From b437a214e873232e33c6cb324b24c0cb09dabc57 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 25 Apr 2018 11:40:12 -0700 Subject: [PATCH] feat: export all types (#1132) --- README.md | 13 +- src/apis/abusiveexperiencereport/v1.ts | 384 +- src/apis/acceleratedmobilepageurl/v1.ts | 304 +- src/apis/adexchangebuyer/v1.2.ts | 1184 +- src/apis/adexchangebuyer/v1.3.ts | 3552 +- src/apis/adexchangebuyer/v1.4.ts | 7938 +- src/apis/adexchangebuyer2/v2beta1.ts | 8896 +- src/apis/adexchangeseller/v1.1.ts | 2930 +- src/apis/adexchangeseller/v1.ts | 1904 +- src/apis/adexchangeseller/v2.0.ts | 2527 +- src/apis/adexperiencereport/v1.ts | 416 +- src/apis/admin/datatransfer_v1.ts | 891 +- src/apis/admin/directory_v1.ts | 17610 +-- src/apis/admin/reports_v1.ts | 1148 +- src/apis/adsense/v1.4.ts | 6116 +- src/apis/adsensehost/v4.1.ts | 3809 +- src/apis/analytics/v2.4.ts | 821 +- src/apis/analytics/v3.ts | 15764 +- src/apis/analyticsreporting/v4.ts | 1857 +- src/apis/androiddeviceprovisioning/v1.ts | 4299 +- src/apis/androidenterprise/v1.ts | 13281 +- src/apis/androidmanagement/v1.ts | 5557 +- src/apis/androidpublisher/v1.1.ts | 547 +- src/apis/androidpublisher/v1.ts | 339 +- src/apis/androidpublisher/v2.ts | 8383 +- src/apis/appengine/v1.ts | 7970 +- src/apis/appengine/v1alpha.ts | 2999 +- src/apis/appengine/v1beta.ts | 8199 +- src/apis/appengine/v1beta4.ts | 5054 +- src/apis/appengine/v1beta5.ts | 5006 +- src/apis/appsactivity/v1.ts | 629 +- src/apis/appstate/v1.ts | 726 +- src/apis/bigquery/v2.ts | 9092 +- src/apis/bigquerydatatransfer/v1.ts | 4478 +- src/apis/blogger/v2.ts | 1640 +- src/apis/blogger/v3.ts | 4750 +- src/apis/books/v1.ts | 7897 +- src/apis/calendar/v3.ts | 6341 +- src/apis/chat/v1.ts | 1809 +- src/apis/civicinfo/v2.ts | 2156 +- src/apis/classroom/v1.ts | 8948 +- src/apis/cloudbilling/v1.ts | 3393 +- src/apis/cloudbuild/v1.ts | 3019 +- src/apis/clouddebugger/v2.ts | 3151 +- src/apis/clouderrorreporting/v1beta1.ts | 1513 +- src/apis/cloudfunctions/v1.ts | 2210 +- src/apis/cloudfunctions/v1beta2.ts | 2254 +- src/apis/cloudiot/v1.ts | 2966 +- src/apis/cloudkms/v1.ts | 3631 +- src/apis/cloudresourcemanager/v1.ts | 10536 +- src/apis/cloudresourcemanager/v1beta1.ts | 4491 +- src/apis/cloudresourcemanager/v2.ts | 2134 +- src/apis/cloudresourcemanager/v2beta1.ts | 2139 +- src/apis/cloudshell/v1.ts | 908 +- src/apis/cloudshell/v1alpha1.ts | 1028 +- src/apis/cloudtasks/v2beta2.ts | 6825 +- src/apis/cloudtrace/v1.ts | 980 +- src/apis/cloudtrace/v2.ts | 1108 +- src/apis/compute/alpha.ts | 86013 +++++------ src/apis/compute/beta.ts | 113093 ++++++++------- src/apis/compute/v1.ts | 93048 ++++++------ src/apis/container/v1.ts | 14130 +- src/apis/container/v1beta1.ts | 10695 +- src/apis/content/v2.ts | 19123 +-- src/apis/content/v2sandbox.ts | 5895 +- src/apis/customsearch/v1.ts | 571 +- src/apis/dataflow/v1b3.ts | 9571 +- src/apis/dataproc/v1.ts | 5855 +- src/apis/dataproc/v1beta2.ts | 8012 +- src/apis/datastore/v1.ts | 3613 +- src/apis/datastore/v1beta1.ts | 1061 +- src/apis/datastore/v1beta3.ts | 2643 +- src/apis/deploymentmanager/alpha.ts | 7105 +- src/apis/deploymentmanager/v2.ts | 6067 +- src/apis/deploymentmanager/v2beta.ts | 6396 +- src/apis/dfareporting/v2.8.ts | 62132 ++++---- src/apis/dfareporting/v3.0.ts | 40325 ++--- src/apis/dialogflow/v2.ts | 8653 +- src/apis/dialogflow/v2beta1.ts | 10512 +- src/apis/digitalassetlinks/v1.ts | 712 +- src/apis/discovery/v1.ts | 906 +- src/apis/dlp/v2.ts | 10436 +- src/apis/dlp/v2beta1.ts | 5663 +- src/apis/dlp/v2beta2.ts | 10577 +- src/apis/dns/v1.ts | 3951 +- src/apis/dns/v1beta2.ts | 2863 +- src/apis/dns/v2beta1.ts | 4724 +- src/apis/doubleclickbidmanager/v1.ts | 1898 +- src/apis/doubleclicksearch/v2.ts | 2158 +- src/apis/drive/v2.ts | 10656 +- src/apis/drive/v3.ts | 6345 +- src/apis/firebasedynamiclinks/v1.ts | 1636 +- src/apis/firebaserules/v1.ts | 1995 +- src/apis/firestore/v1beta1.ts | 3986 +- src/apis/fitness/v1.ts | 2817 +- src/apis/fusiontables/v1.ts | 4624 +- src/apis/fusiontables/v2.ts | 4974 +- src/apis/games/v1.ts | 11755 +- .../gamesConfiguration/v1configuration.ts | 2137 +- src/apis/gamesManagement/v1management.ts | 3682 +- src/apis/genomics/v1.ts | 16544 +-- src/apis/genomics/v1alpha2.ts | 3811 +- src/apis/genomics/v2alpha1.ts | 2049 +- src/apis/gmail/v1.ts | 8698 +- src/apis/groupsmigration/v1.ts | 207 +- src/apis/groupssettings/v1.ts | 661 +- src/apis/iam/v1.ts | 4759 +- src/apis/identitytoolkit/v3.ts | 5106 +- src/apis/index.ts | 404 +- src/apis/kgsearch/v1.ts | 229 +- src/apis/language/v1.ts | 1715 +- src/apis/language/v1beta1.ts | 1345 +- src/apis/language/v1beta2.ts | 1715 +- src/apis/licensing/v1.ts | 969 +- src/apis/logging/v2.ts | 10649 +- src/apis/logging/v2beta1.ts | 6818 +- src/apis/manufacturers/v1.ts | 1343 +- src/apis/mirror/v1.ts | 4026 +- src/apis/ml/v1.ts | 5691 +- src/apis/monitoring/v3.ts | 9094 +- src/apis/oauth2/v1.ts | 1092 +- src/apis/oauth2/v2.ts | 677 +- src/apis/oslogin/v1.ts | 914 +- src/apis/oslogin/v1alpha.ts | 914 +- src/apis/oslogin/v1beta.ts | 914 +- src/apis/pagespeedonline/v1.ts | 299 +- src/apis/pagespeedonline/v2.ts | 373 +- src/apis/pagespeedonline/v4.ts | 402 +- src/apis/partners/v2.ts | 4794 +- src/apis/people/v1.ts | 3889 +- src/apis/playcustomapp/v1.ts | 236 +- src/apis/plus/v1.ts | 1991 +- src/apis/plusDomains/v1.ts | 3616 +- src/apis/poly/v1.ts | 1255 +- src/apis/prediction/v1.2.ts | 749 +- src/apis/prediction/v1.3.ts | 837 +- src/apis/prediction/v1.4.ts | 877 +- src/apis/prediction/v1.5.ts | 1188 +- src/apis/prediction/v1.6.ts | 2199 +- src/apis/proximitybeacon/v1beta1.ts | 3158 +- src/apis/pubsub/v1.ts | 7331 +- src/apis/pubsub/v1beta1a.ts | 2248 +- src/apis/pubsub/v1beta2.ts | 2942 +- src/apis/replicapool/v1beta1.ts | 2160 +- src/apis/replicapool/v1beta2.ts | 2047 +- src/apis/replicapoolupdater/v1beta1.ts | 1733 +- src/apis/reseller/v1.ts | 2655 +- src/apis/resourceviews/v1beta1.ts | 1923 +- src/apis/resourceviews/v1beta2.ts | 1938 +- src/apis/runtimeconfig/v1.ts | 642 +- src/apis/runtimeconfig/v1beta1.ts | 3348 +- src/apis/safebrowsing/v4.ts | 1890 +- src/apis/script/v1.ts | 3105 +- src/apis/searchconsole/v1.ts | 368 +- src/apis/serviceconsumermanagement/v1.ts | 5456 +- src/apis/servicecontrol/v1.ts | 2869 +- src/apis/servicemanagement/v1.ts | 7687 +- src/apis/serviceusage/v1beta1.ts | 4929 +- src/apis/serviceuser/v1.ts | 4380 +- src/apis/sheets/v4.ts | 12033 +- src/apis/siteVerification/v1.ts | 962 +- src/apis/slides/v1.ts | 6418 +- src/apis/sourcerepo/v1.ts | 1243 +- src/apis/spanner/v1.ts | 7815 +- src/apis/spectrum/v1explorer.ts | 2779 +- src/apis/speech/v1.ts | 954 +- src/apis/speech/v1beta1.ts | 867 +- src/apis/sqladmin/v1beta3.ts | 4750 +- src/apis/sqladmin/v1beta4.ts | 7429 +- src/apis/storage/v1.ts | 12392 +- src/apis/storage/v1beta1.ts | 3299 +- src/apis/storage/v1beta2.ts | 4918 +- src/apis/storagetransfer/v1.ts | 3743 +- src/apis/streetviewpublish/v1.ts | 1833 +- src/apis/surveys/v2.ts | 2019 +- src/apis/tagmanager/v1.ts | 7955 +- src/apis/tagmanager/v2.ts | 11151 +- src/apis/taskqueue/v1beta1.ts | 757 +- src/apis/taskqueue/v1beta2.ts | 1101 +- src/apis/tasks/v1.ts | 1850 +- src/apis/testing/v1.ts | 2647 +- src/apis/texttospeech/v1beta1.ts | 590 +- src/apis/toolresults/v1beta3.ts | 5833 +- src/apis/tpu/v1alpha1.ts | 2798 +- src/apis/translate/v2.ts | 872 +- src/apis/urlshortener/v1.ts | 612 +- src/apis/vault/v1.ts | 2493 +- src/apis/videointelligence/v1.ts | 2843 +- src/apis/videointelligence/v1beta1.ts | 2232 +- src/apis/videointelligence/v1beta2.ts | 2285 +- src/apis/vision/v1.ts | 4493 +- src/apis/vision/v1p1beta1.ts | 3668 +- src/apis/vision/v1p2beta1.ts | 2646 +- src/apis/webfonts/v1.ts | 274 +- src/apis/webmasters/v3.ts | 2031 +- src/apis/websecurityscanner/v1alpha.ts | 1282 + src/apis/youtube/v3.ts | 18972 +-- src/apis/youtubeAnalytics/v1.ts | 1093 +- src/apis/youtubeAnalytics/v1beta1.ts | 1093 +- src/apis/youtubeAnalytics/v2.ts | 1543 +- src/apis/youtubereporting/v1.ts | 1859 +- src/index.ts | 202 + src/scripts/generator.ts | 5 + src/templates/api-endpoint.njk | 5 + src/templates/index.njk | 2 +- src/templates/root-index.njk | 26 + test/test.clients.ts | 13 +- 207 files changed, 598408 insertions(+), 589588 deletions(-) create mode 100644 src/apis/websecurityscanner/v1alpha.ts create mode 100644 src/templates/root-index.njk diff --git a/README.md b/README.md index 9a41194462c..7d11939055f 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ * [Request Options](#request-options) * [Using a Proxy](#using-a-proxy) * [Supported APIs](#getting-supported-apis) + * [TypeScript](#typescript) * [License](#license) * [Contributing](#contributing) * [Questions/problems?](#questionsproblems) @@ -461,7 +462,17 @@ const {google} = require('googleapis'); const apis = google.getSupportedAPIs(); ``` -This will return an object with the API name as object property names, and an array of version strings as the object values; +This will return an object with the API name as object property names, and an array of version strings as the object values; + +### TypeScript +This library is written in TypeScript, and provides types out of the box. Due to the shape of the API, in some cases you may need to use generics to get the appropriate types. This is only an issue for APIs that include multiple versions. For example, to use the Drive v3 API: + +```ts +import {google, drive_v3} from 'googleapis'; +const drive = google.drive('v3'); +``` + +All classes and interfaces generated for each API are exported under the `apiName_version` namespace. ## Release Notes & Breaking Changes You can find a detailed list of breaking changes and new features in our [Release Notes][releasenotes]. If you've used this library before `25.x`, see our [Release Notes][releasenotes] to learn about migrating your code from `24.x.x` to `25.x.x`. It's pretty easy :) diff --git a/src/apis/abusiveexperiencereport/v1.ts b/src/apis/abusiveexperiencereport/v1.ts index 36d1b94cbcb..ef771d5a160 100644 --- a/src/apis/abusiveexperiencereport/v1.ts +++ b/src/apis/abusiveexperiencereport/v1.ts @@ -27,216 +27,222 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Abusive Experience Report API - * - * View Abusive Experience Report data, and get a list of sites that have a - * significant number of abusive experiences. - * - * @example - * const google = require('googleapis'); - * const abusiveexperiencereport = google.abusiveexperiencereport('v1'); - * - * @namespace abusiveexperiencereport - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Abusiveexperiencereport - */ -export class Abusiveexperiencereport { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace abusiveexperiencereport_v1 { + /** + * Abusive Experience Report API + * + * View Abusive Experience Report data, and get a list of sites that have a + * significant number of abusive experiences. + * + * @example + * const google = require('googleapis'); + * const abusiveexperiencereport = google.abusiveexperiencereport('v1'); + * + * @namespace abusiveexperiencereport + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Abusiveexperiencereport + */ + export class Abusiveexperiencereport { + _options: GlobalOptions; + google: GoogleApis; + root = this; - sites: Resource$Sites; - violatingSites: Resource$Violatingsites; + sites: Resource$Sites; + violatingSites: Resource$Violatingsites; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.sites = new Resource$Sites(this); - this.violatingSites = new Resource$Violatingsites(this); - } + this.sites = new Resource$Sites(this); + this.violatingSites = new Resource$Violatingsites(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Response message for GetSiteSummary. Do not confuse with same message in - * google.ads.experiencereport.v1 - */ -export interface Schema$SiteSummaryResponse { - /** - * The status of the site reviewed for the abusive experiences. - */ - abusiveStatus: string; /** - * The date on which enforcement begins. + * Response message for GetSiteSummary. Do not confuse with same message in + * google.ads.experiencereport.v1 */ - enforcementTime: string; - /** - * The abusive experience enforcement status of the site. - */ - filterStatus: string; - /** - * The last time that the site changed status. - */ - lastChangeTime: string; - /** - * A link that leads to a full abusive experience report. - */ - reportUrl: string; - /** - * The name of the site reviewed. - */ - reviewedSite: string; - /** - * Whether the site is currently under review. - */ - underReview: boolean; -} -/** - * Response message for ListViolatingSites. - */ -export interface Schema$ViolatingSitesResponse { + export interface Schema$SiteSummaryResponse { + /** + * The status of the site reviewed for the abusive experiences. + */ + abusiveStatus: string; + /** + * The date on which enforcement begins. + */ + enforcementTime: string; + /** + * The abusive experience enforcement status of the site. + */ + filterStatus: string; + /** + * The last time that the site changed status. + */ + lastChangeTime: string; + /** + * A link that leads to a full abusive experience report. + */ + reportUrl: string; + /** + * The name of the site reviewed. + */ + reviewedSite: string; + /** + * Whether the site is currently under review. + */ + underReview: boolean; + } /** - * A list of summaries of violating sites. + * Response message for ListViolatingSites. */ - violatingSites: Schema$SiteSummaryResponse[]; -} - -export class Resource$Sites { - root: Abusiveexperiencereport; - constructor(root: Abusiveexperiencereport) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ViolatingSitesResponse { + /** + * A list of summaries of violating sites. + */ + violatingSites: Schema$SiteSummaryResponse[]; } - getRoot() { - return this.root; - } - - - /** - * abusiveexperiencereport.sites.get - * @desc Gets a summary of the abusive experience rating of a site. - * @alias abusiveexperiencereport.sites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The required site name. This is the site property whose abusive experiences have been reviewed, and it must be URL-encoded. For example, sites/https%3A%2F%2Fwww.google.com. The server will return an error of BAD_REQUEST if this field is not filled in. Note that if the site property is not yet verified in Search Console, the reportUrl field returned by the API will lead to the verification page, prompting the user to go through that process before they can gain access to the Abusive Experience Report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Sites { + root: Abusiveexperiencereport; + constructor(root: Abusiveexperiencereport) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://abusiveexperiencereport.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Violatingsites { - root: Abusiveexperiencereport; - constructor(root: Abusiveexperiencereport) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * abusiveexperiencereport.sites.get + * @desc Gets a summary of the abusive experience rating of a site. + * @alias abusiveexperiencereport.sites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The required site name. This is the site property whose abusive experiences have been reviewed, and it must be URL-encoded. For example, sites/https%3A%2F%2Fwww.google.com. The server will return an error of BAD_REQUEST if this field is not filled in. Note that if the site property is not yet verified in Search Console, the reportUrl field returned by the API will lead to the verification page, prompting the user to go through that process before they can gain access to the Abusive Experience Report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://abusiveexperiencereport.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * abusiveexperiencereport.violatingSites.list - * @desc Lists sites with Abusive Experience Report statuses of "Failing". - * @alias abusiveexperiencereport.violatingSites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Violatingsites { + root: Abusiveexperiencereport; + constructor(root: Abusiveexperiencereport) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://abusiveexperiencereport.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/violatingSites').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * abusiveexperiencereport.violatingSites.list + * @desc Lists sites with Abusive Experience Report statuses of "Failing". + * @alias abusiveexperiencereport.violatingSites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://abusiveexperiencereport.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/violatingSites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/acceleratedmobilepageurl/v1.ts b/src/apis/acceleratedmobilepageurl/v1.ts index 5a8f31a0b25..79619da529a 100644 --- a/src/apis/acceleratedmobilepageurl/v1.ts +++ b/src/apis/acceleratedmobilepageurl/v1.ts @@ -27,175 +27,179 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Accelerated Mobile Pages (AMP) URL API - * - * Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given - * list of public URL(s). - * - * @example - * const google = require('googleapis'); - * const acceleratedmobilepageurl = google.acceleratedmobilepageurl('v1'); - * - * @namespace acceleratedmobilepageurl - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Acceleratedmobilepageurl - */ -export class Acceleratedmobilepageurl { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace acceleratedmobilepageurl_v1 { + /** + * Accelerated Mobile Pages (AMP) URL API + * + * Retrieves the list of AMP URLs (and equivalent AMP Cache URLs) for a given + * list of public URL(s). + * + * @example + * const google = require('googleapis'); + * const acceleratedmobilepageurl = google.acceleratedmobilepageurl('v1'); + * + * @namespace acceleratedmobilepageurl + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Acceleratedmobilepageurl + */ + export class Acceleratedmobilepageurl { + _options: GlobalOptions; + google: GoogleApis; + root = this; - ampUrls: Resource$Ampurls; + ampUrls: Resource$Ampurls; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.ampUrls = new Resource$Ampurls(this); - } + this.ampUrls = new Resource$Ampurls(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * AMP URL response for a requested URL. - */ -export interface Schema$AmpUrl { - /** - * The AMP URL pointing to the publisher's web server. - */ - ampUrl: string; - /** - * The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to - * the cached document in the Google AMP Cache. - */ - cdnAmpUrl: string; /** - * The original non-AMP URL. + * AMP URL response for a requested URL. */ - originalUrl: string; -} -/** - * AMP URL Error resource for a requested URL that couldn't be found. - */ -export interface Schema$AmpUrlError { - /** - * The error code of an API call. - */ - errorCode: string; - /** - * An optional descriptive error message. - */ - errorMessage: string; - /** - * The original non-AMP URL. - */ - originalUrl: string; -} -/** - * AMP URL request for a batch of URLs. - */ -export interface Schema$BatchGetAmpUrlsRequest { - /** - * The lookup_strategy being requested. - */ - lookupStrategy: string; + export interface Schema$AmpUrl { + /** + * The AMP URL pointing to the publisher's web server. + */ + ampUrl: string; + /** + * The [AMP Cache URL](/amp/cache/overview#amp-cache-url-format) pointing to + * the cached document in the Google AMP Cache. + */ + cdnAmpUrl: string; + /** + * The original non-AMP URL. + */ + originalUrl: string; + } /** - * List of URLs to look up for the paired AMP URLs. The URLs are - * case-sensitive. Up to 50 URLs per lookup (see [Usage - * Limits](/amp/cache/reference/limits)). + * AMP URL Error resource for a requested URL that couldn't be found. */ - urls: string[]; -} -/** - * Batch AMP URL response. - */ -export interface Schema$BatchGetAmpUrlsResponse { + export interface Schema$AmpUrlError { + /** + * The error code of an API call. + */ + errorCode: string; + /** + * An optional descriptive error message. + */ + errorMessage: string; + /** + * The original non-AMP URL. + */ + originalUrl: string; + } /** - * For each URL in BatchAmpUrlsRequest, the URL response. The response might - * not be in the same order as URLs in the batch request. If - * BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated only once. + * AMP URL request for a batch of URLs. */ - ampUrls: Schema$AmpUrl[]; + export interface Schema$BatchGetAmpUrlsRequest { + /** + * The lookup_strategy being requested. + */ + lookupStrategy: string; + /** + * List of URLs to look up for the paired AMP URLs. The URLs are + * case-sensitive. Up to 50 URLs per lookup (see [Usage + * Limits](/amp/cache/reference/limits)). + */ + urls: string[]; + } /** - * The errors for requested URLs that have no AMP URL. + * Batch AMP URL response. */ - urlErrors: Schema$AmpUrlError[]; -} - -export class Resource$Ampurls { - root: Acceleratedmobilepageurl; - constructor(root: Acceleratedmobilepageurl) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$BatchGetAmpUrlsResponse { + /** + * For each URL in BatchAmpUrlsRequest, the URL response. The response might + * not be in the same order as URLs in the batch request. If + * BatchAmpUrlsRequest contains duplicate URLs, AmpUrl is generated only + * once. + */ + ampUrls: Schema$AmpUrl[]; + /** + * The errors for requested URLs that have no AMP URL. + */ + urlErrors: Schema$AmpUrlError[]; } - getRoot() { - return this.root; - } - - - /** - * acceleratedmobilepageurl.ampUrls.batchGet - * @desc Returns AMP URL(s) and equivalent [AMP Cache - * URL(s)](/amp/cache/overview#amp-cache-url-format). - * @alias acceleratedmobilepageurl.ampUrls.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BatchGetAmpUrlsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Ampurls { + root: Acceleratedmobilepageurl; + constructor(root: Acceleratedmobilepageurl) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://acceleratedmobilepageurl.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/ampUrls:batchGet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * acceleratedmobilepageurl.ampUrls.batchGet + * @desc Returns AMP URL(s) and equivalent [AMP Cache + * URL(s)](/amp/cache/overview#amp-cache-url-format). + * @alias acceleratedmobilepageurl.ampUrls.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BatchGetAmpUrlsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://acceleratedmobilepageurl.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/ampUrls:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexchangebuyer/v1.2.ts b/src/apis/adexchangebuyer/v1.2.ts index b39c1202c4b..7d44967a675 100644 --- a/src/apis/adexchangebuyer/v1.2.ts +++ b/src/apis/adexchangebuyer/v1.2.ts @@ -27,631 +27,637 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Buyer API - * - * Accesses your bidding-account information, submits creatives for validation, - * finds available direct deals, and retrieves performance reports. - * - * @example - * const google = require('googleapis'); - * const adexchangebuyer = google.adexchangebuyer('v1.2'); - * - * @namespace adexchangebuyer - * @type {Function} - * @version v1.2 - * @variation v1.2 - * @param {object=} options Options for Adexchangebuyer - */ -export class Adexchangebuyer { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace adexchangebuyer_v1_2 { + /** + * Ad Exchange Buyer API + * + * Accesses your bidding-account information, submits creatives for + * validation, finds available direct deals, and retrieves performance + * reports. + * + * @example + * const google = require('googleapis'); + * const adexchangebuyer = google.adexchangebuyer('v1.2'); + * + * @namespace adexchangebuyer + * @type {Function} + * @version v1.2 + * @variation v1.2 + * @param {object=} options Options for Adexchangebuyer + */ + export class Adexchangebuyer { + _options: GlobalOptions; + google: GoogleApis; + root = this; - accounts: Resource$Accounts; - creatives: Resource$Creatives; + accounts: Resource$Accounts; + creatives: Resource$Creatives; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.accounts = new Resource$Accounts(this); - this.creatives = new Resource$Creatives(this); - } + this.accounts = new Resource$Accounts(this); + this.creatives = new Resource$Creatives(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Configuration data for an Ad Exchange buyer account. - */ -export interface Schema$Account { - /** - * Your bidder locations that have distinct URLs. - */ - bidderLocation: any[]; - /** - * The nid parameter value used in cookie match requests. Please contact your - * technical account manager if you need to change this. - */ - cookieMatchingNid: string; - /** - * The base URL used in cookie match requests. - */ - cookieMatchingUrl: string; - /** - * Account id. - */ - id: number; - /** - * Resource type. - */ - kind: string; - /** - * The maximum number of active creatives that an account can have, where a - * creative is active if it was inserted or bid with in the last 30 days. - * Please contact your technical account manager if you need to change this. - */ - maximumActiveCreatives: number; - /** - * The sum of all bidderLocation.maximumQps values cannot exceed this. Please - * contact your technical account manager if you need to change this. - */ - maximumTotalQps: number; - /** - * The number of creatives that this account inserted or bid with in the last - * 30 days. - */ - numberActiveCreatives: number; -} -/** - * An account feed lists Ad Exchange buyer accounts that the user has access to. - * Each entry in the feed corresponds to a single buyer account. - */ -export interface Schema$AccountsList { - /** - * A list of accounts. - */ - items: Schema$Account[]; - /** - * Resource type. - */ - kind: string; -} -/** - * A creative and its classification data. - */ -export interface Schema$Creative { - /** - * Account id. - */ - accountId: number; - /** - * Detected advertiser id, if any. Read-only. This field should not be set in - * requests. - */ - advertiserId: string[]; - /** - * The name of the company being advertised in the creative. - */ - advertiserName: string; - /** - * The agency id for this creative. - */ - agencyId: string; - /** - * The last upload timestamp of this creative if it was uploaded via API. - * Read-only. The value of this field is generated, and will be ignored for - * uploads. (formatted RFC 3339 timestamp). - */ - apiUploadTimestamp: string; - /** - * All attributes for the ads that may be shown from this snippet. - */ - attribute: number[]; - /** - * A buyer-specific id identifying the creative in this ad. - */ - buyerCreativeId: string; - /** - * The set of destination urls for the snippet. - */ - clickThroughUrl: string[]; - /** - * Shows any corrections that were applied to this creative. Read-only. This - * field should not be set in requests. - */ - corrections: any[]; - /** - * The reasons for disapproval, if any. Note that not all disapproval reasons - * may be categorized, so it is possible for the creative to have a status of - * DISAPPROVED with an empty list for disapproval_reasons. In this case, - * please reach out to your TAM to help debug the issue. Read-only. This field - * should not be set in requests. - */ - disapprovalReasons: any[]; - /** - * The filtering reasons for the creative. Read-only. This field should not be - * set in requests. - */ - filteringReasons: any; - /** - * Ad height. - */ - height: number; - /** - * The HTML snippet that displays the ad when inserted in the web page. If - * set, videoURL should not be set. - */ - HTMLSnippet: string; - /** - * The set of urls to be called to record an impression. - */ - impressionTrackingUrl: string[]; - /** - * Resource type. - */ - kind: string; - /** - * Detected product categories, if any. Read-only. This field should not be - * set in requests. - */ - productCategories: number[]; /** - * All restricted categories for the ads that may be shown from this snippet. - */ - restrictedCategories: number[]; - /** - * Detected sensitive categories, if any. Read-only. This field should not be - * set in requests. - */ - sensitiveCategories: number[]; - /** - * Creative serving status. Read-only. This field should not be set in - * requests. - */ - status: string; - /** - * All vendor types for the ads that may be shown from this snippet. - */ - vendorType: number[]; - /** - * The version for this creative. Read-only. This field should not be set in - * requests. - */ - version: number; - /** - * The url to fetch a video ad. If set, HTMLSnippet should not be set. - */ - videoURL: string; - /** - * Ad width. - */ - width: number; -} -/** - * The creatives feed lists the active creatives for the Ad Exchange buyer - * accounts that the user has access to. Each entry in the feed corresponds to a - * single creative. - */ -export interface Schema$CreativesList { - /** - * A list of creatives. - */ - items: Schema$Creative[]; + * Configuration data for an Ad Exchange buyer account. + */ + export interface Schema$Account { + /** + * Your bidder locations that have distinct URLs. + */ + bidderLocation: any[]; + /** + * The nid parameter value used in cookie match requests. Please contact + * your technical account manager if you need to change this. + */ + cookieMatchingNid: string; + /** + * The base URL used in cookie match requests. + */ + cookieMatchingUrl: string; + /** + * Account id. + */ + id: number; + /** + * Resource type. + */ + kind: string; + /** + * The maximum number of active creatives that an account can have, where a + * creative is active if it was inserted or bid with in the last 30 days. + * Please contact your technical account manager if you need to change this. + */ + maximumActiveCreatives: number; + /** + * The sum of all bidderLocation.maximumQps values cannot exceed this. + * Please contact your technical account manager if you need to change this. + */ + maximumTotalQps: number; + /** + * The number of creatives that this account inserted or bid with in the + * last 30 days. + */ + numberActiveCreatives: number; + } /** - * Resource type. - */ - kind: string; + * An account feed lists Ad Exchange buyer accounts that the user has access + * to. Each entry in the feed corresponds to a single buyer account. + */ + export interface Schema$AccountsList { + /** + * A list of accounts. + */ + items: Schema$Account[]; + /** + * Resource type. + */ + kind: string; + } /** - * Continuation token used to page through creatives. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} - -export class Resource$Accounts { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); + * A creative and its classification data. + */ + export interface Schema$Creative { + /** + * Account id. + */ + accountId: number; + /** + * Detected advertiser id, if any. Read-only. This field should not be set + * in requests. + */ + advertiserId: string[]; + /** + * The name of the company being advertised in the creative. + */ + advertiserName: string; + /** + * The agency id for this creative. + */ + agencyId: string; + /** + * The last upload timestamp of this creative if it was uploaded via API. + * Read-only. The value of this field is generated, and will be ignored for + * uploads. (formatted RFC 3339 timestamp). + */ + apiUploadTimestamp: string; + /** + * All attributes for the ads that may be shown from this snippet. + */ + attribute: number[]; + /** + * A buyer-specific id identifying the creative in this ad. + */ + buyerCreativeId: string; + /** + * The set of destination urls for the snippet. + */ + clickThroughUrl: string[]; + /** + * Shows any corrections that were applied to this creative. Read-only. This + * field should not be set in requests. + */ + corrections: any[]; + /** + * The reasons for disapproval, if any. Note that not all disapproval + * reasons may be categorized, so it is possible for the creative to have a + * status of DISAPPROVED with an empty list for disapproval_reasons. In this + * case, please reach out to your TAM to help debug the issue. Read-only. + * This field should not be set in requests. + */ + disapprovalReasons: any[]; + /** + * The filtering reasons for the creative. Read-only. This field should not + * be set in requests. + */ + filteringReasons: any; + /** + * Ad height. + */ + height: number; + /** + * The HTML snippet that displays the ad when inserted in the web page. If + * set, videoURL should not be set. + */ + HTMLSnippet: string; + /** + * The set of urls to be called to record an impression. + */ + impressionTrackingUrl: string[]; + /** + * Resource type. + */ + kind: string; + /** + * Detected product categories, if any. Read-only. This field should not be + * set in requests. + */ + productCategories: number[]; + /** + * All restricted categories for the ads that may be shown from this + * snippet. + */ + restrictedCategories: number[]; + /** + * Detected sensitive categories, if any. Read-only. This field should not + * be set in requests. + */ + sensitiveCategories: number[]; + /** + * Creative serving status. Read-only. This field should not be set in + * requests. + */ + status: string; + /** + * All vendor types for the ads that may be shown from this snippet. + */ + vendorType: number[]; + /** + * The version for this creative. Read-only. This field should not be set in + * requests. + */ + version: number; + /** + * The url to fetch a video ad. If set, HTMLSnippet should not be set. + */ + videoURL: string; + /** + * Ad width. + */ + width: number; } - - getRoot() { - return this.root; + /** + * The creatives feed lists the active creatives for the Ad Exchange buyer + * accounts that the user has access to. Each entry in the feed corresponds to + * a single creative. + */ + export interface Schema$CreativesList { + /** + * A list of creatives. + */ + items: Schema$Creative[]; + /** + * Resource type. + */ + kind: string; + /** + * Continuation token used to page through creatives. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - /** - * adexchangebuyer.accounts.get - * @desc Gets one account by ID. - * @alias adexchangebuyer.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Accounts { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.accounts.list - * @desc Retrieves the authenticated user's list of accounts. - * @alias adexchangebuyer.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.accounts.get + * @desc Gets one account by ID. + * @alias adexchangebuyer.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.accounts.patch - * @desc Updates an existing account. This method supports patch semantics. - * @alias adexchangebuyer.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.accounts.list + * @desc Retrieves the authenticated user's list of accounts. + * @alias adexchangebuyer.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.accounts.update - * @desc Updates an existing account. - * @alias adexchangebuyer.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.accounts.patch + * @desc Updates an existing account. This method supports patch semantics. + * @alias adexchangebuyer.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Creatives { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.accounts.update + * @desc Updates an existing account. + * @alias adexchangebuyer.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.creatives.get - * @desc Gets the status for a single creative. A creative will be available - * 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Creatives { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.2/creatives/{accountId}/{buyerCreativeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId'], - pathParams: ['accountId', 'buyerCreativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.creatives.insert - * @desc Submit a new creative. - * @alias adexchangebuyer.creatives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.creatives.get + * @desc Gets the status for a single creative. A creative will be available + * 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.2/creatives/{accountId}/{buyerCreativeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId'], + pathParams: ['accountId', 'buyerCreativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.creatives.list - * @desc Retrieves a list of the authenticated user's active creatives. A - * creative will be available 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. - * @param {string=} params.statusFilter When specified, only creatives having the given status are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.creatives.insert + * @desc Submit a new creative. + * @alias adexchangebuyer.creatives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.2/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangebuyer.creatives.list + * @desc Retrieves a list of the authenticated user's active creatives. A + * creative will be available 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * @param {string=} params.statusFilter When specified, only creatives having the given status are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.2/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexchangebuyer/v1.3.ts b/src/apis/adexchangebuyer/v1.3.ts index 782bcc0a32f..a5791671379 100644 --- a/src/apis/adexchangebuyer/v1.3.ts +++ b/src/apis/adexchangebuyer/v1.3.ts @@ -27,1873 +27,1887 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Buyer API - * - * Accesses your bidding-account information, submits creatives for validation, - * finds available direct deals, and retrieves performance reports. - * - * @example - * const google = require('googleapis'); - * const adexchangebuyer = google.adexchangebuyer('v1.3'); - * - * @namespace adexchangebuyer - * @type {Function} - * @version v1.3 - * @variation v1.3 - * @param {object=} options Options for Adexchangebuyer - */ -export class Adexchangebuyer { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - billingInfo: Resource$Billinginfo; - budget: Resource$Budget; - creatives: Resource$Creatives; - directDeals: Resource$Directdeals; - performanceReport: Resource$Performancereport; - pretargetingConfig: Resource$Pretargetingconfig; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.billingInfo = new Resource$Billinginfo(this); - this.budget = new Resource$Budget(this); - this.creatives = new Resource$Creatives(this); - this.directDeals = new Resource$Directdeals(this); - this.performanceReport = new Resource$Performancereport(this); - this.pretargetingConfig = new Resource$Pretargetingconfig(this); - } +export namespace adexchangebuyer_v1_3 { + /** + * Ad Exchange Buyer API + * + * Accesses your bidding-account information, submits creatives for + * validation, finds available direct deals, and retrieves performance + * reports. + * + * @example + * const google = require('googleapis'); + * const adexchangebuyer = google.adexchangebuyer('v1.3'); + * + * @namespace adexchangebuyer + * @type {Function} + * @version v1.3 + * @variation v1.3 + * @param {object=} options Options for Adexchangebuyer + */ + export class Adexchangebuyer { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + billingInfo: Resource$Billinginfo; + budget: Resource$Budget; + creatives: Resource$Creatives; + directDeals: Resource$Directdeals; + performanceReport: Resource$Performancereport; + pretargetingConfig: Resource$Pretargetingconfig; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.billingInfo = new Resource$Billinginfo(this); + this.budget = new Resource$Budget(this); + this.creatives = new Resource$Creatives(this); + this.directDeals = new Resource$Directdeals(this); + this.performanceReport = new Resource$Performancereport(this); + this.pretargetingConfig = new Resource$Pretargetingconfig(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Configuration data for an Ad Exchange buyer account. - */ -export interface Schema$Account { - /** - * Your bidder locations that have distinct URLs. - */ - bidderLocation: any[]; - /** - * The nid parameter value used in cookie match requests. Please contact your - * technical account manager if you need to change this. - */ - cookieMatchingNid: string; - /** - * The base URL used in cookie match requests. - */ - cookieMatchingUrl: string; - /** - * Account id. - */ - id: number; - /** - * Resource type. - */ - kind: string; - /** - * The maximum number of active creatives that an account can have, where a - * creative is active if it was inserted or bid with in the last 30 days. - * Please contact your technical account manager if you need to change this. - */ - maximumActiveCreatives: number; - /** - * The sum of all bidderLocation.maximumQps values cannot exceed this. Please - * contact your technical account manager if you need to change this. - */ - maximumTotalQps: number; - /** - * The number of creatives that this account inserted or bid with in the last - * 30 days. - */ - numberActiveCreatives: number; -} -/** - * An account feed lists Ad Exchange buyer accounts that the user has access to. - * Each entry in the feed corresponds to a single buyer account. - */ -export interface Schema$AccountsList { - /** - * A list of accounts. - */ - items: Schema$Account[]; - /** - * Resource type. - */ - kind: string; -} -/** - * The configuration data for an Ad Exchange billing info. - */ -export interface Schema$BillingInfo { - /** - * Account id. - */ - accountId: number; - /** - * Account name. - */ - accountName: string; - /** - * A list of adgroup IDs associated with this particular account. These IDs - * may show up as part of a realtime bidding BidRequest, which indicates a bid - * request for this account. - */ - billingId: string[]; - /** - * Resource type. - */ - kind: string; -} -/** - * A billing info feed lists Billing Info the Ad Exchange buyer account has - * access to. Each entry in the feed corresponds to a single billing info. - */ -export interface Schema$BillingInfoList { - /** - * A list of billing info relevant for your account. - */ - items: Schema$BillingInfo[]; - /** - * Resource type. - */ - kind: string; -} -/** - * The configuration data for Ad Exchange RTB - Budget API. - */ -export interface Schema$Budget { - /** - * The id of the account. This is required for get and update requests. - */ - accountId: string; - /** - * The billing id to determine which adgroup to provide budget information - * for. This is required for get and update requests. - */ - billingId: string; - /** - * The daily budget amount in unit amount of the account currency to apply for - * the billingId provided. This is required for update requests. - */ - budgetAmount: string; - /** - * The currency code for the buyer. This cannot be altered here. - */ - currencyCode: string; - /** - * The unique id that describes this item. - */ - id: string; - /** - * The kind of the resource, i.e. "adexchangebuyer#budget". - */ - kind: string; -} -/** - * A creative and its classification data. - */ -export interface Schema$Creative { - /** - * Account id. - */ - accountId: number; - /** - * Detected advertiser id, if any. Read-only. This field should not be set in - * requests. - */ - advertiserId: string[]; - /** - * The name of the company being advertised in the creative. - */ - advertiserName: string; - /** - * The agency id for this creative. - */ - agencyId: string; - /** - * The last upload timestamp of this creative if it was uploaded via API. - * Read-only. The value of this field is generated, and will be ignored for - * uploads. (formatted RFC 3339 timestamp). - */ - apiUploadTimestamp: string; - /** - * All attributes for the ads that may be shown from this snippet. - */ - attribute: number[]; - /** - * A buyer-specific id identifying the creative in this ad. - */ - buyerCreativeId: string; - /** - * The set of destination urls for the snippet. - */ - clickThroughUrl: string[]; - /** - * Shows any corrections that were applied to this creative. Read-only. This - * field should not be set in requests. - */ - corrections: any[]; - /** - * The reasons for disapproval, if any. Note that not all disapproval reasons - * may be categorized, so it is possible for the creative to have a status of - * DISAPPROVED with an empty list for disapproval_reasons. In this case, - * please reach out to your TAM to help debug the issue. Read-only. This field - * should not be set in requests. - */ - disapprovalReasons: any[]; - /** - * The filtering reasons for the creative. Read-only. This field should not be - * set in requests. - */ - filteringReasons: any; - /** - * Ad height. - */ - height: number; - /** - * The HTML snippet that displays the ad when inserted in the web page. If - * set, videoURL should not be set. - */ - HTMLSnippet: string; - /** - * The set of urls to be called to record an impression. - */ - impressionTrackingUrl: string[]; - /** - * Resource type. - */ - kind: string; - /** - * If nativeAd is set, HTMLSnippet and videoURL should not be set. - */ - nativeAd: any; - /** - * Detected product categories, if any. Read-only. This field should not be - * set in requests. - */ - productCategories: number[]; - /** - * All restricted categories for the ads that may be shown from this snippet. - */ - restrictedCategories: number[]; - /** - * Detected sensitive categories, if any. Read-only. This field should not be - * set in requests. - */ - sensitiveCategories: number[]; - /** - * Creative serving status. Read-only. This field should not be set in - * requests. - */ - status: string; - /** - * All vendor types for the ads that may be shown from this snippet. - */ - vendorType: number[]; - /** - * The version for this creative. Read-only. This field should not be set in - * requests. - */ - version: number; - /** - * The URL to fetch a video ad. If set, HTMLSnippet and the nativeAd should - * not be set. - */ - videoURL: string; - /** - * Ad width. - */ - width: number; -} -/** - * The creatives feed lists the active creatives for the Ad Exchange buyer - * accounts that the user has access to. Each entry in the feed corresponds to a - * single creative. - */ -export interface Schema$CreativesList { - /** - * A list of creatives. - */ - items: Schema$Creative[]; - /** - * Resource type. - */ - kind: string; - /** - * Continuation token used to page through creatives. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -/** - * The configuration data for an Ad Exchange direct deal. - */ -export interface Schema$DirectDeal { - /** - * The account id of the buyer this deal is for. - */ - accountId: number; - /** - * The name of the advertiser this deal is for. - */ - advertiser: string; - /** - * Whether the publisher for this deal is eligible for alcohol ads. - */ - allowsAlcohol: boolean; - /** - * The account id that this deal was negotiated for. It is either the buyer or - * the client that this deal was negotiated on behalf of. - */ - buyerAccountId: string; - /** - * The currency code that applies to the fixed_cpm value. If not set then - * assumed to be USD. - */ - currencyCode: string; - /** - * The deal type such as programmatic reservation or fixed price and so on. - */ - dealTier: string; - /** - * End time for when this deal stops being active. If not set then this deal - * is valid until manually disabled by the publisher. In seconds since the - * epoch. - */ - endTime: string; - /** - * The fixed price for this direct deal. In cpm micros of currency according - * to currency_code. If set, then this deal is eligible for the fixed price - * tier of buying (highest priority, pay exactly the configured fixed price). - */ - fixedCpm: string; - /** - * Deal id. - */ - id: string; - /** - * Resource type. - */ - kind: string; - /** - * Deal name. - */ - name: string; - /** - * The minimum price for this direct deal. In cpm micros of currency according - * to currency_code. If set, then this deal is eligible for the private - * exchange tier of buying (below fixed price priority, run as a second price - * auction). - */ - privateExchangeMinCpm: string; - /** - * If true, the publisher has opted to have their blocks ignored when a - * creative is bid with for this deal. - */ - publisherBlocksOverriden: boolean; - /** - * The name of the publisher offering this direct deal. - */ - sellerNetwork: string; - /** - * Start time for when this deal becomes active. If not set then this deal is - * active immediately upon creation. In seconds since the epoch. - */ - startTime: string; -} -/** - * A direct deals feed lists Direct Deals the Ad Exchange buyer account has - * access to. This includes direct deals set up for the buyer account as well as - * its merged stream seats. - */ -export interface Schema$DirectDealsList { - /** - * A list of direct deals relevant for your account. - */ - directDeals: Schema$DirectDeal[]; - /** - * Resource type. - */ - kind: string; -} -/** - * The configuration data for an Ad Exchange performance report list. - */ -export interface Schema$PerformanceReport { - /** - * The number of bid responses with an ad. - */ - bidRate: number; - /** - * The number of bid requests sent to your bidder. - */ - bidRequestRate: number; - /** - * Rate of various prefiltering statuses per match. Please refer to the - * callout-status-codes.txt file for different statuses. - */ - calloutStatusRate: any[]; - /** - * Average QPS for cookie matcher operations. - */ - cookieMatcherStatusRate: any[]; - /** - * Rate of ads with a given status. Please refer to the - * creative-status-codes.txt file for different statuses. - */ - creativeStatusRate: any[]; - /** - * The number of bid responses that were filtered due to a policy violation or - * other errors. - */ - filteredBidRate: number; - /** - * Average QPS for hosted match operations. - */ - hostedMatchStatusRate: any[]; - /** - * The number of potential queries based on your pretargeting settings. - */ - inventoryMatchRate: number; - /** - * Resource type. - */ - kind: string; - /** - * The 50th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency50thPercentile: number; - /** - * The 85th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency85thPercentile: number; - /** - * The 95th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency95thPercentile: number; - /** - * Rate of various quota account statuses per quota check. - */ - noQuotaInRegion: number; - /** - * Rate of various quota account statuses per quota check. - */ - outOfQuota: number; - /** - * Average QPS for pixel match requests from clients. - */ - pixelMatchRequests: number; - /** - * Average QPS for pixel match responses from clients. - */ - pixelMatchResponses: number; - /** - * The configured quota limits for this account. - */ - quotaConfiguredLimit: number; - /** - * The throttled quota limits for this account. - */ - quotaThrottledLimit: number; - /** - * The trading location of this data. - */ - region: string; - /** - * The number of properly formed bid responses received by our servers within - * the deadline. - */ - successfulRequestRate: number; - /** - * The unix timestamp of the starting time of this performance data. - */ - timestamp: string; /** - * The number of bid responses that were unsuccessful due to timeouts, - * incorrect formatting, etc. - */ - unsuccessfulRequestRate: number; -} -/** - * The configuration data for an Ad Exchange performance report list. - */ -export interface Schema$PerformanceReportList { - /** - * Resource type. - */ - kind: string; - /** - * A list of performance reports relevant for the account. - */ - performanceReport: Schema$PerformanceReport[]; -} -export interface Schema$PretargetingConfig { - /** - * The id for billing purposes, provided for reference. Leave this field blank - * for insert requests; the id will be generated automatically. - */ - billingId: string; - /** - * The config id; generated automatically. Leave this field blank for insert - * requests. - */ - configId: string; - /** - * The name of the config. Must be unique. Required for all requests. - */ - configName: string; - /** - * List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or - * PRETARGETING_CREATIVE_TYPE_VIDEO. - */ - creativeType: string[]; - /** - * Requests which allow one of these (width, height) pairs will match. All - * pairs must be supported ad dimensions. - */ - dimensions: any[]; - /** - * Requests with any of these content labels will not match. Values are from - * content-labels.txt in the downloadable files section. - */ - excludedContentLabels: string[]; - /** - * Requests containing any of these geo criteria ids will not match. - */ - excludedGeoCriteriaIds: string[]; - /** - * Requests containing any of these placements will not match. - */ - excludedPlacements: any[]; - /** - * Requests containing any of these users list ids will not match. - */ - excludedUserLists: string[]; - /** - * Requests containing any of these vertical ids will not match. Values are - * from the publisher-verticals.txt file in the downloadable files section. - */ - excludedVerticals: string[]; - /** - * Requests containing any of these geo criteria ids will match. - */ - geoCriteriaIds: string[]; - /** - * Whether this config is active. Required for all requests. - */ - isActive: boolean; - /** - * The kind of the resource, i.e. - * "adexchangebuyer#pretargetingConfig". - */ - kind: string; - /** - * Request containing any of these language codes will match. - */ - languages: string[]; - /** - * Requests containing any of these mobile carrier ids will match. Values are - * from mobile-carriers.csv in the downloadable files section. - */ - mobileCarriers: string[]; + * Configuration data for an Ad Exchange buyer account. + */ + export interface Schema$Account { + /** + * Your bidder locations that have distinct URLs. + */ + bidderLocation: any[]; + /** + * The nid parameter value used in cookie match requests. Please contact + * your technical account manager if you need to change this. + */ + cookieMatchingNid: string; + /** + * The base URL used in cookie match requests. + */ + cookieMatchingUrl: string; + /** + * Account id. + */ + id: number; + /** + * Resource type. + */ + kind: string; + /** + * The maximum number of active creatives that an account can have, where a + * creative is active if it was inserted or bid with in the last 30 days. + * Please contact your technical account manager if you need to change this. + */ + maximumActiveCreatives: number; + /** + * The sum of all bidderLocation.maximumQps values cannot exceed this. + * Please contact your technical account manager if you need to change this. + */ + maximumTotalQps: number; + /** + * The number of creatives that this account inserted or bid with in the + * last 30 days. + */ + numberActiveCreatives: number; + } /** - * Requests containing any of these mobile device ids will match. Values are - * from mobile-devices.csv in the downloadable files section. - */ - mobileDevices: string[]; + * An account feed lists Ad Exchange buyer accounts that the user has access + * to. Each entry in the feed corresponds to a single buyer account. + */ + export interface Schema$AccountsList { + /** + * A list of accounts. + */ + items: Schema$Account[]; + /** + * Resource type. + */ + kind: string; + } /** - * Requests containing any of these mobile operating system version ids will - * match. Values are from mobile-os.csv in the downloadable files section. - */ - mobileOperatingSystemVersions: string[]; + * The configuration data for an Ad Exchange billing info. + */ + export interface Schema$BillingInfo { + /** + * Account id. + */ + accountId: number; + /** + * Account name. + */ + accountName: string; + /** + * A list of adgroup IDs associated with this particular account. These IDs + * may show up as part of a realtime bidding BidRequest, which indicates a + * bid request for this account. + */ + billingId: string[]; + /** + * Resource type. + */ + kind: string; + } /** - * Requests containing any of these placements will match. - */ - placements: any[]; + * A billing info feed lists Billing Info the Ad Exchange buyer account has + * access to. Each entry in the feed corresponds to a single billing info. + */ + export interface Schema$BillingInfoList { + /** + * A list of billing info relevant for your account. + */ + items: Schema$BillingInfo[]; + /** + * Resource type. + */ + kind: string; + } /** - * Requests matching any of these platforms will match. Possible values are - * PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and - * PRETARGETING_PLATFORM_TABLET. - */ - platforms: string[]; + * The configuration data for Ad Exchange RTB - Budget API. + */ + export interface Schema$Budget { + /** + * The id of the account. This is required for get and update requests. + */ + accountId: string; + /** + * The billing id to determine which adgroup to provide budget information + * for. This is required for get and update requests. + */ + billingId: string; + /** + * The daily budget amount in unit amount of the account currency to apply + * for the billingId provided. This is required for update requests. + */ + budgetAmount: string; + /** + * The currency code for the buyer. This cannot be altered here. + */ + currencyCode: string; + /** + * The unique id that describes this item. + */ + id: string; + /** + * The kind of the resource, i.e. "adexchangebuyer#budget". + */ + kind: string; + } /** - * Creative attributes should be declared here if all creatives corresponding - * to this pretargeting configuration have that creative attribute. Values are - * from pretargetable-creative-attributes.txt in the downloadable files - * section. - */ - supportedCreativeAttributes: string[]; + * A creative and its classification data. + */ + export interface Schema$Creative { + /** + * Account id. + */ + accountId: number; + /** + * Detected advertiser id, if any. Read-only. This field should not be set + * in requests. + */ + advertiserId: string[]; + /** + * The name of the company being advertised in the creative. + */ + advertiserName: string; + /** + * The agency id for this creative. + */ + agencyId: string; + /** + * The last upload timestamp of this creative if it was uploaded via API. + * Read-only. The value of this field is generated, and will be ignored for + * uploads. (formatted RFC 3339 timestamp). + */ + apiUploadTimestamp: string; + /** + * All attributes for the ads that may be shown from this snippet. + */ + attribute: number[]; + /** + * A buyer-specific id identifying the creative in this ad. + */ + buyerCreativeId: string; + /** + * The set of destination urls for the snippet. + */ + clickThroughUrl: string[]; + /** + * Shows any corrections that were applied to this creative. Read-only. This + * field should not be set in requests. + */ + corrections: any[]; + /** + * The reasons for disapproval, if any. Note that not all disapproval + * reasons may be categorized, so it is possible for the creative to have a + * status of DISAPPROVED with an empty list for disapproval_reasons. In this + * case, please reach out to your TAM to help debug the issue. Read-only. + * This field should not be set in requests. + */ + disapprovalReasons: any[]; + /** + * The filtering reasons for the creative. Read-only. This field should not + * be set in requests. + */ + filteringReasons: any; + /** + * Ad height. + */ + height: number; + /** + * The HTML snippet that displays the ad when inserted in the web page. If + * set, videoURL should not be set. + */ + HTMLSnippet: string; + /** + * The set of urls to be called to record an impression. + */ + impressionTrackingUrl: string[]; + /** + * Resource type. + */ + kind: string; + /** + * If nativeAd is set, HTMLSnippet and videoURL should not be set. + */ + nativeAd: any; + /** + * Detected product categories, if any. Read-only. This field should not be + * set in requests. + */ + productCategories: number[]; + /** + * All restricted categories for the ads that may be shown from this + * snippet. + */ + restrictedCategories: number[]; + /** + * Detected sensitive categories, if any. Read-only. This field should not + * be set in requests. + */ + sensitiveCategories: number[]; + /** + * Creative serving status. Read-only. This field should not be set in + * requests. + */ + status: string; + /** + * All vendor types for the ads that may be shown from this snippet. + */ + vendorType: number[]; + /** + * The version for this creative. Read-only. This field should not be set in + * requests. + */ + version: number; + /** + * The URL to fetch a video ad. If set, HTMLSnippet and the nativeAd should + * not be set. + */ + videoURL: string; + /** + * Ad width. + */ + width: number; + } /** - * Requests containing any of these user list ids will match. - */ - userLists: string[]; + * The creatives feed lists the active creatives for the Ad Exchange buyer + * accounts that the user has access to. Each entry in the feed corresponds to + * a single creative. + */ + export interface Schema$CreativesList { + /** + * A list of creatives. + */ + items: Schema$Creative[]; + /** + * Resource type. + */ + kind: string; + /** + * Continuation token used to page through creatives. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } /** - * Requests that allow any of these vendor ids will match. Values are from - * vendors.txt in the downloadable files section. - */ - vendorTypes: string[]; + * The configuration data for an Ad Exchange direct deal. + */ + export interface Schema$DirectDeal { + /** + * The account id of the buyer this deal is for. + */ + accountId: number; + /** + * The name of the advertiser this deal is for. + */ + advertiser: string; + /** + * Whether the publisher for this deal is eligible for alcohol ads. + */ + allowsAlcohol: boolean; + /** + * The account id that this deal was negotiated for. It is either the buyer + * or the client that this deal was negotiated on behalf of. + */ + buyerAccountId: string; + /** + * The currency code that applies to the fixed_cpm value. If not set then + * assumed to be USD. + */ + currencyCode: string; + /** + * The deal type such as programmatic reservation or fixed price and so on. + */ + dealTier: string; + /** + * End time for when this deal stops being active. If not set then this deal + * is valid until manually disabled by the publisher. In seconds since the + * epoch. + */ + endTime: string; + /** + * The fixed price for this direct deal. In cpm micros of currency according + * to currency_code. If set, then this deal is eligible for the fixed price + * tier of buying (highest priority, pay exactly the configured fixed + * price). + */ + fixedCpm: string; + /** + * Deal id. + */ + id: string; + /** + * Resource type. + */ + kind: string; + /** + * Deal name. + */ + name: string; + /** + * The minimum price for this direct deal. In cpm micros of currency + * according to currency_code. If set, then this deal is eligible for the + * private exchange tier of buying (below fixed price priority, run as a + * second price auction). + */ + privateExchangeMinCpm: string; + /** + * If true, the publisher has opted to have their blocks ignored when a + * creative is bid with for this deal. + */ + publisherBlocksOverriden: boolean; + /** + * The name of the publisher offering this direct deal. + */ + sellerNetwork: string; + /** + * Start time for when this deal becomes active. If not set then this deal + * is active immediately upon creation. In seconds since the epoch. + */ + startTime: string; + } /** - * Requests containing any of these vertical ids will match. - */ - verticals: string[]; -} -export interface Schema$PretargetingConfigList { + * A direct deals feed lists Direct Deals the Ad Exchange buyer account has + * access to. This includes direct deals set up for the buyer account as well + * as its merged stream seats. + */ + export interface Schema$DirectDealsList { + /** + * A list of direct deals relevant for your account. + */ + directDeals: Schema$DirectDeal[]; + /** + * Resource type. + */ + kind: string; + } /** - * A list of pretargeting configs - */ - items: Schema$PretargetingConfig[]; + * The configuration data for an Ad Exchange performance report list. + */ + export interface Schema$PerformanceReport { + /** + * The number of bid responses with an ad. + */ + bidRate: number; + /** + * The number of bid requests sent to your bidder. + */ + bidRequestRate: number; + /** + * Rate of various prefiltering statuses per match. Please refer to the + * callout-status-codes.txt file for different statuses. + */ + calloutStatusRate: any[]; + /** + * Average QPS for cookie matcher operations. + */ + cookieMatcherStatusRate: any[]; + /** + * Rate of ads with a given status. Please refer to the + * creative-status-codes.txt file for different statuses. + */ + creativeStatusRate: any[]; + /** + * The number of bid responses that were filtered due to a policy violation + * or other errors. + */ + filteredBidRate: number; + /** + * Average QPS for hosted match operations. + */ + hostedMatchStatusRate: any[]; + /** + * The number of potential queries based on your pretargeting settings. + */ + inventoryMatchRate: number; + /** + * Resource type. + */ + kind: string; + /** + * The 50th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency50thPercentile: number; + /** + * The 85th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency85thPercentile: number; + /** + * The 95th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency95thPercentile: number; + /** + * Rate of various quota account statuses per quota check. + */ + noQuotaInRegion: number; + /** + * Rate of various quota account statuses per quota check. + */ + outOfQuota: number; + /** + * Average QPS for pixel match requests from clients. + */ + pixelMatchRequests: number; + /** + * Average QPS for pixel match responses from clients. + */ + pixelMatchResponses: number; + /** + * The configured quota limits for this account. + */ + quotaConfiguredLimit: number; + /** + * The throttled quota limits for this account. + */ + quotaThrottledLimit: number; + /** + * The trading location of this data. + */ + region: string; + /** + * The number of properly formed bid responses received by our servers + * within the deadline. + */ + successfulRequestRate: number; + /** + * The unix timestamp of the starting time of this performance data. + */ + timestamp: string; + /** + * The number of bid responses that were unsuccessful due to timeouts, + * incorrect formatting, etc. + */ + unsuccessfulRequestRate: number; + } /** - * Resource type. - */ - kind: string; -} - -export class Resource$Accounts { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); + * The configuration data for an Ad Exchange performance report list. + */ + export interface Schema$PerformanceReportList { + /** + * Resource type. + */ + kind: string; + /** + * A list of performance reports relevant for the account. + */ + performanceReport: Schema$PerformanceReport[]; } - - getRoot() { - return this.root; + export interface Schema$PretargetingConfig { + /** + * The id for billing purposes, provided for reference. Leave this field + * blank for insert requests; the id will be generated automatically. + */ + billingId: string; + /** + * The config id; generated automatically. Leave this field blank for insert + * requests. + */ + configId: string; + /** + * The name of the config. Must be unique. Required for all requests. + */ + configName: string; + /** + * List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or + * PRETARGETING_CREATIVE_TYPE_VIDEO. + */ + creativeType: string[]; + /** + * Requests which allow one of these (width, height) pairs will match. All + * pairs must be supported ad dimensions. + */ + dimensions: any[]; + /** + * Requests with any of these content labels will not match. Values are from + * content-labels.txt in the downloadable files section. + */ + excludedContentLabels: string[]; + /** + * Requests containing any of these geo criteria ids will not match. + */ + excludedGeoCriteriaIds: string[]; + /** + * Requests containing any of these placements will not match. + */ + excludedPlacements: any[]; + /** + * Requests containing any of these users list ids will not match. + */ + excludedUserLists: string[]; + /** + * Requests containing any of these vertical ids will not match. Values are + * from the publisher-verticals.txt file in the downloadable files section. + */ + excludedVerticals: string[]; + /** + * Requests containing any of these geo criteria ids will match. + */ + geoCriteriaIds: string[]; + /** + * Whether this config is active. Required for all requests. + */ + isActive: boolean; + /** + * The kind of the resource, i.e. + * "adexchangebuyer#pretargetingConfig". + */ + kind: string; + /** + * Request containing any of these language codes will match. + */ + languages: string[]; + /** + * Requests containing any of these mobile carrier ids will match. Values + * are from mobile-carriers.csv in the downloadable files section. + */ + mobileCarriers: string[]; + /** + * Requests containing any of these mobile device ids will match. Values are + * from mobile-devices.csv in the downloadable files section. + */ + mobileDevices: string[]; + /** + * Requests containing any of these mobile operating system version ids will + * match. Values are from mobile-os.csv in the downloadable files section. + */ + mobileOperatingSystemVersions: string[]; + /** + * Requests containing any of these placements will match. + */ + placements: any[]; + /** + * Requests matching any of these platforms will match. Possible values are + * PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and + * PRETARGETING_PLATFORM_TABLET. + */ + platforms: string[]; + /** + * Creative attributes should be declared here if all creatives + * corresponding to this pretargeting configuration have that creative + * attribute. Values are from pretargetable-creative-attributes.txt in the + * downloadable files section. + */ + supportedCreativeAttributes: string[]; + /** + * Requests containing any of these user list ids will match. + */ + userLists: string[]; + /** + * Requests that allow any of these vendor ids will match. Values are from + * vendors.txt in the downloadable files section. + */ + vendorTypes: string[]; + /** + * Requests containing any of these vertical ids will match. + */ + verticals: string[]; + } + export interface Schema$PretargetingConfigList { + /** + * A list of pretargeting configs + */ + items: Schema$PretargetingConfig[]; + /** + * Resource type. + */ + kind: string; } - - /** - * adexchangebuyer.accounts.get - * @desc Gets one account by ID. - * @alias adexchangebuyer.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.accounts.list - * @desc Retrieves the authenticated user's list of accounts. - * @alias adexchangebuyer.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.accounts.get + * @desc Gets one account by ID. + * @alias adexchangebuyer.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.accounts.patch - * @desc Updates an existing account. This method supports patch semantics. - * @alias adexchangebuyer.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.accounts.list + * @desc Retrieves the authenticated user's list of accounts. + * @alias adexchangebuyer.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.accounts.update - * @desc Updates an existing account. - * @alias adexchangebuyer.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangebuyer.accounts.patch + * @desc Updates an existing account. This method supports patch semantics. + * @alias adexchangebuyer.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Billinginfo { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.accounts.update + * @desc Updates an existing account. + * @alias adexchangebuyer.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.billingInfo.get - * @desc Returns the billing information for one account specified by account - * ID. - * @alias adexchangebuyer.billingInfo.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The account id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Billinginfo { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/billinginfo/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.billingInfo.list - * @desc Retrieves a list of billing information for all accounts of the - * authenticated user. - * @alias adexchangebuyer.billingInfo.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.billingInfo.get + * @desc Returns the billing information for one account specified by + * account ID. + * @alias adexchangebuyer.billingInfo.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The account id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/billinginfo/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/billinginfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Budget { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.billingInfo.list + * @desc Retrieves a list of billing information for all accounts of the + * authenticated user. + * @alias adexchangebuyer.billingInfo.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/billinginfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.budget.get - * @desc Returns the budget information for the adgroup specified by the - * accountId and billingId. - * @alias adexchangebuyer.budget.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the budget information for. - * @param {string} params.billingId The billing id to get the budget information for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Budget { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.budget.patch - * @desc Updates the budget amount for the budget of the adgroup specified by - * the accountId and billingId, with the budget amount in the request. This - * method supports patch semantics. - * @alias adexchangebuyer.budget.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id associated with the budget being updated. - * @param {string} params.billingId The billing id associated with the budget being updated. - * @param {().Budget} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.budget.get + * @desc Returns the budget information for the adgroup specified by the + * accountId and billingId. + * @alias adexchangebuyer.budget.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the budget information for. + * @param {string} params.billingId The billing id to get the budget information for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.budget.update - * @desc Updates the budget amount for the budget of the adgroup specified by - * the accountId and billingId, with the budget amount in the request. - * @alias adexchangebuyer.budget.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id associated with the budget being updated. - * @param {string} params.billingId The billing id associated with the budget being updated. - * @param {().Budget} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangebuyer.budget.patch + * @desc Updates the budget amount for the budget of the adgroup specified + * by the accountId and billingId, with the budget amount in the request. + * This method supports patch semantics. + * @alias adexchangebuyer.budget.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id associated with the budget being updated. + * @param {string} params.billingId The billing id associated with the budget being updated. + * @param {().Budget} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Creatives { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.budget.update + * @desc Updates the budget amount for the budget of the adgroup specified + * by the accountId and billingId, with the budget amount in the request. + * @alias adexchangebuyer.budget.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id associated with the budget being updated. + * @param {string} params.billingId The billing id associated with the budget being updated. + * @param {().Budget} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.creatives.get - * @desc Gets the status for a single creative. A creative will be available - * 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Creatives { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.3/creatives/{accountId}/{buyerCreativeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId'], - pathParams: ['accountId', 'buyerCreativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.creatives.insert - * @desc Submit a new creative. - * @alias adexchangebuyer.creatives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangebuyer.creatives.get + * @desc Gets the status for a single creative. A creative will be available + * 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.3/creatives/{accountId}/{buyerCreativeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId'], + pathParams: ['accountId', 'buyerCreativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * adexchangebuyer.creatives.list - * @desc Retrieves a list of the authenticated user's active creatives. A - * creative will be available 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.accountId When specified, only creatives for the given account ids are returned. - * @param {string=} params.buyerCreativeId When specified, only creatives for the given buyer creative ids are returned. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. - * @param {string=} params.statusFilter When specified, only creatives having the given status are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.creatives.insert + * @desc Submit a new creative. + * @alias adexchangebuyer.creatives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Directdeals { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.creatives.list + * @desc Retrieves a list of the authenticated user's active creatives. A + * creative will be available 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.accountId When specified, only creatives for the given account ids are returned. + * @param {string=} params.buyerCreativeId When specified, only creatives for the given buyer creative ids are returned. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * @param {string=} params.statusFilter When specified, only creatives having the given status are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.directDeals.get - * @desc Gets one direct deal by ID. - * @alias adexchangebuyer.directDeals.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The direct deal id - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Directdeals { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/directdeals/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.directDeals.list - * @desc Retrieves the authenticated user's list of direct deals. - * @alias adexchangebuyer.directDeals.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.directDeals.get + * @desc Gets one direct deal by ID. + * @alias adexchangebuyer.directDeals.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The direct deal id + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/directdeals/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/directdeals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Performancereport { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.directDeals.list + * @desc Retrieves the authenticated user's list of direct deals. + * @alias adexchangebuyer.directDeals.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/directdeals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.performanceReport.list - * @desc Retrieves the authenticated user's list of performance metrics. - * @alias adexchangebuyer.performanceReport.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the reports. - * @param {string} params.endDateTime The end time of the report in ISO 8601 timestamp format using UTC. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. - * @param {string=} params.pageToken A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. - * @param {string} params.startDateTime The start time of the report in ISO 8601 timestamp format using UTC. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Performancereport { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.3/performancereport') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'endDateTime', 'startDateTime'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Pretargetingconfig { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangebuyer.performanceReport.list + * @desc Retrieves the authenticated user's list of performance metrics. + * @alias adexchangebuyer.performanceReport.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the reports. + * @param {string} params.endDateTime The end time of the report in ISO 8601 timestamp format using UTC. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * @param {string=} params.pageToken A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * @param {string} params.startDateTime The start time of the report in ISO 8601 timestamp format using UTC. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.3/performancereport') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'endDateTime', 'startDateTime'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangebuyer.pretargetingConfig.delete - * @desc Deletes an existing pretargeting config. - * @alias adexchangebuyer.pretargetingConfig.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to delete the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Pretargetingconfig { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangebuyer.pretargetingConfig.get - * @desc Gets a specific pretargeting configuration - * @alias adexchangebuyer.pretargetingConfig.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangebuyer.pretargetingConfig.delete + * @desc Deletes an existing pretargeting config. + * @alias adexchangebuyer.pretargetingConfig.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to delete the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.pretargetingConfig.insert - * @desc Inserts a new pretargeting configuration. - * @alias adexchangebuyer.pretargetingConfig.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to insert the pretargeting config for. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangebuyer.pretargetingConfig.get + * @desc Gets a specific pretargeting configuration + * @alias adexchangebuyer.pretargetingConfig.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * adexchangebuyer.pretargetingConfig.list - * @desc Retrieves a list of the authenticated user's pretargeting - * configurations. - * @alias adexchangebuyer.pretargetingConfig.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the pretargeting configs for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangebuyer.pretargetingConfig.insert + * @desc Inserts a new pretargeting configuration. + * @alias adexchangebuyer.pretargetingConfig.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to insert the pretargeting config for. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * adexchangebuyer.pretargetingConfig.patch - * @desc Updates an existing pretargeting config. This method supports patch - * semantics. - * @alias adexchangebuyer.pretargetingConfig.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to update the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to update. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.pretargetingConfig.list + * @desc Retrieves a list of the authenticated user's pretargeting + * configurations. + * @alias adexchangebuyer.pretargetingConfig.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the pretargeting configs for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * adexchangebuyer.pretargetingConfig.update - * @desc Updates an existing pretargeting config. - * @alias adexchangebuyer.pretargetingConfig.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to update the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to update. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangebuyer.pretargetingConfig.patch + * @desc Updates an existing pretargeting config. This method supports patch + * semantics. + * @alias adexchangebuyer.pretargetingConfig.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to update the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to update. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangebuyer.pretargetingConfig.update + * @desc Updates an existing pretargeting config. + * @alias adexchangebuyer.pretargetingConfig.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to update the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to update. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.3/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexchangebuyer/v1.4.ts b/src/apis/adexchangebuyer/v1.4.ts index 103089e70ef..5aae7ddd9b3 100644 --- a/src/apis/adexchangebuyer/v1.4.ts +++ b/src/apis/adexchangebuyer/v1.4.ts @@ -27,3968 +27,3992 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Buyer API - * - * Accesses your bidding-account information, submits creatives for validation, - * finds available direct deals, and retrieves performance reports. - * - * @example - * const google = require('googleapis'); - * const adexchangebuyer = google.adexchangebuyer('v1.4'); - * - * @namespace adexchangebuyer - * @type {Function} - * @version v1.4 - * @variation v1.4 - * @param {object=} options Options for Adexchangebuyer - */ -export class Adexchangebuyer { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - billingInfo: Resource$Billinginfo; - budget: Resource$Budget; - creatives: Resource$Creatives; - marketplacedeals: Resource$Marketplacedeals; - marketplacenotes: Resource$Marketplacenotes; - marketplaceprivateauction: Resource$Marketplaceprivateauction; - performanceReport: Resource$Performancereport; - pretargetingConfig: Resource$Pretargetingconfig; - products: Resource$Products; - proposals: Resource$Proposals; - pubprofiles: Resource$Pubprofiles; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.billingInfo = new Resource$Billinginfo(this); - this.budget = new Resource$Budget(this); - this.creatives = new Resource$Creatives(this); - this.marketplacedeals = new Resource$Marketplacedeals(this); - this.marketplacenotes = new Resource$Marketplacenotes(this); - this.marketplaceprivateauction = - new Resource$Marketplaceprivateauction(this); - this.performanceReport = new Resource$Performancereport(this); - this.pretargetingConfig = new Resource$Pretargetingconfig(this); - this.products = new Resource$Products(this); - this.proposals = new Resource$Proposals(this); - this.pubprofiles = new Resource$Pubprofiles(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Configuration data for an Ad Exchange buyer account. - */ -export interface Schema$Account { - /** - * When this is false, bid requests that include a deal ID for a private - * auction or preferred deal are always sent to your bidder. When true, all - * active pretargeting configs will be applied to private auctions and - * preferred deals. Programmatic Guaranteed deals (when enabled) are always - * sent to your bidder. - */ - applyPretargetingToNonGuaranteedDeals: boolean; - /** - * Your bidder locations that have distinct URLs. - */ - bidderLocation: any[]; - /** - * The nid parameter value used in cookie match requests. Please contact your - * technical account manager if you need to change this. - */ - cookieMatchingNid: string; - /** - * The base URL used in cookie match requests. - */ - cookieMatchingUrl: string; - /** - * Account id. - */ - id: number; - /** - * Resource type. - */ - kind: string; - /** - * The maximum number of active creatives that an account can have, where a - * creative is active if it was inserted or bid with in the last 30 days. - * Please contact your technical account manager if you need to change this. - */ - maximumActiveCreatives: number; - /** - * The sum of all bidderLocation.maximumQps values cannot exceed this. Please - * contact your technical account manager if you need to change this. - */ - maximumTotalQps: number; - /** - * The number of creatives that this account inserted or bid with in the last - * 30 days. - */ - numberActiveCreatives: number; -} -/** - * An account feed lists Ad Exchange buyer accounts that the user has access to. - * Each entry in the feed corresponds to a single buyer account. - */ -export interface Schema$AccountsList { - /** - * A list of accounts. - */ - items: Schema$Account[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$AddOrderDealsRequest { - /** - * The list of deals to add - */ - deals: Schema$MarketplaceDeal[]; - /** - * The last known proposal revision number. - */ - proposalRevisionNumber: string; - /** - * Indicates an optional action to take on the proposal - */ - updateAction: string; -} -export interface Schema$AddOrderDealsResponse { - /** - * List of deals added (in the same proposal as passed in the request) - */ - deals: Schema$MarketplaceDeal[]; - /** - * The updated revision number for the proposal. - */ - proposalRevisionNumber: string; -} -export interface Schema$AddOrderNotesRequest { - /** - * The list of notes to add. - */ - notes: Schema$MarketplaceNote[]; -} -export interface Schema$AddOrderNotesResponse { - notes: Schema$MarketplaceNote[]; -} -/** - * The configuration data for an Ad Exchange billing info. - */ -export interface Schema$BillingInfo { - /** - * Account id. - */ - accountId: number; - /** - * Account name. - */ - accountName: string; - /** - * A list of adgroup IDs associated with this particular account. These IDs - * may show up as part of a realtime bidding BidRequest, which indicates a bid - * request for this account. - */ - billingId: string[]; - /** - * Resource type. - */ - kind: string; -} -/** - * A billing info feed lists Billing Info the Ad Exchange buyer account has - * access to. Each entry in the feed corresponds to a single billing info. - */ -export interface Schema$BillingInfoList { - /** - * A list of billing info relevant for your account. - */ - items: Schema$BillingInfo[]; - /** - * Resource type. - */ - kind: string; -} -/** - * The configuration data for Ad Exchange RTB - Budget API. - */ -export interface Schema$Budget { - /** - * The id of the account. This is required for get and update requests. - */ - accountId: string; - /** - * The billing id to determine which adgroup to provide budget information - * for. This is required for get and update requests. - */ - billingId: string; - /** - * The daily budget amount in unit amount of the account currency to apply for - * the billingId provided. This is required for update requests. - */ - budgetAmount: string; - /** - * The currency code for the buyer. This cannot be altered here. - */ - currencyCode: string; - /** - * The unique id that describes this item. - */ - id: string; - /** - * The kind of the resource, i.e. "adexchangebuyer#budget". - */ - kind: string; -} -export interface Schema$Buyer { - /** - * Adx account id of the buyer. - */ - accountId: string; -} -export interface Schema$ContactInformation { - /** - * Email address of the contact. - */ - email: string; - /** - * The name of the contact. - */ - name: string; -} -export interface Schema$CreateOrdersRequest { - /** - * The list of proposals to create. - */ - proposals: Schema$Proposal[]; - /** - * Web property id of the seller creating these orders - */ - webPropertyCode: string; -} -export interface Schema$CreateOrdersResponse { - /** - * The list of proposals successfully created. - */ - proposals: Schema$Proposal[]; -} -/** - * A creative and its classification data. - */ -export interface Schema$Creative { - /** - * Account id. - */ - accountId: number; - /** - * The link to the Ad Preferences page. This is only supported for native ads. - */ - adChoicesDestinationUrl: string; - /** - * Detected advertiser id, if any. Read-only. This field should not be set in - * requests. - */ - advertiserId: string[]; - /** - * The name of the company being advertised in the creative. The value - * provided must exist in the advertisers.txt file. - */ - advertiserName: string; - /** - * The agency id for this creative. - */ - agencyId: string; - /** - * The last upload timestamp of this creative if it was uploaded via API. - * Read-only. The value of this field is generated, and will be ignored for - * uploads. (formatted RFC 3339 timestamp). - */ - apiUploadTimestamp: string; - /** - * List of buyer selectable attributes for the ads that may be shown from this - * snippet. Each attribute is represented by an integer as defined in - * buyer-declarable-creative-attributes.txt. - */ - attribute: number[]; - /** - * A buyer-specific id identifying the creative in this ad. - */ - buyerCreativeId: string; - /** - * The set of destination urls for the snippet. - */ - clickThroughUrl: string[]; - /** - * Shows any corrections that were applied to this creative. Read-only. This - * field should not be set in requests. - */ - corrections: any[]; - /** - * Top-level deals status. Read-only. This field should not be set in - * requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL) in - * servingRestrictions will also exist. Note that this may be nuanced with - * other contextual restrictions, in which case it may be preferable to read - * from servingRestrictions directly. - */ - dealsStatus: string; - /** - * Detected domains for this creative. Read-only. This field should not be set - * in requests. - */ - detectedDomains: string[]; - /** - * The filtering reasons for the creative. Read-only. This field should not be - * set in requests. - */ - filteringReasons: any; - /** - * Ad height. - */ - height: number; - /** - * The HTML snippet that displays the ad when inserted in the web page. If - * set, videoURL, videoVastXML, and nativeAd should not be set. - */ - HTMLSnippet: string; - /** - * The set of urls to be called to record an impression. - */ - impressionTrackingUrl: string[]; - /** - * Resource type. - */ - kind: string; - /** - * Detected languages for this creative. Read-only. This field should not be - * set in requests. - */ - languages: string[]; - /** - * If nativeAd is set, HTMLSnippet, videoVastXML, and the videoURL outside of - * nativeAd should not be set. (The videoURL inside nativeAd can be set.) - */ - nativeAd: any; - /** - * Top-level open auction status. Read-only. This field should not be set in - * requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or ALL) in - * servingRestrictions will also exist. Note that this may be nuanced with - * other contextual restrictions, in which case it may be preferable to read - * from ServingRestrictions directly. - */ - openAuctionStatus: string; - /** - * Detected product categories, if any. Each category is represented by an - * integer as defined in ad-product-categories.txt. Read-only. This field - * should not be set in requests. - */ - productCategories: number[]; - /** - * All restricted categories for the ads that may be shown from this snippet. - * Each category is represented by an integer as defined in the - * ad-restricted-categories.txt. - */ - restrictedCategories: number[]; - /** - * Detected sensitive categories, if any. Each category is represented by an - * integer as defined in ad-sensitive-categories.txt. Read-only. This field - * should not be set in requests. - */ - sensitiveCategories: number[]; - /** - * The granular status of this ad in specific contexts. A context here relates - * to where something ultimately serves (for example, a physical location, a - * platform, an HTTPS vs HTTP request, or the type of auction). Read-only. - * This field should not be set in requests. See the examples in the Creatives - * guide for more details. - */ - servingRestrictions: any[]; - /** - * List of vendor types for the ads that may be shown from this snippet. Each - * vendor type is represented by an integer as defined in vendors.txt. - */ - vendorType: number[]; - /** - * The version for this creative. Read-only. This field should not be set in - * requests. - */ - version: number; - /** - * The URL to fetch a video ad. If set, HTMLSnippet, videoVastXML, and - * nativeAd should not be set. Note, this is different from - * resource.native_ad.video_url above. - */ - videoURL: string; - /** - * The contents of a VAST document for a video ad. This document should - * conform to the VAST 2.0 or 3.0 standard. If set, HTMLSnippet, videoURL, and - * nativeAd and should not be set. - */ - videoVastXML: string; - /** - * Ad width. - */ - width: number; -} -/** - * The external deal ids associated with a creative. - */ -export interface Schema$CreativeDealIds { - /** - * A list of external deal ids and ARC approval status. - */ - dealStatuses: any[]; - /** - * Resource type. - */ - kind: string; -} -/** - * The creatives feed lists the active creatives for the Ad Exchange buyer - * accounts that the user has access to. Each entry in the feed corresponds to a - * single creative. - */ -export interface Schema$CreativesList { - /** - * A list of creatives. - */ - items: Schema$Creative[]; - /** - * Resource type. - */ - kind: string; - /** - * Continuation token used to page through creatives. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$DealServingMetadata { - /** - * True if alcohol ads are allowed for this deal (read-only). This field is - * only populated when querying for finalized orders using the method - * GetFinalizedOrderDeals - */ - alcoholAdsAllowed: boolean; - /** - * Tracks which parties (if any) have paused a deal. (readonly, except via - * PauseResumeOrderDeals action) - */ - dealPauseStatus: Schema$DealServingMetadataDealPauseStatus; -} -/** - * Tracks which parties (if any) have paused a deal. The deal is considered - * paused if has_buyer_paused || has_seller_paused. Each of the has_buyer_paused - * or the has_seller_paused bits can be set independently. - */ -export interface Schema$DealServingMetadataDealPauseStatus { - buyerPauseReason: string; - /** - * If the deal is paused, records which party paused the deal first. - */ - firstPausedBy: string; - hasBuyerPaused: boolean; - hasSellerPaused: boolean; - sellerPauseReason: string; -} -export interface Schema$DealTerms { - /** - * Visibilty of the URL in bid requests. - */ - brandingType: string; - /** - * Indicates that this ExternalDealId exists under at least two different - * AdxInventoryDeals. Currently, the only case that the same ExternalDealId - * will exist is programmatic cross sell case. - */ - crossListedExternalDealIdType: string; - /** - * Description for the proposed terms of the deal. - */ - description: string; - /** - * Non-binding estimate of the estimated gross spend for this deal Can be set - * by buyer or seller. - */ - estimatedGrossSpend: Schema$Price; - /** - * Non-binding estimate of the impressions served per day Can be set by buyer - * or seller. - */ - estimatedImpressionsPerDay: string; - /** - * The terms for guaranteed fixed price deals. - */ - guaranteedFixedPriceTerms: Schema$DealTermsGuaranteedFixedPriceTerms; - /** - * The terms for non-guaranteed auction deals. - */ - nonGuaranteedAuctionTerms: Schema$DealTermsNonGuaranteedAuctionTerms; - /** - * The terms for non-guaranteed fixed price deals. - */ - nonGuaranteedFixedPriceTerms: Schema$DealTermsNonGuaranteedFixedPriceTerms; - /** - * The terms for rubicon non-guaranteed deals. - */ - rubiconNonGuaranteedTerms: Schema$DealTermsRubiconNonGuaranteedTerms; - /** - * For deals with Cost Per Day billing, defines the timezone used to mark the - * boundaries of a day (buyer-readonly) - */ - sellerTimeZone: string; -} -export interface Schema$DealTermsGuaranteedFixedPriceTerms { - /** - * External billing info for this Deal. This field is relevant when external - * billing info such as price has a different currency code than DFP/AdX. - */ - billingInfo: Schema$DealTermsGuaranteedFixedPriceTermsBillingInfo; - /** - * Fixed price for the specified buyer. - */ - fixedPrices: Schema$PricePerBuyer[]; - /** - * Guaranteed impressions as a percentage. This is the percentage of - * guaranteed looks that the buyer is guaranteeing to buy. - */ - guaranteedImpressions: string; - /** - * Count of guaranteed looks. Required for deal, optional for product. For CPD - * deals, buyer changes to guaranteed_looks will be ignored. - */ - guaranteedLooks: string; - /** - * Count of minimum daily looks for a CPD deal. For CPD deals, buyer should - * negotiate on this field instead of guaranteed_looks. - */ - minimumDailyLooks: string; -} -export interface Schema$DealTermsGuaranteedFixedPriceTermsBillingInfo { - /** - * The timestamp (in ms since epoch) when the original reservation price for - * the deal was first converted to DFP currency. This is used to convert the - * contracted price into buyer's currency without discrepancy. - */ - currencyConversionTimeMs: string; - /** - * The DFP line item id associated with this deal. For features like CPD, - * buyers can retrieve the DFP line item for billing reconciliation. - */ - dfpLineItemId: string; - /** - * The original contracted quantity (# impressions) for this deal. To ensure - * delivery, sometimes the publisher will book the deal with a impression - * buffer, such that guaranteed_looks is greater than the contracted quantity. - * However clients are billed using the original contracted quantity. - */ - originalContractedQuantity: string; - /** - * The original reservation price for the deal, if the currency code is - * different from the one used in negotiation. - */ - price: Schema$Price; -} -export interface Schema$DealTermsNonGuaranteedAuctionTerms { - /** - * True if open auction buyers are allowed to compete with invited buyers in - * this private auction (buyer-readonly). - */ - autoOptimizePrivateAuction: boolean; - /** - * Reserve price for the specified buyer. - */ - reservePricePerBuyers: Schema$PricePerBuyer[]; -} -export interface Schema$DealTermsNonGuaranteedFixedPriceTerms { - /** - * Fixed price for the specified buyer. - */ - fixedPrices: Schema$PricePerBuyer[]; -} -export interface Schema$DealTermsRubiconNonGuaranteedTerms { - /** - * Optional price for Rubicon priority access in the auction. - */ - priorityPrice: Schema$Price; - /** - * Optional price for Rubicon standard access in the auction. - */ - standardPrice: Schema$Price; -} -export interface Schema$DeleteOrderDealsRequest { - /** - * List of deals to delete for a given proposal - */ - dealIds: string[]; - /** - * The last known proposal revision number. - */ - proposalRevisionNumber: string; - /** - * Indicates an optional action to take on the proposal - */ - updateAction: string; -} -export interface Schema$DeleteOrderDealsResponse { - /** - * List of deals deleted (in the same proposal as passed in the request) - */ - deals: Schema$MarketplaceDeal[]; - /** - * The updated revision number for the proposal. - */ - proposalRevisionNumber: string; -} -export interface Schema$DeliveryControl { - creativeBlockingLevel: string; - deliveryRateType: string; - frequencyCaps: Schema$DeliveryControlFrequencyCap[]; -} -export interface Schema$DeliveryControlFrequencyCap { - maxImpressions: number; - numTimeUnits: number; - timeUnitType: string; -} -/** - * This message carries publisher provided breakdown. E.g. {dimension_type: - * 'COUNTRY', [{dimension_value: {id: 1, name: 'US'}}, - * {dimension_value: {id: 2, name: 'UK'}}]} - */ -export interface Schema$Dimension { - dimensionType: string; - dimensionValues: Schema$DimensionDimensionValue[]; -} -/** - * Value of the dimension. - */ -export interface Schema$DimensionDimensionValue { - /** - * Id of the dimension. - */ - id: number; - /** - * Name of the dimension mainly for debugging purposes, except for the case of - * CREATIVE_SIZE. For CREATIVE_SIZE, strings are used instead of ids. - */ - name: string; - /** - * Percent of total impressions for a dimension type. e.g. {dimension_type: - * 'GENDER', [{dimension_value: {id: 1, name: 'MALE', - * percentage: 60}}]} Gender MALE is 60% of all impressions which have gender. - */ - percentage: number; -} -export interface Schema$EditAllOrderDealsRequest { - /** - * List of deals to edit. Service may perform 3 different operations based on - * comparison of deals in this list vs deals already persisted in database: 1. - * Add new deal to proposal If a deal in this list does not exist in the - * proposal, the service will create a new deal and add it to the proposal. - * Validation will follow AddOrderDealsRequest. 2. Update existing deal in the - * proposal If a deal in this list already exist in the proposal, the service - * will update that existing deal to this new deal in the request. Validation - * will follow UpdateOrderDealsRequest. 3. Delete deals from the proposal - * (just need the id) If a existing deal in the proposal is not present in - * this list, the service will delete that deal from the proposal. Validation - * will follow DeleteOrderDealsRequest. - */ - deals: Schema$MarketplaceDeal[]; - /** - * If specified, also updates the proposal in the batch transaction. This is - * useful when the proposal and the deals need to be updated in one - * transaction. - */ - proposal: Schema$Proposal; - /** - * The last known revision number for the proposal. - */ - proposalRevisionNumber: string; - /** - * Indicates an optional action to take on the proposal - */ - updateAction: string; -} -export interface Schema$EditAllOrderDealsResponse { - /** - * List of all deals in the proposal after edit. - */ - deals: Schema$MarketplaceDeal[]; - /** - * The latest revision number after the update has been applied. - */ - orderRevisionNumber: string; -} -export interface Schema$GetOffersResponse { - /** - * The returned list of products. - */ - products: Schema$Product[]; -} -export interface Schema$GetOrderDealsResponse { - /** - * List of deals for the proposal - */ - deals: Schema$MarketplaceDeal[]; -} -export interface Schema$GetOrderNotesResponse { - /** - * The list of matching notes. The notes for a proposal are ordered from - * oldest to newest. If the notes span multiple proposals, they will be - * grouped by proposal, with the notes for the most recently modified proposal - * appearing first. - */ - notes: Schema$MarketplaceNote[]; -} -export interface Schema$GetOrdersResponse { - /** - * The list of matching proposals. - */ - proposals: Schema$Proposal[]; -} -export interface Schema$GetPublisherProfilesByAccountIdResponse { - /** - * Profiles for the requested publisher - */ - profiles: Schema$PublisherProfileApiProto[]; -} -/** - * A proposal can contain multiple deals. A deal contains the terms and - * targeting information that is used for serving. - */ -export interface Schema$MarketplaceDeal { - /** - * Buyer private data (hidden from seller). - */ - buyerPrivateData: Schema$PrivateData; - /** - * The time (ms since epoch) of the deal creation. (readonly) - */ - creationTimeMs: string; - /** - * Specifies the creative pre-approval policy (buyer-readonly) - */ - creativePreApprovalPolicy: string; - /** - * Specifies whether the creative is safeFrame compatible (buyer-readonly) - */ - creativeSafeFrameCompatibility: string; - /** - * A unique deal-id for the deal (readonly). - */ - dealId: string; - /** - * Metadata about the serving status of this deal (readonly, writes via custom - * actions) - */ - dealServingMetadata: Schema$DealServingMetadata; - /** - * The set of fields around delivery control that are interesting for a buyer - * to see but are non-negotiable. These are set by the publisher. This message - * is assigned an id of 100 since some day we would want to model this as a - * protobuf extension. - */ - deliveryControl: Schema$DeliveryControl; - /** - * The external deal id assigned to this deal once the deal is finalized. This - * is the deal-id that shows up in serving/reporting etc. (readonly) - */ - externalDealId: string; - /** - * Proposed flight end time of the deal (ms since epoch) This will generally - * be stored in a granularity of a second. (updatable) - */ - flightEndTimeMs: string; - /** - * Proposed flight start time of the deal (ms since epoch) This will generally - * be stored in a granularity of a second. (updatable) - */ - flightStartTimeMs: string; - /** - * Description for the deal terms. (buyer-readonly) - */ - inventoryDescription: string; - /** - * Indicates whether the current deal is a RFP template. RFP template is - * created by buyer and not based on seller created products. - */ - isRfpTemplate: boolean; - /** - * True, if the buyside inventory setup is complete for this deal. (readonly, - * except via OrderSetupCompleted action) - */ - isSetupComplete: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "adexchangebuyer#marketplaceDeal". - */ - kind: string; - /** - * The time (ms since epoch) when the deal was last updated. (readonly) - */ - lastUpdateTimeMs: string; - /** - * The name of the deal. (updatable) - */ - name: string; - /** - * The product-id from which this deal was created. (readonly, except on - * create) - */ - productId: string; - /** - * The revision number of the product that the deal was created from - * (readonly, except on create) - */ - productRevisionNumber: string; - /** - * Specifies the creative source for programmatic deals, PUBLISHER means - * creative is provided by seller and ADVERTISR means creative is provided by - * buyer. (buyer-readonly) - */ - programmaticCreativeSource: string; - proposalId: string; - /** - * Optional Seller contact information for the deal (buyer-readonly) - */ - sellerContacts: Schema$ContactInformation[]; - /** - * The shared targeting visible to buyers and sellers. Each shared targeting - * entity is AND'd together. (updatable) - */ - sharedTargetings: Schema$SharedTargeting[]; - /** - * The syndication product associated with the deal. (readonly, except on - * create) - */ - syndicationProduct: string; - /** - * The negotiable terms of the deal. (updatable) - */ - terms: Schema$DealTerms; - webPropertyCode: string; -} -export interface Schema$MarketplaceDealParty { - /** - * The buyer/seller associated with the deal. One of buyer/seller is specified - * for a deal-party. - */ - buyer: Schema$Buyer; - /** - * The buyer/seller associated with the deal. One of buyer/seller is specified - * for a deal party. - */ - seller: Schema$Seller; -} -export interface Schema$MarketplaceLabel { - /** - * The accountId of the party that created the label. - */ - accountId: string; - /** - * The creation time (in ms since epoch) for the label. - */ - createTimeMs: string; - /** - * Information about the party that created the label. - */ - deprecatedMarketplaceDealParty: Schema$MarketplaceDealParty; - /** - * The label to use. - */ - label: string; -} -/** - * A proposal is associated with a bunch of notes which may optionally be - * associated with a deal and/or revision number. - */ -export interface Schema$MarketplaceNote { - /** - * The role of the person (buyer/seller) creating the note. (readonly) - */ - creatorRole: string; - /** - * Notes can optionally be associated with a deal. (readonly, except on - * create) - */ - dealId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "adexchangebuyer#marketplaceNote". - */ - kind: string; - /** - * The actual note to attach. (readonly, except on create) - */ - note: string; - /** - * The unique id for the note. (readonly) - */ - noteId: string; - /** - * The proposalId that a note is attached to. (readonly) - */ - proposalId: string; - /** - * If the note is associated with a proposal revision number, then store that - * here. (readonly, except on create) - */ - proposalRevisionNumber: string; - /** - * The timestamp (ms since epoch) that this note was created. (readonly) - */ - timestampMs: string; -} -/** - * The configuration data for an Ad Exchange performance report list. - */ -export interface Schema$PerformanceReport { - /** - * The number of bid responses with an ad. - */ - bidRate: number; - /** - * The number of bid requests sent to your bidder. - */ - bidRequestRate: number; - /** - * Rate of various prefiltering statuses per match. Please refer to the - * callout-status-codes.txt file for different statuses. - */ - calloutStatusRate: any[]; - /** - * Average QPS for cookie matcher operations. - */ - cookieMatcherStatusRate: any[]; - /** - * Rate of ads with a given status. Please refer to the - * creative-status-codes.txt file for different statuses. - */ - creativeStatusRate: any[]; - /** - * The number of bid responses that were filtered due to a policy violation or - * other errors. - */ - filteredBidRate: number; - /** - * Average QPS for hosted match operations. - */ - hostedMatchStatusRate: any[]; - /** - * The number of potential queries based on your pretargeting settings. - */ - inventoryMatchRate: number; - /** - * Resource type. - */ - kind: string; - /** - * The 50th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency50thPercentile: number; - /** - * The 85th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency85thPercentile: number; - /** - * The 95th percentile round trip latency(ms) as perceived from Google servers - * for the duration period covered by the report. - */ - latency95thPercentile: number; - /** - * Rate of various quota account statuses per quota check. - */ - noQuotaInRegion: number; - /** - * Rate of various quota account statuses per quota check. - */ - outOfQuota: number; - /** - * Average QPS for pixel match requests from clients. - */ - pixelMatchRequests: number; - /** - * Average QPS for pixel match responses from clients. - */ - pixelMatchResponses: number; - /** - * The configured quota limits for this account. - */ - quotaConfiguredLimit: number; - /** - * The throttled quota limits for this account. - */ - quotaThrottledLimit: number; - /** - * The trading location of this data. - */ - region: string; - /** - * The number of properly formed bid responses received by our servers within - * the deadline. - */ - successfulRequestRate: number; - /** - * The unix timestamp of the starting time of this performance data. - */ - timestamp: string; - /** - * The number of bid responses that were unsuccessful due to timeouts, - * incorrect formatting, etc. - */ - unsuccessfulRequestRate: number; -} -/** - * The configuration data for an Ad Exchange performance report list. - */ -export interface Schema$PerformanceReportList { - /** - * Resource type. - */ - kind: string; - /** - * A list of performance reports relevant for the account. - */ - performanceReport: Schema$PerformanceReport[]; -} -export interface Schema$PretargetingConfig { - /** - * The id for billing purposes, provided for reference. Leave this field blank - * for insert requests; the id will be generated automatically. - */ - billingId: string; - /** - * The config id; generated automatically. Leave this field blank for insert - * requests. - */ - configId: string; - /** - * The name of the config. Must be unique. Required for all requests. - */ - configName: string; - /** - * List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or - * PRETARGETING_CREATIVE_TYPE_VIDEO. - */ - creativeType: string[]; - /** - * Requests which allow one of these (width, height) pairs will match. All - * pairs must be supported ad dimensions. - */ - dimensions: any[]; - /** - * Requests with any of these content labels will not match. Values are from - * content-labels.txt in the downloadable files section. - */ - excludedContentLabels: string[]; - /** - * Requests containing any of these geo criteria ids will not match. - */ - excludedGeoCriteriaIds: string[]; - /** - * Requests containing any of these placements will not match. - */ - excludedPlacements: any[]; - /** - * Requests containing any of these users list ids will not match. - */ - excludedUserLists: string[]; - /** - * Requests containing any of these vertical ids will not match. Values are - * from the publisher-verticals.txt file in the downloadable files section. - */ - excludedVerticals: string[]; - /** - * Requests containing any of these geo criteria ids will match. - */ - geoCriteriaIds: string[]; - /** - * Whether this config is active. Required for all requests. - */ - isActive: boolean; - /** - * The kind of the resource, i.e. - * "adexchangebuyer#pretargetingConfig". - */ - kind: string; - /** - * Request containing any of these language codes will match. - */ - languages: string[]; - /** - * Requests where the predicted viewability is below the specified decile will - * not match. E.g. if the buyer sets this value to 5, requests from slots - * where the predicted viewability is below 50% will not match. If the - * predicted viewability is unknown this field will be ignored. - */ - minimumViewabilityDecile: number; - /** - * Requests containing any of these mobile carrier ids will match. Values are - * from mobile-carriers.csv in the downloadable files section. - */ - mobileCarriers: string[]; - /** - * Requests containing any of these mobile device ids will match. Values are - * from mobile-devices.csv in the downloadable files section. - */ - mobileDevices: string[]; - /** - * Requests containing any of these mobile operating system version ids will - * match. Values are from mobile-os.csv in the downloadable files section. - */ - mobileOperatingSystemVersions: string[]; - /** - * Requests containing any of these placements will match. - */ - placements: any[]; - /** - * Requests matching any of these platforms will match. Possible values are - * PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and - * PRETARGETING_PLATFORM_TABLET. - */ - platforms: string[]; - /** - * Creative attributes should be declared here if all creatives corresponding - * to this pretargeting configuration have that creative attribute. Values are - * from pretargetable-creative-attributes.txt in the downloadable files - * section. - */ - supportedCreativeAttributes: string[]; - /** - * Requests containing the specified type of user data will match. Possible - * values are HOSTED_MATCH_DATA, which means the request is cookie-targetable - * and has a match in the buyer's hosted match table, and COOKIE_OR_IDFA, - * which means the request has either a targetable cookie or an iOS IDFA. - */ - userIdentifierDataRequired: string[]; - /** - * Requests containing any of these user list ids will match. - */ - userLists: string[]; - /** - * Requests that allow any of these vendor ids will match. Values are from - * vendors.txt in the downloadable files section. - */ - vendorTypes: string[]; - /** - * Requests containing any of these vertical ids will match. - */ - verticals: string[]; - /** - * Video requests satisfying any of these player size constraints will match. - */ - videoPlayerSizes: any[]; -} -export interface Schema$PretargetingConfigList { - /** - * A list of pretargeting configs - */ - items: Schema$PretargetingConfig[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$Price { - /** - * The price value in micros. - */ - amountMicros: number; - /** - * The currency code for the price. - */ - currencyCode: string; - /** - * In case of CPD deals, the expected CPM in micros. - */ - expectedCpmMicros: number; - /** - * The pricing type for the deal/product. - */ - pricingType: string; -} -/** - * Used to specify pricing rules for buyers. Each PricePerBuyer in a product can - * become [0,1] deals. To check if there is a PricePerBuyer for a particular - * buyer we look for the most specific matching rule - we first look for a rule - * matching the buyer and otherwise look for a matching rule where no buyer is - * set. - */ -export interface Schema$PricePerBuyer { - /** - * Optional access type for this buyer. - */ - auctionTier: string; - /** - * Reference to the buyer that will get billed. - */ - billedBuyer: Schema$Buyer; - /** - * The buyer who will pay this price. If unset, all buyers can pay this price - * (if the advertisers match, and there's no more specific rule matching - * the buyer). - */ - buyer: Schema$Buyer; - /** - * The specified price - */ - price: Schema$Price; -} -export interface Schema$PrivateData { - referenceId: string; - referencePayload: string; -} -/** - * A product is segment of inventory that a seller wishes to sell. It is - * associated with certain terms and targeting information which helps buyer - * know more about the inventory. Each field in a product can have one of the - * following setting: (readonly) - It is an error to try and set this field. - * (buyer-readonly) - Only the seller can set this field. (seller-readonly) - - * Only the buyer can set this field. (updatable) - The field is updatable at - * all times by either buyer or the seller. - */ -export interface Schema$Product { - /** - * The billed buyer corresponding to the buyer that created the offer. - * (readonly, except on create) - */ - billedBuyer: Schema$Buyer; - /** - * The buyer that created the offer if this is a buyer initiated offer - * (readonly, except on create) - */ - buyer: Schema$Buyer; - /** - * Creation time in ms. since epoch (readonly) - */ - creationTimeMs: string; - /** - * Optional contact information for the creator of this product. - * (buyer-readonly) - */ - creatorContacts: Schema$ContactInformation[]; - /** - * The role that created the offer. Set to BUYER for buyer initiated offers. - */ - creatorRole: string; - /** - * The set of fields around delivery control that are interesting for a buyer - * to see but are non-negotiable. These are set by the publisher. This message - * is assigned an id of 100 since some day we would want to model this as a - * protobuf extension. - */ - deliveryControl: Schema$DeliveryControl; - /** - * The proposed end time for the deal (ms since epoch) (buyer-readonly) - */ - flightEndTimeMs: string; - /** - * Inventory availability dates. (times are in ms since epoch) The granularity - * is generally in the order of seconds. (buyer-readonly) - */ - flightStartTimeMs: string; - /** - * If the creator has already signed off on the product, then the buyer can - * finalize the deal by accepting the product as is. When copying to a - * proposal, if any of the terms are changed, then auto_finalize is - * automatically set to false. - */ - hasCreatorSignedOff: boolean; - /** - * What exchange will provide this inventory (readonly, except on create). - */ - inventorySource: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "adexchangebuyer#product". - */ - kind: string; - /** - * Optional List of labels for the product (optional, buyer-readonly). - */ - labels: Schema$MarketplaceLabel[]; - /** - * Time of last update in ms. since epoch (readonly) - */ - lastUpdateTimeMs: string; - /** - * Optional legacy offer id if this offer is a preferred deal offer. - */ - legacyOfferId: string; - /** - * Marketplace publisher profile Id. This Id differs from the regular - * publisher_profile_id in that 1. This is a new id, the old Id will be - * deprecated in 2017. 2. This id uniquely identifies a publisher profile by - * itself. - */ - marketplacePublisherProfileId: string; - /** - * The name for this product as set by the seller. (buyer-readonly) - */ - name: string; - /** - * Optional private auction id if this offer is a private auction offer. - */ - privateAuctionId: string; - /** - * The unique id for the product (readonly) - */ - productId: string; - /** - * Id of the publisher profile for a given seller. A (seller.account_id, - * publisher_profile_id) pair uniquely identifies a publisher profile. Buyers - * can call the PublisherProfiles::List endpoint to get a list of publisher - * profiles for a given seller. - */ - publisherProfileId: string; - /** - * Publisher self-provided forecast information. - */ - publisherProvidedForecast: Schema$PublisherProvidedForecast; - /** - * The revision number of the product. (readonly) - */ - revisionNumber: string; - /** - * Information about the seller that created this product (readonly, except on - * create) - */ - seller: Schema$Seller; - /** - * Targeting that is shared between the buyer and the seller. Each targeting - * criteria has a specified key and for each key there is a list of inclusion - * value or exclusion values. (buyer-readonly) - */ - sharedTargetings: Schema$SharedTargeting[]; - /** - * The state of the product. (buyer-readonly) - */ - state: string; - /** - * The syndication product associated with the deal. (readonly, except on - * create) - */ - syndicationProduct: string; - /** - * The negotiable terms of the deal (buyer-readonly) - */ - terms: Schema$DealTerms; - /** - * The web property code for the seller. This field is meant to be copied over - * as is when creating deals. - */ - webPropertyCode: string; -} -/** - * Represents a proposal in the marketplace. A proposal is the unit of - * negotiation between a seller and a buyer and contains deals which are served. - * Each field in a proposal can have one of the following setting: (readonly) - - * It is an error to try and set this field. (buyer-readonly) - Only the seller - * can set this field. (seller-readonly) - Only the buyer can set this field. - * (updatable) - The field is updatable at all times by either buyer or the - * seller. - */ -export interface Schema$Proposal { - /** - * Reference to the buyer that will get billed for this proposal. (readonly) - */ - billedBuyer: Schema$Buyer; - /** - * Reference to the buyer on the proposal. (readonly, except on create) - */ - buyer: Schema$Buyer; - /** - * Optional contact information of the buyer. (seller-readonly) - */ - buyerContacts: Schema$ContactInformation[]; - /** - * Private data for buyer. (hidden from seller). - */ - buyerPrivateData: Schema$PrivateData; - /** - * IDs of DBM advertisers permission to this proposal. - */ - dbmAdvertiserIds: string[]; - /** - * When an proposal is in an accepted state, indicates whether the buyer has - * signed off. Once both sides have signed off on a deal, the proposal can be - * finalized by the seller. (seller-readonly) - */ - hasBuyerSignedOff: boolean; - /** - * When an proposal is in an accepted state, indicates whether the buyer has - * signed off Once both sides have signed off on a deal, the proposal can be - * finalized by the seller. (buyer-readonly) - */ - hasSellerSignedOff: boolean; - /** - * What exchange will provide this inventory (readonly, except on create). - */ - inventorySource: string; - /** - * True if the proposal is being renegotiated (readonly). - */ - isRenegotiating: boolean; - /** - * True, if the buyside inventory setup is complete for this proposal. - * (readonly, except via OrderSetupCompleted action) Deprecated in favor of - * deal level setup complete flag. - */ - isSetupComplete: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "adexchangebuyer#proposal". - */ - kind: string; - /** - * List of labels associated with the proposal. (readonly) - */ - labels: Schema$MarketplaceLabel[]; - /** - * The role of the last user that either updated the proposal or left a - * comment. (readonly) - */ - lastUpdaterOrCommentorRole: string; - /** - * The name for the proposal (updatable) - */ - name: string; - /** - * Optional negotiation id if this proposal is a preferred deal proposal. - */ - negotiationId: string; - /** - * Indicates whether the buyer/seller created the proposal.(readonly) - */ - originatorRole: string; - /** - * Optional private auction id if this proposal is a private auction proposal. - */ - privateAuctionId: string; - /** - * The unique id of the proposal. (readonly). - */ - proposalId: string; - /** - * The current state of the proposal. (readonly) - */ - proposalState: string; - /** - * The revision number for the proposal (readonly). - */ - revisionNumber: string; - /** - * The time (ms since epoch) when the proposal was last revised (readonly). - */ - revisionTimeMs: string; - /** - * Reference to the seller on the proposal. (readonly, except on create) - */ - seller: Schema$Seller; - /** - * Optional contact information of the seller (buyer-readonly). - */ - sellerContacts: Schema$ContactInformation[]; -} -export interface Schema$PublisherProfileApiProto { - /** - * Deprecated: use the seller.account_id. The account id of the seller. - */ - accountId: string; - /** - * Publisher provided info on its audience. - */ - audience: string; - /** - * A pitch statement for the buyer - */ - buyerPitchStatement: string; - /** - * Direct contact for the publisher profile. - */ - directContact: string; - /** - * Exchange where this publisher profile is from. E.g. AdX, Rubicon etc... - */ - exchange: string; - /** - * Link to publisher's Google+ page. - */ - googlePlusLink: string; - /** - * True, if this is the parent profile, which represents all domains owned by - * the publisher. - */ - isParent: boolean; - /** - * True, if this profile is published. Deprecated for state. - */ - isPublished: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "adexchangebuyer#publisherProfileApiProto". - */ - kind: string; - /** - * The url to the logo for the publisher. - */ - logoUrl: string; - /** - * The url for additional marketing and sales materials. - */ - mediaKitLink: string; - name: string; - /** - * Publisher provided overview. - */ - overview: string; - /** - * The pair of (seller.account_id, profile_id) uniquely identifies a publisher - * profile for a given publisher. - */ - profileId: number; - /** - * Programmatic contact for the publisher profile. - */ - programmaticContact: string; - /** - * The list of domains represented in this publisher profile. Empty if this is - * a parent profile. - */ - publisherDomains: string[]; - /** - * Unique Id for publisher profile. - */ - publisherProfileId: string; - /** - * Publisher provided forecasting information. - */ - publisherProvidedForecast: Schema$PublisherProvidedForecast; - /** - * Link to publisher rate card - */ - rateCardInfoLink: string; - /** - * Link for a sample content page. - */ - samplePageLink: string; - /** - * Seller of the publisher profile. - */ - seller: Schema$Seller; - /** - * State of the publisher profile. - */ - state: string; - /** - * Publisher provided key metrics and rankings. - */ - topHeadlines: string[]; -} -/** - * This message carries publisher provided forecasting information. - */ -export interface Schema$PublisherProvidedForecast { - /** - * Publisher provided dimensions. E.g. geo, sizes etc... - */ - dimensions: Schema$Dimension[]; - /** - * Publisher provided weekly impressions. - */ - weeklyImpressions: string; - /** - * Publisher provided weekly uniques. - */ - weeklyUniques: string; -} -export interface Schema$Seller { - /** - * The unique id for the seller. The seller fills in this field. The seller - * account id is then available to buyer in the product. - */ - accountId: string; - /** - * Optional sub-account id for the seller. - */ - subAccountId: string; -} -export interface Schema$SharedTargeting { - /** - * The list of values to exclude from targeting. Each value is AND'd - * together. - */ - exclusions: Schema$TargetingValue[]; - /** - * The list of value to include as part of the targeting. Each value is - * OR'd together. - */ - inclusions: Schema$TargetingValue[]; - /** - * The key representing the shared targeting criterion. - */ - key: string; -} -export interface Schema$TargetingValue { - /** - * The creative size value to exclude/include. - */ - creativeSizeValue: Schema$TargetingValueCreativeSize; - /** - * The daypart targeting to include / exclude. Filled in when the key is - * GOOG_DAYPART_TARGETING. - */ - dayPartTargetingValue: Schema$TargetingValueDayPartTargeting; - demogAgeCriteriaValue: Schema$TargetingValueDemogAgeCriteria; - demogGenderCriteriaValue: Schema$TargetingValueDemogGenderCriteria; - /** - * The long value to exclude/include. - */ - longValue: string; - /** - * The string value to exclude/include. - */ - stringValue: string; -} -/** - * Next Id: 7 - */ -export interface Schema$TargetingValueCreativeSize { - /** - * The formats allowed by the publisher. - */ - allowedFormats: string[]; - /** - * For video size type, the list of companion sizes. - */ - companionSizes: Schema$TargetingValueSize[]; - /** - * The Creative size type. - */ - creativeSizeType: string; - /** - * The native template for native ad. - */ - nativeTemplate: string; - /** - * For regular or video creative size type, specifies the size of the - * creative. - */ - size: Schema$TargetingValueSize; - /** - * The skippable ad type for video size. - */ - skippableAdType: string; -} -export interface Schema$TargetingValueDayPartTargeting { - dayParts: Schema$TargetingValueDayPartTargetingDayPart[]; - timeZoneType: string; -} -export interface Schema$TargetingValueDayPartTargetingDayPart { - dayOfWeek: string; - endHour: number; - endMinute: number; - startHour: number; - startMinute: number; -} -export interface Schema$TargetingValueDemogAgeCriteria { - demogAgeCriteriaIds: string[]; -} -export interface Schema$TargetingValueDemogGenderCriteria { - demogGenderCriteriaIds: string[]; -} -export interface Schema$TargetingValueSize { - /** - * The height of the creative. - */ - height: number; - /** - * The width of the creative. - */ - width: number; -} -export interface Schema$UpdatePrivateAuctionProposalRequest { - /** - * The externalDealId of the deal to be updated. - */ - externalDealId: string; - /** - * Optional note to be added. - */ - note: Schema$MarketplaceNote; - /** - * The current revision number of the proposal to be updated. - */ - proposalRevisionNumber: string; - /** - * The proposed action on the private auction proposal. - */ - updateAction: string; -} - -export class Resource$Accounts { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.accounts.get - * @desc Gets one account by ID. - * @alias adexchangebuyer.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id The account id - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.accounts.list - * @desc Retrieves the authenticated user's list of accounts. - * @alias adexchangebuyer.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.accounts.patch - * @desc Updates an existing account. This method supports patch semantics. - * @alias adexchangebuyer.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.confirmUnsafeAccountChange Confirmation for erasing bidder and cookie matching urls. - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.accounts.update - * @desc Updates an existing account. - * @alias adexchangebuyer.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.confirmUnsafeAccountChange Confirmation for erasing bidder and cookie matching urls. - * @param {integer} params.id The account id - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Billinginfo { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.billingInfo.get - * @desc Returns the billing information for one account specified by account - * ID. - * @alias adexchangebuyer.billingInfo.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The account id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/billinginfo/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.billingInfo.list - * @desc Retrieves a list of billing information for all accounts of the - * authenticated user. - * @alias adexchangebuyer.billingInfo.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/billinginfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Budget { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.budget.get - * @desc Returns the budget information for the adgroup specified by the - * accountId and billingId. - * @alias adexchangebuyer.budget.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the budget information for. - * @param {string} params.billingId The billing id to get the budget information for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.budget.patch - * @desc Updates the budget amount for the budget of the adgroup specified by - * the accountId and billingId, with the budget amount in the request. This - * method supports patch semantics. - * @alias adexchangebuyer.budget.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id associated with the budget being updated. - * @param {string} params.billingId The billing id associated with the budget being updated. - * @param {().Budget} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.budget.update - * @desc Updates the budget amount for the budget of the adgroup specified by - * the accountId and billingId, with the budget amount in the request. - * @alias adexchangebuyer.budget.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id associated with the budget being updated. - * @param {string} params.billingId The billing id associated with the budget being updated. - * @param {().Budget} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'billingId'], - pathParams: ['accountId', 'billingId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creatives { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.creatives.addDeal - * @desc Add a deal id association for the creative. - * @alias adexchangebuyer.creatives.addDeal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {string} params.dealId The id of the deal id to associate with this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addDeal(params?: any, options?: MethodOptions): AxiosPromise; - addDeal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addDeal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId', 'dealId'], - pathParams: ['accountId', 'buyerCreativeId', 'dealId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.creatives.get - * @desc Gets the status for a single creative. A creative will be available - * 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId'], - pathParams: ['accountId', 'buyerCreativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.creatives.insert - * @desc Submit a new creative. - * @alias adexchangebuyer.creatives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.creatives.list - * @desc Retrieves a list of the authenticated user's active creatives. A - * creative will be available 30-40 minutes after submission. - * @alias adexchangebuyer.creatives.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.accountId When specified, only creatives for the given account ids are returned. - * @param {string=} params.buyerCreativeId When specified, only creatives for the given buyer creative ids are returned. - * @param {string=} params.dealsStatusFilter When specified, only creatives having the given deals status are returned. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. - * @param {string=} params.openAuctionStatusFilter When specified, only creatives having the given open auction status are returned. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.creatives.listDeals - * @desc Lists the external deal ids associated with the creative. - * @alias adexchangebuyer.creatives.listDeals - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listDeals(params?: any, options?: MethodOptions): - AxiosPromise; - listDeals( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listDeals( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/listDeals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId'], - pathParams: ['accountId', 'buyerCreativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.creatives.removeDeal - * @desc Remove a deal id associated with the creative. - * @alias adexchangebuyer.creatives.removeDeal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.accountId The id for the account that will serve this creative. - * @param {string} params.buyerCreativeId The buyer-specific id for this creative. - * @param {string} params.dealId The id of the deal id to disassociate with this creative. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeDeal(params?: any, options?: MethodOptions): AxiosPromise; - removeDeal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeDeal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'buyerCreativeId', 'dealId'], - pathParams: ['accountId', 'buyerCreativeId', 'dealId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Marketplacedeals { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.marketplacedeals.delete - * @desc Delete the specified deals from the proposal - * @alias adexchangebuyer.marketplacedeals.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposalId to delete deals from. - * @param {().DeleteOrderDealsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/delete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.marketplacedeals.insert - * @desc Add new deals for the specified proposal - * @alias adexchangebuyer.marketplacedeals.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId proposalId for which deals need to be added. - * @param {().AddOrderDealsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/insert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.marketplacedeals.list - * @desc List all the deals for a given proposal - * @alias adexchangebuyer.marketplacedeals.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pqlQuery Query string to retrieve specific deals. - * @param {string} params.proposalId The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/adexchangebuyer/v1.4/proposals/{proposalId}/deals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.marketplacedeals.update - * @desc Replaces all the deals in the proposal with the passed in deals - * @alias adexchangebuyer.marketplacedeals.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposalId to edit deals on. - * @param {().EditAllOrderDealsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/update') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Marketplacenotes { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.marketplacenotes.insert - * @desc Add notes to the proposal - * @alias adexchangebuyer.marketplacenotes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposalId to add notes for. - * @param {().AddOrderNotesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/notes/insert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.marketplacenotes.list - * @desc Get all the notes associated with a proposal - * @alias adexchangebuyer.marketplacenotes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pqlQuery Query string to retrieve specific notes. To search the text contents of notes, please use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE "%bar%" - * @param {string} params.proposalId The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/adexchangebuyer/v1.4/proposals/{proposalId}/notes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Marketplaceprivateauction { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.marketplaceprivateauction.updateproposal - * @desc Update a given private auction proposal - * @alias adexchangebuyer.marketplaceprivateauction.updateproposal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.privateAuctionId The private auction id to be updated. - * @param {().UpdatePrivateAuctionProposalRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateproposal(params?: any, options?: MethodOptions): AxiosPromise; - updateproposal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateproposal( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/privateauction/{privateAuctionId}/updateproposal') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['privateAuctionId'], - pathParams: ['privateAuctionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Performancereport { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.performanceReport.list - * @desc Retrieves the authenticated user's list of performance metrics. - * @alias adexchangebuyer.performanceReport.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the reports. - * @param {string} params.endDateTime The end time of the report in ISO 8601 timestamp format using UTC. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. - * @param {string=} params.pageToken A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. - * @param {string} params.startDateTime The start time of the report in ISO 8601 timestamp format using UTC. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/performancereport') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'endDateTime', 'startDateTime'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Pretargetingconfig { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.pretargetingConfig.delete - * @desc Deletes an existing pretargeting config. - * @alias adexchangebuyer.pretargetingConfig.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to delete the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.pretargetingConfig.get - * @desc Gets a specific pretargeting configuration - * @alias adexchangebuyer.pretargetingConfig.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.pretargetingConfig.insert - * @desc Inserts a new pretargeting configuration. - * @alias adexchangebuyer.pretargetingConfig.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to insert the pretargeting config for. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.pretargetingConfig.list - * @desc Retrieves a list of the authenticated user's pretargeting - * configurations. - * @alias adexchangebuyer.pretargetingConfig.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to get the pretargeting configs for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.pretargetingConfig.patch - * @desc Updates an existing pretargeting config. This method supports patch - * semantics. - * @alias adexchangebuyer.pretargetingConfig.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to update the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to update. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.pretargetingConfig.update - * @desc Updates an existing pretargeting config. - * @alias adexchangebuyer.pretargetingConfig.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account id to update the pretargeting config for. - * @param {string} params.configId The specific id of the configuration to update. - * @param {().PretargetingConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'configId'], - pathParams: ['accountId', 'configId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Products { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.products.get - * @desc Gets the requested product by id. - * @alias adexchangebuyer.products.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId The id for the product to get the head revision for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/products/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['productId'], - pathParams: ['productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.products.search - * @desc Gets the requested product. - * @alias adexchangebuyer.products.search - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.pqlQuery The pql query used to query for products. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/products/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Proposals { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.proposals.get - * @desc Get a proposal given its id - * @alias adexchangebuyer.proposals.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId Id of the proposal to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/proposals/{proposalId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.proposals.insert - * @desc Create the given list of proposals - * @alias adexchangebuyer.proposals.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CreateOrdersRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/proposals/insert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace adexchangebuyer_v1_4 { /** - * adexchangebuyer.proposals.patch - * @desc Update the given proposal. This method supports patch semantics. - * @alias adexchangebuyer.proposals.patch - * @memberOf! () + * Ad Exchange Buyer API * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposal id to update. - * @param {string} params.revisionNumber The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. - * @param {string} params.updateAction The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. - * @param {().Proposal} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['proposalId', 'revisionNumber', 'updateAction'], - pathParams: ['proposalId', 'revisionNumber', 'updateAction'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.proposals.search - * @desc Search for proposals using pql query - * @alias adexchangebuyer.proposals.search - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.pqlQuery Query string to retrieve specific proposals. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangebuyer/v1.4/proposals/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.proposals.setupcomplete - * @desc Update the given proposal to indicate that setup has been completed. - * @alias adexchangebuyer.proposals.setupcomplete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposal id for which the setup is complete - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setupcomplete(params?: any, options?: MethodOptions): AxiosPromise; - setupcomplete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setupcomplete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/setupcomplete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['proposalId'], - pathParams: ['proposalId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer.proposals.update - * @desc Update the given proposal - * @alias adexchangebuyer.proposals.update - * @memberOf! () + * Accesses your bidding-account information, submits creatives for + * validation, finds available direct deals, and retrieves performance + * reports. * - * @param {object} params Parameters for request - * @param {string} params.proposalId The proposal id to update. - * @param {string} params.revisionNumber The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. - * @param {string} params.updateAction The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. - * @param {().Proposal} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['proposalId', 'revisionNumber', 'updateAction'], - pathParams: ['proposalId', 'revisionNumber', 'updateAction'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Pubprofiles { - root: Adexchangebuyer; - constructor(root: Adexchangebuyer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer.pubprofiles.list - * @desc Gets the requested publisher profile(s) by publisher accountId. - * @alias adexchangebuyer.pubprofiles.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const adexchangebuyer = google.adexchangebuyer('v1.4'); * - * @param {object} params Parameters for request - * @param {integer} params.accountId The accountId of the publisher to get profiles for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangebuyer/v1.4/publisher/{accountId}/profiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + * @namespace adexchangebuyer + * @type {Function} + * @version v1.4 + * @variation v1.4 + * @param {object=} options Options for Adexchangebuyer + */ + export class Adexchangebuyer { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + billingInfo: Resource$Billinginfo; + budget: Resource$Budget; + creatives: Resource$Creatives; + marketplacedeals: Resource$Marketplacedeals; + marketplacenotes: Resource$Marketplacenotes; + marketplaceprivateauction: Resource$Marketplaceprivateauction; + performanceReport: Resource$Performancereport; + pretargetingConfig: Resource$Pretargetingconfig; + products: Resource$Products; + proposals: Resource$Proposals; + pubprofiles: Resource$Pubprofiles; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.billingInfo = new Resource$Billinginfo(this); + this.budget = new Resource$Budget(this); + this.creatives = new Resource$Creatives(this); + this.marketplacedeals = new Resource$Marketplacedeals(this); + this.marketplacenotes = new Resource$Marketplacenotes(this); + this.marketplaceprivateauction = + new Resource$Marketplaceprivateauction(this); + this.performanceReport = new Resource$Performancereport(this); + this.pretargetingConfig = new Resource$Pretargetingconfig(this); + this.products = new Resource$Products(this); + this.proposals = new Resource$Proposals(this); + this.pubprofiles = new Resource$Pubprofiles(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Configuration data for an Ad Exchange buyer account. + */ + export interface Schema$Account { + /** + * When this is false, bid requests that include a deal ID for a private + * auction or preferred deal are always sent to your bidder. When true, all + * active pretargeting configs will be applied to private auctions and + * preferred deals. Programmatic Guaranteed deals (when enabled) are always + * sent to your bidder. + */ + applyPretargetingToNonGuaranteedDeals: boolean; + /** + * Your bidder locations that have distinct URLs. + */ + bidderLocation: any[]; + /** + * The nid parameter value used in cookie match requests. Please contact + * your technical account manager if you need to change this. + */ + cookieMatchingNid: string; + /** + * The base URL used in cookie match requests. + */ + cookieMatchingUrl: string; + /** + * Account id. + */ + id: number; + /** + * Resource type. + */ + kind: string; + /** + * The maximum number of active creatives that an account can have, where a + * creative is active if it was inserted or bid with in the last 30 days. + * Please contact your technical account manager if you need to change this. + */ + maximumActiveCreatives: number; + /** + * The sum of all bidderLocation.maximumQps values cannot exceed this. + * Please contact your technical account manager if you need to change this. + */ + maximumTotalQps: number; + /** + * The number of creatives that this account inserted or bid with in the + * last 30 days. + */ + numberActiveCreatives: number; + } + /** + * An account feed lists Ad Exchange buyer accounts that the user has access + * to. Each entry in the feed corresponds to a single buyer account. + */ + export interface Schema$AccountsList { + /** + * A list of accounts. + */ + items: Schema$Account[]; + /** + * Resource type. + */ + kind: string; + } + export interface Schema$AddOrderDealsRequest { + /** + * The list of deals to add + */ + deals: Schema$MarketplaceDeal[]; + /** + * The last known proposal revision number. + */ + proposalRevisionNumber: string; + /** + * Indicates an optional action to take on the proposal + */ + updateAction: string; + } + export interface Schema$AddOrderDealsResponse { + /** + * List of deals added (in the same proposal as passed in the request) + */ + deals: Schema$MarketplaceDeal[]; + /** + * The updated revision number for the proposal. + */ + proposalRevisionNumber: string; + } + export interface Schema$AddOrderNotesRequest { + /** + * The list of notes to add. + */ + notes: Schema$MarketplaceNote[]; + } + export interface Schema$AddOrderNotesResponse { + notes: Schema$MarketplaceNote[]; + } + /** + * The configuration data for an Ad Exchange billing info. + */ + export interface Schema$BillingInfo { + /** + * Account id. + */ + accountId: number; + /** + * Account name. + */ + accountName: string; + /** + * A list of adgroup IDs associated with this particular account. These IDs + * may show up as part of a realtime bidding BidRequest, which indicates a + * bid request for this account. + */ + billingId: string[]; + /** + * Resource type. + */ + kind: string; + } + /** + * A billing info feed lists Billing Info the Ad Exchange buyer account has + * access to. Each entry in the feed corresponds to a single billing info. + */ + export interface Schema$BillingInfoList { + /** + * A list of billing info relevant for your account. + */ + items: Schema$BillingInfo[]; + /** + * Resource type. + */ + kind: string; + } + /** + * The configuration data for Ad Exchange RTB - Budget API. + */ + export interface Schema$Budget { + /** + * The id of the account. This is required for get and update requests. + */ + accountId: string; + /** + * The billing id to determine which adgroup to provide budget information + * for. This is required for get and update requests. + */ + billingId: string; + /** + * The daily budget amount in unit amount of the account currency to apply + * for the billingId provided. This is required for update requests. + */ + budgetAmount: string; + /** + * The currency code for the buyer. This cannot be altered here. + */ + currencyCode: string; + /** + * The unique id that describes this item. + */ + id: string; + /** + * The kind of the resource, i.e. "adexchangebuyer#budget". + */ + kind: string; + } + export interface Schema$Buyer { + /** + * Adx account id of the buyer. + */ + accountId: string; + } + export interface Schema$ContactInformation { + /** + * Email address of the contact. + */ + email: string; + /** + * The name of the contact. + */ + name: string; + } + export interface Schema$CreateOrdersRequest { + /** + * The list of proposals to create. + */ + proposals: Schema$Proposal[]; + /** + * Web property id of the seller creating these orders + */ + webPropertyCode: string; + } + export interface Schema$CreateOrdersResponse { + /** + * The list of proposals successfully created. + */ + proposals: Schema$Proposal[]; + } + /** + * A creative and its classification data. + */ + export interface Schema$Creative { + /** + * Account id. + */ + accountId: number; + /** + * The link to the Ad Preferences page. This is only supported for native + * ads. + */ + adChoicesDestinationUrl: string; + /** + * Detected advertiser id, if any. Read-only. This field should not be set + * in requests. + */ + advertiserId: string[]; + /** + * The name of the company being advertised in the creative. The value + * provided must exist in the advertisers.txt file. + */ + advertiserName: string; + /** + * The agency id for this creative. + */ + agencyId: string; + /** + * The last upload timestamp of this creative if it was uploaded via API. + * Read-only. The value of this field is generated, and will be ignored for + * uploads. (formatted RFC 3339 timestamp). + */ + apiUploadTimestamp: string; + /** + * List of buyer selectable attributes for the ads that may be shown from + * this snippet. Each attribute is represented by an integer as defined in + * buyer-declarable-creative-attributes.txt. + */ + attribute: number[]; + /** + * A buyer-specific id identifying the creative in this ad. + */ + buyerCreativeId: string; + /** + * The set of destination urls for the snippet. + */ + clickThroughUrl: string[]; + /** + * Shows any corrections that were applied to this creative. Read-only. This + * field should not be set in requests. + */ + corrections: any[]; + /** + * Top-level deals status. Read-only. This field should not be set in + * requests. If disapproved, an entry for auctionType=DIRECT_DEALS (or ALL) + * in servingRestrictions will also exist. Note that this may be nuanced + * with other contextual restrictions, in which case it may be preferable to + * read from servingRestrictions directly. + */ + dealsStatus: string; + /** + * Detected domains for this creative. Read-only. This field should not be + * set in requests. + */ + detectedDomains: string[]; + /** + * The filtering reasons for the creative. Read-only. This field should not + * be set in requests. + */ + filteringReasons: any; + /** + * Ad height. + */ + height: number; + /** + * The HTML snippet that displays the ad when inserted in the web page. If + * set, videoURL, videoVastXML, and nativeAd should not be set. + */ + HTMLSnippet: string; + /** + * The set of urls to be called to record an impression. + */ + impressionTrackingUrl: string[]; + /** + * Resource type. + */ + kind: string; + /** + * Detected languages for this creative. Read-only. This field should not be + * set in requests. + */ + languages: string[]; + /** + * If nativeAd is set, HTMLSnippet, videoVastXML, and the videoURL outside + * of nativeAd should not be set. (The videoURL inside nativeAd can be set.) + */ + nativeAd: any; + /** + * Top-level open auction status. Read-only. This field should not be set in + * requests. If disapproved, an entry for auctionType=OPEN_AUCTION (or ALL) + * in servingRestrictions will also exist. Note that this may be nuanced + * with other contextual restrictions, in which case it may be preferable to + * read from ServingRestrictions directly. + */ + openAuctionStatus: string; + /** + * Detected product categories, if any. Each category is represented by an + * integer as defined in ad-product-categories.txt. Read-only. This field + * should not be set in requests. + */ + productCategories: number[]; + /** + * All restricted categories for the ads that may be shown from this + * snippet. Each category is represented by an integer as defined in the + * ad-restricted-categories.txt. + */ + restrictedCategories: number[]; + /** + * Detected sensitive categories, if any. Each category is represented by an + * integer as defined in ad-sensitive-categories.txt. Read-only. This field + * should not be set in requests. + */ + sensitiveCategories: number[]; + /** + * The granular status of this ad in specific contexts. A context here + * relates to where something ultimately serves (for example, a physical + * location, a platform, an HTTPS vs HTTP request, or the type of auction). + * Read-only. This field should not be set in requests. See the examples in + * the Creatives guide for more details. + */ + servingRestrictions: any[]; + /** + * List of vendor types for the ads that may be shown from this snippet. + * Each vendor type is represented by an integer as defined in vendors.txt. + */ + vendorType: number[]; + /** + * The version for this creative. Read-only. This field should not be set in + * requests. + */ + version: number; + /** + * The URL to fetch a video ad. If set, HTMLSnippet, videoVastXML, and + * nativeAd should not be set. Note, this is different from + * resource.native_ad.video_url above. + */ + videoURL: string; + /** + * The contents of a VAST document for a video ad. This document should + * conform to the VAST 2.0 or 3.0 standard. If set, HTMLSnippet, videoURL, + * and nativeAd and should not be set. + */ + videoVastXML: string; + /** + * Ad width. + */ + width: number; + } + /** + * The external deal ids associated with a creative. + */ + export interface Schema$CreativeDealIds { + /** + * A list of external deal ids and ARC approval status. + */ + dealStatuses: any[]; + /** + * Resource type. + */ + kind: string; + } + /** + * The creatives feed lists the active creatives for the Ad Exchange buyer + * accounts that the user has access to. Each entry in the feed corresponds to + * a single creative. + */ + export interface Schema$CreativesList { + /** + * A list of creatives. + */ + items: Schema$Creative[]; + /** + * Resource type. + */ + kind: string; + /** + * Continuation token used to page through creatives. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } + export interface Schema$DealServingMetadata { + /** + * True if alcohol ads are allowed for this deal (read-only). This field is + * only populated when querying for finalized orders using the method + * GetFinalizedOrderDeals + */ + alcoholAdsAllowed: boolean; + /** + * Tracks which parties (if any) have paused a deal. (readonly, except via + * PauseResumeOrderDeals action) + */ + dealPauseStatus: Schema$DealServingMetadataDealPauseStatus; + } + /** + * Tracks which parties (if any) have paused a deal. The deal is considered + * paused if has_buyer_paused || has_seller_paused. Each of the + * has_buyer_paused or the has_seller_paused bits can be set independently. + */ + export interface Schema$DealServingMetadataDealPauseStatus { + buyerPauseReason: string; + /** + * If the deal is paused, records which party paused the deal first. + */ + firstPausedBy: string; + hasBuyerPaused: boolean; + hasSellerPaused: boolean; + sellerPauseReason: string; + } + export interface Schema$DealTerms { + /** + * Visibilty of the URL in bid requests. + */ + brandingType: string; + /** + * Indicates that this ExternalDealId exists under at least two different + * AdxInventoryDeals. Currently, the only case that the same ExternalDealId + * will exist is programmatic cross sell case. + */ + crossListedExternalDealIdType: string; + /** + * Description for the proposed terms of the deal. + */ + description: string; + /** + * Non-binding estimate of the estimated gross spend for this deal Can be + * set by buyer or seller. + */ + estimatedGrossSpend: Schema$Price; + /** + * Non-binding estimate of the impressions served per day Can be set by + * buyer or seller. + */ + estimatedImpressionsPerDay: string; + /** + * The terms for guaranteed fixed price deals. + */ + guaranteedFixedPriceTerms: Schema$DealTermsGuaranteedFixedPriceTerms; + /** + * The terms for non-guaranteed auction deals. + */ + nonGuaranteedAuctionTerms: Schema$DealTermsNonGuaranteedAuctionTerms; + /** + * The terms for non-guaranteed fixed price deals. + */ + nonGuaranteedFixedPriceTerms: Schema$DealTermsNonGuaranteedFixedPriceTerms; + /** + * The terms for rubicon non-guaranteed deals. + */ + rubiconNonGuaranteedTerms: Schema$DealTermsRubiconNonGuaranteedTerms; + /** + * For deals with Cost Per Day billing, defines the timezone used to mark + * the boundaries of a day (buyer-readonly) + */ + sellerTimeZone: string; + } + export interface Schema$DealTermsGuaranteedFixedPriceTerms { + /** + * External billing info for this Deal. This field is relevant when external + * billing info such as price has a different currency code than DFP/AdX. + */ + billingInfo: Schema$DealTermsGuaranteedFixedPriceTermsBillingInfo; + /** + * Fixed price for the specified buyer. + */ + fixedPrices: Schema$PricePerBuyer[]; + /** + * Guaranteed impressions as a percentage. This is the percentage of + * guaranteed looks that the buyer is guaranteeing to buy. + */ + guaranteedImpressions: string; + /** + * Count of guaranteed looks. Required for deal, optional for product. For + * CPD deals, buyer changes to guaranteed_looks will be ignored. + */ + guaranteedLooks: string; + /** + * Count of minimum daily looks for a CPD deal. For CPD deals, buyer should + * negotiate on this field instead of guaranteed_looks. + */ + minimumDailyLooks: string; + } + export interface Schema$DealTermsGuaranteedFixedPriceTermsBillingInfo { + /** + * The timestamp (in ms since epoch) when the original reservation price for + * the deal was first converted to DFP currency. This is used to convert the + * contracted price into buyer's currency without discrepancy. + */ + currencyConversionTimeMs: string; + /** + * The DFP line item id associated with this deal. For features like CPD, + * buyers can retrieve the DFP line item for billing reconciliation. + */ + dfpLineItemId: string; + /** + * The original contracted quantity (# impressions) for this deal. To ensure + * delivery, sometimes the publisher will book the deal with a impression + * buffer, such that guaranteed_looks is greater than the contracted + * quantity. However clients are billed using the original contracted + * quantity. + */ + originalContractedQuantity: string; + /** + * The original reservation price for the deal, if the currency code is + * different from the one used in negotiation. + */ + price: Schema$Price; + } + export interface Schema$DealTermsNonGuaranteedAuctionTerms { + /** + * True if open auction buyers are allowed to compete with invited buyers in + * this private auction (buyer-readonly). + */ + autoOptimizePrivateAuction: boolean; + /** + * Reserve price for the specified buyer. + */ + reservePricePerBuyers: Schema$PricePerBuyer[]; + } + export interface Schema$DealTermsNonGuaranteedFixedPriceTerms { + /** + * Fixed price for the specified buyer. + */ + fixedPrices: Schema$PricePerBuyer[]; + } + export interface Schema$DealTermsRubiconNonGuaranteedTerms { + /** + * Optional price for Rubicon priority access in the auction. + */ + priorityPrice: Schema$Price; + /** + * Optional price for Rubicon standard access in the auction. + */ + standardPrice: Schema$Price; + } + export interface Schema$DeleteOrderDealsRequest { + /** + * List of deals to delete for a given proposal + */ + dealIds: string[]; + /** + * The last known proposal revision number. + */ + proposalRevisionNumber: string; + /** + * Indicates an optional action to take on the proposal + */ + updateAction: string; + } + export interface Schema$DeleteOrderDealsResponse { + /** + * List of deals deleted (in the same proposal as passed in the request) + */ + deals: Schema$MarketplaceDeal[]; + /** + * The updated revision number for the proposal. + */ + proposalRevisionNumber: string; + } + export interface Schema$DeliveryControl { + creativeBlockingLevel: string; + deliveryRateType: string; + frequencyCaps: Schema$DeliveryControlFrequencyCap[]; + } + export interface Schema$DeliveryControlFrequencyCap { + maxImpressions: number; + numTimeUnits: number; + timeUnitType: string; + } + /** + * This message carries publisher provided breakdown. E.g. {dimension_type: + * 'COUNTRY', [{dimension_value: {id: 1, name: 'US'}}, + * {dimension_value: {id: 2, name: 'UK'}}]} + */ + export interface Schema$Dimension { + dimensionType: string; + dimensionValues: Schema$DimensionDimensionValue[]; + } + /** + * Value of the dimension. + */ + export interface Schema$DimensionDimensionValue { + /** + * Id of the dimension. + */ + id: number; + /** + * Name of the dimension mainly for debugging purposes, except for the case + * of CREATIVE_SIZE. For CREATIVE_SIZE, strings are used instead of ids. + */ + name: string; + /** + * Percent of total impressions for a dimension type. e.g. {dimension_type: + * 'GENDER', [{dimension_value: {id: 1, name: 'MALE', + * percentage: 60}}]} Gender MALE is 60% of all impressions which have + * gender. + */ + percentage: number; + } + export interface Schema$EditAllOrderDealsRequest { + /** + * List of deals to edit. Service may perform 3 different operations based + * on comparison of deals in this list vs deals already persisted in + * database: 1. Add new deal to proposal If a deal in this list does not + * exist in the proposal, the service will create a new deal and add it to + * the proposal. Validation will follow AddOrderDealsRequest. 2. Update + * existing deal in the proposal If a deal in this list already exist in the + * proposal, the service will update that existing deal to this new deal in + * the request. Validation will follow UpdateOrderDealsRequest. 3. Delete + * deals from the proposal (just need the id) If a existing deal in the + * proposal is not present in this list, the service will delete that deal + * from the proposal. Validation will follow DeleteOrderDealsRequest. + */ + deals: Schema$MarketplaceDeal[]; + /** + * If specified, also updates the proposal in the batch transaction. This is + * useful when the proposal and the deals need to be updated in one + * transaction. + */ + proposal: Schema$Proposal; + /** + * The last known revision number for the proposal. + */ + proposalRevisionNumber: string; + /** + * Indicates an optional action to take on the proposal + */ + updateAction: string; + } + export interface Schema$EditAllOrderDealsResponse { + /** + * List of all deals in the proposal after edit. + */ + deals: Schema$MarketplaceDeal[]; + /** + * The latest revision number after the update has been applied. + */ + orderRevisionNumber: string; + } + export interface Schema$GetOffersResponse { + /** + * The returned list of products. + */ + products: Schema$Product[]; + } + export interface Schema$GetOrderDealsResponse { + /** + * List of deals for the proposal + */ + deals: Schema$MarketplaceDeal[]; + } + export interface Schema$GetOrderNotesResponse { + /** + * The list of matching notes. The notes for a proposal are ordered from + * oldest to newest. If the notes span multiple proposals, they will be + * grouped by proposal, with the notes for the most recently modified + * proposal appearing first. + */ + notes: Schema$MarketplaceNote[]; + } + export interface Schema$GetOrdersResponse { + /** + * The list of matching proposals. + */ + proposals: Schema$Proposal[]; + } + export interface Schema$GetPublisherProfilesByAccountIdResponse { + /** + * Profiles for the requested publisher + */ + profiles: Schema$PublisherProfileApiProto[]; + } + /** + * A proposal can contain multiple deals. A deal contains the terms and + * targeting information that is used for serving. + */ + export interface Schema$MarketplaceDeal { + /** + * Buyer private data (hidden from seller). + */ + buyerPrivateData: Schema$PrivateData; + /** + * The time (ms since epoch) of the deal creation. (readonly) + */ + creationTimeMs: string; + /** + * Specifies the creative pre-approval policy (buyer-readonly) + */ + creativePreApprovalPolicy: string; + /** + * Specifies whether the creative is safeFrame compatible (buyer-readonly) + */ + creativeSafeFrameCompatibility: string; + /** + * A unique deal-id for the deal (readonly). + */ + dealId: string; + /** + * Metadata about the serving status of this deal (readonly, writes via + * custom actions) + */ + dealServingMetadata: Schema$DealServingMetadata; + /** + * The set of fields around delivery control that are interesting for a + * buyer to see but are non-negotiable. These are set by the publisher. This + * message is assigned an id of 100 since some day we would want to model + * this as a protobuf extension. + */ + deliveryControl: Schema$DeliveryControl; + /** + * The external deal id assigned to this deal once the deal is finalized. + * This is the deal-id that shows up in serving/reporting etc. (readonly) + */ + externalDealId: string; + /** + * Proposed flight end time of the deal (ms since epoch) This will generally + * be stored in a granularity of a second. (updatable) + */ + flightEndTimeMs: string; + /** + * Proposed flight start time of the deal (ms since epoch) This will + * generally be stored in a granularity of a second. (updatable) + */ + flightStartTimeMs: string; + /** + * Description for the deal terms. (buyer-readonly) + */ + inventoryDescription: string; + /** + * Indicates whether the current deal is a RFP template. RFP template is + * created by buyer and not based on seller created products. + */ + isRfpTemplate: boolean; + /** + * True, if the buyside inventory setup is complete for this deal. + * (readonly, except via OrderSetupCompleted action) + */ + isSetupComplete: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "adexchangebuyer#marketplaceDeal". + */ + kind: string; + /** + * The time (ms since epoch) when the deal was last updated. (readonly) + */ + lastUpdateTimeMs: string; + /** + * The name of the deal. (updatable) + */ + name: string; + /** + * The product-id from which this deal was created. (readonly, except on + * create) + */ + productId: string; + /** + * The revision number of the product that the deal was created from + * (readonly, except on create) + */ + productRevisionNumber: string; + /** + * Specifies the creative source for programmatic deals, PUBLISHER means + * creative is provided by seller and ADVERTISR means creative is provided + * by buyer. (buyer-readonly) + */ + programmaticCreativeSource: string; + proposalId: string; + /** + * Optional Seller contact information for the deal (buyer-readonly) + */ + sellerContacts: Schema$ContactInformation[]; + /** + * The shared targeting visible to buyers and sellers. Each shared targeting + * entity is AND'd together. (updatable) + */ + sharedTargetings: Schema$SharedTargeting[]; + /** + * The syndication product associated with the deal. (readonly, except on + * create) + */ + syndicationProduct: string; + /** + * The negotiable terms of the deal. (updatable) + */ + terms: Schema$DealTerms; + webPropertyCode: string; + } + export interface Schema$MarketplaceDealParty { + /** + * The buyer/seller associated with the deal. One of buyer/seller is + * specified for a deal-party. + */ + buyer: Schema$Buyer; + /** + * The buyer/seller associated with the deal. One of buyer/seller is + * specified for a deal party. + */ + seller: Schema$Seller; + } + export interface Schema$MarketplaceLabel { + /** + * The accountId of the party that created the label. + */ + accountId: string; + /** + * The creation time (in ms since epoch) for the label. + */ + createTimeMs: string; + /** + * Information about the party that created the label. + */ + deprecatedMarketplaceDealParty: Schema$MarketplaceDealParty; + /** + * The label to use. + */ + label: string; + } + /** + * A proposal is associated with a bunch of notes which may optionally be + * associated with a deal and/or revision number. + */ + export interface Schema$MarketplaceNote { + /** + * The role of the person (buyer/seller) creating the note. (readonly) + */ + creatorRole: string; + /** + * Notes can optionally be associated with a deal. (readonly, except on + * create) + */ + dealId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "adexchangebuyer#marketplaceNote". + */ + kind: string; + /** + * The actual note to attach. (readonly, except on create) + */ + note: string; + /** + * The unique id for the note. (readonly) + */ + noteId: string; + /** + * The proposalId that a note is attached to. (readonly) + */ + proposalId: string; + /** + * If the note is associated with a proposal revision number, then store + * that here. (readonly, except on create) + */ + proposalRevisionNumber: string; + /** + * The timestamp (ms since epoch) that this note was created. (readonly) + */ + timestampMs: string; + } + /** + * The configuration data for an Ad Exchange performance report list. + */ + export interface Schema$PerformanceReport { + /** + * The number of bid responses with an ad. + */ + bidRate: number; + /** + * The number of bid requests sent to your bidder. + */ + bidRequestRate: number; + /** + * Rate of various prefiltering statuses per match. Please refer to the + * callout-status-codes.txt file for different statuses. + */ + calloutStatusRate: any[]; + /** + * Average QPS for cookie matcher operations. + */ + cookieMatcherStatusRate: any[]; + /** + * Rate of ads with a given status. Please refer to the + * creative-status-codes.txt file for different statuses. + */ + creativeStatusRate: any[]; + /** + * The number of bid responses that were filtered due to a policy violation + * or other errors. + */ + filteredBidRate: number; + /** + * Average QPS for hosted match operations. + */ + hostedMatchStatusRate: any[]; + /** + * The number of potential queries based on your pretargeting settings. + */ + inventoryMatchRate: number; + /** + * Resource type. + */ + kind: string; + /** + * The 50th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency50thPercentile: number; + /** + * The 85th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency85thPercentile: number; + /** + * The 95th percentile round trip latency(ms) as perceived from Google + * servers for the duration period covered by the report. + */ + latency95thPercentile: number; + /** + * Rate of various quota account statuses per quota check. + */ + noQuotaInRegion: number; + /** + * Rate of various quota account statuses per quota check. + */ + outOfQuota: number; + /** + * Average QPS for pixel match requests from clients. + */ + pixelMatchRequests: number; + /** + * Average QPS for pixel match responses from clients. + */ + pixelMatchResponses: number; + /** + * The configured quota limits for this account. + */ + quotaConfiguredLimit: number; + /** + * The throttled quota limits for this account. + */ + quotaThrottledLimit: number; + /** + * The trading location of this data. + */ + region: string; + /** + * The number of properly formed bid responses received by our servers + * within the deadline. + */ + successfulRequestRate: number; + /** + * The unix timestamp of the starting time of this performance data. + */ + timestamp: string; + /** + * The number of bid responses that were unsuccessful due to timeouts, + * incorrect formatting, etc. + */ + unsuccessfulRequestRate: number; + } + /** + * The configuration data for an Ad Exchange performance report list. + */ + export interface Schema$PerformanceReportList { + /** + * Resource type. + */ + kind: string; + /** + * A list of performance reports relevant for the account. + */ + performanceReport: Schema$PerformanceReport[]; + } + export interface Schema$PretargetingConfig { + /** + * The id for billing purposes, provided for reference. Leave this field + * blank for insert requests; the id will be generated automatically. + */ + billingId: string; + /** + * The config id; generated automatically. Leave this field blank for insert + * requests. + */ + configId: string; + /** + * The name of the config. Must be unique. Required for all requests. + */ + configName: string; + /** + * List must contain exactly one of PRETARGETING_CREATIVE_TYPE_HTML or + * PRETARGETING_CREATIVE_TYPE_VIDEO. + */ + creativeType: string[]; + /** + * Requests which allow one of these (width, height) pairs will match. All + * pairs must be supported ad dimensions. + */ + dimensions: any[]; + /** + * Requests with any of these content labels will not match. Values are from + * content-labels.txt in the downloadable files section. + */ + excludedContentLabels: string[]; + /** + * Requests containing any of these geo criteria ids will not match. + */ + excludedGeoCriteriaIds: string[]; + /** + * Requests containing any of these placements will not match. + */ + excludedPlacements: any[]; + /** + * Requests containing any of these users list ids will not match. + */ + excludedUserLists: string[]; + /** + * Requests containing any of these vertical ids will not match. Values are + * from the publisher-verticals.txt file in the downloadable files section. + */ + excludedVerticals: string[]; + /** + * Requests containing any of these geo criteria ids will match. + */ + geoCriteriaIds: string[]; + /** + * Whether this config is active. Required for all requests. + */ + isActive: boolean; + /** + * The kind of the resource, i.e. + * "adexchangebuyer#pretargetingConfig". + */ + kind: string; + /** + * Request containing any of these language codes will match. + */ + languages: string[]; + /** + * Requests where the predicted viewability is below the specified decile + * will not match. E.g. if the buyer sets this value to 5, requests from + * slots where the predicted viewability is below 50% will not match. If the + * predicted viewability is unknown this field will be ignored. + */ + minimumViewabilityDecile: number; + /** + * Requests containing any of these mobile carrier ids will match. Values + * are from mobile-carriers.csv in the downloadable files section. + */ + mobileCarriers: string[]; + /** + * Requests containing any of these mobile device ids will match. Values are + * from mobile-devices.csv in the downloadable files section. + */ + mobileDevices: string[]; + /** + * Requests containing any of these mobile operating system version ids will + * match. Values are from mobile-os.csv in the downloadable files section. + */ + mobileOperatingSystemVersions: string[]; + /** + * Requests containing any of these placements will match. + */ + placements: any[]; + /** + * Requests matching any of these platforms will match. Possible values are + * PRETARGETING_PLATFORM_MOBILE, PRETARGETING_PLATFORM_DESKTOP, and + * PRETARGETING_PLATFORM_TABLET. + */ + platforms: string[]; + /** + * Creative attributes should be declared here if all creatives + * corresponding to this pretargeting configuration have that creative + * attribute. Values are from pretargetable-creative-attributes.txt in the + * downloadable files section. + */ + supportedCreativeAttributes: string[]; + /** + * Requests containing the specified type of user data will match. Possible + * values are HOSTED_MATCH_DATA, which means the request is + * cookie-targetable and has a match in the buyer's hosted match table, + * and COOKIE_OR_IDFA, which means the request has either a targetable + * cookie or an iOS IDFA. + */ + userIdentifierDataRequired: string[]; + /** + * Requests containing any of these user list ids will match. + */ + userLists: string[]; + /** + * Requests that allow any of these vendor ids will match. Values are from + * vendors.txt in the downloadable files section. + */ + vendorTypes: string[]; + /** + * Requests containing any of these vertical ids will match. + */ + verticals: string[]; + /** + * Video requests satisfying any of these player size constraints will + * match. + */ + videoPlayerSizes: any[]; + } + export interface Schema$PretargetingConfigList { + /** + * A list of pretargeting configs + */ + items: Schema$PretargetingConfig[]; + /** + * Resource type. + */ + kind: string; + } + export interface Schema$Price { + /** + * The price value in micros. + */ + amountMicros: number; + /** + * The currency code for the price. + */ + currencyCode: string; + /** + * In case of CPD deals, the expected CPM in micros. + */ + expectedCpmMicros: number; + /** + * The pricing type for the deal/product. + */ + pricingType: string; + } + /** + * Used to specify pricing rules for buyers. Each PricePerBuyer in a product + * can become [0,1] deals. To check if there is a PricePerBuyer for a + * particular buyer we look for the most specific matching rule - we first + * look for a rule matching the buyer and otherwise look for a matching rule + * where no buyer is set. + */ + export interface Schema$PricePerBuyer { + /** + * Optional access type for this buyer. + */ + auctionTier: string; + /** + * Reference to the buyer that will get billed. + */ + billedBuyer: Schema$Buyer; + /** + * The buyer who will pay this price. If unset, all buyers can pay this + * price (if the advertisers match, and there's no more specific rule + * matching the buyer). + */ + buyer: Schema$Buyer; + /** + * The specified price + */ + price: Schema$Price; + } + export interface Schema$PrivateData { + referenceId: string; + referencePayload: string; + } + /** + * A product is segment of inventory that a seller wishes to sell. It is + * associated with certain terms and targeting information which helps buyer + * know more about the inventory. Each field in a product can have one of the + * following setting: (readonly) - It is an error to try and set this field. + * (buyer-readonly) - Only the seller can set this field. (seller-readonly) - + * Only the buyer can set this field. (updatable) - The field is updatable at + * all times by either buyer or the seller. + */ + export interface Schema$Product { + /** + * The billed buyer corresponding to the buyer that created the offer. + * (readonly, except on create) + */ + billedBuyer: Schema$Buyer; + /** + * The buyer that created the offer if this is a buyer initiated offer + * (readonly, except on create) + */ + buyer: Schema$Buyer; + /** + * Creation time in ms. since epoch (readonly) + */ + creationTimeMs: string; + /** + * Optional contact information for the creator of this product. + * (buyer-readonly) + */ + creatorContacts: Schema$ContactInformation[]; + /** + * The role that created the offer. Set to BUYER for buyer initiated offers. + */ + creatorRole: string; + /** + * The set of fields around delivery control that are interesting for a + * buyer to see but are non-negotiable. These are set by the publisher. This + * message is assigned an id of 100 since some day we would want to model + * this as a protobuf extension. + */ + deliveryControl: Schema$DeliveryControl; + /** + * The proposed end time for the deal (ms since epoch) (buyer-readonly) + */ + flightEndTimeMs: string; + /** + * Inventory availability dates. (times are in ms since epoch) The + * granularity is generally in the order of seconds. (buyer-readonly) + */ + flightStartTimeMs: string; + /** + * If the creator has already signed off on the product, then the buyer can + * finalize the deal by accepting the product as is. When copying to a + * proposal, if any of the terms are changed, then auto_finalize is + * automatically set to false. + */ + hasCreatorSignedOff: boolean; + /** + * What exchange will provide this inventory (readonly, except on create). + */ + inventorySource: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "adexchangebuyer#product". + */ + kind: string; + /** + * Optional List of labels for the product (optional, buyer-readonly). + */ + labels: Schema$MarketplaceLabel[]; + /** + * Time of last update in ms. since epoch (readonly) + */ + lastUpdateTimeMs: string; + /** + * Optional legacy offer id if this offer is a preferred deal offer. + */ + legacyOfferId: string; + /** + * Marketplace publisher profile Id. This Id differs from the regular + * publisher_profile_id in that 1. This is a new id, the old Id will be + * deprecated in 2017. 2. This id uniquely identifies a publisher profile by + * itself. + */ + marketplacePublisherProfileId: string; + /** + * The name for this product as set by the seller. (buyer-readonly) + */ + name: string; + /** + * Optional private auction id if this offer is a private auction offer. + */ + privateAuctionId: string; + /** + * The unique id for the product (readonly) + */ + productId: string; + /** + * Id of the publisher profile for a given seller. A (seller.account_id, + * publisher_profile_id) pair uniquely identifies a publisher profile. + * Buyers can call the PublisherProfiles::List endpoint to get a list of + * publisher profiles for a given seller. + */ + publisherProfileId: string; + /** + * Publisher self-provided forecast information. + */ + publisherProvidedForecast: Schema$PublisherProvidedForecast; + /** + * The revision number of the product. (readonly) + */ + revisionNumber: string; + /** + * Information about the seller that created this product (readonly, except + * on create) + */ + seller: Schema$Seller; + /** + * Targeting that is shared between the buyer and the seller. Each targeting + * criteria has a specified key and for each key there is a list of + * inclusion value or exclusion values. (buyer-readonly) + */ + sharedTargetings: Schema$SharedTargeting[]; + /** + * The state of the product. (buyer-readonly) + */ + state: string; + /** + * The syndication product associated with the deal. (readonly, except on + * create) + */ + syndicationProduct: string; + /** + * The negotiable terms of the deal (buyer-readonly) + */ + terms: Schema$DealTerms; + /** + * The web property code for the seller. This field is meant to be copied + * over as is when creating deals. + */ + webPropertyCode: string; + } + /** + * Represents a proposal in the marketplace. A proposal is the unit of + * negotiation between a seller and a buyer and contains deals which are + * served. Each field in a proposal can have one of the following setting: + * (readonly) - It is an error to try and set this field. (buyer-readonly) - + * Only the seller can set this field. (seller-readonly) - Only the buyer can + * set this field. (updatable) - The field is updatable at all times by either + * buyer or the seller. + */ + export interface Schema$Proposal { + /** + * Reference to the buyer that will get billed for this proposal. (readonly) + */ + billedBuyer: Schema$Buyer; + /** + * Reference to the buyer on the proposal. (readonly, except on create) + */ + buyer: Schema$Buyer; + /** + * Optional contact information of the buyer. (seller-readonly) + */ + buyerContacts: Schema$ContactInformation[]; + /** + * Private data for buyer. (hidden from seller). + */ + buyerPrivateData: Schema$PrivateData; + /** + * IDs of DBM advertisers permission to this proposal. + */ + dbmAdvertiserIds: string[]; + /** + * When an proposal is in an accepted state, indicates whether the buyer has + * signed off. Once both sides have signed off on a deal, the proposal can + * be finalized by the seller. (seller-readonly) + */ + hasBuyerSignedOff: boolean; + /** + * When an proposal is in an accepted state, indicates whether the buyer has + * signed off Once both sides have signed off on a deal, the proposal can be + * finalized by the seller. (buyer-readonly) + */ + hasSellerSignedOff: boolean; + /** + * What exchange will provide this inventory (readonly, except on create). + */ + inventorySource: string; + /** + * True if the proposal is being renegotiated (readonly). + */ + isRenegotiating: boolean; + /** + * True, if the buyside inventory setup is complete for this proposal. + * (readonly, except via OrderSetupCompleted action) Deprecated in favor of + * deal level setup complete flag. + */ + isSetupComplete: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "adexchangebuyer#proposal". + */ + kind: string; + /** + * List of labels associated with the proposal. (readonly) + */ + labels: Schema$MarketplaceLabel[]; + /** + * The role of the last user that either updated the proposal or left a + * comment. (readonly) + */ + lastUpdaterOrCommentorRole: string; + /** + * The name for the proposal (updatable) + */ + name: string; + /** + * Optional negotiation id if this proposal is a preferred deal proposal. + */ + negotiationId: string; + /** + * Indicates whether the buyer/seller created the proposal.(readonly) + */ + originatorRole: string; + /** + * Optional private auction id if this proposal is a private auction + * proposal. + */ + privateAuctionId: string; + /** + * The unique id of the proposal. (readonly). + */ + proposalId: string; + /** + * The current state of the proposal. (readonly) + */ + proposalState: string; + /** + * The revision number for the proposal (readonly). + */ + revisionNumber: string; + /** + * The time (ms since epoch) when the proposal was last revised (readonly). + */ + revisionTimeMs: string; + /** + * Reference to the seller on the proposal. (readonly, except on create) + */ + seller: Schema$Seller; + /** + * Optional contact information of the seller (buyer-readonly). + */ + sellerContacts: Schema$ContactInformation[]; + } + export interface Schema$PublisherProfileApiProto { + /** + * Deprecated: use the seller.account_id. The account id of the seller. + */ + accountId: string; + /** + * Publisher provided info on its audience. + */ + audience: string; + /** + * A pitch statement for the buyer + */ + buyerPitchStatement: string; + /** + * Direct contact for the publisher profile. + */ + directContact: string; + /** + * Exchange where this publisher profile is from. E.g. AdX, Rubicon etc... + */ + exchange: string; + /** + * Link to publisher's Google+ page. + */ + googlePlusLink: string; + /** + * True, if this is the parent profile, which represents all domains owned + * by the publisher. + */ + isParent: boolean; + /** + * True, if this profile is published. Deprecated for state. + */ + isPublished: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "adexchangebuyer#publisherProfileApiProto". + */ + kind: string; + /** + * The url to the logo for the publisher. + */ + logoUrl: string; + /** + * The url for additional marketing and sales materials. + */ + mediaKitLink: string; + name: string; + /** + * Publisher provided overview. + */ + overview: string; + /** + * The pair of (seller.account_id, profile_id) uniquely identifies a + * publisher profile for a given publisher. + */ + profileId: number; + /** + * Programmatic contact for the publisher profile. + */ + programmaticContact: string; + /** + * The list of domains represented in this publisher profile. Empty if this + * is a parent profile. + */ + publisherDomains: string[]; + /** + * Unique Id for publisher profile. + */ + publisherProfileId: string; + /** + * Publisher provided forecasting information. + */ + publisherProvidedForecast: Schema$PublisherProvidedForecast; + /** + * Link to publisher rate card + */ + rateCardInfoLink: string; + /** + * Link for a sample content page. + */ + samplePageLink: string; + /** + * Seller of the publisher profile. + */ + seller: Schema$Seller; + /** + * State of the publisher profile. + */ + state: string; + /** + * Publisher provided key metrics and rankings. + */ + topHeadlines: string[]; + } + /** + * This message carries publisher provided forecasting information. + */ + export interface Schema$PublisherProvidedForecast { + /** + * Publisher provided dimensions. E.g. geo, sizes etc... + */ + dimensions: Schema$Dimension[]; + /** + * Publisher provided weekly impressions. + */ + weeklyImpressions: string; + /** + * Publisher provided weekly uniques. + */ + weeklyUniques: string; + } + export interface Schema$Seller { + /** + * The unique id for the seller. The seller fills in this field. The seller + * account id is then available to buyer in the product. + */ + accountId: string; + /** + * Optional sub-account id for the seller. + */ + subAccountId: string; + } + export interface Schema$SharedTargeting { + /** + * The list of values to exclude from targeting. Each value is AND'd + * together. + */ + exclusions: Schema$TargetingValue[]; + /** + * The list of value to include as part of the targeting. Each value is + * OR'd together. + */ + inclusions: Schema$TargetingValue[]; + /** + * The key representing the shared targeting criterion. + */ + key: string; + } + export interface Schema$TargetingValue { + /** + * The creative size value to exclude/include. + */ + creativeSizeValue: Schema$TargetingValueCreativeSize; + /** + * The daypart targeting to include / exclude. Filled in when the key is + * GOOG_DAYPART_TARGETING. + */ + dayPartTargetingValue: Schema$TargetingValueDayPartTargeting; + demogAgeCriteriaValue: Schema$TargetingValueDemogAgeCriteria; + demogGenderCriteriaValue: Schema$TargetingValueDemogGenderCriteria; + /** + * The long value to exclude/include. + */ + longValue: string; + /** + * The string value to exclude/include. + */ + stringValue: string; + } + /** + * Next Id: 7 + */ + export interface Schema$TargetingValueCreativeSize { + /** + * The formats allowed by the publisher. + */ + allowedFormats: string[]; + /** + * For video size type, the list of companion sizes. + */ + companionSizes: Schema$TargetingValueSize[]; + /** + * The Creative size type. + */ + creativeSizeType: string; + /** + * The native template for native ad. + */ + nativeTemplate: string; + /** + * For regular or video creative size type, specifies the size of the + * creative. + */ + size: Schema$TargetingValueSize; + /** + * The skippable ad type for video size. + */ + skippableAdType: string; + } + export interface Schema$TargetingValueDayPartTargeting { + dayParts: Schema$TargetingValueDayPartTargetingDayPart[]; + timeZoneType: string; + } + export interface Schema$TargetingValueDayPartTargetingDayPart { + dayOfWeek: string; + endHour: number; + endMinute: number; + startHour: number; + startMinute: number; + } + export interface Schema$TargetingValueDemogAgeCriteria { + demogAgeCriteriaIds: string[]; + } + export interface Schema$TargetingValueDemogGenderCriteria { + demogGenderCriteriaIds: string[]; + } + export interface Schema$TargetingValueSize { + /** + * The height of the creative. + */ + height: number; + /** + * The width of the creative. + */ + width: number; + } + export interface Schema$UpdatePrivateAuctionProposalRequest { + /** + * The externalDealId of the deal to be updated. + */ + externalDealId: string; + /** + * Optional note to be added. + */ + note: Schema$MarketplaceNote; + /** + * The current revision number of the proposal to be updated. + */ + proposalRevisionNumber: string; + /** + * The proposed action on the private auction proposal. + */ + updateAction: string; + } + + export class Resource$Accounts { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.accounts.get + * @desc Gets one account by ID. + * @alias adexchangebuyer.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id The account id + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.accounts.list + * @desc Retrieves the authenticated user's list of accounts. + * @alias adexchangebuyer.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.accounts.patch + * @desc Updates an existing account. This method supports patch semantics. + * @alias adexchangebuyer.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.confirmUnsafeAccountChange Confirmation for erasing bidder and cookie matching urls. + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.accounts.update + * @desc Updates an existing account. + * @alias adexchangebuyer.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.confirmUnsafeAccountChange Confirmation for erasing bidder and cookie matching urls. + * @param {integer} params.id The account id + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Billinginfo { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.billingInfo.get + * @desc Returns the billing information for one account specified by + * account ID. + * @alias adexchangebuyer.billingInfo.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The account id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/billinginfo/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.billingInfo.list + * @desc Retrieves a list of billing information for all accounts of the + * authenticated user. + * @alias adexchangebuyer.billingInfo.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/billinginfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Budget { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.budget.get + * @desc Returns the budget information for the adgroup specified by the + * accountId and billingId. + * @alias adexchangebuyer.budget.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the budget information for. + * @param {string} params.billingId The billing id to get the budget information for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.budget.patch + * @desc Updates the budget amount for the budget of the adgroup specified + * by the accountId and billingId, with the budget amount in the request. + * This method supports patch semantics. + * @alias adexchangebuyer.budget.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id associated with the budget being updated. + * @param {string} params.billingId The billing id associated with the budget being updated. + * @param {().Budget} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.budget.update + * @desc Updates the budget amount for the budget of the adgroup specified + * by the accountId and billingId, with the budget amount in the request. + * @alias adexchangebuyer.budget.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id associated with the budget being updated. + * @param {string} params.billingId The billing id associated with the budget being updated. + * @param {().Budget} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'billingId'], + pathParams: ['accountId', 'billingId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creatives { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.creatives.addDeal + * @desc Add a deal id association for the creative. + * @alias adexchangebuyer.creatives.addDeal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {string} params.dealId The id of the deal id to associate with this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addDeal(params?: any, options?: MethodOptions): AxiosPromise; + addDeal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addDeal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId', 'dealId'], + pathParams: ['accountId', 'buyerCreativeId', 'dealId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.creatives.get + * @desc Gets the status for a single creative. A creative will be available + * 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId'], + pathParams: ['accountId', 'buyerCreativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.creatives.insert + * @desc Submit a new creative. + * @alias adexchangebuyer.creatives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.creatives.list + * @desc Retrieves a list of the authenticated user's active creatives. A + * creative will be available 30-40 minutes after submission. + * @alias adexchangebuyer.creatives.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.accountId When specified, only creatives for the given account ids are returned. + * @param {string=} params.buyerCreativeId When specified, only creatives for the given buyer creative ids are returned. + * @param {string=} params.dealsStatusFilter When specified, only creatives having the given deals status are returned. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * @param {string=} params.openAuctionStatusFilter When specified, only creatives having the given open auction status are returned. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.creatives.listDeals + * @desc Lists the external deal ids associated with the creative. + * @alias adexchangebuyer.creatives.listDeals + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listDeals(params?: any, options?: MethodOptions): + AxiosPromise; + listDeals( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listDeals( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/listDeals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId'], + pathParams: ['accountId', 'buyerCreativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.creatives.removeDeal + * @desc Remove a deal id associated with the creative. + * @alias adexchangebuyer.creatives.removeDeal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The id for the account that will serve this creative. + * @param {string} params.buyerCreativeId The buyer-specific id for this creative. + * @param {string} params.dealId The id of the deal id to disassociate with this creative. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeDeal(params?: any, options?: MethodOptions): AxiosPromise; + removeDeal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeDeal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/removeDeal/{dealId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'buyerCreativeId', 'dealId'], + pathParams: ['accountId', 'buyerCreativeId', 'dealId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Marketplacedeals { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.marketplacedeals.delete + * @desc Delete the specified deals from the proposal + * @alias adexchangebuyer.marketplacedeals.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposalId to delete deals from. + * @param {().DeleteOrderDealsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/delete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.marketplacedeals.insert + * @desc Add new deals for the specified proposal + * @alias adexchangebuyer.marketplacedeals.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId proposalId for which deals need to be added. + * @param {().AddOrderDealsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/insert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.marketplacedeals.list + * @desc List all the deals for a given proposal + * @alias adexchangebuyer.marketplacedeals.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pqlQuery Query string to retrieve specific deals. + * @param {string} params.proposalId The proposalId to get deals for. To search across all proposals specify order_id = '-' as part of the URL. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/deals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.marketplacedeals.update + * @desc Replaces all the deals in the proposal with the passed in deals + * @alias adexchangebuyer.marketplacedeals.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposalId to edit deals on. + * @param {().EditAllOrderDealsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/deals/update') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Marketplacenotes { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.marketplacenotes.insert + * @desc Add notes to the proposal + * @alias adexchangebuyer.marketplacenotes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposalId to add notes for. + * @param {().AddOrderNotesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/notes/insert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.marketplacenotes.list + * @desc Get all the notes associated with a proposal + * @alias adexchangebuyer.marketplacenotes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pqlQuery Query string to retrieve specific notes. To search the text contents of notes, please use syntax like "WHERE note.note = "foo" or "WHERE note.note LIKE "%bar%" + * @param {string} params.proposalId The proposalId to get notes for. To search across all proposals specify order_id = '-' as part of the URL. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/notes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Marketplaceprivateauction { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.marketplaceprivateauction.updateproposal + * @desc Update a given private auction proposal + * @alias adexchangebuyer.marketplaceprivateauction.updateproposal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.privateAuctionId The private auction id to be updated. + * @param {().UpdatePrivateAuctionProposalRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateproposal(params?: any, options?: MethodOptions): AxiosPromise; + updateproposal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateproposal( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/privateauction/{privateAuctionId}/updateproposal') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['privateAuctionId'], + pathParams: ['privateAuctionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Performancereport { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.performanceReport.list + * @desc Retrieves the authenticated user's list of performance metrics. + * @alias adexchangebuyer.performanceReport.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the reports. + * @param {string} params.endDateTime The end time of the report in ISO 8601 timestamp format using UTC. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. If not set, the default is 100. Optional. + * @param {string=} params.pageToken A continuation token, used to page through performance reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. Optional. + * @param {string} params.startDateTime The start time of the report in ISO 8601 timestamp format using UTC. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/performancereport') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'endDateTime', 'startDateTime'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Pretargetingconfig { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.pretargetingConfig.delete + * @desc Deletes an existing pretargeting config. + * @alias adexchangebuyer.pretargetingConfig.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to delete the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.pretargetingConfig.get + * @desc Gets a specific pretargeting configuration + * @alias adexchangebuyer.pretargetingConfig.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.pretargetingConfig.insert + * @desc Inserts a new pretargeting configuration. + * @alias adexchangebuyer.pretargetingConfig.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to insert the pretargeting config for. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.pretargetingConfig.list + * @desc Retrieves a list of the authenticated user's pretargeting + * configurations. + * @alias adexchangebuyer.pretargetingConfig.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to get the pretargeting configs for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.pretargetingConfig.patch + * @desc Updates an existing pretargeting config. This method supports patch + * semantics. + * @alias adexchangebuyer.pretargetingConfig.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to update the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to update. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.pretargetingConfig.update + * @desc Updates an existing pretargeting config. + * @alias adexchangebuyer.pretargetingConfig.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account id to update the pretargeting config for. + * @param {string} params.configId The specific id of the configuration to update. + * @param {().PretargetingConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/pretargetingconfigs/{accountId}/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'configId'], + pathParams: ['accountId', 'configId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Products { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.products.get + * @desc Gets the requested product by id. + * @alias adexchangebuyer.products.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId The id for the product to get the head revision for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/products/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['productId'], + pathParams: ['productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.products.search + * @desc Gets the requested product. + * @alias adexchangebuyer.products.search + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.pqlQuery The pql query used to query for products. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/products/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Proposals { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.proposals.get + * @desc Get a proposal given its id + * @alias adexchangebuyer.proposals.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId Id of the proposal to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/proposals/{proposalId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.proposals.insert + * @desc Create the given list of proposals + * @alias adexchangebuyer.proposals.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CreateOrdersRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/proposals/insert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.proposals.patch + * @desc Update the given proposal. This method supports patch semantics. + * @alias adexchangebuyer.proposals.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposal id to update. + * @param {string} params.revisionNumber The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. + * @param {string} params.updateAction The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. + * @param {().Proposal} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['proposalId', 'revisionNumber', 'updateAction'], + pathParams: ['proposalId', 'revisionNumber', 'updateAction'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.proposals.search + * @desc Search for proposals using pql query + * @alias adexchangebuyer.proposals.search + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.pqlQuery Query string to retrieve specific proposals. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangebuyer/v1.4/proposals/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.proposals.setupcomplete + * @desc Update the given proposal to indicate that setup has been + * completed. + * @alias adexchangebuyer.proposals.setupcomplete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposal id for which the setup is complete + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setupcomplete(params?: any, options?: MethodOptions): AxiosPromise; + setupcomplete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setupcomplete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/setupcomplete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['proposalId'], + pathParams: ['proposalId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer.proposals.update + * @desc Update the given proposal + * @alias adexchangebuyer.proposals.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.proposalId The proposal id to update. + * @param {string} params.revisionNumber The last known revision number to update. If the head revision in the marketplace database has since changed, an error will be thrown. The caller should then fetch the latest proposal at head revision and retry the update at that revision. + * @param {string} params.updateAction The proposed action to take on the proposal. This field is required and it must be set when updating a proposal. + * @param {().Proposal} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['proposalId', 'revisionNumber', 'updateAction'], + pathParams: ['proposalId', 'revisionNumber', 'updateAction'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Pubprofiles { + root: Adexchangebuyer; + constructor(root: Adexchangebuyer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer.pubprofiles.list + * @desc Gets the requested publisher profile(s) by publisher accountId. + * @alias adexchangebuyer.pubprofiles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.accountId The accountId of the publisher to get profiles for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GetPublisherProfilesByAccountIdResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GetPublisherProfilesByAccountIdResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangebuyer/v1.4/publisher/{accountId}/profiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/adexchangebuyer2/v2beta1.ts b/src/apis/adexchangebuyer2/v2beta1.ts index 0899992bb52..a0f55c8a0fd 100644 --- a/src/apis/adexchangebuyer2/v2beta1.ts +++ b/src/apis/adexchangebuyer2/v2beta1.ts @@ -27,4597 +27,4661 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Buyer API II - * - * Accesses the latest features for managing Ad Exchange accounts, Real-Time - * Bidding configurations and auction metrics, and Marketplace programmatic - * deals. - * - * @example - * const google = require('googleapis'); - * const adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); - * - * @namespace adexchangebuyer2 - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Adexchangebuyer2 - */ -export class Adexchangebuyer2 { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - bidders: Resource$Bidders; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.bidders = new Resource$Bidders(this); - } - - getRoot() { - return this.root; - } -} - -/** - * An absolute date range, specified by its start date and end date. The - * supported range of dates begins 30 days before today and ends today. Validity - * checked upon filter set creation. If a filter set with an absolute date range - * is run at a later date more than 30 days after start_date, it will fail. - */ -export interface Schema$AbsoluteDateRange { - /** - * The end date of the range (inclusive). Must be within the 30 days leading - * up to current date, and must be equal to or after start_date. - */ - endDate: Schema$Date; - /** - * The start date of the range (inclusive). Must be within the 30 days leading - * up to current date, and must be equal to or before end_date. - */ - startDate: Schema$Date; -} -/** - * A request for associating a deal and a creative. - */ -export interface Schema$AddDealAssociationRequest { - /** - * The association between a creative and a deal that should be added. - */ - association: Schema$CreativeDealAssociation; -} -/** - * @OutputOnly The app type the restriction applies to for mobile device. - */ -export interface Schema$AppContext { - /** - * The app types this restriction applies to. - */ - appTypes: string[]; -} -/** - * @OutputOnly The auction type the restriction applies to. - */ -export interface Schema$AuctionContext { - /** - * The auction types this restriction applies to. - */ - auctionTypes: string[]; -} -/** - * The set of metrics that are measured in numbers of bids, representing how - * many bids with the specified dimension values were considered eligible at - * each stage of the bidding funnel; - */ -export interface Schema$BidMetricsRow { - /** - * The number of bids that Ad Exchange received from the buyer. - */ - bids: Schema$MetricValue; - /** - * The number of bids that were permitted to compete in the auction. - */ - bidsInAuction: Schema$MetricValue; - /** - * The number of bids for which the buyer was billed. - */ - billedImpressions: Schema$MetricValue; - /** - * The number of bids that won an impression. - */ - impressionsWon: Schema$MetricValue; - /** - * The number of bids for which the corresponding impression was measurable - * for viewability (as defined by Active View). - */ - measurableImpressions: Schema$MetricValue; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; - /** - * The number of bids for which the corresponding impression was viewable (as - * defined by Active View). - */ - viewableImpressions: Schema$MetricValue; -} -/** - * The number of impressions with the specified dimension values that were - * considered to have no applicable bids, as described by the specified status. - */ -export interface Schema$BidResponseWithoutBidsStatusRow { - /** - * The number of impressions for which there was a bid response with the - * specified status. - */ - impressionCount: Schema$MetricValue; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; - /** - * The status specifying why the bid responses were considered to have no - * applicable bids. - */ - status: string; -} -/** - * The number of impressions with the specified dimension values where the - * corresponding bid request or bid response was not successful, as described by - * the specified callout status. - */ -export interface Schema$CalloutStatusRow { - /** - * The ID of the callout status. See - * [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes). - */ - calloutStatusId: number; - /** - * The number of impressions for which there was a bid request or bid response - * with the specified callout status. - */ - impressionCount: Schema$MetricValue; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; -} -/** - * A client resource represents a client buyer&mdash;an agency, a brand, or - * an advertiser customer of the sponsor buyer. Users associated with the client - * buyer have restricted access to the Ad Exchange Marketplace and certain other - * sections of the Ad Exchange Buyer UI based on the role granted to the client - * buyer. All fields are required unless otherwise specified. - */ -export interface Schema$Client { - /** - * The globally-unique numerical ID of the client. The value of this field is - * ignored in create and update operations. - */ - clientAccountId: string; - /** - * Name used to represent this client to publishers. You may have multiple - * clients that map to the same entity, but for each client the combination of - * `clientName` and entity must be unique. You can specify this field as - * empty. - */ - clientName: string; - /** - * Numerical identifier of the client entity. The entity can be an advertiser, - * a brand, or an agency. This identifier is unique among all the entities - * with the same type. A list of all known advertisers with their identifiers - * is available in the - * [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt) - * file. A list of all known brands with their identifiers is available in - * the - * [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt) - * file. A list of all known agencies with their identifiers is available in - * the - * [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt) - * file. - */ - entityId: string; - /** - * The name of the entity. This field is automatically fetched based on the - * type and ID. The value of this field is ignored in create and update - * operations. - */ - entityName: string; - /** - * The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`. - */ - entityType: string; - /** - * Optional arbitrary unique identifier of this client buyer from the - * standpoint of its Ad Exchange sponsor buyer. This field can be used to - * associate a client buyer with the identifier in the namespace of its - * sponsor buyer, lookup client buyers by that identifier and verify whether - * an Ad Exchange counterpart of a given client buyer already exists. If - * present, must be unique among all the client buyers for its Ad Exchange - * sponsor buyer. - */ - partnerClientId: string; - /** - * The role which is assigned to the client buyer. Each role implies a set of - * permissions granted to the client. Must be one of `CLIENT_DEAL_VIEWER`, - * `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`. - */ - role: string; - /** - * The status of the client buyer. - */ - status: string; - /** - * Whether the client buyer will be visible to sellers. - */ - visibleToSeller: boolean; -} -/** - * A client user is created under a client buyer and has restricted access to - * the Ad Exchange Marketplace and certain other sections of the Ad Exchange - * Buyer UI based on the role granted to the associated client buyer. The only - * way a new client user can be created is via accepting an email invitation - * (see the accounts.clients.invitations.create method). All fields are - * required unless otherwise specified. - */ -export interface Schema$ClientUser { - /** - * Numerical account ID of the client buyer with which the user is associated; - * the buyer must be a client of the current sponsor buyer. The value of this - * field is ignored in an update operation. - */ - clientAccountId: string; - /** - * User's email address. The value of this field is ignored in an update - * operation. - */ - email: string; - /** - * The status of the client user. - */ - status: string; - /** - * The unique numerical ID of the client user that has accepted an invitation. - * The value of this field is ignored in an update operation. - */ - userId: string; -} -/** - * An invitation for a new client user to get access to the Ad Exchange Buyer - * UI. All fields are required unless otherwise specified. - */ -export interface Schema$ClientUserInvitation { - /** - * Numerical account ID of the client buyer that the invited user is - * associated with. The value of this field is ignored in create operations. - */ - clientAccountId: string; - /** - * The email address to which the invitation is sent. Email addresses should - * be unique among all client users under each sponsor buyer. - */ - email: string; - /** - * The unique numerical ID of the invitation that is sent to the user. The - * value of this field is ignored in create operations. - */ - invitationId: string; -} -/** - * @OutputOnly Shows any corrections that were applied to this creative. - */ -export interface Schema$Correction { - /** - * The contexts for the correction. - */ - contexts: Schema$ServingContext[]; - /** - * Additional details about what was corrected. - */ - details: string[]; - /** - * The type of correction that was applied to the creative. - */ - type: string; -} -/** - * A creative and its classification data. Next ID: 35 - */ -export interface Schema$Creative { - /** - * The account that this creative belongs to. Can be used to filter the - * response of the creatives.list method. - */ - accountId: string; - /** - * The link to AdChoices destination page. - */ - adChoicesDestinationUrl: string; - /** - * The name of the company being advertised in the creative. - */ - advertiserName: string; - /** - * The agency ID for this creative. - */ - agencyId: string; - /** - * @OutputOnly The last update timestamp of the creative via API. - */ - apiUpdateTime: string; - /** - * All attributes for the ads that may be shown from this creative. Can be - * used to filter the response of the creatives.list method. - */ - attributes: string[]; - /** - * The set of destination URLs for the creative. - */ - clickThroughUrls: string[]; - /** - * @OutputOnly Shows any corrections that were applied to this creative. - */ - corrections: Schema$Correction[]; - /** - * The buyer-defined creative ID of this creative. Can be used to filter the - * response of the creatives.list method. - */ - creativeId: string; - /** - * @OutputOnly The top-level deals status of this creative. If disapproved, an - * entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in - * serving_restrictions will also exist. Note that this may be nuanced with - * other contextual restrictions, in which case, it may be preferable to read - * from serving_restrictions directly. Can be used to filter the response of - * the creatives.list method. - */ - dealsStatus: string; - /** - * @OutputOnly Detected advertiser IDs, if any. - */ - detectedAdvertiserIds: string[]; - /** - * @OutputOnly The detected domains for this creative. - */ - detectedDomains: string[]; - /** - * @OutputOnly The detected languages for this creative. The order is - * arbitrary. The codes are 2 or 5 characters and are documented at - * https://developers.google.com/adwords/api/docs/appendix/languagecodes. - */ - detectedLanguages: string[]; - /** - * @OutputOnly Detected product categories, if any. See the - * ad-product-categories.txt file in the technical documentation for a list of - * IDs. - */ - detectedProductCategories: number[]; - /** - * @OutputOnly Detected sensitive categories, if any. See the - * ad-sensitive-categories.txt file in the technical documentation for a list - * of IDs. You should use these IDs along with the excluded-sensitive-category - * field in the bid request to filter your bids. - */ - detectedSensitiveCategories: number[]; - /** - * @OutputOnly The filtering stats for this creative. - */ - filteringStats: Schema$FilteringStats; - /** - * An HTML creative. - */ - html: Schema$HtmlContent; - /** - * The set of URLs to be called to record an impression. - */ - impressionTrackingUrls: string[]; - /** - * A native creative. - */ - native: Schema$NativeContent; - /** - * @OutputOnly The top-level open auction status of this creative. If - * disapproved, an entry for 'auctionType = OPEN_AUCTION' (or - * 'ALL') in serving_restrictions will also exist. Note that this may - * be nuanced with other contextual restrictions, in which case, it may be - * preferable to read from serving_restrictions directly. Can be used to - * filter the response of the creatives.list method. - */ - openAuctionStatus: string; - /** - * All restricted categories for the ads that may be shown from this creative. - */ - restrictedCategories: string[]; - /** - * @OutputOnly The granular status of this ad in specific contexts. A context - * here relates to where something ultimately serves (for example, a physical - * location, a platform, an HTTPS vs HTTP request, or the type of auction). - */ - servingRestrictions: Schema$ServingRestriction[]; - /** - * All vendor IDs for the ads that may be shown from this creative. See - * https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt for - * possible values. - */ - vendorIds: number[]; - /** - * @OutputOnly The version of this creative. - */ - version: number; - /** - * A video creative. - */ - video: Schema$VideoContent; -} -/** - * The association between a creative and a deal. - */ -export interface Schema$CreativeDealAssociation { - /** - * The account the creative belongs to. - */ - accountId: string; - /** - * The ID of the creative associated with the deal. - */ - creativeId: string; - /** - * The externalDealId for the deal associated with the creative. - */ - dealsId: string; -} -/** - * The number of bids with the specified dimension values that did not win the - * auction (either were filtered pre-auction or lost the auction), as described - * by the specified creative status. - */ -export interface Schema$CreativeStatusRow { - /** - * The number of bids with the specified status. - */ - bidCount: Schema$MetricValue; - /** - * The ID of the creative status. See - * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). - */ - creativeStatusId: number; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * @OutputOnly The reason and details for a disapproval. - */ -export interface Schema$Disapproval { - /** - * Additional details about the reason for disapproval. - */ - details: string[]; - /** - * The categorized reason for disapproval. - */ - reason: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The number of filtered bids with the specified dimension values that have the - * specified creative. - */ -export interface Schema$FilteredBidCreativeRow { - /** - * The number of bids with the specified creative. - */ - bidCount: Schema$MetricValue; - /** - * The ID of the creative. - */ - creativeId: string; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; -} -/** - * The number of filtered bids with the specified dimension values, among those - * filtered due to the requested filtering reason (i.e. creative status), that - * have the specified detail. - */ -export interface Schema$FilteredBidDetailRow { - /** - * The number of bids with the specified detail. - */ - bidCount: Schema$MetricValue; - /** - * The ID of the detail. The associated value can be looked up in the - * dictionary file corresponding to the DetailType in the response message. - */ - detailId: number; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; -} -/** - * @OutputOnly Filtering reasons for this creative during a period of a single - * day (from midnight to midnight Pacific). - */ -export interface Schema$FilteringStats { - /** - * The day during which the data was collected. The data is collected from - * 00:00:00 to 23:59:59 PT. During switches from PST to PDT and back, the day - * may contain 23 or 25 hours of data instead of the usual 24. - */ - date: Schema$Date; - /** - * The set of filtering reasons for this date. - */ - reasons: Schema$Reason[]; -} -/** - * A set of filters that is applied to a request for data. Within a filter set, - * an AND operation is performed across the filters represented by each field. - * An OR operation is performed across the filters represented by the multiple - * values of a repeated field. E.g. "format=VIDEO AND deal_id=12 AND - * (seller_network_id=34 OR seller_network_id=56)" - */ -export interface Schema$FilterSet { - /** - * An absolute date range, defined by a start date and an end date. - * Interpreted relative to Pacific time zone. - */ - absoluteDateRange: Schema$AbsoluteDateRange; - /** - * The ID of the creative on which to filter; optional. This field may be set - * only for a filter set that accesses account-level troubleshooting data, - * i.e. one whose name matches the `bidders/x/accounts/x/filterSets/x pattern. - */ - creativeId: string; - /** - * The ID of the deal on which to filter; optional. This field may be set only - * for a filter set that accesses account-level troubleshooting data, i.e. one - * whose name matches the `bidders/x/accounts/x/filterSets/x pattern. - */ - dealId: string; - /** - * The environment on which to filter; optional. - */ - environment: string; - /** - * The list of formats on which to filter; may be empty. The filters - * represented by multiple formats are ORed together (i.e. if non-empty, - * results must match any one of the formats). - */ - formats: string[]; - /** - * A user-defined name of the filter set. Filter set names must be unique - * globally and match one of the patterns: - `bidders/x/filterSets/x (for - * accessing bidder-level troubleshooting data) - - * `bidders/x/accounts/x/filterSets/x (for accessing account-level - * troubleshooting data) This field is required in create operations. - */ - name: string; - /** - * The list of platforms on which to filter; may be empty. The filters - * represented by multiple platforms are ORed together (i.e. if non-empty, - * results must match any one of the platforms). - */ - platforms: string[]; - /** - * For Exchange Bidding buyers only. The list of publisher identifiers on - * which to filter; may be empty. The filters represented by multiple - * publisher identifiers are ORed together. - */ - publisherIdentifiers: string[]; - /** - * An open-ended realtime time range, defined by the aggregation start - * timestamp. - */ - realtimeTimeRange: Schema$RealtimeTimeRange; - /** - * A relative date range, defined by an offset from today and a duration. - * Interpreted relative to Pacific time zone. - */ - relativeDateRange: Schema$RelativeDateRange; - /** - * For Ad Exchange buyers only. The list of IDs of the seller (publisher) - * networks on which to filter; may be empty. The filters represented by - * multiple seller network IDs are ORed together (i.e. if non-empty, results - * must match any one of the publisher networks). See - * [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) - * file for the set of existing seller network IDs. - */ - sellerNetworkIds: number[]; - /** - * The granularity of time intervals if a time series breakdown is desired; - * optional. - */ - timeSeriesGranularity: string; -} -/** - * HTML content for a creative. - */ -export interface Schema$HtmlContent { - /** - * The height of the HTML snippet in pixels. - */ - height: number; - /** - * The HTML snippet that displays the ad when inserted in the web page. - */ - snippet: string; - /** - * The width of the HTML snippet in pixels. - */ - width: number; -} -/** - * An image resource. You may provide a larger image than was requested, so long - * as the aspect ratio is preserved. - */ -export interface Schema$Image { - /** - * Image height in pixels. - */ - height: number; - /** - * The URL of the image. - */ - url: string; - /** - * Image width in pixels. - */ - width: number; -} -/** - * The set of metrics that are measured in numbers of impressions, representing - * how many impressions with the specified dimension values were considered - * eligible at each stage of the bidding funnel. - */ -export interface Schema$ImpressionMetricsRow { - /** - * The number of impressions available to the buyer on Ad Exchange. In some - * cases this value may be unavailable. - */ - availableImpressions: Schema$MetricValue; - /** - * The number of impressions for which Ad Exchange sent the buyer a bid - * request. - */ - bidRequests: Schema$MetricValue; - /** - * The number of impressions that match the buyer's inventory - * pretargeting. - */ - inventoryMatches: Schema$MetricValue; - /** - * The number of impressions for which Ad Exchange received a response from - * the buyer that contained at least one applicable bid. - */ - responsesWithBids: Schema$MetricValue; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; - /** - * The number of impressions for which the buyer successfully sent a response - * to Ad Exchange. - */ - successfulResponses: Schema$MetricValue; -} -/** - * Response message for listing the metrics that are measured in number of bids. - */ -export interface Schema$ListBidMetricsResponse { - /** - * List of rows, each containing a set of bid metrics. - */ - bidMetricsRows: Schema$BidMetricsRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListBidMetricsRequest.pageToken field in the subsequent call to the - * bidMetrics.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons that bid responses resulted in an - * error. - */ -export interface Schema$ListBidResponseErrorsResponse { - /** - * List of rows, with counts of bid responses aggregated by callout status. - */ - calloutStatusRows: Schema$CalloutStatusRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListBidResponseErrorsRequest.pageToken field in the subsequent call to the - * bidResponseErrors.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons that bid responses were considered - * to have no applicable bids. - */ -export interface Schema$ListBidResponsesWithoutBidsResponse { - /** - * List of rows, with counts of bid responses without bids aggregated by - * status. - */ - bidResponseWithoutBidsStatusRows: Schema$BidResponseWithoutBidsStatusRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListBidResponsesWithoutBidsRequest.pageToken field in the subsequent call - * to the bidResponsesWithoutBids.list method to retrieve the next page of - * results. - */ - nextPageToken: string; -} -export interface Schema$ListClientsResponse { - /** - * The returned list of clients. - */ - clients: Schema$Client[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListClientsRequest.pageToken field in the subsequent call to the - * accounts.clients.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -export interface Schema$ListClientUserInvitationsResponse { - /** - * The returned list of client users. - */ - invitations: Schema$ClientUserInvitation[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListClientUserInvitationsRequest.pageToken field in the subsequent call to - * the clients.invitations.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -export interface Schema$ListClientUsersResponse { - /** - * A token to retrieve the next page of results. Pass this value in the - * ListClientUsersRequest.pageToken field in the subsequent call to the - * clients.invitations.list method to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The returned list of client users. - */ - users: Schema$ClientUser[]; -} -/** - * A response for listing creatives. - */ -export interface Schema$ListCreativesResponse { - /** - * The list of creatives. - */ - creatives: Schema$Creative[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListCreativesRequest.page_token field in the subsequent call to - * `ListCreatives` method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all creatives associated with a given filtered - * bid reason. - */ -export interface Schema$ListCreativeStatusBreakdownByCreativeResponse { - /** - * List of rows, with counts of bids with a given creative status aggregated - * by creative. - */ - filteredBidCreativeRows: Schema$FilteredBidCreativeRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListCreativeStatusBreakdownByCreativeRequest.pageToken field in the - * subsequent call to the filteredBids.creatives.list method to retrieve the - * next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all details associated with a given filtered bid - * reason. - */ -export interface Schema$ListCreativeStatusBreakdownByDetailResponse { - /** - * The type of detail that the detail IDs represent. - */ - detailType: string; - /** - * List of rows, with counts of bids with a given creative status aggregated - * by detail. - */ - filteredBidDetailRows: Schema$FilteredBidDetailRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListCreativeStatusBreakdownByDetailRequest.pageToken field in the - * subsequent call to the filteredBids.details.list method to retrieve the - * next page of results. - */ - nextPageToken: string; -} -/** - * A response for listing creative and deal associations - */ -export interface Schema$ListDealAssociationsResponse { - /** - * The list of associations. - */ - associations: Schema$CreativeDealAssociation[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListDealAssociationsRequest.page_token field in the subsequent call to - * 'ListDealAssociation' method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons that bid requests were filtered and - * not sent to the buyer. - */ -export interface Schema$ListFilteredBidRequestsResponse { - /** - * List of rows, with counts of filtered bid requests aggregated by callout - * status. - */ - calloutStatusRows: Schema$CalloutStatusRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListFilteredBidRequestsRequest.pageToken field in the subsequent call to - * the filteredBidRequests.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons that bids were filtered from the - * auction. - */ -export interface Schema$ListFilteredBidsResponse { - /** - * List of rows, with counts of filtered bids aggregated by filtering reason - * (i.e. creative status). - */ - creativeStatusRows: Schema$CreativeStatusRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListFilteredBidsRequest.pageToken field in the subsequent call to the - * filteredBids.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing filter sets. - */ -export interface Schema$ListFilterSetsResponse { - /** - * The filter sets belonging to the buyer. - */ - filterSets: Schema$FilterSet[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListFilterSetsRequest.pageToken field in the subsequent call to the - * accounts.filterSets.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing the metrics that are measured in number of - * impressions. - */ -export interface Schema$ListImpressionMetricsResponse { - /** - * List of rows, each containing a set of impression metrics. - */ - impressionMetricsRows: Schema$ImpressionMetricsRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListImpressionMetricsRequest.pageToken field in the subsequent call to the - * impressionMetrics.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons that bids lost in the auction. - */ -export interface Schema$ListLosingBidsResponse { - /** - * List of rows, with counts of losing bids aggregated by loss reason (i.e. - * creative status). - */ - creativeStatusRows: Schema$CreativeStatusRow[]; - /** - * A token to retrieve the next page of results. Pass this value in the - * ListLosingBidsRequest.pageToken field in the subsequent call to the - * losingBids.list method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for listing all reasons for which a buyer was not billed for - * a winning bid. - */ -export interface Schema$ListNonBillableWinningBidsResponse { - /** - * A token to retrieve the next page of results. Pass this value in the - * ListNonBillableWinningBidsRequest.pageToken field in the subsequent call to - * the nonBillableWinningBids.list method to retrieve the next page of - * results. - */ - nextPageToken: string; - /** - * List of rows, with counts of bids not billed aggregated by reason. - */ - nonBillableWinningBidStatusRows: Schema$NonBillableWinningBidStatusRow[]; -} -/** - * Response message for listing publishers that had recent inventory matches - * with the requesting buyer. - */ -export interface Schema$ListPublishersResponse { - /** - * List of publishers. - */ - publisher: Schema$Publisher[]; -} -/** - * @OutputOnly The Geo criteria the restriction applies to. - */ -export interface Schema$LocationContext { - /** - * IDs representing the geo location for this context. Please refer to the - * [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv) - * file for different geo criteria IDs. - */ - geoCriteriaIds: number[]; -} -/** - * A metric value, with an expected value and a variance; represents a count - * that may be either exact or estimated (i.e. when sampled). - */ -export interface Schema$MetricValue { - /** - * The expected value of the metric. - */ - value: string; - /** - * The variance (i.e. square of the standard deviation) of the metric value. - * If value is exact, variance is 0. Can be used to calculate margin of error - * as a percentage of value, using the following formula, where Z is the - * standard constant that depends on the desired size of the confidence - * interval (e.g. for 90% confidence interval, use Z = 1.645): marginOfError = - * 100 * Z * sqrt(variance) / value - */ - variance: string; -} -/** - * Native content for a creative. - */ -export interface Schema$NativeContent { - /** - * The name of the advertiser or sponsor, to be displayed in the ad creative. - */ - advertiserName: string; - /** - * The app icon, for app download ads. - */ - appIcon: Schema$Image; - /** - * A long description of the ad. - */ - body: string; - /** - * A label for the button that the user is supposed to click. - */ - callToAction: string; - /** - * The URL that the browser/SDK will load when the user clicks the ad. - */ - clickLinkUrl: string; - /** - * The URL to use for click tracking. - */ - clickTrackingUrl: string; - /** - * A short title for the ad. - */ - headline: string; - /** - * A large image. - */ - image: Schema$Image; - /** - * A smaller image, for the advertiser's logo. - */ - logo: Schema$Image; - /** - * The price of the promoted app including currency info. - */ - priceDisplayText: string; - /** - * The app rating in the app store. Must be in the range [0-5]. - */ - starRating: number; - /** - * The URL to the app store to purchase/download the promoted app. - */ - storeUrl: string; - /** - * The URL to fetch a native video ad. - */ - videoUrl: string; -} -/** - * The number of winning bids with the specified dimension values for which the - * buyer was not billed, as described by the specified status. - */ -export interface Schema$NonBillableWinningBidStatusRow { - /** - * The number of bids with the specified status. - */ - bidCount: Schema$MetricValue; - /** - * The values of all dimensions associated with metric values in this row. - */ - rowDimensions: Schema$RowDimensions; - /** - * The status specifying why the winning bids were not billed. - */ - status: string; -} -/** - * @OutputOnly The type of platform the restriction applies to. - */ -export interface Schema$PlatformContext { - /** - * The platforms this restriction applies to. - */ - platforms: string[]; -} -/** - * The publisher ID and name contain values relevant to the requesting buyer - * depending on whether it is an Ad Exchange buyer or Exchange Bidding buyer. - */ -export interface Schema$Publisher { - /** - * Publisher name contains: - Seller network name when the requesting buyer is - * an Ad Exchange buyer. - DFP network name or AdMob publisher code when the - * requesting buyer is an Exchange Bidding buyer. - */ - publisherDisplayName: string; - /** - * Publisher ID contains: - Seller network ID when the requesting buyer is an - * Ad Exchange buyer. See - * [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) - * - DFP network code or AdMob publisher code when the requesting buyer is an - * Exchange Bidding buyer. - */ - publisherId: string; -} -/** - * An open-ended realtime time range specified by the start timestamp. For - * filter sets that specify a realtime time range RTB metrics continue to be - * aggregated throughout the lifetime of the filter set. - */ -export interface Schema$RealtimeTimeRange { - /** - * The start timestamp of the real-time RTB metrics aggregation. - */ - startTimestamp: string; -} -/** - * A specific filtering status and how many times it occurred. - */ -export interface Schema$Reason { - /** - * The number of times the creative was filtered for the status. The count is - * aggregated across all publishers on the exchange. - */ - count: string; - /** - * The filtering status code. Please refer to the - * [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt) - * file for different statuses. - */ - status: number; -} -/** - * A relative date range, specified by an offset and a duration. The supported - * range of dates begins 30 days before today and ends today. I.e. the limits - * for these values are: offset_days >= 0 duration_days >= 1 offset_days + - * duration_days <= 30 - */ -export interface Schema$RelativeDateRange { - /** - * The number of days in the requested date range. E.g. for a range spanning - * today, 1. For a range spanning the last 7 days, 7. - */ - durationDays: number; - /** - * The end date of the filter set, specified as the number of days before - * today. E.g. for a range where the last date is today, 0. - */ - offsetDays: number; -} -/** - * A request for removing the association between a deal and a creative. - */ -export interface Schema$RemoveDealAssociationRequest { - /** - * The association between a creative and a deal that should be removed. - */ - association: Schema$CreativeDealAssociation; -} -/** - * A response may include multiple rows, breaking down along various dimensions. - * Encapsulates the values of all dimensions for a given row. - */ -export interface Schema$RowDimensions { - /** - * The time interval that this row represents. - */ - timeInterval: Schema$TimeInterval; -} -/** - * @OutputOnly A security context. - */ -export interface Schema$SecurityContext { - /** - * The security types in this context. - */ - securities: string[]; -} -/** - * The serving context for this restriction. - */ -export interface Schema$ServingContext { - /** - * Matches all contexts. - */ - all: string; - /** - * Matches impressions for a particular app type. - */ - appType: Schema$AppContext; - /** - * Matches impressions for a particular auction type. - */ - auctionType: Schema$AuctionContext; +export namespace adexchangebuyer2_v2beta1 { /** - * Matches impressions coming from users *or* publishers in a specific - * location. - */ - location: Schema$LocationContext; - /** - * Matches impressions coming from a particular platform. - */ - platform: Schema$PlatformContext; - /** - * Matches impressions for a particular security type. - */ - securityType: Schema$SecurityContext; -} -/** - * @OutputOnly A representation of the status of an ad in a specific context. A - * context here relates to where something ultimately serves (for example, a - * user or publisher geo, a platform, an HTTPS vs HTTP request, or the type of - * auction). - */ -export interface Schema$ServingRestriction { - /** - * The contexts for the restriction. - */ - contexts: Schema$ServingContext[]; - /** - * Any disapprovals bound to this restriction. Only present if - * status=DISAPPROVED. Can be used to filter the response of the - * creatives.list method. - */ - disapprovalReasons: Schema$Disapproval[]; - /** - * The status of the creative in this context (for example, it has been - * explicitly disapproved or is pending review). - */ - status: string; -} -/** - * A request for stopping notifications for changes to creative Status. - */ -export interface Schema$StopWatchingCreativeRequest {} -/** - * An interval of time, with an absolute start and end. - */ -export interface Schema$TimeInterval { - /** - * The timestamp marking the end of the range (exclusive) for which data is - * included. - */ - endTime: string; - /** - * The timestamp marking the start of the range (inclusive) for which data is - * included. - */ - startTime: string; -} -/** - * Video content for a creative. - */ -export interface Schema$VideoContent { - /** - * The URL to fetch a video ad. - */ - videoUrl: string; - /** - * The contents of a VAST document for a video ad. This document should - * conform to the VAST 2.0 or 3.0 standard. - */ - videoVastXml: string; -} -/** - * A request for watching changes to creative Status. - */ -export interface Schema$WatchCreativeRequest { - /** - * The Pub/Sub topic to publish notifications to. This topic must already - * exist and must give permission to ad-exchange-buyside-reports@google.com to - * write to the topic. This should be the full resource name in - * "projects/{project_id}/topics/{topic_id}" format. - */ - topic: string; -} - -export class Resource$Accounts { - root: Adexchangebuyer2; - clients: Resource$Accounts$Clients; - creatives: Resource$Accounts$Creatives; - publishers: Resource$Accounts$Publishers; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.clients = new Resource$Accounts$Clients(root); - this.creatives = new Resource$Accounts$Creatives(root); - this.publishers = new Resource$Accounts$Publishers(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Accounts$Clients { - root: Adexchangebuyer2; - invitations: Resource$Accounts$Clients$Invitations; - users: Resource$Accounts$Clients$Users; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.invitations = new Resource$Accounts$Clients$Invitations(root); - this.users = new Resource$Accounts$Clients$Users(root); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer2.accounts.clients.create - * @desc Creates a new client buyer. - * @alias adexchangebuyer2.accounts.clients.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to create a client for. (required) - * @param {().Client} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/accounts/{accountId}/clients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer2.accounts.clients.get - * @desc Gets a client buyer with a given client account ID. - * @alias adexchangebuyer2.accounts.clients.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer to retrieve. (required) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId'], - pathParams: ['accountId', 'clientAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer2.accounts.clients.list - * @desc Lists all the clients for the current sponsor buyer. - * @alias adexchangebuyer2.accounts.clients.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Unique numerical account ID of the sponsor buyer to list the clients for. - * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientsResponse.nextPageToken returned from the previous call to the accounts.clients.list method. - * @param {string=} params.partnerClientId Optional unique identifier (from the standpoint of an Ad Exchange sponsor buyer partner) of the client to return. If specified, at most one client will be returned in the response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/accounts/{accountId}/clients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer2.accounts.clients.update - * @desc Updates an existing client buyer. - * @alias adexchangebuyer2.accounts.clients.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to update a client for. (required) - * @param {string} params.clientAccountId Unique numerical account ID of the client to update. (required) - * @param {().Client} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId'], - pathParams: ['accountId', 'clientAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Clients$Invitations { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangebuyer2.accounts.clients.invitations.create - * @desc Creates and sends out an email invitation to access an Ad Exchange - * client buyer account. - * @alias adexchangebuyer2.accounts.clients.invitations.create - * @memberOf! () + * Ad Exchange Buyer API II * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user should be associated with. (required) - * @param {().ClientUserInvitation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId'], - pathParams: ['accountId', 'clientAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer2.accounts.clients.invitations.get - * @desc Retrieves an existing client user invitation. - * @alias adexchangebuyer2.accounts.clients.invitations.get - * @memberOf! () + * Accesses the latest features for managing Ad Exchange accounts, Real-Time + * Bidding configurations and auction metrics, and Marketplace programmatic + * deals. * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user invitation to be retrieved is associated with. (required) - * @param {string} params.invitationId Numerical identifier of the user invitation to retrieve. (required) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId', 'invitationId'], - pathParams: ['accountId', 'clientAccountId', 'invitationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adexchangebuyer2.accounts.clients.invitations.list - * @desc Lists all the client users invitations for a client with a given - * account ID. - * @alias adexchangebuyer2.accounts.clients.invitations.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const adexchangebuyer2 = google.adexchangebuyer2('v2beta1'); * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer to list invitations for. (required) You must either specify a string representation of a numerical account identifier or the `-` character to list all the invitations for all the clients of a given sponsor buyer. - * @param {integer=} params.pageSize Requested page size. Server may return fewer clients than requested. If unspecified, server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUserInvitationsResponse.nextPageToken returned from the previous call to the clients.invitations.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace adexchangebuyer2 + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Adexchangebuyer2 */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId'], - pathParams: ['accountId', 'clientAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} + export class Adexchangebuyer2 { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Accounts$Clients$Users { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + accounts: Resource$Accounts; + bidders: Resource$Bidders; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * adexchangebuyer2.accounts.clients.users.get - * @desc Retrieves an existing client user. - * @alias adexchangebuyer2.accounts.clients.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) - * @param {string} params.userId Numerical identifier of the user to retrieve. (required) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId', 'userId'], - pathParams: ['accountId', 'clientAccountId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + this.accounts = new Resource$Accounts(this); + this.bidders = new Resource$Bidders(this); } - } - - /** - * adexchangebuyer2.accounts.clients.users.list - * @desc Lists all the known client users for a specified sponsor buyer - * account ID. - * @alias adexchangebuyer2.accounts.clients.users.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the sponsor buyer of the client to list users for. (required) - * @param {string} params.clientAccountId The account ID of the client buyer to list users for. (required) You must specify either a string representation of a numerical account identifier or the `-` character to list all the client users for all the clients of a given sponsor buyer. - * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUsersResponse.nextPageToken returned from the previous call to the accounts.clients.users.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId'], - pathParams: ['accountId', 'clientAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * adexchangebuyer2.accounts.clients.users.update - * @desc Updates an existing client user. Only the user status can be changed - * on update. - * @alias adexchangebuyer2.accounts.clients.users.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) - * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) - * @param {string} params.userId Numerical identifier of the user to retrieve. (required) - * @param {().ClientUser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'clientAccountId', 'userId'], - pathParams: ['accountId', 'clientAccountId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Creatives { - root: Adexchangebuyer2; - dealAssociations: Resource$Accounts$Creatives$Dealassociations; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.dealAssociations = - new Resource$Accounts$Creatives$Dealassociations(root); - } - - getRoot() { - return this.root; + * An absolute date range, specified by its start date and end date. The + * supported range of dates begins 30 days before today and ends today. + * Validity checked upon filter set creation. If a filter set with an absolute + * date range is run at a later date more than 30 days after start_date, it + * will fail. + */ + export interface Schema$AbsoluteDateRange { + /** + * The end date of the range (inclusive). Must be within the 30 days leading + * up to current date, and must be equal to or after start_date. + */ + endDate: Schema$Date; + /** + * The start date of the range (inclusive). Must be within the 30 days + * leading up to current date, and must be equal to or before end_date. + */ + startDate: Schema$Date; } - - /** - * adexchangebuyer2.accounts.creatives.create - * @desc Creates a creative. - * @alias adexchangebuyer2.accounts.creatives.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. - * @param {string=} params.duplicateIdMode Indicates if multiple creatives can share an ID or not. Default is NO_DUPLICATES (one ID per creative). - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A request for associating a deal and a creative. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/accounts/{accountId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AddDealAssociationRequest { + /** + * The association between a creative and a deal that should be added. + */ + association: Schema$CreativeDealAssociation; } - - /** - * adexchangebuyer2.accounts.creatives.get - * @desc Gets a creative. - * @alias adexchangebuyer2.accounts.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account the creative belongs to. - * @param {string} params.creativeId The ID of the creative to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @OutputOnly The app type the restriction applies to for mobile device. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AppContext { + /** + * The app types this restriction applies to. + */ + appTypes: string[]; } - - /** - * adexchangebuyer2.accounts.creatives.list - * @desc Lists creatives. - * @alias adexchangebuyer2.accounts.creatives.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account to list the creatives from. Specify "-" to list all creatives the current user has access to. - * @param {integer=} params.pageSize Requested page size. The server may return fewer creatives than requested (due to timeout constraint) even if more are available via another call. If unspecified, server will pick an appropriate default. Acceptable values are 1 to 1000, inclusive. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativesResponse.next_page_token returned from the previous call to 'ListCreatives' method. - * @param {string=} params.query An optional query string to filter creatives. If no filter is specified, all active creatives will be returned. Supported queries are:
  • accountId=account_id_string
  • creativeId=creative_id_string
  • dealsStatus: {approved, conditionally_approved, disapproved, not_checked}
  • openAuctionStatus: {approved, conditionally_approved, disapproved, not_checked}
  • attribute: {a numeric attribute from the list of attributes}
  • disapprovalReason: {a reason from DisapprovalReason}
Example: 'accountId=12345 AND (dealsStatus:disapproved AND disapprovalReason:unacceptable_content) OR attribute:47' - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @OutputOnly The auction type the restriction applies to. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/accounts/{accountId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AuctionContext { + /** + * The auction types this restriction applies to. + */ + auctionTypes: string[]; } - - /** - * adexchangebuyer2.accounts.creatives.stopWatching - * @desc Stops watching a creative. Will stop push notifications being sent to - * the topics when the creative changes status. - * @alias adexchangebuyer2.accounts.creatives.stopWatching - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account of the creative to stop notifications for. - * @param {string} params.creativeId The creative ID of the creative to stop notifications for. Specify "-" to specify stopping account level notifications. - * @param {().StopWatchingCreativeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stopWatching(params?: any, options?: MethodOptions): - AxiosPromise; - stopWatching( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stopWatching( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The set of metrics that are measured in numbers of bids, representing how + * many bids with the specified dimension values were considered eligible at + * each stage of the bidding funnel; + */ + export interface Schema$BidMetricsRow { + /** + * The number of bids that Ad Exchange received from the buyer. + */ + bids: Schema$MetricValue; + /** + * The number of bids that were permitted to compete in the auction. + */ + bidsInAuction: Schema$MetricValue; + /** + * The number of bids for which the buyer was billed. + */ + billedImpressions: Schema$MetricValue; + /** + * The number of bids that won an impression. + */ + impressionsWon: Schema$MetricValue; + /** + * The number of bids for which the corresponding impression was measurable + * for viewability (as defined by Active View). + */ + measurableImpressions: Schema$MetricValue; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; + /** + * The number of bids for which the corresponding impression was viewable + * (as defined by Active View). + */ + viewableImpressions: Schema$MetricValue; } - - /** - * adexchangebuyer2.accounts.creatives.update - * @desc Updates a creative. - * @alias adexchangebuyer2.accounts.creatives.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. - * @param {string} params.creativeId The buyer-defined creative ID of this creative. Can be used to filter the response of the creatives.list method. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The number of impressions with the specified dimension values that were + * considered to have no applicable bids, as described by the specified + * status. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BidResponseWithoutBidsStatusRow { + /** + * The number of impressions for which there was a bid response with the + * specified status. + */ + impressionCount: Schema$MetricValue; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; + /** + * The status specifying why the bid responses were considered to have no + * applicable bids. + */ + status: string; } - - /** - * adexchangebuyer2.accounts.creatives.watch - * @desc Watches a creative. Will result in push notifications being sent to - * the topic when the creative changes status. - * @alias adexchangebuyer2.accounts.creatives.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account of the creative to watch. - * @param {string} params.creativeId The creative ID to watch for status changes. Specify "-" to watch all creatives under the above account. If both creative-level and account-level notifications are sent, only a single notification will be sent to the creative-level notification topic. - * @param {().WatchCreativeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}:watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Creatives$Dealassociations { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + * The number of impressions with the specified dimension values where the + * corresponding bid request or bid response was not successful, as described + * by the specified callout status. + */ + export interface Schema$CalloutStatusRow { + /** + * The ID of the callout status. See + * [callout-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/callout-status-codes). + */ + calloutStatusId: number; + /** + * The number of impressions for which there was a bid request or bid + * response with the specified callout status. + */ + impressionCount: Schema$MetricValue; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; } - - getRoot() { - return this.root; - } - - /** - * adexchangebuyer2.accounts.creatives.dealAssociations.add - * @desc Associate an existing deal with a creative. - * @alias adexchangebuyer2.accounts.creatives.dealAssociations.add - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account the creative belongs to. - * @param {string} params.creativeId The ID of the creative associated with the deal. - * @param {().AddDealAssociationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - add(params?: any, options?: MethodOptions): AxiosPromise; - add(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - add(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A client resource represents a client buyer&mdash;an agency, a brand, + * or an advertiser customer of the sponsor buyer. Users associated with the + * client buyer have restricted access to the Ad Exchange Marketplace and + * certain other sections of the Ad Exchange Buyer UI based on the role + * granted to the client buyer. All fields are required unless otherwise + * specified. + */ + export interface Schema$Client { + /** + * The globally-unique numerical ID of the client. The value of this field + * is ignored in create and update operations. + */ + clientAccountId: string; + /** + * Name used to represent this client to publishers. You may have multiple + * clients that map to the same entity, but for each client the combination + * of `clientName` and entity must be unique. You can specify this field as + * empty. + */ + clientName: string; + /** + * Numerical identifier of the client entity. The entity can be an + * advertiser, a brand, or an agency. This identifier is unique among all + * the entities with the same type. A list of all known advertisers with + * their identifiers is available in the + * [advertisers.txt](https://storage.googleapis.com/adx-rtb-dictionaries/advertisers.txt) + * file. A list of all known brands with their identifiers is available in + * the + * [brands.txt](https://storage.googleapis.com/adx-rtb-dictionaries/brands.txt) + * file. A list of all known agencies with their identifiers is available + * in the + * [agencies.txt](https://storage.googleapis.com/adx-rtb-dictionaries/agencies.txt) + * file. + */ + entityId: string; + /** + * The name of the entity. This field is automatically fetched based on the + * type and ID. The value of this field is ignored in create and update + * operations. + */ + entityName: string; + /** + * The type of the client entity: `ADVERTISER`, `BRAND`, or `AGENCY`. + */ + entityType: string; + /** + * Optional arbitrary unique identifier of this client buyer from the + * standpoint of its Ad Exchange sponsor buyer. This field can be used to + * associate a client buyer with the identifier in the namespace of its + * sponsor buyer, lookup client buyers by that identifier and verify whether + * an Ad Exchange counterpart of a given client buyer already exists. If + * present, must be unique among all the client buyers for its Ad Exchange + * sponsor buyer. + */ + partnerClientId: string; + /** + * The role which is assigned to the client buyer. Each role implies a set + * of permissions granted to the client. Must be one of + * `CLIENT_DEAL_VIEWER`, `CLIENT_DEAL_NEGOTIATOR` or `CLIENT_DEAL_APPROVER`. + */ + role: string; + /** + * The status of the client buyer. + */ + status: string; + /** + * Whether the client buyer will be visible to sellers. + */ + visibleToSeller: boolean; } - - /** - * adexchangebuyer2.accounts.creatives.dealAssociations.list - * @desc List all creative-deal associations. - * @alias adexchangebuyer2.accounts.creatives.dealAssociations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account to list the associations from. Specify "-" to list all creatives the current user has access to. - * @param {string} params.creativeId The creative ID to list the associations from. Specify "-" to list all creatives under the above account. - * @param {integer=} params.pageSize Requested page size. Server may return fewer associations than requested. If unspecified, server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListDealAssociationsResponse.next_page_token returned from the previous call to 'ListDealAssociations' method. - * @param {string=} params.query An optional query string to filter deal associations. If no filter is specified, all associations will be returned. Supported queries are:
  • accountId=account_id_string
  • creativeId=creative_id_string
  • dealsId=deals_id_string
  • dealsStatus:{approved, conditionally_approved, disapproved, not_checked}
  • openAuctionStatus:{approved, conditionally_approved, disapproved, not_checked}
Example: 'dealsId=12345 AND dealsStatus:disapproved' - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A client user is created under a client buyer and has restricted access to + * the Ad Exchange Marketplace and certain other sections of the Ad Exchange + * Buyer UI based on the role granted to the associated client buyer. The + * only way a new client user can be created is via accepting an email + * invitation (see the accounts.clients.invitations.create method). All + * fields are required unless otherwise specified. + */ + export interface Schema$ClientUser { + /** + * Numerical account ID of the client buyer with which the user is + * associated; the buyer must be a client of the current sponsor buyer. The + * value of this field is ignored in an update operation. + */ + clientAccountId: string; + /** + * User's email address. The value of this field is ignored in an update + * operation. + */ + email: string; + /** + * The status of the client user. + */ + status: string; + /** + * The unique numerical ID of the client user that has accepted an + * invitation. The value of this field is ignored in an update operation. + */ + userId: string; } - - /** - * adexchangebuyer2.accounts.creatives.dealAssociations.remove - * @desc Remove the association between a deal and a creative. - * @alias adexchangebuyer2.accounts.creatives.dealAssociations.remove - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account the creative belongs to. - * @param {string} params.creativeId The ID of the creative associated with the deal. - * @param {().RemoveDealAssociationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - remove(params?: any, options?: MethodOptions): AxiosPromise; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'creativeId'], - pathParams: ['accountId', 'creativeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Publishers { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * An invitation for a new client user to get access to the Ad Exchange Buyer + * UI. All fields are required unless otherwise specified. + */ + export interface Schema$ClientUserInvitation { + /** + * Numerical account ID of the client buyer that the invited user is + * associated with. The value of this field is ignored in create operations. + */ + clientAccountId: string; + /** + * The email address to which the invitation is sent. Email addresses should + * be unique among all client users under each sponsor buyer. + */ + email: string; + /** + * The unique numerical ID of the invitation that is sent to the user. The + * value of this field is ignored in create operations. + */ + invitationId: string; } - - /** - * adexchangebuyer2.accounts.publishers.list - * @desc Lists publishers that had recent inventory matches with the - * requesting buyer. - * @alias adexchangebuyer2.accounts.publishers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID of the requesting buyer. - * @param {string=} params.environment Optional environment (WEB, APP) for which to return publishers. If specified, response will only include publishers that had recent inventory matches with the requesting buyer on the specified platform. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @OutputOnly Shows any corrections that were applied to this creative. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/accounts/{accountId}/publishers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Bidders { - root: Adexchangebuyer2; - accounts: Resource$Bidders$Accounts; - filterSets: Resource$Bidders$Filtersets; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.accounts = new Resource$Bidders$Accounts(root); - this.filterSets = new Resource$Bidders$Filtersets(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Bidders$Accounts { - root: Adexchangebuyer2; - filterSets: Resource$Bidders$Accounts$Filtersets; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.filterSets = new Resource$Bidders$Accounts$Filtersets(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Bidders$Accounts$Filtersets { - root: Adexchangebuyer2; - bidMetrics: Resource$Bidders$Accounts$Filtersets$Bidmetrics; - bidResponseErrors: Resource$Bidders$Accounts$Filtersets$Bidresponseerrors; - bidResponsesWithoutBids: - Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids; - filteredBidRequests: Resource$Bidders$Accounts$Filtersets$Filteredbidrequests; - filteredBids: Resource$Bidders$Accounts$Filtersets$Filteredbids; - impressionMetrics: Resource$Bidders$Accounts$Filtersets$Impressionmetrics; - losingBids: Resource$Bidders$Accounts$Filtersets$Losingbids; - nonBillableWinningBids: - Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.bidMetrics = new Resource$Bidders$Accounts$Filtersets$Bidmetrics(root); - this.bidResponseErrors = - new Resource$Bidders$Accounts$Filtersets$Bidresponseerrors(root); - this.bidResponsesWithoutBids = - new Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids(root); - this.filteredBidRequests = - new Resource$Bidders$Accounts$Filtersets$Filteredbidrequests(root); - this.filteredBids = - new Resource$Bidders$Accounts$Filtersets$Filteredbids(root); - this.impressionMetrics = - new Resource$Bidders$Accounts$Filtersets$Impressionmetrics(root); - this.losingBids = new Resource$Bidders$Accounts$Filtersets$Losingbids(root); - this.nonBillableWinningBids = - new Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids(root); + export interface Schema$Correction { + /** + * The contexts for the correction. + */ + contexts: Schema$ServingContext[]; + /** + * Additional details about what was corrected. + */ + details: string[]; + /** + * The type of correction that was applied to the creative. + */ + type: string; } - - getRoot() { - return this.root; - } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.create - * @desc Creates the specified filter set for the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.accounts.filterSets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.isTransient Whether the filter set is transient, or should be persisted indefinitely. By default, filter sets are not transient. If transient, it will be available for at least 1 hour after creation. - * @param {string} params.ownerName Name of the owner (bidder or account) of the filter set to be created. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` - * @param {().FilterSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['ownerName'], - pathParams: ['ownerName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A creative and its classification data. Next ID: 35 + */ + export interface Schema$Creative { + /** + * The account that this creative belongs to. Can be used to filter the + * response of the creatives.list method. + */ + accountId: string; + /** + * The link to AdChoices destination page. + */ + adChoicesDestinationUrl: string; + /** + * The name of the company being advertised in the creative. + */ + advertiserName: string; + /** + * The agency ID for this creative. + */ + agencyId: string; + /** + * @OutputOnly The last update timestamp of the creative via API. + */ + apiUpdateTime: string; + /** + * All attributes for the ads that may be shown from this creative. Can be + * used to filter the response of the creatives.list method. + */ + attributes: string[]; + /** + * The set of destination URLs for the creative. + */ + clickThroughUrls: string[]; + /** + * @OutputOnly Shows any corrections that were applied to this creative. + */ + corrections: Schema$Correction[]; + /** + * The buyer-defined creative ID of this creative. Can be used to filter the + * response of the creatives.list method. + */ + creativeId: string; + /** + * @OutputOnly The top-level deals status of this creative. If disapproved, + * an entry for 'auctionType=DIRECT_DEALS' (or 'ALL') in + * serving_restrictions will also exist. Note that this may be nuanced with + * other contextual restrictions, in which case, it may be preferable to + * read from serving_restrictions directly. Can be used to filter the + * response of the creatives.list method. + */ + dealsStatus: string; + /** + * @OutputOnly Detected advertiser IDs, if any. + */ + detectedAdvertiserIds: string[]; + /** + * @OutputOnly The detected domains for this creative. + */ + detectedDomains: string[]; + /** + * @OutputOnly The detected languages for this creative. The order is + * arbitrary. The codes are 2 or 5 characters and are documented at + * https://developers.google.com/adwords/api/docs/appendix/languagecodes. + */ + detectedLanguages: string[]; + /** + * @OutputOnly Detected product categories, if any. See the + * ad-product-categories.txt file in the technical documentation for a list + * of IDs. + */ + detectedProductCategories: number[]; + /** + * @OutputOnly Detected sensitive categories, if any. See the + * ad-sensitive-categories.txt file in the technical documentation for a + * list of IDs. You should use these IDs along with the + * excluded-sensitive-category field in the bid request to filter your bids. + */ + detectedSensitiveCategories: number[]; + /** + * @OutputOnly The filtering stats for this creative. + */ + filteringStats: Schema$FilteringStats; + /** + * An HTML creative. + */ + html: Schema$HtmlContent; + /** + * The set of URLs to be called to record an impression. + */ + impressionTrackingUrls: string[]; + /** + * A native creative. + */ + native: Schema$NativeContent; + /** + * @OutputOnly The top-level open auction status of this creative. If + * disapproved, an entry for 'auctionType = OPEN_AUCTION' (or + * 'ALL') in serving_restrictions will also exist. Note that this + * may be nuanced with other contextual restrictions, in which case, it may + * be preferable to read from serving_restrictions directly. Can be used to + * filter the response of the creatives.list method. + */ + openAuctionStatus: string; + /** + * All restricted categories for the ads that may be shown from this + * creative. + */ + restrictedCategories: string[]; + /** + * @OutputOnly The granular status of this ad in specific contexts. A + * context here relates to where something ultimately serves (for example, a + * physical location, a platform, an HTTPS vs HTTP request, or the type of + * auction). + */ + servingRestrictions: Schema$ServingRestriction[]; + /** + * All vendor IDs for the ads that may be shown from this creative. See + * https://storage.googleapis.com/adx-rtb-dictionaries/vendors.txt for + * possible values. + */ + vendorIds: number[]; + /** + * @OutputOnly The version of this creative. + */ + version: number; + /** + * A video creative. + */ + video: Schema$VideoContent; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.delete - * @desc Deletes the requested filter set from the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.accounts.filterSets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Full name of the resource to delete. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The association between a creative and a deal. + */ + export interface Schema$CreativeDealAssociation { + /** + * The account the creative belongs to. + */ + accountId: string; + /** + * The ID of the creative associated with the deal. + */ + creativeId: string; + /** + * The externalDealId for the deal associated with the creative. + */ + dealsId: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.get - * @desc Retrieves the requested filter set for the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.accounts.filterSets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Full name of the resource being requested. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The number of bids with the specified dimension values that did not win the + * auction (either were filtered pre-auction or lost the auction), as + * described by the specified creative status. + */ + export interface Schema$CreativeStatusRow { + /** + * The number of bids with the specified status. + */ + bidCount: Schema$MetricValue; + /** + * The ID of the creative status. See + * [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + */ + creativeStatusId: number; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.list - * @desc Lists all filter sets for the account with the given account ID. - * @alias adexchangebuyer2.bidders.accounts.filterSets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.ownerName Name of the owner (bidder or account) of the filter sets to be listed. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilterSetsResponse.nextPageToken returned from the previous call to the accounts.filterSets.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ownerName'], - pathParams: ['ownerName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Bidders$Accounts$Filtersets$Bidmetrics { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; } - - getRoot() { - return this.root; + /** + * @OutputOnly The reason and details for a disapproval. + */ + export interface Schema$Disapproval { + /** + * Additional details about the reason for disapproval. + */ + details: string[]; + /** + * The categorized reason for disapproval. + */ + reason: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list - * @desc Lists all metrics that are measured in terms of number of bids. - * @alias adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidMetricsResponse.nextPageToken returned from the previous call to the bidMetrics.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * The number of filtered bids with the specified dimension values that have + * the specified creative. + */ + export interface Schema$FilteredBidCreativeRow { + /** + * The number of bids with the specified creative. + */ + bidCount: Schema$MetricValue; + /** + * The ID of the creative. + */ + creativeId: string; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; } -} - -export class Resource$Bidders$Accounts$Filtersets$Bidresponseerrors { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * The number of filtered bids with the specified dimension values, among + * those filtered due to the requested filtering reason (i.e. creative + * status), that have the specified detail. + */ + export interface Schema$FilteredBidDetailRow { + /** + * The number of bids with the specified detail. + */ + bidCount: Schema$MetricValue; + /** + * The ID of the detail. The associated value can be looked up in the + * dictionary file corresponding to the DetailType in the response message. + */ + detailId: number; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; } - - getRoot() { - return this.root; + /** + * @OutputOnly Filtering reasons for this creative during a period of a single + * day (from midnight to midnight Pacific). + */ + export interface Schema$FilteringStats { + /** + * The day during which the data was collected. The data is collected from + * 00:00:00 to 23:59:59 PT. During switches from PST to PDT and back, the + * day may contain 23 or 25 hours of data instead of the usual 24. + */ + date: Schema$Date; + /** + * The set of filtering reasons for this date. + */ + reasons: Schema$Reason[]; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list - * @desc List all errors that occurred in bid responses, with the number of - * bid responses affected for each reason. - * @alias adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponseErrorsResponse.nextPageToken returned from the previous call to the bidResponseErrors.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponseErrors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A set of filters that is applied to a request for data. Within a filter + * set, an AND operation is performed across the filters represented by each + * field. An OR operation is performed across the filters represented by the + * multiple values of a repeated field. E.g. "format=VIDEO AND deal_id=12 + * AND (seller_network_id=34 OR seller_network_id=56)" + */ + export interface Schema$FilterSet { + /** + * An absolute date range, defined by a start date and an end date. + * Interpreted relative to Pacific time zone. + */ + absoluteDateRange: Schema$AbsoluteDateRange; + /** + * The ID of the creative on which to filter; optional. This field may be + * set only for a filter set that accesses account-level troubleshooting + * data, i.e. one whose name matches the `bidders/x/accounts/x/filterSets/x + * pattern. + */ + creativeId: string; + /** + * The ID of the deal on which to filter; optional. This field may be set + * only for a filter set that accesses account-level troubleshooting data, + * i.e. one whose name matches the `bidders/x/accounts/x/filterSets/x + * pattern. + */ + dealId: string; + /** + * The environment on which to filter; optional. + */ + environment: string; + /** + * The list of formats on which to filter; may be empty. The filters + * represented by multiple formats are ORed together (i.e. if non-empty, + * results must match any one of the formats). + */ + formats: string[]; + /** + * A user-defined name of the filter set. Filter set names must be unique + * globally and match one of the patterns: - `bidders/x/filterSets/x (for + * accessing bidder-level troubleshooting data) - + * `bidders/x/accounts/x/filterSets/x (for accessing account-level + * troubleshooting data) This field is required in create operations. + */ + name: string; + /** + * The list of platforms on which to filter; may be empty. The filters + * represented by multiple platforms are ORed together (i.e. if non-empty, + * results must match any one of the platforms). + */ + platforms: string[]; + /** + * For Exchange Bidding buyers only. The list of publisher identifiers on + * which to filter; may be empty. The filters represented by multiple + * publisher identifiers are ORed together. + */ + publisherIdentifiers: string[]; + /** + * An open-ended realtime time range, defined by the aggregation start + * timestamp. + */ + realtimeTimeRange: Schema$RealtimeTimeRange; + /** + * A relative date range, defined by an offset from today and a duration. + * Interpreted relative to Pacific time zone. + */ + relativeDateRange: Schema$RelativeDateRange; + /** + * For Ad Exchange buyers only. The list of IDs of the seller (publisher) + * networks on which to filter; may be empty. The filters represented by + * multiple seller network IDs are ORed together (i.e. if non-empty, results + * must match any one of the publisher networks). See + * [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) + * file for the set of existing seller network IDs. + */ + sellerNetworkIds: number[]; + /** + * The granularity of time intervals if a time series breakdown is desired; + * optional. + */ + timeSeriesGranularity: string; } -} - -export class Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * HTML content for a creative. + */ + export interface Schema$HtmlContent { + /** + * The height of the HTML snippet in pixels. + */ + height: number; + /** + * The HTML snippet that displays the ad when inserted in the web page. + */ + snippet: string; + /** + * The width of the HTML snippet in pixels. + */ + width: number; } - - getRoot() { - return this.root; + /** + * An image resource. You may provide a larger image than was requested, so + * long as the aspect ratio is preserved. + */ + export interface Schema$Image { + /** + * Image height in pixels. + */ + height: number; + /** + * The URL of the image. + */ + url: string; + /** + * Image width in pixels. + */ + width: number; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list - * @desc List all reasons for which bid responses were considered to have no - * applicable bids, with the number of bid responses affected for each reason. - * @alias - * adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponsesWithoutBidsResponse.nextPageToken returned from the previous call to the bidResponsesWithoutBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponsesWithoutBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * The set of metrics that are measured in numbers of impressions, + * representing how many impressions with the specified dimension values were + * considered eligible at each stage of the bidding funnel. + */ + export interface Schema$ImpressionMetricsRow { + /** + * The number of impressions available to the buyer on Ad Exchange. In some + * cases this value may be unavailable. + */ + availableImpressions: Schema$MetricValue; + /** + * The number of impressions for which Ad Exchange sent the buyer a bid + * request. + */ + bidRequests: Schema$MetricValue; + /** + * The number of impressions that match the buyer's inventory + * pretargeting. + */ + inventoryMatches: Schema$MetricValue; + /** + * The number of impressions for which Ad Exchange received a response from + * the buyer that contained at least one applicable bid. + */ + responsesWithBids: Schema$MetricValue; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; + /** + * The number of impressions for which the buyer successfully sent a + * response to Ad Exchange. + */ + successfulResponses: Schema$MetricValue; } -} - -export class Resource$Bidders$Accounts$Filtersets$Filteredbidrequests { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * Response message for listing the metrics that are measured in number of + * bids. + */ + export interface Schema$ListBidMetricsResponse { + /** + * List of rows, each containing a set of bid metrics. + */ + bidMetricsRows: Schema$BidMetricsRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListBidMetricsRequest.pageToken field in the subsequent call to the + * bidMetrics.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response message for listing all reasons that bid responses resulted in an + * error. + */ + export interface Schema$ListBidResponseErrorsResponse { + /** + * List of rows, with counts of bid responses aggregated by callout status. + */ + calloutStatusRows: Schema$CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListBidResponseErrorsRequest.pageToken field in the subsequent call to + * the bidResponseErrors.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list - * @desc List all reasons that caused a bid request not to be sent for an - * impression, with the number of bid requests not sent for each reason. - * @alias - * adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidRequestsResponse.nextPageToken returned from the previous call to the filteredBidRequests.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBidRequests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Response message for listing all reasons that bid responses were considered + * to have no applicable bids. + */ + export interface Schema$ListBidResponsesWithoutBidsResponse { + /** + * List of rows, with counts of bid responses without bids aggregated by + * status. + */ + bidResponseWithoutBidsStatusRows: Schema$BidResponseWithoutBidsStatusRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListBidResponsesWithoutBidsRequest.pageToken field in the subsequent call + * to the bidResponsesWithoutBids.list method to retrieve the next page of + * results. + */ + nextPageToken: string; } -} - -export class Resource$Bidders$Accounts$Filtersets$Filteredbids { - root: Adexchangebuyer2; - creatives: Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives; - details: Resource$Bidders$Accounts$Filtersets$Filteredbids$Details; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.creatives = - new Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives(root); - this.details = - new Resource$Bidders$Accounts$Filtersets$Filteredbids$Details(root); + export interface Schema$ListClientsResponse { + /** + * The returned list of clients. + */ + clients: Schema$Client[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListClientsRequest.pageToken field in the subsequent call to the + * accounts.clients.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$ListClientUserInvitationsResponse { + /** + * The returned list of client users. + */ + invitations: Schema$ClientUserInvitation[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListClientUserInvitationsRequest.pageToken field in the subsequent call + * to the clients.invitations.list method to retrieve the next page of + * results. + */ + nextPageToken: string; + } + export interface Schema$ListClientUsersResponse { + /** + * A token to retrieve the next page of results. Pass this value in the + * ListClientUsersRequest.pageToken field in the subsequent call to the + * clients.invitations.list method to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The returned list of client users. + */ + users: Schema$ClientUser[]; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list - * @desc List all reasons for which bids were filtered, with the number of - * bids filtered for each reason. - * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidsResponse.nextPageToken returned from the previous call to the filteredBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response for listing creatives. + */ + export interface Schema$ListCreativesResponse { + /** + * The list of creatives. + */ + creatives: Schema$Creative[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListCreativesRequest.page_token field in the subsequent call to + * `ListCreatives` method to retrieve the next page of results. + */ + nextPageToken: string; } -} -export class Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * Response message for listing all creatives associated with a given filtered + * bid reason. + */ + export interface Schema$ListCreativeStatusBreakdownByCreativeResponse { + /** + * List of rows, with counts of bids with a given creative status aggregated + * by creative. + */ + filteredBidCreativeRows: Schema$FilteredBidCreativeRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListCreativeStatusBreakdownByCreativeRequest.pageToken field in the + * subsequent call to the filteredBids.creatives.list method to retrieve the + * next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response message for listing all details associated with a given filtered + * bid reason. + */ + export interface Schema$ListCreativeStatusBreakdownByDetailResponse { + /** + * The type of detail that the detail IDs represent. + */ + detailType: string; + /** + * List of rows, with counts of bids with a given creative status aggregated + * by detail. + */ + filteredBidDetailRows: Schema$FilteredBidDetailRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListCreativeStatusBreakdownByDetailRequest.pageToken field in the + * subsequent call to the filteredBids.details.list method to retrieve the + * next page of results. + */ + nextPageToken: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list - * @desc List all creatives associated with a specific reason for which bids - * were filtered, with the number of bids filtered for each creative. - * @alias - * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by creative. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByCreativeResponse.nextPageToken returned from the previous call to the filteredBids.creatives.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName', 'creativeStatusId'], - pathParams: ['creativeStatusId', 'filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ListCreativeStatusBreakdownByCreativeResponse>(parameters); - } + * A response for listing creative and deal associations + */ + export interface Schema$ListDealAssociationsResponse { + /** + * The list of associations. + */ + associations: Schema$CreativeDealAssociation[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListDealAssociationsRequest.page_token field in the subsequent call to + * 'ListDealAssociation' method to retrieve the next page of + * results. + */ + nextPageToken: string; } -} - -export class Resource$Bidders$Accounts$Filtersets$Filteredbids$Details { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * Response message for listing all reasons that bid requests were filtered + * and not sent to the buyer. + */ + export interface Schema$ListFilteredBidRequestsResponse { + /** + * List of rows, with counts of filtered bid requests aggregated by callout + * status. + */ + calloutStatusRows: Schema$CalloutStatusRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListFilteredBidRequestsRequest.pageToken field in the subsequent call to + * the filteredBidRequests.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response message for listing all reasons that bids were filtered from the + * auction. + */ + export interface Schema$ListFilteredBidsResponse { + /** + * List of rows, with counts of filtered bids aggregated by filtering reason + * (i.e. creative status). + */ + creativeStatusRows: Schema$CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListFilteredBidsRequest.pageToken field in the subsequent call to the + * filteredBids.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list - * @desc List all details associated with a specific reason for which bids - * were filtered, with the number of bids filtered for each detail. - * @alias - * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by detail. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByDetailResponse.nextPageToken returned from the previous call to the filteredBids.details.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for listing filter sets. + */ + export interface Schema$ListFilterSetsResponse { + /** + * The filter sets belonging to the buyer. + */ + filterSets: Schema$FilterSet[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListFilterSetsRequest.pageToken field in the subsequent call to the + * accounts.filterSets.list method to retrieve the next page of results. + */ + nextPageToken: string; + } + /** + * Response message for listing the metrics that are measured in number of + * impressions. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByDetailResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByDetailResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName', 'creativeStatusId'], - pathParams: ['creativeStatusId', 'filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ListCreativeStatusBreakdownByDetailResponse>(parameters); - } + export interface Schema$ListImpressionMetricsResponse { + /** + * List of rows, each containing a set of impression metrics. + */ + impressionMetricsRows: Schema$ImpressionMetricsRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListImpressionMetricsRequest.pageToken field in the subsequent call to + * the impressionMetrics.list method to retrieve the next page of results. + */ + nextPageToken: string; } -} - - -export class Resource$Bidders$Accounts$Filtersets$Impressionmetrics { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * Response message for listing all reasons that bids lost in the auction. + */ + export interface Schema$ListLosingBidsResponse { + /** + * List of rows, with counts of losing bids aggregated by loss reason (i.e. + * creative status). + */ + creativeStatusRows: Schema$CreativeStatusRow[]; + /** + * A token to retrieve the next page of results. Pass this value in the + * ListLosingBidsRequest.pageToken field in the subsequent call to the + * losingBids.list method to retrieve the next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response message for listing all reasons for which a buyer was not billed + * for a winning bid. + */ + export interface Schema$ListNonBillableWinningBidsResponse { + /** + * A token to retrieve the next page of results. Pass this value in the + * ListNonBillableWinningBidsRequest.pageToken field in the subsequent call + * to the nonBillableWinningBids.list method to retrieve the next page of + * results. + */ + nextPageToken: string; + /** + * List of rows, with counts of bids not billed aggregated by reason. + */ + nonBillableWinningBidStatusRows: Schema$NonBillableWinningBidStatusRow[]; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list - * @desc Lists all metrics that are measured in terms of number of - * impressions. - * @alias adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListImpressionMetricsResponse.nextPageToken returned from the previous call to the impressionMetrics.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for listing publishers that had recent inventory matches + * with the requesting buyer. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/impressionMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListPublishersResponse { + /** + * List of publishers. + */ + publisher: Schema$Publisher[]; } -} - -export class Resource$Bidders$Accounts$Filtersets$Losingbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * @OutputOnly The Geo criteria the restriction applies to. + */ + export interface Schema$LocationContext { + /** + * IDs representing the geo location for this context. Please refer to the + * [geo-table.csv](https://storage.googleapis.com/adx-rtb-dictionaries/geo-table.csv) + * file for different geo criteria IDs. + */ + geoCriteriaIds: number[]; } - - getRoot() { - return this.root; + /** + * A metric value, with an expected value and a variance; represents a count + * that may be either exact or estimated (i.e. when sampled). + */ + export interface Schema$MetricValue { + /** + * The expected value of the metric. + */ + value: string; + /** + * The variance (i.e. square of the standard deviation) of the metric value. + * If value is exact, variance is 0. Can be used to calculate margin of + * error as a percentage of value, using the following formula, where Z is + * the standard constant that depends on the desired size of the confidence + * interval (e.g. for 90% confidence interval, use Z = 1.645): marginOfError + * = 100 * Z * sqrt(variance) / value + */ + variance: string; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.losingBids.list - * @desc List all reasons for which bids lost in the auction, with the number - * of bids that lost for each reason. - * @alias adexchangebuyer2.bidders.accounts.filterSets.losingBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListLosingBidsResponse.nextPageToken returned from the previous call to the losingBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/losingBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Native content for a creative. + */ + export interface Schema$NativeContent { + /** + * The name of the advertiser or sponsor, to be displayed in the ad + * creative. + */ + advertiserName: string; + /** + * The app icon, for app download ads. + */ + appIcon: Schema$Image; + /** + * A long description of the ad. + */ + body: string; + /** + * A label for the button that the user is supposed to click. + */ + callToAction: string; + /** + * The URL that the browser/SDK will load when the user clicks the ad. + */ + clickLinkUrl: string; + /** + * The URL to use for click tracking. + */ + clickTrackingUrl: string; + /** + * A short title for the ad. + */ + headline: string; + /** + * A large image. + */ + image: Schema$Image; + /** + * A smaller image, for the advertiser's logo. + */ + logo: Schema$Image; + /** + * The price of the promoted app including currency info. + */ + priceDisplayText: string; + /** + * The app rating in the app store. Must be in the range [0-5]. + */ + starRating: number; + /** + * The URL to the app store to purchase/download the promoted app. + */ + storeUrl: string; + /** + * The URL to fetch a native video ad. + */ + videoUrl: string; } -} - -export class Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * The number of winning bids with the specified dimension values for which + * the buyer was not billed, as described by the specified status. + */ + export interface Schema$NonBillableWinningBidStatusRow { + /** + * The number of bids with the specified status. + */ + bidCount: Schema$MetricValue; + /** + * The values of all dimensions associated with metric values in this row. + */ + rowDimensions: Schema$RowDimensions; + /** + * The status specifying why the winning bids were not billed. + */ + status: string; } - - getRoot() { - return this.root; + /** + * @OutputOnly The type of platform the restriction applies to. + */ + export interface Schema$PlatformContext { + /** + * The platforms this restriction applies to. + */ + platforms: string[]; } - - /** - * adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list - * @desc List all reasons for which winning bids were not billable, with the - * number of bids not billed for each reason. - * @alias - * adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListNonBillableWinningBidsResponse.nextPageToken returned from the previous call to the nonBillableWinningBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The publisher ID and name contain values relevant to the requesting buyer + * depending on whether it is an Ad Exchange buyer or Exchange Bidding buyer. + */ + export interface Schema$Publisher { + /** + * Publisher name contains: - Seller network name when the requesting buyer + * is an Ad Exchange buyer. - DFP network name or AdMob publisher code when + * the requesting buyer is an Exchange Bidding buyer. + */ + publisherDisplayName: string; + /** + * Publisher ID contains: - Seller network ID when the requesting buyer is + * an Ad Exchange buyer. See + * [seller-network-ids](https://developers.google.com/ad-exchange/rtb/downloads/seller-network-ids) + * - DFP network code or AdMob publisher code when the requesting buyer is + * an Exchange Bidding buyer. + */ + publisherId: string; + } + /** + * An open-ended realtime time range specified by the start timestamp. For + * filter sets that specify a realtime time range RTB metrics continue to be + * aggregated throughout the lifetime of the filter set. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/nonBillableWinningBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$RealtimeTimeRange { + /** + * The start timestamp of the real-time RTB metrics aggregation. + */ + startTimestamp: string; } -} - - - -export class Resource$Bidders$Filtersets { - root: Adexchangebuyer2; - bidMetrics: Resource$Bidders$Filtersets$Bidmetrics; - bidResponseErrors: Resource$Bidders$Filtersets$Bidresponseerrors; - bidResponsesWithoutBids: Resource$Bidders$Filtersets$Bidresponseswithoutbids; - filteredBidRequests: Resource$Bidders$Filtersets$Filteredbidrequests; - filteredBids: Resource$Bidders$Filtersets$Filteredbids; - impressionMetrics: Resource$Bidders$Filtersets$Impressionmetrics; - losingBids: Resource$Bidders$Filtersets$Losingbids; - nonBillableWinningBids: Resource$Bidders$Filtersets$Nonbillablewinningbids; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.bidMetrics = new Resource$Bidders$Filtersets$Bidmetrics(root); - this.bidResponseErrors = - new Resource$Bidders$Filtersets$Bidresponseerrors(root); - this.bidResponsesWithoutBids = - new Resource$Bidders$Filtersets$Bidresponseswithoutbids(root); - this.filteredBidRequests = - new Resource$Bidders$Filtersets$Filteredbidrequests(root); - this.filteredBids = new Resource$Bidders$Filtersets$Filteredbids(root); - this.impressionMetrics = - new Resource$Bidders$Filtersets$Impressionmetrics(root); - this.losingBids = new Resource$Bidders$Filtersets$Losingbids(root); - this.nonBillableWinningBids = - new Resource$Bidders$Filtersets$Nonbillablewinningbids(root); + /** + * A specific filtering status and how many times it occurred. + */ + export interface Schema$Reason { + /** + * The number of times the creative was filtered for the status. The count + * is aggregated across all publishers on the exchange. + */ + count: string; + /** + * The filtering status code. Please refer to the + * [creative-status-codes.txt](https://storage.googleapis.com/adx-rtb-dictionaries/creative-status-codes.txt) + * file for different statuses. + */ + status: number; } - - getRoot() { - return this.root; + /** + * A relative date range, specified by an offset and a duration. The supported + * range of dates begins 30 days before today and ends today. I.e. the limits + * for these values are: offset_days >= 0 duration_days >= 1 offset_days + * + duration_days <= 30 + */ + export interface Schema$RelativeDateRange { + /** + * The number of days in the requested date range. E.g. for a range spanning + * today, 1. For a range spanning the last 7 days, 7. + */ + durationDays: number; + /** + * The end date of the filter set, specified as the number of days before + * today. E.g. for a range where the last date is today, 0. + */ + offsetDays: number; } - - /** - * adexchangebuyer2.bidders.filterSets.create - * @desc Creates the specified filter set for the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.filterSets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.isTransient Whether the filter set is transient, or should be persisted indefinitely. By default, filter sets are not transient. If transient, it will be available for at least 1 hour after creation. - * @param {string} params.ownerName Name of the owner (bidder or account) of the filter set to be created. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` - * @param {().FilterSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A request for removing the association between a deal and a creative. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['ownerName'], - pathParams: ['ownerName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RemoveDealAssociationRequest { + /** + * The association between a creative and a deal that should be removed. + */ + association: Schema$CreativeDealAssociation; } - - /** - * adexchangebuyer2.bidders.filterSets.delete - * @desc Deletes the requested filter set from the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.filterSets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Full name of the resource to delete. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response may include multiple rows, breaking down along various + * dimensions. Encapsulates the values of all dimensions for a given row. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RowDimensions { + /** + * The time interval that this row represents. + */ + timeInterval: Schema$TimeInterval; } - - /** - * adexchangebuyer2.bidders.filterSets.get - * @desc Retrieves the requested filter set for the account with the given - * account ID. - * @alias adexchangebuyer2.bidders.filterSets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Full name of the resource being requested. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @OutputOnly A security context. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SecurityContext { + /** + * The security types in this context. + */ + securities: string[]; } - - /** - * adexchangebuyer2.bidders.filterSets.list - * @desc Lists all filter sets for the account with the given account ID. - * @alias adexchangebuyer2.bidders.filterSets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.ownerName Name of the owner (bidder or account) of the filter sets to be listed. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilterSetsResponse.nextPageToken returned from the previous call to the accounts.filterSets.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ownerName'], - pathParams: ['ownerName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The serving context for this restriction. + */ + export interface Schema$ServingContext { + /** + * Matches all contexts. + */ + all: string; + /** + * Matches impressions for a particular app type. + */ + appType: Schema$AppContext; + /** + * Matches impressions for a particular auction type. + */ + auctionType: Schema$AuctionContext; + /** + * Matches impressions coming from users *or* publishers in a specific + * location. + */ + location: Schema$LocationContext; + /** + * Matches impressions coming from a particular platform. + */ + platform: Schema$PlatformContext; + /** + * Matches impressions for a particular security type. + */ + securityType: Schema$SecurityContext; } -} -export class Resource$Bidders$Filtersets$Bidmetrics { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + /** + * @OutputOnly A representation of the status of an ad in a specific context. + * A context here relates to where something ultimately serves (for example, a + * user or publisher geo, a platform, an HTTPS vs HTTP request, or the type of + * auction). + */ + export interface Schema$ServingRestriction { + /** + * The contexts for the restriction. + */ + contexts: Schema$ServingContext[]; + /** + * Any disapprovals bound to this restriction. Only present if + * status=DISAPPROVED. Can be used to filter the response of the + * creatives.list method. + */ + disapprovalReasons: Schema$Disapproval[]; + /** + * The status of the creative in this context (for example, it has been + * explicitly disapproved or is pending review). + */ + status: string; } - - getRoot() { - return this.root; + /** + * A request for stopping notifications for changes to creative Status. + */ + export interface Schema$StopWatchingCreativeRequest {} + /** + * An interval of time, with an absolute start and end. + */ + export interface Schema$TimeInterval { + /** + * The timestamp marking the end of the range (exclusive) for which data is + * included. + */ + endTime: string; + /** + * The timestamp marking the start of the range (inclusive) for which data + * is included. + */ + startTime: string; } - - /** - * adexchangebuyer2.bidders.filterSets.bidMetrics.list - * @desc Lists all metrics that are measured in terms of number of bids. - * @alias adexchangebuyer2.bidders.filterSets.bidMetrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidMetricsResponse.nextPageToken returned from the previous call to the bidMetrics.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Video content for a creative. + */ + export interface Schema$VideoContent { + /** + * The URL to fetch a video ad. + */ + videoUrl: string; + /** + * The contents of a VAST document for a video ad. This document should + * conform to the VAST 2.0 or 3.0 standard. + */ + videoVastXml: string; + } + /** + * A request for watching changes to creative Status. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export interface Schema$WatchCreativeRequest { + /** + * The Pub/Sub topic to publish notifications to. This topic must already + * exist and must give permission to ad-exchange-buyside-reports@google.com + * to write to the topic. This should be the full resource name in + * "projects/{project_id}/topics/{topic_id}" format. + */ + topic: string; + } + + export class Resource$Accounts { + root: Adexchangebuyer2; + clients: Resource$Accounts$Clients; + creatives: Resource$Accounts$Creatives; + publishers: Resource$Accounts$Publishers; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.clients = new Resource$Accounts$Clients(root); + this.creatives = new Resource$Accounts$Creatives(root); + this.publishers = new Resource$Accounts$Publishers(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Accounts$Clients { + root: Adexchangebuyer2; + invitations: Resource$Accounts$Clients$Invitations; + users: Resource$Accounts$Clients$Users; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.invitations = new Resource$Accounts$Clients$Invitations(root); + this.users = new Resource$Accounts$Clients$Users(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.clients.create + * @desc Creates a new client buyer. + * @alias adexchangebuyer2.accounts.clients.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to create a client for. (required) + * @param {().Client} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/accounts/{accountId}/clients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.get + * @desc Gets a client buyer with a given client account ID. + * @alias adexchangebuyer2.accounts.clients.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer to retrieve. (required) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId'], + pathParams: ['accountId', 'clientAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.list + * @desc Lists all the clients for the current sponsor buyer. + * @alias adexchangebuyer2.accounts.clients.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Unique numerical account ID of the sponsor buyer to list the clients for. + * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientsResponse.nextPageToken returned from the previous call to the accounts.clients.list method. + * @param {string=} params.partnerClientId Optional unique identifier (from the standpoint of an Ad Exchange sponsor buyer partner) of the client to return. If specified, at most one client will be returned in the response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/accounts/{accountId}/clients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.update + * @desc Updates an existing client buyer. + * @alias adexchangebuyer2.accounts.clients.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Unique numerical account ID for the buyer of which the client buyer is a customer; the sponsor buyer to update a client for. (required) + * @param {string} params.clientAccountId Unique numerical account ID of the client to update. (required) + * @param {().Client} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId'], + pathParams: ['accountId', 'clientAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Bidders$Filtersets$Bidresponseerrors { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Accounts$Clients$Invitations { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.clients.invitations.create + * @desc Creates and sends out an email invitation to access an Ad Exchange + * client buyer account. + * @alias adexchangebuyer2.accounts.clients.invitations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user should be associated with. (required) + * @param {().ClientUserInvitation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId'], + pathParams: ['accountId', 'clientAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.invitations.get + * @desc Retrieves an existing client user invitation. + * @alias adexchangebuyer2.accounts.clients.invitations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user invitation to be retrieved is associated with. (required) + * @param {string} params.invitationId Numerical identifier of the user invitation to retrieve. (required) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations/{invitationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId', 'invitationId'], + pathParams: ['accountId', 'clientAccountId', 'invitationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.invitations.list + * @desc Lists all the client users invitations for a client with a given + * account ID. + * @alias adexchangebuyer2.accounts.clients.invitations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer to list invitations for. (required) You must either specify a string representation of a numerical account identifier or the `-` character to list all the invitations for all the clients of a given sponsor buyer. + * @param {integer=} params.pageSize Requested page size. Server may return fewer clients than requested. If unspecified, server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUserInvitationsResponse.nextPageToken returned from the previous call to the clients.invitations.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/invitations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId'], + pathParams: ['accountId', 'clientAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Accounts$Clients$Users { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.clients.users.get + * @desc Retrieves an existing client user. + * @alias adexchangebuyer2.accounts.clients.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) + * @param {string} params.userId Numerical identifier of the user to retrieve. (required) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId', 'userId'], + pathParams: ['accountId', 'clientAccountId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.users.list + * @desc Lists all the known client users for a specified sponsor buyer + * account ID. + * @alias adexchangebuyer2.accounts.clients.users.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the sponsor buyer of the client to list users for. (required) + * @param {string} params.clientAccountId The account ID of the client buyer to list users for. (required) You must specify either a string representation of a numerical account identifier or the `-` character to list all the client users for all the clients of a given sponsor buyer. + * @param {integer=} params.pageSize Requested page size. The server may return fewer clients than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListClientUsersResponse.nextPageToken returned from the previous call to the accounts.clients.users.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId'], + pathParams: ['accountId', 'clientAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.clients.users.update + * @desc Updates an existing client user. Only the user status can be + * changed on update. + * @alias adexchangebuyer2.accounts.clients.users.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Numerical account ID of the client's sponsor buyer. (required) + * @param {string} params.clientAccountId Numerical account ID of the client buyer that the user to be retrieved is associated with. (required) + * @param {string} params.userId Numerical identifier of the user to retrieve. (required) + * @param {().ClientUser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/clients/{clientAccountId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'clientAccountId', 'userId'], + pathParams: ['accountId', 'clientAccountId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangebuyer2.bidders.filterSets.bidResponseErrors.list - * @desc List all errors that occurred in bid responses, with the number of - * bid responses affected for each reason. - * @alias adexchangebuyer2.bidders.filterSets.bidResponseErrors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponseErrorsResponse.nextPageToken returned from the previous call to the bidResponseErrors.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts$Creatives { + root: Adexchangebuyer2; + dealAssociations: Resource$Accounts$Creatives$Dealassociations; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.dealAssociations = + new Resource$Accounts$Creatives$Dealassociations(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.creatives.create + * @desc Creates a creative. + * @alias adexchangebuyer2.accounts.creatives.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. + * @param {string=} params.duplicateIdMode Indicates if multiple creatives can share an ID or not. Default is NO_DUPLICATES (one ID per creative). + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/accounts/{accountId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.get + * @desc Gets a creative. + * @alias adexchangebuyer2.accounts.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account the creative belongs to. + * @param {string} params.creativeId The ID of the creative to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.list + * @desc Lists creatives. + * @alias adexchangebuyer2.accounts.creatives.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account to list the creatives from. Specify "-" to list all creatives the current user has access to. + * @param {integer=} params.pageSize Requested page size. The server may return fewer creatives than requested (due to timeout constraint) even if more are available via another call. If unspecified, server will pick an appropriate default. Acceptable values are 1 to 1000, inclusive. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativesResponse.next_page_token returned from the previous call to 'ListCreatives' method. + * @param {string=} params.query An optional query string to filter creatives. If no filter is specified, all active creatives will be returned. Supported queries are:
  • accountId=account_id_string
  • creativeId=creative_id_string
  • dealsStatus: {approved, conditionally_approved, disapproved, not_checked}
  • openAuctionStatus: {approved, conditionally_approved, disapproved, not_checked}
  • attribute: {a numeric attribute from the list of attributes}
  • disapprovalReason: {a reason from DisapprovalReason}
Example: 'accountId=12345 AND (dealsStatus:disapproved AND disapprovalReason:unacceptable_content) OR attribute:47' + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/accounts/{accountId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.stopWatching + * @desc Stops watching a creative. Will stop push notifications being sent + * to the topics when the creative changes status. + * @alias adexchangebuyer2.accounts.creatives.stopWatching + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account of the creative to stop notifications for. + * @param {string} params.creativeId The creative ID of the creative to stop notifications for. Specify "-" to specify stopping account level notifications. + * @param {().StopWatchingCreativeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stopWatching(params?: any, options?: MethodOptions): + AxiosPromise; + stopWatching( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stopWatching( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}:stopWatching') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.update + * @desc Updates a creative. + * @alias adexchangebuyer2.accounts.creatives.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account that this creative belongs to. Can be used to filter the response of the creatives.list method. + * @param {string} params.creativeId The buyer-defined creative ID of this creative. Can be used to filter the response of the creatives.list method. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.watch + * @desc Watches a creative. Will result in push notifications being sent to + * the topic when the creative changes status. + * @alias adexchangebuyer2.accounts.creatives.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account of the creative to watch. + * @param {string} params.creativeId The creative ID to watch for status changes. Specify "-" to watch all creatives under the above account. If both creative-level and account-level notifications are sent, only a single notification will be sent to the creative-level notification topic. + * @param {().WatchCreativeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}:watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponseErrors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Accounts$Creatives$Dealassociations { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.creatives.dealAssociations.add + * @desc Associate an existing deal with a creative. + * @alias adexchangebuyer2.accounts.creatives.dealAssociations.add + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account the creative belongs to. + * @param {string} params.creativeId The ID of the creative associated with the deal. + * @param {().AddDealAssociationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + add(params?: any, options?: MethodOptions): AxiosPromise; + add(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + add(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:add') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.dealAssociations.list + * @desc List all creative-deal associations. + * @alias adexchangebuyer2.accounts.creatives.dealAssociations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account to list the associations from. Specify "-" to list all creatives the current user has access to. + * @param {string} params.creativeId The creative ID to list the associations from. Specify "-" to list all creatives under the above account. + * @param {integer=} params.pageSize Requested page size. Server may return fewer associations than requested. If unspecified, server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListDealAssociationsResponse.next_page_token returned from the previous call to 'ListDealAssociations' method. + * @param {string=} params.query An optional query string to filter deal associations. If no filter is specified, all associations will be returned. Supported queries are:
  • accountId=account_id_string
  • creativeId=creative_id_string
  • dealsId=deals_id_string
  • dealsStatus:{approved, conditionally_approved, disapproved, not_checked}
  • openAuctionStatus:{approved, conditionally_approved, disapproved, not_checked}
Example: 'dealsId=12345 AND dealsStatus:disapproved' + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * adexchangebuyer2.accounts.creatives.dealAssociations.remove + * @desc Remove the association between a deal and a creative. + * @alias adexchangebuyer2.accounts.creatives.dealAssociations.remove + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account the creative belongs to. + * @param {string} params.creativeId The ID of the creative associated with the deal. + * @param {().RemoveDealAssociationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + remove(params?: any, options?: MethodOptions): AxiosPromise; + remove( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + remove( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/accounts/{accountId}/creatives/{creativeId}/dealAssociations:remove') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'creativeId'], + pathParams: ['accountId', 'creativeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Bidders$Filtersets$Bidresponseswithoutbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + export class Resource$Accounts$Publishers { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.accounts.publishers.list + * @desc Lists publishers that had recent inventory matches with the + * requesting buyer. + * @alias adexchangebuyer2.accounts.publishers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID of the requesting buyer. + * @param {string=} params.environment Optional environment (WEB, APP) for which to return publishers. If specified, response will only include publishers that had recent inventory matches with the requesting buyer on the specified platform. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/accounts/{accountId}/publishers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list - * @desc List all reasons for which bid responses were considered to have no - * applicable bids, with the number of bid responses affected for each reason. - * @alias adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponsesWithoutBidsResponse.nextPageToken returned from the previous call to the bidResponsesWithoutBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Bidders { + root: Adexchangebuyer2; + accounts: Resource$Bidders$Accounts; + filterSets: Resource$Bidders$Filtersets; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.accounts = new Resource$Bidders$Accounts(root); + this.filterSets = new Resource$Bidders$Filtersets(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponsesWithoutBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Bidders$Filtersets$Filteredbidrequests { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + getRoot() { + return this.root; + } } + export class Resource$Bidders$Accounts { + root: Adexchangebuyer2; + filterSets: Resource$Bidders$Accounts$Filtersets; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.filterSets = new Resource$Bidders$Accounts$Filtersets(root); + } - - /** - * adexchangebuyer2.bidders.filterSets.filteredBidRequests.list - * @desc List all reasons that caused a bid request not to be sent for an - * impression, with the number of bid requests not sent for each reason. - * @alias adexchangebuyer2.bidders.filterSets.filteredBidRequests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidRequestsResponse.nextPageToken returned from the previous call to the filteredBidRequests.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Bidders$Accounts$Filtersets { + root: Adexchangebuyer2; + bidMetrics: Resource$Bidders$Accounts$Filtersets$Bidmetrics; + bidResponseErrors: Resource$Bidders$Accounts$Filtersets$Bidresponseerrors; + bidResponsesWithoutBids: + Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids; + filteredBidRequests: + Resource$Bidders$Accounts$Filtersets$Filteredbidrequests; + filteredBids: Resource$Bidders$Accounts$Filtersets$Filteredbids; + impressionMetrics: Resource$Bidders$Accounts$Filtersets$Impressionmetrics; + losingBids: Resource$Bidders$Accounts$Filtersets$Losingbids; + nonBillableWinningBids: + Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.bidMetrics = + new Resource$Bidders$Accounts$Filtersets$Bidmetrics(root); + this.bidResponseErrors = + new Resource$Bidders$Accounts$Filtersets$Bidresponseerrors(root); + this.bidResponsesWithoutBids = + new Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids( + root); + this.filteredBidRequests = + new Resource$Bidders$Accounts$Filtersets$Filteredbidrequests(root); + this.filteredBids = + new Resource$Bidders$Accounts$Filtersets$Filteredbids(root); + this.impressionMetrics = + new Resource$Bidders$Accounts$Filtersets$Impressionmetrics(root); + this.losingBids = + new Resource$Bidders$Accounts$Filtersets$Losingbids(root); + this.nonBillableWinningBids = + new Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.create + * @desc Creates the specified filter set for the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.accounts.filterSets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.isTransient Whether the filter set is transient, or should be persisted indefinitely. By default, filter sets are not transient. If transient, it will be available for at least 1 hour after creation. + * @param {string} params.ownerName Name of the owner (bidder or account) of the filter set to be created. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` + * @param {().FilterSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['ownerName'], + pathParams: ['ownerName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.delete + * @desc Deletes the requested filter set from the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.accounts.filterSets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Full name of the resource to delete. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.get + * @desc Retrieves the requested filter set for the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.accounts.filterSets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Full name of the resource being requested. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.list + * @desc Lists all filter sets for the account with the given account ID. + * @alias adexchangebuyer2.bidders.accounts.filterSets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.ownerName Name of the owner (bidder or account) of the filter sets to be listed. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilterSetsResponse.nextPageToken returned from the previous call to the accounts.filterSets.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ownerName'], + pathParams: ['ownerName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBidRequests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + export class Resource$Bidders$Accounts$Filtersets$Bidmetrics { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list + * @desc Lists all metrics that are measured in terms of number of bids. + * @alias adexchangebuyer2.bidders.accounts.filterSets.bidMetrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidMetricsResponse.nextPageToken returned from the previous call to the bidMetrics.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/bidMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Bidders$Filtersets$Filteredbids { - root: Adexchangebuyer2; - creatives: Resource$Bidders$Filtersets$Filteredbids$Creatives; - details: Resource$Bidders$Filtersets$Filteredbids$Details; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - this.creatives = - new Resource$Bidders$Filtersets$Filteredbids$Creatives(root); - this.details = new Resource$Bidders$Filtersets$Filteredbids$Details(root); + export class Resource$Bidders$Accounts$Filtersets$Bidresponseerrors { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list + * @desc List all errors that occurred in bid responses, with the number of + * bid responses affected for each reason. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.bidResponseErrors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponseErrorsResponse.nextPageToken returned from the previous call to the bidResponseErrors.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponseErrors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Bidders$Accounts$Filtersets$Bidresponseswithoutbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list + * @desc List all reasons for which bid responses were considered to have no + * applicable bids, with the number of bid responses affected for each + * reason. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.bidResponsesWithoutBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponsesWithoutBidsResponse.nextPageToken returned from the previous call to the bidResponsesWithoutBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/{+filterSetName}/bidResponsesWithoutBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * adexchangebuyer2.bidders.filterSets.filteredBids.list - * @desc List all reasons for which bids were filtered, with the number of - * bids filtered for each reason. - * @alias adexchangebuyer2.bidders.filterSets.filteredBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidsResponse.nextPageToken returned from the previous call to the filteredBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Bidders$Accounts$Filtersets$Filteredbidrequests { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list + * @desc List all reasons that caused a bid request not to be sent for an + * impression, with the number of bid requests not sent for each reason. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.filteredBidRequests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidRequestsResponse.nextPageToken returned from the previous call to the filteredBidRequests.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBidRequests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Bidders$Accounts$Filtersets$Filteredbids { + root: Adexchangebuyer2; + creatives: Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives; + details: Resource$Bidders$Accounts$Filtersets$Filteredbids$Details; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.creatives = + new Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives(root); + this.details = + new Resource$Bidders$Accounts$Filtersets$Filteredbids$Details(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list + * @desc List all reasons for which bids were filtered, with the number of + * bids filtered for each reason. + * @alias adexchangebuyer2.bidders.accounts.filterSets.filteredBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidsResponse.nextPageToken returned from the previous call to the filteredBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Bidders$Filtersets$Filteredbids$Creatives { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Bidders$Accounts$Filtersets$Filteredbids$Creatives { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list + * @desc List all creatives associated with a specific reason for which bids + * were filtered, with the number of bids filtered for each creative. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.creatives.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by creative. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByCreativeResponse.nextPageToken returned from the previous call to the filteredBids.creatives.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName', 'creativeStatusId'], + pathParams: ['creativeStatusId', 'filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListCreativeStatusBreakdownByCreativeResponse>(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Bidders$Accounts$Filtersets$Filteredbids$Details { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list + * @desc List all details associated with a specific reason for which bids + * were filtered, with the number of bids filtered for each detail. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.filteredBids.details.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by detail. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByDetailResponse.nextPageToken returned from the previous call to the filteredBids.details.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName', 'creativeStatusId'], + pathParams: ['creativeStatusId', 'filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListCreativeStatusBreakdownByDetailResponse>(parameters); + } + } } - /** - * adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list - * @desc List all creatives associated with a specific reason for which bids - * were filtered, with the number of bids filtered for each creative. - * @alias adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by creative. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByCreativeResponse.nextPageToken returned from the previous call to the filteredBids.creatives.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByCreativeResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName', 'creativeStatusId'], - pathParams: ['creativeStatusId', 'filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ListCreativeStatusBreakdownByCreativeResponse>(parameters); + export class Resource$Bidders$Accounts$Filtersets$Impressionmetrics { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list + * @desc Lists all metrics that are measured in terms of number of + * impressions. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.impressionMetrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListImpressionMetricsResponse.nextPageToken returned from the previous call to the impressionMetrics.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/impressionMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Bidders$Filtersets$Filteredbids$Details { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Bidders$Accounts$Filtersets$Losingbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.losingBids.list + * @desc List all reasons for which bids lost in the auction, with the + * number of bids that lost for each reason. + * @alias adexchangebuyer2.bidders.accounts.filterSets.losingBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListLosingBidsResponse.nextPageToken returned from the previous call to the losingBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/losingBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Bidders$Accounts$Filtersets$Nonbillablewinningbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list + * @desc List all reasons for which winning bids were not billable, with the + * number of bids not billed for each reason. + * @alias + * adexchangebuyer2.bidders.accounts.filterSets.nonBillableWinningBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListNonBillableWinningBidsResponse.nextPageToken returned from the previous call to the nonBillableWinningBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2beta1/{+filterSetName}/nonBillableWinningBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - /** - * adexchangebuyer2.bidders.filterSets.filteredBids.details.list - * @desc List all details associated with a specific reason for which bids - * were filtered, with the number of bids filtered for each detail. - * @alias adexchangebuyer2.bidders.filterSets.filteredBids.details.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by detail. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByDetailResponse.nextPageToken returned from the previous call to the filteredBids.details.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByDetailResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListCreativeStatusBreakdownByDetailResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + + export class Resource$Bidders$Filtersets { + root: Adexchangebuyer2; + bidMetrics: Resource$Bidders$Filtersets$Bidmetrics; + bidResponseErrors: Resource$Bidders$Filtersets$Bidresponseerrors; + bidResponsesWithoutBids: + Resource$Bidders$Filtersets$Bidresponseswithoutbids; + filteredBidRequests: Resource$Bidders$Filtersets$Filteredbidrequests; + filteredBids: Resource$Bidders$Filtersets$Filteredbids; + impressionMetrics: Resource$Bidders$Filtersets$Impressionmetrics; + losingBids: Resource$Bidders$Filtersets$Losingbids; + nonBillableWinningBids: Resource$Bidders$Filtersets$Nonbillablewinningbids; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.bidMetrics = new Resource$Bidders$Filtersets$Bidmetrics(root); + this.bidResponseErrors = + new Resource$Bidders$Filtersets$Bidresponseerrors(root); + this.bidResponsesWithoutBids = + new Resource$Bidders$Filtersets$Bidresponseswithoutbids(root); + this.filteredBidRequests = + new Resource$Bidders$Filtersets$Filteredbidrequests(root); + this.filteredBids = new Resource$Bidders$Filtersets$Filteredbids(root); + this.impressionMetrics = + new Resource$Bidders$Filtersets$Impressionmetrics(root); + this.losingBids = new Resource$Bidders$Filtersets$Losingbids(root); + this.nonBillableWinningBids = + new Resource$Bidders$Filtersets$Nonbillablewinningbids(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.create + * @desc Creates the specified filter set for the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.filterSets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.isTransient Whether the filter set is transient, or should be persisted indefinitely. By default, filter sets are not transient. If transient, it will be available for at least 1 hour after creation. + * @param {string} params.ownerName Name of the owner (bidder or account) of the filter set to be created. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` + * @param {().FilterSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['ownerName'], + pathParams: ['ownerName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.filterSets.delete + * @desc Deletes the requested filter set from the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.filterSets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Full name of the resource to delete. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.filterSets.get + * @desc Retrieves the requested filter set for the account with the given + * account ID. + * @alias adexchangebuyer2.bidders.filterSets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Full name of the resource being requested. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adexchangebuyer2.bidders.filterSets.list + * @desc Lists all filter sets for the account with the given account ID. + * @alias adexchangebuyer2.bidders.filterSets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.ownerName Name of the owner (bidder or account) of the filter sets to be listed. For example: - For a bidder-level filter set for bidder 123: `bidders/123` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilterSetsResponse.nextPageToken returned from the previous call to the accounts.filterSets.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+ownerName}/filterSets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ownerName'], + pathParams: ['ownerName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName', 'creativeStatusId'], - pathParams: ['creativeStatusId', 'filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ListCreativeStatusBreakdownByDetailResponse>(parameters); + } + export class Resource$Bidders$Filtersets$Bidmetrics { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.bidMetrics.list + * @desc Lists all metrics that are measured in terms of number of bids. + * @alias adexchangebuyer2.bidders.filterSets.bidMetrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidMetricsResponse.nextPageToken returned from the previous call to the bidMetrics.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/bidMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Bidders$Filtersets$Impressionmetrics { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Bidders$Filtersets$Bidresponseerrors { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.bidResponseErrors.list + * @desc List all errors that occurred in bid responses, with the number of + * bid responses affected for each reason. + * @alias adexchangebuyer2.bidders.filterSets.bidResponseErrors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponseErrorsResponse.nextPageToken returned from the previous call to the bidResponseErrors.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/bidResponseErrors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Bidders$Filtersets$Bidresponseswithoutbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list + * @desc List all reasons for which bid responses were considered to have no + * applicable bids, with the number of bid responses affected for each + * reason. + * @alias adexchangebuyer2.bidders.filterSets.bidResponsesWithoutBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListBidResponsesWithoutBidsResponse.nextPageToken returned from the previous call to the bidResponsesWithoutBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2beta1/{+filterSetName}/bidResponsesWithoutBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * adexchangebuyer2.bidders.filterSets.impressionMetrics.list - * @desc Lists all metrics that are measured in terms of number of - * impressions. - * @alias adexchangebuyer2.bidders.filterSets.impressionMetrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListImpressionMetricsResponse.nextPageToken returned from the previous call to the impressionMetrics.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/impressionMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bidders$Filtersets$Filteredbidrequests { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.filteredBidRequests.list + * @desc List all reasons that caused a bid request not to be sent for an + * impression, with the number of bid requests not sent for each reason. + * @alias adexchangebuyer2.bidders.filterSets.filteredBidRequests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidRequestsResponse.nextPageToken returned from the previous call to the filteredBidRequests.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBidRequests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Bidders$Filtersets$Losingbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Bidders$Filtersets$Filteredbids { + root: Adexchangebuyer2; + creatives: Resource$Bidders$Filtersets$Filteredbids$Creatives; + details: Resource$Bidders$Filtersets$Filteredbids$Details; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + this.creatives = + new Resource$Bidders$Filtersets$Filteredbids$Creatives(root); + this.details = new Resource$Bidders$Filtersets$Filteredbids$Details(root); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.filteredBids.list + * @desc List all reasons for which bids were filtered, with the number of + * bids filtered for each reason. + * @alias adexchangebuyer2.bidders.filterSets.filteredBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListFilteredBidsResponse.nextPageToken returned from the previous call to the filteredBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/filteredBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - getRoot() { - return this.root; + export class Resource$Bidders$Filtersets$Filteredbids$Creatives { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list + * @desc List all creatives associated with a specific reason for which bids + * were filtered, with the number of bids filtered for each creative. + * @alias adexchangebuyer2.bidders.filterSets.filteredBids.creatives.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by creative. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByCreativeResponse.nextPageToken returned from the previous call to the filteredBids.creatives.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByCreativeResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName', 'creativeStatusId'], + pathParams: ['creativeStatusId', 'filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListCreativeStatusBreakdownByCreativeResponse>(parameters); + } + } } - - /** - * adexchangebuyer2.bidders.filterSets.losingBids.list - * @desc List all reasons for which bids lost in the auction, with the number - * of bids that lost for each reason. - * @alias adexchangebuyer2.bidders.filterSets.losingBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListLosingBidsResponse.nextPageToken returned from the previous call to the losingBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/losingBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bidders$Filtersets$Filteredbids$Details { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.filteredBids.details.list + * @desc List all details associated with a specific reason for which bids + * were filtered, with the number of bids filtered for each detail. + * @alias adexchangebuyer2.bidders.filterSets.filteredBids.details.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.creativeStatusId The ID of the creative status for which to retrieve a breakdown by detail. See [creative-status-codes](https://developers.google.com/ad-exchange/rtb/downloads/creative-status-codes). Details are only available for statuses 10, 14, 15, 17, 18, 19, 86, and 87. + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListCreativeStatusBreakdownByDetailResponse.nextPageToken returned from the previous call to the filteredBids.details.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>, + callback?: BodyResponseCallback< + Schema$ListCreativeStatusBreakdownByDetailResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2beta1/{+filterSetName}/filteredBids/{creativeStatusId}/details') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName', 'creativeStatusId'], + pathParams: ['creativeStatusId', 'filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListCreativeStatusBreakdownByDetailResponse>(parameters); + } } } -} -export class Resource$Bidders$Filtersets$Nonbillablewinningbids { - root: Adexchangebuyer2; - constructor(root: Adexchangebuyer2) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + export class Resource$Bidders$Filtersets$Impressionmetrics { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.impressionMetrics.list + * @desc Lists all metrics that are measured in terms of number of + * impressions. + * @alias adexchangebuyer2.bidders.filterSets.impressionMetrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListImpressionMetricsResponse.nextPageToken returned from the previous call to the impressionMetrics.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/impressionMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list - * @desc List all reasons for which winning bids were not billable, with the - * number of bids not billed for each reason. - * @alias adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` - * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListNonBillableWinningBidsResponse.nextPageToken returned from the previous call to the nonBillableWinningBids.list method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Bidders$Filtersets$Losingbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.losingBids.list + * @desc List all reasons for which bids lost in the auction, with the + * number of bids that lost for each reason. + * @alias adexchangebuyer2.bidders.filterSets.losingBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListLosingBidsResponse.nextPageToken returned from the previous call to the losingBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+filterSetName}/losingBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+filterSetName}/nonBillableWinningBids') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterSetName'], - pathParams: ['filterSetName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + + export class Resource$Bidders$Filtersets$Nonbillablewinningbids { + root: Adexchangebuyer2; + constructor(root: Adexchangebuyer2) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list + * @desc List all reasons for which winning bids were not billable, with the + * number of bids not billed for each reason. + * @alias adexchangebuyer2.bidders.filterSets.nonBillableWinningBids.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterSetName Name of the filter set that should be applied to the requested metrics. For example: - For a bidder-level filter set for bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set for the buyer account representing bidder 123: `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set for the child seat buyer account 456 whose bidder is 123: `bidders/123/accounts/456/filterSets/abc` + * @param {integer=} params.pageSize Requested page size. The server may return fewer results than requested. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListNonBillableWinningBidsResponse.nextPageToken returned from the previous call to the nonBillableWinningBids.list method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexchangebuyer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2beta1/{+filterSetName}/nonBillableWinningBids') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterSetName'], + pathParams: ['filterSetName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/adexchangeseller/v1.1.ts b/src/apis/adexchangeseller/v1.1.ts index 3a0b8702590..ef1d33fd59e 100644 --- a/src/apis/adexchangeseller/v1.1.ts +++ b/src/apis/adexchangeseller/v1.1.ts @@ -27,1559 +27,1577 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Seller API - * - * Accesses the inventory of Ad Exchange seller users and generates reports. - * - * @example - * const google = require('googleapis'); - * const adexchangeseller = google.adexchangeseller('v1.1'); - * - * @namespace adexchangeseller - * @type {Function} - * @version v1.1 - * @variation v1.1 - * @param {object=} options Options for Adexchangeseller - */ -export class Adexchangeseller { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - adclients: Resource$Adclients; - adunits: Resource$Adunits; - alerts: Resource$Alerts; - customchannels: Resource$Customchannels; - metadata: Resource$Metadata; - preferreddeals: Resource$Preferreddeals; - reports: Resource$Reports; - urlchannels: Resource$Urlchannels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.adclients = new Resource$Adclients(this); - this.adunits = new Resource$Adunits(this); - this.alerts = new Resource$Alerts(this); - this.customchannels = new Resource$Customchannels(this); - this.metadata = new Resource$Metadata(this); - this.preferreddeals = new Resource$Preferreddeals(this); - this.reports = new Resource$Reports(this); - this.urlchannels = new Resource$Urlchannels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Account { - /** - * Unique identifier of this account. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#account. - */ - kind: string; - /** - * Name of this account. - */ - name: string; -} -export interface Schema$AdClient { - /** - * Whether this ad client is opted in to ARC. - */ - arcOptIn: boolean; - /** - * Unique identifier of this ad client. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#adClient. - */ - kind: string; - /** - * This ad client's product code, which corresponds to the PRODUCT_CODE - * report dimension. - */ - productCode: string; - /** - * Whether this ad client supports being reported on. - */ - supportsReporting: boolean; -} -export interface Schema$AdClients { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad clients returned in this list response. - */ - items: Schema$AdClient[]; - /** - * Kind of list this is, in this case adexchangeseller#adClients. - */ - kind: string; - /** - * Continuation token used to page through ad clients. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$AdUnit { - /** - * Identity code of this ad unit, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this ad unit. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#adUnit. - */ - kind: string; - /** - * Name of this ad unit. - */ - name: string; - /** - * Status of this ad unit. Possible values are: NEW: Indicates that the ad - * unit was created within the last seven days and does not yet have any - * activity associated with it. ACTIVE: Indicates that there has been - * activity on this ad unit in the last seven days. INACTIVE: Indicates that - * there has been no activity on this ad unit in the last seven days. - */ - status: string; -} -export interface Schema$AdUnits { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad units returned in this list response. - */ - items: Schema$AdUnit[]; - /** - * Kind of list this is, in this case adexchangeseller#adUnits. - */ - kind: string; - /** - * Continuation token used to page through ad units. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$Alert { - /** - * Unique identifier of this alert. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#alert. - */ - kind: string; - /** - * The localized alert message. - */ - message: string; - /** - * Severity of this alert. Possible values: INFO, WARNING, SEVERE. - */ - severity: string; - /** - * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, - * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, - * GRAYLISTED_PUBLISHER, API_HOLD. - */ - type: string; -} -export interface Schema$Alerts { - /** - * The alerts returned in this list response. - */ - items: Schema$Alert[]; - /** - * Kind of list this is, in this case adexchangeseller#alerts. - */ - kind: string; -} -export interface Schema$CustomChannel { - /** - * Code of this custom channel, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this custom channel. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#customChannel. - */ - kind: string; - /** - * Name of this custom channel. - */ - name: string; - /** - * The targeting information of this custom channel, if activated. - */ - targetingInfo: any; -} -export interface Schema$CustomChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The custom channels returned in this list response. - */ - items: Schema$CustomChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#customChannels. - */ - kind: string; - /** - * Continuation token used to page through custom channels. To retrieve the - * next page of results, set the next request's "pageToken" - * value to this. - */ - nextPageToken: string; -} -export interface Schema$Metadata { - items: Schema$ReportingMetadataEntry[]; - /** - * Kind of list this is, in this case adexchangeseller#metadata. - */ - kind: string; -} -export interface Schema$PreferredDeal { - /** - * The name of the advertiser this deal is for. - */ - advertiserName: string; - /** - * The name of the buyer network this deal is for. - */ - buyerNetworkName: string; - /** - * The currency code that applies to the fixed_cpm value. If not set then - * assumed to be USD. - */ - currencyCode: string; - /** - * Time when this deal stops being active in seconds since the epoch (GMT). If - * not set then this deal is valid until manually disabled by the publisher. - */ - endTime: string; - /** - * The fixed price for this preferred deal. In cpm micros of currency - * according to currencyCode. If set, then this preferred deal is eligible for - * the fixed price tier of buying (highest priority, pay exactly the - * configured fixed price). - */ - fixedCpm: string; - /** - * Unique identifier of this preferred deal. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#preferredDeal. - */ - kind: string; - /** - * Time when this deal becomes active in seconds since the epoch (GMT). If not - * set then this deal is active immediately upon creation. - */ - startTime: string; -} -export interface Schema$PreferredDeals { - /** - * The preferred deals returned in this list response. - */ - items: Schema$PreferredDeal[]; - /** - * Kind of list this is, in this case adexchangeseller#preferredDeals. - */ - kind: string; -} -export interface Schema$Report { - /** - * The averages of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - averages: string[]; - /** - * The header information of the columns requested in the report. This is a - * list of headers; one for each dimension in the request, followed by one for - * each metric in the request. - */ - headers: any[]; - /** - * Kind this is, in this case adexchangeseller#report. - */ - kind: string; - /** - * The output rows of the report. Each row is a list of cells; one for each - * dimension in the request, followed by one for each metric in the request. - * The dimension cells contain strings, and the metric cells contain numbers. - */ - rows: string[][]; - /** - * The total number of rows matched by the report request. Fewer rows may be - * returned in the response due to being limited by the row count requested or - * the report row limit. - */ - totalMatchedRows: string; - /** - * The totals of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - totals: string[]; - /** - * Any warnings associated with generation of the report. - */ - warnings: string[]; -} -export interface Schema$ReportingMetadataEntry { - /** - * For metrics this is a list of dimension IDs which the metric is compatible - * with, for dimensions it is a list of compatibility groups the dimension - * belongs to. - */ - compatibleDimensions: string[]; - /** - * The names of the metrics the dimension or metric this reporting metadata - * entry describes is compatible with. - */ - compatibleMetrics: string[]; - /** - * Unique identifier of this reporting metadata entry, corresponding to the - * name of the appropriate dimension or metric. - */ - id: string; - /** - * Kind of resource this is, in this case - * adexchangeseller#reportingMetadataEntry. - */ - kind: string; - /** - * The names of the dimensions which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredDimensions: string[]; - /** - * The names of the metrics which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredMetrics: string[]; - /** - * The codes of the projects supported by the dimension or metric this - * reporting metadata entry describes. - */ - supportedProducts: string[]; -} -export interface Schema$SavedReport { - /** - * Unique identifier of this saved report. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#savedReport. - */ - kind: string; - /** - * This saved report's name. - */ - name: string; -} -export interface Schema$SavedReports { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The saved reports returned in this list response. - */ - items: Schema$SavedReport[]; - /** - * Kind of list this is, in this case adexchangeseller#savedReports. - */ - kind: string; - /** - * Continuation token used to page through saved reports. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$UrlChannel { - /** - * Unique identifier of this URL channel. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#urlChannel. - */ - kind: string; - /** - * URL Pattern of this URL channel. Does not include "http://" or - * "https://". Example: www.example.com/home - */ - urlPattern: string; -} -export interface Schema$UrlChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The URL channels returned in this list response. - */ - items: Schema$UrlChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#urlChannels. - */ - kind: string; +export namespace adexchangeseller_v1_1 { /** - * Continuation token used to page through URL channels. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} - -export class Resource$Accounts { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adexchangeseller.accounts.get - * @desc Get information about the selected Ad Exchange account. - * @alias adexchangeseller.accounts.get - * @memberOf! () + * Ad Exchange Seller API * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to get information about. Tip: 'myaccount' is a valid ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + * Accesses the inventory of Ad Exchange seller users and generates reports. + * + * @example + * const google = require('googleapis'); + * const adexchangeseller = google.adexchangeseller('v1.1'); + * + * @namespace adexchangeseller + * @type {Function} + * @version v1.1 + * @variation v1.1 + * @param {object=} options Options for Adexchangeseller + */ + export class Adexchangeseller { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + adclients: Resource$Adclients; + adunits: Resource$Adunits; + alerts: Resource$Alerts; + customchannels: Resource$Customchannels; + metadata: Resource$Metadata; + preferreddeals: Resource$Preferreddeals; + reports: Resource$Reports; + urlchannels: Resource$Urlchannels; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.adclients = new Resource$Adclients(this); + this.adunits = new Resource$Adunits(this); + this.alerts = new Resource$Alerts(this); + this.customchannels = new Resource$Customchannels(this); + this.metadata = new Resource$Metadata(this); + this.preferreddeals = new Resource$Preferreddeals(this); + this.reports = new Resource$Reports(this); + this.urlchannels = new Resource$Urlchannels(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Adclients { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Account { + /** + * Unique identifier of this account. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#account. + */ + kind: string; + /** + * Name of this account. + */ + name: string; } - - getRoot() { - return this.root; + export interface Schema$AdClient { + /** + * Whether this ad client is opted in to ARC. + */ + arcOptIn: boolean; + /** + * Unique identifier of this ad client. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#adClient. + */ + kind: string; + /** + * This ad client's product code, which corresponds to the PRODUCT_CODE + * report dimension. + */ + productCode: string; + /** + * Whether this ad client supports being reported on. + */ + supportsReporting: boolean; } - - - /** - * adexchangeseller.adclients.list - * @desc List all ad clients in this Ad Exchange account. - * @alias adexchangeseller.adclients.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdClients { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad clients returned in this list response. + */ + items: Schema$AdClient[]; + /** + * Kind of list this is, in this case adexchangeseller#adClients. + */ + kind: string; + /** + * Continuation token used to page through ad clients. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } -} - -export class Resource$Adunits { - root: Adexchangeseller; - customchannels: Resource$Adunits$Customchannels; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.customchannels = new Resource$Adunits$Customchannels(root); + export interface Schema$AdUnit { + /** + * Identity code of this ad unit, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this ad unit. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#adUnit. + */ + kind: string; + /** + * Name of this ad unit. + */ + name: string; + /** + * Status of this ad unit. Possible values are: NEW: Indicates that the ad + * unit was created within the last seven days and does not yet have any + * activity associated with it. ACTIVE: Indicates that there has been + * activity on this ad unit in the last seven days. INACTIVE: Indicates + * that there has been no activity on this ad unit in the last seven days. + */ + status: string; } - - getRoot() { - return this.root; + export interface Schema$AdUnits { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad units returned in this list response. + */ + items: Schema$AdUnit[]; + /** + * Kind of list this is, in this case adexchangeseller#adUnits. + */ + kind: string; + /** + * Continuation token used to page through ad units. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - - /** - * adexchangeseller.adunits.get - * @desc Gets the specified ad unit in the specified ad client. - * @alias adexchangeseller.adunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to get the ad unit. - * @param {string} params.adUnitId Ad unit to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Alert { + /** + * Unique identifier of this alert. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#alert. + */ + kind: string; + /** + * The localized alert message. + */ + message: string; + /** + * Severity of this alert. Possible values: INFO, WARNING, SEVERE. + */ + severity: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, + * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type: string; } - - - /** - * adexchangeseller.adunits.list - * @desc List all ad units in the specified ad client for this Ad Exchange - * account. - * @alias adexchangeseller.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Alerts { + /** + * The alerts returned in this list response. + */ + items: Schema$Alert[]; + /** + * Kind of list this is, in this case adexchangeseller#alerts. + */ + kind: string; } -} -export class Resource$Adunits$Customchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CustomChannel { + /** + * Code of this custom channel, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this custom channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#customChannel. + */ + kind: string; + /** + * Name of this custom channel. + */ + name: string; + /** + * The targeting information of this custom channel, if activated. + */ + targetingInfo: any; } - - getRoot() { - return this.root; + export interface Schema$CustomChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The custom channels returned in this list response. + */ + items: Schema$CustomChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#customChannels. + */ + kind: string; + /** + * Continuation token used to page through custom channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$Metadata { + items: Schema$ReportingMetadataEntry[]; + /** + * Kind of list this is, in this case adexchangeseller#metadata. + */ + kind: string; + } + export interface Schema$PreferredDeal { + /** + * The name of the advertiser this deal is for. + */ + advertiserName: string; + /** + * The name of the buyer network this deal is for. + */ + buyerNetworkName: string; + /** + * The currency code that applies to the fixed_cpm value. If not set then + * assumed to be USD. + */ + currencyCode: string; + /** + * Time when this deal stops being active in seconds since the epoch (GMT). + * If not set then this deal is valid until manually disabled by the + * publisher. + */ + endTime: string; + /** + * The fixed price for this preferred deal. In cpm micros of currency + * according to currencyCode. If set, then this preferred deal is eligible + * for the fixed price tier of buying (highest priority, pay exactly the + * configured fixed price). + */ + fixedCpm: string; + /** + * Unique identifier of this preferred deal. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#preferredDeal. + */ + kind: string; + /** + * Time when this deal becomes active in seconds since the epoch (GMT). If + * not set then this deal is active immediately upon creation. + */ + startTime: string; + } + export interface Schema$PreferredDeals { + /** + * The preferred deals returned in this list response. + */ + items: Schema$PreferredDeal[]; + /** + * Kind of list this is, in this case adexchangeseller#preferredDeals. + */ + kind: string; + } + export interface Schema$Report { + /** + * The averages of the report. This is the same length as any other row in + * the report; cells corresponding to dimension columns are empty. + */ + averages: string[]; + /** + * The header information of the columns requested in the report. This is a + * list of headers; one for each dimension in the request, followed by one + * for each metric in the request. + */ + headers: any[]; + /** + * Kind this is, in this case adexchangeseller#report. + */ + kind: string; + /** + * The output rows of the report. Each row is a list of cells; one for each + * dimension in the request, followed by one for each metric in the request. + * The dimension cells contain strings, and the metric cells contain + * numbers. + */ + rows: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be + * returned in the response due to being limited by the row count requested + * or the report row limit. + */ + totalMatchedRows: string; + /** + * The totals of the report. This is the same length as any other row in the + * report; cells corresponding to dimension columns are empty. + */ + totals: string[]; + /** + * Any warnings associated with generation of the report. + */ + warnings: string[]; + } + export interface Schema$ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is + * compatible with, for dimensions it is a list of compatibility groups the + * dimension belongs to. + */ + compatibleDimensions: string[]; + /** + * The names of the metrics the dimension or metric this reporting metadata + * entry describes is compatible with. + */ + compatibleMetrics: string[]; + /** + * Unique identifier of this reporting metadata entry, corresponding to the + * name of the appropriate dimension or metric. + */ + id: string; + /** + * Kind of resource this is, in this case + * adexchangeseller#reportingMetadataEntry. + */ + kind: string; + /** + * The names of the dimensions which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredDimensions: string[]; + /** + * The names of the metrics which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredMetrics: string[]; + /** + * The codes of the projects supported by the dimension or metric this + * reporting metadata entry describes. + */ + supportedProducts: string[]; + } + export interface Schema$SavedReport { + /** + * Unique identifier of this saved report. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#savedReport. + */ + kind: string; + /** + * This saved report's name. + */ + name: string; + } + export interface Schema$SavedReports { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The saved reports returned in this list response. + */ + items: Schema$SavedReport[]; + /** + * Kind of list this is, in this case adexchangeseller#savedReports. + */ + kind: string; + /** + * Continuation token used to page through saved reports. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$UrlChannel { + /** + * Unique identifier of this URL channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#urlChannel. + */ + kind: string; + /** + * URL Pattern of this URL channel. Does not include "http://" or + * "https://". Example: www.example.com/home + */ + urlPattern: string; + } + export interface Schema$UrlChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The URL channels returned in this list response. + */ + items: Schema$UrlChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#urlChannels. + */ + kind: string; + /** + * Continuation token used to page through URL channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } - - /** - * adexchangeseller.adunits.customchannels.list - * @desc List all custom channels which the specified ad unit belongs to. - * @alias adexchangeseller.adunits.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {string} params.adUnitId Ad unit for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Accounts { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/adunits/{adUnitId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + getRoot() { + return this.root; + } -export class Resource$Alerts { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangeseller.accounts.get + * @desc Get information about the selected Ad Exchange account. + * @alias adexchangeseller.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to get information about. Tip: 'myaccount' is a valid ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangeseller.alerts.list - * @desc List the alerts for this Ad Exchange account. - * @alias adexchangeseller.alerts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Adclients { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/alerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Customchannels { - root: Adexchangeseller; - adunits: Resource$Customchannels$Adunits; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.adunits = new Resource$Customchannels$Adunits(root); - } - getRoot() { - return this.root; + /** + * adexchangeseller.adclients.list + * @desc List all ad clients in this Ad Exchange account. + * @alias adexchangeseller.adclients.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangeseller.customchannels.get - * @desc Get the specified custom channel from the specified ad client. - * @alias adexchangeseller.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Adunits { + root: Adexchangeseller; + customchannels: Resource$Adunits$Customchannels; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.customchannels = new Resource$Adunits$Customchannels(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.adunits.get + * @desc Gets the specified ad unit in the specified ad client. + * @alias adexchangeseller.adunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to get the ad unit. + * @param {string} params.adUnitId Ad unit to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * adexchangeseller.customchannels.list - * @desc List all custom channels in the specified ad client for this Ad - * Exchange account. - * @alias adexchangeseller.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.adunits.list + * @desc List all ad units in the specified ad client for this Ad Exchange + * account. + * @alias adexchangeseller.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Adunits$Customchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Customchannels$Adunits { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + + /** + * adexchangeseller.adunits.customchannels.list + * @desc List all custom channels which the specified ad unit belongs to. + * @alias adexchangeseller.adunits.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {string} params.adUnitId Ad unit for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/adunits/{adUnitId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.customchannels.adunits.list - * @desc List all ad units in the specified custom channel. - * @alias adexchangeseller.customchannels.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Alerts { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels/{customChannelId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.alerts.list + * @desc List the alerts for this Ad Exchange account. + * @alias adexchangeseller.alerts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/alerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Customchannels { + root: Adexchangeseller; + adunits: Resource$Customchannels$Adunits; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.adunits = new Resource$Customchannels$Adunits(root); + } -export class Resource$Metadata { - root: Adexchangeseller; - dimensions: Resource$Metadata$Dimensions; - metrics: Resource$Metadata$Metrics; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.dimensions = new Resource$Metadata$Dimensions(root); - this.metrics = new Resource$Metadata$Metrics(root); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } -} -export class Resource$Metadata$Dimensions { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * adexchangeseller.customchannels.get + * @desc Get the specified custom channel from the specified ad client. + * @alias adexchangeseller.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * adexchangeseller.metadata.dimensions.list - * @desc List the metadata for the dimensions available to this AdExchange - * account. - * @alias adexchangeseller.metadata.dimensions.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.customchannels.list + * @desc List all custom channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Customchannels$Adunits { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/metadata/dimensions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Metadata$Metrics { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangeseller.customchannels.adunits.list + * @desc List all ad units in the specified custom channel. + * @alias adexchangeseller.customchannels.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/customchannels/{customChannelId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.metadata.metrics.list - * @desc List the metadata for the metrics available to this AdExchange - * account. - * @alias adexchangeseller.metadata.metrics.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Metadata { + root: Adexchangeseller; + dimensions: Resource$Metadata$Dimensions; + metrics: Resource$Metadata$Metrics; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.dimensions = new Resource$Metadata$Dimensions(root); + this.metrics = new Resource$Metadata$Metrics(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/metadata/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} + export class Resource$Metadata$Dimensions { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + } + getRoot() { + return this.root; + } -export class Resource$Preferreddeals { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexchangeseller.metadata.dimensions.list + * @desc List the metadata for the dimensions available to this AdExchange + * account. + * @alias adexchangeseller.metadata.dimensions.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/metadata/dimensions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangeseller.preferreddeals.get - * @desc Get information about the selected Ad Exchange Preferred Deal. - * @alias adexchangeseller.preferreddeals.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dealId Preferred deal to get information about. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Metadata$Metrics { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/preferreddeals/{dealId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['dealId'], - pathParams: ['dealId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.metadata.metrics.list + * @desc List the metadata for the metrics available to this AdExchange + * account. + * @alias adexchangeseller.metadata.metrics.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/metadata/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * adexchangeseller.preferreddeals.list - * @desc List the preferred deals for this Ad Exchange account. - * @alias adexchangeseller.preferreddeals.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Preferreddeals { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/preferreddeals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Reports { - root: Adexchangeseller; - saved: Resource$Reports$Saved; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.saved = new Resource$Reports$Saved(root); - } - getRoot() { - return this.root; - } + /** + * adexchangeseller.preferreddeals.get + * @desc Get information about the selected Ad Exchange Preferred Deal. + * @alias adexchangeseller.preferreddeals.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dealId Preferred deal to get information about. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/preferreddeals/{dealId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['dealId'], + pathParams: ['dealId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * adexchangeseller.reports.generate - * @desc Generate an Ad Exchange report based on the report request sent in - * the query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adexchangeseller.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['startDate', 'endDate'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangeseller.preferreddeals.list + * @desc List the preferred deals for this Ad Exchange account. + * @alias adexchangeseller.preferreddeals.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/preferreddeals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Reports$Saved { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * adexchangeseller.reports.saved.generate - * @desc Generate an Ad Exchange report based on the saved report ID sent in - * the query parameters. - * @alias adexchangeseller.reports.saved.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string} params.savedReportId The saved report to retrieve. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Reports { + root: Adexchangeseller; + saved: Resource$Reports$Saved; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.saved = new Resource$Reports$Saved(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/reports/{savedReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['savedReportId'], - pathParams: ['savedReportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangeseller.reports.saved.list - * @desc List all saved reports in this Ad Exchange account. - * @alias adexchangeseller.reports.saved.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.reports.generate + * @desc Generate an Ad Exchange report based on the report request sent in + * the query parameters. Returns the result as JSON; to retrieve output in + * CSV format specify "alt=csv" as a query parameter. + * @alias adexchangeseller.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['startDate', 'endDate'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Reports$Saved { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1.1/reports/saved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Urlchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } + /** + * adexchangeseller.reports.saved.generate + * @desc Generate an Ad Exchange report based on the saved report ID sent in + * the query parameters. + * @alias adexchangeseller.reports.saved.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string} params.savedReportId The saved report to retrieve. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/reports/{savedReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['savedReportId'], + pathParams: ['savedReportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - getRoot() { - return this.root; + + /** + * adexchangeseller.reports.saved.list + * @desc List all saved reports in this Ad Exchange account. + * @alias adexchangeseller.reports.saved.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1.1/reports/saved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.urlchannels.list - * @desc List all URL channels in the specified ad client for this Ad Exchange - * account. - * @alias adexchangeseller.urlchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Urlchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v1.1/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.urlchannels.list + * @desc List all URL channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v1.1/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexchangeseller/v1.ts b/src/apis/adexchangeseller/v1.ts index 12a56f7f5ab..06ed7345ffe 100644 --- a/src/apis/adexchangeseller/v1.ts +++ b/src/apis/adexchangeseller/v1.ts @@ -27,1013 +27,1029 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Seller API - * - * Accesses the inventory of Ad Exchange seller users and generates reports. - * - * @example - * const google = require('googleapis'); - * const adexchangeseller = google.adexchangeseller('v1'); - * - * @namespace adexchangeseller - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Adexchangeseller - */ -export class Adexchangeseller { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - adclients: Resource$Adclients; - adunits: Resource$Adunits; - customchannels: Resource$Customchannels; - reports: Resource$Reports; - urlchannels: Resource$Urlchannels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.adclients = new Resource$Adclients(this); - this.adunits = new Resource$Adunits(this); - this.customchannels = new Resource$Customchannels(this); - this.reports = new Resource$Reports(this); - this.urlchannels = new Resource$Urlchannels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$AdClient { - /** - * Whether this ad client is opted in to ARC. - */ - arcOptIn: boolean; - /** - * Unique identifier of this ad client. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#adClient. - */ - kind: string; - /** - * This ad client's product code, which corresponds to the PRODUCT_CODE - * report dimension. - */ - productCode: string; - /** - * Whether this ad client supports being reported on. - */ - supportsReporting: boolean; -} -export interface Schema$AdClients { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad clients returned in this list response. - */ - items: Schema$AdClient[]; - /** - * Kind of list this is, in this case adexchangeseller#adClients. - */ - kind: string; - /** - * Continuation token used to page through ad clients. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$AdUnit { - /** - * Identity code of this ad unit, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this ad unit. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#adUnit. - */ - kind: string; - /** - * Name of this ad unit. - */ - name: string; - /** - * Status of this ad unit. Possible values are: NEW: Indicates that the ad - * unit was created within the last seven days and does not yet have any - * activity associated with it. ACTIVE: Indicates that there has been - * activity on this ad unit in the last seven days. INACTIVE: Indicates that - * there has been no activity on this ad unit in the last seven days. - */ - status: string; -} -export interface Schema$AdUnits { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad units returned in this list response. - */ - items: Schema$AdUnit[]; - /** - * Kind of list this is, in this case adexchangeseller#adUnits. - */ - kind: string; - /** - * Continuation token used to page through ad units. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$CustomChannel { - /** - * Code of this custom channel, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this custom channel. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; +export namespace adexchangeseller_v1 { /** - * Kind of resource this is, in this case adexchangeseller#customChannel. - */ - kind: string; - /** - * Name of this custom channel. - */ - name: string; - /** - * The targeting information of this custom channel, if activated. - */ - targetingInfo: any; -} -export interface Schema$CustomChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The custom channels returned in this list response. - */ - items: Schema$CustomChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#customChannels. - */ - kind: string; - /** - * Continuation token used to page through custom channels. To retrieve the - * next page of results, set the next request's "pageToken" - * value to this. - */ - nextPageToken: string; -} -export interface Schema$Report { - /** - * The averages of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - averages: string[]; - /** - * The header information of the columns requested in the report. This is a - * list of headers; one for each dimension in the request, followed by one for - * each metric in the request. - */ - headers: any[]; - /** - * Kind this is, in this case adexchangeseller#report. - */ - kind: string; - /** - * The output rows of the report. Each row is a list of cells; one for each - * dimension in the request, followed by one for each metric in the request. - * The dimension cells contain strings, and the metric cells contain numbers. - */ - rows: string[][]; - /** - * The total number of rows matched by the report request. Fewer rows may be - * returned in the response due to being limited by the row count requested or - * the report row limit. - */ - totalMatchedRows: string; - /** - * The totals of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - totals: string[]; - /** - * Any warnings associated with generation of the report. - */ - warnings: string[]; -} -export interface Schema$SavedReport { - /** - * Unique identifier of this saved report. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#savedReport. - */ - kind: string; - /** - * This saved report's name. - */ - name: string; -} -export interface Schema$SavedReports { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The saved reports returned in this list response. - */ - items: Schema$SavedReport[]; - /** - * Kind of list this is, in this case adexchangeseller#savedReports. - */ - kind: string; - /** - * Continuation token used to page through saved reports. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$UrlChannel { - /** - * Unique identifier of this URL channel. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#urlChannel. - */ - kind: string; - /** - * URL Pattern of this URL channel. Does not include "http://" or - * "https://". Example: www.example.com/home - */ - urlPattern: string; -} -export interface Schema$UrlChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The URL channels returned in this list response. - */ - items: Schema$UrlChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#urlChannels. - */ - kind: string; - /** - * Continuation token used to page through URL channels. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. + * Ad Exchange Seller API + * + * Accesses the inventory of Ad Exchange seller users and generates reports. + * + * @example + * const google = require('googleapis'); + * const adexchangeseller = google.adexchangeseller('v1'); + * + * @namespace adexchangeseller + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Adexchangeseller */ - nextPageToken: string; -} + export class Adexchangeseller { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Adclients { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + adclients: Resource$Adclients; + adunits: Resource$Adunits; + customchannels: Resource$Customchannels; + reports: Resource$Reports; + urlchannels: Resource$Urlchannels; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * adexchangeseller.adclients.list - * @desc List all ad clients in this Ad Exchange account. - * @alias adexchangeseller.adclients.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.adclients = new Resource$Adclients(this); + this.adunits = new Resource$Adunits(this); + this.customchannels = new Resource$Customchannels(this); + this.reports = new Resource$Reports(this); + this.urlchannels = new Resource$Urlchannels(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Adunits { - root: Adexchangeseller; - customchannels: Resource$Adunits$Customchannels; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.customchannels = new Resource$Adunits$Customchannels(root); + export interface Schema$AdClient { + /** + * Whether this ad client is opted in to ARC. + */ + arcOptIn: boolean; + /** + * Unique identifier of this ad client. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#adClient. + */ + kind: string; + /** + * This ad client's product code, which corresponds to the PRODUCT_CODE + * report dimension. + */ + productCode: string; + /** + * Whether this ad client supports being reported on. + */ + supportsReporting: boolean; } - - getRoot() { - return this.root; + export interface Schema$AdClients { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad clients returned in this list response. + */ + items: Schema$AdClient[]; + /** + * Kind of list this is, in this case adexchangeseller#adClients. + */ + kind: string; + /** + * Continuation token used to page through ad clients. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - - /** - * adexchangeseller.adunits.get - * @desc Gets the specified ad unit in the specified ad client. - * @alias adexchangeseller.adunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to get the ad unit. - * @param {string} params.adUnitId Ad unit to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdUnit { + /** + * Identity code of this ad unit, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this ad unit. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#adUnit. + */ + kind: string; + /** + * Name of this ad unit. + */ + name: string; + /** + * Status of this ad unit. Possible values are: NEW: Indicates that the ad + * unit was created within the last seven days and does not yet have any + * activity associated with it. ACTIVE: Indicates that there has been + * activity on this ad unit in the last seven days. INACTIVE: Indicates + * that there has been no activity on this ad unit in the last seven days. + */ + status: string; } - - - /** - * adexchangeseller.adunits.list - * @desc List all ad units in the specified ad client for this Ad Exchange - * account. - * @alias adexchangeseller.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdUnits { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad units returned in this list response. + */ + items: Schema$AdUnit[]; + /** + * Kind of list this is, in this case adexchangeseller#adUnits. + */ + kind: string; + /** + * Continuation token used to page through ad units. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } -} -export class Resource$Adunits$Customchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CustomChannel { + /** + * Code of this custom channel, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this custom channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#customChannel. + */ + kind: string; + /** + * Name of this custom channel. + */ + name: string; + /** + * The targeting information of this custom channel, if activated. + */ + targetingInfo: any; } - - getRoot() { - return this.root; + export interface Schema$CustomChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The custom channels returned in this list response. + */ + items: Schema$CustomChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#customChannels. + */ + kind: string; + /** + * Continuation token used to page through custom channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$Report { + /** + * The averages of the report. This is the same length as any other row in + * the report; cells corresponding to dimension columns are empty. + */ + averages: string[]; + /** + * The header information of the columns requested in the report. This is a + * list of headers; one for each dimension in the request, followed by one + * for each metric in the request. + */ + headers: any[]; + /** + * Kind this is, in this case adexchangeseller#report. + */ + kind: string; + /** + * The output rows of the report. Each row is a list of cells; one for each + * dimension in the request, followed by one for each metric in the request. + * The dimension cells contain strings, and the metric cells contain + * numbers. + */ + rows: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be + * returned in the response due to being limited by the row count requested + * or the report row limit. + */ + totalMatchedRows: string; + /** + * The totals of the report. This is the same length as any other row in the + * report; cells corresponding to dimension columns are empty. + */ + totals: string[]; + /** + * Any warnings associated with generation of the report. + */ + warnings: string[]; + } + export interface Schema$SavedReport { + /** + * Unique identifier of this saved report. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#savedReport. + */ + kind: string; + /** + * This saved report's name. + */ + name: string; + } + export interface Schema$SavedReports { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The saved reports returned in this list response. + */ + items: Schema$SavedReport[]; + /** + * Kind of list this is, in this case adexchangeseller#savedReports. + */ + kind: string; + /** + * Continuation token used to page through saved reports. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$UrlChannel { + /** + * Unique identifier of this URL channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#urlChannel. + */ + kind: string; + /** + * URL Pattern of this URL channel. Does not include "http://" or + * "https://". Example: www.example.com/home + */ + urlPattern: string; + } + export interface Schema$UrlChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The URL channels returned in this list response. + */ + items: Schema$UrlChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#urlChannels. + */ + kind: string; + /** + * Continuation token used to page through URL channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } - - /** - * adexchangeseller.adunits.customchannels.list - * @desc List all custom channels which the specified ad unit belongs to. - * @alias adexchangeseller.adunits.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {string} params.adUnitId Ad unit for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Adclients { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/adunits/{adUnitId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + getRoot() { + return this.root; + } -export class Resource$Customchannels { - root: Adexchangeseller; - adunits: Resource$Customchannels$Adunits; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.adunits = new Resource$Customchannels$Adunits(root); - } - getRoot() { - return this.root; + /** + * adexchangeseller.adclients.list + * @desc List all ad clients in this Ad Exchange account. + * @alias adexchangeseller.adclients.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexchangeseller.customchannels.get - * @desc Get the specified custom channel from the specified ad client. - * @alias adexchangeseller.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Adunits { + root: Adexchangeseller; + customchannels: Resource$Adunits$Customchannels; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.customchannels = new Resource$Adunits$Customchannels(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.adunits.get + * @desc Gets the specified ad unit in the specified ad client. + * @alias adexchangeseller.adunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to get the ad unit. + * @param {string} params.adUnitId Ad unit to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * adexchangeseller.customchannels.list - * @desc List all custom channels in the specified ad client for this Ad - * Exchange account. - * @alias adexchangeseller.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.adunits.list + * @desc List all ad units in the specified ad client for this Ad Exchange + * account. + * @alias adexchangeseller.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Adunits$Customchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Customchannels$Adunits { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + + /** + * adexchangeseller.adunits.customchannels.list + * @desc List all custom channels which the specified ad unit belongs to. + * @alias adexchangeseller.adunits.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {string} params.adUnitId Ad unit for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/adunits/{adUnitId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.customchannels.adunits.list - * @desc List all ad units in the specified custom channel. - * @alias adexchangeseller.customchannels.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Customchannels { + root: Adexchangeseller; + adunits: Resource$Customchannels$Adunits; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.adunits = new Resource$Customchannels$Adunits(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/customchannels/{customChannelId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + getRoot() { + return this.root; + } -export class Resource$Reports { - root: Adexchangeseller; - saved: Resource$Reports$Saved; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.saved = new Resource$Reports$Saved(root); - } - getRoot() { - return this.root; - } + /** + * adexchangeseller.customchannels.get + * @desc Get the specified custom channel from the specified ad client. + * @alias adexchangeseller.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * adexchangeseller.reports.generate - * @desc Generate an Ad Exchange report based on the report request sent in - * the query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adexchangeseller.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.customchannels.list + * @desc List all custom channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Customchannels$Adunits { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['startDate', 'endDate'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Reports$Saved { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + + /** + * adexchangeseller.customchannels.adunits.list + * @desc List all ad units in the specified custom channel. + * @alias adexchangeseller.customchannels.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/customchannels/{customChannelId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.reports.saved.generate - * @desc Generate an Ad Exchange report based on the saved report ID sent in - * the query parameters. - * @alias adexchangeseller.reports.saved.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string} params.savedReportId The saved report to retrieve. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Reports { + root: Adexchangeseller; + saved: Resource$Reports$Saved; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.saved = new Resource$Reports$Saved(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1/reports/{savedReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['savedReportId'], - pathParams: ['savedReportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangeseller.reports.saved.list - * @desc List all saved reports in this Ad Exchange account. - * @alias adexchangeseller.reports.saved.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.reports.generate + * @desc Generate an Ad Exchange report based on the report request sent in + * the query parameters. Returns the result as JSON; to retrieve output in + * CSV format specify "alt=csv" as a query parameter. + * @alias adexchangeseller.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['startDate', 'endDate'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Reports$Saved { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v1/reports/saved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Urlchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } + /** + * adexchangeseller.reports.saved.generate + * @desc Generate an Ad Exchange report based on the saved report ID sent in + * the query parameters. + * @alias adexchangeseller.reports.saved.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string} params.savedReportId The saved report to retrieve. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1/reports/{savedReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['savedReportId'], + pathParams: ['savedReportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + - getRoot() { - return this.root; + /** + * adexchangeseller.reports.saved.list + * @desc List all saved reports in this Ad Exchange account. + * @alias adexchangeseller.reports.saved.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v1/reports/saved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.urlchannels.list - * @desc List all URL channels in the specified ad client for this Ad Exchange - * account. - * @alias adexchangeseller.urlchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Urlchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v1/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.urlchannels.list + * @desc List all URL channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v1/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexchangeseller/v2.0.ts b/src/apis/adexchangeseller/v2.0.ts index 1bd186551b0..683cbc3abbd 100644 --- a/src/apis/adexchangeseller/v2.0.ts +++ b/src/apis/adexchangeseller/v2.0.ts @@ -27,1341 +27,1358 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Exchange Seller API - * - * Accesses the inventory of Ad Exchange seller users and generates reports. - * - * @example - * const google = require('googleapis'); - * const adexchangeseller = google.adexchangeseller('v2.0'); - * - * @namespace adexchangeseller - * @type {Function} - * @version v2.0 - * @variation v2.0 - * @param {object=} options Options for Adexchangeseller - */ -export class Adexchangeseller { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace adexchangeseller_v2_0 { + /** + * Ad Exchange Seller API + * + * Accesses the inventory of Ad Exchange seller users and generates reports. + * + * @example + * const google = require('googleapis'); + * const adexchangeseller = google.adexchangeseller('v2.0'); + * + * @namespace adexchangeseller + * @type {Function} + * @version v2.0 + * @variation v2.0 + * @param {object=} options Options for Adexchangeseller + */ + export class Adexchangeseller { + _options: GlobalOptions; + google: GoogleApis; + root = this; - accounts: Resource$Accounts; + accounts: Resource$Accounts; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.accounts = new Resource$Accounts(this); - } + this.accounts = new Resource$Accounts(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$Account { - /** - * Unique identifier of this account. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#account. - */ - kind: string; - /** - * Name of this account. - */ - name: string; -} -export interface Schema$Accounts { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The accounts returned in this list response. - */ - items: Schema$Account[]; - /** - * Kind of list this is, in this case adexchangeseller#accounts. - */ - kind: string; - /** - * Continuation token used to page through accounts. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$AdClient { - /** - * Whether this ad client is opted in to ARC. - */ - arcOptIn: boolean; - /** - * Unique identifier of this ad client. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#adClient. - */ - kind: string; - /** - * This ad client's product code, which corresponds to the PRODUCT_CODE - * report dimension. - */ - productCode: string; - /** - * Whether this ad client supports being reported on. - */ - supportsReporting: boolean; -} -export interface Schema$AdClients { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad clients returned in this list response. - */ - items: Schema$AdClient[]; - /** - * Kind of list this is, in this case adexchangeseller#adClients. - */ - kind: string; - /** - * Continuation token used to page through ad clients. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$Alert { - /** - * Unique identifier of this alert. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#alert. - */ - kind: string; - /** - * The localized alert message. - */ - message: string; - /** - * Severity of this alert. Possible values: INFO, WARNING, SEVERE. - */ - severity: string; - /** - * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, - * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, - * GRAYLISTED_PUBLISHER, API_HOLD. - */ - type: string; -} -export interface Schema$Alerts { - /** - * The alerts returned in this list response. - */ - items: Schema$Alert[]; - /** - * Kind of list this is, in this case adexchangeseller#alerts. - */ - kind: string; -} -export interface Schema$CustomChannel { - /** - * Code of this custom channel, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this custom channel. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#customChannel. - */ - kind: string; - /** - * Name of this custom channel. - */ - name: string; - /** - * The targeting information of this custom channel, if activated. - */ - targetingInfo: any; -} -export interface Schema$CustomChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The custom channels returned in this list response. - */ - items: Schema$CustomChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#customChannels. - */ - kind: string; - /** - * Continuation token used to page through custom channels. To retrieve the - * next page of results, set the next request's "pageToken" - * value to this. - */ - nextPageToken: string; -} -export interface Schema$Metadata { - items: Schema$ReportingMetadataEntry[]; - /** - * Kind of list this is, in this case adexchangeseller#metadata. - */ - kind: string; -} -export interface Schema$PreferredDeal { - /** - * The name of the advertiser this deal is for. - */ - advertiserName: string; - /** - * The name of the buyer network this deal is for. - */ - buyerNetworkName: string; - /** - * The currency code that applies to the fixed_cpm value. If not set then - * assumed to be USD. - */ - currencyCode: string; - /** - * Time when this deal stops being active in seconds since the epoch (GMT). If - * not set then this deal is valid until manually disabled by the publisher. - */ - endTime: string; - /** - * The fixed price for this preferred deal. In cpm micros of currency - * according to currencyCode. If set, then this preferred deal is eligible for - * the fixed price tier of buying (highest priority, pay exactly the - * configured fixed price). - */ - fixedCpm: string; - /** - * Unique identifier of this preferred deal. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#preferredDeal. - */ - kind: string; - /** - * Time when this deal becomes active in seconds since the epoch (GMT). If not - * set then this deal is active immediately upon creation. - */ - startTime: string; -} -export interface Schema$PreferredDeals { - /** - * The preferred deals returned in this list response. - */ - items: Schema$PreferredDeal[]; - /** - * Kind of list this is, in this case adexchangeseller#preferredDeals. - */ - kind: string; -} -export interface Schema$Report { - /** - * The averages of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - averages: string[]; - /** - * The header information of the columns requested in the report. This is a - * list of headers; one for each dimension in the request, followed by one for - * each metric in the request. - */ - headers: any[]; - /** - * Kind this is, in this case adexchangeseller#report. - */ - kind: string; - /** - * The output rows of the report. Each row is a list of cells; one for each - * dimension in the request, followed by one for each metric in the request. - * The dimension cells contain strings, and the metric cells contain numbers. - */ - rows: string[][]; - /** - * The total number of rows matched by the report request. Fewer rows may be - * returned in the response due to being limited by the row count requested or - * the report row limit. - */ - totalMatchedRows: string; - /** - * The totals of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - totals: string[]; - /** - * Any warnings associated with generation of the report. - */ - warnings: string[]; -} -export interface Schema$ReportingMetadataEntry { - /** - * For metrics this is a list of dimension IDs which the metric is compatible - * with, for dimensions it is a list of compatibility groups the dimension - * belongs to. - */ - compatibleDimensions: string[]; - /** - * The names of the metrics the dimension or metric this reporting metadata - * entry describes is compatible with. - */ - compatibleMetrics: string[]; - /** - * Unique identifier of this reporting metadata entry, corresponding to the - * name of the appropriate dimension or metric. - */ - id: string; - /** - * Kind of resource this is, in this case - * adexchangeseller#reportingMetadataEntry. - */ - kind: string; - /** - * The names of the dimensions which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredDimensions: string[]; - /** - * The names of the metrics which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredMetrics: string[]; - /** - * The codes of the projects supported by the dimension or metric this - * reporting metadata entry describes. - */ - supportedProducts: string[]; -} -export interface Schema$SavedReport { - /** - * Unique identifier of this saved report. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#savedReport. - */ - kind: string; - /** - * This saved report's name. - */ - name: string; -} -export interface Schema$SavedReports { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The saved reports returned in this list response. - */ - items: Schema$SavedReport[]; - /** - * Kind of list this is, in this case adexchangeseller#savedReports. - */ - kind: string; - /** - * Continuation token used to page through saved reports. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$UrlChannel { - /** - * Unique identifier of this URL channel. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adexchangeseller#urlChannel. - */ - kind: string; - /** - * URL Pattern of this URL channel. Does not include "http://" or - * "https://". Example: www.example.com/home - */ - urlPattern: string; -} -export interface Schema$UrlChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The URL channels returned in this list response. - */ - items: Schema$UrlChannel[]; - /** - * Kind of list this is, in this case adexchangeseller#urlChannels. - */ - kind: string; - /** - * Continuation token used to page through URL channels. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export class Resource$Accounts { - root: Adexchangeseller; - adclients: Resource$Accounts$Adclients; - alerts: Resource$Accounts$Alerts; - customchannels: Resource$Accounts$Customchannels; - metadata: Resource$Accounts$Metadata; - preferreddeals: Resource$Accounts$Preferreddeals; - reports: Resource$Accounts$Reports; - urlchannels: Resource$Accounts$Urlchannels; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.adclients = new Resource$Accounts$Adclients(root); - this.alerts = new Resource$Accounts$Alerts(root); - this.customchannels = new Resource$Accounts$Customchannels(root); - this.metadata = new Resource$Accounts$Metadata(root); - this.preferreddeals = new Resource$Accounts$Preferreddeals(root); - this.reports = new Resource$Accounts$Reports(root); - this.urlchannels = new Resource$Accounts$Urlchannels(root); + export interface Schema$Account { + /** + * Unique identifier of this account. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#account. + */ + kind: string; + /** + * Name of this account. + */ + name: string; } - - getRoot() { - return this.root; + export interface Schema$Accounts { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The accounts returned in this list response. + */ + items: Schema$Account[]; + /** + * Kind of list this is, in this case adexchangeseller#accounts. + */ + kind: string; + /** + * Continuation token used to page through accounts. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - - /** - * adexchangeseller.accounts.get - * @desc Get information about the selected Ad Exchange account. - * @alias adexchangeseller.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to get information about. Tip: 'myaccount' is a valid ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v2.0/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdClient { + /** + * Whether this ad client is opted in to ARC. + */ + arcOptIn: boolean; + /** + * Unique identifier of this ad client. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#adClient. + */ + kind: string; + /** + * This ad client's product code, which corresponds to the PRODUCT_CODE + * report dimension. + */ + productCode: string; + /** + * Whether this ad client supports being reported on. + */ + supportsReporting: boolean; } - - - /** - * adexchangeseller.accounts.list - * @desc List all accounts available to this Ad Exchange account. - * @alias adexchangeseller.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of accounts to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adexchangeseller/v2.0/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdClients { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad clients returned in this list response. + */ + items: Schema$AdClient[]; + /** + * Kind of list this is, in this case adexchangeseller#adClients. + */ + kind: string; + /** + * Continuation token used to page through ad clients. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } -} -export class Resource$Accounts$Adclients { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Alert { + /** + * Unique identifier of this alert. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#alert. + */ + kind: string; + /** + * The localized alert message. + */ + message: string; + /** + * Severity of this alert. Possible values: INFO, WARNING, SEVERE. + */ + severity: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, + * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type: string; } - - getRoot() { - return this.root; + export interface Schema$Alerts { + /** + * The alerts returned in this list response. + */ + items: Schema$Alert[]; + /** + * Kind of list this is, in this case adexchangeseller#alerts. + */ + kind: string; } - - - /** - * adexchangeseller.accounts.adclients.list - * @desc List all ad clients in this Ad Exchange account. - * @alias adexchangeseller.accounts.adclients.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CustomChannel { + /** + * Code of this custom channel, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this custom channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#customChannel. + */ + kind: string; + /** + * Name of this custom channel. + */ + name: string; + /** + * The targeting information of this custom channel, if activated. + */ + targetingInfo: any; } -} - -export class Resource$Accounts$Alerts { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CustomChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The custom channels returned in this list response. + */ + items: Schema$CustomChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#customChannels. + */ + kind: string; + /** + * Continuation token used to page through custom channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$Metadata { + items: Schema$ReportingMetadataEntry[]; + /** + * Kind of list this is, in this case adexchangeseller#metadata. + */ + kind: string; } - - - /** - * adexchangeseller.accounts.alerts.list - * @desc List the alerts for this Ad Exchange account. - * @alias adexchangeseller.accounts.alerts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account owning the alerts. - * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/adexchangeseller/v2.0/accounts/{accountId}/alerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PreferredDeal { + /** + * The name of the advertiser this deal is for. + */ + advertiserName: string; + /** + * The name of the buyer network this deal is for. + */ + buyerNetworkName: string; + /** + * The currency code that applies to the fixed_cpm value. If not set then + * assumed to be USD. + */ + currencyCode: string; + /** + * Time when this deal stops being active in seconds since the epoch (GMT). + * If not set then this deal is valid until manually disabled by the + * publisher. + */ + endTime: string; + /** + * The fixed price for this preferred deal. In cpm micros of currency + * according to currencyCode. If set, then this preferred deal is eligible + * for the fixed price tier of buying (highest priority, pay exactly the + * configured fixed price). + */ + fixedCpm: string; + /** + * Unique identifier of this preferred deal. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#preferredDeal. + */ + kind: string; + /** + * Time when this deal becomes active in seconds since the epoch (GMT). If + * not set then this deal is active immediately upon creation. + */ + startTime: string; } -} - -export class Resource$Accounts$Customchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$PreferredDeals { + /** + * The preferred deals returned in this list response. + */ + items: Schema$PreferredDeal[]; + /** + * Kind of list this is, in this case adexchangeseller#preferredDeals. + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$Report { + /** + * The averages of the report. This is the same length as any other row in + * the report; cells corresponding to dimension columns are empty. + */ + averages: string[]; + /** + * The header information of the columns requested in the report. This is a + * list of headers; one for each dimension in the request, followed by one + * for each metric in the request. + */ + headers: any[]; + /** + * Kind this is, in this case adexchangeseller#report. + */ + kind: string; + /** + * The output rows of the report. Each row is a list of cells; one for each + * dimension in the request, followed by one for each metric in the request. + * The dimension cells contain strings, and the metric cells contain + * numbers. + */ + rows: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be + * returned in the response due to being limited by the row count requested + * or the report row limit. + */ + totalMatchedRows: string; + /** + * The totals of the report. This is the same length as any other row in the + * report; cells corresponding to dimension columns are empty. + */ + totals: string[]; + /** + * Any warnings associated with generation of the report. + */ + warnings: string[]; + } + export interface Schema$ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is + * compatible with, for dimensions it is a list of compatibility groups the + * dimension belongs to. + */ + compatibleDimensions: string[]; + /** + * The names of the metrics the dimension or metric this reporting metadata + * entry describes is compatible with. + */ + compatibleMetrics: string[]; + /** + * Unique identifier of this reporting metadata entry, corresponding to the + * name of the appropriate dimension or metric. + */ + id: string; + /** + * Kind of resource this is, in this case + * adexchangeseller#reportingMetadataEntry. + */ + kind: string; + /** + * The names of the dimensions which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredDimensions: string[]; + /** + * The names of the metrics which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredMetrics: string[]; + /** + * The codes of the projects supported by the dimension or metric this + * reporting metadata entry describes. + */ + supportedProducts: string[]; + } + export interface Schema$SavedReport { + /** + * Unique identifier of this saved report. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#savedReport. + */ + kind: string; + /** + * This saved report's name. + */ + name: string; + } + export interface Schema$SavedReports { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The saved reports returned in this list response. + */ + items: Schema$SavedReport[]; + /** + * Kind of list this is, in this case adexchangeseller#savedReports. + */ + kind: string; + /** + * Continuation token used to page through saved reports. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$UrlChannel { + /** + * Unique identifier of this URL channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adexchangeseller#urlChannel. + */ + kind: string; + /** + * URL Pattern of this URL channel. Does not include "http://" or + * "https://". Example: www.example.com/home + */ + urlPattern: string; + } + export interface Schema$UrlChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The URL channels returned in this list response. + */ + items: Schema$UrlChannel[]; + /** + * Kind of list this is, in this case adexchangeseller#urlChannels. + */ + kind: string; + /** + * Continuation token used to page through URL channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } - - /** - * adexchangeseller.accounts.customchannels.get - * @desc Get the specified custom channel from the specified ad client. - * @alias adexchangeseller.accounts.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Accounts { + root: Adexchangeseller; + adclients: Resource$Accounts$Adclients; + alerts: Resource$Accounts$Alerts; + customchannels: Resource$Accounts$Customchannels; + metadata: Resource$Accounts$Metadata; + preferreddeals: Resource$Accounts$Preferreddeals; + reports: Resource$Accounts$Reports; + urlchannels: Resource$Accounts$Urlchannels; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.adclients = new Resource$Accounts$Adclients(root); + this.alerts = new Resource$Accounts$Alerts(root); + this.customchannels = new Resource$Accounts$Customchannels(root); + this.metadata = new Resource$Accounts$Metadata(root); + this.preferreddeals = new Resource$Accounts$Preferreddeals(root); + this.reports = new Resource$Accounts$Reports(root); + this.urlchannels = new Resource$Accounts$Urlchannels(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'customChannelId'], - pathParams: ['accountId', 'adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangeseller.accounts.customchannels.list - * @desc List all custom channels in the specified ad client for this Ad - * Exchange account. - * @alias adexchangeseller.accounts.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * adexchangeseller.accounts.get + * @desc Get information about the selected Ad Exchange account. + * @alias adexchangeseller.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to get information about. Tip: 'myaccount' is a valid ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v2.0/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Metadata { - root: Adexchangeseller; - dimensions: Resource$Accounts$Metadata$Dimensions; - metrics: Resource$Accounts$Metadata$Metrics; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.dimensions = new Resource$Accounts$Metadata$Dimensions(root); - this.metrics = new Resource$Accounts$Metadata$Metrics(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Accounts$Metadata$Dimensions { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); + /** + * adexchangeseller.accounts.list + * @desc List all accounts available to this Ad Exchange account. + * @alias adexchangeseller.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of accounts to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adexchangeseller/v2.0/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Accounts$Adclients { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * adexchangeseller.accounts.metadata.dimensions.list - * @desc List the metadata for the dimensions available to this AdExchange - * account. - * @alias adexchangeseller.accounts.metadata.dimensions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account with visibility to the dimensions. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/metadata/dimensions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * adexchangeseller.accounts.adclients.list + * @desc List all ad clients in this Ad Exchange account. + * @alias adexchangeseller.accounts.adclients.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Accounts$Metadata$Metrics { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Accounts$Alerts { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * adexchangeseller.accounts.metadata.metrics.list - * @desc List the metadata for the metrics available to this AdExchange - * account. - * @alias adexchangeseller.accounts.metadata.metrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account with visibility to the metrics. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.accounts.alerts.list + * @desc List the alerts for this Ad Exchange account. + * @alias adexchangeseller.accounts.alerts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account owning the alerts. + * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/alerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Accounts$Customchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/metadata/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Accounts$Preferreddeals { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } + /** + * adexchangeseller.accounts.customchannels.get + * @desc Get the specified custom channel from the specified ad client. + * @alias adexchangeseller.accounts.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'customChannelId'], + pathParams: ['accountId', 'adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + - getRoot() { - return this.root; + /** + * adexchangeseller.accounts.customchannels.list + * @desc List all custom channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.accounts.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Accounts$Metadata { + root: Adexchangeseller; + dimensions: Resource$Accounts$Metadata$Dimensions; + metrics: Resource$Accounts$Metadata$Metrics; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.dimensions = new Resource$Accounts$Metadata$Dimensions(root); + this.metrics = new Resource$Accounts$Metadata$Metrics(root); + } - /** - * adexchangeseller.accounts.preferreddeals.get - * @desc Get information about the selected Ad Exchange Preferred Deal. - * @alias adexchangeseller.accounts.preferreddeals.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account owning the deal. - * @param {string} params.dealId Preferred deal to get information about. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Accounts$Metadata$Dimensions { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/preferreddeals/{dealId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'dealId'], - pathParams: ['accountId', 'dealId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangeseller.accounts.preferreddeals.list - * @desc List the preferred deals for this Ad Exchange account. - * @alias adexchangeseller.accounts.preferreddeals.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account owning the deals. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.accounts.metadata.dimensions.list + * @desc List the metadata for the dimensions available to this AdExchange + * account. + * @alias adexchangeseller.accounts.metadata.dimensions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account with visibility to the dimensions. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/metadata/dimensions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Accounts$Metadata$Metrics { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/preferreddeals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Accounts$Reports { - root: Adexchangeseller; - saved: Resource$Accounts$Reports$Saved; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - this.saved = new Resource$Accounts$Reports$Saved(root); - } - getRoot() { - return this.root; + /** + * adexchangeseller.accounts.metadata.metrics.list + * @desc List the metadata for the metrics available to this AdExchange + * account. + * @alias adexchangeseller.accounts.metadata.metrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account with visibility to the metrics. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/metadata/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.accounts.reports.generate - * @desc Generate an Ad Exchange report based on the report request sent in - * the query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adexchangeseller.accounts.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which owns the generated report. - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Accounts$Preferreddeals { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'startDate', 'endDate'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Accounts$Reports$Saved { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * adexchangeseller.accounts.preferreddeals.get + * @desc Get information about the selected Ad Exchange Preferred Deal. + * @alias adexchangeseller.accounts.preferreddeals.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account owning the deal. + * @param {string} params.dealId Preferred deal to get information about. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/preferreddeals/{dealId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'dealId'], + pathParams: ['accountId', 'dealId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * adexchangeseller.accounts.reports.saved.generate - * @desc Generate an Ad Exchange report based on the saved report ID sent in - * the query parameters. - * @alias adexchangeseller.accounts.reports.saved.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account owning the saved report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string} params.savedReportId The saved report to retrieve. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + + /** + * adexchangeseller.accounts.preferreddeals.list + * @desc List the preferred deals for this Ad Exchange account. + * @alias adexchangeseller.accounts.preferreddeals.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account owning the deals. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/preferreddeals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Accounts$Reports { + root: Adexchangeseller; + saved: Resource$Accounts$Reports$Saved; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); + this.saved = new Resource$Accounts$Reports$Saved(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/reports/{savedReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'savedReportId'], - pathParams: ['accountId', 'savedReportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * adexchangeseller.accounts.reports.saved.list - * @desc List all saved reports in this Ad Exchange account. - * @alias adexchangeseller.accounts.reports.saved.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account owning the saved reports. - * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * adexchangeseller.accounts.reports.generate + * @desc Generate an Ad Exchange report based on the report request sent in + * the query parameters. Returns the result as JSON; to retrieve output in + * CSV format specify "alt=csv" as a query parameter. + * @alias adexchangeseller.accounts.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which owns the generated report. + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'startDate', 'endDate'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Accounts$Reports$Saved { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/reports/saved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Accounts$Urlchannels { - root: Adexchangeseller; - constructor(root: Adexchangeseller) { - this.root = root; - this.getRoot.bind(this); - } + /** + * adexchangeseller.accounts.reports.saved.generate + * @desc Generate an Ad Exchange report based on the saved report ID sent in + * the query parameters. + * @alias adexchangeseller.accounts.reports.saved.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account owning the saved report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string} params.savedReportId The saved report to retrieve. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/reports/{savedReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'savedReportId'], + pathParams: ['accountId', 'savedReportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + - getRoot() { - return this.root; + /** + * adexchangeseller.accounts.reports.saved.list + * @desc List all saved reports in this Ad Exchange account. + * @alias adexchangeseller.accounts.reports.saved.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account owning the saved reports. + * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/reports/saved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * adexchangeseller.accounts.urlchannels.list - * @desc List all URL channels in the specified ad client for this Ad Exchange - * account. - * @alias adexchangeseller.accounts.urlchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts$Urlchannels { + root: Adexchangeseller; + constructor(root: Adexchangeseller) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexchangeseller.accounts.urlchannels.list + * @desc List all URL channels in the specified ad client for this Ad + * Exchange account. + * @alias adexchangeseller.accounts.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adexchangeseller/v2.0/accounts/{accountId}/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adexperiencereport/v1.ts b/src/apis/adexperiencereport/v1.ts index 6d048b839a2..8933618a925 100644 --- a/src/apis/adexperiencereport/v1.ts +++ b/src/apis/adexperiencereport/v1.ts @@ -27,234 +27,240 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Ad Experience Report API - * - * View Ad Experience Report data, and get a list of sites that have a - * significant number of annoying ads. - * - * @example - * const google = require('googleapis'); - * const adexperiencereport = google.adexperiencereport('v1'); - * - * @namespace adexperiencereport - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Adexperiencereport - */ -export class Adexperiencereport { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace adexperiencereport_v1 { + /** + * Ad Experience Report API + * + * View Ad Experience Report data, and get a list of sites that have a + * significant number of annoying ads. + * + * @example + * const google = require('googleapis'); + * const adexperiencereport = google.adexperiencereport('v1'); + * + * @namespace adexperiencereport + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Adexperiencereport + */ + export class Adexperiencereport { + _options: GlobalOptions; + google: GoogleApis; + root = this; - sites: Resource$Sites; - violatingSites: Resource$Violatingsites; + sites: Resource$Sites; + violatingSites: Resource$Violatingsites; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.sites = new Resource$Sites(this); - this.violatingSites = new Resource$Violatingsites(this); - } + this.sites = new Resource$Sites(this); + this.violatingSites = new Resource$Violatingsites(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Summary of the ad experience rating of a site for a specific platform. - */ -export interface Schema$PlatformSummary { /** - * The status of the site reviewed for the Better Ads Standards. + * Summary of the ad experience rating of a site for a specific platform. */ - betterAdsStatus: string; - /** - * The date on which ad filtering begins. - */ - enforcementTime: string; - /** - * The ad filtering status of the site. - */ - filterStatus: string; - /** - * The last time that the site changed status. - */ - lastChangeTime: string; - /** - * The assigned regions for the site and platform. - */ - region: string[]; - /** - * A link that leads to a full ad experience report. - */ - reportUrl: string; - /** - * Whether the site is currently under review. - */ - underReview: boolean; -} -/** - * Response message for GetSiteSummary. Do not confuse with same message in - * google.chrome.abusiveexperiencereport.v1 - */ -export interface Schema$SiteSummaryResponse { - /** - * Summary for the desktop review of the site. - */ - desktopSummary: Schema$PlatformSummary; - /** - * Summary for the mobile review of the site. - */ - mobileSummary: Schema$PlatformSummary; + export interface Schema$PlatformSummary { + /** + * The status of the site reviewed for the Better Ads Standards. + */ + betterAdsStatus: string; + /** + * The date on which ad filtering begins. + */ + enforcementTime: string; + /** + * The ad filtering status of the site. + */ + filterStatus: string; + /** + * The last time that the site changed status. + */ + lastChangeTime: string; + /** + * The assigned regions for the site and platform. + */ + region: string[]; + /** + * A link that leads to a full ad experience report. + */ + reportUrl: string; + /** + * Whether the site is currently under review. + */ + underReview: boolean; + } /** - * The name of the site reviewed. + * Response message for GetSiteSummary. Do not confuse with same message in + * google.chrome.abusiveexperiencereport.v1 */ - reviewedSite: string; -} -/** - * Response message for ListViolatingSites. - */ -export interface Schema$ViolatingSitesResponse { + export interface Schema$SiteSummaryResponse { + /** + * Summary for the desktop review of the site. + */ + desktopSummary: Schema$PlatformSummary; + /** + * Summary for the mobile review of the site. + */ + mobileSummary: Schema$PlatformSummary; + /** + * The name of the site reviewed. + */ + reviewedSite: string; + } /** - * A list of summaries of violating sites. + * Response message for ListViolatingSites. */ - violatingSites: Schema$SiteSummaryResponse[]; -} - -export class Resource$Sites { - root: Adexperiencereport; - constructor(root: Adexperiencereport) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ViolatingSitesResponse { + /** + * A list of summaries of violating sites. + */ + violatingSites: Schema$SiteSummaryResponse[]; } - getRoot() { - return this.root; - } - - - /** - * adexperiencereport.sites.get - * @desc Gets a summary of the ad experience rating of a site. - * @alias adexperiencereport.sites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The required site name. It should be the site property whose ad experiences may have been reviewed, and it should be URL-encoded. For example, sites/https%3A%2F%2Fwww.google.com. The server will return an error of BAD_REQUEST if this field is not filled in. Note that if the site property is not yet verified in Search Console, the reportUrl field returned by the API will lead to the verification page, prompting the user to go through that process before they can gain access to the Ad Experience Report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Sites { + root: Adexperiencereport; + constructor(root: Adexperiencereport) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexperiencereport.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Violatingsites { - root: Adexperiencereport; - constructor(root: Adexperiencereport) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * adexperiencereport.sites.get + * @desc Gets a summary of the ad experience rating of a site. + * @alias adexperiencereport.sites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The required site name. It should be the site property whose ad experiences may have been reviewed, and it should be URL-encoded. For example, sites/https%3A%2F%2Fwww.google.com. The server will return an error of BAD_REQUEST if this field is not filled in. Note that if the site property is not yet verified in Search Console, the reportUrl field returned by the API will lead to the verification page, prompting the user to go through that process before they can gain access to the Ad Experience Report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexperiencereport.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * adexperiencereport.violatingSites.list - * @desc Lists sites with Ad Experience Report statuses of "Failing" or - * "Warning". - * @alias adexperiencereport.violatingSites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Violatingsites { + root: Adexperiencereport; + constructor(root: Adexperiencereport) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://adexperiencereport.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/violatingSites').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * adexperiencereport.violatingSites.list + * @desc Lists sites with Ad Experience Report statuses of "Failing" or + * "Warning". + * @alias adexperiencereport.violatingSites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://adexperiencereport.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/violatingSites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/admin/datatransfer_v1.ts b/src/apis/admin/datatransfer_v1.ts index 753b9db3a21..ccf19d9474e 100644 --- a/src/apis/admin/datatransfer_v1.ts +++ b/src/apis/admin/datatransfer_v1.ts @@ -27,485 +27,494 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Admin Data Transfer API - * - * Transfers user data from one user to another. - * - * @example - * const google = require('googleapis'); - * const admin = google.admin('datatransfer_v1'); - * - * @namespace admin - * @type {Function} - * @version datatransfer_v1 - * @variation datatransfer_v1 - * @param {object=} options Options for Admin - */ -export class Admin { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace admin_datatransfer_v1 { + /** + * Admin Data Transfer API + * + * Transfers user data from one user to another. + * + * @example + * const google = require('googleapis'); + * const admin = google.admin('datatransfer_v1'); + * + * @namespace admin + * @type {Function} + * @version datatransfer_v1 + * @variation datatransfer_v1 + * @param {object=} options Options for Admin + */ + export class Admin { + _options: GlobalOptions; + google: GoogleApis; + root = this; - applications: Resource$Applications; - transfers: Resource$Transfers; + applications: Resource$Applications; + transfers: Resource$Transfers; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.applications = new Resource$Applications(this); - this.transfers = new Resource$Transfers(this); - } + this.applications = new Resource$Applications(this); + this.transfers = new Resource$Transfers(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The JSON template for an Application resource. - */ -export interface Schema$Application { - /** - * Etag of the resource. - */ - etag: string; - /** - * The application's ID. - */ - id: string; - /** - * Identifies the resource as a DataTransfer Application Resource. - */ - kind: string; - /** - * The application's name. - */ - name: string; - /** - * The list of all possible transfer parameters for this application. These - * parameters can be used to select the data of the user in this application - * to be transfered. - */ - transferParams: Schema$ApplicationTransferParam[]; -} -/** - * Template to map fields of ApplicationDataTransfer resource. - */ -export interface Schema$ApplicationDataTransfer { - /** - * The application's ID. - */ - applicationId: string; - /** - * The transfer parameters for the application. These parameters are used to - * select the data which will get transfered in context of this application. - */ - applicationTransferParams: Schema$ApplicationTransferParam[]; - /** - * Current status of transfer for this application. (Read-only) - */ - applicationTransferStatus: string; -} -/** - * Template for a collection of Applications. - */ -export interface Schema$ApplicationsListResponse { - /** - * List of applications that support data transfer and are also installed for - * the customer. - */ - applications: Schema$Application[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Identifies the resource as a collection of Applications. - */ - kind: string; - /** - * Continuation token which will be used to specify next page in list API. - */ - nextPageToken: string; -} -/** - * Template for application transfer parameters. - */ -export interface Schema$ApplicationTransferParam { - /** - * The type of the transfer parameter. eg: 'PRIVACY_LEVEL' - */ - key: string; - /** - * The value of the coressponding transfer parameter. eg: 'PRIVATE' or - * 'SHARED' - */ - value: string[]; -} -/** - * The JSON template for a DataTransfer resource. - */ -export interface Schema$DataTransfer { - /** - * List of per application data transfer resources. It contains data transfer - * details of the applications associated with this transfer resource. Note - * that this list is also used to specify the applications for which data - * transfer has to be done at the time of the transfer resource creation. - */ - applicationDataTransfers: Schema$ApplicationDataTransfer[]; /** - * ETag of the resource. + * The JSON template for an Application resource. */ - etag: string; - /** - * The transfer's ID (Read-only). - */ - id: string; - /** - * Identifies the resource as a DataTransfer request. - */ - kind: string; - /** - * ID of the user to whom the data is being transfered. - */ - newOwnerUserId: string; - /** - * ID of the user whose data is being transfered. - */ - oldOwnerUserId: string; - /** - * Overall transfer status (Read-only). - */ - overallTransferStatusCode: string; + export interface Schema$Application { + /** + * Etag of the resource. + */ + etag: string; + /** + * The application's ID. + */ + id: string; + /** + * Identifies the resource as a DataTransfer Application Resource. + */ + kind: string; + /** + * The application's name. + */ + name: string; + /** + * The list of all possible transfer parameters for this application. These + * parameters can be used to select the data of the user in this application + * to be transfered. + */ + transferParams: Schema$ApplicationTransferParam[]; + } /** - * The time at which the data transfer was requested (Read-only). + * Template to map fields of ApplicationDataTransfer resource. */ - requestTime: string; -} -/** - * Template for a collection of DataTransfer resources. - */ -export interface Schema$DataTransfersListResponse { + export interface Schema$ApplicationDataTransfer { + /** + * The application's ID. + */ + applicationId: string; + /** + * The transfer parameters for the application. These parameters are used to + * select the data which will get transfered in context of this application. + */ + applicationTransferParams: Schema$ApplicationTransferParam[]; + /** + * Current status of transfer for this application. (Read-only) + */ + applicationTransferStatus: string; + } /** - * List of data transfer requests. + * Template for a collection of Applications. */ - dataTransfers: Schema$DataTransfer[]; + export interface Schema$ApplicationsListResponse { + /** + * List of applications that support data transfer and are also installed + * for the customer. + */ + applications: Schema$Application[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifies the resource as a collection of Applications. + */ + kind: string; + /** + * Continuation token which will be used to specify next page in list API. + */ + nextPageToken: string; + } /** - * ETag of the resource. + * Template for application transfer parameters. */ - etag: string; + export interface Schema$ApplicationTransferParam { + /** + * The type of the transfer parameter. eg: 'PRIVACY_LEVEL' + */ + key: string; + /** + * The value of the coressponding transfer parameter. eg: 'PRIVATE' + * or 'SHARED' + */ + value: string[]; + } /** - * Identifies the resource as a collection of data transfer requests. + * The JSON template for a DataTransfer resource. */ - kind: string; + export interface Schema$DataTransfer { + /** + * List of per application data transfer resources. It contains data + * transfer details of the applications associated with this transfer + * resource. Note that this list is also used to specify the applications + * for which data transfer has to be done at the time of the transfer + * resource creation. + */ + applicationDataTransfers: Schema$ApplicationDataTransfer[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * The transfer's ID (Read-only). + */ + id: string; + /** + * Identifies the resource as a DataTransfer request. + */ + kind: string; + /** + * ID of the user to whom the data is being transfered. + */ + newOwnerUserId: string; + /** + * ID of the user whose data is being transfered. + */ + oldOwnerUserId: string; + /** + * Overall transfer status (Read-only). + */ + overallTransferStatusCode: string; + /** + * The time at which the data transfer was requested (Read-only). + */ + requestTime: string; + } /** - * Continuation token which will be used to specify next page in list API. + * Template for a collection of DataTransfer resources. */ - nextPageToken: string; -} - -export class Resource$Applications { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$DataTransfersListResponse { + /** + * List of data transfer requests. + */ + dataTransfers: Schema$DataTransfer[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifies the resource as a collection of data transfer requests. + */ + kind: string; + /** + * Continuation token which will be used to specify next page in list API. + */ + nextPageToken: string; } - - /** - * datatransfer.applications.get - * @desc Retrieves information about an application for the given application - * ID. - * @alias datatransfer.applications.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId ID of the application resource to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Applications { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/datatransfer/v1/applications/{applicationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * datatransfer.applications.list - * @desc Lists the applications available for data transfer for a customer. - * @alias datatransfer.applications.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.customerId Immutable ID of the Google Apps account. - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. - * @param {string=} params.pageToken Token to specify next page in the list. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datatransfer.applications.get + * @desc Retrieves information about an application for the given + * application ID. + * @alias datatransfer.applications.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId ID of the application resource to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/datatransfer/v1/applications/{applicationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/datatransfer/v1/applications') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Transfers { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * datatransfer.applications.list + * @desc Lists the applications available for data transfer for a customer. + * @alias datatransfer.applications.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.customerId Immutable ID of the Google Apps account. + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. + * @param {string=} params.pageToken Token to specify next page in the list. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/datatransfer/v1/applications') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * datatransfer.transfers.get - * @desc Retrieves a data transfer request by its resource ID. - * @alias datatransfer.transfers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataTransferId ID of the resource to be retrieved. This is returned in the response from the insert method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Transfers { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/datatransfer/v1/transfers/{dataTransferId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['dataTransferId'], - pathParams: ['dataTransferId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * datatransfer.transfers.insert - * @desc Inserts a data transfer request. - * @alias datatransfer.transfers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().DataTransfer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/datatransfer/v1/transfers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datatransfer.transfers.get + * @desc Retrieves a data transfer request by its resource ID. + * @alias datatransfer.transfers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataTransferId ID of the resource to be retrieved. This is returned in the response from the insert method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/datatransfer/v1/transfers/{dataTransferId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['dataTransferId'], + pathParams: ['dataTransferId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datatransfer.transfers.list - * @desc Lists the transfers for a customer by source user, destination user, - * or status. - * @alias datatransfer.transfers.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.customerId Immutable ID of the Google Apps account. - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. - * @param {string=} params.newOwnerUserId Destination user's profile ID. - * @param {string=} params.oldOwnerUserId Source user's profile ID. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {string=} params.status Status of the transfer. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datatransfer.transfers.insert + * @desc Inserts a data transfer request. + * @alias datatransfer.transfers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().DataTransfer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/datatransfer/v1/transfers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/datatransfer/v1/transfers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * datatransfer.transfers.list + * @desc Lists the transfers for a customer by source user, destination + * user, or status. + * @alias datatransfer.transfers.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.customerId Immutable ID of the Google Apps account. + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. + * @param {string=} params.newOwnerUserId Destination user's profile ID. + * @param {string=} params.oldOwnerUserId Source user's profile ID. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {string=} params.status Status of the transfer. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/datatransfer/v1/transfers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/admin/directory_v1.ts b/src/apis/admin/directory_v1.ts index bbc5f917718..499eed12bb9 100644 --- a/src/apis/admin/directory_v1.ts +++ b/src/apis/admin/directory_v1.ts @@ -27,8781 +27,8851 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Admin Directory API - * - * The Admin SDK Directory API lets you view and manage enterprise resources - * such as users and groups, administrative notifications, security features, - * and more. - * - * @example - * const google = require('googleapis'); - * const admin = google.admin('directory_v1'); - * - * @namespace admin - * @type {Function} - * @version directory_v1 - * @variation directory_v1 - * @param {object=} options Options for Admin - */ -export class Admin { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - asps: Resource$Asps; - channels: Resource$Channels; - chromeosdevices: Resource$Chromeosdevices; - customers: Resource$Customers; - domainAliases: Resource$Domainaliases; - domains: Resource$Domains; - groups: Resource$Groups; - members: Resource$Members; - mobiledevices: Resource$Mobiledevices; - notifications: Resource$Notifications; - orgunits: Resource$Orgunits; - privileges: Resource$Privileges; - resolvedAppAccessSettings: Resource$Resolvedappaccesssettings; - resources: Resource$Resources; - roleAssignments: Resource$Roleassignments; - roles: Resource$Roles; - schemas: Resource$Schemas; - tokens: Resource$Tokens; - users: Resource$Users; - verificationCodes: Resource$Verificationcodes; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.asps = new Resource$Asps(this); - this.channels = new Resource$Channels(this); - this.chromeosdevices = new Resource$Chromeosdevices(this); - this.customers = new Resource$Customers(this); - this.domainAliases = new Resource$Domainaliases(this); - this.domains = new Resource$Domains(this); - this.groups = new Resource$Groups(this); - this.members = new Resource$Members(this); - this.mobiledevices = new Resource$Mobiledevices(this); - this.notifications = new Resource$Notifications(this); - this.orgunits = new Resource$Orgunits(this); - this.privileges = new Resource$Privileges(this); - this.resolvedAppAccessSettings = - new Resource$Resolvedappaccesssettings(this); - this.resources = new Resource$Resources(this); - this.roleAssignments = new Resource$Roleassignments(this); - this.roles = new Resource$Roles(this); - this.schemas = new Resource$Schemas(this); - this.tokens = new Resource$Tokens(this); - this.users = new Resource$Users(this); - this.verificationCodes = new Resource$Verificationcodes(this); - } - - getRoot() { - return this.root; - } -} - -/** - * JSON template for Alias object in Directory API. - */ -export interface Schema$Alias { - /** - * A alias email - */ - alias: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Unique id of the group (Read-only) Unique id of the user (Read-only) - */ - id: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Group's primary email (Read-only) User's primary email (Read-only) - */ - primaryEmail: string; -} -/** - * JSON response template to list aliases in Directory API. - */ -export interface Schema$Aliases { - /** - * List of alias objects. - */ - aliases: any[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; -} -/** - * JSON template for App Access Collections Resource object in Directory API. - */ -export interface Schema$AppAccessCollections { - /** - * List of blocked api access buckets. - */ - blockedApiAccessBuckets: string[]; - /** - * Boolean to indicate whether to enforce app access settings on Android Drive - * or not. - */ - enforceSettingsForAndroidDrive: boolean; - /** - * Error message provided by the Admin that will be shown to the user when an - * app is blocked. - */ - errorMessage: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Identifies the resource as an app access collection. Value: - * admin#directory#appaccesscollection - */ - kind: string; - /** - * Unique ID of app access collection. (Readonly) - */ - resourceId: string; - /** - * Resource name given by the customer while creating/updating. Should be - * unique under given customer. - */ - resourceName: string; - /** - * Boolean that indicates whether to trust domain owned apps. - */ - trustDomainOwnedApps: boolean; -} -/** - * The template that returns individual ASP (Access Code) data. - */ -export interface Schema$Asp { - /** - * The unique ID of the ASP. - */ - codeId: number; - /** - * The time when the ASP was created. Expressed in Unix time format. - */ - creationTime: string; - /** - * ETag of the ASP. - */ - etag: string; - /** - * The type of the API resource. This is always admin#directory#asp. - */ - kind: string; - /** - * The time when the ASP was last used. Expressed in Unix time format. - */ - lastTimeUsed: string; - /** - * The name of the application that the user, represented by their userId, - * entered when the ASP was created. - */ - name: string; - /** - * The unique ID of the user who issued the ASP. - */ - userKey: string; -} -export interface Schema$Asps { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of ASP resources. - */ - items: Schema$Asp[]; - /** - * The type of the API resource. This is always admin#directory#aspList. - */ - kind: string; -} -/** - * JSON template for Building object in Directory API. - */ -export interface Schema$Building { - /** - * Unique identifier for the building. The maximum length is 100 characters. - */ - buildingId: string; - /** - * The building name as seen by users in Calendar. Must be unique for the - * customer. For example, "NYC-CHEL". The maximum length is 100 - * characters. - */ - buildingName: string; - /** - * The geographic coordinates of the center of the building, expressed as - * latitude and longitude in decimal degrees. - */ - coordinates: Schema$BuildingCoordinates; - /** - * A brief description of the building. For example, "Chelsea - * Market". - */ - description: string; - /** - * ETag of the resource. - */ - etags: string; - /** - * The display names for all floors in this building. The floors are expected - * to be sorted in ascending order, from lowest floor to highest floor. For - * example, ["B2", "B1", "L", "1", - * "2", "2M", "3", "PH"] Must contain - * at least one entry. - */ - floorNames: string[]; - /** - * Kind of resource this is. - */ - kind: string; -} -/** - * JSON template for coordinates of a building in Directory API. - */ -export interface Schema$BuildingCoordinates { - /** - * Latitude in decimal degrees. - */ - latitude: number; - /** - * Longitude in decimal degrees. - */ - longitude: number; -} -/** - * JSON template for Building List Response object in Directory API. - */ -export interface Schema$Buildings { - /** - * The Buildings in this page of results. - */ - buildings: Schema$Building[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * JSON template for Calendar Resource object in Directory API. - */ -export interface Schema$CalendarResource { - /** - * Unique ID for the building a resource is located in. - */ - buildingId: string; - /** - * Capacity of a resource, number of seats in a room. - */ - capacity: number; - /** - * ETag of the resource. - */ - etags: string; - featureInstances: any; - /** - * Name of the floor a resource is located on. - */ - floorName: string; - /** - * Name of the section within a floor a resource is located in. - */ - floorSection: string; - /** - * The read-only auto-generated name of the calendar resource which includes - * metadata about the resource such as building name, floor, capacity, etc. - * For example, "NYC-2-Training Room 1A (16)". - */ - generatedResourceName: string; - /** - * The type of the resource. For calendar resources, the value is - * admin#directory#resources#calendars#CalendarResource. - */ - kind: string; - /** - * The category of the calendar resource. Either CONFERENCE_ROOM or OTHER. - * Legacy data is set to CATEGORY_UNKNOWN. - */ - resourceCategory: string; - /** - * Description of the resource, visible only to admins. - */ - resourceDescription: string; - /** - * The read-only email for the calendar resource. Generated as part of - * creating a new calendar resource. - */ - resourceEmail: string; - /** - * The unique ID for the calendar resource. - */ - resourceId: string; - /** - * The name of the calendar resource. For example, "Training Room - * 1A". - */ - resourceName: string; - /** - * The type of the calendar resource, intended for non-room resources. - */ - resourceType: string; - /** - * Description of the resource, visible to users and admins. - */ - userVisibleDescription: string; -} -/** - * JSON template for Calendar Resource List Response object in Directory API. - */ -export interface Schema$CalendarResources { - /** - * ETag of the resource. - */ - etag: string; - /** - * The CalendarResources in this page of results. - */ - items: Schema$CalendarResource[]; - /** - * Identifies this as a collection of CalendarResources. This is always - * admin#directory#resources#calendars#calendarResourcesList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * JSON template for Chrome Os Device resource in Directory API. - */ -export interface Schema$ChromeOsDevice { - /** - * List of active time ranges (Read-only) - */ - activeTimeRanges: any[]; - /** - * AssetId specified during enrollment or through later annotation - */ - annotatedAssetId: string; - /** - * Address or location of the device as noted by the administrator - */ - annotatedLocation: string; - /** - * User of the device - */ - annotatedUser: string; - /** - * Chromebook boot mode (Read-only) - */ - bootMode: string; - /** - * List of device files to download (Read-only) - */ - deviceFiles: any[]; - /** - * Unique identifier of Chrome OS Device (Read-only) - */ - deviceId: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Chromebook Mac Address on ethernet network interface (Read-only) - */ - ethernetMacAddress: string; - /** - * Chromebook firmware version (Read-only) - */ - firmwareVersion: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Date and time the device was last enrolled (Read-only) - */ - lastEnrollmentTime: string; - /** - * Date and time the device was last synchronized with the policy settings in - * the G Suite administrator control panel (Read-only) - */ - lastSync: string; - /** - * Chromebook Mac Address on wifi network interface (Read-only) - */ - macAddress: string; - /** - * Mobile Equipment identifier for the 3G mobile card in the Chromebook - * (Read-only) - */ - meid: string; - /** - * Chromebook Model (Read-only) - */ - model: string; - /** - * Notes added by the administrator - */ - notes: string; - /** - * Chromebook order number (Read-only) - */ - orderNumber: string; - /** - * OrgUnit of the device - */ - orgUnitPath: string; - /** - * Chromebook Os Version (Read-only) - */ - osVersion: string; - /** - * Chromebook platform version (Read-only) - */ - platformVersion: string; - /** - * List of recent device users, in descending order by last login time - * (Read-only) - */ - recentUsers: any[]; - /** - * Chromebook serial number (Read-only) - */ - serialNumber: string; - /** - * status of the device (Read-only) - */ - status: string; - /** - * Final date the device will be supported (Read-only) - */ - supportEndDate: string; - /** - * Trusted Platform Module (TPM) (Read-only) - */ - tpmVersionInfo: any; - /** - * Will Chromebook auto renew after support end date (Read-only) - */ - willAutoRenew: boolean; -} -/** - * JSON request template for firing actions on ChromeOs Device in Directory - * Devices API. - */ -export interface Schema$ChromeOsDeviceAction { - /** - * Action to be taken on the ChromeOs Device - */ - action: string; - deprovisionReason: string; -} -/** - * JSON response template for List Chrome OS Devices operation in Directory API. - */ -export interface Schema$ChromeOsDevices { - /** - * List of Chrome OS Device objects. - */ - chromeosdevices: Schema$ChromeOsDevice[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Token used to access next page of this result. - */ - nextPageToken: string; -} -/** - * JSON request template for moving ChromeOs Device to given OU in Directory - * Devices API. - */ -export interface Schema$ChromeOsMoveDevicesToOu { - /** - * ChromeOs Devices to be moved to OU - */ - deviceIds: string[]; -} -/** - * JSON template for Customer Resource object in Directory API. - */ -export interface Schema$Customer { - /** - * The customer's secondary contact email address. This email address - * cannot be on the same domain as the customerDomain - */ - alternateEmail: string; - /** - * The customer's creation time (Readonly) - */ - customerCreationTime: string; - /** - * The customer's primary domain name string. Do not include the www - * prefix when creating a new customer. - */ - customerDomain: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * The unique ID for the customer's G Suite account. (Readonly) - */ - id: string; - /** - * Identifies the resource as a customer. Value: admin#directory#customer - */ - kind: string; - /** - * The customer's ISO 639-2 language code. The default value is en-US - */ - language: string; - /** - * The customer's contact phone number in E.164 format. - */ - phoneNumber: string; - /** - * The customer's postal address information. - */ - postalAddress: Schema$CustomerPostalAddress; -} -/** - * JSON template for postal address of a customer. - */ -export interface Schema$CustomerPostalAddress { - /** - * A customer's physical address. The address can be composed of one to - * three lines. - */ - addressLine1: string; - /** - * Address line 2 of the address. - */ - addressLine2: string; - /** - * Address line 3 of the address. - */ - addressLine3: string; - /** - * The customer contact's name. - */ - contactName: string; - /** - * This is a required property. For countryCode information see the ISO 3166 - * country code elements. - */ - countryCode: string; - /** - * Name of the locality. An example of a locality value is the city of San - * Francisco. - */ - locality: string; - /** - * The company or company division name. - */ - organizationName: string; - /** - * The postal code. A postalCode example is a postal zip code such as 10009. - * This is in accordance with - - * http://portablecontacts.net/draft-spec.html#address_element. - */ - postalCode: string; - /** - * Name of the region. An example of a region value is NY for the state of New - * York. - */ - region: string; -} -/** - * JSON template for Domain Alias object in Directory API. - */ -export interface Schema$DomainAlias { - /** - * The creation time of the domain alias. (Read-only). - */ - creationTime: string; - /** - * The domain alias name. - */ - domainAliasName: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * The parent domain name that the domain alias is associated with. This can - * either be a primary or secondary domain name within a customer. - */ - parentDomainName: string; - /** - * Indicates the verification state of a domain alias. (Read-only) - */ - verified: boolean; -} -/** - * JSON response template to list domain aliases in Directory API. - */ -export interface Schema$DomainAliases { - /** - * List of domain alias objects. - */ - domainAliases: Schema$DomainAlias[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; -} -/** - * JSON template for Domain object in Directory API. - */ -export interface Schema$Domains { - /** - * Creation time of the domain. (Read-only). - */ - creationTime: string; - /** - * List of domain alias objects. (Read-only) - */ - domainAliases: Schema$DomainAlias[]; - /** - * The domain name of the customer. - */ - domainName: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Indicates if the domain is a primary domain (Read-only). - */ - isPrimary: boolean; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Indicates the verification state of a domain. (Read-only). - */ - verified: boolean; -} -/** - * JSON response template to list Domains in Directory API. - */ -export interface Schema$Domains2 { - /** - * List of domain objects. - */ - domains: Schema$Domains[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; -} -/** - * JSON template for Feature object in Directory API. - */ -export interface Schema$Feature { - /** - * ETag of the resource. - */ - etags: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * The name of the feature. - */ - name: string; -} -/** - * JSON template for a "feature instance". - */ -export interface Schema$FeatureInstance { - /** - * The feature that this is an instance of. A calendar resource may have - * multiple instances of a feature. - */ - feature: Schema$Feature; -} -/** - * JSON request template for renaming a feature. - */ -export interface Schema$FeatureRename { - /** - * New name of the feature. - */ - newName: string; -} -/** - * JSON template for Feature List Response object in Directory API. - */ -export interface Schema$Features { - /** - * ETag of the resource. - */ - etag: string; - /** - * The Features in this page of results. - */ - features: Schema$Feature[]; - /** - * Kind of resource this is. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * JSON template for Group resource in Directory API. - */ -export interface Schema$Group { - /** - * Is the group created by admin (Read-only) * - */ - adminCreated: boolean; - /** - * List of aliases (Read-only) - */ - aliases: string[]; - /** - * Description of the group - */ - description: string; - /** - * Group direct members count - */ - directMembersCount: string; - /** - * Email of Group - */ - email: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Unique identifier of Group (Read-only) - */ - id: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Group name - */ - name: string; - /** - * List of non editable aliases (Read-only) - */ - nonEditableAliases: string[]; -} -/** - * JSON response template for List Groups operation in Directory API. - */ -export interface Schema$Groups { - /** - * ETag of the resource. - */ - etag: string; - /** - * List of group objects. - */ - groups: Schema$Group[]; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Token used to access next page of this result. - */ - nextPageToken: string; -} -/** - * JSON template for Member resource in Directory API. - */ -export interface Schema$Member { - /** - * Email of member (Read-only) - */ - email: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Unique identifier of customer member (Read-only) Unique identifier of group - * (Read-only) Unique identifier of member (Read-only) - */ - id: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Role of member - */ - role: string; - /** - * Status of member (Immutable) - */ - status: string; - /** - * Type of member (Immutable) - */ - type: string; -} -/** - * JSON response template for List Members operation in Directory API. - */ -export interface Schema$Members { - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * List of member objects. - */ - members: Schema$Member[]; - /** - * Token used to access next page of this result. - */ - nextPageToken: string; -} -/** - * JSON template for Has Member response in Directory API. - */ -export interface Schema$MembersHasMember { - /** - * Identifies whether the given user is a member of the group. Membership can - * be direct or nested. - */ - isMember: boolean; -} -/** - * JSON template for Mobile Device resource in Directory API. - */ -export interface Schema$MobileDevice { - /** - * Adb (USB debugging) enabled or disabled on device (Read-only) - */ - adbStatus: boolean; - /** - * List of applications installed on Mobile Device - */ - applications: any[]; - /** - * Mobile Device Baseband version (Read-only) - */ - basebandVersion: string; - /** - * Mobile Device Bootloader version (Read-only) - */ - bootloaderVersion: string; - /** - * Mobile Device Brand (Read-only) - */ - brand: string; - /** - * Mobile Device Build number (Read-only) - */ - buildNumber: string; - /** - * The default locale used on the Mobile Device (Read-only) - */ - defaultLanguage: string; - /** - * Developer options enabled or disabled on device (Read-only) - */ - developerOptionsStatus: boolean; - /** - * Mobile Device compromised status (Read-only) - */ - deviceCompromisedStatus: string; - /** - * Mobile Device serial number (Read-only) - */ - deviceId: string; - /** - * DevicePasswordStatus (Read-only) - */ - devicePasswordStatus: string; - /** - * List of owner user's email addresses (Read-only) - */ - email: string[]; - /** - * Mobile Device Encryption Status (Read-only) - */ - encryptionStatus: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Date and time the device was first synchronized with the policy settings in - * the G Suite administrator control panel (Read-only) - */ - firstSync: string; - /** - * Mobile Device Hardware (Read-only) - */ - hardware: string; - /** - * Mobile Device Hardware Id (Read-only) - */ - hardwareId: string; - /** - * Mobile Device IMEI number (Read-only) - */ - imei: string; - /** - * Mobile Device Kernel version (Read-only) - */ - kernelVersion: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Date and time the device was last synchronized with the policy settings in - * the G Suite administrator control panel (Read-only) - */ - lastSync: string; - /** - * Boolean indicating if this account is on owner/primary profile or not - * (Read-only) - */ - managedAccountIsOnOwnerProfile: boolean; - /** - * Mobile Device manufacturer (Read-only) - */ - manufacturer: string; - /** - * Mobile Device MEID number (Read-only) - */ - meid: string; - /** - * Name of the model of the device - */ - model: string; - /** - * List of owner user's names (Read-only) - */ - name: string[]; - /** - * Mobile Device mobile or network operator (if available) (Read-only) - */ - networkOperator: string; - /** - * Name of the mobile operating system - */ - os: string; - /** - * List of accounts added on device (Read-only) - */ - otherAccountsInfo: string[]; - /** - * DMAgentPermission (Read-only) - */ - privilege: string; - /** - * Mobile Device release version version (Read-only) - */ - releaseVersion: string; - /** - * Unique identifier of Mobile Device (Read-only) - */ - resourceId: string; - /** - * Mobile Device Security patch level (Read-only) - */ - securityPatchLevel: string; - /** - * Mobile Device SSN or Serial Number (Read-only) - */ - serialNumber: string; - /** - * Status of the device (Read-only) - */ - status: string; - /** - * Work profile supported on device (Read-only) - */ - supportsWorkProfile: boolean; - /** - * The type of device (Read-only) - */ - type: string; - /** - * Unknown sources enabled or disabled on device (Read-only) - */ - unknownSourcesStatus: boolean; - /** - * Mobile Device user agent - */ - userAgent: string; - /** - * Mobile Device WiFi MAC address (Read-only) - */ - wifiMacAddress: string; -} -/** - * JSON request template for firing commands on Mobile Device in Directory - * Devices API. - */ -export interface Schema$MobileDeviceAction { - /** - * Action to be taken on the Mobile Device - */ - action: string; -} -/** - * JSON response template for List Mobile Devices operation in Directory API. - */ -export interface Schema$MobileDevices { - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * List of Mobile Device objects. - */ - mobiledevices: Schema$MobileDevice[]; - /** - * Token used to access next page of this result. - */ - nextPageToken: string; -} -/** - * Template for a notification resource. - */ -export interface Schema$Notification { - /** - * Body of the notification (Read-only) - */ - body: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Address from which the notification is received (Read-only) - */ - fromAddress: string; - /** - * Boolean indicating whether the notification is unread or not. - */ - isUnread: boolean; - /** - * The type of the resource. - */ - kind: string; - notificationId: string; - /** - * Time at which notification was sent (Read-only) - */ - sendTime: string; - /** - * Subject of the notification (Read-only) - */ - subject: string; -} -/** - * Template for notifications list response. - */ -export interface Schema$Notifications { - /** - * ETag of the resource. - */ - etag: string; - /** - * List of notifications in this page. - */ - items: Schema$Notification[]; - /** - * The type of the resource. - */ - kind: string; - /** - * Token for fetching the next page of notifications. - */ - nextPageToken: string; - /** - * Number of unread notification for the domain. - */ - unreadNotificationsCount: number; -} -/** - * JSON template for Org Unit resource in Directory API. - */ -export interface Schema$OrgUnit { - /** - * Should block inheritance - */ - blockInheritance: boolean; - /** - * Description of OrgUnit - */ - description: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Name of OrgUnit - */ - name: string; - /** - * Id of OrgUnit - */ - orgUnitId: string; - /** - * Path of OrgUnit - */ - orgUnitPath: string; - /** - * Id of parent OrgUnit - */ - parentOrgUnitId: string; - /** - * Path of parent OrgUnit - */ - parentOrgUnitPath: string; -} -/** - * JSON response template for List Organization Units operation in Directory - * API. - */ -export interface Schema$OrgUnits { - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * List of user objects. - */ - organizationUnits: Schema$OrgUnit[]; -} -/** - * JSON template for privilege resource in Directory API. - */ -export interface Schema$Privilege { - /** - * A list of child privileges. Privileges for a service form a tree. Each - * privilege can have a list of child privileges; this list is empty for a - * leaf privilege. - */ - childPrivileges: Schema$Privilege[]; - /** - * ETag of the resource. - */ - etag: string; - /** - * If the privilege can be restricted to an organization unit. - */ - isOuScopable: boolean; - /** - * The type of the API resource. This is always admin#directory#privilege. - */ - kind: string; - /** - * The name of the privilege. - */ - privilegeName: string; - /** - * The obfuscated ID of the service this privilege is for. - */ - serviceId: string; - /** - * The name of the service this privilege is for. - */ - serviceName: string; -} -/** - * JSON response template for List privileges operation in Directory API. - */ -export interface Schema$Privileges { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of Privilege resources. - */ - items: Schema$Privilege[]; - /** - * The type of the API resource. This is always admin#directory#privileges. - */ - kind: string; -} -/** - * JSON template for role resource in Directory API. - */ -export interface Schema$Role { - /** - * ETag of the resource. - */ - etag: string; - /** - * Returns true if the role is a super admin role. - */ - isSuperAdminRole: boolean; - /** - * Returns true if this is a pre-defined system role. - */ - isSystemRole: boolean; - /** - * The type of the API resource. This is always admin#directory#role. - */ - kind: string; - /** - * A short description of the role. - */ - roleDescription: string; - /** - * ID of the role. - */ - roleId: string; - /** - * Name of the role. - */ - roleName: string; - /** - * The set of privileges that are granted to this role. - */ - rolePrivileges: any[]; -} -/** - * JSON template for roleAssignment resource in Directory API. - */ -export interface Schema$RoleAssignment { - /** - * The unique ID of the user this role is assigned to. - */ - assignedTo: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * The type of the API resource. This is always - * admin#directory#roleAssignment. - */ - kind: string; - /** - * If the role is restricted to an organization unit, this contains the ID for - * the organization unit the exercise of this role is restricted to. - */ - orgUnitId: string; - /** - * ID of this roleAssignment. - */ - roleAssignmentId: string; - /** - * The ID of the role that is assigned. - */ - roleId: string; - /** - * The scope in which this role is assigned. Possible values are: - CUSTOMER - * - ORG_UNIT - */ - scopeType: string; -} -/** - * JSON response template for List roleAssignments operation in Directory API. - */ -export interface Schema$RoleAssignments { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of RoleAssignment resources. - */ - items: Schema$RoleAssignment[]; - /** - * The type of the API resource. This is always - * admin#directory#roleAssignments. - */ - kind: string; - nextPageToken: string; -} -/** - * JSON response template for List roles operation in Directory API. - */ -export interface Schema$Roles { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of Role resources. - */ - items: Schema$Role[]; - /** - * The type of the API resource. This is always admin#directory#roles. - */ - kind: string; - nextPageToken: string; -} -/** - * JSON template for Schema resource in Directory API. - */ -export interface Schema$Schema { - /** - * ETag of the resource. - */ - etag: string; - /** - * Fields of Schema - */ - fields: Schema$SchemaFieldSpec[]; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Unique identifier of Schema (Read-only) - */ - schemaId: string; - /** - * Schema name - */ - schemaName: string; -} -/** - * JSON template for FieldSpec resource for Schemas in Directory API. - */ -export interface Schema$SchemaFieldSpec { - /** - * ETag of the resource. - */ - etag: string; - /** - * Unique identifier of Field (Read-only) - */ - fieldId: string; - /** - * Name of the field. - */ - fieldName: string; - /** - * Type of the field. - */ - fieldType: string; - /** - * Boolean specifying whether the field is indexed or not. - */ - indexed: boolean; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Boolean specifying whether this is a multi-valued field or not. - */ - multiValued: boolean; - /** - * Indexing spec for a numeric field. By default, only exact match queries - * will be supported for numeric fields. Setting the numericIndexingSpec - * allows range queries to be supported. - */ - numericIndexingSpec: any; - /** - * Read ACLs on the field specifying who can view values of this field. Valid - * values are "ALL_DOMAIN_USERS" and "ADMINS_AND_SELF". - */ - readAccessType: string; -} -/** - * JSON response template for List Schema operation in Directory API. - */ -export interface Schema$Schemas { - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * List of UserSchema objects. - */ - schemas: Schema$Schema[]; -} -/** - * JSON template for token resource in Directory API. - */ -export interface Schema$Token { - /** - * Whether the application is registered with Google. The value is true if the - * application has an anonymous Client ID. - */ - anonymous: boolean; - /** - * The Client ID of the application the token is issued to. - */ - clientId: string; - /** - * The displayable name of the application the token is issued to. - */ - displayText: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * The type of the API resource. This is always admin#directory#token. - */ - kind: string; - /** - * Whether the token is issued to an installed application. The value is true - * if the application is installed to a desktop or mobile device. - */ - nativeApp: boolean; - /** - * A list of authorization scopes the application is granted. - */ - scopes: string[]; - /** - * The unique ID of the user that issued the token. - */ - userKey: string; -} -/** - * JSON response template for List tokens operation in Directory API. - */ -export interface Schema$Tokens { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of Token resources. - */ - items: Schema$Token[]; - /** - * The type of the API resource. This is always admin#directory#tokenList. - */ - kind: string; -} -/** - * JSON template for Trusted App Ids Resource object in Directory API. - */ -export interface Schema$TrustedAppId { - /** - * Android package name. - */ - androidPackageName: string; - /** - * SHA1 signature of the app certificate. - */ - certificateHashSHA1: string; - /** - * SHA256 signature of the app certificate. - */ - certificateHashSHA256: string; - etag: string; - /** - * Identifies the resource as a trusted AppId. - */ - kind: string; -} -/** - * JSON template for Trusted Apps response object of a user in Directory API. - */ -export interface Schema$TrustedApps { - /** - * ETag of the resource. - */ - etag: string; - /** - * Identifies the resource as trusted apps response. - */ - kind: string; - nextPageToken: string; - /** - * Trusted Apps list. - */ - trustedApps: Schema$TrustedAppId[]; -} -/** - * JSON template for User object in Directory API. - */ -export interface Schema$User { - addresses: any; - /** - * Indicates if user has agreed to terms (Read-only) - */ - agreedToTerms: boolean; - /** - * List of aliases (Read-only) - */ - aliases: string[]; - /** - * Boolean indicating if the user should change password in next login - */ - changePasswordAtNextLogin: boolean; - /** - * User's G Suite account creation time. (Read-only) - */ - creationTime: string; - /** - * CustomerId of User (Read-only) - */ - customerId: string; - /** - * Custom fields of the user. - */ - customSchemas: any; - deletionTime: string; - emails: any; - /** - * ETag of the resource. - */ - etag: string; - externalIds: any; - gender: any; - /** - * Hash function name for password. Supported are MD5, SHA-1 and crypt - */ - hashFunction: string; - /** - * Unique identifier of User (Read-only) - */ - id: string; - ims: any; - /** - * Boolean indicating if user is included in Global Address List - */ - includeInGlobalAddressList: boolean; - /** - * Boolean indicating if ip is whitelisted - */ - ipWhitelisted: boolean; - /** - * Boolean indicating if the user is admin (Read-only) - */ - isAdmin: boolean; - /** - * Boolean indicating if the user is delegated admin (Read-only) - */ - isDelegatedAdmin: boolean; - /** - * Is 2-step verification enforced (Read-only) - */ - isEnforcedIn2Sv: boolean; - /** - * Is enrolled in 2-step verification (Read-only) - */ - isEnrolledIn2Sv: boolean; - /** - * Is mailbox setup (Read-only) - */ - isMailboxSetup: boolean; - keywords: any; - /** - * Kind of resource this is. - */ - kind: string; - languages: any; - /** - * User's last login time. (Read-only) - */ - lastLoginTime: string; - locations: any; - /** - * User's name - */ - name: Schema$UserName; - /** - * List of non editable aliases (Read-only) - */ - nonEditableAliases: string[]; - notes: any; - organizations: any; - /** - * OrgUnit of User - */ - orgUnitPath: string; - /** - * User's password - */ - password: string; - phones: any; - posixAccounts: any; - /** - * username of User - */ - primaryEmail: string; - relations: any; - sshPublicKeys: any; - /** - * Indicates if user is suspended - */ - suspended: boolean; - /** - * Suspension reason if user is suspended (Read-only) - */ - suspensionReason: string; - /** - * ETag of the user's photo (Read-only) - */ - thumbnailPhotoEtag: string; - /** - * Photo Url of the user (Read-only) - */ - thumbnailPhotoUrl: string; - websites: any; -} -/** - * JSON template for About (notes) of a user in Directory API. - */ -export interface Schema$UserAbout { - /** - * About entry can have a type which indicates the content type. It can either - * be plain or html. By default, notes contents are assumed to contain plain - * text. - */ - contentType: string; - /** - * Actual value of notes. - */ - value: string; -} -/** - * JSON template for address. - */ -export interface Schema$UserAddress { - /** - * Country. - */ - country: string; - /** - * Country code. - */ - countryCode: string; - /** - * Custom type. - */ - customType: string; - /** - * Extended Address. - */ - extendedAddress: string; - /** - * Formatted address. - */ - formatted: string; - /** - * Locality. - */ - locality: string; - /** - * Other parts of address. - */ - poBox: string; - /** - * Postal code. - */ - postalCode: string; - /** - * If this is user's primary address. Only one entry could be marked as - * primary. - */ - primary: boolean; - /** - * Region. - */ - region: string; - /** - * User supplied address was structured. Structured addresses are NOT - * supported at this time. You might be able to write structured addresses, - * but any values will eventually be clobbered. - */ - sourceIsStructured: boolean; - /** - * Street. - */ - streetAddress: string; - /** - * Each entry can have a type which indicates standard values of that entry. - * For example address could be of home, work etc. In addition to the standard - * type, an entry can have a custom type and can take any value. Such type - * should have the CUSTOM value as type and also have a customType value. - */ - type: string; -} -/** - * JSON template for a set of custom properties (i.e. all fields in a particular - * schema) - */ -export interface Schema$UserCustomProperties {} -/** - * JSON template for an email. - */ -export interface Schema$UserEmail { - /** - * Email id of the user. - */ - address: string; - /** - * Custom Type. - */ - customType: string; - /** - * If this is user's primary email. Only one entry could be marked as - * primary. - */ - primary: boolean; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example email could be of home, work etc. In addition to the standard - * type, an entry can have a custom type and can take any value Such types - * should have the CUSTOM value as type and also have a customType value. - */ - type: string; -} -/** - * JSON template for an externalId entry. - */ -export interface Schema$UserExternalId { - /** - * Custom type. - */ - customType: string; - /** - * The type of the Id. - */ - type: string; - /** - * The value of the id. - */ - value: string; -} -export interface Schema$UserGender { - /** - * AddressMeAs. A human-readable string containing the proper way to refer to - * the profile owner by humans, for example "he/him/his" or - * "they/them/their". - */ - addressMeAs: string; - /** - * Custom gender. - */ - customGender: string; - /** - * Gender. - */ - type: string; -} -/** - * JSON template for instant messenger of an user. - */ -export interface Schema$UserIm { - /** - * Custom protocol. - */ - customProtocol: string; - /** - * Custom type. - */ - customType: string; - /** - * Instant messenger id. - */ - im: string; - /** - * If this is user's primary im. Only one entry could be marked as - * primary. - */ - primary: boolean; - /** - * Protocol used in the instant messenger. It should be one of the values from - * ImProtocolTypes map. Similar to type, it can take a CUSTOM value and - * specify the custom name in customProtocol field. - */ - protocol: string; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example instant messengers could be of home, work etc. In addition to - * the standard type, an entry can have a custom type and can take any value. - * Such types should have the CUSTOM value as type and also have a customType - * value. - */ - type: string; -} -/** - * JSON template for a keyword entry. - */ -export interface Schema$UserKeyword { - /** - * Custom Type. - */ - customType: string; - /** - * Each entry can have a type which indicates standard type of that entry. For - * example, keyword could be of type occupation or outlook. In addition to the - * standard type, an entry can have a custom type and can give it any name. - * Such types should have the CUSTOM value as type and also have a customType - * value. - */ - type: string; - /** - * Keyword. - */ - value: string; -} -/** - * JSON template for a language entry. - */ -export interface Schema$UserLanguage { - /** - * Other language. User can provide own language name if there is no - * corresponding Google III language code. If this is set LanguageCode - * can't be set - */ - customLanguage: string; - /** - * Language Code. Should be used for storing Google III LanguageCode string - * representation for language. Illegal values cause SchemaException. - */ - languageCode: string; -} -/** - * JSON template for a location entry. - */ -export interface Schema$UserLocation { - /** - * Textual location. This is most useful for display purposes to concisely - * describe the location. For example, "Mountain View, CA", - * "Near Seattle", "US-NYC-9TH 9A209A". - */ - area: string; - /** - * Building Identifier. - */ - buildingId: string; - /** - * Custom Type. - */ - customType: string; - /** - * Most specific textual code of individual desk location. - */ - deskCode: string; - /** - * Floor name/number. - */ - floorName: string; - /** - * Floor section. More specific location within the floor. For example, if a - * floor is divided into sections "A", "B", and - * "C", this field would identify one of those values. - */ - floorSection: string; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example location could be of types default and desk. In addition to - * standard type, an entry can have a custom type and can give it any name. - * Such types should have "custom" as type and also have a - * customType value. - */ - type: string; -} -/** - * JSON request template for setting/revoking admin status of a user in - * Directory API. - */ -export interface Schema$UserMakeAdmin { - /** - * Boolean indicating new admin status of the user - */ - status: boolean; -} -/** - * JSON template for name of a user in Directory API. - */ -export interface Schema$UserName { - /** - * Last Name - */ - familyName: string; - /** - * Full Name - */ - fullName: string; - /** - * First Name - */ - givenName: string; -} -/** - * JSON template for an organization entry. - */ -export interface Schema$UserOrganization { - /** - * The cost center of the users department. - */ - costCenter: string; - /** - * Custom type. - */ - customType: string; - /** - * Department within the organization. - */ - department: string; - /** - * Description of the organization. - */ - description: string; - /** - * The domain to which the organization belongs to. - */ - domain: string; - /** - * The full-time equivalent percent within the organization (100000 = 100%). - */ - fullTimeEquivalent: number; - /** - * Location of the organization. This need not be fully qualified address. - */ - location: string; - /** - * Name of the organization - */ - name: string; - /** - * If it user's primary organization. - */ - primary: boolean; - /** - * Symbol of the organization. - */ - symbol: string; - /** - * Title (designation) of the user in the organization. - */ - title: string; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example organization could be of school, work etc. In addition to the - * standard type, an entry can have a custom type and can give it any name. - * Such types should have the CUSTOM value as type and also have a CustomType - * value. - */ - type: string; -} -/** - * JSON template for a phone entry. - */ -export interface Schema$UserPhone { - /** - * Custom Type. - */ - customType: string; - /** - * If this is user's primary phone or not. - */ - primary: boolean; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example phone could be of home_fax, work, mobile etc. In addition to - * the standard type, an entry can have a custom type and can give it any - * name. Such types should have the CUSTOM value as type and also have a - * customType value. - */ - type: string; - /** - * Phone number. - */ - value: string; -} -/** - * JSON template for Photo object in Directory API. - */ -export interface Schema$UserPhoto { - /** - * ETag of the resource. - */ - etag: string; - /** - * Height in pixels of the photo - */ - height: number; - /** - * Unique identifier of User (Read-only) - */ - id: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Mime Type of the photo - */ - mimeType: string; - /** - * Base64 encoded photo data - */ - photoData: string; - /** - * Primary email of User (Read-only) - */ - primaryEmail: string; - /** - * Width in pixels of the photo - */ - width: number; -} -/** - * JSON template for a POSIX account entry. Description of the field family: - * go/fbs-posix. - */ -export interface Schema$UserPosixAccount { - /** - * A POSIX account field identifier. (Read-only) - */ - accountId: string; - /** - * The GECOS (user information) for this account. - */ - gecos: string; - /** - * The default group ID. - */ - gid: string; - /** - * The path to the home directory for this account. - */ - homeDirectory: string; - /** - * If this is user's primary account within the SystemId. - */ - primary: boolean; - /** - * The path to the login shell for this account. - */ - shell: string; - /** - * System identifier for which account Username or Uid apply to. - */ - systemId: string; - /** - * The POSIX compliant user ID. - */ - uid: string; - /** - * The username of the account. - */ - username: string; -} -/** - * JSON template for a relation entry. - */ -export interface Schema$UserRelation { - /** - * Custom Type. - */ - customType: string; - /** - * The relation of the user. Some of the possible values are mother, father, - * sister, brother, manager, assistant, partner. - */ - type: string; - /** - * The name of the relation. - */ - value: string; -} -/** - * JSON response template for List Users operation in Apps Directory API. - */ -export interface Schema$Users { - /** - * ETag of the resource. - */ - etag: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Token used to access next page of this result. - */ - nextPageToken: string; - /** - * Event that triggered this response (only used in case of Push Response) - */ - trigger_event: string; - /** - * List of user objects. - */ - users: Schema$User[]; -} -/** - * JSON template for a POSIX account entry. - */ -export interface Schema$UserSshPublicKey { - /** - * An expiration time in microseconds since epoch. - */ - expirationTimeUsec: string; - /** - * A SHA-256 fingerprint of the SSH public key. (Read-only) - */ - fingerprint: string; - /** - * An SSH public key. - */ - key: string; -} -/** - * JSON request template to undelete a user in Directory API. - */ -export interface Schema$UserUndelete { - /** - * OrgUnit of User - */ - orgUnitPath: string; -} -/** - * JSON template for a website entry. - */ -export interface Schema$UserWebsite { - /** - * Custom Type. - */ - customType: string; - /** - * If this is user's primary website or not. - */ - primary: boolean; - /** - * Each entry can have a type which indicates standard types of that entry. - * For example website could be of home, work, blog etc. In addition to the - * standard type, an entry can have a custom type and can give it any name. - * Such types should have the CUSTOM value as type and also have a customType - * value. - */ - type: string; - /** - * Website. - */ - value: string; -} -/** - * JSON template for verification codes in Directory API. - */ -export interface Schema$VerificationCode { - /** - * ETag of the resource. - */ - etag: string; - /** - * The type of the resource. This is always admin#directory#verificationCode. - */ - kind: string; - /** - * The obfuscated unique ID of the user. - */ - userId: string; - /** - * A current verification code for the user. Invalidated or used verification - * codes are not returned as part of the result. - */ - verificationCode: string; -} -/** - * JSON response template for List verification codes operation in Directory - * API. - */ -export interface Schema$VerificationCodes { - /** - * ETag of the resource. - */ - etag: string; - /** - * A list of verification code resources. - */ - items: Schema$VerificationCode[]; - /** - * The type of the resource. This is always - * admin#directory#verificationCodesList. - */ - kind: string; -} - -export class Resource$Asps { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.asps.delete - * @desc Delete an ASP issued by a user. - * @alias directory.asps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.codeId The unique ID of the ASP to be deleted. - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/asps/{codeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userKey', 'codeId'], - pathParams: ['codeId', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.asps.get - * @desc Get information about an ASP issued by a user. - * @alias directory.asps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.codeId The unique ID of the ASP. - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/asps/{codeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey', 'codeId'], - pathParams: ['codeId', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.asps.list - * @desc List the ASPs issued by a user. - * @alias directory.asps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/asps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * admin.channels.stop - * @desc Stop watching resources through this channel - * @alias admin.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/admin/directory_v1/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Chromeosdevices { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.chromeosdevices.action - * @desc Take action on Chrome OS Device - * @alias directory.chromeosdevices.action - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.resourceId Immutable ID of Chrome OS Device - * @param {().ChromeOsDeviceAction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - action(params?: any, options?: MethodOptions): AxiosPromise; - action( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - action( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'resourceId'], - pathParams: ['customerId', 'resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.chromeosdevices.get - * @desc Retrieve Chrome OS Device - * @alias directory.chromeosdevices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.deviceId Immutable ID of Chrome OS Device - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId', 'deviceId'], - pathParams: ['customerId', 'deviceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.chromeosdevices.list - * @desc Retrieve all Chrome OS Devices of a customer (paginated) - * @alias directory.chromeosdevices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100 - * @param {string=} params.orderBy Column to use for sorting results - * @param {string=} params.orgUnitPath Full path of the organizational unit or its ID - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string=} params.query Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=1698333 - * @param {string=} params.sortOrder Whether to return results in ascending or descending order. Only of use when orderBy is also used - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.chromeosdevices.moveDevicesToOu - * @desc Move or insert multiple Chrome OS Devices to organizational unit - * @alias directory.chromeosdevices.moveDevicesToOu - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.orgUnitPath Full path of the target organizational unit or its ID - * @param {().ChromeOsMoveDevicesToOu} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveDevicesToOu(params?: any, options?: MethodOptions): AxiosPromise; - moveDevicesToOu( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveDevicesToOu( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'orgUnitPath'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.chromeosdevices.patch - * @desc Update Chrome OS Device. This method supports patch semantics. - * @alias directory.chromeosdevices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.deviceId Immutable ID of Chrome OS Device - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {().ChromeOsDevice} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customerId', 'deviceId'], - pathParams: ['customerId', 'deviceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.chromeosdevices.update - * @desc Update Chrome OS Device - * @alias directory.chromeosdevices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.deviceId Immutable ID of Chrome OS Device - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {().ChromeOsDevice} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customerId', 'deviceId'], - pathParams: ['customerId', 'deviceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Customers { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.customers.get - * @desc Retrieves a customer. - * @alias directory.customers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerKey Id of the customer to be retrieved - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerKey'], - pathParams: ['customerKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.customers.patch - * @desc Updates a customer. This method supports patch semantics. - * @alias directory.customers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerKey Id of the customer to be updated - * @param {().Customer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customerKey'], - pathParams: ['customerKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.customers.update - * @desc Updates a customer. - * @alias directory.customers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerKey Id of the customer to be updated - * @param {().Customer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customerKey'], - pathParams: ['customerKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Domainaliases { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.domainAliases.delete - * @desc Deletes a Domain Alias of the customer. - * @alias directory.domainAliases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.domainAliasName Name of domain alias to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'domainAliasName'], - pathParams: ['customer', 'domainAliasName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domainAliases.get - * @desc Retrieves a domain alias of the customer. - * @alias directory.domainAliases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.domainAliasName Name of domain alias to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'domainAliasName'], - pathParams: ['customer', 'domainAliasName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domainAliases.insert - * @desc Inserts a Domain alias of the customer. - * @alias directory.domainAliases.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {().DomainAlias} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/domainaliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domainAliases.list - * @desc Lists the domain aliases of the customer. - * @alias directory.domainAliases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string=} params.parentDomainName Name of the parent domain for which domain aliases are to be fetched. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/domainaliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Domains { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.domains.delete - * @desc Deletes a domain of the customer. - * @alias directory.domains.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.domainName Name of domain to be deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/domains/{domainName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'domainName'], - pathParams: ['customer', 'domainName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domains.get - * @desc Retrieves a domain of the customer. - * @alias directory.domains.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.domainName Name of domain to be retrieved - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/domains/{domainName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'domainName'], - pathParams: ['customer', 'domainName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domains.insert - * @desc Inserts a domain of the customer. - * @alias directory.domains.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {().Domains} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customer}/domains') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.domains.list - * @desc Lists the domains of the customer. - * @alias directory.domains.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customer}/domains') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Groups { - root: Admin; - aliases: Resource$Groups$Aliases; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - this.aliases = new Resource$Groups$Aliases(root); - } - - getRoot() { - return this.root; - } - - - /** - * directory.groups.delete - * @desc Delete Group - * @alias directory.groups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.get - * @desc Retrieve Group - * @alias directory.groups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.insert - * @desc Create Group - * @alias directory.groups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.list - * @desc Retrieve all groups in a domain (paginated) - * @alias directory.groups.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. - * @param {string=} params.domain Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead. - * @param {integer=} params.maxResults Maximum number of results to return. Default is 200 - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.userKey Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If ID, it should match with id of user object - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.patch - * @desc Update Group. This method supports patch semantics. - * @alias directory.groups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.update - * @desc Update Group - * @alias directory.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Groups$Aliases { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.groups.aliases.delete - * @desc Remove a alias for the group - * @alias directory.groups.aliases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.alias The alias to be removed - * @param {string} params.groupKey Email or immutable ID of the group - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/aliases/{alias}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['groupKey', 'alias'], - pathParams: ['alias', 'groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.aliases.insert - * @desc Add a alias for the group - * @alias directory.groups.aliases.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {().Alias} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.groups.aliases.list - * @desc List all aliases for a group - * @alias directory.groups.aliases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Members { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.members.delete - * @desc Remove membership. - * @alias directory.members.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {string} params.memberKey Email or immutable ID of the member - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['groupKey', 'memberKey'], - pathParams: ['groupKey', 'memberKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.get - * @desc Retrieve Group Member - * @alias directory.members.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {string} params.memberKey Email or immutable ID of the member - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupKey', 'memberKey'], - pathParams: ['groupKey', 'memberKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.hasMember - * @desc Checks whether the given user is a member of the group. Membership - * can be direct or nested. - * @alias directory.members.hasMember - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. - * @param {string} params.memberKey Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - hasMember(params?: any, options?: MethodOptions): - AxiosPromise; - hasMember( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - hasMember( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupKey', 'memberKey'], - pathParams: ['groupKey', 'memberKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.insert - * @desc Add user to the specified group. - * @alias directory.members.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {().Member} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/members') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.list - * @desc Retrieve all members in a group (paginated) - * @alias directory.members.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group - * @param {integer=} params.maxResults Maximum number of results to return. Default is 200 - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.roles Comma separated role values to filter list results on. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/members') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupKey'], - pathParams: ['groupKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.patch - * @desc Update membership of a user in the specified group. This method - * supports patch semantics. - * @alias directory.members.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object - * @param {string} params.memberKey Email or immutable ID of the user. If ID, it should match with id of member object - * @param {().Member} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['groupKey', 'memberKey'], - pathParams: ['groupKey', 'memberKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.members.update - * @desc Update membership of a user in the specified group. - * @alias directory.members.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object - * @param {string} params.memberKey Email or immutable ID of the user. If ID, it should match with id of member object - * @param {().Member} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['groupKey', 'memberKey'], - pathParams: ['groupKey', 'memberKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Mobiledevices { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.mobiledevices.action - * @desc Take action on Mobile Device - * @alias directory.mobiledevices.action - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.resourceId Immutable ID of Mobile Device - * @param {().MobileDeviceAction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - action(params?: any, options?: MethodOptions): AxiosPromise; - action( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - action( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'resourceId'], - pathParams: ['customerId', 'resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.mobiledevices.delete - * @desc Delete Mobile Device - * @alias directory.mobiledevices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.resourceId Immutable ID of Mobile Device - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customerId', 'resourceId'], - pathParams: ['customerId', 'resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.mobiledevices.get - * @desc Retrieve Mobile Device - * @alias directory.mobiledevices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string} params.resourceId Immutable ID of Mobile Device - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId', 'resourceId'], - pathParams: ['customerId', 'resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.mobiledevices.list - * @desc Retrieve all Mobile Devices of a customer (paginated) - * @alias directory.mobiledevices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100 - * @param {string=} params.orderBy Column to use for sorting results - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string=} params.query Search string in the format given at http://support.google.com/a/bin/answer.py?hl=en&answer=1408863#search - * @param {string=} params.sortOrder Whether to return results in ascending or descending order. Only of use when orderBy is also used - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customerId}/devices/mobile') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Notifications { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.notifications.delete - * @desc Deletes a notification - * @alias directory.notifications.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. - * @param {string} params.notificationId The unique ID of the notification. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'notificationId'], - pathParams: ['customer', 'notificationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.notifications.get - * @desc Retrieves a notification. - * @alias directory.notifications.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. - * @param {string} params.notificationId The unique ID of the notification. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'notificationId'], - pathParams: ['customer', 'notificationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.notifications.list - * @desc Retrieves a list of notifications. - * @alias directory.notifications.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. - * @param {string=} params.language The ISO 639-1 code of the language notifications are returned in. The default is English (en). - * @param {integer=} params.maxResults Maximum number of notifications to return per page. The default is 100. - * @param {string=} params.pageToken The token to specify the page of results to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/notifications') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.notifications.patch - * @desc Updates a notification. This method supports patch semantics. - * @alias directory.notifications.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. - * @param {string} params.notificationId The unique ID of the notification. - * @param {().Notification} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customer', 'notificationId'], - pathParams: ['customer', 'notificationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.notifications.update - * @desc Updates a notification. - * @alias directory.notifications.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. - * @param {string} params.notificationId The unique ID of the notification. - * @param {().Notification} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customer', 'notificationId'], - pathParams: ['customer', 'notificationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Orgunits { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.orgunits.delete - * @desc Remove organizational unit - * @alias directory.orgunits.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.orgUnitPath Full path of the organizational unit or its ID - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customerId', 'orgUnitPath'], - pathParams: ['customerId', 'orgUnitPath'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.orgunits.get - * @desc Retrieve organizational unit - * @alias directory.orgunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.orgUnitPath Full path of the organizational unit or its ID - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId', 'orgUnitPath'], - pathParams: ['customerId', 'orgUnitPath'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.orgunits.insert - * @desc Add organizational unit - * @alias directory.orgunits.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {().OrgUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/admin/directory/v1/customer/{customerId}/orgunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.orgunits.list - * @desc Retrieve all organizational units - * @alias directory.orgunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string=} params.orgUnitPath the URL-encoded organizational unit's path or its ID - * @param {string=} params.type Whether to return all sub-organizations or just immediate children - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/admin/directory/v1/customer/{customerId}/orgunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.orgunits.patch - * @desc Update organizational unit. This method supports patch semantics. - * @alias directory.orgunits.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.orgUnitPath Full path of the organizational unit or its ID - * @param {().OrgUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customerId', 'orgUnitPath'], - pathParams: ['customerId', 'orgUnitPath'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.orgunits.update - * @desc Update organizational unit - * @alias directory.orgunits.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.orgUnitPath Full path of the organizational unit or its ID - * @param {().OrgUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customerId', 'orgUnitPath'], - pathParams: ['customerId', 'orgUnitPath'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Privileges { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.privileges.list - * @desc Retrieves a paginated list of all privileges for a customer. - * @alias directory.privileges.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/roles/ALL/privileges') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Resolvedappaccesssettings { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.resolvedAppAccessSettings.GetSettings - * @desc Retrieves resolved app access settings of the logged in user. - * @alias directory.resolvedAppAccessSettings.GetSettings - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - GetSettings(params?: any, options?: MethodOptions): - AxiosPromise; - GetSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - GetSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/resolvedappaccesssettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resolvedAppAccessSettings.ListTrustedApps - * @desc Retrieves the list of apps trusted by the admin of the logged in - * user. - * @alias directory.resolvedAppAccessSettings.ListTrustedApps - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - ListTrustedApps(params?: any, options?: MethodOptions): - AxiosPromise; - ListTrustedApps( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - ListTrustedApps( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/trustedapps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Resources { - root: Admin; - buildings: Resource$Resources$Buildings; - calendars: Resource$Resources$Calendars; - features: Resource$Resources$Features; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - this.buildings = new Resource$Resources$Buildings(root); - this.calendars = new Resource$Resources$Calendars(root); - this.features = new Resource$Resources$Features(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Resources$Buildings { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.resources.buildings.delete - * @desc Deletes a building. - * @alias directory.resources.buildings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.buildingId The ID of the building to delete. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'buildingId'], - pathParams: ['buildingId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.buildings.get - * @desc Retrieves a building. - * @alias directory.resources.buildings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.buildingId The unique ID of the building to retrieve. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'buildingId'], - pathParams: ['buildingId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.buildings.insert - * @desc Inserts a building. - * @alias directory.resources.buildings.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().Building} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.buildings.list - * @desc Retrieves a list of buildings for an account. - * @alias directory.resources.buildings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.buildings.patch - * @desc Updates a building. This method supports patch semantics. - * @alias directory.resources.buildings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.buildingId The ID of the building to update. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().Building} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customer', 'buildingId'], - pathParams: ['buildingId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.buildings.update - * @desc Updates a building. - * @alias directory.resources.buildings.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.buildingId The ID of the building to update. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().Building} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customer', 'buildingId'], - pathParams: ['buildingId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Resources$Calendars { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.resources.calendars.delete - * @desc Deletes a calendar resource. - * @alias directory.resources.calendars.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarResourceId The unique ID of the calendar resource to delete. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'calendarResourceId'], - pathParams: ['calendarResourceId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.calendars.get - * @desc Retrieves a calendar resource. - * @alias directory.resources.calendars.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarResourceId The unique ID of the calendar resource to retrieve. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'calendarResourceId'], - pathParams: ['calendarResourceId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.calendars.insert - * @desc Inserts a calendar resource. - * @alias directory.resources.calendars.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().CalendarResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.calendars.list - * @desc Retrieves a list of calendar resources for an account. - * @alias directory.resources.calendars.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderBy Field(s) to sort results by in either ascending or descending order. Supported fields include resourceId, resourceName, capacity, buildingId, and floorName. If no order is specified, defaults to ascending. Should be of the form "field [asc|desc], field [asc|desc], ...". For example buildingId, capacity desc would return results sorted first by buildingId in ascending order then by capacity in descending order. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {string=} params.query String query used to filter results. Should be of the form "field operator value" where field can be any of supported fields and operators can be any of supported operations. Operators include '=' for exact match and ':' for prefix match or HAS match where applicable. For prefix match, the value should always be followed by a *. Supported fields include generatedResourceName, name, buildingId, featureInstances.feature.name. For example buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.calendars.patch - * @desc Updates a calendar resource. This method supports patch semantics, - * meaning you only need to include the fields you wish to update. Fields that - * are not present in the request will be preserved. This method supports - * patch semantics. - * @alias directory.resources.calendars.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarResourceId The unique ID of the calendar resource to update. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().CalendarResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customer', 'calendarResourceId'], - pathParams: ['calendarResourceId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.calendars.update - * @desc Updates a calendar resource. This method supports patch semantics, - * meaning you only need to include the fields you wish to update. Fields that - * are not present in the request will be preserved. - * @alias directory.resources.calendars.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarResourceId The unique ID of the calendar resource to update. - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().CalendarResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customer', 'calendarResourceId'], - pathParams: ['calendarResourceId', 'customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Resources$Features { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.resources.features.delete - * @desc Deletes a feature. - * @alias directory.resources.features.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {string} params.featureKey The unique ID of the feature to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'featureKey'], - pathParams: ['customer', 'featureKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.get - * @desc Retrieves a feature. - * @alias directory.resources.features.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {string} params.featureKey The unique ID of the feature to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'featureKey'], - pathParams: ['customer', 'featureKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.insert - * @desc Inserts a feature. - * @alias directory.resources.features.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {().Feature} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.list - * @desc Retrieves a list of features for an account. - * @alias directory.resources.features.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.patch - * @desc Updates a feature. This method supports patch semantics. - * @alias directory.resources.features.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {string} params.featureKey The unique ID of the feature to update. - * @param {().Feature} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customer', 'featureKey'], - pathParams: ['customer', 'featureKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.rename - * @desc Renames a feature. - * @alias directory.resources.features.rename - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {string} params.oldName The unique ID of the feature to rename. - * @param {().FeatureRename} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rename(params?: any, options?: MethodOptions): AxiosPromise; - rename( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rename( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer', 'oldName'], - pathParams: ['customer', 'oldName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.resources.features.update - * @desc Updates a feature. - * @alias directory.resources.features.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. - * @param {string} params.featureKey The unique ID of the feature to update. - * @param {().Feature} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customer', 'featureKey'], - pathParams: ['customer', 'featureKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Roleassignments { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.roleAssignments.delete - * @desc Deletes a role assignment. - * @alias directory.roleAssignments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleAssignmentId Immutable ID of the role assignment. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'roleAssignmentId'], - pathParams: ['customer', 'roleAssignmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roleAssignments.get - * @desc Retrieve a role assignment. - * @alias directory.roleAssignments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleAssignmentId Immutable ID of the role assignment. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'roleAssignmentId'], - pathParams: ['customer', 'roleAssignmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roleAssignments.insert - * @desc Creates a role assignment. - * @alias directory.roleAssignments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {().RoleAssignment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roleassignments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roleAssignments.list - * @desc Retrieves a paginated list of all roleAssignments. - * @alias directory.roleAssignments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {string=} params.roleId Immutable ID of a role. If included in the request, returns only role assignments containing this role ID. - * @param {string=} params.userKey The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roleassignments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Roles { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.roles.delete - * @desc Deletes a role. - * @alias directory.roles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleId Immutable ID of the role. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roles/{roleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customer', 'roleId'], - pathParams: ['customer', 'roleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roles.get - * @desc Retrieves a role. - * @alias directory.roles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleId Immutable ID of the role. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roles/{roleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer', 'roleId'], - pathParams: ['customer', 'roleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roles.insert - * @desc Creates a role. - * @alias directory.roles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {().Role} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customer}/roles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roles.list - * @desc Retrieves a paginated list of all the roles in a domain. - * @alias directory.roles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Token to specify the next page in the list. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customer}/roles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customer'], - pathParams: ['customer'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roles.patch - * @desc Updates a role. This method supports patch semantics. - * @alias directory.roles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleId Immutable ID of the role. - * @param {().Role} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roles/{roleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customer', 'roleId'], - pathParams: ['customer', 'roleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.roles.update - * @desc Updates a role. - * @alias directory.roles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customer Immutable ID of the G Suite account. - * @param {string} params.roleId Immutable ID of the role. - * @param {().Role} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/customer/{customer}/roles/{roleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customer', 'roleId'], - pathParams: ['customer', 'roleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Schemas { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.schemas.delete - * @desc Delete schema - * @alias directory.schemas.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.schemaKey Name or immutable ID of the schema - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customerId', 'schemaKey'], - pathParams: ['customerId', 'schemaKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.schemas.get - * @desc Retrieve schema - * @alias directory.schemas.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.schemaKey Name or immutable ID of the schema - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId', 'schemaKey'], - pathParams: ['customerId', 'schemaKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.schemas.insert - * @desc Create schema. - * @alias directory.schemas.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {().Schema} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customerId}/schemas') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.schemas.list - * @desc Retrieve all schemas for a customer - * @alias directory.schemas.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/customer/{customerId}/schemas') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.schemas.patch - * @desc Update schema. This method supports patch semantics. - * @alias directory.schemas.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.schemaKey Name or immutable ID of the schema. - * @param {().Schema} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customerId', 'schemaKey'], - pathParams: ['customerId', 'schemaKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.schemas.update - * @desc Update schema - * @alias directory.schemas.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Immutable ID of the G Suite account - * @param {string} params.schemaKey Name or immutable ID of the schema. - * @param {().Schema} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customerId', 'schemaKey'], - pathParams: ['customerId', 'schemaKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Tokens { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.tokens.delete - * @desc Delete all access tokens issued by a user for an application. - * @alias directory.tokens.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clientId The Client ID of the application the token is issued to. - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/tokens/{clientId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userKey', 'clientId'], - pathParams: ['clientId', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.tokens.get - * @desc Get information about an access token issued by a user. - * @alias directory.tokens.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clientId The Client ID of the application the token is issued to. - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/tokens/{clientId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey', 'clientId'], - pathParams: ['clientId', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.tokens.list - * @desc Returns the set of tokens specified user has issued to 3rd party - * applications. - * @alias directory.tokens.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/tokens') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users { - root: Admin; - aliases: Resource$Users$Aliases; - photos: Resource$Users$Photos; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - this.aliases = new Resource$Users$Aliases(root); - this.photos = new Resource$Users$Photos(root); - } - - getRoot() { - return this.root; - } - - - /** - * directory.users.delete - * @desc Delete user - * @alias directory.users.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.get - * @desc retrieve user - * @alias directory.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. - * @param {string=} params.projection What subset of fields to fetch for this user. - * @param {string} params.userKey Email or immutable ID of the user - * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.insert - * @desc create user. - * @alias directory.users.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.list - * @desc Retrieve either deleted users or all users in a domain (paginated) - * @alias directory.users.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. - * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. - * @param {string=} params.domain Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. - * @param {string=} params.event Event on which subscription is intended (if subscribing) - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. Max allowed is 500 - * @param {string=} params.orderBy Column to use for sorting results - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.projection What subset of fields to fetch for this user. - * @param {string=} params.query Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users - * @param {string=} params.showDeleted If set to true retrieves the list of deleted users. Default is false - * @param {string=} params.sortOrder Whether to return results in ascending or descending order. - * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.makeAdmin - * @desc change admin status of a user - * @alias directory.users.makeAdmin - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user as admin - * @param {().UserMakeAdmin} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - makeAdmin(params?: any, options?: MethodOptions): AxiosPromise; - makeAdmin( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - makeAdmin( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/makeAdmin') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.patch - * @desc update user. This method supports patch semantics. - * @alias directory.users.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user. If ID, it should match with id of user object - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.undelete - * @desc Undelete a deleted user - * @alias directory.users.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey The immutable id of the user - * @param {().UserUndelete} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.update - * @desc update user - * @alias directory.users.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user. If ID, it should match with id of user object - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.watch - * @desc Watch for changes in users list - * @alias directory.users.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. - * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. - * @param {string=} params.domain Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. - * @param {string=} params.event Event on which subscription is intended (if subscribing) - * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. Max allowed is 500 - * @param {string=} params.orderBy Column to use for sorting results - * @param {string=} params.pageToken Token to specify next page in the list - * @param {string=} params.projection What subset of fields to fetch for this user. - * @param {string=} params.query Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users - * @param {string=} params.showDeleted If set to true retrieves the list of deleted users. Default is false - * @param {string=} params.sortOrder Whether to return results in ascending or descending order. - * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Aliases { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.users.aliases.delete - * @desc Remove a alias for the user - * @alias directory.users.aliases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.alias The alias to be removed - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/aliases/{alias}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userKey', 'alias'], - pathParams: ['alias', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.aliases.insert - * @desc Add a alias for the user - * @alias directory.users.aliases.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {().Alias} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.aliases.list - * @desc List all aliases for a user - * @alias directory.users.aliases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.event Event on which subscription is intended (if subscribing) - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.aliases.watch - * @desc Watch for changes in user aliases list - * @alias directory.users.aliases.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.event Event on which subscription is intended (if subscribing) - * @param {string} params.userKey Email or immutable ID of the user - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/directory/v1/users/{userKey}/aliases/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users$Photos { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * directory.users.photos.delete - * @desc Remove photos for the user - * @alias directory.users.photos.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/photos/thumbnail') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.photos.get - * @desc Retrieve photo of a user - * @alias directory.users.photos.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/photos/thumbnail') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.photos.patch - * @desc Add a photo for the user. This method supports patch semantics. - * @alias directory.users.photos.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {().UserPhoto} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/photos/thumbnail') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.users.photos.update - * @desc Add a photo for the user - * @alias directory.users.photos.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {().UserPhoto} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/photos/thumbnail') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Verificationcodes { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace admin_directory_v1 { /** - * directory.verificationCodes.generate - * @desc Generate new backup verification codes for the user. - * @alias directory.verificationCodes.generate - * @memberOf! () + * Admin Directory API * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/users/{userKey}/verificationCodes/generate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.verificationCodes.invalidate - * @desc Invalidate the current backup verification codes for the user. - * @alias directory.verificationCodes.invalidate - * @memberOf! () + * The Admin SDK Directory API lets you view and manage enterprise resources + * such as users and groups, administrative notifications, security features, + * and more. * - * @param {object} params Parameters for request - * @param {string} params.userKey Email or immutable ID of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - invalidate(params?: any, options?: MethodOptions): AxiosPromise; - invalidate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - invalidate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/directory/v1/users/{userKey}/verificationCodes/invalidate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * directory.verificationCodes.list - * @desc Returns the current set of valid backup verification codes for the - * specified user. - * @alias directory.verificationCodes.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const admin = google.admin('directory_v1'); * - * @param {object} params Parameters for request - * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/directory/v1/users/{userKey}/verificationCodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey'], - pathParams: ['userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace admin + * @type {Function} + * @version directory_v1 + * @variation directory_v1 + * @param {object=} options Options for Admin + */ + export class Admin { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + asps: Resource$Asps; + channels: Resource$Channels; + chromeosdevices: Resource$Chromeosdevices; + customers: Resource$Customers; + domainAliases: Resource$Domainaliases; + domains: Resource$Domains; + groups: Resource$Groups; + members: Resource$Members; + mobiledevices: Resource$Mobiledevices; + notifications: Resource$Notifications; + orgunits: Resource$Orgunits; + privileges: Resource$Privileges; + resolvedAppAccessSettings: Resource$Resolvedappaccesssettings; + resources: Resource$Resources; + roleAssignments: Resource$Roleassignments; + roles: Resource$Roles; + schemas: Resource$Schemas; + tokens: Resource$Tokens; + users: Resource$Users; + verificationCodes: Resource$Verificationcodes; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.asps = new Resource$Asps(this); + this.channels = new Resource$Channels(this); + this.chromeosdevices = new Resource$Chromeosdevices(this); + this.customers = new Resource$Customers(this); + this.domainAliases = new Resource$Domainaliases(this); + this.domains = new Resource$Domains(this); + this.groups = new Resource$Groups(this); + this.members = new Resource$Members(this); + this.mobiledevices = new Resource$Mobiledevices(this); + this.notifications = new Resource$Notifications(this); + this.orgunits = new Resource$Orgunits(this); + this.privileges = new Resource$Privileges(this); + this.resolvedAppAccessSettings = + new Resource$Resolvedappaccesssettings(this); + this.resources = new Resource$Resources(this); + this.roleAssignments = new Resource$Roleassignments(this); + this.roles = new Resource$Roles(this); + this.schemas = new Resource$Schemas(this); + this.tokens = new Resource$Tokens(this); + this.users = new Resource$Users(this); + this.verificationCodes = new Resource$Verificationcodes(this); + } + + getRoot() { + return this.root; + } + } + + /** + * JSON template for Alias object in Directory API. + */ + export interface Schema$Alias { + /** + * A alias email + */ + alias: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Unique id of the group (Read-only) Unique id of the user (Read-only) + */ + id: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Group's primary email (Read-only) User's primary email + * (Read-only) + */ + primaryEmail: string; + } + /** + * JSON response template to list aliases in Directory API. + */ + export interface Schema$Aliases { + /** + * List of alias objects. + */ + aliases: any[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + } + /** + * JSON template for App Access Collections Resource object in Directory API. + */ + export interface Schema$AppAccessCollections { + /** + * List of blocked api access buckets. + */ + blockedApiAccessBuckets: string[]; + /** + * Boolean to indicate whether to enforce app access settings on Android + * Drive or not. + */ + enforceSettingsForAndroidDrive: boolean; + /** + * Error message provided by the Admin that will be shown to the user when + * an app is blocked. + */ + errorMessage: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifies the resource as an app access collection. Value: + * admin#directory#appaccesscollection + */ + kind: string; + /** + * Unique ID of app access collection. (Readonly) + */ + resourceId: string; + /** + * Resource name given by the customer while creating/updating. Should be + * unique under given customer. + */ + resourceName: string; + /** + * Boolean that indicates whether to trust domain owned apps. + */ + trustDomainOwnedApps: boolean; + } + /** + * The template that returns individual ASP (Access Code) data. + */ + export interface Schema$Asp { + /** + * The unique ID of the ASP. + */ + codeId: number; + /** + * The time when the ASP was created. Expressed in Unix time format. + */ + creationTime: string; + /** + * ETag of the ASP. + */ + etag: string; + /** + * The type of the API resource. This is always admin#directory#asp. + */ + kind: string; + /** + * The time when the ASP was last used. Expressed in Unix time format. + */ + lastTimeUsed: string; + /** + * The name of the application that the user, represented by their userId, + * entered when the ASP was created. + */ + name: string; + /** + * The unique ID of the user who issued the ASP. + */ + userKey: string; + } + export interface Schema$Asps { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of ASP resources. + */ + items: Schema$Asp[]; + /** + * The type of the API resource. This is always admin#directory#aspList. + */ + kind: string; + } + /** + * JSON template for Building object in Directory API. + */ + export interface Schema$Building { + /** + * Unique identifier for the building. The maximum length is 100 characters. + */ + buildingId: string; + /** + * The building name as seen by users in Calendar. Must be unique for the + * customer. For example, "NYC-CHEL". The maximum length is 100 + * characters. + */ + buildingName: string; + /** + * The geographic coordinates of the center of the building, expressed as + * latitude and longitude in decimal degrees. + */ + coordinates: Schema$BuildingCoordinates; + /** + * A brief description of the building. For example, "Chelsea + * Market". + */ + description: string; + /** + * ETag of the resource. + */ + etags: string; + /** + * The display names for all floors in this building. The floors are + * expected to be sorted in ascending order, from lowest floor to highest + * floor. For example, ["B2", "B1", "L", + * "1", "2", "2M", "3", + * "PH"] Must contain at least one entry. + */ + floorNames: string[]; + /** + * Kind of resource this is. + */ + kind: string; + } + /** + * JSON template for coordinates of a building in Directory API. + */ + export interface Schema$BuildingCoordinates { + /** + * Latitude in decimal degrees. + */ + latitude: number; + /** + * Longitude in decimal degrees. + */ + longitude: number; + } + /** + * JSON template for Building List Response object in Directory API. + */ + export interface Schema$Buildings { + /** + * The Buildings in this page of results. + */ + buildings: Schema$Building[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + } + /** + * JSON template for Calendar Resource object in Directory API. + */ + export interface Schema$CalendarResource { + /** + * Unique ID for the building a resource is located in. + */ + buildingId: string; + /** + * Capacity of a resource, number of seats in a room. + */ + capacity: number; + /** + * ETag of the resource. + */ + etags: string; + featureInstances: any; + /** + * Name of the floor a resource is located on. + */ + floorName: string; + /** + * Name of the section within a floor a resource is located in. + */ + floorSection: string; + /** + * The read-only auto-generated name of the calendar resource which includes + * metadata about the resource such as building name, floor, capacity, etc. + * For example, "NYC-2-Training Room 1A (16)". + */ + generatedResourceName: string; + /** + * The type of the resource. For calendar resources, the value is + * admin#directory#resources#calendars#CalendarResource. + */ + kind: string; + /** + * The category of the calendar resource. Either CONFERENCE_ROOM or OTHER. + * Legacy data is set to CATEGORY_UNKNOWN. + */ + resourceCategory: string; + /** + * Description of the resource, visible only to admins. + */ + resourceDescription: string; + /** + * The read-only email for the calendar resource. Generated as part of + * creating a new calendar resource. + */ + resourceEmail: string; + /** + * The unique ID for the calendar resource. + */ + resourceId: string; + /** + * The name of the calendar resource. For example, "Training Room + * 1A". + */ + resourceName: string; + /** + * The type of the calendar resource, intended for non-room resources. + */ + resourceType: string; + /** + * Description of the resource, visible to users and admins. + */ + userVisibleDescription: string; + } + /** + * JSON template for Calendar Resource List Response object in Directory API. + */ + export interface Schema$CalendarResources { + /** + * ETag of the resource. + */ + etag: string; + /** + * The CalendarResources in this page of results. + */ + items: Schema$CalendarResource[]; + /** + * Identifies this as a collection of CalendarResources. This is always + * admin#directory#resources#calendars#calendarResourcesList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + } + /** + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; + } + /** + * JSON template for Chrome Os Device resource in Directory API. + */ + export interface Schema$ChromeOsDevice { + /** + * List of active time ranges (Read-only) + */ + activeTimeRanges: any[]; + /** + * AssetId specified during enrollment or through later annotation + */ + annotatedAssetId: string; + /** + * Address or location of the device as noted by the administrator + */ + annotatedLocation: string; + /** + * User of the device + */ + annotatedUser: string; + /** + * Chromebook boot mode (Read-only) + */ + bootMode: string; + /** + * List of device files to download (Read-only) + */ + deviceFiles: any[]; + /** + * Unique identifier of Chrome OS Device (Read-only) + */ + deviceId: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Chromebook Mac Address on ethernet network interface (Read-only) + */ + ethernetMacAddress: string; + /** + * Chromebook firmware version (Read-only) + */ + firmwareVersion: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Date and time the device was last enrolled (Read-only) + */ + lastEnrollmentTime: string; + /** + * Date and time the device was last synchronized with the policy settings + * in the G Suite administrator control panel (Read-only) + */ + lastSync: string; + /** + * Chromebook Mac Address on wifi network interface (Read-only) + */ + macAddress: string; + /** + * Mobile Equipment identifier for the 3G mobile card in the Chromebook + * (Read-only) + */ + meid: string; + /** + * Chromebook Model (Read-only) + */ + model: string; + /** + * Notes added by the administrator + */ + notes: string; + /** + * Chromebook order number (Read-only) + */ + orderNumber: string; + /** + * OrgUnit of the device + */ + orgUnitPath: string; + /** + * Chromebook Os Version (Read-only) + */ + osVersion: string; + /** + * Chromebook platform version (Read-only) + */ + platformVersion: string; + /** + * List of recent device users, in descending order by last login time + * (Read-only) + */ + recentUsers: any[]; + /** + * Chromebook serial number (Read-only) + */ + serialNumber: string; + /** + * status of the device (Read-only) + */ + status: string; + /** + * Final date the device will be supported (Read-only) + */ + supportEndDate: string; + /** + * Trusted Platform Module (TPM) (Read-only) + */ + tpmVersionInfo: any; + /** + * Will Chromebook auto renew after support end date (Read-only) + */ + willAutoRenew: boolean; + } + /** + * JSON request template for firing actions on ChromeOs Device in Directory + * Devices API. + */ + export interface Schema$ChromeOsDeviceAction { + /** + * Action to be taken on the ChromeOs Device + */ + action: string; + deprovisionReason: string; + } + /** + * JSON response template for List Chrome OS Devices operation in Directory + * API. + */ + export interface Schema$ChromeOsDevices { + /** + * List of Chrome OS Device objects. + */ + chromeosdevices: Schema$ChromeOsDevice[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Token used to access next page of this result. + */ + nextPageToken: string; + } + /** + * JSON request template for moving ChromeOs Device to given OU in Directory + * Devices API. + */ + export interface Schema$ChromeOsMoveDevicesToOu { + /** + * ChromeOs Devices to be moved to OU + */ + deviceIds: string[]; + } + /** + * JSON template for Customer Resource object in Directory API. + */ + export interface Schema$Customer { + /** + * The customer's secondary contact email address. This email address + * cannot be on the same domain as the customerDomain + */ + alternateEmail: string; + /** + * The customer's creation time (Readonly) + */ + customerCreationTime: string; + /** + * The customer's primary domain name string. Do not include the www + * prefix when creating a new customer. + */ + customerDomain: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * The unique ID for the customer's G Suite account. (Readonly) + */ + id: string; + /** + * Identifies the resource as a customer. Value: admin#directory#customer + */ + kind: string; + /** + * The customer's ISO 639-2 language code. The default value is en-US + */ + language: string; + /** + * The customer's contact phone number in E.164 format. + */ + phoneNumber: string; + /** + * The customer's postal address information. + */ + postalAddress: Schema$CustomerPostalAddress; + } + /** + * JSON template for postal address of a customer. + */ + export interface Schema$CustomerPostalAddress { + /** + * A customer's physical address. The address can be composed of one to + * three lines. + */ + addressLine1: string; + /** + * Address line 2 of the address. + */ + addressLine2: string; + /** + * Address line 3 of the address. + */ + addressLine3: string; + /** + * The customer contact's name. + */ + contactName: string; + /** + * This is a required property. For countryCode information see the ISO 3166 + * country code elements. + */ + countryCode: string; + /** + * Name of the locality. An example of a locality value is the city of San + * Francisco. + */ + locality: string; + /** + * The company or company division name. + */ + organizationName: string; + /** + * The postal code. A postalCode example is a postal zip code such as 10009. + * This is in accordance with - + * http://portablecontacts.net/draft-spec.html#address_element. + */ + postalCode: string; + /** + * Name of the region. An example of a region value is NY for the state of + * New York. + */ + region: string; + } + /** + * JSON template for Domain Alias object in Directory API. + */ + export interface Schema$DomainAlias { + /** + * The creation time of the domain alias. (Read-only). + */ + creationTime: string; + /** + * The domain alias name. + */ + domainAliasName: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * The parent domain name that the domain alias is associated with. This can + * either be a primary or secondary domain name within a customer. + */ + parentDomainName: string; + /** + * Indicates the verification state of a domain alias. (Read-only) + */ + verified: boolean; + } + /** + * JSON response template to list domain aliases in Directory API. + */ + export interface Schema$DomainAliases { + /** + * List of domain alias objects. + */ + domainAliases: Schema$DomainAlias[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + } + /** + * JSON template for Domain object in Directory API. + */ + export interface Schema$Domains { + /** + * Creation time of the domain. (Read-only). + */ + creationTime: string; + /** + * List of domain alias objects. (Read-only) + */ + domainAliases: Schema$DomainAlias[]; + /** + * The domain name of the customer. + */ + domainName: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Indicates if the domain is a primary domain (Read-only). + */ + isPrimary: boolean; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Indicates the verification state of a domain. (Read-only). + */ + verified: boolean; + } + /** + * JSON response template to list Domains in Directory API. + */ + export interface Schema$Domains2 { + /** + * List of domain objects. + */ + domains: Schema$Domains[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + } + /** + * JSON template for Feature object in Directory API. + */ + export interface Schema$Feature { + /** + * ETag of the resource. + */ + etags: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * The name of the feature. + */ + name: string; + } + /** + * JSON template for a "feature instance". + */ + export interface Schema$FeatureInstance { + /** + * The feature that this is an instance of. A calendar resource may have + * multiple instances of a feature. + */ + feature: Schema$Feature; + } + /** + * JSON request template for renaming a feature. + */ + export interface Schema$FeatureRename { + /** + * New name of the feature. + */ + newName: string; + } + /** + * JSON template for Feature List Response object in Directory API. + */ + export interface Schema$Features { + /** + * ETag of the resource. + */ + etag: string; + /** + * The Features in this page of results. + */ + features: Schema$Feature[]; + /** + * Kind of resource this is. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + } + /** + * JSON template for Group resource in Directory API. + */ + export interface Schema$Group { + /** + * Is the group created by admin (Read-only) * + */ + adminCreated: boolean; + /** + * List of aliases (Read-only) + */ + aliases: string[]; + /** + * Description of the group + */ + description: string; + /** + * Group direct members count + */ + directMembersCount: string; + /** + * Email of Group + */ + email: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Unique identifier of Group (Read-only) + */ + id: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Group name + */ + name: string; + /** + * List of non editable aliases (Read-only) + */ + nonEditableAliases: string[]; + } + /** + * JSON response template for List Groups operation in Directory API. + */ + export interface Schema$Groups { + /** + * ETag of the resource. + */ + etag: string; + /** + * List of group objects. + */ + groups: Schema$Group[]; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Token used to access next page of this result. + */ + nextPageToken: string; + } + /** + * JSON template for Member resource in Directory API. + */ + export interface Schema$Member { + /** + * Email of member (Read-only) + */ + email: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Unique identifier of customer member (Read-only) Unique identifier of + * group (Read-only) Unique identifier of member (Read-only) + */ + id: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Role of member + */ + role: string; + /** + * Status of member (Immutable) + */ + status: string; + /** + * Type of member (Immutable) + */ + type: string; + } + /** + * JSON response template for List Members operation in Directory API. + */ + export interface Schema$Members { + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * List of member objects. + */ + members: Schema$Member[]; + /** + * Token used to access next page of this result. + */ + nextPageToken: string; + } + /** + * JSON template for Has Member response in Directory API. + */ + export interface Schema$MembersHasMember { + /** + * Identifies whether the given user is a member of the group. Membership + * can be direct or nested. + */ + isMember: boolean; + } + /** + * JSON template for Mobile Device resource in Directory API. + */ + export interface Schema$MobileDevice { + /** + * Adb (USB debugging) enabled or disabled on device (Read-only) + */ + adbStatus: boolean; + /** + * List of applications installed on Mobile Device + */ + applications: any[]; + /** + * Mobile Device Baseband version (Read-only) + */ + basebandVersion: string; + /** + * Mobile Device Bootloader version (Read-only) + */ + bootloaderVersion: string; + /** + * Mobile Device Brand (Read-only) + */ + brand: string; + /** + * Mobile Device Build number (Read-only) + */ + buildNumber: string; + /** + * The default locale used on the Mobile Device (Read-only) + */ + defaultLanguage: string; + /** + * Developer options enabled or disabled on device (Read-only) + */ + developerOptionsStatus: boolean; + /** + * Mobile Device compromised status (Read-only) + */ + deviceCompromisedStatus: string; + /** + * Mobile Device serial number (Read-only) + */ + deviceId: string; + /** + * DevicePasswordStatus (Read-only) + */ + devicePasswordStatus: string; + /** + * List of owner user's email addresses (Read-only) + */ + email: string[]; + /** + * Mobile Device Encryption Status (Read-only) + */ + encryptionStatus: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Date and time the device was first synchronized with the policy settings + * in the G Suite administrator control panel (Read-only) + */ + firstSync: string; + /** + * Mobile Device Hardware (Read-only) + */ + hardware: string; + /** + * Mobile Device Hardware Id (Read-only) + */ + hardwareId: string; + /** + * Mobile Device IMEI number (Read-only) + */ + imei: string; + /** + * Mobile Device Kernel version (Read-only) + */ + kernelVersion: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Date and time the device was last synchronized with the policy settings + * in the G Suite administrator control panel (Read-only) + */ + lastSync: string; + /** + * Boolean indicating if this account is on owner/primary profile or not + * (Read-only) + */ + managedAccountIsOnOwnerProfile: boolean; + /** + * Mobile Device manufacturer (Read-only) + */ + manufacturer: string; + /** + * Mobile Device MEID number (Read-only) + */ + meid: string; + /** + * Name of the model of the device + */ + model: string; + /** + * List of owner user's names (Read-only) + */ + name: string[]; + /** + * Mobile Device mobile or network operator (if available) (Read-only) + */ + networkOperator: string; + /** + * Name of the mobile operating system + */ + os: string; + /** + * List of accounts added on device (Read-only) + */ + otherAccountsInfo: string[]; + /** + * DMAgentPermission (Read-only) + */ + privilege: string; + /** + * Mobile Device release version version (Read-only) + */ + releaseVersion: string; + /** + * Unique identifier of Mobile Device (Read-only) + */ + resourceId: string; + /** + * Mobile Device Security patch level (Read-only) + */ + securityPatchLevel: string; + /** + * Mobile Device SSN or Serial Number (Read-only) + */ + serialNumber: string; + /** + * Status of the device (Read-only) + */ + status: string; + /** + * Work profile supported on device (Read-only) + */ + supportsWorkProfile: boolean; + /** + * The type of device (Read-only) + */ + type: string; + /** + * Unknown sources enabled or disabled on device (Read-only) + */ + unknownSourcesStatus: boolean; + /** + * Mobile Device user agent + */ + userAgent: string; + /** + * Mobile Device WiFi MAC address (Read-only) + */ + wifiMacAddress: string; + } + /** + * JSON request template for firing commands on Mobile Device in Directory + * Devices API. + */ + export interface Schema$MobileDeviceAction { + /** + * Action to be taken on the Mobile Device + */ + action: string; + } + /** + * JSON response template for List Mobile Devices operation in Directory API. + */ + export interface Schema$MobileDevices { + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * List of Mobile Device objects. + */ + mobiledevices: Schema$MobileDevice[]; + /** + * Token used to access next page of this result. + */ + nextPageToken: string; + } + /** + * Template for a notification resource. + */ + export interface Schema$Notification { + /** + * Body of the notification (Read-only) + */ + body: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Address from which the notification is received (Read-only) + */ + fromAddress: string; + /** + * Boolean indicating whether the notification is unread or not. + */ + isUnread: boolean; + /** + * The type of the resource. + */ + kind: string; + notificationId: string; + /** + * Time at which notification was sent (Read-only) + */ + sendTime: string; + /** + * Subject of the notification (Read-only) + */ + subject: string; + } + /** + * Template for notifications list response. + */ + export interface Schema$Notifications { + /** + * ETag of the resource. + */ + etag: string; + /** + * List of notifications in this page. + */ + items: Schema$Notification[]; + /** + * The type of the resource. + */ + kind: string; + /** + * Token for fetching the next page of notifications. + */ + nextPageToken: string; + /** + * Number of unread notification for the domain. + */ + unreadNotificationsCount: number; + } + /** + * JSON template for Org Unit resource in Directory API. + */ + export interface Schema$OrgUnit { + /** + * Should block inheritance + */ + blockInheritance: boolean; + /** + * Description of OrgUnit + */ + description: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Name of OrgUnit + */ + name: string; + /** + * Id of OrgUnit + */ + orgUnitId: string; + /** + * Path of OrgUnit + */ + orgUnitPath: string; + /** + * Id of parent OrgUnit + */ + parentOrgUnitId: string; + /** + * Path of parent OrgUnit + */ + parentOrgUnitPath: string; + } + /** + * JSON response template for List Organization Units operation in Directory + * API. + */ + export interface Schema$OrgUnits { + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * List of user objects. + */ + organizationUnits: Schema$OrgUnit[]; + } + /** + * JSON template for privilege resource in Directory API. + */ + export interface Schema$Privilege { + /** + * A list of child privileges. Privileges for a service form a tree. Each + * privilege can have a list of child privileges; this list is empty for a + * leaf privilege. + */ + childPrivileges: Schema$Privilege[]; + /** + * ETag of the resource. + */ + etag: string; + /** + * If the privilege can be restricted to an organization unit. + */ + isOuScopable: boolean; + /** + * The type of the API resource. This is always admin#directory#privilege. + */ + kind: string; + /** + * The name of the privilege. + */ + privilegeName: string; + /** + * The obfuscated ID of the service this privilege is for. + */ + serviceId: string; + /** + * The name of the service this privilege is for. + */ + serviceName: string; + } + /** + * JSON response template for List privileges operation in Directory API. + */ + export interface Schema$Privileges { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of Privilege resources. + */ + items: Schema$Privilege[]; + /** + * The type of the API resource. This is always admin#directory#privileges. + */ + kind: string; + } + /** + * JSON template for role resource in Directory API. + */ + export interface Schema$Role { + /** + * ETag of the resource. + */ + etag: string; + /** + * Returns true if the role is a super admin role. + */ + isSuperAdminRole: boolean; + /** + * Returns true if this is a pre-defined system role. + */ + isSystemRole: boolean; + /** + * The type of the API resource. This is always admin#directory#role. + */ + kind: string; + /** + * A short description of the role. + */ + roleDescription: string; + /** + * ID of the role. + */ + roleId: string; + /** + * Name of the role. + */ + roleName: string; + /** + * The set of privileges that are granted to this role. + */ + rolePrivileges: any[]; + } + /** + * JSON template for roleAssignment resource in Directory API. + */ + export interface Schema$RoleAssignment { + /** + * The unique ID of the user this role is assigned to. + */ + assignedTo: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * The type of the API resource. This is always + * admin#directory#roleAssignment. + */ + kind: string; + /** + * If the role is restricted to an organization unit, this contains the ID + * for the organization unit the exercise of this role is restricted to. + */ + orgUnitId: string; + /** + * ID of this roleAssignment. + */ + roleAssignmentId: string; + /** + * The ID of the role that is assigned. + */ + roleId: string; + /** + * The scope in which this role is assigned. Possible values are: - + * CUSTOMER - ORG_UNIT + */ + scopeType: string; + } + /** + * JSON response template for List roleAssignments operation in Directory API. + */ + export interface Schema$RoleAssignments { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of RoleAssignment resources. + */ + items: Schema$RoleAssignment[]; + /** + * The type of the API resource. This is always + * admin#directory#roleAssignments. + */ + kind: string; + nextPageToken: string; + } + /** + * JSON response template for List roles operation in Directory API. + */ + export interface Schema$Roles { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of Role resources. + */ + items: Schema$Role[]; + /** + * The type of the API resource. This is always admin#directory#roles. + */ + kind: string; + nextPageToken: string; + } + /** + * JSON template for Schema resource in Directory API. + */ + export interface Schema$Schema { + /** + * ETag of the resource. + */ + etag: string; + /** + * Fields of Schema + */ + fields: Schema$SchemaFieldSpec[]; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Unique identifier of Schema (Read-only) + */ + schemaId: string; + /** + * Schema name + */ + schemaName: string; + } + /** + * JSON template for FieldSpec resource for Schemas in Directory API. + */ + export interface Schema$SchemaFieldSpec { + /** + * ETag of the resource. + */ + etag: string; + /** + * Unique identifier of Field (Read-only) + */ + fieldId: string; + /** + * Name of the field. + */ + fieldName: string; + /** + * Type of the field. + */ + fieldType: string; + /** + * Boolean specifying whether the field is indexed or not. + */ + indexed: boolean; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Boolean specifying whether this is a multi-valued field or not. + */ + multiValued: boolean; + /** + * Indexing spec for a numeric field. By default, only exact match queries + * will be supported for numeric fields. Setting the numericIndexingSpec + * allows range queries to be supported. + */ + numericIndexingSpec: any; + /** + * Read ACLs on the field specifying who can view values of this field. + * Valid values are "ALL_DOMAIN_USERS" and + * "ADMINS_AND_SELF". + */ + readAccessType: string; + } + /** + * JSON response template for List Schema operation in Directory API. + */ + export interface Schema$Schemas { + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * List of UserSchema objects. + */ + schemas: Schema$Schema[]; + } + /** + * JSON template for token resource in Directory API. + */ + export interface Schema$Token { + /** + * Whether the application is registered with Google. The value is true if + * the application has an anonymous Client ID. + */ + anonymous: boolean; + /** + * The Client ID of the application the token is issued to. + */ + clientId: string; + /** + * The displayable name of the application the token is issued to. + */ + displayText: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * The type of the API resource. This is always admin#directory#token. + */ + kind: string; + /** + * Whether the token is issued to an installed application. The value is + * true if the application is installed to a desktop or mobile device. + */ + nativeApp: boolean; + /** + * A list of authorization scopes the application is granted. + */ + scopes: string[]; + /** + * The unique ID of the user that issued the token. + */ + userKey: string; + } + /** + * JSON response template for List tokens operation in Directory API. + */ + export interface Schema$Tokens { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of Token resources. + */ + items: Schema$Token[]; + /** + * The type of the API resource. This is always admin#directory#tokenList. + */ + kind: string; + } + /** + * JSON template for Trusted App Ids Resource object in Directory API. + */ + export interface Schema$TrustedAppId { + /** + * Android package name. + */ + androidPackageName: string; + /** + * SHA1 signature of the app certificate. + */ + certificateHashSHA1: string; + /** + * SHA256 signature of the app certificate. + */ + certificateHashSHA256: string; + etag: string; + /** + * Identifies the resource as a trusted AppId. + */ + kind: string; + } + /** + * JSON template for Trusted Apps response object of a user in Directory API. + */ + export interface Schema$TrustedApps { + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifies the resource as trusted apps response. + */ + kind: string; + nextPageToken: string; + /** + * Trusted Apps list. + */ + trustedApps: Schema$TrustedAppId[]; + } + /** + * JSON template for User object in Directory API. + */ + export interface Schema$User { + addresses: any; + /** + * Indicates if user has agreed to terms (Read-only) + */ + agreedToTerms: boolean; + /** + * List of aliases (Read-only) + */ + aliases: string[]; + /** + * Boolean indicating if the user should change password in next login + */ + changePasswordAtNextLogin: boolean; + /** + * User's G Suite account creation time. (Read-only) + */ + creationTime: string; + /** + * CustomerId of User (Read-only) + */ + customerId: string; + /** + * Custom fields of the user. + */ + customSchemas: any; + deletionTime: string; + emails: any; + /** + * ETag of the resource. + */ + etag: string; + externalIds: any; + gender: any; + /** + * Hash function name for password. Supported are MD5, SHA-1 and crypt + */ + hashFunction: string; + /** + * Unique identifier of User (Read-only) + */ + id: string; + ims: any; + /** + * Boolean indicating if user is included in Global Address List + */ + includeInGlobalAddressList: boolean; + /** + * Boolean indicating if ip is whitelisted + */ + ipWhitelisted: boolean; + /** + * Boolean indicating if the user is admin (Read-only) + */ + isAdmin: boolean; + /** + * Boolean indicating if the user is delegated admin (Read-only) + */ + isDelegatedAdmin: boolean; + /** + * Is 2-step verification enforced (Read-only) + */ + isEnforcedIn2Sv: boolean; + /** + * Is enrolled in 2-step verification (Read-only) + */ + isEnrolledIn2Sv: boolean; + /** + * Is mailbox setup (Read-only) + */ + isMailboxSetup: boolean; + keywords: any; + /** + * Kind of resource this is. + */ + kind: string; + languages: any; + /** + * User's last login time. (Read-only) + */ + lastLoginTime: string; + locations: any; + /** + * User's name + */ + name: Schema$UserName; + /** + * List of non editable aliases (Read-only) + */ + nonEditableAliases: string[]; + notes: any; + organizations: any; + /** + * OrgUnit of User + */ + orgUnitPath: string; + /** + * User's password + */ + password: string; + phones: any; + posixAccounts: any; + /** + * username of User + */ + primaryEmail: string; + relations: any; + sshPublicKeys: any; + /** + * Indicates if user is suspended + */ + suspended: boolean; + /** + * Suspension reason if user is suspended (Read-only) + */ + suspensionReason: string; + /** + * ETag of the user's photo (Read-only) + */ + thumbnailPhotoEtag: string; + /** + * Photo Url of the user (Read-only) + */ + thumbnailPhotoUrl: string; + websites: any; + } + /** + * JSON template for About (notes) of a user in Directory API. + */ + export interface Schema$UserAbout { + /** + * About entry can have a type which indicates the content type. It can + * either be plain or html. By default, notes contents are assumed to + * contain plain text. + */ + contentType: string; + /** + * Actual value of notes. + */ + value: string; + } + /** + * JSON template for address. + */ + export interface Schema$UserAddress { + /** + * Country. + */ + country: string; + /** + * Country code. + */ + countryCode: string; + /** + * Custom type. + */ + customType: string; + /** + * Extended Address. + */ + extendedAddress: string; + /** + * Formatted address. + */ + formatted: string; + /** + * Locality. + */ + locality: string; + /** + * Other parts of address. + */ + poBox: string; + /** + * Postal code. + */ + postalCode: string; + /** + * If this is user's primary address. Only one entry could be marked as + * primary. + */ + primary: boolean; + /** + * Region. + */ + region: string; + /** + * User supplied address was structured. Structured addresses are NOT + * supported at this time. You might be able to write structured addresses, + * but any values will eventually be clobbered. + */ + sourceIsStructured: boolean; + /** + * Street. + */ + streetAddress: string; + /** + * Each entry can have a type which indicates standard values of that entry. + * For example address could be of home, work etc. In addition to the + * standard type, an entry can have a custom type and can take any value. + * Such type should have the CUSTOM value as type and also have a customType + * value. + */ + type: string; + } + /** + * JSON template for a set of custom properties (i.e. all fields in a + * particular schema) + */ + export interface Schema$UserCustomProperties {} + /** + * JSON template for an email. + */ + export interface Schema$UserEmail { + /** + * Email id of the user. + */ + address: string; + /** + * Custom Type. + */ + customType: string; + /** + * If this is user's primary email. Only one entry could be marked as + * primary. + */ + primary: boolean; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example email could be of home, work etc. In addition to the standard + * type, an entry can have a custom type and can take any value Such types + * should have the CUSTOM value as type and also have a customType value. + */ + type: string; + } + /** + * JSON template for an externalId entry. + */ + export interface Schema$UserExternalId { + /** + * Custom type. + */ + customType: string; + /** + * The type of the Id. + */ + type: string; + /** + * The value of the id. + */ + value: string; + } + export interface Schema$UserGender { + /** + * AddressMeAs. A human-readable string containing the proper way to refer + * to the profile owner by humans, for example "he/him/his" or + * "they/them/their". + */ + addressMeAs: string; + /** + * Custom gender. + */ + customGender: string; + /** + * Gender. + */ + type: string; + } + /** + * JSON template for instant messenger of an user. + */ + export interface Schema$UserIm { + /** + * Custom protocol. + */ + customProtocol: string; + /** + * Custom type. + */ + customType: string; + /** + * Instant messenger id. + */ + im: string; + /** + * If this is user's primary im. Only one entry could be marked as + * primary. + */ + primary: boolean; + /** + * Protocol used in the instant messenger. It should be one of the values + * from ImProtocolTypes map. Similar to type, it can take a CUSTOM value and + * specify the custom name in customProtocol field. + */ + protocol: string; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example instant messengers could be of home, work etc. In addition to + * the standard type, an entry can have a custom type and can take any + * value. Such types should have the CUSTOM value as type and also have a + * customType value. + */ + type: string; + } + /** + * JSON template for a keyword entry. + */ + export interface Schema$UserKeyword { + /** + * Custom Type. + */ + customType: string; + /** + * Each entry can have a type which indicates standard type of that entry. + * For example, keyword could be of type occupation or outlook. In addition + * to the standard type, an entry can have a custom type and can give it any + * name. Such types should have the CUSTOM value as type and also have a + * customType value. + */ + type: string; + /** + * Keyword. + */ + value: string; + } + /** + * JSON template for a language entry. + */ + export interface Schema$UserLanguage { + /** + * Other language. User can provide own language name if there is no + * corresponding Google III language code. If this is set LanguageCode + * can't be set + */ + customLanguage: string; + /** + * Language Code. Should be used for storing Google III LanguageCode string + * representation for language. Illegal values cause SchemaException. + */ + languageCode: string; + } + /** + * JSON template for a location entry. + */ + export interface Schema$UserLocation { + /** + * Textual location. This is most useful for display purposes to concisely + * describe the location. For example, "Mountain View, CA", + * "Near Seattle", "US-NYC-9TH 9A209A". + */ + area: string; + /** + * Building Identifier. + */ + buildingId: string; + /** + * Custom Type. + */ + customType: string; + /** + * Most specific textual code of individual desk location. + */ + deskCode: string; + /** + * Floor name/number. + */ + floorName: string; + /** + * Floor section. More specific location within the floor. For example, if a + * floor is divided into sections "A", "B", and + * "C", this field would identify one of those values. + */ + floorSection: string; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example location could be of types default and desk. In addition to + * standard type, an entry can have a custom type and can give it any name. + * Such types should have "custom" as type and also have a + * customType value. + */ + type: string; + } + /** + * JSON request template for setting/revoking admin status of a user in + * Directory API. + */ + export interface Schema$UserMakeAdmin { + /** + * Boolean indicating new admin status of the user + */ + status: boolean; + } + /** + * JSON template for name of a user in Directory API. + */ + export interface Schema$UserName { + /** + * Last Name + */ + familyName: string; + /** + * Full Name + */ + fullName: string; + /** + * First Name + */ + givenName: string; + } + /** + * JSON template for an organization entry. + */ + export interface Schema$UserOrganization { + /** + * The cost center of the users department. + */ + costCenter: string; + /** + * Custom type. + */ + customType: string; + /** + * Department within the organization. + */ + department: string; + /** + * Description of the organization. + */ + description: string; + /** + * The domain to which the organization belongs to. + */ + domain: string; + /** + * The full-time equivalent percent within the organization (100000 = 100%). + */ + fullTimeEquivalent: number; + /** + * Location of the organization. This need not be fully qualified address. + */ + location: string; + /** + * Name of the organization + */ + name: string; + /** + * If it user's primary organization. + */ + primary: boolean; + /** + * Symbol of the organization. + */ + symbol: string; + /** + * Title (designation) of the user in the organization. + */ + title: string; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example organization could be of school, work etc. In addition to the + * standard type, an entry can have a custom type and can give it any name. + * Such types should have the CUSTOM value as type and also have a + * CustomType value. + */ + type: string; + } + /** + * JSON template for a phone entry. + */ + export interface Schema$UserPhone { + /** + * Custom Type. + */ + customType: string; + /** + * If this is user's primary phone or not. + */ + primary: boolean; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example phone could be of home_fax, work, mobile etc. In addition to + * the standard type, an entry can have a custom type and can give it any + * name. Such types should have the CUSTOM value as type and also have a + * customType value. + */ + type: string; + /** + * Phone number. + */ + value: string; + } + /** + * JSON template for Photo object in Directory API. + */ + export interface Schema$UserPhoto { + /** + * ETag of the resource. + */ + etag: string; + /** + * Height in pixels of the photo + */ + height: number; + /** + * Unique identifier of User (Read-only) + */ + id: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Mime Type of the photo + */ + mimeType: string; + /** + * Base64 encoded photo data + */ + photoData: string; + /** + * Primary email of User (Read-only) + */ + primaryEmail: string; + /** + * Width in pixels of the photo + */ + width: number; + } + /** + * JSON template for a POSIX account entry. Description of the field family: + * go/fbs-posix. + */ + export interface Schema$UserPosixAccount { + /** + * A POSIX account field identifier. (Read-only) + */ + accountId: string; + /** + * The GECOS (user information) for this account. + */ + gecos: string; + /** + * The default group ID. + */ + gid: string; + /** + * The path to the home directory for this account. + */ + homeDirectory: string; + /** + * If this is user's primary account within the SystemId. + */ + primary: boolean; + /** + * The path to the login shell for this account. + */ + shell: string; + /** + * System identifier for which account Username or Uid apply to. + */ + systemId: string; + /** + * The POSIX compliant user ID. + */ + uid: string; + /** + * The username of the account. + */ + username: string; + } + /** + * JSON template for a relation entry. + */ + export interface Schema$UserRelation { + /** + * Custom Type. + */ + customType: string; + /** + * The relation of the user. Some of the possible values are mother, father, + * sister, brother, manager, assistant, partner. + */ + type: string; + /** + * The name of the relation. + */ + value: string; + } + /** + * JSON response template for List Users operation in Apps Directory API. + */ + export interface Schema$Users { + /** + * ETag of the resource. + */ + etag: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Token used to access next page of this result. + */ + nextPageToken: string; + /** + * Event that triggered this response (only used in case of Push Response) + */ + trigger_event: string; + /** + * List of user objects. + */ + users: Schema$User[]; + } + /** + * JSON template for a POSIX account entry. + */ + export interface Schema$UserSshPublicKey { + /** + * An expiration time in microseconds since epoch. + */ + expirationTimeUsec: string; + /** + * A SHA-256 fingerprint of the SSH public key. (Read-only) + */ + fingerprint: string; + /** + * An SSH public key. + */ + key: string; + } + /** + * JSON request template to undelete a user in Directory API. + */ + export interface Schema$UserUndelete { + /** + * OrgUnit of User + */ + orgUnitPath: string; + } + /** + * JSON template for a website entry. + */ + export interface Schema$UserWebsite { + /** + * Custom Type. + */ + customType: string; + /** + * If this is user's primary website or not. + */ + primary: boolean; + /** + * Each entry can have a type which indicates standard types of that entry. + * For example website could be of home, work, blog etc. In addition to the + * standard type, an entry can have a custom type and can give it any name. + * Such types should have the CUSTOM value as type and also have a + * customType value. + */ + type: string; + /** + * Website. + */ + value: string; + } + /** + * JSON template for verification codes in Directory API. + */ + export interface Schema$VerificationCode { + /** + * ETag of the resource. + */ + etag: string; + /** + * The type of the resource. This is always + * admin#directory#verificationCode. + */ + kind: string; + /** + * The obfuscated unique ID of the user. + */ + userId: string; + /** + * A current verification code for the user. Invalidated or used + * verification codes are not returned as part of the result. + */ + verificationCode: string; + } + /** + * JSON response template for List verification codes operation in Directory + * API. + */ + export interface Schema$VerificationCodes { + /** + * ETag of the resource. + */ + etag: string; + /** + * A list of verification code resources. + */ + items: Schema$VerificationCode[]; + /** + * The type of the resource. This is always + * admin#directory#verificationCodesList. + */ + kind: string; + } + + export class Resource$Asps { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.asps.delete + * @desc Delete an ASP issued by a user. + * @alias directory.asps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.codeId The unique ID of the ASP to be deleted. + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/asps/{codeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userKey', 'codeId'], + pathParams: ['codeId', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.asps.get + * @desc Get information about an ASP issued by a user. + * @alias directory.asps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.codeId The unique ID of the ASP. + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/asps/{codeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey', 'codeId'], + pathParams: ['codeId', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.asps.list + * @desc List the ASPs issued by a user. + * @alias directory.asps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/asps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Channels { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * admin.channels.stop + * @desc Stop watching resources through this channel + * @alias admin.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/admin/directory_v1/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Chromeosdevices { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.chromeosdevices.action + * @desc Take action on Chrome OS Device + * @alias directory.chromeosdevices.action + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.resourceId Immutable ID of Chrome OS Device + * @param {().ChromeOsDeviceAction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + action(params?: any, options?: MethodOptions): AxiosPromise; + action( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + action( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos/{resourceId}/action') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'resourceId'], + pathParams: ['customerId', 'resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.chromeosdevices.get + * @desc Retrieve Chrome OS Device + * @alias directory.chromeosdevices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.deviceId Immutable ID of Chrome OS Device + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId', 'deviceId'], + pathParams: ['customerId', 'deviceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.chromeosdevices.list + * @desc Retrieve all Chrome OS Devices of a customer (paginated) + * @alias directory.chromeosdevices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100 + * @param {string=} params.orderBy Column to use for sorting results + * @param {string=} params.orgUnitPath Full path of the organizational unit or its ID + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string=} params.query Search string in the format given at http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=1698333 + * @param {string=} params.sortOrder Whether to return results in ascending or descending order. Only of use when orderBy is also used + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.chromeosdevices.moveDevicesToOu + * @desc Move or insert multiple Chrome OS Devices to organizational unit + * @alias directory.chromeosdevices.moveDevicesToOu + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.orgUnitPath Full path of the target organizational unit or its ID + * @param {().ChromeOsMoveDevicesToOu} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveDevicesToOu(params?: any, options?: MethodOptions): AxiosPromise; + moveDevicesToOu( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveDevicesToOu( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos/moveDevicesToOu') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'orgUnitPath'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.chromeosdevices.patch + * @desc Update Chrome OS Device. This method supports patch semantics. + * @alias directory.chromeosdevices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.deviceId Immutable ID of Chrome OS Device + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {().ChromeOsDevice} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customerId', 'deviceId'], + pathParams: ['customerId', 'deviceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.chromeosdevices.update + * @desc Update Chrome OS Device + * @alias directory.chromeosdevices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.deviceId Immutable ID of Chrome OS Device + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {().ChromeOsDevice} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customerId', 'deviceId'], + pathParams: ['customerId', 'deviceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Customers { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.customers.get + * @desc Retrieves a customer. + * @alias directory.customers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerKey Id of the customer to be retrieved + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerKey'], + pathParams: ['customerKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.customers.patch + * @desc Updates a customer. This method supports patch semantics. + * @alias directory.customers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerKey Id of the customer to be updated + * @param {().Customer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customerKey'], + pathParams: ['customerKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.customers.update + * @desc Updates a customer. + * @alias directory.customers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerKey Id of the customer to be updated + * @param {().Customer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customers/{customerKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customerKey'], + pathParams: ['customerKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Domainaliases { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.domainAliases.delete + * @desc Deletes a Domain Alias of the customer. + * @alias directory.domainAliases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.domainAliasName Name of domain alias to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'domainAliasName'], + pathParams: ['customer', 'domainAliasName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domainAliases.get + * @desc Retrieves a domain alias of the customer. + * @alias directory.domainAliases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.domainAliasName Name of domain alias to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'domainAliasName'], + pathParams: ['customer', 'domainAliasName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domainAliases.insert + * @desc Inserts a Domain alias of the customer. + * @alias directory.domainAliases.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {().DomainAlias} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/domainaliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domainAliases.list + * @desc Lists the domain aliases of the customer. + * @alias directory.domainAliases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string=} params.parentDomainName Name of the parent domain for which domain aliases are to be fetched. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/domainaliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Domains { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.domains.delete + * @desc Deletes a domain of the customer. + * @alias directory.domains.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.domainName Name of domain to be deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/domains/{domainName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'domainName'], + pathParams: ['customer', 'domainName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domains.get + * @desc Retrieves a domain of the customer. + * @alias directory.domains.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.domainName Name of domain to be retrieved + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/domains/{domainName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'domainName'], + pathParams: ['customer', 'domainName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domains.insert + * @desc Inserts a domain of the customer. + * @alias directory.domains.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {().Domains} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customer/{customer}/domains') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.domains.list + * @desc Lists the domains of the customer. + * @alias directory.domains.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customer/{customer}/domains') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Groups { + root: Admin; + aliases: Resource$Groups$Aliases; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + this.aliases = new Resource$Groups$Aliases(root); + } + + getRoot() { + return this.root; + } + + + /** + * directory.groups.delete + * @desc Delete Group + * @alias directory.groups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.get + * @desc Retrieve Group + * @alias directory.groups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.insert + * @desc Create Group + * @alias directory.groups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.list + * @desc Retrieve all groups in a domain (paginated) + * @alias directory.groups.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. + * @param {string=} params.domain Name of the domain. Fill this field to get groups from only this domain. To return all groups in a multi-domain fill customer field instead. + * @param {integer=} params.maxResults Maximum number of results to return. Default is 200 + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.userKey Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If ID, it should match with id of user object + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.patch + * @desc Update Group. This method supports patch semantics. + * @alias directory.groups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.update + * @desc Update Group + * @alias directory.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Groups$Aliases { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.groups.aliases.delete + * @desc Remove a alias for the group + * @alias directory.groups.aliases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.alias The alias to be removed + * @param {string} params.groupKey Email or immutable ID of the group + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/groups/{groupKey}/aliases/{alias}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['groupKey', 'alias'], + pathParams: ['alias', 'groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.aliases.insert + * @desc Add a alias for the group + * @alias directory.groups.aliases.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {().Alias} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.groups.aliases.list + * @desc List all aliases for a group + * @alias directory.groups.aliases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Members { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.members.delete + * @desc Remove membership. + * @alias directory.members.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {string} params.memberKey Email or immutable ID of the member + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['groupKey', 'memberKey'], + pathParams: ['groupKey', 'memberKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.get + * @desc Retrieve Group Member + * @alias directory.members.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {string} params.memberKey Email or immutable ID of the member + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupKey', 'memberKey'], + pathParams: ['groupKey', 'memberKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.hasMember + * @desc Checks whether the given user is a member of the group. Membership + * can be direct or nested. + * @alias directory.members.hasMember + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID. + * @param {string} params.memberKey Identifies the user member in the API request. The value can be the user's primary email address, alias, or unique ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + hasMember(params?: any, options?: MethodOptions): + AxiosPromise; + hasMember( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + hasMember( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/groups/{groupKey}/hasMember/{memberKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupKey', 'memberKey'], + pathParams: ['groupKey', 'memberKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.insert + * @desc Add user to the specified group. + * @alias directory.members.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {().Member} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/members') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.list + * @desc Retrieve all members in a group (paginated) + * @alias directory.members.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group + * @param {integer=} params.maxResults Maximum number of results to return. Default is 200 + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.roles Comma separated role values to filter list results on. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/groups/{groupKey}/members') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupKey'], + pathParams: ['groupKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.patch + * @desc Update membership of a user in the specified group. This method + * supports patch semantics. + * @alias directory.members.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object + * @param {string} params.memberKey Email or immutable ID of the user. If ID, it should match with id of member object + * @param {().Member} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['groupKey', 'memberKey'], + pathParams: ['groupKey', 'memberKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.members.update + * @desc Update membership of a user in the specified group. + * @alias directory.members.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupKey Email or immutable ID of the group. If ID, it should match with id of group object + * @param {string} params.memberKey Email or immutable ID of the user. If ID, it should match with id of member object + * @param {().Member} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/groups/{groupKey}/members/{memberKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['groupKey', 'memberKey'], + pathParams: ['groupKey', 'memberKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Mobiledevices { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.mobiledevices.action + * @desc Take action on Mobile Device + * @alias directory.mobiledevices.action + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.resourceId Immutable ID of Mobile Device + * @param {().MobileDeviceAction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + action(params?: any, options?: MethodOptions): AxiosPromise; + action( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + action( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}/action') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'resourceId'], + pathParams: ['customerId', 'resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.mobiledevices.delete + * @desc Delete Mobile Device + * @alias directory.mobiledevices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.resourceId Immutable ID of Mobile Device + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customerId', 'resourceId'], + pathParams: ['customerId', 'resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.mobiledevices.get + * @desc Retrieve Mobile Device + * @alias directory.mobiledevices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string} params.resourceId Immutable ID of Mobile Device + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId', 'resourceId'], + pathParams: ['customerId', 'resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.mobiledevices.list + * @desc Retrieve all Mobile Devices of a customer (paginated) + * @alias directory.mobiledevices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100 + * @param {string=} params.orderBy Column to use for sorting results + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string=} params.query Search string in the format given at http://support.google.com/a/bin/answer.py?hl=en&answer=1408863#search + * @param {string=} params.sortOrder Whether to return results in ascending or descending order. Only of use when orderBy is also used + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customerId}/devices/mobile') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Notifications { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.notifications.delete + * @desc Deletes a notification + * @alias directory.notifications.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. + * @param {string} params.notificationId The unique ID of the notification. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'notificationId'], + pathParams: ['customer', 'notificationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.notifications.get + * @desc Retrieves a notification. + * @alias directory.notifications.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. + * @param {string} params.notificationId The unique ID of the notification. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'notificationId'], + pathParams: ['customer', 'notificationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.notifications.list + * @desc Retrieves a list of notifications. + * @alias directory.notifications.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. + * @param {string=} params.language The ISO 639-1 code of the language notifications are returned in. The default is English (en). + * @param {integer=} params.maxResults Maximum number of notifications to return per page. The default is 100. + * @param {string=} params.pageToken The token to specify the page of results to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/notifications') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.notifications.patch + * @desc Updates a notification. This method supports patch semantics. + * @alias directory.notifications.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. + * @param {string} params.notificationId The unique ID of the notification. + * @param {().Notification} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customer', 'notificationId'], + pathParams: ['customer', 'notificationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.notifications.update + * @desc Updates a notification. + * @alias directory.notifications.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. + * @param {string} params.notificationId The unique ID of the notification. + * @param {().Notification} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/notifications/{notificationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customer', 'notificationId'], + pathParams: ['customer', 'notificationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Orgunits { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.orgunits.delete + * @desc Remove organizational unit + * @alias directory.orgunits.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.orgUnitPath Full path of the organizational unit or its ID + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customerId', 'orgUnitPath'], + pathParams: ['customerId', 'orgUnitPath'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.orgunits.get + * @desc Retrieve organizational unit + * @alias directory.orgunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.orgUnitPath Full path of the organizational unit or its ID + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId', 'orgUnitPath'], + pathParams: ['customerId', 'orgUnitPath'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.orgunits.insert + * @desc Add organizational unit + * @alias directory.orgunits.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {().OrgUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.orgunits.list + * @desc Retrieve all organizational units + * @alias directory.orgunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string=} params.orgUnitPath the URL-encoded organizational unit's path or its ID + * @param {string=} params.type Whether to return all sub-organizations or just immediate children + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.orgunits.patch + * @desc Update organizational unit. This method supports patch semantics. + * @alias directory.orgunits.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.orgUnitPath Full path of the organizational unit or its ID + * @param {().OrgUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customerId', 'orgUnitPath'], + pathParams: ['customerId', 'orgUnitPath'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.orgunits.update + * @desc Update organizational unit + * @alias directory.orgunits.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.orgUnitPath Full path of the organizational unit or its ID + * @param {().OrgUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customerId', 'orgUnitPath'], + pathParams: ['customerId', 'orgUnitPath'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Privileges { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.privileges.list + * @desc Retrieves a paginated list of all privileges for a customer. + * @alias directory.privileges.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/roles/ALL/privileges') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Resolvedappaccesssettings { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.resolvedAppAccessSettings.GetSettings + * @desc Retrieves resolved app access settings of the logged in user. + * @alias directory.resolvedAppAccessSettings.GetSettings + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + GetSettings(params?: any, options?: MethodOptions): + AxiosPromise; + GetSettings( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + GetSettings( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/resolvedappaccesssettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resolvedAppAccessSettings.ListTrustedApps + * @desc Retrieves the list of apps trusted by the admin of the logged in + * user. + * @alias directory.resolvedAppAccessSettings.ListTrustedApps + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + ListTrustedApps(params?: any, options?: MethodOptions): + AxiosPromise; + ListTrustedApps( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + ListTrustedApps( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/trustedapps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Resources { + root: Admin; + buildings: Resource$Resources$Buildings; + calendars: Resource$Resources$Calendars; + features: Resource$Resources$Features; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + this.buildings = new Resource$Resources$Buildings(root); + this.calendars = new Resource$Resources$Calendars(root); + this.features = new Resource$Resources$Features(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Resources$Buildings { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.resources.buildings.delete + * @desc Deletes a building. + * @alias directory.resources.buildings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.buildingId The ID of the building to delete. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'buildingId'], + pathParams: ['buildingId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.buildings.get + * @desc Retrieves a building. + * @alias directory.resources.buildings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.buildingId The unique ID of the building to retrieve. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'buildingId'], + pathParams: ['buildingId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.buildings.insert + * @desc Inserts a building. + * @alias directory.resources.buildings.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().Building} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.buildings.list + * @desc Retrieves a list of buildings for an account. + * @alias directory.resources.buildings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.buildings.patch + * @desc Updates a building. This method supports patch semantics. + * @alias directory.resources.buildings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.buildingId The ID of the building to update. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().Building} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customer', 'buildingId'], + pathParams: ['buildingId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.buildings.update + * @desc Updates a building. + * @alias directory.resources.buildings.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.buildingId The ID of the building to update. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().Building} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/buildings/{buildingId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customer', 'buildingId'], + pathParams: ['buildingId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Resources$Calendars { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.resources.calendars.delete + * @desc Deletes a calendar resource. + * @alias directory.resources.calendars.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarResourceId The unique ID of the calendar resource to delete. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'calendarResourceId'], + pathParams: ['calendarResourceId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.calendars.get + * @desc Retrieves a calendar resource. + * @alias directory.resources.calendars.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarResourceId The unique ID of the calendar resource to retrieve. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'calendarResourceId'], + pathParams: ['calendarResourceId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.calendars.insert + * @desc Inserts a calendar resource. + * @alias directory.resources.calendars.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().CalendarResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.calendars.list + * @desc Retrieves a list of calendar resources for an account. + * @alias directory.resources.calendars.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderBy Field(s) to sort results by in either ascending or descending order. Supported fields include resourceId, resourceName, capacity, buildingId, and floorName. If no order is specified, defaults to ascending. Should be of the form "field [asc|desc], field [asc|desc], ...". For example buildingId, capacity desc would return results sorted first by buildingId in ascending order then by capacity in descending order. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {string=} params.query String query used to filter results. Should be of the form "field operator value" where field can be any of supported fields and operators can be any of supported operations. Operators include '=' for exact match and ':' for prefix match or HAS match where applicable. For prefix match, the value should always be followed by a *. Supported fields include generatedResourceName, name, buildingId, featureInstances.feature.name. For example buildingId=US-NYC-9TH AND featureInstances.feature.name:Phone. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.calendars.patch + * @desc Updates a calendar resource. This method supports patch semantics, + * meaning you only need to include the fields you wish to update. Fields + * that are not present in the request will be preserved. This method + * supports patch semantics. + * @alias directory.resources.calendars.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarResourceId The unique ID of the calendar resource to update. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().CalendarResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customer', 'calendarResourceId'], + pathParams: ['calendarResourceId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.calendars.update + * @desc Updates a calendar resource. This method supports patch semantics, + * meaning you only need to include the fields you wish to update. Fields + * that are not present in the request will be preserved. + * @alias directory.resources.calendars.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarResourceId The unique ID of the calendar resource to update. + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().CalendarResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/calendars/{calendarResourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customer', 'calendarResourceId'], + pathParams: ['calendarResourceId', 'customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Resources$Features { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.resources.features.delete + * @desc Deletes a feature. + * @alias directory.resources.features.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {string} params.featureKey The unique ID of the feature to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'featureKey'], + pathParams: ['customer', 'featureKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.get + * @desc Retrieves a feature. + * @alias directory.resources.features.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {string} params.featureKey The unique ID of the feature to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'featureKey'], + pathParams: ['customer', 'featureKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.insert + * @desc Inserts a feature. + * @alias directory.resources.features.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {().Feature} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.list + * @desc Retrieves a list of features for an account. + * @alias directory.resources.features.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.patch + * @desc Updates a feature. This method supports patch semantics. + * @alias directory.resources.features.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {string} params.featureKey The unique ID of the feature to update. + * @param {().Feature} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customer', 'featureKey'], + pathParams: ['customer', 'featureKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.rename + * @desc Renames a feature. + * @alias directory.resources.features.rename + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {string} params.oldName The unique ID of the feature to rename. + * @param {().FeatureRename} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rename(params?: any, options?: MethodOptions): AxiosPromise; + rename( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rename( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features/{oldName}/rename') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer', 'oldName'], + pathParams: ['customer', 'oldName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.resources.features.update + * @desc Updates a feature. + * @alias directory.resources.features.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + * @param {string} params.featureKey The unique ID of the feature to update. + * @param {().Feature} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/resources/features/{featureKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customer', 'featureKey'], + pathParams: ['customer', 'featureKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Roleassignments { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.roleAssignments.delete + * @desc Deletes a role assignment. + * @alias directory.roleAssignments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleAssignmentId Immutable ID of the role assignment. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'roleAssignmentId'], + pathParams: ['customer', 'roleAssignmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roleAssignments.get + * @desc Retrieve a role assignment. + * @alias directory.roleAssignments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleAssignmentId Immutable ID of the role assignment. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'roleAssignmentId'], + pathParams: ['customer', 'roleAssignmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roleAssignments.insert + * @desc Creates a role assignment. + * @alias directory.roleAssignments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {().RoleAssignment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roleassignments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roleAssignments.list + * @desc Retrieves a paginated list of all roleAssignments. + * @alias directory.roleAssignments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {string=} params.roleId Immutable ID of a role. If included in the request, returns only role assignments containing this role ID. + * @param {string=} params.userKey The user's primary email address, alias email address, or unique user ID. If included in the request, returns role assignments only for this user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roleassignments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Roles { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.roles.delete + * @desc Deletes a role. + * @alias directory.roles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleId Immutable ID of the role. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roles/{roleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customer', 'roleId'], + pathParams: ['customer', 'roleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roles.get + * @desc Retrieves a role. + * @alias directory.roles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleId Immutable ID of the role. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roles/{roleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer', 'roleId'], + pathParams: ['customer', 'roleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roles.insert + * @desc Creates a role. + * @alias directory.roles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {().Role} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customer/{customer}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roles.list + * @desc Retrieves a paginated list of all the roles in a domain. + * @alias directory.roles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Token to specify the next page in the list. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/customer/{customer}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customer'], + pathParams: ['customer'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roles.patch + * @desc Updates a role. This method supports patch semantics. + * @alias directory.roles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleId Immutable ID of the role. + * @param {().Role} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roles/{roleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customer', 'roleId'], + pathParams: ['customer', 'roleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.roles.update + * @desc Updates a role. + * @alias directory.roles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customer Immutable ID of the G Suite account. + * @param {string} params.roleId Immutable ID of the role. + * @param {().Role} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customer}/roles/{roleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customer', 'roleId'], + pathParams: ['customer', 'roleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Schemas { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.schemas.delete + * @desc Delete schema + * @alias directory.schemas.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.schemaKey Name or immutable ID of the schema + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customerId', 'schemaKey'], + pathParams: ['customerId', 'schemaKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.schemas.get + * @desc Retrieve schema + * @alias directory.schemas.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.schemaKey Name or immutable ID of the schema + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId', 'schemaKey'], + pathParams: ['customerId', 'schemaKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.schemas.insert + * @desc Create schema. + * @alias directory.schemas.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {().Schema} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.schemas.list + * @desc Retrieve all schemas for a customer + * @alias directory.schemas.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.schemas.patch + * @desc Update schema. This method supports patch semantics. + * @alias directory.schemas.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.schemaKey Name or immutable ID of the schema. + * @param {().Schema} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customerId', 'schemaKey'], + pathParams: ['customerId', 'schemaKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.schemas.update + * @desc Update schema + * @alias directory.schemas.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Immutable ID of the G Suite account + * @param {string} params.schemaKey Name or immutable ID of the schema. + * @param {().Schema} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customerId', 'schemaKey'], + pathParams: ['customerId', 'schemaKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Tokens { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.tokens.delete + * @desc Delete all access tokens issued by a user for an application. + * @alias directory.tokens.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clientId The Client ID of the application the token is issued to. + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/tokens/{clientId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userKey', 'clientId'], + pathParams: ['clientId', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.tokens.get + * @desc Get information about an access token issued by a user. + * @alias directory.tokens.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clientId The Client ID of the application the token is issued to. + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/tokens/{clientId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey', 'clientId'], + pathParams: ['clientId', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.tokens.list + * @desc Returns the set of tokens specified user has issued to 3rd party + * applications. + * @alias directory.tokens.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/tokens') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Users { + root: Admin; + aliases: Resource$Users$Aliases; + photos: Resource$Users$Photos; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + this.aliases = new Resource$Users$Aliases(root); + this.photos = new Resource$Users$Photos(root); + } + + getRoot() { + return this.root; + } + + + /** + * directory.users.delete + * @desc Delete user + * @alias directory.users.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.get + * @desc retrieve user + * @alias directory.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * @param {string=} params.projection What subset of fields to fetch for this user. + * @param {string} params.userKey Email or immutable ID of the user + * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.insert + * @desc create user. + * @alias directory.users.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.list + * @desc Retrieve either deleted users or all users in a domain (paginated) + * @alias directory.users.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * @param {string=} params.domain Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. + * @param {string=} params.event Event on which subscription is intended (if subscribing) + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. Max allowed is 500 + * @param {string=} params.orderBy Column to use for sorting results + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.projection What subset of fields to fetch for this user. + * @param {string=} params.query Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users + * @param {string=} params.showDeleted If set to true retrieves the list of deleted users. Default is false + * @param {string=} params.sortOrder Whether to return results in ascending or descending order. + * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.makeAdmin + * @desc change admin status of a user + * @alias directory.users.makeAdmin + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user as admin + * @param {().UserMakeAdmin} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + makeAdmin(params?: any, options?: MethodOptions): AxiosPromise; + makeAdmin( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + makeAdmin( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/makeAdmin') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.patch + * @desc update user. This method supports patch semantics. + * @alias directory.users.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user. If ID, it should match with id of user object + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.undelete + * @desc Undelete a deleted user + * @alias directory.users.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey The immutable id of the user + * @param {().UserUndelete} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): AxiosPromise; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.update + * @desc update user + * @alias directory.users.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user. If ID, it should match with id of user object + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.watch + * @desc Watch for changes in users list + * @alias directory.users.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customer Immutable ID of the G Suite account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + * @param {string=} params.customFieldMask Comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom. + * @param {string=} params.domain Name of the domain. Fill this field to get users from only this domain. To return all users in a multi-domain fill customer field instead. + * @param {string=} params.event Event on which subscription is intended (if subscribing) + * @param {integer=} params.maxResults Maximum number of results to return. Default is 100. Max allowed is 500 + * @param {string=} params.orderBy Column to use for sorting results + * @param {string=} params.pageToken Token to specify next page in the list + * @param {string=} params.projection What subset of fields to fetch for this user. + * @param {string=} params.query Query string search. Should be of the form "". Complete documentation is at https://developers.google.com/admin-sdk/directory/v1/guides/search-users + * @param {string=} params.showDeleted If set to true retrieves the list of deleted users. Default is false + * @param {string=} params.sortOrder Whether to return results in ascending or descending order. + * @param {string=} params.viewType Whether to fetch the ADMIN_VIEW or DOMAIN_PUBLIC view of the user. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Users$Aliases { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.users.aliases.delete + * @desc Remove a alias for the user + * @alias directory.users.aliases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.alias The alias to be removed + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/aliases/{alias}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userKey', 'alias'], + pathParams: ['alias', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.aliases.insert + * @desc Add a alias for the user + * @alias directory.users.aliases.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {().Alias} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.aliases.list + * @desc List all aliases for a user + * @alias directory.users.aliases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.event Event on which subscription is intended (if subscribing) + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/directory/v1/users/{userKey}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.aliases.watch + * @desc Watch for changes in user aliases list + * @alias directory.users.aliases.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.event Event on which subscription is intended (if subscribing) + * @param {string} params.userKey Email or immutable ID of the user + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/aliases/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Users$Photos { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.users.photos.delete + * @desc Remove photos for the user + * @alias directory.users.photos.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/photos/thumbnail') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.photos.get + * @desc Retrieve photo of a user + * @alias directory.users.photos.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/photos/thumbnail') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.photos.patch + * @desc Add a photo for the user. This method supports patch semantics. + * @alias directory.users.photos.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {().UserPhoto} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/photos/thumbnail') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.users.photos.update + * @desc Add a photo for the user + * @alias directory.users.photos.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {().UserPhoto} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/photos/thumbnail') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Verificationcodes { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * directory.verificationCodes.generate + * @desc Generate new backup verification codes for the user. + * @alias directory.verificationCodes.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): AxiosPromise; + generate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/users/{userKey}/verificationCodes/generate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.verificationCodes.invalidate + * @desc Invalidate the current backup verification codes for the user. + * @alias directory.verificationCodes.invalidate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Email or immutable ID of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + invalidate(params?: any, options?: MethodOptions): AxiosPromise; + invalidate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + invalidate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/directory/v1/users/{userKey}/verificationCodes/invalidate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * directory.verificationCodes.list + * @desc Returns the current set of valid backup verification codes for the + * specified user. + * @alias directory.verificationCodes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userKey Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/directory/v1/users/{userKey}/verificationCodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey'], + pathParams: ['userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/admin/reports_v1.ts b/src/apis/admin/reports_v1.ts index 69cf8fb0196..dd9356ad506 100644 --- a/src/apis/admin/reports_v1.ts +++ b/src/apis/admin/reports_v1.ts @@ -27,616 +27,624 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Admin Reports API - * - * Fetches reports for the administrators of G Suite customers about the usage, - * collaboration, security, and risk for their users. - * - * @example - * const google = require('googleapis'); - * const admin = google.admin('reports_v1'); - * - * @namespace admin - * @type {Function} - * @version reports_v1 - * @variation reports_v1 - * @param {object=} options Options for Admin - */ -export class Admin { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - activities: Resource$Activities; - channels: Resource$Channels; - customerUsageReports: Resource$Customerusagereports; - entityUsageReports: Resource$Entityusagereports; - userUsageReport: Resource$Userusagereport; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.activities = new Resource$Activities(this); - this.channels = new Resource$Channels(this); - this.customerUsageReports = new Resource$Customerusagereports(this); - this.entityUsageReports = new Resource$Entityusagereports(this); - this.userUsageReport = new Resource$Userusagereport(this); - } +export namespace admin_reports_v1 { + /** + * Admin Reports API + * + * Fetches reports for the administrators of G Suite customers about the + * usage, collaboration, security, and risk for their users. + * + * @example + * const google = require('googleapis'); + * const admin = google.admin('reports_v1'); + * + * @namespace admin + * @type {Function} + * @version reports_v1 + * @variation reports_v1 + * @param {object=} options Options for Admin + */ + export class Admin { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + activities: Resource$Activities; + channels: Resource$Channels; + customerUsageReports: Resource$Customerusagereports; + entityUsageReports: Resource$Entityusagereports; + userUsageReport: Resource$Userusagereport; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.activities = new Resource$Activities(this); + this.channels = new Resource$Channels(this); + this.customerUsageReports = new Resource$Customerusagereports(this); + this.entityUsageReports = new Resource$Entityusagereports(this); + this.userUsageReport = new Resource$Userusagereport(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * JSON template for a collection of activites. - */ -export interface Schema$Activities { - /** - * ETag of the resource. - */ - etag: string; - /** - * Each record in read response. - */ - items: Schema$Activity[]; /** - * Kind of list response this is. - */ - kind: string; - /** - * Token for retrieving the next page - */ - nextPageToken: string; -} -/** - * JSON template for the activity resource. - */ -export interface Schema$Activity { - /** - * User doing the action. - */ - actor: any; - /** - * ETag of the entry. - */ - etag: string; - /** - * Activity events. - */ - events: any[]; - /** - * Unique identifier for each activity record. - */ - id: any; - /** - * IP Address of the user doing the action. - */ - ipAddress: string; - /** - * Kind of resource this is. - */ - kind: string; - /** - * Domain of source customer. - */ - ownerDomain: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * JSON template for a usage report. - */ -export interface Schema$UsageReport { - /** - * The date to which the record belongs. - */ - date: string; - /** - * Information about the type of the item. - */ - entity: any; - /** - * ETag of the resource. - */ - etag: string; - /** - * The kind of object. - */ - kind: string; - /** - * Parameter value pairs for various applications. - */ - parameters: any[]; -} -/** - * JSON template for a collection of usage reports. - */ -export interface Schema$UsageReports { - /** - * ETag of the resource. - */ - etag: string; - /** - * The kind of object. - */ - kind: string; + * JSON template for a collection of activites. + */ + export interface Schema$Activities { + /** + * ETag of the resource. + */ + etag: string; + /** + * Each record in read response. + */ + items: Schema$Activity[]; + /** + * Kind of list response this is. + */ + kind: string; + /** + * Token for retrieving the next page + */ + nextPageToken: string; + } /** - * Token for retrieving the next page - */ - nextPageToken: string; + * JSON template for the activity resource. + */ + export interface Schema$Activity { + /** + * User doing the action. + */ + actor: any; + /** + * ETag of the entry. + */ + etag: string; + /** + * Activity events. + */ + events: any[]; + /** + * Unique identifier for each activity record. + */ + id: any; + /** + * IP Address of the user doing the action. + */ + ipAddress: string; + /** + * Kind of resource this is. + */ + kind: string; + /** + * Domain of source customer. + */ + ownerDomain: string; + } /** - * Various application parameter records. - */ - usageReports: Schema$UsageReport[]; + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; + } /** - * Warnings if any. - */ - warnings: any[]; -} - -export class Resource$Activities { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); + * JSON template for a usage report. + */ + export interface Schema$UsageReport { + /** + * The date to which the record belongs. + */ + date: string; + /** + * Information about the type of the item. + */ + entity: any; + /** + * ETag of the resource. + */ + etag: string; + /** + * The kind of object. + */ + kind: string; + /** + * Parameter value pairs for various applications. + */ + parameters: any[]; } - - getRoot() { - return this.root; + /** + * JSON template for a collection of usage reports. + */ + export interface Schema$UsageReports { + /** + * ETag of the resource. + */ + etag: string; + /** + * The kind of object. + */ + kind: string; + /** + * Token for retrieving the next page + */ + nextPageToken: string; + /** + * Various application parameter records. + */ + usageReports: Schema$UsageReport[]; + /** + * Warnings if any. + */ + warnings: any[]; } - - /** - * reports.activities.list - * @desc Retrieves a list of activities for a specific customer and - * application. - * @alias reports.activities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. - * @param {string} params.applicationName Application name for which the events are to be retrieved. - * @param {string=} params.customerId Represents the customer for which the data is to be fetched. - * @param {string=} params.endTime Return events which occurred at or before this time. - * @param {string=} params.eventName Name of the event being queried. - * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... - * @param {integer=} params.maxResults Number of activity records to be shown in each page. - * @param {string=} params.pageToken Token to specify next page. - * @param {string=} params.startTime Return events which occurred at or after this time. - * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Activities { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey', 'applicationName'], - pathParams: ['applicationName', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * reports.activities.watch - * @desc Push changes to activities - * @alias reports.activities.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. - * @param {string} params.applicationName Application name for which the events are to be retrieved. - * @param {string=} params.customerId Represents the customer for which the data is to be fetched. - * @param {string=} params.endTime Return events which occurred at or before this time. - * @param {string=} params.eventName Name of the event being queried. - * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... - * @param {integer=} params.maxResults Number of activity records to be shown in each page. - * @param {string=} params.pageToken Token to specify next page. - * @param {string=} params.startTime Return events which occurred at or after this time. - * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reports.activities.list + * @desc Retrieves a list of activities for a specific customer and + * application. + * @alias reports.activities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. + * @param {string} params.applicationName Application name for which the events are to be retrieved. + * @param {string=} params.customerId Represents the customer for which the data is to be fetched. + * @param {string=} params.endTime Return events which occurred at or before this time. + * @param {string=} params.eventName Name of the event being queried. + * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... + * @param {integer=} params.maxResults Number of activity records to be shown in each page. + * @param {string=} params.pageToken Token to specify next page. + * @param {string=} params.startTime Return events which occurred at or after this time. + * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey', 'applicationName'], + pathParams: ['applicationName', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userKey', 'applicationName'], - pathParams: ['applicationName', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Channels { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * reports.activities.watch + * @desc Push changes to activities + * @alias reports.activities.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.actorIpAddress IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. + * @param {string} params.applicationName Application name for which the events are to be retrieved. + * @param {string=} params.customerId Represents the customer for which the data is to be fetched. + * @param {string=} params.endTime Return events which occurred at or before this time. + * @param {string=} params.eventName Name of the event being queried. + * @param {string=} params.filters Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... + * @param {integer=} params.maxResults Number of activity records to be shown in each page. + * @param {string=} params.pageToken Token to specify next page. + * @param {string=} params.startTime Return events which occurred at or after this time. + * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userKey', 'applicationName'], + pathParams: ['applicationName', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * admin.channels.stop - * @desc Stop watching resources through this channel - * @alias admin.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Channels { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/reports/v1/admin/reports_v1/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Customerusagereports { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * admin.channels.stop + * @desc Stop watching resources through this channel + * @alias admin.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/admin/reports/v1/admin/reports_v1/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * reports.customerUsageReports.get - * @desc Retrieves a report which is a collection of properties / statistics - * for a specific customer. - * @alias reports.customerUsageReports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customerId Represents the customer for which the data is to be fetched. - * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. - * @param {string=} params.pageToken Token to specify next page. - * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Customerusagereports { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/admin/reports/v1/usage/dates/{date}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['date'], - pathParams: ['date'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Entityusagereports { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * reports.customerUsageReports.get + * @desc Retrieves a report which is a collection of properties / statistics + * for a specific customer. + * @alias reports.customerUsageReports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customerId Represents the customer for which the data is to be fetched. + * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. + * @param {string=} params.pageToken Token to specify next page. + * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/admin/reports/v1/usage/dates/{date}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['date'], + pathParams: ['date'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * reports.entityUsageReports.get - * @desc Retrieves a report which is a collection of properties / statistics - * for a set of objects. - * @alias reports.entityUsageReports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customerId Represents the customer for which the data is to be fetched. - * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. - * @param {string} params.entityKey Represents the key of object for which the data should be filtered. - * @param {string} params.entityType Type of object. Should be one of - gplus_communities. - * @param {string=} params.filters Represents the set of filters including parameter operator value. - * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 - * @param {string=} params.pageToken Token to specify next page. - * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Entityusagereports { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['entityType', 'entityKey', 'date'], - pathParams: ['date', 'entityKey', 'entityType'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Userusagereport { - root: Admin; - constructor(root: Admin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * reports.entityUsageReports.get + * @desc Retrieves a report which is a collection of properties / statistics + * for a set of objects. + * @alias reports.entityUsageReports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customerId Represents the customer for which the data is to be fetched. + * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. + * @param {string} params.entityKey Represents the key of object for which the data should be filtered. + * @param {string} params.entityType Type of object. Should be one of - gplus_communities. + * @param {string=} params.filters Represents the set of filters including parameter operator value. + * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 + * @param {string=} params.pageToken Token to specify next page. + * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['entityType', 'entityKey', 'date'], + pathParams: ['date', 'entityKey', 'entityType'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * reports.userUsageReport.get - * @desc Retrieves a report which is a collection of properties / statistics - * for a set of users. - * @alias reports.userUsageReport.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customerId Represents the customer for which the data is to be fetched. - * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. - * @param {string=} params.filters Represents the set of filters including parameter operator value. - * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 - * @param {string=} params.pageToken Token to specify next page. - * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. - * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Userusagereport { + root: Admin; + constructor(root: Admin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/admin/reports/v1/usage/users/{userKey}/dates/{date}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userKey', 'date'], - pathParams: ['date', 'userKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * reports.userUsageReport.get + * @desc Retrieves a report which is a collection of properties / statistics + * for a set of users. + * @alias reports.userUsageReport.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customerId Represents the customer for which the data is to be fetched. + * @param {string} params.date Represents the date in yyyy-mm-dd format for which the data is to be fetched. + * @param {string=} params.filters Represents the set of filters including parameter operator value. + * @param {integer=} params.maxResults Maximum number of results to return. Maximum allowed is 1000 + * @param {string=} params.pageToken Token to specify next page. + * @param {string=} params.parameters Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. + * @param {string} params.userKey Represents the profile id or the user email for which the data should be filtered. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/admin/reports/v1/usage/users/{userKey}/dates/{date}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userKey', 'date'], + pathParams: ['date', 'userKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adsense/v1.4.ts b/src/apis/adsense/v1.4.ts index 1e79af4a135..5cc07665eee 100644 --- a/src/apis/adsense/v1.4.ts +++ b/src/apis/adsense/v1.4.ts @@ -27,3052 +27,3086 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * AdSense Management API - * - * Accesses AdSense publishers' inventory and generates performance reports. - * - * @example - * const google = require('googleapis'); - * const adsense = google.adsense('v1.4'); - * - * @namespace adsense - * @type {Function} - * @version v1.4 - * @variation v1.4 - * @param {object=} options Options for Adsense - */ -export class Adsense { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - adclients: Resource$Adclients; - adunits: Resource$Adunits; - alerts: Resource$Alerts; - customchannels: Resource$Customchannels; - metadata: Resource$Metadata; - payments: Resource$Payments; - reports: Resource$Reports; - savedadstyles: Resource$Savedadstyles; - urlchannels: Resource$Urlchannels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.adclients = new Resource$Adclients(this); - this.adunits = new Resource$Adunits(this); - this.alerts = new Resource$Alerts(this); - this.customchannels = new Resource$Customchannels(this); - this.metadata = new Resource$Metadata(this); - this.payments = new Resource$Payments(this); - this.reports = new Resource$Reports(this); - this.savedadstyles = new Resource$Savedadstyles(this); - this.urlchannels = new Resource$Urlchannels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Account { - creation_time: string; - /** - * Unique identifier of this account. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#account. - */ - kind: string; - /** - * Name of this account. - */ - name: string; - /** - * Whether this account is premium. - */ - premium: boolean; - /** - * Sub accounts of the this account. - */ - subAccounts: Schema$Account[]; - /** - * AdSense timezone of this account. - */ - timezone: string; -} -export interface Schema$Accounts { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The accounts returned in this list response. - */ - items: Schema$Account[]; - /** - * Kind of list this is, in this case adsense#accounts. - */ - kind: string; - /** - * Continuation token used to page through accounts. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$AdClient { - /** - * Whether this ad client is opted in to ARC. - */ - arcOptIn: boolean; - /** - * Unique identifier of this ad client. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#adClient. - */ - kind: string; - /** - * This ad client's product code, which corresponds to the PRODUCT_CODE - * report dimension. - */ - productCode: string; - /** - * Whether this ad client supports being reported on. - */ - supportsReporting: boolean; -} -export interface Schema$AdClients { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad clients returned in this list response. - */ - items: Schema$AdClient[]; - /** - * Kind of list this is, in this case adsense#adClients. - */ - kind: string; - /** - * Continuation token used to page through ad clients. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$AdCode { - /** - * The ad code snippet. - */ - adCode: string; - /** - * Kind this is, in this case adsense#adCode. - */ - kind: string; -} -export interface Schema$AdsenseReportsGenerateResponse { - /** - * The averages of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - averages: string[]; - /** - * The requested end date in yyyy-mm-dd format. - */ - endDate: string; - /** - * The header information of the columns requested in the report. This is a - * list of headers; one for each dimension in the request, followed by one for - * each metric in the request. - */ - headers: any[]; - /** - * Kind this is, in this case adsense#report. - */ - kind: string; - /** - * The output rows of the report. Each row is a list of cells; one for each - * dimension in the request, followed by one for each metric in the request. - * The dimension cells contain strings, and the metric cells contain numbers. - */ - rows: string[][]; - /** - * The requested start date in yyyy-mm-dd format. - */ - startDate: string; - /** - * The total number of rows matched by the report request. Fewer rows may be - * returned in the response due to being limited by the row count requested or - * the report row limit. - */ - totalMatchedRows: string; - /** - * The totals of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - totals: string[]; - /** - * Any warnings associated with generation of the report. - */ - warnings: string[]; -} -export interface Schema$AdStyle { - /** - * The colors which are included in the style. These are represented as six - * hexadecimal characters, similar to HTML color codes, but without the - * leading hash. - */ - colors: any; - /** - * The style of the corners in the ad (deprecated: never populated, ignored). - */ - corners: string; - /** - * The font which is included in the style. - */ - font: any; - /** - * Kind this is, in this case adsense#adStyle. - */ - kind: string; -} -export interface Schema$AdUnit { - /** - * Identity code of this ad unit, not necessarily unique across ad clients. - */ - code: string; - /** - * Settings specific to content ads (AFC) and highend mobile content ads (AFMC - * - deprecated). - */ - contentAdsSettings: any; - /** - * Custom style information specific to this ad unit. - */ - customStyle: Schema$AdStyle; - /** - * Settings specific to feed ads (AFF) - deprecated. - */ - feedAdsSettings: any; - /** - * Unique identifier of this ad unit. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#adUnit. - */ - kind: string; - /** - * Settings specific to WAP mobile content ads (AFMC) - deprecated. - */ - mobileContentAdsSettings: any; - /** - * Name of this ad unit. - */ - name: string; - /** - * ID of the saved ad style which holds this ad unit's style information. - */ - savedStyleId: string; - /** - * Status of this ad unit. Possible values are: NEW: Indicates that the ad - * unit was created within the last seven days and does not yet have any - * activity associated with it. ACTIVE: Indicates that there has been - * activity on this ad unit in the last seven days. INACTIVE: Indicates that - * there has been no activity on this ad unit in the last seven days. - */ - status: string; -} -export interface Schema$AdUnits { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad units returned in this list response. - */ - items: Schema$AdUnit[]; - /** - * Kind of list this is, in this case adsense#adUnits. - */ - kind: string; - /** - * Continuation token used to page through ad units. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$Alert { - /** - * Unique identifier of this alert. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Whether this alert can be dismissed. - */ - isDismissible: boolean; - /** - * Kind of resource this is, in this case adsense#alert. - */ - kind: string; - /** - * The localized alert message. - */ - message: string; - /** - * Severity of this alert. Possible values: INFO, WARNING, SEVERE. - */ - severity: string; - /** - * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, - * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, - * GRAYLISTED_PUBLISHER, API_HOLD. - */ - type: string; -} -export interface Schema$Alerts { - /** - * The alerts returned in this list response. - */ - items: Schema$Alert[]; - /** - * Kind of list this is, in this case adsense#alerts. - */ - kind: string; -} -export interface Schema$CustomChannel { - /** - * Code of this custom channel, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this custom channel. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#customChannel. - */ - kind: string; - /** - * Name of this custom channel. - */ - name: string; - /** - * The targeting information of this custom channel, if activated. - */ - targetingInfo: any; -} -export interface Schema$CustomChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The custom channels returned in this list response. - */ - items: Schema$CustomChannel[]; - /** - * Kind of list this is, in this case adsense#customChannels. - */ - kind: string; - /** - * Continuation token used to page through custom channels. To retrieve the - * next page of results, set the next request's "pageToken" - * value to this. - */ - nextPageToken: string; -} -export interface Schema$Metadata { - items: Schema$ReportingMetadataEntry[]; - /** - * Kind of list this is, in this case adsense#metadata. - */ - kind: string; -} -export interface Schema$Payment { - /** - * Unique identifier of this Payment. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#payment. - */ - kind: string; - /** - * The amount to be paid. - */ - paymentAmount: string; - /** - * The currency code for the amount to be paid. - */ - paymentAmountCurrencyCode: string; - /** - * The date this payment was/will be credited to the user, or none if the - * payment threshold has not been met. - */ - paymentDate: string; -} -export interface Schema$Payments { - /** - * The list of Payments for the account. One or both of a) the account's - * most recent payment; and b) the account's upcoming payment. - */ - items: Schema$Payment[]; - /** - * Kind of list this is, in this case adsense#payments. - */ - kind: string; -} -export interface Schema$ReportingMetadataEntry { - /** - * For metrics this is a list of dimension IDs which the metric is compatible - * with, for dimensions it is a list of compatibility groups the dimension - * belongs to. - */ - compatibleDimensions: string[]; - /** - * The names of the metrics the dimension or metric this reporting metadata - * entry describes is compatible with. - */ - compatibleMetrics: string[]; - /** - * Unique identifier of this reporting metadata entry, corresponding to the - * name of the appropriate dimension or metric. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#reportingMetadataEntry. - */ - kind: string; - /** - * The names of the dimensions which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredDimensions: string[]; - /** - * The names of the metrics which the dimension or metric this reporting - * metadata entry describes requires to also be present in order for the - * report to be valid. Omitting these will not cause an error or warning, but - * may result in data which cannot be correctly interpreted. - */ - requiredMetrics: string[]; - /** - * The codes of the projects supported by the dimension or metric this - * reporting metadata entry describes. - */ - supportedProducts: string[]; -} -export interface Schema$SavedAdStyle { - /** - * The AdStyle itself. - */ - adStyle: Schema$AdStyle; - /** - * Unique identifier of this saved ad style. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#savedAdStyle. - */ - kind: string; - /** - * The user selected name of this SavedAdStyle. - */ - name: string; -} -export interface Schema$SavedAdStyles { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The saved ad styles returned in this list response. - */ - items: Schema$SavedAdStyle[]; - /** - * Kind of list this is, in this case adsense#savedAdStyles. - */ - kind: string; - /** - * Continuation token used to page through ad units. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$SavedReport { - /** - * Unique identifier of this saved report. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#savedReport. - */ - kind: string; - /** - * This saved report's name. - */ - name: string; -} -export interface Schema$SavedReports { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The saved reports returned in this list response. - */ - items: Schema$SavedReport[]; - /** - * Kind of list this is, in this case adsense#savedReports. - */ - kind: string; - /** - * Continuation token used to page through saved reports. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$UrlChannel { - /** - * Unique identifier of this URL channel. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adsense#urlChannel. - */ - kind: string; - /** - * URL Pattern of this URL channel. Does not include "http://" or - * "https://". Example: www.example.com/home - */ - urlPattern: string; -} -export interface Schema$UrlChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The URL channels returned in this list response. - */ - items: Schema$UrlChannel[]; - /** - * Kind of list this is, in this case adsense#urlChannels. - */ - kind: string; - /** - * Continuation token used to page through URL channels. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} - -export class Resource$Accounts { - root: Adsense; - adclients: Resource$Accounts$Adclients; - adunits: Resource$Accounts$Adunits; - alerts: Resource$Accounts$Alerts; - customchannels: Resource$Accounts$Customchannels; - payments: Resource$Accounts$Payments; - reports: Resource$Accounts$Reports; - savedadstyles: Resource$Accounts$Savedadstyles; - urlchannels: Resource$Accounts$Urlchannels; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.adclients = new Resource$Accounts$Adclients(root); - this.adunits = new Resource$Accounts$Adunits(root); - this.alerts = new Resource$Accounts$Alerts(root); - this.customchannels = new Resource$Accounts$Customchannels(root); - this.payments = new Resource$Accounts$Payments(root); - this.reports = new Resource$Accounts$Reports(root); - this.savedadstyles = new Resource$Accounts$Savedadstyles(root); - this.urlchannels = new Resource$Accounts$Urlchannels(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.get - * @desc Get information about the selected AdSense account. - * @alias adsense.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to get information about. - * @param {boolean=} params.tree Whether the tree of sub accounts should be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.list - * @desc List all accounts available to this AdSense account. - * @alias adsense.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of accounts to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Adclients { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.adclients.list - * @desc List all ad clients in the specified account. - * @alias adsense.accounts.adclients.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to list ad clients. - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Adunits { - root: Adsense; - customchannels: Resource$Accounts$Adunits$Customchannels; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.customchannels = new Resource$Accounts$Adunits$Customchannels(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.adunits.get - * @desc Gets the specified ad unit in the specified ad client for the - * specified account. - * @alias adsense.accounts.adunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to get the ad unit. - * @param {string} params.adUnitId Ad unit to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.adunits.getAdCode - * @desc Get ad code for the specified ad unit. - * @alias adsense.accounts.adunits.getAdCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client with contains the ad unit. - * @param {string} params.adUnitId Ad unit to get the code for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAdCode(params?: any, options?: MethodOptions): AxiosPromise; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.adunits.list - * @desc List all ad units in the specified ad client for the specified - * account. - * @alias adsense.accounts.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Adunits$Customchannels { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.adunits.customchannels.list - * @desc List all custom channels which the specified ad unit belongs to. - * @alias adsense.accounts.adunits.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {string} params.adUnitId Ad unit for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Alerts { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.alerts.delete - * @desc Dismiss (delete) the specified alert from the specified publisher - * AdSense account. - * @alias adsense.accounts.alerts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad unit. - * @param {string} params.alertId Alert to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsense/v1.4/accounts/{accountId}/alerts/{alertId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'alertId'], - pathParams: ['accountId', 'alertId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.alerts.list - * @desc List the alerts for the specified AdSense account. - * @alias adsense.accounts.alerts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to retrieve the alerts. - * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/alerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Customchannels { - root: Adsense; - adunits: Resource$Accounts$Customchannels$Adunits; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.adunits = new Resource$Accounts$Customchannels$Adunits(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.customchannels.get - * @desc Get the specified custom channel from the specified ad client for the - * specified account. - * @alias adsense.accounts.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'customChannelId'], - pathParams: ['accountId', 'adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.customchannels.list - * @desc List all custom channels in the specified ad client for the specified - * account. - * @alias adsense.accounts.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Customchannels$Adunits { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.customchannels.adunits.list - * @desc List all ad units in the specified custom channel. - * @alias adsense.accounts.customchannels.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'customChannelId'], - pathParams: ['accountId', 'adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Payments { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.payments.list - * @desc List the payments for the specified AdSense account. - * @alias adsense.accounts.payments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to retrieve the payments. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/payments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Reports { - root: Adsense; - saved: Resource$Accounts$Reports$Saved; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.saved = new Resource$Accounts$Reports$Saved(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.reports.generate - * @desc Generate an AdSense report based on the report request sent in the - * query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adsense.accounts.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account upon which to report. - * @param {string=} params.currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {boolean=} params.useTimezoneReporting Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): - AxiosPromise; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'startDate', 'endDate'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Accounts$Reports$Saved { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.reports.saved.generate - * @desc Generate an AdSense report based on the saved report ID sent in the - * query parameters. - * @alias adsense.accounts.reports.saved.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the saved reports belong. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string} params.savedReportId The saved report to retrieve. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): - AxiosPromise; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsense/v1.4/accounts/{accountId}/reports/{savedReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'savedReportId'], - pathParams: ['accountId', 'savedReportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * adsense.accounts.reports.saved.list - * @desc List all saved reports in the specified AdSense account. - * @alias adsense.accounts.reports.saved.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the saved reports belong. - * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/reports/saved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Savedadstyles { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.savedadstyles.get - * @desc List a specific saved ad style for the specified account. - * @alias adsense.accounts.savedadstyles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to get the saved ad style. - * @param {string} params.savedAdStyleId Saved ad style to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/savedadstyles/{savedAdStyleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'savedAdStyleId'], - pathParams: ['accountId', 'savedAdStyleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.accounts.savedadstyles.list - * @desc List all saved ad styles in the specified account. - * @alias adsense.accounts.savedadstyles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to list saved ad styles. - * @param {integer=} params.maxResults The maximum number of saved ad styles to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/savedadstyles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Urlchannels { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.accounts.urlchannels.list - * @desc List all URL channels in the specified ad client for the specified - * account. - * @alias adsense.accounts.urlchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to which the ad client belongs. - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Adclients { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.adclients.list - * @desc List all ad clients in this AdSense account. - * @alias adsense.adclients.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Adunits { - root: Adsense; - customchannels: Resource$Adunits$Customchannels; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.customchannels = new Resource$Adunits$Customchannels(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.adunits.get - * @desc Gets the specified ad unit in the specified ad client. - * @alias adsense.adunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to get the ad unit. - * @param {string} params.adUnitId Ad unit to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.adunits.getAdCode - * @desc Get ad code for the specified ad unit. - * @alias adsense.adunits.getAdCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client with contains the ad unit. - * @param {string} params.adUnitId Ad unit to get the code for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAdCode(params?: any, options?: MethodOptions): AxiosPromise; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/adcode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.adunits.list - * @desc List all ad units in the specified ad client for this AdSense - * account. - * @alias adsense.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Adunits$Customchannels { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.adunits.customchannels.list - * @desc List all custom channels which the specified ad unit belongs to. - * @alias adsense.adunits.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {string} params.adUnitId Ad unit for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'adUnitId'], - pathParams: ['adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Alerts { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.alerts.delete - * @desc Dismiss (delete) the specified alert from the publisher's AdSense - * account. - * @alias adsense.alerts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.alertId Alert to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/alerts/{alertId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['alertId'], - pathParams: ['alertId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.alerts.list - * @desc List the alerts for this AdSense account. - * @alias adsense.alerts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/alerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Customchannels { - root: Adsense; - adunits: Resource$Customchannels$Adunits; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.adunits = new Resource$Customchannels$Adunits(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.customchannels.get - * @desc Get the specified custom channel from the specified ad client. - * @alias adsense.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.customchannels.list - * @desc List all custom channels in the specified ad client for this AdSense - * account. - * @alias adsense.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Customchannels$Adunits { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.customchannels.adunits.list - * @desc List all ad units in the specified custom channel. - * @alias adsense.customchannels.adunits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client which contains the custom channel. - * @param {string} params.customChannelId Custom channel for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Metadata { - root: Adsense; - dimensions: Resource$Metadata$Dimensions; - metrics: Resource$Metadata$Metrics; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.dimensions = new Resource$Metadata$Dimensions(root); - this.metrics = new Resource$Metadata$Metrics(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Metadata$Dimensions { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.metadata.dimensions.list - * @desc List the metadata for the dimensions available to this AdSense - * account. - * @alias adsense.metadata.dimensions.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/metadata/dimensions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Metadata$Metrics { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.metadata.metrics.list - * @desc List the metadata for the metrics available to this AdSense account. - * @alias adsense.metadata.metrics.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/metadata/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Payments { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.payments.list - * @desc List the payments for this AdSense account. - * @alias adsense.payments.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/payments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports { - root: Adsense; - saved: Resource$Reports$Saved; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - this.saved = new Resource$Reports$Saved(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.reports.generate - * @desc Generate an AdSense report based on the report request sent in the - * query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adsense.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.accountId Accounts upon which to report. - * @param {string=} params.currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {boolean=} params.useTimezoneReporting Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): - AxiosPromise; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['startDate', 'endDate'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Reports$Saved { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.reports.saved.generate - * @desc Generate an AdSense report based on the saved report ID sent in the - * query parameters. - * @alias adsense.reports.saved.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string} params.savedReportId The saved report to retrieve. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): - AxiosPromise; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/reports/{savedReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['savedReportId'], - pathParams: ['savedReportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * adsense.reports.saved.list - * @desc List all saved reports in this AdSense account. - * @alias adsense.reports.saved.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/reports/saved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Savedadstyles { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace adsense_v1_4 { /** - * adsense.savedadstyles.get - * @desc Get a specific saved ad style from the user's account. - * @alias adsense.savedadstyles.get - * @memberOf! () + * AdSense Management API * - * @param {object} params Parameters for request - * @param {string} params.savedAdStyleId Saved ad style to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/savedadstyles/{savedAdStyleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['savedAdStyleId'], - pathParams: ['savedAdStyleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsense.savedadstyles.list - * @desc List all saved ad styles in the user's account. - * @alias adsense.savedadstyles.list - * @memberOf! () + * Accesses AdSense publishers' inventory and generates performance + * reports. * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of saved ad styles to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/savedadstyles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Urlchannels { - root: Adsense; - constructor(root: Adsense) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsense.urlchannels.list - * @desc List all URL channels in the specified ad client for this AdSense - * account. - * @alias adsense.urlchannels.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const adsense = google.adsense('v1.4'); * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsense/v1.4/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace adsense + * @type {Function} + * @version v1.4 + * @variation v1.4 + * @param {object=} options Options for Adsense + */ + export class Adsense { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + adclients: Resource$Adclients; + adunits: Resource$Adunits; + alerts: Resource$Alerts; + customchannels: Resource$Customchannels; + metadata: Resource$Metadata; + payments: Resource$Payments; + reports: Resource$Reports; + savedadstyles: Resource$Savedadstyles; + urlchannels: Resource$Urlchannels; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.adclients = new Resource$Adclients(this); + this.adunits = new Resource$Adunits(this); + this.alerts = new Resource$Alerts(this); + this.customchannels = new Resource$Customchannels(this); + this.metadata = new Resource$Metadata(this); + this.payments = new Resource$Payments(this); + this.reports = new Resource$Reports(this); + this.savedadstyles = new Resource$Savedadstyles(this); + this.urlchannels = new Resource$Urlchannels(this); + } + + getRoot() { + return this.root; + } + } + + export interface Schema$Account { + creation_time: string; + /** + * Unique identifier of this account. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#account. + */ + kind: string; + /** + * Name of this account. + */ + name: string; + /** + * Whether this account is premium. + */ + premium: boolean; + /** + * Sub accounts of the this account. + */ + subAccounts: Schema$Account[]; + /** + * AdSense timezone of this account. + */ + timezone: string; + } + export interface Schema$Accounts { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The accounts returned in this list response. + */ + items: Schema$Account[]; + /** + * Kind of list this is, in this case adsense#accounts. + */ + kind: string; + /** + * Continuation token used to page through accounts. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } + export interface Schema$AdClient { + /** + * Whether this ad client is opted in to ARC. + */ + arcOptIn: boolean; + /** + * Unique identifier of this ad client. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#adClient. + */ + kind: string; + /** + * This ad client's product code, which corresponds to the PRODUCT_CODE + * report dimension. + */ + productCode: string; + /** + * Whether this ad client supports being reported on. + */ + supportsReporting: boolean; + } + export interface Schema$AdClients { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad clients returned in this list response. + */ + items: Schema$AdClient[]; + /** + * Kind of list this is, in this case adsense#adClients. + */ + kind: string; + /** + * Continuation token used to page through ad clients. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } + export interface Schema$AdCode { + /** + * The ad code snippet. + */ + adCode: string; + /** + * Kind this is, in this case adsense#adCode. + */ + kind: string; + } + export interface Schema$AdsenseReportsGenerateResponse { + /** + * The averages of the report. This is the same length as any other row in + * the report; cells corresponding to dimension columns are empty. + */ + averages: string[]; + /** + * The requested end date in yyyy-mm-dd format. + */ + endDate: string; + /** + * The header information of the columns requested in the report. This is a + * list of headers; one for each dimension in the request, followed by one + * for each metric in the request. + */ + headers: any[]; + /** + * Kind this is, in this case adsense#report. + */ + kind: string; + /** + * The output rows of the report. Each row is a list of cells; one for each + * dimension in the request, followed by one for each metric in the request. + * The dimension cells contain strings, and the metric cells contain + * numbers. + */ + rows: string[][]; + /** + * The requested start date in yyyy-mm-dd format. + */ + startDate: string; + /** + * The total number of rows matched by the report request. Fewer rows may be + * returned in the response due to being limited by the row count requested + * or the report row limit. + */ + totalMatchedRows: string; + /** + * The totals of the report. This is the same length as any other row in the + * report; cells corresponding to dimension columns are empty. + */ + totals: string[]; + /** + * Any warnings associated with generation of the report. + */ + warnings: string[]; + } + export interface Schema$AdStyle { + /** + * The colors which are included in the style. These are represented as six + * hexadecimal characters, similar to HTML color codes, but without the + * leading hash. + */ + colors: any; + /** + * The style of the corners in the ad (deprecated: never populated, + * ignored). + */ + corners: string; + /** + * The font which is included in the style. + */ + font: any; + /** + * Kind this is, in this case adsense#adStyle. + */ + kind: string; + } + export interface Schema$AdUnit { + /** + * Identity code of this ad unit, not necessarily unique across ad clients. + */ + code: string; + /** + * Settings specific to content ads (AFC) and highend mobile content ads + * (AFMC - deprecated). + */ + contentAdsSettings: any; + /** + * Custom style information specific to this ad unit. + */ + customStyle: Schema$AdStyle; + /** + * Settings specific to feed ads (AFF) - deprecated. + */ + feedAdsSettings: any; + /** + * Unique identifier of this ad unit. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#adUnit. + */ + kind: string; + /** + * Settings specific to WAP mobile content ads (AFMC) - deprecated. + */ + mobileContentAdsSettings: any; + /** + * Name of this ad unit. + */ + name: string; + /** + * ID of the saved ad style which holds this ad unit's style + * information. + */ + savedStyleId: string; + /** + * Status of this ad unit. Possible values are: NEW: Indicates that the ad + * unit was created within the last seven days and does not yet have any + * activity associated with it. ACTIVE: Indicates that there has been + * activity on this ad unit in the last seven days. INACTIVE: Indicates + * that there has been no activity on this ad unit in the last seven days. + */ + status: string; + } + export interface Schema$AdUnits { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad units returned in this list response. + */ + items: Schema$AdUnit[]; + /** + * Kind of list this is, in this case adsense#adUnits. + */ + kind: string; + /** + * Continuation token used to page through ad units. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } + export interface Schema$Alert { + /** + * Unique identifier of this alert. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Whether this alert can be dismissed. + */ + isDismissible: boolean; + /** + * Kind of resource this is, in this case adsense#alert. + */ + kind: string; + /** + * The localized alert message. + */ + message: string; + /** + * Severity of this alert. Possible values: INFO, WARNING, SEVERE. + */ + severity: string; + /** + * Type of this alert. Possible values: SELF_HOLD, MIGRATED_TO_BILLING3, + * ADDRESS_PIN_VERIFICATION, PHONE_PIN_VERIFICATION, CORPORATE_ENTITY, + * GRAYLISTED_PUBLISHER, API_HOLD. + */ + type: string; + } + export interface Schema$Alerts { + /** + * The alerts returned in this list response. + */ + items: Schema$Alert[]; + /** + * Kind of list this is, in this case adsense#alerts. + */ + kind: string; + } + export interface Schema$CustomChannel { + /** + * Code of this custom channel, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this custom channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#customChannel. + */ + kind: string; + /** + * Name of this custom channel. + */ + name: string; + /** + * The targeting information of this custom channel, if activated. + */ + targetingInfo: any; + } + export interface Schema$CustomChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The custom channels returned in this list response. + */ + items: Schema$CustomChannel[]; + /** + * Kind of list this is, in this case adsense#customChannels. + */ + kind: string; + /** + * Continuation token used to page through custom channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$Metadata { + items: Schema$ReportingMetadataEntry[]; + /** + * Kind of list this is, in this case adsense#metadata. + */ + kind: string; + } + export interface Schema$Payment { + /** + * Unique identifier of this Payment. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#payment. + */ + kind: string; + /** + * The amount to be paid. + */ + paymentAmount: string; + /** + * The currency code for the amount to be paid. + */ + paymentAmountCurrencyCode: string; + /** + * The date this payment was/will be credited to the user, or none if the + * payment threshold has not been met. + */ + paymentDate: string; + } + export interface Schema$Payments { + /** + * The list of Payments for the account. One or both of a) the account's + * most recent payment; and b) the account's upcoming payment. + */ + items: Schema$Payment[]; + /** + * Kind of list this is, in this case adsense#payments. + */ + kind: string; + } + export interface Schema$ReportingMetadataEntry { + /** + * For metrics this is a list of dimension IDs which the metric is + * compatible with, for dimensions it is a list of compatibility groups the + * dimension belongs to. + */ + compatibleDimensions: string[]; + /** + * The names of the metrics the dimension or metric this reporting metadata + * entry describes is compatible with. + */ + compatibleMetrics: string[]; + /** + * Unique identifier of this reporting metadata entry, corresponding to the + * name of the appropriate dimension or metric. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#reportingMetadataEntry. + */ + kind: string; + /** + * The names of the dimensions which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredDimensions: string[]; + /** + * The names of the metrics which the dimension or metric this reporting + * metadata entry describes requires to also be present in order for the + * report to be valid. Omitting these will not cause an error or warning, + * but may result in data which cannot be correctly interpreted. + */ + requiredMetrics: string[]; + /** + * The codes of the projects supported by the dimension or metric this + * reporting metadata entry describes. + */ + supportedProducts: string[]; + } + export interface Schema$SavedAdStyle { + /** + * The AdStyle itself. + */ + adStyle: Schema$AdStyle; + /** + * Unique identifier of this saved ad style. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#savedAdStyle. + */ + kind: string; + /** + * The user selected name of this SavedAdStyle. + */ + name: string; + } + export interface Schema$SavedAdStyles { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The saved ad styles returned in this list response. + */ + items: Schema$SavedAdStyle[]; + /** + * Kind of list this is, in this case adsense#savedAdStyles. + */ + kind: string; + /** + * Continuation token used to page through ad units. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; + } + export interface Schema$SavedReport { + /** + * Unique identifier of this saved report. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#savedReport. + */ + kind: string; + /** + * This saved report's name. + */ + name: string; + } + export interface Schema$SavedReports { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The saved reports returned in this list response. + */ + items: Schema$SavedReport[]; + /** + * Kind of list this is, in this case adsense#savedReports. + */ + kind: string; + /** + * Continuation token used to page through saved reports. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + export interface Schema$UrlChannel { + /** + * Unique identifier of this URL channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adsense#urlChannel. + */ + kind: string; + /** + * URL Pattern of this URL channel. Does not include "http://" or + * "https://". Example: www.example.com/home + */ + urlPattern: string; + } + export interface Schema$UrlChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The URL channels returned in this list response. + */ + items: Schema$UrlChannel[]; + /** + * Kind of list this is, in this case adsense#urlChannels. + */ + kind: string; + /** + * Continuation token used to page through URL channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; + } + + export class Resource$Accounts { + root: Adsense; + adclients: Resource$Accounts$Adclients; + adunits: Resource$Accounts$Adunits; + alerts: Resource$Accounts$Alerts; + customchannels: Resource$Accounts$Customchannels; + payments: Resource$Accounts$Payments; + reports: Resource$Accounts$Reports; + savedadstyles: Resource$Accounts$Savedadstyles; + urlchannels: Resource$Accounts$Urlchannels; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.adclients = new Resource$Accounts$Adclients(root); + this.adunits = new Resource$Accounts$Adunits(root); + this.alerts = new Resource$Accounts$Alerts(root); + this.customchannels = new Resource$Accounts$Customchannels(root); + this.payments = new Resource$Accounts$Payments(root); + this.reports = new Resource$Accounts$Reports(root); + this.savedadstyles = new Resource$Accounts$Savedadstyles(root); + this.urlchannels = new Resource$Accounts$Urlchannels(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.get + * @desc Get information about the selected AdSense account. + * @alias adsense.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to get information about. + * @param {boolean=} params.tree Whether the tree of sub accounts should be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.list + * @desc List all accounts available to this AdSense account. + * @alias adsense.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of accounts to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through accounts. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Adclients { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.adclients.list + * @desc List all ad clients in the specified account. + * @alias adsense.accounts.adclients.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to list ad clients. + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Adunits { + root: Adsense; + customchannels: Resource$Accounts$Adunits$Customchannels; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.customchannels = new Resource$Accounts$Adunits$Customchannels(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.adunits.get + * @desc Gets the specified ad unit in the specified ad client for the + * specified account. + * @alias adsense.accounts.adunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to get the ad unit. + * @param {string} params.adUnitId Ad unit to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.adunits.getAdCode + * @desc Get ad code for the specified ad unit. + * @alias adsense.accounts.adunits.getAdCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client with contains the ad unit. + * @param {string} params.adUnitId Ad unit to get the code for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAdCode(params?: any, options?: MethodOptions): + AxiosPromise; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.adunits.list + * @desc List all ad units in the specified ad client for the specified + * account. + * @alias adsense.accounts.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Adunits$Customchannels { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.adunits.customchannels.list + * @desc List all custom channels which the specified ad unit belongs to. + * @alias adsense.accounts.adunits.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {string} params.adUnitId Ad unit for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Accounts$Alerts { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.alerts.delete + * @desc Dismiss (delete) the specified alert from the specified publisher + * AdSense account. + * @alias adsense.accounts.alerts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad unit. + * @param {string} params.alertId Alert to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsense/v1.4/accounts/{accountId}/alerts/{alertId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'alertId'], + pathParams: ['accountId', 'alertId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.alerts.list + * @desc List the alerts for the specified AdSense account. + * @alias adsense.accounts.alerts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to retrieve the alerts. + * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/alerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Customchannels { + root: Adsense; + adunits: Resource$Accounts$Customchannels$Adunits; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.adunits = new Resource$Accounts$Customchannels$Adunits(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.customchannels.get + * @desc Get the specified custom channel from the specified ad client for + * the specified account. + * @alias adsense.accounts.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'customChannelId'], + pathParams: ['accountId', 'adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.customchannels.list + * @desc List all custom channels in the specified ad client for the + * specified account. + * @alias adsense.accounts.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Customchannels$Adunits { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.customchannels.adunits.list + * @desc List all ad units in the specified custom channel. + * @alias adsense.accounts.customchannels.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/customchannels/{customChannelId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'customChannelId'], + pathParams: ['accountId', 'adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Accounts$Payments { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.payments.list + * @desc List the payments for the specified AdSense account. + * @alias adsense.accounts.payments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to retrieve the payments. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/payments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Reports { + root: Adsense; + saved: Resource$Accounts$Reports$Saved; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.saved = new Resource$Accounts$Reports$Saved(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.reports.generate + * @desc Generate an AdSense report based on the report request sent in the + * query parameters. Returns the result as JSON; to retrieve output in CSV + * format specify "alt=csv" as a query parameter. + * @alias adsense.accounts.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account upon which to report. + * @param {string=} params.currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {boolean=} params.useTimezoneReporting Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/accounts/{accountId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'startDate', 'endDate'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + export class Resource$Accounts$Reports$Saved { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.reports.saved.generate + * @desc Generate an AdSense report based on the saved report ID sent in the + * query parameters. + * @alias adsense.accounts.reports.saved.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the saved reports belong. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string} params.savedReportId The saved report to retrieve. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/reports/{savedReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'savedReportId'], + pathParams: ['accountId', 'savedReportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * adsense.accounts.reports.saved.list + * @desc List all saved reports in the specified AdSense account. + * @alias adsense.accounts.reports.saved.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the saved reports belong. + * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/adsense/v1.4/accounts/{accountId}/reports/saved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Accounts$Savedadstyles { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.savedadstyles.get + * @desc List a specific saved ad style for the specified account. + * @alias adsense.accounts.savedadstyles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to get the saved ad style. + * @param {string} params.savedAdStyleId Saved ad style to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/savedadstyles/{savedAdStyleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'savedAdStyleId'], + pathParams: ['accountId', 'savedAdStyleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.accounts.savedadstyles.list + * @desc List all saved ad styles in the specified account. + * @alias adsense.accounts.savedadstyles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to list saved ad styles. + * @param {integer=} params.maxResults The maximum number of saved ad styles to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/adsense/v1.4/accounts/{accountId}/savedadstyles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Urlchannels { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.accounts.urlchannels.list + * @desc List all URL channels in the specified ad client for the specified + * account. + * @alias adsense.accounts.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to which the ad client belongs. + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Adclients { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.adclients.list + * @desc List all ad clients in this AdSense account. + * @alias adsense.adclients.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Adunits { + root: Adsense; + customchannels: Resource$Adunits$Customchannels; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.customchannels = new Resource$Adunits$Customchannels(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.adunits.get + * @desc Gets the specified ad unit in the specified ad client. + * @alias adsense.adunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to get the ad unit. + * @param {string} params.adUnitId Ad unit to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.adunits.getAdCode + * @desc Get ad code for the specified ad unit. + * @alias adsense.adunits.getAdCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client with contains the ad unit. + * @param {string} params.adUnitId Ad unit to get the code for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAdCode(params?: any, options?: MethodOptions): + AxiosPromise; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/adcode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.adunits.list + * @desc List all ad units in the specified ad client for this AdSense + * account. + * @alias adsense.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Adunits$Customchannels { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.adunits.customchannels.list + * @desc List all custom channels which the specified ad unit belongs to. + * @alias adsense.adunits.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {string} params.adUnitId Ad unit for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'adUnitId'], + pathParams: ['adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Alerts { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.alerts.delete + * @desc Dismiss (delete) the specified alert from the publisher's AdSense + * account. + * @alias adsense.alerts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.alertId Alert to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/alerts/{alertId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['alertId'], + pathParams: ['alertId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.alerts.list + * @desc List the alerts for this AdSense account. + * @alias adsense.alerts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale The locale to use for translating alert messages. The account locale will be used if this is not supplied. The AdSense default (English) will be used if the supplied locale is invalid or unsupported. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/alerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Customchannels { + root: Adsense; + adunits: Resource$Customchannels$Adunits; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.adunits = new Resource$Customchannels$Adunits(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.customchannels.get + * @desc Get the specified custom channel from the specified ad client. + * @alias adsense.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.customchannels.list + * @desc List all custom channels in the specified ad client for this + * AdSense account. + * @alias adsense.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Customchannels$Adunits { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.customchannels.adunits.list + * @desc List all ad units in the specified custom channel. + * @alias adsense.customchannels.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client which contains the custom channel. + * @param {string} params.customChannelId Custom channel for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Metadata { + root: Adsense; + dimensions: Resource$Metadata$Dimensions; + metrics: Resource$Metadata$Metrics; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.dimensions = new Resource$Metadata$Dimensions(root); + this.metrics = new Resource$Metadata$Metrics(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Metadata$Dimensions { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.metadata.dimensions.list + * @desc List the metadata for the dimensions available to this AdSense + * account. + * @alias adsense.metadata.dimensions.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/metadata/dimensions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Metadata$Metrics { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.metadata.metrics.list + * @desc List the metadata for the metrics available to this AdSense + * account. + * @alias adsense.metadata.metrics.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/metadata/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Payments { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.payments.list + * @desc List the payments for this AdSense account. + * @alias adsense.payments.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/payments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Reports { + root: Adsense; + saved: Resource$Reports$Saved; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + this.saved = new Resource$Reports$Saved(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.reports.generate + * @desc Generate an AdSense report based on the report request sent in the + * query parameters. Returns the result as JSON; to retrieve output in CSV + * format specify "alt=csv" as a query parameter. + * @alias adsense.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.accountId Accounts upon which to report. + * @param {string=} params.currency Optional currency to use when reporting on monetary metrics. Defaults to the account's currency if not set. + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {boolean=} params.useTimezoneReporting Whether the report should be generated in the AdSense account's local timezone. If false default PST/PDT timezone will be used. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['startDate', 'endDate'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + export class Resource$Reports$Saved { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.reports.saved.generate + * @desc Generate an AdSense report based on the saved report ID sent in the + * query parameters. + * @alias adsense.reports.saved.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string} params.savedReportId The saved report to retrieve. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/reports/{savedReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['savedReportId'], + pathParams: ['savedReportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * adsense.reports.saved.list + * @desc List all saved reports in this AdSense account. + * @alias adsense.reports.saved.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of saved reports to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved reports. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/reports/saved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Savedadstyles { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.savedadstyles.get + * @desc Get a specific saved ad style from the user's account. + * @alias adsense.savedadstyles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.savedAdStyleId Saved ad style to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/savedadstyles/{savedAdStyleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['savedAdStyleId'], + pathParams: ['savedAdStyleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsense.savedadstyles.list + * @desc List all saved ad styles in the user's account. + * @alias adsense.savedadstyles.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of saved ad styles to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through saved ad styles. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsense/v1.4/savedadstyles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Urlchannels { + root: Adsense; + constructor(root: Adsense) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsense.urlchannels.list + * @desc List all URL channels in the specified ad client for this AdSense + * account. + * @alias adsense.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/adsense/v1.4/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/adsensehost/v4.1.ts b/src/apis/adsensehost/v4.1.ts index f646e16f21c..d6db2468a72 100644 --- a/src/apis/adsensehost/v4.1.ts +++ b/src/apis/adsensehost/v4.1.ts @@ -27,1943 +27,1972 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * AdSense Host API - * - * Generates performance reports, generates ad codes, and provides publisher - * management capabilities for AdSense Hosts. - * - * @example - * const google = require('googleapis'); - * const adsensehost = google.adsensehost('v4.1'); - * - * @namespace adsensehost - * @type {Function} - * @version v4.1 - * @variation v4.1 - * @param {object=} options Options for Adsensehost - */ -export class Adsensehost { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - adclients: Resource$Adclients; - associationsessions: Resource$Associationsessions; - customchannels: Resource$Customchannels; - reports: Resource$Reports; - urlchannels: Resource$Urlchannels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.adclients = new Resource$Adclients(this); - this.associationsessions = new Resource$Associationsessions(this); - this.customchannels = new Resource$Customchannels(this); - this.reports = new Resource$Reports(this); - this.urlchannels = new Resource$Urlchannels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Account { - /** - * Unique identifier of this account. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#account. - */ - kind: string; - /** - * Name of this account. - */ - name: string; - /** - * Approval status of this account. One of: PENDING, APPROVED, DISABLED. - */ - status: string; -} -export interface Schema$Accounts { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The accounts returned in this list response. - */ - items: Schema$Account[]; - /** - * Kind of list this is, in this case adsensehost#accounts. - */ - kind: string; -} -export interface Schema$AdClient { - /** - * Whether this ad client is opted in to ARC. - */ - arcOptIn: boolean; - /** - * Unique identifier of this ad client. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#adClient. - */ - kind: string; - /** - * This ad client's product code, which corresponds to the PRODUCT_CODE - * report dimension. - */ - productCode: string; - /** - * Whether this ad client supports being reported on. - */ - supportsReporting: boolean; -} -export interface Schema$AdClients { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad clients returned in this list response. - */ - items: Schema$AdClient[]; - /** - * Kind of list this is, in this case adsensehost#adClients. - */ - kind: string; - /** - * Continuation token used to page through ad clients. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} -export interface Schema$AdCode { - /** - * The ad code snippet. - */ - adCode: string; - /** - * Kind this is, in this case adsensehost#adCode. - */ - kind: string; -} -export interface Schema$AdStyle { - /** - * The colors included in the style. These are represented as six hexadecimal - * characters, similar to HTML color codes, but without the leading hash. - */ - colors: any; - /** - * The style of the corners in the ad (deprecated: never populated, ignored). - */ - corners: string; - /** - * The font which is included in the style. - */ - font: any; - /** - * Kind this is, in this case adsensehost#adStyle. - */ - kind: string; -} -export interface Schema$AdUnit { - /** - * Identity code of this ad unit, not necessarily unique across ad clients. - */ - code: string; - /** - * Settings specific to content ads (AFC) and highend mobile content ads (AFMC - * - deprecated). - */ - contentAdsSettings: any; - /** - * Custom style information specific to this ad unit. - */ - customStyle: Schema$AdStyle; - /** - * Unique identifier of this ad unit. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#adUnit. - */ - kind: string; - /** - * Settings specific to WAP mobile content ads (AFMC - deprecated). - */ - mobileContentAdsSettings: any; - /** - * Name of this ad unit. - */ - name: string; - /** - * Status of this ad unit. Possible values are: NEW: Indicates that the ad - * unit was created within the last seven days and does not yet have any - * activity associated with it. ACTIVE: Indicates that there has been - * activity on this ad unit in the last seven days. INACTIVE: Indicates that - * there has been no activity on this ad unit in the last seven days. - */ - status: string; -} -export interface Schema$AdUnits { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ad units returned in this list response. - */ - items: Schema$AdUnit[]; - /** - * Kind of list this is, in this case adsensehost#adUnits. - */ - kind: string; - /** - * Continuation token used to page through ad units. To retrieve the next page - * of results, set the next request's "pageToken" value to this. - */ - nextPageToken: string; -} -export interface Schema$AssociationSession { - /** - * Hosted account id of the associated publisher after association. Present if - * status is ACCEPTED. - */ - accountId: string; - /** - * Unique identifier of this association session. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#associationSession. - */ - kind: string; - /** - * The products to associate with the user. Options: AFC, AFG, AFV, AFS - * (deprecated), AFMC (deprecated) - */ - productCodes: string[]; - /** - * Redirect URL of this association session. Used to redirect users into the - * AdSense association flow. - */ - redirectUrl: string; - /** - * Status of the completed association, available once the association - * callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. - */ - status: string; - /** - * The preferred locale of the user themselves when going through the AdSense - * association flow. - */ - userLocale: string; - /** - * The locale of the user's hosted website. - */ - websiteLocale: string; - /** - * The URL of the user's hosted website. - */ - websiteUrl: string; -} -export interface Schema$CustomChannel { - /** - * Code of this custom channel, not necessarily unique across ad clients. - */ - code: string; - /** - * Unique identifier of this custom channel. This should be considered an - * opaque identifier; it is not safe to rely on it being in any particular - * format. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#customChannel. - */ - kind: string; - /** - * Name of this custom channel. - */ - name: string; -} -export interface Schema$CustomChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The custom channels returned in this list response. - */ - items: Schema$CustomChannel[]; - /** - * Kind of list this is, in this case adsensehost#customChannels. - */ - kind: string; - /** - * Continuation token used to page through custom channels. To retrieve the - * next page of results, set the next request's "pageToken" - * value to this. - */ - nextPageToken: string; -} -export interface Schema$Report { - /** - * The averages of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - averages: string[]; - /** - * The header information of the columns requested in the report. This is a - * list of headers; one for each dimension in the request, followed by one for - * each metric in the request. - */ - headers: any[]; - /** - * Kind this is, in this case adsensehost#report. - */ - kind: string; - /** - * The output rows of the report. Each row is a list of cells; one for each - * dimension in the request, followed by one for each metric in the request. - * The dimension cells contain strings, and the metric cells contain numbers. - */ - rows: string[][]; - /** - * The total number of rows matched by the report request. Fewer rows may be - * returned in the response due to being limited by the row count requested or - * the report row limit. - */ - totalMatchedRows: string; - /** - * The totals of the report. This is the same length as any other row in the - * report; cells corresponding to dimension columns are empty. - */ - totals: string[]; - /** - * Any warnings associated with generation of the report. - */ - warnings: string[]; -} -export interface Schema$UrlChannel { - /** - * Unique identifier of this URL channel. This should be considered an opaque - * identifier; it is not safe to rely on it being in any particular format. - */ - id: string; - /** - * Kind of resource this is, in this case adsensehost#urlChannel. - */ - kind: string; - /** - * URL Pattern of this URL channel. Does not include "http://" or - * "https://". Example: www.example.com/home - */ - urlPattern: string; -} -export interface Schema$UrlChannels { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The URL channels returned in this list response. - */ - items: Schema$UrlChannel[]; - /** - * Kind of list this is, in this case adsensehost#urlChannels. - */ - kind: string; - /** - * Continuation token used to page through URL channels. To retrieve the next - * page of results, set the next request's "pageToken" value to - * this. - */ - nextPageToken: string; -} - -export class Resource$Accounts { - root: Adsensehost; - adclients: Resource$Accounts$Adclients; - adunits: Resource$Accounts$Adunits; - reports: Resource$Accounts$Reports; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); - this.adclients = new Resource$Accounts$Adclients(root); - this.adunits = new Resource$Accounts$Adunits(root); - this.reports = new Resource$Accounts$Reports(root); - } - - getRoot() { - return this.root; - } - - - /** - * adsensehost.accounts.get - * @desc Get information about the selected associated AdSense account. - * @alias adsensehost.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account to get information about. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.list - * @desc List hosted accounts associated with this AdSense account by ad - * client id. - * @alias adsensehost.accounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.filterAdClientId Ad clients to list accounts for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['filterAdClientId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Adclients { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsensehost.accounts.adclients.get - * @desc Get information about one of the ad clients in the specified - * publisher's AdSense account. - * @alias adsensehost.accounts.adclients.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adclients.list - * @desc List all hosted ad clients in the specified hosted account. - * @alias adsensehost.accounts.adclients.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account for which to list ad clients. - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/accounts/{accountId}/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Adunits { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * adsensehost.accounts.adunits.delete - * @desc Delete the specified ad unit from the specified publisher AdSense - * account. - * @alias adsensehost.accounts.adunits.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad unit. - * @param {string} params.adClientId Ad client for which to get ad unit. - * @param {string} params.adUnitId Ad unit to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adunits.get - * @desc Get the specified host ad unit in this AdSense account. - * @alias adsensehost.accounts.adunits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad unit. - * @param {string} params.adClientId Ad client for which to get ad unit. - * @param {string} params.adUnitId Ad unit to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adunits.getAdCode - * @desc Get ad code for the specified ad unit, attaching the specified host - * custom channels. - * @alias adsensehost.accounts.adunits.getAdCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client with contains the ad unit. - * @param {string} params.adUnitId Ad unit to get the code for. - * @param {string=} params.hostCustomChannelId Host custom channel to attach to the ad code. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAdCode(params?: any, options?: MethodOptions): AxiosPromise; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAdCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId', 'adUnitId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adunits.insert - * @desc Insert the supplied ad unit into the specified publisher AdSense - * account. - * @alias adsensehost.accounts.adunits.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which will contain the ad unit. - * @param {string} params.adClientId Ad client into which to insert the ad unit. - * @param {().AdUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace adsensehost_v4_1 { /** - * adsensehost.accounts.adunits.list - * @desc List all ad units in the specified publisher's AdSense account. - * @alias adsensehost.accounts.adunits.list - * @memberOf! () + * AdSense Host API * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client for which to list ad units. - * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. - * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adunits.patch - * @desc Update the supplied ad unit in the specified publisher AdSense - * account. This method supports patch semantics. - * @alias adsensehost.accounts.adunits.patch - * @memberOf! () + * Generates performance reports, generates ad codes, and provides publisher + * management capabilities for AdSense Hosts. * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {string} params.adUnitId Ad unit to get. - * @param {().AdUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'adClientId', 'adUnitId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * adsensehost.accounts.adunits.update - * @desc Update the supplied ad unit in the specified publisher AdSense - * account. - * @alias adsensehost.accounts.adunits.update - * @memberOf! () + * @example + * const google = require('googleapis'); + * const adsensehost = google.adsensehost('v4.1'); * - * @param {object} params Parameters for request - * @param {string} params.accountId Account which contains the ad client. - * @param {string} params.adClientId Ad client which contains the ad unit. - * @param {().AdUnit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'adClientId'], - pathParams: ['accountId', 'adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace adsensehost + * @type {Function} + * @version v4.1 + * @variation v4.1 + * @param {object=} options Options for Adsensehost + */ + export class Adsensehost { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + adclients: Resource$Adclients; + associationsessions: Resource$Associationsessions; + customchannels: Resource$Customchannels; + reports: Resource$Reports; + urlchannels: Resource$Urlchannels; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.adclients = new Resource$Adclients(this); + this.associationsessions = new Resource$Associationsessions(this); + this.customchannels = new Resource$Customchannels(this); + this.reports = new Resource$Reports(this); + this.urlchannels = new Resource$Urlchannels(this); + } + + getRoot() { + return this.root; } } -} -export class Resource$Accounts$Reports { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Account { + /** + * Unique identifier of this account. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#account. + */ + kind: string; + /** + * Name of this account. + */ + name: string; + /** + * Approval status of this account. One of: PENDING, APPROVED, DISABLED. + */ + status: string; } - - getRoot() { - return this.root; + export interface Schema$Accounts { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The accounts returned in this list response. + */ + items: Schema$Account[]; + /** + * Kind of list this is, in this case adsensehost#accounts. + */ + kind: string; } - - - /** - * adsensehost.accounts.reports.generate - * @desc Generate an AdSense report based on the report request sent in the - * query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adsensehost.accounts.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Hosted account upon which to report. - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/accounts/{accountId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'startDate', 'endDate'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdClient { + /** + * Whether this ad client is opted in to ARC. + */ + arcOptIn: boolean; + /** + * Unique identifier of this ad client. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#adClient. + */ + kind: string; + /** + * This ad client's product code, which corresponds to the PRODUCT_CODE + * report dimension. + */ + productCode: string; + /** + * Whether this ad client supports being reported on. + */ + supportsReporting: boolean; } -} - - -export class Resource$Adclients { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AdClients { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad clients returned in this list response. + */ + items: Schema$AdClient[]; + /** + * Kind of list this is, in this case adsensehost#adClients. + */ + kind: string; + /** + * Continuation token used to page through ad clients. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$AdCode { + /** + * The ad code snippet. + */ + adCode: string; + /** + * Kind this is, in this case adsensehost#adCode. + */ + kind: string; } - - - /** - * adsensehost.adclients.get - * @desc Get information about one of the ad clients in the Host AdSense - * account. - * @alias adsensehost.adclients.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/adclients/{adClientId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdStyle { + /** + * The colors included in the style. These are represented as six + * hexadecimal characters, similar to HTML color codes, but without the + * leading hash. + */ + colors: any; + /** + * The style of the corners in the ad (deprecated: never populated, + * ignored). + */ + corners: string; + /** + * The font which is included in the style. + */ + font: any; + /** + * Kind this is, in this case adsensehost#adStyle. + */ + kind: string; } - - - /** - * adsensehost.adclients.list - * @desc List all host ad clients in this AdSense account. - * @alias adsensehost.adclients.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/adclients') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AdUnit { + /** + * Identity code of this ad unit, not necessarily unique across ad clients. + */ + code: string; + /** + * Settings specific to content ads (AFC) and highend mobile content ads + * (AFMC - deprecated). + */ + contentAdsSettings: any; + /** + * Custom style information specific to this ad unit. + */ + customStyle: Schema$AdStyle; + /** + * Unique identifier of this ad unit. This should be considered an opaque + * identifier; it is not safe to rely on it being in any particular format. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#adUnit. + */ + kind: string; + /** + * Settings specific to WAP mobile content ads (AFMC - deprecated). + */ + mobileContentAdsSettings: any; + /** + * Name of this ad unit. + */ + name: string; + /** + * Status of this ad unit. Possible values are: NEW: Indicates that the ad + * unit was created within the last seven days and does not yet have any + * activity associated with it. ACTIVE: Indicates that there has been + * activity on this ad unit in the last seven days. INACTIVE: Indicates + * that there has been no activity on this ad unit in the last seven days. + */ + status: string; } -} - -export class Resource$Associationsessions { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AdUnits { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ad units returned in this list response. + */ + items: Schema$AdUnit[]; + /** + * Kind of list this is, in this case adsensehost#adUnits. + */ + kind: string; + /** + * Continuation token used to page through ad units. To retrieve the next + * page of results, set the next request's "pageToken" value + * to this. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$AssociationSession { + /** + * Hosted account id of the associated publisher after association. Present + * if status is ACCEPTED. + */ + accountId: string; + /** + * Unique identifier of this association session. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#associationSession. + */ + kind: string; + /** + * The products to associate with the user. Options: AFC, AFG, AFV, AFS + * (deprecated), AFMC (deprecated) + */ + productCodes: string[]; + /** + * Redirect URL of this association session. Used to redirect users into the + * AdSense association flow. + */ + redirectUrl: string; + /** + * Status of the completed association, available once the association + * callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. + */ + status: string; + /** + * The preferred locale of the user themselves when going through the + * AdSense association flow. + */ + userLocale: string; + /** + * The locale of the user's hosted website. + */ + websiteLocale: string; + /** + * The URL of the user's hosted website. + */ + websiteUrl: string; } - - - /** - * adsensehost.associationsessions.start - * @desc Create an association session for initiating an association with an - * AdSense user. - * @alias adsensehost.associationsessions.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productCode Products to associate with the user. - * @param {string=} params.userLocale The preferred locale of the user. - * @param {string=} params.websiteLocale The locale of the user's hosted website. - * @param {string} params.websiteUrl The URL of the user's hosted website. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): - AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/associationsessions/start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['productCode', 'websiteUrl'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CustomChannel { + /** + * Code of this custom channel, not necessarily unique across ad clients. + */ + code: string; + /** + * Unique identifier of this custom channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#customChannel. + */ + kind: string; + /** + * Name of this custom channel. + */ + name: string; } - - - /** - * adsensehost.associationsessions.verify - * @desc Verify an association session after the association callback returns - * from AdSense signup. - * @alias adsensehost.associationsessions.verify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.token The token returned to the association callback URL. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verify(params?: any, options?: MethodOptions): - AxiosPromise; - verify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - verify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/associationsessions/verify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['token'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CustomChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The custom channels returned in this list response. + */ + items: Schema$CustomChannel[]; + /** + * Kind of list this is, in this case adsensehost#customChannels. + */ + kind: string; + /** + * Continuation token used to page through custom channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } -} - -export class Resource$Customchannels { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Report { + /** + * The averages of the report. This is the same length as any other row in + * the report; cells corresponding to dimension columns are empty. + */ + averages: string[]; + /** + * The header information of the columns requested in the report. This is a + * list of headers; one for each dimension in the request, followed by one + * for each metric in the request. + */ + headers: any[]; + /** + * Kind this is, in this case adsensehost#report. + */ + kind: string; + /** + * The output rows of the report. Each row is a list of cells; one for each + * dimension in the request, followed by one for each metric in the request. + * The dimension cells contain strings, and the metric cells contain + * numbers. + */ + rows: string[][]; + /** + * The total number of rows matched by the report request. Fewer rows may be + * returned in the response due to being limited by the row count requested + * or the report row limit. + */ + totalMatchedRows: string; + /** + * The totals of the report. This is the same length as any other row in the + * report; cells corresponding to dimension columns are empty. + */ + totals: string[]; + /** + * Any warnings associated with generation of the report. + */ + warnings: string[]; } - - getRoot() { - return this.root; + export interface Schema$UrlChannel { + /** + * Unique identifier of this URL channel. This should be considered an + * opaque identifier; it is not safe to rely on it being in any particular + * format. + */ + id: string; + /** + * Kind of resource this is, in this case adsensehost#urlChannel. + */ + kind: string; + /** + * URL Pattern of this URL channel. Does not include "http://" or + * "https://". Example: www.example.com/home + */ + urlPattern: string; } - - - /** - * adsensehost.customchannels.delete - * @desc Delete a specific custom channel from the host AdSense account. - * @alias adsensehost.customchannels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client from which to delete the custom channel. - * @param {string} params.customChannelId Custom channel to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$UrlChannels { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The URL channels returned in this list response. + */ + items: Schema$UrlChannel[]; + /** + * Kind of list this is, in this case adsensehost#urlChannels. + */ + kind: string; + /** + * Continuation token used to page through URL channels. To retrieve the + * next page of results, set the next request's "pageToken" + * value to this. + */ + nextPageToken: string; } - - /** - * adsensehost.customchannels.get - * @desc Get a specific custom channel from the host AdSense account. - * @alias adsensehost.customchannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client from which to get the custom channel. - * @param {string} params.customChannelId Custom channel to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId', 'customChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts { + root: Adsensehost; + adclients: Resource$Accounts$Adclients; + adunits: Resource$Accounts$Adunits; + reports: Resource$Accounts$Reports; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + this.adclients = new Resource$Accounts$Adclients(root); + this.adunits = new Resource$Accounts$Adunits(root); + this.reports = new Resource$Accounts$Reports(root); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.accounts.get + * @desc Get information about the selected associated AdSense account. + * @alias adsensehost.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account to get information about. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.list + * @desc List hosted accounts associated with this AdSense account by ad + * client id. + * @alias adsensehost.accounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.filterAdClientId Ad clients to list accounts for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['filterAdClientId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * adsensehost.customchannels.insert - * @desc Add a new custom channel to the host AdSense account. - * @alias adsensehost.customchannels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client to which the new custom channel will be added. - * @param {().CustomChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts$Adclients { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.accounts.adclients.get + * @desc Get information about one of the ad clients in the specified + * publisher's AdSense account. + * @alias adsensehost.accounts.adclients.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adclients.list + * @desc List all hosted ad clients in the specified hosted account. + * @alias adsensehost.accounts.adclients.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account for which to list ad clients. + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/adsensehost/v4.1/accounts/{accountId}/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * adsensehost.customchannels.list - * @desc List all host custom channels in this AdSense account. - * @alias adsensehost.customchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list custom channels. - * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts$Adunits { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.accounts.adunits.delete + * @desc Delete the specified ad unit from the specified publisher AdSense + * account. + * @alias adsensehost.accounts.adunits.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad unit. + * @param {string} params.adClientId Ad client for which to get ad unit. + * @param {string} params.adUnitId Ad unit to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.get + * @desc Get the specified host ad unit in this AdSense account. + * @alias adsensehost.accounts.adunits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad unit. + * @param {string} params.adClientId Ad client for which to get ad unit. + * @param {string} params.adUnitId Ad unit to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.getAdCode + * @desc Get ad code for the specified ad unit, attaching the specified host + * custom channels. + * @alias adsensehost.accounts.adunits.getAdCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client with contains the ad unit. + * @param {string} params.adUnitId Ad unit to get the code for. + * @param {string=} params.hostCustomChannelId Host custom channel to attach to the ad code. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAdCode(params?: any, options?: MethodOptions): + AxiosPromise; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAdCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}/adcode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId', 'adUnitId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.insert + * @desc Insert the supplied ad unit into the specified publisher AdSense + * account. + * @alias adsensehost.accounts.adunits.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which will contain the ad unit. + * @param {string} params.adClientId Ad client into which to insert the ad unit. + * @param {().AdUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.list + * @desc List all ad units in the specified publisher's AdSense account. + * @alias adsensehost.accounts.adunits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client for which to list ad units. + * @param {boolean=} params.includeInactive Whether to include inactive ad units. Default: true. + * @param {integer=} params.maxResults The maximum number of ad units to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.patch + * @desc Update the supplied ad unit in the specified publisher AdSense + * account. This method supports patch semantics. + * @alias adsensehost.accounts.adunits.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {string} params.adUnitId Ad unit to get. + * @param {().AdUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'adClientId', 'adUnitId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.accounts.adunits.update + * @desc Update the supplied ad unit in the specified publisher AdSense + * account. + * @alias adsensehost.accounts.adunits.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account which contains the ad client. + * @param {string} params.adClientId Ad client which contains the ad unit. + * @param {().AdUnit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'adClientId'], + pathParams: ['accountId', 'adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * adsensehost.customchannels.patch - * @desc Update a custom channel in the host AdSense account. This method - * supports patch semantics. - * @alias adsensehost.customchannels.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client in which the custom channel will be updated. - * @param {string} params.customChannelId Custom channel to get. - * @param {().CustomChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['adClientId', 'customChannelId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts$Reports { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.accounts.reports.generate + * @desc Generate an AdSense report based on the report request sent in the + * query parameters. Returns the result as JSON; to retrieve output in CSV + * format specify "alt=csv" as a query parameter. + * @alias adsensehost.accounts.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Hosted account upon which to report. + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/accounts/{accountId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'startDate', 'endDate'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * adsensehost.customchannels.update - * @desc Update a custom channel in the host AdSense account. - * @alias adsensehost.customchannels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client in which the custom channel will be updated. - * @param {().CustomChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Adclients { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.adclients.get + * @desc Get information about one of the ad clients in the Host AdSense + * account. + * @alias adsensehost.adclients.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/adclients/{adClientId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.adclients.list + * @desc List all host ad clients in this AdSense account. + * @alias adsensehost.adclients.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults The maximum number of ad clients to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/adclients') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/customchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - /** - * adsensehost.reports.generate - * @desc Generate an AdSense report based on the report request sent in the - * query parameters. Returns the result as JSON; to retrieve output in CSV - * format specify "alt=csv" as a query parameter. - * @alias adsensehost.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimension Dimensions to base the report on. - * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {string=} params.filter Filters to be run on the report. - * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - * @param {integer=} params.maxResults The maximum number of rows of report data to return. - * @param {string=} params.metric Numeric columns to include in the report. - * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - * @param {integer=} params.startIndex Index of the first row of report data to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Associationsessions { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.associationsessions.start + * @desc Create an association session for initiating an association with an + * AdSense user. + * @alias adsensehost.associationsessions.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productCode Products to associate with the user. + * @param {string=} params.userLocale The preferred locale of the user. + * @param {string=} params.websiteLocale The locale of the user's hosted website. + * @param {string} params.websiteUrl The URL of the user's hosted website. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/associationsessions/start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['productCode', 'websiteUrl'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.associationsessions.verify + * @desc Verify an association session after the association callback + * returns from AdSense signup. + * @alias adsensehost.associationsessions.verify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.token The token returned to the association callback URL. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verify(params?: any, options?: MethodOptions): + AxiosPromise; + verify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + verify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/associationsessions/verify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['token'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/adsensehost/v4.1/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['startDate', 'endDate'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Urlchannels { - root: Adsensehost; - constructor(root: Adsensehost) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - /** - * adsensehost.urlchannels.delete - * @desc Delete a URL channel from the host AdSense account. - * @alias adsensehost.urlchannels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client from which to delete the URL channel. - * @param {string} params.urlChannelId URL channel to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/urlchannels/{urlChannelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['adClientId', 'urlChannelId'], - pathParams: ['adClientId', 'urlChannelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Customchannels { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.customchannels.delete + * @desc Delete a specific custom channel from the host AdSense account. + * @alias adsensehost.customchannels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client from which to delete the custom channel. + * @param {string} params.customChannelId Custom channel to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.customchannels.get + * @desc Get a specific custom channel from the host AdSense account. + * @alias adsensehost.customchannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client from which to get the custom channel. + * @param {string} params.customChannelId Custom channel to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId', 'customChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.customchannels.insert + * @desc Add a new custom channel to the host AdSense account. + * @alias adsensehost.customchannels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client to which the new custom channel will be added. + * @param {().CustomChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.customchannels.list + * @desc List all host custom channels in this AdSense account. + * @alias adsensehost.customchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list custom channels. + * @param {integer=} params.maxResults The maximum number of custom channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.customchannels.patch + * @desc Update a custom channel in the host AdSense account. This method + * supports patch semantics. + * @alias adsensehost.customchannels.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client in which the custom channel will be updated. + * @param {string} params.customChannelId Custom channel to get. + * @param {().CustomChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['adClientId', 'customChannelId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.customchannels.update + * @desc Update a custom channel in the host AdSense account. + * @alias adsensehost.customchannels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client in which the custom channel will be updated. + * @param {().CustomChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/customchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * adsensehost.urlchannels.insert - * @desc Add a new URL channel to the host AdSense account. - * @alias adsensehost.urlchannels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client to which the new URL channel will be added. - * @param {().UrlChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Reports { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.reports.generate + * @desc Generate an AdSense report based on the report request sent in the + * query parameters. Returns the result as JSON; to retrieve output in CSV + * format specify "alt=csv" as a query parameter. + * @alias adsensehost.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimension Dimensions to base the report on. + * @param {string} params.endDate End of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {string=} params.filter Filters to be run on the report. + * @param {string=} params.locale Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. + * @param {integer=} params.maxResults The maximum number of rows of report data to return. + * @param {string=} params.metric Numeric columns to include in the report. + * @param {string=} params.sort The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. + * @param {string} params.startDate Start of the date range to report on in "YYYY-MM-DD" format, inclusive. + * @param {integer=} params.startIndex Index of the first row of report data to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/adsensehost/v4.1/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['startDate', 'endDate'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * adsensehost.urlchannels.list - * @desc List all host URL channels in the host AdSense account. - * @alias adsensehost.urlchannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.adClientId Ad client for which to list URL channels. - * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. - * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/adsensehost/v4.1/adclients/{adClientId}/urlchannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['adClientId'], - pathParams: ['adClientId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Urlchannels { + root: Adsensehost; + constructor(root: Adsensehost) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * adsensehost.urlchannels.delete + * @desc Delete a URL channel from the host AdSense account. + * @alias adsensehost.urlchannels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client from which to delete the URL channel. + * @param {string} params.urlChannelId URL channel to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/urlchannels/{urlChannelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['adClientId', 'urlChannelId'], + pathParams: ['adClientId', 'urlChannelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.urlchannels.insert + * @desc Add a new URL channel to the host AdSense account. + * @alias adsensehost.urlchannels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client to which the new URL channel will be added. + * @param {().UrlChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * adsensehost.urlchannels.list + * @desc List all host URL channels in the host AdSense account. + * @alias adsensehost.urlchannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.adClientId Ad client for which to list URL channels. + * @param {integer=} params.maxResults The maximum number of URL channels to include in the response, used for paging. + * @param {string=} params.pageToken A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/adsensehost/v4.1/adclients/{adClientId}/urlchannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['adClientId'], + pathParams: ['adClientId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/analytics/v2.4.ts b/src/apis/analytics/v2.4.ts index 9a497e8d1e4..9b83011674c 100644 --- a/src/apis/analytics/v2.4.ts +++ b/src/apis/analytics/v2.4.ts @@ -27,458 +27,461 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Analytics API - * - * Views and manages your Google Analytics data. - * - * @example - * const google = require('googleapis'); - * const analytics = google.analytics('v2.4'); - * - * @namespace analytics - * @type {Function} - * @version v2.4 - * @variation v2.4 - * @param {object=} options Options for Analytics - */ -export class Analytics { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace analytics_v2_4 { + /** + * Google Analytics API + * + * Views and manages your Google Analytics data. + * + * @example + * const google = require('googleapis'); + * const analytics = google.analytics('v2.4'); + * + * @namespace analytics + * @type {Function} + * @version v2.4 + * @variation v2.4 + * @param {object=} options Options for Analytics + */ + export class Analytics { + _options: GlobalOptions; + google: GoogleApis; + root = this; - data: Resource$Data; - management: Resource$Management; + data: Resource$Data; + management: Resource$Management; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.data = new Resource$Data(this); - this.management = new Resource$Management(this); - } + this.data = new Resource$Data(this); + this.management = new Resource$Management(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export class Resource$Data { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Data { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.data.get - * @desc Returns Analytics report data for a view (profile). - * @alias analytics.data.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. - * @param {string} params.end-date End date for fetching report data. All requests should specify an end date formatted as YYYY-MM-DD. - * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to the report data. - * @param {string} params.ids Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. - * @param {integer=} params.max-results The maximum number of entries to include in this feed. - * @param {string} params.metrics A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified to retrieve a valid Analytics report. - * @param {string=} params.segment An Analytics advanced segment to be applied to the report data. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for the report data. - * @param {string} params.start-date Start date for fetching report data. All requests should specify a start date formatted as YYYY-MM-DD. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v2.4/data') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.data.get + * @desc Returns Analytics report data for a view (profile). + * @alias analytics.data.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. + * @param {string} params.end-date End date for fetching report data. All requests should specify an end date formatted as YYYY-MM-DD. + * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to the report data. + * @param {string} params.ids Unique table ID for retrieving report data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * @param {integer=} params.max-results The maximum number of entries to include in this feed. + * @param {string} params.metrics A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified to retrieve a valid Analytics report. + * @param {string=} params.segment An Analytics advanced segment to be applied to the report data. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for the report data. + * @param {string} params.start-date Start date for fetching report data. All requests should specify a start date formatted as YYYY-MM-DD. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v2.4/data') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Management { - root: Analytics; - accounts: Resource$Management$Accounts; - goals: Resource$Management$Goals; - profiles: Resource$Management$Profiles; - segments: Resource$Management$Segments; - webproperties: Resource$Management$Webproperties; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - this.accounts = new Resource$Management$Accounts(root); - this.goals = new Resource$Management$Goals(root); - this.profiles = new Resource$Management$Profiles(root); - this.segments = new Resource$Management$Segments(root); - this.webproperties = new Resource$Management$Webproperties(root); - } + export class Resource$Management { + root: Analytics; + accounts: Resource$Management$Accounts; + goals: Resource$Management$Goals; + profiles: Resource$Management$Profiles; + segments: Resource$Management$Segments; + webproperties: Resource$Management$Webproperties; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + this.accounts = new Resource$Management$Accounts(root); + this.goals = new Resource$Management$Goals(root); + this.profiles = new Resource$Management$Profiles(root); + this.segments = new Resource$Management$Segments(root); + this.webproperties = new Resource$Management$Webproperties(root); + } - getRoot() { - return this.root; - } -} -export class Resource$Management$Accounts { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } + export class Resource$Management$Accounts { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.management.accounts.list - * @desc Lists all accounts to which the user has access. - * @alias analytics.management.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.max-results The maximum number of accounts to include in this response. - * @param {integer=} params.start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v2.4/management/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.management.accounts.list + * @desc Lists all accounts to which the user has access. + * @alias analytics.management.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.max-results The maximum number of accounts to include in this response. + * @param {integer=} params.start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v2.4/management/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Management$Goals { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Management$Goals { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.management.goals.list - * @desc Lists goals to which the user has access. - * @alias analytics.management.goals.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. - * @param {integer=} params.max-results The maximum number of goals to include in this response. - * @param {string} params.profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. - * @param {integer=} params.start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v2.4/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.management.goals.list + * @desc Lists goals to which the user has access. + * @alias analytics.management.goals.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * @param {integer=} params.max-results The maximum number of goals to include in this response. + * @param {string} params.profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. + * @param {integer=} params.start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v2.4/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Management$Profiles { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Management$Profiles { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.management.profiles.list - * @desc Lists views (profiles) to which the user has access. - * @alias analytics.management.profiles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the views (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. - * @param {integer=} params.max-results The maximum number of views (profiles) to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v2.4/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.management.profiles.list + * @desc Lists views (profiles) to which the user has access. + * @alias analytics.management.profiles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the views (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. + * @param {integer=} params.max-results The maximum number of views (profiles) to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v2.4/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Management$Segments { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Management$Segments { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.management.segments.list - * @desc Lists advanced segments to which the user has access. - * @alias analytics.management.segments.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.max-results The maximum number of advanced segments to include in this response. - * @param {integer=} params.start-index An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v2.4/management/segments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.management.segments.list + * @desc Lists advanced segments to which the user has access. + * @alias analytics.management.segments.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.max-results The maximum number of advanced segments to include in this response. + * @param {integer=} params.start-index An index of the first advanced segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v2.4/management/segments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Management$Webproperties { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Management$Webproperties { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * analytics.management.webproperties.list - * @desc Lists web properties to which the user has access. - * @alias analytics.management.webproperties.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. - * @param {integer=} params.max-results The maximum number of web properties to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v2.4/management/accounts/{accountId}/webproperties') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * analytics.management.webproperties.list + * @desc Lists web properties to which the user has access. + * @alias analytics.management.webproperties.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * @param {integer=} params.max-results The maximum number of web properties to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v2.4/management/accounts/{accountId}/webproperties') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/analytics/v3.ts b/src/apis/analytics/v3.ts index 68432429bbf..5f2af4ca5de 100644 --- a/src/apis/analytics/v3.ts +++ b/src/apis/analytics/v3.ts @@ -27,7870 +27,7916 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Analytics API - * - * Views and manages your Google Analytics data. - * - * @example - * const google = require('googleapis'); - * const analytics = google.analytics('v3'); - * - * @namespace analytics - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Analytics - */ -export class Analytics { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - data: Resource$Data; - management: Resource$Management; - metadata: Resource$Metadata; - provisioning: Resource$Provisioning; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.data = new Resource$Data(this); - this.management = new Resource$Management(this); - this.metadata = new Resource$Metadata(this); - this.provisioning = new Resource$Provisioning(this); - } - - getRoot() { - return this.root; - } -} - -/** - * JSON template for Analytics account entry. - */ -export interface Schema$Account { - /** - * Child link for an account entry. Points to the list of web properties for - * this account. - */ - childLink: any; - /** - * Time the account was created. - */ - created: string; - /** - * Account ID. - */ - id: string; - /** - * Resource type for Analytics account. - */ - kind: string; - /** - * Account name. - */ - name: string; - /** - * Permissions the user has for this account. - */ - permissions: any; - /** - * Link for this account. - */ - selfLink: string; - /** - * Indicates whether this account is starred or not. - */ - starred: boolean; - /** - * Time the account was last modified. - */ - updated: string; -} -/** - * JSON template for a linked account. - */ -export interface Schema$AccountRef { - /** - * Link for this account. - */ - href: string; - /** - * Account ID. - */ - id: string; - /** - * Analytics account reference. - */ - kind: string; - /** - * Account name. - */ - name: string; -} -/** - * An account collection provides a list of Analytics accounts to which a user - * has access. The account collection is the entry point to all management - * information. Each resource in the collection corresponds to a single - * Analytics account. - */ -export interface Schema$Accounts { - /** - * A list of accounts. - */ - items: Schema$Account[]; - /** - * The maximum number of entries the response can contain, regardless of the - * actual number of entries returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Next link for this account collection. - */ - nextLink: string; - /** - * Previous link for this account collection. - */ - previousLink: string; - /** - * The starting index of the entries, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * An AccountSummary collection lists a summary of accounts, properties and - * views (profiles) to which the user has access. Each resource in the - * collection corresponds to a single AccountSummary. - */ -export interface Schema$AccountSummaries { - /** - * A list of AccountSummaries. - */ - items: Schema$AccountSummary[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this AccountSummary collection. - */ - nextLink: string; - /** - * Link to previous page for this AccountSummary collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics AccountSummary. An AccountSummary is a - * lightweight tree comprised of properties/profiles. - */ -export interface Schema$AccountSummary { - /** - * Account ID. - */ - id: string; - /** - * Resource type for Analytics AccountSummary. - */ - kind: string; - /** - * Account name. - */ - name: string; - /** - * Indicates whether this account is starred or not. - */ - starred: boolean; - /** - * List of web properties under this account. - */ - webProperties: Schema$WebPropertySummary[]; -} -/** - * JSON template for an Analytics account ticket. The account ticket consists of - * the ticket ID and the basic information for the account, property and - * profile. - */ -export interface Schema$AccountTicket { - /** - * Account for this ticket. - */ - account: Schema$Account; - /** - * Account ticket ID used to access the account ticket. - */ - id: string; - /** - * Resource type for account ticket. - */ - kind: string; - /** - * View (Profile) for the account. - */ - profile: Schema$Profile; - /** - * Redirect URI where the user will be sent after accepting Terms of Service. - * Must be configured in APIs console as a callback URL. - */ - redirectUri: string; - /** - * Web property for the account. - */ - webproperty: Schema$Webproperty; -} -/** - * JSON template for an Analytics account tree requests. The account tree - * request is used in the provisioning api to create an account, property, and - * view (profile). It contains the basic information required to make these - * fields. - */ -export interface Schema$AccountTreeRequest { - accountName: string; - accountSettings: any; - /** - * Resource type for account ticket. - */ - kind: string; - profileName: string; - timezone: string; - webpropertyName: string; - websiteUrl: string; -} -/** - * JSON template for an Analytics account tree response. The account tree - * response is used in the provisioning api to return the result of creating an - * account, property, and view (profile). - */ -export interface Schema$AccountTreeResponse { - /** - * The account created. - */ - account: Schema$Account; - accountSettings: any; - /** - * Resource type for account ticket. - */ - kind: string; - /** - * View (Profile) for the account. - */ - profile: Schema$Profile; - /** - * Web property for the account. - */ - webproperty: Schema$Webproperty; -} -/** - * JSON template for an AdWords account. - */ -export interface Schema$AdWordsAccount { - /** - * True if auto-tagging is enabled on the AdWords account. Read-only after the - * insert operation. - */ - autoTaggingEnabled: boolean; - /** - * Customer ID. This field is required when creating an AdWords link. - */ - customerId: string; - /** - * Resource type for AdWords account. - */ - kind: string; -} -/** - * Request template for the delete upload data request. - */ -export interface Schema$AnalyticsDataimportDeleteUploadDataRequest { - /** - * A list of upload UIDs. - */ - customDataImportUids: string[]; -} -/** - * JSON template for a metadata column. - */ -export interface Schema$Column { - /** - * Map of attribute name and value for this column. - */ - attributes: any; - /** - * Column id. - */ - id: string; - /** - * Resource type for Analytics column. - */ - kind: string; -} -/** - * Lists columns (dimensions and metrics) for a particular report type. - */ -export interface Schema$Columns { - /** - * List of attributes names returned by columns. - */ - attributeNames: string[]; - /** - * Etag of collection. This etag can be compared with the last response etag - * to check if response has changed. - */ - etag: string; - /** - * List of columns for a report type. - */ - items: Schema$Column[]; - /** - * Collection type. - */ - kind: string; - /** - * Total number of columns returned in the response. - */ - totalResults: number; -} -/** - * JSON template for an Analytics custom data source. - */ -export interface Schema$CustomDataSource { - /** - * Account ID to which this custom data source belongs. - */ - accountId: string; - childLink: any; - /** - * Time this custom data source was created. - */ - created: string; - /** - * Description of custom data source. - */ - description: string; - /** - * Custom data source ID. - */ - id: string; - importBehavior: string; - /** - * Resource type for Analytics custom data source. - */ - kind: string; - /** - * Name of this custom data source. - */ - name: string; - /** - * Parent link for this custom data source. Points to the web property to - * which this custom data source belongs. - */ - parentLink: any; - /** - * IDs of views (profiles) linked to the custom data source. - */ - profilesLinked: string[]; - /** - * Collection of schema headers of the custom data source. - */ - schema: string[]; - /** - * Link for this Analytics custom data source. - */ - selfLink: string; - /** - * Type of the custom data source. - */ - type: string; - /** - * Time this custom data source was last modified. - */ - updated: string; - /** - * Upload type of the custom data source. - */ - uploadType: string; - /** - * Web property ID of the form UA-XXXXX-YY to which this custom data source - * belongs. - */ - webPropertyId: string; -} -/** - * Lists Analytics custom data sources to which the user has access. Each - * resource in the collection corresponds to a single Analytics custom data - * source. - */ -export interface Schema$CustomDataSources { - /** - * Collection of custom data sources. - */ - items: Schema$CustomDataSource[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this custom data source collection. - */ - nextLink: string; - /** - * Link to previous page for this custom data source collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for Analytics Custom Dimension. - */ -export interface Schema$CustomDimension { - /** - * Account ID. - */ - accountId: string; - /** - * Boolean indicating whether the custom dimension is active. - */ - active: boolean; - /** - * Time the custom dimension was created. - */ - created: string; - /** - * Custom dimension ID. - */ - id: string; - /** - * Index of the custom dimension. - */ - index: number; - /** - * Kind value for a custom dimension. Set to - * "analytics#customDimension". It is a read-only field. - */ - kind: string; - /** - * Name of the custom dimension. - */ - name: string; - /** - * Parent link for the custom dimension. Points to the property to which the - * custom dimension belongs. - */ - parentLink: any; - /** - * Scope of the custom dimension: HIT, SESSION, USER or PRODUCT. - */ - scope: string; - /** - * Link for the custom dimension - */ - selfLink: string; - /** - * Time the custom dimension was last modified. - */ - updated: string; - /** - * Property ID. - */ - webPropertyId: string; -} -/** - * A custom dimension collection lists Analytics custom dimensions to which the - * user has access. Each resource in the collection corresponds to a single - * Analytics custom dimension. - */ -export interface Schema$CustomDimensions { - /** - * Collection of custom dimensions. - */ - items: Schema$CustomDimension[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this custom dimension collection. - */ - nextLink: string; - /** - * Link to previous page for this custom dimension collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for Analytics Custom Metric. - */ -export interface Schema$CustomMetric { - /** - * Account ID. - */ - accountId: string; - /** - * Boolean indicating whether the custom metric is active. - */ - active: boolean; - /** - * Time the custom metric was created. - */ - created: string; - /** - * Custom metric ID. - */ - id: string; - /** - * Index of the custom metric. - */ - index: number; - /** - * Kind value for a custom metric. Set to "analytics#customMetric". - * It is a read-only field. - */ - kind: string; - /** - * Max value of custom metric. - */ - max_value: string; - /** - * Min value of custom metric. - */ - min_value: string; - /** - * Name of the custom metric. - */ - name: string; - /** - * Parent link for the custom metric. Points to the property to which the - * custom metric belongs. - */ - parentLink: any; - /** - * Scope of the custom metric: HIT or PRODUCT. - */ - scope: string; - /** - * Link for the custom metric - */ - selfLink: string; - /** - * Data type of custom metric. - */ - type: string; - /** - * Time the custom metric was last modified. - */ - updated: string; - /** - * Property ID. - */ - webPropertyId: string; -} -/** - * A custom metric collection lists Analytics custom metrics to which the user - * has access. Each resource in the collection corresponds to a single Analytics - * custom metric. - */ -export interface Schema$CustomMetrics { - /** - * Collection of custom metrics. - */ - items: Schema$CustomMetric[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this custom metric collection. - */ - nextLink: string; - /** - * Link to previous page for this custom metric collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for Analytics Entity AdWords Link. - */ -export interface Schema$EntityAdWordsLink { - /** - * A list of AdWords client accounts. These cannot be MCC accounts. This field - * is required when creating an AdWords link. It cannot be empty. - */ - adWordsAccounts: Schema$AdWordsAccount[]; - /** - * Web property being linked. - */ - entity: any; - /** - * Entity AdWords link ID - */ - id: string; - /** - * Resource type for entity AdWords link. - */ - kind: string; - /** - * Name of the link. This field is required when creating an AdWords link. - */ - name: string; - /** - * IDs of linked Views (Profiles) represented as strings. - */ - profileIds: string[]; - /** - * URL link for this Google Analytics - Google AdWords link. - */ - selfLink: string; -} -/** - * An entity AdWords link collection provides a list of GA-AdWords links Each - * resource in this collection corresponds to a single link. - */ -export interface Schema$EntityAdWordsLinks { - /** - * A list of entity AdWords links. - */ - items: Schema$EntityAdWordsLink[]; - /** - * The maximum number of entries the response can contain, regardless of the - * actual number of entries returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Next link for this AdWords link collection. - */ - nextLink: string; - /** - * Previous link for this AdWords link collection. - */ - previousLink: string; - /** - * The starting index of the entries, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; -} -/** - * JSON template for an Analytics Entity-User Link. Returns permissions that a - * user has for an entity. - */ -export interface Schema$EntityUserLink { - /** - * Entity for this link. It can be an account, a web property, or a view - * (profile). - */ - entity: any; - /** - * Entity user link ID - */ - id: string; - /** - * Resource type for entity user link. - */ - kind: string; - /** - * Permissions the user has for this entity. - */ - permissions: any; - /** - * Self link for this resource. - */ - selfLink: string; - /** - * User reference. - */ - userRef: Schema$UserRef; -} -/** - * An entity user link collection provides a list of Analytics ACL links Each - * resource in this collection corresponds to a single link. - */ -export interface Schema$EntityUserLinks { - /** - * A list of entity user links. - */ - items: Schema$EntityUserLink[]; - /** - * The maximum number of entries the response can contain, regardless of the - * actual number of entries returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Next link for this account collection. - */ - nextLink: string; - /** - * Previous link for this account collection. - */ - previousLink: string; - /** - * The starting index of the entries, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; -} -/** - * JSON template for Analytics experiment resource. - */ -export interface Schema$Experiment { - /** - * Account ID to which this experiment belongs. This field is read-only. - */ - accountId: string; - /** - * Time the experiment was created. This field is read-only. - */ - created: string; - /** - * Notes about this experiment. - */ - description: string; - /** - * If true, the end user will be able to edit the experiment via the Google - * Analytics user interface. - */ - editableInGaUi: boolean; - /** - * The ending time of the experiment (the time the status changed from RUNNING - * to ENDED). This field is present only if the experiment has ended. This - * field is read-only. - */ - endTime: string; - /** - * Boolean specifying whether to distribute traffic evenly across all - * variations. If the value is False, content experiments follows the default - * behavior of adjusting traffic dynamically based on variation performance. - * Optional -- defaults to False. This field may not be changed for an - * experiment whose status is ENDED. - */ - equalWeighting: boolean; - /** - * Experiment ID. Required for patch and update. Disallowed for create. - */ - id: string; - /** - * Internal ID for the web property to which this experiment belongs. This - * field is read-only. - */ - internalWebPropertyId: string; - /** - * Resource type for an Analytics experiment. This field is read-only. - */ - kind: string; - /** - * An integer number in [3, 90]. Specifies the minimum length of the - * experiment. Can be changed for a running experiment. This field may not be - * changed for an experiments whose status is ENDED. - */ - minimumExperimentLengthInDays: number; - /** - * Experiment name. This field may not be changed for an experiment whose - * status is ENDED. This field is required when creating an experiment. - */ - name: string; - /** - * The metric that the experiment is optimizing. Valid values: - * "ga:goal(n)Completions", "ga:adsenseAdsClicks", - * "ga:adsenseAdsViewed", "ga:adsenseRevenue", - * "ga:bounces", "ga:pageviews", - * "ga:sessionDuration", "ga:transactions", - * "ga:transactionRevenue". This field is required if status is - * "RUNNING" and servingFramework is one of "REDIRECT" or - * "API". - */ - objectiveMetric: string; - /** - * Whether the objectiveMetric should be minimized or maximized. Possible - * values: "MAXIMUM", "MINIMUM". Optional--defaults to - * "MAXIMUM". Cannot be specified without objectiveMetric. Cannot be - * modified when status is "RUNNING" or "ENDED". - */ - optimizationType: string; - /** - * Parent link for an experiment. Points to the view (profile) to which this - * experiment belongs. - */ - parentLink: any; - /** - * View (Profile) ID to which this experiment belongs. This field is - * read-only. - */ - profileId: string; - /** - * Why the experiment ended. Possible values: "STOPPED_BY_USER", - * "WINNER_FOUND", "EXPERIMENT_EXPIRED", - * "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". - * "ENDED_WITH_NO_WINNER" means that the experiment didn't - * expire but no winner was projected to be found. If the experiment status is - * changed via the API to ENDED this field is set to STOPPED_BY_USER. This - * field is read-only. - */ - reasonExperimentEnded: string; - /** - * Boolean specifying whether variations URLS are rewritten to match those of - * the original. This field may not be changed for an experiments whose status - * is ENDED. - */ - rewriteVariationUrlsAsOriginal: boolean; - /** - * Link for this experiment. This field is read-only. - */ - selfLink: string; - /** - * The framework used to serve the experiment variations and evaluate the - * results. One of: - REDIRECT: Google Analytics redirects traffic to - * different variation pages, reports the chosen variation and evaluates the - * results. - API: Google Analytics chooses and reports the variation to serve - * and evaluates the results; the caller is responsible for serving the - * selected variation. - EXTERNAL: The variations will be served externally - * and the chosen variation reported to Google Analytics. The caller is - * responsible for serving the selected variation and evaluating the results. - */ - servingFramework: string; - /** - * The snippet of code to include on the control page(s). This field is - * read-only. - */ - snippet: string; - /** - * The starting time of the experiment (the time the status changed from - * READY_TO_RUN to RUNNING). This field is present only if the experiment has - * started. This field is read-only. - */ - startTime: string; - /** - * Experiment status. Possible values: "DRAFT", - * "READY_TO_RUN", "RUNNING", "ENDED". - * Experiments can be created in the "DRAFT", - * "READY_TO_RUN" or "RUNNING" state. This field is - * required when creating an experiment. - */ - status: string; - /** - * A floating-point number in (0, 1]. Specifies the fraction of the traffic - * that participates in the experiment. Can be changed for a running - * experiment. This field may not be changed for an experiments whose status - * is ENDED. - */ - trafficCoverage: number; - /** - * Time the experiment was last modified. This field is read-only. - */ - updated: string; - /** - * Array of variations. The first variation in the array is the original. The - * number of variations may not change once an experiment is in the RUNNING - * state. At least two variations are required before status can be set to - * RUNNING. - */ - variations: any[]; - /** - * Web property ID to which this experiment belongs. The web property ID is of - * the form UA-XXXXX-YY. This field is read-only. - */ - webPropertyId: string; - /** - * A floating-point number in (0, 1). Specifies the necessary confidence level - * to choose a winner. This field may not be changed for an experiments whose - * status is ENDED. - */ - winnerConfidenceLevel: number; - /** - * Boolean specifying whether a winner has been found for this experiment. - * This field is read-only. - */ - winnerFound: boolean; -} -/** - * An experiment collection lists Analytics experiments to which the user has - * access. Each view (profile) can have a set of experiments. Each resource in - * the Experiment collection corresponds to a single Analytics experiment. - */ -export interface Schema$Experiments { - /** - * A list of experiments. - */ - items: Schema$Experiment[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this experiment collection. - */ - nextLink: string; - /** - * Link to previous page for this experiment collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * resources in the result. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics account filter. - */ -export interface Schema$Filter { - /** - * Account ID to which this filter belongs. - */ - accountId: string; - /** - * Details for the filter of the type ADVANCED. - */ - advancedDetails: any; - /** - * Time this filter was created. - */ - created: string; - /** - * Details for the filter of the type EXCLUDE. - */ - excludeDetails: Schema$FilterExpression; - /** - * Filter ID. - */ - id: string; - /** - * Details for the filter of the type INCLUDE. - */ - includeDetails: Schema$FilterExpression; - /** - * Resource type for Analytics filter. - */ - kind: string; - /** - * Details for the filter of the type LOWER. - */ - lowercaseDetails: any; - /** - * Name of this filter. - */ - name: string; - /** - * Parent link for this filter. Points to the account to which this filter - * belongs. - */ - parentLink: any; - /** - * Details for the filter of the type SEARCH_AND_REPLACE. - */ - searchAndReplaceDetails: any; - /** - * Link for this filter. - */ - selfLink: string; - /** - * Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, - * UPPERCASE, SEARCH_AND_REPLACE and ADVANCED. - */ - type: string; - /** - * Time this filter was last modified. - */ - updated: string; - /** - * Details for the filter of the type UPPER. - */ - uppercaseDetails: any; -} -/** - * JSON template for an Analytics filter expression. - */ -export interface Schema$FilterExpression { - /** - * Determines if the filter is case sensitive. - */ - caseSensitive: boolean; - /** - * Filter expression value - */ - expressionValue: string; - /** - * Field to filter. Possible values: - Content and Traffic - - * PAGE_REQUEST_URI, - PAGE_HOSTNAME, - PAGE_TITLE, - REFERRAL, - - * COST_DATA_URI (Campaign target URL), - HIT_TYPE, - INTERNAL_SEARCH_TERM, - * - INTERNAL_SEARCH_TYPE, - SOURCE_PROPERTY_TRACKING_ID, - Campaign or - * AdGroup - CAMPAIGN_SOURCE, - CAMPAIGN_MEDIUM, - CAMPAIGN_NAME, - - * CAMPAIGN_AD_GROUP, - CAMPAIGN_TERM, - CAMPAIGN_CONTENT, - CAMPAIGN_CODE, - * - CAMPAIGN_REFERRAL_PATH, - E-Commerce - TRANSACTION_COUNTRY, - - * TRANSACTION_REGION, - TRANSACTION_CITY, - TRANSACTION_AFFILIATION (Store - * or order location), - ITEM_NAME, - ITEM_CODE, - ITEM_VARIATION, - - * TRANSACTION_ID, - TRANSACTION_CURRENCY_CODE, - PRODUCT_ACTION_TYPE, - - * Audience/Users - BROWSER, - BROWSER_VERSION, - BROWSER_SIZE, - - * PLATFORM, - PLATFORM_VERSION, - LANGUAGE, - SCREEN_RESOLUTION, - - * SCREEN_COLORS, - JAVA_ENABLED (Boolean Field), - FLASH_VERSION, - - * GEO_SPEED (Connection speed), - VISITOR_TYPE, - GEO_ORGANIZATION (ISP - * organization), - GEO_DOMAIN, - GEO_IP_ADDRESS, - GEO_IP_VERSION, - - * Location - GEO_COUNTRY, - GEO_REGION, - GEO_CITY, - Event - - * EVENT_CATEGORY, - EVENT_ACTION, - EVENT_LABEL, - Other - - * CUSTOM_FIELD_1, - CUSTOM_FIELD_2, - USER_DEFINED_VALUE, - Application - * - APP_ID, - APP_INSTALLER_ID, - APP_NAME, - APP_VERSION, - SCREEN, - - * IS_APP (Boolean Field), - IS_FATAL_EXCEPTION (Boolean Field), - - * EXCEPTION_DESCRIPTION, - Mobile device - IS_MOBILE (Boolean Field, - * Deprecated. Use DEVICE_CATEGORY=mobile), - IS_TABLET (Boolean Field, - * Deprecated. Use DEVICE_CATEGORY=tablet), - DEVICE_CATEGORY, - - * MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), - MOBILE_HAS_NFC_SUPPORT - * (Boolean Field), - MOBILE_HAS_CELLULAR_RADIO (Boolean Field), - - * MOBILE_HAS_WIFI_SUPPORT (Boolean Field), - MOBILE_BRAND_NAME, - - * MOBILE_MODEL_NAME, - MOBILE_MARKETING_NAME, - MOBILE_POINTING_METHOD, - - * Social - SOCIAL_NETWORK, - SOCIAL_ACTION, - SOCIAL_ACTION_TARGET, - - * Custom dimension - CUSTOM_DIMENSION (See accompanying field index), - */ - field: string; - /** - * The Index of the custom dimension. Set only if the field is a is - * CUSTOM_DIMENSION. - */ - fieldIndex: number; - /** - * Kind value for filter expression - */ - kind: string; - /** - * Match type for this filter. Possible values are BEGINS_WITH, EQUAL, - * ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, - * PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use any match type; all - * other filters must use MATCHES. - */ - matchType: string; -} -/** - * JSON template for a profile filter link. - */ -export interface Schema$FilterRef { - /** - * Account ID to which this filter belongs. - */ - accountId: string; - /** - * Link for this filter. - */ - href: string; - /** - * Filter ID. - */ - id: string; - /** - * Kind value for filter reference. - */ - kind: string; - /** - * Name of this filter. - */ - name: string; -} -/** - * A filter collection lists filters created by users in an Analytics account. - * Each resource in the collection corresponds to a filter. - */ -export interface Schema$Filters { - /** - * A list of filters. - */ - items: Schema$Filter[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1,000 with - * a value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this filter collection. - */ - nextLink: string; - /** - * Link to previous page for this filter collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * Analytics data for a given view (profile). - */ -export interface Schema$GaData { - /** - * Column headers that list dimension names followed by the metric names. The - * order of dimensions and metrics is same as specified in the request. - */ - columnHeaders: any[]; - /** - * Determines if Analytics data contains samples. - */ - containsSampledData: boolean; - /** - * The last refreshed time in seconds for Analytics data. - */ - dataLastRefreshed: string; - dataTable: any; - /** - * Unique ID for this data response. - */ - id: string; - /** - * The maximum number of rows the response can contain, regardless of the - * actual number of rows returned. Its value ranges from 1 to 10,000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Resource type. - */ - kind: string; - /** - * Link to next page for this Analytics data query. - */ - nextLink: string; - /** - * Link to previous page for this Analytics data query. - */ - previousLink: string; - /** - * Information for the view (profile), for which the Analytics data was - * requested. - */ - profileInfo: any; - /** - * Analytics data request query parameters. - */ - query: any; - /** - * Analytics data rows, where each row contains a list of dimension values - * followed by the metric values. The order of dimensions and metrics is same - * as specified in the request. - */ - rows: string[][]; - /** - * The number of samples used to calculate the result. - */ - sampleSize: string; - /** - * Total size of the sample space from which the samples were selected. - */ - sampleSpace: string; - /** - * Link to this page. - */ - selfLink: string; - /** - * The total number of rows for the query, regardless of the number of rows in - * the response. - */ - totalResults: number; - /** - * Total values for the requested metrics over all the results, not just the - * results returned in this response. The order of the metric totals is same - * as the metric order specified in the request. - */ - totalsForAllResults: any; -} -/** - * JSON template for Analytics goal resource. - */ -export interface Schema$Goal { - /** - * Account ID to which this goal belongs. - */ - accountId: string; - /** - * Determines whether this goal is active. - */ - active: boolean; - /** - * Time this goal was created. - */ - created: string; - /** - * Details for the goal of the type EVENT. - */ - eventDetails: any; - /** - * Goal ID. - */ - id: string; - /** - * Internal ID for the web property to which this goal belongs. - */ - internalWebPropertyId: string; - /** - * Resource type for an Analytics goal. - */ - kind: string; - /** - * Goal name. - */ - name: string; - /** - * Parent link for a goal. Points to the view (profile) to which this goal - * belongs. - */ - parentLink: any; - /** - * View (Profile) ID to which this goal belongs. - */ - profileId: string; - /** - * Link for this goal. - */ - selfLink: string; - /** - * Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, - * VISIT_NUM_PAGES, AND EVENT. - */ - type: string; - /** - * Time this goal was last modified. - */ - updated: string; - /** - * Details for the goal of the type URL_DESTINATION. - */ - urlDestinationDetails: any; - /** - * Goal value. - */ - value: number; - /** - * Details for the goal of the type VISIT_NUM_PAGES. - */ - visitNumPagesDetails: any; - /** - * Details for the goal of the type VISIT_TIME_ON_SITE. - */ - visitTimeOnSiteDetails: any; - /** - * Web property ID to which this goal belongs. The web property ID is of the - * form UA-XXXXX-YY. - */ - webPropertyId: string; -} -/** - * A goal collection lists Analytics goals to which the user has access. Each - * view (profile) can have a set of goals. Each resource in the Goal collection - * corresponds to a single Analytics goal. - */ -export interface Schema$Goals { - /** - * A list of goals. - */ - items: Schema$Goal[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this goal collection. - */ - nextLink: string; - /** - * Link to previous page for this goal collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * resources in the result. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics Remarketing Include Conditions. - */ -export interface Schema$IncludeConditions { - /** - * The look-back window lets you specify a time frame for evaluating the - * behavior that qualifies users for your audience. For example, if your - * filters include users from Central Asia, and Transactions Greater than 2, - * and you set the look-back window to 14 days, then any user from Central - * Asia whose cumulative transactions exceed 2 during the last 14 days is - * added to the audience. - */ - daysToLookBack: number; - /** - * Boolean indicating whether this segment is a smart list. - * https://support.google.com/analytics/answer/4628577 - */ - isSmartList: boolean; - /** - * Resource type for include conditions. - */ - kind: string; - /** - * Number of days (in the range 1 to 540) a user remains in the audience. - */ - membershipDurationDays: number; - /** - * The segment condition that will cause a user to be added to an audience. - */ - segment: string; -} -/** - * JSON template for an Analytics Remarketing Audience Foreign Link. - */ -export interface Schema$LinkedForeignAccount { - /** - * Account ID to which this linked foreign account belongs. - */ - accountId: string; - /** - * Boolean indicating whether this is eligible for search. - */ - eligibleForSearch: boolean; - /** - * Entity ad account link ID. - */ - id: string; - /** - * Internal ID for the web property to which this linked foreign account - * belongs. - */ - internalWebPropertyId: string; - /** - * Resource type for linked foreign account. - */ - kind: string; - /** - * The foreign account ID. For example the an AdWords `linkedAccountId` has - * the following format XXX-XXX-XXXX. - */ - linkedAccountId: string; - /** - * Remarketing audience ID to which this linked foreign account belongs. - */ - remarketingAudienceId: string; - /** - * The status of this foreign account link. - */ - status: string; - /** - * The type of the foreign account. For example, `ADWORDS_LINKS`, `DBM_LINKS`, - * `MCC_LINKS` or `OPTIMIZE`. - */ - type: string; - /** - * Web property ID of the form UA-XXXXX-YY to which this linked foreign - * account belongs. - */ - webPropertyId: string; -} -/** - * Multi-Channel Funnels data for a given view (profile). - */ -export interface Schema$McfData { - /** - * Column headers that list dimension names followed by the metric names. The - * order of dimensions and metrics is same as specified in the request. - */ - columnHeaders: any[]; - /** - * Determines if the Analytics data contains sampled data. - */ - containsSampledData: boolean; - /** - * Unique ID for this data response. - */ - id: string; - /** - * The maximum number of rows the response can contain, regardless of the - * actual number of rows returned. Its value ranges from 1 to 10,000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Resource type. - */ - kind: string; - /** - * Link to next page for this Analytics data query. - */ - nextLink: string; - /** - * Link to previous page for this Analytics data query. - */ - previousLink: string; - /** - * Information for the view (profile), for which the Analytics data was - * requested. - */ - profileInfo: any; - /** - * Analytics data request query parameters. - */ - query: any; - /** - * Analytics data rows, where each row contains a list of dimension values - * followed by the metric values. The order of dimensions and metrics is same - * as specified in the request. - */ - rows: any[][]; - /** - * The number of samples used to calculate the result. - */ - sampleSize: string; - /** - * Total size of the sample space from which the samples were selected. - */ - sampleSpace: string; - /** - * Link to this page. - */ - selfLink: string; - /** - * The total number of rows for the query, regardless of the number of rows in - * the response. - */ - totalResults: number; - /** - * Total values for the requested metrics over all the results, not just the - * results returned in this response. The order of the metric totals is same - * as the metric order specified in the request. - */ - totalsForAllResults: any; -} -/** - * JSON template for an Analytics view (profile). - */ -export interface Schema$Profile { - /** - * Account ID to which this view (profile) belongs. - */ - accountId: string; - /** - * Indicates whether bot filtering is enabled for this view (profile). - */ - botFilteringEnabled: boolean; - /** - * Child link for this view (profile). Points to the list of goals for this - * view (profile). - */ - childLink: any; - /** - * Time this view (profile) was created. - */ - created: string; - /** - * The currency type associated with this view (profile), defaults to USD. The - * supported values are: USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, RUB, - * SEK, NOK, PLN, TRY, TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, CHF, CAD, - * CZK, NZD, HUF, BGN, LTL, ZAR, UAH, AED, BOB, CLP, COP, EGP, HRK, ILS, MAD, - * MYR, PEN, PKR, RON, RSD, SAR, SGD, VEF, LVL - */ - currency: string; - /** - * Default page for this view (profile). - */ - defaultPage: string; - /** - * Indicates whether ecommerce tracking is enabled for this view (profile). - */ - eCommerceTracking: boolean; - /** - * Indicates whether enhanced ecommerce tracking is enabled for this view - * (profile). This property can only be enabled if ecommerce tracking is - * enabled. - */ - enhancedECommerceTracking: boolean; - /** - * The query parameters that are excluded from this view (profile). - */ - excludeQueryParameters: string; - /** - * View (Profile) ID. - */ - id: string; - /** - * Internal ID for the web property to which this view (profile) belongs. - */ - internalWebPropertyId: string; - /** - * Resource type for Analytics view (profile). - */ - kind: string; - /** - * Name of this view (profile). - */ - name: string; - /** - * Parent link for this view (profile). Points to the web property to which - * this view (profile) belongs. - */ - parentLink: any; - /** - * Permissions the user has for this view (profile). - */ - permissions: any; - /** - * Link for this view (profile). - */ - selfLink: string; - /** - * Site search category parameters for this view (profile). - */ - siteSearchCategoryParameters: string; - /** - * The site search query parameters for this view (profile). - */ - siteSearchQueryParameters: string; - /** - * Indicates whether this view (profile) is starred or not. - */ - starred: boolean; - /** - * Whether or not Analytics will strip search category parameters from the - * URLs in your reports. - */ - stripSiteSearchCategoryParameters: boolean; - /** - * Whether or not Analytics will strip search query parameters from the URLs - * in your reports. - */ - stripSiteSearchQueryParameters: boolean; - /** - * Time zone for which this view (profile) has been configured. Time zones are - * identified by strings from the TZ database. - */ - timezone: string; - /** - * View (Profile) type. Supported types: WEB or APP. - */ - type: string; - /** - * Time this view (profile) was last modified. - */ - updated: string; - /** - * Web property ID of the form UA-XXXXX-YY to which this view (profile) - * belongs. - */ - webPropertyId: string; - /** - * Website URL for this view (profile). - */ - websiteUrl: string; -} -/** - * JSON template for an Analytics profile filter link. - */ -export interface Schema$ProfileFilterLink { - /** - * Filter for this link. - */ - filterRef: Schema$FilterRef; - /** - * Profile filter link ID. - */ - id: string; - /** - * Resource type for Analytics filter. - */ - kind: string; - /** - * View (Profile) for this link. - */ - profileRef: Schema$ProfileRef; - /** - * The rank of this profile filter link relative to the other filters linked - * to the same profile. For readonly (i.e., list and get) operations, the rank - * always starts at 1. For write (i.e., create, update, or delete) operations, - * you may specify a value between 0 and 255 inclusively, [0, 255]. In order - * to insert a link at the end of the list, either don't specify a rank or - * set a rank to a number greater than the largest rank in the list. In order - * to insert a link to the beginning of the list specify a rank that is less - * than or equal to 1. The new link will move all existing filters with the - * same or lower rank down the list. After the link is - * inserted/updated/deleted all profile filter links will be renumbered - * starting at 1. - */ - rank: number; - /** - * Link for this profile filter link. - */ - selfLink: string; -} -/** - * A profile filter link collection lists profile filter links between profiles - * and filters. Each resource in the collection corresponds to a profile filter - * link. - */ -export interface Schema$ProfileFilterLinks { - /** - * A list of profile filter links. - */ - items: Schema$ProfileFilterLink[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1,000 with - * a value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this profile filter link collection. - */ - nextLink: string; - /** - * Link to previous page for this profile filter link collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for a linked view (profile). - */ -export interface Schema$ProfileRef { - /** - * Account ID to which this view (profile) belongs. - */ - accountId: string; - /** - * Link for this view (profile). - */ - href: string; - /** - * View (Profile) ID. - */ - id: string; - /** - * Internal ID for the web property to which this view (profile) belongs. - */ - internalWebPropertyId: string; - /** - * Analytics view (profile) reference. - */ - kind: string; - /** - * Name of this view (profile). - */ - name: string; - /** - * Web property ID of the form UA-XXXXX-YY to which this view (profile) - * belongs. - */ - webPropertyId: string; -} -/** - * A view (profile) collection lists Analytics views (profiles) to which the - * user has access. Each resource in the collection corresponds to a single - * Analytics view (profile). - */ -export interface Schema$Profiles { - /** - * A list of views (profiles). - */ - items: Schema$Profile[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this view (profile) collection. - */ - nextLink: string; - /** - * Link to previous page for this view (profile) collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics ProfileSummary. ProfileSummary returns basic - * information (i.e., summary) for a profile. - */ -export interface Schema$ProfileSummary { - /** - * View (profile) ID. - */ - id: string; - /** - * Resource type for Analytics ProfileSummary. - */ - kind: string; - /** - * View (profile) name. - */ - name: string; - /** - * Indicates whether this view (profile) is starred or not. - */ - starred: boolean; - /** - * View (Profile) type. Supported types: WEB or APP. - */ - type: string; -} -/** - * Real time data for a given view (profile). - */ -export interface Schema$RealtimeData { - /** - * Column headers that list dimension names followed by the metric names. The - * order of dimensions and metrics is same as specified in the request. - */ - columnHeaders: any[]; - /** - * Unique ID for this data response. - */ - id: string; - /** - * Resource type. - */ - kind: string; - /** - * Information for the view (profile), for which the real time data was - * requested. - */ - profileInfo: any; - /** - * Real time data request query parameters. - */ - query: any; - /** - * Real time data rows, where each row contains a list of dimension values - * followed by the metric values. The order of dimensions and metrics is same - * as specified in the request. - */ - rows: string[][]; - /** - * Link to this page. - */ - selfLink: string; - /** - * The total number of rows for the query, regardless of the number of rows in - * the response. - */ - totalResults: number; - /** - * Total values for the requested metrics over all the results, not just the - * results returned in this response. The order of the metric totals is same - * as the metric order specified in the request. - */ - totalsForAllResults: any; -} -/** - * JSON template for an Analytics remarketing audience. - */ -export interface Schema$RemarketingAudience { - /** - * Account ID to which this remarketing audience belongs. - */ - accountId: string; - /** - * The simple audience definition that will cause a user to be added to an - * audience. - */ - audienceDefinition: any; - /** - * The type of audience, either SIMPLE or STATE_BASED. - */ - audienceType: string; - /** - * Time this remarketing audience was created. - */ - created: string; - /** - * The description of this remarketing audience. - */ - description: string; - /** - * Remarketing Audience ID. - */ - id: string; - /** - * Internal ID for the web property to which this remarketing audience - * belongs. - */ - internalWebPropertyId: string; - /** - * Collection type. - */ - kind: string; - /** - * The linked ad accounts associated with this remarketing audience. A - * remarketing audience can have only one linkedAdAccount currently. - */ - linkedAdAccounts: Schema$LinkedForeignAccount[]; - /** - * The views (profiles) that this remarketing audience is linked to. - */ - linkedViews: string[]; - /** - * The name of this remarketing audience. - */ - name: string; - /** - * A state based audience definition that will cause a user to be added or - * removed from an audience. - */ - stateBasedAudienceDefinition: any; - /** - * Time this remarketing audience was last modified. - */ - updated: string; - /** - * Web property ID of the form UA-XXXXX-YY to which this remarketing audience - * belongs. - */ - webPropertyId: string; -} -/** - * A remarketing audience collection lists Analytics remarketing audiences to - * which the user has access. Each resource in the collection corresponds to a - * single Analytics remarketing audience. - */ -export interface Schema$RemarketingAudiences { - /** - * A list of remarketing audiences. - */ - items: Schema$RemarketingAudience[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this remarketing audience collection. - */ - nextLink: string; - /** - * Link to previous page for this view (profile) collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics segment. - */ -export interface Schema$Segment { - /** - * Time the segment was created. - */ - created: string; - /** - * Segment definition. - */ - definition: string; - /** - * Segment ID. - */ - id: string; - /** - * Resource type for Analytics segment. - */ - kind: string; - /** - * Segment name. - */ - name: string; - /** - * Segment ID. Can be used with the 'segment' parameter in Core - * Reporting API. - */ - segmentId: string; - /** - * Link for this segment. - */ - selfLink: string; - /** - * Type for a segment. Possible values are "BUILT_IN" or - * "CUSTOM". - */ - type: string; - /** - * Time the segment was last modified. - */ - updated: string; -} -/** - * An segment collection lists Analytics segments that the user has access to. - * Each resource in the collection corresponds to a single Analytics segment. - */ -export interface Schema$Segments { - /** - * A list of segments. - */ - items: Schema$Segment[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type for segments. - */ - kind: string; - /** - * Link to next page for this segment collection. - */ - nextLink: string; - /** - * Link to previous page for this segment collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for Analytics unsampled report resource. - */ -export interface Schema$UnsampledReport { - /** - * Account ID to which this unsampled report belongs. - */ - accountId: string; - /** - * Download details for a file stored in Google Cloud Storage. - */ - cloudStorageDownloadDetails: any; - /** - * Time this unsampled report was created. - */ - created: string; - /** - * The dimensions for the unsampled report. - */ - dimensions: string; - /** - * The type of download you need to use for the report data file. Possible - * values include `GOOGLE_DRIVE` and `GOOGLE_CLOUD_STORAGE`. If the value is - * `GOOGLE_DRIVE`, see the `driveDownloadDetails` field. If the value is - * `GOOGLE_CLOUD_STORAGE`, see the `cloudStorageDownloadDetails` field. - */ - downloadType: string; - /** - * Download details for a file stored in Google Drive. - */ - driveDownloadDetails: any; - /** - * The end date for the unsampled report. - */ - enddate: string; - /** - * The filters for the unsampled report. - */ - filters: string; - /** - * Unsampled report ID. - */ - id: string; - /** - * Resource type for an Analytics unsampled report. - */ - kind: string; - /** - * The metrics for the unsampled report. - */ - metrics: string; - /** - * View (Profile) ID to which this unsampled report belongs. - */ - profileId: string; - /** - * The segment for the unsampled report. - */ - segment: string; - /** - * Link for this unsampled report. - */ - selfLink: string; - /** - * The start date for the unsampled report. - */ - startdate: string; - /** - * Status of this unsampled report. Possible values are PENDING, COMPLETED, or - * FAILED. - */ - status: string; - /** - * Title of the unsampled report. - */ - title: string; - /** - * Time this unsampled report was last modified. - */ - updated: string; - /** - * Web property ID to which this unsampled report belongs. The web property ID - * is of the form UA-XXXXX-YY. - */ - webPropertyId: string; -} -/** - * An unsampled report collection lists Analytics unsampled reports to which the - * user has access. Each view (profile) can have a set of unsampled reports. - * Each resource in the unsampled report collection corresponds to a single - * Analytics unsampled report. - */ -export interface Schema$UnsampledReports { - /** - * A list of unsampled reports. - */ - items: Schema$UnsampledReport[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this unsampled report collection. - */ - nextLink: string; - /** - * Link to previous page for this unsampled report collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * resources in the result. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * Metadata returned for an upload operation. - */ -export interface Schema$Upload { - /** - * Account Id to which this upload belongs. - */ - accountId: string; - /** - * Custom data source Id to which this data import belongs. - */ - customDataSourceId: string; - /** - * Data import errors collection. - */ - errors: string[]; - /** - * A unique ID for this upload. - */ - id: string; - /** - * Resource type for Analytics upload. - */ - kind: string; - /** - * Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, - * DELETED. - */ - status: string; - /** - * Time this file is uploaded. - */ - uploadTime: string; -} -/** - * Upload collection lists Analytics uploads to which the user has access. Each - * custom data source can have a set of uploads. Each resource in the upload - * collection corresponds to a single Analytics data upload. - */ -export interface Schema$Uploads { - /** - * A list of uploads. - */ - items: Schema$Upload[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this upload collection. - */ - nextLink: string; - /** - * Link to previous page for this upload collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * resources in the result. - */ - totalResults: number; -} -/** - * JSON template for a user reference. - */ -export interface Schema$UserRef { - /** - * Email ID of this user. - */ - email: string; - /** - * User ID. - */ - id: string; - kind: string; -} -/** - * A web property collection lists Analytics web properties to which the user - * has access. Each resource in the collection corresponds to a single Analytics - * web property. - */ -export interface Schema$Webproperties { - /** - * A list of web properties. - */ - items: Schema$Webproperty[]; - /** - * The maximum number of resources the response can contain, regardless of the - * actual number of resources returned. Its value ranges from 1 to 1000 with a - * value of 1000 by default, or otherwise specified by the max-results query - * parameter. - */ - itemsPerPage: number; - /** - * Collection type. - */ - kind: string; - /** - * Link to next page for this web property collection. - */ - nextLink: string; - /** - * Link to previous page for this web property collection. - */ - previousLink: string; - /** - * The starting index of the resources, which is 1 by default or otherwise - * specified by the start-index query parameter. - */ - startIndex: number; - /** - * The total number of results for the query, regardless of the number of - * results in the response. - */ - totalResults: number; - /** - * Email ID of the authenticated user - */ - username: string; -} -/** - * JSON template for an Analytics web property. - */ -export interface Schema$Webproperty { - /** - * Account ID to which this web property belongs. - */ - accountId: string; - /** - * Child link for this web property. Points to the list of views (profiles) - * for this web property. - */ - childLink: any; - /** - * Time this web property was created. - */ - created: string; - /** - * Default view (profile) ID. - */ - defaultProfileId: string; - /** - * Web property ID of the form UA-XXXXX-YY. - */ - id: string; - /** - * The industry vertical/category selected for this web property. - */ - industryVertical: string; - /** - * Internal ID for this web property. - */ - internalWebPropertyId: string; - /** - * Resource type for Analytics WebProperty. - */ - kind: string; - /** - * Level for this web property. Possible values are STANDARD or PREMIUM. - */ - level: string; - /** - * Name of this web property. - */ - name: string; - /** - * Parent link for this web property. Points to the account to which this web - * property belongs. - */ - parentLink: any; - /** - * Permissions the user has for this web property. - */ - permissions: any; - /** - * View (Profile) count for this web property. - */ - profileCount: number; - /** - * Link for this web property. - */ - selfLink: string; - /** - * Indicates whether this web property is starred or not. - */ - starred: boolean; - /** - * Time this web property was last modified. - */ - updated: string; - /** - * Website url for this web property. - */ - websiteUrl: string; -} -/** - * JSON template for a web property reference. - */ -export interface Schema$WebPropertyRef { - /** - * Account ID to which this web property belongs. - */ - accountId: string; - /** - * Link for this web property. - */ - href: string; - /** - * Web property ID of the form UA-XXXXX-YY. - */ - id: string; - /** - * Internal ID for this web property. - */ - internalWebPropertyId: string; - /** - * Analytics web property reference. - */ - kind: string; - /** - * Name of this web property. - */ - name: string; -} -/** - * JSON template for an Analytics WebPropertySummary. WebPropertySummary returns - * basic information (i.e., summary) for a web property. - */ -export interface Schema$WebPropertySummary { - /** - * Web property ID of the form UA-XXXXX-YY. - */ - id: string; - /** - * Internal ID for this web property. - */ - internalWebPropertyId: string; - /** - * Resource type for Analytics WebPropertySummary. - */ - kind: string; - /** - * Level for this web property. Possible values are STANDARD or PREMIUM. - */ - level: string; - /** - * Web property name. - */ - name: string; - /** - * List of profiles under this web property. - */ - profiles: Schema$ProfileSummary[]; - /** - * Indicates whether this web property is starred or not. - */ - starred: boolean; - /** - * Website url for this web property. - */ - websiteUrl: string; -} - -export class Resource$Data { - root: Analytics; - ga: Resource$Data$Ga; - mcf: Resource$Data$Mcf; - realtime: Resource$Data$Realtime; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - this.ga = new Resource$Data$Ga(root); - this.mcf = new Resource$Data$Mcf(root); - this.realtime = new Resource$Data$Realtime(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Data$Ga { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.data.ga.get - * @desc Returns Analytics data for a view (profile). - * @alias analytics.data.ga.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. - * @param {string} params.end-date End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday. - * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to Analytics data. - * @param {string} params.ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. - * @param {boolean=} params.include-empty-rows The response will include empty rows if this parameter is set to true, the default is true - * @param {integer=} params.max-results The maximum number of entries to include in this feed. - * @param {string} params.metrics A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. - * @param {string=} params.output The selected format for the response. Default format is JSON. - * @param {string=} params.samplingLevel The desired sampling level. - * @param {string=} params.segment An Analytics segment to be applied to data. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. - * @param {string} params.start-date Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/data/ga') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Data$Mcf { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.data.mcf.get - * @desc Returns Analytics Multi-Channel Funnels data for a view (profile). - * @alias analytics.data.mcf.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimensions A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. - * @param {string} params.end-date End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. - * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to the Analytics data. - * @param {string} params.ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. - * @param {integer=} params.max-results The maximum number of entries to include in this feed. - * @param {string} params.metrics A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. - * @param {string=} params.samplingLevel The desired sampling level. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. - * @param {string} params.start-date Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/data/mcf') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Data$Realtime { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.data.realtime.get - * @desc Returns real time data for a view (profile). - * @alias analytics.data.realtime.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dimensions A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'. - * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to real time data. - * @param {string} params.ids Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. - * @param {integer=} params.max-results The maximum number of entries to include in this feed. - * @param {string} params.metrics A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for real time data. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/data/realtime') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Management { - root: Analytics; - accounts: Resource$Management$Accounts; - accountSummaries: Resource$Management$Accountsummaries; - accountUserLinks: Resource$Management$Accountuserlinks; - customDataSources: Resource$Management$Customdatasources; - customDimensions: Resource$Management$Customdimensions; - customMetrics: Resource$Management$Custommetrics; - experiments: Resource$Management$Experiments; - filters: Resource$Management$Filters; - goals: Resource$Management$Goals; - profileFilterLinks: Resource$Management$Profilefilterlinks; - profiles: Resource$Management$Profiles; - profileUserLinks: Resource$Management$Profileuserlinks; - remarketingAudience: Resource$Management$Remarketingaudience; - segments: Resource$Management$Segments; - unsampledReports: Resource$Management$Unsampledreports; - uploads: Resource$Management$Uploads; - webproperties: Resource$Management$Webproperties; - webPropertyAdWordsLinks: Resource$Management$Webpropertyadwordslinks; - webpropertyUserLinks: Resource$Management$Webpropertyuserlinks; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - this.accounts = new Resource$Management$Accounts(root); - this.accountSummaries = new Resource$Management$Accountsummaries(root); - this.accountUserLinks = new Resource$Management$Accountuserlinks(root); - this.customDataSources = new Resource$Management$Customdatasources(root); - this.customDimensions = new Resource$Management$Customdimensions(root); - this.customMetrics = new Resource$Management$Custommetrics(root); - this.experiments = new Resource$Management$Experiments(root); - this.filters = new Resource$Management$Filters(root); - this.goals = new Resource$Management$Goals(root); - this.profileFilterLinks = new Resource$Management$Profilefilterlinks(root); - this.profiles = new Resource$Management$Profiles(root); - this.profileUserLinks = new Resource$Management$Profileuserlinks(root); - this.remarketingAudience = - new Resource$Management$Remarketingaudience(root); - this.segments = new Resource$Management$Segments(root); - this.unsampledReports = new Resource$Management$Unsampledreports(root); - this.uploads = new Resource$Management$Uploads(root); - this.webproperties = new Resource$Management$Webproperties(root); - this.webPropertyAdWordsLinks = - new Resource$Management$Webpropertyadwordslinks(root); - this.webpropertyUserLinks = - new Resource$Management$Webpropertyuserlinks(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Management$Accounts { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.accounts.list - * @desc Lists all accounts to which the user has access. - * @alias analytics.management.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.max-results The maximum number of accounts to include in this response. - * @param {integer=} params.start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/management/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Accountsummaries { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.accountSummaries.list - * @desc Lists account summaries (lightweight tree comprised of - * accounts/properties/profiles) to which the user has access. - * @alias analytics.management.accountSummaries.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.max-results The maximum number of account summaries to include in this response, where the largest acceptable value is 1000. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/management/accountSummaries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Accountuserlinks { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.accountUserLinks.delete - * @desc Removes a user from the given account. - * @alias analytics.management.accountUserLinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the user link for. - * @param {string} params.linkId Link ID to delete the user link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'linkId'], - pathParams: ['accountId', 'linkId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.accountUserLinks.insert - * @desc Adds a new user to the given account. - * @alias analytics.management.accountUserLinks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.accountUserLinks.list - * @desc Lists account-user links for a given account. - * @alias analytics.management.accountUserLinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve the user links for. - * @param {integer=} params.max-results The maximum number of account-user links to include in this response. - * @param {integer=} params.start-index An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.accountUserLinks.update - * @desc Updates permissions for an existing user on the given account. - * @alias analytics.management.accountUserLinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to update the account-user link for. - * @param {string} params.linkId Link ID to update the account-user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'linkId'], - pathParams: ['accountId', 'linkId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Customdatasources { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.customDataSources.list - * @desc List custom data sources to which the user has access. - * @alias analytics.management.customDataSources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account Id for the custom data sources to retrieve. - * @param {integer=} params.max-results The maximum number of custom data sources to include in this response. - * @param {integer=} params.start-index A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property Id for the custom data sources to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Customdimensions { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.customDimensions.get - * @desc Get a custom dimension to which the user has access. - * @alias analytics.management.customDimensions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom dimension to retrieve. - * @param {string} params.customDimensionId The ID of the custom dimension to retrieve. - * @param {string} params.webPropertyId Web property ID for the custom dimension to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], - pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customDimensions.insert - * @desc Create a new custom dimension. - * @alias analytics.management.customDimensions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom dimension to create. - * @param {string} params.webPropertyId Web property ID for the custom dimension to create. - * @param {().CustomDimension} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customDimensions.list - * @desc Lists custom dimensions to which the user has access. - * @alias analytics.management.customDimensions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom dimensions to retrieve. - * @param {integer=} params.max-results The maximum number of custom dimensions to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID for the custom dimensions to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customDimensions.patch - * @desc Updates an existing custom dimension. This method supports patch - * semantics. - * @alias analytics.management.customDimensions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom dimension to update. - * @param {string} params.customDimensionId Custom dimension ID for the custom dimension to update. - * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. - * @param {string} params.webPropertyId Web property ID for the custom dimension to update. - * @param {().CustomDimension} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], - pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customDimensions.update - * @desc Updates an existing custom dimension. - * @alias analytics.management.customDimensions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom dimension to update. - * @param {string} params.customDimensionId Custom dimension ID for the custom dimension to update. - * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. - * @param {string} params.webPropertyId Web property ID for the custom dimension to update. - * @param {().CustomDimension} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], - pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Custommetrics { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.customMetrics.get - * @desc Get a custom metric to which the user has access. - * @alias analytics.management.customMetrics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom metric to retrieve. - * @param {string} params.customMetricId The ID of the custom metric to retrieve. - * @param {string} params.webPropertyId Web property ID for the custom metric to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], - pathParams: ['accountId', 'customMetricId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customMetrics.insert - * @desc Create a new custom metric. - * @alias analytics.management.customMetrics.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom metric to create. - * @param {string} params.webPropertyId Web property ID for the custom dimension to create. - * @param {().CustomMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customMetrics.list - * @desc Lists custom metrics to which the user has access. - * @alias analytics.management.customMetrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom metrics to retrieve. - * @param {integer=} params.max-results The maximum number of custom metrics to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID for the custom metrics to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customMetrics.patch - * @desc Updates an existing custom metric. This method supports patch - * semantics. - * @alias analytics.management.customMetrics.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom metric to update. - * @param {string} params.customMetricId Custom metric ID for the custom metric to update. - * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. - * @param {string} params.webPropertyId Web property ID for the custom metric to update. - * @param {().CustomMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], - pathParams: ['accountId', 'customMetricId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.customMetrics.update - * @desc Updates an existing custom metric. - * @alias analytics.management.customMetrics.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the custom metric to update. - * @param {string} params.customMetricId Custom metric ID for the custom metric to update. - * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. - * @param {string} params.webPropertyId Web property ID for the custom metric to update. - * @param {().CustomMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], - pathParams: ['accountId', 'customMetricId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Experiments { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.experiments.delete - * @desc Delete an experiment. - * @alias analytics.management.experiments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the experiment belongs - * @param {string} params.experimentId ID of the experiment to delete - * @param {string} params.profileId View (Profile) ID to which the experiment belongs - * @param {string} params.webPropertyId Web property ID to which the experiment belongs - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'experimentId'], - pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.experiments.get - * @desc Returns an experiment to which the user has access. - * @alias analytics.management.experiments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve the experiment for. - * @param {string} params.experimentId Experiment ID to retrieve the experiment for. - * @param {string} params.profileId View (Profile) ID to retrieve the experiment for. - * @param {string} params.webPropertyId Web property ID to retrieve the experiment for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'experimentId'], - pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.experiments.insert - * @desc Create a new experiment. - * @alias analytics.management.experiments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the experiment for. - * @param {string} params.profileId View (Profile) ID to create the experiment for. - * @param {string} params.webPropertyId Web property ID to create the experiment for. - * @param {().Experiment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.experiments.list - * @desc Lists experiments to which the user has access. - * @alias analytics.management.experiments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve experiments for. - * @param {integer=} params.max-results The maximum number of experiments to include in this response. - * @param {string} params.profileId View (Profile) ID to retrieve experiments for. - * @param {integer=} params.start-index An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID to retrieve experiments for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.experiments.patch - * @desc Update an existing experiment. This method supports patch semantics. - * @alias analytics.management.experiments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID of the experiment to update. - * @param {string} params.experimentId Experiment ID of the experiment to update. - * @param {string} params.profileId View (Profile) ID of the experiment to update. - * @param {string} params.webPropertyId Web property ID of the experiment to update. - * @param {().Experiment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'experimentId'], - pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.experiments.update - * @desc Update an existing experiment. - * @alias analytics.management.experiments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID of the experiment to update. - * @param {string} params.experimentId Experiment ID of the experiment to update. - * @param {string} params.profileId View (Profile) ID of the experiment to update. - * @param {string} params.webPropertyId Web property ID of the experiment to update. - * @param {().Experiment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'experimentId'], - pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Filters { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.filters.delete - * @desc Delete a filter. - * @alias analytics.management.filters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the filter for. - * @param {string} params.filterId ID of the filter to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'filterId'], - pathParams: ['accountId', 'filterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.filters.get - * @desc Returns a filters to which the user has access. - * @alias analytics.management.filters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve filters for. - * @param {string} params.filterId Filter ID to retrieve filters for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'filterId'], - pathParams: ['accountId', 'filterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.filters.insert - * @desc Create a new filter. - * @alias analytics.management.filters.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create filter for. - * @param {().Filter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.filters.list - * @desc Lists all filters for an account - * @alias analytics.management.filters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve filters for. - * @param {integer=} params.max-results The maximum number of filters to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.filters.patch - * @desc Updates an existing filter. This method supports patch semantics. - * @alias analytics.management.filters.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the filter belongs. - * @param {string} params.filterId ID of the filter to be updated. - * @param {().Filter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'filterId'], - pathParams: ['accountId', 'filterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.filters.update - * @desc Updates an existing filter. - * @alias analytics.management.filters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the filter belongs. - * @param {string} params.filterId ID of the filter to be updated. - * @param {().Filter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'filterId'], - pathParams: ['accountId', 'filterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Goals { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.goals.get - * @desc Gets a goal to which the user has access. - * @alias analytics.management.goals.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve the goal for. - * @param {string} params.goalId Goal ID to retrieve the goal for. - * @param {string} params.profileId View (Profile) ID to retrieve the goal for. - * @param {string} params.webPropertyId Web property ID to retrieve the goal for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], - pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.goals.insert - * @desc Create a new goal. - * @alias analytics.management.goals.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the goal for. - * @param {string} params.profileId View (Profile) ID to create the goal for. - * @param {string} params.webPropertyId Web property ID to create the goal for. - * @param {().Goal} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.goals.list - * @desc Lists goals to which the user has access. - * @alias analytics.management.goals.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. - * @param {integer=} params.max-results The maximum number of goals to include in this response. - * @param {string} params.profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. - * @param {integer=} params.start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.goals.patch - * @desc Updates an existing goal. This method supports patch semantics. - * @alias analytics.management.goals.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to update the goal. - * @param {string} params.goalId Index of the goal to be updated. - * @param {string} params.profileId View (Profile) ID to update the goal. - * @param {string} params.webPropertyId Web property ID to update the goal. - * @param {().Goal} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], - pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.goals.update - * @desc Updates an existing goal. - * @alias analytics.management.goals.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to update the goal. - * @param {string} params.goalId Index of the goal to be updated. - * @param {string} params.profileId View (Profile) ID to update the goal. - * @param {string} params.webPropertyId Web property ID to update the goal. - * @param {().Goal} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], - pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Profilefilterlinks { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.profileFilterLinks.delete - * @desc Delete a profile filter link. - * @alias analytics.management.profileFilterLinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the profile filter link belongs. - * @param {string} params.linkId ID of the profile filter link to delete. - * @param {string} params.profileId Profile ID to which the filter link belongs. - * @param {string} params.webPropertyId Web property Id to which the profile filter link belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileFilterLinks.get - * @desc Returns a single profile filter link. - * @alias analytics.management.profileFilterLinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve profile filter link for. - * @param {string} params.linkId ID of the profile filter link. - * @param {string} params.profileId Profile ID to retrieve filter link for. - * @param {string} params.webPropertyId Web property Id to retrieve profile filter link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileFilterLinks.insert - * @desc Create a new profile filter link. - * @alias analytics.management.profileFilterLinks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create profile filter link for. - * @param {string} params.profileId Profile ID to create filter link for. - * @param {string} params.webPropertyId Web property Id to create profile filter link for. - * @param {().ProfileFilterLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileFilterLinks.list - * @desc Lists all profile filter links for a profile. - * @alias analytics.management.profileFilterLinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve profile filter links for. - * @param {integer=} params.max-results The maximum number of profile filter links to include in this response. - * @param {string} params.profileId Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileFilterLinks.patch - * @desc Update an existing profile filter link. This method supports patch - * semantics. - * @alias analytics.management.profileFilterLinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which profile filter link belongs. - * @param {string} params.linkId ID of the profile filter link to be updated. - * @param {string} params.profileId Profile ID to which filter link belongs - * @param {string} params.webPropertyId Web property Id to which profile filter link belongs - * @param {().ProfileFilterLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileFilterLinks.update - * @desc Update an existing profile filter link. - * @alias analytics.management.profileFilterLinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which profile filter link belongs. - * @param {string} params.linkId ID of the profile filter link to be updated. - * @param {string} params.profileId Profile ID to which filter link belongs - * @param {string} params.webPropertyId Web property Id to which profile filter link belongs - * @param {().ProfileFilterLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Profiles { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.profiles.delete - * @desc Deletes a view (profile). - * @alias analytics.management.profiles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the view (profile) for. - * @param {string} params.profileId ID of the view (profile) to be deleted. - * @param {string} params.webPropertyId Web property ID to delete the view (profile) for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profiles.get - * @desc Gets a view (profile) to which the user has access. - * @alias analytics.management.profiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve the view (profile) for. - * @param {string} params.profileId View (Profile) ID to retrieve the view (profile) for. - * @param {string} params.webPropertyId Web property ID to retrieve the view (profile) for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profiles.insert - * @desc Create a new view (profile). - * @alias analytics.management.profiles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the view (profile) for. - * @param {string} params.webPropertyId Web property ID to create the view (profile) for. - * @param {().Profile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profiles.list - * @desc Lists views (profiles) to which the user has access. - * @alias analytics.management.profiles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. - * @param {integer=} params.max-results The maximum number of views (profiles) to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profiles.patch - * @desc Updates an existing view (profile). This method supports patch - * semantics. - * @alias analytics.management.profiles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the view (profile) belongs - * @param {string} params.profileId ID of the view (profile) to be updated. - * @param {string} params.webPropertyId Web property ID to which the view (profile) belongs - * @param {().Profile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profiles.update - * @desc Updates an existing view (profile). - * @alias analytics.management.profiles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the view (profile) belongs - * @param {string} params.profileId ID of the view (profile) to be updated. - * @param {string} params.webPropertyId Web property ID to which the view (profile) belongs - * @param {().Profile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Profileuserlinks { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.profileUserLinks.delete - * @desc Removes a user from the given view (profile). - * @alias analytics.management.profileUserLinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the user link for. - * @param {string} params.linkId Link ID to delete the user link for. - * @param {string} params.profileId View (Profile) ID to delete the user link for. - * @param {string} params.webPropertyId Web Property ID to delete the user link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileUserLinks.insert - * @desc Adds a new user to the given view (profile). - * @alias analytics.management.profileUserLinks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the user link for. - * @param {string} params.profileId View (Profile) ID to create the user link for. - * @param {string} params.webPropertyId Web Property ID to create the user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileUserLinks.list - * @desc Lists profile-user links for a given view (profile). - * @alias analytics.management.profileUserLinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID which the given view (profile) belongs to. - * @param {integer=} params.max-results The maximum number of profile-user links to include in this response. - * @param {string} params.profileId View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. - * @param {integer=} params.start-index An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.profileUserLinks.update - * @desc Updates permissions for an existing user on the given view (profile). - * @alias analytics.management.profileUserLinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to update the user link for. - * @param {string} params.linkId Link ID to update the user link for. - * @param {string} params.profileId View (Profile ID) to update the user link for. - * @param {string} params.webPropertyId Web Property ID to update the user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], - pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Remarketingaudience { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.remarketingAudience.delete - * @desc Delete a remarketing audience. - * @alias analytics.management.remarketingAudience.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the remarketing audience belongs. - * @param {string} params.remarketingAudienceId The ID of the remarketing audience to delete. - * @param {string} params.webPropertyId Web property ID to which the remarketing audience belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], - pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.remarketingAudience.get - * @desc Gets a remarketing audience to which the user has access. - * @alias analytics.management.remarketingAudience.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account ID of the remarketing audience to retrieve. - * @param {string} params.remarketingAudienceId The ID of the remarketing audience to retrieve. - * @param {string} params.webPropertyId The web property ID of the remarketing audience to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], - pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.remarketingAudience.insert - * @desc Creates a new remarketing audience. - * @alias analytics.management.remarketingAudience.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account ID for which to create the remarketing audience. - * @param {string} params.webPropertyId Web property ID for which to create the remarketing audience. - * @param {().RemarketingAudience} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.remarketingAudience.list - * @desc Lists remarketing audiences to which the user has access. - * @alias analytics.management.remarketingAudience.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account ID of the remarketing audiences to retrieve. - * @param {integer=} params.max-results The maximum number of remarketing audiences to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string=} params.type - * @param {string} params.webPropertyId The web property ID of the remarketing audiences to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.remarketingAudience.patch - * @desc Updates an existing remarketing audience. This method supports patch - * semantics. - * @alias analytics.management.remarketingAudience.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account ID of the remarketing audience to update. - * @param {string} params.remarketingAudienceId The ID of the remarketing audience to update. - * @param {string} params.webPropertyId The web property ID of the remarketing audience to update. - * @param {().RemarketingAudience} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], - pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.remarketingAudience.update - * @desc Updates an existing remarketing audience. - * @alias analytics.management.remarketingAudience.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The account ID of the remarketing audience to update. - * @param {string} params.remarketingAudienceId The ID of the remarketing audience to update. - * @param {string} params.webPropertyId The web property ID of the remarketing audience to update. - * @param {().RemarketingAudience} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], - pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Segments { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.segments.list - * @desc Lists segments to which the user has access. - * @alias analytics.management.segments.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.max-results The maximum number of segments to include in this response. - * @param {integer=} params.start-index An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/management/segments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Unsampledreports { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.unsampledReports.delete - * @desc Deletes an unsampled report. - * @alias analytics.management.unsampledReports.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the unsampled report for. - * @param {string} params.profileId View (Profile) ID to delete the unsampled report for. - * @param {string} params.unsampledReportId ID of the unsampled report to be deleted. - * @param {string} params.webPropertyId Web property ID to delete the unsampled reports for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'unsampledReportId'], - pathParams: - ['accountId', 'profileId', 'unsampledReportId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.unsampledReports.get - * @desc Returns a single unsampled report. - * @alias analytics.management.unsampledReports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve unsampled report for. - * @param {string} params.profileId View (Profile) ID to retrieve unsampled report for. - * @param {string} params.unsampledReportId ID of the unsampled report to retrieve. - * @param {string} params.webPropertyId Web property ID to retrieve unsampled reports for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'profileId', 'unsampledReportId'], - pathParams: - ['accountId', 'profileId', 'unsampledReportId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.unsampledReports.insert - * @desc Create a new unsampled report. - * @alias analytics.management.unsampledReports.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the unsampled report for. - * @param {string} params.profileId View (Profile) ID to create the unsampled report for. - * @param {string} params.webPropertyId Web property ID to create the unsampled report for. - * @param {().UnsampledReport} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.unsampledReports.list - * @desc Lists unsampled reports to which the user has access. - * @alias analytics.management.unsampledReports.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported. - * @param {integer=} params.max-results The maximum number of unsampled reports to include in this response. - * @param {string} params.profileId View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported. - * @param {integer=} params.start-index An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'profileId'], - pathParams: ['accountId', 'profileId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Uploads { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.uploads.deleteUploadData - * @desc Delete data associated with a previous upload. - * @alias analytics.management.uploads.deleteUploadData - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account Id for the uploads to be deleted. - * @param {string} params.customDataSourceId Custom data source Id for the uploads to be deleted. - * @param {string} params.webPropertyId Web property Id for the uploads to be deleted. - * @param {().AnalyticsDataimportDeleteUploadDataRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteUploadData(params?: any, options?: MethodOptions): AxiosPromise; - deleteUploadData( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteUploadData( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], - pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.uploads.get - * @desc List uploads to which the user has access. - * @alias analytics.management.uploads.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account Id for the upload to retrieve. - * @param {string} params.customDataSourceId Custom data source Id for upload to retrieve. - * @param {string} params.uploadId Upload Id to retrieve. - * @param {string} params.webPropertyId Web property Id for the upload to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'customDataSourceId', 'uploadId'], - pathParams: - ['accountId', 'customDataSourceId', 'uploadId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.uploads.list - * @desc List uploads to which the user has access. - * @alias analytics.management.uploads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account Id for the uploads to retrieve. - * @param {string} params.customDataSourceId Custom data source Id for uploads to retrieve. - * @param {integer=} params.max-results The maximum number of uploads to include in this response. - * @param {integer=} params.start-index A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property Id for the uploads to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], - pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.uploads.uploadData - * @desc Upload data for a custom data source. - * @alias analytics.management.uploads.uploadData - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account Id associated with the upload. - * @param {string} params.customDataSourceId Custom data source Id to which the data being uploaded belongs. - * @param {string} params.webPropertyId Web property UA-string associated with the upload. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - uploadData(params?: any, options?: MethodOptions): - AxiosPromise; - uploadData( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - uploadData( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], - pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Webproperties { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.webproperties.get - * @desc Gets a web property to which the user has access. - * @alias analytics.management.webproperties.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve the web property for. - * @param {string} params.webPropertyId ID to retrieve the web property for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webproperties.insert - * @desc Create a new property if the account has fewer than 20 properties. - * Web properties are visible in the Google Analytics interface only if they - * have at least one profile. - * @alias analytics.management.webproperties.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the web property for. - * @param {().Webproperty} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webproperties.list - * @desc Lists web properties to which the user has access. - * @alias analytics.management.webproperties.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. - * @param {integer=} params.max-results The maximum number of web properties to include in this response. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webproperties.patch - * @desc Updates an existing web property. This method supports patch - * semantics. - * @alias analytics.management.webproperties.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the web property belongs - * @param {string} params.webPropertyId Web property ID - * @param {().Webproperty} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webproperties.update - * @desc Updates an existing web property. - * @alias analytics.management.webproperties.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to which the web property belongs - * @param {string} params.webPropertyId Web property ID - * @param {().Webproperty} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Webpropertyadwordslinks { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.webPropertyAdWordsLinks.delete - * @desc Deletes a web property-AdWords link. - * @alias analytics.management.webPropertyAdWordsLinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the account which the given web property belongs to. - * @param {string} params.webPropertyAdWordsLinkId Web property AdWords link ID. - * @param {string} params.webPropertyId Web property ID to delete the AdWords link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], - pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webPropertyAdWordsLinks.get - * @desc Returns a web property-AdWords link to which the user has access. - * @alias analytics.management.webPropertyAdWordsLinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the account which the given web property belongs to. - * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. - * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], - pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webPropertyAdWordsLinks.insert - * @desc Creates a webProperty-AdWords link. - * @alias analytics.management.webPropertyAdWordsLinks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the Google Analytics account to create the link for. - * @param {string} params.webPropertyId Web property ID to create the link for. - * @param {().EntityAdWordsLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webPropertyAdWordsLinks.list - * @desc Lists webProperty-AdWords links for a given web property. - * @alias analytics.management.webPropertyAdWordsLinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the account which the given web property belongs to. - * @param {integer=} params.max-results The maximum number of webProperty-AdWords links to include in this response. - * @param {integer=} params.start-index An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web property ID to retrieve the AdWords links for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webPropertyAdWordsLinks.patch - * @desc Updates an existing webProperty-AdWords link. This method supports - * patch semantics. - * @alias analytics.management.webPropertyAdWordsLinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the account which the given web property belongs to. - * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. - * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. - * @param {().EntityAdWordsLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], - pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webPropertyAdWordsLinks.update - * @desc Updates an existing webProperty-AdWords link. - * @alias analytics.management.webPropertyAdWordsLinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId ID of the account which the given web property belongs to. - * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. - * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. - * @param {().EntityAdWordsLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: - ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], - pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Management$Webpropertyuserlinks { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.management.webpropertyUserLinks.delete - * @desc Removes a user from the given web property. - * @alias analytics.management.webpropertyUserLinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to delete the user link for. - * @param {string} params.linkId Link ID to delete the user link for. - * @param {string} params.webPropertyId Web Property ID to delete the user link for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'linkId'], - pathParams: ['accountId', 'linkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webpropertyUserLinks.insert - * @desc Adds a new user to the given web property. - * @alias analytics.management.webpropertyUserLinks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to create the user link for. - * @param {string} params.webPropertyId Web Property ID to create the user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webpropertyUserLinks.list - * @desc Lists webProperty-user links for a given web property. - * @alias analytics.management.webpropertyUserLinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID which the given web property belongs to. - * @param {integer=} params.max-results The maximum number of webProperty-user Links to include in this response. - * @param {integer=} params.start-index An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. - * @param {string} params.webPropertyId Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId'], - pathParams: ['accountId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.management.webpropertyUserLinks.update - * @desc Updates permissions for an existing user on the given web property. - * @alias analytics.management.webpropertyUserLinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId Account ID to update the account-user link for. - * @param {string} params.linkId Link ID to update the account-user link for. - * @param {string} params.webPropertyId Web property ID to update the account-user link for. - * @param {().EntityUserLink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'webPropertyId', 'linkId'], - pathParams: ['accountId', 'linkId', 'webPropertyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Metadata { - root: Analytics; - columns: Resource$Metadata$Columns; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - this.columns = new Resource$Metadata$Columns(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Metadata$Columns { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace analytics_v3 { /** - * analytics.metadata.columns.list - * @desc Lists all columns for a report type - * @alias analytics.metadata.columns.list - * @memberOf! () + * Google Analytics API * - * @param {object} params Parameters for request - * @param {string} params.reportType Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/metadata/{reportType}/columns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['reportType'], - pathParams: ['reportType'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Provisioning { - root: Analytics; - constructor(root: Analytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * analytics.provisioning.createAccountTicket - * @desc Creates an account ticket. - * @alias analytics.provisioning.createAccountTicket - * @memberOf! () + * Views and manages your Google Analytics data. * - * @param {object} params Parameters for request - * @param {().AccountTicket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createAccountTicket(params?: any, options?: MethodOptions): - AxiosPromise; - createAccountTicket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createAccountTicket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/provisioning/createAccountTicket') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * analytics.provisioning.createAccountTree - * @desc Provision account. - * @alias analytics.provisioning.createAccountTree - * @memberOf! () + * @example + * const google = require('googleapis'); + * const analytics = google.analytics('v3'); * - * @param {object} params Parameters for request - * @param {().AccountTreeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createAccountTree(params?: any, options?: MethodOptions): - AxiosPromise; - createAccountTree( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createAccountTree( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/analytics/v3/provisioning/createAccountTree') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace analytics + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Analytics + */ + export class Analytics { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + data: Resource$Data; + management: Resource$Management; + metadata: Resource$Metadata; + provisioning: Resource$Provisioning; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.data = new Resource$Data(this); + this.management = new Resource$Management(this); + this.metadata = new Resource$Metadata(this); + this.provisioning = new Resource$Provisioning(this); + } + + getRoot() { + return this.root; + } + } + + /** + * JSON template for Analytics account entry. + */ + export interface Schema$Account { + /** + * Child link for an account entry. Points to the list of web properties for + * this account. + */ + childLink: any; + /** + * Time the account was created. + */ + created: string; + /** + * Account ID. + */ + id: string; + /** + * Resource type for Analytics account. + */ + kind: string; + /** + * Account name. + */ + name: string; + /** + * Permissions the user has for this account. + */ + permissions: any; + /** + * Link for this account. + */ + selfLink: string; + /** + * Indicates whether this account is starred or not. + */ + starred: boolean; + /** + * Time the account was last modified. + */ + updated: string; + } + /** + * JSON template for a linked account. + */ + export interface Schema$AccountRef { + /** + * Link for this account. + */ + href: string; + /** + * Account ID. + */ + id: string; + /** + * Analytics account reference. + */ + kind: string; + /** + * Account name. + */ + name: string; + } + /** + * An account collection provides a list of Analytics accounts to which a user + * has access. The account collection is the entry point to all management + * information. Each resource in the collection corresponds to a single + * Analytics account. + */ + export interface Schema$Accounts { + /** + * A list of accounts. + */ + items: Schema$Account[]; + /** + * The maximum number of entries the response can contain, regardless of the + * actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query + * parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Next link for this account collection. + */ + nextLink: string; + /** + * Previous link for this account collection. + */ + previousLink: string; + /** + * The starting index of the entries, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * An AccountSummary collection lists a summary of accounts, properties and + * views (profiles) to which the user has access. Each resource in the + * collection corresponds to a single AccountSummary. + */ + export interface Schema$AccountSummaries { + /** + * A list of AccountSummaries. + */ + items: Schema$AccountSummary[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this AccountSummary collection. + */ + nextLink: string; + /** + * Link to previous page for this AccountSummary collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics AccountSummary. An AccountSummary is a + * lightweight tree comprised of properties/profiles. + */ + export interface Schema$AccountSummary { + /** + * Account ID. + */ + id: string; + /** + * Resource type for Analytics AccountSummary. + */ + kind: string; + /** + * Account name. + */ + name: string; + /** + * Indicates whether this account is starred or not. + */ + starred: boolean; + /** + * List of web properties under this account. + */ + webProperties: Schema$WebPropertySummary[]; + } + /** + * JSON template for an Analytics account ticket. The account ticket consists + * of the ticket ID and the basic information for the account, property and + * profile. + */ + export interface Schema$AccountTicket { + /** + * Account for this ticket. + */ + account: Schema$Account; + /** + * Account ticket ID used to access the account ticket. + */ + id: string; + /** + * Resource type for account ticket. + */ + kind: string; + /** + * View (Profile) for the account. + */ + profile: Schema$Profile; + /** + * Redirect URI where the user will be sent after accepting Terms of + * Service. Must be configured in APIs console as a callback URL. + */ + redirectUri: string; + /** + * Web property for the account. + */ + webproperty: Schema$Webproperty; + } + /** + * JSON template for an Analytics account tree requests. The account tree + * request is used in the provisioning api to create an account, property, and + * view (profile). It contains the basic information required to make these + * fields. + */ + export interface Schema$AccountTreeRequest { + accountName: string; + accountSettings: any; + /** + * Resource type for account ticket. + */ + kind: string; + profileName: string; + timezone: string; + webpropertyName: string; + websiteUrl: string; + } + /** + * JSON template for an Analytics account tree response. The account tree + * response is used in the provisioning api to return the result of creating + * an account, property, and view (profile). + */ + export interface Schema$AccountTreeResponse { + /** + * The account created. + */ + account: Schema$Account; + accountSettings: any; + /** + * Resource type for account ticket. + */ + kind: string; + /** + * View (Profile) for the account. + */ + profile: Schema$Profile; + /** + * Web property for the account. + */ + webproperty: Schema$Webproperty; + } + /** + * JSON template for an AdWords account. + */ + export interface Schema$AdWordsAccount { + /** + * True if auto-tagging is enabled on the AdWords account. Read-only after + * the insert operation. + */ + autoTaggingEnabled: boolean; + /** + * Customer ID. This field is required when creating an AdWords link. + */ + customerId: string; + /** + * Resource type for AdWords account. + */ + kind: string; + } + /** + * Request template for the delete upload data request. + */ + export interface Schema$AnalyticsDataimportDeleteUploadDataRequest { + /** + * A list of upload UIDs. + */ + customDataImportUids: string[]; + } + /** + * JSON template for a metadata column. + */ + export interface Schema$Column { + /** + * Map of attribute name and value for this column. + */ + attributes: any; + /** + * Column id. + */ + id: string; + /** + * Resource type for Analytics column. + */ + kind: string; + } + /** + * Lists columns (dimensions and metrics) for a particular report type. + */ + export interface Schema$Columns { + /** + * List of attributes names returned by columns. + */ + attributeNames: string[]; + /** + * Etag of collection. This etag can be compared with the last response etag + * to check if response has changed. + */ + etag: string; + /** + * List of columns for a report type. + */ + items: Schema$Column[]; + /** + * Collection type. + */ + kind: string; + /** + * Total number of columns returned in the response. + */ + totalResults: number; + } + /** + * JSON template for an Analytics custom data source. + */ + export interface Schema$CustomDataSource { + /** + * Account ID to which this custom data source belongs. + */ + accountId: string; + childLink: any; + /** + * Time this custom data source was created. + */ + created: string; + /** + * Description of custom data source. + */ + description: string; + /** + * Custom data source ID. + */ + id: string; + importBehavior: string; + /** + * Resource type for Analytics custom data source. + */ + kind: string; + /** + * Name of this custom data source. + */ + name: string; + /** + * Parent link for this custom data source. Points to the web property to + * which this custom data source belongs. + */ + parentLink: any; + /** + * IDs of views (profiles) linked to the custom data source. + */ + profilesLinked: string[]; + /** + * Collection of schema headers of the custom data source. + */ + schema: string[]; + /** + * Link for this Analytics custom data source. + */ + selfLink: string; + /** + * Type of the custom data source. + */ + type: string; + /** + * Time this custom data source was last modified. + */ + updated: string; + /** + * Upload type of the custom data source. + */ + uploadType: string; + /** + * Web property ID of the form UA-XXXXX-YY to which this custom data source + * belongs. + */ + webPropertyId: string; + } + /** + * Lists Analytics custom data sources to which the user has access. Each + * resource in the collection corresponds to a single Analytics custom data + * source. + */ + export interface Schema$CustomDataSources { + /** + * Collection of custom data sources. + */ + items: Schema$CustomDataSource[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this custom data source collection. + */ + nextLink: string; + /** + * Link to previous page for this custom data source collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for Analytics Custom Dimension. + */ + export interface Schema$CustomDimension { + /** + * Account ID. + */ + accountId: string; + /** + * Boolean indicating whether the custom dimension is active. + */ + active: boolean; + /** + * Time the custom dimension was created. + */ + created: string; + /** + * Custom dimension ID. + */ + id: string; + /** + * Index of the custom dimension. + */ + index: number; + /** + * Kind value for a custom dimension. Set to + * "analytics#customDimension". It is a read-only field. + */ + kind: string; + /** + * Name of the custom dimension. + */ + name: string; + /** + * Parent link for the custom dimension. Points to the property to which the + * custom dimension belongs. + */ + parentLink: any; + /** + * Scope of the custom dimension: HIT, SESSION, USER or PRODUCT. + */ + scope: string; + /** + * Link for the custom dimension + */ + selfLink: string; + /** + * Time the custom dimension was last modified. + */ + updated: string; + /** + * Property ID. + */ + webPropertyId: string; + } + /** + * A custom dimension collection lists Analytics custom dimensions to which + * the user has access. Each resource in the collection corresponds to a + * single Analytics custom dimension. + */ + export interface Schema$CustomDimensions { + /** + * Collection of custom dimensions. + */ + items: Schema$CustomDimension[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this custom dimension collection. + */ + nextLink: string; + /** + * Link to previous page for this custom dimension collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for Analytics Custom Metric. + */ + export interface Schema$CustomMetric { + /** + * Account ID. + */ + accountId: string; + /** + * Boolean indicating whether the custom metric is active. + */ + active: boolean; + /** + * Time the custom metric was created. + */ + created: string; + /** + * Custom metric ID. + */ + id: string; + /** + * Index of the custom metric. + */ + index: number; + /** + * Kind value for a custom metric. Set to + * "analytics#customMetric". It is a read-only field. + */ + kind: string; + /** + * Max value of custom metric. + */ + max_value: string; + /** + * Min value of custom metric. + */ + min_value: string; + /** + * Name of the custom metric. + */ + name: string; + /** + * Parent link for the custom metric. Points to the property to which the + * custom metric belongs. + */ + parentLink: any; + /** + * Scope of the custom metric: HIT or PRODUCT. + */ + scope: string; + /** + * Link for the custom metric + */ + selfLink: string; + /** + * Data type of custom metric. + */ + type: string; + /** + * Time the custom metric was last modified. + */ + updated: string; + /** + * Property ID. + */ + webPropertyId: string; + } + /** + * A custom metric collection lists Analytics custom metrics to which the user + * has access. Each resource in the collection corresponds to a single + * Analytics custom metric. + */ + export interface Schema$CustomMetrics { + /** + * Collection of custom metrics. + */ + items: Schema$CustomMetric[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this custom metric collection. + */ + nextLink: string; + /** + * Link to previous page for this custom metric collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for Analytics Entity AdWords Link. + */ + export interface Schema$EntityAdWordsLink { + /** + * A list of AdWords client accounts. These cannot be MCC accounts. This + * field is required when creating an AdWords link. It cannot be empty. + */ + adWordsAccounts: Schema$AdWordsAccount[]; + /** + * Web property being linked. + */ + entity: any; + /** + * Entity AdWords link ID + */ + id: string; + /** + * Resource type for entity AdWords link. + */ + kind: string; + /** + * Name of the link. This field is required when creating an AdWords link. + */ + name: string; + /** + * IDs of linked Views (Profiles) represented as strings. + */ + profileIds: string[]; + /** + * URL link for this Google Analytics - Google AdWords link. + */ + selfLink: string; + } + /** + * An entity AdWords link collection provides a list of GA-AdWords links Each + * resource in this collection corresponds to a single link. + */ + export interface Schema$EntityAdWordsLinks { + /** + * A list of entity AdWords links. + */ + items: Schema$EntityAdWordsLink[]; + /** + * The maximum number of entries the response can contain, regardless of the + * actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query + * parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Next link for this AdWords link collection. + */ + nextLink: string; + /** + * Previous link for this AdWords link collection. + */ + previousLink: string; + /** + * The starting index of the entries, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + } + /** + * JSON template for an Analytics Entity-User Link. Returns permissions that a + * user has for an entity. + */ + export interface Schema$EntityUserLink { + /** + * Entity for this link. It can be an account, a web property, or a view + * (profile). + */ + entity: any; + /** + * Entity user link ID + */ + id: string; + /** + * Resource type for entity user link. + */ + kind: string; + /** + * Permissions the user has for this entity. + */ + permissions: any; + /** + * Self link for this resource. + */ + selfLink: string; + /** + * User reference. + */ + userRef: Schema$UserRef; + } + /** + * An entity user link collection provides a list of Analytics ACL links Each + * resource in this collection corresponds to a single link. + */ + export interface Schema$EntityUserLinks { + /** + * A list of entity user links. + */ + items: Schema$EntityUserLink[]; + /** + * The maximum number of entries the response can contain, regardless of the + * actual number of entries returned. Its value ranges from 1 to 1000 with a + * value of 1000 by default, or otherwise specified by the max-results query + * parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Next link for this account collection. + */ + nextLink: string; + /** + * Previous link for this account collection. + */ + previousLink: string; + /** + * The starting index of the entries, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + } + /** + * JSON template for Analytics experiment resource. + */ + export interface Schema$Experiment { + /** + * Account ID to which this experiment belongs. This field is read-only. + */ + accountId: string; + /** + * Time the experiment was created. This field is read-only. + */ + created: string; + /** + * Notes about this experiment. + */ + description: string; + /** + * If true, the end user will be able to edit the experiment via the Google + * Analytics user interface. + */ + editableInGaUi: boolean; + /** + * The ending time of the experiment (the time the status changed from + * RUNNING to ENDED). This field is present only if the experiment has + * ended. This field is read-only. + */ + endTime: string; + /** + * Boolean specifying whether to distribute traffic evenly across all + * variations. If the value is False, content experiments follows the + * default behavior of adjusting traffic dynamically based on variation + * performance. Optional -- defaults to False. This field may not be changed + * for an experiment whose status is ENDED. + */ + equalWeighting: boolean; + /** + * Experiment ID. Required for patch and update. Disallowed for create. + */ + id: string; + /** + * Internal ID for the web property to which this experiment belongs. This + * field is read-only. + */ + internalWebPropertyId: string; + /** + * Resource type for an Analytics experiment. This field is read-only. + */ + kind: string; + /** + * An integer number in [3, 90]. Specifies the minimum length of the + * experiment. Can be changed for a running experiment. This field may not + * be changed for an experiments whose status is ENDED. + */ + minimumExperimentLengthInDays: number; + /** + * Experiment name. This field may not be changed for an experiment whose + * status is ENDED. This field is required when creating an experiment. + */ + name: string; + /** + * The metric that the experiment is optimizing. Valid values: + * "ga:goal(n)Completions", "ga:adsenseAdsClicks", + * "ga:adsenseAdsViewed", "ga:adsenseRevenue", + * "ga:bounces", "ga:pageviews", + * "ga:sessionDuration", "ga:transactions", + * "ga:transactionRevenue". This field is required if status is + * "RUNNING" and servingFramework is one of "REDIRECT" + * or "API". + */ + objectiveMetric: string; + /** + * Whether the objectiveMetric should be minimized or maximized. Possible + * values: "MAXIMUM", "MINIMUM". Optional--defaults to + * "MAXIMUM". Cannot be specified without objectiveMetric. Cannot + * be modified when status is "RUNNING" or "ENDED". + */ + optimizationType: string; + /** + * Parent link for an experiment. Points to the view (profile) to which this + * experiment belongs. + */ + parentLink: any; + /** + * View (Profile) ID to which this experiment belongs. This field is + * read-only. + */ + profileId: string; + /** + * Why the experiment ended. Possible values: "STOPPED_BY_USER", + * "WINNER_FOUND", "EXPERIMENT_EXPIRED", + * "ENDED_WITH_NO_WINNER", "GOAL_OBJECTIVE_CHANGED". + * "ENDED_WITH_NO_WINNER" means that the experiment didn't + * expire but no winner was projected to be found. If the experiment status + * is changed via the API to ENDED this field is set to STOPPED_BY_USER. + * This field is read-only. + */ + reasonExperimentEnded: string; + /** + * Boolean specifying whether variations URLS are rewritten to match those + * of the original. This field may not be changed for an experiments whose + * status is ENDED. + */ + rewriteVariationUrlsAsOriginal: boolean; + /** + * Link for this experiment. This field is read-only. + */ + selfLink: string; + /** + * The framework used to serve the experiment variations and evaluate the + * results. One of: - REDIRECT: Google Analytics redirects traffic to + * different variation pages, reports the chosen variation and evaluates the + * results. - API: Google Analytics chooses and reports the variation to + * serve and evaluates the results; the caller is responsible for serving + * the selected variation. - EXTERNAL: The variations will be served + * externally and the chosen variation reported to Google Analytics. The + * caller is responsible for serving the selected variation and evaluating + * the results. + */ + servingFramework: string; + /** + * The snippet of code to include on the control page(s). This field is + * read-only. + */ + snippet: string; + /** + * The starting time of the experiment (the time the status changed from + * READY_TO_RUN to RUNNING). This field is present only if the experiment + * has started. This field is read-only. + */ + startTime: string; + /** + * Experiment status. Possible values: "DRAFT", + * "READY_TO_RUN", "RUNNING", "ENDED". + * Experiments can be created in the "DRAFT", + * "READY_TO_RUN" or "RUNNING" state. This field is + * required when creating an experiment. + */ + status: string; + /** + * A floating-point number in (0, 1]. Specifies the fraction of the traffic + * that participates in the experiment. Can be changed for a running + * experiment. This field may not be changed for an experiments whose status + * is ENDED. + */ + trafficCoverage: number; + /** + * Time the experiment was last modified. This field is read-only. + */ + updated: string; + /** + * Array of variations. The first variation in the array is the original. + * The number of variations may not change once an experiment is in the + * RUNNING state. At least two variations are required before status can be + * set to RUNNING. + */ + variations: any[]; + /** + * Web property ID to which this experiment belongs. The web property ID is + * of the form UA-XXXXX-YY. This field is read-only. + */ + webPropertyId: string; + /** + * A floating-point number in (0, 1). Specifies the necessary confidence + * level to choose a winner. This field may not be changed for an + * experiments whose status is ENDED. + */ + winnerConfidenceLevel: number; + /** + * Boolean specifying whether a winner has been found for this experiment. + * This field is read-only. + */ + winnerFound: boolean; + } + /** + * An experiment collection lists Analytics experiments to which the user has + * access. Each view (profile) can have a set of experiments. Each resource in + * the Experiment collection corresponds to a single Analytics experiment. + */ + export interface Schema$Experiments { + /** + * A list of experiments. + */ + items: Schema$Experiment[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this experiment collection. + */ + nextLink: string; + /** + * Link to previous page for this experiment collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * resources in the result. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics account filter. + */ + export interface Schema$Filter { + /** + * Account ID to which this filter belongs. + */ + accountId: string; + /** + * Details for the filter of the type ADVANCED. + */ + advancedDetails: any; + /** + * Time this filter was created. + */ + created: string; + /** + * Details for the filter of the type EXCLUDE. + */ + excludeDetails: Schema$FilterExpression; + /** + * Filter ID. + */ + id: string; + /** + * Details for the filter of the type INCLUDE. + */ + includeDetails: Schema$FilterExpression; + /** + * Resource type for Analytics filter. + */ + kind: string; + /** + * Details for the filter of the type LOWER. + */ + lowercaseDetails: any; + /** + * Name of this filter. + */ + name: string; + /** + * Parent link for this filter. Points to the account to which this filter + * belongs. + */ + parentLink: any; + /** + * Details for the filter of the type SEARCH_AND_REPLACE. + */ + searchAndReplaceDetails: any; + /** + * Link for this filter. + */ + selfLink: string; + /** + * Type of this filter. Possible values are INCLUDE, EXCLUDE, LOWERCASE, + * UPPERCASE, SEARCH_AND_REPLACE and ADVANCED. + */ + type: string; + /** + * Time this filter was last modified. + */ + updated: string; + /** + * Details for the filter of the type UPPER. + */ + uppercaseDetails: any; + } + /** + * JSON template for an Analytics filter expression. + */ + export interface Schema$FilterExpression { + /** + * Determines if the filter is case sensitive. + */ + caseSensitive: boolean; + /** + * Filter expression value + */ + expressionValue: string; + /** + * Field to filter. Possible values: - Content and Traffic - + * PAGE_REQUEST_URI, - PAGE_HOSTNAME, - PAGE_TITLE, - REFERRAL, - + * COST_DATA_URI (Campaign target URL), - HIT_TYPE, - + * INTERNAL_SEARCH_TERM, - INTERNAL_SEARCH_TYPE, - + * SOURCE_PROPERTY_TRACKING_ID, - Campaign or AdGroup - + * CAMPAIGN_SOURCE, - CAMPAIGN_MEDIUM, - CAMPAIGN_NAME, - + * CAMPAIGN_AD_GROUP, - CAMPAIGN_TERM, - CAMPAIGN_CONTENT, - + * CAMPAIGN_CODE, - CAMPAIGN_REFERRAL_PATH, - E-Commerce - + * TRANSACTION_COUNTRY, - TRANSACTION_REGION, - TRANSACTION_CITY, - + * TRANSACTION_AFFILIATION (Store or order location), - ITEM_NAME, - + * ITEM_CODE, - ITEM_VARIATION, - TRANSACTION_ID, - + * TRANSACTION_CURRENCY_CODE, - PRODUCT_ACTION_TYPE, - Audience/Users - + * BROWSER, - BROWSER_VERSION, - BROWSER_SIZE, - PLATFORM, - + * PLATFORM_VERSION, - LANGUAGE, - SCREEN_RESOLUTION, - SCREEN_COLORS, - + * JAVA_ENABLED (Boolean Field), - FLASH_VERSION, - GEO_SPEED (Connection + * speed), - VISITOR_TYPE, - GEO_ORGANIZATION (ISP organization), - + * GEO_DOMAIN, - GEO_IP_ADDRESS, - GEO_IP_VERSION, - Location - + * GEO_COUNTRY, - GEO_REGION, - GEO_CITY, - Event - EVENT_CATEGORY, + * - EVENT_ACTION, - EVENT_LABEL, - Other - CUSTOM_FIELD_1, - + * CUSTOM_FIELD_2, - USER_DEFINED_VALUE, - Application - APP_ID, - + * APP_INSTALLER_ID, - APP_NAME, - APP_VERSION, - SCREEN, - IS_APP + * (Boolean Field), - IS_FATAL_EXCEPTION (Boolean Field), - + * EXCEPTION_DESCRIPTION, - Mobile device - IS_MOBILE (Boolean Field, + * Deprecated. Use DEVICE_CATEGORY=mobile), - IS_TABLET (Boolean Field, + * Deprecated. Use DEVICE_CATEGORY=tablet), - DEVICE_CATEGORY, - + * MOBILE_HAS_QWERTY_KEYBOARD (Boolean Field), - MOBILE_HAS_NFC_SUPPORT + * (Boolean Field), - MOBILE_HAS_CELLULAR_RADIO (Boolean Field), - + * MOBILE_HAS_WIFI_SUPPORT (Boolean Field), - MOBILE_BRAND_NAME, - + * MOBILE_MODEL_NAME, - MOBILE_MARKETING_NAME, - MOBILE_POINTING_METHOD, + * - Social - SOCIAL_NETWORK, - SOCIAL_ACTION, - SOCIAL_ACTION_TARGET, + * - Custom dimension - CUSTOM_DIMENSION (See accompanying field index), + */ + field: string; + /** + * The Index of the custom dimension. Set only if the field is a is + * CUSTOM_DIMENSION. + */ + fieldIndex: number; + /** + * Kind value for filter expression + */ + kind: string; + /** + * Match type for this filter. Possible values are BEGINS_WITH, EQUAL, + * ENDS_WITH, CONTAINS, or MATCHES. GEO_DOMAIN, GEO_IP_ADDRESS, + * PAGE_REQUEST_URI, or PAGE_HOSTNAME filters can use any match type; all + * other filters must use MATCHES. + */ + matchType: string; + } + /** + * JSON template for a profile filter link. + */ + export interface Schema$FilterRef { + /** + * Account ID to which this filter belongs. + */ + accountId: string; + /** + * Link for this filter. + */ + href: string; + /** + * Filter ID. + */ + id: string; + /** + * Kind value for filter reference. + */ + kind: string; + /** + * Name of this filter. + */ + name: string; + } + /** + * A filter collection lists filters created by users in an Analytics account. + * Each resource in the collection corresponds to a filter. + */ + export interface Schema$Filters { + /** + * A list of filters. + */ + items: Schema$Filter[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1,000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this filter collection. + */ + nextLink: string; + /** + * Link to previous page for this filter collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * Analytics data for a given view (profile). + */ + export interface Schema$GaData { + /** + * Column headers that list dimension names followed by the metric names. + * The order of dimensions and metrics is same as specified in the request. + */ + columnHeaders: any[]; + /** + * Determines if Analytics data contains samples. + */ + containsSampledData: boolean; + /** + * The last refreshed time in seconds for Analytics data. + */ + dataLastRefreshed: string; + dataTable: any; + /** + * Unique ID for this data response. + */ + id: string; + /** + * The maximum number of rows the response can contain, regardless of the + * actual number of rows returned. Its value ranges from 1 to 10,000 with a + * value of 1000 by default, or otherwise specified by the max-results query + * parameter. + */ + itemsPerPage: number; + /** + * Resource type. + */ + kind: string; + /** + * Link to next page for this Analytics data query. + */ + nextLink: string; + /** + * Link to previous page for this Analytics data query. + */ + previousLink: string; + /** + * Information for the view (profile), for which the Analytics data was + * requested. + */ + profileInfo: any; + /** + * Analytics data request query parameters. + */ + query: any; + /** + * Analytics data rows, where each row contains a list of dimension values + * followed by the metric values. The order of dimensions and metrics is + * same as specified in the request. + */ + rows: string[][]; + /** + * The number of samples used to calculate the result. + */ + sampleSize: string; + /** + * Total size of the sample space from which the samples were selected. + */ + sampleSpace: string; + /** + * Link to this page. + */ + selfLink: string; + /** + * The total number of rows for the query, regardless of the number of rows + * in the response. + */ + totalResults: number; + /** + * Total values for the requested metrics over all the results, not just the + * results returned in this response. The order of the metric totals is same + * as the metric order specified in the request. + */ + totalsForAllResults: any; + } + /** + * JSON template for Analytics goal resource. + */ + export interface Schema$Goal { + /** + * Account ID to which this goal belongs. + */ + accountId: string; + /** + * Determines whether this goal is active. + */ + active: boolean; + /** + * Time this goal was created. + */ + created: string; + /** + * Details for the goal of the type EVENT. + */ + eventDetails: any; + /** + * Goal ID. + */ + id: string; + /** + * Internal ID for the web property to which this goal belongs. + */ + internalWebPropertyId: string; + /** + * Resource type for an Analytics goal. + */ + kind: string; + /** + * Goal name. + */ + name: string; + /** + * Parent link for a goal. Points to the view (profile) to which this goal + * belongs. + */ + parentLink: any; + /** + * View (Profile) ID to which this goal belongs. + */ + profileId: string; + /** + * Link for this goal. + */ + selfLink: string; + /** + * Goal type. Possible values are URL_DESTINATION, VISIT_TIME_ON_SITE, + * VISIT_NUM_PAGES, AND EVENT. + */ + type: string; + /** + * Time this goal was last modified. + */ + updated: string; + /** + * Details for the goal of the type URL_DESTINATION. + */ + urlDestinationDetails: any; + /** + * Goal value. + */ + value: number; + /** + * Details for the goal of the type VISIT_NUM_PAGES. + */ + visitNumPagesDetails: any; + /** + * Details for the goal of the type VISIT_TIME_ON_SITE. + */ + visitTimeOnSiteDetails: any; + /** + * Web property ID to which this goal belongs. The web property ID is of the + * form UA-XXXXX-YY. + */ + webPropertyId: string; + } + /** + * A goal collection lists Analytics goals to which the user has access. Each + * view (profile) can have a set of goals. Each resource in the Goal + * collection corresponds to a single Analytics goal. + */ + export interface Schema$Goals { + /** + * A list of goals. + */ + items: Schema$Goal[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this goal collection. + */ + nextLink: string; + /** + * Link to previous page for this goal collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * resources in the result. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics Remarketing Include Conditions. + */ + export interface Schema$IncludeConditions { + /** + * The look-back window lets you specify a time frame for evaluating the + * behavior that qualifies users for your audience. For example, if your + * filters include users from Central Asia, and Transactions Greater than 2, + * and you set the look-back window to 14 days, then any user from Central + * Asia whose cumulative transactions exceed 2 during the last 14 days is + * added to the audience. + */ + daysToLookBack: number; + /** + * Boolean indicating whether this segment is a smart list. + * https://support.google.com/analytics/answer/4628577 + */ + isSmartList: boolean; + /** + * Resource type for include conditions. + */ + kind: string; + /** + * Number of days (in the range 1 to 540) a user remains in the audience. + */ + membershipDurationDays: number; + /** + * The segment condition that will cause a user to be added to an audience. + */ + segment: string; + } + /** + * JSON template for an Analytics Remarketing Audience Foreign Link. + */ + export interface Schema$LinkedForeignAccount { + /** + * Account ID to which this linked foreign account belongs. + */ + accountId: string; + /** + * Boolean indicating whether this is eligible for search. + */ + eligibleForSearch: boolean; + /** + * Entity ad account link ID. + */ + id: string; + /** + * Internal ID for the web property to which this linked foreign account + * belongs. + */ + internalWebPropertyId: string; + /** + * Resource type for linked foreign account. + */ + kind: string; + /** + * The foreign account ID. For example the an AdWords `linkedAccountId` has + * the following format XXX-XXX-XXXX. + */ + linkedAccountId: string; + /** + * Remarketing audience ID to which this linked foreign account belongs. + */ + remarketingAudienceId: string; + /** + * The status of this foreign account link. + */ + status: string; + /** + * The type of the foreign account. For example, `ADWORDS_LINKS`, + * `DBM_LINKS`, `MCC_LINKS` or `OPTIMIZE`. + */ + type: string; + /** + * Web property ID of the form UA-XXXXX-YY to which this linked foreign + * account belongs. + */ + webPropertyId: string; + } + /** + * Multi-Channel Funnels data for a given view (profile). + */ + export interface Schema$McfData { + /** + * Column headers that list dimension names followed by the metric names. + * The order of dimensions and metrics is same as specified in the request. + */ + columnHeaders: any[]; + /** + * Determines if the Analytics data contains sampled data. + */ + containsSampledData: boolean; + /** + * Unique ID for this data response. + */ + id: string; + /** + * The maximum number of rows the response can contain, regardless of the + * actual number of rows returned. Its value ranges from 1 to 10,000 with a + * value of 1000 by default, or otherwise specified by the max-results query + * parameter. + */ + itemsPerPage: number; + /** + * Resource type. + */ + kind: string; + /** + * Link to next page for this Analytics data query. + */ + nextLink: string; + /** + * Link to previous page for this Analytics data query. + */ + previousLink: string; + /** + * Information for the view (profile), for which the Analytics data was + * requested. + */ + profileInfo: any; + /** + * Analytics data request query parameters. + */ + query: any; + /** + * Analytics data rows, where each row contains a list of dimension values + * followed by the metric values. The order of dimensions and metrics is + * same as specified in the request. + */ + rows: any[][]; + /** + * The number of samples used to calculate the result. + */ + sampleSize: string; + /** + * Total size of the sample space from which the samples were selected. + */ + sampleSpace: string; + /** + * Link to this page. + */ + selfLink: string; + /** + * The total number of rows for the query, regardless of the number of rows + * in the response. + */ + totalResults: number; + /** + * Total values for the requested metrics over all the results, not just the + * results returned in this response. The order of the metric totals is same + * as the metric order specified in the request. + */ + totalsForAllResults: any; + } + /** + * JSON template for an Analytics view (profile). + */ + export interface Schema$Profile { + /** + * Account ID to which this view (profile) belongs. + */ + accountId: string; + /** + * Indicates whether bot filtering is enabled for this view (profile). + */ + botFilteringEnabled: boolean; + /** + * Child link for this view (profile). Points to the list of goals for this + * view (profile). + */ + childLink: any; + /** + * Time this view (profile) was created. + */ + created: string; + /** + * The currency type associated with this view (profile), defaults to USD. + * The supported values are: USD, JPY, EUR, GBP, AUD, KRW, BRL, CNY, DKK, + * RUB, SEK, NOK, PLN, TRY, TWD, HKD, THB, IDR, ARS, MXN, VND, PHP, INR, + * CHF, CAD, CZK, NZD, HUF, BGN, LTL, ZAR, UAH, AED, BOB, CLP, COP, EGP, + * HRK, ILS, MAD, MYR, PEN, PKR, RON, RSD, SAR, SGD, VEF, LVL + */ + currency: string; + /** + * Default page for this view (profile). + */ + defaultPage: string; + /** + * Indicates whether ecommerce tracking is enabled for this view (profile). + */ + eCommerceTracking: boolean; + /** + * Indicates whether enhanced ecommerce tracking is enabled for this view + * (profile). This property can only be enabled if ecommerce tracking is + * enabled. + */ + enhancedECommerceTracking: boolean; + /** + * The query parameters that are excluded from this view (profile). + */ + excludeQueryParameters: string; + /** + * View (Profile) ID. + */ + id: string; + /** + * Internal ID for the web property to which this view (profile) belongs. + */ + internalWebPropertyId: string; + /** + * Resource type for Analytics view (profile). + */ + kind: string; + /** + * Name of this view (profile). + */ + name: string; + /** + * Parent link for this view (profile). Points to the web property to which + * this view (profile) belongs. + */ + parentLink: any; + /** + * Permissions the user has for this view (profile). + */ + permissions: any; + /** + * Link for this view (profile). + */ + selfLink: string; + /** + * Site search category parameters for this view (profile). + */ + siteSearchCategoryParameters: string; + /** + * The site search query parameters for this view (profile). + */ + siteSearchQueryParameters: string; + /** + * Indicates whether this view (profile) is starred or not. + */ + starred: boolean; + /** + * Whether or not Analytics will strip search category parameters from the + * URLs in your reports. + */ + stripSiteSearchCategoryParameters: boolean; + /** + * Whether or not Analytics will strip search query parameters from the URLs + * in your reports. + */ + stripSiteSearchQueryParameters: boolean; + /** + * Time zone for which this view (profile) has been configured. Time zones + * are identified by strings from the TZ database. + */ + timezone: string; + /** + * View (Profile) type. Supported types: WEB or APP. + */ + type: string; + /** + * Time this view (profile) was last modified. + */ + updated: string; + /** + * Web property ID of the form UA-XXXXX-YY to which this view (profile) + * belongs. + */ + webPropertyId: string; + /** + * Website URL for this view (profile). + */ + websiteUrl: string; + } + /** + * JSON template for an Analytics profile filter link. + */ + export interface Schema$ProfileFilterLink { + /** + * Filter for this link. + */ + filterRef: Schema$FilterRef; + /** + * Profile filter link ID. + */ + id: string; + /** + * Resource type for Analytics filter. + */ + kind: string; + /** + * View (Profile) for this link. + */ + profileRef: Schema$ProfileRef; + /** + * The rank of this profile filter link relative to the other filters linked + * to the same profile. For readonly (i.e., list and get) operations, the + * rank always starts at 1. For write (i.e., create, update, or delete) + * operations, you may specify a value between 0 and 255 inclusively, [0, + * 255]. In order to insert a link at the end of the list, either don't + * specify a rank or set a rank to a number greater than the largest rank in + * the list. In order to insert a link to the beginning of the list specify + * a rank that is less than or equal to 1. The new link will move all + * existing filters with the same or lower rank down the list. After the + * link is inserted/updated/deleted all profile filter links will be + * renumbered starting at 1. + */ + rank: number; + /** + * Link for this profile filter link. + */ + selfLink: string; + } + /** + * A profile filter link collection lists profile filter links between + * profiles and filters. Each resource in the collection corresponds to a + * profile filter link. + */ + export interface Schema$ProfileFilterLinks { + /** + * A list of profile filter links. + */ + items: Schema$ProfileFilterLink[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1,000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this profile filter link collection. + */ + nextLink: string; + /** + * Link to previous page for this profile filter link collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for a linked view (profile). + */ + export interface Schema$ProfileRef { + /** + * Account ID to which this view (profile) belongs. + */ + accountId: string; + /** + * Link for this view (profile). + */ + href: string; + /** + * View (Profile) ID. + */ + id: string; + /** + * Internal ID for the web property to which this view (profile) belongs. + */ + internalWebPropertyId: string; + /** + * Analytics view (profile) reference. + */ + kind: string; + /** + * Name of this view (profile). + */ + name: string; + /** + * Web property ID of the form UA-XXXXX-YY to which this view (profile) + * belongs. + */ + webPropertyId: string; + } + /** + * A view (profile) collection lists Analytics views (profiles) to which the + * user has access. Each resource in the collection corresponds to a single + * Analytics view (profile). + */ + export interface Schema$Profiles { + /** + * A list of views (profiles). + */ + items: Schema$Profile[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this view (profile) collection. + */ + nextLink: string; + /** + * Link to previous page for this view (profile) collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics ProfileSummary. ProfileSummary returns basic + * information (i.e., summary) for a profile. + */ + export interface Schema$ProfileSummary { + /** + * View (profile) ID. + */ + id: string; + /** + * Resource type for Analytics ProfileSummary. + */ + kind: string; + /** + * View (profile) name. + */ + name: string; + /** + * Indicates whether this view (profile) is starred or not. + */ + starred: boolean; + /** + * View (Profile) type. Supported types: WEB or APP. + */ + type: string; + } + /** + * Real time data for a given view (profile). + */ + export interface Schema$RealtimeData { + /** + * Column headers that list dimension names followed by the metric names. + * The order of dimensions and metrics is same as specified in the request. + */ + columnHeaders: any[]; + /** + * Unique ID for this data response. + */ + id: string; + /** + * Resource type. + */ + kind: string; + /** + * Information for the view (profile), for which the real time data was + * requested. + */ + profileInfo: any; + /** + * Real time data request query parameters. + */ + query: any; + /** + * Real time data rows, where each row contains a list of dimension values + * followed by the metric values. The order of dimensions and metrics is + * same as specified in the request. + */ + rows: string[][]; + /** + * Link to this page. + */ + selfLink: string; + /** + * The total number of rows for the query, regardless of the number of rows + * in the response. + */ + totalResults: number; + /** + * Total values for the requested metrics over all the results, not just the + * results returned in this response. The order of the metric totals is same + * as the metric order specified in the request. + */ + totalsForAllResults: any; + } + /** + * JSON template for an Analytics remarketing audience. + */ + export interface Schema$RemarketingAudience { + /** + * Account ID to which this remarketing audience belongs. + */ + accountId: string; + /** + * The simple audience definition that will cause a user to be added to an + * audience. + */ + audienceDefinition: any; + /** + * The type of audience, either SIMPLE or STATE_BASED. + */ + audienceType: string; + /** + * Time this remarketing audience was created. + */ + created: string; + /** + * The description of this remarketing audience. + */ + description: string; + /** + * Remarketing Audience ID. + */ + id: string; + /** + * Internal ID for the web property to which this remarketing audience + * belongs. + */ + internalWebPropertyId: string; + /** + * Collection type. + */ + kind: string; + /** + * The linked ad accounts associated with this remarketing audience. A + * remarketing audience can have only one linkedAdAccount currently. + */ + linkedAdAccounts: Schema$LinkedForeignAccount[]; + /** + * The views (profiles) that this remarketing audience is linked to. + */ + linkedViews: string[]; + /** + * The name of this remarketing audience. + */ + name: string; + /** + * A state based audience definition that will cause a user to be added or + * removed from an audience. + */ + stateBasedAudienceDefinition: any; + /** + * Time this remarketing audience was last modified. + */ + updated: string; + /** + * Web property ID of the form UA-XXXXX-YY to which this remarketing + * audience belongs. + */ + webPropertyId: string; + } + /** + * A remarketing audience collection lists Analytics remarketing audiences to + * which the user has access. Each resource in the collection corresponds to a + * single Analytics remarketing audience. + */ + export interface Schema$RemarketingAudiences { + /** + * A list of remarketing audiences. + */ + items: Schema$RemarketingAudience[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this remarketing audience collection. + */ + nextLink: string; + /** + * Link to previous page for this view (profile) collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics segment. + */ + export interface Schema$Segment { + /** + * Time the segment was created. + */ + created: string; + /** + * Segment definition. + */ + definition: string; + /** + * Segment ID. + */ + id: string; + /** + * Resource type for Analytics segment. + */ + kind: string; + /** + * Segment name. + */ + name: string; + /** + * Segment ID. Can be used with the 'segment' parameter in Core + * Reporting API. + */ + segmentId: string; + /** + * Link for this segment. + */ + selfLink: string; + /** + * Type for a segment. Possible values are "BUILT_IN" or + * "CUSTOM". + */ + type: string; + /** + * Time the segment was last modified. + */ + updated: string; + } + /** + * An segment collection lists Analytics segments that the user has access to. + * Each resource in the collection corresponds to a single Analytics segment. + */ + export interface Schema$Segments { + /** + * A list of segments. + */ + items: Schema$Segment[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type for segments. + */ + kind: string; + /** + * Link to next page for this segment collection. + */ + nextLink: string; + /** + * Link to previous page for this segment collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for Analytics unsampled report resource. + */ + export interface Schema$UnsampledReport { + /** + * Account ID to which this unsampled report belongs. + */ + accountId: string; + /** + * Download details for a file stored in Google Cloud Storage. + */ + cloudStorageDownloadDetails: any; + /** + * Time this unsampled report was created. + */ + created: string; + /** + * The dimensions for the unsampled report. + */ + dimensions: string; + /** + * The type of download you need to use for the report data file. Possible + * values include `GOOGLE_DRIVE` and `GOOGLE_CLOUD_STORAGE`. If the value is + * `GOOGLE_DRIVE`, see the `driveDownloadDetails` field. If the value is + * `GOOGLE_CLOUD_STORAGE`, see the `cloudStorageDownloadDetails` field. + */ + downloadType: string; + /** + * Download details for a file stored in Google Drive. + */ + driveDownloadDetails: any; + /** + * The end date for the unsampled report. + */ + enddate: string; + /** + * The filters for the unsampled report. + */ + filters: string; + /** + * Unsampled report ID. + */ + id: string; + /** + * Resource type for an Analytics unsampled report. + */ + kind: string; + /** + * The metrics for the unsampled report. + */ + metrics: string; + /** + * View (Profile) ID to which this unsampled report belongs. + */ + profileId: string; + /** + * The segment for the unsampled report. + */ + segment: string; + /** + * Link for this unsampled report. + */ + selfLink: string; + /** + * The start date for the unsampled report. + */ + startdate: string; + /** + * Status of this unsampled report. Possible values are PENDING, COMPLETED, + * or FAILED. + */ + status: string; + /** + * Title of the unsampled report. + */ + title: string; + /** + * Time this unsampled report was last modified. + */ + updated: string; + /** + * Web property ID to which this unsampled report belongs. The web property + * ID is of the form UA-XXXXX-YY. + */ + webPropertyId: string; + } + /** + * An unsampled report collection lists Analytics unsampled reports to which + * the user has access. Each view (profile) can have a set of unsampled + * reports. Each resource in the unsampled report collection corresponds to a + * single Analytics unsampled report. + */ + export interface Schema$UnsampledReports { + /** + * A list of unsampled reports. + */ + items: Schema$UnsampledReport[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this unsampled report collection. + */ + nextLink: string; + /** + * Link to previous page for this unsampled report collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * resources in the result. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * Metadata returned for an upload operation. + */ + export interface Schema$Upload { + /** + * Account Id to which this upload belongs. + */ + accountId: string; + /** + * Custom data source Id to which this data import belongs. + */ + customDataSourceId: string; + /** + * Data import errors collection. + */ + errors: string[]; + /** + * A unique ID for this upload. + */ + id: string; + /** + * Resource type for Analytics upload. + */ + kind: string; + /** + * Upload status. Possible values: PENDING, COMPLETED, FAILED, DELETING, + * DELETED. + */ + status: string; + /** + * Time this file is uploaded. + */ + uploadTime: string; + } + /** + * Upload collection lists Analytics uploads to which the user has access. + * Each custom data source can have a set of uploads. Each resource in the + * upload collection corresponds to a single Analytics data upload. + */ + export interface Schema$Uploads { + /** + * A list of uploads. + */ + items: Schema$Upload[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this upload collection. + */ + nextLink: string; + /** + * Link to previous page for this upload collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * resources in the result. + */ + totalResults: number; + } + /** + * JSON template for a user reference. + */ + export interface Schema$UserRef { + /** + * Email ID of this user. + */ + email: string; + /** + * User ID. + */ + id: string; + kind: string; + } + /** + * A web property collection lists Analytics web properties to which the user + * has access. Each resource in the collection corresponds to a single + * Analytics web property. + */ + export interface Schema$Webproperties { + /** + * A list of web properties. + */ + items: Schema$Webproperty[]; + /** + * The maximum number of resources the response can contain, regardless of + * the actual number of resources returned. Its value ranges from 1 to 1000 + * with a value of 1000 by default, or otherwise specified by the + * max-results query parameter. + */ + itemsPerPage: number; + /** + * Collection type. + */ + kind: string; + /** + * Link to next page for this web property collection. + */ + nextLink: string; + /** + * Link to previous page for this web property collection. + */ + previousLink: string; + /** + * The starting index of the resources, which is 1 by default or otherwise + * specified by the start-index query parameter. + */ + startIndex: number; + /** + * The total number of results for the query, regardless of the number of + * results in the response. + */ + totalResults: number; + /** + * Email ID of the authenticated user + */ + username: string; + } + /** + * JSON template for an Analytics web property. + */ + export interface Schema$Webproperty { + /** + * Account ID to which this web property belongs. + */ + accountId: string; + /** + * Child link for this web property. Points to the list of views (profiles) + * for this web property. + */ + childLink: any; + /** + * Time this web property was created. + */ + created: string; + /** + * Default view (profile) ID. + */ + defaultProfileId: string; + /** + * Web property ID of the form UA-XXXXX-YY. + */ + id: string; + /** + * The industry vertical/category selected for this web property. + */ + industryVertical: string; + /** + * Internal ID for this web property. + */ + internalWebPropertyId: string; + /** + * Resource type for Analytics WebProperty. + */ + kind: string; + /** + * Level for this web property. Possible values are STANDARD or PREMIUM. + */ + level: string; + /** + * Name of this web property. + */ + name: string; + /** + * Parent link for this web property. Points to the account to which this + * web property belongs. + */ + parentLink: any; + /** + * Permissions the user has for this web property. + */ + permissions: any; + /** + * View (Profile) count for this web property. + */ + profileCount: number; + /** + * Link for this web property. + */ + selfLink: string; + /** + * Indicates whether this web property is starred or not. + */ + starred: boolean; + /** + * Time this web property was last modified. + */ + updated: string; + /** + * Website url for this web property. + */ + websiteUrl: string; + } + /** + * JSON template for a web property reference. + */ + export interface Schema$WebPropertyRef { + /** + * Account ID to which this web property belongs. + */ + accountId: string; + /** + * Link for this web property. + */ + href: string; + /** + * Web property ID of the form UA-XXXXX-YY. + */ + id: string; + /** + * Internal ID for this web property. + */ + internalWebPropertyId: string; + /** + * Analytics web property reference. + */ + kind: string; + /** + * Name of this web property. + */ + name: string; + } + /** + * JSON template for an Analytics WebPropertySummary. WebPropertySummary + * returns basic information (i.e., summary) for a web property. + */ + export interface Schema$WebPropertySummary { + /** + * Web property ID of the form UA-XXXXX-YY. + */ + id: string; + /** + * Internal ID for this web property. + */ + internalWebPropertyId: string; + /** + * Resource type for Analytics WebPropertySummary. + */ + kind: string; + /** + * Level for this web property. Possible values are STANDARD or PREMIUM. + */ + level: string; + /** + * Web property name. + */ + name: string; + /** + * List of profiles under this web property. + */ + profiles: Schema$ProfileSummary[]; + /** + * Indicates whether this web property is starred or not. + */ + starred: boolean; + /** + * Website url for this web property. + */ + websiteUrl: string; + } + + export class Resource$Data { + root: Analytics; + ga: Resource$Data$Ga; + mcf: Resource$Data$Mcf; + realtime: Resource$Data$Realtime; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + this.ga = new Resource$Data$Ga(root); + this.mcf = new Resource$Data$Mcf(root); + this.realtime = new Resource$Data$Realtime(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Data$Ga { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.data.ga.get + * @desc Returns Analytics data for a view (profile). + * @alias analytics.data.ga.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimensions A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'. + * @param {string} params.end-date End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday. + * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to Analytics data. + * @param {string} params.ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * @param {boolean=} params.include-empty-rows The response will include empty rows if this parameter is set to true, the default is true + * @param {integer=} params.max-results The maximum number of entries to include in this feed. + * @param {string} params.metrics A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified. + * @param {string=} params.output The selected format for the response. Default format is JSON. + * @param {string=} params.samplingLevel The desired sampling level. + * @param {string=} params.segment An Analytics segment to be applied to data. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. + * @param {string} params.start-date Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/data/ga') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Data$Mcf { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.data.mcf.get + * @desc Returns Analytics Multi-Channel Funnels data for a view (profile). + * @alias analytics.data.mcf.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimensions A comma-separated list of Multi-Channel Funnels dimensions. E.g., 'mcf:source,mcf:medium'. + * @param {string} params.end-date End date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to the Analytics data. + * @param {string} params.ids Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * @param {integer=} params.max-results The maximum number of entries to include in this feed. + * @param {string} params.metrics A comma-separated list of Multi-Channel Funnels metrics. E.g., 'mcf:totalConversions,mcf:totalConversionValue'. At least one metric must be specified. + * @param {string=} params.samplingLevel The desired sampling level. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for the Analytics data. + * @param {string} params.start-date Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/data/mcf') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Data$Realtime { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.data.realtime.get + * @desc Returns real time data for a view (profile). + * @alias analytics.data.realtime.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dimensions A comma-separated list of real time dimensions. E.g., 'rt:medium,rt:city'. + * @param {string=} params.filters A comma-separated list of dimension or metric filters to be applied to real time data. + * @param {string} params.ids Unique table ID for retrieving real time data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID. + * @param {integer=} params.max-results The maximum number of entries to include in this feed. + * @param {string} params.metrics A comma-separated list of real time metrics. E.g., 'rt:activeUsers'. At least one metric must be specified. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for real time data. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/data/realtime') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Management { + root: Analytics; + accounts: Resource$Management$Accounts; + accountSummaries: Resource$Management$Accountsummaries; + accountUserLinks: Resource$Management$Accountuserlinks; + customDataSources: Resource$Management$Customdatasources; + customDimensions: Resource$Management$Customdimensions; + customMetrics: Resource$Management$Custommetrics; + experiments: Resource$Management$Experiments; + filters: Resource$Management$Filters; + goals: Resource$Management$Goals; + profileFilterLinks: Resource$Management$Profilefilterlinks; + profiles: Resource$Management$Profiles; + profileUserLinks: Resource$Management$Profileuserlinks; + remarketingAudience: Resource$Management$Remarketingaudience; + segments: Resource$Management$Segments; + unsampledReports: Resource$Management$Unsampledreports; + uploads: Resource$Management$Uploads; + webproperties: Resource$Management$Webproperties; + webPropertyAdWordsLinks: Resource$Management$Webpropertyadwordslinks; + webpropertyUserLinks: Resource$Management$Webpropertyuserlinks; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + this.accounts = new Resource$Management$Accounts(root); + this.accountSummaries = new Resource$Management$Accountsummaries(root); + this.accountUserLinks = new Resource$Management$Accountuserlinks(root); + this.customDataSources = new Resource$Management$Customdatasources(root); + this.customDimensions = new Resource$Management$Customdimensions(root); + this.customMetrics = new Resource$Management$Custommetrics(root); + this.experiments = new Resource$Management$Experiments(root); + this.filters = new Resource$Management$Filters(root); + this.goals = new Resource$Management$Goals(root); + this.profileFilterLinks = + new Resource$Management$Profilefilterlinks(root); + this.profiles = new Resource$Management$Profiles(root); + this.profileUserLinks = new Resource$Management$Profileuserlinks(root); + this.remarketingAudience = + new Resource$Management$Remarketingaudience(root); + this.segments = new Resource$Management$Segments(root); + this.unsampledReports = new Resource$Management$Unsampledreports(root); + this.uploads = new Resource$Management$Uploads(root); + this.webproperties = new Resource$Management$Webproperties(root); + this.webPropertyAdWordsLinks = + new Resource$Management$Webpropertyadwordslinks(root); + this.webpropertyUserLinks = + new Resource$Management$Webpropertyuserlinks(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Management$Accounts { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.accounts.list + * @desc Lists all accounts to which the user has access. + * @alias analytics.management.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.max-results The maximum number of accounts to include in this response. + * @param {integer=} params.start-index An index of the first account to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/management/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Accountsummaries { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.accountSummaries.list + * @desc Lists account summaries (lightweight tree comprised of + * accounts/properties/profiles) to which the user has access. + * @alias analytics.management.accountSummaries.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.max-results The maximum number of account summaries to include in this response, where the largest acceptable value is 1000. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/management/accountSummaries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Accountuserlinks { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.accountUserLinks.delete + * @desc Removes a user from the given account. + * @alias analytics.management.accountUserLinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the user link for. + * @param {string} params.linkId Link ID to delete the user link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'linkId'], + pathParams: ['accountId', 'linkId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.accountUserLinks.insert + * @desc Adds a new user to the given account. + * @alias analytics.management.accountUserLinks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.accountUserLinks.list + * @desc Lists account-user links for a given account. + * @alias analytics.management.accountUserLinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve the user links for. + * @param {integer=} params.max-results The maximum number of account-user links to include in this response. + * @param {integer=} params.start-index An index of the first account-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.accountUserLinks.update + * @desc Updates permissions for an existing user on the given account. + * @alias analytics.management.accountUserLinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to update the account-user link for. + * @param {string} params.linkId Link ID to update the account-user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'linkId'], + pathParams: ['accountId', 'linkId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Customdatasources { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.customDataSources.list + * @desc List custom data sources to which the user has access. + * @alias analytics.management.customDataSources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account Id for the custom data sources to retrieve. + * @param {integer=} params.max-results The maximum number of custom data sources to include in this response. + * @param {integer=} params.start-index A 1-based index of the first custom data source to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property Id for the custom data sources to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Customdimensions { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.customDimensions.get + * @desc Get a custom dimension to which the user has access. + * @alias analytics.management.customDimensions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom dimension to retrieve. + * @param {string} params.customDimensionId The ID of the custom dimension to retrieve. + * @param {string} params.webPropertyId Web property ID for the custom dimension to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], + pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customDimensions.insert + * @desc Create a new custom dimension. + * @alias analytics.management.customDimensions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom dimension to create. + * @param {string} params.webPropertyId Web property ID for the custom dimension to create. + * @param {().CustomDimension} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customDimensions.list + * @desc Lists custom dimensions to which the user has access. + * @alias analytics.management.customDimensions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom dimensions to retrieve. + * @param {integer=} params.max-results The maximum number of custom dimensions to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID for the custom dimensions to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customDimensions.patch + * @desc Updates an existing custom dimension. This method supports patch + * semantics. + * @alias analytics.management.customDimensions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom dimension to update. + * @param {string} params.customDimensionId Custom dimension ID for the custom dimension to update. + * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. + * @param {string} params.webPropertyId Web property ID for the custom dimension to update. + * @param {().CustomDimension} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], + pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customDimensions.update + * @desc Updates an existing custom dimension. + * @alias analytics.management.customDimensions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom dimension to update. + * @param {string} params.customDimensionId Custom dimension ID for the custom dimension to update. + * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom dimension being linked to a custom data source / data set. + * @param {string} params.webPropertyId Web property ID for the custom dimension to update. + * @param {().CustomDimension} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customDimensionId'], + pathParams: ['accountId', 'customDimensionId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Custommetrics { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.customMetrics.get + * @desc Get a custom metric to which the user has access. + * @alias analytics.management.customMetrics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom metric to retrieve. + * @param {string} params.customMetricId The ID of the custom metric to retrieve. + * @param {string} params.webPropertyId Web property ID for the custom metric to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], + pathParams: ['accountId', 'customMetricId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customMetrics.insert + * @desc Create a new custom metric. + * @alias analytics.management.customMetrics.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom metric to create. + * @param {string} params.webPropertyId Web property ID for the custom dimension to create. + * @param {().CustomMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customMetrics.list + * @desc Lists custom metrics to which the user has access. + * @alias analytics.management.customMetrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom metrics to retrieve. + * @param {integer=} params.max-results The maximum number of custom metrics to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID for the custom metrics to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customMetrics.patch + * @desc Updates an existing custom metric. This method supports patch + * semantics. + * @alias analytics.management.customMetrics.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom metric to update. + * @param {string} params.customMetricId Custom metric ID for the custom metric to update. + * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. + * @param {string} params.webPropertyId Web property ID for the custom metric to update. + * @param {().CustomMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], + pathParams: ['accountId', 'customMetricId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.customMetrics.update + * @desc Updates an existing custom metric. + * @alias analytics.management.customMetrics.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the custom metric to update. + * @param {string} params.customMetricId Custom metric ID for the custom metric to update. + * @param {boolean=} params.ignoreCustomDataSourceLinks Force the update and ignore any warnings related to the custom metric being linked to a custom data source / data set. + * @param {string} params.webPropertyId Web property ID for the custom metric to update. + * @param {().CustomMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customMetricId'], + pathParams: ['accountId', 'customMetricId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Experiments { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.experiments.delete + * @desc Delete an experiment. + * @alias analytics.management.experiments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the experiment belongs + * @param {string} params.experimentId ID of the experiment to delete + * @param {string} params.profileId View (Profile) ID to which the experiment belongs + * @param {string} params.webPropertyId Web property ID to which the experiment belongs + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'experimentId'], + pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.experiments.get + * @desc Returns an experiment to which the user has access. + * @alias analytics.management.experiments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve the experiment for. + * @param {string} params.experimentId Experiment ID to retrieve the experiment for. + * @param {string} params.profileId View (Profile) ID to retrieve the experiment for. + * @param {string} params.webPropertyId Web property ID to retrieve the experiment for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'experimentId'], + pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.experiments.insert + * @desc Create a new experiment. + * @alias analytics.management.experiments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the experiment for. + * @param {string} params.profileId View (Profile) ID to create the experiment for. + * @param {string} params.webPropertyId Web property ID to create the experiment for. + * @param {().Experiment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.experiments.list + * @desc Lists experiments to which the user has access. + * @alias analytics.management.experiments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve experiments for. + * @param {integer=} params.max-results The maximum number of experiments to include in this response. + * @param {string} params.profileId View (Profile) ID to retrieve experiments for. + * @param {integer=} params.start-index An index of the first experiment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID to retrieve experiments for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.experiments.patch + * @desc Update an existing experiment. This method supports patch + * semantics. + * @alias analytics.management.experiments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID of the experiment to update. + * @param {string} params.experimentId Experiment ID of the experiment to update. + * @param {string} params.profileId View (Profile) ID of the experiment to update. + * @param {string} params.webPropertyId Web property ID of the experiment to update. + * @param {().Experiment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'experimentId'], + pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.experiments.update + * @desc Update an existing experiment. + * @alias analytics.management.experiments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID of the experiment to update. + * @param {string} params.experimentId Experiment ID of the experiment to update. + * @param {string} params.profileId View (Profile) ID of the experiment to update. + * @param {string} params.webPropertyId Web property ID of the experiment to update. + * @param {().Experiment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'experimentId'], + pathParams: ['accountId', 'experimentId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Filters { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.filters.delete + * @desc Delete a filter. + * @alias analytics.management.filters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the filter for. + * @param {string} params.filterId ID of the filter to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'filterId'], + pathParams: ['accountId', 'filterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.filters.get + * @desc Returns a filters to which the user has access. + * @alias analytics.management.filters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve filters for. + * @param {string} params.filterId Filter ID to retrieve filters for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'filterId'], + pathParams: ['accountId', 'filterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.filters.insert + * @desc Create a new filter. + * @alias analytics.management.filters.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create filter for. + * @param {().Filter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.filters.list + * @desc Lists all filters for an account + * @alias analytics.management.filters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve filters for. + * @param {integer=} params.max-results The maximum number of filters to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.filters.patch + * @desc Updates an existing filter. This method supports patch semantics. + * @alias analytics.management.filters.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the filter belongs. + * @param {string} params.filterId ID of the filter to be updated. + * @param {().Filter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'filterId'], + pathParams: ['accountId', 'filterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.filters.update + * @desc Updates an existing filter. + * @alias analytics.management.filters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the filter belongs. + * @param {string} params.filterId ID of the filter to be updated. + * @param {().Filter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/filters/{filterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'filterId'], + pathParams: ['accountId', 'filterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Goals { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.goals.get + * @desc Gets a goal to which the user has access. + * @alias analytics.management.goals.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve the goal for. + * @param {string} params.goalId Goal ID to retrieve the goal for. + * @param {string} params.profileId View (Profile) ID to retrieve the goal for. + * @param {string} params.webPropertyId Web property ID to retrieve the goal for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], + pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.goals.insert + * @desc Create a new goal. + * @alias analytics.management.goals.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the goal for. + * @param {string} params.profileId View (Profile) ID to create the goal for. + * @param {string} params.webPropertyId Web property ID to create the goal for. + * @param {().Goal} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.goals.list + * @desc Lists goals to which the user has access. + * @alias analytics.management.goals.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve goals for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * @param {integer=} params.max-results The maximum number of goals to include in this response. + * @param {string} params.profileId View (Profile) ID to retrieve goals for. Can either be a specific view (profile) ID or '~all', which refers to all the views (profiles) that user has access to. + * @param {integer=} params.start-index An index of the first goal to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID to retrieve goals for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.goals.patch + * @desc Updates an existing goal. This method supports patch semantics. + * @alias analytics.management.goals.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to update the goal. + * @param {string} params.goalId Index of the goal to be updated. + * @param {string} params.profileId View (Profile) ID to update the goal. + * @param {string} params.webPropertyId Web property ID to update the goal. + * @param {().Goal} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], + pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.goals.update + * @desc Updates an existing goal. + * @alias analytics.management.goals.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to update the goal. + * @param {string} params.goalId Index of the goal to be updated. + * @param {string} params.profileId View (Profile) ID to update the goal. + * @param {string} params.webPropertyId Web property ID to update the goal. + * @param {().Goal} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'goalId'], + pathParams: ['accountId', 'goalId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Profilefilterlinks { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.profileFilterLinks.delete + * @desc Delete a profile filter link. + * @alias analytics.management.profileFilterLinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the profile filter link belongs. + * @param {string} params.linkId ID of the profile filter link to delete. + * @param {string} params.profileId Profile ID to which the filter link belongs. + * @param {string} params.webPropertyId Web property Id to which the profile filter link belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileFilterLinks.get + * @desc Returns a single profile filter link. + * @alias analytics.management.profileFilterLinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve profile filter link for. + * @param {string} params.linkId ID of the profile filter link. + * @param {string} params.profileId Profile ID to retrieve filter link for. + * @param {string} params.webPropertyId Web property Id to retrieve profile filter link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileFilterLinks.insert + * @desc Create a new profile filter link. + * @alias analytics.management.profileFilterLinks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create profile filter link for. + * @param {string} params.profileId Profile ID to create filter link for. + * @param {string} params.webPropertyId Web property Id to create profile filter link for. + * @param {().ProfileFilterLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileFilterLinks.list + * @desc Lists all profile filter links for a profile. + * @alias analytics.management.profileFilterLinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve profile filter links for. + * @param {integer=} params.max-results The maximum number of profile filter links to include in this response. + * @param {string} params.profileId Profile ID to retrieve filter links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property Id for profile filter links for. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileFilterLinks.patch + * @desc Update an existing profile filter link. This method supports patch + * semantics. + * @alias analytics.management.profileFilterLinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which profile filter link belongs. + * @param {string} params.linkId ID of the profile filter link to be updated. + * @param {string} params.profileId Profile ID to which filter link belongs + * @param {string} params.webPropertyId Web property Id to which profile filter link belongs + * @param {().ProfileFilterLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileFilterLinks.update + * @desc Update an existing profile filter link. + * @alias analytics.management.profileFilterLinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which profile filter link belongs. + * @param {string} params.linkId ID of the profile filter link to be updated. + * @param {string} params.profileId Profile ID to which filter link belongs + * @param {string} params.webPropertyId Web property Id to which profile filter link belongs + * @param {().ProfileFilterLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Profiles { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.profiles.delete + * @desc Deletes a view (profile). + * @alias analytics.management.profiles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the view (profile) for. + * @param {string} params.profileId ID of the view (profile) to be deleted. + * @param {string} params.webPropertyId Web property ID to delete the view (profile) for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profiles.get + * @desc Gets a view (profile) to which the user has access. + * @alias analytics.management.profiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve the view (profile) for. + * @param {string} params.profileId View (Profile) ID to retrieve the view (profile) for. + * @param {string} params.webPropertyId Web property ID to retrieve the view (profile) for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profiles.insert + * @desc Create a new view (profile). + * @alias analytics.management.profiles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the view (profile) for. + * @param {string} params.webPropertyId Web property ID to create the view (profile) for. + * @param {().Profile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profiles.list + * @desc Lists views (profiles) to which the user has access. + * @alias analytics.management.profiles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID for the view (profiles) to retrieve. Can either be a specific account ID or '~all', which refers to all the accounts to which the user has access. + * @param {integer=} params.max-results The maximum number of views (profiles) to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID for the views (profiles) to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties to which the user has access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profiles.patch + * @desc Updates an existing view (profile). This method supports patch + * semantics. + * @alias analytics.management.profiles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the view (profile) belongs + * @param {string} params.profileId ID of the view (profile) to be updated. + * @param {string} params.webPropertyId Web property ID to which the view (profile) belongs + * @param {().Profile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profiles.update + * @desc Updates an existing view (profile). + * @alias analytics.management.profiles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the view (profile) belongs + * @param {string} params.profileId ID of the view (profile) to be updated. + * @param {string} params.webPropertyId Web property ID to which the view (profile) belongs + * @param {().Profile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Profileuserlinks { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.profileUserLinks.delete + * @desc Removes a user from the given view (profile). + * @alias analytics.management.profileUserLinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the user link for. + * @param {string} params.linkId Link ID to delete the user link for. + * @param {string} params.profileId View (Profile) ID to delete the user link for. + * @param {string} params.webPropertyId Web Property ID to delete the user link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileUserLinks.insert + * @desc Adds a new user to the given view (profile). + * @alias analytics.management.profileUserLinks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the user link for. + * @param {string} params.profileId View (Profile) ID to create the user link for. + * @param {string} params.webPropertyId Web Property ID to create the user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileUserLinks.list + * @desc Lists profile-user links for a given view (profile). + * @alias analytics.management.profileUserLinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID which the given view (profile) belongs to. + * @param {integer=} params.max-results The maximum number of profile-user links to include in this response. + * @param {string} params.profileId View (Profile) ID to retrieve the profile-user links for. Can either be a specific profile ID or '~all', which refers to all the profiles that user has access to. + * @param {integer=} params.start-index An index of the first profile-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web Property ID which the given view (profile) belongs to. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.profileUserLinks.update + * @desc Updates permissions for an existing user on the given view + * (profile). + * @alias analytics.management.profileUserLinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to update the user link for. + * @param {string} params.linkId Link ID to update the user link for. + * @param {string} params.profileId View (Profile ID) to update the user link for. + * @param {string} params.webPropertyId Web Property ID to update the user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId', 'linkId'], + pathParams: ['accountId', 'linkId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Remarketingaudience { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.remarketingAudience.delete + * @desc Delete a remarketing audience. + * @alias analytics.management.remarketingAudience.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the remarketing audience belongs. + * @param {string} params.remarketingAudienceId The ID of the remarketing audience to delete. + * @param {string} params.webPropertyId Web property ID to which the remarketing audience belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], + pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.remarketingAudience.get + * @desc Gets a remarketing audience to which the user has access. + * @alias analytics.management.remarketingAudience.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account ID of the remarketing audience to retrieve. + * @param {string} params.remarketingAudienceId The ID of the remarketing audience to retrieve. + * @param {string} params.webPropertyId The web property ID of the remarketing audience to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], + pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.remarketingAudience.insert + * @desc Creates a new remarketing audience. + * @alias analytics.management.remarketingAudience.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account ID for which to create the remarketing audience. + * @param {string} params.webPropertyId Web property ID for which to create the remarketing audience. + * @param {().RemarketingAudience} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.remarketingAudience.list + * @desc Lists remarketing audiences to which the user has access. + * @alias analytics.management.remarketingAudience.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account ID of the remarketing audiences to retrieve. + * @param {integer=} params.max-results The maximum number of remarketing audiences to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string=} params.type + * @param {string} params.webPropertyId The web property ID of the remarketing audiences to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.remarketingAudience.patch + * @desc Updates an existing remarketing audience. This method supports + * patch semantics. + * @alias analytics.management.remarketingAudience.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account ID of the remarketing audience to update. + * @param {string} params.remarketingAudienceId The ID of the remarketing audience to update. + * @param {string} params.webPropertyId The web property ID of the remarketing audience to update. + * @param {().RemarketingAudience} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], + pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.remarketingAudience.update + * @desc Updates an existing remarketing audience. + * @alias analytics.management.remarketingAudience.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The account ID of the remarketing audience to update. + * @param {string} params.remarketingAudienceId The ID of the remarketing audience to update. + * @param {string} params.webPropertyId The web property ID of the remarketing audience to update. + * @param {().RemarketingAudience} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'remarketingAudienceId'], + pathParams: ['accountId', 'remarketingAudienceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Segments { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.segments.list + * @desc Lists segments to which the user has access. + * @alias analytics.management.segments.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.max-results The maximum number of segments to include in this response. + * @param {integer=} params.start-index An index of the first segment to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/management/segments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Unsampledreports { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.unsampledReports.delete + * @desc Deletes an unsampled report. + * @alias analytics.management.unsampledReports.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the unsampled report for. + * @param {string} params.profileId View (Profile) ID to delete the unsampled report for. + * @param {string} params.unsampledReportId ID of the unsampled report to be deleted. + * @param {string} params.webPropertyId Web property ID to delete the unsampled reports for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'unsampledReportId'], + pathParams: + ['accountId', 'profileId', 'unsampledReportId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.unsampledReports.get + * @desc Returns a single unsampled report. + * @alias analytics.management.unsampledReports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve unsampled report for. + * @param {string} params.profileId View (Profile) ID to retrieve unsampled report for. + * @param {string} params.unsampledReportId ID of the unsampled report to retrieve. + * @param {string} params.webPropertyId Web property ID to retrieve unsampled reports for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'profileId', 'unsampledReportId'], + pathParams: + ['accountId', 'profileId', 'unsampledReportId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.unsampledReports.insert + * @desc Create a new unsampled report. + * @alias analytics.management.unsampledReports.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the unsampled report for. + * @param {string} params.profileId View (Profile) ID to create the unsampled report for. + * @param {string} params.webPropertyId Web property ID to create the unsampled report for. + * @param {().UnsampledReport} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.unsampledReports.list + * @desc Lists unsampled reports to which the user has access. + * @alias analytics.management.unsampledReports.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve unsampled reports for. Must be a specific account ID, ~all is not supported. + * @param {integer=} params.max-results The maximum number of unsampled reports to include in this response. + * @param {string} params.profileId View (Profile) ID to retrieve unsampled reports for. Must be a specific view (profile) ID, ~all is not supported. + * @param {integer=} params.start-index An index of the first unsampled report to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID to retrieve unsampled reports for. Must be a specific web property ID, ~all is not supported. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'profileId'], + pathParams: ['accountId', 'profileId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Uploads { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.uploads.deleteUploadData + * @desc Delete data associated with a previous upload. + * @alias analytics.management.uploads.deleteUploadData + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account Id for the uploads to be deleted. + * @param {string} params.customDataSourceId Custom data source Id for the uploads to be deleted. + * @param {string} params.webPropertyId Web property Id for the uploads to be deleted. + * @param {().AnalyticsDataimportDeleteUploadDataRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteUploadData(params?: any, options?: MethodOptions): AxiosPromise; + deleteUploadData( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteUploadData( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], + pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.uploads.get + * @desc List uploads to which the user has access. + * @alias analytics.management.uploads.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account Id for the upload to retrieve. + * @param {string} params.customDataSourceId Custom data source Id for upload to retrieve. + * @param {string} params.uploadId Upload Id to retrieve. + * @param {string} params.webPropertyId Web property Id for the upload to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'customDataSourceId', 'uploadId'], + pathParams: + ['accountId', 'customDataSourceId', 'uploadId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.uploads.list + * @desc List uploads to which the user has access. + * @alias analytics.management.uploads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account Id for the uploads to retrieve. + * @param {string} params.customDataSourceId Custom data source Id for uploads to retrieve. + * @param {integer=} params.max-results The maximum number of uploads to include in this response. + * @param {integer=} params.start-index A 1-based index of the first upload to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property Id for the uploads to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], + pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.uploads.uploadData + * @desc Upload data for a custom data source. + * @alias analytics.management.uploads.uploadData + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account Id associated with the upload. + * @param {string} params.customDataSourceId Custom data source Id to which the data being uploaded belongs. + * @param {string} params.webPropertyId Web property UA-string associated with the upload. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + uploadData(params?: any, options?: MethodOptions): + AxiosPromise; + uploadData( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + uploadData( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['accountId', 'webPropertyId', 'customDataSourceId'], + pathParams: ['accountId', 'customDataSourceId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Webproperties { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.webproperties.get + * @desc Gets a web property to which the user has access. + * @alias analytics.management.webproperties.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve the web property for. + * @param {string} params.webPropertyId ID to retrieve the web property for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webproperties.insert + * @desc Create a new property if the account has fewer than 20 properties. + * Web properties are visible in the Google Analytics interface only if they + * have at least one profile. + * @alias analytics.management.webproperties.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the web property for. + * @param {().Webproperty} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webproperties.list + * @desc Lists web properties to which the user has access. + * @alias analytics.management.webproperties.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to retrieve web properties for. Can either be a specific account ID or '~all', which refers to all the accounts that user has access to. + * @param {integer=} params.max-results The maximum number of web properties to include in this response. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webproperties.patch + * @desc Updates an existing web property. This method supports patch + * semantics. + * @alias analytics.management.webproperties.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the web property belongs + * @param {string} params.webPropertyId Web property ID + * @param {().Webproperty} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webproperties.update + * @desc Updates an existing web property. + * @alias analytics.management.webproperties.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to which the web property belongs + * @param {string} params.webPropertyId Web property ID + * @param {().Webproperty} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Webpropertyadwordslinks { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.webPropertyAdWordsLinks.delete + * @desc Deletes a web property-AdWords link. + * @alias analytics.management.webPropertyAdWordsLinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the account which the given web property belongs to. + * @param {string} params.webPropertyAdWordsLinkId Web property AdWords link ID. + * @param {string} params.webPropertyId Web property ID to delete the AdWords link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], + pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webPropertyAdWordsLinks.get + * @desc Returns a web property-AdWords link to which the user has access. + * @alias analytics.management.webPropertyAdWordsLinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the account which the given web property belongs to. + * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. + * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], + pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webPropertyAdWordsLinks.insert + * @desc Creates a webProperty-AdWords link. + * @alias analytics.management.webPropertyAdWordsLinks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the Google Analytics account to create the link for. + * @param {string} params.webPropertyId Web property ID to create the link for. + * @param {().EntityAdWordsLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webPropertyAdWordsLinks.list + * @desc Lists webProperty-AdWords links for a given web property. + * @alias analytics.management.webPropertyAdWordsLinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the account which the given web property belongs to. + * @param {integer=} params.max-results The maximum number of webProperty-AdWords links to include in this response. + * @param {integer=} params.start-index An index of the first webProperty-AdWords link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web property ID to retrieve the AdWords links for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webPropertyAdWordsLinks.patch + * @desc Updates an existing webProperty-AdWords link. This method supports + * patch semantics. + * @alias analytics.management.webPropertyAdWordsLinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the account which the given web property belongs to. + * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. + * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. + * @param {().EntityAdWordsLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], + pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webPropertyAdWordsLinks.update + * @desc Updates an existing webProperty-AdWords link. + * @alias analytics.management.webPropertyAdWordsLinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId ID of the account which the given web property belongs to. + * @param {string} params.webPropertyAdWordsLinkId Web property-AdWords link ID. + * @param {string} params.webPropertyId Web property ID to retrieve the AdWords link for. + * @param {().EntityAdWordsLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: + ['accountId', 'webPropertyId', 'webPropertyAdWordsLinkId'], + pathParams: ['accountId', 'webPropertyAdWordsLinkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Management$Webpropertyuserlinks { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.management.webpropertyUserLinks.delete + * @desc Removes a user from the given web property. + * @alias analytics.management.webpropertyUserLinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to delete the user link for. + * @param {string} params.linkId Link ID to delete the user link for. + * @param {string} params.webPropertyId Web Property ID to delete the user link for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'linkId'], + pathParams: ['accountId', 'linkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webpropertyUserLinks.insert + * @desc Adds a new user to the given web property. + * @alias analytics.management.webpropertyUserLinks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to create the user link for. + * @param {string} params.webPropertyId Web Property ID to create the user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webpropertyUserLinks.list + * @desc Lists webProperty-user links for a given web property. + * @alias analytics.management.webpropertyUserLinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID which the given web property belongs to. + * @param {integer=} params.max-results The maximum number of webProperty-user Links to include in this response. + * @param {integer=} params.start-index An index of the first webProperty-user link to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter. + * @param {string} params.webPropertyId Web Property ID for the webProperty-user links to retrieve. Can either be a specific web property ID or '~all', which refers to all the web properties that user has access to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId'], + pathParams: ['accountId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.management.webpropertyUserLinks.update + * @desc Updates permissions for an existing user on the given web property. + * @alias analytics.management.webpropertyUserLinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId Account ID to update the account-user link for. + * @param {string} params.linkId Link ID to update the account-user link for. + * @param {string} params.webPropertyId Web property ID to update the account-user link for. + * @param {().EntityUserLink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'webPropertyId', 'linkId'], + pathParams: ['accountId', 'linkId', 'webPropertyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Metadata { + root: Analytics; + columns: Resource$Metadata$Columns; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + this.columns = new Resource$Metadata$Columns(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Metadata$Columns { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.metadata.columns.list + * @desc Lists all columns for a report type + * @alias analytics.metadata.columns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.reportType Report type. Allowed Values: 'ga'. Where 'ga' corresponds to the Core Reporting API + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/metadata/{reportType}/columns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['reportType'], + pathParams: ['reportType'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Provisioning { + root: Analytics; + constructor(root: Analytics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * analytics.provisioning.createAccountTicket + * @desc Creates an account ticket. + * @alias analytics.provisioning.createAccountTicket + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AccountTicket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createAccountTicket(params?: any, options?: MethodOptions): + AxiosPromise; + createAccountTicket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createAccountTicket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/provisioning/createAccountTicket') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * analytics.provisioning.createAccountTree + * @desc Provision account. + * @alias analytics.provisioning.createAccountTree + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AccountTreeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createAccountTree(params?: any, options?: MethodOptions): + AxiosPromise; + createAccountTree( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + createAccountTree( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/analytics/v3/provisioning/createAccountTree') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/analyticsreporting/v4.ts b/src/apis/analyticsreporting/v4.ts index 0d3d9ff3cac..a578b883f24 100644 --- a/src/apis/analyticsreporting/v4.ts +++ b/src/apis/analyticsreporting/v4.ts @@ -27,986 +27,993 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Analytics Reporting API - * - * Accesses Analytics report data. - * - * @example - * const google = require('googleapis'); - * const analyticsreporting = google.analyticsreporting('v4'); - * - * @namespace analyticsreporting - * @type {Function} - * @version v4 - * @variation v4 - * @param {object=} options Options for Analyticsreporting - */ -export class Analyticsreporting { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace analyticsreporting_v4 { + /** + * Google Analytics Reporting API + * + * Accesses Analytics report data. + * + * @example + * const google = require('googleapis'); + * const analyticsreporting = google.analyticsreporting('v4'); + * + * @namespace analyticsreporting + * @type {Function} + * @version v4 + * @variation v4 + * @param {object=} options Options for Analyticsreporting + */ + export class Analyticsreporting { + _options: GlobalOptions; + google: GoogleApis; + root = this; - reports: Resource$Reports; + reports: Resource$Reports; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.reports = new Resource$Reports(this); - } + this.reports = new Resource$Reports(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Defines a cohort. A cohort is a group of users who share a common - * characteristic. For example, all users with the same acquisition date belong - * to the same cohort. - */ -export interface Schema$Cohort { - /** - * This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users whose - * first visit date is between start date and end date defined in the - * DateRange. The date ranges should be aligned for cohort requests. If the - * request contains `ga:cohortNthDay` it should be exactly one day long, if - * `ga:cohortNthWeek` it should be aligned to the week boundary (starting at - * Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range - * should be aligned to the month (starting at the first and ending on the - * last day of the month). For LTV requests there are no such restrictions. - * You do not need to supply a date range for the `reportsRequest.dateRanges` - * field. - */ - dateRange: Schema$DateRange; - /** - * A unique name for the cohort. If not defined name will be auto-generated - * with values cohort_[1234...]. - */ - name: string; - /** - * Type of the cohort. The only supported type as of now is - * `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated as - * `FIRST_VISIT_DATE` type cohort. - */ - type: string; -} -/** - * Defines a cohort group. For example: "cohortGroup": { - * "cohorts": [{ "name": "cohort 1", - * "type": "FIRST_VISIT_DATE", "dateRange": { - * "startDate": "2015-08-01", "endDate": - * "2015-08-01" } },{ "name": "cohort - * 2" "type": "FIRST_VISIT_DATE" - * "dateRange": { "startDate": "2015-07-01", - * "endDate": "2015-07-01" } }] } - */ -export interface Schema$CohortGroup { - /** - * The definition for the cohort. - */ - cohorts: Schema$Cohort[]; - /** - * Enable Life Time Value (LTV). LTV measures lifetime value for users - * acquired through different channels. Please see: [Cohort - * Analysis](https://support.google.com/analytics/answer/6074676) and - * [Lifetime Value](https://support.google.com/analytics/answer/6182550) If - * the value of lifetimeValue is false: - The metric values are similar to - * the values in the web interface cohort report. - The cohort definition - * date ranges must be aligned to the calendar week and month. i.e. while - * requesting `ga:cohortNthWeek` the `startDate` in the cohort definition - * should be a Sunday and the `endDate` should be the following Saturday, - * and for `ga:cohortNthMonth`, the `startDate` should be the 1st of the - * month and `endDate` should be the last day of the month. When the - * lifetimeValue is true: - The metric values will correspond to the values - * in the web interface LifeTime value report. - The Lifetime Value report - * shows you how user value (Revenue) and engagement (Appviews, Goal - * Completions, Sessions, and Session Duration) grow during the 90 days - * after a user is acquired. - The metrics are calculated as a cumulative - * average per user per the time increment. - The cohort definition date - * ranges need not be aligned to the calendar week and month boundaries. - - * The `viewId` must be an [app view - * ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) - */ - lifetimeValue: boolean; -} -/** - * Column headers. - */ -export interface Schema$ColumnHeader { - /** - * The dimension names in the response. - */ - dimensions: string[]; - /** - * Metric headers for the metrics in the response. - */ - metricHeader: Schema$MetricHeader; -} -/** - * A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The - * start and end dates are specified in - * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. - */ -export interface Schema$DateRange { - /** - * The end date for the query in the format `YYYY-MM-DD`. - */ - endDate: string; - /** - * The start date for the query in the format `YYYY-MM-DD`. - */ - startDate: string; -} -/** - * Used to return a list of metrics for a single DateRange / dimension - * combination - */ -export interface Schema$DateRangeValues { - /** - * The values of each pivot region. - */ - pivotValueRegions: Schema$PivotValueRegion[]; - /** - * Each value corresponds to each Metric in the request. - */ - values: string[]; -} -/** - * [Dimensions](https://support.google.com/analytics/answer/1033861) are - * attributes of your data. For example, the dimension `ga:city` indicates the - * city, for example, "Paris" or "New York", from which a - * session originates. - */ -export interface Schema$Dimension { - /** - * If non-empty, we place dimension values into buckets after string to int64. - * Dimension values that are not the string representation of an integral - * value will be converted to zero. The bucket values have to be in - * increasing order. Each bucket is closed on the lower end, and open on the - * upper end. The "first" bucket includes all values less than the - * first boundary, the "last" bucket includes all values up to - * infinity. Dimension values that fall in a bucket get transformed to a new - * dimension value. For example, if one gives a list of "0, 1, 3, 4, - * 7", then we return the following buckets: - bucket #1: values < 0, - * dimension value "<0" - bucket #2: values in [0,1), dimension - * value "0" - bucket #3: values in [1,3), dimension value - * "1-2" - bucket #4: values in [3,4), dimension value "3" - * - bucket #5: values in [4,7), dimension value "4-6" - bucket #6: - * values >= 7, dimension value "7+" NOTE: If you are applying - * histogram mutation on any dimension, and using that dimension in sort, you - * will want to use the sort type `HISTOGRAM_BUCKET` for that purpose. Without - * that the dimension values will be sorted according to dictionary - * (lexicographic) order. For example the ascending dictionary order is: - * "<50", "1001+", "121-1000", - * "50-120" And the ascending `HISTOGRAM_BUCKET` order is: - * "<50", "50-120", "121-1000", - * "1001+" The client has to explicitly request - * `"orderType": "HISTOGRAM_BUCKET"` for a - * histogram-mutated dimension. - */ - histogramBuckets: string[]; - /** - * Name of the dimension to fetch, for example `ga:browser`. - */ - name: string; -} -/** - * Dimension filter specifies the filtering options on a dimension. - */ -export interface Schema$DimensionFilter { - /** - * Should the match be case sensitive? Default is false. - */ - caseSensitive: boolean; - /** - * The dimension to filter on. A DimensionFilter must contain a dimension. - */ - dimensionName: string; - /** - * Strings or regular expression to match against. Only the first value of the - * list is used for comparison unless the operator is `IN_LIST`. If `IN_LIST` - * operator, then the entire list is used to filter the dimensions as - * explained in the description of the `IN_LIST` operator. - */ - expressions: string[]; - /** - * Logical `NOT` operator. If this boolean is set to true, then the matching - * dimension values will be excluded in the report. The default is false. - */ - not: boolean; - /** - * How to match the dimension to the expression. The default is REGEXP. - */ - operator: string; -} -/** - * A group of dimension filters. Set the operator value to specify how the - * filters are logically combined. - */ -export interface Schema$DimensionFilterClause { - /** - * The repeated set of filters. They are logically combined based on the - * operator specified. - */ - filters: Schema$DimensionFilter[]; - /** - * The operator for combining multiple dimension filters. If unspecified, it - * is treated as an `OR`. - */ - operator: string; -} -/** - * Dynamic segment definition for defining the segment within the request. A - * segment can select users, sessions or both. - */ -export interface Schema$DynamicSegment { - /** - * The name of the dynamic segment. - */ - name: string; - /** - * Session Segment to select sessions to include in the segment. - */ - sessionSegment: Schema$SegmentDefinition; - /** - * User Segment to select users to include in the segment. - */ - userSegment: Schema$SegmentDefinition; -} -/** - * The batch request containing multiple report request. - */ -export interface Schema$GetReportsRequest { - /** - * Requests, each request will have a separate response. There can be a - * maximum of 5 requests. All requests should have the same `dateRanges`, - * `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. - */ - reportRequests: Schema$ReportRequest[]; - /** - * Enables [resource based - * quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4), - * (defaults to `False`). If this field is set to `True` the per view - * (profile) quotas are governed by the computational cost of the request. - * Note that using cost based quotas will higher enable sampling rates. (10 - * Million for `SMALL`, 100M for `LARGE`. See the [limits and quotas - * documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) - * for details. - */ - useResourceQuotas: boolean; -} -/** - * The main response class which holds the reports from the Reporting API - * `batchGet` call. - */ -export interface Schema$GetReportsResponse { - /** - * The amount of resource quota tokens deducted to execute the query. Includes - * all responses. - */ - queryCost: number; - /** - * Responses corresponding to each of the request. - */ - reports: Schema$Report[]; - /** - * The amount of resource quota remaining for the property. - */ - resourceQuotasRemaining: Schema$ResourceQuotasRemaining; -} -/** - * [Metrics](https://support.google.com/analytics/answer/1033861) are the - * quantitative measurements. For example, the metric `ga:users` indicates the - * total number of users for the requested time period. - */ -export interface Schema$Metric { - /** - * An alias for the metric expression is an alternate name for the expression. - * The alias can be used for filtering and sorting. This field is optional and - * is useful if the expression is not a single metric but a complex expression - * which cannot be used in filtering and sorting. The alias is also used in - * the response column header. - */ - alias: string; - /** - * A metric expression in the request. An expression is constructed from one - * or more metrics and numbers. Accepted operators include: Plus (+), Minus - * (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, - * Positive cardinal numbers (0-9), can include decimals and is limited to - * 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the - * metric expression is just a single metric name like `ga:users`. Adding - * mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics will result in - * unexpected results. - */ - expression: string; - /** - * Specifies how the metric expression should be formatted, for example - * `INTEGER`. - */ - formattingType: string; -} -/** - * MetricFilter specifies the filter on a metric. - */ -export interface Schema$MetricFilter { - /** - * The value to compare against. - */ - comparisonValue: string; - /** - * The metric that will be filtered on. A metricFilter must contain a metric - * name. A metric name can be an alias earlier defined as a metric or it can - * also be a metric expression. - */ - metricName: string; - /** - * Logical `NOT` operator. If this boolean is set to true, then the matching - * metric values will be excluded in the report. The default is false. - */ - not: boolean; - /** - * Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the comparisonValue, - * the default is `EQUAL`. If the operator is `IS_MISSING`, checks if the - * metric is missing and would ignore the comparisonValue. - */ - operator: string; -} -/** - * Represents a group of metric filters. Set the operator value to specify how - * the filters are logically combined. - */ -export interface Schema$MetricFilterClause { - /** - * The repeated set of filters. They are logically combined based on the - * operator specified. - */ - filters: Schema$MetricFilter[]; - /** - * The operator for combining multiple metric filters. If unspecified, it is - * treated as an `OR`. - */ - operator: string; -} -/** - * The headers for the metrics. - */ -export interface Schema$MetricHeader { - /** - * Headers for the metrics in the response. - */ - metricHeaderEntries: Schema$MetricHeaderEntry[]; - /** - * Headers for the pivots in the response. - */ - pivotHeaders: Schema$PivotHeader[]; -} -/** - * Header for the metrics. - */ -export interface Schema$MetricHeaderEntry { - /** - * The name of the header. - */ - name: string; - /** - * The type of the metric, for example `INTEGER`. - */ - type: string; -} -/** - * Specifies the sorting options. - */ -export interface Schema$OrderBy { - /** - * The field which to sort by. The default sort order is ascending. Example: - * `ga:browser`. Note, that you can only specify one field for sort here. For - * example, `ga:browser, ga:city` is not valid. - */ - fieldName: string; - /** - * The order type. The default orderType is `VALUE`. - */ - orderType: string; - /** - * The sorting order for the field. - */ - sortOrder: string; -} -/** - * A list of segment filters in the `OR` group are combined with the logical OR - * operator. - */ -export interface Schema$OrFiltersForSegment { - /** - * List of segment filters to be combined with a `OR` operator. - */ - segmentFilterClauses: Schema$SegmentFilterClause[]; -} -/** - * The Pivot describes the pivot section in the request. The Pivot helps - * rearrange the information in the table for certain reports by pivoting your - * data on a second dimension. - */ -export interface Schema$Pivot { - /** - * DimensionFilterClauses are logically combined with an `AND` operator: only - * data that is included by all these DimensionFilterClauses contributes to - * the values in this pivot region. Dimension filters can be used to restrict - * the columns shown in the pivot region. For example if you have `ga:browser` - * as the requested dimension in the pivot region, and you specify key filters - * to restrict `ga:browser` to only "IE" or "Firefox", - * then only those two browsers would show up as columns. - */ - dimensionFilterClauses: Schema$DimensionFilterClause[]; - /** - * A list of dimensions to show as pivot columns. A Pivot can have a maximum - * of 4 dimensions. Pivot dimensions are part of the restriction on the total - * number of dimensions allowed in the request. - */ - dimensions: Schema$Dimension[]; - /** - * Specifies the maximum number of groups to return. The default value is 10, - * also the maximum value is 1,000. - */ - maxGroupCount: number; - /** - * The pivot metrics. Pivot metrics are part of the restriction on total - * number of metrics allowed in the request. - */ - metrics: Schema$Metric[]; - /** - * If k metrics were requested, then the response will contain some - * data-dependent multiple of k columns in the report. E.g., if you pivoted - * on the dimension `ga:browser` then you'd get k columns for - * "Firefox", k columns for "IE", k columns for - * "Chrome", etc. The ordering of the groups of columns is - * determined by descending order of "total" for the first of the k - * values. Ties are broken by lexicographic ordering of the first pivot - * dimension, then lexicographic ordering of the second pivot dimension, and - * so on. E.g., if the totals for the first value for Firefox, IE, and Chrome - * were 8, 2, 8, respectively, the order of columns would be Chrome, Firefox, - * IE. The following let you choose which of the groups of k columns are - * included in the response. - */ - startGroup: number; -} -/** - * The headers for each of the pivot sections defined in the request. - */ -export interface Schema$PivotHeader { - /** - * A single pivot section header. - */ - pivotHeaderEntries: Schema$PivotHeaderEntry[]; - /** - * The total number of groups for this pivot. - */ - totalPivotGroupsCount: number; -} -/** - * The headers for the each of the metric column corresponding to the metrics - * requested in the pivots section of the response. - */ -export interface Schema$PivotHeaderEntry { - /** - * The name of the dimensions in the pivot response. - */ - dimensionNames: string[]; /** - * The values for the dimensions in the pivot. - */ - dimensionValues: string[]; - /** - * The metric header for the metric in the pivot. - */ - metric: Schema$MetricHeaderEntry; -} -/** - * The metric values in the pivot region. - */ -export interface Schema$PivotValueRegion { - /** - * The values of the metrics in each of the pivot regions. - */ - values: string[]; -} -/** - * The data response corresponding to the request. - */ -export interface Schema$Report { - /** - * The column headers. - */ - columnHeader: Schema$ColumnHeader; - /** - * Response data. - */ - data: Schema$ReportData; - /** - * Page token to retrieve the next page of results in the list. - */ - nextPageToken: string; -} -/** - * The data part of the report. - */ -export interface Schema$ReportData { - /** - * The last time the data in the report was refreshed. All the hits received - * before this timestamp are included in the calculation of the report. - */ - dataLastRefreshed: string; - /** - * Indicates if response to this request is golden or not. Data is golden when - * the exact same request will not produce any new results if asked at a later - * point in time. - */ - isDataGolden: boolean; - /** - * Minimum and maximum values seen over all matching rows. These are both - * empty when `hideValueRanges` in the request is false, or when rowCount is - * zero. - */ - maximums: Schema$DateRangeValues[]; - /** - * Minimum and maximum values seen over all matching rows. These are both - * empty when `hideValueRanges` in the request is false, or when rowCount is - * zero. - */ - minimums: Schema$DateRangeValues[]; - /** - * Total number of matching rows for this query. - */ - rowCount: number; - /** - * There's one ReportRow for every unique combination of dimensions. - */ - rows: Schema$ReportRow[]; - /** - * If the results are - * [sampled](https://support.google.com/analytics/answer/2637192), this - * returns the total number of samples read, one entry per date range. If the - * results are not sampled this field will not be defined. See [developer - * guide](/analytics/devguides/reporting/core/v4/basics#sampling) for details. - */ - samplesReadCounts: string[]; + * Defines a cohort. A cohort is a group of users who share a common + * characteristic. For example, all users with the same acquisition date + * belong to the same cohort. + */ + export interface Schema$Cohort { + /** + * This is used for `FIRST_VISIT_DATE` cohort, the cohort selects users + * whose first visit date is between start date and end date defined in the + * DateRange. The date ranges should be aligned for cohort requests. If the + * request contains `ga:cohortNthDay` it should be exactly one day long, if + * `ga:cohortNthWeek` it should be aligned to the week boundary (starting at + * Sunday and ending Saturday), and for `ga:cohortNthMonth` the date range + * should be aligned to the month (starting at the first and ending on the + * last day of the month). For LTV requests there are no such restrictions. + * You do not need to supply a date range for the + * `reportsRequest.dateRanges` field. + */ + dateRange: Schema$DateRange; + /** + * A unique name for the cohort. If not defined name will be auto-generated + * with values cohort_[1234...]. + */ + name: string; + /** + * Type of the cohort. The only supported type as of now is + * `FIRST_VISIT_DATE`. If this field is unspecified the cohort is treated as + * `FIRST_VISIT_DATE` type cohort. + */ + type: string; + } /** - * If the results are - * [sampled](https://support.google.com/analytics/answer/2637192), this - * returns the total number of samples present, one entry per date range. If - * the results are not sampled this field will not be defined. See [developer - * guide](/analytics/devguides/reporting/core/v4/basics#sampling) for details. - */ - samplingSpaceSizes: string[]; + * Defines a cohort group. For example: "cohortGroup": { + * "cohorts": [{ "name": "cohort 1", + * "type": "FIRST_VISIT_DATE", "dateRange": { + * "startDate": "2015-08-01", "endDate": + * "2015-08-01" } },{ "name": "cohort + * 2" "type": "FIRST_VISIT_DATE" + * "dateRange": { "startDate": "2015-07-01", + * "endDate": "2015-07-01" } }] } + */ + export interface Schema$CohortGroup { + /** + * The definition for the cohort. + */ + cohorts: Schema$Cohort[]; + /** + * Enable Life Time Value (LTV). LTV measures lifetime value for users + * acquired through different channels. Please see: [Cohort + * Analysis](https://support.google.com/analytics/answer/6074676) and + * [Lifetime Value](https://support.google.com/analytics/answer/6182550) If + * the value of lifetimeValue is false: - The metric values are similar to + * the values in the web interface cohort report. - The cohort definition + * date ranges must be aligned to the calendar week and month. i.e. while + * requesting `ga:cohortNthWeek` the `startDate` in the cohort definition + * should be a Sunday and the `endDate` should be the following Saturday, + * and for `ga:cohortNthMonth`, the `startDate` should be the 1st of the + * month and `endDate` should be the last day of the month. When the + * lifetimeValue is true: - The metric values will correspond to the values + * in the web interface LifeTime value report. - The Lifetime Value report + * shows you how user value (Revenue) and engagement (Appviews, Goal + * Completions, Sessions, and Session Duration) grow during the 90 days + * after a user is acquired. - The metrics are calculated as a cumulative + * average per user per the time increment. - The cohort definition date + * ranges need not be aligned to the calendar week and month boundaries. - + * The `viewId` must be an [app view + * ID](https://support.google.com/analytics/answer/2649553#WebVersusAppViews) + */ + lifetimeValue: boolean; + } /** - * For each requested date range, for the set of all rows that match the - * query, every requested value format gets a total. The total for a value - * format is computed by first totaling the metrics mentioned in the value - * format and then evaluating the value format as a scalar expression. E.g., - * The "totals" for `3 / (ga:sessions + 2)` we compute `3 / ((sum of - * all relevant ga:sessions) + 2)`. Totals are computed before pagination. - */ - totals: Schema$DateRangeValues[]; -} -/** - * The main request class which specifies the Reporting API request. - */ -export interface Schema$ReportRequest { + * Column headers. + */ + export interface Schema$ColumnHeader { + /** + * The dimension names in the response. + */ + dimensions: string[]; + /** + * Metric headers for the metrics in the response. + */ + metricHeader: Schema$MetricHeader; + } /** - * Cohort group associated with this request. If there is a cohort group in - * the request the `ga:cohort` dimension must be present. Every - * [ReportRequest](#ReportRequest) within a `batchGet` method must contain the - * same `cohortGroup` definition. - */ - cohortGroup: Schema$CohortGroup; + * A contiguous set of days: startDate, startDate + 1 day, ..., endDate. The + * start and end dates are specified in + * [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) date format `YYYY-MM-DD`. + */ + export interface Schema$DateRange { + /** + * The end date for the query in the format `YYYY-MM-DD`. + */ + endDate: string; + /** + * The start date for the query in the format `YYYY-MM-DD`. + */ + startDate: string; + } /** - * Date ranges in the request. The request can have a maximum of 2 date - * ranges. The response will contain a set of metric values for each - * combination of the dimensions for each date range in the request. So, if - * there are two date ranges, there will be two set of metric values, one for - * the original date range and one for the second date range. The - * `reportRequest.dateRanges` field should not be specified for cohorts or - * Lifetime value requests. If a date range is not provided, the default date - * range is (startDate: current date - 7 days, endDate: current date - 1 day). - * Every [ReportRequest](#ReportRequest) within a `batchGet` method must - * contain the same `dateRanges` definition. - */ - dateRanges: Schema$DateRange[]; + * Used to return a list of metrics for a single DateRange / dimension + * combination + */ + export interface Schema$DateRangeValues { + /** + * The values of each pivot region. + */ + pivotValueRegions: Schema$PivotValueRegion[]; + /** + * Each value corresponds to each Metric in the request. + */ + values: string[]; + } /** - * The dimension filter clauses for filtering Dimension Values. They are - * logically combined with the `AND` operator. Note that filtering occurs - * before any dimensions are aggregated, so that the returned metrics - * represent the total for only the relevant dimensions. - */ - dimensionFilterClauses: Schema$DimensionFilterClause[]; + * [Dimensions](https://support.google.com/analytics/answer/1033861) are + * attributes of your data. For example, the dimension `ga:city` indicates the + * city, for example, "Paris" or "New York", from which a + * session originates. + */ + export interface Schema$Dimension { + /** + * If non-empty, we place dimension values into buckets after string to + * int64. Dimension values that are not the string representation of an + * integral value will be converted to zero. The bucket values have to be + * in increasing order. Each bucket is closed on the lower end, and open on + * the upper end. The "first" bucket includes all values less than + * the first boundary, the "last" bucket includes all values up to + * infinity. Dimension values that fall in a bucket get transformed to a new + * dimension value. For example, if one gives a list of "0, 1, 3, 4, + * 7", then we return the following buckets: - bucket #1: values < + * 0, dimension value "<0" - bucket #2: values in [0,1), + * dimension value "0" - bucket #3: values in [1,3), dimension + * value "1-2" - bucket #4: values in [3,4), dimension value + * "3" - bucket #5: values in [4,7), dimension value + * "4-6" - bucket #6: values >= 7, dimension value + * "7+" NOTE: If you are applying histogram mutation on any + * dimension, and using that dimension in sort, you will want to use the + * sort type `HISTOGRAM_BUCKET` for that purpose. Without that the dimension + * values will be sorted according to dictionary (lexicographic) order. For + * example the ascending dictionary order is: "<50", + * "1001+", "121-1000", "50-120" And the + * ascending `HISTOGRAM_BUCKET` order is: "<50", + * "50-120", "121-1000", "1001+" The client + * has to explicitly request `"orderType": + * "HISTOGRAM_BUCKET"` for a histogram-mutated dimension. + */ + histogramBuckets: string[]; + /** + * Name of the dimension to fetch, for example `ga:browser`. + */ + name: string; + } /** - * The dimensions requested. Requests can have a total of 7 dimensions. - */ - dimensions: Schema$Dimension[]; + * Dimension filter specifies the filtering options on a dimension. + */ + export interface Schema$DimensionFilter { + /** + * Should the match be case sensitive? Default is false. + */ + caseSensitive: boolean; + /** + * The dimension to filter on. A DimensionFilter must contain a dimension. + */ + dimensionName: string; + /** + * Strings or regular expression to match against. Only the first value of + * the list is used for comparison unless the operator is `IN_LIST`. If + * `IN_LIST` operator, then the entire list is used to filter the dimensions + * as explained in the description of the `IN_LIST` operator. + */ + expressions: string[]; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * dimension values will be excluded in the report. The default is false. + */ + not: boolean; + /** + * How to match the dimension to the expression. The default is REGEXP. + */ + operator: string; + } /** - * Dimension or metric filters that restrict the data returned for your - * request. To use the `filtersExpression`, supply a dimension or metric on - * which to filter, followed by the filter expression. For example, the - * following expression selects `ga:browser` dimension which starts with - * Firefox; `ga:browser=~^Firefox`. For more information on dimensions and - * metric filters, see [Filters - * reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). - */ - filtersExpression: string; + * A group of dimension filters. Set the operator value to specify how the + * filters are logically combined. + */ + export interface Schema$DimensionFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters: Schema$DimensionFilter[]; + /** + * The operator for combining multiple dimension filters. If unspecified, it + * is treated as an `OR`. + */ + operator: string; + } /** - * If set to true, hides the total of all metrics for all the matching rows, - * for every date range. The default false and will return the totals. - */ - hideTotals: boolean; + * Dynamic segment definition for defining the segment within the request. A + * segment can select users, sessions or both. + */ + export interface Schema$DynamicSegment { + /** + * The name of the dynamic segment. + */ + name: string; + /** + * Session Segment to select sessions to include in the segment. + */ + sessionSegment: Schema$SegmentDefinition; + /** + * User Segment to select users to include in the segment. + */ + userSegment: Schema$SegmentDefinition; + } /** - * If set to true, hides the minimum and maximum across all matching rows. The - * default is false and the value ranges are returned. - */ - hideValueRanges: boolean; + * The batch request containing multiple report request. + */ + export interface Schema$GetReportsRequest { + /** + * Requests, each request will have a separate response. There can be a + * maximum of 5 requests. All requests should have the same `dateRanges`, + * `viewId`, `segments`, `samplingLevel`, and `cohortGroup`. + */ + reportRequests: Schema$ReportRequest[]; + /** + * Enables [resource based + * quotas](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4), + * (defaults to `False`). If this field is set to `True` the per view + * (profile) quotas are governed by the computational cost of the request. + * Note that using cost based quotas will higher enable sampling rates. (10 + * Million for `SMALL`, 100M for `LARGE`. See the [limits and quotas + * documentation](/analytics/devguides/reporting/core/v4/limits-quotas#analytics_reporting_api_v4) + * for details. + */ + useResourceQuotas: boolean; + } /** - * If set to false, the response does not include rows if all the retrieved - * metrics are equal to zero. The default is false which will exclude these - * rows. - */ - includeEmptyRows: boolean; + * The main response class which holds the reports from the Reporting API + * `batchGet` call. + */ + export interface Schema$GetReportsResponse { + /** + * The amount of resource quota tokens deducted to execute the query. + * Includes all responses. + */ + queryCost: number; + /** + * Responses corresponding to each of the request. + */ + reports: Schema$Report[]; + /** + * The amount of resource quota remaining for the property. + */ + resourceQuotasRemaining: Schema$ResourceQuotasRemaining; + } /** - * The metric filter clauses. They are logically combined with the `AND` - * operator. Metric filters look at only the first date range and not the - * comparing date range. Note that filtering on metrics occurs after the - * metrics are aggregated. - */ - metricFilterClauses: Schema$MetricFilterClause[]; + * [Metrics](https://support.google.com/analytics/answer/1033861) are the + * quantitative measurements. For example, the metric `ga:users` indicates the + * total number of users for the requested time period. + */ + export interface Schema$Metric { + /** + * An alias for the metric expression is an alternate name for the + * expression. The alias can be used for filtering and sorting. This field + * is optional and is useful if the expression is not a single metric but a + * complex expression which cannot be used in filtering and sorting. The + * alias is also used in the response column header. + */ + alias: string; + /** + * A metric expression in the request. An expression is constructed from one + * or more metrics and numbers. Accepted operators include: Plus (+), Minus + * (-), Negation (Unary -), Divided by (/), Multiplied by (*), Parenthesis, + * Positive cardinal numbers (0-9), can include decimals and is limited to + * 1024 characters. Example `ga:totalRefunds/ga:users`, in most cases the + * metric expression is just a single metric name like `ga:users`. Adding + * mixed `MetricType` (E.g., `CURRENCY` + `PERCENTAGE`) metrics will result + * in unexpected results. + */ + expression: string; + /** + * Specifies how the metric expression should be formatted, for example + * `INTEGER`. + */ + formattingType: string; + } /** - * The metrics requested. Requests must specify at least one metric. Requests - * can have a total of 10 metrics. - */ - metrics: Schema$Metric[]; + * MetricFilter specifies the filter on a metric. + */ + export interface Schema$MetricFilter { + /** + * The value to compare against. + */ + comparisonValue: string; + /** + * The metric that will be filtered on. A metricFilter must contain a metric + * name. A metric name can be an alias earlier defined as a metric or it can + * also be a metric expression. + */ + metricName: string; + /** + * Logical `NOT` operator. If this boolean is set to true, then the matching + * metric values will be excluded in the report. The default is false. + */ + not: boolean; + /** + * Is the metric `EQUAL`, `LESS_THAN` or `GREATER_THAN` the comparisonValue, + * the default is `EQUAL`. If the operator is `IS_MISSING`, checks if the + * metric is missing and would ignore the comparisonValue. + */ + operator: string; + } /** - * Sort order on output rows. To compare two rows, the elements of the - * following are applied in order until a difference is found. All date - * ranges in the output get the same row order. - */ - orderBys: Schema$OrderBy[]; + * Represents a group of metric filters. Set the operator value to specify how + * the filters are logically combined. + */ + export interface Schema$MetricFilterClause { + /** + * The repeated set of filters. They are logically combined based on the + * operator specified. + */ + filters: Schema$MetricFilter[]; + /** + * The operator for combining multiple metric filters. If unspecified, it is + * treated as an `OR`. + */ + operator: string; + } /** - * Page size is for paging and specifies the maximum number of returned rows. - * Page size should be >= 0. A query returns the default of 1,000 rows. The - * Analytics Core Reporting API returns a maximum of 10,000 rows per request, - * no matter how many you ask for. It can also return fewer rows than - * requested, if there aren't as many dimension segments as you expect. - * For instance, there are fewer than 300 possible values for `ga:country`, so - * when segmenting only by country, you can't get more than 300 rows, even - * if you set `pageSize` to a higher value. - */ - pageSize: number; + * The headers for the metrics. + */ + export interface Schema$MetricHeader { + /** + * Headers for the metrics in the response. + */ + metricHeaderEntries: Schema$MetricHeaderEntry[]; + /** + * Headers for the pivots in the response. + */ + pivotHeaders: Schema$PivotHeader[]; + } /** - * A continuation token to get the next page of the results. Adding this to - * the request will return the rows after the pageToken. The pageToken should - * be the value returned in the nextPageToken parameter in the response to the - * GetReports request. - */ - pageToken: string; + * Header for the metrics. + */ + export interface Schema$MetricHeaderEntry { + /** + * The name of the header. + */ + name: string; + /** + * The type of the metric, for example `INTEGER`. + */ + type: string; + } /** - * The pivot definitions. Requests can have a maximum of 2 pivots. - */ - pivots: Schema$Pivot[]; + * Specifies the sorting options. + */ + export interface Schema$OrderBy { + /** + * The field which to sort by. The default sort order is ascending. Example: + * `ga:browser`. Note, that you can only specify one field for sort here. + * For example, `ga:browser, ga:city` is not valid. + */ + fieldName: string; + /** + * The order type. The default orderType is `VALUE`. + */ + orderType: string; + /** + * The sorting order for the field. + */ + sortOrder: string; + } /** - * The desired report - * [sample](https://support.google.com/analytics/answer/2637192) size. If the - * the `samplingLevel` field is unspecified the `DEFAULT` sampling level is - * used. Every [ReportRequest](#ReportRequest) within a `batchGet` method must - * contain the same `samplingLevel` definition. See [developer - * guide](/analytics/devguides/reporting/core/v4/basics#sampling) for - * details. + * A list of segment filters in the `OR` group are combined with the logical + * OR operator. */ - samplingLevel: string; + export interface Schema$OrFiltersForSegment { + /** + * List of segment filters to be combined with a `OR` operator. + */ + segmentFilterClauses: Schema$SegmentFilterClause[]; + } /** - * Segment the data returned for the request. A segment definition helps look - * at a subset of the segment request. A request can contain up to four - * segments. Every [ReportRequest](#ReportRequest) within a `batchGet` method - * must contain the same `segments` definition. Requests with segments must - * have the `ga:segment` dimension. - */ - segments: Schema$Segment[]; + * The Pivot describes the pivot section in the request. The Pivot helps + * rearrange the information in the table for certain reports by pivoting your + * data on a second dimension. + */ + export interface Schema$Pivot { + /** + * DimensionFilterClauses are logically combined with an `AND` operator: + * only data that is included by all these DimensionFilterClauses + * contributes to the values in this pivot region. Dimension filters can be + * used to restrict the columns shown in the pivot region. For example if + * you have `ga:browser` as the requested dimension in the pivot region, and + * you specify key filters to restrict `ga:browser` to only "IE" + * or "Firefox", then only those two browsers would show up as + * columns. + */ + dimensionFilterClauses: Schema$DimensionFilterClause[]; + /** + * A list of dimensions to show as pivot columns. A Pivot can have a maximum + * of 4 dimensions. Pivot dimensions are part of the restriction on the + * total number of dimensions allowed in the request. + */ + dimensions: Schema$Dimension[]; + /** + * Specifies the maximum number of groups to return. The default value is + * 10, also the maximum value is 1,000. + */ + maxGroupCount: number; + /** + * The pivot metrics. Pivot metrics are part of the restriction on total + * number of metrics allowed in the request. + */ + metrics: Schema$Metric[]; + /** + * If k metrics were requested, then the response will contain some + * data-dependent multiple of k columns in the report. E.g., if you pivoted + * on the dimension `ga:browser` then you'd get k columns for + * "Firefox", k columns for "IE", k columns for + * "Chrome", etc. The ordering of the groups of columns is + * determined by descending order of "total" for the first of the + * k values. Ties are broken by lexicographic ordering of the first pivot + * dimension, then lexicographic ordering of the second pivot dimension, and + * so on. E.g., if the totals for the first value for Firefox, IE, and + * Chrome were 8, 2, 8, respectively, the order of columns would be Chrome, + * Firefox, IE. The following let you choose which of the groups of k + * columns are included in the response. + */ + startGroup: number; + } /** - * The Analytics [view - * ID](https://support.google.com/analytics/answer/1009618) from which to - * retrieve data. Every [ReportRequest](#ReportRequest) within a `batchGet` - * method must contain the same `viewId`. - */ - viewId: string; -} -/** - * A row in the report. - */ -export interface Schema$ReportRow { + * The headers for each of the pivot sections defined in the request. + */ + export interface Schema$PivotHeader { + /** + * A single pivot section header. + */ + pivotHeaderEntries: Schema$PivotHeaderEntry[]; + /** + * The total number of groups for this pivot. + */ + totalPivotGroupsCount: number; + } /** - * List of requested dimensions. - */ - dimensions: string[]; + * The headers for the each of the metric column corresponding to the metrics + * requested in the pivots section of the response. + */ + export interface Schema$PivotHeaderEntry { + /** + * The name of the dimensions in the pivot response. + */ + dimensionNames: string[]; + /** + * The values for the dimensions in the pivot. + */ + dimensionValues: string[]; + /** + * The metric header for the metric in the pivot. + */ + metric: Schema$MetricHeaderEntry; + } /** - * List of metrics for each requested DateRange. + * The metric values in the pivot region. */ - metrics: Schema$DateRangeValues[]; -} -/** - * The resource quota tokens remaining for the property after the request is - * completed. - */ -export interface Schema$ResourceQuotasRemaining { + export interface Schema$PivotValueRegion { + /** + * The values of the metrics in each of the pivot regions. + */ + values: string[]; + } /** - * Daily resource quota remaining remaining. - */ - dailyQuotaTokensRemaining: number; + * The data response corresponding to the request. + */ + export interface Schema$Report { + /** + * The column headers. + */ + columnHeader: Schema$ColumnHeader; + /** + * Response data. + */ + data: Schema$ReportData; + /** + * Page token to retrieve the next page of results in the list. + */ + nextPageToken: string; + } /** - * Hourly resource quota tokens remaining. - */ - hourlyQuotaTokensRemaining: number; -} -/** - * The segment definition, if the report needs to be segmented. A Segment is a - * subset of the Analytics data. For example, of the entire set of users, one - * Segment might be users from a particular country or city. - */ -export interface Schema$Segment { + * The data part of the report. + */ + export interface Schema$ReportData { + /** + * The last time the data in the report was refreshed. All the hits received + * before this timestamp are included in the calculation of the report. + */ + dataLastRefreshed: string; + /** + * Indicates if response to this request is golden or not. Data is golden + * when the exact same request will not produce any new results if asked at + * a later point in time. + */ + isDataGolden: boolean; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when rowCount is + * zero. + */ + maximums: Schema$DateRangeValues[]; + /** + * Minimum and maximum values seen over all matching rows. These are both + * empty when `hideValueRanges` in the request is false, or when rowCount is + * zero. + */ + minimums: Schema$DateRangeValues[]; + /** + * Total number of matching rows for this query. + */ + rowCount: number; + /** + * There's one ReportRow for every unique combination of dimensions. + */ + rows: Schema$ReportRow[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), this + * returns the total number of samples read, one entry per date range. If + * the results are not sampled this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplesReadCounts: string[]; + /** + * If the results are + * [sampled](https://support.google.com/analytics/answer/2637192), this + * returns the total number of samples present, one entry per date range. If + * the results are not sampled this field will not be defined. See + * [developer guide](/analytics/devguides/reporting/core/v4/basics#sampling) + * for details. + */ + samplingSpaceSizes: string[]; + /** + * For each requested date range, for the set of all rows that match the + * query, every requested value format gets a total. The total for a value + * format is computed by first totaling the metrics mentioned in the value + * format and then evaluating the value format as a scalar expression. E.g., + * The "totals" for `3 / (ga:sessions + 2)` we compute `3 / ((sum + * of all relevant ga:sessions) + 2)`. Totals are computed before + * pagination. + */ + totals: Schema$DateRangeValues[]; + } /** - * A dynamic segment definition in the request. - */ - dynamicSegment: Schema$DynamicSegment; + * The main request class which specifies the Reporting API request. + */ + export interface Schema$ReportRequest { + /** + * Cohort group associated with this request. If there is a cohort group in + * the request the `ga:cohort` dimension must be present. Every + * [ReportRequest](#ReportRequest) within a `batchGet` method must contain + * the same `cohortGroup` definition. + */ + cohortGroup: Schema$CohortGroup; + /** + * Date ranges in the request. The request can have a maximum of 2 date + * ranges. The response will contain a set of metric values for each + * combination of the dimensions for each date range in the request. So, if + * there are two date ranges, there will be two set of metric values, one + * for the original date range and one for the second date range. The + * `reportRequest.dateRanges` field should not be specified for cohorts or + * Lifetime value requests. If a date range is not provided, the default + * date range is (startDate: current date - 7 days, endDate: current date - + * 1 day). Every [ReportRequest](#ReportRequest) within a `batchGet` method + * must contain the same `dateRanges` definition. + */ + dateRanges: Schema$DateRange[]; + /** + * The dimension filter clauses for filtering Dimension Values. They are + * logically combined with the `AND` operator. Note that filtering occurs + * before any dimensions are aggregated, so that the returned metrics + * represent the total for only the relevant dimensions. + */ + dimensionFilterClauses: Schema$DimensionFilterClause[]; + /** + * The dimensions requested. Requests can have a total of 7 dimensions. + */ + dimensions: Schema$Dimension[]; + /** + * Dimension or metric filters that restrict the data returned for your + * request. To use the `filtersExpression`, supply a dimension or metric on + * which to filter, followed by the filter expression. For example, the + * following expression selects `ga:browser` dimension which starts with + * Firefox; `ga:browser=~^Firefox`. For more information on dimensions and + * metric filters, see [Filters + * reference](https://developers.google.com/analytics/devguides/reporting/core/v3/reference#filters). + */ + filtersExpression: string; + /** + * If set to true, hides the total of all metrics for all the matching rows, + * for every date range. The default false and will return the totals. + */ + hideTotals: boolean; + /** + * If set to true, hides the minimum and maximum across all matching rows. + * The default is false and the value ranges are returned. + */ + hideValueRanges: boolean; + /** + * If set to false, the response does not include rows if all the retrieved + * metrics are equal to zero. The default is false which will exclude these + * rows. + */ + includeEmptyRows: boolean; + /** + * The metric filter clauses. They are logically combined with the `AND` + * operator. Metric filters look at only the first date range and not the + * comparing date range. Note that filtering on metrics occurs after the + * metrics are aggregated. + */ + metricFilterClauses: Schema$MetricFilterClause[]; + /** + * The metrics requested. Requests must specify at least one metric. + * Requests can have a total of 10 metrics. + */ + metrics: Schema$Metric[]; + /** + * Sort order on output rows. To compare two rows, the elements of the + * following are applied in order until a difference is found. All date + * ranges in the output get the same row order. + */ + orderBys: Schema$OrderBy[]; + /** + * Page size is for paging and specifies the maximum number of returned + * rows. Page size should be >= 0. A query returns the default of 1,000 + * rows. The Analytics Core Reporting API returns a maximum of 10,000 rows + * per request, no matter how many you ask for. It can also return fewer + * rows than requested, if there aren't as many dimension segments as + * you expect. For instance, there are fewer than 300 possible values for + * `ga:country`, so when segmenting only by country, you can't get more + * than 300 rows, even if you set `pageSize` to a higher value. + */ + pageSize: number; + /** + * A continuation token to get the next page of the results. Adding this to + * the request will return the rows after the pageToken. The pageToken + * should be the value returned in the nextPageToken parameter in the + * response to the GetReports request. + */ + pageToken: string; + /** + * The pivot definitions. Requests can have a maximum of 2 pivots. + */ + pivots: Schema$Pivot[]; + /** + * The desired report + * [sample](https://support.google.com/analytics/answer/2637192) size. If + * the the `samplingLevel` field is unspecified the `DEFAULT` sampling level + * is used. Every [ReportRequest](#ReportRequest) within a `batchGet` method + * must contain the same `samplingLevel` definition. See [developer + * guide](/analytics/devguides/reporting/core/v4/basics#sampling) for + * details. + */ + samplingLevel: string; + /** + * Segment the data returned for the request. A segment definition helps + * look at a subset of the segment request. A request can contain up to four + * segments. Every [ReportRequest](#ReportRequest) within a `batchGet` + * method must contain the same `segments` definition. Requests with + * segments must have the `ga:segment` dimension. + */ + segments: Schema$Segment[]; + /** + * The Analytics [view + * ID](https://support.google.com/analytics/answer/1009618) from which to + * retrieve data. Every [ReportRequest](#ReportRequest) within a `batchGet` + * method must contain the same `viewId`. + */ + viewId: string; + } /** - * The segment ID of a built-in or custom segment, for example `gaid::-3`. - */ - segmentId: string; -} -/** - * SegmentDefinition defines the segment to be a set of SegmentFilters which are - * combined together with a logical `AND` operation. - */ -export interface Schema$SegmentDefinition { + * A row in the report. + */ + export interface Schema$ReportRow { + /** + * List of requested dimensions. + */ + dimensions: string[]; + /** + * List of metrics for each requested DateRange. + */ + metrics: Schema$DateRangeValues[]; + } /** - * A segment is defined by a set of segment filters which are combined - * together with a logical `AND` operation. - */ - segmentFilters: Schema$SegmentFilter[]; -} -/** - * Dimension filter specifies the filtering options on a dimension. - */ -export interface Schema$SegmentDimensionFilter { + * The resource quota tokens remaining for the property after the request is + * completed. + */ + export interface Schema$ResourceQuotasRemaining { + /** + * Daily resource quota remaining remaining. + */ + dailyQuotaTokensRemaining: number; + /** + * Hourly resource quota tokens remaining. + */ + hourlyQuotaTokensRemaining: number; + } /** - * Should the match be case sensitive, ignored for `IN_LIST` operator. - */ - caseSensitive: boolean; + * The segment definition, if the report needs to be segmented. A Segment is a + * subset of the Analytics data. For example, of the entire set of users, one + * Segment might be users from a particular country or city. + */ + export interface Schema$Segment { + /** + * A dynamic segment definition in the request. + */ + dynamicSegment: Schema$DynamicSegment; + /** + * The segment ID of a built-in or custom segment, for example `gaid::-3`. + */ + segmentId: string; + } /** - * Name of the dimension for which the filter is being applied. + * SegmentDefinition defines the segment to be a set of SegmentFilters which + * are combined together with a logical `AND` operation. */ - dimensionName: string; + export interface Schema$SegmentDefinition { + /** + * A segment is defined by a set of segment filters which are combined + * together with a logical `AND` operation. + */ + segmentFilters: Schema$SegmentFilter[]; + } /** - * The list of expressions, only the first element is used for all operators - */ - expressions: string[]; + * Dimension filter specifies the filtering options on a dimension. + */ + export interface Schema$SegmentDimensionFilter { + /** + * Should the match be case sensitive, ignored for `IN_LIST` operator. + */ + caseSensitive: boolean; + /** + * Name of the dimension for which the filter is being applied. + */ + dimensionName: string; + /** + * The list of expressions, only the first element is used for all operators + */ + expressions: string[]; + /** + * Maximum comparison values for `BETWEEN` match type. + */ + maxComparisonValue: string; + /** + * Minimum comparison values for `BETWEEN` match type. + */ + minComparisonValue: string; + /** + * The operator to use to match the dimension with the expressions. + */ + operator: string; + } /** - * Maximum comparison values for `BETWEEN` match type. - */ - maxComparisonValue: string; + * SegmentFilter defines the segment to be either a simple or a sequence + * segment. A simple segment condition contains dimension and metric + * conditions to select the sessions or users. A sequence segment condition + * can be used to select users or sessions based on sequential conditions. + */ + export interface Schema$SegmentFilter { + /** + * If true, match the complement of simple or sequence segment. For example, + * to match all visits not from "New York", we can define the + * segment as follows: "sessionSegment": { + * "segmentFilters": [{ "simpleSegment" :{ + * "orFiltersForSegment": [{ "segmentFilterClauses":[{ + * "dimensionFilter": { "dimensionName": + * "ga:city", "expressions": + * ["New York"] } }] }] + * }, "not": "True" }] }, + */ + not: boolean; + /** + * Sequence conditions consist of one or more steps, where each step is + * defined by one or more dimension/metric conditions. Multiple steps can be + * combined with special sequence operators. + */ + sequenceSegment: Schema$SequenceSegment; + /** + * A Simple segment conditions consist of one or more dimension/metric + * conditions that can be combined + */ + simpleSegment: Schema$SimpleSegment; + } /** - * Minimum comparison values for `BETWEEN` match type. - */ - minComparisonValue: string; + * Filter Clause to be used in a segment definition, can be wither a metric or + * a dimension filter. + */ + export interface Schema$SegmentFilterClause { + /** + * Dimension Filter for the segment definition. + */ + dimensionFilter: Schema$SegmentDimensionFilter; + /** + * Metric Filter for the segment definition. + */ + metricFilter: Schema$SegmentMetricFilter; + /** + * Matches the complement (`!`) of the filter. + */ + not: boolean; + } /** - * The operator to use to match the dimension with the expressions. - */ - operator: string; -} -/** - * SegmentFilter defines the segment to be either a simple or a sequence - * segment. A simple segment condition contains dimension and metric conditions - * to select the sessions or users. A sequence segment condition can be used to - * select users or sessions based on sequential conditions. - */ -export interface Schema$SegmentFilter { + * Metric filter to be used in a segment filter clause. + */ + export interface Schema$SegmentMetricFilter { + /** + * The value to compare against. If the operator is `BETWEEN`, this value is + * treated as minimum comparison value. + */ + comparisonValue: string; + /** + * Max comparison value is only used for `BETWEEN` operator. + */ + maxComparisonValue: string; + /** + * The metric that will be filtered on. A `metricFilter` must contain a + * metric name. + */ + metricName: string; + /** + * Specifies is the operation to perform to compare the metric. The default + * is `EQUAL`. + */ + operator: string; + /** + * Scope for a metric defines the level at which that metric is defined. The + * specified metric scope must be equal to or greater than its primary scope + * as defined in the data model. The primary scope is defined by if the + * segment is selecting users or sessions. + */ + scope: string; + } /** - * If true, match the complement of simple or sequence segment. For example, - * to match all visits not from "New York", we can define the - * segment as follows: "sessionSegment": { - * "segmentFilters": [{ "simpleSegment" :{ - * "orFiltersForSegment": [{ "segmentFilterClauses":[{ - * "dimensionFilter": { "dimensionName": - * "ga:city", "expressions": ["New - * York"] } }] }] }, - * "not": "True" }] }, - */ - not: boolean; + * A segment sequence definition. + */ + export interface Schema$SegmentSequenceStep { + /** + * Specifies if the step immediately precedes or can be any time before the + * next step. + */ + matchType: string; + /** + * A sequence is specified with a list of Or grouped filters which are + * combined with `AND` operator. + */ + orFiltersForSegment: Schema$OrFiltersForSegment[]; + } /** * Sequence conditions consist of one or more steps, where each step is * defined by one or more dimension/metric conditions. Multiple steps can be * combined with special sequence operators. */ - sequenceSegment: Schema$SequenceSegment; + export interface Schema$SequenceSegment { + /** + * If set, first step condition must match the first hit of the visitor (in + * the date range). + */ + firstStepShouldMatchFirstHit: boolean; + /** + * The list of steps in the sequence. + */ + segmentSequenceSteps: Schema$SegmentSequenceStep[]; + } /** * A Simple segment conditions consist of one or more dimension/metric - * conditions that can be combined - */ - simpleSegment: Schema$SimpleSegment; -} -/** - * Filter Clause to be used in a segment definition, can be wither a metric or a - * dimension filter. - */ -export interface Schema$SegmentFilterClause { - /** - * Dimension Filter for the segment definition. - */ - dimensionFilter: Schema$SegmentDimensionFilter; - /** - * Metric Filter for the segment definition. - */ - metricFilter: Schema$SegmentMetricFilter; - /** - * Matches the complement (`!`) of the filter. - */ - not: boolean; -} -/** - * Metric filter to be used in a segment filter clause. - */ -export interface Schema$SegmentMetricFilter { - /** - * The value to compare against. If the operator is `BETWEEN`, this value is - * treated as minimum comparison value. - */ - comparisonValue: string; - /** - * Max comparison value is only used for `BETWEEN` operator. - */ - maxComparisonValue: string; - /** - * The metric that will be filtered on. A `metricFilter` must contain a metric - * name. - */ - metricName: string; - /** - * Specifies is the operation to perform to compare the metric. The default is - * `EQUAL`. - */ - operator: string; - /** - * Scope for a metric defines the level at which that metric is defined. The - * specified metric scope must be equal to or greater than its primary scope - * as defined in the data model. The primary scope is defined by if the - * segment is selecting users or sessions. - */ - scope: string; -} -/** - * A segment sequence definition. - */ -export interface Schema$SegmentSequenceStep { - /** - * Specifies if the step immediately precedes or can be any time before the - * next step. - */ - matchType: string; - /** - * A sequence is specified with a list of Or grouped filters which are - * combined with `AND` operator. - */ - orFiltersForSegment: Schema$OrFiltersForSegment[]; -} -/** - * Sequence conditions consist of one or more steps, where each step is defined - * by one or more dimension/metric conditions. Multiple steps can be combined - * with special sequence operators. - */ -export interface Schema$SequenceSegment { - /** - * If set, first step condition must match the first hit of the visitor (in - * the date range). - */ - firstStepShouldMatchFirstHit: boolean; - /** - * The list of steps in the sequence. - */ - segmentSequenceSteps: Schema$SegmentSequenceStep[]; -} -/** - * A Simple segment conditions consist of one or more dimension/metric - * conditions that can be combined. - */ -export interface Schema$SimpleSegment { - /** - * A list of segment filters groups which are combined with logical `AND` - * operator. - */ - orFiltersForSegment: Schema$OrFiltersForSegment[]; -} - -export class Resource$Reports { - root: Analyticsreporting; - constructor(root: Analyticsreporting) { - this.root = root; - this.getRoot.bind(this); + * conditions that can be combined. + */ + export interface Schema$SimpleSegment { + /** + * A list of segment filters groups which are combined with logical `AND` + * operator. + */ + orFiltersForSegment: Schema$OrFiltersForSegment[]; } - getRoot() { - return this.root; - } - - - /** - * analyticsreporting.reports.batchGet - * @desc Returns the Analytics data. - * @alias analyticsreporting.reports.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GetReportsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Analyticsreporting; + constructor(root: Analyticsreporting) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://analyticsreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/reports:batchGet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * analyticsreporting.reports.batchGet + * @desc Returns the Analytics data. + * @alias analyticsreporting.reports.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GetReportsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://analyticsreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/reports:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androiddeviceprovisioning/v1.ts b/src/apis/androiddeviceprovisioning/v1.ts index 7cfe3ce7fe0..9eb1f78d2d2 100644 --- a/src/apis/androiddeviceprovisioning/v1.ts +++ b/src/apis/androiddeviceprovisioning/v1.ts @@ -27,2234 +27,2263 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Android Device Provisioning Partner API - * - * Automates Android zero-touch enrollment for device resellers, customers, and - * EMMs. - * - * @example - * const google = require('googleapis'); - * const androiddeviceprovisioning = google.androiddeviceprovisioning('v1'); - * - * @namespace androiddeviceprovisioning - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Androiddeviceprovisioning - */ -export class Androiddeviceprovisioning { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - customers: Resource$Customers; - operations: Resource$Operations; - partners: Resource$Partners; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.customers = new Resource$Customers(this); - this.operations = new Resource$Operations(this); - this.partners = new Resource$Partners(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Request message to claim a device on behalf of a customer. - */ -export interface Schema$ClaimDeviceRequest { - /** - * Required. The ID of the customer for whom the device is being claimed. - */ - customerId: string; - /** - * Required. The device identifier of the device to claim. - */ - deviceIdentifier: Schema$DeviceIdentifier; - /** - * Required. The section type of the device's provisioning record. - */ - sectionType: string; -} -/** - * Response message containing device id of the claim. - */ -export interface Schema$ClaimDeviceResponse { - /** - * The device ID of the claimed device. - */ - deviceId: string; - /** - * The resource name of the device in the format - * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. - */ - deviceName: string; -} -/** - * Request to claim devices asynchronously in batch. Claiming a device adds the - * device to zero-touch enrollment and shows the device in the customer's - * view of the portal. - */ -export interface Schema$ClaimDevicesRequest { - /** - * Required. A list of device claims. - */ - claims: Schema$PartnerClaim[]; -} -/** - * A customer resource in the zero-touch enrollment API. - */ -export interface Schema$Company { - /** - * Input only. Optional. Email address of customer's users in the admin - * role. Each email address must be associated with a Google Account. - */ - adminEmails: string[]; - /** - * Output only. The ID of the company. Assigned by the server. - */ - companyId: string; - /** - * Required. The name of the company. For example _XYZ Corp_. Characters - * allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to the - * customer's employees in the zero-touch enrollment portal. - */ - companyName: string; - /** - * Output only. The API resource name of the company in the format - * `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server. - */ - name: string; - /** - * Input only. Email address of customer's users in the owner role. At - * least one `owner_email` is required. Each email address must be associated - * with a Google Account. Owners share the same access as admins but can also - * add, delete, and edit your organization's portal users. - */ - ownerEmails: string[]; -} -/** - * A configuration collects the provisioning options for Android devices. Each - * configuration combines the following: * The EMM device policy controller - * (DPC) installed on the devices. * EMM policies enforced on the devices. * - * Metadata displayed on the device to help users during setup. Customers can - * add as many configurations as they need. However, zero-touch enrollment works - * best when a customer sets a default configuration that's applied to any - * new devices the organization purchases. - */ -export interface Schema$Configuration { - /** - * Required. The name of the organization. Zero-touch enrollment shows this - * organization name to device users during device provisioning. - */ - companyName: string; - /** - * Output only. The ID of the configuration. Assigned by the server. - */ - configurationId: string; - /** - * Required. A short name that describes the configuration's purpose. For - * example, _Sales team_ or _Temporary employees_. The zero-touch enrollment - * portal displays this name to IT admins. - */ - configurationName: string; - /** - * Required. The email address that device users can contact to get help. - * Zero-touch enrollment shows this email address to device users before - * device provisioning. The value is validated on input. - */ - contactEmail: string; - /** - * Required. The telephone number that device users can call, using another - * device, to get help. Zero-touch enrollment shows this number to device - * users before device provisioning. Accepts numerals, spaces, the plus sign, - * hyphens, and parentheses. - */ - contactPhone: string; - /** - * A message, containing one or two sentences, to help device users get help - * or give them more details about what’s happening to their device. - * Zero-touch enrollment shows this message before the device is provisioned. - */ - customMessage: string; - /** - * The JSON-formatted EMM provisioning extras that are passed to the DPC. - */ - dpcExtras: string; - /** - * Required. The resource name of the selected DPC (device policy controller) - * in the format `customers/[CUSTOMER_ID]/dpcs/x. To list the supported DPCs, - * call `customers.dpcs.list`. - */ - dpcResourcePath: string; - /** - * Required. Whether this is the default configuration that zero-touch - * enrollment applies to any new devices the organization purchases in the - * future. Only one customer configuration can be the default. Setting this - * value to `true`, changes the previous default configuration's - * `isDefault` value to `false`. - */ - isDefault: boolean; - /** - * Output only. The API resource name in the format - * `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by - * the server. - */ - name: string; -} -/** - * Request message to create a customer. - */ -export interface Schema$CreateCustomerRequest { - /** - * Required. The company data to populate the new customer. Must contain a - * value for `companyName` and at least one `owner_email` that's - * associated with a Google Account. The values for `companyId` and `name` - * must be empty. - */ - customer: Schema$Company; -} -/** - * Request message for customer to assign a configuration to device. - */ -export interface Schema$CustomerApplyConfigurationRequest { - /** - * Required. The configuration applied to the device in the format - * `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. - */ - configuration: string; - /** - * Required. The device the configuration is applied to. - */ - device: Schema$DeviceReference; -} -/** - * Response message of customer's listing configuration. - */ -export interface Schema$CustomerListConfigurationsResponse { - /** - * The configurations. - */ - configurations: Schema$Configuration[]; -} -/** - * Response message for listing my customers. - */ -export interface Schema$CustomerListCustomersResponse { - /** - * The customer accounts the calling user is a member of. - */ - customers: Schema$Company[]; - /** - * A token used to access the next page of results. Omitted if no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response message of customer's liting devices. - */ -export interface Schema$CustomerListDevicesResponse { - /** - * The customer's devices. - */ - devices: Schema$Device[]; - /** - * A token used to access the next page of results. Omitted if no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response message of customer's listing DPCs. - */ -export interface Schema$CustomerListDpcsResponse { - /** - * The list of DPCs available to the customer that support zero-touch - * enrollment. - */ - dpcs: Schema$Dpc[]; -} -/** - * Request message for customer to remove the configuration from device. - */ -export interface Schema$CustomerRemoveConfigurationRequest { - /** - * Required. The device to remove the configuration from. - */ - device: Schema$DeviceReference; -} -/** - * Request message for customer to unclaim a device. - */ -export interface Schema$CustomerUnclaimDeviceRequest { - /** - * Required. The device to unclaim. - */ - device: Schema$DeviceReference; -} -/** - * An Android device registered for zero-touch enrollment. - */ -export interface Schema$Device { - /** - * Output only. The provisioning claims for a device. Devices claimed for - * zero-touch enrollment have a claim with the type `SECTION_TYPE_ZERO_TOUCH`. - * Call `partners.devices.unclaim` or `partners.devices.unclaimAsync` to - * remove the device from zero-touch enrollment. - */ - claims: Schema$DeviceClaim[]; - /** - * Not available to resellers. - */ - configuration: string; - /** - * Output only. The ID of the device. Assigned by the server. - */ - deviceId: string; - /** - * The hardware IDs that identify a manufactured device. To learn more, read - * [Identifiers](/zero-touch/guides/identifiers). - */ - deviceIdentifier: Schema$DeviceIdentifier; - /** - * The metadata attached to the device. Structured as key-value pairs. To - * learn more, read [Device metadata](/zero-touch/guides/metadata). - */ - deviceMetadata: Schema$DeviceMetadata; - /** - * Output only. The API resource name in the format - * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server. - */ - name: string; -} -/** - * A record of a device claimed by a reseller for a customer. Devices claimed - * for zero-touch enrollment have a claim with the type - * `SECTION_TYPE_ZERO_TOUCH`. To learn more, read [Claim devices for - * customers](/zero-touch/guides/how-it-works#claim). - */ -export interface Schema$DeviceClaim { - /** - * The ID of the Customer that purchased the device. - */ - ownerCompanyId: string; - /** - * Output only. The type of claim made on the device. - */ - sectionType: string; -} -/** - * Encapsulates hardware and product IDs to identify a manufactured device. To - * learn more, read [Identifiers](/zero-touch/guides/identifiers). - */ -export interface Schema$DeviceIdentifier { - /** - * The device’s IMEI number. Validated on input. - */ - imei: string; - /** - * Required. The device manufacturer’s name. Matches the device's built-in - * value returned from `android.os.Build.MANUFACTURER`. Allowed values are - * listed in [manufacturer names](/zero-touch/resources/manufacturer-names). - */ - manufacturer: string; - /** - * The device’s MEID number. - */ - meid: string; - /** - * The manufacturer's serial number for the device. This value might not - * be unique. - */ - serialNumber: string; -} -/** - * Metadata entries that can be attached to a `Device`. To learn more, read - * [Device metadata](/zero-touch/guides/metadata). - */ -export interface Schema$DeviceMetadata { - /** - * Metadata entries recorded as key-value pairs. - */ - entries: any; -} -/** - * A `DeviceReference` is an API abstraction that lets you supply a _device_ - * argument to a method using one of the following identifier types: * A - * numeric API resource ID. * Real-world hardware IDs, such as IMEI number, - * belonging to the manufactured device. Methods that operate on devices take - * a `DeviceReference` as a parameter type because it's more flexible for - * the caller. To learn more about device identifiers, read - * [Identifiers](/zero-touch/guides/identifiers). - */ -export interface Schema$DeviceReference { - /** - * The ID of the device. - */ - deviceId: string; - /** - * The hardware IDs of the device. - */ - deviceIdentifier: Schema$DeviceIdentifier; -} -/** - * Tracks the status of a long-running operation to asynchronously update a - * batch of reseller metadata attached to devices. To learn more, read - * [Long‑running batch operations](/zero-touch/guides/how-it-works#operations). - */ -export interface Schema$DevicesLongRunningOperationMetadata { - /** - * The number of metadata updates in the operation. This might be different - * from the number of updates in the request if the API can't parse some - * of the updates. - */ - devicesCount: number; - /** - * The processing status of the operation. - */ - processingStatus: string; - /** - * The processing progress of the operation. Measured as a number from 0 to - * 100. A value of 10O doesnt always mean the operation completed—check for - * the inclusion of a `done` field. - */ - progress: number; -} -/** - * Tracks the status of a long-running operation to claim, unclaim, or attach - * metadata to devices. To learn more, read [Long‑running batch - * operations](/zero-touch/guides/how-it-works#operations). - */ -export interface Schema$DevicesLongRunningOperationResponse { - /** - * The processing status for each device in the operation. One - * `PerDeviceStatus` per device. The list order matches the items in the - * original request. - */ - perDeviceStatus: Schema$OperationPerDevice[]; - /** - * A summary of how many items in the operation the server processed - * successfully. Updated as the operation progresses. - */ - successCount: number; -} -/** - * An EMM's DPC ([device policy - * controller](http://developer.android.com/work/dpc/build-dpc.html)). - * Zero-touch enrollment installs a DPC (listed in the `Configuration`) on a - * device to maintain the customer's mobile policies. All the DPCs listed by - * the API support zero-touch enrollment and are available in Google Play. - */ -export interface Schema$Dpc { - /** - * Output only. The title of the DPC app in Google Play. For example, _Google - * Apps Device Policy_. Useful in an application's user interface. - */ - dpcName: string; - /** - * Output only. The API resource name in the format - * `customers/[CUSTOMER_ID]/dpcs/[DPC_ID]`. Assigned by the server. To - * maintain a reference to a DPC across customer accounts, persist and match - * the last path component (`DPC_ID`). - */ - name: string; - /** - * Output only. The DPC's Android application ID that looks like a Java - * package name. Zero-touch enrollment installs the DPC app onto a device - * using this identifier. - */ - packageName: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Request to find devices. - */ -export interface Schema$FindDevicesByDeviceIdentifierRequest { - /** - * Required. The device identifier to search for. - */ - deviceIdentifier: Schema$DeviceIdentifier; - /** - * Required. The maximum number of devices to show in a page of results. Must - * be between 1 and 100 inclusive. - */ - limit: string; - /** - * A token specifying which result page to return. - */ - pageToken: string; -} -/** - * Response containing found devices. - */ -export interface Schema$FindDevicesByDeviceIdentifierResponse { - /** - * Found devices. - */ - devices: Schema$Device[]; - /** - * A token used to access the next page of results. Omitted if no further - * results are available. - */ - nextPageToken: string; -} -/** - * Request to find devices by customers. - */ -export interface Schema$FindDevicesByOwnerRequest { - /** - * Required. The list of customer IDs to search for. - */ - customerId: string[]; - /** - * Required. The maximum number of devices to show in a page of results. Must - * be between 1 and 100 inclusive. - */ - limit: string; - /** - * A token specifying which result page to return. - */ - pageToken: string; - /** - * Required. The section type of the device's provisioning record. - */ - sectionType: string; -} -/** - * Response containing found devices. - */ -export interface Schema$FindDevicesByOwnerResponse { - /** - * The customer's devices. - */ - devices: Schema$Device[]; - /** - * A token used to access the next page of results. Omitted if no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response message of all customers related to this partner. - */ -export interface Schema$ListCustomersResponse { - /** - * List of customers related to this reseller partner. - */ - customers: Schema$Company[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * This field will always be not set if the operation is created by - * `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, error - * information for each device is set in - * `response.perDeviceStatus.result.status`. - */ - error: Schema$Status; - /** - * This field will contain a `DevicesLongRunningOperationMetadata` object if - * the operation is created by `claimAsync`, `unclaimAsync`, or - * `updateMetadataAsync`. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * This field will contain a `DevicesLongRunningOperationResponse` object if - * the operation is created by `claimAsync`, `unclaimAsync`, or - * `updateMetadataAsync`. - */ - response: any; -} -/** - * A task for each device in the operation. Corresponds to each device change in - * the request. - */ -export interface Schema$OperationPerDevice { - /** - * A copy of the original device-claim request received by the server. - */ - claim: Schema$PartnerClaim; - /** - * The processing result for each device. - */ - result: Schema$PerDeviceStatusInBatch; - /** - * A copy of the original device-unclaim request received by the server. - */ - unclaim: Schema$PartnerUnclaim; - /** - * A copy of the original metadata-update request received by the server. - */ - updateMetadata: Schema$UpdateMetadataArguments; -} -/** - * Identifies one claim request. - */ -export interface Schema$PartnerClaim { - /** - * Required. The ID of the customer for whom the device is being claimed. - */ - customerId: string; - /** - * Required. Device identifier of the device. - */ - deviceIdentifier: Schema$DeviceIdentifier; - /** - * Required. The metadata to attach to the device at claim. - */ - deviceMetadata: Schema$DeviceMetadata; - /** - * Required. The section type of the device's provisioning record. - */ - sectionType: string; -} -/** - * Identifies one unclaim request. - */ -export interface Schema$PartnerUnclaim { - /** - * Device ID of the device. - */ - deviceId: string; - /** - * Device identifier of the device. - */ - deviceIdentifier: Schema$DeviceIdentifier; - /** - * Required. The section type of the device's provisioning record. - */ - sectionType: string; -} -/** - * Captures the processing status for each device in the operation. - */ -export interface Schema$PerDeviceStatusInBatch { +export namespace androiddeviceprovisioning_v1 { /** - * If processing succeeds, the device ID of the device. - */ - deviceId: string; - /** - * If processing fails, the error type. - */ - errorIdentifier: string; - /** - * If processing fails, a developer message explaining what went wrong. - */ - errorMessage: string; - /** - * The result status of the device after processing. + * Android Device Provisioning Partner API + * + * Automates Android zero-touch enrollment for device resellers, customers, + * and EMMs. + * + * @example + * const google = require('googleapis'); + * const androiddeviceprovisioning = google.androiddeviceprovisioning('v1'); + * + * @namespace androiddeviceprovisioning + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Androiddeviceprovisioning */ - status: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export class Androiddeviceprovisioning { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + customers: Resource$Customers; + operations: Resource$Operations; + partners: Resource$Partners; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.customers = new Resource$Customers(this); + this.operations = new Resource$Operations(this); + this.partners = new Resource$Partners(this); + } + + getRoot() { + return this.root; + } + } + /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Request message to claim a device on behalf of a customer. + */ + export interface Schema$ClaimDeviceRequest { + /** + * Required. The ID of the customer for whom the device is being claimed. + */ + customerId: string; + /** + * Required. The device identifier of the device to claim. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The section type of the device's provisioning record. + */ + sectionType: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Response message containing device id of the claim. + */ + export interface Schema$ClaimDeviceResponse { + /** + * The device ID of the claimed device. + */ + deviceId: string; + /** + * The resource name of the device in the format + * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + */ + deviceName: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Request to claim devices asynchronously in batch. Claiming a device adds + * the device to zero-touch enrollment and shows the device in the + * customer's view of the portal. */ - message: string; -} -/** - * Request message to unclaim a device. - */ -export interface Schema$UnclaimDeviceRequest { + export interface Schema$ClaimDevicesRequest { + /** + * Required. A list of device claims. + */ + claims: Schema$PartnerClaim[]; + } /** - * The device ID returned by `ClaimDevice`. - */ - deviceId: string; + * A customer resource in the zero-touch enrollment API. + */ + export interface Schema$Company { + /** + * Input only. Optional. Email address of customer's users in the admin + * role. Each email address must be associated with a Google Account. + */ + adminEmails: string[]; + /** + * Output only. The ID of the company. Assigned by the server. + */ + companyId: string; + /** + * Required. The name of the company. For example _XYZ Corp_. Characters + * allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to + * the customer's employees in the zero-touch enrollment portal. + */ + companyName: string; + /** + * Output only. The API resource name of the company in the format + * `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server. + */ + name: string; + /** + * Input only. Email address of customer's users in the owner role. At + * least one `owner_email` is required. Each email address must be + * associated with a Google Account. Owners share the same access as admins + * but can also add, delete, and edit your organization's portal users. + */ + ownerEmails: string[]; + } /** - * The device identifier you used when you claimed this device. - */ - deviceIdentifier: Schema$DeviceIdentifier; + * A configuration collects the provisioning options for Android devices. Each + * configuration combines the following: * The EMM device policy controller + * (DPC) installed on the devices. * EMM policies enforced on the devices. * + * Metadata displayed on the device to help users during setup. Customers can + * add as many configurations as they need. However, zero-touch enrollment + * works best when a customer sets a default configuration that's applied + * to any new devices the organization purchases. + */ + export interface Schema$Configuration { + /** + * Required. The name of the organization. Zero-touch enrollment shows this + * organization name to device users during device provisioning. + */ + companyName: string; + /** + * Output only. The ID of the configuration. Assigned by the server. + */ + configurationId: string; + /** + * Required. A short name that describes the configuration's purpose. + * For example, _Sales team_ or _Temporary employees_. The zero-touch + * enrollment portal displays this name to IT admins. + */ + configurationName: string; + /** + * Required. The email address that device users can contact to get help. + * Zero-touch enrollment shows this email address to device users before + * device provisioning. The value is validated on input. + */ + contactEmail: string; + /** + * Required. The telephone number that device users can call, using another + * device, to get help. Zero-touch enrollment shows this number to device + * users before device provisioning. Accepts numerals, spaces, the plus + * sign, hyphens, and parentheses. + */ + contactPhone: string; + /** + * A message, containing one or two sentences, to help device users get help + * or give them more details about what’s happening to their device. + * Zero-touch enrollment shows this message before the device is + * provisioned. + */ + customMessage: string; + /** + * The JSON-formatted EMM provisioning extras that are passed to the DPC. + */ + dpcExtras: string; + /** + * Required. The resource name of the selected DPC (device policy + * controller) in the format `customers/[CUSTOMER_ID]/dpcs/x. To list the + * supported DPCs, call `customers.dpcs.list`. + */ + dpcResourcePath: string; + /** + * Required. Whether this is the default configuration that zero-touch + * enrollment applies to any new devices the organization purchases in the + * future. Only one customer configuration can be the default. Setting this + * value to `true`, changes the previous default configuration's + * `isDefault` value to `false`. + */ + isDefault: boolean; + /** + * Output only. The API resource name in the format + * `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by + * the server. + */ + name: string; + } /** - * Required. The section type of the device's provisioning record. + * Request message to create a customer. */ - sectionType: string; -} -/** - * Request to unclaim devices asynchronously in batch. - */ -export interface Schema$UnclaimDevicesRequest { + export interface Schema$CreateCustomerRequest { + /** + * Required. The company data to populate the new customer. Must contain a + * value for `companyName` and at least one `owner_email` that's + * associated with a Google Account. The values for `companyId` and `name` + * must be empty. + */ + customer: Schema$Company; + } /** - * Required. The list of devices to unclaim. - */ - unclaims: Schema$PartnerUnclaim[]; -} -/** - * Request to update device metadata in batch. - */ -export interface Schema$UpdateDeviceMetadataInBatchRequest { + * Request message for customer to assign a configuration to device. + */ + export interface Schema$CustomerApplyConfigurationRequest { + /** + * Required. The configuration applied to the device in the format + * `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. + */ + configuration: string; + /** + * Required. The device the configuration is applied to. + */ + device: Schema$DeviceReference; + } /** - * Required. The list of metadata updates. + * Response message of customer's listing configuration. */ - updates: Schema$UpdateMetadataArguments[]; -} -/** - * Request to set metadata for a device. - */ -export interface Schema$UpdateDeviceMetadataRequest { + export interface Schema$CustomerListConfigurationsResponse { + /** + * The configurations. + */ + configurations: Schema$Configuration[]; + } /** - * Required. The metdata to attach to the device. - */ - deviceMetadata: Schema$DeviceMetadata; -} -/** - * Identifies metdata updates to one device. - */ -export interface Schema$UpdateMetadataArguments { + * Response message for listing my customers. + */ + export interface Schema$CustomerListCustomersResponse { + /** + * The customer accounts the calling user is a member of. + */ + customers: Schema$Company[]; + /** + * A token used to access the next page of results. Omitted if no further + * results are available. + */ + nextPageToken: string; + } /** - * Device ID of the device. - */ - deviceId: string; + * Response message of customer's liting devices. + */ + export interface Schema$CustomerListDevicesResponse { + /** + * The customer's devices. + */ + devices: Schema$Device[]; + /** + * A token used to access the next page of results. Omitted if no further + * results are available. + */ + nextPageToken: string; + } /** - * Device identifier. + * Response message of customer's listing DPCs. */ - deviceIdentifier: Schema$DeviceIdentifier; + export interface Schema$CustomerListDpcsResponse { + /** + * The list of DPCs available to the customer that support zero-touch + * enrollment. + */ + dpcs: Schema$Dpc[]; + } /** - * Required. The metadata to update. + * Request message for customer to remove the configuration from device. */ - deviceMetadata: Schema$DeviceMetadata; -} - -export class Resource$Customers { - root: Androiddeviceprovisioning; - configurations: Resource$Customers$Configurations; - devices: Resource$Customers$Devices; - dpcs: Resource$Customers$Dpcs; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); - this.configurations = new Resource$Customers$Configurations(root); - this.devices = new Resource$Customers$Devices(root); - this.dpcs = new Resource$Customers$Dpcs(root); - } - - getRoot() { - return this.root; + export interface Schema$CustomerRemoveConfigurationRequest { + /** + * Required. The device to remove the configuration from. + */ + device: Schema$DeviceReference; } - - /** - * androiddeviceprovisioning.customers.list - * @desc Lists the user's customer accounts. - * @alias androiddeviceprovisioning.customers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of customers to show in a page of results. A number between 1 and 100 (inclusive). - * @param {string=} params.pageToken A token specifying which result page to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for customer to unclaim a device. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/customers').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Customers$Configurations { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$CustomerUnclaimDeviceRequest { + /** + * Required. The device to unclaim. + */ + device: Schema$DeviceReference; } - - /** - * androiddeviceprovisioning.customers.configurations.create - * @desc Creates a new configuration. Once created, a customer can apply the - * configuration to devices. - * @alias androiddeviceprovisioning.customers.configurations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer that manages the configuration. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {().Configuration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/configurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An Android device registered for zero-touch enrollment. + */ + export interface Schema$Device { + /** + * Output only. The provisioning claims for a device. Devices claimed for + * zero-touch enrollment have a claim with the type + * `SECTION_TYPE_ZERO_TOUCH`. Call `partners.devices.unclaim` or + * `partners.devices.unclaimAsync` to remove the device from zero-touch + * enrollment. + */ + claims: Schema$DeviceClaim[]; + /** + * Not available to resellers. + */ + configuration: string; + /** + * Output only. The ID of the device. Assigned by the server. + */ + deviceId: string; + /** + * The hardware IDs that identify a manufactured device. To learn more, read + * [Identifiers](/zero-touch/guides/identifiers). + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * The metadata attached to the device. Structured as key-value pairs. To + * learn more, read [Device metadata](/zero-touch/guides/metadata). + */ + deviceMetadata: Schema$DeviceMetadata; + /** + * Output only. The API resource name in the format + * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. Assigned by the server. + */ + name: string; } - - /** - * androiddeviceprovisioning.customers.configurations.delete - * @desc Deletes an unused configuration. The API call fails if the customer - * has devices with the configuration applied. - * @alias androiddeviceprovisioning.customers.configurations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The configuration to delete. An API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. If the configuration is applied to any devices, the API call fails. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A record of a device claimed by a reseller for a customer. Devices claimed + * for zero-touch enrollment have a claim with the type + * `SECTION_TYPE_ZERO_TOUCH`. To learn more, read [Claim devices for + * customers](/zero-touch/guides/how-it-works#claim). + */ + export interface Schema$DeviceClaim { + /** + * The ID of the Customer that purchased the device. + */ + ownerCompanyId: string; + /** + * Output only. The type of claim made on the device. + */ + sectionType: string; } - - /** - * androiddeviceprovisioning.customers.configurations.get - * @desc Gets the details of a configuration. - * @alias androiddeviceprovisioning.customers.configurations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The configuration to get. An API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Encapsulates hardware and product IDs to identify a manufactured device. To + * learn more, read [Identifiers](/zero-touch/guides/identifiers). + */ + export interface Schema$DeviceIdentifier { + /** + * The device’s IMEI number. Validated on input. + */ + imei: string; + /** + * Required. The device manufacturer’s name. Matches the device's + * built-in value returned from `android.os.Build.MANUFACTURER`. Allowed + * values are listed in [manufacturer + * names](/zero-touch/resources/manufacturer-names). + */ + manufacturer: string; + /** + * The device’s MEID number. + */ + meid: string; + /** + * The manufacturer's serial number for the device. This value might not + * be unique. + */ + serialNumber: string; } - - /** - * androiddeviceprovisioning.customers.configurations.list - * @desc Lists a customer's configurations. - * @alias androiddeviceprovisioning.customers.configurations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer that manages the listed configurations. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Metadata entries that can be attached to a `Device`. To learn more, read + * [Device metadata](/zero-touch/guides/metadata). */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/configurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$DeviceMetadata { + /** + * Metadata entries recorded as key-value pairs. + */ + entries: any; } - - /** - * androiddeviceprovisioning.customers.configurations.patch - * @desc Updates a configuration's field values. - * @alias androiddeviceprovisioning.customers.configurations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by the server. - * @param {string=} params.updateMask Required. The field mask applied to the target `Configuration` before updating the fields. To learn more about using field masks, read [FieldMask](/protocol-buffers/docs/reference/google.protobuf#fieldmask) in the Protocol Buffers documentation. - * @param {().Configuration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A `DeviceReference` is an API abstraction that lets you supply a _device_ + * argument to a method using one of the following identifier types: * A + * numeric API resource ID. * Real-world hardware IDs, such as IMEI number, + * belonging to the manufactured device. Methods that operate on devices + * take a `DeviceReference` as a parameter type because it's more flexible + * for the caller. To learn more about device identifiers, read + * [Identifiers](/zero-touch/guides/identifiers). */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Customers$Devices { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$DeviceReference { + /** + * The ID of the device. + */ + deviceId: string; + /** + * The hardware IDs of the device. + */ + deviceIdentifier: Schema$DeviceIdentifier; } - - getRoot() { - return this.root; - } - - /** - * androiddeviceprovisioning.customers.devices.applyConfiguration - * @desc Applies a Configuration to the device to register the device for - * zero-touch enrollment. After applying a configuration to a device, the - * device automatically provisions itself on first boot, or next factory - * reset. - * @alias androiddeviceprovisioning.customers.devices.applyConfiguration - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer managing the device. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {().CustomerApplyConfigurationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Tracks the status of a long-running operation to asynchronously update a + * batch of reseller metadata attached to devices. To learn more, read + * [Long‑running batch + * operations](/zero-touch/guides/how-it-works#operations). */ - applyConfiguration(params?: any, options?: MethodOptions): - AxiosPromise; - applyConfiguration( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - applyConfiguration( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices:applyConfiguration') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$DevicesLongRunningOperationMetadata { + /** + * The number of metadata updates in the operation. This might be different + * from the number of updates in the request if the API can't parse some + * of the updates. + */ + devicesCount: number; + /** + * The processing status of the operation. + */ + processingStatus: string; + /** + * The processing progress of the operation. Measured as a number from 0 to + * 100. A value of 10O doesnt always mean the operation completed—check for + * the inclusion of a `done` field. + */ + progress: number; } - - /** - * androiddeviceprovisioning.customers.devices.get - * @desc Gets the details of a device. - * @alias androiddeviceprovisioning.customers.devices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The device to get. An API resource name in the format `customers/[CUSTOMER_ID]/devices/[DEVICE_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Tracks the status of a long-running operation to claim, unclaim, or attach + * metadata to devices. To learn more, read [Long‑running batch + * operations](/zero-touch/guides/how-it-works#operations). */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$DevicesLongRunningOperationResponse { + /** + * The processing status for each device in the operation. One + * `PerDeviceStatus` per device. The list order matches the items in the + * original request. + */ + perDeviceStatus: Schema$OperationPerDevice[]; + /** + * A summary of how many items in the operation the server processed + * successfully. Updated as the operation progresses. + */ + successCount: number; } - - /** - * androiddeviceprovisioning.customers.devices.list - * @desc Lists a customer's devices. - * @alias androiddeviceprovisioning.customers.devices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageSize The maximum number of devices to show in a page of results. Must be between 1 and 100 inclusive. - * @param {string=} params.pageToken A token specifying which result page to return. - * @param {string} params.parent Required. The customer managing the devices. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An EMM's DPC ([device policy + * controller](http://developer.android.com/work/dpc/build-dpc.html)). + * Zero-touch enrollment installs a DPC (listed in the `Configuration`) on a + * device to maintain the customer's mobile policies. All the DPCs listed + * by the API support zero-touch enrollment and are available in Google Play. + */ + export interface Schema$Dpc { + /** + * Output only. The title of the DPC app in Google Play. For example, + * _Google Apps Device Policy_. Useful in an application's user + * interface. + */ + dpcName: string; + /** + * Output only. The API resource name in the format + * `customers/[CUSTOMER_ID]/dpcs/[DPC_ID]`. Assigned by the server. To + * maintain a reference to a DPC across customer accounts, persist and match + * the last path component (`DPC_ID`). + */ + name: string; + /** + * Output only. The DPC's Android application ID that looks like a Java + * package name. Zero-touch enrollment installs the DPC app onto a device + * using this identifier. + */ + packageName: string; } - - /** - * androiddeviceprovisioning.customers.devices.removeConfiguration - * @desc Removes a configuration from device. - * @alias androiddeviceprovisioning.customers.devices.removeConfiguration - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer managing the device in the format `customers/[CUSTOMER_ID]`. - * @param {().CustomerRemoveConfigurationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeConfiguration(params?: any, options?: MethodOptions): - AxiosPromise; - removeConfiguration( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeConfiguration( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices:removeConfiguration') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Request to find devices. + */ + export interface Schema$FindDevicesByDeviceIdentifierRequest { + /** + * Required. The device identifier to search for. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The maximum number of devices to show in a page of results. + * Must be between 1 and 100 inclusive. + */ + limit: string; + /** + * A token specifying which result page to return. + */ + pageToken: string; } - - /** - * androiddeviceprovisioning.customers.devices.unclaim - * @desc Unclaims a device from a customer and removes it from zero-touch - * enrollment. After removing a device, a customer must contact their - * reseller to register the device into zero-touch enrollment again. - * @alias androiddeviceprovisioning.customers.devices.unclaim - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer managing the device. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {().CustomerUnclaimDeviceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unclaim(params?: any, options?: MethodOptions): AxiosPromise; - unclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices:unclaim') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response containing found devices. + */ + export interface Schema$FindDevicesByDeviceIdentifierResponse { + /** + * Found devices. + */ + devices: Schema$Device[]; + /** + * A token used to access the next page of results. Omitted if no further + * results are available. + */ + nextPageToken: string; } -} - -export class Resource$Customers$Dpcs { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); + /** + * Request to find devices by customers. + */ + export interface Schema$FindDevicesByOwnerRequest { + /** + * Required. The list of customer IDs to search for. + */ + customerId: string[]; + /** + * Required. The maximum number of devices to show in a page of results. + * Must be between 1 and 100 inclusive. + */ + limit: string; + /** + * A token specifying which result page to return. + */ + pageToken: string; + /** + * Required. The section type of the device's provisioning record. + */ + sectionType: string; } - - getRoot() { - return this.root; + /** + * Response containing found devices. + */ + export interface Schema$FindDevicesByOwnerResponse { + /** + * The customer's devices. + */ + devices: Schema$Device[]; + /** + * A token used to access the next page of results. Omitted if no further + * results are available. + */ + nextPageToken: string; } - - /** - * androiddeviceprovisioning.customers.dpcs.list - * @desc Lists the DPCs (device policy controllers) that support zero-touch - * enrollment. - * @alias androiddeviceprovisioning.customers.dpcs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The customer that can use the DPCs in configurations. An API resource name in the format `customers/[CUSTOMER_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message of all customers related to this partner. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/dpcs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListCustomersResponse { + /** + * List of customers related to this reseller partner. + */ + customers: Schema$Company[]; } -} - - -export class Resource$Operations { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + /** + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * This field will always be not set if the operation is created by + * `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case, + * error information for each device is set in + * `response.perDeviceStatus.result.status`. + */ + error: Schema$Status; + /** + * This field will contain a `DevicesLongRunningOperationMetadata` object if + * the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * This field will contain a `DevicesLongRunningOperationResponse` object if + * the operation is created by `claimAsync`, `unclaimAsync`, or + * `updateMetadataAsync`. + */ + response: any; } - - /** - * androiddeviceprovisioning.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias androiddeviceprovisioning.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A task for each device in the operation. Corresponds to each device change + * in the request. + */ + export interface Schema$OperationPerDevice { + /** + * A copy of the original device-claim request received by the server. + */ + claim: Schema$PartnerClaim; + /** + * The processing result for each device. + */ + result: Schema$PerDeviceStatusInBatch; + /** + * A copy of the original device-unclaim request received by the server. + */ + unclaim: Schema$PartnerUnclaim; + /** + * A copy of the original metadata-update request received by the server. + */ + updateMetadata: Schema$UpdateMetadataArguments; } -} - -export class Resource$Partners { - root: Androiddeviceprovisioning; - customers: Resource$Partners$Customers; - devices: Resource$Partners$Devices; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); - this.customers = new Resource$Partners$Customers(root); - this.devices = new Resource$Partners$Devices(root); + /** + * Identifies one claim request. + */ + export interface Schema$PartnerClaim { + /** + * Required. The ID of the customer for whom the device is being claimed. + */ + customerId: string; + /** + * Required. Device identifier of the device. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The metadata to attach to the device at claim. + */ + deviceMetadata: Schema$DeviceMetadata; + /** + * Required. The section type of the device's provisioning record. + */ + sectionType: string; } - - getRoot() { - return this.root; + /** + * Identifies one unclaim request. + */ + export interface Schema$PartnerUnclaim { + /** + * Device ID of the device. + */ + deviceId: string; + /** + * Device identifier of the device. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The section type of the device's provisioning record. + */ + sectionType: string; } -} -export class Resource$Partners$Customers { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); + /** + * Captures the processing status for each device in the operation. + */ + export interface Schema$PerDeviceStatusInBatch { + /** + * If processing succeeds, the device ID of the device. + */ + deviceId: string; + /** + * If processing fails, the error type. + */ + errorIdentifier: string; + /** + * If processing fails, a developer message explaining what went wrong. + */ + errorMessage: string; + /** + * The result status of the device after processing. + */ + status: string; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * androiddeviceprovisioning.partners.customers.create - * @desc Creates a customer for zero-touch enrollment. After the method - * returns successfully, admin and owner roles can manage devices and EMM - * configs by calling API methods or using their zero-touch enrollment portal. - * The API doesn't notify the customer that they have access. - * @alias androiddeviceprovisioning.partners.customers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource ID in the format `partners/[PARTNER_ID]` that identifies the reseller. - * @param {().CreateCustomerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/customers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message to unclaim a device. + */ + export interface Schema$UnclaimDeviceRequest { + /** + * The device ID returned by `ClaimDevice`. + */ + deviceId: string; + /** + * The device identifier you used when you claimed this device. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The section type of the device's provisioning record. + */ + sectionType: string; } - - /** - * androiddeviceprovisioning.partners.customers.list - * @desc Lists the customers that are enrolled to the reseller identified by - * the `partnerId` argument. This list includes customers that the reseller - * created and customers that enrolled themselves using the portal. - * @alias androiddeviceprovisioning.partners.customers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to unclaim devices asynchronously in batch. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/customers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Partners$Devices { - root: Androiddeviceprovisioning; - constructor(root: Androiddeviceprovisioning) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$UnclaimDevicesRequest { + /** + * Required. The list of devices to unclaim. + */ + unclaims: Schema$PartnerUnclaim[]; } - - /** - * androiddeviceprovisioning.partners.devices.claim - * @desc Claims a device for a customer and adds it to zero-touch enrollment. - * If the device is already claimed by another customer, the call returns an - * error. - * @alias androiddeviceprovisioning.partners.devices.claim - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {().ClaimDeviceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to update device metadata in batch. */ - claim(params?: any, options?: MethodOptions): - AxiosPromise; - claim( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - claim( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/devices:claim') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$UpdateDeviceMetadataInBatchRequest { + /** + * Required. The list of metadata updates. + */ + updates: Schema$UpdateMetadataArguments[]; } - - /** - * androiddeviceprovisioning.partners.devices.claimAsync - * @desc Claims a batch of devices for a customer asynchronously. Adds the - * devices to zero-touch enrollment. To learn more, read [Long‑running batch - * operations](/zero-touch/guides/how-it-works#operations). - * @alias androiddeviceprovisioning.partners.devices.claimAsync - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {().ClaimDevicesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to set metadata for a device. */ - claimAsync(params?: any, options?: MethodOptions): - AxiosPromise; - claimAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - claimAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/devices:claimAsync') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$UpdateDeviceMetadataRequest { + /** + * Required. The metdata to attach to the device. + */ + deviceMetadata: Schema$DeviceMetadata; } - - /** - * androiddeviceprovisioning.partners.devices.findByIdentifier - * @desc Finds devices by hardware identifiers, such as IMEI. - * @alias androiddeviceprovisioning.partners.devices.findByIdentifier - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {().FindDevicesByDeviceIdentifierRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - findByIdentifier(params?: any, options?: MethodOptions): - AxiosPromise; - findByIdentifier( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - findByIdentifier( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/partners/{+partnerId}/devices:findByIdentifier') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Identifies metdata updates to one device. + */ + export interface Schema$UpdateMetadataArguments { + /** + * Device ID of the device. + */ + deviceId: string; + /** + * Device identifier. + */ + deviceIdentifier: Schema$DeviceIdentifier; + /** + * Required. The metadata to update. + */ + deviceMetadata: Schema$DeviceMetadata; } - - /** - * androiddeviceprovisioning.partners.devices.findByOwner - * @desc Finds devices claimed for customers. The results only contain devices - * registered to the reseller that's identified by the `partnerId` argument. - * The customer's devices purchased from other resellers don't appear in the - * results. - * @alias androiddeviceprovisioning.partners.devices.findByOwner - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {().FindDevicesByOwnerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - findByOwner(params?: any, options?: MethodOptions): - AxiosPromise; - findByOwner( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - findByOwner( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Customers { + root: Androiddeviceprovisioning; + configurations: Resource$Customers$Configurations; + devices: Resource$Customers$Devices; + dpcs: Resource$Customers$Dpcs; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + this.configurations = new Resource$Customers$Configurations(root); + this.devices = new Resource$Customers$Devices(root); + this.dpcs = new Resource$Customers$Dpcs(root); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.customers.list + * @desc Lists the user's customer accounts. + * @alias androiddeviceprovisioning.customers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of customers to show in a page of results. A number between 1 and 100 (inclusive). + * @param {string=} params.pageToken A token specifying which result page to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/customers').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/devices:findByOwner') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Customers$Configurations { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.customers.configurations.create + * @desc Creates a new configuration. Once created, a customer can apply the + * configuration to devices. + * @alias androiddeviceprovisioning.customers.configurations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer that manages the configuration. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {().Configuration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/configurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.configurations.delete + * @desc Deletes an unused configuration. The API call fails if the customer + * has devices with the configuration applied. + * @alias androiddeviceprovisioning.customers.configurations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The configuration to delete. An API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. If the configuration is applied to any devices, the API call fails. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.configurations.get + * @desc Gets the details of a configuration. + * @alias androiddeviceprovisioning.customers.configurations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The configuration to get. An API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.configurations.list + * @desc Lists a customer's configurations. + * @alias androiddeviceprovisioning.customers.configurations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer that manages the listed configurations. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/configurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.configurations.patch + * @desc Updates a configuration's field values. + * @alias androiddeviceprovisioning.customers.configurations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The API resource name in the format `customers/[CUSTOMER_ID]/configurations/[CONFIGURATION_ID]`. Assigned by the server. + * @param {string=} params.updateMask Required. The field mask applied to the target `Configuration` before updating the fields. To learn more about using field masks, read [FieldMask](/protocol-buffers/docs/reference/google.protobuf#fieldmask) in the Protocol Buffers documentation. + * @param {().Configuration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androiddeviceprovisioning.partners.devices.get - * @desc Gets a device. - * @alias androiddeviceprovisioning.partners.devices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The device API resource name in the format `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Customers$Devices { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.customers.devices.applyConfiguration + * @desc Applies a Configuration to the device to register the device for + * zero-touch enrollment. After applying a configuration to a device, the + * device automatically provisions itself on first boot, or next factory + * reset. + * @alias androiddeviceprovisioning.customers.devices.applyConfiguration + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer managing the device. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {().CustomerApplyConfigurationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + applyConfiguration(params?: any, options?: MethodOptions): + AxiosPromise; + applyConfiguration( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + applyConfiguration( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices:applyConfiguration') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.devices.get + * @desc Gets the details of a device. + * @alias androiddeviceprovisioning.customers.devices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The device to get. An API resource name in the format `customers/[CUSTOMER_ID]/devices/[DEVICE_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.devices.list + * @desc Lists a customer's devices. + * @alias androiddeviceprovisioning.customers.devices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageSize The maximum number of devices to show in a page of results. Must be between 1 and 100 inclusive. + * @param {string=} params.pageToken A token specifying which result page to return. + * @param {string} params.parent Required. The customer managing the devices. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.devices.removeConfiguration + * @desc Removes a configuration from device. + * @alias androiddeviceprovisioning.customers.devices.removeConfiguration + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer managing the device in the format `customers/[CUSTOMER_ID]`. + * @param {().CustomerRemoveConfigurationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeConfiguration(params?: any, options?: MethodOptions): + AxiosPromise; + removeConfiguration( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeConfiguration( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices:removeConfiguration') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.customers.devices.unclaim + * @desc Unclaims a device from a customer and removes it from zero-touch + * enrollment. After removing a device, a customer must contact their + * reseller to register the device into zero-touch enrollment again. + * @alias androiddeviceprovisioning.customers.devices.unclaim + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer managing the device. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {().CustomerUnclaimDeviceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unclaim(params?: any, options?: MethodOptions): AxiosPromise; + unclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices:unclaim') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androiddeviceprovisioning.partners.devices.metadata - * @desc Updates reseller metadata associated with the device. - * @alias androiddeviceprovisioning.partners.devices.metadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId Required. The ID of the reseller partner. - * @param {string} params.metadataOwnerId Required. The owner of the newly set metadata. Set this to the partner ID. - * @param {().UpdateDeviceMetadataRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - metadata(params?: any, options?: MethodOptions): - AxiosPromise; - metadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - metadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['metadataOwnerId', 'deviceId'], - pathParams: ['deviceId', 'metadataOwnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Customers$Dpcs { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.customers.dpcs.list + * @desc Lists the DPCs (device policy controllers) that support zero-touch + * enrollment. + * @alias androiddeviceprovisioning.customers.dpcs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The customer that can use the DPCs in configurations. An API resource name in the format `customers/[CUSTOMER_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/dpcs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * androiddeviceprovisioning.partners.devices.unclaim - * @desc Unclaims a device from a customer and removes it from zero-touch - * enrollment. - * @alias androiddeviceprovisioning.partners.devices.unclaim - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The ID of the reseller partner. - * @param {().UnclaimDeviceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unclaim(params?: any, options?: MethodOptions): AxiosPromise; - unclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/devices:unclaim') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Operations { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias androiddeviceprovisioning.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androiddeviceprovisioning.partners.devices.unclaimAsync - * @desc Unclaims a batch of devices for a customer asynchronously. Removes - * the devices from zero-touch enrollment. To learn more, read [Long‑running - * batch operations](/zero-touch/guides/how-it-works#operations). - * @alias androiddeviceprovisioning.partners.devices.unclaimAsync - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The reseller partner ID. - * @param {().UnclaimDevicesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unclaimAsync(params?: any, options?: MethodOptions): - AxiosPromise; - unclaimAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unclaimAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Partners { + root: Androiddeviceprovisioning; + customers: Resource$Partners$Customers; + devices: Resource$Partners$Devices; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + this.customers = new Resource$Partners$Customers(root); + this.devices = new Resource$Partners$Devices(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/partners/{+partnerId}/devices:unclaimAsync') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Partners$Customers { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.partners.customers.create + * @desc Creates a customer for zero-touch enrollment. After the method + * returns successfully, admin and owner roles can manage devices and EMM + * configs by calling API methods or using their zero-touch enrollment + * portal. The API doesn't notify the customer that they have access. + * @alias androiddeviceprovisioning.partners.customers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource ID in the format `partners/[PARTNER_ID]` that identifies the reseller. + * @param {().CreateCustomerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/customers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.customers.list + * @desc Lists the customers that are enrolled to the reseller identified by + * the `partnerId` argument. This list includes customers that the reseller + * created and customers that enrolled themselves using the portal. + * @alias androiddeviceprovisioning.partners.customers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/customers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androiddeviceprovisioning.partners.devices.updateMetadataAsync - * @desc Updates the reseller metadata attached to a batch of devices. This - * method updates devices asynchronously and returns an `Operation` that can - * be used to track progress. Read [Long‑running batch - * operations](/zero-touch/guides/how-it-works#operations). - * @alias androiddeviceprovisioning.partners.devices.updateMetadataAsync - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.partnerId Required. The reseller partner ID. - * @param {().UpdateDeviceMetadataInBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateMetadataAsync(params?: any, options?: MethodOptions): - AxiosPromise; - updateMetadataAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateMetadataAsync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androiddeviceprovisioning.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/partners/{+partnerId}/devices:updateMetadataAsync') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['partnerId'], - pathParams: ['partnerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Partners$Devices { + root: Androiddeviceprovisioning; + constructor(root: Androiddeviceprovisioning) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androiddeviceprovisioning.partners.devices.claim + * @desc Claims a device for a customer and adds it to zero-touch + * enrollment. If the device is already claimed by another customer, the + * call returns an error. + * @alias androiddeviceprovisioning.partners.devices.claim + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {().ClaimDeviceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + claim(params?: any, options?: MethodOptions): + AxiosPromise; + claim( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + claim( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/devices:claim') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.claimAsync + * @desc Claims a batch of devices for a customer asynchronously. Adds the + * devices to zero-touch enrollment. To learn more, read [Long‑running batch + * operations](/zero-touch/guides/how-it-works#operations). + * @alias androiddeviceprovisioning.partners.devices.claimAsync + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {().ClaimDevicesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + claimAsync(params?: any, options?: MethodOptions): + AxiosPromise; + claimAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + claimAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/devices:claimAsync') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.findByIdentifier + * @desc Finds devices by hardware identifiers, such as IMEI. + * @alias androiddeviceprovisioning.partners.devices.findByIdentifier + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {().FindDevicesByDeviceIdentifierRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + findByIdentifier(params?: any, options?: MethodOptions): + AxiosPromise; + findByIdentifier( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + findByIdentifier( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/partners/{+partnerId}/devices:findByIdentifier') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.findByOwner + * @desc Finds devices claimed for customers. The results only contain + * devices registered to the reseller that's identified by the `partnerId` + * argument. The customer's devices purchased from other resellers don't + * appear in the results. + * @alias androiddeviceprovisioning.partners.devices.findByOwner + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {().FindDevicesByOwnerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + findByOwner(params?: any, options?: MethodOptions): + AxiosPromise; + findByOwner( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + findByOwner( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/devices:findByOwner') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.get + * @desc Gets a device. + * @alias androiddeviceprovisioning.partners.devices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The device API resource name in the format `partners/[PARTNER_ID]/devices/[DEVICE_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.metadata + * @desc Updates reseller metadata associated with the device. + * @alias androiddeviceprovisioning.partners.devices.metadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId Required. The ID of the reseller partner. + * @param {string} params.metadataOwnerId Required. The owner of the newly set metadata. Set this to the partner ID. + * @param {().UpdateDeviceMetadataRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + metadata(params?: any, options?: MethodOptions): + AxiosPromise; + metadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + metadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/partners/{+metadataOwnerId}/devices/{+deviceId}/metadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['metadataOwnerId', 'deviceId'], + pathParams: ['deviceId', 'metadataOwnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.unclaim + * @desc Unclaims a device from a customer and removes it from zero-touch + * enrollment. + * @alias androiddeviceprovisioning.partners.devices.unclaim + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The ID of the reseller partner. + * @param {().UnclaimDeviceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unclaim(params?: any, options?: MethodOptions): AxiosPromise; + unclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/devices:unclaim') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.unclaimAsync + * @desc Unclaims a batch of devices for a customer asynchronously. Removes + * the devices from zero-touch enrollment. To learn more, read [Long‑running + * batch operations](/zero-touch/guides/how-it-works#operations). + * @alias androiddeviceprovisioning.partners.devices.unclaimAsync + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The reseller partner ID. + * @param {().UnclaimDevicesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unclaimAsync(params?: any, options?: MethodOptions): + AxiosPromise; + unclaimAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unclaimAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/partners/{+partnerId}/devices:unclaimAsync') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androiddeviceprovisioning.partners.devices.updateMetadataAsync + * @desc Updates the reseller metadata attached to a batch of devices. This + * method updates devices asynchronously and returns an `Operation` that can + * be used to track progress. Read [Long‑running batch + * operations](/zero-touch/guides/how-it-works#operations). + * @alias androiddeviceprovisioning.partners.devices.updateMetadataAsync + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.partnerId Required. The reseller partner ID. + * @param {().UpdateDeviceMetadataInBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateMetadataAsync(params?: any, options?: MethodOptions): + AxiosPromise; + updateMetadataAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateMetadataAsync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://androiddeviceprovisioning.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/partners/{+partnerId}/devices:updateMetadataAsync') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['partnerId'], + pathParams: ['partnerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androidenterprise/v1.ts b/src/apis/androidenterprise/v1.ts index 44f95b632a7..06a9516232b 100644 --- a/src/apis/androidenterprise/v1.ts +++ b/src/apis/androidenterprise/v1.ts @@ -27,6769 +27,6848 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play EMM API - * - * Manages the deployment of apps to Android for Work users. - * - * @example - * const google = require('googleapis'); - * const androidenterprise = google.androidenterprise('v1'); - * - * @namespace androidenterprise - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Androidenterprise - */ -export class Androidenterprise { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - devices: Resource$Devices; - enterprises: Resource$Enterprises; - entitlements: Resource$Entitlements; - grouplicenses: Resource$Grouplicenses; - grouplicenseusers: Resource$Grouplicenseusers; - installs: Resource$Installs; - managedconfigurationsfordevice: Resource$Managedconfigurationsfordevice; - managedconfigurationsforuser: Resource$Managedconfigurationsforuser; - managedconfigurationssettings: Resource$Managedconfigurationssettings; - permissions: Resource$Permissions; - products: Resource$Products; - serviceaccountkeys: Resource$Serviceaccountkeys; - storelayoutclusters: Resource$Storelayoutclusters; - storelayoutpages: Resource$Storelayoutpages; - users: Resource$Users; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.devices = new Resource$Devices(this); - this.enterprises = new Resource$Enterprises(this); - this.entitlements = new Resource$Entitlements(this); - this.grouplicenses = new Resource$Grouplicenses(this); - this.grouplicenseusers = new Resource$Grouplicenseusers(this); - this.installs = new Resource$Installs(this); - this.managedconfigurationsfordevice = - new Resource$Managedconfigurationsfordevice(this); - this.managedconfigurationsforuser = - new Resource$Managedconfigurationsforuser(this); - this.managedconfigurationssettings = - new Resource$Managedconfigurationssettings(this); - this.permissions = new Resource$Permissions(this); - this.products = new Resource$Products(this); - this.serviceaccountkeys = new Resource$Serviceaccountkeys(this); - this.storelayoutclusters = new Resource$Storelayoutclusters(this); - this.storelayoutpages = new Resource$Storelayoutpages(this); - this.users = new Resource$Users(this); - } - - getRoot() { - return this.root; - } -} - -/** - * This represents an enterprise admin who can manage the enterprise in the - * managed Google Play store. - */ -export interface Schema$Administrator { - /** - * The admin's email address. - */ - email: string; -} -/** - * A token authorizing an admin to access an iframe. - */ -export interface Schema$AdministratorWebToken { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#administratorWebToken". - */ - kind: string; - /** - * An opaque token to be passed to the Play front-end to generate an iframe. - */ - token: string; -} -/** - * Specification for a token used to generate iframes. The token specifies what - * data the admin is allowed to modify and the URI the iframe is allowed to - * communiate with. - */ -export interface Schema$AdministratorWebTokenSpec { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#administratorWebTokenSpec". - */ - kind: string; - /** - * The URI of the parent frame hosting the iframe. To prevent XSS, the iframe - * may not be hosted at other URIs. This URI must be https. - */ - parent: string; - /** - * The list of permissions the admin is granted within the iframe. The admin - * will only be allowed to view an iframe if they have all of the permissions - * associated with it. The only valid value is "approveApps" that - * will allow the admin to access the iframe in "approve" mode. - */ - permission: string[]; -} -/** - * The Android Device Policy configuration of an enterprise. - */ -export interface Schema$AndroidDevicePolicyConfig { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#androidDevicePolicyConfig". - */ - kind: string; - /** - * The state of Android Device Policy. "enabled" indicates that - * Android Device Policy is enabled for the enterprise and the EMM is allowed - * to manage devices with Android Device Policy, while "disabled" - * means that it cannot. - */ - state: string; -} -/** - * Represents the list of app restrictions available to be pre-configured for - * the product. - */ -export interface Schema$AppRestrictionsSchema { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#appRestrictionsSchema". - */ - kind: string; - /** - * The set of restrictions that make up this schema. - */ - restrictions: Schema$AppRestrictionsSchemaRestriction[]; -} -/** - * An event generated when a new app version is uploaded to Google Play and its - * app restrictions schema changed. To fetch the app restrictions schema for an - * app, use Products.getAppRestrictionsSchema on the EMM API. - */ -export interface Schema$AppRestrictionsSchemaChangeEvent { - /** - * The id of the product (e.g. "app:com.google.android.gm") for - * which the app restriction schema changed. This field will always be - * present. - */ - productId: string; -} -/** - * A restriction in the App Restriction Schema represents a piece of - * configuration that may be pre-applied. - */ -export interface Schema$AppRestrictionsSchemaRestriction { - /** - * The default value of the restriction. bundle and bundleArray restrictions - * never have a default value. - */ - defaultValue: Schema$AppRestrictionsSchemaRestrictionRestrictionValue; - /** - * A longer description of the restriction, giving more detail of what it - * affects. - */ - description: string; - /** - * For choice or multiselect restrictions, the list of possible entries' - * human-readable names. - */ - entry: string[]; - /** - * For choice or multiselect restrictions, the list of possible entries' - * machine-readable values. These values should be used in the configuration, - * either as a single string value for a choice restriction or in a - * stringArray for a multiselect restriction. - */ - entryValue: string[]; - /** - * The unique key that the product uses to identify the restriction, e.g. - * "com.google.android.gm.fieldname". - */ - key: string; - /** - * For bundle or bundleArray restrictions, the list of nested restrictions. A - * bundle restriction is always nested within a bundleArray restriction, and a - * bundleArray restriction is at most two levels deep. - */ - nestedRestriction: Schema$AppRestrictionsSchemaRestriction[]; - /** - * The type of the restriction. - */ - restrictionType: string; - /** - * The name of the restriction. - */ - title: string; -} -/** - * A typed value for the restriction. - */ -export interface Schema$AppRestrictionsSchemaRestrictionRestrictionValue { - /** - * The type of the value being provided. - */ - type: string; - /** - * The boolean value - this will only be present if type is bool. - */ - valueBool: boolean; - /** - * The integer value - this will only be present if type is integer. - */ - valueInteger: number; - /** - * The list of string values - this will only be present if type is - * multiselect. - */ - valueMultiselect: string[]; - /** - * The string value - this will be present for types string, choice and - * hidden. - */ - valueString: string; -} -/** - * Information on an approval URL. - */ -export interface Schema$ApprovalUrlInfo { - /** - * A URL that displays a product's permissions and that can also be used - * to approve the product with the Products.approve call. - */ - approvalUrl: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#approvalUrlInfo". - */ - kind: string; -} -/** - * An event generated when a new version of an app is uploaded to Google Play. - * Notifications are sent for new public versions only: alpha, beta, or canary - * versions do not generate this event. To fetch up-to-date version history for - * an app, use Products.Get on the EMM API. - */ -export interface Schema$AppUpdateEvent { - /** - * The id of the product (e.g. "app:com.google.android.gm") that was - * updated. This field will always be present. - */ - productId: string; -} -/** - * This represents a single version of the app. - */ -export interface Schema$AppVersion { - /** - * The track that this app was published in. For example if track is - * "alpha", this is an alpha version of the app. - */ - track: string; - /** - * Unique increasing identifier for the app version. - */ - versionCode: number; - /** - * The string used in the Play store by the app developer to identify the - * version. The string is not necessarily unique or localized (for example, - * the string could be "1.4"). - */ - versionString: string; -} -/** - * An AuthenticationToken is used by the EMM's device policy client on a - * device to provision the given EMM-managed user on that device. - */ -export interface Schema$AuthenticationToken { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#authenticationToken". - */ - kind: string; - /** - * The authentication token to be passed to the device policy client on the - * device where it can be used to provision the account for which this token - * was generated. - */ - token: string; -} -/** - * A configuration variables resource contains the managed configuration - * settings ID to be applied to a single user, as well as the variable set that - * is attributed to the user. The variable set will be used to replace - * placeholders in the managed configuration settings. - */ -export interface Schema$ConfigurationVariables { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#configurationVariables". - */ - kind: string; - /** - * The ID of the managed configurations settings. - */ - mcmId: string; - /** - * The variable set that is attributed to the user. - */ - variableSet: Schema$VariableSet[]; -} -/** - * A Devices resource represents a mobile device managed by the EMM and - * belonging to a specific enterprise user. - */ -export interface Schema$Device { - /** - * The Google Play Services Android ID for the device encoded as a lowercase - * hex string. For example, "123456789abcdef0". - */ - androidId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#device". - */ - kind: string; - /** - * Identifies the extent to which the device is controlled by a managed Google - * Play EMM in various deployment configurations. Possible values include: - - * "managedDevice", a device that has the EMM's device policy - * controller (DPC) as the device owner. - "managedProfile", a - * device that has a profile managed by the DPC (DPC is profile owner) in - * addition to a separate, personal profile that is unavailable to the DPC. - - * "containerApp", no longer used (deprecated). - - * "unmanagedProfile", a device that has been allowed (by the - * domain's admin, using the Admin Console to enable the privilege) to use - * managed Google Play, but the profile is itself not owned by a DPC. - */ - managementType: string; - /** - * The policy enforced on the device. - */ - policy: Schema$Policy; -} -/** - * The device resources for the user. - */ -export interface Schema$DevicesListResponse { - /** - * A managed device. - */ - device: Schema$Device[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#devicesListResponse". - */ - kind: string; -} -/** - * The state of a user's device, as accessed by the getState and setState - * methods on device resources. - */ -export interface Schema$DeviceState { - /** - * The state of the Google account on the device. "enabled" - * indicates that the Google account on the device can be used to access - * Google services (including Google Play), while "disabled" means - * that it cannot. A new device is initially in the "disabled" - * state. - */ - accountState: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#deviceState". - */ - kind: string; -} -/** - * An Enterprises resource represents the binding between an EMM and a specific - * organization. That binding can be instantiated in one of two different ways - * using this API as follows: - For Google managed domain customers, the - * process involves using Enterprises.enroll and Enterprises.setAccount (in - * conjunction with artifacts obtained from the Admin console and the Google API - * Console) and submitted to the EMM through a more-or-less manual process. - - * For managed Google Play Accounts customers, the process involves using - * Enterprises.generateSignupUrl and Enterprises.completeSignup in conjunction - * with the managed Google Play sign-up UI (Google-provided mechanism) to create - * the binding without manual steps. As an EMM, you can support either or both - * approaches in your EMM console. See Create an Enterprise for details. - */ -export interface Schema$Enterprise { - /** - * Admins of the enterprise. This is only supported for enterprises created - * via the EMM-initiated flow. - */ - administrator: Schema$Administrator[]; - /** - * The unique ID for the enterprise. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#enterprise". - */ - kind: string; - /** - * The name of the enterprise, for example, "Example, Inc". - */ - name: string; - /** - * The enterprise's primary domain, such as "example.com". - */ - primaryDomain: string; -} -/** - * A service account that can be used to authenticate as the enterprise to API - * calls that require such authentication. - */ -export interface Schema$EnterpriseAccount { - /** - * The email address of the service account. - */ - accountEmail: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#enterpriseAccount". - */ - kind: string; -} -/** - * The matching enterprise resources. - */ -export interface Schema$EnterprisesListResponse { - /** - * An enterprise. - */ - enterprise: Schema$Enterprise[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#enterprisesListResponse". - */ - kind: string; -} -export interface Schema$EnterprisesSendTestPushNotificationResponse { - /** - * The message ID of the test push notification that was sent. - */ - messageId: string; - /** - * The name of the Cloud Pub/Sub topic to which notifications for this - * enterprise's enrolled account will be sent. - */ - topicName: string; -} -/** - * The presence of an Entitlements resource indicates that a user has the right - * to use a particular app. Entitlements are user specific, not device specific. - * This allows a user with an entitlement to an app to install the app on all - * their devices. It's also possible for a user to hold an entitlement to an - * app without installing the app on any device. The API can be used to create - * an entitlement. As an option, you can also use the API to trigger the - * installation of an app on all a user's managed devices at the same time - * the entitlement is created. If the app is free, creating the entitlement - * also creates a group license for that app. For paid apps, creating the - * entitlement consumes one license, and that license remains consumed until the - * entitlement is removed. If the enterprise hasn't purchased enough - * licenses, then no entitlement is created and the installation fails. An - * entitlement is also not created for an app if the app requires permissions - * that the enterprise hasn't accepted. If an entitlement is deleted, the - * app may be uninstalled from a user's device. As a best practice, - * uninstall the app by calling Installs.delete() before deleting the - * entitlement. Entitlements for apps that a user pays for on an unmanaged - * profile have "userPurchase" as the entitlement reason. These - * entitlements cannot be removed via the API. - */ -export interface Schema$Entitlement { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#entitlement". - */ - kind: string; - /** - * The ID of the product that the entitlement is for. For example, - * "app:com.google.android.gm". - */ - productId: string; - /** - * The reason for the entitlement. For example, "free" for free - * apps. This property is temporary: it will be replaced by the acquisition - * kind field of group licenses. - */ - reason: string; -} -/** - * The entitlement resources for the user. - */ -export interface Schema$EntitlementsListResponse { - /** - * An entitlement of a user to a product (e.g. an app). For example, a free - * app that they have installed, or a paid app that they have been allocated a - * license to. - */ - entitlement: Schema$Entitlement[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#entitlementsListResponse". - */ - kind: string; -} -/** - * Group license objects allow you to keep track of licenses (called - * entitlements) for both free and paid apps. For a free app, a group license is - * created when an enterprise admin first approves the product in Google Play or - * when the first entitlement for the product is created for a user via the API. - * For a paid app, a group license object is only created when an enterprise - * admin purchases the product in Google Play for the first time. Use the API - * to query group licenses. A Grouplicenses resource includes the total number - * of licenses purchased (paid apps only) and the total number of licenses - * currently in use. In other words, the total number of Entitlements that exist - * for the product. Only one group license object is created per product and - * group license objects are never deleted. If a product is unapproved, its - * group license remains. This allows enterprise admins to keep track of any - * remaining entitlements for the product. - */ -export interface Schema$GroupLicense { - /** - * How this group license was acquired. "bulkPurchase" means that - * this Grouplicenses resource was created because the enterprise purchased - * licenses for this product; otherwise, the value is "free" (for - * free products). - */ - acquisitionKind: string; - /** - * Whether the product to which this group license relates is currently - * approved by the enterprise. Products are approved when a group license is - * first created, but this approval may be revoked by an enterprise admin via - * Google Play. Unapproved products will not be visible to end users in - * collections, and new entitlements to them should not normally be created. - */ - approval: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#groupLicense". - */ - kind: string; - /** - * The total number of provisioned licenses for this product. Returned by read - * operations, but ignored in write operations. - */ - numProvisioned: number; - /** - * The number of purchased licenses (possibly in multiple purchases). If this - * field is omitted, then there is no limit on the number of licenses that can - * be provisioned (for example, if the acquisition kind is "free"). - */ - numPurchased: number; - /** - * The permission approval status of the product. This field is only set if - * the product is approved. Possible states are: - - * "currentApproved", the current set of permissions is approved, - * but additional permissions will require the administrator to reapprove the - * product (If the product was approved without specifying the approved - * permissions setting, then this is the default behavior.), - - * "needsReapproval", the product has unapproved permissions. No - * additional product licenses can be assigned until the product is - * reapproved, - "allCurrentAndFutureApproved", the current - * permissions are approved and any future permission updates will be - * automatically approved without administrator review. - */ - permissions: string; - /** - * The ID of the product that the license is for. For example, - * "app:com.google.android.gm". - */ - productId: string; -} -/** - * The grouplicense resources for the enterprise. - */ -export interface Schema$GroupLicensesListResponse { - /** - * A group license for a product approved for use in the enterprise. - */ - groupLicense: Schema$GroupLicense[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#groupLicensesListResponse". - */ - kind: string; -} -/** - * The user resources for the group license. - */ -export interface Schema$GroupLicenseUsersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#groupLicenseUsersListResponse". - */ - kind: string; - /** - * A user of an enterprise. - */ - user: Schema$User[]; -} -/** - * The existence of an Installs resource indicates that an app is installed on a - * particular device (or that an install is pending). The API can be used to - * create an install resource using the update method. This triggers the actual - * install of the app on the device. If the user does not already have an - * entitlement for the app, then an attempt is made to create one. If this fails - * (for example, because the app is not free and there is no available license), - * then the creation of the install fails. The API can also be used to update - * an installed app. If the update method is used on an existing install, then - * the app will be updated to the latest available version. Note that it is not - * possible to force the installation of a specific version of an app: the - * version code is read-only. If a user installs an app themselves (as - * permitted by the enterprise), then again an install resource and possibly an - * entitlement resource are automatically created. The API can also be used to - * delete an install resource, which triggers the removal of the app from the - * device. Note that deleting an install does not automatically remove the - * corresponding entitlement, even if there are no remaining installs. The - * install resource will also be deleted if the user uninstalls the app - * themselves. - */ -export interface Schema$Install { - /** - * Install state. The state "installPending" means that an install - * request has recently been made and download to the device is in progress. - * The state "installed" means that the app has been installed. This - * field is read-only. - */ - installState: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#install". - */ - kind: string; - /** - * The ID of the product that the install is for. For example, - * "app:com.google.android.gm". - */ - productId: string; - /** - * The version of the installed product. Guaranteed to be set only if the - * install state is "installed". - */ - versionCode: number; -} -/** - * An event generated when an app installation failed on a device - */ -export interface Schema$InstallFailureEvent { - /** - * The Android ID of the device. This field will always be present. - */ - deviceId: string; - /** - * Additional details on the failure if applicable. - */ - failureDetails: string; - /** - * The reason for the installation failure. This field will always be present. - */ - failureReason: string; - /** - * The id of the product (e.g. "app:com.google.android.gm") for - * which the install failure event occured. This field will always be present. - */ - productId: string; - /** - * The ID of the user. This field will always be present. - */ - userId: string; -} -/** - * The install resources for the device. - */ -export interface Schema$InstallsListResponse { - /** - * An installation of an app for a user on a specific device. The existence of - * an install implies that the user must have an entitlement to the app. - */ - install: Schema$Install[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#installsListResponse". - */ - kind: string; -} -/** - * A localized string with its locale. - */ -export interface Schema$LocalizedText { - /** - * The BCP47 tag for a locale. (e.g. "en-US", "de"). - */ - locale: string; - /** - * The text localized in the associated locale. - */ - text: string; -} -/** - * Maintenance window for managed Google Play Accounts. This allows Play store - * to update the apps on the foreground in the designated window. - */ -export interface Schema$MaintenanceWindow { - /** - * Duration of the maintenance window, in milliseconds. The duration must be - * between 30 minutes and 24 hours (inclusive). - */ - durationMs: string; - /** - * Start time of the maintenance window, in milliseconds after midnight on the - * device. Windows can span midnight. - */ - startTimeAfterMidnightMs: string; -} -/** - * A managed configuration resource contains the set of managed properties - * defined by the app developer in the app's managed configurations schema, - * as well as any configuration variables defined for the user. - */ -export interface Schema$ManagedConfiguration { - /** - * Contains the ID of the managed configuration profile and the set of - * configuration variables (if any) defined for the user. - */ - configurationVariables: Schema$ConfigurationVariables; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#managedConfiguration". - */ - kind: string; - /** - * The set of managed properties for this configuration. - */ - managedProperty: Schema$ManagedProperty[]; - /** - * The ID of the product that the managed configuration is for, e.g. - * "app:com.google.android.gm". - */ - productId: string; -} -/** - * The managed configuration resources for the device. - */ -export interface Schema$ManagedConfigurationsForDeviceListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#managedConfigurationsForDeviceListResponse". - */ - kind: string; - /** - * A managed configuration for an app on a specific device. - */ - managedConfigurationForDevice: Schema$ManagedConfiguration[]; -} -/** - * The managed configuration resources for the user. - */ -export interface Schema$ManagedConfigurationsForUserListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#managedConfigurationsForUserListResponse". - */ - kind: string; - /** - * A managed configuration for an app for a specific user. - */ - managedConfigurationForUser: Schema$ManagedConfiguration[]; -} -/** - * A managed configurations settings resource contains the set of managed - * properties that have been configured for an Android app to be applied to a - * set of users. The app's developer would have defined configurable - * properties in the managed configurations schema. - */ -export interface Schema$ManagedConfigurationsSettings { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#managedConfigurationsSettings". - */ - kind: string; - /** - * The last updated time of the managed configuration settings in milliseconds - * since 1970-01-01T00:00:00Z. - */ - lastUpdatedTimestampMillis: string; - /** - * The set of managed properties for this configuration. - */ - managedProperty: Schema$ManagedProperty[]; - /** - * The ID of the managed configurations settings. - */ - mcmId: string; - /** - * The name of the managed configurations settings. - */ - name: string; -} -/** - * The managed configurations settings for a product. - */ -export interface Schema$ManagedConfigurationsSettingsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#managedConfigurationsSettingsListResponse". - */ - kind: string; - /** - * A managed configurations settings for an app that may be assigned to a - * group of users in an enterprise. - */ - managedConfigurationsSettings: Schema$ManagedConfigurationsSettings[]; -} -/** - * A managed property of a managed configuration. The property must match one of - * the properties in the app restrictions schema of the product. Exactly one of - * the value fields must be populated, and it must match the property's type - * in the app restrictions schema. - */ -export interface Schema$ManagedProperty { - /** - * The unique key that identifies the property. - */ - key: string; - /** - * The boolean value - this will only be present if type of the property is - * bool. - */ - valueBool: boolean; - /** - * The bundle of managed properties - this will only be present if type of the - * property is bundle. - */ - valueBundle: Schema$ManagedPropertyBundle; - /** - * The list of bundles of properties - this will only be present if type of - * the property is bundle_array. - */ - valueBundleArray: Schema$ManagedPropertyBundle[]; - /** - * The integer value - this will only be present if type of the property is - * integer. - */ - valueInteger: number; - /** - * The string value - this will only be present if type of the property is - * string, choice or hidden. - */ - valueString: string; - /** - * The list of string values - this will only be present if type of the - * property is multiselect. - */ - valueStringArray: string[]; -} -/** - * A bundle of managed properties. - */ -export interface Schema$ManagedPropertyBundle { - /** - * The list of managed properties. - */ - managedProperty: Schema$ManagedProperty[]; -} -/** - * An event generated when a new device is ready to be managed. - */ -export interface Schema$NewDeviceEvent { - /** - * The Android ID of the device. This field will always be present. - */ - deviceId: string; - /** - * Policy app on the device. - */ - dpcPackageName: string; - /** - * Identifies the extent to which the device is controlled by an Android EMM - * in various deployment configurations. Possible values include: - - * "managedDevice", a device where the DPC is set as device owner, - * - "managedProfile", a device where the DPC is set as profile - * owner. - */ - managementType: string; - /** - * The ID of the user. This field will always be present. - */ - userId: string; -} -/** - * An event generated when new permissions are added to an app. - */ -export interface Schema$NewPermissionsEvent { - /** - * The set of permissions that the enterprise admin has already approved for - * this application. Use Permissions.Get on the EMM API to retrieve details - * about these permissions. - */ - approvedPermissions: string[]; - /** - * The id of the product (e.g. "app:com.google.android.gm") for - * which new permissions were added. This field will always be present. - */ - productId: string; - /** - * The set of permissions that the app is currently requesting. Use - * Permissions.Get on the EMM API to retrieve details about these permissions. - */ - requestedPermissions: string[]; -} -/** - * A notification of one event relating to an enterprise. - */ -export interface Schema$Notification { - /** - * Notifications about new app restrictions schema changes. - */ - appRestrictionsSchemaChangeEvent: Schema$AppRestrictionsSchemaChangeEvent; - /** - * Notifications about app updates. - */ - appUpdateEvent: Schema$AppUpdateEvent; - /** - * The ID of the enterprise for which the notification is sent. This will - * always be present. - */ - enterpriseId: string; - /** - * Notifications about an app installation failure. - */ - installFailureEvent: Schema$InstallFailureEvent; - /** - * Notifications about new devices. - */ - newDeviceEvent: Schema$NewDeviceEvent; - /** - * Notifications about new app permissions. - */ - newPermissionsEvent: Schema$NewPermissionsEvent; - /** - * Type of the notification. - */ - notificationType: string; - /** - * Notifications about changes to a product's approval status. - */ - productApprovalEvent: Schema$ProductApprovalEvent; - /** - * Notifications about product availability changes. - */ - productAvailabilityChangeEvent: Schema$ProductAvailabilityChangeEvent; - /** - * The time when the notification was published in milliseconds since - * 1970-01-01T00:00:00Z. This will always be present. - */ - timestampMillis: string; -} -/** - * A resource returned by the PullNotificationSet API, which contains a - * collection of notifications for enterprises associated with the service - * account authenticated for the request. - */ -export interface Schema$NotificationSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#notificationSet". - */ - kind: string; - /** - * The notifications received, or empty if no notifications are present. - */ - notification: Schema$Notification[]; - /** - * The notification set ID, required to mark the notification as received with - * the Enterprises.AcknowledgeNotification API. This will be omitted if no - * notifications are present. - */ - notificationSetId: string; -} -export interface Schema$PageInfo { - resultPerPage: number; - startIndex: number; - totalResults: number; -} -/** - * A Permissions resource represents some extra capability, to be granted to an - * Android app, which requires explicit consent. An enterprise admin must - * consent to these permissions on behalf of their users before an entitlement - * for the app can be created. The permissions collection is read-only. The - * information provided for each permission (localized name and description) is - * intended to be used in the MDM user interface when obtaining consent from the - * enterprise. - */ -export interface Schema$Permission { - /** - * A longer description of the Permissions resource, giving more details of - * what it affects. - */ - description: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#permission". - */ - kind: string; - /** - * The name of the permission. - */ - name: string; - /** - * An opaque string uniquely identifying the permission. - */ - permissionId: string; -} -/** - * The device policy for a given managed device. - */ -export interface Schema$Policy { - /** - * The auto-update policy for apps installed on the device. - * "choiceToTheUser" allows the device's user to configure the - * app update policy. "always" enables auto updates. - * "never" disables auto updates. "wifiOnly" enables auto - * updates only when the device is connected to wifi. - */ - autoUpdatePolicy: string; - /** - * The maintenance window defining when apps running in the foreground should - * be updated. - */ - maintenanceWindow: Schema$MaintenanceWindow; - /** - * The availability granted to the device for the specified products. - * "all" gives the device access to all products, regardless of - * approval status. "allApproved" entitles the device to access all - * products that are approved for the enterprise. "allApproved" and - * "all" do not enable automatic visibility of "alpha" or - * "beta" tracks. "whitelist" grants the device access the - * products specified in productPolicy[]. Only products that are approved or - * products that were previously approved (products with revoked approval) by - * the enterprise can be whitelisted. If no value is provided, the - * availability set at the user level is applied by default. - */ - productAvailabilityPolicy: string; - /** - * The list of product policies. - */ - productPolicy: Schema$ProductPolicy[]; -} -/** - * A Products resource represents an app in the Google Play store that is - * available to at least some users in the enterprise. (Some apps are restricted - * to a single enterprise, and no information about them is made available - * outside that enterprise.) The information provided for each product - * (localized name, icon, link to the full Google Play details page) is intended - * to allow a basic representation of the product within an EMM user interface. - */ -export interface Schema$Product { - /** - * App versions currently available for this product. - */ - appVersion: Schema$AppVersion[]; - /** - * The name of the author of the product (for example, the app developer). - */ - authorName: string; - /** - * The countries which this app is available in. - */ - availableCountries: string[]; - /** - * The tracks that are visible to the enterprise. - */ - availableTracks: string[]; - /** - * The app category (e.g. RACING, SOCIAL, etc.) - */ - category: string; - /** - * The content rating for this app. - */ - contentRating: string; - /** - * The localized promotional description, if available. - */ - description: string; - /** - * A link to the (consumer) Google Play details page for the product. - */ - detailsUrl: string; - /** - * How and to whom the package is made available. The value publicGoogleHosted - * means that the package is available through the Play store and not - * restricted to a specific enterprise. The value privateGoogleHosted means - * that the package is a private app (restricted to an enterprise) but hosted - * by Google. The value privateSelfHosted means that the package is a private - * app (restricted to an enterprise) and is privately hosted. - */ - distributionChannel: string; - /** - * A link to an image that can be used as an icon for the product. This image - * is suitable for use at up to 512px x 512px. - */ - iconUrl: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#product". - */ - kind: string; - /** - * The approximate time (within 7 days) the app was last published, expressed - * in milliseconds since epoch. - */ - lastUpdatedTimestampMillis: string; - /** - * The minimum Android SDK necessary to run the app. - */ - minAndroidSdkVersion: number; - /** - * A list of permissions required by the app. - */ - permissions: Schema$ProductPermission[]; - /** - * A string of the form app:<package name>. For example, - * app:com.google.android.gm represents the Gmail app. - */ - productId: string; - /** - * Whether this product is free, free with in-app purchases, or paid. If the - * pricing is unknown, this means the product is not generally available - * anymore (even though it might still be available to people who own it). - */ - productPricing: string; - /** - * A description of the recent changes made to the app. - */ - recentChanges: string; - /** - * Deprecated. - */ - requiresContainerApp: boolean; - /** - * A list of screenshot links representing the app. - */ - screenshotUrls: string[]; - /** - * The certificate used to sign this product. - */ - signingCertificate: Schema$ProductSigningCertificate; - /** - * A link to a smaller image that can be used as an icon for the product. This - * image is suitable for use at up to 128px x 128px. - */ - smallIconUrl: string; - /** - * The name of the product. - */ - title: string; - /** - * A link to the managed Google Play details page for the product, for use by - * an Enterprise admin. - */ - workDetailsUrl: string; -} -/** - * An event generated when a product's approval status is changed. - */ -export interface Schema$ProductApprovalEvent { - /** - * Whether the product was approved or unapproved. This field will always be - * present. - */ - approved: string; - /** - * The id of the product (e.g. "app:com.google.android.gm") for - * which the approval status has changed. This field will always be present. - */ - productId: string; -} -/** - * An event generated whenever a product's availability changes. - */ -export interface Schema$ProductAvailabilityChangeEvent { - /** - * The new state of the product. This field will always be present. - */ - availabilityStatus: string; - /** - * The id of the product (e.g. "app:com.google.android.gm") for - * which the product availability changed. This field will always be present. - */ - productId: string; -} -/** - * A product permissions resource represents the set of permissions required by - * a specific app and whether or not they have been accepted by an enterprise - * admin. The API can be used to read the set of permissions, and also to - * update the set to indicate that permissions have been accepted. - */ -export interface Schema$ProductPermission { - /** - * An opaque string uniquely identifying the permission. - */ - permissionId: string; - /** - * Whether the permission has been accepted or not. - */ - state: string; -} -/** - * Information about the permissions required by a specific app and whether they - * have been accepted by the enterprise. - */ -export interface Schema$ProductPermissions { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#productPermissions". - */ - kind: string; - /** - * The permissions required by the app. - */ - permission: Schema$ProductPermission[]; - /** - * The ID of the app that the permissions relate to, e.g. - * "app:com.google.android.gm". - */ - productId: string; -} -/** - * The policy for a product. - */ -export interface Schema$ProductPolicy { - /** - * The ID of the product. For example, "app:com.google.android.gm". - */ - productId: string; - /** - * Grants visibility to the specified track(s) of the product to the device. - * The track available to the device is based on the following order of - * preference: alpha, beta, production. For example, if an app has a prod - * version, a beta version and an alpha version and the enterprise has been - * granted visibility to both the alpha and beta tracks, if tracks is - * {"beta", "production"} then the beta version of the app - * is made available to the device. If there are no app versions in the - * specified track adding the "alpha" and "beta" values to - * the list of tracks will have no effect. Note that the enterprise requires - * access to alpha and/or beta tracks before users can be granted visibility - * to apps in those tracks. The allowed sets are: {} (considered equivalent - * to {"production"}) {"production"} {"beta", - * "production"} {"alpha", "beta", - * "production"} The order of elements is not relevant. Any other - * set of tracks will be rejected with an error. - */ - tracks: string[]; -} -export interface Schema$ProductsApproveRequest { - /** - * The approval URL that was shown to the user. Only the permissions shown to - * the user with that URL will be accepted, which may not be the product's - * entire set of permissions. For example, the URL may only display new - * permissions from an update after the product was approved, or not include - * new permissions if the product was updated since the URL was generated. - */ - approvalUrlInfo: Schema$ApprovalUrlInfo; - /** - * Sets how new permission requests for the product are handled. - * "allPermissions" automatically approves all current and future - * permissions for the product. "currentPermissionsOnly" approves - * the current set of permissions for the product, but any future permissions - * added through updates will require manual reapproval. If not specified, - * only the current set of permissions will be approved. - */ - approvedPermissions: string; -} -/** - * A set of products. - */ -export interface Schema$ProductSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#productSet". - */ - kind: string; - /** - * The list of product IDs making up the set of products. - */ - productId: string[]; - /** - * The interpretation of this product set. "unknown" should never be - * sent and is ignored if received. "whitelist" means that the user - * is entitled to access the product set. "includeAll" means that - * all products are accessible, including products that are approved, products - * with revoked approval, and products that have never been approved. - * "allApproved" means that the user is entitled to access all - * products that are approved for the enterprise. If the value is - * "allApproved" or "includeAll", the productId field is - * ignored. If no value is provided, it is interpreted as - * "whitelist" for backwards compatibility. Further - * "allApproved" or "includeAll" does not enable automatic - * visibility of "alpha" or "beta" tracks for Android app. - * Use ProductVisibility to enable "alpha" or "beta" - * tracks per user. - */ - productSetBehavior: string; - /** - * Additional list of product IDs making up the product set. Unlike the - * productID array, in this list It's possible to specify which tracks - * (alpha, beta, production) of a product are visible to the user. See - * ProductVisibility and its fields for more information. Specifying the same - * product ID both here and in the productId array is not allowed and it will - * result in an error. - */ - productVisibility: Schema$ProductVisibility[]; -} -export interface Schema$ProductsGenerateApprovalUrlResponse { - /** - * A URL that can be rendered in an iframe to display the permissions (if any) - * of a product. This URL can be used to approve the product only once and - * only within 24 hours of being generated, using the Products.approve call. - * If the product is currently unapproved and has no permissions, this URL - * will point to an empty page. If the product is currently approved, a URL - * will only be generated if that product has added permissions since it was - * last approved, and the URL will only display those new permissions that - * have not yet been accepted. - */ - url: string; -} -export interface Schema$ProductSigningCertificate { - /** - * The base64 urlsafe encoded SHA1 hash of the certificate. (This field is - * deprecated in favor of SHA2-256. It should not be used and may be removed - * at any time.) - */ - certificateHashSha1: string; - /** - * The base64 urlsafe encoded SHA2-256 hash of the certificate. - */ - certificateHashSha256: string; -} -/** - * The matching products. - */ -export interface Schema$ProductsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#productsListResponse". - */ - kind: string; - /** - * General pagination information. - */ - pageInfo: Schema$PageInfo; - /** - * Information about a product (e.g. an app) in the Google Play store, for - * display to an enterprise admin. - */ - product: Schema$Product[]; - /** - * Pagination information for token pagination. - */ - tokenPagination: Schema$TokenPagination; -} -/** - * A product to be made visible to a user. - */ -export interface Schema$ProductVisibility { - /** - * The product ID to make visible to the user. Required for each item in the - * productVisibility list. - */ - productId: string; - /** - * Grants visibility to the specified track(s) of the product to the user. The - * track available to the user is based on the following order of preference: - * alpha, beta, production. For example, if an app has a prod version, a beta - * version and an alpha version and the enterprise has been granted visibility - * to both the alpha and beta tracks, if tracks is {"beta", - * "production"} the user will be able to install the app and they - * will get the beta version of the app. If there are no app versions in the - * specified track adding the "alpha" and "beta" values to - * the list of tracks will have no effect. Note that the enterprise requires - * access to alpha and/or beta tracks before users can be granted visibility - * to apps in those tracks. The allowed sets are: {} (considered equivalent - * to {"production"}) {"production"} {"beta", - * "production"} {"alpha", "beta", - * "production"} The order of elements is not relevant. Any other - * set of tracks will be rejected with an error. - */ - tracks: string[]; -} -/** - * A service account identity, including the name and credentials that can be - * used to authenticate as the service account. - */ -export interface Schema$ServiceAccount { - /** - * Credentials that can be used to authenticate as this ServiceAccount. - */ - key: Schema$ServiceAccountKey; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#serviceAccount". - */ - kind: string; - /** - * The account name of the service account, in the form of an email address. - * Assigned by the server. - */ - name: string; -} -/** - * Credentials that can be used to authenticate as a service account. - */ -export interface Schema$ServiceAccountKey { - /** - * The body of the private key credentials file, in string format. This is - * only populated when the ServiceAccountKey is created, and is not stored by - * Google. - */ - data: string; - /** - * An opaque, unique identifier for this ServiceAccountKey. Assigned by the - * server. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#serviceAccountKey". - */ - kind: string; - /** - * Public key data for the credentials file. This is an X.509 cert. If you are - * using the googleCredentials key type, this is identical to the cert that - * can be retrieved by using the X.509 cert url inside of the credentials - * file. - */ - publicData: string; - /** - * The file format of the generated key data. - */ - type: string; -} -export interface Schema$ServiceAccountKeysListResponse { - /** - * The service account credentials. - */ - serviceAccountKey: Schema$ServiceAccountKey[]; -} -/** - * A resource returned by the GenerateSignupUrl API, which contains the Signup - * URL and Completion Token. - */ -export interface Schema$SignupInfo { - /** - * An opaque token that will be required, along with the Enterprise Token, for - * obtaining the enterprise resource from CompleteSignup. - */ - completionToken: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#signupInfo". - */ - kind: string; - /** - * A URL under which the Admin can sign up for an enterprise. The page pointed - * to cannot be rendered in an iframe. - */ - url: string; -} -/** - * Definition of a managed Google Play store cluster, a list of products - * displayed as part of a store page. - */ -export interface Schema$StoreCluster { - /** - * Unique ID of this cluster. Assigned by the server. Immutable once assigned. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#storeCluster". - */ - kind: string; - /** - * Ordered list of localized strings giving the name of this page. The text - * displayed is the one that best matches the user locale, or the first entry - * if there is no good match. There needs to be at least one entry. - */ - name: Schema$LocalizedText[]; - /** - * String (US-ASCII only) used to determine order of this cluster within the - * parent page's elements. Page elements are sorted in lexicographic order - * of this field. Duplicated values are allowed, but ordering between elements - * with duplicate order is undefined. The value of this field is never - * visible to a user, it is used solely for the purpose of defining an - * ordering. Maximum length is 256 characters. - */ - orderInPage: string; - /** - * List of products in the order they are displayed in the cluster. There - * should not be duplicates within a cluster. - */ - productId: string[]; -} -/** - * General setting for the managed Google Play store layout, currently only - * specifying the page to display the first time the store is opened. - */ -export interface Schema$StoreLayout { - /** - * The ID of the store page to be used as the homepage. The homepage is the - * first page shown in the managed Google Play Store. Not specifying a - * homepage is equivalent to setting the store layout type to - * "basic". - */ - homepageId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#storeLayout". - */ - kind: string; - /** - * The store layout type. By default, this value is set to "basic" - * if the homepageId field is not set, and to "custom" otherwise. If - * set to "basic", the layout will consist of all approved apps that - * have been whitelisted for the user. - */ - storeLayoutType: string; -} -/** - * The store page resources for the enterprise. - */ -export interface Schema$StoreLayoutClustersListResponse { - /** - * A store cluster of an enterprise. - */ - cluster: Schema$StoreCluster[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#storeLayoutClustersListResponse". - */ - kind: string; -} -/** - * The store page resources for the enterprise. - */ -export interface Schema$StoreLayoutPagesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#storeLayoutPagesListResponse". - */ - kind: string; - /** - * A store page of an enterprise. - */ - page: Schema$StorePage[]; -} -/** - * Definition of a managed Google Play store page, made of a localized name and - * links to other pages. A page also contains clusters defined as a - * subcollection. - */ -export interface Schema$StorePage { - /** - * Unique ID of this page. Assigned by the server. Immutable once assigned. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#storePage". - */ - kind: string; - /** - * Ordered list of pages a user should be able to reach from this page. The - * pages must exist, must not be this page, and once a link is created the - * page linked to cannot be deleted until all links to it are removed. It is - * recommended that the basic pages are created first, before adding the links - * between pages. No attempt is made to verify that all pages are reachable - * from the homepage. - */ - link: string[]; - /** - * Ordered list of localized strings giving the name of this page. The text - * displayed is the one that best matches the user locale, or the first entry - * if there is no good match. There needs to be at least one entry. - */ - name: Schema$LocalizedText[]; -} -export interface Schema$TokenPagination { - nextPageToken: string; - previousPageToken: string; -} -/** - * A Users resource represents an account associated with an enterprise. The - * account may be specific to a device or to an individual user (who can then - * use the account across multiple devices). The account may provide access to - * managed Google Play only, or to other Google services, depending on the - * identity model: - The Google managed domain identity model requires - * synchronization to Google account sources (via primaryEmail). - The managed - * Google Play Accounts identity model provides a dynamic means for enterprises - * to create user or device accounts as needed. These accounts provide access to - * managed Google Play. - */ -export interface Schema$User { - /** - * A unique identifier you create for this user, such as "user342" - * or "asset#44418". Do not use personally identifiable information - * (PII) for this property. Must always be set for EMM-managed users. Not set - * for Google-managed users. - */ - accountIdentifier: string; - /** - * The type of account that this user represents. A userAccount can be - * installed on multiple devices, but a deviceAccount is specific to a single - * device. An EMM-managed user (emmManaged) can be either type (userAccount, - * deviceAccount), but a Google-managed user (googleManaged) is always a - * userAccount. - */ - accountType: string; - /** - * The name that will appear in user interfaces. Setting this property is - * optional when creating EMM-managed users. If you do set this property, use - * something generic about the organization (such as "Example, - * Inc.") or your name (as EMM). Not used for Google-managed user - * accounts. - */ - displayName: string; - /** - * The unique ID for the user. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#user". - */ - kind: string; - /** - * The entity that manages the user. With googleManaged users, the source of - * truth is Google so EMMs have to make sure a Google Account exists for the - * user. With emmManaged users, the EMM is in charge. - */ - managementType: string; - /** - * The user's primary email address, for example, - * "jsmith@example.com". Will always be set for Google managed users - * and not set for EMM managed users. - */ - primaryEmail: string; -} -/** - * The matching user resources. - */ -export interface Schema$UsersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#usersListResponse". - */ - kind: string; - /** - * A user of an enterprise. - */ - user: Schema$User[]; -} -/** - * A UserToken is used by a user when setting up a managed device or profile - * with their managed Google Play account on a device. When the user enters - * their email address and token (activation code) the appropriate EMM app can - * be automatically downloaded. - */ -export interface Schema$UserToken { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#userToken". - */ - kind: string; - /** - * The token (activation code) to be entered by the user. This consists of a - * sequence of decimal digits. Note that the leading digit may be 0. - */ - token: string; - /** - * The unique ID for the user. - */ - userId: string; -} -/** - * A variable set is a key-value pair of EMM-provided placeholders and its - * corresponding value, which is attributed to a user. For example, $FIRSTNAME - * could be a placeholder, and its value could be Alice. Placeholders should - * start with a '$' sign and should be alphanumeric only. - */ -export interface Schema$VariableSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidenterprise#variableSet". - */ - kind: string; - /** - * The placeholder string; defined by EMM. - */ - placeholder: string; - /** - * The value of the placeholder, specific to the user. - */ - userValue: string; -} - -export class Resource$Devices { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidenterprise.devices.get - * @desc Retrieves the details of a device. - * @alias androidenterprise.devices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.devices.getState - * @desc Retrieves whether a device's access to Google services is enabled or - * disabled. The device state takes effect only if enforcing EMM policies on - * Android devices is enabled in the Google Admin Console. Otherwise, the - * device state is ignored and all devices are allowed access to Google - * services. This is only supported for Google-managed users. - * @alias androidenterprise.devices.getState - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getState(params?: any, options?: MethodOptions): - AxiosPromise; - getState( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getState( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.devices.list - * @desc Retrieves the IDs of all of a user's devices. - * @alias androidenterprise.devices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.devices.patch - * @desc Updates the device policy. This method supports patch semantics. - * @alias androidenterprise.devices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.updateMask Mask that identifies which fields to update. If not set, all modifiable fields will be modified. When set in a query parameter, this field should be specified as updateMask=,,... - * @param {string} params.userId The ID of the user. - * @param {().Device} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.devices.setState - * @desc Sets whether a device's access to Google services is enabled or - * disabled. The device state takes effect only if enforcing EMM policies on - * Android devices is enabled in the Google Admin Console. Otherwise, the - * device state is ignored and all devices are allowed access to Google - * services. This is only supported for Google-managed users. - * @alias androidenterprise.devices.setState - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {().DeviceState} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setState(params?: any, options?: MethodOptions): - AxiosPromise; - setState( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setState( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.devices.update - * @desc Updates the device policy - * @alias androidenterprise.devices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.updateMask Mask that identifies which fields to update. If not set, all modifiable fields will be modified. When set in a query parameter, this field should be specified as updateMask=,,... - * @param {string} params.userId The ID of the user. - * @param {().Device} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Enterprises { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidenterprise.enterprises.acknowledgeNotificationSet - * @desc Acknowledges notifications that were received from - * Enterprises.PullNotificationSet to prevent subsequent calls from returning - * the same notifications. - * @alias androidenterprise.enterprises.acknowledgeNotificationSet - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.notificationSetId The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledgeNotificationSet(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledgeNotificationSet( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledgeNotificationSet( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/acknowledgeNotificationSet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.completeSignup - * @desc Completes the signup flow, by specifying the Completion token and - * Enterprise token. This request must not be called multiple times for a - * given Enterprise Token. - * @alias androidenterprise.enterprises.completeSignup - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.completionToken The Completion token initially returned by GenerateSignupUrl. - * @param {string=} params.enterpriseToken The Enterprise token appended to the Callback URL. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - completeSignup(params?: any, options?: MethodOptions): - AxiosPromise; - completeSignup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - completeSignup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises/completeSignup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.createWebToken - * @desc Returns a unique token to access an embeddable UI. To generate a web - * UI, pass the generated token into the managed Google Play javascript API. - * Each token may only be used to start one UI session. See the javascript API - * documentation for further information. - * @alias androidenterprise.enterprises.createWebToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().AdministratorWebTokenSpec} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createWebToken(params?: any, options?: MethodOptions): - AxiosPromise; - createWebToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - createWebToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/createWebToken') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.delete - * @desc Deletes the binding between the EMM and enterprise. This is now - * deprecated. Use this method only to unenroll customers that were previously - * enrolled with the insert call, then enroll them again with the enroll call. - * @alias androidenterprise.enterprises.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises/{enterpriseId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.enroll - * @desc Enrolls an enterprise with the calling EMM. - * @alias androidenterprise.enterprises.enroll - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.token The token provided by the enterprise to register the EMM. - * @param {().Enterprise} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enroll(params?: any, options?: MethodOptions): - AxiosPromise; - enroll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enroll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises/enroll') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['token'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.generateSignupUrl - * @desc Generates a sign-up URL. - * @alias androidenterprise.enterprises.generateSignupUrl - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.callbackUrl The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateSignupUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateSignupUrl( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateSignupUrl( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises/signupUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.get - * @desc Retrieves the name and domain of an enterprise. - * @alias androidenterprise.enterprises.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises/{enterpriseId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.getAndroidDevicePolicyConfig - * @desc Returns the Android Device Policy config resource. - * @alias androidenterprise.enterprises.getAndroidDevicePolicyConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAndroidDevicePolicyConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getAndroidDevicePolicyConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAndroidDevicePolicyConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/androidDevicePolicyConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.getServiceAccount - * @desc Returns a service account and credentials. The service account can be - * bound to the enterprise by calling setAccount. The service account is - * unique to this enterprise and EMM, and will be deleted if the enterprise is - * unbound. The credentials contain private key data and are not stored - * server-side. This method can only be called after calling - * Enterprises.Enroll or Enterprises.CompleteSignup, and before - * Enterprises.SetAccount; at other times it will return an error. Subsequent - * calls after the first will generate a new, unique set of credentials, and - * invalidate the previously generated credentials. Once the service account - * is bound to the enterprise, it can be managed using the serviceAccountKeys - * resource. - * @alias androidenterprise.enterprises.getServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.keyType The type of credential to return with the service account. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - getServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.getStoreLayout - * @desc Returns the store layout for the enterprise. If the store layout has - * not been set, returns "basic" as the store layout type and no homepage. - * @alias androidenterprise.enterprises.getStoreLayout - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getStoreLayout(params?: any, options?: MethodOptions): - AxiosPromise; - getStoreLayout( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getStoreLayout( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.insert - * @desc Establishes the binding between the EMM and an enterprise. This is - * now deprecated; use enroll instead. - * @alias androidenterprise.enterprises.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.token The token provided by the enterprise to register the EMM. - * @param {().Enterprise} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['token'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.list - * @desc Looks up an enterprise by domain name. This is only supported for - * enterprises created via the Google-initiated creation flow. Lookup of the - * id is not needed for enterprises created via the EMM-initiated flow since - * the EMM learns the enterprise ID in the callback specified in the - * Enterprises.generateSignupUrl call. - * @alias androidenterprise.enterprises.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.domain The exact primary domain name of the enterprise to look up. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/enterprises') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['domain'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace androidenterprise_v1 { /** - * androidenterprise.enterprises.pullNotificationSet - * @desc Pulls and returns a notification set for the enterprises associated - * with the service account authenticated for the request. The notification - * set may be empty if no notification are pending. A notification set - * returned needs to be acknowledged within 20 seconds by calling - * Enterprises.AcknowledgeNotificationSet, unless the notification set is - * empty. Notifications that are not acknowledged within the 20 seconds will - * eventually be included again in the response to another PullNotificationSet - * request, and those that are never acknowledged will ultimately be deleted - * according to the Google Cloud Platform Pub/Sub system policy. Multiple - * requests might be performed concurrently to retrieve notifications, in - * which case the pending notifications (if any) will be split among each - * caller, if any are pending. If no notifications are present, an empty - * notification list is returned. Subsequent requests may return more - * notifications once they become available. - * @alias androidenterprise.enterprises.pullNotificationSet - * @memberOf! () + * Google Play EMM API * - * @param {object=} params Parameters for request - * @param {string=} params.requestMode The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pullNotificationSet(params?: any, options?: MethodOptions): - AxiosPromise; - pullNotificationSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pullNotificationSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/pullNotificationSet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidenterprise.enterprises.sendTestPushNotification - * @desc Sends a test notification to validate the EMM integration with the - * Google Cloud Pub/Sub service for this enterprise. - * @alias androidenterprise.enterprises.sendTestPushNotification - * @memberOf! () + * Manages the deployment of apps to Android for Work users. * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sendTestPushNotification(params?: any, options?: MethodOptions): - AxiosPromise; - sendTestPushNotification( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$EnterprisesSendTestPushNotificationResponse>): void; - sendTestPushNotification( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$EnterprisesSendTestPushNotificationResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$EnterprisesSendTestPushNotificationResponse>(parameters); - } - } - - - /** - * androidenterprise.enterprises.setAccount - * @desc Sets the account that will be used to authenticate to the API as the - * enterprise. - * @alias androidenterprise.enterprises.setAccount - * @memberOf! () + * @example + * const google = require('googleapis'); + * const androidenterprise = google.androidenterprise('v1'); * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().EnterpriseAccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAccount(params?: any, options?: MethodOptions): - AxiosPromise; - setAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/account') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace androidenterprise + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Androidenterprise + */ + export class Androidenterprise { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + devices: Resource$Devices; + enterprises: Resource$Enterprises; + entitlements: Resource$Entitlements; + grouplicenses: Resource$Grouplicenses; + grouplicenseusers: Resource$Grouplicenseusers; + installs: Resource$Installs; + managedconfigurationsfordevice: Resource$Managedconfigurationsfordevice; + managedconfigurationsforuser: Resource$Managedconfigurationsforuser; + managedconfigurationssettings: Resource$Managedconfigurationssettings; + permissions: Resource$Permissions; + products: Resource$Products; + serviceaccountkeys: Resource$Serviceaccountkeys; + storelayoutclusters: Resource$Storelayoutclusters; + storelayoutpages: Resource$Storelayoutpages; + users: Resource$Users; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.devices = new Resource$Devices(this); + this.enterprises = new Resource$Enterprises(this); + this.entitlements = new Resource$Entitlements(this); + this.grouplicenses = new Resource$Grouplicenses(this); + this.grouplicenseusers = new Resource$Grouplicenseusers(this); + this.installs = new Resource$Installs(this); + this.managedconfigurationsfordevice = + new Resource$Managedconfigurationsfordevice(this); + this.managedconfigurationsforuser = + new Resource$Managedconfigurationsforuser(this); + this.managedconfigurationssettings = + new Resource$Managedconfigurationssettings(this); + this.permissions = new Resource$Permissions(this); + this.products = new Resource$Products(this); + this.serviceaccountkeys = new Resource$Serviceaccountkeys(this); + this.storelayoutclusters = new Resource$Storelayoutclusters(this); + this.storelayoutpages = new Resource$Storelayoutpages(this); + this.users = new Resource$Users(this); + } + + getRoot() { + return this.root; } } - /** - * androidenterprise.enterprises.setAndroidDevicePolicyConfig - * @desc Sets the Android Device Policy config resource. EMM may use this - * method to enable or disable Android Device Policy support for the specified - * enterprise. To learn more about managing devices and apps with Android - * Device Policy, see the Android Management API. - * @alias androidenterprise.enterprises.setAndroidDevicePolicyConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().AndroidDevicePolicyConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * This represents an enterprise admin who can manage the enterprise in the + * managed Google Play store. */ - setAndroidDevicePolicyConfig(params?: any, options?: MethodOptions): - AxiosPromise; - setAndroidDevicePolicyConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAndroidDevicePolicyConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/androidDevicePolicyConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Administrator { + /** + * The admin's email address. + */ + email: string; } - - /** - * androidenterprise.enterprises.setStoreLayout - * @desc Sets the store layout for the enterprise. By default, storeLayoutType - * is set to "basic" and the basic store layout is enabled. The basic layout - * only contains apps approved by the admin, and that have been added to the - * available product set for a user (using the setAvailableProductSet call). - * Apps on the page are sorted in order of their product ID value. If you - * create a custom store layout (by setting storeLayoutType = "custom" and - * setting a homepage), the basic store layout is disabled. - * @alias androidenterprise.enterprises.setStoreLayout - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().StoreLayout} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setStoreLayout(params?: any, options?: MethodOptions): - AxiosPromise; - setStoreLayout( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setStoreLayout( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A token authorizing an admin to access an iframe. + */ + export interface Schema$AdministratorWebToken { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#administratorWebToken". + */ + kind: string; + /** + * An opaque token to be passed to the Play front-end to generate an iframe. + */ + token: string; } - - /** - * androidenterprise.enterprises.unenroll - * @desc Unenrolls an enterprise from the calling EMM. - * @alias androidenterprise.enterprises.unenroll - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unenroll(params?: any, options?: MethodOptions): AxiosPromise; - unenroll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unenroll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/unenroll') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Entitlements { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + * Specification for a token used to generate iframes. The token specifies + * what data the admin is allowed to modify and the URI the iframe is allowed + * to communiate with. + */ + export interface Schema$AdministratorWebTokenSpec { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#administratorWebTokenSpec". + */ + kind: string; + /** + * The URI of the parent frame hosting the iframe. To prevent XSS, the + * iframe may not be hosted at other URIs. This URI must be https. + */ + parent: string; + /** + * The list of permissions the admin is granted within the iframe. The admin + * will only be allowed to view an iframe if they have all of the + * permissions associated with it. The only valid value is + * "approveApps" that will allow the admin to access the iframe in + * "approve" mode. + */ + permission: string[]; } - - getRoot() { - return this.root; - } - - /** - * androidenterprise.entitlements.delete - * @desc Removes an entitlement to an app for a user. - * @alias androidenterprise.entitlements.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'entitlementId'], - pathParams: ['enterpriseId', 'entitlementId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Android Device Policy configuration of an enterprise. + */ + export interface Schema$AndroidDevicePolicyConfig { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#androidDevicePolicyConfig". + */ + kind: string; + /** + * The state of Android Device Policy. "enabled" indicates that + * Android Device Policy is enabled for the enterprise and the EMM is + * allowed to manage devices with Android Device Policy, while + * "disabled" means that it cannot. + */ + state: string; } - - /** - * androidenterprise.entitlements.get - * @desc Retrieves details of an entitlement. - * @alias androidenterprise.entitlements.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'entitlementId'], - pathParams: ['enterpriseId', 'entitlementId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the list of app restrictions available to be pre-configured for + * the product. + */ + export interface Schema$AppRestrictionsSchema { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#appRestrictionsSchema". + */ + kind: string; + /** + * The set of restrictions that make up this schema. + */ + restrictions: Schema$AppRestrictionsSchemaRestriction[]; } - - /** - * androidenterprise.entitlements.list - * @desc Lists all entitlements for the specified user. Only the ID is set. - * @alias androidenterprise.entitlements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An event generated when a new app version is uploaded to Google Play and + * its app restrictions schema changed. To fetch the app restrictions schema + * for an app, use Products.getAppRestrictionsSchema on the EMM API. + */ + export interface Schema$AppRestrictionsSchemaChangeEvent { + /** + * The id of the product (e.g. "app:com.google.android.gm") for + * which the app restriction schema changed. This field will always be + * present. + */ + productId: string; } - - /** - * androidenterprise.entitlements.patch - * @desc Adds or updates an entitlement to an app for a user. This method - * supports patch semantics. - * @alias androidenterprise.entitlements.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - * @param {boolean=} params.install Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. - * @param {string} params.userId The ID of the user. - * @param {().Entitlement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'entitlementId'], - pathParams: ['enterpriseId', 'entitlementId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A restriction in the App Restriction Schema represents a piece of + * configuration that may be pre-applied. + */ + export interface Schema$AppRestrictionsSchemaRestriction { + /** + * The default value of the restriction. bundle and bundleArray restrictions + * never have a default value. + */ + defaultValue: Schema$AppRestrictionsSchemaRestrictionRestrictionValue; + /** + * A longer description of the restriction, giving more detail of what it + * affects. + */ + description: string; + /** + * For choice or multiselect restrictions, the list of possible entries' + * human-readable names. + */ + entry: string[]; + /** + * For choice or multiselect restrictions, the list of possible entries' + * machine-readable values. These values should be used in the + * configuration, either as a single string value for a choice restriction + * or in a stringArray for a multiselect restriction. + */ + entryValue: string[]; + /** + * The unique key that the product uses to identify the restriction, e.g. + * "com.google.android.gm.fieldname". + */ + key: string; + /** + * For bundle or bundleArray restrictions, the list of nested restrictions. + * A bundle restriction is always nested within a bundleArray restriction, + * and a bundleArray restriction is at most two levels deep. + */ + nestedRestriction: Schema$AppRestrictionsSchemaRestriction[]; + /** + * The type of the restriction. + */ + restrictionType: string; + /** + * The name of the restriction. + */ + title: string; } - - /** - * androidenterprise.entitlements.update - * @desc Adds or updates an entitlement to an app for a user. - * @alias androidenterprise.entitlements.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - * @param {boolean=} params.install Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. - * @param {string} params.userId The ID of the user. - * @param {().Entitlement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'entitlementId'], - pathParams: ['enterpriseId', 'entitlementId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Grouplicenses { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + * A typed value for the restriction. + */ + export interface Schema$AppRestrictionsSchemaRestrictionRestrictionValue { + /** + * The type of the value being provided. + */ + type: string; + /** + * The boolean value - this will only be present if type is bool. + */ + valueBool: boolean; + /** + * The integer value - this will only be present if type is integer. + */ + valueInteger: number; + /** + * The list of string values - this will only be present if type is + * multiselect. + */ + valueMultiselect: string[]; + /** + * The string value - this will be present for types string, choice and + * hidden. + */ + valueString: string; } - - getRoot() { - return this.root; - } - - /** - * androidenterprise.grouplicenses.get - * @desc Retrieves details of an enterprise's group license for a product. - * @alias androidenterprise.grouplicenses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.groupLicenseId The ID of the product the group license is for, e.g. "app:com.google.android.gm". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'groupLicenseId'], - pathParams: ['enterpriseId', 'groupLicenseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Information on an approval URL. + */ + export interface Schema$ApprovalUrlInfo { + /** + * A URL that displays a product's permissions and that can also be used + * to approve the product with the Products.approve call. + */ + approvalUrl: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#approvalUrlInfo". + */ + kind: string; } - - /** - * androidenterprise.grouplicenses.list - * @desc Retrieves IDs of all products for which the enterprise has a group - * license. - * @alias androidenterprise.grouplicenses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Grouplicenseusers { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * An event generated when a new version of an app is uploaded to Google Play. + * Notifications are sent for new public versions only: alpha, beta, or canary + * versions do not generate this event. To fetch up-to-date version history + * for an app, use Products.Get on the EMM API. + */ + export interface Schema$AppUpdateEvent { + /** + * The id of the product (e.g. "app:com.google.android.gm") that + * was updated. This field will always be present. + */ + productId: string; } - - /** - * androidenterprise.grouplicenseusers.list - * @desc Retrieves the IDs of the users who have been granted entitlements - * under the license. - * @alias androidenterprise.grouplicenseusers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.groupLicenseId The ID of the product the group license is for, e.g. "app:com.google.android.gm". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'groupLicenseId'], - pathParams: ['enterpriseId', 'groupLicenseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This represents a single version of the app. + */ + export interface Schema$AppVersion { + /** + * The track that this app was published in. For example if track is + * "alpha", this is an alpha version of the app. + */ + track: string; + /** + * Unique increasing identifier for the app version. + */ + versionCode: number; + /** + * The string used in the Play store by the app developer to identify the + * version. The string is not necessarily unique or localized (for example, + * the string could be "1.4"). + */ + versionString: string; } -} - -export class Resource$Installs { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * An AuthenticationToken is used by the EMM's device policy client on a + * device to provision the given EMM-managed user on that device. + */ + export interface Schema$AuthenticationToken { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#authenticationToken". + */ + kind: string; + /** + * The authentication token to be passed to the device policy client on the + * device where it can be used to provision the account for which this token + * was generated. + */ + token: string; } - - getRoot() { - return this.root; + /** + * A configuration variables resource contains the managed configuration + * settings ID to be applied to a single user, as well as the variable set + * that is attributed to the user. The variable set will be used to replace + * placeholders in the managed configuration settings. + */ + export interface Schema$ConfigurationVariables { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#configurationVariables". + */ + kind: string; + /** + * The ID of the managed configurations settings. + */ + mcmId: string; + /** + * The variable set that is attributed to the user. + */ + variableSet: Schema$VariableSet[]; } - - /** - * androidenterprise.installs.delete - * @desc Requests to remove an app from a device. A call to get or list will - * still show the app as installed on the device until it is actually removed. - * @alias androidenterprise.installs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], - pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Devices resource represents a mobile device managed by the EMM and + * belonging to a specific enterprise user. + */ + export interface Schema$Device { + /** + * The Google Play Services Android ID for the device encoded as a lowercase + * hex string. For example, "123456789abcdef0". + */ + androidId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#device". + */ + kind: string; + /** + * Identifies the extent to which the device is controlled by a managed + * Google Play EMM in various deployment configurations. Possible values + * include: - "managedDevice", a device that has the EMM's + * device policy controller (DPC) as the device owner. - + * "managedProfile", a device that has a profile managed by the + * DPC (DPC is profile owner) in addition to a separate, personal profile + * that is unavailable to the DPC. - "containerApp", no longer + * used (deprecated). - "unmanagedProfile", a device that has + * been allowed (by the domain's admin, using the Admin Console to + * enable the privilege) to use managed Google Play, but the profile is + * itself not owned by a DPC. + */ + managementType: string; + /** + * The policy enforced on the device. + */ + policy: Schema$Policy; } - - /** - * androidenterprise.installs.get - * @desc Retrieves details of an installation of an app on a device. - * @alias androidenterprise.installs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], - pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The device resources for the user. + */ + export interface Schema$DevicesListResponse { + /** + * A managed device. + */ + device: Schema$Device[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#devicesListResponse". + */ + kind: string; } - - /** - * androidenterprise.installs.list - * @desc Retrieves the details of all apps installed on the specified device. - * @alias androidenterprise.installs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The state of a user's device, as accessed by the getState and setState + * methods on device resources. + */ + export interface Schema$DeviceState { + /** + * The state of the Google account on the device. "enabled" + * indicates that the Google account on the device can be used to access + * Google services (including Google Play), while "disabled" means + * that it cannot. A new device is initially in the "disabled" + * state. + */ + accountState: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#deviceState". + */ + kind: string; } - - /** - * androidenterprise.installs.patch - * @desc Requests to install the latest version of an app to a device. If the - * app is already installed, then it is updated to the latest version if - * necessary. This method supports patch semantics. - * @alias androidenterprise.installs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().Install} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], - pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An Enterprises resource represents the binding between an EMM and a + * specific organization. That binding can be instantiated in one of two + * different ways using this API as follows: - For Google managed domain + * customers, the process involves using Enterprises.enroll and + * Enterprises.setAccount (in conjunction with artifacts obtained from the + * Admin console and the Google API Console) and submitted to the EMM through + * a more-or-less manual process. - For managed Google Play Accounts + * customers, the process involves using Enterprises.generateSignupUrl and + * Enterprises.completeSignup in conjunction with the managed Google Play + * sign-up UI (Google-provided mechanism) to create the binding without manual + * steps. As an EMM, you can support either or both approaches in your EMM + * console. See Create an Enterprise for details. + */ + export interface Schema$Enterprise { + /** + * Admins of the enterprise. This is only supported for enterprises created + * via the EMM-initiated flow. + */ + administrator: Schema$Administrator[]; + /** + * The unique ID for the enterprise. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#enterprise". + */ + kind: string; + /** + * The name of the enterprise, for example, "Example, Inc". + */ + name: string; + /** + * The enterprise's primary domain, such as "example.com". + */ + primaryDomain: string; } - - /** - * androidenterprise.installs.update - * @desc Requests to install the latest version of an app to a device. If the - * app is already installed, then it is updated to the latest version if - * necessary. - * @alias androidenterprise.installs.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().Install} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], - pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A service account that can be used to authenticate as the enterprise to API + * calls that require such authentication. + */ + export interface Schema$EnterpriseAccount { + /** + * The email address of the service account. + */ + accountEmail: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#enterpriseAccount". + */ + kind: string; } -} - -export class Resource$Managedconfigurationsfordevice { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * The matching enterprise resources. + */ + export interface Schema$EnterprisesListResponse { + /** + * An enterprise. + */ + enterprise: Schema$Enterprise[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#enterprisesListResponse". + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$EnterprisesSendTestPushNotificationResponse { + /** + * The message ID of the test push notification that was sent. + */ + messageId: string; + /** + * The name of the Cloud Pub/Sub topic to which notifications for this + * enterprise's enrolled account will be sent. + */ + topicName: string; } - - /** - * androidenterprise.managedconfigurationsfordevice.delete - * @desc Removes a per-device managed configuration for an app for the - * specified device. - * @alias androidenterprise.managedconfigurationsfordevice.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: [ - 'enterpriseId', 'userId', 'deviceId', 'managedConfigurationForDeviceId' - ], - pathParams: [ - 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', 'userId' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The presence of an Entitlements resource indicates that a user has the + * right to use a particular app. Entitlements are user specific, not device + * specific. This allows a user with an entitlement to an app to install the + * app on all their devices. It's also possible for a user to hold an + * entitlement to an app without installing the app on any device. The API + * can be used to create an entitlement. As an option, you can also use the + * API to trigger the installation of an app on all a user's managed + * devices at the same time the entitlement is created. If the app is free, + * creating the entitlement also creates a group license for that app. For + * paid apps, creating the entitlement consumes one license, and that license + * remains consumed until the entitlement is removed. If the enterprise + * hasn't purchased enough licenses, then no entitlement is created and + * the installation fails. An entitlement is also not created for an app if + * the app requires permissions that the enterprise hasn't accepted. If + * an entitlement is deleted, the app may be uninstalled from a user's + * device. As a best practice, uninstall the app by calling Installs.delete() + * before deleting the entitlement. Entitlements for apps that a user pays + * for on an unmanaged profile have "userPurchase" as the + * entitlement reason. These entitlements cannot be removed via the API. + */ + export interface Schema$Entitlement { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#entitlement". + */ + kind: string; + /** + * The ID of the product that the entitlement is for. For example, + * "app:com.google.android.gm". + */ + productId: string; + /** + * The reason for the entitlement. For example, "free" for free + * apps. This property is temporary: it will be replaced by the acquisition + * kind field of group licenses. + */ + reason: string; } - - /** - * androidenterprise.managedconfigurationsfordevice.get - * @desc Retrieves details of a per-device managed configuration. - * @alias androidenterprise.managedconfigurationsfordevice.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [ - 'enterpriseId', 'userId', 'deviceId', 'managedConfigurationForDeviceId' - ], - pathParams: [ - 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', 'userId' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The entitlement resources for the user. + */ + export interface Schema$EntitlementsListResponse { + /** + * An entitlement of a user to a product (e.g. an app). For example, a free + * app that they have installed, or a paid app that they have been allocated + * a license to. + */ + entitlement: Schema$Entitlement[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#entitlementsListResponse". + */ + kind: string; } - - /** - * androidenterprise.managedconfigurationsfordevice.list - * @desc Lists all the per-device managed configurations for the specified - * device. Only the ID is set. - * @alias androidenterprise.managedconfigurationsfordevice.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsForDeviceListResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsForDeviceListResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId', 'deviceId'], - pathParams: ['deviceId', 'enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ManagedConfigurationsForDeviceListResponse>(parameters); - } + * Group license objects allow you to keep track of licenses (called + * entitlements) for both free and paid apps. For a free app, a group license + * is created when an enterprise admin first approves the product in Google + * Play or when the first entitlement for the product is created for a user + * via the API. For a paid app, a group license object is only created when an + * enterprise admin purchases the product in Google Play for the first time. + * Use the API to query group licenses. A Grouplicenses resource includes the + * total number of licenses purchased (paid apps only) and the total number of + * licenses currently in use. In other words, the total number of Entitlements + * that exist for the product. Only one group license object is created per + * product and group license objects are never deleted. If a product is + * unapproved, its group license remains. This allows enterprise admins to + * keep track of any remaining entitlements for the product. + */ + export interface Schema$GroupLicense { + /** + * How this group license was acquired. "bulkPurchase" means that + * this Grouplicenses resource was created because the enterprise purchased + * licenses for this product; otherwise, the value is "free" (for + * free products). + */ + acquisitionKind: string; + /** + * Whether the product to which this group license relates is currently + * approved by the enterprise. Products are approved when a group license is + * first created, but this approval may be revoked by an enterprise admin + * via Google Play. Unapproved products will not be visible to end users in + * collections, and new entitlements to them should not normally be created. + */ + approval: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#groupLicense". + */ + kind: string; + /** + * The total number of provisioned licenses for this product. Returned by + * read operations, but ignored in write operations. + */ + numProvisioned: number; + /** + * The number of purchased licenses (possibly in multiple purchases). If + * this field is omitted, then there is no limit on the number of licenses + * that can be provisioned (for example, if the acquisition kind is + * "free"). + */ + numPurchased: number; + /** + * The permission approval status of the product. This field is only set if + * the product is approved. Possible states are: - + * "currentApproved", the current set of permissions is approved, + * but additional permissions will require the administrator to reapprove + * the product (If the product was approved without specifying the approved + * permissions setting, then this is the default behavior.), - + * "needsReapproval", the product has unapproved permissions. No + * additional product licenses can be assigned until the product is + * reapproved, - "allCurrentAndFutureApproved", the current + * permissions are approved and any future permission updates will be + * automatically approved without administrator review. + */ + permissions: string; + /** + * The ID of the product that the license is for. For example, + * "app:com.google.android.gm". + */ + productId: string; } - - /** - * androidenterprise.managedconfigurationsfordevice.patch - * @desc Adds or updates a per-device managed configuration for an app for the - * specified device. This method supports patch semantics. - * @alias androidenterprise.managedconfigurationsfordevice.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().ManagedConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: [ - 'enterpriseId', 'userId', 'deviceId', 'managedConfigurationForDeviceId' - ], - pathParams: [ - 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', 'userId' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The grouplicense resources for the enterprise. + */ + export interface Schema$GroupLicensesListResponse { + /** + * A group license for a product approved for use in the enterprise. + */ + groupLicense: Schema$GroupLicense[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#groupLicensesListResponse". + */ + kind: string; } - - /** - * androidenterprise.managedconfigurationsfordevice.update - * @desc Adds or updates a per-device managed configuration for an app for the - * specified device. - * @alias androidenterprise.managedconfigurationsfordevice.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceId The Android ID of the device. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().ManagedConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [ - 'enterpriseId', 'userId', 'deviceId', 'managedConfigurationForDeviceId' - ], - pathParams: [ - 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', 'userId' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Managedconfigurationsforuser { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * The user resources for the group license. + */ + export interface Schema$GroupLicenseUsersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#groupLicenseUsersListResponse". + */ + kind: string; + /** + * A user of an enterprise. + */ + user: Schema$User[]; } - - /** - * androidenterprise.managedconfigurationsforuser.delete - * @desc Removes a per-user managed configuration for an app for the specified - * user. - * @alias androidenterprise.managedconfigurationsforuser.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: - ['enterpriseId', 'userId', 'managedConfigurationForUserId'], - pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The existence of an Installs resource indicates that an app is installed on + * a particular device (or that an install is pending). The API can be used + * to create an install resource using the update method. This triggers the + * actual install of the app on the device. If the user does not already have + * an entitlement for the app, then an attempt is made to create one. If this + * fails (for example, because the app is not free and there is no available + * license), then the creation of the install fails. The API can also be used + * to update an installed app. If the update method is used on an existing + * install, then the app will be updated to the latest available version. Note + * that it is not possible to force the installation of a specific version of + * an app: the version code is read-only. If a user installs an app + * themselves (as permitted by the enterprise), then again an install resource + * and possibly an entitlement resource are automatically created. The API + * can also be used to delete an install resource, which triggers the removal + * of the app from the device. Note that deleting an install does not + * automatically remove the corresponding entitlement, even if there are no + * remaining installs. The install resource will also be deleted if the user + * uninstalls the app themselves. + */ + export interface Schema$Install { + /** + * Install state. The state "installPending" means that an install + * request has recently been made and download to the device is in progress. + * The state "installed" means that the app has been installed. + * This field is read-only. + */ + installState: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#install". + */ + kind: string; + /** + * The ID of the product that the install is for. For example, + * "app:com.google.android.gm". + */ + productId: string; + /** + * The version of the installed product. Guaranteed to be set only if the + * install state is "installed". + */ + versionCode: number; } - - /** - * androidenterprise.managedconfigurationsforuser.get - * @desc Retrieves details of a per-user managed configuration for an app for - * the specified user. - * @alias androidenterprise.managedconfigurationsforuser.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['enterpriseId', 'userId', 'managedConfigurationForUserId'], - pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An event generated when an app installation failed on a device + */ + export interface Schema$InstallFailureEvent { + /** + * The Android ID of the device. This field will always be present. + */ + deviceId: string; + /** + * Additional details on the failure if applicable. + */ + failureDetails: string; + /** + * The reason for the installation failure. This field will always be + * present. + */ + failureReason: string; + /** + * The id of the product (e.g. "app:com.google.android.gm") for + * which the install failure event occured. This field will always be + * present. + */ + productId: string; + /** + * The ID of the user. This field will always be present. + */ + userId: string; } - - /** - * androidenterprise.managedconfigurationsforuser.list - * @desc Lists all the per-user managed configurations for the specified user. - * Only the ID is set. - * @alias androidenterprise.managedconfigurationsforuser.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsForUserListResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsForUserListResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * The install resources for the device. + */ + export interface Schema$InstallsListResponse { + /** + * An installation of an app for a user on a specific device. The existence + * of an install implies that the user must have an entitlement to the app. + */ + install: Schema$Install[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#installsListResponse". + */ + kind: string; } - - /** - * androidenterprise.managedconfigurationsforuser.patch - * @desc Adds or updates the managed configuration settings for an app for the - * specified user. If you support the Managed configurations iframe, you can - * apply managed configurations to a user by specifying an mcmId and its - * associated configuration variables (if any) in the request. Alternatively, - * all EMMs can apply managed configurations by passing a list of managed - * properties. This method supports patch semantics. - * @alias androidenterprise.managedconfigurationsforuser.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().ManagedConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: - ['enterpriseId', 'userId', 'managedConfigurationForUserId'], - pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A localized string with its locale. + */ + export interface Schema$LocalizedText { + /** + * The BCP47 tag for a locale. (e.g. "en-US", "de"). + */ + locale: string; + /** + * The text localized in the associated locale. + */ + text: string; } - - /** - * androidenterprise.managedconfigurationsforuser.update - * @desc Adds or updates the managed configuration settings for an app for the - * specified user. If you support the Managed configurations iframe, you can - * apply managed configurations to a user by specifying an mcmId and its - * associated configuration variables (if any) in the request. Alternatively, - * all EMMs can apply managed configurations by passing a list of managed - * properties. - * @alias androidenterprise.managedconfigurationsforuser.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - * @param {string} params.userId The ID of the user. - * @param {().ManagedConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: - ['enterpriseId', 'userId', 'managedConfigurationForUserId'], - pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Managedconfigurationssettings { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Maintenance window for managed Google Play Accounts. This allows Play store + * to update the apps on the foreground in the designated window. + */ + export interface Schema$MaintenanceWindow { + /** + * Duration of the maintenance window, in milliseconds. The duration must be + * between 30 minutes and 24 hours (inclusive). + */ + durationMs: string; + /** + * Start time of the maintenance window, in milliseconds after midnight on + * the device. Windows can span midnight. + */ + startTimeAfterMidnightMs: string; } - - /** - * androidenterprise.managedconfigurationssettings.list - * @desc Lists all the managed configurations settings for the specified app. - * Only the ID and the name is set. - * @alias androidenterprise.managedconfigurationssettings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.productId The ID of the product for which the managed configurations settings applies to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsSettingsListResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ManagedConfigurationsSettingsListResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Permissions { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + * A managed configuration resource contains the set of managed properties + * defined by the app developer in the app's managed configurations + * schema, as well as any configuration variables defined for the user. + */ + export interface Schema$ManagedConfiguration { + /** + * Contains the ID of the managed configuration profile and the set of + * configuration variables (if any) defined for the user. + */ + configurationVariables: Schema$ConfigurationVariables; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#managedConfiguration". + */ + kind: string; + /** + * The set of managed properties for this configuration. + */ + managedProperty: Schema$ManagedProperty[]; + /** + * The ID of the product that the managed configuration is for, e.g. + * "app:com.google.android.gm". + */ + productId: string; } - - getRoot() { - return this.root; + /** + * The managed configuration resources for the device. + */ + export interface Schema$ManagedConfigurationsForDeviceListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#managedConfigurationsForDeviceListResponse". + */ + kind: string; + /** + * A managed configuration for an app on a specific device. + */ + managedConfigurationForDevice: Schema$ManagedConfiguration[]; } - - /** - * androidenterprise.permissions.get - * @desc Retrieves details of an Android app permission for display to an - * enterprise admin. - * @alias androidenterprise.permissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de") - * @param {string} params.permissionId The ID of the permission. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/androidenterprise/v1/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['permissionId'], - pathParams: ['permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The managed configuration resources for the user. + */ + export interface Schema$ManagedConfigurationsForUserListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#managedConfigurationsForUserListResponse". + */ + kind: string; + /** + * A managed configuration for an app for a specific user. + */ + managedConfigurationForUser: Schema$ManagedConfiguration[]; + } + /** + * A managed configurations settings resource contains the set of managed + * properties that have been configured for an Android app to be applied to a + * set of users. The app's developer would have defined configurable + * properties in the managed configurations schema. + */ + export interface Schema$ManagedConfigurationsSettings { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#managedConfigurationsSettings". + */ + kind: string; + /** + * The last updated time of the managed configuration settings in + * milliseconds since 1970-01-01T00:00:00Z. + */ + lastUpdatedTimestampMillis: string; + /** + * The set of managed properties for this configuration. + */ + managedProperty: Schema$ManagedProperty[]; + /** + * The ID of the managed configurations settings. + */ + mcmId: string; + /** + * The name of the managed configurations settings. + */ + name: string; } -} - -export class Resource$Products { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * The managed configurations settings for a product. + */ + export interface Schema$ManagedConfigurationsSettingsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#managedConfigurationsSettingsListResponse". + */ + kind: string; + /** + * A managed configurations settings for an app that may be assigned to a + * group of users in an enterprise. + */ + managedConfigurationsSettings: Schema$ManagedConfigurationsSettings[]; } - - getRoot() { - return this.root; + /** + * A managed property of a managed configuration. The property must match one + * of the properties in the app restrictions schema of the product. Exactly + * one of the value fields must be populated, and it must match the + * property's type in the app restrictions schema. + */ + export interface Schema$ManagedProperty { + /** + * The unique key that identifies the property. + */ + key: string; + /** + * The boolean value - this will only be present if type of the property is + * bool. + */ + valueBool: boolean; + /** + * The bundle of managed properties - this will only be present if type of + * the property is bundle. + */ + valueBundle: Schema$ManagedPropertyBundle; + /** + * The list of bundles of properties - this will only be present if type of + * the property is bundle_array. + */ + valueBundleArray: Schema$ManagedPropertyBundle[]; + /** + * The integer value - this will only be present if type of the property is + * integer. + */ + valueInteger: number; + /** + * The string value - this will only be present if type of the property is + * string, choice or hidden. + */ + valueString: string; + /** + * The list of string values - this will only be present if type of the + * property is multiselect. + */ + valueStringArray: string[]; } - - /** - * androidenterprise.products.approve - * @desc Approves the specified product and the relevant app permissions, if - * any. The maximum number of products that you can approve per enterprise - * customer is 1,000. To learn how to use managed Google Play to design and - * create a store layout to display approved products to your users, see Store - * Layout Design. - * @alias androidenterprise.products.approve - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.productId The ID of the product. - * @param {().ProductsApproveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A bundle of managed properties. */ - approve(params?: any, options?: MethodOptions): AxiosPromise; - approve( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - approve( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ManagedPropertyBundle { + /** + * The list of managed properties. + */ + managedProperty: Schema$ManagedProperty[]; } - - /** - * androidenterprise.products.generateApprovalUrl - * @desc Generates a URL that can be rendered in an iframe to display the - * permissions (if any) of a product. An enterprise admin must view these - * permissions and accept them on behalf of their organization in order to - * approve that product. Admins should accept the displayed permissions by - * interacting with a separate UI element in the EMM console, which in turn - * should trigger the use of this URL as the approvalUrlInfo.approvalUrl - * property in a Products.approve call to approve the product. This URL can - * only be used to display permissions for up to 1 day. - * @alias androidenterprise.products.generateApprovalUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.languageCode The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". - * @param {string} params.productId The ID of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateApprovalUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateApprovalUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - generateApprovalUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * An event generated when a new device is ready to be managed. + */ + export interface Schema$NewDeviceEvent { + /** + * The Android ID of the device. This field will always be present. + */ + deviceId: string; + /** + * Policy app on the device. + */ + dpcPackageName: string; + /** + * Identifies the extent to which the device is controlled by an Android EMM + * in various deployment configurations. Possible values include: - + * "managedDevice", a device where the DPC is set as device owner, + * - "managedProfile", a device where the DPC is set as profile + * owner. + */ + managementType: string; + /** + * The ID of the user. This field will always be present. + */ + userId: string; } - - /** - * androidenterprise.products.get - * @desc Retrieves details of a product for display to an enterprise admin. - * @alias androidenterprise.products.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). - * @param {string} params.productId The ID of the product, e.g. "app:com.google.android.gm". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An event generated when new permissions are added to an app. + */ + export interface Schema$NewPermissionsEvent { + /** + * The set of permissions that the enterprise admin has already approved for + * this application. Use Permissions.Get on the EMM API to retrieve details + * about these permissions. + */ + approvedPermissions: string[]; + /** + * The id of the product (e.g. "app:com.google.android.gm") for + * which new permissions were added. This field will always be present. + */ + productId: string; + /** + * The set of permissions that the app is currently requesting. Use + * Permissions.Get on the EMM API to retrieve details about these + * permissions. + */ + requestedPermissions: string[]; } - - /** - * androidenterprise.products.getAppRestrictionsSchema - * @desc Retrieves the schema that defines the configurable properties for - * this product. All products have a schema, but this schema may be empty if - * no managed configurations have been defined. This schema can be used to - * populate a UI that allows an admin to configure the product. To apply a - * managed configuration based on the schema obtained using this API, see - * Managed Configurations through Play. - * @alias androidenterprise.products.getAppRestrictionsSchema - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). - * @param {string} params.productId The ID of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAppRestrictionsSchema(params?: any, options?: MethodOptions): - AxiosPromise; - getAppRestrictionsSchema( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAppRestrictionsSchema( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A notification of one event relating to an enterprise. + */ + export interface Schema$Notification { + /** + * Notifications about new app restrictions schema changes. + */ + appRestrictionsSchemaChangeEvent: Schema$AppRestrictionsSchemaChangeEvent; + /** + * Notifications about app updates. + */ + appUpdateEvent: Schema$AppUpdateEvent; + /** + * The ID of the enterprise for which the notification is sent. This will + * always be present. + */ + enterpriseId: string; + /** + * Notifications about an app installation failure. + */ + installFailureEvent: Schema$InstallFailureEvent; + /** + * Notifications about new devices. + */ + newDeviceEvent: Schema$NewDeviceEvent; + /** + * Notifications about new app permissions. + */ + newPermissionsEvent: Schema$NewPermissionsEvent; + /** + * Type of the notification. + */ + notificationType: string; + /** + * Notifications about changes to a product's approval status. + */ + productApprovalEvent: Schema$ProductApprovalEvent; + /** + * Notifications about product availability changes. + */ + productAvailabilityChangeEvent: Schema$ProductAvailabilityChangeEvent; + /** + * The time when the notification was published in milliseconds since + * 1970-01-01T00:00:00Z. This will always be present. + */ + timestampMillis: string; } - - /** - * androidenterprise.products.getPermissions - * @desc Retrieves the Android app permissions required by this app. - * @alias androidenterprise.products.getPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.productId The ID of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - getPermissions( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getPermissions( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A resource returned by the PullNotificationSet API, which contains a + * collection of notifications for enterprises associated with the service + * account authenticated for the request. + */ + export interface Schema$NotificationSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#notificationSet". + */ + kind: string; + /** + * The notifications received, or empty if no notifications are present. + */ + notification: Schema$Notification[]; + /** + * The notification set ID, required to mark the notification as received + * with the Enterprises.AcknowledgeNotification API. This will be omitted if + * no notifications are present. + */ + notificationSetId: string; + } + export interface Schema$PageInfo { + resultPerPage: number; + startIndex: number; + totalResults: number; } - - /** - * androidenterprise.products.list - * @desc Finds approved products that match a query, or all approved products - * if there is no query. - * @alias androidenterprise.products.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.approved Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be specified. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language. - * @param {integer=} params.maxResults Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response. - * @param {string=} params.query The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps). - * @param {string=} params.token A pagination token is contained in a request''s response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Permissions resource represents some extra capability, to be granted to + * an Android app, which requires explicit consent. An enterprise admin must + * consent to these permissions on behalf of their users before an entitlement + * for the app can be created. The permissions collection is read-only. The + * information provided for each permission (localized name and description) + * is intended to be used in the MDM user interface when obtaining consent + * from the enterprise. + */ + export interface Schema$Permission { + /** + * A longer description of the Permissions resource, giving more details of + * what it affects. + */ + description: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#permission". + */ + kind: string; + /** + * The name of the permission. + */ + name: string; + /** + * An opaque string uniquely identifying the permission. + */ + permissionId: string; } - - /** - * androidenterprise.products.unapprove - * @desc Unapproves the specified product (and the relevant app permissions, - * if any) - * @alias androidenterprise.products.unapprove - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.productId The ID of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unapprove(params?: any, options?: MethodOptions): AxiosPromise; - unapprove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unapprove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'productId'], - pathParams: ['enterpriseId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The device policy for a given managed device. + */ + export interface Schema$Policy { + /** + * The auto-update policy for apps installed on the device. + * "choiceToTheUser" allows the device's user to configure the + * app update policy. "always" enables auto updates. + * "never" disables auto updates. "wifiOnly" enables + * auto updates only when the device is connected to wifi. + */ + autoUpdatePolicy: string; + /** + * The maintenance window defining when apps running in the foreground + * should be updated. + */ + maintenanceWindow: Schema$MaintenanceWindow; + /** + * The availability granted to the device for the specified products. + * "all" gives the device access to all products, regardless of + * approval status. "allApproved" entitles the device to access + * all products that are approved for the enterprise. + * "allApproved" and "all" do not enable automatic + * visibility of "alpha" or "beta" tracks. + * "whitelist" grants the device access the products specified in + * productPolicy[]. Only products that are approved or products that were + * previously approved (products with revoked approval) by the enterprise + * can be whitelisted. If no value is provided, the availability set at the + * user level is applied by default. + */ + productAvailabilityPolicy: string; + /** + * The list of product policies. + */ + productPolicy: Schema$ProductPolicy[]; } -} - -export class Resource$Serviceaccountkeys { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * A Products resource represents an app in the Google Play store that is + * available to at least some users in the enterprise. (Some apps are + * restricted to a single enterprise, and no information about them is made + * available outside that enterprise.) The information provided for each + * product (localized name, icon, link to the full Google Play details page) + * is intended to allow a basic representation of the product within an EMM + * user interface. + */ + export interface Schema$Product { + /** + * App versions currently available for this product. + */ + appVersion: Schema$AppVersion[]; + /** + * The name of the author of the product (for example, the app developer). + */ + authorName: string; + /** + * The countries which this app is available in. + */ + availableCountries: string[]; + /** + * The tracks that are visible to the enterprise. + */ + availableTracks: string[]; + /** + * The app category (e.g. RACING, SOCIAL, etc.) + */ + category: string; + /** + * The content rating for this app. + */ + contentRating: string; + /** + * The localized promotional description, if available. + */ + description: string; + /** + * A link to the (consumer) Google Play details page for the product. + */ + detailsUrl: string; + /** + * How and to whom the package is made available. The value + * publicGoogleHosted means that the package is available through the Play + * store and not restricted to a specific enterprise. The value + * privateGoogleHosted means that the package is a private app (restricted + * to an enterprise) but hosted by Google. The value privateSelfHosted means + * that the package is a private app (restricted to an enterprise) and is + * privately hosted. + */ + distributionChannel: string; + /** + * A link to an image that can be used as an icon for the product. This + * image is suitable for use at up to 512px x 512px. + */ + iconUrl: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#product". + */ + kind: string; + /** + * The approximate time (within 7 days) the app was last published, + * expressed in milliseconds since epoch. + */ + lastUpdatedTimestampMillis: string; + /** + * The minimum Android SDK necessary to run the app. + */ + minAndroidSdkVersion: number; + /** + * A list of permissions required by the app. + */ + permissions: Schema$ProductPermission[]; + /** + * A string of the form app:<package name>. For example, + * app:com.google.android.gm represents the Gmail app. + */ + productId: string; + /** + * Whether this product is free, free with in-app purchases, or paid. If the + * pricing is unknown, this means the product is not generally available + * anymore (even though it might still be available to people who own it). + */ + productPricing: string; + /** + * A description of the recent changes made to the app. + */ + recentChanges: string; + /** + * Deprecated. + */ + requiresContainerApp: boolean; + /** + * A list of screenshot links representing the app. + */ + screenshotUrls: string[]; + /** + * The certificate used to sign this product. + */ + signingCertificate: Schema$ProductSigningCertificate; + /** + * A link to a smaller image that can be used as an icon for the product. + * This image is suitable for use at up to 128px x 128px. + */ + smallIconUrl: string; + /** + * The name of the product. + */ + title: string; + /** + * A link to the managed Google Play details page for the product, for use + * by an Enterprise admin. + */ + workDetailsUrl: string; } - - getRoot() { - return this.root; + /** + * An event generated when a product's approval status is changed. + */ + export interface Schema$ProductApprovalEvent { + /** + * Whether the product was approved or unapproved. This field will always be + * present. + */ + approved: string; + /** + * The id of the product (e.g. "app:com.google.android.gm") for + * which the approval status has changed. This field will always be present. + */ + productId: string; } - - /** - * androidenterprise.serviceaccountkeys.delete - * @desc Removes and invalidates the specified credentials for the service - * account associated with this enterprise. The calling service account must - * have been retrieved by calling Enterprises.GetServiceAccount and must have - * been set as the enterprise service account by calling - * Enterprises.SetAccount. - * @alias androidenterprise.serviceaccountkeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.keyId The ID of the key. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'keyId'], - pathParams: ['enterpriseId', 'keyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An event generated whenever a product's availability changes. + */ + export interface Schema$ProductAvailabilityChangeEvent { + /** + * The new state of the product. This field will always be present. + */ + availabilityStatus: string; + /** + * The id of the product (e.g. "app:com.google.android.gm") for + * which the product availability changed. This field will always be + * present. + */ + productId: string; } - - /** - * androidenterprise.serviceaccountkeys.insert - * @desc Generates new credentials for the service account associated with - * this enterprise. The calling service account must have been retrieved by - * calling Enterprises.GetServiceAccount and must have been set as the - * enterprise service account by calling Enterprises.SetAccount. Only the - * type of the key should be populated in the resource to be inserted. - * @alias androidenterprise.serviceaccountkeys.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().ServiceAccountKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A product permissions resource represents the set of permissions required + * by a specific app and whether or not they have been accepted by an + * enterprise admin. The API can be used to read the set of permissions, and + * also to update the set to indicate that permissions have been accepted. + */ + export interface Schema$ProductPermission { + /** + * An opaque string uniquely identifying the permission. + */ + permissionId: string; + /** + * Whether the permission has been accepted or not. + */ + state: string; } - - /** - * androidenterprise.serviceaccountkeys.list - * @desc Lists all active credentials for the service account associated with - * this enterprise. Only the ID and key type are returned. The calling service - * account must have been retrieved by calling Enterprises.GetServiceAccount - * and must have been set as the enterprise service account by calling - * Enterprises.SetAccount. - * @alias androidenterprise.serviceaccountkeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Information about the permissions required by a specific app and whether + * they have been accepted by the enterprise. + */ + export interface Schema$ProductPermissions { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#productPermissions". + */ + kind: string; + /** + * The permissions required by the app. + */ + permission: Schema$ProductPermission[]; + /** + * The ID of the app that the permissions relate to, e.g. + * "app:com.google.android.gm". + */ + productId: string; } -} - -export class Resource$Storelayoutclusters { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * The policy for a product. + */ + export interface Schema$ProductPolicy { + /** + * The ID of the product. For example, + * "app:com.google.android.gm". + */ + productId: string; + /** + * Grants visibility to the specified track(s) of the product to the device. + * The track available to the device is based on the following order of + * preference: alpha, beta, production. For example, if an app has a prod + * version, a beta version and an alpha version and the enterprise has been + * granted visibility to both the alpha and beta tracks, if tracks is + * {"beta", "production"} then the beta version of the + * app is made available to the device. If there are no app versions in the + * specified track adding the "alpha" and "beta" values + * to the list of tracks will have no effect. Note that the enterprise + * requires access to alpha and/or beta tracks before users can be granted + * visibility to apps in those tracks. The allowed sets are: {} (considered + * equivalent to {"production"}) {"production"} + * {"beta", "production"} {"alpha", + * "beta", "production"} The order of elements is not + * relevant. Any other set of tracks will be rejected with an error. + */ + tracks: string[]; } - - getRoot() { - return this.root; + export interface Schema$ProductsApproveRequest { + /** + * The approval URL that was shown to the user. Only the permissions shown + * to the user with that URL will be accepted, which may not be the + * product's entire set of permissions. For example, the URL may only + * display new permissions from an update after the product was approved, or + * not include new permissions if the product was updated since the URL was + * generated. + */ + approvalUrlInfo: Schema$ApprovalUrlInfo; + /** + * Sets how new permission requests for the product are handled. + * "allPermissions" automatically approves all current and future + * permissions for the product. "currentPermissionsOnly" approves + * the current set of permissions for the product, but any future + * permissions added through updates will require manual reapproval. If not + * specified, only the current set of permissions will be approved. + */ + approvedPermissions: string; } - - /** - * androidenterprise.storelayoutclusters.delete - * @desc Deletes a cluster. - * @alias androidenterprise.storelayoutclusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The ID of the cluster. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId', 'clusterId'], - pathParams: ['clusterId', 'enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A set of products. + */ + export interface Schema$ProductSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#productSet". + */ + kind: string; + /** + * The list of product IDs making up the set of products. + */ + productId: string[]; + /** + * The interpretation of this product set. "unknown" should never + * be sent and is ignored if received. "whitelist" means that the + * user is entitled to access the product set. "includeAll" means + * that all products are accessible, including products that are approved, + * products with revoked approval, and products that have never been + * approved. "allApproved" means that the user is entitled to + * access all products that are approved for the enterprise. If the value is + * "allApproved" or "includeAll", the productId field is + * ignored. If no value is provided, it is interpreted as + * "whitelist" for backwards compatibility. Further + * "allApproved" or "includeAll" does not enable + * automatic visibility of "alpha" or "beta" tracks for + * Android app. Use ProductVisibility to enable "alpha" or + * "beta" tracks per user. + */ + productSetBehavior: string; + /** + * Additional list of product IDs making up the product set. Unlike the + * productID array, in this list It's possible to specify which tracks + * (alpha, beta, production) of a product are visible to the user. See + * ProductVisibility and its fields for more information. Specifying the + * same product ID both here and in the productId array is not allowed and + * it will result in an error. + */ + productVisibility: Schema$ProductVisibility[]; + } + export interface Schema$ProductsGenerateApprovalUrlResponse { + /** + * A URL that can be rendered in an iframe to display the permissions (if + * any) of a product. This URL can be used to approve the product only once + * and only within 24 hours of being generated, using the Products.approve + * call. If the product is currently unapproved and has no permissions, this + * URL will point to an empty page. If the product is currently approved, a + * URL will only be generated if that product has added permissions since it + * was last approved, and the URL will only display those new permissions + * that have not yet been accepted. + */ + url: string; + } + export interface Schema$ProductSigningCertificate { + /** + * The base64 urlsafe encoded SHA1 hash of the certificate. (This field is + * deprecated in favor of SHA2-256. It should not be used and may be removed + * at any time.) + */ + certificateHashSha1: string; + /** + * The base64 urlsafe encoded SHA2-256 hash of the certificate. + */ + certificateHashSha256: string; } - - /** - * androidenterprise.storelayoutclusters.get - * @desc Retrieves details of a cluster. - * @alias androidenterprise.storelayoutclusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The ID of the cluster. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId', 'clusterId'], - pathParams: ['clusterId', 'enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The matching products. + */ + export interface Schema$ProductsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#productsListResponse". + */ + kind: string; + /** + * General pagination information. + */ + pageInfo: Schema$PageInfo; + /** + * Information about a product (e.g. an app) in the Google Play store, for + * display to an enterprise admin. + */ + product: Schema$Product[]; + /** + * Pagination information for token pagination. + */ + tokenPagination: Schema$TokenPagination; } - - /** - * androidenterprise.storelayoutclusters.insert - * @desc Inserts a new cluster in a page. - * @alias androidenterprise.storelayoutclusters.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {().StoreCluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A product to be made visible to a user. + */ + export interface Schema$ProductVisibility { + /** + * The product ID to make visible to the user. Required for each item in the + * productVisibility list. + */ + productId: string; + /** + * Grants visibility to the specified track(s) of the product to the user. + * The track available to the user is based on the following order of + * preference: alpha, beta, production. For example, if an app has a prod + * version, a beta version and an alpha version and the enterprise has been + * granted visibility to both the alpha and beta tracks, if tracks is + * {"beta", "production"} the user will be able to + * install the app and they will get the beta version of the app. If there + * are no app versions in the specified track adding the "alpha" + * and "beta" values to the list of tracks will have no effect. + * Note that the enterprise requires access to alpha and/or beta tracks + * before users can be granted visibility to apps in those tracks. The + * allowed sets are: {} (considered equivalent to {"production"}) + * {"production"} {"beta", "production"} + * {"alpha", "beta", "production"} The order + * of elements is not relevant. Any other set of tracks will be rejected + * with an error. + */ + tracks: string[]; } - - /** - * androidenterprise.storelayoutclusters.list - * @desc Retrieves the details of all clusters on the specified page. - * @alias androidenterprise.storelayoutclusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A service account identity, including the name and credentials that can be + * used to authenticate as the service account. + */ + export interface Schema$ServiceAccount { + /** + * Credentials that can be used to authenticate as this ServiceAccount. + */ + key: Schema$ServiceAccountKey; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#serviceAccount". + */ + kind: string; + /** + * The account name of the service account, in the form of an email address. + * Assigned by the server. + */ + name: string; } - - /** - * androidenterprise.storelayoutclusters.patch - * @desc Updates a cluster. This method supports patch semantics. - * @alias androidenterprise.storelayoutclusters.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The ID of the cluster. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {().StoreCluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId', 'clusterId'], - pathParams: ['clusterId', 'enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Credentials that can be used to authenticate as a service account. + */ + export interface Schema$ServiceAccountKey { + /** + * The body of the private key credentials file, in string format. This is + * only populated when the ServiceAccountKey is created, and is not stored + * by Google. + */ + data: string; + /** + * An opaque, unique identifier for this ServiceAccountKey. Assigned by the + * server. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#serviceAccountKey". + */ + kind: string; + /** + * Public key data for the credentials file. This is an X.509 cert. If you + * are using the googleCredentials key type, this is identical to the cert + * that can be retrieved by using the X.509 cert url inside of the + * credentials file. + */ + publicData: string; + /** + * The file format of the generated key data. + */ + type: string; + } + export interface Schema$ServiceAccountKeysListResponse { + /** + * The service account credentials. + */ + serviceAccountKey: Schema$ServiceAccountKey[]; } - - /** - * androidenterprise.storelayoutclusters.update - * @desc Updates a cluster. - * @alias androidenterprise.storelayoutclusters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The ID of the cluster. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {().StoreCluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId', 'clusterId'], - pathParams: ['clusterId', 'enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A resource returned by the GenerateSignupUrl API, which contains the Signup + * URL and Completion Token. + */ + export interface Schema$SignupInfo { + /** + * An opaque token that will be required, along with the Enterprise Token, + * for obtaining the enterprise resource from CompleteSignup. + */ + completionToken: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#signupInfo". + */ + kind: string; + /** + * A URL under which the Admin can sign up for an enterprise. The page + * pointed to cannot be rendered in an iframe. + */ + url: string; } -} - -export class Resource$Storelayoutpages { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * Definition of a managed Google Play store cluster, a list of products + * displayed as part of a store page. + */ + export interface Schema$StoreCluster { + /** + * Unique ID of this cluster. Assigned by the server. Immutable once + * assigned. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#storeCluster". + */ + kind: string; + /** + * Ordered list of localized strings giving the name of this page. The text + * displayed is the one that best matches the user locale, or the first + * entry if there is no good match. There needs to be at least one entry. + */ + name: Schema$LocalizedText[]; + /** + * String (US-ASCII only) used to determine order of this cluster within the + * parent page's elements. Page elements are sorted in lexicographic + * order of this field. Duplicated values are allowed, but ordering between + * elements with duplicate order is undefined. The value of this field is + * never visible to a user, it is used solely for the purpose of defining an + * ordering. Maximum length is 256 characters. + */ + orderInPage: string; + /** + * List of products in the order they are displayed in the cluster. There + * should not be duplicates within a cluster. + */ + productId: string[]; } - - getRoot() { - return this.root; + /** + * General setting for the managed Google Play store layout, currently only + * specifying the page to display the first time the store is opened. + */ + export interface Schema$StoreLayout { + /** + * The ID of the store page to be used as the homepage. The homepage is the + * first page shown in the managed Google Play Store. Not specifying a + * homepage is equivalent to setting the store layout type to + * "basic". + */ + homepageId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#storeLayout". + */ + kind: string; + /** + * The store layout type. By default, this value is set to "basic" + * if the homepageId field is not set, and to "custom" otherwise. + * If set to "basic", the layout will consist of all approved apps + * that have been whitelisted for the user. + */ + storeLayoutType: string; } - - /** - * androidenterprise.storelayoutpages.delete - * @desc Deletes a store page. - * @alias androidenterprise.storelayoutpages.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The store page resources for the enterprise. + */ + export interface Schema$StoreLayoutClustersListResponse { + /** + * A store cluster of an enterprise. + */ + cluster: Schema$StoreCluster[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#storeLayoutClustersListResponse". + */ + kind: string; } - - /** - * androidenterprise.storelayoutpages.get - * @desc Retrieves details of a store page. - * @alias androidenterprise.storelayoutpages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The store page resources for the enterprise. + */ + export interface Schema$StoreLayoutPagesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#storeLayoutPagesListResponse". + */ + kind: string; + /** + * A store page of an enterprise. + */ + page: Schema$StorePage[]; } - - /** - * androidenterprise.storelayoutpages.insert - * @desc Inserts a new store page. - * @alias androidenterprise.storelayoutpages.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().StorePage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Definition of a managed Google Play store page, made of a localized name + * and links to other pages. A page also contains clusters defined as a + * subcollection. + */ + export interface Schema$StorePage { + /** + * Unique ID of this page. Assigned by the server. Immutable once assigned. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#storePage". + */ + kind: string; + /** + * Ordered list of pages a user should be able to reach from this page. The + * pages must exist, must not be this page, and once a link is created the + * page linked to cannot be deleted until all links to it are removed. It is + * recommended that the basic pages are created first, before adding the + * links between pages. No attempt is made to verify that all pages are + * reachable from the homepage. + */ + link: string[]; + /** + * Ordered list of localized strings giving the name of this page. The text + * displayed is the one that best matches the user locale, or the first + * entry if there is no good match. There needs to be at least one entry. + */ + name: Schema$LocalizedText[]; + } + export interface Schema$TokenPagination { + nextPageToken: string; + previousPageToken: string; } - - /** - * androidenterprise.storelayoutpages.list - * @desc Retrieves the details of all pages in the store. - * @alias androidenterprise.storelayoutpages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Users resource represents an account associated with an enterprise. The + * account may be specific to a device or to an individual user (who can then + * use the account across multiple devices). The account may provide access to + * managed Google Play only, or to other Google services, depending on the + * identity model: - The Google managed domain identity model requires + * synchronization to Google account sources (via primaryEmail). - The + * managed Google Play Accounts identity model provides a dynamic means for + * enterprises to create user or device accounts as needed. These accounts + * provide access to managed Google Play. + */ + export interface Schema$User { + /** + * A unique identifier you create for this user, such as "user342" + * or "asset#44418". Do not use personally identifiable + * information (PII) for this property. Must always be set for EMM-managed + * users. Not set for Google-managed users. + */ + accountIdentifier: string; + /** + * The type of account that this user represents. A userAccount can be + * installed on multiple devices, but a deviceAccount is specific to a + * single device. An EMM-managed user (emmManaged) can be either type + * (userAccount, deviceAccount), but a Google-managed user (googleManaged) + * is always a userAccount. + */ + accountType: string; + /** + * The name that will appear in user interfaces. Setting this property is + * optional when creating EMM-managed users. If you do set this property, + * use something generic about the organization (such as "Example, + * Inc.") or your name (as EMM). Not used for Google-managed user + * accounts. + */ + displayName: string; + /** + * The unique ID for the user. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#user". + */ + kind: string; + /** + * The entity that manages the user. With googleManaged users, the source of + * truth is Google so EMMs have to make sure a Google Account exists for the + * user. With emmManaged users, the EMM is in charge. + */ + managementType: string; + /** + * The user's primary email address, for example, + * "jsmith@example.com". Will always be set for Google managed + * users and not set for EMM managed users. + */ + primaryEmail: string; } - - /** - * androidenterprise.storelayoutpages.patch - * @desc Updates the content of a store page. This method supports patch - * semantics. - * @alias androidenterprise.storelayoutpages.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {().StorePage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The matching user resources. + */ + export interface Schema$UsersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#usersListResponse". + */ + kind: string; + /** + * A user of an enterprise. + */ + user: Schema$User[]; } - - /** - * androidenterprise.storelayoutpages.update - * @desc Updates the content of a store page. - * @alias androidenterprise.storelayoutpages.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.pageId The ID of the page. - * @param {().StorePage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'pageId'], - pathParams: ['enterpriseId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A UserToken is used by a user when setting up a managed device or profile + * with their managed Google Play account on a device. When the user enters + * their email address and token (activation code) the appropriate EMM app can + * be automatically downloaded. + */ + export interface Schema$UserToken { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#userToken". + */ + kind: string; + /** + * The token (activation code) to be entered by the user. This consists of a + * sequence of decimal digits. Note that the leading digit may be 0. + */ + token: string; + /** + * The unique ID for the user. + */ + userId: string; } -} - -export class Resource$Users { - root: Androidenterprise; - constructor(root: Androidenterprise) { - this.root = root; - this.getRoot.bind(this); + /** + * A variable set is a key-value pair of EMM-provided placeholders and its + * corresponding value, which is attributed to a user. For example, $FIRSTNAME + * could be a placeholder, and its value could be Alice. Placeholders should + * start with a '$' sign and should be alphanumeric only. + */ + export interface Schema$VariableSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidenterprise#variableSet". + */ + kind: string; + /** + * The placeholder string; defined by EMM. + */ + placeholder: string; + /** + * The value of the placeholder, specific to the user. + */ + userValue: string; } - getRoot() { - return this.root; + export class Resource$Devices { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.devices.get + * @desc Retrieves the details of a device. + * @alias androidenterprise.devices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.devices.getState + * @desc Retrieves whether a device's access to Google services is enabled + * or disabled. The device state takes effect only if enforcing EMM policies + * on Android devices is enabled in the Google Admin Console. Otherwise, the + * device state is ignored and all devices are allowed access to Google + * services. This is only supported for Google-managed users. + * @alias androidenterprise.devices.getState + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getState(params?: any, options?: MethodOptions): + AxiosPromise; + getState( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getState( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.devices.list + * @desc Retrieves the IDs of all of a user's devices. + * @alias androidenterprise.devices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.devices.patch + * @desc Updates the device policy. This method supports patch semantics. + * @alias androidenterprise.devices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.updateMask Mask that identifies which fields to update. If not set, all modifiable fields will be modified. When set in a query parameter, this field should be specified as updateMask=,,... + * @param {string} params.userId The ID of the user. + * @param {().Device} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.devices.setState + * @desc Sets whether a device's access to Google services is enabled or + * disabled. The device state takes effect only if enforcing EMM policies on + * Android devices is enabled in the Google Admin Console. Otherwise, the + * device state is ignored and all devices are allowed access to Google + * services. This is only supported for Google-managed users. + * @alias androidenterprise.devices.setState + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {().DeviceState} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setState(params?: any, options?: MethodOptions): + AxiosPromise; + setState( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setState( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.devices.update + * @desc Updates the device policy + * @alias androidenterprise.devices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.updateMask Mask that identifies which fields to update. If not set, all modifiable fields will be modified. When set in a query parameter, this field should be specified as updateMask=,,... + * @param {string} params.userId The ID of the user. + * @param {().Device} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * androidenterprise.users.delete - * @desc Deleted an EMM-managed user. - * @alias androidenterprise.users.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Enterprises { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.enterprises.acknowledgeNotificationSet + * @desc Acknowledges notifications that were received from + * Enterprises.PullNotificationSet to prevent subsequent calls from + * returning the same notifications. + * @alias androidenterprise.enterprises.acknowledgeNotificationSet + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.notificationSetId The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledgeNotificationSet(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledgeNotificationSet( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + acknowledgeNotificationSet( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/acknowledgeNotificationSet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.completeSignup + * @desc Completes the signup flow, by specifying the Completion token and + * Enterprise token. This request must not be called multiple times for a + * given Enterprise Token. + * @alias androidenterprise.enterprises.completeSignup + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.completionToken The Completion token initially returned by GenerateSignupUrl. + * @param {string=} params.enterpriseToken The Enterprise token appended to the Callback URL. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + completeSignup(params?: any, options?: MethodOptions): + AxiosPromise; + completeSignup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + completeSignup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/androidenterprise/v1/enterprises/completeSignup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.createWebToken + * @desc Returns a unique token to access an embeddable UI. To generate a + * web UI, pass the generated token into the managed Google Play javascript + * API. Each token may only be used to start one UI session. See the + * javascript API documentation for further information. + * @alias androidenterprise.enterprises.createWebToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().AdministratorWebTokenSpec} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createWebToken(params?: any, options?: MethodOptions): + AxiosPromise; + createWebToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + createWebToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/createWebToken') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.delete + * @desc Deletes the binding between the EMM and enterprise. This is now + * deprecated. Use this method only to unenroll customers that were + * previously enrolled with the insert call, then enroll them again with the + * enroll call. + * @alias androidenterprise.enterprises.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/androidenterprise/v1/enterprises/{enterpriseId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.enroll + * @desc Enrolls an enterprise with the calling EMM. + * @alias androidenterprise.enterprises.enroll + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.token The token provided by the enterprise to register the EMM. + * @param {().Enterprise} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enroll(params?: any, options?: MethodOptions): + AxiosPromise; + enroll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enroll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/androidenterprise/v1/enterprises/enroll') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['token'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.generateSignupUrl + * @desc Generates a sign-up URL. + * @alias androidenterprise.enterprises.generateSignupUrl + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.callbackUrl The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateSignupUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateSignupUrl( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generateSignupUrl( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/androidenterprise/v1/enterprises/signupUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.get + * @desc Retrieves the name and domain of an enterprise. + * @alias androidenterprise.enterprises.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/androidenterprise/v1/enterprises/{enterpriseId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.getAndroidDevicePolicyConfig + * @desc Returns the Android Device Policy config resource. + * @alias androidenterprise.enterprises.getAndroidDevicePolicyConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAndroidDevicePolicyConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getAndroidDevicePolicyConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getAndroidDevicePolicyConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/androidDevicePolicyConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.getServiceAccount + * @desc Returns a service account and credentials. The service account can + * be bound to the enterprise by calling setAccount. The service account is + * unique to this enterprise and EMM, and will be deleted if the enterprise + * is unbound. The credentials contain private key data and are not stored + * server-side. This method can only be called after calling + * Enterprises.Enroll or Enterprises.CompleteSignup, and before + * Enterprises.SetAccount; at other times it will return an error. + * Subsequent calls after the first will generate a new, unique set of + * credentials, and invalidate the previously generated credentials. Once + * the service account is bound to the enterprise, it can be managed using + * the serviceAccountKeys resource. + * @alias androidenterprise.enterprises.getServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.keyType The type of credential to return with the service account. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + getServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.getStoreLayout + * @desc Returns the store layout for the enterprise. If the store layout + * has not been set, returns "basic" as the store layout type and no + * homepage. + * @alias androidenterprise.enterprises.getStoreLayout + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getStoreLayout(params?: any, options?: MethodOptions): + AxiosPromise; + getStoreLayout( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getStoreLayout( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.insert + * @desc Establishes the binding between the EMM and an enterprise. This is + * now deprecated; use enroll instead. + * @alias androidenterprise.enterprises.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.token The token provided by the enterprise to register the EMM. + * @param {().Enterprise} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/androidenterprise/v1/enterprises') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['token'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.list + * @desc Looks up an enterprise by domain name. This is only supported for + * enterprises created via the Google-initiated creation flow. Lookup of the + * id is not needed for enterprises created via the EMM-initiated flow since + * the EMM learns the enterprise ID in the callback specified in the + * Enterprises.generateSignupUrl call. + * @alias androidenterprise.enterprises.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.domain The exact primary domain name of the enterprise to look up. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/androidenterprise/v1/enterprises') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['domain'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.pullNotificationSet + * @desc Pulls and returns a notification set for the enterprises associated + * with the service account authenticated for the request. The notification + * set may be empty if no notification are pending. A notification set + * returned needs to be acknowledged within 20 seconds by calling + * Enterprises.AcknowledgeNotificationSet, unless the notification set is + * empty. Notifications that are not acknowledged within the 20 seconds will + * eventually be included again in the response to another + * PullNotificationSet request, and those that are never acknowledged will + * ultimately be deleted according to the Google Cloud Platform Pub/Sub + * system policy. Multiple requests might be performed concurrently to + * retrieve notifications, in which case the pending notifications (if any) + * will be split among each caller, if any are pending. If no notifications + * are present, an empty notification list is returned. Subsequent requests + * may return more notifications once they become available. + * @alias androidenterprise.enterprises.pullNotificationSet + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.requestMode The request mode for pulling notifications. Specifying waitForNotifications will cause the request to block and wait until one or more notifications are present, or return an empty notification list if no notifications are present after some time. Speciying returnImmediately will cause the request to immediately return the pending notifications, or an empty list if no notifications are present. If omitted, defaults to waitForNotifications. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pullNotificationSet(params?: any, options?: MethodOptions): + AxiosPromise; + pullNotificationSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pullNotificationSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/pullNotificationSet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.sendTestPushNotification + * @desc Sends a test notification to validate the EMM integration with the + * Google Cloud Pub/Sub service for this enterprise. + * @alias androidenterprise.enterprises.sendTestPushNotification + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sendTestPushNotification(params?: any, options?: MethodOptions): + AxiosPromise; + sendTestPushNotification( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$EnterprisesSendTestPushNotificationResponse>, + callback?: BodyResponseCallback< + Schema$EnterprisesSendTestPushNotificationResponse>): void; + sendTestPushNotification( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$EnterprisesSendTestPushNotificationResponse>, + callback?: BodyResponseCallback< + Schema$EnterprisesSendTestPushNotificationResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$EnterprisesSendTestPushNotificationResponse>(parameters); + } + } + + + /** + * androidenterprise.enterprises.setAccount + * @desc Sets the account that will be used to authenticate to the API as + * the enterprise. + * @alias androidenterprise.enterprises.setAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().EnterpriseAccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAccount(params?: any, options?: MethodOptions): + AxiosPromise; + setAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/account') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.setAndroidDevicePolicyConfig + * @desc Sets the Android Device Policy config resource. EMM may use this + * method to enable or disable Android Device Policy support for the + * specified enterprise. To learn more about managing devices and apps with + * Android Device Policy, see the Android Management API. + * @alias androidenterprise.enterprises.setAndroidDevicePolicyConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().AndroidDevicePolicyConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAndroidDevicePolicyConfig(params?: any, options?: MethodOptions): + AxiosPromise; + setAndroidDevicePolicyConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + setAndroidDevicePolicyConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/androidDevicePolicyConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.setStoreLayout + * @desc Sets the store layout for the enterprise. By default, + * storeLayoutType is set to "basic" and the basic store layout is enabled. + * The basic layout only contains apps approved by the admin, and that have + * been added to the available product set for a user (using the + * setAvailableProductSet call). Apps on the page are sorted in order of + * their product ID value. If you create a custom store layout (by setting + * storeLayoutType = "custom" and setting a homepage), the basic store + * layout is disabled. + * @alias androidenterprise.enterprises.setStoreLayout + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().StoreLayout} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setStoreLayout(params?: any, options?: MethodOptions): + AxiosPromise; + setStoreLayout( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setStoreLayout( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.enterprises.unenroll + * @desc Unenrolls an enterprise from the calling EMM. + * @alias androidenterprise.enterprises.unenroll + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unenroll(params?: any, options?: MethodOptions): AxiosPromise; + unenroll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unenroll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/unenroll') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.generateAuthenticationToken - * @desc Generates an authentication token which the device policy client can - * use to provision the given EMM-managed user account on a device. The - * generated token is single-use and expires after a few minutes. This call - * only works with EMM-managed accounts. - * @alias androidenterprise.users.generateAuthenticationToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateAuthenticationToken(params?: any, options?: MethodOptions): - AxiosPromise; - generateAuthenticationToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateAuthenticationToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Entitlements { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.entitlements.delete + * @desc Removes an entitlement to an app for a user. + * @alias androidenterprise.entitlements.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'entitlementId'], + pathParams: ['enterpriseId', 'entitlementId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.entitlements.get + * @desc Retrieves details of an entitlement. + * @alias androidenterprise.entitlements.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'entitlementId'], + pathParams: ['enterpriseId', 'entitlementId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.entitlements.list + * @desc Lists all entitlements for the specified user. Only the ID is set. + * @alias androidenterprise.entitlements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.entitlements.patch + * @desc Adds or updates an entitlement to an app for a user. This method + * supports patch semantics. + * @alias androidenterprise.entitlements.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * @param {boolean=} params.install Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. + * @param {string} params.userId The ID of the user. + * @param {().Entitlement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'entitlementId'], + pathParams: ['enterpriseId', 'entitlementId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.entitlements.update + * @desc Adds or updates an entitlement to an app for a user. + * @alias androidenterprise.entitlements.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.entitlementId The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + * @param {boolean=} params.install Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user. + * @param {string} params.userId The ID of the user. + * @param {().Entitlement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'entitlementId'], + pathParams: ['enterpriseId', 'entitlementId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.generateToken - * @desc Generates a token (activation code) to allow this user to configure - * their managed account in the Android Setup Wizard. Revokes any previously - * generated token. This call only works with Google managed accounts. - * @alias androidenterprise.users.generateToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateToken(params?: any, options?: MethodOptions): - AxiosPromise; - generateToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Grouplicenses { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.grouplicenses.get + * @desc Retrieves details of an enterprise's group license for a product. + * @alias androidenterprise.grouplicenses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.groupLicenseId The ID of the product the group license is for, e.g. "app:com.google.android.gm". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'groupLicenseId'], + pathParams: ['enterpriseId', 'groupLicenseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.grouplicenses.list + * @desc Retrieves IDs of all products for which the enterprise has a group + * license. + * @alias androidenterprise.grouplicenses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.get - * @desc Retrieves a user's details. - * @alias androidenterprise.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Grouplicenseusers { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.grouplicenseusers.list + * @desc Retrieves the IDs of the users who have been granted entitlements + * under the license. + * @alias androidenterprise.grouplicenseusers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.groupLicenseId The ID of the product the group license is for, e.g. "app:com.google.android.gm". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'groupLicenseId'], + pathParams: ['enterpriseId', 'groupLicenseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * androidenterprise.users.getAvailableProductSet - * @desc Retrieves the set of products a user is entitled to access. - * @alias androidenterprise.users.getAvailableProductSet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAvailableProductSet(params?: any, options?: MethodOptions): - AxiosPromise; - getAvailableProductSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAvailableProductSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Installs { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.installs.delete + * @desc Requests to remove an app from a device. A call to get or list will + * still show the app as installed on the device until it is actually + * removed. + * @alias androidenterprise.installs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], + pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.installs.get + * @desc Retrieves details of an installation of an app on a device. + * @alias androidenterprise.installs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], + pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.installs.list + * @desc Retrieves the details of all apps installed on the specified + * device. + * @alias androidenterprise.installs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.installs.patch + * @desc Requests to install the latest version of an app to a device. If + * the app is already installed, then it is updated to the latest version if + * necessary. This method supports patch semantics. + * @alias androidenterprise.installs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().Install} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], + pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.installs.update + * @desc Requests to install the latest version of an app to a device. If + * the app is already installed, then it is updated to the latest version if + * necessary. + * @alias androidenterprise.installs.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.installId The ID of the product represented by the install, e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().Install} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId', 'installId'], + pathParams: ['deviceId', 'enterpriseId', 'installId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.insert - * @desc Creates a new EMM-managed user. The Users resource passed in the - * body of the request should include an accountIdentifier and an accountType. - * If a corresponding user already exists with the same account identifier, - * the user will be updated with the resource. In this case only the - * displayName field can be changed. - * @alias androidenterprise.users.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['enterpriseId'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Managedconfigurationsfordevice { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.managedconfigurationsfordevice.delete + * @desc Removes a per-device managed configuration for an app for the + * specified device. + * @alias androidenterprise.managedconfigurationsfordevice.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: [ + 'enterpriseId', 'userId', 'deviceId', + 'managedConfigurationForDeviceId' + ], + pathParams: [ + 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', + 'userId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsfordevice.get + * @desc Retrieves details of a per-device managed configuration. + * @alias androidenterprise.managedconfigurationsfordevice.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [ + 'enterpriseId', 'userId', 'deviceId', + 'managedConfigurationForDeviceId' + ], + pathParams: [ + 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', + 'userId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsfordevice.list + * @desc Lists all the per-device managed configurations for the specified + * device. Only the ID is set. + * @alias androidenterprise.managedconfigurationsfordevice.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsForDeviceListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsForDeviceListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId', 'deviceId'], + pathParams: ['deviceId', 'enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ManagedConfigurationsForDeviceListResponse>(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsfordevice.patch + * @desc Adds or updates a per-device managed configuration for an app for + * the specified device. This method supports patch semantics. + * @alias androidenterprise.managedconfigurationsfordevice.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().ManagedConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: [ + 'enterpriseId', 'userId', 'deviceId', + 'managedConfigurationForDeviceId' + ], + pathParams: [ + 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', + 'userId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsfordevice.update + * @desc Adds or updates a per-device managed configuration for an app for + * the specified device. + * @alias androidenterprise.managedconfigurationsfordevice.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceId The Android ID of the device. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForDeviceId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().ManagedConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [ + 'enterpriseId', 'userId', 'deviceId', + 'managedConfigurationForDeviceId' + ], + pathParams: [ + 'deviceId', 'enterpriseId', 'managedConfigurationForDeviceId', + 'userId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.list - * @desc Looks up a user by primary email address. This is only supported for - * Google-managed users. Lookup of the id is not needed for EMM-managed users - * because the id is already returned in the result of the Users.insert call. - * @alias androidenterprise.users.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.email The exact primary email address of the user to look up. - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['enterpriseId', 'email'], - pathParams: ['enterpriseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Managedconfigurationsforuser { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.managedconfigurationsforuser.delete + * @desc Removes a per-user managed configuration for an app for the + * specified user. + * @alias androidenterprise.managedconfigurationsforuser.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: + ['enterpriseId', 'userId', 'managedConfigurationForUserId'], + pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsforuser.get + * @desc Retrieves details of a per-user managed configuration for an app + * for the specified user. + * @alias androidenterprise.managedconfigurationsforuser.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['enterpriseId', 'userId', 'managedConfigurationForUserId'], + pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsforuser.list + * @desc Lists all the per-user managed configurations for the specified + * user. Only the ID is set. + * @alias androidenterprise.managedconfigurationsforuser.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsForUserListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsForUserListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ManagedConfigurationsForUserListResponse>(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsforuser.patch + * @desc Adds or updates the managed configuration settings for an app for + * the specified user. If you support the Managed configurations iframe, you + * can apply managed configurations to a user by specifying an mcmId and its + * associated configuration variables (if any) in the request. + * Alternatively, all EMMs can apply managed configurations by passing a + * list of managed properties. This method supports patch semantics. + * @alias androidenterprise.managedconfigurationsforuser.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().ManagedConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: + ['enterpriseId', 'userId', 'managedConfigurationForUserId'], + pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.managedconfigurationsforuser.update + * @desc Adds or updates the managed configuration settings for an app for + * the specified user. If you support the Managed configurations iframe, you + * can apply managed configurations to a user by specifying an mcmId and its + * associated configuration variables (if any) in the request. + * Alternatively, all EMMs can apply managed configurations by passing a + * list of managed properties. + * @alias androidenterprise.managedconfigurationsforuser.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.managedConfigurationForUserId The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + * @param {string} params.userId The ID of the user. + * @param {().ManagedConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: + ['enterpriseId', 'userId', 'managedConfigurationForUserId'], + pathParams: ['enterpriseId', 'managedConfigurationForUserId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.patch - * @desc Updates the details of an EMM-managed user. Can be used with - * EMM-managed users only (not Google managed users). Pass the new details in - * the Users resource in the request body. Only the displayName field can be - * changed. Other fields must either be unset or have the currently active - * value. This method supports patch semantics. - * @alias androidenterprise.users.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Managedconfigurationssettings { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.managedconfigurationssettings.list + * @desc Lists all the managed configurations settings for the specified + * app. Only the ID and the name is set. + * @alias androidenterprise.managedconfigurationssettings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.productId The ID of the product for which the managed configurations settings applies to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsSettingsListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ManagedConfigurationsSettingsListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/managedConfigurationsSettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ManagedConfigurationsSettingsListResponse>(parameters); + } } } - - /** - * androidenterprise.users.revokeDeviceAccess - * @desc Revokes access to all devices currently provisioned to the user. The - * user will no longer be able to use the managed Play store on any of their - * managed devices. This call only works with EMM-managed accounts. - * @alias androidenterprise.users.revokeDeviceAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revokeDeviceAccess(params?: any, options?: MethodOptions): AxiosPromise; - revokeDeviceAccess( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revokeDeviceAccess( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Permissions { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.permissions.get + * @desc Retrieves details of an Android app permission for display to an + * enterprise admin. + * @alias androidenterprise.permissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de") + * @param {string} params.permissionId The ID of the permission. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/androidenterprise/v1/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['permissionId'], + pathParams: ['permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.revokeToken - * @desc Revokes a previously generated token (activation code) for the user. - * @alias androidenterprise.users.revokeToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revokeToken(params?: any, options?: MethodOptions): AxiosPromise; - revokeToken( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revokeToken( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Products { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.products.approve + * @desc Approves the specified product and the relevant app permissions, if + * any. The maximum number of products that you can approve per enterprise + * customer is 1,000. To learn how to use managed Google Play to design and + * create a store layout to display approved products to your users, see + * Store Layout Design. + * @alias androidenterprise.products.approve + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.productId The ID of the product. + * @param {().ProductsApproveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + approve(params?: any, options?: MethodOptions): AxiosPromise; + approve( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + approve( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.products.generateApprovalUrl + * @desc Generates a URL that can be rendered in an iframe to display the + * permissions (if any) of a product. An enterprise admin must view these + * permissions and accept them on behalf of their organization in order to + * approve that product. Admins should accept the displayed permissions by + * interacting with a separate UI element in the EMM console, which in turn + * should trigger the use of this URL as the approvalUrlInfo.approvalUrl + * property in a Products.approve call to approve the product. This URL can + * only be used to display permissions for up to 1 day. + * @alias androidenterprise.products.generateApprovalUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.languageCode The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". + * @param {string} params.productId The ID of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateApprovalUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateApprovalUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + generateApprovalUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androidenterprise.products.get + * @desc Retrieves details of a product for display to an enterprise admin. + * @alias androidenterprise.products.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + * @param {string} params.productId The ID of the product, e.g. "app:com.google.android.gm". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.products.getAppRestrictionsSchema + * @desc Retrieves the schema that defines the configurable properties for + * this product. All products have a schema, but this schema may be empty if + * no managed configurations have been defined. This schema can be used to + * populate a UI that allows an admin to configure the product. To apply a + * managed configuration based on the schema obtained using this API, see + * Managed Configurations through Play. + * @alias androidenterprise.products.getAppRestrictionsSchema + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + * @param {string} params.productId The ID of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAppRestrictionsSchema(params?: any, options?: MethodOptions): + AxiosPromise; + getAppRestrictionsSchema( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAppRestrictionsSchema( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.products.getPermissions + * @desc Retrieves the Android app permissions required by this app. + * @alias androidenterprise.products.getPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.productId The ID of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + getPermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getPermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.products.list + * @desc Finds approved products that match a query, or all approved + * products if there is no query. + * @alias androidenterprise.products.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.approved Specifies whether to search among all products (false) or among only products that have been approved (true). Only "true" is supported, and should be specified. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string=} params.language The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). Results are returned in the language best matching the preferred language. + * @param {integer=} params.maxResults Specifies the maximum number of products that can be returned per request. If not specified, uses a default value of 100, which is also the maximum retrievable within a single response. + * @param {string=} params.query The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps). + * @param {string=} params.token A pagination token is contained in a request''s response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.products.unapprove + * @desc Unapproves the specified product (and the relevant app permissions, + * if any) + * @alias androidenterprise.products.unapprove + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.productId The ID of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unapprove(params?: any, options?: MethodOptions): AxiosPromise; + unapprove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unapprove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'productId'], + pathParams: ['enterpriseId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidenterprise.users.setAvailableProductSet - * @desc Modifies the set of products that a user is entitled to access - * (referred to as whitelisted products). Only products that are approved or - * products that were previously approved (products with revoked approval) can - * be whitelisted. - * @alias androidenterprise.users.setAvailableProductSet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {().ProductSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAvailableProductSet(params?: any, options?: MethodOptions): - AxiosPromise; - setAvailableProductSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAvailableProductSet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Serviceaccountkeys { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.serviceaccountkeys.delete + * @desc Removes and invalidates the specified credentials for the service + * account associated with this enterprise. The calling service account must + * have been retrieved by calling Enterprises.GetServiceAccount and must + * have been set as the enterprise service account by calling + * Enterprises.SetAccount. + * @alias androidenterprise.serviceaccountkeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.keyId The ID of the key. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys/{keyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'keyId'], + pathParams: ['enterpriseId', 'keyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.serviceaccountkeys.insert + * @desc Generates new credentials for the service account associated with + * this enterprise. The calling service account must have been retrieved by + * calling Enterprises.GetServiceAccount and must have been set as the + * enterprise service account by calling Enterprises.SetAccount. Only the + * type of the key should be populated in the resource to be inserted. + * @alias androidenterprise.serviceaccountkeys.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().ServiceAccountKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.serviceaccountkeys.list + * @desc Lists all active credentials for the service account associated + * with this enterprise. Only the ID and key type are returned. The calling + * service account must have been retrieved by calling + * Enterprises.GetServiceAccount and must have been set as the enterprise + * service account by calling Enterprises.SetAccount. + * @alias androidenterprise.serviceaccountkeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * androidenterprise.users.update - * @desc Updates the details of an EMM-managed user. Can be used with - * EMM-managed users only (not Google managed users). Pass the new details in - * the Users resource in the request body. Only the displayName field can be - * changed. Other fields must either be unset or have the currently active - * value. - * @alias androidenterprise.users.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.enterpriseId The ID of the enterprise. - * @param {string} params.userId The ID of the user. - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Storelayoutclusters { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.storelayoutclusters.delete + * @desc Deletes a cluster. + * @alias androidenterprise.storelayoutclusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The ID of the cluster. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId', 'clusterId'], + pathParams: ['clusterId', 'enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutclusters.get + * @desc Retrieves details of a cluster. + * @alias androidenterprise.storelayoutclusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The ID of the cluster. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId', 'clusterId'], + pathParams: ['clusterId', 'enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutclusters.insert + * @desc Inserts a new cluster in a page. + * @alias androidenterprise.storelayoutclusters.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {().StoreCluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutclusters.list + * @desc Retrieves the details of all clusters on the specified page. + * @alias androidenterprise.storelayoutclusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androidenterprise.storelayoutclusters.patch + * @desc Updates a cluster. This method supports patch semantics. + * @alias androidenterprise.storelayoutclusters.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The ID of the cluster. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {().StoreCluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId', 'clusterId'], + pathParams: ['clusterId', 'enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutclusters.update + * @desc Updates a cluster. + * @alias androidenterprise.storelayoutclusters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The ID of the cluster. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {().StoreCluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId', 'clusterId'], + pathParams: ['clusterId', 'enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Storelayoutpages { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.storelayoutpages.delete + * @desc Deletes a store page. + * @alias androidenterprise.storelayoutpages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutpages.get + * @desc Retrieves details of a store page. + * @alias androidenterprise.storelayoutpages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutpages.insert + * @desc Inserts a new store page. + * @alias androidenterprise.storelayoutpages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().StorePage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutpages.list + * @desc Retrieves the details of all pages in the store. + * @alias androidenterprise.storelayoutpages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androidenterprise.storelayoutpages.patch + * @desc Updates the content of a store page. This method supports patch + * semantics. + * @alias androidenterprise.storelayoutpages.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {().StorePage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.storelayoutpages.update + * @desc Updates the content of a store page. + * @alias androidenterprise.storelayoutpages.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.pageId The ID of the page. + * @param {().StorePage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'pageId'], + pathParams: ['enterpriseId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['enterpriseId', 'userId'], - pathParams: ['enterpriseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Users { + root: Androidenterprise; + constructor(root: Androidenterprise) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidenterprise.users.delete + * @desc Deleted an EMM-managed user. + * @alias androidenterprise.users.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.generateAuthenticationToken + * @desc Generates an authentication token which the device policy client + * can use to provision the given EMM-managed user account on a device. The + * generated token is single-use and expires after a few minutes. This call + * only works with EMM-managed accounts. + * @alias androidenterprise.users.generateAuthenticationToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateAuthenticationToken(params?: any, options?: MethodOptions): + AxiosPromise; + generateAuthenticationToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + generateAuthenticationToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.generateToken + * @desc Generates a token (activation code) to allow this user to configure + * their managed account in the Android Setup Wizard. Revokes any previously + * generated token. This call only works with Google managed accounts. + * @alias androidenterprise.users.generateToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateToken(params?: any, options?: MethodOptions): + AxiosPromise; + generateToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generateToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.get + * @desc Retrieves a user's details. + * @alias androidenterprise.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.getAvailableProductSet + * @desc Retrieves the set of products a user is entitled to access. + * @alias androidenterprise.users.getAvailableProductSet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAvailableProductSet(params?: any, options?: MethodOptions): + AxiosPromise; + getAvailableProductSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAvailableProductSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.insert + * @desc Creates a new EMM-managed user. The Users resource passed in the + * body of the request should include an accountIdentifier and an + * accountType. If a corresponding user already exists with the same account + * identifier, the user will be updated with the resource. In this case only + * the displayName field can be changed. + * @alias androidenterprise.users.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['enterpriseId'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.list + * @desc Looks up a user by primary email address. This is only supported + * for Google-managed users. Lookup of the id is not needed for EMM-managed + * users because the id is already returned in the result of the + * Users.insert call. + * @alias androidenterprise.users.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.email The exact primary email address of the user to look up. + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['enterpriseId', 'email'], + pathParams: ['enterpriseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.patch + * @desc Updates the details of an EMM-managed user. Can be used with + * EMM-managed users only (not Google managed users). Pass the new details + * in the Users resource in the request body. Only the displayName field can + * be changed. Other fields must either be unset or have the currently + * active value. This method supports patch semantics. + * @alias androidenterprise.users.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.revokeDeviceAccess + * @desc Revokes access to all devices currently provisioned to the user. + * The user will no longer be able to use the managed Play store on any of + * their managed devices. This call only works with EMM-managed accounts. + * @alias androidenterprise.users.revokeDeviceAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revokeDeviceAccess(params?: any, options?: MethodOptions): + AxiosPromise; + revokeDeviceAccess( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revokeDeviceAccess( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/deviceAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.revokeToken + * @desc Revokes a previously generated token (activation code) for the + * user. + * @alias androidenterprise.users.revokeToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revokeToken(params?: any, options?: MethodOptions): AxiosPromise; + revokeToken( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revokeToken( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.setAvailableProductSet + * @desc Modifies the set of products that a user is entitled to access + * (referred to as whitelisted products). Only products that are approved or + * products that were previously approved (products with revoked approval) + * can be whitelisted. + * @alias androidenterprise.users.setAvailableProductSet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {().ProductSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAvailableProductSet(params?: any, options?: MethodOptions): + AxiosPromise; + setAvailableProductSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAvailableProductSet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/availableProductSet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidenterprise.users.update + * @desc Updates the details of an EMM-managed user. Can be used with + * EMM-managed users only (not Google managed users). Pass the new details + * in the Users resource in the request body. Only the displayName field can + * be changed. Other fields must either be unset or have the currently + * active value. + * @alias androidenterprise.users.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.enterpriseId The ID of the enterprise. + * @param {string} params.userId The ID of the user. + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['enterpriseId', 'userId'], + pathParams: ['enterpriseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androidmanagement/v1.ts b/src/apis/androidmanagement/v1.ts index e8b50c18c27..693675167d7 100644 --- a/src/apis/androidmanagement/v1.ts +++ b/src/apis/androidmanagement/v1.ts @@ -27,2890 +27,2931 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Android Management API - * - * The Android Management API provides remote enterprise management of Android - * devices and apps. - * - * @example - * const google = require('googleapis'); - * const androidmanagement = google.androidmanagement('v1'); - * - * @namespace androidmanagement - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Androidmanagement - */ -export class Androidmanagement { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - enterprises: Resource$Enterprises; - signupUrls: Resource$Signupurls; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.enterprises = new Resource$Enterprises(this); - this.signupUrls = new Resource$Signupurls(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Configuration for an always-on VPN connection. - */ -export interface Schema$AlwaysOnVpnPackage { - /** - * Disallows networking when the VPN is not connected. - */ - lockdownEnabled: boolean; - /** - * The package name of the VPN app. - */ - packageName: string; -} -/** - * A compliance rule condition which is satisfied if the Android Framework API - * level on the device doesn't meet a minimum requirement. There can only be - * one rule with this type of condition per policy. - */ -export interface Schema$ApiLevelCondition { - /** - * The minimum desired Android Framework API level. If the device doesn't - * meet the minimum requirement, this condition is satisfied. Must be greater - * than zero. - */ - minApiLevel: number; -} -/** - * Information about an app. - */ -export interface Schema$Application { - /** - * The set of managed properties available to be pre-configured for the app. - */ - managedProperties: Schema$ManagedProperty[]; - /** - * The name of the app in the form - * enterprises/{enterpriseId}/applications/{package_name}. - */ - name: string; - /** - * The permissions required by the app. - */ - permissions: Schema$ApplicationPermission[]; - /** - * The title of the app. Localized. - */ - title: string; -} -/** - * A permission required by the app. - */ -export interface Schema$ApplicationPermission { - /** - * A longer description of the permission, providing more detail on what it - * affects. Localized. - */ - description: string; - /** - * The name of the permission. Localized. - */ - name: string; - /** - * An opaque string uniquely identifying the permission. Not localized. - */ - permissionId: string; -} -/** - * Policy for an individual app. - */ -export interface Schema$ApplicationPolicy { - /** - * The default policy for all permissions requested by the app. If specified, - * this overrides the policy-level default_permission_policy which applies to - * all apps. It does not override the permission_grants which applies to all - * apps. - */ - defaultPermissionPolicy: string; - /** - * The scopes delegated to the app from Android Device Policy. - */ - delegatedScopes: string[]; - /** - * The type of installation to perform. - */ - installType: string; - /** - * Whether the app is allowed to lock itself in full-screen mode. - */ - lockTaskAllowed: boolean; - /** - * Managed configuration applied to the app. The format for the configuration - * is dictated by the ManagedProperty values supported by the app. Each field - * name in the managed configuration must match the key field of the - * ManagedProperty. The field value must be compatible with the type of the - * ManagedProperty: <table> - * <tr><td><i>type</i></td><td><i>JSON - * value</i></td></tr> - * <tr><td>BOOL</td><td>true or - * false</td></tr> - * <tr><td>STRING</td><td>string</td></tr> - * <tr><td>INTEGER</td><td>number</td></tr> - * <tr><td>CHOICE</td><td>string</td></tr> - * <tr><td>MULTISELECT</td><td>array of - * strings</td></tr> - * <tr><td>HIDDEN</td><td>string</td></tr> - * <tr><td>BUNDLE_ARRAY</td><td>array of - * objects</td></tr> </table> - */ - managedConfiguration: any; - /** - * The minimum version of the app that runs on the device. If set, the device - * attempts to update the app to at least this version code. If the app is not - * up-to-date, the device will contain a NonComplianceDetail with - * non_compliance_reason set to APP_NOT_UPDATED. The app must already be - * published to Google Play with a version code greater than or equal to this - * value. At most 20 apps may specify a minimum version code per policy. - */ - minimumVersionCode: number; - /** - * The package name of the app. For example, com.google.android.youtube for - * the YouTube app. - */ - packageName: string; - /** - * Explicit permission grants or denials for the app. These values override - * the default_permission_policy and permission_grants which apply to all - * apps. - */ - permissionGrants: Schema$PermissionGrant[]; -} -/** - * A command. - */ -export interface Schema$Command { - /** - * The timestamp at which the command was created. The timestamp is - * automatically generated by the server. - */ - createTime: string; - /** - * The duration for which the command is valid. The command will expire if not - * executed by the device during this time. The default duration if - * unspecified is ten minutes. There is no maximum duration. - */ - duration: string; - /** - * If the command failed, an error code explaining the failure. This is not - * set when the command is cancelled by the caller. - */ - errorCode: string; - /** - * For commands of type RESET_PASSWORD, optionally specifies the new password. - */ - newPassword: string; - /** - * For commands of type RESET_PASSWORD, optionally specifies flags. - */ - resetPasswordFlags: string[]; - /** - * The type of the command. - */ - type: string; - /** - * The resource name of the user that owns the device in the form - * enterprises/{enterpriseId}/users/{userId}. This is automatically generated - * by the server based on the device the command is sent to. - */ - userName: string; -} -/** - * A rule declaring which mitigating actions to take when a device is not - * compliant with its policy. For every rule, there is always an implicit - * mitigating action to set policy_compliant to false for the Device resource, - * and display a message on the device indicating that the device is not - * compliant with its policy. Other mitigating actions may optionally be taken - * as well, depending on the field values in the rule. - */ -export interface Schema$ComplianceRule { - /** - * A condition which is satisfied if the Android Framework API level on the - * device doesn't meet a minimum requirement. - */ - apiLevelCondition: Schema$ApiLevelCondition; - /** - * If set to true, the rule includes a mitigating action to disable apps so - * that the device is effectively disabled, but app data is preserved. If the - * device is running an app in locked task mode, the app will be closed and a - * UI showing the reason for non-compliance will be displayed. - */ - disableApps: boolean; - /** - * A condition which is satisfied if there exists any matching - * NonComplianceDetail for the device. - */ - nonComplianceDetailCondition: Schema$NonComplianceDetailCondition; -} -/** - * A device owned by an enterprise. Unless otherwise noted, all fields are - * read-only and can't be modified by enterprises.devices.patch. - */ -export interface Schema$Device { - /** - * The API level of the Android platform version running on the device. - */ - apiLevel: number; - /** - * The name of the policy currently applied to the device. - */ - appliedPolicyName: string; - /** - * The version of the policy currently applied to the device. - */ - appliedPolicyVersion: string; - /** - * The state currently applied to the device. - */ - appliedState: string; - /** - * Device settings information. This information is only available if - * deviceSettingsEnabled is true in the device's policy. - */ - deviceSettings: Schema$DeviceSettings; - /** - * If the device state is DISABLED, an optional message that is displayed on - * the device indicating the reason the device is disabled. This field can be - * modified by a patch request. - */ - disabledReason: Schema$UserFacingMessage; - /** - * Detailed information about displays on the device. This information is only - * available if displayInfoEnabled is true in the device's policy. - */ - displays: Schema$Display[]; - /** - * The time of device enrollment. - */ - enrollmentTime: string; - /** - * If the device was enrolled with an enrollment token with additional data - * provided, this field contains that data. - */ - enrollmentTokenData: string; - /** - * If the device was enrolled with an enrollment token, this field contains - * the name of the token. - */ - enrollmentTokenName: string; - /** - * Detailed information about the device hardware. - */ - hardwareInfo: Schema$HardwareInfo; - /** - * Hardware status samples in chronological order. This information is only - * available if hardwareStatusEnabled is true in the device's policy. - */ - hardwareStatusSamples: Schema$HardwareStatus[]; - /** - * The last time the device sent a policy compliance report. - */ - lastPolicyComplianceReportTime: string; - /** - * The last time the device fetched its policy. - */ - lastPolicySyncTime: string; - /** - * The last time the device sent a status report. - */ - lastStatusReportTime: string; - /** - * Events related to memory and storage measurements in chronological order. - * This information is only available if memoryInfoEnabled is true in the - * device's policy. - */ - memoryEvents: Schema$MemoryEvent[]; - /** - * Memory information. This information is only available if memoryInfoEnabled - * is true in the device's policy. - */ - memoryInfo: Schema$MemoryInfo; - /** - * The name of the device in the form - * enterprises/{enterpriseId}/devices/{deviceId}. - */ - name: string; - /** - * Device network information. This information is only available if - * networkInfoEnabled is true in the device's policy. - */ - networkInfo: Schema$NetworkInfo; - /** - * Details about policy settings that the device is not compliant with. - */ - nonComplianceDetails: Schema$NonComplianceDetail[]; - /** - * Whether the device is compliant with its policy. - */ - policyCompliant: boolean; - /** - * The name of the policy applied to the device, in the form - * enterprises/{enterpriseId}/policies/{policyId}. If not specified, the - * policy_name for the device's user is applied. This field can be - * modified by a patch request. You can specify only the policyId when calling - * enterprises.devices.patch, as long as the policyId doesn’t contain any - * slashes. The rest of the policy name is inferred. - */ - policyName: string; - /** - * Power management events on the device in chronological order. This - * information is only available if powerManagementEventsEnabled is true in - * the device's policy. - */ - powerManagementEvents: Schema$PowerManagementEvent[]; - /** - * If the same physical device has been enrolled multiple times, this field - * contains its previous device names. The serial number is used as the unique - * identifier to determine if the same physical device has enrolled - * previously. The names are in chronological order. - */ - previousDeviceNames: string[]; - /** - * Detailed information about the device software. This information is only - * available if softwareInfoEnabled is true in the device's policy. - */ - softwareInfo: Schema$SoftwareInfo; - /** - * The state to be applied to the device. This field can be modified by a - * patch request. Note that when calling enterprises.devices.patch, ACTIVE and - * DISABLED are the only allowable values. To enter the device into a DELETED - * state, call enterprises.devices.delete. - */ - state: string; - /** - * The resource name of the user that owns this device in the form - * enterprises/{enterpriseId}/users/{userId}. - */ - userName: string; -} -/** - * Information about security related device settings on device. - */ -export interface Schema$DeviceSettings { - /** - * Whether ADB (https://developer.android.com/studio/command-line/adb.html) is - * enabled on the device. - */ - adbEnabled: boolean; - /** - * Whether developer mode is enabled on the device. - */ - developmentSettingsEnabled: boolean; - /** - * Encryption status from DevicePolicyManager. - */ - encryptionStatus: string; - /** - * Whether the device is secured with PIN/password. - */ - isDeviceSecure: boolean; - /** - * Whether the storage encryption is enabled. - */ - isEncrypted: boolean; - /** - * Whether installing apps from unknown sources is enabled. - */ - unknownSourcesEnabled: boolean; - /** - * Whether Verify Apps (Google Play Protect - * (https://support.google.com/googleplay/answer/2812853)) is enabled on the - * device. - */ - verifyAppsEnabled: boolean; -} -/** - * Device display information. - */ -export interface Schema$Display { - /** - * Display density expressed as dots-per-inch. - */ - density: number; - /** - * Unique display id. - */ - displayId: number; - /** - * Display height in pixels. - */ - height: number; - /** - * Name of the display. - */ - name: string; - /** - * Refresh rate of the display in frames per second. - */ - refreshRate: number; - /** - * State of the display. - */ - state: string; - /** - * Display width in pixels. - */ - width: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * An enrollment token. - */ -export interface Schema$EnrollmentToken { - /** - * Optional, arbitrary data associated with the enrollment token. This could - * contain, for example, the ID of an org unit the device is assigned to after - * enrollment. After a device enrolls with the token, this data will be - * exposed in the enrollment_token_data field of the Device resource. The data - * must be 1024 characters or less; otherwise, the creation request will fail. - */ - additionalData: string; - /** - * The length of time the enrollment token is valid, ranging from 1 minute to - * 30 days. If not specified, the default duration is 1 hour. - */ - duration: string; - /** - * The expiration time of the token. This is a read-only field generated by - * the server. - */ - expirationTimestamp: string; - /** - * The name of the enrollment token, which is generated by the server during - * creation, in the form - * enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. - */ - name: string; - /** - * The name of the policy initially applied to the enrolled device, in the - * form enterprises/{enterpriseId}/policies/{policyId}. If not specified, the - * policy_name for the device’s user is applied. If user_name is also not - * specified, enterprises/{enterpriseId}/policies/default is applied by - * default. When updating this field, you can specify only the policyId as - * long as the policyId doesn’t contain any slashes. The rest of the policy - * name will be inferred. - */ - policyName: string; - /** - * A JSON string whose UTF-8 representation can be used to generate a QR code - * to enroll a device with this enrollment token. To enroll a device using - * NFC, the NFC record must contain a serialized java.util.Properties - * representation of the properties in the JSON. - */ - qrCode: string; - /** - * The token value that's passed to the device and authorizes the device - * to enroll. This is a read-only field generated by the server. - */ - value: string; -} -/** - * The configuration applied to an enterprise. - */ -export interface Schema$Enterprise { - /** - * Whether permissions for apps installed via policy are automatically - * approved. If enabled, you must display an app's permissions to the - * enterprise admin before setting the app to be installed in a policy. - */ - appAutoApprovalEnabled: boolean; - /** - * The types of Google Pub/Sub notifications enabled for the enterprise. - */ - enabledNotificationTypes: string[]; - /** - * The name of the enterprise displayed to users. - */ - enterpriseDisplayName: string; - /** - * An image displayed as a logo during device provisioning. Supported types - * are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp, - * image/vnd.wap.wbmp, image/x-adobe-dng. - */ - logo: Schema$ExternalData; - /** - * The name of the enterprise which is generated by the server during - * creation, in the form enterprises/{enterpriseId}. - */ - name: string; - /** - * A color in RGB format that indicates the predominant color to display in - * the device management app UI. The color components are stored as follows: - * (red << 16) | (green << 8) | blue, where the value of each - * component is between 0 and 255, inclusive. - */ - primaryColor: number; - /** - * The topic that Cloud Pub/Sub notifications are published to, in the form - * projects/{project}/topics/{topic}. This field is only required if Pub/Sub - * notifications are enabled. - */ - pubsubTopic: string; - /** - * Terms and conditions that must be accepted when provisioning a device for - * this enterprise. A page of terms is generated for each value in this list. - */ - termsAndConditions: Schema$TermsAndConditions[]; -} -/** - * Data hosted at an external location. The data is to be downloaded by Android - * Device Policy and verified against the hash. - */ -export interface Schema$ExternalData { - /** - * The base-64 encoded SHA-256 hash of the content hosted at url. If the - * content doesn't match this hash, Android Device Policy won't use - * the data. - */ - sha256Hash: string; - /** - * The absolute URL to the data, which must use either the http or https - * scheme. Android Device Policy doesn't provide any credentials in the - * GET request, so the URL must be publicly accessible. Including a long, - * random component in the URL may be used to prevent attackers from - * discovering the URL. - */ - url: string; -} -/** - * Information about device hardware. The fields related to temperature - * thresholds are only available if hardwareStatusEnabled is true in the - * device's policy. - */ -export interface Schema$HardwareInfo { - /** - * Battery shutdown temperature thresholds in Celsius for each battery on the - * device. - */ - batteryShutdownTemperatures: number[]; - /** - * Battery throttling temperature thresholds in Celsius for each battery on - * the device. - */ - batteryThrottlingTemperatures: number[]; - /** - * Brand of the device. For example, Google. - */ - brand: string; - /** - * CPU shutdown temperature thresholds in Celsius for each CPU on the device. - */ - cpuShutdownTemperatures: number[]; - /** - * CPU throttling temperature thresholds in Celsius for each CPU on the - * device. - */ - cpuThrottlingTemperatures: number[]; - /** - * Baseband version. For example, MDM9625_104662.22.05.34p. - */ - deviceBasebandVersion: string; - /** - * GPU shutdown temperature thresholds in Celsius for each GPU on the device. - */ - gpuShutdownTemperatures: number[]; - /** - * GPU throttling temperature thresholds in Celsius for each GPU on the - * device. - */ - gpuThrottlingTemperatures: number[]; - /** - * Name of the hardware. For example, Angler. - */ - hardware: string; - /** - * Manufacturer. For example, Motorola. - */ - manufacturer: string; - /** - * The model of the device. For example, Asus Nexus 7. - */ - model: string; - /** - * The device serial number. - */ - serialNumber: string; - /** - * Device skin shutdown temperature thresholds in Celsius. - */ - skinShutdownTemperatures: number[]; - /** - * Device skin throttling temperature thresholds in Celsius. - */ - skinThrottlingTemperatures: number[]; -} -/** - * Hardware status. Temperatures may be compared to the temperature thresholds - * available in hardwareInfo to determine hardware health. - */ -export interface Schema$HardwareStatus { - /** - * Current battery temperatures in Celsius for each battery on the device. - */ - batteryTemperatures: number[]; - /** - * Current CPU temperatures in Celsius for each CPU on the device. - */ - cpuTemperatures: number[]; - /** - * CPU usages in percentage for each core available on the device. Usage is 0 - * for each unplugged core. Empty array implies that CPU usage is not - * supported in the system. - */ - cpuUsages: number[]; - /** - * The time the measurements were taken. - */ - createTime: string; - /** - * Fan speeds in RPM for each fan on the device. Empty array means that there - * are no fans or fan speed is not supported on the system. - */ - fanSpeeds: number[]; - /** - * Current GPU temperatures in Celsius for each GPU on the device. - */ - gpuTemperatures: number[]; - /** - * Current device skin temperatures in Celsius. - */ - skinTemperatures: number[]; -} -/** - * Response to a request to list devices for a given enterprise. - */ -export interface Schema$ListDevicesResponse { - /** - * The list of devices. - */ - devices: Schema$Device[]; - /** - * If there are more results, a token to retrieve next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response to a request to list policies for a given enterprise. - */ -export interface Schema$ListPoliciesResponse { - /** - * If there are more results, a token to retrieve next page of results. - */ - nextPageToken: string; - /** - * The list of policies. - */ - policies: Schema$Policy[]; -} -/** - * Managed property. - */ -export interface Schema$ManagedProperty { - /** - * The default value of the property. BUNDLE_ARRAY properties don't have a - * default value. - */ - defaultValue: any; - /** - * A longer description of the property, providing more detail of what it - * affects. Localized. - */ - description: string; - /** - * For CHOICE or MULTISELECT properties, the list of possible entries. - */ - entries: Schema$ManagedPropertyEntry[]; - /** - * The unique key that the app uses to identify the property, e.g. - * "com.google.android.gm.fieldname". - */ - key: string; - /** - * For BUNDLE_ARRAY properties, the list of nested properties. A BUNDLE_ARRAY - * property is at most two levels deep. - */ - nestedProperties: Schema$ManagedProperty[]; - /** - * The name of the property. Localized. - */ - title: string; - /** - * The type of the property. - */ - type: string; -} -/** - * An entry of a managed property. - */ -export interface Schema$ManagedPropertyEntry { - /** - * The human-readable name of the value. Localized. - */ - name: string; - /** - * The machine-readable value of the entry, which should be used in the - * configuration. Not localized. - */ - value: string; -} -/** - * An event related to memory and storage measurements. - */ -export interface Schema$MemoryEvent { - /** - * The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, - * the total capacity in bytes of the storage medium. - */ - byteCount: string; - /** - * The creation time of the event. - */ - createTime: string; - /** - * Event type. - */ - eventType: string; -} -/** - * Information about device memory and storage. - */ -export interface Schema$MemoryInfo { - /** - * Total internal storage on device in bytes. - */ - totalInternalStorage: string; - /** - * Total RAM on device in bytes. - */ - totalRam: string; -} -/** - * Device network info. - */ -export interface Schema$NetworkInfo { - /** - * IMEI number of the GSM device. For example, A1000031212. - */ - imei: string; - /** - * MEID number of the CDMA device. For example, A00000292788E1. - */ - meid: string; - /** - * Alphabetic name of current registered operator. For example, Vodafone. - */ - networkOperatorName: string; - /** - * Wi-Fi MAC address of the device. For example, 7c:11:11:11:11:11. - */ - wifiMacAddress: string; -} -/** - * Provides detail about non-compliance with a policy setting. - */ -export interface Schema$NonComplianceDetail { - /** - * If the policy setting could not be applied, the current value of the - * setting on the device. - */ - currentValue: any; - /** - * For settings with nested fields, if a particular nested field is out of - * compliance, this specifies the full path to the offending field. The path - * is formatted in the same way the policy JSON field would be referenced in - * JavaScript, that is: 1) For object-typed fields, the field name is followed - * by a dot then by a subfield name. 2) For array-typed fields, the field - * name is followed by the array index enclosed in brackets. For example, to - * indicate a problem with the url field in the externalData field in the 3rd - * application, the path would be applications[2].externalData.url - */ - fieldPath: string; - /** - * If package_name is set and the non-compliance reason is APP_NOT_INSTALLED - * or APP_NOT_UPDATED, the detailed reason the app can't be installed or - * updated. - */ - installationFailureReason: string; - /** - * The reason the device is not in compliance with the setting. - */ - nonComplianceReason: string; - /** - * The package name indicating which app is out of compliance, if applicable. - */ - packageName: string; - /** - * The name of the policy setting. This is the JSON field name of a top-level - * Policy field. - */ - settingName: string; -} -/** - * A compliance rule condition which is satisfied if there exists any matching - * NonComplianceDetail for the device. A NonComplianceDetail matches a - * NonComplianceDetailCondition if all the fields which are set within the - * NonComplianceDetailCondition match the corresponding NonComplianceDetail - * fields. - */ -export interface Schema$NonComplianceDetailCondition { - /** - * The reason the device is not in compliance with the setting. If not set, - * then this condition matches any reason. - */ - nonComplianceReason: string; - /** - * The package name of the app that's out of compliance. If not set, then - * this condition matches any package name. - */ - packageName: string; - /** - * The name of the policy setting. This is the JSON field name of a top-level - * Policy field. If not set, then this condition matches any setting name. - */ - settingName: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * A list of package names. - */ -export interface Schema$PackageNameList { - /** - * A list of package names. - */ - packageNames: string[]; -} -/** - * Requirements for the password used to unlock a device. - */ -export interface Schema$PasswordRequirements { - /** - * Number of incorrect device-unlock passwords that can be entered before a - * device is wiped. A value of 0 means there is no restriction. - */ - maximumFailedPasswordsForWipe: number; - /** - * Password expiration timeout. - */ - passwordExpirationTimeout: string; - /** - * The length of the password history. After setting this field, the user - * won't be able to enter a new password that is the same as any password - * in the history. A value of 0 means there is no restriction. - */ - passwordHistoryLength: number; - /** - * The minimum allowed password length. A value of 0 means there is no - * restriction. Only enforced when password_quality is NUMERIC, - * NUMERIC_COMPLEX, ALPHABETIC, ALPHANUMERIC, or COMPLEX. - */ - passwordMinimumLength: number; - /** - * Minimum number of letters required in the password. Only enforced when - * password_quality is COMPLEX. - */ - passwordMinimumLetters: number; - /** - * Minimum number of lower case letters required in the password. Only - * enforced when password_quality is COMPLEX. - */ - passwordMinimumLowerCase: number; - /** - * Minimum number of non-letter characters (numerical digits or symbols) - * required in the password. Only enforced when password_quality is COMPLEX. - */ - passwordMinimumNonLetter: number; - /** - * Minimum number of numerical digits required in the password. Only enforced - * when password_quality is COMPLEX. - */ - passwordMinimumNumeric: number; - /** - * Minimum number of symbols required in the password. Only enforced when - * password_quality is COMPLEX. - */ - passwordMinimumSymbols: number; - /** - * Minimum number of upper case letters required in the password. Only - * enforced when password_quality is COMPLEX. - */ - passwordMinimumUpperCase: number; - /** - * The required password quality. - */ - passwordQuality: string; -} -/** - * Configuration for an Android permission and its grant state. - */ -export interface Schema$PermissionGrant { - /** - * The android permission, e.g. android.permission.READ_CALENDAR. - */ - permission: string; - /** - * The policy for granting the permission. - */ - policy: string; -} -/** - * A default activity for handling intents that match a particular intent - * filter. - */ -export interface Schema$PersistentPreferredActivity { - /** - * The intent actions to match in the filter. If any actions are included in - * the filter, then an intent's action must be one of those values for it - * to match. If no actions are included, the intent action is ignored. - */ - actions: string[]; - /** - * The intent categories to match in the filter. An intent includes the - * categories that it requires, all of which must be included in the filter in - * order to match. In other words, adding a category to the filter has no - * impact on matching unless that category is specified in the intent. - */ - categories: string[]; - /** - * The activity that should be the default intent handler. This should be an - * Android component name, e.g. com.android.enterprise.app/.MainActivity. - * Alternatively, the value may be the package name of an app, which causes - * Android Device Policy to choose an appropriate activity from the app to - * handle the intent. - */ - receiverActivity: string; -} -/** - * A policy resources represents a group settings that govern the behavior of a - * managed device and the apps installed on it. - */ -export interface Schema$Policy { - /** - * Account types that can't be managed by the user. - */ - accountTypesWithManagementDisabled: string[]; - /** - * Whether adding new users and profiles is disabled. - */ - addUserDisabled: boolean; - /** - * Whether adjusting the master volume is disabled. - */ - adjustVolumeDisabled: boolean; - /** - * Configuration for an always-on VPN connection. Use with vpn_config_disabled - * to prevent modification of this setting. - */ - alwaysOnVpnPackage: Schema$AlwaysOnVpnPackage; - /** - * The app tracks for Android Device Policy the device can access. The device - * receives the latest version among all accessible tracks. If no tracks are - * specified, then the device only uses the production track. - */ - androidDevicePolicyTracks: string[]; - /** - * The app auto update policy, which controls when automatic app updates can - * be applied. - */ - appAutoUpdatePolicy: string; - /** - * Policy applied to apps. - */ - applications: Schema$ApplicationPolicy[]; - /** - * Whether auto time is required, which prevents the user from manually - * setting the date and time. - */ - autoTimeRequired: boolean; - /** - * Whether applications other than the ones configured in applications are - * blocked from being installed. When set, applications that were installed - * under a previous policy but no longer appear in the policy are - * automatically uninstalled. - */ - blockApplicationsEnabled: boolean; - /** - * Whether configuring bluetooth is disabled. - */ - bluetoothConfigDisabled: boolean; - /** - * Whether bluetooth contact sharing is disabled. - */ - bluetoothContactSharingDisabled: boolean; - /** - * Whether bluetooth is disabled. Prefer this setting over - * bluetooth_config_disabled because bluetooth_config_disabled can be bypassed - * by the user. - */ - bluetoothDisabled: boolean; - /** - * Whether all cameras on the device are disabled. - */ - cameraDisabled: boolean; - /** - * Whether configuring cell broadcast is disabled. - */ - cellBroadcastsConfigDisabled: boolean; - /** - * Rules declaring which mitigating actions to take when a device is not - * compliant with its policy. When the conditions for multiple rules are - * satisfied, all of the mitigating actions for the rules are taken. There is - * a maximum limit of 100 rules. - */ - complianceRules: Schema$ComplianceRule[]; - /** - * Whether creating windows besides app windows is disabled. - */ - createWindowsDisabled: boolean; - /** - * Whether configuring user credentials is disabled. - */ - credentialsConfigDisabled: boolean; - /** - * Whether roaming data services are disabled. - */ - dataRoamingDisabled: boolean; +export namespace androidmanagement_v1 { /** - * Whether the user is allowed to enable debugging features. - */ - debuggingFeaturesAllowed: boolean; - /** - * The default permission policy for runtime permission requests. - */ - defaultPermissionPolicy: string; - /** - * The device owner information to be shown on the lock screen. - */ - deviceOwnerLockScreenInfo: Schema$UserFacingMessage; - /** - * Whether encryption is enabled - */ - encryptionPolicy: string; - /** - * Whether app verification is force-enabled. - */ - ensureVerifyAppsEnabled: boolean; - /** - * Whether factory resetting from settings is disabled. - */ - factoryResetDisabled: boolean; - /** - * Email addresses of device administrators for factory reset protection. When - * the device is factory reset, it will require one of these admins to log in - * with the Google account email and password to unlock the device. If no - * admins are specified, the device won't provide factory reset - * protection. - */ - frpAdminEmails: string[]; - /** - * Whether the user is allowed to have fun. Controls whether the Easter egg - * game in Settings is disabled. - */ - funDisabled: boolean; - /** - * Whether user installation of apps is disabled. - */ - installAppsDisabled: boolean; - /** - * Whether the user is allowed to enable the "Unknown Sources" - * setting, which allows installation of apps from unknown sources. - */ - installUnknownSourcesAllowed: boolean; - /** - * Whether the keyguard is disabled. - */ - keyguardDisabled: boolean; - /** - * Disabled keyguard customizations, such as widgets. - */ - keyguardDisabledFeatures: string[]; - /** - * Whether the kiosk custom launcher is enabled. This replaces the home screen - * with a launcher that locks down the device to the apps installed via the - * applications setting. The apps appear on a single page in alphabetical - * order. It is recommended to also use status_bar_disabled to block access to - * device settings. - */ - kioskCustomLauncherEnabled: boolean; - /** - * The degree of location detection enabled. The user may change the value - * unless the user is otherwise blocked from accessing device settings. - */ - locationMode: string; - /** - * A message displayed to the user in the device administators settings - * screen. - */ - longSupportMessage: Schema$UserFacingMessage; - /** - * Maximum time in milliseconds for user activity until the device locks. A - * value of 0 means there is no restriction. - */ - maximumTimeToLock: string; - /** - * Whether configuring mobile networks is disabled. - */ - mobileNetworksConfigDisabled: boolean; - /** - * Whether adding or removing accounts is disabled. - */ - modifyAccountsDisabled: boolean; - /** - * Whether the user mounting physical external media is disabled. - */ - mountPhysicalMediaDisabled: boolean; - /** - * The name of the policy in the form - * enterprises/{enterpriseId}/policies/{policyId}. - */ - name: string; - /** - * Whether the network escape hatch is enabled. If a network connection - * can't be made at boot time, the escape hatch prompts the user to - * temporarily connect to a network in order to refresh the device policy. - * After applying policy, the temporary network will be forgotten and the - * device will continue booting. This prevents being unable to connect to a - * network if there is no suitable network in the last policy and the device - * boots into an app in lock task mode, or the user is otherwise unable to - * reach device settings. - */ - networkEscapeHatchEnabled: boolean; - /** - * Whether resetting network settings is disabled. - */ - networkResetDisabled: boolean; - /** - * Network configuration for the device. See configure networks for more - * information. - */ - openNetworkConfiguration: any; - /** - * Whether using NFC to beam data from apps is disabled. - */ - outgoingBeamDisabled: boolean; - /** - * Whether outgoing calls are disabled. - */ - outgoingCallsDisabled: boolean; - /** - * Password requirements. - */ - passwordRequirements: Schema$PasswordRequirements; - /** - * If present, only the input methods provided by packages in this list are - * permitted. If this field is present, but the list is empty, then only - * system input methods are permitted. - */ - permittedInputMethods: Schema$PackageNameList; - /** - * Default intent handler activities. - */ - persistentPreferredActivities: Schema$PersistentPreferredActivity[]; - /** - * The network-independent global HTTP proxy. Typically proxies should be - * configured per-network in open_network_configuration. However for unusual - * configurations like general internal filtering a global HTTP proxy may be - * useful. If the proxy is not accessible, network access may break. The - * global proxy is only a recommendation and some apps may ignore it. - */ - recommendedGlobalProxy: Schema$ProxyInfo; - /** - * Whether removing other users is disabled. - */ - removeUserDisabled: boolean; - /** - * Whether rebooting the device into safe boot is disabled. - */ - safeBootDisabled: boolean; - /** - * Whether screen capture is disabled. - */ - screenCaptureDisabled: boolean; - /** - * Whether changing the user icon is disabled. - */ - setUserIconDisabled: boolean; - /** - * Whether changing the wallpaper is disabled. - */ - setWallpaperDisabled: boolean; - /** - * Whether location sharing is disabled. - */ - shareLocationDisabled: boolean; - /** - * A message displayed to the user in the settings screen wherever - * functionality has been disabled by the admin. - */ - shortSupportMessage: Schema$UserFacingMessage; - /** - * Flag to skip hints on the first use. Enterprise admin can enable the system - * recommendation for apps to skip their user tutorial and other introductory - * hints on first start-up. - */ - skipFirstUseHintsEnabled: boolean; - /** - * Whether sending and receiving SMS messages is disabled. - */ - smsDisabled: boolean; - /** - * Whether the status bar is disabled. This disables notifications, quick - * settings, and other screen overlays that allow escape from full-screen - * mode. - */ - statusBarDisabled: boolean; - /** - * Status reporting settings - */ - statusReportingSettings: Schema$StatusReportingSettings; - /** - * The battery plugged in modes for which the device stays on. When using this - * setting, it is recommended to clear maximum_time_to_lock so that the device - * doesn't lock itself while it stays on. - */ - stayOnPluggedModes: string[]; - /** - * The system update policy, which controls how OS updates are applied. If the - * update type is WINDOWED, the update window will automatically apply to Play - * app updates as well. - */ - systemUpdate: Schema$SystemUpdate; - /** - * Whether configuring tethering and portable hotspots is disabled. - */ - tetheringConfigDisabled: boolean; - /** - * Whether user uninstallation of applications is disabled. - */ - uninstallAppsDisabled: boolean; - /** - * Whether the microphone is muted and adjusting microphone volume is - * disabled. - */ - unmuteMicrophoneDisabled: boolean; - /** - * Whether transferring files over USB is disabled. - */ - usbFileTransferDisabled: boolean; - /** - * Allows admins to toggle whether USB storge is enabled or disabled on - * user's devices. - */ - usbMassStorageEnabled: boolean; - /** - * The version of the policy. This is a read-only field. The version is - * incremented each time the policy is updated. - */ - version: string; - /** - * Whether configuring VPN is disabled. - */ - vpnConfigDisabled: boolean; - /** - * Whether configuring Wi-Fi access points is disabled. - */ - wifiConfigDisabled: boolean; - /** - * Whether Wi-Fi networks defined in Open Network Configuration are locked so - * they can't be edited by the user. - */ - wifiConfigsLockdownEnabled: boolean; -} -/** - * A power management event. - */ -export interface Schema$PowerManagementEvent { - /** - * For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage. - */ - batteryLevel: number; - /** - * The creation time of the event. - */ - createTime: string; - /** - * Event type. - */ - eventType: string; -} -/** - * Configuration info for an HTTP proxy. For a direct proxy, set the host, port, - * and excluded_hosts fields. For a PAC script proxy, set the pac_uri field. - */ -export interface Schema$ProxyInfo { - /** - * For a direct proxy, the hosts for which the proxy is bypassed. The host - * names may contain wildcards such as *.example.com. - */ - excludedHosts: string[]; - /** - * The host of the direct proxy. - */ - host: string; - /** - * The URI of the PAC script used to configure the proxy. - */ - pacUri: string; - /** - * The port of the direct proxy. - */ - port: number; -} -/** - * An enterprise signup URL. - */ -export interface Schema$SignupUrl { + * Android Management API + * + * The Android Management API provides remote enterprise management of Android + * devices and apps. + * + * @example + * const google = require('googleapis'); + * const androidmanagement = google.androidmanagement('v1'); + * + * @namespace androidmanagement + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Androidmanagement + */ + export class Androidmanagement { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + enterprises: Resource$Enterprises; + signupUrls: Resource$Signupurls; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.enterprises = new Resource$Enterprises(this); + this.signupUrls = new Resource$Signupurls(this); + } + + getRoot() { + return this.root; + } + } + /** - * The name of the resource. Use this value in the signupUrl field when - * calling enterprises.create to complete the enterprise signup flow. + * Configuration for an always-on VPN connection. */ - name: string; + export interface Schema$AlwaysOnVpnPackage { + /** + * Disallows networking when the VPN is not connected. + */ + lockdownEnabled: boolean; + /** + * The package name of the VPN app. + */ + packageName: string; + } /** - * A URL where an enterprise admin can register their enterprise. The page - * can't be rendered in an iframe. - */ - url: string; -} -/** - * Information about device software. - */ -export interface Schema$SoftwareInfo { + * A compliance rule condition which is satisfied if the Android Framework API + * level on the device doesn't meet a minimum requirement. There can only + * be one rule with this type of condition per policy. + */ + export interface Schema$ApiLevelCondition { + /** + * The minimum desired Android Framework API level. If the device + * doesn't meet the minimum requirement, this condition is satisfied. + * Must be greater than zero. + */ + minApiLevel: number; + } /** - * Android build ID string meant for displaying to the user. For example, - * shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. - */ - androidBuildNumber: string; + * Information about an app. + */ + export interface Schema$Application { + /** + * The set of managed properties available to be pre-configured for the app. + */ + managedProperties: Schema$ManagedProperty[]; + /** + * The name of the app in the form + * enterprises/{enterpriseId}/applications/{package_name}. + */ + name: string; + /** + * The permissions required by the app. + */ + permissions: Schema$ApplicationPermission[]; + /** + * The title of the app. Localized. + */ + title: string; + } /** - * Build time. - */ - androidBuildTime: string; + * A permission required by the app. + */ + export interface Schema$ApplicationPermission { + /** + * A longer description of the permission, providing more detail on what it + * affects. Localized. + */ + description: string; + /** + * The name of the permission. Localized. + */ + name: string; + /** + * An opaque string uniquely identifying the permission. Not localized. + */ + permissionId: string; + } /** - * The Android Device Policy app version code. - */ - androidDevicePolicyVersionCode: number; + * Policy for an individual app. + */ + export interface Schema$ApplicationPolicy { + /** + * The default policy for all permissions requested by the app. If + * specified, this overrides the policy-level default_permission_policy + * which applies to all apps. It does not override the permission_grants + * which applies to all apps. + */ + defaultPermissionPolicy: string; + /** + * The scopes delegated to the app from Android Device Policy. + */ + delegatedScopes: string[]; + /** + * The type of installation to perform. + */ + installType: string; + /** + * Whether the app is allowed to lock itself in full-screen mode. + */ + lockTaskAllowed: boolean; + /** + * Managed configuration applied to the app. The format for the + * configuration is dictated by the ManagedProperty values supported by the + * app. Each field name in the managed configuration must match the key + * field of the ManagedProperty. The field value must be compatible with the + * type of the ManagedProperty: <table> + * <tr><td><i>type</i></td><td><i>JSON + * value</i></td></tr> + * <tr><td>BOOL</td><td>true or + * false</td></tr> + * <tr><td>STRING</td><td>string</td></tr> + * <tr><td>INTEGER</td><td>number</td></tr> + * <tr><td>CHOICE</td><td>string</td></tr> + * <tr><td>MULTISELECT</td><td>array of + * strings</td></tr> + * <tr><td>HIDDEN</td><td>string</td></tr> + * <tr><td>BUNDLE_ARRAY</td><td>array of + * objects</td></tr> </table> + */ + managedConfiguration: any; + /** + * The minimum version of the app that runs on the device. If set, the + * device attempts to update the app to at least this version code. If the + * app is not up-to-date, the device will contain a NonComplianceDetail with + * non_compliance_reason set to APP_NOT_UPDATED. The app must already be + * published to Google Play with a version code greater than or equal to + * this value. At most 20 apps may specify a minimum version code per + * policy. + */ + minimumVersionCode: number; + /** + * The package name of the app. For example, com.google.android.youtube for + * the YouTube app. + */ + packageName: string; + /** + * Explicit permission grants or denials for the app. These values override + * the default_permission_policy and permission_grants which apply to all + * apps. + */ + permissionGrants: Schema$PermissionGrant[]; + } /** - * The Android Device Policy app version as displayed to the user. - */ - androidDevicePolicyVersionName: string; + * A command. + */ + export interface Schema$Command { + /** + * The timestamp at which the command was created. The timestamp is + * automatically generated by the server. + */ + createTime: string; + /** + * The duration for which the command is valid. The command will expire if + * not executed by the device during this time. The default duration if + * unspecified is ten minutes. There is no maximum duration. + */ + duration: string; + /** + * If the command failed, an error code explaining the failure. This is not + * set when the command is cancelled by the caller. + */ + errorCode: string; + /** + * For commands of type RESET_PASSWORD, optionally specifies the new + * password. + */ + newPassword: string; + /** + * For commands of type RESET_PASSWORD, optionally specifies flags. + */ + resetPasswordFlags: string[]; + /** + * The type of the command. + */ + type: string; + /** + * The resource name of the user that owns the device in the form + * enterprises/{enterpriseId}/users/{userId}. This is automatically + * generated by the server based on the device the command is sent to. + */ + userName: string; + } /** - * The user-visible Android version string. For example, 6.0.1. - */ - androidVersion: string; + * A rule declaring which mitigating actions to take when a device is not + * compliant with its policy. For every rule, there is always an implicit + * mitigating action to set policy_compliant to false for the Device resource, + * and display a message on the device indicating that the device is not + * compliant with its policy. Other mitigating actions may optionally be taken + * as well, depending on the field values in the rule. + */ + export interface Schema$ComplianceRule { + /** + * A condition which is satisfied if the Android Framework API level on the + * device doesn't meet a minimum requirement. + */ + apiLevelCondition: Schema$ApiLevelCondition; + /** + * If set to true, the rule includes a mitigating action to disable apps so + * that the device is effectively disabled, but app data is preserved. If + * the device is running an app in locked task mode, the app will be closed + * and a UI showing the reason for non-compliance will be displayed. + */ + disableApps: boolean; + /** + * A condition which is satisfied if there exists any matching + * NonComplianceDetail for the device. + */ + nonComplianceDetailCondition: Schema$NonComplianceDetailCondition; + } /** - * The system bootloader version number, e.g. 0.6.7. - */ - bootloaderVersion: string; + * A device owned by an enterprise. Unless otherwise noted, all fields are + * read-only and can't be modified by enterprises.devices.patch. + */ + export interface Schema$Device { + /** + * The API level of the Android platform version running on the device. + */ + apiLevel: number; + /** + * The name of the policy currently applied to the device. + */ + appliedPolicyName: string; + /** + * The version of the policy currently applied to the device. + */ + appliedPolicyVersion: string; + /** + * The state currently applied to the device. + */ + appliedState: string; + /** + * Device settings information. This information is only available if + * deviceSettingsEnabled is true in the device's policy. + */ + deviceSettings: Schema$DeviceSettings; + /** + * If the device state is DISABLED, an optional message that is displayed on + * the device indicating the reason the device is disabled. This field can + * be modified by a patch request. + */ + disabledReason: Schema$UserFacingMessage; + /** + * Detailed information about displays on the device. This information is + * only available if displayInfoEnabled is true in the device's policy. + */ + displays: Schema$Display[]; + /** + * The time of device enrollment. + */ + enrollmentTime: string; + /** + * If the device was enrolled with an enrollment token with additional data + * provided, this field contains that data. + */ + enrollmentTokenData: string; + /** + * If the device was enrolled with an enrollment token, this field contains + * the name of the token. + */ + enrollmentTokenName: string; + /** + * Detailed information about the device hardware. + */ + hardwareInfo: Schema$HardwareInfo; + /** + * Hardware status samples in chronological order. This information is only + * available if hardwareStatusEnabled is true in the device's policy. + */ + hardwareStatusSamples: Schema$HardwareStatus[]; + /** + * The last time the device sent a policy compliance report. + */ + lastPolicyComplianceReportTime: string; + /** + * The last time the device fetched its policy. + */ + lastPolicySyncTime: string; + /** + * The last time the device sent a status report. + */ + lastStatusReportTime: string; + /** + * Events related to memory and storage measurements in chronological order. + * This information is only available if memoryInfoEnabled is true in the + * device's policy. + */ + memoryEvents: Schema$MemoryEvent[]; + /** + * Memory information. This information is only available if + * memoryInfoEnabled is true in the device's policy. + */ + memoryInfo: Schema$MemoryInfo; + /** + * The name of the device in the form + * enterprises/{enterpriseId}/devices/{deviceId}. + */ + name: string; + /** + * Device network information. This information is only available if + * networkInfoEnabled is true in the device's policy. + */ + networkInfo: Schema$NetworkInfo; + /** + * Details about policy settings that the device is not compliant with. + */ + nonComplianceDetails: Schema$NonComplianceDetail[]; + /** + * Whether the device is compliant with its policy. + */ + policyCompliant: boolean; + /** + * The name of the policy applied to the device, in the form + * enterprises/{enterpriseId}/policies/{policyId}. If not specified, the + * policy_name for the device's user is applied. This field can be + * modified by a patch request. You can specify only the policyId when + * calling enterprises.devices.patch, as long as the policyId doesn’t + * contain any slashes. The rest of the policy name is inferred. + */ + policyName: string; + /** + * Power management events on the device in chronological order. This + * information is only available if powerManagementEventsEnabled is true in + * the device's policy. + */ + powerManagementEvents: Schema$PowerManagementEvent[]; + /** + * If the same physical device has been enrolled multiple times, this field + * contains its previous device names. The serial number is used as the + * unique identifier to determine if the same physical device has enrolled + * previously. The names are in chronological order. + */ + previousDeviceNames: string[]; + /** + * Detailed information about the device software. This information is only + * available if softwareInfoEnabled is true in the device's policy. + */ + softwareInfo: Schema$SoftwareInfo; + /** + * The state to be applied to the device. This field can be modified by a + * patch request. Note that when calling enterprises.devices.patch, ACTIVE + * and DISABLED are the only allowable values. To enter the device into a + * DELETED state, call enterprises.devices.delete. + */ + state: string; + /** + * The resource name of the user that owns this device in the form + * enterprises/{enterpriseId}/users/{userId}. + */ + userName: string; + } /** - * SHA-256 hash of android.content.pm.Signature - * (https://developer.android.com/reference/android/content/pm/Signature.html) - * associated with the system package, which can be used to verify that the - * system build hasn't been modified. - */ - deviceBuildSignature: string; + * Information about security related device settings on device. + */ + export interface Schema$DeviceSettings { + /** + * Whether ADB (https://developer.android.com/studio/command-line/adb.html) + * is enabled on the device. + */ + adbEnabled: boolean; + /** + * Whether developer mode is enabled on the device. + */ + developmentSettingsEnabled: boolean; + /** + * Encryption status from DevicePolicyManager. + */ + encryptionStatus: string; + /** + * Whether the device is secured with PIN/password. + */ + isDeviceSecure: boolean; + /** + * Whether the storage encryption is enabled. + */ + isEncrypted: boolean; + /** + * Whether installing apps from unknown sources is enabled. + */ + unknownSourcesEnabled: boolean; + /** + * Whether Verify Apps (Google Play Protect + * (https://support.google.com/googleplay/answer/2812853)) is enabled on the + * device. + */ + verifyAppsEnabled: boolean; + } /** - * Kernel version, for example, 2.6.32.9-g103d848. - */ - deviceKernelVersion: string; + * Device display information. + */ + export interface Schema$Display { + /** + * Display density expressed as dots-per-inch. + */ + density: number; + /** + * Unique display id. + */ + displayId: number; + /** + * Display height in pixels. + */ + height: number; + /** + * Name of the display. + */ + name: string; + /** + * Refresh rate of the display in frames per second. + */ + refreshRate: number; + /** + * State of the display. + */ + state: string; + /** + * Display width in pixels. + */ + width: number; + } /** - * Security patch level, e.g. 2016-05-01. - */ - securityPatchLevel: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * An enrollment token. + */ + export interface Schema$EnrollmentToken { + /** + * Optional, arbitrary data associated with the enrollment token. This could + * contain, for example, the ID of an org unit the device is assigned to + * after enrollment. After a device enrolls with the token, this data will + * be exposed in the enrollment_token_data field of the Device resource. The + * data must be 1024 characters or less; otherwise, the creation request + * will fail. + */ + additionalData: string; + /** + * The length of time the enrollment token is valid, ranging from 1 minute + * to 30 days. If not specified, the default duration is 1 hour. + */ + duration: string; + /** + * The expiration time of the token. This is a read-only field generated by + * the server. + */ + expirationTimestamp: string; + /** + * The name of the enrollment token, which is generated by the server during + * creation, in the form + * enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. + */ + name: string; + /** + * The name of the policy initially applied to the enrolled device, in the + * form enterprises/{enterpriseId}/policies/{policyId}. If not specified, + * the policy_name for the device’s user is applied. If user_name is also + * not specified, enterprises/{enterpriseId}/policies/default is applied by + * default. When updating this field, you can specify only the policyId as + * long as the policyId doesn’t contain any slashes. The rest of the policy + * name will be inferred. + */ + policyName: string; + /** + * A JSON string whose UTF-8 representation can be used to generate a QR + * code to enroll a device with this enrollment token. To enroll a device + * using NFC, the NFC record must contain a serialized java.util.Properties + * representation of the properties in the JSON. + */ + qrCode: string; + /** + * The token value that's passed to the device and authorizes the device + * to enroll. This is a read-only field generated by the server. + */ + value: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The configuration applied to an enterprise. + */ + export interface Schema$Enterprise { + /** + * Whether permissions for apps installed via policy are automatically + * approved. If enabled, you must display an app's permissions to the + * enterprise admin before setting the app to be installed in a policy. + */ + appAutoApprovalEnabled: boolean; + /** + * The types of Google Pub/Sub notifications enabled for the enterprise. + */ + enabledNotificationTypes: string[]; + /** + * The name of the enterprise displayed to users. + */ + enterpriseDisplayName: string; + /** + * An image displayed as a logo during device provisioning. Supported types + * are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, + * image/webp, image/vnd.wap.wbmp, image/x-adobe-dng. + */ + logo: Schema$ExternalData; + /** + * The name of the enterprise which is generated by the server during + * creation, in the form enterprises/{enterpriseId}. + */ + name: string; + /** + * A color in RGB format that indicates the predominant color to display in + * the device management app UI. The color components are stored as follows: + * (red << 16) | (green << 8) | blue, where the value of each + * component is between 0 and 255, inclusive. + */ + primaryColor: number; + /** + * The topic that Cloud Pub/Sub notifications are published to, in the form + * projects/{project}/topics/{topic}. This field is only required if Pub/Sub + * notifications are enabled. + */ + pubsubTopic: string; + /** + * Terms and conditions that must be accepted when provisioning a device for + * this enterprise. A page of terms is generated for each value in this + * list. + */ + termsAndConditions: Schema$TermsAndConditions[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Data hosted at an external location. The data is to be downloaded by + * Android Device Policy and verified against the hash. + */ + export interface Schema$ExternalData { + /** + * The base-64 encoded SHA-256 hash of the content hosted at url. If the + * content doesn't match this hash, Android Device Policy won't use + * the data. + */ + sha256Hash: string; + /** + * The absolute URL to the data, which must use either the http or https + * scheme. Android Device Policy doesn't provide any credentials in the + * GET request, so the URL must be publicly accessible. Including a long, + * random component in the URL may be used to prevent attackers from + * discovering the URL. + */ + url: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Information about device hardware. The fields related to temperature + * thresholds are only available if hardwareStatusEnabled is true in the + * device's policy. */ - message: string; -} -/** - * Settings controlling the behavior of status reports. - */ -export interface Schema$StatusReportingSettings { + export interface Schema$HardwareInfo { + /** + * Battery shutdown temperature thresholds in Celsius for each battery on + * the device. + */ + batteryShutdownTemperatures: number[]; + /** + * Battery throttling temperature thresholds in Celsius for each battery on + * the device. + */ + batteryThrottlingTemperatures: number[]; + /** + * Brand of the device. For example, Google. + */ + brand: string; + /** + * CPU shutdown temperature thresholds in Celsius for each CPU on the + * device. + */ + cpuShutdownTemperatures: number[]; + /** + * CPU throttling temperature thresholds in Celsius for each CPU on the + * device. + */ + cpuThrottlingTemperatures: number[]; + /** + * Baseband version. For example, MDM9625_104662.22.05.34p. + */ + deviceBasebandVersion: string; + /** + * GPU shutdown temperature thresholds in Celsius for each GPU on the + * device. + */ + gpuShutdownTemperatures: number[]; + /** + * GPU throttling temperature thresholds in Celsius for each GPU on the + * device. + */ + gpuThrottlingTemperatures: number[]; + /** + * Name of the hardware. For example, Angler. + */ + hardware: string; + /** + * Manufacturer. For example, Motorola. + */ + manufacturer: string; + /** + * The model of the device. For example, Asus Nexus 7. + */ + model: string; + /** + * The device serial number. + */ + serialNumber: string; + /** + * Device skin shutdown temperature thresholds in Celsius. + */ + skinShutdownTemperatures: number[]; + /** + * Device skin throttling temperature thresholds in Celsius. + */ + skinThrottlingTemperatures: number[]; + } /** - * Whether device settings reporting is enabled. - */ - deviceSettingsEnabled: boolean; + * Hardware status. Temperatures may be compared to the temperature thresholds + * available in hardwareInfo to determine hardware health. + */ + export interface Schema$HardwareStatus { + /** + * Current battery temperatures in Celsius for each battery on the device. + */ + batteryTemperatures: number[]; + /** + * Current CPU temperatures in Celsius for each CPU on the device. + */ + cpuTemperatures: number[]; + /** + * CPU usages in percentage for each core available on the device. Usage is + * 0 for each unplugged core. Empty array implies that CPU usage is not + * supported in the system. + */ + cpuUsages: number[]; + /** + * The time the measurements were taken. + */ + createTime: string; + /** + * Fan speeds in RPM for each fan on the device. Empty array means that + * there are no fans or fan speed is not supported on the system. + */ + fanSpeeds: number[]; + /** + * Current GPU temperatures in Celsius for each GPU on the device. + */ + gpuTemperatures: number[]; + /** + * Current device skin temperatures in Celsius. + */ + skinTemperatures: number[]; + } /** - * Whether displays reporting is enabled. - */ - displayInfoEnabled: boolean; + * Response to a request to list devices for a given enterprise. + */ + export interface Schema$ListDevicesResponse { + /** + * The list of devices. + */ + devices: Schema$Device[]; + /** + * If there are more results, a token to retrieve next page of results. + */ + nextPageToken: string; + } /** - * Whether hardware status reporting is enabled. - */ - hardwareStatusEnabled: boolean; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Whether memory info reporting is enabled. - */ - memoryInfoEnabled: boolean; + * Response to a request to list policies for a given enterprise. + */ + export interface Schema$ListPoliciesResponse { + /** + * If there are more results, a token to retrieve next page of results. + */ + nextPageToken: string; + /** + * The list of policies. + */ + policies: Schema$Policy[]; + } /** - * Whether network info reporting is enabled. - */ - networkInfoEnabled: boolean; + * Managed property. + */ + export interface Schema$ManagedProperty { + /** + * The default value of the property. BUNDLE_ARRAY properties don't have + * a default value. + */ + defaultValue: any; + /** + * A longer description of the property, providing more detail of what it + * affects. Localized. + */ + description: string; + /** + * For CHOICE or MULTISELECT properties, the list of possible entries. + */ + entries: Schema$ManagedPropertyEntry[]; + /** + * The unique key that the app uses to identify the property, e.g. + * "com.google.android.gm.fieldname". + */ + key: string; + /** + * For BUNDLE_ARRAY properties, the list of nested properties. A + * BUNDLE_ARRAY property is at most two levels deep. + */ + nestedProperties: Schema$ManagedProperty[]; + /** + * The name of the property. Localized. + */ + title: string; + /** + * The type of the property. + */ + type: string; + } /** - * Whether power management event reporting is enabled. - */ - powerManagementEventsEnabled: boolean; + * An entry of a managed property. + */ + export interface Schema$ManagedPropertyEntry { + /** + * The human-readable name of the value. Localized. + */ + name: string; + /** + * The machine-readable value of the entry, which should be used in the + * configuration. Not localized. + */ + value: string; + } /** - * Whether software info reporting is enabled. - */ - softwareInfoEnabled: boolean; -} -/** - * Configuration for managing system updates - */ -export interface Schema$SystemUpdate { + * An event related to memory and storage measurements. + */ + export interface Schema$MemoryEvent { + /** + * The number of free bytes in the medium, or for EXTERNAL_STORAGE_DETECTED, + * the total capacity in bytes of the storage medium. + */ + byteCount: string; + /** + * The creation time of the event. + */ + createTime: string; + /** + * Event type. + */ + eventType: string; + } /** - * If the type is WINDOWED, the end of the maintenance window, measured as the - * number of minutes after midnight in device's local time. This value - * must be between 0 and 1439, inclusive. If this value is less than - * start_minutes, then the maintenance window spans midnight. If the - * maintenance window specified is smaller than 30 minutes, the actual window - * is extended to 30 minutes beyond the start time. - */ - endMinutes: number; + * Information about device memory and storage. + */ + export interface Schema$MemoryInfo { + /** + * Total internal storage on device in bytes. + */ + totalInternalStorage: string; + /** + * Total RAM on device in bytes. + */ + totalRam: string; + } /** - * If the type is WINDOWED, the start of the maintenance window, measured as - * the number of minutes after midnight in the device's local time. This - * value must be between 0 and 1439, inclusive. - */ - startMinutes: number; + * Device network info. + */ + export interface Schema$NetworkInfo { + /** + * IMEI number of the GSM device. For example, A1000031212. + */ + imei: string; + /** + * MEID number of the CDMA device. For example, A00000292788E1. + */ + meid: string; + /** + * Alphabetic name of current registered operator. For example, Vodafone. + */ + networkOperatorName: string; + /** + * Wi-Fi MAC address of the device. For example, 7c:11:11:11:11:11. + */ + wifiMacAddress: string; + } /** - * The type of system update to configure. - */ - type: string; -} -/** - * A terms and conditions page to be accepted during provisioning. - */ -export interface Schema$TermsAndConditions { + * Provides detail about non-compliance with a policy setting. + */ + export interface Schema$NonComplianceDetail { + /** + * If the policy setting could not be applied, the current value of the + * setting on the device. + */ + currentValue: any; + /** + * For settings with nested fields, if a particular nested field is out of + * compliance, this specifies the full path to the offending field. The path + * is formatted in the same way the policy JSON field would be referenced in + * JavaScript, that is: 1) For object-typed fields, the field name is + * followed by a dot then by a subfield name. 2) For array-typed fields, + * the field name is followed by the array index enclosed in brackets. For + * example, to indicate a problem with the url field in the externalData + * field in the 3rd application, the path would be + * applications[2].externalData.url + */ + fieldPath: string; + /** + * If package_name is set and the non-compliance reason is APP_NOT_INSTALLED + * or APP_NOT_UPDATED, the detailed reason the app can't be installed or + * updated. + */ + installationFailureReason: string; + /** + * The reason the device is not in compliance with the setting. + */ + nonComplianceReason: string; + /** + * The package name indicating which app is out of compliance, if + * applicable. + */ + packageName: string; + /** + * The name of the policy setting. This is the JSON field name of a + * top-level Policy field. + */ + settingName: string; + } /** - * A well-formatted HTML string. It will be parsed on the client with - * android.text.Html#fromHtml. - */ - content: Schema$UserFacingMessage; + * A compliance rule condition which is satisfied if there exists any matching + * NonComplianceDetail for the device. A NonComplianceDetail matches a + * NonComplianceDetailCondition if all the fields which are set within the + * NonComplianceDetailCondition match the corresponding NonComplianceDetail + * fields. + */ + export interface Schema$NonComplianceDetailCondition { + /** + * The reason the device is not in compliance with the setting. If not set, + * then this condition matches any reason. + */ + nonComplianceReason: string; + /** + * The package name of the app that's out of compliance. If not set, + * then this condition matches any package name. + */ + packageName: string; + /** + * The name of the policy setting. This is the JSON field name of a + * top-level Policy field. If not set, then this condition matches any + * setting name. + */ + settingName: string; + } /** - * A short header which appears above the HTML content. - */ - header: Schema$UserFacingMessage; -} -/** - * Provides a user-facing message with locale info. The maximum message length - * is 4096 characters. - */ -export interface Schema$UserFacingMessage { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * The default message displayed if no localized message is specified or the - * user's locale doesn't match with any of the localized messages. A - * default message must be provided if any localized messages are provided. + * A list of package names. */ - defaultMessage: string; + export interface Schema$PackageNameList { + /** + * A list of package names. + */ + packageNames: string[]; + } /** - * A map containing <locale, message> pairs, where locale is a - * well-formed BCP 47 language - * (https://www.w3.org/International/articles/language-tags/) code, such as - * en-US, es-ES, or fr. - */ - localizedMessages: any; -} -/** - * A web token used to access the managed Google Play iframe. - */ -export interface Schema$WebToken { + * Requirements for the password used to unlock a device. + */ + export interface Schema$PasswordRequirements { + /** + * Number of incorrect device-unlock passwords that can be entered before a + * device is wiped. A value of 0 means there is no restriction. + */ + maximumFailedPasswordsForWipe: number; + /** + * Password expiration timeout. + */ + passwordExpirationTimeout: string; + /** + * The length of the password history. After setting this field, the user + * won't be able to enter a new password that is the same as any + * password in the history. A value of 0 means there is no restriction. + */ + passwordHistoryLength: number; + /** + * The minimum allowed password length. A value of 0 means there is no + * restriction. Only enforced when password_quality is NUMERIC, + * NUMERIC_COMPLEX, ALPHABETIC, ALPHANUMERIC, or COMPLEX. + */ + passwordMinimumLength: number; + /** + * Minimum number of letters required in the password. Only enforced when + * password_quality is COMPLEX. + */ + passwordMinimumLetters: number; + /** + * Minimum number of lower case letters required in the password. Only + * enforced when password_quality is COMPLEX. + */ + passwordMinimumLowerCase: number; + /** + * Minimum number of non-letter characters (numerical digits or symbols) + * required in the password. Only enforced when password_quality is COMPLEX. + */ + passwordMinimumNonLetter: number; + /** + * Minimum number of numerical digits required in the password. Only + * enforced when password_quality is COMPLEX. + */ + passwordMinimumNumeric: number; + /** + * Minimum number of symbols required in the password. Only enforced when + * password_quality is COMPLEX. + */ + passwordMinimumSymbols: number; + /** + * Minimum number of upper case letters required in the password. Only + * enforced when password_quality is COMPLEX. + */ + passwordMinimumUpperCase: number; + /** + * The required password quality. + */ + passwordQuality: string; + } /** - * The name of the web token, which is generated by the server during creation - * in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. - */ - name: string; + * Configuration for an Android permission and its grant state. + */ + export interface Schema$PermissionGrant { + /** + * The android permission, e.g. android.permission.READ_CALENDAR. + */ + permission: string; + /** + * The policy for granting the permission. + */ + policy: string; + } /** - * The URL of the parent frame hosting the iframe with the embedded UI. To - * prevent XSS, the iframe may not be hosted at other URLs. The URL must use - * the https scheme. - */ - parentFrameUrl: string; + * A default activity for handling intents that match a particular intent + * filter. + */ + export interface Schema$PersistentPreferredActivity { + /** + * The intent actions to match in the filter. If any actions are included in + * the filter, then an intent's action must be one of those values for + * it to match. If no actions are included, the intent action is ignored. + */ + actions: string[]; + /** + * The intent categories to match in the filter. An intent includes the + * categories that it requires, all of which must be included in the filter + * in order to match. In other words, adding a category to the filter has no + * impact on matching unless that category is specified in the intent. + */ + categories: string[]; + /** + * The activity that should be the default intent handler. This should be an + * Android component name, e.g. com.android.enterprise.app/.MainActivity. + * Alternatively, the value may be the package name of an app, which causes + * Android Device Policy to choose an appropriate activity from the app to + * handle the intent. + */ + receiverActivity: string; + } /** - * Permissions available to an admin in the embedded UI. An admin must have - * all of these permissions in order to view the UI. - */ - permissions: string[]; + * A policy resources represents a group settings that govern the behavior of + * a managed device and the apps installed on it. + */ + export interface Schema$Policy { + /** + * Account types that can't be managed by the user. + */ + accountTypesWithManagementDisabled: string[]; + /** + * Whether adding new users and profiles is disabled. + */ + addUserDisabled: boolean; + /** + * Whether adjusting the master volume is disabled. + */ + adjustVolumeDisabled: boolean; + /** + * Configuration for an always-on VPN connection. Use with + * vpn_config_disabled to prevent modification of this setting. + */ + alwaysOnVpnPackage: Schema$AlwaysOnVpnPackage; + /** + * The app tracks for Android Device Policy the device can access. The + * device receives the latest version among all accessible tracks. If no + * tracks are specified, then the device only uses the production track. + */ + androidDevicePolicyTracks: string[]; + /** + * The app auto update policy, which controls when automatic app updates can + * be applied. + */ + appAutoUpdatePolicy: string; + /** + * Policy applied to apps. + */ + applications: Schema$ApplicationPolicy[]; + /** + * Whether auto time is required, which prevents the user from manually + * setting the date and time. + */ + autoTimeRequired: boolean; + /** + * Whether applications other than the ones configured in applications are + * blocked from being installed. When set, applications that were installed + * under a previous policy but no longer appear in the policy are + * automatically uninstalled. + */ + blockApplicationsEnabled: boolean; + /** + * Whether configuring bluetooth is disabled. + */ + bluetoothConfigDisabled: boolean; + /** + * Whether bluetooth contact sharing is disabled. + */ + bluetoothContactSharingDisabled: boolean; + /** + * Whether bluetooth is disabled. Prefer this setting over + * bluetooth_config_disabled because bluetooth_config_disabled can be + * bypassed by the user. + */ + bluetoothDisabled: boolean; + /** + * Whether all cameras on the device are disabled. + */ + cameraDisabled: boolean; + /** + * Whether configuring cell broadcast is disabled. + */ + cellBroadcastsConfigDisabled: boolean; + /** + * Rules declaring which mitigating actions to take when a device is not + * compliant with its policy. When the conditions for multiple rules are + * satisfied, all of the mitigating actions for the rules are taken. There + * is a maximum limit of 100 rules. + */ + complianceRules: Schema$ComplianceRule[]; + /** + * Whether creating windows besides app windows is disabled. + */ + createWindowsDisabled: boolean; + /** + * Whether configuring user credentials is disabled. + */ + credentialsConfigDisabled: boolean; + /** + * Whether roaming data services are disabled. + */ + dataRoamingDisabled: boolean; + /** + * Whether the user is allowed to enable debugging features. + */ + debuggingFeaturesAllowed: boolean; + /** + * The default permission policy for runtime permission requests. + */ + defaultPermissionPolicy: string; + /** + * The device owner information to be shown on the lock screen. + */ + deviceOwnerLockScreenInfo: Schema$UserFacingMessage; + /** + * Whether encryption is enabled + */ + encryptionPolicy: string; + /** + * Whether app verification is force-enabled. + */ + ensureVerifyAppsEnabled: boolean; + /** + * Whether factory resetting from settings is disabled. + */ + factoryResetDisabled: boolean; + /** + * Email addresses of device administrators for factory reset protection. + * When the device is factory reset, it will require one of these admins to + * log in with the Google account email and password to unlock the device. + * If no admins are specified, the device won't provide factory reset + * protection. + */ + frpAdminEmails: string[]; + /** + * Whether the user is allowed to have fun. Controls whether the Easter egg + * game in Settings is disabled. + */ + funDisabled: boolean; + /** + * Whether user installation of apps is disabled. + */ + installAppsDisabled: boolean; + /** + * Whether the user is allowed to enable the "Unknown Sources" + * setting, which allows installation of apps from unknown sources. + */ + installUnknownSourcesAllowed: boolean; + /** + * Whether the keyguard is disabled. + */ + keyguardDisabled: boolean; + /** + * Disabled keyguard customizations, such as widgets. + */ + keyguardDisabledFeatures: string[]; + /** + * Whether the kiosk custom launcher is enabled. This replaces the home + * screen with a launcher that locks down the device to the apps installed + * via the applications setting. The apps appear on a single page in + * alphabetical order. It is recommended to also use status_bar_disabled to + * block access to device settings. + */ + kioskCustomLauncherEnabled: boolean; + /** + * The degree of location detection enabled. The user may change the value + * unless the user is otherwise blocked from accessing device settings. + */ + locationMode: string; + /** + * A message displayed to the user in the device administators settings + * screen. + */ + longSupportMessage: Schema$UserFacingMessage; + /** + * Maximum time in milliseconds for user activity until the device locks. A + * value of 0 means there is no restriction. + */ + maximumTimeToLock: string; + /** + * Whether configuring mobile networks is disabled. + */ + mobileNetworksConfigDisabled: boolean; + /** + * Whether adding or removing accounts is disabled. + */ + modifyAccountsDisabled: boolean; + /** + * Whether the user mounting physical external media is disabled. + */ + mountPhysicalMediaDisabled: boolean; + /** + * The name of the policy in the form + * enterprises/{enterpriseId}/policies/{policyId}. + */ + name: string; + /** + * Whether the network escape hatch is enabled. If a network connection + * can't be made at boot time, the escape hatch prompts the user to + * temporarily connect to a network in order to refresh the device policy. + * After applying policy, the temporary network will be forgotten and the + * device will continue booting. This prevents being unable to connect to a + * network if there is no suitable network in the last policy and the device + * boots into an app in lock task mode, or the user is otherwise unable to + * reach device settings. + */ + networkEscapeHatchEnabled: boolean; + /** + * Whether resetting network settings is disabled. + */ + networkResetDisabled: boolean; + /** + * Network configuration for the device. See configure networks for more + * information. + */ + openNetworkConfiguration: any; + /** + * Whether using NFC to beam data from apps is disabled. + */ + outgoingBeamDisabled: boolean; + /** + * Whether outgoing calls are disabled. + */ + outgoingCallsDisabled: boolean; + /** + * Password requirements. + */ + passwordRequirements: Schema$PasswordRequirements; + /** + * If present, only the input methods provided by packages in this list are + * permitted. If this field is present, but the list is empty, then only + * system input methods are permitted. + */ + permittedInputMethods: Schema$PackageNameList; + /** + * Default intent handler activities. + */ + persistentPreferredActivities: Schema$PersistentPreferredActivity[]; + /** + * The network-independent global HTTP proxy. Typically proxies should be + * configured per-network in open_network_configuration. However for unusual + * configurations like general internal filtering a global HTTP proxy may be + * useful. If the proxy is not accessible, network access may break. The + * global proxy is only a recommendation and some apps may ignore it. + */ + recommendedGlobalProxy: Schema$ProxyInfo; + /** + * Whether removing other users is disabled. + */ + removeUserDisabled: boolean; + /** + * Whether rebooting the device into safe boot is disabled. + */ + safeBootDisabled: boolean; + /** + * Whether screen capture is disabled. + */ + screenCaptureDisabled: boolean; + /** + * Whether changing the user icon is disabled. + */ + setUserIconDisabled: boolean; + /** + * Whether changing the wallpaper is disabled. + */ + setWallpaperDisabled: boolean; + /** + * Whether location sharing is disabled. + */ + shareLocationDisabled: boolean; + /** + * A message displayed to the user in the settings screen wherever + * functionality has been disabled by the admin. + */ + shortSupportMessage: Schema$UserFacingMessage; + /** + * Flag to skip hints on the first use. Enterprise admin can enable the + * system recommendation for apps to skip their user tutorial and other + * introductory hints on first start-up. + */ + skipFirstUseHintsEnabled: boolean; + /** + * Whether sending and receiving SMS messages is disabled. + */ + smsDisabled: boolean; + /** + * Whether the status bar is disabled. This disables notifications, quick + * settings, and other screen overlays that allow escape from full-screen + * mode. + */ + statusBarDisabled: boolean; + /** + * Status reporting settings + */ + statusReportingSettings: Schema$StatusReportingSettings; + /** + * The battery plugged in modes for which the device stays on. When using + * this setting, it is recommended to clear maximum_time_to_lock so that the + * device doesn't lock itself while it stays on. + */ + stayOnPluggedModes: string[]; + /** + * The system update policy, which controls how OS updates are applied. If + * the update type is WINDOWED, the update window will automatically apply + * to Play app updates as well. + */ + systemUpdate: Schema$SystemUpdate; + /** + * Whether configuring tethering and portable hotspots is disabled. + */ + tetheringConfigDisabled: boolean; + /** + * Whether user uninstallation of applications is disabled. + */ + uninstallAppsDisabled: boolean; + /** + * Whether the microphone is muted and adjusting microphone volume is + * disabled. + */ + unmuteMicrophoneDisabled: boolean; + /** + * Whether transferring files over USB is disabled. + */ + usbFileTransferDisabled: boolean; + /** + * Allows admins to toggle whether USB storge is enabled or disabled on + * user's devices. + */ + usbMassStorageEnabled: boolean; + /** + * The version of the policy. This is a read-only field. The version is + * incremented each time the policy is updated. + */ + version: string; + /** + * Whether configuring VPN is disabled. + */ + vpnConfigDisabled: boolean; + /** + * Whether configuring Wi-Fi access points is disabled. + */ + wifiConfigDisabled: boolean; + /** + * Whether Wi-Fi networks defined in Open Network Configuration are locked + * so they can't be edited by the user. + */ + wifiConfigsLockdownEnabled: boolean; + } /** - * The token value which is used in the hosting page to generate the iframe - * with the embedded UI. This is a read-only field generated by the server. - */ - value: string; -} - -export class Resource$Enterprises { - root: Androidmanagement; - applications: Resource$Enterprises$Applications; - devices: Resource$Enterprises$Devices; - enrollmentTokens: Resource$Enterprises$Enrollmenttokens; - policies: Resource$Enterprises$Policies; - webTokens: Resource$Enterprises$Webtokens; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - this.applications = new Resource$Enterprises$Applications(root); - this.devices = new Resource$Enterprises$Devices(root); - this.enrollmentTokens = new Resource$Enterprises$Enrollmenttokens(root); - this.policies = new Resource$Enterprises$Policies(root); - this.webTokens = new Resource$Enterprises$Webtokens(root); + * A power management event. + */ + export interface Schema$PowerManagementEvent { + /** + * For BATTERY_LEVEL_COLLECTED events, the battery level as a percentage. + */ + batteryLevel: number; + /** + * The creation time of the event. + */ + createTime: string; + /** + * Event type. + */ + eventType: string; } - - getRoot() { - return this.root; + /** + * Configuration info for an HTTP proxy. For a direct proxy, set the host, + * port, and excluded_hosts fields. For a PAC script proxy, set the pac_uri + * field. + */ + export interface Schema$ProxyInfo { + /** + * For a direct proxy, the hosts for which the proxy is bypassed. The host + * names may contain wildcards such as *.example.com. + */ + excludedHosts: string[]; + /** + * The host of the direct proxy. + */ + host: string; + /** + * The URI of the PAC script used to configure the proxy. + */ + pacUri: string; + /** + * The port of the direct proxy. + */ + port: number; } - - /** - * androidmanagement.enterprises.create - * @desc Creates an enterprise. This is the last step in the enterprise signup - * flow. - * @alias androidmanagement.enterprises.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.enterpriseToken The enterprise token appended to the callback URL. - * @param {string=} params.projectId The ID of the Google Cloud Platform project which will own the enterprise. - * @param {string=} params.signupUrlName The name of the SignupUrl used to sign up for the enterprise. - * @param {().Enterprise} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/enterprises').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An enterprise signup URL. + */ + export interface Schema$SignupUrl { + /** + * The name of the resource. Use this value in the signupUrl field when + * calling enterprises.create to complete the enterprise signup flow. + */ + name: string; + /** + * A URL where an enterprise admin can register their enterprise. The page + * can't be rendered in an iframe. + */ + url: string; } - - /** - * androidmanagement.enterprises.get - * @desc Gets an enterprise. - * @alias androidmanagement.enterprises.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Information about device software. + */ + export interface Schema$SoftwareInfo { + /** + * Android build ID string meant for displaying to the user. For example, + * shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys. + */ + androidBuildNumber: string; + /** + * Build time. + */ + androidBuildTime: string; + /** + * The Android Device Policy app version code. + */ + androidDevicePolicyVersionCode: number; + /** + * The Android Device Policy app version as displayed to the user. + */ + androidDevicePolicyVersionName: string; + /** + * The user-visible Android version string. For example, 6.0.1. + */ + androidVersion: string; + /** + * The system bootloader version number, e.g. 0.6.7. + */ + bootloaderVersion: string; + /** + * SHA-256 hash of android.content.pm.Signature + * (https://developer.android.com/reference/android/content/pm/Signature.html) + * associated with the system package, which can be used to verify that the + * system build hasn't been modified. + */ + deviceBuildSignature: string; + /** + * Kernel version, for example, 2.6.32.9-g103d848. + */ + deviceKernelVersion: string; + /** + * Security patch level, e.g. 2016-05-01. + */ + securityPatchLevel: string; } - - /** - * androidmanagement.enterprises.patch - * @desc Updates an enterprise. - * @alias androidmanagement.enterprises.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. - * @param {().Enterprise} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } -} -export class Resource$Enterprises$Applications { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); + /** + * Settings controlling the behavior of status reports. + */ + export interface Schema$StatusReportingSettings { + /** + * Whether device settings reporting is enabled. + */ + deviceSettingsEnabled: boolean; + /** + * Whether displays reporting is enabled. + */ + displayInfoEnabled: boolean; + /** + * Whether hardware status reporting is enabled. + */ + hardwareStatusEnabled: boolean; + /** + * Whether memory info reporting is enabled. + */ + memoryInfoEnabled: boolean; + /** + * Whether network info reporting is enabled. + */ + networkInfoEnabled: boolean; + /** + * Whether power management event reporting is enabled. + */ + powerManagementEventsEnabled: boolean; + /** + * Whether software info reporting is enabled. + */ + softwareInfoEnabled: boolean; } - - getRoot() { - return this.root; + /** + * Configuration for managing system updates + */ + export interface Schema$SystemUpdate { + /** + * If the type is WINDOWED, the end of the maintenance window, measured as + * the number of minutes after midnight in device's local time. This + * value must be between 0 and 1439, inclusive. If this value is less than + * start_minutes, then the maintenance window spans midnight. If the + * maintenance window specified is smaller than 30 minutes, the actual + * window is extended to 30 minutes beyond the start time. + */ + endMinutes: number; + /** + * If the type is WINDOWED, the start of the maintenance window, measured as + * the number of minutes after midnight in the device's local time. This + * value must be between 0 and 1439, inclusive. + */ + startMinutes: number; + /** + * The type of system update to configure. + */ + type: string; } - - /** - * androidmanagement.enterprises.applications.get - * @desc Gets info about an application. - * @alias androidmanagement.enterprises.applications.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application will be used. - * @param {string} params.name The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A terms and conditions page to be accepted during provisioning. + */ + export interface Schema$TermsAndConditions { + /** + * A well-formatted HTML string. It will be parsed on the client with + * android.text.Html#fromHtml. + */ + content: Schema$UserFacingMessage; + /** + * A short header which appears above the HTML content. + */ + header: Schema$UserFacingMessage; } -} - -export class Resource$Enterprises$Devices { - root: Androidmanagement; - operations: Resource$Enterprises$Devices$Operations; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Enterprises$Devices$Operations(root); + /** + * Provides a user-facing message with locale info. The maximum message length + * is 4096 characters. + */ + export interface Schema$UserFacingMessage { + /** + * The default message displayed if no localized message is specified or the + * user's locale doesn't match with any of the localized messages. A + * default message must be provided if any localized messages are provided. + */ + defaultMessage: string; + /** + * A map containing <locale, message> pairs, where locale is a + * well-formed BCP 47 language + * (https://www.w3.org/International/articles/language-tags/) code, such as + * en-US, es-ES, or fr. + */ + localizedMessages: any; } - - getRoot() { - return this.root; + /** + * A web token used to access the managed Google Play iframe. + */ + export interface Schema$WebToken { + /** + * The name of the web token, which is generated by the server during + * creation in the form enterprises/{enterpriseId}/webTokens/{webTokenId}. + */ + name: string; + /** + * The URL of the parent frame hosting the iframe with the embedded UI. To + * prevent XSS, the iframe may not be hosted at other URLs. The URL must use + * the https scheme. + */ + parentFrameUrl: string; + /** + * Permissions available to an admin in the embedded UI. An admin must have + * all of these permissions in order to view the UI. + */ + permissions: string[]; + /** + * The token value which is used in the hosting page to generate the iframe + * with the embedded UI. This is a read-only field generated by the server. + */ + value: string; } - - /** - * androidmanagement.enterprises.devices.delete - * @desc Deletes a device. This operation wipes the device. - * @alias androidmanagement.enterprises.devices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Enterprises { + root: Androidmanagement; + applications: Resource$Enterprises$Applications; + devices: Resource$Enterprises$Devices; + enrollmentTokens: Resource$Enterprises$Enrollmenttokens; + policies: Resource$Enterprises$Policies; + webTokens: Resource$Enterprises$Webtokens; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); + this.applications = new Resource$Enterprises$Applications(root); + this.devices = new Resource$Enterprises$Devices(root); + this.enrollmentTokens = new Resource$Enterprises$Enrollmenttokens(root); + this.policies = new Resource$Enterprises$Policies(root); + this.webTokens = new Resource$Enterprises$Webtokens(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidmanagement.enterprises.devices.get - * @desc Gets a device. - * @alias androidmanagement.enterprises.devices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * androidmanagement.enterprises.create + * @desc Creates an enterprise. This is the last step in the enterprise + * signup flow. + * @alias androidmanagement.enterprises.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.enterpriseToken The enterprise token appended to the callback URL. + * @param {string=} params.projectId The ID of the Google Cloud Platform project which will own the enterprise. + * @param {string=} params.signupUrlName The name of the SignupUrl used to sign up for the enterprise. + * @param {().Enterprise} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/enterprises').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * androidmanagement.enterprises.devices.issueCommand - * @desc Issues a command to a device. The Operation resource returned - * contains a Command in its metadata field. Use the get operation method to - * get the status of the command. - * @alias androidmanagement.enterprises.devices.issueCommand - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. - * @param {().Command} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - issueCommand(params?: any, options?: MethodOptions): - AxiosPromise; - issueCommand( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - issueCommand( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.get + * @desc Gets an enterprise. + * @alias androidmanagement.enterprises.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:issueCommand') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * androidmanagement.enterprises.devices.list - * @desc Lists devices for a given enterprise. - * @alias androidmanagement.enterprises.devices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The requested page size. The actual page size may be fixed to a min or max value. - * @param {string=} params.pageToken A token identifying a page of results returned by the server. - * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.patch + * @desc Updates an enterprise. + * @alias androidmanagement.enterprises.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * @param {().Enterprise} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Enterprises$Applications { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidmanagement.enterprises.devices.patch - * @desc Updates a device. - * @alias androidmanagement.enterprises.devices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. - * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. - * @param {().Device} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.applications.get + * @desc Gets info about an application. + * @alias androidmanagement.enterprises.applications.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode The preferred language for localized application info, as a BCP47 tag (e.g. "en-US", "de"). If not specified the default language of the application will be used. + * @param {string} params.name The name of the application in the form enterprises/{enterpriseId}/applications/{package_name}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Enterprises$Devices$Operations { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; - } - - - /** - * androidmanagement.enterprises.devices.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * Code.CANCELLED. - * @alias androidmanagement.enterprises.devices.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Enterprises$Devices { + root: Androidmanagement; + operations: Resource$Enterprises$Devices$Operations; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Enterprises$Devices$Operations(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidmanagement.enterprises.devices.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. - * @alias androidmanagement.enterprises.devices.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.devices.delete + * @desc Deletes a device. This operation wipes the device. + * @alias androidmanagement.enterprises.devices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * androidmanagement.enterprises.devices.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias androidmanagement.enterprises.devices.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * androidmanagement.enterprises.devices.get + * @desc Gets a device. + * @alias androidmanagement.enterprises.devices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * androidmanagement.enterprises.devices.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias androidmanagement.enterprises.devices.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.devices.issueCommand + * @desc Issues a command to a device. The Operation resource returned + * contains a Command in its metadata field. Use the get operation method to + * get the status of the command. + * @alias androidmanagement.enterprises.devices.issueCommand + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * @param {().Command} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + issueCommand(params?: any, options?: MethodOptions): + AxiosPromise; + issueCommand( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + issueCommand( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:issueCommand') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Enterprises$Enrollmenttokens { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + /** + * androidmanagement.enterprises.devices.list + * @desc Lists devices for a given enterprise. + * @alias androidmanagement.enterprises.devices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The requested page size. The actual page size may be fixed to a min or max value. + * @param {string=} params.pageToken A token identifying a page of results returned by the server. + * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * androidmanagement.enterprises.enrollmentTokens.create - * @desc Creates an enrollment token for a given enterprise. - * @alias androidmanagement.enterprises.enrollmentTokens.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {().EnrollmentToken} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.devices.patch + * @desc Updates a device. + * @alias androidmanagement.enterprises.devices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device in the form enterprises/{enterpriseId}/devices/{deviceId}. + * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * @param {().Device} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Enterprises$Devices$Operations { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/enrollmentTokens') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidmanagement.enterprises.enrollmentTokens.delete - * @desc Deletes an enrollment token. This operation invalidates the token, - * preventing its future use. - * @alias androidmanagement.enterprises.enrollmentTokens.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * androidmanagement.enterprises.devices.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, the + * operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to Code.CANCELLED. + * @alias androidmanagement.enterprises.devices.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Enterprises$Policies { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * androidmanagement.enterprises.devices.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns google.rpc.Code.UNIMPLEMENTED. + * @alias androidmanagement.enterprises.devices.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * androidmanagement.enterprises.policies.delete - * @desc Deletes a policy. This operation is only permitted if no devices are - * currently referencing the policy. - * @alias androidmanagement.enterprises.policies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * androidmanagement.enterprises.devices.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias androidmanagement.enterprises.devices.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * androidmanagement.enterprises.policies.get - * @desc Gets a policy. - * @alias androidmanagement.enterprises.policies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * androidmanagement.enterprises.devices.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias androidmanagement.enterprises.devices.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * androidmanagement.enterprises.policies.list - * @desc Lists policies for a given enterprise. - * @alias androidmanagement.enterprises.policies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The requested page size. The actual page size may be fixed to a min or max value. - * @param {string=} params.pageToken A token identifying a page of results returned by the server. - * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Enterprises$Enrollmenttokens { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/policies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * androidmanagement.enterprises.enrollmentTokens.create + * @desc Creates an enrollment token for a given enterprise. + * @alias androidmanagement.enterprises.enrollmentTokens.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {().EnrollmentToken} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/enrollmentTokens') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * androidmanagement.enterprises.policies.patch - * @desc Updates or creates a policy. - * @alias androidmanagement.enterprises.policies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. - * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.enrollmentTokens.delete + * @desc Deletes an enrollment token. This operation invalidates the token, + * preventing its future use. + * @alias androidmanagement.enterprises.enrollmentTokens.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the enrollment token in the form enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Enterprises$Policies { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Enterprises$Webtokens { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * androidmanagement.enterprises.policies.delete + * @desc Deletes a policy. This operation is only permitted if no devices + * are currently referencing the policy. + * @alias androidmanagement.enterprises.policies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * androidmanagement.enterprises.webTokens.create - * @desc Creates a web token to access an embeddable managed Google Play web - * UI for a given enterprise. - * @alias androidmanagement.enterprises.webTokens.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. - * @param {().WebToken} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * androidmanagement.enterprises.policies.get + * @desc Gets a policy. + * @alias androidmanagement.enterprises.policies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * androidmanagement.enterprises.policies.list + * @desc Lists policies for a given enterprise. + * @alias androidmanagement.enterprises.policies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The requested page size. The actual page size may be fixed to a min or max value. + * @param {string=} params.pageToken A token identifying a page of results returned by the server. + * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/policies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/webTokens') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * androidmanagement.enterprises.policies.patch + * @desc Updates or creates a policy. + * @alias androidmanagement.enterprises.policies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the policy in the form enterprises/{enterpriseId}/policies/{policyId}. + * @param {string=} params.updateMask The field mask indicating the fields to update. If not set, all modifiable fields will be modified. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Enterprises$Webtokens { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); + } -export class Resource$Signupurls { - root: Androidmanagement; - constructor(root: Androidmanagement) { - this.root = root; - this.getRoot.bind(this); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; + + /** + * androidmanagement.enterprises.webTokens.create + * @desc Creates a web token to access an embeddable managed Google Play web + * UI for a given enterprise. + * @alias androidmanagement.enterprises.webTokens.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The name of the enterprise in the form enterprises/{enterpriseId}. + * @param {().WebToken} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/webTokens') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * androidmanagement.signupUrls.create - * @desc Creates an enterprise signup URL. - * @alias androidmanagement.signupUrls.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.callbackUrl The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. - * @param {string=} params.projectId The ID of the Google Cloud Platform project which will own the enterprise. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Signupurls { + root: Androidmanagement; + constructor(root: Androidmanagement) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://androidmanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/signupUrls').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * androidmanagement.signupUrls.create + * @desc Creates an enterprise signup URL. + * @alias androidmanagement.signupUrls.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.callbackUrl The callback URL that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes. + * @param {string=} params.projectId The ID of the Google Cloud Platform project which will own the enterprise. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://androidmanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/signupUrls').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androidpublisher/v1.1.ts b/src/apis/androidpublisher/v1.1.ts index ab56b41cd1b..0974b865e01 100644 --- a/src/apis/androidpublisher/v1.1.ts +++ b/src/apis/androidpublisher/v1.1.ts @@ -27,301 +27,306 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Developer API - * - * Lets Android application developers access their Google Play accounts. - * - * @example - * const google = require('googleapis'); - * const androidpublisher = google.androidpublisher('v1.1'); - * - * @namespace androidpublisher - * @type {Function} - * @version v1.1 - * @variation v1.1 - * @param {object=} options Options for Androidpublisher - */ -export class Androidpublisher { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace androidpublisher_v1_1 { + /** + * Google Play Developer API + * + * Lets Android application developers access their Google Play accounts. + * + * @example + * const google = require('googleapis'); + * const androidpublisher = google.androidpublisher('v1.1'); + * + * @namespace androidpublisher + * @type {Function} + * @version v1.1 + * @variation v1.1 + * @param {object=} options Options for Androidpublisher + */ + export class Androidpublisher { + _options: GlobalOptions; + google: GoogleApis; + root = this; - inapppurchases: Resource$Inapppurchases; - purchases: Resource$Purchases; + inapppurchases: Resource$Inapppurchases; + purchases: Resource$Purchases; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.inapppurchases = new Resource$Inapppurchases(this); - this.purchases = new Resource$Purchases(this); - } + this.inapppurchases = new Resource$Inapppurchases(this); + this.purchases = new Resource$Purchases(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An InappPurchase resource indicates the status of a user's inapp product - * purchase. - */ -export interface Schema$InappPurchase { - /** - * The consumption state of the inapp product. Possible values are: - Yet to - * be consumed - 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; - /** - * The order id associated with the purchase of the inapp product. - */ - orderId: string; - /** - * The purchase state of the order. Possible values are: - Purchased - - * Canceled - */ - purchaseState: number; - /** - * The time the product was purchased, in milliseconds since the epoch (Jan 1, - * 1970). - */ - purchaseTime: 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: - Test (i.e. purchased from a license testing account) - - * Promo (i.e. purchased using a promo code) - */ - purchaseType: number; -} -/** - * A SubscriptionPurchase resource indicates the status of a user's - * subscription purchase. - */ -export interface Schema$SubscriptionPurchase { /** - * Whether the subscription will automatically be renewed when it reaches its - * current expiry time. + * An InappPurchase resource indicates the status of a user's inapp + * product purchase. */ - autoRenewing: boolean; - /** - * Time at which the subscription was granted, in milliseconds since the - * Epoch. - */ - initiationTimestampMsec: string; - /** - * This kind represents a subscriptionPurchase object in the androidpublisher - * service. - */ - kind: string; + export interface Schema$InappPurchase { + /** + * The consumption state of the inapp product. Possible values are: - Yet + * to be consumed - 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; + /** + * The order id associated with the purchase of the inapp product. + */ + orderId: string; + /** + * The purchase state of the order. Possible values are: - Purchased - + * Canceled + */ + purchaseState: number; + /** + * The time the product was purchased, in milliseconds since the epoch (Jan + * 1, 1970). + */ + purchaseTime: 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: - Test (i.e. purchased from a license testing account) - + * Promo (i.e. purchased using a promo code) + */ + purchaseType: number; + } /** - * Time at which the subscription will expire, in milliseconds since the - * Epoch. + * A SubscriptionPurchase resource indicates the status of a user's + * subscription purchase. */ - validUntilTimestampMsec: string; -} - -export class Resource$Inapppurchases { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SubscriptionPurchase { + /** + * Whether the subscription will automatically be renewed when it reaches + * its current expiry time. + */ + autoRenewing: boolean; + /** + * Time at which the subscription was granted, in milliseconds since the + * Epoch. + */ + initiationTimestampMsec: string; + /** + * This kind represents a subscriptionPurchase object in the + * androidpublisher service. + */ + kind: string; + /** + * Time at which the subscription will expire, in milliseconds since the + * Epoch. + */ + validUntilTimestampMsec: string; } - - /** - * androidpublisher.inapppurchases.get - * @desc Checks the purchase and consumption status of an inapp item. - * @alias androidpublisher.inapppurchases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). - * @param {string} params.productId The inapp product SKU (for example, 'com.some.thing.inapp1'). - * @param {string} params.token The token provided to the user's device when the inapp product was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Inapppurchases { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v1.1/applications/{packageName}/inapp/{productId}/purchases/{token}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'productId', 'token'], - pathParams: ['packageName', 'productId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Purchases { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * androidpublisher.inapppurchases.get + * @desc Checks the purchase and consumption status of an inapp item. + * @alias androidpublisher.inapppurchases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * @param {string} params.productId The inapp product SKU (for example, 'com.some.thing.inapp1'). + * @param {string} params.token The token provided to the user's device when the inapp product was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v1.1/applications/{packageName}/inapp/{productId}/purchases/{token}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'productId', 'token'], + pathParams: ['packageName', 'productId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * androidpublisher.purchases.cancel - * @desc Cancels a user's subscription purchase. The subscription remains - * valid until its expiration time. - * @alias androidpublisher.purchases.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Purchases { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v1.1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidpublisher.purchases.get - * @desc Checks whether a user's subscription purchase is valid and returns - * its expiry time. - * @alias androidpublisher.purchases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * androidpublisher.purchases.cancel + * @desc Cancels a user's subscription purchase. The subscription remains + * valid until its expiration time. + * @alias androidpublisher.purchases.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v1.1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v1.1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * androidpublisher.purchases.get + * @desc Checks whether a user's subscription purchase is valid and returns + * its expiry time. + * @alias androidpublisher.purchases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v1.1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androidpublisher/v1.ts b/src/apis/androidpublisher/v1.ts index 0dd626e8388..615ba654ff9 100644 --- a/src/apis/androidpublisher/v1.ts +++ b/src/apis/androidpublisher/v1.ts @@ -27,189 +27,194 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Developer API - * - * Lets Android application developers access their Google Play accounts. - * - * @example - * const google = require('googleapis'); - * const androidpublisher = google.androidpublisher('v1'); - * - * @namespace androidpublisher - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Androidpublisher - */ -export class Androidpublisher { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace androidpublisher_v1 { + /** + * Google Play Developer API + * + * Lets Android application developers access their Google Play accounts. + * + * @example + * const google = require('googleapis'); + * const androidpublisher = google.androidpublisher('v1'); + * + * @namespace androidpublisher + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Androidpublisher + */ + export class Androidpublisher { + _options: GlobalOptions; + google: GoogleApis; + root = this; - purchases: Resource$Purchases; + purchases: Resource$Purchases; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.purchases = new Resource$Purchases(this); - } + this.purchases = new Resource$Purchases(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A SubscriptionPurchase resource indicates the status of a user's - * subscription purchase. - */ -export interface Schema$SubscriptionPurchase { - /** - * Whether the subscription will automatically be renewed when it reaches its - * current expiry time. - */ - autoRenewing: boolean; - /** - * Time at which the subscription was granted, in milliseconds since the - * Epoch. - */ - initiationTimestampMsec: string; /** - * This kind represents a subscriptionPurchase object in the androidpublisher - * service. + * A SubscriptionPurchase resource indicates the status of a user's + * subscription purchase. */ - kind: string; - /** - * Time at which the subscription will expire, in milliseconds since the - * Epoch. - */ - validUntilTimestampMsec: string; -} - -export class Resource$Purchases { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SubscriptionPurchase { + /** + * Whether the subscription will automatically be renewed when it reaches + * its current expiry time. + */ + autoRenewing: boolean; + /** + * Time at which the subscription was granted, in milliseconds since the + * Epoch. + */ + initiationTimestampMsec: string; + /** + * This kind represents a subscriptionPurchase object in the + * androidpublisher service. + */ + kind: string; + /** + * Time at which the subscription will expire, in milliseconds since the + * Epoch. + */ + validUntilTimestampMsec: string; } - - /** - * androidpublisher.purchases.cancel - * @desc Cancels a user's subscription purchase. The subscription remains - * valid until its expiration time. - * @alias androidpublisher.purchases.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Purchases { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * androidpublisher.purchases.get - * @desc Checks whether a user's subscription purchase is valid and returns - * its expiry time. - * @alias androidpublisher.purchases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * androidpublisher.purchases.cancel + * @desc Cancels a user's subscription purchase. The subscription remains + * valid until its expiration time. + * @alias androidpublisher.purchases.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * androidpublisher.purchases.get + * @desc Checks whether a user's subscription purchase is valid and returns + * its expiry time. + * @alias androidpublisher.purchases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v1/applications/{packageName}/subscriptions/{subscriptionId}/purchases/{token}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/androidpublisher/v2.ts b/src/apis/androidpublisher/v2.ts index 1b3888c160b..b80d0da9eb2 100644 --- a/src/apis/androidpublisher/v2.ts +++ b/src/apis/androidpublisher/v2.ts @@ -27,4267 +27,4306 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Developer API - * - * Lets Android application developers access their Google Play accounts. - * - * @example - * const google = require('googleapis'); - * const androidpublisher = google.androidpublisher('v2'); - * - * @namespace androidpublisher - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Androidpublisher - */ -export class Androidpublisher { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - edits: Resource$Edits; - inappproducts: Resource$Inappproducts; - purchases: Resource$Purchases; - reviews: Resource$Reviews; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.edits = new Resource$Edits(this); - this.inappproducts = new Resource$Inappproducts(this); - this.purchases = new Resource$Purchases(this); - this.reviews = new Resource$Reviews(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Apk { - /** - * Information about the binary payload of this APK. - */ - binary: Schema$ApkBinary; - /** - * The version code of the APK, as specified in the APK's manifest file. - */ - versionCode: number; -} -/** - * Represents the binary payload of an APK. - */ -export interface Schema$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; -} -export interface Schema$ApkListing { - /** - * The language code, in BCP 47 format (eg "en-US"). - */ - language: string; - /** - * Describe what's new in your APK. - */ - recentChanges: string; -} -export interface Schema$ApkListingsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidpublisher#apkListingsListResponse". - */ - kind: string; - listings: Schema$ApkListing[]; -} -export interface Schema$ApksAddExternallyHostedRequest { - /** - * The definition of the externally-hosted APK and where it is located. - */ - externallyHostedApk: Schema$ExternallyHostedApk; -} -export interface Schema$ApksAddExternallyHostedResponse { - /** - * The definition of the externally-hosted APK and where it is located. - */ - externallyHostedApk: Schema$ExternallyHostedApk; -} -export interface Schema$ApksListResponse { - apks: Schema$Apk[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidpublisher#apksListResponse". - */ - kind: string; -} -export interface Schema$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; -} -/** - * Represents an edit of an app. An edit allows clients to make multiple changes - * before committing them in one operation. - */ -export interface Schema$AppEdit { - /** - * The time at which the edit will expire and will be no longer valid for use - * in any subsequent API calls (encoded as seconds since the Epoch). - */ - expiryTimeSeconds: string; - /** - * The ID of the edit that can be used in subsequent API calls. - */ - id: string; -} -export interface Schema$Comment { - /** - * A comment from a developer. - */ - developerComment: Schema$DeveloperComment; - /** - * A comment from a user. - */ - userComment: Schema$UserComment; -} -/** - * Represents a deobfuscation file. - */ -export interface Schema$DeobfuscationFile { - /** - * The type of the deobfuscation file. - */ - symbolType: string; -} -export interface Schema$DeobfuscationFilesUploadResponse { - deobfuscationFile: Schema$DeobfuscationFile; -} -export interface Schema$DeveloperComment { - /** - * The last time at which this comment was updated. - */ - lastModified: Schema$Timestamp; - /** - * The content of the comment, i.e. reply body. - */ - text: string; -} -export interface Schema$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; -} -export interface Schema$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: string; - /** - * If set this APK's Expansion File references another APK's Expansion - * File. The file_size field will not be set. - */ - referencesVersion: number; -} -export interface Schema$ExpansionFilesUploadResponse { - expansionFile: Schema$ExpansionFile; -} -/** - * Defines an APK available for this application that is hosted externally and - * not uploaded to Google Play. This function is only available to enterprises - * who are using Google Play for Work, and whos application is restricted to the - * enterprise private channel - */ -export interface Schema$ExternallyHostedApk { - /** - * The application label. - */ - applicationLabel: string; - /** - * A certificate (or array of certificates if a certificate-chain is used) - * used to signed 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: string; - /** - * 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: Schema$ExternallyHostedApkUsesPermission[]; - /** - * The version code of this APK. - */ - versionCode: number; - /** - * The version name of this APK. - */ - versionName: string; -} -/** - * A permission used by this APK. - */ -export interface Schema$ExternallyHostedApkUsesPermission { - /** - * Optionally, the maximum SDK version for which the permission is required. - */ - maxSdkVersion: number; - /** - * The name of the permission requested. - */ - name: string; -} -export interface Schema$Image { - /** - * A unique id representing this image. - */ - id: string; - /** - * A sha1 hash of the image that was uploaded. - */ - sha1: string; - /** - * A URL that will serve a preview of the image. - */ - url: string; -} -export interface Schema$ImagesDeleteAllResponse { deleted: Schema$Image[]; } -export interface Schema$ImagesListResponse { images: Schema$Image[]; } -export interface Schema$ImagesUploadResponse { image: Schema$Image; } -export interface Schema$InAppProduct { - /** - * The default language of the localized data, as defined by BCP 47. e.g. - * "en-US", "en-GB". - */ - defaultLanguage: string; - /** - * Default price cannot be zero. In-app products can never be free. Default - * price is always in the developer's Checkout merchant currency. - */ - defaultPrice: Schema$Price; - /** - * List of localized title and description data. - */ - listings: any; - /** - * The package name of the parent app. - */ - packageName: string; - /** - * Prices per buyer region. None of these prices should be zero. In-app - * products can never be free. - */ - prices: any; - /** - * Purchase type enum value. Unmodifiable after creation. - */ - purchaseType: string; - /** - * Definition of a season for a seasonal subscription. Can be defined only for - * yearly subscriptions. - */ - season: Schema$Season; - /** - * The stock-keeping-unit (SKU) of the product, unique within an app. - */ - sku: string; - status: string; - /** - * 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; - /** - * Trial period, specified in ISO 8601 format. Acceptable values are anything - * between "P7D" (seven days) and "P999D" (999 days). - * Seasonal subscriptions cannot have a trial period. - */ - trialPeriod: string; -} -export interface Schema$InAppProductListing { - description: string; - title: string; -} -export interface Schema$InappproductsListResponse { - inappproduct: Schema$InAppProduct[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidpublisher#inappproductsListResponse". - */ - kind: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; -} -export interface Schema$Listing { - /** - * Full description of the app; this may be up to 4000 characters in length. - */ - fullDescription: string; - /** - * Language localization code (for example, "de-AT" for Austrian - * German). - */ - language: string; - /** - * Short description of the app (previously known as promo text); this may be - * up to 80 characters in length. - */ - shortDescription: string; - /** - * App's localized title. - */ - title: string; - /** - * URL of a promotional YouTube video for the app. - */ - video: string; -} -export interface Schema$ListingsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidpublisher#listingsListResponse". - */ - kind: string; - listings: Schema$Listing[]; -} -export interface Schema$MonthDay { - /** - * Day of a month, value in [1, 31] range. Valid range depends on the - * specified month. - */ - day: number; - /** - * Month of a year. e.g. 1 = JAN, 2 = FEB etc. - */ - month: number; -} -export interface Schema$PageInfo { - resultPerPage: number; - startIndex: number; - totalResults: number; -} -export interface Schema$Price { - /** - * 3 letter Currency code, as defined by ISO 4217. - */ - currency: string; - /** - * The price in millionths 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 Schema$ProductPurchase { - /** - * The consumption state of the inapp product. Possible values are: - Yet to - * be consumed - 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; - /** - * The order id associated with the purchase of the inapp product. - */ - orderId: string; - /** - * The purchase state of the order. Possible values are: - Purchased - - * Canceled - */ - purchaseState: number; - /** - * The time the product was purchased, in milliseconds since the epoch (Jan 1, - * 1970). - */ - purchaseTimeMillis: 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: - Test (i.e. purchased from a license testing account) - - * Promo (i.e. purchased using a promo code) - */ - purchaseType: number; -} -export interface Schema$Prorate { - /** - * Default price cannot be zero and must be less than the full subscription - * price. Default price is always in the developer's Checkout merchant - * currency. Targeted countries have their prices set automatically based on - * the default_price. - */ - defaultPrice: Schema$Price; - /** - * Defines the first day on which the price takes effect. - */ - start: Schema$MonthDay; -} -export interface Schema$Review { - /** - * The name of the user who wrote the review. - */ - authorName: string; - /** - * A repeated field containing comments for the review. - */ - comments: Schema$Comment[]; - /** - * Unique identifier for this review. - */ - reviewId: string; -} -export interface Schema$ReviewReplyResult { - /** - * The time at which the reply took effect. - */ - lastEdited: Schema$Timestamp; - /** - * The reply text that was applied. - */ - replyText: string; -} -export interface Schema$ReviewsListResponse { - pageInfo: Schema$PageInfo; - reviews: Schema$Review[]; - tokenPagination: Schema$TokenPagination; -} -export interface Schema$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; -} -export interface Schema$ReviewsReplyResponse { - result: Schema$ReviewReplyResult; -} -export interface Schema$Season { - /** - * Inclusive end date of the recurrence period. - */ - end: Schema$MonthDay; - /** - * Optionally present list of prorations for the season. Each proration is a - * one-off discounted entry into a subscription. Each proration contains the - * first date on which the discount is available and the new pricing - * information. - */ - prorations: Schema$Prorate[]; - /** - * Inclusive start date of the recurrence period. - */ - start: Schema$MonthDay; -} -/** - * A SubscriptionDeferralInfo contains the data needed to defer a subscription - * purchase to a future expiry time. - */ -export interface Schema$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: string; - /** - * 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: string; -} -/** - * A SubscriptionPurchase resource indicates the status of a user's - * subscription purchase. - */ -export interface Schema$SubscriptionPurchase { - /** - * Whether the subscription will automatically be renewed when it reaches its - * current expiry time. - */ - autoRenewing: boolean; - /** - * The reason why a subscription was canceled or is not auto-renewing. - * Possible values are: - User canceled the subscription - Subscription was - * canceled by the system, for example because of a billing problem - - * Subscription was replaced with a new subscription - Subscription was - * canceled by the developer - */ - cancelReason: number; - /** - * 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: 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; - /** - * 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: - Re-signup of a canceled but non-lapsed subscription - * - 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; - /** - * The order id of the latest recurring order associated with the purchase of - * the subscription. - */ - orderId: string; - /** - * The payment state of the subscription. Possible values are: - Payment - * pending - Payment received - Free trial - */ - paymentState: number; - /** - * Price of the subscription, not including 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: string; - /** - * 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 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 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: - Test (i.e. purchased from a license testing account) - */ - purchaseType: number; - /** - * Time at which the subscription was granted, in milliseconds since the - * Epoch. - */ - startTimeMillis: string; - /** - * The time at which the subscription was canceled by the user, in - * milliseconds since the epoch. Only present if cancelReason is 0. - */ - userCancellationTimeMillis: string; -} -export interface Schema$SubscriptionPurchasesDeferRequest { - /** - * The information about the new desired expiry time for the subscription. - */ - deferralInfo: Schema$SubscriptionDeferralInfo; -} -export interface Schema$SubscriptionPurchasesDeferResponse { - /** - * The new expiry time for the subscription in milliseconds since the Epoch. - */ - newExpiryTimeMillis: string; -} -export interface Schema$Testers { - googleGroups: string[]; - googlePlusCommunities: string[]; -} -export interface Schema$Timestamp { - nanos: number; - seconds: string; -} -export interface Schema$TokenPagination { - nextPageToken: string; - previousPageToken: string; -} -export interface Schema$Track { - /** - * Identifier for this track. One of "alpha", "beta", - * "production", "rollout" or "internal". - */ - track: string; - userFraction: number; - versionCodes: number[]; -} -export interface Schema$TracksListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "androidpublisher#tracksListResponse". - */ - kind: string; - tracks: Schema$Track[]; -} -export interface Schema$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; - /** - * Some information about the characteristics of the user's device - */ - deviceMetadata: Schema$DeviceMetadata; - /** - * The last time at which this comment was updated. - */ - lastModified: Schema$Timestamp; - /** - * Untranslated text of the review, in the case where the review has been - * translated. If the review has not been 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; -} -/** - * A VoidedPurchase resource indicates a purchase that was either - * canceled/refunded/charged-back. - */ -export interface Schema$VoidedPurchase { - /** - * This kind represents a voided purchase object in the androidpublisher - * service. - */ - kind: string; - /** - * The time at which the purchase was made, in milliseconds since the epoch - * (Jan 1, 1970). - */ - purchaseTimeMillis: string; - /** - * The token that was generated when a purchase was made. This uniquely - * identifies a purchase. - */ - purchaseToken: string; - /** - * The time at which the purchase was canceled/refunded/charged-back, in - * milliseconds since the epoch (Jan 1, 1970). - */ - voidedTimeMillis: string; -} -export interface Schema$VoidedPurchasesListResponse { - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - voidedPurchases: Schema$VoidedPurchase[]; -} - -export class Resource$Edits { - root: Androidpublisher; - apklistings: Resource$Edits$Apklistings; - apks: Resource$Edits$Apks; - deobfuscationfiles: Resource$Edits$Deobfuscationfiles; - details: Resource$Edits$Details; - expansionfiles: Resource$Edits$Expansionfiles; - images: Resource$Edits$Images; - listings: Resource$Edits$Listings; - testers: Resource$Edits$Testers; - tracks: Resource$Edits$Tracks; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - this.apklistings = new Resource$Edits$Apklistings(root); - this.apks = new Resource$Edits$Apks(root); - this.deobfuscationfiles = new Resource$Edits$Deobfuscationfiles(root); - this.details = new Resource$Edits$Details(root); - this.expansionfiles = new Resource$Edits$Expansionfiles(root); - this.images = new Resource$Edits$Images(root); - this.listings = new Resource$Edits$Listings(root); - this.testers = new Resource$Edits$Testers(root); - this.tracks = new Resource$Edits$Tracks(root); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.commit - * @desc Commits/applies the changes made in this edit back to the app. - * @alias androidpublisher.edits.commit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - commit(params?: any, options?: MethodOptions): AxiosPromise; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}:commit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.delete - * @desc Deletes an edit for an app. Creating a new edit will automatically - * delete any of your previous edits so this method need only be called if you - * want to preemptively abandon an edit. - * @alias androidpublisher.edits.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.get - * @desc Returns information about the edit specified. Calls will fail if the - * edit is no long active (e.g. has been deleted, superseded or expired). - * @alias androidpublisher.edits.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.insert - * @desc Creates a new edit for an app, populated with the app's current - * state. - * @alias androidpublisher.edits.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().AppEdit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName'], - pathParams: ['packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.validate - * @desc Checks that the edit can be successfully committed. The edit's - * changes are not applied to the live app. - * @alias androidpublisher.edits.validate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - validate(params?: any, options?: MethodOptions): AxiosPromise; - validate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - validate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}:validate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Edits$Apklistings { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.apklistings.delete - * @desc Deletes the APK-specific localized listing for a specified APK and - * language code. - * @alias androidpublisher.edits.apklistings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], - pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apklistings.deleteall - * @desc Deletes all the APK-specific localized listings for a specified APK. - * @alias androidpublisher.edits.apklistings.deleteall - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteall(params?: any, options?: MethodOptions): AxiosPromise; - deleteall( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteall( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode'], - pathParams: ['apkVersionCode', 'editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apklistings.get - * @desc Fetches the APK-specific localized listing for a specified APK and - * language code. - * @alias androidpublisher.edits.apklistings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], - pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apklistings.list - * @desc Lists all the APK-specific localized listings for a specified APK. - * @alias androidpublisher.edits.apklistings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode'], - pathParams: ['apkVersionCode', 'editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apklistings.patch - * @desc Updates or creates the APK-specific localized listing for a specified - * APK and language code. This method supports patch semantics. - * @alias androidpublisher.edits.apklistings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().ApkListing} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], - pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apklistings.update - * @desc Updates or creates the APK-specific localized listing for a specified - * APK and language code. - * @alias androidpublisher.edits.apklistings.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().ApkListing} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], - pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Edits$Apks { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.apks.addexternallyhosted - * @desc 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 enterprises using Google Play for Work whose application is configured - * to restrict distribution to the enterprise domain. - * @alias androidpublisher.edits.apks.addexternallyhosted - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().ApksAddExternallyHostedRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addexternallyhosted(params?: any, options?: MethodOptions): - AxiosPromise; - addexternallyhosted( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - addexternallyhosted( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/externallyHosted') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * androidpublisher.edits.apks.list - * @alias androidpublisher.edits.apks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.apks.upload - * @alias androidpublisher.edits.apks.upload - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - upload(params?: any, options?: MethodOptions): AxiosPromise; - upload( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - upload( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Edits$Deobfuscationfiles { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.deobfuscationfiles.upload - * @desc Uploads the deobfuscation file of the specified APK. If a - * deobfuscation file already exists, it will be replaced. - * @alias androidpublisher.edits.deobfuscationfiles.upload - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The version code of the APK whose deobfuscation file is being uploaded. - * @param {string} params.deobfuscationFileType - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, "com.spiffygame". - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - upload(params?: any, options?: MethodOptions): - AxiosPromise; - upload( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - upload( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: - ['packageName', 'editId', 'apkVersionCode', 'deobfuscationFileType'], - pathParams: - ['apkVersionCode', 'deobfuscationFileType', 'editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Edits$Details { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.details.get - * @desc Fetches app details for this edit. This includes the default language - * and developer support contact information. - * @alias androidpublisher.edits.details.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.details.patch - * @desc Updates app details for this edit. This method supports patch - * semantics. - * @alias androidpublisher.edits.details.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().AppDetails} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.details.update - * @desc Updates app details for this edit. - * @alias androidpublisher.edits.details.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().AppDetails} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Edits$Expansionfiles { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.expansionfiles.get - * @desc Fetches the Expansion File configuration for the APK specified. - * @alias androidpublisher.edits.expansionfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.expansionFileType - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], - pathParams: - ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.expansionfiles.patch - * @desc Updates the APK's Expansion File configuration to reference another - * APK's Expansion Files. To add a new Expansion File use the Upload method. - * This method supports patch semantics. - * @alias androidpublisher.edits.expansionfiles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.expansionFileType - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().ExpansionFile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: - ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], - pathParams: - ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.expansionfiles.update - * @desc Updates the APK's Expansion File configuration to reference another - * APK's Expansion Files. To add a new Expansion File use the Upload method. - * @alias androidpublisher.edits.expansionfiles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.expansionFileType - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().ExpansionFile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: - ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], - pathParams: - ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.expansionfiles.upload - * @desc Uploads and attaches a new Expansion File to the APK specified. - * @alias androidpublisher.edits.expansionfiles.upload - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.expansionFileType - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - upload(params?: any, options?: MethodOptions): - AxiosPromise; - upload( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - upload( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: - ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], - pathParams: - ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Edits$Images { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * androidpublisher.edits.images.delete - * @desc Deletes the image (specified by id) from the edit. - * @alias androidpublisher.edits.images.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.imageId Unique identifier an image within the set of images attached to this edit. - * @param {string} params.imageType - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: - ['packageName', 'editId', 'language', 'imageType', 'imageId'], - pathParams: ['editId', 'imageId', 'imageType', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.images.deleteall - * @desc Deletes all images for the specified language and image type. - * @alias androidpublisher.edits.images.deleteall - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.imageType - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteall(params?: any, options?: MethodOptions): - AxiosPromise; - deleteall( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteall( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language', 'imageType'], - pathParams: ['editId', 'imageType', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * androidpublisher.edits.images.list - * @desc Lists all images for the specified language and image type. - * @alias androidpublisher.edits.images.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.imageType - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language', 'imageType'], - pathParams: ['editId', 'imageType', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace androidpublisher_v2 { /** - * androidpublisher.edits.images.upload - * @desc Uploads a new image and adds it to the list of images for the - * specified language and image type. - * @alias androidpublisher.edits.images.upload - * @memberOf! () + * Google Play Developer API + * + * Lets Android application developers access their Google Play accounts. + * + * @example + * const google = require('googleapis'); + * const androidpublisher = google.androidpublisher('v2'); * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.imageType - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace androidpublisher + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Androidpublisher */ - upload(params?: any, options?: MethodOptions): - AxiosPromise; - upload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - upload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['packageName', 'editId', 'language', 'imageType'], - pathParams: ['editId', 'imageType', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Edits$Listings { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - } + export class Androidpublisher { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + edits: Resource$Edits; + inappproducts: Resource$Inappproducts; + purchases: Resource$Purchases; + reviews: Resource$Reviews; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * androidpublisher.edits.listings.delete - * @desc Deletes the specified localized store listing from an edit. - * @alias androidpublisher.edits.listings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.edits = new Resource$Edits(this); + this.inappproducts = new Resource$Inappproducts(this); + this.purchases = new Resource$Purchases(this); + this.reviews = new Resource$Reviews(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language'], - pathParams: ['editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * androidpublisher.edits.listings.deleteall - * @desc Deletes all localized listings from an edit. - * @alias androidpublisher.edits.listings.deleteall - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteall(params?: any, options?: MethodOptions): AxiosPromise; - deleteall( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteall( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - - /** - * androidpublisher.edits.listings.get - * @desc Fetches information about a localized store listing. - * @alias androidpublisher.edits.listings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language'], - pathParams: ['editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Apk { + /** + * Information about the binary payload of this APK. + */ + binary: Schema$ApkBinary; + /** + * The version code of the APK, as specified in the APK's manifest file. + */ + versionCode: number; } - - /** - * androidpublisher.edits.listings.list - * @desc Returns all of the localized store listings attached to this edit. - * @alias androidpublisher.edits.listings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the binary payload of an APK. + */ + export interface Schema$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; } - - - /** - * androidpublisher.edits.listings.patch - * @desc Creates or updates a localized store listing. This method supports - * patch semantics. - * @alias androidpublisher.edits.listings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().Listing} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language'], - pathParams: ['editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ApkListing { + /** + * The language code, in BCP 47 format (eg "en-US"). + */ + language: string; + /** + * Describe what's new in your APK. + */ + recentChanges: string; } - - - /** - * androidpublisher.edits.listings.update - * @desc Creates or updates a localized store listing. - * @alias androidpublisher.edits.listings.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {().Listing} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'language'], - pathParams: ['editId', 'language', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ApkListingsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidpublisher#apkListingsListResponse". + */ + kind: string; + listings: Schema$ApkListing[]; } -} - -export class Resource$Edits$Testers { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ApksAddExternallyHostedRequest { + /** + * The definition of the externally-hosted APK and where it is located. + */ + externallyHostedApk: Schema$ExternallyHostedApk; } - - getRoot() { - return this.root; + export interface Schema$ApksAddExternallyHostedResponse { + /** + * The definition of the externally-hosted APK and where it is located. + */ + externallyHostedApk: Schema$ExternallyHostedApk; } - - - /** - * androidpublisher.edits.testers.get - * @alias androidpublisher.edits.testers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ApksListResponse { + apks: Schema$Apk[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidpublisher#apksListResponse". + */ + kind: string; + } + export interface Schema$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; } - - /** - * androidpublisher.edits.testers.patch - * @alias androidpublisher.edits.testers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {().Testers} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an edit of an app. An edit allows clients to make multiple + * changes before committing them in one operation. + */ + export interface Schema$AppEdit { + /** + * The time at which the edit will expire and will be no longer valid for + * use in any subsequent API calls (encoded as seconds since the Epoch). + */ + expiryTimeSeconds: string; + /** + * The ID of the edit that can be used in subsequent API calls. + */ + id: string; + } + export interface Schema$Comment { + /** + * A comment from a developer. + */ + developerComment: Schema$DeveloperComment; + /** + * A comment from a user. + */ + userComment: Schema$UserComment; } - - /** - * androidpublisher.edits.testers.update - * @alias androidpublisher.edits.testers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {().Testers} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Represents a deobfuscation file. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$DeobfuscationFile { + /** + * The type of the deobfuscation file. + */ + symbolType: string; } -} - -export class Resource$Edits$Tracks { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$DeobfuscationFilesUploadResponse { + deobfuscationFile: Schema$DeobfuscationFile; } - - getRoot() { - return this.root; + export interface Schema$DeveloperComment { + /** + * The last time at which this comment was updated. + */ + lastModified: Schema$Timestamp; + /** + * The content of the comment, i.e. reply body. + */ + text: string; } - - - /** - * androidpublisher.edits.tracks.get - * @desc Fetches the track configuration for the specified track type. - * Includes the APK version codes that are in this track. - * @alias androidpublisher.edits.tracks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$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; } - - - /** - * androidpublisher.edits.tracks.list - * @desc Lists all the track configurations for this edit. - * @alias androidpublisher.edits.tracks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'editId'], - pathParams: ['editId', 'packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$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: string; + /** + * If set this APK's Expansion File references another APK's + * Expansion File. The file_size field will not be set. + */ + referencesVersion: number; + } + export interface Schema$ExpansionFilesUploadResponse { + expansionFile: Schema$ExpansionFile; } - - /** - * androidpublisher.edits.tracks.patch - * @desc Updates the track configuration for the specified track type. When - * halted, the rollout track cannot be updated without adding new APKs, and - * adding new APKs will cause it to resume. This method supports patch - * semantics. - * @alias androidpublisher.edits.tracks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {().Track} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an APK available for this application that is hosted externally and + * not uploaded to Google Play. This function is only available to enterprises + * who are using Google Play for Work, and whos application is restricted to + * the enterprise private channel + */ + export interface Schema$ExternallyHostedApk { + /** + * The application label. + */ + applicationLabel: string; + /** + * A certificate (or array of certificates if a certificate-chain is used) + * used to signed 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: string; + /** + * 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: Schema$ExternallyHostedApkUsesPermission[]; + /** + * The version code of this APK. + */ + versionCode: number; + /** + * The version name of this APK. + */ + versionName: string; } - - /** - * androidpublisher.edits.tracks.update - * @desc Updates the track configuration for the specified track type. When - * halted, the rollout track cannot be updated without adding new APKs, and - * adding new APKs will cause it to resume. - * @alias androidpublisher.edits.tracks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.editId Unique identifier for this edit. - * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". - * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". - * @param {().Track} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'editId', 'track'], - pathParams: ['editId', 'packageName', 'track'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A permission used by this APK. + */ + export interface Schema$ExternallyHostedApkUsesPermission { + /** + * Optionally, the maximum SDK version for which the permission is required. + */ + maxSdkVersion: number; + /** + * The name of the permission requested. + */ + name: string; } -} - - -export class Resource$Inappproducts { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Image { + /** + * A unique id representing this image. + */ + id: string; + /** + * A sha1 hash of the image that was uploaded. + */ + sha1: string; + /** + * A URL that will serve a preview of the image. + */ + url: string; } - - getRoot() { - return this.root; + export interface Schema$ImagesDeleteAllResponse { deleted: Schema$Image[]; } + export interface Schema$ImagesListResponse { images: Schema$Image[]; } + export interface Schema$ImagesUploadResponse { image: Schema$Image; } + export interface Schema$InAppProduct { + /** + * The default language of the localized data, as defined by BCP 47. e.g. + * "en-US", "en-GB". + */ + defaultLanguage: string; + /** + * Default price cannot be zero. In-app products can never be free. Default + * price is always in the developer's Checkout merchant currency. + */ + defaultPrice: Schema$Price; + /** + * List of localized title and description data. + */ + listings: any; + /** + * The package name of the parent app. + */ + packageName: string; + /** + * Prices per buyer region. None of these prices should be zero. In-app + * products can never be free. + */ + prices: any; + /** + * Purchase type enum value. Unmodifiable after creation. + */ + purchaseType: string; + /** + * Definition of a season for a seasonal subscription. Can be defined only + * for yearly subscriptions. + */ + season: Schema$Season; + /** + * The stock-keeping-unit (SKU) of the product, unique within an app. + */ + sku: string; + status: string; + /** + * 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; + /** + * Trial period, specified in ISO 8601 format. Acceptable values are + * anything between "P7D" (seven days) and "P999D" (999 + * days). Seasonal subscriptions cannot have a trial period. + */ + trialPeriod: string; } - - - /** - * androidpublisher.inappproducts.delete - * @desc Delete an in-app product for an app. - * @alias androidpublisher.inappproducts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". - * @param {string} params.sku Unique identifier for the in-app product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['packageName', 'sku'], - pathParams: ['packageName', 'sku'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InAppProductListing { + description: string; + title: string; } - - - /** - * androidpublisher.inappproducts.get - * @desc Returns information about the in-app product specified. - * @alias androidpublisher.inappproducts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName - * @param {string} params.sku Unique identifier for the in-app product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'sku'], - pathParams: ['packageName', 'sku'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InappproductsListResponse { + inappproduct: Schema$InAppProduct[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidpublisher#inappproductsListResponse". + */ + kind: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; } - - - /** - * androidpublisher.inappproducts.insert - * @desc Creates a new in-app product for an app. - * @alias androidpublisher.inappproducts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. - * @param {string} params.packageName Unique identifier for the Android app; for example, "com.spiffygame". - * @param {().InAppProduct} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName'], - pathParams: ['packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Listing { + /** + * Full description of the app; this may be up to 4000 characters in length. + */ + fullDescription: string; + /** + * Language localization code (for example, "de-AT" for Austrian + * German). + */ + language: string; + /** + * Short description of the app (previously known as promo text); this may + * be up to 80 characters in length. + */ + shortDescription: string; + /** + * App's localized title. + */ + title: string; + /** + * URL of a promotional YouTube video for the app. + */ + video: string; + } + export interface Schema$ListingsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidpublisher#listingsListResponse". + */ + kind: string; + listings: Schema$Listing[]; + } + export interface Schema$MonthDay { + /** + * Day of a month, value in [1, 31] range. Valid range depends on the + * specified month. + */ + day: number; + /** + * Month of a year. e.g. 1 = JAN, 2 = FEB etc. + */ + month: number; + } + export interface Schema$PageInfo { + resultPerPage: number; + startIndex: number; + totalResults: number; + } + export interface Schema$Price { + /** + * 3 letter Currency code, as defined by ISO 4217. + */ + currency: string; + /** + * The price in millionths of the currency base unit represented as a + * string. + */ + priceMicros: string; } - - /** - * androidpublisher.inappproducts.list - * @desc List all the in-app products for an Android app, both subscriptions - * and managed in-app products.. - * @alias androidpublisher.inappproducts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults - * @param {string} params.packageName Unique identifier for the Android app with in-app products; for example, "com.spiffygame". - * @param {integer=} params.startIndex - * @param {string=} params.token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName'], - pathParams: ['packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A ProductPurchase resource indicates the status of a user's inapp + * product purchase. + */ + export interface Schema$ProductPurchase { + /** + * The consumption state of the inapp product. Possible values are: - Yet + * to be consumed - 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; + /** + * The order id associated with the purchase of the inapp product. + */ + orderId: string; + /** + * The purchase state of the order. Possible values are: - Purchased - + * Canceled + */ + purchaseState: number; + /** + * The time the product was purchased, in milliseconds since the epoch (Jan + * 1, 1970). + */ + purchaseTimeMillis: 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: - Test (i.e. purchased from a license testing account) - + * Promo (i.e. purchased using a promo code) + */ + purchaseType: number; + } + export interface Schema$Prorate { + /** + * Default price cannot be zero and must be less than the full subscription + * price. Default price is always in the developer's Checkout merchant + * currency. Targeted countries have their prices set automatically based on + * the default_price. + */ + defaultPrice: Schema$Price; + /** + * Defines the first day on which the price takes effect. + */ + start: Schema$MonthDay; + } + export interface Schema$Review { + /** + * The name of the user who wrote the review. + */ + authorName: string; + /** + * A repeated field containing comments for the review. + */ + comments: Schema$Comment[]; + /** + * Unique identifier for this review. + */ + reviewId: string; + } + export interface Schema$ReviewReplyResult { + /** + * The time at which the reply took effect. + */ + lastEdited: Schema$Timestamp; + /** + * The reply text that was applied. + */ + replyText: string; + } + export interface Schema$ReviewsListResponse { + pageInfo: Schema$PageInfo; + reviews: Schema$Review[]; + tokenPagination: Schema$TokenPagination; + } + export interface Schema$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; + } + export interface Schema$ReviewsReplyResponse { + result: Schema$ReviewReplyResult; + } + export interface Schema$Season { + /** + * Inclusive end date of the recurrence period. + */ + end: Schema$MonthDay; + /** + * Optionally present list of prorations for the season. Each proration is a + * one-off discounted entry into a subscription. Each proration contains the + * first date on which the discount is available and the new pricing + * information. + */ + prorations: Schema$Prorate[]; + /** + * Inclusive start date of the recurrence period. + */ + start: Schema$MonthDay; } - - /** - * androidpublisher.inappproducts.patch - * @desc Updates the details of an in-app product. This method supports patch - * semantics. - * @alias androidpublisher.inappproducts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. - * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". - * @param {string} params.sku Unique identifier for the in-app product. - * @param {().InAppProduct} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['packageName', 'sku'], - pathParams: ['packageName', 'sku'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A SubscriptionDeferralInfo contains the data needed to defer a subscription + * purchase to a future expiry time. + */ + export interface Schema$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: string; + /** + * 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: string; } - - /** - * androidpublisher.inappproducts.update - * @desc Updates the details of an in-app product. - * @alias androidpublisher.inappproducts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. - * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". - * @param {string} params.sku Unique identifier for the in-app product. - * @param {().InAppProduct} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['packageName', 'sku'], - pathParams: ['packageName', 'sku'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A SubscriptionPurchase resource indicates the status of a user's + * subscription purchase. + */ + export interface Schema$SubscriptionPurchase { + /** + * Whether the subscription will automatically be renewed when it reaches + * its current expiry time. + */ + autoRenewing: boolean; + /** + * The reason why a subscription was canceled or is not auto-renewing. + * Possible values are: - User canceled the subscription - Subscription + * was canceled by the system, for example because of a billing problem - + * Subscription was replaced with a new subscription - Subscription was + * canceled by the developer + */ + cancelReason: number; + /** + * 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: 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; + /** + * 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: - Re-signup of a canceled but non-lapsed + * subscription - 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; + /** + * The order id of the latest recurring order associated with the purchase + * of the subscription. + */ + orderId: string; + /** + * The payment state of the subscription. Possible values are: - Payment + * pending - Payment received - Free trial + */ + paymentState: number; + /** + * Price of the subscription, not including 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: string; + /** + * 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 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 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: - Test (i.e. purchased from a license testing account) + */ + purchaseType: number; + /** + * Time at which the subscription was granted, in milliseconds since the + * Epoch. + */ + startTimeMillis: string; + /** + * The time at which the subscription was canceled by the user, in + * milliseconds since the epoch. Only present if cancelReason is 0. + */ + userCancellationTimeMillis: string; } -} - -export class Resource$Purchases { - root: Androidpublisher; - products: Resource$Purchases$Products; - subscriptions: Resource$Purchases$Subscriptions; - voidedpurchases: Resource$Purchases$Voidedpurchases; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); - this.products = new Resource$Purchases$Products(root); - this.subscriptions = new Resource$Purchases$Subscriptions(root); - this.voidedpurchases = new Resource$Purchases$Voidedpurchases(root); + export interface Schema$SubscriptionPurchasesDeferRequest { + /** + * The information about the new desired expiry time for the subscription. + */ + deferralInfo: Schema$SubscriptionDeferralInfo; } - - getRoot() { - return this.root; + export interface Schema$SubscriptionPurchasesDeferResponse { + /** + * The new expiry time for the subscription in milliseconds since the Epoch. + */ + newExpiryTimeMillis: string; } -} -export class Resource$Purchases$Products { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Testers { + googleGroups: string[]; + googlePlusCommunities: string[]; } - - getRoot() { - return this.root; + export interface Schema$Timestamp { + nanos: number; + seconds: string; } - - - /** - * androidpublisher.purchases.products.get - * @desc Checks the purchase and consumption status of an inapp item. - * @alias androidpublisher.purchases.products.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). - * @param {string} params.productId The inapp product SKU (for example, 'com.some.thing.inapp1'). - * @param {string} params.token The token provided to the user's device when the inapp product was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/products/{productId}/tokens/{token}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'productId', 'token'], - pathParams: ['packageName', 'productId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TokenPagination { + nextPageToken: string; + previousPageToken: string; } -} - -export class Resource$Purchases$Subscriptions { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Track { + /** + * Identifier for this track. One of "alpha", "beta", + * "production", "rollout" or "internal". + */ + track: string; + userFraction: number; + versionCodes: number[]; } - - getRoot() { - return this.root; + export interface Schema$TracksListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "androidpublisher#tracksListResponse". + */ + kind: string; + tracks: Schema$Track[]; + } + export interface Schema$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; + /** + * Some information about the characteristics of the user's device + */ + deviceMetadata: Schema$DeviceMetadata; + /** + * The last time at which this comment was updated. + */ + lastModified: Schema$Timestamp; + /** + * Untranslated text of the review, in the case where the review has been + * translated. If the review has not been 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; } - - /** - * androidpublisher.purchases.subscriptions.cancel - * @desc Cancels a user's subscription purchase. The subscription remains - * valid until its expiration time. - * @alias androidpublisher.purchases.subscriptions.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A VoidedPurchase resource indicates a purchase that was either + * canceled/refunded/charged-back. + */ + export interface Schema$VoidedPurchase { + /** + * This kind represents a voided purchase object in the androidpublisher + * service. + */ + kind: string; + /** + * The time at which the purchase was made, in milliseconds since the epoch + * (Jan 1, 1970). + */ + purchaseTimeMillis: string; + /** + * The token that was generated when a purchase was made. This uniquely + * identifies a purchase. + */ + purchaseToken: string; + /** + * The time at which the purchase was canceled/refunded/charged-back, in + * milliseconds since the epoch (Jan 1, 1970). + */ + voidedTimeMillis: string; + } + export interface Schema$VoidedPurchasesListResponse { + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + voidedPurchases: Schema$VoidedPurchase[]; } - - /** - * androidpublisher.purchases.subscriptions.defer - * @desc Defers a user's subscription purchase until a specified future - * expiration time. - * @alias androidpublisher.purchases.subscriptions.defer - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {().SubscriptionPurchasesDeferRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - defer(params?: any, options?: MethodOptions): - AxiosPromise; - defer( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - defer( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Edits { + root: Androidpublisher; + apklistings: Resource$Edits$Apklistings; + apks: Resource$Edits$Apks; + deobfuscationfiles: Resource$Edits$Deobfuscationfiles; + details: Resource$Edits$Details; + expansionfiles: Resource$Edits$Expansionfiles; + images: Resource$Edits$Images; + listings: Resource$Edits$Listings; + testers: Resource$Edits$Testers; + tracks: Resource$Edits$Tracks; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + this.apklistings = new Resource$Edits$Apklistings(root); + this.apks = new Resource$Edits$Apks(root); + this.deobfuscationfiles = new Resource$Edits$Deobfuscationfiles(root); + this.details = new Resource$Edits$Details(root); + this.expansionfiles = new Resource$Edits$Expansionfiles(root); + this.images = new Resource$Edits$Images(root); + this.listings = new Resource$Edits$Listings(root); + this.testers = new Resource$Edits$Testers(root); + this.tracks = new Resource$Edits$Tracks(root); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.commit + * @desc Commits/applies the changes made in this edit back to the app. + * @alias androidpublisher.edits.commit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + commit(params?: any, options?: MethodOptions): AxiosPromise; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}:commit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.delete + * @desc Deletes an edit for an app. Creating a new edit will automatically + * delete any of your previous edits so this method need only be called if + * you want to preemptively abandon an edit. + * @alias androidpublisher.edits.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.get + * @desc Returns information about the edit specified. Calls will fail if + * the edit is no long active (e.g. has been deleted, superseded or + * expired). + * @alias androidpublisher.edits.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.insert + * @desc Creates a new edit for an app, populated with the app's current + * state. + * @alias androidpublisher.edits.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().AppEdit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.validate + * @desc Checks that the edit can be successfully committed. The edit's + * changes are not applied to the live app. + * @alias androidpublisher.edits.validate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + validate(params?: any, options?: MethodOptions): + AxiosPromise; + validate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + validate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}:validate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + export class Resource$Edits$Apklistings { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.apklistings.delete + * @desc Deletes the APK-specific localized listing for a specified APK and + * language code. + * @alias androidpublisher.edits.apklistings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], + pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apklistings.deleteall + * @desc Deletes all the APK-specific localized listings for a specified + * APK. + * @alias androidpublisher.edits.apklistings.deleteall + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteall(params?: any, options?: MethodOptions): AxiosPromise; + deleteall( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteall( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode'], + pathParams: ['apkVersionCode', 'editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apklistings.get + * @desc Fetches the APK-specific localized listing for a specified APK and + * language code. + * @alias androidpublisher.edits.apklistings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], + pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apklistings.list + * @desc Lists all the APK-specific localized listings for a specified APK. + * @alias androidpublisher.edits.apklistings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode'], + pathParams: ['apkVersionCode', 'editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apklistings.patch + * @desc Updates or creates the APK-specific localized listing for a + * specified APK and language code. This method supports patch semantics. + * @alias androidpublisher.edits.apklistings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().ApkListing} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], + pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apklistings.update + * @desc Updates or creates the APK-specific localized listing for a + * specified APK and language code. + * @alias androidpublisher.edits.apklistings.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The APK version code whose APK-specific listings should be read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().ApkListing} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'apkVersionCode', 'language'], + pathParams: ['apkVersionCode', 'editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidpublisher.purchases.subscriptions.get - * @desc Checks whether a user's subscription purchase is valid and returns - * its expiry time. - * @alias androidpublisher.purchases.subscriptions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Edits$Apks { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.apks.addexternallyhosted + * @desc 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 enterprises using Google Play for Work whose application is + * configured to restrict distribution to the enterprise domain. + * @alias androidpublisher.edits.apks.addexternallyhosted + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().ApksAddExternallyHostedRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addexternallyhosted(params?: any, options?: MethodOptions): + AxiosPromise; + addexternallyhosted( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + addexternallyhosted( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/externallyHosted') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androidpublisher.edits.apks.list + * @alias androidpublisher.edits.apks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.apks.upload + * @alias androidpublisher.edits.apks.upload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + upload(params?: any, options?: MethodOptions): AxiosPromise; + upload( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + upload( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidpublisher.purchases.subscriptions.refund - * @desc Refunds a user's subscription purchase, but the subscription remains - * valid until its expiration time and it will continue to recur. - * @alias androidpublisher.purchases.subscriptions.refund - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - refund(params?: any, options?: MethodOptions): AxiosPromise; - refund( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - refund( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Edits$Deobfuscationfiles { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.deobfuscationfiles.upload + * @desc Uploads the deobfuscation file of the specified APK. If a + * deobfuscation file already exists, it will be replaced. + * @alias androidpublisher.edits.deobfuscationfiles.upload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The version code of the APK whose deobfuscation file is being uploaded. + * @param {string} params.deobfuscationFileType + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, "com.spiffygame". + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + upload(params?: any, options?: MethodOptions): + AxiosPromise; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: [ + 'packageName', 'editId', 'apkVersionCode', 'deobfuscationFileType' + ], + pathParams: [ + 'apkVersionCode', 'deobfuscationFileType', 'editId', 'packageName' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * androidpublisher.purchases.subscriptions.revoke - * @desc Refunds and immediately revokes a user's subscription purchase. - * Access to the subscription will be terminated immediately and it will stop - * recurring. - * @alias androidpublisher.purchases.subscriptions.revoke - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). - * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). - * @param {string} params.token The token provided to the user's device when the subscription was purchased. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revoke(params?: any, options?: MethodOptions): AxiosPromise; - revoke( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revoke( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'subscriptionId', 'token'], - pathParams: ['packageName', 'subscriptionId', 'token'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Edits$Details { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.details.get + * @desc Fetches app details for this edit. This includes the default + * language and developer support contact information. + * @alias androidpublisher.edits.details.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.details.patch + * @desc Updates app details for this edit. This method supports patch + * semantics. + * @alias androidpublisher.edits.details.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().AppDetails} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.details.update + * @desc Updates app details for this edit. + * @alias androidpublisher.edits.details.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().AppDetails} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/details') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Purchases$Voidedpurchases { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Edits$Expansionfiles { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.expansionfiles.get + * @desc Fetches the Expansion File configuration for the APK specified. + * @alias androidpublisher.edits.expansionfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.expansionFileType + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], + pathParams: + ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.expansionfiles.patch + * @desc Updates the APK's Expansion File configuration to reference another + * APK's Expansion Files. To add a new Expansion File use the Upload method. + * This method supports patch semantics. + * @alias androidpublisher.edits.expansionfiles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.expansionFileType + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().ExpansionFile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: + ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], + pathParams: + ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.expansionfiles.update + * @desc Updates the APK's Expansion File configuration to reference another + * APK's Expansion Files. To add a new Expansion File use the Upload method. + * @alias androidpublisher.edits.expansionfiles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.expansionFileType + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().ExpansionFile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: + ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], + pathParams: + ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.expansionfiles.upload + * @desc Uploads and attaches a new Expansion File to the APK specified. + * @alias androidpublisher.edits.expansionfiles.upload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.apkVersionCode The version code of the APK whose Expansion File configuration is being read or modified. + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.expansionFileType + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + upload(params?: any, options?: MethodOptions): + AxiosPromise; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: + ['packageName', 'editId', 'apkVersionCode', 'expansionFileType'], + pathParams: + ['apkVersionCode', 'editId', 'expansionFileType', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Edits$Images { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.images.delete + * @desc Deletes the image (specified by id) from the edit. + * @alias androidpublisher.edits.images.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.imageId Unique identifier an image within the set of images attached to this edit. + * @param {string} params.imageType + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: + ['packageName', 'editId', 'language', 'imageType', 'imageId'], + pathParams: + ['editId', 'imageId', 'imageType', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.images.deleteall + * @desc Deletes all images for the specified language and image type. + * @alias androidpublisher.edits.images.deleteall + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.imageType + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteall(params?: any, options?: MethodOptions): + AxiosPromise; + deleteall( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteall( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language', 'imageType'], + pathParams: ['editId', 'imageType', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.images.list + * @desc Lists all images for the specified language and image type. + * @alias androidpublisher.edits.images.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.imageType + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language', 'imageType'], + pathParams: ['editId', 'imageType', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.images.upload + * @desc Uploads a new image and adds it to the list of images for the + * specified language and image type. + * @alias androidpublisher.edits.images.upload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.imageType + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + upload(params?: any, options?: MethodOptions): + AxiosPromise; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + upload( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['packageName', 'editId', 'language', 'imageType'], + pathParams: ['editId', 'imageType', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * androidpublisher.purchases.voidedpurchases.list - * @desc Lists the purchases that were canceled, refunded or charged-back. - * @alias androidpublisher.purchases.voidedpurchases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.endTime The time, in milliseconds since the Epoch, of the newest voided in-app product 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. - * @param {integer=} params.maxResults - * @param {string} params.packageName The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). - * @param {integer=} params.startIndex - * @param {string=} params.startTime The time, in milliseconds since the Epoch, of the oldest voided in-app product 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. - * @param {string=} params.token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/purchases/voidedpurchases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName'], - pathParams: ['packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Edits$Listings { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.listings.delete + * @desc Deletes the specified localized store listing from an edit. + * @alias androidpublisher.edits.listings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language'], + pathParams: ['editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.listings.deleteall + * @desc Deletes all localized listings from an edit. + * @alias androidpublisher.edits.listings.deleteall + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteall(params?: any, options?: MethodOptions): AxiosPromise; + deleteall( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteall( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.listings.get + * @desc Fetches information about a localized store listing. + * @alias androidpublisher.edits.listings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language'], + pathParams: ['editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.listings.list + * @desc Returns all of the localized store listings attached to this edit. + * @alias androidpublisher.edits.listings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.listings.patch + * @desc Creates or updates a localized store listing. This method supports + * patch semantics. + * @alias androidpublisher.edits.listings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().Listing} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language'], + pathParams: ['editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.listings.update + * @desc Creates or updates a localized store listing. + * @alias androidpublisher.edits.listings.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.language The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass "de-AT". + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {().Listing} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'language'], + pathParams: ['editId', 'language', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Reviews { - root: Androidpublisher; - constructor(root: Androidpublisher) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Edits$Testers { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.testers.get + * @alias androidpublisher.edits.testers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.testers.patch + * @alias androidpublisher.edits.testers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {().Testers} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.testers.update + * @alias androidpublisher.edits.testers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {().Testers} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Edits$Tracks { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.edits.tracks.get + * @desc Fetches the track configuration for the specified track type. + * Includes the APK version codes that are in this track. + * @alias androidpublisher.edits.tracks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.tracks.list + * @desc Lists all the track configurations for this edit. + * @alias androidpublisher.edits.tracks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'editId'], + pathParams: ['editId', 'packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.tracks.patch + * @desc Updates the track configuration for the specified track type. When + * halted, the rollout track cannot be updated without adding new APKs, and + * adding new APKs will cause it to resume. This method supports patch + * semantics. + * @alias androidpublisher.edits.tracks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {().Track} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.edits.tracks.update + * @desc Updates the track configuration for the specified track type. When + * halted, the rollout track cannot be updated without adding new APKs, and + * adding new APKs will cause it to resume. + * @alias androidpublisher.edits.tracks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.editId Unique identifier for this edit. + * @param {string} params.packageName Unique identifier for the Android app that is being updated; for example, "com.spiffygame". + * @param {string} params.track The track to read or modify. Acceptable values are: "alpha", "beta", "production", "rollout" or "internal". + * @param {().Track} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'editId', 'track'], + pathParams: ['editId', 'packageName', 'track'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * androidpublisher.reviews.get - * @desc Returns a single review. - * @alias androidpublisher.reviews.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". - * @param {string} params.reviewId - * @param {string=} params.translationLanguage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName', 'reviewId'], - pathParams: ['packageName', 'reviewId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Inappproducts { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.inappproducts.delete + * @desc Delete an in-app product for an app. + * @alias androidpublisher.inappproducts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * @param {string} params.sku Unique identifier for the in-app product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['packageName', 'sku'], + pathParams: ['packageName', 'sku'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.inappproducts.get + * @desc Returns information about the in-app product specified. + * @alias androidpublisher.inappproducts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName + * @param {string} params.sku Unique identifier for the in-app product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'sku'], + pathParams: ['packageName', 'sku'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.inappproducts.insert + * @desc Creates a new in-app product for an app. + * @alias androidpublisher.inappproducts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * @param {string} params.packageName Unique identifier for the Android app; for example, "com.spiffygame". + * @param {().InAppProduct} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.inappproducts.list + * @desc List all the in-app products for an Android app, both subscriptions + * and managed in-app products.. + * @alias androidpublisher.inappproducts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults + * @param {string} params.packageName Unique identifier for the Android app with in-app products; for example, "com.spiffygame". + * @param {integer=} params.startIndex + * @param {string=} params.token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.inappproducts.patch + * @desc Updates the details of an in-app product. This method supports + * patch semantics. + * @alias androidpublisher.inappproducts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * @param {string} params.sku Unique identifier for the in-app product. + * @param {().InAppProduct} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['packageName', 'sku'], + pathParams: ['packageName', 'sku'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.inappproducts.update + * @desc Updates the details of an in-app product. + * @alias androidpublisher.inappproducts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.autoConvertMissingPrices If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. + * @param {string} params.packageName Unique identifier for the Android app with the in-app product; for example, "com.spiffygame". + * @param {string} params.sku Unique identifier for the in-app product. + * @param {().InAppProduct} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['packageName', 'sku'], + pathParams: ['packageName', 'sku'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidpublisher.reviews.list - * @desc Returns a list of reviews. Only reviews from last week will be - * returned. - * @alias androidpublisher.reviews.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults - * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". - * @param {integer=} params.startIndex - * @param {string=} params.token - * @param {string=} params.translationLanguage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Purchases { + root: Androidpublisher; + products: Resource$Purchases$Products; + subscriptions: Resource$Purchases$Subscriptions; + voidedpurchases: Resource$Purchases$Voidedpurchases; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + this.products = new Resource$Purchases$Products(root); + this.subscriptions = new Resource$Purchases$Subscriptions(root); + this.voidedpurchases = new Resource$Purchases$Voidedpurchases(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/androidpublisher/v2/applications/{packageName}/reviews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['packageName'], - pathParams: ['packageName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Purchases$Products { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.purchases.products.get + * @desc Checks the purchase and consumption status of an inapp item. + * @alias androidpublisher.purchases.products.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application the inapp product was sold in (for example, 'com.some.thing'). + * @param {string} params.productId The inapp product SKU (for example, 'com.some.thing.inapp1'). + * @param {string} params.token The token provided to the user's device when the inapp product was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/products/{productId}/tokens/{token}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'productId', 'token'], + pathParams: ['packageName', 'productId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * androidpublisher.reviews.reply - * @desc Reply to a single review, or update an existing reply. - * @alias androidpublisher.reviews.reply - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". - * @param {string} params.reviewId - * @param {().ReviewsReplyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reply(params?: any, options?: MethodOptions): - AxiosPromise; - reply( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reply( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Purchases$Subscriptions { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.purchases.subscriptions.cancel + * @desc Cancels a user's subscription purchase. The subscription remains + * valid until its expiration time. + * @alias androidpublisher.purchases.subscriptions.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.purchases.subscriptions.defer + * @desc Defers a user's subscription purchase until a specified future + * expiration time. + * @alias androidpublisher.purchases.subscriptions.defer + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {().SubscriptionPurchasesDeferRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + defer(params?: any, options?: MethodOptions): + AxiosPromise; + defer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + defer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * androidpublisher.purchases.subscriptions.get + * @desc Checks whether a user's subscription purchase is valid and returns + * its expiry time. + * @alias androidpublisher.purchases.subscriptions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.purchases.subscriptions.refund + * @desc Refunds a user's subscription purchase, but the subscription + * remains valid until its expiration time and it will continue to recur. + * @alias androidpublisher.purchases.subscriptions.refund + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + refund(params?: any, options?: MethodOptions): AxiosPromise; + refund( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + refund( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.purchases.subscriptions.revoke + * @desc Refunds and immediately revokes a user's subscription purchase. + * Access to the subscription will be terminated immediately and it will + * stop recurring. + * @alias androidpublisher.purchases.subscriptions.revoke + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName The package name of the application for which this subscription was purchased (for example, 'com.some.thing'). + * @param {string} params.subscriptionId The purchased subscription ID (for example, 'monthly001'). + * @param {string} params.token The token provided to the user's device when the subscription was purchased. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revoke(params?: any, options?: MethodOptions): AxiosPromise; + revoke( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revoke( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'subscriptionId', 'token'], + pathParams: ['packageName', 'subscriptionId', 'token'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Purchases$Voidedpurchases { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.purchases.voidedpurchases.list + * @desc Lists the purchases that were canceled, refunded or charged-back. + * @alias androidpublisher.purchases.voidedpurchases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.endTime The time, in milliseconds since the Epoch, of the newest voided in-app product 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. + * @param {integer=} params.maxResults + * @param {string} params.packageName The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing'). + * @param {integer=} params.startIndex + * @param {string=} params.startTime The time, in milliseconds since the Epoch, of the oldest voided in-app product 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. + * @param {string=} params.token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/purchases/voidedpurchases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}:reply') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['packageName', 'reviewId'], - pathParams: ['packageName', 'reviewId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + + export class Resource$Reviews { + root: Androidpublisher; + constructor(root: Androidpublisher) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * androidpublisher.reviews.get + * @desc Returns a single review. + * @alias androidpublisher.reviews.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * @param {string} params.reviewId + * @param {string=} params.translationLanguage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName', 'reviewId'], + pathParams: ['packageName', 'reviewId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.reviews.list + * @desc Returns a list of reviews. Only reviews from last week will be + * returned. + * @alias androidpublisher.reviews.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults + * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * @param {integer=} params.startIndex + * @param {string=} params.token + * @param {string=} params.translationLanguage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/androidpublisher/v2/applications/{packageName}/reviews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['packageName'], + pathParams: ['packageName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * androidpublisher.reviews.reply + * @desc Reply to a single review, or update an existing reply. + * @alias androidpublisher.reviews.reply + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.packageName Unique identifier for the Android app for which we want reviews; for example, "com.spiffygame". + * @param {string} params.reviewId + * @param {().ReviewsReplyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reply(params?: any, options?: MethodOptions): + AxiosPromise; + reply( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + reply( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}:reply') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['packageName', 'reviewId'], + pathParams: ['packageName', 'reviewId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appengine/v1.ts b/src/apis/appengine/v1.ts index 1642a362be0..cc56f5e53c3 100644 --- a/src/apis/appengine/v1.ts +++ b/src/apis/appengine/v1.ts @@ -27,4197 +27,4243 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * App Engine Admin API - * - * The App Engine Admin API enables developers to provision and manage their App - * Engine applications. - * - * @example - * const google = require('googleapis'); - * const appengine = google.appengine('v1'); - * - * @namespace appengine - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Appengine - */ -export class Appengine { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - apps: Resource$Apps; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.apps = new Resource$Apps(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for - * API handlers. - */ -export interface Schema$ApiConfigHandler { - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. Defaults to optional. - */ - login: string; - /** - * Path to the script from the application root directory. - */ - script: string; - /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; - /** - * URL to serve the endpoint at. - */ - url: string; -} -/** - * Uses Google Cloud Endpoints to handle requests. - */ -export interface Schema$ApiEndpointHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * An Application resource contains the top-level configuration of an App Engine - * application. - */ -export interface Schema$Application { - /** - * Google Apps authentication domain that controls which users can access this - * application.Defaults to open access for any Google Account. - */ - authDomain: string; - /** - * Google Cloud Storage bucket that can be used for storing files associated - * with this application. This bucket is associated with the application and - * can be used by the gcloud deployment commands.@OutputOnly - */ - codeBucket: string; - /** - * Google Cloud Storage bucket that can be used by this application to store - * content.@OutputOnly - */ - defaultBucket: string; - /** - * Cookie expiration policy for this application. - */ - defaultCookieExpiration: string; - /** - * Hostname used to reach this application, as resolved by App - * Engine.@OutputOnly - */ - defaultHostname: string; - /** - * HTTP path dispatch rules for requests to the application that do not - * explicitly target a service or version. Rules are order-dependent. Up to 20 - * dispatch rules can be supported.@OutputOnly - */ - dispatchRules: Schema$UrlDispatchRule[]; - /** - * The feature specific settings to be used in the application. - */ - featureSettings: Schema$FeatureSettings; - /** - * The Google Container Registry domain used for storing managed build docker - * images for this application. - */ - gcrDomain: string; - iap: Schema$IdentityAwareProxy; - /** - * Identifier of the Application resource. This identifier is equivalent to - * the project ID of the Google Cloud Platform project where you want to - * deploy your application. Example: myapp. - */ - id: string; - /** - * Location from which this application runs. Application instances run out of - * the data centers in the specified location, which is also where all of the - * application's end user content is stored.Defaults to us-central.View - * the list of supported locations - * (https://cloud.google.com/appengine/docs/locations). - */ - locationId: string; - /** - * Full path to the Application resource in the API. Example: - * apps/myapp.@OutputOnly - */ - name: string; - /** - * Serving status of this application. - */ - servingStatus: string; -} -/** - * An SSL certificate that a user has been authorized to administer. A user is - * authorized to administer any certificate that applies to one of their - * authorized domains. - */ -export interface Schema$AuthorizedCertificate { - /** - * The SSL certificate serving the AuthorizedCertificate resource. This must - * be obtained independently from a certificate authority. - */ - certificateRawData: Schema$CertificateRawData; - /** - * The user-specified display name of the certificate. This is not guaranteed - * to be unique. Example: My Certificate. - */ - displayName: string; - /** - * Aggregate count of the domain mappings with this certificate mapped. This - * count includes domain mappings on applications for which the user does not - * have VIEWER permissions.Only returned by GET or LIST requests when - * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly - */ - domainMappingsCount: number; - /** - * Topmost applicable domains of this certificate. This certificate applies to - * these domains and their subdomains. Example: example.com.@OutputOnly - */ - domainNames: string[]; - /** - * The time when this certificate expires. To update the renewal time on this - * certificate, upload an SSL certificate with a different expiration time - * using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly - */ - expireTime: string; - /** - * Relative name of the certificate. This is a unique value autogenerated on - * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly - */ - id: string; - /** - * Full path to the AuthorizedCertificate resource in the API. Example: - * apps/myapp/authorizedCertificates/12345.@OutputOnly - */ - name: string; - /** - * The full paths to user visible Domain Mapping resources that have this - * certificate mapped. Example: apps/myapp/domainMappings/example.com.This may - * not represent the full list of mapped domain mappings if the user does not - * have VIEWER permissions on all of the applications that have this - * certificate mapped. See domain_mappings_count for a complete count.Only - * returned by GET or LIST requests when specifically requested by the - * view=FULL_CERTIFICATE option.@OutputOnly - */ - visibleDomainMappings: string[]; -} -/** - * A domain that a user has been authorized to administer. To authorize use of a - * domain, verify ownership via Webmaster Central - * (https://www.google.com/webmasters/verification/home). - */ -export interface Schema$AuthorizedDomain { - /** - * Fully qualified domain name of the domain authorized for use. Example: - * example.com. - */ - id: string; - /** - * Full path to the AuthorizedDomain resource in the API. Example: - * apps/myapp/authorizedDomains/example.com.@OutputOnly - */ - name: string; -} -/** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ -export interface Schema$AutomaticScaling { - /** - * Amount of time that the Autoscaler - * (https://cloud.google.com/compute/docs/autoscaler/) should wait between - * changes to the number of virtual machines. Only applicable in the App - * Engine flexible environment. - */ - coolDownPeriod: string; - /** - * Target scaling by CPU usage. - */ - cpuUtilization: Schema$CpuUtilization; - /** - * Target scaling by disk usage. - */ - diskUtilization: Schema$DiskUtilization; - /** - * Number of concurrent requests an automatic scaling instance can accept - * before the scheduler spawns a new instance.Defaults to a runtime-specific - * value. - */ - maxConcurrentRequests: number; - /** - * Maximum number of idle instances that should be maintained for this - * version. - */ - maxIdleInstances: number; - /** - * Maximum amount of time that a request should wait in the pending queue - * before starting a new instance to handle it. - */ - maxPendingLatency: string; - /** - * Maximum number of instances that should be started to handle requests for - * this version. - */ - maxTotalInstances: number; - /** - * Minimum number of idle instances that should be maintained for this - * version. Only applicable for the default version of a service. - */ - minIdleInstances: number; - /** - * Minimum amount of time a request should wait in the pending queue before - * starting a new instance to handle it. - */ - minPendingLatency: string; - /** - * Minimum number of running instances that should be maintained for this - * version. - */ - minTotalInstances: number; - /** - * Target scaling by network usage. - */ - networkUtilization: Schema$NetworkUtilization; - /** - * Target scaling by request utilization. - */ - requestUtilization: Schema$RequestUtilization; - /** - * Scheduler settings for standard environment. - */ - standardSchedulerSettings: Schema$StandardSchedulerSettings; -} -/** - * A service with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by user - * activity. - */ -export interface Schema$BasicScaling { - /** - * Duration of time after the last request that an instance must wait before - * the instance is shut down. - */ - idleTimeout: string; - /** - * Maximum number of instances to create for this version. - */ - maxInstances: number; -} -/** - * Request message for Firewall.BatchUpdateIngressRules. - */ -export interface Schema$BatchUpdateIngressRulesRequest { - /** - * A list of FirewallRules to replace the existing set. - */ - ingressRules: Schema$FirewallRule[]; -} -/** - * Response message for Firewall.UpdateAllIngressRules. - */ -export interface Schema$BatchUpdateIngressRulesResponse { - /** - * The full list of ingress FirewallRules for this application. - */ - ingressRules: Schema$FirewallRule[]; -} -/** - * An SSL certificate obtained from a certificate authority. - */ -export interface Schema$CertificateRawData { - /** - * Unencrypted PEM encoded RSA private key. This field is set once on - * certificate creation and then encrypted. The key size must be 2048 bits or - * fewer. Must include the header and footer. Example: <pre> -----BEGIN - * RSA PRIVATE KEY----- <unencrypted_key_value> -----END RSA PRIVATE - * KEY----- </pre> @InputOnly - */ - privateKey: string; - /** - * PEM encoded x.509 public key certificate. This field is set once on - * certificate creation. Must include the header and footer. Example: - * <pre> -----BEGIN CERTIFICATE----- <certificate_value> -----END - * CERTIFICATE----- </pre> - */ - publicCertificate: string; -} -/** - * Options for the build operations performed as a part of the version - * deployment. Only applicable for App Engine flexible environment when creating - * a version using source code directly. - */ -export interface Schema$CloudBuildOptions { - /** - * Path to the yaml file used in deployment, used to determine runtime - * configuration details.Required for flexible environment builds.See - * https://cloud.google.com/appengine/docs/standard/python/config/appref for - * more details. - */ - appYamlPath: string; - /** - * The Cloud Build timeout used as part of any dependent builds performed by - * version creation. Defaults to 10 minutes. - */ - cloudBuildTimeout: string; -} -/** - * Docker image that is used to create a container and start a VM instance for - * the version that you deploy. Only applicable for instances running in the App - * Engine flexible environment. - */ -export interface Schema$ContainerInfo { - /** - * URI to the hosted container image in Google Container Registry. The URI - * must be fully qualified and include a tag or digest. Examples: - * "gcr.io/my-project/image:tag" or - * "gcr.io/my-project/image@digest" - */ - image: string; -} -/** - * Target scaling by CPU usage. - */ -export interface Schema$CpuUtilization { - /** - * Period of time over which CPU utilization is calculated. - */ - aggregationWindowLength: string; - /** - * Target CPU utilization ratio to maintain when scaling. Must be between 0 - * and 1. - */ - targetUtilization: number; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1 { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1alpha.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Alpha { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1beta.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Beta { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Request message for Instances.DebugInstance. - */ -export interface Schema$DebugInstanceRequest { - /** - * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa - * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh - * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For - * more information, see Adding and Removing SSH Keys - * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). - */ - sshKey: string; -} -/** - * Code and application artifacts used to deploy a version to App Engine. - */ -export interface Schema$Deployment { - /** - * Options for any Google Cloud Container Builder builds created as a part of - * this deployment.Note that this is orthogonal to the build parameter, where - * the deployment depends on an already existing cloud build. These options - * will only be used if a new build is created, such as when deploying to the - * App Engine flexible environment using files or zip. - */ - cloudBuildOptions: Schema$CloudBuildOptions; - /** - * The Docker image for the container that runs the version. Only applicable - * for instances running in the App Engine flexible environment. - */ - container: Schema$ContainerInfo; - /** - * Manifest of the files stored in Google Cloud Storage that are included as - * part of this version. All files must be readable using the credentials - * supplied with this call. - */ - files: any; - /** - * The zip file for this deployment, if this is a zip deployment. - */ - zip: Schema$ZipInfo; -} -/** - * Target scaling by disk usage. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$DiskUtilization { - /** - * Target bytes read per second. - */ - targetReadBytesPerSecond: number; - /** - * Target ops read per seconds. - */ - targetReadOpsPerSecond: number; - /** - * Target bytes written per second. - */ - targetWriteBytesPerSecond: number; - /** - * Target ops written per second. - */ - targetWriteOpsPerSecond: number; -} -/** - * A domain serving an App Engine application. - */ -export interface Schema$DomainMapping { - /** - * Relative name of the domain serving the application. Example: example.com. - */ - id: string; - /** - * Full path to the DomainMapping resource in the API. Example: - * apps/myapp/domainMapping/example.com.@OutputOnly - */ - name: string; - /** - * The resource records required to configure this domain mapping. These - * records must be added to the domain's DNS configuration in order to - * serve the application via this domain mapping.@OutputOnly - */ - resourceRecords: Schema$ResourceRecord[]; - /** - * SSL configuration for this domain. If unconfigured, this domain will not - * serve with SSL. - */ - sslSettings: Schema$SslSettings; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The - * Endpoints API Service provides tooling for serving Open API and gRPC - * endpoints via an NGINX proxy. Only valid for App Engine Flexible environment - * deployments.The fields here refer to the name and configuration id of a - * "service" resource in the Service Management API - * (https://cloud.google.com/service-management/overview). - */ -export interface Schema$EndpointsApiService { - /** - * Endpoints service configuration id as specified by the Service Management - * API. For example "2016-09-19r1" - */ - configId: string; - /** - * Endpoints service name which is the name of the "service" - * resource in the Service Management API. For example - * "myapi.endpoints.myproject.cloud.goog" - */ - name: string; -} -/** - * Custom static error page to be served when an error occurs. - */ -export interface Schema$ErrorHandler { - /** - * Error condition this handler applies to. - */ - errorCode: string; - /** - * MIME type of file. Defaults to text/html. - */ - mimeType: string; - /** - * Static file content to be served for this error. - */ - staticFile: string; -} -/** - * The feature specific settings to be used in the application. These define - * behaviors that are user configurable. - */ -export interface Schema$FeatureSettings { - /** - * Boolean value indicating if split health checks should be used instead of - * the legacy health checks. At an app.yaml level, this means defaulting to - * 'readiness_check' and 'liveness_check' values instead of - * 'health_check' ones. Once the legacy 'health_check' - * behavior is deprecated, and this value is always true, this setting can be - * removed. - */ - splitHealthChecks: boolean; -} -/** - * Single source file that is part of the version to be deployed. Each source - * file that is deployed must be specified separately. - */ -export interface Schema$FileInfo { - /** - * The MIME type of the file.Defaults to the value from Google Cloud Storage. - */ - mimeType: string; - /** - * The SHA1 hash of the file, in hex. - */ - sha1Sum: string; - /** - * URL source to use to fetch this file. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. - */ - sourceUrl: string; -} -/** - * A single firewall rule that is evaluated against incoming traffic and - * provides an action to take on matched requests. - */ -export interface Schema$FirewallRule { - /** - * The action to take on matched requests. - */ - action: string; - /** - * An optional string description of this rule. This field has a maximum - * length of 100 characters. - */ - description: string; - /** - * A positive integer between 1, Int32.MaxValue-1 that defines the order of - * rule evaluation. Rules with the lowest priority are evaluated first.A - * default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic - * when no previous rule matches. Only the action of this rule can be modified - * by the user. - */ - priority: number; - /** - * IP address or range, defined using CIDR notation, of requests that this - * rule applies to. You can use the wildcard character "*" to match - * all IPs equivalent to "0/0" and "::/0" together. - * Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or - * 2001:0db8:0000:0042:0000:8a2e:0370:7334.<p>Truncation will be - * silently performed on addresses which are not properly truncated. For - * example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. - * Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as - * 2001:db8::/32. - */ - sourceRange: string; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. Only applicable for instances in App - * Engine flexible environment. - */ -export interface Schema$HealthCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Whether to explicitly disable health checks for this instance. - */ - disableHealthCheck: boolean; - /** - * Number of consecutive successful health checks required before receiving - * traffic. - */ - healthyThreshold: number; - /** - * Host header to send when performing an HTTP health check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * Number of consecutive failed health checks required before an instance is - * restarted. - */ - restartThreshold: number; - /** - * Time before the health check is considered failed. - */ - timeout: string; - /** - * Number of consecutive failed health checks required before removing - * traffic. - */ - unhealthyThreshold: number; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$IdentityAwareProxy { - /** - * Whether the serving infrastructure will authenticate and authorize all - * incoming requests.If true, the oauth2_client_id and oauth2_client_secret - * fields must be non-empty. - */ - enabled: boolean; - /** - * OAuth2 client ID to use for the authentication flow. - */ - oauth2ClientId: string; - /** - * OAuth2 client secret to use for the authentication flow.For security - * reasons, this value cannot be retrieved via the API. Instead, the SHA-256 - * hash of the value is returned in the oauth2_client_secret_sha256 - * field.@InputOnly - */ - oauth2ClientSecret: string; - /** - * Hex-encoded SHA-256 hash of the client secret.@OutputOnly - */ - oauth2ClientSecretSha256: string; -} -/** - * An Instance resource is the computing unit that App Engine uses to - * automatically scale an application. - */ -export interface Schema$Instance { - /** - * App Engine release this instance is running on.@OutputOnly - */ - appEngineRelease: string; - /** - * Availability of the instance.@OutputOnly - */ - availability: string; - /** - * Average latency (ms) over the last minute.@OutputOnly - */ - averageLatency: number; - /** - * Number of errors since this instance was started.@OutputOnly - */ - errors: number; - /** - * Relative name of the instance within the version. Example: - * instance-1.@OutputOnly - */ - id: string; - /** - * Total memory in use (bytes).@OutputOnly - */ - memoryUsage: string; - /** - * Full path to the Instance resource in the API. Example: - * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly - */ - name: string; - /** - * Average queries per second (QPS) over the last minute.@OutputOnly - */ - qps: number; - /** - * Number of requests since this instance was started.@OutputOnly - */ - requests: number; - /** - * Time that this instance was started.@OutputOnly - */ - startTime: string; - /** - * Whether this instance is in debug mode. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmDebugEnabled: boolean; - /** - * Virtual machine ID of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmId: string; - /** - * The IP address of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmIp: string; - /** - * Name of the virtual machine where this instance lives. Only applicable for - * instances in App Engine flexible environment.@OutputOnly - */ - vmName: string; - /** - * Status of the virtual machine where this instance lives. Only applicable - * for instances in App Engine flexible environment.@OutputOnly - */ - vmStatus: string; - /** - * Zone where the virtual machine is located. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmZoneName: string; -} -/** - * Third-party Python runtime library that is required by the application. - */ -export interface Schema$Library { - /** - * Name of the library. Example: "django". - */ - name: string; - /** - * Version of the library to select, or "latest". - */ - version: string; -} -/** - * Response message for AuthorizedCertificates.ListAuthorizedCertificates. - */ -export interface Schema$ListAuthorizedCertificatesResponse { - /** - * The SSL certificates the user is authorized to administer. - */ - certificates: Schema$AuthorizedCertificate[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for AuthorizedDomains.ListAuthorizedDomains. - */ -export interface Schema$ListAuthorizedDomainsResponse { - /** - * The authorized domains belonging to the user. - */ - domains: Schema$AuthorizedDomain[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for DomainMappings.ListDomainMappings. - */ -export interface Schema$ListDomainMappingsResponse { - /** - * The domain mappings for the application. - */ - domainMappings: Schema$DomainMapping[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for Firewall.ListIngressRules. - */ -export interface Schema$ListIngressRulesResponse { - /** - * The ingress FirewallRules for this application. - */ - ingressRules: Schema$FirewallRule[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for Instances.ListInstances. - */ -export interface Schema$ListInstancesResponse { - /** - * The instances belonging to the requested version. - */ - instances: Schema$Instance[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for Services.ListServices. - */ -export interface Schema$ListServicesResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The services belonging to the requested application. - */ - services: Schema$Service[]; -} -/** - * Response message for Versions.ListVersions. - */ -export interface Schema$ListVersionsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The versions belonging to the requested service. - */ - versions: Schema$Version[]; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. - */ -export interface Schema$LivenessCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Number of consecutive failed checks required before considering the VM - * unhealthy. - */ - failureThreshold: number; - /** - * Host header to send when performing a HTTP Liveness check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * The initial delay before starting to execute the checks. - */ - initialDelay: string; - /** - * The request path. - */ - path: string; - /** - * Number of consecutive successful checks required before considering the VM - * healthy. - */ - successThreshold: number; - /** - * Time before the check is considered failed. - */ - timeout: string; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: "us-east1". - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: "projects/example-project/locations/us-east1" - */ - name: string; -} -/** - * Metadata for the given google.cloud.location.Location. - */ -export interface Schema$LocationMetadata { - /** - * App Engine flexible environment is available in the given - * location.@OutputOnly - */ - flexibleEnvironmentAvailable: boolean; - /** - * App Engine standard environment is available in the given - * location.@OutputOnly - */ - standardEnvironmentAvailable: boolean; -} -/** - * A service with manual scaling runs continuously, allowing you to perform - * complex initialization and rely on the state of its memory over time. - */ -export interface Schema$ManualScaling { - /** - * Number of instances to assign to the service at the start. This number can - * later be altered by using the Modules API - * (https://cloud.google.com/appengine/docs/python/modules/functions) - * set_num_instances() function. - */ - instances: number; -} -/** - * Extra network settings. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$Network { - /** - * List of ports, or port pairs, to forward from the virtual machine to the - * application container. Only applicable in the App Engine flexible - * environment. - */ - forwardedPorts: string[]; - /** - * Tag to apply to the instance during creation. Only applicable in the App - * Engine flexible environment. - */ - instanceTag: string; - /** - * Google Compute Engine network where the virtual machines are created. - * Specify the short name, not the resource path.Defaults to default. - */ - name: string; - /** - * Google Cloud Platform sub-network where the virtual machines are created. - * Specify the short name, not the resource path.If a subnetwork name is - * specified, a network name will also be required unless it is for the - * default network. If the network that the instance is being created in is a - * Legacy network, then the IP address is allocated from the IPv4Range. If the - * network that the instance is being created in is an auto Subnet Mode - * Network, then only network name should be specified (not the - * subnetwork_name) and the IP address is created from the IPCidrRange of the - * subnetwork that exists in that zone for that network. If the network that - * the instance is being created in is a custom Subnet Mode Network, then the - * subnetwork_name must be specified and the IP address is created from the - * IPCidrRange of the subnetwork.If specified, the subnetwork must exist in - * the same region as the App Engine flexible environment application. - */ - subnetworkName: string; -} -/** - * Target scaling by network usage. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$NetworkUtilization { - /** - * Target bytes received per second. - */ - targetReceivedBytesPerSecond: number; - /** - * Target packets received per second. - */ - targetReceivedPacketsPerSecond: number; - /** - * Target bytes sent per second. - */ - targetSentBytesPerSecond: number; - /** - * Target packets sent per second. - */ - targetSentPacketsPerSecond: number; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadata { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Type of this operation. Deprecated, use method field instead. Example: - * "create_version".@OutputOnly - */ - operationType: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/modules/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1 { - createVersionMetadata: Schema$CreateVersionMetadataV1; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Alpha { - createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta { - createVersionMetadata: Schema$CreateVersionMetadataV1Beta; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta5 { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method name that initiated this operation. Example: - * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Readiness checking configuration for VM instances. Unhealthy instances are - * removed from traffic rotation. - */ -export interface Schema$ReadinessCheck { - /** - * A maximum time limit on application initialization, measured from moment - * the application successfully replies to a healthcheck until it is ready to - * serve traffic. - */ - appStartTimeout: string; - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Number of consecutive failed checks required before removing traffic. - */ - failureThreshold: number; +export namespace appengine_v1 { /** - * Host header to send when performing a HTTP Readiness check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * The request path. - */ - path: string; - /** - * Number of consecutive successful checks required before receiving traffic. - */ - successThreshold: number; - /** - * Time before the check is considered failed. - */ - timeout: string; -} -/** - * Request message for 'Applications.RepairApplication'. - */ -export interface Schema$RepairApplicationRequest {} -/** - * Target scaling by request utilization. Only applicable in the App Engine - * flexible environment. - */ -export interface Schema$RequestUtilization { - /** - * Target number of concurrent requests. - */ - targetConcurrentRequests: number; - /** - * Target requests per second. - */ - targetRequestCountPerSecond: number; -} -/** - * A DNS resource record. - */ -export interface Schema$ResourceRecord { - /** - * Relative name of the object affected by this record. Only applicable for - * CNAME records. Example: 'www'. - */ - name: string; - /** - * Data for this record. Values vary by record type, as defined in RFC 1035 - * (section 5) and RFC 1034 (section 3.6.1). - */ - rrdata: string; - /** - * Resource record type. Example: AAAA. - */ - type: string; -} -/** - * Machine resources for a version. - */ -export interface Schema$Resources { - /** - * Number of CPU cores needed. - */ - cpu: number; - /** - * Disk size (GB) needed. - */ - diskGb: number; - /** - * Memory (GB) needed. - */ - memoryGb: number; - /** - * User specified volumes. - */ - volumes: Schema$Volume[]; -} -/** - * Executes a script to handle the request that matches the URL pattern. - */ -export interface Schema$ScriptHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * A Service resource is a logical component of an application that can share - * state and communicate in a secure fashion with other services. For example, - * an application that handles customer requests might include separate services - * to handle tasks such as backend data analysis or API requests from mobile - * devices. Each service has a collection of versions that define a specific set - * of code used to implement the functionality of that service. - */ -export interface Schema$Service { - /** - * Relative name of the service within the application. Example: - * default.@OutputOnly - */ - id: string; - /** - * Full path to the Service resource in the API. Example: - * apps/myapp/services/default.@OutputOnly - */ - name: string; - /** - * Mapping that defines fractional HTTP traffic diversion to different - * versions within the service. - */ - split: Schema$TrafficSplit; -} -/** - * SSL configuration for a DomainMapping resource. - */ -export interface Schema$SslSettings { - /** - * ID of the AuthorizedCertificate resource configuring SSL for the - * application. Clearing this field will remove SSL support. Example: 12345. - */ - certificateId: string; -} -/** - * Scheduler settings for standard environment. - */ -export interface Schema$StandardSchedulerSettings { - /** - * Maximum number of instances to run for this version. Set to zero to disable - * max_instances configuration. - */ - maxInstances: number; - /** - * Minimum number of instances to run for this version. Set to zero to disable - * min_instances configuration. - */ - minInstances: number; - /** - * Target CPU utilization ratio to maintain when scaling. - */ - targetCpuUtilization: number; - /** - * Target throughput utilization ratio to maintain when scaling - */ - targetThroughputUtilization: number; -} -/** - * Files served directly to the user for a given URL, such as images, CSS - * stylesheets, or JavaScript source files. Static file handlers describe which - * files in the application directory are static files, and which URLs serve - * them. - */ -export interface Schema$StaticFilesHandler { - /** - * Whether files should also be uploaded as code data. By default, files - * declared in static file handlers are uploaded as static data and are only - * served to end users; they cannot be read by the application. If enabled, - * uploads are charged against both your code and static data storage resource - * quotas. - */ - applicationReadable: boolean; - /** - * Time a static file served by this handler should be cached by web proxies - * and browsers. - */ - expiration: string; + * App Engine Admin API + * + * The App Engine Admin API enables developers to provision and manage their + * App Engine applications. + * + * @example + * const google = require('googleapis'); + * const appengine = google.appengine('v1'); + * + * @namespace appengine + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Appengine + */ + export class Appengine { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + apps: Resource$Apps; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.apps = new Resource$Apps(this); + } + + getRoot() { + return this.root; + } + } + /** - * HTTP headers to use for all responses from these URLs. - */ - httpHeaders: any; + * Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration + * for API handlers. + */ + export interface Schema$ApiConfigHandler { + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. Defaults to optional. + */ + login: string; + /** + * Path to the script from the application root directory. + */ + script: string; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * URL to serve the endpoint at. + */ + url: string; + } /** - * MIME type used to serve all files served by this handler.Defaults to - * file-specific MIME types, which are derived from each file's filename - * extension. + * Uses Google Cloud Endpoints to handle requests. */ - mimeType: string; + export interface Schema$ApiEndpointHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * Path to the static files matched by the URL pattern, from the application - * root directory. The path can refer to text matched in groupings in the URL - * pattern. - */ - path: string; + * An Application resource contains the top-level configuration of an App + * Engine application. + */ + export interface Schema$Application { + /** + * Google Apps authentication domain that controls which users can access + * this application.Defaults to open access for any Google Account. + */ + authDomain: string; + /** + * Google Cloud Storage bucket that can be used for storing files associated + * with this application. This bucket is associated with the application and + * can be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket: string; + /** + * Google Cloud Storage bucket that can be used by this application to store + * content.@OutputOnly + */ + defaultBucket: string; + /** + * Cookie expiration policy for this application. + */ + defaultCookieExpiration: string; + /** + * Hostname used to reach this application, as resolved by App + * Engine.@OutputOnly + */ + defaultHostname: string; + /** + * HTTP path dispatch rules for requests to the application that do not + * explicitly target a service or version. Rules are order-dependent. Up to + * 20 dispatch rules can be supported.@OutputOnly + */ + dispatchRules: Schema$UrlDispatchRule[]; + /** + * The feature specific settings to be used in the application. + */ + featureSettings: Schema$FeatureSettings; + /** + * The Google Container Registry domain used for storing managed build + * docker images for this application. + */ + gcrDomain: string; + iap: Schema$IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to + * the project ID of the Google Cloud Platform project where you want to + * deploy your application. Example: myapp. + */ + id: string; + /** + * Location from which this application runs. Application instances run out + * of the data centers in the specified location, which is also where all of + * the application's end user content is stored.Defaults to + * us-central.View the list of supported locations + * (https://cloud.google.com/appengine/docs/locations). + */ + locationId: string; + /** + * Full path to the Application resource in the API. Example: + * apps/myapp.@OutputOnly + */ + name: string; + /** + * Serving status of this application. + */ + servingStatus: string; + } /** - * Whether this handler should match the request if the file referenced by the - * handler does not exist. - */ - requireMatchingFile: boolean; + * An SSL certificate that a user has been authorized to administer. A user is + * authorized to administer any certificate that applies to one of their + * authorized domains. + */ + export interface Schema$AuthorizedCertificate { + /** + * The SSL certificate serving the AuthorizedCertificate resource. This must + * be obtained independently from a certificate authority. + */ + certificateRawData: Schema$CertificateRawData; + /** + * The user-specified display name of the certificate. This is not + * guaranteed to be unique. Example: My Certificate. + */ + displayName: string; + /** + * Aggregate count of the domain mappings with this certificate mapped. This + * count includes domain mappings on applications for which the user does + * not have VIEWER permissions.Only returned by GET or LIST requests when + * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + */ + domainMappingsCount: number; + /** + * Topmost applicable domains of this certificate. This certificate applies + * to these domains and their subdomains. Example: example.com.@OutputOnly + */ + domainNames: string[]; + /** + * The time when this certificate expires. To update the renewal time on + * this certificate, upload an SSL certificate with a different expiration + * time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + */ + expireTime: string; + /** + * Relative name of the certificate. This is a unique value autogenerated on + * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly + */ + id: string; + /** + * Full path to the AuthorizedCertificate resource in the API. Example: + * apps/myapp/authorizedCertificates/12345.@OutputOnly + */ + name: string; + /** + * The full paths to user visible Domain Mapping resources that have this + * certificate mapped. Example: apps/myapp/domainMappings/example.com.This + * may not represent the full list of mapped domain mappings if the user + * does not have VIEWER permissions on all of the applications that have + * this certificate mapped. See domain_mappings_count for a complete + * count.Only returned by GET or LIST requests when specifically requested + * by the view=FULL_CERTIFICATE option.@OutputOnly + */ + visibleDomainMappings: string[]; + } /** - * Regular expression that matches the file paths for all files that should be - * referenced by this handler. - */ - uploadPathRegex: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { + * A domain that a user has been authorized to administer. To authorize use of + * a domain, verify ownership via Webmaster Central + * (https://www.google.com/webmasters/verification/home). + */ + export interface Schema$AuthorizedDomain { + /** + * Fully qualified domain name of the domain authorized for use. Example: + * example.com. + */ + id: string; + /** + * Full path to the AuthorizedDomain resource in the API. Example: + * apps/myapp/authorizedDomains/example.com.@OutputOnly + */ + name: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. */ - code: number; + export interface Schema$AutomaticScaling { + /** + * Amount of time that the Autoscaler + * (https://cloud.google.com/compute/docs/autoscaler/) should wait between + * changes to the number of virtual machines. Only applicable in the App + * Engine flexible environment. + */ + coolDownPeriod: string; + /** + * Target scaling by CPU usage. + */ + cpuUtilization: Schema$CpuUtilization; + /** + * Target scaling by disk usage. + */ + diskUtilization: Schema$DiskUtilization; + /** + * Number of concurrent requests an automatic scaling instance can accept + * before the scheduler spawns a new instance.Defaults to a runtime-specific + * value. + */ + maxConcurrentRequests: number; + /** + * Maximum number of idle instances that should be maintained for this + * version. + */ + maxIdleInstances: number; + /** + * Maximum amount of time that a request should wait in the pending queue + * before starting a new instance to handle it. + */ + maxPendingLatency: string; + /** + * Maximum number of instances that should be started to handle requests for + * this version. + */ + maxTotalInstances: number; + /** + * Minimum number of idle instances that should be maintained for this + * version. Only applicable for the default version of a service. + */ + minIdleInstances: number; + /** + * Minimum amount of time a request should wait in the pending queue before + * starting a new instance to handle it. + */ + minPendingLatency: string; + /** + * Minimum number of running instances that should be maintained for this + * version. + */ + minTotalInstances: number; + /** + * Target scaling by network usage. + */ + networkUtilization: Schema$NetworkUtilization; + /** + * Target scaling by request utilization. + */ + requestUtilization: Schema$RequestUtilization; + /** + * Scheduler settings for standard environment. + */ + standardSchedulerSettings: Schema$StandardSchedulerSettings; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * A service with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. */ - details: any[]; + export interface Schema$BasicScaling { + /** + * Duration of time after the last request that an instance must wait before + * the instance is shut down. + */ + idleTimeout: string; + /** + * Maximum number of instances to create for this version. + */ + maxInstances: number; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Request message for Firewall.BatchUpdateIngressRules. */ - message: string; -} -/** - * Traffic routing configuration for versions within a single service. Traffic - * splits define how traffic directed to the service is assigned to versions. - */ -export interface Schema$TrafficSplit { + export interface Schema$BatchUpdateIngressRulesRequest { + /** + * A list of FirewallRules to replace the existing set. + */ + ingressRules: Schema$FirewallRule[]; + } /** - * Mapping from version IDs within the service to fractional (0.000, 1] - * allocations of traffic for that version. Each version can be specified only - * once, but some versions in the service may not have any traffic allocation. - * Services that have traffic allocated cannot be deleted until either the - * service is deleted or their traffic allocation is removed. Allocations must - * sum to 1. Up to two decimal place precision is supported for IP-based - * splits and up to three decimal places is supported for cookie-based splits. + * Response message for Firewall.UpdateAllIngressRules. */ - allocations: any; + export interface Schema$BatchUpdateIngressRulesResponse { + /** + * The full list of ingress FirewallRules for this application. + */ + ingressRules: Schema$FirewallRule[]; + } /** - * Mechanism used to determine which version a request is sent to. The traffic - * selection algorithm will be stable for either type until allocations are - * changed. - */ - shardBy: string; -} -/** - * Rules to match an HTTP request and dispatch that request to a service. - */ -export interface Schema$UrlDispatchRule { + * An SSL certificate obtained from a certificate authority. + */ + export interface Schema$CertificateRawData { + /** + * Unencrypted PEM encoded RSA private key. This field is set once on + * certificate creation and then encrypted. The key size must be 2048 bits + * or fewer. Must include the header and footer. Example: <pre> + * -----BEGIN RSA PRIVATE KEY----- <unencrypted_key_value> -----END + * RSA PRIVATE KEY----- </pre> @InputOnly + */ + privateKey: string; + /** + * PEM encoded x.509 public key certificate. This field is set once on + * certificate creation. Must include the header and footer. Example: + * <pre> -----BEGIN CERTIFICATE----- <certificate_value> + * -----END CERTIFICATE----- </pre> + */ + publicCertificate: string; + } /** - * Domain name to match against. The wildcard "*" is supported if - * specified before a period: "*.".Defaults to matching all domains: - * "*". - */ - domain: string; + * Options for the build operations performed as a part of the version + * deployment. Only applicable for App Engine flexible environment when + * creating a version using source code directly. + */ + export interface Schema$CloudBuildOptions { + /** + * Path to the yaml file used in deployment, used to determine runtime + * configuration details.Required for flexible environment builds.See + * https://cloud.google.com/appengine/docs/standard/python/config/appref for + * more details. + */ + appYamlPath: string; + /** + * The Cloud Build timeout used as part of any dependent builds performed by + * version creation. Defaults to 10 minutes. + */ + cloudBuildTimeout: string; + } /** - * Pathname within the host. Must start with a "/". A single - * "*" can be included at the end of the path.The sum of the lengths - * of the domain and path may not exceed 100 characters. + * Docker image that is used to create a container and start a VM instance for + * the version that you deploy. Only applicable for instances running in the + * App Engine flexible environment. */ - path: string; + export interface Schema$ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI + * must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or + * "gcr.io/my-project/image@digest" + */ + image: string; + } /** - * Resource ID of a service in this application that should serve the matched - * request. The service must already exist. Example: default. + * Target scaling by CPU usage. */ - service: string; -} -/** - * URL pattern and description of how the URL should be handled. App Engine can - * handle URLs by executing application code or by serving static files uploaded - * with the version, such as images, CSS, or JavaScript. - */ -export interface Schema$UrlMap { + export interface Schema$CpuUtilization { + /** + * Period of time over which CPU utilization is calculated. + */ + aggregationWindowLength: string; + /** + * Target CPU utilization ratio to maintain when scaling. Must be between 0 + * and 1. + */ + targetUtilization: number; + } /** - * Uses API Endpoints to handle requests. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1.CreateVersionRequest. */ - apiEndpoint: Schema$ApiEndpointHandler; + export interface Schema$CreateVersionMetadataV1 { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1alpha.CreateVersionRequest. */ - authFailAction: string; + export interface Schema$CreateVersionMetadataV1Alpha { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Level of login required to access this resource. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1beta.CreateVersionRequest. */ - login: string; + export interface Schema$CreateVersionMetadataV1Beta { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * 30x code to use when performing redirects for the secure field. Defaults to - * 302. - */ - redirectHttpResponseCode: string; + * Request message for Instances.DebugInstance. + */ + export interface Schema$DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa + * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh + * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For + * more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey: string; + } /** - * Executes a script to handle the request that matches this URL pattern. - */ - script: Schema$ScriptHandler; + * Code and application artifacts used to deploy a version to App Engine. + */ + export interface Schema$Deployment { + /** + * Options for any Google Cloud Container Builder builds created as a part + * of this deployment.Note that this is orthogonal to the build parameter, + * where the deployment depends on an already existing cloud build. These + * options will only be used if a new build is created, such as when + * deploying to the App Engine flexible environment using files or zip. + */ + cloudBuildOptions: Schema$CloudBuildOptions; + /** + * The Docker image for the container that runs the version. Only applicable + * for instances running in the App Engine flexible environment. + */ + container: Schema$ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as + * part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files: any; + /** + * The zip file for this deployment, if this is a zip deployment. + */ + zip: Schema$ZipInfo; + } /** - * Security (HTTPS) enforcement for this URL. + * Target scaling by disk usage. Only applicable in the App Engine flexible + * environment. */ - securityLevel: string; + export interface Schema$DiskUtilization { + /** + * Target bytes read per second. + */ + targetReadBytesPerSecond: number; + /** + * Target ops read per seconds. + */ + targetReadOpsPerSecond: number; + /** + * Target bytes written per second. + */ + targetWriteBytesPerSecond: number; + /** + * Target ops written per second. + */ + targetWriteOpsPerSecond: number; + } /** - * Returns the contents of a file, such as an image, as the response. - */ - staticFiles: Schema$StaticFilesHandler; + * A domain serving an App Engine application. + */ + export interface Schema$DomainMapping { + /** + * Relative name of the domain serving the application. Example: + * example.com. + */ + id: string; + /** + * Full path to the DomainMapping resource in the API. Example: + * apps/myapp/domainMapping/example.com.@OutputOnly + */ + name: string; + /** + * The resource records required to configure this domain mapping. These + * records must be added to the domain's DNS configuration in order to + * serve the application via this domain mapping.@OutputOnly + */ + resourceRecords: Schema$ResourceRecord[]; + /** + * SSL configuration for this domain. If unconfigured, this domain will not + * serve with SSL. + */ + sslSettings: Schema$SslSettings; + } /** - * URL prefix. Uses regular expression syntax, which means regexp special - * characters must be escaped, but should not contain groupings. All URLs that - * begin with this prefix are handled by this handler, using the portion of - * the URL after the prefix as part of the file path. - */ - urlRegex: string; -} -/** - * A Version resource is a specific set of source code and configuration files - * that are deployed into a service. - */ -export interface Schema$Version { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The + * Endpoints API Service provides tooling for serving Open API and gRPC + * endpoints via an NGINX proxy. Only valid for App Engine Flexible + * environment deployments.The fields here refer to the name and configuration + * id of a "service" resource in the Service Management API + * (https://cloud.google.com/service-management/overview). + */ + export interface Schema$EndpointsApiService { + /** + * Endpoints service configuration id as specified by the Service Management + * API. For example "2016-09-19r1" + */ + configId: string; + /** + * Endpoints service name which is the name of the "service" + * resource in the Service Management API. For example + * "myapi.endpoints.myproject.cloud.goog" + */ + name: string; + } /** - * Serving configuration for Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned - * in GET requests if view=FULL is set. - */ - apiConfig: Schema$ApiConfigHandler; + * Custom static error page to be served when an error occurs. + */ + export interface Schema$ErrorHandler { + /** + * Error condition this handler applies to. + */ + errorCode: string; + /** + * MIME type of file. Defaults to text/html. + */ + mimeType: string; + /** + * Static file content to be served for this error. + */ + staticFile: string; + } /** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ - automaticScaling: Schema$AutomaticScaling; + * The feature specific settings to be used in the application. These define + * behaviors that are user configurable. + */ + export interface Schema$FeatureSettings { + /** + * Boolean value indicating if split health checks should be used instead of + * the legacy health checks. At an app.yaml level, this means defaulting to + * 'readiness_check' and 'liveness_check' values instead of + * 'health_check' ones. Once the legacy 'health_check' + * behavior is deprecated, and this value is always true, this setting can + * be removed. + */ + splitHealthChecks: boolean; + } /** - * A service with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by - * user activity. - */ - basicScaling: Schema$BasicScaling; + * Single source file that is part of the version to be deployed. Each source + * file that is deployed must be specified separately. + */ + export interface Schema$FileInfo { + /** + * The MIME type of the file.Defaults to the value from Google Cloud + * Storage. + */ + mimeType: string; + /** + * The SHA1 hash of the file, in hex. + */ + sha1Sum: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in + * Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; + } /** - * Metadata settings that are supplied to this version to enable beta runtime - * features. - */ - betaSettings: any; + * A single firewall rule that is evaluated against incoming traffic and + * provides an action to take on matched requests. + */ + export interface Schema$FirewallRule { + /** + * The action to take on matched requests. + */ + action: string; + /** + * An optional string description of this rule. This field has a maximum + * length of 100 characters. + */ + description: string; + /** + * A positive integer between 1, Int32.MaxValue-1 that defines the order of + * rule evaluation. Rules with the lowest priority are evaluated first.A + * default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic + * when no previous rule matches. Only the action of this rule can be + * modified by the user. + */ + priority: number; + /** + * IP address or range, defined using CIDR notation, of requests that this + * rule applies to. You can use the wildcard character "*" to + * match all IPs equivalent to "0/0" and "::/0" + * together. Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or + * 2001:0db8:0000:0042:0000:8a2e:0370:7334.<p>Truncation will be + * silently performed on addresses which are not properly truncated. For + * example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. + * Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as + * 2001:db8::/32. + */ + sourceRange: string; + } /** - * Email address of the user who created this version.@OutputOnly + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. Only applicable for instances in + * App Engine flexible environment. */ - createdBy: string; + export interface Schema$HealthCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Whether to explicitly disable health checks for this instance. + */ + disableHealthCheck: boolean; + /** + * Number of consecutive successful health checks required before receiving + * traffic. + */ + healthyThreshold: number; + /** + * Host header to send when performing an HTTP health check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * Number of consecutive failed health checks required before an instance is + * restarted. + */ + restartThreshold: number; + /** + * Time before the health check is considered failed. + */ + timeout: string; + /** + * Number of consecutive failed health checks required before removing + * traffic. + */ + unhealthyThreshold: number; + } /** - * Time that this version was created.@OutputOnly - */ - createTime: string; + * Identity-Aware Proxy + */ + export interface Schema$IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all + * incoming requests.If true, the oauth2_client_id and oauth2_client_secret + * fields must be non-empty. + */ + enabled: boolean; + /** + * OAuth2 client ID to use for the authentication flow. + */ + oauth2ClientId: string; + /** + * OAuth2 client secret to use for the authentication flow.For security + * reasons, this value cannot be retrieved via the API. Instead, the SHA-256 + * hash of the value is returned in the oauth2_client_secret_sha256 + * field.@InputOnly + */ + oauth2ClientSecret: string; + /** + * Hex-encoded SHA-256 hash of the client secret.@OutputOnly + */ + oauth2ClientSecretSha256: string; + } /** - * Duration that static files should be cached by web proxies and browsers. - * Only applicable if the corresponding StaticFilesHandler - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) - * does not specify its own expiration time.Only returned in GET requests if - * view=FULL is set. - */ - defaultExpiration: string; + * An Instance resource is the computing unit that App Engine uses to + * automatically scale an application. + */ + export interface Schema$Instance { + /** + * App Engine release this instance is running on.@OutputOnly + */ + appEngineRelease: string; + /** + * Availability of the instance.@OutputOnly + */ + availability: string; + /** + * Average latency (ms) over the last minute.@OutputOnly + */ + averageLatency: number; + /** + * Number of errors since this instance was started.@OutputOnly + */ + errors: number; + /** + * Relative name of the instance within the version. Example: + * instance-1.@OutputOnly + */ + id: string; + /** + * Total memory in use (bytes).@OutputOnly + */ + memoryUsage: string; + /** + * Full path to the Instance resource in the API. Example: + * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly + */ + name: string; + /** + * Average queries per second (QPS) over the last minute.@OutputOnly + */ + qps: number; + /** + * Number of requests since this instance was started.@OutputOnly + */ + requests: number; + /** + * Time that this instance was started.@OutputOnly + */ + startTime: string; + /** + * Whether this instance is in debug mode. Only applicable for instances in + * App Engine flexible environment.@OutputOnly + */ + vmDebugEnabled: boolean; + /** + * Virtual machine ID of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmId: string; + /** + * The IP address of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmIp: string; + /** + * Name of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmName: string; + /** + * Status of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmStatus: string; + /** + * Zone where the virtual machine is located. Only applicable for instances + * in App Engine flexible environment.@OutputOnly + */ + vmZoneName: string; + } /** - * Code and application artifacts that make up this version.Only returned in - * GET requests if view=FULL is set. - */ - deployment: Schema$Deployment; + * Third-party Python runtime library that is required by the application. + */ + export interface Schema$Library { + /** + * Name of the library. Example: "django". + */ + name: string; + /** + * Version of the library to select, or "latest". + */ + version: string; + } /** - * Total size in bytes of all the files that are included in this version and - * currently hosted on the App Engine disk.@OutputOnly - */ - diskUsageBytes: string; + * Response message for AuthorizedCertificates.ListAuthorizedCertificates. + */ + export interface Schema$ListAuthorizedCertificatesResponse { + /** + * The SSL certificates the user is authorized to administer. + */ + certificates: Schema$AuthorizedCertificate[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud - * Endpoints Extensible Service Proxy will be provided to serve the API - * implemented by the app. - */ - endpointsApiService: Schema$EndpointsApiService; + * Response message for AuthorizedDomains.ListAuthorizedDomains. + */ + export interface Schema$ListAuthorizedDomainsResponse { + /** + * The authorized domains belonging to the user. + */ + domains: Schema$AuthorizedDomain[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * App Engine execution environment for this version.Defaults to standard. - */ - env: string; + * Response message for DomainMappings.ListDomainMappings. + */ + export interface Schema$ListDomainMappingsResponse { + /** + * The domain mappings for the application. + */ + domainMappings: Schema$DomainMapping[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Environment variables available to the application.Only returned in GET - * requests if view=FULL is set. - */ - envVariables: any; + * Response message for Firewall.ListIngressRules. + */ + export interface Schema$ListIngressRulesResponse { + /** + * The ingress FirewallRules for this application. + */ + ingressRules: Schema$FirewallRule[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Custom static error pages. Limited to 10KB per page.Only returned in GET - * requests if view=FULL is set. - */ - errorHandlers: Schema$ErrorHandler[]; + * Response message for Instances.ListInstances. + */ + export interface Schema$ListInstancesResponse { + /** + * The instances belonging to the requested version. + */ + instances: Schema$Instance[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * An ordered list of URL-matching patterns that should be applied to incoming - * requests. The first matching URL handles the request and other request - * handlers are not attempted.Only returned in GET requests if view=FULL is - * set. - */ - handlers: Schema$UrlMap[]; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Configures health checking for instances. Unhealthy instances are stopped - * and replaced with new instances. Only applicable in the App Engine flexible - * environment.Only returned in GET requests if view=FULL is set. - */ - healthCheck: Schema$HealthCheck; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Relative name of the version within the service. Example: v1. Version names - * can contain only lowercase letters, numbers, or hyphens. Reserved names: - * "default", "latest", and any name with the prefix - * "ah-". - */ - id: string; + * Response message for Services.ListServices. + */ + export interface Schema$ListServicesResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The services belonging to the requested application. + */ + services: Schema$Service[]; + } /** - * Before an application can receive email or XMPP messages, the application - * must be configured to enable the service. - */ - inboundServices: string[]; + * Response message for Versions.ListVersions. + */ + export interface Schema$ListVersionsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The versions belonging to the requested service. + */ + versions: Schema$Version[]; + } /** - * Instance class that is used to run this version. Valid values are: - * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, - * B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling - * or BasicScaling. - */ - instanceClass: string; + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. + */ + export interface Schema$LivenessCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Number of consecutive failed checks required before considering the VM + * unhealthy. + */ + failureThreshold: number; + /** + * Host header to send when performing a HTTP Liveness check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * The initial delay before starting to execute the checks. + */ + initialDelay: string; + /** + * The request path. + */ + path: string; + /** + * Number of consecutive successful checks required before considering the + * VM healthy. + */ + successThreshold: number; + /** + * Time before the check is considered failed. + */ + timeout: string; + } /** - * Configuration for third-party Python runtime libraries that are required by - * the application.Only returned in GET requests if view=FULL is set. - */ - libraries: Schema$Library[]; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: "us-east1". + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: "projects/example-project/locations/us-east1" + */ + name: string; + } /** - * Configures liveness health checking for instances. Unhealthy instances are - * stopped and replaced with new instancesOnly returned in GET requests if - * view=FULL is set. - */ - livenessCheck: Schema$LivenessCheck; + * Metadata for the given google.cloud.location.Location. + */ + export interface Schema$LocationMetadata { + /** + * App Engine flexible environment is available in the given + * location.@OutputOnly + */ + flexibleEnvironmentAvailable: boolean; + /** + * App Engine standard environment is available in the given + * location.@OutputOnly + */ + standardEnvironmentAvailable: boolean; + } /** * A service with manual scaling runs continuously, allowing you to perform * complex initialization and rely on the state of its memory over time. */ - manualScaling: Schema$ManualScaling; - /** - * Full path to the Version resource in the API. Example: - * apps/myapp/services/default/versions/v1.@OutputOnly - */ - name: string; + export interface Schema$ManualScaling { + /** + * Number of instances to assign to the service at the start. This number + * can later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) + * set_num_instances() function. + */ + instances: number; + } /** * Extra network settings. Only applicable in the App Engine flexible * environment. */ - network: Schema$Network; - /** - * Files that match this pattern will not be built into this version. Only - * applicable for Go runtimes.Only returned in GET requests if view=FULL is - * set. - */ - nobuildFilesRegex: string; + export interface Schema$Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the + * application container. Only applicable in the App Engine flexible + * environment. + */ + forwardedPorts: string[]; + /** + * Tag to apply to the instance during creation. Only applicable in the App + * Engine flexible environment. + */ + instanceTag: string; + /** + * Google Compute Engine network where the virtual machines are created. + * Specify the short name, not the resource path.Defaults to default. + */ + name: string; + /** + * Google Cloud Platform sub-network where the virtual machines are created. + * Specify the short name, not the resource path.If a subnetwork name is + * specified, a network name will also be required unless it is for the + * default network. If the network that the instance is being created in is + * a Legacy network, then the IP address is allocated from the IPv4Range. If + * the network that the instance is being created in is an auto Subnet Mode + * Network, then only network name should be specified (not the + * subnetwork_name) and the IP address is created from the IPCidrRange of + * the subnetwork that exists in that zone for that network. If the network + * that the instance is being created in is a custom Subnet Mode Network, + * then the subnetwork_name must be specified and the IP address is created + * from the IPCidrRange of the subnetwork.If specified, the subnetwork must + * exist in the same region as the App Engine flexible environment + * application. + */ + subnetworkName: string; + } /** - * Configures readiness health checking for instances. Unhealthy instances are - * not put into the backend traffic rotation.Only returned in GET requests if - * view=FULL is set. + * Target scaling by network usage. Only applicable in the App Engine flexible + * environment. */ - readinessCheck: Schema$ReadinessCheck; + export interface Schema$NetworkUtilization { + /** + * Target bytes received per second. + */ + targetReceivedBytesPerSecond: number; + /** + * Target packets received per second. + */ + targetReceivedPacketsPerSecond: number; + /** + * Target bytes sent per second. + */ + targetSentBytesPerSecond: number; + /** + * Target packets sent per second. + */ + targetSentPacketsPerSecond: number; + } /** - * Machine resources for this version. Only applicable in the App Engine - * flexible environment. - */ - resources: Schema$Resources; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * Desired runtime. Example: python27. - */ - runtime: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadata { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Type of this operation. Deprecated, use method field instead. Example: + * "create_version".@OutputOnly + */ + operationType: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/modules/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * The version of the API in the given runtime environment. Please see the - * app.yaml reference for valid values at - * https://cloud.google.com/appengine/docs/standard/<language>/config/appref - */ - runtimeApiVersion: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1 { + createVersionMetadata: Schema$CreateVersionMetadataV1; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * The channel of the runtime to use. Only available for some runtimes. - * Defaults to the default channel. - */ - runtimeChannel: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Alpha { + createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Current serving status of this version. Only the versions with a SERVING - * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an - * invalid value. Defaults to SERVING. - */ - servingStatus: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta { + createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Whether multiple requests can be dispatched to this version at once. - */ - threadsafe: boolean; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta5 { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method name that initiated this operation. Example: + * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * Serving URL for this version. Example: - * "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly - */ - versionUrl: string; + * Readiness checking configuration for VM instances. Unhealthy instances are + * removed from traffic rotation. + */ + export interface Schema$ReadinessCheck { + /** + * A maximum time limit on application initialization, measured from moment + * the application successfully replies to a healthcheck until it is ready + * to serve traffic. + */ + appStartTimeout: string; + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Number of consecutive failed checks required before removing traffic. + */ + failureThreshold: number; + /** + * Host header to send when performing a HTTP Readiness check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * The request path. + */ + path: string; + /** + * Number of consecutive successful checks required before receiving + * traffic. + */ + successThreshold: number; + /** + * Time before the check is considered failed. + */ + timeout: string; + } /** - * Whether to deploy this version in a container on a virtual machine. + * Request message for 'Applications.RepairApplication'. */ - vm: boolean; + export interface Schema$RepairApplicationRequest {} /** - * The Google Compute Engine zones that are supported by this version in the - * App Engine flexible environment. + * Target scaling by request utilization. Only applicable in the App Engine + * flexible environment. */ - zones: string[]; -} -/** - * Volumes mounted within the app container. Only applicable in the App Engine - * flexible environment. - */ -export interface Schema$Volume { + export interface Schema$RequestUtilization { + /** + * Target number of concurrent requests. + */ + targetConcurrentRequests: number; + /** + * Target requests per second. + */ + targetRequestCountPerSecond: number; + } /** - * Unique name for the volume. - */ - name: string; + * A DNS resource record. + */ + export interface Schema$ResourceRecord { + /** + * Relative name of the object affected by this record. Only applicable for + * CNAME records. Example: 'www'. + */ + name: string; + /** + * Data for this record. Values vary by record type, as defined in RFC 1035 + * (section 5) and RFC 1034 (section 3.6.1). + */ + rrdata: string; + /** + * Resource record type. Example: AAAA. + */ + type: string; + } /** - * Volume size in gigabytes. - */ - sizeGb: number; + * Machine resources for a version. + */ + export interface Schema$Resources { + /** + * Number of CPU cores needed. + */ + cpu: number; + /** + * Disk size (GB) needed. + */ + diskGb: number; + /** + * Memory (GB) needed. + */ + memoryGb: number; + /** + * User specified volumes. + */ + volumes: Schema$Volume[]; + } /** - * Underlying volume type, e.g. 'tmpfs'. + * Executes a script to handle the request that matches the URL pattern. */ - volumeType: string; -} -/** - * The zip file information for a zip deployment. - */ -export interface Schema$ZipInfo { + export interface Schema$ScriptHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * An estimate of the number of files in a zip for a zip deployment. If set, - * must be greater than or equal to the actual number of files. Used for - * optimizing performance; if not provided, deployment may be slow. - */ - filesCount: number; + * A Service resource is a logical component of an application that can share + * state and communicate in a secure fashion with other services. For example, + * an application that handles customer requests might include separate + * services to handle tasks such as backend data analysis or API requests from + * mobile devices. Each service has a collection of versions that define a + * specific set of code used to implement the functionality of that service. + */ + export interface Schema$Service { + /** + * Relative name of the service within the application. Example: + * default.@OutputOnly + */ + id: string; + /** + * Full path to the Service resource in the API. Example: + * apps/myapp/services/default.@OutputOnly + */ + name: string; + /** + * Mapping that defines fractional HTTP traffic diversion to different + * versions within the service. + */ + split: Schema$TrafficSplit; + } /** - * URL of the zip file to deploy from. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + * SSL configuration for a DomainMapping resource. */ - sourceUrl: string; -} - -export class Resource$Apps { - root: Appengine; - authorizedCertificates: Resource$Apps$Authorizedcertificates; - authorizedDomains: Resource$Apps$Authorizeddomains; - domainMappings: Resource$Apps$Domainmappings; - firewall: Resource$Apps$Firewall; - locations: Resource$Apps$Locations; - operations: Resource$Apps$Operations; - services: Resource$Apps$Services; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.authorizedCertificates = - new Resource$Apps$Authorizedcertificates(root); - this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); - this.domainMappings = new Resource$Apps$Domainmappings(root); - this.firewall = new Resource$Apps$Firewall(root); - this.locations = new Resource$Apps$Locations(root); - this.operations = new Resource$Apps$Operations(root); - this.services = new Resource$Apps$Services(root); - } - - getRoot() { - return this.root; + export interface Schema$SslSettings { + /** + * ID of the AuthorizedCertificate resource configuring SSL for the + * application. Clearing this field will remove SSL support. Example: 12345. + */ + certificateId: string; } - - /** - * appengine.apps.create - * @desc Creates an App Engine application for a Google Cloud Platform - * project. Required fields: id - The ID of the target Cloud Platform project. - * location - The region (https://cloud.google.com/appengine/docs/locations) - * where you want the App Engine application located.For more information - * about App Engine applications, see Managing Projects, Applications, and - * Billing (https://cloud.google.com/appengine/docs/standard/python/console/). - * @alias appengine.apps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Scheduler settings for standard environment. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$StandardSchedulerSettings { + /** + * Maximum number of instances to run for this version. Set to zero to + * disable max_instances configuration. + */ + maxInstances: number; + /** + * Minimum number of instances to run for this version. Set to zero to + * disable min_instances configuration. + */ + minInstances: number; + /** + * Target CPU utilization ratio to maintain when scaling. + */ + targetCpuUtilization: number; + /** + * Target throughput utilization ratio to maintain when scaling + */ + targetThroughputUtilization: number; } - - /** - * appengine.apps.get - * @desc Gets information about an application. - * @alias appengine.apps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to get. Example: apps/myapp. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Files served directly to the user for a given URL, such as images, CSS + * stylesheets, or JavaScript source files. Static file handlers describe + * which files in the application directory are static files, and which URLs + * serve them. + */ + export interface Schema$StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files + * declared in static file handlers are uploaded as static data and are only + * served to end users; they cannot be read by the application. If enabled, + * uploads are charged against both your code and static data storage + * resource quotas. + */ + applicationReadable: boolean; + /** + * Time a static file served by this handler should be cached by web proxies + * and browsers. + */ + expiration: string; + /** + * HTTP headers to use for all responses from these URLs. + */ + httpHeaders: any; + /** + * MIME type used to serve all files served by this handler.Defaults to + * file-specific MIME types, which are derived from each file's filename + * extension. + */ + mimeType: string; + /** + * Path to the static files matched by the URL pattern, from the application + * root directory. The path can refer to text matched in groupings in the + * URL pattern. + */ + path: string; + /** + * Whether this handler should match the request if the file referenced by + * the handler does not exist. + */ + requireMatchingFile: boolean; + /** + * Regular expression that matches the file paths for all files that should + * be referenced by this handler. + */ + uploadPathRegex: string; } - - /** - * appengine.apps.patch - * @desc Updates the specified Application resource. You can update the - * following fields: auth_domain - Google authentication domain for - * controlling user access to the application. default_cookie_expiration - - * Cookie expiration policy for the application. - * @alias appengine.apps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * appengine.apps.repair - * @desc Recreates the required App Engine features for the specified App - * Engine application, for example a Cloud Storage bucket or App Engine - * service account. Use this method if you receive an error message about a - * missing feature, for example, Error retrieving the App Engine service - * account. - * @alias appengine.apps.repair - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the application to repair. Example: apps/myapp - * @param {().RepairApplicationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - repair(params?: any, options?: MethodOptions): AxiosPromise; - repair( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - repair( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}:repair') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Traffic routing configuration for versions within a single service. Traffic + * splits define how traffic directed to the service is assigned to versions. + */ + export interface Schema$TrafficSplit { + /** + * Mapping from version IDs within the service to fractional (0.000, 1] + * allocations of traffic for that version. Each version can be specified + * only once, but some versions in the service may not have any traffic + * allocation. Services that have traffic allocated cannot be deleted until + * either the service is deleted or their traffic allocation is removed. + * Allocations must sum to 1. Up to two decimal place precision is supported + * for IP-based splits and up to three decimal places is supported for + * cookie-based splits. + */ + allocations: any; + /** + * Mechanism used to determine which version a request is sent to. The + * traffic selection algorithm will be stable for either type until + * allocations are changed. + */ + shardBy: string; } -} -export class Resource$Apps$Authorizedcertificates { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * Rules to match an HTTP request and dispatch that request to a service. + */ + export interface Schema$UrlDispatchRule { + /** + * Domain name to match against. The wildcard "*" is supported if + * specified before a period: "*.".Defaults to matching all + * domains: "*". + */ + domain: string; + /** + * Pathname within the host. Must start with a "/". A single + * "*" can be included at the end of the path.The sum of the + * lengths of the domain and path may not exceed 100 characters. + */ + path: string; + /** + * Resource ID of a service in this application that should serve the + * matched request. The service must already exist. Example: default. + */ + service: string; } - - getRoot() { - return this.root; + /** + * URL pattern and description of how the URL should be handled. App Engine + * can handle URLs by executing application code or by serving static files + * uploaded with the version, such as images, CSS, or JavaScript. + */ + export interface Schema$UrlMap { + /** + * Uses API Endpoints to handle requests. + */ + apiEndpoint: Schema$ApiEndpointHandler; + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. + */ + login: string; + /** + * 30x code to use when performing redirects for the secure field. Defaults + * to 302. + */ + redirectHttpResponseCode: string; + /** + * Executes a script to handle the request that matches this URL pattern. + */ + script: Schema$ScriptHandler; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * Returns the contents of a file, such as an image, as the response. + */ + staticFiles: Schema$StaticFilesHandler; + /** + * URL prefix. Uses regular expression syntax, which means regexp special + * characters must be escaped, but should not contain groupings. All URLs + * that begin with this prefix are handled by this handler, using the + * portion of the URL after the prefix as part of the file path. + */ + urlRegex: string; } - - /** - * appengine.apps.authorizedCertificates.create - * @desc Uploads the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Version resource is a specific set of source code and configuration files + * that are deployed into a service. + */ + export interface Schema$Version { + /** + * Serving configuration for Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned + * in GET requests if view=FULL is set. + */ + apiConfig: Schema$ApiConfigHandler; + /** + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. + */ + automaticScaling: Schema$AutomaticScaling; + /** + * A service with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. + */ + basicScaling: Schema$BasicScaling; + /** + * Metadata settings that are supplied to this version to enable beta + * runtime features. + */ + betaSettings: any; + /** + * Email address of the user who created this version.@OutputOnly + */ + createdBy: string; + /** + * Time that this version was created.@OutputOnly + */ + createTime: string; + /** + * Duration that static files should be cached by web proxies and browsers. + * Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) + * does not specify its own expiration time.Only returned in GET requests if + * view=FULL is set. + */ + defaultExpiration: string; + /** + * Code and application artifacts that make up this version.Only returned in + * GET requests if view=FULL is set. + */ + deployment: Schema$Deployment; + /** + * Total size in bytes of all the files that are included in this version + * and currently hosted on the App Engine disk.@OutputOnly + */ + diskUsageBytes: string; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud + * Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService: Schema$EndpointsApiService; + /** + * App Engine execution environment for this version.Defaults to standard. + */ + env: string; + /** + * Environment variables available to the application.Only returned in GET + * requests if view=FULL is set. + */ + envVariables: any; + /** + * Custom static error pages. Limited to 10KB per page.Only returned in GET + * requests if view=FULL is set. + */ + errorHandlers: Schema$ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to + * incoming requests. The first matching URL handles the request and other + * request handlers are not attempted.Only returned in GET requests if + * view=FULL is set. + */ + handlers: Schema$UrlMap[]; + /** + * Configures health checking for instances. Unhealthy instances are stopped + * and replaced with new instances. Only applicable in the App Engine + * flexible environment.Only returned in GET requests if view=FULL is set. + */ + healthCheck: Schema$HealthCheck; + /** + * Relative name of the version within the service. Example: v1. Version + * names can contain only lowercase letters, numbers, or hyphens. Reserved + * names: "default", "latest", and any name with the + * prefix "ah-". + */ + id: string; + /** + * Before an application can receive email or XMPP messages, the application + * must be configured to enable the service. + */ + inboundServices: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, + * B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for + * ManualScaling or BasicScaling. + */ + instanceClass: string; + /** + * Configuration for third-party Python runtime libraries that are required + * by the application.Only returned in GET requests if view=FULL is set. + */ + libraries: Schema$Library[]; + /** + * Configures liveness health checking for instances. Unhealthy instances + * are stopped and replaced with new instancesOnly returned in GET requests + * if view=FULL is set. + */ + livenessCheck: Schema$LivenessCheck; + /** + * A service with manual scaling runs continuously, allowing you to perform + * complex initialization and rely on the state of its memory over time. + */ + manualScaling: Schema$ManualScaling; + /** + * Full path to the Version resource in the API. Example: + * apps/myapp/services/default/versions/v1.@OutputOnly + */ + name: string; + /** + * Extra network settings. Only applicable in the App Engine flexible + * environment. + */ + network: Schema$Network; + /** + * Files that match this pattern will not be built into this version. Only + * applicable for Go runtimes.Only returned in GET requests if view=FULL is + * set. + */ + nobuildFilesRegex: string; + /** + * Configures readiness health checking for instances. Unhealthy instances + * are not put into the backend traffic rotation.Only returned in GET + * requests if view=FULL is set. + */ + readinessCheck: Schema$ReadinessCheck; + /** + * Machine resources for this version. Only applicable in the App Engine + * flexible environment. + */ + resources: Schema$Resources; + /** + * Desired runtime. Example: python27. + */ + runtime: string; + /** + * The version of the API in the given runtime environment. Please see the + * app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard/<language>/config/appref + */ + runtimeApiVersion: string; + /** + * The channel of the runtime to use. Only available for some runtimes. + * Defaults to the default channel. + */ + runtimeChannel: string; + /** + * Current serving status of this version. Only the versions with a SERVING + * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is + * an invalid value. Defaults to SERVING. + */ + servingStatus: string; + /** + * Whether multiple requests can be dispatched to this version at once. + */ + threadsafe: boolean; + /** + * Serving URL for this version. Example: + * "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly + */ + versionUrl: string; + /** + * Whether to deploy this version in a container on a virtual machine. + */ + vm: boolean; + /** + * The Google Compute Engine zones that are supported by this version in the + * App Engine flexible environment. + */ + zones: string[]; } - - /** - * appengine.apps.authorizedCertificates.delete - * @desc Deletes the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Volumes mounted within the app container. Only applicable in the App Engine + * flexible environment. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Volume { + /** + * Unique name for the volume. + */ + name: string; + /** + * Volume size in gigabytes. + */ + sizeGb: number; + /** + * Underlying volume type, e.g. 'tmpfs'. + */ + volumeType: string; } - - /** - * appengine.apps.authorizedCertificates.get - * @desc Gets the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the GET response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The zip file information for a zip deployment. + */ + export interface Schema$ZipInfo { + /** + * An estimate of the number of files in a zip for a zip deployment. If set, + * must be greater than or equal to the actual number of files. Used for + * optimizing performance; if not provided, deployment may be slow. + */ + filesCount: number; + /** + * URL of the zip file to deploy from. Must be a URL to a resource in Google + * Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; } - - /** - * appengine.apps.authorizedCertificates.list - * @desc Lists all SSL certificates the user is authorized to administer. - * @alias appengine.apps.authorizedCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string=} params.view Controls the set of fields returned in the LIST response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps { + root: Appengine; + authorizedCertificates: Resource$Apps$Authorizedcertificates; + authorizedDomains: Resource$Apps$Authorizeddomains; + domainMappings: Resource$Apps$Domainmappings; + firewall: Resource$Apps$Firewall; + locations: Resource$Apps$Locations; + operations: Resource$Apps$Operations; + services: Resource$Apps$Services; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.authorizedCertificates = + new Resource$Apps$Authorizedcertificates(root); + this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); + this.domainMappings = new Resource$Apps$Domainmappings(root); + this.firewall = new Resource$Apps$Firewall(root); + this.locations = new Resource$Apps$Locations(root); + this.operations = new Resource$Apps$Operations(root); + this.services = new Resource$Apps$Services(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.authorizedCertificates.patch - * @desc Updates the specified SSL certificate. To renew a certificate and - * maintain its existing domain mappings, update certificate_data with a new - * certificate. The new certificate must be applicable to the same domains as - * the original certificate. The certificate display_name may also be updated. - * @alias appengine.apps.authorizedCertificates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.create + * @desc Creates an App Engine application for a Google Cloud Platform + * project. Required fields: id - The ID of the target Cloud Platform + * project. location - The region + * (https://cloud.google.com/appengine/docs/locations) where you want the + * App Engine application located.For more information about App Engine + * applications, see Managing Projects, Applications, and Billing + * (https://cloud.google.com/appengine/docs/standard/python/console/). + * @alias appengine.apps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.get + * @desc Gets information about an application. + * @alias appengine.apps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to get. Example: apps/myapp. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/apps/{appsId}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Apps$Authorizeddomains { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.patch + * @desc Updates the specified Application resource. You can update the + * following fields: auth_domain - Google authentication domain for + * controlling user access to the application. default_cookie_expiration - + * Cookie expiration policy for the application. + * @alias appengine.apps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/apps/{appsId}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.authorizedDomains.list - * @desc Lists all domains the user is authorized to administer. - * @alias appengine.apps.authorizedDomains.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.repair + * @desc Recreates the required App Engine features for the specified App + * Engine application, for example a Cloud Storage bucket or App Engine + * service account. Use this method if you receive an error message about a + * missing feature, for example, Error retrieving the App Engine service + * account. + * @alias appengine.apps.repair + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the application to repair. Example: apps/myapp + * @param {().RepairApplicationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + repair(params?: any, options?: MethodOptions): + AxiosPromise; + repair( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + repair( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}:repair') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Authorizedcertificates { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/authorizedDomains') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Domainmappings { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.authorizedCertificates.create + * @desc Uploads the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.domainMappings.create - * @desc Maps a domain to an application. A user must be authorized to - * administer a domain in order to map it to an application. For a list of - * available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. - * @alias appengine.apps.domainMappings.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.delete + * @desc Deletes the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.domainMappings.delete - * @desc Deletes the specified domain mapping. A user must be authorized to - * administer the associated domain in order to delete a DomainMapping - * resource. - * @alias appengine.apps.domainMappings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.authorizedCertificates.get + * @desc Gets the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the GET response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.domainMappings.get - * @desc Gets the specified domain mapping. - * @alias appengine.apps.domainMappings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.list + * @desc Lists all SSL certificates the user is authorized to administer. + * @alias appengine.apps.authorizedCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string=} params.view Controls the set of fields returned in the LIST response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.domainMappings.list - * @desc Lists the domain mappings on an application. - * @alias appengine.apps.domainMappings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.authorizedCertificates.patch + * @desc Updates the specified SSL certificate. To renew a certificate and + * maintain its existing domain mappings, update certificate_data with a new + * certificate. The new certificate must be applicable to the same domains + * as the original certificate. The certificate display_name may also be + * updated. + * @alias appengine.apps.authorizedCertificates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.domainMappings.patch - * @desc Updates the specified domain mapping. To map an SSL certificate to a - * domain mapping, update certificate_id to point to an AuthorizedCertificate - * resource. A user must be authorized to administer the associated domain in - * order to update a DomainMapping resource. - * @alias appengine.apps.domainMappings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Authorizeddomains { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Firewall { - root: Appengine; - ingressRules: Resource$Apps$Firewall$Ingressrules; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.ingressRules = new Resource$Apps$Firewall$Ingressrules(root); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } -} -export class Resource$Apps$Firewall$Ingressrules { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.authorizedDomains.list + * @desc Lists all domains the user is authorized to administer. + * @alias appengine.apps.authorizedDomains.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/authorizedDomains') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * appengine.apps.firewall.ingressRules.batchUpdate - * @desc Replaces the entire firewall ruleset in one bulk operation. This - * overrides and replaces the rules of an existing firewall with the new - * rules.If the final rule does not match traffic with the '*' wildcard IP - * range, then an "allow all" rule is explicitly added to the end of the list. - * @alias appengine.apps.firewall.ingressRules.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. - * @param {().BatchUpdateIngressRulesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Domainmappings { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/firewall/ingressRules:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.firewall.ingressRules.create - * @desc Creates a firewall rule for the application. - * @alias appengine.apps.firewall.ingressRules.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. - * @param {().FirewallRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.domainMappings.create + * @desc Maps a domain to an application. A user must be authorized to + * administer a domain in order to map it to an application. For a list of + * available authorized domains, see + * AuthorizedDomains.ListAuthorizedDomains. + * @alias appengine.apps.domainMappings.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/firewall/ingressRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.firewall.ingressRules.delete - * @desc Deletes the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.delete + * @desc Deletes the specified domain mapping. A user must be authorized to + * administer the associated domain in order to delete a DomainMapping + * resource. + * @alias appengine.apps.domainMappings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.firewall.ingressRules.get - * @desc Gets the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.domainMappings.get + * @desc Gets the specified domain mapping. + * @alias appengine.apps.domainMappings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.firewall.ingressRules.list - * @desc Lists the firewall rules of an application. - * @alias appengine.apps.firewall.ingressRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. - * @param {string=} params.matchingAddress A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/firewall/ingressRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.list + * @desc Lists the domain mappings on an application. + * @alias appengine.apps.domainMappings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.firewall.ingressRules.patch - * @desc Updates the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().FirewallRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.patch + * @desc Updates the specified domain mapping. To map an SSL certificate to + * a domain mapping, update certificate_id to point to an + * AuthorizedCertificate resource. A user must be authorized to administer + * the associated domain in order to update a DomainMapping resource. + * @alias appengine.apps.domainMappings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Apps$Firewall { + root: Appengine; + ingressRules: Resource$Apps$Firewall$Ingressrules; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.ingressRules = new Resource$Apps$Firewall$Ingressrules(root); + } -export class Resource$Apps$Locations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } + export class Resource$Apps$Firewall$Ingressrules { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.locations.get - * @desc Gets information about a location. - * @alias appengine.apps.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Resource name for the location. - * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.batchUpdate + * @desc Replaces the entire firewall ruleset in one bulk operation. This + * overrides and replaces the rules of an existing firewall with the new + * rules.If the final rule does not match traffic with the '*' wildcard IP + * range, then an "allow all" rule is explicitly added to the end of the + * list. + * @alias appengine.apps.firewall.ingressRules.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + * @param {().BatchUpdateIngressRulesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/firewall/ingressRules:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/locations/{locationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'locationsId'], - pathParams: ['appsId', 'locationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.locations.list - * @desc Lists information about the supported locations for this service. - * @alias appengine.apps.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.create + * @desc Creates a firewall rule for the application. + * @alias appengine.apps.firewall.ingressRules.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + * @param {().FirewallRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/firewall/ingressRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Operations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.firewall.ingressRules.delete + * @desc Deletes the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias appengine.apps.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation resource. - * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.get + * @desc Gets the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/operations/{operationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'operationsId'], - pathParams: ['appsId', 'operationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias appengine.apps.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.list + * @desc Lists the firewall rules of an application. + * @alias appengine.apps.firewall.ingressRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + * @param {string=} params.matchingAddress A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/firewall/ingressRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services { - root: Appengine; - versions: Resource$Apps$Services$Versions; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.versions = new Resource$Apps$Services$Versions(root); - } - getRoot() { - return this.root; + /** + * appengine.apps.firewall.ingressRules.patch + * @desc Updates the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().FirewallRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * appengine.apps.services.delete - * @desc Deletes the specified service and all enclosed versions. - * @alias appengine.apps.services.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Locations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.get - * @desc Gets the current configuration of the specified service. - * @alias appengine.apps.services.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.locations.get + * @desc Gets information about a location. + * @alias appengine.apps.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Resource name for the location. + * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/locations/{locationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'locationsId'], + pathParams: ['appsId', 'locationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.services.list - * @desc Lists all the services in the application. - * @alias appengine.apps.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.locations.list + * @desc Lists information about the supported locations for this service. + * @alias appengine.apps.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.patch - * @desc Updates the configuration of the specified service. - * @alias appengine.apps.services.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. - * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().Service} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Operations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services$Versions { - root: Appengine; - instances: Resource$Apps$Services$Versions$Instances; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.instances = new Resource$Apps$Services$Versions$Instances(root); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.services.versions.create - * @desc Deploys code and resource files to a new version. - * @alias appengine.apps.services.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias appengine.apps.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation resource. + * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/operations/{operationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'operationsId'], + pathParams: ['appsId', 'operationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.delete - * @desc Deletes an existing Version resource. - * @alias appengine.apps.services.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias appengine.apps.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.versions.get - * @desc Gets the specified Version resource. By default, only a BASIC_VIEW - * will be returned. Specify the FULL_VIEW parameter to get the full resource. - * @alias appengine.apps.services.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the Get response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Services { + root: Appengine; + versions: Resource$Apps$Services$Versions; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.versions = new Resource$Apps$Services$Versions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.list - * @desc Lists the versions of a service. - * @alias appengine.apps.services.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the List response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.delete + * @desc Deletes the specified service and all enclosed versions. + * @alias appengine.apps.services.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.get + * @desc Gets the current configuration of the specified service. + * @alias appengine.apps.services.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.list + * @desc Lists all the services in the application. + * @alias appengine.apps.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/services') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.patch - * @desc Updates the specified Version resource. You can specify the following - * fields depending on the App Engine environment and type of scaling that the - * version resource uses: serving_status - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): - * For Version resources that use basic scaling, manual scaling, or run in the - * App Engine flexible environment. instance_class - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): - * For Version resources that run in the App Engine standard environment. - * automatic_scaling.min_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.max_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.min_total_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.max_total_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.cool_down_period_sec - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.cpu_utilization.target_utilization - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. - * @alias appengine.apps.services.versions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.patch + * @desc Updates the configuration of the specified service. + * @alias appengine.apps.services.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. + * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().Service} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions { + root: Appengine; + instances: Resource$Apps$Services$Versions$Instances; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.instances = new Resource$Apps$Services$Versions$Instances(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Services$Versions$Instances { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + + /** + * appengine.apps.services.versions.create + * @desc Deploys code and resource files to a new version. + * @alias appengine.apps.services.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.services.versions.instances.debug - * @desc Enables debugging on a VM instance. This allows you to use the SSH - * command to connect to the virtual machine where the instance lives. While - * in "debug mode", the instance continues to serve live traffic. You should - * delete the instance when you are done debugging and then allow the system - * to take over and determine if another instance should be started.Only - * applicable for instances in App Engine flexible environment. - * @alias appengine.apps.services.versions.instances.debug - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().DebugInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - debug(params?: any, options?: MethodOptions): AxiosPromise; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.delete + * @desc Deletes an existing Version resource. + * @alias appengine.apps.services.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.get + * @desc Gets the specified Version resource. By default, only a BASIC_VIEW + * will be returned. Specify the FULL_VIEW parameter to get the full + * resource. + * @alias appengine.apps.services.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the Get response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.list + * @desc Lists the versions of a service. + * @alias appengine.apps.services.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the List response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.delete - * @desc Stops a running instance. - * @alias appengine.apps.services.versions.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.patch + * @desc Updates the specified Version resource. You can specify the + * following fields depending on the App Engine environment and type of + * scaling that the version resource uses: serving_status + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): + * For Version resources that use basic scaling, manual scaling, or run in + * the App Engine flexible environment. instance_class + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): + * For Version resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.min_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. automatic_scaling.max_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. automatic_scaling.cool_down_period_sec + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. + * automatic_scaling.cpu_utilization.target_utilization + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. + * @alias appengine.apps.services.versions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions$Instances { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.instances.get - * @desc Gets instance information. - * @alias appengine.apps.services.versions.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.services.versions.instances.debug + * @desc Enables debugging on a VM instance. This allows you to use the SSH + * command to connect to the virtual machine where the instance lives. While + * in "debug mode", the instance continues to serve live traffic. You should + * delete the instance when you are done debugging and then allow the system + * to take over and determine if another instance should be started.Only + * applicable for instances in App Engine flexible environment. + * @alias appengine.apps.services.versions.instances.debug + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().DebugInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + debug(params?: any, options?: MethodOptions): + AxiosPromise; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.list - * @desc Lists the instances of a version.Tip: To aggregate details about - * instances over time, see the Stackdriver Monitoring API - * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * @alias appengine.apps.services.versions.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `parent`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.instances.delete + * @desc Stops a running instance. + * @alias appengine.apps.services.versions.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.instances.get + * @desc Gets instance information. + * @alias appengine.apps.services.versions.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.instances.list + * @desc Lists the instances of a version.Tip: To aggregate details about + * instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @alias appengine.apps.services.versions.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `parent`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appengine/v1alpha.ts b/src/apis/appengine/v1alpha.ts index 385283a359d..c4e34a7dfbe 100644 --- a/src/apis/appengine/v1alpha.ts +++ b/src/apis/appengine/v1alpha.ts @@ -27,1591 +27,1608 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * App Engine Admin API - * - * The App Engine Admin API enables developers to provision and manage their App - * Engine applications. - * - * @example - * const google = require('googleapis'); - * const appengine = google.appengine('v1alpha'); - * - * @namespace appengine - * @type {Function} - * @version v1alpha - * @variation v1alpha - * @param {object=} options Options for Appengine - */ -export class Appengine { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace appengine_v1alpha { + /** + * App Engine Admin API + * + * The App Engine Admin API enables developers to provision and manage their + * App Engine applications. + * + * @example + * const google = require('googleapis'); + * const appengine = google.appengine('v1alpha'); + * + * @namespace appengine + * @type {Function} + * @version v1alpha + * @variation v1alpha + * @param {object=} options Options for Appengine + */ + export class Appengine { + _options: GlobalOptions; + google: GoogleApis; + root = this; - apps: Resource$Apps; + apps: Resource$Apps; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.apps = new Resource$Apps(this); - } + this.apps = new Resource$Apps(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An SSL certificate that a user has been authorized to administer. A user is - * authorized to administer any certificate that applies to one of their - * authorized domains. - */ -export interface Schema$AuthorizedCertificate { - /** - * The SSL certificate serving the AuthorizedCertificate resource. This must - * be obtained independently from a certificate authority. - */ - certificateRawData: Schema$CertificateRawData; - /** - * The user-specified display name of the certificate. This is not guaranteed - * to be unique. Example: My Certificate. - */ - displayName: string; - /** - * Aggregate count of the domain mappings with this certificate mapped. This - * count includes domain mappings on applications for which the user does not - * have VIEWER permissions.Only returned by GET or LIST requests when - * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly - */ - domainMappingsCount: number; - /** - * Topmost applicable domains of this certificate. This certificate applies to - * these domains and their subdomains. Example: example.com.@OutputOnly - */ - domainNames: string[]; - /** - * The time when this certificate expires. To update the renewal time on this - * certificate, upload an SSL certificate with a different expiration time - * using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly - */ - expireTime: string; - /** - * Relative name of the certificate. This is a unique value autogenerated on - * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly - */ - id: string; - /** - * Only applicable if this certificate is managed by App Engine. Managed - * certificates are tied to the lifecycle of a DomainMapping and cannot be - * updated or deleted via the AuthorizedCertificates API. If this certificate - * is manually administered by the user, this field will be empty.@OutputOnly - */ - managedCertificate: Schema$ManagedCertificate; - /** - * Full path to the AuthorizedCertificate resource in the API. Example: - * apps/myapp/authorizedCertificates/12345.@OutputOnly - */ - name: string; - /** - * The full paths to user visible Domain Mapping resources that have this - * certificate mapped. Example: apps/myapp/domainMappings/example.com.This may - * not represent the full list of mapped domain mappings if the user does not - * have VIEWER permissions on all of the applications that have this - * certificate mapped. See domain_mappings_count for a complete count.Only - * returned by GET or LIST requests when specifically requested by the - * view=FULL_CERTIFICATE option.@OutputOnly - */ - visibleDomainMappings: string[]; -} -/** - * A domain that a user has been authorized to administer. To authorize use of a - * domain, verify ownership via Webmaster Central - * (https://www.google.com/webmasters/verification/home). - */ -export interface Schema$AuthorizedDomain { - /** - * Fully qualified domain name of the domain authorized for use. Example: - * example.com. - */ - id: string; - /** - * Full path to the AuthorizedDomain resource in the API. Example: - * apps/myapp/authorizedDomains/example.com.@OutputOnly - */ - name: string; -} -/** - * An SSL certificate obtained from a certificate authority. - */ -export interface Schema$CertificateRawData { - /** - * Unencrypted PEM encoded RSA private key. This field is set once on - * certificate creation and then encrypted. The key size must be 2048 bits or - * fewer. Must include the header and footer. Example: <pre> -----BEGIN - * RSA PRIVATE KEY----- <unencrypted_key_value> -----END RSA PRIVATE - * KEY----- </pre> @InputOnly - */ - privateKey: string; - /** - * PEM encoded x.509 public key certificate. This field is set once on - * certificate creation. Must include the header and footer. Example: - * <pre> -----BEGIN CERTIFICATE----- <certificate_value> -----END - * CERTIFICATE----- </pre> - */ - publicCertificate: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1 { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1alpha.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Alpha { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1beta.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Beta { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * A domain serving an App Engine application. - */ -export interface Schema$DomainMapping { - /** - * Relative name of the domain serving the application. Example: example.com. - */ - id: string; - /** - * Full path to the DomainMapping resource in the API. Example: - * apps/myapp/domainMapping/example.com.@OutputOnly - */ - name: string; - /** - * The resource records required to configure this domain mapping. These - * records must be added to the domain's DNS configuration in order to - * serve the application via this domain mapping.@OutputOnly - */ - resourceRecords: Schema$ResourceRecord[]; - /** - * SSL configuration for this domain. If unconfigured, this domain will not - * serve with SSL. - */ - sslSettings: Schema$SslSettings; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Response message for AuthorizedCertificates.ListAuthorizedCertificates. - */ -export interface Schema$ListAuthorizedCertificatesResponse { - /** - * The SSL certificates the user is authorized to administer. - */ - certificates: Schema$AuthorizedCertificate[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for AuthorizedDomains.ListAuthorizedDomains. - */ -export interface Schema$ListAuthorizedDomainsResponse { - /** - * The authorized domains belonging to the user. - */ - domains: Schema$AuthorizedDomain[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for DomainMappings.ListDomainMappings. - */ -export interface Schema$ListDomainMappingsResponse { /** - * The domain mappings for the application. - */ - domainMappings: Schema$DomainMapping[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: "us-east1". - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: "projects/example-project/locations/us-east1" - */ - name: string; -} -/** - * Metadata for the given google.cloud.location.Location. - */ -export interface Schema$LocationMetadata { - /** - * App Engine flexible environment is available in the given - * location.@OutputOnly - */ - flexibleEnvironmentAvailable: boolean; - /** - * App Engine standard environment is available in the given - * location.@OutputOnly - */ - standardEnvironmentAvailable: boolean; -} -/** - * A certificate managed by App Engine. - */ -export interface Schema$ManagedCertificate { - /** - * Time at which the certificate was last renewed. The renewal process is - * fully managed. Certificate renewal will automatically occur before the - * certificate expires. Renewal errors can be tracked via - * ManagementStatus.@OutputOnly - */ - lastRenewalTime: string; - /** - * Status of certificate management. Refers to the most recent certificate - * acquisition or renewal attempt.@OutputOnly - */ - status: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadata { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Type of this operation. Deprecated, use method field instead. Example: - * "create_version".@OutputOnly - */ - operationType: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/modules/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1 { - createVersionMetadata: Schema$CreateVersionMetadataV1; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Alpha { - createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta { - createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + * An SSL certificate that a user has been authorized to administer. A user is + * authorized to administer any certificate that applies to one of their + * authorized domains. + */ + export interface Schema$AuthorizedCertificate { + /** + * The SSL certificate serving the AuthorizedCertificate resource. This must + * be obtained independently from a certificate authority. + */ + certificateRawData: Schema$CertificateRawData; + /** + * The user-specified display name of the certificate. This is not + * guaranteed to be unique. Example: My Certificate. + */ + displayName: string; + /** + * Aggregate count of the domain mappings with this certificate mapped. This + * count includes domain mappings on applications for which the user does + * not have VIEWER permissions.Only returned by GET or LIST requests when + * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + */ + domainMappingsCount: number; + /** + * Topmost applicable domains of this certificate. This certificate applies + * to these domains and their subdomains. Example: example.com.@OutputOnly + */ + domainNames: string[]; + /** + * The time when this certificate expires. To update the renewal time on + * this certificate, upload an SSL certificate with a different expiration + * time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + */ + expireTime: string; + /** + * Relative name of the certificate. This is a unique value autogenerated on + * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly + */ + id: string; + /** + * Only applicable if this certificate is managed by App Engine. Managed + * certificates are tied to the lifecycle of a DomainMapping and cannot be + * updated or deleted via the AuthorizedCertificates API. If this + * certificate is manually administered by the user, this field will be + * empty.@OutputOnly + */ + managedCertificate: Schema$ManagedCertificate; + /** + * Full path to the AuthorizedCertificate resource in the API. Example: + * apps/myapp/authorizedCertificates/12345.@OutputOnly + */ + name: string; + /** + * The full paths to user visible Domain Mapping resources that have this + * certificate mapped. Example: apps/myapp/domainMappings/example.com.This + * may not represent the full list of mapped domain mappings if the user + * does not have VIEWER permissions on all of the applications that have + * this certificate mapped. See domain_mappings_count for a complete + * count.Only returned by GET or LIST requests when specifically requested + * by the view=FULL_CERTIFICATE option.@OutputOnly + */ + visibleDomainMappings: string[]; + } /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; + * A domain that a user has been authorized to administer. To authorize use of + * a domain, verify ownership via Webmaster Central + * (https://www.google.com/webmasters/verification/home). + */ + export interface Schema$AuthorizedDomain { + /** + * Fully qualified domain name of the domain authorized for use. Example: + * example.com. + */ + id: string; + /** + * Full path to the AuthorizedDomain resource in the API. Example: + * apps/myapp/authorizedDomains/example.com.@OutputOnly + */ + name: string; + } /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; + * An SSL certificate obtained from a certificate authority. + */ + export interface Schema$CertificateRawData { + /** + * Unencrypted PEM encoded RSA private key. This field is set once on + * certificate creation and then encrypted. The key size must be 2048 bits + * or fewer. Must include the header and footer. Example: <pre> + * -----BEGIN RSA PRIVATE KEY----- <unencrypted_key_value> -----END + * RSA PRIVATE KEY----- </pre> @InputOnly + */ + privateKey: string; + /** + * PEM encoded x.509 public key certificate. This field is set once on + * certificate creation. Must include the header and footer. Example: + * <pre> -----BEGIN CERTIFICATE----- <certificate_value> + * -----END CERTIFICATE----- </pre> + */ + publicCertificate: string; + } /** - * Time that this operation was created.@OutputOnly + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1.CreateVersionRequest. */ - insertTime: string; + export interface Schema$CreateVersionMetadataV1 { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * API method that initiated this operation. Example: - * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1alpha.CreateVersionRequest. */ - method: string; + export interface Schema$CreateVersionMetadataV1Alpha { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1beta.CreateVersionRequest. */ - target: string; + export interface Schema$CreateVersionMetadataV1Beta { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * User who requested this operation.@OutputOnly - */ - user: string; + * A domain serving an App Engine application. + */ + export interface Schema$DomainMapping { + /** + * Relative name of the domain serving the application. Example: + * example.com. + */ + id: string; + /** + * Full path to the DomainMapping resource in the API. Example: + * apps/myapp/domainMapping/example.com.@OutputOnly + */ + name: string; + /** + * The resource records required to configure this domain mapping. These + * records must be added to the domain's DNS configuration in order to + * serve the application via this domain mapping.@OutputOnly + */ + resourceRecords: Schema$ResourceRecord[]; + /** + * SSL configuration for this domain. If unconfigured, this domain will not + * serve with SSL. + */ + sslSettings: Schema$SslSettings; + } /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta5 { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Response message for AuthorizedCertificates.ListAuthorizedCertificates. + */ + export interface Schema$ListAuthorizedCertificatesResponse { + /** + * The SSL certificates the user is authorized to administer. + */ + certificates: Schema$AuthorizedCertificate[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; + * Response message for AuthorizedDomains.ListAuthorizedDomains. + */ + export interface Schema$ListAuthorizedDomainsResponse { + /** + * The authorized domains belonging to the user. + */ + domains: Schema$AuthorizedDomain[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; + * Response message for DomainMappings.ListDomainMappings. + */ + export interface Schema$ListDomainMappingsResponse { + /** + * The domain mappings for the application. + */ + domainMappings: Schema$DomainMapping[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * API method name that initiated this operation. Example: - * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly - */ - method: string; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * A DNS resource record. - */ -export interface Schema$ResourceRecord { + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: "us-east1". + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: "projects/example-project/locations/us-east1" + */ + name: string; + } /** - * Relative name of the object affected by this record. Only applicable for - * CNAME records. Example: 'www'. - */ - name: string; + * Metadata for the given google.cloud.location.Location. + */ + export interface Schema$LocationMetadata { + /** + * App Engine flexible environment is available in the given + * location.@OutputOnly + */ + flexibleEnvironmentAvailable: boolean; + /** + * App Engine standard environment is available in the given + * location.@OutputOnly + */ + standardEnvironmentAvailable: boolean; + } /** - * Data for this record. Values vary by record type, as defined in RFC 1035 - * (section 5) and RFC 1034 (section 3.6.1). - */ - rrdata: string; + * A certificate managed by App Engine. + */ + export interface Schema$ManagedCertificate { + /** + * Time at which the certificate was last renewed. The renewal process is + * fully managed. Certificate renewal will automatically occur before the + * certificate expires. Renewal errors can be tracked via + * ManagementStatus.@OutputOnly + */ + lastRenewalTime: string; + /** + * Status of certificate management. Refers to the most recent certificate + * acquisition or renewal attempt.@OutputOnly + */ + status: string; + } /** - * Resource record type. Example: AAAA. - */ - type: string; -} -/** - * SSL configuration for a DomainMapping resource. - */ -export interface Schema$SslSettings { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * ID of the AuthorizedCertificate resource configuring SSL for the - * application. Clearing this field will remove SSL support.By default, a - * managed certificate is automatically created for every domain mapping. To - * omit SSL support or to configure SSL manually, specify - * no_managed_certificate on a CREATE or UPDATE request. You must be - * authorized to administer the AuthorizedCertificate resource to manually map - * it to a DomainMapping resource. Example: 12345. - */ - certificateId: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadata { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Type of this operation. Deprecated, use method field instead. Example: + * "create_version".@OutputOnly + */ + operationType: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/modules/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * Whether the mapped certificate is an App Engine managed certificate. - * Managed certificates are created by default with a domain mapping. To opt - * out, specify no_managed_certificate on a CREATE or UPDATE - * request.@OutputOnly - */ - isManagedCertificate: boolean; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1 { + createVersionMetadata: Schema$CreateVersionMetadataV1; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Alpha { + createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta { + createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Apps { - root: Appengine; - authorizedCertificates: Resource$Apps$Authorizedcertificates; - authorizedDomains: Resource$Apps$Authorizeddomains; - domainMappings: Resource$Apps$Domainmappings; - locations: Resource$Apps$Locations; - operations: Resource$Apps$Operations; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.authorizedCertificates = - new Resource$Apps$Authorizedcertificates(root); - this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); - this.domainMappings = new Resource$Apps$Domainmappings(root); - this.locations = new Resource$Apps$Locations(root); - this.operations = new Resource$Apps$Operations(root); + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta5 { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method name that initiated this operation. Example: + * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; } - - getRoot() { - return this.root; + /** + * A DNS resource record. + */ + export interface Schema$ResourceRecord { + /** + * Relative name of the object affected by this record. Only applicable for + * CNAME records. Example: 'www'. + */ + name: string; + /** + * Data for this record. Values vary by record type, as defined in RFC 1035 + * (section 5) and RFC 1034 (section 3.6.1). + */ + rrdata: string; + /** + * Resource record type. Example: AAAA. + */ + type: string; } -} -export class Resource$Apps$Authorizedcertificates { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * SSL configuration for a DomainMapping resource. + */ + export interface Schema$SslSettings { + /** + * ID of the AuthorizedCertificate resource configuring SSL for the + * application. Clearing this field will remove SSL support.By default, a + * managed certificate is automatically created for every domain mapping. To + * omit SSL support or to configure SSL manually, specify + * no_managed_certificate on a CREATE or UPDATE request. You must be + * authorized to administer the AuthorizedCertificate resource to manually + * map it to a DomainMapping resource. Example: 12345. + */ + certificateId: string; + /** + * Whether the mapped certificate is an App Engine managed certificate. + * Managed certificates are created by default with a domain mapping. To opt + * out, specify no_managed_certificate on a CREATE or UPDATE + * request.@OutputOnly + */ + isManagedCertificate: boolean; } - - getRoot() { - return this.root; + /** + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } + export class Resource$Apps { + root: Appengine; + authorizedCertificates: Resource$Apps$Authorizedcertificates; + authorizedDomains: Resource$Apps$Authorizeddomains; + domainMappings: Resource$Apps$Domainmappings; + locations: Resource$Apps$Locations; + operations: Resource$Apps$Operations; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.authorizedCertificates = + new Resource$Apps$Authorizedcertificates(root); + this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); + this.domainMappings = new Resource$Apps$Domainmappings(root); + this.locations = new Resource$Apps$Locations(root); + this.operations = new Resource$Apps$Operations(root); + } - /** - * appengine.apps.authorizedCertificates.create - * @desc Uploads the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Authorizedcertificates { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.authorizedCertificates.delete - * @desc Deletes the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.authorizedCertificates.create + * @desc Uploads the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.authorizedCertificates.get - * @desc Gets the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the GET response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.delete + * @desc Deletes the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.authorizedCertificates.list - * @desc Lists all SSL certificates the user is authorized to administer. - * @alias appengine.apps.authorizedCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string=} params.view Controls the set of fields returned in the LIST response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.get + * @desc Gets the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the GET response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * appengine.apps.authorizedCertificates.patch - * @desc Updates the specified SSL certificate. To renew a certificate and - * maintain its existing domain mappings, update certificate_data with a new - * certificate. The new certificate must be applicable to the same domains as - * the original certificate. The certificate display_name may also be updated. - * @alias appengine.apps.authorizedCertificates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.list + * @desc Lists all SSL certificates the user is authorized to administer. + * @alias appengine.apps.authorizedCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string=} params.view Controls the set of fields returned in the LIST response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Authorizeddomains { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.authorizedCertificates.patch + * @desc Updates the specified SSL certificate. To renew a certificate and + * maintain its existing domain mappings, update certificate_data with a new + * certificate. The new certificate must be applicable to the same domains + * as the original certificate. The certificate display_name may also be + * updated. + * @alias appengine.apps.authorizedCertificates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1alpha/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * appengine.apps.authorizedDomains.list - * @desc Lists all domains the user is authorized to administer. - * @alias appengine.apps.authorizedDomains.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps$Authorizeddomains { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedDomains') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Domainmappings { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.authorizedDomains.list + * @desc Lists all domains the user is authorized to administer. + * @alias appengine.apps.authorizedDomains.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/authorizedDomains') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * appengine.apps.domainMappings.create - * @desc Maps a domain to an application. A user must be authorized to - * administer a domain in order to map it to an application. For a list of - * available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. - * @alias appengine.apps.domainMappings.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {boolean=} params.noManagedCertificate Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manaually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. - * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Domainmappings { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.domainMappings.delete - * @desc Deletes the specified domain mapping. A user must be authorized to - * administer the associated domain in order to delete a DomainMapping - * resource. - * @alias appengine.apps.domainMappings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.domainMappings.create + * @desc Maps a domain to an application. A user must be authorized to + * administer a domain in order to map it to an application. For a list of + * available authorized domains, see + * AuthorizedDomains.ListAuthorizedDomains. + * @alias appengine.apps.domainMappings.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {boolean=} params.noManagedCertificate Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manaually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. + * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.domainMappings.get - * @desc Gets the specified domain mapping. - * @alias appengine.apps.domainMappings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.delete + * @desc Deletes the specified domain mapping. A user must be authorized to + * administer the associated domain in order to delete a DomainMapping + * resource. + * @alias appengine.apps.domainMappings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.domainMappings.list - * @desc Lists the domain mappings on an application. - * @alias appengine.apps.domainMappings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.get + * @desc Gets the specified domain mapping. + * @alias appengine.apps.domainMappings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.domainMappings.patch - * @desc Updates the specified domain mapping. To map an SSL certificate to a - * domain mapping, update certificate_id to point to an AuthorizedCertificate - * resource. A user must be authorized to administer the associated domain in - * order to update a DomainMapping resource. - * @alias appengine.apps.domainMappings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {boolean=} params.noManagedCertificate Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. Only applicable if ssl_settings.certificate_id is specified in the update mask. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.list + * @desc Lists the domain mappings on an application. + * @alias appengine.apps.domainMappings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Apps$Locations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.domainMappings.patch + * @desc Updates the specified domain mapping. To map an SSL certificate to + * a domain mapping, update certificate_id to point to an + * AuthorizedCertificate resource. A user must be authorized to administer + * the associated domain in order to update a DomainMapping resource. + * @alias appengine.apps.domainMappings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {boolean=} params.noManagedCertificate Whether a managed certificate should be provided by App Engine. If true, a certificate ID must be manually set in the DomainMapping resource to configure SSL for this domain. If false, a managed certificate will be provisioned and a certificate ID will be automatically populated. Only applicable if ssl_settings.certificate_id is specified in the update mask. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1alpha/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * appengine.apps.locations.get - * @desc Gets information about a location. - * @alias appengine.apps.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Resource name for the location. - * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps$Locations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/locations/{locationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'locationsId'], - pathParams: ['appsId', 'locationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.locations.list - * @desc Lists information about the supported locations for this service. - * @alias appengine.apps.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.locations.get + * @desc Gets information about a location. + * @alias appengine.apps.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Resource name for the location. + * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/locations/{locationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'locationsId'], + pathParams: ['appsId', 'locationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Operations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.locations.list + * @desc Lists information about the supported locations for this service. + * @alias appengine.apps.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * appengine.apps.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias appengine.apps.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation resource. - * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps$Operations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/operations/{operationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'operationsId'], - pathParams: ['appsId', 'operationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias appengine.apps.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias appengine.apps.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation resource. + * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha/apps/{appsId}/operations/{operationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'operationsId'], + pathParams: ['appsId', 'operationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/apps/{appsId}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias appengine.apps.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/apps/{appsId}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appengine/v1beta.ts b/src/apis/appengine/v1beta.ts index 5ced4a36b27..983ab507389 100644 --- a/src/apis/appengine/v1beta.ts +++ b/src/apis/appengine/v1beta.ts @@ -27,4316 +27,4359 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * App Engine Admin API - * - * The App Engine Admin API enables developers to provision and manage their App - * Engine applications. - * - * @example - * const google = require('googleapis'); - * const appengine = google.appengine('v1beta'); - * - * @namespace appengine - * @type {Function} - * @version v1beta - * @variation v1beta - * @param {object=} options Options for Appengine - */ -export class Appengine { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - apps: Resource$Apps; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.apps = new Resource$Apps(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for - * API handlers. - */ -export interface Schema$ApiConfigHandler { - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. Defaults to optional. - */ - login: string; - /** - * Path to the script from the application root directory. - */ - script: string; - /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; - /** - * URL to serve the endpoint at. - */ - url: string; -} -/** - * Uses Google Cloud Endpoints to handle requests. - */ -export interface Schema$ApiEndpointHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * An Application resource contains the top-level configuration of an App Engine - * application. - */ -export interface Schema$Application { - /** - * Google Apps authentication domain that controls which users can access this - * application.Defaults to open access for any Google Account. - */ - authDomain: string; - /** - * Google Cloud Storage bucket that can be used for storing files associated - * with this application. This bucket is associated with the application and - * can be used by the gcloud deployment commands.@OutputOnly - */ - codeBucket: string; - /** - * Google Cloud Storage bucket that can be used by this application to store - * content.@OutputOnly - */ - defaultBucket: string; - /** - * Cookie expiration policy for this application. - */ - defaultCookieExpiration: string; - /** - * Hostname used to reach this application, as resolved by App - * Engine.@OutputOnly - */ - defaultHostname: string; - /** - * HTTP path dispatch rules for requests to the application that do not - * explicitly target a service or version. Rules are order-dependent. Up to 20 - * dispatch rules can be supported.@OutputOnly - */ - dispatchRules: Schema$UrlDispatchRule[]; - /** - * The feature specific settings to be used in the application. - */ - featureSettings: Schema$FeatureSettings; - /** - * The Google Container Registry domain used for storing managed build docker - * images for this application. - */ - gcrDomain: string; - iap: Schema$IdentityAwareProxy; - /** - * Identifier of the Application resource. This identifier is equivalent to - * the project ID of the Google Cloud Platform project where you want to - * deploy your application. Example: myapp. - */ - id: string; - /** - * Location from which this application runs. Application instances run out of - * the data centers in the specified location, which is also where all of the - * application's end user content is stored.Defaults to us-central.View - * the list of supported locations - * (https://cloud.google.com/appengine/docs/locations). - */ - locationId: string; - /** - * Full path to the Application resource in the API. Example: - * apps/myapp.@OutputOnly - */ - name: string; - /** - * Serving status of this application. - */ - servingStatus: string; -} -/** - * An SSL certificate that a user has been authorized to administer. A user is - * authorized to administer any certificate that applies to one of their - * authorized domains. - */ -export interface Schema$AuthorizedCertificate { - /** - * The SSL certificate serving the AuthorizedCertificate resource. This must - * be obtained independently from a certificate authority. - */ - certificateRawData: Schema$CertificateRawData; - /** - * The user-specified display name of the certificate. This is not guaranteed - * to be unique. Example: My Certificate. - */ - displayName: string; - /** - * Aggregate count of the domain mappings with this certificate mapped. This - * count includes domain mappings on applications for which the user does not - * have VIEWER permissions.Only returned by GET or LIST requests when - * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly - */ - domainMappingsCount: number; - /** - * Topmost applicable domains of this certificate. This certificate applies to - * these domains and their subdomains. Example: example.com.@OutputOnly - */ - domainNames: string[]; - /** - * The time when this certificate expires. To update the renewal time on this - * certificate, upload an SSL certificate with a different expiration time - * using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly - */ - expireTime: string; - /** - * Relative name of the certificate. This is a unique value autogenerated on - * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly - */ - id: string; - /** - * Only applicable if this certificate is managed by App Engine. Managed - * certificates are tied to the lifecycle of a DomainMapping and cannot be - * updated or deleted via the AuthorizedCertificates API. If this certificate - * is manually administered by the user, this field will be empty.@OutputOnly - */ - managedCertificate: Schema$ManagedCertificate; - /** - * Full path to the AuthorizedCertificate resource in the API. Example: - * apps/myapp/authorizedCertificates/12345.@OutputOnly - */ - name: string; - /** - * The full paths to user visible Domain Mapping resources that have this - * certificate mapped. Example: apps/myapp/domainMappings/example.com.This may - * not represent the full list of mapped domain mappings if the user does not - * have VIEWER permissions on all of the applications that have this - * certificate mapped. See domain_mappings_count for a complete count.Only - * returned by GET or LIST requests when specifically requested by the - * view=FULL_CERTIFICATE option.@OutputOnly - */ - visibleDomainMappings: string[]; -} -/** - * A domain that a user has been authorized to administer. To authorize use of a - * domain, verify ownership via Webmaster Central - * (https://www.google.com/webmasters/verification/home). - */ -export interface Schema$AuthorizedDomain { - /** - * Fully qualified domain name of the domain authorized for use. Example: - * example.com. - */ - id: string; - /** - * Full path to the AuthorizedDomain resource in the API. Example: - * apps/myapp/authorizedDomains/example.com.@OutputOnly - */ - name: string; -} -/** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ -export interface Schema$AutomaticScaling { - /** - * Amount of time that the Autoscaler - * (https://cloud.google.com/compute/docs/autoscaler/) should wait between - * changes to the number of virtual machines. Only applicable in the App - * Engine flexible environment. - */ - coolDownPeriod: string; - /** - * Target scaling by CPU usage. - */ - cpuUtilization: Schema$CpuUtilization; - /** - * Target scaling by user-provided metrics. - */ - customMetrics: Schema$CustomMetric[]; - /** - * Target scaling by disk usage. - */ - diskUtilization: Schema$DiskUtilization; - /** - * Number of concurrent requests an automatic scaling instance can accept - * before the scheduler spawns a new instance.Defaults to a runtime-specific - * value. - */ - maxConcurrentRequests: number; - /** - * Maximum number of idle instances that should be maintained for this - * version. - */ - maxIdleInstances: number; - /** - * Maximum amount of time that a request should wait in the pending queue - * before starting a new instance to handle it. - */ - maxPendingLatency: string; - /** - * Maximum number of instances that should be started to handle requests for - * this version. - */ - maxTotalInstances: number; - /** - * Minimum number of idle instances that should be maintained for this - * version. Only applicable for the default version of a service. - */ - minIdleInstances: number; - /** - * Minimum amount of time a request should wait in the pending queue before - * starting a new instance to handle it. - */ - minPendingLatency: string; - /** - * Minimum number of running instances that should be maintained for this - * version. - */ - minTotalInstances: number; - /** - * Target scaling by network usage. - */ - networkUtilization: Schema$NetworkUtilization; - /** - * Target scaling by request utilization. - */ - requestUtilization: Schema$RequestUtilization; - /** - * Scheduler settings for standard environment. - */ - standardSchedulerSettings: Schema$StandardSchedulerSettings; -} -/** - * A service with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by user - * activity. - */ -export interface Schema$BasicScaling { - /** - * Duration of time after the last request that an instance must wait before - * the instance is shut down. - */ - idleTimeout: string; - /** - * Maximum number of instances to create for this version. - */ - maxInstances: number; -} -/** - * Request message for Firewall.BatchUpdateIngressRules. - */ -export interface Schema$BatchUpdateIngressRulesRequest { - /** - * A list of FirewallRules to replace the existing set. - */ - ingressRules: Schema$FirewallRule[]; -} -/** - * Response message for Firewall.UpdateAllIngressRules. - */ -export interface Schema$BatchUpdateIngressRulesResponse { - /** - * The full list of ingress FirewallRules for this application. - */ - ingressRules: Schema$FirewallRule[]; -} -/** - * Google Cloud Container Builder build information. - */ -export interface Schema$BuildInfo { - /** - * The Google Cloud Container Builder build id. Example: - * "f966068f-08b2-42c8-bdfe-74137dff2bf9" - */ - cloudBuildId: string; -} -/** - * An SSL certificate obtained from a certificate authority. - */ -export interface Schema$CertificateRawData { - /** - * Unencrypted PEM encoded RSA private key. This field is set once on - * certificate creation and then encrypted. The key size must be 2048 bits or - * fewer. Must include the header and footer. Example: <pre> -----BEGIN - * RSA PRIVATE KEY----- <unencrypted_key_value> -----END RSA PRIVATE - * KEY----- </pre> @InputOnly - */ - privateKey: string; - /** - * PEM encoded x.509 public key certificate. This field is set once on - * certificate creation. Must include the header and footer. Example: - * <pre> -----BEGIN CERTIFICATE----- <certificate_value> -----END - * CERTIFICATE----- </pre> - */ - publicCertificate: string; -} -/** - * Options for the build operations performed as a part of the version - * deployment. Only applicable for App Engine flexible environment when creating - * a version using source code directly. - */ -export interface Schema$CloudBuildOptions { - /** - * Path to the yaml file used in deployment, used to determine runtime - * configuration details.Required for flexible environment builds.See - * https://cloud.google.com/appengine/docs/standard/python/config/appref for - * more details. - */ - appYamlPath: string; - /** - * The Cloud Build timeout used as part of any dependent builds performed by - * version creation. Defaults to 10 minutes. - */ - cloudBuildTimeout: string; -} -/** - * Docker image that is used to create a container and start a VM instance for - * the version that you deploy. Only applicable for instances running in the App - * Engine flexible environment. - */ -export interface Schema$ContainerInfo { - /** - * URI to the hosted container image in Google Container Registry. The URI - * must be fully qualified and include a tag or digest. Examples: - * "gcr.io/my-project/image:tag" or - * "gcr.io/my-project/image@digest" - */ - image: string; -} -/** - * Target scaling by CPU usage. - */ -export interface Schema$CpuUtilization { - /** - * Period of time over which CPU utilization is calculated. - */ - aggregationWindowLength: string; - /** - * Target CPU utilization ratio to maintain when scaling. Must be between 0 - * and 1. - */ - targetUtilization: number; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1 { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1alpha.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Alpha { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1beta.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Beta { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Allows autoscaling based on Stackdriver metrics. - */ -export interface Schema$CustomMetric { - /** - * Allows filtering on the metric's fields. - */ - filter: string; - /** - * The name of the metric. - */ - metricName: string; - /** - * May be used instead of target_utilization when an instance can handle a - * specific amount of work/resources and the metric value is equal to the - * current amount of work remaining. The autoscaler will try to keep the - * number of instances equal to the metric value divided by - * single_instance_assignment. - */ - singleInstanceAssignment: number; - /** - * The type of the metric. Must be a string representing a Stackdriver metric - * type e.g. GAGUE, DELTA_PER_SECOND, etc. - */ - targetType: string; - /** - * The target value for the metric. - */ - targetUtilization: number; -} -/** - * Request message for Instances.DebugInstance. - */ -export interface Schema$DebugInstanceRequest { - /** - * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa - * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh - * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For - * more information, see Adding and Removing SSH Keys - * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). - */ - sshKey: string; -} -/** - * Code and application artifacts used to deploy a version to App Engine. - */ -export interface Schema$Deployment { - /** - * Google Cloud Container Builder build information. Only applicable for - * instances running in the App Engine flexible environment. - */ - build: Schema$BuildInfo; - /** - * Options for any Google Cloud Container Builder builds created as a part of - * this deployment.Note that this is orthogonal to the build parameter, where - * the deployment depends on an already existing cloud build. These options - * will only be used if a new build is created, such as when deploying to the - * App Engine flexible environment using files or zip. - */ - cloudBuildOptions: Schema$CloudBuildOptions; - /** - * The Docker image for the container that runs the version. Only applicable - * for instances running in the App Engine flexible environment. - */ - container: Schema$ContainerInfo; - /** - * Manifest of the files stored in Google Cloud Storage that are included as - * part of this version. All files must be readable using the credentials - * supplied with this call. - */ - files: any; - /** - * The zip file for this deployment, if this is a zip deployment. - */ - zip: Schema$ZipInfo; -} -/** - * Target scaling by disk usage. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$DiskUtilization { - /** - * Target bytes read per second. - */ - targetReadBytesPerSecond: number; - /** - * Target ops read per seconds. - */ - targetReadOpsPerSecond: number; - /** - * Target bytes written per second. - */ - targetWriteBytesPerSecond: number; - /** - * Target ops written per second. - */ - targetWriteOpsPerSecond: number; -} -/** - * A domain serving an App Engine application. - */ -export interface Schema$DomainMapping { - /** - * Relative name of the domain serving the application. Example: example.com. - */ - id: string; - /** - * Full path to the DomainMapping resource in the API. Example: - * apps/myapp/domainMapping/example.com.@OutputOnly - */ - name: string; - /** - * The resource records required to configure this domain mapping. These - * records must be added to the domain's DNS configuration in order to - * serve the application via this domain mapping.@OutputOnly - */ - resourceRecords: Schema$ResourceRecord[]; - /** - * SSL configuration for this domain. If unconfigured, this domain will not - * serve with SSL. - */ - sslSettings: Schema$SslSettings; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The - * Endpoints API Service provides tooling for serving Open API and gRPC - * endpoints via an NGINX proxy. Only valid for App Engine Flexible environment - * deployments.The fields here refer to the name and configuration id of a - * "service" resource in the Service Management API - * (https://cloud.google.com/service-management/overview). - */ -export interface Schema$EndpointsApiService { - /** - * Endpoints service configuration id as specified by the Service Management - * API. For example "2016-09-19r1"By default, the Endpoints service - * configuration id is fixed and config_id must be specified. To keep the - * Endpoints service configuration id updated with each rollout, specify - * RolloutStrategy.MANAGED and omit config_id. - */ - configId: string; - /** - * Endpoints service name which is the name of the "service" - * resource in the Service Management API. For example - * "myapi.endpoints.myproject.cloud.goog" - */ - name: string; - /** - * Endpoints rollout strategy. If FIXED, config_id must be specified. If - * MANAGED, config_id must be omitted. - */ - rolloutStrategy: string; -} -/** - * Custom static error page to be served when an error occurs. - */ -export interface Schema$ErrorHandler { - /** - * Error condition this handler applies to. - */ - errorCode: string; - /** - * MIME type of file. Defaults to text/html. - */ - mimeType: string; - /** - * Static file content to be served for this error. - */ - staticFile: string; -} -/** - * The feature specific settings to be used in the application. These define - * behaviors that are user configurable. - */ -export interface Schema$FeatureSettings { - /** - * Boolean value indicating if split health checks should be used instead of - * the legacy health checks. At an app.yaml level, this means defaulting to - * 'readiness_check' and 'liveness_check' values instead of - * 'health_check' ones. Once the legacy 'health_check' - * behavior is deprecated, and this value is always true, this setting can be - * removed. - */ - splitHealthChecks: boolean; - /** - * If true, use Container-Optimized OS - * (https://cloud.google.com/container-optimized-os/) base image for VMs, - * rather than a base Debian image. - */ - useContainerOptimizedOs: boolean; -} -/** - * Single source file that is part of the version to be deployed. Each source - * file that is deployed must be specified separately. - */ -export interface Schema$FileInfo { - /** - * The MIME type of the file.Defaults to the value from Google Cloud Storage. - */ - mimeType: string; - /** - * The SHA1 hash of the file, in hex. - */ - sha1Sum: string; - /** - * URL source to use to fetch this file. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. - */ - sourceUrl: string; -} -/** - * A single firewall rule that is evaluated against incoming traffic and - * provides an action to take on matched requests. - */ -export interface Schema$FirewallRule { - /** - * The action to take on matched requests. - */ - action: string; - /** - * An optional string description of this rule. This field has a maximum - * length of 100 characters. - */ - description: string; - /** - * A positive integer between 1, Int32.MaxValue-1 that defines the order of - * rule evaluation. Rules with the lowest priority are evaluated first.A - * default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic - * when no previous rule matches. Only the action of this rule can be modified - * by the user. - */ - priority: number; - /** - * IP address or range, defined using CIDR notation, of requests that this - * rule applies to. You can use the wildcard character "*" to match - * all IPs equivalent to "0/0" and "::/0" together. - * Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or - * 2001:0db8:0000:0042:0000:8a2e:0370:7334.<p>Truncation will be - * silently performed on addresses which are not properly truncated. For - * example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. - * Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as - * 2001:db8::/32. - */ - sourceRange: string; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. Only applicable for instances in App - * Engine flexible environment. - */ -export interface Schema$HealthCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Whether to explicitly disable health checks for this instance. - */ - disableHealthCheck: boolean; - /** - * Number of consecutive successful health checks required before receiving - * traffic. - */ - healthyThreshold: number; - /** - * Host header to send when performing an HTTP health check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * Number of consecutive failed health checks required before an instance is - * restarted. - */ - restartThreshold: number; - /** - * Time before the health check is considered failed. - */ - timeout: string; - /** - * Number of consecutive failed health checks required before removing - * traffic. - */ - unhealthyThreshold: number; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$IdentityAwareProxy { - /** - * Whether the serving infrastructure will authenticate and authorize all - * incoming requests.If true, the oauth2_client_id and oauth2_client_secret - * fields must be non-empty. - */ - enabled: boolean; - /** - * OAuth2 client ID to use for the authentication flow. - */ - oauth2ClientId: string; - /** - * OAuth2 client secret to use for the authentication flow.For security - * reasons, this value cannot be retrieved via the API. Instead, the SHA-256 - * hash of the value is returned in the oauth2_client_secret_sha256 - * field.@InputOnly - */ - oauth2ClientSecret: string; - /** - * Hex-encoded SHA-256 hash of the client secret.@OutputOnly - */ - oauth2ClientSecretSha256: string; -} -/** - * An Instance resource is the computing unit that App Engine uses to - * automatically scale an application. - */ -export interface Schema$Instance { - /** - * App Engine release this instance is running on.@OutputOnly - */ - appEngineRelease: string; - /** - * Availability of the instance.@OutputOnly - */ - availability: string; - /** - * Average latency (ms) over the last minute.@OutputOnly - */ - averageLatency: number; - /** - * Number of errors since this instance was started.@OutputOnly - */ - errors: number; - /** - * Relative name of the instance within the version. Example: - * instance-1.@OutputOnly - */ - id: string; - /** - * Total memory in use (bytes).@OutputOnly - */ - memoryUsage: string; - /** - * Full path to the Instance resource in the API. Example: - * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly - */ - name: string; - /** - * Average queries per second (QPS) over the last minute.@OutputOnly - */ - qps: number; - /** - * Number of requests since this instance was started.@OutputOnly - */ - requests: number; - /** - * Time that this instance was started.@OutputOnly - */ - startTime: string; - /** - * Whether this instance is in debug mode. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmDebugEnabled: boolean; - /** - * Virtual machine ID of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmId: string; - /** - * The IP address of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmIp: string; - /** - * Name of the virtual machine where this instance lives. Only applicable for - * instances in App Engine flexible environment.@OutputOnly - */ - vmName: string; - /** - * Status of the virtual machine where this instance lives. Only applicable - * for instances in App Engine flexible environment.@OutputOnly - */ - vmStatus: string; - /** - * Zone where the virtual machine is located. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmZoneName: string; -} -/** - * Third-party Python runtime library that is required by the application. - */ -export interface Schema$Library { - /** - * Name of the library. Example: "django". - */ - name: string; - /** - * Version of the library to select, or "latest". - */ - version: string; -} -/** - * Response message for AuthorizedCertificates.ListAuthorizedCertificates. - */ -export interface Schema$ListAuthorizedCertificatesResponse { - /** - * The SSL certificates the user is authorized to administer. - */ - certificates: Schema$AuthorizedCertificate[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for AuthorizedDomains.ListAuthorizedDomains. - */ -export interface Schema$ListAuthorizedDomainsResponse { - /** - * The authorized domains belonging to the user. - */ - domains: Schema$AuthorizedDomain[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for DomainMappings.ListDomainMappings. - */ -export interface Schema$ListDomainMappingsResponse { - /** - * The domain mappings for the application. - */ - domainMappings: Schema$DomainMapping[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for Firewall.ListIngressRules. - */ -export interface Schema$ListIngressRulesResponse { - /** - * The ingress FirewallRules for this application. - */ - ingressRules: Schema$FirewallRule[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for Instances.ListInstances. - */ -export interface Schema$ListInstancesResponse { - /** - * The instances belonging to the requested version. - */ - instances: Schema$Instance[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for Services.ListServices. - */ -export interface Schema$ListServicesResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The services belonging to the requested application. - */ - services: Schema$Service[]; -} -/** - * Response message for Versions.ListVersions. - */ -export interface Schema$ListVersionsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The versions belonging to the requested service. - */ - versions: Schema$Version[]; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. - */ -export interface Schema$LivenessCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Number of consecutive failed checks required before considering the VM - * unhealthy. - */ - failureThreshold: number; - /** - * Host header to send when performing a HTTP Liveness check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * The initial delay before starting to execute the checks. - */ - initialDelay: string; - /** - * The request path. - */ - path: string; - /** - * Number of consecutive successful checks required before considering the VM - * healthy. - */ - successThreshold: number; - /** - * Time before the check is considered failed. - */ - timeout: string; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: "us-east1". - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: "projects/example-project/locations/us-east1" - */ - name: string; -} -/** - * Metadata for the given google.cloud.location.Location. - */ -export interface Schema$LocationMetadata { - /** - * App Engine flexible environment is available in the given - * location.@OutputOnly - */ - flexibleEnvironmentAvailable: boolean; - /** - * App Engine standard environment is available in the given - * location.@OutputOnly - */ - standardEnvironmentAvailable: boolean; -} -/** - * A certificate managed by App Engine. - */ -export interface Schema$ManagedCertificate { - /** - * Time at which the certificate was last renewed. The renewal process is - * fully managed. Certificate renewal will automatically occur before the - * certificate expires. Renewal errors can be tracked via - * ManagementStatus.@OutputOnly - */ - lastRenewalTime: string; - /** - * Status of certificate management. Refers to the most recent certificate - * acquisition or renewal attempt.@OutputOnly - */ - status: string; -} -/** - * A service with manual scaling runs continuously, allowing you to perform - * complex initialization and rely on the state of its memory over time. - */ -export interface Schema$ManualScaling { - /** - * Number of instances to assign to the service at the start. This number can - * later be altered by using the Modules API - * (https://cloud.google.com/appengine/docs/python/modules/functions) - * set_num_instances() function. - */ - instances: number; -} -/** - * Extra network settings. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$Network { - /** - * List of ports, or port pairs, to forward from the virtual machine to the - * application container. Only applicable in the App Engine flexible - * environment. - */ - forwardedPorts: string[]; - /** - * Tag to apply to the instance during creation. Only applicable in the App - * Engine flexible environment. - */ - instanceTag: string; - /** - * Google Compute Engine network where the virtual machines are created. - * Specify the short name, not the resource path.Defaults to default. - */ - name: string; - /** - * Enable session affinity. - */ - sessionAffinity: boolean; - /** - * Google Cloud Platform sub-network where the virtual machines are created. - * Specify the short name, not the resource path.If a subnetwork name is - * specified, a network name will also be required unless it is for the - * default network. If the network that the instance is being created in is a - * Legacy network, then the IP address is allocated from the IPv4Range. If the - * network that the instance is being created in is an auto Subnet Mode - * Network, then only network name should be specified (not the - * subnetwork_name) and the IP address is created from the IPCidrRange of the - * subnetwork that exists in that zone for that network. If the network that - * the instance is being created in is a custom Subnet Mode Network, then the - * subnetwork_name must be specified and the IP address is created from the - * IPCidrRange of the subnetwork.If specified, the subnetwork must exist in - * the same region as the App Engine flexible environment application. - */ - subnetworkName: string; -} -/** - * Target scaling by network usage. Only applicable in the App Engine flexible - * environment. - */ -export interface Schema$NetworkUtilization { - /** - * Target bytes received per second. - */ - targetReceivedBytesPerSecond: number; - /** - * Target packets received per second. - */ - targetReceivedPacketsPerSecond: number; - /** - * Target bytes sent per second. - */ - targetSentBytesPerSecond: number; - /** - * Target packets sent per second. - */ - targetSentPacketsPerSecond: number; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadata { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Type of this operation. Deprecated, use method field instead. Example: - * "create_version".@OutputOnly - */ - operationType: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/modules/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1 { - createVersionMetadata: Schema$CreateVersionMetadataV1; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Alpha { - createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta { - createVersionMetadata: Schema$CreateVersionMetadataV1Beta; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta5 { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method name that initiated this operation. Example: - * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Readiness checking configuration for VM instances. Unhealthy instances are - * removed from traffic rotation. - */ -export interface Schema$ReadinessCheck { - /** - * A maximum time limit on application initialization, measured from moment - * the application successfully replies to a healthcheck until it is ready to - * serve traffic. - */ - appStartTimeout: string; - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Number of consecutive failed checks required before removing traffic. - */ - failureThreshold: number; - /** - * Host header to send when performing a HTTP Readiness check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * The request path. - */ - path: string; +export namespace appengine_v1beta { /** - * Number of consecutive successful checks required before receiving traffic. - */ - successThreshold: number; - /** - * Time before the check is considered failed. - */ - timeout: string; -} -/** - * Request message for 'Applications.RepairApplication'. - */ -export interface Schema$RepairApplicationRequest {} -/** - * Target scaling by request utilization. Only applicable in the App Engine - * flexible environment. - */ -export interface Schema$RequestUtilization { - /** - * Target number of concurrent requests. - */ - targetConcurrentRequests: number; - /** - * Target requests per second. - */ - targetRequestCountPerSecond: number; -} -/** - * A DNS resource record. - */ -export interface Schema$ResourceRecord { - /** - * Relative name of the object affected by this record. Only applicable for - * CNAME records. Example: 'www'. - */ - name: string; - /** - * Data for this record. Values vary by record type, as defined in RFC 1035 - * (section 5) and RFC 1034 (section 3.6.1). - */ - rrdata: string; - /** - * Resource record type. Example: AAAA. - */ - type: string; -} -/** - * Machine resources for a version. - */ -export interface Schema$Resources { - /** - * Number of CPU cores needed. - */ - cpu: number; - /** - * Disk size (GB) needed. - */ - diskGb: number; - /** - * Memory (GB) needed. - */ - memoryGb: number; - /** - * User specified volumes. - */ - volumes: Schema$Volume[]; -} -/** - * Executes a script to handle the request that matches the URL pattern. - */ -export interface Schema$ScriptHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * A Service resource is a logical component of an application that can share - * state and communicate in a secure fashion with other services. For example, - * an application that handles customer requests might include separate services - * to handle tasks such as backend data analysis or API requests from mobile - * devices. Each service has a collection of versions that define a specific set - * of code used to implement the functionality of that service. - */ -export interface Schema$Service { - /** - * Relative name of the service within the application. Example: - * default.@OutputOnly - */ - id: string; - /** - * Full path to the Service resource in the API. Example: - * apps/myapp/services/default.@OutputOnly - */ - name: string; - /** - * Mapping that defines fractional HTTP traffic diversion to different - * versions within the service. - */ - split: Schema$TrafficSplit; -} -/** - * SSL configuration for a DomainMapping resource. - */ -export interface Schema$SslSettings { - /** - * ID of the AuthorizedCertificate resource configuring SSL for the - * application. Clearing this field will remove SSL support.By default, a - * managed certificate is automatically created for every domain mapping. To - * omit SSL support or to configure SSL manually, specify - * SslManagementType.MANUAL on a CREATE or UPDATE request. You must be - * authorized to administer the AuthorizedCertificate resource to manually map - * it to a DomainMapping resource. Example: 12345. - */ - certificateId: string; - /** - * ID of the managed AuthorizedCertificate resource currently being - * provisioned, if applicable. Until the new managed certificate has been - * successfully provisioned, the previous SSL state will be preserved. Once - * the provisioning process completes, the certificate_id field will reflect - * the new managed certificate and this field will be left empty. To remove - * SSL support while there is still a pending managed certificate, clear the - * certificate_id field with an UpdateDomainMappingRequest.@OutputOnly - */ - pendingManagedCertificateId: string; - /** - * SSL management type for this domain. If AUTOMATIC, a managed certificate is - * automatically provisioned. If MANUAL, certificate_id must be manually - * specified in order to configure SSL for this domain. - */ - sslManagementType: string; -} -/** - * Scheduler settings for standard environment. - */ -export interface Schema$StandardSchedulerSettings { - /** - * Maximum number of instances to run for this version. Set to zero to disable - * max_instances configuration. - */ - maxInstances: number; - /** - * Minimum number of instances to run for this version. Set to zero to disable - * min_instances configuration. - */ - minInstances: number; - /** - * Target CPU utilization ratio to maintain when scaling. - */ - targetCpuUtilization: number; + * App Engine Admin API + * + * The App Engine Admin API enables developers to provision and manage their + * App Engine applications. + * + * @example + * const google = require('googleapis'); + * const appengine = google.appengine('v1beta'); + * + * @namespace appengine + * @type {Function} + * @version v1beta + * @variation v1beta + * @param {object=} options Options for Appengine + */ + export class Appengine { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + apps: Resource$Apps; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.apps = new Resource$Apps(this); + } + + getRoot() { + return this.root; + } + } + /** - * Target throughput utilization ratio to maintain when scaling - */ - targetThroughputUtilization: number; -} -/** - * Files served directly to the user for a given URL, such as images, CSS - * stylesheets, or JavaScript source files. Static file handlers describe which - * files in the application directory are static files, and which URLs serve - * them. - */ -export interface Schema$StaticFilesHandler { + * Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration + * for API handlers. + */ + export interface Schema$ApiConfigHandler { + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. Defaults to optional. + */ + login: string; + /** + * Path to the script from the application root directory. + */ + script: string; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * URL to serve the endpoint at. + */ + url: string; + } /** - * Whether files should also be uploaded as code data. By default, files - * declared in static file handlers are uploaded as static data and are only - * served to end users; they cannot be read by the application. If enabled, - * uploads are charged against both your code and static data storage resource - * quotas. + * Uses Google Cloud Endpoints to handle requests. */ - applicationReadable: boolean; + export interface Schema$ApiEndpointHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * Time a static file served by this handler should be cached by web proxies - * and browsers. - */ - expiration: string; + * An Application resource contains the top-level configuration of an App + * Engine application. + */ + export interface Schema$Application { + /** + * Google Apps authentication domain that controls which users can access + * this application.Defaults to open access for any Google Account. + */ + authDomain: string; + /** + * Google Cloud Storage bucket that can be used for storing files associated + * with this application. This bucket is associated with the application and + * can be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket: string; + /** + * Google Cloud Storage bucket that can be used by this application to store + * content.@OutputOnly + */ + defaultBucket: string; + /** + * Cookie expiration policy for this application. + */ + defaultCookieExpiration: string; + /** + * Hostname used to reach this application, as resolved by App + * Engine.@OutputOnly + */ + defaultHostname: string; + /** + * HTTP path dispatch rules for requests to the application that do not + * explicitly target a service or version. Rules are order-dependent. Up to + * 20 dispatch rules can be supported.@OutputOnly + */ + dispatchRules: Schema$UrlDispatchRule[]; + /** + * The feature specific settings to be used in the application. + */ + featureSettings: Schema$FeatureSettings; + /** + * The Google Container Registry domain used for storing managed build + * docker images for this application. + */ + gcrDomain: string; + iap: Schema$IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to + * the project ID of the Google Cloud Platform project where you want to + * deploy your application. Example: myapp. + */ + id: string; + /** + * Location from which this application runs. Application instances run out + * of the data centers in the specified location, which is also where all of + * the application's end user content is stored.Defaults to + * us-central.View the list of supported locations + * (https://cloud.google.com/appengine/docs/locations). + */ + locationId: string; + /** + * Full path to the Application resource in the API. Example: + * apps/myapp.@OutputOnly + */ + name: string; + /** + * Serving status of this application. + */ + servingStatus: string; + } /** - * HTTP headers to use for all responses from these URLs. - */ - httpHeaders: any; + * An SSL certificate that a user has been authorized to administer. A user is + * authorized to administer any certificate that applies to one of their + * authorized domains. + */ + export interface Schema$AuthorizedCertificate { + /** + * The SSL certificate serving the AuthorizedCertificate resource. This must + * be obtained independently from a certificate authority. + */ + certificateRawData: Schema$CertificateRawData; + /** + * The user-specified display name of the certificate. This is not + * guaranteed to be unique. Example: My Certificate. + */ + displayName: string; + /** + * Aggregate count of the domain mappings with this certificate mapped. This + * count includes domain mappings on applications for which the user does + * not have VIEWER permissions.Only returned by GET or LIST requests when + * specifically requested by the view=FULL_CERTIFICATE option.@OutputOnly + */ + domainMappingsCount: number; + /** + * Topmost applicable domains of this certificate. This certificate applies + * to these domains and their subdomains. Example: example.com.@OutputOnly + */ + domainNames: string[]; + /** + * The time when this certificate expires. To update the renewal time on + * this certificate, upload an SSL certificate with a different expiration + * time using AuthorizedCertificates.UpdateAuthorizedCertificate.@OutputOnly + */ + expireTime: string; + /** + * Relative name of the certificate. This is a unique value autogenerated on + * AuthorizedCertificate resource creation. Example: 12345.@OutputOnly + */ + id: string; + /** + * Only applicable if this certificate is managed by App Engine. Managed + * certificates are tied to the lifecycle of a DomainMapping and cannot be + * updated or deleted via the AuthorizedCertificates API. If this + * certificate is manually administered by the user, this field will be + * empty.@OutputOnly + */ + managedCertificate: Schema$ManagedCertificate; + /** + * Full path to the AuthorizedCertificate resource in the API. Example: + * apps/myapp/authorizedCertificates/12345.@OutputOnly + */ + name: string; + /** + * The full paths to user visible Domain Mapping resources that have this + * certificate mapped. Example: apps/myapp/domainMappings/example.com.This + * may not represent the full list of mapped domain mappings if the user + * does not have VIEWER permissions on all of the applications that have + * this certificate mapped. See domain_mappings_count for a complete + * count.Only returned by GET or LIST requests when specifically requested + * by the view=FULL_CERTIFICATE option.@OutputOnly + */ + visibleDomainMappings: string[]; + } /** - * MIME type used to serve all files served by this handler.Defaults to - * file-specific MIME types, which are derived from each file's filename - * extension. - */ - mimeType: string; + * A domain that a user has been authorized to administer. To authorize use of + * a domain, verify ownership via Webmaster Central + * (https://www.google.com/webmasters/verification/home). + */ + export interface Schema$AuthorizedDomain { + /** + * Fully qualified domain name of the domain authorized for use. Example: + * example.com. + */ + id: string; + /** + * Full path to the AuthorizedDomain resource in the API. Example: + * apps/myapp/authorizedDomains/example.com.@OutputOnly + */ + name: string; + } /** - * Path to the static files matched by the URL pattern, from the application - * root directory. The path can refer to text matched in groupings in the URL - * pattern. + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. */ - path: string; + export interface Schema$AutomaticScaling { + /** + * Amount of time that the Autoscaler + * (https://cloud.google.com/compute/docs/autoscaler/) should wait between + * changes to the number of virtual machines. Only applicable in the App + * Engine flexible environment. + */ + coolDownPeriod: string; + /** + * Target scaling by CPU usage. + */ + cpuUtilization: Schema$CpuUtilization; + /** + * Target scaling by user-provided metrics. + */ + customMetrics: Schema$CustomMetric[]; + /** + * Target scaling by disk usage. + */ + diskUtilization: Schema$DiskUtilization; + /** + * Number of concurrent requests an automatic scaling instance can accept + * before the scheduler spawns a new instance.Defaults to a runtime-specific + * value. + */ + maxConcurrentRequests: number; + /** + * Maximum number of idle instances that should be maintained for this + * version. + */ + maxIdleInstances: number; + /** + * Maximum amount of time that a request should wait in the pending queue + * before starting a new instance to handle it. + */ + maxPendingLatency: string; + /** + * Maximum number of instances that should be started to handle requests for + * this version. + */ + maxTotalInstances: number; + /** + * Minimum number of idle instances that should be maintained for this + * version. Only applicable for the default version of a service. + */ + minIdleInstances: number; + /** + * Minimum amount of time a request should wait in the pending queue before + * starting a new instance to handle it. + */ + minPendingLatency: string; + /** + * Minimum number of running instances that should be maintained for this + * version. + */ + minTotalInstances: number; + /** + * Target scaling by network usage. + */ + networkUtilization: Schema$NetworkUtilization; + /** + * Target scaling by request utilization. + */ + requestUtilization: Schema$RequestUtilization; + /** + * Scheduler settings for standard environment. + */ + standardSchedulerSettings: Schema$StandardSchedulerSettings; + } /** - * Whether this handler should match the request if the file referenced by the - * handler does not exist. + * A service with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. */ - requireMatchingFile: boolean; + export interface Schema$BasicScaling { + /** + * Duration of time after the last request that an instance must wait before + * the instance is shut down. + */ + idleTimeout: string; + /** + * Maximum number of instances to create for this version. + */ + maxInstances: number; + } /** - * Regular expression that matches the file paths for all files that should be - * referenced by this handler. + * Request message for Firewall.BatchUpdateIngressRules. */ - uploadPathRegex: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$BatchUpdateIngressRulesRequest { + /** + * A list of FirewallRules to replace the existing set. + */ + ingressRules: Schema$FirewallRule[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Response message for Firewall.UpdateAllIngressRules. */ - code: number; + export interface Schema$BatchUpdateIngressRulesResponse { + /** + * The full list of ingress FirewallRules for this application. + */ + ingressRules: Schema$FirewallRule[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Google Cloud Container Builder build information. */ - details: any[]; + export interface Schema$BuildInfo { + /** + * The Google Cloud Container Builder build id. Example: + * "f966068f-08b2-42c8-bdfe-74137dff2bf9" + */ + cloudBuildId: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Traffic routing configuration for versions within a single service. Traffic - * splits define how traffic directed to the service is assigned to versions. - */ -export interface Schema$TrafficSplit { + * An SSL certificate obtained from a certificate authority. + */ + export interface Schema$CertificateRawData { + /** + * Unencrypted PEM encoded RSA private key. This field is set once on + * certificate creation and then encrypted. The key size must be 2048 bits + * or fewer. Must include the header and footer. Example: <pre> + * -----BEGIN RSA PRIVATE KEY----- <unencrypted_key_value> -----END + * RSA PRIVATE KEY----- </pre> @InputOnly + */ + privateKey: string; + /** + * PEM encoded x.509 public key certificate. This field is set once on + * certificate creation. Must include the header and footer. Example: + * <pre> -----BEGIN CERTIFICATE----- <certificate_value> + * -----END CERTIFICATE----- </pre> + */ + publicCertificate: string; + } /** - * Mapping from version IDs within the service to fractional (0.000, 1] - * allocations of traffic for that version. Each version can be specified only - * once, but some versions in the service may not have any traffic allocation. - * Services that have traffic allocated cannot be deleted until either the - * service is deleted or their traffic allocation is removed. Allocations must - * sum to 1. Up to two decimal place precision is supported for IP-based - * splits and up to three decimal places is supported for cookie-based splits. - */ - allocations: any; + * Options for the build operations performed as a part of the version + * deployment. Only applicable for App Engine flexible environment when + * creating a version using source code directly. + */ + export interface Schema$CloudBuildOptions { + /** + * Path to the yaml file used in deployment, used to determine runtime + * configuration details.Required for flexible environment builds.See + * https://cloud.google.com/appengine/docs/standard/python/config/appref for + * more details. + */ + appYamlPath: string; + /** + * The Cloud Build timeout used as part of any dependent builds performed by + * version creation. Defaults to 10 minutes. + */ + cloudBuildTimeout: string; + } /** - * Mechanism used to determine which version a request is sent to. The traffic - * selection algorithm will be stable for either type until allocations are - * changed. + * Docker image that is used to create a container and start a VM instance for + * the version that you deploy. Only applicable for instances running in the + * App Engine flexible environment. */ - shardBy: string; -} -/** - * Rules to match an HTTP request and dispatch that request to a service. - */ -export interface Schema$UrlDispatchRule { + export interface Schema$ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI + * must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or + * "gcr.io/my-project/image@digest" + */ + image: string; + } /** - * Domain name to match against. The wildcard "*" is supported if - * specified before a period: "*.".Defaults to matching all domains: - * "*". + * Target scaling by CPU usage. */ - domain: string; + export interface Schema$CpuUtilization { + /** + * Period of time over which CPU utilization is calculated. + */ + aggregationWindowLength: string; + /** + * Target CPU utilization ratio to maintain when scaling. Must be between 0 + * and 1. + */ + targetUtilization: number; + } /** - * Pathname within the host. Must start with a "/". A single - * "*" can be included at the end of the path.The sum of the lengths - * of the domain and path may not exceed 100 characters. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1.CreateVersionRequest. */ - path: string; + export interface Schema$CreateVersionMetadataV1 { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Resource ID of a service in this application that should serve the matched - * request. The service must already exist. Example: default. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1alpha.CreateVersionRequest. */ - service: string; -} -/** - * URL pattern and description of how the URL should be handled. App Engine can - * handle URLs by executing application code or by serving static files uploaded - * with the version, such as images, CSS, or JavaScript. - */ -export interface Schema$UrlMap { + export interface Schema$CreateVersionMetadataV1Alpha { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Uses API Endpoints to handle requests. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1beta.CreateVersionRequest. */ - apiEndpoint: Schema$ApiEndpointHandler; + export interface Schema$CreateVersionMetadataV1Beta { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; + * Allows autoscaling based on Stackdriver metrics. + */ + export interface Schema$CustomMetric { + /** + * Allows filtering on the metric's fields. + */ + filter: string; + /** + * The name of the metric. + */ + metricName: string; + /** + * May be used instead of target_utilization when an instance can handle a + * specific amount of work/resources and the metric value is equal to the + * current amount of work remaining. The autoscaler will try to keep the + * number of instances equal to the metric value divided by + * single_instance_assignment. + */ + singleInstanceAssignment: number; + /** + * The type of the metric. Must be a string representing a Stackdriver + * metric type e.g. GAGUE, DELTA_PER_SECOND, etc. + */ + targetType: string; + /** + * The target value for the metric. + */ + targetUtilization: number; + } /** - * Level of login required to access this resource. - */ - login: string; + * Request message for Instances.DebugInstance. + */ + export interface Schema$DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa + * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh + * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For + * more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey: string; + } /** - * 30x code to use when performing redirects for the secure field. Defaults to - * 302. - */ - redirectHttpResponseCode: string; + * Code and application artifacts used to deploy a version to App Engine. + */ + export interface Schema$Deployment { + /** + * Google Cloud Container Builder build information. Only applicable for + * instances running in the App Engine flexible environment. + */ + build: Schema$BuildInfo; + /** + * Options for any Google Cloud Container Builder builds created as a part + * of this deployment.Note that this is orthogonal to the build parameter, + * where the deployment depends on an already existing cloud build. These + * options will only be used if a new build is created, such as when + * deploying to the App Engine flexible environment using files or zip. + */ + cloudBuildOptions: Schema$CloudBuildOptions; + /** + * The Docker image for the container that runs the version. Only applicable + * for instances running in the App Engine flexible environment. + */ + container: Schema$ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as + * part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files: any; + /** + * The zip file for this deployment, if this is a zip deployment. + */ + zip: Schema$ZipInfo; + } /** - * Executes a script to handle the request that matches this URL pattern. + * Target scaling by disk usage. Only applicable in the App Engine flexible + * environment. */ - script: Schema$ScriptHandler; + export interface Schema$DiskUtilization { + /** + * Target bytes read per second. + */ + targetReadBytesPerSecond: number; + /** + * Target ops read per seconds. + */ + targetReadOpsPerSecond: number; + /** + * Target bytes written per second. + */ + targetWriteBytesPerSecond: number; + /** + * Target ops written per second. + */ + targetWriteOpsPerSecond: number; + } /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; + * A domain serving an App Engine application. + */ + export interface Schema$DomainMapping { + /** + * Relative name of the domain serving the application. Example: + * example.com. + */ + id: string; + /** + * Full path to the DomainMapping resource in the API. Example: + * apps/myapp/domainMapping/example.com.@OutputOnly + */ + name: string; + /** + * The resource records required to configure this domain mapping. These + * records must be added to the domain's DNS configuration in order to + * serve the application via this domain mapping.@OutputOnly + */ + resourceRecords: Schema$ResourceRecord[]; + /** + * SSL configuration for this domain. If unconfigured, this domain will not + * serve with SSL. + */ + sslSettings: Schema$SslSettings; + } /** - * Returns the contents of a file, such as an image, as the response. - */ - staticFiles: Schema$StaticFilesHandler; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The + * Endpoints API Service provides tooling for serving Open API and gRPC + * endpoints via an NGINX proxy. Only valid for App Engine Flexible + * environment deployments.The fields here refer to the name and configuration + * id of a "service" resource in the Service Management API + * (https://cloud.google.com/service-management/overview). + */ + export interface Schema$EndpointsApiService { + /** + * Endpoints service configuration id as specified by the Service Management + * API. For example "2016-09-19r1"By default, the Endpoints + * service configuration id is fixed and config_id must be specified. To + * keep the Endpoints service configuration id updated with each rollout, + * specify RolloutStrategy.MANAGED and omit config_id. + */ + configId: string; + /** + * Endpoints service name which is the name of the "service" + * resource in the Service Management API. For example + * "myapi.endpoints.myproject.cloud.goog" + */ + name: string; + /** + * Endpoints rollout strategy. If FIXED, config_id must be specified. If + * MANAGED, config_id must be omitted. + */ + rolloutStrategy: string; + } /** - * URL prefix. Uses regular expression syntax, which means regexp special - * characters must be escaped, but should not contain groupings. All URLs that - * begin with this prefix are handled by this handler, using the portion of - * the URL after the prefix as part of the file path. - */ - urlRegex: string; -} -/** - * A Version resource is a specific set of source code and configuration files - * that are deployed into a service. - */ -export interface Schema$Version { + * Custom static error page to be served when an error occurs. + */ + export interface Schema$ErrorHandler { + /** + * Error condition this handler applies to. + */ + errorCode: string; + /** + * MIME type of file. Defaults to text/html. + */ + mimeType: string; + /** + * Static file content to be served for this error. + */ + staticFile: string; + } /** - * Serving configuration for Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned - * in GET requests if view=FULL is set. - */ - apiConfig: Schema$ApiConfigHandler; + * The feature specific settings to be used in the application. These define + * behaviors that are user configurable. + */ + export interface Schema$FeatureSettings { + /** + * Boolean value indicating if split health checks should be used instead of + * the legacy health checks. At an app.yaml level, this means defaulting to + * 'readiness_check' and 'liveness_check' values instead of + * 'health_check' ones. Once the legacy 'health_check' + * behavior is deprecated, and this value is always true, this setting can + * be removed. + */ + splitHealthChecks: boolean; + /** + * If true, use Container-Optimized OS + * (https://cloud.google.com/container-optimized-os/) base image for VMs, + * rather than a base Debian image. + */ + useContainerOptimizedOs: boolean; + } /** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ - automaticScaling: Schema$AutomaticScaling; + * Single source file that is part of the version to be deployed. Each source + * file that is deployed must be specified separately. + */ + export interface Schema$FileInfo { + /** + * The MIME type of the file.Defaults to the value from Google Cloud + * Storage. + */ + mimeType: string; + /** + * The SHA1 hash of the file, in hex. + */ + sha1Sum: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in + * Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; + } /** - * A service with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by - * user activity. - */ - basicScaling: Schema$BasicScaling; + * A single firewall rule that is evaluated against incoming traffic and + * provides an action to take on matched requests. + */ + export interface Schema$FirewallRule { + /** + * The action to take on matched requests. + */ + action: string; + /** + * An optional string description of this rule. This field has a maximum + * length of 100 characters. + */ + description: string; + /** + * A positive integer between 1, Int32.MaxValue-1 that defines the order of + * rule evaluation. Rules with the lowest priority are evaluated first.A + * default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic + * when no previous rule matches. Only the action of this rule can be + * modified by the user. + */ + priority: number; + /** + * IP address or range, defined using CIDR notation, of requests that this + * rule applies to. You can use the wildcard character "*" to + * match all IPs equivalent to "0/0" and "::/0" + * together. Examples: 192.168.1.1 or 192.168.0.0/16 or 2001:db8::/32 or + * 2001:0db8:0000:0042:0000:8a2e:0370:7334.<p>Truncation will be + * silently performed on addresses which are not properly truncated. For + * example, 1.2.3.4/24 is accepted as the same address as 1.2.3.0/24. + * Similarly, for IPv6, 2001:db8::1/32 is accepted as the same address as + * 2001:db8::/32. + */ + sourceRange: string; + } /** - * Metadata settings that are supplied to this version to enable beta runtime - * features. + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. Only applicable for instances in + * App Engine flexible environment. */ - betaSettings: any; + export interface Schema$HealthCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Whether to explicitly disable health checks for this instance. + */ + disableHealthCheck: boolean; + /** + * Number of consecutive successful health checks required before receiving + * traffic. + */ + healthyThreshold: number; + /** + * Host header to send when performing an HTTP health check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * Number of consecutive failed health checks required before an instance is + * restarted. + */ + restartThreshold: number; + /** + * Time before the health check is considered failed. + */ + timeout: string; + /** + * Number of consecutive failed health checks required before removing + * traffic. + */ + unhealthyThreshold: number; + } /** - * Email address of the user who created this version.@OutputOnly - */ - createdBy: string; + * Identity-Aware Proxy + */ + export interface Schema$IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all + * incoming requests.If true, the oauth2_client_id and oauth2_client_secret + * fields must be non-empty. + */ + enabled: boolean; + /** + * OAuth2 client ID to use for the authentication flow. + */ + oauth2ClientId: string; + /** + * OAuth2 client secret to use for the authentication flow.For security + * reasons, this value cannot be retrieved via the API. Instead, the SHA-256 + * hash of the value is returned in the oauth2_client_secret_sha256 + * field.@InputOnly + */ + oauth2ClientSecret: string; + /** + * Hex-encoded SHA-256 hash of the client secret.@OutputOnly + */ + oauth2ClientSecretSha256: string; + } /** - * Time that this version was created.@OutputOnly - */ - createTime: string; + * An Instance resource is the computing unit that App Engine uses to + * automatically scale an application. + */ + export interface Schema$Instance { + /** + * App Engine release this instance is running on.@OutputOnly + */ + appEngineRelease: string; + /** + * Availability of the instance.@OutputOnly + */ + availability: string; + /** + * Average latency (ms) over the last minute.@OutputOnly + */ + averageLatency: number; + /** + * Number of errors since this instance was started.@OutputOnly + */ + errors: number; + /** + * Relative name of the instance within the version. Example: + * instance-1.@OutputOnly + */ + id: string; + /** + * Total memory in use (bytes).@OutputOnly + */ + memoryUsage: string; + /** + * Full path to the Instance resource in the API. Example: + * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly + */ + name: string; + /** + * Average queries per second (QPS) over the last minute.@OutputOnly + */ + qps: number; + /** + * Number of requests since this instance was started.@OutputOnly + */ + requests: number; + /** + * Time that this instance was started.@OutputOnly + */ + startTime: string; + /** + * Whether this instance is in debug mode. Only applicable for instances in + * App Engine flexible environment.@OutputOnly + */ + vmDebugEnabled: boolean; + /** + * Virtual machine ID of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmId: string; + /** + * The IP address of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmIp: string; + /** + * Name of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmName: string; + /** + * Status of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmStatus: string; + /** + * Zone where the virtual machine is located. Only applicable for instances + * in App Engine flexible environment.@OutputOnly + */ + vmZoneName: string; + } /** - * Duration that static files should be cached by web proxies and browsers. - * Only applicable if the corresponding StaticFilesHandler - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#staticfileshandler) - * does not specify its own expiration time.Only returned in GET requests if - * view=FULL is set. - */ - defaultExpiration: string; + * Third-party Python runtime library that is required by the application. + */ + export interface Schema$Library { + /** + * Name of the library. Example: "django". + */ + name: string; + /** + * Version of the library to select, or "latest". + */ + version: string; + } /** - * Code and application artifacts that make up this version.Only returned in - * GET requests if view=FULL is set. - */ - deployment: Schema$Deployment; + * Response message for AuthorizedCertificates.ListAuthorizedCertificates. + */ + export interface Schema$ListAuthorizedCertificatesResponse { + /** + * The SSL certificates the user is authorized to administer. + */ + certificates: Schema$AuthorizedCertificate[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Total size in bytes of all the files that are included in this version and - * currently hosted on the App Engine disk.@OutputOnly - */ - diskUsageBytes: string; + * Response message for AuthorizedDomains.ListAuthorizedDomains. + */ + export interface Schema$ListAuthorizedDomainsResponse { + /** + * The authorized domains belonging to the user. + */ + domains: Schema$AuthorizedDomain[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud - * Endpoints Extensible Service Proxy will be provided to serve the API - * implemented by the app. - */ - endpointsApiService: Schema$EndpointsApiService; + * Response message for DomainMappings.ListDomainMappings. + */ + export interface Schema$ListDomainMappingsResponse { + /** + * The domain mappings for the application. + */ + domainMappings: Schema$DomainMapping[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * App Engine execution environment for this version.Defaults to standard. - */ - env: string; + * Response message for Firewall.ListIngressRules. + */ + export interface Schema$ListIngressRulesResponse { + /** + * The ingress FirewallRules for this application. + */ + ingressRules: Schema$FirewallRule[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Environment variables available to the application.Only returned in GET - * requests if view=FULL is set. - */ - envVariables: any; + * Response message for Instances.ListInstances. + */ + export interface Schema$ListInstancesResponse { + /** + * The instances belonging to the requested version. + */ + instances: Schema$Instance[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Custom static error pages. Limited to 10KB per page.Only returned in GET - * requests if view=FULL is set. - */ - errorHandlers: Schema$ErrorHandler[]; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * An ordered list of URL-matching patterns that should be applied to incoming - * requests. The first matching URL handles the request and other request - * handlers are not attempted.Only returned in GET requests if view=FULL is - * set. - */ - handlers: Schema$UrlMap[]; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Configures health checking for instances. Unhealthy instances are stopped - * and replaced with new instances. Only applicable in the App Engine flexible - * environment.Only returned in GET requests if view=FULL is set. - */ - healthCheck: Schema$HealthCheck; + * Response message for Services.ListServices. + */ + export interface Schema$ListServicesResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The services belonging to the requested application. + */ + services: Schema$Service[]; + } /** - * Relative name of the version within the service. Example: v1. Version names - * can contain only lowercase letters, numbers, or hyphens. Reserved names: - * "default", "latest", and any name with the prefix - * "ah-". - */ - id: string; + * Response message for Versions.ListVersions. + */ + export interface Schema$ListVersionsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The versions belonging to the requested service. + */ + versions: Schema$Version[]; + } /** - * Before an application can receive email or XMPP messages, the application - * must be configured to enable the service. - */ - inboundServices: string[]; + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. + */ + export interface Schema$LivenessCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Number of consecutive failed checks required before considering the VM + * unhealthy. + */ + failureThreshold: number; + /** + * Host header to send when performing a HTTP Liveness check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * The initial delay before starting to execute the checks. + */ + initialDelay: string; + /** + * The request path. + */ + path: string; + /** + * Number of consecutive successful checks required before considering the + * VM healthy. + */ + successThreshold: number; + /** + * Time before the check is considered failed. + */ + timeout: string; + } /** - * Instance class that is used to run this version. Valid values are: - * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, - * B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling - * or BasicScaling. - */ - instanceClass: string; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: "us-east1". + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: "projects/example-project/locations/us-east1" + */ + name: string; + } /** - * Configuration for third-party Python runtime libraries that are required by - * the application.Only returned in GET requests if view=FULL is set. - */ - libraries: Schema$Library[]; + * Metadata for the given google.cloud.location.Location. + */ + export interface Schema$LocationMetadata { + /** + * App Engine flexible environment is available in the given + * location.@OutputOnly + */ + flexibleEnvironmentAvailable: boolean; + /** + * App Engine standard environment is available in the given + * location.@OutputOnly + */ + standardEnvironmentAvailable: boolean; + } /** - * Configures liveness health checking for instances. Unhealthy instances are - * stopped and replaced with new instancesOnly returned in GET requests if - * view=FULL is set. - */ - livenessCheck: Schema$LivenessCheck; + * A certificate managed by App Engine. + */ + export interface Schema$ManagedCertificate { + /** + * Time at which the certificate was last renewed. The renewal process is + * fully managed. Certificate renewal will automatically occur before the + * certificate expires. Renewal errors can be tracked via + * ManagementStatus.@OutputOnly + */ + lastRenewalTime: string; + /** + * Status of certificate management. Refers to the most recent certificate + * acquisition or renewal attempt.@OutputOnly + */ + status: string; + } /** * A service with manual scaling runs continuously, allowing you to perform * complex initialization and rely on the state of its memory over time. */ - manualScaling: Schema$ManualScaling; - /** - * Full path to the Version resource in the API. Example: - * apps/myapp/services/default/versions/v1.@OutputOnly - */ - name: string; + export interface Schema$ManualScaling { + /** + * Number of instances to assign to the service at the start. This number + * can later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) + * set_num_instances() function. + */ + instances: number; + } /** * Extra network settings. Only applicable in the App Engine flexible * environment. */ - network: Schema$Network; - /** - * Files that match this pattern will not be built into this version. Only - * applicable for Go runtimes.Only returned in GET requests if view=FULL is - * set. - */ - nobuildFilesRegex: string; - /** - * Configures readiness health checking for instances. Unhealthy instances are - * not put into the backend traffic rotation.Only returned in GET requests if - * view=FULL is set. - */ - readinessCheck: Schema$ReadinessCheck; + export interface Schema$Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the + * application container. Only applicable in the App Engine flexible + * environment. + */ + forwardedPorts: string[]; + /** + * Tag to apply to the instance during creation. Only applicable in the App + * Engine flexible environment. + */ + instanceTag: string; + /** + * Google Compute Engine network where the virtual machines are created. + * Specify the short name, not the resource path.Defaults to default. + */ + name: string; + /** + * Enable session affinity. + */ + sessionAffinity: boolean; + /** + * Google Cloud Platform sub-network where the virtual machines are created. + * Specify the short name, not the resource path.If a subnetwork name is + * specified, a network name will also be required unless it is for the + * default network. If the network that the instance is being created in is + * a Legacy network, then the IP address is allocated from the IPv4Range. If + * the network that the instance is being created in is an auto Subnet Mode + * Network, then only network name should be specified (not the + * subnetwork_name) and the IP address is created from the IPCidrRange of + * the subnetwork that exists in that zone for that network. If the network + * that the instance is being created in is a custom Subnet Mode Network, + * then the subnetwork_name must be specified and the IP address is created + * from the IPCidrRange of the subnetwork.If specified, the subnetwork must + * exist in the same region as the App Engine flexible environment + * application. + */ + subnetworkName: string; + } /** - * Machine resources for this version. Only applicable in the App Engine - * flexible environment. + * Target scaling by network usage. Only applicable in the App Engine flexible + * environment. */ - resources: Schema$Resources; + export interface Schema$NetworkUtilization { + /** + * Target bytes received per second. + */ + targetReceivedBytesPerSecond: number; + /** + * Target packets received per second. + */ + targetReceivedPacketsPerSecond: number; + /** + * Target bytes sent per second. + */ + targetSentBytesPerSecond: number; + /** + * Target packets sent per second. + */ + targetSentPacketsPerSecond: number; + } /** - * Desired runtime. Example: python27. - */ - runtime: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * The version of the API in the given runtime environment. Please see the - * app.yaml reference for valid values at - * https://cloud.google.com/appengine/docs/standard/<language>/config/appref - */ - runtimeApiVersion: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadata { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Type of this operation. Deprecated, use method field instead. Example: + * "create_version".@OutputOnly + */ + operationType: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/modules/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * The channel of the runtime to use. Only available for some runtimes. - * Defaults to the default channel. - */ - runtimeChannel: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1 { + createVersionMetadata: Schema$CreateVersionMetadataV1; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Current serving status of this version. Only the versions with a SERVING - * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an - * invalid value. Defaults to SERVING. - */ - servingStatus: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Alpha { + createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Whether multiple requests can be dispatched to this version at once. - */ - threadsafe: boolean; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta { + createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Serving URL for this version. Example: - * "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly - */ - versionUrl: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta5 { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method name that initiated this operation. Example: + * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * Whether to deploy this version in a container on a virtual machine. - */ - vm: boolean; + * Readiness checking configuration for VM instances. Unhealthy instances are + * removed from traffic rotation. + */ + export interface Schema$ReadinessCheck { + /** + * A maximum time limit on application initialization, measured from moment + * the application successfully replies to a healthcheck until it is ready + * to serve traffic. + */ + appStartTimeout: string; + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Number of consecutive failed checks required before removing traffic. + */ + failureThreshold: number; + /** + * Host header to send when performing a HTTP Readiness check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * The request path. + */ + path: string; + /** + * Number of consecutive successful checks required before receiving + * traffic. + */ + successThreshold: number; + /** + * Time before the check is considered failed. + */ + timeout: string; + } /** - * The Google Compute Engine zones that are supported by this version in the - * App Engine flexible environment. + * Request message for 'Applications.RepairApplication'. */ - zones: string[]; -} -/** - * Volumes mounted within the app container. Only applicable in the App Engine - * flexible environment. - */ -export interface Schema$Volume { + export interface Schema$RepairApplicationRequest {} /** - * Unique name for the volume. + * Target scaling by request utilization. Only applicable in the App Engine + * flexible environment. */ - name: string; + export interface Schema$RequestUtilization { + /** + * Target number of concurrent requests. + */ + targetConcurrentRequests: number; + /** + * Target requests per second. + */ + targetRequestCountPerSecond: number; + } /** - * Volume size in gigabytes. - */ - sizeGb: number; + * A DNS resource record. + */ + export interface Schema$ResourceRecord { + /** + * Relative name of the object affected by this record. Only applicable for + * CNAME records. Example: 'www'. + */ + name: string; + /** + * Data for this record. Values vary by record type, as defined in RFC 1035 + * (section 5) and RFC 1034 (section 3.6.1). + */ + rrdata: string; + /** + * Resource record type. Example: AAAA. + */ + type: string; + } /** - * Underlying volume type, e.g. 'tmpfs'. - */ - volumeType: string; -} -/** - * The zip file information for a zip deployment. - */ -export interface Schema$ZipInfo { + * Machine resources for a version. + */ + export interface Schema$Resources { + /** + * Number of CPU cores needed. + */ + cpu: number; + /** + * Disk size (GB) needed. + */ + diskGb: number; + /** + * Memory (GB) needed. + */ + memoryGb: number; + /** + * User specified volumes. + */ + volumes: Schema$Volume[]; + } /** - * An estimate of the number of files in a zip for a zip deployment. If set, - * must be greater than or equal to the actual number of files. Used for - * optimizing performance; if not provided, deployment may be slow. + * Executes a script to handle the request that matches the URL pattern. */ - filesCount: number; + export interface Schema$ScriptHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * URL of the zip file to deploy from. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. - */ - sourceUrl: string; -} - -export class Resource$Apps { - root: Appengine; - authorizedCertificates: Resource$Apps$Authorizedcertificates; - authorizedDomains: Resource$Apps$Authorizeddomains; - domainMappings: Resource$Apps$Domainmappings; - firewall: Resource$Apps$Firewall; - locations: Resource$Apps$Locations; - operations: Resource$Apps$Operations; - services: Resource$Apps$Services; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.authorizedCertificates = - new Resource$Apps$Authorizedcertificates(root); - this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); - this.domainMappings = new Resource$Apps$Domainmappings(root); - this.firewall = new Resource$Apps$Firewall(root); - this.locations = new Resource$Apps$Locations(root); - this.operations = new Resource$Apps$Operations(root); - this.services = new Resource$Apps$Services(root); + * A Service resource is a logical component of an application that can share + * state and communicate in a secure fashion with other services. For example, + * an application that handles customer requests might include separate + * services to handle tasks such as backend data analysis or API requests from + * mobile devices. Each service has a collection of versions that define a + * specific set of code used to implement the functionality of that service. + */ + export interface Schema$Service { + /** + * Relative name of the service within the application. Example: + * default.@OutputOnly + */ + id: string; + /** + * Full path to the Service resource in the API. Example: + * apps/myapp/services/default.@OutputOnly + */ + name: string; + /** + * Mapping that defines fractional HTTP traffic diversion to different + * versions within the service. + */ + split: Schema$TrafficSplit; } - - getRoot() { - return this.root; + /** + * SSL configuration for a DomainMapping resource. + */ + export interface Schema$SslSettings { + /** + * ID of the AuthorizedCertificate resource configuring SSL for the + * application. Clearing this field will remove SSL support.By default, a + * managed certificate is automatically created for every domain mapping. To + * omit SSL support or to configure SSL manually, specify + * SslManagementType.MANUAL on a CREATE or UPDATE request. You must be + * authorized to administer the AuthorizedCertificate resource to manually + * map it to a DomainMapping resource. Example: 12345. + */ + certificateId: string; + /** + * ID of the managed AuthorizedCertificate resource currently being + * provisioned, if applicable. Until the new managed certificate has been + * successfully provisioned, the previous SSL state will be preserved. Once + * the provisioning process completes, the certificate_id field will reflect + * the new managed certificate and this field will be left empty. To remove + * SSL support while there is still a pending managed certificate, clear the + * certificate_id field with an UpdateDomainMappingRequest.@OutputOnly + */ + pendingManagedCertificateId: string; + /** + * SSL management type for this domain. If AUTOMATIC, a managed certificate + * is automatically provisioned. If MANUAL, certificate_id must be manually + * specified in order to configure SSL for this domain. + */ + sslManagementType: string; } - - /** - * appengine.apps.create - * @desc Creates an App Engine application for a Google Cloud Platform - * project. Required fields: id - The ID of the target Cloud Platform project. - * location - The region (https://cloud.google.com/appengine/docs/locations) - * where you want the App Engine application located.For more information - * about App Engine applications, see Managing Projects, Applications, and - * Billing (https://cloud.google.com/appengine/docs/standard/python/console/). - * @alias appengine.apps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Scheduler settings for standard environment. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$StandardSchedulerSettings { + /** + * Maximum number of instances to run for this version. Set to zero to + * disable max_instances configuration. + */ + maxInstances: number; + /** + * Minimum number of instances to run for this version. Set to zero to + * disable min_instances configuration. + */ + minInstances: number; + /** + * Target CPU utilization ratio to maintain when scaling. + */ + targetCpuUtilization: number; + /** + * Target throughput utilization ratio to maintain when scaling + */ + targetThroughputUtilization: number; } - - /** - * appengine.apps.get - * @desc Gets information about an application. - * @alias appengine.apps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to get. Example: apps/myapp. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Files served directly to the user for a given URL, such as images, CSS + * stylesheets, or JavaScript source files. Static file handlers describe + * which files in the application directory are static files, and which URLs + * serve them. + */ + export interface Schema$StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files + * declared in static file handlers are uploaded as static data and are only + * served to end users; they cannot be read by the application. If enabled, + * uploads are charged against both your code and static data storage + * resource quotas. + */ + applicationReadable: boolean; + /** + * Time a static file served by this handler should be cached by web proxies + * and browsers. + */ + expiration: string; + /** + * HTTP headers to use for all responses from these URLs. + */ + httpHeaders: any; + /** + * MIME type used to serve all files served by this handler.Defaults to + * file-specific MIME types, which are derived from each file's filename + * extension. + */ + mimeType: string; + /** + * Path to the static files matched by the URL pattern, from the application + * root directory. The path can refer to text matched in groupings in the + * URL pattern. + */ + path: string; + /** + * Whether this handler should match the request if the file referenced by + * the handler does not exist. + */ + requireMatchingFile: boolean; + /** + * Regular expression that matches the file paths for all files that should + * be referenced by this handler. + */ + uploadPathRegex: string; } - - /** - * appengine.apps.patch - * @desc Updates the specified Application resource. You can update the - * following fields: auth_domain - Google authentication domain for - * controlling user access to the application. default_cookie_expiration - - * Cookie expiration policy for the application. - * @alias appengine.apps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * appengine.apps.repair - * @desc Recreates the required App Engine features for the specified App - * Engine application, for example a Cloud Storage bucket or App Engine - * service account. Use this method if you receive an error message about a - * missing feature, for example, Error retrieving the App Engine service - * account. - * @alias appengine.apps.repair - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the application to repair. Example: apps/myapp - * @param {().RepairApplicationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - repair(params?: any, options?: MethodOptions): AxiosPromise; - repair( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - repair( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}:repair') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Traffic routing configuration for versions within a single service. Traffic + * splits define how traffic directed to the service is assigned to versions. + */ + export interface Schema$TrafficSplit { + /** + * Mapping from version IDs within the service to fractional (0.000, 1] + * allocations of traffic for that version. Each version can be specified + * only once, but some versions in the service may not have any traffic + * allocation. Services that have traffic allocated cannot be deleted until + * either the service is deleted or their traffic allocation is removed. + * Allocations must sum to 1. Up to two decimal place precision is supported + * for IP-based splits and up to three decimal places is supported for + * cookie-based splits. + */ + allocations: any; + /** + * Mechanism used to determine which version a request is sent to. The + * traffic selection algorithm will be stable for either type until + * allocations are changed. + */ + shardBy: string; } -} -export class Resource$Apps$Authorizedcertificates { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * Rules to match an HTTP request and dispatch that request to a service. + */ + export interface Schema$UrlDispatchRule { + /** + * Domain name to match against. The wildcard "*" is supported if + * specified before a period: "*.".Defaults to matching all + * domains: "*". + */ + domain: string; + /** + * Pathname within the host. Must start with a "/". A single + * "*" can be included at the end of the path.The sum of the + * lengths of the domain and path may not exceed 100 characters. + */ + path: string; + /** + * Resource ID of a service in this application that should serve the + * matched request. The service must already exist. Example: default. + */ + service: string; } - - getRoot() { - return this.root; + /** + * URL pattern and description of how the URL should be handled. App Engine + * can handle URLs by executing application code or by serving static files + * uploaded with the version, such as images, CSS, or JavaScript. + */ + export interface Schema$UrlMap { + /** + * Uses API Endpoints to handle requests. + */ + apiEndpoint: Schema$ApiEndpointHandler; + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. + */ + login: string; + /** + * 30x code to use when performing redirects for the secure field. Defaults + * to 302. + */ + redirectHttpResponseCode: string; + /** + * Executes a script to handle the request that matches this URL pattern. + */ + script: Schema$ScriptHandler; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * Returns the contents of a file, such as an image, as the response. + */ + staticFiles: Schema$StaticFilesHandler; + /** + * URL prefix. Uses regular expression syntax, which means regexp special + * characters must be escaped, but should not contain groupings. All URLs + * that begin with this prefix are handled by this handler, using the + * portion of the URL after the prefix as part of the file path. + */ + urlRegex: string; } - - /** - * appengine.apps.authorizedCertificates.create - * @desc Uploads the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Version resource is a specific set of source code and configuration files + * that are deployed into a service. + */ + export interface Schema$Version { + /** + * Serving configuration for Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned + * in GET requests if view=FULL is set. + */ + apiConfig: Schema$ApiConfigHandler; + /** + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. + */ + automaticScaling: Schema$AutomaticScaling; + /** + * A service with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. + */ + basicScaling: Schema$BasicScaling; + /** + * Metadata settings that are supplied to this version to enable beta + * runtime features. + */ + betaSettings: any; + /** + * Email address of the user who created this version.@OutputOnly + */ + createdBy: string; + /** + * Time that this version was created.@OutputOnly + */ + createTime: string; + /** + * Duration that static files should be cached by web proxies and browsers. + * Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#staticfileshandler) + * does not specify its own expiration time.Only returned in GET requests if + * view=FULL is set. + */ + defaultExpiration: string; + /** + * Code and application artifacts that make up this version.Only returned in + * GET requests if view=FULL is set. + */ + deployment: Schema$Deployment; + /** + * Total size in bytes of all the files that are included in this version + * and currently hosted on the App Engine disk.@OutputOnly + */ + diskUsageBytes: string; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud + * Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService: Schema$EndpointsApiService; + /** + * App Engine execution environment for this version.Defaults to standard. + */ + env: string; + /** + * Environment variables available to the application.Only returned in GET + * requests if view=FULL is set. + */ + envVariables: any; + /** + * Custom static error pages. Limited to 10KB per page.Only returned in GET + * requests if view=FULL is set. + */ + errorHandlers: Schema$ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to + * incoming requests. The first matching URL handles the request and other + * request handlers are not attempted.Only returned in GET requests if + * view=FULL is set. + */ + handlers: Schema$UrlMap[]; + /** + * Configures health checking for instances. Unhealthy instances are stopped + * and replaced with new instances. Only applicable in the App Engine + * flexible environment.Only returned in GET requests if view=FULL is set. + */ + healthCheck: Schema$HealthCheck; + /** + * Relative name of the version within the service. Example: v1. Version + * names can contain only lowercase letters, numbers, or hyphens. Reserved + * names: "default", "latest", and any name with the + * prefix "ah-". + */ + id: string; + /** + * Before an application can receive email or XMPP messages, the application + * must be configured to enable the service. + */ + inboundServices: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, + * B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for + * ManualScaling or BasicScaling. + */ + instanceClass: string; + /** + * Configuration for third-party Python runtime libraries that are required + * by the application.Only returned in GET requests if view=FULL is set. + */ + libraries: Schema$Library[]; + /** + * Configures liveness health checking for instances. Unhealthy instances + * are stopped and replaced with new instancesOnly returned in GET requests + * if view=FULL is set. + */ + livenessCheck: Schema$LivenessCheck; + /** + * A service with manual scaling runs continuously, allowing you to perform + * complex initialization and rely on the state of its memory over time. + */ + manualScaling: Schema$ManualScaling; + /** + * Full path to the Version resource in the API. Example: + * apps/myapp/services/default/versions/v1.@OutputOnly + */ + name: string; + /** + * Extra network settings. Only applicable in the App Engine flexible + * environment. + */ + network: Schema$Network; + /** + * Files that match this pattern will not be built into this version. Only + * applicable for Go runtimes.Only returned in GET requests if view=FULL is + * set. + */ + nobuildFilesRegex: string; + /** + * Configures readiness health checking for instances. Unhealthy instances + * are not put into the backend traffic rotation.Only returned in GET + * requests if view=FULL is set. + */ + readinessCheck: Schema$ReadinessCheck; + /** + * Machine resources for this version. Only applicable in the App Engine + * flexible environment. + */ + resources: Schema$Resources; + /** + * Desired runtime. Example: python27. + */ + runtime: string; + /** + * The version of the API in the given runtime environment. Please see the + * app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard/<language>/config/appref + */ + runtimeApiVersion: string; + /** + * The channel of the runtime to use. Only available for some runtimes. + * Defaults to the default channel. + */ + runtimeChannel: string; + /** + * Current serving status of this version. Only the versions with a SERVING + * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is + * an invalid value. Defaults to SERVING. + */ + servingStatus: string; + /** + * Whether multiple requests can be dispatched to this version at once. + */ + threadsafe: boolean; + /** + * Serving URL for this version. Example: + * "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly + */ + versionUrl: string; + /** + * Whether to deploy this version in a container on a virtual machine. + */ + vm: boolean; + /** + * The Google Compute Engine zones that are supported by this version in the + * App Engine flexible environment. + */ + zones: string[]; } - - /** - * appengine.apps.authorizedCertificates.delete - * @desc Deletes the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Volumes mounted within the app container. Only applicable in the App Engine + * flexible environment. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Volume { + /** + * Unique name for the volume. + */ + name: string; + /** + * Volume size in gigabytes. + */ + sizeGb: number; + /** + * Underlying volume type, e.g. 'tmpfs'. + */ + volumeType: string; } - - /** - * appengine.apps.authorizedCertificates.get - * @desc Gets the specified SSL certificate. - * @alias appengine.apps.authorizedCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the GET response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The zip file information for a zip deployment. + */ + export interface Schema$ZipInfo { + /** + * An estimate of the number of files in a zip for a zip deployment. If set, + * must be greater than or equal to the actual number of files. Used for + * optimizing performance; if not provided, deployment may be slow. + */ + filesCount: number; + /** + * URL of the zip file to deploy from. Must be a URL to a resource in Google + * Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; } - - /** - * appengine.apps.authorizedCertificates.list - * @desc Lists all SSL certificates the user is authorized to administer. - * @alias appengine.apps.authorizedCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string=} params.view Controls the set of fields returned in the LIST response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps { + root: Appengine; + authorizedCertificates: Resource$Apps$Authorizedcertificates; + authorizedDomains: Resource$Apps$Authorizeddomains; + domainMappings: Resource$Apps$Domainmappings; + firewall: Resource$Apps$Firewall; + locations: Resource$Apps$Locations; + operations: Resource$Apps$Operations; + services: Resource$Apps$Services; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.authorizedCertificates = + new Resource$Apps$Authorizedcertificates(root); + this.authorizedDomains = new Resource$Apps$Authorizeddomains(root); + this.domainMappings = new Resource$Apps$Domainmappings(root); + this.firewall = new Resource$Apps$Firewall(root); + this.locations = new Resource$Apps$Locations(root); + this.operations = new Resource$Apps$Operations(root); + this.services = new Resource$Apps$Services(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/authorizedCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.authorizedCertificates.patch - * @desc Updates the specified SSL certificate. To renew a certificate and - * maintain its existing domain mappings, update certificate_data with a new - * certificate. The new certificate must be applicable to the same domains as - * the original certificate. The certificate display_name may also be updated. - * @alias appengine.apps.authorizedCertificates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. - * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. - * @param {().AuthorizedCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.create + * @desc Creates an App Engine application for a Google Cloud Platform + * project. Required fields: id - The ID of the target Cloud Platform + * project. location - The region + * (https://cloud.google.com/appengine/docs/locations) where you want the + * App Engine application located.For more information about App Engine + * applications, see Managing Projects, Applications, and Billing + * (https://cloud.google.com/appengine/docs/standard/python/console/). + * @alias appengine.apps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'authorizedCertificatesId'], - pathParams: ['appsId', 'authorizedCertificatesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.get + * @desc Gets information about an application. + * @alias appengine.apps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to get. Example: apps/myapp. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Apps$Authorizeddomains { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.patch + * @desc Updates the specified Application resource. You can update the + * following fields: auth_domain - Google authentication domain for + * controlling user access to the application. default_cookie_expiration - + * Cookie expiration policy for the application. + * @alias appengine.apps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.authorizedDomains.list - * @desc Lists all domains the user is authorized to administer. - * @alias appengine.apps.authorizedDomains.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.repair + * @desc Recreates the required App Engine features for the specified App + * Engine application, for example a Cloud Storage bucket or App Engine + * service account. Use this method if you receive an error message about a + * missing feature, for example, Error retrieving the App Engine service + * account. + * @alias appengine.apps.repair + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the application to repair. Example: apps/myapp + * @param {().RepairApplicationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + repair(params?: any, options?: MethodOptions): + AxiosPromise; + repair( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + repair( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}:repair') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Authorizedcertificates { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/authorizedDomains') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Domainmappings { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.authorizedCertificates.create + * @desc Uploads the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.domainMappings.create - * @desc Maps a domain to an application. A user must be authorized to - * administer a domain in order to map it to an application. For a list of - * available authorized domains, see AuthorizedDomains.ListAuthorizedDomains. - * @alias appengine.apps.domainMappings.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.delete + * @desc Deletes the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.domainMappings.delete - * @desc Deletes the specified domain mapping. A user must be authorized to - * administer the associated domain in order to delete a DomainMapping - * resource. - * @alias appengine.apps.domainMappings.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.authorizedCertificates.get + * @desc Gets the specified SSL certificate. + * @alias appengine.apps.authorizedCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the GET response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.domainMappings.get - * @desc Gets the specified domain mapping. - * @alias appengine.apps.domainMappings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.authorizedCertificates.list + * @desc Lists all SSL certificates the user is authorized to administer. + * @alias appengine.apps.authorizedCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string=} params.view Controls the set of fields returned in the LIST response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/authorizedCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.domainMappings.list - * @desc Lists the domain mappings on an application. - * @alias appengine.apps.domainMappings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/domainMappings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.authorizedCertificates.patch + * @desc Updates the specified SSL certificate. To renew a certificate and + * maintain its existing domain mappings, update certificate_data with a new + * certificate. The new certificate must be applicable to the same domains + * as the original certificate. The certificate display_name may also be + * updated. + * @alias appengine.apps.authorizedCertificates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/authorizedCertificates/12345. + * @param {string} params.authorizedCertificatesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Updates are only supported on the certificate_raw_data and display_name fields. + * @param {().AuthorizedCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/authorizedCertificates/{authorizedCertificatesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'authorizedCertificatesId'], + pathParams: ['appsId', 'authorizedCertificatesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.domainMappings.patch - * @desc Updates the specified domain mapping. To map an SSL certificate to a - * domain mapping, update certificate_id to point to an AuthorizedCertificate - * resource. A user must be authorized to administer the associated domain in - * order to update a DomainMapping resource. - * @alias appengine.apps.domainMappings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. - * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().DomainMapping} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Authorizeddomains { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'domainMappingsId'], - pathParams: ['appsId', 'domainMappingsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Firewall { - root: Appengine; - ingressRules: Resource$Apps$Firewall$Ingressrules; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.ingressRules = new Resource$Apps$Firewall$Ingressrules(root); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } -} -export class Resource$Apps$Firewall$Ingressrules { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.authorizedDomains.list + * @desc Lists all domains the user is authorized to administer. + * @alias appengine.apps.authorizedDomains.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/authorizedDomains') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * appengine.apps.firewall.ingressRules.batchUpdate - * @desc Replaces the entire firewall ruleset in one bulk operation. This - * overrides and replaces the rules of an existing firewall with the new - * rules.If the final rule does not match traffic with the '*' wildcard IP - * range, then an "allow all" rule is explicitly added to the end of the list. - * @alias appengine.apps.firewall.ingressRules.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. - * @param {().BatchUpdateIngressRulesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Domainmappings { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/firewall/ingressRules:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.firewall.ingressRules.create - * @desc Creates a firewall rule for the application. - * @alias appengine.apps.firewall.ingressRules.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. - * @param {().FirewallRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.domainMappings.create + * @desc Maps a domain to an application. A user must be authorized to + * administer a domain in order to map it to an application. For a list of + * available authorized domains, see + * AuthorizedDomains.ListAuthorizedDomains. + * @alias appengine.apps.domainMappings.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {string=} params.overrideStrategy Whether the domain creation should override any existing mappings for this domain. By default, overrides are rejected. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/firewall/ingressRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.firewall.ingressRules.delete - * @desc Deletes the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.delete + * @desc Deletes the specified domain mapping. A user must be authorized to + * administer the associated domain in order to delete a DomainMapping + * resource. + * @alias appengine.apps.domainMappings.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to delete. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.firewall.ingressRules.get - * @desc Gets the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.domainMappings.get + * @desc Gets the specified domain mapping. + * @alias appengine.apps.domainMappings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.firewall.ingressRules.list - * @desc Lists the firewall rules of an application. - * @alias appengine.apps.firewall.ingressRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. - * @param {string=} params.matchingAddress A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/firewall/ingressRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.list + * @desc Lists the domain mappings on an application. + * @alias appengine.apps.domainMappings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/domainMappings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.firewall.ingressRules.patch - * @desc Updates the specified firewall rule. - * @alias appengine.apps.firewall.ingressRules.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. - * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().FirewallRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'ingressRulesId'], - pathParams: ['appsId', 'ingressRulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.domainMappings.patch + * @desc Updates the specified domain mapping. To map an SSL certificate to + * a domain mapping, update certificate_id to point to an + * AuthorizedCertificate resource. A user must be authorized to administer + * the associated domain in order to update a DomainMapping resource. + * @alias appengine.apps.domainMappings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/domainMappings/example.com. + * @param {string} params.domainMappingsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().DomainMapping} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/domainMappings/{domainMappingsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'domainMappingsId'], + pathParams: ['appsId', 'domainMappingsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Apps$Firewall { + root: Appengine; + ingressRules: Resource$Apps$Firewall$Ingressrules; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.ingressRules = new Resource$Apps$Firewall$Ingressrules(root); + } -export class Resource$Apps$Locations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } + export class Resource$Apps$Firewall$Ingressrules { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.locations.get - * @desc Gets information about a location. - * @alias appengine.apps.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Resource name for the location. - * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.batchUpdate + * @desc Replaces the entire firewall ruleset in one bulk operation. This + * overrides and replaces the rules of an existing firewall with the new + * rules.If the final rule does not match traffic with the '*' wildcard IP + * range, then an "allow all" rule is explicitly added to the end of the + * list. + * @alias appengine.apps.firewall.ingressRules.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall collection to set. Example: apps/myapp/firewall/ingressRules. + * @param {().BatchUpdateIngressRulesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/firewall/ingressRules:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/locations/{locationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'locationsId'], - pathParams: ['appsId', 'locationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.locations.list - * @desc Lists information about the supported locations for this service. - * @alias appengine.apps.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.create + * @desc Creates a firewall rule for the application. + * @alias appengine.apps.firewall.ingressRules.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Firewall collection in which to create a new rule. Example: apps/myapp/firewall/ingressRules. + * @param {().FirewallRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/firewall/ingressRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Operations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.firewall.ingressRules.delete + * @desc Deletes the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to delete. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias appengine.apps.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation resource. - * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.get + * @desc Gets the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to retrieve. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/operations/{operationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'operationsId'], - pathParams: ['appsId', 'operationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias appengine.apps.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.firewall.ingressRules.list + * @desc Lists the firewall rules of an application. + * @alias appengine.apps.firewall.ingressRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the Firewall collection to retrieve. Example: apps/myapp/firewall/ingressRules. + * @param {string=} params.matchingAddress A valid IP Address. If set, only rules matching this address will be returned. The first returned rule will be the rule that fires on requests from this IP. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/firewall/ingressRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services { - root: Appengine; - versions: Resource$Apps$Services$Versions; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.versions = new Resource$Apps$Services$Versions(root); - } - getRoot() { - return this.root; + /** + * appengine.apps.firewall.ingressRules.patch + * @desc Updates the specified firewall rule. + * @alias appengine.apps.firewall.ingressRules.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Firewall resource to update. Example: apps/myapp/firewall/ingressRules/100. + * @param {string} params.ingressRulesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().FirewallRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/firewall/ingressRules/{ingressRulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'ingressRulesId'], + pathParams: ['appsId', 'ingressRulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * appengine.apps.services.delete - * @desc Deletes the specified service and all enclosed versions. - * @alias appengine.apps.services.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Locations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.get - * @desc Gets the current configuration of the specified service. - * @alias appengine.apps.services.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.locations.get + * @desc Gets information about a location. + * @alias appengine.apps.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Resource name for the location. + * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/locations/{locationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'locationsId'], + pathParams: ['appsId', 'locationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.services.list - * @desc Lists all the services in the application. - * @alias appengine.apps.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/services') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.locations.list + * @desc Lists information about the supported locations for this service. + * @alias appengine.apps.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.patch - * @desc Updates the configuration of the specified service. - * @alias appengine.apps.services.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. - * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {().Service} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Operations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services$Versions { - root: Appengine; - instances: Resource$Apps$Services$Versions$Instances; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.instances = new Resource$Apps$Services$Versions$Instances(root); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.services.versions.create - * @desc Deploys code and resource files to a new version. - * @alias appengine.apps.services.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias appengine.apps.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation resource. + * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/operations/{operationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'operationsId'], + pathParams: ['appsId', 'operationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.delete - * @desc Deletes an existing Version resource. - * @alias appengine.apps.services.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias appengine.apps.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.versions.get - * @desc Gets the specified Version resource. By default, only a BASIC_VIEW - * will be returned. Specify the FULL_VIEW parameter to get the full resource. - * @alias appengine.apps.services.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the Get response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Services { + root: Appengine; + versions: Resource$Apps$Services$Versions; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.versions = new Resource$Apps$Services$Versions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.list - * @desc Lists the versions of a service. - * @alias appengine.apps.services.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the List response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.delete + * @desc Deletes the specified service and all enclosed versions. + * @alias appengine.apps.services.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.get + * @desc Gets the current configuration of the specified service. + * @alias appengine.apps.services.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.list + * @desc Lists all the services in the application. + * @alias appengine.apps.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Application resource. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/services') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.patch - * @desc Updates the specified Version resource. You can specify the following - * fields depending on the App Engine environment and type of scaling that the - * version resource uses: serving_status - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status): - * For Version resources that use basic scaling, manual scaling, or run in the - * App Engine flexible environment. instance_class - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.instance_class): - * For Version resources that run in the App Engine standard environment. - * automatic_scaling.min_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.max_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.min_total_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.max_total_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.cool_down_period_sec - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. automatic_scaling.cpu_utilization.target_utilization - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * flexible environment. - * @alias appengine.apps.services.versions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.patch + * @desc Updates the configuration of the specified service. + * @alias appengine.apps.services.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. + * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {().Service} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions { + root: Appengine; + instances: Resource$Apps$Services$Versions$Instances; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.instances = new Resource$Apps$Services$Versions$Instances(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Services$Versions$Instances { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + + /** + * appengine.apps.services.versions.create + * @desc Deploys code and resource files to a new version. + * @alias appengine.apps.services.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent resource to create this version under. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.services.versions.instances.debug - * @desc Enables debugging on a VM instance. This allows you to use the SSH - * command to connect to the virtual machine where the instance lives. While - * in "debug mode", the instance continues to serve live traffic. You should - * delete the instance when you are done debugging and then allow the system - * to take over and determine if another instance should be started.Only - * applicable for instances in App Engine flexible environment. - * @alias appengine.apps.services.versions.instances.debug - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().DebugInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - debug(params?: any, options?: MethodOptions): AxiosPromise; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.delete + * @desc Deletes an existing Version resource. + * @alias appengine.apps.services.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.get + * @desc Gets the specified Version resource. By default, only a BASIC_VIEW + * will be returned. Specify the FULL_VIEW parameter to get the full + * resource. + * @alias appengine.apps.services.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the Get response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.list + * @desc Lists the versions of a service. + * @alias appengine.apps.services.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Service resource. Example: apps/myapp/services/default. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the List response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.delete - * @desc Stops a running instance. - * @alias appengine.apps.services.versions.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.patch + * @desc Updates the specified Version resource. You can specify the + * following fields depending on the App Engine environment and type of + * scaling that the version resource uses: serving_status + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.serving_status): + * For Version resources that use basic scaling, manual scaling, or run in + * the App Engine flexible environment. instance_class + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.instance_class): + * For Version resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.min_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. automatic_scaling.max_total_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. automatic_scaling.cool_down_period_sec + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. + * automatic_scaling.cpu_utilization.target_utilization + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine flexible environment. + * @alias appengine.apps.services.versions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions$Instances { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.instances.get - * @desc Gets instance information. - * @alias appengine.apps.services.versions.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.services.versions.instances.debug + * @desc Enables debugging on a VM instance. This allows you to use the SSH + * command to connect to the virtual machine where the instance lives. While + * in "debug mode", the instance continues to serve live traffic. You should + * delete the instance when you are done debugging and then allow the system + * to take over and determine if another instance should be started.Only + * applicable for instances in App Engine flexible environment. + * @alias appengine.apps.services.versions.instances.debug + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().DebugInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + debug(params?: any, options?: MethodOptions): + AxiosPromise; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.list - * @desc Lists the instances of a version.Tip: To aggregate details about - * instances over time, see the Stackdriver Monitoring API - * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * @alias appengine.apps.services.versions.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `parent`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.instances.delete + * @desc Stops a running instance. + * @alias appengine.apps.services.versions.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.instances.get + * @desc Gets instance information. + * @alias appengine.apps.services.versions.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.instances.list + * @desc Lists the instances of a version.Tip: To aggregate details about + * instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @alias appengine.apps.services.versions.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `parent`. Name of the parent Version resource. Example: apps/myapp/services/default/versions/v1. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `parent`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `parent`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appengine/v1beta4.ts b/src/apis/appengine/v1beta4.ts index 36aa464f6e6..4540119defc 100644 --- a/src/apis/appengine/v1beta4.ts +++ b/src/apis/appengine/v1beta4.ts @@ -27,2652 +27,2678 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * App Engine Admin API - * - * The App Engine Admin API enables developers to provision and manage their App - * Engine applications. - * - * @example - * const google = require('googleapis'); - * const appengine = google.appengine('v1beta4'); - * - * @namespace appengine - * @type {Function} - * @version v1beta4 - * @variation v1beta4 - * @param {object=} options Options for Appengine - */ -export class Appengine { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - apps: Resource$Apps; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.apps = new Resource$Apps(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for - * API handlers. - */ -export interface Schema$ApiConfigHandler { - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. Defaults to optional. - */ - login: string; - /** - * Path to the script from the application root directory. - */ - script: string; - /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; - /** - * URL to serve the endpoint at. - */ - url: string; -} -/** - * Uses Google Cloud Endpoints to handle requests. - */ -export interface Schema$ApiEndpointHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * An Application resource contains the top-level configuration of an App Engine - * application. - */ -export interface Schema$Application { - /** - * Google Apps authentication domain that controls which users can access this - * application.Defaults to open access for any Google Account. - */ - authDomain: string; - /** - * Google Cloud Storage bucket that can be used for storing files associated - * with this application. This bucket is associated with the application and - * can be used by the gcloud deployment commands.@OutputOnly - */ - codeBucket: string; - /** - * Google Cloud Storage bucket that can be used by this application to store - * content.@OutputOnly - */ - defaultBucket: string; - /** - * Cookie expiration policy for this application. - */ - defaultCookieExpiration: string; - /** - * Hostname used to reach the application, as resolved by App - * Engine.@OutputOnly - */ - defaultHostname: string; - /** - * HTTP path dispatch rules for requests to the application that do not - * explicitly target a module or version. Rules are - * order-dependent.@OutputOnly - */ - dispatchRules: Schema$UrlDispatchRule[]; - iap: Schema$IdentityAwareProxy; - /** - * Identifier of the Application resource. This identifier is equivalent to - * the project ID of the Google Cloud Platform project where you want to - * deploy your application. Example: myapp. - */ - id: string; - /** - * Location from which this application will be run. Application instances - * will run out of data centers in the chosen location, which is also where - * all of the application's end user content is stored.Defaults to - * us-central.Options are:us-central - Central USeurope-west - Western - * Europeus-east1 - Eastern US - */ - location: string; - /** - * Full path to the Application resource in the API. Example: - * apps/myapp.@OutputOnly - */ - name: string; -} -/** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ -export interface Schema$AutomaticScaling { - /** - * Amount of time that the Autoscaler - * (https://cloud.google.com/compute/docs/autoscaler/) should wait between - * changes to the number of virtual machines. Only applicable for VM runtimes. - */ - coolDownPeriod: string; - /** - * Target scaling by CPU usage. - */ - cpuUtilization: Schema$CpuUtilization; - /** - * Target scaling by disk usage. - */ - diskUtilization: Schema$DiskUtilization; - /** - * Number of concurrent requests an automatic scaling instance can accept - * before the scheduler spawns a new instance.Defaults to a runtime-specific - * value. - */ - maxConcurrentRequests: number; - /** - * Maximum number of idle instances that should be maintained for this - * version. - */ - maxIdleInstances: number; - /** - * Maximum amount of time that a request should wait in the pending queue - * before starting a new instance to handle it. - */ - maxPendingLatency: string; - /** - * Maximum number of instances that should be started to handle requests. - */ - maxTotalInstances: number; - /** - * Minimum number of idle instances that should be maintained for this - * version. Only applicable for the default version of a module. - */ - minIdleInstances: number; - /** - * Minimum amount of time a request should wait in the pending queue before - * starting a new instance to handle it. - */ - minPendingLatency: string; - /** - * Minimum number of instances that should be maintained for this version. - */ - minTotalInstances: number; - /** - * Target scaling by network usage. - */ - networkUtilization: Schema$NetworkUtilization; - /** - * Target scaling by request utilization. - */ - requestUtilization: Schema$RequestUtilization; -} -/** - * A module with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by user - * activity. - */ -export interface Schema$BasicScaling { - /** - * Duration of time after the last request that an instance must wait before - * the instance is shut down. - */ - idleTimeout: string; - /** - * Maximum number of instances to create for this version. - */ - maxInstances: number; -} -/** - * Docker image that is used to create a container and start a VM instance for - * the version that you deploy. Only applicable for instances running in the App - * Engine flexible environment. - */ -export interface Schema$ContainerInfo { - /** - * URI to the hosted container image in Google Container Registry. The URI - * must be fully qualified and include a tag or digest. Examples: - * "gcr.io/my-project/image:tag" or - * "gcr.io/my-project/image@digest" - */ - image: string; -} -/** - * Target scaling by CPU usage. - */ -export interface Schema$CpuUtilization { - /** - * Period of time over which CPU utilization is calculated. - */ - aggregationWindowLength: string; - /** - * Target CPU utilization ratio to maintain when scaling. Must be between 0 - * and 1. - */ - targetUtilization: number; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1 { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1alpha.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Alpha { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1beta.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Beta { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Request message for Instances.DebugInstance. - */ -export interface Schema$DebugInstanceRequest { - /** - * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa - * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh - * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For - * more information, see Adding and Removing SSH Keys - * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). - */ - sshKey: string; -} -/** - * Code and application artifacts used to deploy a version to App Engine. - */ -export interface Schema$Deployment { - /** - * The Docker image for the container that runs the version. Only applicable - * for instances running in the App Engine flexible environment. - */ - container: Schema$ContainerInfo; - /** - * Manifest of the files stored in Google Cloud Storage that are included as - * part of this version. All files must be readable using the credentials - * supplied with this call. - */ - files: any; - /** - * Origin of the source code for this deployment. There can be more than one - * source reference per version if source code is distributed among multiple - * repositories. - */ - sourceReferences: Schema$SourceReference[]; -} -/** - * Target scaling by disk usage. Only applicable for VM runtimes. - */ -export interface Schema$DiskUtilization { - /** - * Target bytes read per second. - */ - targetReadBytesPerSec: number; - /** - * Target ops read per second. - */ - targetReadOpsPerSec: number; - /** - * Target bytes written per second. - */ - targetWriteBytesPerSec: number; - /** - * Target ops written per second. - */ - targetWriteOpsPerSec: number; -} -/** - * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The - * Endpoints API Service provides tooling for serving Open API and gRPC - * endpoints via an NGINX proxy. Only valid for App Engine Flexible environment - * deployments..The fields here refer to the name and configuration id of a - * "service" resource in the Service Management API - * (https://cloud.google.com/service-management/overview). - */ -export interface Schema$EndpointsApiService { - /** - * Endpoints service configuration id as specified by the Service Management - * API. For example "2016-09-19r1"By default, the Endpoints service - * configuration id is fixed and config_id must be specified. To keep the - * Endpoints service configuration id updated with each rollout, specify - * RolloutStrategy.MANAGED and omit config_id. - */ - configId: string; - /** - * Endpoints service name which is the name of the "service" - * resource in the Service Management API. For example - * "myapi.endpoints.myproject.cloud.goog" - */ - name: string; - /** - * Endpoints rollout strategy. If FIXED, config_id must be specified. If - * MANAGED, config_id must be omitted. - */ - rolloutStrategy: string; -} -/** - * Custom static error page to be served when an error occurs. - */ -export interface Schema$ErrorHandler { - /** - * Error condition this handler applies to. - */ - errorCode: string; - /** - * MIME type of file. Defaults to text/html. - */ - mimeType: string; - /** - * Static file content to be served for this error. - */ - staticFile: string; -} -/** - * Single source file that is part of the version to be deployed. Each source - * file that is deployed must be specified separately. - */ -export interface Schema$FileInfo { - /** - * The MIME type of the file.Defaults to the value from Google Cloud Storage. - */ - mimeType: string; - /** - * The SHA1 hash of the file, in hex. - */ - sha1Sum: string; - /** - * URL source to use to fetch this file. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. - */ - sourceUrl: string; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. Only applicable for instances in App - * Engine flexible environment. - */ -export interface Schema$HealthCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Whether to explicitly disable health checks for this instance. - */ - disableHealthCheck: boolean; - /** - * Number of consecutive successful health checks required before receiving - * traffic. - */ - healthyThreshold: number; - /** - * Host header to send when performing an HTTP health check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * Number of consecutive failed health checks required before an instance is - * restarted. - */ - restartThreshold: number; - /** - * Time before the health check is considered failed. - */ - timeout: string; - /** - * Number of consecutive failed health checks required before removing - * traffic. - */ - unhealthyThreshold: number; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$IdentityAwareProxy { - /** - * Whether the serving infrastructure will authenticate and authorize all - * incoming requests.If true, the oauth2_client_id and oauth2_client_secret - * fields must be non-empty. - */ - enabled: boolean; - /** - * OAuth2 client ID to use for the authentication flow. - */ - oauth2ClientId: string; - /** - * For security reasons, this value cannot be retrieved via the API. Instead, - * the SHA-256 hash of the value is returned in the - * oauth2_client_secret_sha256 field.@InputOnly - */ - oauth2ClientSecret: string; - /** - * Hex-encoded SHA-256 hash of the client secret.@OutputOnly - */ - oauth2ClientSecretSha256: string; -} -/** - * An Instance resource is the computing unit that App Engine uses to - * automatically scale an application. - */ -export interface Schema$Instance { - /** - * App Engine release this instance is running on.@OutputOnly - */ - appEngineRelease: string; - /** - * Availability of the instance.@OutputOnly - */ - availability: string; - /** - * Average latency (ms) over the last minute.@OutputOnly - */ - averageLatency: number; - /** - * Number of errors since this instance was started.@OutputOnly - */ - errors: number; - /** - * Relative name of the instance within the version. Example: - * instance-1.@OutputOnly - */ - id: string; - /** - * Total memory in use (bytes).@OutputOnly - */ - memoryUsage: string; - /** - * Full path to the Instance resource in the API. Example: - * apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly - */ - name: string; - /** - * Average queries per second (QPS) over the last minute.@OutputOnly - */ - qps: number; - /** - * Number of requests since this instance was started.@OutputOnly - */ - requests: number; - /** - * Time that this instance was started.@OutputOnly - */ - startTimestamp: string; - /** - * Virtual machine ID of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmId: string; - /** - * The IP address of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmIp: string; - /** - * Name of the virtual machine where this instance lives. Only applicable for - * instances in App Engine flexible environment.@OutputOnly - */ - vmName: string; - /** - * Status of the virtual machine where this instance lives. Only applicable - * for instances in App Engine flexible environment.@OutputOnly - */ - vmStatus: string; - /** - * Whether this instance is in debug mode. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmUnlocked: boolean; - /** - * Zone where the virtual machine is located. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmZoneName: string; -} -/** - * Third-party Python runtime library that is required by the application. - */ -export interface Schema$Library { - /** - * Name of the library. Example: "django". - */ - name: string; - /** - * Version of the library to select, or "latest". - */ - version: string; -} -/** - * Response message for Instances.ListInstances. - */ -export interface Schema$ListInstancesResponse { - /** - * The instances belonging to the requested version. - */ - instances: Schema$Instance[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * Response message for Modules.ListModules. - */ -export interface Schema$ListModulesResponse { - /** - * The modules belonging to the requested application. - */ - modules: Schema$Module[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for Versions.ListVersions. - */ -export interface Schema$ListVersionsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The versions belonging to the requested module. - */ - versions: Schema$Version[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: "us-east1". - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: "projects/example-project/locations/us-east1" - */ - name: string; -} -/** - * Metadata for the given google.cloud.location.Location. - */ -export interface Schema$LocationMetadata { - /** - * App Engine flexible environment is available in the given - * location.@OutputOnly - */ - flexibleEnvironmentAvailable: boolean; - /** - * App Engine standard environment is available in the given - * location.@OutputOnly - */ - standardEnvironmentAvailable: boolean; -} -/** - * A module with manual scaling runs continuously, allowing you to perform - * complex initialization and rely on the state of its memory over time. - */ -export interface Schema$ManualScaling { - /** - * Number of instances to assign to the module at the start. This number can - * later be altered by using the Modules API - * (https://cloud.google.com/appengine/docs/python/modules/functions) - * set_num_instances() function. - */ - instances: number; -} -/** - * A Module resource is a logical component of an application that can share - * state and communicate in a secure fashion with other modules. For example, an - * application that handles customer requests might include separate modules to - * handle tasks such as backend data analysis or API requests from mobile - * devices. Each module has a collection of versions that define a specific set - * of code used to implement the functionality of that module. - */ -export interface Schema$Module { - /** - * Relative name of the module within the application. Example: - * default.@OutputOnly - */ - id: string; - /** - * Full path to the Module resource in the API. Example: - * apps/myapp/modules/default.@OutputOnly - */ - name: string; - /** - * Mapping that defines fractional HTTP traffic diversion to different - * versions within the module. - */ - split: Schema$TrafficSplit; -} -/** - * Extra network settings. Only applicable for VM runtimes. - */ -export interface Schema$Network { - /** - * List of ports, or port pairs, to forward from the virtual machine to the - * application container. - */ - forwardedPorts: string[]; - /** - * Tag to apply to the VM instance during creation. - */ - instanceTag: string; - /** - * Google Cloud Platform network where the virtual machines are created. - * Specify the short name, not the resource path.Defaults to default. - */ - name: string; -} -/** - * Target scaling by network usage. Only applicable for VM runtimes. - */ -export interface Schema$NetworkUtilization { - /** - * Target bytes received per second. - */ - targetReceivedBytesPerSec: number; - /** - * Target packets received per second. - */ - targetReceivedPacketsPerSec: number; - /** - * Target bytes sent per second. - */ - targetSentBytesPerSec: number; - /** - * Target packets sent per second. - */ - targetSentPacketsPerSec: number; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadata { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Type of this operation. Deprecated, use method field instead. Example: - * "create_version".@OutputOnly - */ - operationType: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/modules/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1 { - createVersionMetadata: Schema$CreateVersionMetadataV1; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Alpha { - createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta { - createVersionMetadata: Schema$CreateVersionMetadataV1Beta; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta5 { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method name that initiated this operation. Example: - * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Target scaling by request utilization. Only applicable for VM runtimes. - */ -export interface Schema$RequestUtilization { - /** - * Target number of concurrent requests. - */ - targetConcurrentRequests: number; - /** - * Target requests per second. - */ - targetRequestCountPerSec: number; -} -/** - * Machine resources for a version. - */ -export interface Schema$Resources { - /** - * Number of CPU cores needed. - */ - cpu: number; - /** - * Disk size (GB) needed. - */ - diskGb: number; - /** - * Memory (GB) needed. - */ - memoryGb: number; - /** - * User specified volumes. - */ - volumes: Schema$Volume[]; -} -/** - * Executes a script to handle the request that matches the URL pattern. - */ -export interface Schema$ScriptHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * Reference to a particular snapshot of the source tree used to build and - * deploy the application. - */ -export interface Schema$SourceReference { - /** - * URI string identifying the repository. Example: - * "https://source.developers.google.com/p/app-123/r/default" - */ - repository: string; - /** - * The canonical, persistent identifier of the deployed revision. Aliases that - * include tags or branch names are not allowed. Example (git): - * "2198322f89e0bb2e25021667c2ed489d1fd34e6b" - */ - revisionId: string; -} -/** - * Files served directly to the user for a given URL, such as images, CSS - * stylesheets, or JavaScript source files. Static directory handlers make it - * easy to serve the entire contents of a directory as static files. - */ -export interface Schema$StaticDirectoryHandler { - /** - * Whether files should also be uploaded as code data. By default, files - * declared in static directory handlers are uploaded as static data and are - * only served to end users; they cannot be read by the application. If - * enabled, uploads are charged against both your code and static data storage - * resource quotas. - */ - applicationReadable: boolean; - /** - * Path to the directory containing the static files from the application root - * directory. Everything after the end of the matched URL pattern is appended - * to static_dir to form the full path to the requested file. - */ - directory: string; - /** - * Time a static file served by this handler should be cached. - */ - expiration: string; - /** - * HTTP headers to use for all responses from these URLs. - */ - httpHeaders: any; - /** - * MIME type used to serve all files served by this handler. Defaults to - * file-specific MIME types, which are direved from each file's filename - * extension. - */ - mimeType: string; - /** - * Whether this handler should match the request if the file referenced by the - * handler does not exist. - */ - requireMatchingFile: boolean; -} -/** - * Files served directly to the user for a given URL, such as images, CSS - * stylesheets, or JavaScript source files. Static file handlers describe which - * files in the application directory are static files, and which URLs serve - * them. - */ -export interface Schema$StaticFilesHandler { - /** - * Whether files should also be uploaded as code data. By default, files - * declared in static file handlers are uploaded as static data and are only - * served to end users; they cannot be read by the application. If enabled, - * uploads are charged against both your code and static data storage resource - * quotas. - */ - applicationReadable: boolean; - /** - * Time a static file served by this handler should be cached. - */ - expiration: string; - /** - * HTTP headers to use for all responses from these URLs. - */ - httpHeaders: any; - /** - * MIME type used to serve all files served by this handler. Defaults to - * file-specific MIME types, which are derived from each file's filename - * extension. - */ - mimeType: string; - /** - * Path to the static files matched by the URL pattern, from the application - * root directory. The path can refer to text matched in groupings in the URL - * pattern. - */ - path: string; - /** - * Whether this handler should match the request if the file referenced by the - * handler does not exist. - */ - requireMatchingFile: boolean; - /** - * Regular expression that matches the file paths for all files that should be - * referenced by this handler. - */ - uploadPathRegex: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Traffic routing configuration for versions within a single module. Traffic - * splits define how traffic directed to the module is assigned to versions. - */ -export interface Schema$TrafficSplit { - /** - * Mapping from version IDs within the module to fractional (0.000, 1] - * allocations of traffic for that version. Each version can be specified only - * once, but some versions in the module may not have any traffic allocation. - * Modules that have traffic allocated cannot be deleted until either the - * module is deleted or their traffic allocation is removed. Allocations must - * sum to 1. Up to two decimal place precision is supported for IP-based - * splits and up to three decimal places is supported for cookie-based splits. - */ - allocations: any; - /** - * Mechanism used to determine which version a request is sent to. The traffic - * selection algorithm will be stable for either type until allocations are - * changed. - */ - shardBy: string; -} -/** - * Rules to match an HTTP request and dispatch that request to a module. - */ -export interface Schema$UrlDispatchRule { - /** - * Domain name to match against. The wildcard "*" is supported if - * specified before a period: "*.".Defaults to matching all domains: - * "*". - */ - domain: string; - /** - * Resource ID of a module in this application that should serve the matched - * request. The module must already exist. Example: default. - */ - module: string; - /** - * Pathname within the host. Must start with a "/". A single - * "*" can be included at the end of the path. The sum of the - * lengths of the domain and path may not exceed 100 characters. - */ - path: string; -} -/** - * URL pattern and description of how the URL should be handled. App Engine can - * handle URLs by executing application code, or by serving static files - * uploaded with the version, such as images, CSS, or JavaScript. - */ -export interface Schema$UrlMap { - /** - * Uses API Endpoints to handle requests. - */ - apiEndpoint: Schema$ApiEndpointHandler; - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. - */ - login: string; - /** - * 30x code to use when performing redirects for the secure field. Defaults to - * 302. - */ - redirectHttpResponseCode: string; - /** - * Executes a script to handle the request that matches this URL pattern. - */ - script: Schema$ScriptHandler; - /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; +export namespace appengine_v1beta4 { /** - * Serves the entire contents of a directory as static files.This attribute is - * deprecated. You can mimic the behavior of static directories using static - * files. - */ - staticDirectory: Schema$StaticDirectoryHandler; + * App Engine Admin API + * + * The App Engine Admin API enables developers to provision and manage their + * App Engine applications. + * + * @example + * const google = require('googleapis'); + * const appengine = google.appengine('v1beta4'); + * + * @namespace appengine + * @type {Function} + * @version v1beta4 + * @variation v1beta4 + * @param {object=} options Options for Appengine + */ + export class Appengine { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + apps: Resource$Apps; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.apps = new Resource$Apps(this); + } + + getRoot() { + return this.root; + } + } + /** - * Returns the contents of a file, such as an image, as the response. - */ - staticFiles: Schema$StaticFilesHandler; + * Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration + * for API handlers. + */ + export interface Schema$ApiConfigHandler { + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. Defaults to optional. + */ + login: string; + /** + * Path to the script from the application root directory. + */ + script: string; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * URL to serve the endpoint at. + */ + url: string; + } /** - * A URL prefix. Uses regular expression syntax, which means regexp special - * characters must be escaped, but should not contain groupings. All URLs that - * begin with this prefix are handled by this handler, using the portion of - * the URL after the prefix as part of the file path. + * Uses Google Cloud Endpoints to handle requests. */ - urlRegex: string; -} -/** - * A Version resource is a specific set of source code and configuration files - * that are deployed into a module. - */ -export interface Schema$Version { + export interface Schema$ApiEndpointHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * Serving configuration for Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned - * in GET requests if view=FULL is set. - */ - apiConfig: Schema$ApiConfigHandler; + * An Application resource contains the top-level configuration of an App + * Engine application. + */ + export interface Schema$Application { + /** + * Google Apps authentication domain that controls which users can access + * this application.Defaults to open access for any Google Account. + */ + authDomain: string; + /** + * Google Cloud Storage bucket that can be used for storing files associated + * with this application. This bucket is associated with the application and + * can be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket: string; + /** + * Google Cloud Storage bucket that can be used by this application to store + * content.@OutputOnly + */ + defaultBucket: string; + /** + * Cookie expiration policy for this application. + */ + defaultCookieExpiration: string; + /** + * Hostname used to reach the application, as resolved by App + * Engine.@OutputOnly + */ + defaultHostname: string; + /** + * HTTP path dispatch rules for requests to the application that do not + * explicitly target a module or version. Rules are + * order-dependent.@OutputOnly + */ + dispatchRules: Schema$UrlDispatchRule[]; + iap: Schema$IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to + * the project ID of the Google Cloud Platform project where you want to + * deploy your application. Example: myapp. + */ + id: string; + /** + * Location from which this application will be run. Application instances + * will run out of data centers in the chosen location, which is also where + * all of the application's end user content is stored.Defaults to + * us-central.Options are:us-central - Central USeurope-west - Western + * Europeus-east1 - Eastern US + */ + location: string; + /** + * Full path to the Application resource in the API. Example: + * apps/myapp.@OutputOnly + */ + name: string; + } /** * Automatic scaling is based on request rate, response latencies, and other * application metrics. */ - automaticScaling: Schema$AutomaticScaling; + export interface Schema$AutomaticScaling { + /** + * Amount of time that the Autoscaler + * (https://cloud.google.com/compute/docs/autoscaler/) should wait between + * changes to the number of virtual machines. Only applicable for VM + * runtimes. + */ + coolDownPeriod: string; + /** + * Target scaling by CPU usage. + */ + cpuUtilization: Schema$CpuUtilization; + /** + * Target scaling by disk usage. + */ + diskUtilization: Schema$DiskUtilization; + /** + * Number of concurrent requests an automatic scaling instance can accept + * before the scheduler spawns a new instance.Defaults to a runtime-specific + * value. + */ + maxConcurrentRequests: number; + /** + * Maximum number of idle instances that should be maintained for this + * version. + */ + maxIdleInstances: number; + /** + * Maximum amount of time that a request should wait in the pending queue + * before starting a new instance to handle it. + */ + maxPendingLatency: string; + /** + * Maximum number of instances that should be started to handle requests. + */ + maxTotalInstances: number; + /** + * Minimum number of idle instances that should be maintained for this + * version. Only applicable for the default version of a module. + */ + minIdleInstances: number; + /** + * Minimum amount of time a request should wait in the pending queue before + * starting a new instance to handle it. + */ + minPendingLatency: string; + /** + * Minimum number of instances that should be maintained for this version. + */ + minTotalInstances: number; + /** + * Target scaling by network usage. + */ + networkUtilization: Schema$NetworkUtilization; + /** + * Target scaling by request utilization. + */ + requestUtilization: Schema$RequestUtilization; + } /** * A module with basic scaling will create an instance when the application * receives a request. The instance will be turned down when the app becomes * idle. Basic scaling is ideal for work that is intermittent or driven by * user activity. */ - basicScaling: Schema$BasicScaling; + export interface Schema$BasicScaling { + /** + * Duration of time after the last request that an instance must wait before + * the instance is shut down. + */ + idleTimeout: string; + /** + * Maximum number of instances to create for this version. + */ + maxInstances: number; + } /** - * Metadata settings that are supplied to this version to enable beta runtime - * features. - */ - betaSettings: any; + * Docker image that is used to create a container and start a VM instance for + * the version that you deploy. Only applicable for instances running in the + * App Engine flexible environment. + */ + export interface Schema$ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI + * must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or + * "gcr.io/my-project/image@digest" + */ + image: string; + } /** - * Time that this version was created.@OutputOnly + * Target scaling by CPU usage. */ - creationTime: string; + export interface Schema$CpuUtilization { + /** + * Period of time over which CPU utilization is calculated. + */ + aggregationWindowLength: string; + /** + * Target CPU utilization ratio to maintain when scaling. Must be between 0 + * and 1. + */ + targetUtilization: number; + } /** - * Duration that static files should be cached by web proxies and browsers. - * Only applicable if the corresponding StaticFilesHandler - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) - * does not specify its own expiration time.Only returned in GET requests if - * view=FULL is set. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1.CreateVersionRequest. */ - defaultExpiration: string; + export interface Schema$CreateVersionMetadataV1 { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Email address of the user who created this version.@OutputOnly + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1alpha.CreateVersionRequest. */ - deployer: string; + export interface Schema$CreateVersionMetadataV1Alpha { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Code and application artifacts that make up this version.Only returned in - * GET requests if view=FULL is set. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1beta.CreateVersionRequest. */ - deployment: Schema$Deployment; + export interface Schema$CreateVersionMetadataV1Beta { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud - * Endpoints Extensible Service Proxy will be provided to serve the API - * implemented by the app. - */ - endpointsApiService: Schema$EndpointsApiService; + * Request message for Instances.DebugInstance. + */ + export interface Schema$DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa + * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh + * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For + * more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey: string; + } /** - * App Engine execution environment to use for this version.Defaults to 1. - */ - env: string; + * Code and application artifacts used to deploy a version to App Engine. + */ + export interface Schema$Deployment { + /** + * The Docker image for the container that runs the version. Only applicable + * for instances running in the App Engine flexible environment. + */ + container: Schema$ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as + * part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files: any; + /** + * Origin of the source code for this deployment. There can be more than one + * source reference per version if source code is distributed among multiple + * repositories. + */ + sourceReferences: Schema$SourceReference[]; + } /** - * Environment variables made available to the application.Only returned in - * GET requests if view=FULL is set. - */ - envVariables: any; + * Target scaling by disk usage. Only applicable for VM runtimes. + */ + export interface Schema$DiskUtilization { + /** + * Target bytes read per second. + */ + targetReadBytesPerSec: number; + /** + * Target ops read per second. + */ + targetReadOpsPerSec: number; + /** + * Target bytes written per second. + */ + targetWriteBytesPerSec: number; + /** + * Target ops written per second. + */ + targetWriteOpsPerSec: number; + } /** - * Custom static error pages. Limited to 10KB per page.Only returned in GET - * requests if view=FULL is set. - */ - errorHandlers: Schema$ErrorHandler[]; + * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The + * Endpoints API Service provides tooling for serving Open API and gRPC + * endpoints via an NGINX proxy. Only valid for App Engine Flexible + * environment deployments..The fields here refer to the name and + * configuration id of a "service" resource in the Service + * Management API (https://cloud.google.com/service-management/overview). + */ + export interface Schema$EndpointsApiService { + /** + * Endpoints service configuration id as specified by the Service Management + * API. For example "2016-09-19r1"By default, the Endpoints + * service configuration id is fixed and config_id must be specified. To + * keep the Endpoints service configuration id updated with each rollout, + * specify RolloutStrategy.MANAGED and omit config_id. + */ + configId: string; + /** + * Endpoints service name which is the name of the "service" + * resource in the Service Management API. For example + * "myapi.endpoints.myproject.cloud.goog" + */ + name: string; + /** + * Endpoints rollout strategy. If FIXED, config_id must be specified. If + * MANAGED, config_id must be omitted. + */ + rolloutStrategy: string; + } /** - * An ordered list of URL-matching patterns that should be applied to incoming - * requests. The first matching URL handles the request and other request - * handlers are not attempted.Only returned in GET requests if view=FULL is - * set. - */ - handlers: Schema$UrlMap[]; + * Custom static error page to be served when an error occurs. + */ + export interface Schema$ErrorHandler { + /** + * Error condition this handler applies to. + */ + errorCode: string; + /** + * MIME type of file. Defaults to text/html. + */ + mimeType: string; + /** + * Static file content to be served for this error. + */ + staticFile: string; + } /** - * Configures health checking for VM instances. Unhealthy instances are - * stopped and replaced with new instances. Only applicable for VM - * runtimes.Only returned in GET requests if view=FULL is set. - */ - healthCheck: Schema$HealthCheck; + * Single source file that is part of the version to be deployed. Each source + * file that is deployed must be specified separately. + */ + export interface Schema$FileInfo { + /** + * The MIME type of the file.Defaults to the value from Google Cloud + * Storage. + */ + mimeType: string; + /** + * The SHA1 hash of the file, in hex. + */ + sha1Sum: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in + * Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; + } /** - * Relative name of the version within the module. Example: v1. Version names - * can contain only lowercase letters, numbers, or hyphens. Reserved names: - * "default", "latest", and any name with the prefix - * "ah-". - */ - id: string; + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. Only applicable for instances in + * App Engine flexible environment. + */ + export interface Schema$HealthCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Whether to explicitly disable health checks for this instance. + */ + disableHealthCheck: boolean; + /** + * Number of consecutive successful health checks required before receiving + * traffic. + */ + healthyThreshold: number; + /** + * Host header to send when performing an HTTP health check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * Number of consecutive failed health checks required before an instance is + * restarted. + */ + restartThreshold: number; + /** + * Time before the health check is considered failed. + */ + timeout: string; + /** + * Number of consecutive failed health checks required before removing + * traffic. + */ + unhealthyThreshold: number; + } /** - * Before an application can receive email or XMPP messages, the application - * must be configured to enable the service. - */ - inboundServices: string[]; + * Identity-Aware Proxy + */ + export interface Schema$IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all + * incoming requests.If true, the oauth2_client_id and oauth2_client_secret + * fields must be non-empty. + */ + enabled: boolean; + /** + * OAuth2 client ID to use for the authentication flow. + */ + oauth2ClientId: string; + /** + * For security reasons, this value cannot be retrieved via the API. + * Instead, the SHA-256 hash of the value is returned in the + * oauth2_client_secret_sha256 field.@InputOnly + */ + oauth2ClientSecret: string; + /** + * Hex-encoded SHA-256 hash of the client secret.@OutputOnly + */ + oauth2ClientSecretSha256: string; + } /** - * Instance class that is used to run this version. Valid values are: - * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, - * B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling - * or BasicScaling. - */ - instanceClass: string; + * An Instance resource is the computing unit that App Engine uses to + * automatically scale an application. + */ + export interface Schema$Instance { + /** + * App Engine release this instance is running on.@OutputOnly + */ + appEngineRelease: string; + /** + * Availability of the instance.@OutputOnly + */ + availability: string; + /** + * Average latency (ms) over the last minute.@OutputOnly + */ + averageLatency: number; + /** + * Number of errors since this instance was started.@OutputOnly + */ + errors: number; + /** + * Relative name of the instance within the version. Example: + * instance-1.@OutputOnly + */ + id: string; + /** + * Total memory in use (bytes).@OutputOnly + */ + memoryUsage: string; + /** + * Full path to the Instance resource in the API. Example: + * apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly + */ + name: string; + /** + * Average queries per second (QPS) over the last minute.@OutputOnly + */ + qps: number; + /** + * Number of requests since this instance was started.@OutputOnly + */ + requests: number; + /** + * Time that this instance was started.@OutputOnly + */ + startTimestamp: string; + /** + * Virtual machine ID of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmId: string; + /** + * The IP address of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmIp: string; + /** + * Name of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmName: string; + /** + * Status of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmStatus: string; + /** + * Whether this instance is in debug mode. Only applicable for instances in + * App Engine flexible environment.@OutputOnly + */ + vmUnlocked: boolean; + /** + * Zone where the virtual machine is located. Only applicable for instances + * in App Engine flexible environment.@OutputOnly + */ + vmZoneName: string; + } /** - * Configuration for third-party Python runtime libraries required by the - * application.Only returned in GET requests if view=FULL is set. - */ - libraries: Schema$Library[]; + * Third-party Python runtime library that is required by the application. + */ + export interface Schema$Library { + /** + * Name of the library. Example: "django". + */ + name: string; + /** + * Version of the library to select, or "latest". + */ + version: string; + } /** - * A module with manual scaling runs continuously, allowing you to perform - * complex initialization and rely on the state of its memory over time. - */ - manualScaling: Schema$ManualScaling; + * Response message for Instances.ListInstances. + */ + export interface Schema$ListInstancesResponse { + /** + * The instances belonging to the requested version. + */ + instances: Schema$Instance[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Full path to the Version resource in the API. Example: - * apps/myapp/modules/default/versions/v1.@OutputOnly - */ - name: string; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Extra network settings. Only applicable for VM runtimes. - */ - network: Schema$Network; + * Response message for Modules.ListModules. + */ + export interface Schema$ListModulesResponse { + /** + * The modules belonging to the requested application. + */ + modules: Schema$Module[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } /** - * Files that match this pattern will not be built into this version. Only - * applicable for Go runtimes.Only returned in GET requests if view=FULL is - * set. - */ - nobuildFilesRegex: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Machine resources for this version. Only applicable for VM runtimes. - */ - resources: Schema$Resources; + * Response message for Versions.ListVersions. + */ + export interface Schema$ListVersionsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The versions belonging to the requested module. + */ + versions: Schema$Version[]; + } /** - * Desired runtime. Example: python27. - */ - runtime: string; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: "us-east1". + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: "projects/example-project/locations/us-east1" + */ + name: string; + } /** - * The version of the API in the given runtime environment. Please see the - * app.yaml reference for valid values at - * https://cloud.google.com/appengine/docs/standard/<language>/config/appref - */ - runtimeApiVersion: string; + * Metadata for the given google.cloud.location.Location. + */ + export interface Schema$LocationMetadata { + /** + * App Engine flexible environment is available in the given + * location.@OutputOnly + */ + flexibleEnvironmentAvailable: boolean; + /** + * App Engine standard environment is available in the given + * location.@OutputOnly + */ + standardEnvironmentAvailable: boolean; + } /** - * Current serving status of this version. Only the versions with a SERVING - * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an - * invalid value. Defaults to SERVING. + * A module with manual scaling runs continuously, allowing you to perform + * complex initialization and rely on the state of its memory over time. */ - servingStatus: string; + export interface Schema$ManualScaling { + /** + * Number of instances to assign to the module at the start. This number can + * later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) + * set_num_instances() function. + */ + instances: number; + } /** - * Whether multiple requests can be dispatched to this version at once. - */ - threadsafe: boolean; + * A Module resource is a logical component of an application that can share + * state and communicate in a secure fashion with other modules. For example, + * an application that handles customer requests might include separate + * modules to handle tasks such as backend data analysis or API requests from + * mobile devices. Each module has a collection of versions that define a + * specific set of code used to implement the functionality of that module. + */ + export interface Schema$Module { + /** + * Relative name of the module within the application. Example: + * default.@OutputOnly + */ + id: string; + /** + * Full path to the Module resource in the API. Example: + * apps/myapp/modules/default.@OutputOnly + */ + name: string; + /** + * Mapping that defines fractional HTTP traffic diversion to different + * versions within the module. + */ + split: Schema$TrafficSplit; + } /** - * Whether to deploy this version in a container on a virtual machine. + * Extra network settings. Only applicable for VM runtimes. */ - vm: boolean; -} -/** - * Volumes mounted within the app container. Only applicable for VM runtimes. - */ -export interface Schema$Volume { + export interface Schema$Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the + * application container. + */ + forwardedPorts: string[]; + /** + * Tag to apply to the VM instance during creation. + */ + instanceTag: string; + /** + * Google Cloud Platform network where the virtual machines are created. + * Specify the short name, not the resource path.Defaults to default. + */ + name: string; + } /** - * Unique name for the volume. - */ - name: string; + * Target scaling by network usage. Only applicable for VM runtimes. + */ + export interface Schema$NetworkUtilization { + /** + * Target bytes received per second. + */ + targetReceivedBytesPerSec: number; + /** + * Target packets received per second. + */ + targetReceivedPacketsPerSec: number; + /** + * Target bytes sent per second. + */ + targetSentBytesPerSec: number; + /** + * Target packets sent per second. + */ + targetSentPacketsPerSec: number; + } /** - * Volume size in gigabytes. - */ - sizeGb: number; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * Underlying volume type, e.g. 'tmpfs'. - */ - volumeType: string; -} - -export class Resource$Apps { - root: Appengine; - locations: Resource$Apps$Locations; - modules: Resource$Apps$Modules; - operations: Resource$Apps$Operations; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Apps$Locations(root); - this.modules = new Resource$Apps$Modules(root); - this.operations = new Resource$Apps$Operations(root); + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadata { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Type of this operation. Deprecated, use method field instead. Example: + * "create_version".@OutputOnly + */ + operationType: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/modules/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; } - - getRoot() { - return this.root; + /** + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1 { + createVersionMetadata: Schema$CreateVersionMetadataV1; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; } - - /** - * appengine.apps.create - * @desc Creates an App Engine application for a Google Cloud Platform - * project. Required fields: id - The ID of the target Cloud Platform project. - * location - The region (https://cloud.google.com/appengine/docs/locations) - * where you want the App Engine application located.For more information - * about App Engine applications, see Managing Projects, Applications, and - * Billing (https://cloud.google.com/appengine/docs/python/console/). - * @alias appengine.apps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Alpha { + createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; } - - /** - * appengine.apps.get - * @desc Gets information about an application. - * @alias appengine.apps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the application to get. Example: apps/myapp. - * @param {boolean=} params.ensureResourcesExist Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta { + createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; } - - /** - * appengine.apps.patch - * @desc Updates the specified Application resource. You can update the - * following fields: auth_domain - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) - * default_cookie_expiration - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) - * @alias appengine.apps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta5 { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method name that initiated this operation. Example: + * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; } -} -export class Resource$Apps$Locations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * Target scaling by request utilization. Only applicable for VM runtimes. + */ + export interface Schema$RequestUtilization { + /** + * Target number of concurrent requests. + */ + targetConcurrentRequests: number; + /** + * Target requests per second. + */ + targetRequestCountPerSec: number; } - - getRoot() { - return this.root; + /** + * Machine resources for a version. + */ + export interface Schema$Resources { + /** + * Number of CPU cores needed. + */ + cpu: number; + /** + * Disk size (GB) needed. + */ + diskGb: number; + /** + * Memory (GB) needed. + */ + memoryGb: number; + /** + * User specified volumes. + */ + volumes: Schema$Volume[]; } - - /** - * appengine.apps.locations.get - * @desc Gets information about a location. - * @alias appengine.apps.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Resource name for the location. - * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Executes a script to handle the request that matches the URL pattern. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/locations/{locationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'locationsId'], - pathParams: ['appsId', 'locationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ScriptHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; } - - /** - * appengine.apps.locations.list - * @desc Lists information about the supported locations for this service. - * @alias appengine.apps.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Reference to a particular snapshot of the source tree used to build and + * deploy the application. + */ + export interface Schema$SourceReference { + /** + * URI string identifying the repository. Example: + * "https://source.developers.google.com/p/app-123/r/default" + */ + repository: string; + /** + * The canonical, persistent identifier of the deployed revision. Aliases + * that include tags or branch names are not allowed. Example (git): + * "2198322f89e0bb2e25021667c2ed489d1fd34e6b" + */ + revisionId: string; } -} - -export class Resource$Apps$Modules { - root: Appengine; - versions: Resource$Apps$Modules$Versions; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.versions = new Resource$Apps$Modules$Versions(root); + /** + * Files served directly to the user for a given URL, such as images, CSS + * stylesheets, or JavaScript source files. Static directory handlers make it + * easy to serve the entire contents of a directory as static files. + */ + export interface Schema$StaticDirectoryHandler { + /** + * Whether files should also be uploaded as code data. By default, files + * declared in static directory handlers are uploaded as static data and are + * only served to end users; they cannot be read by the application. If + * enabled, uploads are charged against both your code and static data + * storage resource quotas. + */ + applicationReadable: boolean; + /** + * Path to the directory containing the static files from the application + * root directory. Everything after the end of the matched URL pattern is + * appended to static_dir to form the full path to the requested file. + */ + directory: string; + /** + * Time a static file served by this handler should be cached. + */ + expiration: string; + /** + * HTTP headers to use for all responses from these URLs. + */ + httpHeaders: any; + /** + * MIME type used to serve all files served by this handler. Defaults to + * file-specific MIME types, which are direved from each file's filename + * extension. + */ + mimeType: string; + /** + * Whether this handler should match the request if the file referenced by + * the handler does not exist. + */ + requireMatchingFile: boolean; } - - getRoot() { - return this.root; + /** + * Files served directly to the user for a given URL, such as images, CSS + * stylesheets, or JavaScript source files. Static file handlers describe + * which files in the application directory are static files, and which URLs + * serve them. + */ + export interface Schema$StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files + * declared in static file handlers are uploaded as static data and are only + * served to end users; they cannot be read by the application. If enabled, + * uploads are charged against both your code and static data storage + * resource quotas. + */ + applicationReadable: boolean; + /** + * Time a static file served by this handler should be cached. + */ + expiration: string; + /** + * HTTP headers to use for all responses from these URLs. + */ + httpHeaders: any; + /** + * MIME type used to serve all files served by this handler. Defaults to + * file-specific MIME types, which are derived from each file's filename + * extension. + */ + mimeType: string; + /** + * Path to the static files matched by the URL pattern, from the application + * root directory. The path can refer to text matched in groupings in the + * URL pattern. + */ + path: string; + /** + * Whether this handler should match the request if the file referenced by + * the handler does not exist. + */ + requireMatchingFile: boolean; + /** + * Regular expression that matches the file paths for all files that should + * be referenced by this handler. + */ + uploadPathRegex: string; } - - /** - * appengine.apps.modules.delete - * @desc Deletes the specified module and all enclosed versions. - * @alias appengine.apps.modules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'modulesId'], - pathParams: ['appsId', 'modulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * appengine.apps.modules.get - * @desc Gets the current configuration of the specified module. - * @alias appengine.apps.modules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'modulesId'], - pathParams: ['appsId', 'modulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Traffic routing configuration for versions within a single module. Traffic + * splits define how traffic directed to the module is assigned to versions. + */ + export interface Schema$TrafficSplit { + /** + * Mapping from version IDs within the module to fractional (0.000, 1] + * allocations of traffic for that version. Each version can be specified + * only once, but some versions in the module may not have any traffic + * allocation. Modules that have traffic allocated cannot be deleted until + * either the module is deleted or their traffic allocation is removed. + * Allocations must sum to 1. Up to two decimal place precision is supported + * for IP-based splits and up to three decimal places is supported for + * cookie-based splits. + */ + allocations: any; + /** + * Mechanism used to determine which version a request is sent to. The + * traffic selection algorithm will be stable for either type until + * allocations are changed. + */ + shardBy: string; } - - /** - * appengine.apps.modules.list - * @desc Lists all the modules in the application. - * @alias appengine.apps.modules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/modules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Rules to match an HTTP request and dispatch that request to a module. + */ + export interface Schema$UrlDispatchRule { + /** + * Domain name to match against. The wildcard "*" is supported if + * specified before a period: "*.".Defaults to matching all + * domains: "*". + */ + domain: string; + /** + * Resource ID of a module in this application that should serve the matched + * request. The module must already exist. Example: default. + */ + module: string; + /** + * Pathname within the host. Must start with a "/". A single + * "*" can be included at the end of the path. The sum of the + * lengths of the domain and path may not exceed 100 characters. + */ + path: string; } - - /** - * appengine.apps.modules.patch - * @desc Updates the configuration of the specified module. - * @alias appengine.apps.modules.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules#shardby) field in the Module resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {().Module} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'modulesId'], - pathParams: ['appsId', 'modulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * URL pattern and description of how the URL should be handled. App Engine + * can handle URLs by executing application code, or by serving static files + * uploaded with the version, such as images, CSS, or JavaScript. + */ + export interface Schema$UrlMap { + /** + * Uses API Endpoints to handle requests. + */ + apiEndpoint: Schema$ApiEndpointHandler; + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. + */ + login: string; + /** + * 30x code to use when performing redirects for the secure field. Defaults + * to 302. + */ + redirectHttpResponseCode: string; + /** + * Executes a script to handle the request that matches this URL pattern. + */ + script: Schema$ScriptHandler; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * Serves the entire contents of a directory as static files.This attribute + * is deprecated. You can mimic the behavior of static directories using + * static files. + */ + staticDirectory: Schema$StaticDirectoryHandler; + /** + * Returns the contents of a file, such as an image, as the response. + */ + staticFiles: Schema$StaticFilesHandler; + /** + * A URL prefix. Uses regular expression syntax, which means regexp special + * characters must be escaped, but should not contain groupings. All URLs + * that begin with this prefix are handled by this handler, using the + * portion of the URL after the prefix as part of the file path. + */ + urlRegex: string; } -} -export class Resource$Apps$Modules$Versions { - root: Appengine; - instances: Resource$Apps$Modules$Versions$Instances; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.instances = new Resource$Apps$Modules$Versions$Instances(root); + /** + * A Version resource is a specific set of source code and configuration files + * that are deployed into a module. + */ + export interface Schema$Version { + /** + * Serving configuration for Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned + * in GET requests if view=FULL is set. + */ + apiConfig: Schema$ApiConfigHandler; + /** + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. + */ + automaticScaling: Schema$AutomaticScaling; + /** + * A module with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. + */ + basicScaling: Schema$BasicScaling; + /** + * Metadata settings that are supplied to this version to enable beta + * runtime features. + */ + betaSettings: any; + /** + * Time that this version was created.@OutputOnly + */ + creationTime: string; + /** + * Duration that static files should be cached by web proxies and browsers. + * Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) + * does not specify its own expiration time.Only returned in GET requests if + * view=FULL is set. + */ + defaultExpiration: string; + /** + * Email address of the user who created this version.@OutputOnly + */ + deployer: string; + /** + * Code and application artifacts that make up this version.Only returned in + * GET requests if view=FULL is set. + */ + deployment: Schema$Deployment; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud + * Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService: Schema$EndpointsApiService; + /** + * App Engine execution environment to use for this version.Defaults to 1. + */ + env: string; + /** + * Environment variables made available to the application.Only returned in + * GET requests if view=FULL is set. + */ + envVariables: any; + /** + * Custom static error pages. Limited to 10KB per page.Only returned in GET + * requests if view=FULL is set. + */ + errorHandlers: Schema$ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to + * incoming requests. The first matching URL handles the request and other + * request handlers are not attempted.Only returned in GET requests if + * view=FULL is set. + */ + handlers: Schema$UrlMap[]; + /** + * Configures health checking for VM instances. Unhealthy instances are + * stopped and replaced with new instances. Only applicable for VM + * runtimes.Only returned in GET requests if view=FULL is set. + */ + healthCheck: Schema$HealthCheck; + /** + * Relative name of the version within the module. Example: v1. Version + * names can contain only lowercase letters, numbers, or hyphens. Reserved + * names: "default", "latest", and any name with the + * prefix "ah-". + */ + id: string; + /** + * Before an application can receive email or XMPP messages, the application + * must be configured to enable the service. + */ + inboundServices: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, + * B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for + * ManualScaling or BasicScaling. + */ + instanceClass: string; + /** + * Configuration for third-party Python runtime libraries required by the + * application.Only returned in GET requests if view=FULL is set. + */ + libraries: Schema$Library[]; + /** + * A module with manual scaling runs continuously, allowing you to perform + * complex initialization and rely on the state of its memory over time. + */ + manualScaling: Schema$ManualScaling; + /** + * Full path to the Version resource in the API. Example: + * apps/myapp/modules/default/versions/v1.@OutputOnly + */ + name: string; + /** + * Extra network settings. Only applicable for VM runtimes. + */ + network: Schema$Network; + /** + * Files that match this pattern will not be built into this version. Only + * applicable for Go runtimes.Only returned in GET requests if view=FULL is + * set. + */ + nobuildFilesRegex: string; + /** + * Machine resources for this version. Only applicable for VM runtimes. + */ + resources: Schema$Resources; + /** + * Desired runtime. Example: python27. + */ + runtime: string; + /** + * The version of the API in the given runtime environment. Please see the + * app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard/<language>/config/appref + */ + runtimeApiVersion: string; + /** + * Current serving status of this version. Only the versions with a SERVING + * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is + * an invalid value. Defaults to SERVING. + */ + servingStatus: string; + /** + * Whether multiple requests can be dispatched to this version at once. + */ + threadsafe: boolean; + /** + * Whether to deploy this version in a container on a virtual machine. + */ + vm: boolean; } - - getRoot() { - return this.root; + /** + * Volumes mounted within the app container. Only applicable for VM runtimes. + */ + export interface Schema$Volume { + /** + * Unique name for the volume. + */ + name: string; + /** + * Volume size in gigabytes. + */ + sizeGb: number; + /** + * Underlying volume type, e.g. 'tmpfs'. + */ + volumeType: string; } + export class Resource$Apps { + root: Appengine; + locations: Resource$Apps$Locations; + modules: Resource$Apps$Modules; + operations: Resource$Apps$Operations; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Apps$Locations(root); + this.modules = new Resource$Apps$Modules(root); + this.operations = new Resource$Apps$Operations(root); + } - /** - * appengine.apps.modules.versions.create - * @desc Deploys code and resource files to a new version. - * @alias appengine.apps.modules.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.create + * @desc Creates an App Engine application for a Google Cloud Platform + * project. Required fields: id - The ID of the target Cloud Platform + * project. location - The region + * (https://cloud.google.com/appengine/docs/locations) where you want the + * App Engine application located.For more information about App Engine + * applications, see Managing Projects, Applications, and Billing + * (https://cloud.google.com/appengine/docs/python/console/). + * @alias appengine.apps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'modulesId'], - pathParams: ['appsId', 'modulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.get + * @desc Gets information about an application. + * @alias appengine.apps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the application to get. Example: apps/myapp. + * @param {boolean=} params.ensureResourcesExist Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.modules.versions.delete - * @desc Deletes an existing version. - * @alias appengine.apps.modules.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.patch + * @desc Updates the specified Application resource. You can update the + * following fields: auth_domain + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) + * default_cookie_expiration + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) + * @alias appengine.apps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Locations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId'], - pathParams: ['appsId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.modules.versions.get - * @desc Gets the specified Version resource. By default, only a BASIC_VIEW - * will be returned. Specify the FULL_VIEW parameter to get the full resource. - * @alias appengine.apps.modules.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the Get response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.locations.get + * @desc Gets information about a location. + * @alias appengine.apps.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Resource name for the location. + * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/locations/{locationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'locationsId'], + pathParams: ['appsId', 'locationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId'], - pathParams: ['appsId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.locations.list + * @desc Lists information about the supported locations for this service. + * @alias appengine.apps.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.modules.versions.list - * @desc Lists the versions of a module. - * @alias appengine.apps.modules.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string=} params.view Controls the set of fields returned in the List response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Apps$Modules { + root: Appengine; + versions: Resource$Apps$Modules$Versions; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.versions = new Resource$Apps$Modules$Versions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'modulesId'], - pathParams: ['appsId', 'modulesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.modules.delete + * @desc Deletes the specified module and all enclosed versions. + * @alias appengine.apps.modules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'modulesId'], + pathParams: ['appsId', 'modulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.modules.versions.patch - * @desc Updates the specified Version resource. You can specify the following - * fields depending on the App Engine environment and type of scaling that the - * version resource uses: serving_status - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.serving_status): - * For Version resources that use basic scaling, manual scaling, or run in the - * App Engine flexible environment. instance_class - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.instance_class): - * For Version resources that run in the App Engine standard environment. - * automatic_scaling.min_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.max_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. - * @alias appengine.apps.modules.versions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default/versions/1. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.modules.get + * @desc Gets the current configuration of the specified module. + * @alias appengine.apps.modules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'modulesId'], + pathParams: ['appsId', 'modulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.modules.list + * @desc Lists all the modules in the application. + * @alias appengine.apps.modules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/modules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId'], - pathParams: ['appsId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.modules.patch + * @desc Updates the configuration of the specified module. + * @alias appengine.apps.modules.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules#shardby) field in the Module resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {().Module} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/modules/{modulesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'modulesId'], + pathParams: ['appsId', 'modulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Apps$Modules$Versions$Instances { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Apps$Modules$Versions { + root: Appengine; + instances: Resource$Apps$Modules$Versions$Instances; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.instances = new Resource$Apps$Modules$Versions$Instances(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.modules.versions.instances.debug - * @desc Enables debugging on a VM instance. This allows you to use the SSH - * command to connect to the virtual machine where the instance lives. While - * in "debug mode", the instance continues to serve live traffic. You should - * delete the instance when you are done debugging and then allow the system - * to take over and determine if another instance should be started.Only - * applicable for instances in App Engine flexible environment. - * @alias appengine.apps.modules.versions.instances.debug - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().DebugInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - debug(params?: any, options?: MethodOptions): AxiosPromise; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.modules.versions.create + * @desc Deploys code and resource files to a new version. + * @alias appengine.apps.modules.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'modulesId'], + pathParams: ['appsId', 'modulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.modules.versions.instances.delete - * @desc Stops a running instance. - * @alias appengine.apps.modules.versions.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.modules.versions.delete + * @desc Deletes an existing version. + * @alias appengine.apps.modules.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId'], + pathParams: ['appsId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.modules.versions.get + * @desc Gets the specified Version resource. By default, only a BASIC_VIEW + * will be returned. Specify the FULL_VIEW parameter to get the full + * resource. + * @alias appengine.apps.modules.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the Get response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId'], + pathParams: ['appsId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.modules.versions.list + * @desc Lists the versions of a module. + * @alias appengine.apps.modules.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string=} params.view Controls the set of fields returned in the List response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'modulesId'], + pathParams: ['appsId', 'modulesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.modules.versions.instances.get - * @desc Gets instance information. - * @alias appengine.apps.modules.versions.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.modules.versions.patch + * @desc Updates the specified Version resource. You can specify the + * following fields depending on the App Engine environment and type of + * scaling that the version resource uses: serving_status + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.serving_status): + * For Version resources that use basic scaling, manual scaling, or run in + * the App Engine flexible environment. instance_class + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.instance_class): + * For Version resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps.modules.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. + * @alias appengine.apps.modules.versions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/modules/default/versions/1. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId'], + pathParams: ['appsId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Modules$Versions$Instances { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.modules.versions.instances.list - * @desc Lists the instances of a version.Tip: To aggregate details about - * instances over time, see the Stackdriver Monitoring API - * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * @alias appengine.apps.modules.versions.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. - * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.modules.versions.instances.debug + * @desc Enables debugging on a VM instance. This allows you to use the SSH + * command to connect to the virtual machine where the instance lives. While + * in "debug mode", the instance continues to serve live traffic. You should + * delete the instance when you are done debugging and then allow the system + * to take over and determine if another instance should be started.Only + * applicable for instances in App Engine flexible environment. + * @alias appengine.apps.modules.versions.instances.debug + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().DebugInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + debug(params?: any, options?: MethodOptions): + AxiosPromise; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}:debug') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'modulesId', 'versionsId'], - pathParams: ['appsId', 'modulesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.modules.versions.instances.delete + * @desc Stops a running instance. + * @alias appengine.apps.modules.versions.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} + /** + * appengine.apps.modules.versions.instances.get + * @desc Gets instance information. + * @alias appengine.apps.modules.versions.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } -export class Resource$Apps$Operations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * appengine.apps.modules.versions.instances.list + * @desc Lists the instances of a version.Tip: To aggregate details about + * instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @alias appengine.apps.modules.versions.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/modules/default/versions/v1. + * @param {string} params.modulesId Part of `name`. See documentation of `appsId`. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta4/apps/{appsId}/modules/{modulesId}/versions/{versionsId}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'modulesId', 'versionsId'], + pathParams: ['appsId', 'modulesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * appengine.apps.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias appengine.apps.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation resource. - * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + + export class Resource$Apps$Operations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/operations/{operationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'operationsId'], - pathParams: ['appsId', 'operationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias appengine.apps.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias appengine.apps.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation resource. + * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta4/apps/{appsId}/operations/{operationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'operationsId'], + pathParams: ['appsId', 'operationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta4/apps/{appsId}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias appengine.apps.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta4/apps/{appsId}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appengine/v1beta5.ts b/src/apis/appengine/v1beta5.ts index d6bf0b5a633..4b7517f1d58 100644 --- a/src/apis/appengine/v1beta5.ts +++ b/src/apis/appengine/v1beta5.ts @@ -27,2626 +27,2652 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * App Engine Admin API - * - * The App Engine Admin API enables developers to provision and manage their App - * Engine applications. - * - * @example - * const google = require('googleapis'); - * const appengine = google.appengine('v1beta5'); - * - * @namespace appengine - * @type {Function} - * @version v1beta5 - * @variation v1beta5 - * @param {object=} options Options for Appengine - */ -export class Appengine { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - apps: Resource$Apps; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.apps = new Resource$Apps(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for - * API handlers. - */ -export interface Schema$ApiConfigHandler { - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. Defaults to optional. - */ - login: string; - /** - * Path to the script from the application root directory. - */ - script: string; - /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; - /** - * URL to serve the endpoint at. - */ - url: string; -} -/** - * Uses Google Cloud Endpoints to handle requests. - */ -export interface Schema$ApiEndpointHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * An Application resource contains the top-level configuration of an App Engine - * application. - */ -export interface Schema$Application { - /** - * Google Apps authentication domain that controls which users can access this - * application.Defaults to open access for any Google Account. - */ - authDomain: string; - /** - * A Google Cloud Storage bucket that can be used for storing files associated - * with this application. This bucket is associated with the application and - * can be used by the gcloud deployment commands.@OutputOnly - */ - codeBucket: string; - /** - * A Google Cloud Storage bucket that can be used by the application to store - * content.@OutputOnly - */ - defaultBucket: string; - /** - * Cookie expiration policy for this application. - */ - defaultCookieExpiration: string; - /** - * Hostname used to reach the application, as resolved by App - * Engine.@OutputOnly - */ - defaultHostname: string; - /** - * HTTP path dispatch rules for requests to the application that do not - * explicitly target a service or version. Rules are - * order-dependent.@OutputOnly - */ - dispatchRules: Schema$UrlDispatchRule[]; - iap: Schema$IdentityAwareProxy; - /** - * Identifier of the Application resource. This identifier is equivalent to - * the project ID of the Google Cloud Platform project where you want to - * deploy your application. Example: myapp. - */ - id: string; - /** - * Location from which this application will be run. Application instances - * will run out of data centers in the chosen location, which is also where - * all of the application's end user content is stored.Defaults to - * us-central.Options are:us-central - Central USeurope-west - Western - * Europeus-east1 - Eastern US - */ - location: string; - /** - * Full path to the Application resource in the API. Example: - * apps/myapp.@OutputOnly - */ - name: string; -} -/** - * Automatic scaling is based on request rate, response latencies, and other - * application metrics. - */ -export interface Schema$AutomaticScaling { - /** - * Amount of time that the Autoscaler - * (https://cloud.google.com/compute/docs/autoscaler/) should wait between - * changes to the number of virtual machines. Only applicable for VM runtimes. - */ - coolDownPeriod: string; - /** - * Target scaling by CPU usage. - */ - cpuUtilization: Schema$CpuUtilization; - /** - * Target scaling by disk usage. - */ - diskUtilization: Schema$DiskUtilization; - /** - * Number of concurrent requests an automatic scaling instance can accept - * before the scheduler spawns a new instance.Defaults to a runtime-specific - * value. - */ - maxConcurrentRequests: number; - /** - * Maximum number of idle instances that should be maintained for this - * version. - */ - maxIdleInstances: number; - /** - * Maximum amount of time that a request should wait in the pending queue - * before starting a new instance to handle it. - */ - maxPendingLatency: string; - /** - * Maximum number of instances that should be started to handle requests. - */ - maxTotalInstances: number; - /** - * Minimum number of idle instances that should be maintained for this - * version. Only applicable for the default version of a module. - */ - minIdleInstances: number; - /** - * Minimum amount of time a request should wait in the pending queue before - * starting a new instance to handle it. - */ - minPendingLatency: string; - /** - * Minimum number of instances that should be maintained for this version. - */ - minTotalInstances: number; - /** - * Target scaling by network usage. - */ - networkUtilization: Schema$NetworkUtilization; - /** - * Target scaling by request utilization. - */ - requestUtilization: Schema$RequestUtilization; -} -/** - * A service with basic scaling will create an instance when the application - * receives a request. The instance will be turned down when the app becomes - * idle. Basic scaling is ideal for work that is intermittent or driven by user - * activity. - */ -export interface Schema$BasicScaling { - /** - * Duration of time after the last request that an instance must wait before - * the instance is shut down. - */ - idleTimeout: string; - /** - * Maximum number of instances to create for this version. - */ - maxInstances: number; -} -/** - * Docker image that is used to create a container and start a VM instance for - * the version that you deploy. Only applicable for instances running in the App - * Engine flexible environment. - */ -export interface Schema$ContainerInfo { - /** - * URI to the hosted container image in Google Container Registry. The URI - * must be fully qualified and include a tag or digest. Examples: - * "gcr.io/my-project/image:tag" or - * "gcr.io/my-project/image@digest" - */ - image: string; -} -/** - * Target scaling by CPU usage. - */ -export interface Schema$CpuUtilization { - /** - * Period of time over which CPU utilization is calculated. - */ - aggregationWindowLength: string; - /** - * Target CPU utilization ratio to maintain when scaling. Must be between 0 - * and 1. - */ - targetUtilization: number; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1 { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1alpha.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Alpha { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Metadata for the given google.longrunning.Operation during a - * google.appengine.v1beta.CreateVersionRequest. - */ -export interface Schema$CreateVersionMetadataV1Beta { - /** - * The Cloud Build ID if one was created as part of the version create. - * @OutputOnly - */ - cloudBuildId: string; -} -/** - * Request message for Instances.DebugInstance. - */ -export interface Schema$DebugInstanceRequest { - /** - * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa - * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh - * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For - * more information, see Adding and Removing SSH Keys - * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). - */ - sshKey: string; -} -/** - * Code and application artifacts used to deploy a version to App Engine. - */ -export interface Schema$Deployment { - /** - * The Docker image for the container that runs the version. Only applicable - * for instances running in the App Engine flexible environment. - */ - container: Schema$ContainerInfo; - /** - * Manifest of the files stored in Google Cloud Storage that are included as - * part of this version. All files must be readable using the credentials - * supplied with this call. - */ - files: any; - /** - * Origin of the source code for this deployment. There can be more than one - * source reference per version if source code is distributed among multiple - * repositories. - */ - sourceReferences: Schema$SourceReference[]; -} -/** - * Target scaling by disk usage. Only applicable for VM runtimes. - */ -export interface Schema$DiskUtilization { - /** - * Target bytes read per second. - */ - targetReadBytesPerSec: number; - /** - * Target ops read per second. - */ - targetReadOpsPerSec: number; - /** - * Target bytes written per second. - */ - targetWriteBytesPerSec: number; - /** - * Target ops written per second. - */ - targetWriteOpsPerSec: number; -} -/** - * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The - * Endpoints API Service provides tooling for serving Open API and gRPC - * endpoints via an NGINX proxy. Only valid for App Engine Flexible environment - * deployments.The fields here refer to the name and configuration id of a - * "service" resource in the Service Management API - * (https://cloud.google.com/service-management/overview). - */ -export interface Schema$EndpointsApiService { - /** - * Endpoints service configuration id as specified by the Service Management - * API. For example "2016-09-19r1"By default, the Endpoints service - * configuration id is fixed and config_id must be specified. To keep the - * Endpoints service configuration id updated with each rollout, specify - * RolloutStrategy.MANAGED and omit config_id. - */ - configId: string; - /** - * Endpoints service name which is the name of the "service" - * resource in the Service Management API. For example - * "myapi.endpoints.myproject.cloud.goog" - */ - name: string; - /** - * Endpoints rollout strategy. If FIXED, config_id must be specified. If - * MANAGED, config_id must be omitted. - */ - rolloutStrategy: string; -} -/** - * Custom static error page to be served when an error occurs. - */ -export interface Schema$ErrorHandler { - /** - * Error condition this handler applies to. - */ - errorCode: string; - /** - * MIME type of file. Defaults to text/html. - */ - mimeType: string; - /** - * Static file content to be served for this error. - */ - staticFile: string; -} -/** - * Single source file that is part of the version to be deployed. Each source - * file that is deployed must be specified separately. - */ -export interface Schema$FileInfo { - /** - * The MIME type of the file.Defaults to the value from Google Cloud Storage. - */ - mimeType: string; - /** - * The SHA1 hash of the file, in hex. - */ - sha1Sum: string; - /** - * URL source to use to fetch this file. Must be a URL to a resource in Google - * Cloud Storage in the form - * 'http(s)://storage.googleapis.com/<bucket>/<object>'. - */ - sourceUrl: string; -} -/** - * Health checking configuration for VM instances. Unhealthy instances are - * killed and replaced with new instances. Only applicable for instances in App - * Engine flexible environment. - */ -export interface Schema$HealthCheck { - /** - * Interval between health checks. - */ - checkInterval: string; - /** - * Whether to explicitly disable health checks for this instance. - */ - disableHealthCheck: boolean; - /** - * Number of consecutive successful health checks required before receiving - * traffic. - */ - healthyThreshold: number; - /** - * Host header to send when performing an HTTP health check. Example: - * "myapp.appspot.com" - */ - host: string; - /** - * Number of consecutive failed health checks required before an instance is - * restarted. - */ - restartThreshold: number; - /** - * Time before the health check is considered failed. - */ - timeout: string; - /** - * Number of consecutive failed health checks required before removing - * traffic. - */ - unhealthyThreshold: number; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$IdentityAwareProxy { - /** - * Whether the serving infrastructure will authenticate and authorize all - * incoming requests.If true, the oauth2_client_id and oauth2_client_secret - * fields must be non-empty. - */ - enabled: boolean; - /** - * OAuth2 client ID to use for the authentication flow. - */ - oauth2ClientId: string; - /** - * For security reasons, this value cannot be retrieved via the API. Instead, - * the SHA-256 hash of the value is returned in the - * oauth2_client_secret_sha256 field.@InputOnly - */ - oauth2ClientSecret: string; - /** - * Hex-encoded SHA-256 hash of the client secret.@OutputOnly - */ - oauth2ClientSecretSha256: string; -} -/** - * An Instance resource is the computing unit that App Engine uses to - * automatically scale an application. - */ -export interface Schema$Instance { - /** - * App Engine release this instance is running on.@OutputOnly - */ - appEngineRelease: string; - /** - * Availability of the instance.@OutputOnly - */ - availability: string; - /** - * Average latency (ms) over the last minute.@OutputOnly - */ - averageLatency: number; - /** - * Number of errors since this instance was started.@OutputOnly - */ - errors: number; - /** - * Relative name of the instance within the version. Example: - * instance-1.@OutputOnly - */ - id: string; - /** - * Total memory in use (bytes).@OutputOnly - */ - memoryUsage: string; - /** - * Full path to the Instance resource in the API. Example: - * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly - */ - name: string; - /** - * Average queries per second (QPS) over the last minute.@OutputOnly - */ - qps: number; - /** - * Number of requests since this instance was started.@OutputOnly - */ - requests: number; - /** - * Time that this instance was started.@OutputOnly - */ - startTimestamp: string; - /** - * Virtual machine ID of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmId: string; - /** - * The IP address of this instance. Only applicable for instances in App - * Engine flexible environment.@OutputOnly - */ - vmIp: string; - /** - * Name of the virtual machine where this instance lives. Only applicable for - * instances in App Engine flexible environment.@OutputOnly - */ - vmName: string; - /** - * Status of the virtual machine where this instance lives. Only applicable - * for instances in App Engine flexible environment.@OutputOnly - */ - vmStatus: string; - /** - * Whether this instance is in debug mode. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmUnlocked: boolean; - /** - * Zone where the virtual machine is located. Only applicable for instances in - * App Engine flexible environment.@OutputOnly - */ - vmZoneName: string; -} -/** - * Third-party Python runtime library that is required by the application. - */ -export interface Schema$Library { - /** - * Name of the library. Example: "django". - */ - name: string; - /** - * Version of the library to select, or "latest". - */ - version: string; -} -/** - * Response message for Instances.ListInstances. - */ -export interface Schema$ListInstancesResponse { - /** - * The instances belonging to the requested version. - */ - instances: Schema$Instance[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for Services.ListServices. - */ -export interface Schema$ListServicesResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The services belonging to the requested application. - */ - services: Schema$Service[]; -} -/** - * Response message for Versions.ListVersions. - */ -export interface Schema$ListVersionsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The versions belonging to the requested service. - */ - versions: Schema$Version[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: "us-east1". - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: "projects/example-project/locations/us-east1" - */ - name: string; -} -/** - * Metadata for the given google.cloud.location.Location. - */ -export interface Schema$LocationMetadata { - /** - * App Engine flexible environment is available in the given - * location.@OutputOnly - */ - flexibleEnvironmentAvailable: boolean; - /** - * App Engine standard environment is available in the given - * location.@OutputOnly - */ - standardEnvironmentAvailable: boolean; -} -/** - * A service with manual scaling runs continuously, allowing you to perform - * complex initialization and rely on the state of its memory over time. - */ -export interface Schema$ManualScaling { - /** - * Number of instances to assign to the service at the start. This number can - * later be altered by using the Modules API - * (https://cloud.google.com/appengine/docs/python/modules/functions) - * set_num_instances() function. - */ - instances: number; -} -/** - * Extra network settings. Only applicable for VM runtimes. - */ -export interface Schema$Network { - /** - * List of ports, or port pairs, to forward from the virtual machine to the - * application container. - */ - forwardedPorts: string[]; - /** - * Tag to apply to the VM instance during creation. - */ - instanceTag: string; - /** - * Google Cloud Platform network where the virtual machines are created. - * Specify the short name, not the resource path.Defaults to default. - */ - name: string; - /** - * Google Cloud Platform sub-network where the virtual machines are created. - * Specify the short name, not the resource path.If a subnetwork name is - * specified, a network name will also be required unless it is for the - * default network. If the network the VM instance is being created in is a - * Legacy network, then the IP address is allocated from the IPv4Range. If the - * network the VM instance is being created in is an auto Subnet Mode Network, - * then only network name should be specified (not the subnetwork_name) and - * the IP address is created from the IPCidrRange of the subnetwork that - * exists in that zone for that network. If the network the VM instance is - * being created in is a custom Subnet Mode Network, then the subnetwork_name - * must be specified and the IP address is created from the IPCidrRange of the - * subnetwork.If specified, the subnetwork must exist in the same region as - * the Flex app. - */ - subnetworkName: string; -} -/** - * Target scaling by network usage. Only applicable for VM runtimes. - */ -export interface Schema$NetworkUtilization { - /** - * Target bytes received per second. - */ - targetReceivedBytesPerSec: number; - /** - * Target packets received per second. - */ - targetReceivedPacketsPerSec: number; - /** - * Target bytes sent per second. - */ - targetSentBytesPerSec: number; - /** - * Target packets sent per second. - */ - targetSentPacketsPerSec: number; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadata { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Type of this operation. Deprecated, use method field instead. Example: - * "create_version".@OutputOnly - */ - operationType: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/modules/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1 { - createVersionMetadata: Schema$CreateVersionMetadataV1; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Alpha { - createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta { - createVersionMetadata: Schema$CreateVersionMetadataV1Beta; - /** - * Time that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Ephemeral message that may change every time the operation is polled. - * @OutputOnly - */ - ephemeralMessage: string; - /** - * Time that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method that initiated this operation. Example: - * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; - /** - * Durable messages that persist on every operation poll. @OutputOnly - */ - warning: string[]; -} -/** - * Metadata for the given google.longrunning.Operation. - */ -export interface Schema$OperationMetadataV1Beta5 { - /** - * Timestamp that this operation completed.@OutputOnly - */ - endTime: string; - /** - * Timestamp that this operation was created.@OutputOnly - */ - insertTime: string; - /** - * API method name that initiated this operation. Example: - * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly - */ - method: string; - /** - * Name of the resource that this operation is acting on. Example: - * apps/myapp/services/default.@OutputOnly - */ - target: string; - /** - * User who requested this operation.@OutputOnly - */ - user: string; -} -/** - * Target scaling by request utilization. Only applicable for VM runtimes. - */ -export interface Schema$RequestUtilization { - /** - * Target number of concurrent requests. - */ - targetConcurrentRequests: number; - /** - * Target requests per second. - */ - targetRequestCountPerSec: number; -} -/** - * Machine resources for a version. - */ -export interface Schema$Resources { - /** - * Number of CPU cores needed. - */ - cpu: number; - /** - * Disk size (GB) needed. - */ - diskGb: number; - /** - * Memory (GB) needed. - */ - memoryGb: number; - /** - * Volumes mounted within the app container. - */ - volumes: Schema$Volume[]; -} -/** - * Executes a script to handle the request that matches the URL pattern. - */ -export interface Schema$ScriptHandler { - /** - * Path to the script from the application root directory. - */ - scriptPath: string; -} -/** - * A Service resource is a logical component of an application that can share - * state and communicate in a secure fashion with other services. For example, - * an application that handles customer requests might include separate services - * to handle other tasks such as API requests from mobile devices or backend - * data analysis. Each service has a collection of versions that define a - * specific set of code used to implement the functionality of that service. - */ -export interface Schema$Service { - /** - * Relative name of the service within the application. Example: - * default.@OutputOnly - */ - id: string; - /** - * Full path to the Service resource in the API. Example: - * apps/myapp/services/default.@OutputOnly - */ - name: string; - /** - * Mapping that defines fractional HTTP traffic diversion to different - * versions within the service. - */ - split: Schema$TrafficSplit; -} -/** - * Reference to a particular snapshot of the source tree used to build and - * deploy the application. - */ -export interface Schema$SourceReference { - /** - * URI string identifying the repository. Example: - * "https://source.developers.google.com/p/app-123/r/default" - */ - repository: string; - /** - * The canonical, persistent identifier of the deployed revision. Aliases that - * include tags or branch names are not allowed. Example (git): - * "2198322f89e0bb2e25021667c2ed489d1fd34e6b" - */ - revisionId: string; -} -/** - * Files served directly to the user for a given URL, such as images, CSS - * stylesheets, or JavaScript source files. Static file handlers describe which - * files in the application directory are static files, and which URLs serve - * them. - */ -export interface Schema$StaticFilesHandler { - /** - * Whether files should also be uploaded as code data. By default, files - * declared in static file handlers are uploaded as static data and are only - * served to end users; they cannot be read by the application. If enabled, - * uploads are charged against both your code and static data storage resource - * quotas. - */ - applicationReadable: boolean; - /** - * Time a static file served by this handler should be cached. - */ - expiration: string; - /** - * HTTP headers to use for all responses from these URLs. - */ - httpHeaders: any; - /** - * MIME type used to serve all files served by this handler. Defaults to - * file-specific MIME types, which are derived from each file's filename - * extension. - */ - mimeType: string; - /** - * Path to the static files matched by the URL pattern, from the application - * root directory. The path can refer to text matched in groupings in the URL - * pattern. - */ - path: string; - /** - * Whether this handler should match the request if the file referenced by the - * handler does not exist. - */ - requireMatchingFile: boolean; - /** - * Regular expression that matches the file paths for all files that should be - * referenced by this handler. - */ - uploadPathRegex: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Traffic routing configuration for versions within a single service. Traffic - * splits define how traffic directed to the service is assigned to versions. - */ -export interface Schema$TrafficSplit { - /** - * Mapping from version IDs within the service to fractional (0.000, 1] - * allocations of traffic for that version. Each version can be specified only - * once, but some versions in the service may not have any traffic allocation. - * Services that have traffic allocated cannot be deleted until either the - * service is deleted or their traffic allocation is removed. Allocations must - * sum to 1. Up to two decimal place precision is supported for IP-based - * splits and up to three decimal places is supported for cookie-based splits. - */ - allocations: any; - /** - * Mechanism used to determine which version a request is sent to. The traffic - * selection algorithm will be stable for either type until allocations are - * changed. - */ - shardBy: string; -} -/** - * Rules to match an HTTP request and dispatch that request to a service. - */ -export interface Schema$UrlDispatchRule { - /** - * Domain name to match against. The wildcard "*" is supported if - * specified before a period: "*.".Defaults to matching all domains: - * "*". - */ - domain: string; - /** - * Pathname within the host. Must start with a "/". A single - * "*" can be included at the end of the path. The sum of the - * lengths of the domain and path may not exceed 100 characters. - */ - path: string; - /** - * Resource id of a service in this application that should serve the matched - * request. The service must already exist. Example: default. - */ - service: string; -} -/** - * URL pattern and description of how the URL should be handled. App Engine can - * handle URLs by executing application code, or by serving static files - * uploaded with the version, such as images, CSS, or JavaScript. - */ -export interface Schema$UrlMap { - /** - * Uses API Endpoints to handle requests. - */ - apiEndpoint: Schema$ApiEndpointHandler; - /** - * Action to take when users access resources that require authentication. - * Defaults to redirect. - */ - authFailAction: string; - /** - * Level of login required to access this resource. - */ - login: string; - /** - * 30x code to use when performing redirects for the secure field. Defaults to - * 302. - */ - redirectHttpResponseCode: string; - /** - * Executes a script to handle the request that matches this URL pattern. - */ - script: Schema$ScriptHandler; +export namespace appengine_v1beta5 { /** - * Security (HTTPS) enforcement for this URL. - */ - securityLevel: string; + * App Engine Admin API + * + * The App Engine Admin API enables developers to provision and manage their + * App Engine applications. + * + * @example + * const google = require('googleapis'); + * const appengine = google.appengine('v1beta5'); + * + * @namespace appengine + * @type {Function} + * @version v1beta5 + * @variation v1beta5 + * @param {object=} options Options for Appengine + */ + export class Appengine { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + apps: Resource$Apps; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.apps = new Resource$Apps(this); + } + + getRoot() { + return this.root; + } + } + /** - * Returns the contents of a file, such as an image, as the response. - */ - staticFiles: Schema$StaticFilesHandler; + * Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/) configuration + * for API handlers. + */ + export interface Schema$ApiConfigHandler { + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. Defaults to optional. + */ + login: string; + /** + * Path to the script from the application root directory. + */ + script: string; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * URL to serve the endpoint at. + */ + url: string; + } /** - * A URL prefix. Uses regular expression syntax, which means regexp special - * characters must be escaped, but should not contain groupings. All URLs that - * begin with this prefix are handled by this handler, using the portion of - * the URL after the prefix as part of the file path. + * Uses Google Cloud Endpoints to handle requests. */ - urlRegex: string; -} -/** - * A Version resource is a specific set of source code and configuration files - * that are deployed into a service. - */ -export interface Schema$Version { + export interface Schema$ApiEndpointHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; + } /** - * Serving configuration for Google Cloud Endpoints - * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned - * in GET requests if view=FULL is set. - */ - apiConfig: Schema$ApiConfigHandler; + * An Application resource contains the top-level configuration of an App + * Engine application. + */ + export interface Schema$Application { + /** + * Google Apps authentication domain that controls which users can access + * this application.Defaults to open access for any Google Account. + */ + authDomain: string; + /** + * A Google Cloud Storage bucket that can be used for storing files + * associated with this application. This bucket is associated with the + * application and can be used by the gcloud deployment commands.@OutputOnly + */ + codeBucket: string; + /** + * A Google Cloud Storage bucket that can be used by the application to + * store content.@OutputOnly + */ + defaultBucket: string; + /** + * Cookie expiration policy for this application. + */ + defaultCookieExpiration: string; + /** + * Hostname used to reach the application, as resolved by App + * Engine.@OutputOnly + */ + defaultHostname: string; + /** + * HTTP path dispatch rules for requests to the application that do not + * explicitly target a service or version. Rules are + * order-dependent.@OutputOnly + */ + dispatchRules: Schema$UrlDispatchRule[]; + iap: Schema$IdentityAwareProxy; + /** + * Identifier of the Application resource. This identifier is equivalent to + * the project ID of the Google Cloud Platform project where you want to + * deploy your application. Example: myapp. + */ + id: string; + /** + * Location from which this application will be run. Application instances + * will run out of data centers in the chosen location, which is also where + * all of the application's end user content is stored.Defaults to + * us-central.Options are:us-central - Central USeurope-west - Western + * Europeus-east1 - Eastern US + */ + location: string; + /** + * Full path to the Application resource in the API. Example: + * apps/myapp.@OutputOnly + */ + name: string; + } /** * Automatic scaling is based on request rate, response latencies, and other * application metrics. */ - automaticScaling: Schema$AutomaticScaling; + export interface Schema$AutomaticScaling { + /** + * Amount of time that the Autoscaler + * (https://cloud.google.com/compute/docs/autoscaler/) should wait between + * changes to the number of virtual machines. Only applicable for VM + * runtimes. + */ + coolDownPeriod: string; + /** + * Target scaling by CPU usage. + */ + cpuUtilization: Schema$CpuUtilization; + /** + * Target scaling by disk usage. + */ + diskUtilization: Schema$DiskUtilization; + /** + * Number of concurrent requests an automatic scaling instance can accept + * before the scheduler spawns a new instance.Defaults to a runtime-specific + * value. + */ + maxConcurrentRequests: number; + /** + * Maximum number of idle instances that should be maintained for this + * version. + */ + maxIdleInstances: number; + /** + * Maximum amount of time that a request should wait in the pending queue + * before starting a new instance to handle it. + */ + maxPendingLatency: string; + /** + * Maximum number of instances that should be started to handle requests. + */ + maxTotalInstances: number; + /** + * Minimum number of idle instances that should be maintained for this + * version. Only applicable for the default version of a module. + */ + minIdleInstances: number; + /** + * Minimum amount of time a request should wait in the pending queue before + * starting a new instance to handle it. + */ + minPendingLatency: string; + /** + * Minimum number of instances that should be maintained for this version. + */ + minTotalInstances: number; + /** + * Target scaling by network usage. + */ + networkUtilization: Schema$NetworkUtilization; + /** + * Target scaling by request utilization. + */ + requestUtilization: Schema$RequestUtilization; + } /** * A service with basic scaling will create an instance when the application * receives a request. The instance will be turned down when the app becomes * idle. Basic scaling is ideal for work that is intermittent or driven by * user activity. */ - basicScaling: Schema$BasicScaling; + export interface Schema$BasicScaling { + /** + * Duration of time after the last request that an instance must wait before + * the instance is shut down. + */ + idleTimeout: string; + /** + * Maximum number of instances to create for this version. + */ + maxInstances: number; + } /** - * Metadata settings that are supplied to this version to enable beta runtime - * features. - */ - betaSettings: any; + * Docker image that is used to create a container and start a VM instance for + * the version that you deploy. Only applicable for instances running in the + * App Engine flexible environment. + */ + export interface Schema$ContainerInfo { + /** + * URI to the hosted container image in Google Container Registry. The URI + * must be fully qualified and include a tag or digest. Examples: + * "gcr.io/my-project/image:tag" or + * "gcr.io/my-project/image@digest" + */ + image: string; + } /** - * Time that this version was created.@OutputOnly + * Target scaling by CPU usage. */ - creationTime: string; + export interface Schema$CpuUtilization { + /** + * Period of time over which CPU utilization is calculated. + */ + aggregationWindowLength: string; + /** + * Target CPU utilization ratio to maintain when scaling. Must be between 0 + * and 1. + */ + targetUtilization: number; + } /** - * Duration that static files should be cached by web proxies and browsers. - * Only applicable if the corresponding StaticFilesHandler - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) - * does not specify its own expiration time.Only returned in GET requests if - * view=FULL is set. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1.CreateVersionRequest. */ - defaultExpiration: string; + export interface Schema$CreateVersionMetadataV1 { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Email address of the user who created this version.@OutputOnly + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1alpha.CreateVersionRequest. */ - deployer: string; + export interface Schema$CreateVersionMetadataV1Alpha { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Code and application artifacts that make up this version.Only returned in - * GET requests if view=FULL is set. + * Metadata for the given google.longrunning.Operation during a + * google.appengine.v1beta.CreateVersionRequest. */ - deployment: Schema$Deployment; + export interface Schema$CreateVersionMetadataV1Beta { + /** + * The Cloud Build ID if one was created as part of the version create. + * @OutputOnly + */ + cloudBuildId: string; + } /** - * Total size of version files hosted on App Engine disk in bytes.@OutputOnly - */ - diskUsageBytes: string; + * Request message for Instances.DebugInstance. + */ + export interface Schema$DebugInstanceRequest { + /** + * Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa + * [KEY_VALUE] [USERNAME] [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh + * {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}For + * more information, see Adding and Removing SSH Keys + * (https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys). + */ + sshKey: string; + } /** - * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud - * Endpoints Extensible Service Proxy will be provided to serve the API - * implemented by the app. - */ - endpointsApiService: Schema$EndpointsApiService; + * Code and application artifacts used to deploy a version to App Engine. + */ + export interface Schema$Deployment { + /** + * The Docker image for the container that runs the version. Only applicable + * for instances running in the App Engine flexible environment. + */ + container: Schema$ContainerInfo; + /** + * Manifest of the files stored in Google Cloud Storage that are included as + * part of this version. All files must be readable using the credentials + * supplied with this call. + */ + files: any; + /** + * Origin of the source code for this deployment. There can be more than one + * source reference per version if source code is distributed among multiple + * repositories. + */ + sourceReferences: Schema$SourceReference[]; + } /** - * App Engine execution environment to use for this version.Defaults to 1. - */ - env: string; + * Target scaling by disk usage. Only applicable for VM runtimes. + */ + export interface Schema$DiskUtilization { + /** + * Target bytes read per second. + */ + targetReadBytesPerSec: number; + /** + * Target ops read per second. + */ + targetReadOpsPerSec: number; + /** + * Target bytes written per second. + */ + targetWriteBytesPerSec: number; + /** + * Target ops written per second. + */ + targetWriteOpsPerSec: number; + } /** - * Environment variables made available to the application.Only returned in - * GET requests if view=FULL is set. - */ - envVariables: any; + * Cloud Endpoints (https://cloud.google.com/endpoints) configuration. The + * Endpoints API Service provides tooling for serving Open API and gRPC + * endpoints via an NGINX proxy. Only valid for App Engine Flexible + * environment deployments.The fields here refer to the name and configuration + * id of a "service" resource in the Service Management API + * (https://cloud.google.com/service-management/overview). + */ + export interface Schema$EndpointsApiService { + /** + * Endpoints service configuration id as specified by the Service Management + * API. For example "2016-09-19r1"By default, the Endpoints + * service configuration id is fixed and config_id must be specified. To + * keep the Endpoints service configuration id updated with each rollout, + * specify RolloutStrategy.MANAGED and omit config_id. + */ + configId: string; + /** + * Endpoints service name which is the name of the "service" + * resource in the Service Management API. For example + * "myapi.endpoints.myproject.cloud.goog" + */ + name: string; + /** + * Endpoints rollout strategy. If FIXED, config_id must be specified. If + * MANAGED, config_id must be omitted. + */ + rolloutStrategy: string; + } /** - * Custom static error pages. Limited to 10KB per page.Only returned in GET - * requests if view=FULL is set. - */ - errorHandlers: Schema$ErrorHandler[]; + * Custom static error page to be served when an error occurs. + */ + export interface Schema$ErrorHandler { + /** + * Error condition this handler applies to. + */ + errorCode: string; + /** + * MIME type of file. Defaults to text/html. + */ + mimeType: string; + /** + * Static file content to be served for this error. + */ + staticFile: string; + } /** - * An ordered list of URL-matching patterns that should be applied to incoming - * requests. The first matching URL handles the request and other request - * handlers are not attempted.Only returned in GET requests if view=FULL is - * set. - */ - handlers: Schema$UrlMap[]; + * Single source file that is part of the version to be deployed. Each source + * file that is deployed must be specified separately. + */ + export interface Schema$FileInfo { + /** + * The MIME type of the file.Defaults to the value from Google Cloud + * Storage. + */ + mimeType: string; + /** + * The SHA1 hash of the file, in hex. + */ + sha1Sum: string; + /** + * URL source to use to fetch this file. Must be a URL to a resource in + * Google Cloud Storage in the form + * 'http(s)://storage.googleapis.com/<bucket>/<object>'. + */ + sourceUrl: string; + } /** - * Configures health checking for VM instances. Unhealthy instances are be - * stopped and replaced with new instances. Only applicable for VM - * runtimes.Only returned in GET requests if view=FULL is set. - */ - healthCheck: Schema$HealthCheck; + * Health checking configuration for VM instances. Unhealthy instances are + * killed and replaced with new instances. Only applicable for instances in + * App Engine flexible environment. + */ + export interface Schema$HealthCheck { + /** + * Interval between health checks. + */ + checkInterval: string; + /** + * Whether to explicitly disable health checks for this instance. + */ + disableHealthCheck: boolean; + /** + * Number of consecutive successful health checks required before receiving + * traffic. + */ + healthyThreshold: number; + /** + * Host header to send when performing an HTTP health check. Example: + * "myapp.appspot.com" + */ + host: string; + /** + * Number of consecutive failed health checks required before an instance is + * restarted. + */ + restartThreshold: number; + /** + * Time before the health check is considered failed. + */ + timeout: string; + /** + * Number of consecutive failed health checks required before removing + * traffic. + */ + unhealthyThreshold: number; + } /** - * Relative name of the version within the module. Example: v1. Version names - * can contain only lowercase letters, numbers, or hyphens. Reserved names: - * "default", "latest", and any name with the prefix - * "ah-". - */ - id: string; + * Identity-Aware Proxy + */ + export interface Schema$IdentityAwareProxy { + /** + * Whether the serving infrastructure will authenticate and authorize all + * incoming requests.If true, the oauth2_client_id and oauth2_client_secret + * fields must be non-empty. + */ + enabled: boolean; + /** + * OAuth2 client ID to use for the authentication flow. + */ + oauth2ClientId: string; + /** + * For security reasons, this value cannot be retrieved via the API. + * Instead, the SHA-256 hash of the value is returned in the + * oauth2_client_secret_sha256 field.@InputOnly + */ + oauth2ClientSecret: string; + /** + * Hex-encoded SHA-256 hash of the client secret.@OutputOnly + */ + oauth2ClientSecretSha256: string; + } /** - * Before an application can receive email or XMPP messages, the application - * must be configured to enable the service. - */ - inboundServices: string[]; + * An Instance resource is the computing unit that App Engine uses to + * automatically scale an application. + */ + export interface Schema$Instance { + /** + * App Engine release this instance is running on.@OutputOnly + */ + appEngineRelease: string; + /** + * Availability of the instance.@OutputOnly + */ + availability: string; + /** + * Average latency (ms) over the last minute.@OutputOnly + */ + averageLatency: number; + /** + * Number of errors since this instance was started.@OutputOnly + */ + errors: number; + /** + * Relative name of the instance within the version. Example: + * instance-1.@OutputOnly + */ + id: string; + /** + * Total memory in use (bytes).@OutputOnly + */ + memoryUsage: string; + /** + * Full path to the Instance resource in the API. Example: + * apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly + */ + name: string; + /** + * Average queries per second (QPS) over the last minute.@OutputOnly + */ + qps: number; + /** + * Number of requests since this instance was started.@OutputOnly + */ + requests: number; + /** + * Time that this instance was started.@OutputOnly + */ + startTimestamp: string; + /** + * Virtual machine ID of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmId: string; + /** + * The IP address of this instance. Only applicable for instances in App + * Engine flexible environment.@OutputOnly + */ + vmIp: string; + /** + * Name of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmName: string; + /** + * Status of the virtual machine where this instance lives. Only applicable + * for instances in App Engine flexible environment.@OutputOnly + */ + vmStatus: string; + /** + * Whether this instance is in debug mode. Only applicable for instances in + * App Engine flexible environment.@OutputOnly + */ + vmUnlocked: boolean; + /** + * Zone where the virtual machine is located. Only applicable for instances + * in App Engine flexible environment.@OutputOnly + */ + vmZoneName: string; + } /** - * Instance class that is used to run this version. Valid values are: - * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, - * B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling - * or BasicScaling. - */ - instanceClass: string; + * Third-party Python runtime library that is required by the application. + */ + export interface Schema$Library { + /** + * Name of the library. Example: "django". + */ + name: string; + /** + * Version of the library to select, or "latest". + */ + version: string; + } /** - * Configuration for third-party Python runtime libraries required by the - * application.Only returned in GET requests if view=FULL is set. - */ - libraries: Schema$Library[]; + * Response message for Instances.ListInstances. + */ + export interface Schema$ListInstancesResponse { + /** + * The instances belonging to the requested version. + */ + instances: Schema$Instance[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + } + /** + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } + /** + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } + /** + * Response message for Services.ListServices. + */ + export interface Schema$ListServicesResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The services belonging to the requested application. + */ + services: Schema$Service[]; + } + /** + * Response message for Versions.ListVersions. + */ + export interface Schema$ListVersionsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The versions belonging to the requested service. + */ + versions: Schema$Version[]; + } + /** + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: "us-east1". + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: "projects/example-project/locations/us-east1" + */ + name: string; + } + /** + * Metadata for the given google.cloud.location.Location. + */ + export interface Schema$LocationMetadata { + /** + * App Engine flexible environment is available in the given + * location.@OutputOnly + */ + flexibleEnvironmentAvailable: boolean; + /** + * App Engine standard environment is available in the given + * location.@OutputOnly + */ + standardEnvironmentAvailable: boolean; + } /** * A service with manual scaling runs continuously, allowing you to perform * complex initialization and rely on the state of its memory over time. */ - manualScaling: Schema$ManualScaling; - /** - * Full path to the Version resource in the API. Example: - * apps/myapp/services/default/versions/v1.@OutputOnly - */ - name: string; + export interface Schema$ManualScaling { + /** + * Number of instances to assign to the service at the start. This number + * can later be altered by using the Modules API + * (https://cloud.google.com/appengine/docs/python/modules/functions) + * set_num_instances() function. + */ + instances: number; + } /** * Extra network settings. Only applicable for VM runtimes. */ - network: Schema$Network; + export interface Schema$Network { + /** + * List of ports, or port pairs, to forward from the virtual machine to the + * application container. + */ + forwardedPorts: string[]; + /** + * Tag to apply to the VM instance during creation. + */ + instanceTag: string; + /** + * Google Cloud Platform network where the virtual machines are created. + * Specify the short name, not the resource path.Defaults to default. + */ + name: string; + /** + * Google Cloud Platform sub-network where the virtual machines are created. + * Specify the short name, not the resource path.If a subnetwork name is + * specified, a network name will also be required unless it is for the + * default network. If the network the VM instance is being created in is a + * Legacy network, then the IP address is allocated from the IPv4Range. If + * the network the VM instance is being created in is an auto Subnet Mode + * Network, then only network name should be specified (not the + * subnetwork_name) and the IP address is created from the IPCidrRange of + * the subnetwork that exists in that zone for that network. If the network + * the VM instance is being created in is a custom Subnet Mode Network, then + * the subnetwork_name must be specified and the IP address is created from + * the IPCidrRange of the subnetwork.If specified, the subnetwork must exist + * in the same region as the Flex app. + */ + subnetworkName: string; + } /** - * Files that match this pattern will not be built into this version. Only - * applicable for Go runtimes.Only returned in GET requests if view=FULL is - * set. - */ - nobuildFilesRegex: string; + * Target scaling by network usage. Only applicable for VM runtimes. + */ + export interface Schema$NetworkUtilization { + /** + * Target bytes received per second. + */ + targetReceivedBytesPerSec: number; + /** + * Target packets received per second. + */ + targetReceivedPacketsPerSec: number; + /** + * Target bytes sent per second. + */ + targetSentBytesPerSec: number; + /** + * Target packets sent per second. + */ + targetSentPacketsPerSec: number; + } /** - * Machine resources for this version. Only applicable for VM runtimes. - */ - resources: Schema$Resources; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * Desired runtime. Example: python27. - */ - runtime: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadata { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta4.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Type of this operation. Deprecated, use method field instead. Example: + * "create_version".@OutputOnly + */ + operationType: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/modules/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * The version of the API in the given runtime environment. Please see the - * app.yaml reference for valid values at - * https://cloud.google.com/appengine/docs/standard/<language>/config/appref - */ - runtimeApiVersion: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1 { + createVersionMetadata: Schema$CreateVersionMetadataV1; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Current serving status of this version. Only the versions with a SERVING - * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an - * invalid value. Defaults to SERVING. - */ - servingStatus: string; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Alpha { + createVersionMetadata: Schema$CreateVersionMetadataV1Alpha; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1alpha.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Whether multiple requests can be dispatched to this version at once. - */ - threadsafe: boolean; + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta { + createVersionMetadata: Schema$CreateVersionMetadataV1Beta; + /** + * Time that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Ephemeral message that may change every time the operation is polled. + * @OutputOnly + */ + ephemeralMessage: string; + /** + * Time that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method that initiated this operation. Example: + * google.appengine.v1beta.Versions.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + /** + * Durable messages that persist on every operation poll. @OutputOnly + */ + warning: string[]; + } /** - * Whether to deploy this version in a container on a virtual machine. - */ - vm: boolean; -} -/** - * Volumes mounted within the app container. Only applicable for VM runtimes. - */ -export interface Schema$Volume { + * Metadata for the given google.longrunning.Operation. + */ + export interface Schema$OperationMetadataV1Beta5 { + /** + * Timestamp that this operation completed.@OutputOnly + */ + endTime: string; + /** + * Timestamp that this operation was created.@OutputOnly + */ + insertTime: string; + /** + * API method name that initiated this operation. Example: + * google.appengine.v1beta5.Version.CreateVersion.@OutputOnly + */ + method: string; + /** + * Name of the resource that this operation is acting on. Example: + * apps/myapp/services/default.@OutputOnly + */ + target: string; + /** + * User who requested this operation.@OutputOnly + */ + user: string; + } /** - * Unique name for the volume. - */ - name: string; + * Target scaling by request utilization. Only applicable for VM runtimes. + */ + export interface Schema$RequestUtilization { + /** + * Target number of concurrent requests. + */ + targetConcurrentRequests: number; + /** + * Target requests per second. + */ + targetRequestCountPerSec: number; + } /** - * Volume size in gigabytes. - */ - sizeGb: number; + * Machine resources for a version. + */ + export interface Schema$Resources { + /** + * Number of CPU cores needed. + */ + cpu: number; + /** + * Disk size (GB) needed. + */ + diskGb: number; + /** + * Memory (GB) needed. + */ + memoryGb: number; + /** + * Volumes mounted within the app container. + */ + volumes: Schema$Volume[]; + } /** - * Underlying volume type, e.g. 'tmpfs'. + * Executes a script to handle the request that matches the URL pattern. */ - volumeType: string; -} - -export class Resource$Apps { - root: Appengine; - locations: Resource$Apps$Locations; - operations: Resource$Apps$Operations; - services: Resource$Apps$Services; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Apps$Locations(root); - this.operations = new Resource$Apps$Operations(root); - this.services = new Resource$Apps$Services(root); - } - - getRoot() { - return this.root; + export interface Schema$ScriptHandler { + /** + * Path to the script from the application root directory. + */ + scriptPath: string; } - - /** - * appengine.apps.create - * @desc Creates an App Engine application for a Google Cloud Platform - * project. Required fields: id - The ID of the target Cloud Platform project. - * location - The region (https://cloud.google.com/appengine/docs/locations) - * where you want the App Engine application located.For more information - * about App Engine applications, see Managing Projects, Applications, and - * Billing (https://cloud.google.com/appengine/docs/python/console/). - * @alias appengine.apps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Service resource is a logical component of an application that can share + * state and communicate in a secure fashion with other services. For example, + * an application that handles customer requests might include separate + * services to handle other tasks such as API requests from mobile devices or + * backend data analysis. Each service has a collection of versions that + * define a specific set of code used to implement the functionality of that + * service. + */ + export interface Schema$Service { + /** + * Relative name of the service within the application. Example: + * default.@OutputOnly + */ + id: string; + /** + * Full path to the Service resource in the API. Example: + * apps/myapp/services/default.@OutputOnly + */ + name: string; + /** + * Mapping that defines fractional HTTP traffic diversion to different + * versions within the service. + */ + split: Schema$TrafficSplit; } - - /** - * appengine.apps.get - * @desc Gets information about an application. - * @alias appengine.apps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the application to get. Example: apps/myapp. - * @param {boolean=} params.ensureResourcesExist Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. Note: This parameter will be deprecated in a future version of the API. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Reference to a particular snapshot of the source tree used to build and + * deploy the application. + */ + export interface Schema$SourceReference { + /** + * URI string identifying the repository. Example: + * "https://source.developers.google.com/p/app-123/r/default" + */ + repository: string; + /** + * The canonical, persistent identifier of the deployed revision. Aliases + * that include tags or branch names are not allowed. Example (git): + * "2198322f89e0bb2e25021667c2ed489d1fd34e6b" + */ + revisionId: string; } - - /** - * appengine.apps.patch - * @desc Updates the specified Application resource. You can update the - * following fields: auth_domain - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) - * default_cookie_expiration - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration) - * @alias appengine.apps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {().Application} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Files served directly to the user for a given URL, such as images, CSS + * stylesheets, or JavaScript source files. Static file handlers describe + * which files in the application directory are static files, and which URLs + * serve them. + */ + export interface Schema$StaticFilesHandler { + /** + * Whether files should also be uploaded as code data. By default, files + * declared in static file handlers are uploaded as static data and are only + * served to end users; they cannot be read by the application. If enabled, + * uploads are charged against both your code and static data storage + * resource quotas. + */ + applicationReadable: boolean; + /** + * Time a static file served by this handler should be cached. + */ + expiration: string; + /** + * HTTP headers to use for all responses from these URLs. + */ + httpHeaders: any; + /** + * MIME type used to serve all files served by this handler. Defaults to + * file-specific MIME types, which are derived from each file's filename + * extension. + */ + mimeType: string; + /** + * Path to the static files matched by the URL pattern, from the application + * root directory. The path can refer to text matched in groupings in the + * URL pattern. + */ + path: string; + /** + * Whether this handler should match the request if the file referenced by + * the handler does not exist. + */ + requireMatchingFile: boolean; + /** + * Regular expression that matches the file paths for all files that should + * be referenced by this handler. + */ + uploadPathRegex: string; } -} -export class Resource$Apps$Locations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - getRoot() { - return this.root; + /** + * Traffic routing configuration for versions within a single service. Traffic + * splits define how traffic directed to the service is assigned to versions. + */ + export interface Schema$TrafficSplit { + /** + * Mapping from version IDs within the service to fractional (0.000, 1] + * allocations of traffic for that version. Each version can be specified + * only once, but some versions in the service may not have any traffic + * allocation. Services that have traffic allocated cannot be deleted until + * either the service is deleted or their traffic allocation is removed. + * Allocations must sum to 1. Up to two decimal place precision is supported + * for IP-based splits and up to three decimal places is supported for + * cookie-based splits. + */ + allocations: any; + /** + * Mechanism used to determine which version a request is sent to. The + * traffic selection algorithm will be stable for either type until + * allocations are changed. + */ + shardBy: string; } - - /** - * appengine.apps.locations.get - * @desc Gets information about a location. - * @alias appengine.apps.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Resource name for the location. - * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/locations/{locationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'locationsId'], - pathParams: ['appsId', 'locationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Rules to match an HTTP request and dispatch that request to a service. + */ + export interface Schema$UrlDispatchRule { + /** + * Domain name to match against. The wildcard "*" is supported if + * specified before a period: "*.".Defaults to matching all + * domains: "*". + */ + domain: string; + /** + * Pathname within the host. Must start with a "/". A single + * "*" can be included at the end of the path. The sum of the + * lengths of the domain and path may not exceed 100 characters. + */ + path: string; + /** + * Resource id of a service in this application that should serve the + * matched request. The service must already exist. Example: default. + */ + service: string; } - - /** - * appengine.apps.locations.list - * @desc Lists information about the supported locations for this service. - * @alias appengine.apps.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * URL pattern and description of how the URL should be handled. App Engine + * can handle URLs by executing application code, or by serving static files + * uploaded with the version, such as images, CSS, or JavaScript. + */ + export interface Schema$UrlMap { + /** + * Uses API Endpoints to handle requests. + */ + apiEndpoint: Schema$ApiEndpointHandler; + /** + * Action to take when users access resources that require authentication. + * Defaults to redirect. + */ + authFailAction: string; + /** + * Level of login required to access this resource. + */ + login: string; + /** + * 30x code to use when performing redirects for the secure field. Defaults + * to 302. + */ + redirectHttpResponseCode: string; + /** + * Executes a script to handle the request that matches this URL pattern. + */ + script: Schema$ScriptHandler; + /** + * Security (HTTPS) enforcement for this URL. + */ + securityLevel: string; + /** + * Returns the contents of a file, such as an image, as the response. + */ + staticFiles: Schema$StaticFilesHandler; + /** + * A URL prefix. Uses regular expression syntax, which means regexp special + * characters must be escaped, but should not contain groupings. All URLs + * that begin with this prefix are handled by this handler, using the + * portion of the URL after the prefix as part of the file path. + */ + urlRegex: string; } -} - -export class Resource$Apps$Operations { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); + /** + * A Version resource is a specific set of source code and configuration files + * that are deployed into a service. + */ + export interface Schema$Version { + /** + * Serving configuration for Google Cloud Endpoints + * (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned + * in GET requests if view=FULL is set. + */ + apiConfig: Schema$ApiConfigHandler; + /** + * Automatic scaling is based on request rate, response latencies, and other + * application metrics. + */ + automaticScaling: Schema$AutomaticScaling; + /** + * A service with basic scaling will create an instance when the application + * receives a request. The instance will be turned down when the app becomes + * idle. Basic scaling is ideal for work that is intermittent or driven by + * user activity. + */ + basicScaling: Schema$BasicScaling; + /** + * Metadata settings that are supplied to this version to enable beta + * runtime features. + */ + betaSettings: any; + /** + * Time that this version was created.@OutputOnly + */ + creationTime: string; + /** + * Duration that static files should be cached by web proxies and browsers. + * Only applicable if the corresponding StaticFilesHandler + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) + * does not specify its own expiration time.Only returned in GET requests if + * view=FULL is set. + */ + defaultExpiration: string; + /** + * Email address of the user who created this version.@OutputOnly + */ + deployer: string; + /** + * Code and application artifacts that make up this version.Only returned in + * GET requests if view=FULL is set. + */ + deployment: Schema$Deployment; + /** + * Total size of version files hosted on App Engine disk in + * bytes.@OutputOnly + */ + diskUsageBytes: string; + /** + * Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud + * Endpoints Extensible Service Proxy will be provided to serve the API + * implemented by the app. + */ + endpointsApiService: Schema$EndpointsApiService; + /** + * App Engine execution environment to use for this version.Defaults to 1. + */ + env: string; + /** + * Environment variables made available to the application.Only returned in + * GET requests if view=FULL is set. + */ + envVariables: any; + /** + * Custom static error pages. Limited to 10KB per page.Only returned in GET + * requests if view=FULL is set. + */ + errorHandlers: Schema$ErrorHandler[]; + /** + * An ordered list of URL-matching patterns that should be applied to + * incoming requests. The first matching URL handles the request and other + * request handlers are not attempted.Only returned in GET requests if + * view=FULL is set. + */ + handlers: Schema$UrlMap[]; + /** + * Configures health checking for VM instances. Unhealthy instances are be + * stopped and replaced with new instances. Only applicable for VM + * runtimes.Only returned in GET requests if view=FULL is set. + */ + healthCheck: Schema$HealthCheck; + /** + * Relative name of the version within the module. Example: v1. Version + * names can contain only lowercase letters, numbers, or hyphens. Reserved + * names: "default", "latest", and any name with the + * prefix "ah-". + */ + id: string; + /** + * Before an application can receive email or XMPP messages, the application + * must be configured to enable the service. + */ + inboundServices: string[]; + /** + * Instance class that is used to run this version. Valid values are: + * AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, + * B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for + * ManualScaling or BasicScaling. + */ + instanceClass: string; + /** + * Configuration for third-party Python runtime libraries required by the + * application.Only returned in GET requests if view=FULL is set. + */ + libraries: Schema$Library[]; + /** + * A service with manual scaling runs continuously, allowing you to perform + * complex initialization and rely on the state of its memory over time. + */ + manualScaling: Schema$ManualScaling; + /** + * Full path to the Version resource in the API. Example: + * apps/myapp/services/default/versions/v1.@OutputOnly + */ + name: string; + /** + * Extra network settings. Only applicable for VM runtimes. + */ + network: Schema$Network; + /** + * Files that match this pattern will not be built into this version. Only + * applicable for Go runtimes.Only returned in GET requests if view=FULL is + * set. + */ + nobuildFilesRegex: string; + /** + * Machine resources for this version. Only applicable for VM runtimes. + */ + resources: Schema$Resources; + /** + * Desired runtime. Example: python27. + */ + runtime: string; + /** + * The version of the API in the given runtime environment. Please see the + * app.yaml reference for valid values at + * https://cloud.google.com/appengine/docs/standard/<language>/config/appref + */ + runtimeApiVersion: string; + /** + * Current serving status of this version. Only the versions with a SERVING + * status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is + * an invalid value. Defaults to SERVING. + */ + servingStatus: string; + /** + * Whether multiple requests can be dispatched to this version at once. + */ + threadsafe: boolean; + /** + * Whether to deploy this version in a container on a virtual machine. + */ + vm: boolean; } - - getRoot() { - return this.root; + /** + * Volumes mounted within the app container. Only applicable for VM runtimes. + */ + export interface Schema$Volume { + /** + * Unique name for the volume. + */ + name: string; + /** + * Volume size in gigabytes. + */ + sizeGb: number; + /** + * Underlying volume type, e.g. 'tmpfs'. + */ + volumeType: string; } - - /** - * appengine.apps.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias appengine.apps.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation resource. - * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps { + root: Appengine; + locations: Resource$Apps$Locations; + operations: Resource$Apps$Operations; + services: Resource$Apps$Services; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Apps$Locations(root); + this.operations = new Resource$Apps$Operations(root); + this.services = new Resource$Apps$Services(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/operations/{operationsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'operationsId'], - pathParams: ['appsId', 'operationsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias appengine.apps.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. - * @param {string=} params.filter The standard list filter. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.create + * @desc Creates an App Engine application for a Google Cloud Platform + * project. Required fields: id - The ID of the target Cloud Platform + * project. location - The region + * (https://cloud.google.com/appengine/docs/locations) where you want the + * App Engine application located.For more information about App Engine + * applications, see Managing Projects, Applications, and Billing + * (https://cloud.google.com/appengine/docs/python/console/). + * @alias appengine.apps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services { - root: Appengine; - versions: Resource$Apps$Services$Versions; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.versions = new Resource$Apps$Services$Versions(root); - } - getRoot() { - return this.root; - } + /** + * appengine.apps.get + * @desc Gets information about an application. + * @alias appengine.apps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the application to get. Example: apps/myapp. + * @param {boolean=} params.ensureResourcesExist Certain resources associated with an application are created on-demand. Controls whether these resources should be created when performing the GET operation. If specified and any resources could not be created, the request will fail with an error code. Additionally, this parameter can cause the request to take longer to complete. Note: This parameter will be deprecated in a future version of the API. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.services.delete - * @desc Deletes the specified service and all enclosed versions. - * @alias appengine.apps.services.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.patch + * @desc Updates the specified Application resource. You can update the + * following fields: auth_domain + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) + * default_cookie_expiration + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration) + * @alias appengine.apps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the Application resource to update. Example: apps/myapp. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {().Application} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Locations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.get - * @desc Gets the current configuration of the specified service. - * @alias appengine.apps.services.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.locations.get + * @desc Gets information about a location. + * @alias appengine.apps.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Resource name for the location. + * @param {string} params.locationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/locations/{locationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'locationsId'], + pathParams: ['appsId', 'locationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.services.list - * @desc Lists all the services in the application. - * @alias appengine.apps.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/services') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId'], - pathParams: ['appsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.locations.list + * @desc Lists information about the supported locations for this service. + * @alias appengine.apps.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The resource that owns the locations collection, if applicable. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.patch - * @desc Updates the configuration of the specified service. - * @alias appengine.apps.services.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {().Service} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps$Operations { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Apps$Services$Versions { - root: Appengine; - instances: Resource$Apps$Services$Versions$Instances; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - this.instances = new Resource$Apps$Services$Versions$Instances(root); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * appengine.apps.services.versions.create - * @desc Deploys new code and resource files to a new version. - * @alias appengine.apps.services.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. For example: "apps/myapp/services/default". - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appengine.apps.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias appengine.apps.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation resource. + * @param {string} params.operationsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta5/apps/{appsId}/operations/{operationsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'operationsId'], + pathParams: ['appsId', 'operationsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appengine.apps.services.versions.delete - * @desc Deletes an existing version. - * @alias appengine.apps.services.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias appengine.apps.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. The name of the operation's parent resource. + * @param {string=} params.filter The standard list filter. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * appengine.apps.services.versions.get - * @desc Gets the specified Version resource. By default, only a BASIC_VIEW - * will be returned. Specify the FULL_VIEW parameter to get the full resource. - * @alias appengine.apps.services.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the Get response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apps$Services { + root: Appengine; + versions: Resource$Apps$Services$Versions; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.versions = new Resource$Apps$Services$Versions(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.list - * @desc Lists the versions of a service. - * @alias appengine.apps.services.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string=} params.view Controls the set of fields returned in the List response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.delete + * @desc Deletes the specified service and all enclosed versions. + * @alias appengine.apps.services.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.get + * @desc Gets the current configuration of the specified service. + * @alias appengine.apps.services.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId'], - pathParams: ['appsId', 'servicesId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.list + * @desc Lists all the services in the application. + * @alias appengine.apps.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/services') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId'], + pathParams: ['appsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.patch - * @desc Updates the specified Version resource. You can specify the following - * fields depending on the App Engine environment and type of scaling that the - * version resource uses: serving_status - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.serving_status): - * For Version resources that use basic scaling, manual scaling, or run in the - * App Engine flexible environment. instance_class - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.instance_class): - * For Version resources that run in the App Engine standard environment. - * automatic_scaling.min_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. automatic_scaling.max_idle_instances - * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): - * For Version resources that use automatic scaling and run in the App Engine - * standard environment. - * @alias appengine.apps.services.versions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. - * @param {string=} params.mask Standard field mask for the set of fields to be updated. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.patch + * @desc Updates the configuration of the specified service. + * @alias appengine.apps.services.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {boolean=} params.migrateTraffic Set to true to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#inboundservicetype) and automatic scaling (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#automaticscaling). You must specify the shardBy (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic (https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic). + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {().Service} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta5/apps/{appsId}/services/{servicesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions { + root: Appengine; + instances: Resource$Apps$Services$Versions$Instances; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); + this.instances = new Resource$Apps$Services$Versions$Instances(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Apps$Services$Versions$Instances { - root: Appengine; - constructor(root: Appengine) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + + /** + * appengine.apps.services.versions.create + * @desc Deploys new code and resource files to a new version. + * @alias appengine.apps.services.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. For example: "apps/myapp/services/default". + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * appengine.apps.services.versions.instances.debug - * @desc Enables debugging on a VM instance. This allows you to use the SSH - * command to connect to the virtual machine where the instance lives. While - * in "debug mode", the instance continues to serve live traffic. You should - * delete the instance when you are done debugging and then allow the system - * to take over and determine if another instance should be started.Only - * applicable for instances in App Engine flexible environment. - * @alias appengine.apps.services.versions.instances.debug - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {().DebugInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - debug(params?: any, options?: MethodOptions): AxiosPromise; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - debug( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.delete + * @desc Deletes an existing version. + * @alias appengine.apps.services.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.get + * @desc Gets the specified Version resource. By default, only a BASIC_VIEW + * will be returned. Specify the FULL_VIEW parameter to get the full + * resource. + * @alias appengine.apps.services.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the Get response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.list + * @desc Lists the versions of a service. + * @alias appengine.apps.services.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string=} params.view Controls the set of fields returned in the List response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId'], + pathParams: ['appsId', 'servicesId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.delete - * @desc Stops a running instance. - * @alias appengine.apps.services.versions.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default/versions/v1/instances/instance-1". - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.patch + * @desc Updates the specified Version resource. You can specify the + * following fields depending on the App Engine environment and type of + * scaling that the version resource uses: serving_status + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.serving_status): + * For Version resources that use basic scaling, manual scaling, or run in + * the App Engine flexible environment. instance_class + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.instance_class): + * For Version resources that run in the App Engine standard environment. + * automatic_scaling.min_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. automatic_scaling.max_idle_instances + * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps.services.versions#Version.FIELDS.automatic_scaling): + * For Version resources that use automatic scaling and run in the App + * Engine standard environment. + * @alias appengine.apps.services.versions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource to update. Example: apps/myapp/services/default/versions/1. + * @param {string=} params.mask Standard field mask for the set of fields to be updated. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Apps$Services$Versions$Instances { + root: Appengine; + constructor(root: Appengine) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appengine.apps.services.versions.instances.get - * @desc Gets instance information. - * @alias appengine.apps.services.versions.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. - * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], - pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appengine.apps.services.versions.instances.debug + * @desc Enables debugging on a VM instance. This allows you to use the SSH + * command to connect to the virtual machine where the instance lives. While + * in "debug mode", the instance continues to serve live traffic. You should + * delete the instance when you are done debugging and then allow the system + * to take over and determine if another instance should be started.Only + * applicable for instances in App Engine flexible environment. + * @alias appengine.apps.services.versions.instances.debug + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {().DebugInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + debug(params?: any, options?: MethodOptions): + AxiosPromise; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + debug( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appengine.apps.services.versions.instances.list - * @desc Lists the instances of a version.Tip: To aggregate details about - * instances over time, see the Stackdriver Monitoring API - * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). - * @alias appengine.apps.services.versions.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. - * @param {integer=} params.pageSize Maximum results to return per page. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. - * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appengine.apps.services.versions.instances.delete + * @desc Stops a running instance. + * @alias appengine.apps.services.versions.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. For example: "apps/myapp/services/default/versions/v1/instances/instance-1". + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * appengine.apps.services.versions.instances.get + * @desc Gets instance information. + * @alias appengine.apps.services.versions.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1/instances/instance-1. + * @param {string} params.instancesId Part of `name`. See documentation of `appsId`. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId', 'instancesId'], + pathParams: ['appsId', 'instancesId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appsId', 'servicesId', 'versionsId'], - pathParams: ['appsId', 'servicesId', 'versionsId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appengine.apps.services.versions.instances.list + * @desc Lists the instances of a version.Tip: To aggregate details about + * instances over time, see the Stackdriver Monitoring API + * (https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). + * @alias appengine.apps.services.versions.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appsId Part of `name`. Name of the resource requested. Example: apps/myapp/services/default/versions/v1. + * @param {integer=} params.pageSize Maximum results to return per page. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.servicesId Part of `name`. See documentation of `appsId`. + * @param {string} params.versionsId Part of `name`. See documentation of `appsId`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://appengine.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appsId', 'servicesId', 'versionsId'], + pathParams: ['appsId', 'servicesId', 'versionsId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appsactivity/v1.ts b/src/apis/appsactivity/v1.ts index 9228e73e00a..ddd548294de 100644 --- a/src/apis/appsactivity/v1.ts +++ b/src/apis/appsactivity/v1.ts @@ -27,342 +27,345 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * G Suite Activity API - * - * Provides a historical view of activity. - * - * @example - * const google = require('googleapis'); - * const appsactivity = google.appsactivity('v1'); - * - * @namespace appsactivity - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Appsactivity - */ -export class Appsactivity { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace appsactivity_v1 { + /** + * G Suite Activity API + * + * Provides a historical view of activity. + * + * @example + * const google = require('googleapis'); + * const appsactivity = google.appsactivity('v1'); + * + * @namespace appsactivity + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Appsactivity + */ + export class Appsactivity { + _options: GlobalOptions; + google: GoogleApis; + root = this; - activities: Resource$Activities; + activities: Resource$Activities; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.activities = new Resource$Activities(this); - } + this.activities = new Resource$Activities(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An Activity resource is a combined view of multiple events. An activity has a - * list of individual events and a combined view of the common fields among all - * events. - */ -export interface Schema$Activity { - /** - * The fields common to all of the singleEvents that make up the Activity. - */ - combinedEvent: Schema$Event; - /** - * A list of all the Events that make up the Activity. - */ - singleEvents: Schema$Event[]; -} -/** - * Represents the changes associated with an action taken by a user. - */ -export interface Schema$Event { - /** - * Additional event types. Some events may have multiple types when multiple - * actions are part of a single event. For example, creating a document, - * renaming it, and sharing it may be part of a single file-creation event. - */ - additionalEventTypes: string[]; - /** - * The time at which the event occurred formatted as Unix time in - * milliseconds. - */ - eventTimeMillis: string; - /** - * Whether this event is caused by a user being deleted. - */ - fromUserDeletion: boolean; - /** - * Extra information for move type events, such as changes in an object's - * parents. - */ - move: Schema$Move; - /** - * Extra information for permissionChange type events, such as the user or - * group the new permission applies to. - */ - permissionChanges: Schema$PermissionChange[]; - /** - * The main type of event that occurred. - */ - primaryEventType: string; - /** - * Extra information for rename type events, such as the old and new names. - */ - rename: Schema$Rename; - /** - * Information specific to the Target object modified by the event. - */ - target: Schema$Target; - /** - * Represents the user responsible for the event. - */ - user: Schema$User; -} -/** - * The response from the list request. Contains a list of activities and a token - * to retrieve the next page of results. - */ -export interface Schema$ListActivitiesResponse { - /** - * List of activities. - */ - activities: Schema$Activity[]; - /** - * Token for the next page of results. - */ - nextPageToken: string; -} -/** - * Contains information about changes in an object's parents as a result of - * a move type event. - */ -export interface Schema$Move { - /** - * The added parent(s). - */ - addedParents: Schema$Parent[]; - /** - * The removed parent(s). - */ - removedParents: Schema$Parent[]; -} -/** - * Contains information about a parent object. For example, a folder in Drive is - * a parent for all files within it. - */ -export interface Schema$Parent { - /** - * The parent's ID. - */ - id: string; - /** - * Whether this is the root folder. - */ - isRoot: boolean; - /** - * The parent's title. - */ - title: string; -} -/** - * Contains information about the permissions and type of access allowed with - * regards to a Google Drive object. This is a subset of the fields contained in - * a corresponding Drive Permissions object. - */ -export interface Schema$Permission { - /** - * The name of the user or group the permission applies to. - */ - name: string; - /** - * The ID for this permission. Corresponds to the Drive API's permission - * ID returned as part of the Drive Permissions resource. - */ - permissionId: string; - /** - * Indicates the Google Drive permissions role. The role determines a - * user's ability to read, write, or comment on the file. - */ - role: string; - /** - * Indicates how widely permissions are granted. - */ - type: string; - /** - * The user's information if the type is USER. - */ - user: Schema$User; - /** - * Whether the permission requires a link to the file. - */ - withLink: boolean; -} -/** - * Contains information about a Drive object's permissions that changed as a - * result of a permissionChange type event. - */ -export interface Schema$PermissionChange { - /** - * Lists all Permission objects added. - */ - addedPermissions: Schema$Permission[]; - /** - * Lists all Permission objects removed. - */ - removedPermissions: Schema$Permission[]; -} -/** - * Photo information for a user. - */ -export interface Schema$Photo { /** - * The URL of the photo. - */ - url: string; -} -/** - * Contains information about a renametype event. - */ -export interface Schema$Rename { - /** - * The new title. - */ - newTitle: string; + * An Activity resource is a combined view of multiple events. An activity has + * a list of individual events and a combined view of the common fields among + * all events. + */ + export interface Schema$Activity { + /** + * The fields common to all of the singleEvents that make up the Activity. + */ + combinedEvent: Schema$Event; + /** + * A list of all the Events that make up the Activity. + */ + singleEvents: Schema$Event[]; + } /** - * The old title. - */ - oldTitle: string; -} -/** - * Information about the object modified by the event. - */ -export interface Schema$Target { + * Represents the changes associated with an action taken by a user. + */ + export interface Schema$Event { + /** + * Additional event types. Some events may have multiple types when multiple + * actions are part of a single event. For example, creating a document, + * renaming it, and sharing it may be part of a single file-creation event. + */ + additionalEventTypes: string[]; + /** + * The time at which the event occurred formatted as Unix time in + * milliseconds. + */ + eventTimeMillis: string; + /** + * Whether this event is caused by a user being deleted. + */ + fromUserDeletion: boolean; + /** + * Extra information for move type events, such as changes in an + * object's parents. + */ + move: Schema$Move; + /** + * Extra information for permissionChange type events, such as the user or + * group the new permission applies to. + */ + permissionChanges: Schema$PermissionChange[]; + /** + * The main type of event that occurred. + */ + primaryEventType: string; + /** + * Extra information for rename type events, such as the old and new names. + */ + rename: Schema$Rename; + /** + * Information specific to the Target object modified by the event. + */ + target: Schema$Target; + /** + * Represents the user responsible for the event. + */ + user: Schema$User; + } /** - * The ID of the target. For example, in Google Drive, this is the file or - * folder ID. - */ - id: string; + * The response from the list request. Contains a list of activities and a + * token to retrieve the next page of results. + */ + export interface Schema$ListActivitiesResponse { + /** + * List of activities. + */ + activities: Schema$Activity[]; + /** + * Token for the next page of results. + */ + nextPageToken: string; + } /** - * The MIME type of the target. - */ - mimeType: string; + * Contains information about changes in an object's parents as a result + * of a move type event. + */ + export interface Schema$Move { + /** + * The added parent(s). + */ + addedParents: Schema$Parent[]; + /** + * The removed parent(s). + */ + removedParents: Schema$Parent[]; + } /** - * The name of the target. For example, in Google Drive, this is the title of - * the file. - */ - name: string; -} -/** - * A representation of a user. - */ -export interface Schema$User { + * Contains information about a parent object. For example, a folder in Drive + * is a parent for all files within it. + */ + export interface Schema$Parent { + /** + * The parent's ID. + */ + id: string; + /** + * Whether this is the root folder. + */ + isRoot: boolean; + /** + * The parent's title. + */ + title: string; + } /** - * A boolean which indicates whether the specified User was deleted. If true, - * name, photo and permission_id will be omitted. - */ - isDeleted: boolean; + * Contains information about the permissions and type of access allowed with + * regards to a Google Drive object. This is a subset of the fields contained + * in a corresponding Drive Permissions object. + */ + export interface Schema$Permission { + /** + * The name of the user or group the permission applies to. + */ + name: string; + /** + * The ID for this permission. Corresponds to the Drive API's permission + * ID returned as part of the Drive Permissions resource. + */ + permissionId: string; + /** + * Indicates the Google Drive permissions role. The role determines a + * user's ability to read, write, or comment on the file. + */ + role: string; + /** + * Indicates how widely permissions are granted. + */ + type: string; + /** + * The user's information if the type is USER. + */ + user: Schema$User; + /** + * Whether the permission requires a link to the file. + */ + withLink: boolean; + } /** - * Whether the user is the authenticated user. - */ - isMe: boolean; + * Contains information about a Drive object's permissions that changed as + * a result of a permissionChange type event. + */ + export interface Schema$PermissionChange { + /** + * Lists all Permission objects added. + */ + addedPermissions: Schema$Permission[]; + /** + * Lists all Permission objects removed. + */ + removedPermissions: Schema$Permission[]; + } /** - * The displayable name of the user. + * Photo information for a user. */ - name: string; + export interface Schema$Photo { + /** + * The URL of the photo. + */ + url: string; + } /** - * The permission ID associated with this user. Equivalent to the Drive - * API's permission ID for this user, returned as part of the Drive - * Permissions resource. - */ - permissionId: string; + * Contains information about a renametype event. + */ + export interface Schema$Rename { + /** + * The new title. + */ + newTitle: string; + /** + * The old title. + */ + oldTitle: string; + } /** - * The profile photo of the user. Not present if the user has no profile - * photo. - */ - photo: Schema$Photo; -} - -export class Resource$Activities { - root: Appsactivity; - constructor(root: Appsactivity) { - this.root = root; - this.getRoot.bind(this); + * Information about the object modified by the event. + */ + export interface Schema$Target { + /** + * The ID of the target. For example, in Google Drive, this is the file or + * folder ID. + */ + id: string; + /** + * The MIME type of the target. + */ + mimeType: string; + /** + * The name of the target. For example, in Google Drive, this is the title + * of the file. + */ + name: string; } - - getRoot() { - return this.root; + /** + * A representation of a user. + */ + export interface Schema$User { + /** + * A boolean which indicates whether the specified User was deleted. If + * true, name, photo and permission_id will be omitted. + */ + isDeleted: boolean; + /** + * Whether the user is the authenticated user. + */ + isMe: boolean; + /** + * The displayable name of the user. + */ + name: string; + /** + * The permission ID associated with this user. Equivalent to the Drive + * API's permission ID for this user, returned as part of the Drive + * Permissions resource. + */ + permissionId: string; + /** + * The profile photo of the user. Not present if the user has no profile + * photo. + */ + photo: Schema$Photo; } - - /** - * appsactivity.activities.list - * @desc Returns a list of activities visible to the current logged in user. - * Visible activities are determined by the visiblity settings of the object - * that was acted on, e.g. Drive files a user can see. An activity is a record - * of past events. Multiple events may be merged if they are similar. A - * request is scoped to activities from a given Google service using the - * source parameter. - * @alias appsactivity.activities.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.drive.ancestorId Identifies the Drive folder containing the items for which to return activities. - * @param {string=} params.drive.fileId Identifies the Drive item to return activities for. - * @param {string=} params.groupingStrategy Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. - * @param {integer=} params.pageSize The maximum number of events to return on a page. The response includes a continuation token if there are more events. - * @param {string=} params.pageToken A token to retrieve a specific page of results. - * @param {string=} params.source The Google service from which to return activities. Possible values of source are: - drive.google.com - * @param {string=} params.userId Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Activities { + root: Appsactivity; + constructor(root: Appsactivity) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/appsactivity/v1/activities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appsactivity.activities.list + * @desc Returns a list of activities visible to the current logged in user. + * Visible activities are determined by the visiblity settings of the object + * that was acted on, e.g. Drive files a user can see. An activity is a + * record of past events. Multiple events may be merged if they are similar. + * A request is scoped to activities from a given Google service using the + * source parameter. + * @alias appsactivity.activities.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.drive.ancestorId Identifies the Drive folder containing the items for which to return activities. + * @param {string=} params.drive.fileId Identifies the Drive item to return activities for. + * @param {string=} params.groupingStrategy Indicates the strategy to use when grouping singleEvents items in the associated combinedEvent object. + * @param {integer=} params.pageSize The maximum number of events to return on a page. The response includes a continuation token if there are more events. + * @param {string=} params.pageToken A token to retrieve a specific page of results. + * @param {string=} params.source The Google service from which to return activities. Possible values of source are: - drive.google.com + * @param {string=} params.userId Indicates the user to return activity for. Use the special value me to indicate the currently authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appsactivity/v1/activities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/appstate/v1.ts b/src/apis/appstate/v1.ts index 1a23aa43d2a..0ea569ee9a4 100644 --- a/src/apis/appstate/v1.ts +++ b/src/apis/appstate/v1.ts @@ -27,398 +27,402 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google App State API - * - * The Google App State API. - * - * @example - * const google = require('googleapis'); - * const appstate = google.appstate('v1'); - * - * @namespace appstate - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Appstate - */ -export class Appstate { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace appstate_v1 { + /** + * Google App State API + * + * The Google App State API. + * + * @example + * const google = require('googleapis'); + * const appstate = google.appstate('v1'); + * + * @namespace appstate + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Appstate + */ + export class Appstate { + _options: GlobalOptions; + google: GoogleApis; + root = this; - states: Resource$States; + states: Resource$States; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.states = new Resource$States(this); - } + this.states = new Resource$States(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * This is a JSON template for an app state resource. - */ -export interface Schema$GetResponse { - /** - * The current app state version. - */ - currentStateVersion: string; - /** - * The requested data. - */ - data: string; /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string appstate#getResponse. + * This is a JSON template for an app state resource. */ - kind: string; - /** - * The key for the data. - */ - stateKey: number; -} -/** - * This is a JSON template to convert a list-response for app state. - */ -export interface Schema$ListResponse { - /** - * The app state data. - */ - items: Schema$GetResponse[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string appstate#listResponse. - */ - kind: string; - /** - * The maximum number of keys allowed for this user. - */ - maximumKeyCount: number; -} -/** - * This is a JSON template for a requests which update app state - */ -export interface Schema$UpdateRequest { - /** - * The new app state data that your application is trying to update with. - */ - data: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string appstate#updateRequest. - */ - kind: string; -} -/** - * This is a JSON template for an app state write result. - */ -export interface Schema$WriteResult { + export interface Schema$GetResponse { + /** + * The current app state version. + */ + currentStateVersion: string; + /** + * The requested data. + */ + data: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string appstate#getResponse. + */ + kind: string; + /** + * The key for the data. + */ + stateKey: number; + } /** - * The version of the data for this key on the server. + * This is a JSON template to convert a list-response for app state. */ - currentStateVersion: string; + export interface Schema$ListResponse { + /** + * The app state data. + */ + items: Schema$GetResponse[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string appstate#listResponse. + */ + kind: string; + /** + * The maximum number of keys allowed for this user. + */ + maximumKeyCount: number; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string appstate#writeResult. + * This is a JSON template for a requests which update app state */ - kind: string; + export interface Schema$UpdateRequest { + /** + * The new app state data that your application is trying to update with. + */ + data: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string appstate#updateRequest. + */ + kind: string; + } /** - * The written key. + * This is a JSON template for an app state write result. */ - stateKey: number; -} - -export class Resource$States { - root: Appstate; - constructor(root: Appstate) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$WriteResult { + /** + * The version of the data for this key on the server. + */ + currentStateVersion: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string appstate#writeResult. + */ + kind: string; + /** + * The written key. + */ + stateKey: number; } - - /** - * appstate.states.clear - * @desc Clears (sets to empty) the data for the passed key if and only if the - * passed version matches the currently stored version. This method results in - * a conflict error on version mismatch. - * @alias appstate.states.clear - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentDataVersion The version of the data to be cleared. Version strings are returned by the server. - * @param {integer} params.stateKey The key for the data to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clear(params?: any, options?: MethodOptions): - AxiosPromise; - clear( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clear( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$States { + root: Appstate; + constructor(root: Appstate) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/appstate/v1/states/{stateKey}/clear') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['stateKey'], - pathParams: ['stateKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * appstate.states.delete - * @desc Deletes a key and the data associated with it. The key is removed and - * no longer counts against the key quota. Note that since this method is not - * safe in the face of concurrent modifications, it should only be used for - * development and testing purposes. Invoking this method in shipping code can - * result in data loss and data corruption. - * @alias appstate.states.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.stateKey The key for the data to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/appstate/v1/states/{stateKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['stateKey'], - pathParams: ['stateKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * appstate.states.clear + * @desc Clears (sets to empty) the data for the passed key if and only if + * the passed version matches the currently stored version. This method + * results in a conflict error on version mismatch. + * @alias appstate.states.clear + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentDataVersion The version of the data to be cleared. Version strings are returned by the server. + * @param {integer} params.stateKey The key for the data to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clear(params?: any, options?: MethodOptions): + AxiosPromise; + clear( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clear( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appstate/v1/states/{stateKey}/clear') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['stateKey'], + pathParams: ['stateKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * appstate.states.get - * @desc Retrieves the data corresponding to the passed key. If the key does - * not exist on the server, an HTTP 404 will be returned. - * @alias appstate.states.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.stateKey The key for the data to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appstate.states.delete + * @desc Deletes a key and the data associated with it. The key is removed + * and no longer counts against the key quota. Note that since this method + * is not safe in the face of concurrent modifications, it should only be + * used for development and testing purposes. Invoking this method in + * shipping code can result in data loss and data corruption. + * @alias appstate.states.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.stateKey The key for the data to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appstate/v1/states/{stateKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['stateKey'], + pathParams: ['stateKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/appstate/v1/states/{stateKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['stateKey'], - pathParams: ['stateKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appstate.states.list - * @desc Lists all the states keys, and optionally the state data. - * @alias appstate.states.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.includeData Whether to include the full data in addition to the version number - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * appstate.states.get + * @desc Retrieves the data corresponding to the passed key. If the key does + * not exist on the server, an HTTP 404 will be returned. + * @alias appstate.states.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.stateKey The key for the data to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appstate/v1/states/{stateKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['stateKey'], + pathParams: ['stateKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/appstate/v1/states').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * appstate.states.update - * @desc Update the data associated with the input key if and only if the - * passed version matches the currently stored version. This method is safe in - * the face of concurrent writes. Maximum per-key size is 128KB. - * @alias appstate.states.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentStateVersion The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter. - * @param {integer} params.stateKey The key for the data to be retrieved. - * @param {().UpdateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * appstate.states.list + * @desc Lists all the states keys, and optionally the state data. + * @alias appstate.states.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.includeData Whether to include the full data in addition to the version number + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appstate/v1/states') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/appstate/v1/states/{stateKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['stateKey'], - pathParams: ['stateKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * appstate.states.update + * @desc Update the data associated with the input key if and only if the + * passed version matches the currently stored version. This method is safe + * in the face of concurrent writes. Maximum per-key size is 128KB. + * @alias appstate.states.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentStateVersion The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter. + * @param {integer} params.stateKey The key for the data to be retrieved. + * @param {().UpdateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/appstate/v1/states/{stateKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['stateKey'], + pathParams: ['stateKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/bigquery/v2.ts b/src/apis/bigquery/v2.ts index e7ed1e7f4f5..0841fd68987 100644 --- a/src/apis/bigquery/v2.ts +++ b/src/apis/bigquery/v2.ts @@ -27,4608 +27,4658 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * BigQuery API - * - * A data platform for customers to create, manage, share and query data. - * - * @example - * const google = require('googleapis'); - * const bigquery = google.bigquery('v2'); - * - * @namespace bigquery - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Bigquery - */ -export class Bigquery { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - datasets: Resource$Datasets; - jobs: Resource$Jobs; - projects: Resource$Projects; - tabledata: Resource$Tabledata; - tables: Resource$Tables; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.datasets = new Resource$Datasets(this); - this.jobs = new Resource$Jobs(this); - this.projects = new Resource$Projects(this); - this.tabledata = new Resource$Tabledata(this); - this.tables = new Resource$Tables(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$BigtableColumn { - /** - * [Optional] The encoding of the values when the type is not STRING. - * Acceptable encoding values are: TEXT - indicates values are alphanumeric - * text strings. BINARY - indicates values are encoded using HBase - * Bytes.toBytes family of functions. 'encoding' can also be set at - * the column family level. However, the setting at this level takes - * precedence if 'encoding' is set at both levels. - */ - encoding: string; - /** - * [Optional] If the qualifier is not a valid BigQuery field identifier i.e. - * does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided - * as the column field name and is used as field name in queries. - */ - fieldName: string; - /** - * [Optional] If this is set, only the latest version of value in this column - * are exposed. 'onlyReadLatest' can also be set at the column family - * level. However, the setting at this level takes precedence if - * 'onlyReadLatest' is set at both levels. - */ - onlyReadLatest: boolean; - /** - * [Required] Qualifier of the column. Columns in the parent column family - * that has this exact qualifier are exposed as . field. If the qualifier is - * valid UTF-8 string, it can be specified in the qualifier_string field. - * Otherwise, a base-64 encoded value must be set to qualifier_encoded. The - * column field name is the same as the column qualifier. However, if the - * qualifier is not a valid BigQuery field identifier i.e. does not match - * [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name. - */ - qualifierEncoded: string; - qualifierString: string; - /** - * [Optional] The type to convert the value in cells of this column. The - * values are expected to be encoded using HBase Bytes.toBytes function when - * using the BINARY encoding value. Following BigQuery types are allowed - * (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is - * BYTES. 'type' can also be set at the column family level. However, - * the setting at this level takes precedence if 'type' is set at both - * levels. - */ - type: string; -} -export interface Schema$BigtableColumnFamily { - /** - * [Optional] Lists of columns that should be exposed as individual fields as - * opposed to a list of (column name, value) pairs. All columns whose - * qualifier matches a qualifier in this list can be accessed as .. Other - * columns can be accessed as a list through .Column field. - */ - columns: Schema$BigtableColumn[]; - /** - * [Optional] The encoding of the values when the type is not STRING. - * Acceptable encoding values are: TEXT - indicates values are alphanumeric - * text strings. BINARY - indicates values are encoded using HBase - * Bytes.toBytes family of functions. This can be overridden for a specific - * column by listing that column in 'columns' and specifying an - * encoding for it. - */ - encoding: string; - /** - * Identifier of the column family. - */ - familyId: string; - /** - * [Optional] If this is set only the latest version of value are exposed for - * all columns in this column family. This can be overridden for a specific - * column by listing that column in 'columns' and specifying a - * different setting for that column. - */ - onlyReadLatest: boolean; - /** - * [Optional] The type to convert the value in cells of this column family. - * The values are expected to be encoded using HBase Bytes.toBytes function - * when using the BINARY encoding value. Following BigQuery types are allowed - * (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is - * BYTES. This can be overridden for a specific column by listing that column - * in 'columns' and specifying a type for it. - */ - type: string; -} -export interface Schema$BigtableOptions { - /** - * [Optional] List of column families to expose in the table schema along with - * their types. This list restricts the column families that can be referenced - * in queries and specifies their value types. You can use this list to do - * type conversions - see the 'type' field for more details. If you - * leave this list empty, all column families are present in the table schema - * and their values are read as BYTES. During a query only the column families - * referenced in that query are read from Bigtable. - */ - columnFamilies: Schema$BigtableColumnFamily[]; - /** - * [Optional] If field is true, then the column families that are not - * specified in columnFamilies list are not exposed in the table schema. - * Otherwise, they are read with BYTES type values. The default value is - * false. - */ - ignoreUnspecifiedColumnFamilies: boolean; - /** - * [Optional] If field is true, then the rowkey column families will be read - * and converted to string. Otherwise they are read with BYTES type values and - * users need to manually cast them with CAST if necessary. The default value - * is false. - */ - readRowkeyAsString: boolean; -} -export interface Schema$Clustering { - /** - * [Repeated] One or more fields on which data should be clustered. Only - * top-level, non-repeated, simple-type fields are supported. The order of the - * fields will determine how clusters will be generated, so it is important. - */ - fields: string[]; -} -export interface Schema$CsvOptions { - /** - * [Optional] Indicates if BigQuery should accept rows that are missing - * trailing optional columns. If true, BigQuery treats missing trailing - * columns as null values. If false, records with missing trailing columns are - * treated as bad records, and if there are too many bad records, an invalid - * error is returned in the job result. The default value is false. - */ - allowJaggedRows: boolean; - /** - * [Optional] Indicates if BigQuery should allow quoted data sections that - * contain newline characters in a CSV file. The default value is false. - */ - allowQuotedNewlines: boolean; - /** - * [Optional] The character encoding of the data. The supported values are - * UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data - * after the raw, binary data has been split using the values of the quote and - * fieldDelimiter properties. - */ - encoding: string; - /** - * [Optional] The separator for fields in a CSV file. BigQuery converts the - * string to ISO-8859-1 encoding, and then uses the first byte of the encoded - * string to split the data in its raw, binary state. BigQuery also supports - * the escape sequence "\t" to specify a tab separator. The default - * value is a comma (','). - */ - fieldDelimiter: string; - /** - * [Optional] The value that is used to quote data sections in a CSV file. - * BigQuery converts the string to ISO-8859-1 encoding, and then uses the - * first byte of the encoded string to split the data in its raw, binary - * state. The default value is a double-quote ('"'). If your data - * does not contain quoted sections, set the property value to an empty - * string. If your data contains quoted newline characters, you must also set - * the allowQuotedNewlines property to true. - */ - quote: string; - /** - * [Optional] The number of rows at the top of a CSV file that BigQuery will - * skip when reading the data. The default value is 0. This property is useful - * if you have header rows in the file that should be skipped. - */ - skipLeadingRows: string; -} -export interface Schema$Dataset { - /** - * [Optional] An array of objects that define dataset access for one or more - * entities. You can set this property when inserting or updating a dataset in - * order to control who is allowed to access the data. If unspecified at - * dataset creation time, BigQuery adds default dataset access for the - * following entities: access.specialGroup: projectReaders; access.role: - * READER; access.specialGroup: projectWriters; access.role: WRITER; - * access.specialGroup: projectOwners; access.role: OWNER; access.userByEmail: - * [dataset creator email]; access.role: OWNER; - */ - access: any[]; - /** - * [Output-only] The time when this dataset was created, in milliseconds since - * the epoch. - */ - creationTime: string; - /** - * [Required] A reference that identifies the dataset. - */ - datasetReference: Schema$DatasetReference; - /** - * [Optional] The default lifetime of all tables in the dataset, in - * milliseconds. The minimum value is 3600000 milliseconds (one hour). Once - * this property is set, all newly-created tables in the dataset will have an - * expirationTime property set to the creation time plus the value in this - * property, and changing the value will only affect new tables, not existing - * ones. When the expirationTime for a given table is reached, that table will - * be deleted automatically. If a table's expirationTime is modified or - * removed before the table expires, or if you provide an explicit - * expirationTime when creating a table, that value takes precedence over the - * default expiration time indicated by this property. - */ - defaultTableExpirationMs: string; - /** - * [Optional] A user-friendly description of the dataset. - */ - description: string; - /** - * [Output-only] A hash of the resource. - */ - etag: string; - /** - * [Optional] A descriptive name for the dataset. - */ - friendlyName: string; - /** - * [Output-only] The fully-qualified unique name of the dataset in the format - * projectId:datasetId. The dataset name without the project name is given in - * the datasetId field. When creating a new dataset, leave this field blank, - * and instead specify the datasetId field. - */ - id: string; - /** - * [Output-only] The resource type. - */ - kind: string; - /** - * The labels associated with this dataset. You can use these to organize and - * group your datasets. You can set this property when inserting or updating a - * dataset. See Labeling Datasets for more information. - */ - labels: any; - /** - * [Output-only] The date when this dataset or any of its tables was last - * modified, in milliseconds since the epoch. - */ - lastModifiedTime: string; - /** - * The geographic location where the dataset should reside. The default value - * is US. - */ - location: string; - /** - * [Output-only] A URL that can be used to access the resource again. You can - * use this URL in Get or Update requests to the resource. - */ - selfLink: string; -} -export interface Schema$DatasetList { - /** - * An array of the dataset resources in the project. Each resource contains - * basic information. For full information about a particular dataset - * resource, use the Datasets: get method. This property is omitted when there - * are no datasets in the project. - */ - datasets: any[]; - /** - * A hash value of the results page. You can use this property to determine if - * the page has changed since the last request. - */ - etag: string; - /** - * The list type. This property always returns the value - * "bigquery#datasetList". - */ - kind: string; - /** - * A token that can be used to request the next results page. This property is - * omitted on the final results page. - */ - nextPageToken: string; -} -export interface Schema$DatasetReference { - /** - * [Required] A unique ID for this dataset, without the project name. The ID - * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). - * The maximum length is 1,024 characters. - */ - datasetId: string; - /** - * [Optional] The ID of the project containing this dataset. - */ - projectId: string; -} -export interface Schema$DestinationTableProperties { - /** - * [Optional] The description for the destination table. This will only be - * used if the destination table is newly created. If the table already exists - * and a value different than the current description is provided, the job - * will fail. - */ - description: string; - /** - * [Optional] The friendly name for the destination table. This will only be - * used if the destination table is newly created. If the table already exists - * and a value different than the current friendly name is provided, the job - * will fail. - */ - friendlyName: string; -} -export interface Schema$EncryptionConfiguration { - /** - * [Optional] Describes the Cloud KMS encryption key that will be used to - * protect destination BigQuery table. The BigQuery Service Account associated - * with your project requires access to this encryption key. - */ - kmsKeyName: string; -} -export interface Schema$ErrorProto { - /** - * Debugging information. This property is internal to Google and should not - * be used. - */ - debugInfo: string; - /** - * Specifies where the error occurred, if present. - */ - location: string; - /** - * A human-readable description of the error. - */ - message: string; - /** - * A short error code that summarizes the error. - */ - reason: string; -} -export interface Schema$ExplainQueryStage { - /** - * Number of parallel input segments completed. - */ - completedParallelInputs: string; - /** - * Milliseconds the average shard spent on CPU-bound tasks. - */ - computeMsAvg: string; - /** - * Milliseconds the slowest shard spent on CPU-bound tasks. - */ - computeMsMax: string; - /** - * Relative amount of time the average shard spent on CPU-bound tasks. - */ - computeRatioAvg: number; - /** - * Relative amount of time the slowest shard spent on CPU-bound tasks. - */ - computeRatioMax: number; - /** - * Stage end time in milliseconds. - */ - endMs: string; - /** - * Unique ID for stage within plan. - */ - id: string; - /** - * IDs for stages that are inputs to this stage. - */ - inputStages: string[]; - /** - * Human-readable name for stage. - */ - name: string; - /** - * Number of parallel input segments to be processed. - */ - parallelInputs: string; - /** - * Milliseconds the average shard spent reading input. - */ - readMsAvg: string; - /** - * Milliseconds the slowest shard spent reading input. - */ - readMsMax: string; - /** - * Relative amount of time the average shard spent reading input. - */ - readRatioAvg: number; - /** - * Relative amount of time the slowest shard spent reading input. - */ - readRatioMax: number; - /** - * Number of records read into the stage. - */ - recordsRead: string; - /** - * Number of records written by the stage. - */ - recordsWritten: string; - /** - * Total number of bytes written to shuffle. - */ - shuffleOutputBytes: string; - /** - * Total number of bytes written to shuffle and spilled to disk. - */ - shuffleOutputBytesSpilled: string; - /** - * Stage start time in milliseconds. - */ - startMs: string; - /** - * Current status for the stage. - */ - status: string; - /** - * List of operations within the stage in dependency order (approximately - * chronological). - */ - steps: Schema$ExplainQueryStep[]; - /** - * Milliseconds the average shard spent waiting to be scheduled. - */ - waitMsAvg: string; - /** - * Milliseconds the slowest shard spent waiting to be scheduled. - */ - waitMsMax: string; - /** - * Relative amount of time the average shard spent waiting to be scheduled. - */ - waitRatioAvg: number; - /** - * Relative amount of time the slowest shard spent waiting to be scheduled. - */ - waitRatioMax: number; - /** - * Milliseconds the average shard spent on writing output. - */ - writeMsAvg: string; - /** - * Milliseconds the slowest shard spent on writing output. - */ - writeMsMax: string; - /** - * Relative amount of time the average shard spent on writing output. - */ - writeRatioAvg: number; - /** - * Relative amount of time the slowest shard spent on writing output. - */ - writeRatioMax: number; -} -export interface Schema$ExplainQueryStep { - /** - * Machine-readable operation type. - */ - kind: string; - /** - * Human-readable stage descriptions. - */ - substeps: string[]; -} -export interface Schema$ExternalDataConfiguration { - /** - * Try to detect schema and format options automatically. Any option specified - * explicitly will be honored. - */ - autodetect: boolean; - /** - * [Optional] Additional options if sourceFormat is set to BIGTABLE. - */ - bigtableOptions: Schema$BigtableOptions; - /** - * [Optional] The compression type of the data source. Possible values include - * GZIP and NONE. The default value is NONE. This setting is ignored for - * Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats. - */ - compression: string; - /** - * Additional properties to set if sourceFormat is set to CSV. - */ - csvOptions: Schema$CsvOptions; - /** - * [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS. - */ - googleSheetsOptions: Schema$GoogleSheetsOptions; - /** - * [Optional] Indicates if BigQuery should allow extra values that are not - * represented in the table schema. If true, the extra values are ignored. If - * false, records with extra columns are treated as bad records, and if there - * are too many bad records, an invalid error is returned in the job result. - * The default value is false. The sourceFormat property determines what - * BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values - * that don't match any column names Google Cloud Bigtable: This setting - * is ignored. Google Cloud Datastore backups: This setting is ignored. Avro: - * This setting is ignored. - */ - ignoreUnknownValues: boolean; - /** - * [Optional] The maximum number of bad records that BigQuery can ignore when - * reading data. If the number of bad records exceeds this value, an invalid - * error is returned in the job result. The default value is 0, which requires - * that all records are valid. This setting is ignored for Google Cloud - * Bigtable, Google Cloud Datastore backups and Avro formats. - */ - maxBadRecords: number; - /** - * [Optional] The schema for the data. Schema is required for CSV and JSON - * formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore - * backups, and Avro formats. - */ - schema: Schema$TableSchema; - /** - * [Required] The data format. For CSV files, specify "CSV". For - * Google sheets, specify "GOOGLE_SHEETS". For newline-delimited - * JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify - * "AVRO". For Google Cloud Datastore backups, specify - * "DATASTORE_BACKUP". [Beta] For Google Cloud Bigtable, specify - * "BIGTABLE". - */ - sourceFormat: string; - /** - * [Required] The fully-qualified URIs that point to your data in Google - * Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' - * wildcard character and it must come after the 'bucket' name. Size - * limits related to load jobs apply to external data sources. For Google - * Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully - * specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google - * Cloud Datastore backups, exactly one URI can be specified. Also, the - * '*' wildcard character is not allowed. - */ - sourceUris: string[]; -} -export interface Schema$GetQueryResultsResponse { - /** - * Whether the query result was fetched from the query cache. - */ - cacheHit: boolean; - /** - * [Output-only] The first errors or warnings encountered during the running - * of the job. The final message includes the number of errors that caused the - * process to stop. Errors here do not necessarily mean that the job has - * completed or was unsuccessful. - */ - errors: Schema$ErrorProto[]; - /** - * A hash of this response. - */ - etag: string; - /** - * Whether the query has completed or not. If rows or totalRows are present, - * this will always be true. If this is false, totalRows will not be - * available. - */ - jobComplete: boolean; - /** - * Reference to the BigQuery Job that was created to run the query. This field - * will be present even if the original request timed out, in which case - * GetQueryResults can be used to read the results once the query has - * completed. Since this API only returns the first page of results, - * subsequent pages can be fetched via the same mechanism (GetQueryResults). - */ - jobReference: Schema$JobReference; - /** - * The resource type of the response. - */ - kind: string; - /** - * [Output-only] The number of rows affected by a DML statement. Present only - * for DML statements INSERT, UPDATE or DELETE. - */ - numDmlAffectedRows: string; - /** - * A token used for paging results. - */ - pageToken: string; - /** - * An object with as many results as can be contained within the maximum - * permitted reply size. To get any additional rows, you can call - * GetQueryResults and specify the jobReference returned above. Present only - * when the query completes successfully. - */ - rows: Schema$TableRow[]; - /** - * The schema of the results. Present only when the query completes - * successfully. - */ - schema: Schema$TableSchema; - /** - * The total number of bytes processed for this query. - */ - totalBytesProcessed: string; - /** - * The total number of rows in the complete query result set, which can be - * more than the number of rows in this single page of results. Present only - * when the query completes successfully. - */ - totalRows: string; -} -export interface Schema$GetServiceAccountResponse { - /** - * The service account email address. - */ - email: string; - /** - * The resource type of the response. - */ - kind: string; -} -export interface Schema$GoogleSheetsOptions { - /** - * [Experimental] [Optional] Range of a sheet to query from. Only used when - * non-empty. Typical format: !: - */ - range: string; - /** - * [Optional] The number of rows at the top of a sheet that BigQuery will skip - * when reading the data. The default value is 0. This property is useful if - * you have header rows that should be skipped. When autodetect is on, - * behavior is the following: * skipLeadingRows unspecified - Autodetect tries - * to detect headers in the first row. If they are not detected, the row is - * read as data. Otherwise data is read starting from the second row. * - * skipLeadingRows is 0 - Instructs autodetect that there are no headers and - * data should be read starting from the first row. * skipLeadingRows = N > - * 0 - Autodetect skips N-1 rows and tries to detect headers in row N. If - * headers are not detected, row N is just skipped. Otherwise row N is used to - * extract column names for the detected schema. - */ - skipLeadingRows: string; -} -export interface Schema$Job { - /** - * [Required] Describes the job configuration. - */ - configuration: Schema$JobConfiguration; - /** - * [Output-only] A hash of this resource. - */ - etag: string; - /** - * [Output-only] Opaque ID field of the job - */ - id: string; - /** - * [Optional] Reference describing the unique-per-user name of the job. - */ - jobReference: Schema$JobReference; - /** - * [Output-only] The type of the resource. - */ - kind: string; - /** - * [Output-only] A URL that can be used to access this resource again. - */ - selfLink: string; - /** - * [Output-only] Information about the job, including starting time and ending - * time of the job. - */ - statistics: Schema$JobStatistics; - /** - * [Output-only] The status of this job. Examine this value when polling an - * asynchronous job to see if the job is complete. - */ - status: Schema$JobStatus; - /** - * [Output-only] Email address of the user who ran the job. - */ - user_email: string; -} -export interface Schema$JobCancelResponse { - /** - * The final state of the job. - */ - job: Schema$Job; - /** - * The resource type of the response. - */ - kind: string; -} -export interface Schema$JobConfiguration { - /** - * [Pick one] Copies a table. - */ - copy: Schema$JobConfigurationTableCopy; - /** - * [Optional] If set, don't actually run this job. A valid query will - * return a mostly empty response with some processing statistics, while an - * invalid query will return the same error it would if it wasn't a dry - * run. Behavior of non-query jobs is undefined. - */ - dryRun: boolean; - /** - * [Pick one] Configures an extract job. - */ - extract: Schema$JobConfigurationExtract; - /** - * [Optional] Job timeout in milliseconds. If this time limit is exceeded, - * BigQuery may attempt to terminate the job. - */ - jobTimeoutMs: string; - /** - * The labels associated with this job. You can use these to organize and - * group your jobs. Label keys and values can be no longer than 63 characters, - * can only contain lowercase letters, numeric characters, underscores and - * dashes. International characters are allowed. Label values are optional. - * Label keys must start with a letter and each label in the list must have a - * different key. - */ - labels: any; - /** - * [Pick one] Configures a load job. - */ - load: Schema$JobConfigurationLoad; - /** - * [Pick one] Configures a query job. - */ - query: Schema$JobConfigurationQuery; -} -export interface Schema$JobConfigurationExtract { - /** - * [Optional] The compression type to use for exported files. Possible values - * include GZIP, DEFLATE, SNAPPY, and NONE. The default value is NONE. DEFLATE - * and SNAPPY are only supported for Avro. - */ - compression: string; - /** - * [Optional] The exported file format. Possible values include CSV, - * NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with - * nested or repeated fields cannot be exported as CSV. - */ - destinationFormat: string; - /** - * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI as - * necessary. The fully-qualified Google Cloud Storage URI where the extracted - * table should be written. - */ - destinationUri: string; - /** - * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the - * extracted table should be written. - */ - destinationUris: string[]; - /** - * [Optional] Delimiter to use between fields in the exported data. Default is - * ',' - */ - fieldDelimiter: string; - /** - * [Optional] Whether to print out a header row in the results. Default is - * true. - */ - printHeader: boolean; - /** - * [Required] A reference to the table being exported. - */ - sourceTable: Schema$TableReference; -} -export interface Schema$JobConfigurationLoad { - /** - * [Optional] Accept rows that are missing trailing optional columns. The - * missing values are treated as nulls. If false, records with missing - * trailing columns are treated as bad records, and if there are too many bad - * records, an invalid error is returned in the job result. The default value - * is false. Only applicable to CSV, ignored for other formats. - */ - allowJaggedRows: boolean; - /** - * Indicates if BigQuery should allow quoted data sections that contain - * newline characters in a CSV file. The default value is false. - */ - allowQuotedNewlines: boolean; - /** - * [Optional] Indicates if we should automatically infer the options and - * schema for CSV and JSON sources. - */ - autodetect: boolean; - /** - * [Experimental] Clustering specification for the destination table. Must be - * specified with time-based partitioning, data in the table will be first - * partitioned and subsequently clustered. - */ - clustering: Schema$Clustering; - /** - * [Optional] Specifies whether the job is allowed to create new tables. The - * following values are supported: CREATE_IF_NEEDED: If the table does not - * exist, BigQuery creates the table. CREATE_NEVER: The table must already - * exist. If it does not, a 'notFound' error is returned in the job - * result. The default value is CREATE_IF_NEEDED. Creation, truncation and - * append actions occur as one atomic update upon job completion. - */ - createDisposition: string; - /** - * Custom encryption configuration (e.g., Cloud KMS keys). - */ - destinationEncryptionConfiguration: Schema$EncryptionConfiguration; - /** - * [Required] The destination table to load the data into. - */ - destinationTable: Schema$TableReference; - /** - * [Experimental] [Optional] Properties with which to create the destination - * table if it is new. - */ - destinationTableProperties: Schema$DestinationTableProperties; - /** - * [Optional] The character encoding of the data. The supported values are - * UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the data - * after the raw, binary data has been split using the values of the quote and - * fieldDelimiter properties. - */ - encoding: string; - /** - * [Optional] The separator for fields in a CSV file. The separator can be any - * ISO-8859-1 single-byte character. To use a character in the range 128-255, - * you must encode the character as UTF8. BigQuery converts the string to - * ISO-8859-1 encoding, and then uses the first byte of the encoded string to - * split the data in its raw, binary state. BigQuery also supports the escape - * sequence "\t" to specify a tab separator. The default value is a - * comma (','). - */ - fieldDelimiter: string; - /** - * [Optional] Indicates if BigQuery should allow extra values that are not - * represented in the table schema. If true, the extra values are ignored. If - * false, records with extra columns are treated as bad records, and if there - * are too many bad records, an invalid error is returned in the job result. - * The default value is false. The sourceFormat property determines what - * BigQuery treats as an extra value: CSV: Trailing columns JSON: Named values - * that don't match any column names - */ - ignoreUnknownValues: boolean; - /** - * [Optional] The maximum number of bad records that BigQuery can ignore when - * running the job. If the number of bad records exceeds this value, an - * invalid error is returned in the job result. The default value is 0, which - * requires that all records are valid. - */ - maxBadRecords: number; - /** - * [Optional] Specifies a string that represents a null value in a CSV file. - * For example, if you specify "x/", BigQuery interprets - * "x/" as a null value when loading a CSV file. The default value - * is the empty string. If you set this property to a custom value, BigQuery - * throws an error if an empty string is present for all data types except for - * STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the empty - * string as an empty value. - */ - nullMarker: string; - /** - * If sourceFormat is set to "DATASTORE_BACKUP", indicates which - * entity properties to load into BigQuery from a Cloud Datastore backup. - * Property names are case sensitive and must be top-level properties. If no - * properties are specified, BigQuery loads all properties. If any named - * property isn't found in the Cloud Datastore backup, an invalid error is - * returned in the job result. - */ - projectionFields: string[]; - /** - * [Optional] The value that is used to quote data sections in a CSV file. - * BigQuery converts the string to ISO-8859-1 encoding, and then uses the - * first byte of the encoded string to split the data in its raw, binary - * state. The default value is a double-quote ('"'). If your data - * does not contain quoted sections, set the property value to an empty - * string. If your data contains quoted newline characters, you must also set - * the allowQuotedNewlines property to true. - */ - quote: string; - /** - * [Optional] The schema for the destination table. The schema can be omitted - * if the destination table already exists, or if you're loading data from - * Google Cloud Datastore. - */ - schema: Schema$TableSchema; - /** - * [Deprecated] The inline schema. For CSV schemas, specify as - * "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, - * bar:INTEGER, baz:FLOAT". - */ - schemaInline: string; - /** - * [Deprecated] The format of the schemaInline property. - */ - schemaInlineFormat: string; - /** - * Allows the schema of the destination table to be updated as a side effect - * of the load job if a schema is autodetected or supplied in the job - * configuration. Schema update options are supported in two cases: when - * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE - * and the destination table is a partition of a table, specified by partition - * decorators. For normal tables, WRITE_TRUNCATE will always overwrite the - * schema. One or more of the following values are specified: - * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. - * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original - * schema to nullable. - */ - schemaUpdateOptions: string[]; - /** - * [Optional] The number of rows at the top of a CSV file that BigQuery will - * skip when loading the data. The default value is 0. This property is useful - * if you have header rows in the file that should be skipped. - */ - skipLeadingRows: number; - /** - * [Optional] The format of the data files. For CSV files, specify - * "CSV". For datastore backups, specify - * "DATASTORE_BACKUP". For newline-delimited JSON, specify - * "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". For - * parquet, specify "PARQUET". For orc, specify "ORC". The - * default value is CSV. - */ - sourceFormat: string; - /** - * [Required] The fully-qualified URIs that point to your data in Google - * Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' - * wildcard character and it must come after the 'bucket' name. Size - * limits related to load jobs apply to external data sources. For Google - * Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully - * specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google - * Cloud Datastore backups: Exactly one URI can be specified. Also, the - * '*' wildcard character is not allowed. - */ - sourceUris: string[]; - /** - * Time-based partitioning specification for the destination table. - */ - timePartitioning: Schema$TimePartitioning; - /** - * [Optional] Specifies the action that occurs if the destination table - * already exists. The following values are supported: WRITE_TRUNCATE: If the - * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If - * the table already exists, BigQuery appends the data to the table. - * WRITE_EMPTY: If the table already exists and contains data, a - * 'duplicate' error is returned in the job result. The default value - * is WRITE_APPEND. Each action is atomic and only occurs if BigQuery is able - * to complete the job successfully. Creation, truncation and append actions - * occur as one atomic update upon job completion. - */ - writeDisposition: string; -} -export interface Schema$JobConfigurationQuery { - /** - * [Optional] If true and query uses legacy SQL dialect, allows the query to - * produce arbitrarily large result tables at a slight cost in performance. - * Requires destinationTable to be set. For standard SQL queries, this flag is - * ignored and large results are always allowed. However, you must still set - * destinationTable when result size exceeds the allowed maximum response - * size. - */ - allowLargeResults: boolean; - /** - * [Experimental] Clustering specification for the destination table. Must be - * specified with time-based partitioning, data in the table will be first - * partitioned and subsequently clustered. - */ - clustering: Schema$Clustering; - /** - * [Optional] Specifies whether the job is allowed to create new tables. The - * following values are supported: CREATE_IF_NEEDED: If the table does not - * exist, BigQuery creates the table. CREATE_NEVER: The table must already - * exist. If it does not, a 'notFound' error is returned in the job - * result. The default value is CREATE_IF_NEEDED. Creation, truncation and - * append actions occur as one atomic update upon job completion. - */ - createDisposition: string; - /** - * [Optional] Specifies the default dataset to use for unqualified table names - * in the query. - */ - defaultDataset: Schema$DatasetReference; - /** - * Custom encryption configuration (e.g., Cloud KMS keys). - */ - destinationEncryptionConfiguration: Schema$EncryptionConfiguration; - /** - * [Optional] Describes the table where the query results should be stored. If - * not present, a new table will be created to store the results. This - * property must be set for large results that exceed the maximum response - * size. - */ - destinationTable: Schema$TableReference; - /** - * [Optional] If true and query uses legacy SQL dialect, flattens all nested - * and repeated fields in the query results. allowLargeResults must be true if - * this is set to false. For standard SQL queries, this flag is ignored and - * results are never flattened. - */ - flattenResults: boolean; - /** - * [Optional] Limits the billing tier for this job. Queries that have resource - * usage beyond this tier will fail (without incurring a charge). If - * unspecified, this will be set to your project default. - */ - maximumBillingTier: number; - /** - * [Optional] Limits the bytes billed for this job. Queries that will have - * bytes billed beyond this limit will fail (without incurring a charge). If - * unspecified, this will be set to your project default. - */ - maximumBytesBilled: string; - /** - * Standard SQL only. Set to POSITIONAL to use positional (?) query parameters - * or to NAMED to use named (@myparam) query parameters in this query. - */ - parameterMode: string; - /** - * [Deprecated] This property is deprecated. - */ - preserveNulls: boolean; - /** - * [Optional] Specifies a priority for the query. Possible values include - * INTERACTIVE and BATCH. The default value is INTERACTIVE. - */ - priority: string; - /** - * [Required] SQL query text to execute. The useLegacySql field can be used to - * indicate whether the query uses legacy SQL or standard SQL. - */ - query: string; - /** - * Query parameters for standard SQL queries. - */ - queryParameters: Schema$QueryParameter[]; - /** - * Allows the schema of the destination table to be updated as a side effect - * of the query job. Schema update options are supported in two cases: when - * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE - * and the destination table is a partition of a table, specified by partition - * decorators. For normal tables, WRITE_TRUNCATE will always overwrite the - * schema. One or more of the following values are specified: - * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. - * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original - * schema to nullable. - */ - schemaUpdateOptions: string[]; - /** - * [Optional] If querying an external data source outside of BigQuery, - * describes the data format, location and other properties of the data - * source. By defining these properties, the data source can then be queried - * as if it were a standard BigQuery table. - */ - tableDefinitions: any; - /** - * Time-based partitioning specification for the destination table. - */ - timePartitioning: Schema$TimePartitioning; - /** - * Specifies whether to use BigQuery's legacy SQL dialect for this query. - * The default value is true. If set to false, the query will use - * BigQuery's standard SQL: - * https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set - * to false, the value of flattenResults is ignored; query will be run as if - * flattenResults is false. - */ - useLegacySql: boolean; - /** - * [Optional] Whether to look for the result in the query cache. The query - * cache is a best-effort cache that will be flushed whenever tables in the - * query are modified. Moreover, the query cache is only available when a - * query does not have a destination table specified. The default value is - * true. - */ - useQueryCache: boolean; - /** - * Describes user-defined function resources used in the query. - */ - userDefinedFunctionResources: Schema$UserDefinedFunctionResource[]; - /** - * [Optional] Specifies the action that occurs if the destination table - * already exists. The following values are supported: WRITE_TRUNCATE: If the - * table already exists, BigQuery overwrites the table data and uses the - * schema from the query result. WRITE_APPEND: If the table already exists, - * BigQuery appends the data to the table. WRITE_EMPTY: If the table already - * exists and contains data, a 'duplicate' error is returned in the - * job result. The default value is WRITE_EMPTY. Each action is atomic and - * only occurs if BigQuery is able to complete the job successfully. Creation, - * truncation and append actions occur as one atomic update upon job - * completion. - */ - writeDisposition: string; -} -export interface Schema$JobConfigurationTableCopy { - /** - * [Optional] Specifies whether the job is allowed to create new tables. The - * following values are supported: CREATE_IF_NEEDED: If the table does not - * exist, BigQuery creates the table. CREATE_NEVER: The table must already - * exist. If it does not, a 'notFound' error is returned in the job - * result. The default value is CREATE_IF_NEEDED. Creation, truncation and - * append actions occur as one atomic update upon job completion. - */ - createDisposition: string; - /** - * Custom encryption configuration (e.g., Cloud KMS keys). - */ - destinationEncryptionConfiguration: Schema$EncryptionConfiguration; - /** - * [Required] The destination table - */ - destinationTable: Schema$TableReference; - /** - * [Pick one] Source table to copy. - */ - sourceTable: Schema$TableReference; - /** - * [Pick one] Source tables to copy. - */ - sourceTables: Schema$TableReference[]; - /** - * [Optional] Specifies the action that occurs if the destination table - * already exists. The following values are supported: WRITE_TRUNCATE: If the - * table already exists, BigQuery overwrites the table data. WRITE_APPEND: If - * the table already exists, BigQuery appends the data to the table. - * WRITE_EMPTY: If the table already exists and contains data, a - * 'duplicate' error is returned in the job result. The default value - * is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able - * to complete the job successfully. Creation, truncation and append actions - * occur as one atomic update upon job completion. - */ - writeDisposition: string; -} -export interface Schema$JobList { - /** - * A hash of this page of results. - */ - etag: string; - /** - * List of jobs that were requested. - */ - jobs: any[]; - /** - * The resource type of the response. - */ - kind: string; - /** - * A token to request the next page of results. - */ - nextPageToken: string; -} -export interface Schema$JobReference { - /** - * [Required] The ID of the job. The ID must contain only letters (a-z, A-Z), - * numbers (0-9), underscores (_), or dashes (-). The maximum length is 1,024 - * characters. - */ - jobId: string; - /** - * [Experimental] The geographic location of the job. Required except for US - * and EU. - */ - location: string; - /** - * [Required] The ID of the project containing this job. - */ - projectId: string; -} -export interface Schema$JobStatistics { - /** - * [Experimental] [Output-only] Job progress (0.0 -> 1.0) for LOAD and - * EXTRACT jobs. - */ - completionRatio: number; - /** - * [Output-only] Creation time of this job, in milliseconds since the epoch. - * This field will be present on all jobs. - */ - creationTime: string; - /** - * [Output-only] End time of this job, in milliseconds since the epoch. This - * field will be present whenever a job is in the DONE state. - */ - endTime: string; - /** - * [Output-only] Statistics for an extract job. - */ - extract: Schema$JobStatistics4; - /** - * [Output-only] Statistics for a load job. - */ - load: Schema$JobStatistics3; - /** - * [Output-only] Statistics for a query job. - */ - query: Schema$JobStatistics2; - /** - * [Output-only] Start time of this job, in milliseconds since the epoch. This - * field will be present when the job transitions from the PENDING state to - * either RUNNING or DONE. - */ - startTime: string; - /** - * [Output-only] [Deprecated] Use the bytes processed in the query statistics - * instead. - */ - totalBytesProcessed: string; -} -export interface Schema$JobStatistics2 { - /** - * [Output-only] Billing tier for the job. - */ - billingTier: number; - /** - * [Output-only] Whether the query result was fetched from the query cache. - */ - cacheHit: boolean; - /** - * [Output-only, Experimental] The DDL operation performed, possibly dependent - * on the pre-existence of the DDL target. Possible values (new values might - * be added in the future): "CREATE": The query created the DDL - * target. "SKIP": No-op. Example cases: the query is CREATE TABLE - * IF NOT EXISTS while the table already exists, or the query is DROP TABLE IF - * EXISTS while the table does not exist. "REPLACE": The query - * replaced the DDL target. Example case: the query is CREATE OR REPLACE - * TABLE, and the table already exists. "DROP": The query deleted - * the DDL target. - */ - ddlOperationPerformed: string; - /** - * [Output-only, Experimental] The DDL target table. Present only for - * CREATE/DROP TABLE/VIEW queries. - */ - ddlTargetTable: Schema$TableReference; - /** - * [Output-only] The original estimate of bytes processed for the job. - */ - estimatedBytesProcessed: string; - /** - * [Output-only] The number of rows affected by a DML statement. Present only - * for DML statements INSERT, UPDATE or DELETE. - */ - numDmlAffectedRows: string; - /** - * [Output-only] Describes execution plan for the query. - */ - queryPlan: Schema$ExplainQueryStage[]; - /** - * [Output-only] Referenced tables for the job. Queries that reference more - * than 50 tables will not have a complete list. - */ - referencedTables: Schema$TableReference[]; - /** - * [Output-only] The schema of the results. Present only for successful dry - * run of non-legacy SQL queries. - */ - schema: Schema$TableSchema; - /** - * [Output-only, Experimental] The type of query statement, if valid. Possible - * values (new values might be added in the future): "SELECT": - * SELECT query. "INSERT": INSERT query; see - * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language - * "UPDATE": UPDATE query; see - * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language - * "DELETE": DELETE query; see - * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language - * "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. - * "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS SELECT - * ... "DROP_TABLE": DROP TABLE query. "CREATE_VIEW": - * CREATE [OR REPLACE] VIEW ... AS SELECT ... "DROP_VIEW": DROP VIEW - * query. - */ - statementType: string; - /** - * [Output-only] [Experimental] Describes a timeline of job execution. - */ - timeline: Schema$QueryTimelineSample[]; - /** - * [Output-only] Total bytes billed for the job. - */ - totalBytesBilled: string; - /** - * [Output-only] Total bytes processed for the job. - */ - totalBytesProcessed: string; - /** - * [Output-only] Total number of partitions processed from all partitioned - * tables referenced in the job. - */ - totalPartitionsProcessed: string; - /** - * [Output-only] Slot-milliseconds for the job. - */ - totalSlotMs: string; - /** - * [Output-only, Experimental] Standard SQL only: list of undeclared query - * parameters detected during a dry run validation. - */ - undeclaredQueryParameters: Schema$QueryParameter[]; -} -export interface Schema$JobStatistics3 { - /** - * [Output-only] The number of bad records encountered. Note that if the job - * has failed because of more bad records encountered than the maximum allowed - * in the load job configuration, then this number can be less than the total - * number of bad records present in the input data. - */ - badRecords: string; - /** - * [Output-only] Number of bytes of source data in a load job. - */ - inputFileBytes: string; - /** - * [Output-only] Number of source files in a load job. - */ - inputFiles: string; - /** - * [Output-only] Size of the loaded data in bytes. Note that while a load job - * is in the running state, this value may change. - */ - outputBytes: string; - /** - * [Output-only] Number of rows imported in a load job. Note that while an - * import job is in the running state, this value may change. - */ - outputRows: string; -} -export interface Schema$JobStatistics4 { - /** - * [Output-only] Number of files per destination URI or URI pattern specified - * in the extract configuration. These values will be in the same order as the - * URIs specified in the 'destinationUris' field. - */ - destinationUriFileCounts: string[]; -} -export interface Schema$JobStatus { - /** - * [Output-only] Final error result of the job. If present, indicates that the - * job has completed and was unsuccessful. - */ - errorResult: Schema$ErrorProto; - /** - * [Output-only] The first errors encountered during the running of the job. - * The final message includes the number of errors that caused the process to - * stop. Errors here do not necessarily mean that the job has completed or was - * unsuccessful. - */ - errors: Schema$ErrorProto[]; - /** - * [Output-only] Running state of the job. - */ - state: string; -} -/** - * Represents a single JSON object. - */ -export interface Schema$JsonObject {} -export interface Schema$JsonValue {} -export interface Schema$ProjectList { - /** - * A hash of the page of results - */ - etag: string; - /** - * The type of list. - */ - kind: string; - /** - * A token to request the next page of results. - */ - nextPageToken: string; - /** - * Projects to which you have at least READ access. - */ - projects: any[]; - /** - * The total number of projects in the list. - */ - totalItems: number; -} -export interface Schema$ProjectReference { - /** - * [Required] ID of the project. Can be either the numeric ID or the assigned - * ID of the project. - */ - projectId: string; -} -export interface Schema$QueryParameter { - /** - * [Optional] If unset, this is a positional parameter. Otherwise, should be - * unique within a query. - */ - name: string; - /** - * [Required] The type of this parameter. - */ - parameterType: Schema$QueryParameterType; - /** - * [Required] The value of this parameter. - */ - parameterValue: Schema$QueryParameterValue; -} -export interface Schema$QueryParameterType { - /** - * [Optional] The type of the array's elements, if this is an array. - */ - arrayType: Schema$QueryParameterType; - /** - * [Optional] The types of the fields of this struct, in order, if this is a - * struct. - */ - structTypes: any[]; - /** - * [Required] The top level type of this field. - */ - type: string; -} -export interface Schema$QueryParameterValue { - /** - * [Optional] The array values, if this is an array type. - */ - arrayValues: Schema$QueryParameterValue[]; - /** - * [Optional] The struct field values, in order of the struct type's - * declaration. - */ - structValues: any; - /** - * [Optional] The value of this value, if a simple scalar type. - */ - value: string; -} -export interface Schema$QueryRequest { - /** - * [Optional] Specifies the default datasetId and projectId to assume for any - * unqualified table names in the query. If not set, all table names in the - * query string must be qualified in the format 'datasetId.tableId'. - */ - defaultDataset: Schema$DatasetReference; - /** - * [Optional] If set to true, BigQuery doesn't run the job. Instead, if - * the query is valid, BigQuery returns statistics about the job such as how - * many bytes would be processed. If the query is invalid, an error returns. - * The default value is false. - */ - dryRun: boolean; - /** - * The resource type of the request. - */ - kind: string; - /** - * [Experimental] The geographic location where the job should run. Required - * except for US and EU. - */ - location: string; - /** - * [Optional] The maximum number of rows of data to return per page of - * results. Setting this flag to a small value such as 1000 and then paging - * through results might improve reliability when the query result set is - * large. In addition to this limit, responses are also limited to 10 MB. By - * default, there is no maximum row count, and only the byte limit applies. - */ - maxResults: number; - /** - * Standard SQL only. Set to POSITIONAL to use positional (?) query parameters - * or to NAMED to use named (@myparam) query parameters in this query. - */ - parameterMode: string; - /** - * [Deprecated] This property is deprecated. - */ - preserveNulls: boolean; - /** - * [Required] A query string, following the BigQuery query syntax, of the - * query to execute. Example: "SELECT count(f1) FROM - * [myProjectId:myDatasetId.myTableId]". - */ - query: string; - /** - * Query parameters for Standard SQL queries. - */ - queryParameters: Schema$QueryParameter[]; - /** - * [Optional] How long to wait for the query to complete, in milliseconds, - * before the request times out and returns. Note that this is only a timeout - * for the request, not the query. If the query takes longer to run than the - * timeout value, the call returns without any results and with the - * 'jobComplete' flag set to false. You can call GetQueryResults() to - * wait for the query to complete and read the results. The default value is - * 10000 milliseconds (10 seconds). - */ - timeoutMs: number; - /** - * Specifies whether to use BigQuery's legacy SQL dialect for this query. - * The default value is true. If set to false, the query will use - * BigQuery's standard SQL: - * https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set - * to false, the value of flattenResults is ignored; query will be run as if - * flattenResults is false. - */ - useLegacySql: boolean; - /** - * [Optional] Whether to look for the result in the query cache. The query - * cache is a best-effort cache that will be flushed whenever tables in the - * query are modified. The default value is true. - */ - useQueryCache: boolean; -} -export interface Schema$QueryResponse { - /** - * Whether the query result was fetched from the query cache. - */ - cacheHit: boolean; - /** - * [Output-only] The first errors or warnings encountered during the running - * of the job. The final message includes the number of errors that caused the - * process to stop. Errors here do not necessarily mean that the job has - * completed or was unsuccessful. - */ - errors: Schema$ErrorProto[]; - /** - * Whether the query has completed or not. If rows or totalRows are present, - * this will always be true. If this is false, totalRows will not be - * available. - */ - jobComplete: boolean; - /** - * Reference to the Job that was created to run the query. This field will be - * present even if the original request timed out, in which case - * GetQueryResults can be used to read the results once the query has - * completed. Since this API only returns the first page of results, - * subsequent pages can be fetched via the same mechanism (GetQueryResults). - */ - jobReference: Schema$JobReference; - /** - * The resource type. - */ - kind: string; - /** - * [Output-only] The number of rows affected by a DML statement. Present only - * for DML statements INSERT, UPDATE or DELETE. - */ - numDmlAffectedRows: string; - /** - * A token used for paging results. - */ - pageToken: string; - /** - * An object with as many results as can be contained within the maximum - * permitted reply size. To get any additional rows, you can call - * GetQueryResults and specify the jobReference returned above. - */ - rows: Schema$TableRow[]; - /** - * The schema of the results. Present only when the query completes - * successfully. - */ - schema: Schema$TableSchema; - /** - * The total number of bytes processed for this query. If this query was a dry - * run, this is the number of bytes that would be processed if the query were - * run. - */ - totalBytesProcessed: string; - /** - * The total number of rows in the complete query result set, which can be - * more than the number of rows in this single page of results. - */ - totalRows: string; -} -export interface Schema$QueryTimelineSample { - /** - * Total number of units currently being processed by workers. This does not - * correspond directly to slot usage. This is the largest value observed since - * the last sample. - */ - activeUnits: string; - /** - * Total parallel units of work completed by this query. - */ - completedUnits: string; - /** - * Milliseconds elapsed since the start of query execution. - */ - elapsedMs: string; - /** - * Total parallel units of work remaining for the active stages. - */ - pendingUnits: string; - /** - * Cumulative slot-ms consumed by the query. - */ - totalSlotMs: string; -} -export interface Schema$Streamingbuffer { - /** - * [Output-only] A lower-bound estimate of the number of bytes currently in - * the streaming buffer. - */ - estimatedBytes: string; - /** - * [Output-only] A lower-bound estimate of the number of rows currently in the - * streaming buffer. - */ - estimatedRows: string; - /** - * [Output-only] Contains the timestamp of the oldest entry in the streaming - * buffer, in milliseconds since the epoch, if the streaming buffer is - * available. - */ - oldestEntryTime: string; -} -export interface Schema$Table { - /** - * [Experimental] Clustering specification for the table. Must be specified - * with time-based partitioning, data in the table will be first partitioned - * and subsequently clustered. - */ - clustering: Schema$Clustering; - /** - * [Output-only] The time when this table was created, in milliseconds since - * the epoch. - */ - creationTime: string; - /** - * [Optional] A user-friendly description of this table. - */ - description: string; - /** - * Custom encryption configuration (e.g., Cloud KMS keys). - */ - encryptionConfiguration: Schema$EncryptionConfiguration; - /** - * [Output-only] A hash of this resource. - */ - etag: string; - /** - * [Optional] The time when this table expires, in milliseconds since the - * epoch. If not present, the table will persist indefinitely. Expired tables - * will be deleted and their storage reclaimed. The defaultTableExpirationMs - * property of the encapsulating dataset can be used to set a default - * expirationTime on newly created tables. - */ - expirationTime: string; - /** - * [Optional] Describes the data format, location, and other properties of a - * table stored outside of BigQuery. By defining these properties, the data - * source can then be queried as if it were a standard BigQuery table. - */ - externalDataConfiguration: Schema$ExternalDataConfiguration; - /** - * [Optional] A descriptive name for this table. - */ - friendlyName: string; - /** - * [Output-only] An opaque ID uniquely identifying the table. - */ - id: string; - /** - * [Output-only] The type of the resource. - */ - kind: string; - /** - * The labels associated with this table. You can use these to organize and - * group your tables. Label keys and values can be no longer than 63 - * characters, can only contain lowercase letters, numeric characters, - * underscores and dashes. International characters are allowed. Label values - * are optional. Label keys must start with a letter and each label in the - * list must have a different key. - */ - labels: any; - /** - * [Output-only] The time when this table was last modified, in milliseconds - * since the epoch. - */ - lastModifiedTime: string; - /** - * [Output-only] The geographic location where the table resides. This value - * is inherited from the dataset. - */ - location: string; +export namespace bigquery_v2 { /** - * [Output-only] The size of this table in bytes, excluding any data in the - * streaming buffer. - */ - numBytes: string; - /** - * [Output-only] The number of bytes in the table that are considered - * "long-term storage". - */ - numLongTermBytes: string; - /** - * [Output-only] The number of rows of data in this table, excluding any data - * in the streaming buffer. - */ - numRows: string; - /** - * [Optional] Describes the schema of this table. - */ - schema: Schema$TableSchema; - /** - * [Output-only] A URL that can be used to access this resource again. - */ - selfLink: string; - /** - * [Output-only] Contains information regarding this table's streaming - * buffer, if one is present. This field will be absent if the table is not - * being streamed to or if there is no data in the streaming buffer. - */ - streamingBuffer: Schema$Streamingbuffer; - /** - * [Required] Reference describing the ID of this table. - */ - tableReference: Schema$TableReference; - /** - * Time-based partitioning specification for this table. - */ - timePartitioning: Schema$TimePartitioning; - /** - * [Output-only] Describes the table type. The following values are supported: - * TABLE: A normal BigQuery table. VIEW: A virtual table defined by a SQL - * query. EXTERNAL: A table that references data stored in an external storage - * system, such as Google Cloud Storage. The default value is TABLE. - */ - type: string; - /** - * [Optional] The view definition. - */ - view: Schema$ViewDefinition; -} -export interface Schema$TableCell { v: any; } -export interface Schema$TableDataInsertAllRequest { - /** - * [Optional] Accept rows that contain values that do not match the schema. - * The unknown values are ignored. Default is false, which treats unknown - * values as errors. - */ - ignoreUnknownValues: boolean; - /** - * The resource type of the response. - */ - kind: string; - /** - * The rows to insert. - */ - rows: any[]; - /** - * [Optional] Insert all valid rows of a request, even if invalid rows exist. - * The default value is false, which causes the entire request to fail if any - * invalid rows exist. - */ - skipInvalidRows: boolean; - /** - * [Experimental] If specified, treats the destination table as a base - * template, and inserts the rows into an instance table named - * "{destination}{templateSuffix}". BigQuery will manage creation of - * the instance table, using the schema of the base template table. See - * https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables - * for considerations when working with templates tables. - */ - templateSuffix: string; -} -export interface Schema$TableDataInsertAllResponse { - /** - * An array of errors for rows that were not inserted. - */ - insertErrors: any[]; - /** - * The resource type of the response. - */ - kind: string; -} -export interface Schema$TableDataList { - /** - * A hash of this page of results. - */ - etag: string; - /** - * The resource type of the response. - */ - kind: string; - /** - * A token used for paging results. Providing this token instead of the - * startIndex parameter can help you retrieve stable results when an - * underlying table is changing. - */ - pageToken: string; - /** - * Rows of results. - */ - rows: Schema$TableRow[]; - /** - * The total number of rows in the complete table. - */ - totalRows: string; -} -export interface Schema$TableFieldSchema { - /** - * [Optional] The field description. The maximum length is 1,024 characters. - */ - description: string; - /** - * [Optional] Describes the nested schema fields if the type property is set - * to RECORD. - */ - fields: Schema$TableFieldSchema[]; - /** - * [Optional] The field mode. Possible values include NULLABLE, REQUIRED and - * REPEATED. The default value is NULLABLE. - */ - mode: string; - /** - * [Required] The field name. The name must contain only letters (a-z, A-Z), - * numbers (0-9), or underscores (_), and must start with a letter or - * underscore. The maximum length is 128 characters. - */ - name: string; - /** - * [Required] The field data type. Possible values include STRING, BYTES, - * INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, - * BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where - * RECORD indicates that the field contains a nested schema) or STRUCT (same - * as RECORD). - */ - type: string; -} -export interface Schema$TableList { - /** - * A hash of this page of results. - */ - etag: string; - /** - * The type of list. - */ - kind: string; - /** - * A token to request the next page of results. - */ - nextPageToken: string; - /** - * Tables in the requested dataset. - */ - tables: any[]; - /** - * The total number of tables in the dataset. - */ - totalItems: number; -} -export interface Schema$TableReference { - /** - * [Required] The ID of the dataset containing this table. - */ - datasetId: string; - /** - * [Required] The ID of the project containing this table. - */ - projectId: string; - /** - * [Required] The ID of the table. The ID must contain only letters (a-z, - * A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 - * characters. - */ - tableId: string; -} -export interface Schema$TableRow { - /** - * Represents a single row in the result set, consisting of one or more - * fields. - */ - f: Schema$TableCell[]; -} -export interface Schema$TableSchema { - /** - * Describes the fields in a table. - */ - fields: Schema$TableFieldSchema[]; -} -export interface Schema$TimePartitioning { - /** - * [Optional] Number of milliseconds for which to keep the storage for a - * partition. - */ - expirationMs: string; - /** - * [Experimental] [Optional] If not set, the table is partitioned by pseudo - * column '_PARTITIONTIME'; if set, the table is partitioned by this - * field. The field must be a top-level TIMESTAMP or DATE field. Its mode must - * be NULLABLE or REQUIRED. - */ - field: string; - /** - * [Experimental] [Optional] If set to true, queries over this table require a - * partition filter that can be used for partition elimination to be - * specified. - */ - requirePartitionFilter: boolean; - /** - * [Required] The only type supported is DAY, which will generate one - * partition per day. - */ - type: string; -} -export interface Schema$UserDefinedFunctionResource { - /** - * [Pick one] An inline resource that contains code for a user-defined - * function (UDF). Providing a inline code resource is equivalent to providing - * a URI for a file containing the same code. - */ - inlineCode: string; - /** - * [Pick one] A code resource to load from a Google Cloud Storage URI - * (gs://bucket/path). - */ - resourceUri: string; -} -export interface Schema$ViewDefinition { - /** - * [Required] A query that BigQuery executes when the view is referenced. - */ - query: string; - /** - * Specifies whether to use BigQuery's legacy SQL for this view. The - * default value is true. If set to false, the view will use BigQuery's - * standard SQL: https://cloud.google.com/bigquery/sql-reference/ Queries and - * views that reference this view must use the same flag value. - */ - useLegacySql: boolean; - /** - * Describes user-defined function resources used in the query. - */ - userDefinedFunctionResources: Schema$UserDefinedFunctionResource[]; -} - -export class Resource$Datasets { - root: Bigquery; - constructor(root: Bigquery) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * bigquery.datasets.delete - * @desc Deletes the dataset specified by the datasetId value. Before you can - * delete a dataset, you must delete all its tables, either manually or by - * specifying deleteContents. Immediately after deletion, you can create - * another dataset with the same name. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); + * BigQuery API * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being deleted - * projectId: 'my-project-id', // TODO: Update placeholder value. + * A data platform for customers to create, manage, share and query data. * - * // Dataset ID of dataset being deleted - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.datasets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of dataset being deleted - * @param {boolean=} params.deleteContents If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False - * @param {string} params.projectId Project ID of the dataset being deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * bigquery.datasets.get - * @desc Returns the dataset specified by datasetID. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested dataset - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the requested dataset - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.datasets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the requested dataset - * @param {string} params.projectId Project ID of the requested dataset - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - + * const google = require('googleapis'); + * const bigquery = google.bigquery('v2'); + * + * @namespace bigquery + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Bigquery + */ + export class Bigquery { + _options: GlobalOptions; + google: GoogleApis; + root = this; - /** - * bigquery.datasets.insert - * @desc Creates a new empty dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the new dataset - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID of the new dataset - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/datasets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + datasets: Resource$Datasets; + jobs: Resource$Jobs; + projects: Resource$Projects; + tabledata: Resource$Tabledata; + tables: Resource$Tables; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * bigquery.datasets.list - * @desc Lists all datasets in the specified project to which you have been - * granted the READER dataset role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the datasets to be listed - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var datasetsPage = response['datasets']; - * if (!datasetsPage) { - * return; - * } - * for (var i = 0; i < datasetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `datasetsPage`: console.log(JSON.stringify(datasetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.datasets.list(request, handlePage); - * } - * }; - * - * bigquery.datasets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.all Whether to list all datasets, including hidden ones - * @param {string=} params.filter An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. - * @param {integer=} params.maxResults The maximum number of results to return - * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results - * @param {string} params.projectId Project ID of the datasets to be listed - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.datasets = new Resource$Datasets(this); + this.jobs = new Resource$Jobs(this); + this.projects = new Resource$Projects(this); + this.tabledata = new Resource$Tabledata(this); + this.tables = new Resource$Tables(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/datasets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * bigquery.datasets.patch - * @desc Updates information in an existing dataset. The update method - * replaces the entire dataset resource, whereas the patch method only - * replaces fields that are provided in the submitted dataset resource. This - * method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being updated - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the dataset being updated - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the dataset being updated - * @param {string} params.projectId Project ID of the dataset being updated - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - - /** - * bigquery.datasets.update - * @desc Updates information in an existing dataset. The update method - * replaces the entire dataset resource, whereas the patch method only - * replaces fields that are provided in the submitted dataset resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the dataset being updated - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the dataset being updated - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * bigquery.datasets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.datasets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the dataset being updated - * @param {string} params.projectId Project ID of the dataset being updated - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BigtableColumn { + /** + * [Optional] The encoding of the values when the type is not STRING. + * Acceptable encoding values are: TEXT - indicates values are alphanumeric + * text strings. BINARY - indicates values are encoded using HBase + * Bytes.toBytes family of functions. 'encoding' can also be set at + * the column family level. However, the setting at this level takes + * precedence if 'encoding' is set at both levels. + */ + encoding: string; + /** + * [Optional] If the qualifier is not a valid BigQuery field identifier i.e. + * does not match [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided + * as the column field name and is used as field name in queries. + */ + fieldName: string; + /** + * [Optional] If this is set, only the latest version of value in this + * column are exposed. 'onlyReadLatest' can also be set at the + * column family level. However, the setting at this level takes precedence + * if 'onlyReadLatest' is set at both levels. + */ + onlyReadLatest: boolean; + /** + * [Required] Qualifier of the column. Columns in the parent column family + * that has this exact qualifier are exposed as . field. If the qualifier is + * valid UTF-8 string, it can be specified in the qualifier_string field. + * Otherwise, a base-64 encoded value must be set to qualifier_encoded. The + * column field name is the same as the column qualifier. However, if the + * qualifier is not a valid BigQuery field identifier i.e. does not match + * [a-zA-Z][a-zA-Z0-9_]*, a valid identifier must be provided as field_name. + */ + qualifierEncoded: string; + qualifierString: string; + /** + * [Optional] The type to convert the value in cells of this column. The + * values are expected to be encoded using HBase Bytes.toBytes function when + * using the BINARY encoding value. Following BigQuery types are allowed + * (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default type is + * BYTES. 'type' can also be set at the column family level. + * However, the setting at this level takes precedence if 'type' is + * set at both levels. + */ + type: string; } -} - -export class Resource$Jobs { - root: Bigquery; - constructor(root: Bigquery) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$BigtableColumnFamily { + /** + * [Optional] Lists of columns that should be exposed as individual fields + * as opposed to a list of (column name, value) pairs. All columns whose + * qualifier matches a qualifier in this list can be accessed as .. Other + * columns can be accessed as a list through .Column field. + */ + columns: Schema$BigtableColumn[]; + /** + * [Optional] The encoding of the values when the type is not STRING. + * Acceptable encoding values are: TEXT - indicates values are alphanumeric + * text strings. BINARY - indicates values are encoded using HBase + * Bytes.toBytes family of functions. This can be overridden for a specific + * column by listing that column in 'columns' and specifying an + * encoding for it. + */ + encoding: string; + /** + * Identifier of the column family. + */ + familyId: string; + /** + * [Optional] If this is set only the latest version of value are exposed + * for all columns in this column family. This can be overridden for a + * specific column by listing that column in 'columns' and + * specifying a different setting for that column. + */ + onlyReadLatest: boolean; + /** + * [Optional] The type to convert the value in cells of this column family. + * The values are expected to be encoded using HBase Bytes.toBytes function + * when using the BINARY encoding value. Following BigQuery types are + * allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default + * type is BYTES. This can be overridden for a specific column by listing + * that column in 'columns' and specifying a type for it. + */ + type: string; } - - getRoot() { - return this.root; + export interface Schema$BigtableOptions { + /** + * [Optional] List of column families to expose in the table schema along + * with their types. This list restricts the column families that can be + * referenced in queries and specifies their value types. You can use this + * list to do type conversions - see the 'type' field for more + * details. If you leave this list empty, all column families are present in + * the table schema and their values are read as BYTES. During a query only + * the column families referenced in that query are read from Bigtable. + */ + columnFamilies: Schema$BigtableColumnFamily[]; + /** + * [Optional] If field is true, then the column families that are not + * specified in columnFamilies list are not exposed in the table schema. + * Otherwise, they are read with BYTES type values. The default value is + * false. + */ + ignoreUnspecifiedColumnFamilies: boolean; + /** + * [Optional] If field is true, then the rowkey column families will be read + * and converted to string. Otherwise they are read with BYTES type values + * and users need to manually cast them with CAST if necessary. The default + * value is false. + */ + readRowkeyAsString: boolean; + } + export interface Schema$Clustering { + /** + * [Repeated] One or more fields on which data should be clustered. Only + * top-level, non-repeated, simple-type fields are supported. The order of + * the fields will determine how clusters will be generated, so it is + * important. + */ + fields: string[]; + } + export interface Schema$CsvOptions { + /** + * [Optional] Indicates if BigQuery should accept rows that are missing + * trailing optional columns. If true, BigQuery treats missing trailing + * columns as null values. If false, records with missing trailing columns + * are treated as bad records, and if there are too many bad records, an + * invalid error is returned in the job result. The default value is false. + */ + allowJaggedRows: boolean; + /** + * [Optional] Indicates if BigQuery should allow quoted data sections that + * contain newline characters in a CSV file. The default value is false. + */ + allowQuotedNewlines: boolean; + /** + * [Optional] The character encoding of the data. The supported values are + * UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the + * data after the raw, binary data has been split using the values of the + * quote and fieldDelimiter properties. + */ + encoding: string; + /** + * [Optional] The separator for fields in a CSV file. BigQuery converts the + * string to ISO-8859-1 encoding, and then uses the first byte of the + * encoded string to split the data in its raw, binary state. BigQuery also + * supports the escape sequence "\t" to specify a tab separator. + * The default value is a comma (','). + */ + fieldDelimiter: string; + /** + * [Optional] The value that is used to quote data sections in a CSV file. + * BigQuery converts the string to ISO-8859-1 encoding, and then uses the + * first byte of the encoded string to split the data in its raw, binary + * state. The default value is a double-quote ('"'). If your + * data does not contain quoted sections, set the property value to an empty + * string. If your data contains quoted newline characters, you must also + * set the allowQuotedNewlines property to true. + */ + quote: string; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will + * skip when reading the data. The default value is 0. This property is + * useful if you have header rows in the file that should be skipped. + */ + skipLeadingRows: string; + } + export interface Schema$Dataset { + /** + * [Optional] An array of objects that define dataset access for one or more + * entities. You can set this property when inserting or updating a dataset + * in order to control who is allowed to access the data. If unspecified at + * dataset creation time, BigQuery adds default dataset access for the + * following entities: access.specialGroup: projectReaders; access.role: + * READER; access.specialGroup: projectWriters; access.role: WRITER; + * access.specialGroup: projectOwners; access.role: OWNER; + * access.userByEmail: [dataset creator email]; access.role: OWNER; + */ + access: any[]; + /** + * [Output-only] The time when this dataset was created, in milliseconds + * since the epoch. + */ + creationTime: string; + /** + * [Required] A reference that identifies the dataset. + */ + datasetReference: Schema$DatasetReference; + /** + * [Optional] The default lifetime of all tables in the dataset, in + * milliseconds. The minimum value is 3600000 milliseconds (one hour). Once + * this property is set, all newly-created tables in the dataset will have + * an expirationTime property set to the creation time plus the value in + * this property, and changing the value will only affect new tables, not + * existing ones. When the expirationTime for a given table is reached, that + * table will be deleted automatically. If a table's expirationTime is + * modified or removed before the table expires, or if you provide an + * explicit expirationTime when creating a table, that value takes + * precedence over the default expiration time indicated by this property. + */ + defaultTableExpirationMs: string; + /** + * [Optional] A user-friendly description of the dataset. + */ + description: string; + /** + * [Output-only] A hash of the resource. + */ + etag: string; + /** + * [Optional] A descriptive name for the dataset. + */ + friendlyName: string; + /** + * [Output-only] The fully-qualified unique name of the dataset in the + * format projectId:datasetId. The dataset name without the project name is + * given in the datasetId field. When creating a new dataset, leave this + * field blank, and instead specify the datasetId field. + */ + id: string; + /** + * [Output-only] The resource type. + */ + kind: string; + /** + * The labels associated with this dataset. You can use these to organize + * and group your datasets. You can set this property when inserting or + * updating a dataset. See Labeling Datasets for more information. + */ + labels: any; + /** + * [Output-only] The date when this dataset or any of its tables was last + * modified, in milliseconds since the epoch. + */ + lastModifiedTime: string; + /** + * The geographic location where the dataset should reside. The default + * value is US. + */ + location: string; + /** + * [Output-only] A URL that can be used to access the resource again. You + * can use this URL in Get or Update requests to the resource. + */ + selfLink: string; + } + export interface Schema$DatasetList { + /** + * An array of the dataset resources in the project. Each resource contains + * basic information. For full information about a particular dataset + * resource, use the Datasets: get method. This property is omitted when + * there are no datasets in the project. + */ + datasets: any[]; + /** + * A hash value of the results page. You can use this property to determine + * if the page has changed since the last request. + */ + etag: string; + /** + * The list type. This property always returns the value + * "bigquery#datasetList". + */ + kind: string; + /** + * A token that can be used to request the next results page. This property + * is omitted on the final results page. + */ + nextPageToken: string; + } + export interface Schema$DatasetReference { + /** + * [Required] A unique ID for this dataset, without the project name. The ID + * must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_). + * The maximum length is 1,024 characters. + */ + datasetId: string; + /** + * [Optional] The ID of the project containing this dataset. + */ + projectId: string; + } + export interface Schema$DestinationTableProperties { + /** + * [Optional] The description for the destination table. This will only be + * used if the destination table is newly created. If the table already + * exists and a value different than the current description is provided, + * the job will fail. + */ + description: string; + /** + * [Optional] The friendly name for the destination table. This will only be + * used if the destination table is newly created. If the table already + * exists and a value different than the current friendly name is provided, + * the job will fail. + */ + friendlyName: string; + } + export interface Schema$EncryptionConfiguration { + /** + * [Optional] Describes the Cloud KMS encryption key that will be used to + * protect destination BigQuery table. The BigQuery Service Account + * associated with your project requires access to this encryption key. + */ + kmsKeyName: string; + } + export interface Schema$ErrorProto { + /** + * Debugging information. This property is internal to Google and should not + * be used. + */ + debugInfo: string; + /** + * Specifies where the error occurred, if present. + */ + location: string; + /** + * A human-readable description of the error. + */ + message: string; + /** + * A short error code that summarizes the error. + */ + reason: string; + } + export interface Schema$ExplainQueryStage { + /** + * Number of parallel input segments completed. + */ + completedParallelInputs: string; + /** + * Milliseconds the average shard spent on CPU-bound tasks. + */ + computeMsAvg: string; + /** + * Milliseconds the slowest shard spent on CPU-bound tasks. + */ + computeMsMax: string; + /** + * Relative amount of time the average shard spent on CPU-bound tasks. + */ + computeRatioAvg: number; + /** + * Relative amount of time the slowest shard spent on CPU-bound tasks. + */ + computeRatioMax: number; + /** + * Stage end time in milliseconds. + */ + endMs: string; + /** + * Unique ID for stage within plan. + */ + id: string; + /** + * IDs for stages that are inputs to this stage. + */ + inputStages: string[]; + /** + * Human-readable name for stage. + */ + name: string; + /** + * Number of parallel input segments to be processed. + */ + parallelInputs: string; + /** + * Milliseconds the average shard spent reading input. + */ + readMsAvg: string; + /** + * Milliseconds the slowest shard spent reading input. + */ + readMsMax: string; + /** + * Relative amount of time the average shard spent reading input. + */ + readRatioAvg: number; + /** + * Relative amount of time the slowest shard spent reading input. + */ + readRatioMax: number; + /** + * Number of records read into the stage. + */ + recordsRead: string; + /** + * Number of records written by the stage. + */ + recordsWritten: string; + /** + * Total number of bytes written to shuffle. + */ + shuffleOutputBytes: string; + /** + * Total number of bytes written to shuffle and spilled to disk. + */ + shuffleOutputBytesSpilled: string; + /** + * Stage start time in milliseconds. + */ + startMs: string; + /** + * Current status for the stage. + */ + status: string; + /** + * List of operations within the stage in dependency order (approximately + * chronological). + */ + steps: Schema$ExplainQueryStep[]; + /** + * Milliseconds the average shard spent waiting to be scheduled. + */ + waitMsAvg: string; + /** + * Milliseconds the slowest shard spent waiting to be scheduled. + */ + waitMsMax: string; + /** + * Relative amount of time the average shard spent waiting to be scheduled. + */ + waitRatioAvg: number; + /** + * Relative amount of time the slowest shard spent waiting to be scheduled. + */ + waitRatioMax: number; + /** + * Milliseconds the average shard spent on writing output. + */ + writeMsAvg: string; + /** + * Milliseconds the slowest shard spent on writing output. + */ + writeMsMax: string; + /** + * Relative amount of time the average shard spent on writing output. + */ + writeRatioAvg: number; + /** + * Relative amount of time the slowest shard spent on writing output. + */ + writeRatioMax: number; + } + export interface Schema$ExplainQueryStep { + /** + * Machine-readable operation type. + */ + kind: string; + /** + * Human-readable stage descriptions. + */ + substeps: string[]; + } + export interface Schema$ExternalDataConfiguration { + /** + * Try to detect schema and format options automatically. Any option + * specified explicitly will be honored. + */ + autodetect: boolean; + /** + * [Optional] Additional options if sourceFormat is set to BIGTABLE. + */ + bigtableOptions: Schema$BigtableOptions; + /** + * [Optional] The compression type of the data source. Possible values + * include GZIP and NONE. The default value is NONE. This setting is ignored + * for Google Cloud Bigtable, Google Cloud Datastore backups and Avro + * formats. + */ + compression: string; + /** + * Additional properties to set if sourceFormat is set to CSV. + */ + csvOptions: Schema$CsvOptions; + /** + * [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS. + */ + googleSheetsOptions: Schema$GoogleSheetsOptions; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not + * represented in the table schema. If true, the extra values are ignored. + * If false, records with extra columns are treated as bad records, and if + * there are too many bad records, an invalid error is returned in the job + * result. The default value is false. The sourceFormat property determines + * what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named + * values that don't match any column names Google Cloud Bigtable: This + * setting is ignored. Google Cloud Datastore backups: This setting is + * ignored. Avro: This setting is ignored. + */ + ignoreUnknownValues: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore + * when reading data. If the number of bad records exceeds this value, an + * invalid error is returned in the job result. The default value is 0, + * which requires that all records are valid. This setting is ignored for + * Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats. + */ + maxBadRecords: number; + /** + * [Optional] The schema for the data. Schema is required for CSV and JSON + * formats. Schema is disallowed for Google Cloud Bigtable, Cloud Datastore + * backups, and Avro formats. + */ + schema: Schema$TableSchema; + /** + * [Required] The data format. For CSV files, specify "CSV". For + * Google sheets, specify "GOOGLE_SHEETS". For newline-delimited + * JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify + * "AVRO". For Google Cloud Datastore backups, specify + * "DATASTORE_BACKUP". [Beta] For Google Cloud Bigtable, specify + * "BIGTABLE". + */ + sourceFormat: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google + * Cloud. For Google Cloud Storage URIs: Each URI can contain one + * '*' wildcard character and it must come after the + * 'bucket' name. Size limits related to load jobs apply to external + * data sources. For Google Cloud Bigtable URIs: Exactly one URI can be + * specified and it has be a fully specified and valid HTTPS URL for a + * Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly + * one URI can be specified. Also, the '*' wildcard character is not + * allowed. + */ + sourceUris: string[]; + } + export interface Schema$GetQueryResultsResponse { + /** + * Whether the query result was fetched from the query cache. + */ + cacheHit: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running + * of the job. The final message includes the number of errors that caused + * the process to stop. Errors here do not necessarily mean that the job has + * completed or was unsuccessful. + */ + errors: Schema$ErrorProto[]; + /** + * A hash of this response. + */ + etag: string; + /** + * Whether the query has completed or not. If rows or totalRows are present, + * this will always be true. If this is false, totalRows will not be + * available. + */ + jobComplete: boolean; + /** + * Reference to the BigQuery Job that was created to run the query. This + * field will be present even if the original request timed out, in which + * case GetQueryResults can be used to read the results once the query has + * completed. Since this API only returns the first page of results, + * subsequent pages can be fetched via the same mechanism (GetQueryResults). + */ + jobReference: Schema$JobReference; + /** + * The resource type of the response. + */ + kind: string; + /** + * [Output-only] The number of rows affected by a DML statement. Present + * only for DML statements INSERT, UPDATE or DELETE. + */ + numDmlAffectedRows: string; + /** + * A token used for paging results. + */ + pageToken: string; + /** + * An object with as many results as can be contained within the maximum + * permitted reply size. To get any additional rows, you can call + * GetQueryResults and specify the jobReference returned above. Present only + * when the query completes successfully. + */ + rows: Schema$TableRow[]; + /** + * The schema of the results. Present only when the query completes + * successfully. + */ + schema: Schema$TableSchema; + /** + * The total number of bytes processed for this query. + */ + totalBytesProcessed: string; + /** + * The total number of rows in the complete query result set, which can be + * more than the number of rows in this single page of results. Present only + * when the query completes successfully. + */ + totalRows: string; + } + export interface Schema$GetServiceAccountResponse { + /** + * The service account email address. + */ + email: string; + /** + * The resource type of the response. + */ + kind: string; + } + export interface Schema$GoogleSheetsOptions { + /** + * [Experimental] [Optional] Range of a sheet to query from. Only used when + * non-empty. Typical format: !: + */ + range: string; + /** + * [Optional] The number of rows at the top of a sheet that BigQuery will + * skip when reading the data. The default value is 0. This property is + * useful if you have header rows that should be skipped. When autodetect is + * on, behavior is the following: * skipLeadingRows unspecified - Autodetect + * tries to detect headers in the first row. If they are not detected, the + * row is read as data. Otherwise data is read starting from the second row. + * * skipLeadingRows is 0 - Instructs autodetect that there are no headers + * and data should be read starting from the first row. * skipLeadingRows = + * N > 0 - Autodetect skips N-1 rows and tries to detect headers in row + * N. If headers are not detected, row N is just skipped. Otherwise row N is + * used to extract column names for the detected schema. + */ + skipLeadingRows: string; + } + export interface Schema$Job { + /** + * [Required] Describes the job configuration. + */ + configuration: Schema$JobConfiguration; + /** + * [Output-only] A hash of this resource. + */ + etag: string; + /** + * [Output-only] Opaque ID field of the job + */ + id: string; + /** + * [Optional] Reference describing the unique-per-user name of the job. + */ + jobReference: Schema$JobReference; + /** + * [Output-only] The type of the resource. + */ + kind: string; + /** + * [Output-only] A URL that can be used to access this resource again. + */ + selfLink: string; + /** + * [Output-only] Information about the job, including starting time and + * ending time of the job. + */ + statistics: Schema$JobStatistics; + /** + * [Output-only] The status of this job. Examine this value when polling an + * asynchronous job to see if the job is complete. + */ + status: Schema$JobStatus; + /** + * [Output-only] Email address of the user who ran the job. + */ + user_email: string; + } + export interface Schema$JobCancelResponse { + /** + * The final state of the job. + */ + job: Schema$Job; + /** + * The resource type of the response. + */ + kind: string; + } + export interface Schema$JobConfiguration { + /** + * [Pick one] Copies a table. + */ + copy: Schema$JobConfigurationTableCopy; + /** + * [Optional] If set, don't actually run this job. A valid query will + * return a mostly empty response with some processing statistics, while an + * invalid query will return the same error it would if it wasn't a dry + * run. Behavior of non-query jobs is undefined. + */ + dryRun: boolean; + /** + * [Pick one] Configures an extract job. + */ + extract: Schema$JobConfigurationExtract; + /** + * [Optional] Job timeout in milliseconds. If this time limit is exceeded, + * BigQuery may attempt to terminate the job. + */ + jobTimeoutMs: string; + /** + * The labels associated with this job. You can use these to organize and + * group your jobs. Label keys and values can be no longer than 63 + * characters, can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label + * values are optional. Label keys must start with a letter and each label + * in the list must have a different key. + */ + labels: any; + /** + * [Pick one] Configures a load job. + */ + load: Schema$JobConfigurationLoad; + /** + * [Pick one] Configures a query job. + */ + query: Schema$JobConfigurationQuery; + } + export interface Schema$JobConfigurationExtract { + /** + * [Optional] The compression type to use for exported files. Possible + * values include GZIP, DEFLATE, SNAPPY, and NONE. The default value is + * NONE. DEFLATE and SNAPPY are only supported for Avro. + */ + compression: string; + /** + * [Optional] The exported file format. Possible values include CSV, + * NEWLINE_DELIMITED_JSON and AVRO. The default value is CSV. Tables with + * nested or repeated fields cannot be exported as CSV. + */ + destinationFormat: string; + /** + * [Pick one] DEPRECATED: Use destinationUris instead, passing only one URI + * as necessary. The fully-qualified Google Cloud Storage URI where the + * extracted table should be written. + */ + destinationUri: string; + /** + * [Pick one] A list of fully-qualified Google Cloud Storage URIs where the + * extracted table should be written. + */ + destinationUris: string[]; + /** + * [Optional] Delimiter to use between fields in the exported data. Default + * is ',' + */ + fieldDelimiter: string; + /** + * [Optional] Whether to print out a header row in the results. Default is + * true. + */ + printHeader: boolean; + /** + * [Required] A reference to the table being exported. + */ + sourceTable: Schema$TableReference; + } + export interface Schema$JobConfigurationLoad { + /** + * [Optional] Accept rows that are missing trailing optional columns. The + * missing values are treated as nulls. If false, records with missing + * trailing columns are treated as bad records, and if there are too many + * bad records, an invalid error is returned in the job result. The default + * value is false. Only applicable to CSV, ignored for other formats. + */ + allowJaggedRows: boolean; + /** + * Indicates if BigQuery should allow quoted data sections that contain + * newline characters in a CSV file. The default value is false. + */ + allowQuotedNewlines: boolean; + /** + * [Optional] Indicates if we should automatically infer the options and + * schema for CSV and JSON sources. + */ + autodetect: boolean; + /** + * [Experimental] Clustering specification for the destination table. Must + * be specified with time-based partitioning, data in the table will be + * first partitioned and subsequently clustered. + */ + clustering: Schema$Clustering; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The + * following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already + * exist. If it does not, a 'notFound' error is returned in the job + * result. The default value is CREATE_IF_NEEDED. Creation, truncation and + * append actions occur as one atomic update upon job completion. + */ + createDisposition: string; + /** + * Custom encryption configuration (e.g., Cloud KMS keys). + */ + destinationEncryptionConfiguration: Schema$EncryptionConfiguration; + /** + * [Required] The destination table to load the data into. + */ + destinationTable: Schema$TableReference; + /** + * [Experimental] [Optional] Properties with which to create the destination + * table if it is new. + */ + destinationTableProperties: Schema$DestinationTableProperties; + /** + * [Optional] The character encoding of the data. The supported values are + * UTF-8 or ISO-8859-1. The default value is UTF-8. BigQuery decodes the + * data after the raw, binary data has been split using the values of the + * quote and fieldDelimiter properties. + */ + encoding: string; + /** + * [Optional] The separator for fields in a CSV file. The separator can be + * any ISO-8859-1 single-byte character. To use a character in the range + * 128-255, you must encode the character as UTF8. BigQuery converts the + * string to ISO-8859-1 encoding, and then uses the first byte of the + * encoded string to split the data in its raw, binary state. BigQuery also + * supports the escape sequence "\t" to specify a tab separator. + * The default value is a comma (','). + */ + fieldDelimiter: string; + /** + * [Optional] Indicates if BigQuery should allow extra values that are not + * represented in the table schema. If true, the extra values are ignored. + * If false, records with extra columns are treated as bad records, and if + * there are too many bad records, an invalid error is returned in the job + * result. The default value is false. The sourceFormat property determines + * what BigQuery treats as an extra value: CSV: Trailing columns JSON: Named + * values that don't match any column names + */ + ignoreUnknownValues: boolean; + /** + * [Optional] The maximum number of bad records that BigQuery can ignore + * when running the job. If the number of bad records exceeds this value, an + * invalid error is returned in the job result. The default value is 0, + * which requires that all records are valid. + */ + maxBadRecords: number; + /** + * [Optional] Specifies a string that represents a null value in a CSV file. + * For example, if you specify "x/", BigQuery interprets + * "x/" as a null value when loading a CSV file. The default value + * is the empty string. If you set this property to a custom value, BigQuery + * throws an error if an empty string is present for all data types except + * for STRING and BYTE. For STRING and BYTE columns, BigQuery interprets the + * empty string as an empty value. + */ + nullMarker: string; + /** + * If sourceFormat is set to "DATASTORE_BACKUP", indicates which + * entity properties to load into BigQuery from a Cloud Datastore backup. + * Property names are case sensitive and must be top-level properties. If no + * properties are specified, BigQuery loads all properties. If any named + * property isn't found in the Cloud Datastore backup, an invalid error + * is returned in the job result. + */ + projectionFields: string[]; + /** + * [Optional] The value that is used to quote data sections in a CSV file. + * BigQuery converts the string to ISO-8859-1 encoding, and then uses the + * first byte of the encoded string to split the data in its raw, binary + * state. The default value is a double-quote ('"'). If your + * data does not contain quoted sections, set the property value to an empty + * string. If your data contains quoted newline characters, you must also + * set the allowQuotedNewlines property to true. + */ + quote: string; + /** + * [Optional] The schema for the destination table. The schema can be + * omitted if the destination table already exists, or if you're loading + * data from Google Cloud Datastore. + */ + schema: Schema$TableSchema; + /** + * [Deprecated] The inline schema. For CSV schemas, specify as + * "Field1:Type1[,Field2:Type2]*". For example, "foo:STRING, + * bar:INTEGER, baz:FLOAT". + */ + schemaInline: string; + /** + * [Deprecated] The format of the schemaInline property. + */ + schemaInlineFormat: string; + /** + * Allows the schema of the destination table to be updated as a side effect + * of the load job if a schema is autodetected or supplied in the job + * configuration. Schema update options are supported in two cases: when + * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE + * and the destination table is a partition of a table, specified by + * partition decorators. For normal tables, WRITE_TRUNCATE will always + * overwrite the schema. One or more of the following values are specified: + * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. + * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original + * schema to nullable. + */ + schemaUpdateOptions: string[]; + /** + * [Optional] The number of rows at the top of a CSV file that BigQuery will + * skip when loading the data. The default value is 0. This property is + * useful if you have header rows in the file that should be skipped. + */ + skipLeadingRows: number; + /** + * [Optional] The format of the data files. For CSV files, specify + * "CSV". For datastore backups, specify + * "DATASTORE_BACKUP". For newline-delimited JSON, specify + * "NEWLINE_DELIMITED_JSON". For Avro, specify "AVRO". + * For parquet, specify "PARQUET". For orc, specify + * "ORC". The default value is CSV. + */ + sourceFormat: string; + /** + * [Required] The fully-qualified URIs that point to your data in Google + * Cloud. For Google Cloud Storage URIs: Each URI can contain one + * '*' wildcard character and it must come after the + * 'bucket' name. Size limits related to load jobs apply to external + * data sources. For Google Cloud Bigtable URIs: Exactly one URI can be + * specified and it has be a fully specified and valid HTTPS URL for a + * Google Cloud Bigtable table. For Google Cloud Datastore backups: Exactly + * one URI can be specified. Also, the '*' wildcard character is not + * allowed. + */ + sourceUris: string[]; + /** + * Time-based partitioning specification for the destination table. + */ + timePartitioning: Schema$TimePartitioning; + /** + * [Optional] Specifies the action that occurs if the destination table + * already exists. The following values are supported: WRITE_TRUNCATE: If + * the table already exists, BigQuery overwrites the table data. + * WRITE_APPEND: If the table already exists, BigQuery appends the data to + * the table. WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. The default + * value is WRITE_APPEND. Each action is atomic and only occurs if BigQuery + * is able to complete the job successfully. Creation, truncation and append + * actions occur as one atomic update upon job completion. + */ + writeDisposition: string; + } + export interface Schema$JobConfigurationQuery { + /** + * [Optional] If true and query uses legacy SQL dialect, allows the query to + * produce arbitrarily large result tables at a slight cost in performance. + * Requires destinationTable to be set. For standard SQL queries, this flag + * is ignored and large results are always allowed. However, you must still + * set destinationTable when result size exceeds the allowed maximum + * response size. + */ + allowLargeResults: boolean; + /** + * [Experimental] Clustering specification for the destination table. Must + * be specified with time-based partitioning, data in the table will be + * first partitioned and subsequently clustered. + */ + clustering: Schema$Clustering; + /** + * [Optional] Specifies whether the job is allowed to create new tables. The + * following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already + * exist. If it does not, a 'notFound' error is returned in the job + * result. The default value is CREATE_IF_NEEDED. Creation, truncation and + * append actions occur as one atomic update upon job completion. + */ + createDisposition: string; + /** + * [Optional] Specifies the default dataset to use for unqualified table + * names in the query. + */ + defaultDataset: Schema$DatasetReference; + /** + * Custom encryption configuration (e.g., Cloud KMS keys). + */ + destinationEncryptionConfiguration: Schema$EncryptionConfiguration; + /** + * [Optional] Describes the table where the query results should be stored. + * If not present, a new table will be created to store the results. This + * property must be set for large results that exceed the maximum response + * size. + */ + destinationTable: Schema$TableReference; + /** + * [Optional] If true and query uses legacy SQL dialect, flattens all nested + * and repeated fields in the query results. allowLargeResults must be true + * if this is set to false. For standard SQL queries, this flag is ignored + * and results are never flattened. + */ + flattenResults: boolean; + /** + * [Optional] Limits the billing tier for this job. Queries that have + * resource usage beyond this tier will fail (without incurring a charge). + * If unspecified, this will be set to your project default. + */ + maximumBillingTier: number; + /** + * [Optional] Limits the bytes billed for this job. Queries that will have + * bytes billed beyond this limit will fail (without incurring a charge). If + * unspecified, this will be set to your project default. + */ + maximumBytesBilled: string; + /** + * Standard SQL only. Set to POSITIONAL to use positional (?) query + * parameters or to NAMED to use named (@myparam) query parameters in this + * query. + */ + parameterMode: string; + /** + * [Deprecated] This property is deprecated. + */ + preserveNulls: boolean; + /** + * [Optional] Specifies a priority for the query. Possible values include + * INTERACTIVE and BATCH. The default value is INTERACTIVE. + */ + priority: string; + /** + * [Required] SQL query text to execute. The useLegacySql field can be used + * to indicate whether the query uses legacy SQL or standard SQL. + */ + query: string; + /** + * Query parameters for standard SQL queries. + */ + queryParameters: Schema$QueryParameter[]; + /** + * Allows the schema of the destination table to be updated as a side effect + * of the query job. Schema update options are supported in two cases: when + * writeDisposition is WRITE_APPEND; when writeDisposition is WRITE_TRUNCATE + * and the destination table is a partition of a table, specified by + * partition decorators. For normal tables, WRITE_TRUNCATE will always + * overwrite the schema. One or more of the following values are specified: + * ALLOW_FIELD_ADDITION: allow adding a nullable field to the schema. + * ALLOW_FIELD_RELAXATION: allow relaxing a required field in the original + * schema to nullable. + */ + schemaUpdateOptions: string[]; + /** + * [Optional] If querying an external data source outside of BigQuery, + * describes the data format, location and other properties of the data + * source. By defining these properties, the data source can then be queried + * as if it were a standard BigQuery table. + */ + tableDefinitions: any; + /** + * Time-based partitioning specification for the destination table. + */ + timePartitioning: Schema$TimePartitioning; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this + * query. The default value is true. If set to false, the query will use + * BigQuery's standard SQL: + * https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set + * to false, the value of flattenResults is ignored; query will be run as if + * flattenResults is false. + */ + useLegacySql: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query + * cache is a best-effort cache that will be flushed whenever tables in the + * query are modified. Moreover, the query cache is only available when a + * query does not have a destination table specified. The default value is + * true. + */ + useQueryCache: boolean; + /** + * Describes user-defined function resources used in the query. + */ + userDefinedFunctionResources: Schema$UserDefinedFunctionResource[]; + /** + * [Optional] Specifies the action that occurs if the destination table + * already exists. The following values are supported: WRITE_TRUNCATE: If + * the table already exists, BigQuery overwrites the table data and uses the + * schema from the query result. WRITE_APPEND: If the table already exists, + * BigQuery appends the data to the table. WRITE_EMPTY: If the table already + * exists and contains data, a 'duplicate' error is returned in the + * job result. The default value is WRITE_EMPTY. Each action is atomic and + * only occurs if BigQuery is able to complete the job successfully. + * Creation, truncation and append actions occur as one atomic update upon + * job completion. + */ + writeDisposition: string; + } + export interface Schema$JobConfigurationTableCopy { + /** + * [Optional] Specifies whether the job is allowed to create new tables. The + * following values are supported: CREATE_IF_NEEDED: If the table does not + * exist, BigQuery creates the table. CREATE_NEVER: The table must already + * exist. If it does not, a 'notFound' error is returned in the job + * result. The default value is CREATE_IF_NEEDED. Creation, truncation and + * append actions occur as one atomic update upon job completion. + */ + createDisposition: string; + /** + * Custom encryption configuration (e.g., Cloud KMS keys). + */ + destinationEncryptionConfiguration: Schema$EncryptionConfiguration; + /** + * [Required] The destination table + */ + destinationTable: Schema$TableReference; + /** + * [Pick one] Source table to copy. + */ + sourceTable: Schema$TableReference; + /** + * [Pick one] Source tables to copy. + */ + sourceTables: Schema$TableReference[]; + /** + * [Optional] Specifies the action that occurs if the destination table + * already exists. The following values are supported: WRITE_TRUNCATE: If + * the table already exists, BigQuery overwrites the table data. + * WRITE_APPEND: If the table already exists, BigQuery appends the data to + * the table. WRITE_EMPTY: If the table already exists and contains data, a + * 'duplicate' error is returned in the job result. The default + * value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery + * is able to complete the job successfully. Creation, truncation and append + * actions occur as one atomic update upon job completion. + */ + writeDisposition: string; + } + export interface Schema$JobList { + /** + * A hash of this page of results. + */ + etag: string; + /** + * List of jobs that were requested. + */ + jobs: any[]; + /** + * The resource type of the response. + */ + kind: string; + /** + * A token to request the next page of results. + */ + nextPageToken: string; + } + export interface Schema$JobReference { + /** + * [Required] The ID of the job. The ID must contain only letters (a-z, + * A-Z), numbers (0-9), underscores (_), or dashes (-). The maximum length + * is 1,024 characters. + */ + jobId: string; + /** + * [Experimental] The geographic location of the job. Required except for US + * and EU. + */ + location: string; + /** + * [Required] The ID of the project containing this job. + */ + projectId: string; + } + export interface Schema$JobStatistics { + /** + * [Experimental] [Output-only] Job progress (0.0 -> 1.0) for LOAD and + * EXTRACT jobs. + */ + completionRatio: number; + /** + * [Output-only] Creation time of this job, in milliseconds since the epoch. + * This field will be present on all jobs. + */ + creationTime: string; + /** + * [Output-only] End time of this job, in milliseconds since the epoch. This + * field will be present whenever a job is in the DONE state. + */ + endTime: string; + /** + * [Output-only] Statistics for an extract job. + */ + extract: Schema$JobStatistics4; + /** + * [Output-only] Statistics for a load job. + */ + load: Schema$JobStatistics3; + /** + * [Output-only] Statistics for a query job. + */ + query: Schema$JobStatistics2; + /** + * [Output-only] Start time of this job, in milliseconds since the epoch. + * This field will be present when the job transitions from the PENDING + * state to either RUNNING or DONE. + */ + startTime: string; + /** + * [Output-only] [Deprecated] Use the bytes processed in the query + * statistics instead. + */ + totalBytesProcessed: string; + } + export interface Schema$JobStatistics2 { + /** + * [Output-only] Billing tier for the job. + */ + billingTier: number; + /** + * [Output-only] Whether the query result was fetched from the query cache. + */ + cacheHit: boolean; + /** + * [Output-only, Experimental] The DDL operation performed, possibly + * dependent on the pre-existence of the DDL target. Possible values (new + * values might be added in the future): "CREATE": The query + * created the DDL target. "SKIP": No-op. Example cases: the query + * is CREATE TABLE IF NOT EXISTS while the table already exists, or the + * query is DROP TABLE IF EXISTS while the table does not exist. + * "REPLACE": The query replaced the DDL target. Example case: the + * query is CREATE OR REPLACE TABLE, and the table already exists. + * "DROP": The query deleted the DDL target. + */ + ddlOperationPerformed: string; + /** + * [Output-only, Experimental] The DDL target table. Present only for + * CREATE/DROP TABLE/VIEW queries. + */ + ddlTargetTable: Schema$TableReference; + /** + * [Output-only] The original estimate of bytes processed for the job. + */ + estimatedBytesProcessed: string; + /** + * [Output-only] The number of rows affected by a DML statement. Present + * only for DML statements INSERT, UPDATE or DELETE. + */ + numDmlAffectedRows: string; + /** + * [Output-only] Describes execution plan for the query. + */ + queryPlan: Schema$ExplainQueryStage[]; + /** + * [Output-only] Referenced tables for the job. Queries that reference more + * than 50 tables will not have a complete list. + */ + referencedTables: Schema$TableReference[]; + /** + * [Output-only] The schema of the results. Present only for successful dry + * run of non-legacy SQL queries. + */ + schema: Schema$TableSchema; + /** + * [Output-only, Experimental] The type of query statement, if valid. + * Possible values (new values might be added in the future): + * "SELECT": SELECT query. "INSERT": INSERT query; see + * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language + * "UPDATE": UPDATE query; see + * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language + * "DELETE": DELETE query; see + * https://cloud.google.com/bigquery/docs/reference/standard-sql/data-manipulation-language + * "CREATE_TABLE": CREATE [OR REPLACE] TABLE without AS SELECT. + * "CREATE_TABLE_AS_SELECT": CREATE [OR REPLACE] TABLE ... AS + * SELECT ... "DROP_TABLE": DROP TABLE query. + * "CREATE_VIEW": CREATE [OR REPLACE] VIEW ... AS SELECT ... + * "DROP_VIEW": DROP VIEW query. + */ + statementType: string; + /** + * [Output-only] [Experimental] Describes a timeline of job execution. + */ + timeline: Schema$QueryTimelineSample[]; + /** + * [Output-only] Total bytes billed for the job. + */ + totalBytesBilled: string; + /** + * [Output-only] Total bytes processed for the job. + */ + totalBytesProcessed: string; + /** + * [Output-only] Total number of partitions processed from all partitioned + * tables referenced in the job. + */ + totalPartitionsProcessed: string; + /** + * [Output-only] Slot-milliseconds for the job. + */ + totalSlotMs: string; + /** + * [Output-only, Experimental] Standard SQL only: list of undeclared query + * parameters detected during a dry run validation. + */ + undeclaredQueryParameters: Schema$QueryParameter[]; + } + export interface Schema$JobStatistics3 { + /** + * [Output-only] The number of bad records encountered. Note that if the job + * has failed because of more bad records encountered than the maximum + * allowed in the load job configuration, then this number can be less than + * the total number of bad records present in the input data. + */ + badRecords: string; + /** + * [Output-only] Number of bytes of source data in a load job. + */ + inputFileBytes: string; + /** + * [Output-only] Number of source files in a load job. + */ + inputFiles: string; + /** + * [Output-only] Size of the loaded data in bytes. Note that while a load + * job is in the running state, this value may change. + */ + outputBytes: string; + /** + * [Output-only] Number of rows imported in a load job. Note that while an + * import job is in the running state, this value may change. + */ + outputRows: string; + } + export interface Schema$JobStatistics4 { + /** + * [Output-only] Number of files per destination URI or URI pattern + * specified in the extract configuration. These values will be in the same + * order as the URIs specified in the 'destinationUris' field. + */ + destinationUriFileCounts: string[]; + } + export interface Schema$JobStatus { + /** + * [Output-only] Final error result of the job. If present, indicates that + * the job has completed and was unsuccessful. + */ + errorResult: Schema$ErrorProto; + /** + * [Output-only] The first errors encountered during the running of the job. + * The final message includes the number of errors that caused the process + * to stop. Errors here do not necessarily mean that the job has completed + * or was unsuccessful. + */ + errors: Schema$ErrorProto[]; + /** + * [Output-only] Running state of the job. + */ + state: string; } - - /** - * bigquery.jobs.cancel - * @desc Requests that a job be cancelled. This call will return immediately, - * and the client will need to poll for the job status to see if the cancel - * completed successfully. Cancelled jobs may still incur costs. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the job to cancel - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // [Required] Job ID of the job to cancel - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.jobs.cancel(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId [Required] Job ID of the job to cancel - * @param {string=} params.location [Experimental] The geographic location of the job. Required except for US and EU. - * @param {string} params.projectId [Required] Project ID of the job to cancel - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/bigquery/v2/projects/{projectId}/jobs/{jobId}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a single JSON object. + */ + export interface Schema$JsonObject {} + export interface Schema$JsonValue {} + export interface Schema$ProjectList { + /** + * A hash of the page of results + */ + etag: string; + /** + * The type of list. + */ + kind: string; + /** + * A token to request the next page of results. + */ + nextPageToken: string; + /** + * Projects to which you have at least READ access. + */ + projects: any[]; + /** + * The total number of projects in the list. + */ + totalItems: number; + } + export interface Schema$ProjectReference { + /** + * [Required] ID of the project. Can be either the numeric ID or the + * assigned ID of the project. + */ + projectId: string; + } + export interface Schema$QueryParameter { + /** + * [Optional] If unset, this is a positional parameter. Otherwise, should be + * unique within a query. + */ + name: string; + /** + * [Required] The type of this parameter. + */ + parameterType: Schema$QueryParameterType; + /** + * [Required] The value of this parameter. + */ + parameterValue: Schema$QueryParameterValue; + } + export interface Schema$QueryParameterType { + /** + * [Optional] The type of the array's elements, if this is an array. + */ + arrayType: Schema$QueryParameterType; + /** + * [Optional] The types of the fields of this struct, in order, if this is a + * struct. + */ + structTypes: any[]; + /** + * [Required] The top level type of this field. + */ + type: string; + } + export interface Schema$QueryParameterValue { + /** + * [Optional] The array values, if this is an array type. + */ + arrayValues: Schema$QueryParameterValue[]; + /** + * [Optional] The struct field values, in order of the struct type's + * declaration. + */ + structValues: any; + /** + * [Optional] The value of this value, if a simple scalar type. + */ + value: string; + } + export interface Schema$QueryRequest { + /** + * [Optional] Specifies the default datasetId and projectId to assume for + * any unqualified table names in the query. If not set, all table names in + * the query string must be qualified in the format + * 'datasetId.tableId'. + */ + defaultDataset: Schema$DatasetReference; + /** + * [Optional] If set to true, BigQuery doesn't run the job. Instead, if + * the query is valid, BigQuery returns statistics about the job such as how + * many bytes would be processed. If the query is invalid, an error returns. + * The default value is false. + */ + dryRun: boolean; + /** + * The resource type of the request. + */ + kind: string; + /** + * [Experimental] The geographic location where the job should run. Required + * except for US and EU. + */ + location: string; + /** + * [Optional] The maximum number of rows of data to return per page of + * results. Setting this flag to a small value such as 1000 and then paging + * through results might improve reliability when the query result set is + * large. In addition to this limit, responses are also limited to 10 MB. By + * default, there is no maximum row count, and only the byte limit applies. + */ + maxResults: number; + /** + * Standard SQL only. Set to POSITIONAL to use positional (?) query + * parameters or to NAMED to use named (@myparam) query parameters in this + * query. + */ + parameterMode: string; + /** + * [Deprecated] This property is deprecated. + */ + preserveNulls: boolean; + /** + * [Required] A query string, following the BigQuery query syntax, of the + * query to execute. Example: "SELECT count(f1) FROM + * [myProjectId:myDatasetId.myTableId]". + */ + query: string; + /** + * Query parameters for Standard SQL queries. + */ + queryParameters: Schema$QueryParameter[]; + /** + * [Optional] How long to wait for the query to complete, in milliseconds, + * before the request times out and returns. Note that this is only a + * timeout for the request, not the query. If the query takes longer to run + * than the timeout value, the call returns without any results and with the + * 'jobComplete' flag set to false. You can call GetQueryResults() + * to wait for the query to complete and read the results. The default value + * is 10000 milliseconds (10 seconds). + */ + timeoutMs: number; + /** + * Specifies whether to use BigQuery's legacy SQL dialect for this + * query. The default value is true. If set to false, the query will use + * BigQuery's standard SQL: + * https://cloud.google.com/bigquery/sql-reference/ When useLegacySql is set + * to false, the value of flattenResults is ignored; query will be run as if + * flattenResults is false. + */ + useLegacySql: boolean; + /** + * [Optional] Whether to look for the result in the query cache. The query + * cache is a best-effort cache that will be flushed whenever tables in the + * query are modified. The default value is true. + */ + useQueryCache: boolean; + } + export interface Schema$QueryResponse { + /** + * Whether the query result was fetched from the query cache. + */ + cacheHit: boolean; + /** + * [Output-only] The first errors or warnings encountered during the running + * of the job. The final message includes the number of errors that caused + * the process to stop. Errors here do not necessarily mean that the job has + * completed or was unsuccessful. + */ + errors: Schema$ErrorProto[]; + /** + * Whether the query has completed or not. If rows or totalRows are present, + * this will always be true. If this is false, totalRows will not be + * available. + */ + jobComplete: boolean; + /** + * Reference to the Job that was created to run the query. This field will + * be present even if the original request timed out, in which case + * GetQueryResults can be used to read the results once the query has + * completed. Since this API only returns the first page of results, + * subsequent pages can be fetched via the same mechanism (GetQueryResults). + */ + jobReference: Schema$JobReference; + /** + * The resource type. + */ + kind: string; + /** + * [Output-only] The number of rows affected by a DML statement. Present + * only for DML statements INSERT, UPDATE or DELETE. + */ + numDmlAffectedRows: string; + /** + * A token used for paging results. + */ + pageToken: string; + /** + * An object with as many results as can be contained within the maximum + * permitted reply size. To get any additional rows, you can call + * GetQueryResults and specify the jobReference returned above. + */ + rows: Schema$TableRow[]; + /** + * The schema of the results. Present only when the query completes + * successfully. + */ + schema: Schema$TableSchema; + /** + * The total number of bytes processed for this query. If this query was a + * dry run, this is the number of bytes that would be processed if the query + * were run. + */ + totalBytesProcessed: string; + /** + * The total number of rows in the complete query result set, which can be + * more than the number of rows in this single page of results. + */ + totalRows: string; + } + export interface Schema$QueryTimelineSample { + /** + * Total number of units currently being processed by workers. This does not + * correspond directly to slot usage. This is the largest value observed + * since the last sample. + */ + activeUnits: string; + /** + * Total parallel units of work completed by this query. + */ + completedUnits: string; + /** + * Milliseconds elapsed since the start of query execution. + */ + elapsedMs: string; + /** + * Total parallel units of work remaining for the active stages. + */ + pendingUnits: string; + /** + * Cumulative slot-ms consumed by the query. + */ + totalSlotMs: string; + } + export interface Schema$Streamingbuffer { + /** + * [Output-only] A lower-bound estimate of the number of bytes currently in + * the streaming buffer. + */ + estimatedBytes: string; + /** + * [Output-only] A lower-bound estimate of the number of rows currently in + * the streaming buffer. + */ + estimatedRows: string; + /** + * [Output-only] Contains the timestamp of the oldest entry in the streaming + * buffer, in milliseconds since the epoch, if the streaming buffer is + * available. + */ + oldestEntryTime: string; + } + export interface Schema$Table { + /** + * [Experimental] Clustering specification for the table. Must be specified + * with time-based partitioning, data in the table will be first partitioned + * and subsequently clustered. + */ + clustering: Schema$Clustering; + /** + * [Output-only] The time when this table was created, in milliseconds since + * the epoch. + */ + creationTime: string; + /** + * [Optional] A user-friendly description of this table. + */ + description: string; + /** + * Custom encryption configuration (e.g., Cloud KMS keys). + */ + encryptionConfiguration: Schema$EncryptionConfiguration; + /** + * [Output-only] A hash of this resource. + */ + etag: string; + /** + * [Optional] The time when this table expires, in milliseconds since the + * epoch. If not present, the table will persist indefinitely. Expired + * tables will be deleted and their storage reclaimed. The + * defaultTableExpirationMs property of the encapsulating dataset can be + * used to set a default expirationTime on newly created tables. + */ + expirationTime: string; + /** + * [Optional] Describes the data format, location, and other properties of a + * table stored outside of BigQuery. By defining these properties, the data + * source can then be queried as if it were a standard BigQuery table. + */ + externalDataConfiguration: Schema$ExternalDataConfiguration; + /** + * [Optional] A descriptive name for this table. + */ + friendlyName: string; + /** + * [Output-only] An opaque ID uniquely identifying the table. + */ + id: string; + /** + * [Output-only] The type of the resource. + */ + kind: string; + /** + * The labels associated with this table. You can use these to organize and + * group your tables. Label keys and values can be no longer than 63 + * characters, can only contain lowercase letters, numeric characters, + * underscores and dashes. International characters are allowed. Label + * values are optional. Label keys must start with a letter and each label + * in the list must have a different key. + */ + labels: any; + /** + * [Output-only] The time when this table was last modified, in milliseconds + * since the epoch. + */ + lastModifiedTime: string; + /** + * [Output-only] The geographic location where the table resides. This value + * is inherited from the dataset. + */ + location: string; + /** + * [Output-only] The size of this table in bytes, excluding any data in the + * streaming buffer. + */ + numBytes: string; + /** + * [Output-only] The number of bytes in the table that are considered + * "long-term storage". + */ + numLongTermBytes: string; + /** + * [Output-only] The number of rows of data in this table, excluding any + * data in the streaming buffer. + */ + numRows: string; + /** + * [Optional] Describes the schema of this table. + */ + schema: Schema$TableSchema; + /** + * [Output-only] A URL that can be used to access this resource again. + */ + selfLink: string; + /** + * [Output-only] Contains information regarding this table's streaming + * buffer, if one is present. This field will be absent if the table is not + * being streamed to or if there is no data in the streaming buffer. + */ + streamingBuffer: Schema$Streamingbuffer; + /** + * [Required] Reference describing the ID of this table. + */ + tableReference: Schema$TableReference; + /** + * Time-based partitioning specification for this table. + */ + timePartitioning: Schema$TimePartitioning; + /** + * [Output-only] Describes the table type. The following values are + * supported: TABLE: A normal BigQuery table. VIEW: A virtual table defined + * by a SQL query. EXTERNAL: A table that references data stored in an + * external storage system, such as Google Cloud Storage. The default value + * is TABLE. + */ + type: string; + /** + * [Optional] The view definition. + */ + view: Schema$ViewDefinition; + } + export interface Schema$TableCell { v: any; } + export interface Schema$TableDataInsertAllRequest { + /** + * [Optional] Accept rows that contain values that do not match the schema. + * The unknown values are ignored. Default is false, which treats unknown + * values as errors. + */ + ignoreUnknownValues: boolean; + /** + * The resource type of the response. + */ + kind: string; + /** + * The rows to insert. + */ + rows: any[]; + /** + * [Optional] Insert all valid rows of a request, even if invalid rows + * exist. The default value is false, which causes the entire request to + * fail if any invalid rows exist. + */ + skipInvalidRows: boolean; + /** + * [Experimental] If specified, treats the destination table as a base + * template, and inserts the rows into an instance table named + * "{destination}{templateSuffix}". BigQuery will manage creation + * of the instance table, using the schema of the base template table. See + * https://cloud.google.com/bigquery/streaming-data-into-bigquery#template-tables + * for considerations when working with templates tables. + */ + templateSuffix: string; + } + export interface Schema$TableDataInsertAllResponse { + /** + * An array of errors for rows that were not inserted. + */ + insertErrors: any[]; + /** + * The resource type of the response. + */ + kind: string; + } + export interface Schema$TableDataList { + /** + * A hash of this page of results. + */ + etag: string; + /** + * The resource type of the response. + */ + kind: string; + /** + * A token used for paging results. Providing this token instead of the + * startIndex parameter can help you retrieve stable results when an + * underlying table is changing. + */ + pageToken: string; + /** + * Rows of results. + */ + rows: Schema$TableRow[]; + /** + * The total number of rows in the complete table. + */ + totalRows: string; + } + export interface Schema$TableFieldSchema { + /** + * [Optional] The field description. The maximum length is 1,024 characters. + */ + description: string; + /** + * [Optional] Describes the nested schema fields if the type property is set + * to RECORD. + */ + fields: Schema$TableFieldSchema[]; + /** + * [Optional] The field mode. Possible values include NULLABLE, REQUIRED and + * REPEATED. The default value is NULLABLE. + */ + mode: string; + /** + * [Required] The field name. The name must contain only letters (a-z, A-Z), + * numbers (0-9), or underscores (_), and must start with a letter or + * underscore. The maximum length is 128 characters. + */ + name: string; + /** + * [Required] The field data type. Possible values include STRING, BYTES, + * INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), + * BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD + * (where RECORD indicates that the field contains a nested schema) or + * STRUCT (same as RECORD). + */ + type: string; + } + export interface Schema$TableList { + /** + * A hash of this page of results. + */ + etag: string; + /** + * The type of list. + */ + kind: string; + /** + * A token to request the next page of results. + */ + nextPageToken: string; + /** + * Tables in the requested dataset. + */ + tables: any[]; + /** + * The total number of tables in the dataset. + */ + totalItems: number; + } + export interface Schema$TableReference { + /** + * [Required] The ID of the dataset containing this table. + */ + datasetId: string; + /** + * [Required] The ID of the project containing this table. + */ + projectId: string; + /** + * [Required] The ID of the table. The ID must contain only letters (a-z, + * A-Z), numbers (0-9), or underscores (_). The maximum length is 1,024 + * characters. + */ + tableId: string; + } + export interface Schema$TableRow { + /** + * Represents a single row in the result set, consisting of one or more + * fields. + */ + f: Schema$TableCell[]; + } + export interface Schema$TableSchema { + /** + * Describes the fields in a table. + */ + fields: Schema$TableFieldSchema[]; + } + export interface Schema$TimePartitioning { + /** + * [Optional] Number of milliseconds for which to keep the storage for a + * partition. + */ + expirationMs: string; + /** + * [Experimental] [Optional] If not set, the table is partitioned by pseudo + * column '_PARTITIONTIME'; if set, the table is partitioned by this + * field. The field must be a top-level TIMESTAMP or DATE field. Its mode + * must be NULLABLE or REQUIRED. + */ + field: string; + /** + * [Experimental] [Optional] If set to true, queries over this table require + * a partition filter that can be used for partition elimination to be + * specified. + */ + requirePartitionFilter: boolean; + /** + * [Required] The only type supported is DAY, which will generate one + * partition per day. + */ + type: string; + } + export interface Schema$UserDefinedFunctionResource { + /** + * [Pick one] An inline resource that contains code for a user-defined + * function (UDF). Providing a inline code resource is equivalent to + * providing a URI for a file containing the same code. + */ + inlineCode: string; + /** + * [Pick one] A code resource to load from a Google Cloud Storage URI + * (gs://bucket/path). + */ + resourceUri: string; + } + export interface Schema$ViewDefinition { + /** + * [Required] A query that BigQuery executes when the view is referenced. + */ + query: string; + /** + * Specifies whether to use BigQuery's legacy SQL for this view. The + * default value is true. If set to false, the view will use BigQuery's + * standard SQL: https://cloud.google.com/bigquery/sql-reference/ Queries + * and views that reference this view must use the same flag value. + */ + useLegacySql: boolean; + /** + * Describes user-defined function resources used in the query. + */ + userDefinedFunctionResources: Schema$UserDefinedFunctionResource[]; } - - /** - * bigquery.jobs.get - * @desc Returns information about a specific job. Job information is - * available for a six month period after creation. Requires that you're the - * person who ran the job, or have the Is Owner project role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the requested job - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // [Required] Job ID of the requested job - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId [Required] Job ID of the requested job - * @param {string=} params.location [Experimental] The geographic location of the job. Required except for US and EU. - * @param {string} params.projectId [Required] Project ID of the requested job - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Datasets { + root: Bigquery; + constructor(root: Bigquery) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * bigquery.jobs.getQueryResults - * @desc Retrieves the results of a query job. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // [Required] Project ID of the query job - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // [Required] Job ID of the query job - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var errorsPage = response['errors']; - * if (!errorsPage) { - * return; - * } - * for (var i = 0; i < errorsPage.length; i++) { - * // TODO: Change code below to process each resource in `errorsPage`: - * console.log(JSON.stringify(errorsPage[i], null, 2)); - * } - * - * if (response.pageToken) { - * request.pageToken = response.pageToken; - * bigquery.jobs.getQueryResults(request, handlePage); - * } - * }; - * - * bigquery.jobs.getQueryResults(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.getQueryResults - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId [Required] Job ID of the query job - * @param {string=} params.location [Experimental] The geographic location where the job should run. Required except for US and EU. - * @param {integer=} params.maxResults Maximum number of results to read - * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results - * @param {string} params.projectId [Required] Project ID of the query job - * @param {string=} params.startIndex Zero-based index of the starting row - * @param {integer=} params.timeoutMs How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getQueryResults(params?: any, options?: MethodOptions): - AxiosPromise; - getQueryResults( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getQueryResults( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * bigquery.datasets.delete + * @desc Deletes the dataset specified by the datasetId value. Before you + * can delete a dataset, you must delete all its tables, either manually or + * by specifying deleteContents. Immediately after deletion, you can create + * another dataset with the same name. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the dataset being deleted + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of dataset being deleted + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.datasets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of dataset being deleted + * @param {boolean=} params.deleteContents If True, delete all the tables in the dataset. If False and the dataset contains tables, the request will fail. Default is False + * @param {string} params.projectId Project ID of the dataset being deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/queries/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * bigquery.jobs.insert - * @desc Starts a new asynchronous job. Requires the Can View project role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the project that will be billed for the job - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * media: { - * // TODO: Add desired media content for upload. See - * // https://github.com/google/google-api-nodejs-client#media-uploads - * mimeType: '', // See - * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', - * }, - * - * auth: authClient, - * }; - * - * bigquery.jobs.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID of the project that will be billed for the job - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * bigquery.datasets.get + * @desc Returns the dataset specified by datasetID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the requested dataset + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the requested dataset + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.datasets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the requested dataset + * @param {string} params.projectId Project ID of the requested dataset + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/bigquery/v2/projects/{projectId}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * bigquery.jobs.list - * @desc Lists all jobs that you started in the specified project. Job - * information is available for a six month period after creation. The job - * list is sorted in reverse chronological order, by job creation time. - * Requires the Can View project role, or the Is Owner project role if you set - * the allUsers property. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the jobs to list - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.jobs.list(request, handlePage); - * } - * }; - * - * bigquery.jobs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.allUsers Whether to display jobs owned by all users in the project. Default false - * @param {string=} params.maxCreationTime Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.minCreationTime Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned - * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results - * @param {string} params.projectId Project ID of the jobs to list - * @param {string=} params.projection Restrict information returned to a set of selected fields - * @param {string=} params.stateFilter Filter for job state - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * bigquery.datasets.insert + * @desc Creates a new empty dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the new dataset + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * bigquery.datasets.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID of the new dataset + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/datasets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * bigquery.jobs.query - * @desc Runs a BigQuery SQL query synchronously and returns query results if - * the query completes within a specified timeout. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the project billed for the query - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * bigquery.jobs.query(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.jobs.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID of the project billed for the query - * @param {().QueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * bigquery.datasets.list + * @desc Lists all datasets in the specified project to which you have been + * granted the READER dataset role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the datasets to be listed + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var datasetsPage = response['datasets']; + * if (!datasetsPage) { + * return; + * } + * for (var i = 0; i < datasetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `datasetsPage`: console.log(JSON.stringify(datasetsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * bigquery.datasets.list(request, handlePage); + * } + * }; + * + * bigquery.datasets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.all Whether to list all datasets, including hidden ones + * @param {string=} params.filter An expression for filtering the results of the request by label. The syntax is "labels.[:]". Multiple filters can be ANDed together by connecting with a space. Example: "labels.department:receiving labels.active". See Filtering datasets using labels for details. + * @param {integer=} params.maxResults The maximum number of results to return + * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results + * @param {string} params.projectId Project ID of the datasets to be listed + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/datasets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/queries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Bigquery; - constructor(root: Bigquery) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * bigquery.datasets.patch + * @desc Updates information in an existing dataset. The update method + * replaces the entire dataset resource, whereas the patch method only + * replaces fields that are provided in the submitted dataset resource. This + * method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the dataset being updated + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the dataset being updated + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * bigquery.datasets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the dataset being updated + * @param {string} params.projectId Project ID of the dataset being updated + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * bigquery.projects.getServiceAccount - * @desc Returns the email address of the service account for your project - * used for interactions with Google Cloud KMS. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for which the service account is requested. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.projects.getServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.projects.getServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID for which the service account is requested. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - getServiceAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServiceAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects/{projectId}/serviceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * bigquery.datasets.update + * @desc Updates information in an existing dataset. The update method + * replaces the entire dataset resource, whereas the patch method only + * replaces fields that are provided in the submitted dataset resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the dataset being updated + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the dataset being updated + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * bigquery.datasets.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.datasets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the dataset being updated + * @param {string} params.projectId Project ID of the dataset being updated + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * bigquery.projects.list - * @desc Lists all projects to which you have been granted any project role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.projects.list(request, handlePage); - * } - * }; - * - * bigquery.projects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.projects.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Jobs { + root: Bigquery; + constructor(root: Bigquery) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/bigquery/v2/projects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Tabledata { - root: Bigquery; - constructor(root: Bigquery) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * bigquery.jobs.cancel + * @desc Requests that a job be cancelled. This call will return + * immediately, and the client will need to poll for the job status to see + * if the cancel completed successfully. Cancelled jobs may still incur + * costs. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // [Required] Project ID of the job to cancel + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // [Required] Job ID of the job to cancel + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.jobs.cancel(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId [Required] Job ID of the job to cancel + * @param {string=} params.location [Experimental] The geographic location of the job. Required except for US and EU. + * @param {string} params.projectId [Required] Project ID of the job to cancel + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/jobs/{jobId}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * bigquery.tabledata.insertAll - * @desc Streams data into BigQuery one record at a time without needing to - * run a load job. Requires the WRITER dataset role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the destination table. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the destination table. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the destination table. - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * bigquery.tabledata.insertAll(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tabledata.insertAll - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the destination table. - * @param {string} params.projectId Project ID of the destination table. - * @param {string} params.tableId Table ID of the destination table. - * @param {().TableDataInsertAllRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insertAll(params?: any, options?: MethodOptions): - AxiosPromise; - insertAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insertAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * bigquery.jobs.get + * @desc Returns information about a specific job. Job information is + * available for a six month period after creation. Requires that you're the + * person who ran the job, or have the Is Owner project role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // [Required] Project ID of the requested job + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // [Required] Job ID of the requested job + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.jobs.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId [Required] Job ID of the requested job + * @param {string=} params.location [Experimental] The geographic location of the job. Required except for US and EU. + * @param {string} params.projectId [Required] Project ID of the requested job + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * bigquery.tabledata.list - * @desc Retrieves table data from a specified set of rows. Requires the - * READER dataset role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to read - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the table to read - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the table to read - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rowsPage = response['rows']; - * if (!rowsPage) { - * return; - * } - * for (var i = 0; i < rowsPage.length; i++) { - * // TODO: Change code below to process each resource in `rowsPage`: - * console.log(JSON.stringify(rowsPage[i], null, 2)); - * } - * - * if (response.pageToken) { - * request.pageToken = response.pageToken; - * bigquery.tabledata.list(request, handlePage); - * } - * }; - * - * bigquery.tabledata.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tabledata.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the table to read - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken Page token, returned by a previous call, identifying the result set - * @param {string} params.projectId Project ID of the table to read - * @param {string=} params.selectedFields List of fields to return (comma-separated). If unspecified, all fields are returned - * @param {string=} params.startIndex Zero-based index of the starting row to read - * @param {string} params.tableId Table ID of the table to read - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * bigquery.jobs.getQueryResults + * @desc Retrieves the results of a query job. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // [Required] Project ID of the query job + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // [Required] Job ID of the query job + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var errorsPage = response['errors']; + * if (!errorsPage) { + * return; + * } + * for (var i = 0; i < errorsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `errorsPage`: console.log(JSON.stringify(errorsPage[i], null, 2)); + * } + * + * if (response.pageToken) { + * request.pageToken = response.pageToken; + * bigquery.jobs.getQueryResults(request, handlePage); + * } + * }; + * + * bigquery.jobs.getQueryResults(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.getQueryResults + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId [Required] Job ID of the query job + * @param {string=} params.location [Experimental] The geographic location where the job should run. Required except for US and EU. + * @param {integer=} params.maxResults Maximum number of results to read + * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results + * @param {string} params.projectId [Required] Project ID of the query job + * @param {string=} params.startIndex Zero-based index of the starting row + * @param {integer=} params.timeoutMs How long to wait for the query to complete, in milliseconds, before returning. Default is 10 seconds. If the timeout passes before the job completes, the 'jobComplete' field in the response will be false + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getQueryResults(params?: any, options?: MethodOptions): + AxiosPromise; + getQueryResults( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getQueryResults( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/bigquery/v2/projects/{projectId}/queries/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Tables { - root: Bigquery; - constructor(root: Bigquery) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * bigquery.jobs.insert + * @desc Starts a new asynchronous job. Requires the Can View project role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the project that will be billed for the job + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * media: { + * // TODO: Add desired media content for upload. See + * // https://github.com/google/google-api-nodejs-client#media-uploads + * mimeType: '', // See + * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', + * }, + * + * auth: authClient, + * }; + * + * bigquery.jobs.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID of the project that will be billed for the job + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/bigquery/v2/projects/{projectId}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * bigquery.tables.delete - * @desc Deletes the table specified by tableId from the dataset. If the table - * contains data, all the data will be deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to delete - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the table to delete - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the table to delete - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.tables.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the table to delete - * @param {string} params.projectId Project ID of the table to delete - * @param {string} params.tableId Table ID of the table to delete - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * bigquery.jobs.list + * @desc Lists all jobs that you started in the specified project. Job + * information is available for a six month period after creation. The job + * list is sorted in reverse chronological order, by job creation time. + * Requires the Can View project role, or the Is Owner project role if you + * set the allUsers property. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the jobs to list + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var jobsPage = response['jobs']; + * if (!jobsPage) { + * return; + * } + * for (var i = 0; i < jobsPage.length; i++) { + * // TODO: Change code below to process each resource in `jobsPage`: + * console.log(JSON.stringify(jobsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * bigquery.jobs.list(request, handlePage); + * } + * }; + * + * bigquery.jobs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.allUsers Whether to display jobs owned by all users in the project. Default false + * @param {string=} params.maxCreationTime Max value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created before or at this timestamp are returned + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.minCreationTime Min value for job creation time, in milliseconds since the POSIX epoch. If set, only jobs created after or at this timestamp are returned + * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results + * @param {string} params.projectId Project ID of the jobs to list + * @param {string=} params.projection Restrict information returned to a set of selected fields + * @param {string=} params.stateFilter Filter for job state + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * bigquery.jobs.query + * @desc Runs a BigQuery SQL query synchronously and returns query results + * if the query completes within a specified timeout. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the project billed for the query + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * bigquery.jobs.query(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.jobs.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID of the project billed for the query + * @param {().QueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects/{projectId}/queries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Projects { + root: Bigquery; + constructor(root: Bigquery) { + this.root = root; + this.getRoot.bind(this); + } - /** - * bigquery.tables.get - * @desc Gets the specified table resource by table ID. This method does not - * return the data in the table, it only returns the table resource, which - * describes the structure of this table. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the requested table - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the requested table - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the requested table - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * bigquery.tables.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the requested table - * @param {string} params.projectId Project ID of the requested table - * @param {string=} params.selectedFields List of fields to return (comma-separated). If unspecified, all fields are returned - * @param {string} params.tableId Table ID of the requested table - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * bigquery.projects.getServiceAccount + * @desc Returns the email address of the service account for your project + * used for interactions with Google Cloud KMS. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for which the service account is requested. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.projects.getServiceAccount(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.projects.getServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID for which the service account is requested. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + getServiceAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getServiceAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/bigquery/v2/projects/{projectId}/serviceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * bigquery.projects.list + * @desc Lists all projects to which you have been granted any project role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var projectsPage = response['projects']; + * if (!projectsPage) { + * return; + * } + * for (var i = 0; i < projectsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * bigquery.projects.list(request, handlePage); + * } + * }; + * + * bigquery.projects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.projects.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/bigquery/v2/projects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * bigquery.tables.insert - * @desc Creates a new, empty table in the dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the new table - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the new table - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the new table - * @param {string} params.projectId Project ID of the new table - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Tabledata { + root: Bigquery; + constructor(root: Bigquery) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * bigquery.tabledata.insertAll + * @desc Streams data into BigQuery one record at a time without needing to + * run a load job. Requires the WRITER dataset role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the destination table. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the destination table. + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the destination table. + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * bigquery.tabledata.insertAll(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tabledata.insertAll + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the destination table. + * @param {string} params.projectId Project ID of the destination table. + * @param {string} params.tableId Table ID of the destination table. + * @param {().TableDataInsertAllRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insertAll(params?: any, options?: MethodOptions): + AxiosPromise; + insertAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + insertAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/insertAll') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * bigquery.tables.list - * @desc Lists all tables in the specified dataset. Requires the READER - * dataset role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the tables to list - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the tables to list - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tablesPage = response['tables']; - * if (!tablesPage) { - * return; - * } - * for (var i = 0; i < tablesPage.length; i++) { - * // TODO: Change code below to process each resource in `tablesPage`: - * console.log(JSON.stringify(tablesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * bigquery.tables.list(request, handlePage); - * } - * }; - * - * bigquery.tables.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the tables to list - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results - * @param {string} params.projectId Project ID of the tables to list - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * bigquery.tabledata.list + * @desc Retrieves table data from a specified set of rows. Requires the + * READER dataset role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the table to read + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the table to read + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the table to read + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var rowsPage = response['rows']; + * if (!rowsPage) { + * return; + * } + * for (var i = 0; i < rowsPage.length; i++) { + * // TODO: Change code below to process each resource in `rowsPage`: + * console.log(JSON.stringify(rowsPage[i], null, 2)); + * } + * + * if (response.pageToken) { + * request.pageToken = response.pageToken; + * bigquery.tabledata.list(request, handlePage); + * } + * }; + * + * bigquery.tabledata.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tabledata.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the table to read + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken Page token, returned by a previous call, identifying the result set + * @param {string} params.projectId Project ID of the table to read + * @param {string=} params.selectedFields List of fields to return (comma-separated). If unspecified, all fields are returned + * @param {string=} params.startIndex Zero-based index of the starting row to read + * @param {string} params.tableId Table ID of the table to read + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Tables { + root: Bigquery; + constructor(root: Bigquery) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'datasetId'], - pathParams: ['datasetId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * bigquery.tables.patch - * @desc Updates information in an existing table. The update method replaces - * the entire table resource, whereas the patch method only replaces fields - * that are provided in the submitted table resource. This method supports - * patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to update - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the table to update - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the table to update - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the table to update - * @param {string} params.projectId Project ID of the table to update - * @param {string} params.tableId Table ID of the table to update - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * bigquery.tables.delete + * @desc Deletes the table specified by tableId from the dataset. If the + * table contains data, all the data will be deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the table to delete + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the table to delete + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the table to delete + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.tables.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the table to delete + * @param {string} params.projectId Project ID of the table to delete + * @param {string} params.tableId Table ID of the table to delete + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * bigquery.tables.get + * @desc Gets the specified table resource by table ID. This method does not + * return the data in the table, it only returns the table resource, which + * describes the structure of this table. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the requested table + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the requested table + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the requested table + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * bigquery.tables.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the requested table + * @param {string} params.projectId Project ID of the requested table + * @param {string=} params.selectedFields List of fields to return (comma-separated). If unspecified, all fields are returned + * @param {string} params.tableId Table ID of the requested table + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * bigquery.tables.insert + * @desc Creates a new, empty table in the dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the new table + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the new table + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * bigquery.tables.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the new table + * @param {string} params.projectId Project ID of the new table + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * bigquery.tables.update - * @desc Updates information in an existing table. The update method replaces - * the entire table resource, whereas the patch method only replaces fields - * that are provided in the submitted table resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the BigQuery API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/bigquery - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var bigquery = google.bigquery('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID of the table to update - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Dataset ID of the table to update - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * // Table ID of the table to update - * tableId: 'my-table-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * bigquery.tables.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias bigquery.tables.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset ID of the table to update - * @param {string} params.projectId Project ID of the table to update - * @param {string} params.tableId Table ID of the table to update - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * bigquery.tables.list + * @desc Lists all tables in the specified dataset. Requires the READER + * dataset role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the tables to list + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the tables to list + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var tablesPage = response['tables']; + * if (!tablesPage) { + * return; + * } + * for (var i = 0; i < tablesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `tablesPage`: console.log(JSON.stringify(tablesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * bigquery.tables.list(request, handlePage); + * } + * }; + * + * bigquery.tables.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the tables to list + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken Page token, returned by a previous call, to request the next page of results + * @param {string} params.projectId Project ID of the tables to list + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'datasetId'], + pathParams: ['datasetId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * bigquery.tables.patch + * @desc Updates information in an existing table. The update method + * replaces the entire table resource, whereas the patch method only + * replaces fields that are provided in the submitted table resource. This + * method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the table to update + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the table to update + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the table to update + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * bigquery.tables.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the table to update + * @param {string} params.projectId Project ID of the table to update + * @param {string} params.tableId Table ID of the table to update + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'datasetId', 'tableId'], - pathParams: ['datasetId', 'projectId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * bigquery.tables.update + * @desc Updates information in an existing table. The update method + * replaces the entire table resource, whereas the patch method only + * replaces fields that are provided in the submitted table resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the BigQuery API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/bigquery + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var bigquery = google.bigquery('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID of the table to update + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // Dataset ID of the table to update + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * // Table ID of the table to update + * tableId: 'my-table-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * bigquery.tables.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias bigquery.tables.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset ID of the table to update + * @param {string} params.projectId Project ID of the table to update + * @param {string} params.tableId Table ID of the table to update + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'datasetId', 'tableId'], + pathParams: ['datasetId', 'projectId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/bigquerydatatransfer/v1.ts b/src/apis/bigquerydatatransfer/v1.ts index cf205b98c01..164952085b9 100644 --- a/src/apis/bigquerydatatransfer/v1.ts +++ b/src/apis/bigquerydatatransfer/v1.ts @@ -27,2303 +27,2327 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * BigQuery Data Transfer API - * - * Transfers data from partner SaaS applications to Google BigQuery on a - * scheduled, managed basis. - * - * @example - * const google = require('googleapis'); - * const bigquerydatatransfer = google.bigquerydatatransfer('v1'); - * - * @namespace bigquerydatatransfer - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Bigquerydatatransfer - */ -export class Bigquerydatatransfer { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A request to determine whether the user has valid credentials. This method is - * used to limit the number of OAuth popups in the user interface. The user id - * is inferred from the API call context. If the data source has the Google+ - * authorization type, this method returns false, as it cannot be determined - * whether the credentials are already valid merely based on the user id. - */ -export interface Schema$CheckValidCredsRequest {} -/** - * A response indicating whether the credentials exist and are valid. - */ -export interface Schema$CheckValidCredsResponse { - /** - * If set to `true`, the credentials exist and are valid. - */ - hasValidCreds: boolean; -} -/** - * Represents data source metadata. Metadata is sufficient to render UI and - * request proper OAuth tokens. - */ -export interface Schema$DataSource { - /** - * Indicates the type of authorization. - */ - authorizationType: string; - /** - * Data source client id which should be used to receive refresh token. When - * not supplied, no offline credentials are populated for data transfer. - */ - clientId: string; - /** - * Specifies whether the data source supports automatic data refresh for the - * past few days, and how it's supported. For some data sources, data - * might not be complete until a few days later, so it's useful to refresh - * data automatically. - */ - dataRefreshType: string; - /** - * Data source id. - */ - dataSourceId: string; - /** - * Default data refresh window on days. Only meaningful when - * `data_refresh_type` = `SLIDING_WINDOW`. - */ - defaultDataRefreshWindowDays: number; - /** - * Default data transfer schedule. Examples of valid schedules include: - * `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun 13:15`, and - * `first sunday of quarter 00:00`. - */ - defaultSchedule: string; - /** - * User friendly data source description string. - */ - description: string; - /** - * User friendly data source name. - */ - displayName: string; - /** - * Url for the help document for this data source. - */ - helpUrl: string; - /** - * Disables backfilling and manual run scheduling for the data source. - */ - manualRunsDisabled: boolean; - /** - * The minimum interval for scheduler to schedule runs. - */ - minimumScheduleInterval: string; - /** - * Output only. Data source resource name. - */ - name: string; - /** - * Data source parameters. - */ - parameters: Schema$DataSourceParameter[]; - /** - * Api auth scopes for which refresh token needs to be obtained. Only valid - * when `client_id` is specified. Ignored otherwise. These are scopes needed - * by a data source to prepare data and ingest them into BigQuery, e.g., - * https://www.googleapis.com/auth/bigquery - */ - scopes: string[]; - /** - * Specifies whether the data source supports a user defined schedule, or - * operates on the default schedule. When set to `true`, user can override - * default schedule. - */ - supportsCustomSchedule: boolean; - /** - * Indicates whether the data source supports multiple transfers to different - * BigQuery targets. - */ - supportsMultipleTransfers: boolean; - /** - * Deprecated. This field has no effect. - */ - transferType: string; - /** - * The number of seconds to wait for an update from the data source before - * BigQuery marks the transfer as failed. - */ - updateDeadlineSeconds: number; -} -/** - * Represents a data source parameter with validation rules, so that parameters - * can be rendered in the UI. These parameters are given to us by supported data - * sources, and include all needed information for rendering and validation. - * Thus, whoever uses this api can decide to generate either generic ui, or - * custom data source specific forms. - */ -export interface Schema$DataSourceParameter { - /** - * All possible values for the parameter. - */ - allowedValues: string[]; - /** - * Parameter description. - */ - description: string; - /** - * Parameter display name in the user interface. - */ - displayName: string; - /** - * When parameter is a record, describes child fields. - */ - fields: Schema$DataSourceParameter[]; - /** - * Cannot be changed after initial creation. - */ - immutable: boolean; - /** - * For integer and double values specifies maxminum allowed value. - */ - maxValue: number; - /** - * For integer and double values specifies minimum allowed value. - */ - minValue: number; - /** - * Parameter identifier. - */ - paramId: string; - /** - * If set to true, schema should be taken from the parent with the same - * parameter_id. Only applicable when parameter type is RECORD. - */ - recurse: boolean; - /** - * Can parameter have multiple values. - */ - repeated: boolean; - /** - * Is parameter required. - */ - required: boolean; - /** - * Parameter type. - */ - type: string; - /** - * Description of the requirements for this field, in case the user input does - * not fulfill the regex pattern or min/max values. - */ - validationDescription: string; - /** - * URL to a help document to further explain the naming requirements. - */ - validationHelpUrl: string; - /** - * Regular expression which can be used for parameter validation. - */ - validationRegex: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Returns list of supported data sources and their metadata. - */ -export interface Schema$ListDataSourcesResponse { - /** - * List of supported data sources and their transfer settings. - */ - dataSources: Schema$DataSource[]; - /** - * Output only. The next-pagination token. For multiple-page list results, - * this token can be used as the `ListDataSourcesRequest.page_token` to - * request the next page of list results. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The returned list of pipelines in the project. - */ -export interface Schema$ListTransferConfigsResponse { - /** - * Output only. The next-pagination token. For multiple-page list results, - * this token can be used as the `ListTransferConfigsRequest.page_token` to - * request the next page of list results. - */ - nextPageToken: string; - /** - * Output only. The stored pipeline transfer configurations. - */ - transferConfigs: Schema$TransferConfig[]; -} -/** - * The returned list transfer run messages. - */ -export interface Schema$ListTransferLogsResponse { - /** - * Output only. The next-pagination token. For multiple-page list results, - * this token can be used as the `GetTransferRunLogRequest.page_token` to - * request the next page of list results. - */ - nextPageToken: string; - /** - * Output only. The stored pipeline transfer messages. - */ - transferMessages: Schema$TransferMessage[]; -} -/** - * The returned list of pipelines in the project. - */ -export interface Schema$ListTransferRunsResponse { - /** - * Output only. The next-pagination token. For multiple-page list results, - * this token can be used as the `ListTransferRunsRequest.page_token` to - * request the next page of list results. - */ - nextPageToken: string; - /** - * Output only. The stored pipeline transfer runs. - */ - transferRuns: Schema$TransferRun[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * A request to schedule transfer runs for a time range. - */ -export interface Schema$ScheduleTransferRunsRequest { - /** - * End time of the range of transfer runs. For example, - * `"2017-05-30T00:00:00+00:00"`. - */ - endTime: string; - /** - * Start time of the range of transfer runs. For example, - * `"2017-05-25T00:00:00+00:00"`. - */ - startTime: string; -} -/** - * A response to schedule transfer runs for a time range. - */ -export interface Schema$ScheduleTransferRunsResponse { - /** - * The transfer runs that were scheduled. - */ - runs: Schema$TransferRun[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents a data transfer configuration. A transfer configuration contains - * all metadata needed to perform a data transfer. For example, - * `destination_dataset_id` specifies where data should be stored. When a new - * transfer configuration is created, the specified `destination_dataset_id` is - * created when needed and shared with the appropriate data source service - * account. - */ -export interface Schema$TransferConfig { - /** - * The number of days to look back to automatically refresh the data. For - * example, if `data_refresh_window_days = 10`, then every day BigQuery - * reingests data for [today-10, today-1], rather than ingesting data for just - * [today-1]. Only valid if the data source supports the feature. Set the - * value to 0 to use the default value. - */ - dataRefreshWindowDays: number; - /** - * Output only. Region in which BigQuery dataset is located. - */ - datasetRegion: string; - /** - * Data source id. Cannot be changed once data transfer is created. - */ - dataSourceId: string; - /** - * The BigQuery target dataset id. - */ - destinationDatasetId: string; - /** - * Is this config disabled. When set to true, no runs are scheduled for a - * given transfer. - */ - disabled: boolean; - /** - * User specified display name for the data transfer. - */ - displayName: string; - /** - * The resource name of the transfer config. Transfer config names have the - * form `projects/{project_id}/transferConfigs/{config_id}`. Where `config_id` - * is usually a uuid, even though it is not guaranteed or required. The name - * is ignored when creating a transfer config. - */ - name: string; - /** - * Output only. Next time when data transfer will run. - */ - nextRunTime: string; - /** - * Data transfer specific parameters. - */ - params: any; - /** - * Data transfer schedule. If the data source does not support a custom - * schedule, this should be empty. If it is empty, the default value for the - * data source will be used. The specified times are in UTC. Examples of valid - * format: `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun 13:15`, - * and `first sunday of quarter 00:00`. See more explanation about the format - * here: - * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format - * NOTE: the granularity should be at least 8 hours, or less frequent. - */ - schedule: string; - /** - * Output only. State of the most recently updated transfer run. - */ - state: string; - /** - * Output only. Data transfer modification time. Ignored by server on input. - */ - updateTime: string; - /** - * Output only. Unique ID of the user on whose behalf transfer is done. - * Applicable only to data sources that do not support service accounts. When - * set to 0, the data source service account credentials are used. May be - * negative. Note, that this identifier is not stable. It may change over time - * even for the same user. - */ - userId: string; -} -/** - * Represents a user facing message for a particular data transfer run. - */ -export interface Schema$TransferMessage { - /** - * Message text. - */ - messageText: string; - /** - * Time when message was logged. - */ - messageTime: string; - /** - * Message severity. - */ - severity: string; -} -/** - * Represents a data transfer run. - */ -export interface Schema$TransferRun { - /** - * Output only. Data source id. - */ - dataSourceId: string; - /** - * Output only. The BigQuery target dataset id. - */ - destinationDatasetId: string; - /** - * Output only. Time when transfer run ended. Parameter ignored by server for - * input requests. - */ - endTime: string; - /** - * Status of the transfer run. - */ - errorStatus: Schema$Status; - /** - * The resource name of the transfer run. Transfer run names have the form - * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. - * The name is ignored when creating a transfer run. - */ - name: string; - /** - * Output only. Data transfer specific parameters. - */ - params: any; - /** - * For batch transfer runs, specifies the date and time that data should be - * ingested. - */ - runTime: string; - /** - * Output only. Describes the schedule of this transfer run if it was created - * as part of a regular schedule. For batch transfer runs that are scheduled - * manually, this is empty. NOTE: the system might choose to delay the - * schedule depending on the current load, so `schedule_time` doesn't - * always matches this. - */ - schedule: string; - /** - * Minimum time after which a transfer run can be started. - */ - scheduleTime: string; - /** - * Output only. Time when transfer run was started. Parameter ignored by - * server for input requests. - */ - startTime: string; - /** - * Data transfer run state. Ignored for input requests. - */ - state: string; - /** - * Output only. Last time the data transfer run state was updated. - */ - updateTime: string; - /** - * Output only. Unique ID of the user on whose behalf transfer is done. - * Applicable only to data sources that do not support service accounts. When - * set to 0, the data source service account credentials are used. May be - * negative. Note, that this identifier is not stable. It may change over time - * even for the same user. - */ - userId: string; -} - -export class Resource$Projects { - root: Bigquerydatatransfer; - dataSources: Resource$Projects$Datasources; - locations: Resource$Projects$Locations; - transferConfigs: Resource$Projects$Transferconfigs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.dataSources = new Resource$Projects$Datasources(root); - this.locations = new Resource$Projects$Locations(root); - this.transferConfigs = new Resource$Projects$Transferconfigs(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Datasources { - root: Bigquerydatatransfer; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace bigquerydatatransfer_v1 { /** - * bigquerydatatransfer.projects.dataSources.checkValidCreds - * @desc Returns true if valid credentials exist for the given data source and - * requesting user. Some data sources doesn't support service account, so we - * need to talk to them on behalf of the end user. This API just checks - * whether we have OAuth token for the particular user, which is a - * pre-requisite before user can create a transfer config. - * @alias bigquerydatatransfer.projects.dataSources.checkValidCreds - * @memberOf! () + * BigQuery Data Transfer API * - * @param {object} params Parameters for request - * @param {string} params.name The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` - * @param {().CheckValidCredsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - checkValidCreds(params?: any, options?: MethodOptions): - AxiosPromise; - checkValidCreds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - checkValidCreds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:checkValidCreds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * bigquerydatatransfer.projects.dataSources.get - * @desc Retrieves a supported data source and returns its settings, which can - * be used for UI rendering. - * @alias bigquerydatatransfer.projects.dataSources.get - * @memberOf! () + * Transfers data from partner SaaS applications to Google BigQuery on a + * scheduled, managed basis. * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * bigquerydatatransfer.projects.dataSources.list - * @desc Lists supported data sources and returns their settings, which can be - * used for UI rendering. - * @alias bigquerydatatransfer.projects.dataSources.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const bigquerydatatransfer = google.bigquerydatatransfer('v1'); * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace bigquerydatatransfer + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Bigquerydatatransfer */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/dataSources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects$Locations { - root: Bigquerydatatransfer; - dataSources: Resource$Projects$Locations$Datasources; - transferConfigs: Resource$Projects$Locations$Transferconfigs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.dataSources = new Resource$Projects$Locations$Datasources(root); - this.transferConfigs = - new Resource$Projects$Locations$Transferconfigs(root); - } + export class Bigquerydatatransfer { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + projects: Resource$Projects; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * bigquerydatatransfer.projects.locations.get - * @desc Gets information about a location. - * @alias bigquerydatatransfer.projects.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.projects = new Resource$Projects(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * bigquerydatatransfer.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @alias bigquerydatatransfer.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Datasources { - root: Bigquerydatatransfer; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; - } - - /** - * bigquerydatatransfer.projects.locations.dataSources.checkValidCreds - * @desc Returns true if valid credentials exist for the given data source and - * requesting user. Some data sources doesn't support service account, so we - * need to talk to them on behalf of the end user. This API just checks - * whether we have OAuth token for the particular user, which is a - * pre-requisite before user can create a transfer config. - * @alias bigquerydatatransfer.projects.locations.dataSources.checkValidCreds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` - * @param {().CheckValidCredsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A request to determine whether the user has valid credentials. This method + * is used to limit the number of OAuth popups in the user interface. The user + * id is inferred from the API call context. If the data source has the + * Google+ authorization type, this method returns false, as it cannot be + * determined whether the credentials are already valid merely based on the + * user id. */ - checkValidCreds(params?: any, options?: MethodOptions): - AxiosPromise; - checkValidCreds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - checkValidCreds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:checkValidCreds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - + export interface Schema$CheckValidCredsRequest {} /** - * bigquerydatatransfer.projects.locations.dataSources.get - * @desc Retrieves a supported data source and returns its settings, which can - * be used for UI rendering. - * @alias bigquerydatatransfer.projects.locations.dataSources.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response indicating whether the credentials exist and are valid. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CheckValidCredsResponse { + /** + * If set to `true`, the credentials exist and are valid. + */ + hasValidCreds: boolean; } - - /** - * bigquerydatatransfer.projects.locations.dataSources.list - * @desc Lists supported data sources and returns their settings, which can be - * used for UI rendering. - * @alias bigquerydatatransfer.projects.locations.dataSources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/dataSources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents data source metadata. Metadata is sufficient to render UI and + * request proper OAuth tokens. + */ + export interface Schema$DataSource { + /** + * Indicates the type of authorization. + */ + authorizationType: string; + /** + * Data source client id which should be used to receive refresh token. When + * not supplied, no offline credentials are populated for data transfer. + */ + clientId: string; + /** + * Specifies whether the data source supports automatic data refresh for the + * past few days, and how it's supported. For some data sources, data + * might not be complete until a few days later, so it's useful to + * refresh data automatically. + */ + dataRefreshType: string; + /** + * Data source id. + */ + dataSourceId: string; + /** + * Default data refresh window on days. Only meaningful when + * `data_refresh_type` = `SLIDING_WINDOW`. + */ + defaultDataRefreshWindowDays: number; + /** + * Default data transfer schedule. Examples of valid schedules include: + * `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun 13:15`, and + * `first sunday of quarter 00:00`. + */ + defaultSchedule: string; + /** + * User friendly data source description string. + */ + description: string; + /** + * User friendly data source name. + */ + displayName: string; + /** + * Url for the help document for this data source. + */ + helpUrl: string; + /** + * Disables backfilling and manual run scheduling for the data source. + */ + manualRunsDisabled: boolean; + /** + * The minimum interval for scheduler to schedule runs. + */ + minimumScheduleInterval: string; + /** + * Output only. Data source resource name. + */ + name: string; + /** + * Data source parameters. + */ + parameters: Schema$DataSourceParameter[]; + /** + * Api auth scopes for which refresh token needs to be obtained. Only valid + * when `client_id` is specified. Ignored otherwise. These are scopes needed + * by a data source to prepare data and ingest them into BigQuery, e.g., + * https://www.googleapis.com/auth/bigquery + */ + scopes: string[]; + /** + * Specifies whether the data source supports a user defined schedule, or + * operates on the default schedule. When set to `true`, user can override + * default schedule. + */ + supportsCustomSchedule: boolean; + /** + * Indicates whether the data source supports multiple transfers to + * different BigQuery targets. + */ + supportsMultipleTransfers: boolean; + /** + * Deprecated. This field has no effect. + */ + transferType: string; + /** + * The number of seconds to wait for an update from the data source before + * BigQuery marks the transfer as failed. + */ + updateDeadlineSeconds: number; } -} - -export class Resource$Projects$Locations$Transferconfigs { - root: Bigquerydatatransfer; - runs: Resource$Projects$Locations$Transferconfigs$Runs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.runs = new Resource$Projects$Locations$Transferconfigs$Runs(root); - } - - getRoot() { - return this.root; - } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.create - * @desc Creates a new data transfer configuration. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. This is required if new credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. - * @param {string} params.parent The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} If specified location and location of the destination bigquery dataset do not match - the request will fail. - * @param {().TransferConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a data source parameter with validation rules, so that + * parameters can be rendered in the UI. These parameters are given to us by + * supported data sources, and include all needed information for rendering + * and validation. Thus, whoever uses this api can decide to generate either + * generic ui, or custom data source specific forms. + */ + export interface Schema$DataSourceParameter { + /** + * All possible values for the parameter. + */ + allowedValues: string[]; + /** + * Parameter description. + */ + description: string; + /** + * Parameter display name in the user interface. + */ + displayName: string; + /** + * When parameter is a record, describes child fields. + */ + fields: Schema$DataSourceParameter[]; + /** + * Cannot be changed after initial creation. + */ + immutable: boolean; + /** + * For integer and double values specifies maxminum allowed value. + */ + maxValue: number; + /** + * For integer and double values specifies minimum allowed value. + */ + minValue: number; + /** + * Parameter identifier. + */ + paramId: string; + /** + * If set to true, schema should be taken from the parent with the same + * parameter_id. Only applicable when parameter type is RECORD. + */ + recurse: boolean; + /** + * Can parameter have multiple values. + */ + repeated: boolean; + /** + * Is parameter required. + */ + required: boolean; + /** + * Parameter type. + */ + type: string; + /** + * Description of the requirements for this field, in case the user input + * does not fulfill the regex pattern or min/max values. + */ + validationDescription: string; + /** + * URL to a help document to further explain the naming requirements. + */ + validationHelpUrl: string; + /** + * Regular expression which can be used for parameter validation. + */ + validationRegex: string; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.delete - * @desc Deletes a data transfer configuration, including any associated - * transfer runs and logs. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Returns list of supported data sources and their metadata. + */ + export interface Schema$ListDataSourcesResponse { + /** + * List of supported data sources and their transfer settings. + */ + dataSources: Schema$DataSource[]; + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the `ListDataSourcesRequest.page_token` to + * request the next page of list results. + */ + nextPageToken: string; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.get - * @desc Returns information about a data transfer config. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.list - * @desc Returns information about all data transfers in the project. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dataSourceIds When specified, only configurations of requested data sources are returned. - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent The BigQuery project id for which data sources should be returned: `projects/{project_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The returned list of pipelines in the project. + */ + export interface Schema$ListTransferConfigsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the `ListTransferConfigsRequest.page_token` to + * request the next page of list results. + */ + nextPageToken: string; + /** + * Output only. The stored pipeline transfer configurations. + */ + transferConfigs: Schema$TransferConfig[]; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.patch - * @desc Updates a data transfer configuration. All fields must be set, even - * if they are not updated. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the transfer configuration will be associated with the authorizing user. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. - * @param {string} params.name The resource name of the transfer config. Transfer config names have the form `projects/{project_id}/transferConfigs/{config_id}`. Where `config_id` is usually a uuid, even though it is not guaranteed or required. The name is ignored when creating a transfer config. - * @param {string=} params.updateMask Required list of fields to be updated in this request. - * @param {().TransferConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The returned list transfer run messages. + */ + export interface Schema$ListTransferLogsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the `GetTransferRunLogRequest.page_token` to + * request the next page of list results. + */ + nextPageToken: string; + /** + * Output only. The stored pipeline transfer messages. + */ + transferMessages: Schema$TransferMessage[]; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns - * @desc Creates transfer runs for a time range [start_time, end_time]. For - * each date - or whatever granularity the data source supports - in the - * range, one transfer run is created. Note that runs are created per UTC time - * in the time range. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}`. - * @param {().ScheduleTransferRunsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - scheduleRuns(params?: any, options?: MethodOptions): - AxiosPromise; - scheduleRuns( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - scheduleRuns( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}:scheduleRuns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Transferconfigs$Runs { - root: Bigquerydatatransfer; - transferLogs: Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.transferLogs = - new Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs(root); - } - - getRoot() { - return this.root; + * The returned list of pipelines in the project. + */ + export interface Schema$ListTransferRunsResponse { + /** + * Output only. The next-pagination token. For multiple-page list results, + * this token can be used as the `ListTransferRunsRequest.page_token` to + * request the next page of list results. + */ + nextPageToken: string; + /** + * Output only. The stored pipeline transfer runs. + */ + transferRuns: Schema$TransferRun[]; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.runs.delete - * @desc Deletes the specified transfer run. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.runs.get - * @desc Returns information about the particular transfer run. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A request to schedule transfer runs for a time range. + */ + export interface Schema$ScheduleTransferRunsRequest { + /** + * End time of the range of transfer runs. For example, + * `"2017-05-30T00:00:00+00:00"`. + */ + endTime: string; + /** + * Start time of the range of transfer runs. For example, + * `"2017-05-25T00:00:00+00:00"`. + */ + startTime: string; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.runs.list - * @desc Returns information about running and completed jobs. - * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}`. - * @param {string=} params.runAttempt Indicates how run attempts are to be pulled. - * @param {string=} params.states When specified, only transfer runs with requested states are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response to schedule transfer runs for a time range. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/runs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs { - root: Bigquerydatatransfer; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$ScheduleTransferRunsResponse { + /** + * The transfer runs that were scheduled. + */ + runs: Schema$TransferRun[]; } - - /** - * bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list - * @desc Returns user facing log messages for the data transfer run. - * @alias - * bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.messageTypes Message types to return. If not populated - INFO, WARNING and ERROR messages are returned. - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferLogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } -} - - - -export class Resource$Projects$Transferconfigs { - root: Bigquerydatatransfer; - runs: Resource$Projects$Transferconfigs$Runs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.runs = new Resource$Projects$Transferconfigs$Runs(root); - } - - getRoot() { - return this.root; - } - - /** - * bigquerydatatransfer.projects.transferConfigs.create - * @desc Creates a new data transfer configuration. - * @alias bigquerydatatransfer.projects.transferConfigs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. This is required if new credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. - * @param {string} params.parent The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} If specified location and location of the destination bigquery dataset do not match - the request will fail. - * @param {().TransferConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a data transfer configuration. A transfer configuration contains + * all metadata needed to perform a data transfer. For example, + * `destination_dataset_id` specifies where data should be stored. When a new + * transfer configuration is created, the specified `destination_dataset_id` + * is created when needed and shared with the appropriate data source service + * account. + */ + export interface Schema$TransferConfig { + /** + * The number of days to look back to automatically refresh the data. For + * example, if `data_refresh_window_days = 10`, then every day BigQuery + * reingests data for [today-10, today-1], rather than ingesting data for + * just [today-1]. Only valid if the data source supports the feature. Set + * the value to 0 to use the default value. + */ + dataRefreshWindowDays: number; + /** + * Output only. Region in which BigQuery dataset is located. + */ + datasetRegion: string; + /** + * Data source id. Cannot be changed once data transfer is created. + */ + dataSourceId: string; + /** + * The BigQuery target dataset id. + */ + destinationDatasetId: string; + /** + * Is this config disabled. When set to true, no runs are scheduled for a + * given transfer. + */ + disabled: boolean; + /** + * User specified display name for the data transfer. + */ + displayName: string; + /** + * The resource name of the transfer config. Transfer config names have the + * form `projects/{project_id}/transferConfigs/{config_id}`. Where + * `config_id` is usually a uuid, even though it is not guaranteed or + * required. The name is ignored when creating a transfer config. + */ + name: string; + /** + * Output only. Next time when data transfer will run. + */ + nextRunTime: string; + /** + * Data transfer specific parameters. + */ + params: any; + /** + * Data transfer schedule. If the data source does not support a custom + * schedule, this should be empty. If it is empty, the default value for the + * data source will be used. The specified times are in UTC. Examples of + * valid format: `1st,3rd monday of month 15:30`, `every wed,fri of jan,jun + * 13:15`, and `first sunday of quarter 00:00`. See more explanation about + * the format here: + * https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format + * NOTE: the granularity should be at least 8 hours, or less frequent. + */ + schedule: string; + /** + * Output only. State of the most recently updated transfer run. + */ + state: string; + /** + * Output only. Data transfer modification time. Ignored by server on input. + */ + updateTime: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. May + * be negative. Note, that this identifier is not stable. It may change over + * time even for the same user. + */ + userId: string; } - - /** - * bigquerydatatransfer.projects.transferConfigs.delete - * @desc Deletes a data transfer configuration, including any associated - * transfer runs and logs. - * @alias bigquerydatatransfer.projects.transferConfigs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a user facing message for a particular data transfer run. + */ + export interface Schema$TransferMessage { + /** + * Message text. + */ + messageText: string; + /** + * Time when message was logged. + */ + messageTime: string; + /** + * Message severity. + */ + severity: string; } - - /** - * bigquerydatatransfer.projects.transferConfigs.get - * @desc Returns information about a data transfer config. - * @alias bigquerydatatransfer.projects.transferConfigs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a data transfer run. + */ + export interface Schema$TransferRun { + /** + * Output only. Data source id. + */ + dataSourceId: string; + /** + * Output only. The BigQuery target dataset id. + */ + destinationDatasetId: string; + /** + * Output only. Time when transfer run ended. Parameter ignored by server + * for input requests. + */ + endTime: string; + /** + * Status of the transfer run. + */ + errorStatus: Schema$Status; + /** + * The resource name of the transfer run. Transfer run names have the form + * `projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}`. + * The name is ignored when creating a transfer run. + */ + name: string; + /** + * Output only. Data transfer specific parameters. + */ + params: any; + /** + * For batch transfer runs, specifies the date and time that data should be + * ingested. + */ + runTime: string; + /** + * Output only. Describes the schedule of this transfer run if it was + * created as part of a regular schedule. For batch transfer runs that are + * scheduled manually, this is empty. NOTE: the system might choose to delay + * the schedule depending on the current load, so `schedule_time` + * doesn't always matches this. + */ + schedule: string; + /** + * Minimum time after which a transfer run can be started. + */ + scheduleTime: string; + /** + * Output only. Time when transfer run was started. Parameter ignored by + * server for input requests. + */ + startTime: string; + /** + * Data transfer run state. Ignored for input requests. + */ + state: string; + /** + * Output only. Last time the data transfer run state was updated. + */ + updateTime: string; + /** + * Output only. Unique ID of the user on whose behalf transfer is done. + * Applicable only to data sources that do not support service accounts. + * When set to 0, the data source service account credentials are used. May + * be negative. Note, that this identifier is not stable. It may change over + * time even for the same user. + */ + userId: string; } - - /** - * bigquerydatatransfer.projects.transferConfigs.list - * @desc Returns information about all data transfers in the project. - * @alias bigquerydatatransfer.projects.transferConfigs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dataSourceIds When specified, only configurations of requested data sources are returned. - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent The BigQuery project id for which data sources should be returned: `projects/{project_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects { + root: Bigquerydatatransfer; + dataSources: Resource$Projects$Datasources; + locations: Resource$Projects$Locations; + transferConfigs: Resource$Projects$Transferconfigs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.dataSources = new Resource$Projects$Datasources(root); + this.locations = new Resource$Projects$Locations(root); + this.transferConfigs = new Resource$Projects$Transferconfigs(root); } - } - - /** - * bigquerydatatransfer.projects.transferConfigs.patch - * @desc Updates a data transfer configuration. All fields must be set, even - * if they are not updated. - * @alias bigquerydatatransfer.projects.transferConfigs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the transfer configuration will be associated with the authorizing user. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. - * @param {string} params.name The resource name of the transfer config. Transfer config names have the form `projects/{project_id}/transferConfigs/{config_id}`. Where `config_id` is usually a uuid, even though it is not guaranteed or required. The name is ignored when creating a transfer config. - * @param {string=} params.updateMask Required list of fields to be updated in this request. - * @param {().TransferConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - - - /** - * bigquerydatatransfer.projects.transferConfigs.scheduleRuns - * @desc Creates transfer runs for a time range [start_time, end_time]. For - * each date - or whatever granularity the data source supports - in the - * range, one transfer run is created. Note that runs are created per UTC time - * in the time range. - * @alias bigquerydatatransfer.projects.transferConfigs.scheduleRuns - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}`. - * @param {().ScheduleTransferRunsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - scheduleRuns(params?: any, options?: MethodOptions): - AxiosPromise; - scheduleRuns( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - scheduleRuns( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}:scheduleRuns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Datasources { + root: Bigquerydatatransfer; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.dataSources.checkValidCreds + * @desc Returns true if valid credentials exist for the given data source + * and requesting user. Some data sources doesn't support service account, + * so we need to talk to them on behalf of the end user. This API just + * checks whether we have OAuth token for the particular user, which is a + * pre-requisite before user can create a transfer config. + * @alias bigquerydatatransfer.projects.dataSources.checkValidCreds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` + * @param {().CheckValidCredsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + checkValidCreds(params?: any, options?: MethodOptions): + AxiosPromise; + checkValidCreds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + checkValidCreds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:checkValidCreds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.dataSources.get + * @desc Retrieves a supported data source and returns its settings, which + * can be used for UI rendering. + * @alias bigquerydatatransfer.projects.dataSources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.dataSources.list + * @desc Lists supported data sources and returns their settings, which can + * be used for UI rendering. + * @alias bigquerydatatransfer.projects.dataSources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/dataSources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Transferconfigs$Runs { - root: Bigquerydatatransfer; - transferLogs: Resource$Projects$Transferconfigs$Runs$Transferlogs; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); - this.transferLogs = - new Resource$Projects$Transferconfigs$Runs$Transferlogs(root); - } - getRoot() { - return this.root; - } - - - /** - * bigquerydatatransfer.projects.transferConfigs.runs.delete - * @desc Deletes the specified transfer run. - * @alias bigquerydatatransfer.projects.transferConfigs.runs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations { + root: Bigquerydatatransfer; + dataSources: Resource$Projects$Locations$Datasources; + transferConfigs: Resource$Projects$Locations$Transferconfigs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.dataSources = new Resource$Projects$Locations$Datasources(root); + this.transferConfigs = + new Resource$Projects$Locations$Transferconfigs(root); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.locations.get + * @desc Gets information about a location. + * @alias bigquerydatatransfer.projects.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @alias bigquerydatatransfer.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * bigquerydatatransfer.projects.transferConfigs.runs.get - * @desc Returns information about the particular transfer run. - * @alias bigquerydatatransfer.projects.transferConfigs.runs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Datasources { + root: Bigquerydatatransfer; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.locations.dataSources.checkValidCreds + * @desc Returns true if valid credentials exist for the given data source + * and requesting user. Some data sources doesn't support service account, + * so we need to talk to them on behalf of the end user. This API just + * checks whether we have OAuth token for the particular user, which is a + * pre-requisite before user can create a transfer config. + * @alias + * bigquerydatatransfer.projects.locations.dataSources.checkValidCreds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The data source in the form: `projects/{project_id}/dataSources/{data_source_id}` + * @param {().CheckValidCredsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + checkValidCreds(params?: any, options?: MethodOptions): + AxiosPromise; + checkValidCreds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + checkValidCreds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:checkValidCreds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.dataSources.get + * @desc Retrieves a supported data source and returns its settings, which + * can be used for UI rendering. + * @alias bigquerydatatransfer.projects.locations.dataSources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/dataSources/{data_source_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.dataSources.list + * @desc Lists supported data sources and returns their settings, which can + * be used for UI rendering. + * @alias bigquerydatatransfer.projects.locations.dataSources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListDataSourcesRequest` list results. For multiple-page results, `ListDataSourcesResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent The BigQuery project id for which data sources should be returned. Must be in the form: `projects/{project_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/dataSources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * bigquerydatatransfer.projects.transferConfigs.runs.list - * @desc Returns information about running and completed jobs. - * @alias bigquerydatatransfer.projects.transferConfigs.runs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}`. - * @param {string=} params.runAttempt Indicates how run attempts are to be pulled. - * @param {string=} params.states When specified, only transfer runs with requested states are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Locations$Transferconfigs { + root: Bigquerydatatransfer; + runs: Resource$Projects$Locations$Transferconfigs$Runs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.runs = new Resource$Projects$Locations$Transferconfigs$Runs(root); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.create + * @desc Creates a new data transfer configuration. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. This is required if new credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. + * @param {string} params.parent The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} If specified location and location of the destination bigquery dataset do not match - the request will fail. + * @param {().TransferConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.delete + * @desc Deletes a data transfer configuration, including any associated + * transfer runs and logs. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.get + * @desc Returns information about a data transfer config. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.list + * @desc Returns information about all data transfers in the project. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dataSourceIds When specified, only configurations of requested data sources are returned. + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent The BigQuery project id for which data sources should be returned: `projects/{project_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.patch + * @desc Updates a data transfer configuration. All fields must be set, even + * if they are not updated. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the transfer configuration will be associated with the authorizing user. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. + * @param {string} params.name The resource name of the transfer config. Transfer config names have the form `projects/{project_id}/transferConfigs/{config_id}`. Where `config_id` is usually a uuid, even though it is not guaranteed or required. The name is ignored when creating a transfer config. + * @param {string=} params.updateMask Required list of fields to be updated in this request. + * @param {().TransferConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns + * @desc Creates transfer runs for a time range [start_time, end_time]. For + * each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. Note that runs are created per UTC + * time in the time range. + * @alias + * bigquerydatatransfer.projects.locations.transferConfigs.scheduleRuns + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}`. + * @param {().ScheduleTransferRunsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + scheduleRuns(params?: any, options?: MethodOptions): + AxiosPromise; + scheduleRuns( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + scheduleRuns( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}:scheduleRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/runs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Locations$Transferconfigs$Runs { + root: Bigquerydatatransfer; + transferLogs: Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.transferLogs = + new Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs( + root); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.runs.delete + * @desc Deletes the specified transfer run. + * @alias + * bigquerydatatransfer.projects.locations.transferConfigs.runs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.runs.get + * @desc Returns information about the particular transfer run. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.runs.list + * @desc Returns information about running and completed jobs. + * @alias bigquerydatatransfer.projects.locations.transferConfigs.runs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}`. + * @param {string=} params.runAttempt Indicates how run attempts are to be pulled. + * @param {string=} params.states When specified, only transfer runs with requested states are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/runs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Transferconfigs$Runs$Transferlogs { - root: Bigquerydatatransfer; - constructor(root: Bigquerydatatransfer) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Projects$Locations$Transferconfigs$Runs$Transferlogs { + root: Bigquerydatatransfer; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list + * @desc Returns user facing log messages for the data transfer run. + * @alias + * bigquerydatatransfer.projects.locations.transferConfigs.runs.transferLogs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.messageTypes Message types to return. If not populated - INFO, WARNING and ERROR messages are returned. + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferLogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; - } - /** - * bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list - * @desc Returns user facing log messages for the data transfer run. - * @alias bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.messageTypes Message types to return. If not populated - INFO, WARNING and ERROR messages are returned. - * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. - * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. - * @param {string} params.parent Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Transferconfigs { + root: Bigquerydatatransfer; + runs: Resource$Projects$Transferconfigs$Runs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.runs = new Resource$Projects$Transferconfigs$Runs(root); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.create + * @desc Creates a new data transfer configuration. + * @alias bigquerydatatransfer.projects.transferConfigs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. This is required if new credentials are needed, as indicated by `CheckValidCreds`. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. + * @param {string} params.parent The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} If specified location and location of the destination bigquery dataset do not match - the request will fail. + * @param {().TransferConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.delete + * @desc Deletes a data transfer configuration, including any associated + * transfer runs and logs. + * @alias bigquerydatatransfer.projects.transferConfigs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.get + * @desc Returns information about a data transfer config. + * @alias bigquerydatatransfer.projects.transferConfigs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.list + * @desc Returns information about all data transfers in the project. + * @alias bigquerydatatransfer.projects.transferConfigs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dataSourceIds When specified, only configurations of requested data sources are returned. + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransfersRequest` list results. For multiple-page results, `ListTransfersResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent The BigQuery project id for which data sources should be returned: `projects/{project_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.patch + * @desc Updates a data transfer configuration. All fields must be set, even + * if they are not updated. + * @alias bigquerydatatransfer.projects.transferConfigs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.authorizationCode Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the transfer configuration will be associated with the authorizing user. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= * client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. * redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application. + * @param {string} params.name The resource name of the transfer config. Transfer config names have the form `projects/{project_id}/transferConfigs/{config_id}`. Where `config_id` is usually a uuid, even though it is not guaranteed or required. The name is ignored when creating a transfer config. + * @param {string=} params.updateMask Required list of fields to be updated in this request. + * @param {().TransferConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.scheduleRuns + * @desc Creates transfer runs for a time range [start_time, end_time]. For + * each date - or whatever granularity the data source supports - in the + * range, one transfer run is created. Note that runs are created per UTC + * time in the time range. + * @alias bigquerydatatransfer.projects.transferConfigs.scheduleRuns + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Transfer configuration name in the form: `projects/{project_id}/transferConfigs/{config_id}`. + * @param {().ScheduleTransferRunsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + scheduleRuns(params?: any, options?: MethodOptions): + AxiosPromise; + scheduleRuns( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + scheduleRuns( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}:scheduleRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Transferconfigs$Runs { + root: Bigquerydatatransfer; + transferLogs: Resource$Projects$Transferconfigs$Runs$Transferlogs; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + this.transferLogs = + new Resource$Projects$Transferconfigs$Runs$Transferlogs(root); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.runs.delete + * @desc Deletes the specified transfer run. + * @alias bigquerydatatransfer.projects.transferConfigs.runs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.runs.get + * @desc Returns information about the particular transfer run. + * @alias bigquerydatatransfer.projects.transferConfigs.runs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The field will contain name of the resource requested, for example: `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.runs.list + * @desc Returns information about running and completed jobs. + * @alias bigquerydatatransfer.projects.transferConfigs.runs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferRunsRequest` list results. For multiple-page results, `ListTransferRunsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: `projects/{project_id}/transferConfigs/{config_id}`. + * @param {string=} params.runAttempt Indicates how run attempts are to be pulled. + * @param {string=} params.states When specified, only transfer runs with requested states are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/runs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/transferLogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Transferconfigs$Runs$Transferlogs { + root: Bigquerydatatransfer; + constructor(root: Bigquerydatatransfer) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list + * @desc Returns user facing log messages for the data transfer run. + * @alias + * bigquerydatatransfer.projects.transferConfigs.runs.transferLogs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.messageTypes Message types to return. If not populated - INFO, WARNING and ERROR messages are returned. + * @param {integer=} params.pageSize Page size. The default page size is the maximum value of 1000 results. + * @param {string=} params.pageToken Pagination token, which can be used to request a specific page of `ListTransferLogsRequest` list results. For multiple-page results, `ListTransferLogsResponse` outputs a `next_page` token, which can be used as the `page_token` value to request the next page of list results. + * @param {string} params.parent Transfer run name in the form: `projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://bigquerydatatransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/transferLogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/blogger/v2.ts b/src/apis/blogger/v2.ts index 23fb7a6dbdf..96f1b1a3c1a 100644 --- a/src/apis/blogger/v2.ts +++ b/src/apis/blogger/v2.ts @@ -27,871 +27,875 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Blogger API - * - * API for access to the data within Blogger. - * - * @example - * const google = require('googleapis'); - * const blogger = google.blogger('v2'); - * - * @namespace blogger - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Blogger - */ -export class Blogger { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - blogs: Resource$Blogs; - comments: Resource$Comments; - pages: Resource$Pages; - posts: Resource$Posts; - users: Resource$Users; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.blogs = new Resource$Blogs(this); - this.comments = new Resource$Comments(this); - this.pages = new Resource$Pages(this); - this.posts = new Resource$Posts(this); - this.users = new Resource$Users(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Blog { - /** - * The description of this blog. This is displayed underneath the title. - */ - description: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * The kind of this entry. Always blogger#blog - */ - kind: string; - /** - * The locale this Blog is set to. - */ - locale: any; - /** - * The name of this blog. This is displayed as the title. - */ - name: string; - /** - * The container of pages in this blog. - */ - pages: any; - /** - * The container of posts in this blog. - */ - posts: any; - /** - * RFC 3339 date-time when this blog was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * RFC 3339 date-time when this blog was last updated. - */ - updated: string; - /** - * The URL where this blog is published. - */ - url: string; -} -export interface Schema$BlogList { - /** - * The list of Blogs this user has Authorship or Admin rights over. - */ - items: Schema$Blog[]; - /** - * The kind of this entity. Always blogger#blogList - */ - kind: string; -} -export interface Schema$Comment { - /** - * The author of this Comment. - */ - author: any; - /** - * Data about the blog containing this comment. - */ - blog: any; - /** - * The actual content of the comment. May include HTML markup. - */ - content: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * Data about the comment this is in reply to. - */ - inReplyTo: any; - /** - * The kind of this entry. Always blogger#comment - */ - kind: string; - /** - * Data about the post containing this comment. - */ - post: any; - /** - * RFC 3339 date-time when this comment was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * RFC 3339 date-time when this comment was last updated. - */ - updated: string; -} -export interface Schema$CommentList { - /** - * The List of Comments for a Post. - */ - items: Schema$Comment[]; - /** - * The kind of this entry. Always blogger#commentList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; - /** - * Pagination token to fetch the previous page, if one exists. - */ - prevPageToken: string; -} -export interface Schema$Page { - /** - * The author of this Page. - */ - author: any; - /** - * Data about the blog containing this Page. - */ - blog: any; - /** - * The body content of this Page, in HTML. - */ - content: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * The kind of this entity. Always blogger#page - */ - kind: string; - /** - * RFC 3339 date-time when this Page was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The title of this entity. This is the name displayed in the Admin user - * interface. - */ - title: string; - /** - * RFC 3339 date-time when this Page was last updated. - */ - updated: string; - /** - * The URL that this Page is displayed at. - */ - url: string; -} -export interface Schema$PageList { - /** - * The list of Pages for a Blog. - */ - items: Schema$Page[]; - /** - * The kind of this entity. Always blogger#pageList - */ - kind: string; -} -export interface Schema$Post { - /** - * The author of this Post. - */ - author: any; - /** - * Data about the blog containing this Post. - */ - blog: any; - /** - * The content of the Post. May contain HTML markup. - */ - content: string; - /** - * The identifier of this Post. - */ - id: string; - /** - * The kind of this entity. Always blogger#post - */ - kind: string; - /** - * The list of labels this Post was tagged with. - */ - labels: string[]; - /** - * RFC 3339 date-time when this Post was published. - */ - published: string; - /** - * The container of comments on this Post. - */ - replies: any; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The title of the Post. - */ - title: string; - /** - * RFC 3339 date-time when this Post was last updated. - */ - updated: string; - /** - * The URL where this Post is displayed. - */ - url: string; -} -export interface Schema$PostList { - /** - * The list of Posts for this Blog. - */ - items: Schema$Post[]; - /** - * The kind of this entity. Always blogger#postList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; - /** - * Pagination token to fetch the previous page, if one exists. - */ - prevPageToken: string; -} -export interface Schema$User { - /** - * Profile summary information. - */ - about: string; - /** - * The container of blogs for this user. - */ - blogs: any; +export namespace blogger_v2 { /** - * The timestamp of when this profile was created, in seconds since epoch. - */ - created: string; - /** - * The display name. - */ - displayName: string; - /** - * The identifier for this User. - */ - id: string; - /** - * The kind of this entity. Always blogger#user - */ - kind: string; - /** - * This user's locale - */ - locale: any; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The user's profile page. - */ - url: string; -} - -export class Resource$Blogs { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * blogger.blogs.get - * @desc Gets one blog by id. - * @alias blogger.blogs.get - * @memberOf! () + * Blogger API * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + * API for access to the data within Blogger. + * + * @example + * const google = require('googleapis'); + * const blogger = google.blogger('v2'); + * + * @namespace blogger + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Blogger + */ + export class Blogger { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + blogs: Resource$Blogs; + comments: Resource$Comments; + pages: Resource$Pages; + posts: Resource$Posts; + users: Resource$Users; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.blogs = new Resource$Blogs(this); + this.comments = new Resource$Comments(this); + this.pages = new Resource$Pages(this); + this.posts = new Resource$Posts(this); + this.users = new Resource$Users(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/blogs/{blogId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Comments { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Blog { + /** + * The description of this blog. This is displayed underneath the title. + */ + description: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * The kind of this entry. Always blogger#blog + */ + kind: string; + /** + * The locale this Blog is set to. + */ + locale: any; + /** + * The name of this blog. This is displayed as the title. + */ + name: string; + /** + * The container of pages in this blog. + */ + pages: any; + /** + * The container of posts in this blog. + */ + posts: any; + /** + * RFC 3339 date-time when this blog was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * RFC 3339 date-time when this blog was last updated. + */ + updated: string; + /** + * The URL where this blog is published. + */ + url: string; } - - getRoot() { - return this.root; + export interface Schema$BlogList { + /** + * The list of Blogs this user has Authorship or Admin rights over. + */ + items: Schema$Blog[]; + /** + * The kind of this entity. Always blogger#blogList + */ + kind: string; + } + export interface Schema$Comment { + /** + * The author of this Comment. + */ + author: any; + /** + * Data about the blog containing this comment. + */ + blog: any; + /** + * The actual content of the comment. May include HTML markup. + */ + content: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * Data about the comment this is in reply to. + */ + inReplyTo: any; + /** + * The kind of this entry. Always blogger#comment + */ + kind: string; + /** + * Data about the post containing this comment. + */ + post: any; + /** + * RFC 3339 date-time when this comment was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * RFC 3339 date-time when this comment was last updated. + */ + updated: string; + } + export interface Schema$CommentList { + /** + * The List of Comments for a Post. + */ + items: Schema$Comment[]; + /** + * The kind of this entry. Always blogger#commentList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; + /** + * Pagination token to fetch the previous page, if one exists. + */ + prevPageToken: string; + } + export interface Schema$Page { + /** + * The author of this Page. + */ + author: any; + /** + * Data about the blog containing this Page. + */ + blog: any; + /** + * The body content of this Page, in HTML. + */ + content: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * The kind of this entity. Always blogger#page + */ + kind: string; + /** + * RFC 3339 date-time when this Page was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The title of this entity. This is the name displayed in the Admin user + * interface. + */ + title: string; + /** + * RFC 3339 date-time when this Page was last updated. + */ + updated: string; + /** + * The URL that this Page is displayed at. + */ + url: string; + } + export interface Schema$PageList { + /** + * The list of Pages for a Blog. + */ + items: Schema$Page[]; + /** + * The kind of this entity. Always blogger#pageList + */ + kind: string; + } + export interface Schema$Post { + /** + * The author of this Post. + */ + author: any; + /** + * Data about the blog containing this Post. + */ + blog: any; + /** + * The content of the Post. May contain HTML markup. + */ + content: string; + /** + * The identifier of this Post. + */ + id: string; + /** + * The kind of this entity. Always blogger#post + */ + kind: string; + /** + * The list of labels this Post was tagged with. + */ + labels: string[]; + /** + * RFC 3339 date-time when this Post was published. + */ + published: string; + /** + * The container of comments on this Post. + */ + replies: any; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The title of the Post. + */ + title: string; + /** + * RFC 3339 date-time when this Post was last updated. + */ + updated: string; + /** + * The URL where this Post is displayed. + */ + url: string; + } + export interface Schema$PostList { + /** + * The list of Posts for this Blog. + */ + items: Schema$Post[]; + /** + * The kind of this entity. Always blogger#postList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; + /** + * Pagination token to fetch the previous page, if one exists. + */ + prevPageToken: string; + } + export interface Schema$User { + /** + * Profile summary information. + */ + about: string; + /** + * The container of blogs for this user. + */ + blogs: any; + /** + * The timestamp of when this profile was created, in seconds since epoch. + */ + created: string; + /** + * The display name. + */ + displayName: string; + /** + * The identifier for this User. + */ + id: string; + /** + * The kind of this entity. Always blogger#user + */ + kind: string; + /** + * This user's locale + */ + locale: any; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The user's profile page. + */ + url: string; } - - /** - * blogger.comments.get - * @desc Gets one comment by id. - * @alias blogger.comments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to containing the comment. - * @param {string} params.commentId The ID of the comment to get. - * @param {string} params.postId ID of the post to fetch posts from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Blogs { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v2/blogs/{blogId}/posts/{postId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * blogger.comments.list - * @desc Retrieves the comments for a blog, possibly filtered. - * @alias blogger.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch comments from. - * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. - * @param {integer=} params.maxResults Maximum number of comments to include in the result. - * @param {string=} params.pageToken Continuation token if request is paged. - * @param {string} params.postId ID of the post to fetch posts from. - * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/blogger/v2/blogs/{blogId}/posts/{postId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * blogger.blogs.get + * @desc Gets one blog by id. + * @alias blogger.blogs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/blogs/{blogId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Pages { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Comments { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * blogger.pages.get - * @desc Gets one blog page by id. - * @alias blogger.pages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog containing the page. - * @param {string} params.pageId The ID of the page to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * blogger.comments.get + * @desc Gets one comment by id. + * @alias blogger.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to containing the comment. + * @param {string} params.commentId The ID of the comment to get. + * @param {string} params.postId ID of the post to fetch posts from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v2/blogs/{blogId}/posts/{postId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/blogs/{blogId}/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * blogger.pages.list - * @desc Retrieves pages for a blog, possibly filtered. - * @alias blogger.pages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch pages from. - * @param {boolean=} params.fetchBodies Whether to retrieve the Page bodies. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/blogs/{blogId}/pages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * blogger.comments.list + * @desc Retrieves the comments for a blog, possibly filtered. + * @alias blogger.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch comments from. + * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. + * @param {integer=} params.maxResults Maximum number of comments to include in the result. + * @param {string=} params.pageToken Continuation token if request is paged. + * @param {string} params.postId ID of the post to fetch posts from. + * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/blogger/v2/blogs/{blogId}/posts/{postId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Posts { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Pages { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * blogger.posts.get - * @desc Get a post by id. - * @alias blogger.posts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch the post from. - * @param {string} params.postId The ID of the post - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * blogger.pages.get + * @desc Gets one blog page by id. + * @alias blogger.pages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog containing the page. + * @param {string} params.pageId The ID of the page to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/blogs/{blogId}/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * blogger.pages.list + * @desc Retrieves pages for a blog, possibly filtered. + * @alias blogger.pages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch pages from. + * @param {boolean=} params.fetchBodies Whether to retrieve the Page bodies. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/blogs/{blogId}/pages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.posts.list - * @desc Retrieves a list of posts, possibly filtered. - * @alias blogger.posts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch posts from. - * @param {boolean=} params.fetchBodies Whether the body content of posts is included. - * @param {integer=} params.maxResults Maximum number of posts to fetch. - * @param {string=} params.pageToken Continuation token if the request is paged. - * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Posts { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/blogs/{blogId}/posts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * blogger.posts.get + * @desc Get a post by id. + * @alias blogger.posts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch the post from. + * @param {string} params.postId The ID of the post + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Users { - root: Blogger; - blogs: Resource$Users$Blogs; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - this.blogs = new Resource$Users$Blogs(root); - } - getRoot() { - return this.root; + /** + * blogger.posts.list + * @desc Retrieves a list of posts, possibly filtered. + * @alias blogger.posts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch posts from. + * @param {boolean=} params.fetchBodies Whether the body content of posts is included. + * @param {integer=} params.maxResults Maximum number of posts to fetch. + * @param {string=} params.pageToken Continuation token if the request is paged. + * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/blogs/{blogId}/posts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * blogger.users.get - * @desc Gets one user by id. - * @alias blogger.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The ID of the user to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users { + root: Blogger; + blogs: Resource$Users$Blogs; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + this.blogs = new Resource$Users$Blogs(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * blogger.users.get + * @desc Gets one user by id. + * @alias blogger.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The ID of the user to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Users$Blogs { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Users$Blogs { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * blogger.users.blogs.list - * @desc Retrieves a list of blogs, possibly filtered. - * @alias blogger.users.blogs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v2/users/{userId}/blogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * blogger.users.blogs.list + * @desc Retrieves a list of blogs, possibly filtered. + * @alias blogger.users.blogs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v2/users/{userId}/blogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/blogger/v3.ts b/src/apis/blogger/v3.ts index 11ff4a05c9e..020b94917ba 100644 --- a/src/apis/blogger/v3.ts +++ b/src/apis/blogger/v3.ts @@ -27,2420 +27,2432 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Blogger API - * - * API for access to the data within Blogger. - * - * @example - * const google = require('googleapis'); - * const blogger = google.blogger('v3'); - * - * @namespace blogger - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Blogger - */ -export class Blogger { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - blogs: Resource$Blogs; - blogUserInfos: Resource$Bloguserinfos; - comments: Resource$Comments; - pages: Resource$Pages; - pageViews: Resource$Pageviews; - posts: Resource$Posts; - postUserInfos: Resource$Postuserinfos; - users: Resource$Users; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.blogs = new Resource$Blogs(this); - this.blogUserInfos = new Resource$Bloguserinfos(this); - this.comments = new Resource$Comments(this); - this.pages = new Resource$Pages(this); - this.pageViews = new Resource$Pageviews(this); - this.posts = new Resource$Posts(this); - this.postUserInfos = new Resource$Postuserinfos(this); - this.users = new Resource$Users(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Blog { - /** - * The JSON custom meta-data for the Blog - */ - customMetaData: string; - /** - * The description of this blog. This is displayed underneath the title. - */ - description: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * The kind of this entry. Always blogger#blog - */ - kind: string; - /** - * The locale this Blog is set to. - */ - locale: any; - /** - * The name of this blog. This is displayed as the title. - */ - name: string; - /** - * The container of pages in this blog. - */ - pages: any; - /** - * The container of posts in this blog. - */ - posts: any; - /** - * RFC 3339 date-time when this blog was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The status of the blog. - */ - status: string; - /** - * RFC 3339 date-time when this blog was last updated. - */ - updated: string; - /** - * The URL where this blog is published. - */ - url: string; -} -export interface Schema$BlogList { - /** - * Admin level list of blog per-user information - */ - blogUserInfos: Schema$BlogUserInfo[]; - /** - * The list of Blogs this user has Authorship or Admin rights over. - */ - items: Schema$Blog[]; - /** - * The kind of this entity. Always blogger#blogList - */ - kind: string; -} -export interface Schema$BlogPerUserInfo { - /** - * ID of the Blog resource - */ - blogId: string; - /** - * True if the user has Admin level access to the blog. - */ - hasAdminAccess: boolean; - /** - * The kind of this entity. Always blogger#blogPerUserInfo - */ - kind: string; - /** - * The Photo Album Key for the user when adding photos to the blog - */ - photosAlbumKey: string; - /** - * Access permissions that the user has for the blog (ADMIN, AUTHOR, or - * READER). - */ - role: string; - /** - * ID of the User - */ - userId: string; -} -export interface Schema$BlogUserInfo { - /** - * The Blog resource. - */ - blog: Schema$Blog; - /** - * Information about a User for the Blog. - */ - blog_user_info: Schema$BlogPerUserInfo; - /** - * The kind of this entity. Always blogger#blogUserInfo - */ - kind: string; -} -export interface Schema$Comment { - /** - * The author of this Comment. - */ - author: any; - /** - * Data about the blog containing this comment. - */ - blog: any; - /** - * The actual content of the comment. May include HTML markup. - */ - content: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * Data about the comment this is in reply to. - */ - inReplyTo: any; - /** - * The kind of this entry. Always blogger#comment - */ - kind: string; - /** - * Data about the post containing this comment. - */ - post: any; - /** - * RFC 3339 date-time when this comment was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The status of the comment (only populated for admin users) - */ - status: string; - /** - * RFC 3339 date-time when this comment was last updated. - */ - updated: string; -} -export interface Schema$CommentList { - /** - * Etag of the response. - */ - etag: string; - /** - * The List of Comments for a Post. - */ - items: Schema$Comment[]; - /** - * The kind of this entry. Always blogger#commentList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; - /** - * Pagination token to fetch the previous page, if one exists. - */ - prevPageToken: string; -} -export interface Schema$Page { - /** - * The author of this Page. - */ - author: any; - /** - * Data about the blog containing this Page. - */ - blog: any; - /** - * The body content of this Page, in HTML. - */ - content: string; - /** - * Etag of the resource. - */ - etag: string; - /** - * The identifier for this resource. - */ - id: string; - /** - * The kind of this entity. Always blogger#page - */ - kind: string; - /** - * RFC 3339 date-time when this Page was published. - */ - published: string; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The status of the page for admin resources (either LIVE or DRAFT). - */ - status: string; - /** - * The title of this entity. This is the name displayed in the Admin user - * interface. - */ - title: string; - /** - * RFC 3339 date-time when this Page was last updated. - */ - updated: string; - /** - * The URL that this Page is displayed at. - */ - url: string; -} -export interface Schema$PageList { - /** - * Etag of the response. - */ - etag: string; - /** - * The list of Pages for a Blog. - */ - items: Schema$Page[]; - /** - * The kind of this entity. Always blogger#pageList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; -} -export interface Schema$Pageviews { - /** - * Blog Id - */ - blogId: string; - /** - * The container of posts in this blog. - */ - counts: any[]; - /** - * The kind of this entry. Always blogger#page_views - */ - kind: string; -} -export interface Schema$Post { - /** - * The author of this Post. - */ - author: any; - /** - * Data about the blog containing this Post. - */ - blog: any; - /** - * The content of the Post. May contain HTML markup. - */ - content: string; - /** - * The JSON meta-data for the Post. - */ - customMetaData: string; - /** - * Etag of the resource. - */ - etag: string; - /** - * The identifier of this Post. - */ - id: string; - /** - * Display image for the Post. - */ - images: any[]; - /** - * The kind of this entity. Always blogger#post - */ - kind: string; - /** - * The list of labels this Post was tagged with. - */ - labels: string[]; - /** - * The location for geotagged posts. - */ - location: any; - /** - * RFC 3339 date-time when this Post was published. - */ - published: string; - /** - * Comment control and display setting for readers of this post. - */ - readerComments: string; - /** - * The container of comments on this Post. - */ - replies: any; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * Status of the post. Only set for admin-level requests - */ - status: string; - /** - * The title of the Post. - */ - title: string; - /** - * The title link URL, similar to atom's related link. - */ - titleLink: string; - /** - * RFC 3339 date-time when this Post was last updated. - */ - updated: string; - /** - * The URL where this Post is displayed. - */ - url: string; -} -export interface Schema$PostList { - /** - * Etag of the response. - */ - etag: string; - /** - * The list of Posts for this Blog. - */ - items: Schema$Post[]; - /** - * The kind of this entity. Always blogger#postList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; -} -export interface Schema$PostPerUserInfo { - /** - * ID of the Blog that the post resource belongs to. - */ - blogId: string; - /** - * True if the user has Author level access to the post. - */ - hasEditAccess: boolean; - /** - * The kind of this entity. Always blogger#postPerUserInfo - */ - kind: string; - /** - * ID of the Post resource. - */ - postId: string; - /** - * ID of the User. - */ - userId: string; -} -export interface Schema$PostUserInfo { - /** - * The kind of this entity. Always blogger#postUserInfo - */ - kind: string; - /** - * The Post resource. - */ - post: Schema$Post; - /** - * Information about a User for the Post. - */ - post_user_info: Schema$PostPerUserInfo; -} -export interface Schema$PostUserInfosList { - /** - * The list of Posts with User information for the post, for this Blog. - */ - items: Schema$PostUserInfo[]; - /** - * The kind of this entity. Always blogger#postList - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; -} -export interface Schema$User { - /** - * Profile summary information. - */ - about: string; - /** - * The container of blogs for this user. - */ - blogs: any; - /** - * The timestamp of when this profile was created, in seconds since epoch. - */ - created: string; - /** - * The display name. - */ - displayName: string; - /** - * The identifier for this User. - */ - id: string; - /** - * The kind of this entity. Always blogger#user - */ - kind: string; - /** - * This user's locale - */ - locale: any; - /** - * The API REST URL to fetch this resource from. - */ - selfLink: string; - /** - * The user's profile page. - */ - url: string; -} - -export class Resource$Blogs { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * blogger.blogs.get - * @desc Gets one blog by ID. - * @alias blogger.blogs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog to get. - * @param {integer=} params.maxPosts Maximum number of posts to pull back with the blog. - * @param {string=} params.view Access level with which to view the blog. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.blogs.getByUrl - * @desc Retrieve a Blog by URL. - * @alias blogger.blogs.getByUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.url The URL of the blog to retrieve. - * @param {string=} params.view Access level with which to view the blog. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getByUrl(params?: any, options?: MethodOptions): AxiosPromise; - getByUrl( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getByUrl( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/byurl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['url'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.blogs.listByUser - * @desc Retrieves a list of blogs, possibly filtered. - * @alias blogger.blogs.listByUser - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.fetchUserInfo Whether the response is a list of blogs with per-user information instead of just blogs. - * @param {string=} params.role User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, defaults to ADMIN and AUTHOR roles. - * @param {string=} params.status Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs. - * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. - * @param {string=} params.view Access level with which to view the blogs. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByUser(params?: any, options?: MethodOptions): - AxiosPromise; - listByUser( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByUser( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/users/{userId}/blogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Bloguserinfos { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * blogger.blogUserInfos.get - * @desc Gets one blog and user info pair by blogId and userId. - * @alias blogger.blogUserInfos.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog to get. - * @param {integer=} params.maxPosts Maximum number of posts to pull back with the blog. - * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/users/{userId}/blogs/{blogId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'blogId'], - pathParams: ['blogId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Comments { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * blogger.comments.approve - * @desc Marks a comment as not spam. - * @alias blogger.comments.approve - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.commentId The ID of the comment to mark as not spam. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - approve(params?: any, options?: MethodOptions): AxiosPromise; - approve( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - approve( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.delete - * @desc Delete a comment by ID. - * @alias blogger.comments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.commentId The ID of the comment to delete. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.get - * @desc Gets one comment by ID. - * @alias blogger.comments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to containing the comment. - * @param {string} params.commentId The ID of the comment to get. - * @param {string} params.postId ID of the post to fetch posts from. - * @param {string=} params.view Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the parent posts which is in a draft state, or comments that are pending moderation. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.list - * @desc Retrieves the comments for a post, possibly filtered. - * @alias blogger.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch comments from. - * @param {string=} params.endDate Latest date of comment to fetch, a date-time with RFC 3339 formatting. - * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. - * @param {integer=} params.maxResults Maximum number of comments to include in the result. - * @param {string=} params.pageToken Continuation token if request is paged. - * @param {string} params.postId ID of the post to fetch posts from. - * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. - * @param {string=} params.status - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.listByBlog - * @desc Retrieves the comments for a blog, across all posts, possibly - * filtered. - * @alias blogger.comments.listByBlog - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch comments from. - * @param {string=} params.endDate Latest date of comment to fetch, a date-time with RFC 3339 formatting. - * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. - * @param {integer=} params.maxResults Maximum number of comments to include in the result. - * @param {string=} params.pageToken Continuation token if request is paged. - * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. - * @param {string=} params.status - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByBlog(params?: any, options?: MethodOptions): - AxiosPromise; - listByBlog( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByBlog( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.markAsSpam - * @desc Marks a comment as spam. - * @alias blogger.comments.markAsSpam - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.commentId The ID of the comment to mark as spam. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - markAsSpam(params?: any, options?: MethodOptions): - AxiosPromise; - markAsSpam( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - markAsSpam( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.comments.removeContent - * @desc Removes the content of a comment. - * @alias blogger.comments.removeContent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.commentId The ID of the comment to delete content from. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeContent(params?: any, options?: MethodOptions): - AxiosPromise; - removeContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'postId', 'commentId'], - pathParams: ['blogId', 'commentId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Pages { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace blogger_v3 { /** - * blogger.pages.delete - * @desc Delete a page by ID. - * @alias blogger.pages.delete - * @memberOf! () + * Blogger API * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.pageId The ID of the Page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.pages.get - * @desc Gets one blog page by ID. - * @alias blogger.pages.get - * @memberOf! () + * API for access to the data within Blogger. * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog containing the page. - * @param {string} params.pageId The ID of the page to get. - * @param {string=} params.view - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * blogger.pages.insert - * @desc Add a page. - * @alias blogger.pages.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const blogger = google.blogger('v3'); * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to add the page to. - * @param {boolean=} params.isDraft Whether to create the page as a draft (default: false). - * @param {().Page} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace blogger + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Blogger + */ + export class Blogger { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + blogs: Resource$Blogs; + blogUserInfos: Resource$Bloguserinfos; + comments: Resource$Comments; + pages: Resource$Pages; + pageViews: Resource$Pageviews; + posts: Resource$Posts; + postUserInfos: Resource$Postuserinfos; + users: Resource$Users; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.blogs = new Resource$Blogs(this); + this.blogUserInfos = new Resource$Bloguserinfos(this); + this.comments = new Resource$Comments(this); + this.pages = new Resource$Pages(this); + this.pageViews = new Resource$Pageviews(this); + this.posts = new Resource$Posts(this); + this.postUserInfos = new Resource$Postuserinfos(this); + this.users = new Resource$Users(this); + } + + getRoot() { + return this.root; } } - - /** - * blogger.pages.list - * @desc Retrieves the pages for a blog, optionally including non-LIVE - * statuses. - * @alias blogger.pages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch Pages from. - * @param {boolean=} params.fetchBodies Whether to retrieve the Page bodies. - * @param {integer=} params.maxResults Maximum number of Pages to fetch. - * @param {string=} params.pageToken Continuation token if the request is paged. - * @param {string=} params.status - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Blog { + /** + * The JSON custom meta-data for the Blog + */ + customMetaData: string; + /** + * The description of this blog. This is displayed underneath the title. + */ + description: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * The kind of this entry. Always blogger#blog + */ + kind: string; + /** + * The locale this Blog is set to. + */ + locale: any; + /** + * The name of this blog. This is displayed as the title. + */ + name: string; + /** + * The container of pages in this blog. + */ + pages: any; + /** + * The container of posts in this blog. + */ + posts: any; + /** + * RFC 3339 date-time when this blog was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The status of the blog. + */ + status: string; + /** + * RFC 3339 date-time when this blog was last updated. + */ + updated: string; + /** + * The URL where this blog is published. + */ + url: string; } - - - /** - * blogger.pages.patch - * @desc Update a page. This method supports patch semantics. - * @alias blogger.pages.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.pageId The ID of the Page. - * @param {boolean=} params.publish Whether a publish action should be performed when the page is updated (default: false). - * @param {boolean=} params.revert Whether a revert action should be performed when the page is updated (default: false). - * @param {().Page} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BlogList { + /** + * Admin level list of blog per-user information + */ + blogUserInfos: Schema$BlogUserInfo[]; + /** + * The list of Blogs this user has Authorship or Admin rights over. + */ + items: Schema$Blog[]; + /** + * The kind of this entity. Always blogger#blogList + */ + kind: string; } - - - /** - * blogger.pages.publish - * @desc Publishes a draft page. - * @alias blogger.pages.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): AxiosPromise; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}/publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BlogPerUserInfo { + /** + * ID of the Blog resource + */ + blogId: string; + /** + * True if the user has Admin level access to the blog. + */ + hasAdminAccess: boolean; + /** + * The kind of this entity. Always blogger#blogPerUserInfo + */ + kind: string; + /** + * The Photo Album Key for the user when adding photos to the blog + */ + photosAlbumKey: string; + /** + * Access permissions that the user has for the blog (ADMIN, AUTHOR, or + * READER). + */ + role: string; + /** + * ID of the User + */ + userId: string; } - - - /** - * blogger.pages.revert - * @desc Revert a published or scheduled page to draft state. - * @alias blogger.pages.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog. - * @param {string} params.pageId The ID of the page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): AxiosPromise; - revert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}/revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BlogUserInfo { + /** + * The Blog resource. + */ + blog: Schema$Blog; + /** + * Information about a User for the Blog. + */ + blog_user_info: Schema$BlogPerUserInfo; + /** + * The kind of this entity. Always blogger#blogUserInfo + */ + kind: string; } - - - /** - * blogger.pages.update - * @desc Update a page. - * @alias blogger.pages.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.pageId The ID of the Page. - * @param {boolean=} params.publish Whether a publish action should be performed when the page is updated (default: false). - * @param {boolean=} params.revert Whether a revert action should be performed when the page is updated (default: false). - * @param {().Page} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['blogId', 'pageId'], - pathParams: ['blogId', 'pageId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Comment { + /** + * The author of this Comment. + */ + author: any; + /** + * Data about the blog containing this comment. + */ + blog: any; + /** + * The actual content of the comment. May include HTML markup. + */ + content: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * Data about the comment this is in reply to. + */ + inReplyTo: any; + /** + * The kind of this entry. Always blogger#comment + */ + kind: string; + /** + * Data about the post containing this comment. + */ + post: any; + /** + * RFC 3339 date-time when this comment was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The status of the comment (only populated for admin users) + */ + status: string; + /** + * RFC 3339 date-time when this comment was last updated. + */ + updated: string; } -} - -export class Resource$Pageviews { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CommentList { + /** + * Etag of the response. + */ + etag: string; + /** + * The List of Comments for a Post. + */ + items: Schema$Comment[]; + /** + * The kind of this entry. Always blogger#commentList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; + /** + * Pagination token to fetch the previous page, if one exists. + */ + prevPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$Page { + /** + * The author of this Page. + */ + author: any; + /** + * Data about the blog containing this Page. + */ + blog: any; + /** + * The body content of this Page, in HTML. + */ + content: string; + /** + * Etag of the resource. + */ + etag: string; + /** + * The identifier for this resource. + */ + id: string; + /** + * The kind of this entity. Always blogger#page + */ + kind: string; + /** + * RFC 3339 date-time when this Page was published. + */ + published: string; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The status of the page for admin resources (either LIVE or DRAFT). + */ + status: string; + /** + * The title of this entity. This is the name displayed in the Admin user + * interface. + */ + title: string; + /** + * RFC 3339 date-time when this Page was last updated. + */ + updated: string; + /** + * The URL that this Page is displayed at. + */ + url: string; } - - - /** - * blogger.pageViews.get - * @desc Retrieve pageview stats for a Blog. - * @alias blogger.pageViews.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog to get. - * @param {string=} params.range - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/pageviews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PageList { + /** + * Etag of the response. + */ + etag: string; + /** + * The list of Pages for a Blog. + */ + items: Schema$Page[]; + /** + * The kind of this entity. Always blogger#pageList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; } -} - -export class Resource$Posts { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Pageviews { + /** + * Blog Id + */ + blogId: string; + /** + * The container of posts in this blog. + */ + counts: any[]; + /** + * The kind of this entry. Always blogger#page_views + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$Post { + /** + * The author of this Post. + */ + author: any; + /** + * Data about the blog containing this Post. + */ + blog: any; + /** + * The content of the Post. May contain HTML markup. + */ + content: string; + /** + * The JSON meta-data for the Post. + */ + customMetaData: string; + /** + * Etag of the resource. + */ + etag: string; + /** + * The identifier of this Post. + */ + id: string; + /** + * Display image for the Post. + */ + images: any[]; + /** + * The kind of this entity. Always blogger#post + */ + kind: string; + /** + * The list of labels this Post was tagged with. + */ + labels: string[]; + /** + * The location for geotagged posts. + */ + location: any; + /** + * RFC 3339 date-time when this Post was published. + */ + published: string; + /** + * Comment control and display setting for readers of this post. + */ + readerComments: string; + /** + * The container of comments on this Post. + */ + replies: any; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * Status of the post. Only set for admin-level requests + */ + status: string; + /** + * The title of the Post. + */ + title: string; + /** + * The title link URL, similar to atom's related link. + */ + titleLink: string; + /** + * RFC 3339 date-time when this Post was last updated. + */ + updated: string; + /** + * The URL where this Post is displayed. + */ + url: string; } - - - /** - * blogger.posts.delete - * @desc Delete a post by ID. - * @alias blogger.posts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostList { + /** + * Etag of the response. + */ + etag: string; + /** + * The list of Posts for this Blog. + */ + items: Schema$Post[]; + /** + * The kind of this entity. Always blogger#postList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; } - - - /** - * blogger.posts.get - * @desc Get a post by ID. - * @alias blogger.posts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch the post from. - * @param {boolean=} params.fetchBody Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. - * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included (default: false). - * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. - * @param {string} params.postId The ID of the post - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostPerUserInfo { + /** + * ID of the Blog that the post resource belongs to. + */ + blogId: string; + /** + * True if the user has Author level access to the post. + */ + hasEditAccess: boolean; + /** + * The kind of this entity. Always blogger#postPerUserInfo + */ + kind: string; + /** + * ID of the Post resource. + */ + postId: string; + /** + * ID of the User. + */ + userId: string; } - - - /** - * blogger.posts.getByPath - * @desc Retrieve a Post by Path. - * @alias blogger.posts.getByPath - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch the post from. - * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. - * @param {string} params.path Path of the Post to retrieve. - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getByPath(params?: any, options?: MethodOptions): AxiosPromise; - getByPath( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getByPath( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/bypath') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'path'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostUserInfo { + /** + * The kind of this entity. Always blogger#postUserInfo + */ + kind: string; + /** + * The Post resource. + */ + post: Schema$Post; + /** + * Information about a User for the Post. + */ + post_user_info: Schema$PostPerUserInfo; } - - - /** - * blogger.posts.insert - * @desc Add a post. - * @alias blogger.posts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to add the post to. - * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). - * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). - * @param {boolean=} params.isDraft Whether to create the post as a draft (default: false). - * @param {().Post} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostUserInfosList { + /** + * The list of Posts with User information for the post, for this Blog. + */ + items: Schema$PostUserInfo[]; + /** + * The kind of this entity. Always blogger#postList + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; } - - - /** - * blogger.posts.list - * @desc Retrieves a list of posts, possibly filtered. - * @alias blogger.posts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch posts from. - * @param {string=} params.endDate Latest post date to fetch, a date-time with RFC 3339 formatting. - * @param {boolean=} params.fetchBodies Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. - * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included. - * @param {string=} params.labels Comma-separated list of labels to search for. - * @param {integer=} params.maxResults Maximum number of posts to fetch. - * @param {string=} params.orderBy Sort search results - * @param {string=} params.pageToken Continuation token if the request is paged. - * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. - * @param {string=} params.status Statuses to include in the results. - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require escalated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$User { + /** + * Profile summary information. + */ + about: string; + /** + * The container of blogs for this user. + */ + blogs: any; + /** + * The timestamp of when this profile was created, in seconds since epoch. + */ + created: string; + /** + * The display name. + */ + displayName: string; + /** + * The identifier for this User. + */ + id: string; + /** + * The kind of this entity. Always blogger#user + */ + kind: string; + /** + * This user's locale + */ + locale: any; + /** + * The API REST URL to fetch this resource from. + */ + selfLink: string; + /** + * The user's profile page. + */ + url: string; } - - /** - * blogger.posts.patch - * @desc Update a post. This method supports patch semantics. - * @alias blogger.posts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). - * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). - * @param {integer=} params.maxComments Maximum number of comments to retrieve with the returned post. - * @param {string} params.postId The ID of the Post. - * @param {boolean=} params.publish Whether a publish action should be performed when the post is updated (default: false). - * @param {boolean=} params.revert Whether a revert action should be performed when the post is updated (default: false). - * @param {().Post} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Blogs { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.blogs.get + * @desc Gets one blog by ID. + * @alias blogger.blogs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog to get. + * @param {integer=} params.maxPosts Maximum number of posts to pull back with the blog. + * @param {string=} params.view Access level with which to view the blog. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.blogs.getByUrl + * @desc Retrieve a Blog by URL. + * @alias blogger.blogs.getByUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.url The URL of the blog to retrieve. + * @param {string=} params.view Access level with which to view the blog. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getByUrl(params?: any, options?: MethodOptions): AxiosPromise; + getByUrl( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getByUrl( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/byurl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['url'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.blogs.listByUser + * @desc Retrieves a list of blogs, possibly filtered. + * @alias blogger.blogs.listByUser + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.fetchUserInfo Whether the response is a list of blogs with per-user information instead of just blogs. + * @param {string=} params.role User access types for blogs to include in the results, e.g. AUTHOR will return blogs where the user has author level access. If no roles are specified, defaults to ADMIN and AUTHOR roles. + * @param {string=} params.status Blog statuses to include in the result (default: Live blogs only). Note that ADMIN access is required to view deleted blogs. + * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. + * @param {string=} params.view Access level with which to view the blogs. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByUser(params?: any, options?: MethodOptions): + AxiosPromise; + listByUser( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByUser( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/users/{userId}/blogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.posts.publish - * @desc Publishes a draft post, optionally at the specific time of the given - * publishDate parameter. - * @alias blogger.posts.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.postId The ID of the Post. - * @param {string=} params.publishDate Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): AxiosPromise; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}/publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bloguserinfos { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.blogUserInfos.get + * @desc Gets one blog and user info pair by blogId and userId. + * @alias blogger.blogUserInfos.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog to get. + * @param {integer=} params.maxPosts Maximum number of posts to pull back with the blog. + * @param {string} params.userId ID of the user whose blogs are to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/users/{userId}/blogs/{blogId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'blogId'], + pathParams: ['blogId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.posts.revert - * @desc Revert a published or scheduled post to draft state. - * @alias blogger.posts.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {string} params.postId The ID of the Post. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): AxiosPromise; - revert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}/revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Comments { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.comments.approve + * @desc Marks a comment as not spam. + * @alias blogger.comments.approve + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.commentId The ID of the comment to mark as not spam. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + approve(params?: any, options?: MethodOptions): + AxiosPromise; + approve( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + approve( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.delete + * @desc Delete a comment by ID. + * @alias blogger.comments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.commentId The ID of the comment to delete. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.get + * @desc Gets one comment by ID. + * @alias blogger.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to containing the comment. + * @param {string} params.commentId The ID of the comment to get. + * @param {string} params.postId ID of the post to fetch posts from. + * @param {string=} params.view Access level for the requested comment (default: READER). Note that some comments will require elevated permissions, for example comments where the parent posts which is in a draft state, or comments that are pending moderation. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.list + * @desc Retrieves the comments for a post, possibly filtered. + * @alias blogger.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch comments from. + * @param {string=} params.endDate Latest date of comment to fetch, a date-time with RFC 3339 formatting. + * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. + * @param {integer=} params.maxResults Maximum number of comments to include in the result. + * @param {string=} params.pageToken Continuation token if request is paged. + * @param {string} params.postId ID of the post to fetch posts from. + * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. + * @param {string=} params.status + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.listByBlog + * @desc Retrieves the comments for a blog, across all posts, possibly + * filtered. + * @alias blogger.comments.listByBlog + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch comments from. + * @param {string=} params.endDate Latest date of comment to fetch, a date-time with RFC 3339 formatting. + * @param {boolean=} params.fetchBodies Whether the body content of the comments is included. + * @param {integer=} params.maxResults Maximum number of comments to include in the result. + * @param {string=} params.pageToken Continuation token if request is paged. + * @param {string=} params.startDate Earliest date of comment to fetch, a date-time with RFC 3339 formatting. + * @param {string=} params.status + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByBlog(params?: any, options?: MethodOptions): + AxiosPromise; + listByBlog( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByBlog( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.markAsSpam + * @desc Marks a comment as spam. + * @alias blogger.comments.markAsSpam + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.commentId The ID of the comment to mark as spam. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + markAsSpam(params?: any, options?: MethodOptions): + AxiosPromise; + markAsSpam( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + markAsSpam( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.comments.removeContent + * @desc Removes the content of a comment. + * @alias blogger.comments.removeContent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.commentId The ID of the comment to delete content from. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeContent(params?: any, options?: MethodOptions): + AxiosPromise; + removeContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/removecontent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'postId', 'commentId'], + pathParams: ['blogId', 'commentId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.posts.search - * @desc Search for a post. - * @alias blogger.posts.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch the post from. - * @param {boolean=} params.fetchBodies Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. - * @param {string=} params.orderBy Sort search results - * @param {string} params.q Query terms to search this blog for matching posts. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['blogId', 'q'], - pathParams: ['blogId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Pages { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.pages.delete + * @desc Delete a page by ID. + * @alias blogger.pages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.pageId The ID of the Page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.get + * @desc Gets one blog page by ID. + * @alias blogger.pages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog containing the page. + * @param {string} params.pageId The ID of the page to get. + * @param {string=} params.view + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.insert + * @desc Add a page. + * @alias blogger.pages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to add the page to. + * @param {boolean=} params.isDraft Whether to create the page as a draft (default: false). + * @param {().Page} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.list + * @desc Retrieves the pages for a blog, optionally including non-LIVE + * statuses. + * @alias blogger.pages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch Pages from. + * @param {boolean=} params.fetchBodies Whether to retrieve the Page bodies. + * @param {integer=} params.maxResults Maximum number of Pages to fetch. + * @param {string=} params.pageToken Continuation token if the request is paged. + * @param {string=} params.status + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.patch + * @desc Update a page. This method supports patch semantics. + * @alias blogger.pages.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.pageId The ID of the Page. + * @param {boolean=} params.publish Whether a publish action should be performed when the page is updated (default: false). + * @param {boolean=} params.revert Whether a revert action should be performed when the page is updated (default: false). + * @param {().Page} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.publish + * @desc Publishes a draft page. + * @alias blogger.pages.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): AxiosPromise; + publish( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publish( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/blogger/v3/blogs/{blogId}/pages/{pageId}/publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.revert + * @desc Revert a published or scheduled page to draft state. + * @alias blogger.pages.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog. + * @param {string} params.pageId The ID of the page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): AxiosPromise; + revert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}/revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.pages.update + * @desc Update a page. + * @alias blogger.pages.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.pageId The ID of the Page. + * @param {boolean=} params.publish Whether a publish action should be performed when the page is updated (default: false). + * @param {boolean=} params.revert Whether a revert action should be performed when the page is updated (default: false). + * @param {().Page} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pages/{pageId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['blogId', 'pageId'], + pathParams: ['blogId', 'pageId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.posts.update - * @desc Update a post. - * @alias blogger.posts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the Blog. - * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). - * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). - * @param {integer=} params.maxComments Maximum number of comments to retrieve with the returned post. - * @param {string} params.postId The ID of the Post. - * @param {boolean=} params.publish Whether a publish action should be performed when the post is updated (default: false). - * @param {boolean=} params.revert Whether a revert action should be performed when the post is updated (default: false). - * @param {().Post} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['blogId', 'postId'], - pathParams: ['blogId', 'postId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Pageviews { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.pageViews.get + * @desc Retrieve pageview stats for a Blog. + * @alias blogger.pageViews.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog to get. + * @param {string=} params.range + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/pageviews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Postuserinfos { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * blogger.postUserInfos.get - * @desc Gets one post and user info pair, by post ID and user ID. The post - * user info contains per-user information about the post, such as access - * rights, specific to the user. - * @alias blogger.postUserInfos.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId The ID of the blog. - * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. - * @param {string} params.postId The ID of the post to get. - * @param {string} params.userId ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/blogger/v3/users/{userId}/blogs/{blogId}/posts/{postId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'blogId', 'postId'], - pathParams: ['blogId', 'postId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Posts { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.posts.delete + * @desc Delete a post by ID. + * @alias blogger.posts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.get + * @desc Get a post by ID. + * @alias blogger.posts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch the post from. + * @param {boolean=} params.fetchBody Whether the body content of the post is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. + * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included (default: false). + * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. + * @param {string} params.postId The ID of the post + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.getByPath + * @desc Retrieve a Post by Path. + * @alias blogger.posts.getByPath + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch the post from. + * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. + * @param {string} params.path Path of the Post to retrieve. + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getByPath(params?: any, options?: MethodOptions): AxiosPromise; + getByPath( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getByPath( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/bypath') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'path'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.insert + * @desc Add a post. + * @alias blogger.posts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to add the post to. + * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). + * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). + * @param {boolean=} params.isDraft Whether to create the post as a draft (default: false). + * @param {().Post} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.list + * @desc Retrieves a list of posts, possibly filtered. + * @alias blogger.posts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch posts from. + * @param {string=} params.endDate Latest post date to fetch, a date-time with RFC 3339 formatting. + * @param {boolean=} params.fetchBodies Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. + * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included. + * @param {string=} params.labels Comma-separated list of labels to search for. + * @param {integer=} params.maxResults Maximum number of posts to fetch. + * @param {string=} params.orderBy Sort search results + * @param {string=} params.pageToken Continuation token if the request is paged. + * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. + * @param {string=} params.status Statuses to include in the results. + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require escalated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.patch + * @desc Update a post. This method supports patch semantics. + * @alias blogger.posts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). + * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). + * @param {integer=} params.maxComments Maximum number of comments to retrieve with the returned post. + * @param {string} params.postId The ID of the Post. + * @param {boolean=} params.publish Whether a publish action should be performed when the post is updated (default: false). + * @param {boolean=} params.revert Whether a revert action should be performed when the post is updated (default: false). + * @param {().Post} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.publish + * @desc Publishes a draft post, optionally at the specific time of the + * given publishDate parameter. + * @alias blogger.posts.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.postId The ID of the Post. + * @param {string=} params.publishDate Optional date and time to schedule the publishing of the Blog. If no publishDate parameter is given, the post is either published at the a previously saved schedule date (if present), or the current time. If a future date is given, the post will be scheduled to be published. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): AxiosPromise; + publish( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publish( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/blogger/v3/blogs/{blogId}/posts/{postId}/publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.revert + * @desc Revert a published or scheduled post to draft state. + * @alias blogger.posts.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {string} params.postId The ID of the Post. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): AxiosPromise; + revert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}/revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.search + * @desc Search for a post. + * @alias blogger.posts.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch the post from. + * @param {boolean=} params.fetchBodies Whether the body content of posts is included (default: true). This should be set to false when the post bodies are not required, to help minimize traffic. + * @param {string=} params.orderBy Sort search results + * @param {string} params.q Query terms to search this blog for matching posts. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['blogId', 'q'], + pathParams: ['blogId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.posts.update + * @desc Update a post. + * @alias blogger.posts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the Blog. + * @param {boolean=} params.fetchBody Whether the body content of the post is included with the result (default: true). + * @param {boolean=} params.fetchImages Whether image URL metadata for each post is included in the returned result (default: false). + * @param {integer=} params.maxComments Maximum number of comments to retrieve with the returned post. + * @param {string} params.postId The ID of the Post. + * @param {boolean=} params.publish Whether a publish action should be performed when the post is updated (default: false). + * @param {boolean=} params.revert Whether a revert action should be performed when the post is updated (default: false). + * @param {().Post} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['blogId', 'postId'], + pathParams: ['blogId', 'postId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * blogger.postUserInfos.list - * @desc Retrieves a list of post and post user info pairs, possibly filtered. - * The post user info contains per-user information about the post, such as - * access rights, specific to the user. - * @alias blogger.postUserInfos.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.blogId ID of the blog to fetch posts from. - * @param {string=} params.endDate Latest post date to fetch, a date-time with RFC 3339 formatting. - * @param {boolean=} params.fetchBodies Whether the body content of posts is included. Default is false. - * @param {string=} params.labels Comma-separated list of labels to search for. - * @param {integer=} params.maxResults Maximum number of posts to fetch. - * @param {string=} params.orderBy Sort order applied to search results. Default is published. - * @param {string=} params.pageToken Continuation token if the request is paged. - * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. - * @param {string=} params.status - * @param {string} params.userId ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. - * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Postuserinfos { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.postUserInfos.get + * @desc Gets one post and user info pair, by post ID and user ID. The post + * user info contains per-user information about the post, such as access + * rights, specific to the user. + * @alias blogger.postUserInfos.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId The ID of the blog. + * @param {integer=} params.maxComments Maximum number of comments to pull back on a post. + * @param {string} params.postId The ID of the post to get. + * @param {string} params.userId ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/blogger/v3/users/{userId}/blogs/{blogId}/posts/{postId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'blogId', 'postId'], + pathParams: ['blogId', 'postId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * blogger.postUserInfos.list + * @desc Retrieves a list of post and post user info pairs, possibly + * filtered. The post user info contains per-user information about the + * post, such as access rights, specific to the user. + * @alias blogger.postUserInfos.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.blogId ID of the blog to fetch posts from. + * @param {string=} params.endDate Latest post date to fetch, a date-time with RFC 3339 formatting. + * @param {boolean=} params.fetchBodies Whether the body content of posts is included. Default is false. + * @param {string=} params.labels Comma-separated list of labels to search for. + * @param {integer=} params.maxResults Maximum number of posts to fetch. + * @param {string=} params.orderBy Sort order applied to search results. Default is published. + * @param {string=} params.pageToken Continuation token if the request is paged. + * @param {string=} params.startDate Earliest post date to fetch, a date-time with RFC 3339 formatting. + * @param {string=} params.status + * @param {string} params.userId ID of the user for the per-user information to be fetched. Either the word 'self' (sans quote marks) or the user's profile identifier. + * @param {string=} params.view Access level with which to view the returned result. Note that some fields require elevated access. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/users/{userId}/blogs/{blogId}/posts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'blogId'], + pathParams: ['blogId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/users/{userId}/blogs/{blogId}/posts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'blogId'], - pathParams: ['blogId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users { - root: Blogger; - constructor(root: Blogger) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; - } - - - /** - * blogger.users.get - * @desc Gets one user by ID. - * @alias blogger.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The ID of the user to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/blogger/v3/users/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Users { + root: Blogger; + constructor(root: Blogger) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * blogger.users.get + * @desc Gets one user by ID. + * @alias blogger.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The ID of the user to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/blogger/v3/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/books/v1.ts b/src/apis/books/v1.ts index 81e0ffbaa97..52d8442948d 100644 --- a/src/apis/books/v1.ts +++ b/src/apis/books/v1.ts @@ -27,4047 +27,4072 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Books API - * - * Searches for books and manages your Google Books library. - * - * @example - * const google = require('googleapis'); - * const books = google.books('v1'); - * - * @namespace books - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Books - */ -export class Books { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - bookshelves: Resource$Bookshelves; - cloudloading: Resource$Cloudloading; - dictionary: Resource$Dictionary; - familysharing: Resource$Familysharing; - layers: Resource$Layers; - myconfig: Resource$Myconfig; - mylibrary: Resource$Mylibrary; - notification: Resource$Notification; - onboarding: Resource$Onboarding; - personalizedstream: Resource$Personalizedstream; - promooffer: Resource$Promooffer; - series: Resource$Series; - volumes: Resource$Volumes; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.bookshelves = new Resource$Bookshelves(this); - this.cloudloading = new Resource$Cloudloading(this); - this.dictionary = new Resource$Dictionary(this); - this.familysharing = new Resource$Familysharing(this); - this.layers = new Resource$Layers(this); - this.myconfig = new Resource$Myconfig(this); - this.mylibrary = new Resource$Mylibrary(this); - this.notification = new Resource$Notification(this); - this.onboarding = new Resource$Onboarding(this); - this.personalizedstream = new Resource$Personalizedstream(this); - this.promooffer = new Resource$Promooffer(this); - this.series = new Resource$Series(this); - this.volumes = new Resource$Volumes(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Annotation { - /** - * Anchor text after excerpt. For requests, if the user bookmarked a screen - * that has no flowing text on it, then this field should be empty. - */ - afterSelectedText: string; - /** - * Anchor text before excerpt. For requests, if the user bookmarked a screen - * that has no flowing text on it, then this field should be empty. - */ - beforeSelectedText: string; - /** - * Selection ranges sent from the client. - */ - clientVersionRanges: any; - /** - * Timestamp for the created time of this annotation. - */ - created: string; - /** - * Selection ranges for the most recent content version. - */ - currentVersionRanges: any; - /** - * User-created data for this annotation. - */ - data: string; - /** - * Indicates that this annotation is deleted. - */ - deleted: boolean; - /** - * The highlight style for this annotation. - */ - highlightStyle: string; - /** - * Id of this annotation, in the form of a GUID. - */ - id: string; - /** - * Resource type. - */ - kind: string; - /** - * The layer this annotation is for. - */ - layerId: string; - layerSummary: any; - /** - * Pages that this annotation spans. - */ - pageIds: string[]; - /** - * Excerpt from the volume. - */ - selectedText: string; - /** - * URL to this resource. - */ - selfLink: string; - /** - * Timestamp for the last time this annotation was modified. - */ - updated: string; - /** - * The volume that this annotation belongs to. - */ - volumeId: string; -} -export interface Schema$Annotationdata { - /** - * The type of annotation this data is for. - */ - annotationType: string; - data: any; - /** - * Base64 encoded data for this annotation data. - */ - encoded_data: string; - /** - * Unique id for this annotation data. - */ - id: string; - /** - * Resource Type - */ - kind: string; - /** - * The Layer id for this data. * - */ - layerId: string; - /** - * URL for this resource. * - */ - selfLink: string; - /** - * Timestamp for the last time this data was updated. (RFC 3339 UTC date-time - * format). - */ - updated: string; - /** - * The volume id for this data. * - */ - volumeId: string; -} -export interface Schema$Annotations { - /** - * A list of annotations. - */ - items: Schema$Annotation[]; - /** - * Resource type. - */ - kind: string; - /** - * Token to pass in for pagination for the next page. This will not be present - * if this request does not have more results. - */ - nextPageToken: string; - /** - * Total number of annotations found. This may be greater than the number of - * notes returned in this response if results have been paginated. - */ - totalItems: number; -} -export interface Schema$Annotationsdata { - /** - * A list of Annotation Data. - */ - items: Schema$Annotationdata[]; - /** - * Resource type - */ - kind: string; - /** - * Token to pass in for pagination for the next page. This will not be present - * if this request does not have more results. - */ - nextPageToken: string; - /** - * The total number of volume annotations found. - */ - totalItems: number; -} -export interface Schema$AnnotationsSummary { - kind: string; - layers: any[]; -} -export interface Schema$BooksAnnotationsRange { - /** - * The offset from the ending position. - */ - endOffset: string; - /** - * The ending position for the range. - */ - endPosition: string; - /** - * The offset from the starting position. - */ - startOffset: string; - /** - * The starting position for the range. - */ - startPosition: string; -} -export interface Schema$BooksCloudloadingResource { - author: string; - processingState: string; - title: string; - volumeId: string; -} -export interface Schema$Bookshelf { - /** - * Whether this bookshelf is PUBLIC or PRIVATE. - */ - access: string; - /** - * Created time for this bookshelf (formatted UTC timestamp with millisecond - * resolution). - */ - created: string; - /** - * Description of this bookshelf. - */ - description: string; - /** - * Id of this bookshelf, only unique by user. - */ - id: number; - /** - * Resource type for bookshelf metadata. - */ - kind: string; - /** - * URL to this resource. - */ - selfLink: string; - /** - * Title of this bookshelf. - */ - title: string; - /** - * Last modified time of this bookshelf (formatted UTC timestamp with - * millisecond resolution). - */ - updated: string; - /** - * Number of volumes in this bookshelf. - */ - volumeCount: number; - /** - * Last time a volume was added or removed from this bookshelf (formatted UTC - * timestamp with millisecond resolution). - */ - volumesLastUpdated: string; -} -export interface Schema$Bookshelves { - /** - * A list of bookshelves. - */ - items: Schema$Bookshelf[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$BooksVolumesRecommendedRateResponse { - consistency_token: string; -} -export interface Schema$Category { - /** - * A list of onboarding categories. - */ - items: any[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$ConcurrentAccessRestriction { - /** - * Whether access is granted for this (user, device, volume). - */ - deviceAllowed: boolean; - /** - * Resource type. - */ - kind: string; - /** - * The maximum number of concurrent access licenses for this volume. - */ - maxConcurrentDevices: number; - /** - * Error/warning message. - */ - message: string; - /** - * Client nonce for verification. Download access and client-validation only. - */ - nonce: string; - /** - * Error/warning reason code. - */ - reasonCode: string; - /** - * Whether this volume has any concurrent access restrictions. - */ - restricted: boolean; - /** - * Response signature. - */ - signature: string; - /** - * Client app identifier for verification. Download access and - * client-validation only. - */ - source: string; - /** - * Time in seconds for license auto-expiration. - */ - timeWindowSeconds: number; - /** - * Identifies the volume for which this entry applies. - */ - volumeId: string; -} -export interface Schema$Dictlayerdata { - common: any; - dict: any; - kind: string; -} -export interface Schema$Discoveryclusters { - clusters: any[]; - /** - * Resorce type. - */ - kind: string; - totalClusters: number; -} -export interface Schema$DownloadAccesses { - /** - * A list of download access responses. - */ - downloadAccessList: Schema$DownloadAccessRestriction[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$DownloadAccessRestriction { - /** - * If restricted, whether access is granted for this (user, device, volume). - */ - deviceAllowed: boolean; - /** - * If restricted, the number of content download licenses already acquired - * (including the requesting client, if licensed). - */ - downloadsAcquired: number; - /** - * If deviceAllowed, whether access was just acquired with this request. - */ - justAcquired: boolean; - /** - * Resource type. - */ - kind: string; - /** - * If restricted, the maximum number of content download licenses for this - * volume. - */ - maxDownloadDevices: number; - /** - * Error/warning message. - */ - message: string; - /** - * Client nonce for verification. Download access and client-validation only. - */ - nonce: string; - /** - * Error/warning reason code. Additional codes may be added in the future. 0 - * OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 - * WARNING_USED_LAST_ACCESS - */ - reasonCode: string; - /** - * Whether this volume has any download access restrictions. - */ - restricted: boolean; - /** - * Response signature. - */ - signature: string; - /** - * Client app identifier for verification. Download access and - * client-validation only. - */ - source: string; - /** - * Identifies the volume for which this entry applies. - */ - volumeId: string; -} -export interface Schema$FamilyInfo { - /** - * Resource type. - */ - kind: string; - /** - * Family membership info of the user that made the request. - */ - membership: any; -} -export interface Schema$Geolayerdata { - common: any; - geo: any; - kind: string; -} -export interface Schema$Layersummaries { - /** - * A list of layer summary items. - */ - items: Schema$Layersummary[]; - /** - * Resource type. - */ - kind: string; - /** - * The total number of layer summaries found. - */ - totalItems: number; -} -export interface Schema$Layersummary { - /** - * The number of annotations for this layer. - */ - annotationCount: number; - /** - * Link to get data for this annotation. - */ - annotationsDataLink: string; - /** - * The link to get the annotations for this layer. - */ - annotationsLink: string; - /** - * The list of annotation types contained for this layer. - */ - annotationTypes: string[]; - /** - * The content version this resource is for. - */ - contentVersion: string; - /** - * The number of data items for this layer. - */ - dataCount: number; - /** - * Unique id of this layer summary. - */ - id: string; - /** - * Resource Type - */ - kind: string; - /** - * The layer id for this summary. - */ - layerId: string; - /** - * URL to this resource. - */ - selfLink: string; - /** - * Timestamp for the last time an item in this layer was updated. (RFC 3339 - * UTC date-time format). - */ - updated: string; - /** - * The current version of this layer's volume annotations. Note that this - * version applies only to the data in the books.layers.volumeAnnotations.* - * responses. The actual annotation data is versioned separately. - */ - volumeAnnotationsVersion: string; - /** - * The volume id this resource is for. - */ - volumeId: string; -} -export interface Schema$Metadata { - /** - * A list of offline dictionary metadata. - */ - items: any[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$Notification { - body: string; - /** - * The list of crm experiment ids. - */ - crmExperimentIds: string[]; - doc_id: string; - doc_type: string; - dont_show_notification: boolean; - iconUrl: string; - /** - * Resource type. - */ - kind: string; - notificationGroup: string; - notification_type: string; - pcampaign_id: string; - reason: string; - show_notification_settings_action: boolean; - targetUrl: string; - title: string; -} -export interface Schema$Offers { - /** - * A list of offers. - */ - items: any[]; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$ReadingPosition { - /** - * Position in an EPUB as a CFI. - */ - epubCfiPosition: string; - /** - * Position in a volume for image-based content. - */ - gbImagePosition: string; - /** - * Position in a volume for text-based content. - */ - gbTextPosition: string; - /** - * Resource type for a reading position. - */ - kind: string; - /** - * Position in a PDF file. - */ - pdfPosition: string; - /** - * Timestamp when this reading position was last updated (formatted UTC - * timestamp with millisecond resolution). - */ - updated: string; - /** - * Volume id associated with this reading position. - */ - volumeId: string; -} -export interface Schema$RequestAccess { - /** - * A concurrent access response. - */ - concurrentAccess: Schema$ConcurrentAccessRestriction; - /** - * A download access response. - */ - downloadAccess: Schema$DownloadAccessRestriction; - /** - * Resource type. - */ - kind: string; -} -export interface Schema$Review { - /** - * Author of this review. - */ - author: any; - /** - * Review text. - */ - content: string; - /** - * Date of this review. - */ - date: string; - /** - * URL for the full review text, for reviews gathered from the web. - */ - fullTextUrl: string; - /** - * Resource type for a review. - */ - kind: string; - /** - * Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, - * FIVE or NOT_RATED. - */ - rating: string; - /** - * Information regarding the source of this review, when the review is not - * from a Google Books user. - */ - source: any; - /** - * Title for this review. - */ - title: string; - /** - * Source type for this review. Possible values are EDITORIAL, WEB_USER or - * GOOGLE_USER. - */ - type: string; - /** - * Volume that this review is for. - */ - volumeId: string; -} -export interface Schema$Series { - /** - * Resource type. - */ - kind: string; - series: any[]; -} -export interface Schema$Seriesmembership { - /** - * Resorce type. - */ - kind: string; - member: Schema$Volume[]; - nextPageToken: string; -} -export interface Schema$Usersettings { - /** - * Resource type. - */ - kind: string; - /** - * User settings in sub-objects, each for different purposes. - */ - notesExport: any; - notification: any; -} -export interface Schema$Volume { - /** - * Any information about a volume related to reading or obtaining that volume - * text. This information can depend on country (books may be public domain in - * one country but not in another, e.g.). - */ - accessInfo: any; - /** - * Opaque identifier for a specific version of a volume resource. (In LITE - * projection) - */ - etag: string; - /** - * Unique identifier for a volume. (In LITE projection.) - */ - id: string; - /** - * Resource type for a volume. (In LITE projection.) - */ - kind: string; - /** - * What layers exist in this volume and high level information about them. - */ - layerInfo: any; - /** - * Recommendation related information for this volume. - */ - recommendedInfo: any; - /** - * Any information about a volume related to the eBookstore and/or - * purchaseability. This information can depend on the country where the - * request originates from (i.e. books may not be for sale in certain - * countries). - */ - saleInfo: any; - /** - * Search result information related to this volume. - */ - searchInfo: any; - /** - * URL to this resource. (In LITE projection.) - */ - selfLink: string; - /** - * User specific information related to this volume. (e.g. page this user last - * read or whether they purchased this book) - */ - userInfo: any; - /** - * General volume information. - */ - volumeInfo: any; -} -export interface Schema$Volume2 { - /** - * A list of volumes. - */ - items: Schema$Volume[]; - /** - * Resource type. - */ - kind: string; - nextPageToken: string; -} -export interface Schema$Volumeannotation { - /** - * The annotation data id for this volume annotation. - */ - annotationDataId: string; - /** - * Link to get data for this annotation. - */ - annotationDataLink: string; - /** - * The type of annotation this is. - */ - annotationType: string; - /** - * The content ranges to identify the selected text. - */ - contentRanges: any; - /** - * Data for this annotation. - */ - data: string; - /** - * Indicates that this annotation is deleted. - */ - deleted: boolean; - /** - * Unique id of this volume annotation. - */ - id: string; - /** - * Resource Type - */ - kind: string; - /** - * The Layer this annotation is for. - */ - layerId: string; - /** - * Pages the annotation spans. - */ - pageIds: string[]; - /** - * Excerpt from the volume. - */ - selectedText: string; - /** - * URL to this resource. - */ - selfLink: string; - /** - * Timestamp for the last time this anntoation was updated. (RFC 3339 UTC - * date-time format). - */ - updated: string; - /** - * The Volume this annotation is for. - */ - volumeId: string; -} -export interface Schema$Volumeannotations { - /** - * A list of volume annotations. - */ - items: Schema$Volumeannotation[]; - /** - * Resource type - */ - kind: string; - /** - * Token to pass in for pagination for the next page. This will not be present - * if this request does not have more results. - */ - nextPageToken: string; - /** - * The total number of volume annotations found. - */ - totalItems: number; - /** - * The version string for all of the volume annotations in this layer (not - * just the ones in this response). Note: the version string doesn't apply - * to the annotation data, just the information in this response (e.g. the - * location of annotations in the book). - */ - version: string; -} -export interface Schema$Volumes { - /** - * A list of volumes. - */ - items: Schema$Volume[]; - /** - * Resource type. - */ - kind: string; - /** - * Total number of volumes found. This might be greater than the number of - * volumes returned in this response if results have been paginated. - */ - totalItems: number; -} -export interface Schema$Volumeseriesinfo { - /** - * The display number string. This should be used only for display purposes - * and the actual sequence should be inferred from the below orderNumber. - */ - bookDisplayNumber: string; - /** - * Resource type. - */ - kind: string; - /** - * Short book title in the context of the series. - */ - shortSeriesBookTitle: string; - volumeSeries: any[]; -} - -export class Resource$Bookshelves { - root: Books; - volumes: Resource$Bookshelves$Volumes; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.volumes = new Resource$Bookshelves$Volumes(root); - } - - getRoot() { - return this.root; - } - - - /** - * books.bookshelves.get - * @desc Retrieves metadata for a specific bookshelf for the specified user. - * @alias books.bookshelves.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.shelf ID of bookshelf to retrieve. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.userId ID of user for whom to retrieve bookshelves. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/users/{userId}/bookshelves/{shelf}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'shelf'], - pathParams: ['shelf', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.bookshelves.list - * @desc Retrieves a list of public bookshelves for the specified user. - * @alias books.bookshelves.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.userId ID of user for whom to retrieve bookshelves. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/users/{userId}/bookshelves') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Bookshelves$Volumes { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * books.bookshelves.volumes.list - * @desc Retrieves volumes in a specific bookshelf for the specified user. - * @alias books.bookshelves.volumes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string} params.shelf ID of bookshelf to retrieve volumes. - * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string=} params.source String to identify the originator of this request. - * @param {integer=} params.startIndex Index of the first element to return (starts at 0) - * @param {string} params.userId ID of user for whom to retrieve bookshelf volumes. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/books/v1/users/{userId}/bookshelves/{shelf}/volumes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'shelf'], - pathParams: ['shelf', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Cloudloading { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * books.cloudloading.addBook - * @alias books.cloudloading.addBook - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.drive_document_id A drive document id. The upload_client_token must not be set. - * @param {string=} params.mime_type The document MIME type. It can be set only if the drive_document_id is set. - * @param {string=} params.name The document name. It can be set only if the drive_document_id is set. - * @param {string=} params.upload_client_token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addBook(params?: any, options?: MethodOptions): - AxiosPromise; - addBook( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - addBook( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/cloudloading/addBook') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.cloudloading.deleteBook - * @desc Remove the book and its contents - * @alias books.cloudloading.deleteBook - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.volumeId The id of the book to be removed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteBook(params?: any, options?: MethodOptions): AxiosPromise; - deleteBook( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteBook( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/cloudloading/deleteBook') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['volumeId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.cloudloading.updateBook - * @alias books.cloudloading.updateBook - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BooksCloudloadingResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateBook(params?: any, options?: MethodOptions): - AxiosPromise; - updateBook( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateBook( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/cloudloading/updateBook') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Dictionary { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * books.dictionary.listOfflineMetadata - * @desc Returns a list of offline dictionary metadata available - * @alias books.dictionary.listOfflineMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.cpksver The device/version ID from which to request the data. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listOfflineMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - listOfflineMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listOfflineMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/dictionary/listOfflineMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['cpksver'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Familysharing { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * books.familysharing.getFamilyInfo - * @desc Gets information regarding the family that the user is part of. - * @alias books.familysharing.getFamilyInfo - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getFamilyInfo(params?: any, options?: MethodOptions): - AxiosPromise; - getFamilyInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getFamilyInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/familysharing/getFamilyInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.familysharing.share - * @desc Initiates sharing of the content with the user's family. Empty - * response indicates success. - * @alias books.familysharing.share - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.docId The docid to share. - * @param {string=} params.source String to identify the originator of this request. - * @param {string=} params.volumeId The volume to share. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - share(params?: any, options?: MethodOptions): AxiosPromise; - share( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - share( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/familysharing/share') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.familysharing.unshare - * @desc Initiates revoking content that has already been shared with the - * user's family. Empty response indicates success. - * @alias books.familysharing.unshare - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.docId The docid to unshare. - * @param {string=} params.source String to identify the originator of this request. - * @param {string=} params.volumeId The volume to unshare. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unshare(params?: any, options?: MethodOptions): AxiosPromise; - unshare( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unshare( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/familysharing/unshare') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Layers { - root: Books; - annotationData: Resource$Layers$Annotationdata; - volumeAnnotations: Resource$Layers$Volumeannotations; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.annotationData = new Resource$Layers$Annotationdata(root); - this.volumeAnnotations = new Resource$Layers$Volumeannotations(root); - } - - getRoot() { - return this.root; - } - - - /** - * books.layers.get - * @desc Gets the layer summary for a volume. - * @alias books.layers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.contentVersion The content version for the requested volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.summaryId The ID for the layer to get the summary for. - * @param {string} params.volumeId The volume to retrieve layers for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/books/v1/volumes/{volumeId}/layersummary/{summaryId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId', 'summaryId'], - pathParams: ['summaryId', 'volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.layers.list - * @desc List the layer summaries for a volume. - * @alias books.layers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.contentVersion The content version for the requested volume. - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken The value of the nextToken from the previous page. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId The volume to retrieve layers for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/{volumeId}/layersummary') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId'], - pathParams: ['volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Layers$Annotationdata { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * books.layers.annotationData.get - * @desc Gets the annotation data. - * @alias books.layers.annotationData.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. - * @param {string} params.annotationDataId The ID of the annotation data to retrieve. - * @param {string} params.contentVersion The content version for the volume you are trying to retrieve. - * @param {integer=} params.h The requested pixel height for any images. If height is provided width must also be provided. - * @param {string} params.layerId The ID for the layer to get the annotations. - * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {integer=} params.scale The requested scale for the image. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId The volume to retrieve annotations for. - * @param {integer=} params.w The requested pixel width for any images. If width is provided height must also be provided. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/books/v1/volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['volumeId', 'layerId', 'annotationDataId', 'contentVersion'], - pathParams: ['annotationDataId', 'layerId', 'volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.layers.annotationData.list - * @desc Gets the annotation data for a volume and layer. - * @alias books.layers.annotationData.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. - * @param {string} params.contentVersion The content version for the requested volume. - * @param {integer=} params.h The requested pixel height for any images. If height is provided width must also be provided. - * @param {string} params.layerId The ID for the layer to get the annotation data. - * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken The value of the nextToken from the previous page. - * @param {integer=} params.scale The requested scale for the image. - * @param {string=} params.source String to identify the originator of this request. - * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string} params.volumeId The volume to retrieve annotation data for. - * @param {integer=} params.w The requested pixel width for any images. If width is provided height must also be provided. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/books/v1/volumes/{volumeId}/layers/{layerId}/data') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId', 'layerId', 'contentVersion'], - pathParams: ['layerId', 'volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Layers$Volumeannotations { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace books_v1 { /** - * books.layers.volumeAnnotations.get - * @desc Gets the volume annotation. - * @alias books.layers.volumeAnnotations.get - * @memberOf! () + * Books API * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID of the volume annotation to retrieve. - * @param {string} params.layerId The ID for the layer to get the annotations. - * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId The volume to retrieve annotations for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/books/v1/volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId', 'layerId', 'annotationId'], - pathParams: ['annotationId', 'layerId', 'volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * books.layers.volumeAnnotations.list - * @desc Gets the volume annotations for a volume and layer. - * @alias books.layers.volumeAnnotations.list - * @memberOf! () + * Searches for books and manages your Google Books library. * - * @param {object} params Parameters for request - * @param {string} params.contentVersion The content version for the requested volume. - * @param {string=} params.endOffset The end offset to end retrieving data from. - * @param {string=} params.endPosition The end position to end retrieving data from. - * @param {string} params.layerId The ID for the layer to get the annotations. - * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken The value of the nextToken from the previous page. - * @param {boolean=} params.showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string=} params.source String to identify the originator of this request. - * @param {string=} params.startOffset The start offset to start retrieving data from. - * @param {string=} params.startPosition The start position to start retrieving data from. - * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string=} params.volumeAnnotationsVersion The version of the volume annotations that you are requesting. - * @param {string} params.volumeId The volume to retrieve annotations for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/{volumeId}/layers/{layerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId', 'layerId', 'contentVersion'], - pathParams: ['layerId', 'volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @example + * const google = require('googleapis'); + * const books = google.books('v1'); + * + * @namespace books + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Books + */ + export class Books { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + bookshelves: Resource$Bookshelves; + cloudloading: Resource$Cloudloading; + dictionary: Resource$Dictionary; + familysharing: Resource$Familysharing; + layers: Resource$Layers; + myconfig: Resource$Myconfig; + mylibrary: Resource$Mylibrary; + notification: Resource$Notification; + onboarding: Resource$Onboarding; + personalizedstream: Resource$Personalizedstream; + promooffer: Resource$Promooffer; + series: Resource$Series; + volumes: Resource$Volumes; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.bookshelves = new Resource$Bookshelves(this); + this.cloudloading = new Resource$Cloudloading(this); + this.dictionary = new Resource$Dictionary(this); + this.familysharing = new Resource$Familysharing(this); + this.layers = new Resource$Layers(this); + this.myconfig = new Resource$Myconfig(this); + this.mylibrary = new Resource$Mylibrary(this); + this.notification = new Resource$Notification(this); + this.onboarding = new Resource$Onboarding(this); + this.personalizedstream = new Resource$Personalizedstream(this); + this.promooffer = new Resource$Promooffer(this); + this.series = new Resource$Series(this); + this.volumes = new Resource$Volumes(this); + } + + getRoot() { + return this.root; } } -} - - -export class Resource$Myconfig { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + export interface Schema$Annotation { + /** + * Anchor text after excerpt. For requests, if the user bookmarked a screen + * that has no flowing text on it, then this field should be empty. + */ + afterSelectedText: string; + /** + * Anchor text before excerpt. For requests, if the user bookmarked a screen + * that has no flowing text on it, then this field should be empty. + */ + beforeSelectedText: string; + /** + * Selection ranges sent from the client. + */ + clientVersionRanges: any; + /** + * Timestamp for the created time of this annotation. + */ + created: string; + /** + * Selection ranges for the most recent content version. + */ + currentVersionRanges: any; + /** + * User-created data for this annotation. + */ + data: string; + /** + * Indicates that this annotation is deleted. + */ + deleted: boolean; + /** + * The highlight style for this annotation. + */ + highlightStyle: string; + /** + * Id of this annotation, in the form of a GUID. + */ + id: string; + /** + * Resource type. + */ + kind: string; + /** + * The layer this annotation is for. + */ + layerId: string; + layerSummary: any; + /** + * Pages that this annotation spans. + */ + pageIds: string[]; + /** + * Excerpt from the volume. + */ + selectedText: string; + /** + * URL to this resource. + */ + selfLink: string; + /** + * Timestamp for the last time this annotation was modified. + */ + updated: string; + /** + * The volume that this annotation belongs to. + */ + volumeId: string; } - - - /** - * books.myconfig.getUserSettings - * @desc Gets the current settings for the user. - * @alias books.myconfig.getUserSettings - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getUserSettings(params?: any, options?: MethodOptions): - AxiosPromise; - getUserSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getUserSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/myconfig/getUserSettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Annotationdata { + /** + * The type of annotation this data is for. + */ + annotationType: string; + data: any; + /** + * Base64 encoded data for this annotation data. + */ + encoded_data: string; + /** + * Unique id for this annotation data. + */ + id: string; + /** + * Resource Type + */ + kind: string; + /** + * The Layer id for this data. * + */ + layerId: string; + /** + * URL for this resource. * + */ + selfLink: string; + /** + * Timestamp for the last time this data was updated. (RFC 3339 UTC + * date-time format). + */ + updated: string; + /** + * The volume id for this data. * + */ + volumeId: string; } - - - /** - * books.myconfig.releaseDownloadAccess - * @desc Release downloaded content access restriction. - * @alias books.myconfig.releaseDownloadAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.cpksver The device/version ID from which to release the restriction. - * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeIds The volume(s) to release restrictions for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - releaseDownloadAccess(params?: any, options?: MethodOptions): - AxiosPromise; - releaseDownloadAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - releaseDownloadAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/myconfig/releaseDownloadAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['volumeIds', 'cpksver'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Annotations { + /** + * A list of annotations. + */ + items: Schema$Annotation[]; + /** + * Resource type. + */ + kind: string; + /** + * Token to pass in for pagination for the next page. This will not be + * present if this request does not have more results. + */ + nextPageToken: string; + /** + * Total number of annotations found. This may be greater than the number of + * notes returned in this response if results have been paginated. + */ + totalItems: number; } - - - /** - * books.myconfig.requestAccess - * @desc Request concurrent and download access restrictions. - * @alias books.myconfig.requestAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.cpksver The device/version ID from which to request the restrictions. - * @param {string=} params.licenseTypes The type of access license to request. If not specified, the default is BOTH. - * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {string} params.nonce The client nonce value. - * @param {string} params.source String to identify the originator of this request. - * @param {string} params.volumeId The volume to request concurrent/download restrictions for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - requestAccess(params?: any, options?: MethodOptions): - AxiosPromise; - requestAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - requestAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/myconfig/requestAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['source', 'volumeId', 'nonce', 'cpksver'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Annotationsdata { + /** + * A list of Annotation Data. + */ + items: Schema$Annotationdata[]; + /** + * Resource type + */ + kind: string; + /** + * Token to pass in for pagination for the next page. This will not be + * present if this request does not have more results. + */ + nextPageToken: string; + /** + * The total number of volume annotations found. + */ + totalItems: number; } - - - /** - * books.myconfig.syncVolumeLicenses - * @desc Request downloaded content access for specified volumes on the My - * eBooks shelf. - * @alias books.myconfig.syncVolumeLicenses - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.cpksver The device/version ID from which to release the restriction. - * @param {string=} params.features List of features supported by the client, i.e., 'RENTALS' - * @param {boolean=} params.includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. - * @param {string} params.nonce The client nonce value. - * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string} params.source String to identify the originator of this request. - * @param {string=} params.volumeIds The volume(s) to request download restrictions for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - syncVolumeLicenses(params?: any, options?: MethodOptions): - AxiosPromise; - syncVolumeLicenses( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - syncVolumeLicenses( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/myconfig/syncVolumeLicenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['source', 'nonce', 'cpksver'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AnnotationsSummary { + kind: string; + layers: any[]; } - - - /** - * books.myconfig.updateUserSettings - * @desc Sets the settings for the user. If a sub-object is specified, it will - * overwrite the existing sub-object stored in the server. Unspecified - * sub-objects will retain the existing value. - * @alias books.myconfig.updateUserSettings - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Usersettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateUserSettings(params?: any, options?: MethodOptions): - AxiosPromise; - updateUserSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateUserSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/myconfig/updateUserSettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BooksAnnotationsRange { + /** + * The offset from the ending position. + */ + endOffset: string; + /** + * The ending position for the range. + */ + endPosition: string; + /** + * The offset from the starting position. + */ + startOffset: string; + /** + * The starting position for the range. + */ + startPosition: string; } -} - -export class Resource$Mylibrary { - root: Books; - annotations: Resource$Mylibrary$Annotations; - bookshelves: Resource$Mylibrary$Bookshelves; - readingpositions: Resource$Mylibrary$Readingpositions; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.annotations = new Resource$Mylibrary$Annotations(root); - this.bookshelves = new Resource$Mylibrary$Bookshelves(root); - this.readingpositions = new Resource$Mylibrary$Readingpositions(root); + export interface Schema$BooksCloudloadingResource { + author: string; + processingState: string; + title: string; + volumeId: string; } - - getRoot() { - return this.root; + export interface Schema$Bookshelf { + /** + * Whether this bookshelf is PUBLIC or PRIVATE. + */ + access: string; + /** + * Created time for this bookshelf (formatted UTC timestamp with millisecond + * resolution). + */ + created: string; + /** + * Description of this bookshelf. + */ + description: string; + /** + * Id of this bookshelf, only unique by user. + */ + id: number; + /** + * Resource type for bookshelf metadata. + */ + kind: string; + /** + * URL to this resource. + */ + selfLink: string; + /** + * Title of this bookshelf. + */ + title: string; + /** + * Last modified time of this bookshelf (formatted UTC timestamp with + * millisecond resolution). + */ + updated: string; + /** + * Number of volumes in this bookshelf. + */ + volumeCount: number; + /** + * Last time a volume was added or removed from this bookshelf (formatted + * UTC timestamp with millisecond resolution). + */ + volumesLastUpdated: string; } -} -export class Resource$Mylibrary$Annotations { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Bookshelves { + /** + * A list of bookshelves. + */ + items: Schema$Bookshelf[]; + /** + * Resource type. + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$BooksVolumesRecommendedRateResponse { + consistency_token: string; } - - - /** - * books.mylibrary.annotations.delete - * @desc Deletes an annotation. - * @alias books.mylibrary.annotations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID for the annotation to delete. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['annotationId'], - pathParams: ['annotationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Category { + /** + * A list of onboarding categories. + */ + items: any[]; + /** + * Resource type. + */ + kind: string; } - - - /** - * books.mylibrary.annotations.insert - * @desc Inserts a new annotation. - * @alias books.mylibrary.annotations.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.annotationId The ID for the annotation to insert. - * @param {string=} params.country ISO-3166-1 code to override the IP-based location. - * @param {boolean=} params.showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. - * @param {string=} params.source String to identify the originator of this request. - * @param {().Annotation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/annotations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ConcurrentAccessRestriction { + /** + * Whether access is granted for this (user, device, volume). + */ + deviceAllowed: boolean; + /** + * Resource type. + */ + kind: string; + /** + * The maximum number of concurrent access licenses for this volume. + */ + maxConcurrentDevices: number; + /** + * Error/warning message. + */ + message: string; + /** + * Client nonce for verification. Download access and client-validation + * only. + */ + nonce: string; + /** + * Error/warning reason code. + */ + reasonCode: string; + /** + * Whether this volume has any concurrent access restrictions. + */ + restricted: boolean; + /** + * Response signature. + */ + signature: string; + /** + * Client app identifier for verification. Download access and + * client-validation only. + */ + source: string; + /** + * Time in seconds for license auto-expiration. + */ + timeWindowSeconds: number; + /** + * Identifies the volume for which this entry applies. + */ + volumeId: string; } - - - /** - * books.mylibrary.annotations.list - * @desc Retrieves a list of annotations, possibly filtered. - * @alias books.mylibrary.annotations.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.contentVersion The content version for the requested volume. - * @param {string=} params.layerId The layer ID to limit annotation by. - * @param {string=} params.layerIds The layer ID(s) to limit annotation by. - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken The value of the nextToken from the previous page. - * @param {boolean=} params.showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. - * @param {string=} params.source String to identify the originator of this request. - * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). - * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). - * @param {string=} params.volumeId The volume to restrict annotations to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/annotations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Dictlayerdata { + common: any; + dict: any; + kind: string; } - - - /** - * books.mylibrary.annotations.summary - * @desc Gets the summary of specified layers. - * @alias books.mylibrary.annotations.summary - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.layerIds Array of layer IDs to get the summary for. - * @param {string} params.volumeId Volume id to get the summary for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - summary(params?: any, options?: MethodOptions): - AxiosPromise; - summary( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - summary( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/annotations/summary') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['layerIds', 'volumeId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Discoveryclusters { + clusters: any[]; + /** + * Resorce type. + */ + kind: string; + totalClusters: number; } - - - /** - * books.mylibrary.annotations.update - * @desc Updates an existing annotation. - * @alias books.mylibrary.annotations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID for the annotation to update. - * @param {string=} params.source String to identify the originator of this request. - * @param {().Annotation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['annotationId'], - pathParams: ['annotationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$DownloadAccesses { + /** + * A list of download access responses. + */ + downloadAccessList: Schema$DownloadAccessRestriction[]; + /** + * Resource type. + */ + kind: string; } -} - -export class Resource$Mylibrary$Bookshelves { - root: Books; - volumes: Resource$Mylibrary$Bookshelves$Volumes; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.volumes = new Resource$Mylibrary$Bookshelves$Volumes(root); + export interface Schema$DownloadAccessRestriction { + /** + * If restricted, whether access is granted for this (user, device, volume). + */ + deviceAllowed: boolean; + /** + * If restricted, the number of content download licenses already acquired + * (including the requesting client, if licensed). + */ + downloadsAcquired: number; + /** + * If deviceAllowed, whether access was just acquired with this request. + */ + justAcquired: boolean; + /** + * Resource type. + */ + kind: string; + /** + * If restricted, the maximum number of content download licenses for this + * volume. + */ + maxDownloadDevices: number; + /** + * Error/warning message. + */ + message: string; + /** + * Client nonce for verification. Download access and client-validation + * only. + */ + nonce: string; + /** + * Error/warning reason code. Additional codes may be added in the future. 0 + * OK 100 ACCESS_DENIED_PUBLISHER_LIMIT 101 ACCESS_DENIED_LIMIT 200 + * WARNING_USED_LAST_ACCESS + */ + reasonCode: string; + /** + * Whether this volume has any download access restrictions. + */ + restricted: boolean; + /** + * Response signature. + */ + signature: string; + /** + * Client app identifier for verification. Download access and + * client-validation only. + */ + source: string; + /** + * Identifies the volume for which this entry applies. + */ + volumeId: string; } - - getRoot() { - return this.root; + export interface Schema$FamilyInfo { + /** + * Resource type. + */ + kind: string; + /** + * Family membership info of the user that made the request. + */ + membership: any; } - - - /** - * books.mylibrary.bookshelves.addVolume - * @desc Adds a volume to a bookshelf. - * @alias books.mylibrary.bookshelves.addVolume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.reason The reason for which the book is added to the library. - * @param {string} params.shelf ID of bookshelf to which to add a volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of volume to add. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addVolume(params?: any, options?: MethodOptions): AxiosPromise; - addVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}/addVolume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['shelf', 'volumeId'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Geolayerdata { + common: any; + geo: any; + kind: string; } - - - /** - * books.mylibrary.bookshelves.clearVolumes - * @desc Clears all volumes from a bookshelf. - * @alias books.mylibrary.bookshelves.clearVolumes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.shelf ID of bookshelf from which to remove a volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clearVolumes(params?: any, options?: MethodOptions): AxiosPromise; - clearVolumes( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clearVolumes( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/books/v1/mylibrary/bookshelves/{shelf}/clearVolumes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['shelf'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Layersummaries { + /** + * A list of layer summary items. + */ + items: Schema$Layersummary[]; + /** + * Resource type. + */ + kind: string; + /** + * The total number of layer summaries found. + */ + totalItems: number; } - - - /** - * books.mylibrary.bookshelves.get - * @desc Retrieves metadata for a specific bookshelf belonging to the - * authenticated user. - * @alias books.mylibrary.bookshelves.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.shelf ID of bookshelf to retrieve. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['shelf'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Layersummary { + /** + * The number of annotations for this layer. + */ + annotationCount: number; + /** + * Link to get data for this annotation. + */ + annotationsDataLink: string; + /** + * The link to get the annotations for this layer. + */ + annotationsLink: string; + /** + * The list of annotation types contained for this layer. + */ + annotationTypes: string[]; + /** + * The content version this resource is for. + */ + contentVersion: string; + /** + * The number of data items for this layer. + */ + dataCount: number; + /** + * Unique id of this layer summary. + */ + id: string; + /** + * Resource Type + */ + kind: string; + /** + * The layer id for this summary. + */ + layerId: string; + /** + * URL to this resource. + */ + selfLink: string; + /** + * Timestamp for the last time an item in this layer was updated. (RFC 3339 + * UTC date-time format). + */ + updated: string; + /** + * The current version of this layer's volume annotations. Note that + * this version applies only to the data in the + * books.layers.volumeAnnotations.* responses. The actual annotation data is + * versioned separately. + */ + volumeAnnotationsVersion: string; + /** + * The volume id this resource is for. + */ + volumeId: string; } - - - /** - * books.mylibrary.bookshelves.list - * @desc Retrieves a list of bookshelves belonging to the authenticated user. - * @alias books.mylibrary.bookshelves.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/bookshelves') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Metadata { + /** + * A list of offline dictionary metadata. + */ + items: any[]; + /** + * Resource type. + */ + kind: string; } - - - /** - * books.mylibrary.bookshelves.moveVolume - * @desc Moves a volume within a bookshelf. - * @alias books.mylibrary.bookshelves.moveVolume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.shelf ID of bookshelf with the volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of volume to move. - * @param {integer} params.volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveVolume(params?: any, options?: MethodOptions): AxiosPromise; - moveVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}/moveVolume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['shelf', 'volumeId', 'volumePosition'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Notification { + body: string; + /** + * The list of crm experiment ids. + */ + crmExperimentIds: string[]; + doc_id: string; + doc_type: string; + dont_show_notification: boolean; + iconUrl: string; + /** + * Resource type. + */ + kind: string; + notificationGroup: string; + notification_type: string; + pcampaign_id: string; + reason: string; + show_notification_settings_action: boolean; + targetUrl: string; + title: string; } - - - /** - * books.mylibrary.bookshelves.removeVolume - * @desc Removes a volume from a bookshelf. - * @alias books.mylibrary.bookshelves.removeVolume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.reason The reason for which the book is removed from the library. - * @param {string} params.shelf ID of bookshelf from which to remove a volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of volume to remove. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeVolume(params?: any, options?: MethodOptions): AxiosPromise; - removeVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeVolume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/books/v1/mylibrary/bookshelves/{shelf}/removeVolume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['shelf', 'volumeId'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Offers { + /** + * A list of offers. + */ + items: any[]; + /** + * Resource type. + */ + kind: string; } -} -export class Resource$Mylibrary$Bookshelves$Volumes { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ReadingPosition { + /** + * Position in an EPUB as a CFI. + */ + epubCfiPosition: string; + /** + * Position in a volume for image-based content. + */ + gbImagePosition: string; + /** + * Position in a volume for text-based content. + */ + gbTextPosition: string; + /** + * Resource type for a reading position. + */ + kind: string; + /** + * Position in a PDF file. + */ + pdfPosition: string; + /** + * Timestamp when this reading position was last updated (formatted UTC + * timestamp with millisecond resolution). + */ + updated: string; + /** + * Volume id associated with this reading position. + */ + volumeId: string; } - - getRoot() { - return this.root; + export interface Schema$RequestAccess { + /** + * A concurrent access response. + */ + concurrentAccess: Schema$ConcurrentAccessRestriction; + /** + * A download access response. + */ + downloadAccess: Schema$DownloadAccessRestriction; + /** + * Resource type. + */ + kind: string; } - - - /** - * books.mylibrary.bookshelves.volumes.list - * @desc Gets volume information for volumes on a bookshelf. - * @alias books.mylibrary.bookshelves.volumes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.country ISO-3166-1 code to override the IP-based location. - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string=} params.q Full-text search query string in this bookshelf. - * @param {string} params.shelf The bookshelf ID or name retrieve volumes for. - * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. - * @param {string=} params.source String to identify the originator of this request. - * @param {integer=} params.startIndex Index of the first element to return (starts at 0) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}/volumes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['shelf'], - pathParams: ['shelf'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Review { + /** + * Author of this review. + */ + author: any; + /** + * Review text. + */ + content: string; + /** + * Date of this review. + */ + date: string; + /** + * URL for the full review text, for reviews gathered from the web. + */ + fullTextUrl: string; + /** + * Resource type for a review. + */ + kind: string; + /** + * Star rating for this review. Possible values are ONE, TWO, THREE, FOUR, + * FIVE or NOT_RATED. + */ + rating: string; + /** + * Information regarding the source of this review, when the review is not + * from a Google Books user. + */ + source: any; + /** + * Title for this review. + */ + title: string; + /** + * Source type for this review. Possible values are EDITORIAL, WEB_USER or + * GOOGLE_USER. + */ + type: string; + /** + * Volume that this review is for. + */ + volumeId: string; } -} - - -export class Resource$Mylibrary$Readingpositions { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Series { + /** + * Resource type. + */ + kind: string; + series: any[]; } - - getRoot() { - return this.root; + export interface Schema$Seriesmembership { + /** + * Resorce type. + */ + kind: string; + member: Schema$Volume[]; + nextPageToken: string; } - - - /** - * books.mylibrary.readingpositions.get - * @desc Retrieves my reading position information for a volume. - * @alias books.mylibrary.readingpositions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.contentVersion Volume content version for which this reading position is requested. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of volume for which to retrieve a reading position. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/mylibrary/readingpositions/{volumeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId'], - pathParams: ['volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Usersettings { + /** + * Resource type. + */ + kind: string; + /** + * User settings in sub-objects, each for different purposes. + */ + notesExport: any; + notification: any; } - - - /** - * books.mylibrary.readingpositions.setPosition - * @desc Sets my reading position information for a volume. - * @alias books.mylibrary.readingpositions.setPosition - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.action Action that caused this reading position to be set. - * @param {string=} params.contentVersion Volume content version for which this reading position applies. - * @param {string=} params.deviceCookie Random persistent device cookie optional on set position. - * @param {string} params.position Position string for the new volume reading position. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.timestamp RFC 3339 UTC format timestamp associated with this reading position. - * @param {string} params.volumeId ID of volume for which to update the reading position. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setPosition(params?: any, options?: MethodOptions): AxiosPromise; - setPosition( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setPosition( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/books/v1/mylibrary/readingpositions/{volumeId}/setPosition') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['volumeId', 'timestamp', 'position'], - pathParams: ['volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Volume { + /** + * Any information about a volume related to reading or obtaining that + * volume text. This information can depend on country (books may be public + * domain in one country but not in another, e.g.). + */ + accessInfo: any; + /** + * Opaque identifier for a specific version of a volume resource. (In LITE + * projection) + */ + etag: string; + /** + * Unique identifier for a volume. (In LITE projection.) + */ + id: string; + /** + * Resource type for a volume. (In LITE projection.) + */ + kind: string; + /** + * What layers exist in this volume and high level information about them. + */ + layerInfo: any; + /** + * Recommendation related information for this volume. + */ + recommendedInfo: any; + /** + * Any information about a volume related to the eBookstore and/or + * purchaseability. This information can depend on the country where the + * request originates from (i.e. books may not be for sale in certain + * countries). + */ + saleInfo: any; + /** + * Search result information related to this volume. + */ + searchInfo: any; + /** + * URL to this resource. (In LITE projection.) + */ + selfLink: string; + /** + * User specific information related to this volume. (e.g. page this user + * last read or whether they purchased this book) + */ + userInfo: any; + /** + * General volume information. + */ + volumeInfo: any; } -} - - -export class Resource$Notification { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Volume2 { + /** + * A list of volumes. + */ + items: Schema$Volume[]; + /** + * Resource type. + */ + kind: string; + nextPageToken: string; } - - getRoot() { - return this.root; + export interface Schema$Volumeannotation { + /** + * The annotation data id for this volume annotation. + */ + annotationDataId: string; + /** + * Link to get data for this annotation. + */ + annotationDataLink: string; + /** + * The type of annotation this is. + */ + annotationType: string; + /** + * The content ranges to identify the selected text. + */ + contentRanges: any; + /** + * Data for this annotation. + */ + data: string; + /** + * Indicates that this annotation is deleted. + */ + deleted: boolean; + /** + * Unique id of this volume annotation. + */ + id: string; + /** + * Resource Type + */ + kind: string; + /** + * The Layer this annotation is for. + */ + layerId: string; + /** + * Pages the annotation spans. + */ + pageIds: string[]; + /** + * Excerpt from the volume. + */ + selectedText: string; + /** + * URL to this resource. + */ + selfLink: string; + /** + * Timestamp for the last time this anntoation was updated. (RFC 3339 UTC + * date-time format). + */ + updated: string; + /** + * The Volume this annotation is for. + */ + volumeId: string; } - - - /** - * books.notification.get - * @desc Returns notification details for a given notification id. - * @alias books.notification.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. - * @param {string} params.notification_id String to identify the notification. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/notification/get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['notification_id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Volumeannotations { + /** + * A list of volume annotations. + */ + items: Schema$Volumeannotation[]; + /** + * Resource type + */ + kind: string; + /** + * Token to pass in for pagination for the next page. This will not be + * present if this request does not have more results. + */ + nextPageToken: string; + /** + * The total number of volume annotations found. + */ + totalItems: number; + /** + * The version string for all of the volume annotations in this layer (not + * just the ones in this response). Note: the version string doesn't + * apply to the annotation data, just the information in this response (e.g. + * the location of annotations in the book). + */ + version: string; } -} - -export class Resource$Onboarding { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Volumes { + /** + * A list of volumes. + */ + items: Schema$Volume[]; + /** + * Resource type. + */ + kind: string; + /** + * Total number of volumes found. This might be greater than the number of + * volumes returned in this response if results have been paginated. + */ + totalItems: number; } - - getRoot() { - return this.root; + export interface Schema$Volumeseriesinfo { + /** + * The display number string. This should be used only for display purposes + * and the actual sequence should be inferred from the below orderNumber. + */ + bookDisplayNumber: string; + /** + * Resource type. + */ + kind: string; + /** + * Short book title in the context of the series. + */ + shortSeriesBookTitle: string; + volumeSeries: any[]; } - - /** - * books.onboarding.listCategories - * @desc List categories for onboarding experience. - * @alias books.onboarding.listCategories - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listCategories(params?: any, options?: MethodOptions): - AxiosPromise; - listCategories( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listCategories( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/onboarding/listCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bookshelves { + root: Books; + volumes: Resource$Bookshelves$Volumes; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.volumes = new Resource$Bookshelves$Volumes(root); + } + + getRoot() { + return this.root; + } + + + /** + * books.bookshelves.get + * @desc Retrieves metadata for a specific bookshelf for the specified user. + * @alias books.bookshelves.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.shelf ID of bookshelf to retrieve. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.userId ID of user for whom to retrieve bookshelves. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/users/{userId}/bookshelves/{shelf}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'shelf'], + pathParams: ['shelf', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.bookshelves.list + * @desc Retrieves a list of public bookshelves for the specified user. + * @alias books.bookshelves.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.userId ID of user for whom to retrieve bookshelves. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/users/{userId}/bookshelves') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * books.onboarding.listCategoryVolumes - * @desc List available volumes under categories for onboarding experience. - * @alias books.onboarding.listCategoryVolumes - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.categoryId List of category ids requested. - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. - * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. - * @param {integer=} params.pageSize Number of maximum results per page to be included in the response. - * @param {string=} params.pageToken The value of the nextToken from the previous page. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listCategoryVolumes(params?: any, options?: MethodOptions): - AxiosPromise; - listCategoryVolumes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listCategoryVolumes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/onboarding/listCategoryVolumes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bookshelves$Volumes { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.bookshelves.volumes.list + * @desc Retrieves volumes in a specific bookshelf for the specified user. + * @alias books.bookshelves.volumes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string} params.shelf ID of bookshelf to retrieve volumes. + * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string=} params.source String to identify the originator of this request. + * @param {integer=} params.startIndex Index of the first element to return (starts at 0) + * @param {string} params.userId ID of user for whom to retrieve bookshelf volumes. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/users/{userId}/bookshelves/{shelf}/volumes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'shelf'], + pathParams: ['shelf', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Personalizedstream { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * books.personalizedstream.get - * @desc Returns a stream of personalized book clusters - * @alias books.personalizedstream.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/personalizedstream/get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Cloudloading { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.cloudloading.addBook + * @alias books.cloudloading.addBook + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.drive_document_id A drive document id. The upload_client_token must not be set. + * @param {string=} params.mime_type The document MIME type. It can be set only if the drive_document_id is set. + * @param {string=} params.name The document name. It can be set only if the drive_document_id is set. + * @param {string=} params.upload_client_token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addBook(params?: any, options?: MethodOptions): + AxiosPromise; + addBook( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + addBook( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/cloudloading/addBook') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.cloudloading.deleteBook + * @desc Remove the book and its contents + * @alias books.cloudloading.deleteBook + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.volumeId The id of the book to be removed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteBook(params?: any, options?: MethodOptions): AxiosPromise; + deleteBook( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteBook( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/cloudloading/deleteBook') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['volumeId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.cloudloading.updateBook + * @alias books.cloudloading.updateBook + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BooksCloudloadingResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateBook(params?: any, options?: MethodOptions): + AxiosPromise; + updateBook( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + updateBook( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/cloudloading/updateBook') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Promooffer { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * books.promooffer.accept - * @alias books.promooffer.accept - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.androidId device android_id - * @param {string=} params.device device device - * @param {string=} params.manufacturer device manufacturer - * @param {string=} params.model device model - * @param {string=} params.offerId - * @param {string=} params.product device product - * @param {string=} params.serial device serial - * @param {string=} params.volumeId Volume id to exercise the offer - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - accept(params?: any, options?: MethodOptions): AxiosPromise; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/promooffer/accept') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Dictionary { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.dictionary.listOfflineMetadata + * @desc Returns a list of offline dictionary metadata available + * @alias books.dictionary.listOfflineMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.cpksver The device/version ID from which to request the data. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listOfflineMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + listOfflineMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listOfflineMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/dictionary/listOfflineMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['cpksver'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * books.promooffer.dismiss - * @alias books.promooffer.dismiss - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.androidId device android_id - * @param {string=} params.device device device - * @param {string=} params.manufacturer device manufacturer - * @param {string=} params.model device model - * @param {string=} params.offerId Offer to dimiss - * @param {string=} params.product device product - * @param {string=} params.serial device serial - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - dismiss(params?: any, options?: MethodOptions): AxiosPromise; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/promooffer/dismiss') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Familysharing { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.familysharing.getFamilyInfo + * @desc Gets information regarding the family that the user is part of. + * @alias books.familysharing.getFamilyInfo + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getFamilyInfo(params?: any, options?: MethodOptions): + AxiosPromise; + getFamilyInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getFamilyInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/familysharing/getFamilyInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.familysharing.share + * @desc Initiates sharing of the content with the user's family. Empty + * response indicates success. + * @alias books.familysharing.share + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.docId The docid to share. + * @param {string=} params.source String to identify the originator of this request. + * @param {string=} params.volumeId The volume to share. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + share(params?: any, options?: MethodOptions): AxiosPromise; + share( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + share( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/familysharing/share') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.familysharing.unshare + * @desc Initiates revoking content that has already been shared with the + * user's family. Empty response indicates success. + * @alias books.familysharing.unshare + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.docId The docid to unshare. + * @param {string=} params.source String to identify the originator of this request. + * @param {string=} params.volumeId The volume to unshare. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unshare(params?: any, options?: MethodOptions): AxiosPromise; + unshare( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unshare( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/familysharing/unshare') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * books.promooffer.get - * @desc Returns a list of promo offers available to the user - * @alias books.promooffer.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.androidId device android_id - * @param {string=} params.device device device - * @param {string=} params.manufacturer device manufacturer - * @param {string=} params.model device model - * @param {string=} params.product device product - * @param {string=} params.serial device serial - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/promooffer/get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Layers { + root: Books; + annotationData: Resource$Layers$Annotationdata; + volumeAnnotations: Resource$Layers$Volumeannotations; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.annotationData = new Resource$Layers$Annotationdata(root); + this.volumeAnnotations = new Resource$Layers$Volumeannotations(root); + } + + getRoot() { + return this.root; + } + + + /** + * books.layers.get + * @desc Gets the layer summary for a volume. + * @alias books.layers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.contentVersion The content version for the requested volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.summaryId The ID for the layer to get the summary for. + * @param {string} params.volumeId The volume to retrieve layers for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/volumes/{volumeId}/layersummary/{summaryId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId', 'summaryId'], + pathParams: ['summaryId', 'volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.layers.list + * @desc List the layer summaries for a volume. + * @alias books.layers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.contentVersion The content version for the requested volume. + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken The value of the nextToken from the previous page. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId The volume to retrieve layers for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/{volumeId}/layersummary') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId'], + pathParams: ['volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Series { - root: Books; - membership: Resource$Series$Membership; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.membership = new Resource$Series$Membership(root); + export class Resource$Layers$Annotationdata { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.layers.annotationData.get + * @desc Gets the annotation data. + * @alias books.layers.annotationData.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.allowWebDefinitions For the dictionary layer. Whether or not to allow web definitions. + * @param {string} params.annotationDataId The ID of the annotation data to retrieve. + * @param {string} params.contentVersion The content version for the volume you are trying to retrieve. + * @param {integer=} params.h The requested pixel height for any images. If height is provided width must also be provided. + * @param {string} params.layerId The ID for the layer to get the annotations. + * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {integer=} params.scale The requested scale for the image. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId The volume to retrieve annotations for. + * @param {integer=} params.w The requested pixel width for any images. If width is provided height must also be provided. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/books/v1/volumes/{volumeId}/layers/{layerId}/data/{annotationDataId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['volumeId', 'layerId', 'annotationDataId', 'contentVersion'], + pathParams: ['annotationDataId', 'layerId', 'volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.layers.annotationData.list + * @desc Gets the annotation data for a volume and layer. + * @alias books.layers.annotationData.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.annotationDataId The list of Annotation Data Ids to retrieve. Pagination is ignored if this is set. + * @param {string} params.contentVersion The content version for the requested volume. + * @param {integer=} params.h The requested pixel height for any images. If height is provided width must also be provided. + * @param {string} params.layerId The ID for the layer to get the annotation data. + * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken The value of the nextToken from the previous page. + * @param {integer=} params.scale The requested scale for the image. + * @param {string=} params.source String to identify the originator of this request. + * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string} params.volumeId The volume to retrieve annotation data for. + * @param {integer=} params.w The requested pixel width for any images. If width is provided height must also be provided. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/volumes/{volumeId}/layers/{layerId}/data') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId', 'layerId', 'contentVersion'], + pathParams: ['layerId', 'volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Layers$Volumeannotations { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.layers.volumeAnnotations.get + * @desc Gets the volume annotation. + * @alias books.layers.volumeAnnotations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID of the volume annotation to retrieve. + * @param {string} params.layerId The ID for the layer to get the annotations. + * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId The volume to retrieve annotations for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/books/v1/volumes/{volumeId}/layers/{layerId}/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId', 'layerId', 'annotationId'], + pathParams: ['annotationId', 'layerId', 'volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.layers.volumeAnnotations.list + * @desc Gets the volume annotations for a volume and layer. + * @alias books.layers.volumeAnnotations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.contentVersion The content version for the requested volume. + * @param {string=} params.endOffset The end offset to end retrieving data from. + * @param {string=} params.endPosition The end position to end retrieving data from. + * @param {string} params.layerId The ID for the layer to get the annotations. + * @param {string=} params.locale The locale information for the data. ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken The value of the nextToken from the previous page. + * @param {boolean=} params.showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string=} params.source String to identify the originator of this request. + * @param {string=} params.startOffset The start offset to start retrieving data from. + * @param {string=} params.startPosition The start position to start retrieving data from. + * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string=} params.volumeAnnotationsVersion The version of the volume annotations that you are requesting. + * @param {string} params.volumeId The volume to retrieve annotations for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/{volumeId}/layers/{layerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId', 'layerId', 'contentVersion'], + pathParams: ['layerId', 'volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * books.series.get - * @desc Returns Series metadata for the given series ids. - * @alias books.series.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.series_id String that identifies the series - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/series/get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['series_id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Myconfig { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.myconfig.getUserSettings + * @desc Gets the current settings for the user. + * @alias books.myconfig.getUserSettings + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getUserSettings(params?: any, options?: MethodOptions): + AxiosPromise; + getUserSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getUserSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/myconfig/getUserSettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.myconfig.releaseDownloadAccess + * @desc Release downloaded content access restriction. + * @alias books.myconfig.releaseDownloadAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.cpksver The device/version ID from which to release the restriction. + * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeIds The volume(s) to release restrictions for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + releaseDownloadAccess(params?: any, options?: MethodOptions): + AxiosPromise; + releaseDownloadAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + releaseDownloadAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/myconfig/releaseDownloadAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['volumeIds', 'cpksver'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.myconfig.requestAccess + * @desc Request concurrent and download access restrictions. + * @alias books.myconfig.requestAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.cpksver The device/version ID from which to request the restrictions. + * @param {string=} params.licenseTypes The type of access license to request. If not specified, the default is BOTH. + * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {string} params.nonce The client nonce value. + * @param {string} params.source String to identify the originator of this request. + * @param {string} params.volumeId The volume to request concurrent/download restrictions for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + requestAccess(params?: any, options?: MethodOptions): + AxiosPromise; + requestAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + requestAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/myconfig/requestAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['source', 'volumeId', 'nonce', 'cpksver'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.myconfig.syncVolumeLicenses + * @desc Request downloaded content access for specified volumes on the My + * eBooks shelf. + * @alias books.myconfig.syncVolumeLicenses + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.cpksver The device/version ID from which to release the restriction. + * @param {string=} params.features List of features supported by the client, i.e., 'RENTALS' + * @param {boolean=} params.includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string=} params.locale ISO-639-1, ISO-3166-1 codes for message localization, i.e. en_US. + * @param {string} params.nonce The client nonce value. + * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string} params.source String to identify the originator of this request. + * @param {string=} params.volumeIds The volume(s) to request download restrictions for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + syncVolumeLicenses(params?: any, options?: MethodOptions): + AxiosPromise; + syncVolumeLicenses( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + syncVolumeLicenses( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/myconfig/syncVolumeLicenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['source', 'nonce', 'cpksver'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.myconfig.updateUserSettings + * @desc Sets the settings for the user. If a sub-object is specified, it + * will overwrite the existing sub-object stored in the server. Unspecified + * sub-objects will retain the existing value. + * @alias books.myconfig.updateUserSettings + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Usersettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateUserSettings(params?: any, options?: MethodOptions): + AxiosPromise; + updateUserSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateUserSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/myconfig/updateUserSettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Series$Membership { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + export class Resource$Mylibrary { + root: Books; + annotations: Resource$Mylibrary$Annotations; + bookshelves: Resource$Mylibrary$Bookshelves; + readingpositions: Resource$Mylibrary$Readingpositions; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.annotations = new Resource$Mylibrary$Annotations(root); + this.bookshelves = new Resource$Mylibrary$Bookshelves(root); + this.readingpositions = new Resource$Mylibrary$Readingpositions(root); + } - /** - * books.series.membership.get - * @desc Returns Series membership data given the series id. - * @alias books.series.membership.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.page_size Number of maximum results per page to be included in the response. - * @param {string=} params.page_token The value of the nextToken from the previous page. - * @param {string} params.series_id String that identifies the series - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/series/membership/get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['series_id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } -} - - -export class Resource$Volumes { - root: Books; - associated: Resource$Volumes$Associated; - mybooks: Resource$Volumes$Mybooks; - recommended: Resource$Volumes$Recommended; - useruploaded: Resource$Volumes$Useruploaded; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - this.associated = new Resource$Volumes$Associated(root); - this.mybooks = new Resource$Volumes$Mybooks(root); - this.recommended = new Resource$Volumes$Recommended(root); - this.useruploaded = new Resource$Volumes$Useruploaded(root); + export class Resource$Mylibrary$Annotations { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.mylibrary.annotations.delete + * @desc Deletes an annotation. + * @alias books.mylibrary.annotations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID for the annotation to delete. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['annotationId'], + pathParams: ['annotationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.annotations.insert + * @desc Inserts a new annotation. + * @alias books.mylibrary.annotations.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.annotationId The ID for the annotation to insert. + * @param {string=} params.country ISO-3166-1 code to override the IP-based location. + * @param {boolean=} params.showOnlySummaryInResponse Requests that only the summary of the specified layer be provided in the response. + * @param {string=} params.source String to identify the originator of this request. + * @param {().Annotation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/annotations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.annotations.list + * @desc Retrieves a list of annotations, possibly filtered. + * @alias books.mylibrary.annotations.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.contentVersion The content version for the requested volume. + * @param {string=} params.layerId The layer ID to limit annotation by. + * @param {string=} params.layerIds The layer ID(s) to limit annotation by. + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken The value of the nextToken from the previous page. + * @param {boolean=} params.showDeleted Set to true to return deleted annotations. updatedMin must be in the request to use this. Defaults to false. + * @param {string=} params.source String to identify the originator of this request. + * @param {string=} params.updatedMax RFC 3339 timestamp to restrict to items updated prior to this timestamp (exclusive). + * @param {string=} params.updatedMin RFC 3339 timestamp to restrict to items updated since this timestamp (inclusive). + * @param {string=} params.volumeId The volume to restrict annotations to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/annotations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.annotations.summary + * @desc Gets the summary of specified layers. + * @alias books.mylibrary.annotations.summary + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.layerIds Array of layer IDs to get the summary for. + * @param {string} params.volumeId Volume id to get the summary for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + summary(params?: any, options?: MethodOptions): + AxiosPromise; + summary( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + summary( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/annotations/summary') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['layerIds', 'volumeId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.annotations.update + * @desc Updates an existing annotation. + * @alias books.mylibrary.annotations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID for the annotation to update. + * @param {string=} params.source String to identify the originator of this request. + * @param {().Annotation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['annotationId'], + pathParams: ['annotationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Mylibrary$Bookshelves { + root: Books; + volumes: Resource$Mylibrary$Bookshelves$Volumes; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.volumes = new Resource$Mylibrary$Bookshelves$Volumes(root); + } + + getRoot() { + return this.root; + } + + + /** + * books.mylibrary.bookshelves.addVolume + * @desc Adds a volume to a bookshelf. + * @alias books.mylibrary.bookshelves.addVolume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.reason The reason for which the book is added to the library. + * @param {string} params.shelf ID of bookshelf to which to add a volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of volume to add. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addVolume(params?: any, options?: MethodOptions): AxiosPromise; + addVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/mylibrary/bookshelves/{shelf}/addVolume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['shelf', 'volumeId'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.bookshelves.clearVolumes + * @desc Clears all volumes from a bookshelf. + * @alias books.mylibrary.bookshelves.clearVolumes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.shelf ID of bookshelf from which to remove a volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clearVolumes(params?: any, options?: MethodOptions): AxiosPromise; + clearVolumes( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clearVolumes( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/mylibrary/bookshelves/{shelf}/clearVolumes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['shelf'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.bookshelves.get + * @desc Retrieves metadata for a specific bookshelf belonging to the + * authenticated user. + * @alias books.mylibrary.bookshelves.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.shelf ID of bookshelf to retrieve. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['shelf'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.bookshelves.list + * @desc Retrieves a list of bookshelves belonging to the authenticated + * user. + * @alias books.mylibrary.bookshelves.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/bookshelves') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.bookshelves.moveVolume + * @desc Moves a volume within a bookshelf. + * @alias books.mylibrary.bookshelves.moveVolume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.shelf ID of bookshelf with the volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of volume to move. + * @param {integer} params.volumePosition Position on shelf to move the item (0 puts the item before the current first item, 1 puts it between the first and the second and so on.) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveVolume(params?: any, options?: MethodOptions): AxiosPromise; + moveVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/mylibrary/bookshelves/{shelf}/moveVolume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['shelf', 'volumeId', 'volumePosition'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.bookshelves.removeVolume + * @desc Removes a volume from a bookshelf. + * @alias books.mylibrary.bookshelves.removeVolume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.reason The reason for which the book is removed from the library. + * @param {string} params.shelf ID of bookshelf from which to remove a volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of volume to remove. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeVolume(params?: any, options?: MethodOptions): AxiosPromise; + removeVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeVolume( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/books/v1/mylibrary/bookshelves/{shelf}/removeVolume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['shelf', 'volumeId'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - - /** - * books.volumes.get - * @desc Gets volume information for a single volume. - * @alias books.volumes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.country ISO-3166-1 code to override the IP-based location. - * @param {boolean=} params.includeNonComicsSeries Set to true to include non-comics series. Defaults to false. - * @param {string=} params.partner Brand results for partner ID. - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string=} params.source String to identify the originator of this request. - * @param {boolean=} params.user_library_consistent_read - * @param {string} params.volumeId ID of volume to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/{volumeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId'], - pathParams: ['volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Mylibrary$Bookshelves$Volumes { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.mylibrary.bookshelves.volumes.list + * @desc Gets volume information for volumes on a bookshelf. + * @alias books.mylibrary.bookshelves.volumes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.country ISO-3166-1 code to override the IP-based location. + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string=} params.q Full-text search query string in this bookshelf. + * @param {string} params.shelf The bookshelf ID or name retrieve volumes for. + * @param {boolean=} params.showPreorders Set to true to show pre-ordered books. Defaults to false. + * @param {string=} params.source String to identify the originator of this request. + * @param {integer=} params.startIndex Index of the first element to return (starts at 0) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/bookshelves/{shelf}/volumes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['shelf'], + pathParams: ['shelf'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * books.volumes.list - * @desc Performs a book search. - * @alias books.volumes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.download Restrict to volumes by download availability. - * @param {string=} params.filter Filter search results. - * @param {string=} params.langRestrict Restrict results to books with this language code. - * @param {string=} params.libraryRestrict Restrict search to this user's library. - * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderBy Sort search results. - * @param {string=} params.partner Restrict and brand results for partner ID. - * @param {string=} params.printType Restrict to books or magazines. - * @param {string=} params.projection Restrict information returned to a set of selected fields. - * @param {string} params.q Full-text search query string. - * @param {boolean=} params.showPreorders Set to true to show books available for preorder. Defaults to false. - * @param {string=} params.source String to identify the originator of this request. - * @param {integer=} params.startIndex Index of the first result to return (starts at 0) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['q'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Mylibrary$Readingpositions { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.mylibrary.readingpositions.get + * @desc Retrieves my reading position information for a volume. + * @alias books.mylibrary.readingpositions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.contentVersion Volume content version for which this reading position is requested. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of volume for which to retrieve a reading position. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/mylibrary/readingpositions/{volumeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId'], + pathParams: ['volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.mylibrary.readingpositions.setPosition + * @desc Sets my reading position information for a volume. + * @alias books.mylibrary.readingpositions.setPosition + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.action Action that caused this reading position to be set. + * @param {string=} params.contentVersion Volume content version for which this reading position applies. + * @param {string=} params.deviceCookie Random persistent device cookie optional on set position. + * @param {string} params.position Position string for the new volume reading position. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.timestamp RFC 3339 UTC format timestamp associated with this reading position. + * @param {string} params.volumeId ID of volume for which to update the reading position. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setPosition(params?: any, options?: MethodOptions): AxiosPromise; + setPosition( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setPosition( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/books/v1/mylibrary/readingpositions/{volumeId}/setPosition') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['volumeId', 'timestamp', 'position'], + pathParams: ['volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Volumes$Associated { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * books.volumes.associated.list - * @desc Return a list of associated books. - * @alias books.volumes.associated.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.association Association type. - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of the source volume. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/{volumeId}/associated') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['volumeId'], - pathParams: ['volumeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Notification { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.notification.get + * @desc Returns notification details for a given notification id. + * @alias books.notification.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating notification title and body. + * @param {string} params.notification_id String to identify the notification. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/notification/get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['notification_id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Volumes$Mybooks { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Onboarding { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.onboarding.listCategories + * @desc List categories for onboarding experience. + * @alias books.onboarding.listCategories + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listCategories(params?: any, options?: MethodOptions): + AxiosPromise; + listCategories( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listCategories( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/onboarding/listCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.onboarding.listCategoryVolumes + * @desc List available volumes under categories for onboarding experience. + * @alias books.onboarding.listCategoryVolumes + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.categoryId List of category ids requested. + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Default is en-US if unset. + * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned volumes. Books with a higher maturity rating are filtered out. + * @param {integer=} params.pageSize Number of maximum results per page to be included in the response. + * @param {string=} params.pageToken The value of the nextToken from the previous page. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listCategoryVolumes(params?: any, options?: MethodOptions): + AxiosPromise; + listCategoryVolumes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listCategoryVolumes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/onboarding/listCategoryVolumes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Personalizedstream { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.personalizedstream.get + * @desc Returns a stream of personalized book clusters + * @alias books.personalizedstream.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/personalizedstream/get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * books.volumes.mybooks.list - * @desc Return a list of books in My Library. - * @alias books.volumes.mybooks.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.acquireMethod How the book was acquired - * @param {string=} params.country ISO-3166-1 code to override the IP-based location. - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. - * @param {string=} params.source String to identify the originator of this request. - * @param {integer=} params.startIndex Index of the first result to return (starts at 0) - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/mybooks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Promooffer { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.promooffer.accept + * @alias books.promooffer.accept + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.androidId device android_id + * @param {string=} params.device device device + * @param {string=} params.manufacturer device manufacturer + * @param {string=} params.model device model + * @param {string=} params.offerId + * @param {string=} params.product device product + * @param {string=} params.serial device serial + * @param {string=} params.volumeId Volume id to exercise the offer + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + accept(params?: any, options?: MethodOptions): AxiosPromise; + accept( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + accept( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/promooffer/accept') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.promooffer.dismiss + * @alias books.promooffer.dismiss + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.androidId device android_id + * @param {string=} params.device device device + * @param {string=} params.manufacturer device manufacturer + * @param {string=} params.model device model + * @param {string=} params.offerId Offer to dimiss + * @param {string=} params.product device product + * @param {string=} params.serial device serial + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + dismiss(params?: any, options?: MethodOptions): AxiosPromise; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/promooffer/dismiss') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.promooffer.get + * @desc Returns a list of promo offers available to the user + * @alias books.promooffer.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.androidId device android_id + * @param {string=} params.device device device + * @param {string=} params.manufacturer device manufacturer + * @param {string=} params.model device model + * @param {string=} params.product device product + * @param {string=} params.serial device serial + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/promooffer/get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Volumes$Recommended { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Series { + root: Books; + membership: Resource$Series$Membership; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.membership = new Resource$Series$Membership(root); + } + + getRoot() { + return this.root; + } + + + /** + * books.series.get + * @desc Returns Series metadata for the given series ids. + * @alias books.series.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.series_id String that identifies the series + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/series/get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['series_id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - getRoot() { - return this.root; + export class Resource$Series$Membership { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.series.membership.get + * @desc Returns Series membership data given the series id. + * @alias books.series.membership.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.page_size Number of maximum results per page to be included in the response. + * @param {string=} params.page_token The value of the nextToken from the previous page. + * @param {string} params.series_id String that identifies the series + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/series/membership/get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['series_id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * books.volumes.recommended.list - * @desc Return a list of recommended books for the current user. - * @alias books.volumes.recommended.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. - * @param {string=} params.source String to identify the originator of this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/recommended') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Volumes { + root: Books; + associated: Resource$Volumes$Associated; + mybooks: Resource$Volumes$Mybooks; + recommended: Resource$Volumes$Recommended; + useruploaded: Resource$Volumes$Useruploaded; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + this.associated = new Resource$Volumes$Associated(root); + this.mybooks = new Resource$Volumes$Mybooks(root); + this.recommended = new Resource$Volumes$Recommended(root); + this.useruploaded = new Resource$Volumes$Useruploaded(root); + } + + getRoot() { + return this.root; + } + + + /** + * books.volumes.get + * @desc Gets volume information for a single volume. + * @alias books.volumes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.country ISO-3166-1 code to override the IP-based location. + * @param {boolean=} params.includeNonComicsSeries Set to true to include non-comics series. Defaults to false. + * @param {string=} params.partner Brand results for partner ID. + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string=} params.source String to identify the originator of this request. + * @param {boolean=} params.user_library_consistent_read + * @param {string} params.volumeId ID of volume to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/{volumeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId'], + pathParams: ['volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.volumes.list + * @desc Performs a book search. + * @alias books.volumes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.download Restrict to volumes by download availability. + * @param {string=} params.filter Filter search results. + * @param {string=} params.langRestrict Restrict results to books with this language code. + * @param {string=} params.libraryRestrict Restrict search to this user's library. + * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderBy Sort search results. + * @param {string=} params.partner Restrict and brand results for partner ID. + * @param {string=} params.printType Restrict to books or magazines. + * @param {string=} params.projection Restrict information returned to a set of selected fields. + * @param {string} params.q Full-text search query string. + * @param {boolean=} params.showPreorders Set to true to show books available for preorder. Defaults to false. + * @param {string=} params.source String to identify the originator of this request. + * @param {integer=} params.startIndex Index of the first result to return (starts at 0) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/books/v1/volumes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['q'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * books.volumes.recommended.rate - * @desc Rate a recommended book for the current user. - * @alias books.volumes.recommended.rate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {string} params.rating Rating to be given to the volume. - * @param {string=} params.source String to identify the originator of this request. - * @param {string} params.volumeId ID of the source volume. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rate(params?: any, options?: MethodOptions): - AxiosPromise; - rate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - rate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/recommended/rate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['rating', 'volumeId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Volumes$Associated { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.volumes.associated.list + * @desc Return a list of associated books. + * @alias books.volumes.associated.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.association Association type. + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of the source volume. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/{volumeId}/associated') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['volumeId'], + pathParams: ['volumeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Volumes$Useruploaded { - root: Books; - constructor(root: Books) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Volumes$Mybooks { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.volumes.mybooks.list + * @desc Return a list of books in My Library. + * @alias books.volumes.mybooks.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.acquireMethod How the book was acquired + * @param {string=} params.country ISO-3166-1 code to override the IP-based location. + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex:'en_US'. Used for generating recommendations. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.processingState The processing state of the user uploaded volumes to be returned. Applicable only if the UPLOADED is specified in the acquireMethod. + * @param {string=} params.source String to identify the originator of this request. + * @param {integer=} params.startIndex Index of the first result to return (starts at 0) + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/mybooks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Volumes$Recommended { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.volumes.recommended.list + * @desc Return a list of recommended books for the current user. + * @alias books.volumes.recommended.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string=} params.maxAllowedMaturityRating The maximum allowed maturity rating of returned recommendations. Books with a higher maturity rating are filtered out. + * @param {string=} params.source String to identify the originator of this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/recommended') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * books.volumes.recommended.rate + * @desc Rate a recommended book for the current user. + * @alias books.volumes.recommended.rate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {string} params.rating Rating to be given to the volume. + * @param {string=} params.source String to identify the originator of this request. + * @param {string} params.volumeId ID of the source volume. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rate(params?: any, options?: MethodOptions): + AxiosPromise; + rate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + rate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/recommended/rate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['rating', 'volumeId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * books.volumes.useruploaded.list - * @desc Return a list of books uploaded by the current user. - * @alias books.volumes.useruploaded.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.processingState The processing state of the user uploaded volumes to be returned. - * @param {string=} params.source String to identify the originator of this request. - * @param {integer=} params.startIndex Index of the first result to return (starts at 0) - * @param {string=} params.volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/books/v1/volumes/useruploaded') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Volumes$Useruploaded { + root: Books; + constructor(root: Books) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * books.volumes.useruploaded.list + * @desc Return a list of books uploaded by the current user. + * @alias books.volumes.useruploaded.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.locale ISO-639-1 language and ISO-3166-1 country code. Ex: 'en_US'. Used for generating recommendations. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.processingState The processing state of the user uploaded volumes to be returned. + * @param {string=} params.source String to identify the originator of this request. + * @param {integer=} params.startIndex Index of the first result to return (starts at 0) + * @param {string=} params.volumeId The ids of the volumes to be returned. If not specified all that match the processingState are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/books/v1/volumes/useruploaded') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/calendar/v3.ts b/src/apis/calendar/v3.ts index 5b5dd1f7753..6e950dbf841 100644 --- a/src/apis/calendar/v3.ts +++ b/src/apis/calendar/v3.ts @@ -27,2504 +27,2530 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Calendar API - * - * Manipulates events and other calendar data. - * - * @example - * const google = require('googleapis'); - * const calendar = google.calendar('v3'); - * - * @namespace calendar - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Calendar - */ -export class Calendar { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - acl: Resource$Acl; - calendarList: Resource$Calendarlist; - calendars: Resource$Calendars; - channels: Resource$Channels; - colors: Resource$Colors; - events: Resource$Events; - freebusy: Resource$Freebusy; - settings: Resource$Settings; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.acl = new Resource$Acl(this); - this.calendarList = new Resource$Calendarlist(this); - this.calendars = new Resource$Calendars(this); - this.channels = new Resource$Channels(this); - this.colors = new Resource$Colors(this); - this.events = new Resource$Events(this); - this.freebusy = new Resource$Freebusy(this); - this.settings = new Resource$Settings(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Acl { - /** - * ETag of the collection. - */ - etag: string; - /** - * List of rules on the access control list. - */ - items: Schema$AclRule[]; - /** - * Type of the collection ("calendar#acl"). - */ - kind: string; - /** - * Token used to access the next page of this result. Omitted if no further - * results are available, in which case nextSyncToken is provided. - */ - nextPageToken: string; - /** - * Token used at a later point in time to retrieve only the entries that have - * changed since this result was returned. Omitted if further results are - * available, in which case nextPageToken is provided. - */ - nextSyncToken: string; -} -export interface Schema$AclRule { - /** - * ETag of the resource. - */ - etag: string; - /** - * Identifier of the ACL rule. - */ - id: string; - /** - * Type of the resource ("calendar#aclRule"). - */ - kind: string; - /** - * The role assigned to the scope. Possible values are: - "none" - - * Provides no access. - "freeBusyReader" - Provides read access to - * free/busy information. - "reader" - Provides read access to the - * calendar. Private events will appear to users with reader access, but event - * details will be hidden. - "writer" - Provides read and write - * access to the calendar. Private events will appear to users with writer - * access, and event details will be visible. - "owner" - Provides - * ownership of the calendar. This role has all of the permissions of the - * writer role with the additional ability to see and manipulate ACLs. - */ - role: string; - /** - * The scope of the rule. - */ - scope: any; -} -export interface Schema$Calendar { - /** - * Conferencing properties for this calendar, for example what types of - * conferences are allowed. - */ - conferenceProperties: Schema$ConferenceProperties; - /** - * Description of the calendar. Optional. - */ - description: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Identifier of the calendar. To retrieve IDs call the calendarList.list() - * method. - */ - id: string; - /** - * Type of the resource ("calendar#calendar"). - */ - kind: string; - /** - * Geographic location of the calendar as free-form text. Optional. - */ - location: string; - /** - * Title of the calendar. - */ - summary: string; - /** - * The time zone of the calendar. (Formatted as an IANA Time Zone Database - * name, e.g. "Europe/Zurich".) Optional. - */ - timeZone: string; -} -export interface Schema$CalendarList { - /** - * ETag of the collection. - */ - etag: string; - /** - * Calendars that are present on the user's calendar list. - */ - items: Schema$CalendarListEntry[]; - /** - * Type of the collection ("calendar#calendarList"). - */ - kind: string; - /** - * Token used to access the next page of this result. Omitted if no further - * results are available, in which case nextSyncToken is provided. - */ - nextPageToken: string; - /** - * Token used at a later point in time to retrieve only the entries that have - * changed since this result was returned. Omitted if further results are - * available, in which case nextPageToken is provided. - */ - nextSyncToken: string; -} -export interface Schema$CalendarListEntry { - /** - * The effective access role that the authenticated user has on the calendar. - * Read-only. Possible values are: - "freeBusyReader" - Provides - * read access to free/busy information. - "reader" - Provides read - * access to the calendar. Private events will appear to users with reader - * access, but event details will be hidden. - "writer" - Provides - * read and write access to the calendar. Private events will appear to users - * with writer access, and event details will be visible. - "owner" - * - Provides ownership of the calendar. This role has all of the permissions - * of the writer role with the additional ability to see and manipulate ACLs. - */ - accessRole: string; - /** - * The main color of the calendar in the hexadecimal format - * "#0088aa". This property supersedes the index-based colorId - * property. To set or change this property, you need to specify - * colorRgbFormat=true in the parameters of the insert, update and patch - * methods. Optional. - */ - backgroundColor: string; - /** - * The color of the calendar. This is an ID referring to an entry in the - * calendar section of the colors definition (see the colors endpoint). This - * property is superseded by the backgroundColor and foregroundColor - * properties and can be ignored when using these properties. Optional. - */ - colorId: string; - /** - * Conferencing properties for this calendar, for example what types of - * conferences are allowed. - */ - conferenceProperties: Schema$ConferenceProperties; - /** - * The default reminders that the authenticated user has for this calendar. - */ - defaultReminders: Schema$EventReminder[]; - /** - * Whether this calendar list entry has been deleted from the calendar list. - * Read-only. Optional. The default is False. - */ - deleted: boolean; - /** - * Description of the calendar. Optional. Read-only. - */ - description: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * The foreground color of the calendar in the hexadecimal format - * "#ffffff". This property supersedes the index-based colorId - * property. To set or change this property, you need to specify - * colorRgbFormat=true in the parameters of the insert, update and patch - * methods. Optional. - */ - foregroundColor: string; - /** - * Whether the calendar has been hidden from the list. Optional. The default - * is False. - */ - hidden: boolean; - /** - * Identifier of the calendar. - */ - id: string; - /** - * Type of the resource ("calendar#calendarListEntry"). - */ - kind: string; - /** - * Geographic location of the calendar as free-form text. Optional. Read-only. - */ - location: string; - /** - * The notifications that the authenticated user is receiving for this - * calendar. - */ - notificationSettings: any; - /** - * Whether the calendar is the primary calendar of the authenticated user. - * Read-only. Optional. The default is False. - */ - primary: boolean; - /** - * Whether the calendar content shows up in the calendar UI. Optional. The - * default is False. - */ - selected: boolean; - /** - * Title of the calendar. Read-only. - */ - summary: string; - /** - * The summary that the authenticated user has set for this calendar. - * Optional. - */ - summaryOverride: string; - /** - * The time zone of the calendar. Optional. Read-only. - */ - timeZone: string; -} -export interface Schema$CalendarNotification { - /** - * The method used to deliver the notification. Possible values are: - - * "email" - Reminders are sent via email. - "sms" - - * Reminders are sent via SMS. This value is read-only and is ignored on - * inserts and updates. SMS reminders are only available for G Suite - * customers. - */ - method: string; - /** - * The type of notification. Possible values are: - - * "eventCreation" - Notification sent when a new event is put on - * the calendar. - "eventChange" - Notification sent when an event - * is changed. - "eventCancellation" - Notification sent when an - * event is cancelled. - "eventResponse" - Notification sent when - * an event is changed. - "agenda" - An agenda with the events of - * the day (sent out in the morning). - */ - type: string; -} -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -export interface Schema$ColorDefinition { - /** - * The background color associated with this color definition. - */ - background: string; - /** - * The foreground color that can be used to write on top of a background with - * 'background' color. - */ - foreground: string; -} -export interface Schema$Colors { - /** - * A global palette of calendar colors, mapping from the color ID to its - * definition. A calendarListEntry resource refers to one of these color IDs - * in its color field. Read-only. - */ - calendar: any; - /** - * A global palette of event colors, mapping from the color ID to its - * definition. An event resource may refer to one of these color IDs in its - * color field. Read-only. - */ - event: any; - /** - * Type of the resource ("calendar#colors"). - */ - kind: string; - /** - * Last modification time of the color palette (as a RFC3339 timestamp). - * Read-only. - */ - updated: string; -} -export interface Schema$ConferenceData { - /** - * The ID of the conference. Can be used by developers to keep track of - * conferences, should not be displayed to users. Values for solution types: - * - "eventHangout": unset. - "eventNamedHangout": the - * name of the Hangout. - "hangoutsMeet": the 10-letter meeting - * code, for example "aaa-bbbb-ccc". Optional. - */ - conferenceId: string; - /** - * The conference solution, such as Hangouts or Hangouts Meet. Unset for a - * conference with a failed create request. Either conferenceSolution and at - * least one entryPoint, or createRequest is required. - */ - conferenceSolution: Schema$ConferenceSolution; - /** - * A request to generate a new conference and attach it to the event. The data - * is generated asynchronously. To see whether the data is present check the - * status field. Either conferenceSolution and at least one entryPoint, or - * createRequest is required. - */ - createRequest: Schema$CreateConferenceRequest; - /** - * Information about individual conference entry points, such as URLs or phone - * numbers. All of them must belong to the same conference. Either - * conferenceSolution and at least one entryPoint, or createRequest is - * required. - */ - entryPoints: Schema$EntryPoint[]; - /** - * Additional notes (such as instructions from the domain administrator, legal - * notices) to display to the user. Can contain HTML. The maximum length is - * 2048 characters. Optional. - */ - notes: string; - /** - * Additional properties related to a conference. An example would be a - * solution-specific setting for enabling video streaming. - */ - parameters: Schema$ConferenceParameters; - /** - * The signature of the conference data. Genereated on server side. Must be - * preserved while copying the conference data between events, otherwise the - * conference data will not be copied. Unset for a conference with a failed - * create request. Optional for a conference with a pending create request. - */ - signature: string; -} -export interface Schema$ConferenceParameters { - /** - * Additional add-on specific data. - */ - addOnParameters: Schema$ConferenceParametersAddOnParameters; -} -export interface Schema$ConferenceParametersAddOnParameters { parameters: any; } -export interface Schema$ConferenceProperties { - /** - * The types of conference solutions that are supported for this calendar. The - * possible values are: - "eventHangout" - - * "eventNamedHangout" - "hangoutsMeet" Optional. - */ - allowedConferenceSolutionTypes: string[]; -} -export interface Schema$ConferenceRequestStatus { - /** - * The current status of the conference create request. Read-only. The - * possible values are: - "pending": the conference create request - * is still being processed. - "success": the conference create - * request succeeded, the entry points are populated. - "failure": - * the conference create request failed, there are no entry points. - */ - statusCode: string; -} -export interface Schema$ConferenceSolution { - /** - * The user-visible icon for this solution. - */ - iconUri: string; - /** - * The key which can uniquely identify the conference solution for this event. - */ - key: Schema$ConferenceSolutionKey; - /** - * The user-visible name of this solution. Not localized. - */ - name: string; -} -export interface Schema$ConferenceSolutionKey { - /** - * The conference solution type. If a client encounters an unfamiliar or empty - * type, it should still be able to display the entry points. However, it - * should disallow modifications. The possible values are: - - * "eventHangout" for Hangouts for consumers - * (http://hangouts.google.com) - "eventNamedHangout" for classic - * Hangouts for G Suite users (http://hangouts.google.com) - - * "hangoutsMeet" for Hangouts Meet (http://meet.google.com) - */ - type: string; -} -export interface Schema$CreateConferenceRequest { - /** - * The conference solution, such as Hangouts or Hangouts Meet. - */ - conferenceSolutionKey: Schema$ConferenceSolutionKey; - /** - * The client-generated unique ID for this request. Clients should regenerate - * this ID for every new request. If an ID provided is the same as for the - * previous request, the request is ignored. - */ - requestId: string; - /** - * The status of the conference create request. - */ - status: Schema$ConferenceRequestStatus; -} -export interface Schema$EntryPoint { - /** - * The access code to access the conference. The maximum length is 128 - * characters. When creating new conference data, populate only the subset of - * {meetingCode, accessCode, passcode, password, pin} fields that match the - * terminology that the conference provider uses. Only the populated fields - * should be displayed. Optional. - */ - accessCode: string; - /** - * The type of the conference entry point. Possible values are: - - * "video" - joining a conference over HTTP. A conference can have - * zero or one video entry point. - "phone" - joining a conference - * by dialing a phone number. A conference can have zero or more phone entry - * points. - "sip" - joining a conference over SIP. A conference can - * have zero or one sip entry point. - "more" - further conference - * joining instructions, for example additional phone numbers. A conference - * can have zero or one more entry point. A conference with only a more entry - * point is not a valid conference. - */ - entryPointType: string; - /** - * The label for the URI. Visible to end users. Not localized. The maximum - * length is 512 characters. Examples: - for video: - * meet.google.com/aaa-bbbb-ccc - for phone: +1 123 268 2601 - for sip: - * 12345678@altostrat.com - for more: should not be filled Optional. - */ - label: string; - /** - * The meeting code to access the conference. The maximum length is 128 - * characters. When creating new conference data, populate only the subset of - * {meetingCode, accessCode, passcode, password, pin} fields that match the - * terminology that the conference provider uses. Only the populated fields - * should be displayed. Optional. - */ - meetingCode: string; - /** - * The passcode to access the conference. The maximum length is 128 - * characters. When creating new conference data, populate only the subset of - * {meetingCode, accessCode, passcode, password, pin} fields that match the - * terminology that the conference provider uses. Only the populated fields - * should be displayed. - */ - passcode: string; - /** - * The password to access the conference. The maximum length is 128 - * characters. When creating new conference data, populate only the subset of - * {meetingCode, accessCode, passcode, password, pin} fields that match the - * terminology that the conference provider uses. Only the populated fields - * should be displayed. Optional. - */ - password: string; - /** - * The PIN to access the conference. The maximum length is 128 characters. - * When creating new conference data, populate only the subset of - * {meetingCode, accessCode, passcode, password, pin} fields that match the - * terminology that the conference provider uses. Only the populated fields - * should be displayed. Optional. - */ - pin: string; - /** - * The URI of the entry point. The maximum length is 1300 characters. Format: - * - for video, http: or https: schema is required. - for phone, tel: schema - * is required. The URI should include the entire dial sequence (e.g., - * tel:+12345678900,,,123456789;1234). - for sip, sip: schema is required, - * e.g., sip:12345678@myprovider.com. - for more, http: or https: schema is - * required. - */ - uri: string; -} -export interface Schema$Error { - /** - * Domain, or broad category, of the error. - */ - domain: string; - /** - * Specific reason for the error. Some of the possible values are: - - * "groupTooBig" - The group of users requested is too large for a - * single query. - "tooManyCalendarsRequested" - The number of - * calendars requested is too large for a single query. - - * "notFound" - The requested resource was not found. - - * "internalError" - The API service has encountered an internal - * error. Additional error types may be added in the future, so clients - * should gracefully handle additional error statuses not included in this - * list. - */ - reason: string; -} -export interface Schema$Event { - /** - * Whether anyone can invite themselves to the event (currently works for - * Google+ events only). Optional. The default is False. - */ - anyoneCanAddSelf: boolean; - /** - * File attachments for the event. Currently only Google Drive attachments are - * supported. In order to modify attachments the supportsAttachments request - * parameter should be set to true. There can be at most 25 attachments per - * event, - */ - attachments: Schema$EventAttachment[]; - /** - * The attendees of the event. See the Events with attendees guide for more - * information on scheduling events with other calendar users. - */ - attendees: Schema$EventAttendee[]; - /** - * Whether attendees may have been omitted from the event's - * representation. When retrieving an event, this may be due to a restriction - * specified by the maxAttendee query parameter. When updating an event, this - * can be used to only update the participant's response. Optional. The - * default is False. - */ - attendeesOmitted: boolean; - /** - * The color of the event. This is an ID referring to an entry in the event - * section of the colors definition (see the colors endpoint). Optional. - */ - colorId: string; - /** - * The conference-related information, such as details of a Hangouts Meet - * conference. To create new conference details use the createRequest field. - * To persist your changes, remember to set the conferenceDataVersion request - * parameter to 1 for all event modification requests. - */ - conferenceData: Schema$ConferenceData; - /** - * Creation time of the event (as a RFC3339 timestamp). Read-only. - */ - created: string; - /** - * The creator of the event. Read-only. - */ - creator: any; - /** - * Description of the event. Optional. - */ - description: string; - /** - * The (exclusive) end time of the event. For a recurring event, this is the - * end time of the first instance. - */ - end: Schema$EventDateTime; - /** - * Whether the end time is actually unspecified. An end time is still provided - * for compatibility reasons, even if this attribute is set to True. The - * default is False. - */ - endTimeUnspecified: boolean; - /** - * ETag of the resource. - */ - etag: string; - /** - * Extended properties of the event. - */ - extendedProperties: any; - /** - * A gadget that extends this event. - */ - gadget: any; - /** - * Whether attendees other than the organizer can invite others to the event. - * Optional. The default is True. - */ - guestsCanInviteOthers: boolean; - /** - * Whether attendees other than the organizer can modify the event. Optional. - * The default is False. - */ - guestsCanModify: boolean; - /** - * Whether attendees other than the organizer can see who the event's - * attendees are. Optional. The default is True. - */ - guestsCanSeeOtherGuests: boolean; - /** - * An absolute link to the Google+ hangout associated with this event. - * Read-only. - */ - hangoutLink: string; - /** - * An absolute link to this event in the Google Calendar Web UI. Read-only. - */ - htmlLink: string; - /** - * Event unique identifier as defined in RFC5545. It is used to uniquely - * identify events accross calendaring systems and must be supplied when - * importing events via the import method. Note that the icalUID and the id - * are not identical and only one of them should be supplied at event creation - * time. One difference in their semantics is that in recurring events, all - * occurrences of one event have different ids while they all share the same - * icalUIDs. - */ - iCalUID: string; - /** - * Opaque identifier of the event. When creating new single or recurring - * events, you can specify their IDs. Provided IDs must follow these rules: - - * characters allowed in the ID are those used in base32hex encoding, i.e. - * lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 - the - * length of the ID must be between 5 and 1024 characters - the ID must be - * unique per calendar Due to the globally distributed nature of the system, - * we cannot guarantee that ID collisions will be detected at event creation - * time. To minimize the risk of collisions we recommend using an established - * UUID algorithm such as one described in RFC4122. If you do not specify an - * ID, it will be automatically generated by the server. Note that the icalUID - * and the id are not identical and only one of them should be supplied at - * event creation time. One difference in their semantics is that in recurring - * events, all occurrences of one event have different ids while they all - * share the same icalUIDs. - */ - id: string; - /** - * Type of the resource ("calendar#event"). - */ - kind: string; - /** - * Geographic location of the event as free-form text. Optional. - */ - location: string; - /** - * Whether this is a locked event copy where no changes can be made to the - * main event fields "summary", "description", - * "location", "start", "end" or - * "recurrence". The default is False. Read-Only. - */ - locked: boolean; - /** - * The organizer of the event. If the organizer is also an attendee, this is - * indicated with a separate entry in attendees with the organizer field set - * to True. To change the organizer, use the move operation. Read-only, except - * when importing an event. - */ - organizer: any; - /** - * For an instance of a recurring event, this is the time at which this event - * would start according to the recurrence data in the recurring event - * identified by recurringEventId. Immutable. - */ - originalStartTime: Schema$EventDateTime; - /** - * Whether this is a private event copy where changes are not shared with - * other copies on other calendars. Optional. Immutable. The default is False. - */ - privateCopy: boolean; - /** - * List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as - * specified in RFC5545. Note that DTSTART and DTEND lines are not allowed in - * this field; event start and end times are specified in the start and end - * fields. This field is omitted for single events or instances of recurring - * events. - */ - recurrence: string[]; - /** - * For an instance of a recurring event, this is the id of the recurring event - * to which this instance belongs. Immutable. - */ - recurringEventId: string; - /** - * Information about the event's reminders for the authenticated user. - */ - reminders: any; - /** - * Sequence number as per iCalendar. - */ - sequence: number; - /** - * Source from which the event was created. For example, a web page, an email - * message or any document identifiable by an URL with HTTP or HTTPS scheme. - * Can only be seen or modified by the creator of the event. - */ - source: any; - /** - * The (inclusive) start time of the event. For a recurring event, this is the - * start time of the first instance. - */ - start: Schema$EventDateTime; - /** - * Status of the event. Optional. Possible values are: - - * "confirmed" - The event is confirmed. This is the default status. - * - "tentative" - The event is tentatively confirmed. - - * "cancelled" - The event is cancelled. - */ - status: string; - /** - * Title of the event. - */ - summary: string; - /** - * Whether the event blocks time on the calendar. Optional. Possible values - * are: - "opaque" - Default value. The event does block time on - * the calendar. This is equivalent to setting Show me as to Busy in the - * Calendar UI. - "transparent" - The event does not block time on - * the calendar. This is equivalent to setting Show me as to Available in the - * Calendar UI. - */ - transparency: string; - /** - * Last modification time of the event (as a RFC3339 timestamp). Read-only. - */ - updated: string; - /** - * Visibility of the event. Optional. Possible values are: - - * "default" - Uses the default visibility for events on the - * calendar. This is the default value. - "public" - The event is - * public and event details are visible to all readers of the calendar. - - * "private" - The event is private and only event attendees may - * view event details. - "confidential" - The event is private. - * This value is provided for compatibility reasons. - */ - visibility: string; -} -export interface Schema$EventAttachment { - /** - * ID of the attached file. Read-only. For Google Drive files, this is the ID - * of the corresponding Files resource entry in the Drive API. - */ - fileId: string; - /** - * URL link to the attachment. For adding Google Drive file attachments use - * the same format as in alternateLink property of the Files resource in the - * Drive API. - */ - fileUrl: string; - /** - * URL link to the attachment's icon. Read-only. - */ - iconLink: string; - /** - * Internet media type (MIME type) of the attachment. - */ - mimeType: string; - /** - * Attachment title. - */ - title: string; -} -export interface Schema$EventAttendee { - /** - * Number of additional guests. Optional. The default is 0. - */ - additionalGuests: number; - /** - * The attendee's response comment. Optional. - */ - comment: string; - /** - * The attendee's name, if available. Optional. - */ - displayName: string; - /** - * The attendee's email address, if available. This field must be present - * when adding an attendee. It must be a valid email address as per RFC5322. - */ - email: string; - /** - * The attendee's Profile ID, if available. It corresponds to theid field - * in the People collection of the Google+ API - */ - id: string; - /** - * Whether this is an optional attendee. Optional. The default is False. - */ - optional: boolean; - /** - * Whether the attendee is the organizer of the event. Read-only. The default - * is False. - */ - organizer: boolean; - /** - * Whether the attendee is a resource. Can only be set when the attendee is - * added to the event for the first time. Subsequent modifications are - * ignored. Optional. The default is False. - */ - resource: boolean; - /** - * The attendee's response status. Possible values are: - - * "needsAction" - The attendee has not responded to the invitation. - * - "declined" - The attendee has declined the invitation. - - * "tentative" - The attendee has tentatively accepted the - * invitation. - "accepted" - The attendee has accepted the - * invitation. - */ - responseStatus: string; - /** - * Whether this entry represents the calendar on which this copy of the event - * appears. Read-only. The default is False. - */ - self: boolean; -} -export interface Schema$EventDateTime { - /** - * The date, in the format "yyyy-mm-dd", if this is an all-day - * event. - */ - date: string; - /** - * The time, as a combined date-time value (formatted according to RFC3339). A - * time zone offset is required unless a time zone is explicitly specified in - * timeZone. - */ - dateTime: string; - /** - * The time zone in which the time is specified. (Formatted as an IANA Time - * Zone Database name, e.g. "Europe/Zurich".) For recurring events - * this field is required and specifies the time zone in which the recurrence - * is expanded. For single events this field is optional and indicates a - * custom time zone for the event start/end. - */ - timeZone: string; -} -export interface Schema$EventReminder { - /** - * The method used by this reminder. Possible values are: - - * "email" - Reminders are sent via email. - "sms" - - * Reminders are sent via SMS. These are only available for G Suite customers. - * Requests to set SMS reminders for other account types are ignored. - - * "popup" - Reminders are sent via a UI popup. - */ - method: string; - /** - * Number of minutes before the start of the event when the reminder should - * trigger. Valid values are between 0 and 40320 (4 weeks in minutes). - */ - minutes: number; -} -export interface Schema$Events { - /** - * The user's access role for this calendar. Read-only. Possible values - * are: - "none" - The user has no access. - - * "freeBusyReader" - The user has read access to free/busy - * information. - "reader" - The user has read access to the - * calendar. Private events will appear to users with reader access, but event - * details will be hidden. - "writer" - The user has read and write - * access to the calendar. Private events will appear to users with writer - * access, and event details will be visible. - "owner" - The user - * has ownership of the calendar. This role has all of the permissions of the - * writer role with the additional ability to see and manipulate ACLs. - */ - accessRole: string; - /** - * The default reminders on the calendar for the authenticated user. These - * reminders apply to all events on this calendar that do not explicitly - * override them (i.e. do not have reminders.useDefault set to True). - */ - defaultReminders: Schema$EventReminder[]; - /** - * Description of the calendar. Read-only. - */ - description: string; - /** - * ETag of the collection. - */ - etag: string; - /** - * List of events on the calendar. - */ - items: Schema$Event[]; - /** - * Type of the collection ("calendar#events"). - */ - kind: string; - /** - * Token used to access the next page of this result. Omitted if no further - * results are available, in which case nextSyncToken is provided. - */ - nextPageToken: string; - /** - * Token used at a later point in time to retrieve only the entries that have - * changed since this result was returned. Omitted if further results are - * available, in which case nextPageToken is provided. - */ - nextSyncToken: string; - /** - * Title of the calendar. Read-only. - */ - summary: string; - /** - * The time zone of the calendar. Read-only. - */ - timeZone: string; - /** - * Last modification time of the calendar (as a RFC3339 timestamp). Read-only. - */ - updated: string; -} -export interface Schema$FreeBusyCalendar { - /** - * List of time ranges during which this calendar should be regarded as busy. - */ - busy: Schema$TimePeriod[]; - /** - * Optional error(s) (if computation for the calendar failed). - */ - errors: Schema$Error[]; -} -export interface Schema$FreeBusyGroup { - /** - * List of calendars' identifiers within a group. - */ - calendars: string[]; - /** - * Optional error(s) (if computation for the group failed). - */ - errors: Schema$Error[]; -} -export interface Schema$FreeBusyRequest { - /** - * Maximal number of calendars for which FreeBusy information is to be - * provided. Optional. - */ - calendarExpansionMax: number; - /** - * Maximal number of calendar identifiers to be provided for a single group. - * Optional. An error will be returned for a group with more members than this - * value. - */ - groupExpansionMax: number; - /** - * List of calendars and/or groups to query. - */ - items: Schema$FreeBusyRequestItem[]; - /** - * The end of the interval for the query. - */ - timeMax: string; - /** - * The start of the interval for the query. - */ - timeMin: string; - /** - * Time zone used in the response. Optional. The default is UTC. - */ - timeZone: string; -} -export interface Schema$FreeBusyRequestItem { - /** - * The identifier of a calendar or a group. - */ - id: string; -} -export interface Schema$FreeBusyResponse { - /** - * List of free/busy information for calendars. - */ - calendars: any; - /** - * Expansion of groups. - */ - groups: any; - /** - * Type of the resource ("calendar#freeBusy"). - */ - kind: string; - /** - * The end of the interval. - */ - timeMax: string; - /** - * The start of the interval. - */ - timeMin: string; -} -export interface Schema$Setting { - /** - * ETag of the resource. - */ - etag: string; - /** - * The id of the user setting. - */ - id: string; - /** - * Type of the resource ("calendar#setting"). - */ - kind: string; - /** - * Value of the user setting. The format of the value depends on the ID of the - * setting. It must always be a UTF-8 string of length up to 1024 characters. - */ - value: string; -} -export interface Schema$Settings { - /** - * Etag of the collection. - */ - etag: string; - /** - * List of user settings. - */ - items: Schema$Setting[]; - /** - * Type of the collection ("calendar#settings"). - */ - kind: string; - /** - * Token used to access the next page of this result. Omitted if no further - * results are available, in which case nextSyncToken is provided. - */ - nextPageToken: string; - /** - * Token used at a later point in time to retrieve only the entries that have - * changed since this result was returned. Omitted if further results are - * available, in which case nextPageToken is provided. - */ - nextSyncToken: string; -} -export interface Schema$TimePeriod { - /** - * The (exclusive) end of the time period. - */ - end: string; - /** - * The (inclusive) start of the time period. - */ - start: string; -} - -export class Resource$Acl { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * calendar.acl.delete - * @desc Deletes an access control rule. - * @alias calendar.acl.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.ruleId ACL rule identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['calendarId', 'ruleId'], - pathParams: ['calendarId', 'ruleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.get - * @desc Returns an access control rule. - * @alias calendar.acl.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.ruleId ACL rule identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId', 'ruleId'], - pathParams: ['calendarId', 'ruleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.insert - * @desc Creates an access control rule. - * @alias calendar.acl.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Optional. The default is True. - * @param {().AclRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.list - * @desc Returns the rules in the access control list for the calendar. - * @alias calendar.acl.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {boolean=} params.showDeleted Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.patch - * @desc Updates an access control rule. This method supports patch semantics. - * @alias calendar.acl.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.ruleId ACL rule identifier. - * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. - * @param {().AclRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['calendarId', 'ruleId'], - pathParams: ['calendarId', 'ruleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.update - * @desc Updates an access control rule. - * @alias calendar.acl.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.ruleId ACL rule identifier. - * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. - * @param {().AclRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['calendarId', 'ruleId'], - pathParams: ['calendarId', 'ruleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.acl.watch - * @desc Watch for changes to ACL resources. - * @alias calendar.acl.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {boolean=} params.showDeleted Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Calendarlist { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * calendar.calendarList.delete - * @desc Deletes an entry on the user's calendar list. - * @alias calendar.calendarList.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace calendar_v3 { /** - * calendar.calendarList.get - * @desc Returns an entry on the user's calendar list. - * @alias calendar.calendarList.get - * @memberOf! () + * Calendar API * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.calendarList.insert - * @desc Adds an entry to the user's calendar list. - * @alias calendar.calendarList.insert - * @memberOf! () + * Manipulates events and other calendar data. * - * @param {object} params Parameters for request - * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - * @param {().CalendarListEntry} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.calendarList.list - * @desc Returns entries on the user's calendar list. - * @alias calendar.calendarList.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const calendar = google.calendar('v3'); * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.minAccessRole The minimum access role for the user in the returned entries. Optional. The default is no restriction. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {boolean=} params.showDeleted Whether to include deleted calendar list entries in the result. Optional. The default is False. - * @param {boolean=} params.showHidden Whether to show hidden entries. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace calendar + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Calendar + */ + export class Calendar { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + acl: Resource$Acl; + calendarList: Resource$Calendarlist; + calendars: Resource$Calendars; + channels: Resource$Channels; + colors: Resource$Colors; + events: Resource$Events; + freebusy: Resource$Freebusy; + settings: Resource$Settings; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.acl = new Resource$Acl(this); + this.calendarList = new Resource$Calendarlist(this); + this.calendars = new Resource$Calendars(this); + this.channels = new Resource$Channels(this); + this.colors = new Resource$Colors(this); + this.events = new Resource$Events(this); + this.freebusy = new Resource$Freebusy(this); + this.settings = new Resource$Settings(this); + } + + getRoot() { + return this.root; } } - - /** - * calendar.calendarList.patch - * @desc Updates an entry on the user's calendar list. This method supports - * patch semantics. - * @alias calendar.calendarList.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - * @param {().CalendarListEntry} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Acl { + /** + * ETag of the collection. + */ + etag: string; + /** + * List of rules on the access control list. + */ + items: Schema$AclRule[]; + /** + * Type of the collection ("calendar#acl"). + */ + kind: string; + /** + * Token used to access the next page of this result. Omitted if no further + * results are available, in which case nextSyncToken is provided. + */ + nextPageToken: string; + /** + * Token used at a later point in time to retrieve only the entries that + * have changed since this result was returned. Omitted if further results + * are available, in which case nextPageToken is provided. + */ + nextSyncToken: string; } - - - /** - * calendar.calendarList.update - * @desc Updates an entry on the user's calendar list. - * @alias calendar.calendarList.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. - * @param {().CalendarListEntry} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AclRule { + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifier of the ACL rule. + */ + id: string; + /** + * Type of the resource ("calendar#aclRule"). + */ + kind: string; + /** + * The role assigned to the scope. Possible values are: - "none" + * - Provides no access. - "freeBusyReader" - Provides read + * access to free/busy information. - "reader" - Provides read + * access to the calendar. Private events will appear to users with reader + * access, but event details will be hidden. - "writer" - + * Provides read and write access to the calendar. Private events will + * appear to users with writer access, and event details will be visible. - + * "owner" - Provides ownership of the calendar. This role has all + * of the permissions of the writer role with the additional ability to see + * and manipulate ACLs. + */ + role: string; + /** + * The scope of the rule. + */ + scope: any; } - - - /** - * calendar.calendarList.watch - * @desc Watch for changes to CalendarList resources. - * @alias calendar.calendarList.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.minAccessRole The minimum access role for the user in the returned entries. Optional. The default is no restriction. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {boolean=} params.showDeleted Whether to include deleted calendar list entries in the result. Optional. The default is False. - * @param {boolean=} params.showHidden Whether to show hidden entries. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/calendarList/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Calendar { + /** + * Conferencing properties for this calendar, for example what types of + * conferences are allowed. + */ + conferenceProperties: Schema$ConferenceProperties; + /** + * Description of the calendar. Optional. + */ + description: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Identifier of the calendar. To retrieve IDs call the calendarList.list() + * method. + */ + id: string; + /** + * Type of the resource ("calendar#calendar"). + */ + kind: string; + /** + * Geographic location of the calendar as free-form text. Optional. + */ + location: string; + /** + * Title of the calendar. + */ + summary: string; + /** + * The time zone of the calendar. (Formatted as an IANA Time Zone Database + * name, e.g. "Europe/Zurich".) Optional. + */ + timeZone: string; } -} - -export class Resource$Calendars { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CalendarList { + /** + * ETag of the collection. + */ + etag: string; + /** + * Calendars that are present on the user's calendar list. + */ + items: Schema$CalendarListEntry[]; + /** + * Type of the collection ("calendar#calendarList"). + */ + kind: string; + /** + * Token used to access the next page of this result. Omitted if no further + * results are available, in which case nextSyncToken is provided. + */ + nextPageToken: string; + /** + * Token used at a later point in time to retrieve only the entries that + * have changed since this result was returned. Omitted if further results + * are available, in which case nextPageToken is provided. + */ + nextSyncToken: string; } - - getRoot() { - return this.root; + export interface Schema$CalendarListEntry { + /** + * The effective access role that the authenticated user has on the + * calendar. Read-only. Possible values are: - "freeBusyReader" + * - Provides read access to free/busy information. - "reader" - + * Provides read access to the calendar. Private events will appear to users + * with reader access, but event details will be hidden. - + * "writer" - Provides read and write access to the calendar. + * Private events will appear to users with writer access, and event details + * will be visible. - "owner" - Provides ownership of the + * calendar. This role has all of the permissions of the writer role with + * the additional ability to see and manipulate ACLs. + */ + accessRole: string; + /** + * The main color of the calendar in the hexadecimal format + * "#0088aa". This property supersedes the index-based colorId + * property. To set or change this property, you need to specify + * colorRgbFormat=true in the parameters of the insert, update and patch + * methods. Optional. + */ + backgroundColor: string; + /** + * The color of the calendar. This is an ID referring to an entry in the + * calendar section of the colors definition (see the colors endpoint). This + * property is superseded by the backgroundColor and foregroundColor + * properties and can be ignored when using these properties. Optional. + */ + colorId: string; + /** + * Conferencing properties for this calendar, for example what types of + * conferences are allowed. + */ + conferenceProperties: Schema$ConferenceProperties; + /** + * The default reminders that the authenticated user has for this calendar. + */ + defaultReminders: Schema$EventReminder[]; + /** + * Whether this calendar list entry has been deleted from the calendar list. + * Read-only. Optional. The default is False. + */ + deleted: boolean; + /** + * Description of the calendar. Optional. Read-only. + */ + description: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * The foreground color of the calendar in the hexadecimal format + * "#ffffff". This property supersedes the index-based colorId + * property. To set or change this property, you need to specify + * colorRgbFormat=true in the parameters of the insert, update and patch + * methods. Optional. + */ + foregroundColor: string; + /** + * Whether the calendar has been hidden from the list. Optional. The default + * is False. + */ + hidden: boolean; + /** + * Identifier of the calendar. + */ + id: string; + /** + * Type of the resource ("calendar#calendarListEntry"). + */ + kind: string; + /** + * Geographic location of the calendar as free-form text. Optional. + * Read-only. + */ + location: string; + /** + * The notifications that the authenticated user is receiving for this + * calendar. + */ + notificationSettings: any; + /** + * Whether the calendar is the primary calendar of the authenticated user. + * Read-only. Optional. The default is False. + */ + primary: boolean; + /** + * Whether the calendar content shows up in the calendar UI. Optional. The + * default is False. + */ + selected: boolean; + /** + * Title of the calendar. Read-only. + */ + summary: string; + /** + * The summary that the authenticated user has set for this calendar. + * Optional. + */ + summaryOverride: string; + /** + * The time zone of the calendar. Optional. Read-only. + */ + timeZone: string; } - - - /** - * calendar.calendars.clear - * @desc Clears a primary calendar. This operation deletes all events - * associated with the primary calendar of an account. - * @alias calendar.calendars.clear - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clear(params?: any, options?: MethodOptions): AxiosPromise; - clear( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clear( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/clear') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CalendarNotification { + /** + * The method used to deliver the notification. Possible values are: - + * "email" - Reminders are sent via email. - "sms" - + * Reminders are sent via SMS. This value is read-only and is ignored on + * inserts and updates. SMS reminders are only available for G Suite + * customers. + */ + method: string; + /** + * The type of notification. Possible values are: - + * "eventCreation" - Notification sent when a new event is put on + * the calendar. - "eventChange" - Notification sent when an + * event is changed. - "eventCancellation" - Notification sent + * when an event is cancelled. - "eventResponse" - Notification + * sent when an event is changed. - "agenda" - An agenda with the + * events of the day (sent out in the morning). + */ + type: string; } - - - /** - * calendar.calendars.delete - * @desc Deletes a secondary calendar. Use calendars.clear for clearing all - * events on primary calendars. - * @alias calendar.calendars.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; } - - - /** - * calendar.calendars.get - * @desc Returns metadata for a calendar. - * @alias calendar.calendars.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ColorDefinition { + /** + * The background color associated with this color definition. + */ + background: string; + /** + * The foreground color that can be used to write on top of a background + * with 'background' color. + */ + foreground: string; } - - - /** - * calendar.calendars.insert - * @desc Creates a secondary calendar. - * @alias calendar.calendars.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Calendar} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Colors { + /** + * A global palette of calendar colors, mapping from the color ID to its + * definition. A calendarListEntry resource refers to one of these color IDs + * in its color field. Read-only. + */ + calendar: any; + /** + * A global palette of event colors, mapping from the color ID to its + * definition. An event resource may refer to one of these color IDs in its + * color field. Read-only. + */ + event: any; + /** + * Type of the resource ("calendar#colors"). + */ + kind: string; + /** + * Last modification time of the color palette (as a RFC3339 timestamp). + * Read-only. + */ + updated: string; } - - - /** - * calendar.calendars.patch - * @desc Updates metadata for a calendar. This method supports patch - * semantics. - * @alias calendar.calendars.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {().Calendar} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ConferenceData { + /** + * The ID of the conference. Can be used by developers to keep track of + * conferences, should not be displayed to users. Values for solution types: + * - "eventHangout": unset. - "eventNamedHangout": the + * name of the Hangout. - "hangoutsMeet": the 10-letter meeting + * code, for example "aaa-bbbb-ccc". Optional. + */ + conferenceId: string; + /** + * The conference solution, such as Hangouts or Hangouts Meet. Unset for a + * conference with a failed create request. Either conferenceSolution and at + * least one entryPoint, or createRequest is required. + */ + conferenceSolution: Schema$ConferenceSolution; + /** + * A request to generate a new conference and attach it to the event. The + * data is generated asynchronously. To see whether the data is present + * check the status field. Either conferenceSolution and at least one + * entryPoint, or createRequest is required. + */ + createRequest: Schema$CreateConferenceRequest; + /** + * Information about individual conference entry points, such as URLs or + * phone numbers. All of them must belong to the same conference. Either + * conferenceSolution and at least one entryPoint, or createRequest is + * required. + */ + entryPoints: Schema$EntryPoint[]; + /** + * Additional notes (such as instructions from the domain administrator, + * legal notices) to display to the user. Can contain HTML. The maximum + * length is 2048 characters. Optional. + */ + notes: string; + /** + * Additional properties related to a conference. An example would be a + * solution-specific setting for enabling video streaming. + */ + parameters: Schema$ConferenceParameters; + /** + * The signature of the conference data. Genereated on server side. Must be + * preserved while copying the conference data between events, otherwise the + * conference data will not be copied. Unset for a conference with a failed + * create request. Optional for a conference with a pending create request. + */ + signature: string; } - - - /** - * calendar.calendars.update - * @desc Updates metadata for a calendar. - * @alias calendar.calendars.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {().Calendar} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ConferenceParameters { + /** + * Additional add-on specific data. + */ + addOnParameters: Schema$ConferenceParametersAddOnParameters; } -} - -export class Resource$Channels { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ConferenceParametersAddOnParameters { + parameters: any; } - - getRoot() { - return this.root; + export interface Schema$ConferenceProperties { + /** + * The types of conference solutions that are supported for this calendar. + * The possible values are: - "eventHangout" - + * "eventNamedHangout" - "hangoutsMeet" Optional. + */ + allowedConferenceSolutionTypes: string[]; } - - - /** - * calendar.channels.stop - * @desc Stop watching resources through this channel - * @alias calendar.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ConferenceRequestStatus { + /** + * The current status of the conference create request. Read-only. The + * possible values are: - "pending": the conference create + * request is still being processed. - "success": the conference + * create request succeeded, the entry points are populated. - + * "failure": the conference create request failed, there are no + * entry points. + */ + statusCode: string; } -} - -export class Resource$Colors { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ConferenceSolution { + /** + * The user-visible icon for this solution. + */ + iconUri: string; + /** + * The key which can uniquely identify the conference solution for this + * event. + */ + key: Schema$ConferenceSolutionKey; + /** + * The user-visible name of this solution. Not localized. + */ + name: string; } - - getRoot() { - return this.root; + export interface Schema$ConferenceSolutionKey { + /** + * The conference solution type. If a client encounters an unfamiliar or + * empty type, it should still be able to display the entry points. However, + * it should disallow modifications. The possible values are: - + * "eventHangout" for Hangouts for consumers + * (http://hangouts.google.com) - "eventNamedHangout" for classic + * Hangouts for G Suite users (http://hangouts.google.com) - + * "hangoutsMeet" for Hangouts Meet (http://meet.google.com) + */ + type: string; + } + export interface Schema$CreateConferenceRequest { + /** + * The conference solution, such as Hangouts or Hangouts Meet. + */ + conferenceSolutionKey: Schema$ConferenceSolutionKey; + /** + * The client-generated unique ID for this request. Clients should + * regenerate this ID for every new request. If an ID provided is the same + * as for the previous request, the request is ignored. + */ + requestId: string; + /** + * The status of the conference create request. + */ + status: Schema$ConferenceRequestStatus; + } + export interface Schema$EntryPoint { + /** + * The access code to access the conference. The maximum length is 128 + * characters. When creating new conference data, populate only the subset + * of {meetingCode, accessCode, passcode, password, pin} fields that match + * the terminology that the conference provider uses. Only the populated + * fields should be displayed. Optional. + */ + accessCode: string; + /** + * The type of the conference entry point. Possible values are: - + * "video" - joining a conference over HTTP. A conference can have + * zero or one video entry point. - "phone" - joining a conference + * by dialing a phone number. A conference can have zero or more phone entry + * points. - "sip" - joining a conference over SIP. A conference + * can have zero or one sip entry point. - "more" - further + * conference joining instructions, for example additional phone numbers. A + * conference can have zero or one more entry point. A conference with only + * a more entry point is not a valid conference. + */ + entryPointType: string; + /** + * The label for the URI. Visible to end users. Not localized. The maximum + * length is 512 characters. Examples: - for video: + * meet.google.com/aaa-bbbb-ccc - for phone: +1 123 268 2601 - for sip: + * 12345678@altostrat.com - for more: should not be filled Optional. + */ + label: string; + /** + * The meeting code to access the conference. The maximum length is 128 + * characters. When creating new conference data, populate only the subset + * of {meetingCode, accessCode, passcode, password, pin} fields that match + * the terminology that the conference provider uses. Only the populated + * fields should be displayed. Optional. + */ + meetingCode: string; + /** + * The passcode to access the conference. The maximum length is 128 + * characters. When creating new conference data, populate only the subset + * of {meetingCode, accessCode, passcode, password, pin} fields that match + * the terminology that the conference provider uses. Only the populated + * fields should be displayed. + */ + passcode: string; + /** + * The password to access the conference. The maximum length is 128 + * characters. When creating new conference data, populate only the subset + * of {meetingCode, accessCode, passcode, password, pin} fields that match + * the terminology that the conference provider uses. Only the populated + * fields should be displayed. Optional. + */ + password: string; + /** + * The PIN to access the conference. The maximum length is 128 characters. + * When creating new conference data, populate only the subset of + * {meetingCode, accessCode, passcode, password, pin} fields that match the + * terminology that the conference provider uses. Only the populated fields + * should be displayed. Optional. + */ + pin: string; + /** + * The URI of the entry point. The maximum length is 1300 characters. + * Format: - for video, http: or https: schema is required. - for phone, + * tel: schema is required. The URI should include the entire dial sequence + * (e.g., tel:+12345678900,,,123456789;1234). - for sip, sip: schema is + * required, e.g., sip:12345678@myprovider.com. - for more, http: or https: + * schema is required. + */ + uri: string; + } + export interface Schema$Error { + /** + * Domain, or broad category, of the error. + */ + domain: string; + /** + * Specific reason for the error. Some of the possible values are: - + * "groupTooBig" - The group of users requested is too large for a + * single query. - "tooManyCalendarsRequested" - The number of + * calendars requested is too large for a single query. - + * "notFound" - The requested resource was not found. - + * "internalError" - The API service has encountered an internal + * error. Additional error types may be added in the future, so clients + * should gracefully handle additional error statuses not included in this + * list. + */ + reason: string; + } + export interface Schema$Event { + /** + * Whether anyone can invite themselves to the event (currently works for + * Google+ events only). Optional. The default is False. + */ + anyoneCanAddSelf: boolean; + /** + * File attachments for the event. Currently only Google Drive attachments + * are supported. In order to modify attachments the supportsAttachments + * request parameter should be set to true. There can be at most 25 + * attachments per event, + */ + attachments: Schema$EventAttachment[]; + /** + * The attendees of the event. See the Events with attendees guide for more + * information on scheduling events with other calendar users. + */ + attendees: Schema$EventAttendee[]; + /** + * Whether attendees may have been omitted from the event's + * representation. When retrieving an event, this may be due to a + * restriction specified by the maxAttendee query parameter. When updating + * an event, this can be used to only update the participant's response. + * Optional. The default is False. + */ + attendeesOmitted: boolean; + /** + * The color of the event. This is an ID referring to an entry in the event + * section of the colors definition (see the colors endpoint). Optional. + */ + colorId: string; + /** + * The conference-related information, such as details of a Hangouts Meet + * conference. To create new conference details use the createRequest field. + * To persist your changes, remember to set the conferenceDataVersion + * request parameter to 1 for all event modification requests. + */ + conferenceData: Schema$ConferenceData; + /** + * Creation time of the event (as a RFC3339 timestamp). Read-only. + */ + created: string; + /** + * The creator of the event. Read-only. + */ + creator: any; + /** + * Description of the event. Optional. + */ + description: string; + /** + * The (exclusive) end time of the event. For a recurring event, this is the + * end time of the first instance. + */ + end: Schema$EventDateTime; + /** + * Whether the end time is actually unspecified. An end time is still + * provided for compatibility reasons, even if this attribute is set to + * True. The default is False. + */ + endTimeUnspecified: boolean; + /** + * ETag of the resource. + */ + etag: string; + /** + * Extended properties of the event. + */ + extendedProperties: any; + /** + * A gadget that extends this event. + */ + gadget: any; + /** + * Whether attendees other than the organizer can invite others to the + * event. Optional. The default is True. + */ + guestsCanInviteOthers: boolean; + /** + * Whether attendees other than the organizer can modify the event. + * Optional. The default is False. + */ + guestsCanModify: boolean; + /** + * Whether attendees other than the organizer can see who the event's + * attendees are. Optional. The default is True. + */ + guestsCanSeeOtherGuests: boolean; + /** + * An absolute link to the Google+ hangout associated with this event. + * Read-only. + */ + hangoutLink: string; + /** + * An absolute link to this event in the Google Calendar Web UI. Read-only. + */ + htmlLink: string; + /** + * Event unique identifier as defined in RFC5545. It is used to uniquely + * identify events accross calendaring systems and must be supplied when + * importing events via the import method. Note that the icalUID and the id + * are not identical and only one of them should be supplied at event + * creation time. One difference in their semantics is that in recurring + * events, all occurrences of one event have different ids while they all + * share the same icalUIDs. + */ + iCalUID: string; + /** + * Opaque identifier of the event. When creating new single or recurring + * events, you can specify their IDs. Provided IDs must follow these rules: + * - characters allowed in the ID are those used in base32hex encoding, i.e. + * lowercase letters a-v and digits 0-9, see section 3.1.2 in RFC2938 - the + * length of the ID must be between 5 and 1024 characters - the ID must be + * unique per calendar Due to the globally distributed nature of the + * system, we cannot guarantee that ID collisions will be detected at event + * creation time. To minimize the risk of collisions we recommend using an + * established UUID algorithm such as one described in RFC4122. If you do + * not specify an ID, it will be automatically generated by the server. Note + * that the icalUID and the id are not identical and only one of them should + * be supplied at event creation time. One difference in their semantics is + * that in recurring events, all occurrences of one event have different ids + * while they all share the same icalUIDs. + */ + id: string; + /** + * Type of the resource ("calendar#event"). + */ + kind: string; + /** + * Geographic location of the event as free-form text. Optional. + */ + location: string; + /** + * Whether this is a locked event copy where no changes can be made to the + * main event fields "summary", "description", + * "location", "start", "end" or + * "recurrence". The default is False. Read-Only. + */ + locked: boolean; + /** + * The organizer of the event. If the organizer is also an attendee, this is + * indicated with a separate entry in attendees with the organizer field set + * to True. To change the organizer, use the move operation. Read-only, + * except when importing an event. + */ + organizer: any; + /** + * For an instance of a recurring event, this is the time at which this + * event would start according to the recurrence data in the recurring event + * identified by recurringEventId. Immutable. + */ + originalStartTime: Schema$EventDateTime; + /** + * Whether this is a private event copy where changes are not shared with + * other copies on other calendars. Optional. Immutable. The default is + * False. + */ + privateCopy: boolean; + /** + * List of RRULE, EXRULE, RDATE and EXDATE lines for a recurring event, as + * specified in RFC5545. Note that DTSTART and DTEND lines are not allowed + * in this field; event start and end times are specified in the start and + * end fields. This field is omitted for single events or instances of + * recurring events. + */ + recurrence: string[]; + /** + * For an instance of a recurring event, this is the id of the recurring + * event to which this instance belongs. Immutable. + */ + recurringEventId: string; + /** + * Information about the event's reminders for the authenticated user. + */ + reminders: any; + /** + * Sequence number as per iCalendar. + */ + sequence: number; + /** + * Source from which the event was created. For example, a web page, an + * email message or any document identifiable by an URL with HTTP or HTTPS + * scheme. Can only be seen or modified by the creator of the event. + */ + source: any; + /** + * The (inclusive) start time of the event. For a recurring event, this is + * the start time of the first instance. + */ + start: Schema$EventDateTime; + /** + * Status of the event. Optional. Possible values are: - + * "confirmed" - The event is confirmed. This is the default + * status. - "tentative" - The event is tentatively confirmed. - + * "cancelled" - The event is cancelled. + */ + status: string; + /** + * Title of the event. + */ + summary: string; + /** + * Whether the event blocks time on the calendar. Optional. Possible values + * are: - "opaque" - Default value. The event does block time on + * the calendar. This is equivalent to setting Show me as to Busy in the + * Calendar UI. - "transparent" - The event does not block time + * on the calendar. This is equivalent to setting Show me as to Available in + * the Calendar UI. + */ + transparency: string; + /** + * Last modification time of the event (as a RFC3339 timestamp). Read-only. + */ + updated: string; + /** + * Visibility of the event. Optional. Possible values are: - + * "default" - Uses the default visibility for events on the + * calendar. This is the default value. - "public" - The event is + * public and event details are visible to all readers of the calendar. - + * "private" - The event is private and only event attendees may + * view event details. - "confidential" - The event is private. + * This value is provided for compatibility reasons. + */ + visibility: string; + } + export interface Schema$EventAttachment { + /** + * ID of the attached file. Read-only. For Google Drive files, this is the + * ID of the corresponding Files resource entry in the Drive API. + */ + fileId: string; + /** + * URL link to the attachment. For adding Google Drive file attachments use + * the same format as in alternateLink property of the Files resource in the + * Drive API. + */ + fileUrl: string; + /** + * URL link to the attachment's icon. Read-only. + */ + iconLink: string; + /** + * Internet media type (MIME type) of the attachment. + */ + mimeType: string; + /** + * Attachment title. + */ + title: string; + } + export interface Schema$EventAttendee { + /** + * Number of additional guests. Optional. The default is 0. + */ + additionalGuests: number; + /** + * The attendee's response comment. Optional. + */ + comment: string; + /** + * The attendee's name, if available. Optional. + */ + displayName: string; + /** + * The attendee's email address, if available. This field must be + * present when adding an attendee. It must be a valid email address as per + * RFC5322. + */ + email: string; + /** + * The attendee's Profile ID, if available. It corresponds to theid + * field in the People collection of the Google+ API + */ + id: string; + /** + * Whether this is an optional attendee. Optional. The default is False. + */ + optional: boolean; + /** + * Whether the attendee is the organizer of the event. Read-only. The + * default is False. + */ + organizer: boolean; + /** + * Whether the attendee is a resource. Can only be set when the attendee is + * added to the event for the first time. Subsequent modifications are + * ignored. Optional. The default is False. + */ + resource: boolean; + /** + * The attendee's response status. Possible values are: - + * "needsAction" - The attendee has not responded to the + * invitation. - "declined" - The attendee has declined the + * invitation. - "tentative" - The attendee has tentatively + * accepted the invitation. - "accepted" - The attendee has + * accepted the invitation. + */ + responseStatus: string; + /** + * Whether this entry represents the calendar on which this copy of the + * event appears. Read-only. The default is False. + */ + self: boolean; + } + export interface Schema$EventDateTime { + /** + * The date, in the format "yyyy-mm-dd", if this is an all-day + * event. + */ + date: string; + /** + * The time, as a combined date-time value (formatted according to RFC3339). + * A time zone offset is required unless a time zone is explicitly specified + * in timeZone. + */ + dateTime: string; + /** + * The time zone in which the time is specified. (Formatted as an IANA Time + * Zone Database name, e.g. "Europe/Zurich".) For recurring events + * this field is required and specifies the time zone in which the + * recurrence is expanded. For single events this field is optional and + * indicates a custom time zone for the event start/end. + */ + timeZone: string; + } + export interface Schema$EventReminder { + /** + * The method used by this reminder. Possible values are: - + * "email" - Reminders are sent via email. - "sms" - + * Reminders are sent via SMS. These are only available for G Suite + * customers. Requests to set SMS reminders for other account types are + * ignored. - "popup" - Reminders are sent via a UI popup. + */ + method: string; + /** + * Number of minutes before the start of the event when the reminder should + * trigger. Valid values are between 0 and 40320 (4 weeks in minutes). + */ + minutes: number; + } + export interface Schema$Events { + /** + * The user's access role for this calendar. Read-only. Possible values + * are: - "none" - The user has no access. - + * "freeBusyReader" - The user has read access to free/busy + * information. - "reader" - The user has read access to the + * calendar. Private events will appear to users with reader access, but + * event details will be hidden. - "writer" - The user has read + * and write access to the calendar. Private events will appear to users + * with writer access, and event details will be visible. - + * "owner" - The user has ownership of the calendar. This role has + * all of the permissions of the writer role with the additional ability to + * see and manipulate ACLs. + */ + accessRole: string; + /** + * The default reminders on the calendar for the authenticated user. These + * reminders apply to all events on this calendar that do not explicitly + * override them (i.e. do not have reminders.useDefault set to True). + */ + defaultReminders: Schema$EventReminder[]; + /** + * Description of the calendar. Read-only. + */ + description: string; + /** + * ETag of the collection. + */ + etag: string; + /** + * List of events on the calendar. + */ + items: Schema$Event[]; + /** + * Type of the collection ("calendar#events"). + */ + kind: string; + /** + * Token used to access the next page of this result. Omitted if no further + * results are available, in which case nextSyncToken is provided. + */ + nextPageToken: string; + /** + * Token used at a later point in time to retrieve only the entries that + * have changed since this result was returned. Omitted if further results + * are available, in which case nextPageToken is provided. + */ + nextSyncToken: string; + /** + * Title of the calendar. Read-only. + */ + summary: string; + /** + * The time zone of the calendar. Read-only. + */ + timeZone: string; + /** + * Last modification time of the calendar (as a RFC3339 timestamp). + * Read-only. + */ + updated: string; + } + export interface Schema$FreeBusyCalendar { + /** + * List of time ranges during which this calendar should be regarded as + * busy. + */ + busy: Schema$TimePeriod[]; + /** + * Optional error(s) (if computation for the calendar failed). + */ + errors: Schema$Error[]; + } + export interface Schema$FreeBusyGroup { + /** + * List of calendars' identifiers within a group. + */ + calendars: string[]; + /** + * Optional error(s) (if computation for the group failed). + */ + errors: Schema$Error[]; + } + export interface Schema$FreeBusyRequest { + /** + * Maximal number of calendars for which FreeBusy information is to be + * provided. Optional. + */ + calendarExpansionMax: number; + /** + * Maximal number of calendar identifiers to be provided for a single group. + * Optional. An error will be returned for a group with more members than + * this value. + */ + groupExpansionMax: number; + /** + * List of calendars and/or groups to query. + */ + items: Schema$FreeBusyRequestItem[]; + /** + * The end of the interval for the query. + */ + timeMax: string; + /** + * The start of the interval for the query. + */ + timeMin: string; + /** + * Time zone used in the response. Optional. The default is UTC. + */ + timeZone: string; + } + export interface Schema$FreeBusyRequestItem { + /** + * The identifier of a calendar or a group. + */ + id: string; + } + export interface Schema$FreeBusyResponse { + /** + * List of free/busy information for calendars. + */ + calendars: any; + /** + * Expansion of groups. + */ + groups: any; + /** + * Type of the resource ("calendar#freeBusy"). + */ + kind: string; + /** + * The end of the interval. + */ + timeMax: string; + /** + * The start of the interval. + */ + timeMin: string; + } + export interface Schema$Setting { + /** + * ETag of the resource. + */ + etag: string; + /** + * The id of the user setting. + */ + id: string; + /** + * Type of the resource ("calendar#setting"). + */ + kind: string; + /** + * Value of the user setting. The format of the value depends on the ID of + * the setting. It must always be a UTF-8 string of length up to 1024 + * characters. + */ + value: string; + } + export interface Schema$Settings { + /** + * Etag of the collection. + */ + etag: string; + /** + * List of user settings. + */ + items: Schema$Setting[]; + /** + * Type of the collection ("calendar#settings"). + */ + kind: string; + /** + * Token used to access the next page of this result. Omitted if no further + * results are available, in which case nextSyncToken is provided. + */ + nextPageToken: string; + /** + * Token used at a later point in time to retrieve only the entries that + * have changed since this result was returned. Omitted if further results + * are available, in which case nextPageToken is provided. + */ + nextSyncToken: string; + } + export interface Schema$TimePeriod { + /** + * The (exclusive) end of the time period. + */ + end: string; + /** + * The (inclusive) start of the time period. + */ + start: string; } - - /** - * calendar.colors.get - * @desc Returns the color definitions for calendars and events. - * @alias calendar.colors.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/calendar/v3/colors').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Acl { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.acl.delete + * @desc Deletes an access control rule. + * @alias calendar.acl.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.ruleId ACL rule identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['calendarId', 'ruleId'], + pathParams: ['calendarId', 'ruleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.get + * @desc Returns an access control rule. + * @alias calendar.acl.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.ruleId ACL rule identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId', 'ruleId'], + pathParams: ['calendarId', 'ruleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.insert + * @desc Creates an access control rule. + * @alias calendar.acl.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Optional. The default is True. + * @param {().AclRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.list + * @desc Returns the rules in the access control list for the calendar. + * @alias calendar.acl.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {boolean=} params.showDeleted Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.patch + * @desc Updates an access control rule. This method supports patch + * semantics. + * @alias calendar.acl.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.ruleId ACL rule identifier. + * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + * @param {().AclRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['calendarId', 'ruleId'], + pathParams: ['calendarId', 'ruleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.update + * @desc Updates an access control rule. + * @alias calendar.acl.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.ruleId ACL rule identifier. + * @param {boolean=} params.sendNotifications Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True. + * @param {().AclRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/{ruleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['calendarId', 'ruleId'], + pathParams: ['calendarId', 'ruleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.acl.watch + * @desc Watch for changes to ACL resources. + * @alias calendar.acl.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {boolean=} params.showDeleted Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to "none". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/acl/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Events { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Calendarlist { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.calendarList.delete + * @desc Deletes an entry on the user's calendar list. + * @alias calendar.calendarList.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.get + * @desc Returns an entry on the user's calendar list. + * @alias calendar.calendarList.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.insert + * @desc Adds an entry to the user's calendar list. + * @alias calendar.calendarList.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * @param {().CalendarListEntry} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.list + * @desc Returns entries on the user's calendar list. + * @alias calendar.calendarList.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.minAccessRole The minimum access role for the user in the returned entries. Optional. The default is no restriction. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {boolean=} params.showDeleted Whether to include deleted calendar list entries in the result. Optional. The default is False. + * @param {boolean=} params.showHidden Whether to show hidden entries. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.patch + * @desc Updates an entry on the user's calendar list. This method supports + * patch semantics. + * @alias calendar.calendarList.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * @param {().CalendarListEntry} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.update + * @desc Updates an entry on the user's calendar list. + * @alias calendar.calendarList.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {boolean=} params.colorRgbFormat Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False. + * @param {().CalendarListEntry} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendarList.watch + * @desc Watch for changes to CalendarList resources. + * @alias calendar.calendarList.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.minAccessRole The minimum access role for the user in the returned entries. Optional. The default is no restriction. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {boolean=} params.showDeleted Whether to include deleted calendar list entries in the result. Optional. The default is False. + * @param {boolean=} params.showHidden Whether to show hidden entries. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False. To ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/calendarList/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Calendars { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.calendars.clear + * @desc Clears a primary calendar. This operation deletes all events + * associated with the primary calendar of an account. + * @alias calendar.calendars.clear + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clear(params?: any, options?: MethodOptions): AxiosPromise; + clear( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clear( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/clear') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendars.delete + * @desc Deletes a secondary calendar. Use calendars.clear for clearing all + * events on primary calendars. + * @alias calendar.calendars.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendars.get + * @desc Returns metadata for a calendar. + * @alias calendar.calendars.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendars.insert + * @desc Creates a secondary calendar. + * @alias calendar.calendars.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Calendar} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendars.patch + * @desc Updates metadata for a calendar. This method supports patch + * semantics. + * @alias calendar.calendars.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {().Calendar} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.calendars.update + * @desc Updates metadata for a calendar. + * @alias calendar.calendars.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {().Calendar} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * calendar.events.delete - * @desc Deletes an event. - * @alias calendar.events.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.eventId Event identifier. - * @param {boolean=} params.sendNotifications Whether to send notifications about the deletion of the event. Optional. The default is False. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['calendarId', 'eventId'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Channels { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.channels.stop + * @desc Stop watching resources through this channel + * @alias calendar.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * calendar.events.get - * @desc Returns an event. - * @alias calendar.events.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.eventId Event identifier. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId', 'eventId'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Colors { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.colors.get + * @desc Returns the color definitions for calendars and events. + * @alias calendar.colors.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/colors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * calendar.events.import - * @desc Imports an event. This operation is used to add a private copy of an - * existing event to a calendar. - * @alias calendar.events.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. - * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. - * @param {().Event} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ + export class Resource$Events { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.events.delete + * @desc Deletes an event. + * @alias calendar.events.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.eventId Event identifier. + * @param {boolean=} params.sendNotifications Whether to send notifications about the deletion of the event. Optional. The default is False. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['calendarId', 'eventId'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.get + * @desc Returns an event. + * @alias calendar.events.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.eventId Event identifier. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId', 'eventId'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.import + * @desc Imports an event. This operation is used to add a private copy of + * an existing event to a calendar. + * @alias calendar.events.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. + * @param {().Event} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ import(params?: any, options?: MethodOptions): AxiosPromise; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { callback = options; options = {}; - } if(typeof params === 'function') { + } if(typeof params === 'function') { callback = params; params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['calendarId'], pathParams: ['calendarId'], context: this.getRoot()}; if(callback) { + } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['calendarId'], pathParams: ['calendarId'], context: this.getRoot()}; if(callback) { createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} + } else { return createAPIRequest(parameters); + }} - /** + /** * calendar.events.insert * @desc Creates an event. * @alias calendar.events.insert @@ -2541,711 +2567,728 @@ import(params?: any, options?: MethodOptions|BodyResponseCallback, * @param {callback} callback The callback that handles the response. * @return {object} Request object */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.instances - * @desc Returns instances of the specified recurring event. - * @alias calendar.events.instances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string} params.eventId Recurring event identifier. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {integer=} params.maxResults Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. - * @param {string=} params.originalStart The original start time of the instance in the result. Optional. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if singleEvents is False. Optional. The default is False. - * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset. - * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset. - * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instances(params?: any, options?: MethodOptions): AxiosPromise; - instances( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - instances( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId', 'eventId'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.list - * @desc Returns events on the specified calendar. - * @alias calendar.events.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string=} params.iCalUID Specifies event ID in the iCalendar format to be included in the response. Optional. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {integer=} params.maxResults Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. - * @param {string=} params.orderBy The order of the events returned in the result. Optional. The default is an unspecified, stable order. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {string=} params.privateExtendedProperty Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. - * @param {string=} params.q Free text search terms to find events that match these terms in any field, except for extended properties. Optional. - * @param {string=} params.sharedExtendedProperty Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. - * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. - * @param {boolean=} params.showHiddenInvitations Whether to include hidden invitations in the result. Optional. The default is False. - * @param {boolean=} params.singleEvents Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. These are: - iCalUID - orderBy - privateExtendedProperty - q - sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. - * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. - * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. - * @param {string=} params.updatedMin Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.move - * @desc Moves an event to another calendar, i.e. changes an event's - * organizer. - * @alias calendar.events.move - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier of the source calendar where the event currently is on. - * @param {string} params.destination Calendar identifier of the target calendar where the event is to be moved to. - * @param {string} params.eventId Event identifier. - * @param {boolean=} params.sendNotifications Whether to send notifications about the change of the event's organizer. Optional. The default is False. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - move(params?: any, options?: MethodOptions): AxiosPromise; - move( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - move( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}/move') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId', 'eventId', 'destination'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.patch - * @desc Updates an event. This method supports patch semantics. - * @alias calendar.events.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. - * @param {string} params.eventId Event identifier. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {boolean=} params.sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. - * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. - * @param {().Event} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['calendarId', 'eventId'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.quickAdd - * @desc Creates an event based on a simple text string. - * @alias calendar.events.quickAdd - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {boolean=} params.sendNotifications Whether to send notifications about the creation of the event. Optional. The default is False. - * @param {string} params.text The text describing the event to be created. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - quickAdd(params?: any, options?: MethodOptions): AxiosPromise; - quickAdd( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - quickAdd( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/quickAdd') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId', 'text'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.update - * @desc Updates an event. - * @alias calendar.events.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. - * @param {string} params.eventId Event identifier. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {boolean=} params.sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. - * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. - * @param {().Event} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/calendar/v3/calendars/{calendarId}/events/{eventId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['calendarId', 'eventId'], - pathParams: ['calendarId', 'eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * calendar.events.watch - * @desc Watch for changes to Events resources. - * @alias calendar.events.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. - * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. - * @param {string=} params.iCalUID Specifies event ID in the iCalendar format to be included in the response. Optional. - * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. - * @param {integer=} params.maxResults Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. - * @param {string=} params.orderBy The order of the events returned in the result. Optional. The default is an unspecified, stable order. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {string=} params.privateExtendedProperty Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. - * @param {string=} params.q Free text search terms to find events that match these terms in any field, except for extended properties. Optional. - * @param {string=} params.sharedExtendedProperty Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. - * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. - * @param {boolean=} params.showHiddenInvitations Whether to include hidden invitations in the result. Optional. The default is False. - * @param {boolean=} params.singleEvents Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. These are: - iCalUID - orderBy - privateExtendedProperty - q - sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. - * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. - * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. - * @param {string=} params.updatedMin Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['calendarId'], - pathParams: ['calendarId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Freebusy { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * calendar.freebusy.query - * @desc Returns free/busy information for a set of calendars. - * @alias calendar.freebusy.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().FreeBusyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/freeBusy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Settings { - root: Calendar; - constructor(root: Calendar) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * calendar.settings.get - * @desc Returns a single user setting. - * @alias calendar.settings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.setting The id of the user setting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/settings/{setting}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['setting'], - pathParams: ['setting'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.instances + * @desc Returns instances of the specified recurring event. + * @alias calendar.events.instances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string} params.eventId Recurring event identifier. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {integer=} params.maxResults Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * @param {string=} params.originalStart The original start time of the instance in the result. Optional. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events will still be included if singleEvents is False. Optional. The default is False. + * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset. + * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset. + * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instances(params?: any, options?: MethodOptions): + AxiosPromise; + instances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + instances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId', 'eventId'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.list + * @desc Returns events on the specified calendar. + * @alias calendar.events.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string=} params.iCalUID Specifies event ID in the iCalendar format to be included in the response. Optional. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {integer=} params.maxResults Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * @param {string=} params.orderBy The order of the events returned in the result. Optional. The default is an unspecified, stable order. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {string=} params.privateExtendedProperty Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. + * @param {string=} params.q Free text search terms to find events that match these terms in any field, except for extended properties. Optional. + * @param {string=} params.sharedExtendedProperty Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. + * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + * @param {boolean=} params.showHiddenInvitations Whether to include hidden invitations in the result. Optional. The default is False. + * @param {boolean=} params.singleEvents Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. These are: - iCalUID - orderBy - privateExtendedProperty - q - sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. + * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. + * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. + * @param {string=} params.updatedMin Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/calendars/{calendarId}/events') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.move + * @desc Moves an event to another calendar, i.e. changes an event's + * organizer. + * @alias calendar.events.move + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier of the source calendar where the event currently is on. + * @param {string} params.destination Calendar identifier of the target calendar where the event is to be moved to. + * @param {string} params.eventId Event identifier. + * @param {boolean=} params.sendNotifications Whether to send notifications about the change of the event's organizer. Optional. The default is False. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + move(params?: any, options?: MethodOptions): AxiosPromise; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}/move') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId', 'eventId', 'destination'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.patch + * @desc Updates an event. This method supports patch semantics. + * @alias calendar.events.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * @param {string} params.eventId Event identifier. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {boolean=} params.sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. + * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. + * @param {().Event} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['calendarId', 'eventId'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.quickAdd + * @desc Creates an event based on a simple text string. + * @alias calendar.events.quickAdd + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {boolean=} params.sendNotifications Whether to send notifications about the creation of the event. Optional. The default is False. + * @param {string} params.text The text describing the event to be created. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + quickAdd(params?: any, options?: MethodOptions): AxiosPromise; + quickAdd( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + quickAdd( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/quickAdd') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId', 'text'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.update + * @desc Updates an event. + * @alias calendar.events.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {integer=} params.conferenceDataVersion Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0. + * @param {string} params.eventId Event identifier. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {boolean=} params.sendNotifications Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False. + * @param {boolean=} params.supportsAttachments Whether API client performing operation supports event attachments. Optional. The default is False. + * @param {().Event} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/calendar/v3/calendars/{calendarId}/events/{eventId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['calendarId', 'eventId'], + pathParams: ['calendarId', 'eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.events.watch + * @desc Watch for changes to Events resources. + * @alias calendar.events.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.alwaysIncludeEmail Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False. + * @param {string} params.calendarId Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. + * @param {string=} params.iCalUID Specifies event ID in the iCalendar format to be included in the response. Optional. + * @param {integer=} params.maxAttendees The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional. + * @param {integer=} params.maxResults Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional. + * @param {string=} params.orderBy The order of the events returned in the result. Optional. The default is an unspecified, stable order. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {string=} params.privateExtendedProperty Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints. + * @param {string=} params.q Free text search terms to find events that match these terms in any field, except for extended properties. Optional. + * @param {string=} params.sharedExtendedProperty Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints. + * @param {boolean=} params.showDeleted Whether to include deleted events (with status equals "cancelled") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False. + * @param {boolean=} params.showHiddenInvitations Whether to include hidden invitations in the result. Optional. The default is False. + * @param {boolean=} params.singleEvents Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. These are: - iCalUID - orderBy - privateExtendedProperty - q - sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {string=} params.timeMax Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin. + * @param {string=} params.timeMin Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax. + * @param {string=} params.timeZone Time zone used in the response. Optional. The default is the time zone of the calendar. + * @param {string=} params.updatedMin Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/calendar/v3/calendars/{calendarId}/events/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['calendarId'], + pathParams: ['calendarId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * calendar.settings.list - * @desc Returns all user settings for the authenticated user. - * @alias calendar.settings.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/settings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Freebusy { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.freebusy.query + * @desc Returns free/busy information for a set of calendars. + * @alias calendar.freebusy.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().FreeBusyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/freeBusy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * calendar.settings.watch - * @desc Watch for changes to Settings resources. - * @alias calendar.settings.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. - * @param {string=} params.pageToken Token specifying which result page to return. Optional. - * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/calendar/v3/users/me/settings/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Settings { + root: Calendar; + constructor(root: Calendar) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * calendar.settings.get + * @desc Returns a single user setting. + * @alias calendar.settings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.setting The id of the user setting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/settings/{setting}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['setting'], + pathParams: ['setting'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.settings.list + * @desc Returns all user settings for the authenticated user. + * @alias calendar.settings.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/settings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * calendar.settings.watch + * @desc Watch for changes to Settings resources. + * @alias calendar.settings.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional. + * @param {string=} params.pageToken Token specifying which result page to return. Optional. + * @param {string=} params.syncToken Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken. Learn more about incremental synchronization. Optional. The default is to return all entries. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/calendar/v3/users/me/settings/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/chat/v1.ts b/src/apis/chat/v1.ts index cafa7ec5958..ec324f847af 100644 --- a/src/apis/chat/v1.ts +++ b/src/apis/chat/v1.ts @@ -27,969 +27,978 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Hangouts Chat API - * - * Enables bots to fetch information and perform actions in the new Hangouts - * Chat. - * - * @example - * const google = require('googleapis'); - * const chat = google.chat('v1'); - * - * @namespace chat - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Chat - */ -export class Chat { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace chat_v1 { + /** + * Hangouts Chat API + * + * Enables bots to fetch information and perform actions in the new Hangouts + * Chat. + * + * @example + * const google = require('googleapis'); + * const chat = google.chat('v1'); + * + * @namespace chat + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Chat + */ + export class Chat { + _options: GlobalOptions; + google: GoogleApis; + root = this; - spaces: Resource$Spaces; + spaces: Resource$Spaces; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.spaces = new Resource$Spaces(this); - } + this.spaces = new Resource$Spaces(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * List of string parameters to supply when the action method is invoked. For - * example, consider three snooze buttons: snooze now, snooze 1 day, snooze next - * week. You might use action method = snooze(), passing the snooze type and - * snooze time in the list of string parameters. - */ -export interface Schema$ActionParameter { - /** - * The name of the parameter for the action script. - */ - key: string; - /** - * The value of the parameter. - */ - value: string; -} -/** - * Parameters that a bot can use to configure how it's response is posted. - */ -export interface Schema$ActionResponse { - /** - * The type of bot response. - */ - type: string; - /** - * URL for users to auth or config. (Only for REQUEST_CONFIG response types.) - */ - url: string; -} -/** - * Annotations associated with the plain-text body of the message. Example - * plain-text message body: ``` Hello @FooBot how are you!" ``` The - * corresponding annotations metadata: ``` "annotations":[{ - * "type":"USER_MENTION", "startIndex":6, - * "length":7, "userMention": { "user": { - * "name":"users/107946847022116401880", - * "displayName":"FooBot", - * "avatarUrl":"https://goo.gl/aeDtrS", - * "type":"BOT" }, "type":"MENTION" - * } }] ``` - */ -export interface Schema$Annotation { - /** - * Length of the substring in the plain-text message body this annotation - * corresponds to. - */ - length: number; - /** - * Start index (0-based, inclusive) in the plain-text message body this - * annotation corresponds to. - */ - startIndex: number; - /** - * The type of this annotation. - */ - type: string; - /** - * The metadata of user mention. - */ - userMention: Schema$UserMentionMetadata; -} -/** - * A button. Can be a text button or an image button. - */ -export interface Schema$Button { - /** - * A button with image and onclick action. - */ - imageButton: Schema$ImageButton; - /** - * A button with text and onclick action. - */ - textButton: Schema$TextButton; -} -/** - * A card is a UI element that can contain UI widgets such as texts, images. - */ -export interface Schema$Card { - /** - * The actions of this card. - */ - cardActions: Schema$CardAction[]; - /** - * The header of the card. A header usually contains a title and an image. - */ - header: Schema$CardHeader; - /** - * Name of the card. - */ - name: string; - /** - * Sections are separated by a line divider. - */ - sections: Schema$Section[]; -} -/** - * A card action is the action associated with the card. For an invoice card, a - * typical action would be: delete invoice, email invoice or open the invoice in - * browser. - */ -export interface Schema$CardAction { - /** - * The label used to be displayed in the action menu item. - */ - actionLabel: string; - /** - * The onclick action for this action item. - */ - onClick: Schema$OnClick; -} -export interface Schema$CardHeader { - /** - * The image's type (e.g. square border or circular border). - */ - imageStyle: string; - /** - * The URL of the image in the card header. - */ - imageUrl: string; - /** - * The subtitle of the card header. - */ - subtitle: string; - /** - * The title must be specified. The header has a fixed height: if both a title - * and subtitle is specified, each will take up 1 line. If only the title is - * specified, it will take up both lines. - */ - title: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A form action describes the behavior when the form is submitted. For example, - * an Apps Script can be invoked to handle the form. - */ -export interface Schema$FormAction { - /** - * Apps Script function to invoke when the containing element is - * clicked/activated. - */ - actionMethodName: string; - /** - * List of action parameters. - */ - parameters: Schema$ActionParameter[]; -} -/** - * An image that is specified by a URL and can have an onclick action. - */ -export interface Schema$Image { - /** - * The aspect ratio of this image (width/height). - */ - aspectRatio: number; - /** - * The URL of the image. - */ - imageUrl: string; - /** - * The onclick action. - */ - onClick: Schema$OnClick; -} -/** - * An image button with an onclick action. - */ -export interface Schema$ImageButton { - /** - * The icon specified by an enum that indices to an icon provided by Chat API. - */ - icon: string; - /** - * The icon specified by a URL. - */ - iconUrl: string; - /** - * The name of this image_button which will be used for accessibility. Default - * value will be provided if developers don't specify. - */ - name: string; - /** - * The onclick action. - */ - onClick: Schema$OnClick; -} -/** - * A UI element contains a key (label) and a value (content). And this element - * may also contain some actions such as onclick button. - */ -export interface Schema$KeyValue { - /** - * The text of the bottom label. Formatted text supported. - */ - bottomLabel: string; - /** - * A button that can be clicked to trigger an action. - */ - button: Schema$Button; - /** - * The text of the content. Formatted text supported and always required. - */ - content: string; - /** - * If the content should be multiline. - */ - contentMultiline: boolean; - /** - * An enum value that will be replaced by the Chat API with the corresponding - * icon image. - */ - icon: string; - /** - * The icon specified by a URL. - */ - iconUrl: string; - /** - * The onclick action. Only the top label, bottom label and content region are - * clickable. - */ - onClick: Schema$OnClick; - /** - * The text of the top label. Formatted text supported. - */ - topLabel: string; -} -export interface Schema$ListMembershipsResponse { - /** - * List of memberships in the requested (or first) page. - */ - memberships: Schema$Membership[]; - /** - * Continuation token to retrieve the next page of results. It will be empty - * for the last page of results. - */ - nextPageToken: string; -} -export interface Schema$ListSpacesResponse { - /** - * Continuation token to retrieve the next page of results. It will be empty - * for the last page of results. Tokens expire in an hour. An error is thrown - * if an expired token is passed. - */ - nextPageToken: string; - /** - * List of spaces in the requested (or first) page. - */ - spaces: Schema$Space[]; -} -/** - * Represents a membership relation in Hangouts Chat. - */ -export interface Schema$Membership { - /** - * The creation time of the membership a.k.a the time at which the member - * joined the space, if applicable. - */ - createTime: string; - /** - * Member details. - */ - member: Schema$User; - /** - * Resource name of the membership, in the form - * "spaces/x/members/*". Example: - * spaces/AAAAMpdlehY/members/105115627578887013105 - */ - name: string; - /** - * State of the membership. - */ - state: string; -} -/** - * A message in Hangouts Chat. - */ -export interface Schema$Message { - /** - * Input only. Parameters that a bot can use to configure how its response is - * posted. - */ - actionResponse: Schema$ActionResponse; - /** - * Output only. Annotations associated with the text in this message. - */ - annotations: Schema$Annotation[]; - /** - * Rich, formatted and interactive cards that can be used to display UI - * elements such as: formatted texts, buttons, clickable images. Cards are - * normally displayed below the plain-text body of the message. - */ - cards: Schema$Card[]; - /** - * Output only. The time at which the message was created in Hangouts Chat - * server. - */ - createTime: string; /** - * A plain-text description of the message's cards, used when the actual - * cards cannot be displayed (e.g. mobile notifications). - */ - fallbackText: string; - /** - * Resource name, in the form "spaces/x/messages/*". Example: - * spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 - */ - name: string; - /** - * Text for generating preview chips. This text will not be displayed to the - * user, but any links to images, web pages, videos, etc. included here will - * generate preview chips. - */ - previewText: string; - /** - * The user who created the message. - */ - sender: Schema$User; - /** - * The space the message belongs to. - */ - space: Schema$Space; - /** - * Plain-text body of the message. - */ - text: string; - /** - * The thread the message belongs to. - */ - thread: Schema$Thread; -} -/** - * An onclick action (e.g. open a link). - */ -export interface Schema$OnClick { + * List of string parameters to supply when the action method is invoked. For + * example, consider three snooze buttons: snooze now, snooze 1 day, snooze + * next week. You might use action method = snooze(), passing the snooze type + * and snooze time in the list of string parameters. + */ + export interface Schema$ActionParameter { + /** + * The name of the parameter for the action script. + */ + key: string; + /** + * The value of the parameter. + */ + value: string; + } /** - * A form action will be trigger by this onclick if specified. - */ - action: Schema$FormAction; + * Parameters that a bot can use to configure how it's response is posted. + */ + export interface Schema$ActionResponse { + /** + * The type of bot response. + */ + type: string; + /** + * URL for users to auth or config. (Only for REQUEST_CONFIG response + * types.) + */ + url: string; + } /** - * This onclick triggers an open link action if specified. - */ - openLink: Schema$OpenLink; -} -/** - * A link that opens a new window. - */ -export interface Schema$OpenLink { + * Annotations associated with the plain-text body of the message. Example + * plain-text message body: ``` Hello @FooBot how are you!" ``` The + * corresponding annotations metadata: ``` "annotations":[{ + * "type":"USER_MENTION", "startIndex":6, + * "length":7, "userMention": { "user": { + * "name":"users/107946847022116401880", + * "displayName":"FooBot", + * "avatarUrl":"https://goo.gl/aeDtrS", + * "type":"BOT" }, + * "type":"MENTION" } }] ``` + */ + export interface Schema$Annotation { + /** + * Length of the substring in the plain-text message body this annotation + * corresponds to. + */ + length: number; + /** + * Start index (0-based, inclusive) in the plain-text message body this + * annotation corresponds to. + */ + startIndex: number; + /** + * The type of this annotation. + */ + type: string; + /** + * The metadata of user mention. + */ + userMention: Schema$UserMentionMetadata; + } /** - * The URL to open. - */ - url: string; -} -/** - * A section contains a collection of widgets that are rendered (vertically) in - * the order that they are specified. Across all platforms, cards have a narrow - * fixed width, so there is currently no need for layout properties (e.g. - * float). - */ -export interface Schema$Section { + * A button. Can be a text button or an image button. + */ + export interface Schema$Button { + /** + * A button with image and onclick action. + */ + imageButton: Schema$ImageButton; + /** + * A button with text and onclick action. + */ + textButton: Schema$TextButton; + } /** - * The header of the section, text formatted supported. - */ - header: string; + * A card is a UI element that can contain UI widgets such as texts, images. + */ + export interface Schema$Card { + /** + * The actions of this card. + */ + cardActions: Schema$CardAction[]; + /** + * The header of the card. A header usually contains a title and an image. + */ + header: Schema$CardHeader; + /** + * Name of the card. + */ + name: string; + /** + * Sections are separated by a line divider. + */ + sections: Schema$Section[]; + } /** - * A section must contain at least 1 widget. - */ - widgets: Schema$WidgetMarkup[]; -} -/** - * A room or DM in Hangouts Chat. - */ -export interface Schema$Space { + * A card action is the action associated with the card. For an invoice card, + * a typical action would be: delete invoice, email invoice or open the + * invoice in browser. + */ + export interface Schema$CardAction { + /** + * The label used to be displayed in the action menu item. + */ + actionLabel: string; + /** + * The onclick action for this action item. + */ + onClick: Schema$OnClick; + } + export interface Schema$CardHeader { + /** + * The image's type (e.g. square border or circular border). + */ + imageStyle: string; + /** + * The URL of the image in the card header. + */ + imageUrl: string; + /** + * The subtitle of the card header. + */ + subtitle: string; + /** + * The title must be specified. The header has a fixed height: if both a + * title and subtitle is specified, each will take up 1 line. If only the + * title is specified, it will take up both lines. + */ + title: string; + } /** - * Output only. The display name (only if the space is a room). - */ - displayName: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A form action describes the behavior when the form is submitted. For + * example, an Apps Script can be invoked to handle the form. + */ + export interface Schema$FormAction { + /** + * Apps Script function to invoke when the containing element is + * clicked/activated. + */ + actionMethodName: string; + /** + * List of action parameters. + */ + parameters: Schema$ActionParameter[]; + } /** - * Resource name of the space, in the form "spaces/*". Example: - * spaces/AAAAMpdlehYs - */ - name: string; + * An image that is specified by a URL and can have an onclick action. + */ + export interface Schema$Image { + /** + * The aspect ratio of this image (width/height). + */ + aspectRatio: number; + /** + * The URL of the image. + */ + imageUrl: string; + /** + * The onclick action. + */ + onClick: Schema$OnClick; + } /** - * Output only. The type of a space. - */ - type: string; -} -/** - * A button with text and onclick action. - */ -export interface Schema$TextButton { + * An image button with an onclick action. + */ + export interface Schema$ImageButton { + /** + * The icon specified by an enum that indices to an icon provided by Chat + * API. + */ + icon: string; + /** + * The icon specified by a URL. + */ + iconUrl: string; + /** + * The name of this image_button which will be used for accessibility. + * Default value will be provided if developers don't specify. + */ + name: string; + /** + * The onclick action. + */ + onClick: Schema$OnClick; + } /** - * The onclick action of the button. - */ - onClick: Schema$OnClick; + * A UI element contains a key (label) and a value (content). And this element + * may also contain some actions such as onclick button. + */ + export interface Schema$KeyValue { + /** + * The text of the bottom label. Formatted text supported. + */ + bottomLabel: string; + /** + * A button that can be clicked to trigger an action. + */ + button: Schema$Button; + /** + * The text of the content. Formatted text supported and always required. + */ + content: string; + /** + * If the content should be multiline. + */ + contentMultiline: boolean; + /** + * An enum value that will be replaced by the Chat API with the + * corresponding icon image. + */ + icon: string; + /** + * The icon specified by a URL. + */ + iconUrl: string; + /** + * The onclick action. Only the top label, bottom label and content region + * are clickable. + */ + onClick: Schema$OnClick; + /** + * The text of the top label. Formatted text supported. + */ + topLabel: string; + } + export interface Schema$ListMembershipsResponse { + /** + * List of memberships in the requested (or first) page. + */ + memberships: Schema$Membership[]; + /** + * Continuation token to retrieve the next page of results. It will be empty + * for the last page of results. + */ + nextPageToken: string; + } + export interface Schema$ListSpacesResponse { + /** + * Continuation token to retrieve the next page of results. It will be empty + * for the last page of results. Tokens expire in an hour. An error is + * thrown if an expired token is passed. + */ + nextPageToken: string; + /** + * List of spaces in the requested (or first) page. + */ + spaces: Schema$Space[]; + } /** - * The text of the button. - */ - text: string; -} -/** - * A paragraph of text. Formatted text supported. - */ -export interface Schema$TextParagraph { text: string; } -/** - * A thread in Hangouts Chat. - */ -export interface Schema$Thread { + * Represents a membership relation in Hangouts Chat. + */ + export interface Schema$Membership { + /** + * The creation time of the membership a.k.a the time at which the member + * joined the space, if applicable. + */ + createTime: string; + /** + * Member details. + */ + member: Schema$User; + /** + * Resource name of the membership, in the form + * "spaces/x/members/*". Example: + * spaces/AAAAMpdlehY/members/105115627578887013105 + */ + name: string; + /** + * State of the membership. + */ + state: string; + } /** - * Resource name, in the form "spaces/x/threads/*". Example: - * spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 - */ - name: string; -} -/** - * A user in Hangouts Chat. - */ -export interface Schema$User { + * A message in Hangouts Chat. + */ + export interface Schema$Message { + /** + * Input only. Parameters that a bot can use to configure how its response + * is posted. + */ + actionResponse: Schema$ActionResponse; + /** + * Output only. Annotations associated with the text in this message. + */ + annotations: Schema$Annotation[]; + /** + * Rich, formatted and interactive cards that can be used to display UI + * elements such as: formatted texts, buttons, clickable images. Cards are + * normally displayed below the plain-text body of the message. + */ + cards: Schema$Card[]; + /** + * Output only. The time at which the message was created in Hangouts Chat + * server. + */ + createTime: string; + /** + * A plain-text description of the message's cards, used when the actual + * cards cannot be displayed (e.g. mobile notifications). + */ + fallbackText: string; + /** + * Resource name, in the form "spaces/x/messages/*". Example: + * spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + */ + name: string; + /** + * Text for generating preview chips. This text will not be displayed to the + * user, but any links to images, web pages, videos, etc. included here will + * generate preview chips. + */ + previewText: string; + /** + * The user who created the message. + */ + sender: Schema$User; + /** + * The space the message belongs to. + */ + space: Schema$Space; + /** + * Plain-text body of the message. + */ + text: string; + /** + * The thread the message belongs to. + */ + thread: Schema$Thread; + } /** - * The user's display name. - */ - displayName: string; + * An onclick action (e.g. open a link). + */ + export interface Schema$OnClick { + /** + * A form action will be trigger by this onclick if specified. + */ + action: Schema$FormAction; + /** + * This onclick triggers an open link action if specified. + */ + openLink: Schema$OpenLink; + } /** - * Resource name, in the format "users/*". + * A link that opens a new window. */ - name: string; + export interface Schema$OpenLink { + /** + * The URL to open. + */ + url: string; + } /** - * User type. - */ - type: string; -} -/** - * Annotation metadata for user mentions (@). - */ -export interface Schema$UserMentionMetadata { + * A section contains a collection of widgets that are rendered (vertically) + * in the order that they are specified. Across all platforms, cards have a + * narrow fixed width, so there is currently no need for layout properties + * (e.g. float). + */ + export interface Schema$Section { + /** + * The header of the section, text formatted supported. + */ + header: string; + /** + * A section must contain at least 1 widget. + */ + widgets: Schema$WidgetMarkup[]; + } /** - * The type of user mention. - */ - type: string; + * A room or DM in Hangouts Chat. + */ + export interface Schema$Space { + /** + * Output only. The display name (only if the space is a room). + */ + displayName: string; + /** + * Resource name of the space, in the form "spaces/*". Example: + * spaces/AAAAMpdlehYs + */ + name: string; + /** + * Output only. The type of a space. + */ + type: string; + } /** - * The user mentioned. + * A button with text and onclick action. */ - user: Schema$User; -} -/** - * A widget is a UI element that presents texts, images, etc. - */ -export interface Schema$WidgetMarkup { + export interface Schema$TextButton { + /** + * The onclick action of the button. + */ + onClick: Schema$OnClick; + /** + * The text of the button. + */ + text: string; + } /** - * A list of buttons. Buttons is also oneof data and only one of these fields - * should be set. + * A paragraph of text. Formatted text supported. */ - buttons: Schema$Button[]; + export interface Schema$TextParagraph { text: string; } /** - * Display an image in this widget. + * A thread in Hangouts Chat. */ - image: Schema$Image; + export interface Schema$Thread { + /** + * Resource name, in the form "spaces/x/threads/*". Example: + * spaces/AAAAMpdlehY/threads/UMxbHmzDlr4 + */ + name: string; + } /** - * Display a key value item in this widget. - */ - keyValue: Schema$KeyValue; + * A user in Hangouts Chat. + */ + export interface Schema$User { + /** + * The user's display name. + */ + displayName: string; + /** + * Resource name, in the format "users/*". + */ + name: string; + /** + * User type. + */ + type: string; + } /** - * Display a text paragraph in this widget. - */ - textParagraph: Schema$TextParagraph; -} - -export class Resource$Spaces { - root: Chat; - members: Resource$Spaces$Members; - messages: Resource$Spaces$Messages; - constructor(root: Chat) { - this.root = root; - this.getRoot.bind(this); - this.members = new Resource$Spaces$Members(root); - this.messages = new Resource$Spaces$Messages(root); + * Annotation metadata for user mentions (@). + */ + export interface Schema$UserMentionMetadata { + /** + * The type of user mention. + */ + type: string; + /** + * The user mentioned. + */ + user: Schema$User; } - - getRoot() { - return this.root; + /** + * A widget is a UI element that presents texts, images, etc. + */ + export interface Schema$WidgetMarkup { + /** + * A list of buttons. Buttons is also oneof data and only one of these + * fields should be set. + */ + buttons: Schema$Button[]; + /** + * Display an image in this widget. + */ + image: Schema$Image; + /** + * Display a key value item in this widget. + */ + keyValue: Schema$KeyValue; + /** + * Display a text paragraph in this widget. + */ + textParagraph: Schema$TextParagraph; } - - /** - * chat.spaces.get - * @desc Returns a space. - * @alias chat.spaces.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. Resource name of the space, in the form "spaces/x". Example: spaces/AAAAMpdlehY - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Spaces { + root: Chat; + members: Resource$Spaces$Members; + messages: Resource$Spaces$Messages; + constructor(root: Chat) { + this.root = root; + this.getRoot.bind(this); + this.members = new Resource$Spaces$Members(root); + this.messages = new Resource$Spaces$Messages(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * chat.spaces.list - * @desc Lists spaces the caller is a member of. - * @alias chat.spaces.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100. - * @param {string=} params.pageToken A token identifying a page of results the server should return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/spaces').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * chat.spaces.get + * @desc Returns a space. + * @alias chat.spaces.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Resource name of the space, in the form "spaces/x". Example: spaces/AAAAMpdlehY + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Spaces$Members { - root: Chat; - constructor(root: Chat) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * chat.spaces.members.get - * @desc Returns a membership. - * @alias chat.spaces.members.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. Resource name of the membership to be retrieved, in the form "spaces/x/members/x". Example: spaces/AAAAMpdlehY/members/105115627578887013105 - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * chat.spaces.list + * @desc Lists spaces the caller is a member of. + * @alias chat.spaces.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100. + * @param {string=} params.pageToken A token identifying a page of results the server should return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/spaces').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Spaces$Members { + root: Chat; + constructor(root: Chat) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * chat.spaces.members.list - * @desc Lists human memberships in a space. - * @alias chat.spaces.members.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100. - * @param {string=} params.pageToken A token identifying a page of results the server should return. - * @param {string} params.parent Required. The resource name of the space for which membership list is to be fetched, in the form "spaces/x". Example: spaces/AAAAMpdlehY - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * chat.spaces.members.get + * @desc Returns a membership. + * @alias chat.spaces.members.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Resource name of the membership to be retrieved, in the form "spaces/x/members/x". Example: spaces/AAAAMpdlehY/members/105115627578887013105 + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/members') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Spaces$Messages { - root: Chat; - constructor(root: Chat) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * chat.spaces.members.list + * @desc Lists human memberships in a space. + * @alias chat.spaces.members.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested page size. The value is capped at 1000. Server may return fewer results than requested. If unspecified, server will default to 100. + * @param {string=} params.pageToken A token identifying a page of results the server should return. + * @param {string} params.parent Required. The resource name of the space for which membership list is to be fetched, in the form "spaces/x". Example: spaces/AAAAMpdlehY + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/members') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * chat.spaces.messages.create - * @desc Creates a message. - * @alias chat.spaces.messages.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. Space resource name, in the form "spaces/x". Example: spaces/AAAAMpdlehY - * @param {string=} params.threadKey Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message. - * @param {().Message} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Spaces$Messages { + root: Chat; + constructor(root: Chat) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * chat.spaces.messages.delete - * @desc Deletes a message. - * @alias chat.spaces.messages.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. Resource name of the message to be deleted, in the form "spaces/x/messages/x" Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * chat.spaces.messages.create + * @desc Creates a message. + * @alias chat.spaces.messages.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. Space resource name, in the form "spaces/x". Example: spaces/AAAAMpdlehY + * @param {string=} params.threadKey Opaque thread identifier string that can be specified to group messages into a single thread. If this is the first message with a given thread identifier, a new thread is created. Subsequent messages with the same thread identifier will be posted into the same thread. This relieves bots and webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post further updates to it. Has no effect if thread field, corresponding to an existing thread, is set in message. + * @param {().Message} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * chat.spaces.messages.get - * @desc Returns a message. - * @alias chat.spaces.messages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. Resource name of the message to be retrieved, in the form "spaces/x/messages/x". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * chat.spaces.messages.delete + * @desc Deletes a message. + * @alias chat.spaces.messages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Resource name of the message to be deleted, in the form "spaces/x/messages/x" Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * chat.spaces.messages.update - * @desc Updates a message. - * @alias chat.spaces.messages.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name, in the form "spaces/x/messages/x". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 - * @param {string=} params.updateMask Required. The field paths to be updated. Currently supported field paths: "text", "cards". - * @param {().Message} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * chat.spaces.messages.get + * @desc Returns a message. + * @alias chat.spaces.messages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. Resource name of the message to be retrieved, in the form "spaces/x/messages/x". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * chat.spaces.messages.update + * @desc Updates a message. + * @alias chat.spaces.messages.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name, in the form "spaces/x/messages/x". Example: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4 + * @param {string=} params.updateMask Required. The field paths to be updated. Currently supported field paths: "text", "cards". + * @param {().Message} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://chat.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/civicinfo/v2.ts b/src/apis/civicinfo/v2.ts index 571052e9712..0e5afdc3724 100644 --- a/src/apis/civicinfo/v2.ts +++ b/src/apis/civicinfo/v2.ts @@ -27,1137 +27,1147 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Civic Information API - * - * Provides polling places, early vote locations, contest data, election - * officials, and government representatives for U.S. residential addresses. - * - * @example - * const google = require('googleapis'); - * const civicinfo = google.civicinfo('v2'); - * - * @namespace civicinfo - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Civicinfo - */ -export class Civicinfo { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace civicinfo_v2 { + /** + * Google Civic Information API + * + * Provides polling places, early vote locations, contest data, election + * officials, and government representatives for U.S. residential addresses. + * + * @example + * const google = require('googleapis'); + * const civicinfo = google.civicinfo('v2'); + * + * @namespace civicinfo + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Civicinfo + */ + export class Civicinfo { + _options: GlobalOptions; + google: GoogleApis; + root = this; - divisions: Resource$Divisions; - elections: Resource$Elections; - representatives: Resource$Representatives; + divisions: Resource$Divisions; + elections: Resource$Elections; + representatives: Resource$Representatives; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.divisions = new Resource$Divisions(this); - this.elections = new Resource$Elections(this); - this.representatives = new Resource$Representatives(this); - } + this.divisions = new Resource$Divisions(this); + this.elections = new Resource$Elections(this); + this.representatives = new Resource$Representatives(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Describes information about a regional election administrative area. - */ -export interface Schema$AdministrationRegion { - /** - * The election administration body for this area. - */ - electionAdministrationBody: Schema$AdministrativeBody; - /** - * An ID for this object. IDs may change in future requests and should not be - * cached. Access to this field requires special access that can be requested - * from the Request more link on the Quotas page. - */ - id: string; - /** - * The city or county that provides election information for this voter. This - * object can have the same elements as state. - */ - local_jurisdiction: Schema$AdministrationRegion; - /** - * The name of the jurisdiction. - */ - name: string; - /** - * A list of sources for this area. If multiple sources are listed the data - * has been aggregated from those sources. - */ - sources: Schema$Source[]; -} -/** - * Information about an election administrative body (e.g. County Board of - * Elections). - */ -export interface Schema$AdministrativeBody { - /** - * A URL provided by this administrative body for information on absentee - * voting. - */ - absenteeVotingInfoUrl: string; - addressLines: string[]; - /** - * A URL provided by this administrative body to give contest information to - * the voter. - */ - ballotInfoUrl: string; - /** - * The mailing address of this administrative body. - */ - correspondenceAddress: Schema$SimpleAddressType; - /** - * A URL provided by this administrative body for looking up general election - * information. - */ - electionInfoUrl: string; - /** - * The election officials for this election administrative body. - */ - electionOfficials: Schema$ElectionOfficial[]; - /** - * A URL provided by this administrative body for confirming that the voter is - * registered to vote. - */ - electionRegistrationConfirmationUrl: string; - /** - * A URL provided by this administrative body for looking up how to register - * to vote. - */ - electionRegistrationUrl: string; - /** - * A URL provided by this administrative body describing election rules to the - * voter. - */ - electionRulesUrl: string; - /** - * A description of the hours of operation for this administrative body. - */ - hoursOfOperation: string; - /** - * The name of this election administrative body. - */ - name: string; - /** - * The physical address of this administrative body. - */ - physicalAddress: Schema$SimpleAddressType; - /** - * A description of the services this administrative body may provide. - */ - voter_services: string[]; - /** - * A URL provided by this administrative body for looking up where to vote. - */ - votingLocationFinderUrl: string; -} -/** - * Information about a candidate running for elected office. - */ -export interface Schema$Candidate { - /** - * The URL for the candidate's campaign web site. - */ - candidateUrl: string; - /** - * A list of known (social) media channels for this candidate. - */ - channels: Schema$Channel[]; - /** - * The email address for the candidate's campaign. - */ - email: string; - /** - * The candidate's name. If this is a joint ticket it will indicate the - * name of the candidate at the top of a ticket followed by a / and that name - * of candidate at the bottom of the ticket. e.g. "Mitt Romney / Paul - * Ryan" - */ - name: string; - /** - * The order the candidate appears on the ballot for this contest. - */ - orderOnBallot: string; - /** - * The full name of the party the candidate is a member of. - */ - party: string; - /** - * The voice phone number for the candidate's campaign office. - */ - phone: string; - /** - * A URL for a photo of the candidate. - */ - photoUrl: string; -} -/** - * A social media or web channel for a candidate. - */ -export interface Schema$Channel { - /** - * The unique public identifier for the candidate's channel. - */ - id: string; - /** - * The type of channel. The following is a list of types of channels, but is - * not exhaustive. More channel types may be added at a later time. One of: - * GooglePlus, YouTube, Facebook, Twitter - */ - type: string; -} -/** - * Information about a contest that appears on a voter's ballot. - */ -export interface Schema$Contest { - /** - * A number specifying the position of this contest on the voter's ballot. - */ - ballotPlacement: string; - /** - * The candidate choices for this contest. - */ - candidates: Schema$Candidate[]; - /** - * Information about the electoral district that this contest is in. - */ - district: Schema$ElectoralDistrict; - /** - * A description of any additional eligibility requirements for voting in this - * contest. - */ - electorateSpecifications: string; - /** - * An ID for this object. IDs may change in future requests and should not be - * cached. Access to this field requires special access that can be requested - * from the Request more link on the Quotas page. - */ - id: string; - /** - * The levels of government of the office for this contest. There may be more - * than one in cases where a jurisdiction effectively acts at two different - * levels of government; for example, the mayor of the District of Columbia - * acts at "locality" level, but also effectively at both - * "administrative-area-2" and "administrative-area-1". - */ - level: string[]; - /** - * The number of candidates that will be elected to office in this contest. - */ - numberElected: string; - /** - * The number of candidates that a voter may vote for in this contest. - */ - numberVotingFor: string; - /** - * The name of the office for this contest. - */ - office: string; - /** - * If this is a partisan election, the name of the party it is for. - */ - primaryParty: string; - /** - * The set of ballot responses for the referendum. A ballot response - * represents a line on the ballot. Common examples might include - * "yes" or "no" for referenda. This field is only - * populated for contests of type 'Referendum'. - */ - referendumBallotResponses: string[]; - /** - * Specifies a short summary of the referendum that is typically on the ballot - * below the title but above the text. This field is only populated for - * contests of type 'Referendum'. - */ - referendumBrief: string; - /** - * A statement in opposition to the referendum. It does not necessarily appear - * on the ballot. This field is only populated for contests of type - * 'Referendum'. - */ - referendumConStatement: string; - /** - * Specifies what effect abstaining (not voting) on the proposition will have - * (i.e. whether abstaining is considered a vote against it). This field is - * only populated for contests of type 'Referendum'. - */ - referendumEffectOfAbstain: string; - /** - * The threshold of votes that the referendum needs in order to pass, e.g. - * "two-thirds". This field is only populated for contests of type - * 'Referendum'. - */ - referendumPassageThreshold: string; - /** - * A statement in favor of the referendum. It does not necessarily appear on - * the ballot. This field is only populated for contests of type - * 'Referendum'. - */ - referendumProStatement: string; - /** - * A brief description of the referendum. This field is only populated for - * contests of type 'Referendum'. - */ - referendumSubtitle: string; - /** - * The full text of the referendum. This field is only populated for contests - * of type 'Referendum'. - */ - referendumText: string; - /** - * The title of the referendum (e.g. 'Proposition 42'). This field is - * only populated for contests of type 'Referendum'. - */ - referendumTitle: string; - /** - * A link to the referendum. This field is only populated for contests of type - * 'Referendum'. - */ - referendumUrl: string; - /** - * The roles which this office fulfills. - */ - roles: string[]; - /** - * A list of sources for this contest. If multiple sources are listed, the - * data has been aggregated from those sources. - */ - sources: Schema$Source[]; - /** - * "Yes" or "No" depending on whether this a contest being - * held outside the normal election cycle. - */ - special: string; - /** - * The type of contest. Usually this will be 'General', - * 'Primary', or 'Run-off' for contests with candidates. For - * referenda this will be 'Referendum'. For Retention contests this - * will typically be 'Retention'. - */ - type: string; -} -export interface Schema$ContextParams { clientProfile: string; } -/** - * A request to look up representative information for a single division. - */ -export interface Schema$DivisionRepresentativeInfoRequest { - contextParams: Schema$ContextParams; -} -/** - * A search request for political geographies. - */ -export interface Schema$DivisionSearchRequest { - contextParams: Schema$ContextParams; -} -/** - * The result of a division search query. - */ -export interface Schema$DivisionSearchResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "civicinfo#divisionSearchResponse". - */ - kind: string; - results: Schema$DivisionSearchResult[]; -} -/** - * Represents a political geographic division that matches the requested query. - */ -export interface Schema$DivisionSearchResult { - /** - * Other Open Civic Data identifiers that refer to the same division -- for - * example, those that refer to other political divisions whose boundaries are - * defined to be coterminous with this one. For example, - * ocd-division/country:us/state:wy will include an alias of - * ocd-division/country:us/state:wy/cd:1, since Wyoming has only one - * Congressional district. - */ - aliases: string[]; - /** - * The name of the division. - */ - name: string; - /** - * The unique Open Civic Data identifier for this division. - */ - ocdId: string; -} -/** - * Information about the election that was queried. - */ -export interface Schema$Election { - /** - * Day of the election in YYYY-MM-DD format. - */ - electionDay: string; - /** - * The unique ID of this election. - */ - id: string; - /** - * A displayable name for the election. - */ - name: string; - /** - * The political division of the election. Represented as an OCD Division ID. - * Voters within these political jurisdictions are covered by this election. - * This is typically a state such as ocd-division/country:us/state:ca or for - * the midterms or general election the entire US (i.e. - * ocd-division/country:us). - */ - ocdDivisionId: string; -} -/** - * Information about individual election officials. - */ -export interface Schema$ElectionOfficial { - /** - * The email address of the election official. - */ - emailAddress: string; - /** - * The fax number of the election official. - */ - faxNumber: string; - /** - * The full name of the election official. - */ - name: string; - /** - * The office phone number of the election official. - */ - officePhoneNumber: string; - /** - * The title of the election official. - */ - title: string; -} -export interface Schema$ElectionsQueryRequest { - contextParams: Schema$ContextParams; -} -/** - * The list of elections available for this version of the API. - */ -export interface Schema$ElectionsQueryResponse { - /** - * A list of available elections - */ - elections: Schema$Election[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "civicinfo#electionsQueryResponse". - */ - kind: string; -} -/** - * Describes the geographic scope of a contest. - */ -export interface Schema$ElectoralDistrict { - /** - * An identifier for this district, relative to its scope. For example, the - * 34th State Senate district would have id "34" and a scope of - * stateUpper. - */ - id: string; - kgForeignKey: string; - /** - * The name of the district. - */ - name: string; - /** - * The geographic scope of this district. If unspecified the district's - * geography is not known. One of: national, statewide, congressional, - * stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, - * township, countyCouncil, cityCouncil, ward, special - */ - scope: string; -} -/** - * Describes a political geography. - */ -export interface Schema$GeographicDivision { - /** - * Any other valid OCD IDs that refer to the same division. Because OCD IDs - * are meant to be human-readable and at least somewhat predictable, there are - * occasionally several identifiers for a single division. These identifiers - * are defined to be equivalent to one another, and one is always indicated as - * the primary identifier. The primary identifier will be returned in ocd_id - * above, and any other equivalent valid identifiers will be returned in this - * list. For example, if this division's OCD ID is - * ocd-division/country:us/district:dc, this will contain - * ocd-division/country:us/state:dc. - */ - alsoKnownAs: string[]; /** - * The name of the division. - */ - name: string; - /** - * List of indices in the offices array, one for each office elected from this - * division. Will only be present if includeOffices was true (or absent) in - * the request. - */ - officeIndices: number[]; -} -/** - * Information about an Office held by one or more Officials. - */ -export interface Schema$Office { - /** - * The OCD ID of the division with which this office is associated. - */ - divisionId: string; - /** - * The levels of government of which this office is part. There may be more - * than one in cases where a jurisdiction effectively acts at two different - * levels of government; for example, the mayor of the District of Columbia - * acts at "locality" level, but also effectively at both - * "administrative-area-2" and "administrative-area-1". - */ - levels: string[]; - /** - * The human-readable name of the office. - */ - name: string; - /** - * List of indices in the officials array of people who presently hold this - * office. - */ - officialIndices: number[]; - /** - * The roles which this office fulfills. Roles are not meant to be exhaustive, - * or to exactly specify the entire set of responsibilities of a given office, - * but are meant to be rough categories that are useful for general selection - * from or sorting of a list of offices. - */ - roles: string[]; - /** - * A list of sources for this office. If multiple sources are listed, the data - * has been aggregated from those sources. - */ - sources: Schema$Source[]; -} -/** - * Information about a person holding an elected office. - */ -export interface Schema$Official { - /** - * Addresses at which to contact the official. - */ - address: Schema$SimpleAddressType[]; - /** - * A list of known (social) media channels for this official. - */ - channels: Schema$Channel[]; - /** - * The direct email addresses for the official. - */ - emails: string[]; - /** - * The official's name. - */ - name: string; - /** - * The full name of the party the official belongs to. - */ - party: string; - /** - * The official's public contact phone numbers. - */ - phones: string[]; - /** - * A URL for a photo of the official. - */ - photoUrl: string; - /** - * The official's public website URLs. - */ - urls: string[]; -} -/** - * A location where a voter can vote. This may be an early vote site, an - * election day voting location, or a drop off location for a completed ballot. - */ -export interface Schema$PollingLocation { - /** - * The address of the location. - */ - address: Schema$SimpleAddressType; - /** - * The last date that this early vote site or drop off location may be used. - * This field is not populated for polling locations. - */ - endDate: string; - /** - * An ID for this object. IDs may change in future requests and should not be - * cached. Access to this field requires special access that can be requested - * from the Request more link on the Quotas page. - */ - id: string; - /** - * The name of the early vote site or drop off location. This field is not - * populated for polling locations. - */ - name: string; - /** - * Notes about this location (e.g. accessibility ramp or entrance to use). - */ - notes: string; - /** - * A description of when this location is open. - */ - pollingHours: string; - /** - * A list of sources for this location. If multiple sources are listed the - * data has been aggregated from those sources. - */ - sources: Schema$Source[]; - /** - * The first date that this early vote site or drop off location may be used. - * This field is not populated for polling locations. - */ - startDate: string; - /** - * The services provided by this early vote site or drop off location. This - * field is not populated for polling locations. - */ - voterServices: string; -} -export interface Schema$PostalAddress { - addressLines: string[]; - administrativeAreaName: string; - countryName: string; - countryNameCode: string; - dependentLocalityName: string; - dependentThoroughfareLeadingType: string; - dependentThoroughfareName: string; - dependentThoroughfarePostDirection: string; - dependentThoroughfarePreDirection: string; - dependentThoroughfaresConnector: string; - dependentThoroughfaresIndicator: string; - dependentThoroughfaresType: string; - dependentThoroughfareTrailingType: string; - firmName: string; - isDisputed: boolean; - languageCode: string; - localityName: string; - postalCodeNumber: string; - postalCodeNumberExtension: string; - postBoxNumber: string; - premiseName: string; - recipientName: string; - sortingCode: string; - subAdministrativeAreaName: string; - subPremiseName: string; - thoroughfareLeadingType: string; - thoroughfareName: string; - thoroughfareNumber: string; - thoroughfarePostDirection: string; - thoroughfarePreDirection: string; - thoroughfareTrailingType: string; -} -export interface Schema$RepresentativeInfoData { - /** - * Political geographic divisions that contain the requested address. - */ - divisions: any; - /** - * Elected offices referenced by the divisions listed above. Will only be - * present if includeOffices was true in the request. - */ - offices: Schema$Office[]; - /** - * Officials holding the offices listed above. Will only be present if - * includeOffices was true in the request. - */ - officials: Schema$Official[]; -} -/** - * A request for political geography and representative information for an - * address. - */ -export interface Schema$RepresentativeInfoRequest { - contextParams: Schema$ContextParams; -} -/** - * The result of a representative info lookup query. - */ -export interface Schema$RepresentativeInfoResponse { - /** - * Political geographic divisions that contain the requested address. - */ - divisions: any; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "civicinfo#representativeInfoResponse". - */ - kind: string; + * Describes information about a regional election administrative area. + */ + export interface Schema$AdministrationRegion { + /** + * The election administration body for this area. + */ + electionAdministrationBody: Schema$AdministrativeBody; + /** + * An ID for this object. IDs may change in future requests and should not + * be cached. Access to this field requires special access that can be + * requested from the Request more link on the Quotas page. + */ + id: string; + /** + * The city or county that provides election information for this voter. + * This object can have the same elements as state. + */ + local_jurisdiction: Schema$AdministrationRegion; + /** + * The name of the jurisdiction. + */ + name: string; + /** + * A list of sources for this area. If multiple sources are listed the data + * has been aggregated from those sources. + */ + sources: Schema$Source[]; + } /** - * The normalized version of the requested address - */ - normalizedInput: Schema$SimpleAddressType; + * Information about an election administrative body (e.g. County Board of + * Elections). + */ + export interface Schema$AdministrativeBody { + /** + * A URL provided by this administrative body for information on absentee + * voting. + */ + absenteeVotingInfoUrl: string; + addressLines: string[]; + /** + * A URL provided by this administrative body to give contest information to + * the voter. + */ + ballotInfoUrl: string; + /** + * The mailing address of this administrative body. + */ + correspondenceAddress: Schema$SimpleAddressType; + /** + * A URL provided by this administrative body for looking up general + * election information. + */ + electionInfoUrl: string; + /** + * The election officials for this election administrative body. + */ + electionOfficials: Schema$ElectionOfficial[]; + /** + * A URL provided by this administrative body for confirming that the voter + * is registered to vote. + */ + electionRegistrationConfirmationUrl: string; + /** + * A URL provided by this administrative body for looking up how to register + * to vote. + */ + electionRegistrationUrl: string; + /** + * A URL provided by this administrative body describing election rules to + * the voter. + */ + electionRulesUrl: string; + /** + * A description of the hours of operation for this administrative body. + */ + hoursOfOperation: string; + /** + * The name of this election administrative body. + */ + name: string; + /** + * The physical address of this administrative body. + */ + physicalAddress: Schema$SimpleAddressType; + /** + * A description of the services this administrative body may provide. + */ + voter_services: string[]; + /** + * A URL provided by this administrative body for looking up where to vote. + */ + votingLocationFinderUrl: string; + } /** - * Elected offices referenced by the divisions listed above. Will only be - * present if includeOffices was true in the request. - */ - offices: Schema$Office[]; + * Information about a candidate running for elected office. + */ + export interface Schema$Candidate { + /** + * The URL for the candidate's campaign web site. + */ + candidateUrl: string; + /** + * A list of known (social) media channels for this candidate. + */ + channels: Schema$Channel[]; + /** + * The email address for the candidate's campaign. + */ + email: string; + /** + * The candidate's name. If this is a joint ticket it will indicate the + * name of the candidate at the top of a ticket followed by a / and that + * name of candidate at the bottom of the ticket. e.g. "Mitt Romney / + * Paul Ryan" + */ + name: string; + /** + * The order the candidate appears on the ballot for this contest. + */ + orderOnBallot: string; + /** + * The full name of the party the candidate is a member of. + */ + party: string; + /** + * The voice phone number for the candidate's campaign office. + */ + phone: string; + /** + * A URL for a photo of the candidate. + */ + photoUrl: string; + } /** - * Officials holding the offices listed above. Will only be present if - * includeOffices was true in the request. - */ - officials: Schema$Official[]; -} -/** - * A simple representation of an address. - */ -export interface Schema$SimpleAddressType { + * A social media or web channel for a candidate. + */ + export interface Schema$Channel { + /** + * The unique public identifier for the candidate's channel. + */ + id: string; + /** + * The type of channel. The following is a list of types of channels, but is + * not exhaustive. More channel types may be added at a later time. One of: + * GooglePlus, YouTube, Facebook, Twitter + */ + type: string; + } /** - * The city or town for the address. - */ - city: string; + * Information about a contest that appears on a voter's ballot. + */ + export interface Schema$Contest { + /** + * A number specifying the position of this contest on the voter's + * ballot. + */ + ballotPlacement: string; + /** + * The candidate choices for this contest. + */ + candidates: Schema$Candidate[]; + /** + * Information about the electoral district that this contest is in. + */ + district: Schema$ElectoralDistrict; + /** + * A description of any additional eligibility requirements for voting in + * this contest. + */ + electorateSpecifications: string; + /** + * An ID for this object. IDs may change in future requests and should not + * be cached. Access to this field requires special access that can be + * requested from the Request more link on the Quotas page. + */ + id: string; + /** + * The levels of government of the office for this contest. There may be + * more than one in cases where a jurisdiction effectively acts at two + * different levels of government; for example, the mayor of the District of + * Columbia acts at "locality" level, but also effectively at both + * "administrative-area-2" and "administrative-area-1". + */ + level: string[]; + /** + * The number of candidates that will be elected to office in this contest. + */ + numberElected: string; + /** + * The number of candidates that a voter may vote for in this contest. + */ + numberVotingFor: string; + /** + * The name of the office for this contest. + */ + office: string; + /** + * If this is a partisan election, the name of the party it is for. + */ + primaryParty: string; + /** + * The set of ballot responses for the referendum. A ballot response + * represents a line on the ballot. Common examples might include + * "yes" or "no" for referenda. This field is only + * populated for contests of type 'Referendum'. + */ + referendumBallotResponses: string[]; + /** + * Specifies a short summary of the referendum that is typically on the + * ballot below the title but above the text. This field is only populated + * for contests of type 'Referendum'. + */ + referendumBrief: string; + /** + * A statement in opposition to the referendum. It does not necessarily + * appear on the ballot. This field is only populated for contests of type + * 'Referendum'. + */ + referendumConStatement: string; + /** + * Specifies what effect abstaining (not voting) on the proposition will + * have (i.e. whether abstaining is considered a vote against it). This + * field is only populated for contests of type 'Referendum'. + */ + referendumEffectOfAbstain: string; + /** + * The threshold of votes that the referendum needs in order to pass, e.g. + * "two-thirds". This field is only populated for contests of type + * 'Referendum'. + */ + referendumPassageThreshold: string; + /** + * A statement in favor of the referendum. It does not necessarily appear on + * the ballot. This field is only populated for contests of type + * 'Referendum'. + */ + referendumProStatement: string; + /** + * A brief description of the referendum. This field is only populated for + * contests of type 'Referendum'. + */ + referendumSubtitle: string; + /** + * The full text of the referendum. This field is only populated for + * contests of type 'Referendum'. + */ + referendumText: string; + /** + * The title of the referendum (e.g. 'Proposition 42'). This field + * is only populated for contests of type 'Referendum'. + */ + referendumTitle: string; + /** + * A link to the referendum. This field is only populated for contests of + * type 'Referendum'. + */ + referendumUrl: string; + /** + * The roles which this office fulfills. + */ + roles: string[]; + /** + * A list of sources for this contest. If multiple sources are listed, the + * data has been aggregated from those sources. + */ + sources: Schema$Source[]; + /** + * "Yes" or "No" depending on whether this a contest + * being held outside the normal election cycle. + */ + special: string; + /** + * The type of contest. Usually this will be 'General', + * 'Primary', or 'Run-off' for contests with candidates. For + * referenda this will be 'Referendum'. For Retention contests this + * will typically be 'Retention'. + */ + type: string; + } + export interface Schema$ContextParams { clientProfile: string; } /** - * The street name and number of this address. + * A request to look up representative information for a single division. */ - line1: string; + export interface Schema$DivisionRepresentativeInfoRequest { + contextParams: Schema$ContextParams; + } /** - * The second line the address, if needed. + * A search request for political geographies. */ - line2: string; + export interface Schema$DivisionSearchRequest { + contextParams: Schema$ContextParams; + } /** - * The third line of the address, if needed. + * The result of a division search query. */ - line3: string; + export interface Schema$DivisionSearchResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "civicinfo#divisionSearchResponse". + */ + kind: string; + results: Schema$DivisionSearchResult[]; + } /** - * The name of the location. - */ - locationName: string; + * Represents a political geographic division that matches the requested + * query. + */ + export interface Schema$DivisionSearchResult { + /** + * Other Open Civic Data identifiers that refer to the same division -- for + * example, those that refer to other political divisions whose boundaries + * are defined to be coterminous with this one. For example, + * ocd-division/country:us/state:wy will include an alias of + * ocd-division/country:us/state:wy/cd:1, since Wyoming has only one + * Congressional district. + */ + aliases: string[]; + /** + * The name of the division. + */ + name: string; + /** + * The unique Open Civic Data identifier for this division. + */ + ocdId: string; + } /** - * The US two letter state abbreviation of the address. - */ - state: string; + * Information about the election that was queried. + */ + export interface Schema$Election { + /** + * Day of the election in YYYY-MM-DD format. + */ + electionDay: string; + /** + * The unique ID of this election. + */ + id: string; + /** + * A displayable name for the election. + */ + name: string; + /** + * The political division of the election. Represented as an OCD Division + * ID. Voters within these political jurisdictions are covered by this + * election. This is typically a state such as + * ocd-division/country:us/state:ca or for the midterms or general election + * the entire US (i.e. ocd-division/country:us). + */ + ocdDivisionId: string; + } /** - * The US Postal Zip Code of the address. - */ - zip: string; -} -/** - * Contains information about the data source for the element containing it. - */ -export interface Schema$Source { + * Information about individual election officials. + */ + export interface Schema$ElectionOfficial { + /** + * The email address of the election official. + */ + emailAddress: string; + /** + * The fax number of the election official. + */ + faxNumber: string; + /** + * The full name of the election official. + */ + name: string; + /** + * The office phone number of the election official. + */ + officePhoneNumber: string; + /** + * The title of the election official. + */ + title: string; + } + export interface Schema$ElectionsQueryRequest { + contextParams: Schema$ContextParams; + } /** - * The name of the data source. - */ - name: string; + * The list of elections available for this version of the API. + */ + export interface Schema$ElectionsQueryResponse { + /** + * A list of available elections + */ + elections: Schema$Election[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "civicinfo#electionsQueryResponse". + */ + kind: string; + } /** - * Whether this data comes from an official government source. - */ - official: boolean; -} -/** - * A request for information about a voter. - */ -export interface Schema$VoterInfoRequest { - contextParams: Schema$ContextParams; - voterInfoSegmentResult: Schema$VoterInfoSegmentResult; -} -/** - * The result of a voter info lookup query. - */ -export interface Schema$VoterInfoResponse { + * Describes the geographic scope of a contest. + */ + export interface Schema$ElectoralDistrict { + /** + * An identifier for this district, relative to its scope. For example, the + * 34th State Senate district would have id "34" and a scope of + * stateUpper. + */ + id: string; + kgForeignKey: string; + /** + * The name of the district. + */ + name: string; + /** + * The geographic scope of this district. If unspecified the district's + * geography is not known. One of: national, statewide, congressional, + * stateUpper, stateLower, countywide, judicial, schoolBoard, cityWide, + * township, countyCouncil, cityCouncil, ward, special + */ + scope: string; + } /** - * Contests that will appear on the voter's ballot. - */ - contests: Schema$Contest[]; + * Describes a political geography. + */ + export interface Schema$GeographicDivision { + /** + * Any other valid OCD IDs that refer to the same division. Because OCD IDs + * are meant to be human-readable and at least somewhat predictable, there + * are occasionally several identifiers for a single division. These + * identifiers are defined to be equivalent to one another, and one is + * always indicated as the primary identifier. The primary identifier will + * be returned in ocd_id above, and any other equivalent valid identifiers + * will be returned in this list. For example, if this division's OCD + * ID is ocd-division/country:us/district:dc, this will contain + * ocd-division/country:us/state:dc. + */ + alsoKnownAs: string[]; + /** + * The name of the division. + */ + name: string; + /** + * List of indices in the offices array, one for each office elected from + * this division. Will only be present if includeOffices was true (or + * absent) in the request. + */ + officeIndices: number[]; + } /** - * Locations where a voter is eligible to drop off a completed ballot. The - * voter must have received and completed a ballot prior to arriving at the - * location. The location may not have ballots available on the premises. - * These locations could be open on or before election day as indicated in the - * pollingHours field. - */ - dropOffLocations: Schema$PollingLocation[]; + * Information about an Office held by one or more Officials. + */ + export interface Schema$Office { + /** + * The OCD ID of the division with which this office is associated. + */ + divisionId: string; + /** + * The levels of government of which this office is part. There may be more + * than one in cases where a jurisdiction effectively acts at two different + * levels of government; for example, the mayor of the District of Columbia + * acts at "locality" level, but also effectively at both + * "administrative-area-2" and "administrative-area-1". + */ + levels: string[]; + /** + * The human-readable name of the office. + */ + name: string; + /** + * List of indices in the officials array of people who presently hold this + * office. + */ + officialIndices: number[]; + /** + * The roles which this office fulfills. Roles are not meant to be + * exhaustive, or to exactly specify the entire set of responsibilities of a + * given office, but are meant to be rough categories that are useful for + * general selection from or sorting of a list of offices. + */ + roles: string[]; + /** + * A list of sources for this office. If multiple sources are listed, the + * data has been aggregated from those sources. + */ + sources: Schema$Source[]; + } /** - * Locations where the voter is eligible to vote early, prior to election day. - */ - earlyVoteSites: Schema$PollingLocation[]; + * Information about a person holding an elected office. + */ + export interface Schema$Official { + /** + * Addresses at which to contact the official. + */ + address: Schema$SimpleAddressType[]; + /** + * A list of known (social) media channels for this official. + */ + channels: Schema$Channel[]; + /** + * The direct email addresses for the official. + */ + emails: string[]; + /** + * The official's name. + */ + name: string; + /** + * The full name of the party the official belongs to. + */ + party: string; + /** + * The official's public contact phone numbers. + */ + phones: string[]; + /** + * A URL for a photo of the official. + */ + photoUrl: string; + /** + * The official's public website URLs. + */ + urls: string[]; + } /** - * The election that was queried. - */ - election: Schema$Election; + * A location where a voter can vote. This may be an early vote site, an + * election day voting location, or a drop off location for a completed + * ballot. + */ + export interface Schema$PollingLocation { + /** + * The address of the location. + */ + address: Schema$SimpleAddressType; + /** + * The last date that this early vote site or drop off location may be used. + * This field is not populated for polling locations. + */ + endDate: string; + /** + * An ID for this object. IDs may change in future requests and should not + * be cached. Access to this field requires special access that can be + * requested from the Request more link on the Quotas page. + */ + id: string; + /** + * The name of the early vote site or drop off location. This field is not + * populated for polling locations. + */ + name: string; + /** + * Notes about this location (e.g. accessibility ramp or entrance to use). + */ + notes: string; + /** + * A description of when this location is open. + */ + pollingHours: string; + /** + * A list of sources for this location. If multiple sources are listed the + * data has been aggregated from those sources. + */ + sources: Schema$Source[]; + /** + * The first date that this early vote site or drop off location may be + * used. This field is not populated for polling locations. + */ + startDate: string; + /** + * The services provided by this early vote site or drop off location. This + * field is not populated for polling locations. + */ + voterServices: string; + } + export interface Schema$PostalAddress { + addressLines: string[]; + administrativeAreaName: string; + countryName: string; + countryNameCode: string; + dependentLocalityName: string; + dependentThoroughfareLeadingType: string; + dependentThoroughfareName: string; + dependentThoroughfarePostDirection: string; + dependentThoroughfarePreDirection: string; + dependentThoroughfaresConnector: string; + dependentThoroughfaresIndicator: string; + dependentThoroughfaresType: string; + dependentThoroughfareTrailingType: string; + firmName: string; + isDisputed: boolean; + languageCode: string; + localityName: string; + postalCodeNumber: string; + postalCodeNumberExtension: string; + postBoxNumber: string; + premiseName: string; + recipientName: string; + sortingCode: string; + subAdministrativeAreaName: string; + subPremiseName: string; + thoroughfareLeadingType: string; + thoroughfareName: string; + thoroughfareNumber: string; + thoroughfarePostDirection: string; + thoroughfarePreDirection: string; + thoroughfareTrailingType: string; + } + export interface Schema$RepresentativeInfoData { + /** + * Political geographic divisions that contain the requested address. + */ + divisions: any; + /** + * Elected offices referenced by the divisions listed above. Will only be + * present if includeOffices was true in the request. + */ + offices: Schema$Office[]; + /** + * Officials holding the offices listed above. Will only be present if + * includeOffices was true in the request. + */ + officials: Schema$Official[]; + } /** - * Identifies what kind of resource this is. Value: the fixed string - * "civicinfo#voterInfoResponse". + * A request for political geography and representative information for an + * address. */ - kind: string; + export interface Schema$RepresentativeInfoRequest { + contextParams: Schema$ContextParams; + } /** - * Specifies whether voters in the precinct vote only by mailing their ballots - * (with the possible option of dropping off their ballots as well). - */ - mailOnly: boolean; + * The result of a representative info lookup query. + */ + export interface Schema$RepresentativeInfoResponse { + /** + * Political geographic divisions that contain the requested address. + */ + divisions: any; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "civicinfo#representativeInfoResponse". + */ + kind: string; + /** + * The normalized version of the requested address + */ + normalizedInput: Schema$SimpleAddressType; + /** + * Elected offices referenced by the divisions listed above. Will only be + * present if includeOffices was true in the request. + */ + offices: Schema$Office[]; + /** + * Officials holding the offices listed above. Will only be present if + * includeOffices was true in the request. + */ + officials: Schema$Official[]; + } /** - * The normalized version of the requested address - */ - normalizedInput: Schema$SimpleAddressType; + * A simple representation of an address. + */ + export interface Schema$SimpleAddressType { + /** + * The city or town for the address. + */ + city: string; + /** + * The street name and number of this address. + */ + line1: string; + /** + * The second line the address, if needed. + */ + line2: string; + /** + * The third line of the address, if needed. + */ + line3: string; + /** + * The name of the location. + */ + locationName: string; + /** + * The US two letter state abbreviation of the address. + */ + state: string; + /** + * The US Postal Zip Code of the address. + */ + zip: string; + } /** - * If no election ID was specified in the query, and there was more than one - * election with data for the given voter, this will contain information about - * the other elections that could apply. - */ - otherElections: Schema$Election[]; + * Contains information about the data source for the element containing it. + */ + export interface Schema$Source { + /** + * The name of the data source. + */ + name: string; + /** + * Whether this data comes from an official government source. + */ + official: boolean; + } /** - * Locations where the voter is eligible to vote on election day. + * A request for information about a voter. */ - pollingLocations: Schema$PollingLocation[]; - precinctId: string; + export interface Schema$VoterInfoRequest { + contextParams: Schema$ContextParams; + voterInfoSegmentResult: Schema$VoterInfoSegmentResult; + } /** - * Local Election Information for the state that the voter votes in. For the - * US, there will only be one element in this array. - */ - state: Schema$AdministrationRegion[]; -} -export interface Schema$VoterInfoSegmentResult { - generatedMillis: string; - postalAddress: Schema$PostalAddress; - request: Schema$VoterInfoRequest; - response: Schema$VoterInfoResponse; -} - -export class Resource$Divisions { - root: Civicinfo; - constructor(root: Civicinfo) { - this.root = root; - this.getRoot.bind(this); + * The result of a voter info lookup query. + */ + export interface Schema$VoterInfoResponse { + /** + * Contests that will appear on the voter's ballot. + */ + contests: Schema$Contest[]; + /** + * Locations where a voter is eligible to drop off a completed ballot. The + * voter must have received and completed a ballot prior to arriving at the + * location. The location may not have ballots available on the premises. + * These locations could be open on or before election day as indicated in + * the pollingHours field. + */ + dropOffLocations: Schema$PollingLocation[]; + /** + * Locations where the voter is eligible to vote early, prior to election + * day. + */ + earlyVoteSites: Schema$PollingLocation[]; + /** + * The election that was queried. + */ + election: Schema$Election; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "civicinfo#voterInfoResponse". + */ + kind: string; + /** + * Specifies whether voters in the precinct vote only by mailing their + * ballots (with the possible option of dropping off their ballots as well). + */ + mailOnly: boolean; + /** + * The normalized version of the requested address + */ + normalizedInput: Schema$SimpleAddressType; + /** + * If no election ID was specified in the query, and there was more than one + * election with data for the given voter, this will contain information + * about the other elections that could apply. + */ + otherElections: Schema$Election[]; + /** + * Locations where the voter is eligible to vote on election day. + */ + pollingLocations: Schema$PollingLocation[]; + precinctId: string; + /** + * Local Election Information for the state that the voter votes in. For the + * US, there will only be one element in this array. + */ + state: Schema$AdministrationRegion[]; } - - getRoot() { - return this.root; + export interface Schema$VoterInfoSegmentResult { + generatedMillis: string; + postalAddress: Schema$PostalAddress; + request: Schema$VoterInfoRequest; + response: Schema$VoterInfoResponse; } - - /** - * civicinfo.divisions.search - * @desc Searches for political divisions by their natural name or OCD ID. - * @alias civicinfo.divisions.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.query The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html - * @param {().DivisionSearchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Divisions { + root: Civicinfo; + constructor(root: Civicinfo) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/civicinfo/v2/divisions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Elections { - root: Civicinfo; - constructor(root: Civicinfo) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * civicinfo.divisions.search + * @desc Searches for political divisions by their natural name or OCD ID. + * @alias civicinfo.divisions.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.query The search query. Queries can cover any parts of a OCD ID or a human readable division name. All words given in the query are treated as required patterns. In addition to that, most query operators of the Apache Lucene library are supported. See http://lucene.apache.org/core/2_9_4/queryparsersyntax.html + * @param {().DivisionSearchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/civicinfo/v2/divisions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * civicinfo.elections.electionQuery - * @desc List of available elections to query. - * @alias civicinfo.elections.electionQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ElectionsQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - electionQuery(params?: any, options?: MethodOptions): - AxiosPromise; - electionQuery( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - electionQuery( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Elections { + root: Civicinfo; + constructor(root: Civicinfo) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/civicinfo/v2/elections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * civicinfo.elections.voterInfoQuery - * @desc Looks up information relevant to a voter based on the voter's - * registered address. - * @alias civicinfo.elections.voterInfoQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address The registered address of the voter to look up. - * @param {string=} params.electionId The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections - * @param {boolean=} params.officialOnly If set to true, only data from official state sources will be returned. - * @param {boolean=} params.returnAllAvailableData If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries. - * @param {().VoterInfoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - voterInfoQuery(params?: any, options?: MethodOptions): - AxiosPromise; - voterInfoQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - voterInfoQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/civicinfo/v2/voterinfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['address'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * civicinfo.elections.electionQuery + * @desc List of available elections to query. + * @alias civicinfo.elections.electionQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ElectionsQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + electionQuery(params?: any, options?: MethodOptions): + AxiosPromise; + electionQuery( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + electionQuery( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/civicinfo/v2/elections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Representatives { - root: Civicinfo; - constructor(root: Civicinfo) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * civicinfo.elections.voterInfoQuery + * @desc Looks up information relevant to a voter based on the voter's + * registered address. + * @alias civicinfo.elections.voterInfoQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address The registered address of the voter to look up. + * @param {string=} params.electionId The unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/elections + * @param {boolean=} params.officialOnly If set to true, only data from official state sources will be returned. + * @param {boolean=} params.returnAllAvailableData If set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries. + * @param {().VoterInfoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + voterInfoQuery(params?: any, options?: MethodOptions): + AxiosPromise; + voterInfoQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + voterInfoQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/civicinfo/v2/voterinfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['address'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * civicinfo.representatives.representativeInfoByAddress - * @desc Looks up political geography and representative information for a - * single address. - * @alias civicinfo.representatives.representativeInfoByAddress - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.address The address to look up. May only be specified if the field ocdId is not given in the URL. - * @param {boolean=} params.includeOffices Whether to return information about offices and officials. If false, only the top-level district information will be returned. - * @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. - * @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. - * @param {().RepresentativeInfoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - representativeInfoByAddress(params?: any, options?: MethodOptions): - AxiosPromise; - representativeInfoByAddress( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - representativeInfoByAddress( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Representatives { + root: Civicinfo; + constructor(root: Civicinfo) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/civicinfo/v2/representatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * civicinfo.representatives.representativeInfoByDivision - * @desc Looks up representative information for a single geographic division. - * @alias civicinfo.representatives.representativeInfoByDivision - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. - * @param {string} params.ocdId The Open Civic Data division identifier of the division to look up. - * @param {boolean=} params.recursive If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. - * @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. - * @param {().DivisionRepresentativeInfoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - representativeInfoByDivision(params?: any, options?: MethodOptions): - AxiosPromise; - representativeInfoByDivision( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - representativeInfoByDivision( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * civicinfo.representatives.representativeInfoByAddress + * @desc Looks up political geography and representative information for a + * single address. + * @alias civicinfo.representatives.representativeInfoByAddress + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.address The address to look up. May only be specified if the field ocdId is not given in the URL. + * @param {boolean=} params.includeOffices Whether to return information about offices and officials. If false, only the top-level district information will be returned. + * @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. + * @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. + * @param {().RepresentativeInfoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + representativeInfoByAddress(params?: any, options?: MethodOptions): + AxiosPromise; + representativeInfoByAddress( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + representativeInfoByAddress( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/civicinfo/v2/representatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/civicinfo/v2/representatives/{ocdId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ocdId'], - pathParams: ['ocdId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * civicinfo.representatives.representativeInfoByDivision + * @desc Looks up representative information for a single geographic + * division. + * @alias civicinfo.representatives.representativeInfoByDivision + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.levels A list of office levels to filter by. Only offices that serve at least one of these levels will be returned. Divisions that don't contain a matching office will not be returned. + * @param {string} params.ocdId The Open Civic Data division identifier of the division to look up. + * @param {boolean=} params.recursive If true, information about all divisions contained in the division requested will be included as well. For example, if querying ocd-division/country:us/district:dc, this would also return all DC's wards and ANCs. + * @param {string=} params.roles A list of office roles to filter by. Only offices fulfilling one of these roles will be returned. Divisions that don't contain a matching office will not be returned. + * @param {().DivisionRepresentativeInfoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + representativeInfoByDivision(params?: any, options?: MethodOptions): + AxiosPromise; + representativeInfoByDivision( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + representativeInfoByDivision( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/civicinfo/v2/representatives/{ocdId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ocdId'], + pathParams: ['ocdId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/classroom/v1.ts b/src/apis/classroom/v1.ts index a51be989885..4aa5e3370c5 100644 --- a/src/apis/classroom/v1.ts +++ b/src/apis/classroom/v1.ts @@ -27,4579 +27,4647 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Classroom API - * - * Manages classes, rosters, and invitations in Google Classroom. - * - * @example - * const google = require('googleapis'); - * const classroom = google.classroom('v1'); - * - * @namespace classroom - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Classroom - */ -export class Classroom { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - courses: Resource$Courses; - invitations: Resource$Invitations; - registrations: Resource$Registrations; - userProfiles: Resource$Userprofiles; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.courses = new Resource$Courses(this); - this.invitations = new Resource$Invitations(this); - this.registrations = new Resource$Registrations(this); - this.userProfiles = new Resource$Userprofiles(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Announcement created by a teacher for students of the course - */ -export interface Schema$Announcement { - /** - * Absolute link to this announcement in the Classroom web UI. This is only - * populated if `state` is `PUBLISHED`. Read-only. - */ - alternateLink: string; - /** - * Assignee mode of the announcement. If unspecified, the default value is - * `ALL_STUDENTS`. - */ - assigneeMode: string; - /** - * Identifier of the course. Read-only. - */ - courseId: string; - /** - * Timestamp when this announcement was created. Read-only. - */ - creationTime: string; - /** - * Identifier for the user that created the announcement. Read-only. - */ - creatorUserId: string; - /** - * Classroom-assigned identifier of this announcement, unique per course. - * Read-only. - */ - id: string; - /** - * Identifiers of students with access to the announcement. This field is set - * only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is - * `INDIVIDUAL_STUDENTS`, then only students specified in this field will be - * able to see the announcement. - */ - individualStudentsOptions: Schema$IndividualStudentsOptions; - /** - * Additional materials. Announcements must have no more than 20 material - * items. - */ - materials: Schema$Material[]; - /** - * Optional timestamp when this announcement is scheduled to be published. - */ - scheduledTime: string; - /** - * Status of this announcement. If unspecified, the default state is `DRAFT`. - */ - state: string; - /** - * Description of this announcement. The text must be a valid UTF-8 string - * containing no more than 30,000 characters. - */ - text: string; - /** - * Timestamp of the most recent change to this announcement. Read-only. - */ - updateTime: string; -} -/** - * Additional details for assignments. - */ -export interface Schema$Assignment { - /** - * Drive folder where attachments from student submissions are placed. This is - * only populated for course teachers and administrators. - */ - studentWorkFolder: Schema$DriveFolder; -} -/** - * Student work for an assignment. - */ -export interface Schema$AssignmentSubmission { - /** - * Attachments added by the student. Drive files that correspond to materials - * with a share mode of STUDENT_COPY may not exist yet if the student has not - * accessed the assignment in Classroom. Some attachment metadata is only - * populated if the requesting user has permission to access it. Identifier - * and alternate_link fields are always available, but others (e.g. title) may - * not be. - */ - attachments: Schema$Attachment[]; -} -/** - * Attachment added to student assignment work. When creating attachments, - * setting the `form` field is not supported. - */ -export interface Schema$Attachment { - /** - * Google Drive file attachment. - */ - driveFile: Schema$DriveFile; - /** - * Google Forms attachment. - */ - form: Schema$Form; - /** - * Link attachment. - */ - link: Schema$Link; - /** - * Youtube video attachment. - */ - youTubeVideo: Schema$YouTubeVideo; -} -/** - * A reference to a Cloud Pub/Sub topic. To register for notifications, the - * owner of the topic must grant - * `classroom-notifications@system.gserviceaccount.com` the - * `projects.topics.publish` permission. - */ -export interface Schema$CloudPubsubTopic { - /** - * The `name` field of a Cloud Pub/Sub - * [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). - */ - topicName: string; -} -/** - * A Course in Classroom. - */ -export interface Schema$Course { - /** - * Absolute link to this course in the Classroom web UI. Read-only. - */ - alternateLink: string; - /** - * The Calendar ID for a calendar that all course members can see, to which - * Classroom adds events for course work and announcements in the course. - * Read-only. - */ - calendarId: string; - /** - * The email address of a Google group containing all members of the course. - * This group does not accept email and can only be used for permissions. - * Read-only. - */ - courseGroupEmail: string; - /** - * Sets of materials that appear on the "about" page of this course. - * Read-only. - */ - courseMaterialSets: Schema$CourseMaterialSet[]; - /** - * State of the course. If unspecified, the default state is `PROVISIONED`. - */ - courseState: string; - /** - * Creation time of the course. Specifying this field in a course update mask - * results in an error. Read-only. - */ - creationTime: string; - /** - * Optional description. For example, "We'll be learning about the - * structure of living creatures from a combination of textbooks, guest - * lectures, and lab work. Expect to be excited!" If set, this field must - * be a valid UTF-8 string and no longer than 30,000 characters. - */ - description: string; - /** - * Optional heading for the description. For example, "Welcome to 10th - * Grade Biology." If set, this field must be a valid UTF-8 string and no - * longer than 3600 characters. - */ - descriptionHeading: string; - /** - * Enrollment code to use when joining this course. Specifying this field in a - * course update mask results in an error. Read-only. - */ - enrollmentCode: string; - /** - * Whether or not guardian notifications are enabled for this course. - * Read-only. - */ - guardiansEnabled: boolean; - /** - * Identifier for this course assigned by Classroom. When creating a course, - * you may optionally set this identifier to an alias string in the request to - * create a corresponding alias. The `id` is still assigned by Classroom and - * cannot be updated after the course is created. Specifying this field in a - * course update mask results in an error. - */ - id: string; - /** - * Name of the course. For example, "10th Grade Biology". The name - * is required. It must be between 1 and 50 characters and a valid UTF-8 - * string. - */ - name: string; - /** - * The identifier of the owner of a course. When specified as a parameter of - * a create course request, this field is required. The identifier can be one - * of the following: * the numeric identifier for the user * the email - * address of the user * the string literal `"me"`, indicating the - * requesting user This must be set in a create request. Admins can also - * specify this field in a patch course request to transfer ownership. In - * other contexts, it is read-only. - */ - ownerId: string; - /** - * Optional room location. For example, "301". If set, this field - * must be a valid UTF-8 string and no longer than 650 characters. - */ - room: string; - /** - * Section of the course. For example, "Period 2". If set, this - * field must be a valid UTF-8 string and no longer than 2800 characters. - */ - section: string; - /** - * Information about a Drive Folder that is shared with all teachers of the - * course. This field will only be set for teachers of the course and domain - * administrators. Read-only. - */ - teacherFolder: Schema$DriveFolder; - /** - * The email address of a Google group containing all teachers of the course. - * This group does not accept email and can only be used for permissions. - * Read-only. - */ - teacherGroupEmail: string; - /** - * Time of the most recent update to this course. Specifying this field in a - * course update mask results in an error. Read-only. - */ - updateTime: string; -} -/** - * Alternative identifier for a course. An alias uniquely identifies a course. - * It must be unique within one of the following scopes: * domain: A - * domain-scoped alias is visible to all users within the alias creator's - * domain and can be created only by a domain admin. A domain-scoped alias is - * often used when a course has an identifier external to Classroom. * project: - * A project-scoped alias is visible to any request from an application using - * the Developer Console project ID that created the alias and can be created by - * any project. A project-scoped alias is often used when an application has - * alternative identifiers. A random value can also be used to avoid duplicate - * courses in the event of transmission failures, as retrying a request will - * return `ALREADY_EXISTS` if a previous one has succeeded. - */ -export interface Schema$CourseAlias { - /** - * Alias string. The format of the string indicates the desired alias scoping. - * * `d:<name>` indicates a domain-scoped alias. Example: `d:math_101` - * * `p:<name>` indicates a project-scoped alias. Example: `p:abc123` - * This field has a maximum length of 256 characters. - */ - alias: string; -} -/** - * A material attached to a course as part of a material set. - */ -export interface Schema$CourseMaterial { - /** - * Google Drive file attachment. - */ - driveFile: Schema$DriveFile; - /** - * Google Forms attachment. - */ - form: Schema$Form; - /** - * Link atatchment. - */ - link: Schema$Link; - /** - * Youtube video attachment. - */ - youTubeVideo: Schema$YouTubeVideo; -} -/** - * A set of materials that appears on the "About" page of the course. - * These materials might include a syllabus, schedule, or other background - * information relating to the course as a whole. - */ -export interface Schema$CourseMaterialSet { - /** - * Materials attached to this set. - */ - materials: Schema$CourseMaterial[]; - /** - * Title for this set. - */ - title: string; -} -/** - * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. - */ -export interface Schema$CourseRosterChangesInfo { - /** - * The `course_id` of the course to subscribe to roster changes for. - */ - courseId: string; -} -/** - * Course work created by a teacher for students of the course. - */ -export interface Schema$CourseWork { - /** - * Absolute link to this course work in the Classroom web UI. This is only - * populated if `state` is `PUBLISHED`. Read-only. - */ - alternateLink: string; - /** - * Assignee mode of the coursework. If unspecified, the default value is - * `ALL_STUDENTS`. - */ - assigneeMode: string; - /** - * Assignment details. This is populated only when `work_type` is - * `ASSIGNMENT`. Read-only. - */ - assignment: Schema$Assignment; - /** - * Whether this course work item is associated with the Developer Console - * project making the request. See google.classroom.Work.CreateCourseWork for - * more details. Read-only. - */ - associatedWithDeveloper: boolean; - /** - * Identifier of the course. Read-only. - */ - courseId: string; - /** - * Timestamp when this course work was created. Read-only. - */ - creationTime: string; - /** - * Identifier for the user that created the coursework. Read-only. - */ - creatorUserId: string; - /** - * Optional description of this course work. If set, the description must be a - * valid UTF-8 string containing no more than 30,000 characters. - */ - description: string; - /** - * Optional date, in UTC, that submissions for this this course work are due. - * This must be specified if `due_time` is specified. - */ - dueDate: Schema$Date; - /** - * Optional time of day, in UTC, that submissions for this this course work - * are due. This must be specified if `due_date` is specified. - */ - dueTime: Schema$TimeOfDay; - /** - * Classroom-assigned identifier of this course work, unique per course. - * Read-only. - */ - id: string; - /** - * Identifiers of students with access to the coursework. This field is set - * only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is - * `INDIVIDUAL_STUDENTS`, then only students specified in this field will be - * assigned the coursework. - */ - individualStudentsOptions: Schema$IndividualStudentsOptions; - /** - * Additional materials. CourseWork must have no more than 20 material items. - */ - materials: Schema$Material[]; - /** - * Maximum grade for this course work. If zero or unspecified, this assignment - * is considered ungraded. This must be a non-negative integer value. - */ - maxPoints: number; - /** - * Multiple choice question details. For read operations, this field is - * populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write - * operations, this field must be specified when creating course work with a - * `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set - * otherwise. - */ - multipleChoiceQuestion: Schema$MultipleChoiceQuestion; - /** - * Optional timestamp when this course work is scheduled to be published. - */ - scheduledTime: string; - /** - * Status of this course work. If unspecified, the default state is `DRAFT`. - */ - state: string; - /** - * Setting to determine when students are allowed to modify submissions. If - * unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. - */ - submissionModificationMode: string; - /** - * Title of this course work. The title must be a valid UTF-8 string - * containing between 1 and 3000 characters. - */ - title: string; - /** - * Timestamp of the most recent change to this course work. Read-only. - */ - updateTime: string; - /** - * Type of this course work. The type is set when the course work is created - * and cannot be changed. - */ - workType: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * Representation of a Google Drive file. - */ -export interface Schema$DriveFile { - /** - * URL that can be used to access the Drive item. Read-only. - */ - alternateLink: string; - /** - * Drive API resource ID. - */ - id: string; - /** - * URL of a thumbnail image of the Drive item. Read-only. - */ - thumbnailUrl: string; - /** - * Title of the Drive item. Read-only. - */ - title: string; -} -/** - * Representation of a Google Drive folder. - */ -export interface Schema$DriveFolder { - /** - * URL that can be used to access the Drive folder. Read-only. - */ - alternateLink: string; - /** - * Drive API resource ID. - */ - id: string; - /** - * Title of the Drive folder. Read-only. - */ - title: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A class of notifications that an application can register to receive. For - * example: "all roster changes for a domain". - */ -export interface Schema$Feed { - /** - * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. - * This field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`. - */ - courseRosterChangesInfo: Schema$CourseRosterChangesInfo; - /** - * The type of feed. - */ - feedType: string; -} -/** - * Google Forms item. - */ -export interface Schema$Form { - /** - * URL of the form. - */ - formUrl: string; - /** - * URL of the form responses document. Only set if respsonses have been - * recorded and only when the requesting user is an editor of the form. - * Read-only. - */ - responseUrl: string; - /** - * URL of a thumbnail image of the Form. Read-only. - */ - thumbnailUrl: string; - /** - * Title of the Form. Read-only. - */ - title: string; -} -/** - * Global user permission description. - */ -export interface Schema$GlobalPermission { - /** - * Permission value. - */ - permission: string; -} -/** - * The history of each grade on this submission. - */ -export interface Schema$GradeHistory { - /** - * The teacher who made the grade change. - */ - actorUserId: string; - /** - * The type of grade change at this time in the submission grade history. - */ - gradeChangeType: string; - /** - * When the grade of the submission was changed. - */ - gradeTimestamp: string; - /** - * The denominator of the grade at this time in the submission grade history. - */ - maxPoints: number; - /** - * The numerator of the grade at this time in the submission grade history. - */ - pointsEarned: number; -} -/** - * Association between a student and a guardian of that student. The guardian - * may receive information about the student's course work. - */ -export interface Schema$Guardian { - /** - * Identifier for the guardian. - */ - guardianId: string; - /** - * User profile for the guardian. - */ - guardianProfile: Schema$UserProfile; - /** - * The email address to which the initial guardian invitation was sent. This - * field is only visible to domain administrators. - */ - invitedEmailAddress: string; - /** - * Identifier for the student to whom the guardian relationship applies. - */ - studentId: string; -} -/** - * An invitation to become the guardian of a specified user, sent to a specified - * email address. - */ -export interface Schema$GuardianInvitation { - /** - * The time that this invitation was created. Read-only. - */ - creationTime: string; - /** - * Unique identifier for this invitation. Read-only. - */ - invitationId: string; - /** - * Email address that the invitation was sent to. This field is only visible - * to domain administrators. - */ - invitedEmailAddress: string; - /** - * The state that this invitation is in. - */ - state: string; - /** - * ID of the student (in standard format) - */ - studentId: string; -} -/** - * Assignee details about a coursework/announcement. This field is set if and - * only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. - */ -export interface Schema$IndividualStudentsOptions { - /** - * Identifiers for the students that have access to the - * coursework/announcement. - */ - studentIds: string[]; -} -/** - * An invitation to join a course. - */ -export interface Schema$Invitation { - /** - * Identifier of the course to invite the user to. - */ - courseId: string; - /** - * Identifier assigned by Classroom. Read-only. - */ - id: string; - /** - * Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. - */ - role: string; - /** - * Identifier of the invited user. When specified as a parameter of a - * request, this identifier can be set to one of the following: * the numeric - * identifier for the user * the email address of the user * the string - * literal `"me"`, indicating the requesting user - */ - userId: string; -} -/** - * URL item. - */ -export interface Schema$Link { - /** - * URL of a thumbnail image of the target URL. Read-only. - */ - thumbnailUrl: string; - /** - * Title of the target of the URL. Read-only. - */ - title: string; - /** - * URL to link to. This must be a valid UTF-8 string containing between 1 and - * 2024 characters. - */ - url: string; -} -/** - * Response when listing course work. - */ -export interface Schema$ListAnnouncementsResponse { - /** - * Announcement items that match the request. - */ - announcements: Schema$Announcement[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing course aliases. - */ -export interface Schema$ListCourseAliasesResponse { - /** - * The course aliases. - */ - aliases: Schema$CourseAlias[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing courses. - */ -export interface Schema$ListCoursesResponse { - /** - * Courses that match the list request. - */ - courses: Schema$Course[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing course work. - */ -export interface Schema$ListCourseWorkResponse { - /** - * Course work items that match the request. - */ - courseWork: Schema$CourseWork[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing guardian invitations. - */ -export interface Schema$ListGuardianInvitationsResponse { - /** - * Guardian invitations that matched the list request. - */ - guardianInvitations: Schema$GuardianInvitation[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing guardians. - */ -export interface Schema$ListGuardiansResponse { - /** - * Guardians on this page of results that met the criteria specified in the - * request. - */ - guardians: Schema$Guardian[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing invitations. - */ -export interface Schema$ListInvitationsResponse { - /** - * Invitations that match the list request. - */ - invitations: Schema$Invitation[]; - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; -} -/** - * Response when listing students. - */ -export interface Schema$ListStudentsResponse { - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; - /** - * Students who match the list request. - */ - students: Schema$Student[]; -} -/** - * Response when listing student submissions. - */ -export interface Schema$ListStudentSubmissionsResponse { - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; - /** - * Student work that matches the request. - */ - studentSubmissions: Schema$StudentSubmission[]; -} -/** - * Response when listing teachers. - */ -export interface Schema$ListTeachersResponse { - /** - * Token identifying the next page of results to return. If empty, no further - * results are available. - */ - nextPageToken: string; - /** - * Teachers who match the list request. - */ - teachers: Schema$Teacher[]; -} -/** - * Material attached to course work. When creating attachments, setting the - * `form` field is not supported. - */ -export interface Schema$Material { - /** - * Google Drive file material. - */ - driveFile: Schema$SharedDriveFile; - /** - * Google Forms material. - */ - form: Schema$Form; - /** - * Link material. On creation, will be upgraded to a more appropriate type if - * possible, and this will be reflected in the response. - */ - link: Schema$Link; - /** - * YouTube video material. - */ - youtubeVideo: Schema$YouTubeVideo; -} -/** - * Request to modify assignee mode and options of an announcement. - */ -export interface Schema$ModifyAnnouncementAssigneesRequest { - /** - * Mode of the announcement describing whether it will be accessible by all - * students or specified individual students. - */ - assigneeMode: string; - /** - * Set which students can view or cannot view the announcement. Must be - * specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. - */ - modifyIndividualStudentsOptions: Schema$ModifyIndividualStudentsOptions; -} -/** - * Request to modify the attachments of a student submission. - */ -export interface Schema$ModifyAttachmentsRequest { - /** - * Attachments to add. A student submission may not have more than 20 - * attachments. Form attachments are not supported. - */ - addAttachments: Schema$Attachment[]; -} -/** - * Request to modify assignee mode and options of a coursework. - */ -export interface Schema$ModifyCourseWorkAssigneesRequest { - /** - * Mode of the coursework describing whether it will be assigned to all - * students or specified individual students. - */ - assigneeMode: string; - /** - * Set which students are assigned or not assigned to the coursework. Must be - * specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. - */ - modifyIndividualStudentsOptions: Schema$ModifyIndividualStudentsOptions; -} -/** - * Contains fields to add or remove students from a course work or announcement - * where the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`. - */ -export interface Schema$ModifyIndividualStudentsOptions { - /** - * Ids of students to be added as having access to this - * coursework/announcement. - */ - addStudentIds: string[]; - /** - * Ids of students to be removed from having access to this - * coursework/announcement. - */ - removeStudentIds: string[]; -} -/** - * Additional details for multiple-choice questions. - */ -export interface Schema$MultipleChoiceQuestion { - /** - * Possible choices. - */ - choices: string[]; -} -/** - * Student work for a multiple-choice question. - */ -export interface Schema$MultipleChoiceSubmission { - /** - * Student's select choice. - */ - answer: string; -} -/** - * Details of the user's name. - */ -export interface Schema$Name { - /** - * The user's last name. Read-only. - */ - familyName: string; - /** - * The user's full name formed by concatenating the first and last name - * values. Read-only. - */ - fullName: string; - /** - * The user's first name. Read-only. - */ - givenName: string; -} -/** - * Request to reclaim a student submission. - */ -export interface Schema$ReclaimStudentSubmissionRequest {} -/** - * An instruction to Classroom to send notifications from the `feed` to the - * provided `destination`. - */ -export interface Schema$Registration { - /** - * The Cloud Pub/Sub topic that notifications are to be sent to. - */ - cloudPubsubTopic: Schema$CloudPubsubTopic; - /** - * The time until which the `Registration` is effective. This is a read-only - * field assigned by the server. - */ - expiryTime: string; - /** - * Specification for the class of notifications that Classroom should deliver - * to the `destination`. - */ - feed: Schema$Feed; - /** - * A server-generated unique identifier for this `Registration`. Read-only. - */ - registrationId: string; -} -/** - * Request to return a student submission. - */ -export interface Schema$ReturnStudentSubmissionRequest {} -/** - * Drive file that is used as material for course work. - */ -export interface Schema$SharedDriveFile { - /** - * Drive file details. - */ - driveFile: Schema$DriveFile; - /** - * Mechanism by which students access the Drive item. - */ - shareMode: string; -} -/** - * Student work for a short answer question. - */ -export interface Schema$ShortAnswerSubmission { - /** - * Student response to a short-answer question. - */ - answer: string; -} -/** - * The history of each state this submission has been in. - */ -export interface Schema$StateHistory { - /** - * The teacher or student who made the change - */ - actorUserId: string; - /** - * The workflow pipeline stage. - */ - state: string; - /** - * When the submission entered this state. - */ - stateTimestamp: string; -} -/** - * Student in a course. - */ -export interface Schema$Student { - /** - * Identifier of the course. Read-only. - */ - courseId: string; - /** - * Global user information for the student. Read-only. - */ - profile: Schema$UserProfile; - /** - * Information about a Drive Folder for this student's work in this - * course. Only visible to the student and domain administrators. Read-only. - */ - studentWorkFolder: Schema$DriveFolder; - /** - * Identifier of the user. When specified as a parameter of a request, this - * identifier can be one of the following: * the numeric identifier for the - * user * the email address of the user * the string literal `"me"`, - * indicating the requesting user - */ - userId: string; -} -/** - * Student submission for course work. StudentSubmission items are generated - * when a CourseWork item is created. StudentSubmissions that have never been - * accessed (i.e. with `state` = NEW) may not have a creation time or update - * time. - */ -export interface Schema$StudentSubmission { - /** - * Absolute link to the submission in the Classroom web UI. Read-only. - */ - alternateLink: string; - /** - * Optional grade. If unset, no grade was set. This value must be - * non-negative. Decimal (i.e. non-integer) values are allowed, but will be - * rounded to two decimal places. This may be modified only by course - * teachers. - */ - assignedGrade: number; - /** - * Submission content when course_work_type is ASSIGNMENT. Students can - * modify this content using google.classroom.Work.ModifyAttachments. - */ - assignmentSubmission: Schema$AssignmentSubmission; - /** - * Whether this student submission is associated with the Developer Console - * project making the request. See google.classroom.Work.CreateCourseWork for - * more details. Read-only. - */ - associatedWithDeveloper: boolean; - /** - * Identifier of the course. Read-only. - */ - courseId: string; - /** - * Identifier for the course work this corresponds to. Read-only. - */ - courseWorkId: string; - /** - * Type of course work this submission is for. Read-only. - */ - courseWorkType: string; - /** - * Creation time of this submission. This may be unset if the student has not - * accessed this item. Read-only. - */ - creationTime: string; - /** - * Optional pending grade. If unset, no grade was set. This value must be - * non-negative. Decimal (i.e. non-integer) values are allowed, but will be - * rounded to two decimal places. This is only visible to and modifiable by - * course teachers. - */ - draftGrade: number; - /** - * Classroom-assigned Identifier for the student submission. This is unique - * among submissions for the relevant course work. Read-only. - */ - id: string; - /** - * Whether this submission is late. Read-only. - */ - late: boolean; - /** - * Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. - */ - multipleChoiceSubmission: Schema$MultipleChoiceSubmission; - /** - * Submission content when course_work_type is SHORT_ANSWER_QUESTION. - */ - shortAnswerSubmission: Schema$ShortAnswerSubmission; - /** - * State of this submission. Read-only. - */ - state: string; - /** - * The history of the submission (includes state and grade histories). - * Read-only. - */ - submissionHistory: Schema$SubmissionHistory[]; - /** - * Last update time of this submission. This may be unset if the student has - * not accessed this item. Read-only. - */ - updateTime: string; - /** - * Identifier for the student that owns this submission. Read-only. - */ - userId: string; -} -/** - * The history of the submission. This currently includes state and grade - * histories. - */ -export interface Schema$SubmissionHistory { - /** - * The grade history information of the submission, if present. - */ - gradeHistory: Schema$GradeHistory; - /** - * The state history information of the submission, if present. - */ - stateHistory: Schema$StateHistory; -} -/** - * Teacher of a course. - */ -export interface Schema$Teacher { - /** - * Identifier of the course. Read-only. - */ - courseId: string; - /** - * Global user information for the teacher. Read-only. - */ - profile: Schema$UserProfile; - /** - * Identifier of the user. When specified as a parameter of a request, this - * identifier can be one of the following: * the numeric identifier for the - * user * the email address of the user * the string literal `"me"`, - * indicating the requesting user - */ - userId: string; -} -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - */ -export interface Schema$TimeOfDay { - /** - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing - * time. - */ - hours: number; - /** - * Minutes of hour of day. Must be from 0 to 59. - */ - minutes: number; - /** - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - */ - nanos: number; - /** - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. - */ - seconds: number; -} -/** - * Request to turn in a student submission. - */ -export interface Schema$TurnInStudentSubmissionRequest {} -/** - * Global information for a user. - */ -export interface Schema$UserProfile { - /** - * Email address of the user. Read-only. - */ - emailAddress: string; - /** - * Identifier of the user. Read-only. - */ - id: string; - /** - * Name of the user. Read-only. - */ - name: Schema$Name; - /** - * Global permissions of the user. Read-only. - */ - permissions: Schema$GlobalPermission[]; - /** - * URL of user's profile photo. Read-only. - */ - photoUrl: string; - /** - * Represents whether a G Suite for Education user's domain administrator - * has explicitly verified them as being a teacher. If the user is not a - * member of a G Suite for Education domain, than this field will always be - * false. Read-only - */ - verifiedTeacher: boolean; -} -/** - * YouTube video item. - */ -export interface Schema$YouTubeVideo { - /** - * URL that can be used to view the YouTube video. Read-only. - */ - alternateLink: string; - /** - * YouTube API resource ID. - */ - id: string; - /** - * URL of a thumbnail image of the YouTube video. Read-only. - */ - thumbnailUrl: string; - /** - * Title of the YouTube video. Read-only. - */ - title: string; -} - -export class Resource$Courses { - root: Classroom; - aliases: Resource$Courses$Aliases; - announcements: Resource$Courses$Announcements; - courseWork: Resource$Courses$Coursework; - students: Resource$Courses$Students; - teachers: Resource$Courses$Teachers; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); - this.aliases = new Resource$Courses$Aliases(root); - this.announcements = new Resource$Courses$Announcements(root); - this.courseWork = new Resource$Courses$Coursework(root); - this.students = new Resource$Courses$Students(root); - this.teachers = new Resource$Courses$Teachers(root); - } - - getRoot() { - return this.root; - } - - - /** - * classroom.courses.create - * @desc Creates a course. The user specified in `ownerId` is the owner of - * the created course and added as a teacher. This method returns the - * following error codes: * `PERMISSION_DENIED` if the requesting user is not - * permitted to create courses or for access errors. * `NOT_FOUND` if the - * primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course - * owner's account is disabled or for the following request errors: * - * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was - * specified in the `id` and already exists. - * @alias classroom.courses.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Course} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * classroom.courses.delete - * @desc Deletes a course. This method returns the following error codes: * - * `PERMISSION_DENIED` if the requesting user is not permitted to delete the - * requested course or for access errors. * `NOT_FOUND` if no course exists - * with the requested ID. - * @alias classroom.courses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * classroom.courses.get - * @desc Returns a course. This method returns the following error codes: * - * `PERMISSION_DENIED` if the requesting user is not permitted to access the - * requested course or for access errors. * `NOT_FOUND` if no course exists - * with the requested ID. - * @alias classroom.courses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * classroom.courses.list - * @desc Returns a list of courses that the requesting user is permitted to - * view, restricted to those that match the request. Returned courses are - * ordered by creation time, with the most recently created coming first. This - * method returns the following error codes: * `PERMISSION_DENIED` for access - * errors. * `INVALID_ARGUMENT` if the query argument is malformed. * - * `NOT_FOUND` if any users specified in the query arguments do not exist. - * @alias classroom.courses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.courseStates Restricts returned courses to those in one of the specified states The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {string=} params.studentId Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {string=} params.teacherId Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace classroom_v1 { /** - * classroom.courses.patch - * @desc Updates one or more fields in a course. This method returns the - * following error codes: * `PERMISSION_DENIED` if the requesting user is not - * permitted to modify the requested course or for access errors. * - * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` - * if invalid fields are specified in the update mask or if no update mask is - * supplied. * `FAILED_PRECONDITION` for the following request errors: * - * CourseNotModifiable - * @alias classroom.courses.patch - * @memberOf! () + * Google Classroom API * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string=} params.updateMask Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `name` * `section` * `descriptionHeading` * `description` * `room` * `courseState` * `ownerId` Note: patches to ownerId are treated as being effective immediately, but in practice it may take some time for the ownership transfer of all affected resources to complete. When set in a query parameter, this field should be specified as `updateMask=,,...` - * @param {().Course} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * classroom.courses.update - * @desc Updates a course. This method returns the following error codes: * - * `PERMISSION_DENIED` if the requesting user is not permitted to modify the - * requested course or for access errors. * `NOT_FOUND` if no course exists - * with the requested ID. * `FAILED_PRECONDITION` for the following request - * errors: * CourseNotModifiable - * @alias classroom.courses.update - * @memberOf! () + * Manages classes, rosters, and invitations in Google Classroom. * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {().Course} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Courses$Aliases { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * classroom.courses.aliases.create - * @desc Creates an alias for a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to create the alias or for access errors. * `NOT_FOUND` if the course does - * not exist. * `ALREADY_EXISTS` if the alias already exists. * - * `FAILED_PRECONDITION` if the alias requested does not make sense for the - * requesting user or course (for example, if a user not in a domain attempts - * to access a domain-scoped alias). - * @alias classroom.courses.aliases.create - * @memberOf! () + * @example + * const google = require('googleapis'); + * const classroom = google.classroom('v1'); * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {().CourseAlias} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace classroom + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Classroom */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - + export class Classroom { + _options: GlobalOptions; + google: GoogleApis; + root = this; - /** - * classroom.courses.aliases.delete - * @desc Deletes an alias of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to remove the alias or for access errors. * `NOT_FOUND` if the alias does - * not exist. * `FAILED_PRECONDITION` if the alias requested does not make - * sense for the requesting user or course (for example, if a user not in a - * domain attempts to delete a domain-scoped alias). - * @alias classroom.courses.aliases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.alias Alias to delete. This may not be the Classroom-assigned identifier. - * @param {string} params.courseId Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/aliases/{alias}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['courseId', 'alias'], - pathParams: ['alias', 'courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + courses: Resource$Courses; + invitations: Resource$Invitations; + registrations: Resource$Registrations; + userProfiles: Resource$Userprofiles; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * classroom.courses.aliases.list - * @desc Returns a list of aliases for a course. This method returns the - * following error codes: * `PERMISSION_DENIED` if the requesting user is not - * permitted to access the course or for access errors. * `NOT_FOUND` if the - * course does not exist. - * @alias classroom.courses.aliases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/aliases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + this.courses = new Resource$Courses(this); + this.invitations = new Resource$Invitations(this); + this.registrations = new Resource$Registrations(this); + this.userProfiles = new Resource$Userprofiles(this); } - } -} - -export class Resource$Courses$Announcements { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } - - - /** - * classroom.courses.announcements.create - * @desc Creates an announcement. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course, create announcements in the requested course, - * share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the - * request is malformed. * `NOT_FOUND` if the requested course does not exist. - * * `FAILED_PRECONDITION` for the following request error: * - * AttachmentNotVisible - * @alias classroom.courses.announcements.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {().Announcement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/announcements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * classroom.courses.announcements.delete - * @desc Deletes an announcement. This request must be made by the Developer - * Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding announcement item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting developer project did not - * create the corresponding announcement, if the requesting user is not - * permitted to delete the requested course or for access errors. * - * `FAILED_PRECONDITION` if the requested announcement has already been - * deleted. * `NOT_FOUND` if no course exists with the requested ID. - * @alias classroom.courses.announcements.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the announcement to delete. This identifier is a Classroom-assigned identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Announcement created by a teacher for students of the course + */ + export interface Schema$Announcement { + /** + * Absolute link to this announcement in the Classroom web UI. This is only + * populated if `state` is `PUBLISHED`. Read-only. + */ + alternateLink: string; + /** + * Assignee mode of the announcement. If unspecified, the default value is + * `ALL_STUDENTS`. + */ + assigneeMode: string; + /** + * Identifier of the course. Read-only. + */ + courseId: string; + /** + * Timestamp when this announcement was created. Read-only. + */ + creationTime: string; + /** + * Identifier for the user that created the announcement. Read-only. + */ + creatorUserId: string; + /** + * Classroom-assigned identifier of this announcement, unique per course. + * Read-only. + */ + id: string; + /** + * Identifiers of students with access to the announcement. This field is + * set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the + * `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in + * this field will be able to see the announcement. + */ + individualStudentsOptions: Schema$IndividualStudentsOptions; + /** + * Additional materials. Announcements must have no more than 20 material + * items. + */ + materials: Schema$Material[]; + /** + * Optional timestamp when this announcement is scheduled to be published. + */ + scheduledTime: string; + /** + * Status of this announcement. If unspecified, the default state is + * `DRAFT`. + */ + state: string; + /** + * Description of this announcement. The text must be a valid UTF-8 string + * containing no more than 30,000 characters. + */ + text: string; + /** + * Timestamp of the most recent change to this announcement. Read-only. + */ + updateTime: string; } - - /** - * classroom.courses.announcements.get - * @desc Returns an announcement. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course or announcement, or for access errors. * - * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the - * requested course or announcement does not exist. - * @alias classroom.courses.announcements.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the announcement. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Additional details for assignments. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Assignment { + /** + * Drive folder where attachments from student submissions are placed. This + * is only populated for course teachers and administrators. + */ + studentWorkFolder: Schema$DriveFolder; } - - /** - * classroom.courses.announcements.list - * @desc Returns a list of announcements that the requester is permitted to - * view. Course students may only view `PUBLISHED` announcements. Course - * teachers and domain administrators may view all announcements. This method - * returns the following error codes: * `PERMISSION_DENIED` if the requesting - * user is not permitted to access the requested course or for access errors. - * * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the - * requested course does not exist. - * @alias classroom.courses.announcements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.announcementStates Restriction on the `state` of announcements returned. If this argument is left unspecified, the default value is `PUBLISHED`. - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string=} params.orderBy Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported field is `updateTime`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `updateTime asc`, `updateTime` - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/announcements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Student work for an assignment. + */ + export interface Schema$AssignmentSubmission { + /** + * Attachments added by the student. Drive files that correspond to + * materials with a share mode of STUDENT_COPY may not exist yet if the + * student has not accessed the assignment in Classroom. Some attachment + * metadata is only populated if the requesting user has permission to + * access it. Identifier and alternate_link fields are always available, but + * others (e.g. title) may not be. + */ + attachments: Schema$Attachment[]; } - - /** - * classroom.courses.announcements.modifyAssignees - * @desc Modifies assignee mode and options of an announcement. Only a - * teacher of the course that contains the announcement may call this method. - * This method returns the following error codes: * `PERMISSION_DENIED` if - * the requesting user is not permitted to access the requested course or - * course work or for access errors. * `INVALID_ARGUMENT` if the request is - * malformed. * `NOT_FOUND` if the requested course or course work does not - * exist. - * @alias classroom.courses.announcements.modifyAssignees - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the announcement. - * @param {().ModifyAnnouncementAssigneesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyAssignees(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAssignees( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAssignees( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/courses/{courseId}/announcements/{id}:modifyAssignees') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Attachment added to student assignment work. When creating attachments, + * setting the `form` field is not supported. + */ + export interface Schema$Attachment { + /** + * Google Drive file attachment. + */ + driveFile: Schema$DriveFile; + /** + * Google Forms attachment. + */ + form: Schema$Form; + /** + * Link attachment. + */ + link: Schema$Link; + /** + * Youtube video attachment. + */ + youTubeVideo: Schema$YouTubeVideo; } - - /** - * classroom.courses.announcements.patch - * @desc Updates one or more fields of an announcement. This method returns - * the following error codes: * `PERMISSION_DENIED` if the requesting - * developer project did not create the corresponding announcement or for - * access errors. * `INVALID_ARGUMENT` if the request is malformed. * - * `FAILED_PRECONDITION` if the requested announcement has already been - * deleted. * `NOT_FOUND` if the requested course or announcement does not - * exist - * @alias classroom.courses.announcements.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the announcement. - * @param {string=} params.updateMask Mask that identifies which fields on the announcement to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the Announcement object. If a field that does not support empty values is included in the update mask and not set in the Announcement object, an `INVALID_ARGUMENT` error will be returned. The following fields may be specified by teachers: * `text` * `state` * `scheduled_time` - * @param {().Announcement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Courses$Coursework { - root: Classroom; - studentSubmissions: Resource$Courses$Coursework$Studentsubmissions; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); - this.studentSubmissions = - new Resource$Courses$Coursework$Studentsubmissions(root); + * A reference to a Cloud Pub/Sub topic. To register for notifications, the + * owner of the topic must grant + * `classroom-notifications@system.gserviceaccount.com` the + * `projects.topics.publish` permission. + */ + export interface Schema$CloudPubsubTopic { + /** + * The `name` field of a Cloud Pub/Sub + * [Topic](https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic). + */ + topicName: string; } - - getRoot() { - return this.root; - } - - /** - * classroom.courses.courseWork.create - * @desc Creates course work. The resulting course work (and corresponding - * student submissions) are associated with the Developer Console project of - * the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used - * to make the request. Classroom API requests to modify course work and - * student submissions must be made with an OAuth client ID from the - * associated Developer Console project. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to access the requested course, create course work in the requested course, - * share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the - * request is malformed. * `NOT_FOUND` if the requested course does not exist. - * * `FAILED_PRECONDITION` for the following request error: * - * AttachmentNotVisible - * @alias classroom.courses.courseWork.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {().CourseWork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/courseWork') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Course in Classroom. + */ + export interface Schema$Course { + /** + * Absolute link to this course in the Classroom web UI. Read-only. + */ + alternateLink: string; + /** + * The Calendar ID for a calendar that all course members can see, to which + * Classroom adds events for course work and announcements in the course. + * Read-only. + */ + calendarId: string; + /** + * The email address of a Google group containing all members of the course. + * This group does not accept email and can only be used for permissions. + * Read-only. + */ + courseGroupEmail: string; + /** + * Sets of materials that appear on the "about" page of this + * course. Read-only. + */ + courseMaterialSets: Schema$CourseMaterialSet[]; + /** + * State of the course. If unspecified, the default state is `PROVISIONED`. + */ + courseState: string; + /** + * Creation time of the course. Specifying this field in a course update + * mask results in an error. Read-only. + */ + creationTime: string; + /** + * Optional description. For example, "We'll be learning about the + * structure of living creatures from a combination of textbooks, guest + * lectures, and lab work. Expect to be excited!" If set, this field + * must be a valid UTF-8 string and no longer than 30,000 characters. + */ + description: string; + /** + * Optional heading for the description. For example, "Welcome to 10th + * Grade Biology." If set, this field must be a valid UTF-8 string and + * no longer than 3600 characters. + */ + descriptionHeading: string; + /** + * Enrollment code to use when joining this course. Specifying this field in + * a course update mask results in an error. Read-only. + */ + enrollmentCode: string; + /** + * Whether or not guardian notifications are enabled for this course. + * Read-only. + */ + guardiansEnabled: boolean; + /** + * Identifier for this course assigned by Classroom. When creating a + * course, you may optionally set this identifier to an alias string in the + * request to create a corresponding alias. The `id` is still assigned by + * Classroom and cannot be updated after the course is created. Specifying + * this field in a course update mask results in an error. + */ + id: string; + /** + * Name of the course. For example, "10th Grade Biology". The name + * is required. It must be between 1 and 50 characters and a valid UTF-8 + * string. + */ + name: string; + /** + * The identifier of the owner of a course. When specified as a parameter + * of a create course request, this field is required. The identifier can be + * one of the following: * the numeric identifier for the user * the email + * address of the user * the string literal `"me"`, indicating the + * requesting user This must be set in a create request. Admins can also + * specify this field in a patch course request to transfer ownership. In + * other contexts, it is read-only. + */ + ownerId: string; + /** + * Optional room location. For example, "301". If set, this field + * must be a valid UTF-8 string and no longer than 650 characters. + */ + room: string; + /** + * Section of the course. For example, "Period 2". If set, this + * field must be a valid UTF-8 string and no longer than 2800 characters. + */ + section: string; + /** + * Information about a Drive Folder that is shared with all teachers of the + * course. This field will only be set for teachers of the course and + * domain administrators. Read-only. + */ + teacherFolder: Schema$DriveFolder; + /** + * The email address of a Google group containing all teachers of the + * course. This group does not accept email and can only be used for + * permissions. Read-only. + */ + teacherGroupEmail: string; + /** + * Time of the most recent update to this course. Specifying this field in a + * course update mask results in an error. Read-only. + */ + updateTime: string; } - - /** - * classroom.courses.courseWork.delete - * @desc Deletes a course work. This request must be made by the Developer - * Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting developer project did not - * create the corresponding course work, if the requesting user is not - * permitted to delete the requested course or for access errors. * - * `FAILED_PRECONDITION` if the requested course work has already been - * deleted. * `NOT_FOUND` if no course exists with the requested ID. - * @alias classroom.courses.courseWork.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the course work to delete. This identifier is a Classroom-assigned identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Alternative identifier for a course. An alias uniquely identifies a + * course. It must be unique within one of the following scopes: * domain: A + * domain-scoped alias is visible to all users within the alias creator's + * domain and can be created only by a domain admin. A domain-scoped alias is + * often used when a course has an identifier external to Classroom. * + * project: A project-scoped alias is visible to any request from an + * application using the Developer Console project ID that created the alias + * and can be created by any project. A project-scoped alias is often used + * when an application has alternative identifiers. A random value can also be + * used to avoid duplicate courses in the event of transmission failures, as + * retrying a request will return `ALREADY_EXISTS` if a previous one has + * succeeded. + */ + export interface Schema$CourseAlias { + /** + * Alias string. The format of the string indicates the desired alias + * scoping. * `d:<name>` indicates a domain-scoped alias. Example: + * `d:math_101` * `p:<name>` indicates a project-scoped alias. + * Example: `p:abc123` This field has a maximum length of 256 characters. + */ + alias: string; } - - /** - * classroom.courses.courseWork.get - * @desc Returns course work. This method returns the following error codes: - * * `PERMISSION_DENIED` if the requesting user is not permitted to access the - * requested course or course work, or for access errors. * `INVALID_ARGUMENT` - * if the request is malformed. * `NOT_FOUND` if the requested course or - * course work does not exist. - * @alias classroom.courses.courseWork.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the course work. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A material attached to a course as part of a material set. + */ + export interface Schema$CourseMaterial { + /** + * Google Drive file attachment. + */ + driveFile: Schema$DriveFile; + /** + * Google Forms attachment. + */ + form: Schema$Form; + /** + * Link atatchment. + */ + link: Schema$Link; + /** + * Youtube video attachment. + */ + youTubeVideo: Schema$YouTubeVideo; } - - /** - * classroom.courses.courseWork.list - * @desc Returns a list of course work that the requester is permitted to - * view. Course students may only view `PUBLISHED` course work. Course - * teachers and domain administrators may view all course work. This method - * returns the following error codes: * `PERMISSION_DENIED` if the requesting - * user is not permitted to access the requested course or for access errors. - * * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the - * requested course does not exist. - * @alias classroom.courses.courseWork.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string=} params.courseWorkStates Restriction on the work status to return. Only courseWork that matches is returned. If unspecified, items with a work status of `PUBLISHED` is returned. - * @param {string=} params.orderBy Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported fields are `updateTime` and `dueDate`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/courseWork') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A set of materials that appears on the "About" page of the + * course. These materials might include a syllabus, schedule, or other + * background information relating to the course as a whole. + */ + export interface Schema$CourseMaterialSet { + /** + * Materials attached to this set. + */ + materials: Schema$CourseMaterial[]; + /** + * Title for this set. + */ + title: string; } - - /** - * classroom.courses.courseWork.modifyAssignees - * @desc Modifies assignee mode and options of a coursework. Only a teacher - * of the course that contains the coursework may call this method. This - * method returns the following error codes: * `PERMISSION_DENIED` if the - * requesting user is not permitted to access the requested course or course - * work or for access errors. * `INVALID_ARGUMENT` if the request is - * malformed. * `NOT_FOUND` if the requested course or course work does not - * exist. - * @alias classroom.courses.courseWork.modifyAssignees - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the coursework. - * @param {().ModifyCourseWorkAssigneesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. */ - modifyAssignees(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAssignees( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAssignees( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/courses/{courseId}/courseWork/{id}:modifyAssignees') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CourseRosterChangesInfo { + /** + * The `course_id` of the course to subscribe to roster changes for. + */ + courseId: string; } - - /** - * classroom.courses.courseWork.patch - * @desc Updates one or more fields of a course work. See - * google.classroom.v1.CourseWork for details of which fields may be updated - * and who may change them. This request must be made by the Developer - * Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting developer project did not - * create the corresponding course work, if the user is not permitted to make - * the requested modification to the student submission, or for access errors. - * * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` - * if the requested course work has already been deleted. * `NOT_FOUND` if the - * requested course, course work, or student submission does not exist. - * @alias classroom.courses.courseWork.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.id Identifier of the course work. - * @param {string=} params.updateMask Mask that identifies which fields on the course work to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the CourseWork object. If a field that does not support empty values is included in the update mask and not set in the CourseWork object, an `INVALID_ARGUMENT` error will be returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `due_date` * `due_time` * `max_points` * `scheduled_time` * `submission_modification_mode` - * @param {().CourseWork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['courseId', 'id'], - pathParams: ['courseId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Course work created by a teacher for students of the course. + */ + export interface Schema$CourseWork { + /** + * Absolute link to this course work in the Classroom web UI. This is only + * populated if `state` is `PUBLISHED`. Read-only. + */ + alternateLink: string; + /** + * Assignee mode of the coursework. If unspecified, the default value is + * `ALL_STUDENTS`. + */ + assigneeMode: string; + /** + * Assignment details. This is populated only when `work_type` is + * `ASSIGNMENT`. Read-only. + */ + assignment: Schema$Assignment; + /** + * Whether this course work item is associated with the Developer Console + * project making the request. See google.classroom.Work.CreateCourseWork + * for more details. Read-only. + */ + associatedWithDeveloper: boolean; + /** + * Identifier of the course. Read-only. + */ + courseId: string; + /** + * Timestamp when this course work was created. Read-only. + */ + creationTime: string; + /** + * Identifier for the user that created the coursework. Read-only. + */ + creatorUserId: string; + /** + * Optional description of this course work. If set, the description must be + * a valid UTF-8 string containing no more than 30,000 characters. + */ + description: string; + /** + * Optional date, in UTC, that submissions for this this course work are + * due. This must be specified if `due_time` is specified. + */ + dueDate: Schema$Date; + /** + * Optional time of day, in UTC, that submissions for this this course work + * are due. This must be specified if `due_date` is specified. + */ + dueTime: Schema$TimeOfDay; + /** + * Classroom-assigned identifier of this course work, unique per course. + * Read-only. + */ + id: string; + /** + * Identifiers of students with access to the coursework. This field is set + * only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is + * `INDIVIDUAL_STUDENTS`, then only students specified in this field will be + * assigned the coursework. + */ + individualStudentsOptions: Schema$IndividualStudentsOptions; + /** + * Additional materials. CourseWork must have no more than 20 material + * items. + */ + materials: Schema$Material[]; + /** + * Maximum grade for this course work. If zero or unspecified, this + * assignment is considered ungraded. This must be a non-negative integer + * value. + */ + maxPoints: number; + /** + * Multiple choice question details. For read operations, this field is + * populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write + * operations, this field must be specified when creating course work with a + * `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set + * otherwise. + */ + multipleChoiceQuestion: Schema$MultipleChoiceQuestion; + /** + * Optional timestamp when this course work is scheduled to be published. + */ + scheduledTime: string; + /** + * Status of this course work. If unspecified, the default state is `DRAFT`. + */ + state: string; + /** + * Setting to determine when students are allowed to modify submissions. If + * unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. + */ + submissionModificationMode: string; + /** + * Title of this course work. The title must be a valid UTF-8 string + * containing between 1 and 3000 characters. + */ + title: string; + /** + * Timestamp of the most recent change to this course work. Read-only. + */ + updateTime: string; + /** + * Type of this course work. The type is set when the course work is + * created and cannot be changed. + */ + workType: string; } -} -export class Resource$Courses$Coursework$Studentsubmissions { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; } - - getRoot() { - return this.root; + /** + * Representation of a Google Drive file. + */ + export interface Schema$DriveFile { + /** + * URL that can be used to access the Drive item. Read-only. + */ + alternateLink: string; + /** + * Drive API resource ID. + */ + id: string; + /** + * URL of a thumbnail image of the Drive item. Read-only. + */ + thumbnailUrl: string; + /** + * Title of the Drive item. Read-only. + */ + title: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.get - * @desc Returns a student submission. * `PERMISSION_DENIED` if the - * requesting user is not permitted to access the requested course, course - * work, or student submission or for access errors. * `INVALID_ARGUMENT` if - * the request is malformed. * `NOT_FOUND` if the requested course, course - * work, or student submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Representation of a Google Drive folder. + */ + export interface Schema$DriveFolder { + /** + * URL that can be used to access the Drive folder. Read-only. + */ + alternateLink: string; + /** + * Drive API resource ID. + */ + id: string; + /** + * Title of the Drive folder. Read-only. + */ + title: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.list - * @desc Returns a list of student submissions that the requester is permitted - * to view, factoring in the OAuth scopes of the request. `-` may be specified - * as the `course_work_id` to include student submissions for multiple course - * work items. Course students may only view their own work. Course teachers - * and domain administrators may view all student submissions. This method - * returns the following error codes: * `PERMISSION_DENIED` if the requesting - * user is not permitted to access the requested course or course work, or for - * access errors. * `INVALID_ARGUMENT` if the request is malformed. * - * `NOT_FOUND` if the requested course does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course. - * @param {string=} params.late Requested lateness value. If specified, returned student submissions are restricted by the requested value. If unspecified, submissions are returned regardless of `late` value. - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {string=} params.states Requested submission states. If specified, returned student submissions match one of the specified submission states. - * @param {string=} params.userId Optional argument to restrict returned student work to those owned by the student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId'], - pathParams: ['courseId', 'courseWorkId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A class of notifications that an application can register to receive. For + * example: "all roster changes for a domain". + */ + export interface Schema$Feed { + /** + * Information about a `Feed` with a `feed_type` of `COURSE_ROSTER_CHANGES`. + * This field must be specified if `feed_type` is `COURSE_ROSTER_CHANGES`. + */ + courseRosterChangesInfo: Schema$CourseRosterChangesInfo; + /** + * The type of feed. + */ + feedType: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.modifyAttachments - * @desc Modifies attachments of student submission. Attachments may only be - * added to student submissions belonging to course work objects with a - * `workType` of `ASSIGNMENT`. This request must be made by the Developer - * Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course or course work, if the user is not permitted to - * modify attachments on the requested student submission, or for access - * errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if - * the requested course, course work, or student submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.modifyAttachments - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {().ModifyAttachmentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyAttachments(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAttachments( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAttachments( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Google Forms item. + */ + export interface Schema$Form { + /** + * URL of the form. + */ + formUrl: string; + /** + * URL of the form responses document. Only set if respsonses have been + * recorded and only when the requesting user is an editor of the form. + * Read-only. + */ + responseUrl: string; + /** + * URL of a thumbnail image of the Form. Read-only. + */ + thumbnailUrl: string; + /** + * Title of the Form. Read-only. + */ + title: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.patch - * @desc Updates one or more fields of a student submission. See - * google.classroom.v1.StudentSubmission for details of which fields may be - * updated and who may change them. This request must be made by the - * Developer Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting developer project did not - * create the corresponding course work, if the user is not permitted to make - * the requested modification to the student submission, or for access errors. - * * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the - * requested course, course work, or student submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {string=} params.updateMask Mask that identifies which fields on the student submission to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields may be specified by teachers: * `draft_grade` * `assigned_grade` - * @param {().StudentSubmission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Global user permission description. */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$GlobalPermission { + /** + * Permission value. + */ + permission: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.reclaim - * @desc Reclaims a student submission on behalf of the student that owns it. - * Reclaiming a student submission transfers ownership of attached Drive files - * to the student and update the submission state. Only the student that owns - * the requested student submission may call this method, and only for a - * student submission that has been turned in. This request must be made by - * the Developer Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course or course work, unsubmit the requested student - * submission, or for access errors. * `FAILED_PRECONDITION` if the student - * submission has not been turned in. * `INVALID_ARGUMENT` if the request is - * malformed. * `NOT_FOUND` if the requested course, course work, or student - * submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.reclaim - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {().ReclaimStudentSubmissionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reclaim(params?: any, options?: MethodOptions): AxiosPromise; - reclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reclaim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The history of each grade on this submission. + */ + export interface Schema$GradeHistory { + /** + * The teacher who made the grade change. + */ + actorUserId: string; + /** + * The type of grade change at this time in the submission grade history. + */ + gradeChangeType: string; + /** + * When the grade of the submission was changed. + */ + gradeTimestamp: string; + /** + * The denominator of the grade at this time in the submission grade + * history. + */ + maxPoints: number; + /** + * The numerator of the grade at this time in the submission grade history. + */ + pointsEarned: number; } - - /** - * classroom.courses.courseWork.studentSubmissions.return - * @desc Returns a student submission. Returning a student submission - * transfers ownership of attached Drive files to the student and may also - * update the submission state. Unlike the Classroom application, returning a - * student submission does not set assignedGrade to the draftGrade value. Only - * a teacher of the course that contains the requested student submission may - * call this method. This request must be made by the Developer Console - * project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course or course work, return the requested student - * submission, or for access errors. * `INVALID_ARGUMENT` if the request is - * malformed. * `NOT_FOUND` if the requested course, course work, or student - * submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.return - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {().ReturnStudentSubmissionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - return(params?: any, options?: MethodOptions): AxiosPromise; - return( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - return( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Association between a student and a guardian of that student. The guardian + * may receive information about the student's course work. + */ + export interface Schema$Guardian { + /** + * Identifier for the guardian. + */ + guardianId: string; + /** + * User profile for the guardian. + */ + guardianProfile: Schema$UserProfile; + /** + * The email address to which the initial guardian invitation was sent. This + * field is only visible to domain administrators. + */ + invitedEmailAddress: string; + /** + * Identifier for the student to whom the guardian relationship applies. + */ + studentId: string; } - - /** - * classroom.courses.courseWork.studentSubmissions.turnIn - * @desc Turns in a student submission. Turning in a student submission - * transfers ownership of attached Drive files to the teacher and may also - * update the submission state. This may only be called by the student that - * owns the specified student submission. This request must be made by the - * Developer Console project of the [OAuth client - * ID](https://support.google.com/cloud/answer/6158849) used to create the - * corresponding course work item. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access the requested course or course work, turn in the requested student - * submission, or for access errors. * `INVALID_ARGUMENT` if the request is - * malformed. * `NOT_FOUND` if the requested course, course work, or student - * submission does not exist. - * @alias classroom.courses.courseWork.studentSubmissions.turnIn - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.courseWorkId Identifier of the course work. - * @param {string} params.id Identifier of the student submission. - * @param {().TurnInStudentSubmissionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * An invitation to become the guardian of a specified user, sent to a + * specified email address. + */ + export interface Schema$GuardianInvitation { + /** + * The time that this invitation was created. Read-only. + */ + creationTime: string; + /** + * Unique identifier for this invitation. Read-only. + */ + invitationId: string; + /** + * Email address that the invitation was sent to. This field is only visible + * to domain administrators. + */ + invitedEmailAddress: string; + /** + * The state that this invitation is in. + */ + state: string; + /** + * ID of the student (in standard format) + */ + studentId: string; + } + /** + * Assignee details about a coursework/announcement. This field is set if and + * only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. */ - turnIn(params?: any, options?: MethodOptions): AxiosPromise; - turnIn( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - turnIn( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId', 'courseWorkId', 'id'], - pathParams: ['courseId', 'courseWorkId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$IndividualStudentsOptions { + /** + * Identifiers for the students that have access to the + * coursework/announcement. + */ + studentIds: string[]; } -} - - -export class Resource$Courses$Students { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * An invitation to join a course. + */ + export interface Schema$Invitation { + /** + * Identifier of the course to invite the user to. + */ + courseId: string; + /** + * Identifier assigned by Classroom. Read-only. + */ + id: string; + /** + * Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. + */ + role: string; + /** + * Identifier of the invited user. When specified as a parameter of a + * request, this identifier can be set to one of the following: * the + * numeric identifier for the user * the email address of the user * the + * string literal `"me"`, indicating the requesting user + */ + userId: string; } - - getRoot() { - return this.root; + /** + * URL item. + */ + export interface Schema$Link { + /** + * URL of a thumbnail image of the target URL. Read-only. + */ + thumbnailUrl: string; + /** + * Title of the target of the URL. Read-only. + */ + title: string; + /** + * URL to link to. This must be a valid UTF-8 string containing between 1 + * and 2024 characters. + */ + url: string; } - - /** - * classroom.courses.students.create - * @desc Adds a user as a student of a course. This method returns the - * following error codes: * `PERMISSION_DENIED` if the requesting user is not - * permitted to create students in this course or for access errors. * - * `NOT_FOUND` if the requested course ID does not exist. * - * `FAILED_PRECONDITION` if the requested user's account is disabled, for the - * following request errors: * CourseMemberLimitReached * - * CourseNotModifiable * UserGroupsMembershipLimitReached * - * `ALREADY_EXISTS` if the user is already a student or teacher in the course. - * @alias classroom.courses.students.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string=} params.enrollmentCode Enrollment code of the course to create the student in. This code is required if userId corresponds to the requesting user; it may be omitted if the requesting user has administrative permissions to create students for any user. - * @param {().Student} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/students') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing course work. + */ + export interface Schema$ListAnnouncementsResponse { + /** + * Announcement items that match the request. + */ + announcements: Schema$Announcement[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - /** - * classroom.courses.students.delete - * @desc Deletes a student of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to delete students of this course or for access errors. * `NOT_FOUND` if no - * student of this course has the requested ID or if the course does not - * exist. - * @alias classroom.courses.students.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.userId Identifier of the student to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/students/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['courseId', 'userId'], - pathParams: ['courseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing course aliases. + */ + export interface Schema$ListCourseAliasesResponse { + /** + * The course aliases. + */ + aliases: Schema$CourseAlias[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - /** - * classroom.courses.students.get - * @desc Returns a student of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to view students of this course or for access errors. * `NOT_FOUND` if no - * student of this course has the requested ID or if the course does not - * exist. - * @alias classroom.courses.students.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.userId Identifier of the student to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/students/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'userId'], - pathParams: ['courseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing courses. + */ + export interface Schema$ListCoursesResponse { + /** + * Courses that match the list request. + */ + courses: Schema$Course[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - /** - * classroom.courses.students.list - * @desc Returns a list of students of this course that the requester is - * permitted to view. This method returns the following error codes: * - * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access - * errors. - * @alias classroom.courses.students.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/students') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing course work. + */ + export interface Schema$ListCourseWorkResponse { + /** + * Course work items that match the request. + */ + courseWork: Schema$CourseWork[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } -} - -export class Resource$Courses$Teachers { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * Response when listing guardian invitations. + */ + export interface Schema$ListGuardianInvitationsResponse { + /** + * Guardian invitations that matched the list request. + */ + guardianInvitations: Schema$GuardianInvitation[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response when listing guardians. + */ + export interface Schema$ListGuardiansResponse { + /** + * Guardians on this page of results that met the criteria specified in the + * request. + */ + guardians: Schema$Guardian[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - /** - * classroom.courses.teachers.create - * @desc Creates a teacher of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to create teachers in this course or for access errors. * `NOT_FOUND` if - * the requested course ID does not exist. * `FAILED_PRECONDITION` if the - * requested user's account is disabled, for the following request errors: * - * CourseMemberLimitReached * CourseNotModifiable * - * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * - * `ALREADY_EXISTS` if the user is already a teacher or student in the course. - * @alias classroom.courses.teachers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {().Teacher} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/teachers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing invitations. + */ + export interface Schema$ListInvitationsResponse { + /** + * Invitations that match the list request. + */ + invitations: Schema$Invitation[]; + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; } - - /** - * classroom.courses.teachers.delete - * @desc Deletes a teacher of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to delete teachers of this course or for access errors. * `NOT_FOUND` if no - * teacher of this course has the requested ID or if the course does not - * exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary - * teacher of this course. - * @alias classroom.courses.teachers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.userId Identifier of the teacher to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/teachers/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['courseId', 'userId'], - pathParams: ['courseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing students. + */ + export interface Schema$ListStudentsResponse { + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; + /** + * Students who match the list request. + */ + students: Schema$Student[]; } - - /** - * classroom.courses.teachers.get - * @desc Returns a teacher of a course. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to view teachers of this course or for access errors. * `NOT_FOUND` if no - * teacher of this course has the requested ID or if the course does not - * exist. - * @alias classroom.courses.teachers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {string} params.userId Identifier of the teacher to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/teachers/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId', 'userId'], - pathParams: ['courseId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing student submissions. + */ + export interface Schema$ListStudentSubmissionsResponse { + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; + /** + * Student work that matches the request. + */ + studentSubmissions: Schema$StudentSubmission[]; } - - /** - * classroom.courses.teachers.list - * @desc Returns a list of teachers of this course that the requester is - * permitted to view. This method returns the following error codes: * - * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access - * errors. - * @alias classroom.courses.teachers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/courses/{courseId}/teachers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['courseId'], - pathParams: ['courseId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response when listing teachers. + */ + export interface Schema$ListTeachersResponse { + /** + * Token identifying the next page of results to return. If empty, no + * further results are available. + */ + nextPageToken: string; + /** + * Teachers who match the list request. + */ + teachers: Schema$Teacher[]; } -} - - -export class Resource$Invitations { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * Material attached to course work. When creating attachments, setting the + * `form` field is not supported. + */ + export interface Schema$Material { + /** + * Google Drive file material. + */ + driveFile: Schema$SharedDriveFile; + /** + * Google Forms material. + */ + form: Schema$Form; + /** + * Link material. On creation, will be upgraded to a more appropriate type + * if possible, and this will be reflected in the response. + */ + link: Schema$Link; + /** + * YouTube video material. + */ + youtubeVideo: Schema$YouTubeVideo; } - - getRoot() { - return this.root; + /** + * Request to modify assignee mode and options of an announcement. + */ + export interface Schema$ModifyAnnouncementAssigneesRequest { + /** + * Mode of the announcement describing whether it will be accessible by all + * students or specified individual students. + */ + assigneeMode: string; + /** + * Set which students can view or cannot view the announcement. Must be + * specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions: Schema$ModifyIndividualStudentsOptions; } - - /** - * classroom.invitations.accept - * @desc Accepts an invitation, removing it and adding the invited user to the - * teachers or students (as appropriate) of the specified course. Only the - * invited user may accept an invitation. This method returns the following - * error codes: * `PERMISSION_DENIED` if the requesting user is not permitted - * to accept the requested invitation or for access errors. * - * `FAILED_PRECONDITION` for the following request errors: * - * CourseMemberLimitReached * CourseNotModifiable * - * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * - * `NOT_FOUND` if no invitation exists with the requested ID. - * @alias classroom.invitations.accept - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the invitation to accept. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to modify the attachments of a student submission. */ - accept(params?: any, options?: MethodOptions): AxiosPromise; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/invitations/{id}:accept') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ModifyAttachmentsRequest { + /** + * Attachments to add. A student submission may not have more than 20 + * attachments. Form attachments are not supported. + */ + addAttachments: Schema$Attachment[]; } - - /** - * classroom.invitations.create - * @desc Creates an invitation. Only one invitation for a user and course may - * exist at a time. Delete and re-create an invitation to make changes. This - * method returns the following error codes: * `PERMISSION_DENIED` if the - * requesting user is not permitted to create invitations for this course or - * for access errors. * `NOT_FOUND` if the course or the user does not exist. - * * `FAILED_PRECONDITION` if the requested user's account is disabled or if - * the user already has this role or a role with greater permissions. * - * `ALREADY_EXISTS` if an invitation for the specified user and course already - * exists. - * @alias classroom.invitations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Invitation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/invitations').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request to modify assignee mode and options of a coursework. + */ + export interface Schema$ModifyCourseWorkAssigneesRequest { + /** + * Mode of the coursework describing whether it will be assigned to all + * students or specified individual students. + */ + assigneeMode: string; + /** + * Set which students are assigned or not assigned to the coursework. Must + * be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. + */ + modifyIndividualStudentsOptions: Schema$ModifyIndividualStudentsOptions; } - - /** - * classroom.invitations.delete - * @desc Deletes an invitation. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * delete the requested invitation or for access errors. * `NOT_FOUND` if no - * invitation exists with the requested ID. - * @alias classroom.invitations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the invitation to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/invitations/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Contains fields to add or remove students from a course work or + * announcement where the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`. + */ + export interface Schema$ModifyIndividualStudentsOptions { + /** + * Ids of students to be added as having access to this + * coursework/announcement. + */ + addStudentIds: string[]; + /** + * Ids of students to be removed from having access to this + * coursework/announcement. + */ + removeStudentIds: string[]; } - - /** - * classroom.invitations.get - * @desc Returns an invitation. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * view the requested invitation or for access errors. * `NOT_FOUND` if no - * invitation exists with the requested ID. - * @alias classroom.invitations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Identifier of the invitation to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Additional details for multiple-choice questions. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/invitations/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$MultipleChoiceQuestion { + /** + * Possible choices. + */ + choices: string[]; } - - /** - * classroom.invitations.list - * @desc Returns a list of invitations that the requesting user is permitted - * to view, restricted to those that match the list request. *Note:* At least - * one of `user_id` or `course_id` must be supplied. Both fields can be - * supplied. This method returns the following error codes: * - * `PERMISSION_DENIED` for access errors. - * @alias classroom.invitations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.courseId Restricts returned invitations to those for a course with the specified identifier. - * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {string=} params.userId Restricts returned invitations to those for a specific user. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Student work for a multiple-choice question. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/invitations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$MultipleChoiceSubmission { + /** + * Student's select choice. + */ + answer: string; } -} - -export class Resource$Registrations { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * Details of the user's name. + */ + export interface Schema$Name { + /** + * The user's last name. Read-only. + */ + familyName: string; + /** + * The user's full name formed by concatenating the first and last name + * values. Read-only. + */ + fullName: string; + /** + * The user's first name. Read-only. + */ + givenName: string; } - - getRoot() { - return this.root; + /** + * Request to reclaim a student submission. + */ + export interface Schema$ReclaimStudentSubmissionRequest {} + /** + * An instruction to Classroom to send notifications from the `feed` to the + * provided `destination`. + */ + export interface Schema$Registration { + /** + * The Cloud Pub/Sub topic that notifications are to be sent to. + */ + cloudPubsubTopic: Schema$CloudPubsubTopic; + /** + * The time until which the `Registration` is effective. This is a + * read-only field assigned by the server. + */ + expiryTime: string; + /** + * Specification for the class of notifications that Classroom should + * deliver to the `destination`. + */ + feed: Schema$Feed; + /** + * A server-generated unique identifier for this `Registration`. Read-only. + */ + registrationId: string; } - - /** - * classroom.registrations.create - * @desc Creates a `Registration`, causing Classroom to start sending - * notifications from the provided `feed` to the provided `destination`. - * Returns the created `Registration`. Currently, this will be the same as the - * argument, but with server-assigned fields such as `expiry_time` and `id` - * filled in. Note that any value specified for the `expiry_time` or `id` - * fields will be ignored. While Classroom may validate the `destination` and - * return errors on a best effort basis, it is the caller's responsibility to - * ensure that it exists and that Classroom has permission to publish to it. - * This method may return the following error codes: * `PERMISSION_DENIED` - * if: * the authenticated user does not have permission to receive - * notifications from the requested field; or * the credential provided - * does not include the appropriate scope for the requested feed. * - * another access error is encountered. * `INVALID_ARGUMENT` if: * no - * `destination` is specified, or the specified `destination` is not valid; or - * * no `feed` is specified, or the specified `feed` is not valid. * - * `NOT_FOUND` if: * the specified `feed` cannot be located, or the - * requesting user does not have permission to determine whether or not - * it exists; or * the specified `destination` cannot be located, or - * Classroom has not been granted permission to publish to it. - * @alias classroom.registrations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Registration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to return a student submission. */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/registrations').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ReturnStudentSubmissionRequest {} + /** + * Drive file that is used as material for course work. + */ + export interface Schema$SharedDriveFile { + /** + * Drive file details. + */ + driveFile: Schema$DriveFile; + /** + * Mechanism by which students access the Drive item. + */ + shareMode: string; } - - /** - * classroom.registrations.delete - * @desc Deletes a `Registration`, causing Classroom to stop sending - * notifications for that `Registration`. - * @alias classroom.registrations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.registrationId The `registration_id` of the `Registration` to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Student work for a short answer question. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/registrations/{registrationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['registrationId'], - pathParams: ['registrationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ShortAnswerSubmission { + /** + * Student response to a short-answer question. + */ + answer: string; } -} - -export class Resource$Userprofiles { - root: Classroom; - guardianInvitations: Resource$Userprofiles$Guardianinvitations; - guardians: Resource$Userprofiles$Guardians; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); - this.guardianInvitations = - new Resource$Userprofiles$Guardianinvitations(root); - this.guardians = new Resource$Userprofiles$Guardians(root); + /** + * The history of each state this submission has been in. + */ + export interface Schema$StateHistory { + /** + * The teacher or student who made the change + */ + actorUserId: string; + /** + * The workflow pipeline stage. + */ + state: string; + /** + * When the submission entered this state. + */ + stateTimestamp: string; } - - getRoot() { - return this.root; + /** + * Student in a course. + */ + export interface Schema$Student { + /** + * Identifier of the course. Read-only. + */ + courseId: string; + /** + * Global user information for the student. Read-only. + */ + profile: Schema$UserProfile; + /** + * Information about a Drive Folder for this student's work in this + * course. Only visible to the student and domain administrators. Read-only. + */ + studentWorkFolder: Schema$DriveFolder; + /** + * Identifier of the user. When specified as a parameter of a request, this + * identifier can be one of the following: * the numeric identifier for the + * user * the email address of the user * the string literal + * `"me"`, indicating the requesting user + */ + userId: string; } - - /** - * classroom.userProfiles.get - * @desc Returns a user profile. This method returns the following error - * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to - * access this user profile, if no profile exists with the requested ID, or - * for access errors. - * @alias classroom.userProfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Student submission for course work. StudentSubmission items are generated + * when a CourseWork item is created. StudentSubmissions that have never been + * accessed (i.e. with `state` = NEW) may not have a creation time or update + * time. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/userProfiles/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$StudentSubmission { + /** + * Absolute link to the submission in the Classroom web UI. Read-only. + */ + alternateLink: string; + /** + * Optional grade. If unset, no grade was set. This value must be + * non-negative. Decimal (i.e. non-integer) values are allowed, but will be + * rounded to two decimal places. This may be modified only by course + * teachers. + */ + assignedGrade: number; + /** + * Submission content when course_work_type is ASSIGNMENT. Students can + * modify this content using google.classroom.Work.ModifyAttachments. + */ + assignmentSubmission: Schema$AssignmentSubmission; + /** + * Whether this student submission is associated with the Developer Console + * project making the request. See google.classroom.Work.CreateCourseWork + * for more details. Read-only. + */ + associatedWithDeveloper: boolean; + /** + * Identifier of the course. Read-only. + */ + courseId: string; + /** + * Identifier for the course work this corresponds to. Read-only. + */ + courseWorkId: string; + /** + * Type of course work this submission is for. Read-only. + */ + courseWorkType: string; + /** + * Creation time of this submission. This may be unset if the student has + * not accessed this item. Read-only. + */ + creationTime: string; + /** + * Optional pending grade. If unset, no grade was set. This value must be + * non-negative. Decimal (i.e. non-integer) values are allowed, but will be + * rounded to two decimal places. This is only visible to and modifiable by + * course teachers. + */ + draftGrade: number; + /** + * Classroom-assigned Identifier for the student submission. This is unique + * among submissions for the relevant course work. Read-only. + */ + id: string; + /** + * Whether this submission is late. Read-only. + */ + late: boolean; + /** + * Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. + */ + multipleChoiceSubmission: Schema$MultipleChoiceSubmission; + /** + * Submission content when course_work_type is SHORT_ANSWER_QUESTION. + */ + shortAnswerSubmission: Schema$ShortAnswerSubmission; + /** + * State of this submission. Read-only. + */ + state: string; + /** + * The history of the submission (includes state and grade histories). + * Read-only. + */ + submissionHistory: Schema$SubmissionHistory[]; + /** + * Last update time of this submission. This may be unset if the student has + * not accessed this item. Read-only. + */ + updateTime: string; + /** + * Identifier for the student that owns this submission. Read-only. + */ + userId: string; } -} -export class Resource$Userprofiles$Guardianinvitations { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + /** + * The history of the submission. This currently includes state and grade + * histories. + */ + export interface Schema$SubmissionHistory { + /** + * The grade history information of the submission, if present. + */ + gradeHistory: Schema$GradeHistory; + /** + * The state history information of the submission, if present. + */ + stateHistory: Schema$StateHistory; } - - getRoot() { - return this.root; + /** + * Teacher of a course. + */ + export interface Schema$Teacher { + /** + * Identifier of the course. Read-only. + */ + courseId: string; + /** + * Global user information for the teacher. Read-only. + */ + profile: Schema$UserProfile; + /** + * Identifier of the user. When specified as a parameter of a request, this + * identifier can be one of the following: * the numeric identifier for the + * user * the email address of the user * the string literal + * `"me"`, indicating the requesting user + */ + userId: string; } - - /** - * classroom.userProfiles.guardianInvitations.create - * @desc Creates a guardian invitation, and sends an email to the guardian - * asking them to confirm that they are the student's guardian. Once the - * guardian accepts the invitation, their `state` will change to `COMPLETED` - * and they will start receiving guardian notifications. A `Guardian` resource - * will also be created to represent the active guardian. The request object - * must have the `student_id` and `invited_email_address` fields set. Failing - * to set these fields, or setting any other fields in the request, will - * result in an error. This method returns the following error codes: * - * `PERMISSION_DENIED` if the current user does not have permission to manage - * guardians, if the guardian in question has already rejected too many - * requests for that student, if guardians are not enabled for the domain in - * question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student - * or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if - * the guardian email address is not valid (for example, if it is too long), - * or if the format of the student ID provided cannot be recognized (it is - * not an email address, nor a `user_id` from this API). This error will - * also be returned if read-only fields are set, or if the `state` field is - * set to to a value other than `PENDING`. * `NOT_FOUND` if the student ID - * provided is a valid student ID, but Classroom has no record of that - * student. * `ALREADY_EXISTS` if there is already a pending guardian - * invitation for the student and `invited_email_address` provided, or if - * the provided `invited_email_address` matches the Google account of an - * existing `Guardian` for this user. - * @alias classroom.userProfiles.guardianInvitations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.studentId ID of the student (in standard format) - * @param {().GuardianInvitation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/userProfiles/{studentId}/guardianInvitations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['studentId'], - pathParams: ['studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a time of day. The date and time zone are either not significant + * or are specified elsewhere. An API may choose to allow leap seconds. + * Related types are google.type.Date and `google.protobuf.Timestamp`. + */ + export interface Schema$TimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business + * closing time. + */ + hours: number; + /** + * Minutes of hour of day. Must be from 0 to 59. + */ + minutes: number; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + */ + nanos: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds: number; } - - /** - * classroom.userProfiles.guardianInvitations.get - * @desc Returns a specific guardian invitation. This method returns the - * following error codes: * `PERMISSION_DENIED` if the requesting user is not - * permitted to view guardian invitations for the student identified by the - * `student_id`, if guardians are not enabled for the domain in question, or - * for other access errors. * `INVALID_ARGUMENT` if a `student_id` is - * specified, but its format cannot be recognized (it is not an email - * address, nor a `student_id` from the API, nor the literal string `me`). * - * `NOT_FOUND` if Classroom cannot find any record of the given student or - * `invitation_id`. May also be returned if the student exists, but the - * requesting user does not have access to see that student. - * @alias classroom.userProfiles.guardianInvitations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.invitationId The `id` field of the `GuardianInvitation` being requested. - * @param {string} params.studentId The ID of the student whose guardian invitation is being requested. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['studentId', 'invitationId'], - pathParams: ['invitationId', 'studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request to turn in a student submission. + */ + export interface Schema$TurnInStudentSubmissionRequest {} + /** + * Global information for a user. + */ + export interface Schema$UserProfile { + /** + * Email address of the user. Read-only. + */ + emailAddress: string; + /** + * Identifier of the user. Read-only. + */ + id: string; + /** + * Name of the user. Read-only. + */ + name: Schema$Name; + /** + * Global permissions of the user. Read-only. + */ + permissions: Schema$GlobalPermission[]; + /** + * URL of user's profile photo. Read-only. + */ + photoUrl: string; + /** + * Represents whether a G Suite for Education user's domain + * administrator has explicitly verified them as being a teacher. If the + * user is not a member of a G Suite for Education domain, than this field + * will always be false. Read-only + */ + verifiedTeacher: boolean; } - - /** - * classroom.userProfiles.guardianInvitations.list - * @desc Returns a list of guardian invitations that the requesting user is - * permitted to view, filtered by the parameters provided. This method - * returns the following error codes: * `PERMISSION_DENIED` if a `student_id` - * is specified, and the requesting user is not permitted to view guardian - * invitations for that student, if `"-"` is specified as the `student_id` - * and the user is not a domain administrator, if guardians are not enabled - * for the domain in question, or for other access errors. * - * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be - * recognized (it is not an email address, nor a `student_id` from the API, - * nor the literal string `me`). May also be returned if an invalid - * `page_token` or `state` is provided. * `NOT_FOUND` if a `student_id` is - * specified, and its format can be recognized, but Classroom has no record - * of that student. - * @alias classroom.userProfiles.guardianInvitations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.invitedEmailAddress If specified, only results with the specified `invited_email_address` will be returned. - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {string=} params.states If specified, only results with the specified `state` values will be returned. Otherwise, results with a `state` of `PENDING` will be returned. - * @param {string} params.studentId The ID of the student whose guardian invitations are to be returned. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user * the string literal `"-"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/userProfiles/{studentId}/guardianInvitations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['studentId'], - pathParams: ['studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * YouTube video item. + */ + export interface Schema$YouTubeVideo { + /** + * URL that can be used to view the YouTube video. Read-only. + */ + alternateLink: string; + /** + * YouTube API resource ID. + */ + id: string; + /** + * URL of a thumbnail image of the YouTube video. Read-only. + */ + thumbnailUrl: string; + /** + * Title of the YouTube video. Read-only. + */ + title: string; } - - /** - * classroom.userProfiles.guardianInvitations.patch - * @desc Modifies a guardian invitation. Currently, the only valid - * modification is to change the `state` from `PENDING` to `COMPLETE`. This - * has the effect of withdrawing the invitation. This method returns the - * following error codes: * `PERMISSION_DENIED` if the current user does not - * have permission to manage guardians, if guardians are not enabled for the - * domain in question or for other access errors. * `FAILED_PRECONDITION` if - * the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if - * the format of the student ID provided cannot be recognized (it is not an - * email address, nor a `user_id` from this API), or if the passed - * `GuardianInvitation` has a `state` other than `COMPLETE`, or if it - * modifies fields other than `state`. * `NOT_FOUND` if the student ID - * provided is a valid student ID, but Classroom has no record of that - * student, or if the `id` field does not refer to a guardian invitation - * known to Classroom. - * @alias classroom.userProfiles.guardianInvitations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.invitationId The `id` field of the `GuardianInvitation` to be modified. - * @param {string} params.studentId The ID of the student whose guardian invitation is to be modified. - * @param {string=} params.updateMask Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `state` When set in a query parameter, this field should be specified as `updateMask=,,...` - * @param {().GuardianInvitation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Courses { + root: Classroom; + aliases: Resource$Courses$Aliases; + announcements: Resource$Courses$Announcements; + courseWork: Resource$Courses$Coursework; + students: Resource$Courses$Students; + teachers: Resource$Courses$Teachers; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + this.aliases = new Resource$Courses$Aliases(root); + this.announcements = new Resource$Courses$Announcements(root); + this.courseWork = new Resource$Courses$Coursework(root); + this.students = new Resource$Courses$Students(root); + this.teachers = new Resource$Courses$Teachers(root); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.create + * @desc Creates a course. The user specified in `ownerId` is the owner of + * the created course and added as a teacher. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to create courses or for access errors. * `NOT_FOUND` if + * the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the + * course owner's account is disabled or for the following request errors: + * * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was + * specified in the `id` and already exists. + * @alias classroom.courses.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Course} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.delete + * @desc Deletes a course. This method returns the following error codes: + * * `PERMISSION_DENIED` if the requesting user is not permitted to delete + * the requested course or for access errors. * `NOT_FOUND` if no course + * exists with the requested ID. + * @alias classroom.courses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.get + * @desc Returns a course. This method returns the following error codes: + * * `PERMISSION_DENIED` if the requesting user is not permitted to access + * the requested course or for access errors. * `NOT_FOUND` if no course + * exists with the requested ID. + * @alias classroom.courses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.list + * @desc Returns a list of courses that the requesting user is permitted to + * view, restricted to those that match the request. Returned courses are + * ordered by creation time, with the most recently created coming first. + * This method returns the following error codes: * `PERMISSION_DENIED` for + * access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * + * `NOT_FOUND` if any users specified in the query arguments do not exist. + * @alias classroom.courses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.courseStates Restricts returned courses to those in one of the specified states The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {string=} params.studentId Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {string=} params.teacherId Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.patch + * @desc Updates one or more fields in a course. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to modify the requested course or for access errors. * + * `NOT_FOUND` if no course exists with the requested ID. * + * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + * if no update mask is supplied. * `FAILED_PRECONDITION` for the following + * request errors: * CourseNotModifiable + * @alias classroom.courses.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string=} params.updateMask Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `name` * `section` * `descriptionHeading` * `description` * `room` * `courseState` * `ownerId` Note: patches to ownerId are treated as being effective immediately, but in practice it may take some time for the ownership transfer of all affected resources to complete. When set in a query parameter, this field should be specified as `updateMask=,,...` + * @param {().Course} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.update + * @desc Updates a course. This method returns the following error codes: + * * `PERMISSION_DENIED` if the requesting user is not permitted to modify + * the requested course or for access errors. * `NOT_FOUND` if no course + * exists with the requested ID. * `FAILED_PRECONDITION` for the following + * request errors: * CourseNotModifiable + * @alias classroom.courses.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {().Course} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{id}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['studentId', 'invitationId'], - pathParams: ['invitationId', 'studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Courses$Aliases { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.aliases.create + * @desc Creates an alias for a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to create the alias or for access errors. * `NOT_FOUND` if the + * course does not exist. * `ALREADY_EXISTS` if the alias already exists. * + * `FAILED_PRECONDITION` if the alias requested does not make sense for the + * requesting user or course (for example, if a user not in a domain + * attempts to access a domain-scoped alias). + * @alias classroom.courses.aliases.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {().CourseAlias} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.aliases.delete + * @desc Deletes an alias of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to remove the alias or for access errors. * `NOT_FOUND` if the + * alias does not exist. * `FAILED_PRECONDITION` if the alias requested does + * not make sense for the requesting user or course (for example, if a + * user not in a domain attempts to delete a domain-scoped alias). + * @alias classroom.courses.aliases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.alias Alias to delete. This may not be the Classroom-assigned identifier. + * @param {string} params.courseId Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/aliases/{alias}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['courseId', 'alias'], + pathParams: ['alias', 'courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.aliases.list + * @desc Returns a list of aliases for a course. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to access the course or for access errors. * `NOT_FOUND` if + * the course does not exist. + * @alias classroom.courses.aliases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/aliases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Userprofiles$Guardians { - root: Classroom; - constructor(root: Classroom) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Courses$Announcements { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.announcements.create + * @desc Creates an announcement. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course, create announcements in the requested + * course, share a Drive attachment, or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course does not exist. * `FAILED_PRECONDITION` for the + * following request error: * AttachmentNotVisible + * @alias classroom.courses.announcements.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {().Announcement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/announcements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.announcements.delete + * @desc Deletes an announcement. This request must be made by the + * Developer Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding announcement item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting developer project did not + * create the corresponding announcement, if the requesting user is not + * permitted to delete the requested course or for access errors. * + * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. * `NOT_FOUND` if no course exists with the requested ID. + * @alias classroom.courses.announcements.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the announcement to delete. This identifier is a Classroom-assigned identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.announcements.get + * @desc Returns an announcement. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or announcement, or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course or announcement does not exist. + * @alias classroom.courses.announcements.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the announcement. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.announcements.list + * @desc Returns a list of announcements that the requester is permitted to + * view. Course students may only view `PUBLISHED` announcements. Course + * teachers and domain administrators may view all announcements. This + * method returns the following error codes: * `PERMISSION_DENIED` if the + * requesting user is not permitted to access the requested course or for + * access errors. * `INVALID_ARGUMENT` if the request is malformed. * + * `NOT_FOUND` if the requested course does not exist. + * @alias classroom.courses.announcements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.announcementStates Restriction on the `state` of announcements returned. If this argument is left unspecified, the default value is `PUBLISHED`. + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string=} params.orderBy Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported field is `updateTime`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `updateTime asc`, `updateTime` + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/announcements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.announcements.modifyAssignees + * @desc Modifies assignee mode and options of an announcement. Only a + * teacher of the course that contains the announcement may call this + * method. This method returns the following error codes: * + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course or course work does not exist. + * @alias classroom.courses.announcements.modifyAssignees + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the announcement. + * @param {().ModifyAnnouncementAssigneesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAssignees(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAssignees( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAssignees( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/courses/{courseId}/announcements/{id}:modifyAssignees') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.announcements.patch + * @desc Updates one or more fields of an announcement. This method returns + * the following error codes: * `PERMISSION_DENIED` if the requesting + * developer project did not create the corresponding announcement or for + * access errors. * `INVALID_ARGUMENT` if the request is malformed. * + * `FAILED_PRECONDITION` if the requested announcement has already been + * deleted. * `NOT_FOUND` if the requested course or announcement does not + * exist + * @alias classroom.courses.announcements.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the announcement. + * @param {string=} params.updateMask Mask that identifies which fields on the announcement to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the Announcement object. If a field that does not support empty values is included in the update mask and not set in the Announcement object, an `INVALID_ARGUMENT` error will be returned. The following fields may be specified by teachers: * `text` * `state` * `scheduled_time` + * @param {().Announcement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/announcements/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Courses$Coursework { + root: Classroom; + studentSubmissions: Resource$Courses$Coursework$Studentsubmissions; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + this.studentSubmissions = + new Resource$Courses$Coursework$Studentsubmissions(root); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.courseWork.create + * @desc Creates course work. The resulting course work (and corresponding + * student submissions) are associated with the Developer Console project of + * the [OAuth client ID](https://support.google.com/cloud/answer/6158849) + * used to make the request. Classroom API requests to modify course work + * and student submissions must be made with an OAuth client ID from the + * associated Developer Console project. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to access the requested course, create course work in the + * requested course, share a Drive attachment, or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course does not exist. * `FAILED_PRECONDITION` for the + * following request error: * AttachmentNotVisible + * @alias classroom.courses.courseWork.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {().CourseWork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/courseWork') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.delete + * @desc Deletes a course work. This request must be made by the Developer + * Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting developer project did not + * create the corresponding course work, if the requesting user is not + * permitted to delete the requested course or for access errors. * + * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. * `NOT_FOUND` if no course exists with the requested ID. + * @alias classroom.courses.courseWork.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the course work to delete. This identifier is a Classroom-assigned identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.get + * @desc Returns course work. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or course work, or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course or course work does not exist. + * @alias classroom.courses.courseWork.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the course work. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.list + * @desc Returns a list of course work that the requester is permitted to + * view. Course students may only view `PUBLISHED` course work. Course + * teachers and domain administrators may view all course work. This method + * returns the following error codes: * `PERMISSION_DENIED` if the + * requesting user is not permitted to access the requested course or for + * access errors. * `INVALID_ARGUMENT` if the request is malformed. * + * `NOT_FOUND` if the requested course does not exist. + * @alias classroom.courses.courseWork.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string=} params.courseWorkStates Restriction on the work status to return. Only courseWork that matches is returned. If unspecified, items with a work status of `PUBLISHED` is returned. + * @param {string=} params.orderBy Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported fields are `updateTime` and `dueDate`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/courseWork') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.modifyAssignees + * @desc Modifies assignee mode and options of a coursework. Only a teacher + * of the course that contains the coursework may call this method. This + * method returns the following error codes: * `PERMISSION_DENIED` if the + * requesting user is not permitted to access the requested course or course + * work or for access errors. * `INVALID_ARGUMENT` if the request is + * malformed. * `NOT_FOUND` if the requested course or course work does not + * exist. + * @alias classroom.courses.courseWork.modifyAssignees + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the coursework. + * @param {().ModifyCourseWorkAssigneesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAssignees(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAssignees( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAssignees( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/courses/{courseId}/courseWork/{id}:modifyAssignees') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.patch + * @desc Updates one or more fields of a course work. See + * google.classroom.v1.CourseWork for details of which fields may be updated + * and who may change them. This request must be made by the Developer + * Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting developer project did not + * create the corresponding course work, if the user is not permitted to + * make the requested modification to the student submission, or for access + * errors. * `INVALID_ARGUMENT` if the request is malformed. * + * `FAILED_PRECONDITION` if the requested course work has already been + * deleted. * `NOT_FOUND` if the requested course, course work, or student + * submission does not exist. + * @alias classroom.courses.courseWork.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.id Identifier of the course work. + * @param {string=} params.updateMask Mask that identifies which fields on the course work to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the CourseWork object. If a field that does not support empty values is included in the update mask and not set in the CourseWork object, an `INVALID_ARGUMENT` error will be returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `due_date` * `due_time` * `max_points` * `scheduled_time` * `submission_modification_mode` + * @param {().CourseWork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/courseWork/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['courseId', 'id'], + pathParams: ['courseId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Courses$Coursework$Studentsubmissions { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.courseWork.studentSubmissions.get + * @desc Returns a student submission. * `PERMISSION_DENIED` if the + * requesting user is not permitted to access the requested course, course + * work, or student submission or for access errors. * `INVALID_ARGUMENT` if + * the request is malformed. * `NOT_FOUND` if the requested course, course + * work, or student submission does not exist. + * @alias classroom.courses.courseWork.studentSubmissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.list + * @desc Returns a list of student submissions that the requester is + * permitted to view, factoring in the OAuth scopes of the request. `-` may + * be specified as the `course_work_id` to include student submissions for + * multiple course work items. Course students may only view their own + * work. Course teachers and domain administrators may view all student + * submissions. This method returns the following error codes: * + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + * requested course or course work, or for access errors. * + * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the + * requested course does not exist. + * @alias classroom.courses.courseWork.studentSubmissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course. + * @param {string=} params.late Requested lateness value. If specified, returned student submissions are restricted by the requested value. If unspecified, submissions are returned regardless of `late` value. + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {string=} params.states Requested submission states. If specified, returned student submissions match one of the specified submission states. + * @param {string=} params.userId Optional argument to restrict returned student work to those owned by the student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId'], + pathParams: ['courseId', 'courseWorkId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.modifyAttachments + * @desc Modifies attachments of student submission. Attachments may only + * be added to student submissions belonging to course work objects with a + * `workType` of `ASSIGNMENT`. This request must be made by the Developer + * Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or course work, if the user is not permitted + * to modify attachments on the requested student submission, or for access + * errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` + * if the requested course, course work, or student submission does not + * exist. + * @alias classroom.courses.courseWork.studentSubmissions.modifyAttachments + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {().ModifyAttachmentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAttachments(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAttachments( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAttachments( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.patch + * @desc Updates one or more fields of a student submission. See + * google.classroom.v1.StudentSubmission for details of which fields may be + * updated and who may change them. This request must be made by the + * Developer Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting developer project did not + * create the corresponding course work, if the user is not permitted to + * make the requested modification to the student submission, or for access + * errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` + * if the requested course, course work, or student submission does not + * exist. + * @alias classroom.courses.courseWork.studentSubmissions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {string=} params.updateMask Mask that identifies which fields on the student submission to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields may be specified by teachers: * `draft_grade` * `assigned_grade` + * @param {().StudentSubmission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.reclaim + * @desc Reclaims a student submission on behalf of the student that owns + * it. Reclaiming a student submission transfers ownership of attached + * Drive files to the student and update the submission state. Only the + * student that owns the requested student submission may call this method, + * and only for a student submission that has been turned in. This request + * must be made by the Developer Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or course work, unsubmit the requested + * student submission, or for access errors. * `FAILED_PRECONDITION` if the + * student submission has not been turned in. * `INVALID_ARGUMENT` if the + * request is malformed. * `NOT_FOUND` if the requested course, course work, + * or student submission does not exist. + * @alias classroom.courses.courseWork.studentSubmissions.reclaim + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {().ReclaimStudentSubmissionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reclaim(params?: any, options?: MethodOptions): AxiosPromise; + reclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reclaim( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.return + * @desc Returns a student submission. Returning a student submission + * transfers ownership of attached Drive files to the student and may also + * update the submission state. Unlike the Classroom application, returning + * a student submission does not set assignedGrade to the draftGrade value. + * Only a teacher of the course that contains the requested student + * submission may call this method. This request must be made by the + * Developer Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or course work, return the requested student + * submission, or for access errors. * `INVALID_ARGUMENT` if the request is + * malformed. * `NOT_FOUND` if the requested course, course work, or student + * submission does not exist. + * @alias classroom.courses.courseWork.studentSubmissions.return + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {().ReturnStudentSubmissionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + return(params?: any, options?: MethodOptions): AxiosPromise; + return( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + return( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.courseWork.studentSubmissions.turnIn + * @desc Turns in a student submission. Turning in a student submission + * transfers ownership of attached Drive files to the teacher and may also + * update the submission state. This may only be called by the student that + * owns the specified student submission. This request must be made by the + * Developer Console project of the [OAuth client + * ID](https://support.google.com/cloud/answer/6158849) used to create the + * corresponding course work item. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access the requested course or course work, turn in the requested student + * submission, or for access errors. * `INVALID_ARGUMENT` if the request is + * malformed. * `NOT_FOUND` if the requested course, course work, or student + * submission does not exist. + * @alias classroom.courses.courseWork.studentSubmissions.turnIn + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.courseWorkId Identifier of the course work. + * @param {string} params.id Identifier of the student submission. + * @param {().TurnInStudentSubmissionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + turnIn(params?: any, options?: MethodOptions): AxiosPromise; + turnIn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + turnIn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId', 'courseWorkId', 'id'], + pathParams: ['courseId', 'courseWorkId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * classroom.userProfiles.guardians.delete - * @desc Deletes a guardian. The guardian will no longer receive guardian - * notifications and the guardian will no longer be accessible via the API. - * This method returns the following error codes: * `PERMISSION_DENIED` if no - * user that matches the provided `student_id` is visible to the requesting - * user, if the requesting user is not permitted to manage guardians for the - * student identified by the `student_id`, if guardians are not enabled for - * the domain in question, or for other access errors. * `INVALID_ARGUMENT` - * if a `student_id` is specified, but its format cannot be recognized (it - * is not an email address, nor a `student_id` from the API). * `NOT_FOUND` - * if the requesting user is permitted to modify guardians for the requested - * `student_id`, but no `Guardian` record exists for that student with the - * provided `guardian_id`. - * @alias classroom.userProfiles.guardians.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.guardianId The `id` field from a `Guardian`. - * @param {string} params.studentId The student whose guardian is to be deleted. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Courses$Students { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.students.create + * @desc Adds a user as a student of a course. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to create students in this course or for access errors. * + * `NOT_FOUND` if the requested course ID does not exist. * + * `FAILED_PRECONDITION` if the requested user's account is disabled, for + * the following request errors: * CourseMemberLimitReached * + * CourseNotModifiable * UserGroupsMembershipLimitReached * + * `ALREADY_EXISTS` if the user is already a student or teacher in the + * course. + * @alias classroom.courses.students.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string=} params.enrollmentCode Enrollment code of the course to create the student in. This code is required if userId corresponds to the requesting user; it may be omitted if the requesting user has administrative permissions to create students for any user. + * @param {().Student} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/students') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.students.delete + * @desc Deletes a student of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to delete students of this course or for access errors. * + * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + * @alias classroom.courses.students.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.userId Identifier of the student to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/students/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['courseId', 'userId'], + pathParams: ['courseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.students.get + * @desc Returns a student of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to view students of this course or for access errors. * + * `NOT_FOUND` if no student of this course has the requested ID or if the + * course does not exist. + * @alias classroom.courses.students.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.userId Identifier of the student to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/students/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'userId'], + pathParams: ['courseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.students.list + * @desc Returns a list of students of this course that the requester is + * permitted to view. This method returns the following error codes: * + * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for + * access errors. + * @alias classroom.courses.students.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/students') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/userProfiles/{studentId}/guardians/{guardianId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['studentId', 'guardianId'], - pathParams: ['guardianId', 'studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Courses$Teachers { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.courses.teachers.create + * @desc Creates a teacher of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to create teachers in this course or for access errors. * + * `NOT_FOUND` if the requested course ID does not exist. * + * `FAILED_PRECONDITION` if the requested user's account is disabled, for + * the following request errors: * CourseMemberLimitReached * + * CourseNotModifiable * CourseTeacherLimitReached * + * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is + * already a teacher or student in the course. + * @alias classroom.courses.teachers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {().Teacher} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/teachers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.teachers.delete + * @desc Deletes a teacher of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to delete teachers of this course or for access errors. * + * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. * `FAILED_PRECONDITION` if the requested ID + * belongs to the primary teacher of this course. + * @alias classroom.courses.teachers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.userId Identifier of the teacher to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/teachers/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['courseId', 'userId'], + pathParams: ['courseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.teachers.get + * @desc Returns a teacher of a course. This method returns the following + * error codes: * `PERMISSION_DENIED` if the requesting user is not + * permitted to view teachers of this course or for access errors. * + * `NOT_FOUND` if no teacher of this course has the requested ID or if the + * course does not exist. + * @alias classroom.courses.teachers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {string} params.userId Identifier of the teacher to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/teachers/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId', 'userId'], + pathParams: ['courseId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.courses.teachers.list + * @desc Returns a list of teachers of this course that the requester is + * permitted to view. This method returns the following error codes: * + * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for + * access errors. + * @alias classroom.courses.teachers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.courseId Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/courses/{courseId}/teachers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['courseId'], + pathParams: ['courseId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * classroom.userProfiles.guardians.get - * @desc Returns a specific guardian. This method returns the following error - * codes: * `PERMISSION_DENIED` if no user that matches the provided - * `student_id` is visible to the requesting user, if the requesting user is - * not permitted to view guardian information for the student identified by - * the `student_id`, if guardians are not enabled for the domain in - * question, or for other access errors. * `INVALID_ARGUMENT` if a - * `student_id` is specified, but its format cannot be recognized (it is not - * an email address, nor a `student_id` from the API, nor the literal string - * `me`). * `NOT_FOUND` if the requesting user is permitted to view guardians - * for the requested `student_id`, but no `Guardian` record exists for that - * student that matches the provided `guardian_id`. - * @alias classroom.userProfiles.guardians.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.guardianId The `id` field from a `Guardian`. - * @param {string} params.studentId The student whose guardian is being requested. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/userProfiles/{studentId}/guardians/{guardianId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['studentId', 'guardianId'], - pathParams: ['guardianId', 'studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Invitations { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.invitations.accept + * @desc Accepts an invitation, removing it and adding the invited user to + * the teachers or students (as appropriate) of the specified course. Only + * the invited user may accept an invitation. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to accept the requested invitation or for access errors. * + * `FAILED_PRECONDITION` for the following request errors: * + * CourseMemberLimitReached * CourseNotModifiable * + * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * + * `NOT_FOUND` if no invitation exists with the requested ID. + * @alias classroom.invitations.accept + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the invitation to accept. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + accept(params?: any, options?: MethodOptions): AxiosPromise; + accept( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + accept( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/invitations/{id}:accept') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.invitations.create + * @desc Creates an invitation. Only one invitation for a user and course + * may exist at a time. Delete and re-create an invitation to make changes. + * This method returns the following error codes: * `PERMISSION_DENIED` if + * the requesting user is not permitted to create invitations for this + * course or for access errors. * `NOT_FOUND` if the course or the user does + * not exist. * `FAILED_PRECONDITION` if the requested user's account is + * disabled or if the user already has this role or a role with greater + * permissions. * `ALREADY_EXISTS` if an invitation for the specified user + * and course already exists. + * @alias classroom.invitations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Invitation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/invitations').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.invitations.delete + * @desc Deletes an invitation. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * delete the requested invitation or for access errors. * `NOT_FOUND` if no + * invitation exists with the requested ID. + * @alias classroom.invitations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the invitation to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/invitations/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.invitations.get + * @desc Returns an invitation. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * view the requested invitation or for access errors. * `NOT_FOUND` if no + * invitation exists with the requested ID. + * @alias classroom.invitations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Identifier of the invitation to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/invitations/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.invitations.list + * @desc Returns a list of invitations that the requesting user is permitted + * to view, restricted to those that match the list request. *Note:* At + * least one of `user_id` or `course_id` must be supplied. Both fields can + * be supplied. This method returns the following error codes: * + * `PERMISSION_DENIED` for access errors. + * @alias classroom.invitations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.courseId Restricts returned invitations to those for a course with the specified identifier. + * @param {integer=} params.pageSize Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {string=} params.userId Restricts returned invitations to those for a specific user. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/invitations').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Registrations { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.registrations.create + * @desc Creates a `Registration`, causing Classroom to start sending + * notifications from the provided `feed` to the provided `destination`. + * Returns the created `Registration`. Currently, this will be the same as + * the argument, but with server-assigned fields such as `expiry_time` and + * `id` filled in. Note that any value specified for the `expiry_time` or + * `id` fields will be ignored. While Classroom may validate the + * `destination` and return errors on a best effort basis, it is the + * caller's responsibility to ensure that it exists and that Classroom has + * permission to publish to it. This method may return the following error + * codes: * `PERMISSION_DENIED` if: * the authenticated user does not + * have permission to receive notifications from the requested field; + * or * the credential provided does not include the appropriate scope + * for the requested feed. * another access error is encountered. + * * `INVALID_ARGUMENT` if: * no `destination` is specified, or the + * specified `destination` is not valid; or * no `feed` is + * specified, or the specified `feed` is not valid. * `NOT_FOUND` if: * + * the specified `feed` cannot be located, or the requesting user does not + * have permission to determine whether or not it exists; or * the + * specified `destination` cannot be located, or Classroom has not been + * granted permission to publish to it. + * @alias classroom.registrations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Registration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/registrations').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.registrations.delete + * @desc Deletes a `Registration`, causing Classroom to stop sending + * notifications for that `Registration`. + * @alias classroom.registrations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.registrationId The `registration_id` of the `Registration` to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/registrations/{registrationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['registrationId'], + pathParams: ['registrationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * classroom.userProfiles.guardians.list - * @desc Returns a list of guardians that the requesting user is permitted to - * view, restricted to those that match the request. To list guardians for - * any student that the requesting user may view guardians for, use the - * literal character `-` for the student ID. This method returns the - * following error codes: * `PERMISSION_DENIED` if a `student_id` is - * specified, and the requesting user is not permitted to view guardian - * information for that student, if `"-"` is specified as the `student_id` - * and the user is not a domain administrator, if guardians are not enabled - * for the domain in question, if the `invited_email_address` filter is set - * by a user who is not a domain administrator, or for other access errors. - * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot - * be recognized (it is not an email address, nor a `student_id` from the API, - * nor the literal string `me`). May also be returned if an invalid - * `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and - * its format can be recognized, but Classroom has no record of that - * student. - * @alias classroom.userProfiles.guardians.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.invitedEmailAddress Filter results by the email address that the original invitation was sent to, resulting in this guardian link. This filter can only be used by domain administrators. - * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - * @param {string} params.studentId Filter results by the student who the guardian is linked to. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user * the string literal `"-"`, indicating that results should be returned for all students that the requesting user has access to view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Userprofiles { + root: Classroom; + guardianInvitations: Resource$Userprofiles$Guardianinvitations; + guardians: Resource$Userprofiles$Guardians; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + this.guardianInvitations = + new Resource$Userprofiles$Guardianinvitations(root); + this.guardians = new Resource$Userprofiles$Guardians(root); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.userProfiles.get + * @desc Returns a user profile. This method returns the following error + * codes: * `PERMISSION_DENIED` if the requesting user is not permitted to + * access this user profile, if no profile exists with the requested ID, or + * for access errors. + * @alias classroom.userProfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId Identifier of the profile to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/userProfiles/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Userprofiles$Guardianinvitations { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.userProfiles.guardianInvitations.create + * @desc Creates a guardian invitation, and sends an email to the guardian + * asking them to confirm that they are the student's guardian. Once the + * guardian accepts the invitation, their `state` will change to `COMPLETED` + * and they will start receiving guardian notifications. A `Guardian` + * resource will also be created to represent the active guardian. The + * request object must have the `student_id` and `invited_email_address` + * fields set. Failing to set these fields, or setting any other fields in + * the request, will result in an error. This method returns the following + * error codes: * `PERMISSION_DENIED` if the current user does not have + * permission to manage guardians, if the guardian in question has already + * rejected too many requests for that student, if guardians are not + * enabled for the domain in question, or for other access errors. * + * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian + * link limit. * `INVALID_ARGUMENT` if the guardian email address is not + * valid (for example, if it is too long), or if the format of the student + * ID provided cannot be recognized (it is not an email address, nor a + * `user_id` from this API). This error will also be returned if read-only + * fields are set, or if the `state` field is set to to a value other than + * `PENDING`. * `NOT_FOUND` if the student ID provided is a valid student + * ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if + * there is already a pending guardian invitation for the student and + * `invited_email_address` provided, or if the provided + * `invited_email_address` matches the Google account of an existing + * `Guardian` for this user. + * @alias classroom.userProfiles.guardianInvitations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.studentId ID of the student (in standard format) + * @param {().GuardianInvitation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/userProfiles/{studentId}/guardianInvitations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['studentId'], + pathParams: ['studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.userProfiles.guardianInvitations.get + * @desc Returns a specific guardian invitation. This method returns the + * following error codes: * `PERMISSION_DENIED` if the requesting user is + * not permitted to view guardian invitations for the student identified + * by the `student_id`, if guardians are not enabled for the domain in + * question, or for other access errors. * `INVALID_ARGUMENT` if a + * `student_id` is specified, but its format cannot be recognized (it is + * not an email address, nor a `student_id` from the API, nor the literal + * string `me`). * `NOT_FOUND` if Classroom cannot find any record of the + * given student or `invitation_id`. May also be returned if the student + * exists, but the requesting user does not have access to see that + * student. + * @alias classroom.userProfiles.guardianInvitations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.invitationId The `id` field of the `GuardianInvitation` being requested. + * @param {string} params.studentId The ID of the student whose guardian invitation is being requested. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['studentId', 'invitationId'], + pathParams: ['invitationId', 'studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.userProfiles.guardianInvitations.list + * @desc Returns a list of guardian invitations that the requesting user is + * permitted to view, filtered by the parameters provided. This method + * returns the following error codes: * `PERMISSION_DENIED` if a + * `student_id` is specified, and the requesting user is not permitted to + * view guardian invitations for that student, if `"-"` is specified as + * the `student_id` and the user is not a domain administrator, if + * guardians are not enabled for the domain in question, or for other + * access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but + * its format cannot be recognized (it is not an email address, nor a + * `student_id` from the API, nor the literal string `me`). May also be + * returned if an invalid `page_token` or `state` is provided. * + * `NOT_FOUND` if a `student_id` is specified, and its format can be + * recognized, but Classroom has no record of that student. + * @alias classroom.userProfiles.guardianInvitations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.invitedEmailAddress If specified, only results with the specified `invited_email_address` will be returned. + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {string=} params.states If specified, only results with the specified `state` values will be returned. Otherwise, results with a `state` of `PENDING` will be returned. + * @param {string} params.studentId The ID of the student whose guardian invitations are to be returned. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user * the string literal `"-"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/userProfiles/{studentId}/guardianInvitations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['studentId'], + pathParams: ['studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * classroom.userProfiles.guardianInvitations.patch + * @desc Modifies a guardian invitation. Currently, the only valid + * modification is to change the `state` from `PENDING` to `COMPLETE`. This + * has the effect of withdrawing the invitation. This method returns the + * following error codes: * `PERMISSION_DENIED` if the current user does + * not have permission to manage guardians, if guardians are not enabled + * for the domain in question or for other access errors. * + * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. + * * `INVALID_ARGUMENT` if the format of the student ID provided cannot be + * recognized (it is not an email address, nor a `user_id` from this API), + * or if the passed `GuardianInvitation` has a `state` other than + * `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if + * the student ID provided is a valid student ID, but Classroom has no + * record of that student, or if the `id` field does not refer to a + * guardian invitation known to Classroom. + * @alias classroom.userProfiles.guardianInvitations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.invitationId The `id` field of the `GuardianInvitation` to be modified. + * @param {string} params.studentId The ID of the student whose guardian invitation is to be modified. + * @param {string=} params.updateMask Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `state` When set in a query parameter, this field should be specified as `updateMask=,,...` + * @param {().GuardianInvitation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['studentId', 'invitationId'], + pathParams: ['invitationId', 'studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/userProfiles/{studentId}/guardians') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['studentId'], - pathParams: ['studentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Userprofiles$Guardians { + root: Classroom; + constructor(root: Classroom) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * classroom.userProfiles.guardians.delete + * @desc Deletes a guardian. The guardian will no longer receive guardian + * notifications and the guardian will no longer be accessible via the API. + * This method returns the following error codes: * `PERMISSION_DENIED` if + * no user that matches the provided `student_id` is visible to the + * requesting user, if the requesting user is not permitted to manage + * guardians for the student identified by the `student_id`, if guardians + * are not enabled for the domain in question, or for other access errors. + * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format + * cannot be recognized (it is not an email address, nor a `student_id` + * from the API). * `NOT_FOUND` if the requesting user is permitted to + * modify guardians for the requested `student_id`, but no `Guardian` + * record exists for that student with the provided `guardian_id`. + * @alias classroom.userProfiles.guardians.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.guardianId The `id` field from a `Guardian`. + * @param {string} params.studentId The student whose guardian is to be deleted. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/userProfiles/{studentId}/guardians/{guardianId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['studentId', 'guardianId'], + pathParams: ['guardianId', 'studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.userProfiles.guardians.get + * @desc Returns a specific guardian. This method returns the following + * error codes: * `PERMISSION_DENIED` if no user that matches the provided + * `student_id` is visible to the requesting user, if the requesting user + * is not permitted to view guardian information for the student + * identified by the `student_id`, if guardians are not enabled for the + * domain in question, or for other access errors. * `INVALID_ARGUMENT` if + * a `student_id` is specified, but its format cannot be recognized (it is + * not an email address, nor a `student_id` from the API, nor the literal + * string `me`). * `NOT_FOUND` if the requesting user is permitted to view + * guardians for the requested `student_id`, but no `Guardian` record + * exists for that student that matches the provided `guardian_id`. + * @alias classroom.userProfiles.guardians.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.guardianId The `id` field from a `Guardian`. + * @param {string} params.studentId The student whose guardian is being requested. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/userProfiles/{studentId}/guardians/{guardianId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['studentId', 'guardianId'], + pathParams: ['guardianId', 'studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * classroom.userProfiles.guardians.list + * @desc Returns a list of guardians that the requesting user is permitted + * to view, restricted to those that match the request. To list guardians + * for any student that the requesting user may view guardians for, use the + * literal character `-` for the student ID. This method returns the + * following error codes: * `PERMISSION_DENIED` if a `student_id` is + * specified, and the requesting user is not permitted to view guardian + * information for that student, if `"-"` is specified as the `student_id` + * and the user is not a domain administrator, if guardians are not + * enabled for the domain in question, if the `invited_email_address` + * filter is set by a user who is not a domain administrator, or for other + * access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but + * its format cannot be recognized (it is not an email address, nor a + * `student_id` from the API, nor the literal string `me`). May also be + * returned if an invalid `page_token` is provided. * `NOT_FOUND` if a + * `student_id` is specified, and its format can be recognized, but + * Classroom has no record of that student. + * @alias classroom.userProfiles.guardians.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.invitedEmailAddress Filter results by the email address that the original invitation was sent to, resulting in this guardian link. This filter can only be used by domain administrators. + * @param {integer=} params.pageSize Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + * @param {string=} params.pageToken nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * @param {string} params.studentId Filter results by the student who the guardian is linked to. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user * the string literal `"-"`, indicating that results should be returned for all students that the requesting user has access to view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://classroom.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/userProfiles/{studentId}/guardians') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['studentId'], + pathParams: ['studentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudbilling/v1.ts b/src/apis/cloudbilling/v1.ts index a2295b8978c..4c28881a37d 100644 --- a/src/apis/cloudbilling/v1.ts +++ b/src/apis/cloudbilling/v1.ts @@ -27,1767 +27,1794 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Billing API - * - * Allows developers to manage billing for their Google Cloud Platform projects - * programmatically. - * - * @example - * const google = require('googleapis'); - * const cloudbilling = google.cloudbilling('v1'); - * - * @namespace cloudbilling - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudbilling - */ -export class Cloudbilling { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudbilling_v1 { + /** + * Cloud Billing API + * + * Allows developers to manage billing for their Google Cloud Platform + * projects programmatically. + * + * @example + * const google = require('googleapis'); + * const cloudbilling = google.cloudbilling('v1'); + * + * @namespace cloudbilling + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudbilling + */ + export class Cloudbilling { + _options: GlobalOptions; + google: GoogleApis; + root = this; - billingAccounts: Resource$Billingaccounts; - projects: Resource$Projects; - services: Resource$Services; + billingAccounts: Resource$Billingaccounts; + projects: Resource$Projects; + services: Resource$Services; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.billingAccounts = new Resource$Billingaccounts(this); - this.projects = new Resource$Projects(this); - this.services = new Resource$Services(this); - } + this.billingAccounts = new Resource$Billingaccounts(this); + this.projects = new Resource$Projects(this); + this.services = new Resource$Services(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Represents the aggregation level and interval for pricing of a single SKU. - */ -export interface Schema$AggregationInfo { - /** - * The number of intervals to aggregate over. Example: If aggregation_level is - * "DAILY" and aggregation_count is 14, aggregation will be over 14 - * days. - */ - aggregationCount: number; - aggregationInterval: string; - aggregationLevel: string; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * A billing account in [GCP Console](https://console.cloud.google.com/). You - * can assign a billing account to one or more projects. - */ -export interface Schema$BillingAccount { - /** - * The display name given to the billing account, such as `My Billing - * Account`. This name is displayed in the GCP Console. - */ - displayName: string; - /** - * If this account is a - * [subaccount](https://cloud.google.com/billing/docs/concepts), then this - * will be the resource name of the master billing account that it is being - * resold through. Otherwise this will be empty. > This field is currently - * in > [Beta](https://cloud.google.com/terms/launch-stages). - */ - masterBillingAccount: string; - /** - * The resource name of the billing account. The resource name has the form - * `billingAccounts/{billing_account_id}`. For example, - * `billingAccounts/012345-567890-ABCDEF` would be the resource name for - * billing account `012345-567890-ABCDEF`. - */ - name: string; - /** - * True if the billing account is open, and will therefore be charged for any - * usage on associated projects. False if the billing account is closed, and - * therefore projects associated with it will be unable to use paid services. - */ - open: boolean; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Represents the category hierarchy of a SKU. - */ -export interface Schema$Category { - /** - * The type of product the SKU refers to. Example: "Compute", - * "Storage", "Network", "ApplicationServices" - * etc. - */ - resourceFamily: string; - /** - * A group classification for related SKUs. Example: "RAM", - * "GPU", "Prediction", "Ops", - * "GoogleEgress" etc. - */ - resourceGroup: string; - /** - * The display name of the service this SKU belongs to. - */ - serviceDisplayName: string; - /** - * Represents how the SKU is consumed. Example: "OnDemand", - * "Preemptible", "Commit1Mo", "Commit1Yr" etc. - */ - usageType: string; -} -/** - * Response message for `ListBillingAccounts`. - */ -export interface Schema$ListBillingAccountsResponse { - /** - * A list of billing accounts. - */ - billingAccounts: Schema$BillingAccount[]; - /** - * A token to retrieve the next page of results. To retrieve the next page, - * call `ListBillingAccounts` again with the `page_token` field set to this - * value. This field is empty if there are no more results to retrieve. - */ - nextPageToken: string; -} -/** - * Request message for `ListProjectBillingInfoResponse`. - */ -export interface Schema$ListProjectBillingInfoResponse { - /** - * A token to retrieve the next page of results. To retrieve the next page, - * call `ListProjectBillingInfo` again with the `page_token` field set to this - * value. This field is empty if there are no more results to retrieve. - */ - nextPageToken: string; - /** - * A list of `ProjectBillingInfo` resources representing the projects - * associated with the billing account. - */ - projectBillingInfo: Schema$ProjectBillingInfo[]; -} -/** - * Response message for `ListServices`. - */ -export interface Schema$ListServicesResponse { - /** - * A token to retrieve the next page of results. To retrieve the next page, - * call `ListServices` again with the `page_token` field set to this value. - * This field is empty if there are no more results to retrieve. - */ - nextPageToken: string; - /** - * A list of services. - */ - services: Schema$Service[]; -} -/** - * Response message for `ListSkus`. - */ -export interface Schema$ListSkusResponse { - /** - * A token to retrieve the next page of results. To retrieve the next page, - * call `ListSkus` again with the `page_token` field set to this value. This - * field is empty if there are no more results to retrieve. - */ - nextPageToken: string; /** - * The list of public SKUs of the given service. - */ - skus: Schema$Sku[]; -} -/** - * Represents an amount of money with its currency type. - */ -export interface Schema$Money { - /** - * The 3-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: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Expresses a mathematical pricing formula. For Example:- `usage_unit: GBy` - * `tiered_rates:` `[start_usage_amount: 20, unit_price: $10]` - * `[start_usage_amount: 100, unit_price: $5]` The above expresses a pricing - * formula where the first 20GB is free, the next 80GB is priced at $10 per GB - * followed by $5 per GB for additional usage. - */ -export interface Schema$PricingExpression { - /** - * The base unit for the SKU which is the unit used in usage exports. Example: - * "By" - */ - baseUnit: string; - /** - * Conversion factor for converting from price per usage_unit to price per - * base_unit, and start_usage_amount to start_usage_amount in base_unit. - * unit_price / base_unit_conversion_factor = price per base_unit. - * start_usage_amount * base_unit_conversion_factor = start_usage_amount in - * base_unit. - */ - baseUnitConversionFactor: number; - /** - * The base unit in human readable form. Example: "byte". - */ - baseUnitDescription: string; - /** - * The recommended quantity of units for displaying pricing info. When - * displaying pricing info it is recommended to display: (unit_price * - * display_quantity) per display_quantity usage_unit. This field does not - * affect the pricing formula and is for display purposes only. Example: If - * the unit_price is "0.0001 USD", the usage_unit is "GB" - * and the display_quantity is "1000" then the recommended way of - * displaying the pricing info is "0.10 USD per 1000 GB" - */ - displayQuantity: number; - /** - * The list of tiered rates for this pricing. The total cost is computed by - * applying each of the tiered rates on usage. This repeated list is sorted by - * ascending order of start_usage_amount. - */ - tieredRates: Schema$TierRate[]; - /** - * The short hand for unit of usage this pricing is specified in. Example: - * usage_unit of "GiBy" means that usage is specified in "Gibi - * Byte". - */ - usageUnit: string; - /** - * The unit of usage in human readable form. Example: "gibi byte". - */ - usageUnitDescription: string; -} -/** - * Represents the pricing information for a SKU at a single point of time. - */ -export interface Schema$PricingInfo { - /** - * Aggregation Info. This can be left unspecified if the pricing expression - * doesn't require aggregation. - */ - aggregationInfo: Schema$AggregationInfo; - /** - * Conversion rate used for currency conversion, from USD to the currency - * specified in the request. This includes any surcharge collected for billing - * in non USD currency. If a currency is not specified in the request this - * defaults to 1.0. Example: USD * currency_conversion_rate = JPY - */ - currencyConversionRate: number; - /** - * The timestamp from which this pricing was effective within the requested - * time range. This is guaranteed to be greater than or equal to the - * start_time field in the request and less than the end_time field in the - * request. If a time range was not specified in the request this field will - * be equivalent to a time within the last 12 hours, indicating the latest - * pricing info. - */ - effectiveTime: string; - /** - * Expresses the pricing formula. See `PricingExpression` for an example. - */ - pricingExpression: Schema$PricingExpression; - /** - * An optional human readable summary of the pricing information, has a - * maximum length of 256 characters. - */ - summary: string; -} -/** - * Encapsulation of billing information for a GCP Console project. A project has - * at most one associated billing account at a time (but a billing account can - * be assigned to multiple projects). - */ -export interface Schema$ProjectBillingInfo { - /** - * The resource name of the billing account associated with the project, if - * any. For example, `billingAccounts/012345-567890-ABCDEF`. - */ - billingAccountName: string; + * Represents the aggregation level and interval for pricing of a single SKU. + */ + export interface Schema$AggregationInfo { + /** + * The number of intervals to aggregate over. Example: If aggregation_level + * is "DAILY" and aggregation_count is 14, aggregation will be + * over 14 days. + */ + aggregationCount: number; + aggregationInterval: string; + aggregationLevel: string; + } /** - * True if the project is associated with an open billing account, to which - * usage on the project is charged. False if the project is associated with a - * closed billing account, or no billing account at all, and therefore cannot - * use paid services. This field is read-only. - */ - billingEnabled: boolean; + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * The resource name for the `ProjectBillingInfo`; has the form - * `projects/{project_id}/billingInfo`. For example, the resource name for the - * billing information for project `tokyo-rain-123` would be - * `projects/tokyo-rain-123/billingInfo`. This field is read-only. - */ - name: string; + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * The ID of the project that this `ProjectBillingInfo` represents, such as - * `tokyo-rain-123`. This is a convenience field so that you don't need to - * parse the `name` field to obtain a project ID. This field is read-only. - */ - projectId: string; -} -/** - * Encapsulates a single service in Google Cloud Platform. - */ -export interface Schema$Service { + * A billing account in [GCP Console](https://console.cloud.google.com/). You + * can assign a billing account to one or more projects. + */ + export interface Schema$BillingAccount { + /** + * The display name given to the billing account, such as `My Billing + * Account`. This name is displayed in the GCP Console. + */ + displayName: string; + /** + * If this account is a + * [subaccount](https://cloud.google.com/billing/docs/concepts), then this + * will be the resource name of the master billing account that it is being + * resold through. Otherwise this will be empty. > This field is + * currently in > [Beta](https://cloud.google.com/terms/launch-stages). + */ + masterBillingAccount: string; + /** + * The resource name of the billing account. The resource name has the form + * `billingAccounts/{billing_account_id}`. For example, + * `billingAccounts/012345-567890-ABCDEF` would be the resource name for + * billing account `012345-567890-ABCDEF`. + */ + name: string; + /** + * True if the billing account is open, and will therefore be charged for + * any usage on associated projects. False if the billing account is closed, + * and therefore projects associated with it will be unable to use paid + * services. + */ + open: boolean; + } /** - * A human readable display name for this service. - */ - displayName: string; + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * The resource name for the service. Example: - * "services/DA34-426B-A397" - */ - name: string; + * Represents the category hierarchy of a SKU. + */ + export interface Schema$Category { + /** + * The type of product the SKU refers to. Example: "Compute", + * "Storage", "Network", "ApplicationServices" + * etc. + */ + resourceFamily: string; + /** + * A group classification for related SKUs. Example: "RAM", + * "GPU", "Prediction", "Ops", + * "GoogleEgress" etc. + */ + resourceGroup: string; + /** + * The display name of the service this SKU belongs to. + */ + serviceDisplayName: string; + /** + * Represents how the SKU is consumed. Example: "OnDemand", + * "Preemptible", "Commit1Mo", "Commit1Yr" + * etc. + */ + usageType: string; + } /** - * The identifier for the service. Example: "DA34-426B-A397" - */ - serviceId: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + * Response message for `ListBillingAccounts`. + */ + export interface Schema$ListBillingAccountsResponse { + /** + * A list of billing accounts. + */ + billingAccounts: Schema$BillingAccount[]; + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListBillingAccounts` again with the `page_token` field set to this + * value. This field is empty if there are no more results to retrieve. + */ + nextPageToken: string; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; + * Request message for `ListProjectBillingInfoResponse`. + */ + export interface Schema$ListProjectBillingInfoResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListProjectBillingInfo` again with the `page_token` field set to + * this value. This field is empty if there are no more results to retrieve. + */ + nextPageToken: string; + /** + * A list of `ProjectBillingInfo` resources representing the projects + * associated with the billing account. + */ + projectBillingInfo: Schema$ProjectBillingInfo[]; + } /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * Encapsulates a single SKU in Google Cloud Platform - */ -export interface Schema$Sku { + * Response message for `ListServices`. + */ + export interface Schema$ListServicesResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListServices` again with the `page_token` field set to this value. + * This field is empty if there are no more results to retrieve. + */ + nextPageToken: string; + /** + * A list of services. + */ + services: Schema$Service[]; + } /** - * The category hierarchy of this SKU, purely for organizational purpose. - */ - category: Schema$Category; + * Response message for `ListSkus`. + */ + export interface Schema$ListSkusResponse { + /** + * A token to retrieve the next page of results. To retrieve the next page, + * call `ListSkus` again with the `page_token` field set to this value. This + * field is empty if there are no more results to retrieve. + */ + nextPageToken: string; + /** + * The list of public SKUs of the given service. + */ + skus: Schema$Sku[]; + } /** - * A human readable description of the SKU, has a maximum length of 256 - * characters. - */ - description: string; + * Represents an amount of money with its currency type. + */ + export interface Schema$Money { + /** + * The 3-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: string; + } /** - * The resource name for the SKU. Example: - * "services/DA34-426B-A397/skus/AA95-CD31-42FE" - */ - name: string; + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * A timeline of pricing info for this SKU in chronological order. - */ - pricingInfo: Schema$PricingInfo[]; + * Expresses a mathematical pricing formula. For Example:- `usage_unit: GBy` + * `tiered_rates:` `[start_usage_amount: 20, unit_price: $10]` + * `[start_usage_amount: 100, unit_price: $5]` The above expresses a pricing + * formula where the first 20GB is free, the next 80GB is priced at $10 per GB + * followed by $5 per GB for additional usage. + */ + export interface Schema$PricingExpression { + /** + * The base unit for the SKU which is the unit used in usage exports. + * Example: "By" + */ + baseUnit: string; + /** + * Conversion factor for converting from price per usage_unit to price per + * base_unit, and start_usage_amount to start_usage_amount in base_unit. + * unit_price / base_unit_conversion_factor = price per base_unit. + * start_usage_amount * base_unit_conversion_factor = start_usage_amount in + * base_unit. + */ + baseUnitConversionFactor: number; + /** + * The base unit in human readable form. Example: "byte". + */ + baseUnitDescription: string; + /** + * The recommended quantity of units for displaying pricing info. When + * displaying pricing info it is recommended to display: (unit_price * + * display_quantity) per display_quantity usage_unit. This field does not + * affect the pricing formula and is for display purposes only. Example: If + * the unit_price is "0.0001 USD", the usage_unit is + * "GB" and the display_quantity is "1000" then the + * recommended way of displaying the pricing info is "0.10 USD per 1000 + * GB" + */ + displayQuantity: number; + /** + * The list of tiered rates for this pricing. The total cost is computed by + * applying each of the tiered rates on usage. This repeated list is sorted + * by ascending order of start_usage_amount. + */ + tieredRates: Schema$TierRate[]; + /** + * The short hand for unit of usage this pricing is specified in. Example: + * usage_unit of "GiBy" means that usage is specified in + * "Gibi Byte". + */ + usageUnit: string; + /** + * The unit of usage in human readable form. Example: "gibi byte". + */ + usageUnitDescription: string; + } /** - * Identifies the service provider. This is 'Google' for first party - * services in Google Cloud Platform. - */ - serviceProviderName: string; + * Represents the pricing information for a SKU at a single point of time. + */ + export interface Schema$PricingInfo { + /** + * Aggregation Info. This can be left unspecified if the pricing expression + * doesn't require aggregation. + */ + aggregationInfo: Schema$AggregationInfo; + /** + * Conversion rate used for currency conversion, from USD to the currency + * specified in the request. This includes any surcharge collected for + * billing in non USD currency. If a currency is not specified in the + * request this defaults to 1.0. Example: USD * currency_conversion_rate = + * JPY + */ + currencyConversionRate: number; + /** + * The timestamp from which this pricing was effective within the requested + * time range. This is guaranteed to be greater than or equal to the + * start_time field in the request and less than the end_time field in the + * request. If a time range was not specified in the request this field will + * be equivalent to a time within the last 12 hours, indicating the latest + * pricing info. + */ + effectiveTime: string; + /** + * Expresses the pricing formula. See `PricingExpression` for an example. + */ + pricingExpression: Schema$PricingExpression; + /** + * An optional human readable summary of the pricing information, has a + * maximum length of 256 characters. + */ + summary: string; + } /** - * List of service regions this SKU is offered at. Example: - * "asia-east1" Service regions can be found at - * https://cloud.google.com/about/locations/ - */ - serviceRegions: string[]; + * Encapsulation of billing information for a GCP Console project. A project + * has at most one associated billing account at a time (but a billing account + * can be assigned to multiple projects). + */ + export interface Schema$ProjectBillingInfo { + /** + * The resource name of the billing account associated with the project, if + * any. For example, `billingAccounts/012345-567890-ABCDEF`. + */ + billingAccountName: string; + /** + * True if the project is associated with an open billing account, to which + * usage on the project is charged. False if the project is associated with + * a closed billing account, or no billing account at all, and therefore + * cannot use paid services. This field is read-only. + */ + billingEnabled: boolean; + /** + * The resource name for the `ProjectBillingInfo`; has the form + * `projects/{project_id}/billingInfo`. For example, the resource name for + * the billing information for project `tokyo-rain-123` would be + * `projects/tokyo-rain-123/billingInfo`. This field is read-only. + */ + name: string; + /** + * The ID of the project that this `ProjectBillingInfo` represents, such as + * `tokyo-rain-123`. This is a convenience field so that you don't need + * to parse the `name` field to obtain a project ID. This field is + * read-only. + */ + projectId: string; + } /** - * The identifier for the SKU. Example: "AA95-CD31-42FE" - */ - skuId: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + * Encapsulates a single service in Google Cloud Platform. + */ + export interface Schema$Service { + /** + * A human readable display name for this service. + */ + displayName: string; + /** + * The resource name for the service. Example: + * "services/DA34-426B-A397" + */ + name: string; + /** + * The identifier for the service. Example: "DA34-426B-A397" + */ + serviceId: string; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * The price rate indicating starting usage and its corresponding price. - */ -export interface Schema$TierRate { + * Encapsulates a single SKU in Google Cloud Platform + */ + export interface Schema$Sku { + /** + * The category hierarchy of this SKU, purely for organizational purpose. + */ + category: Schema$Category; + /** + * A human readable description of the SKU, has a maximum length of 256 + * characters. + */ + description: string; + /** + * The resource name for the SKU. Example: + * "services/DA34-426B-A397/skus/AA95-CD31-42FE" + */ + name: string; + /** + * A timeline of pricing info for this SKU in chronological order. + */ + pricingInfo: Schema$PricingInfo[]; + /** + * Identifies the service provider. This is 'Google' for first party + * services in Google Cloud Platform. + */ + serviceProviderName: string; + /** + * List of service regions this SKU is offered at. Example: + * "asia-east1" Service regions can be found at + * https://cloud.google.com/about/locations/ + */ + serviceRegions: string[]; + /** + * The identifier for the SKU. Example: "AA95-CD31-42FE" + */ + skuId: string; + } /** - * Usage is priced at this rate only after this amount. Example: - * start_usage_amount of 10 indicates that the usage will be priced at the - * unit_price after the first 10 usage_units. + * Request message for `TestIamPermissions` method. */ - startUsageAmount: number; + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The price per unit of usage. Example: unit_price of amount $10 indicates - * that each unit will cost $10. + * Response message for `TestIamPermissions` method. */ - unitPrice: Schema$Money; -} - -export class Resource$Billingaccounts { - root: Cloudbilling; - projects: Resource$Billingaccounts$Projects; - constructor(root: Cloudbilling) { - this.root = root; - this.getRoot.bind(this); - this.projects = new Resource$Billingaccounts$Projects(root); + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - getRoot() { - return this.root; + /** + * The price rate indicating starting usage and its corresponding price. + */ + export interface Schema$TierRate { + /** + * Usage is priced at this rate only after this amount. Example: + * start_usage_amount of 10 indicates that the usage will be priced at the + * unit_price after the first 10 usage_units. + */ + startUsageAmount: number; + /** + * The price per unit of usage. Example: unit_price of amount $10 indicates + * that each unit will cost $10. + */ + unitPrice: Schema$Money; } - - /** - * cloudbilling.billingAccounts.create - * @desc Creates a billing account. This method can only be used to create - * [billing subaccounts](https://cloud.google.com/billing/docs/concepts) for - * GCP resellers. When creating a subaccount, the current authenticated user - * must have the `billing.accounts.update` IAM permission on the master - * account, which is typically given to billing account - * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). - * > This method is currently in > - * [Beta](https://cloud.google.com/terms/launch-stages). - * @alias cloudbilling.billingAccounts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BillingAccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Billingaccounts { + root: Cloudbilling; + projects: Resource$Billingaccounts$Projects; + constructor(root: Cloudbilling) { + this.root = root; + this.getRoot.bind(this); + this.projects = new Resource$Billingaccounts$Projects(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/billingAccounts').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudbilling.billingAccounts.get - * @desc Gets information about a billing account. The current authenticated - * user must be a [viewer of the billing - * account](https://cloud.google.com/billing/docs/how-to/billing-access). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the billing account to retrieve. For example, - * // `billingAccounts/012345-567890-ABCDEF`. - * name: 'billingAccounts/my-billing-account', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * cloudbilling.billingAccounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.billingAccounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbilling.billingAccounts.create + * @desc Creates a billing account. This method can only be used to create + * [billing subaccounts](https://cloud.google.com/billing/docs/concepts) for + * GCP resellers. When creating a subaccount, the current authenticated user + * must have the `billing.accounts.update` IAM permission on the master + * account, which is typically given to billing account + * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). + * > This method is currently in > + * [Beta](https://cloud.google.com/terms/launch-stages). + * @alias cloudbilling.billingAccounts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BillingAccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/billingAccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudbilling.billingAccounts.getIamPolicy - * @desc Gets the access control policy for a billing account. The caller must - * have the `billing.accounts.getIamPolicy` permission on the account, which - * is often given to billing account - * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). > - * This method is currently in > - * [Beta](https://cloud.google.com/terms/launch-stages). - * @alias cloudbilling.billingAccounts.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbilling.billingAccounts.get + * @desc Gets information about a billing account. The current authenticated + * user must be a [viewer of the billing + * account](https://cloud.google.com/billing/docs/how-to/billing-access). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the billing account to retrieve. For example, + * // `billingAccounts/012345-567890-ABCDEF`. + * name: 'billingAccounts/my-billing-account', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * cloudbilling.billingAccounts.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.billingAccounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudbilling.billingAccounts.list - * @desc Lists the billing accounts that the current authenticated user has - * permission to - * [view](https://cloud.google.com/billing/docs/how-to/billing-access). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var billingAccountsPage = response['billingAccounts']; - * if (!billingAccountsPage) { - * return; - * } - * for (var i = 0; i < billingAccountsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `billingAccountsPage`: console.log(JSON.stringify(billingAccountsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.billingAccounts.list(request, handlePage); - * } - * }; - * - * cloudbilling.billingAccounts.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.billingAccounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Options for how to filter the returned billing accounts. Currently this only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided reseller billing account. (e.g. "master_billing_account=billingAccounts/012345-678901-ABCDEF"). Boolean algebra and other fields are not currently supported. > This field is currently in > [Beta](https://cloud.google.com/terms/launch-stages). - * @param {integer=} params.pageSize Requested page size. The maximum page size is 100; this is also the default. - * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbilling.billingAccounts.getIamPolicy + * @desc Gets the access control policy for a billing account. The caller + * must have the `billing.accounts.getIamPolicy` permission on the account, + * which is often given to billing account + * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). + * > This method is currently in > + * [Beta](https://cloud.google.com/terms/launch-stages). + * @alias cloudbilling.billingAccounts.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/billingAccounts').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbilling.billingAccounts.patch - * @desc Updates a billing account's fields. Currently the only field that can - * be edited is `display_name`. The current authenticated user must have the - * `billing.accounts.update` IAM permission, which is typically given to the - * [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) - * of the billing account. > This method is currently in > - * [Beta](https://cloud.google.com/terms/launch-stages). - * @alias cloudbilling.billingAccounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the billing account resource to be updated. - * @param {string=} params.updateMask The update mask applied to the resource. Only "display_name" is currently supported. - * @param {().BillingAccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbilling.billingAccounts.list + * @desc Lists the billing accounts that the current authenticated user has + * permission to + * [view](https://cloud.google.com/billing/docs/how-to/billing-access). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var billingAccountsPage = response['billingAccounts']; + * if (!billingAccountsPage) { + * return; + * } + * for (var i = 0; i < billingAccountsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `billingAccountsPage`: console.log(JSON.stringify(billingAccountsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudbilling.billingAccounts.list(request, handlePage); + * } + * }; + * + * cloudbilling.billingAccounts.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.billingAccounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Options for how to filter the returned billing accounts. Currently this only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided reseller billing account. (e.g. "master_billing_account=billingAccounts/012345-678901-ABCDEF"). Boolean algebra and other fields are not currently supported. > This field is currently in > [Beta](https://cloud.google.com/terms/launch-stages). + * @param {integer=} params.pageSize Requested page size. The maximum page size is 100; this is also the default. + * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/billingAccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbilling.billingAccounts.setIamPolicy - * @desc Sets the access control policy for a billing account. Replaces any - * existing policy. The caller must have the `billing.accounts.setIamPolicy` - * permission on the account, which is often given to billing account - * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). - * > This method is currently in > - * [Beta](https://cloud.google.com/terms/launch-stages). - * @alias cloudbilling.billingAccounts.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudbilling.billingAccounts.patch + * @desc Updates a billing account's fields. Currently the only field that + * can be edited is `display_name`. The current authenticated user must have + * the `billing.accounts.update` IAM permission, which is typically given to + * the + * [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) + * of the billing account. > This method is currently in > + * [Beta](https://cloud.google.com/terms/launch-stages). + * @alias cloudbilling.billingAccounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the billing account resource to be updated. + * @param {string=} params.updateMask The update mask applied to the resource. Only "display_name" is currently supported. + * @param {().BillingAccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbilling.billingAccounts.testIamPermissions - * @desc Tests the access control policy for a billing account. This method - * takes the resource and a set of permissions as input and returns the subset - * of the input permissions that the caller is allowed for that resource. > - * This method is currently in > - * [Beta](https://cloud.google.com/terms/launch-stages). - * @alias cloudbilling.billingAccounts.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbilling.billingAccounts.setIamPolicy + * @desc Sets the access control policy for a billing account. Replaces any + * existing policy. The caller must have the `billing.accounts.setIamPolicy` + * permission on the account, which is often given to billing account + * [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). + * > This method is currently in > + * [Beta](https://cloud.google.com/terms/launch-stages). + * @alias cloudbilling.billingAccounts.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Billingaccounts$Projects { - root: Cloudbilling; - constructor(root: Cloudbilling) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * cloudbilling.billingAccounts.projects.list - * @desc Lists the projects associated with a billing account. The current - * authenticated user must have the `billing.resourceAssociations.list` IAM - * permission, which is often given to billing account - * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the billing account associated with the - * projects that - * // you want to list. For example, - * `billingAccounts/012345-567890-ABCDEF`. name: - * 'billingAccounts/my-billing-account', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectBillingInfoPage = response['projectBillingInfo']; - * if (!projectBillingInfoPage) { - * return; - * } - * for (var i = 0; i < projectBillingInfoPage.length; i++) { - * // TODO: Change code below to process each resource in - * `projectBillingInfoPage`: - * console.log(JSON.stringify(projectBillingInfoPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.billingAccounts.projects.list(request, handlePage); - * } - * }; - * - * cloudbilling.billingAccounts.projects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.billingAccounts.projects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. - * @param {integer=} params.pageSize Requested page size. The maximum page size is 100; this is also the default. - * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/projects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * cloudbilling.billingAccounts.testIamPermissions + * @desc Tests the access control policy for a billing account. This method + * takes the resource and a set of permissions as input and returns the + * subset of the input permissions that the caller is allowed for that + * resource. > This method is currently in > + * [Beta](https://cloud.google.com/terms/launch-stages). + * @alias cloudbilling.billingAccounts.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Billingaccounts$Projects { + root: Cloudbilling; + constructor(root: Cloudbilling) { + this.root = root; + this.getRoot.bind(this); + } + getRoot() { + return this.root; + } -export class Resource$Projects { - root: Cloudbilling; - constructor(root: Cloudbilling) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * cloudbilling.billingAccounts.projects.list + * @desc Lists the projects associated with a billing account. The current + * authenticated user must have the `billing.resourceAssociations.list` IAM + * permission, which is often given to billing account + * [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the billing account associated with the + * projects that + * // you want to list. For example, + * `billingAccounts/012345-567890-ABCDEF`. name: + * 'billingAccounts/my-billing-account', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var projectBillingInfoPage = response['projectBillingInfo']; + * if (!projectBillingInfoPage) { + * return; + * } + * for (var i = 0; i < projectBillingInfoPage.length; i++) { + * // TODO: Change code below to process each resource in + * `projectBillingInfoPage`: + * console.log(JSON.stringify(projectBillingInfoPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudbilling.billingAccounts.projects.list(request, handlePage); + * } + * }; + * + * cloudbilling.billingAccounts.projects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.billingAccounts.projects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + * @param {integer=} params.pageSize Requested page size. The maximum page size is 100; this is also the default. + * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/projects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - /** - * cloudbilling.projects.getBillingInfo - * @desc Gets the billing information for a project. The current authenticated - * user must have [permission to view the - * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo - * ). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the project for which billing information is - * // retrieved. For example, `projects/tokyo-rain-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudbilling.projects.getBillingInfo(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.projects.getBillingInfo - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getBillingInfo(params?: any, options?: MethodOptions): - AxiosPromise; - getBillingInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getBillingInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Cloudbilling; + constructor(root: Cloudbilling) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/billingInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudbilling.projects.updateBillingInfo - * @desc Sets or updates the billing account associated with a project. You - * specify the new billing account by setting the `billing_account_name` in - * the `ProjectBillingInfo` resource to the resource name of a billing - * account. Associating a project with an open billing account enables billing - * on the project and allows charges for resource usage. If the project - * already had a billing account, this method changes the billing account used - * for resource usage charges. *Note:* Incurred charges that have not yet - * been reported in the transaction history of the GCP Console might be billed - * to the new billing account, even if the charge occurred before the new - * billing account was assigned to the project. The current authenticated - * user must have ownership privileges for both the - * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo - * ) and the [billing - * account](https://cloud.google.com/billing/docs/how-to/billing-access). You - * can disable billing on the project by setting the `billing_account_name` - * field to empty. This action disassociates the current billing account from - * the project. Any billable activity of your in-use services will stop, and - * your application could stop functioning as expected. Any unbilled charges - * to date will be billed to the previously associated account. The current - * authenticated user must be either an owner of the project or an owner of - * the billing account for the project. Note that associating a project with - * a *closed* billing account will have much the same effect as disabling - * billing on the project: any paid resources used by the project will be shut - * down. Thus, unless you wish to disable billing, you should always call this - * method with the name of an *open* billing account. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the project associated with the billing - * information - * // that you want to update. For example, `projects/tokyo-rain-123`. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudbilling.projects.updateBillingInfo(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.projects.updateBillingInfo - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`. - * @param {().ProjectBillingInfo} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateBillingInfo(params?: any, options?: MethodOptions): - AxiosPromise; - updateBillingInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateBillingInfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudbilling.projects.getBillingInfo + * @desc Gets the billing information for a project. The current + * authenticated user must have [permission to view the + * project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the project for which billing information is + * // retrieved. For example, `projects/tokyo-rain-123`. + * name: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudbilling.projects.getBillingInfo(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.projects.getBillingInfo + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getBillingInfo(params?: any, options?: MethodOptions): + AxiosPromise; + getBillingInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getBillingInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/billingInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/billingInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Services { - root: Cloudbilling; - skus: Resource$Services$Skus; - constructor(root: Cloudbilling) { - this.root = root; - this.getRoot.bind(this); - this.skus = new Resource$Services$Skus(root); - } - getRoot() { - return this.root; + /** + * cloudbilling.projects.updateBillingInfo + * @desc Sets or updates the billing account associated with a project. You + * specify the new billing account by setting the `billing_account_name` in + * the `ProjectBillingInfo` resource to the resource name of a billing + * account. Associating a project with an open billing account enables + * billing on the project and allows charges for resource usage. If the + * project already had a billing account, this method changes the billing + * account used for resource usage charges. *Note:* Incurred charges that + * have not yet been reported in the transaction history of the GCP Console + * might be billed to the new billing account, even if the charge occurred + * before the new billing account was assigned to the project. The current + * authenticated user must have ownership privileges for both the + * [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + * ) and the [billing + * account](https://cloud.google.com/billing/docs/how-to/billing-access). + * You can disable billing on the project by setting the + * `billing_account_name` field to empty. This action disassociates the + * current billing account from the project. Any billable activity of your + * in-use services will stop, and your application could stop functioning as + * expected. Any unbilled charges to date will be billed to the previously + * associated account. The current authenticated user must be either an + * owner of the project or an owner of the billing account for the project. + * Note that associating a project with a *closed* billing account will have + * much the same effect as disabling billing on the project: any paid + * resources used by the project will be shut down. Thus, unless you wish to + * disable billing, you should always call this method with the name of an + * *open* billing account. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the project associated with the billing + * information + * // that you want to update. For example, `projects/tokyo-rain-123`. + * name: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * cloudbilling.projects.updateBillingInfo(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.projects.updateBillingInfo + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`. + * @param {().ProjectBillingInfo} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateBillingInfo(params?: any, options?: MethodOptions): + AxiosPromise; + updateBillingInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateBillingInfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/billingInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * cloudbilling.services.list - * @desc Lists all public cloud services. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var servicesPage = response['services']; - * if (!servicesPage) { - * return; - * } - * for (var i = 0; i < servicesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `servicesPage`: console.log(JSON.stringify(servicesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.services.list(request, handlePage); - * } - * }; - * - * cloudbilling.services.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested page size. Defaults to 5000. - * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListServices` call. If unspecified, the first page of results is returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Services { + root: Cloudbilling; + skus: Resource$Services$Skus; + constructor(root: Cloudbilling) { + this.root = root; + this.getRoot.bind(this); + this.skus = new Resource$Services$Skus(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudbilling.services.list + * @desc Lists all public cloud services. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var servicesPage = response['services']; + * if (!servicesPage) { + * return; + * } + * for (var i = 0; i < servicesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `servicesPage`: console.log(JSON.stringify(servicesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudbilling.services.list(request, handlePage); + * } + * }; + * + * cloudbilling.services.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested page size. Defaults to 5000. + * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListServices` call. If unspecified, the first page of results is returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Services$Skus { - root: Cloudbilling; - constructor(root: Cloudbilling) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Services$Skus { + root: Cloudbilling; + constructor(root: Cloudbilling) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudbilling.services.skus.list - * @desc Lists all publicly available SKUs for a given cloud service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Billing API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudbilling - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudbilling = google.cloudbilling('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the service. - * // Example: "services/DA34-426B-A397" - * parent: 'services/my-service', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var skusPage = response['skus']; - * if (!skusPage) { - * return; - * } - * for (var i = 0; i < skusPage.length; i++) { - * // TODO: Change code below to process each resource in `skusPage`: - * console.log(JSON.stringify(skusPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudbilling.services.skus.list(request, handlePage); - * } - * }; - * - * cloudbilling.services.skus.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudbilling.services.skus.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currencyCode The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time. Optional. If not specified USD will be used. - * @param {string=} params.endTime Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most). - * @param {integer=} params.pageSize Requested page size. Defaults to 5000. - * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListSkus` call. If unspecified, the first page of results is returned. - * @param {string} params.parent The name of the service. Example: "services/DA34-426B-A397" - * @param {string=} params.startTime Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/skus').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbilling.services.skus.list + * @desc Lists all publicly available SKUs for a given cloud service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Billing API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudbilling + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudbilling = google.cloudbilling('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the service. + * // Example: "services/DA34-426B-A397" + * parent: 'services/my-service', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var skusPage = response['skus']; + * if (!skusPage) { + * return; + * } + * for (var i = 0; i < skusPage.length; i++) { + * // TODO: Change code below to process each resource in `skusPage`: + * console.log(JSON.stringify(skusPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudbilling.services.skus.list(request, handlePage); + * } + * }; + * + * cloudbilling.services.skus.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudbilling.services.skus.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currencyCode The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time. Optional. If not specified USD will be used. + * @param {string=} params.endTime Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most). + * @param {integer=} params.pageSize Requested page size. Defaults to 5000. + * @param {string=} params.pageToken A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListSkus` call. If unspecified, the first page of results is returned. + * @param {string} params.parent The name of the service. Example: "services/DA34-426B-A397" + * @param {string=} params.startTime Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. The time range has to be within a single calendar month in America/Los_Angeles timezone. Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbilling.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/skus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudbuild/v1.ts b/src/apis/cloudbuild/v1.ts index 0bc0c9e8fd6..a781f229600 100644 --- a/src/apis/cloudbuild/v1.ts +++ b/src/apis/cloudbuild/v1.ts @@ -27,1595 +27,1624 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Container Builder API - * - * Builds container images in the cloud. - * - * @example - * const google = require('googleapis'); - * const cloudbuild = google.cloudbuild('v1'); - * - * @namespace cloudbuild - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudbuild - */ -export class Cloudbuild { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudbuild_v1 { + /** + * Cloud Container Builder API + * + * Builds container images in the cloud. + * + * @example + * const google = require('googleapis'); + * const cloudbuild = google.cloudbuild('v1'); + * + * @namespace cloudbuild + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudbuild + */ + export class Cloudbuild { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - projects: Resource$Projects; + operations: Resource$Operations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.projects = new Resource$Projects(this); - } + this.operations = new Resource$Operations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Files in the workspace to upload to Cloud Storage upon successful completion - * of all build steps. - */ -export interface Schema$ArtifactObjects { - /** - * Cloud Storage bucket and optional object path, in the form - * "gs://bucket/path/to/somewhere/". (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Files in the workspace matching any path pattern will be uploaded to Cloud - * Storage with this location as a prefix. - */ - location: string; - /** - * Path globs used to match files in the build's workspace. - */ - paths: string[]; - /** - * Stores timing information for pushing all artifact objects. @OutputOnly - */ - timing: Schema$TimeSpan; -} -/** - * An artifact that was uploaded during a build. This is a single record in the - * artifact manifest JSON file. - */ -export interface Schema$ArtifactResult { /** - * The file hash of the artifact. - */ - fileHash: Schema$FileHashes[]; - /** - * The path of an artifact in a Google Cloud Storage bucket, with the - * generation number. For example, - * `gs://mybucket/path/to/output.jar#generation`. - */ - location: string; -} -/** - * Artifacts produced by a build that should be uploaded upon successful - * completion of all build steps. - */ -export interface Schema$Artifacts { - /** - * A list of images to be pushed upon the successful completion of all build - * steps. The images will be pushed using the builder service account's - * credentials. The digests of the pushed images will be stored in the Build - * resource's results field. If any of the images fail to be pushed, the - * build is marked FAILURE. - */ - images: string[]; - /** - * A list of objects to be uploaded to Cloud Storage upon successful - * completion of all build steps. Files in the workspace matching specified - * paths globs will be uploaded to the specified Cloud Storage location using - * the builder service account's credentials. The location and generation - * of the uploaded objects will be stored in the Build resource's results - * field. If any objects fail to be pushed, the build is marked FAILURE. - */ - objects: Schema$ArtifactObjects; -} -/** - * A build resource in the Container Builder API. At a high level, a `Build` - * describes where to find source code, how to build it (for example, the - * builder image to run on the source), and where to store the built artifacts. - * Fields can include the following variables, which will be expanded when the - * build is created: - $PROJECT_ID: the project ID of the build. - $BUILD_ID: - * the autogenerated ID of the build. - $REPO_NAME: the source repository name - * specified by RepoSource. - $BRANCH_NAME: the branch name specified by - * RepoSource. - $TAG_NAME: the tag name specified by RepoSource. - $REVISION_ID - * or $COMMIT_SHA: the commit SHA specified by RepoSource or resolved from the - * specified branch or tag. - $SHORT_SHA: first 7 characters of $REVISION_ID or - * $COMMIT_SHA. - */ -export interface Schema$Build { - /** - * Artifacts produced by the build that should be uploaded upon successful + * Files in the workspace to upload to Cloud Storage upon successful * completion of all build steps. */ - artifacts: Schema$Artifacts; - /** - * The ID of the `BuildTrigger` that triggered this build, if it was triggered - * automatically. @OutputOnly - */ - buildTriggerId: string; - /** - * Time at which the request to create the build was received. @OutputOnly - */ - createTime: string; - /** - * Time at which execution of the build was finished. The difference between - * finish_time and start_time is the duration of the build's execution. - * @OutputOnly - */ - finishTime: string; - /** - * Unique identifier of the build. @OutputOnly - */ - id: string; - /** - * A list of images to be pushed upon the successful completion of all build - * steps. The images are pushed using the builder service account's - * credentials. The digests of the pushed images will be stored in the - * `Build` resource's results field. If any of the images fail to be - * pushed, the build status is marked `FAILURE`. - */ - images: string[]; - /** - * Google Cloud Storage bucket where logs should be written (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`. - */ - logsBucket: string; - /** - * URL to logs for this build in Google Cloud Console. @OutputOnly - */ - logUrl: string; - /** - * Special options for this build. - */ - options: Schema$BuildOptions; - /** - * ID of the project. @OutputOnly. - */ - projectId: string; - /** - * Results of the build. @OutputOnly - */ - results: Schema$Results; - /** - * Secrets to decrypt using Cloud Key Management Service. - */ - secrets: Schema$Secret[]; - /** - * The location of the source files to build. - */ - source: Schema$Source; - /** - * A permanent fixed identifier for source. @OutputOnly - */ - sourceProvenance: Schema$SourceProvenance; - /** - * Time at which execution of the build was started. @OutputOnly - */ - startTime: string; - /** - * Status of the build. @OutputOnly - */ - status: string; - /** - * Customer-readable message about the current status. @OutputOnly - */ - statusDetail: string; - /** - * Required. The operations to be performed on the workspace. - */ - steps: Schema$BuildStep[]; - /** - * Substitutions data for `Build` resource. - */ - substitutions: any; - /** - * Tags for annotation of a `Build`. These are not docker tags. - */ - tags: string[]; - /** - * Amount of time that this build should be allowed to run, to second - * granularity. If this amount of time elapses, work on the build will cease - * and the build status will be `TIMEOUT`. Default time is ten minutes. - */ - timeout: string; - /** - * Stores timing information for phases of the build. Valid keys are: * - * BUILD: time to execute all build steps * PUSH: time to push all specified - * images. * FETCHSOURCE: time to fetch source. If the build does not specify - * source or images, these keys will not be included. @OutputOnly - */ - timing: any; -} -/** - * Metadata for build operations. - */ -export interface Schema$BuildOperationMetadata { - /** - * The build that the operation is tracking. - */ - build: Schema$Build; -} -/** - * Optional arguments to enable specific features of builds. - */ -export interface Schema$BuildOptions { - /** - * Requested disk size for the VM that runs the build. Note that this is *NOT* - * "disk free"; some of the space will be used by the operating - * system and build utilities. Also note that this is the minimum disk size - * that will be allocated for the build -- the build may run with a larger - * disk than requested. At present, the maximum disk size is 1000GB; builds - * that request more than the maximum are rejected with an error. - */ - diskSizeGb: string; - /** - * Option to define build log streaming behavior to Google Cloud Storage. - */ - logStreamingOption: string; - /** - * Compute Engine machine type on which to run the build. - */ - machineType: string; - /** - * Requested verifiability options. - */ - requestedVerifyOption: string; - /** - * Requested hash for SourceProvenance. - */ - sourceProvenanceHash: string[]; - /** - * Option to specify behavior when there is an error in the substitution - * checks. - */ - substitutionOption: string; -} -/** - * A step in the build pipeline. - */ -export interface Schema$BuildStep { - /** - * A list of arguments that will be presented to the step when it is started. - * If the image used to run the step's container has an entrypoint, the - * `args` are used as arguments to that entrypoint. If the image does not - * define an entrypoint, the first element in args is used as the entrypoint, - * and the remainder will be used as arguments. - */ - args: string[]; - /** - * Working directory to use when running this step's container. If this - * value is a relative path, it is relative to the build's working - * directory. If this value is absolute, it may be outside the build's - * working directory, in which case the contents of the path may not be - * persisted across build step executions, unless a `volume` for that path is - * specified. If the build specifies a `RepoSource` with `dir` and a step - * with a `dir`, which specifies an absolute path, the `RepoSource` `dir` is - * ignored for the step's execution. - */ - dir: string; - /** - * Entrypoint to be used instead of the build step image's default - * entrypoint. If unset, the image's default entrypoint is used. - */ - entrypoint: string; - /** - * A list of environment variable definitions to be used when running a step. - * The elements are of the form "KEY=VALUE" for the environment - * variable "KEY" being given the value "VALUE". - */ - env: string[]; - /** - * Unique identifier for this build step, used in `wait_for` to reference this - * build step as a dependency. - */ - id: string; - /** - * Required. The name of the container image that will run this particular - * build step. If the image is available in the host's Docker - * daemon's cache, it will be run directly. If not, the host will attempt - * to pull the image first, using the builder service account's - * credentials if necessary. The Docker daemon's cache will already have - * the latest versions of all of the officially supported build steps - * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). - * The Docker daemon will also have cached many of the layers for some popular - * images, like "ubuntu", "debian", but they will be - * refreshed at the time you attempt to use them. If you built an image in a - * previous build step, it will be stored in the host's Docker - * daemon's cache and is available to use as the name for a later build - * step. - */ - name: string; - /** - * A list of environment variables which are encrypted using a Cloud Key - * Management Service crypto key. These values must be specified in the - * build's `Secret`. - */ - secretEnv: string[]; - /** - * Status of the build step. At this time, build step status is only updated - * on build completion; step status is not updated in real-time as the build - * progresses. @OutputOnly - */ - status: string; - /** - * Time limit for executing this build step. If not defined, the step has no - * time limit and will be allowed to continue to run until either it completes - * or the build itself times out. - */ - timeout: string; - /** - * Stores timing information for executing this build step. @OutputOnly - */ - timing: Schema$TimeSpan; - /** - * List of volumes to mount into the build step. Each volume will be created - * as an empty volume prior to execution of the build step. Upon completion of - * the build, volumes and their contents will be discarded. Using a named - * volume in only one step is not valid as it is indicative of a - * mis-configured build request. - */ - volumes: Schema$Volume[]; - /** - * The ID(s) of the step(s) that this build step depends on. This build step - * will not start until all the build steps in `wait_for` have completed - * successfully. If `wait_for` is empty, this build step will start when all - * previous build steps in the `Build.Steps` list have completed successfully. - */ - waitFor: string[]; -} -/** - * Configuration for an automated build in response to source repository - * changes. - */ -export interface Schema$BuildTrigger { - /** - * Contents of the build template. - */ - build: Schema$Build; - /** - * Time when the trigger was created. @OutputOnly - */ - createTime: string; - /** - * Human-readable description of this trigger. - */ - description: string; - /** - * If true, the trigger will never result in a build. - */ - disabled: boolean; - /** - * Path, from the source root, to a file whose contents is used for the - * template. - */ - filename: string; - /** - * Unique identifier of the trigger. @OutputOnly - */ - id: string; - /** - * Substitutions data for Build resource. - */ - substitutions: any; - /** - * Template describing the types of source changes to trigger a build. Branch - * and tag names in trigger templates are interpreted as regular expressions. - * Any branch or tag change that matches that regular expression will trigger - * a build. - */ - triggerTemplate: Schema$RepoSource; -} -/** - * An image built by the pipeline. - */ -export interface Schema$BuiltImage { - /** - * Docker Registry 2.0 digest. - */ - digest: string; - /** - * Name used to push the container image to Google Container Registry, as - * presented to `docker push`. - */ - name: string; - /** - * Stores timing information for pushing the specified image. @OutputOnly - */ - pushTiming: Schema$TimeSpan; -} -/** - * Request to cancel an ongoing build. - */ -export interface Schema$CancelBuildRequest {} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Container message for hashes of byte content of files, used in - * SourceProvenance messages to verify integrity of source input to the build. - */ -export interface Schema$FileHashes { - /** - * Collection of file hashes. - */ - fileHash: Schema$Hash[]; -} -/** - * Container message for hash values. - */ -export interface Schema$Hash { - /** - * The type of hash that was performed. - */ - type: string; - /** - * The hash value. - */ - value: string; -} -/** - * Response including listed builds. - */ -export interface Schema$ListBuildsResponse { - /** - * Builds will be sorted by `create_time`, descending. - */ - builds: Schema$Build[]; - /** - * Token to receive the next page of results. - */ - nextPageToken: string; -} -/** - * Response containing existing `BuildTriggers`. - */ -export interface Schema$ListBuildTriggersResponse { - /** - * `BuildTriggers` for the project, sorted by `create_time` descending. - */ - triggers: Schema$BuildTrigger[]; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Location of the source in a Google Cloud Source Repository. - */ -export interface Schema$RepoSource { - /** - * Name of the branch to build. - */ - branchName: string; + export interface Schema$ArtifactObjects { + /** + * Cloud Storage bucket and optional object path, in the form + * "gs://bucket/path/to/somewhere/". (see [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * Files in the workspace matching any path pattern will be uploaded to + * Cloud Storage with this location as a prefix. + */ + location: string; + /** + * Path globs used to match files in the build's workspace. + */ + paths: string[]; + /** + * Stores timing information for pushing all artifact objects. @OutputOnly + */ + timing: Schema$TimeSpan; + } /** - * Explicit commit SHA to build. - */ - commitSha: string; + * An artifact that was uploaded during a build. This is a single record in + * the artifact manifest JSON file. + */ + export interface Schema$ArtifactResult { + /** + * The file hash of the artifact. + */ + fileHash: Schema$FileHashes[]; + /** + * The path of an artifact in a Google Cloud Storage bucket, with the + * generation number. For example, + * `gs://mybucket/path/to/output.jar#generation`. + */ + location: string; + } /** - * Directory, relative to the source root, in which to run the build. This - * must be a relative path. If a step's `dir` is specified and is an - * absolute path, this value is ignored for that step's execution. + * Artifacts produced by a build that should be uploaded upon successful + * completion of all build steps. */ - dir: string; + export interface Schema$Artifacts { + /** + * A list of images to be pushed upon the successful completion of all build + * steps. The images will be pushed using the builder service account's + * credentials. The digests of the pushed images will be stored in the + * Build resource's results field. If any of the images fail to be + * pushed, the build is marked FAILURE. + */ + images: string[]; + /** + * A list of objects to be uploaded to Cloud Storage upon successful + * completion of all build steps. Files in the workspace matching specified + * paths globs will be uploaded to the specified Cloud Storage location + * using the builder service account's credentials. The location and + * generation of the uploaded objects will be stored in the Build + * resource's results field. If any objects fail to be pushed, the + * build is marked FAILURE. + */ + objects: Schema$ArtifactObjects; + } /** - * ID of the project that owns the Cloud Source Repository. If omitted, the - * project ID requesting the build is assumed. - */ - projectId: string; + * A build resource in the Container Builder API. At a high level, a `Build` + * describes where to find source code, how to build it (for example, the + * builder image to run on the source), and where to store the built + * artifacts. Fields can include the following variables, which will be + * expanded when the build is created: - $PROJECT_ID: the project ID of the + * build. - $BUILD_ID: the autogenerated ID of the build. - $REPO_NAME: the + * source repository name specified by RepoSource. - $BRANCH_NAME: the branch + * name specified by RepoSource. - $TAG_NAME: the tag name specified by + * RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by + * RepoSource or resolved from the specified branch or tag. - $SHORT_SHA: + * first 7 characters of $REVISION_ID or $COMMIT_SHA. + */ + export interface Schema$Build { + /** + * Artifacts produced by the build that should be uploaded upon successful + * completion of all build steps. + */ + artifacts: Schema$Artifacts; + /** + * The ID of the `BuildTrigger` that triggered this build, if it was + * triggered automatically. @OutputOnly + */ + buildTriggerId: string; + /** + * Time at which the request to create the build was received. @OutputOnly + */ + createTime: string; + /** + * Time at which execution of the build was finished. The difference + * between finish_time and start_time is the duration of the build's + * execution. @OutputOnly + */ + finishTime: string; + /** + * Unique identifier of the build. @OutputOnly + */ + id: string; + /** + * A list of images to be pushed upon the successful completion of all build + * steps. The images are pushed using the builder service account's + * credentials. The digests of the pushed images will be stored in the + * `Build` resource's results field. If any of the images fail to be + * pushed, the build status is marked `FAILURE`. + */ + images: string[]; + /** + * Google Cloud Storage bucket where logs should be written (see [Bucket + * Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * Logs file names will be of the format + * `${logs_bucket}/log-${build_id}.txt`. + */ + logsBucket: string; + /** + * URL to logs for this build in Google Cloud Console. @OutputOnly + */ + logUrl: string; + /** + * Special options for this build. + */ + options: Schema$BuildOptions; + /** + * ID of the project. @OutputOnly. + */ + projectId: string; + /** + * Results of the build. @OutputOnly + */ + results: Schema$Results; + /** + * Secrets to decrypt using Cloud Key Management Service. + */ + secrets: Schema$Secret[]; + /** + * The location of the source files to build. + */ + source: Schema$Source; + /** + * A permanent fixed identifier for source. @OutputOnly + */ + sourceProvenance: Schema$SourceProvenance; + /** + * Time at which execution of the build was started. @OutputOnly + */ + startTime: string; + /** + * Status of the build. @OutputOnly + */ + status: string; + /** + * Customer-readable message about the current status. @OutputOnly + */ + statusDetail: string; + /** + * Required. The operations to be performed on the workspace. + */ + steps: Schema$BuildStep[]; + /** + * Substitutions data for `Build` resource. + */ + substitutions: any; + /** + * Tags for annotation of a `Build`. These are not docker tags. + */ + tags: string[]; + /** + * Amount of time that this build should be allowed to run, to second + * granularity. If this amount of time elapses, work on the build will cease + * and the build status will be `TIMEOUT`. Default time is ten minutes. + */ + timeout: string; + /** + * Stores timing information for phases of the build. Valid keys are: * + * BUILD: time to execute all build steps * PUSH: time to push all specified + * images. * FETCHSOURCE: time to fetch source. If the build does not + * specify source or images, these keys will not be included. @OutputOnly + */ + timing: any; + } /** - * Name of the Cloud Source Repository. If omitted, the name - * "default" is assumed. + * Metadata for build operations. */ - repoName: string; + export interface Schema$BuildOperationMetadata { + /** + * The build that the operation is tracking. + */ + build: Schema$Build; + } /** - * Name of the tag to build. - */ - tagName: string; -} -/** - * Artifacts created by the build pipeline. - */ -export interface Schema$Results { + * Optional arguments to enable specific features of builds. + */ + export interface Schema$BuildOptions { + /** + * Requested disk size for the VM that runs the build. Note that this is + * *NOT* "disk free"; some of the space will be used by the + * operating system and build utilities. Also note that this is the minimum + * disk size that will be allocated for the build -- the build may run with + * a larger disk than requested. At present, the maximum disk size is + * 1000GB; builds that request more than the maximum are rejected with an + * error. + */ + diskSizeGb: string; + /** + * Option to define build log streaming behavior to Google Cloud Storage. + */ + logStreamingOption: string; + /** + * Compute Engine machine type on which to run the build. + */ + machineType: string; + /** + * Requested verifiability options. + */ + requestedVerifyOption: string; + /** + * Requested hash for SourceProvenance. + */ + sourceProvenanceHash: string[]; + /** + * Option to specify behavior when there is an error in the substitution + * checks. + */ + substitutionOption: string; + } /** - * Path to the artifact manifest. Only populated when artifacts are uploaded. - */ - artifactManifest: string; + * A step in the build pipeline. + */ + export interface Schema$BuildStep { + /** + * A list of arguments that will be presented to the step when it is + * started. If the image used to run the step's container has an + * entrypoint, the `args` are used as arguments to that entrypoint. If the + * image does not define an entrypoint, the first element in args is used as + * the entrypoint, and the remainder will be used as arguments. + */ + args: string[]; + /** + * Working directory to use when running this step's container. If this + * value is a relative path, it is relative to the build's working + * directory. If this value is absolute, it may be outside the build's + * working directory, in which case the contents of the path may not be + * persisted across build step executions, unless a `volume` for that path + * is specified. If the build specifies a `RepoSource` with `dir` and a + * step with a `dir`, which specifies an absolute path, the `RepoSource` + * `dir` is ignored for the step's execution. + */ + dir: string; + /** + * Entrypoint to be used instead of the build step image's default + * entrypoint. If unset, the image's default entrypoint is used. + */ + entrypoint: string; + /** + * A list of environment variable definitions to be used when running a + * step. The elements are of the form "KEY=VALUE" for the + * environment variable "KEY" being given the value + * "VALUE". + */ + env: string[]; + /** + * Unique identifier for this build step, used in `wait_for` to reference + * this build step as a dependency. + */ + id: string; + /** + * Required. The name of the container image that will run this particular + * build step. If the image is available in the host's Docker + * daemon's cache, it will be run directly. If not, the host will + * attempt to pull the image first, using the builder service account's + * credentials if necessary. The Docker daemon's cache will already + * have the latest versions of all of the officially supported build steps + * ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)). + * The Docker daemon will also have cached many of the layers for some + * popular images, like "ubuntu", "debian", but they + * will be refreshed at the time you attempt to use them. If you built an + * image in a previous build step, it will be stored in the host's + * Docker daemon's cache and is available to use as the name for a later + * build step. + */ + name: string; + /** + * A list of environment variables which are encrypted using a Cloud Key + * Management Service crypto key. These values must be specified in the + * build's `Secret`. + */ + secretEnv: string[]; + /** + * Status of the build step. At this time, build step status is only updated + * on build completion; step status is not updated in real-time as the build + * progresses. @OutputOnly + */ + status: string; + /** + * Time limit for executing this build step. If not defined, the step has no + * time limit and will be allowed to continue to run until either it + * completes or the build itself times out. + */ + timeout: string; + /** + * Stores timing information for executing this build step. @OutputOnly + */ + timing: Schema$TimeSpan; + /** + * List of volumes to mount into the build step. Each volume will be + * created as an empty volume prior to execution of the build step. Upon + * completion of the build, volumes and their contents will be discarded. + * Using a named volume in only one step is not valid as it is indicative of + * a mis-configured build request. + */ + volumes: Schema$Volume[]; + /** + * The ID(s) of the step(s) that this build step depends on. This build step + * will not start until all the build steps in `wait_for` have completed + * successfully. If `wait_for` is empty, this build step will start when all + * previous build steps in the `Build.Steps` list have completed + * successfully. + */ + waitFor: string[]; + } /** - * List of build step digests, in the order corresponding to build step - * indices. - */ - buildStepImages: string[]; + * Configuration for an automated build in response to source repository + * changes. + */ + export interface Schema$BuildTrigger { + /** + * Contents of the build template. + */ + build: Schema$Build; + /** + * Time when the trigger was created. @OutputOnly + */ + createTime: string; + /** + * Human-readable description of this trigger. + */ + description: string; + /** + * If true, the trigger will never result in a build. + */ + disabled: boolean; + /** + * Path, from the source root, to a file whose contents is used for the + * template. + */ + filename: string; + /** + * Unique identifier of the trigger. @OutputOnly + */ + id: string; + /** + * Substitutions data for Build resource. + */ + substitutions: any; + /** + * Template describing the types of source changes to trigger a build. + * Branch and tag names in trigger templates are interpreted as regular + * expressions. Any branch or tag change that matches that regular + * expression will trigger a build. + */ + triggerTemplate: Schema$RepoSource; + } /** - * Container images that were built as a part of the build. - */ - images: Schema$BuiltImage[]; + * An image built by the pipeline. + */ + export interface Schema$BuiltImage { + /** + * Docker Registry 2.0 digest. + */ + digest: string; + /** + * Name used to push the container image to Google Container Registry, as + * presented to `docker push`. + */ + name: string; + /** + * Stores timing information for pushing the specified image. @OutputOnly + */ + pushTiming: Schema$TimeSpan; + } /** - * Number of artifacts uploaded. Only populated when artifacts are uploaded. + * Request to cancel an ongoing build. */ - numArtifacts: string; -} -/** - * Specifies a build to retry. - */ -export interface Schema$RetryBuildRequest {} -/** - * Pairs a set of secret environment variables containing encrypted values with - * the Cloud KMS key to use to decrypt the value. - */ -export interface Schema$Secret { + export interface Schema$CancelBuildRequest {} /** - * Cloud KMS key name to use to decrypt these envs. + * The request message for Operations.CancelOperation. */ - kmsKeyName: string; + export interface Schema$CancelOperationRequest {} /** - * Map of environment variable name to its encrypted value. Secret - * environment variables must be unique across all of a build's secrets, - * and must be used by at least one build step. Values can be at most 1 KB in - * size. There can be at most ten secret values across all of a build's - * secrets. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - secretEnv: any; -} -/** - * Location of the source in a supported storage service. - */ -export interface Schema$Source { + export interface Schema$Empty {} /** - * If provided, get the source from this location in a Cloud Source - * Repository. + * Container message for hashes of byte content of files, used in + * SourceProvenance messages to verify integrity of source input to the build. */ - repoSource: Schema$RepoSource; - /** - * If provided, get the source from this location in Google Cloud Storage. - */ - storageSource: Schema$StorageSource; -} -/** - * Provenance of the source. Ways to find the original source, or verify that - * some source was used for this build. - */ -export interface Schema$SourceProvenance { + export interface Schema$FileHashes { + /** + * Collection of file hashes. + */ + fileHash: Schema$Hash[]; + } /** - * Hash(es) of the build source, which can be used to verify that the original - * source integrity was maintained in the build. Note that `FileHashes` will - * only be populated if `BuildOptions` has requested a `SourceProvenanceHash`. - * The keys to this map are file paths used as build source and the values - * contain the hash values for those files. If the build source came in a - * single package such as a gzipped tarfile (`.tar.gz`), the `FileHash` will - * be for the single path to that file. @OutputOnly - */ - fileHashes: any; + * Container message for hash values. + */ + export interface Schema$Hash { + /** + * The type of hash that was performed. + */ + type: string; + /** + * The hash value. + */ + value: string; + } /** - * A copy of the build's `source.repo_source`, if exists, with any - * revisions resolved. - */ - resolvedRepoSource: Schema$RepoSource; + * Response including listed builds. + */ + export interface Schema$ListBuildsResponse { + /** + * Builds will be sorted by `create_time`, descending. + */ + builds: Schema$Build[]; + /** + * Token to receive the next page of results. + */ + nextPageToken: string; + } /** - * A copy of the build's `source.storage_source`, if exists, with any - * generations resolved. + * Response containing existing `BuildTriggers`. */ - resolvedStorageSource: Schema$StorageSource; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$ListBuildTriggersResponse { + /** + * `BuildTriggers` for the project, sorted by `create_time` descending. + */ + triggers: Schema$BuildTrigger[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Location of the source in an archive file in Google Cloud Storage. - */ -export interface Schema$StorageSource { + * Location of the source in a Google Cloud Source Repository. + */ + export interface Schema$RepoSource { + /** + * Name of the branch to build. + */ + branchName: string; + /** + * Explicit commit SHA to build. + */ + commitSha: string; + /** + * Directory, relative to the source root, in which to run the build. This + * must be a relative path. If a step's `dir` is specified and is an + * absolute path, this value is ignored for that step's execution. + */ + dir: string; + /** + * ID of the project that owns the Cloud Source Repository. If omitted, the + * project ID requesting the build is assumed. + */ + projectId: string; + /** + * Name of the Cloud Source Repository. If omitted, the name + * "default" is assumed. + */ + repoName: string; + /** + * Name of the tag to build. + */ + tagName: string; + } /** - * Google Cloud Storage bucket containing the source (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - */ - bucket: string; + * Artifacts created by the build pipeline. + */ + export interface Schema$Results { + /** + * Path to the artifact manifest. Only populated when artifacts are + * uploaded. + */ + artifactManifest: string; + /** + * List of build step digests, in the order corresponding to build step + * indices. + */ + buildStepImages: string[]; + /** + * Container images that were built as a part of the build. + */ + images: Schema$BuiltImage[]; + /** + * Number of artifacts uploaded. Only populated when artifacts are uploaded. + */ + numArtifacts: string; + } /** - * Google Cloud Storage generation for the object. If the generation is - * omitted, the latest generation will be used. - */ - generation: string; + * Specifies a build to retry. + */ + export interface Schema$RetryBuildRequest {} + /** + * Pairs a set of secret environment variables containing encrypted values + * with the Cloud KMS key to use to decrypt the value. + */ + export interface Schema$Secret { + /** + * Cloud KMS key name to use to decrypt these envs. + */ + kmsKeyName: string; + /** + * Map of environment variable name to its encrypted value. Secret + * environment variables must be unique across all of a build's secrets, + * and must be used by at least one build step. Values can be at most 1 KB + * in size. There can be at most ten secret values across all of a + * build's secrets. + */ + secretEnv: any; + } /** - * Google Cloud Storage object containing the source. This object must be a - * gzipped archive file (`.tar.gz`) containing source to build. - */ - object: string; -} -/** - * Start and end times for a build execution phase. - */ -export interface Schema$TimeSpan { + * Location of the source in a supported storage service. + */ + export interface Schema$Source { + /** + * If provided, get the source from this location in a Cloud Source + * Repository. + */ + repoSource: Schema$RepoSource; + /** + * If provided, get the source from this location in Google Cloud Storage. + */ + storageSource: Schema$StorageSource; + } /** - * End of time span. - */ - endTime: string; + * Provenance of the source. Ways to find the original source, or verify that + * some source was used for this build. + */ + export interface Schema$SourceProvenance { + /** + * Hash(es) of the build source, which can be used to verify that the + * original source integrity was maintained in the build. Note that + * `FileHashes` will only be populated if `BuildOptions` has requested a + * `SourceProvenanceHash`. The keys to this map are file paths used as + * build source and the values contain the hash values for those files. If + * the build source came in a single package such as a gzipped tarfile + * (`.tar.gz`), the `FileHash` will be for the single path to that file. + * @OutputOnly + */ + fileHashes: any; + /** + * A copy of the build's `source.repo_source`, if exists, with any + * revisions resolved. + */ + resolvedRepoSource: Schema$RepoSource; + /** + * A copy of the build's `source.storage_source`, if exists, with any + * generations resolved. + */ + resolvedStorageSource: Schema$StorageSource; + } /** - * Start of time span. - */ - startTime: string; -} -/** - * Volume describes a Docker container volume which is mounted into build steps - * in order to persist files across build step execution. - */ -export interface Schema$Volume { + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * Name of the volume to mount. Volume names must be unique per build step - * and must be valid names for Docker volumes. Each named volume must be used - * by at least two build steps. - */ - name: string; + * Location of the source in an archive file in Google Cloud Storage. + */ + export interface Schema$StorageSource { + /** + * Google Cloud Storage bucket containing the source (see [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + */ + bucket: string; + /** + * Google Cloud Storage generation for the object. If the generation is + * omitted, the latest generation will be used. + */ + generation: string; + /** + * Google Cloud Storage object containing the source. This object must be a + * gzipped archive file (`.tar.gz`) containing source to build. + */ + object: string; + } /** - * Path at which to mount the volume. Paths must be absolute and cannot - * conflict with other volume paths on the same build step or with certain - * reserved volume paths. - */ - path: string; -} - -export class Resource$Operations { - root: Cloudbuild; - constructor(root: Cloudbuild) { - this.root = root; - this.getRoot.bind(this); + * Start and end times for a build execution phase. + */ + export interface Schema$TimeSpan { + /** + * End of time span. + */ + endTime: string; + /** + * Start of time span. + */ + startTime: string; } - - getRoot() { - return this.root; + /** + * Volume describes a Docker container volume which is mounted into build + * steps in order to persist files across build step execution. + */ + export interface Schema$Volume { + /** + * Name of the volume to mount. Volume names must be unique per build step + * and must be valid names for Docker volumes. Each named volume must be + * used by at least two build steps. + */ + name: string; + /** + * Path at which to mount the volume. Paths must be absolute and cannot + * conflict with other volume paths on the same build step or with certain + * reserved volume paths. + */ + path: string; } - - /** - * cloudbuild.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias cloudbuild.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Cloudbuild; + constructor(root: Cloudbuild) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudbuild.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias cloudbuild.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias cloudbuild.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbuild.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias cloudbuild.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias cloudbuild.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Cloudbuild; - builds: Resource$Projects$Builds; - triggers: Resource$Projects$Triggers; - constructor(root: Cloudbuild) { - this.root = root; - this.getRoot.bind(this); - this.builds = new Resource$Projects$Builds(root); - this.triggers = new Resource$Projects$Triggers(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Builds { - root: Cloudbuild; - constructor(root: Cloudbuild) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * cloudbuild.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias cloudbuild.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Projects { + root: Cloudbuild; + builds: Resource$Projects$Builds; + triggers: Resource$Projects$Triggers; + constructor(root: Cloudbuild) { + this.root = root; + this.getRoot.bind(this); + this.builds = new Resource$Projects$Builds(root); + this.triggers = new Resource$Projects$Triggers(root); + } - /** - * cloudbuild.projects.builds.cancel - * @desc Cancels a build in progress. - * @alias cloudbuild.projects.builds.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id ID of the build. - * @param {string} params.projectId ID of the project. - * @param {().CancelBuildRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Builds { + root: Cloudbuild; + constructor(root: Cloudbuild) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/builds/{id}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'id'], - pathParams: ['id', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudbuild.projects.builds.create - * @desc Starts a build with the specified configuration. This method returns - * a long-running `Operation`, which includes the build ID. Pass the build ID - * to `GetBuild` to determine the build status (such as `SUCCESS` or - * `FAILURE`). - * @alias cloudbuild.projects.builds.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project. - * @param {().Build} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/builds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbuild.projects.builds.cancel + * @desc Cancels a build in progress. + * @alias cloudbuild.projects.builds.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id ID of the build. + * @param {string} params.projectId ID of the project. + * @param {().CancelBuildRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/builds/{id}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'id'], + pathParams: ['id', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudbuild.projects.builds.get - * @desc Returns information about a previously requested build. The `Build` - * that is returned includes its status (such as `SUCCESS`, `FAILURE`, or - * `WORKING`), and timing information. - * @alias cloudbuild.projects.builds.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id ID of the build. - * @param {string} params.projectId ID of the project. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/builds/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'id'], - pathParams: ['id', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbuild.projects.builds.create + * @desc Starts a build with the specified configuration. This method + * returns a long-running `Operation`, which includes the build ID. Pass the + * build ID to `GetBuild` to determine the build status (such as `SUCCESS` + * or `FAILURE`). + * @alias cloudbuild.projects.builds.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project. + * @param {().Build} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/builds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudbuild.projects.builds.list - * @desc Lists previously requested builds. Previously requested builds may - * still be in-progress, or may have finished successfully or unsuccessfully. - * @alias cloudbuild.projects.builds.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The raw filter text to constrain the results. - * @param {integer=} params.pageSize Number of results to return in the list. - * @param {string=} params.pageToken Token to provide to skip to a particular spot in the list. - * @param {string} params.projectId ID of the project. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/builds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbuild.projects.builds.get + * @desc Returns information about a previously requested build. The + * `Build` that is returned includes its status (such as `SUCCESS`, + * `FAILURE`, or `WORKING`), and timing information. + * @alias cloudbuild.projects.builds.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id ID of the build. + * @param {string} params.projectId ID of the project. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/builds/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'id'], + pathParams: ['id', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudbuild.projects.builds.retry - * @desc Creates a new build based on the specified build. This method - * creates a new build using the original build request, which may or may not - * result in an identical build. For triggered builds: * Triggered builds - * resolve to a precise revision; therefore a retry of a triggered build will - * result in a build that uses the same revision. For non-triggered builds - * that specify `RepoSource`: * If the original build built from the tip of a - * branch, the retried build will build from the tip of that branch, which may - * not be the same revision as the original build. * If the original build - * specified a commit sha or revision ID, the retried build will use the - * identical source. For builds that specify `StorageSource`: * If the - * original build pulled source from Google Cloud Storage without specifying - * the generation of the object, the new build will use the current object, - * which may be different from the original build source. * If the original - * build pulled source from Cloud Storage and specified the generation of the - * object, the new build will attempt to use the same object, which may or may - * not be available depending on the bucket's lifecycle management settings. - * @alias cloudbuild.projects.builds.retry - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Build ID of the original build. - * @param {string} params.projectId ID of the project. - * @param {().RetryBuildRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - retry(params?: any, options?: MethodOptions): AxiosPromise; - retry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - retry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/builds/{id}:retry') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'id'], - pathParams: ['id', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudbuild.projects.builds.list + * @desc Lists previously requested builds. Previously requested builds may + * still be in-progress, or may have finished successfully or + * unsuccessfully. + * @alias cloudbuild.projects.builds.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The raw filter text to constrain the results. + * @param {integer=} params.pageSize Number of results to return in the list. + * @param {string=} params.pageToken Token to provide to skip to a particular spot in the list. + * @param {string} params.projectId ID of the project. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/builds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Triggers { - root: Cloudbuild; - constructor(root: Cloudbuild) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * cloudbuild.projects.builds.retry + * @desc Creates a new build based on the specified build. This method + * creates a new build using the original build request, which may or may + * not result in an identical build. For triggered builds: * Triggered + * builds resolve to a precise revision; therefore a retry of a triggered + * build will result in a build that uses the same revision. For + * non-triggered builds that specify `RepoSource`: * If the original build + * built from the tip of a branch, the retried build will build from the tip + * of that branch, which may not be the same revision as the original build. + * * If the original build specified a commit sha or revision ID, the + * retried build will use the identical source. For builds that specify + * `StorageSource`: * If the original build pulled source from Google Cloud + * Storage without specifying the generation of the object, the new build + * will use the current object, which may be different from the original + * build source. * If the original build pulled source from Cloud Storage + * and specified the generation of the object, the new build will attempt to + * use the same object, which may or may not be available depending on the + * bucket's lifecycle management settings. + * @alias cloudbuild.projects.builds.retry + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Build ID of the original build. + * @param {string} params.projectId ID of the project. + * @param {().RetryBuildRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + retry(params?: any, options?: MethodOptions): + AxiosPromise; + retry( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + retry( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/builds/{id}:retry') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'id'], + pathParams: ['id', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * cloudbuild.projects.triggers.create - * @desc Creates a new `BuildTrigger`. This API is experimental. - * @alias cloudbuild.projects.triggers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project for which to configure automatic builds. - * @param {().BuildTrigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Triggers { + root: Cloudbuild; + constructor(root: Cloudbuild) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudbuild.projects.triggers.delete - * @desc Deletes a `BuildTrigger` by its project ID and trigger ID. This API - * is experimental. - * @alias cloudbuild.projects.triggers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project that owns the trigger. - * @param {string} params.triggerId ID of the `BuildTrigger` to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.projects.triggers.create + * @desc Creates a new `BuildTrigger`. This API is experimental. + * @alias cloudbuild.projects.triggers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project for which to configure automatic builds. + * @param {().BuildTrigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'triggerId'], - pathParams: ['projectId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbuild.projects.triggers.get - * @desc Returns information about a `BuildTrigger`. This API is - * experimental. - * @alias cloudbuild.projects.triggers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project that owns the trigger. - * @param {string} params.triggerId ID of the `BuildTrigger` to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.projects.triggers.delete + * @desc Deletes a `BuildTrigger` by its project ID and trigger ID. This + * API is experimental. + * @alias cloudbuild.projects.triggers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project that owns the trigger. + * @param {string} params.triggerId ID of the `BuildTrigger` to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'triggerId'], + pathParams: ['projectId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'triggerId'], - pathParams: ['projectId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbuild.projects.triggers.list - * @desc Lists existing `BuildTrigger`s. This API is experimental. - * @alias cloudbuild.projects.triggers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project for which to list BuildTriggers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.projects.triggers.get + * @desc Returns information about a `BuildTrigger`. This API is + * experimental. + * @alias cloudbuild.projects.triggers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project that owns the trigger. + * @param {string} params.triggerId ID of the `BuildTrigger` to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'triggerId'], + pathParams: ['projectId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbuild.projects.triggers.patch - * @desc Updates a `BuildTrigger` by its project ID and trigger ID. This API - * is experimental. - * @alias cloudbuild.projects.triggers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project that owns the trigger. - * @param {string} params.triggerId ID of the `BuildTrigger` to update. - * @param {().BuildTrigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.projects.triggers.list + * @desc Lists existing `BuildTrigger`s. This API is experimental. + * @alias cloudbuild.projects.triggers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project for which to list BuildTriggers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'triggerId'], - pathParams: ['projectId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudbuild.projects.triggers.run - * @desc Runs a `BuildTrigger` at a particular source revision. - * @alias cloudbuild.projects.triggers.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the project. - * @param {string} params.triggerId ID of the trigger. - * @param {().RepoSource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudbuild.projects.triggers.patch + * @desc Updates a `BuildTrigger` by its project ID and trigger ID. This + * API is experimental. + * @alias cloudbuild.projects.triggers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project that owns the trigger. + * @param {string} params.triggerId ID of the `BuildTrigger` to update. + * @param {().BuildTrigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'triggerId'], + pathParams: ['projectId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/triggers/{triggerId}:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'triggerId'], - pathParams: ['projectId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudbuild.projects.triggers.run + * @desc Runs a `BuildTrigger` at a particular source revision. + * @alias cloudbuild.projects.triggers.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the project. + * @param {string} params.triggerId ID of the trigger. + * @param {().RepoSource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudbuild.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/triggers/{triggerId}:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'triggerId'], + pathParams: ['projectId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/clouddebugger/v2.ts b/src/apis/clouddebugger/v2.ts index 1669ab1c91d..b5a8da0e9b9 100644 --- a/src/apis/clouddebugger/v2.ts +++ b/src/apis/clouddebugger/v2.ts @@ -27,1644 +27,1673 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Debugger API - * - * Examines the call stack and variables of a running application without - * stopping or slowing it down. - * - * @example - * const google = require('googleapis'); - * const clouddebugger = google.clouddebugger('v2'); - * - * @namespace clouddebugger - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Clouddebugger - */ -export class Clouddebugger { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace clouddebugger_v2 { + /** + * Stackdriver Debugger API + * + * Examines the call stack and variables of a running application without + * stopping or slowing it down. + * + * @example + * const google = require('googleapis'); + * const clouddebugger = google.clouddebugger('v2'); + * + * @namespace clouddebugger + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Clouddebugger + */ + export class Clouddebugger { + _options: GlobalOptions; + google: GoogleApis; + root = this; - controller: Resource$Controller; - debugger: Resource$Debugger; + controller: Resource$Controller; + debugger: Resource$Debugger; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.controller = new Resource$Controller(this); - this.debugger = new Resource$Debugger(this); - } + this.controller = new Resource$Controller(this); + this.debugger = new Resource$Debugger(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An alias to a repo revision. - */ -export interface Schema$AliasContext { - /** - * The alias kind. - */ - kind: string; - /** - * The alias name. - */ - name: string; -} -/** - * Represents the breakpoint specification, status and results. - */ -export interface Schema$Breakpoint { - /** - * Action that the agent should perform when the code at the breakpoint - * location is hit. - */ - action: string; - /** - * Condition that triggers the breakpoint. The condition is a compound boolean - * expression composed using expressions in a programming language at the - * source location. - */ - condition: string; - /** - * Time this breakpoint was created by the server in seconds resolution. - */ - createTime: string; - /** - * Values of evaluated expressions at breakpoint time. The evaluated - * expressions appear in exactly the same order they are listed in the - * `expressions` field. The `name` field holds the original expression text, - * the `value` or `members` field holds the result of the evaluated - * expression. If the expression cannot be evaluated, the `status` inside the - * `Variable` will indicate an error and contain the error text. - */ - evaluatedExpressions: Schema$Variable[]; - /** - * List of read-only expressions to evaluate at the breakpoint location. The - * expressions are composed using expressions in the programming language at - * the source location. If the breakpoint action is `LOG`, the evaluated - * expressions are included in log statements. - */ - expressions: string[]; - /** - * Time this breakpoint was finalized as seen by the server in seconds - * resolution. - */ - finalTime: string; - /** - * Breakpoint identifier, unique in the scope of the debuggee. - */ - id: string; - /** - * When true, indicates that this is a final result and the breakpoint state - * will not change from here on. - */ - isFinalState: boolean; - /** - * A set of custom breakpoint properties, populated by the agent, to be - * displayed to the user. - */ - labels: any; - /** - * Breakpoint source location. - */ - location: Schema$SourceLocation; - /** - * Indicates the severity of the log. Only relevant when action is `LOG`. - */ - logLevel: string; - /** - * Only relevant when action is `LOG`. Defines the message to log when the - * breakpoint hits. The message may include parameter placeholders `$0`, `$1`, - * etc. These placeholders are replaced with the evaluated value of the - * appropriate expression. Expressions not referenced in `log_message_format` - * are not logged. Example: `Message received, id = $0, count = $1` with - * `expressions` = `[ message.id, message.count ]`. - */ - logMessageFormat: string; - /** - * The stack at breakpoint time. - */ - stackFrames: Schema$StackFrame[]; - /** - * Breakpoint status. The status includes an error flag and a human readable - * message. This field is usually unset. The message can be either - * informational or an error message. Regardless, clients should always - * display the text message back to the user. Error status indicates complete - * failure of the breakpoint. Example (non-final state): `Still loading - * symbols...` Examples (final state): * `Invalid line number` referring - * to location * `Field f not found in class C` referring to condition - */ - status: Schema$StatusMessage; - /** - * E-mail address of the user that created this breakpoint - */ - userEmail: string; - /** - * The `variable_table` exists to aid with computation, memory and network - * traffic optimization. It enables storing a variable once and reference it - * from multiple variables, including variables stored in the `variable_table` - * itself. For example, the same `this` object, which may appear at many - * levels of the stack, can have all of its data stored once in this table. - * The stack frame variables then would hold only a reference to it. The - * variable `var_table_index` field is an index into this repeated field. The - * stored objects are nameless and get their name from the referencing - * variable. The effective variable is a merge of the referencing variable and - * the referenced variable. - */ - variableTable: Schema$Variable[]; -} -/** - * A CloudRepoSourceContext denotes a particular revision in a cloud repo (a - * repo hosted by the Google Cloud Platform). - */ -export interface Schema$CloudRepoSourceContext { - /** - * An alias, which may be a branch or tag. - */ - aliasContext: Schema$AliasContext; - /** - * The name of an alias (branch, tag, etc.). - */ - aliasName: string; - /** - * The ID of the repo. - */ - repoId: Schema$RepoId; - /** - * A revision ID. - */ - revisionId: string; -} -/** - * A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud - * workspace is a place associated with a repo where modified files can be - * stored before they are committed. - */ -export interface Schema$CloudWorkspaceId { - /** - * The unique name of the workspace within the repo. This is the name chosen - * by the client in the Source API's CreateWorkspace method. - */ - name: string; - /** - * The ID of the repo containing the workspace. - */ - repoId: Schema$RepoId; -} -/** - * A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot. - */ -export interface Schema$CloudWorkspaceSourceContext { - /** - * The ID of the snapshot. An empty snapshot_id refers to the most recent - * snapshot. - */ - snapshotId: string; - /** - * The ID of the workspace. - */ - workspaceId: Schema$CloudWorkspaceId; -} -/** - * Represents the debugged application. The application may include one or more - * replicated processes executing the same code. Each of these processes is - * attached with a debugger agent, carrying out the debugging commands. Agents - * attached to the same debuggee identify themselves as such by using exactly - * the same Debuggee message value when registering. - */ -export interface Schema$Debuggee { - /** - * Version ID of the agent. Schema: `domain/language-platform/vmajor.minor` - * (for example `google.com/java-gcp/v1.1`). - */ - agentVersion: string; - /** - * Human readable description of the debuggee. Including a human-readable - * project name, environment name and version information is recommended. - */ - description: string; - /** - * References to the locations and revisions of the source code used in the - * deployed application. - */ - extSourceContexts: Schema$ExtendedSourceContext[]; - /** - * Unique identifier for the debuggee generated by the controller service. - */ - id: string; - /** - * If set to `true`, indicates that the agent should disable itself and detach - * from the debuggee. - */ - isDisabled: boolean; /** - * If set to `true`, indicates that Controller service does not detect any - * activity from the debuggee agents and the application is possibly stopped. - */ - isInactive: boolean; - /** - * A set of custom debuggee properties, populated by the agent, to be - * displayed to the user. - */ - labels: any; - /** - * Project the debuggee is associated with. Use project number or id when - * registering a Google Cloud Platform project. - */ - project: string; - /** - * References to the locations and revisions of the source code used in the - * deployed application. - */ - sourceContexts: Schema$SourceContext[]; - /** - * Human readable message to be displayed to the user about this debuggee. - * Absence of this field indicates no status. The message can be either - * informational or an error status. - */ - status: Schema$StatusMessage; - /** - * Uniquifier to further distiguish the application. It is possible that - * different applications might have identical values in the debuggee message, - * thus, incorrectly identified as a single application by the Controller - * service. This field adds salt to further distiguish the application. Agents - * should consider seeding this field with value that identifies the code, - * binary, configuration and environment. - */ - uniquifier: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * An ExtendedSourceContext is a SourceContext combined with additional details - * describing the context. - */ -export interface Schema$ExtendedSourceContext { - /** - * Any source context. - */ - context: Schema$SourceContext; - /** - * Labels with user defined metadata. - */ - labels: any; -} -/** - * Represents a message with parameters. - */ -export interface Schema$FormatMessage { - /** - * Format template for the message. The `format` uses placeholders `$0`, `$1`, - * etc. to reference parameters. `$$` can be used to denote the `$` character. - * Examples: * `Failed to load '$0' which helps debug $1 the first - * time it is loaded. Again, $0 is very important.` * `Please pay $$10 - * to use $0 instead of $1.` - */ - format: string; - /** - * Optional parameters to be embedded into the message. - */ - parameters: string[]; -} -/** - * A SourceContext referring to a Gerrit project. - */ -export interface Schema$GerritSourceContext { - /** - * An alias, which may be a branch or tag. - */ - aliasContext: Schema$AliasContext; - /** - * The name of an alias (branch, tag, etc.). - */ - aliasName: string; - /** - * The full project name within the host. Projects may be nested, so - * "project/subproject" is a valid project name. The "repo - * name" is hostURI/project. - */ - gerritProject: string; - /** - * The URI of a running Gerrit instance. - */ - hostUri: string; - /** - * A revision (commit) ID. - */ - revisionId: string; -} -/** - * Response for getting breakpoint information. - */ -export interface Schema$GetBreakpointResponse { - /** - * Complete breakpoint state. The fields `id` and `location` are guaranteed to - * be set. - */ - breakpoint: Schema$Breakpoint; -} -/** - * A GitSourceContext denotes a particular revision in a third party Git - * repository (e.g. GitHub). - */ -export interface Schema$GitSourceContext { - /** - * Git commit hash. required. - */ - revisionId: string; - /** - * Git repository URL. - */ - url: string; -} -/** - * Response for listing active breakpoints. - */ -export interface Schema$ListActiveBreakpointsResponse { - /** - * List of all active breakpoints. The fields `id` and `location` are - * guaranteed to be set on each breakpoint. - */ - breakpoints: Schema$Breakpoint[]; - /** - * A token that can be used in the next method call to block until the list of - * breakpoints changes. - */ - nextWaitToken: string; - /** - * If set to `true`, indicates that there is no change to the list of active - * breakpoints and the server-selected timeout has expired. The `breakpoints` - * field would be empty and should be ignored. - */ - waitExpired: boolean; -} -/** - * Response for listing breakpoints. - */ -export interface Schema$ListBreakpointsResponse { - /** - * List of breakpoints matching the request. The fields `id` and `location` - * are guaranteed to be set on each breakpoint. The fields: `stack_frames`, - * `evaluated_expressions` and `variable_table` are cleared on each breakpoint - * regardless of its status. - */ - breakpoints: Schema$Breakpoint[]; - /** - * A wait token that can be used in the next call to `list` (REST) or - * `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. - */ - nextWaitToken: string; -} -/** - * Response for listing debuggees. - */ -export interface Schema$ListDebuggeesResponse { - /** - * List of debuggees accessible to the calling user. The fields `debuggee.id` - * and `description` are guaranteed to be set. The `description` field is a - * human readable field provided by agents and can be displayed to users. - */ - debuggees: Schema$Debuggee[]; -} -/** - * Selects a repo using a Google Cloud Platform project ID (e.g. - * winged-cargo-31) and a repo name within that project. - */ -export interface Schema$ProjectRepoId { - /** - * The ID of the project. - */ - projectId: string; - /** - * The name of the repo. Leave empty for the default repo. - */ - repoName: string; -} -/** - * Request to register a debuggee. - */ -export interface Schema$RegisterDebuggeeRequest { + * An alias to a repo revision. + */ + export interface Schema$AliasContext { + /** + * The alias kind. + */ + kind: string; + /** + * The alias name. + */ + name: string; + } /** - * Debuggee information to register. The fields `project`, `uniquifier`, - * `description` and `agent_version` of the debuggee must be set. - */ - debuggee: Schema$Debuggee; -} -/** - * Response for registering a debuggee. - */ -export interface Schema$RegisterDebuggeeResponse { + * Represents the breakpoint specification, status and results. + */ + export interface Schema$Breakpoint { + /** + * Action that the agent should perform when the code at the breakpoint + * location is hit. + */ + action: string; + /** + * Condition that triggers the breakpoint. The condition is a compound + * boolean expression composed using expressions in a programming language + * at the source location. + */ + condition: string; + /** + * Time this breakpoint was created by the server in seconds resolution. + */ + createTime: string; + /** + * Values of evaluated expressions at breakpoint time. The evaluated + * expressions appear in exactly the same order they are listed in the + * `expressions` field. The `name` field holds the original expression text, + * the `value` or `members` field holds the result of the evaluated + * expression. If the expression cannot be evaluated, the `status` inside + * the `Variable` will indicate an error and contain the error text. + */ + evaluatedExpressions: Schema$Variable[]; + /** + * List of read-only expressions to evaluate at the breakpoint location. The + * expressions are composed using expressions in the programming language at + * the source location. If the breakpoint action is `LOG`, the evaluated + * expressions are included in log statements. + */ + expressions: string[]; + /** + * Time this breakpoint was finalized as seen by the server in seconds + * resolution. + */ + finalTime: string; + /** + * Breakpoint identifier, unique in the scope of the debuggee. + */ + id: string; + /** + * When true, indicates that this is a final result and the breakpoint state + * will not change from here on. + */ + isFinalState: boolean; + /** + * A set of custom breakpoint properties, populated by the agent, to be + * displayed to the user. + */ + labels: any; + /** + * Breakpoint source location. + */ + location: Schema$SourceLocation; + /** + * Indicates the severity of the log. Only relevant when action is `LOG`. + */ + logLevel: string; + /** + * Only relevant when action is `LOG`. Defines the message to log when the + * breakpoint hits. The message may include parameter placeholders `$0`, + * `$1`, etc. These placeholders are replaced with the evaluated value of + * the appropriate expression. Expressions not referenced in + * `log_message_format` are not logged. Example: `Message received, id = + * $0, count = $1` with `expressions` = `[ message.id, message.count ]`. + */ + logMessageFormat: string; + /** + * The stack at breakpoint time. + */ + stackFrames: Schema$StackFrame[]; + /** + * Breakpoint status. The status includes an error flag and a human + * readable message. This field is usually unset. The message can be either + * informational or an error message. Regardless, clients should always + * display the text message back to the user. Error status indicates + * complete failure of the breakpoint. Example (non-final state): `Still + * loading symbols...` Examples (final state): * `Invalid line number` + * referring to location * `Field f not found in class C` referring to + * condition + */ + status: Schema$StatusMessage; + /** + * E-mail address of the user that created this breakpoint + */ + userEmail: string; + /** + * The `variable_table` exists to aid with computation, memory and network + * traffic optimization. It enables storing a variable once and reference + * it from multiple variables, including variables stored in the + * `variable_table` itself. For example, the same `this` object, which may + * appear at many levels of the stack, can have all of its data stored once + * in this table. The stack frame variables then would hold only a + * reference to it. The variable `var_table_index` field is an index into + * this repeated field. The stored objects are nameless and get their name + * from the referencing variable. The effective variable is a merge of the + * referencing variable and the referenced variable. + */ + variableTable: Schema$Variable[]; + } /** - * Debuggee resource. The field `id` is guranteed to be set (in addition to - * the echoed fields). If the field `is_disabled` is set to `true`, the agent - * should disable itself by removing all breakpoints and detaching from the - * application. It should however continue to poll `RegisterDebuggee` until - * reenabled. - */ - debuggee: Schema$Debuggee; -} -/** - * A unique identifier for a cloud repo. - */ -export interface Schema$RepoId { + * A CloudRepoSourceContext denotes a particular revision in a cloud repo (a + * repo hosted by the Google Cloud Platform). + */ + export interface Schema$CloudRepoSourceContext { + /** + * An alias, which may be a branch or tag. + */ + aliasContext: Schema$AliasContext; + /** + * The name of an alias (branch, tag, etc.). + */ + aliasName: string; + /** + * The ID of the repo. + */ + repoId: Schema$RepoId; + /** + * A revision ID. + */ + revisionId: string; + } /** - * A combination of a project ID and a repo name. - */ - projectRepoId: Schema$ProjectRepoId; + * A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud + * workspace is a place associated with a repo where modified files can be + * stored before they are committed. + */ + export interface Schema$CloudWorkspaceId { + /** + * The unique name of the workspace within the repo. This is the name + * chosen by the client in the Source API's CreateWorkspace method. + */ + name: string; + /** + * The ID of the repo containing the workspace. + */ + repoId: Schema$RepoId; + } /** - * A server-assigned, globally unique identifier. - */ - uid: string; -} -/** - * Response for setting a breakpoint. - */ -export interface Schema$SetBreakpointResponse { + * A CloudWorkspaceSourceContext denotes a workspace at a particular snapshot. + */ + export interface Schema$CloudWorkspaceSourceContext { + /** + * The ID of the snapshot. An empty snapshot_id refers to the most recent + * snapshot. + */ + snapshotId: string; + /** + * The ID of the workspace. + */ + workspaceId: Schema$CloudWorkspaceId; + } /** - * Breakpoint resource. The field `id` is guaranteed to be set (in addition to - * the echoed fileds). - */ - breakpoint: Schema$Breakpoint; -} -/** - * A SourceContext is a reference to a tree of files. A SourceContext together - * with a path point to a unique revision of a single file or directory. - */ -export interface Schema$SourceContext { + * Represents the debugged application. The application may include one or + * more replicated processes executing the same code. Each of these processes + * is attached with a debugger agent, carrying out the debugging commands. + * Agents attached to the same debuggee identify themselves as such by using + * exactly the same Debuggee message value when registering. + */ + export interface Schema$Debuggee { + /** + * Version ID of the agent. Schema: `domain/language-platform/vmajor.minor` + * (for example `google.com/java-gcp/v1.1`). + */ + agentVersion: string; + /** + * Human readable description of the debuggee. Including a human-readable + * project name, environment name and version information is recommended. + */ + description: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + */ + extSourceContexts: Schema$ExtendedSourceContext[]; + /** + * Unique identifier for the debuggee generated by the controller service. + */ + id: string; + /** + * If set to `true`, indicates that the agent should disable itself and + * detach from the debuggee. + */ + isDisabled: boolean; + /** + * If set to `true`, indicates that Controller service does not detect any + * activity from the debuggee agents and the application is possibly + * stopped. + */ + isInactive: boolean; + /** + * A set of custom debuggee properties, populated by the agent, to be + * displayed to the user. + */ + labels: any; + /** + * Project the debuggee is associated with. Use project number or id when + * registering a Google Cloud Platform project. + */ + project: string; + /** + * References to the locations and revisions of the source code used in the + * deployed application. + */ + sourceContexts: Schema$SourceContext[]; + /** + * Human readable message to be displayed to the user about this debuggee. + * Absence of this field indicates no status. The message can be either + * informational or an error status. + */ + status: Schema$StatusMessage; + /** + * Uniquifier to further distiguish the application. It is possible that + * different applications might have identical values in the debuggee + * message, thus, incorrectly identified as a single application by the + * Controller service. This field adds salt to further distiguish the + * application. Agents should consider seeding this field with value that + * identifies the code, binary, configuration and environment. + */ + uniquifier: string; + } /** - * A SourceContext referring to a revision in a cloud repo. - */ - cloudRepo: Schema$CloudRepoSourceContext; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * An ExtendedSourceContext is a SourceContext combined with additional + * details describing the context. + */ + export interface Schema$ExtendedSourceContext { + /** + * Any source context. + */ + context: Schema$SourceContext; + /** + * Labels with user defined metadata. + */ + labels: any; + } /** - * A SourceContext referring to a snapshot in a cloud workspace. - */ - cloudWorkspace: Schema$CloudWorkspaceSourceContext; + * Represents a message with parameters. + */ + export interface Schema$FormatMessage { + /** + * Format template for the message. The `format` uses placeholders `$0`, + * `$1`, etc. to reference parameters. `$$` can be used to denote the `$` + * character. Examples: * `Failed to load '$0' which helps debug + * $1 the first time it is loaded. Again, $0 is very important.` * + * `Please pay $$10 to use $0 instead of $1.` + */ + format: string; + /** + * Optional parameters to be embedded into the message. + */ + parameters: string[]; + } /** * A SourceContext referring to a Gerrit project. */ - gerrit: Schema$GerritSourceContext; - /** - * A SourceContext referring to any third party Git repo (e.g. GitHub). - */ - git: Schema$GitSourceContext; -} -/** - * Represents a location in the source code. - */ -export interface Schema$SourceLocation { - /** - * Line inside the file. The first line in the file has the value `1`. - */ - line: number; - /** - * Path to the source file within the source context of the target binary. - */ - path: string; -} -/** - * Represents a stack frame context. - */ -export interface Schema$StackFrame { - /** - * Set of arguments passed to this function. Note that this might not be - * populated for all stack frames. - */ - arguments: Schema$Variable[]; - /** - * Demangled function name at the call site. - */ - function: string; - /** - * Set of local variables at the stack frame location. Note that this might - * not be populated for all stack frames. - */ - locals: Schema$Variable[]; + export interface Schema$GerritSourceContext { + /** + * An alias, which may be a branch or tag. + */ + aliasContext: Schema$AliasContext; + /** + * The name of an alias (branch, tag, etc.). + */ + aliasName: string; + /** + * The full project name within the host. Projects may be nested, so + * "project/subproject" is a valid project name. The "repo + * name" is hostURI/project. + */ + gerritProject: string; + /** + * The URI of a running Gerrit instance. + */ + hostUri: string; + /** + * A revision (commit) ID. + */ + revisionId: string; + } /** - * Source location of the call site. + * Response for getting breakpoint information. */ - location: Schema$SourceLocation; -} -/** - * Represents a contextual status message. The message can indicate an error or - * informational status, and refer to specific parts of the containing object. - * For example, the `Breakpoint.status` field can indicate an error referring to - * the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`. - */ -export interface Schema$StatusMessage { + export interface Schema$GetBreakpointResponse { + /** + * Complete breakpoint state. The fields `id` and `location` are guaranteed + * to be set. + */ + breakpoint: Schema$Breakpoint; + } /** - * Status message text. - */ - description: Schema$FormatMessage; + * A GitSourceContext denotes a particular revision in a third party Git + * repository (e.g. GitHub). + */ + export interface Schema$GitSourceContext { + /** + * Git commit hash. required. + */ + revisionId: string; + /** + * Git repository URL. + */ + url: string; + } /** - * Distinguishes errors from informational messages. - */ - isError: boolean; + * Response for listing active breakpoints. + */ + export interface Schema$ListActiveBreakpointsResponse { + /** + * List of all active breakpoints. The fields `id` and `location` are + * guaranteed to be set on each breakpoint. + */ + breakpoints: Schema$Breakpoint[]; + /** + * A token that can be used in the next method call to block until the list + * of breakpoints changes. + */ + nextWaitToken: string; + /** + * If set to `true`, indicates that there is no change to the list of active + * breakpoints and the server-selected timeout has expired. The + * `breakpoints` field would be empty and should be ignored. + */ + waitExpired: boolean; + } /** - * Reference to which the message applies. - */ - refersTo: string; -} -/** - * Request to update an active breakpoint. - */ -export interface Schema$UpdateActiveBreakpointRequest { + * Response for listing breakpoints. + */ + export interface Schema$ListBreakpointsResponse { + /** + * List of breakpoints matching the request. The fields `id` and `location` + * are guaranteed to be set on each breakpoint. The fields: `stack_frames`, + * `evaluated_expressions` and `variable_table` are cleared on each + * breakpoint regardless of its status. + */ + breakpoints: Schema$Breakpoint[]; + /** + * A wait token that can be used in the next call to `list` (REST) or + * `ListBreakpoints` (RPC) to block until the list of breakpoints has + * changes. + */ + nextWaitToken: string; + } /** - * Updated breakpoint information. The field `id` must be set. The agent must - * echo all Breakpoint specification fields in the update. + * Response for listing debuggees. */ - breakpoint: Schema$Breakpoint; -} -/** - * Response for updating an active breakpoint. The message is defined to allow - * future extensions. - */ -export interface Schema$UpdateActiveBreakpointResponse {} -/** - * Represents a variable or an argument possibly of a compound object type. Note - * how the following variables are represented: 1) A simple variable: int - * x = 5 { name: "x", value: "5", type: "int" - * } // Captured variable 2) A compound object: struct T { int - * m1; int m2; }; T x = { 3, 7 }; { // Captured variable - * name: "x", type: "T", members { name: - * "m1", value: "3", type: "int" }, members { - * name: "m2", value: "7", type: "int" } } 3) - * A pointer where the pointee was captured: T x = { 3, 7 }; T* p = - * &x; { // Captured variable name: "p", type: - * "T*", value: "0x00500500", members { - * name: "m1", value: "3", type: "int" }, members - * { name: "m2", value: "7", type: "int" } } - * 4) A pointer where the pointee was not captured: T* p = new T; { // - * Captured variable name: "p", type: "T*", - * value: "0x00400400" status { is_error: true, description { - * format: "unavailable" } } } The status should describe the - * reason for the missing value, such as `<optimized out>`, - * `<inaccessible>`, `<pointers limit reached>`. Note that a null - * pointer should not have members. 5) An unnamed value: int* p = new - * int(7); { // Captured variable name: "p", value: - * "0x00500500", type: "int*", members { - * value: "7", type: "int" } } 6) An unnamed pointer where - * the pointee was not captured: int* p = new int(7); int** pp = - * &p; { // Captured variable name: "pp", value: - * "0x00500500", type: "int**", members { - * value: "0x00400400", type: "int*" status { - * is_error: true, description: { format: - * "unavailable" } } } } } To optimize - * computation, memory and network traffic, variables that repeat in the output - * multiple times can be stored once in a shared variable table and be - * referenced using the `var_table_index` field. The variables stored in the - * shared table are nameless and are essentially a partition of the complete - * variable. To reconstruct the complete variable, merge the referencing - * variable with the referenced variable. When using the shared variable table, - * the following variables: T x = { 3, 7 }; T* p = &x; T& r - * = x; { name: "x", var_table_index: 3, type: "T" } // - * Captured variables { name: "p", value "0x00500500", - * type="T*", var_table_index: 3 } { name: "r", - * type="T&", var_table_index: 3 } { // Shared variable - * table entry #3: members { name: "m1", value: "3", - * type: "int" }, members { name: "m2", value: - * "7", type: "int" } } Note that the pointer address - * is stored with the referencing variable and not with the referenced variable. - * This allows the referenced variable to be shared between pointers and - * references. The type field is optional. The debugger agent may or may not - * support it. - */ -export interface Schema$Variable { + export interface Schema$ListDebuggeesResponse { + /** + * List of debuggees accessible to the calling user. The fields + * `debuggee.id` and `description` are guaranteed to be set. The + * `description` field is a human readable field provided by agents and can + * be displayed to users. + */ + debuggees: Schema$Debuggee[]; + } /** - * Members contained or pointed to by the variable. - */ - members: Schema$Variable[]; + * Selects a repo using a Google Cloud Platform project ID (e.g. + * winged-cargo-31) and a repo name within that project. + */ + export interface Schema$ProjectRepoId { + /** + * The ID of the project. + */ + projectId: string; + /** + * The name of the repo. Leave empty for the default repo. + */ + repoName: string; + } /** - * Name of the variable, if any. + * Request to register a debuggee. */ - name: string; + export interface Schema$RegisterDebuggeeRequest { + /** + * Debuggee information to register. The fields `project`, `uniquifier`, + * `description` and `agent_version` of the debuggee must be set. + */ + debuggee: Schema$Debuggee; + } /** - * Status associated with the variable. This field will usually stay unset. A - * status of a single variable only applies to that variable or expression. - * The rest of breakpoint data still remains valid. Variables might be - * reported in error state even when breakpoint is not in final state. The - * message may refer to variable name with `refers_to` set to `VARIABLE_NAME`. - * Alternatively `refers_to` will be set to `VARIABLE_VALUE`. In either case - * variable value and members will be unset. Example of error message applied - * to name: `Invalid expression syntax`. Example of information message - * applied to value: `Not captured`. Examples of error message applied to - * value: * `Malformed string`, * `Field f not found in class C` * `Null - * pointer dereference` - */ - status: Schema$StatusMessage; + * Response for registering a debuggee. + */ + export interface Schema$RegisterDebuggeeResponse { + /** + * Debuggee resource. The field `id` is guranteed to be set (in addition to + * the echoed fields). If the field `is_disabled` is set to `true`, the + * agent should disable itself by removing all breakpoints and detaching + * from the application. It should however continue to poll + * `RegisterDebuggee` until reenabled. + */ + debuggee: Schema$Debuggee; + } /** - * Variable type (e.g. `MyClass`). If the variable is split with - * `var_table_index`, `type` goes next to `value`. The interpretation of a - * type is agent specific. It is recommended to include the dynamic type - * rather than a static type of an object. - */ - type: string; + * A unique identifier for a cloud repo. + */ + export interface Schema$RepoId { + /** + * A combination of a project ID and a repo name. + */ + projectRepoId: Schema$ProjectRepoId; + /** + * A server-assigned, globally unique identifier. + */ + uid: string; + } /** - * Simple value of the variable. + * Response for setting a breakpoint. */ - value: string; + export interface Schema$SetBreakpointResponse { + /** + * Breakpoint resource. The field `id` is guaranteed to be set (in addition + * to the echoed fileds). + */ + breakpoint: Schema$Breakpoint; + } /** - * Reference to a variable in the shared variable table. More than one - * variable can reference the same variable in the table. The - * `var_table_index` field is an index into `variable_table` in Breakpoint. - */ - varTableIndex: number; -} - -export class Resource$Controller { - root: Clouddebugger; - debuggees: Resource$Controller$Debuggees; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); - this.debuggees = new Resource$Controller$Debuggees(root); + * A SourceContext is a reference to a tree of files. A SourceContext together + * with a path point to a unique revision of a single file or directory. + */ + export interface Schema$SourceContext { + /** + * A SourceContext referring to a revision in a cloud repo. + */ + cloudRepo: Schema$CloudRepoSourceContext; + /** + * A SourceContext referring to a snapshot in a cloud workspace. + */ + cloudWorkspace: Schema$CloudWorkspaceSourceContext; + /** + * A SourceContext referring to a Gerrit project. + */ + gerrit: Schema$GerritSourceContext; + /** + * A SourceContext referring to any third party Git repo (e.g. GitHub). + */ + git: Schema$GitSourceContext; } - - getRoot() { - return this.root; + /** + * Represents a location in the source code. + */ + export interface Schema$SourceLocation { + /** + * Line inside the file. The first line in the file has the value `1`. + */ + line: number; + /** + * Path to the source file within the source context of the target binary. + */ + path: string; } -} -export class Resource$Controller$Debuggees { - root: Clouddebugger; - breakpoints: Resource$Controller$Debuggees$Breakpoints; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); - this.breakpoints = new Resource$Controller$Debuggees$Breakpoints(root); + /** + * Represents a stack frame context. + */ + export interface Schema$StackFrame { + /** + * Set of arguments passed to this function. Note that this might not be + * populated for all stack frames. + */ + arguments: Schema$Variable[]; + /** + * Demangled function name at the call site. + */ + function: string; + /** + * Set of local variables at the stack frame location. Note that this might + * not be populated for all stack frames. + */ + locals: Schema$Variable[]; + /** + * Source location of the call site. + */ + location: Schema$SourceLocation; } - - getRoot() { - return this.root; + /** + * Represents a contextual status message. The message can indicate an error + * or informational status, and refer to specific parts of the containing + * object. For example, the `Breakpoint.status` field can indicate an error + * referring to the `BREAKPOINT_SOURCE_LOCATION` with the message `Location + * not found`. + */ + export interface Schema$StatusMessage { + /** + * Status message text. + */ + description: Schema$FormatMessage; + /** + * Distinguishes errors from informational messages. + */ + isError: boolean; + /** + * Reference to which the message applies. + */ + refersTo: string; } - - /** - * clouddebugger.controller.debuggees.register - * @desc Registers the debuggee with the controller service. All agents - * attached to the same application must call this method with exactly the - * same request content to get back the same stable `debuggee_id`. Agents - * should call this method again whenever `google.rpc.Code.NOT_FOUND` is - * returned from any controller method. This protocol allows the controller - * service to disable debuggees, recover from data loss, or change the - * `debuggee_id` format. Agents must handle `debuggee_id` value changing upon - * re-registration. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudDebugger.controller.debuggees.register(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.controller.debuggees.register - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().RegisterDebuggeeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request to update an active breakpoint. */ - register(params?: any, options?: MethodOptions): - AxiosPromise; - register( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - register( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/controller/debuggees/register') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Controller$Debuggees$Breakpoints { - root: Clouddebugger; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$UpdateActiveBreakpointRequest { + /** + * Updated breakpoint information. The field `id` must be set. The agent + * must echo all Breakpoint specification fields in the update. + */ + breakpoint: Schema$Breakpoint; } - - getRoot() { - return this.root; + /** + * Response for updating an active breakpoint. The message is defined to allow + * future extensions. + */ + export interface Schema$UpdateActiveBreakpointResponse {} + /** + * Represents a variable or an argument possibly of a compound object type. + * Note how the following variables are represented: 1) A simple variable: + * int x = 5 { name: "x", value: "5", type: + * "int" } // Captured variable 2) A compound object: struct + * T { int m1; int m2; }; T x = { 3, 7 }; { // + * Captured variable name: "x", type: "T", + * members { name: "m1", value: "3", type: "int" + * }, members { name: "m2", value: "7", type: + * "int" } } 3) A pointer where the pointee was captured: T x = + * { 3, 7 }; T* p = &x; { // Captured variable name: + * "p", type: "T*", value: + * "0x00500500", members { name: "m1", value: + * "3", type: "int" }, members { name: + * "m2", value: "7", type: "int" } } 4) A + * pointer where the pointee was not captured: T* p = new T; { // + * Captured variable name: "p", type: + * "T*", value: "0x00400400" status { + * is_error: true, description { format: "unavailable" } } } The + * status should describe the reason for the missing value, such as + * `<optimized out>`, `<inaccessible>`, `<pointers limit + * reached>`. Note that a null pointer should not have members. 5) An + * unnamed value: int* p = new int(7); { // Captured variable + * name: "p", value: "0x00500500", type: + * "int*", members { value: "7", type: + * "int" } } 6) An unnamed pointer where the pointee was not + * captured: int* p = new int(7); int** pp = &p; { // + * Captured variable name: "pp", value: + * "0x00500500", type: "int**", members { + * value: "0x00400400", type: "int*" status { + * is_error: true, description: { format: + * "unavailable" } } } } } To optimize + * computation, memory and network traffic, variables that repeat in the + * output multiple times can be stored once in a shared variable table and be + * referenced using the `var_table_index` field. The variables stored in the + * shared table are nameless and are essentially a partition of the complete + * variable. To reconstruct the complete variable, merge the referencing + * variable with the referenced variable. When using the shared variable + * table, the following variables: T x = { 3, 7 }; T* p = &x; + * T& r = x; { name: "x", var_table_index: 3, type: + * "T" } // Captured variables { name: "p", value + * "0x00500500", type="T*", var_table_index: 3 } { + * name: "r", type="T&", var_table_index: 3 } { + * // Shared variable table entry #3: members { name: "m1", + * value: "3", type: "int" }, members { name: + * "m2", value: "7", type: "int" } } Note + * that the pointer address is stored with the referencing variable and not + * with the referenced variable. This allows the referenced variable to be + * shared between pointers and references. The type field is optional. The + * debugger agent may or may not support it. + */ + export interface Schema$Variable { + /** + * Members contained or pointed to by the variable. + */ + members: Schema$Variable[]; + /** + * Name of the variable, if any. + */ + name: string; + /** + * Status associated with the variable. This field will usually stay unset. + * A status of a single variable only applies to that variable or + * expression. The rest of breakpoint data still remains valid. Variables + * might be reported in error state even when breakpoint is not in final + * state. The message may refer to variable name with `refers_to` set to + * `VARIABLE_NAME`. Alternatively `refers_to` will be set to + * `VARIABLE_VALUE`. In either case variable value and members will be + * unset. Example of error message applied to name: `Invalid expression + * syntax`. Example of information message applied to value: `Not + * captured`. Examples of error message applied to value: * `Malformed + * string`, * `Field f not found in class C` * `Null pointer + * dereference` + */ + status: Schema$StatusMessage; + /** + * Variable type (e.g. `MyClass`). If the variable is split with + * `var_table_index`, `type` goes next to `value`. The interpretation of a + * type is agent specific. It is recommended to include the dynamic type + * rather than a static type of an object. + */ + type: string; + /** + * Simple value of the variable. + */ + value: string; + /** + * Reference to a variable in the shared variable table. More than one + * variable can reference the same variable in the table. The + * `var_table_index` field is an index into `variable_table` in Breakpoint. + */ + varTableIndex: number; } + export class Resource$Controller { + root: Clouddebugger; + debuggees: Resource$Controller$Debuggees; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); + this.debuggees = new Resource$Controller$Debuggees(root); + } - /** - * clouddebugger.controller.debuggees.breakpoints.list - * @desc Returns the list of all active breakpoints for the debuggee. The - * breakpoint specification (`location`, `condition`, and `expressions` - * fields) is semantically immutable, although the field values may change. - * For example, an agent may update the location line number to reflect the - * actual line where the breakpoint was set, but this doesn't change the - * breakpoint semantics. This means that an agent does not need to check if a - * breakpoint has changed when it encounters the same breakpoint on a - * successive call. Moreover, an agent should remember the breakpoints that - * are completed until the controller removes them from the active list to - * avoid setting those breakpoints again. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the debuggee. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudDebugger.controller.debuggees.breakpoints.list(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.controller.debuggees.breakpoints.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.debuggeeId Identifies the debuggee. - * @param {boolean=} params.successOnTimeout If set to `true` (recommended), returns `google.rpc.Code.OK` status and sets the `wait_expired` response field to `true` when the server-selected timeout has expired. If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status when the server-selected timeout has expired. - * @param {string=} params.waitToken A token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server-selected timeout has expired. The value should be set from the `next_wait_token` field in the last response. The initial value should be set to `"init"`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Controller$Debuggees { + root: Clouddebugger; + breakpoints: Resource$Controller$Debuggees$Breakpoints; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); + this.breakpoints = new Resource$Controller$Debuggees$Breakpoints(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/controller/debuggees/{debuggeeId}/breakpoints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['debuggeeId'], - pathParams: ['debuggeeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * clouddebugger.controller.debuggees.breakpoints.update - * @desc Updates the breakpoint state or mutable fields. The entire Breakpoint - * message must be sent back to the controller service. Updates to active - * breakpoint fields are only allowed if the new value does not change the - * breakpoint specification. Updates to the `location`, `condition` and - * `expressions` fields should not alter the breakpoint semantics. These may - * only make changes such as canonicalizing a value or snapping the location - * to the correct line of code. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the debuggee being debugged. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * // Breakpoint identifier, unique in the scope of the debuggee. - * id: 'my-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudDebugger.controller.debuggees.breakpoints.update(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.controller.debuggees.breakpoints.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.debuggeeId Identifies the debuggee being debugged. - * @param {string} params.id Breakpoint identifier, unique in the scope of the debuggee. - * @param {().UpdateActiveBreakpointRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * clouddebugger.controller.debuggees.register + * @desc Registers the debuggee with the controller service. All agents + * attached to the same application must call this method with exactly the + * same request content to get back the same stable `debuggee_id`. Agents + * should call this method again whenever `google.rpc.Code.NOT_FOUND` is + * returned from any controller method. This protocol allows the controller + * service to disable debuggees, recover from data loss, or change the + * `debuggee_id` format. Agents must handle `debuggee_id` value changing + * upon re-registration. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudDebugger.controller.debuggees.register(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.controller.debuggees.register + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().RegisterDebuggeeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + register(params?: any, options?: MethodOptions): + AxiosPromise; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/controller/debuggees/register') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Controller$Debuggees$Breakpoints { + root: Clouddebugger; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2/controller/debuggees/{debuggeeId}/breakpoints/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['debuggeeId', 'id'], - pathParams: ['debuggeeId', 'id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} + /** + * clouddebugger.controller.debuggees.breakpoints.list + * @desc Returns the list of all active breakpoints for the debuggee. The + * breakpoint specification (`location`, `condition`, and `expressions` + * fields) is semantically immutable, although the field values may change. + * For example, an agent may update the location line number to reflect the + * actual line where the breakpoint was set, but this doesn't change the + * breakpoint semantics. This means that an agent does not need to check if + * a breakpoint has changed when it encounters the same breakpoint on a + * successive call. Moreover, an agent should remember the breakpoints that + * are completed until the controller removes them from the active list to + * avoid setting those breakpoints again. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the debuggee. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudDebugger.controller.debuggees.breakpoints.list(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.controller.debuggees.breakpoints.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.debuggeeId Identifies the debuggee. + * @param {boolean=} params.successOnTimeout If set to `true` (recommended), returns `google.rpc.Code.OK` status and sets the `wait_expired` response field to `true` when the server-selected timeout has expired. If set to `false` (deprecated), returns `google.rpc.Code.ABORTED` status when the server-selected timeout has expired. + * @param {string=} params.waitToken A token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server-selected timeout has expired. The value should be set from the `next_wait_token` field in the last response. The initial value should be set to `"init"`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2/controller/debuggees/{debuggeeId}/breakpoints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['debuggeeId'], + pathParams: ['debuggeeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } -export class Resource$Debugger { - root: Clouddebugger; - debuggees: Resource$Debugger$Debuggees; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); - this.debuggees = new Resource$Debugger$Debuggees(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Debugger$Debuggees { - root: Clouddebugger; - breakpoints: Resource$Debugger$Debuggees$Breakpoints; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); - this.breakpoints = new Resource$Debugger$Debuggees$Breakpoints(root); + /** + * clouddebugger.controller.debuggees.breakpoints.update + * @desc Updates the breakpoint state or mutable fields. The entire + * Breakpoint message must be sent back to the controller service. Updates + * to active breakpoint fields are only allowed if the new value does not + * change the breakpoint specification. Updates to the `location`, + * `condition` and `expressions` fields should not alter the breakpoint + * semantics. These may only make changes such as canonicalizing a value or + * snapping the location to the correct line of code. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the debuggee being debugged. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * // Breakpoint identifier, unique in the scope of the debuggee. + * id: 'my-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * cloudDebugger.controller.debuggees.breakpoints.update(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.controller.debuggees.breakpoints.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.debuggeeId Identifies the debuggee being debugged. + * @param {string} params.id Breakpoint identifier, unique in the scope of the debuggee. + * @param {().UpdateActiveBreakpointRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2/controller/debuggees/{debuggeeId}/breakpoints/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['debuggeeId', 'id'], + pathParams: ['debuggeeId', 'id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; - } - /** - * clouddebugger.debugger.debuggees.list - * @desc Lists all the debuggees that the user has access to. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * cloudDebugger.debugger.debuggees.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.debugger.debuggees.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). - * @param {boolean=} params.includeInactive When set to `true`, the result includes all debuggees. Otherwise, the result includes only debuggees that are active. - * @param {string=} params.project Project number of a Google Cloud project whose debuggees to list. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Debugger { + root: Clouddebugger; + debuggees: Resource$Debugger$Debuggees; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); + this.debuggees = new Resource$Debugger$Debuggees(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/debugger/debuggees') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Debugger$Debuggees$Breakpoints { - root: Clouddebugger; - constructor(root: Clouddebugger) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Debugger$Debuggees { + root: Clouddebugger; + breakpoints: Resource$Debugger$Debuggees$Breakpoints; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); + this.breakpoints = new Resource$Debugger$Debuggees$Breakpoints(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * clouddebugger.debugger.debuggees.breakpoints.delete - * @desc Deletes the breakpoint from the debuggee. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoint to delete. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * // ID of the breakpoint to delete. - * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudDebugger.debugger.debuggees.breakpoints.delete(request, - * function(err) { if (err) { console.error(err); return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.debugger.debuggees.breakpoints.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.breakpointId ID of the breakpoint to delete. - * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). - * @param {string} params.debuggeeId ID of the debuggee whose breakpoint to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * clouddebugger.debugger.debuggees.list + * @desc Lists all the debuggees that the user has access to. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * cloudDebugger.debugger.debuggees.list(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.debugger.debuggees.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * @param {boolean=} params.includeInactive When set to `true`, the result includes all debuggees. Otherwise, the result includes only debuggees that are active. + * @param {string=} params.project Project number of a Google Cloud project whose debuggees to list. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/debugger/debuggees') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Debugger$Debuggees$Breakpoints { + root: Clouddebugger; + constructor(root: Clouddebugger) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['debuggeeId', 'breakpointId'], - pathParams: ['breakpointId', 'debuggeeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * clouddebugger.debugger.debuggees.breakpoints.get - * @desc Gets breakpoint information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoint to get. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * // ID of the breakpoint to get. - * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudDebugger.debugger.debuggees.breakpoints.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.debugger.debuggees.breakpoints.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.breakpointId ID of the breakpoint to get. - * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). - * @param {string} params.debuggeeId ID of the debuggee whose breakpoint to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * clouddebugger.debugger.debuggees.breakpoints.delete + * @desc Deletes the breakpoint from the debuggee. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the debuggee whose breakpoint to delete. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * // ID of the breakpoint to delete. + * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudDebugger.debugger.debuggees.breakpoints.delete(request, + * function(err) { if (err) { console.error(err); return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.debugger.debuggees.breakpoints.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.breakpointId ID of the breakpoint to delete. + * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * @param {string} params.debuggeeId ID of the debuggee whose breakpoint to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['debuggeeId', 'breakpointId'], + pathParams: ['breakpointId', 'debuggeeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['debuggeeId', 'breakpointId'], - pathParams: ['breakpointId', 'debuggeeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * clouddebugger.debugger.debuggees.breakpoints.list - * @desc Lists all breakpoints for the debuggee. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee whose breakpoints to list. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudDebugger.debugger.debuggees.breakpoints.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.debugger.debuggees.breakpoints.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.action.value Only breakpoints with the specified action will pass the filter. - * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). - * @param {string} params.debuggeeId ID of the debuggee whose breakpoints to list. - * @param {boolean=} params.includeAllUsers When set to `true`, the response includes the list of breakpoints set by any user. Otherwise, it includes only breakpoints set by the caller. - * @param {boolean=} params.includeInactive When set to `true`, the response includes active and inactive breakpoints. Otherwise, it includes only active breakpoints. - * @param {boolean=} params.stripResults This field is deprecated. The following fields are always stripped out of the result: `stack_frames`, `evaluated_expressions` and `variable_table`. - * @param {string=} params.waitToken A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response. The error code `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which should be called again with the same `wait_token`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * clouddebugger.debugger.debuggees.breakpoints.get + * @desc Gets breakpoint information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the debuggee whose breakpoint to get. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * // ID of the breakpoint to get. + * breakpointId: 'my-breakpoint-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudDebugger.debugger.debuggees.breakpoints.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.debugger.debuggees.breakpoints.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.breakpointId ID of the breakpoint to get. + * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * @param {string} params.debuggeeId ID of the debuggee whose breakpoint to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['debuggeeId', 'breakpointId'], + pathParams: ['breakpointId', 'debuggeeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/debugger/debuggees/{debuggeeId}/breakpoints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['debuggeeId'], - pathParams: ['debuggeeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * clouddebugger.debugger.debuggees.breakpoints.set - * @desc Sets the breakpoint to the debuggee. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Debugger API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/clouddebugger - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudDebugger = google.clouddebugger('v2'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the debuggee where the breakpoint is to be set. - * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudDebugger.debugger.debuggees.breakpoints.set(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias clouddebugger.debugger.debuggees.breakpoints.set - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). - * @param {string} params.debuggeeId ID of the debuggee where the breakpoint is to be set. - * @param {().Breakpoint} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - set(params?: any, - options?: MethodOptions): AxiosPromise; - set(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - set(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * clouddebugger.debugger.debuggees.breakpoints.list + * @desc Lists all breakpoints for the debuggee. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the debuggee whose breakpoints to list. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudDebugger.debugger.debuggees.breakpoints.list(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.debugger.debuggees.breakpoints.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.action.value Only breakpoints with the specified action will pass the filter. + * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * @param {string} params.debuggeeId ID of the debuggee whose breakpoints to list. + * @param {boolean=} params.includeAllUsers When set to `true`, the response includes the list of breakpoints set by any user. Otherwise, it includes only breakpoints set by the caller. + * @param {boolean=} params.includeInactive When set to `true`, the response includes active and inactive breakpoints. Otherwise, it includes only active breakpoints. + * @param {boolean=} params.stripResults This field is deprecated. The following fields are always stripped out of the result: `stack_frames`, `evaluated_expressions` and `variable_table`. + * @param {string=} params.waitToken A wait token that, if specified, blocks the call until the breakpoints list has changed, or a server selected timeout has expired. The value should be set from the last response. The error code `google.rpc.Code.ABORTED` (RPC) is returned on wait timeout, which should be called again with the same `wait_token`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/debugger/debuggees/{debuggeeId}/breakpoints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['debuggeeId'], + pathParams: ['debuggeeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://clouddebugger.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v2/debugger/debuggees/{debuggeeId}/breakpoints/set') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['debuggeeId'], - pathParams: ['debuggeeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * clouddebugger.debugger.debuggees.breakpoints.set + * @desc Sets the breakpoint to the debuggee. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Debugger API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/clouddebugger + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudDebugger = google.clouddebugger('v2'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the debuggee where the breakpoint is to be set. + * debuggeeId: 'my-debuggee-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudDebugger.debugger.debuggees.breakpoints.set(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias clouddebugger.debugger.debuggees.breakpoints.set + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientVersion The client version making the call. Schema: `domain/type/version` (e.g., `google.com/intellij/v1`). + * @param {string} params.debuggeeId ID of the debuggee where the breakpoint is to be set. + * @param {().Breakpoint} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + set(params?: any, + options?: MethodOptions): AxiosPromise; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouddebugger.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v2/debugger/debuggees/{debuggeeId}/breakpoints/set') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['debuggeeId'], + pathParams: ['debuggeeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/clouderrorreporting/v1beta1.ts b/src/apis/clouderrorreporting/v1beta1.ts index 6f6c7834929..3b91020c3b4 100644 --- a/src/apis/clouderrorreporting/v1beta1.ts +++ b/src/apis/clouderrorreporting/v1beta1.ts @@ -27,807 +27,814 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Error Reporting API - * - * Groups and counts similar errors from cloud services and applications, - * reports new errors, and provides access to error groups and their associated - * errors. - * - * @example - * const google = require('googleapis'); - * const clouderrorreporting = google.clouderrorreporting('v1beta1'); - * - * @namespace clouderrorreporting - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Clouderrorreporting - */ -export class Clouderrorreporting { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace clouderrorreporting_v1beta1 { + /** + * Stackdriver Error Reporting API + * + * Groups and counts similar errors from cloud services and applications, + * reports new errors, and provides access to error groups and their + * associated errors. + * + * @example + * const google = require('googleapis'); + * const clouderrorreporting = google.clouderrorreporting('v1beta1'); + * + * @namespace clouderrorreporting + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Clouderrorreporting + */ + export class Clouderrorreporting { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Response message for deleting error events. - */ -export interface Schema$DeleteEventsResponse {} -/** - * A description of the context in which an error occurred. This data should be - * provided by the application when reporting an error, unless the error report - * has been generated automatically from Google App Engine logs. - */ -export interface Schema$ErrorContext { - /** - * The HTTP request which was processed when the error was triggered. - */ - httpRequest: Schema$HttpRequestContext; - /** - * The location in the source code where the decision was made to report the - * error, usually the place where it was logged. For a logged exception this - * would be the source line where the exception is logged, usually close to - * the place where it was caught. - */ - reportLocation: Schema$SourceLocation; - /** - * Source code that was used to build the executable which has caused the - * given error message. - */ - sourceReferences: Schema$SourceReference[]; - /** - * The user who caused or was affected by the crash. This can be a user ID, an - * email address, or an arbitrary token that uniquely identifies the user. - * When sending an error report, leave this field empty if the user was not - * logged in. In this case the Error Reporting system will use other data, - * such as remote IP address, to distinguish affected users. See - * `affected_users_count` in `ErrorGroupStats`. - */ - user: string; -} -/** - * An error event which is returned by the Error Reporting system. - */ -export interface Schema$ErrorEvent { - /** - * Data about the context in which the error occurred. - */ - context: Schema$ErrorContext; - /** - * Time when the event occurred as provided in the error report. If the report - * did not contain a timestamp, the time the error was received by the Error - * Reporting system is used. - */ - eventTime: string; - /** - * The stack trace that was reported or logged by the service. - */ - message: string; - /** - * The `ServiceContext` for which this error was reported. - */ - serviceContext: Schema$ServiceContext; -} -/** - * Description of a group of similar error events. - */ -export interface Schema$ErrorGroup { - /** - * Group IDs are unique for a given project. If the same kind of error occurs - * in different service contexts, it will receive the same group ID. - */ - groupId: string; - /** - * The group resource name. Example: - * <code>projects/my-project-123/groups/my-groupid</code> - */ - name: string; - /** - * Associated tracking issues. - */ - trackingIssues: Schema$TrackingIssue[]; -} -/** - * Data extracted for a specific group based on certain filter criteria, such as - * a given time period and/or service filter. - */ -export interface Schema$ErrorGroupStats { - /** - * Service contexts with a non-zero error count for the given filter criteria. - * This list can be truncated if multiple services are affected. Refer to - * `num_affected_services` for the total count. - */ - affectedServices: Schema$ServiceContext[]; - /** - * Approximate number of affected users in the given group that match the - * filter criteria. Users are distinguished by data in the `ErrorContext` of - * the individual error events, such as their login name or their remote IP - * address in case of HTTP requests. The number of affected users can be zero - * even if the number of errors is non-zero if no data was provided from which - * the affected user could be deduced. Users are counted based on data in the - * request context that was provided in the error report. If more users are - * implicitly affected, such as due to a crash of the whole service, this is - * not reflected here. - */ - affectedUsersCount: string; - /** - * Approximate total number of events in the given group that match the filter - * criteria. - */ - count: string; - /** - * Approximate first occurrence that was ever seen for this group and which - * matches the given filter criteria, ignoring the time_range that was - * specified in the request. - */ - firstSeenTime: string; - /** - * Group data that is independent of the filter criteria. - */ - group: Schema$ErrorGroup; - /** - * Approximate last occurrence that was ever seen for this group and which - * matches the given filter criteria, ignoring the time_range that was - * specified in the request. - */ - lastSeenTime: string; - /** - * The total number of services with a non-zero error count for the given - * filter criteria. - */ - numAffectedServices: number; - /** - * An arbitrary event that is chosen as representative for the whole group. - * The representative event is intended to be used as a quick preview for the - * whole group. Events in the group are usually sufficiently similar to each - * other such that showing an arbitrary representative provides insight into - * the characteristics of the group as a whole. - */ - representative: Schema$ErrorEvent; - /** - * Approximate number of occurrences over time. Timed counts returned by - * ListGroups are guaranteed to be: - Inside the requested time interval - - * Non-overlapping, and - Ordered by ascending time. - */ - timedCounts: Schema$TimedCount[]; -} -/** - * HTTP request data that is related to a reported error. This data should be - * provided by the application when reporting an error, unless the error report - * has been generated automatically from Google App Engine logs. - */ -export interface Schema$HttpRequestContext { - /** - * The type of HTTP request, such as `GET`, `POST`, etc. - */ - method: string; - /** - * The referrer information that is provided with the request. - */ - referrer: string; - /** - * The IP address from which the request originated. This can be IPv4, IPv6, - * or a token which is derived from the IP address, depending on the data that - * has been provided in the error report. - */ - remoteIp: string; - /** - * The HTTP response status code for the request. - */ - responseStatusCode: number; - /** - * The URL of the request. - */ - url: string; - /** - * The user agent information that is provided with the request. - */ - userAgent: string; -} -/** - * Contains a set of requested error events. - */ -export interface Schema$ListEventsResponse { - /** - * The error events which match the given request. - */ - errorEvents: Schema$ErrorEvent[]; - /** - * If non-empty, more results are available. Pass this token, along with the - * same query parameters as the first request, to view the next page of - * results. - */ - nextPageToken: string; - /** - * The timestamp specifies the start time to which the request was restricted. - */ - timeRangeBegin: string; -} -/** - * Contains a set of requested error group stats. - */ -export interface Schema$ListGroupStatsResponse { - /** - * The error group stats which match the given request. - */ - errorGroupStats: Schema$ErrorGroupStats[]; - /** - * If non-empty, more results are available. Pass this token, along with the - * same query parameters as the first request, to view the next page of - * results. - */ - nextPageToken: string; - /** - * The timestamp specifies the start time to which the request was restricted. - * The start time is set based on the requested time range. It may be adjusted - * to a later time if a project has exceeded the storage quota and older data - * has been deleted. - */ - timeRangeBegin: string; -} -/** - * An error event which is reported to the Error Reporting system. - */ -export interface Schema$ReportedErrorEvent { - /** - * [Optional] A description of the context in which the error occurred. - */ - context: Schema$ErrorContext; - /** - * [Optional] Time when the event occurred. If not provided, the time when the - * event was received by the Error Reporting system will be used. - */ - eventTime: string; - /** - * [Required] The error message. If no `context.reportLocation` is provided, - * the message must contain a header (typically consisting of the exception - * type name and an error message) and an exception stack trace in one of the - * supported programming languages and formats. Supported languages are Java, - * Python, JavaScript, Ruby, C#, PHP, and Go. Supported stack trace formats - * are: * **Java**: Must be the return value of - * [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). - * * **Python**: Must be the return value of - * [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). - * * **JavaScript**: Must be the value of - * [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) as returned - * by V8. * **Ruby**: Must contain frames returned by - * [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). - * * **C#**: Must be the return value of - * [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). - * * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)` - * and contain the result of - * [`(string)$exception`](http://php.net/manual/en/exception.tostring.php). * - * **Go**: Must be the return value of - * [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). - */ - message: string; /** - * [Required] The service context in which this error has occurred. - */ - serviceContext: Schema$ServiceContext; -} -/** - * Response for reporting an individual error event. Data may be added to this - * message in the future. - */ -export interface Schema$ReportErrorEventResponse {} -/** - * Describes a running service that sends errors. Its version changes over time - * and multiple versions can run in parallel. - */ -export interface Schema$ServiceContext { + * Response message for deleting error events. + */ + export interface Schema$DeleteEventsResponse {} + /** + * A description of the context in which an error occurred. This data should + * be provided by the application when reporting an error, unless the error + * report has been generated automatically from Google App Engine logs. + */ + export interface Schema$ErrorContext { + /** + * The HTTP request which was processed when the error was triggered. + */ + httpRequest: Schema$HttpRequestContext; + /** + * The location in the source code where the decision was made to report the + * error, usually the place where it was logged. For a logged exception this + * would be the source line where the exception is logged, usually close to + * the place where it was caught. + */ + reportLocation: Schema$SourceLocation; + /** + * Source code that was used to build the executable which has caused the + * given error message. + */ + sourceReferences: Schema$SourceReference[]; + /** + * The user who caused or was affected by the crash. This can be a user ID, + * an email address, or an arbitrary token that uniquely identifies the + * user. When sending an error report, leave this field empty if the user + * was not logged in. In this case the Error Reporting system will use other + * data, such as remote IP address, to distinguish affected users. See + * `affected_users_count` in `ErrorGroupStats`. + */ + user: string; + } /** - * Type of the MonitoredResource. List of possible values: - * https://cloud.google.com/monitoring/api/resources Value is set - * automatically for incoming errors and must not be set when reporting - * errors. - */ - resourceType: string; + * An error event which is returned by the Error Reporting system. + */ + export interface Schema$ErrorEvent { + /** + * Data about the context in which the error occurred. + */ + context: Schema$ErrorContext; + /** + * Time when the event occurred as provided in the error report. If the + * report did not contain a timestamp, the time the error was received by + * the Error Reporting system is used. + */ + eventTime: string; + /** + * The stack trace that was reported or logged by the service. + */ + message: string; + /** + * The `ServiceContext` for which this error was reported. + */ + serviceContext: Schema$ServiceContext; + } /** - * An identifier of the service, such as the name of the executable, job, or - * Google App Engine service name. This field is expected to have a low number - * of values that are relatively stable over time, as opposed to `version`, - * which can be changed whenever new code is deployed. Contains the service - * name for error reports extracted from Google App Engine logs or `default` - * if the App Engine default service is used. - */ - service: string; + * Description of a group of similar error events. + */ + export interface Schema$ErrorGroup { + /** + * Group IDs are unique for a given project. If the same kind of error + * occurs in different service contexts, it will receive the same group ID. + */ + groupId: string; + /** + * The group resource name. Example: + * <code>projects/my-project-123/groups/my-groupid</code> + */ + name: string; + /** + * Associated tracking issues. + */ + trackingIssues: Schema$TrackingIssue[]; + } /** - * Represents the source code version that the developer provided, which could - * represent a version label or a Git SHA-1 hash, for example. For App Engine - * standard environment, the version is set to the version of the app. - */ - version: string; -} -/** - * Indicates a location in the source code of the service for which errors are - * reported. `functionName` must be provided by the application when reporting - * an error, unless the error report contains a `message` with a supported - * exception stack trace. All fields are optional for the later case. - */ -export interface Schema$SourceLocation { + * Data extracted for a specific group based on certain filter criteria, such + * as a given time period and/or service filter. + */ + export interface Schema$ErrorGroupStats { + /** + * Service contexts with a non-zero error count for the given filter + * criteria. This list can be truncated if multiple services are affected. + * Refer to `num_affected_services` for the total count. + */ + affectedServices: Schema$ServiceContext[]; + /** + * Approximate number of affected users in the given group that match the + * filter criteria. Users are distinguished by data in the `ErrorContext` of + * the individual error events, such as their login name or their remote IP + * address in case of HTTP requests. The number of affected users can be + * zero even if the number of errors is non-zero if no data was provided + * from which the affected user could be deduced. Users are counted based on + * data in the request context that was provided in the error report. If + * more users are implicitly affected, such as due to a crash of the whole + * service, this is not reflected here. + */ + affectedUsersCount: string; + /** + * Approximate total number of events in the given group that match the + * filter criteria. + */ + count: string; + /** + * Approximate first occurrence that was ever seen for this group and which + * matches the given filter criteria, ignoring the time_range that was + * specified in the request. + */ + firstSeenTime: string; + /** + * Group data that is independent of the filter criteria. + */ + group: Schema$ErrorGroup; + /** + * Approximate last occurrence that was ever seen for this group and which + * matches the given filter criteria, ignoring the time_range that was + * specified in the request. + */ + lastSeenTime: string; + /** + * The total number of services with a non-zero error count for the given + * filter criteria. + */ + numAffectedServices: number; + /** + * An arbitrary event that is chosen as representative for the whole group. + * The representative event is intended to be used as a quick preview for + * the whole group. Events in the group are usually sufficiently similar to + * each other such that showing an arbitrary representative provides insight + * into the characteristics of the group as a whole. + */ + representative: Schema$ErrorEvent; + /** + * Approximate number of occurrences over time. Timed counts returned by + * ListGroups are guaranteed to be: - Inside the requested time interval - + * Non-overlapping, and - Ordered by ascending time. + */ + timedCounts: Schema$TimedCount[]; + } /** - * The source code filename, which can include a truncated relative path, or a - * full path from a production machine. - */ - filePath: string; + * HTTP request data that is related to a reported error. This data should be + * provided by the application when reporting an error, unless the error + * report has been generated automatically from Google App Engine logs. + */ + export interface Schema$HttpRequestContext { + /** + * The type of HTTP request, such as `GET`, `POST`, etc. + */ + method: string; + /** + * The referrer information that is provided with the request. + */ + referrer: string; + /** + * The IP address from which the request originated. This can be IPv4, IPv6, + * or a token which is derived from the IP address, depending on the data + * that has been provided in the error report. + */ + remoteIp: string; + /** + * The HTTP response status code for the request. + */ + responseStatusCode: number; + /** + * The URL of the request. + */ + url: string; + /** + * The user agent information that is provided with the request. + */ + userAgent: string; + } /** - * Human-readable name of a function or method. The value can include optional - * context like the class or package name. For example, - * `my.package.MyClass.method` in case of Java. - */ - functionName: string; + * Contains a set of requested error events. + */ + export interface Schema$ListEventsResponse { + /** + * The error events which match the given request. + */ + errorEvents: Schema$ErrorEvent[]; + /** + * If non-empty, more results are available. Pass this token, along with the + * same query parameters as the first request, to view the next page of + * results. + */ + nextPageToken: string; + /** + * The timestamp specifies the start time to which the request was + * restricted. + */ + timeRangeBegin: string; + } /** - * 1-based. 0 indicates that the line number is unknown. - */ - lineNumber: number; -} -/** - * A reference to a particular snapshot of the source tree used to build and - * deploy an application. - */ -export interface Schema$SourceReference { + * Contains a set of requested error group stats. + */ + export interface Schema$ListGroupStatsResponse { + /** + * The error group stats which match the given request. + */ + errorGroupStats: Schema$ErrorGroupStats[]; + /** + * If non-empty, more results are available. Pass this token, along with the + * same query parameters as the first request, to view the next page of + * results. + */ + nextPageToken: string; + /** + * The timestamp specifies the start time to which the request was + * restricted. The start time is set based on the requested time range. It + * may be adjusted to a later time if a project has exceeded the storage + * quota and older data has been deleted. + */ + timeRangeBegin: string; + } /** - * Optional. A URI string identifying the repository. Example: - * "https://github.com/GoogleCloudPlatform/kubernetes.git" - */ - repository: string; + * An error event which is reported to the Error Reporting system. + */ + export interface Schema$ReportedErrorEvent { + /** + * [Optional] A description of the context in which the error occurred. + */ + context: Schema$ErrorContext; + /** + * [Optional] Time when the event occurred. If not provided, the time when + * the event was received by the Error Reporting system will be used. + */ + eventTime: string; + /** + * [Required] The error message. If no `context.reportLocation` is provided, + * the message must contain a header (typically consisting of the exception + * type name and an error message) and an exception stack trace in one of + * the supported programming languages and formats. Supported languages are + * Java, Python, JavaScript, Ruby, C#, PHP, and Go. Supported stack trace + * formats are: * **Java**: Must be the return value of + * [`Throwable.printStackTrace()`](https://docs.oracle.com/javase/7/docs/api/java/lang/Throwable.html#printStackTrace%28%29). + * * **Python**: Must be the return value of + * [`traceback.format_exc()`](https://docs.python.org/2/library/traceback.html#traceback.format_exc). + * * **JavaScript**: Must be the value of + * [`error.stack`](https://github.com/v8/v8/wiki/Stack-Trace-API) as + * returned by V8. * **Ruby**: Must contain frames returned by + * [`Exception.backtrace`](https://ruby-doc.org/core-2.2.0/Exception.html#method-i-backtrace). + * * **C#**: Must be the return value of + * [`Exception.ToString()`](https://msdn.microsoft.com/en-us/library/system.exception.tostring.aspx). + * * **PHP**: Must start with `PHP (Notice|Parse error|Fatal error|Warning)` + * and contain the result of + * [`(string)$exception`](http://php.net/manual/en/exception.tostring.php). + * * **Go**: Must be the return value of + * [`runtime.Stack()`](https://golang.org/pkg/runtime/debug/#Stack). + */ + message: string; + /** + * [Required] The service context in which this error has occurred. + */ + serviceContext: Schema$ServiceContext; + } /** - * The canonical and persistent identifier of the deployed revision. Example - * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" - */ - revisionId: string; -} -/** - * The number of errors in a given time period. All numbers are approximate - * since the error events are sampled before counting them. - */ -export interface Schema$TimedCount { + * Response for reporting an individual error event. Data may be added to this + * message in the future. + */ + export interface Schema$ReportErrorEventResponse {} + /** + * Describes a running service that sends errors. Its version changes over + * time and multiple versions can run in parallel. + */ + export interface Schema$ServiceContext { + /** + * Type of the MonitoredResource. List of possible values: + * https://cloud.google.com/monitoring/api/resources Value is set + * automatically for incoming errors and must not be set when reporting + * errors. + */ + resourceType: string; + /** + * An identifier of the service, such as the name of the executable, job, or + * Google App Engine service name. This field is expected to have a low + * number of values that are relatively stable over time, as opposed to + * `version`, which can be changed whenever new code is deployed. Contains + * the service name for error reports extracted from Google App Engine logs + * or `default` if the App Engine default service is used. + */ + service: string; + /** + * Represents the source code version that the developer provided, which + * could represent a version label or a Git SHA-1 hash, for example. For App + * Engine standard environment, the version is set to the version of the + * app. + */ + version: string; + } /** - * Approximate number of occurrences in the given time period. - */ - count: string; + * Indicates a location in the source code of the service for which errors are + * reported. `functionName` must be provided by the application when reporting + * an error, unless the error report contains a `message` with a supported + * exception stack trace. All fields are optional for the later case. + */ + export interface Schema$SourceLocation { + /** + * The source code filename, which can include a truncated relative path, or + * a full path from a production machine. + */ + filePath: string; + /** + * Human-readable name of a function or method. The value can include + * optional context like the class or package name. For example, + * `my.package.MyClass.method` in case of Java. + */ + functionName: string; + /** + * 1-based. 0 indicates that the line number is unknown. + */ + lineNumber: number; + } /** - * End of the time period to which `count` refers (excluded). - */ - endTime: string; + * A reference to a particular snapshot of the source tree used to build and + * deploy an application. + */ + export interface Schema$SourceReference { + /** + * Optional. A URI string identifying the repository. Example: + * "https://github.com/GoogleCloudPlatform/kubernetes.git" + */ + repository: string; + /** + * The canonical and persistent identifier of the deployed revision. Example + * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + */ + revisionId: string; + } /** - * Start of the time period to which `count` refers (included). - */ - startTime: string; -} -/** - * Information related to tracking the progress on resolving the error. - */ -export interface Schema$TrackingIssue { + * The number of errors in a given time period. All numbers are approximate + * since the error events are sampled before counting them. + */ + export interface Schema$TimedCount { + /** + * Approximate number of occurrences in the given time period. + */ + count: string; + /** + * End of the time period to which `count` refers (excluded). + */ + endTime: string; + /** + * Start of the time period to which `count` refers (included). + */ + startTime: string; + } /** - * A URL pointing to a related entry in an issue tracking system. Example: - * https://github.com/user/project/issues/4 + * Information related to tracking the progress on resolving the error. */ - url: string; -} - -export class Resource$Projects { - root: Clouderrorreporting; - events: Resource$Projects$Events; - groups: Resource$Projects$Groups; - groupStats: Resource$Projects$Groupstats; - constructor(root: Clouderrorreporting) { - this.root = root; - this.getRoot.bind(this); - this.events = new Resource$Projects$Events(root); - this.groups = new Resource$Projects$Groups(root); - this.groupStats = new Resource$Projects$Groupstats(root); + export interface Schema$TrackingIssue { + /** + * A URL pointing to a related entry in an issue tracking system. Example: + * https://github.com/user/project/issues/4 + */ + url: string; } - getRoot() { - return this.root; - } - - - /** - * clouderrorreporting.projects.deleteEvents - * @desc Deletes all error events of a given project. - * @alias clouderrorreporting.projects.deleteEvents - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteEvents(params?: any, options?: MethodOptions): - AxiosPromise; - deleteEvents( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteEvents( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+projectName}/events') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectName'], - pathParams: ['projectName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects { + root: Clouderrorreporting; + events: Resource$Projects$Events; + groups: Resource$Projects$Groups; + groupStats: Resource$Projects$Groupstats; + constructor(root: Clouderrorreporting) { + this.root = root; + this.getRoot.bind(this); + this.events = new Resource$Projects$Events(root); + this.groups = new Resource$Projects$Groups(root); + this.groupStats = new Resource$Projects$Groupstats(root); } - } -} -export class Resource$Projects$Events { - root: Clouderrorreporting; - constructor(root: Clouderrorreporting) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * clouderrorreporting.projects.events.list - * @desc Lists the specified events. - * @alias clouderrorreporting.projects.events.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.groupId [Required] The group for which events shall be returned. - * @param {integer=} params.pageSize [Optional] The maximum number of results to return per response. - * @param {string=} params.pageToken [Optional] A `next_page_token` provided by a previous response. - * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. - * @param {string=} params.serviceFilter.resourceType [Optional] The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). - * @param {string=} params.serviceFilter.service [Optional] The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). - * @param {string=} params.serviceFilter.version [Optional] The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). - * @param {string=} params.timeRange.period Restricts the query to the specified time range. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * clouderrorreporting.projects.deleteEvents + * @desc Deletes all error events of a given project. + * @alias clouderrorreporting.projects.deleteEvents + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteEvents(params?: any, options?: MethodOptions): + AxiosPromise; + deleteEvents( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteEvents( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+projectName}/events') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectName'], + pathParams: ['projectName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Events { + root: Clouderrorreporting; + constructor(root: Clouderrorreporting) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+projectName}/events') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName'], - pathParams: ['projectName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * clouderrorreporting.projects.events.report - * @desc Report an individual error event. This endpoint accepts - * either an OAuth token, or an API key for - * authentication. To use an API key, append it to the URL as the value of a - * `key` parameter. For example:
POST
-   * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
- * @alias clouderrorreporting.projects.events.report - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. - * @param {().ReportedErrorEvent} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - report(params?: any, options?: MethodOptions): - AxiosPromise; - report( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - report( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * clouderrorreporting.projects.events.list + * @desc Lists the specified events. + * @alias clouderrorreporting.projects.events.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.groupId [Required] The group for which events shall be returned. + * @param {integer=} params.pageSize [Optional] The maximum number of results to return per response. + * @param {string=} params.pageToken [Optional] A `next_page_token` provided by a previous response. + * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. + * @param {string=} params.serviceFilter.resourceType [Optional] The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + * @param {string=} params.serviceFilter.service [Optional] The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + * @param {string=} params.serviceFilter.version [Optional] The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + * @param {string=} params.timeRange.period Restricts the query to the specified time range. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+projectName}/events') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName'], + pathParams: ['projectName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+projectName}/events:report') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName'], - pathParams: ['projectName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Groups { - root: Clouderrorreporting; - constructor(root: Clouderrorreporting) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * clouderrorreporting.projects.events.report + * @desc Report an individual error event. This endpoint accepts + * either an OAuth token, or an API key for + * authentication. To use an API key, append it to the URL as the value of a + * `key` parameter. For example:
POST
+     * https://clouderrorreporting.googleapis.com/v1beta1/projects/example-project/events:report?key=123ABC456
+ * @alias clouderrorreporting.projects.events.report + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as `projects/` plus the [Google Cloud Platform project ID](https://support.google.com/cloud/answer/6158840). Example: `projects/my-project-123`. + * @param {().ReportedErrorEvent} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + report(params?: any, options?: MethodOptions): + AxiosPromise; + report( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + report( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+projectName}/events:report') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName'], + pathParams: ['projectName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * clouderrorreporting.projects.groups.get - * @desc Get the specified group. - * @alias clouderrorreporting.projects.groups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupName [Required] The group resource name. Written as projects/projectID/groups/group_name. Call groupStats.list to return a list of groups belonging to this project. Example: projects/my-project-123/groups/my-group - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Groups { + root: Clouderrorreporting; + constructor(root: Clouderrorreporting) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+groupName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupName'], - pathParams: ['groupName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * clouderrorreporting.projects.groups.update - * @desc Replace the data for the specified group. Fails if the group does not - * exist. - * @alias clouderrorreporting.projects.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The group resource name. Example: projects/my-project-123/groups/my-groupid - * @param {().ErrorGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * clouderrorreporting.projects.groups.get + * @desc Get the specified group. + * @alias clouderrorreporting.projects.groups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupName [Required] The group resource name. Written as projects/projectID/groups/group_name. Call groupStats.list to return a list of groups belonging to this project. Example: projects/my-project-123/groups/my-group + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+groupName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupName'], + pathParams: ['groupName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Groupstats { - root: Clouderrorreporting; - constructor(root: Clouderrorreporting) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * clouderrorreporting.projects.groups.update + * @desc Replace the data for the specified group. Fails if the group does + * not exist. + * @alias clouderrorreporting.projects.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The group resource name. Example: projects/my-project-123/groups/my-groupid + * @param {().ErrorGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * clouderrorreporting.projects.groupStats.list - * @desc Lists the specified groups. - * @alias clouderrorreporting.projects.groupStats.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.alignment [Optional] The alignment of the timed counts to be returned. Default is `ALIGNMENT_EQUAL_AT_END`. - * @param {string=} params.alignmentTime [Optional] Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC. - * @param {string=} params.groupId [Optional] List all ErrorGroupStats with these IDs. - * @param {string=} params.order [Optional] The sort order in which the results are returned. Default is `COUNT_DESC`. - * @param {integer=} params.pageSize [Optional] The maximum number of results to return per response. Default is 20. - * @param {string=} params.pageToken [Optional] A `next_page_token` provided by a previous response. To view additional results, pass this token along with the identical query parameters as the first request. - * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as projects/ plus the Google Cloud Platform project ID. Example: projects/my-project-123. - * @param {string=} params.serviceFilter.resourceType [Optional] The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). - * @param {string=} params.serviceFilter.service [Optional] The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). - * @param {string=} params.serviceFilter.version [Optional] The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). - * @param {string=} params.timedCountDuration [Optional] The preferred duration for a single returned `TimedCount`. If not set, no timed counts are returned. - * @param {string=} params.timeRange.period Restricts the query to the specified time range. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Groupstats { + root: Clouderrorreporting; + constructor(root: Clouderrorreporting) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+projectName}/groupStats') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName'], - pathParams: ['projectName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * clouderrorreporting.projects.groupStats.list + * @desc Lists the specified groups. + * @alias clouderrorreporting.projects.groupStats.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.alignment [Optional] The alignment of the timed counts to be returned. Default is `ALIGNMENT_EQUAL_AT_END`. + * @param {string=} params.alignmentTime [Optional] Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC. + * @param {string=} params.groupId [Optional] List all ErrorGroupStats with these IDs. + * @param {string=} params.order [Optional] The sort order in which the results are returned. Default is `COUNT_DESC`. + * @param {integer=} params.pageSize [Optional] The maximum number of results to return per response. Default is 20. + * @param {string=} params.pageToken [Optional] A `next_page_token` provided by a previous response. To view additional results, pass this token along with the identical query parameters as the first request. + * @param {string} params.projectName [Required] The resource name of the Google Cloud Platform project. Written as projects/ plus the Google Cloud Platform project ID. Example: projects/my-project-123. + * @param {string=} params.serviceFilter.resourceType [Optional] The exact value to match against [`ServiceContext.resource_type`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type). + * @param {string=} params.serviceFilter.service [Optional] The exact value to match against [`ServiceContext.service`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service). + * @param {string=} params.serviceFilter.version [Optional] The exact value to match against [`ServiceContext.version`](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version). + * @param {string=} params.timedCountDuration [Optional] The preferred duration for a single returned `TimedCount`. If not set, no timed counts are returned. + * @param {string=} params.timeRange.period Restricts the query to the specified time range. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://clouderrorreporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+projectName}/groupStats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName'], + pathParams: ['projectName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudfunctions/v1.ts b/src/apis/cloudfunctions/v1.ts index 4072a271776..0978cfc13b6 100644 --- a/src/apis/cloudfunctions/v1.ts +++ b/src/apis/cloudfunctions/v1.ts @@ -27,1172 +27,1198 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Functions API - * - * Manages lightweight user-provided functions executed in response to events. - * - * @example - * const google = require('googleapis'); - * const cloudfunctions = google.cloudfunctions('v1'); - * - * @namespace cloudfunctions - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudfunctions - */ -export class Cloudfunctions { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudfunctions_v1 { + /** + * Google Cloud Functions API + * + * Manages lightweight user-provided functions executed in response to events. + * + * @example + * const google = require('googleapis'); + * const cloudfunctions = google.cloudfunctions('v1'); + * + * @namespace cloudfunctions + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudfunctions + */ + export class Cloudfunctions { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - projects: Resource$Projects; + operations: Resource$Operations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.projects = new Resource$Projects(this); - } + this.operations = new Resource$Operations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request for the `CallFunction` method. - */ -export interface Schema$CallFunctionRequest { - /** - * Input to be passed to the function. - */ - data: string; -} -/** - * Response of `CallFunction` method. - */ -export interface Schema$CallFunctionResponse { - /** - * Either system or user-function generated error. Set if execution was not - * successful. - */ - error: string; - /** - * Execution id of function invocation. - */ - executionId: string; - /** - * Result populated for successful execution of synchronous function. Will not - * be populated if function does not return a result through context. - */ - result: string; -} -/** - * Describes a Cloud Function that contains user computation executed in - * response to an event. It encapsulate function and triggers configurations. - */ -export interface Schema$CloudFunction { - /** - * The amount of memory in MB available for a function. Defaults to 256MB. - */ - availableMemoryMb: number; - /** - * User-provided description of a function. - */ - description: string; - /** - * The name of the function (as defined in source code) that will be executed. - * Defaults to the resource name suffix, if not specified. For backward - * compatibility, if function with given name is not found, then the system - * will try to use function named "function". For Node.js this is - * name of a function exported by the module specified in `source_location`. - */ - entryPoint: string; - /** - * A source that fires events in response to a condition in another service. - */ - eventTrigger: Schema$EventTrigger; - /** - * An HTTPS endpoint type of source that can be triggered via URL. - */ - httpsTrigger: Schema$HttpsTrigger; - /** - * Labels associated with this Cloud Function. - */ - labels: any; - /** - * A user-defined name of the function. Function names must be unique globally - * and match pattern `projects/x/locations/x/functions/x - */ - name: string; - /** - * Output only. The email of the function's service account. - */ - serviceAccountEmail: string; - /** - * The Google Cloud Storage URL, starting with gs://, pointing to the zip - * archive which contains the function. - */ - sourceArchiveUrl: string; - /** - * **Beta Feature** The source repository where a function is hosted. - */ - sourceRepository: Schema$SourceRepository; - /** - * The Google Cloud Storage signed URL used for source uploading, generated by - * google.cloud.functions.v1.GenerateUploadUrl - */ - sourceUploadUrl: string; - /** - * Output only. Status of the function deployment. - */ - status: string; - /** - * The function execution timeout. Execution is considered failed and can be - * terminated if the function is not completed at the end of the timeout - * period. Defaults to 60 seconds. - */ - timeout: string; - /** - * Output only. The last update timestamp of a Cloud Function. - */ - updateTime: string; - /** - * Output only. The version identifier of the Cloud Function. Each deployment - * attempt results in a new version of a function being created. - */ - versionId: string; -} -/** - * Describes EventTrigger, used to request events be sent from another service. - */ -export interface Schema$EventTrigger { - /** - * Required. The type of event to observe. For example: - * `providers/cloud.storage/eventTypes/object.change` and - * `providers/cloud.pubsub/eventTypes/topic.publish`. Event types match - * pattern `providers/x/eventTypes/*.*`. The pattern contains: 1. namespace: - * For example, `cloud.storage` and `google.firebase.analytics`. 2. - * resource type: The type of resource on which event occurs. For example, - * the Google Cloud Storage API includes the type `object`. 3. action: The - * action that generates the event. For example, action for a Google Cloud - * Storage Object is 'change'. These parts are lower case. - */ - eventType: string; - /** - * Specifies policy for failed executions. - */ - failurePolicy: Schema$FailurePolicy; - /** - * Required. The resource(s) from which to observe events, for example, - * `projects/_/buckets/myBucket`. Not all syntactically correct values are - * accepted by all services. For example: 1. The authorization model must - * support it. Google Cloud Functions only allows EventTriggers to be - * deployed that observe resources in the same project as the - * `CloudFunction`. 2. The resource type must match the pattern expected for - * an `event_type`. For example, an `EventTrigger` that has an `event_type` - * of "google.pubsub.topic.publish" should have a resource that - * matches Google Cloud Pub/Sub topics. Additionally, some services may - * support short names when creating an `EventTrigger`. These will always be - * returned in the normalized "long" format. See each - * *service's* documentation for supported formats. - */ - resource: string; - /** - * The hostname of the service that should be observed. If no string is - * provided, the default service implementing the API will be used. For - * example, `storage.googleapis.com` is the default for all event types in the - * `google.storage` namespace. - */ - service: string; -} -/** - * Describes the policy in case of function's execution failure. If empty, - * then defaults to ignoring failures (i.e. not retrying them). - */ -export interface Schema$FailurePolicy { - /** - * If specified, then the function will be retried in case of a failure. - */ - retry: Schema$Retry; -} -/** - * Request of `GenerateDownloadUrl` method. - */ -export interface Schema$GenerateDownloadUrlRequest { - /** - * The optional version of function. If not set, default, current version is - * used. - */ - versionId: string; -} -/** - * Response of `GenerateDownloadUrl` method. - */ -export interface Schema$GenerateDownloadUrlResponse { - /** - * The generated Google Cloud Storage signed URL that should be used for - * function source code download. - */ - downloadUrl: string; -} -/** - * Request of `GenerateSourceUploadUrl` method. - */ -export interface Schema$GenerateUploadUrlRequest {} -/** - * Response of `GenerateSourceUploadUrl` method. - */ -export interface Schema$GenerateUploadUrlResponse { - /** - * The generated Google Cloud Storage signed URL that should be used for a - * function source code upload. The uploaded file should be a zip archive - * which contains a function. - */ - uploadUrl: string; -} -/** - * Describes HttpsTrigger, could be used to connect web hooks to function. - */ -export interface Schema$HttpsTrigger { - /** - * Output only. The deployed url for the function. - */ - url: string; -} -/** - * Response for the `ListFunctions` method. - */ -export interface Schema$ListFunctionsResponse { - /** - * The functions that match the request. - */ - functions: Schema$CloudFunction[]; - /** - * If not empty, indicates that there may be more functions that match the - * request; this value should be passed in a new - * google.cloud.functions.v1.ListFunctionsRequest to get more functions. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; /** - * The error result of the operation in case of failure or cancellation. + * Request for the `CallFunction` method. */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + export interface Schema$CallFunctionRequest { + /** + * Input to be passed to the function. + */ + data: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Response of `CallFunction` method. + */ + export interface Schema$CallFunctionResponse { + /** + * Either system or user-function generated error. Set if execution was not + * successful. + */ + error: string; + /** + * Execution id of function invocation. + */ + executionId: string; + /** + * Result populated for successful execution of synchronous function. Will + * not be populated if function does not return a result through context. + */ + result: string; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Metadata describing an Operation - */ -export interface Schema$OperationMetadataV1 { + * Describes a Cloud Function that contains user computation executed in + * response to an event. It encapsulate function and triggers configurations. + */ + export interface Schema$CloudFunction { + /** + * The amount of memory in MB available for a function. Defaults to 256MB. + */ + availableMemoryMb: number; + /** + * User-provided description of a function. + */ + description: string; + /** + * The name of the function (as defined in source code) that will be + * executed. Defaults to the resource name suffix, if not specified. For + * backward compatibility, if function with given name is not found, then + * the system will try to use function named "function". For + * Node.js this is name of a function exported by the module specified in + * `source_location`. + */ + entryPoint: string; + /** + * A source that fires events in response to a condition in another service. + */ + eventTrigger: Schema$EventTrigger; + /** + * An HTTPS endpoint type of source that can be triggered via URL. + */ + httpsTrigger: Schema$HttpsTrigger; + /** + * Labels associated with this Cloud Function. + */ + labels: any; + /** + * A user-defined name of the function. Function names must be unique + * globally and match pattern `projects/x/locations/x/functions/x + */ + name: string; + /** + * Output only. The email of the function's service account. + */ + serviceAccountEmail: string; + /** + * The Google Cloud Storage URL, starting with gs://, pointing to the zip + * archive which contains the function. + */ + sourceArchiveUrl: string; + /** + * **Beta Feature** The source repository where a function is hosted. + */ + sourceRepository: Schema$SourceRepository; + /** + * The Google Cloud Storage signed URL used for source uploading, generated + * by google.cloud.functions.v1.GenerateUploadUrl + */ + sourceUploadUrl: string; + /** + * Output only. Status of the function deployment. + */ + status: string; + /** + * The function execution timeout. Execution is considered failed and can be + * terminated if the function is not completed at the end of the timeout + * period. Defaults to 60 seconds. + */ + timeout: string; + /** + * Output only. The last update timestamp of a Cloud Function. + */ + updateTime: string; + /** + * Output only. The version identifier of the Cloud Function. Each + * deployment attempt results in a new version of a function being created. + */ + versionId: string; + } /** - * The original request that started the operation. - */ - request: any; + * Describes EventTrigger, used to request events be sent from another + * service. + */ + export interface Schema$EventTrigger { + /** + * Required. The type of event to observe. For example: + * `providers/cloud.storage/eventTypes/object.change` and + * `providers/cloud.pubsub/eventTypes/topic.publish`. Event types match + * pattern `providers/x/eventTypes/*.*`. The pattern contains: 1. + * namespace: For example, `cloud.storage` and + * `google.firebase.analytics`. 2. resource type: The type of resource on + * which event occurs. For example, the Google Cloud Storage API includes + * the type `object`. 3. action: The action that generates the event. For + * example, action for a Google Cloud Storage Object is 'change'. + * These parts are lower case. + */ + eventType: string; + /** + * Specifies policy for failed executions. + */ + failurePolicy: Schema$FailurePolicy; + /** + * Required. The resource(s) from which to observe events, for example, + * `projects/_/buckets/myBucket`. Not all syntactically correct values are + * accepted by all services. For example: 1. The authorization model must + * support it. Google Cloud Functions only allows EventTriggers to be + * deployed that observe resources in the same project as the + * `CloudFunction`. 2. The resource type must match the pattern expected for + * an `event_type`. For example, an `EventTrigger` that has an + * `event_type` of "google.pubsub.topic.publish" should have a + * resource that matches Google Cloud Pub/Sub topics. Additionally, some + * services may support short names when creating an `EventTrigger`. These + * will always be returned in the normalized "long" format. See + * each *service's* documentation for supported formats. + */ + resource: string; + /** + * The hostname of the service that should be observed. If no string is + * provided, the default service implementing the API will be used. For + * example, `storage.googleapis.com` is the default for all event types in + * the `google.storage` namespace. + */ + service: string; + } /** - * Target of the operation - for example - * projects/project-1/locations/region-1/functions/function-1 + * Describes the policy in case of function's execution failure. If empty, + * then defaults to ignoring failures (i.e. not retrying them). */ - target: string; + export interface Schema$FailurePolicy { + /** + * If specified, then the function will be retried in case of a failure. + */ + retry: Schema$Retry; + } /** - * Type of operation. + * Request of `GenerateDownloadUrl` method. */ - type: string; + export interface Schema$GenerateDownloadUrlRequest { + /** + * The optional version of function. If not set, default, current version is + * used. + */ + versionId: string; + } /** - * The last update timestamp of the operation. + * Response of `GenerateDownloadUrl` method. */ - updateTime: string; + export interface Schema$GenerateDownloadUrlResponse { + /** + * The generated Google Cloud Storage signed URL that should be used for + * function source code download. + */ + downloadUrl: string; + } /** - * Version id of the function created or updated by an API call. This field is - * only pupulated for Create and Update operations. + * Request of `GenerateSourceUploadUrl` method. */ - versionId: string; -} -/** - * Metadata describing an Operation - */ -export interface Schema$OperationMetadataV1Beta2 { + export interface Schema$GenerateUploadUrlRequest {} /** - * The original request that started the operation. + * Response of `GenerateSourceUploadUrl` method. */ - request: any; + export interface Schema$GenerateUploadUrlResponse { + /** + * The generated Google Cloud Storage signed URL that should be used for a + * function source code upload. The uploaded file should be a zip archive + * which contains a function. + */ + uploadUrl: string; + } /** - * Target of the operation - for example - * projects/project-1/locations/region-1/functions/function-1 + * Describes HttpsTrigger, could be used to connect web hooks to function. */ - target: string; + export interface Schema$HttpsTrigger { + /** + * Output only. The deployed url for the function. + */ + url: string; + } /** - * Type of operation. - */ - type: string; + * Response for the `ListFunctions` method. + */ + export interface Schema$ListFunctionsResponse { + /** + * The functions that match the request. + */ + functions: Schema$CloudFunction[]; + /** + * If not empty, indicates that there may be more functions that match the + * request; this value should be passed in a new + * google.cloud.functions.v1.ListFunctionsRequest to get more functions. + */ + nextPageToken: string; + } /** - * The last update timestamp of the operation. - */ - updateTime: string; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Version id of the function created or updated by an API call. This field is - * only pupulated for Create and Update operations. - */ - versionId: string; -} -/** - * Describes the retry policy in case of function's execution failure. A - * function execution will be retried on any failure. A failed execution will be - * retried up to 7 days with an exponential backoff (capped at 10 seconds). - * Retried execution is charged as any other execution. - */ -export interface Schema$Retry {} -/** - * Describes SourceRepository, used to represent parameters related to source - * repository where a function is hosted. - */ -export interface Schema$SourceRepository { + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Output only. The URL pointing to the hosted repository where the function - * were defined at the time of deployment. It always points to a specific - * commit in the format described above. - */ - deployedUrl: string; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; + } /** - * The URL pointing to the hosted repository where the function is defined. - * There are supported Cloud Source Repository URLs in the following formats: - * To refer to a specific commit: - * `https://source.developers.google.com/projects/x/repos/x/revisions/x/paths/x - * To refer to a moveable alias (branch): - * `https://source.developers.google.com/projects/x/repos/x/moveable-aliases/x/paths/x - * In particular, to refer to HEAD use `master` moveable alias. To refer to a - * specific fixed alias (tag): - * `https://source.developers.google.com/projects/x/repos/x/fixed-aliases/x/paths/x - * You may omit `paths/x if you want to use the main directory. - */ - url: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Metadata describing an Operation + */ + export interface Schema$OperationMetadataV1 { + /** + * The original request that started the operation. + */ + request: any; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target: string; + /** + * Type of operation. + */ + type: string; + /** + * The last update timestamp of the operation. + */ + updateTime: string; + /** + * Version id of the function created or updated by an API call. This field + * is only pupulated for Create and Update operations. + */ + versionId: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Metadata describing an Operation + */ + export interface Schema$OperationMetadataV1Beta2 { + /** + * The original request that started the operation. + */ + request: any; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target: string; + /** + * Type of operation. + */ + type: string; + /** + * The last update timestamp of the operation. + */ + updateTime: string; + /** + * Version id of the function created or updated by an API call. This field + * is only pupulated for Create and Update operations. + */ + versionId: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Operations { - root: Cloudfunctions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); + * Describes the retry policy in case of function's execution failure. A + * function execution will be retried on any failure. A failed execution will + * be retried up to 7 days with an exponential backoff (capped at 10 seconds). + * Retried execution is charged as any other execution. + */ + export interface Schema$Retry {} + /** + * Describes SourceRepository, used to represent parameters related to source + * repository where a function is hosted. + */ + export interface Schema$SourceRepository { + /** + * Output only. The URL pointing to the hosted repository where the function + * were defined at the time of deployment. It always points to a specific + * commit in the format described above. + */ + deployedUrl: string; + /** + * The URL pointing to the hosted repository where the function is defined. + * There are supported Cloud Source Repository URLs in the following + * formats: To refer to a specific commit: + * `https://source.developers.google.com/projects/x/repos/x/revisions/x/paths/x + * To refer to a moveable alias (branch): + * `https://source.developers.google.com/projects/x/repos/x/moveable-aliases/x/paths/x + * In particular, to refer to HEAD use `master` moveable alias. To refer to + * a specific fixed alias (tag): + * `https://source.developers.google.com/projects/x/repos/x/fixed-aliases/x/paths/x + * You may omit `paths/x if you want to use the main directory. + */ + url: string; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * cloudfunctions.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias cloudfunctions.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Cloudfunctions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudfunctions.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias cloudfunctions.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string=} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudfunctions.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias cloudfunctions.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Cloudfunctions; - locations: Resource$Projects$Locations; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations { - root: Cloudfunctions; - functions: Resource$Projects$Locations$Functions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - this.functions = new Resource$Projects$Locations$Functions(root); - } - getRoot() { - return this.root; + /** + * cloudfunctions.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias cloudfunctions.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string=} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * cloudfunctions.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @alias cloudfunctions.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Cloudfunctions; + locations: Resource$Projects$Locations; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Projects$Locations$Functions { - root: Cloudfunctions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Locations { + root: Cloudfunctions; + functions: Resource$Projects$Locations$Functions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); + this.functions = new Resource$Projects$Locations$Functions(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudfunctions.projects.locations.functions.call - * @desc Invokes synchronously deployed function. To be used for testing, very - * limited traffic allowed. - * @alias cloudfunctions.projects.locations.functions.call - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function to be called. - * @param {().CallFunctionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - call(params?: any, options?: MethodOptions): - AxiosPromise; - call( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - call( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudfunctions.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @alias cloudfunctions.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Functions { + root: Cloudfunctions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:call').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudfunctions.projects.locations.functions.create - * @desc Creates a new function. If a function with the given name already - * exists in the specified project, the long running operation will return - * `ALREADY_EXISTS` error. - * @alias cloudfunctions.projects.locations.functions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The project and location in which the function should be created, specified in the format `projects/x/locations/x` - * @param {().CloudFunction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.call + * @desc Invokes synchronously deployed function. To be used for testing, + * very limited traffic allowed. + * @alias cloudfunctions.projects.locations.functions.call + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function to be called. + * @param {().CallFunctionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + call(params?: any, options?: MethodOptions): + AxiosPromise; + call( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + call( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:call').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+location}/functions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['location'], - pathParams: ['location'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.delete - * @desc Deletes a function with the given name from the specified project. If - * the given function is used by some trigger, the trigger will be updated to - * remove this function. - * @alias cloudfunctions.projects.locations.functions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function which should be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.create + * @desc Creates a new function. If a function with the given name already + * exists in the specified project, the long running operation will return + * `ALREADY_EXISTS` error. + * @alias cloudfunctions.projects.locations.functions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The project and location in which the function should be created, specified in the format `projects/x/locations/x` + * @param {().CloudFunction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+location}/functions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['location'], + pathParams: ['location'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.generateDownloadUrl - * @desc Returns a signed URL for downloading deployed function source code. - * The URL is only valid for a limited period and should be used within - * minutes after generation. For more information about the signed URL usage - * see: https://cloud.google.com/storage/docs/access-control/signed-urls - * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of function for which source code Google Cloud Storage signed URL should be generated. - * @param {().GenerateDownloadUrlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateDownloadUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateDownloadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generateDownloadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.delete + * @desc Deletes a function with the given name from the specified project. + * If the given function is used by some trigger, the trigger will be + * updated to remove this function. + * @alias cloudfunctions.projects.locations.functions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function which should be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:generateDownloadUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.generateUploadUrl - * @desc Returns a signed URL for uploading a function source code. For more - * information about the signed URL usage see: - * https://cloud.google.com/storage/docs/access-control/signed-urls. Once the - * function source code upload is complete, the used signed URL should be - * provided in CreateFunction or UpdateFunction request as a reference to the - * function source code. When uploading source code to the generated signed - * URL, please follow these restrictions: * Source file type should be a zip - * file. * Source file size should not exceed 100MB limit. When making a HTTP - * PUT request, these two headers need to be specified: * `content-type: - * application/zip` * `x-goog-content-length-range: 0,104857600` - * @alias cloudfunctions.projects.locations.functions.generateUploadUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/x/locations/x`. - * @param {().GenerateUploadUrlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateUploadUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateUploadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateUploadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.generateDownloadUrl + * @desc Returns a signed URL for downloading deployed function source code. + * The URL is only valid for a limited period and should be used within + * minutes after generation. For more information about the signed URL usage + * see: https://cloud.google.com/storage/docs/access-control/signed-urls + * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of function for which source code Google Cloud Storage signed URL should be generated. + * @param {().GenerateDownloadUrlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateDownloadUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateDownloadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generateDownloadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:generateDownloadUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/functions:generateUploadUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.get - * @desc Returns a function with the given name from the requested project. - * @alias cloudfunctions.projects.locations.functions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function which details should be obtained. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.generateUploadUrl + * @desc Returns a signed URL for uploading a function source code. For more + * information about the signed URL usage see: + * https://cloud.google.com/storage/docs/access-control/signed-urls. Once + * the function source code upload is complete, the used signed URL should + * be provided in CreateFunction or UpdateFunction request as a reference to + * the function source code. When uploading source code to the generated + * signed URL, please follow these restrictions: * Source file type should + * be a zip file. * Source file size should not exceed 100MB limit. When + * making a HTTP PUT request, these two headers need to be specified: * + * `content-type: application/zip` * `x-goog-content-length-range: + * 0,104857600` + * @alias cloudfunctions.projects.locations.functions.generateUploadUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/x/locations/x`. + * @param {().GenerateUploadUrlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateUploadUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateUploadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generateUploadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/functions:generateUploadUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.list - * @desc Returns a list of functions that belong to the requested project. - * @alias cloudfunctions.projects.locations.functions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of functions to return per call. - * @param {string=} params.pageToken The value returned by the last `ListFunctionsResponse`; indicates that this is a continuation of a prior `ListFunctions` call, and that the system should return the next page of data. - * @param {string} params.parent The project and location from which the function should be listed, specified in the format `projects/x/locations/x` If you want to list functions in all locations, use "-" in place of a location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.get + * @desc Returns a function with the given name from the requested project. + * @alias cloudfunctions.projects.locations.functions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function which details should be obtained. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/functions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.patch - * @desc Updates existing function. - * @alias cloudfunctions.projects.locations.functions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name A user-defined name of the function. Function names must be unique globally and match pattern `projects/x/locations/x/functions/x` - * @param {string=} params.updateMask Required list of fields to be updated in this request. - * @param {().CloudFunction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.list + * @desc Returns a list of functions that belong to the requested project. + * @alias cloudfunctions.projects.locations.functions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of functions to return per call. + * @param {string=} params.pageToken The value returned by the last `ListFunctionsResponse`; indicates that this is a continuation of a prior `ListFunctions` call, and that the system should return the next page of data. + * @param {string} params.parent The project and location from which the function should be listed, specified in the format `projects/x/locations/x` If you want to list functions in all locations, use "-" in place of a location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/functions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudfunctions.projects.locations.functions.patch + * @desc Updates existing function. + * @alias cloudfunctions.projects.locations.functions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name A user-defined name of the function. Function names must be unique globally and match pattern `projects/x/locations/x/functions/x` + * @param {string=} params.updateMask Required list of fields to be updated in this request. + * @param {().CloudFunction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudfunctions/v1beta2.ts b/src/apis/cloudfunctions/v1beta2.ts index c5693e40fc9..3041c04660e 100644 --- a/src/apis/cloudfunctions/v1beta2.ts +++ b/src/apis/cloudfunctions/v1beta2.ts @@ -27,1194 +27,1220 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Functions API - * - * Manages lightweight user-provided functions executed in response to events. - * - * @example - * const google = require('googleapis'); - * const cloudfunctions = google.cloudfunctions('v1beta2'); - * - * @namespace cloudfunctions - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Cloudfunctions - */ -export class Cloudfunctions { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudfunctions_v1beta2 { + /** + * Google Cloud Functions API + * + * Manages lightweight user-provided functions executed in response to events. + * + * @example + * const google = require('googleapis'); + * const cloudfunctions = google.cloudfunctions('v1beta2'); + * + * @namespace cloudfunctions + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Cloudfunctions + */ + export class Cloudfunctions { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - projects: Resource$Projects; + operations: Resource$Operations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.projects = new Resource$Projects(this); - } + this.operations = new Resource$Operations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request for the `CallFunction` method. - */ -export interface Schema$CallFunctionRequest { - /** - * Input to be passed to the function. - */ - data: string; -} -/** - * Response of `CallFunction` method. - */ -export interface Schema$CallFunctionResponse { - /** - * Either system or user-function generated error. Set if execution was not - * successful. - */ - error: string; - /** - * Execution id of function invocation. - */ - executionId: string; - /** - * Result populated for successful execution of synchronous function. Will not - * be populated if function does not return a result through context. - */ - result: string; -} -/** - * Describes a Cloud Function that contains user computation executed in - * response to an event. It encapsulate function and triggers configurations. - */ -export interface Schema$CloudFunction { - /** - * The amount of memory in MB available for a function. Defaults to 256MB. - */ - availableMemoryMb: number; - /** - * The name of the function (as defined in source code) that will be executed. - * Defaults to the resource name suffix, if not specified. For backward - * compatibility, if function with given name is not found, then the system - * will try to use function named "function". For Node.js this is - * name of a function exported by the module specified in `source_location`. - */ - entryPoint: string; - /** - * A source that fires events in response to a condition in another service. - */ - eventTrigger: Schema$EventTrigger; - /** - * An HTTPS endpoint type of source that can be triggered via URL. - */ - httpsTrigger: Schema$HTTPSTrigger; - /** - * Labels associated with this Cloud Function. - */ - labels: any; - /** - * Output only. Name of the most recent operation modifying the function. If - * the function status is `DEPLOYING` or `DELETING`, then it points to the - * active operation. - */ - latestOperation: string; - /** - * A user-defined name of the function. Function names must be unique globally - * and match pattern `projects/x/locations/x/functions/x - */ - name: string; - /** - * Output only. The service account of the function. - */ - serviceAccount: string; - /** - * The Google Cloud Storage URL, starting with gs://, pointing to the zip - * archive which contains the function. - */ - sourceArchiveUrl: string; - /** - * The hosted repository where the function is defined. - */ - sourceRepository: Schema$SourceRepository; - /** - * The URL pointing to the hosted repository where the function is defined. - * There are supported Cloud Source Repository URLs in the following formats: - * To refer to a specific commit: - * `https://source.developers.google.com/projects/x/repos/x/revisions/x/paths/x - * To refer to a moveable alias (branch): - * `https://source.developers.google.com/projects/x/repos/x/moveable-aliases/x/paths/x - * In particular, to refer to HEAD use `master` moveable alias. To refer to a - * specific fixed alias (tag): - * `https://source.developers.google.com/projects/x/repos/x/fixed-aliases/x/paths/x - * You may omit `paths/x if you want to use the main directory. - */ - sourceRepositoryUrl: string; - /** - * The Google Cloud Storage signed URL used for source uploading, generated by - * google.cloud.functions.v1beta2.GenerateUploadUrl - */ - sourceUploadUrl: string; - /** - * Output only. Status of the function deployment. - */ - status: string; - /** - * The function execution timeout. Execution is considered failed and can be - * terminated if the function is not completed at the end of the timeout - * period. Defaults to 60 seconds. - */ - timeout: string; - /** - * Output only. The last update timestamp of a Cloud Function. - */ - updateTime: string; - /** - * Output only. The version identifier of the Cloud Function. Each deployment - * attempt results in a new version of a function being created. - */ - versionId: string; -} -/** - * Describes EventTrigger, used to request events be sent from another service. - */ -export interface Schema$EventTrigger { - /** - * `event_type` names contain the service that is sending an event and the - * kind of event that was fired. Must be of the form `providers/x/eventTypes/x - * e.g. Directly handle a Message published to Google Cloud Pub/Sub - * `providers/cloud.pubsub/eventTypes/topic.publish`. Handle an object - * changing in Google Cloud Storage: - * `providers/cloud.storage/eventTypes/object.change` Handle a write to the - * Firebase Realtime Database: - * `providers/google.firebase.database/eventTypes/ref.write` - */ - eventType: string; - /** - * Specifies policy for failed executions. - */ - failurePolicy: Schema$FailurePolicy; - /** - * Which instance of the source's service should send events. E.g. for - * Pub/Sub this would be a Pub/Sub topic at `projects/x/topics/x. For Google - * Cloud Storage this would be a bucket at `projects/x/buckets/x. For any - * source that only supports one instance per-project, this should be the name - * of the project (`projects/x) - */ - resource: string; - /** - * The hostname of the service that should be observed. If no string is - * provided, the default service implementing the API will be used. For - * example, `storage.googleapis.com` is the default for all event types in the - * `google.storage` namespace. - */ - service: string; -} -/** - * Describes the policy in case of function's execution failure. If empty, - * then defaults to ignoring failures (i.e. not retrying them). - */ -export interface Schema$FailurePolicy { - /** - * If specified, then the function will be retried in case of a failure. - */ - retry: Schema$Retry; -} -/** - * Request of `GenerateDownloadUrl` method. - */ -export interface Schema$GenerateDownloadUrlRequest { - /** - * The optional version of function. - */ - versionId: string; -} -/** - * Response of `GenerateDownloadUrl` method. - */ -export interface Schema$GenerateDownloadUrlResponse { - /** - * The generated Google Cloud Storage signed URL that should be used for - * function source code download. - */ - downloadUrl: string; -} -/** - * Request of `GenerateUploadUrl` method. - */ -export interface Schema$GenerateUploadUrlRequest {} -/** - * Response of `GenerateUploadUrl` method. - */ -export interface Schema$GenerateUploadUrlResponse { - /** - * The generated Google Cloud Storage signed URL that should be used for a - * function source code upload. The uploaded file should be a zip archive - * which contains a function. - */ - uploadUrl: string; -} -/** - * Describes HTTPSTrigger, could be used to connect web hooks to function. - */ -export interface Schema$HTTPSTrigger { - /** - * Output only. The deployed url for the function. - */ - url: string; -} -/** - * Response for the `ListFunctions` method. - */ -export interface Schema$ListFunctionsResponse { - /** - * The functions that match the request. - */ - functions: Schema$CloudFunction[]; - /** - * If not empty, indicates that there may be more functions that match the - * request; this value should be passed in a new - * google.cloud.functions.v1beta2.ListFunctionsRequest to get more functions. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. + * Request for the `CallFunction` method. */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Metadata describing an Operation - */ -export interface Schema$OperationMetadataV1 { - /** - * The original request that started the operation. - */ - request: any; - /** - * Target of the operation - for example - * projects/project-1/locations/region-1/functions/function-1 - */ - target: string; + export interface Schema$CallFunctionRequest { + /** + * Input to be passed to the function. + */ + data: string; + } /** - * Type of operation. - */ - type: string; + * Response of `CallFunction` method. + */ + export interface Schema$CallFunctionResponse { + /** + * Either system or user-function generated error. Set if execution was not + * successful. + */ + error: string; + /** + * Execution id of function invocation. + */ + executionId: string; + /** + * Result populated for successful execution of synchronous function. Will + * not be populated if function does not return a result through context. + */ + result: string; + } /** - * The last update timestamp of the operation. - */ - updateTime: string; + * Describes a Cloud Function that contains user computation executed in + * response to an event. It encapsulate function and triggers configurations. + */ + export interface Schema$CloudFunction { + /** + * The amount of memory in MB available for a function. Defaults to 256MB. + */ + availableMemoryMb: number; + /** + * The name of the function (as defined in source code) that will be + * executed. Defaults to the resource name suffix, if not specified. For + * backward compatibility, if function with given name is not found, then + * the system will try to use function named "function". For + * Node.js this is name of a function exported by the module specified in + * `source_location`. + */ + entryPoint: string; + /** + * A source that fires events in response to a condition in another service. + */ + eventTrigger: Schema$EventTrigger; + /** + * An HTTPS endpoint type of source that can be triggered via URL. + */ + httpsTrigger: Schema$HTTPSTrigger; + /** + * Labels associated with this Cloud Function. + */ + labels: any; + /** + * Output only. Name of the most recent operation modifying the function. If + * the function status is `DEPLOYING` or `DELETING`, then it points to the + * active operation. + */ + latestOperation: string; + /** + * A user-defined name of the function. Function names must be unique + * globally and match pattern `projects/x/locations/x/functions/x + */ + name: string; + /** + * Output only. The service account of the function. + */ + serviceAccount: string; + /** + * The Google Cloud Storage URL, starting with gs://, pointing to the zip + * archive which contains the function. + */ + sourceArchiveUrl: string; + /** + * The hosted repository where the function is defined. + */ + sourceRepository: Schema$SourceRepository; + /** + * The URL pointing to the hosted repository where the function is defined. + * There are supported Cloud Source Repository URLs in the following + * formats: To refer to a specific commit: + * `https://source.developers.google.com/projects/x/repos/x/revisions/x/paths/x + * To refer to a moveable alias (branch): + * `https://source.developers.google.com/projects/x/repos/x/moveable-aliases/x/paths/x + * In particular, to refer to HEAD use `master` moveable alias. To refer to + * a specific fixed alias (tag): + * `https://source.developers.google.com/projects/x/repos/x/fixed-aliases/x/paths/x + * You may omit `paths/x if you want to use the main directory. + */ + sourceRepositoryUrl: string; + /** + * The Google Cloud Storage signed URL used for source uploading, generated + * by google.cloud.functions.v1beta2.GenerateUploadUrl + */ + sourceUploadUrl: string; + /** + * Output only. Status of the function deployment. + */ + status: string; + /** + * The function execution timeout. Execution is considered failed and can be + * terminated if the function is not completed at the end of the timeout + * period. Defaults to 60 seconds. + */ + timeout: string; + /** + * Output only. The last update timestamp of a Cloud Function. + */ + updateTime: string; + /** + * Output only. The version identifier of the Cloud Function. Each + * deployment attempt results in a new version of a function being created. + */ + versionId: string; + } /** - * Version id of the function created or updated by an API call. This field is - * only pupulated for Create and Update operations. - */ - versionId: string; -} -/** - * Metadata describing an Operation - */ -export interface Schema$OperationMetadataV1Beta2 { + * Describes EventTrigger, used to request events be sent from another + * service. + */ + export interface Schema$EventTrigger { + /** + * `event_type` names contain the service that is sending an event and the + * kind of event that was fired. Must be of the form + * `providers/x/eventTypes/x e.g. Directly handle a Message published to + * Google Cloud Pub/Sub `providers/cloud.pubsub/eventTypes/topic.publish`. + * Handle an object changing in Google Cloud Storage: + * `providers/cloud.storage/eventTypes/object.change` Handle a write to the + * Firebase Realtime Database: + * `providers/google.firebase.database/eventTypes/ref.write` + */ + eventType: string; + /** + * Specifies policy for failed executions. + */ + failurePolicy: Schema$FailurePolicy; + /** + * Which instance of the source's service should send events. E.g. for + * Pub/Sub this would be a Pub/Sub topic at `projects/x/topics/x. For Google + * Cloud Storage this would be a bucket at `projects/x/buckets/x. For any + * source that only supports one instance per-project, this should be the + * name of the project (`projects/x) + */ + resource: string; + /** + * The hostname of the service that should be observed. If no string is + * provided, the default service implementing the API will be used. For + * example, `storage.googleapis.com` is the default for all event types in + * the `google.storage` namespace. + */ + service: string; + } /** - * The original request that started the operation. + * Describes the policy in case of function's execution failure. If empty, + * then defaults to ignoring failures (i.e. not retrying them). */ - request: any; + export interface Schema$FailurePolicy { + /** + * If specified, then the function will be retried in case of a failure. + */ + retry: Schema$Retry; + } /** - * Target of the operation - for example - * projects/project-1/locations/region-1/functions/function-1 + * Request of `GenerateDownloadUrl` method. */ - target: string; + export interface Schema$GenerateDownloadUrlRequest { + /** + * The optional version of function. + */ + versionId: string; + } /** - * Type of operation. + * Response of `GenerateDownloadUrl` method. */ - type: string; + export interface Schema$GenerateDownloadUrlResponse { + /** + * The generated Google Cloud Storage signed URL that should be used for + * function source code download. + */ + downloadUrl: string; + } /** - * The last update timestamp of the operation. + * Request of `GenerateUploadUrl` method. */ - updateTime: string; + export interface Schema$GenerateUploadUrlRequest {} /** - * Version id of the function created or updated by an API call. This field is - * only pupulated for Create and Update operations. + * Response of `GenerateUploadUrl` method. */ - versionId: string; -} -/** - * Describes the retry policy in case of function's execution failure. A - * function execution will be retried on any failure. A failed execution will be - * retried up to 7 days with an exponential backoff (capped at 10 seconds). - * Retried execution is charged as any other execution. - */ -export interface Schema$Retry {} -/** - * Describes the location of the function source in a remote repository. - */ -export interface Schema$SourceRepository { + export interface Schema$GenerateUploadUrlResponse { + /** + * The generated Google Cloud Storage signed URL that should be used for a + * function source code upload. The uploaded file should be a zip archive + * which contains a function. + */ + uploadUrl: string; + } /** - * The name of the branch from which the function should be fetched. + * Describes HTTPSTrigger, could be used to connect web hooks to function. */ - branch: string; + export interface Schema$HTTPSTrigger { + /** + * Output only. The deployed url for the function. + */ + url: string; + } /** - * Output only. The id of the revision that was resolved at the moment of - * function creation or update. For example when a user deployed from a - * branch, it will be the revision id of the latest change on this branch at - * that time. If user deployed from revision then this value will be always - * equal to the revision specified by the user. - */ - deployedRevision: string; + * Response for the `ListFunctions` method. + */ + export interface Schema$ListFunctionsResponse { + /** + * The functions that match the request. + */ + functions: Schema$CloudFunction[]; + /** + * If not empty, indicates that there may be more functions that match the + * request; this value should be passed in a new + * google.cloud.functions.v1beta2.ListFunctionsRequest to get more + * functions. + */ + nextPageToken: string; + } /** - * URL to the hosted repository where the function is defined. Only paths in - * https://source.developers.google.com domain are supported. The path should - * contain the name of the repository. - */ - repositoryUrl: string; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * The id of the revision that captures the state of the repository from which - * the function should be fetched. - */ - revision: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * The path within the repository where the function is defined. The path - * should point to the directory where Cloud Functions files are located. Use - * "/" if the function is defined directly in the root directory of - * a repository. - */ - sourcePath: string; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; + } /** - * The name of the tag that captures the state of the repository from which - * the function should be fetched. - */ - tag: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Metadata describing an Operation + */ + export interface Schema$OperationMetadataV1 { + /** + * The original request that started the operation. + */ + request: any; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target: string; + /** + * Type of operation. + */ + type: string; + /** + * The last update timestamp of the operation. + */ + updateTime: string; + /** + * Version id of the function created or updated by an API call. This field + * is only pupulated for Create and Update operations. + */ + versionId: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Metadata describing an Operation + */ + export interface Schema$OperationMetadataV1Beta2 { + /** + * The original request that started the operation. + */ + request: any; + /** + * Target of the operation - for example + * projects/project-1/locations/region-1/functions/function-1 + */ + target: string; + /** + * Type of operation. + */ + type: string; + /** + * The last update timestamp of the operation. + */ + updateTime: string; + /** + * Version id of the function created or updated by an API call. This field + * is only pupulated for Create and Update operations. + */ + versionId: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Operations { - root: Cloudfunctions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); + * Describes the retry policy in case of function's execution failure. A + * function execution will be retried on any failure. A failed execution will + * be retried up to 7 days with an exponential backoff (capped at 10 seconds). + * Retried execution is charged as any other execution. + */ + export interface Schema$Retry {} + /** + * Describes the location of the function source in a remote repository. + */ + export interface Schema$SourceRepository { + /** + * The name of the branch from which the function should be fetched. + */ + branch: string; + /** + * Output only. The id of the revision that was resolved at the moment of + * function creation or update. For example when a user deployed from a + * branch, it will be the revision id of the latest change on this branch at + * that time. If user deployed from revision then this value will be always + * equal to the revision specified by the user. + */ + deployedRevision: string; + /** + * URL to the hosted repository where the function is defined. Only paths in + * https://source.developers.google.com domain are supported. The path + * should contain the name of the repository. + */ + repositoryUrl: string; + /** + * The id of the revision that captures the state of the repository from + * which the function should be fetched. + */ + revision: string; + /** + * The path within the repository where the function is defined. The path + * should point to the directory where Cloud Functions files are located. + * Use "/" if the function is defined directly in the root + * directory of a repository. + */ + sourcePath: string; + /** + * The name of the tag that captures the state of the repository from which + * the function should be fetched. + */ + tag: string; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * cloudfunctions.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias cloudfunctions.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Cloudfunctions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudfunctions.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias cloudfunctions.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string=} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias cloudfunctions.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1beta2/operations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Cloudfunctions; - locations: Resource$Projects$Locations; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations { - root: Cloudfunctions; - functions: Resource$Projects$Locations$Functions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - this.functions = new Resource$Projects$Locations$Functions(root); - } - - getRoot() { - return this.root; + /** + * cloudfunctions.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias cloudfunctions.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string=} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * cloudfunctions.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @alias cloudfunctions.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Cloudfunctions; + locations: Resource$Projects$Locations; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Projects$Locations$Functions { - root: Cloudfunctions; - constructor(root: Cloudfunctions) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Locations { + root: Cloudfunctions; + functions: Resource$Projects$Locations$Functions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); + this.functions = new Resource$Projects$Locations$Functions(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudfunctions.projects.locations.functions.call - * @desc Invokes synchronously deployed function. To be used for testing, very - * limited traffic allowed. - * @alias cloudfunctions.projects.locations.functions.call - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function to be called. - * @param {().CallFunctionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - call(params?: any, options?: MethodOptions): - AxiosPromise; - call( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - call( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudfunctions.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @alias cloudfunctions.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Functions { + root: Cloudfunctions; + constructor(root: Cloudfunctions) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}:call') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudfunctions.projects.locations.functions.create - * @desc Creates a new function. If a function with the given name already - * exists in the specified project, the long running operation will return - * `ALREADY_EXISTS` error. - * @alias cloudfunctions.projects.locations.functions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The project and location in which the function should be created, specified in the format `projects/x/locations/x` - * @param {().CloudFunction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.call + * @desc Invokes synchronously deployed function. To be used for testing, + * very limited traffic allowed. + * @alias cloudfunctions.projects.locations.functions.call + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function to be called. + * @param {().CallFunctionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + call(params?: any, options?: MethodOptions): + AxiosPromise; + call( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + call( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}:call') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+location}/functions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['location'], - pathParams: ['location'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.delete - * @desc Deletes a function with the given name from the specified project. If - * the given function is used by some trigger, the trigger will be updated to - * remove this function. - * @alias cloudfunctions.projects.locations.functions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function which should be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudfunctions.projects.locations.functions.create + * @desc Creates a new function. If a function with the given name already + * exists in the specified project, the long running operation will return + * `ALREADY_EXISTS` error. + * @alias cloudfunctions.projects.locations.functions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The project and location in which the function should be created, specified in the format `projects/x/locations/x` + * @param {().CloudFunction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+location}/functions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['location'], + pathParams: ['location'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudfunctions.projects.locations.functions.generateDownloadUrl - * @desc Returns a signed URL for downloading deployed function source code. - * The URL is only valid for a limited period and should be used within - * minutes after generation. For more information about the signed URL usage - * see: https://cloud.google.com/storage/docs/access-control/signed-urls - * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of function for which source code Google Cloud Storage signed URL should be generated. - * @param {().GenerateDownloadUrlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateDownloadUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateDownloadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generateDownloadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}:generateDownloadUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudfunctions.projects.locations.functions.delete + * @desc Deletes a function with the given name from the specified project. + * If the given function is used by some trigger, the trigger will be + * updated to remove this function. + * @alias cloudfunctions.projects.locations.functions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function which should be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudfunctions.projects.locations.functions.generateUploadUrl - * @desc Returns a signed URL for uploading a function source code. For more - * information about the signed URL usage see: - * https://cloud.google.com/storage/docs/access-control/signed-urls Once the - * function source code upload is complete, the used signed URL should be - * provided in CreateFunction or UpdateFunction request as a reference to the - * function source code. When uploading source code to the generated signed - * URL, please follow these restrictions: * Source file type should be a zip - * file. * Source file size should not exceed 100MB limit. When making a HTTP - * PUT request, these two headers need to be specified: * `content-type: - * application/zip` * `x-goog-content-length-range: 0,104857600` - * @alias cloudfunctions.projects.locations.functions.generateUploadUrl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/x/locations/x`. - * @param {().GenerateUploadUrlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateUploadUrl(params?: any, options?: MethodOptions): - AxiosPromise; - generateUploadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateUploadUrl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudfunctions.projects.locations.functions.generateDownloadUrl + * @desc Returns a signed URL for downloading deployed function source code. + * The URL is only valid for a limited period and should be used within + * minutes after generation. For more information about the signed URL usage + * see: https://cloud.google.com/storage/docs/access-control/signed-urls + * @alias cloudfunctions.projects.locations.functions.generateDownloadUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of function for which source code Google Cloud Storage signed URL should be generated. + * @param {().GenerateDownloadUrlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateDownloadUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateDownloadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generateDownloadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}:generateDownloadUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+parent}/functions:generateUploadUrl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.get - * @desc Returns a function with the given name from the requested project. - * @alias cloudfunctions.projects.locations.functions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function which details should be obtained. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.generateUploadUrl + * @desc Returns a signed URL for uploading a function source code. For more + * information about the signed URL usage see: + * https://cloud.google.com/storage/docs/access-control/signed-urls Once the + * function source code upload is complete, the used signed URL should be + * provided in CreateFunction or UpdateFunction request as a reference to + * the function source code. When uploading source code to the generated + * signed URL, please follow these restrictions: * Source file type should + * be a zip file. * Source file size should not exceed 100MB limit. When + * making a HTTP PUT request, these two headers need to be specified: * + * `content-type: application/zip` * `x-goog-content-length-range: + * 0,104857600` + * @alias cloudfunctions.projects.locations.functions.generateUploadUrl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The project and location in which the Google Cloud Storage signed URL should be generated, specified in the format `projects/x/locations/x`. + * @param {().GenerateUploadUrlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateUploadUrl(params?: any, options?: MethodOptions): + AxiosPromise; + generateUploadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generateUploadUrl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+parent}/functions:generateUploadUrl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.list - * @desc Returns a list of functions that belong to the requested project. - * @alias cloudfunctions.projects.locations.functions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The project and location from which the function should be listed, specified in the format `projects/x/locations/x` If you want to list functions in all locations, use "-" in place of a location. - * @param {integer=} params.pageSize Maximum number of functions to return per call. - * @param {string=} params.pageToken The value returned by the last `ListFunctionsResponse`; indicates that this is a continuation of a prior `ListFunctions` call, and that the system should return the next page of data. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.get + * @desc Returns a function with the given name from the requested project. + * @alias cloudfunctions.projects.locations.functions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function which details should be obtained. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+location}/functions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['location'], - pathParams: ['location'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudfunctions.projects.locations.functions.update - * @desc Updates existing function. - * @alias cloudfunctions.projects.locations.functions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the function to be updated. - * @param {().CloudFunction} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudfunctions.projects.locations.functions.list + * @desc Returns a list of functions that belong to the requested project. + * @alias cloudfunctions.projects.locations.functions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The project and location from which the function should be listed, specified in the format `projects/x/locations/x` If you want to list functions in all locations, use "-" in place of a location. + * @param {integer=} params.pageSize Maximum number of functions to return per call. + * @param {string=} params.pageToken The value returned by the last `ListFunctionsResponse`; indicates that this is a continuation of a prior `ListFunctions` call, and that the system should return the next page of data. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+location}/functions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['location'], + pathParams: ['location'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudfunctions.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudfunctions.projects.locations.functions.update + * @desc Updates existing function. + * @alias cloudfunctions.projects.locations.functions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the function to be updated. + * @param {().CloudFunction} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudfunctions.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudiot/v1.ts b/src/apis/cloudiot/v1.ts index 0807bcae983..825892ab3f2 100644 --- a/src/apis/cloudiot/v1.ts +++ b/src/apis/cloudiot/v1.ts @@ -27,1577 +27,1607 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud IoT API - * - * Registers and manages IoT (Internet of Things) devices that connect to the - * Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const cloudiot = google.cloudiot('v1'); - * - * @namespace cloudiot - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudiot - */ -export class Cloudiot { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudiot_v1 { + /** + * Cloud IoT API + * + * Registers and manages IoT (Internet of Things) devices that connect to the + * Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const cloudiot = google.cloudiot('v1'); + * + * @namespace cloudiot + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudiot + */ + export class Cloudiot { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * The device resource. - */ -export interface Schema$Device { - /** - * If a device is blocked, connections or requests from this device will fail. - * Can be used to temporarily prevent the device from connecting if, for - * example, the sensor is generating bad data and needs maintenance. - */ - blocked: boolean; - /** - * The most recent device configuration, which is eventually sent from Cloud - * IoT Core to the device. If not present on creation, the configuration will - * be initialized with an empty payload and version value of `1`. To update - * this field after creation, use the - * `DeviceManager.ModifyCloudToDeviceConfig` method. - */ - config: Schema$DeviceConfig; - /** - * The credentials used to authenticate this device. To allow credential - * rotation without interruption, multiple device credentials can be bound to - * this device. No more than 3 credentials can be bound to a single device at - * a time. When new credentials are added to a device, they are verified - * against the registry credentials. For details, see the description of the - * `DeviceRegistry.credentials` field. - */ - credentials: Schema$DeviceCredential[]; - /** - * The user-defined device identifier. The device ID must be unique within a - * device registry. - */ - id: string; - /** - * [Output only] The last time a cloud-to-device config version acknowledgment - * was received from the device. This field is only for configurations sent - * through MQTT. - */ - lastConfigAckTime: string; /** - * [Output only] The last time a cloud-to-device config version was sent to - * the device. - */ - lastConfigSendTime: string; - /** - * [Output only] The error message of the most recent error, such as a failure - * to publish to Cloud Pub/Sub. 'last_error_time' is the timestamp of - * this field. If no errors have occurred, this field has an empty message and - * the status code 0 == OK. Otherwise, this field is expected to have a status - * code other than OK. - */ - lastErrorStatus: Schema$Status; - /** - * [Output only] The time the most recent error occurred, such as a failure to - * publish to Cloud Pub/Sub. This field is the timestamp of - * 'last_error_status'. - */ - lastErrorTime: string; + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * [Output only] The last time a telemetry event was received. Timestamps are - * periodically collected and written to storage; they may be stale by a few - * minutes. - */ - lastEventTime: string; + * The device resource. + */ + export interface Schema$Device { + /** + * If a device is blocked, connections or requests from this device will + * fail. Can be used to temporarily prevent the device from connecting if, + * for example, the sensor is generating bad data and needs maintenance. + */ + blocked: boolean; + /** + * The most recent device configuration, which is eventually sent from Cloud + * IoT Core to the device. If not present on creation, the configuration + * will be initialized with an empty payload and version value of `1`. To + * update this field after creation, use the + * `DeviceManager.ModifyCloudToDeviceConfig` method. + */ + config: Schema$DeviceConfig; + /** + * The credentials used to authenticate this device. To allow credential + * rotation without interruption, multiple device credentials can be bound + * to this device. No more than 3 credentials can be bound to a single + * device at a time. When new credentials are added to a device, they are + * verified against the registry credentials. For details, see the + * description of the `DeviceRegistry.credentials` field. + */ + credentials: Schema$DeviceCredential[]; + /** + * The user-defined device identifier. The device ID must be unique within a + * device registry. + */ + id: string; + /** + * [Output only] The last time a cloud-to-device config version + * acknowledgment was received from the device. This field is only for + * configurations sent through MQTT. + */ + lastConfigAckTime: string; + /** + * [Output only] The last time a cloud-to-device config version was sent to + * the device. + */ + lastConfigSendTime: string; + /** + * [Output only] The error message of the most recent error, such as a + * failure to publish to Cloud Pub/Sub. 'last_error_time' is the + * timestamp of this field. If no errors have occurred, this field has an + * empty message and the status code 0 == OK. Otherwise, this field is + * expected to have a status code other than OK. + */ + lastErrorStatus: Schema$Status; + /** + * [Output only] The time the most recent error occurred, such as a failure + * to publish to Cloud Pub/Sub. This field is the timestamp of + * 'last_error_status'. + */ + lastErrorTime: string; + /** + * [Output only] The last time a telemetry event was received. Timestamps + * are periodically collected and written to storage; they may be stale by a + * few minutes. + */ + lastEventTime: string; + /** + * [Output only] The last time an MQTT `PINGREQ` was received. This field + * applies only to devices connecting through MQTT. MQTT clients usually + * only send `PINGREQ` messages if the connection is idle, and no other + * messages have been sent. Timestamps are periodically collected and + * written to storage; they may be stale by a few minutes. + */ + lastHeartbeatTime: string; + /** + * [Output only] The last time a state event was received. Timestamps are + * periodically collected and written to storage; they may be stale by a few + * minutes. + */ + lastStateTime: string; + /** + * The metadata key-value pairs assigned to the device. This metadata is not + * interpreted or indexed by Cloud IoT Core. It can be used to add + * contextual information for the device. Keys must conform to the regular + * expression a-zA-Z+ and be less than 128 bytes in length. Values are + * free-form strings. Each value must be less than or equal to 32 KB in + * size. The total size of all keys and values must be less than 256 KB, + * and the maximum number of key-value pairs is 500. + */ + metadata: any; + /** + * The resource path name. For example, + * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or + * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. + * When `name` is populated as a response from the service, it always ends + * in the device numeric ID. + */ + name: string; + /** + * [Output only] A server-defined unique numeric ID for the device. This is + * a more compact way to identify devices, and it is globally unique. + */ + numId: string; + /** + * [Output only] The state most recently received from the device. If no + * state has been reported, this field is not present. + */ + state: Schema$DeviceState; + } /** - * [Output only] The last time an MQTT `PINGREQ` was received. This field - * applies only to devices connecting through MQTT. MQTT clients usually only - * send `PINGREQ` messages if the connection is idle, and no other messages - * have been sent. Timestamps are periodically collected and written to - * storage; they may be stale by a few minutes. - */ - lastHeartbeatTime: string; + * The device configuration. Eventually delivered to devices. + */ + export interface Schema$DeviceConfig { + /** + * The device configuration data. + */ + binaryData: string; + /** + * [Output only] The time at which this configuration version was updated in + * Cloud IoT Core. This timestamp is set by the server. + */ + cloudUpdateTime: string; + /** + * [Output only] The time at which Cloud IoT Core received the + * acknowledgment from the device, indicating that the device has received + * this configuration version. If this field is not present, the device has + * not yet acknowledged that it received this version. Note that when the + * config was sent to the device, many config versions may have been + * available in Cloud IoT Core while the device was disconnected, and on + * connection, only the latest version is sent to the device. Some versions + * may never be sent to the device, and therefore are never acknowledged. + * This timestamp is set by Cloud IoT Core. + */ + deviceAckTime: string; + /** + * [Output only] The version of this update. The version number is assigned + * by the server, and is always greater than 0 after device creation. The + * version must be 0 on the `CreateDevice` request if a `config` is + * specified; the response of `CreateDevice` will always have a value of 1. + */ + version: string; + } /** - * [Output only] The last time a state event was received. Timestamps are - * periodically collected and written to storage; they may be stale by a few - * minutes. - */ - lastStateTime: string; + * A server-stored device credential used for authentication. + */ + export interface Schema$DeviceCredential { + /** + * [Optional] The time at which this credential becomes invalid. This + * credential will be ignored for new client authentication requests after + * this timestamp; however, it will not be automatically deleted. + */ + expirationTime: string; + /** + * A public key used to verify the signature of JSON Web Tokens (JWTs). When + * adding a new device credential, either via device creation or via + * modifications, this public key credential may be required to be signed by + * one of the registry level certificates. More specifically, if the + * registry contains at least one certificate, any new device credential + * must be signed by one of the registry certificates. As a result, when the + * registry contains certificates, only X.509 certificates are accepted as + * device credentials. However, if the registry does not contain a + * certificate, self-signed certificates and public keys will be accepted. + * New device credentials must be different from every registry-level + * certificate. + */ + publicKey: Schema$PublicKeyCredential; + } /** - * The metadata key-value pairs assigned to the device. This metadata is not - * interpreted or indexed by Cloud IoT Core. It can be used to add contextual - * information for the device. Keys must conform to the regular expression - * a-zA-Z+ and be less than 128 bytes in length. Values are free-form - * strings. Each value must be less than or equal to 32 KB in size. The total - * size of all keys and values must be less than 256 KB, and the maximum - * number of key-value pairs is 500. - */ - metadata: any; + * A container for a group of devices. + */ + export interface Schema$DeviceRegistry { + /** + * The credentials used to verify the device credentials. No more than 10 + * credentials can be bound to a single registry at a time. The verification + * process occurs at the time of device creation or update. If this field is + * empty, no verification is performed. Otherwise, the credentials of a + * newly created device or added credentials of an updated device should be + * signed with one of these registry credentials. Note, however, that + * existing devices will never be affected by modifications to this list of + * credentials: after a device has been successfully created in a registry, + * it should be able to connect even if its registry credentials are + * revoked, deleted, or modified. + */ + credentials: Schema$RegistryCredential[]; + /** + * The configuration for notification of telemetry events received from the + * device. All telemetry events that were successfully published by the + * device and acknowledged by Cloud IoT Core are guaranteed to be delivered + * to Cloud Pub/Sub. If multiple configurations match a message, only the + * first matching configuration is used. If you try to publish a device + * telemetry event using MQTT without specifying a Cloud Pub/Sub topic for + * the device's registry, the connection closes automatically. If you + * try to do so using an HTTP connection, an error is returned. Up to 10 + * configurations may be provided. + */ + eventNotificationConfigs: Schema$EventNotificationConfig[]; + /** + * The DeviceService (HTTP) configuration for this device registry. + */ + httpConfig: Schema$HttpConfig; + /** + * The identifier of this device registry. For example, `myRegistry`. + */ + id: string; + /** + * The MQTT configuration for this device registry. + */ + mqttConfig: Schema$MqttConfig; + /** + * The resource path name. For example, + * `projects/example-project/locations/us-central1/registries/my-registry`. + */ + name: string; + /** + * The configuration for notification of new states received from the + * device. State updates are guaranteed to be stored in the state history, + * but notifications to Cloud Pub/Sub are not guaranteed. For example, if + * permissions are misconfigured or the specified topic doesn't exist, + * no notification will be published but the state will still be stored in + * Cloud IoT Core. + */ + stateNotificationConfig: Schema$StateNotificationConfig; + } /** - * The resource path name. For example, - * `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or - * `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. - * When `name` is populated as a response from the service, it always ends in - * the device numeric ID. - */ - name: string; + * The device state, as reported by the device. + */ + export interface Schema$DeviceState { + /** + * The device state data. + */ + binaryData: string; + /** + * [Output only] The time at which this state version was updated in Cloud + * IoT Core. + */ + updateTime: string; + } /** - * [Output only] A server-defined unique numeric ID for the device. This is a - * more compact way to identify devices, and it is globally unique. - */ - numId: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * The configuration for forwarding telemetry events. + */ + export interface Schema$EventNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName: string; + /** + * If the subfolder name matches this string exactly, this configuration + * will be used. The string must not include the leading '/' + * character. If empty, all strings are matched. This field is used only for + * telemetry events; subfolders are not supported for state changes. + */ + subfolderMatches: string; + } /** - * [Output only] The state most recently received from the device. If no state - * has been reported, this field is not present. + * Request message for `GetIamPolicy` method. */ - state: Schema$DeviceState; -} -/** - * The device configuration. Eventually delivered to devices. - */ -export interface Schema$DeviceConfig { + export interface Schema$GetIamPolicyRequest {} /** - * The device configuration data. + * The configuration of the HTTP bridge for a device registry. */ - binaryData: string; + export interface Schema$HttpConfig { + /** + * If enabled, allows devices to use DeviceService via the HTTP protocol. + * Otherwise, any requests to DeviceService will fail for this registry. + */ + httpEnabledState: string; + } /** - * [Output only] The time at which this configuration version was updated in - * Cloud IoT Core. This timestamp is set by the server. + * Response for `ListDeviceConfigVersions`. */ - cloudUpdateTime: string; + export interface Schema$ListDeviceConfigVersionsResponse { + /** + * The device configuration for the last few versions. Versions are listed + * in decreasing order, starting from the most recent one. + */ + deviceConfigs: Schema$DeviceConfig[]; + } /** - * [Output only] The time at which Cloud IoT Core received the acknowledgment - * from the device, indicating that the device has received this configuration - * version. If this field is not present, the device has not yet acknowledged - * that it received this version. Note that when the config was sent to the - * device, many config versions may have been available in Cloud IoT Core - * while the device was disconnected, and on connection, only the latest - * version is sent to the device. Some versions may never be sent to the - * device, and therefore are never acknowledged. This timestamp is set by - * Cloud IoT Core. - */ - deviceAckTime: string; + * Response for `ListDeviceRegistries`. + */ + export interface Schema$ListDeviceRegistriesResponse { + /** + * The registries that matched the query. + */ + deviceRegistries: Schema$DeviceRegistry[]; + /** + * If not empty, indicates that there may be more registries that match the + * request; this value should be passed in a new + * `ListDeviceRegistriesRequest`. + */ + nextPageToken: string; + } /** - * [Output only] The version of this update. The version number is assigned by - * the server, and is always greater than 0 after device creation. The version - * must be 0 on the `CreateDevice` request if a `config` is specified; the - * response of `CreateDevice` will always have a value of 1. - */ - version: string; -} -/** - * A server-stored device credential used for authentication. - */ -export interface Schema$DeviceCredential { + * Response for `ListDevices`. + */ + export interface Schema$ListDevicesResponse { + /** + * The devices that match the request. + */ + devices: Schema$Device[]; + /** + * If not empty, indicates that there may be more devices that match the + * request; this value should be passed in a new `ListDevicesRequest`. + */ + nextPageToken: string; + } /** - * [Optional] The time at which this credential becomes invalid. This - * credential will be ignored for new client authentication requests after - * this timestamp; however, it will not be automatically deleted. + * Response for `ListDeviceStates`. */ - expirationTime: string; + export interface Schema$ListDeviceStatesResponse { + /** + * The last few device states. States are listed in descending order of + * server update time, starting from the most recent one. + */ + deviceStates: Schema$DeviceState[]; + } /** - * A public key used to verify the signature of JSON Web Tokens (JWTs). When - * adding a new device credential, either via device creation or via - * modifications, this public key credential may be required to be signed by - * one of the registry level certificates. More specifically, if the registry - * contains at least one certificate, any new device credential must be signed - * by one of the registry certificates. As a result, when the registry - * contains certificates, only X.509 certificates are accepted as device - * credentials. However, if the registry does not contain a certificate, - * self-signed certificates and public keys will be accepted. New device - * credentials must be different from every registry-level certificate. - */ - publicKey: Schema$PublicKeyCredential; -} -/** - * A container for a group of devices. - */ -export interface Schema$DeviceRegistry { + * Request for `ModifyCloudToDeviceConfig`. + */ + export interface Schema$ModifyCloudToDeviceConfigRequest { + /** + * The configuration data for the device. + */ + binaryData: string; + /** + * The version number to update. If this value is zero, it will not check + * the version number of the server and will always update the current + * version; otherwise, this update will fail if the version number found on + * the server does not match this version number. This is used to support + * multiple simultaneous updates without losing data. + */ + versionToUpdate: string; + } /** - * The credentials used to verify the device credentials. No more than 10 - * credentials can be bound to a single registry at a time. The verification - * process occurs at the time of device creation or update. If this field is - * empty, no verification is performed. Otherwise, the credentials of a newly - * created device or added credentials of an updated device should be signed - * with one of these registry credentials. Note, however, that existing - * devices will never be affected by modifications to this list of - * credentials: after a device has been successfully created in a registry, it - * should be able to connect even if its registry credentials are revoked, - * deleted, or modified. + * The configuration of MQTT for a device registry. */ - credentials: Schema$RegistryCredential[]; + export interface Schema$MqttConfig { + /** + * If enabled, allows connections using the MQTT protocol. Otherwise, MQTT + * connections to this registry will fail. + */ + mqttEnabledState: string; + } /** - * The configuration for notification of telemetry events received from the - * device. All telemetry events that were successfully published by the device - * and acknowledged by Cloud IoT Core are guaranteed to be delivered to Cloud - * Pub/Sub. If multiple configurations match a message, only the first - * matching configuration is used. If you try to publish a device telemetry - * event using MQTT without specifying a Cloud Pub/Sub topic for the - * device's registry, the connection closes automatically. If you try to - * do so using an HTTP connection, an error is returned. Up to 10 - * configurations may be provided. - */ - eventNotificationConfigs: Schema$EventNotificationConfig[]; + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * The DeviceService (HTTP) configuration for this device registry. - */ - httpConfig: Schema$HttpConfig; + * A public key certificate format and data. + */ + export interface Schema$PublicKeyCertificate { + /** + * The certificate data. + */ + certificate: string; + /** + * The certificate format. + */ + format: string; + /** + * [Output only] The certificate details. Used only for X.509 certificates. + */ + x509Details: Schema$X509CertificateDetails; + } /** - * The identifier of this device registry. For example, `myRegistry`. - */ - id: string; + * A public key format and data. + */ + export interface Schema$PublicKeyCredential { + /** + * The format of the key. + */ + format: string; + /** + * The key data. + */ + key: string; + } /** - * The MQTT configuration for this device registry. + * A server-stored registry credential used to validate device credentials. */ - mqttConfig: Schema$MqttConfig; + export interface Schema$RegistryCredential { + /** + * A public key certificate used to verify the device credentials. + */ + publicKeyCertificate: Schema$PublicKeyCertificate; + } /** - * The resource path name. For example, - * `projects/example-project/locations/us-central1/registries/my-registry`. + * Request message for `SetIamPolicy` method. */ - name: string; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + } /** * The configuration for notification of new states received from the device. - * State updates are guaranteed to be stored in the state history, but - * notifications to Cloud Pub/Sub are not guaranteed. For example, if - * permissions are misconfigured or the specified topic doesn't exist, no - * notification will be published but the state will still be stored in Cloud - * IoT Core. - */ - stateNotificationConfig: Schema$StateNotificationConfig; -} -/** - * The device state, as reported by the device. - */ -export interface Schema$DeviceState { - /** - * The device state data. */ - binaryData: string; - /** - * [Output only] The time at which this state version was updated in Cloud IoT - * Core. - */ - updateTime: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The configuration for forwarding telemetry events. - */ -export interface Schema$EventNotificationConfig { - /** - * A Cloud Pub/Sub topic name. For example, - * `projects/myProject/topics/deviceEvents`. - */ - pubsubTopicName: string; - /** - * If the subfolder name matches this string exactly, this configuration will - * be used. The string must not include the leading '/' character. If - * empty, all strings are matched. This field is used only for telemetry - * events; subfolders are not supported for state changes. - */ - subfolderMatches: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The configuration of the HTTP bridge for a device registry. - */ -export interface Schema$HttpConfig { - /** - * If enabled, allows devices to use DeviceService via the HTTP protocol. - * Otherwise, any requests to DeviceService will fail for this registry. - */ - httpEnabledState: string; -} -/** - * Response for `ListDeviceConfigVersions`. - */ -export interface Schema$ListDeviceConfigVersionsResponse { - /** - * The device configuration for the last few versions. Versions are listed in - * decreasing order, starting from the most recent one. - */ - deviceConfigs: Schema$DeviceConfig[]; -} -/** - * Response for `ListDeviceRegistries`. - */ -export interface Schema$ListDeviceRegistriesResponse { - /** - * The registries that matched the query. - */ - deviceRegistries: Schema$DeviceRegistry[]; - /** - * If not empty, indicates that there may be more registries that match the - * request; this value should be passed in a new - * `ListDeviceRegistriesRequest`. - */ - nextPageToken: string; -} -/** - * Response for `ListDevices`. - */ -export interface Schema$ListDevicesResponse { - /** - * The devices that match the request. - */ - devices: Schema$Device[]; - /** - * If not empty, indicates that there may be more devices that match the - * request; this value should be passed in a new `ListDevicesRequest`. - */ - nextPageToken: string; -} -/** - * Response for `ListDeviceStates`. - */ -export interface Schema$ListDeviceStatesResponse { - /** - * The last few device states. States are listed in descending order of server - * update time, starting from the most recent one. - */ - deviceStates: Schema$DeviceState[]; -} -/** - * Request for `ModifyCloudToDeviceConfig`. - */ -export interface Schema$ModifyCloudToDeviceConfigRequest { - /** - * The configuration data for the device. - */ - binaryData: string; - /** - * The version number to update. If this value is zero, it will not check the - * version number of the server and will always update the current version; - * otherwise, this update will fail if the version number found on the server - * does not match this version number. This is used to support multiple - * simultaneous updates without losing data. - */ - versionToUpdate: string; -} -/** - * The configuration of MQTT for a device registry. - */ -export interface Schema$MqttConfig { - /** - * If enabled, allows connections using the MQTT protocol. Otherwise, MQTT - * connections to this registry will fail. - */ - mqttEnabledState: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * A public key certificate format and data. - */ -export interface Schema$PublicKeyCertificate { - /** - * The certificate data. - */ - certificate: string; - /** - * The certificate format. - */ - format: string; - /** - * [Output only] The certificate details. Used only for X.509 certificates. - */ - x509Details: Schema$X509CertificateDetails; -} -/** - * A public key format and data. - */ -export interface Schema$PublicKeyCredential { - /** - * The format of the key. - */ - format: string; - /** - * The key data. - */ - key: string; -} -/** - * A server-stored registry credential used to validate device credentials. - */ -export interface Schema$RegistryCredential { - /** - * A public key certificate used to verify the device credentials. - */ - publicKeyCertificate: Schema$PublicKeyCertificate; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * The configuration for notification of new states received from the device. - */ -export interface Schema$StateNotificationConfig { - /** - * A Cloud Pub/Sub topic name. For example, - * `projects/myProject/topics/deviceEvents`. - */ - pubsubTopicName: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * Details of an X.509 certificate. For informational purposes only. - */ -export interface Schema$X509CertificateDetails { - /** - * The time the certificate becomes invalid. - */ - expiryTime: string; - /** - * The entity that signed the certificate. - */ - issuer: string; - /** - * The type of public key in the certificate. - */ - publicKeyType: string; + export interface Schema$StateNotificationConfig { + /** + * A Cloud Pub/Sub topic name. For example, + * `projects/myProject/topics/deviceEvents`. + */ + pubsubTopicName: string; + } /** - * The algorithm used to sign the certificate. - */ - signatureAlgorithm: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The time the certificate becomes valid. + * Request message for `TestIamPermissions` method. */ - startTime: string; + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The entity the certificate and public key belong to. + * Response message for `TestIamPermissions` method. */ - subject: string; -} - -export class Resource$Projects { - root: Cloudiot; - locations: Resource$Projects$Locations; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - } - - getRoot() { - return this.root; + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } -} -export class Resource$Projects$Locations { - root: Cloudiot; - registries: Resource$Projects$Locations$Registries; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - this.registries = new Resource$Projects$Locations$Registries(root); + /** + * Details of an X.509 certificate. For informational purposes only. + */ + export interface Schema$X509CertificateDetails { + /** + * The time the certificate becomes invalid. + */ + expiryTime: string; + /** + * The entity that signed the certificate. + */ + issuer: string; + /** + * The type of public key in the certificate. + */ + publicKeyType: string; + /** + * The algorithm used to sign the certificate. + */ + signatureAlgorithm: string; + /** + * The time the certificate becomes valid. + */ + startTime: string; + /** + * The entity the certificate and public key belong to. + */ + subject: string; } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations$Registries { - root: Cloudiot; - devices: Resource$Projects$Locations$Registries$Devices; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - this.devices = new Resource$Projects$Locations$Registries$Devices(root); - } + export class Resource$Projects { + root: Cloudiot; + locations: Resource$Projects$Locations; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } + export class Resource$Projects$Locations { + root: Cloudiot; + registries: Resource$Projects$Locations$Registries; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); + this.registries = new Resource$Projects$Locations$Registries(root); + } - - /** - * cloudiot.projects.locations.registries.create - * @desc Creates a device registry that contains devices. - * @alias cloudiot.projects.locations.registries.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The project and cloud region where this device registry must be created. For example, `projects/example-project/locations/us-central1`. - * @param {().DeviceRegistry} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Registries { + root: Cloudiot; + devices: Resource$Projects$Locations$Registries$Devices; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); + this.devices = new Resource$Projects$Locations$Registries$Devices(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/registries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudiot.projects.locations.registries.delete - * @desc Deletes a device registry configuration. - * @alias cloudiot.projects.locations.registries.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudiot.projects.locations.registries.create + * @desc Creates a device registry that contains devices. + * @alias cloudiot.projects.locations.registries.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The project and cloud region where this device registry must be created. For example, `projects/example-project/locations/us-central1`. + * @param {().DeviceRegistry} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/registries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudiot.projects.locations.registries.get - * @desc Gets a device registry configuration. - * @alias cloudiot.projects.locations.registries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudiot.projects.locations.registries.delete + * @desc Deletes a device registry configuration. + * @alias cloudiot.projects.locations.registries.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias cloudiot.projects.locations.registries.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudiot.projects.locations.registries.get + * @desc Gets a device registry configuration. + * @alias cloudiot.projects.locations.registries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device registry. For example, `projects/example-project/locations/us-central1/registries/my-registry`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.list - * @desc Lists device registries. - * @alias cloudiot.projects.locations.registries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of registries to return in the response. If this value is zero, the service will select a default size. A call may return fewer objects than requested, but if there is a non-empty `page_token`, it indicates that more entries are available. - * @param {string=} params.pageToken The value returned by the last `ListDeviceRegistriesResponse`; indicates that this is a continuation of a prior `ListDeviceRegistries` call, and that the system should return the next page of data. - * @param {string} params.parent The project and cloud region path. For example, `projects/example-project/locations/us-central1`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/registries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudiot.projects.locations.registries.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias cloudiot.projects.locations.registries.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudiot.projects.locations.registries.patch - * @desc Updates a device registry configuration. - * @alias cloudiot.projects.locations.registries.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource path name. For example, `projects/example-project/locations/us-central1/registries/my-registry`. - * @param {string=} params.updateMask Only updates the `device_registry` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `event_notification_config`, `http_config`, `mqtt_config`, and `state_notification_config`. - * @param {().DeviceRegistry} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudiot.projects.locations.registries.list + * @desc Lists device registries. + * @alias cloudiot.projects.locations.registries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of registries to return in the response. If this value is zero, the service will select a default size. A call may return fewer objects than requested, but if there is a non-empty `page_token`, it indicates that more entries are available. + * @param {string=} params.pageToken The value returned by the last `ListDeviceRegistriesResponse`; indicates that this is a continuation of a prior `ListDeviceRegistries` call, and that the system should return the next page of data. + * @param {string} params.parent The project and cloud region path. For example, `projects/example-project/locations/us-central1`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/registries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * cloudiot.projects.locations.registries.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias cloudiot.projects.locations.registries.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudiot.projects.locations.registries.patch + * @desc Updates a device registry configuration. + * @alias cloudiot.projects.locations.registries.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource path name. For example, `projects/example-project/locations/us-central1/registries/my-registry`. + * @param {string=} params.updateMask Only updates the `device_registry` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `event_notification_config`, `http_config`, `mqtt_config`, and `state_notification_config`. + * @param {().DeviceRegistry} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. - * @alias cloudiot.projects.locations.registries.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudiot.projects.locations.registries.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias cloudiot.projects.locations.registries.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Locations$Registries$Devices { - root: Cloudiot; - configVersions: Resource$Projects$Locations$Registries$Devices$Configversions; - states: Resource$Projects$Locations$Registries$Devices$States; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - this.configVersions = - new Resource$Projects$Locations$Registries$Devices$Configversions(root); - this.states = - new Resource$Projects$Locations$Registries$Devices$States(root); - } - - getRoot() { - return this.root; - } - /** - * cloudiot.projects.locations.registries.devices.create - * @desc Creates a device in a device registry. - * @alias cloudiot.projects.locations.registries.devices.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The name of the device registry where this device should be created. For example, `projects/example-project/locations/us-central1/registries/my-registry`. - * @param {().Device} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudiot.projects.locations.registries.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * @alias cloudiot.projects.locations.registries.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Registries$Devices { + root: Cloudiot; + configVersions: + Resource$Projects$Locations$Registries$Devices$Configversions; + states: Resource$Projects$Locations$Registries$Devices$States; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); + this.configVersions = + new Resource$Projects$Locations$Registries$Devices$Configversions( + root); + this.states = + new Resource$Projects$Locations$Registries$Devices$States(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudiot.projects.locations.registries.devices.delete - * @desc Deletes a device. - * @alias cloudiot.projects.locations.registries.devices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudiot.projects.locations.registries.devices.create + * @desc Creates a device in a device registry. + * @alias cloudiot.projects.locations.registries.devices.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The name of the device registry where this device should be created. For example, `projects/example-project/locations/us-central1/registries/my-registry`. + * @param {().Device} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.devices.get - * @desc Gets details about a device. - * @alias cloudiot.projects.locations.registries.devices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fieldMask The fields of the `Device` resource to be returned in the response. If the field mask is unset or empty, all fields are returned. - * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudiot.projects.locations.registries.devices.delete + * @desc Deletes a device. + * @alias cloudiot.projects.locations.registries.devices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.devices.list - * @desc List devices in a device registry. - * @alias cloudiot.projects.locations.registries.devices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.deviceIds A list of device string identifiers. If empty, it will ignore this field. For example, `['device0', 'device12']`. This field cannot hold more than 10,000 entries. - * @param {string=} params.deviceNumIds A list of device numerical ids. If empty, it will ignore this field. This field cannot hold more than 10,000 entries. - * @param {string=} params.fieldMask The fields of the `Device` resource to be returned in the response. The fields `id`, and `num_id` are always returned by default, along with any other fields specified. - * @param {integer=} params.pageSize The maximum number of devices to return in the response. If this value is zero, the service will select a default size. A call may return fewer objects than requested, but if there is a non-empty `page_token`, it indicates that more entries are available. - * @param {string=} params.pageToken The value returned by the last `ListDevicesResponse`; indicates that this is a continuation of a prior `ListDevices` call, and that the system should return the next page of data. - * @param {string} params.parent The device registry path. Required. For example, `projects/my-project/locations/us-central1/registries/my-registry`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudiot.projects.locations.registries.devices.get + * @desc Gets details about a device. + * @alias cloudiot.projects.locations.registries.devices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fieldMask The fields of the `Device` resource to be returned in the response. If the field mask is unset or empty, all fields are returned. + * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/devices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig - * @desc Modifies the configuration for the device, which is eventually sent - * from the Cloud IoT Core servers. Returns the modified configuration version - * and its metadata. - * @alias - * cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. - * @param {().ModifyCloudToDeviceConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyCloudToDeviceConfig(params?: any, options?: MethodOptions): - AxiosPromise; - modifyCloudToDeviceConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyCloudToDeviceConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:modifyCloudToDeviceConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudiot.projects.locations.registries.devices.list + * @desc List devices in a device registry. + * @alias cloudiot.projects.locations.registries.devices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.deviceIds A list of device string identifiers. If empty, it will ignore this field. For example, `['device0', 'device12']`. This field cannot hold more than 10,000 entries. + * @param {string=} params.deviceNumIds A list of device numerical ids. If empty, it will ignore this field. This field cannot hold more than 10,000 entries. + * @param {string=} params.fieldMask The fields of the `Device` resource to be returned in the response. The fields `id`, and `num_id` are always returned by default, along with any other fields specified. + * @param {integer=} params.pageSize The maximum number of devices to return in the response. If this value is zero, the service will select a default size. A call may return fewer objects than requested, but if there is a non-empty `page_token`, it indicates that more entries are available. + * @param {string=} params.pageToken The value returned by the last `ListDevicesResponse`; indicates that this is a continuation of a prior `ListDevices` call, and that the system should return the next page of data. + * @param {string} params.parent The device registry path. Required. For example, `projects/my-project/locations/us-central1/registries/my-registry`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/devices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudiot.projects.locations.registries.devices.patch - * @desc Updates a device. - * @alias cloudiot.projects.locations.registries.devices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource path name. For example, `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. When `name` is populated as a response from the service, it always ends in the device numeric ID. - * @param {string=} params.updateMask Only updates the `device` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `credentials`, `blocked`, and `metadata` - * @param {().Device} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig + * @desc Modifies the configuration for the device, which is eventually sent + * from the Cloud IoT Core servers. Returns the modified configuration + * version and its metadata. + * @alias + * cloudiot.projects.locations.registries.devices.modifyCloudToDeviceConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * @param {().ModifyCloudToDeviceConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyCloudToDeviceConfig(params?: any, options?: MethodOptions): + AxiosPromise; + modifyCloudToDeviceConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyCloudToDeviceConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:modifyCloudToDeviceConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Registries$Devices$Configversions { - root: Cloudiot; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } - - /** - * cloudiot.projects.locations.registries.devices.configVersions.list - * @desc Lists the last few versions of the device configuration in descending - * order (i.e.: newest first). - * @alias cloudiot.projects.locations.registries.devices.configVersions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. - * @param {integer=} params.numVersions The number of versions to list. Versions are listed in decreasing order of the version number. The maximum number of versions retained is 10. If this value is zero, it will return all the versions available. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudiot.projects.locations.registries.devices.patch + * @desc Updates a device. + * @alias cloudiot.projects.locations.registries.devices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource path name. For example, `projects/p1/locations/us-central1/registries/registry0/devices/dev0` or `projects/p1/locations/us-central1/registries/registry0/devices/{num_id}`. When `name` is populated as a response from the service, it always ends in the device numeric ID. + * @param {string=} params.updateMask Only updates the `device` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `credentials`, `blocked`, and `metadata` + * @param {().Device} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Registries$Devices$Configversions { + root: Cloudiot; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/configVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Locations$Registries$Devices$States { - root: Cloudiot; - constructor(root: Cloudiot) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * cloudiot.projects.locations.registries.devices.configVersions.list + * @desc Lists the last few versions of the device configuration in + * descending order (i.e.: newest first). + * @alias cloudiot.projects.locations.registries.devices.configVersions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * @param {integer=} params.numVersions The number of versions to list. Versions are listed in decreasing order of the version number. The maximum number of versions retained is 10. If this value is zero, it will return all the versions available. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/configVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * cloudiot.projects.locations.registries.devices.states.list - * @desc Lists the last few versions of the device state in descending order - * (i.e.: newest first). - * @alias cloudiot.projects.locations.registries.devices.states.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. - * @param {integer=} params.numStates The number of states to list. States are listed in descending order of update time. The maximum number of states retained is 10. If this value is zero, it will return all the states available. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Locations$Registries$Devices$States { + root: Cloudiot; + constructor(root: Cloudiot) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/states').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudiot.projects.locations.registries.devices.states.list + * @desc Lists the last few versions of the device state in descending order + * (i.e.: newest first). + * @alias cloudiot.projects.locations.registries.devices.states.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the device. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0` or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. + * @param {integer=} params.numStates The number of states to list. States are listed in descending order of update time. The maximum number of states retained is 10. If this value is zero, it will return all the states available. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudiot.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/states') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudkms/v1.ts b/src/apis/cloudkms/v1.ts index 57e748f9501..ff39ff67f2b 100644 --- a/src/apis/cloudkms/v1.ts +++ b/src/apis/cloudkms/v1.ts @@ -27,1873 +27,1898 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Key Management Service (KMS) API - * - * Manages encryption for your cloud services the same way you do on-premises. - * You can generate, use, rotate, and destroy AES256 encryption keys. - * - * @example - * const google = require('googleapis'); - * const cloudkms = google.cloudkms('v1'); - * - * @namespace cloudkms - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudkms - */ -export class Cloudkms { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A CryptoKey represents a logical key that can be used for cryptographic - * operations. A CryptoKey is made up of one or more versions, which represent - * the actual key material used in cryptographic operations. - */ -export interface Schema$CryptoKey { - /** - * Output only. The time at which this CryptoKey was created. - */ - createTime: string; - /** - * Labels with user-defined metadata. For more information, see [Labeling - * Keys](/kms/docs/labeling-keys). - */ - labels: any; - /** - * Output only. The resource name for this CryptoKey in the format - * `projects/x/locations/x/keyRings/x/cryptoKeys/x. - */ - name: string; - /** - * At next_rotation_time, the Key Management Service will automatically: 1. - * Create a new version of this CryptoKey. 2. Mark the new version as primary. - * Key rotations performed manually via CreateCryptoKeyVersion and - * UpdateCryptoKeyPrimaryVersion do not affect next_rotation_time. - */ - nextRotationTime: string; - /** - * Output only. A copy of the "primary" CryptoKeyVersion that will - * be used by Encrypt when this CryptoKey is given in EncryptRequest.name. The - * CryptoKey's primary version can be updated via - * UpdateCryptoKeyPrimaryVersion. - */ - primary: Schema$CryptoKeyVersion; - /** - * The immutable purpose of this CryptoKey. Currently, the only acceptable - * purpose is ENCRYPT_DECRYPT. - */ - purpose: string; - /** - * next_rotation_time will be advanced by this period when the service - * automatically rotates a key. Must be at least one day. If rotation_period - * is set, next_rotation_time must also be set. - */ - rotationPeriod: string; -} -/** - * A CryptoKeyVersion represents an individual cryptographic key, and the - * associated key material. It can be used for cryptographic operations either - * directly, or via its parent CryptoKey, in which case the server will choose - * the appropriate version for the operation. For security reasons, the raw - * cryptographic key material represented by a CryptoKeyVersion can never be - * viewed or exported. It can only be used to encrypt or decrypt data when an - * authorized user or application invokes Cloud KMS. - */ -export interface Schema$CryptoKeyVersion { - /** - * Output only. The time at which this CryptoKeyVersion was created. - */ - createTime: string; - /** - * Output only. The time this CryptoKeyVersion's key material was - * destroyed. Only present if state is DESTROYED. - */ - destroyEventTime: string; - /** - * Output only. The time this CryptoKeyVersion's key material is scheduled - * for destruction. Only present if state is DESTROY_SCHEDULED. - */ - destroyTime: string; - /** - * Output only. The resource name for this CryptoKeyVersion in the format - * `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x. - */ - name: string; - /** - * The current state of the CryptoKeyVersion. - */ - state: string; -} -/** - * Request message for KeyManagementService.Decrypt. - */ -export interface Schema$DecryptRequest { - /** - * Optional data that must match the data originally supplied in - * EncryptRequest.additional_authenticated_data. - */ - additionalAuthenticatedData: string; - /** - * Required. The encrypted data originally returned in - * EncryptResponse.ciphertext. - */ - ciphertext: string; -} -/** - * Response message for KeyManagementService.Decrypt. - */ -export interface Schema$DecryptResponse { - /** - * The decrypted data originally supplied in EncryptRequest.plaintext. - */ - plaintext: string; -} -/** - * Request message for KeyManagementService.DestroyCryptoKeyVersion. - */ -export interface Schema$DestroyCryptoKeyVersionRequest {} -/** - * Request message for KeyManagementService.Encrypt. - */ -export interface Schema$EncryptRequest { - /** - * Optional data that, if specified, must also be provided during decryption - * through DecryptRequest.additional_authenticated_data. Must be no larger - * than 64KiB. - */ - additionalAuthenticatedData: string; - /** - * Required. The data to encrypt. Must be no larger than 64KiB. - */ - plaintext: string; -} -/** - * Response message for KeyManagementService.Encrypt. - */ -export interface Schema$EncryptResponse { - /** - * The encrypted data. - */ - ciphertext: string; - /** - * The resource name of the CryptoKeyVersion used in encryption. - */ - name: string; -} -/** - * A KeyRing is a toplevel logical grouping of CryptoKeys. - */ -export interface Schema$KeyRing { - /** - * Output only. The time at which this KeyRing was created. - */ - createTime: string; - /** - * Output only. The resource name for the KeyRing in the format - * `projects/x/locations/x/keyRings/x. - */ - name: string; -} -/** - * Response message for KeyManagementService.ListCryptoKeys. - */ -export interface Schema$ListCryptoKeysResponse { - /** - * The list of CryptoKeys. - */ - cryptoKeys: Schema$CryptoKey[]; - /** - * A token to retrieve next page of results. Pass this value in - * ListCryptoKeysRequest.page_token to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The total number of CryptoKeys that matched the query. - */ - totalSize: number; -} -/** - * Response message for KeyManagementService.ListCryptoKeyVersions. - */ -export interface Schema$ListCryptoKeyVersionsResponse { - /** - * The list of CryptoKeyVersions. - */ - cryptoKeyVersions: Schema$CryptoKeyVersion[]; - /** - * A token to retrieve next page of results. Pass this value in - * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of - * results. - */ - nextPageToken: string; - /** - * The total number of CryptoKeyVersions that matched the query. - */ - totalSize: number; -} -/** - * Response message for KeyManagementService.ListKeyRings. - */ -export interface Schema$ListKeyRingsResponse { - /** - * The list of KeyRings. - */ - keyRings: Schema$KeyRing[]; - /** - * A token to retrieve next page of results. Pass this value in - * ListKeyRingsRequest.page_token to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The total number of KeyRings that matched the query. - */ - totalSize: number; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Request message for KeyManagementService.RestoreCryptoKeyVersion. - */ -export interface Schema$RestoreCryptoKeyVersionRequest {} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. - */ -export interface Schema$UpdateCryptoKeyPrimaryVersionRequest { - /** - * The id of the child CryptoKeyVersion to use as primary. - */ - cryptoKeyVersionId: string; -} - -export class Resource$Projects { - root: Cloudkms; - locations: Resource$Projects$Locations; - constructor(root: Cloudkms) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations { - root: Cloudkms; - keyRings: Resource$Projects$Locations$Keyrings; - constructor(root: Cloudkms) { - this.root = root; - this.getRoot.bind(this); - this.keyRings = new Resource$Projects$Locations$Keyrings(root); - } - - getRoot() { - return this.root; - } - - +export namespace cloudkms_v1 { /** - * cloudkms.projects.locations.get - * @desc Gets information about a location. - * @alias cloudkms.projects.locations.get - * @memberOf! () + * Cloud Key Management Service (KMS) API * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudkms.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @alias cloudkms.projects.locations.list - * @memberOf! () + * Manages encryption for your cloud services the same way you do on-premises. + * You can generate, use, rotate, and destroy AES256 encryption keys. + * + * @example + * const google = require('googleapis'); + * const cloudkms = google.cloudkms('v1'); * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace cloudkms + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudkms */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Keyrings { - root: Cloudkms; - cryptoKeys: Resource$Projects$Locations$Keyrings$Cryptokeys; - constructor(root: Cloudkms) { - this.root = root; - this.getRoot.bind(this); - this.cryptoKeys = new Resource$Projects$Locations$Keyrings$Cryptokeys(root); - } + export class Cloudkms { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + projects: Resource$Projects; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * cloudkms.projects.locations.keyRings.create - * @desc Create a new KeyRing in a given Project and Location. - * @alias cloudkms.projects.locations.keyRings.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.keyRingId Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63}` - * @param {string} params.parent Required. The resource name of the location associated with the KeyRings, in the format `projects/x/locations/x`. - * @param {().KeyRing} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/keyRings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + this.projects = new Resource$Projects(this); } - } - - /** - * cloudkms.projects.locations.keyRings.get - * @desc Returns metadata for a given KeyRing. - * @alias cloudkms.projects.locations.keyRings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the KeyRing to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * cloudkms.projects.locations.keyRings.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias cloudkms.projects.locations.keyRings.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; } - - /** - * cloudkms.projects.locations.keyRings.list - * @desc Lists KeyRings. - * @alias cloudkms.projects.locations.keyRings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of KeyRings to include in the response. Further KeyRings can subsequently be obtained by including the ListKeyRingsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken Optional pagination token, returned earlier via ListKeyRingsResponse.next_page_token. - * @param {string} params.parent Required. The resource name of the location associated with the KeyRings, in the format `projects/x/locations/x`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/keyRings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; } - - /** - * cloudkms.projects.locations.keyRings.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias cloudkms.projects.locations.keyRings.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; } - - /** - * cloudkms.projects.locations.keyRings.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias cloudkms.projects.locations.keyRings.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Keyrings$Cryptokeys { - root: Cloudkms; - cryptoKeyVersions: - Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions; - constructor(root: Cloudkms) { - this.root = root; - this.getRoot.bind(this); - this.cryptoKeyVersions = - new Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions( - root); + * A CryptoKey represents a logical key that can be used for cryptographic + * operations. A CryptoKey is made up of one or more versions, which + * represent the actual key material used in cryptographic operations. + */ + export interface Schema$CryptoKey { + /** + * Output only. The time at which this CryptoKey was created. + */ + createTime: string; + /** + * Labels with user-defined metadata. For more information, see [Labeling + * Keys](/kms/docs/labeling-keys). + */ + labels: any; + /** + * Output only. The resource name for this CryptoKey in the format + * `projects/x/locations/x/keyRings/x/cryptoKeys/x. + */ + name: string; + /** + * At next_rotation_time, the Key Management Service will automatically: 1. + * Create a new version of this CryptoKey. 2. Mark the new version as + * primary. Key rotations performed manually via CreateCryptoKeyVersion and + * UpdateCryptoKeyPrimaryVersion do not affect next_rotation_time. + */ + nextRotationTime: string; + /** + * Output only. A copy of the "primary" CryptoKeyVersion that will + * be used by Encrypt when this CryptoKey is given in EncryptRequest.name. + * The CryptoKey's primary version can be updated via + * UpdateCryptoKeyPrimaryVersion. + */ + primary: Schema$CryptoKeyVersion; + /** + * The immutable purpose of this CryptoKey. Currently, the only acceptable + * purpose is ENCRYPT_DECRYPT. + */ + purpose: string; + /** + * next_rotation_time will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. If + * rotation_period is set, next_rotation_time must also be set. + */ + rotationPeriod: string; } - - getRoot() { - return this.root; + /** + * A CryptoKeyVersion represents an individual cryptographic key, and the + * associated key material. It can be used for cryptographic operations + * either directly, or via its parent CryptoKey, in which case the server will + * choose the appropriate version for the operation. For security reasons, + * the raw cryptographic key material represented by a CryptoKeyVersion can + * never be viewed or exported. It can only be used to encrypt or decrypt data + * when an authorized user or application invokes Cloud KMS. + */ + export interface Schema$CryptoKeyVersion { + /** + * Output only. The time at which this CryptoKeyVersion was created. + */ + createTime: string; + /** + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if state is DESTROYED. + */ + destroyEventTime: string; + /** + * Output only. The time this CryptoKeyVersion's key material is + * scheduled for destruction. Only present if state is DESTROY_SCHEDULED. + */ + destroyTime: string; + /** + * Output only. The resource name for this CryptoKeyVersion in the format + * `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x. + */ + name: string; + /** + * The current state of the CryptoKeyVersion. + */ + state: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.create - * @desc Create a new CryptoKey within a KeyRing. CryptoKey.purpose is - * required. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.cryptoKeyId Required. It must be unique within a KeyRing and match the regular expression `[a-zA-Z0-9_-]{1,63}` - * @param {string} params.parent Required. The name of the KeyRing associated with the CryptoKeys. - * @param {().CryptoKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/cryptoKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for KeyManagementService.Decrypt. + */ + export interface Schema$DecryptRequest { + /** + * Optional data that must match the data originally supplied in + * EncryptRequest.additional_authenticated_data. + */ + additionalAuthenticatedData: string; + /** + * Required. The encrypted data originally returned in + * EncryptResponse.ciphertext. + */ + ciphertext: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.decrypt - * @desc Decrypts data that was protected by Encrypt. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.decrypt - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the CryptoKey to use for decryption. The server will choose the appropriate version. - * @param {().DecryptRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for KeyManagementService.Decrypt. */ - decrypt(params?: any, options?: MethodOptions): - AxiosPromise; - decrypt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - decrypt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:decrypt').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$DecryptResponse { + /** + * The decrypted data originally supplied in EncryptRequest.plaintext. + */ + plaintext: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.encrypt - * @desc Encrypts data, so that it can only be recovered by a call to Decrypt. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.encrypt - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the CryptoKey or CryptoKeyVersion to use for encryption. If a CryptoKey is specified, the server will use its primary version. - * @param {().EncryptRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for KeyManagementService.DestroyCryptoKeyVersion. */ - encrypt(params?: any, options?: MethodOptions): - AxiosPromise; - encrypt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - encrypt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:encrypt').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - + export interface Schema$DestroyCryptoKeyVersionRequest {} /** - * cloudkms.projects.locations.keyRings.cryptoKeys.get - * @desc Returns metadata for a given CryptoKey, as well as its primary - * CryptoKeyVersion. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the CryptoKey to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for KeyManagementService.Encrypt. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$EncryptRequest { + /** + * Optional data that, if specified, must also be provided during decryption + * through DecryptRequest.additional_authenticated_data. Must be no larger + * than 64KiB. + */ + additionalAuthenticatedData: string; + /** + * Required. The data to encrypt. Must be no larger than 64KiB. + */ + plaintext: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for KeyManagementService.Encrypt. + */ + export interface Schema$EncryptResponse { + /** + * The encrypted data. + */ + ciphertext: string; + /** + * The resource name of the CryptoKeyVersion used in encryption. + */ + name: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.list - * @desc Lists CryptoKeys. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of CryptoKeys to include in the response. Further CryptoKeys can subsequently be obtained by including the ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token. - * @param {string} params.parent Required. The resource name of the KeyRing to list, in the format `projects/x/locations/x/keyRings/x`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/cryptoKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A KeyRing is a toplevel logical grouping of CryptoKeys. + */ + export interface Schema$KeyRing { + /** + * Output only. The time at which this KeyRing was created. + */ + createTime: string; + /** + * Output only. The resource name for the KeyRing in the format + * `projects/x/locations/x/keyRings/x. + */ + name: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.patch - * @desc Update a CryptoKey. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The resource name for this CryptoKey in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x`. - * @param {string=} params.updateMask Required list of fields to be updated in this request. - * @param {().CryptoKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for KeyManagementService.ListCryptoKeys. + */ + export interface Schema$ListCryptoKeysResponse { + /** + * The list of CryptoKeys. + */ + cryptoKeys: Schema$CryptoKey[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeysRequest.page_token to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The total number of CryptoKeys that matched the query. + */ + totalSize: number; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for KeyManagementService.ListCryptoKeyVersions. + */ + export interface Schema$ListCryptoKeyVersionsResponse { + /** + * The list of CryptoKeyVersions. + */ + cryptoKeyVersions: Schema$CryptoKeyVersion[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListCryptoKeyVersionsRequest.page_token to retrieve the next page of + * results. + */ + nextPageToken: string; + /** + * The total number of CryptoKeyVersions that matched the query. + */ + totalSize: number; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for KeyManagementService.ListKeyRings. + */ + export interface Schema$ListKeyRingsResponse { + /** + * The list of KeyRings. + */ + keyRings: Schema$KeyRing[]; + /** + * A token to retrieve next page of results. Pass this value in + * ListKeyRingsRequest.page_token to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The total number of KeyRings that matched the query. + */ + totalSize: number; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion - * @desc Update the version of a CryptoKey that will be used in Encrypt - * @alias cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the CryptoKey to update. - * @param {().UpdateCryptoKeyPrimaryVersionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatePrimaryVersion(params?: any, options?: MethodOptions): - AxiosPromise; - updatePrimaryVersion( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updatePrimaryVersion( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:updatePrimaryVersion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; } -} -export class Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions { - root: Cloudkms; - constructor(root: Cloudkms) { - this.root = root; - this.getRoot.bind(this); + /** + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; } - - getRoot() { - return this.root; + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create - * @desc Create a new CryptoKeyVersion in a CryptoKey. The server will assign - * the next sequential id. If unset, state will be set to ENABLED. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the CryptoKey associated with the CryptoKeyVersions. - * @param {().CryptoKeyVersion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/cryptoKeyVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for KeyManagementService.RestoreCryptoKeyVersion. + */ + export interface Schema$RestoreCryptoKeyVersionRequest {} + /** + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy - * @desc Schedule a CryptoKeyVersion for destruction. Upon calling this - * method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and - * destroy_time will be set to a time 24 hours in the future, at which point - * the state will be changed to DESTROYED, and the key material will be - * irrevocably destroyed. Before the destroy_time is reached, - * RestoreCryptoKeyVersion may be called to reverse the process. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the CryptoKeyVersion to destroy. - * @param {().DestroyCryptoKeyVersionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `TestIamPermissions` method. */ - destroy(params?: any, options?: MethodOptions): - AxiosPromise; - destroy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - destroy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:destroy').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get - * @desc Returns metadata for a given CryptoKeyVersion. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the CryptoKeyVersion to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list - * @desc Lists CryptoKeyVersions. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of CryptoKeyVersions to include in the response. Further CryptoKeyVersions can subsequently be obtained by including the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. - * @param {string=} params.pageToken Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token. - * @param {string} params.parent Required. The resource name of the CryptoKey to list, in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/cryptoKeyVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$UpdateCryptoKeyPrimaryVersionRequest { + /** + * The id of the child CryptoKeyVersion to use as primary. + */ + cryptoKeyVersionId: string; } - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch - * @desc Update a CryptoKeyVersion's metadata. state may be changed between - * ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and - * RestoreCryptoKeyVersion to move between other states. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The resource name for this CryptoKeyVersion in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x`. - * @param {string=} params.updateMask Required list of fields to be updated in this request. - * @param {().CryptoKeyVersion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Cloudkms; + locations: Resource$Projects$Locations; + constructor(root: Cloudkms) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Locations { + root: Cloudkms; + keyRings: Resource$Projects$Locations$Keyrings; + constructor(root: Cloudkms) { + this.root = root; + this.getRoot.bind(this); + this.keyRings = new Resource$Projects$Locations$Keyrings(root); + } + + getRoot() { + return this.root; + } + + + /** + * cloudkms.projects.locations.get + * @desc Gets information about a location. + * @alias cloudkms.projects.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @alias cloudkms.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore - * @desc Restore a CryptoKeyVersion in the DESTROY_SCHEDULED, state. Upon - * restoration of the CryptoKeyVersion, state will be set to DISABLED, and - * destroy_time will be cleared. - * @alias - * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the CryptoKeyVersion to restore. - * @param {().RestoreCryptoKeyVersionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restore(params?: any, options?: MethodOptions): - AxiosPromise; - restore( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - restore( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Locations$Keyrings { + root: Cloudkms; + cryptoKeys: Resource$Projects$Locations$Keyrings$Cryptokeys; + constructor(root: Cloudkms) { + this.root = root; + this.getRoot.bind(this); + this.cryptoKeys = + new Resource$Projects$Locations$Keyrings$Cryptokeys(root); + } + + getRoot() { + return this.root; + } + + + /** + * cloudkms.projects.locations.keyRings.create + * @desc Create a new KeyRing in a given Project and Location. + * @alias cloudkms.projects.locations.keyRings.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.keyRingId Required. It must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63}` + * @param {string} params.parent Required. The resource name of the location associated with the KeyRings, in the format `projects/x/locations/x`. + * @param {().KeyRing} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/keyRings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.get + * @desc Returns metadata for a given KeyRing. + * @alias cloudkms.projects.locations.keyRings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the KeyRing to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias cloudkms.projects.locations.keyRings.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.list + * @desc Lists KeyRings. + * @alias cloudkms.projects.locations.keyRings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of KeyRings to include in the response. Further KeyRings can subsequently be obtained by including the ListKeyRingsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken Optional pagination token, returned earlier via ListKeyRingsResponse.next_page_token. + * @param {string} params.parent Required. The resource name of the location associated with the KeyRings, in the format `projects/x/locations/x`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/keyRings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias cloudkms.projects.locations.keyRings.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias cloudkms.projects.locations.keyRings.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Keyrings$Cryptokeys { + root: Cloudkms; + cryptoKeyVersions: + Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions; + constructor(root: Cloudkms) { + this.root = root; + this.getRoot.bind(this); + this.cryptoKeyVersions = + new Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions( + root); + } + + getRoot() { + return this.root; + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.create + * @desc Create a new CryptoKey within a KeyRing. CryptoKey.purpose is + * required. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.cryptoKeyId Required. It must be unique within a KeyRing and match the regular expression `[a-zA-Z0-9_-]{1,63}` + * @param {string} params.parent Required. The name of the KeyRing associated with the CryptoKeys. + * @param {().CryptoKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/cryptoKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.decrypt + * @desc Decrypts data that was protected by Encrypt. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.decrypt + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the CryptoKey to use for decryption. The server will choose the appropriate version. + * @param {().DecryptRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + decrypt(params?: any, options?: MethodOptions): + AxiosPromise; + decrypt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + decrypt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:decrypt') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.encrypt + * @desc Encrypts data, so that it can only be recovered by a call to + * Decrypt. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.encrypt + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the CryptoKey or CryptoKeyVersion to use for encryption. If a CryptoKey is specified, the server will use its primary version. + * @param {().EncryptRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + encrypt(params?: any, options?: MethodOptions): + AxiosPromise; + encrypt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + encrypt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:encrypt') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.get + * @desc Returns metadata for a given CryptoKey, as well as its primary + * CryptoKeyVersion. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the CryptoKey to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.list + * @desc Lists CryptoKeys. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of CryptoKeys to include in the response. Further CryptoKeys can subsequently be obtained by including the ListCryptoKeysResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken Optional pagination token, returned earlier via ListCryptoKeysResponse.next_page_token. + * @param {string} params.parent Required. The resource name of the KeyRing to list, in the format `projects/x/locations/x/keyRings/x`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/cryptoKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.patch + * @desc Update a CryptoKey. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The resource name for this CryptoKey in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x`. + * @param {string=} params.updateMask Required list of fields to be updated in this request. + * @param {().CryptoKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion + * @desc Update the version of a CryptoKey that will be used in Encrypt + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the CryptoKey to update. + * @param {().UpdateCryptoKeyPrimaryVersionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatePrimaryVersion(params?: any, options?: MethodOptions): + AxiosPromise; + updatePrimaryVersion( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updatePrimaryVersion( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:updatePrimaryVersion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:restore').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class + Resource$Projects$Locations$Keyrings$Cryptokeys$Cryptokeyversions { + root: Cloudkms; + constructor(root: Cloudkms) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create + * @desc Create a new CryptoKeyVersion in a CryptoKey. The server will + * assign the next sequential id. If unset, state will be set to ENABLED. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the CryptoKey associated with the CryptoKeyVersions. + * @param {().CryptoKeyVersion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/cryptoKeyVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy + * @desc Schedule a CryptoKeyVersion for destruction. Upon calling this + * method, CryptoKeyVersion.state will be set to DESTROY_SCHEDULED and + * destroy_time will be set to a time 24 hours in the future, at which point + * the state will be changed to DESTROYED, and the key material will be + * irrevocably destroyed. Before the destroy_time is reached, + * RestoreCryptoKeyVersion may be called to reverse the process. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the CryptoKeyVersion to destroy. + * @param {().DestroyCryptoKeyVersionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + destroy(params?: any, options?: MethodOptions): + AxiosPromise; + destroy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + destroy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:destroy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get + * @desc Returns metadata for a given CryptoKeyVersion. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the CryptoKeyVersion to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list + * @desc Lists CryptoKeyVersions. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of CryptoKeyVersions to include in the response. Further CryptoKeyVersions can subsequently be obtained by including the ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. If unspecified, the server will pick an appropriate default. + * @param {string=} params.pageToken Optional pagination token, returned earlier via ListCryptoKeyVersionsResponse.next_page_token. + * @param {string} params.parent Required. The resource name of the CryptoKey to list, in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/cryptoKeyVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch + * @desc Update a CryptoKeyVersion's metadata. state may be changed between + * ENABLED and DISABLED using this method. See DestroyCryptoKeyVersion and + * RestoreCryptoKeyVersion to move between other states. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The resource name for this CryptoKeyVersion in the format `projects/x/locations/x/keyRings/x/cryptoKeys/x/cryptoKeyVersions/x`. + * @param {string=} params.updateMask Required list of fields to be updated in this request. + * @param {().CryptoKeyVersion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore + * @desc Restore a CryptoKeyVersion in the DESTROY_SCHEDULED, state. Upon + * restoration of the CryptoKeyVersion, state will be set to DISABLED, and + * destroy_time will be cleared. + * @alias + * cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the CryptoKeyVersion to restore. + * @param {().RestoreCryptoKeyVersionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restore(params?: any, options?: MethodOptions): + AxiosPromise; + restore( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + restore( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudkms.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:restore') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudresourcemanager/v1.ts b/src/apis/cloudresourcemanager/v1.ts index 5900c1052cf..0d5f52aa582 100644 --- a/src/apis/cloudresourcemanager/v1.ts +++ b/src/apis/cloudresourcemanager/v1.ts @@ -27,5363 +27,5455 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Resource Manager API - * - * The Google Cloud Resource Manager API provides methods for creating, reading, - * and updating project metadata. - * - * @example - * const google = require('googleapis'); - * const cloudresourcemanager = google.cloudresourcemanager('v1'); - * - * @namespace cloudresourcemanager - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudresourcemanager - */ -export class Cloudresourcemanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudresourcemanager_v1 { + /** + * Cloud Resource Manager API + * + * The Google Cloud Resource Manager API provides methods for creating, + * reading, and updating project metadata. + * + * @example + * const google = require('googleapis'); + * const cloudresourcemanager = google.cloudresourcemanager('v1'); + * + * @namespace cloudresourcemanager + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudresourcemanager + */ + export class Cloudresourcemanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - folders: Resource$Folders; - liens: Resource$Liens; - operations: Resource$Operations; - organizations: Resource$Organizations; - projects: Resource$Projects; + folders: Resource$Folders; + liens: Resource$Liens; + operations: Resource$Operations; + organizations: Resource$Organizations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.folders = new Resource$Folders(this); - this.liens = new Resource$Liens(this); - this.operations = new Resource$Operations(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - } + this.folders = new Resource$Folders(this); + this.liens = new Resource$Liens(this); + this.operations = new Resource$Operations(this); + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Identifying information for a single ancestor of a project. - */ -export interface Schema$Ancestor { - /** - * Resource id of the ancestor. - */ - resourceId: Schema$ResourceId; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` . * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A `Constraint` that is either enforced or not. For example a constraint - * `constraints/compute.disableSerialPortAccess`. If it is enforced on a VM - * instance, serial port connections will not be opened to that instance. - */ -export interface Schema$BooleanConstraint {} -/** - * Used in `policy_type` to specify how `boolean_policy` will behave at this - * resource. - */ -export interface Schema$BooleanPolicy { - /** - * If `true`, then the `Policy` is enforced. If `false`, then any - * configuration is acceptable. Suppose you have a `Constraint` - * `constraints/compute.disableSerialPortAccess` with `constraint_default` set - * to `ALLOW`. A `Policy` for that `Constraint` exhibits the following - * behavior: - If the `Policy` at this resource has enforced set to `false`, - * serial port connection attempts will be allowed. - If the `Policy` at - * this resource has enforced set to `true`, serial port connection - * attempts will be refused. - If the `Policy` at this resource is - * `RestoreDefault`, serial port connection attempts will be allowed. - - * If no `Policy` is set at this resource or anywhere higher in the resource - * hierarchy, serial port connection attempts will be allowed. - If no - * `Policy` is set at this resource, but one exists higher in the resource - * hierarchy, the behavior is as if the`Policy` were set at this resource. - * The following examples demonstrate the different possible layerings: - * Example 1 (nearest `Constraint` wins): `organizations/foo` has a `Policy` - * with: {enforced: false} `projects/bar` has no `Policy` set. The - * constraint at `projects/bar` and `organizations/foo` will not be enforced. - * Example 2 (enforcement gets replaced): `organizations/foo` has a `Policy` - * with: {enforced: false} `projects/bar` has a `Policy` with: - * {enforced: true} The constraint at `organizations/foo` is not enforced. The - * constraint at `projects/bar` is enforced. Example 3 (RestoreDefault): - * `organizations/foo` has a `Policy` with: {enforced: true} - * `projects/bar` has a `Policy` with: {RestoreDefault: {}} The constraint - * at `organizations/foo` is enforced. The constraint at `projects/bar` is not - * enforced, because `constraint_default` for the `Constraint` is `ALLOW`. - */ - enforced: boolean; -} -/** - * The request sent to the ClearOrgPolicy method. - */ -export interface Schema$ClearOrgPolicyRequest { - /** - * Name of the `Constraint` of the `Policy` to clear. - */ - constraint: string; - /** - * The current version, for concurrency control. Not sending an `etag` will - * cause the `Policy` to be cleared blindly. - */ - etag: string; -} -/** - * A `Constraint` describes a way in which a resource's configuration can be - * restricted. For example, it controls which cloud services can be activated - * across an organization, or whether a Compute Engine instance can have serial - * port connections established. `Constraints` can be configured by the - * organization's policy adminstrator to fit the needs of the organzation by - * setting Policies for `Constraints` at different locations in the - * organization's resource hierarchy. Policies are inherited down the - * resource hierarchy from higher levels, but can also be overridden. For - * details about the inheritance rules please read about Policies. `Constraints` - * have a default behavior determined by the `constraint_default` field, which - * is the enforcement behavior that is used in the absence of a `Policy` being - * defined or inherited for the resource in question. - */ -export interface Schema$Constraint { - /** - * Defines this constraint as being a BooleanConstraint. - */ - booleanConstraint: Schema$BooleanConstraint; - /** - * The evaluation behavior of this constraint in the absense of - * 'Policy'. - */ - constraintDefault: string; - /** - * Detailed description of what this `Constraint` controls as well as how and - * where it is enforced. Mutable. - */ - description: string; - /** - * The human readable name. Mutable. - */ - displayName: string; - /** - * Defines this constraint as being a ListConstraint. - */ - listConstraint: Schema$ListConstraint; - /** - * Immutable value, required to globally be unique. For example, - * `constraints/serviceuser.services` - */ - name: string; - /** - * Version of the `Constraint`. Default version is 0; - */ - version: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Metadata describing a long running folder operation - */ -export interface Schema$FolderOperation { - /** - * The resource name of the folder or organization we are either creating the - * folder under or moving the folder to. - */ - destinationParent: string; - /** - * The display name of the folder. - */ - displayName: string; - /** - * The type of this operation. - */ - operationType: string; - /** - * The resource name of the folder's parent. Only applicable when the - * operation_type is MOVE. - */ - sourceParent: string; -} -/** - * A classification of the Folder Operation error. - */ -export interface Schema$FolderOperationError { - /** - * The type of operation error experienced. - */ - errorMessageId: string; -} -/** - * The request sent to the GetAncestry method. - */ -export interface Schema$GetAncestryRequest {} -/** - * Response from the GetAncestry method. - */ -export interface Schema$GetAncestryResponse { - /** - * Ancestors are ordered from bottom to top of the resource hierarchy. The - * first ancestor is the project itself, followed by the project's parent, - * etc.. - */ - ancestor: Schema$Ancestor[]; -} -/** - * The request sent to the GetEffectiveOrgPolicy method. - */ -export interface Schema$GetEffectiveOrgPolicyRequest { - /** - * The name of the `Constraint` to compute the effective `Policy`. - */ - constraint: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The request sent to the GetOrgPolicy method. - */ -export interface Schema$GetOrgPolicyRequest { - /** - * Name of the `Constraint` to get the `Policy`. - */ - constraint: string; -} -/** - * A Lien represents an encumbrance on the actions that can be performed on a - * resource. - */ -export interface Schema$Lien { - /** - * The creation time of this Lien. - */ - createTime: string; - /** - * A system-generated unique identifier for this Lien. Example: - * `liens/1234abcd` - */ - name: string; - /** - * A stable, user-visible/meaningful string identifying the origin of the - * Lien, intended to be inspected programmatically. Maximum length of 200 - * characters. Example: 'compute.googleapis.com' - */ - origin: string; - /** - * A reference to the resource this Lien is attached to. The server will - * validate the parent against those for which Liens are supported. Example: - * `projects/1234` - */ - parent: string; - /** - * Concise user-visible strings indicating why an action cannot be performed - * on a resource. Maximum lenth of 200 characters. Example: 'Holds - * production API key' - */ - reason: string; - /** - * The types of operations which should be blocked as a result of this Lien. - * Each value should correspond to an IAM permission. The server will validate - * the permissions against those for which Liens are supported. An empty list - * is meaningless and will be rejected. Example: - * ['resourcemanager.projects.delete'] - */ - restrictions: string[]; -} -/** - * The request sent to the [ListAvailableOrgPolicyConstraints] - * google.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method. - */ -export interface Schema$ListAvailableOrgPolicyConstraintsRequest { - /** - * Size of the pages to be returned. This is currently unsupported and will be - * ignored. The server may at any point start using this field to limit page - * size. - */ - pageSize: number; - /** - * Page token used to retrieve the next page. This is currently unsupported - * and will be ignored. The server may at any point start using this field. - */ - pageToken: string; -} -/** - * The response returned from the ListAvailableOrgPolicyConstraints method. - * Returns all `Constraints` that could be set at this level of the hierarchy - * (contrast with the response from `ListPolicies`, which returns all policies - * which are set). - */ -export interface Schema$ListAvailableOrgPolicyConstraintsResponse { - /** - * The collection of constraints that are settable on the request resource. - */ - constraints: Schema$Constraint[]; - /** - * Page token used to retrieve the next page. This is currently not used. - */ - nextPageToken: string; -} -/** - * A `Constraint` that allows or disallows a list of string values, which are - * configured by an Organization's policy administrator with a `Policy`. - */ -export interface Schema$ListConstraint { - /** - * Optional. The Google Cloud Console will try to default to a configuration - * that matches the value specified in this `Constraint`. - */ - suggestedValue: string; -} -/** - * The response message for Liens.ListLiens. - */ -export interface Schema$ListLiensResponse { - /** - * A list of Liens. - */ - liens: Schema$Lien[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The request sent to the ListOrgPolicies method. - */ -export interface Schema$ListOrgPoliciesRequest { - /** - * Size of the pages to be returned. This is currently unsupported and will be - * ignored. The server may at any point start using this field to limit page - * size. - */ - pageSize: number; - /** - * Page token used to retrieve the next page. This is currently unsupported - * and will be ignored. The server may at any point start using this field. - */ - pageToken: string; -} -/** - * The response returned from the ListOrgPolicies method. It will be empty if no - * `Policies` are set on the resource. - */ -export interface Schema$ListOrgPoliciesResponse { - /** - * Page token used to retrieve the next page. This is currently not used, but - * the server may at any point start supplying a valid token. - */ - nextPageToken: string; - /** - * The `Policies` that are set on the resource. It will be empty if no - * `Policies` are set. - */ - policies: Schema$OrgPolicy[]; -} -/** - * Used in `policy_type` to specify how `list_policy` behaves at this resource. - * A `ListPolicy` can define specific values that are allowed or denied by - * setting either the `allowed_values` or `denied_values` fields. It can also be - * used to allow or deny all values, by setting the `all_values` field. If - * `all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of `allowed_values` or - * `denied_values` must be set (attempting to set both or neither will result in - * a failed request). If `all_values` is set to either `ALLOW` or `DENY`, - * `allowed_values` and `denied_values` must be unset. - */ -export interface Schema$ListPolicy { - /** - * List of values allowed at this resource. Can only be set if no values are - * set for `denied_values` and `all_values` is set to - * `ALL_VALUES_UNSPECIFIED`. - */ - allowedValues: string[]; - /** - * The policy all_values state. - */ - allValues: string; /** - * List of values denied at this resource. Can only be set if no values are - * set for `allowed_values` and `all_values` is set to - * `ALL_VALUES_UNSPECIFIED`. + * Identifying information for a single ancestor of a project. */ - deniedValues: string[]; - /** - * Determines the inheritance behavior for this `Policy`. By default, a - * `ListPolicy` set at a resource supercedes any `Policy` set anywhere up the - * resource hierarchy. However, if `inherit_from_parent` is set to `true`, - * then the values from the effective `Policy` of the parent resource are - * inherited, meaning the values set in this `Policy` are added to the values - * inherited up the hierarchy. Setting `Policy` hierarchies that inherit both - * allowed values and denied values isn't recommended in most - * circumstances to keep the configuration simple and understandable. However, - * it is possible to set a `Policy` with `allowed_values` set that inherits a - * `Policy` with `denied_values` set. In this case, the values that are - * allowed must be in `allowed_values` and not present in `denied_values`. For - * example, suppose you have a `Constraint` - * `constraints/serviceuser.services`, which has a `constraint_type` of - * `list_constraint`, and with `constraint_default` set to `ALLOW`. Suppose - * that at the Organization level, a `Policy` is applied that restricts the - * allowed API activations to {`E1`, `E2`}. Then, if a `Policy` is applied to - * a project below the Organization that has `inherit_from_parent` set to - * `false` and field all_values set to DENY, then an attempt to activate any - * API will be denied. The following examples demonstrate different possible - * layerings: Example 1 (no inherited values): `organizations/foo` has a - * `Policy` with values: {allowed_values: “E1” allowed_values:”E2”} - * ``projects/bar`` has `inherit_from_parent` `false` and values: - * {allowed_values: "E3" allowed_values: "E4"} The - * accepted values at `organizations/foo` are `E1`, `E2`. The accepted values - * at `projects/bar` are `E3`, and `E4`. Example 2 (inherited values): - * `organizations/foo` has a `Policy` with values: {allowed_values: “E1” - * allowed_values:”E2”} `projects/bar` has a `Policy` with values: {value: - * “E3” value: ”E4” inherit_from_parent: true} The accepted values at - * `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar` - * are `E1`, `E2`, `E3`, and `E4`. Example 3 (inheriting both allowed and - * denied values): `organizations/foo` has a `Policy` with values: - * {allowed_values: "E1" allowed_values: "E2"} - * `projects/bar` has a `Policy` with: {denied_values: "E1"} The - * accepted values at `organizations/foo` are `E1`, `E2`. The value accepted - * at `projects/bar` is `E2`. Example 4 (RestoreDefault): `organizations/foo` - * has a `Policy` with values: {allowed_values: “E1” allowed_values:”E2”} - * `projects/bar` has a `Policy` with values: {RestoreDefault: {}} The - * accepted values at `organizations/foo` are `E1`, `E2`. The accepted values - * at `projects/bar` are either all or none depending on the value of - * `constraint_default` (if `ALLOW`, all; if `DENY`, none). Example 5 (no - * policy inherits parent policy): `organizations/foo` has no `Policy` set. - * `projects/bar` has no `Policy` set. The accepted values at both levels are - * either all or none depending on the value of `constraint_default` (if - * `ALLOW`, all; if `DENY`, none). Example 6 (ListConstraint allowing all): - * `organizations/foo` has a `Policy` with values: {allowed_values: “E1” - * allowed_values: ”E2”} `projects/bar` has a `Policy` with: {all: - * ALLOW} The accepted values at `organizations/foo` are `E1`, E2`. Any value - * is accepted at `projects/bar`. Example 7 (ListConstraint allowing none): - * `organizations/foo` has a `Policy` with values: {allowed_values: “E1” - * allowed_values: ”E2”} `projects/bar` has a `Policy` with: {all: DENY} - * The accepted values at `organizations/foo` are `E1`, E2`. No value is - * accepted at `projects/bar`. - */ - inheritFromParent: boolean; + export interface Schema$Ancestor { + /** + * Resource id of the ancestor. + */ + resourceId: Schema$ResourceId; + } /** - * Optional. The Google Cloud Console will try to default to a configuration - * that matches the value specified in this `Policy`. If `suggested_value` is - * not set, it will inherit the value specified higher in the hierarchy, - * unless `inherit_from_parent` is `false`. - */ - suggestedValue: string; -} -/** - * A page of the response received from the ListProjects method. A paginated - * response where more pages are available has `next_page_token` set. This token - * can be used in a subsequent request to retrieve the next request page. - */ -export interface Schema$ListProjectsResponse { + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * Pagination token. If the result set is too large to fit in a single - * response, this token is returned. It encodes the position of the current - * result cursor. Feeding this value into a new list request with the - * `page_token` parameter gives the next page of the results. When - * `next_page_token` is not filled in, there is no next page and the list - * returned is the last page in the result set. Pagination tokens have a - * limited lifetime. - */ - nextPageToken: string; + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * The list of Projects that matched the list filter. This list can be - * paginated. - */ - projects: Schema$Project[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; + * A `Constraint` that is either enforced or not. For example a constraint + * `constraints/compute.disableSerialPortAccess`. If it is enforced on a VM + * instance, serial port connections will not be opened to that instance. + */ + export interface Schema$BooleanConstraint {} + /** + * Used in `policy_type` to specify how `boolean_policy` will behave at this + * resource. + */ + export interface Schema$BooleanPolicy { + /** + * If `true`, then the `Policy` is enforced. If `false`, then any + * configuration is acceptable. Suppose you have a `Constraint` + * `constraints/compute.disableSerialPortAccess` with `constraint_default` + * set to `ALLOW`. A `Policy` for that `Constraint` exhibits the following + * behavior: - If the `Policy` at this resource has enforced set to + * `false`, serial port connection attempts will be allowed. - If the + * `Policy` at this resource has enforced set to `true`, serial port + * connection attempts will be refused. - If the `Policy` at this resource + * is `RestoreDefault`, serial port connection attempts will be allowed. + * - If no `Policy` is set at this resource or anywhere higher in the + * resource hierarchy, serial port connection attempts will be allowed. - + * If no `Policy` is set at this resource, but one exists higher in the + * resource hierarchy, the behavior is as if the`Policy` were set at this + * resource. The following examples demonstrate the different possible + * layerings: Example 1 (nearest `Constraint` wins): `organizations/foo` + * has a `Policy` with: {enforced: false} `projects/bar` has no + * `Policy` set. The constraint at `projects/bar` and `organizations/foo` + * will not be enforced. Example 2 (enforcement gets replaced): + * `organizations/foo` has a `Policy` with: {enforced: false} + * `projects/bar` has a `Policy` with: {enforced: true} The constraint + * at `organizations/foo` is not enforced. The constraint at `projects/bar` + * is enforced. Example 3 (RestoreDefault): `organizations/foo` has a + * `Policy` with: {enforced: true} `projects/bar` has a `Policy` with: + * {RestoreDefault: {}} The constraint at `organizations/foo` is enforced. + * The constraint at `projects/bar` is not enforced, because + * `constraint_default` for the `Constraint` is `ALLOW`. + */ + enforced: boolean; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; + * The request sent to the ClearOrgPolicy method. + */ + export interface Schema$ClearOrgPolicyRequest { + /** + * Name of the `Constraint` of the `Policy` to clear. + */ + constraint: string; + /** + * The current version, for concurrency control. Not sending an `etag` will + * cause the `Policy` to be cleared blindly. + */ + etag: string; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * A `Constraint` describes a way in which a resource's configuration can + * be restricted. For example, it controls which cloud services can be + * activated across an organization, or whether a Compute Engine instance can + * have serial port connections established. `Constraints` can be configured + * by the organization's policy adminstrator to fit the needs of the + * organzation by setting Policies for `Constraints` at different locations in + * the organization's resource hierarchy. Policies are inherited down the + * resource hierarchy from higher levels, but can also be overridden. For + * details about the inheritance rules please read about Policies. + * `Constraints` have a default behavior determined by the + * `constraint_default` field, which is the enforcement behavior that is used + * in the absence of a `Policy` being defined or inherited for the resource in + * question. + */ + export interface Schema$Constraint { + /** + * Defines this constraint as being a BooleanConstraint. + */ + booleanConstraint: Schema$BooleanConstraint; + /** + * The evaluation behavior of this constraint in the absense of + * 'Policy'. + */ + constraintDefault: string; + /** + * Detailed description of what this `Constraint` controls as well as how + * and where it is enforced. Mutable. + */ + description: string; + /** + * The human readable name. Mutable. + */ + displayName: string; + /** + * Defines this constraint as being a ListConstraint. + */ + listConstraint: Schema$ListConstraint; + /** + * Immutable value, required to globally be unique. For example, + * `constraints/serviceuser.services` + */ + name: string; + /** + * Version of the `Constraint`. Default version is 0; + */ + version: number; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Metadata describing a long running folder operation + */ + export interface Schema$FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent: string; + /** + * The display name of the folder. + */ + displayName: string; + /** + * The type of this operation. + */ + operationType: string; + /** + * The resource name of the folder's parent. Only applicable when the + * operation_type is MOVE. + */ + sourceParent: string; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + * A classification of the Folder Operation error. */ - response: any; -} -/** - * The root node in the resource hierarchy to which a particular entity's - * (e.g., company) resources belong. - */ -export interface Schema$Organization { + export interface Schema$FolderOperationError { + /** + * The type of operation error experienced. + */ + errorMessageId: string; + } /** - * Timestamp when the Organization was created. Assigned by the server. - * @OutputOnly + * The request sent to the GetAncestry method. */ - creationTime: string; + export interface Schema$GetAncestryRequest {} /** - * A human-readable string that refers to the Organization in the GCP Console - * UI. This string is set by the server and cannot be changed. The string will - * be set to the primary domain (for example, "google.com") of the G - * Suite customer that owns the organization. @OutputOnly + * Response from the GetAncestry method. */ - displayName: string; + export interface Schema$GetAncestryResponse { + /** + * Ancestors are ordered from bottom to top of the resource hierarchy. The + * first ancestor is the project itself, followed by the project's + * parent, etc.. + */ + ancestor: Schema$Ancestor[]; + } /** - * The organization's current lifecycle state. Assigned by the server. - * @OutputOnly + * The request sent to the GetEffectiveOrgPolicy method. */ - lifecycleState: string; + export interface Schema$GetEffectiveOrgPolicyRequest { + /** + * The name of the `Constraint` to compute the effective `Policy`. + */ + constraint: string; + } /** - * Output Only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, - * "organizations/1234". + * Request message for `GetIamPolicy` method. */ - name: string; + export interface Schema$GetIamPolicyRequest {} /** - * The owner of this Organization. The owner should be specified on creation. - * Once set, it cannot be changed. This field is required. + * The request sent to the GetOrgPolicy method. */ - owner: Schema$OrganizationOwner; -} -/** - * The entity that owns an Organization. The lifetime of the Organization and - * all of its descendants are bound to the `OrganizationOwner`. If the - * `OrganizationOwner` is deleted, the Organization and all its descendants will - * be deleted. - */ -export interface Schema$OrganizationOwner { + export interface Schema$GetOrgPolicyRequest { + /** + * Name of the `Constraint` to get the `Policy`. + */ + constraint: string; + } /** - * The G Suite customer id used in the Directory API. - */ - directoryCustomerId: string; -} -/** - * Defines a Cloud Organization `Policy` which is used to specify `Constraints` - * for configurations of Cloud Platform resources. - */ -export interface Schema$OrgPolicy { + * A Lien represents an encumbrance on the actions that can be performed on a + * resource. + */ + export interface Schema$Lien { + /** + * The creation time of this Lien. + */ + createTime: string; + /** + * A system-generated unique identifier for this Lien. Example: + * `liens/1234abcd` + */ + name: string; + /** + * A stable, user-visible/meaningful string identifying the origin of the + * Lien, intended to be inspected programmatically. Maximum length of 200 + * characters. Example: 'compute.googleapis.com' + */ + origin: string; + /** + * A reference to the resource this Lien is attached to. The server will + * validate the parent against those for which Liens are supported. Example: + * `projects/1234` + */ + parent: string; + /** + * Concise user-visible strings indicating why an action cannot be performed + * on a resource. Maximum lenth of 200 characters. Example: 'Holds + * production API key' + */ + reason: string; + /** + * The types of operations which should be blocked as a result of this Lien. + * Each value should correspond to an IAM permission. The server will + * validate the permissions against those for which Liens are supported. An + * empty list is meaningless and will be rejected. Example: + * ['resourcemanager.projects.delete'] + */ + restrictions: string[]; + } /** - * For boolean `Constraints`, whether to enforce the `Constraint` or not. - */ - booleanPolicy: Schema$BooleanPolicy; + * The request sent to the [ListAvailableOrgPolicyConstraints] + * google.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] method. + */ + export interface Schema$ListAvailableOrgPolicyConstraintsRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken: string; + } /** - * The name of the `Constraint` the `Policy` is configuring, for example, - * `constraints/serviceuser.services`. Immutable after creation. - */ - constraint: string; + * The response returned from the ListAvailableOrgPolicyConstraints method. + * Returns all `Constraints` that could be set at this level of the hierarchy + * (contrast with the response from `ListPolicies`, which returns all policies + * which are set). + */ + export interface Schema$ListAvailableOrgPolicyConstraintsResponse { + /** + * The collection of constraints that are settable on the request resource. + */ + constraints: Schema$Constraint[]; + /** + * Page token used to retrieve the next page. This is currently not used. + */ + nextPageToken: string; + } /** - * An opaque tag indicating the current version of the `Policy`, used for - * concurrency control. When the `Policy` is returned from either a - * `GetPolicy` or a `ListOrgPolicy` request, this `etag` indicates the version - * of the current `Policy` to use when executing a read-modify-write loop. - * When the `Policy` is returned from a `GetEffectivePolicy` request, the - * `etag` will be unset. When the `Policy` is used in a `SetOrgPolicy` - * method, use the `etag` value that was returned from a `GetOrgPolicy` - * request as part of a read-modify-write loop for concurrency control. Not - * setting the `etag`in a `SetOrgPolicy` request will result in an - * unconditional write of the `Policy`. + * A `Constraint` that allows or disallows a list of string values, which are + * configured by an Organization's policy administrator with a `Policy`. */ - etag: string; + export interface Schema$ListConstraint { + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Constraint`. + */ + suggestedValue: string; + } /** - * List of values either allowed or disallowed. - */ - listPolicy: Schema$ListPolicy; + * The response message for Liens.ListLiens. + */ + export interface Schema$ListLiensResponse { + /** + * A list of Liens. + */ + liens: Schema$Lien[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Restores the default behavior of the constraint; independent of - * `Constraint` type. - */ - restoreDefault: Schema$RestoreDefault; + * The request sent to the ListOrgPolicies method. + */ + export interface Schema$ListOrgPoliciesRequest { + /** + * Size of the pages to be returned. This is currently unsupported and will + * be ignored. The server may at any point start using this field to limit + * page size. + */ + pageSize: number; + /** + * Page token used to retrieve the next page. This is currently unsupported + * and will be ignored. The server may at any point start using this field. + */ + pageToken: string; + } /** - * The time stamp the `Policy` was previously updated. This is set by the - * server, not specified by the caller, and represents the last time a call to - * `SetOrgPolicy` was made for that `Policy`. Any value set by the client will - * be ignored. - */ - updateTime: string; + * The response returned from the ListOrgPolicies method. It will be empty if + * no `Policies` are set on the resource. + */ + export interface Schema$ListOrgPoliciesResponse { + /** + * Page token used to retrieve the next page. This is currently not used, + * but the server may at any point start supplying a valid token. + */ + nextPageToken: string; + /** + * The `Policies` that are set on the resource. It will be empty if no + * `Policies` are set. + */ + policies: Schema$OrgPolicy[]; + } /** - * Version of the `Policy`. Default version is 0; - */ - version: number; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { + * Used in `policy_type` to specify how `list_policy` behaves at this + * resource. A `ListPolicy` can define specific values that are allowed or + * denied by setting either the `allowed_values` or `denied_values` fields. It + * can also be used to allow or deny all values, by setting the `all_values` + * field. If `all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of + * `allowed_values` or `denied_values` must be set (attempting to set both or + * neither will result in a failed request). If `all_values` is set to either + * `ALLOW` or `DENY`, `allowed_values` and `denied_values` must be unset. + */ + export interface Schema$ListPolicy { + /** + * List of values allowed at this resource. Can only be set if no values + * are set for `denied_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + allowedValues: string[]; + /** + * The policy all_values state. + */ + allValues: string; + /** + * List of values denied at this resource. Can only be set if no values are + * set for `allowed_values` and `all_values` is set to + * `ALL_VALUES_UNSPECIFIED`. + */ + deniedValues: string[]; + /** + * Determines the inheritance behavior for this `Policy`. By default, a + * `ListPolicy` set at a resource supercedes any `Policy` set anywhere up + * the resource hierarchy. However, if `inherit_from_parent` is set to + * `true`, then the values from the effective `Policy` of the parent + * resource are inherited, meaning the values set in this `Policy` are added + * to the values inherited up the hierarchy. Setting `Policy` hierarchies + * that inherit both allowed values and denied values isn't recommended + * in most circumstances to keep the configuration simple and + * understandable. However, it is possible to set a `Policy` with + * `allowed_values` set that inherits a `Policy` with `denied_values` set. + * In this case, the values that are allowed must be in `allowed_values` and + * not present in `denied_values`. For example, suppose you have a + * `Constraint` `constraints/serviceuser.services`, which has a + * `constraint_type` of `list_constraint`, and with `constraint_default` set + * to `ALLOW`. Suppose that at the Organization level, a `Policy` is applied + * that restricts the allowed API activations to {`E1`, `E2`}. Then, if a + * `Policy` is applied to a project below the Organization that has + * `inherit_from_parent` set to `false` and field all_values set to DENY, + * then an attempt to activate any API will be denied. The following + * examples demonstrate different possible layerings: Example 1 (no + * inherited values): `organizations/foo` has a `Policy` with values: + * {allowed_values: “E1” allowed_values:”E2”} ``projects/bar`` has + * `inherit_from_parent` `false` and values: {allowed_values: + * "E3" allowed_values: "E4"} The accepted values at + * `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar` + * are `E3`, and `E4`. Example 2 (inherited values): `organizations/foo` + * has a `Policy` with values: {allowed_values: “E1” + * allowed_values:”E2”} `projects/bar` has a `Policy` with values: {value: + * “E3” value: ”E4” inherit_from_parent: true} The accepted values at + * `organizations/foo` are `E1`, `E2`. The accepted values at `projects/bar` + * are `E1`, `E2`, `E3`, and `E4`. Example 3 (inheriting both allowed and + * denied values): `organizations/foo` has a `Policy` with values: + * {allowed_values: "E1" allowed_values: "E2"} + * `projects/bar` has a `Policy` with: {denied_values: "E1"} + * The accepted values at `organizations/foo` are `E1`, `E2`. The value + * accepted at `projects/bar` is `E2`. Example 4 (RestoreDefault): + * `organizations/foo` has a `Policy` with values: {allowed_values: “E1” + * allowed_values:”E2”} `projects/bar` has a `Policy` with values: + * {RestoreDefault: {}} The accepted values at `organizations/foo` are `E1`, + * `E2`. The accepted values at `projects/bar` are either all or none + * depending on the value of `constraint_default` (if `ALLOW`, all; if + * `DENY`, none). Example 5 (no policy inherits parent policy): + * `organizations/foo` has no `Policy` set. `projects/bar` has no `Policy` + * set. The accepted values at both levels are either all or none depending + * on the value of `constraint_default` (if `ALLOW`, all; if `DENY`, none). + * Example 6 (ListConstraint allowing all): `organizations/foo` has a + * `Policy` with values: {allowed_values: “E1” allowed_values: ”E2”} + * `projects/bar` has a `Policy` with: {all: ALLOW} The accepted values + * at `organizations/foo` are `E1`, E2`. Any value is accepted at + * `projects/bar`. Example 7 (ListConstraint allowing none): + * `organizations/foo` has a `Policy` with values: {allowed_values: “E1” + * allowed_values: ”E2”} `projects/bar` has a `Policy` with: {all: + * DENY} The accepted values at `organizations/foo` are `E1`, E2`. No value + * is accepted at `projects/bar`. + */ + inheritFromParent: boolean; + /** + * Optional. The Google Cloud Console will try to default to a configuration + * that matches the value specified in this `Policy`. If `suggested_value` + * is not set, it will inherit the value specified higher in the hierarchy, + * unless `inherit_from_parent` is `false`. + */ + suggestedValue: string; + } /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; + * A page of the response received from the ListProjects method. A paginated + * response where more pages are available has `next_page_token` set. This + * token can be used in a subsequent request to retrieve the next request + * page. + */ + export interface Schema$ListProjectsResponse { + /** + * Pagination token. If the result set is too large to fit in a single + * response, this token is returned. It encodes the position of the current + * result cursor. Feeding this value into a new list request with the + * `page_token` parameter gives the next page of the results. When + * `next_page_token` is not filled in, there is no next page and the list + * returned is the last page in the result set. Pagination tokens have a + * limited lifetime. + */ + nextPageToken: string; + /** + * The list of Projects that matched the list filter. This list can be + * paginated. + */ + projects: Schema$Project[]; + } /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; + * The root node in the resource hierarchy to which a particular entity's + * (e.g., company) resources belong. + */ + export interface Schema$Organization { + /** + * Timestamp when the Organization was created. Assigned by the server. + * @OutputOnly + */ + creationTime: string; + /** + * A human-readable string that refers to the Organization in the GCP + * Console UI. This string is set by the server and cannot be changed. The + * string will be set to the primary domain (for example, + * "google.com") of the G Suite customer that owns the + * organization. @OutputOnly + */ + displayName: string; + /** + * The organization's current lifecycle state. Assigned by the server. + * @OutputOnly + */ + lifecycleState: string; + /** + * Output Only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, + * "organizations/1234". + */ + name: string; + /** + * The owner of this Organization. The owner should be specified on + * creation. Once set, it cannot be changed. This field is required. + */ + owner: Schema$OrganizationOwner; + } /** - * Deprecated. + * The entity that owns an Organization. The lifetime of the Organization and + * all of its descendants are bound to the `OrganizationOwner`. If the + * `OrganizationOwner` is deleted, the Organization and all its descendants + * will be deleted. */ - version: number; -} -/** - * A Project is a high-level Google Cloud Platform entity. It is a container - * for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud Platform - * resources. - */ -export interface Schema$Project { + export interface Schema$OrganizationOwner { + /** + * The G Suite customer id used in the Directory API. + */ + directoryCustomerId: string; + } /** - * Creation time. Read-only. - */ - createTime: string; + * Defines a Cloud Organization `Policy` which is used to specify + * `Constraints` for configurations of Cloud Platform resources. + */ + export interface Schema$OrgPolicy { + /** + * For boolean `Constraints`, whether to enforce the `Constraint` or not. + */ + booleanPolicy: Schema$BooleanPolicy; + /** + * The name of the `Constraint` the `Policy` is configuring, for example, + * `constraints/serviceuser.services`. Immutable after creation. + */ + constraint: string; + /** + * An opaque tag indicating the current version of the `Policy`, used for + * concurrency control. When the `Policy` is returned from either a + * `GetPolicy` or a `ListOrgPolicy` request, this `etag` indicates the + * version of the current `Policy` to use when executing a read-modify-write + * loop. When the `Policy` is returned from a `GetEffectivePolicy` request, + * the `etag` will be unset. When the `Policy` is used in a `SetOrgPolicy` + * method, use the `etag` value that was returned from a `GetOrgPolicy` + * request as part of a read-modify-write loop for concurrency control. Not + * setting the `etag`in a `SetOrgPolicy` request will result in an + * unconditional write of the `Policy`. + */ + etag: string; + /** + * List of values either allowed or disallowed. + */ + listPolicy: Schema$ListPolicy; + /** + * Restores the default behavior of the constraint; independent of + * `Constraint` type. + */ + restoreDefault: Schema$RestoreDefault; + /** + * The time stamp the `Policy` was previously updated. This is set by the + * server, not specified by the caller, and represents the last time a call + * to `SetOrgPolicy` was made for that `Policy`. Any value set by the client + * will be ignored. + */ + updateTime: string; + /** + * Version of the `Policy`. Default version is 0; + */ + version: number; + } /** - * The labels associated with this Project. Label keys must be between 1 and - * 63 characters long and must conform to the following regular expression: - * \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be between 0 and 63 - * characters long and must conform to the regular expression - * (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels can be - * associated with a given resource. Clients should store labels in a - * representation such as JSON that does not depend on specific characters - * being disallowed. Example: <code>"environment" : - * "dev"</code> Read-write. - */ - labels: any; + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * The Project lifecycle state. Read-only. + * A Project is a high-level Google Cloud Platform entity. It is a container + * for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud Platform + * resources. */ - lifecycleState: string; + export interface Schema$Project { + /** + * Creation time. Read-only. + */ + createTime: string; + /** + * The labels associated with this Project. Label keys must be between 1 + * and 63 characters long and must conform to the following regular + * expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be + * between 0 and 63 characters long and must conform to the regular + * expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels + * can be associated with a given resource. Clients should store labels in + * a representation such as JSON that does not depend on specific characters + * being disallowed. Example: <code>"environment" : + * "dev"</code> Read-write. + */ + labels: any; + /** + * The Project lifecycle state. Read-only. + */ + lifecycleState: string; + /** + * The user-assigned display name of the Project. It must be 4 to 30 + * characters. Allowed characters are: lowercase and uppercase letters, + * numbers, hyphen, single-quote, double-quote, space, and exclamation + * point. Example: <code>My Project</code> Read-write. + */ + name: string; + /** + * An optional reference to a parent Resource. Supported parent types + * include "organization" and "folder". Once set, the + * parent cannot be cleared. The `parent` can be set on creation or using + * the `UpdateProject` method; the end user must have the + * `resourcemanager.projects.create` permission on the parent. Read-write. + */ + parent: Schema$ResourceId; + /** + * The unique, user-assigned ID of the Project. It must be 6 to 30 lowercase + * letters, digits, or hyphens. It must start with a letter. Trailing + * hyphens are prohibited. Example: <code>tokyo-rain-123</code> + * Read-only after creation. + */ + projectId: string; + /** + * The number uniquely identifying the project. Example: + * <code>415104041262</code> Read-only. + */ + projectNumber: string; + } /** - * The user-assigned display name of the Project. It must be 4 to 30 - * characters. Allowed characters are: lowercase and uppercase letters, - * numbers, hyphen, single-quote, double-quote, space, and exclamation point. - * Example: <code>My Project</code> Read-write. - */ - name: string; + * A status object which is used as the `metadata` field for the Operation + * returned by CreateProject. It provides insight for when significant phases + * of Project creation have completed. + */ + export interface Schema$ProjectCreationStatus { + /** + * Creation time of the project creation workflow. + */ + createTime: string; + /** + * True if the project can be retrieved using GetProject. No other + * operations on the project are guaranteed to work until the project + * creation is complete. + */ + gettable: boolean; + /** + * True if the project creation process is complete. + */ + ready: boolean; + } /** - * An optional reference to a parent Resource. Supported parent types include - * "organization" and "folder". Once set, the parent - * cannot be cleared. The `parent` can be set on creation or using the - * `UpdateProject` method; the end user must have the - * `resourcemanager.projects.create` permission on the parent. Read-write. - */ - parent: Schema$ResourceId; + * A container to reference an id for any resource type. A `resource` in + * Google Cloud Platform is a generic term for something you (a developer) may + * want to interact with through one of our API's. Some examples are an + * App Engine app, a Compute Engine instance, a Cloud SQL database, and so on. + */ + export interface Schema$ResourceId { + /** + * Required field for the type-specific id. This should correspond to the id + * used in the type-specific API's. + */ + id: string; + /** + * Required field representing the resource type this id is for. At present, + * the valid types are: "organization" + */ + type: string; + } /** - * The unique, user-assigned ID of the Project. It must be 6 to 30 lowercase - * letters, digits, or hyphens. It must start with a letter. Trailing hyphens - * are prohibited. Example: <code>tokyo-rain-123</code> Read-only - * after creation. - */ - projectId: string; + * Ignores policies set above this resource and restores the + * `constraint_default` enforcement behavior of the specific `Constraint` at + * this resource. Suppose that `constraint_default` is set to `ALLOW` for the + * `Constraint` `constraints/serviceuser.services`. Suppose that organization + * foo.com sets a `Policy` at their Organization resource node that restricts + * the allowed service activations to deny all service activations. They could + * then set a `Policy` with the `policy_type` `restore_default` on several + * experimental projects, restoring the `constraint_default` enforcement of + * the `Constraint` for only those projects, allowing those projects to have + * all services activated. + */ + export interface Schema$RestoreDefault {} + /** + * The request sent to the `SearchOrganizations` method. + */ + export interface Schema$SearchOrganizationsRequest { + /** + * An optional query string used to filter the Organizations to return in + * the response. Filter rules are case-insensitive. Organizations may be + * filtered by `owner.directoryCustomerId` or by `domain`, where the domain + * is a G Suite domain, for example: |Filter|Description| + * |------|-----------| |owner.directorycustomerid:123456789|Organizations + * with `owner.directory_customer_id` equal to `123456789`.| + * |domain:google.com|Organizations corresponding to the domain + * `google.com`.| This field is optional. + */ + filter: string; + /** + * The maximum number of Organizations to return in the response. This field + * is optional. + */ + pageSize: number; + /** + * A pagination token returned from a previous call to `SearchOrganizations` + * that indicates from where listing should continue. This field is + * optional. + */ + pageToken: string; + } /** - * The number uniquely identifying the project. Example: - * <code>415104041262</code> Read-only. - */ - projectNumber: string; -} -/** - * A status object which is used as the `metadata` field for the Operation - * returned by CreateProject. It provides insight for when significant phases of - * Project creation have completed. - */ -export interface Schema$ProjectCreationStatus { + * The response returned from the `SearchOrganizations` method. + */ + export interface Schema$SearchOrganizationsResponse { + /** + * A pagination token to be used to retrieve the next page of results. If + * the result is too large to fit within the page size specified in the + * request, this field will be set with a token that can be used to fetch + * the next page of results. If this field is empty, it indicates that this + * response contains the last page of results. + */ + nextPageToken: string; + /** + * The list of Organizations that matched the search query, possibly + * paginated. + */ + organizations: Schema$Organization[]; + } /** - * Creation time of the project creation workflow. - */ - createTime: string; + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * True if the project can be retrieved using GetProject. No other operations - * on the project are guaranteed to work until the project creation is - * complete. + * The request sent to the SetOrgPolicyRequest method. */ - gettable: boolean; + export interface Schema$SetOrgPolicyRequest { + /** + * `Policy` to set on the resource. + */ + policy: Schema$OrgPolicy; + } /** - * True if the project creation process is complete. - */ - ready: boolean; -} -/** - * A container to reference an id for any resource type. A `resource` in Google - * Cloud Platform is a generic term for something you (a developer) may want to - * interact with through one of our API's. Some examples are an App Engine - * app, a Compute Engine instance, a Cloud SQL database, and so on. - */ -export interface Schema$ResourceId { - /** - * Required field for the type-specific id. This should correspond to the id - * used in the type-specific API's. - */ - id: string; - /** - * Required field representing the resource type this id is for. At present, - * the valid types are: "organization" - */ - type: string; -} -/** - * Ignores policies set above this resource and restores the - * `constraint_default` enforcement behavior of the specific `Constraint` at - * this resource. Suppose that `constraint_default` is set to `ALLOW` for the - * `Constraint` `constraints/serviceuser.services`. Suppose that organization - * foo.com sets a `Policy` at their Organization resource node that restricts - * the allowed service activations to deny all service activations. They could - * then set a `Policy` with the `policy_type` `restore_default` on several - * experimental projects, restoring the `constraint_default` enforcement of the - * `Constraint` for only those projects, allowing those projects to have all - * services activated. - */ -export interface Schema$RestoreDefault {} -/** - * The request sent to the `SearchOrganizations` method. - */ -export interface Schema$SearchOrganizationsRequest { - /** - * An optional query string used to filter the Organizations to return in the - * response. Filter rules are case-insensitive. Organizations may be - * filtered by `owner.directoryCustomerId` or by `domain`, where the domain is - * a G Suite domain, for example: |Filter|Description| |------|-----------| - * |owner.directorycustomerid:123456789|Organizations with - * `owner.directory_customer_id` equal to `123456789`.| - * |domain:google.com|Organizations corresponding to the domain `google.com`.| - * This field is optional. - */ - filter: string; - /** - * The maximum number of Organizations to return in the response. This field - * is optional. - */ - pageSize: number; - /** - * A pagination token returned from a previous call to `SearchOrganizations` - * that indicates from where listing should continue. This field is optional. - */ - pageToken: string; -} -/** - * The response returned from the `SearchOrganizations` method. - */ -export interface Schema$SearchOrganizationsResponse { - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - */ - nextPageToken: string; - /** - * The list of Organizations that matched the search query, possibly - * paginated. - */ - organizations: Schema$Organization[]; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * The request sent to the SetOrgPolicyRequest method. - */ -export interface Schema$SetOrgPolicyRequest { - /** - * `Policy` to set on the resource. - */ - policy: Schema$OrgPolicy; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * The request sent to the UndeleteProject method. - */ -export interface Schema$UndeleteProjectRequest {} - -export class Resource$Folders { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * cloudresourcemanager.folders.clearOrgPolicy - * @desc Clears a `Policy` from a resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.clearOrgPolicy(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.clearOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource for the `Policy` to clear. - * @param {().ClearOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clearOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.folders.getEffectiveOrgPolicy - * @desc Gets the effective `Policy` on a resource. This is the result of - * merging `Policies` in the resource hierarchy. The returned `Policy` will - * not have an `etag`set because it is a computed `Policy` across multiple - * resources. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.getEffectiveOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.getEffectiveOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. - * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getEffectiveOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.folders.getOrgPolicy - * @desc Gets a `Policy` on a resource. If no `Policy` is set on the - * resource, a `Policy` is returned with default values including - * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be - * used with `SetOrgPolicy()` to create or update a `Policy` during - * read-modify-write. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.getOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.getOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource the `Policy` is set on. - * @param {().GetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.folders.listAvailableOrgPolicyConstraints - * @desc Lists `Constraints` that could be applied on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, - * handlePage); - * } - * }; - * - * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, - * handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.listAvailableOrgPolicyConstraints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list `Constraints` for. - * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): void; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listAvailableOrgPolicyConstraints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * cloudresourcemanager.folders.listOrgPolicies - * @desc Lists all the `Policies` set for a particular resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.folders.listOrgPolicies(request, handlePage); - * } - * }; - * - * cloudResourceManager.folders.listOrgPolicies(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.listOrgPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list Policies for. - * @param {().ListOrgPoliciesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listOrgPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listOrgPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.folders.setOrgPolicy - * @desc Updates the specified `Policy` on the resource. Creates a new - * `Policy` for that `Constraint` on the resource if one does not exist. Not - * supplying an `etag` on the request `Policy` results in an unconditional - * write of the `Policy`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'folders/my-folder', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.folders.setOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.folders.setOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. - * @param {().SetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Liens { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * cloudresourcemanager.liens.create - * @desc Create a Lien which applies to the resource denoted by the `parent` - * field. Callers of this method will require permission on the `parent` - * resource. For example, applying to `projects/1234` requires permission - * `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the - * number of Liens which may be applied. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.liens.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.liens.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Lien} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/liens').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.liens.delete - * @desc Delete a Lien by `name`. Callers of this method will require - * permission on the `parent` resource. For example, a Lien with a `parent` of - * `projects/1234` requires permission `resourcemanager.projects.updateLiens`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name/identifier of the Lien to delete. - * name: 'liens/my-lien', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.liens.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.liens.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name/identifier of the Lien to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.liens.list - * @desc List all Liens applied to the `parent` resource. Callers of this - * method will require permission on the `parent` resource. For example, a - * Lien with a `parent` of `projects/1234` requires permission - * `resourcemanager.projects.get`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var liensPage = response['liens']; - * if (!liensPage) { - * return; - * } - * for (var i = 0; i < liensPage.length; i++) { - * // TODO: Change code below to process each resource in `liensPage`: - * console.log(JSON.stringify(liensPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.liens.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.liens.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.liens.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of items to return. This is a suggestion for the server. - * @param {string=} params.pageToken The `next_page_token` value returned from a previous List request, if any. - * @param {string=} params.parent The name of the resource to list all attached Liens. For example, `projects/1234`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/liens').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operations { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * cloudresourcemanager.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Organizations { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * cloudresourcemanager.organizations.clearOrgPolicy - * @desc Clears a `Policy` from a resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.clearOrgPolicy(request, function(err) - * { if (err) { console.error(err); return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.clearOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource for the `Policy` to clear. - * @param {().ClearOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clearOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.get - * @desc Fetches an Organization resource identified by the specified resource - * name. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the Organization to fetch, e.g. - * "organizations/1234". name: 'organizations/my-organization', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Organization to fetch, e.g. "organizations/1234". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.getEffectiveOrgPolicy - * @desc Gets the effective `Policy` on a resource. This is the result of - * merging `Policies` in the resource hierarchy. The returned `Policy` will - * not have an `etag`set because it is a computed `Policy` across multiple - * resources. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getEffectiveOrgPolicy(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.getEffectiveOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. - * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getEffectiveOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.getIamPolicy - * @desc Gets the access control policy for an Organization resource. May be - * empty if no such policy or resource exists. The `resource` field should be - * the organization's resource name, e.g. "organizations/123". Authorization - * requires the Google IAM permission - * `resourcemanager.organizations.getIamPolicy` on the specified organization - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.getOrgPolicy - * @desc Gets a `Policy` on a resource. If no `Policy` is set on the - * resource, a `Policy` is returned with default values including - * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be - * used with `SetOrgPolicy()` to create or update a `Policy` during - * read-modify-write. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.getOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource the `Policy` is set on. - * @param {().GetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints - * @desc Lists `Constraints` that could be applied on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, - * handlePage); - * } - * }; - * - * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, - * handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list `Constraints` for. - * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): void; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listAvailableOrgPolicyConstraints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * cloudresourcemanager.organizations.listOrgPolicies - * @desc Lists all the `Policies` set for a particular resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.listOrgPolicies(request, - * handlePage); - * } - * }; - * - * cloudResourceManager.organizations.listOrgPolicies(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.listOrgPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list Policies for. - * @param {().ListOrgPoliciesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listOrgPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listOrgPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.search - * @desc Searches Organization resources that are visible to the user and - * satisfy the specified filter. This method returns Organizations in an - * unspecified order. New Organizations do not necessarily appear at the end - * of the results. Search will only return organizations on which the user - * has the permission `resourcemanager.organizations.get` - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var organizationsPage = response['organizations']; - * if (!organizationsPage) { - * return; - * } - * for (var i = 0; i < organizationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `organizationsPage`: console.log(JSON.stringify(organizationsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.search(request, handlePage); - * } - * }; - * - * cloudResourceManager.organizations.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchOrganizationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/organizations:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.setIamPolicy - * @desc Sets the access control policy on an Organization resource. Replaces - * any existing policy. The `resource` field should be the organization's - * resource name, e.g. "organizations/123". Authorization requires the Google - * IAM permission `resourcemanager.organizations.setIamPolicy` on the - * specified organization - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.setOrgPolicy - * @desc Updates the specified `Policy` on the resource. Creates a new - * `Policy` for that `Constraint` on the resource if one does not exist. Not - * supplying an `etag` on the request `Policy` results in an unconditional - * write of the `Policy`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.setOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.setOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. - * @param {().SetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * cloudresourcemanager.organizations.testIamPermissions - * @desc Returns permissions that a caller has on the specified Organization. - * The `resource` field should be the organization's resource name, e.g. - * "organizations/123". There are no permissions required for making this API - * call. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.testIamPermissions(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } -} - -export class Resource$Projects { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Request message for `TestIamPermissions` method. + */ + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - getRoot() { - return this.root; + /** + * Response message for `TestIamPermissions` method. + */ + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * cloudresourcemanager.projects.clearOrgPolicy - * @desc Clears a `Policy` from a resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource for the `Policy` to clear. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.clearOrgPolicy(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.clearOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource for the `Policy` to clear. - * @param {().ClearOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The request sent to the UndeleteProject method. */ - clearOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clearOrgPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export interface Schema$UndeleteProjectRequest {} + + export class Resource$Folders { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudresourcemanager.projects.create - * @desc Request that a new Project be created. The result is an Operation - * which can be used to track the creation process. It is automatically - * deleted after a few hours, so there is no need to call DeleteOperation. Our - * SLO permits Project creation to take up to 30 seconds at the 90th - * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile - * latency. 95th percentile latency is around 11 seconds. We recommend polling - * at the 5th second with an exponential backoff. Authorization requires the - * Google IAM permission `resourcemanager.projects.create` on the specified - * parent for the new project. The parent is identified by a specified - * ResourceId, which must include both an ID and a type, such as organization. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Project} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.clearOrgPolicy + * @desc Clears a `Policy` from a resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource for the `Policy` to clear. + * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.folders.clearOrgPolicy(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.clearOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource for the `Policy` to clear. + * @param {().ClearOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clearOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.folders.getEffectiveOrgPolicy + * @desc Gets the effective `Policy` on a resource. This is the result of + * merging `Policies` in the resource hierarchy. The returned `Policy` will + * not have an `etag`set because it is a computed `Policy` across multiple + * resources. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the resource to start computing the effective + * `Policy`. resource_: 'folders/my-folder', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.folders.getEffectiveOrgPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.getEffectiveOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. + * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getEffectiveOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.delete - * @desc Marks the Project identified by the specified `project_id` (for - * example, `my-project-123`) for deletion. This method will only affect the - * Project if it has a lifecycle state of ACTIVE. This method changes the - * Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion - * starts at an unspecified time, at which point the Project is no longer - * accessible. Until the deletion completes, you can check the lifecycle - * state checked by retrieving the Project with GetProject, and the Project - * remains visible to ListProjects. However, you cannot update the project. - * After the deletion completes, the Project is not retrievable by the - * GetProject and ListProjects methods. The caller must have modify - * permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `foo-bar-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `foo-bar-123`). Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.getOrgPolicy + * @desc Gets a `Policy` on a resource. If no `Policy` is set on the + * resource, a `Policy` is returned with default values including + * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can + * be used with `SetOrgPolicy()` to create or update a `Policy` during + * read-modify-write. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource the `Policy` is set on. + * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.folders.getOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.getOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource the `Policy` is set on. + * @param {().GetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.folders.listAvailableOrgPolicyConstraints + * @desc Lists `Constraints` that could be applied on the specified + * resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list `Constraints` for. + * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var constraintsPage = response['constraints']; + * if (!constraintsPage) { + * return; + * } + * for (var i = 0; i < constraintsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, + * handlePage); + * } + * }; + * + * cloudResourceManager.folders.listAvailableOrgPolicyConstraints(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.listAvailableOrgPolicyConstraints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list `Constraints` for. + * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): void; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/{+resource}:listAvailableOrgPolicyConstraints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListAvailableOrgPolicyConstraintsResponse>(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.folders.listOrgPolicies + * @desc Lists all the `Policies` set for a particular resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list Policies for. + * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var policiesPage = response['policies']; + * if (!policiesPage) { + * return; + * } + * for (var i = 0; i < policiesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.folders.listOrgPolicies(request, handlePage); + * } + * }; + * + * cloudResourceManager.folders.listOrgPolicies(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.listOrgPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list Policies for. + * @param {().ListOrgPoliciesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listOrgPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:listOrgPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.get - * @desc Retrieves the Project identified by the specified `project_id` (for - * example, `my-project-123`). The caller must have read permissions for this - * Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.setOrgPolicy + * @desc Updates the specified `Policy` on the resource. Creates a new + * `Policy` for that `Constraint` on the resource if one does not exist. Not + * supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Resource name of the resource to attach the `Policy`. + * resource_: 'folders/my-folder', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.folders.setOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.folders.setOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. + * @param {().SetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Liens { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudresourcemanager.projects.getAncestry - * @desc Gets a list of ancestors in the resource hierarchy for the Project - * identified by the specified `project_id` (for example, `my-project-123`). - * The caller must have read permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getAncestry(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getAncestry - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. - * @param {().GetAncestryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAncestry(params?: any, options?: MethodOptions): - AxiosPromise; - getAncestry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAncestry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.liens.create + * @desc Create a Lien which applies to the resource denoted by the `parent` + * field. Callers of this method will require permission on the `parent` + * resource. For example, applying to `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit + * the number of Liens which may be applied. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.liens.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.liens.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Lien} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/liens').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.liens.delete + * @desc Delete a Lien by `name`. Callers of this method will require + * permission on the `parent` resource. For example, a Lien with a `parent` + * of `projects/1234` requires permission + * `resourcemanager.projects.updateLiens`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name/identifier of the Lien to delete. + * name: 'liens/my-lien', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.liens.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.liens.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name/identifier of the Lien to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:getAncestry') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.liens.list + * @desc List all Liens applied to the `parent` resource. Callers of this + * method will require permission on the `parent` resource. For example, a + * Lien with a `parent` of `projects/1234` requires permission + * `resourcemanager.projects.get`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var liensPage = response['liens']; + * if (!liensPage) { + * return; + * } + * for (var i = 0; i < liensPage.length; i++) { + * // TODO: Change code below to process each resource in `liensPage`: + * console.log(JSON.stringify(liensPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudResourceManager.liens.list(request, handlePage); + * } + * }; + * + * cloudResourceManager.liens.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.liens.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of items to return. This is a suggestion for the server. + * @param {string=} params.pageToken The `next_page_token` value returned from a previous List request, if any. + * @param {string=} params.parent The name of the resource to list all attached Liens. For example, `projects/1234`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/liens').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * cloudresourcemanager.projects.getEffectiveOrgPolicy - * @desc Gets the effective `Policy` on a resource. This is the result of - * merging `Policies` in the resource hierarchy. The returned `Policy` will - * not have an `etag`set because it is a computed `Policy` across multiple - * resources. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the resource to start computing the effective `Policy`. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getEffectiveOrgPolicy(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getEffectiveOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. - * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getEffectiveOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getEffectiveOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource. + * name: 'operations/my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.operations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Organizations { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); + } - /** - * cloudresourcemanager.projects.getIamPolicy - * @desc Returns the IAM access control policy for the specified Project. - * Permission is denied if the policy or the resource does not exist. - * Authorization requires the Google IAM permission - * `resourcemanager.projects.getIamPolicy` on the project. For additional - * information about resource structure and identification, see [Resource - * Names](/apis/design/resource_names). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.organizations.clearOrgPolicy + * @desc Clears a `Policy` from a resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource for the `Policy` to clear. + * resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.clearOrgPolicy(request, + * function(err) { if (err) { console.error(err); return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.clearOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource for the `Policy` to clear. + * @param {().ClearOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clearOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.organizations.get + * @desc Fetches an Organization resource identified by the specified + * resource name. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the Organization to fetch, e.g. + * "organizations/1234". name: 'organizations/my-organization', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Organization to fetch, e.g. "organizations/1234". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.getOrgPolicy - * @desc Gets a `Policy` on a resource. If no `Policy` is set on the - * resource, a `Policy` is returned with default values including - * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be - * used with `SetOrgPolicy()` to create or update a `Policy` during - * read-modify-write. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource the `Policy` is set on. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource the `Policy` is set on. - * @param {().GetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.getEffectiveOrgPolicy + * @desc Gets the effective `Policy` on a resource. This is the result of + * merging `Policies` in the resource hierarchy. The returned `Policy` will + * not have an `etag`set because it is a computed `Policy` across multiple + * resources. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the resource to start computing the effective + * `Policy`. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.getEffectiveOrgPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.getEffectiveOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. + * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getEffectiveOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.organizations.getIamPolicy + * @desc Gets the access control policy for an Organization resource. May be + * empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, e.g. "organizations/123". + * Authorization requires the Google IAM permission + * `resourcemanager.organizations.getIamPolicy` on the specified + * organization + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.organizations.getOrgPolicy + * @desc Gets a `Policy` on a resource. If no `Policy` is set on the + * resource, a `Policy` is returned with default values including + * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can + * be used with `SetOrgPolicy()` to create or update a `Policy` during + * read-modify-write. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource the `Policy` is set on. + * resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.getOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.getOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource the `Policy` is set on. + * @param {().GetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.list - * @desc Lists Projects that are visible to the user and satisfy the specified - * filter. This method returns Projects in an unspecified order. This method - * is eventually consistent with project mutations; this means that a newly - * created project may not appear in the results or recent updates to an - * existing project may not be reflected in the results. To retrieve the - * latest state of a project, use the GetProject method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.projects.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.projects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:how*|The project's name starts with "how".| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. If you specify a filter that has both `parent.type` and `parent.id`, then the `resourcemanager.projects.list` permission is checked on the parent. If the user has this permission, all projects under the parent will be returned after remaining filters have been applied. If the user lacks this permission, then all projects for which the user has the `resourcemanager.projects.get` permission will be returned after remaining filters have been applied. If no filter is specified, the call will return projects for which the user has `resourcemanager.projects.get` permissions. Optional. - * @param {integer=} params.pageSize The maximum number of Projects to return in the response. The server can return fewer Projects than requested. If unspecified, server picks an appropriate default. Optional. - * @param {string=} params.pageToken A pagination token returned from a previous call to ListProjects that indicates from where listing should continue. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints + * @desc Lists `Constraints` that could be applied on the specified + * resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list `Constraints` for. + * resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var constraintsPage = response['constraints']; + * if (!constraintsPage) { + * return; + * } + * for (var i = 0; i < constraintsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, + * handlePage); + * } + * }; + * + * cloudResourceManager.organizations.listAvailableOrgPolicyConstraints(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias + * cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list `Constraints` for. + * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): void; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/{+resource}:listAvailableOrgPolicyConstraints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListAvailableOrgPolicyConstraintsResponse>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.organizations.listOrgPolicies + * @desc Lists all the `Policies` set for a particular resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list Policies for. + * resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var policiesPage = response['policies']; + * if (!policiesPage) { + * return; + * } + * for (var i = 0; i < policiesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.organizations.listOrgPolicies(request, + * handlePage); + * } + * }; + * + * cloudResourceManager.organizations.listOrgPolicies(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.listOrgPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list Policies for. + * @param {().ListOrgPoliciesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listOrgPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:listOrgPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.organizations.search + * @desc Searches Organization resources that are visible to the user and + * satisfy the specified filter. This method returns Organizations in an + * unspecified order. New Organizations do not necessarily appear at the end + * of the results. Search will only return organizations on which the user + * has the permission `resourcemanager.organizations.get` + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var organizationsPage = response['organizations']; + * if (!organizationsPage) { + * return; + * } + * for (var i = 0; i < organizationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `organizationsPage`: console.log(JSON.stringify(organizationsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.organizations.search(request, handlePage); + * } + * }; + * + * cloudResourceManager.organizations.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchOrganizationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/organizations:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.listAvailableOrgPolicyConstraints - * @desc Lists `Constraints` that could be applied on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list `Constraints` for. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var constraintsPage = response['constraints']; - * if (!constraintsPage) { - * return; - * } - * for (var i = 0; i < constraintsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, - * handlePage); - * } - * }; - * - * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, - * handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.listAvailableOrgPolicyConstraints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list `Constraints` for. - * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): void; - listAvailableOrgPolicyConstraints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListAvailableOrgPolicyConstraintsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.setIamPolicy + * @desc Sets the access control policy on an Organization resource. + * Replaces any existing policy. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". Authorization + * requires the Google IAM permission + * `resourcemanager.organizations.setIamPolicy` on the specified + * organization + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.organizations.setOrgPolicy + * @desc Updates the specified `Policy` on the resource. Creates a new + * `Policy` for that `Constraint` on the resource if one does not exist. Not + * supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Resource name of the resource to attach the `Policy`. + * resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.setOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.setOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. + * @param {().SetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listAvailableOrgPolicyConstraints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * cloudresourcemanager.organizations.testIamPermissions + * @desc Returns permissions that a caller has on the specified + * Organization. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". There are no permissions required for + * making this API call. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.testIamPermissions(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * cloudresourcemanager.projects.listOrgPolicies - * @desc Lists all the `Policies` set for a particular resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the resource to list Policies for. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var policiesPage = response['policies']; - * if (!policiesPage) { - * return; - * } - * for (var i = 0; i < policiesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * cloudResourceManager.projects.listOrgPolicies(request, handlePage); - * } - * }; - * - * cloudResourceManager.projects.listOrgPolicies(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.listOrgPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Name of the resource to list Policies for. - * @param {().ListOrgPoliciesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listOrgPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listOrgPolicies( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:listOrgPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.clearOrgPolicy + * @desc Clears a `Policy` from a resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource for the `Policy` to clear. + * resource_: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.clearOrgPolicy(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.clearOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource for the `Policy` to clear. + * @param {().ClearOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clearOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clearOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:clearOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.setIamPolicy - * @desc Sets the IAM access control policy for the specified Project. - * Overwrites any existing policy. The following constraints apply when using - * `setIamPolicy()`: + Project does not support `allUsers` and - * `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The - * owner role can be granted only to `user` and `serviceAccount`. + Service - * accounts can be made owners of a project directly without any restrictions. - * However, to be added as an owner, a user must be invited via Cloud Platform - * console and must accept the invitation. + A user cannot be granted the - * owner role using `setIamPolicy()`. The user must be granted the owner role - * using the Cloud Platform Console and must explicitly accept the invitation. - * + You can only grant ownership of a project to a member by using the GCP - * Console. Inviting a member will deliver an invitation email that they must - * accept. An invitation email is not generated if you are granting a role - * other than owner, or if both the member you are inviting and the project - * are part of your organization. + Membership changes that leave the project - * without any owners that have accepted the Terms of Service (ToS) will be - * rejected. + If the project is not part of an organization, there must be - * at least one owner who has accepted the Terms of Service (ToS) agreement in - * the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner - * from the policy will fail. This restriction also applies to legacy projects - * that no longer have owners who have accepted the ToS. Edits to IAM policies - * will be rejected until the lack of a ToS-accepting owner is rectified. + - * This method will replace the existing policy, and cannot be used to append - * additional IAM settings. Note: Removing service accounts from policies or - * changing their roles can render services completely inoperable. It is - * important to understand how the service account is being used before - * removing or updating its roles. Authorization requires the Google IAM - * permission `resourcemanager.projects.setIamPolicy` on the project - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.create + * @desc Request that a new Project be created. The result is an Operation + * which can be used to track the creation process. It is automatically + * deleted after a few hours, so there is no need to call DeleteOperation. + * Our SLO permits Project creation to take up to 30 seconds at the 90th + * percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + * latency. 95th percentile latency is around 11 seconds. We recommend + * polling at the 5th second with an exponential backoff. Authorization + * requires the Google IAM permission `resourcemanager.projects.create` on + * the specified parent for the new project. The parent is identified by a + * specified ResourceId, which must include both an ID and a type, such as + * organization. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Project} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.projects.delete + * @desc Marks the Project identified by the specified `project_id` (for + * example, `my-project-123`) for deletion. This method will only affect the + * Project if it has a lifecycle state of ACTIVE. This method changes the + * Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion + * starts at an unspecified time, at which point the Project is no longer + * accessible. Until the deletion completes, you can check the lifecycle + * state checked by retrieving the Project with GetProject, and the Project + * remains visible to ListProjects. However, you cannot update the project. + * After the deletion completes, the Project is not retrievable by the + * GetProject and ListProjects methods. The caller must have modify + * permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `foo-bar-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `foo-bar-123`). Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.get + * @desc Retrieves the Project identified by the specified `project_id` (for + * example, `my-project-123`). The caller must have read permissions for + * this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.setOrgPolicy - * @desc Updates the specified `Policy` on the resource. Creates a new - * `Policy` for that `Constraint` on the resource if one does not exist. Not - * supplying an `etag` on the request `Policy` results in an unconditional - * write of the `Policy`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name of the resource to attach the `Policy`. - * resource_: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.setOrgPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.setOrgPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. - * @param {().SetOrgPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setOrgPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setOrgPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.getAncestry + * @desc Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * The caller must have read permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getAncestry(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getAncestry + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. + * @param {().GetAncestryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAncestry(params?: any, options?: MethodOptions): + AxiosPromise; + getAncestry( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAncestry( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:getAncestry') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.projects.getEffectiveOrgPolicy + * @desc Gets the effective `Policy` on a resource. This is the result of + * merging `Policies` in the resource hierarchy. The returned `Policy` will + * not have an `etag`set because it is a computed `Policy` across multiple + * resources. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the resource to start computing the effective + * `Policy`. resource_: 'projects/my-project', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getEffectiveOrgPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getEffectiveOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ The name of the resource to start computing the effective `Policy`. + * @param {().GetEffectiveOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getEffectiveOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getEffectiveOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getEffectiveOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setOrgPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.getIamPolicy + * @desc Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. + * Authorization requires the Google IAM permission + * `resourcemanager.projects.getIamPolicy` on the project. For additional + * information about resource structure and identification, see [Resource + * Names](/apis/design/resource_names). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.testIamPermissions - * @desc Returns permissions that a caller has on the specified Project. There - * are no permissions required for making this API call. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.getOrgPolicy + * @desc Gets a `Policy` on a resource. If no `Policy` is set on the + * resource, a `Policy` is returned with default values including + * `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can + * be used with `SetOrgPolicy()` to create or update a `Policy` during + * read-modify-write. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource the `Policy` is set on. + * resource_: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource the `Policy` is set on. + * @param {().GetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.projects.list + * @desc Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the GetProject method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var projectsPage = response['projects']; + * if (!projectsPage) { + * return; + * } + * for (var i = 0; i < projectsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudResourceManager.projects.list(request, handlePage); + * } + * }; + * + * cloudResourceManager.projects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:how*|The project's name starts with "how".| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. If you specify a filter that has both `parent.type` and `parent.id`, then the `resourcemanager.projects.list` permission is checked on the parent. If the user has this permission, all projects under the parent will be returned after remaining filters have been applied. If the user lacks this permission, then all projects for which the user has the `resourcemanager.projects.get` permission will be returned after remaining filters have been applied. If no filter is specified, the call will return projects for which the user has `resourcemanager.projects.get` permissions. Optional. + * @param {integer=} params.pageSize The maximum number of Projects to return in the response. The server can return fewer Projects than requested. If unspecified, server picks an appropriate default. Optional. + * @param {string=} params.pageToken A pagination token returned from a previous call to ListProjects that indicates from where listing should continue. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.listAvailableOrgPolicyConstraints + * @desc Lists `Constraints` that could be applied on the specified + * resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list `Constraints` for. + * resource_: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var constraintsPage = response['constraints']; + * if (!constraintsPage) { + * return; + * } + * for (var i = 0; i < constraintsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `constraintsPage`: console.log(JSON.stringify(constraintsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, + * handlePage); + * } + * }; + * + * cloudResourceManager.projects.listAvailableOrgPolicyConstraints(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.listAvailableOrgPolicyConstraints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list `Constraints` for. + * @param {().ListAvailableOrgPolicyConstraintsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableOrgPolicyConstraints(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): void; + listAvailableOrgPolicyConstraints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListAvailableOrgPolicyConstraintsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/{+resource}:listAvailableOrgPolicyConstraints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListAvailableOrgPolicyConstraintsResponse>(parameters); + } } - } - /** - * cloudresourcemanager.projects.undelete - * @desc Restores the Project identified by the specified `project_id` (for - * example, `my-project-123`). You can only use this method for a Project that - * has a lifecycle state of DELETE_REQUESTED. After deletion starts, the - * Project cannot be restored. The caller must have modify permissions for - * this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID (for example, `foo-bar-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.undelete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The project ID (for example, `foo-bar-123`). Required. - * @param {().UndeleteProjectRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.listOrgPolicies + * @desc Lists all the `Policies` set for a particular resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the resource to list Policies for. + * resource_: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var policiesPage = response['policies']; + * if (!policiesPage) { + * return; + * } + * for (var i = 0; i < policiesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `policiesPage`: console.log(JSON.stringify(policiesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * cloudResourceManager.projects.listOrgPolicies(request, handlePage); + * } + * }; + * + * cloudResourceManager.projects.listOrgPolicies(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.listOrgPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Name of the resource to list Policies for. + * @param {().ListOrgPoliciesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listOrgPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listOrgPolicies( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:listOrgPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.projects.setIamPolicy + * @desc Sets the IAM access control policy for the specified Project. + * Overwrites any existing policy. The following constraints apply when + * using `setIamPolicy()`: + Project does not support `allUsers` and + * `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The + * owner role can be granted only to `user` and `serviceAccount`. + Service + * accounts can be made owners of a project directly without any + * restrictions. However, to be added as an owner, a user must be invited + * via Cloud Platform console and must accept the invitation. + A user + * cannot be granted the owner role using `setIamPolicy()`. The user must be + * granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + You can only grant ownership of a + * project to a member by using the GCP Console. Inviting a member will + * deliver an invitation email that they must accept. An invitation email is + * not generated if you are granting a role other than owner, or if both the + * member you are inviting and the project are part of your organization. + + * Membership changes that leave the project without any owners that have + * accepted the Terms of Service (ToS) will be rejected. + If the project + * is not part of an organization, there must be at least one owner who has + * accepted the Terms of Service (ToS) agreement in the policy. Calling + * `setIamPolicy()` to remove the last ToS-accepted owner from the policy + * will fail. This restriction also applies to legacy projects that no + * longer have owners who have accepted the ToS. Edits to IAM policies will + * be rejected until the lack of a ToS-accepting owner is rectified. + This + * method will replace the existing policy, and cannot be used to append + * additional IAM settings. Note: Removing service accounts from policies + * or changing their roles can render services completely inoperable. It is + * important to understand how the service account is being used before + * removing or updating its roles. Authorization requires the Google IAM + * permission `resourcemanager.projects.setIamPolicy` on the project + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.setOrgPolicy + * @desc Updates the specified `Policy` on the resource. Creates a new + * `Policy` for that `Constraint` on the resource if one does not exist. Not + * supplying an `etag` on the request `Policy` results in an unconditional + * write of the `Policy`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Resource name of the resource to attach the `Policy`. + * resource_: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.setOrgPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.setOrgPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ Resource name of the resource to attach the `Policy`. + * @param {().SetOrgPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setOrgPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setOrgPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setOrgPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.update - * @desc Updates the attributes of the Project identified by the specified - * `project_id` (for example, `my-project-123`). The caller must have modify - * permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The project ID (for example, `my-project-123`). Required. - * @param {().Project} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.testIamPermissions + * @desc Returns permissions that a caller has on the specified Project. + * There are no permissions required for making this API call. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudresourcemanager.projects.undelete + * @desc Restores the Project identified by the specified `project_id` (for + * example, `my-project-123`). You can only use this method for a Project + * that has a lifecycle state of DELETE_REQUESTED. After deletion starts, + * the Project cannot be restored. The caller must have modify permissions + * for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID (for example, `foo-bar-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.undelete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The project ID (for example, `foo-bar-123`). Required. + * @param {().UndeleteProjectRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudresourcemanager.projects.update + * @desc Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). The caller must have + * modify permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The project ID (for example, `my-project-123`). Required. + * @param {().Project} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudresourcemanager/v1beta1.ts b/src/apis/cloudresourcemanager/v1beta1.ts index f7573d5ce2c..83fb260391c 100644 --- a/src/apis/cloudresourcemanager/v1beta1.ts +++ b/src/apis/cloudresourcemanager/v1beta1.ts @@ -27,2331 +27,2378 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Resource Manager API - * - * The Google Cloud Resource Manager API provides methods for creating, reading, - * and updating project metadata. - * - * @example - * const google = require('googleapis'); - * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); - * - * @namespace cloudresourcemanager - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Cloudresourcemanager - */ -export class Cloudresourcemanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudresourcemanager_v1beta1 { + /** + * Cloud Resource Manager API + * + * The Google Cloud Resource Manager API provides methods for creating, + * reading, and updating project metadata. + * + * @example + * const google = require('googleapis'); + * const cloudresourcemanager = google.cloudresourcemanager('v1beta1'); + * + * @namespace cloudresourcemanager + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Cloudresourcemanager + */ + export class Cloudresourcemanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - organizations: Resource$Organizations; - projects: Resource$Projects; + organizations: Resource$Organizations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - } + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Identifying information for a single ancestor of a project. - */ -export interface Schema$Ancestor { - /** - * Resource id of the ancestor. - */ - resourceId: Schema$ResourceId; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` . * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Metadata describing a long running folder operation - */ -export interface Schema$FolderOperation { - /** - * The resource name of the folder or organization we are either creating the - * folder under or moving the folder to. - */ - destinationParent: string; - /** - * The display name of the folder. - */ - displayName: string; - /** - * The type of this operation. - */ - operationType: string; - /** - * The resource name of the folder's parent. Only applicable when the - * operation_type is MOVE. - */ - sourceParent: string; -} -/** - * A classification of the Folder Operation error. - */ -export interface Schema$FolderOperationError { - /** - * The type of operation error experienced. - */ - errorMessageId: string; -} -/** - * The request sent to the GetAncestry method. - */ -export interface Schema$GetAncestryRequest {} -/** - * Response from the GetAncestry method. - */ -export interface Schema$GetAncestryResponse { - /** - * Ancestors are ordered from bottom to top of the resource hierarchy. The - * first ancestor is the project itself, followed by the project's parent, - * etc. - */ - ancestor: Schema$Ancestor[]; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The response returned from the `ListOrganizations` method. - */ -export interface Schema$ListOrganizationsResponse { - /** - * A pagination token to be used to retrieve the next page of results. If the - * result is too large to fit within the page size specified in the request, - * this field will be set with a token that can be used to fetch the next page - * of results. If this field is empty, it indicates that this response - * contains the last page of results. - */ - nextPageToken: string; - /** - * The list of Organizations that matched the list query, possibly paginated. - */ - organizations: Schema$Organization[]; -} -/** - * A page of the response received from the ListProjects method. A paginated - * response where more pages are available has `next_page_token` set. This token - * can be used in a subsequent request to retrieve the next request page. - */ -export interface Schema$ListProjectsResponse { - /** - * Pagination token. If the result set is too large to fit in a single - * response, this token is returned. It encodes the position of the current - * result cursor. Feeding this value into a new list request with the - * `page_token` parameter gives the next page of the results. When - * `next_page_token` is not filled in, there is no next page and the list - * returned is the last page in the result set. Pagination tokens have a - * limited lifetime. - */ - nextPageToken: string; - /** - * The list of Projects that matched the list filter. This list can be - * paginated. - */ - projects: Schema$Project[]; -} -/** - * The root node in the resource hierarchy to which a particular entity's - * (e.g., company) resources belong. - */ -export interface Schema$Organization { - /** - * Timestamp when the Organization was created. Assigned by the server. - * @OutputOnly - */ - creationTime: string; - /** - * A human-readable string that refers to the Organization in the GCP Console - * UI. This string is set by the server and cannot be changed. The string will - * be set to the primary domain (for example, "google.com") of the G - * Suite customer that owns the organization. @OutputOnly - */ - displayName: string; - /** - * The organization's current lifecycle state. Assigned by the server. - * @OutputOnly - */ - lifecycleState: string; - /** - * Output Only. The resource name of the organization. This is the - * organization's relative path in the API. Its format is - * "organizations/[organization_id]". For example, - * "organizations/1234". - */ - name: string; /** - * An immutable id for the Organization that is assigned on creation. This - * should be omitted when creating a new Organization. This field is - * read-only. + * Identifying information for a single ancestor of a project. */ - organizationId: string; - /** - * The owner of this Organization. The owner should be specified on creation. - * Once set, it cannot be changed. This field is required. - */ - owner: Schema$OrganizationOwner; -} -/** - * The entity that owns an Organization. The lifetime of the Organization and - * all of its descendants are bound to the `OrganizationOwner`. If the - * `OrganizationOwner` is deleted, the Organization and all its descendants will - * be deleted. - */ -export interface Schema$OrganizationOwner { + export interface Schema$Ancestor { + /** + * Resource id of the ancestor. + */ + resourceId: Schema$ResourceId; + } /** - * The G Suite customer id used in the Directory API. + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. */ - directoryCustomerId: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * Specifies cloud audit logging configuration for this policy. + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. */ - auditConfigs: Schema$AuditConfig[]; + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. + * Associates `members` with a `role`. */ - bindings: Schema$Binding[]; + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - etag: string; + export interface Schema$Empty {} /** - * Deprecated. + * Metadata describing a long running folder operation */ - version: number; -} -/** - * A Project is a high-level Google Cloud Platform entity. It is a container - * for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud Platform - * resources. - */ -export interface Schema$Project { + export interface Schema$FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent: string; + /** + * The display name of the folder. + */ + displayName: string; + /** + * The type of this operation. + */ + operationType: string; + /** + * The resource name of the folder's parent. Only applicable when the + * operation_type is MOVE. + */ + sourceParent: string; + } /** - * Creation time. Read-only. + * A classification of the Folder Operation error. */ - createTime: string; + export interface Schema$FolderOperationError { + /** + * The type of operation error experienced. + */ + errorMessageId: string; + } /** - * The labels associated with this Project. Label keys must be between 1 and - * 63 characters long and must conform to the following regular expression: - * \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be between 0 and 63 - * characters long and must conform to the regular expression - * (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels can be - * associated with a given resource. Clients should store labels in a - * representation such as JSON that does not depend on specific characters - * being disallowed. Example: <code>"environment" : - * "dev"</code> Read-write. + * The request sent to the GetAncestry method. */ - labels: any; + export interface Schema$GetAncestryRequest {} /** - * The Project lifecycle state. Read-only. + * Response from the GetAncestry method. */ - lifecycleState: string; + export interface Schema$GetAncestryResponse { + /** + * Ancestors are ordered from bottom to top of the resource hierarchy. The + * first ancestor is the project itself, followed by the project's + * parent, etc. + */ + ancestor: Schema$Ancestor[]; + } /** - * The user-assigned display name of the Project. It must be 4 to 30 - * characters. Allowed characters are: lowercase and uppercase letters, - * numbers, hyphen, single-quote, double-quote, space, and exclamation point. - * Example: <code>My Project</code> Read-write. + * Request message for `GetIamPolicy` method. */ - name: string; + export interface Schema$GetIamPolicyRequest {} /** - * An optional reference to a parent Resource. Supported parent types include - * "organization" and "folder". Once set, the parent - * cannot be cleared. The `parent` can be set on creation or using the - * `UpdateProject` method; the end user must have the - * `resourcemanager.projects.create` permission on the parent. Read-write. + * The response returned from the `ListOrganizations` method. */ - parent: Schema$ResourceId; + export interface Schema$ListOrganizationsResponse { + /** + * A pagination token to be used to retrieve the next page of results. If + * the result is too large to fit within the page size specified in the + * request, this field will be set with a token that can be used to fetch + * the next page of results. If this field is empty, it indicates that this + * response contains the last page of results. + */ + nextPageToken: string; + /** + * The list of Organizations that matched the list query, possibly + * paginated. + */ + organizations: Schema$Organization[]; + } /** - * The unique, user-assigned ID of the Project. It must be 6 to 30 lowercase - * letters, digits, or hyphens. It must start with a letter. Trailing hyphens - * are prohibited. Example: <code>tokyo-rain-123</code> Read-only - * after creation. + * A page of the response received from the ListProjects method. A paginated + * response where more pages are available has `next_page_token` set. This + * token can be used in a subsequent request to retrieve the next request + * page. */ - projectId: string; + export interface Schema$ListProjectsResponse { + /** + * Pagination token. If the result set is too large to fit in a single + * response, this token is returned. It encodes the position of the current + * result cursor. Feeding this value into a new list request with the + * `page_token` parameter gives the next page of the results. When + * `next_page_token` is not filled in, there is no next page and the list + * returned is the last page in the result set. Pagination tokens have a + * limited lifetime. + */ + nextPageToken: string; + /** + * The list of Projects that matched the list filter. This list can be + * paginated. + */ + projects: Schema$Project[]; + } /** - * The number uniquely identifying the project. Example: - * <code>415104041262</code> Read-only. + * The root node in the resource hierarchy to which a particular entity's + * (e.g., company) resources belong. */ - projectNumber: string; -} -/** - * A status object which is used as the `metadata` field for the Operation - * returned by CreateProject. It provides insight for when significant phases of - * Project creation have completed. - */ -export interface Schema$ProjectCreationStatus { + export interface Schema$Organization { + /** + * Timestamp when the Organization was created. Assigned by the server. + * @OutputOnly + */ + creationTime: string; + /** + * A human-readable string that refers to the Organization in the GCP + * Console UI. This string is set by the server and cannot be changed. The + * string will be set to the primary domain (for example, + * "google.com") of the G Suite customer that owns the + * organization. @OutputOnly + */ + displayName: string; + /** + * The organization's current lifecycle state. Assigned by the server. + * @OutputOnly + */ + lifecycleState: string; + /** + * Output Only. The resource name of the organization. This is the + * organization's relative path in the API. Its format is + * "organizations/[organization_id]". For example, + * "organizations/1234". + */ + name: string; + /** + * An immutable id for the Organization that is assigned on creation. This + * should be omitted when creating a new Organization. This field is + * read-only. + */ + organizationId: string; + /** + * The owner of this Organization. The owner should be specified on + * creation. Once set, it cannot be changed. This field is required. + */ + owner: Schema$OrganizationOwner; + } /** - * Creation time of the project creation workflow. + * The entity that owns an Organization. The lifetime of the Organization and + * all of its descendants are bound to the `OrganizationOwner`. If the + * `OrganizationOwner` is deleted, the Organization and all its descendants + * will be deleted. */ - createTime: string; + export interface Schema$OrganizationOwner { + /** + * The G Suite customer id used in the Directory API. + */ + directoryCustomerId: string; + } /** - * True if the project can be retrieved using GetProject. No other operations - * on the project are guaranteed to work until the project creation is - * complete. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). */ - gettable: boolean; + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * True if the project creation process is complete. + * A Project is a high-level Google Cloud Platform entity. It is a container + * for ACLs, APIs, App Engine Apps, VMs, and other Google Cloud Platform + * resources. */ - ready: boolean; -} -/** - * A container to reference an id for any resource type. A `resource` in Google - * Cloud Platform is a generic term for something you (a developer) may want to - * interact with through one of our API's. Some examples are an App Engine - * app, a Compute Engine instance, a Cloud SQL database, and so on. - */ -export interface Schema$ResourceId { + export interface Schema$Project { + /** + * Creation time. Read-only. + */ + createTime: string; + /** + * The labels associated with this Project. Label keys must be between 1 + * and 63 characters long and must conform to the following regular + * expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. Label values must be + * between 0 and 63 characters long and must conform to the regular + * expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. No more than 256 labels + * can be associated with a given resource. Clients should store labels in + * a representation such as JSON that does not depend on specific characters + * being disallowed. Example: <code>"environment" : + * "dev"</code> Read-write. + */ + labels: any; + /** + * The Project lifecycle state. Read-only. + */ + lifecycleState: string; + /** + * The user-assigned display name of the Project. It must be 4 to 30 + * characters. Allowed characters are: lowercase and uppercase letters, + * numbers, hyphen, single-quote, double-quote, space, and exclamation + * point. Example: <code>My Project</code> Read-write. + */ + name: string; + /** + * An optional reference to a parent Resource. Supported parent types + * include "organization" and "folder". Once set, the + * parent cannot be cleared. The `parent` can be set on creation or using + * the `UpdateProject` method; the end user must have the + * `resourcemanager.projects.create` permission on the parent. Read-write. + */ + parent: Schema$ResourceId; + /** + * The unique, user-assigned ID of the Project. It must be 6 to 30 lowercase + * letters, digits, or hyphens. It must start with a letter. Trailing + * hyphens are prohibited. Example: <code>tokyo-rain-123</code> + * Read-only after creation. + */ + projectId: string; + /** + * The number uniquely identifying the project. Example: + * <code>415104041262</code> Read-only. + */ + projectNumber: string; + } /** - * Required field for the type-specific id. This should correspond to the id - * used in the type-specific API's. + * A status object which is used as the `metadata` field for the Operation + * returned by CreateProject. It provides insight for when significant phases + * of Project creation have completed. */ - id: string; + export interface Schema$ProjectCreationStatus { + /** + * Creation time of the project creation workflow. + */ + createTime: string; + /** + * True if the project can be retrieved using GetProject. No other + * operations on the project are guaranteed to work until the project + * creation is complete. + */ + gettable: boolean; + /** + * True if the project creation process is complete. + */ + ready: boolean; + } /** - * Required field representing the resource type this id is for. At present, - * the valid types are "project", "folder", and - * "organization". + * A container to reference an id for any resource type. A `resource` in + * Google Cloud Platform is a generic term for something you (a developer) may + * want to interact with through one of our API's. Some examples are an + * App Engine app, a Compute Engine instance, a Cloud SQL database, and so on. */ - type: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + export interface Schema$ResourceId { + /** + * Required field for the type-specific id. This should correspond to the id + * used in the type-specific API's. + */ + id: string; + /** + * Required field representing the resource type this id is for. At present, + * the valid types are "project", "folder", and + * "organization". + */ + type: string; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. + * Request message for `SetIamPolicy` method. */ - policy: Schema$Policy; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. + * Request message for `TestIamPermissions` method. */ - updateMask: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * Response message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * The request sent to the UndeleteProject method. */ - permissions: string[]; -} -/** - * The request sent to the UndeleteProject method. - */ -export interface Schema$UndeleteProjectRequest {} + export interface Schema$UndeleteProjectRequest {} -export class Resource$Organizations { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Organizations { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudresourcemanager.organizations.get - * @desc Fetches an Organization resource identified by the specified resource - * name. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the Organization to fetch, e.g. - * "organizations/1234". name: 'organizations/my-organization', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Organization to fetch, e.g. "organizations/1234". - * @param {string=} params.organizationId The id of the Organization resource to fetch. This field is deprecated and will be removed in v1. Use name instead. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.get + * @desc Fetches an Organization resource identified by the specified + * resource name. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the Organization to fetch, e.g. + * "organizations/1234". name: 'organizations/my-organization', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Organization to fetch, e.g. "organizations/1234". + * @param {string=} params.organizationId The id of the Organization resource to fetch. This field is deprecated and will be removed in v1. Use name instead. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.organizations.getIamPolicy - * @desc Gets the access control policy for an Organization resource. May be - * empty if no such policy or resource exists. The `resource` field should be - * the organization's resource name, e.g. "organizations/123". - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.getIamPolicy + * @desc Gets the access control policy for an Organization resource. May be + * empty if no such policy or resource exists. The `resource` field should + * be the organization's resource name, e.g. "organizations/123". + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.organizations.list - * @desc Lists Organization resources that are visible to the user and satisfy - * the specified filter. This method returns Organizations in an unspecified - * order. New Organizations do not necessarily appear at the end of the list. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var organizationsPage = response['organizations']; - * if (!organizationsPage) { - * return; - * } - * for (var i = 0; i < organizationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `organizationsPage`: console.log(JSON.stringify(organizationsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.organizations.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.organizations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An optional query string used to filter the Organizations to return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for example: |Filter|Description| |------|-----------| |owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.| |domain:google.com|Organizations corresponding to the domain `google.com`.| This field is optional. - * @param {integer=} params.pageSize The maximum number of Organizations to return in the response. This field is optional. - * @param {string=} params.pageToken A pagination token returned from a previous call to `ListOrganizations` that indicates from where listing should continue. This field is optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/organizations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.organizations.list + * @desc Lists Organization resources that are visible to the user and + * satisfy the specified filter. This method returns Organizations in an + * unspecified order. New Organizations do not necessarily appear at the end + * of the list. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var organizationsPage = response['organizations']; + * if (!organizationsPage) { + * return; + * } + * for (var i = 0; i < organizationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `organizationsPage`: console.log(JSON.stringify(organizationsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudResourceManager.organizations.list(request, handlePage); + * } + * }; + * + * cloudResourceManager.organizations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An optional query string used to filter the Organizations to return in the response. Filter rules are case-insensitive. Organizations may be filtered by `owner.directoryCustomerId` or by `domain`, where the domain is a G Suite domain, for example: |Filter|Description| |------|-----------| |owner.directorycustomerid:123456789|Organizations with `owner.directory_customer_id` equal to `123456789`.| |domain:google.com|Organizations corresponding to the domain `google.com`.| This field is optional. + * @param {integer=} params.pageSize The maximum number of Organizations to return in the response. This field is optional. + * @param {string=} params.pageToken A pagination token returned from a previous call to `ListOrganizations` that indicates from where listing should continue. This field is optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/organizations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.organizations.setIamPolicy - * @desc Sets the access control policy on an Organization resource. Replaces - * any existing policy. The `resource` field should be the organization's - * resource name, e.g. "organizations/123". - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.setIamPolicy + * @desc Sets the access control policy on an Organization resource. + * Replaces any existing policy. The `resource` field should be the + * organization's resource name, e.g. "organizations/123". + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.organizations.testIamPermissions - * @desc Returns permissions that a caller has on the specified Organization. - * The `resource` field should be the organization's resource name, e.g. - * "organizations/123". - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'organizations/my-organization', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.testIamPermissions(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.organizations.testIamPermissions + * @desc Returns permissions that a caller has on the specified + * Organization. The `resource` field should be the organization's resource + * name, e.g. "organizations/123". + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'organizations/my-organization', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.testIamPermissions(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.organizations.update - * @desc Updates an Organization resource identified by the specified resource - * name. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Output Only. The resource name of the organization. This is the - * // organization's relative path in the API. Its format is - * // "organizations/[organization_id]". For example, - * "organizations/1234". name: 'organizations/my-organization', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.organizations.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.organizations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output Only. The resource name of the organization. This is the organization's relative path in the API. Its format is "organizations/[organization_id]". For example, "organizations/1234". - * @param {().Organization} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.organizations.update + * @desc Updates an Organization resource identified by the specified + * resource name. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Output Only. The resource name of the organization. This is the + * // organization's relative path in the API. Its format is + * // "organizations/[organization_id]". For example, + * "organizations/1234". name: 'organizations/my-organization', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.organizations.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.organizations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output Only. The resource name of the organization. This is the organization's relative path in the API. Its format is "organizations/[organization_id]". For example, "organizations/1234". + * @param {().Organization} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudresourcemanager.projects.create - * @desc Creates a Project resource. Initially, the Project resource is owned - * by its creator exclusively. The creator can later grant permission to - * others to read or update the Project. Several APIs are activated - * automatically for the Project, including Google Cloud Storage. The parent - * is identified by a specified ResourceId, which must include both an ID and - * a type, such as project, folder, or organization. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.useLegacyStack A safety hatch to opt out of the new reliable project creation process. - * @param {().Project} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.projects.create + * @desc Creates a Project resource. Initially, the Project resource is + * owned by its creator exclusively. The creator can later grant permission + * to others to read or update the Project. Several APIs are activated + * automatically for the Project, including Google Cloud Storage. The parent + * is identified by a specified ResourceId, which must include both an ID + * and a type, such as project, folder, or organization. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.useLegacyStack A safety hatch to opt out of the new reliable project creation process. + * @param {().Project} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta1/projects').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.delete - * @desc Marks the Project identified by the specified `project_id` (for - * example, `my-project-123`) for deletion. This method will only affect the - * Project if it has a lifecycle state of ACTIVE. This method changes the - * Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion - * starts at an unspecified time, at which point the project is no longer - * accessible. Until the deletion completes, you can check the lifecycle - * state checked by retrieving the Project with GetProject, and the Project - * remains visible to ListProjects. However, you cannot update the project. - * After the deletion completes, the Project is not retrievable by the - * GetProject and ListProjects methods. The caller must have modify - * permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `foo-bar-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `foo-bar-123`). Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.delete + * @desc Marks the Project identified by the specified `project_id` (for + * example, `my-project-123`) for deletion. This method will only affect the + * Project if it has a lifecycle state of ACTIVE. This method changes the + * Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion + * starts at an unspecified time, at which point the project is no longer + * accessible. Until the deletion completes, you can check the lifecycle + * state checked by retrieving the Project with GetProject, and the Project + * remains visible to ListProjects. However, you cannot update the project. + * After the deletion completes, the Project is not retrievable by the + * GetProject and ListProjects methods. The caller must have modify + * permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `foo-bar-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `foo-bar-123`). Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.get - * @desc Retrieves the Project identified by the specified `project_id` (for - * example, `my-project-123`). The caller must have read permissions for this - * Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.projects.get + * @desc Retrieves the Project identified by the specified `project_id` (for + * example, `my-project-123`). The caller must have read permissions for + * this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.getAncestry - * @desc Gets a list of ancestors in the resource hierarchy for the Project - * identified by the specified `project_id` (for example, `my-project-123`). - * The caller must have read permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The Project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getAncestry(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getAncestry - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. - * @param {().GetAncestryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAncestry(params?: any, options?: MethodOptions): - AxiosPromise; - getAncestry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAncestry( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.projects.getAncestry + * @desc Gets a list of ancestors in the resource hierarchy for the Project + * identified by the specified `project_id` (for example, `my-project-123`). + * The caller must have read permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The Project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getAncestry(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getAncestry + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The Project ID (for example, `my-project-123`). Required. + * @param {().GetAncestryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAncestry(params?: any, options?: MethodOptions): + AxiosPromise; + getAncestry( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAncestry( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}:getAncestry') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}:getAncestry') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.getIamPolicy - * @desc Returns the IAM access control policy for the specified Project. - * Permission is denied if the policy or the resource does not exist. For - * additional information about resource structure and identification, see - * [Resource Names](/apis/design/resource_names). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.projects.getIamPolicy + * @desc Returns the IAM access control policy for the specified Project. + * Permission is denied if the policy or the resource does not exist. For + * additional information about resource structure and identification, see + * [Resource Names](/apis/design/resource_names). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.list - * @desc Lists Projects that are visible to the user and satisfy the specified - * filter. This method returns Projects in an unspecified order. This method - * is eventually consistent with project mutations; this means that a newly - * created project may not appear in the results or recent updates to an - * existing project may not be reflected in the results. To retrieve the - * latest state of a project, use the GetProjectmethod. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudResourceManager.projects.list(request, handlePage); - * } - * }; - * - * cloudResourceManager.projects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:how*|The project's name starts with "how".| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. If you specify a filter that has both `parent.type` and `parent.id`, then the `resourcemanager.projects.list` permission is checked on the parent. If the user has this permission, all projects under the parent will be returned after remaining filters have been applied. If the user lacks this permission, then all projects for which the user has the `resourcemanager.projects.get` permission will be returned after remaining filters have been applied. If no filter is specified, the call will return projects for which the user has `resourcemanager.projects.get` permissions. Optional. - * @param {integer=} params.pageSize The maximum number of Projects to return in the response. The server can return fewer Projects than requested. If unspecified, server picks an appropriate default. Optional. - * @param {string=} params.pageToken A pagination token returned from a previous call to ListProjects that indicates from where listing should continue. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.projects.list + * @desc Lists Projects that are visible to the user and satisfy the + * specified filter. This method returns Projects in an unspecified order. + * This method is eventually consistent with project mutations; this means + * that a newly created project may not appear in the results or recent + * updates to an existing project may not be reflected in the results. To + * retrieve the latest state of a project, use the GetProjectmethod. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var projectsPage = response['projects']; + * if (!projectsPage) { + * return; + * } + * for (var i = 0; i < projectsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudResourceManager.projects.list(request, handlePage); + * } + * }; + * + * cloudResourceManager.projects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: + `name` + `id` + labels.key where *key* is the name of a label Some examples of using labels as filters: |Filter|Description| |------|-----------| |name:how*|The project's name starts with "how".| |name:Howl|The project's name is `Howl` or `howl`.| |name:HOWL|Equivalent to above.| |NAME:howl|Equivalent to above.| |labels.color:*|The project has the label `color`.| |labels.color:red|The project's label `color` has the value `red`.| |labels.color:red labels.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. If you specify a filter that has both `parent.type` and `parent.id`, then the `resourcemanager.projects.list` permission is checked on the parent. If the user has this permission, all projects under the parent will be returned after remaining filters have been applied. If the user lacks this permission, then all projects for which the user has the `resourcemanager.projects.get` permission will be returned after remaining filters have been applied. If no filter is specified, the call will return projects for which the user has `resourcemanager.projects.get` permissions. Optional. + * @param {integer=} params.pageSize The maximum number of Projects to return in the response. The server can return fewer Projects than requested. If unspecified, server picks an appropriate default. Optional. + * @param {string=} params.pageToken A pagination token returned from a previous call to ListProjects that indicates from where listing should continue. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta1/projects').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.setIamPolicy - * @desc Sets the IAM access control policy for the specified Project. - * Overwrites any existing policy. The following constraints apply when using - * `setIamPolicy()`: + Project does not support `allUsers` and - * `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The - * owner role can be granted only to `user` and `serviceAccount`. + Service - * accounts can be made owners of a project directly without any restrictions. - * However, to be added as an owner, a user must be invited via Cloud Platform - * console and must accept the invitation. + A user cannot be granted the - * owner role using `setIamPolicy()`. The user must be granted the owner role - * using the Cloud Platform Console and must explicitly accept the invitation. - * + Invitations to grant the owner role cannot be sent using - * `setIamPolicy()`; they must be sent only using the Cloud Platform Console. - * + Membership changes that leave the project without any owners that have - * accepted the Terms of Service (ToS) will be rejected. + If the project is - * not part of an organization, there must be at least one owner who has - * accepted the Terms of Service (ToS) agreement in the policy. Calling - * `setIamPolicy()` to remove the last ToS-accepted owner from the policy will - * fail. This restriction also applies to legacy projects that no longer have - * owners who have accepted the ToS. Edits to IAM policies will be rejected - * until the lack of a ToS-accepting owner is rectified. + This method will - * replace the existing policy, and cannot be used to append additional IAM - * settings. Note: Removing service accounts from policies or changing their - * roles can render services completely inoperable. It is important to - * understand how the service account is being used before removing or - * updating its roles. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.projects.setIamPolicy + * @desc Sets the IAM access control policy for the specified Project. + * Overwrites any existing policy. The following constraints apply when + * using `setIamPolicy()`: + Project does not support `allUsers` and + * `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The + * owner role can be granted only to `user` and `serviceAccount`. + Service + * accounts can be made owners of a project directly without any + * restrictions. However, to be added as an owner, a user must be invited + * via Cloud Platform console and must accept the invitation. + A user + * cannot be granted the owner role using `setIamPolicy()`. The user must be + * granted the owner role using the Cloud Platform Console and must + * explicitly accept the invitation. + Invitations to grant the owner role + * cannot be sent using `setIamPolicy()`; they must be sent only using the + * Cloud Platform Console. + Membership changes that leave the project + * without any owners that have accepted the Terms of Service (ToS) will be + * rejected. + If the project is not part of an organization, there must be + * at least one owner who has accepted the Terms of Service (ToS) agreement + * in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted + * owner from the policy will fail. This restriction also applies to legacy + * projects that no longer have owners who have accepted the ToS. Edits to + * IAM policies will be rejected until the lack of a ToS-accepting owner is + * rectified. + This method will replace the existing policy, and cannot be + * used to append additional IAM settings. Note: Removing service accounts + * from policies or changing their roles can render services completely + * inoperable. It is important to understand how the service account is + * being used before removing or updating its roles. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.testIamPermissions - * @desc Returns permissions that a caller has on the specified Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.projects.testIamPermissions + * @desc Returns permissions that a caller has on the specified Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.projects.undelete - * @desc Restores the Project identified by the specified `project_id` (for - * example, `my-project-123`). You can only use this method for a Project that - * has a lifecycle state of DELETE_REQUESTED. After deletion starts, the - * Project cannot be restored. The caller must have modify permissions for - * this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID (for example, `foo-bar-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.undelete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The project ID (for example, `foo-bar-123`). Required. - * @param {().UndeleteProjectRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.projects.undelete + * @desc Restores the Project identified by the specified `project_id` (for + * example, `my-project-123`). You can only use this method for a Project + * that has a lifecycle state of DELETE_REQUESTED. After deletion starts, + * the Project cannot be restored. The caller must have modify permissions + * for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID (for example, `foo-bar-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.undelete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The project ID (for example, `foo-bar-123`). Required. + * @param {().UndeleteProjectRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.projects.update - * @desc Updates the attributes of the Project identified by the specified - * `project_id` (for example, `my-project-123`). The caller must have modify - * permissions for this Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Resource Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudresourcemanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID (for example, `my-project-123`). - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * cloudResourceManager.projects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudresourcemanager.projects.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The project ID (for example, `my-project-123`). Required. - * @param {().Project} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.projects.update + * @desc Updates the attributes of the Project identified by the specified + * `project_id` (for example, `my-project-123`). The caller must have + * modify permissions for this Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Resource Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudresourcemanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudResourceManager = google.cloudresourcemanager('v1beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID (for example, `my-project-123`). + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * cloudResourceManager.projects.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudresourcemanager.projects.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The project ID (for example, `my-project-123`). Required. + * @param {().Project} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudresourcemanager/v2.ts b/src/apis/cloudresourcemanager/v2.ts index 0c44ba132da..5dae8a1e2eb 100644 --- a/src/apis/cloudresourcemanager/v2.ts +++ b/src/apis/cloudresourcemanager/v2.ts @@ -27,1137 +27,1167 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Resource Manager API - * - * The Google Cloud Resource Manager API provides methods for creating, reading, - * and updating project metadata. - * - * @example - * const google = require('googleapis'); - * const cloudresourcemanager = google.cloudresourcemanager('v2'); - * - * @namespace cloudresourcemanager - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Cloudresourcemanager - */ -export class Cloudresourcemanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudresourcemanager_v2 { + /** + * Cloud Resource Manager API + * + * The Google Cloud Resource Manager API provides methods for creating, + * reading, and updating project metadata. + * + * @example + * const google = require('googleapis'); + * const cloudresourcemanager = google.cloudresourcemanager('v2'); + * + * @namespace cloudresourcemanager + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Cloudresourcemanager + */ + export class Cloudresourcemanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - folders: Resource$Folders; + folders: Resource$Folders; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.folders = new Resource$Folders(this); - } + this.folders = new Resource$Folders(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` . * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A Folder in an Organization's resource hierarchy, used to organize that - * Organization's resources. - */ -export interface Schema$Folder { - /** - * Output only. Timestamp when the Folder was created. Assigned by the server. - */ - createTime: string; - /** - * The folder’s display name. A folder’s display name must be unique amongst - * its siblings, e.g. no two folders with the same parent can share the same - * display name. The display name must start and end with a letter or digit, - * may contain letters, digits, spaces, hyphens and underscores and can be no - * longer than 30 characters. This is captured by the regular expression: - * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. - */ - displayName: string; - /** - * Output only. The lifecycle state of the folder. Updates to the - * lifecycle_state must be performed via DeleteFolder and UndeleteFolder. - */ - lifecycleState: string; - /** - * Output only. The resource name of the Folder. Its format is - * `folders/{folder_id}`, for example: "folders/1234". - */ - name: string; - /** - * The Folder’s parent's resource name. Updates to the folder's parent - * must be performed via MoveFolder. - */ - parent: string; -} -/** - * Metadata describing a long running folder operation - */ -export interface Schema$FolderOperation { - /** - * The resource name of the folder or organization we are either creating the - * folder under or moving the folder to. - */ - destinationParent: string; - /** - * The display name of the folder. - */ - displayName: string; - /** - * The type of this operation. - */ - operationType: string; - /** - * The resource name of the folder's parent. Only applicable when the - * operation_type is MOVE. - */ - sourceParent: string; -} -/** - * A classification of the Folder Operation error. - */ -export interface Schema$FolderOperationError { - /** - * The type of operation error experienced. - */ - errorMessageId: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The ListFolders response message. - */ -export interface Schema$ListFoldersResponse { /** - * A possibly paginated list of Folders that are direct descendants of the - * specified parent resource. + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. */ - folders: Schema$Folder[]; - /** - * A pagination token returned from a previous call to `ListFolders` that - * indicates from where listing should continue. This field is optional. - */ - nextPageToken: string; -} -/** - * The MoveFolder request message. - */ -export interface Schema$MoveFolderRequest { - /** - * The resource name of the Folder or Organization to reparent the folder - * under. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - */ - destinationParent: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * Specifies cloud audit logging configuration for this policy. + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. */ - auditConfigs: Schema$AuditConfig[]; + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. + * Associates `members` with a `role`. */ - bindings: Schema$Binding[]; + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * A Folder in an Organization's resource hierarchy, used to organize that + * Organization's resources. */ - etag: string; + export interface Schema$Folder { + /** + * Output only. Timestamp when the Folder was created. Assigned by the + * server. + */ + createTime: string; + /** + * The folder’s display name. A folder’s display name must be unique amongst + * its siblings, e.g. no two folders with the same parent can share the same + * display name. The display name must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * no longer than 30 characters. This is captured by the regular expression: + * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + */ + displayName: string; + /** + * Output only. The lifecycle state of the folder. Updates to the + * lifecycle_state must be performed via DeleteFolder and UndeleteFolder. + */ + lifecycleState: string; + /** + * Output only. The resource name of the Folder. Its format is + * `folders/{folder_id}`, for example: "folders/1234". + */ + name: string; + /** + * The Folder’s parent's resource name. Updates to the folder's + * parent must be performed via MoveFolder. + */ + parent: string; + } /** - * Deprecated. + * Metadata describing a long running folder operation */ - version: number; -} -/** - * A status object which is used as the `metadata` field for the Operation - * returned by CreateProject. It provides insight for when significant phases of - * Project creation have completed. - */ -export interface Schema$ProjectCreationStatus { + export interface Schema$FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent: string; + /** + * The display name of the folder. + */ + displayName: string; + /** + * The type of this operation. + */ + operationType: string; + /** + * The resource name of the folder's parent. Only applicable when the + * operation_type is MOVE. + */ + sourceParent: string; + } /** - * Creation time of the project creation workflow. + * A classification of the Folder Operation error. */ - createTime: string; + export interface Schema$FolderOperationError { + /** + * The type of operation error experienced. + */ + errorMessageId: string; + } /** - * True if the project can be retrieved using GetProject. No other operations - * on the project are guaranteed to work until the project creation is - * complete. + * Request message for `GetIamPolicy` method. */ - gettable: boolean; + export interface Schema$GetIamPolicyRequest {} /** - * True if the project creation process is complete. + * The ListFolders response message. */ - ready: boolean; -} -/** - * The request message for searching folders. - */ -export interface Schema$SearchFoldersRequest { - /** - * The maximum number of folders to return in the response. This field is - * optional. - */ - pageSize: number; + export interface Schema$ListFoldersResponse { + /** + * A possibly paginated list of Folders that are direct descendants of the + * specified parent resource. + */ + folders: Schema$Folder[]; + /** + * A pagination token returned from a previous call to `ListFolders` that + * indicates from where listing should continue. This field is optional. + */ + nextPageToken: string; + } /** - * A pagination token returned from a previous call to `SearchFolders` that - * indicates from where search should continue. This field is optional. + * The MoveFolder request message. */ - pageToken: string; + export interface Schema$MoveFolderRequest { + /** + * The resource name of the Folder or Organization to reparent the folder + * under. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + */ + destinationParent: string; + } /** - * Search criteria used to select the Folders to return. If no search criteria - * is specified then all accessible folders will be returned. Query - * expressions can be used to restrict results based upon displayName, - * lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. Some example - * queries are: |Query | Description| |----- | -----------| - * |displayName=Test* | Folders whose display name starts with - * "Test". |lifecycleState=ACTIVE | Folders whose lifecycleState is - * ACTIVE. |parent=folders/123 | Folders whose parent is - * "folders/123". |parent=folders/123 AND lifecycleState=ACTIVE | - * Active folders whose parent is "folders/123".| + * This resource represents a long-running operation that is the result of a + * network API call. */ - query: string; -} -/** - * The response message for searching folders. - */ -export interface Schema$SearchFoldersResponse { + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A possibly paginated folder search results. the specified parent resource. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). */ - folders: Schema$Folder[]; + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * A pagination token returned from a previous call to `SearchFolders` that - * indicates from where searching should continue. This field is optional. + * A status object which is used as the `metadata` field for the Operation + * returned by CreateProject. It provides insight for when significant phases + * of Project creation have completed. */ - nextPageToken: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + export interface Schema$ProjectCreationStatus { + /** + * Creation time of the project creation workflow. + */ + createTime: string; + /** + * True if the project can be retrieved using GetProject. No other + * operations on the project are guaranteed to work until the project + * creation is complete. + */ + gettable: boolean; + /** + * True if the project creation process is complete. + */ + ready: boolean; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. + * The request message for searching folders. */ - policy: Schema$Policy; + export interface Schema$SearchFoldersRequest { + /** + * The maximum number of folders to return in the response. This field is + * optional. + */ + pageSize: number; + /** + * A pagination token returned from a previous call to `SearchFolders` that + * indicates from where search should continue. This field is optional. + */ + pageToken: string; + /** + * Search criteria used to select the Folders to return. If no search + * criteria is specified then all accessible folders will be returned. Query + * expressions can be used to restrict results based upon displayName, + * lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. Some example + * queries are: |Query | Description| |----- | -----------| + * |displayName=Test* | Folders whose display name starts with + * "Test". |lifecycleState=ACTIVE | Folders whose lifecycleState + * is ACTIVE. |parent=folders/123 | Folders whose parent is + * "folders/123". |parent=folders/123 AND lifecycleState=ACTIVE | + * Active folders whose parent is "folders/123".| + */ + query: string; + } /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. + * The response message for searching folders. */ - updateMask: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$SearchFoldersResponse { + /** + * A possibly paginated folder search results. the specified parent + * resource. + */ + folders: Schema$Folder[]; + /** + * A pagination token returned from a previous call to `SearchFolders` that + * indicates from where searching should continue. This field is optional. + */ + nextPageToken: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Request message for `SetIamPolicy` method. */ - code: number; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - details: any[]; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Request message for `TestIamPermissions` method. */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * Response message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * The UndeleteFolder request message. */ - permissions: string[]; -} -/** - * The UndeleteFolder request message. - */ -export interface Schema$UndeleteFolderRequest {} + export interface Schema$UndeleteFolderRequest {} -export class Resource$Folders { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Folders { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudresourcemanager.folders.create - * @desc Creates a Folder in the resource hierarchy. Returns an Operation - * which can be used to track the progress of the folder creation workflow. - * Upon success the Operation.response field will be populated with the - * created Folder. In order to succeed, the addition of this new Folder must - * not violate the Folder naming, height or fanout constraints. + The - * Folder's display_name must be distinct from all other Folder's that share - * its parent. + The addition of the Folder must not cause the active Folder - * hierarchy to exceed a height of 4. Note, the full active + deleted Folder - * hierarchy is allowed to reach a height of 8; this provides additional - * headroom when moving folders that contain deleted folders. + The addition - * of the Folder must not cause the total number of Folders under its parent - * to exceed 100. If the operation fails due to a folder constraint - * violation, a PreconditionFailure explaining the violation will be returned. - * If the failure occurs synchronously then the PreconditionFailure will be - * returned via the Status.details field and if it occurs asynchronously then - * the PreconditionFailure will be returned via the the Operation.error field. - * The caller must have `resourcemanager.folders.create` permission on the - * identified parent. - * @alias cloudresourcemanager.folders.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.create + * @desc Creates a Folder in the resource hierarchy. Returns an Operation + * which can be used to track the progress of the folder creation workflow. + * Upon success the Operation.response field will be populated with the + * created Folder. In order to succeed, the addition of this new Folder + * must not violate the Folder naming, height or fanout constraints. + The + * Folder's display_name must be distinct from all other Folder's that share + * its parent. + The addition of the Folder must not cause the active Folder + * hierarchy to exceed a height of 4. Note, the full active + deleted Folder + * hierarchy is allowed to reach a height of 8; this provides additional + * headroom when moving folders that contain deleted folders. + The addition + * of the Folder must not cause the total number of Folders under its parent + * to exceed 100. If the operation fails due to a folder constraint + * violation, a PreconditionFailure explaining the violation will be + * returned. If the failure occurs synchronously then the + * PreconditionFailure will be returned via the Status.details field and if + * it occurs asynchronously then the PreconditionFailure will be returned + * via the the Operation.error field. The caller must have + * `resourcemanager.folders.create` permission on the identified parent. + * @alias cloudresourcemanager.folders.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/folders').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/folders').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.delete - * @desc Requests deletion of a Folder. The Folder is moved into the - * DELETE_REQUESTED state immediately, and is deleted approximately 30 days - * later. This method may only be called on an empty Folder in the ACTIVE - * state, where a Folder is empty if it doesn't contain any Folders or - * Projects in the ACTIVE state. The caller must have - * `resourcemanager.folders.delete` permission on the identified folder. - * @alias cloudresourcemanager.folders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.delete + * @desc Requests deletion of a Folder. The Folder is moved into the + * DELETE_REQUESTED state immediately, and is deleted approximately 30 days + * later. This method may only be called on an empty Folder in the ACTIVE + * state, where a Folder is empty if it doesn't contain any Folders or + * Projects in the ACTIVE state. The caller must have + * `resourcemanager.folders.delete` permission on the identified folder. + * @alias cloudresourcemanager.folders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.get - * @desc Retrieves a Folder identified by the supplied resource name. Valid - * Folder resource names have the format `folders/{folder_id}` (for example, - * `folders/1234`). The caller must have `resourcemanager.folders.get` - * permission on the identified folder. - * @alias cloudresourcemanager.folders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.get + * @desc Retrieves a Folder identified by the supplied resource name. Valid + * Folder resource names have the format `folders/{folder_id}` (for example, + * `folders/1234`). The caller must have `resourcemanager.folders.get` + * permission on the identified folder. + * @alias cloudresourcemanager.folders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.getIamPolicy - * @desc Gets the access control policy for a Folder. The returned policy may - * be empty if no such policy or resource exists. The `resource` field should - * be the Folder's resource name, e.g. "folders/1234". The caller must have - * `resourcemanager.folders.getIamPolicy` permission on the identified folder. - * @alias cloudresourcemanager.folders.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.getIamPolicy + * @desc Gets the access control policy for a Folder. The returned policy + * may be empty if no such policy or resource exists. The `resource` field + * should be the Folder's resource name, e.g. "folders/1234". The caller + * must have `resourcemanager.folders.getIamPolicy` permission on the + * identified folder. + * @alias cloudresourcemanager.folders.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.list - * @desc Lists the Folders that are direct descendants of supplied parent - * resource. List provides a strongly consistent view of the Folders - * underneath the specified parent resource. List returns Folders sorted based - * upon the (ascending) lexical ordering of their display_name. The caller - * must have `resourcemanager.folders.list` permission on the identified - * parent. - * @alias cloudresourcemanager.folders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of Folders to return in the response. This field is optional. - * @param {string=} params.pageToken A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from. This field is optional. - * @param {string=} params.parent The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`. - * @param {boolean=} params.showDeleted Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false. This field is optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.list + * @desc Lists the Folders that are direct descendants of supplied parent + * resource. List provides a strongly consistent view of the Folders + * underneath the specified parent resource. List returns Folders sorted + * based upon the (ascending) lexical ordering of their display_name. The + * caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * @alias cloudresourcemanager.folders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of Folders to return in the response. This field is optional. + * @param {string=} params.pageToken A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from. This field is optional. + * @param {string=} params.parent The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`. + * @param {boolean=} params.showDeleted Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false. This field is optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/folders').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/folders').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.move - * @desc Moves a Folder under a new resource parent. Returns an Operation - * which can be used to track the progress of the folder move workflow. Upon - * success the Operation.response field will be populated with the moved - * Folder. Upon failure, a FolderOperationError categorizing the failure cause - * will be returned - if the failure occurs synchronously then the - * FolderOperationError will be returned via the Status.details field and if - * it occurs asynchronously then the FolderOperation will be returned via the - * the Operation.error field. In addition, the Operation.metadata field will - * be populated with a FolderOperation message as an aid to stateless clients. - * Folder moves will be rejected if they violate either the naming, height or - * fanout constraints described in the CreateFolder documentation. The caller - * must have `resourcemanager.folders.move` permission on the folder's current - * and proposed new parent. - * @alias cloudresourcemanager.folders.move - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to move. Must be of the form folders/{folder_id} - * @param {().MoveFolderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - move(params?: any, options?: MethodOptions): AxiosPromise; - move( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - move( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.move + * @desc Moves a Folder under a new resource parent. Returns an Operation + * which can be used to track the progress of the folder move workflow. Upon + * success the Operation.response field will be populated with the moved + * Folder. Upon failure, a FolderOperationError categorizing the failure + * cause will be returned - if the failure occurs synchronously then the + * FolderOperationError will be returned via the Status.details field and if + * it occurs asynchronously then the FolderOperation will be returned via + * the the Operation.error field. In addition, the Operation.metadata field + * will be populated with a FolderOperation message as an aid to stateless + * clients. Folder moves will be rejected if they violate either the naming, + * height or fanout constraints described in the CreateFolder documentation. + * The caller must have `resourcemanager.folders.move` permission on the + * folder's current and proposed new parent. + * @alias cloudresourcemanager.folders.move + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to move. Must be of the form folders/{folder_id} + * @param {().MoveFolderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + move(params?: any, options?: MethodOptions): AxiosPromise; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}:move').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}:move').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.patch - * @desc Updates a Folder, changing its display_name. Changes to the folder - * display_name will be rejected if they violate either the display_name - * formatting rules or naming constraints described in the CreateFolder - * documentation. The Folder's display name must start and end with a letter - * or digit, may contain letters, digits, spaces, hyphens and underscores and - * can be no longer than 30 characters. This is captured by the regular - * expression: [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. The caller - * must have `resourcemanager.folders.update` permission on the identified - * folder. If the update fails due to the unique name constraint then a - * PreconditionFailure explaining this violation will be returned in the - * Status.details field. - * @alias cloudresourcemanager.folders.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". - * @param {string=} params.updateMask Fields to be updated. Only the `display_name` can be updated. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.patch + * @desc Updates a Folder, changing its display_name. Changes to the folder + * display_name will be rejected if they violate either the display_name + * formatting rules or naming constraints described in the CreateFolder + * documentation. The Folder's display name must start and end with a + * letter or digit, may contain letters, digits, spaces, hyphens and + * underscores and can be no longer than 30 characters. This is captured by + * the regular expression: [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. If the update fails due to the unique name constraint + * then a PreconditionFailure explaining this violation will be returned in + * the Status.details field. + * @alias cloudresourcemanager.folders.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". + * @param {string=} params.updateMask Fields to be updated. Only the `display_name` can be updated. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.search - * @desc Search for folders that match specific filter criteria. Search - * provides an eventually consistent view of the folders a user has access to - * which meet the specified filter criteria. This will only return folders on - * which the caller has the permission `resourcemanager.folders.get`. - * @alias cloudresourcemanager.folders.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchFoldersRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/folders:search').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.search + * @desc Search for folders that match specific filter criteria. Search + * provides an eventually consistent view of the folders a user has access + * to which meet the specified filter criteria. This will only return + * folders on which the caller has the permission + * `resourcemanager.folders.get`. + * @alias cloudresourcemanager.folders.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchFoldersRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/folders:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.setIamPolicy - * @desc Sets the access control policy on a Folder, replacing any existing - * policy. The `resource` field should be the Folder's resource name, e.g. - * "folders/1234". The caller must have `resourcemanager.folders.setIamPolicy` - * permission on the identified folder. - * @alias cloudresourcemanager.folders.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.setIamPolicy + * @desc Sets the access control policy on a Folder, replacing any existing + * policy. The `resource` field should be the Folder's resource name, e.g. + * "folders/1234". The caller must have + * `resourcemanager.folders.setIamPolicy` permission on the identified + * folder. + * @alias cloudresourcemanager.folders.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.testIamPermissions - * @desc Returns permissions that a caller has on the specified Folder. The - * `resource` field should be the Folder's resource name, e.g. "folders/1234". - * There are no permissions required for making this API call. - * @alias cloudresourcemanager.folders.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.testIamPermissions + * @desc Returns permissions that a caller has on the specified Folder. The + * `resource` field should be the Folder's resource name, e.g. + * "folders/1234". There are no permissions required for making this API + * call. + * @alias cloudresourcemanager.folders.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.undelete - * @desc Cancels the deletion request for a Folder. This method may only be - * called on a Folder in the DELETE_REQUESTED state. In order to succeed, the - * Folder's parent must be in the ACTIVE state. In addition, reintroducing the - * folder into the tree must not violate folder naming, height and fanout - * constraints described in the CreateFolder documentation. The caller must - * have `resourcemanager.folders.undelete` permission on the identified - * folder. - * @alias cloudresourcemanager.folders.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. - * @param {().UndeleteFolderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.undelete + * @desc Cancels the deletion request for a Folder. This method may only be + * called on a Folder in the DELETE_REQUESTED state. In order to succeed, + * the Folder's parent must be in the ACTIVE state. In addition, + * reintroducing the folder into the tree must not violate folder naming, + * height and fanout constraints described in the CreateFolder + * documentation. The caller must have `resourcemanager.folders.undelete` + * permission on the identified folder. + * @alias cloudresourcemanager.folders.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. + * @param {().UndeleteFolderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudresourcemanager/v2beta1.ts b/src/apis/cloudresourcemanager/v2beta1.ts index 6e0a6819b82..b704601244d 100644 --- a/src/apis/cloudresourcemanager/v2beta1.ts +++ b/src/apis/cloudresourcemanager/v2beta1.ts @@ -27,1140 +27,1169 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Resource Manager API - * - * The Google Cloud Resource Manager API provides methods for creating, reading, - * and updating project metadata. - * - * @example - * const google = require('googleapis'); - * const cloudresourcemanager = google.cloudresourcemanager('v2beta1'); - * - * @namespace cloudresourcemanager - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Cloudresourcemanager - */ -export class Cloudresourcemanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudresourcemanager_v2beta1 { + /** + * Cloud Resource Manager API + * + * The Google Cloud Resource Manager API provides methods for creating, + * reading, and updating project metadata. + * + * @example + * const google = require('googleapis'); + * const cloudresourcemanager = google.cloudresourcemanager('v2beta1'); + * + * @namespace cloudresourcemanager + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Cloudresourcemanager + */ + export class Cloudresourcemanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - folders: Resource$Folders; + folders: Resource$Folders; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.folders = new Resource$Folders(this); - } + this.folders = new Resource$Folders(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` . * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A Folder in an Organization's resource hierarchy, used to organize that - * Organization's resources. - */ -export interface Schema$Folder { - /** - * Output only. Timestamp when the Folder was created. Assigned by the server. - */ - createTime: string; - /** - * The folder’s display name. A folder’s display name must be unique amongst - * its siblings, e.g. no two folders with the same parent can share the same - * display name. The display name must start and end with a letter or digit, - * may contain letters, digits, spaces, hyphens and underscores and can be no - * longer than 30 characters. This is captured by the regular expression: - * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. - */ - displayName: string; - /** - * Output only. The lifecycle state of the folder. Updates to the - * lifecycle_state must be performed via DeleteFolder and UndeleteFolder. - */ - lifecycleState: string; - /** - * Output only. The resource name of the Folder. Its format is - * `folders/{folder_id}`, for example: "folders/1234". - */ - name: string; - /** - * The Folder’s parent's resource name. Updates to the folder's parent - * must be performed via MoveFolder. - */ - parent: string; -} -/** - * Metadata describing a long running folder operation - */ -export interface Schema$FolderOperation { - /** - * The resource name of the folder or organization we are either creating the - * folder under or moving the folder to. - */ - destinationParent: string; - /** - * The display name of the folder. - */ - displayName: string; - /** - * The type of this operation. - */ - operationType: string; - /** - * The resource name of the folder's parent. Only applicable when the - * operation_type is MOVE. - */ - sourceParent: string; -} -/** - * A classification of the Folder Operation error. - */ -export interface Schema$FolderOperationError { - /** - * The type of operation error experienced. - */ - errorMessageId: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The ListFolders response message. - */ -export interface Schema$ListFoldersResponse { /** - * A possibly paginated list of Folders that are direct descendants of the - * specified parent resource. + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. */ - folders: Schema$Folder[]; - /** - * A pagination token returned from a previous call to `ListFolders` that - * indicates from where listing should continue. This field is optional. - */ - nextPageToken: string; -} -/** - * The MoveFolder request message. - */ -export interface Schema$MoveFolderRequest { - /** - * The resource name of the Folder or Organization to reparent the folder - * under. Must be of the form `folders/{folder_id}` or - * `organizations/{org_id}`. - */ - destinationParent: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * Specifies cloud audit logging configuration for this policy. + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. */ - auditConfigs: Schema$AuditConfig[]; + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. + * Associates `members` with a `role`. */ - bindings: Schema$Binding[]; + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * A Folder in an Organization's resource hierarchy, used to organize that + * Organization's resources. */ - etag: string; + export interface Schema$Folder { + /** + * Output only. Timestamp when the Folder was created. Assigned by the + * server. + */ + createTime: string; + /** + * The folder’s display name. A folder’s display name must be unique amongst + * its siblings, e.g. no two folders with the same parent can share the same + * display name. The display name must start and end with a letter or digit, + * may contain letters, digits, spaces, hyphens and underscores and can be + * no longer than 30 characters. This is captured by the regular expression: + * [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + */ + displayName: string; + /** + * Output only. The lifecycle state of the folder. Updates to the + * lifecycle_state must be performed via DeleteFolder and UndeleteFolder. + */ + lifecycleState: string; + /** + * Output only. The resource name of the Folder. Its format is + * `folders/{folder_id}`, for example: "folders/1234". + */ + name: string; + /** + * The Folder’s parent's resource name. Updates to the folder's + * parent must be performed via MoveFolder. + */ + parent: string; + } /** - * Deprecated. + * Metadata describing a long running folder operation */ - version: number; -} -/** - * A status object which is used as the `metadata` field for the Operation - * returned by CreateProject. It provides insight for when significant phases of - * Project creation have completed. - */ -export interface Schema$ProjectCreationStatus { + export interface Schema$FolderOperation { + /** + * The resource name of the folder or organization we are either creating + * the folder under or moving the folder to. + */ + destinationParent: string; + /** + * The display name of the folder. + */ + displayName: string; + /** + * The type of this operation. + */ + operationType: string; + /** + * The resource name of the folder's parent. Only applicable when the + * operation_type is MOVE. + */ + sourceParent: string; + } /** - * Creation time of the project creation workflow. + * A classification of the Folder Operation error. */ - createTime: string; + export interface Schema$FolderOperationError { + /** + * The type of operation error experienced. + */ + errorMessageId: string; + } /** - * True if the project can be retrieved using GetProject. No other operations - * on the project are guaranteed to work until the project creation is - * complete. + * Request message for `GetIamPolicy` method. */ - gettable: boolean; + export interface Schema$GetIamPolicyRequest {} /** - * True if the project creation process is complete. + * The ListFolders response message. */ - ready: boolean; -} -/** - * The request message for searching folders. - */ -export interface Schema$SearchFoldersRequest { - /** - * The maximum number of folders to return in the response. This field is - * optional. - */ - pageSize: number; + export interface Schema$ListFoldersResponse { + /** + * A possibly paginated list of Folders that are direct descendants of the + * specified parent resource. + */ + folders: Schema$Folder[]; + /** + * A pagination token returned from a previous call to `ListFolders` that + * indicates from where listing should continue. This field is optional. + */ + nextPageToken: string; + } /** - * A pagination token returned from a previous call to `SearchFolders` that - * indicates from where search should continue. This field is optional. + * The MoveFolder request message. */ - pageToken: string; + export interface Schema$MoveFolderRequest { + /** + * The resource name of the Folder or Organization to reparent the folder + * under. Must be of the form `folders/{folder_id}` or + * `organizations/{org_id}`. + */ + destinationParent: string; + } /** - * Search criteria used to select the Folders to return. If no search criteria - * is specified then all accessible folders will be returned. Query - * expressions can be used to restrict results based upon displayName, - * lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` - * can be used along with the suffix wildcard symbol `*`. Some example - * queries are: |Query | Description| |----- | -----------| - * |displayName=Test*|Folders whose display name starts with - * "Test".| |lifecycleState=ACTIVE|Folders whose lifecycleState is - * ACTIVE.| |parent=folders/123|Folders whose parent is - * "folders/123".| |parent=folders/123 AND - * lifecycleState=ACTIVE|Active folders whose parent is - * "folders/123".| + * This resource represents a long-running operation that is the result of a + * network API call. */ - query: string; -} -/** - * The response message for searching folders. - */ -export interface Schema$SearchFoldersResponse { + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A possibly paginated folder search results. the specified parent resource. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). */ - folders: Schema$Folder[]; + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * A pagination token returned from a previous call to `SearchFolders` that - * indicates from where searching should continue. This field is optional. + * A status object which is used as the `metadata` field for the Operation + * returned by CreateProject. It provides insight for when significant phases + * of Project creation have completed. */ - nextPageToken: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + export interface Schema$ProjectCreationStatus { + /** + * Creation time of the project creation workflow. + */ + createTime: string; + /** + * True if the project can be retrieved using GetProject. No other + * operations on the project are guaranteed to work until the project + * creation is complete. + */ + gettable: boolean; + /** + * True if the project creation process is complete. + */ + ready: boolean; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. + * The request message for searching folders. */ - policy: Schema$Policy; + export interface Schema$SearchFoldersRequest { + /** + * The maximum number of folders to return in the response. This field is + * optional. + */ + pageSize: number; + /** + * A pagination token returned from a previous call to `SearchFolders` that + * indicates from where search should continue. This field is optional. + */ + pageToken: string; + /** + * Search criteria used to select the Folders to return. If no search + * criteria is specified then all accessible folders will be returned. Query + * expressions can be used to restrict results based upon displayName, + * lifecycleState and parent, where the operators `=`, `NOT`, `AND` and `OR` + * can be used along with the suffix wildcard symbol `*`. Some example + * queries are: |Query | Description| |----- | -----------| + * |displayName=Test*|Folders whose display name starts with + * "Test".| |lifecycleState=ACTIVE|Folders whose lifecycleState is + * ACTIVE.| |parent=folders/123|Folders whose parent is + * "folders/123".| |parent=folders/123 AND + * lifecycleState=ACTIVE|Active folders whose parent is + * "folders/123".| + */ + query: string; + } /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. + * The response message for searching folders. */ - updateMask: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$SearchFoldersResponse { + /** + * A possibly paginated folder search results. the specified parent + * resource. + */ + folders: Schema$Folder[]; + /** + * A pagination token returned from a previous call to `SearchFolders` that + * indicates from where searching should continue. This field is optional. + */ + nextPageToken: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Request message for `SetIamPolicy` method. */ - code: number; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - details: any[]; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Request message for `TestIamPermissions` method. */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * Response message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * The UndeleteFolder request message. */ - permissions: string[]; -} -/** - * The UndeleteFolder request message. - */ -export interface Schema$UndeleteFolderRequest {} + export interface Schema$UndeleteFolderRequest {} -export class Resource$Folders { - root: Cloudresourcemanager; - constructor(root: Cloudresourcemanager) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Folders { + root: Cloudresourcemanager; + constructor(root: Cloudresourcemanager) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudresourcemanager.folders.create - * @desc Creates a Folder in the resource hierarchy. Returns an Operation - * which can be used to track the progress of the folder creation workflow. - * Upon success the Operation.response field will be populated with the - * created Folder. In order to succeed, the addition of this new Folder must - * not violate the Folder naming, height or fanout constraints. + The - * Folder's display_name must be distinct from all other Folder's that share - * its parent. + The addition of the Folder must not cause the active Folder - * hierarchy to exceed a height of 4. Note, the full active + deleted Folder - * hierarchy is allowed to reach a height of 8; this provides additional - * headroom when moving folders that contain deleted folders. + The addition - * of the Folder must not cause the total number of Folders under its parent - * to exceed 100. If the operation fails due to a folder constraint - * violation, a PreconditionFailure explaining the violation will be returned. - * If the failure occurs synchronously then the PreconditionFailure will be - * returned via the Status.details field and if it occurs asynchronously then - * the PreconditionFailure will be returned via the the Operation.error field. - * The caller must have `resourcemanager.folders.create` permission on the - * identified parent. - * @alias cloudresourcemanager.folders.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.create + * @desc Creates a Folder in the resource hierarchy. Returns an Operation + * which can be used to track the progress of the folder creation workflow. + * Upon success the Operation.response field will be populated with the + * created Folder. In order to succeed, the addition of this new Folder + * must not violate the Folder naming, height or fanout constraints. + The + * Folder's display_name must be distinct from all other Folder's that share + * its parent. + The addition of the Folder must not cause the active Folder + * hierarchy to exceed a height of 4. Note, the full active + deleted Folder + * hierarchy is allowed to reach a height of 8; this provides additional + * headroom when moving folders that contain deleted folders. + The addition + * of the Folder must not cause the total number of Folders under its parent + * to exceed 100. If the operation fails due to a folder constraint + * violation, a PreconditionFailure explaining the violation will be + * returned. If the failure occurs synchronously then the + * PreconditionFailure will be returned via the Status.details field and if + * it occurs asynchronously then the PreconditionFailure will be returned + * via the the Operation.error field. The caller must have + * `resourcemanager.folders.create` permission on the identified parent. + * @alias cloudresourcemanager.folders.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The resource name of the new Folder's parent. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/folders').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/folders').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.delete - * @desc Requests deletion of a Folder. The Folder is moved into the - * DELETE_REQUESTED state immediately, and is deleted approximately 30 days - * later. This method may only be called on an empty Folder in the ACTIVE - * state, where a Folder is empty if it doesn't contain any Folders or - * Projects in the ACTIVE state. The caller must have - * `resourcemanager.folders.delete` permission on the identified folder. - * @alias cloudresourcemanager.folders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.delete + * @desc Requests deletion of a Folder. The Folder is moved into the + * DELETE_REQUESTED state immediately, and is deleted approximately 30 days + * later. This method may only be called on an empty Folder in the ACTIVE + * state, where a Folder is empty if it doesn't contain any Folders or + * Projects in the ACTIVE state. The caller must have + * `resourcemanager.folders.delete` permission on the identified folder. + * @alias cloudresourcemanager.folders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name the resource name of the Folder to be deleted. Must be of the form `folders/{folder_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.get - * @desc Retrieves a Folder identified by the supplied resource name. Valid - * Folder resource names have the format `folders/{folder_id}` (for example, - * `folders/1234`). The caller must have `resourcemanager.folders.get` - * permission on the identified folder. - * @alias cloudresourcemanager.folders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudresourcemanager.folders.get + * @desc Retrieves a Folder identified by the supplied resource name. Valid + * Folder resource names have the format `folders/{folder_id}` (for example, + * `folders/1234`). The caller must have `resourcemanager.folders.get` + * permission on the identified folder. + * @alias cloudresourcemanager.folders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to retrieve. Must be of the form `folders/{folder_id}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.getIamPolicy - * @desc Gets the access control policy for a Folder. The returned policy may - * be empty if no such policy or resource exists. The `resource` field should - * be the Folder's resource name, e.g. "folders/1234". The caller must have - * `resourcemanager.folders.getIamPolicy` permission on the identified folder. - * @alias cloudresourcemanager.folders.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.getIamPolicy + * @desc Gets the access control policy for a Folder. The returned policy + * may be empty if no such policy or resource exists. The `resource` field + * should be the Folder's resource name, e.g. "folders/1234". The caller + * must have `resourcemanager.folders.getIamPolicy` permission on the + * identified folder. + * @alias cloudresourcemanager.folders.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.list - * @desc Lists the Folders that are direct descendants of supplied parent - * resource. List provides a strongly consistent view of the Folders - * underneath the specified parent resource. List returns Folders sorted based - * upon the (ascending) lexical ordering of their display_name. The caller - * must have `resourcemanager.folders.list` permission on the identified - * parent. - * @alias cloudresourcemanager.folders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of Folders to return in the response. This field is optional. - * @param {string=} params.pageToken A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from. This field is optional. - * @param {string=} params.parent The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`. - * @param {boolean=} params.showDeleted Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false. This field is optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.list + * @desc Lists the Folders that are direct descendants of supplied parent + * resource. List provides a strongly consistent view of the Folders + * underneath the specified parent resource. List returns Folders sorted + * based upon the (ascending) lexical ordering of their display_name. The + * caller must have `resourcemanager.folders.list` permission on the + * identified parent. + * @alias cloudresourcemanager.folders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of Folders to return in the response. This field is optional. + * @param {string=} params.pageToken A pagination token returned from a previous call to `ListFolders` that indicates where this listing should continue from. This field is optional. + * @param {string=} params.parent The resource name of the Organization or Folder whose Folders are being listed. Must be of the form `folders/{folder_id}` or `organizations/{org_id}`. Access to this method is controlled by checking the `resourcemanager.folders.list` permission on the `parent`. + * @param {boolean=} params.showDeleted Controls whether Folders in the DELETE_REQUESTED state should be returned. Defaults to false. This field is optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/folders').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/folders').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.move - * @desc Moves a Folder under a new resource parent. Returns an Operation - * which can be used to track the progress of the folder move workflow. Upon - * success the Operation.response field will be populated with the moved - * Folder. Upon failure, a FolderOperationError categorizing the failure cause - * will be returned - if the failure occurs synchronously then the - * FolderOperationError will be returned via the Status.details field and if - * it occurs asynchronously then the FolderOperation will be returned via the - * the Operation.error field. In addition, the Operation.metadata field will - * be populated with a FolderOperation message as an aid to stateless clients. - * Folder moves will be rejected if they violate either the naming, height or - * fanout constraints described in the CreateFolder documentation. The caller - * must have `resourcemanager.folders.move` permission on the folder's current - * and proposed new parent. - * @alias cloudresourcemanager.folders.move - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to move. Must be of the form folders/{folder_id} - * @param {().MoveFolderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - move(params?: any, options?: MethodOptions): AxiosPromise; - move( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - move( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.move + * @desc Moves a Folder under a new resource parent. Returns an Operation + * which can be used to track the progress of the folder move workflow. Upon + * success the Operation.response field will be populated with the moved + * Folder. Upon failure, a FolderOperationError categorizing the failure + * cause will be returned - if the failure occurs synchronously then the + * FolderOperationError will be returned via the Status.details field and if + * it occurs asynchronously then the FolderOperation will be returned via + * the the Operation.error field. In addition, the Operation.metadata field + * will be populated with a FolderOperation message as an aid to stateless + * clients. Folder moves will be rejected if they violate either the naming, + * height or fanout constraints described in the CreateFolder documentation. + * The caller must have `resourcemanager.folders.move` permission on the + * folder's current and proposed new parent. + * @alias cloudresourcemanager.folders.move + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to move. Must be of the form folders/{folder_id} + * @param {().MoveFolderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + move(params?: any, options?: MethodOptions): AxiosPromise; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + move( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}:move') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}:move') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.patch - * @desc Updates a Folder, changing its display_name. Changes to the folder - * display_name will be rejected if they violate either the display_name - * formatting rules or naming constraints described in the CreateFolder - * documentation. The Folder's display name must start and end with a letter - * or digit, may contain letters, digits, spaces, hyphens and underscores and - * can be no longer than 30 characters. This is captured by the regular - * expression: [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. The caller - * must have `resourcemanager.folders.update` permission on the identified - * folder. If the update fails due to the unique name constraint then a - * PreconditionFailure explaining this violation will be returned in the - * Status.details field. - * @alias cloudresourcemanager.folders.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". - * @param {string=} params.updateMask Fields to be updated. Only the `display_name` can be updated. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudresourcemanager.folders.patch + * @desc Updates a Folder, changing its display_name. Changes to the folder + * display_name will be rejected if they violate either the display_name + * formatting rules or naming constraints described in the CreateFolder + * documentation. The Folder's display name must start and end with a + * letter or digit, may contain letters, digits, spaces, hyphens and + * underscores and can be no longer than 30 characters. This is captured by + * the regular expression: [\p{L}\p{N}]({\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?. + * The caller must have `resourcemanager.folders.update` permission on the + * identified folder. If the update fails due to the unique name constraint + * then a PreconditionFailure explaining this violation will be returned in + * the Status.details field. + * @alias cloudresourcemanager.folders.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The resource name of the Folder. Its format is `folders/{folder_id}`, for example: "folders/1234". + * @param {string=} params.updateMask Fields to be updated. Only the `display_name` can be updated. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudresourcemanager.folders.search - * @desc Search for folders that match specific filter criteria. Search - * provides an eventually consistent view of the folders a user has access to - * which meet the specified filter criteria. This will only return folders on - * which the caller has the permission `resourcemanager.folders.get`. - * @alias cloudresourcemanager.folders.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchFoldersRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/folders:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.search + * @desc Search for folders that match specific filter criteria. Search + * provides an eventually consistent view of the folders a user has access + * to which meet the specified filter criteria. This will only return + * folders on which the caller has the permission + * `resourcemanager.folders.get`. + * @alias cloudresourcemanager.folders.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchFoldersRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/folders:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.setIamPolicy - * @desc Sets the access control policy on a Folder, replacing any existing - * policy. The `resource` field should be the Folder's resource name, e.g. - * "folders/1234". The caller must have `resourcemanager.folders.setIamPolicy` - * permission on the identified folder. - * @alias cloudresourcemanager.folders.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.setIamPolicy + * @desc Sets the access control policy on a Folder, replacing any existing + * policy. The `resource` field should be the Folder's resource name, e.g. + * "folders/1234". The caller must have + * `resourcemanager.folders.setIamPolicy` permission on the identified + * folder. + * @alias cloudresourcemanager.folders.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.testIamPermissions - * @desc Returns permissions that a caller has on the specified Folder. The - * `resource` field should be the Folder's resource name, e.g. "folders/1234". - * There are no permissions required for making this API call. - * @alias cloudresourcemanager.folders.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.testIamPermissions + * @desc Returns permissions that a caller has on the specified Folder. The + * `resource` field should be the Folder's resource name, e.g. + * "folders/1234". There are no permissions required for making this API + * call. + * @alias cloudresourcemanager.folders.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudresourcemanager.folders.undelete - * @desc Cancels the deletion request for a Folder. This method may only be - * called on a Folder in the DELETE_REQUESTED state. In order to succeed, the - * Folder's parent must be in the ACTIVE state. In addition, reintroducing the - * folder into the tree must not violate folder naming, height and fanout - * constraints described in the CreateFolder documentation. The caller must - * have `resourcemanager.folders.undelete` permission on the identified - * folder. - * @alias cloudresourcemanager.folders.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. - * @param {().UndeleteFolderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudresourcemanager.folders.undelete + * @desc Cancels the deletion request for a Folder. This method may only be + * called on a Folder in the DELETE_REQUESTED state. In order to succeed, + * the Folder's parent must be in the ACTIVE state. In addition, + * reintroducing the folder into the tree must not violate folder naming, + * height and fanout constraints described in the CreateFolder + * documentation. The caller must have `resourcemanager.folders.undelete` + * permission on the identified folder. + * @alias cloudresourcemanager.folders.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the Folder to undelete. Must be of the form `folders/{folder_id}`. + * @param {().UndeleteFolderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://cloudresourcemanager.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudshell/v1.ts b/src/apis/cloudshell/v1.ts index bbc2254437e..67af04028d0 100644 --- a/src/apis/cloudshell/v1.ts +++ b/src/apis/cloudshell/v1.ts @@ -27,493 +27,503 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Shell API - * - * Allows users to start, configure, and connect to interactive shell sessions - * running in the cloud. - * - * @example - * const google = require('googleapis'); - * const cloudshell = google.cloudshell('v1'); - * - * @namespace cloudshell - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudshell - */ -export class Cloudshell { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudshell_v1 { + /** + * Cloud Shell API + * + * Allows users to start, configure, and connect to interactive shell sessions + * running in the cloud. + * + * @example + * const google = require('googleapis'); + * const cloudshell = google.cloudshell('v1'); + * + * @namespace cloudshell + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudshell + */ + export class Cloudshell { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; + operations: Resource$Operations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - } + this.operations = new Resource$Operations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A Cloud Shell environment, which is defined as the combination of a Docker - * image specifying what is installed on the environment and a home directory - * containing the user's data that will remain across sessions. Each user - * has a single environment with the ID "default". - */ -export interface Schema$Environment { - /** - * Required. Full path to the Docker image used to run this environment, e.g. - * "gcr.io/dev-con/cloud-devshell:latest". - */ - dockerImage: string; - /** - * Output only. The environment's identifier, which is always - * "default". - */ - id: string; - /** - * Output only. Full name of this resource, in the format - * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the - * email address of the user to whom this environment belongs, and - * `{environment_id}` is the identifier of this environment. For example, - * `users/someone@example.com/environments/default`. - */ - name: string; /** - * Output only. Public keys associated with the environment. Clients can - * connect to this environment via SSH only if they possess a private key - * corresponding to at least one of these public keys. Keys can be added to or - * removed from the environment using the CreatePublicKey and DeletePublicKey - * methods. + * The request message for Operations.CancelOperation. */ - publicKeys: Schema$PublicKey[]; + export interface Schema$CancelOperationRequest {} /** - * Output only. Host to which clients can connect to initiate SSH sessions - * with the environment. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - sshHost: string; + export interface Schema$Empty {} /** - * Output only. Port to which clients can connect to initiate SSH sessions - * with the environment. + * A Cloud Shell environment, which is defined as the combination of a Docker + * image specifying what is installed on the environment and a home directory + * containing the user's data that will remain across sessions. Each user + * has a single environment with the ID "default". */ - sshPort: number; - /** - * Output only. Username that clients should use when initiating SSH sessions - * with the environment. - */ - sshUsername: string; - /** - * Output only. Current execution state of this environment. - */ - state: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A public SSH key, corresponding to a private SSH key held by the client. - */ -export interface Schema$PublicKey { - /** - * Required. Format of this key's content. - */ - format: string; - /** - * Required. Content of this key. - */ - key: string; + export interface Schema$Environment { + /** + * Required. Full path to the Docker image used to run this environment, + * e.g. "gcr.io/dev-con/cloud-devshell:latest". + */ + dockerImage: string; + /** + * Output only. The environment's identifier, which is always + * "default". + */ + id: string; + /** + * Output only. Full name of this resource, in the format + * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is + * the email address of the user to whom this environment belongs, and + * `{environment_id}` is the identifier of this environment. For example, + * `users/someone@example.com/environments/default`. + */ + name: string; + /** + * Output only. Public keys associated with the environment. Clients can + * connect to this environment via SSH only if they possess a private key + * corresponding to at least one of these public keys. Keys can be added to + * or removed from the environment using the CreatePublicKey and + * DeletePublicKey methods. + */ + publicKeys: Schema$PublicKey[]; + /** + * Output only. Host to which clients can connect to initiate SSH sessions + * with the environment. + */ + sshHost: string; + /** + * Output only. Port to which clients can connect to initiate SSH sessions + * with the environment. + */ + sshPort: number; + /** + * Output only. Username that clients should use when initiating SSH + * sessions with the environment. + */ + sshUsername: string; + /** + * Output only. Current execution state of this environment. + */ + state: string; + } /** - * Output only. Full name of this resource, in the format - * `users/{owner_email}/environments/{environment_id}/publicKeys/{key_id}`. - * `{owner_email}` is the email address of the user to whom the key belongs. - * `{environment_id}` is the identifier of the environment to which the key - * grants access. `{key_id}` is the unique identifier of the key. For example, - * `users/someone@example.com/environments/default/publicKeys/myKey`. + * The response message for Operations.ListOperations. */ - name: string; -} -/** - * Message included in the metadata field of operations returned from - * StartEnvironment. - */ -export interface Schema$StartEnvironmentMetadata { + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Current state of the environment being started. + * This resource represents a long-running operation that is the result of a + * network API call. */ - state: string; -} -/** - * Message included in the response field of operations returned from - * StartEnvironment once the operation is complete. - */ -export interface Schema$StartEnvironmentResponse { + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Environment that was started. + * A public SSH key, corresponding to a private SSH key held by the client. */ - environment: Schema$Environment; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$PublicKey { + /** + * Required. Format of this key's content. + */ + format: string; + /** + * Required. Content of this key. + */ + key: string; + /** + * Output only. Full name of this resource, in the format + * `users/{owner_email}/environments/{environment_id}/publicKeys/{key_id}`. + * `{owner_email}` is the email address of the user to whom the key belongs. + * `{environment_id}` is the identifier of the environment to which the key + * grants access. `{key_id}` is the unique identifier of the key. For + * example, + * `users/someone@example.com/environments/default/publicKeys/myKey`. + */ + name: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Message included in the metadata field of operations returned from + * StartEnvironment. */ - code: number; + export interface Schema$StartEnvironmentMetadata { + /** + * Current state of the environment being started. + */ + state: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Message included in the response field of operations returned from + * StartEnvironment once the operation is complete. */ - details: any[]; + export interface Schema$StartEnvironmentResponse { + /** + * Environment that was started. + */ + environment: Schema$Environment; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - message: string; -} - -export class Resource$Operations { - root: Cloudshell; - constructor(root: Cloudshell) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * cloudshell.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias cloudshell.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Cloudshell; + constructor(root: Cloudshell) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudshell.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias cloudshell.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudshell.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias cloudshell.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudshell.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias cloudshell.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudshell.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias cloudshell.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudshell.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias cloudshell.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudshell.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias cloudshell.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudshell.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias cloudshell.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudshell/v1alpha1.ts b/src/apis/cloudshell/v1alpha1.ts index c8a18383a46..b9f8cf4e826 100644 --- a/src/apis/cloudshell/v1alpha1.ts +++ b/src/apis/cloudshell/v1alpha1.ts @@ -27,558 +27,572 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Shell API - * - * Allows users to start, configure, and connect to interactive shell sessions - * running in the cloud. - * - * @example - * const google = require('googleapis'); - * const cloudshell = google.cloudshell('v1alpha1'); - * - * @namespace cloudshell - * @type {Function} - * @version v1alpha1 - * @variation v1alpha1 - * @param {object=} options Options for Cloudshell - */ -export class Cloudshell { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudshell_v1alpha1 { + /** + * Cloud Shell API + * + * Allows users to start, configure, and connect to interactive shell sessions + * running in the cloud. + * + * @example + * const google = require('googleapis'); + * const cloudshell = google.cloudshell('v1alpha1'); + * + * @namespace cloudshell + * @type {Function} + * @version v1alpha1 + * @variation v1alpha1 + * @param {object=} options Options for Cloudshell + */ + export class Cloudshell { + _options: GlobalOptions; + google: GoogleApis; + root = this; - users: Resource$Users; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.users = new Resource$Users(this); - } + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request message for CreatePublicKey. - */ -export interface Schema$CreatePublicKeyRequest { - /** - * Key that should be added to the environment. - */ - key: Schema$PublicKey; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A Cloud Shell environment, which is defined as the combination of a Docker - * image specifying what is installed on the environment and a home directory - * containing the user's data that will remain across sessions. Each user - * has a single environment with the ID "default". - */ -export interface Schema$Environment { - /** - * Required. Full path to the Docker image used to run this environment, e.g. - * "gcr.io/dev-con/cloud-devshell:latest". - */ - dockerImage: string; - /** - * Output only. The environment's identifier, which is always - * "default". - */ - id: string; - /** - * Output only. Full name of this resource, in the format - * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is the - * email address of the user to whom this environment belongs, and - * `{environment_id}` is the identifier of this environment. For example, - * `users/someone@example.com/environments/default`. - */ - name: string; /** - * Output only. Public keys associated with the environment. Clients can - * connect to this environment via SSH only if they possess a private key - * corresponding to at least one of these public keys. Keys can be added to or - * removed from the environment using the CreatePublicKey and DeletePublicKey - * methods. + * Request message for CreatePublicKey. */ - publicKeys: Schema$PublicKey[]; - /** - * Output only. Host to which clients can connect to initiate SSH sessions - * with the environment. - */ - sshHost: string; - /** - * Output only. Port to which clients can connect to initiate SSH sessions - * with the environment. - */ - sshPort: number; - /** - * Output only. Username that clients should use when initiating SSH sessions - * with the environment. - */ - sshUsername: string; - /** - * Output only. Current execution state of this environment. - */ - state: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A public SSH key, corresponding to a private SSH key held by the client. - */ -export interface Schema$PublicKey { + export interface Schema$CreatePublicKeyRequest { + /** + * Key that should be added to the environment. + */ + key: Schema$PublicKey; + } /** - * Required. Format of this key's content. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - format: string; + export interface Schema$Empty {} /** - * Required. Content of this key. + * A Cloud Shell environment, which is defined as the combination of a Docker + * image specifying what is installed on the environment and a home directory + * containing the user's data that will remain across sessions. Each user + * has a single environment with the ID "default". */ - key: string; + export interface Schema$Environment { + /** + * Required. Full path to the Docker image used to run this environment, + * e.g. "gcr.io/dev-con/cloud-devshell:latest". + */ + dockerImage: string; + /** + * Output only. The environment's identifier, which is always + * "default". + */ + id: string; + /** + * Output only. Full name of this resource, in the format + * `users/{owner_email}/environments/{environment_id}`. `{owner_email}` is + * the email address of the user to whom this environment belongs, and + * `{environment_id}` is the identifier of this environment. For example, + * `users/someone@example.com/environments/default`. + */ + name: string; + /** + * Output only. Public keys associated with the environment. Clients can + * connect to this environment via SSH only if they possess a private key + * corresponding to at least one of these public keys. Keys can be added to + * or removed from the environment using the CreatePublicKey and + * DeletePublicKey methods. + */ + publicKeys: Schema$PublicKey[]; + /** + * Output only. Host to which clients can connect to initiate SSH sessions + * with the environment. + */ + sshHost: string; + /** + * Output only. Port to which clients can connect to initiate SSH sessions + * with the environment. + */ + sshPort: number; + /** + * Output only. Username that clients should use when initiating SSH + * sessions with the environment. + */ + sshUsername: string; + /** + * Output only. Current execution state of this environment. + */ + state: string; + } /** - * Output only. Full name of this resource, in the format - * `users/{owner_email}/environments/{environment_id}/publicKeys/{key_id}`. - * `{owner_email}` is the email address of the user to whom the key belongs. - * `{environment_id}` is the identifier of the environment to which the key - * grants access. `{key_id}` is the unique identifier of the key. For example, - * `users/someone@example.com/environments/default/publicKeys/myKey`. + * This resource represents a long-running operation that is the result of a + * network API call. */ - name: string; -} -/** - * Message included in the metadata field of operations returned from - * StartEnvironment. - */ -export interface Schema$StartEnvironmentMetadata { + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Current state of the environment being started. + * A public SSH key, corresponding to a private SSH key held by the client. */ - state: string; -} -/** - * Request message for StartEnvironment. - */ -export interface Schema$StartEnvironmentRequest {} -/** - * Message included in the response field of operations returned from - * StartEnvironment once the operation is complete. - */ -export interface Schema$StartEnvironmentResponse { + export interface Schema$PublicKey { + /** + * Required. Format of this key's content. + */ + format: string; + /** + * Required. Content of this key. + */ + key: string; + /** + * Output only. Full name of this resource, in the format + * `users/{owner_email}/environments/{environment_id}/publicKeys/{key_id}`. + * `{owner_email}` is the email address of the user to whom the key belongs. + * `{environment_id}` is the identifier of the environment to which the key + * grants access. `{key_id}` is the unique identifier of the key. For + * example, + * `users/someone@example.com/environments/default/publicKeys/myKey`. + */ + name: string; + } /** - * Environment that was started. + * Message included in the metadata field of operations returned from + * StartEnvironment. */ - environment: Schema$Environment; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$StartEnvironmentMetadata { + /** + * Current state of the environment being started. + */ + state: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Request message for StartEnvironment. */ - code: number; + export interface Schema$StartEnvironmentRequest {} /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Message included in the response field of operations returned from + * StartEnvironment once the operation is complete. */ - details: any[]; + export interface Schema$StartEnvironmentResponse { + /** + * Environment that was started. + */ + environment: Schema$Environment; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - message: string; -} - -export class Resource$Users { - root: Cloudshell; - environments: Resource$Users$Environments; - constructor(root: Cloudshell) { - this.root = root; - this.getRoot.bind(this); - this.environments = new Resource$Users$Environments(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Users$Environments { - root: Cloudshell; - publicKeys: Resource$Users$Environments$Publickeys; - constructor(root: Cloudshell) { - this.root = root; - this.getRoot.bind(this); - this.publicKeys = new Resource$Users$Environments$Publickeys(root); - } - - getRoot() { - return this.root; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } + export class Resource$Users { + root: Cloudshell; + environments: Resource$Users$Environments; + constructor(root: Cloudshell) { + this.root = root; + this.getRoot.bind(this); + this.environments = new Resource$Users$Environments(root); + } - /** - * cloudshell.users.environments.get - * @desc Gets an environment. Returns NOT_FOUND if the environment does not - * exist. - * @alias cloudshell.users.environments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Environments { + root: Cloudshell; + publicKeys: Resource$Users$Environments$Publickeys; + constructor(root: Cloudshell) { + this.root = root; + this.getRoot.bind(this); + this.publicKeys = new Resource$Users$Environments$Publickeys(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudshell.users.environments.patch - * @desc Updates an existing environment. - * @alias cloudshell.users.environments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the resource to be updated, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. - * @param {string=} params.updateMask Mask specifying which fields in the environment should be updated. - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudshell.users.environments.get + * @desc Gets an environment. Returns NOT_FOUND if the environment does not + * exist. + * @alias cloudshell.users.environments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudshell.users.environments.start - * @desc Starts an existing environment, allowing clients to connect to it. - * The returned operation will contain an instance of StartEnvironmentMetadata - * in its metadata field. Users can wait for the environment to start by - * polling this operation via GetOperation. Once the environment has finished - * starting and is ready to accept connections, the operation will contain a - * StartEnvironmentResponse in its response field. - * @alias cloudshell.users.environments.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the resource that should be started, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. - * @param {().StartEnvironmentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudshell.users.environments.patch + * @desc Updates an existing environment. + * @alias cloudshell.users.environments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the resource to be updated, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. + * @param {string=} params.updateMask Mask specifying which fields in the environment should be updated. + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Users$Environments$Publickeys { - root: Cloudshell; - constructor(root: Cloudshell) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * cloudshell.users.environments.publicKeys.create - * @desc Adds a public SSH key to an environment, allowing clients with the - * corresponding private key to connect to that environment via SSH. If a key - * with the same format and content already exists, this will return the - * existing key. - * @alias cloudshell.users.environments.publicKeys.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Parent resource name, e.g. `users/me/environments/default`. - * @param {().CreatePublicKeyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudshell.users.environments.start + * @desc Starts an existing environment, allowing clients to connect to it. + * The returned operation will contain an instance of + * StartEnvironmentMetadata in its metadata field. Users can wait for the + * environment to start by polling this operation via GetOperation. Once the + * environment has finished starting and is ready to accept connections, the + * operation will contain a StartEnvironmentResponse in its response field. + * @alias cloudshell.users.environments.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the resource that should be started, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. + * @param {().StartEnvironmentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Environments$Publickeys { + root: Cloudshell; + constructor(root: Cloudshell) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+parent}/publicKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudshell.users.environments.publicKeys.delete - * @desc Removes a public SSH key from an environment. Clients will no longer - * be able to connect to the environment using the corresponding private key. - * @alias cloudshell.users.environments.publicKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the resource to be deleted, e.g. `users/me/environments/default/publicKeys/my-key`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudshell.users.environments.publicKeys.create + * @desc Adds a public SSH key to an environment, allowing clients with the + * corresponding private key to connect to that environment via SSH. If a + * key with the same format and content already exists, this will return the + * existing key. + * @alias cloudshell.users.environments.publicKeys.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Parent resource name, e.g. `users/me/environments/default`. + * @param {().CreatePublicKeyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+parent}/publicKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudshell.users.environments.publicKeys.delete + * @desc Removes a public SSH key from an environment. Clients will no + * longer be able to connect to the environment using the corresponding + * private key. + * @alias cloudshell.users.environments.publicKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the resource to be deleted, e.g. `users/me/environments/default/publicKeys/my-key`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudshell.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudtasks/v2beta2.ts b/src/apis/cloudtasks/v2beta2.ts index e96f0bb790d..3b897de2fda 100644 --- a/src/apis/cloudtasks/v2beta2.ts +++ b/src/apis/cloudtasks/v2beta2.ts @@ -27,3487 +27,3564 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Tasks API - * - * Manages the execution of large numbers of distributed requests. Cloud Tasks - * is in Alpha. - * - * @example - * const google = require('googleapis'); - * const cloudtasks = google.cloudtasks('v2beta2'); - * - * @namespace cloudtasks - * @type {Function} - * @version v2beta2 - * @variation v2beta2 - * @param {object=} options Options for Cloudtasks - */ -export class Cloudtasks { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudtasks_v2beta2 { + /** + * Cloud Tasks API + * + * Manages the execution of large numbers of distributed requests. Cloud Tasks + * is in Alpha. + * + * @example + * const google = require('googleapis'); + * const cloudtasks = google.cloudtasks('v2beta2'); + * + * @namespace cloudtasks + * @type {Function} + * @version v2beta2 + * @variation v2beta2 + * @param {object=} options Options for Cloudtasks + */ + export class Cloudtasks { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request message for acknowledging a task using AcknowledgeTask. - */ -export interface Schema$AcknowledgeTaskRequest { - /** - * Required. The task's current schedule time, available in the - * schedule_time returned by LeaseTasks response or RenewLease response. This - * restriction is to ensure that your worker currently holds the lease. - */ - scheduleTime: string; -} -/** - * App Engine HTTP request. The message defines the HTTP request that is sent - * to an App Engine app when the task is dispatched. This proto can only be - * used for tasks in a queue which has app_engine_http_target set. Using - * AppEngineHttpRequest requires - * [`appengine.applications.get`](/appengine/docs/admin-api/access-control) - * Google IAM permission for the project and the following scope: - * `https://www.googleapis.com/auth/cloud-platform` The task will be delivered - * to the App Engine app which belongs to the same project as the queue. For - * more information, see [How Requests are - * Routed](/appengine/docs/standard/python/how-requests-are-routed) and how - * routing is affected by [dispatch - * files](/appengine/docs/python/config/dispatchref). The AppEngineRouting used - * to construct the URL that the task is delivered to can be set at the - * queue-level or task-level: * If set, app_engine_routing_override is - * used for all tasks in the queue, no matter what the setting is for the - * task-level app_engine_routing. The `url` that the task will be sent to is: - * * `url =` host `+` relative_url The task attempt has succeeded if the - * app's request handler returns an HTTP response code in the range [`200` - - * `299`]. `503` is considered an App Engine system error instead of an - * application error. Requests returning error `503` will be retried regardless - * of retry configuration and not counted against retry counts. Any other - * response code or a failure to receive a response before the deadline is a - * failed attempt. - */ -export interface Schema$AppEngineHttpRequest { /** - * Task-level setting for App Engine routing. If set, - * app_engine_routing_override is used for all tasks in the queue, no matter - * what the setting is for the task-level app_engine_routing. + * Request message for acknowledging a task using AcknowledgeTask. */ - appEngineRouting: Schema$AppEngineRouting; - /** - * HTTP request headers. This map contains the header field names and values. - * Headers can be set when the [task is - * created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). Repeated - * headers are not supported but a header value can contain commas. Cloud - * Tasks sets some headers to default values: * `User-Agent`: By default, - * this header is `"AppEngine-Google; - * (+http://code.google.com/appengine)"`. This header can be modified, - * but Cloud Tasks will append `"AppEngine-Google; - * (+http://code.google.com/appengine)"` to the modified `User-Agent`. - * If the task has a payload, Cloud Tasks sets the following headers: * - * `Content-Type`: By default, the `Content-Type` header is set to - * `"application/octet-stream"`. The default can be overridden by - * explicitly setting `Content-Type` to a particular media type when the - * [task is created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). For - * example, `Content-Type` can be set to `"application/json"`. * - * `Content-Length`: This is computed by Cloud Tasks. This value is output - * only. It cannot be changed. The headers below cannot be set or - * overridden: * `Host` * `X-Google-*` * `X-AppEngine-*` In addition, Cloud - * Tasks sets some headers when the task is dispatched, such as headers - * containing information about the task; see [request - * headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). - * These headers are set only when the task is dispatched, so they are not - * visible when the task is returned in a Cloud Tasks response. Although - * there is no specific limit for the maximum number of headers or the size, - * there is a limit on the maximum size of the Task. For more information, see - * the CreateTask documentation. - */ - headers: any; - /** - * The HTTP method to use for the request. The default is POST. The app's - * request handler for the task's target URL must be able to handle HTTP - * requests with this http_method, otherwise the task attempt will fail with - * error code 405 (Method Not Allowed). See [Writing a push task request - * handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) - * and the documentation for the request handlers in the language your app is - * written in e.g. [Python Request - * Handler](/appengine/docs/python/tools/webapp/requesthandlerclass). - */ - httpMethod: string; - /** - * Payload. The payload will be sent as the HTTP message body. A message - * body, and thus a payload, is allowed only if the HTTP method is POST or - * PUT. It is an error to set a data payload on a task with an incompatible - * HttpMethod. - */ - payload: string; - /** - * The relative URL. The relative URL must begin with "/" and must - * be a valid HTTP relative URL. It can contain a path and query string - * arguments. If the relative URL is empty, then the root path "/" - * will be used. No spaces are allowed, and the maximum length allowed is 2083 - * characters. - */ - relativeUrl: string; -} -/** - * App Engine HTTP target. The task will be delivered to the App Engine - * application hostname specified by its AppEngineHttpTarget and - * AppEngineHttpRequest. The documentation for AppEngineHttpRequest explains how - * the task's host URL is constructed. Using AppEngineHttpTarget requires - * [`appengine.applications.get`](/appengine/docs/admin-api/access-control) - * Google IAM permission for the project and the following scope: - * `https://www.googleapis.com/auth/cloud-platform` - */ -export interface Schema$AppEngineHttpTarget { + export interface Schema$AcknowledgeTaskRequest { + /** + * Required. The task's current schedule time, available in the + * schedule_time returned by LeaseTasks response or RenewLease response. + * This restriction is to ensure that your worker currently holds the lease. + */ + scheduleTime: string; + } /** - * Overrides for the task-level app_engine_routing. If set, - * `app_engine_routing_override` is used for all tasks in the queue, no matter - * what the setting is for the task-level app_engine_routing. - */ - appEngineRoutingOverride: Schema$AppEngineRouting; -} -/** - * App Engine Routing. For more information about services, versions, and - * instances see [An Overview of App - * Engine](/appengine/docs/python/an-overview-of-app-engine), [Microservices - * Architecture on Google App - * Engine](/appengine/docs/python/microservices-on-app-engine), [App Engine - * Standard request - * routing](/appengine/docs/standard/python/how-requests-are-routed), and [App - * Engine Flex request - * routing](/appengine/docs/flexible/python/how-requests-are-routed). - */ -export interface Schema$AppEngineRouting { + * App Engine HTTP request. The message defines the HTTP request that is sent + * to an App Engine app when the task is dispatched. This proto can only be + * used for tasks in a queue which has app_engine_http_target set. Using + * AppEngineHttpRequest requires + * [`appengine.applications.get`](/appengine/docs/admin-api/access-control) + * Google IAM permission for the project and the following scope: + * `https://www.googleapis.com/auth/cloud-platform` The task will be + * delivered to the App Engine app which belongs to the same project as the + * queue. For more information, see [How Requests are + * Routed](/appengine/docs/standard/python/how-requests-are-routed) and how + * routing is affected by [dispatch + * files](/appengine/docs/python/config/dispatchref). The AppEngineRouting + * used to construct the URL that the task is delivered to can be set at the + * queue-level or task-level: * If set, app_engine_routing_override is + * used for all tasks in the queue, no matter what the setting is for the + * task-level app_engine_routing. The `url` that the task will be sent to + * is: * `url =` host `+` relative_url The task attempt has succeeded if + * the app's request handler returns an HTTP response code in the range + * [`200` - `299`]. `503` is considered an App Engine system error instead of + * an application error. Requests returning error `503` will be retried + * regardless of retry configuration and not counted against retry counts. Any + * other response code or a failure to receive a response before the deadline + * is a failed attempt. + */ + export interface Schema$AppEngineHttpRequest { + /** + * Task-level setting for App Engine routing. If set, + * app_engine_routing_override is used for all tasks in the queue, no matter + * what the setting is for the task-level app_engine_routing. + */ + appEngineRouting: Schema$AppEngineRouting; + /** + * HTTP request headers. This map contains the header field names and + * values. Headers can be set when the [task is + * created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). Repeated + * headers are not supported but a header value can contain commas. Cloud + * Tasks sets some headers to default values: * `User-Agent`: By default, + * this header is `"AppEngine-Google; + * (+http://code.google.com/appengine)"`. This header can be + * modified, but Cloud Tasks will append `"AppEngine-Google; + * (+http://code.google.com/appengine)"` to the modified + * `User-Agent`. If the task has a payload, Cloud Tasks sets the following + * headers: * `Content-Type`: By default, the `Content-Type` header is set + * to `"application/octet-stream"`. The default can be + * overridden by explicitly setting `Content-Type` to a particular media + * type when the [task is + * created](google.cloud.tasks.v2beta2.CloudTasks.CreateTask). For + * example, `Content-Type` can be set to `"application/json"`. * + * `Content-Length`: This is computed by Cloud Tasks. This value is output + * only. It cannot be changed. The headers below cannot be set or + * overridden: * `Host` * `X-Google-*` * `X-AppEngine-*` In addition, + * Cloud Tasks sets some headers when the task is dispatched, such as + * headers containing information about the task; see [request + * headers](/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). + * These headers are set only when the task is dispatched, so they are not + * visible when the task is returned in a Cloud Tasks response. Although + * there is no specific limit for the maximum number of headers or the size, + * there is a limit on the maximum size of the Task. For more information, + * see the CreateTask documentation. + */ + headers: any; + /** + * The HTTP method to use for the request. The default is POST. The + * app's request handler for the task's target URL must be able to + * handle HTTP requests with this http_method, otherwise the task attempt + * will fail with error code 405 (Method Not Allowed). See [Writing a push + * task request + * handler](/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) + * and the documentation for the request handlers in the language your app + * is written in e.g. [Python Request + * Handler](/appengine/docs/python/tools/webapp/requesthandlerclass). + */ + httpMethod: string; + /** + * Payload. The payload will be sent as the HTTP message body. A message + * body, and thus a payload, is allowed only if the HTTP method is POST or + * PUT. It is an error to set a data payload on a task with an incompatible + * HttpMethod. + */ + payload: string; + /** + * The relative URL. The relative URL must begin with "/" and + * must be a valid HTTP relative URL. It can contain a path and query string + * arguments. If the relative URL is empty, then the root path "/" + * will be used. No spaces are allowed, and the maximum length allowed is + * 2083 characters. + */ + relativeUrl: string; + } /** - * Output only. The host that the task is sent to. For more information, see - * [How Requests are - * Routed](/appengine/docs/standard/python/how-requests-are-routed). The host - * is constructed as: * `host = [application_domain_name]`</br> `| - * [service] + '.' + [application_domain_name]`</br> `| - * [version] + '.' + [application_domain_name]`</br> `| - * [version_dot_service]+ '.' + [application_domain_name]`</br> - * `| [instance] + '.' + [application_domain_name]`</br> `| - * [instance_dot_service] + '.' + - * [application_domain_name]`</br> `| [instance_dot_version] + - * '.' + [application_domain_name]`</br> `| - * [instance_dot_version_dot_service] + '.' + - * [application_domain_name]` * `application_domain_name` = The domain name - * of the app, for example <app-id>.appspot.com, which is associated - * with the queue's project ID. Some tasks which were created using the - * App Engine SDK use a custom domain name. * `service =` service * - * `version =` version * `version_dot_service =` version `+ '.' +` - * service * `instance =` instance * `instance_dot_service =` instance `+ - * '.' +` service * `instance_dot_version =` instance `+ - * '.' +` version * `instance_dot_version_dot_service =` instance - * `+ '.' +` version `+ '.' +` service If service is - * empty, then the task will be sent to the service which is the default - * service when the task is attempted. If version is empty, then the task - * will be sent to the version which is the default version when the task is - * attempted. If instance is empty, then the task will be sent to an instance - * which is available when the task is attempted. When service is - * "default", version is "default", and instance is empty, - * host is shortened to just the `application_domain_name`. If service, - * version, or instance is invalid, then the task will be sent to the default - * version of the default service when the task is attempted. - */ - host: string; + * App Engine HTTP target. The task will be delivered to the App Engine + * application hostname specified by its AppEngineHttpTarget and + * AppEngineHttpRequest. The documentation for AppEngineHttpRequest explains + * how the task's host URL is constructed. Using AppEngineHttpTarget + * requires + * [`appengine.applications.get`](/appengine/docs/admin-api/access-control) + * Google IAM permission for the project and the following scope: + * `https://www.googleapis.com/auth/cloud-platform` + */ + export interface Schema$AppEngineHttpTarget { + /** + * Overrides for the task-level app_engine_routing. If set, + * `app_engine_routing_override` is used for all tasks in the queue, no + * matter what the setting is for the task-level app_engine_routing. + */ + appEngineRoutingOverride: Schema$AppEngineRouting; + } /** - * App instance. By default, the task is sent to an instance which is - * available when the task is attempted. Requests can only be sent to a - * specific instance if [manual scaling is used in App Engine - * Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). - * App Engine Flex does not support instances. For more information, see [App - * Engine Standard request - * routing](/appengine/docs/standard/python/how-requests-are-routed) and [App + * App Engine Routing. For more information about services, versions, and + * instances see [An Overview of App + * Engine](/appengine/docs/python/an-overview-of-app-engine), [Microservices + * Architecture on Google App + * Engine](/appengine/docs/python/microservices-on-app-engine), [App Engine + * Standard request + * routing](/appengine/docs/standard/python/how-requests-are-routed), and [App * Engine Flex request * routing](/appengine/docs/flexible/python/how-requests-are-routed). */ - instance: string; - /** - * App service. By default, the task is sent to the service which is the - * default service when the task is attempted ("default"). For some - * queues or tasks which were created using the App Engine Task Queue API, - * host is not parsable into service, version, and instance. For example, some - * tasks which were created using the App Engine SDK use a custom domain name; - * custom domains are not parsed by Cloud Tasks. If host is not parsable, then - * service, version, and instance are the empty string. - */ - service: string; - /** - * App version. By default, the task is sent to the version which is the - * default version when the task is attempted ("default"). For some - * queues or tasks which were created using the App Engine Task Queue API, - * host is not parsable into service, version, and instance. For example, some - * tasks which were created using the App Engine SDK use a custom domain name; - * custom domains are not parsed by Cloud Tasks. If host is not parsable, then - * service, version, and instance are the empty string. - */ - version: string; -} -/** - * The status of a task attempt. - */ -export interface Schema$AttemptStatus { - /** - * Output only. The time that this attempt was dispatched. `dispatch_time` - * will be truncated to the nearest microsecond. - */ - dispatchTime: string; - /** - * Output only. The response from the target for this attempt. If the task - * has not been attempted or the task is currently running then the response - * status is unset. - */ - responseStatus: Schema$Status; - /** - * Output only. The time that this attempt response was received. - * `response_time` will be truncated to the nearest microsecond. - */ - responseTime: string; - /** - * Output only. The time that this attempt was scheduled. `schedule_time` - * will be truncated to the nearest microsecond. - */ - scheduleTime: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Request message for canceling a lease using CancelLease. - */ -export interface Schema$CancelLeaseRequest { - /** - * The response_view specifies which subset of the Task will be returned. By - * default response_view is BASIC; not all information is retrieved by default - * because some data, such as payloads, might be desirable to return only when - * needed because of its large size or because of the sensitivity of data that - * it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` - * [Google IAM](/iam/) permission on the Task resource. - */ - responseView: string; - /** - * Required. The task's current schedule time, available in the - * schedule_time returned by LeaseTasks response or RenewLease response. This - * restriction is to ensure that your worker currently holds the lease. - */ - scheduleTime: string; -} -/** - * Request message for CreateTask. - */ -export interface Schema$CreateTaskRequest { - /** - * The response_view specifies which subset of the Task will be returned. By - * default response_view is BASIC; not all information is retrieved by default - * because some data, such as payloads, might be desirable to return only when - * needed because of its large size or because of the sensitivity of data that - * it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` - * [Google IAM](/iam/) permission on the Task resource. - */ - responseView: string; - /** - * Required. The task to add. Task names have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. - * The user can optionally specify a task name. If a name is not specified - * then the system will generate a random unique task id, which will be set in - * the task returned in the response. If schedule_time is not set or is in - * the past then Cloud Tasks will set it to the current time. Task - * De-duplication: Explicitly specifying a task ID enables task - * de-duplication. If a task's ID is identical to that of an existing - * task or a task that was deleted or completed recently then the call will - * fail with ALREADY_EXISTS. If the task's queue was created using Cloud - * Tasks, then another task with the same name can't be created for ~1hour - * after the original task was deleted or completed. If the task's queue - * was created using queue.yaml or queue.xml, then another task with the same - * name can't be created for ~9days after the original task was deleted or - * completed. Because there is an extra lookup cost to identify duplicate - * task names, these CreateTask calls have significantly increased latency. - * Using hashed strings for the task id or for the prefix of the task id is - * recommended. Choosing task ids that are sequential or have sequential - * prefixes, for example using a timestamp, causes an increase in latency and - * error rates in all task commands. The infrastructure relies on an - * approximately uniform distribution of task ids to store and serve tasks - * efficiently. - */ - task: Schema$Task; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * Request message for leasing tasks using LeaseTasks. - */ -export interface Schema$LeaseTasksRequest { - /** - * `filter` can be used to specify a subset of tasks to lease. When `filter` - * is set to `tag=<my-tag>` then the response will contain only tasks - * whose tag is equal to `<my-tag>`. `<my-tag>` must be less than - * 500 characters. When `filter` is set to `tag_function=oldest_tag()`, only - * tasks which have the same tag as the task with the oldest schedule_time - * will be returned. Grammar Syntax: * `filter = "tag=" tag | - * "tag_function=" function` * `tag = string` * `function = - * "oldest_tag()"` The `oldest_tag()` function returns tasks which - * have the same tag as the oldest task (ordered by schedule time). SDK - * compatibility: Although the SDK allows tags to be either string or - * [bytes](/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which aren't - * UTF-8 encoded can't be used in the filter and the task's tag will - * be displayed as empty in Cloud Tasks. - */ - filter: string; - /** - * After the worker has successfully finished the work associated with the - * task, the worker must call via AcknowledgeTask before the schedule_time. - * Otherwise the task will be returned to a later LeaseTasks call so that - * another worker can retry it. The maximum lease duration is 1 week. - * `lease_duration` will be truncated to the nearest second. - */ - leaseDuration: string; - /** - * The maximum number of tasks to lease. The maximum that can be requested is - * 1000. - */ - maxTasks: number; - /** - * The response_view specifies which subset of the Task will be returned. By - * default response_view is BASIC; not all information is retrieved by default - * because some data, such as payloads, might be desirable to return only when - * needed because of its large size or because of the sensitivity of data that - * it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` - * [Google IAM](/iam/) permission on the Task resource. - */ - responseView: string; -} -/** - * Response message for leasing tasks using LeaseTasks. - */ -export interface Schema$LeaseTasksResponse { - /** - * The leased tasks. - */ - tasks: Schema$Task[]; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * Response message for ListQueues. - */ -export interface Schema$ListQueuesResponse { - /** - * A token to retrieve next page of results. To return the next page of - * results, call ListQueues with this value as the page_token. If the - * next_page_token is empty, there are no more results. The page token is - * valid for only 2 hours. - */ - nextPageToken: string; - /** - * The list of queues. - */ - queues: Schema$Queue[]; -} -/** - * Response message for listing tasks using ListTasks. - */ -export interface Schema$ListTasksResponse { - /** - * A token to retrieve next page of results. To return the next page of - * results, call ListTasks with this value as the page_token. If the - * next_page_token is empty, there are no more results. - */ - nextPageToken: string; - /** - * The list of tasks. - */ - tasks: Schema$Task[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * Request message for PauseQueue. - */ -export interface Schema$PauseQueueRequest {} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * The pull message contains data that can be used by the caller of LeaseTasks - * to process the task. This proto can only be used for tasks in a queue which - * has pull_target set. - */ -export interface Schema$PullMessage { - /** - * A data payload consumed by the worker to execute the task. - */ - payload: string; - /** - * The task's tag. Tags allow similar tasks to be processed in a batch. - * If you label tasks with a tag, your worker can lease tasks with the same - * tag using filter. For example, if you want to aggregate the events - * associated with a specific user once a day, you could tag tasks with the - * user ID. The task's tag can only be set when the task is created. The - * tag must be less than 500 characters. SDK compatibility: Although the SDK - * allows tags to be either string or - * [bytes](/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), - * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't - * UTF-8 encoded, the tag will be empty when the task is returned by Cloud - * Tasks. - */ - tag: string; -} -/** - * Pull target. - */ -export interface Schema$PullTarget {} -/** - * Request message for PurgeQueue. - */ -export interface Schema$PurgeQueueRequest {} -/** - * A queue is a container of related tasks. Queues are configured to manage how - * those tasks are dispatched. Configurable properties include rate limits, - * retry options, target types, and others. - */ -export interface Schema$Queue { - /** - * App Engine HTTP target. An App Engine queue is a queue that has an - * AppEngineHttpTarget. - */ - appEngineHttpTarget: Schema$AppEngineHttpTarget; - /** - * The queue name. The queue name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` - * can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons - * (:), or periods (.). For more information, see [Identifying - * projects](/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the queue's location. The - * list of available locations can be obtained by calling ListLocations. - * For more information, see https://cloud.google.com/about/locations/. * - * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens - * (-). The maximum length is 100 characters. Caller-specified and required - * in CreateQueue, after which it becomes output only. - */ - name: string; - /** - * Pull target. A pull queue is a queue that has a PullTarget. - */ - pullTarget: Schema$PullTarget; - /** - * Output only. The last time this queue was purged. All tasks that were - * created before this time were purged. A queue can be purged using - * PurgeQueue, the [App Engine Task Queue SDK, or the Cloud - * Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). - * Purge time will be truncated to the nearest microsecond. Purge time will be - * unset if the queue has never been purged. - */ - purgeTime: string; - /** - * Rate limits for task dispatches. rate_limits and retry_config are related - * because they both control task attempts however they control how tasks are - * attempted in different ways: * rate_limits controls the total rate of - * dispatches from a queue (i.e. all traffic dispatched from the queue, - * regardless of whether the dispatch is from a first attempt or a retry). * - * retry_config controls what happens to particular a task after its first - * attempt fails. That is, retry_config controls task retries (the second - * attempt, third attempt, etc). - */ - rateLimits: Schema$RateLimits; - /** - * Settings that determine the retry behavior. * For tasks created using - * Cloud Tasks: the queue-level retry settings apply to all tasks in the - * queue that were created using Cloud Tasks. Retry settings cannot be set - * on individual tasks. * For tasks created using the App Engine SDK: the - * queue-level retry settings apply to all tasks in the queue which do not - * have retry settings explicitly set on the task and were created by the - * App Engine SDK. See [App Engine - * documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks). - */ - retryConfig: Schema$RetryConfig; - /** - * Output only. The state of the queue. `state` can only be changed by called - * PauseQueue, ResumeQueue, or uploading - * [queue.yaml/xml](/appengine/docs/python/config/queueref). UpdateQueue - * cannot be used to change `state`. - */ - state: string; -} -/** - * Rate limits. This message determines the maximum rate that tasks can be - * dispatched by a queue, regardless of whether the dispatch is a first task - * attempt or a retry. - */ -export interface Schema$RateLimits { - /** - * Output only. The max burst size. Max burst size limits how fast tasks in - * queue are processed when many tasks are in the queue and the rate is high. - * This field allows the queue to have a high rate so processing starts - * shortly after a task is enqueued, but still limits resource usage when many - * tasks are enqueued in a short period of time. The [token - * bucket](https://wikipedia.org/wiki/Token_Bucket) algorithm is used to - * control the rate of task dispatches. Each queue has a token bucket that - * holds tokens, up to the maximum specified by `max_burst_size`. Each time a - * task is dispatched, a token is removed from the bucket. Tasks will be - * dispatched until the queue's bucket runs out of tokens. The bucket will - * be continuously refilled with new tokens based on - * max_tasks_dispatched_per_second. Cloud Tasks will pick the value of - * `max_burst_size` based on the value of max_tasks_dispatched_per_second. For - * App Engine queues that were created or updated using `queue.yaml/xml`, - * `max_burst_size` is equal to - * [bucket_size](/appengine/docs/standard/python/config/queueref#bucket_size). - * Since `max_burst_size` is output only, if UpdateQueue is called on a queue - * created by `queue.yaml/xml`, `max_burst_size` will be reset based on the - * value of max_tasks_dispatched_per_second, regardless of whether - * max_tasks_dispatched_per_second is updated. - */ - maxBurstSize: number; - /** - * The maximum number of concurrent tasks that Cloud Tasks allows to be - * dispatched for this queue. After this threshold has been reached, Cloud - * Tasks stops dispatching tasks until the number of concurrent requests - * decreases. If unspecified when the queue is created, Cloud Tasks will pick - * the default. The maximum allowed value is 5,000. -1 indicates no limit. - * This field is output only for [pull - * queues](google.cloud.tasks.v2beta2.PullTarget). This field has the same - * meaning as [max_concurrent_requests in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests). - */ - maxConcurrentTasks: number; - /** - * The maximum rate at which tasks are dispatched from this queue. If - * unspecified when the queue is created, Cloud Tasks will pick the default. - * * For App Engine queues, the maximum allowed value is 500. * This field is - * output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). In - * addition to the `max_tasks_dispatched_per_second` limit, a maximum of 10 - * QPS of LeaseTasks requests are allowed per pull queue. This field has - * the same meaning as [rate in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#rate). - */ - maxTasksDispatchedPerSecond: number; -} -/** - * Request message for renewing a lease using RenewLease. - */ -export interface Schema$RenewLeaseRequest { - /** - * Required. The desired new lease duration, starting from now. The maximum - * lease duration is 1 week. `lease_duration` will be truncated to the nearest - * second. - */ - leaseDuration: string; - /** - * The response_view specifies which subset of the Task will be returned. By - * default response_view is BASIC; not all information is retrieved by default - * because some data, such as payloads, might be desirable to return only when - * needed because of its large size or because of the sensitivity of data that - * it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` - * [Google IAM](/iam/) permission on the Task resource. - */ - responseView: string; - /** - * Required. The task's current schedule time, available in the - * schedule_time returned by LeaseTasks response or RenewLease response. This - * restriction is to ensure that your worker currently holds the lease. - */ - scheduleTime: string; -} -/** - * Request message for ResumeQueue. - */ -export interface Schema$ResumeQueueRequest {} -/** - * Retry config. These settings determine how a failed task attempt is retried. - */ -export interface Schema$RetryConfig { - /** - * The maximum number of attempts for a task. Cloud Tasks will attempt the - * task `max_attempts` times (that is, if the first attempt fails, then there - * will be `max_attempts - 1` retries). Must be > 0. - */ - maxAttempts: number; - /** - * A task will be [scheduled](Task.schedule_time) for retry between - * min_backoff and max_backoff duration after it fails, if the queue's - * RetryConfig specifies that the task should be retried. If unspecified when - * the queue is created, Cloud Tasks will pick the default. This field is - * output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). - * `max_backoff` will be truncated to the nearest second. This field has the - * same meaning as [max_backoff_seconds in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). - */ - maxBackoff: string; - /** - * The time between retries will double `max_doublings` times. A task's - * retry interval starts at min_backoff, then doubles `max_doublings` times, - * then increases linearly, and finally retries retries at intervals of - * max_backoff up to max_attempts times. For example, if min_backoff is 10s, - * max_backoff is 300s, and `max_doublings` is 3, then the a task will first - * be retried in 10s. The retry interval will double three times, and then - * increase linearly by 2^3 * 10s. Finally, the task will retry at intervals - * of max_backoff until the task has been attempted max_attempts times. Thus, - * the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... - * If unspecified when the queue is created, Cloud Tasks will pick the - * default. This field is output only for [pull - * queues](google.cloud.tasks.v2beta2.PullTarget). This field has the same - * meaning as [max_doublings in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). - */ - maxDoublings: number; - /** - * If positive, `max_retry_duration` specifies the time limit for retrying a - * failed task, measured from when the task was first attempted. Once - * `max_retry_duration` time has passed *and* the task has been attempted - * max_attempts times, no further attempts will be made and the task will be - * deleted. If zero, then the task age is unlimited. If unspecified when the - * queue is created, Cloud Tasks will pick the default. This field is output - * only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). - * `max_retry_duration` will be truncated to the nearest second. This field - * has the same meaning as [task_age_limit in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). - */ - maxRetryDuration: string; - /** - * A task will be [scheduled](Task.schedule_time) for retry between - * min_backoff and max_backoff duration after it fails, if the queue's - * RetryConfig specifies that the task should be retried. If unspecified when - * the queue is created, Cloud Tasks will pick the default. This field is - * output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). - * `min_backoff` will be truncated to the nearest second. This field has the - * same meaning as [min_backoff_seconds in - * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). - */ - minBackoff: string; - /** - * If true, then the number of attempts is unlimited. - */ - unlimitedAttempts: boolean; -} -/** - * Request message for forcing a task to run now using RunTask. - */ -export interface Schema$RunTaskRequest { - /** - * The response_view specifies which subset of the Task will be returned. By - * default response_view is BASIC; not all information is retrieved by default - * because some data, such as payloads, might be desirable to return only when - * needed because of its large size or because of the sensitivity of data that - * it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` - * [Google IAM](/iam/) permission on the Task resource. - */ - responseView: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A unit of scheduled work. - */ -export interface Schema$Task { - /** - * App Engine HTTP request that is sent to the task's target. Can be set - * only if app_engine_http_target is set on the queue. An App Engine task is - * a task that has AppEngineHttpRequest set. - */ - appEngineHttpRequest: Schema$AppEngineHttpRequest; - /** - * Output only. The time that the task was created. `create_time` will be - * truncated to the nearest second. - */ - createTime: string; - /** - * The task name. The task name must have the following format: - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens - * (-), colons (:), or periods (.). For more information, see [Identifying - * projects](/resource-manager/docs/creating-managing-projects#identifying_projects) - * * `LOCATION_ID` is the canonical ID for the task's location. The - * list of available locations can be obtained by calling ListLocations. - * For more information, see https://cloud.google.com/about/locations/. * - * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens - * (-). The maximum length is 100 characters. * `TASK_ID` can contain only - * letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). The - * maximum length is 500 characters. Optionally caller-specified in - * CreateTask. - */ - name: string; + export interface Schema$AppEngineRouting { + /** + * Output only. The host that the task is sent to. For more information, + * see [How Requests are + * Routed](/appengine/docs/standard/python/how-requests-are-routed). The + * host is constructed as: * `host = [application_domain_name]`</br> + * `| [service] + '.' + [application_domain_name]`</br> `| + * [version] + '.' + [application_domain_name]`</br> `| + * [version_dot_service]+ '.' + + * [application_domain_name]`</br> `| [instance] + '.' + + * [application_domain_name]`</br> `| [instance_dot_service] + + * '.' + [application_domain_name]`</br> `| + * [instance_dot_version] + '.' + + * [application_domain_name]`</br> `| + * [instance_dot_version_dot_service] + '.' + + * [application_domain_name]` * `application_domain_name` = The domain name + * of the app, for example <app-id>.appspot.com, which is associated + * with the queue's project ID. Some tasks which were created using + * the App Engine SDK use a custom domain name. * `service =` service * + * `version =` version * `version_dot_service =` version `+ '.' + * +` service * `instance =` instance * `instance_dot_service =` + * instance `+ '.' +` service * `instance_dot_version =` instance + * `+ '.' +` version * `instance_dot_version_dot_service =` + * instance `+ '.' +` version `+ '.' +` service If + * service is empty, then the task will be sent to the service which is the + * default service when the task is attempted. If version is empty, then + * the task will be sent to the version which is the default version when + * the task is attempted. If instance is empty, then the task will be sent + * to an instance which is available when the task is attempted. When + * service is "default", version is "default", and + * instance is empty, host is shortened to just the + * `application_domain_name`. If service, version, or instance is invalid, + * then the task will be sent to the default version of the default service + * when the task is attempted. + */ + host: string; + /** + * App instance. By default, the task is sent to an instance which is + * available when the task is attempted. Requests can only be sent to a + * specific instance if [manual scaling is used in App Engine + * Standard](/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). + * App Engine Flex does not support instances. For more information, see + * [App Engine Standard request + * routing](/appengine/docs/standard/python/how-requests-are-routed) and + * [App Engine Flex request + * routing](/appengine/docs/flexible/python/how-requests-are-routed). + */ + instance: string; + /** + * App service. By default, the task is sent to the service which is the + * default service when the task is attempted ("default"). For + * some queues or tasks which were created using the App Engine Task Queue + * API, host is not parsable into service, version, and instance. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If host + * is not parsable, then service, version, and instance are the empty + * string. + */ + service: string; + /** + * App version. By default, the task is sent to the version which is the + * default version when the task is attempted ("default"). For + * some queues or tasks which were created using the App Engine Task Queue + * API, host is not parsable into service, version, and instance. For + * example, some tasks which were created using the App Engine SDK use a + * custom domain name; custom domains are not parsed by Cloud Tasks. If host + * is not parsable, then service, version, and instance are the empty + * string. + */ + version: string; + } /** - * LeaseTasks to process the task. Can be set only if pull_target is set on - * the queue. A pull task is a task that has PullMessage set. - */ - pullMessage: Schema$PullMessage; + * The status of a task attempt. + */ + export interface Schema$AttemptStatus { + /** + * Output only. The time that this attempt was dispatched. `dispatch_time` + * will be truncated to the nearest microsecond. + */ + dispatchTime: string; + /** + * Output only. The response from the target for this attempt. If the task + * has not been attempted or the task is currently running then the response + * status is unset. + */ + responseStatus: Schema$Status; + /** + * Output only. The time that this attempt response was received. + * `response_time` will be truncated to the nearest microsecond. + */ + responseTime: string; + /** + * Output only. The time that this attempt was scheduled. `schedule_time` + * will be truncated to the nearest microsecond. + */ + scheduleTime: string; + } /** - * The time when the task is scheduled to be attempted. For App Engine - * queues, this is when the task will be attempted or retried. For pull - * queues, this is the time when the task is available to be leased; if a task - * is currently leased, this is the time when the current lease expires, that - * is, the time that the task was leased plus the lease_duration. - * `schedule_time` will be truncated to the nearest microsecond. - */ - scheduleTime: string; + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * Output only. The task status. - */ - status: Schema$TaskStatus; + * Request message for canceling a lease using CancelLease. + */ + export interface Schema$CancelLeaseRequest { + /** + * The response_view specifies which subset of the Task will be returned. By + * default response_view is BASIC; not all information is retrieved by + * default because some data, such as payloads, might be desirable to return + * only when needed because of its large size or because of the sensitivity + * of data that it contains. Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task + * resource. + */ + responseView: string; + /** + * Required. The task's current schedule time, available in the + * schedule_time returned by LeaseTasks response or RenewLease response. + * This restriction is to ensure that your worker currently holds the lease. + */ + scheduleTime: string; + } /** - * Output only. The view specifies which subset of the Task has been returned. - */ - view: string; -} -/** - * Status of the task. - */ -export interface Schema$TaskStatus { + * Request message for CreateTask. + */ + export interface Schema$CreateTaskRequest { + /** + * The response_view specifies which subset of the Task will be returned. By + * default response_view is BASIC; not all information is retrieved by + * default because some data, such as payloads, might be desirable to return + * only when needed because of its large size or because of the sensitivity + * of data that it contains. Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task + * resource. + */ + responseView: string; + /** + * Required. The task to add. Task names have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. + * The user can optionally specify a task name. If a name is not specified + * then the system will generate a random unique task id, which will be set + * in the task returned in the response. If schedule_time is not set or is + * in the past then Cloud Tasks will set it to the current time. Task + * De-duplication: Explicitly specifying a task ID enables task + * de-duplication. If a task's ID is identical to that of an existing + * task or a task that was deleted or completed recently then the call will + * fail with ALREADY_EXISTS. If the task's queue was created using Cloud + * Tasks, then another task with the same name can't be created for + * ~1hour after the original task was deleted or completed. If the + * task's queue was created using queue.yaml or queue.xml, then another + * task with the same name can't be created for ~9days after the + * original task was deleted or completed. Because there is an extra lookup + * cost to identify duplicate task names, these CreateTask calls have + * significantly increased latency. Using hashed strings for the task id or + * for the prefix of the task id is recommended. Choosing task ids that are + * sequential or have sequential prefixes, for example using a timestamp, + * causes an increase in latency and error rates in all task commands. The + * infrastructure relies on an approximately uniform distribution of task + * ids to store and serve tasks efficiently. + */ + task: Schema$Task; + } /** - * Output only. The number of attempts dispatched. This count includes tasks - * which have been dispatched but haven't received a response. - */ - attemptDispatchCount: number; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Request message for `GetIamPolicy` method. + */ + export interface Schema$GetIamPolicyRequest {} + /** + * Request message for leasing tasks using LeaseTasks. + */ + export interface Schema$LeaseTasksRequest { + /** + * `filter` can be used to specify a subset of tasks to lease. When + * `filter` is set to `tag=<my-tag>` then the response will contain + * only tasks whose tag is equal to `<my-tag>`. `<my-tag>` must + * be less than 500 characters. When `filter` is set to + * `tag_function=oldest_tag()`, only tasks which have the same tag as the + * task with the oldest schedule_time will be returned. Grammar Syntax: * + * `filter = "tag=" tag | "tag_function=" function` * + * `tag = string` * `function = "oldest_tag()"` The + * `oldest_tag()` function returns tasks which have the same tag as the + * oldest task (ordered by schedule time). SDK compatibility: Although the + * SDK allows tags to be either string or + * [bytes](/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. Tag which aren't + * UTF-8 encoded can't be used in the filter and the task's tag will + * be displayed as empty in Cloud Tasks. + */ + filter: string; + /** + * After the worker has successfully finished the work associated with the + * task, the worker must call via AcknowledgeTask before the schedule_time. + * Otherwise the task will be returned to a later LeaseTasks call so that + * another worker can retry it. The maximum lease duration is 1 week. + * `lease_duration` will be truncated to the nearest second. + */ + leaseDuration: string; + /** + * The maximum number of tasks to lease. The maximum that can be requested + * is 1000. + */ + maxTasks: number; + /** + * The response_view specifies which subset of the Task will be returned. By + * default response_view is BASIC; not all information is retrieved by + * default because some data, such as payloads, might be desirable to return + * only when needed because of its large size or because of the sensitivity + * of data that it contains. Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task + * resource. + */ + responseView: string; + } /** - * Output only. The number of attempts which have received a response. This - * field is not calculated for [pull - * tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + * Response message for leasing tasks using LeaseTasks. */ - attemptResponseCount: number; + export interface Schema$LeaseTasksResponse { + /** + * The leased tasks. + */ + tasks: Schema$Task[]; + } /** - * Output only. The status of the task's first attempt. Only - * dispatch_time will be set. The other AttemptStatus information is not - * retained by Cloud Tasks. This field is not calculated for [pull - * tasks](google.cloud.tasks.v2beta2.PullTaskTarget). - */ - firstAttemptStatus: Schema$AttemptStatus; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Output only. The status of the task's last attempt. This field is not - * calculated for [pull tasks](google.cloud.tasks.v2beta2.PullTaskTarget). - */ - lastAttemptStatus: Schema$AttemptStatus; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + * Response message for ListQueues. + */ + export interface Schema$ListQueuesResponse { + /** + * A token to retrieve next page of results. To return the next page of + * results, call ListQueues with this value as the page_token. If the + * next_page_token is empty, there are no more results. The page token is + * valid for only 2 hours. + */ + nextPageToken: string; + /** + * The list of queues. + */ + queues: Schema$Queue[]; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + * Response message for listing tasks using ListTasks. + */ + export interface Schema$ListTasksResponse { + /** + * A token to retrieve next page of results. To return the next page of + * results, call ListTasks with this value as the page_token. If the + * next_page_token is empty, there are no more results. + */ + nextPageToken: string; + /** + * The list of tasks. + */ + tasks: Schema$Task[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} - -export class Resource$Projects { - root: Cloudtasks; - locations: Resource$Projects$Locations; - constructor(root: Cloudtasks) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; } - - getRoot() { - return this.root; + /** + * Request message for PauseQueue. + */ + export interface Schema$PauseQueueRequest {} + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } -} -export class Resource$Projects$Locations { - root: Cloudtasks; - queues: Resource$Projects$Locations$Queues; - constructor(root: Cloudtasks) { - this.root = root; - this.getRoot.bind(this); - this.queues = new Resource$Projects$Locations$Queues(root); + /** + * The pull message contains data that can be used by the caller of LeaseTasks + * to process the task. This proto can only be used for tasks in a queue + * which has pull_target set. + */ + export interface Schema$PullMessage { + /** + * A data payload consumed by the worker to execute the task. + */ + payload: string; + /** + * The task's tag. Tags allow similar tasks to be processed in a batch. + * If you label tasks with a tag, your worker can lease tasks with the same + * tag using filter. For example, if you want to aggregate the events + * associated with a specific user once a day, you could tag tasks with the + * user ID. The task's tag can only be set when the task is created. + * The tag must be less than 500 characters. SDK compatibility: Although + * the SDK allows tags to be either string or + * [bytes](/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), + * only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't + * UTF-8 encoded, the tag will be empty when the task is returned by Cloud + * Tasks. + */ + tag: string; } - - getRoot() { - return this.root; + /** + * Pull target. + */ + export interface Schema$PullTarget {} + /** + * Request message for PurgeQueue. + */ + export interface Schema$PurgeQueueRequest {} + /** + * A queue is a container of related tasks. Queues are configured to manage + * how those tasks are dispatched. Configurable properties include rate + * limits, retry options, target types, and others. + */ + export interface Schema$Queue { + /** + * App Engine HTTP target. An App Engine queue is a queue that has an + * AppEngineHttpTarget. + */ + appEngineHttpTarget: Schema$AppEngineHttpTarget; + /** + * The queue name. The queue name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * + * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens + * (-), colons (:), or periods (.). For more information, see + * [Identifying + * projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the queue's location. The + * list of available locations can be obtained by calling ListLocations. + * For more information, see https://cloud.google.com/about/locations/. * + * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens + * (-). The maximum length is 100 characters. Caller-specified and required + * in CreateQueue, after which it becomes output only. + */ + name: string; + /** + * Pull target. A pull queue is a queue that has a PullTarget. + */ + pullTarget: Schema$PullTarget; + /** + * Output only. The last time this queue was purged. All tasks that were + * created before this time were purged. A queue can be purged using + * PurgeQueue, the [App Engine Task Queue SDK, or the Cloud + * Console](/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue). + * Purge time will be truncated to the nearest microsecond. Purge time will + * be unset if the queue has never been purged. + */ + purgeTime: string; + /** + * Rate limits for task dispatches. rate_limits and retry_config are + * related because they both control task attempts however they control how + * tasks are attempted in different ways: * rate_limits controls the total + * rate of dispatches from a queue (i.e. all traffic dispatched from the + * queue, regardless of whether the dispatch is from a first attempt or a + * retry). * retry_config controls what happens to particular a task after + * its first attempt fails. That is, retry_config controls task retries + * (the second attempt, third attempt, etc). + */ + rateLimits: Schema$RateLimits; + /** + * Settings that determine the retry behavior. * For tasks created using + * Cloud Tasks: the queue-level retry settings apply to all tasks in the + * queue that were created using Cloud Tasks. Retry settings cannot be set + * on individual tasks. * For tasks created using the App Engine SDK: the + * queue-level retry settings apply to all tasks in the queue which do not + * have retry settings explicitly set on the task and were created by the + * App Engine SDK. See [App Engine + * documentation](/appengine/docs/standard/python/taskqueue/push/retrying-tasks). + */ + retryConfig: Schema$RetryConfig; + /** + * Output only. The state of the queue. `state` can only be changed by + * called PauseQueue, ResumeQueue, or uploading + * [queue.yaml/xml](/appengine/docs/python/config/queueref). UpdateQueue + * cannot be used to change `state`. + */ + state: string; } - - /** - * cloudtasks.projects.locations.get - * @desc Gets information about a location. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Resource name for the location. - * name: 'projects/my-project/locations/my-location', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Rate limits. This message determines the maximum rate that tasks can be + * dispatched by a queue, regardless of whether the dispatch is a first task + * attempt or a retry. + */ + export interface Schema$RateLimits { + /** + * Output only. The max burst size. Max burst size limits how fast tasks in + * queue are processed when many tasks are in the queue and the rate is + * high. This field allows the queue to have a high rate so processing + * starts shortly after a task is enqueued, but still limits resource usage + * when many tasks are enqueued in a short period of time. The [token + * bucket](https://wikipedia.org/wiki/Token_Bucket) algorithm is used to + * control the rate of task dispatches. Each queue has a token bucket that + * holds tokens, up to the maximum specified by `max_burst_size`. Each time + * a task is dispatched, a token is removed from the bucket. Tasks will be + * dispatched until the queue's bucket runs out of tokens. The bucket + * will be continuously refilled with new tokens based on + * max_tasks_dispatched_per_second. Cloud Tasks will pick the value of + * `max_burst_size` based on the value of max_tasks_dispatched_per_second. + * For App Engine queues that were created or updated using + * `queue.yaml/xml`, `max_burst_size` is equal to + * [bucket_size](/appengine/docs/standard/python/config/queueref#bucket_size). + * Since `max_burst_size` is output only, if UpdateQueue is called on a + * queue created by `queue.yaml/xml`, `max_burst_size` will be reset based + * on the value of max_tasks_dispatched_per_second, regardless of whether + * max_tasks_dispatched_per_second is updated. + */ + maxBurstSize: number; + /** + * The maximum number of concurrent tasks that Cloud Tasks allows to be + * dispatched for this queue. After this threshold has been reached, Cloud + * Tasks stops dispatching tasks until the number of concurrent requests + * decreases. If unspecified when the queue is created, Cloud Tasks will + * pick the default. The maximum allowed value is 5,000. -1 indicates no + * limit. This field is output only for [pull + * queues](google.cloud.tasks.v2beta2.PullTarget). This field has the same + * meaning as [max_concurrent_requests in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#max_concurrent_requests). + */ + maxConcurrentTasks: number; + /** + * The maximum rate at which tasks are dispatched from this queue. If + * unspecified when the queue is created, Cloud Tasks will pick the default. + * * For App Engine queues, the maximum allowed value is 500. * This field + * is output only for [pull + * queues](google.cloud.tasks.v2beta2.PullTarget). In addition to the + * `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of + * LeaseTasks requests are allowed per pull queue. This field has the + * same meaning as [rate in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#rate). + */ + maxTasksDispatchedPerSecond: number; } - - /** - * cloudtasks.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // The resource that owns the locations collection, if applicable. - * name: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var locationsPage = response['locations']; - * if (!locationsPage) { - * return; - * } - * for (var i = 0; i < locationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `locationsPage`: console.log(JSON.stringify(locationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for renewing a lease using RenewLease. + */ + export interface Schema$RenewLeaseRequest { + /** + * Required. The desired new lease duration, starting from now. The + * maximum lease duration is 1 week. `lease_duration` will be truncated to + * the nearest second. + */ + leaseDuration: string; + /** + * The response_view specifies which subset of the Task will be returned. By + * default response_view is BASIC; not all information is retrieved by + * default because some data, such as payloads, might be desirable to return + * only when needed because of its large size or because of the sensitivity + * of data that it contains. Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task + * resource. + */ + responseView: string; + /** + * Required. The task's current schedule time, available in the + * schedule_time returned by LeaseTasks response or RenewLease response. + * This restriction is to ensure that your worker currently holds the lease. + */ + scheduleTime: string; } -} -export class Resource$Projects$Locations$Queues { - root: Cloudtasks; - tasks: Resource$Projects$Locations$Queues$Tasks; - constructor(root: Cloudtasks) { - this.root = root; - this.getRoot.bind(this); - this.tasks = new Resource$Projects$Locations$Queues$Tasks(root); + /** + * Request message for ResumeQueue. + */ + export interface Schema$ResumeQueueRequest {} + /** + * Retry config. These settings determine how a failed task attempt is + * retried. + */ + export interface Schema$RetryConfig { + /** + * The maximum number of attempts for a task. Cloud Tasks will attempt the + * task `max_attempts` times (that is, if the first attempt fails, then + * there will be `max_attempts - 1` retries). Must be > 0. + */ + maxAttempts: number; + /** + * A task will be [scheduled](Task.schedule_time) for retry between + * min_backoff and max_backoff duration after it fails, if the queue's + * RetryConfig specifies that the task should be retried. If unspecified + * when the queue is created, Cloud Tasks will pick the default. This field + * is output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). + * `max_backoff` will be truncated to the nearest second. This field has + * the same meaning as [max_backoff_seconds in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxBackoff: string; + /** + * The time between retries will double `max_doublings` times. A task's + * retry interval starts at min_backoff, then doubles `max_doublings` times, + * then increases linearly, and finally retries retries at intervals of + * max_backoff up to max_attempts times. For example, if min_backoff is + * 10s, max_backoff is 300s, and `max_doublings` is 3, then the a task will + * first be retried in 10s. The retry interval will double three times, and + * then increase linearly by 2^3 * 10s. Finally, the task will retry at + * intervals of max_backoff until the task has been attempted max_attempts + * times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, + * 300s, 300s, .... If unspecified when the queue is created, Cloud Tasks + * will pick the default. This field is output only for [pull + * queues](google.cloud.tasks.v2beta2.PullTarget). This field has the same + * meaning as [max_doublings in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxDoublings: number; + /** + * If positive, `max_retry_duration` specifies the time limit for retrying a + * failed task, measured from when the task was first attempted. Once + * `max_retry_duration` time has passed *and* the task has been attempted + * max_attempts times, no further attempts will be made and the task will be + * deleted. If zero, then the task age is unlimited. If unspecified when + * the queue is created, Cloud Tasks will pick the default. This field is + * output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). + * `max_retry_duration` will be truncated to the nearest second. This field + * has the same meaning as [task_age_limit in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + maxRetryDuration: string; + /** + * A task will be [scheduled](Task.schedule_time) for retry between + * min_backoff and max_backoff duration after it fails, if the queue's + * RetryConfig specifies that the task should be retried. If unspecified + * when the queue is created, Cloud Tasks will pick the default. This field + * is output only for [pull queues](google.cloud.tasks.v2beta2.PullTarget). + * `min_backoff` will be truncated to the nearest second. This field has + * the same meaning as [min_backoff_seconds in + * queue.yaml/xml](/appengine/docs/standard/python/config/queueref#retry_parameters). + */ + minBackoff: string; + /** + * If true, then the number of attempts is unlimited. + */ + unlimitedAttempts: boolean; } - - getRoot() { - return this.root; + /** + * Request message for forcing a task to run now using RunTask. + */ + export interface Schema$RunTaskRequest { + /** + * The response_view specifies which subset of the Task will be returned. By + * default response_view is BASIC; not all information is retrieved by + * default because some data, such as payloads, might be desirable to return + * only when needed because of its large size or because of the sensitivity + * of data that it contains. Authorization for FULL requires + * `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task + * resource. + */ + responseView: string; } - - /** - * cloudtasks.projects.locations.queues.create - * @desc Creates a queue. Queues created with this method allow tasks to live - * for a maximum of 31 days. After a task is 31 days old, the task will be - * deleted regardless of whether it was dispatched or not. WARNING: Using - * this method may have unintended side effects if you are using an App Engine - * `queue.yaml` or `queue.xml` file to manage your queues. Read [Overview of - * Queue Management and queue.yaml](/cloud-tasks/docs/queue-yaml) before using - * this method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name in which the queue will be created. - * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * // The list of allowed locations can be obtained by calling Cloud - * // Tasks' implementation of - * // google.cloud.location.Locations.ListLocations. - * parent: 'projects/my-project/locations/my-location', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.create(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud Tasks' implementation of ListLocations. - * @param {().Queue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `SetIamPolicy` method. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/queues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; } - - /** - * cloudtasks.projects.locations.queues.delete - * @desc Deletes a queue. This command will delete the queue even if it has - * tasks in it. Note: If you delete a queue, a queue with the same name can't - * be created for 7 days. WARNING: Using this method may have unintended side - * effects if you are using an App Engine `queue.yaml` or `queue.xml` file to - * manage your queues. Read [Overview of Queue Management and - * queue.yaml](/cloud-tasks/docs/queue-yaml) before using this method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * cloudtasks.projects.locations.queues.get - * @desc Gets a queue. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The resource name of the queue. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A unit of scheduled work. + */ + export interface Schema$Task { + /** + * App Engine HTTP request that is sent to the task's target. Can be set + * only if app_engine_http_target is set on the queue. An App Engine task + * is a task that has AppEngineHttpRequest set. + */ + appEngineHttpRequest: Schema$AppEngineHttpRequest; + /** + * Output only. The time that the task was created. `create_time` will be + * truncated to the nearest second. + */ + createTime: string; + /** + * The task name. The task name must have the following format: + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens + * (-), colons (:), or periods (.). For more information, see + * [Identifying + * projects](/resource-manager/docs/creating-managing-projects#identifying_projects) + * * `LOCATION_ID` is the canonical ID for the task's location. The + * list of available locations can be obtained by calling ListLocations. + * For more information, see https://cloud.google.com/about/locations/. * + * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens + * (-). The maximum length is 100 characters. * `TASK_ID` can contain only + * letters ([A-Za-z]), numbers ([0-9]), hyphens (-), or underscores (_). + * The maximum length is 500 characters. Optionally caller-specified in + * CreateTask. + */ + name: string; + /** + * LeaseTasks to process the task. Can be set only if pull_target is set on + * the queue. A pull task is a task that has PullMessage set. + */ + pullMessage: Schema$PullMessage; + /** + * The time when the task is scheduled to be attempted. For App Engine + * queues, this is when the task will be attempted or retried. For pull + * queues, this is the time when the task is available to be leased; if a + * task is currently leased, this is the time when the current lease + * expires, that is, the time that the task was leased plus the + * lease_duration. `schedule_time` will be truncated to the nearest + * microsecond. + */ + scheduleTime: string; + /** + * Output only. The task status. + */ + status: Schema$TaskStatus; + /** + * Output only. The view specifies which subset of the Task has been + * returned. + */ + view: string; } - - /** - * cloudtasks.projects.locations.queues.getIamPolicy - * @desc Gets the access control policy for a Queue. Returns an empty policy - * if the resource exists and does not have a policy set. Authorization - * requires the following [Google IAM](/iam) permission on the specified - * resource parent: * `cloudtasks.queues.getIamPolicy` - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: - * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Status of the task. + */ + export interface Schema$TaskStatus { + /** + * Output only. The number of attempts dispatched. This count includes + * tasks which have been dispatched but haven't received a response. + */ + attemptDispatchCount: number; + /** + * Output only. The number of attempts which have received a response. This + * field is not calculated for [pull + * tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + attemptResponseCount: number; + /** + * Output only. The status of the task's first attempt. Only + * dispatch_time will be set. The other AttemptStatus information is not + * retained by Cloud Tasks. This field is not calculated for [pull + * tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + firstAttemptStatus: Schema$AttemptStatus; + /** + * Output only. The status of the task's last attempt. This field is + * not calculated for [pull + * tasks](google.cloud.tasks.v2beta2.PullTaskTarget). + */ + lastAttemptStatus: Schema$AttemptStatus; } - - /** - * cloudtasks.projects.locations.queues.list - * @desc Lists queues. Queues are returned in lexicographical order. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The location name. - * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * parent: 'projects/my-project/locations/my-location', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var queuesPage = response['queues']; - * if (!queuesPage) { - * return; - * } - * for (var i = 0; i < queuesPage.length; i++) { - * // TODO: Change code below to process each resource in `queuesPage`: - * console.log(JSON.stringify(queuesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter `filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as described in [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters). Sample filter "app_engine_http_target: *". Note that using filters might cause fewer queues than the requested_page size to be returned. - * @param {integer=} params.pageSize Requested page size. The maximum page size is 9800. If unspecified, the page size will be the maximum. Fewer queues than requested might be returned, even if more queues exist; use the next_page_token in the response to determine if more queues exist. - * @param {string=} params.pageToken A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListQueues method. It is an error to switch the value of the filter while iterating through pages. - * @param {string} params.parent Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `TestIamPermissions` method. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/queues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * cloudtasks.projects.locations.queues.patch - * @desc Updates a queue. This method creates the queue if it does not exist - * and updates the queue if it does exist. Queues created with this method - * allow tasks to live for a maximum of 31 days. After a task is 31 days old, - * the task will be deleted regardless of whether it was dispatched or not. - * WARNING: Using this method may have unintended side effects if you are - * using an App Engine `queue.yaml` or `queue.xml` file to manage your queues. - * Read [Overview of Queue Management and - * queue.yaml](/cloud-tasks/docs/queue-yaml) before using this method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // The queue name. - * // The queue name must have the following format: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * // * `PROJECT_ID` can contain uppercase and lowercase letters, - * // numbers, hyphens, colons, and periods; that is, it must match - * // the regular expression: `[a-zA-Z\\d-:\\.]+`. - * // * `QUEUE_ID` can contain uppercase and lowercase letters, - * // numbers, and hyphens; that is, it must match the regular - * // expression: `[a-zA-Z\\d-]+`. The maximum length is 100 - * // characters. - * // Caller-specified and required in CreateQueueRequest, after which - * // it becomes output only. - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.patch(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The queue name. The queue name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters. Caller-specified and required in CreateQueue, after which it becomes output only. - * @param {string=} params.updateMask A mask used to specify which fields of the queue are being updated. If empty, then all fields will be updated. - * @param {().Queue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } + export class Resource$Projects { + root: Cloudtasks; + locations: Resource$Projects$Locations; + constructor(root: Cloudtasks) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); + } - /** - * cloudtasks.projects.locations.queues.pause - * @desc Pauses the queue. If a queue is paused then the system will stop - * dispatching tasks until the queue is resumed via ResumeQueue. Tasks can - * still be added when the queue is paused. A queue is paused if its state is - * PAUSED. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.pause(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.pause - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {().PauseQueueRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pause(params?: any, options?: MethodOptions): AxiosPromise; - pause( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pause( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations { + root: Cloudtasks; + queues: Resource$Projects$Locations$Queues; + constructor(root: Cloudtasks) { + this.root = root; + this.getRoot.bind(this); + this.queues = new Resource$Projects$Locations$Queues(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:pause') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudtasks.projects.locations.queues.purge - * @desc Purges a queue by deleting all of its tasks. All tasks created - * before this method is called are permanently deleted. Purge operations can - * take up to one minute to take effect. Tasks might be dispatched before the - * purge takes effect. A purge is irreversible. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.purge(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.purge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {().PurgeQueueRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - purge(params?: any, options?: MethodOptions): AxiosPromise; - purge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - purge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.get + * @desc Gets information about a location. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Resource name for the location. + * name: 'projects/my-project/locations/my-location', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:purge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudtasks.projects.locations.queues.resume - * @desc Resume a queue. This method resumes a queue after it has been PAUSED - * or DISABLED. The state of a queue is stored in the queue's state; after - * calling this method it will be set to RUNNING. WARNING: Resuming many - * high-QPS queues at the same time can lead to target overloading. If you are - * resuming high-QPS queues, follow the 500/50/5 pattern described in - * [Managing Cloud Tasks Scaling - * Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * name: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.resume(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.resume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` - * @param {().ResumeQueueRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resume(params?: any, options?: MethodOptions): AxiosPromise; - resume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // The resource that owns the locations collection, if applicable. + * name: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var locationsPage = response['locations']; + * if (!locationsPage) { + * return; + * } + * for (var i = 0; i < locationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `locationsPage`: console.log(JSON.stringify(locationsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudTasks.projects.locations.list(request, handlePage); + * } + * }; + * + * cloudTasks.projects.locations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Queues { + root: Cloudtasks; + tasks: Resource$Projects$Locations$Queues$Tasks; + constructor(root: Cloudtasks) { + this.root = root; + this.getRoot.bind(this); + this.tasks = new Resource$Projects$Locations$Queues$Tasks(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:resume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudtasks.projects.locations.queues.setIamPolicy - * @desc Sets the access control policy for a Queue. Replaces any existing - * policy. Note: The Cloud Console does not check queue-level IAM permissions - * yet. Project-level permissions are required to use the Cloud Console. - * Authorization requires the following [Google IAM](/iam) permission on the - * specified resource parent: * `cloudtasks.queues.setIamPolicy` - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: - * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.create + * @desc Creates a queue. Queues created with this method allow tasks to + * live for a maximum of 31 days. After a task is 31 days old, the task will + * be deleted regardless of whether it was dispatched or not. WARNING: + * Using this method may have unintended side effects if you are using an + * App Engine `queue.yaml` or `queue.xml` file to manage your queues. Read + * [Overview of Queue Management and + * queue.yaml](/cloud-tasks/docs/queue-yaml) before using this method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The location name in which the queue will be created. + * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * // The list of allowed locations can be obtained by calling Cloud + * // Tasks' implementation of + * // google.cloud.location.Locations.ListLocations. + * parent: 'projects/my-project/locations/my-location', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.create(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The location name in which the queue will be created. For example: `projects/PROJECT_ID/locations/LOCATION_ID` The list of allowed locations can be obtained by calling Cloud Tasks' implementation of ListLocations. + * @param {().Queue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/queues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudtasks.projects.locations.queues.testIamPermissions - * @desc Returns permissions that a caller has on a Queue. If the resource - * does not exist, this will return an empty set of permissions, not a - * NOT_FOUND error. Note: This operation is designed to be used for building - * permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: - * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.testIamPermissions(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * cloudtasks.projects.locations.queues.delete + * @desc Deletes a queue. This command will delete the queue even if it has + * tasks in it. Note: If you delete a queue, a queue with the same name + * can't be created for 7 days. WARNING: Using this method may have + * unintended side effects if you are using an App Engine `queue.yaml` or + * `queue.xml` file to manage your queues. Read [Overview of Queue + * Management and queue.yaml](/cloud-tasks/docs/queue-yaml) before using + * this method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Locations$Queues$Tasks { - root: Cloudtasks; - constructor(root: Cloudtasks) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * cloudtasks.projects.locations.queues.tasks.acknowledge - * @desc Acknowledges a pull task. The worker, that is, the entity that - * leased this task must call this method to indicate that the work associated - * with the task has finished. The worker must acknowledge a task within the - * lease_duration or the lease will expire and the task will become available - * to be leased again. After the task is acknowledged, it will not be returned - * by a later LeaseTasks, GetTask, or ListTasks. To acknowledge multiple - * tasks at the same time, use [HTTP - * batching](/storage/docs/json_api/v1/how-tos/batch) or the batching - * documentation for your client library, for example - * https://developers.google.com/api-client-library/python/guide/batch. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.acknowledge(request, - * function(err) { if (err) { console.error(err); return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {().AcknowledgeTaskRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudtasks.projects.locations.queues.get + * @desc Gets a queue. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The resource name of the queue. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the queue. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudtasks.projects.locations.queues.tasks.cancelLease - * @desc Cancel a pull task's lease. The worker can use this method to cancel - * a task's lease by setting its schedule_time to now. This will make the task - * available to be leased to the next caller of LeaseTasks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.cancelLease(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.cancelLease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {().CancelLeaseRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancelLease(params?: any, options?: MethodOptions): AxiosPromise; - cancelLease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancelLease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudtasks.projects.locations.queues.getIamPolicy + * @desc Gets the access control policy for a Queue. Returns an empty policy + * if the resource exists and does not have a policy set. Authorization + * requires the following [Google IAM](/iam) permission on the specified + * resource parent: * `cloudtasks.queues.getIamPolicy` + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: + * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.getIamPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:cancelLease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudtasks.projects.locations.queues.tasks.create - * @desc Creates a task and adds it to a queue. To add multiple tasks at the - * same time, use [HTTP batching](/storage/docs/json_api/v1/how-tos/batch) or - * the batching documentation for your client library, for example - * https://developers.google.com/api-client-library/python/guide/batch. Tasks - * cannot be updated after creation; there is no UpdateTask command. * For - * [App Engine queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), the - * maximum task size is 100KB. * For [pull - * queues](google.cloud.tasks.v2beta2.PullTarget), this the maximum task - * size is 1MB. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * // The queue must already exist. - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.create(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. - * @param {().CreateTaskRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudtasks.projects.locations.queues.list + * @desc Lists queues. Queues are returned in lexicographical order. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The location name. + * // For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * parent: 'projects/my-project/locations/my-location', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var queuesPage = response['queues']; + * if (!queuesPage) { + * return; + * } + * for (var i = 0; i < queuesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `queuesPage`: console.log(JSON.stringify(queuesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudTasks.projects.locations.queues.list(request, handlePage); + * } + * }; + * + * cloudTasks.projects.locations.queues.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter `filter` can be used to specify a subset of queues. Any Queue field can be used as a filter and several operators as supported. For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as described in [Stackdriver's Advanced Logs Filters](/logging/docs/view/advanced_filters). Sample filter "app_engine_http_target: *". Note that using filters might cause fewer queues than the requested_page size to be returned. + * @param {integer=} params.pageSize Requested page size. The maximum page size is 9800. If unspecified, the page size will be the maximum. Fewer queues than requested might be returned, even if more queues exist; use the next_page_token in the response to determine if more queues exist. + * @param {string=} params.pageToken A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListQueues method. It is an error to switch the value of the filter while iterating through pages. + * @param {string} params.parent Required. The location name. For example: `projects/PROJECT_ID/locations/LOCATION_ID` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/queues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * cloudtasks.projects.locations.queues.tasks.delete - * @desc Deletes a task. A task can be deleted if it is scheduled or - * dispatched. A task cannot be deleted if it has completed successfully or - * permanently failed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.delete(request, function(err) - * { if (err) { console.error(err); return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * cloudtasks.projects.locations.queues.patch + * @desc Updates a queue. This method creates the queue if it does not + * exist and updates the queue if it does exist. Queues created with this + * method allow tasks to live for a maximum of 31 days. After a task is 31 + * days old, the task will be deleted regardless of whether it was + * dispatched or not. WARNING: Using this method may have unintended side + * effects if you are using an App Engine `queue.yaml` or `queue.xml` file + * to manage your queues. Read [Overview of Queue Management and + * queue.yaml](/cloud-tasks/docs/queue-yaml) before using this method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // The queue name. + * // The queue name must have the following format: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // * `PROJECT_ID` can contain uppercase and lowercase letters, + * // numbers, hyphens, colons, and periods; that is, it must match + * // the regular expression: `[a-zA-Z\\d-:\\.]+`. + * // * `QUEUE_ID` can contain uppercase and lowercase letters, + * // numbers, and hyphens; that is, it must match the regular + * // expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + * // characters. + * // Caller-specified and required in CreateQueueRequest, after which + * // it becomes output only. + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The queue name. The queue name must have the following format: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see [Identifying projects](/resource-manager/docs/creating-managing-projects#identifying_projects) * `LOCATION_ID` is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters. Caller-specified and required in CreateQueue, after which it becomes output only. + * @param {string=} params.updateMask A mask used to specify which fields of the queue are being updated. If empty, then all fields will be updated. + * @param {().Queue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtasks.projects.locations.queues.pause + * @desc Pauses the queue. If a queue is paused then the system will stop + * dispatching tasks until the queue is resumed via ResumeQueue. Tasks can + * still be added when the queue is paused. A queue is paused if its state + * is PAUSED. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.pause(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.pause + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {().PauseQueueRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pause(params?: any, options?: MethodOptions): AxiosPromise; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:pause') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudtasks.projects.locations.queues.tasks.get - * @desc Gets a task. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {string=} params.responseView The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.purge + * @desc Purges a queue by deleting all of its tasks. All tasks created + * before this method is called are permanently deleted. Purge operations + * can take up to one minute to take effect. Tasks might be dispatched + * before the purge takes effect. A purge is irreversible. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.purge(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.purge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {().PurgeQueueRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + purge(params?: any, options?: MethodOptions): AxiosPromise; + purge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + purge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:purge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudtasks.projects.locations.queues.resume + * @desc Resume a queue. This method resumes a queue after it has been + * PAUSED or DISABLED. The state of a queue is stored in the queue's state; + * after calling this method it will be set to RUNNING. WARNING: Resuming + * many high-QPS queues at the same time can lead to target overloading. If + * you are resuming high-QPS queues, follow the 500/50/5 pattern described + * in [Managing Cloud Tasks Scaling + * Risks](/cloud-tasks/pdfs/managing-cloud-tasks-scaling-risks-2017-06-05.pdf). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * name: 'projects/my-project/locations/my-location/queues/my-queue', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.resume(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.resume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The queue name. For example: `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID` + * @param {().ResumeQueueRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resume(params?: any, options?: MethodOptions): AxiosPromise; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:resume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtasks.projects.locations.queues.setIamPolicy + * @desc Sets the access control policy for a Queue. Replaces any existing + * policy. Note: The Cloud Console does not check queue-level IAM + * permissions yet. Project-level permissions are required to use the Cloud + * Console. Authorization requires the following [Google IAM](/iam) + * permission on the specified resource parent: * + * `cloudtasks.queues.setIamPolicy` + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: + * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.setIamPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudtasks.projects.locations.queues.tasks.lease - * @desc Leases tasks from a pull queue for lease_duration. This method is - * invoked by the worker to obtain a lease. The worker must acknowledge the - * task via AcknowledgeTask after they have performed the work associated with - * the task. The payload is intended to store data that the worker needs to - * perform the work associated with the task. To return the payloads in the - * response, set response_view to FULL. A maximum of 10 qps of LeaseTasks - * requests are allowed per queue. RESOURCE_EXHAUSTED is returned when this - * limit is exceeded. RESOURCE_EXHAUSTED is also returned when - * max_tasks_dispatched_per_second is exceeded. - * @alias cloudtasks.projects.locations.queues.tasks.lease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {().LeaseTasksRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lease(params?: any, options?: MethodOptions): - AxiosPromise; - lease( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lease( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.testIamPermissions + * @desc Returns permissions that a caller has on a Queue. If the resource + * does not exist, this will return an empty set of permissions, not a + * NOT_FOUND error. Note: This operation is designed to be used for + * building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: + * 'projects/my-project/locations/my-location/queues/my-queue', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.testIamPermissions(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Queues$Tasks { + root: Cloudtasks; + constructor(root: Cloudtasks) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/tasks:lease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudtasks.projects.locations.queues.tasks.list - * @desc Lists the tasks in a queue. By default, only the BASIC view is - * retrieved due to performance considerations; response_view controls the - * subset of information which is returned. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The queue name. For example: - * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * parent: 'projects/my-project/locations/my-location/queues/my-queue', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tasksPage = response['tasks']; - * if (!tasksPage) { - * return; - * } - * for (var i = 0; i < tasksPage.length; i++) { - * // TODO: Change code below to process each resource in `tasksPage`: - * console.log(JSON.stringify(tasksPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * } - * }; - * - * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.orderBy Sort order used for the query. The only fields supported for sorting are `schedule_time` and `pull_message.tag`. All results will be returned in approximately ascending order. The default ordering is by `schedule_time`. - * @param {integer=} params.pageSize Requested page size. Fewer tasks than requested might be returned. The maximum page size is 1000. If unspecified, the page size will be the maximum. Fewer tasks than requested might be returned, even if more tasks exist; use next_page_token in the response to determine if more tasks exist. - * @param {string=} params.pageToken A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListTasks method. The page token is valid for only 2 hours. - * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` - * @param {string=} params.responseView The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.tasks.acknowledge + * @desc Acknowledges a pull task. The worker, that is, the entity that + * leased this task must call this method to indicate that the work + * associated with the task has finished. The worker must acknowledge a + * task within the lease_duration or the lease will expire and the task will + * become available to be leased again. After the task is acknowledged, it + * will not be returned by a later LeaseTasks, GetTask, or ListTasks. To + * acknowledge multiple tasks at the same time, use [HTTP + * batching](/storage/docs/json_api/v1/how-tos/batch) or the batching + * documentation for your client library, for example + * https://developers.google.com/api-client-library/python/guide/batch. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.acknowledge(request, + * function(err) { if (err) { console.error(err); return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {().AcknowledgeTaskRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudtasks.projects.locations.queues.tasks.cancelLease + * @desc Cancel a pull task's lease. The worker can use this method to + * cancel a task's lease by setting its schedule_time to now. This will make + * the task available to be leased to the next caller of LeaseTasks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.cancelLease(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.cancelLease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {().CancelLeaseRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancelLease(params?: any, options?: MethodOptions): + AxiosPromise; + cancelLease( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancelLease( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:cancelLease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtasks.projects.locations.queues.tasks.create + * @desc Creates a task and adds it to a queue. To add multiple tasks at + * the same time, use [HTTP + * batching](/storage/docs/json_api/v1/how-tos/batch) or the batching + * documentation for your client library, for example + * https://developers.google.com/api-client-library/python/guide/batch. + * Tasks cannot be updated after creation; there is no UpdateTask command. + * * For [App Engine + * queues](google.cloud.tasks.v2beta2.AppEngineHttpTarget), the maximum + * task size is 100KB. * For [pull + * queues](google.cloud.tasks.v2beta2.PullTarget), this the maximum task + * size is 1MB. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * // The queue must already exist. + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.create(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist. + * @param {().CreateTaskRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudtasks.projects.locations.queues.tasks.renewLease - * @desc Renew the current lease of a pull task. The worker can use this - * method to extend the lease by a new duration, starting from now. The new - * task lease will be returned in the task's schedule_time. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.renewLease(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.renewLease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {().RenewLeaseRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - renewLease(params?: any, options?: MethodOptions): AxiosPromise; - renewLease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - renewLease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.tasks.delete + * @desc Deletes a task. A task can be deleted if it is scheduled or + * dispatched. A task cannot be deleted if it has completed successfully or + * permanently failed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.delete(request, + * function(err) { if (err) { console.error(err); return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudtasks.projects.locations.queues.tasks.get + * @desc Gets a task. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {string=} params.responseView The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:renewLease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtasks.projects.locations.queues.tasks.lease + * @desc Leases tasks from a pull queue for lease_duration. This method is + * invoked by the worker to obtain a lease. The worker must acknowledge the + * task via AcknowledgeTask after they have performed the work associated + * with the task. The payload is intended to store data that the worker + * needs to perform the work associated with the task. To return the + * payloads in the response, set response_view to FULL. A maximum of 10 qps + * of LeaseTasks requests are allowed per queue. RESOURCE_EXHAUSTED is + * returned when this limit is exceeded. RESOURCE_EXHAUSTED is also returned + * when max_tasks_dispatched_per_second is exceeded. + * @alias cloudtasks.projects.locations.queues.tasks.lease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {().LeaseTasksRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lease(params?: any, options?: MethodOptions): + AxiosPromise; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/tasks:lease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * cloudtasks.projects.locations.queues.tasks.run - * @desc Forces a task to run now. This command is meant to be used for - * manual debugging. For example, RunTask can be used to retry a failed task - * after a fix has been made or to manually force a task to be dispatched now. - * When this method is called, Cloud Tasks will dispatch the task to its - * target, even if the queue is PAUSED. The dispatched task is returned. That - * is, the task that is returned contains the status after the task is - * dispatched but before the task is received by its target. If Cloud Tasks - * receives a successful response from the task's handler, then the task will - * be deleted; otherwise the task's schedule_time will be reset to the time - * that RunTask was called plus the retry delay specified in the queue and - * task's RetryConfig. RunTask returns NOT_FOUND when it is called on a task - * that has already succeeded or permanently failed. FAILED_PRECONDITION is - * returned when RunTask is called on task that is dispatched or already - * running. RunTask cannot be called on pull tasks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Tasks API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtasks - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTasks = google.cloudtasks('v2beta2'); - * - * authorize(function(authClient) { - * var request = { - * // Required. - * // The task name. For example: - * // - * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * name: - * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', - * // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * cloudTasks.projects.locations.queues.tasks.run(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtasks.projects.locations.queues.tasks.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` - * @param {().RunTaskRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtasks.projects.locations.queues.tasks.list + * @desc Lists the tasks in a queue. By default, only the BASIC view is + * retrieved due to performance considerations; response_view controls the + * subset of information which is returned. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The queue name. For example: + * // `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * parent: 'projects/my-project/locations/my-location/queues/my-queue', + * // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var tasksPage = response['tasks']; + * if (!tasksPage) { + * return; + * } + * for (var i = 0; i < tasksPage.length; i++) { + * // TODO: Change code below to process each resource in `tasksPage`: + * console.log(JSON.stringify(tasksPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudTasks.projects.locations.queues.tasks.list(request, + * handlePage); + * } + * }; + * + * cloudTasks.projects.locations.queues.tasks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.orderBy Sort order used for the query. The only fields supported for sorting are `schedule_time` and `pull_message.tag`. All results will be returned in approximately ascending order. The default ordering is by `schedule_time`. + * @param {integer=} params.pageSize Requested page size. Fewer tasks than requested might be returned. The maximum page size is 1000. If unspecified, the page size will be the maximum. Fewer tasks than requested might be returned, even if more tasks exist; use next_page_token in the response to determine if more tasks exist. + * @param {string=} params.pageToken A token identifying the page of results to return. To request the first page results, page_token must be empty. To request the next page of results, page_token must be the value of next_page_token returned from the previous call to ListTasks method. The page token is valid for only 2 hours. + * @param {string} params.parent Required. The queue name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` + * @param {string=} params.responseView The response_view specifies which subset of the Task will be returned. By default response_view is BASIC; not all information is retrieved by default because some data, such as payloads, might be desirable to return only when needed because of its large size or because of the sensitivity of data that it contains. Authorization for FULL requires `cloudtasks.tasks.fullView` [Google IAM](/iam/) permission on the Task resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * cloudtasks.projects.locations.queues.tasks.renewLease + * @desc Renew the current lease of a pull task. The worker can use this + * method to extend the lease by a new duration, starting from now. The new + * task lease will be returned in the task's schedule_time. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.renewLease(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.renewLease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {().RenewLeaseRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + renewLease(params?: any, options?: MethodOptions): + AxiosPromise; + renewLease( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + renewLease( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:renewLease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtasks.projects.locations.queues.tasks.run + * @desc Forces a task to run now. This command is meant to be used for + * manual debugging. For example, RunTask can be used to retry a failed task + * after a fix has been made or to manually force a task to be dispatched + * now. When this method is called, Cloud Tasks will dispatch the task to + * its target, even if the queue is PAUSED. The dispatched task is + * returned. That is, the task that is returned contains the status after + * the task is dispatched but before the task is received by its target. If + * Cloud Tasks receives a successful response from the task's handler, then + * the task will be deleted; otherwise the task's schedule_time will be + * reset to the time that RunTask was called plus the retry delay specified + * in the queue and task's RetryConfig. RunTask returns NOT_FOUND when it + * is called on a task that has already succeeded or permanently failed. + * FAILED_PRECONDITION is returned when RunTask is called on task that is + * dispatched or already running. RunTask cannot be called on pull tasks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Tasks API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtasks + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTasks = google.cloudtasks('v2beta2'); + * + * authorize(function(authClient) { + * var request = { + * // Required. + * // The task name. For example: + * // + * `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * name: + * 'projects/my-project/locations/my-location/queues/my-queue/tasks/my-task', + * // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * cloudTasks.projects.locations.queues.tasks.run(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtasks.projects.locations.queues.tasks.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The task name. For example: `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` + * @param {().RunTaskRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtasks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudtrace/v1.ts b/src/apis/cloudtrace/v1.ts index 30e56acd893..c52cf0c6d69 100644 --- a/src/apis/cloudtrace/v1.ts +++ b/src/apis/cloudtrace/v1.ts @@ -27,519 +27,531 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Trace API - * - * Sends application trace data to Stackdriver Trace for viewing. Trace data is - * collected for all App Engine applications by default. Trace data from other - * applications can be provided using this API. - * - * @example - * const google = require('googleapis'); - * const cloudtrace = google.cloudtrace('v1'); - * - * @namespace cloudtrace - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Cloudtrace - */ -export class Cloudtrace { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudtrace_v1 { + /** + * Stackdriver Trace API + * + * Sends application trace data to Stackdriver Trace for viewing. Trace data + * is collected for all App Engine applications by default. Trace data from + * other applications can be provided using this API. + * + * @example + * const google = require('googleapis'); + * const cloudtrace = google.cloudtrace('v1'); + * + * @namespace cloudtrace + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Cloudtrace + */ + export class Cloudtrace { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The response message for the `ListTraces` method. - */ -export interface Schema$ListTracesResponse { /** - * If defined, indicates that there are more traces that match the request and - * that this value should be passed to the next request to continue retrieving - * additional traces. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - nextPageToken: string; + export interface Schema$Empty {} /** - * List of trace records returned. + * The response message for the `ListTraces` method. */ - traces: Schema$Trace[]; -} -/** - * A trace describes how long it takes for an application to perform an - * operation. It consists of a set of spans, each of which represent a single - * timed event within the operation. - */ -export interface Schema$Trace { - /** - * Project ID of the Cloud project where the trace data is stored. - */ - projectId: string; - /** - * Collection of spans in the trace. - */ - spans: Schema$TraceSpan[]; - /** - * Globally unique identifier for the trace. This identifier is a 128-bit - * numeric value formatted as a 32-byte hex string. - */ - traceId: string; -} -/** - * List of new or updated traces. - */ -export interface Schema$Traces { - /** - * List of traces. - */ - traces: Schema$Trace[]; -} -/** - * A span represents a single timed event within a trace. Spans can be nested - * and form a trace tree. Often, a trace contains a root span that describes the - * end-to-end latency of an operation and, optionally, one or more subspans for - * its suboperations. Spans do not need to be contiguous. There may be gaps - * between spans in a trace. - */ -export interface Schema$TraceSpan { - /** - * End time of the span in nanoseconds from the UNIX epoch. - */ - endTime: string; - /** - * Distinguishes between spans generated in a particular context. For example, - * two spans with the same name may be distinguished using `RPC_CLIENT` and - * `RPC_SERVER` to identify queueing latency associated with the span. - */ - kind: string; - /** - * Collection of labels associated with the span. Label keys must be less than - * 128 bytes. Label values must be less than 16 kilobytes (10MB for - * `/stacktrace` values). Some predefined label keys exist, or you may create - * your own. When creating your own, we recommend the following formats: * - * `/category/product/key` for agents of well-known products (e.g. - * `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys - * (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` - * * `/component` * `/error/message` * `/error/name` * - * `/http/client_city` * `/http/client_country` * `/http/client_protocol` - * * `/http/client_region` * `/http/host` * `/http/method` * - * `/http/path` * `/http/redirected_url` * `/http/request/size` * - * `/http/response/size` * `/http/route` * `/http/status_code` * - * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid` - */ - labels: any; - /** - * Name of the span. Must be less than 128 bytes. The span name is sanitized - * and displayed in the Stackdriver Trace tool in the {% dynamic print - * site_values.console_name %}. The name may be a method name or some other - * per-call site name. For the same executable and the same call point, a best - * practice is to use a consistent name, which makes it easier to correlate - * cross-trace spans. - */ - name: string; + export interface Schema$ListTracesResponse { + /** + * If defined, indicates that there are more traces that match the request + * and that this value should be passed to the next request to continue + * retrieving additional traces. + */ + nextPageToken: string; + /** + * List of trace records returned. + */ + traces: Schema$Trace[]; + } /** - * ID of the parent span, if any. Optional. + * A trace describes how long it takes for an application to perform an + * operation. It consists of a set of spans, each of which represent a single + * timed event within the operation. */ - parentSpanId: string; + export interface Schema$Trace { + /** + * Project ID of the Cloud project where the trace data is stored. + */ + projectId: string; + /** + * Collection of spans in the trace. + */ + spans: Schema$TraceSpan[]; + /** + * Globally unique identifier for the trace. This identifier is a 128-bit + * numeric value formatted as a 32-byte hex string. + */ + traceId: string; + } /** - * Identifier for the span. Must be a 64-bit integer other than 0 and unique - * within a trace. + * List of new or updated traces. */ - spanId: string; + export interface Schema$Traces { + /** + * List of traces. + */ + traces: Schema$Trace[]; + } /** - * Start time of the span in nanoseconds from the UNIX epoch. + * A span represents a single timed event within a trace. Spans can be nested + * and form a trace tree. Often, a trace contains a root span that describes + * the end-to-end latency of an operation and, optionally, one or more + * subspans for its suboperations. Spans do not need to be contiguous. There + * may be gaps between spans in a trace. */ - startTime: string; -} - -export class Resource$Projects { - root: Cloudtrace; - traces: Resource$Projects$Traces; - constructor(root: Cloudtrace) { - this.root = root; - this.getRoot.bind(this); - this.traces = new Resource$Projects$Traces(root); + export interface Schema$TraceSpan { + /** + * End time of the span in nanoseconds from the UNIX epoch. + */ + endTime: string; + /** + * Distinguishes between spans generated in a particular context. For + * example, two spans with the same name may be distinguished using + * `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated + * with the span. + */ + kind: string; + /** + * Collection of labels associated with the span. Label keys must be less + * than 128 bytes. Label values must be less than 16 kilobytes (10MB for + * `/stacktrace` values). Some predefined label keys exist, or you may + * create your own. When creating your own, we recommend the following + * formats: * `/category/product/key` for agents of well-known products + * (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for + * domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels + * include: * `/agent` * `/component` * `/error/message` * + * `/error/name` * `/http/client_city` * `/http/client_country` * + * `/http/client_protocol` * `/http/client_region` * `/http/host` * + * `/http/method` * `/http/path` * `/http/redirected_url` * + * `/http/request/size` * `/http/response/size` * `/http/route` * + * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * + * `/stacktrace` * `/tid` + */ + labels: any; + /** + * Name of the span. Must be less than 128 bytes. The span name is sanitized + * and displayed in the Stackdriver Trace tool in the {% dynamic print + * site_values.console_name %}. The name may be a method name or some other + * per-call site name. For the same executable and the same call point, a + * best practice is to use a consistent name, which makes it easier to + * correlate cross-trace spans. + */ + name: string; + /** + * ID of the parent span, if any. Optional. + */ + parentSpanId: string; + /** + * Identifier for the span. Must be a 64-bit integer other than 0 and unique + * within a trace. + */ + spanId: string; + /** + * Start time of the span in nanoseconds from the UNIX epoch. + */ + startTime: string; } - getRoot() { - return this.root; - } - - - /** - * cloudtrace.projects.patchTraces - * @desc Sends new traces to Stackdriver Trace or updates existing traces. If - * the ID of a trace that you send matches that of an existing trace, any - * fields in the existing trace and its spans are overwritten by the provided - * values, and any new fields provided are merged with the existing trace - * data. If the ID does not match, a new trace is created. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTrace = google.cloudtrace('v1'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * cloudTrace.projects.patchTraces(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtrace.projects.patchTraces - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the Cloud project where the trace data is stored. - * @param {().Traces} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patchTraces(params?: any, options?: MethodOptions): - AxiosPromise; - patchTraces( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patchTraces( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Cloudtrace; + traces: Resource$Projects$Traces; + constructor(root: Cloudtrace) { + this.root = root; + this.getRoot.bind(this); + this.traces = new Resource$Projects$Traces(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/traces') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Traces { - root: Cloudtrace; - constructor(root: Cloudtrace) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudtrace.projects.traces.get - * @desc Gets a single trace by its ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTrace = google.cloudtrace('v1'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // ID of the trace to return. - * traceId: 'my-trace-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * cloudTrace.projects.traces.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtrace.projects.traces.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId ID of the Cloud project where the trace data is stored. - * @param {string} params.traceId ID of the trace to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtrace.projects.patchTraces + * @desc Sends new traces to Stackdriver Trace or updates existing traces. + * If the ID of a trace that you send matches that of an existing trace, any + * fields in the existing trace and its spans are overwritten by the + * provided values, and any new fields provided are merged with the existing + * trace data. If the ID does not match, a new trace is created. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Trace API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtrace + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTrace = google.cloudtrace('v1'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the Cloud project where the trace data is stored. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * cloudTrace.projects.patchTraces(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtrace.projects.patchTraces + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the Cloud project where the trace data is stored. + * @param {().Traces} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patchTraces(params?: any, options?: MethodOptions): + AxiosPromise; + patchTraces( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patchTraces( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/traces') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Traces { + root: Cloudtrace; + constructor(root: Cloudtrace) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/traces/{traceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'traceId'], - pathParams: ['projectId', 'traceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * cloudtrace.projects.traces.list - * @desc Returns of a list of traces that match the specified filter - * conditions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Trace API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/cloudtrace - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var cloudTrace = google.cloudtrace('v1'); - * - * authorize(function(authClient) { - * var request = { - * // ID of the Cloud project where the trace data is stored. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var tracesPage = response['traces']; - * if (!tracesPage) { - * return; - * } - * for (var i = 0; i < tracesPage.length; i++) { - * // TODO: Change code below to process each resource in `tracesPage`: - * console.log(JSON.stringify(tracesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * cloudTrace.projects.traces.list(request, handlePage); - * } - * }; - * - * cloudTrace.projects.traces.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias cloudtrace.projects.traces.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.endTime End of the time interval (inclusive) during which the trace data was collected from the application. - * @param {string=} params.filter An optional filter against labels for the request. By default, searches use prefix matching. To specify exact match, prepend a plus symbol (`+`) to the search term. Multiple terms are ANDed. Syntax: * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root span starts with `NAME_PREFIX`. * `+root:NAME` or `+NAME`: Return traces where any root span's name is exactly `NAME`. * `span:NAME_PREFIX`: Return traces where any span starts with `NAME_PREFIX`. * `+span:NAME`: Return traces where any span's name is exactly `NAME`. * `latency:DURATION`: Return traces whose overall latency is greater or equal to than `DURATION`. Accepted units are nanoseconds (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For example, `latency:24ms` returns traces whose overall latency is greater than or equal to 24 milliseconds. * `label:LABEL_KEY`: Return all traces containing the specified label key (exact match, case-sensitive) regardless of the key:value pair's value (including empty values). * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified label key (exact match, case-sensitive) whose value starts with `VALUE_PREFIX`. Both a key and a value must be specified. * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair exactly matching the specified text. Both a key and a value must be specified. * `method:VALUE`: Equivalent to `/http/method:VALUE`. * `url:VALUE`: Equivalent to `/http/url:VALUE`. - * @param {string=} params.orderBy Field used to sort the returned traces. Optional. Can be one of the following: * `trace_id` * `name` (`name` field of root span in the trace) * `duration` (difference between `end_time` and `start_time` fields of the root span) * `start` (`start_time` field of the root span) Descending order can be specified by appending `desc` to the sort field (for example, `name desc`). Only one sort field is permitted. - * @param {integer=} params.pageSize Maximum number of traces to return. If not specified or <= 0, the implementation selects a reasonable value. The implementation may return fewer traces than the requested page size. Optional. - * @param {string=} params.pageToken Token identifying the page of results to return. If provided, use the value of the `next_page_token` field from a previous request. Optional. - * @param {string} params.projectId ID of the Cloud project where the trace data is stored. - * @param {string=} params.startTime Start of the time interval (inclusive) during which the trace data was collected from the application. - * @param {string=} params.view Type of data returned for traces in the list. Optional. Default is `MINIMAL`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtrace.projects.traces.get + * @desc Gets a single trace by its ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Trace API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtrace + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTrace = google.cloudtrace('v1'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the Cloud project where the trace data is stored. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // ID of the trace to return. + * traceId: 'my-trace-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * cloudTrace.projects.traces.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtrace.projects.traces.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId ID of the Cloud project where the trace data is stored. + * @param {string} params.traceId ID of the trace to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/traces/{traceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'traceId'], + pathParams: ['projectId', 'traceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/traces') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtrace.projects.traces.list + * @desc Returns of a list of traces that match the specified filter + * conditions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Trace API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/cloudtrace + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var cloudTrace = google.cloudtrace('v1'); + * + * authorize(function(authClient) { + * var request = { + * // ID of the Cloud project where the trace data is stored. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var tracesPage = response['traces']; + * if (!tracesPage) { + * return; + * } + * for (var i = 0; i < tracesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `tracesPage`: console.log(JSON.stringify(tracesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * cloudTrace.projects.traces.list(request, handlePage); + * } + * }; + * + * cloudTrace.projects.traces.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias cloudtrace.projects.traces.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.endTime End of the time interval (inclusive) during which the trace data was collected from the application. + * @param {string=} params.filter An optional filter against labels for the request. By default, searches use prefix matching. To specify exact match, prepend a plus symbol (`+`) to the search term. Multiple terms are ANDed. Syntax: * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root span starts with `NAME_PREFIX`. * `+root:NAME` or `+NAME`: Return traces where any root span's name is exactly `NAME`. * `span:NAME_PREFIX`: Return traces where any span starts with `NAME_PREFIX`. * `+span:NAME`: Return traces where any span's name is exactly `NAME`. * `latency:DURATION`: Return traces whose overall latency is greater or equal to than `DURATION`. Accepted units are nanoseconds (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For example, `latency:24ms` returns traces whose overall latency is greater than or equal to 24 milliseconds. * `label:LABEL_KEY`: Return all traces containing the specified label key (exact match, case-sensitive) regardless of the key:value pair's value (including empty values). * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified label key (exact match, case-sensitive) whose value starts with `VALUE_PREFIX`. Both a key and a value must be specified. * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair exactly matching the specified text. Both a key and a value must be specified. * `method:VALUE`: Equivalent to `/http/method:VALUE`. * `url:VALUE`: Equivalent to `/http/url:VALUE`. + * @param {string=} params.orderBy Field used to sort the returned traces. Optional. Can be one of the following: * `trace_id` * `name` (`name` field of root span in the trace) * `duration` (difference between `end_time` and `start_time` fields of the root span) * `start` (`start_time` field of the root span) Descending order can be specified by appending `desc` to the sort field (for example, `name desc`). Only one sort field is permitted. + * @param {integer=} params.pageSize Maximum number of traces to return. If not specified or <= 0, the implementation selects a reasonable value. The implementation may return fewer traces than the requested page size. Optional. + * @param {string=} params.pageToken Token identifying the page of results to return. If provided, use the value of the `next_page_token` field from a previous request. Optional. + * @param {string} params.projectId ID of the Cloud project where the trace data is stored. + * @param {string=} params.startTime Start of the time interval (inclusive) during which the trace data was collected from the application. + * @param {string=} params.view Type of data returned for traces in the list. Optional. Default is `MINIMAL`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/traces') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/cloudtrace/v2.ts b/src/apis/cloudtrace/v2.ts index 79a31314267..d108a1dc36d 100644 --- a/src/apis/cloudtrace/v2.ts +++ b/src/apis/cloudtrace/v2.ts @@ -27,591 +27,603 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Trace API - * - * Sends application trace data to Stackdriver Trace for viewing. Trace data is - * collected for all App Engine applications by default. Trace data from other - * applications can be provided using this API. - * - * @example - * const google = require('googleapis'); - * const cloudtrace = google.cloudtrace('v2'); - * - * @namespace cloudtrace - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Cloudtrace - */ -export class Cloudtrace { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace cloudtrace_v2 { + /** + * Stackdriver Trace API + * + * Sends application trace data to Stackdriver Trace for viewing. Trace data + * is collected for all App Engine applications by default. Trace data from + * other applications can be provided using this API. + * + * @example + * const google = require('googleapis'); + * const cloudtrace = google.cloudtrace('v2'); + * + * @namespace cloudtrace + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Cloudtrace + */ + export class Cloudtrace { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Text annotation with a set of attributes. - */ -export interface Schema$Annotation { - /** - * A set of attributes on the annotation. You can have up to 4 attributes per - * Annotation. - */ - attributes: Schema$Attributes; - /** - * A user-supplied message describing the event. The maximum length for the - * description is 256 bytes. - */ - description: Schema$TruncatableString; -} -/** - * A set of attributes, each in the format `[KEY]:[VALUE]`. - */ -export interface Schema$Attributes { - /** - * The set of attributes. Each attribute's key can be up to 128 bytes - * long. The value can be a string up to 256 bytes, an integer, or the Boolean - * values `true` and `false`. For example: "/instance_id": - * "my-instance" "/http/user_agent": "" - * "/http/request_bytes": 300 "abc.com/myattribute": - * true - */ - attributeMap: any; - /** - * The number of attributes that were discarded. Attributes can be discarded - * because their keys are too long or because there are too many attributes. - * If this value is 0 then all attributes are valid. - */ - droppedAttributesCount: number; -} -/** - * The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute. - */ -export interface Schema$AttributeValue { - /** - * A Boolean value represented by `true` or `false`. - */ - boolValue: boolean; - /** - * A 64-bit signed integer. - */ - intValue: string; - /** - * A string up to 256 bytes long. - */ - stringValue: Schema$TruncatableString; -} -/** - * The request message for the `BatchWriteSpans` method. - */ -export interface Schema$BatchWriteSpansRequest { - /** - * A list of new spans. The span names must not match existing spans, or the - * results are undefined. - */ - spans: Schema$Span[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A pointer from the current span to another span in the same trace or in a - * different trace. For example, this can be used in batching operations, where - * a single batch handler processes multiple requests from different traces or - * when the handler receives a request from a different project. - */ -export interface Schema$Link { - /** - * A set of attributes on the link. You have have up to 32 attributes per - * link. - */ - attributes: Schema$Attributes; - /** - * The [SPAN_ID] for a span within a trace. - */ - spanId: string; - /** - * The [TRACE_ID] for a trace within a project. - */ - traceId: string; - /** - * The relationship of the current span relative to the linked span. - */ - type: string; -} -/** - * A collection of links, which are references from this span to a span in the - * same or different trace. - */ -export interface Schema$Links { - /** - * The number of dropped links after the maximum size was enforced. If this - * value is 0, then no links were dropped. - */ - droppedLinksCount: number; - /** - * A collection of links. - */ - link: Schema$Link[]; -} -/** - * An event describing a message sent/received between Spans. - */ -export interface Schema$MessageEvent { - /** - * The number of compressed bytes sent or received. If missing assumed to be - * the same size as uncompressed. - */ - compressedSizeBytes: string; - /** - * An identifier for the MessageEvent's message that can be used to match - * SENT and RECEIVED MessageEvents. It is recommended to be unique within a - * Span. - */ - id: string; - /** - * Type of MessageEvent. Indicates whether the message was sent or received. - */ - type: string; - /** - * The number of uncompressed bytes sent or received. - */ - uncompressedSizeBytes: string; -} -/** - * Binary module. - */ -export interface Schema$Module { - /** - * A unique identifier for the module, usually a hash of its contents (up to - * 128 bytes). - */ - buildId: Schema$TruncatableString; - /** - * For example: main binary, kernel modules, and dynamic libraries such as - * libc.so, sharedlib.so (up to 256 bytes). - */ - module: Schema$TruncatableString; -} -/** - * A span represents a single operation within a trace. Spans can be nested to - * form a trace tree. Often, a trace contains a root span that describes the - * end-to-end latency, and one or more subspans for its sub-operations. A trace - * can also contain multiple root spans, or none at all. Spans do not need to be - * contiguous&mdash;there may be gaps or overlaps between spans in a trace. - */ -export interface Schema$Span { - /** - * A set of attributes on the span. You can have up to 32 attributes per span. - */ - attributes: Schema$Attributes; - /** - * An optional number of child spans that were generated while this span was - * active. If set, allows implementation to detect missing child spans. - */ - childSpanCount: number; - /** - * A description of the span's operation (up to 128 bytes). Stackdriver - * Trace displays the description in the {% dynamic print - * site_values.console_name %}. For example, the display name can be a - * qualified method name or a file name and a line number where the operation - * is called. A best practice is to use the same display name within an - * application and at the same call point. This makes it easier to correlate - * spans in different traces. - */ - displayName: Schema$TruncatableString; - /** - * The end time of the span. On the client side, this is the time kept by the - * local machine where the span execution ends. On the server side, this is - * the time when the server application handler stops running. - */ - endTime: string; - /** - * Links associated with the span. You can have up to 128 links per Span. - */ - links: Schema$Links; - /** - * The resource name of the span in the following format: - * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique - * identifier for a trace within a project; it is a 32-character hexadecimal - * encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span - * within a trace; it is a 16-character hexadecimal encoding of an 8-byte - * array. - */ - name: string; - /** - * The [SPAN_ID] of this span's parent span. If this is a root span, then - * this field must be empty. - */ - parentSpanId: string; - /** - * (Optional) Set this parameter to indicate whether this span is in the same - * process as its parent. If you do not set this parameter, Stackdriver Trace - * is unable to take advantage of this helpful information. - */ - sameProcessAsParentSpan: boolean; - /** - * The [SPAN_ID] portion of the span's resource name. - */ - spanId: string; /** - * Stack trace captured at the start of the span. - */ - stackTrace: Schema$StackTrace; - /** - * The start time of the span. On the client side, this is the time kept by - * the local machine where the span execution starts. On the server side, this - * is the time when the server's application handler starts running. - */ - startTime: string; - /** - * An optional final status for this span. - */ - status: Schema$Status; - /** - * A set of time events. You can have up to 32 annotations and 128 message - * events per span. - */ - timeEvents: Schema$TimeEvents; -} -/** - * Represents a single stack frame in a stack trace. - */ -export interface Schema$StackFrame { - /** - * The column number where the function call appears, if available. This is - * important in JavaScript because of its anonymous functions. - */ - columnNumber: string; - /** - * The name of the source file where the function call appears (up to 256 - * bytes). - */ - fileName: Schema$TruncatableString; - /** - * The fully-qualified name that uniquely identifies the function or method - * that is active in this frame (up to 1024 bytes). - */ - functionName: Schema$TruncatableString; - /** - * The line number in `file_name` where the function call appears. - */ - lineNumber: string; - /** - * The binary module from where the code was loaded. - */ - loadModule: Schema$Module; - /** - * An un-mangled function name, if `function_name` is - * [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can be - * fully-qualified (up to 1024 bytes). - */ - originalFunctionName: Schema$TruncatableString; - /** - * The version of the deployed source code (up to 128 bytes). - */ - sourceVersion: Schema$TruncatableString; -} -/** - * A collection of stack frames, which can be truncated. - */ -export interface Schema$StackFrames { - /** - * The number of stack frames that were dropped because there were too many - * stack frames. If this value is 0, then no stack frames were dropped. - */ - droppedFramesCount: number; - /** - * Stack frames in this call stack. - */ - frame: Schema$StackFrame[]; -} -/** - * A call stack appearing in a trace. - */ -export interface Schema$StackTrace { - /** - * Stack frames in this stack trace. A maximum of 128 frames are allowed. + * Text annotation with a set of attributes. */ - stackFrames: Schema$StackFrames; + export interface Schema$Annotation { + /** + * A set of attributes on the annotation. You can have up to 4 attributes + * per Annotation. + */ + attributes: Schema$Attributes; + /** + * A user-supplied message describing the event. The maximum length for the + * description is 256 bytes. + */ + description: Schema$TruncatableString; + } /** - * The hash ID is used to conserve network bandwidth for duplicate stack - * traces within a single trace. Often multiple spans will have identical - * stack traces. The first occurrence of a stack trace should contain both the - * `stackFrame` content and a value in `stackTraceHashId`. Subsequent spans - * within the same request can refer to that stack trace by only setting - * `stackTraceHashId`. - */ - stackTraceHashId: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * A set of attributes, each in the format `[KEY]:[VALUE]`. + */ + export interface Schema$Attributes { + /** + * The set of attributes. Each attribute's key can be up to 128 bytes + * long. The value can be a string up to 256 bytes, an integer, or the + * Boolean values `true` and `false`. For example: "/instance_id": + * "my-instance" "/http/user_agent": "" + * "/http/request_bytes": 300 "abc.com/myattribute": + * true + */ + attributeMap: any; + /** + * The number of attributes that were discarded. Attributes can be discarded + * because their keys are too long or because there are too many attributes. + * If this value is 0 then all attributes are valid. + */ + droppedAttributesCount: number; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute. + */ + export interface Schema$AttributeValue { + /** + * A Boolean value represented by `true` or `false`. + */ + boolValue: boolean; + /** + * A 64-bit signed integer. + */ + intValue: string; + /** + * A string up to 256 bytes long. + */ + stringValue: Schema$TruncatableString; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * The request message for the `BatchWriteSpans` method. */ - details: any[]; + export interface Schema$BatchWriteSpansRequest { + /** + * A list of new spans. The span names must not match existing spans, or the + * results are undefined. + */ + spans: Schema$Span[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A time-stamped annotation or message event in the Span. - */ -export interface Schema$TimeEvent { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A pointer from the current span to another span in the same trace or in a + * different trace. For example, this can be used in batching operations, + * where a single batch handler processes multiple requests from different + * traces or when the handler receives a request from a different project. + */ + export interface Schema$Link { + /** + * A set of attributes on the link. You have have up to 32 attributes per + * link. + */ + attributes: Schema$Attributes; + /** + * The [SPAN_ID] for a span within a trace. + */ + spanId: string; + /** + * The [TRACE_ID] for a trace within a project. + */ + traceId: string; + /** + * The relationship of the current span relative to the linked span. + */ + type: string; + } /** - * Text annotation with a set of attributes. - */ - annotation: Schema$Annotation; + * A collection of links, which are references from this span to a span in the + * same or different trace. + */ + export interface Schema$Links { + /** + * The number of dropped links after the maximum size was enforced. If this + * value is 0, then no links were dropped. + */ + droppedLinksCount: number; + /** + * A collection of links. + */ + link: Schema$Link[]; + } /** * An event describing a message sent/received between Spans. */ - messageEvent: Schema$MessageEvent; + export interface Schema$MessageEvent { + /** + * The number of compressed bytes sent or received. If missing assumed to be + * the same size as uncompressed. + */ + compressedSizeBytes: string; + /** + * An identifier for the MessageEvent's message that can be used to + * match SENT and RECEIVED MessageEvents. It is recommended to be unique + * within a Span. + */ + id: string; + /** + * Type of MessageEvent. Indicates whether the message was sent or received. + */ + type: string; + /** + * The number of uncompressed bytes sent or received. + */ + uncompressedSizeBytes: string; + } /** - * The timestamp indicating the time the event occurred. - */ - time: string; -} -/** - * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation on - * the span, consisting of either user-supplied key:value pairs, or details of a - * message sent/received between Spans. - */ -export interface Schema$TimeEvents { + * Binary module. + */ + export interface Schema$Module { + /** + * A unique identifier for the module, usually a hash of its contents (up to + * 128 bytes). + */ + buildId: Schema$TruncatableString; + /** + * For example: main binary, kernel modules, and dynamic libraries such as + * libc.so, sharedlib.so (up to 256 bytes). + */ + module: Schema$TruncatableString; + } /** - * The number of dropped annotations in all the included time events. If the - * value is 0, then no annotations were dropped. - */ - droppedAnnotationsCount: number; + * A span represents a single operation within a trace. Spans can be nested to + * form a trace tree. Often, a trace contains a root span that describes the + * end-to-end latency, and one or more subspans for its sub-operations. A + * trace can also contain multiple root spans, or none at all. Spans do not + * need to be contiguous&mdash;there may be gaps or overlaps between spans + * in a trace. + */ + export interface Schema$Span { + /** + * A set of attributes on the span. You can have up to 32 attributes per + * span. + */ + attributes: Schema$Attributes; + /** + * An optional number of child spans that were generated while this span was + * active. If set, allows implementation to detect missing child spans. + */ + childSpanCount: number; + /** + * A description of the span's operation (up to 128 bytes). Stackdriver + * Trace displays the description in the {% dynamic print + * site_values.console_name %}. For example, the display name can be a + * qualified method name or a file name and a line number where the + * operation is called. A best practice is to use the same display name + * within an application and at the same call point. This makes it easier to + * correlate spans in different traces. + */ + displayName: Schema$TruncatableString; + /** + * The end time of the span. On the client side, this is the time kept by + * the local machine where the span execution ends. On the server side, this + * is the time when the server application handler stops running. + */ + endTime: string; + /** + * Links associated with the span. You can have up to 128 links per Span. + */ + links: Schema$Links; + /** + * The resource name of the span in the following format: + * projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique + * identifier for a trace within a project; it is a 32-character hexadecimal + * encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span + * within a trace; it is a 16-character hexadecimal encoding of an 8-byte + * array. + */ + name: string; + /** + * The [SPAN_ID] of this span's parent span. If this is a root span, + * then this field must be empty. + */ + parentSpanId: string; + /** + * (Optional) Set this parameter to indicate whether this span is in the + * same process as its parent. If you do not set this parameter, Stackdriver + * Trace is unable to take advantage of this helpful information. + */ + sameProcessAsParentSpan: boolean; + /** + * The [SPAN_ID] portion of the span's resource name. + */ + spanId: string; + /** + * Stack trace captured at the start of the span. + */ + stackTrace: Schema$StackTrace; + /** + * The start time of the span. On the client side, this is the time kept by + * the local machine where the span execution starts. On the server side, + * this is the time when the server's application handler starts + * running. + */ + startTime: string; + /** + * An optional final status for this span. + */ + status: Schema$Status; + /** + * A set of time events. You can have up to 32 annotations and 128 message + * events per span. + */ + timeEvents: Schema$TimeEvents; + } /** - * The number of dropped message events in all the included time events. If - * the value is 0, then no message events were dropped. - */ - droppedMessageEventsCount: number; + * Represents a single stack frame in a stack trace. + */ + export interface Schema$StackFrame { + /** + * The column number where the function call appears, if available. This is + * important in JavaScript because of its anonymous functions. + */ + columnNumber: string; + /** + * The name of the source file where the function call appears (up to 256 + * bytes). + */ + fileName: Schema$TruncatableString; + /** + * The fully-qualified name that uniquely identifies the function or method + * that is active in this frame (up to 1024 bytes). + */ + functionName: Schema$TruncatableString; + /** + * The line number in `file_name` where the function call appears. + */ + lineNumber: string; + /** + * The binary module from where the code was loaded. + */ + loadModule: Schema$Module; + /** + * An un-mangled function name, if `function_name` is + * [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can + * be fully-qualified (up to 1024 bytes). + */ + originalFunctionName: Schema$TruncatableString; + /** + * The version of the deployed source code (up to 128 bytes). + */ + sourceVersion: Schema$TruncatableString; + } /** - * A collection of `TimeEvent`s. - */ - timeEvent: Schema$TimeEvent[]; -} -/** - * Represents a string that might be shortened to a specified length. - */ -export interface Schema$TruncatableString { + * A collection of stack frames, which can be truncated. + */ + export interface Schema$StackFrames { + /** + * The number of stack frames that were dropped because there were too many + * stack frames. If this value is 0, then no stack frames were dropped. + */ + droppedFramesCount: number; + /** + * Stack frames in this call stack. + */ + frame: Schema$StackFrame[]; + } /** - * The number of bytes removed from the original string. If this value is 0, - * then the string was not shortened. - */ - truncatedByteCount: number; + * A call stack appearing in a trace. + */ + export interface Schema$StackTrace { + /** + * Stack frames in this stack trace. A maximum of 128 frames are allowed. + */ + stackFrames: Schema$StackFrames; + /** + * The hash ID is used to conserve network bandwidth for duplicate stack + * traces within a single trace. Often multiple spans will have identical + * stack traces. The first occurrence of a stack trace should contain both + * the `stackFrame` content and a value in `stackTraceHashId`. Subsequent + * spans within the same request can refer to that stack trace by only + * setting `stackTraceHashId`. + */ + stackTraceHashId: string; + } /** - * The shortened string. For example, if the original string is 500 bytes long - * and the limit of the string is 128 bytes, then `value` contains the first - * 128 bytes of the 500-byte string. Truncation always happens on a UTF8 - * character boundary. If there are multi-byte characters in the string, then - * the length of the shortened string might be less than the size limit. - */ - value: string; -} - -export class Resource$Projects { - root: Cloudtrace; - traces: Resource$Projects$Traces; - constructor(root: Cloudtrace) { - this.root = root; - this.getRoot.bind(this); - this.traces = new Resource$Projects$Traces(root); + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - getRoot() { - return this.root; + /** + * A time-stamped annotation or message event in the Span. + */ + export interface Schema$TimeEvent { + /** + * Text annotation with a set of attributes. + */ + annotation: Schema$Annotation; + /** + * An event describing a message sent/received between Spans. + */ + messageEvent: Schema$MessageEvent; + /** + * The timestamp indicating the time the event occurred. + */ + time: string; } -} -export class Resource$Projects$Traces { - root: Cloudtrace; - spans: Resource$Projects$Traces$Spans; - constructor(root: Cloudtrace) { - this.root = root; - this.getRoot.bind(this); - this.spans = new Resource$Projects$Traces$Spans(root); + /** + * A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation on + * the span, consisting of either user-supplied key:value pairs, or details of + * a message sent/received between Spans. + */ + export interface Schema$TimeEvents { + /** + * The number of dropped annotations in all the included time events. If the + * value is 0, then no annotations were dropped. + */ + droppedAnnotationsCount: number; + /** + * The number of dropped message events in all the included time events. If + * the value is 0, then no message events were dropped. + */ + droppedMessageEventsCount: number; + /** + * A collection of `TimeEvent`s. + */ + timeEvent: Schema$TimeEvent[]; } - - getRoot() { - return this.root; + /** + * Represents a string that might be shortened to a specified length. + */ + export interface Schema$TruncatableString { + /** + * The number of bytes removed from the original string. If this value is 0, + * then the string was not shortened. + */ + truncatedByteCount: number; + /** + * The shortened string. For example, if the original string is 500 bytes + * long and the limit of the string is 128 bytes, then `value` contains the + * first 128 bytes of the 500-byte string. Truncation always happens on a + * UTF8 character boundary. If there are multi-byte characters in the + * string, then the length of the shortened string might be less than the + * size limit. + */ + value: string; } - - /** - * cloudtrace.projects.traces.batchWrite - * @desc Sends new spans to new or existing traces. You cannot update existing - * spans. - * @alias cloudtrace.projects.traces.batchWrite - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. - * @param {().BatchWriteSpansRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchWrite(params?: any, options?: MethodOptions): AxiosPromise; - batchWrite( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchWrite( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Cloudtrace; + traces: Resource$Projects$Traces; + constructor(root: Cloudtrace) { + this.root = root; + this.getRoot.bind(this); + this.traces = new Resource$Projects$Traces(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}/traces:batchWrite') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Projects$Traces$Spans { - root: Cloudtrace; - constructor(root: Cloudtrace) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Traces { + root: Cloudtrace; + spans: Resource$Projects$Traces$Spans; + constructor(root: Cloudtrace) { + this.root = root; + this.getRoot.bind(this); + this.spans = new Resource$Projects$Traces$Spans(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * cloudtrace.projects.traces.spans.createSpan - * @desc Creates a new span. - * @alias cloudtrace.projects.traces.spans.createSpan - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. - * @param {().Span} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSpan(params?: any, options?: MethodOptions): AxiosPromise; - createSpan( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSpan( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * cloudtrace.projects.traces.batchWrite + * @desc Sends new spans to new or existing traces. You cannot update + * existing spans. + * @alias cloudtrace.projects.traces.batchWrite + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`. + * @param {().BatchWriteSpansRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchWrite(params?: any, options?: MethodOptions): + AxiosPromise; + batchWrite( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchWrite( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}/traces:batchWrite') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Projects$Traces$Spans { + root: Cloudtrace; + constructor(root: Cloudtrace) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * cloudtrace.projects.traces.spans.createSpan + * @desc Creates a new span. + * @alias cloudtrace.projects.traces.spans.createSpan + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. + * @param {().Span} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSpan(params?: any, options?: MethodOptions): + AxiosPromise; + createSpan( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSpan( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://cloudtrace.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/compute/alpha.ts b/src/apis/compute/alpha.ts index 7551e6ce981..ca36d8b5d45 100644 --- a/src/apis/compute/alpha.ts +++ b/src/apis/compute/alpha.ts @@ -27,42830 +27,43253 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format - -/** - * Compute Engine API - * - * Creates and runs virtual machines on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const compute = google.compute('alpha'); - * - * @namespace compute - * @type {Function} - * @version alpha - * @variation alpha - * @param {object=} options Options for Compute - */ -export class Compute { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - acceleratorTypes: Resource$Acceleratortypes; - addresses: Resource$Addresses; - autoscalers: Resource$Autoscalers; - backendBuckets: Resource$Backendbuckets; - backendServices: Resource$Backendservices; - disks: Resource$Disks; - diskTypes: Resource$Disktypes; - firewalls: Resource$Firewalls; - forwardingRules: Resource$Forwardingrules; - globalAddresses: Resource$Globaladdresses; - globalForwardingRules: Resource$Globalforwardingrules; - globalOperations: Resource$Globaloperations; - healthChecks: Resource$Healthchecks; - hosts: Resource$Hosts; - hostTypes: Resource$Hosttypes; - httpHealthChecks: Resource$Httphealthchecks; - httpsHealthChecks: Resource$Httpshealthchecks; - images: Resource$Images; - instanceGroupManagers: Resource$Instancegroupmanagers; - instanceGroups: Resource$Instancegroups; - instances: Resource$Instances; - instanceTemplates: Resource$Instancetemplates; - interconnectAttachments: Resource$Interconnectattachments; - interconnectLocations: Resource$Interconnectlocations; - interconnects: Resource$Interconnects; - licenseCodes: Resource$Licensecodes; - licenses: Resource$Licenses; - machineTypes: Resource$Machinetypes; - networkEndpointGroups: Resource$Networkendpointgroups; - networks: Resource$Networks; - nodeGroups: Resource$Nodegroups; - nodeTemplates: Resource$Nodetemplates; - nodeTypes: Resource$Nodetypes; - projects: Resource$Projects; - regionAutoscalers: Resource$Regionautoscalers; - regionBackendServices: Resource$Regionbackendservices; - regionCommitments: Resource$Regioncommitments; - regionDisks: Resource$Regiondisks; - regionDiskTypes: Resource$Regiondisktypes; - regionHealthChecks: Resource$Regionhealthchecks; - regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; - regionInstanceGroups: Resource$Regioninstancegroups; - regionOperations: Resource$Regionoperations; - regions: Resource$Regions; - regionTargetHttpProxies: Resource$Regiontargethttpproxies; - regionUrlMaps: Resource$Regionurlmaps; - routers: Resource$Routers; - routes: Resource$Routes; - securityPolicies: Resource$Securitypolicies; - snapshots: Resource$Snapshots; - sslCertificates: Resource$Sslcertificates; - sslPolicies: Resource$Sslpolicies; - subnetworks: Resource$Subnetworks; - targetHttpProxies: Resource$Targethttpproxies; - targetHttpsProxies: Resource$Targethttpsproxies; - targetInstances: Resource$Targetinstances; - targetPools: Resource$Targetpools; - targetSslProxies: Resource$Targetsslproxies; - targetTcpProxies: Resource$Targettcpproxies; - targetVpnGateways: Resource$Targetvpngateways; - urlMaps: Resource$Urlmaps; - vpnTunnels: Resource$Vpntunnels; - zoneOperations: Resource$Zoneoperations; - zones: Resource$Zones; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.acceleratorTypes = new Resource$Acceleratortypes(this); - this.addresses = new Resource$Addresses(this); - this.autoscalers = new Resource$Autoscalers(this); - this.backendBuckets = new Resource$Backendbuckets(this); - this.backendServices = new Resource$Backendservices(this); - this.disks = new Resource$Disks(this); - this.diskTypes = new Resource$Disktypes(this); - this.firewalls = new Resource$Firewalls(this); - this.forwardingRules = new Resource$Forwardingrules(this); - this.globalAddresses = new Resource$Globaladdresses(this); - this.globalForwardingRules = new Resource$Globalforwardingrules(this); - this.globalOperations = new Resource$Globaloperations(this); - this.healthChecks = new Resource$Healthchecks(this); - this.hosts = new Resource$Hosts(this); - this.hostTypes = new Resource$Hosttypes(this); - this.httpHealthChecks = new Resource$Httphealthchecks(this); - this.httpsHealthChecks = new Resource$Httpshealthchecks(this); - this.images = new Resource$Images(this); - this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); - this.instanceGroups = new Resource$Instancegroups(this); - this.instances = new Resource$Instances(this); - this.instanceTemplates = new Resource$Instancetemplates(this); - this.interconnectAttachments = new Resource$Interconnectattachments(this); - this.interconnectLocations = new Resource$Interconnectlocations(this); - this.interconnects = new Resource$Interconnects(this); - this.licenseCodes = new Resource$Licensecodes(this); - this.licenses = new Resource$Licenses(this); - this.machineTypes = new Resource$Machinetypes(this); - this.networkEndpointGroups = new Resource$Networkendpointgroups(this); - this.networks = new Resource$Networks(this); - this.nodeGroups = new Resource$Nodegroups(this); - this.nodeTemplates = new Resource$Nodetemplates(this); - this.nodeTypes = new Resource$Nodetypes(this); - this.projects = new Resource$Projects(this); - this.regionAutoscalers = new Resource$Regionautoscalers(this); - this.regionBackendServices = new Resource$Regionbackendservices(this); - this.regionCommitments = new Resource$Regioncommitments(this); - this.regionDisks = new Resource$Regiondisks(this); - this.regionDiskTypes = new Resource$Regiondisktypes(this); - this.regionHealthChecks = new Resource$Regionhealthchecks(this); - this.regionInstanceGroupManagers = - new Resource$Regioninstancegroupmanagers(this); - this.regionInstanceGroups = new Resource$Regioninstancegroups(this); - this.regionOperations = new Resource$Regionoperations(this); - this.regions = new Resource$Regions(this); - this.regionTargetHttpProxies = new Resource$Regiontargethttpproxies(this); - this.regionUrlMaps = new Resource$Regionurlmaps(this); - this.routers = new Resource$Routers(this); - this.routes = new Resource$Routes(this); - this.securityPolicies = new Resource$Securitypolicies(this); - this.snapshots = new Resource$Snapshots(this); - this.sslCertificates = new Resource$Sslcertificates(this); - this.sslPolicies = new Resource$Sslpolicies(this); - this.subnetworks = new Resource$Subnetworks(this); - this.targetHttpProxies = new Resource$Targethttpproxies(this); - this.targetHttpsProxies = new Resource$Targethttpsproxies(this); - this.targetInstances = new Resource$Targetinstances(this); - this.targetPools = new Resource$Targetpools(this); - this.targetSslProxies = new Resource$Targetsslproxies(this); - this.targetTcpProxies = new Resource$Targettcpproxies(this); - this.targetVpnGateways = new Resource$Targetvpngateways(this); - this.urlMaps = new Resource$Urlmaps(this); - this.vpnTunnels = new Resource$Vpntunnels(this); - this.zoneOperations = new Resource$Zoneoperations(this); - this.zones = new Resource$Zones(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A specification of the type and number of accelerator cards attached to the - * instance. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the guest accelerator cards exposed to this instance. - */ - acceleratorCount: number; - /** - * Full or partial URL of the accelerator type resource to attach to this - * instance. If you are creating an instance template, specify only the - * accelerator name. - */ - acceleratorType: string; -} -/** - * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== - * resource_for v1.acceleratorTypes ==) - */ -export interface Schema$AcceleratorType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this accelerator type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#acceleratorType for - * accelerator types. - */ - kind: string; - /** - * [Output Only] Maximum accelerator cards allowed per instance. - */ - maximumCardsPerInstance: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the accelerator type resides, such - * as us-central1-a. You must specify this field as part of the HTTP request - * URL. It is not settable as a field in the request body. - */ - zone: string; -} -export interface Schema$AcceleratorTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator - * types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of accelerator types. - */ -export interface Schema$AcceleratorTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorType resources. - */ - items: Schema$AcceleratorType[]; - /** - * [Output Only] Type of resource. Always compute#acceleratorTypeList for - * lists of accelerator types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AcceleratorTypesScopedList { - /** - * [Output Only] A list of accelerator types contained in this scope. - */ - acceleratorTypes: Schema$AcceleratorType[]; - /** - * [Output Only] An informational warning that appears when the accelerator - * types list is empty. - */ - warning: any; -} -/** - * An access configuration attached to an instance's network interface. Only - * one access config per instance is supported. - */ -export interface Schema$AccessConfig { - /** - * [Output Only] Type of the resource. Always compute#accessConfig for access - * configs. - */ - kind: string; - /** - * The name of this access configuration. The default and recommended name is - * External NAT but you can use any arbitrary string you would like. For - * example, My external IP or Network Access. - */ - name: string; - /** - * An external IP address associated with this instance. Specify an unused - * static external IP address available to the project or leave this field - * undefined to use an IP from a shared ephemeral IP address pool. If you - * specify a static external IP address, it must live in the same region as - * the zone of the instance. - */ - natIP: string; - /** - * This signifies the networking tier used for configuring this access - * configuration and can only take the following values: PREMIUM, STANDARD. If - * an AccessConfig is specified without a valid external IP address, an - * ephemeral IP will be created with this networkTier. If an AccessConfig - * with a valid external IP address is specified, it must match that of the - * networkTier associated with the Address resource owning that IP. - */ - networkTier: string; - /** - * [Output Only] The public DNS domain name for the instance. - */ - publicDnsName: string; - /** - * The DNS domain name for the public PTR record. This field can only be set - * when the set_public_ptr field is enabled. - */ - publicPtrDomainName: string; - /** - * Specifies whether a public DNS ?A? record should be created for the - * external IP address of this access configuration. - */ - setPublicDns: boolean; - /** - * Specifies whether a public DNS ?PTR? record should be created to map the - * external IP address of the instance to a DNS domain name. - */ - setPublicPtr: boolean; - /** - * The type of configuration. The default and only option is ONE_TO_ONE_NAT. - */ - type: string; -} -/** - * A reserved address resource. (== resource_for beta.addresses ==) (== - * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== - * resource_for v1.globalAddresses ==) - */ -export interface Schema$Address { - /** - * The static IP address represented by this resource. - */ - address: string; - /** - * The type of address to reserve, either INTERNAL or EXTERNAL. If - * unspecified, defaults to EXTERNAL. - */ - addressType: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP Version that will be used by this address. Valid options are IPV4 or - * IPV6. This can only be specified for a global address. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#address for addresses. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this Address, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an Address. - */ - labelFingerprint: string; - /** - * Labels to apply to this Address resource. These can be later modified by - * the setLabels method. Each label key/value must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The URL of the network in which to reserve the address. This field can only - * be used with INTERNAL type with VPC_PEERING purpose. - */ - network: string; - /** - * This signifies the networking tier used for configuring this Address and - * can only take the following values: PREMIUM , STANDARD. If this field is - * not specified, it is assumed to be PREMIUM. - */ - networkTier: string; - /** - * The prefix length if the resource reprensents an IP range. - */ - prefixLength: number; - /** - * The purpose of resource, only used with INTERNAL type. - */ - purpose: string; - /** - * [Output Only] URL of the region where the regional address resides. This - * field is not applicable to global addresses. You must specify this field as - * part of the HTTP request URL. You cannot set this field in the request - * body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the address, which can be one of RESERVING, - * RESERVED, or IN_USE. An address that is RESERVING is currently in the - * process of being reserved. A RESERVED address is currently reserved and - * available to use. An IN_USE address is currently being used by another - * resource and is not available. - */ - status: string; - /** - * The URL of the subnetwork in which to reserve the address. If an IP address - * is specified, it must be within the subnetwork's IP range. This field - * can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER - * purposes. - */ - subnetwork: string; - /** - * [Output Only] The URLs of the resources that are using this address. - */ - users: string[]; -} -export interface Schema$AddressAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AddressesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#addressAggregatedList for - * aggregated lists of addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AddressesScopedList { - /** - * [Output Only] A list of addresses contained in this scope. - */ - addresses: Schema$Address[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -/** - * Contains a list of addresses. - */ -export interface Schema$AddressList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Address resources. - */ - items: Schema$Address[]; - /** - * [Output Only] Type of resource. Always compute#addressList for lists of - * addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An alias IP range attached to an instance's network interface. - */ -export interface Schema$AliasIpRange { - /** - * The IP CIDR range represented by this alias IP range. This IP CIDR range - * must belong to the specified subnetwork and cannot contain IP addresses - * reserved by system or used by other network interfaces. This range may be a - * single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format - * string (e.g. 10.1.2.0/24). - */ - ipCidrRange: string; - /** - * Optional subnetwork secondary range name specifying the secondary range - * from which to allocate the IP CIDR range for this alias IP range. If left - * unspecified, the primary range of the subnetwork will be used. - */ - subnetworkRangeName: string; -} -/** - * An instance-attached disk resource. - */ -export interface Schema$AttachedDisk { - /** - * Specifies whether the disk will be auto-deleted when the instance is - * deleted (but not when the disk is detached from the instance). - */ - autoDelete: boolean; - /** - * Indicates that this is a boot disk. The virtual machine will use the first - * partition of the disk for its root filesystem. - */ - boot: boolean; - /** - * Specifies a unique device name of your choice that is reflected into the - * /dev/disk/by-id/google-* tree of a Linux operating system running within - * the instance. This name can be used to reference the device for mounting, - * resizing, and so on, from within the instance. If not specified, the - * server chooses a default device name to apply to this disk, in the form - * persistent-disks-x, where x is a number assigned by Google Compute Engine. - * This field is only applicable for persistent disks. - */ - deviceName: string; - /** - * Encrypts or decrypts a disk using a customer-supplied encryption key. If - * you are creating a new disk, this field encrypts the new disk using an - * encryption key that you provide. If you are attaching an existing disk that - * is already encrypted, this field decrypts the disk using the - * customer-supplied encryption key. If you encrypt a disk using a - * customer-supplied key, you must provide the same key again when you attempt - * to use this resource at a later time. For example, you must provide the key - * when you create a snapshot or an image from the disk or when you attach the - * disk to a virtual machine instance. If you do not provide an encryption - * key, then the disk will be encrypted using an automatically generated key - * and you do not need to provide a key to use the disk later. Instance - * templates do not store customer-supplied encryption keys, so you cannot use - * your own keys to encrypt disks in a managed instance group. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * The size of the disk in base-2 GB. This supersedes disk_size_gb in - * InitializeParams. - */ - diskSizeGb: string; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] A zero-based index to this disk, where 0 is reserved for the - * boot disk. If you have many disks attached to an instance, each disk would - * have a unique index number. - */ - index: number; - /** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is - * mutually exclusive with the source property; you can only define one or the - * other, but not both. - */ - initializeParams: Schema$AttachedDiskInitializeParams; - /** - * Specifies the disk interface to use for attaching this disk, which is - * either SCSI or NVME. The default is SCSI. Persistent disks must always use - * SCSI and the request will fail if you attempt to attach a persistent disk - * in any other format than SCSI. Local SSDs can use either NVME or SCSI. For - * performance characteristics of SCSI over NVMe, see Local SSD performance. - */ - interface: string; - /** - * [Output Only] Type of the resource. Always compute#attachedDisk for - * attached disks. - */ - kind: string; - /** - * [Output Only] Any valid publicly visible licenses. - */ - licenses: string[]; - /** - * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If - * not specified, the default is to attach the disk in READ_WRITE mode. - */ - mode: string; - /** - * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this - * field is set to PRESERVED iff the LocalSSD data has been saved to a - * persistent location by customer request. (see the discard_local_ssd option - * on Stop/Suspend). Read-only in the api. - */ - savedState: string; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. When creating a new instance, one of initializeParams.sourceImage - * or disks.source is required except for local SSD. If desired, you can also - * attach existing non-root persistent disks using this property. This field - * is only applicable for persistent disks. Note that for InstanceTemplate, - * specify the disk name, not the URL for the disk. - */ - source: string; - /** - * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not - * specified, the default is PERSISTENT. - */ - type: string; -} -/** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is mutually - * exclusive with the source property; you can only define one or the other, but - * not both. - */ -export interface Schema$AttachedDiskInitializeParams { - /** - * Specifies the disk name. If not specified, the default is to use the name - * of the instance. - */ - diskName: string; - /** - * Specifies the size of the disk in base-2 GB. - */ - diskSizeGb: string; - /** - * [Deprecated] Storage type of the disk. - */ - diskStorageType: string; - /** - * Specifies the disk type to use to create the instance. If not specified, - * the default is pd-standard, specified using the full URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard - * Other values include pd-ssd and local-ssd. If you define this field, you - * can provide either the full or partial URL. For example, the following are - * valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - * - projects/project/zones/zone/diskTypes/diskType - - * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the - * name of the disk type, not URL. - */ - diskType: string; - /** - * Labels to apply to this disk. These can be later modified by the - * disks.setLabels method. This field is only applicable for persistent disks. - */ - labels: any; - /** - * The source image to create this disk. When creating a new instance, one of - * initializeParams.sourceImage or disks.source is required except for local - * SSD. To create a disk with one of the public operating system images, - * specify the image by its family name. For example, specify family/debian-8 - * to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family If the source image is deleted - * later, this field will not be set. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. Instance - * templates do not store customer-supplied encryption keys, so you cannot - * create disks for instances in a managed instance group if the source images - * are encrypted with your own keys. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": "allServices" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", }, { "log_type": "ADMIN_READ", } - * ] }, { "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": "DATA_WRITE", - * "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } - * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - exemptedMembers: string[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", } ] } This enables 'DATA_READ' and - * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ - * logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of [Binding.members][]. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Authorization-related information used by Cloud Audit Logging. - */ -export interface Schema$AuthorizationLoggingOptions { - /** - * The type of the permission that was checked. - */ - permissionType: string; -} -/** - * Represents an Autoscaler resource. Autoscalers allow you to automatically - * scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling - * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for - * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== - * resource_for v1.regionAutoscalers ==) - */ -export interface Schema$Autoscaler { - /** - * The configuration parameters for the autoscaling algorithm. You can define - * one or more of the policies for an autoscaler: cpuUtilization, - * customMetricUtilizations, and loadBalancingUtilization. If none of these - * are specified, the default will be to autoscale based on cpuUtilization to - * 0.6 or 60%. - */ - autoscalingPolicy: Schema$AutoscalingPolicy; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#autoscaler for - * autoscalers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Target recommended MIG size (number of instances) computed by - * autoscaler. Autoscaler calculates recommended MIG size even when - * autoscaling policy mode is different from ON. This field is empty when - * autoscaler is not connected to the existing managed instance group or - * autoscaler did not generate its prediction. - */ - recommendedSize: number; - /** - * [Output Only] URL of the region where the instance group resides (for - * autoscalers living in regional scope). - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the autoscaler configuration. - */ - status: string; - /** - * [Output Only] Human-readable details about the current state of the - * autoscaler. Read the documentation for Commonly returned status messages - * for examples of status messages you might encounter. - */ - statusDetails: Schema$AutoscalerStatusDetails[]; - /** - * URL of the managed instance group that this autoscaler will scale. - */ - target: string; - /** - * [Output Only] URL of the zone where the instance group resides (for - * autoscalers living in zonal scope). - */ - zone: string; -} -export interface Schema$AutoscalerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AutoscalersScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for - * aggregated lists of autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Autoscaler resources. - */ -export interface Schema$AutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * [Output Only] Type of resource. Always compute#autoscalerList for lists of - * autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AutoscalersScopedList { - /** - * [Output Only] A list of autoscalers contained in this scope. - */ - autoscalers: Schema$Autoscaler[]; - /** - * [Output Only] Informational warning which replaces the list of autoscalers - * when the list is empty. - */ - warning: any; -} -export interface Schema$AutoscalerStatusDetails { - /** - * The status message. - */ - message: string; - /** - * The type of error returned. - */ - type: string; -} -/** - * Cloud Autoscaler policy. - */ -export interface Schema$AutoscalingPolicy { - /** - * The number of seconds that the autoscaler should wait before it starts - * collecting information from a new instance. This prevents the autoscaler - * from collecting information when the instance is initializing, during which - * the collected usage would not be reliable. The default time autoscaler - * waits is 60 seconds. Virtual machine initialization times might vary - * because of numerous factors. We recommend that you test how long an - * instance may take to initialize. To do this, create an instance and time - * the startup process. - */ - coolDownPeriodSec: number; - /** - * Defines the CPU utilization policy that allows the autoscaler to scale - * based on the average CPU utilization of a managed instance group. - */ - cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; - /** - * Configuration parameters of autoscaling based on a custom metric. - */ - customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; - /** - * Configuration parameters of autoscaling based on load balancer. - */ - loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; - /** - * The maximum number of instances that the autoscaler can scale up to. This - * is required when creating or updating an autoscaler. The maximum number of - * replicas should not be lower than minimal number of replicas. - */ - maxNumReplicas: number; - /** - * The minimum number of replicas that the autoscaler can scale down to. This - * cannot be less than 0. If not provided, autoscaler will choose a default - * value depending on maximum number of instances allowed. - */ - minNumReplicas: number; - /** - * Defines operating mode for this policy. - */ - mode: string; - /** - * Configuration parameters of autoscaling based on queuing system. - */ - queueBasedScaling: Schema$AutoscalingPolicyQueueBasedScaling; -} -/** - * CPU utilization policy. - */ -export interface Schema$AutoscalingPolicyCpuUtilization { - /** - * The target CPU utilization that the autoscaler should maintain. Must be a - * float value in the range (0, 1]. If not specified, the default is 0.6. If - * the CPU level is below the target utilization, the autoscaler scales down - * the number of instances until it reaches the minimum number of instances - * you specified or until the average CPU of your instances reaches the target - * utilization. If the average CPU is above the target utilization, the - * autoscaler scales up until it reaches the maximum number of instances you - * specified or until the average utilization reaches the target utilization. - */ - utilizationTarget: number; -} -/** - * Custom utilization metric policy. - */ -export interface Schema$AutoscalingPolicyCustomMetricUtilization { - /** - * A filter string, compatible with a Stackdriver Monitoring filter string for - * TimeSeries.list API call. This filter is used to select a specific - * TimeSeries for the purpose of autoscaling and to determine whether the - * metric is exporting per-instance or per-group data. For the filter to be - * valid for autoscaling purposes, the following rules apply: - You can only - * use the AND operator for joining selectors. - You can only use direct - * equality comparison operator (=) without any functions for each selector. - * - You can specify the metric in both the filter string and in the metric - * field. However, if specified in both places, the metric must be identical. - * - The monitored resource type determines what kind of values are expected - * for the metric. If it is a gce_instance, the autoscaler expects the metric - * to include a separate TimeSeries for each instance in a group. In such a - * case, you cannot filter on resource labels. If the resource type is any - * other value, the autoscaler expects this metric to contain values that - * apply to the entire autoscaled instance group and resource label filtering - * can be performed to point autoscaler at the correct TimeSeries to scale - * upon. This is called a per-group metric for the purpose of autoscaling. If - * not specified, the type defaults to gce_instance. You should provide a - * filter that is selective enough to pick just one TimeSeries for the - * autoscaled group or for each of the instances (if you are using - * gce_instance resource type). If multiple TimeSeries are returned upon the - * query execution, the autoscaler will sum their respective values to obtain - * its scaling value. - */ - filter: string; - /** - * The identifier (type) of the Stackdriver Monitoring metric. The metric - * cannot have negative values. The metric must have a value type of INT64 or - * DOUBLE. - */ - metric: string; - /** - * If scaling is based on a per-group metric value that represents the total - * amount of work to be done or resource usage, set this value to an amount - * assigned for a single instance of the scaled group. Autoscaler will keep - * the number of instances proportional to the value of this metric, the - * metric itself should not change value due to group resizing. A good metric - * to use with the target is for example - * pubsub.googleapis.com/subscription/num_undelivered_messages or a custom - * metric exporting the total number of requests coming to your instances. A - * bad example would be a metric exporting an average or median latency, since - * this value can't include a chunk assignable to a single instance, it - * could be better used with utilization_target instead. - */ - singleInstanceAssignment: number; - /** - * The target value of the metric that autoscaler should maintain. This must - * be a positive value. A utilization metric scales number of virtual machines - * handling requests to increase or decrease proportionally to the metric. For - * example, a good metric to use as a utilization_target is - * compute.googleapis.com/instance/network/received_bytes_count. The - * autoscaler will work to keep this value constant for each of the instances. - */ - utilizationTarget: number; - /** - * Defines how target utilization value is expressed for a Stackdriver - * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If - * not specified, the default is GAUGE. - */ - utilizationTargetType: string; -} -/** - * Configuration parameters of autoscaling based on load balancing. - */ -export interface Schema$AutoscalingPolicyLoadBalancingUtilization { - /** - * Fraction of backend capacity utilization (set in HTTP(s) load balancing - * configuration) that autoscaler should maintain. Must be a positive float - * value. If not defined, the default is 0.8. - */ - utilizationTarget: number; -} -/** - * Configuration parameters of autoscaling based on queuing system. - */ -export interface Schema$AutoscalingPolicyQueueBasedScaling { - /** - * Scaling based on the average number of tasks in the queue per each active - * instance. The autoscaler keeps the average number of tasks per instance - * below this number, based on data collected in the last couple of minutes. - * The autoscaler will also take into account incoming tasks when calculating - * when to scale. - */ - acceptableBacklogPerInstance: number; - /** - * Configuration for Cloud Pub/Sub subscription queue. - */ - cloudPubSub: Schema$AutoscalingPolicyQueueBasedScalingCloudPubSub; - /** - * The scaling algorithm will also calculate throughput estimates on its own; - * if you explicitly provide this value, the autoscaler will take into account - * your value as well as automatic estimates when deciding how to scale. - */ - singleWorkerThroughputPerSec: number; -} -/** - * Configuration parameters for scaling based on Cloud Pub/Sub subscription - * queue. - */ -export interface Schema$AutoscalingPolicyQueueBasedScalingCloudPubSub { - /** - * Cloud Pub/Sub subscription used for scaling. Provide the partial URL - * (starting with projects/) or just the subscription name. The subscription - * must be assigned to the topic specified in topicName and must be in a pull - * configuration. The subscription must belong to the same project as the - * Autoscaler. - */ - subscription: string; - /** - * Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial - * URL (starting with projects/) or just the topic name. The topic must belong - * to the same project as the Autoscaler resource. - */ - topic: string; -} -/** - * Message containing information of one individual backend. - */ -export interface Schema$Backend { - /** - * Specifies the balancing mode for this backend. For global HTTP(S) or - * TCP/SSL load balancing, the default is UTILIZATION. Valid values are - * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For Internal - * Load Balancing, the default and only supported mode is CONNECTION. - */ - balancingMode: string; - /** - * A multiplier applied to the group's maximum servicing capacity (based - * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the - * group will serve up to 100% of its configured capacity (depending on - * balancingMode). A setting of 0 means the group is completely drained, - * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This - * cannot be used for internal load balancing. - */ - capacityScaler: number; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * This field designates whether this is a failover backend. More than one - * failover backend can be configured for a given BackendService. - */ - failover: boolean; - /** - * The fully-qualified URL of a Instance Group resource. This instance group - * defines the list of instances that serve traffic. Member virtual machine - * instances from each instance group must live in the same zone as the - * instance group itself. No two backends in a backend service are allowed to - * use same Instance Group resource. Note that you must specify an Instance - * Group resource using the fully-qualified URL, rather than a partial URL. - * When the BackendService has load balancing scheme INTERNAL, the instance - * group must be within the same region as the BackendService. - */ - group: string; - /** - * The max number of simultaneous connections for the group. Can be used with - * either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, - * either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnections: number; - /** - * The max number of simultaneous connections that a single backend network - * endpoint can handle. This is used to calculate the capacity of the group. - * Can be used in either CONNECTION or UTILIZATION balancing modes. For - * CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must be - * set. This cannot be used for internal load balancing. - */ - maxConnectionsPerEndpoint: number; - /** - * The max number of simultaneous connections that a single backend instance - * can handle. This is used to calculate the capacity of the group. Can be - * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION - * mode, either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnectionsPerInstance: number; - /** - * The max requests per second (RPS) of the group. Can be used with either - * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE - * mode, either maxRate or maxRatePerInstance must be set. This cannot be - * used for internal load balancing. - */ - maxRate: number; - /** - * The max requests per second (RPS) that a single backend network endpoint - * can handle. This is used to calculate the capacity of the group. Can be - * used in either balancing mode. For RATE mode, either maxRate or - * maxRatePerEndpoint must be set. This cannot be used for internal load - * balancing. - */ - maxRatePerEndpoint: number; - /** - * The max requests per second (RPS) that a single backend instance can - * handle. This is used to calculate the capacity of the group. Can be used in - * either balancing mode. For RATE mode, either maxRate or maxRatePerInstance - * must be set. This cannot be used for internal load balancing. - */ - maxRatePerInstance: number; - /** - * Used when balancingMode is UTILIZATION. This ratio defines the CPU - * utilization target for the group. The default is 0.8. Valid range is - * [0.0, 1.0]. This cannot be used for internal load balancing. - */ - maxUtilization: number; -} -/** - * A BackendBucket resource. This resource defines a Cloud Storage bucket. - */ -export interface Schema$BackendBucket { - /** - * Cloud Storage bucket name. - */ - bucketName: string; - /** - * Cloud CDN Coniguration for this BackendBucket. - */ - cdnPolicy: Schema$BackendBucketCdnPolicy; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendBucket. - */ - enableCdn: boolean; - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Message containing Cloud CDN configuration for a backend bucket. - */ -export interface Schema$BackendBucketCdnPolicy { - /** - * Number of seconds up to which the response to a signed URL request will be - * cached in the CDN. After this time period, the Signed URL will be - * revalidated before being served. Defaults to 1hr (3600s). If this field is - * set, Cloud CDN will internally act as though all responses from this bucket - * had a ?Cache-Control: public, max-age=[TTL]? header, regardless of any - * existing Cache-Control header. The actual headers served in responses will - * not be altered. - */ - signedUrlCacheMaxAgeSec: string; - /** - * [Output Only] Names of the keys currently configured for Cloud CDN Signed - * URL on this backend bucket. - */ - signedUrlKeyNames: string[]; -} -/** - * Contains a list of BackendBucket resources. - */ -export interface Schema$BackendBucketList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendBucket resources. - */ - items: Schema$BackendBucket[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A BackendService resource. This resource defines a group of backend virtual - * machines and their serving capacity. (== resource_for v1.backendService ==) - * (== resource_for beta.backendService ==) - */ -export interface Schema$BackendService { - /** - * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If - * set to 0, the cookie is non-persistent and lasts only until the end of the - * browser session (or equivalent). The maximum allowed value for TTL is one - * day. When the load balancing scheme is INTERNAL, this field is not used. - */ - affinityCookieTtlSec: number; - /** - * Directs request to an App Engine app. cloudFunctionBackend and backends[] - * must be empty if this is set. - */ - appEngineBackend: Schema$BackendServiceAppEngineBackend; - /** - * The list of backends that serve this BackendService. - */ - backends: Schema$Backend[]; - /** - * Cloud CDN configuration for this BackendService. - */ - cdnPolicy: Schema$BackendServiceCdnPolicy; - /** - * Directs request to a cloud function. appEngineBackend and backends[] must - * be empty if this is set. - */ - cloudFunctionBackend: Schema$BackendServiceCloudFunctionBackend; - connectionDraining: Schema$ConnectionDraining; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Headers that the HTTP/S load balancer should add to proxied requests. - */ - customRequestHeaders: string[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendService. When the load balancing - * scheme is INTERNAL, this field is not used. - */ - enableCDN: boolean; - failoverPolicy: Schema$BackendServiceFailoverPolicy; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a BackendService. An up-to-date fingerprint must be provided in - * order to update the BackendService. - */ - fingerprint: string; - /** - * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for - * health checking this BackendService. Currently at most one health check can - * be specified, and a health check is required for Compute Engine backend - * services. A health check must not be specified for App Engine backend and - * Cloud Function backend. For internal load balancing, a URL to a - * HealthCheck resource must be specified instead. - */ - healthChecks: string[]; - iap: Schema$BackendServiceIAP; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#backendService for backend - * services. - */ - kind: string; - /** - * Indicates whether the backend service will be used with internal or - * external load balancing. A backend service created for one type of load - * balancing cannot be used with the other. Possible values are INTERNAL and - * EXTERNAL. - */ - loadBalancingScheme: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Deprecated in favor of portName. The TCP port to connect on the backend. - * The default value is 80. This cannot be used for internal load balancing. - */ - port: number; - /** - * Name of backend port. The same name should appear in the instance groups - * referenced by this service. Required when the load balancing scheme is - * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not - * used. - */ - portName: string; - /** - * The protocol this BackendService uses to communicate with backends. - * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For - * internal load balancing, the possible values are TCP and UDP, and the - * default is TCP. - */ - protocol: string; - /** - * [Output Only] URL of the region where the regional backend service resides. - * This field is not applicable to global backend services. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] The resource URL for the security policy associated with this - * backend service. - */ - securityPolicy: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Type of session affinity to use. The default is NONE. When the load - * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. - * When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, - * CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the protocol is UDP, this - * field is not used. - */ - sessionAffinity: string; - /** - * How many seconds to wait for the backend before considering it a failed - * request. Default is 30 seconds. - */ - timeoutSec: number; -} -/** - * Contains a list of BackendServicesScopedList. - */ -export interface Schema$BackendServiceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendServicesScopedList resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Configuration of a App Engine backend. - */ -export interface Schema$BackendServiceAppEngineBackend { - /** - * Optional. App Engine app service name. - */ - appEngineService: string; - /** - * Required. Project ID of the project hosting the app. This is the project ID - * of this project. Reference to another project is not allowed. - */ - targetProject: string; - /** - * Optional. Version of App Engine app service. When empty, App Engine will do - * its normal traffic split. - */ - version: string; -} -/** - * Message containing Cloud CDN configuration for a backend service. - */ -export interface Schema$BackendServiceCdnPolicy { - /** - * The CacheKeyPolicy for this CdnPolicy. - */ - cacheKeyPolicy: Schema$CacheKeyPolicy; - /** - * Number of seconds up to which the response to a signed URL request will be - * cached in the CDN. After this time period, the Signed URL will be - * revalidated before being served. Defaults to 1hr (3600s). If this field is - * set, Cloud CDN will internally act as though all responses from this - * backend had a ?Cache-Control: public, max-age=[TTL]? header, regardless of - * any existing Cache-Control header. The actual headers served in responses - * will not be altered. - */ - signedUrlCacheMaxAgeSec: string; - /** - * [Output Only] Names of the keys currently configured for Cloud CDN Signed - * URL on this backend service. - */ - signedUrlKeyNames: string[]; -} -/** - * Configuration of a Cloud Function backend. - */ -export interface Schema$BackendServiceCloudFunctionBackend { - /** - * Required. A cloud function name. Special value ?*? represents all cloud - * functions in the project. - */ - functionName: string; - /** - * Required. Project ID of the project hosting the cloud function. - */ - targetProject: string; -} -export interface Schema$BackendServiceFailoverPolicy { - /** - * On failover or failback, this field indicates whether connection drain will - * be honored. Setting this to true has the following effect: connections to - * the old active pool are not drained. Connections to the new active pool use - * the timeout of 10 min (currently fixed). Setting to false has the following - * effect: both old and new connections will have a drain timeout of 10 min. - * This can be set to true only if the protocol is TCP. The default is false. - */ - disableConnectionDrainOnFailover: boolean; - /** - * This option is used only when no healthy VMs are detected in the primary - * and backup instance groups. When set to true, traffic is dropped. When set - * to false, new connections are sent across all VMs in the primary group. The - * default is false. - */ - dropTrafficIfUnhealthy: boolean; - /** - * The value of the field must be in [0, 1]. If the ratio of the healthy VMs - * in the primary backend is at or below this number, traffic arriving at the - * load-balanced IP will be directed to the failover backend. In case where - * 'failoverRatio' is not set or all the VMs in the backup backend are - * unhealthy, the traffic will be directed back to the primary backend in the - * "force" mode, where traffic will be spread to the healthy VMs - * with the best effort, or to all VMs when no VM is healthy. This field is - * only used with l4 load balancing. - */ - failoverRatio: number; -} -export interface Schema$BackendServiceGroupHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceGroupHealth - * for the health of backend services. - */ - kind: string; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$BackendServiceIAP { - enabled: boolean; - oauth2ClientId: string; - oauth2ClientSecret: string; - /** - * [Output Only] SHA256 hash value for the field oauth2_client_secret above. - */ - oauth2ClientSecretSha256: string; -} -/** - * Contains a list of BackendService resources. - */ -export interface Schema$BackendServiceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendService resources. - */ - items: Schema$BackendService[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceList for lists - * of backend services. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$BackendServiceReference { backendService: string; } -export interface Schema$BackendServicesScopedList { - /** - * A list of BackendServices contained in this scope. - */ - backendServices: Schema$BackendService[]; - /** - * Informational warning which replaces the list of backend services when the - * list is empty. - */ - warning: any; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * The condition that is associated with this binding. NOTE: an unsatisfied - * condition will not allow user access via current binding. Different - * bindings, including their conditions, are examined independently. This - * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. - */ - condition: Schema$Expr; - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or without a - * Google account. * `allAuthenticatedUsers`: A special identifier that - * represents anyone who is authenticated with a Google account or a service - * account. * `user:{emailid}`: An email address that represents a specific - * Google account. For example, `alice@gmail.com` or `joe@example.com`. * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. - */ - role: string; -} -export interface Schema$CacheInvalidationRule { - /** - * If set, this invalidation rule will only apply to requests with a Host - * header matching host. - */ - host: string; - path: string; -} -/** - * Message containing what to include in the cache key for a request for Cloud - * CDN. - */ -export interface Schema$CacheKeyPolicy { - /** - * If true, requests to different hosts will be cached separately. - */ - includeHost: boolean; - /** - * If true, http and https requests will be cached separately. - */ - includeProtocol: boolean; - /** - * If true, include query string parameters in the cache key according to - * query_string_whitelist and query_string_blacklist. If neither is set, the - * entire query string will be included. If false, the query string will be - * excluded from the cache key entirely. - */ - includeQueryString: boolean; - /** - * Names of query string parameters to exclude in cache keys. All other - * parameters will be included. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringBlacklist: string[]; - /** - * Names of query string parameters to include in cache keys. All other - * parameters will be excluded. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringWhitelist: string[]; -} -/** - * Represents a Commitment resource. Creating a Commitment resource means that - * you are purchasing a committed use contract with an explicit start and end - * time. You can create commitments based on vCPUs and memory usage and receive - * discounted rates. For full details, read Signing Up for Committed Use - * Discounts. Committed use discounts are subject to Google Cloud - * Platform's Service Specific Terms. By purchasing a committed use - * discount, you agree to these terms. Committed use discounts will not renew, - * so you must purchase a new commitment to continue receiving discounts. (== - * resource_for beta.commitments ==) (== resource_for v1.commitments ==) - */ -export interface Schema$Commitment { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Commitment end time in RFC3339 text format. - */ - endTimestamp: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#commitment for - * commitments. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The plan for this commitment, which determines duration and discount rate. - * The currently supported plans are TWELVE_MONTH (1 year), and - * THIRTY_SIX_MONTH (3 years). - */ - plan: string; - /** - * [Output Only] URL of the region where this commitment may be used. - */ - region: string; - /** - * A list of commitment amounts for particular resources. Note that VCPU and - * MEMORY resource commitments must occur together. - */ - resources: Schema$ResourceCommitment[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Commitment start time in RFC3339 text format. - */ - startTimestamp: string; - /** - * [Output Only] Status of the commitment with regards to eventual expiration - * (each commitment has an end date defined). One of the following values: - * NOT_YET_ACTIVE, ACTIVE, EXPIRED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; - /** - * The type of commitment, which affects the discount rate and the eligible - * resources. Type MEMORY_OPTIMIZED_VM specifies a commitment that will only - * apply to memory optimized VMs. Type NORMAL specifies a commitment that - * applies to all other resources. - */ - type: string; -} -export interface Schema$CommitmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of CommitmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#commitmentAggregatedList for - * aggregated lists of commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Commitment resources. - */ -export interface Schema$CommitmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Commitment resources. - */ - items: Schema$Commitment[]; - /** - * [Output Only] Type of resource. Always compute#commitmentList for lists of - * commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$CommitmentsScopedList { - /** - * [Output Only] A list of commitments contained in this scope. - */ - commitments: Schema$Commitment[]; - /** - * [Output Only] Informational warning which replaces the list of commitments - * when the list is empty. - */ - warning: any; -} -/** - * A condition to be met. - */ -export interface Schema$Condition { - /** - * Trusted attributes supplied by the IAM system. - */ - iam: string; - /** - * An operator to apply the subject with. - */ - op: string; - /** - * Trusted attributes discharged by the service. - */ - svc: string; - /** - * Trusted attributes supplied by any service that owns resources and uses the - * IAM system for access control. - */ - sys: string; - /** - * DEPRECATED. Use 'values' instead. - */ - value: string; - /** - * The objects of the condition. This is mutually exclusive with - * 'value'. - */ - values: string[]; -} -/** - * Message containing connection draining configuration. - */ -export interface Schema$ConnectionDraining { - /** - * Time for which instance will be drained (not accept new connections, but - * still work to finish started). - */ - drainingTimeoutSec: number; -} -/** - * Represents a customer-supplied encryption key - */ -export interface Schema$CustomerEncryptionKey { - /** - * The name of the encryption key that is stored in Google Cloud KMS. - */ - kmsKeyName: string; - /** - * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - * base64 to either encrypt or decrypt this resource. - */ - rawKey: string; - /** - * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit - * customer-supplied encryption key to either encrypt or decrypt this - * resource. The key must meet the following requirements before you can - * provide it to Compute Engine: - The key is wrapped using a RSA public key - * certificate provided by Google. - After being wrapped, the key must be - * encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate - * provided by Google at: - * https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem - */ - rsaEncryptedKey: string; - /** - * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the - * customer-supplied encryption key that protects this resource. - */ - sha256: string; -} -export interface Schema$CustomerEncryptionKeyProtectedDisk { - /** - * Decrypts data associated with the disk with a customer-supplied encryption - * key. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. This field is only applicable for persistent disks. - */ - source: string; -} -/** - * Deprecation status for a public resource. - */ -export interface Schema$DeprecationStatus { - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DELETED. This is only informational and the status - * will not change unless the client explicitly changes it. - */ - deleted: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DEPRECATED. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - deprecated: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to OBSOLETE. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - obsolete: string; - /** - * The URL of the suggested replacement for a deprecated resource. The - * suggested replacement resource must be the same kind of resource as the - * deprecated resource. - */ - replacement: string; - /** - * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, - * or DELETED. Operations which create a new resource using a DEPRECATED - * resource will return successfully, but with a warning indicating the - * deprecated resource and recommending its replacement. Operations which use - * OBSOLETE or DELETED resources will be rejected and result in an error. - */ - state: string; -} -/** - * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks - * ==) - */ -export interface Schema$Disk { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Encrypts the disk using a customer-supplied encryption key. After you - * encrypt a disk with a customer-supplied key, you must provide the same key - * if you use the disk later (e.g. to create a disk snapshot or an image, or - * to attach the disk to a virtual machine). Customer-supplied encryption - * keys do not protect access to metadata of the disk. If you do not provide - * an encryption key when creating the disk, then the disk will be encrypted - * using an automatically generated key and you do not need to provide a key - * to use the disk later. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#disk for disks. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this disk, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a disk. - */ - labelFingerprint: string; - /** - * Labels to apply to this disk. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * [Output Only] Last attach timestamp in RFC3339 text format. - */ - lastAttachTimestamp: string; - /** - * [Output Only] Last detach timestamp in RFC3339 text format. - */ - lastDetachTimestamp: string; - /** - * Integer license codes indicating which licenses are attached to this disk. - */ - licenseCodes: string[]; - /** - * Any applicable publicly visible licenses. - */ - licenses: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Internal use only. - */ - options: string; - /** - * Physical block size of the persistent disk, in bytes. If not present in a - * request, a default value is used. Initially only 4096 is supported, but - * other powers of two may be added. If an unsupported value is requested, the - * error message will list the supported values, but even a supported value - * may be allowed for only some projects. - */ - physicalBlockSizeBytes: string; - /** - * [Output Only] URL of the region where the disk resides. Only applicable for - * regional resources. You must specify this field as part of the HTTP request - * URL. It is not settable as a field in the request body. - */ - region: string; - /** - * URLs of the zones where the disk should be replicated to. Only applicable - * for regional resources. - */ - replicaZones: string[]; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * Size of the persistent disk, specified in GB. You can specify this field - * when creating a persistent disk using the sourceImage or sourceSnapshot - * parameter, or specify it alone to create an empty persistent disk. If you - * specify this field along with sourceImage or sourceSnapshot, the value of - * sizeGb must not be less than the size of the sourceImage or the size of the - * snapshot. Acceptable values are 1 to 65536, inclusive. - */ - sizeGb: string; - /** - * The source image used to create this disk. If the source image is deleted, - * this field will not be set. To create a disk with one of the public - * operating system images, specify the image by its family name. For example, - * specify family/debian-8 to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this disk. This - * value identifies the exact image that was used to create this persistent - * disk. For example, if you created the persistent disk from an image that - * was later deleted and recreated under the same name, the source image ID - * would identify the exact version of the image that was used. - */ - sourceImageId: string; - /** - * The source snapshot used to create this disk. You can provide this as a - * partial or full URL to the resource. For example, the following are valid - * values: - - * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot - * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The unique ID of the snapshot used to create this disk. This - * value identifies the exact snapshot that was used to create this persistent - * disk. For example, if you created the persistent disk from a snapshot that - * was later deleted and recreated under the same name, the source snapshot ID - * would identify the exact version of the snapshot that was used. - */ - sourceSnapshotId: string; - /** - * [Output Only] The status of disk creation. - */ - status: string; - /** - * [Deprecated] Storage type of the persistent disk. - */ - storageType: string; - /** - * URL of the disk type resource describing which disk type to use to create - * the disk. Provide this when creating the disk. For example: - * project/zones/zone/diskTypes/pd-standard or pd-ssd - */ - type: string; - /** - * [Output Only] Links to the users of the disk (attached instances) in form: - * project/zones/zone/instances/instance - */ - users: string[]; - /** - * [Output Only] URL of the zone where the disk resides. You must specify this - * field as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$DiskAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DisksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskAggregatedList for - * aggregated lists of persistent disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A specification of the desired way to instantiate a disk in the instance - * template when its created from a source instance. - */ -export interface Schema$DiskInstantiationConfig { - /** - * Specifies whether the disk will be auto-deleted when the instance is - * deleted (but not when the disk is detached from the instance). - */ - autoDelete: boolean; - /** - * The custom source image to be used to restore this disk when instantiating - * this instance template. - */ - customImage: string; - /** - * Specifies the device name of the disk to which the configurations apply to. - */ - deviceName: string; - /** - * Specifies whether to include the disk and what image to use. Possible - * values are: - source-image: to use the same image that was used to create - * the source instance's corresponding disk. Applicable to the boot disk - * and additional read-write disks. - source-image-family: to use the same - * image family that was used to create the source instance's - * corresponding disk. Applicable to the boot disk and additional read-write - * disks. - custom-image: to use a user-provided image url for disk creation. - * Applicable to the boot disk and additional read-write disks. - - * attach-read-only: to attach a read-only disk. Applicable to read-only - * disks. - do-not-include: to exclude a disk from the template. Applicable - * to additional read-write disks, local SSDs, and read-only disks. - */ - instantiateFrom: string; -} -/** - * A list of Disk resources. - */ -export interface Schema$DiskList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Disk resources. - */ - items: Schema$Disk[]; - /** - * [Output Only] Type of resource. Always compute#diskList for lists of disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskMoveRequest { - /** - * The URL of the destination zone to move the disk. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target disk to move. This can be a full or partial URL. For - * example, the following are all valid URLs to a disk: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - targetDisk: string; -} -export interface Schema$DisksResizeRequest { - /** - * The new size of the persistent disk, which is specified in GB. - */ - sizeGb: string; -} -export interface Schema$DisksScopedList { - /** - * [Output Only] A list of disks contained in this scope. - */ - disks: Schema$Disk[]; - /** - * [Output Only] Informational warning which replaces the list of disks when - * the list is empty. - */ - warning: any; -} -/** - * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for - * v1.diskTypes ==) - */ -export interface Schema$DiskType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Server-defined default disk size in GB. - */ - defaultDiskSizeGb: string; - /** - * [Output Only] The deprecation status associated with this disk type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional description of this resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#diskType for disk types. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] An optional textual description of the valid disk size, such - * as "10GB-10TB". - */ - validDiskSize: string; - /** - * [Output Only] URL of the zone where the disk type resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$DiskTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of disk types. - */ -export interface Schema$DiskTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskType resources. - */ - items: Schema$DiskType[]; - /** - * [Output Only] Type of resource. Always compute#diskTypeList for disk types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskTypesScopedList { - /** - * [Output Only] A list of disk types contained in this scope. - */ - diskTypes: Schema$DiskType[]; - /** - * [Output Only] Informational warning which replaces the list of disk types - * when the list is empty. - */ - warning: any; -} -export interface Schema$DistributionPolicy { - zones: Schema$DistributionPolicyZoneConfiguration[]; -} -export interface Schema$DistributionPolicyZoneConfiguration { - /** - * URL of the zone where managed instance group is spawning instances (for - * regional resources). Zone has to belong to the region where managed - * instance group is located. - */ - zone: string; -} -/** - * Represents an expression text. Example: title: "User account - * presence" description: "Determines whether the request has a user - * account" expression: "size(request.user) > 0" - */ -export interface Schema$Expr { - /** - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - */ - description: string; - /** - * Textual representation of an expression in Common Expression Language - * syntax. The application context of the containing message determines which - * well-known feature set of CEL is supported. - */ - expression: string; - /** - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - */ - location: string; - /** - * An optional title for the expression, i.e. a short string describing its - * purpose. This can be used e.g. in UIs which allow to enter the expression. - */ - title: string; -} -/** - * Represents a Firewall resource. - */ -export interface Schema$Firewall { - /** - * The list of ALLOW rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a permitted connection. - */ - allowed: any[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The list of DENY rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a denied connection. - */ - denied: any[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If destination ranges are specified, the firewall will apply only to - * traffic that has destination IP address in these ranges. These ranges must - * be expressed in CIDR format. Only IPv4 is supported. - */ - destinationRanges: string[]; - /** - * Direction of traffic to which this firewall applies; default is INGRESS. - * Note: For INGRESS traffic, it is NOT supported to specify - * destinationRanges; For EGRESS traffic, it is NOT supported to specify - * sourceRanges OR sourceTags. - */ - direction: string; - /** - * Denotes whether the firewall rule is disabled, i.e not applied to the - * network it is associated with. When set to true, the firewall rule is not - * enforced and the network behaves as if it did not exist. If this is - * unspecified, the firewall rule will be enabled. - */ - disabled: boolean; - /** - * This field denotes whether to enable logging for a particular firewall - * rule. If logging is enabled, logs will be exported to the configured export - * destination for all firewall logs in the network. Logs may be exported to - * BigQuery or Pub/Sub. - */ - enableLogging: boolean; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#firewall for firewall - * rules. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network resource for this firewall rule. If not specified when - * creating a firewall rule, the default network is used: - * global/networks/default If you choose to specify this property, you can - * specify the network as a full or partial URL. For example, the following - * are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - * - projects/myproject/global/networks/my-network - global/networks/default - */ - network: string; - /** - * Priority for this rule. This is an integer between 0 and 65535, both - * inclusive. When not specified, the value assumed is 1000. Relative - * priorities determine precedence of conflicting rules. Lower value of - * priority implies higher precedence (eg, a rule with priority 0 has higher - * precedence than a rule with priority 1). DENY rules take precedence over - * ALLOW rules having equal priority. - */ - priority: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If source ranges are specified, the firewall will apply only to traffic - * that has source IP address in these ranges. These ranges must be expressed - * in CIDR format. One or both of sourceRanges and sourceTags may be set. If - * both properties are set, the firewall will apply to traffic that has source - * IP address within sourceRanges OR the source IP that belongs to a tag - * listed in the sourceTags property. The connection does not need to match - * both properties for the firewall to apply. Only IPv4 is supported. - */ - sourceRanges: string[]; - /** - * If source service accounts are specified, the firewall will apply only to - * traffic originating from an instance with a service account in this list. - * Source service accounts cannot be used to control traffic to an - * instance's external IP address because service accounts are associated - * with an instance, not an IP address. sourceRanges can be set at the same - * time as sourceServiceAccounts. If both are set, the firewall will apply to - * traffic that has source IP address within sourceRanges OR the source IP - * belongs to an instance with service account listed in sourceServiceAccount. - * The connection does not need to match both properties for the firewall to - * apply. sourceServiceAccounts cannot be used at the same time as sourceTags - * or targetTags. - */ - sourceServiceAccounts: string[]; - /** - * If source tags are specified, the firewall rule applies only to traffic - * with source IPs that match the primary network interfaces of VM instances - * that have the tag and are in the same VPC network. Source tags cannot be - * used to control traffic to an instance's external IP address, it only - * applies to traffic between instances in the same virtual network. Because - * tags are associated with instances, not IP addresses. One or both of - * sourceRanges and sourceTags may be set. If both properties are set, the - * firewall will apply to traffic that has source IP address within - * sourceRanges OR the source IP that belongs to a tag listed in the - * sourceTags property. The connection does not need to match both properties - * for the firewall to apply. - */ - sourceTags: string[]; - /** - * A list of service accounts indicating sets of instances located in the - * network that may make network connections as specified in allowed[]. - * targetServiceAccounts cannot be used at the same time as targetTags or - * sourceTags. If neither targetServiceAccounts nor targetTags are specified, - * the firewall rule applies to all instances on the specified network. - */ - targetServiceAccounts: string[]; - /** - * A list of tags that controls which instances the firewall rule applies to. - * If targetTags are specified, then the firewall rule applies only to - * instances in the VPC network that have one of those tags. If no targetTags - * are specified, the firewall rule applies to all instances on the specified - * network. - */ - targetTags: string[]; -} -/** - * Contains a list of firewalls. - */ -export interface Schema$FirewallList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Firewall resources. - */ - items: Schema$Firewall[]; - /** - * [Output Only] Type of resource. Always compute#firewallList for lists of - * firewalls. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Encapsulates numeric value that can be either absolute or relative. - */ -export interface Schema$FixedOrPercent { - /** - * [Output Only] Absolute value of VM instances calculated based on the - * specific mode. - If the value is fixed, then the caculated value is - * equal to the fixed value. - If the value is a percent, then the calculated - * value is percent/100 * targetSize. For example, the calculated value of a - * 80% of a managed instance group with 150 instances would be (80/100 * 150) - * = 120 VM instances. If there is a remainder, the number is rounded up. - */ - calculated: number; - /** - * Specifies a fixed number of VM instances. This must be a positive integer. - */ - fixed: number; - /** - * Specifies a percentage of instances between 0 to 100%, inclusive. For - * example, specify 80 for 80%. - */ - percent: number; -} -/** - * A ForwardingRule resource. A ForwardingRule resource specifies which pool of - * target virtual machines to forward a packet to if it matches the given - * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules - * ==) (== resource_for v1.forwardingRules ==) (== resource_for - * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) - * (== resource_for beta.regionForwardingRules ==) (== resource_for - * v1.regionForwardingRules ==) - */ -export interface Schema$ForwardingRule { - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the BackendService resource to receive the - * matched traffic. - */ - backendService: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a ForwardingRule. Include the fingerprint in patch request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. To see the latest fingerprint, make a get() request to - * retrieve a ForwardingRule. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP address that this forwarding rule is serving on behalf of. Addresses - * are restricted based on the forwarding rule's load balancing scheme - * (EXTERNAL or INTERNAL) and scope (global or regional). When the load - * balancing scheme is EXTERNAL, for global forwarding rules, the address must - * be a global IP, and for regional forwarding rules, the address must live in - * the same region as the forwarding rule. If this field is empty, an - * ephemeral IPv4 address from the same scope (global or regional) will be - * assigned. A regional forwarding rule supports IPv4 only. A global - * forwarding rule supports either IPv4 or IPv6. When the load balancing - * scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to - * the network/subnet configured for the forwarding rule. By default, if this - * field is empty, an ephemeral internal IP address will be automatically - * allocated from the IP range of the subnet or network configured for this - * forwarding rule. An address can be specified either by a literal IP - * address or a URL reference to an existing Address resource. The following - * examples are all valid: - 100.1.2.3 - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address - * - projects/project/regions/region/addresses/address - - * regions/region/addresses/address - global/addresses/address - address - */ - IPAddress: string; - /** - * The IP protocol to which this rule applies. Valid options are TCP, UDP, - * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only - * TCP and UDP are valid. - */ - IPProtocol: string; - /** - * The IP Version that will be used by this forwarding rule. Valid options are - * IPV4 or IPV6. This can only be specified for a global forwarding rule. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#forwardingRule for - * Forwarding Rule resources. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this resource, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a ForwardingRule. - */ - labelFingerprint: string; - /** - * Labels to apply to this resource. These can be later modified by the - * setLabels method. Each label key/value pair must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * This signifies what the ForwardingRule will be used for and can only take - * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that - * this will be used for Internal Network Load Balancing (TCP, UDP). The value - * of EXTERNAL means that this will be used for External Load Balancing - * (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) - */ - loadBalancingScheme: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the network that the load balanced IP - * should belong to for this Forwarding Rule. If this field is not specified, - * the default network will be used. - */ - network: string; - /** - * This signifies the networking tier used for configuring this load balancer - * and can only take the following values: PREMIUM , STANDARD. For regional - * ForwardingRule, the valid values are PREMIUM and STANDARD. For - * GlobalForwardingRule, the valid value is PREMIUM. If this field is not - * specified, it is assumed to be PREMIUM. If IPAddress is specified, this - * value must be equal to the networkTier of the Address. - */ - networkTier: string; - /** - * This field is used along with the target field for TargetHttpProxy, - * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, - * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, - * or SCTP, only packets addressed to ports in the specified range will be - * forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] - * pair must have disjoint port ranges. Some types of forwarding target have - * constraints on the acceptable ports: - TargetHttpProxy: 80, 8080 - - * TargetHttpsProxy: 443 - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, - * 587, 700, 993, 995, 1688, 1883, 5222 - TargetSslProxy: 25, 43, 110, 143, - * 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - TargetVpnGateway: - * 500, 4500 - */ - portRange: string; - /** - * This field is used along with the backend_service field for internal load - * balancing. When the load balancing scheme is INTERNAL, a single port or a - * comma separated list of ports can be configured. Only packets addressed to - * these ports will be forwarded to the backends configured with this - * forwarding rule. You may specify a maximum of up to 5 ports. - */ - ports: string[]; - /** - * [Output Only] URL of the region where the regional forwarding rule resides. - * This field is not applicable to global forwarding rules. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * An optional prefix to the service name for this Forwarding Rule. If - * specified, will be the first label of the fully qualified service name. The - * label must be 1-63 characters long, and comply with RFC1035. Specifically, - * the label must be 1-63 characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase - * letter, or digit, except the last character, which cannot be a dash. This - * field is only used for internal load balancing. - */ - serviceLabel: string; - /** - * [Output Only] The internal fully qualified service name for this Forwarding - * Rule. This field is only used for internal load balancing. - */ - serviceName: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the subnetwork that the load balanced IP - * should belong to for this Forwarding Rule. If the network specified is in - * auto subnet mode, this field is optional. However, if the network is in - * custom subnet mode, a subnetwork must be specified. - */ - subnetwork: string; - /** - * The URL of the target resource to receive the matched traffic. For regional - * forwarding rules, this target must live in the same region as the - * forwarding rule. For global forwarding rules, this target must be a global - * load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. - */ - target: string; -} -export interface Schema$ForwardingRuleAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRulesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList - * for lists of forwarding rules. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of ForwardingRule resources. - */ -export interface Schema$ForwardingRuleList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRule resources. - */ - items: Schema$ForwardingRule[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ForwardingRuleReference { forwardingRule: string; } -export interface Schema$ForwardingRulesScopedList { - /** - * A list of forwarding rules contained in this scope. - */ - forwardingRules: Schema$ForwardingRule[]; - /** - * Informational warning which replaces the list of forwarding rules when the - * list is empty. - */ - warning: any; -} -export interface Schema$GlobalSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash when updating or changing labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * A list of labels to apply for this resource. Each label key & value - * must comply with RFC1035. Specifically, the name must be 1-63 characters - * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which - * means the first character must be a lowercase letter, and all following - * characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. For example, - * "webserver-frontend": "images". A label value can also - * be empty (e.g. "my-label": ""). - */ - labels: any; -} -/** - * A guest attributes entry. - */ -export interface Schema$GuestAttributes { - /** - * [Output Only] Type of the resource. Always compute#guestAttributes for - * guest attributes entry. - */ - kind: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * The key to search for. - */ - variableKey: string; - /** - * [Output Only] The value found for the requested key. - */ - variableValue: string; -} -/** - * Guest OS features. - */ -export interface Schema$GuestOsFeature { - /** - * The ID of a supported feature. Read Enabling guest operating system - * features to see a list of available options. - */ - type: string; -} -/** - * An HealthCheck resource. This resource defines a template for how individual - * virtual machines should be checked for health, via one of the supported - * protocols. - */ -export interface Schema$HealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in 3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - http2HealthCheck: Schema$HTTP2HealthCheck; - httpHealthCheck: Schema$HTTPHealthCheck; - httpsHealthCheck: Schema$HTTPSHealthCheck; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Region where the health check resides. Not applicable to - * global health checks. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - sslHealthCheck: Schema$SSLHealthCheck; - tcpHealthCheck: Schema$TCPHealthCheck; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If - * not specified, the default is TCP. Exactly one of the protocol-specific - * health check field must be specified, which must match type field. - */ - type: string; - udpHealthCheck: Schema$UDPHealthCheck; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -/** - * Contains a list of HealthCheck resources. - */ -export interface Schema$HealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HealthCheck resources. - */ - items: Schema$HealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A full or valid partial URL to a health check. For example, the following are - * valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check - * - projects/project-id/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ -export interface Schema$HealthCheckReference { healthCheck: string; } -export interface Schema$HealthChecksAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HealthChecksScopedList resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$HealthChecksScopedList { - /** - * A list of HealthChecks contained in this scope. - */ - healthChecks: Schema$HealthCheck[]; - /** - * Informational warning which replaces the list of backend services when the - * list is empty. - */ - warning: any; -} -export interface Schema$HealthStatus { - /** - * Health state of the instance. - */ - healthState: string; - /** - * URL of the instance resource. - */ - instance: string; - /** - * The IP address represented by this resource. - */ - ipAddress: string; - /** - * The port on the instance. - */ - port: number; -} -export interface Schema$HealthStatusForNetworkEndpoint { - /** - * URL of the backend service associated with the health state of the network - * endpoint. - */ - backendService: Schema$BackendServiceReference; - /** - * URL of the forwarding rule associated with the health state of the network - * endpoint. - */ - forwardingRule: Schema$ForwardingRuleReference; - /** - * URL of the health check associated with the health state of the network - * endpoint. - */ - healthCheck: Schema$HealthCheckReference; - /** - * Health state of the network endpoint determined based on the health checks - * configured. - */ - healthState: string; -} -export interface Schema$Host { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * Full or partial URL of the host type resource to use for this host, in the - * format: zones/zone/hostTypes/host-type. This is provided by the client when - * the host is created. For example, the following is a valid partial url to a - * predefined host type: zones/us-central1-b/hostTypes/n1-host-64-416 - */ - hostType: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A list of resource URLs to the virtual machine instances in this host. They - * must live in zones contained in the same region as this host. - */ - instances: string[]; - /** - * [Output Only] The type of the resource. Always compute#host for host. - */ - kind: string; - /** - * A fingerprint for this request, which is essentially a hash of the - * metadata's contents and used for optimistic locking. The fingerprint is - * initially generated by Compute Engine and changes after every request to - * modify or update metadata. You must always provide an up-to-date - * fingerprint hash in order to update or change metadata. To see the latest - * fingerprint, make get() request to the host. - */ - labelFingerprint: string; - /** - * Labels to apply to this host. - */ - labels: any; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the host. One of the following values: - * CREATING, READY, REPAIR, and DELETING. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; - /** - * [Output Only] The name of the zone where the host resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$HostAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HostsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#hostAggregatedList for - * aggregated lists of hosts. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of hosts. - */ -export interface Schema$HostList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Host resources. - */ - items: Schema$Host[]; - /** - * [Output Only] Type of resource. Always compute#hostList for lists of hosts. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * UrlMaps A host-matching rule for a URL. If matched, will use the named - * PathMatcher to select the BackendService. - */ -export interface Schema$HostRule { - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The list of host patterns to match. They must be valid hostnames, except * - * will match any string of ([a-z0-9-.]*). In that case, * must be the first - * character and must be followed in the pattern by either - or .. - */ - hosts: string[]; - /** - * The name of the PathMatcher to use to match the path portion of the URL if - * the hostRule matches the URL's host portion. - */ - pathMatcher: string; -} -export interface Schema$HostsScopedList { - /** - * [Output Only] A list of hosts contained in this scope. - */ - hosts: Schema$Host[]; - /** - * [Output Only] An informational warning that appears when the host list is - * empty. - */ - warning: any; -} -/** - * A Host Type resource. - */ -export interface Schema$HostType { - /** - * [Output Only] The CPU platform used by this host type. - */ - cpuPlatform: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this host type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The number of virtual CPUs that are available to the host - * type. - */ - guestCpus: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#hostType for host - * types. - */ - kind: string; - /** - * [Output Only] Local SSD available to the host type, defined in GB. - */ - localSsdGb: number; - /** - * [Output Only] The amount of physical memory available to the host type, - * defined in MB. - */ - memoryMb: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the host type resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$HostTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HostTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource.Always compute#hostTypeAggregatedList for - * aggregated lists of host types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of host types. - */ -export interface Schema$HostTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HostType resources. - */ - items: Schema$HostType[]; - /** - * [Output Only] Type of resource.Always compute#hostTypeList for lists of - * host types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$HostTypesScopedList { - /** - * [Output Only] A list of host types contained in this scope. - */ - hostTypes: Schema$HostType[]; - /** - * [Output Only] An informational warning that appears when the host types - * list is empty. - */ - warning: any; -} -export interface Schema$HTTP2HealthCheck { - /** - * The value of the host header in the HTTP/2 health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies how port is selected for health checking, can be one of following - * values: USE_FIXED_PORT: The port number in port is used for health - * checking. USE_NAMED_PORT: The portName is used for health checking. - * USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each - * network endpoint is used for health checking. For other backends, the port - * or named port specified in the Backend Service is used for health checking. - * If not specified, HTTP2 health check follows behavior specified in port and - * portName fields. - */ - portSpecification: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTP/2 health check request. The default value is - * /. - */ - requestPath: string; - /** - * The string to match anywhere in the first 1024 bytes of the response body. - * If left empty (the default value), the status code determines health. The - * response data can only be ASCII. - */ - response: string; -} -/** - * An HttpHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTP. - */ -export interface Schema$HttpHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#httpHealthCheck for HTTP - * health checks. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTP health check request. The default value - * is 80. - */ - port: number; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPHealthCheck { - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies how port is selected for health checking, can be one of following - * values: USE_FIXED_PORT: The port number in port is used for health - * checking. USE_NAMED_PORT: The portName is used for health checking. - * USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each - * network endpoint is used for health checking. For other backends, the port - * or named port specified in the Backend Service is used for health checking. - * If not specified, HTTP health check follows behavior specified in port and - * portName fields. - */ - portSpecification: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; - /** - * The string to match anywhere in the first 1024 bytes of the response body. - * If left empty (the default value), the status code determines health. The - * response data can only be ASCII. - */ - response: string; -} -/** - * Contains a list of HttpHealthCheck resources. - */ -export interface Schema$HttpHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpHealthCheck resources. - */ - items: Schema$HttpHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An HttpsHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTPS. - */ -export interface Schema$HttpsHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTPS health check request. The default value - * is 443. - */ - port: number; - /** - * The request path of the HTTPS health check request. The default value is - * "/". - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have a greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPSHealthCheck { - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies how port is selected for health checking, can be one of following - * values: USE_FIXED_PORT: The port number in port is used for health - * checking. USE_NAMED_PORT: The portName is used for health checking. - * USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each - * network endpoint is used for health checking. For other backends, the port - * or named port specified in the Backend Service is used for health checking. - * If not specified, HTTPS health check follows behavior specified in port and - * portName fields. - */ - portSpecification: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTPS health check request. The default value is /. - */ - requestPath: string; - /** - * The string to match anywhere in the first 1024 bytes of the response body. - * If left empty (the default value), the status code determines health. The - * response data can only be ASCII. - */ - response: string; -} -/** - * Contains a list of HttpsHealthCheck resources. - */ -export interface Schema$HttpsHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpsHealthCheck resources. - */ - items: Schema$HttpsHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Image resource. (== resource_for beta.images ==) (== resource_for - * v1.images ==) - */ -export interface Schema$Image { - /** - * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). - */ - archiveSizeBytes: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The deprecation status associated with this image. - */ - deprecated: Schema$DeprecationStatus; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Size of the image when restored onto a persistent disk (in GB). - */ - diskSizeGb: string; - /** - * The name of the image family to which this image belongs. You can create - * disks by specifying an image family instead of a specific image name. The - * image family always returns its latest image that is not deprecated. The - * name of the image family must comply with RFC1035. - */ - family: string; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Encrypts the image using a customer-supplied encryption key. After you - * encrypt an image with a customer-supplied key, you must provide the same - * key if you use the image later (e.g. to create a disk from the image). - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the image, - * then the disk will be encrypted using an automatically generated key and - * you do not need to provide a key to use the image later. - */ - imageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] Type of the resource. Always compute#image for images. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this image, which is - * essentially a hash of the labels used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an image. - */ - labelFingerprint: string; - /** - * Labels to apply to this image. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this image. - */ - licenseCodes: string[]; - /** - * Any applicable license URI. - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The parameters of the raw disk image. - */ - rawDisk: any; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL of the source disk used to create this image. This can be a full or - * valid partial URL. You must provide either this property or the - * rawDisk.source property but not both to create an image. For example, the - * following are valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * The ID value of the disk used to create this image. This value may be used - * to determine whether the image was taken from the current or a previous - * instance of a given disk name. - */ - sourceDiskId: string; - /** - * URL of the source image used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the rawDisk.source property, or - the sourceDisk property in order to - * create an image. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this image. This - * value may be used to determine whether the image was taken from the current - * or a previous instance of a given image name. - */ - sourceImageId: string; - /** - * URL of the source snapshot used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the sourceImage property, or - the rawDisk.source property, or - the - * sourceDisk property in order to create an image. - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the snapshot used to create this image. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given snapshot name. - */ - sourceSnapshotId: string; - /** - * The type of the image used to create this disk. The default and only value - * is RAW - */ - sourceType: string; - /** - * [Output Only] The status of the image. An image can be used to create other - * resources, such as instances, only after the image has been successfully - * created and the status is set to READY. Possible values are FAILED, - * PENDING, or READY. - */ - status: string; -} -/** - * Contains a list of images. - */ -export interface Schema$ImageList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Image resources. - */ - items: Schema$Image[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance resource. (== resource_for beta.instances ==) (== resource_for - * v1.instances ==) - */ -export interface Schema$Instance { - /** - * Allows this instance to send and receive packets with non-matching - * destination or source IPs. This is required if you plan to use this - * instance to forward routes. For more information, see Enabling IP - * Forwarding. - */ - canIpForward: boolean; - /** - * [Output Only] The CPU platform used by this instance. - */ - cpuPlatform: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Whether the resource should be protected against deletion. - */ - deletionProtection: boolean; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Array of disks associated with this instance. Persistent disks must be - * created before you can assign them. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * Full or partial URL of the host resource that the instance should be placed - * on, in the format: zones/zone/hosts/host. Optional, sole-tenant Host - * (physical machine) that the instance will be placed on when it's - * created. The instance is guaranteed to be placed on the same machine as - * other instances with the same sole-tenant host. The request will be - * rejected if the sole-tenant host has run out of resources. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Encrypts or decrypts data for an instance with a customer-supplied - * encryption key. If you are creating a new instance, this field encrypts - * the local SSD and in-memory contents of the instance using a key that you - * provide. If you are restarting an instance protected with a - * customer-supplied encryption key, you must provide the correct key in order - * to successfully restart the instance. If you do not provide an encryption - * key when creating the instance, then the local SSD and in-memory contents - * will be encrypted using an automatically generated key and you do not need - * to provide a key to start the instance later. Instance templates do not - * store customer-supplied encryption keys, so you cannot use your own keys to - * encrypt local SSDs and in-memory content in a managed instance group. - */ - instanceEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] Type of the resource. Always compute#instance for instances. - */ - kind: string; - /** - * A fingerprint for this request, which is essentially a hash of the - * metadata's contents and used for optimistic locking. The fingerprint is - * initially generated by Compute Engine and changes after every request to - * modify or update metadata. You must always provide an up-to-date - * fingerprint hash in order to update or change metadata. To see the latest - * fingerprint, make get() request to the instance. - */ - labelFingerprint: string; - /** - * Labels to apply to this instance. These can be later modified by the - * setLabels method. - */ - labels: any; - /** - * Full or partial URL of the machine type resource to use for this instance, - * in the format: zones/zone/machineTypes/machine-type. This is provided by - * the client when the instance is created. For example, the following is a - * valid partial url to a predefined machine type: - * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine - * type, provide a URL to a machine type in the following format, where CPUS - * is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the - * total memory for this instance. Memory must be a multiple of 256 MB and - * must be supplied in MB (e.g. 5 GB of memory is 5120 MB): - * zones/zone/machineTypes/custom-CPUS-MEMORY For example: - * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of - * restrictions, read the Specifications for custom machine types. - */ - machineType: string; - /** - * The metadata key/value pairs assigned to this instance. This includes - * custom metadata and predefined keys. - */ - metadata: Schema$Metadata; - /** - * Specifies a minimum CPU platform for the VM instance. Applicable values are - * the friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". - */ - minCpuPlatform: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * An array of network configurations for this instance. These specify how - * interfaces are configured to interact with other network services, such as - * connecting to the internet. Multiple interfaces are supported per instance. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Total amount of preserved state for SUSPENDED instances. Read-only in the - * api. - */ - preservedStateSizeGb: string; - /** - * Sets the scheduling options for this instance. - */ - scheduling: Schema$Scheduling; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * A list of service accounts, with their specified scopes, authorized for - * this instance. Only one service account per VM instance is supported. - * Service accounts generate access tokens that can be accessed through the - * metadata server and used to authenticate applications on the instance. See - * Service Accounts for more information. - */ - serviceAccounts: Schema$ServiceAccount[]; - shieldedVmConfig: Schema$ShieldedVmConfig; - shieldedVmIntegrityPolicy: Schema$ShieldedVmIntegrityPolicy; - /** - * [Output Only] Whether a VM has been restricted for start because Compute - * Engine has detected suspicious activity. - */ - startRestricted: boolean; - /** - * [Output Only] The status of the instance. One of the following values: - * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, - * and TERMINATED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; - /** - * A list of tags to apply to this instance. Tags are used to identify valid - * sources or targets for network firewalls and are specified by the client - * during instance creation. The tags can be later modified by the setTags - * method. Each tag within the list must comply with RFC1035. - */ - tags: Schema$Tags; - /** - * [Output Only] URL of the zone where the instance resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$InstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstancesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#instanceAggregatedList for - * aggregated lists of Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for - * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== - * resource_for v1.regionInstanceGroups ==) - */ -export interface Schema$InstanceGroup { - /** - * [Output Only] The creation timestamp for this instance group in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The fingerprint of the named ports. The system uses this - * fingerprint to detect conflicts when multiple users change the named ports - * concurrently. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this instance group, generated by the - * server. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceGroup for - * instance groups. - */ - kind: string; - /** - * The name of the instance group. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * Assigns a name to a port number. For example: {name: "http", - * port: 80} This allows the system to reference ports by the assigned name - * instead of a port number. Named ports can also contain multiple ports. For - * example: [{name: "http", port: 80},{name: "http", port: - * 8080}] Named ports apply to all instances in this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * The URL of the network to which all instances in the instance group belong. - */ - network: string; - /** - * [Output Only] The URL of the region where the instance group is located - * (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this instance group. The server generates this - * URL. - */ - selfLink: string; - /** - * [Output Only] The total number of instances in the instance group. - */ - size: number; - /** - * [Output Only] The URL of the subnetwork to which all instances in the - * instance group belong. - */ - subnetwork: string; - /** - * [Output Only] The URL of the zone where the instance group is located (for - * zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupsScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupAggregatedList for aggregated lists of instance - * groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A list of InstanceGroup resources. - */ -export interface Schema$InstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * [Output Only] The resource type, which is always compute#instanceGroupList - * for instance group lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance Group Manager resource. (== resource_for - * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) - * (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for - * v1.regionInstanceGroupManagers ==) - */ -export interface Schema$InstanceGroupManager { - activities: Schema$InstanceGroupManagerActivities; - /** - * The autohealing policy for this managed instance group. You can specify - * only one value. - */ - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; - /** - * The base instance name to use for instances in this group. The value must - * be 1-58 characters long. Instances are named by appending a hyphen and a - * random four-character string to the base instance name. The base instance - * name must comply with RFC1035. - */ - baseInstanceName: string; - /** - * [Output Only] The creation timestamp for this managed instance group in - * RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The list of instance actions and the number of instances in - * this managed instance group that are scheduled for each of those actions. - */ - currentActions: Schema$InstanceGroupManagerActionsSummary; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Policy valid only for regional managed instance groups. - */ - distributionPolicy: Schema$DistributionPolicy; - /** - * The action to perform in case of zone failure. Only one value is supported, - * NO_FAILOVER. The default is NO_FAILOVER. - */ - failoverAction: string; - /** - * [Output Only] The fingerprint of the resource data. You can use this - * optional field for optimistic locking when you update the resource. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this resource type. The server - * generates this identifier. - */ - id: string; - /** - * [Output Only] The URL of the Instance Group resource. - */ - instanceGroup: string; - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManager for managed instance groups. - */ - kind: string; - /** - * The name of the managed instance group. The name must be 1-63 characters - * long, and comply with RFC1035. - */ - name: string; - /** - * Named ports configured for the Instance Groups complementary to this - * Instance Group Manager. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The list of instance actions and the number of instances in - * this managed instance group that are pending for each of those actions. - */ - pendingActions: Schema$InstanceGroupManagerPendingActionsSummary; - /** - * [Output Only] The URL of the region where the managed instance group - * resides (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this managed instance group. The server defines - * this URL. - */ - selfLink: string; - /** - * [Output Only] The service account to be used as credentials for all - * operations performed by the managed instance group on instances. The - * service accounts needs all permissions required to create and delete - * instances. By default, the service account - * {projectNumber}@cloudservices.gserviceaccount.com is used. - */ - serviceAccount: string; - /** - * Stateful configuration for this Instanced Group Manager - */ - statefulPolicy: Schema$StatefulPolicy; - /** - * The URLs for all TargetPool resources to which instances in the - * instanceGroup field are added. The target pools automatically apply to all - * of the instances in the managed instance group. - */ - targetPools: string[]; - /** - * The target number of running instances for this managed instance group. - * Deleting or abandoning instances reduces this number. Resizing the group - * changes this number. - */ - targetSize: number; - /** - * The update policy for this managed instance group. - */ - updatePolicy: Schema$InstanceGroupManagerUpdatePolicy; - /** - * Specifies the instance templates used by this managed instance group to - * create instances. Each version is defined by an instanceTemplate. Every - * template can appear at most once per instance group. This field overrides - * the top-level instanceTemplate field. Read more about the relationships - * between these fields. Exactly one version must leave the targetSize field - * unset. That version will be applied to all remaining instances. For more - * information, read about canary updates. - */ - versions: Schema$InstanceGroupManagerVersion[]; - /** - * [Output Only] The URL of the zone where the managed instance group is - * located (for zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupManagerActionsSummary { - /** - * [Output Only] The total number of instances in the managed instance group - * that are scheduled to be abandoned. Abandoning an instance removes it from - * the managed instance group without deleting it. - */ - abandoning: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be created or are currently being created. If the group - * fails to create any of these instances, it tries again until it creates the - * instance successfully. If you have disabled creation retries, this field - * will not be populated; instead, the creatingWithoutRetries field will be - * populated. - */ - creating: number; - /** - * [Output Only] The number of instances that the managed instance group will - * attempt to create. The group attempts to create each instance only once. If - * the group fails to create any of these instances, it decreases the - * group's targetSize value accordingly. - */ - creatingWithoutRetries: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be deleted or are currently being deleted. - */ - deleting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are running and have no scheduled actions. - */ - none: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be recreated or are currently being being recreated. - * Recreating an instance deletes the existing root persistent disk and - * creates a new disk from the image that is defined in the instance template. - */ - recreating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are being reconfigured with properties that do not require a restart or a - * recreate action. For example, setting or removing target pools for the - * instance. - */ - refreshing: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be restarted or are currently being restarted. - */ - restarting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are being verified. See the managedInstances[].currentAction property in - * the listManagedInstances method documentation. - */ - verifying: number; -} -export interface Schema$InstanceGroupManagerActivities { - autohealing: string; - autohealingHealthCheckBased: string; - autoscalingDown: string; - autoscalingUp: string; - creatingInstances: string; - deletingInstances: string; - recreatingInstances: string; -} -export interface Schema$InstanceGroupManagerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManagersScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerAggregatedList for an aggregated list of - * managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagerAutoHealingPolicy { - /** - * The URL for the health check that signals autohealing. - */ - healthCheck: string; - /** - * The number of seconds that the managed instance group waits before it - * applies autohealing policies to new instances or recently recreated - * instances. This initial delay allows instances to initialize and run their - * startup scripts before the instance group determines that they are - * UNHEALTHY. This prevents the managed instance group from recreating its - * instances prematurely. This value must be from range [0, 3600]. - */ - initialDelaySec: number; - /** - * Maximum number of instances that can be unavailable when autohealing. The - * instance is considered available if all of the following conditions are - * satisfied: 1. Instance's status is RUNNING. 2. Instance's liveness - * health check result was observed to be HEALTHY at least once. By default, a - * percent value of 100% is used. - */ - maxUnavailable: Schema$FixedOrPercent; - /** - * Defines operating mode for this policy. - */ - mode: string; -} -/** - * [Output Only] A list of managed instance groups. - */ -export interface Schema$InstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagerPendingActionsSummary { - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be created. - */ - creating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be deleted. - */ - deleting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be recreated. - */ - recreating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be restarted. - */ - restarting: number; -} -export interface Schema$InstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -/** - * InstanceGroupManagers.applyUpdatesToInstances - */ -export interface Schema$InstanceGroupManagersApplyUpdatesRequest { - /** - * The list of URLs of one or more instances for which we want to apply - * updates on this managed instance group. This can be a full URL or a partial - * URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; - /** - * The maximal action that should be perfomed on the instances. By default - * REPLACE. - */ - maximalAction: string; - /** - * The minimal action that should be perfomed on the instances. By default - * NONE. - */ - minimalAction: string; -} -export interface Schema$InstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -/** - * InstanceGroupManagers.deletePerInstanceConfigs - */ -export interface Schema$InstanceGroupManagersDeletePerInstanceConfigsReq { - /** - * The list of instances for which we want to delete per-instance configs on - * this managed instance group. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersListManagedInstancesResponse { - /** - * [Output Only] The list of instances in the managed instance group. - */ - managedInstances: Schema$ManagedInstance[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; -} -export interface Schema$InstanceGroupManagersListPerInstanceConfigsResp { - /** - * [Output Only] The list of PerInstanceConfig. - */ - items: Schema$PerInstanceConfig[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagersRecreateInstancesRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersResizeAdvancedRequest { - /** - * If this flag is true, the managed instance group attempts to create all - * instances initiated by this resize request only once. If there is an error - * during creation, the managed instance group does not retry create this - * instance, and we will decrease the targetSize of the request instead. If - * the flag is false, the group attemps to recreate each instance continuously - * until it succeeds. This flag matters only in the first attempt of creation - * of an instance. After an instance is successfully created while this flag - * is enabled, the instance behaves the same way as all the other instances - * created with a regular resize request. In particular, if a running instance - * dies unexpectedly at a later time and needs to be recreated, this mode does - * not affect the recreation behavior in that scenario. This flag is - * applicable only to the current resize request. It does not influence other - * resize requests in any way. You can see which instances is being creating - * in which mode by calling the get or listManagedInstances API. - */ - noCreationRetries: boolean; - /** - * The number of running instances that the managed instance group should - * maintain at any given time. The group automatically adds or removes - * instances to maintain the number of instances specified by this parameter. - */ - targetSize: number; -} -export interface Schema$InstanceGroupManagersScopedList { - /** - * [Output Only] The list of managed instance groups that are contained in the - * specified project and zone. - */ - instanceGroupManagers: Schema$InstanceGroupManager[]; - /** - * [Output Only] The warning that replaces the list of managed instance groups - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupManagersSetAutoHealingRequest { - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; -} -export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; -} -export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { - /** - * The fingerprint of the target pools information. Use this optional property - * to prevent conflicts when multiple users change the target pools settings - * concurrently. Obtain the fingerprint with the instanceGroupManagers.get - * method. Then, include the fingerprint in your request to ensure that you do - * not overwrite changes that were applied from another concurrent request. - */ - fingerprint: string; - /** - * The list of target pool URLs that instances in this managed instance group - * belong to. The managed instance group applies these target pools to all of - * the instances in the group. Existing instances and new instances in the - * group all receive these target pool settings. - */ - targetPools: string[]; -} -/** - * InstanceGroupManagers.updatePerInstanceConfigs - */ -export interface Schema$InstanceGroupManagersUpdatePerInstanceConfigsReq { - /** - * The list of per-instance configs to insert or patch on this managed - * instance group. - */ - perInstanceConfigs: Schema$PerInstanceConfig[]; -} -export interface Schema$InstanceGroupManagerUpdatePolicy { - /** - * The maximum number of instances that can be created above the specified - * targetSize during the update process. By default, a fixed value of 1 is - * used. This value can be either a fixed number or a percentage if the - * instance group has 10 or more instances. If you set a percentage, the - * number of instances will be rounded up if necessary. At least one of - * either maxSurge or maxUnavailable must be greater than 0. Learn more about - * maxSurge. - */ - maxSurge: Schema$FixedOrPercent; - /** - * The maximum number of instances that can be unavailable during the update - * process. An instance is considered available if all of the following - * conditions are satisfied: - The instance's status is RUNNING. - If - * there is a health check on the instance group, the instance's liveness - * health check result must be HEALTHY at least once. If there is no health - * check on the group, then the instance only needs to have a status of - * RUNNING to be considered available. By default, a fixed value of 1 is - * used. This value can be either a fixed number or a percentage if the - * instance group has 10 or more instances. If you set a percentage, the - * number of instances will be rounded up if necessary. At least one of - * either maxSurge or maxUnavailable must be greater than 0. Learn more about - * maxUnavailable. - */ - maxUnavailable: Schema$FixedOrPercent; - /** - * Minimal action to be taken on an instance. You can specify either RESTART - * to restart existing instances or REPLACE to delete and create new instances - * from the target template. If you specify a code>RESTART, the Updater - * will attempt to perform that action only. However, if the Updater - * determines that the minimal action you specify is not enough to perform the - * update, it might perform a more disruptive action. - */ - minimalAction: string; - /** - * Minimum number of seconds to wait for after a newly created instance - * becomes available. This value must be from range [0, 3600]. - */ - minReadySec: number; - type: string; -} -export interface Schema$InstanceGroupManagerVersion { - instanceTemplate: string; - /** - * Name of the version. Unique among all versions in the scope of this managed - * instance group. - */ - name: string; - /** - * Tag describing the version. Used to trigger rollout of a target version - * even if instance_template remains unchanged. Deprecated in favor of - * 'name'. - */ - tag: string; - /** - * Specifies the intended number of instances to be created from the - * instanceTemplate. The final number of instances created from the template - * will be equal to: - If expressed as a fixed number, the minimum of either - * targetSize.fixed or instanceGroupManager.targetSize is used. - if - * expressed as a percent, the targetSize would be (targetSize.percent/100 * - * InstanceGroupManager.targetSize) If there is a remainder, the number is - * rounded up. If unset, this version will update any remaining instances not - * updated by another version. Read Starting a canary update for more - * information. - */ - targetSize: Schema$FixedOrPercent; -} -export interface Schema$InstanceGroupsAddInstancesRequest { - /** - * The list of instances to add to the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupsListInstances for the list of instances in the - * specified instance group. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupsListInstancesRequest { - /** - * A filter for the state of the instances in the instance group. Valid - * options are ALL or RUNNING. If you do not specify this parameter the list - * includes all instances regardless of their state. - */ - instanceState: string; -} -export interface Schema$InstanceGroupsRemoveInstancesRequest { - /** - * The list of instances to remove from the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsScopedList { - /** - * [Output Only] The list of instance groups that are contained in this scope. - */ - instanceGroups: Schema$InstanceGroup[]; - /** - * [Output Only] An informational warning that replaces the list of instance - * groups when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of instances. - */ -export interface Schema$InstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Instance resources. - */ - items: Schema$Instance[]; - /** - * [Output Only] Type of resource. Always compute#instanceList for lists of - * Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of instance referrers. - */ -export interface Schema$InstanceListReferrers { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Reference resources. - */ - items: Schema$Reference[]; - /** - * [Output Only] Type of resource. Always compute#instanceListReferrers for - * lists of Instance referrers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceMoveRequest { - /** - * The URL of the destination zone to move the instance. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target instance to move. This can be a full or partial URL. - * For example, the following are all valid URLs to an instance: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - targetInstance: string; -} -export interface Schema$InstanceProperties { - /** - * Enables instances created based on this template to send packets with - * source IP addresses other than their own and receive packets with - * destination IP addresses other than their own. If these instances will be - * used as an IP gateway or it will be set as the next-hop in a Route - * resource, specify true. If unsure, leave this set to false. See the Enable - * IP forwarding documentation for more information. - */ - canIpForward: boolean; - /** - * An optional text description for the instances that are created from this - * instance template. - */ - description: string; - /** - * An array of disks that are associated with the instances that are created - * from this template. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of guest accelerator cards' type and count to use for instances - * created from the instance template. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * Labels to apply to instances that are created from this template. - */ - labels: any; - /** - * The machine type to use for instances that are created from this template. - */ - machineType: string; - /** - * The metadata key/value pairs to assign to instances that are created from - * this template. These pairs can consist of custom metadata or predefined - * keys. See Project and instance metadata for more information. - */ - metadata: Schema$Metadata; - /** - * Minimum cpu/platform to be used by this instance. The instance may be - * scheduled on the specified or newer cpu/platform. Applicable values are the - * friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more - * information, read Specifying a Minimum CPU Platform. - */ - minCpuPlatform: string; - /** - * An array of network access configurations for this interface. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Specifies the scheduling options for the instances that are created from - * this template. - */ - scheduling: Schema$Scheduling; - /** - * A list of service accounts with specified scopes. Access tokens for these - * service accounts are available to the instances that are created from this - * template. Use metadata queries to obtain the access tokens for these - * instances. - */ - serviceAccounts: Schema$ServiceAccount[]; - /** - * Specifies the Shielded VM options for the instances that are created from - * this template. - */ - shieldedVmConfig: Schema$ShieldedVmConfig; - /** - * A list of tags to apply to the instances that are created from this - * template. The tags identify valid sources or targets for network firewalls. - * The setTags method can modify this list of tags. Each tag within the list - * must comply with RFC1035. - */ - tags: Schema$Tags; -} -export interface Schema$InstanceReference { - /** - * The URL for a specific instance. - */ - instance: string; -} -export interface Schema$InstancesResumeRequest { - /** - * Array of disks associated with this instance that are protected with a - * customer-supplied encryption key. In order to resume the instance, the - * disk url and its corresponding key must be provided. If the disk is not - * protected with a customer-supplied encryption key it should not be - * specified. - */ - disks: Schema$CustomerEncryptionKeyProtectedDisk[]; - /** - * Decrypts data associated with an instance that is protected with a - * customer-supplied encryption key. If the instance you are starting is - * protected with a customer-supplied encryption key, the correct key must be - * provided otherwise the instance resume will not succeed. - */ - instanceEncryptionKey: Schema$CustomerEncryptionKey; -} -export interface Schema$InstancesScopedList { - /** - * [Output Only] A list of instances contained in this scope. - */ - instances: Schema$Instance[]; - /** - * [Output Only] Informational warning which replaces the list of instances - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstancesSetLabelsRequest { - /** - * Fingerprint of the previous set of labels for this resource, used to - * prevent conflicts. Provide the latest fingerprint value when making a - * request to add or change labels. - */ - labelFingerprint: string; - labels: any; -} -export interface Schema$InstancesSetMachineResourcesRequest { - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; -} -export interface Schema$InstancesSetMachineTypeRequest { - /** - * Full or partial URL of the machine type resource. See Machine Types for a - * full list of machine types. For example: - * zones/us-central1-f/machineTypes/n1-standard-1 - */ - machineType: string; -} -export interface Schema$InstancesSetMinCpuPlatformRequest { - /** - * Minimum cpu/platform this instance should be started at. - */ - minCpuPlatform: string; -} -export interface Schema$InstancesSetServiceAccountRequest { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -export interface Schema$InstancesStartWithEncryptionKeyRequest { - /** - * Array of disks associated with this instance that are protected with a - * customer-supplied encryption key. In order to start the instance, the disk - * url and its corresponding key must be provided. If the disk is not - * protected with a customer-supplied encryption key it should not be - * specified. - */ - disks: Schema$CustomerEncryptionKeyProtectedDisk[]; - /** - * Decrypts data associated with an instance that is protected with a - * customer-supplied encryption key. If the instance you are starting is - * protected with a customer-supplied encryption key, the correct key must be - * provided otherwise the instance start will not succeed. - */ - instanceEncryptionKey: Schema$CustomerEncryptionKey; -} -/** - * An Instance Template resource. (== resource_for beta.instanceTemplates ==) - * (== resource_for v1.instanceTemplates ==) - */ -export interface Schema$InstanceTemplate { - /** - * [Output Only] The creation timestamp for this instance template in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A unique identifier for this instance template. The server - * defines this identifier. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceTemplate - * for instance templates. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The instance properties for this instance template. - */ - properties: Schema$InstanceProperties; - /** - * [Output Only] The URL for this instance template. The server defines this - * URL. - */ - selfLink: string; - /** - * The source instance used to create the template. You can provide this as a - * partial or full URL to the resource. For example, the following are valid - * values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - */ - sourceInstance: string; - /** - * The source instance params to use to create this instance template. - */ - sourceInstanceParams: Schema$SourceInstanceParams; -} -/** - * A list of instance templates. - */ -export interface Schema$InstanceTemplateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceTemplate resources. - */ - items: Schema$InstanceTemplate[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceTemplatesListResponse for instance template lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceWithNamedPorts { - /** - * [Output Only] The URL of the instance. - */ - instance: string; - /** - * [Output Only] The named ports that belong to this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The status of the instance. - */ - status: string; -} -/** - * Represents an Interconnects resource. The Interconnects resource is a - * dedicated connection between Google's network and your on-premises - * network. For more information, see the Dedicated overview page. (== - * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) - */ -export interface Schema$Interconnect { - /** - * Administrative status of the interconnect. When this is set to true, the - * Interconnect is functional and can carry traffic. When set to false, no - * packets can be carried over the interconnect and no BGP routes are - * exchanged over it. By default, the status is set to true. - */ - adminEnabled: boolean; - /** - * [Output Only] A list of CircuitInfo objects, that describe the individual - * circuits in this LAG. - */ - circuitInfos: Schema$InterconnectCircuitInfo[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Customer name, to put in the Letter of Authorization as the party - * authorized to request a crossconnect. - */ - customerName: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of outages expected for this Interconnect. - */ - expectedOutages: Schema$InterconnectOutageNotification[]; - /** - * [Output Only] IP address configured on the Google side of the Interconnect - * link. This can be used only for ping tests. - */ - googleIpAddress: string; - /** - * [Output Only] Google reference ID; to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of the URLs of all InterconnectAttachments configured - * to use this Interconnect. - */ - interconnectAttachments: string[]; - /** - * Type of interconnect. Note that "IT_PRIVATE" has been deprecated - * in favor of "DEDICATED" - */ - interconnectType: string; - /** - * [Output Only] Type of the resource. Always compute#interconnect for - * interconnects. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this Interconnect, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an Interconnect. - */ - labelFingerprint: string; - /** - * Labels to apply to this Interconnect resource. These can be later modified - * by the setLabels method. Each label key/value must comply with RFC1035. - * Label values may be empty. - */ - labels: any; - /** - * Type of link requested. This field indicates speed of each of the links in - * the bundle, not the entire bundle. Only 10G per link is allowed for a - * dedicated interconnect. Options: Ethernet_10G_LR - */ - linkType: string; - /** - * URL of the InterconnectLocation object that represents where this - * connection is to be provisioned. - */ - location: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Email address to contact the customer NOC for operations and maintenance - * notifications regarding this Interconnect. If specified, this will be used - * for notifications in addition to all other forms described, such as - * Stackdriver logs alerting and Cloud Notifications. - */ - nocContactEmail: string; - /** - * [Output Only] The current status of whether or not this Interconnect is - * functional. - */ - operationalStatus: string; - /** - * [Output Only] IP address configured on the customer side of the - * Interconnect link. The customer should configure this IP address during - * turnup when prompted by Google NOC. This can be used only for ping tests. - */ - peerIpAddress: string; - /** - * [Output Only] Number of links actually provisioned in this interconnect. - */ - provisionedLinkCount: number; - /** - * Target number of physical links in the link bundle, as requested by the - * customer. - */ - requestedLinkCount: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The current state of whether or not this Interconnect is - * functional. - */ - state: string; -} -/** - * Represents an InterconnectAttachment (VLAN attachment) resource. For more - * information, see Creating VLAN Attachments. (== resource_for - * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments - * ==) - */ -export interface Schema$InterconnectAttachment { - /** - * Determines whether this Attachment will carry packets. Not present for - * PARTNER_PROVIDER. - */ - adminEnabled: boolean; - /** - * [Deprecated] Replaced by edge_availability_domain. - */ - availabilityZone: string; - /** - * Provisioned bandwidth capacity for the interconnectAttachment. Can be set - * by the partner to update the customer's provisioned bandwidth. Output - * only for for PARTNER type, mutable for PARTNER_PROVIDER, not available for - * DEDICATED. - */ - bandwidth: string; - /** - * Up to 16 candidate prefixes that can be used to restrict the allocation of - * cloudRouterIpAddress and customerRouterIpAddress for this attachment. All - * prefixes must be within link-local address space (169.254.0.0/16) and must - * be /29 or shorter (/28, /27, etc). Google will attempt to select an unused - * /29 from the supplied candidate prefix(es). The request will fail if all - * possible /29s are in use on Google?s edge. If not supplied, Google will - * randomly select an unused /29 from all of link-local space. - */ - candidateSubnets: string[]; - /** - * [Output Only] IPv4 address + prefix length to be configured on Cloud Router - * Interface for this interconnect attachment. - */ - cloudRouterIpAddress: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] IPv4 address + prefix length to be configured on the customer - * router subinterface for this interconnect attachment. - */ - customerRouterIpAddress: string; - /** - * An optional description of this resource. - */ - description: string; - /** - * Desired availability domain for the attachment. Only available for type - * PARTNER, at creation time. For improved reliability, customers should - * configure a pair of attachments with one per availability domain. The - * selected availability domain will be provided to the Partner via the - * pairing key so that the provisioned circuit will lie in the specified - * domain. If not specified, the value will default to - * AVAILABILITY_DOMAIN_ANY. - */ - edgeAvailabilityDomain: string; - /** - * [Output Only] Google reference ID, to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * URL of the underlying Interconnect object that this attachment's - * traffic will traverse through. - */ - interconnect: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectAttachment - * for interconnect attachments. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this InterconnectAttachment, - * which is essentially a hash of the labels set used for optimistic locking. - * The fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an - * InterconnectAttachment. - */ - labelFingerprint: string; - /** - * Labels to apply to this InterconnectAttachment resource. These can be later - * modified by the setLabels method. Each label key/value must comply with - * RFC1035. Label values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] The current status of whether or not this interconnect - * attachment is functional. - */ - operationalStatus: string; - /** - * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present - * for DEDICATED]. The opaque identifier of an PARTNER attachment used to - * initiate provisioning with a selected partner. Of the form - * "XXXXX/region/domain" - */ - pairingKey: string; - /** - * Optional BGP ASN for the router that should be supplied by a layer 3 - * Partner if they configured BGP on behalf of the customer. Output only for - * PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. - */ - partnerAsn: string; - /** - * Informational metadata about Partner attachments from Partners to display - * to customers. Output only for for PARTNER type, mutable for - * PARTNER_PROVIDER, not available for DEDICATED. - */ - partnerMetadata: Schema$InterconnectAttachmentPartnerMetadata; - /** - * [Output Only] Information specific to an InterconnectAttachment. This - * property is populated if the interconnect that this is attached to is of - * type DEDICATED. - */ - privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; - /** - * [Output Only] URL of the region where the regional interconnect attachment - * resides. You must specify this field as part of the HTTP request URL. It is - * not settable as a field in the request body. - */ - region: string; - /** - * URL of the cloud router to be used for dynamic routing. This router must be - * in the same region as this InterconnectAttachment. The - * InterconnectAttachment will automatically connect the Interconnect to the - * network & region within which the Cloud Router is configured. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The current state of this attachment's functionality. - */ - state: string; - type: string; - /** - * Available only for DEDICATED and PARTNER_PROVIDER. Desired VLAN tag for - * this attachment, in the range 2-4094. This field refers to 802.1q VLAN tag, - * also known as IEEE 802.1Q Only specified at creation time. - */ - vlanTag8021q: number; -} -export interface Schema$InterconnectAttachmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#interconnectAttachmentAggregatedList for aggregated lists of - * interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Response to the list request, and contains a list of interconnect - * attachments. - */ -export interface Schema$InterconnectAttachmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachment resources. - */ - items: Schema$InterconnectAttachment[]; - /** - * [Output Only] Type of resource. Always compute#interconnectAttachmentList - * for lists of interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Informational metadata about Partner attachments from Partners to display to - * customers. These fields are propagated from PARTNER_PROVIDER attachments to - * their corresponding PARTNER attachments. - */ -export interface Schema$InterconnectAttachmentPartnerMetadata { - /** - * Plain text name of the Interconnect this attachment is connected to, as - * displayed in the Partner?s portal. For instance ?Chicago 1?. This value may - * be validated to match approved Partner values. - */ - interconnectName: string; - /** - * Plain text name of the Partner providing this attachment. This value may be - * validated to match approved Partner values. - */ - partnerName: string; - /** - * URL of the Partner?s portal for this Attachment. Partners may customise - * this to be a deep-link to the specific resource on the Partner portal. This - * value may be validated to match approved Partner values. - */ - portalUrl: string; -} -/** - * Information for an interconnect attachment when this belongs to an - * interconnect of type DEDICATED. - */ -export interface Schema$InterconnectAttachmentPrivateInfo { - /** - * [Output Only] 802.1q encapsulation tag to be used for traffic between - * Google and the customer, going to and from this network and region. - */ - tag8021q: number; -} -export interface Schema$InterconnectAttachmentsScopedList { - /** - * A list of interconnect attachments contained in this scope. - */ - interconnectAttachments: Schema$InterconnectAttachment[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * Describes a single physical circuit between the Customer and Google. - * CircuitInfo objects are created by Google, so all fields are output only. - * Next id: 4 - */ -export interface Schema$InterconnectCircuitInfo { - /** - * Customer-side demarc ID for this circuit. - */ - customerDemarcId: string; - /** - * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. - */ - googleCircuitId: string; - /** - * Google-side demarc ID for this circuit. Assigned at circuit turn-up and - * provided by Google to the customer in the LOA. - */ - googleDemarcId: string; -} -/** - * Response to the list request, and contains a list of interconnects. - */ -export interface Schema$InterconnectList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Interconnect resources. - */ - items: Schema$Interconnect[]; - /** - * [Output Only] Type of resource. Always compute#interconnectList for lists - * of interconnects. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents an InterconnectLocations resource. The InterconnectLocations - * resource describes the locations where you can connect to Google's - * networks. For more information, see Colocation Facilities. - */ -export interface Schema$InterconnectLocation { - /** - * [Output Only] The postal address of the Point of Presence, each line in the - * address is separated by a newline character. - */ - address: string; - /** - * [Output Only] Availability zone for this location. Within a metropolitan - * area (metro), maintenance will not be simultaneously scheduled in more than - * one availability zone. Example: "zone1" or "zone2". - */ - availabilityZone: string; - /** - * [Output Only] Metropolitan area designator that indicates which city an - * interconnect is located. For example: "Chicago, IL", - * "Amsterdam, Netherlands". - */ - city: string; - /** - * [Output Only] Continent for this location. - */ - continent: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] An optional description of the resource. - */ - description: string; - /** - * [Output Only] The name of the provider for this facility (e.g., EQUINIX). - */ - facilityProvider: string; - /** - * [Output Only] A provider-assigned Identifier for this facility (e.g., - * Ashburn-DC1). - */ - facilityProviderFacilityId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectLocation for - * interconnect locations. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The peeringdb identifier for this facility (corresponding - * with a netfac type in peeringdb). - */ - peeringdbFacilityId: string; - /** - * [Output Only] A list of InterconnectLocation.RegionInfo objects, that - * describe parameters pertaining to the relation between this - * InterconnectLocation and various Google Cloud regions. - */ - regionInfos: Schema$InterconnectLocationRegionInfo[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Response to the list request, and contains a list of interconnect locations. - */ -export interface Schema$InterconnectLocationList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectLocation resources. - */ - items: Schema$InterconnectLocation[]; - /** - * [Output Only] Type of resource. Always compute#interconnectLocationList for - * lists of interconnect locations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Information about any potential InterconnectAttachments between an - * Interconnect at a specific InterconnectLocation, and a specific Cloud Region. - */ -export interface Schema$InterconnectLocationRegionInfo { - /** - * Expected round-trip time in milliseconds, from this InterconnectLocation to - * a VM in this region. - */ - expectedRttMs: string; - /** - * Identifies the network presence of this location. - */ - locationPresence: string; - /** - * URL for the region of this location. - */ - region: string; -} -/** - * Description of a planned outage on this Interconnect. Next id: 9 - */ -export interface Schema$InterconnectOutageNotification { - /** - * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs - * that will be affected. - */ - affectedCircuits: string[]; - /** - * A description about the purpose of the outage. - */ - description: string; - /** - * Scheduled end time for the outage (milliseconds since Unix epoch). - */ - endTime: string; - /** - * Form this outage is expected to take. Note that the "IT_" - * versions of this enum have been deprecated in favor of the unprefixed - * values. - */ - issueType: string; - /** - * Unique identifier for this outage notification. - */ - name: string; - /** - * The party that generated this notification. Note that - * "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE" - */ - source: string; - /** - * Scheduled start time for the outage (milliseconds since Unix epoch). - */ - startTime: string; - /** - * State of this notification. Note that the "NS_" versions of this - * enum have been deprecated in favor of the unprefixed values. - */ - state: string; -} -export interface Schema$InternalIpOwner { - /** - * IP CIDR range being owned. - */ - ipCidrRange: string; - /** - * URLs of the IP owners of the IP CIDR range. - */ - owners: string[]; - /** - * Whether this IP CIDR range is reserved for system use. - */ - systemOwned: boolean; -} -/** - * Contains a list of IP owners. - */ -export interface Schema$IpOwnerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InternalIpOwner resources. - */ - items: Schema$InternalIpOwner[]; - /** - * [Output Only] Type of resource. Always compute#ipOwnerList for lists of IP - * owners. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A license resource. - */ -export interface Schema$License { - /** - * [Output Only] Deprecated. This field no longer reflects whether a license - * charges a usage fee. - */ - chargesUseFee: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#license for licenses. - */ - kind: string; - /** - * [Output Only] The unique code used to attach this license to images, - * snapshots, and disks. - */ - licenseCode: string; - /** - * [Output Only] Name of the resource. The name is 1-63 characters long and - * complies with RFC1035. - */ - name: string; - resourceRequirements: Schema$LicenseResourceRequirements; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If false, licenses will not be copied from the source resource when - * creating an image from a disk, disk from snapshot, or snapshot from disk. - */ - transferable: boolean; -} -export interface Schema$LicenseCode { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#licenseCode for licenses. - */ - kind: string; - /** - * [Output Only] URL and description aliases of Licenses with the same License - * Code. - */ - licenseAlias: Schema$LicenseCodeLicenseAlias[]; - /** - * [Output Only] Name of the resource. The name is 1-20 characters long and - * must be a valid 64 bit integer. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Current state of this License Code. - */ - state: string; - /** - * [Output Only] If true, the license will remain attached when creating - * images or snapshots from disks. Otherwise, the license is not transferred. - */ - transferable: boolean; -} -export interface Schema$LicenseCodeLicenseAlias { - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] URL of license corresponding to this License Code. - */ - selfLink: string; -} -export interface Schema$LicenseResourceRequirements { - /** - * Minimum number of guest cpus required to use the Instance. Enforced at - * Instance creation and Instance start. - */ - minGuestCpuCount: number; - /** - * Minimum memory required to use the Instance. Enforced at Instance creation - * and Instance start. - */ - minMemoryMb: number; -} -export interface Schema$LicensesListResponse { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of License resources. - */ - items: Schema$License[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Specifies what kind of log the caller must write - */ -export interface Schema$LogConfig { - /** - * Cloud audit options. - */ - cloudAudit: Schema$LogConfigCloudAuditOptions; - /** - * Counter options. - */ - counter: Schema$LogConfigCounterOptions; - /** - * Data access options. - */ - dataAccess: Schema$LogConfigDataAccessOptions; -} -/** - * Write a Cloud Audit log - */ -export interface Schema$LogConfigCloudAuditOptions { - /** - * Information used by the Cloud Audit Logging pipeline. - */ - authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; - /** - * The log_name to populate in the Cloud Audit Record. - */ - logName: string; -} -/** - * Increment a streamz counter with the specified metric and field names. Metric - * names should start with a '/', generally be lowercase-only, and end - * in "_count". Field names should not contain an initial slash. The - * actual exported metric names will have "/iam/policy" prepended. - * Field names correspond to IAM request parameters and field values are their - * respective values. At present the only supported field names are - - * "iam_principal", corresponding to IAMContext.principal; - - * "" (empty string), resulting in one aggretated counter with no - * field. Examples: counter { metric: "/debug_access_count" field: - * "iam_principal" } ==> increment counter - * /iam/policy/backend_debug_access_count {iam_principal=[value of - * IAMContext.principal]} At this time we do not support: * multiple field - * names (though this may be supported in the future) * decrementing the counter - * * incrementing it by anything other than 1 - */ -export interface Schema$LogConfigCounterOptions { - /** - * The field value to attribute. - */ - field: string; - /** - * The metric to update. - */ - metric: string; -} -/** - * Write a Data Access (Gin) log - */ -export interface Schema$LogConfigDataAccessOptions { - /** - * Whether Gin logging should happen in a fail-closed manner at the caller. - * This is relevant only in the LocalIAM implementation, for now. - */ - logMode: string; -} -/** - * A Machine Type resource. (== resource_for v1.machineTypes ==) (== - * resource_for beta.machineTypes ==) - */ -export interface Schema$MachineType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this machine type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The number of virtual CPUs that are available to the - * instance. - */ - guestCpus: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Whether this machine type has a shared CPU. See Shared-core - * machine types for more information. - */ - isSharedCpu: boolean; - /** - * [Output Only] The type of the resource. Always compute#machineType for - * machine types. - */ - kind: string; - /** - * [Output Only] Maximum persistent disks allowed. - */ - maximumPersistentDisks: number; - /** - * [Output Only] Maximum total persistent disks size (GB) allowed. - */ - maximumPersistentDisksSizeGb: string; - /** - * [Output Only] The amount of physical memory available to the instance, - * defined in MB. - */ - memoryMb: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the machine type resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$MachineTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#machineTypeAggregatedList - * for aggregated lists of machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of machine types. - */ -export interface Schema$MachineTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineType resources. - */ - items: Schema$MachineType[]; - /** - * [Output Only] Type of resource. Always compute#machineTypeList for lists of - * machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$MachineTypesScopedList { - /** - * [Output Only] A list of machine types contained in this scope. - */ - machineTypes: Schema$MachineType[]; - /** - * [Output Only] An informational warning that appears when the machine types - * list is empty. - */ - warning: any; -} -/** - * Next available tag: 12 - */ -export interface Schema$ManagedInstance { - /** - * [Output Only] The current action that the managed instance group has - * scheduled for the instance. Possible values: - NONE The instance is - * running, and the managed instance group does not have any scheduled actions - * for this instance. - CREATING The managed instance group is creating this - * instance. If the group fails to create this instance, it will try again - * until it is successful. - CREATING_WITHOUT_RETRIES The managed instance - * group is attempting to create this instance only once. If the group fails - * to create this instance, it does not try again and the group's - * targetSize value is decreased instead. - RECREATING The managed instance - * group is recreating this instance. - DELETING The managed instance group - * is permanently deleting this instance. - ABANDONING The managed instance - * group is abandoning this instance. The instance will be removed from the - * instance group and from any target pools that are associated with this - * group. - RESTARTING The managed instance group is restarting the instance. - * - REFRESHING The managed instance group is applying configuration changes - * to the instance without stopping it. For example, the group can update the - * target pool list for an instance without stopping that instance. - - * VERIFYING The managed instance group has created the instance and it is in - * the process of being verified. - */ - currentAction: string; - /** - * [Output only] The unique identifier for this resource. This field is empty - * when instance does not exist. - */ - id: string; - /** - * [Output Only] The URL of the instance. The URL can exist even if the - * instance has not yet been created. - */ - instance: string; - /** - * [Output Only] The status of the instance. This field is empty when the - * instance does not exist. - */ - instanceStatus: string; - /** - * [Output Only] The intended template of the instance. This field is empty - * when current_action is one of { DELETING, ABANDONING }. - */ - instanceTemplate: string; - /** - * [Output Only] Information about the last attempt to create or delete the - * instance. - */ - lastAttempt: Schema$ManagedInstanceLastAttempt; - /** - * [Output Only] Override defined for this instance. - */ - override: Schema$ManagedInstanceOverride; - /** - * [Output Only] Tag describing the version. - */ - tag: string; - /** - * [Output Only] Intended version of this instance. - */ - version: Schema$ManagedInstanceVersion; -} -export interface Schema$ManagedInstanceLastAttempt { - /** - * [Output Only] Encountered errors during the last attempt to create or - * delete the instance. - */ - errors: any; -} -/** - * Overrides of stateful properties for a given instance - */ -export interface Schema$ManagedInstanceOverride { - /** - * Disk overrides defined for this instance. According to documentation the - * maximum number of disks attached to an instance is 128: - * https://cloud.google.com/compute/docs/disks/ However, compute API defines - * the limit at 140, so this is what we check. - */ - disks: Schema$ManagedInstanceOverrideDiskOverride[]; - /** - * Metadata overrides defined for this instance. TODO(b/69785416) validate the - * total length is <9 KB - */ - metadata: any[]; - /** - * [Output Only] Indicates where does the override come from. - */ - origin: string; -} -export interface Schema$ManagedInstanceOverrideDiskOverride { - /** - * The name of the device on the VM - */ - deviceName: string; - /** - * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If - * not specified, the default is to attach the disk in READ_WRITE mode. - */ - mode: string; - /** - * The disk that is/will be mounted - */ - source: string; -} -export interface Schema$ManagedInstanceVersion { - /** - * [Output Only] The intended template of the instance. This field is empty - * when current_action is one of { DELETING, ABANDONING }. - */ - instanceTemplate: string; - /** - * [Output Only] Name of the version. - */ - name: string; -} -/** - * A metadata key/value entry. - */ -export interface Schema$Metadata { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. - */ - fingerprint: string; - /** - * Array of key/value pairs. The total size of all keys and values must be - * less than 512 KB. - */ - items: any[]; - /** - * [Output Only] Type of the resource. Always compute#metadata for metadata. - */ - kind: string; -} -/** - * The named port. For example: . - */ -export interface Schema$NamedPort { - /** - * The name for this named port. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * The port number, which can be a value between 1 and 65535. - */ - port: number; -} -/** - * Represents a Network resource. Read Networks and Firewalls for more - * information. (== resource_for v1.networks ==) (== resource_for beta.networks - * ==) - */ -export interface Schema$Network { - /** - * When set to true, the network is created in "auto subnet mode". - * When set to false, the network is in "custom subnet mode". In - * "auto subnet mode", a newly created network is assigned the - * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork - * per region. - */ - autoCreateSubnetworks: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Type of VM-to-VM traffic encryption for this network. - */ - crossVmEncryption: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A gateway address for default routing to other networks. This value is read - * only and is selected by the Google Compute Engine, typically as the first - * usable address in the IPv4Range. - */ - gatewayIPv4: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are legal on this network. This range - * is a CIDR specification, for example: 192.168.0.0/16. Provided by the - * client when the network is created. - */ - IPv4Range: string; - /** - * [Output Only] Type of the resource. Always compute#network for networks. - */ - kind: string; - /** - * [Output Only] Type of LB-to-VM traffic encryption for this network. - */ - loadBalancerVmEncryption: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] A list of network peerings for the resource. - */ - peerings: Schema$NetworkPeering[]; - /** - * The network-level routing configuration for this network. Used by Cloud - * Router to determine what type of network-wide routing behavior to enforce. - */ - routingConfig: Schema$NetworkRoutingConfig; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Server-defined fully-qualified URLs for all subnetworks in - * this network. - */ - subnetworks: string[]; -} -/** - * The network endpoint. - */ -export interface Schema$NetworkEndpoint { - /** - * The name for a specific VM instance that the IP address belongs to. This is - * required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The - * instance must be in the same zone of network endpoint group. The name must - * be 1-63 characters long, and comply with RFC1035. - */ - instance: string; - /** - * Optional IPv4 address of network endpoint. The IP address must belong to a - * VM in GCE (either the primary IP or as part of an aliased IP range). If the - * IP address is not specified, then the primary IP address for the VM - * instance in the network that the network endpoint group belongs to will be - * used. - */ - ipAddress: string; - /** - * Optional port number of network endpoint. If not specified and the - * NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the defaultPort - * for the network endpoint group will be used. - */ - port: number; -} -/** - * Represents a collection of network endpoints. - */ -export interface Schema$NetworkEndpointGroup { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#networkEndpointGroup for - * network endpoint group. - */ - kind: string; - /** - * This field is only valid when the network endpoint group type is - * LOAD_BALANCING. - */ - loadBalancer: Schema$NetworkEndpointGroupLbNetworkEndpointGroup; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Type of network endpoints in this network endpoint group. Only supported - * values for LOAD_BALANCING are GCE_VM_IP or GCE_VM_IP_PORT. - */ - networkEndpointType: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] Number of network endpoints in the network endpoint group. - */ - size: number; - /** - * Specify the type of this network endpoint group. Only LOAD_BALANCING is - * valid for now. - */ - type: string; -} -export interface Schema$NetworkEndpointGroupAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NetworkEndpointGroupsScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#networkEndpointGroupAggregatedList for aggregated lists of network - * endpoint groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Load balancing specific fields for network endpoint group of type - * LOAD_BALANCING. - */ -export interface Schema$NetworkEndpointGroupLbNetworkEndpointGroup { - /** - * The default port used if the port number is not specified in the network - * endpoint. If the network endpoint type is GCE_VM_IP, this field must not be - * specified. - */ - defaultPort: number; - /** - * The URL of the network to which all network endpoints in the NEG belong. - * Uses "default" project network if unspecified. - */ - network: string; - /** - * Optional URL of the subnetwork to which all network endpoints in the NEG - * belong. - */ - subnetwork: string; - /** - * [Output Only] The URL of the zone where the network endpoint group is - * located. - */ - zone: string; -} -export interface Schema$NetworkEndpointGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NetworkEndpointGroup resources. - */ - items: Schema$NetworkEndpointGroup[]; - /** - * [Output Only] The resource type, which is always - * compute#networkEndpointGroupList for network endpoint group lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$NetworkEndpointGroupsAttachEndpointsRequest { - /** - * The list of network endpoints to be attached. - */ - networkEndpoints: Schema$NetworkEndpoint[]; -} -export interface Schema$NetworkEndpointGroupsDetachEndpointsRequest { - /** - * The list of network endpoints to be detached. - */ - networkEndpoints: Schema$NetworkEndpoint[]; -} -export interface Schema$NetworkEndpointGroupsListEndpointsRequest { - /** - * Optional query parameter for showing the health status of each network - * endpoint. Valid options are SKIP or SHOW. If you don't specifiy this - * parameter, the health status of network endpoints will not be provided. - */ - healthStatus: string; -} -export interface Schema$NetworkEndpointGroupsListNetworkEndpoints { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NetworkEndpointWithHealthStatus resources. - */ - items: Schema$NetworkEndpointWithHealthStatus[]; - /** - * [Output Only] The resource type, which is always - * compute#networkEndpointGroupsListNetworkEndpoints for the list of network - * endpoints in the specified network endpoint group. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$NetworkEndpointGroupsScopedList { - /** - * [Output Only] The list of network endpoint groups that are contained in - * this scope. - */ - networkEndpointGroups: Schema$NetworkEndpointGroup[]; - /** - * [Output Only] An informational warning that replaces the list of network - * endpoint groups when the list is empty. - */ - warning: any; -} -export interface Schema$NetworkEndpointWithHealthStatus { - /** - * [Output only] The health status of network endpoint; - */ - healths: Schema$HealthStatusForNetworkEndpoint[]; - /** - * [Output only] The network endpoint; - */ - networkEndpoint: Schema$NetworkEndpoint; -} -/** - * A network interface resource attached to an instance. - */ -export interface Schema$NetworkInterface { - /** - * An array of configurations for this interface. Currently, only one access - * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs - * specified, then this instance will have no external internet access. - */ - accessConfigs: Schema$AccessConfig[]; - /** - * An array of alias IP ranges for this network interface. Can only be - * specified for network interfaces on subnet-mode networks. - */ - aliasIpRanges: Schema$AliasIpRange[]; - /** - * Fingerprint hash of contents stored in this network interface. This field - * will be ignored when inserting an Instance or adding a NetworkInterface. An - * up-to-date fingerprint must be provided in order to update the - * NetworkInterface. - */ - fingerprint: string; - /** - * [Output Only] Type of the resource. Always compute#networkInterface for - * network interfaces. - */ - kind: string; - /** - * [Output Only] The name of the network interface, generated by the server. - * For network devices, these are eth0, eth1, etc. - */ - name: string; - /** - * URL of the network resource for this instance. When creating an instance, - * if neither the network nor the subnetwork is specified, the default network - * global/networks/default is used; if the network is not specified but the - * subnetwork is specified, the network is inferred. This field is optional - * when creating a firewall rule. If not specified when creating a firewall - * rule, the default network global/networks/default is used. If you specify - * this property, you can specify the network as a full or partial URL. For - * example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/global/networks/network - * - projects/project/global/networks/network - global/networks/default - */ - network: string; - /** - * An IPv4 internal network address to assign to the instance for this network - * interface. If not specified by the user, an unused internal IP is assigned - * by the system. - */ - networkIP: string; - /** - * The URL of the Subnetwork resource for this instance. If the network - * resource is in legacy mode, do not provide this property. If the network is - * in auto subnet mode, providing the subnetwork is optional. If the network - * is in custom subnet mode, then this field should be specified. If you - * specify this property, you can specify the subnetwork as a full or partial - * URL. For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork - * - regions/region/subnetworks/subnetwork - */ - subnetwork: string; -} -/** - * Contains a list of networks. - */ -export interface Schema$NetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Network resources. - */ - items: Schema$Network[]; - /** - * [Output Only] Type of resource. Always compute#networkList for lists of - * networks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A network peering attached to a network resource. The message includes the - * peering name, peer network, peering state, and a flag indicating whether - * Google Compute Engine should automatically create routes for the peering. - */ -export interface Schema$NetworkPeering { - /** - * Whether full mesh connectivity is created and managed automatically. When - * it is set to true, Google Compute Engine will automatically create and - * manage the routes between two networks when the state is ACTIVE. Otherwise, - * user needs to create routes manually to route packets to peer network. - */ - autoCreateRoutes: boolean; - /** - * Name of this peering. Provided by the client when the peering is created. - * The name must comply with RFC1035. Specifically, the name must be 1-63 - * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` - * which means the first character must be a lowercase letter, and all the - * following characters must be a dash, lowercase letter, or digit, except the - * last character, which cannot be a dash. - */ - name: string; - /** - * The URL of the peer network. It can be either full URL or partial URL. The - * peer network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - network: string; - /** - * [Output Only] State for the peering. - */ - state: string; - /** - * [Output Only] Details about the current state of the peering. - */ - stateDetails: string; -} -/** - * A routing configuration attached to a network resource. The message includes - * the list of routers associated with the network, and a flag indicating the - * type of routing behavior to enforce network-wide. - */ -export interface Schema$NetworkRoutingConfig { - /** - * The network-wide routing mode to use. If set to REGIONAL, this - * network's cloud routers will only advertise routes with subnetworks of - * this network in the same region as the router. If set to GLOBAL, this - * network's cloud routers will advertise routes with all subnetworks of - * this network, across regions. - */ - routingMode: string; -} -export interface Schema$NetworksAddPeeringRequest { - /** - * Whether Google Compute Engine manages the routes automatically. - */ - autoCreateRoutes: boolean; - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; - /** - * URL of the peer network. It can be either full URL or partial URL. The peer - * network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - peerNetwork: string; -} -export interface Schema$NetworksRemovePeeringRequest { - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; -} -/** - * A NodeGroup resource. - */ -export interface Schema$NodeGroup { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#nodeGroup for node - * group. - */ - kind: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * [Output Only] A list of nodes in this node group. - */ - nodes: Schema$NodeGroupNode[]; - /** - * The URL of the node template to which this node group belongs. - */ - nodeTemplate: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - status: string; - /** - * [Output Only] The name of the zone where the node group resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$NodeGroupAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeGroupsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for - * aggregated lists of node groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of nodeGroups. - */ -export interface Schema$NodeGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeGroup resources. - */ - items: Schema$NodeGroup[]; - /** - * [Output Only] Type of resource.Always compute#nodeGroupList for lists of - * node groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$NodeGroupNode { - index: number; - /** - * Instances scheduled on this node. - */ - instances: string[]; - /** - * The type of this node. - */ - nodeType: string; -} -export interface Schema$NodeGroupsAddNodesRequest { - /** - * Count of additional nodes to be added to the node group. - */ - additionalNodeCount: number; -} -export interface Schema$NodeGroupsDeleteNodesRequest { - /** - * Indexes of the nodes to be deleted from the node group. - */ - nodeIndexes: number[]; -} -export interface Schema$NodeGroupsScopedList { - /** - * [Output Only] A list of node groups contained in this scope. - */ - nodeGroups: Schema$NodeGroup[]; - /** - * [Output Only] An informational warning that appears when the nodeGroup list - * is empty. - */ - warning: any; -} -export interface Schema$NodeGroupsSetNodeTemplateRequest { - /** - * Full or partial URL of the node template resource to be updated for this - * node group. - */ - nodeTemplate: string; -} -/** - * A Node Template resource. - */ -export interface Schema$NodeTemplate { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#nodeTemplate for - * node templates. - */ - kind: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last charaicter, which - * cannot be a dash. - */ - name: string; - /** - * Labels to use for node affinity, which will be used in instance scheduling. - */ - nodeAffinityLabels: any; - /** - * The node type to use for nodes group that are created from this template. - */ - nodeType: string; - /** - * The flexible properties of the desired node type. Node groups that use this - * node template will create nodes of a type that matches these properties. - * This field is mutually exclusive with the node_type property; you can only - * define one or the other, but not both. - */ - nodeTypeFlexibility: Schema$NodeTemplateNodeTypeFlexibility; - /** - * [Output Only] The name of the region where the node template resides, such - * as us-central1. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the node template. One of the following values: - * CREATING, READY, and DELETING. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; -} -export interface Schema$NodeTemplateAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeTemplatesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList - * for aggregated lists of node templates. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of node templates. - */ -export interface Schema$NodeTemplateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeTemplate resources. - */ - items: Schema$NodeTemplate[]; - /** - * [Output Only] Type of resource.Always compute#nodeTemplateList for lists of - * node templates. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$NodeTemplateNodeTypeFlexibility { - cpus: string; - localSsd: string; - memory: string; -} -export interface Schema$NodeTemplatesScopedList { - /** - * [Output Only] A list of node templates contained in this scope. - */ - nodeTemplates: Schema$NodeTemplate[]; - /** - * [Output Only] An informational warning that appears when the node templates - * list is empty. - */ - warning: any; -} -/** - * A Node Type resource. - */ -export interface Schema$NodeType { - /** - * [Output Only] The CPU platform used by this node type. - */ - cpuPlatform: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this node type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The number of virtual CPUs that are available to the node - * type. - */ - guestCpus: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#nodeType for node - * types. - */ - kind: string; - /** - * [Output Only] Local SSD available to the node type, defined in GB. - */ - localSsdGb: number; - /** - * [Output Only] The amount of physical memory available to the node type, - * defined in MB. - */ - memoryMb: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the node type resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$NodeTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for - * aggregated lists of node types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of node types. - */ -export interface Schema$NodeTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of NodeType resources. - */ - items: Schema$NodeType[]; - /** - * [Output Only] Type of resource.Always compute#nodeTypeList for lists of - * node types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$NodeTypesScopedList { - /** - * [Output Only] A list of node types contained in this scope. - */ - nodeTypes: Schema$NodeType[]; - /** - * [Output Only] An informational warning that appears when the node types - * list is empty. - */ - warning: any; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; - /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$OperationAggregatedList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A map of scoped operation lists. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#operationAggregatedList for - * aggregated lists of operations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Operation resources. - */ -export interface Schema$OperationList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of Operation resources. - */ - items: Schema$Operation[]; - /** - * [Output Only] Type of resource. Always compute#operations for Operations - * resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$OperationsScopedList { - /** - * [Output Only] A list of operations contained in this scope. - */ - operations: Schema$Operation[]; - /** - * [Output Only] Informational warning which replaces the list of operations - * when the list is empty. - */ - warning: any; -} -/** - * A matcher for the path portion of the URL. The BackendService from the - * longest-matched rule will serve the URL. If no rule was matched, the default - * service will be used. - */ -export interface Schema$PathMatcher { - /** - * The full or partial URL to the BackendService resource. This will be used - * if none of the pathRules defined by this PathMatcher is matched by the - * URL's path portion. For example, the following are all valid URLs to a - * BackendService resource: - - * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService - * - compute/v1/projects/project/global/backendServices/backendService - - * global/backendServices/backendService - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The name to which this PathMatcher is referred by the HostRule. - */ - name: string; - /** - * The list of path rules. - */ - pathRules: Schema$PathRule[]; -} -/** - * A path-matching rule for a URL. If matched, will use the specified - * BackendService to handle the traffic arriving at this URL. - */ -export interface Schema$PathRule { - /** - * The list of path patterns to match. Each must start with / and the only - * place a * is allowed is at the end following a /. The string fed to the - * path matcher does not include any text after the first ? or #, and those - * chars are not allowed here. - */ - paths: string[]; - /** - * The URL of the BackendService resource if this rule is matched. - */ - service: string; -} -export interface Schema$PerInstanceConfig { - /** - * The URL of the instance. Serves as a merge key during - * UpdatePerInstanceConfigs operation. - */ - instance: string; - override: Schema$ManagedInstanceOverride; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a description of IAM and its - * features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - iamOwned: boolean; - /** - * If more than one rule is specified, the rules are applied in the following - * manner: - All matching LOG rules are always applied. - If any - * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if any - * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if no - * rule applies, permission is denied. - */ - rules: Schema$Rule[]; - /** - * Deprecated. - */ - version: number; -} -/** - * A Project resource. For an overview of projects, see Cloud Platform Resource - * Hierarchy. (== resource_for v1.projects ==) (== resource_for beta.projects - * ==) - */ -export interface Schema$Project { - /** - * Metadata key/value pairs available to all instances contained in this - * project. See Custom metadata for more information. - */ - commonInstanceMetadata: Schema$Metadata; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * This signifies the default network tier used for configuring resources of - * the project and can only take the following values: PREMIUM, STANDARD. - * Initially the default network tier is PREMIUM. - */ - defaultNetworkTier: string; - /** - * [Output Only] Default service account used by VMs running in this project. - */ - defaultServiceAccount: string; - /** - * An optional textual description of the resource. - */ - description: string; - /** - * Restricted features enabled for use on this project. - */ - enabledFeatures: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. This is not the project ID, and is just a unique ID - * used by Compute Engine to identify resources. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#project for projects. - */ - kind: string; - /** - * The project ID. For example: my-example-project. Use the project ID to make - * requests to Compute Engine. - */ - name: string; - /** - * [Output Only] Quotas assigned to this project. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The naming prefix for daily usage reports and the Google Cloud Storage - * bucket where they are stored. - */ - usageExportLocation: Schema$UsageExportLocation; - /** - * [Output Only] The role this project has in a shared VPC configuration. - * Currently only HOST projects are differentiated. - */ - xpnProjectStatus: string; -} -export interface Schema$ProjectsDisableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsEnableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsGetXpnResources { - /** - * [Output Only] Type of resource. Always compute#projectsGetXpnResources for - * lists of service resources (a.k.a service projects) - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * Service resources (a.k.a service projects) attached to this project as - * their shared VPC host. - */ - resources: Schema$XpnResourceId[]; -} -export interface Schema$ProjectsListXpnHostsRequest { - /** - * Optional organization ID managed by Cloud Resource Manager, for which to - * list shared VPC host projects. If not specified, the organization will be - * inferred from the project. - */ - organization: string; -} -export interface Schema$ProjectsSetDefaultNetworkTierRequest { - /** - * Default network tier to be set. - */ - networkTier: string; -} -export interface Schema$ProjectsSetDefaultServiceAccountRequest { - /** - * Email address of the service account. - */ - email: string; -} -/** - * A quotas entry. - */ -export interface Schema$Quota { - /** - * [Output Only] Quota limit for this metric. - */ - limit: number; - /** - * [Output Only] Name of the quota metric. - */ - metric: string; - /** - * [Output Only] Current usage of this metric. - */ - usage: number; -} -/** - * Represents a reference to a resource. - */ -export interface Schema$Reference { - /** - * [Output Only] Type of the resource. Always compute#reference for - * references. - */ - kind: string; - /** - * A description of the reference type with no implied semantics. Possible - * values include: - MEMBER_OF - */ - referenceType: string; - /** - * URL of the resource which refers to the target. - */ - referrer: string; - /** - * URL of the resource to which this reference points. - */ - target: string; -} -/** - * Region resource. (== resource_for beta.regions ==) (== resource_for - * v1.regions ==) - */ -export interface Schema$Region { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this region. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#region for regions. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Quotas assigned to this region. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the region, either UP or DOWN. - */ - status: string; - /** - * [Output Only] A list of zones available in this region, in the form of - * resource URLs. - */ - zones: string[]; -} -/** - * Contains a list of autoscalers. - */ -export interface Schema$RegionAutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionDisksResizeRequest { - /** - * The new size of the regional persistent disk, which is specified in GB. - */ - sizeGb: string; -} -export interface Schema$RegionDiskTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskType resources. - */ - items: Schema$DiskType[]; - /** - * [Output Only] Type of resource. Always compute#regionDiskTypeList for - * region disk types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of InstanceGroup resources. - */ -export interface Schema$RegionInstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * RegionInstanceGroupManagers.deletePerInstanceConfigs - */ -export interface Schema$RegionInstanceGroupManagerDeleteInstanceConfigReq { - /** - * The list of instances for which we want to delete per-instance configs on - * this managed instance group. - */ - instances: string[]; -} -/** - * Contains a list of managed instance groups. - */ -export interface Schema$RegionInstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups that - * exist in th regional scope. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -/** - * InstanceGroupManagers.applyUpdatesToInstances - */ -export interface Schema$RegionInstanceGroupManagersApplyUpdatesRequest { - /** - * The list of instances for which we want to apply changes on this managed - * instance group. - */ - instances: string[]; - /** - * The maximal action that should be perfomed on the instances. By default - * REPLACE. - */ - maximalAction: string; - /** - * The minimal action that should be perfomed on the instances. By default - * NONE. - */ - minimalAction: string; -} -export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersListInstanceConfigsResp { - /** - * [Output Only] The list of PerInstanceConfig. - */ - items: Schema$PerInstanceConfig[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupManagersListInstancesResponse { - /** - * A list of managed instances. - */ - managedInstances: Schema$ManagedInstance[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; -} -export interface Schema$RegionInstanceGroupManagersRecreateRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetAutoHealingRequest { - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; -} -export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { - /** - * Fingerprint of the target pools information, which is a hash of the - * contents. This field is used for optimistic locking when you update the - * target pool entries. This field is optional. - */ - fingerprint: string; - /** - * The URL of all TargetPool resources to which instances in the instanceGroup - * field are added. The target pools automatically apply to all of the - * instances in the managed instance group. - */ - targetPools: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { - /** - * URL of the InstanceTemplate resource from which all new instances will be - * created. - */ - instanceTemplate: string; -} -/** - * RegionInstanceGroupManagers.updatePerInstanceConfigs - */ -export interface Schema$RegionInstanceGroupManagerUpdateInstanceConfigReq { - /** - * The list of per-instance configs to insert or patch on this managed - * instance group. - */ - perInstanceConfigs: Schema$PerInstanceConfig[]; -} -export interface Schema$RegionInstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupsListInstancesRequest { - /** - * Instances in which state should be returned. Valid options are: - * 'ALL', 'RUNNING'. By default, it lists all instances. - */ - instanceState: string; - /** - * Name of port user is interested in. It is optional. If it is set, only - * information about this ports will be returned. If it is not set, all the - * named ports will be returned. Always lists all instances. - */ - portName: string; -} -export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of region resources. - */ -export interface Schema$RegionList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Region resources. - */ - items: Schema$Region[]; - /** - * [Output Only] Type of resource. Always compute#regionList for lists of - * regions. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash in order to update or change labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The labels to set for this resource. - */ - labels: any; -} -export interface Schema$RegionUrlMapsValidateRequest { - /** - * Content of the UrlMap to be validated. - */ - resource: Schema$UrlMap; -} -/** - * Commitment for a particular resource (a Commitment is composed of one or more - * of these). - */ -export interface Schema$ResourceCommitment { - /** - * The amount of the resource purchased (in a type-dependent unit, such as - * bytes). For vCPUs, this can just be an integer. For memory, this must be - * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of - * memory per every vCPU. - */ - amount: string; - /** - * Type of resource for which this commitment applies. Possible values are - * VCPU and MEMORY - */ - type: string; -} -export interface Schema$ResourceGroupReference { - /** - * A URI referencing one of the instance groups listed in the backend service. - */ - group: string; -} -/** - * Represents a Route resource. A route specifies how certain packets should be - * handled by the network. Routes are associated with instances by tags and the - * set of routes for a particular instance is called its routing table. For - * each packet leaving an instance, the system searches that instance's - * routing table for a single best matching route. Routes match packets by - * destination IP address, preferring smaller or more specific ranges over - * larger ones. If there is a tie, the system selects the route with the - * smallest priority value. If there is still a tie, it uses the layer three and - * four packet headers to select just one of the remaining matching routes. The - * packet is then forwarded as specified by the nextHop field of the winning - * route - either to another instance destination, an instance gateway, or a - * Google Compute Engine-operated gateway. Packets that do not match any route - * in the sending instance's routing table are dropped. (== resource_for - * beta.routes ==) (== resource_for v1.routes ==) - */ -export interface Schema$Route { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The destination range of outgoing packets that this route applies to. Only - * IPv4 is supported. - */ - destRange: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of this resource. Always compute#routes for Route - * resources. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Fully-qualified URL of the network that this route applies to. - */ - network: string; - /** - * The URL to a gateway that should handle matching packets. You can only - * specify the internet gateway using a full or partial valid URL: - * projects/<project-id>/global/gateways/default-internet-gateway - */ - nextHopGateway: string; - /** - * The URL to an instance that should handle matching packets. You can specify - * this as a full or partial URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ - */ - nextHopInstance: string; - /** - * The network IP address of an instance that should handle matching packets. - * Only IPv4 is supported. - */ - nextHopIp: string; - /** - * The URL of the local network if it should handle matching packets. - */ - nextHopNetwork: string; - /** - * [Output Only] The network peering name that should handle matching packets, - * which should conform to RFC1035. - */ - nextHopPeering: string; - /** - * The URL to a VpnTunnel that should handle matching packets. - */ - nextHopVpnTunnel: string; - /** - * The priority of this route. Priority is used to break ties in cases where - * there is more than one matching route of equal prefix length. In the case - * of two routes with equal prefix length, the one with the lowest-numbered - * priority value wins. Default value is 1000. Valid range is 0 through 65535. - */ - priority: number; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * A list of instance tags to which this route applies. - */ - tags: string[]; - /** - * [Output Only] If potential misconfigurations are detected for this route, - * this field will be populated with warning messages. - */ - warnings: any[]; -} -/** - * Contains a list of Route resources. - */ -export interface Schema$RouteList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Route resources. - */ - items: Schema$Route[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Router resource. - */ -export interface Schema$Router { - /** - * BGP information specific to this router. - */ - bgp: Schema$RouterBgp; - /** - * BGP information that needs to be configured into the routing stack to - * establish the BGP peering. It must specify peer ASN and either interface - * name, IP, or peer IP. Please refer to RFC4273. - */ - bgpPeers: Schema$RouterBgpPeer[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Router interfaces. Each interface requires either one linked resource (e.g. - * linkedVpnTunnel), or IP address and IP address range (e.g. ipRange), or - * both. - */ - interfaces: Schema$RouterInterface[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A list of Nat services created in this router. The maximum number of Nat - * services within a Router is 3 for Alpha. - */ - nats: Schema$RouterNat[]; - /** - * URI of the network to which this router belongs. - */ - network: string; - /** - * [Output Only] URI of the region where the router resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Description-tagged IP ranges for the router to advertise. - */ -export interface Schema$RouterAdvertisedIpRange { - /** - * User-specified description for the IP range. - */ - description: string; - /** - * The IP range to advertise. The value must be a CIDR-formatted string. - */ - range: string; -} -/** - * Description-tagged prefixes for the router to advertise. - */ -export interface Schema$RouterAdvertisedPrefix { - /** - * User-specified description for the prefix. - */ - description: string; - /** - * The prefix to advertise. The value must be a CIDR-formatted string. - */ - prefix: string; -} -/** - * Contains a list of routers. - */ -export interface Schema$RouterAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RouterBgp { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and is advertised - * to all peers of the router. These groups will be advertised in addition to - * any specified prefixes. Leave this field blank to advertise no custom - * groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and is - * advertised to all peers of the router. These IP ranges will be advertised - * in addition to any specified groups. Leave this field blank to advertise no - * custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * User-specified list of individual prefixes to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and is - * advertised to all peers of the router. These prefixes will be advertised in - * addition to any specified groups. Leave this field blank to advertise no - * custom prefixes. - */ - advertisedPrefixs: Schema$RouterAdvertisedPrefix[]; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, - * either 16-bit or 32-bit. The value will be fixed for this router resource. - * All VPN tunnels that link to this router will have the same local ASN. - */ - asn: number; -} -export interface Schema$RouterBgpPeer { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and overrides the - * list defined for the router (in Bgp message). These groups will be - * advertised in addition to any specified prefixes. Leave this field blank to - * advertise no custom groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and overrides - * the list defined for the router (in Bgp message). These IP ranges will be - * advertised in addition to any specified groups. Leave this field blank to - * advertise no custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * User-specified list of individual prefixes to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and overrides - * the list defined for the router (in Bgp message). These prefixes will be - * advertised in addition to any specified groups. Leave this field blank to - * advertise no custom prefixes. - */ - advertisedPrefixs: Schema$RouterAdvertisedPrefix[]; - /** - * The priority of routes advertised to this BGP peer. In the case where there - * is more than one matching route of maximum length, the routes with lowest - * priority value win. - */ - advertisedRoutePriority: number; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Name of the interface the BGP peer is associated with. - */ - interfaceName: string; - /** - * IP address of the interface inside Google Cloud Platform. Only IPv4 is - * supported. - */ - ipAddress: string; - /** - * [Output Only] Type of how the resource/configuration of the BGP peer is - * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT - * represents an BGP peer that is automatically created for PARTNER - * interconnectAttachment, Google will automatically create/delete this type - * of BGP peer when the PARTNER interconnectAttachment is created/deleted. - */ - managementType: string; - /** - * Name of this BGP peer. The name must be 1-63 characters long and comply - * with RFC1035. - */ - name: string; - /** - * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can - * be different for every tunnel. - */ - peerAsn: number; - /** - * IP address of the BGP interface outside Google cloud. Only IPv4 is - * supported. - */ - peerIpAddress: string; -} -export interface Schema$RouterInterface { - /** - * IP address and range of the interface. The IP range must be in the RFC3927 - * link-local IP space. The value must be a CIDR-formatted string, for - * example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents - * the IP address of the interface. - */ - ipRange: string; - /** - * URI of the linked interconnect attachment. It must be in the same region as - * the router. Each interface can have at most one linked resource and it - * could either be a VPN Tunnel or an interconnect attachment. - */ - linkedInterconnectAttachment: string; - /** - * URI of the linked VPN tunnel. It must be in the same region as the router. - * Each interface can have at most one linked resource and it could either be - * a VPN Tunnel or an interconnect attachment. - */ - linkedVpnTunnel: string; - /** - * [Output Only] Type of how the resource/configuration of the interface is - * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT - * represents an interface that is automatically created for PARTNER type - * interconnectAttachment, Google will automatically create/update/delete this - * type of interface when the PARTNER interconnectAttachment is - * created/provisioned/deleted. - */ - managementType: string; - /** - * Name of this interface entry. The name must be 1-63 characters long and - * comply with RFC1035. - */ - name: string; -} -/** - * Contains a list of Router resources. - */ -export interface Schema$RouterList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: Schema$Router[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a Nat resource. It enables the VMs within the specified - * subnetworks to access Internet without external IP addresses. It specifies a - * list of subnetworks (and the ranges within) that want to use NAT. Customers - * can also provide the external IPs that would be used for NAT. GCP would - * auto-allocate ephemeral IPs if no external IPs are provided. - */ -export interface Schema$RouterNat { - /** - * [Output Only] A list of IPs allocated automatically by GCP for this Nat - * service. They will be raw IP strings like "179.12.26.133". They - * are ephemeral IPs allocated from the IP blocks managed by the NAT manager. - * This list can grow and shrink based on the number of VMs configured to use - * NAT. - */ - autoAllocatedNatIps: string[]; - /** - * Unique name of this Nat service. The name must be 1-63 characters long and - * comply with RFC1035. - */ - name: string; - /** - * Specify the NatIpAllocateOption. If it is AUTO_ONLY, then nat_ip should be - * empty. - */ - natIpAllocateOption: string; - /** - * A list of URLs of the IP resources used for this Nat service. These IPs - * must be valid static external IP addresses assigned to the project. - * max_length is subject to change post alpha. - */ - natIps: string[]; - /** - * Specify the Nat option. If this field contains - * ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, - * then there should not be any other Router.Nat section in any Router for - * this network in this region. - */ - sourceSubnetworkIpRangesToNat: string; - /** - * A list of Subnetwork resources whose traffic should be translated by NAT - * Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the - * SubnetworkIpRangeToNatOption above. - */ - subnetworks: Schema$RouterNatSubnetworkToNat[]; -} -/** - * Defines the IP ranges that want to use NAT for a subnetwork. - */ -export interface Schema$RouterNatSubnetworkToNat { - /** - * URL for the subnetwork resource to use NAT. - */ - name: string; - /** - * A list of the secondary ranges of the Subnetwork that are allowed to use - * NAT. This can be populated only if "LIST_OF_SECONDARY_IP_RANGES" - * is one of the values in source_ip_ranges_to_nat. - */ - secondaryIpRangeNames: string[]; - /** - * Specify the options for NAT ranges in the Subnetwork. All usages of single - * value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid - * option with multiple values is: ["PRIMARY_IP_RANGE", - * "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] - */ - sourceIpRangesToNats: string[]; -} -export interface Schema$RoutersPreviewResponse { - /** - * Preview of given router. - */ - resource: Schema$Router; -} -export interface Schema$RoutersScopedList { - /** - * A list of routers contained in this scope. - */ - routers: Schema$Router[]; - /** - * Informational warning which replaces the list of routers when the list is - * empty. - */ - warning: any; -} -export interface Schema$RouterStatus { - /** - * Best routes for this router's network. - */ - bestRoutes: Schema$Route[]; - /** - * Best routes learned by this router. - */ - bestRoutesForRouter: Schema$Route[]; - bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; - natStatus: Schema$RouterStatusNatStatus[]; - /** - * URI of the network to which this router belongs. - */ - network: string; -} -export interface Schema$RouterStatusBgpPeerStatus { - /** - * Routes that were advertised to the remote BGP peer - */ - advertisedRoutes: Schema$Route[]; - /** - * IP address of the local BGP interface. - */ - ipAddress: string; - /** - * URL of the VPN tunnel that this BGP peer controls. - */ - linkedVpnTunnel: string; - /** - * Name of this BGP peer. Unique within the Routers resource. - */ - name: string; - /** - * Number of routes learned from the remote BGP Peer. - */ - numLearnedRoutes: number; - /** - * IP address of the remote BGP interface. - */ - peerIpAddress: string; - /** - * BGP state as specified in RFC1771. - */ - state: string; - /** - * Status of the BGP peer: {UP, DOWN} - */ - status: string; - /** - * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 - * hours, 59 minutes, 59 seconds - */ - uptime: string; - /** - * Time this session has been up, in seconds. Format: 145 - */ - uptimeSeconds: string; -} -/** - * Status of a NAT contained in this router. - */ -export interface Schema$RouterStatusNatStatus { - /** - * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", - * "129.2.16.89"] - */ - autoAllocatedNatIps: string[]; - /** - * The number of extra IPs to allocate. This will be greater than 0 only if - * user-specified IPs are NOT enough to allow all configured VMs to use NAT. - * This value is meaningful only when auto-allocation of NAT IPs is *not* - * used. - */ - minExtraNatIpsNeeded: number; - /** - * Unique name of this NAT. - */ - name: string; - /** - * Number of VM endpoints (i.e., Nics) that can use NAT. - */ - numVmEndpointsWithNatMappings: number; - /** - * A list of fully qualified URLs of reserved IP address resources. - */ - userAllocatedNatIpResources: string[]; - /** - * A list of IPs user-allocated for NAT. They will be raw IP strings like - * "179.12.26.133". - */ - userAllocatedNatIps: string[]; -} -export interface Schema$RouterStatusResponse { - /** - * Type of resource. - */ - kind: string; - result: Schema$RouterStatus; -} -/** - * A rule to be applied in a Policy. - */ -export interface Schema$Rule { - /** - * Required - */ - action: string; - /** - * Additional restrictions that must be met. All conditions must pass for the - * rule to match. - */ - conditions: Schema$Condition[]; - /** - * Human-readable description of the rule. - */ - description: string; - /** - * If one or more 'in' clauses are specified, the rule matches if the - * PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - */ - ins: string[]; - /** - * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - * that match the LOG action. - */ - logConfigs: Schema$LogConfig[]; - /** - * If one or more 'not_in' clauses are specified, the rule matches if - * the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - */ - notIns: string[]; - /** - * A permission is a string of form '..' (e.g., - * 'storage.buckets.list'). A value of '*' matches all - * permissions, and a verb part of '*' (e.g., - * 'storage.buckets.*') matches all verbs. - */ - permissions: string[]; -} -/** - * Sets the scheduling options for an Instance. - */ -export interface Schema$Scheduling { - /** - * Specifies whether the instance should be automatically restarted if it is - * terminated by Compute Engine (not terminated by a user). You can only set - * the automatic restart option for standard instances. Preemptible instances - * cannot be automatically restarted. By default, this is set to true so an - * instance is automatically restarted if it is terminated by Compute Engine. - */ - automaticRestart: boolean; - /** - * A set of node affinity and anti-affinity. - */ - nodeAffinities: Schema$SchedulingNodeAffinity[]; - /** - * Defines the maintenance behavior for this instance. For standard instances, - * the default behavior is MIGRATE. For preemptible instances, the default and - * only possible behavior is TERMINATE. For more information, see Setting - * Instance Scheduling Options. - */ - onHostMaintenance: string; - /** - * Defines whether the instance is preemptible. This can only be set during - * instance creation, it cannot be set or changed after the instance has been - * created. - */ - preemptible: boolean; -} -/** - * Node Affinity: the configuration of desired nodes onto which this Instance - * could be scheduled. - */ -export interface Schema$SchedulingNodeAffinity { - /** - * Corresponds to the label key of Node resource. - */ - key: string; - /** - * Defines the operation of node selection. - */ - operator: string; - /** - * Corresponds to the label values of Node resource. - */ - values: string[]; -} -/** - * A security policy is comprised of one or more rules. It can also be - * associated with one or more 'targets'. - */ -export interface Schema$SecurityPolicy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Specifies a fingerprint for this resource, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. To see - * the latest fingerprint, make get() request to the security policy. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output only] Type of the resource. Always compute#securityPolicyfor - * security policies - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A list of rules that belong to this policy. There must always be a default - * rule (rule with priority 2147483647 and match "*"). If no rules - * are provided when creating a security policy, a default rule with action - * "allow" will be added. - */ - rules: Schema$SecurityPolicyRule[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$SecurityPolicyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SecurityPolicy resources. - */ - items: Schema$SecurityPolicy[]; - /** - * [Output Only] Type of resource. Always compute#securityPolicyList for - * listsof securityPolicies - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SecurityPolicyReference { securityPolicy: string; } -/** - * Represents a rule that describes one or more match conditions along with the - * action to be taken when traffic matches this condition (allow or deny). - */ -export interface Schema$SecurityPolicyRule { - /** - * The Action to preform when the client connection triggers the rule. Can - * currently be either "allow" or "deny()" where valid - * values for status are 403, 404, and 502. - */ - action: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output only] Type of the resource. Always compute#securityPolicyRule for - * security policy rules - */ - kind: string; - /** - * A match condition that incoming traffic is evaluated against. If it - * evaluates to true, the corresponding ?action? is enforced. - */ - match: Schema$SecurityPolicyRuleMatcher; - /** - * If set to true, the specified action is not enforced. - */ - preview: boolean; - /** - * An integer indicating the priority of a rule in the list. The priority must - * be a positive value between 0 and 2147483647. Rules are evaluated in the - * increasing order of priority. - */ - priority: number; -} -/** - * Represents a match condition that incoming traffic is evaluated against. - * Exactly one field must be specified. - */ -export interface Schema$SecurityPolicyRuleMatcher { - /** - * The configuration options available when specifying versioned_expr. This - * field must be specified if versioned_expr is specified and cannot be - * specified if versioned_expr is not specified. - */ - config: Schema$SecurityPolicyRuleMatcherConfig; - /** - * User defined CEVAL expression. A CEVAL expression is used to specify match - * criteria such as origin.ip, source.region_code and contents in the request - * header. - */ - expr: Schema$Expr; - /** - * CIDR IP address range. - */ - srcIpRanges: string[]; - /** - * Preconfigured versioned expression. If this field is specified, config must - * also be specified. Available preconfigured expressions along with their - * requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range - * field in config. - */ - versionedExpr: string; -} -export interface Schema$SecurityPolicyRuleMatcherConfig { - /** - * CIDR IP address range. - */ - srcIpRanges: string[]; -} -/** - * An instance's serial console output. - */ -export interface Schema$SerialPortOutput { - /** - * [Output Only] The contents of the console output. - */ - contents: string; - /** - * [Output Only] Type of the resource. Always compute#serialPortOutput for - * serial port output. - */ - kind: string; - /** - * [Output Only] The position of the next byte of content from the serial - * console output. Use this value in the next request as the start parameter. - */ - next: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * The starting byte position of the output that was returned. This should - * match the start parameter sent with the request. If the serial console - * output exceeds the size of the buffer, older output will be overwritten by - * newer content and the start values will be mismatched. - */ - start: string; -} -/** - * A service account. - */ -export interface Schema$ServiceAccount { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -/** - * A set of Shielded VM options. - */ -export interface Schema$ShieldedVmConfig { - /** - * Defines whether the instance should have integrity monitoring enabled. - */ - enableIntegrityMonitoring: boolean; - /** - * Defines whether the instance should have secure boot enabled. - */ - enableSecureBoot: boolean; - /** - * Defines whether the instance should have the TPM enabled. - */ - enableVtpm: boolean; -} -/** - * The policy describes how boot integrity measurements are evaluated. - */ -export interface Schema$ShieldedVmIntegrityPolicy { - /** - * Triggers an auto relearn event: the integrity monitoring module copies - * existing guest measurements to the baseline. - */ - updateAutoLearnPolicy: boolean; -} -/** - * Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs - */ -export interface Schema$SignedUrlKey { - /** - * Name of the key. The name must be 1-63 characters long, and comply with - * RFC1035. Specifically, the name must be 1-63 characters long and match the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - keyName: string; - /** - * 128-bit key value used for signing the URL. The key value must be a valid - * RFC 4648 Section 5 base64url encoded string. - */ - keyValue: string; -} -/** - * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== - * resource_for v1.snapshots ==) - */ -export interface Schema$Snapshot { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Size of the snapshot, specified in GB. - */ - diskSizeGb: string; - /** - * [Output Only] A list of features to enable on the guest operating system. - * Applicable only for bootable images. Read Enabling guest operating system - * features to see a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#snapshot for Snapshot - * resources. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this snapshot, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a snapshot. - */ - labelFingerprint: string; - /** - * Labels to apply to this snapshot. These can be later modified by the - * setLabels method. Label values may be empty. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this - * snapshot. - */ - licenseCodes: string[]; - /** - * [Output Only] A list of public visible licenses that apply to this - * snapshot. This can be because the original image had licenses attached - * (such as a Windows image). - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Encrypts the snapshot using a customer-supplied encryption key. After you - * encrypt a snapshot using a customer-supplied key, you must provide the same - * key if you use the image later For example, you must provide the encryption - * key when you create a disk from the encrypted snapshot in a future request. - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the snapshot, - * then the snapshot will be encrypted using an automatically generated key - * and you do not need to provide a key to use the snapshot later. - */ - snapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The source disk used to create this snapshot. - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the disk used to create this snapshot. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given disk name. - */ - sourceDiskId: string; - /** - * [Output Only] The status of the snapshot. This can be CREATING, DELETING, - * FAILED, READY, or UPLOADING. - */ - status: string; - /** - * [Output Only] A size of the storage used by the snapshot. As snapshots - * share storage, this number is expected to change with snapshot - * creation/deletion. - */ - storageBytes: string; - /** - * [Output Only] An indicator whether storageBytes is in a stable state or it - * is being adjusted as a result of shared storage reallocation. This status - * can either be UPDATING, meaning the size of the snapshot is being updated, - * or UP_TO_DATE, meaning the size of the snapshot is up-to-date. - */ - storageBytesStatus: string; - /** - * GCS bucket storage location of the snapshot (regional or multi-regional). - */ - storageLocations: string[]; -} -/** - * Contains a list of Snapshot resources. - */ -export interface Schema$SnapshotList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Snapshot resources. - */ - items: Schema$Snapshot[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A specification of the parameters to use when creating the instance template - * from a source instance. - */ -export interface Schema$SourceInstanceParams { - /** - * Attached disks configuration. If not provided, defaults are applied: For - * boot disk and any other R/W disks, new custom images will be created from - * each disk. For read-only disks, they will be attached in read-only mode. - * Local SSD disks will be created as blank volumes. - */ - diskConfigs: Schema$DiskInstantiationConfig[]; -} -/** - * An SslCertificate resource. This resource provides a mechanism to upload an - * SSL key and certificate to the load balancer to serve secure connections from - * the user. (== resource_for beta.sslCertificates ==) (== resource_for - * v1.sslCertificates ==) - */ -export interface Schema$SslCertificate { - /** - * A local certificate file. The certificate must be in PEM format. The - * certificate chain must be no greater than 5 certs long. The chain must - * include at least one intermediate cert. - */ - certificate: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Expire time of the certificate. RFC3339 - */ - expireTime: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#sslCertificate for SSL - * certificates. - */ - kind: string; - /** - * Configuration and status of a managed SSL certificate. - */ - managed: Schema$SslCertificateManagedSslCertificate; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A write-only private key in PEM format. Only insert requests will include - * this field. - */ - privateKey: string; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Configuration and status of a self-managed SSL certificate. - */ - selfManaged: Schema$SslCertificateSelfManagedSslCertificate; - /** - * [Output Only] Domains associated with the certificate via Subject - * Alternative Name. - */ - subjectAlternativeNames: string[]; - /** - * (Optional) Specifies the type of SSL certificate, either - * "SELF_MANAGED" or "MANAGED". If not specified, the - * certificate is self-managed and the fields certificate and private_key are - * used. - */ - type: string; -} -/** - * Contains a list of SslCertificate resources. - */ -export interface Schema$SslCertificateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslCertificate resources. - */ - items: Schema$SslCertificate[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Configuration and status of a managed SSL certificate. - */ -export interface Schema$SslCertificateManagedSslCertificate { - /** - * The domains for which a managed SSL certificate will be generated. - * Currently only single-domain certs are supported. - */ - domains: string[]; - /** - * [Output only] Detailed statuses of the domains specified for managed - * certificate resource. - */ - domainStatus: any; - /** - * [Output only] Status of the managed certificate resource. - */ - status: string; -} -/** - * Configuration and status of a self-managed SSL certificate. - */ -export interface Schema$SslCertificateSelfManagedSslCertificate { - /** - * A local certificate file. The certificate must be in PEM format. The - * certificate chain must be no greater than 5 certs long. The chain must - * include at least one intermediate cert. - */ - certificate: string; - /** - * A write-only private key in PEM format. Only insert requests will include - * this field. - */ - privateKey: string; -} -export interface Schema$SSLHealthCheck { - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies how port is selected for health checking, can be one of following - * values: USE_FIXED_PORT: The port number in port is used for health - * checking. USE_NAMED_PORT: The portName is used for health checking. - * USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each - * network endpoint is used for health checking. For other backends, the port - * or named port specified in the Backend Service is used for health checking. - * If not specified, SSL health check follows behavior specified in port and - * portName fields. - */ - portSpecification: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the SSL connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$SslPoliciesList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslPolicy resources. - */ - items: Schema$SslPolicy[]; - /** - * [Output Only] Type of the resource. Always compute#sslPoliciesList for - * lists of sslPolicies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SslPoliciesListAvailableFeaturesResponse { - features: string[]; -} -/** - * A SSL policy specifies the server-side support for SSL features. This can be - * attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections - * between clients and the HTTPS or SSL proxy load balancer. They do not affect - * the connection between the load balancers and the backends. - */ -export interface Schema$SslPolicy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * A list of features enabled when the selected profile is CUSTOM. The - - * method returns the set of features that can be specified in this list. This - * field must be empty if the profile is not CUSTOM. - */ - customFeatures: string[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The list of features enabled in the SSL policy. - */ - enabledFeatures: string[]; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a SslPolicy. An up-to-date fingerprint must be provided in order - * to update the SslPolicy. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output only] Type of the resource. Always compute#sslPolicyfor SSL - * policies. - */ - kind: string; - /** - * The minimum version of SSL protocol that can be used by the clients to - * establish a connection with the load balancer. This can be one of TLS_1_0, - * TLS_1_1, TLS_1_2. - */ - minTlsVersion: string; - /** - * Name of the resource. The name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * Profile specifies the set of SSL features that can be used by the load - * balancer when negotiating SSL with clients. This can be one of COMPATIBLE, - * MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to - * enable must be specified in the customFeatures field. - */ - profile: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] If potential misconfigurations are detected for this SSL - * policy, this field will be populated with warning messages. - */ - warnings: any[]; -} -export interface Schema$SslPolicyReference { - /** - * URL of the SSL policy resource. Set this to empty string to clear any - * existing SSL policy associated with the target proxy resource. - */ - sslPolicy: string; -} -export interface Schema$StatefulPolicy { - preservedResources: Schema$StatefulPolicyPreservedResources; -} -export interface Schema$StatefulPolicyPreservedDisk { - /** - * Device name of the disk to be preserved - */ - deviceName: string; -} -/** - * Configuration of all preserved resources. - */ -export interface Schema$StatefulPolicyPreservedResources { - /** - * Disks created on the instances that will be preserved on instance delete, - * resize down, etc. - */ - disks: Schema$StatefulPolicyPreservedDisk[]; -} -/** - * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for - * v1.subnetworks ==) - */ -export interface Schema$Subnetwork { - /** - * Whether this subnetwork can conflict with static routes. Setting this to - * true allows this subnetwork's primary and secondary ranges to conflict - * with routes that have already been configured on the corresponding network. - * Static routes will take precedence over the subnetwork route if the route - * prefix length is at least as large as the subnetwork prefix length. Also, - * packets destined to IPs within subnetwork may contain private/sensitive - * data and are prevented from leaving the virtual network. Setting this field - * to true will disable this feature. The default value is false and applies - * to all existing subnetworks and automatically created subnetworks. This - * field cannot be set to true at resource creation time. - */ - allowSubnetCidrRoutesOverlap: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. This field can be set only at resource creation time. - */ - description: string; - /** - * Whether to enable flow logging for this subnetwork. - */ - enableFlowLogs: boolean; - /** - * Whether the VMs in this subnet can directly access Google services via - * internal IPv6 addresses. This field can be both set at resource creation - * time and updated using patch. - */ - enablePrivateV6Access: boolean; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a Subnetwork. An up-to-date fingerprint must be provided in order - * to update the Subnetwork. - */ - fingerprint: string; - /** - * [Output Only] The gateway address for default routes to reach destination - * addresses outside this subnetwork. - */ - gatewayAddress: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are owned by this subnetwork. Provide - * this property when you create the subnetwork. For example, 10.0.0.0/8 or - * 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. - * Only IPv4 is supported. This field can be set only at resource creation - * time. - */ - ipCidrRange: string; - /** - * [Output Only] The range of internal IPv6 addresses that are owned by this - * subnetwork. - */ - ipv6CidrRange: string; - /** - * [Output Only] Type of the resource. Always compute#subnetwork for - * Subnetwork resources. - */ - kind: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The name must be 1-63 characters long, and comply with - * RFC1035. Specifically, the name must be 1-63 characters long and match the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * The URL of the network to which this subnetwork belongs, provided by the - * client when initially creating the subnetwork. Only networks that are in - * the distributed mode can have subnetworks. This field can be set only at - * resource creation time. - */ - network: string; - /** - * Whether the VMs in this subnet can access Google services without assigned - * external IP addresses. This field can be both set at resource creation time - * and updated using setPrivateIpGoogleAccess. - */ - privateIpGoogleAccess: boolean; - /** - * The purpose of the resource. This field can be either PRIVATE_RFC_1918 or - * INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to - * INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is reserved - * for Internal HTTP(S) Load Balancing. If unspecified, the purpose defaults - * to PRIVATE_RFC_1918. - */ - purpose: string; - /** - * URL of the region where the Subnetwork resides. This field can be set only - * at resource creation time. - */ - region: string; - /** - * The role of subnetwork. Currenly, this field is only used when purpose = - * INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or BACKUP. An - * ACTIVE subnetwork is one that is currently being used for Internal HTTP(S) - * Load Balancing. A BACKUP subnetwork is one that is ready to be promoted to - * ACTIVE or is currently draining. - */ - role: string; - /** - * An array of configurations for secondary IP ranges for VM instances - * contained in this subnetwork. The primary IP of such VM must belong to the - * primary ipCidrRange of the subnetwork. The alias IPs may belong to either - * primary or secondary ranges. - */ - secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$SubnetworkAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SubnetworksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for - * aggregated lists of subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Subnetwork resources. - */ -export interface Schema$SubnetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Subnetwork resources. - */ - items: Schema$Subnetwork[]; - /** - * [Output Only] Type of resource. Always compute#subnetworkList for lists of - * subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a secondary IP range of a subnetwork. - */ -export interface Schema$SubnetworkSecondaryRange { - /** - * The range of IP addresses belonging to this subnetwork secondary range. - * Provide this property when you create the subnetwork. Ranges must be unique - * and non-overlapping with all primary and secondary IP ranges within a - * network. Only IPv4 is supported. - */ - ipCidrRange: string; - /** - * The name associated with this subnetwork secondary range, used when adding - * an alias IP range to a VM instance. The name must be 1-63 characters long, - * and comply with RFC1035. The name must be unique within the subnetwork. - */ - rangeName: string; -} -export interface Schema$SubnetworksExpandIpCidrRangeRequest { - /** - * The IP (in CIDR format or netmask) of internal addresses that are legal on - * this Subnetwork. This range should be disjoint from other subnetworks - * within this network. This range can only be larger than (i.e. a superset - * of) the range previously defined before the update. - */ - ipCidrRange: string; -} -export interface Schema$SubnetworksScopedList { - /** - * A list of subnetworks contained in this scope. - */ - subnetworks: Schema$Subnetwork[]; - /** - * An informational warning that appears when the list of addresses is empty. - */ - warning: any; -} -export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { - privateIpGoogleAccess: boolean; -} -/** - * A set of instance tags. - */ -export interface Schema$Tags { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. To see - * the latest fingerprint, make get() request to the instance. - */ - fingerprint: string; - /** - * An array of tags. Each tag must be 1-63 characters long, and comply with - * RFC1035. - */ - items: string[]; -} -export interface Schema$TargetHttpProxiesScopedList { - /** - * A list of TargetHttpProxies contained in this scope. - */ - targetHttpProxies: Schema$TargetHttpProxy[]; - /** - * Informational warning which replaces the list of backend services when the - * list is empty. - */ - warning: any; -} -/** - * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== - * resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies - * ==) - */ -export interface Schema$TargetHttpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpProxy for target - * HTTP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the regional Target HTTP Proxy - * resides. This field is not applicable to global Target HTTP Proxies. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the UrlMap resource that defines the mapping from URL to the - * BackendService. - */ - urlMap: string; -} -export interface Schema$TargetHttpProxyAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpProxiesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A list of TargetHttpProxy resources. - */ -export interface Schema$TargetHttpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpProxy resources. - */ - items: Schema$TargetHttpProxy[]; - /** - * Type of resource. Always compute#targetHttpProxyList for lists of target - * HTTP proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetHttpsProxiesSetQuicOverrideRequest { - /** - * QUIC policy for the TargetHttpsProxy resource. - */ - quicOverride: string; -} -export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { - /** - * New set of SslCertificate resources to associate with this TargetHttpsProxy - * resource. Currently exactly one SslCertificate resource must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== - * resource_for beta.targetHttpsProxies ==) (== resource_for - * v1.targetHttpsProxies ==) - */ -export interface Schema$TargetHttpsProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpsProxy for target - * HTTPS proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the QUIC override policy for this TargetHttpsProxy resource. This - * determines whether the load balancer will attempt to negotiate QUIC with - * clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify ENABLE - * to always enable QUIC, Enables QUIC when set to ENABLE, and disables QUIC - * when set to DISABLE. If NONE is specified, uses the QUIC policy with no - * user overrides, which is equivalent to DISABLE. Not specifying this field - * is equivalent to specifying NONE. - */ - quicOverride: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * between users and the load balancer. Currently, exactly one SSL certificate - * must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetHttpsProxy - * resource. If not set, the TargetHttpsProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; - /** - * A fully-qualified or valid partial URL to the UrlMap resource that defines - * the mapping from URL to the BackendService. For example, the following are - * all valid URLs for specifying a URL map: - - * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map - * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map - */ - urlMap: string; -} -/** - * Contains a list of TargetHttpsProxy resources. - */ -export interface Schema$TargetHttpsProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpsProxy resources. - */ - items: Schema$TargetHttpsProxy[]; - /** - * Type of resource. Always compute#targetHttpsProxyList for lists of target - * HTTPS proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A TargetInstance resource. This resource defines an endpoint instance that - * terminates traffic of certain protocols. (== resource_for - * beta.targetInstances ==) (== resource_for v1.targetInstances ==) - */ -export interface Schema$TargetInstance { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A URL to the virtual machine instance that handles traffic for this target - * instance. When creating a target instance, you can provide the - * fully-qualified URL or a valid partial URL to the desired virtual machine. - * For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - instance: string; - /** - * [Output Only] The type of the resource. Always compute#targetInstance for - * target instances. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * NAT option controlling how IPs are NAT'ed to the instance. Currently - * only NO_NAT (default value) is supported. - */ - natPolicy: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] URL of the zone where the target instance resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - zone: string; -} -export interface Schema$TargetInstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetInstance resources. - */ -export interface Schema$TargetInstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: Schema$TargetInstance[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetInstancesScopedList { - /** - * A list of target instances contained in this scope. - */ - targetInstances: Schema$TargetInstance[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * A TargetPool resource. This resource defines a pool of instances, an - * associated HttpHealthCheck resource, and the fallback target pool. (== - * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) - */ -export interface Schema$TargetPool { - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool, and its failoverRatio field is - * properly set to a value between [0, 1]. backupPool and failoverRatio - * together define the fallback behavior of the primary target pool: if the - * ratio of the healthy instances in the primary pool is at or below - * failoverRatio, traffic arriving at the load-balanced IP will be directed to - * the backup pool. In case where failoverRatio and backupPool are not set, - * or all the instances in the backup pool are unhealthy, the traffic will be - * directed back to the primary pool in the "force" mode, where - * traffic will be spread to the healthy instances with the best effort, or to - * all instances when no instance is healthy. - */ - backupPool: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool (i.e., not as a backup pool to some - * other target pool). The value of the field must be in [0, 1]. If set, - * backupPool must also be set. They together define the fallback behavior of - * the primary target pool: if the ratio of the healthy instances in the - * primary pool is at or below this number, traffic arriving at the - * load-balanced IP will be directed to the backup pool. In case where - * failoverRatio is not set or all the instances in the backup pool are - * unhealthy, the traffic will be directed back to the primary pool in the - * "force" mode, where traffic will be spread to the healthy - * instances with the best effort, or to all instances when no instance is - * healthy. - */ - failoverRatio: number; - /** - * The URL of the HttpHealthCheck resource. A member instance in this pool is - * considered healthy if and only if the health checks pass. An empty list - * means all member instances will be considered healthy at all times. Only - * HttpHealthChecks are supported. Only one health check may be specified. - */ - healthChecks: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A list of resource URLs to the virtual machine instances serving this pool. - * They must live in zones contained in the same region as this pool. - */ - instances: string[]; - /** - * [Output Only] Type of the resource. Always compute#targetPool for target - * pools. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the target pool resides. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Sesssion affinity option, must be one of the following values: NONE: - * Connections from the same client IP may go to any instance in the pool. - * CLIENT_IP: Connections from the same client IP will go to the same instance - * in the pool while that instance remains healthy. CLIENT_IP_PROTO: - * Connections from the same client IP with the same IP protocol will go to - * the same instance in the pool while that instance remains healthy. - */ - sessionAffinity: string; -} -export interface Schema$TargetPoolAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for - * aggregated lists of target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolInstanceHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth - * when checking the health of an instance. - */ - kind: string; -} -/** - * Contains a list of TargetPool resources. - */ -export interface Schema$TargetPoolList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: Schema$TargetPool[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolList for lists of - * target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolsAddHealthCheckRequest { - /** - * The HttpHealthCheck to add to the target pool. - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsAddInstanceRequest { - /** - * A full or partial URL to an instance to add to this target pool. This can - * be a full or partial URL. For example, the following are valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name - * - projects/project-id/zones/zone/instances/instance-name - - * zones/zone/instances/instance-name - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsRemoveHealthCheckRequest { - /** - * Health check URL to be removed. This can be a full or valid partial URL. - * For example, the following are valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check - * - projects/project/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsRemoveInstanceRequest { - /** - * URLs of the instances to be removed from target pool. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsScopedList { - /** - * A list of target pools contained in this scope. - */ - targetPools: Schema$TargetPool[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$TargetReference { target: string; } -export interface Schema$TargetSslProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetSslProxy. - */ - service: string; -} -export interface Schema$TargetSslProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -export interface Schema$TargetSslProxiesSetSslCertificatesRequest { - /** - * New set of URLs to SslCertificate resources to associate with this - * TargetSslProxy. Currently exactly one ssl certificate must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetSslProxy resource. This resource defines an SSL proxy. (== - * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies - * ==) - */ -export interface Schema$TargetSslProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetSslProxy for - * target SSL proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * to Backends. Currently exactly one SSL certificate must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetSslProxy - * resource. If not set, the TargetSslProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; -} -/** - * Contains a list of TargetSslProxy resources. - */ -export interface Schema$TargetSslProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetSslProxy resources. - */ - items: Schema$TargetSslProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetTcpProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetTcpProxy. - */ - service: string; -} -export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -/** - * A TargetTcpProxy resource. This resource defines a TCP proxy. (== - * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies - * ==) - */ -export interface Schema$TargetTcpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetTcpProxy for - * target TCP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; -} -/** - * Contains a list of TargetTcpProxy resources. - */ -export interface Schema$TargetTcpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetTcpProxy resources. - */ - items: Schema$TargetTcpProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a Target VPN gateway resource. (== resource_for - * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) - */ -export interface Schema$TargetVpnGateway { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of URLs to the ForwardingRule resources. - * ForwardingRules are created using compute.forwardingRules.insert and - * associated to a VPN gateway. - */ - forwardingRules: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this TargetVpnGateway, which - * is essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an - * TargetVpnGateway. - */ - labelFingerprint: string; - /** - * Labels to apply to this TargetVpnGateway resource. These can be later - * modified by the setLabels method. Each label key/value must comply with - * RFC1035. Label values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network to which this VPN gateway is attached. Provided by the - * client when the VPN gateway is created. - */ - network: string; - /** - * [Output Only] URL of the region where the target VPN gateway resides. You - * must specify this field as part of the HTTP request URL. It is not settable - * as a field in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the VPN gateway. - */ - status: string; - /** - * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created - * using compute.vpntunnels.insert method and associated to a VPN gateway. - */ - tunnels: string[]; -} -export interface Schema$TargetVpnGatewayAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetVpnGateway resources. - */ -export interface Schema$TargetVpnGatewayList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: Schema$TargetVpnGateway[]; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetVpnGatewaysScopedList { - /** - * [Output Only] A list of target vpn gateways contained in this scope. - */ - targetVpnGateways: Schema$TargetVpnGateway[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -export interface Schema$TCPHealthCheck { - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies how port is selected for health checking, can be one of following - * values: USE_FIXED_PORT: The port number in port is used for health - * checking. USE_NAMED_PORT: The portName is used for health checking. - * USE_SERVING_PORT: For NetworkEndpointGroup, the port specified for each - * network endpoint is used for health checking. For other backends, the port - * or named port specified in the Backend Service is used for health checking. - * If not specified, TCP health check follows behavior specified in port and - * portName fields. - */ - portSpecification: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the TCP connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$TestFailure { - actualService: string; - expectedService: string; - host: string; - path: string; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -export interface Schema$UDPHealthCheck { - /** - * The UDP port number for the health check request. Valid values are 1 - * through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Raw data of request to send in payload of UDP packet. It is an error if - * this is empty. The request data can only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. It is an - * error if this is empty. The response data can only be ASCII. - */ - response: string; -} -/** - * A UrlMap resource. This resource defines the mapping from URL to the - * BackendService resource, based on the "longest-match" of the - * URL's host and path. - */ -export interface Schema$UrlMap { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The URL of the BackendService resource if none of the hostRules match. - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a UrlMap. An up-to-date fingerprint must be provided in order to - * update the UrlMap. - */ - fingerprint: string; - /** - * The list of HostRules to use against the URL. - */ - hostRules: Schema$HostRule[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#urlMaps for url maps. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The list of named PathMatchers to use against the URL. - */ - pathMatchers: Schema$PathMatcher[]; - /** - * [Output Only] URL of the region where the regional URL map resides. This - * field is not applicable to global URL maps. You must specify this field as - * part of the HTTP request URL. It is not settable as a field in the request - * body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The list of expected URL mapping tests. Request to update this UrlMap will - * succeed only if all of the test cases pass. You can specify a maximum of - * 100 tests per UrlMap. - */ - tests: Schema$UrlMapTest[]; -} -/** - * Contains a list of UrlMap resources. - */ -export interface Schema$UrlMapList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of UrlMap resources. - */ - items: Schema$UrlMap[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$UrlMapReference { urlMap: string; } -export interface Schema$UrlMapsValidateRequest { - /** - * Content of the UrlMap to be validated. - */ - resource: Schema$UrlMap; -} -export interface Schema$UrlMapsValidateResponse { - result: Schema$UrlMapValidationResult; -} -/** - * Message for the expected URL mappings. - */ -export interface Schema$UrlMapTest { - /** - * Description of this test case. - */ - description: string; - /** - * Host portion of the URL. - */ - host: string; - /** - * Path portion of the URL. - */ - path: string; - /** - * Expected BackendService resource the given URL should be mapped to. - */ - service: string; -} -/** - * Message representing the validation result for a UrlMap. - */ -export interface Schema$UrlMapValidationResult { - loadErrors: string[]; - /** - * Whether the given UrlMap can be successfully loaded. If false, - * 'loadErrors' indicates the reasons. - */ - loadSucceeded: boolean; - testFailures: Schema$TestFailure[]; - /** - * If successfully loaded, this field indicates whether the test passed. If - * false, 'testFailures's indicate the reason of failure. - */ - testPassed: boolean; -} -/** - * Subnetwork which the current user has compute.subnetworks.use permission on. - */ -export interface Schema$UsableSubnetwork { - /** - * The range of internal addresses that are owned by this subnetwork. - */ - ipCidrRange: string; - /** - * Network URL. - */ - network: string; - /** - * Subnetwork URL. - */ - subnetwork: string; -} -export interface Schema$UsableSubnetworksAggregatedList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output] A list of usable subnetwork URLs. - */ - items: Schema$UsableSubnetwork[]; - /** - * [Output Only] Type of resource. Always - * compute#usableSubnetworksAggregatedList for aggregated lists of usable - * subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * The location in Cloud Storage and naming method of the daily usage report. - * Contains bucket_name and report_name prefix. - */ -export interface Schema$UsageExportLocation { - /** - * The name of an existing bucket in Cloud Storage where the usage report - * object is stored. The Google Service Account is granted write access to - * this bucket. This can either be the bucket name by itself, such as - * example-bucket, or the bucket name with gs:// or - * https://storage.googleapis.com/ in front of it, such as - * gs://example-bucket. - */ - bucketName: string; - /** - * An optional prefix for the name of the usage report object stored in - * bucketName. If not supplied, defaults to usage. The report is stored as a - * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the - * day of the usage according to Pacific Time. If you supply a prefix, it - * should conform to Cloud Storage object naming conventions. - */ - reportNamePrefix: string; -} -/** - * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for - * v1.vpnTunnels ==) - */ -export interface Schema$VpnTunnel { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Detailed status message for the VPN tunnel. - */ - detailedStatus: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * IKE protocol version to use when establishing the VPN tunnel with peer VPN - * gateway. Acceptable IKE versions are 1 or 2. Default version is 2. - */ - ikeVersion: number; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this VpnTunnel, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a VpnTunnel. - */ - labelFingerprint: string; - /** - * Labels to apply to this VpnTunnel. These can be later modified by the - * setLabels method. Each label key/value pair must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * Local traffic selector to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - localTrafficSelector: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * IP address of the peer VPN gateway. Only IPv4 is supported. - */ - peerIp: string; - /** - * [Output Only] URL of the region where the VPN tunnel resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - region: string; - /** - * Remote traffic selectors to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - remoteTrafficSelector: string[]; - /** - * URL of router resource to be used for dynamic routing. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Shared secret used to set the secure session between the Cloud VPN gateway - * and the peer VPN gateway. - */ - sharedSecret: string; - /** - * Hash of the shared secret. - */ - sharedSecretHash: string; - /** - * [Output Only] The status of the VPN tunnel. - */ - status: string; - /** - * URL of the Target VPN gateway with which this VPN tunnel is associated. - * Provided by the client when the VPN tunnel is created. - */ - targetVpnGateway: string; -} -export interface Schema$VpnTunnelAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnelsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of VpnTunnel resources. - */ -export interface Schema$VpnTunnelList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnel resources. - */ - items: Schema$VpnTunnel[]; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$VpnTunnelsScopedList { - /** - * A list of vpn tunnels contained in this scope. - */ - vpnTunnels: Schema$VpnTunnel[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$XpnHostList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * [Output Only] A list of shared VPC host project URLs. - */ - items: Schema$Project[]; - /** - * [Output Only] Type of resource. Always compute#xpnHostList for lists of - * shared VPC hosts. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Service resource (a.k.a service project) ID. - */ -export interface Schema$XpnResourceId { - /** - * The ID of the service resource. In the case of projects, this field matches - * the project ID (e.g., my-project), not the project number (e.g., 12345678). - */ - id: string; - /** - * The type of the service resource. - */ - type: string; -} -/** - * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones - * ==) - */ -export interface Schema$Zone { - /** - * [Output Only] Available cpu/platform selections for the zone. - */ - availableCpuPlatforms: string[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this zone. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#zone for zones. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Full URL reference to the region which hosts the zone. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the zone, either UP or DOWN. - */ - status: string; -} -/** - * Contains a list of zone resources. - */ -export interface Schema$ZoneList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Zone resources. - */ - items: Schema$Zone[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ZoneSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash in order to update or change labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The labels to set for this resource. - */ - labels: any; -} - -export class Resource$Acceleratortypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.acceleratorTypes.aggregatedList - * @desc Retrieves an aggregated list of accelerator types. - * @alias compute.acceleratorTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.get - * @desc Returns the specified accelerator type. Get a list of available - * accelerator types by making a list() request. - * @alias compute.acceleratorTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.acceleratorType Name of the accelerator type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'acceleratorType'], - pathParams: ['acceleratorType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.list - * @desc Retrieves a list of accelerator types available to the specified - * project. - * @alias compute.acceleratorTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Addresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.addresses.aggregatedList - * @desc Retrieves an aggregated list of addresses. - * @alias compute.addresses.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.delete - * @desc Deletes the specified address resource. - * @alias compute.addresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.get - * @desc Returns the specified address resource. - * @alias compute.addresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @alias compute.addresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.list - * @desc Retrieves a list of addresses contained within the specified region. - * @alias compute.addresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.setLabels - * @desc Sets the labels on an Address. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.addresses.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.addresses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Autoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.autoscalers.aggregatedList - * @desc Retrieves an aggregated list of autoscalers. - * @alias compute.autoscalers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.delete - * @desc Deletes the specified autoscaler. - * @alias compute.autoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.get - * @desc Returns the specified autoscaler resource. Get a list of available - * autoscalers by making a list() request. - * @alias compute.autoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @alias compute.autoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified zone. - * @alias compute.autoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @alias compute.autoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.autoscalers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @alias compute.autoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendbuckets { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendBuckets.addSignedUrlKey - * @desc Adds the given Signed URL Key to the backend bucket. - * @alias compute.backendBuckets.addSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SignedUrlKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.delete - * @desc Deletes the specified BackendBucket resource. - * @alias compute.backendBuckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.deleteSignedUrlKey - * @desc Deletes the given Signed URL Key from the backend bucket. - * @alias compute.backendBuckets.deleteSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.keyName The name of the Signed URL Key to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendBucket', 'keyName'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.get - * @desc Returns the specified BackendBucket resource. Get a list of available - * backend buckets by making a list() request. - * @alias compute.backendBuckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.backendBuckets.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.insert - * @desc Creates a BackendBucket resource in the specified project using the - * data included in the request. - * @alias compute.backendBuckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.list - * @desc Retrieves the list of BackendBucket resources available to the - * specified project. - * @alias compute.backendBuckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.patch - * @desc Updates the specified BackendBucket resource with the data included - * in the request. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @alias compute.backendBuckets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.backendBuckets.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.backendBuckets.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.update - * @desc Updates the specified BackendBucket resource with the data included - * in the request. - * @alias compute.backendBuckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendServices.addSignedUrlKey - * @desc Adds the given Signed URL Key to the specified backend service. - * @alias compute.backendServices.addSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SignedUrlKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}/addSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.aggregatedList - * @desc Retrieves the list of all BackendService resources, regional and - * global, available to the specified project. - * @alias compute.backendServices.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Name of the project scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.delete - * @desc Deletes the specified BackendService resource. - * @alias compute.backendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.deleteSignedUrlKey - * @desc Deletes the given Signed URL Key from the specified backend service. - * @alias compute.backendServices.deleteSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.keyName The name of the Signed URL Key to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService', 'keyName'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.get - * @desc Returns the specified BackendService resource. Get a list of - * available backend services by making a list() request. - * @alias compute.backendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.getHealth - * @desc Gets the most recent health check results for this BackendService. - * @alias compute.backendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. - * @param {string} params.project - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.insert - * @desc Creates a BackendService resource in the specified project using the - * data included in the request. There are several restrictions and guidelines - * to keep in mind when creating a backend service. Read Restrictions and - * Guidelines for more information. - * @alias compute.backendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.list - * @desc Retrieves the list of BackendService resources available to the - * specified project. - * @alias compute.backendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.patch - * @desc Patches the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @alias compute.backendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.setSecurityPolicy - * @desc Sets the security policy for the specified backend service. - * @alias compute.backendServices.setSecurityPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SecurityPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSecurityPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSecurityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSecurityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}/setSecurityPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.backendServices.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.update - * @desc Updates the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. - * @alias compute.backendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.disks.aggregatedList - * @desc Retrieves an aggregated list of persistent disks. - * @alias compute.disks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/aggregated/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.createSnapshot - * @desc Creates a snapshot of a specified persistent disk. - * @alias compute.disks.createSnapshot - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to snapshot. - * @param {boolean=} params.guestFlush - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Snapshot} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSnapshot(params?: any, options?: MethodOptions): - AxiosPromise; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.delete - * @desc Deletes the specified persistent disk. Deleting a disk removes its - * data permanently and is irreversible. However, deleting a disk does not - * delete any snapshots previously made from the disk. You must separately - * delete snapshots. - * @alias compute.disks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.get - * @desc Returns a specified persistent disk. Get a list of available - * persistent disks by making a list() request. - * @alias compute.disks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.disks.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.insert - * @desc Creates a persistent disk in the specified project using the data in - * the request. You can create a disk with a sourceImage, a sourceSnapshot, or - * create an empty 500 GB data disk by omitting all properties. You can also - * create a disk that is larger than the default size by specifying the sizeGb - * property. - * @alias compute.disks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. - * @param {string} params.zone The name of the zone for this request. - * @param {().Disk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.list - * @desc Retrieves a list of persistent disks contained within the specified - * zone. - * @alias compute.disks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.resize - * @desc Resizes the specified persistent disk. You can only increase the size - * of the disk. - * @alias compute.disks.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk The name of the persistent disk. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().DisksResizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.disks.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.setLabels - * @desc Sets the labels on a disk. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.disks.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().ZoneSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.disks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disktypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.diskTypes.aggregatedList - * @desc Retrieves an aggregated list of disk types. - * @alias compute.diskTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.get - * @desc Returns the specified disk type. Get a list of available disk types - * by making a list() request. - * @alias compute.diskTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.diskType Name of the disk type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/diskTypes/{diskType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'diskType'], - pathParams: ['diskType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.list - * @desc Retrieves a list of disk types available to the specified project. - * @alias compute.diskTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Firewalls { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.firewalls.delete - * @desc Deletes the specified firewall. - * @alias compute.firewalls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.get - * @desc Returns the specified firewall. - * @alias compute.firewalls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.insert - * @desc Creates a firewall rule in the specified project using the data - * included in the request. - * @alias compute.firewalls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.list - * @desc Retrieves the list of firewall rules available to the specified - * project. - * @alias compute.firewalls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.patch - * @desc Updates the specified firewall rule with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @alias compute.firewalls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.firewalls.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/firewalls/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.update - * @desc Updates the specified firewall rule with the data included in the - * request. The PUT method can only update the following fields of firewall - * rule: allowed, description, sourceRanges, sourceTags, targetTags. - * @alias compute.firewalls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Forwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.forwardingRules.aggregatedList - * @desc Retrieves an aggregated list of forwarding rules. - * @alias compute.forwardingRules.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.delete - * @desc Deletes the specified ForwardingRule resource. - * @alias compute.forwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.get - * @desc Returns the specified ForwardingRule resource. - * @alias compute.forwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.insert - * @desc Creates a ForwardingRule resource in the specified project and region - * using the data included in the request. - * @alias compute.forwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.list - * @desc Retrieves a list of ForwardingRule resources available to the - * specified project and region. - * @alias compute.forwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.patch - * @desc Updates the specified forwarding rule with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. Currently, you can only patch the network_tier - * field. - * @alias compute.forwardingRules.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.setLabels - * @desc Sets the labels on the specified resource. To learn more about - * labels, read the Labeling Resources documentation. - * @alias compute.forwardingRules.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.setTarget - * @desc Changes target URL for forwarding rule. The new target should be of - * the same type as the old target. - * @alias compute.forwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.forwardingRules.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaladdresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalAddresses.delete - * @desc Deletes the specified address resource. - * @alias compute.globalAddresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.get - * @desc Returns the specified address resource. Get a list of available - * addresses by making a list() request. - * @alias compute.globalAddresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @alias compute.globalAddresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.list - * @desc Retrieves a list of global addresses. - * @alias compute.globalAddresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.setLabels - * @desc Sets the labels on a GlobalAddress. To learn more about labels, read - * the Labeling Resources documentation. - * @alias compute.globalAddresses.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/addresses/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.globalAddresses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/addresses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globalforwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalForwardingRules.delete - * @desc Deletes the specified GlobalForwardingRule resource. - * @alias compute.globalForwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.get - * @desc Returns the specified GlobalForwardingRule resource. Get a list of - * available forwarding rules by making a list() request. - * @alias compute.globalForwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.insert - * @desc Creates a GlobalForwardingRule resource in the specified project - * using the data included in the request. - * @alias compute.globalForwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.list - * @desc Retrieves a list of GlobalForwardingRule resources available to the - * specified project. - * @alias compute.globalForwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.patch - * @desc Updates the specified forwarding rule with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. Currently, you can only patch the network_tier - * field. - * @alias compute.globalForwardingRules.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.setLabels - * @desc Sets the labels on the specified resource. To learn more about - * labels, read the Labeling Resources documentation. - * @alias compute.globalForwardingRules.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.setTarget - * @desc Changes target URL for the GlobalForwardingRule resource. The new - * target should be of the same type as the old target. - * @alias compute.globalForwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.globalForwardingRules.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/forwardingRules/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaloperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalOperations.aggregatedList - * @desc Retrieves an aggregated list of all operations. - * @alias compute.globalOperations.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.delete - * @desc Deletes the specified Operations resource. - * @alias compute.globalOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.get - * @desc Retrieves the specified Operations resource. Get a list of operations - * by making a list() request. - * @alias compute.globalOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified project. - * @alias compute.globalOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Healthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.healthChecks.aggregatedList - * @desc Retrieves the list of all HealthCheck resources, regional and global, - * available to the specified project. - * @alias compute.healthChecks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Name of the project scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.delete - * @desc Deletes the specified HealthCheck resource. - * @alias compute.healthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.get - * @desc Returns the specified HealthCheck resource. Get a list of available - * health checks by making a list() request. - * @alias compute.healthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.insert - * @desc Creates a HealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.healthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.list - * @desc Retrieves the list of HealthCheck resources available to the - * specified project. - * @alias compute.healthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.patch - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @alias compute.healthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.healthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.update - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.healthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Hosts { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.hosts.aggregatedList - * @desc Retrieves an aggregated list of hosts. - * @alias compute.hosts.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/aggregated/hosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.delete - * @desc Deletes the specified Host resource. - * @alias compute.hosts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.host Name of the Host resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts/{host}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'host'], - pathParams: ['host', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.get - * @desc Returns the specified host. Get a list of available hosts by making a - * list() request. - * @alias compute.hosts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.host Name of the host to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts/{host}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'host'], - pathParams: ['host', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.hosts.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.insert - * @desc Creates a host resource in the specified project using the data - * included in the request. - * @alias compute.hosts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Host} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.list - * @desc Retrieves a list of hosts available to the specified project. - * @alias compute.hosts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.hosts.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hosts.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.hosts.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Hosttypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.hostTypes.aggregatedList - * @desc Retrieves an aggregated list of host types. - * @alias compute.hostTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/hostTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hostTypes.get - * @desc Returns the specified host type. Get a list of available host types - * by making a list() request. - * @alias compute.hostTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostType Name of the host type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hostTypes/{hostType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'hostType'], - pathParams: ['hostType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.hostTypes.list - * @desc Retrieves a list of host types available to the specified project. - * @alias compute.hostTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/hostTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httphealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpHealthChecks.delete - * @desc Deletes the specified HttpHealthCheck resource. - * @alias compute.httpHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.get - * @desc Returns the specified HttpHealthCheck resource. Get a list of - * available HTTP health checks by making a list() request. - * @alias compute.httpHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.insert - * @desc Creates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.httpHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.list - * @desc Retrieves the list of HttpHealthCheck resources available to the - * specified project. - * @alias compute.httpHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.patch - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @alias compute.httpHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.httpHealthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.update - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.httpHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httpshealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpsHealthChecks.delete - * @desc Deletes the specified HttpsHealthCheck resource. - * @alias compute.httpsHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.get - * @desc Returns the specified HttpsHealthCheck resource. Get a list of - * available HTTPS health checks by making a list() request. - * @alias compute.httpsHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.insert - * @desc Creates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @alias compute.httpsHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.list - * @desc Retrieves the list of HttpsHealthCheck resources available to the - * specified project. - * @alias compute.httpsHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.patch - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @alias compute.httpsHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.httpsHealthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.update - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @alias compute.httpsHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Images { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.images.delete - * @desc Deletes the specified image. - * @alias compute.images.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.deprecate - * @desc Sets the deprecation status of an image. If an empty request body is - * given, clears the deprecation status instead. - * @alias compute.images.deprecate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Image name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DeprecationStatus} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deprecate(params?: any, options?: MethodOptions): - AxiosPromise; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/{image}/deprecate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.get - * @desc Returns the specified image. Get a list of available images by making - * a list() request. - * @alias compute.images.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.getFromFamily - * @desc Returns the latest image that is part of an image family and is not - * deprecated. - * @alias compute.images.getFromFamily - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.family Name of the image family to search for. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getFromFamily(params?: any, options?: MethodOptions): - AxiosPromise; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/family/{family}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'family'], - pathParams: ['family', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.images.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.insert - * @desc Creates an image in the specified project using the data included in - * the request. - * @alias compute.images.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.forceCreate Force image creation if true. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Image} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.list - * @desc Retrieves the list of custom images available to the specified - * project. Custom images are images you create that belong to your project. - * This method does not get any images that belong to other projects, - * including publicly-available images, like Debian 8. If you want to get a - * list of publicly-available images, use this method to make a request to the - * respective image project, such as debian-cloud or windows-cloud. - * @alias compute.images.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.images.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.setLabels - * @desc Sets the labels on an image. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.images.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.images.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/images/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @alias compute.instanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.aggregatedList - * @desc Retrieves the list of managed instance groups and groups them by - * zone. - * @alias compute.instanceGroupManagers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.instanceGroupManagers.applyUpdatesToInstances - * @desc Apply changes to selected instances on the managed instance group. - * This method can be used to apply new overrides and/or new versions. - * @alias compute.instanceGroupManagers.applyUpdatesToInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group, should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. Should conform to RFC1035. - * @param {().InstanceGroupManagersApplyUpdatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - applyUpdatesToInstances(params?: any, options?: MethodOptions): - AxiosPromise; - applyUpdatesToInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - applyUpdatesToInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. Note that the instance group must not belong to a backend - * service. Read Deleting an instance group for more information. - * @alias compute.instanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @alias compute.instanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.deletePerInstanceConfigs - * @desc Deletes selected per-instance configs for the managed instance group. - * @alias compute.instanceGroupManagers.deletePerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. - * @param {().InstanceGroupManagersDeletePerInstanceConfigsReq} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deletePerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - deletePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deletePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. Gets a list of available managed instance groups by making a list() - * request. - * @alias compute.instanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A managed instance group can have up to 1000 VM instances per - * group. Please contact Cloud Support if you need an increase in this limit. - * @alias compute.instanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.list - * @desc Retrieves a list of managed instance groups that are contained within - * the specified project and zone. - * @alias compute.instanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.listManagedInstances - * @desc Lists all of the instances in the managed instance group. Each - * instance in the list has a currentAction, which indicates the action that - * the managed instance group is performing on the instance. For example, if - * the group is still creating an instance, the currentAction is CREATING. If - * a previous action failed, the list displays the errors for that failed - * action. - * @alias compute.instanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>(parameters); - } - } - - - /** - * compute.instanceGroupManagers.listPerInstanceConfigs - * @desc Lists all of the per-instance configs defined for the managed - * instance group. - * @alias compute.instanceGroupManagers.listPerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listPerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - listPerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListPerInstanceConfigsResp>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListPerInstanceConfigsResp>): void; - listPerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListPerInstanceConfigsResp>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListPerInstanceConfigsResp>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$InstanceGroupManagersListPerInstanceConfigsResp>(parameters); - } - } - - - /** - * compute.instanceGroupManagers.patch - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * patched even if the instances in the group are still in the process of - * being patched. You must separately verify the status of the individual - * instances with the listManagedInstances method. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @alias compute.instanceGroupManagers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @alias compute.instanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.resize - * @desc Resizes the managed instance group. If you increase the size, the - * group creates new instances using the current instance template. If you - * decrease the size, the group deletes instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @alias compute.instanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.resizeAdvanced - * @desc Resizes the managed instance group with advanced configuration - * options like disabling creation retries. This is an extended version of the - * resize method. If you increase the size of the instance group, the group - * creates new instances using the current instance template. If you decrease - * the size, the group deletes instances. The resize operation is marked DONE - * when the resize actions are scheduled even if the group has not yet added - * or deleted any instances. You must separately verify the status of the - * creating, creatingWithoutRetries, or deleting actions with the get or - * listmanagedinstances method. If the group is part of a backend service - * that has enabled connection draining, it can take up to 60 seconds after - * the connection draining duration has elapsed before the VM instance is - * removed or deleted. - * @alias compute.instanceGroupManagers.resizeAdvanced - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersResizeAdvancedRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resizeAdvanced(params?: any, options?: MethodOptions): - AxiosPromise; - resizeAdvanced( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resizeAdvanced( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setAutoHealingPolicies - * @desc Modifies the autohealing policies. - * @alias compute.instanceGroupManagers.setAutoHealingPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetAutoHealingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAutoHealingPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setInstanceTemplate - * @desc Specifies the instance template to use when creating new instances in - * this group. The templates for existing instances in the group do not change - * unless you recreate them. - * @alias compute.instanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all instances in this managed - * instance group are assigned. The target pools automatically apply to all of - * the instances in the managed instance group. This operation is marked DONE - * when you make the request even if the instances have not yet been added to - * their target pools. The change might take some time to apply to all of the - * instances in the group depending on the size of the group. - * @alias compute.instanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.instanceGroupManagers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.update - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * updated even if the instances in the group have not yet been updated. You - * must separately verify the status of the individual instances with the - * listManagedInstances method. - * @alias compute.instanceGroupManagers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.updatePerInstanceConfigs - * @desc Insert or patch (for the ones that already exist) per-instance - * configs for the managed instance group. perInstanceConfig.instance serves - * as a key used to distinguish whether to perform insert or patch. - * @alias compute.instanceGroupManagers.updatePerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. - * @param {().InstanceGroupManagersUpdatePerInstanceConfigsReq} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatePerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - updatePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updatePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroups.addInstances - * @desc Adds a list of instances to the specified instance group. All of the - * instances in the instance group must be in the same network/subnetwork. - * Read Adding instances for more information. - * @alias compute.instanceGroups.addInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where you are adding instances. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstances(params?: any, options?: MethodOptions): - AxiosPromise; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.aggregatedList - * @desc Retrieves the list of instance groups and sorts them by zone. - * @alias compute.instanceGroups.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.delete - * @desc Deletes the specified instance group. The instances in the group are - * not deleted. Note that instance group must not belong to a backend service. - * Read Deleting an instance group for more information. - * @alias compute.instanceGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.get - * @desc Returns the specified instance group. Get a list of available - * instance groups by making a list() request. - * @alias compute.instanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.insert - * @desc Creates an instance group in the specified project using the - * parameters that are included in the request. - * @alias compute.instanceGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the instance group. - * @param {().InstanceGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.list - * @desc Retrieves the list of instance groups that are located in the - * specified project and zone. - * @alias compute.instanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.listInstances - * @desc Lists the instances in the specified instance group. - * @alias compute.instanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.removeInstances - * @desc Removes one or more instances from the specified instance group, but - * does not delete those instances. If the group is part of a backend service - * that has enabled connection draining, it can take up to 60 seconds after - * the connection draining duration before the VM instance is removed or - * deleted. - * @alias compute.instanceGroups.removeInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstances(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.setNamedPorts - * @desc Sets the named ports for the specified instance group. - * @alias compute.instanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.instanceGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instances.addAccessConfig - * @desc Adds an access config to an instance's network interface. - * @alias compute.instances.addAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to add to this instance. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.aggregatedList - * @desc Retrieves aggregated list of instances. - * @alias compute.instances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.attachDisk - * @desc Attaches an existing Disk resource to an instance. You must first - * create the disk before you can attach it. It is not possible to create and - * attach a disk at the same time. For more information, read Adding a - * persistent disk to your instance. - * @alias compute.instances.attachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.forceAttach Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks. - * @param {string} params.instance The instance name for this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AttachedDisk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - attachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.delete - * @desc Deletes the specified Instance resource. For more information, see - * Stopping or Deleting an Instance. - * @alias compute.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.deleteAccessConfig - * @desc Deletes an access config from an instance's network interface. - * @alias compute.instances.deleteAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accessConfig The name of the access config to delete. - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.detachDisk - * @desc Detaches a disk from an instance. - * @alias compute.instances.detachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceName Disk device name to detach. - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.get - * @desc Returns the specified Instance resource. Get a list of available - * instances by making a list() request. - * @alias compute.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.getGuestAttributes - * @desc Returns the specified guest attributes entry. - * @alias compute.instances.getGuestAttributes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.variableKey Specifies the key for the guest attributes entry. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getGuestAttributes(params?: any, options?: MethodOptions): - AxiosPromise; - getGuestAttributes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getGuestAttributes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.instances.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.getSerialPortOutput - * @desc Returns the specified instance's serial port output. - * @alias compute.instances.getSerialPortOutput - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSerialPortOutput(params?: any, options?: MethodOptions): - AxiosPromise; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/serialPort') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.insert - * @desc Creates an instance resource in the specified project using the data - * included in the request. - * @alias compute.instances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate - * @param {string} params.zone The name of the zone for this request. - * @param {().Instance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.list - * @desc Retrieves the list of instances contained within the specified zone. - * @alias compute.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.listReferrers - * @desc Retrieves the list of referrers to instances contained within the - * specified zone. - * @alias compute.instances.listReferrers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listReferrers(params?: any, options?: MethodOptions): - AxiosPromise; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/referrers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.reset - * @desc Performs a reset on the instance. For more information, see Resetting - * an instance. - * @alias compute.instances.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.resume - * @desc Resumes an instance that was suspended using the instances().suspend - * method. - * @alias compute.instances.resume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to resume. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesResumeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resume(params?: any, options?: MethodOptions): AxiosPromise; - resume( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resume( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/resume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDeletionProtection - * @desc Sets deletion protection on the instance. - * @alias compute.instances.setDeletionProtection - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDeletionProtection(params?: any, options?: MethodOptions): - AxiosPromise; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDiskAutoDelete - * @desc Sets the auto-delete flag for a disk attached to an instance. - * @alias compute.instances.setDiskAutoDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. - * @param {string} params.deviceName The device name of the disk to modify. - * @param {string} params.instance The instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDiskAutoDelete(params?: any, options?: MethodOptions): - AxiosPromise; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.instances.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setLabels - * @desc Sets labels on an instance. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.instances.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineResources - * @desc Changes the number and/or type of accelerator for a stopped instance - * to the values specified in the request. - * @alias compute.instances.setMachineResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineResources(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineType - * @desc Changes the machine type for a stopped instance to the machine type - * specified in the request. - * @alias compute.instances.setMachineType - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineTypeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineType(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMetadata - * @desc Sets metadata for the specified instance to the data included in the - * request. - * @alias compute.instances.setMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMinCpuPlatform - * @desc Changes the minimum CPU platform that this instance should use. This - * method can only be called on a stopped instance. For more information, read - * Specifying a Minimum CPU Platform. - * @alias compute.instances.setMinCpuPlatform - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMinCpuPlatform(params?: any, options?: MethodOptions): - AxiosPromise; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setScheduling - * @desc Sets an instance's scheduling options. - * @alias compute.instances.setScheduling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Scheduling} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setScheduling(params?: any, options?: MethodOptions): - AxiosPromise; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setServiceAccount - * @desc Sets the service account on the instance. For more information, read - * Changing the service account and access scopes for an instance. - * @alias compute.instances.setServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetServiceAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setShieldedVmIntegrityPolicy - * @desc Sets the Shielded VM integrity policy for an instance. This method - * supports PATCH semantics and uses the JSON merge patch format and - * processing rules. - * @alias compute.instances.setShieldedVmIntegrityPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().ShieldedVmIntegrityPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setShieldedVmIntegrityPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setShieldedVmIntegrityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setShieldedVmIntegrityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setTags - * @desc Sets tags for the specified instance to the data included in the - * request. - * @alias compute.instances.setTags - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Tags} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTags(params?: any, options?: MethodOptions): - AxiosPromise; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.simulateMaintenanceEvent - * @desc Simulates a maintenance event on the instance. - * @alias compute.instances.simulateMaintenanceEvent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - simulateMaintenanceEvent(params?: any, options?: MethodOptions): - AxiosPromise; - simulateMaintenanceEvent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - simulateMaintenanceEvent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.start - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @alias compute.instances.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.startWithEncryptionKey - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @alias compute.instances.startWithEncryptionKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startWithEncryptionKey(params?: any, options?: MethodOptions): - AxiosPromise; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.stop - * @desc Stops a running instance, shutting it down cleanly, and allows you to - * restart the instance at a later time. Stopped instances do not incur VM - * usage charges while they are stopped. However, resources that the VM is - * using, such as persistent disks and static IP addresses, will continue to - * be charged until they are deleted. For more information, see Stopping an - * instance. - * @alias compute.instances.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.discardLocalSsd If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). - * @param {string} params.instance Name of the instance resource to stop. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.suspend - * @desc This method suspends a running instance, saving its state to - * persistent storage, and allows you to resume the instance at a later time. - * Suspended instances incur reduced per-minute, virtual machine usage charges - * while they are suspended. Any resources the virtual machine is using, such - * as persistent disks and static IP addresses, will continue to be charged - * until they are deleted. - * @alias compute.instances.suspend - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.discardLocalSsd If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). - * @param {string} params.instance Name of the instance resource to suspend. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - suspend(params?: any, options?: MethodOptions): - AxiosPromise; - suspend( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - suspend( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/suspend') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.instances.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateAccessConfig - * @desc Updates the specified access config from an instance's network - * interface with the data included in the request. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @alias compute.instances.updateAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface where the access config is attached. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateNetworkInterface - * @desc Updates an instance's network interface. This method follows PATCH - * semantics. - * @alias compute.instances.updateNetworkInterface - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NetworkInterface} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateNetworkInterface(params?: any, options?: MethodOptions): - AxiosPromise; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateShieldedVmConfig - * @desc Updates the Shielded VM config for an instance. This method supports - * PATCH semantics and uses the JSON merge patch format and processing rules. - * @alias compute.instances.updateShieldedVmConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().ShieldedVmConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateShieldedVmConfig(params?: any, options?: MethodOptions): - AxiosPromise; - updateShieldedVmConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateShieldedVmConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancetemplates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceTemplates.delete - * @desc Deletes the specified instance template. Deleting an instance - * template is permanent and cannot be undone. It's not possible to delete - * templates which are in use by an instance group. - * @alias compute.instanceTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.get - * @desc Returns the specified instance template. Gets a list of available - * instance templates by making a list() request. - * @alias compute.instanceTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.insert - * @desc Creates an instance template in the specified project using the data - * that is included in the request. If you are creating a new template to - * update an existing instance group, your new instance template must use the - * same network or, if applicable, the same subnetwork as the original - * template. - * @alias compute.instanceTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.list - * @desc Retrieves a list of instance templates that are contained within the - * specified project and zone. - * @alias compute.instanceTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.instanceTemplates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectattachments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectAttachments.aggregatedList - * @desc Retrieves an aggregated list of interconnect attachments. - * @alias compute.interconnectAttachments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.interconnectAttachments.delete - * @desc Deletes the specified interconnect attachment. - * @alias compute.interconnectAttachments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.get - * @desc Returns the specified interconnect attachment. - * @alias compute.interconnectAttachments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.interconnectAttachments.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.insert - * @desc Creates an InterconnectAttachment in the specified project using the - * data included in the request. - * @alias compute.interconnectAttachments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InterconnectAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.list - * @desc Retrieves the list of interconnect attachments contained within the - * specified region. - * @alias compute.interconnectAttachments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.patch - * @desc Updates the specified interconnect attachment with the data included - * in the request. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @alias compute.interconnectAttachments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InterconnectAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.interconnectAttachments.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.setLabels - * @desc Sets the labels on an InterconnectAttachment. To learn more about - * labels, read the Labeling Resources documentation. - * @alias compute.interconnectAttachments.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.interconnectAttachments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectlocations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectLocations.get - * @desc Returns the details for the specified interconnect location. Get a - * list of available interconnect locations by making a list() request. - * @alias compute.interconnectLocations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectLocation Name of the interconnect location to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnectLocations/{interconnectLocation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnectLocation'], - pathParams: ['interconnectLocation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectLocations.list - * @desc Retrieves the list of interconnect locations available to the - * specified project. - * @alias compute.interconnectLocations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnectLocations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectLocations.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.interconnectLocations.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnectLocations/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnects.delete - * @desc Deletes the specified interconnect. - * @alias compute.interconnects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.get - * @desc Returns the specified interconnect. Get a list of available - * interconnects by making a list() request. - * @alias compute.interconnects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.interconnects.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.insert - * @desc Creates a Interconnect in the specified project using the data - * included in the request. - * @alias compute.interconnects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.list - * @desc Retrieves the list of interconnect available to the specified - * project. - * @alias compute.interconnects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.patch - * @desc Updates the specified interconnect with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @alias compute.interconnects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.interconnects.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.setLabels - * @desc Sets the labels on an Interconnect. To learn more about labels, read - * the Labeling Resources documentation. - * @alias compute.interconnects.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.interconnects.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/interconnects/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licensecodes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenseCodes.get - * @desc Return a specified license code. License codes are mirrored across - * all projects that have permissions to read the License Code. - * @alias compute.licenseCodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.licenseCode Number corresponding to the License code resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenseCodes/{licenseCode}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'licenseCode'], - pathParams: ['licenseCode', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenseCodes.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.licenseCodes.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenseCodes.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.licenseCodes.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenseCodes.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.licenseCodes.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licenses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenses.delete - * @desc Deletes the specified license. - * @alias compute.licenses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the license resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.get - * @desc Returns the specified License resource. - * @alias compute.licenses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the License resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.licenses.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenses/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.insert - * @desc Create a License resource in the specified project. - * @alias compute.licenses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().License} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.list - * @desc Retrieves the list of licenses available in the specified project. - * This method does not get any licenses that belong to other projects, - * including licenses attached to publicly-available images, like Debian 8. If - * you want to get a list of publicly-available licenses, use this method to - * make a request to the respective image project, such as debian-cloud or - * windows-cloud. - * @alias compute.licenses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.licenses.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenses/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.licenses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/licenses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Machinetypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.machineTypes.aggregatedList - * @desc Retrieves an aggregated list of machine types. - * @alias compute.machineTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.get - * @desc Returns the specified machine type. Gets a list of available machine - * types by making a list() request. - * @alias compute.machineTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.machineType Name of the machine type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/machineTypes/{machineType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'machineType'], - pathParams: ['machineType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.list - * @desc Retrieves a list of machine types available to the specified project. - * @alias compute.machineTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Networkendpointgroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.networkEndpointGroups.aggregatedList - * @desc Retrieves the list of network endpoint groups and sorts them by zone. - * @alias compute.networkEndpointGroups.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/networkEndpointGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.networkEndpointGroups.attachNetworkEndpoints - * @desc Attach a list of network endpoints to the specified network endpoint - * group. - * @alias compute.networkEndpointGroups.attachNetworkEndpoints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {().NetworkEndpointGroupsAttachEndpointsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - attachNetworkEndpoints(params?: any, options?: MethodOptions): - AxiosPromise; - attachNetworkEndpoints( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - attachNetworkEndpoints( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'networkEndpointGroup'], - pathParams: ['networkEndpointGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.delete - * @desc Deletes the specified network endpoint group. The network endpoints - * in the NEG and the VM instances they belong to are not terminated when the - * NEG is deleted. Note that the NEG cannot be deleted if there are backend - * services referencing it. - * @alias compute.networkEndpointGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'networkEndpointGroup'], - pathParams: ['networkEndpointGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.detachNetworkEndpoints - * @desc Detach a list of network endpoints from the specified network - * endpoint group. - * @alias compute.networkEndpointGroups.detachNetworkEndpoints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {().NetworkEndpointGroupsDetachEndpointsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detachNetworkEndpoints(params?: any, options?: MethodOptions): - AxiosPromise; - detachNetworkEndpoints( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - detachNetworkEndpoints( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'networkEndpointGroup'], - pathParams: ['networkEndpointGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.get - * @desc Returns the specified network endpoint group. Get a list of available - * network endpoint groups by making a list() request. - * @alias compute.networkEndpointGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'networkEndpointGroup'], - pathParams: ['networkEndpointGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.insert - * @desc Creates a network endpoint group in the specified project using the - * parameters that are included in the request. - * @alias compute.networkEndpointGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. - * @param {().NetworkEndpointGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.list - * @desc Retrieves the list of network endpoint groups that are located in the - * specified project and zone. - * @alias compute.networkEndpointGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networkEndpointGroups.listNetworkEndpoints - * @desc Lists the network endpoints in the specified network endpoint group. - * @alias compute.networkEndpointGroups.listNetworkEndpoints - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string} params.networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. - * @param {().NetworkEndpointGroupsListEndpointsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listNetworkEndpoints(params?: any, options?: MethodOptions): - AxiosPromise; - listNetworkEndpoints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$NetworkEndpointGroupsListNetworkEndpoints>): void; - listNetworkEndpoints( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$NetworkEndpointGroupsListNetworkEndpoints>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'networkEndpointGroup'], - pathParams: ['networkEndpointGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.networkEndpointGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.networkEndpointGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Networks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.networks.addPeering - * @desc Adds a peering to the specified network. - * @alias compute.networks.addPeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to add peering to. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksAddPeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addPeering(params?: any, options?: MethodOptions): - AxiosPromise; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}/addPeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.delete - * @desc Deletes the specified network. - * @alias compute.networks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.get - * @desc Returns the specified network. Get a list of available networks by - * making a list() request. - * @alias compute.networks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.insert - * @desc Creates a network in the specified project using the data included in - * the request. - * @alias compute.networks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.list - * @desc Retrieves the list of networks available to the specified project. - * @alias compute.networks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.listIpOwners - * @desc Lists the internal IP owners in the specified network. - * @alias compute.networks.listIpOwners - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string=} params.ipCidrRange (Optional) IP CIDR range filter, example: "10.128.10.0/30". - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string} params.network Name of the network to return. - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.ownerProjects (Optional) Project IDs filter, example: "project-1,project-2". - * @param {string=} params.ownerTypes (Optional) Owner types filter, example: "instance,forwardingRule". - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string=} params.subnetName (Optional) Subnetwork name filter. - * @param {string=} params.subnetRegion (Optional) Subnetwork region filter. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listIpOwners(params?: any, options?: MethodOptions): - AxiosPromise; - listIpOwners( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listIpOwners( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}/listIpOwners') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.patch - * @desc Patches the specified network with the data included in the request. - * Only the following fields can be modified: routingConfig.routingMode. - * @alias compute.networks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.removePeering - * @desc Removes a peering from the specified network. - * @alias compute.networks.removePeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to remove peering from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksRemovePeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removePeering(params?: any, options?: MethodOptions): - AxiosPromise; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}/removePeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.switchToCustomMode - * @desc Switches the network mode from auto subnet mode to custom subnet - * mode. - * @alias compute.networks.switchToCustomMode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to be updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - switchToCustomMode(params?: any, options?: MethodOptions): - AxiosPromise; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{network}/switchToCustomMode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.networks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/networks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Nodegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.nodeGroups.addNodes - * @desc Adds specified number of nodes to the node group. - * @alias compute.nodeGroups.addNodes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NodeGroupsAddNodesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addNodes(params?: any, options?: MethodOptions): - AxiosPromise; - addNodes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addNodes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeGroup'], - pathParams: ['nodeGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.aggregatedList - * @desc Retrieves an aggregated list of node groups. - * @alias compute.nodeGroups.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/nodeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.delete - * @desc Deletes the specified NodeGroup resource. - * @alias compute.nodeGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeGroup'], - pathParams: ['nodeGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.deleteNodes - * @desc Deletes specified nodes from the node group. - * @alias compute.nodeGroups.deleteNodes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NodeGroupsDeleteNodesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteNodes(params?: any, options?: MethodOptions): - AxiosPromise; - deleteNodes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteNodes( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeGroup'], - pathParams: ['nodeGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.get - * @desc Returns the specified NodeGroup. Get a list of available NodeGroups - * by making a list() request. - * @alias compute.nodeGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeGroup Name of the node group to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeGroup'], - pathParams: ['nodeGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.nodeGroups.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.insert - * @desc Creates a NodeGroup resource in the specified project using the data - * included in the request. - * @alias compute.nodeGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.initialNodeCount Initial count of nodes in the node group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NodeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'initialNodeCount'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.list - * @desc Retrieves a list of node groups available to the specified project. - * @alias compute.nodeGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.nodeGroups.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.setNodeTemplate - * @desc Updates the node template of the node group. - * @alias compute.nodeGroups.setNodeTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NodeGroupsSetNodeTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNodeTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setNodeTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNodeTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeGroup'], - pathParams: ['nodeGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.nodeGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Nodetemplates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.nodeTemplates.aggregatedList - * @desc Retrieves an aggregated list of node templates. - * @alias compute.nodeTemplates.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/nodeTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.delete - * @desc Deletes the specified NodeTemplate resource. - * @alias compute.nodeTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeTemplate Name of the NodeTemplate resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'nodeTemplate'], - pathParams: ['nodeTemplate', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.get - * @desc Returns the specified node template. Get a list of available node - * templates by making a list() request. - * @alias compute.nodeTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeTemplate Name of the node template to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'nodeTemplate'], - pathParams: ['nodeTemplate', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.nodeTemplates.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.insert - * @desc Creates a NodeTemplate resource in the specified project using the - * data included in the request. - * @alias compute.nodeTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NodeTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.list - * @desc Retrieves a list of node templates available to the specified - * project. - * @alias compute.nodeTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.nodeTemplates.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTemplates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.nodeTemplates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Nodetypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.nodeTypes.aggregatedList - * @desc Retrieves an aggregated list of node types. - * @alias compute.nodeTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/nodeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTypes.get - * @desc Returns the specified node type. Get a list of available node types - * by making a list() request. - * @alias compute.nodeTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.nodeType Name of the node type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeTypes/{nodeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'nodeType'], - pathParams: ['nodeType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.nodeTypes.list - * @desc Retrieves a list of node types available to the specified project. - * @alias compute.nodeTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/nodeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.projects.disableXpnHost - * @desc Disable this project as a shared VPC host project. - * @alias compute.projects.disableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/disableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.disableXpnResource - * @desc Disable a serivce resource (a.k.a service project) associated with - * this host project. - * @alias compute.projects.disableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/disableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnHost - * @desc Enable this project as a shared VPC host project. - * @alias compute.projects.enableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/enableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnResource - * @desc Enable service resource (a.k.a service project) for a host project, - * so that subnets in the host project can be used by instances in the service - * project. - * @alias compute.projects.enableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/enableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.get - * @desc Returns the specified Project resource. - * @alias compute.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnHost - * @desc Gets the shared VPC host project that this project links to. May be - * empty if no link exists. - * @alias compute.projects.getXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/getXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnResources - * @desc Gets service resources (a.k.a service project) associated with this - * host project. - * @alias compute.projects.getXpnResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnResources(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/getXpnResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.listXpnHosts - * @desc Lists all shared VPC host projects visible to the user in an - * organization. - * @alias compute.projects.listXpnHosts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {().ProjectsListXpnHostsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listXpnHosts(params?: any, options?: MethodOptions): - AxiosPromise; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/listXpnHosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveDisk - * @desc Moves a persistent disk from one zone to another. - * @alias compute.projects.moveDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DiskMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveDisk(params?: any, options?: MethodOptions): - AxiosPromise; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/moveDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveInstance - * @desc Moves an instance and its attached persistent disks from one zone to - * another. - * @alias compute.projects.moveInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveInstance(params?: any, options?: MethodOptions): - AxiosPromise; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/moveInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setCommonInstanceMetadata - * @desc Sets metadata common to all instances within the specified project - * using the data included in the request. - * @alias compute.projects.setCommonInstanceMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setCommonInstanceMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/setCommonInstanceMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setDefaultNetworkTier - * @desc Sets the default network tier of the project. The default network - * tier is used when an address/forwardingRule/instance is created without - * specifying the network tier field. - * @alias compute.projects.setDefaultNetworkTier - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsSetDefaultNetworkTierRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDefaultNetworkTier(params?: any, options?: MethodOptions): - AxiosPromise; - setDefaultNetworkTier( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDefaultNetworkTier( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/setDefaultNetworkTier') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setDefaultServiceAccount - * @desc Sets the default service account of the project. The default service - * account is used when a VM instance is created with the service account - * email address set to "default". - * @alias compute.projects.setDefaultServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsSetDefaultServiceAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDefaultServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - setDefaultServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDefaultServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/setDefaultServiceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setUsageExportBucket - * @desc Enables the usage export feature and sets the usage export bucket - * where reports are stored. If you provide an empty request body using this - * method, the usage export feature will be disabled. - * @alias compute.projects.setUsageExportBucket - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UsageExportLocation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUsageExportBucket(params?: any, options?: MethodOptions): - AxiosPromise; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/setUsageExportBucket') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionautoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionAutoscalers.delete - * @desc Deletes the specified autoscaler. - * @alias compute.regionAutoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.get - * @desc Returns the specified autoscaler. - * @alias compute.regionAutoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @alias compute.regionAutoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified - * region. - * @alias compute.regionAutoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @alias compute.regionAutoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionAutoscalers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @alias compute.regionAutoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionbackendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionBackendServices.delete - * @desc Deletes the specified regional BackendService resource. - * @alias compute.regionBackendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.get - * @desc Returns the specified regional BackendService resource. - * @alias compute.regionBackendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.getHealth - * @desc Gets the most recent health check results for this regional - * BackendService. - * @alias compute.regionBackendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource for which to get health. - * @param {string} params.project - * @param {string} params.region Name of the region scoping this request. - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.insert - * @desc Creates a regional BackendService resource in the specified project - * using the data included in the request. There are several restrictions and - * guidelines to keep in mind when creating a regional backend service. Read - * Restrictions and Guidelines for more information. - * @alias compute.regionBackendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.list - * @desc Retrieves the list of regional BackendService resources available to - * the specified project in the given region. - * @alias compute.regionBackendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.patch - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @alias compute.regionBackendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionBackendServices.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.update - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. - * @alias compute.regionBackendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioncommitments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionCommitments.aggregatedList - * @desc Retrieves an aggregated list of commitments. - * @alias compute.regionCommitments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.get - * @desc Returns the specified commitment resource. Get a list of available - * commitments by making a list() request. - * @alias compute.regionCommitments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commitment Name of the commitment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/commitments/{commitment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'commitment'], - pathParams: ['commitment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.insert - * @desc Creates a commitment in the specified project using the data included - * in the request. - * @alias compute.regionCommitments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Commitment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.list - * @desc Retrieves a list of commitments contained within the specified - * region. - * @alias compute.regionCommitments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionCommitments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/commitments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regiondisks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionDisks.createSnapshot - * @desc Creates a snapshot of this regional disk. - * @alias compute.regionDisks.createSnapshot - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to snapshot. - * @param {boolean=} params.guestFlush - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Snapshot} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSnapshot(params?: any, options?: MethodOptions): - AxiosPromise; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}/createSnapshot') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.delete - * @desc Deletes the specified regional persistent disk. Deleting a regional - * disk removes all the replicas of its data permanently and is irreversible. - * However, deleting a disk does not delete any snapshots previously made from - * the disk. You must separately delete snapshots. - * @alias compute.regionDisks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.get - * @desc Returns a specified regional persistent disk. - * @alias compute.regionDisks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.insert - * @desc Creates a persistent regional disk in the specified project using the - * data included in the request. - * @alias compute.regionDisks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. - * @param {().Disk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.list - * @desc Retrieves the list of persistent disks contained within the specified - * region. - * @alias compute.regionDisks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.resize - * @desc Resizes the specified regional persistent disk. - * @alias compute.regionDisks.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk. - * @param {string} params.project The project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionDisksResizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.setLabels - * @desc Sets the labels on the target regional disk. - * @alias compute.regionDisks.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionDisks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regiondisktypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionDiskTypes.get - * @desc Returns the specified regional disk type. Get a list of available - * disk types by making a list() request. - * @alias compute.regionDiskTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.diskType Name of the disk type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/diskTypes/{diskType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'diskType'], - pathParams: ['diskType', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDiskTypes.list - * @desc Retrieves a list of regional disk types available to the specified - * project. - * @alias compute.regionDiskTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionhealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionHealthChecks.delete - * @desc Deletes the specified HealthCheck resource. - * @alias compute.regionHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'healthCheck'], - pathParams: ['healthCheck', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.get - * @desc Returns the specified HealthCheck resource. Get a list of available - * health checks by making a list() request. - * @alias compute.regionHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'healthCheck'], - pathParams: ['healthCheck', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.insert - * @desc Creates a HealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.regionHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.list - * @desc Retrieves the list of HealthCheck resources available to the - * specified project. - * @alias compute.regionHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.patch - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @alias compute.regionHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'healthCheck'], - pathParams: ['healthCheck', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionHealthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionHealthChecks.update - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. - * @alias compute.regionHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'healthCheck'], - pathParams: ['healthCheck', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @alias compute.regionInstanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.applyUpdatesToInstances - * @desc Apply updates to selected instances the managed instance group. - * @alias compute.regionInstanceGroupManagers.applyUpdatesToInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group, should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. - * @param {().RegionInstanceGroupManagersApplyUpdatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - applyUpdatesToInstances(params?: any, options?: MethodOptions): - AxiosPromise; - applyUpdatesToInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - applyUpdatesToInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. - * @alias compute.regionInstanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @alias compute.regionInstanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.deletePerInstanceConfigs - * @desc Deletes selected per-instance configs for the managed instance group. - * @alias compute.regionInstanceGroupManagers.deletePerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. - * @param {().RegionInstanceGroupManagerDeleteInstanceConfigReq} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deletePerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - deletePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deletePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. - * @alias compute.regionInstanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A regional managed instance group can contain up to 2000 - * instances. - * @alias compute.regionInstanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.list - * @desc Retrieves the list of managed instance groups that are contained - * within the specified region. - * @alias compute.regionInstanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.listManagedInstances - * @desc Lists the instances in the managed instance group and instances that - * are scheduled to be created. The list includes any current actions that the - * group has scheduled for its instances. - * @alias compute.regionInstanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$RegionInstanceGroupManagersListInstancesResponse>(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.listPerInstanceConfigs - * @desc Lists all of the per-instance configs defined for the managed - * instance group. - * @alias compute.regionInstanceGroupManagers.listPerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listPerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - listPerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>): void; - listPerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>( - parameters, callback); - } else { - return createAPIRequest< - Schema$RegionInstanceGroupManagersListInstanceConfigsResp>( - parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.patch - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * patched even if the instances in the group are still in the process of - * being patched. You must separately verify the status of the individual - * instances with the listmanagedinstances method. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @alias compute.regionInstanceGroupManagers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @alias compute.regionInstanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.resize - * @desc Changes the intended size for the managed instance group. If you - * increase the size, the group schedules actions to create new instances - * using the current instance template. If you decrease the size, the group - * schedules delete actions on one or more instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @alias compute.regionInstanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size Number of instances that should exist in this instance group manager. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setAutoHealingPolicies - * @desc Modifies the autohealing policy for the instances in this managed - * instance group. - * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetAutoHealingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAutoHealingPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setInstanceTemplate - * @desc Sets the instance template to use when creating new instances or - * recreating instances in this group. Existing instances are not affected. - * @alias compute.regionInstanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all new instances in this group - * are assigned. Existing instances in the group are not affected. - * @alias compute.regionInstanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionInstanceGroupManagers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.update - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * updated even if the instances in the group have not yet been updated. You - * must separately verify the status of the individual instances with the - * listmanagedinstances method. - * @alias compute.regionInstanceGroupManagers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.updatePerInstanceConfigs - * @desc Insert or patch (for the ones that already exist) per-instance - * configs for the managed instance group. perInstanceConfig.instance serves - * as a key used to distinguish whether to perform insert or patch. - * @alias compute.regionInstanceGroupManagers.updatePerInstanceConfigs - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. - * @param {().RegionInstanceGroupManagerUpdateInstanceConfigReq} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatePerInstanceConfigs(params?: any, options?: MethodOptions): - AxiosPromise; - updatePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updatePerInstanceConfigs( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroups.get - * @desc Returns the specified instance group resource. - * @alias compute.regionInstanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup Name of the instance group resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.list - * @desc Retrieves the list of instance group resources contained within the - * specified region. - * @alias compute.regionInstanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.listInstances - * @desc Lists the instances in the specified instance group and displays - * information about the named ports. Depending on the specified options, this - * method can list all instances or only the instances that are running. - * @alias compute.regionInstanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroups.setNamedPorts - * @desc Sets the named ports for the specified regional instance group. - * @alias compute.regionInstanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionInstanceGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionOperations.delete - * @desc Deletes the specified region-specific Operations resource. - * @alias compute.regionOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.get - * @desc Retrieves the specified region-specific Operations resource. - * @alias compute.regionOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified region. - * @alias compute.regionOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regions { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regions.get - * @desc Returns the specified Region resource. Get a list of available - * regions by making a list() request. - * @alias compute.regions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/regions/{region}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regions.list - * @desc Retrieves the list of region resources available to the specified - * project. - * @alias compute.regions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/regions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regiontargethttpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionTargetHttpProxies.delete - * @desc Deletes the specified TargetHttpProxy resource. - * @alias compute.regionTargetHttpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetHttpProxy'], - pathParams: ['project', 'region', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionTargetHttpProxies.get - * @desc Returns the specified TargetHttpProxy resource in the specified - * region. Gets a list of available target HTTP proxies by making a list() - * request. - * @alias compute.regionTargetHttpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetHttpProxy'], - pathParams: ['project', 'region', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionTargetHttpProxies.insert - * @desc Creates a TargetHttpProxy resource in the specified project and - * region using the data included in the request. - * @alias compute.regionTargetHttpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionTargetHttpProxies.list - * @desc Retrieves the list of TargetHttpProxy resources available to the - * specified project in the specified region. - * @alias compute.regionTargetHttpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionTargetHttpProxies.setUrlMap - * @desc Changes the URL map for TargetHttpProxy. - * @alias compute.regionTargetHttpProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetHttpProxy'], - pathParams: ['project', 'region', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionTargetHttpProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionTargetHttpProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionurlmaps { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionUrlMaps.delete - * @desc Deletes the specified UrlMap resource. - * @alias compute.regionUrlMaps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. - * @param {string} params.urlMap Name of the UrlMap resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'urlMap'], - pathParams: ['project', 'region', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.get - * @desc Returns the specified UrlMap resource. Get a list of available URL - * maps by making a list() request. - * @alias compute.regionUrlMaps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.urlMap Name of the UrlMap resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'urlMap'], - pathParams: ['project', 'region', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.insert - * @desc Creates a UrlMap resource in the specified project using the data - * included in the request. - * @alias compute.regionUrlMaps.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.list - * @desc Retrieves the list of UrlMap resources available to the specified - * project in the specified region. - * @alias compute.regionUrlMaps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.patch - * @desc Patches the specified UrlMap resource with the data included in the - * request. This method supports PATCH semantics and uses JSON merge patch - * format and processing rules. - * @alias compute.regionUrlMaps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. - * @param {string} params.urlMap Name of the UrlMap resource to patch. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'urlMap'], - pathParams: ['project', 'region', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionUrlMaps.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.update - * @desc Updates the specified UrlMap resource with the data included in the - * request. - * @alias compute.regionUrlMaps.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. - * @param {string} params.urlMap Name of the UrlMap resource to update. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'urlMap'], - pathParams: ['project', 'region', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionUrlMaps.validate - * @desc Runs static validation for the UrlMap. In particular, the tests of - * the provided UrlMap will be run. Calling this method does NOT create the - * UrlMap. - * @alias compute.regionUrlMaps.validate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.urlMap Name of the UrlMap resource to be validated as. - * @param {().RegionUrlMapsValidateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - validate(params?: any, options?: MethodOptions): - AxiosPromise; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}/validate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'urlMap'], - pathParams: ['project', 'region', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routers.aggregatedList - * @desc Retrieves an aggregated list of routers. - * @alias compute.routers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.delete - * @desc Deletes the specified Router resource. - * @alias compute.routers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.get - * @desc Returns the specified Router resource. Get a list of available - * routers by making a list() request. - * @alias compute.routers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.getRouterStatus - * @desc Retrieves runtime information of the specified router. - * @alias compute.routers.getRouterStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRouterStatus(params?: any, options?: MethodOptions): - AxiosPromise; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.insert - * @desc Creates a Router resource in the specified project and region using - * the data included in the request. - * @alias compute.routers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.list - * @desc Retrieves a list of Router resources available to the specified - * project. - * @alias compute.routers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.patch - * @desc Patches the specified Router resource with the data included in the - * request. This method supports PATCH semantics and uses JSON merge patch - * format and processing rules. - * @alias compute.routers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to patch. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.preview - * @desc Preview fields auto-generated during router create and update - * operations. Calling this method does NOT create or update the router. - * @alias compute.routers.preview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - preview(params?: any, options?: MethodOptions): - AxiosPromise; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}/preview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.routers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.update - * @desc Updates the specified Router resource with the data included in the - * request. - * @alias compute.routers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to update. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routes.delete - * @desc Deletes the specified Route resource. - * @alias compute.routes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.route Name of the Route resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.get - * @desc Returns the specified Route resource. Get a list of available routes - * by making a list() request. - * @alias compute.routes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.route Name of the Route resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.insert - * @desc Creates a Route resource in the specified project using the data - * included in the request. - * @alias compute.routes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Route} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.list - * @desc Retrieves the list of Route resources available to the specified - * project. - * @alias compute.routes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.routes.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/routes/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Securitypolicies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.securityPolicies.addRule - * @desc Inserts a rule into a security policy. - * @alias compute.securityPolicies.addRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {boolean=} params.validateOnly If true, the request will not be committed. - * @param {().SecurityPolicyRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addRule(params?: any, options?: MethodOptions): - AxiosPromise; - addRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/addRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.delete - * @desc Deletes the specified policy. - * @alias compute.securityPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.securityPolicy Name of the security policy to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.get - * @desc List all of the ordered rules present in a single specified policy. - * @alias compute.securityPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.getRule - * @desc Gets a rule at the specified priority. - * @alias compute.securityPolicies.getRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to get from the security policy. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to which the queried rule belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRule(params?: any, options?: MethodOptions): - AxiosPromise; - getRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/getRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.insert - * @desc Creates a new policy in the specified project using the data included - * in the request. - * @alias compute.securityPolicies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean=} params.validateOnly If true, the request will not be committed. - * @param {().SecurityPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.list - * @desc List all the policies that have been configured for the specified - * project. - * @alias compute.securityPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.patch - * @desc Patches the specified policy with the data included in the request. - * @alias compute.securityPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {().SecurityPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.patchRule - * @desc Patches a rule at the specified priority. - * @alias compute.securityPolicies.patchRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {boolean=} params.validateOnly If true, the request will not be committed. - * @param {().SecurityPolicyRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patchRule(params?: any, options?: MethodOptions): - AxiosPromise; - patchRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patchRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/patchRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.removeRule - * @desc Deletes a rule at the specified priority. - * @alias compute.securityPolicies.removeRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to remove from the security policy. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeRule(params?: any, options?: MethodOptions): - AxiosPromise; - removeRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/removeRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.securityPolicies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/securityPolicies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Snapshots { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.snapshots.delete - * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a - * single snapshot might not necessarily delete all the data on that snapshot. - * If any data on the snapshot that is marked for deletion is needed for - * subsequent snapshots, the data will be moved to the next corresponding - * snapshot. For more information, see Deleting snaphots. - * @alias compute.snapshots.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.snapshot Name of the Snapshot resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.get - * @desc Returns the specified Snapshot resource. Get a list of available - * snapshots by making a list() request. - * @alias compute.snapshots.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.snapshot Name of the Snapshot resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.snapshots.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.list - * @desc Retrieves the list of Snapshot resources contained within the - * specified project. - * @alias compute.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/alpha/projects/{project}/global/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.snapshots.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.setLabels - * @desc Sets the labels on a snapshot. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.snapshots.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.snapshots.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/snapshots/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslcertificates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslCertificates.delete - * @desc Deletes the specified SslCertificate resource. - * @alias compute.sslCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.get - * @desc Returns the specified SslCertificate resource. Get a list of - * available SSL certificates by making a list() request. - * @alias compute.sslCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslCertificate Name of the SslCertificate resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.insert - * @desc Creates a SslCertificate resource in the specified project using the - * data included in the request. - * @alias compute.sslCertificates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.list - * @desc Retrieves the list of SslCertificate resources available to the - * specified project. - * @alias compute.sslCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.sslCertificates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslCertificates/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslpolicies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslPolicies.delete - * @desc Deletes the specified SSL policy. The SSL policy resource can be - * deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy - * resources. - * @alias compute.sslPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.get - * @desc Lists all of the ordered rules present in a single specified policy. - * @alias compute.sslPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.insert - * @desc Returns the specified SSL policy resource. Get a list of available - * SSL policies by making a list() request. - * @alias compute.sslPolicies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.list - * @desc Lists all the SSL policies that have been configured for the - * specified project. - * @alias compute.sslPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.listAvailableFeatures - * @desc Lists all features that can be specified in the SSL policy when using - * custom profile. - * @alias compute.sslPolicies.listAvailableFeatures - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableFeatures(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): void; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies/listAvailableFeatures') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.sslPolicies.patch - * @desc Patches the specified SSL policy with the data included in the - * request. - * @alias compute.sslPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.sslPolicies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/sslPolicies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subnetworks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.subnetworks.aggregatedList - * @desc Retrieves an aggregated list of subnetworks. - * @alias compute.subnetworks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.delete - * @desc Deletes the specified subnetwork. - * @alias compute.subnetworks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.expandIpCidrRange - * @desc Expands the IP CIDR range of the subnetwork to a specified value. - * @alias compute.subnetworks.expandIpCidrRange - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to update. - * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - expandIpCidrRange(params?: any, options?: MethodOptions): - AxiosPromise; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.get - * @desc Returns the specified subnetwork. Get a list of available subnetworks - * list() request. - * @alias compute.subnetworks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.subnetwork Name of the Subnetwork resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias compute.subnetworks.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.insert - * @desc Creates a subnetwork in the specified project using the data included - * in the request. - * @alias compute.subnetworks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.list - * @desc Retrieves a list of subnetworks available to the specified project. - * @alias compute.subnetworks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.listUsable - * @desc Retrieves an aggregated list of usable subnetworks. - * @alias compute.subnetworks.listUsable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listUsable(params?: any, options?: MethodOptions): - AxiosPromise; - listUsable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listUsable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/subnetworks/listUsable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.subnetworks.patch - * @desc Patches the specified subnetwork with the data included in the - * request. Only the following fields within the subnetwork resource can be - * specified in the request: secondary_ip_range, - * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify - * the current fingeprint of the subnetwork resource being patched. - * @alias compute.subnetworks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to patch. - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias compute.subnetworks.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.setPrivateIpGoogleAccess - * @desc Set whether VMs in this subnet can access Google services without - * assigning external IP addresses through Private Google Access. - * @alias compute.subnetworks.setPrivateIpGoogleAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource. - * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): - AxiosPromise; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.subnetworks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpProxies.aggregatedList - * @desc Retrieves the list of all TargetHttpProxy resources, regional and - * global, available to the specified project. - * @alias compute.targetHttpProxies.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Name of the project scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.delete - * @desc Deletes the specified TargetHttpProxy resource. - * @alias compute.targetHttpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.get - * @desc Returns the specified TargetHttpProxy resource. Get a list of - * available target HTTP proxies by making a list() request. - * @alias compute.targetHttpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.insert - * @desc Creates a TargetHttpProxy resource in the specified project using the - * data included in the request. - * @alias compute.targetHttpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.list - * @desc Retrieves the list of TargetHttpProxy resources available to the - * specified project. - * @alias compute.targetHttpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.setUrlMap - * @desc Changes the URL map for TargetHttpProxy. - * @alias compute.targetHttpProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetHttpProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpsproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpsProxies.delete - * @desc Deletes the specified TargetHttpsProxy resource. - * @alias compute.targetHttpsProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.get - * @desc Returns the specified TargetHttpsProxy resource. Get a list of - * available target HTTPS proxies by making a list() request. - * @alias compute.targetHttpsProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.insert - * @desc Creates a TargetHttpsProxy resource in the specified project using - * the data included in the request. - * @alias compute.targetHttpsProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpsProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.list - * @desc Retrieves the list of TargetHttpsProxy resources available to the - * specified project. - * @alias compute.targetHttpsProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setQuicOverride - * @desc Sets the QUIC override policy for TargetHttpsProxy. - * @alias compute.targetHttpsProxies.setQuicOverride - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. - * @param {().TargetHttpsProxiesSetQuicOverrideRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setQuicOverride(params?: any, options?: MethodOptions): - AxiosPromise; - setQuicOverride( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setQuicOverride( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslCertificates - * @desc Replaces SslCertificates for TargetHttpsProxy. - * @alias compute.targetHttpsProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslPolicy - * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies - * the server-side support for SSL features. This affects connections between - * clients and the HTTPS proxy load balancer. They do not affect the - * connection between the load balancer and the backends. - * @alias compute.targetHttpsProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setUrlMap - * @desc Changes the URL map for TargetHttpsProxy. - * @alias compute.targetHttpsProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetHttpsProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetHttpsProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetinstances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetInstances.aggregatedList - * @desc Retrieves an aggregated list of target instances. - * @alias compute.targetInstances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.delete - * @desc Deletes the specified TargetInstance resource. - * @alias compute.targetInstances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetInstance Name of the TargetInstance resource to delete. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.get - * @desc Returns the specified TargetInstance resource. Get a list of - * available target instances by making a list() request. - * @alias compute.targetInstances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetInstance Name of the TargetInstance resource to return. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.insert - * @desc Creates a TargetInstance resource in the specified project and zone - * using the data included in the request. - * @alias compute.targetInstances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone scoping this request. - * @param {().TargetInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.list - * @desc Retrieves a list of TargetInstance resources available to the - * specified project and zone. - * @alias compute.targetInstances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetInstances.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetpools { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetPools.addHealthCheck - * @desc Adds health check URLs to a target pool. - * @alias compute.targetPools.addHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to add a health check to. - * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.addInstance - * @desc Adds an instance to a target pool. - * @alias compute.targetPools.addInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to add instances to. - * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstance(params?: any, options?: MethodOptions): - AxiosPromise; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.aggregatedList - * @desc Retrieves an aggregated list of target pools. - * @alias compute.targetPools.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.delete - * @desc Deletes the specified target pool. - * @alias compute.targetPools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.get - * @desc Returns the specified target pool. Get a list of available target - * pools by making a list() request. - * @alias compute.targetPools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.getHealth - * @desc Gets the most recent health check results for each IP for the - * instance that is referenced by the given target pool. - * @alias compute.targetPools.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. - * @param {().InstanceReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.insert - * @desc Creates a target pool in the specified project and region using the - * data included in the request. - * @alias compute.targetPools.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetPool} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.list - * @desc Retrieves a list of target pools available to the specified project - * and region. - * @alias compute.targetPools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeHealthCheck - * @desc Removes health check URL from a target pool. - * @alias compute.targetPools.removeHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to remove health checks from. - * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeInstance - * @desc Removes instance URL from a target pool. - * @alias compute.targetPools.removeInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. - * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstance(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.setBackup - * @desc Changes a backup target pool's configurations. - * @alias compute.targetPools.setBackup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {number=} params.failoverRatio New failoverRatio value for the target pool. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackup(params?: any, options?: MethodOptions): - AxiosPromise; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetPools.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetPools/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetsslproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetSslProxies.delete - * @desc Deletes the specified TargetSslProxy resource. - * @alias compute.targetSslProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.get - * @desc Returns the specified TargetSslProxy resource. Get a list of - * available target SSL proxies by making a list() request. - * @alias compute.targetSslProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.insert - * @desc Creates a TargetSslProxy resource in the specified project using the - * data included in the request. - * @alias compute.targetSslProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetSslProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.list - * @desc Retrieves the list of TargetSslProxy resources available to the - * specified project. - * @alias compute.targetSslProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setBackendService - * @desc Changes the BackendService for TargetSslProxy. - * @alias compute.targetSslProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. - * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetSslProxy. - * @alias compute.targetSslProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslCertificates - * @desc Changes SslCertificates for TargetSslProxy. - * @alias compute.targetSslProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslPolicy - * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the - * server-side support for SSL features. This affects connections between - * clients and the SSL proxy load balancer. They do not affect the connection - * between the load balancer and the backends. - * @alias compute.targetSslProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetSslProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetSslProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targettcpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetTcpProxies.delete - * @desc Deletes the specified TargetTcpProxy resource. - * @alias compute.targetTcpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.get - * @desc Returns the specified TargetTcpProxy resource. Get a list of - * available target TCP proxies by making a list() request. - * @alias compute.targetTcpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.insert - * @desc Creates a TargetTcpProxy resource in the specified project using the - * data included in the request. - * @alias compute.targetTcpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetTcpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.list - * @desc Retrieves the list of TargetTcpProxy resources available to the - * specified project. - * @alias compute.targetTcpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setBackendService - * @desc Changes the BackendService for TargetTcpProxy. - * @alias compute.targetTcpProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. - * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetTcpProxy. - * @alias compute.targetTcpProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetTcpProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/targetTcpProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetvpngateways { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetVpnGateways.aggregatedList - * @desc Retrieves an aggregated list of target VPN gateways. - * @alias compute.targetVpnGateways.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/aggregated/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.targetVpnGateways.delete - * @desc Deletes the specified target VPN gateway. - * @alias compute.targetVpnGateways.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.get - * @desc Returns the specified target VPN gateway. Get a list of available - * target VPN gateways by making a list() request. - * @alias compute.targetVpnGateways.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.insert - * @desc Creates a target VPN gateway in the specified project and region - * using the data included in the request. - * @alias compute.targetVpnGateways.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetVpnGateway} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.list - * @desc Retrieves a list of target VPN gateways available to the specified - * project and region. - * @alias compute.targetVpnGateways.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.setLabels - * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, - * read the Labeling Resources documentation. - * @alias compute.targetVpnGateways.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.targetVpnGateways.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Urlmaps { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.urlMaps.delete - * @desc Deletes the specified UrlMap resource. - * @alias compute.urlMaps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.get - * @desc Returns the specified UrlMap resource. Get a list of available URL - * maps by making a list() request. - * @alias compute.urlMaps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.insert - * @desc Creates a UrlMap resource in the specified project using the data - * included in the request. - * @alias compute.urlMaps.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.invalidateCache - * @desc Initiates a cache invalidation operation, invalidating the specified - * path, scoped to the specified UrlMap. - * @alias compute.urlMaps.invalidateCache - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap scoping this request. - * @param {().CacheInvalidationRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - invalidateCache(params?: any, options?: MethodOptions): - AxiosPromise; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.list - * @desc Retrieves the list of UrlMap resources available to the specified - * project. - * @alias compute.urlMaps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.patch - * @desc Patches the specified UrlMap resource with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @alias compute.urlMaps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to patch. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.urlMaps.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.update - * @desc Updates the specified UrlMap resource with the data included in the - * request. - * @alias compute.urlMaps.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to update. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.validate - * @desc Runs static validation for the UrlMap. In particular, the tests of - * the provided UrlMap will be run. Calling this method does NOT create the - * UrlMap. - * @alias compute.urlMaps.validate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to be validated as. - * @param {().UrlMapsValidateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - validate(params?: any, options?: MethodOptions): - AxiosPromise; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}/validate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Vpntunnels { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.vpnTunnels.aggregatedList - * @desc Retrieves an aggregated list of VPN tunnels. - * @alias compute.vpnTunnels.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/aggregated/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.delete - * @desc Deletes the specified VpnTunnel resource. - * @alias compute.vpnTunnels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object +// tslint:disable: no-namespace + +export namespace compute_alpha { + /** + * Compute Engine API + * + * Creates and runs virtual machines on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const compute = google.compute('alpha'); + * + * @namespace compute + * @type {Function} + * @version alpha + * @variation alpha + * @param {object=} options Options for Compute + */ + export class Compute { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + acceleratorTypes: Resource$Acceleratortypes; + addresses: Resource$Addresses; + autoscalers: Resource$Autoscalers; + backendBuckets: Resource$Backendbuckets; + backendServices: Resource$Backendservices; + disks: Resource$Disks; + diskTypes: Resource$Disktypes; + firewalls: Resource$Firewalls; + forwardingRules: Resource$Forwardingrules; + globalAddresses: Resource$Globaladdresses; + globalForwardingRules: Resource$Globalforwardingrules; + globalOperations: Resource$Globaloperations; + healthChecks: Resource$Healthchecks; + hosts: Resource$Hosts; + hostTypes: Resource$Hosttypes; + httpHealthChecks: Resource$Httphealthchecks; + httpsHealthChecks: Resource$Httpshealthchecks; + images: Resource$Images; + instanceGroupManagers: Resource$Instancegroupmanagers; + instanceGroups: Resource$Instancegroups; + instances: Resource$Instances; + instanceTemplates: Resource$Instancetemplates; + interconnectAttachments: Resource$Interconnectattachments; + interconnectLocations: Resource$Interconnectlocations; + interconnects: Resource$Interconnects; + licenseCodes: Resource$Licensecodes; + licenses: Resource$Licenses; + machineTypes: Resource$Machinetypes; + networkEndpointGroups: Resource$Networkendpointgroups; + networks: Resource$Networks; + nodeGroups: Resource$Nodegroups; + nodeTemplates: Resource$Nodetemplates; + nodeTypes: Resource$Nodetypes; + projects: Resource$Projects; + regionAutoscalers: Resource$Regionautoscalers; + regionBackendServices: Resource$Regionbackendservices; + regionCommitments: Resource$Regioncommitments; + regionDisks: Resource$Regiondisks; + regionDiskTypes: Resource$Regiondisktypes; + regionHealthChecks: Resource$Regionhealthchecks; + regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; + regionInstanceGroups: Resource$Regioninstancegroups; + regionOperations: Resource$Regionoperations; + regions: Resource$Regions; + regionTargetHttpProxies: Resource$Regiontargethttpproxies; + regionUrlMaps: Resource$Regionurlmaps; + routers: Resource$Routers; + routes: Resource$Routes; + securityPolicies: Resource$Securitypolicies; + snapshots: Resource$Snapshots; + sslCertificates: Resource$Sslcertificates; + sslPolicies: Resource$Sslpolicies; + subnetworks: Resource$Subnetworks; + targetHttpProxies: Resource$Targethttpproxies; + targetHttpsProxies: Resource$Targethttpsproxies; + targetInstances: Resource$Targetinstances; + targetPools: Resource$Targetpools; + targetSslProxies: Resource$Targetsslproxies; + targetTcpProxies: Resource$Targettcpproxies; + targetVpnGateways: Resource$Targetvpngateways; + urlMaps: Resource$Urlmaps; + vpnTunnels: Resource$Vpntunnels; + zoneOperations: Resource$Zoneoperations; + zones: Resource$Zones; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.acceleratorTypes = new Resource$Acceleratortypes(this); + this.addresses = new Resource$Addresses(this); + this.autoscalers = new Resource$Autoscalers(this); + this.backendBuckets = new Resource$Backendbuckets(this); + this.backendServices = new Resource$Backendservices(this); + this.disks = new Resource$Disks(this); + this.diskTypes = new Resource$Disktypes(this); + this.firewalls = new Resource$Firewalls(this); + this.forwardingRules = new Resource$Forwardingrules(this); + this.globalAddresses = new Resource$Globaladdresses(this); + this.globalForwardingRules = new Resource$Globalforwardingrules(this); + this.globalOperations = new Resource$Globaloperations(this); + this.healthChecks = new Resource$Healthchecks(this); + this.hosts = new Resource$Hosts(this); + this.hostTypes = new Resource$Hosttypes(this); + this.httpHealthChecks = new Resource$Httphealthchecks(this); + this.httpsHealthChecks = new Resource$Httpshealthchecks(this); + this.images = new Resource$Images(this); + this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); + this.instanceGroups = new Resource$Instancegroups(this); + this.instances = new Resource$Instances(this); + this.instanceTemplates = new Resource$Instancetemplates(this); + this.interconnectAttachments = new Resource$Interconnectattachments(this); + this.interconnectLocations = new Resource$Interconnectlocations(this); + this.interconnects = new Resource$Interconnects(this); + this.licenseCodes = new Resource$Licensecodes(this); + this.licenses = new Resource$Licenses(this); + this.machineTypes = new Resource$Machinetypes(this); + this.networkEndpointGroups = new Resource$Networkendpointgroups(this); + this.networks = new Resource$Networks(this); + this.nodeGroups = new Resource$Nodegroups(this); + this.nodeTemplates = new Resource$Nodetemplates(this); + this.nodeTypes = new Resource$Nodetypes(this); + this.projects = new Resource$Projects(this); + this.regionAutoscalers = new Resource$Regionautoscalers(this); + this.regionBackendServices = new Resource$Regionbackendservices(this); + this.regionCommitments = new Resource$Regioncommitments(this); + this.regionDisks = new Resource$Regiondisks(this); + this.regionDiskTypes = new Resource$Regiondisktypes(this); + this.regionHealthChecks = new Resource$Regionhealthchecks(this); + this.regionInstanceGroupManagers = + new Resource$Regioninstancegroupmanagers(this); + this.regionInstanceGroups = new Resource$Regioninstancegroups(this); + this.regionOperations = new Resource$Regionoperations(this); + this.regions = new Resource$Regions(this); + this.regionTargetHttpProxies = new Resource$Regiontargethttpproxies(this); + this.regionUrlMaps = new Resource$Regionurlmaps(this); + this.routers = new Resource$Routers(this); + this.routes = new Resource$Routes(this); + this.securityPolicies = new Resource$Securitypolicies(this); + this.snapshots = new Resource$Snapshots(this); + this.sslCertificates = new Resource$Sslcertificates(this); + this.sslPolicies = new Resource$Sslpolicies(this); + this.subnetworks = new Resource$Subnetworks(this); + this.targetHttpProxies = new Resource$Targethttpproxies(this); + this.targetHttpsProxies = new Resource$Targethttpsproxies(this); + this.targetInstances = new Resource$Targetinstances(this); + this.targetPools = new Resource$Targetpools(this); + this.targetSslProxies = new Resource$Targetsslproxies(this); + this.targetTcpProxies = new Resource$Targettcpproxies(this); + this.targetVpnGateways = new Resource$Targetvpngateways(this); + this.urlMaps = new Resource$Urlmaps(this); + this.vpnTunnels = new Resource$Vpntunnels(this); + this.zoneOperations = new Resource$Zoneoperations(this); + this.zones = new Resource$Zones(this); + } + + getRoot() { + return this.root; + } + } + + /** + * A specification of the type and number of accelerator cards attached to the + * instance. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AcceleratorConfig { + /** + * The number of the guest accelerator cards exposed to this instance. + */ + acceleratorCount: number; + /** + * Full or partial URL of the accelerator type resource to attach to this + * instance. If you are creating an instance template, specify only the + * accelerator name. + */ + acceleratorType: string; + } + /** + * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) + * (== resource_for v1.acceleratorTypes ==) + */ + export interface Schema$AcceleratorType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this accelerator + * type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#acceleratorType + * for accelerator types. + */ + kind: string; + /** + * [Output Only] Maximum accelerator cards allowed per instance. + */ + maximumCardsPerInstance: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the accelerator type resides, + * such as us-central1-a. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + zone: string; + } + export interface Schema$AcceleratorTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of accelerator types. + */ + export interface Schema$AcceleratorTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorType resources. + */ + items: Schema$AcceleratorType[]; + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for + * lists of accelerator types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AcceleratorTypesScopedList { + /** + * [Output Only] A list of accelerator types contained in this scope. + */ + acceleratorTypes: Schema$AcceleratorType[]; + /** + * [Output Only] An informational warning that appears when the accelerator + * types list is empty. + */ + warning: any; + } + /** + * An access configuration attached to an instance's network interface. + * Only one access config per instance is supported. + */ + export interface Schema$AccessConfig { + /** + * [Output Only] Type of the resource. Always compute#accessConfig for + * access configs. + */ + kind: string; + /** + * The name of this access configuration. The default and recommended name + * is External NAT but you can use any arbitrary string you would like. For + * example, My external IP or Network Access. + */ + name: string; + /** + * An external IP address associated with this instance. Specify an unused + * static external IP address available to the project or leave this field + * undefined to use an IP from a shared ephemeral IP address pool. If you + * specify a static external IP address, it must live in the same region as + * the zone of the instance. + */ + natIP: string; + /** + * This signifies the networking tier used for configuring this access + * configuration and can only take the following values: PREMIUM, STANDARD. + * If an AccessConfig is specified without a valid external IP address, an + * ephemeral IP will be created with this networkTier. If an AccessConfig + * with a valid external IP address is specified, it must match that of the + * networkTier associated with the Address resource owning that IP. + */ + networkTier: string; + /** + * [Output Only] The public DNS domain name for the instance. + */ + publicDnsName: string; + /** + * The DNS domain name for the public PTR record. This field can only be set + * when the set_public_ptr field is enabled. + */ + publicPtrDomainName: string; + /** + * Specifies whether a public DNS ?A? record should be created for the + * external IP address of this access configuration. + */ + setPublicDns: boolean; + /** + * Specifies whether a public DNS ?PTR? record should be created to map the + * external IP address of the instance to a DNS domain name. + */ + setPublicPtr: boolean; + /** + * The type of configuration. The default and only option is ONE_TO_ONE_NAT. + */ + type: string; + } + /** + * A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== + * resource_for v1.globalAddresses ==) + */ + export interface Schema$Address { + /** + * The static IP address represented by this resource. + */ + address: string; + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If + * unspecified, defaults to EXTERNAL. + */ + addressType: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP Version that will be used by this address. Valid options are IPV4 + * or IPV6. This can only be specified for a global address. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this Address, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an Address. + */ + labelFingerprint: string; + /** + * Labels to apply to this Address resource. These can be later modified by + * the setLabels method. Each label key/value must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The URL of the network in which to reserve the address. This field can + * only be used with INTERNAL type with VPC_PEERING purpose. + */ + network: string; + /** + * This signifies the networking tier used for configuring this Address and + * can only take the following values: PREMIUM , STANDARD. If this field is + * not specified, it is assumed to be PREMIUM. + */ + networkTier: string; + /** + * The prefix length if the resource reprensents an IP range. + */ + prefixLength: number; + /** + * The purpose of resource, only used with INTERNAL type. + */ + purpose: string; + /** + * [Output Only] URL of the region where the regional address resides. This + * field is not applicable to global addresses. You must specify this field + * as part of the HTTP request URL. You cannot set this field in the request + * body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the address, which can be one of RESERVING, + * RESERVED, or IN_USE. An address that is RESERVING is currently in the + * process of being reserved. A RESERVED address is currently reserved and + * available to use. An IN_USE address is currently being used by another + * resource and is not available. + */ + status: string; + /** + * The URL of the subnetwork in which to reserve the address. If an IP + * address is specified, it must be within the subnetwork's IP range. + * This field can only be used with INTERNAL type with + * GCE_ENDPOINT/DNS_RESOLVER purposes. + */ + subnetwork: string; + /** + * [Output Only] The URLs of the resources that are using this address. + */ + users: string[]; + } + export interface Schema$AddressAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AddressesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for + * aggregated lists of addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AddressesScopedList { + /** + * [Output Only] A list of addresses contained in this scope. + */ + addresses: Schema$Address[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + /** + * Contains a list of addresses. + */ + export interface Schema$AddressList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Address resources. + */ + items: Schema$Address[]; + /** + * [Output Only] Type of resource. Always compute#addressList for lists of + * addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An alias IP range attached to an instance's network interface. + */ + export interface Schema$AliasIpRange { + /** + * The IP CIDR range represented by this alias IP range. This IP CIDR range + * must belong to the specified subnetwork and cannot contain IP addresses + * reserved by system or used by other network interfaces. This range may be + * a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR + * format string (e.g. 10.1.2.0/24). + */ + ipCidrRange: string; + /** + * Optional subnetwork secondary range name specifying the secondary range + * from which to allocate the IP CIDR range for this alias IP range. If left + * unspecified, the primary range of the subnetwork will be used. + */ + subnetworkRangeName: string; + } + /** + * An instance-attached disk resource. + */ + export interface Schema$AttachedDisk { + /** + * Specifies whether the disk will be auto-deleted when the instance is + * deleted (but not when the disk is detached from the instance). + */ + autoDelete: boolean; + /** + * Indicates that this is a boot disk. The virtual machine will use the + * first partition of the disk for its root filesystem. + */ + boot: boolean; + /** + * Specifies a unique device name of your choice that is reflected into the + * /dev/disk/by-id/google-* tree of a Linux operating system running within + * the instance. This name can be used to reference the device for mounting, + * resizing, and so on, from within the instance. If not specified, the + * server chooses a default device name to apply to this disk, in the form + * persistent-disks-x, where x is a number assigned by Google Compute + * Engine. This field is only applicable for persistent disks. + */ + deviceName: string; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If + * you are creating a new disk, this field encrypts the new disk using an + * encryption key that you provide. If you are attaching an existing disk + * that is already encrypted, this field decrypts the disk using the + * customer-supplied encryption key. If you encrypt a disk using a + * customer-supplied key, you must provide the same key again when you + * attempt to use this resource at a later time. For example, you must + * provide the key when you create a snapshot or an image from the disk or + * when you attach the disk to a virtual machine instance. If you do not + * provide an encryption key, then the disk will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the disk later. Instance templates do not store customer-supplied + * encryption keys, so you cannot use your own keys to encrypt disks in a + * managed instance group. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * The size of the disk in base-2 GB. This supersedes disk_size_gb in + * InitializeParams. + */ + diskSizeGb: string; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for + * the boot disk. If you have many disks attached to an instance, each disk + * would have a unique index number. + */ + index: number; + /** + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or + * the other, but not both. + */ + initializeParams: Schema$AttachedDiskInitializeParams; + /** + * Specifies the disk interface to use for attaching this disk, which is + * either SCSI or NVME. The default is SCSI. Persistent disks must always + * use SCSI and the request will fail if you attempt to attach a persistent + * disk in any other format than SCSI. Local SSDs can use either NVME or + * SCSI. For performance characteristics of SCSI over NVMe, see Local SSD + * performance. + */ + interface: string; + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for + * attached disks. + */ + kind: string; + /** + * [Output Only] Any valid publicly visible licenses. + */ + licenses: string[]; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If + * not specified, the default is to attach the disk in READ_WRITE mode. + */ + mode: string; + /** + * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this + * field is set to PRESERVED iff the LocalSSD data has been saved to a + * persistent location by customer request. (see the discard_local_ssd + * option on Stop/Suspend). Read-only in the api. + */ + savedState: string; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. When creating a new instance, one of + * initializeParams.sourceImage or disks.source is required except for local + * SSD. If desired, you can also attach existing non-root persistent disks + * using this property. This field is only applicable for persistent disks. + * Note that for InstanceTemplate, specify the disk name, not the URL for + * the disk. + */ + source: string; + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not + * specified, the default is PERSISTENT. + */ + type: string; } - - /** - * compute.vpnTunnels.get - * @desc Returns the specified VpnTunnel resource. Get a list of available VPN - * tunnels by making a list() request. - * @alias compute.vpnTunnels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or the + * other, but not both. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AttachedDiskInitializeParams { + /** + * Specifies the disk name. If not specified, the default is to use the name + * of the instance. + */ + diskName: string; + /** + * Specifies the size of the disk in base-2 GB. + */ + diskSizeGb: string; + /** + * [Deprecated] Storage type of the disk. + */ + diskStorageType: string; + /** + * Specifies the disk type to use to create the instance. If not specified, + * the default is pd-standard, specified using the full URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + * Other values include pd-ssd and local-ssd. If you define this field, you + * can provide either the full or partial URL. For example, the following + * are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + * - projects/project/zones/zone/diskTypes/diskType - + * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is + * the name of the disk type, not URL. + */ + diskType: string; + /** + * Labels to apply to this disk. These can be later modified by the + * disks.setLabels method. This field is only applicable for persistent + * disks. + */ + labels: any; + /** + * The source image to create this disk. When creating a new instance, one + * of initializeParams.sourceImage or disks.source is required except for + * local SSD. To create a disk with one of the public operating system + * images, specify the image by its family name. For example, specify + * family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family If the source + * image is deleted later, this field will not be set. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. Instance + * templates do not store customer-supplied encryption keys, so you cannot + * create disks for instances in a managed instance group if the source + * images are encrypted with your own keys. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + } + /** + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { "log_type": + * "ADMIN_READ", } ] }, { "service": + * "fooservice.googleapis.com" "audit_log_configs": [ { + * "log_type": "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } ] } For fooservice, this policy + * enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts + * foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE + * logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + exemptedMembers: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } + /** + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { "log_type": + * "DATA_WRITE", } ] } This enables 'DATA_READ' and + * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ + * logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of [Binding.members][]. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } + /** + * Authorization-related information used by Cloud Audit Logging. + */ + export interface Schema$AuthorizationLoggingOptions { + /** + * The type of the permission that was checked. + */ + permissionType: string; + } + /** + * Represents an Autoscaler resource. Autoscalers allow you to automatically + * scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling + * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for + * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== + * resource_for v1.regionAutoscalers ==) + */ + export interface Schema$Autoscaler { + /** + * The configuration parameters for the autoscaling algorithm. You can + * define one or more of the policies for an autoscaler: cpuUtilization, + * customMetricUtilizations, and loadBalancingUtilization. If none of these + * are specified, the default will be to autoscale based on cpuUtilization + * to 0.6 or 60%. + */ + autoscalingPolicy: Schema$AutoscalingPolicy; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#autoscaler for + * autoscalers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Target recommended MIG size (number of instances) computed + * by autoscaler. Autoscaler calculates recommended MIG size even when + * autoscaling policy mode is different from ON. This field is empty when + * autoscaler is not connected to the existing managed instance group or + * autoscaler did not generate its prediction. + */ + recommendedSize: number; + /** + * [Output Only] URL of the region where the instance group resides (for + * autoscalers living in regional scope). + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the autoscaler configuration. + */ + status: string; + /** + * [Output Only] Human-readable details about the current state of the + * autoscaler. Read the documentation for Commonly returned status messages + * for examples of status messages you might encounter. + */ + statusDetails: Schema$AutoscalerStatusDetails[]; + /** + * URL of the managed instance group that this autoscaler will scale. + */ + target: string; + /** + * [Output Only] URL of the zone where the instance group resides (for + * autoscalers living in zonal scope). + */ + zone: string; + } + export interface Schema$AutoscalerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AutoscalersScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList + * for aggregated lists of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Autoscaler resources. + */ + export interface Schema$AutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists + * of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AutoscalersScopedList { + /** + * [Output Only] A list of autoscalers contained in this scope. + */ + autoscalers: Schema$Autoscaler[]; + /** + * [Output Only] Informational warning which replaces the list of + * autoscalers when the list is empty. + */ + warning: any; + } + export interface Schema$AutoscalerStatusDetails { + /** + * The status message. + */ + message: string; + /** + * The type of error returned. + */ + type: string; + } + /** + * Cloud Autoscaler policy. + */ + export interface Schema$AutoscalingPolicy { + /** + * The number of seconds that the autoscaler should wait before it starts + * collecting information from a new instance. This prevents the autoscaler + * from collecting information when the instance is initializing, during + * which the collected usage would not be reliable. The default time + * autoscaler waits is 60 seconds. Virtual machine initialization times + * might vary because of numerous factors. We recommend that you test how + * long an instance may take to initialize. To do this, create an instance + * and time the startup process. + */ + coolDownPeriodSec: number; + /** + * Defines the CPU utilization policy that allows the autoscaler to scale + * based on the average CPU utilization of a managed instance group. + */ + cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; + /** + * Configuration parameters of autoscaling based on a custom metric. + */ + customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; + /** + * Configuration parameters of autoscaling based on load balancer. + */ + loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; + /** + * The maximum number of instances that the autoscaler can scale up to. This + * is required when creating or updating an autoscaler. The maximum number + * of replicas should not be lower than minimal number of replicas. + */ + maxNumReplicas: number; + /** + * The minimum number of replicas that the autoscaler can scale down to. + * This cannot be less than 0. If not provided, autoscaler will choose a + * default value depending on maximum number of instances allowed. + */ + minNumReplicas: number; + /** + * Defines operating mode for this policy. + */ + mode: string; + /** + * Configuration parameters of autoscaling based on queuing system. + */ + queueBasedScaling: Schema$AutoscalingPolicyQueueBasedScaling; + } + /** + * CPU utilization policy. + */ + export interface Schema$AutoscalingPolicyCpuUtilization { + /** + * The target CPU utilization that the autoscaler should maintain. Must be a + * float value in the range (0, 1]. If not specified, the default is 0.6. If + * the CPU level is below the target utilization, the autoscaler scales down + * the number of instances until it reaches the minimum number of instances + * you specified or until the average CPU of your instances reaches the + * target utilization. If the average CPU is above the target utilization, + * the autoscaler scales up until it reaches the maximum number of instances + * you specified or until the average utilization reaches the target + * utilization. + */ + utilizationTarget: number; + } + /** + * Custom utilization metric policy. + */ + export interface Schema$AutoscalingPolicyCustomMetricUtilization { + /** + * A filter string, compatible with a Stackdriver Monitoring filter string + * for TimeSeries.list API call. This filter is used to select a specific + * TimeSeries for the purpose of autoscaling and to determine whether the + * metric is exporting per-instance or per-group data. For the filter to be + * valid for autoscaling purposes, the following rules apply: - You can + * only use the AND operator for joining selectors. - You can only use + * direct equality comparison operator (=) without any functions for each + * selector. - You can specify the metric in both the filter string and in + * the metric field. However, if specified in both places, the metric must + * be identical. - The monitored resource type determines what kind of + * values are expected for the metric. If it is a gce_instance, the + * autoscaler expects the metric to include a separate TimeSeries for each + * instance in a group. In such a case, you cannot filter on resource + * labels. If the resource type is any other value, the autoscaler expects + * this metric to contain values that apply to the entire autoscaled + * instance group and resource label filtering can be performed to point + * autoscaler at the correct TimeSeries to scale upon. This is called a + * per-group metric for the purpose of autoscaling. If not specified, the + * type defaults to gce_instance. You should provide a filter that is + * selective enough to pick just one TimeSeries for the autoscaled group or + * for each of the instances (if you are using gce_instance resource type). + * If multiple TimeSeries are returned upon the query execution, the + * autoscaler will sum their respective values to obtain its scaling value. + */ + filter: string; + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric + * cannot have negative values. The metric must have a value type of INT64 + * or DOUBLE. + */ + metric: string; + /** + * If scaling is based on a per-group metric value that represents the total + * amount of work to be done or resource usage, set this value to an amount + * assigned for a single instance of the scaled group. Autoscaler will keep + * the number of instances proportional to the value of this metric, the + * metric itself should not change value due to group resizing. A good + * metric to use with the target is for example + * pubsub.googleapis.com/subscription/num_undelivered_messages or a custom + * metric exporting the total number of requests coming to your instances. + * A bad example would be a metric exporting an average or median latency, + * since this value can't include a chunk assignable to a single + * instance, it could be better used with utilization_target instead. + */ + singleInstanceAssignment: number; + /** + * The target value of the metric that autoscaler should maintain. This must + * be a positive value. A utilization metric scales number of virtual + * machines handling requests to increase or decrease proportionally to the + * metric. For example, a good metric to use as a utilization_target is + * compute.googleapis.com/instance/network/received_bytes_count. The + * autoscaler will work to keep this value constant for each of the + * instances. + */ + utilizationTarget: number; + /** + * Defines how target utilization value is expressed for a Stackdriver + * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * If not specified, the default is GAUGE. + */ + utilizationTargetType: string; + } + /** + * Configuration parameters of autoscaling based on load balancing. + */ + export interface Schema$AutoscalingPolicyLoadBalancingUtilization { + /** + * Fraction of backend capacity utilization (set in HTTP(s) load balancing + * configuration) that autoscaler should maintain. Must be a positive float + * value. If not defined, the default is 0.8. + */ + utilizationTarget: number; } - - /** - * compute.vpnTunnels.insert - * @desc Creates a VpnTunnel resource in the specified project and region - * using the data included in the request. - * @alias compute.vpnTunnels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().VpnTunnel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration parameters of autoscaling based on queuing system. */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AutoscalingPolicyQueueBasedScaling { + /** + * Scaling based on the average number of tasks in the queue per each active + * instance. The autoscaler keeps the average number of tasks per instance + * below this number, based on data collected in the last couple of minutes. + * The autoscaler will also take into account incoming tasks when + * calculating when to scale. + */ + acceptableBacklogPerInstance: number; + /** + * Configuration for Cloud Pub/Sub subscription queue. + */ + cloudPubSub: Schema$AutoscalingPolicyQueueBasedScalingCloudPubSub; + /** + * The scaling algorithm will also calculate throughput estimates on its + * own; if you explicitly provide this value, the autoscaler will take into + * account your value as well as automatic estimates when deciding how to + * scale. + */ + singleWorkerThroughputPerSec: number; + } + /** + * Configuration parameters for scaling based on Cloud Pub/Sub subscription + * queue. + */ + export interface Schema$AutoscalingPolicyQueueBasedScalingCloudPubSub { + /** + * Cloud Pub/Sub subscription used for scaling. Provide the partial URL + * (starting with projects/) or just the subscription name. The subscription + * must be assigned to the topic specified in topicName and must be in a + * pull configuration. The subscription must belong to the same project as + * the Autoscaler. + */ + subscription: string; + /** + * Cloud Pub/Sub topic used for scaling. Provide the partial URL or partial + * URL (starting with projects/) or just the topic name. The topic must + * belong to the same project as the Autoscaler resource. + */ + topic: string; + } + /** + * Message containing information of one individual backend. + */ + export interface Schema$Backend { + /** + * Specifies the balancing mode for this backend. For global HTTP(S) or + * TCP/SSL load balancing, the default is UTILIZATION. Valid values are + * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For + * Internal Load Balancing, the default and only supported mode is + * CONNECTION. + */ + balancingMode: string; + /** + * A multiplier applied to the group's maximum servicing capacity (based + * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the + * group will serve up to 100% of its configured capacity (depending on + * balancingMode). A setting of 0 means the group is completely drained, + * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This + * cannot be used for internal load balancing. + */ + capacityScaler: number; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * This field designates whether this is a failover backend. More than one + * failover backend can be configured for a given BackendService. + */ + failover: boolean; + /** + * The fully-qualified URL of a Instance Group resource. This instance group + * defines the list of instances that serve traffic. Member virtual machine + * instances from each instance group must live in the same zone as the + * instance group itself. No two backends in a backend service are allowed + * to use same Instance Group resource. Note that you must specify an + * Instance Group resource using the fully-qualified URL, rather than a + * partial URL. When the BackendService has load balancing scheme INTERNAL, + * the instance group must be within the same region as the BackendService. + */ + group: string; + /** + * The max number of simultaneous connections for the group. Can be used + * with either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnections: number; + /** + * The max number of simultaneous connections that a single backend network + * endpoint can handle. This is used to calculate the capacity of the group. + * Can be used in either CONNECTION or UTILIZATION balancing modes. For + * CONNECTION mode, either maxConnections or maxConnectionsPerEndpoint must + * be set. This cannot be used for internal load balancing. + */ + maxConnectionsPerEndpoint: number; + /** + * The max number of simultaneous connections that a single backend instance + * can handle. This is used to calculate the capacity of the group. Can be + * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnectionsPerInstance: number; + /** + * The max requests per second (RPS) of the group. Can be used with either + * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE + * mode, either maxRate or maxRatePerInstance must be set. This cannot be + * used for internal load balancing. + */ + maxRate: number; + /** + * The max requests per second (RPS) that a single backend network endpoint + * can handle. This is used to calculate the capacity of the group. Can be + * used in either balancing mode. For RATE mode, either maxRate or + * maxRatePerEndpoint must be set. This cannot be used for internal load + * balancing. + */ + maxRatePerEndpoint: number; + /** + * The max requests per second (RPS) that a single backend instance can + * handle. This is used to calculate the capacity of the group. Can be used + * in either balancing mode. For RATE mode, either maxRate or + * maxRatePerInstance must be set. This cannot be used for internal load + * balancing. + */ + maxRatePerInstance: number; + /** + * Used when balancingMode is UTILIZATION. This ratio defines the CPU + * utilization target for the group. The default is 0.8. Valid range is + * [0.0, 1.0]. This cannot be used for internal load balancing. + */ + maxUtilization: number; + } + /** + * A BackendBucket resource. This resource defines a Cloud Storage bucket. + */ + export interface Schema$BackendBucket { + /** + * Cloud Storage bucket name. + */ + bucketName: string; + /** + * Cloud CDN Coniguration for this BackendBucket. + */ + cdnPolicy: Schema$BackendBucketCdnPolicy; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendBucket. + */ + enableCdn: boolean; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Message containing Cloud CDN configuration for a backend bucket. + */ + export interface Schema$BackendBucketCdnPolicy { + /** + * Number of seconds up to which the response to a signed URL request will + * be cached in the CDN. After this time period, the Signed URL will be + * revalidated before being served. Defaults to 1hr (3600s). If this field + * is set, Cloud CDN will internally act as though all responses from this + * bucket had a ?Cache-Control: public, max-age=[TTL]? header, regardless of + * any existing Cache-Control header. The actual headers served in responses + * will not be altered. + */ + signedUrlCacheMaxAgeSec: string; + /** + * [Output Only] Names of the keys currently configured for Cloud CDN Signed + * URL on this backend bucket. + */ + signedUrlKeyNames: string[]; + } + /** + * Contains a list of BackendBucket resources. + */ + export interface Schema$BackendBucketList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendBucket resources. + */ + items: Schema$BackendBucket[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A BackendService resource. This resource defines a group of backend virtual + * machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) + */ + export interface Schema$BackendService { + /** + * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. + * If set to 0, the cookie is non-persistent and lasts only until the end of + * the browser session (or equivalent). The maximum allowed value for TTL is + * one day. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + affinityCookieTtlSec: number; + /** + * Directs request to an App Engine app. cloudFunctionBackend and backends[] + * must be empty if this is set. + */ + appEngineBackend: Schema$BackendServiceAppEngineBackend; + /** + * The list of backends that serve this BackendService. + */ + backends: Schema$Backend[]; + /** + * Cloud CDN configuration for this BackendService. + */ + cdnPolicy: Schema$BackendServiceCdnPolicy; + /** + * Directs request to a cloud function. appEngineBackend and backends[] must + * be empty if this is set. + */ + cloudFunctionBackend: Schema$BackendServiceCloudFunctionBackend; + connectionDraining: Schema$ConnectionDraining; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Headers that the HTTP/S load balancer should add to proxied requests. + */ + customRequestHeaders: string[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendService. When the load + * balancing scheme is INTERNAL, this field is not used. + */ + enableCDN: boolean; + failoverPolicy: Schema$BackendServiceFailoverPolicy; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a BackendService. An up-to-date fingerprint must + * be provided in order to update the BackendService. + */ + fingerprint: string; + /** + * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for + * health checking this BackendService. Currently at most one health check + * can be specified, and a health check is required for Compute Engine + * backend services. A health check must not be specified for App Engine + * backend and Cloud Function backend. For internal load balancing, a URL + * to a HealthCheck resource must be specified instead. + */ + healthChecks: string[]; + iap: Schema$BackendServiceIAP; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#backendService for backend + * services. + */ + kind: string; + /** + * Indicates whether the backend service will be used with internal or + * external load balancing. A backend service created for one type of load + * balancing cannot be used with the other. Possible values are INTERNAL and + * EXTERNAL. + */ + loadBalancingScheme: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. + * The default value is 80. This cannot be used for internal load + * balancing. + */ + port: number; + /** + * Name of backend port. The same name should appear in the instance groups + * referenced by this service. Required when the load balancing scheme is + * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + portName: string; + /** + * The protocol this BackendService uses to communicate with backends. + * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For + * internal load balancing, the possible values are TCP and UDP, and the + * default is TCP. + */ + protocol: string; + /** + * [Output Only] URL of the region where the regional backend service + * resides. This field is not applicable to global backend services. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] The resource URL for the security policy associated with + * this backend service. + */ + securityPolicy: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Type of session affinity to use. The default is NONE. When the load + * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or + * GENERATED_COOKIE. When the load balancing scheme is INTERNAL, can be + * NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the + * protocol is UDP, this field is not used. + */ + sessionAffinity: string; + /** + * How many seconds to wait for the backend before considering it a failed + * request. Default is 30 seconds. + */ + timeoutSec: number; + } + /** + * Contains a list of BackendServicesScopedList. + */ + export interface Schema$BackendServiceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendServicesScopedList resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Configuration of a App Engine backend. + */ + export interface Schema$BackendServiceAppEngineBackend { + /** + * Optional. App Engine app service name. + */ + appEngineService: string; + /** + * Required. Project ID of the project hosting the app. This is the project + * ID of this project. Reference to another project is not allowed. + */ + targetProject: string; + /** + * Optional. Version of App Engine app service. When empty, App Engine will + * do its normal traffic split. + */ + version: string; + } + /** + * Message containing Cloud CDN configuration for a backend service. + */ + export interface Schema$BackendServiceCdnPolicy { + /** + * The CacheKeyPolicy for this CdnPolicy. + */ + cacheKeyPolicy: Schema$CacheKeyPolicy; + /** + * Number of seconds up to which the response to a signed URL request will + * be cached in the CDN. After this time period, the Signed URL will be + * revalidated before being served. Defaults to 1hr (3600s). If this field + * is set, Cloud CDN will internally act as though all responses from this + * backend had a ?Cache-Control: public, max-age=[TTL]? header, regardless + * of any existing Cache-Control header. The actual headers served in + * responses will not be altered. + */ + signedUrlCacheMaxAgeSec: string; + /** + * [Output Only] Names of the keys currently configured for Cloud CDN Signed + * URL on this backend service. + */ + signedUrlKeyNames: string[]; + } + /** + * Configuration of a Cloud Function backend. + */ + export interface Schema$BackendServiceCloudFunctionBackend { + /** + * Required. A cloud function name. Special value ?*? represents all cloud + * functions in the project. + */ + functionName: string; + /** + * Required. Project ID of the project hosting the cloud function. + */ + targetProject: string; + } + export interface Schema$BackendServiceFailoverPolicy { + /** + * On failover or failback, this field indicates whether connection drain + * will be honored. Setting this to true has the following effect: + * connections to the old active pool are not drained. Connections to the + * new active pool use the timeout of 10 min (currently fixed). Setting to + * false has the following effect: both old and new connections will have a + * drain timeout of 10 min. This can be set to true only if the protocol is + * TCP. The default is false. + */ + disableConnectionDrainOnFailover: boolean; + /** + * This option is used only when no healthy VMs are detected in the primary + * and backup instance groups. When set to true, traffic is dropped. When + * set to false, new connections are sent across all VMs in the primary + * group. The default is false. + */ + dropTrafficIfUnhealthy: boolean; + /** + * The value of the field must be in [0, 1]. If the ratio of the healthy VMs + * in the primary backend is at or below this number, traffic arriving at + * the load-balanced IP will be directed to the failover backend. In case + * where 'failoverRatio' is not set or all the VMs in the backup + * backend are unhealthy, the traffic will be directed back to the primary + * backend in the "force" mode, where traffic will be spread to + * the healthy VMs with the best effort, or to all VMs when no VM is + * healthy. This field is only used with l4 load balancing. + */ + failoverRatio: number; + } + export interface Schema$BackendServiceGroupHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth + * for the health of backend services. + */ + kind: string; + } + /** + * Identity-Aware Proxy + */ + export interface Schema$BackendServiceIAP { + enabled: boolean; + oauth2ClientId: string; + oauth2ClientSecret: string; + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + */ + oauth2ClientSecretSha256: string; + } + /** + * Contains a list of BackendService resources. + */ + export interface Schema$BackendServiceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendService resources. + */ + items: Schema$BackendService[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceList for + * lists of backend services. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$BackendServiceReference { backendService: string; } + export interface Schema$BackendServicesScopedList { + /** + * A list of BackendServices contained in this scope. + */ + backendServices: Schema$BackendService[]; + /** + * Informational warning which replaces the list of backend services when + * the list is empty. + */ + warning: any; + } + /** + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied + * condition will not allow user access via current binding. Different + * bindings, including their conditions, are examined independently. This + * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. + */ + condition: Schema$Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or without + * a Google account. * `allAuthenticatedUsers`: A special identifier that + * represents anyone who is authenticated with a Google account or a service + * account. * `user:{emailid}`: An email address that represents a specific + * Google account. For example, `alice@gmail.com` or `joe@example.com`. * + * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. + */ + role: string; + } + export interface Schema$CacheInvalidationRule { + /** + * If set, this invalidation rule will only apply to requests with a Host + * header matching host. + */ + host: string; + path: string; + } + /** + * Message containing what to include in the cache key for a request for Cloud + * CDN. + */ + export interface Schema$CacheKeyPolicy { + /** + * If true, requests to different hosts will be cached separately. + */ + includeHost: boolean; + /** + * If true, http and https requests will be cached separately. + */ + includeProtocol: boolean; + /** + * If true, include query string parameters in the cache key according to + * query_string_whitelist and query_string_blacklist. If neither is set, the + * entire query string will be included. If false, the query string will be + * excluded from the cache key entirely. + */ + includeQueryString: boolean; + /** + * Names of query string parameters to exclude in cache keys. All other + * parameters will be included. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringBlacklist: string[]; + /** + * Names of query string parameters to include in cache keys. All other + * parameters will be excluded. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringWhitelist: string[]; + } + /** + * Represents a Commitment resource. Creating a Commitment resource means that + * you are purchasing a committed use contract with an explicit start and end + * time. You can create commitments based on vCPUs and memory usage and + * receive discounted rates. For full details, read Signing Up for Committed + * Use Discounts. Committed use discounts are subject to Google Cloud + * Platform's Service Specific Terms. By purchasing a committed use + * discount, you agree to these terms. Committed use discounts will not renew, + * so you must purchase a new commitment to continue receiving discounts. (== + * resource_for beta.commitments ==) (== resource_for v1.commitments ==) + */ + export interface Schema$Commitment { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Commitment end time in RFC3339 text format. + */ + endTimestamp: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#commitment for + * commitments. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The plan for this commitment, which determines duration and discount + * rate. The currently supported plans are TWELVE_MONTH (1 year), and + * THIRTY_SIX_MONTH (3 years). + */ + plan: string; + /** + * [Output Only] URL of the region where this commitment may be used. + */ + region: string; + /** + * A list of commitment amounts for particular resources. Note that VCPU and + * MEMORY resource commitments must occur together. + */ + resources: Schema$ResourceCommitment[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Commitment start time in RFC3339 text format. + */ + startTimestamp: string; + /** + * [Output Only] Status of the commitment with regards to eventual + * expiration (each commitment has an end date defined). One of the + * following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + /** + * The type of commitment, which affects the discount rate and the eligible + * resources. Type MEMORY_OPTIMIZED_VM specifies a commitment that will only + * apply to memory optimized VMs. Type NORMAL specifies a commitment that + * applies to all other resources. + */ + type: string; + } + export interface Schema$CommitmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of CommitmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList + * for aggregated lists of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Commitment resources. + */ + export interface Schema$CommitmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Commitment resources. + */ + items: Schema$Commitment[]; + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists + * of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$CommitmentsScopedList { + /** + * [Output Only] A list of commitments contained in this scope. + */ + commitments: Schema$Commitment[]; + /** + * [Output Only] Informational warning which replaces the list of + * commitments when the list is empty. + */ + warning: any; + } + /** + * A condition to be met. + */ + export interface Schema$Condition { + /** + * Trusted attributes supplied by the IAM system. + */ + iam: string; + /** + * An operator to apply the subject with. + */ + op: string; + /** + * Trusted attributes discharged by the service. + */ + svc: string; + /** + * Trusted attributes supplied by any service that owns resources and uses + * the IAM system for access control. + */ + sys: string; + /** + * DEPRECATED. Use 'values' instead. + */ + value: string; + /** + * The objects of the condition. This is mutually exclusive with + * 'value'. + */ + values: string[]; + } + /** + * Message containing connection draining configuration. + */ + export interface Schema$ConnectionDraining { + /** + * Time for which instance will be drained (not accept new connections, but + * still work to finish started). + */ + drainingTimeoutSec: number; + } + /** + * Represents a customer-supplied encryption key + */ + export interface Schema$CustomerEncryptionKey { + /** + * The name of the encryption key that is stored in Google Cloud KMS. + */ + kmsKeyName: string; + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 + * base64 to either encrypt or decrypt this resource. + */ + rawKey: string; + /** + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. The key must meet the following requirements before you can + * provide it to Compute Engine: - The key is wrapped using a RSA public + * key certificate provided by Google. - After being wrapped, the key must + * be encoded in RFC 4648 base64 encoding. Gets the RSA public key + * certificate provided by Google at: + * https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + */ + rsaEncryptedKey: string; + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the + * customer-supplied encryption key that protects this resource. + */ + sha256: string; + } + export interface Schema$CustomerEncryptionKeyProtectedDisk { + /** + * Decrypts data associated with the disk with a customer-supplied + * encryption key. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. This field is only applicable for persistent disks. + */ + source: string; + } + /** + * Deprecation status for a public resource. + */ + export interface Schema$DeprecationStatus { + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DELETED. This is only informational and + * the status will not change unless the client explicitly changes it. + */ + deleted: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DEPRECATED. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + deprecated: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to OBSOLETE. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + obsolete: string; + /** + * The URL of the suggested replacement for a deprecated resource. The + * suggested replacement resource must be the same kind of resource as the + * deprecated resource. + */ + replacement: string; + /** + * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, + * or DELETED. Operations which create a new resource using a DEPRECATED + * resource will return successfully, but with a warning indicating the + * deprecated resource and recommending its replacement. Operations which + * use OBSOLETE or DELETED resources will be rejected and result in an + * error. + */ + state: string; + } + /** + * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) + */ + export interface Schema$Disk { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Encrypts the disk using a customer-supplied encryption key. After you + * encrypt a disk with a customer-supplied key, you must provide the same + * key if you use the disk later (e.g. to create a disk snapshot or an + * image, or to attach the disk to a virtual machine). Customer-supplied + * encryption keys do not protect access to metadata of the disk. If you do + * not provide an encryption key when creating the disk, then the disk will + * be encrypted using an automatically generated key and you do not need to + * provide a key to use the disk later. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this disk, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a disk. + */ + labelFingerprint: string; + /** + * Labels to apply to this disk. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + */ + lastAttachTimestamp: string; + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + */ + lastDetachTimestamp: string; + /** + * Integer license codes indicating which licenses are attached to this + * disk. + */ + licenseCodes: string[]; + /** + * Any applicable publicly visible licenses. + */ + licenses: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Internal use only. + */ + options: string; + /** + * Physical block size of the persistent disk, in bytes. If not present in a + * request, a default value is used. Initially only 4096 is supported, but + * other powers of two may be added. If an unsupported value is requested, + * the error message will list the supported values, but even a supported + * value may be allowed for only some projects. + */ + physicalBlockSizeBytes: string; + /** + * [Output Only] URL of the region where the disk resides. Only applicable + * for regional resources. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + region: string; + /** + * URLs of the zones where the disk should be replicated to. Only applicable + * for regional resources. + */ + replicaZones: string[]; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * Size of the persistent disk, specified in GB. You can specify this field + * when creating a persistent disk using the sourceImage or sourceSnapshot + * parameter, or specify it alone to create an empty persistent disk. If + * you specify this field along with sourceImage or sourceSnapshot, the + * value of sizeGb must not be less than the size of the sourceImage or the + * size of the snapshot. Acceptable values are 1 to 65536, inclusive. + */ + sizeGb: string; + /** + * The source image used to create this disk. If the source image is + * deleted, this field will not be set. To create a disk with one of the + * public operating system images, specify the image by its family name. For + * example, specify family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this disk. This + * value identifies the exact image that was used to create this persistent + * disk. For example, if you created the persistent disk from an image that + * was later deleted and recreated under the same name, the source image ID + * would identify the exact version of the image that was used. + */ + sourceImageId: string; + /** + * The source snapshot used to create this disk. You can provide this as a + * partial or full URL to the resource. For example, the following are valid + * values: - + * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. + * This value identifies the exact snapshot that was used to create this + * persistent disk. For example, if you created the persistent disk from a + * snapshot that was later deleted and recreated under the same name, the + * source snapshot ID would identify the exact version of the snapshot that + * was used. + */ + sourceSnapshotId: string; + /** + * [Output Only] The status of disk creation. + */ + status: string; + /** + * [Deprecated] Storage type of the persistent disk. + */ + storageType: string; + /** + * URL of the disk type resource describing which disk type to use to create + * the disk. Provide this when creating the disk. For example: + * project/zones/zone/diskTypes/pd-standard or pd-ssd + */ + type: string; + /** + * [Output Only] Links to the users of the disk (attached instances) in + * form: project/zones/zone/instances/instance + */ + users: string[]; + /** + * [Output Only] URL of the zone where the disk resides. You must specify + * this field as part of the HTTP request URL. It is not settable as a field + * in the request body. + */ + zone: string; + } + export interface Schema$DiskAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DisksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for + * aggregated lists of persistent disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A specification of the desired way to instantiate a disk in the instance + * template when its created from a source instance. + */ + export interface Schema$DiskInstantiationConfig { + /** + * Specifies whether the disk will be auto-deleted when the instance is + * deleted (but not when the disk is detached from the instance). + */ + autoDelete: boolean; + /** + * The custom source image to be used to restore this disk when + * instantiating this instance template. + */ + customImage: string; + /** + * Specifies the device name of the disk to which the configurations apply + * to. + */ + deviceName: string; + /** + * Specifies whether to include the disk and what image to use. Possible + * values are: - source-image: to use the same image that was used to + * create the source instance's corresponding disk. Applicable to the + * boot disk and additional read-write disks. - source-image-family: to use + * the same image family that was used to create the source instance's + * corresponding disk. Applicable to the boot disk and additional read-write + * disks. - custom-image: to use a user-provided image url for disk + * creation. Applicable to the boot disk and additional read-write disks. - + * attach-read-only: to attach a read-only disk. Applicable to read-only + * disks. - do-not-include: to exclude a disk from the template. Applicable + * to additional read-write disks, local SSDs, and read-only disks. + */ + instantiateFrom: string; } - - /** - * compute.vpnTunnels.list - * @desc Retrieves a list of VpnTunnel resources contained in the specified - * project and region. - * @alias compute.vpnTunnels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of Disk resources. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.setLabels - * @desc Sets the labels on a VpnTunnel. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.vpnTunnels.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$DiskList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Disk resources. + */ + items: Schema$Disk[]; + /** + * [Output Only] Type of resource. Always compute#diskList for lists of + * disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskMoveRequest { + /** + * The URL of the destination zone to move the disk. This can be a full or + * partial URL. For example, the following are all valid URLs to a zone: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target disk to move. This can be a full or partial URL. + * For example, the following are all valid URLs to a disk: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + targetDisk: string; + } + export interface Schema$DisksResizeRequest { + /** + * The new size of the persistent disk, which is specified in GB. + */ + sizeGb: string; + } + export interface Schema$DisksScopedList { + /** + * [Output Only] A list of disks contained in this scope. + */ + disks: Schema$Disk[]; + /** + * [Output Only] Informational warning which replaces the list of disks when + * the list is empty. + */ + warning: any; + } + /** + * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for + * v1.diskTypes ==) + */ + export interface Schema$DiskType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Server-defined default disk size in GB. + */ + defaultDiskSizeGb: string; + /** + * [Output Only] The deprecation status associated with this disk type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional description of this resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#diskType for disk + * types. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] An optional textual description of the valid disk size, + * such as "10GB-10TB". + */ + validDiskSize: string; + /** + * [Output Only] URL of the zone where the disk type resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$DiskTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of disk types. + */ + export interface Schema$DiskTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskType resources. + */ + items: Schema$DiskType[]; + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskTypesScopedList { + /** + * [Output Only] A list of disk types contained in this scope. + */ + diskTypes: Schema$DiskType[]; + /** + * [Output Only] Informational warning which replaces the list of disk types + * when the list is empty. + */ + warning: any; + } + export interface Schema$DistributionPolicy { + zones: Schema$DistributionPolicyZoneConfiguration[]; + } + export interface Schema$DistributionPolicyZoneConfiguration { + /** + * URL of the zone where managed instance group is spawning instances (for + * regional resources). Zone has to belong to the region where managed + * instance group is located. + */ + zone: string; + } + /** + * Represents an expression text. Example: title: "User account + * presence" description: "Determines whether the request has a user + * account" expression: "size(request.user) > 0" + */ + export interface Schema$Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description: string; + /** + * Textual representation of an expression in Common Expression Language + * syntax. The application context of the containing message determines + * which well-known feature set of CEL is supported. + */ + expression: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location: string; + /** + * An optional title for the expression, i.e. a short string describing its + * purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title: string; + } + /** + * Represents a Firewall resource. + */ + export interface Schema$Firewall { + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a permitted connection. + */ + allowed: any[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The list of DENY rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a denied connection. + */ + denied: any[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If destination ranges are specified, the firewall will apply only to + * traffic that has destination IP address in these ranges. These ranges + * must be expressed in CIDR format. Only IPv4 is supported. + */ + destinationRanges: string[]; + /** + * Direction of traffic to which this firewall applies; default is INGRESS. + * Note: For INGRESS traffic, it is NOT supported to specify + * destinationRanges; For EGRESS traffic, it is NOT supported to specify + * sourceRanges OR sourceTags. + */ + direction: string; + /** + * Denotes whether the firewall rule is disabled, i.e not applied to the + * network it is associated with. When set to true, the firewall rule is not + * enforced and the network behaves as if it did not exist. If this is + * unspecified, the firewall rule will be enabled. + */ + disabled: boolean; + /** + * This field denotes whether to enable logging for a particular firewall + * rule. If logging is enabled, logs will be exported to the configured + * export destination for all firewall logs in the network. Logs may be + * exported to BigQuery or Pub/Sub. + */ + enableLogging: boolean; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall + * rules. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network resource for this firewall rule. If not specified when + * creating a firewall rule, the default network is used: + * global/networks/default If you choose to specify this property, you can + * specify the network as a full or partial URL. For example, the following + * are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + * - projects/myproject/global/networks/my-network - + * global/networks/default + */ + network: string; + /** + * Priority for this rule. This is an integer between 0 and 65535, both + * inclusive. When not specified, the value assumed is 1000. Relative + * priorities determine precedence of conflicting rules. Lower value of + * priority implies higher precedence (eg, a rule with priority 0 has higher + * precedence than a rule with priority 1). DENY rules take precedence over + * ALLOW rules having equal priority. + */ + priority: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If source ranges are specified, the firewall will apply only to traffic + * that has source IP address in these ranges. These ranges must be + * expressed in CIDR format. One or both of sourceRanges and sourceTags may + * be set. If both properties are set, the firewall will apply to traffic + * that has source IP address within sourceRanges OR the source IP that + * belongs to a tag listed in the sourceTags property. The connection does + * not need to match both properties for the firewall to apply. Only IPv4 is + * supported. + */ + sourceRanges: string[]; + /** + * If source service accounts are specified, the firewall will apply only to + * traffic originating from an instance with a service account in this list. + * Source service accounts cannot be used to control traffic to an + * instance's external IP address because service accounts are + * associated with an instance, not an IP address. sourceRanges can be set + * at the same time as sourceServiceAccounts. If both are set, the firewall + * will apply to traffic that has source IP address within sourceRanges OR + * the source IP belongs to an instance with service account listed in + * sourceServiceAccount. The connection does not need to match both + * properties for the firewall to apply. sourceServiceAccounts cannot be + * used at the same time as sourceTags or targetTags. + */ + sourceServiceAccounts: string[]; + /** + * If source tags are specified, the firewall rule applies only to traffic + * with source IPs that match the primary network interfaces of VM instances + * that have the tag and are in the same VPC network. Source tags cannot be + * used to control traffic to an instance's external IP address, it only + * applies to traffic between instances in the same virtual network. Because + * tags are associated with instances, not IP addresses. One or both of + * sourceRanges and sourceTags may be set. If both properties are set, the + * firewall will apply to traffic that has source IP address within + * sourceRanges OR the source IP that belongs to a tag listed in the + * sourceTags property. The connection does not need to match both + * properties for the firewall to apply. + */ + sourceTags: string[]; + /** + * A list of service accounts indicating sets of instances located in the + * network that may make network connections as specified in allowed[]. + * targetServiceAccounts cannot be used at the same time as targetTags or + * sourceTags. If neither targetServiceAccounts nor targetTags are + * specified, the firewall rule applies to all instances on the specified + * network. + */ + targetServiceAccounts: string[]; + /** + * A list of tags that controls which instances the firewall rule applies + * to. If targetTags are specified, then the firewall rule applies only to + * instances in the VPC network that have one of those tags. If no + * targetTags are specified, the firewall rule applies to all instances on + * the specified network. + */ + targetTags: string[]; + } + /** + * Contains a list of firewalls. + */ + export interface Schema$FirewallList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Firewall resources. + */ + items: Schema$Firewall[]; + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of + * firewalls. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Encapsulates numeric value that can be either absolute or relative. + */ + export interface Schema$FixedOrPercent { + /** + * [Output Only] Absolute value of VM instances calculated based on the + * specific mode. - If the value is fixed, then the caculated value is + * equal to the fixed value. - If the value is a percent, then the + * calculated value is percent/100 * targetSize. For example, the calculated + * value of a 80% of a managed instance group with 150 instances would be + * (80/100 * 150) = 120 VM instances. If there is a remainder, the number is + * rounded up. + */ + calculated: number; + /** + * Specifies a fixed number of VM instances. This must be a positive + * integer. + */ + fixed: number; + /** + * Specifies a percentage of instances between 0 to 100%, inclusive. For + * example, specify 80 for 80%. + */ + percent: number; + } + /** + * A ForwardingRule resource. A ForwardingRule resource specifies which pool + * of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules + * ==) (== resource_for v1.forwardingRules ==) (== resource_for + * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules + * ==) (== resource_for beta.regionForwardingRules ==) (== resource_for + * v1.regionForwardingRules ==) + */ + export interface Schema$ForwardingRule { + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the BackendService resource to receive + * the matched traffic. + */ + backendService: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a ForwardingRule. Include the fingerprint in patch + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. To see the latest fingerprint, make a + * get() request to retrieve a ForwardingRule. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP address that this forwarding rule is serving on behalf of. + * Addresses are restricted based on the forwarding rule's load + * balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). + * When the load balancing scheme is EXTERNAL, for global forwarding rules, + * the address must be a global IP, and for regional forwarding rules, the + * address must live in the same region as the forwarding rule. If this + * field is empty, an ephemeral IPv4 address from the same scope (global or + * regional) will be assigned. A regional forwarding rule supports IPv4 + * only. A global forwarding rule supports either IPv4 or IPv6. When the + * load balancing scheme is INTERNAL, this can only be an RFC 1918 IP + * address belonging to the network/subnet configured for the forwarding + * rule. By default, if this field is empty, an ephemeral internal IP + * address will be automatically allocated from the IP range of the subnet + * or network configured for this forwarding rule. An address can be + * specified either by a literal IP address or a URL reference to an + * existing Address resource. The following examples are all valid: - + * 100.1.2.3 - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address + * - projects/project/regions/region/addresses/address - + * regions/region/addresses/address - global/addresses/address - address + */ + IPAddress: string; + /** + * The IP protocol to which this rule applies. Valid options are TCP, UDP, + * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only + * TCP and UDP are valid. + */ + IPProtocol: string; + /** + * The IP Version that will be used by this forwarding rule. Valid options + * are IPV4 or IPV6. This can only be specified for a global forwarding + * rule. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for + * Forwarding Rule resources. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this resource, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a + * ForwardingRule. + */ + labelFingerprint: string; + /** + * Labels to apply to this resource. These can be later modified by the + * setLabels method. Each label key/value pair must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * This signifies what the ForwardingRule will be used for and can only take + * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that + * this will be used for Internal Network Load Balancing (TCP, UDP). The + * value of EXTERNAL means that this will be used for External Load + * Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) + */ + loadBalancingScheme: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the network that the load balanced IP + * should belong to for this Forwarding Rule. If this field is not + * specified, the default network will be used. + */ + network: string; + /** + * This signifies the networking tier used for configuring this load + * balancer and can only take the following values: PREMIUM , STANDARD. For + * regional ForwardingRule, the valid values are PREMIUM and STANDARD. For + * GlobalForwardingRule, the valid value is PREMIUM. If this field is not + * specified, it is assumed to be PREMIUM. If IPAddress is specified, this + * value must be equal to the networkTier of the Address. + */ + networkTier: string; + /** + * This field is used along with the target field for TargetHttpProxy, + * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, + * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, + * or SCTP, only packets addressed to ports in the specified range will be + * forwarded to target. Forwarding rules with the same [IPAddress, + * IPProtocol] pair must have disjoint port ranges. Some types of + * forwarding target have constraints on the acceptable ports: - + * TargetHttpProxy: 80, 8080 - TargetHttpsProxy: 443 - TargetTcpProxy: 25, + * 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - + * TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, + * 1688, 1883, 5222 - TargetVpnGateway: 500, 4500 + */ + portRange: string; + /** + * This field is used along with the backend_service field for internal load + * balancing. When the load balancing scheme is INTERNAL, a single port or + * a comma separated list of ports can be configured. Only packets addressed + * to these ports will be forwarded to the backends configured with this + * forwarding rule. You may specify a maximum of up to 5 ports. + */ + ports: string[]; + /** + * [Output Only] URL of the region where the regional forwarding rule + * resides. This field is not applicable to global forwarding rules. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * An optional prefix to the service name for this Forwarding Rule. If + * specified, will be the first label of the fully qualified service name. + * The label must be 1-63 characters long, and comply with RFC1035. + * Specifically, the label must be 1-63 characters long and match the + * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. This field is only used for internal load balancing. + */ + serviceLabel: string; + /** + * [Output Only] The internal fully qualified service name for this + * Forwarding Rule. This field is only used for internal load balancing. + */ + serviceName: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the subnetwork that the load balanced IP + * should belong to for this Forwarding Rule. If the network specified is + * in auto subnet mode, this field is optional. However, if the network is + * in custom subnet mode, a subnetwork must be specified. + */ + subnetwork: string; + /** + * The URL of the target resource to receive the matched traffic. For + * regional forwarding rules, this target must live in the same region as + * the forwarding rule. For global forwarding rules, this target must be a + * global load balancing resource. The forwarded traffic must be of a type + * appropriate to the target object. + */ + target: string; + } + export interface Schema$ForwardingRuleAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRulesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#forwardingRuleAggregatedList for lists of forwarding rules. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of ForwardingRule resources. + */ + export interface Schema$ForwardingRuleList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRule resources. + */ + items: Schema$ForwardingRule[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ForwardingRuleReference { forwardingRule: string; } + export interface Schema$ForwardingRulesScopedList { + /** + * A list of forwarding rules contained in this scope. + */ + forwardingRules: Schema$ForwardingRule[]; + /** + * Informational warning which replaces the list of forwarding rules when + * the list is empty. + */ + warning: any; + } + export interface Schema$GlobalSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash when updating or + * changing labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * A list of labels to apply for this resource. Each label key & value + * must comply with RFC1035. Specifically, the name must be 1-63 characters + * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which + * means the first character must be a lowercase letter, and all following + * characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. For example, + * "webserver-frontend": "images". A label value can + * also be empty (e.g. "my-label": ""). + */ + labels: any; + } + /** + * A guest attributes entry. + */ + export interface Schema$GuestAttributes { + /** + * [Output Only] Type of the resource. Always compute#guestAttributes for + * guest attributes entry. + */ + kind: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * The key to search for. + */ + variableKey: string; + /** + * [Output Only] The value found for the requested key. + */ + variableValue: string; + } + /** + * Guest OS features. + */ + export interface Schema$GuestOsFeature { + /** + * The ID of a supported feature. Read Enabling guest operating system + * features to see a list of available options. + */ + type: string; + } + /** + * An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the + * supported protocols. + */ + export interface Schema$HealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in 3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + http2HealthCheck: Schema$HTTP2HealthCheck; + httpHealthCheck: Schema$HTTPHealthCheck; + httpsHealthCheck: Schema$HTTPSHealthCheck; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Region where the health check resides. Not applicable to + * global health checks. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + sslHealthCheck: Schema$SSLHealthCheck; + tcpHealthCheck: Schema$TCPHealthCheck; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If + * not specified, the default is TCP. Exactly one of the protocol-specific + * health check field must be specified, which must match type field. + */ + type: string; + udpHealthCheck: Schema$UDPHealthCheck; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + /** + * Contains a list of HealthCheck resources. + */ + export interface Schema$HealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HealthCheck resources. + */ + items: Schema$HealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A full or valid partial URL to a health check. For example, the following + * are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check + * - projects/project-id/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$HealthCheckReference { healthCheck: string; } + export interface Schema$HealthChecksAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HealthChecksScopedList resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$HealthChecksScopedList { + /** + * A list of HealthChecks contained in this scope. + */ + healthChecks: Schema$HealthCheck[]; + /** + * Informational warning which replaces the list of backend services when + * the list is empty. + */ + warning: any; + } + export interface Schema$HealthStatus { + /** + * Health state of the instance. + */ + healthState: string; + /** + * URL of the instance resource. + */ + instance: string; + /** + * The IP address represented by this resource. + */ + ipAddress: string; + /** + * The port on the instance. + */ + port: number; + } + export interface Schema$HealthStatusForNetworkEndpoint { + /** + * URL of the backend service associated with the health state of the + * network endpoint. + */ + backendService: Schema$BackendServiceReference; + /** + * URL of the forwarding rule associated with the health state of the + * network endpoint. + */ + forwardingRule: Schema$ForwardingRuleReference; + /** + * URL of the health check associated with the health state of the network + * endpoint. + */ + healthCheck: Schema$HealthCheckReference; + /** + * Health state of the network endpoint determined based on the health + * checks configured. + */ + healthState: string; + } + export interface Schema$Host { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * Full or partial URL of the host type resource to use for this host, in + * the format: zones/zone/hostTypes/host-type. This is provided by the + * client when the host is created. For example, the following is a valid + * partial url to a predefined host type: + * zones/us-central1-b/hostTypes/n1-host-64-416 + */ + hostType: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A list of resource URLs to the virtual machine instances in this host. + * They must live in zones contained in the same region as this host. + */ + instances: string[]; + /** + * [Output Only] The type of the resource. Always compute#host for host. + */ + kind: string; + /** + * A fingerprint for this request, which is essentially a hash of the + * metadata's contents and used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request + * to modify or update metadata. You must always provide an up-to-date + * fingerprint hash in order to update or change metadata. To see the + * latest fingerprint, make get() request to the host. + */ + labelFingerprint: string; + /** + * Labels to apply to this host. + */ + labels: any; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the host. One of the following values: + * CREATING, READY, REPAIR, and DELETING. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + /** + * [Output Only] The name of the zone where the host resides, such as + * us-central1-a. + */ + zone: string; + } + export interface Schema$HostAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HostsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#hostAggregatedList for + * aggregated lists of hosts. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of hosts. + */ + export interface Schema$HostList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Host resources. + */ + items: Schema$Host[]; + /** + * [Output Only] Type of resource. Always compute#hostList for lists of + * hosts. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * UrlMaps A host-matching rule for a URL. If matched, will use the named + * PathMatcher to select the BackendService. + */ + export interface Schema$HostRule { + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The list of host patterns to match. They must be valid hostnames, except + * * will match any string of ([a-z0-9-.]*). In that case, * must be the + * first character and must be followed in the pattern by either - or .. + */ + hosts: string[]; + /** + * The name of the PathMatcher to use to match the path portion of the URL + * if the hostRule matches the URL's host portion. + */ + pathMatcher: string; + } + export interface Schema$HostsScopedList { + /** + * [Output Only] A list of hosts contained in this scope. + */ + hosts: Schema$Host[]; + /** + * [Output Only] An informational warning that appears when the host list is + * empty. + */ + warning: any; + } + /** + * A Host Type resource. + */ + export interface Schema$HostType { + /** + * [Output Only] The CPU platform used by this host type. + */ + cpuPlatform: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this host type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The number of virtual CPUs that are available to the host + * type. + */ + guestCpus: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#hostType for host + * types. + */ + kind: string; + /** + * [Output Only] Local SSD available to the host type, defined in GB. + */ + localSsdGb: number; + /** + * [Output Only] The amount of physical memory available to the host type, + * defined in MB. + */ + memoryMb: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the host type resides, such as + * us-central1-a. + */ + zone: string; + } + export interface Schema$HostTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HostTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource.Always compute#hostTypeAggregatedList for + * aggregated lists of host types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of host types. + */ + export interface Schema$HostTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HostType resources. + */ + items: Schema$HostType[]; + /** + * [Output Only] Type of resource.Always compute#hostTypeList for lists of + * host types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$HostTypesScopedList { + /** + * [Output Only] A list of host types contained in this scope. + */ + hostTypes: Schema$HostType[]; + /** + * [Output Only] An informational warning that appears when the host types + * list is empty. + */ + warning: any; + } + export interface Schema$HTTP2HealthCheck { + /** + * The value of the host header in the HTTP/2 health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies how port is selected for health checking, can be one of + * following values: USE_FIXED_PORT: The port number in port is used for + * health checking. USE_NAMED_PORT: The portName is used for health + * checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified + * for each network endpoint is used for health checking. For other + * backends, the port or named port specified in the Backend Service is used + * for health checking. If not specified, HTTP2 health check follows + * behavior specified in port and portName fields. + */ + portSpecification: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTP/2 health check request. The default value is + * /. + */ + requestPath: string; + /** + * The string to match anywhere in the first 1024 bytes of the response + * body. If left empty (the default value), the status code determines + * health. The response data can only be ASCII. + */ + response: string; + } + /** + * An HttpHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTP. + */ + export interface Schema$HttpHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#httpHealthCheck for + * HTTP health checks. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTP health check request. The default value + * is 80. + */ + port: number; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPHealthCheck { + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies how port is selected for health checking, can be one of + * following values: USE_FIXED_PORT: The port number in port is used for + * health checking. USE_NAMED_PORT: The portName is used for health + * checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified + * for each network endpoint is used for health checking. For other + * backends, the port or named port specified in the Backend Service is used + * for health checking. If not specified, HTTP health check follows + * behavior specified in port and portName fields. + */ + portSpecification: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + /** + * The string to match anywhere in the first 1024 bytes of the response + * body. If left empty (the default value), the status code determines + * health. The response data can only be ASCII. + */ + response: string; + } + /** + * Contains a list of HttpHealthCheck resources. + */ + export interface Schema$HttpHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpHealthCheck resources. + */ + items: Schema$HttpHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An HttpsHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTPS. + */ + export interface Schema$HttpsHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTPS health check request. The default value + * is 443. + */ + port: number; + /** + * The request path of the HTTPS health check request. The default value is + * "/". + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have a greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPSHealthCheck { + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies how port is selected for health checking, can be one of + * following values: USE_FIXED_PORT: The port number in port is used for + * health checking. USE_NAMED_PORT: The portName is used for health + * checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified + * for each network endpoint is used for health checking. For other + * backends, the port or named port specified in the Backend Service is used + * for health checking. If not specified, HTTPS health check follows + * behavior specified in port and portName fields. + */ + portSpecification: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTPS health check request. The default value is + * /. + */ + requestPath: string; + /** + * The string to match anywhere in the first 1024 bytes of the response + * body. If left empty (the default value), the status code determines + * health. The response data can only be ASCII. + */ + response: string; + } + /** + * Contains a list of HttpsHealthCheck resources. + */ + export interface Schema$HttpsHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpsHealthCheck resources. + */ + items: Schema$HttpsHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Image resource. (== resource_for beta.images ==) (== resource_for + * v1.images ==) + */ + export interface Schema$Image { + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in + * bytes). + */ + archiveSizeBytes: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The deprecation status associated with this image. + */ + deprecated: Schema$DeprecationStatus; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Size of the image when restored onto a persistent disk (in GB). + */ + diskSizeGb: string; + /** + * The name of the image family to which this image belongs. You can create + * disks by specifying an image family instead of a specific image name. The + * image family always returns its latest image that is not deprecated. The + * name of the image family must comply with RFC1035. + */ + family: string; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Encrypts the image using a customer-supplied encryption key. After you + * encrypt an image with a customer-supplied key, you must provide the same + * key if you use the image later (e.g. to create a disk from the image). + * Customer-supplied encryption keys do not protect access to metadata of + * the disk. If you do not provide an encryption key when creating the + * image, then the disk will be encrypted using an automatically generated + * key and you do not need to provide a key to use the image later. + */ + imageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] Type of the resource. Always compute#image for images. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this image, which is + * essentially a hash of the labels used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an image. + */ + labelFingerprint: string; + /** + * Labels to apply to this image. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * image. + */ + licenseCodes: string[]; + /** + * Any applicable license URI. + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The parameters of the raw disk image. + */ + rawDisk: any; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL of the source disk used to create this image. This can be a full or + * valid partial URL. You must provide either this property or the + * rawDisk.source property but not both to create an image. For example, the + * following are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * The ID value of the disk used to create this image. This value may be + * used to determine whether the image was taken from the current or a + * previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * URL of the source image used to create this image. This can be a full or + * valid partial URL. You must provide exactly one of: - this property, or + * - the rawDisk.source property, or - the sourceDisk property in order + * to create an image. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this image. This + * value may be used to determine whether the image was taken from the + * current or a previous instance of a given image name. + */ + sourceImageId: string; + /** + * URL of the source snapshot used to create this image. This can be a full + * or valid partial URL. You must provide exactly one of: - this property, + * or - the sourceImage property, or - the rawDisk.source property, or + * - the sourceDisk property in order to create an image. + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the snapshot used to create this image. + * This value may be used to determine whether the snapshot was taken from + * the current or a previous instance of a given snapshot name. + */ + sourceSnapshotId: string; + /** + * The type of the image used to create this disk. The default and only + * value is RAW + */ + sourceType: string; + /** + * [Output Only] The status of the image. An image can be used to create + * other resources, such as instances, only after the image has been + * successfully created and the status is set to READY. Possible values are + * FAILED, PENDING, or READY. + */ + status: string; + } + /** + * Contains a list of images. + */ + export interface Schema$ImageList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Image resources. + */ + items: Schema$Image[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance resource. (== resource_for beta.instances ==) (== resource_for + * v1.instances ==) + */ + export interface Schema$Instance { + /** + * Allows this instance to send and receive packets with non-matching + * destination or source IPs. This is required if you plan to use this + * instance to forward routes. For more information, see Enabling IP + * Forwarding. + */ + canIpForward: boolean; + /** + * [Output Only] The CPU platform used by this instance. + */ + cpuPlatform: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Whether the resource should be protected against deletion. + */ + deletionProtection: boolean; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Array of disks associated with this instance. Persistent disks must be + * created before you can assign them. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * Full or partial URL of the host resource that the instance should be + * placed on, in the format: zones/zone/hosts/host. Optional, sole-tenant + * Host (physical machine) that the instance will be placed on when it's + * created. The instance is guaranteed to be placed on the same machine as + * other instances with the same sole-tenant host. The request will be + * rejected if the sole-tenant host has run out of resources. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Encrypts or decrypts data for an instance with a customer-supplied + * encryption key. If you are creating a new instance, this field encrypts + * the local SSD and in-memory contents of the instance using a key that you + * provide. If you are restarting an instance protected with a + * customer-supplied encryption key, you must provide the correct key in + * order to successfully restart the instance. If you do not provide an + * encryption key when creating the instance, then the local SSD and + * in-memory contents will be encrypted using an automatically generated key + * and you do not need to provide a key to start the instance later. + * Instance templates do not store customer-supplied encryption keys, so you + * cannot use your own keys to encrypt local SSDs and in-memory content in a + * managed instance group. + */ + instanceEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] Type of the resource. Always compute#instance for + * instances. + */ + kind: string; + /** + * A fingerprint for this request, which is essentially a hash of the + * metadata's contents and used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request + * to modify or update metadata. You must always provide an up-to-date + * fingerprint hash in order to update or change metadata. To see the + * latest fingerprint, make get() request to the instance. + */ + labelFingerprint: string; + /** + * Labels to apply to this instance. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Full or partial URL of the machine type resource to use for this + * instance, in the format: zones/zone/machineTypes/machine-type. This is + * provided by the client when the instance is created. For example, the + * following is a valid partial url to a predefined machine type: + * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom + * machine type, provide a URL to a machine type in the following format, + * where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and + * MEMORY is the total memory for this instance. Memory must be a multiple + * of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): + * zones/zone/machineTypes/custom-CPUS-MEMORY For example: + * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of + * restrictions, read the Specifications for custom machine types. + */ + machineType: string; + /** + * The metadata key/value pairs assigned to this instance. This includes + * custom metadata and predefined keys. + */ + metadata: Schema$Metadata; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values + * are the friendly names of CPU platforms, such as minCpuPlatform: + * "Intel Haswell" or minCpuPlatform: "Intel Sandy + * Bridge". + */ + minCpuPlatform: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * An array of network configurations for this instance. These specify how + * interfaces are configured to interact with other network services, such + * as connecting to the internet. Multiple interfaces are supported per + * instance. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Total amount of preserved state for SUSPENDED instances. Read-only in the + * api. + */ + preservedStateSizeGb: string; + /** + * Sets the scheduling options for this instance. + */ + scheduling: Schema$Scheduling; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * A list of service accounts, with their specified scopes, authorized for + * this instance. Only one service account per VM instance is supported. + * Service accounts generate access tokens that can be accessed through the + * metadata server and used to authenticate applications on the instance. + * See Service Accounts for more information. + */ + serviceAccounts: Schema$ServiceAccount[]; + shieldedVmConfig: Schema$ShieldedVmConfig; + shieldedVmIntegrityPolicy: Schema$ShieldedVmIntegrityPolicy; + /** + * [Output Only] Whether a VM has been restricted for start because Compute + * Engine has detected suspicious activity. + */ + startRestricted: boolean; + /** + * [Output Only] The status of the instance. One of the following values: + * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, + * and TERMINATED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + /** + * A list of tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. The tags can be later modified by the setTags + * method. Each tag within the list must comply with RFC1035. + */ + tags: Schema$Tags; + /** + * [Output Only] URL of the zone where the instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$InstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstancesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for + * aggregated lists of Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for + * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== + * resource_for v1.regionInstanceGroups ==) + */ + export interface Schema$InstanceGroup { + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 + * text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The fingerprint of the named ports. The system uses this + * fingerprint to detect conflicts when multiple users change the named + * ports concurrently. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this instance group, generated by + * the server. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceGroup + * for instance groups. + */ + kind: string; + /** + * The name of the instance group. The name must be 1-63 characters long, + * and comply with RFC1035. + */ + name: string; + /** + * Assigns a name to a port number. For example: {name: "http", + * port: 80} This allows the system to reference ports by the assigned name + * instead of a port number. Named ports can also contain multiple ports. + * For example: [{name: "http", port: 80},{name: "http", + * port: 8080}] Named ports apply to all instances in this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * The URL of the network to which all instances in the instance group + * belong. + */ + network: string; + /** + * [Output Only] The URL of the region where the instance group is located + * (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this instance group. The server generates this + * URL. + */ + selfLink: string; + /** + * [Output Only] The total number of instances in the instance group. + */ + size: number; + /** + * [Output Only] The URL of the subnetwork to which all instances in the + * instance group belong. + */ + subnetwork: string; + /** + * [Output Only] The URL of the zone where the instance group is located + * (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupsScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupAggregatedList for aggregated lists of instance + * groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.vpnTunnels.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.vpnTunnels.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of InstanceGroup resources. */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Zoneoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$InstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupList for instance group lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers + * ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + */ + export interface Schema$InstanceGroupManager { + activities: Schema$InstanceGroupManagerActivities; + /** + * The autohealing policy for this managed instance group. You can specify + * only one value. + */ + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + /** + * The base instance name to use for instances in this group. The value must + * be 1-58 characters long. Instances are named by appending a hyphen and a + * random four-character string to the base instance name. The base instance + * name must comply with RFC1035. + */ + baseInstanceName: string; + /** + * [Output Only] The creation timestamp for this managed instance group in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The list of instance actions and the number of instances in + * this managed instance group that are scheduled for each of those actions. + */ + currentActions: Schema$InstanceGroupManagerActionsSummary; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Policy valid only for regional managed instance groups. + */ + distributionPolicy: Schema$DistributionPolicy; + /** + * The action to perform in case of zone failure. Only one value is + * supported, NO_FAILOVER. The default is NO_FAILOVER. + */ + failoverAction: string; + /** + * [Output Only] The fingerprint of the resource data. You can use this + * optional field for optimistic locking when you update the resource. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this resource type. The server + * generates this identifier. + */ + id: string; + /** + * [Output Only] The URL of the Instance Group resource. + */ + instanceGroup: string; + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManager for managed instance groups. + */ + kind: string; + /** + * The name of the managed instance group. The name must be 1-63 characters + * long, and comply with RFC1035. + */ + name: string; + /** + * Named ports configured for the Instance Groups complementary to this + * Instance Group Manager. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The list of instance actions and the number of instances in + * this managed instance group that are pending for each of those actions. + */ + pendingActions: Schema$InstanceGroupManagerPendingActionsSummary; + /** + * [Output Only] The URL of the region where the managed instance group + * resides (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this managed instance group. The server defines + * this URL. + */ + selfLink: string; + /** + * [Output Only] The service account to be used as credentials for all + * operations performed by the managed instance group on instances. The + * service accounts needs all permissions required to create and delete + * instances. By default, the service account + * {projectNumber}@cloudservices.gserviceaccount.com is used. + */ + serviceAccount: string; + /** + * Stateful configuration for this Instanced Group Manager + */ + statefulPolicy: Schema$StatefulPolicy; + /** + * The URLs for all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + /** + * The target number of running instances for this managed instance group. + * Deleting or abandoning instances reduces this number. Resizing the group + * changes this number. + */ + targetSize: number; + /** + * The update policy for this managed instance group. + */ + updatePolicy: Schema$InstanceGroupManagerUpdatePolicy; + /** + * Specifies the instance templates used by this managed instance group to + * create instances. Each version is defined by an instanceTemplate. Every + * template can appear at most once per instance group. This field overrides + * the top-level instanceTemplate field. Read more about the relationships + * between these fields. Exactly one version must leave the targetSize field + * unset. That version will be applied to all remaining instances. For more + * information, read about canary updates. + */ + versions: Schema$InstanceGroupManagerVersion[]; + /** + * [Output Only] The URL of the zone where the managed instance group is + * located (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupManagerActionsSummary { + /** + * [Output Only] The total number of instances in the managed instance group + * that are scheduled to be abandoned. Abandoning an instance removes it + * from the managed instance group without deleting it. + */ + abandoning: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be created or are currently being created. If the group + * fails to create any of these instances, it tries again until it creates + * the instance successfully. If you have disabled creation retries, this + * field will not be populated; instead, the creatingWithoutRetries field + * will be populated. + */ + creating: number; + /** + * [Output Only] The number of instances that the managed instance group + * will attempt to create. The group attempts to create each instance only + * once. If the group fails to create any of these instances, it decreases + * the group's targetSize value accordingly. + */ + creatingWithoutRetries: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be deleted or are currently being deleted. + */ + deleting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are running and have no scheduled actions. + */ + none: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be recreated or are currently being being recreated. + * Recreating an instance deletes the existing root persistent disk and + * creates a new disk from the image that is defined in the instance + * template. + */ + recreating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are being reconfigured with properties that do not require a restart or a + * recreate action. For example, setting or removing target pools for the + * instance. + */ + refreshing: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be restarted or are currently being restarted. + */ + restarting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are being verified. See the managedInstances[].currentAction property in + * the listManagedInstances method documentation. + */ + verifying: number; + } + export interface Schema$InstanceGroupManagerActivities { + autohealing: string; + autohealingHealthCheckBased: string; + autoscalingDown: string; + autoscalingUp: string; + creatingInstances: string; + deletingInstances: string; + recreatingInstances: string; + } + export interface Schema$InstanceGroupManagerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManagersScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerAggregatedList for an aggregated list of + * managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagerAutoHealingPolicy { + /** + * The URL for the health check that signals autohealing. + */ + healthCheck: string; + /** + * The number of seconds that the managed instance group waits before it + * applies autohealing policies to new instances or recently recreated + * instances. This initial delay allows instances to initialize and run + * their startup scripts before the instance group determines that they are + * UNHEALTHY. This prevents the managed instance group from recreating its + * instances prematurely. This value must be from range [0, 3600]. + */ + initialDelaySec: number; + /** + * Maximum number of instances that can be unavailable when autohealing. The + * instance is considered available if all of the following conditions are + * satisfied: 1. Instance's status is RUNNING. 2. Instance's + * liveness health check result was observed to be HEALTHY at least once. By + * default, a percent value of 100% is used. + */ + maxUnavailable: Schema$FixedOrPercent; + /** + * Defines operating mode for this policy. + */ + mode: string; + } + /** + * [Output Only] A list of managed instance groups. + */ + export interface Schema$InstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagerPendingActionsSummary { + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be created. + */ + creating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be deleted. + */ + deleting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be recreated. + */ + recreating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be restarted. + */ + restarting: number; + } + export interface Schema$InstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + /** + * InstanceGroupManagers.applyUpdatesToInstances + */ + export interface Schema$InstanceGroupManagersApplyUpdatesRequest { + /** + * The list of URLs of one or more instances for which we want to apply + * updates on this managed instance group. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + /** + * The maximal action that should be perfomed on the instances. By default + * REPLACE. + */ + maximalAction: string; + /** + * The minimal action that should be perfomed on the instances. By default + * NONE. + */ + minimalAction: string; + } + export interface Schema$InstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + /** + * InstanceGroupManagers.deletePerInstanceConfigs + */ + export interface Schema$InstanceGroupManagersDeletePerInstanceConfigsReq { + /** + * The list of instances for which we want to delete per-instance configs on + * this managed instance group. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersListManagedInstancesResponse { + /** + * [Output Only] The list of instances in the managed instance group. + */ + managedInstances: Schema$ManagedInstance[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + } + export interface Schema$InstanceGroupManagersListPerInstanceConfigsResp { + /** + * [Output Only] The list of PerInstanceConfig. + */ + items: Schema$PerInstanceConfig[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagersRecreateInstancesRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersResizeAdvancedRequest { + /** + * If this flag is true, the managed instance group attempts to create all + * instances initiated by this resize request only once. If there is an + * error during creation, the managed instance group does not retry create + * this instance, and we will decrease the targetSize of the request + * instead. If the flag is false, the group attemps to recreate each + * instance continuously until it succeeds. This flag matters only in the + * first attempt of creation of an instance. After an instance is + * successfully created while this flag is enabled, the instance behaves the + * same way as all the other instances created with a regular resize + * request. In particular, if a running instance dies unexpectedly at a + * later time and needs to be recreated, this mode does not affect the + * recreation behavior in that scenario. This flag is applicable only to + * the current resize request. It does not influence other resize requests + * in any way. You can see which instances is being creating in which mode + * by calling the get or listManagedInstances API. + */ + noCreationRetries: boolean; + /** + * The number of running instances that the managed instance group should + * maintain at any given time. The group automatically adds or removes + * instances to maintain the number of instances specified by this + * parameter. + */ + targetSize: number; + } + export interface Schema$InstanceGroupManagersScopedList { + /** + * [Output Only] The list of managed instance groups that are contained in + * the specified project and zone. + */ + instanceGroupManagers: Schema$InstanceGroupManager[]; + /** + * [Output Only] The warning that replaces the list of managed instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupManagersSetAutoHealingRequest { + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + } + export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + } + export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { + /** + * The fingerprint of the target pools information. Use this optional + * property to prevent conflicts when multiple users change the target pools + * settings concurrently. Obtain the fingerprint with the + * instanceGroupManagers.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of target pool URLs that instances in this managed instance + * group belong to. The managed instance group applies these target pools to + * all of the instances in the group. Existing instances and new instances + * in the group all receive these target pool settings. + */ + targetPools: string[]; + } + /** + * InstanceGroupManagers.updatePerInstanceConfigs + */ + export interface Schema$InstanceGroupManagersUpdatePerInstanceConfigsReq { + /** + * The list of per-instance configs to insert or patch on this managed + * instance group. + */ + perInstanceConfigs: Schema$PerInstanceConfig[]; + } + export interface Schema$InstanceGroupManagerUpdatePolicy { + /** + * The maximum number of instances that can be created above the specified + * targetSize during the update process. By default, a fixed value of 1 is + * used. This value can be either a fixed number or a percentage if the + * instance group has 10 or more instances. If you set a percentage, the + * number of instances will be rounded up if necessary. At least one of + * either maxSurge or maxUnavailable must be greater than 0. Learn more + * about maxSurge. + */ + maxSurge: Schema$FixedOrPercent; + /** + * The maximum number of instances that can be unavailable during the update + * process. An instance is considered available if all of the following + * conditions are satisfied: - The instance's status is RUNNING. - + * If there is a health check on the instance group, the instance's + * liveness health check result must be HEALTHY at least once. If there is + * no health check on the group, then the instance only needs to have a + * status of RUNNING to be considered available. By default, a fixed value + * of 1 is used. This value can be either a fixed number or a percentage if + * the instance group has 10 or more instances. If you set a percentage, the + * number of instances will be rounded up if necessary. At least one of + * either maxSurge or maxUnavailable must be greater than 0. Learn more + * about maxUnavailable. + */ + maxUnavailable: Schema$FixedOrPercent; + /** + * Minimal action to be taken on an instance. You can specify either RESTART + * to restart existing instances or REPLACE to delete and create new + * instances from the target template. If you specify a code>RESTART, the + * Updater will attempt to perform that action only. However, if the Updater + * determines that the minimal action you specify is not enough to perform + * the update, it might perform a more disruptive action. + */ + minimalAction: string; + /** + * Minimum number of seconds to wait for after a newly created instance + * becomes available. This value must be from range [0, 3600]. + */ + minReadySec: number; + type: string; + } + export interface Schema$InstanceGroupManagerVersion { + instanceTemplate: string; + /** + * Name of the version. Unique among all versions in the scope of this + * managed instance group. + */ + name: string; + /** + * Tag describing the version. Used to trigger rollout of a target version + * even if instance_template remains unchanged. Deprecated in favor of + * 'name'. + */ + tag: string; + /** + * Specifies the intended number of instances to be created from the + * instanceTemplate. The final number of instances created from the template + * will be equal to: - If expressed as a fixed number, the minimum of + * either targetSize.fixed or instanceGroupManager.targetSize is used. - if + * expressed as a percent, the targetSize would be (targetSize.percent/100 * + * InstanceGroupManager.targetSize) If there is a remainder, the number is + * rounded up. If unset, this version will update any remaining instances + * not updated by another version. Read Starting a canary update for more + * information. + */ + targetSize: Schema$FixedOrPercent; + } + export interface Schema$InstanceGroupsAddInstancesRequest { + /** + * The list of instances to add to the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupsListInstances for the list of instances in the + * specified instance group. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupsListInstancesRequest { + /** + * A filter for the state of the instances in the instance group. Valid + * options are ALL or RUNNING. If you do not specify this parameter the list + * includes all instances regardless of their state. + */ + instanceState: string; + } + export interface Schema$InstanceGroupsRemoveInstancesRequest { + /** + * The list of instances to remove from the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsScopedList { + /** + * [Output Only] The list of instance groups that are contained in this + * scope. + */ + instanceGroups: Schema$InstanceGroup[]; + /** + * [Output Only] An informational warning that replaces the list of instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of instances. + */ + export interface Schema$InstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Instance resources. + */ + items: Schema$Instance[]; + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of + * Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of instance referrers. + */ + export interface Schema$InstanceListReferrers { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Reference resources. + */ + items: Schema$Reference[]; + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for + * lists of Instance referrers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceMoveRequest { + /** + * The URL of the destination zone to move the instance. This can be a full + * or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target instance to move. This can be a full or partial + * URL. For example, the following are all valid URLs to an instance: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + targetInstance: string; + } + export interface Schema$InstanceProperties { + /** + * Enables instances created based on this template to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify true. If unsure, leave this set to false. See the + * Enable IP forwarding documentation for more information. + */ + canIpForward: boolean; + /** + * An optional text description for the instances that are created from this + * instance template. + */ + description: string; + /** + * An array of disks that are associated with the instances that are created + * from this template. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of guest accelerator cards' type and count to use for + * instances created from the instance template. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * Labels to apply to instances that are created from this template. + */ + labels: any; + /** + * The machine type to use for instances that are created from this + * template. + */ + machineType: string; + /** + * The metadata key/value pairs to assign to instances that are created from + * this template. These pairs can consist of custom metadata or predefined + * keys. See Project and instance metadata for more information. + */ + metadata: Schema$Metadata; + /** + * Minimum cpu/platform to be used by this instance. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are + * the friendly names of CPU platforms, such as minCpuPlatform: "Intel + * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more + * information, read Specifying a Minimum CPU Platform. + */ + minCpuPlatform: string; + /** + * An array of network access configurations for this interface. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Specifies the scheduling options for the instances that are created from + * this template. + */ + scheduling: Schema$Scheduling; + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * this template. Use metadata queries to obtain the access tokens for these + * instances. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * Specifies the Shielded VM options for the instances that are created from + * this template. + */ + shieldedVmConfig: Schema$ShieldedVmConfig; + /** + * A list of tags to apply to the instances that are created from this + * template. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag + * within the list must comply with RFC1035. + */ + tags: Schema$Tags; + } + export interface Schema$InstanceReference { + /** + * The URL for a specific instance. + */ + instance: string; + } + export interface Schema$InstancesResumeRequest { + /** + * Array of disks associated with this instance that are protected with a + * customer-supplied encryption key. In order to resume the instance, the + * disk url and its corresponding key must be provided. If the disk is not + * protected with a customer-supplied encryption key it should not be + * specified. + */ + disks: Schema$CustomerEncryptionKeyProtectedDisk[]; + /** + * Decrypts data associated with an instance that is protected with a + * customer-supplied encryption key. If the instance you are starting is + * protected with a customer-supplied encryption key, the correct key must + * be provided otherwise the instance resume will not succeed. + */ + instanceEncryptionKey: Schema$CustomerEncryptionKey; + } + export interface Schema$InstancesScopedList { + /** + * [Output Only] A list of instances contained in this scope. + */ + instances: Schema$Instance[]; + /** + * [Output Only] Informational warning which replaces the list of instances + * when the list is empty. + */ + warning: any; + } + export interface Schema$InstancesSetLabelsRequest { + /** + * Fingerprint of the previous set of labels for this resource, used to + * prevent conflicts. Provide the latest fingerprint value when making a + * request to add or change labels. + */ + labelFingerprint: string; + labels: any; + } + export interface Schema$InstancesSetMachineResourcesRequest { + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + } + export interface Schema$InstancesSetMachineTypeRequest { + /** + * Full or partial URL of the machine type resource. See Machine Types for a + * full list of machine types. For example: + * zones/us-central1-f/machineTypes/n1-standard-1 + */ + machineType: string; + } + export interface Schema$InstancesSetMinCpuPlatformRequest { + /** + * Minimum cpu/platform this instance should be started at. + */ + minCpuPlatform: string; + } + export interface Schema$InstancesSetServiceAccountRequest { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + export interface Schema$InstancesStartWithEncryptionKeyRequest { + /** + * Array of disks associated with this instance that are protected with a + * customer-supplied encryption key. In order to start the instance, the + * disk url and its corresponding key must be provided. If the disk is not + * protected with a customer-supplied encryption key it should not be + * specified. + */ + disks: Schema$CustomerEncryptionKeyProtectedDisk[]; + /** + * Decrypts data associated with an instance that is protected with a + * customer-supplied encryption key. If the instance you are starting is + * protected with a customer-supplied encryption key, the correct key must + * be provided otherwise the instance start will not succeed. + */ + instanceEncryptionKey: Schema$CustomerEncryptionKey; + } + /** + * An Instance Template resource. (== resource_for beta.instanceTemplates ==) + * (== resource_for v1.instanceTemplates ==) + */ + export interface Schema$InstanceTemplate { + /** + * [Output Only] The creation timestamp for this instance template in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A unique identifier for this instance template. The server + * defines this identifier. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceTemplate + * for instance templates. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The instance properties for this instance template. + */ + properties: Schema$InstanceProperties; + /** + * [Output Only] The URL for this instance template. The server defines this + * URL. + */ + selfLink: string; + /** + * The source instance used to create the template. You can provide this as + * a partial or full URL to the resource. For example, the following are + * valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + */ + sourceInstance: string; + /** + * The source instance params to use to create this instance template. + */ + sourceInstanceParams: Schema$SourceInstanceParams; + } + /** + * A list of instance templates. + */ + export interface Schema$InstanceTemplateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceTemplate resources. + */ + items: Schema$InstanceTemplate[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceTemplatesListResponse for instance template lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceWithNamedPorts { + /** + * [Output Only] The URL of the instance. + */ + instance: string; + /** + * [Output Only] The named ports that belong to this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The status of the instance. + */ + status: string; + } + /** + * Represents an Interconnects resource. The Interconnects resource is a + * dedicated connection between Google's network and your on-premises + * network. For more information, see the Dedicated overview page. (== + * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + */ + export interface Schema$Interconnect { + /** + * Administrative status of the interconnect. When this is set to true, the + * Interconnect is functional and can carry traffic. When set to false, no + * packets can be carried over the interconnect and no BGP routes are + * exchanged over it. By default, the status is set to true. + */ + adminEnabled: boolean; + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual + * circuits in this LAG. + */ + circuitInfos: Schema$InterconnectCircuitInfo[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Customer name, to put in the Letter of Authorization as the party + * authorized to request a crossconnect. + */ + customerName: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of outages expected for this Interconnect. + */ + expectedOutages: Schema$InterconnectOutageNotification[]; + /** + * [Output Only] IP address configured on the Google side of the + * Interconnect link. This can be used only for ping tests. + */ + googleIpAddress: string; + /** + * [Output Only] Google reference ID; to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of the URLs of all InterconnectAttachments + * configured to use this Interconnect. + */ + interconnectAttachments: string[]; + /** + * Type of interconnect. Note that "IT_PRIVATE" has been + * deprecated in favor of "DEDICATED" + */ + interconnectType: string; + /** + * [Output Only] Type of the resource. Always compute#interconnect for + * interconnects. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this Interconnect, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an Interconnect. + */ + labelFingerprint: string; + /** + * Labels to apply to this Interconnect resource. These can be later + * modified by the setLabels method. Each label key/value must comply with + * RFC1035. Label values may be empty. + */ + labels: any; + /** + * Type of link requested. This field indicates speed of each of the links + * in the bundle, not the entire bundle. Only 10G per link is allowed for a + * dedicated interconnect. Options: Ethernet_10G_LR + */ + linkType: string; + /** + * URL of the InterconnectLocation object that represents where this + * connection is to be provisioned. + */ + location: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Email address to contact the customer NOC for operations and maintenance + * notifications regarding this Interconnect. If specified, this will be + * used for notifications in addition to all other forms described, such as + * Stackdriver logs alerting and Cloud Notifications. + */ + nocContactEmail: string; + /** + * [Output Only] The current status of whether or not this Interconnect is + * functional. + */ + operationalStatus: string; + /** + * [Output Only] IP address configured on the customer side of the + * Interconnect link. The customer should configure this IP address during + * turnup when prompted by Google NOC. This can be used only for ping tests. + */ + peerIpAddress: string; + /** + * [Output Only] Number of links actually provisioned in this interconnect. + */ + provisionedLinkCount: number; + /** + * Target number of physical links in the link bundle, as requested by the + * customer. + */ + requestedLinkCount: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The current state of whether or not this Interconnect is + * functional. + */ + state: string; + } + /** + * Represents an InterconnectAttachment (VLAN attachment) resource. For more + * information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for + * v1.interconnectAttachments ==) + */ + export interface Schema$InterconnectAttachment { + /** + * Determines whether this Attachment will carry packets. Not present for + * PARTNER_PROVIDER. + */ + adminEnabled: boolean; + /** + * [Deprecated] Replaced by edge_availability_domain. + */ + availabilityZone: string; + /** + * Provisioned bandwidth capacity for the interconnectAttachment. Can be set + * by the partner to update the customer's provisioned bandwidth. Output + * only for for PARTNER type, mutable for PARTNER_PROVIDER, not available + * for DEDICATED. + */ + bandwidth: string; + /** + * Up to 16 candidate prefixes that can be used to restrict the allocation + * of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + * All prefixes must be within link-local address space (169.254.0.0/16) and + * must be /29 or shorter (/28, /27, etc). Google will attempt to select an + * unused /29 from the supplied candidate prefix(es). The request will fail + * if all possible /29s are in use on Google?s edge. If not supplied, Google + * will randomly select an unused /29 from all of link-local space. + */ + candidateSubnets: string[]; + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud + * Router Interface for this interconnect attachment. + */ + cloudRouterIpAddress: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] IPv4 address + prefix length to be configured on the + * customer router subinterface for this interconnect attachment. + */ + customerRouterIpAddress: string; + /** + * An optional description of this resource. + */ + description: string; + /** + * Desired availability domain for the attachment. Only available for type + * PARTNER, at creation time. For improved reliability, customers should + * configure a pair of attachments with one per availability domain. The + * selected availability domain will be provided to the Partner via the + * pairing key so that the provisioned circuit will lie in the specified + * domain. If not specified, the value will default to + * AVAILABILITY_DOMAIN_ANY. + */ + edgeAvailabilityDomain: string; + /** + * [Output Only] Google reference ID, to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * URL of the underlying Interconnect object that this attachment's + * traffic will traverse through. + */ + interconnect: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment + * for interconnect attachments. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this + * InterconnectAttachment, which is essentially a hash of the labels set + * used for optimistic locking. The fingerprint is initially generated by + * Compute Engine and changes after every request to modify or update + * labels. You must always provide an up-to-date fingerprint hash in order + * to update or change labels. To see the latest fingerprint, make a get() + * request to retrieve an InterconnectAttachment. + */ + labelFingerprint: string; + /** + * Labels to apply to this InterconnectAttachment resource. These can be + * later modified by the setLabels method. Each label key/value must comply + * with RFC1035. Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] The current status of whether or not this interconnect + * attachment is functional. + */ + operationalStatus: string; + /** + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not + * present for DEDICATED]. The opaque identifier of an PARTNER attachment + * used to initiate provisioning with a selected partner. Of the form + * "XXXXX/region/domain" + */ + pairingKey: string; + /** + * Optional BGP ASN for the router that should be supplied by a layer 3 + * Partner if they configured BGP on behalf of the customer. Output only for + * PARTNER type, input only for PARTNER_PROVIDER, not available for + * DEDICATED. + */ + partnerAsn: string; + /** + * Informational metadata about Partner attachments from Partners to display + * to customers. Output only for for PARTNER type, mutable for + * PARTNER_PROVIDER, not available for DEDICATED. + */ + partnerMetadata: Schema$InterconnectAttachmentPartnerMetadata; + /** + * [Output Only] Information specific to an InterconnectAttachment. This + * property is populated if the interconnect that this is attached to is of + * type DEDICATED. + */ + privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; + /** + * [Output Only] URL of the region where the regional interconnect + * attachment resides. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + region: string; + /** + * URL of the cloud router to be used for dynamic routing. This router must + * be in the same region as this InterconnectAttachment. The + * InterconnectAttachment will automatically connect the Interconnect to the + * network & region within which the Cloud Router is configured. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The current state of this attachment's functionality. + */ + state: string; + type: string; + /** + * Available only for DEDICATED and PARTNER_PROVIDER. Desired VLAN tag for + * this attachment, in the range 2-4094. This field refers to 802.1q VLAN + * tag, also known as IEEE 802.1Q Only specified at creation time. + */ + vlanTag8021q: number; + } + export interface Schema$InterconnectAttachmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#interconnectAttachmentAggregatedList for aggregated lists of + * interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Response to the list request, and contains a list of interconnect + * attachments. + */ + export interface Schema$InterconnectAttachmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachment resources. + */ + items: Schema$InterconnectAttachment[]; + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList + * for lists of interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - getRoot() { - return this.root; - } - - /** - * compute.zoneOperations.delete - * @desc Deletes the specified zone-specific Operations resource. - * @alias compute.zoneOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Informational metadata about Partner attachments from Partners to display + * to customers. These fields are propagated from PARTNER_PROVIDER attachments + * to their corresponding PARTNER attachments. + */ + export interface Schema$InterconnectAttachmentPartnerMetadata { + /** + * Plain text name of the Interconnect this attachment is connected to, as + * displayed in the Partner?s portal. For instance ?Chicago 1?. This value + * may be validated to match approved Partner values. + */ + interconnectName: string; + /** + * Plain text name of the Partner providing this attachment. This value may + * be validated to match approved Partner values. + */ + partnerName: string; + /** + * URL of the Partner?s portal for this Attachment. Partners may customise + * this to be a deep-link to the specific resource on the Partner portal. + * This value may be validated to match approved Partner values. + */ + portalUrl: string; + } + /** + * Information for an interconnect attachment when this belongs to an + * interconnect of type DEDICATED. + */ + export interface Schema$InterconnectAttachmentPrivateInfo { + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between + * Google and the customer, going to and from this network and region. + */ + tag8021q: number; + } + export interface Schema$InterconnectAttachmentsScopedList { + /** + * A list of interconnect attachments contained in this scope. + */ + interconnectAttachments: Schema$InterconnectAttachment[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * Describes a single physical circuit between the Customer and Google. + * CircuitInfo objects are created by Google, so all fields are output only. + * Next id: 4 + */ + export interface Schema$InterconnectCircuitInfo { + /** + * Customer-side demarc ID for this circuit. + */ + customerDemarcId: string; + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + */ + googleCircuitId: string; + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and + * provided by Google to the customer in the LOA. + */ + googleDemarcId: string; + } + /** + * Response to the list request, and contains a list of interconnects. + */ + export interface Schema$InterconnectList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Interconnect resources. + */ + items: Schema$Interconnect[]; + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists + * of interconnects. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents an InterconnectLocations resource. The InterconnectLocations + * resource describes the locations where you can connect to Google's + * networks. For more information, see Colocation Facilities. + */ + export interface Schema$InterconnectLocation { + /** + * [Output Only] The postal address of the Point of Presence, each line in + * the address is separated by a newline character. + */ + address: string; + /** + * [Output Only] Availability zone for this location. Within a metropolitan + * area (metro), maintenance will not be simultaneously scheduled in more + * than one availability zone. Example: "zone1" or + * "zone2". + */ + availabilityZone: string; + /** + * [Output Only] Metropolitan area designator that indicates which city an + * interconnect is located. For example: "Chicago, IL", + * "Amsterdam, Netherlands". + */ + city: string; + /** + * [Output Only] Continent for this location. + */ + continent: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] An optional description of the resource. + */ + description: string; + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + */ + facilityProvider: string; + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., + * Ashburn-DC1). + */ + facilityProviderFacilityId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation + * for interconnect locations. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The peeringdb identifier for this facility (corresponding + * with a netfac type in peeringdb). + */ + peeringdbFacilityId: string; + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that + * describe parameters pertaining to the relation between this + * InterconnectLocation and various Google Cloud regions. + */ + regionInfos: Schema$InterconnectLocationRegionInfo[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Response to the list request, and contains a list of interconnect + * locations. + */ + export interface Schema$InterconnectLocationList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectLocation resources. + */ + items: Schema$InterconnectLocation[]; + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList + * for lists of interconnect locations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Information about any potential InterconnectAttachments between an + * Interconnect at a specific InterconnectLocation, and a specific Cloud + * Region. + */ + export interface Schema$InterconnectLocationRegionInfo { + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation + * to a VM in this region. + */ + expectedRttMs: string; + /** + * Identifies the network presence of this location. + */ + locationPresence: string; + /** + * URL for the region of this location. + */ + region: string; + } + /** + * Description of a planned outage on this Interconnect. Next id: 9 + */ + export interface Schema$InterconnectOutageNotification { + /** + * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit + * IDs that will be affected. + */ + affectedCircuits: string[]; + /** + * A description about the purpose of the outage. + */ + description: string; + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + */ + endTime: string; + /** + * Form this outage is expected to take. Note that the "IT_" + * versions of this enum have been deprecated in favor of the unprefixed + * values. + */ + issueType: string; + /** + * Unique identifier for this outage notification. + */ + name: string; + /** + * The party that generated this notification. Note that + * "NSRC_GOOGLE" has been deprecated in favor of + * "GOOGLE" + */ + source: string; + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + */ + startTime: string; + /** + * State of this notification. Note that the "NS_" versions of + * this enum have been deprecated in favor of the unprefixed values. + */ + state: string; + } + export interface Schema$InternalIpOwner { + /** + * IP CIDR range being owned. + */ + ipCidrRange: string; + /** + * URLs of the IP owners of the IP CIDR range. + */ + owners: string[]; + /** + * Whether this IP CIDR range is reserved for system use. + */ + systemOwned: boolean; + } + /** + * Contains a list of IP owners. + */ + export interface Schema$IpOwnerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InternalIpOwner resources. + */ + items: Schema$InternalIpOwner[]; + /** + * [Output Only] Type of resource. Always compute#ipOwnerList for lists of + * IP owners. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A license resource. + */ + export interface Schema$License { + /** + * [Output Only] Deprecated. This field no longer reflects whether a license + * charges a usage fee. + */ + chargesUseFee: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#license for licenses. + */ + kind: string; + /** + * [Output Only] The unique code used to attach this license to images, + * snapshots, and disks. + */ + licenseCode: string; + /** + * [Output Only] Name of the resource. The name is 1-63 characters long and + * complies with RFC1035. + */ + name: string; + resourceRequirements: Schema$LicenseResourceRequirements; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If false, licenses will not be copied from the source resource when + * creating an image from a disk, disk from snapshot, or snapshot from disk. + */ + transferable: boolean; + } + export interface Schema$LicenseCode { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + */ + kind: string; + /** + * [Output Only] URL and description aliases of Licenses with the same + * License Code. + */ + licenseAlias: Schema$LicenseCodeLicenseAlias[]; + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and + * must be a valid 64 bit integer. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Current state of this License Code. + */ + state: string; + /** + * [Output Only] If true, the license will remain attached when creating + * images or snapshots from disks. Otherwise, the license is not + * transferred. + */ + transferable: boolean; + } + export interface Schema$LicenseCodeLicenseAlias { + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] URL of license corresponding to this License Code. + */ + selfLink: string; + } + export interface Schema$LicenseResourceRequirements { + /** + * Minimum number of guest cpus required to use the Instance. Enforced at + * Instance creation and Instance start. + */ + minGuestCpuCount: number; + /** + * Minimum memory required to use the Instance. Enforced at Instance + * creation and Instance start. + */ + minMemoryMb: number; + } + export interface Schema$LicensesListResponse { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of License resources. + */ + items: Schema$License[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Specifies what kind of log the caller must write + */ + export interface Schema$LogConfig { + /** + * Cloud audit options. + */ + cloudAudit: Schema$LogConfigCloudAuditOptions; + /** + * Counter options. + */ + counter: Schema$LogConfigCounterOptions; + /** + * Data access options. + */ + dataAccess: Schema$LogConfigDataAccessOptions; + } + /** + * Write a Cloud Audit log + */ + export interface Schema$LogConfigCloudAuditOptions { + /** + * Information used by the Cloud Audit Logging pipeline. + */ + authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; + /** + * The log_name to populate in the Cloud Audit Record. + */ + logName: string; + } + /** + * Increment a streamz counter with the specified metric and field names. + * Metric names should start with a '/', generally be lowercase-only, + * and end in "_count". Field names should not contain an initial + * slash. The actual exported metric names will have "/iam/policy" + * prepended. Field names correspond to IAM request parameters and field + * values are their respective values. At present the only supported field + * names are - "iam_principal", corresponding to + * IAMContext.principal; - "" (empty string), resulting in one + * aggretated counter with no field. Examples: counter { metric: + * "/debug_access_count" field: "iam_principal" } ==> + * increment counter /iam/policy/backend_debug_access_count + * {iam_principal=[value of IAMContext.principal]} At this time we do not + * support: * multiple field names (though this may be supported in the + * future) * decrementing the counter * incrementing it by anything other than + * 1 + */ + export interface Schema$LogConfigCounterOptions { + /** + * The field value to attribute. + */ + field: string; + /** + * The metric to update. + */ + metric: string; + } + /** + * Write a Data Access (Gin) log + */ + export interface Schema$LogConfigDataAccessOptions { + /** + * Whether Gin logging should happen in a fail-closed manner at the caller. + * This is relevant only in the LocalIAM implementation, for now. + */ + logMode: string; + } + /** + * A Machine Type resource. (== resource_for v1.machineTypes ==) (== + * resource_for beta.machineTypes ==) + */ + export interface Schema$MachineType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this machine type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The number of virtual CPUs that are available to the + * instance. + */ + guestCpus: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core + * machine types for more information. + */ + isSharedCpu: boolean; + /** + * [Output Only] The type of the resource. Always compute#machineType for + * machine types. + */ + kind: string; + /** + * [Output Only] Maximum persistent disks allowed. + */ + maximumPersistentDisks: number; + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + */ + maximumPersistentDisksSizeGb: string; + /** + * [Output Only] The amount of physical memory available to the instance, + * defined in MB. + */ + memoryMb: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the machine type resides, such + * as us-central1-a. + */ + zone: string; + } + export interface Schema$MachineTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList + * for aggregated lists of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of machine types. + */ + export interface Schema$MachineTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineType resources. + */ + items: Schema$MachineType[]; + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists + * of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$MachineTypesScopedList { + /** + * [Output Only] A list of machine types contained in this scope. + */ + machineTypes: Schema$MachineType[]; + /** + * [Output Only] An informational warning that appears when the machine + * types list is empty. + */ + warning: any; + } + /** + * Next available tag: 12 + */ + export interface Schema$ManagedInstance { + /** + * [Output Only] The current action that the managed instance group has + * scheduled for the instance. Possible values: - NONE The instance is + * running, and the managed instance group does not have any scheduled + * actions for this instance. - CREATING The managed instance group is + * creating this instance. If the group fails to create this instance, it + * will try again until it is successful. - CREATING_WITHOUT_RETRIES The + * managed instance group is attempting to create this instance only once. + * If the group fails to create this instance, it does not try again and the + * group's targetSize value is decreased instead. - RECREATING The + * managed instance group is recreating this instance. - DELETING The + * managed instance group is permanently deleting this instance. - + * ABANDONING The managed instance group is abandoning this instance. The + * instance will be removed from the instance group and from any target + * pools that are associated with this group. - RESTARTING The managed + * instance group is restarting the instance. - REFRESHING The managed + * instance group is applying configuration changes to the instance without + * stopping it. For example, the group can update the target pool list for + * an instance without stopping that instance. - VERIFYING The managed + * instance group has created the instance and it is in the process of being + * verified. + */ + currentAction: string; + /** + * [Output only] The unique identifier for this resource. This field is + * empty when instance does not exist. + */ + id: string; + /** + * [Output Only] The URL of the instance. The URL can exist even if the + * instance has not yet been created. + */ + instance: string; + /** + * [Output Only] The status of the instance. This field is empty when the + * instance does not exist. + */ + instanceStatus: string; + /** + * [Output Only] The intended template of the instance. This field is empty + * when current_action is one of { DELETING, ABANDONING }. + */ + instanceTemplate: string; + /** + * [Output Only] Information about the last attempt to create or delete the + * instance. + */ + lastAttempt: Schema$ManagedInstanceLastAttempt; + /** + * [Output Only] Override defined for this instance. + */ + override: Schema$ManagedInstanceOverride; + /** + * [Output Only] Tag describing the version. + */ + tag: string; + /** + * [Output Only] Intended version of this instance. + */ + version: Schema$ManagedInstanceVersion; + } + export interface Schema$ManagedInstanceLastAttempt { + /** + * [Output Only] Encountered errors during the last attempt to create or + * delete the instance. + */ + errors: any; + } + /** + * Overrides of stateful properties for a given instance + */ + export interface Schema$ManagedInstanceOverride { + /** + * Disk overrides defined for this instance. According to documentation the + * maximum number of disks attached to an instance is 128: + * https://cloud.google.com/compute/docs/disks/ However, compute API defines + * the limit at 140, so this is what we check. + */ + disks: Schema$ManagedInstanceOverrideDiskOverride[]; + /** + * Metadata overrides defined for this instance. TODO(b/69785416) validate + * the total length is <9 KB + */ + metadata: any[]; + /** + * [Output Only] Indicates where does the override come from. + */ + origin: string; + } + export interface Schema$ManagedInstanceOverrideDiskOverride { + /** + * The name of the device on the VM + */ + deviceName: string; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If + * not specified, the default is to attach the disk in READ_WRITE mode. + */ + mode: string; + /** + * The disk that is/will be mounted + */ + source: string; + } + export interface Schema$ManagedInstanceVersion { + /** + * [Output Only] The intended template of the instance. This field is empty + * when current_action is one of { DELETING, ABANDONING }. + */ + instanceTemplate: string; + /** + * [Output Only] Name of the version. + */ + name: string; + } + /** + * A metadata key/value entry. + */ + export interface Schema$Metadata { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. + */ + fingerprint: string; + /** + * Array of key/value pairs. The total size of all keys and values must be + * less than 512 KB. + */ + items: any[]; + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + */ + kind: string; + } + /** + * The named port. For example: . + */ + export interface Schema$NamedPort { + /** + * The name for this named port. The name must be 1-63 characters long, and + * comply with RFC1035. + */ + name: string; + /** + * The port number, which can be a value between 1 and 65535. + */ + port: number; + } + /** + * Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for + * beta.networks ==) + */ + export interface Schema$Network { + /** + * When set to true, the network is created in "auto subnet mode". + * When set to false, the network is in "custom subnet mode". In + * "auto subnet mode", a newly created network is assigned the + * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork + * per region. + */ + autoCreateSubnetworks: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Type of VM-to-VM traffic encryption for this network. + */ + crossVmEncryption: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A gateway address for default routing to other networks. This value is + * read only and is selected by the Google Compute Engine, typically as the + * first usable address in the IPv4Range. + */ + gatewayIPv4: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are legal on this network. This + * range is a CIDR specification, for example: 192.168.0.0/16. Provided by + * the client when the network is created. + */ + IPv4Range: string; + /** + * [Output Only] Type of the resource. Always compute#network for networks. + */ + kind: string; + /** + * [Output Only] Type of LB-to-VM traffic encryption for this network. + */ + loadBalancerVmEncryption: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] A list of network peerings for the resource. + */ + peerings: Schema$NetworkPeering[]; + /** + * The network-level routing configuration for this network. Used by Cloud + * Router to determine what type of network-wide routing behavior to + * enforce. + */ + routingConfig: Schema$NetworkRoutingConfig; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in + * this network. + */ + subnetworks: string[]; + } + /** + * The network endpoint. + */ + export interface Schema$NetworkEndpoint { + /** + * The name for a specific VM instance that the IP address belongs to. This + * is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. + * The instance must be in the same zone of network endpoint group. The + * name must be 1-63 characters long, and comply with RFC1035. + */ + instance: string; + /** + * Optional IPv4 address of network endpoint. The IP address must belong to + * a VM in GCE (either the primary IP or as part of an aliased IP range). If + * the IP address is not specified, then the primary IP address for the VM + * instance in the network that the network endpoint group belongs to will + * be used. + */ + ipAddress: string; + /** + * Optional port number of network endpoint. If not specified and the + * NetworkEndpointGroup.network_endpoint_type is GCE_IP_PORT, the + * defaultPort for the network endpoint group will be used. + */ + port: number; + } + /** + * Represents a collection of network endpoints. + */ + export interface Schema$NetworkEndpointGroup { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#networkEndpointGroup + * for network endpoint group. + */ + kind: string; + /** + * This field is only valid when the network endpoint group type is + * LOAD_BALANCING. + */ + loadBalancer: Schema$NetworkEndpointGroupLbNetworkEndpointGroup; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Type of network endpoints in this network endpoint group. Only supported + * values for LOAD_BALANCING are GCE_VM_IP or GCE_VM_IP_PORT. + */ + networkEndpointType: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] Number of network endpoints in the network endpoint group. + */ + size: number; + /** + * Specify the type of this network endpoint group. Only LOAD_BALANCING is + * valid for now. + */ + type: string; + } + export interface Schema$NetworkEndpointGroupAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NetworkEndpointGroupsScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#networkEndpointGroupAggregatedList for aggregated lists of + * network endpoint groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Load balancing specific fields for network endpoint group of type + * LOAD_BALANCING. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$NetworkEndpointGroupLbNetworkEndpointGroup { + /** + * The default port used if the port number is not specified in the network + * endpoint. If the network endpoint type is GCE_VM_IP, this field must not + * be specified. + */ + defaultPort: number; + /** + * The URL of the network to which all network endpoints in the NEG belong. + * Uses "default" project network if unspecified. + */ + network: string; + /** + * Optional URL of the subnetwork to which all network endpoints in the NEG + * belong. + */ + subnetwork: string; + /** + * [Output Only] The URL of the zone where the network endpoint group is + * located. + */ + zone: string; + } + export interface Schema$NetworkEndpointGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NetworkEndpointGroup resources. + */ + items: Schema$NetworkEndpointGroup[]; + /** + * [Output Only] The resource type, which is always + * compute#networkEndpointGroupList for network endpoint group lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$NetworkEndpointGroupsAttachEndpointsRequest { + /** + * The list of network endpoints to be attached. + */ + networkEndpoints: Schema$NetworkEndpoint[]; + } + export interface Schema$NetworkEndpointGroupsDetachEndpointsRequest { + /** + * The list of network endpoints to be detached. + */ + networkEndpoints: Schema$NetworkEndpoint[]; + } + export interface Schema$NetworkEndpointGroupsListEndpointsRequest { + /** + * Optional query parameter for showing the health status of each network + * endpoint. Valid options are SKIP or SHOW. If you don't specifiy this + * parameter, the health status of network endpoints will not be provided. + */ + healthStatus: string; + } + export interface Schema$NetworkEndpointGroupsListNetworkEndpoints { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NetworkEndpointWithHealthStatus resources. + */ + items: Schema$NetworkEndpointWithHealthStatus[]; + /** + * [Output Only] The resource type, which is always + * compute#networkEndpointGroupsListNetworkEndpoints for the list of network + * endpoints in the specified network endpoint group. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$NetworkEndpointGroupsScopedList { + /** + * [Output Only] The list of network endpoint groups that are contained in + * this scope. + */ + networkEndpointGroups: Schema$NetworkEndpointGroup[]; + /** + * [Output Only] An informational warning that replaces the list of network + * endpoint groups when the list is empty. + */ + warning: any; + } + export interface Schema$NetworkEndpointWithHealthStatus { + /** + * [Output only] The health status of network endpoint; + */ + healths: Schema$HealthStatusForNetworkEndpoint[]; + /** + * [Output only] The network endpoint; + */ + networkEndpoint: Schema$NetworkEndpoint; + } + /** + * A network interface resource attached to an instance. + */ + export interface Schema$NetworkInterface { + /** + * An array of configurations for this interface. Currently, only one access + * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs + * specified, then this instance will have no external internet access. + */ + accessConfigs: Schema$AccessConfig[]; + /** + * An array of alias IP ranges for this network interface. Can only be + * specified for network interfaces on subnet-mode networks. + */ + aliasIpRanges: Schema$AliasIpRange[]; + /** + * Fingerprint hash of contents stored in this network interface. This field + * will be ignored when inserting an Instance or adding a NetworkInterface. + * An up-to-date fingerprint must be provided in order to update the + * NetworkInterface. + */ + fingerprint: string; + /** + * [Output Only] Type of the resource. Always compute#networkInterface for + * network interfaces. + */ + kind: string; + /** + * [Output Only] The name of the network interface, generated by the server. + * For network devices, these are eth0, eth1, etc. + */ + name: string; + /** + * URL of the network resource for this instance. When creating an instance, + * if neither the network nor the subnetwork is specified, the default + * network global/networks/default is used; if the network is not specified + * but the subnetwork is specified, the network is inferred. This field is + * optional when creating a firewall rule. If not specified when creating a + * firewall rule, the default network global/networks/default is used. If + * you specify this property, you can specify the network as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/global/networks/network + * - projects/project/global/networks/network - global/networks/default + */ + network: string; + /** + * An IPv4 internal network address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + */ + networkIP: string; + /** + * The URL of the Subnetwork resource for this instance. If the network + * resource is in legacy mode, do not provide this property. If the network + * is in auto subnet mode, providing the subnetwork is optional. If the + * network is in custom subnet mode, then this field should be specified. If + * you specify this property, you can specify the subnetwork as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + * - regions/region/subnetworks/subnetwork + */ + subnetwork: string; + } + /** + * Contains a list of networks. + */ + export interface Schema$NetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Network resources. + */ + items: Schema$Network[]; + /** + * [Output Only] Type of resource. Always compute#networkList for lists of + * networks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A network peering attached to a network resource. The message includes the + * peering name, peer network, peering state, and a flag indicating whether + * Google Compute Engine should automatically create routes for the peering. + */ + export interface Schema$NetworkPeering { + /** + * Whether full mesh connectivity is created and managed automatically. When + * it is set to true, Google Compute Engine will automatically create and + * manage the routes between two networks when the state is ACTIVE. + * Otherwise, user needs to create routes manually to route packets to peer + * network. + */ + autoCreateRoutes: boolean; + /** + * Name of this peering. Provided by the client when the peering is created. + * The name must comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all the + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + */ + name: string; + /** + * The URL of the peer network. It can be either full URL or partial URL. + * The peer network may belong to a different project. If the partial URL + * does not contain project, it is assumed that the peer network is in the + * same project as the current network. + */ + network: string; + /** + * [Output Only] State for the peering. + */ + state: string; + /** + * [Output Only] Details about the current state of the peering. + */ + stateDetails: string; + } + /** + * A routing configuration attached to a network resource. The message + * includes the list of routers associated with the network, and a flag + * indicating the type of routing behavior to enforce network-wide. + */ + export interface Schema$NetworkRoutingConfig { + /** + * The network-wide routing mode to use. If set to REGIONAL, this + * network's cloud routers will only advertise routes with subnetworks + * of this network in the same region as the router. If set to GLOBAL, this + * network's cloud routers will advertise routes with all subnetworks of + * this network, across regions. + */ + routingMode: string; + } + export interface Schema$NetworksAddPeeringRequest { + /** + * Whether Google Compute Engine manages the routes automatically. + */ + autoCreateRoutes: boolean; + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + /** + * URL of the peer network. It can be either full URL or partial URL. The + * peer network may belong to a different project. If the partial URL does + * not contain project, it is assumed that the peer network is in the same + * project as the current network. + */ + peerNetwork: string; + } + export interface Schema$NetworksRemovePeeringRequest { + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + } + /** + * A NodeGroup resource. + */ + export interface Schema$NodeGroup { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#nodeGroup for node + * group. + */ + kind: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * [Output Only] A list of nodes in this node group. + */ + nodes: Schema$NodeGroupNode[]; + /** + * The URL of the node template to which this node group belongs. + */ + nodeTemplate: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + status: string; + /** + * [Output Only] The name of the zone where the node group resides, such as + * us-central1-a. + */ + zone: string; + } + export interface Schema$NodeGroupAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeGroupsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource.Always compute#nodeGroupAggregatedList for + * aggregated lists of node groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of nodeGroups. + */ + export interface Schema$NodeGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeGroup resources. + */ + items: Schema$NodeGroup[]; + /** + * [Output Only] Type of resource.Always compute#nodeGroupList for lists of + * node groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$NodeGroupNode { + index: number; + /** + * Instances scheduled on this node. + */ + instances: string[]; + /** + * The type of this node. + */ + nodeType: string; + } + export interface Schema$NodeGroupsAddNodesRequest { + /** + * Count of additional nodes to be added to the node group. + */ + additionalNodeCount: number; + } + export interface Schema$NodeGroupsDeleteNodesRequest { + /** + * Indexes of the nodes to be deleted from the node group. + */ + nodeIndexes: number[]; + } + export interface Schema$NodeGroupsScopedList { + /** + * [Output Only] A list of node groups contained in this scope. + */ + nodeGroups: Schema$NodeGroup[]; + /** + * [Output Only] An informational warning that appears when the nodeGroup + * list is empty. + */ + warning: any; + } + export interface Schema$NodeGroupsSetNodeTemplateRequest { + /** + * Full or partial URL of the node template resource to be updated for this + * node group. + */ + nodeTemplate: string; + } + /** + * A Node Template resource. + */ + export interface Schema$NodeTemplate { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#nodeTemplate for + * node templates. + */ + kind: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last charaicter, + * which cannot be a dash. + */ + name: string; + /** + * Labels to use for node affinity, which will be used in instance + * scheduling. + */ + nodeAffinityLabels: any; + /** + * The node type to use for nodes group that are created from this template. + */ + nodeType: string; + /** + * The flexible properties of the desired node type. Node groups that use + * this node template will create nodes of a type that matches these + * properties. This field is mutually exclusive with the node_type + * property; you can only define one or the other, but not both. + */ + nodeTypeFlexibility: Schema$NodeTemplateNodeTypeFlexibility; + /** + * [Output Only] The name of the region where the node template resides, + * such as us-central1. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the node template. One of the following + * values: CREATING, READY, and DELETING. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + } + export interface Schema$NodeTemplateAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeTemplatesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource.Always compute#nodeTemplateAggregatedList + * for aggregated lists of node templates. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of node templates. + */ + export interface Schema$NodeTemplateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeTemplate resources. + */ + items: Schema$NodeTemplate[]; + /** + * [Output Only] Type of resource.Always compute#nodeTemplateList for lists + * of node templates. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$NodeTemplateNodeTypeFlexibility { + cpus: string; + localSsd: string; + memory: string; + } + export interface Schema$NodeTemplatesScopedList { + /** + * [Output Only] A list of node templates contained in this scope. + */ + nodeTemplates: Schema$NodeTemplate[]; + /** + * [Output Only] An informational warning that appears when the node + * templates list is empty. + */ + warning: any; + } + /** + * A Node Type resource. + */ + export interface Schema$NodeType { + /** + * [Output Only] The CPU platform used by this node type. + */ + cpuPlatform: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this node type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The number of virtual CPUs that are available to the node + * type. + */ + guestCpus: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#nodeType for node + * types. + */ + kind: string; + /** + * [Output Only] Local SSD available to the node type, defined in GB. + */ + localSsdGb: number; + /** + * [Output Only] The amount of physical memory available to the node type, + * defined in MB. + */ + memoryMb: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the node type resides, such as + * us-central1-a. + */ + zone: string; + } + export interface Schema$NodeTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource.Always compute#nodeTypeAggregatedList for + * aggregated lists of node types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of node types. + */ + export interface Schema$NodeTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of NodeType resources. + */ + items: Schema$NodeType[]; + /** + * [Output Only] Type of resource.Always compute#nodeTypeList for lists of + * node types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$NodeTypesScopedList { + /** + * [Output Only] A list of node types contained in this scope. + */ + nodeTypes: Schema$NodeType[]; + /** + * [Output Only] An informational warning that appears when the node types + * list is empty. + */ + warning: any; + } + /** + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; + } + export interface Schema$OperationAggregatedList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A map of scoped operation lists. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#operationAggregatedList + * for aggregated lists of operations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Operation resources. + */ + export interface Schema$OperationList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of Operation resources. + */ + items: Schema$Operation[]; + /** + * [Output Only] Type of resource. Always compute#operations for Operations + * resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$OperationsScopedList { + /** + * [Output Only] A list of operations contained in this scope. + */ + operations: Schema$Operation[]; + /** + * [Output Only] Informational warning which replaces the list of operations + * when the list is empty. + */ + warning: any; + } + /** + * A matcher for the path portion of the URL. The BackendService from the + * longest-matched rule will serve the URL. If no rule was matched, the + * default service will be used. + */ + export interface Schema$PathMatcher { + /** + * The full or partial URL to the BackendService resource. This will be used + * if none of the pathRules defined by this PathMatcher is matched by the + * URL's path portion. For example, the following are all valid URLs to + * a BackendService resource: - + * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + * - compute/v1/projects/project/global/backendServices/backendService - + * global/backendServices/backendService + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The name to which this PathMatcher is referred by the HostRule. + */ + name: string; + /** + * The list of path rules. + */ + pathRules: Schema$PathRule[]; + } + /** + * A path-matching rule for a URL. If matched, will use the specified + * BackendService to handle the traffic arriving at this URL. + */ + export interface Schema$PathRule { + /** + * The list of path patterns to match. Each must start with / and the only + * place a * is allowed is at the end following a /. The string fed to the + * path matcher does not include any text after the first ? or #, and those + * chars are not allowed here. + */ + paths: string[]; + /** + * The URL of the BackendService resource if this rule is matched. + */ + service: string; + } + export interface Schema$PerInstanceConfig { + /** + * The URL of the instance. Serves as a merge key during + * UpdatePerInstanceConfigs operation. + */ + instance: string; + override: Schema$ManagedInstanceOverride; + } + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { "role": + * "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } For a description of IAM and its + * features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + iamOwned: boolean; + /** + * If more than one rule is specified, the rules are applied in the + * following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be + * applied if one or more matching rule requires logging. - Otherwise, if + * any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging + * will be applied if one or more matching rule requires logging. - + * Otherwise, if no rule applies, permission is denied. + */ + rules: Schema$Rule[]; + /** + * Deprecated. + */ + version: number; + } + /** + * A Project resource. For an overview of projects, see Cloud Platform + * Resource Hierarchy. (== resource_for v1.projects ==) (== resource_for + * beta.projects ==) + */ + export interface Schema$Project { + /** + * Metadata key/value pairs available to all instances contained in this + * project. See Custom metadata for more information. + */ + commonInstanceMetadata: Schema$Metadata; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * This signifies the default network tier used for configuring resources of + * the project and can only take the following values: PREMIUM, STANDARD. + * Initially the default network tier is PREMIUM. + */ + defaultNetworkTier: string; + /** + * [Output Only] Default service account used by VMs running in this + * project. + */ + defaultServiceAccount: string; + /** + * An optional textual description of the resource. + */ + description: string; + /** + * Restricted features enabled for use on this project. + */ + enabledFeatures: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. This is not the project ID, and is just a unique + * ID used by Compute Engine to identify resources. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#project for projects. + */ + kind: string; + /** + * The project ID. For example: my-example-project. Use the project ID to + * make requests to Compute Engine. + */ + name: string; + /** + * [Output Only] Quotas assigned to this project. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The naming prefix for daily usage reports and the Google Cloud Storage + * bucket where they are stored. + */ + usageExportLocation: Schema$UsageExportLocation; + /** + * [Output Only] The role this project has in a shared VPC configuration. + * Currently only HOST projects are differentiated. + */ + xpnProjectStatus: string; + } + export interface Schema$ProjectsDisableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsEnableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsGetXpnResources { + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources + * for lists of service resources (a.k.a service projects) + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * Service resources (a.k.a service projects) attached to this project as + * their shared VPC host. + */ + resources: Schema$XpnResourceId[]; + } + export interface Schema$ProjectsListXpnHostsRequest { + /** + * Optional organization ID managed by Cloud Resource Manager, for which to + * list shared VPC host projects. If not specified, the organization will be + * inferred from the project. + */ + organization: string; + } + export interface Schema$ProjectsSetDefaultNetworkTierRequest { + /** + * Default network tier to be set. + */ + networkTier: string; + } + export interface Schema$ProjectsSetDefaultServiceAccountRequest { + /** + * Email address of the service account. + */ + email: string; + } + /** + * A quotas entry. + */ + export interface Schema$Quota { + /** + * [Output Only] Quota limit for this metric. + */ + limit: number; + /** + * [Output Only] Name of the quota metric. + */ + metric: string; + /** + * [Output Only] Current usage of this metric. + */ + usage: number; + } + /** + * Represents a reference to a resource. + */ + export interface Schema$Reference { + /** + * [Output Only] Type of the resource. Always compute#reference for + * references. + */ + kind: string; + /** + * A description of the reference type with no implied semantics. Possible + * values include: - MEMBER_OF + */ + referenceType: string; + /** + * URL of the resource which refers to the target. + */ + referrer: string; + /** + * URL of the resource to which this reference points. + */ + target: string; + } + /** + * Region resource. (== resource_for beta.regions ==) (== resource_for + * v1.regions ==) + */ + export interface Schema$Region { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this region. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#region for regions. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Quotas assigned to this region. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the region, either UP or DOWN. + */ + status: string; + /** + * [Output Only] A list of zones available in this region, in the form of + * resource URLs. + */ + zones: string[]; + } + /** + * Contains a list of autoscalers. + */ + export interface Schema$RegionAutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionDisksResizeRequest { + /** + * The new size of the regional persistent disk, which is specified in GB. + */ + sizeGb: string; + } + export interface Schema$RegionDiskTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskType resources. + */ + items: Schema$DiskType[]; + /** + * [Output Only] Type of resource. Always compute#regionDiskTypeList for + * region disk types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of InstanceGroup resources. + */ + export interface Schema$RegionInstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * RegionInstanceGroupManagers.deletePerInstanceConfigs + */ + export interface Schema$RegionInstanceGroupManagerDeleteInstanceConfigReq { + /** + * The list of instances for which we want to delete per-instance configs on + * this managed instance group. + */ + instances: string[]; + } + /** + * Contains a list of managed instance groups. + */ + export interface Schema$RegionInstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups + * that exist in th regional scope. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + /** + * InstanceGroupManagers.applyUpdatesToInstances + */ + export interface Schema$RegionInstanceGroupManagersApplyUpdatesRequest { + /** + * The list of instances for which we want to apply changes on this managed + * instance group. + */ + instances: string[]; + /** + * The maximal action that should be perfomed on the instances. By default + * REPLACE. + */ + maximalAction: string; + /** + * The minimal action that should be perfomed on the instances. By default + * NONE. + */ + minimalAction: string; + } + export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersListInstanceConfigsResp { + /** + * [Output Only] The list of PerInstanceConfig. + */ + items: Schema$PerInstanceConfig[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupManagersListInstancesResponse { + /** + * A list of managed instances. + */ + managedInstances: Schema$ManagedInstance[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + } + export interface Schema$RegionInstanceGroupManagersRecreateRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetAutoHealingRequest { + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + } + export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { + /** + * Fingerprint of the target pools information, which is a hash of the + * contents. This field is used for optimistic locking when you update the + * target pool entries. This field is optional. + */ + fingerprint: string; + /** + * The URL of all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { + /** + * URL of the InstanceTemplate resource from which all new instances will be + * created. + */ + instanceTemplate: string; + } + /** + * RegionInstanceGroupManagers.updatePerInstanceConfigs + */ + export interface Schema$RegionInstanceGroupManagerUpdateInstanceConfigReq { + /** + * The list of per-instance configs to insert or patch on this managed + * instance group. + */ + perInstanceConfigs: Schema$PerInstanceConfig[]; + } + export interface Schema$RegionInstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupsListInstancesRequest { + /** + * Instances in which state should be returned. Valid options are: + * 'ALL', 'RUNNING'. By default, it lists all instances. + */ + instanceState: string; + /** + * Name of port user is interested in. It is optional. If it is set, only + * information about this ports will be returned. If it is not set, all the + * named ports will be returned. Always lists all instances. + */ + portName: string; + } + export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of region resources. + */ + export interface Schema$RegionList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Region resources. + */ + items: Schema$Region[]; + /** + * [Output Only] Type of resource. Always compute#regionList for lists of + * regions. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash in order to update or + * change labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * The labels to set for this resource. + */ + labels: any; + } + export interface Schema$RegionUrlMapsValidateRequest { + /** + * Content of the UrlMap to be validated. + */ + resource: Schema$UrlMap; + } + /** + * Commitment for a particular resource (a Commitment is composed of one or + * more of these). + */ + export interface Schema$ResourceCommitment { + /** + * The amount of the resource purchased (in a type-dependent unit, such as + * bytes). For vCPUs, this can just be an integer. For memory, this must be + * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of + * memory per every vCPU. + */ + amount: string; + /** + * Type of resource for which this commitment applies. Possible values are + * VCPU and MEMORY + */ + type: string; + } + export interface Schema$ResourceGroupReference { + /** + * A URI referencing one of the instance groups listed in the backend + * service. + */ + group: string; + } + /** + * Represents a Route resource. A route specifies how certain packets should + * be handled by the network. Routes are associated with instances by tags and + * the set of routes for a particular instance is called its routing table. + * For each packet leaving an instance, the system searches that + * instance's routing table for a single best matching route. Routes match + * packets by destination IP address, preferring smaller or more specific + * ranges over larger ones. If there is a tie, the system selects the route + * with the smallest priority value. If there is still a tie, it uses the + * layer three and four packet headers to select just one of the remaining + * matching routes. The packet is then forwarded as specified by the nextHop + * field of the winning route - either to another instance destination, an + * instance gateway, or a Google Compute Engine-operated gateway. Packets + * that do not match any route in the sending instance's routing table are + * dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) + */ + export interface Schema$Route { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The destination range of outgoing packets that this route applies to. + * Only IPv4 is supported. + */ + destRange: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of this resource. Always compute#routes for Route + * resources. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Fully-qualified URL of the network that this route applies to. + */ + network: string; + /** + * The URL to a gateway that should handle matching packets. You can only + * specify the internet gateway using a full or partial valid URL: + * projects/<project-id>/global/gateways/default-internet-gateway + */ + nextHopGateway: string; + /** + * The URL to an instance that should handle matching packets. You can + * specify this as a full or partial URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + */ + nextHopInstance: string; + /** + * The network IP address of an instance that should handle matching + * packets. Only IPv4 is supported. + */ + nextHopIp: string; + /** + * The URL of the local network if it should handle matching packets. + */ + nextHopNetwork: string; + /** + * [Output Only] The network peering name that should handle matching + * packets, which should conform to RFC1035. + */ + nextHopPeering: string; + /** + * The URL to a VpnTunnel that should handle matching packets. + */ + nextHopVpnTunnel: string; + /** + * The priority of this route. Priority is used to break ties in cases where + * there is more than one matching route of equal prefix length. In the case + * of two routes with equal prefix length, the one with the lowest-numbered + * priority value wins. Default value is 1000. Valid range is 0 through + * 65535. + */ + priority: number; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * A list of instance tags to which this route applies. + */ + tags: string[]; + /** + * [Output Only] If potential misconfigurations are detected for this route, + * this field will be populated with warning messages. + */ + warnings: any[]; + } + /** + * Contains a list of Route resources. + */ + export interface Schema$RouteList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Route resources. + */ + items: Schema$Route[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Router resource. + */ + export interface Schema$Router { + /** + * BGP information specific to this router. + */ + bgp: Schema$RouterBgp; + /** + * BGP information that needs to be configured into the routing stack to + * establish the BGP peering. It must specify peer ASN and either interface + * name, IP, or peer IP. Please refer to RFC4273. + */ + bgpPeers: Schema$RouterBgpPeer[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Router interfaces. Each interface requires either one linked resource + * (e.g. linkedVpnTunnel), or IP address and IP address range (e.g. + * ipRange), or both. + */ + interfaces: Schema$RouterInterface[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A list of Nat services created in this router. The maximum number of Nat + * services within a Router is 3 for Alpha. + */ + nats: Schema$RouterNat[]; + /** + * URI of the network to which this router belongs. + */ + network: string; + /** + * [Output Only] URI of the region where the router resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Description-tagged IP ranges for the router to advertise. + */ + export interface Schema$RouterAdvertisedIpRange { + /** + * User-specified description for the IP range. + */ + description: string; + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + */ + range: string; + } + /** + * Description-tagged prefixes for the router to advertise. + */ + export interface Schema$RouterAdvertisedPrefix { + /** + * User-specified description for the prefix. + */ + description: string; + /** + * The prefix to advertise. The value must be a CIDR-formatted string. + */ + prefix: string; + } + /** + * Contains a list of routers. + */ + export interface Schema$RouterAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RouterBgp { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and is advertised + * to all peers of the router. These groups will be advertised in addition + * to any specified prefixes. Leave this field blank to advertise no custom + * groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and is + * advertised to all peers of the router. These IP ranges will be advertised + * in addition to any specified groups. Leave this field blank to advertise + * no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * User-specified list of individual prefixes to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and is + * advertised to all peers of the router. These prefixes will be advertised + * in addition to any specified groups. Leave this field blank to advertise + * no custom prefixes. + */ + advertisedPrefixs: Schema$RouterAdvertisedPrefix[]; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, + * either 16-bit or 32-bit. The value will be fixed for this router + * resource. All VPN tunnels that link to this router will have the same + * local ASN. + */ + asn: number; + } + export interface Schema$RouterBgpPeer { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and overrides the + * list defined for the router (in Bgp message). These groups will be + * advertised in addition to any specified prefixes. Leave this field blank + * to advertise no custom groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and + * overrides the list defined for the router (in Bgp message). These IP + * ranges will be advertised in addition to any specified groups. Leave this + * field blank to advertise no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * User-specified list of individual prefixes to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and + * overrides the list defined for the router (in Bgp message). These + * prefixes will be advertised in addition to any specified groups. Leave + * this field blank to advertise no custom prefixes. + */ + advertisedPrefixs: Schema$RouterAdvertisedPrefix[]; + /** + * The priority of routes advertised to this BGP peer. In the case where + * there is more than one matching route of maximum length, the routes with + * lowest priority value win. + */ + advertisedRoutePriority: number; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Name of the interface the BGP peer is associated with. + */ + interfaceName: string; + /** + * IP address of the interface inside Google Cloud Platform. Only IPv4 is + * supported. + */ + ipAddress: string; + /** + * [Output Only] Type of how the resource/configuration of the BGP peer is + * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT + * represents an BGP peer that is automatically created for PARTNER + * interconnectAttachment, Google will automatically create/delete this type + * of BGP peer when the PARTNER interconnectAttachment is created/deleted. + */ + managementType: string; + /** + * Name of this BGP peer. The name must be 1-63 characters long and comply + * with RFC1035. + */ + name: string; + /** + * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can + * be different for every tunnel. + */ + peerAsn: number; + /** + * IP address of the BGP interface outside Google cloud. Only IPv4 is + * supported. + */ + peerIpAddress: string; + } + export interface Schema$RouterInterface { + /** + * IP address and range of the interface. The IP range must be in the + * RFC3927 link-local IP space. The value must be a CIDR-formatted string, + * for example: 169.254.0.1/30. NOTE: Do not truncate the address as it + * represents the IP address of the interface. + */ + ipRange: string; + /** + * URI of the linked interconnect attachment. It must be in the same region + * as the router. Each interface can have at most one linked resource and it + * could either be a VPN Tunnel or an interconnect attachment. + */ + linkedInterconnectAttachment: string; + /** + * URI of the linked VPN tunnel. It must be in the same region as the + * router. Each interface can have at most one linked resource and it could + * either be a VPN Tunnel or an interconnect attachment. + */ + linkedVpnTunnel: string; + /** + * [Output Only] Type of how the resource/configuration of the interface is + * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT + * represents an interface that is automatically created for PARTNER type + * interconnectAttachment, Google will automatically create/update/delete + * this type of interface when the PARTNER interconnectAttachment is + * created/provisioned/deleted. + */ + managementType: string; + /** + * Name of this interface entry. The name must be 1-63 characters long and + * comply with RFC1035. + */ + name: string; + } + /** + * Contains a list of Router resources. + */ + export interface Schema$RouterList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: Schema$Router[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a Nat resource. It enables the VMs within the specified + * subnetworks to access Internet without external IP addresses. It specifies + * a list of subnetworks (and the ranges within) that want to use NAT. + * Customers can also provide the external IPs that would be used for NAT. GCP + * would auto-allocate ephemeral IPs if no external IPs are provided. + */ + export interface Schema$RouterNat { + /** + * [Output Only] A list of IPs allocated automatically by GCP for this Nat + * service. They will be raw IP strings like "179.12.26.133". They + * are ephemeral IPs allocated from the IP blocks managed by the NAT + * manager. This list can grow and shrink based on the number of VMs + * configured to use NAT. + */ + autoAllocatedNatIps: string[]; + /** + * Unique name of this Nat service. The name must be 1-63 characters long + * and comply with RFC1035. + */ + name: string; + /** + * Specify the NatIpAllocateOption. If it is AUTO_ONLY, then nat_ip should + * be empty. + */ + natIpAllocateOption: string; + /** + * A list of URLs of the IP resources used for this Nat service. These IPs + * must be valid static external IP addresses assigned to the project. + * max_length is subject to change post alpha. + */ + natIps: string[]; + /** + * Specify the Nat option. If this field contains + * ALL_SUBNETWORKS_ALL_IP_RANGES or ALL_SUBNETWORKS_ALL_PRIMARY_IP_RANGES, + * then there should not be any other Router.Nat section in any Router for + * this network in this region. + */ + sourceSubnetworkIpRangesToNat: string; + /** + * A list of Subnetwork resources whose traffic should be translated by NAT + * Gateway. It is used only when LIST_OF_SUBNETWORKS is selected for the + * SubnetworkIpRangeToNatOption above. + */ + subnetworks: Schema$RouterNatSubnetworkToNat[]; + } + /** + * Defines the IP ranges that want to use NAT for a subnetwork. + */ + export interface Schema$RouterNatSubnetworkToNat { + /** + * URL for the subnetwork resource to use NAT. + */ + name: string; + /** + * A list of the secondary ranges of the Subnetwork that are allowed to use + * NAT. This can be populated only if + * "LIST_OF_SECONDARY_IP_RANGES" is one of the values in + * source_ip_ranges_to_nat. + */ + secondaryIpRangeNames: string[]; + /** + * Specify the options for NAT ranges in the Subnetwork. All usages of + * single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only + * valid option with multiple values is: ["PRIMARY_IP_RANGE", + * "LIST_OF_SECONDARY_IP_RANGES"] Default: [ALL_IP_RANGES] + */ + sourceIpRangesToNats: string[]; + } + export interface Schema$RoutersPreviewResponse { + /** + * Preview of given router. + */ + resource: Schema$Router; + } + export interface Schema$RoutersScopedList { + /** + * A list of routers contained in this scope. + */ + routers: Schema$Router[]; + /** + * Informational warning which replaces the list of routers when the list is + * empty. + */ + warning: any; + } + export interface Schema$RouterStatus { + /** + * Best routes for this router's network. + */ + bestRoutes: Schema$Route[]; + /** + * Best routes learned by this router. + */ + bestRoutesForRouter: Schema$Route[]; + bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; + natStatus: Schema$RouterStatusNatStatus[]; + /** + * URI of the network to which this router belongs. + */ + network: string; + } + export interface Schema$RouterStatusBgpPeerStatus { + /** + * Routes that were advertised to the remote BGP peer + */ + advertisedRoutes: Schema$Route[]; + /** + * IP address of the local BGP interface. + */ + ipAddress: string; + /** + * URL of the VPN tunnel that this BGP peer controls. + */ + linkedVpnTunnel: string; + /** + * Name of this BGP peer. Unique within the Routers resource. + */ + name: string; + /** + * Number of routes learned from the remote BGP Peer. + */ + numLearnedRoutes: number; + /** + * IP address of the remote BGP interface. + */ + peerIpAddress: string; + /** + * BGP state as specified in RFC1771. + */ + state: string; + /** + * Status of the BGP peer: {UP, DOWN} + */ + status: string; + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 + * hours, 59 minutes, 59 seconds + */ + uptime: string; + /** + * Time this session has been up, in seconds. Format: 145 + */ + uptimeSeconds: string; + } + /** + * Status of a NAT contained in this router. + */ + export interface Schema$RouterStatusNatStatus { + /** + * A list of IPs auto-allocated for NAT. Example: ["1.1.1.1", + * "129.2.16.89"] + */ + autoAllocatedNatIps: string[]; + /** + * The number of extra IPs to allocate. This will be greater than 0 only if + * user-specified IPs are NOT enough to allow all configured VMs to use NAT. + * This value is meaningful only when auto-allocation of NAT IPs is *not* + * used. + */ + minExtraNatIpsNeeded: number; + /** + * Unique name of this NAT. + */ + name: string; + /** + * Number of VM endpoints (i.e., Nics) that can use NAT. + */ + numVmEndpointsWithNatMappings: number; + /** + * A list of fully qualified URLs of reserved IP address resources. + */ + userAllocatedNatIpResources: string[]; + /** + * A list of IPs user-allocated for NAT. They will be raw IP strings like + * "179.12.26.133". + */ + userAllocatedNatIps: string[]; + } + export interface Schema$RouterStatusResponse { + /** + * Type of resource. + */ + kind: string; + result: Schema$RouterStatus; + } + /** + * A rule to be applied in a Policy. + */ + export interface Schema$Rule { + /** + * Required + */ + action: string; + /** + * Additional restrictions that must be met. All conditions must pass for + * the rule to match. + */ + conditions: Schema$Condition[]; + /** + * Human-readable description of the rule. + */ + description: string; + /** + * If one or more 'in' clauses are specified, the rule matches if + * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + */ + ins: string[]; + /** + * The config returned to callers of tech.iam.IAM.CheckPolicy for any + * entries that match the LOG action. + */ + logConfigs: Schema$LogConfig[]; + /** + * If one or more 'not_in' clauses are specified, the rule matches + * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + */ + notIns: string[]; + /** + * A permission is a string of form '..' (e.g., + * 'storage.buckets.list'). A value of '*' matches all + * permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions: string[]; + } + /** + * Sets the scheduling options for an Instance. + */ + export interface Schema$Scheduling { + /** + * Specifies whether the instance should be automatically restarted if it is + * terminated by Compute Engine (not terminated by a user). You can only set + * the automatic restart option for standard instances. Preemptible + * instances cannot be automatically restarted. By default, this is set to + * true so an instance is automatically restarted if it is terminated by + * Compute Engine. + */ + automaticRestart: boolean; + /** + * A set of node affinity and anti-affinity. + */ + nodeAffinities: Schema$SchedulingNodeAffinity[]; + /** + * Defines the maintenance behavior for this instance. For standard + * instances, the default behavior is MIGRATE. For preemptible instances, + * the default and only possible behavior is TERMINATE. For more + * information, see Setting Instance Scheduling Options. + */ + onHostMaintenance: string; + /** + * Defines whether the instance is preemptible. This can only be set during + * instance creation, it cannot be set or changed after the instance has + * been created. + */ + preemptible: boolean; + } + /** + * Node Affinity: the configuration of desired nodes onto which this Instance + * could be scheduled. + */ + export interface Schema$SchedulingNodeAffinity { + /** + * Corresponds to the label key of Node resource. + */ + key: string; + /** + * Defines the operation of node selection. + */ + operator: string; + /** + * Corresponds to the label values of Node resource. + */ + values: string[]; + } + /** + * A security policy is comprised of one or more rules. It can also be + * associated with one or more 'targets'. + */ + export interface Schema$SecurityPolicy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Specifies a fingerprint for this resource, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. To + * see the latest fingerprint, make get() request to the security policy. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output only] Type of the resource. Always compute#securityPolicyfor + * security policies + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A list of rules that belong to this policy. There must always be a + * default rule (rule with priority 2147483647 and match "*"). If + * no rules are provided when creating a security policy, a default rule + * with action "allow" will be added. + */ + rules: Schema$SecurityPolicyRule[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$SecurityPolicyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SecurityPolicy resources. + */ + items: Schema$SecurityPolicy[]; + /** + * [Output Only] Type of resource. Always compute#securityPolicyList for + * listsof securityPolicies + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SecurityPolicyReference { securityPolicy: string; } + /** + * Represents a rule that describes one or more match conditions along with + * the action to be taken when traffic matches this condition (allow or deny). + */ + export interface Schema$SecurityPolicyRule { + /** + * The Action to preform when the client connection triggers the rule. Can + * currently be either "allow" or "deny()" where valid + * values for status are 403, 404, and 502. + */ + action: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output only] Type of the resource. Always compute#securityPolicyRule for + * security policy rules + */ + kind: string; + /** + * A match condition that incoming traffic is evaluated against. If it + * evaluates to true, the corresponding ?action? is enforced. + */ + match: Schema$SecurityPolicyRuleMatcher; + /** + * If set to true, the specified action is not enforced. + */ + preview: boolean; + /** + * An integer indicating the priority of a rule in the list. The priority + * must be a positive value between 0 and 2147483647. Rules are evaluated in + * the increasing order of priority. + */ + priority: number; + } + /** + * Represents a match condition that incoming traffic is evaluated against. + * Exactly one field must be specified. + */ + export interface Schema$SecurityPolicyRuleMatcher { + /** + * The configuration options available when specifying versioned_expr. This + * field must be specified if versioned_expr is specified and cannot be + * specified if versioned_expr is not specified. + */ + config: Schema$SecurityPolicyRuleMatcherConfig; + /** + * User defined CEVAL expression. A CEVAL expression is used to specify + * match criteria such as origin.ip, source.region_code and contents in the + * request header. + */ + expr: Schema$Expr; + /** + * CIDR IP address range. + */ + srcIpRanges: string[]; + /** + * Preconfigured versioned expression. If this field is specified, config + * must also be specified. Available preconfigured expressions along with + * their requirements are: SRC_IPS_V1 - must specify the corresponding + * src_ip_range field in config. + */ + versionedExpr: string; + } + export interface Schema$SecurityPolicyRuleMatcherConfig { + /** + * CIDR IP address range. + */ + srcIpRanges: string[]; + } + /** + * An instance's serial console output. + */ + export interface Schema$SerialPortOutput { + /** + * [Output Only] The contents of the console output. + */ + contents: string; + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for + * serial port output. + */ + kind: string; + /** + * [Output Only] The position of the next byte of content from the serial + * console output. Use this value in the next request as the start + * parameter. + */ + next: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * The starting byte position of the output that was returned. This should + * match the start parameter sent with the request. If the serial console + * output exceeds the size of the buffer, older output will be overwritten + * by newer content and the start values will be mismatched. + */ + start: string; + } + /** + * A service account. + */ + export interface Schema$ServiceAccount { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + /** + * A set of Shielded VM options. + */ + export interface Schema$ShieldedVmConfig { + /** + * Defines whether the instance should have integrity monitoring enabled. + */ + enableIntegrityMonitoring: boolean; + /** + * Defines whether the instance should have secure boot enabled. + */ + enableSecureBoot: boolean; + /** + * Defines whether the instance should have the TPM enabled. + */ + enableVtpm: boolean; + } + /** + * The policy describes how boot integrity measurements are evaluated. + */ + export interface Schema$ShieldedVmIntegrityPolicy { + /** + * Triggers an auto relearn event: the integrity monitoring module copies + * existing guest measurements to the baseline. + */ + updateAutoLearnPolicy: boolean; + } + /** + * Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs + */ + export interface Schema$SignedUrlKey { + /** + * Name of the key. The name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match + * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ + keyName: string; + /** + * 128-bit key value used for signing the URL. The key value must be a valid + * RFC 4648 Section 5 base64url encoded string. + */ + keyValue: string; + } + /** + * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) + * (== resource_for v1.snapshots ==) + */ + export interface Schema$Snapshot { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Size of the snapshot, specified in GB. + */ + diskSizeGb: string; + /** + * [Output Only] A list of features to enable on the guest operating system. + * Applicable only for bootable images. Read Enabling guest operating + * system features to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot + * resources. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this snapshot, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a snapshot. + */ + labelFingerprint: string; + /** + * Labels to apply to this snapshot. These can be later modified by the + * setLabels method. Label values may be empty. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * snapshot. + */ + licenseCodes: string[]; + /** + * [Output Only] A list of public visible licenses that apply to this + * snapshot. This can be because the original image had licenses attached + * (such as a Windows image). + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Encrypts the snapshot using a customer-supplied encryption key. After + * you encrypt a snapshot using a customer-supplied key, you must provide + * the same key if you use the image later For example, you must provide the + * encryption key when you create a disk from the encrypted snapshot in a + * future request. Customer-supplied encryption keys do not protect access + * to metadata of the disk. If you do not provide an encryption key when + * creating the snapshot, then the snapshot will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the snapshot later. + */ + snapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The source disk used to create this snapshot. + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This + * value may be used to determine whether the snapshot was taken from the + * current or a previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, + * FAILED, READY, or UPLOADING. + */ + status: string; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots + * share storage, this number is expected to change with snapshot + * creation/deletion. + */ + storageBytes: string; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or + * it is being adjusted as a result of shared storage reallocation. This + * status can either be UPDATING, meaning the size of the snapshot is being + * updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + */ + storageBytesStatus: string; + /** + * GCS bucket storage location of the snapshot (regional or multi-regional). + */ + storageLocations: string[]; + } + /** + * Contains a list of Snapshot resources. + */ + export interface Schema$SnapshotList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Snapshot resources. + */ + items: Schema$Snapshot[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A specification of the parameters to use when creating the instance + * template from a source instance. + */ + export interface Schema$SourceInstanceParams { + /** + * Attached disks configuration. If not provided, defaults are applied: For + * boot disk and any other R/W disks, new custom images will be created from + * each disk. For read-only disks, they will be attached in read-only mode. + * Local SSD disks will be created as blank volumes. + */ + diskConfigs: Schema$DiskInstantiationConfig[]; + } + /** + * An SslCertificate resource. This resource provides a mechanism to upload an + * SSL key and certificate to the load balancer to serve secure connections + * from the user. (== resource_for beta.sslCertificates ==) (== resource_for + * v1.sslCertificates ==) + */ + export interface Schema$SslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The + * certificate chain must be no greater than 5 certs long. The chain must + * include at least one intermediate cert. + */ + certificate: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Expire time of the certificate. RFC3339 + */ + expireTime: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL + * certificates. + */ + kind: string; + /** + * Configuration and status of a managed SSL certificate. + */ + managed: Schema$SslCertificateManagedSslCertificate; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A write-only private key in PEM format. Only insert requests will include + * this field. + */ + privateKey: string; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Configuration and status of a self-managed SSL certificate. + */ + selfManaged: Schema$SslCertificateSelfManagedSslCertificate; + /** + * [Output Only] Domains associated with the certificate via Subject + * Alternative Name. + */ + subjectAlternativeNames: string[]; + /** + * (Optional) Specifies the type of SSL certificate, either + * "SELF_MANAGED" or "MANAGED". If not specified, the + * certificate is self-managed and the fields certificate and private_key + * are used. + */ + type: string; + } + /** + * Contains a list of SslCertificate resources. + */ + export interface Schema$SslCertificateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslCertificate resources. + */ + items: Schema$SslCertificate[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zoneOperations.get - * @desc Retrieves the specified zone-specific Operations resource. - * @alias compute.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration and status of a managed SSL certificate. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SslCertificateManagedSslCertificate { + /** + * The domains for which a managed SSL certificate will be generated. + * Currently only single-domain certs are supported. + */ + domains: string[]; + /** + * [Output only] Detailed statuses of the domains specified for managed + * certificate resource. + */ + domainStatus: any; + /** + * [Output only] Status of the managed certificate resource. + */ + status: string; } - - /** - * compute.zoneOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified zone. - * @alias compute.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration and status of a self-managed SSL certificate. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/alpha/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Zones { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SslCertificateSelfManagedSslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The + * certificate chain must be no greater than 5 certs long. The chain must + * include at least one intermediate cert. + */ + certificate: string; + /** + * A write-only private key in PEM format. Only insert requests will include + * this field. + */ + privateKey: string; + } + export interface Schema$SSLHealthCheck { + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies how port is selected for health checking, can be one of + * following values: USE_FIXED_PORT: The port number in port is used for + * health checking. USE_NAMED_PORT: The portName is used for health + * checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified + * for each network endpoint is used for health checking. For other + * backends, the port or named port specified in the Backend Service is used + * for health checking. If not specified, SSL health check follows + * behavior specified in port and portName fields. + */ + portSpecification: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the SSL connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$SslPoliciesList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslPolicy resources. + */ + items: Schema$SslPolicy[]; + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for + * lists of sslPolicies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SslPoliciesListAvailableFeaturesResponse { + features: string[]; + } + /** + * A SSL policy specifies the server-side support for SSL features. This can + * be attached to a TargetHttpsProxy or a TargetSslProxy. This affects + * connections between clients and the HTTPS or SSL proxy load balancer. They + * do not affect the connection between the load balancers and the backends. + */ + export interface Schema$SslPolicy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * A list of features enabled when the selected profile is CUSTOM. The - + * method returns the set of features that can be specified in this list. + * This field must be empty if the profile is not CUSTOM. + */ + customFeatures: string[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The list of features enabled in the SSL policy. + */ + enabledFeatures: string[]; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a SslPolicy. An up-to-date fingerprint must be + * provided in order to update the SslPolicy. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL + * policies. + */ + kind: string; + /** + * The minimum version of SSL protocol that can be used by the clients to + * establish a connection with the load balancer. This can be one of + * TLS_1_0, TLS_1_1, TLS_1_2. + */ + minTlsVersion: string; + /** + * Name of the resource. The name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * Profile specifies the set of SSL features that can be used by the load + * balancer when negotiating SSL with clients. This can be one of + * COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of + * SSL features to enable must be specified in the customFeatures field. + */ + profile: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] If potential misconfigurations are detected for this SSL + * policy, this field will be populated with warning messages. + */ + warnings: any[]; + } + export interface Schema$SslPolicyReference { + /** + * URL of the SSL policy resource. Set this to empty string to clear any + * existing SSL policy associated with the target proxy resource. + */ + sslPolicy: string; + } + export interface Schema$StatefulPolicy { + preservedResources: Schema$StatefulPolicyPreservedResources; + } + export interface Schema$StatefulPolicyPreservedDisk { + /** + * Device name of the disk to be preserved + */ + deviceName: string; + } + /** + * Configuration of all preserved resources. + */ + export interface Schema$StatefulPolicyPreservedResources { + /** + * Disks created on the instances that will be preserved on instance delete, + * resize down, etc. + */ + disks: Schema$StatefulPolicyPreservedDisk[]; + } + /** + * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) + */ + export interface Schema$Subnetwork { + /** + * Whether this subnetwork can conflict with static routes. Setting this to + * true allows this subnetwork's primary and secondary ranges to + * conflict with routes that have already been configured on the + * corresponding network. Static routes will take precedence over the + * subnetwork route if the route prefix length is at least as large as the + * subnetwork prefix length. Also, packets destined to IPs within + * subnetwork may contain private/sensitive data and are prevented from + * leaving the virtual network. Setting this field to true will disable this + * feature. The default value is false and applies to all existing + * subnetworks and automatically created subnetworks. This field cannot be + * set to true at resource creation time. + */ + allowSubnetCidrRoutesOverlap: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. This field can be set only at resource creation + * time. + */ + description: string; + /** + * Whether to enable flow logging for this subnetwork. + */ + enableFlowLogs: boolean; + /** + * Whether the VMs in this subnet can directly access Google services via + * internal IPv6 addresses. This field can be both set at resource creation + * time and updated using patch. + */ + enablePrivateV6Access: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a Subnetwork. An up-to-date fingerprint must be + * provided in order to update the Subnetwork. + */ + fingerprint: string; + /** + * [Output Only] The gateway address for default routes to reach destination + * addresses outside this subnetwork. + */ + gatewayAddress: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are owned by this subnetwork. + * Provide this property when you create the subnetwork. For + * example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + * non-overlapping within a network. Only IPv4 is supported. This field can + * be set only at resource creation time. + */ + ipCidrRange: string; + /** + * [Output Only] The range of internal IPv6 addresses that are owned by this + * subnetwork. + */ + ipv6CidrRange: string; + /** + * [Output Only] Type of the resource. Always compute#subnetwork for + * Subnetwork resources. + */ + kind: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match + * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ + name: string; + /** + * The URL of the network to which this subnetwork belongs, provided by the + * client when initially creating the subnetwork. Only networks that are in + * the distributed mode can have subnetworks. This field can be set only at + * resource creation time. + */ + network: string; + /** + * Whether the VMs in this subnet can access Google services without + * assigned external IP addresses. This field can be both set at resource + * creation time and updated using setPrivateIpGoogleAccess. + */ + privateIpGoogleAccess: boolean; + /** + * The purpose of the resource. This field can be either PRIVATE_RFC_1918 or + * INTERNAL_HTTPS_LOAD_BALANCER. A subnetwork with purpose set to + * INTERNAL_HTTPS_LOAD_BALANCER is a user-created subnetwork that is + * reserved for Internal HTTP(S) Load Balancing. If unspecified, the purpose + * defaults to PRIVATE_RFC_1918. + */ + purpose: string; + /** + * URL of the region where the Subnetwork resides. This field can be set + * only at resource creation time. + */ + region: string; + /** + * The role of subnetwork. Currenly, this field is only used when purpose = + * INTERNAL_HTTPS_LOAD_BALANCER. The value can be set to ACTIVE or BACKUP. + * An ACTIVE subnetwork is one that is currently being used for Internal + * HTTP(S) Load Balancing. A BACKUP subnetwork is one that is ready to be + * promoted to ACTIVE or is currently draining. + */ + role: string; + /** + * An array of configurations for secondary IP ranges for VM instances + * contained in this subnetwork. The primary IP of such VM must belong to + * the primary ipCidrRange of the subnetwork. The alias IPs may belong to + * either primary or secondary ranges. + */ + secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$SubnetworkAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SubnetworksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList + * for aggregated lists of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Subnetwork resources. + */ + export interface Schema$SubnetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Subnetwork resources. + */ + items: Schema$Subnetwork[]; + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists + * of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a secondary IP range of a subnetwork. + */ + export interface Schema$SubnetworkSecondaryRange { + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * Provide this property when you create the subnetwork. Ranges must be + * unique and non-overlapping with all primary and secondary IP ranges + * within a network. Only IPv4 is supported. + */ + ipCidrRange: string; + /** + * The name associated with this subnetwork secondary range, used when + * adding an alias IP range to a VM instance. The name must be 1-63 + * characters long, and comply with RFC1035. The name must be unique within + * the subnetwork. + */ + rangeName: string; + } + export interface Schema$SubnetworksExpandIpCidrRangeRequest { + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal + * on this Subnetwork. This range should be disjoint from other subnetworks + * within this network. This range can only be larger than (i.e. a superset + * of) the range previously defined before the update. + */ + ipCidrRange: string; + } + export interface Schema$SubnetworksScopedList { + /** + * A list of subnetworks contained in this scope. + */ + subnetworks: Schema$Subnetwork[]; + /** + * An informational warning that appears when the list of addresses is + * empty. + */ + warning: any; + } + export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { + privateIpGoogleAccess: boolean; + } + /** + * A set of instance tags. + */ + export interface Schema$Tags { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. To + * see the latest fingerprint, make get() request to the instance. + */ + fingerprint: string; + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with + * RFC1035. + */ + items: string[]; + } + export interface Schema$TargetHttpProxiesScopedList { + /** + * A list of TargetHttpProxies contained in this scope. + */ + targetHttpProxies: Schema$TargetHttpProxy[]; + /** + * Informational warning which replaces the list of backend services when + * the list is empty. + */ + warning: any; + } + /** + * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== + * resource_for beta.targetHttpProxies ==) (== resource_for + * v1.targetHttpProxies ==) + */ + export interface Schema$TargetHttpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target + * HTTP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the regional Target HTTP Proxy + * resides. This field is not applicable to global Target HTTP Proxies. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the UrlMap resource that defines the mapping from URL to the + * BackendService. + */ + urlMap: string; + } + export interface Schema$TargetHttpProxyAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpProxiesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#targetHttpProxyAggregatedList for lists of Target HTTP Proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zones.get - * @desc Returns the specified Zone resource. Get a list of available zones by - * making a list() request. - * @alias compute.zones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of TargetHttpProxy resources. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/zones/{zone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TargetHttpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpProxy resources. + */ + items: Schema$TargetHttpProxy[]; + /** + * Type of resource. Always compute#targetHttpProxyList for lists of target + * HTTP proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetHttpsProxiesSetQuicOverrideRequest { + /** + * QUIC policy for the TargetHttpsProxy resource. + */ + quicOverride: string; + } + export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { + /** + * New set of SslCertificate resources to associate with this + * TargetHttpsProxy resource. Currently exactly one SslCertificate resource + * must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== + * resource_for beta.targetHttpsProxies ==) (== resource_for + * v1.targetHttpsProxies ==) + */ + export interface Schema$TargetHttpsProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for + * target HTTPS proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the QUIC override policy for this TargetHttpsProxy resource. + * This determines whether the load balancer will attempt to negotiate QUIC + * with clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify + * ENABLE to always enable QUIC, Enables QUIC when set to ENABLE, and + * disables QUIC when set to DISABLE. If NONE is specified, uses the QUIC + * policy with no user overrides, which is equivalent to DISABLE. Not + * specifying this field is equivalent to specifying NONE. + */ + quicOverride: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections between users and the load balancer. Currently, exactly one + * SSL certificate must be specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the + * TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will + * not have any SSL policy configured. + */ + sslPolicy: string; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that + * defines the mapping from URL to the BackendService. For example, the + * following are all valid URLs for specifying a URL map: - + * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + */ + urlMap: string; + } + /** + * Contains a list of TargetHttpsProxy resources. + */ + export interface Schema$TargetHttpsProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpsProxy resources. + */ + items: Schema$TargetHttpsProxy[]; + /** + * Type of resource. Always compute#targetHttpsProxyList for lists of target + * HTTPS proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A TargetInstance resource. This resource defines an endpoint instance that + * terminates traffic of certain protocols. (== resource_for + * beta.targetInstances ==) (== resource_for v1.targetInstances ==) + */ + export interface Schema$TargetInstance { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A URL to the virtual machine instance that handles traffic for this + * target instance. When creating a target instance, you can provide the + * fully-qualified URL or a valid partial URL to the desired virtual + * machine. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + instance: string; + /** + * [Output Only] The type of the resource. Always compute#targetInstance for + * target instances. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * NAT option controlling how IPs are NAT'ed to the instance. Currently + * only NO_NAT (default value) is supported. + */ + natPolicy: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] URL of the zone where the target instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$TargetInstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetInstance resources. + */ + export interface Schema$TargetInstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: Schema$TargetInstance[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetInstancesScopedList { + /** + * A list of target instances contained in this scope. + */ + targetInstances: Schema$TargetInstance[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * A TargetPool resource. This resource defines a pool of instances, an + * associated HttpHealthCheck resource, and the fallback target pool. (== + * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) + */ + export interface Schema$TargetPool { + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool, and its failoverRatio field is + * properly set to a value between [0, 1]. backupPool and failoverRatio + * together define the fallback behavior of the primary target pool: if the + * ratio of the healthy instances in the primary pool is at or below + * failoverRatio, traffic arriving at the load-balanced IP will be directed + * to the backup pool. In case where failoverRatio and backupPool are not + * set, or all the instances in the backup pool are unhealthy, the traffic + * will be directed back to the primary pool in the "force" mode, + * where traffic will be spread to the healthy instances with the best + * effort, or to all instances when no instance is healthy. + */ + backupPool: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool (i.e., not as a backup pool to some + * other target pool). The value of the field must be in [0, 1]. If set, + * backupPool must also be set. They together define the fallback behavior + * of the primary target pool: if the ratio of the healthy instances in the + * primary pool is at or below this number, traffic arriving at the + * load-balanced IP will be directed to the backup pool. In case where + * failoverRatio is not set or all the instances in the backup pool are + * unhealthy, the traffic will be directed back to the primary pool in the + * "force" mode, where traffic will be spread to the healthy + * instances with the best effort, or to all instances when no instance is + * healthy. + */ + failoverRatio: number; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool + * is considered healthy if and only if the health checks pass. An empty + * list means all member instances will be considered healthy at all times. + * Only HttpHealthChecks are supported. Only one health check may be + * specified. + */ + healthChecks: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A list of resource URLs to the virtual machine instances serving this + * pool. They must live in zones contained in the same region as this pool. + */ + instances: string[]; + /** + * [Output Only] Type of the resource. Always compute#targetPool for target + * pools. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the target pool resides. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Sesssion affinity option, must be one of the following values: NONE: + * Connections from the same client IP may go to any instance in the pool. + * CLIENT_IP: Connections from the same client IP will go to the same + * instance in the pool while that instance remains healthy. + * CLIENT_IP_PROTO: Connections from the same client IP with the same IP + * protocol will go to the same instance in the pool while that instance + * remains healthy. + */ + sessionAffinity: string; + } + export interface Schema$TargetPoolAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList + * for aggregated lists of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolInstanceHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth + * when checking the health of an instance. + */ + kind: string; + } + /** + * Contains a list of TargetPool resources. + */ + export interface Schema$TargetPoolList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: Schema$TargetPool[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists + * of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolsAddHealthCheckRequest { + /** + * The HttpHealthCheck to add to the target pool. + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsAddInstanceRequest { + /** + * A full or partial URL to an instance to add to this target pool. This can + * be a full or partial URL. For example, the following are valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + * - projects/project-id/zones/zone/instances/instance-name - + * zones/zone/instances/instance-name + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsRemoveHealthCheckRequest { + /** + * Health check URL to be removed. This can be a full or valid partial URL. + * For example, the following are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + * - projects/project/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsRemoveInstanceRequest { + /** + * URLs of the instances to be removed from target pool. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsScopedList { + /** + * A list of target pools contained in this scope. + */ + targetPools: Schema$TargetPool[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$TargetReference { target: string; } + export interface Schema$TargetSslProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetSslProxy. + */ + service: string; + } + export interface Schema$TargetSslProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + export interface Schema$TargetSslProxiesSetSslCertificatesRequest { + /** + * New set of URLs to SslCertificate resources to associate with this + * TargetSslProxy. Currently exactly one ssl certificate must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetSslProxy resource. This resource defines an SSL proxy. (== + * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies + * ==) + */ + export interface Schema$TargetSslProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for + * target SSL proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections to Backends. Currently exactly one SSL certificate must be + * specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy + * resource. If not set, the TargetSslProxy resource will not have any SSL + * policy configured. + */ + sslPolicy: string; + } + /** + * Contains a list of TargetSslProxy resources. + */ + export interface Schema$TargetSslProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetSslProxy resources. + */ + items: Schema$TargetSslProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetTcpProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetTcpProxy. + */ + service: string; + } + export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + /** + * A TargetTcpProxy resource. This resource defines a TCP proxy. (== + * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies + * ==) + */ + export interface Schema$TargetTcpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for + * target TCP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + } + /** + * Contains a list of TargetTcpProxy resources. + */ + export interface Schema$TargetTcpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetTcpProxy resources. + */ + items: Schema$TargetTcpProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a Target VPN gateway resource. (== resource_for + * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) + */ + export interface Schema$TargetVpnGateway { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. + * ForwardingRules are created using compute.forwardingRules.insert and + * associated to a VPN gateway. + */ + forwardingRules: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this TargetVpnGateway, + * which is essentially a hash of the labels set used for optimistic + * locking. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always + * provide an up-to-date fingerprint hash in order to update or change + * labels. To see the latest fingerprint, make a get() request to retrieve + * an TargetVpnGateway. + */ + labelFingerprint: string; + /** + * Labels to apply to this TargetVpnGateway resource. These can be later + * modified by the setLabels method. Each label key/value must comply with + * RFC1035. Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network to which this VPN gateway is attached. Provided by the + * client when the VPN gateway is created. + */ + network: string; + /** + * [Output Only] URL of the region where the target VPN gateway resides. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the VPN gateway. + */ + status: string; + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are + * created using compute.vpntunnels.insert method and associated to a VPN + * gateway. + */ + tunnels: string[]; + } + export interface Schema$TargetVpnGatewayAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetVpnGateway resources. + */ + export interface Schema$TargetVpnGatewayList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: Schema$TargetVpnGateway[]; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetVpnGatewaysScopedList { + /** + * [Output Only] A list of target vpn gateways contained in this scope. + */ + targetVpnGateways: Schema$TargetVpnGateway[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + export interface Schema$TCPHealthCheck { + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies how port is selected for health checking, can be one of + * following values: USE_FIXED_PORT: The port number in port is used for + * health checking. USE_NAMED_PORT: The portName is used for health + * checking. USE_SERVING_PORT: For NetworkEndpointGroup, the port specified + * for each network endpoint is used for health checking. For other + * backends, the port or named port specified in the Backend Service is used + * for health checking. If not specified, TCP health check follows + * behavior specified in port and portName fields. + */ + portSpecification: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the TCP connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$TestFailure { + actualService: string; + expectedService: string; + host: string; + path: string; + } + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; + } + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } + export interface Schema$UDPHealthCheck { + /** + * The UDP port number for the health check request. Valid values are 1 + * through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Raw data of request to send in payload of UDP packet. It is an error if + * this is empty. The request data can only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. It is an + * error if this is empty. The response data can only be ASCII. + */ + response: string; + } + /** + * A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the + * URL's host and path. + */ + export interface Schema$UrlMap { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The URL of the BackendService resource if none of the hostRules match. + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a UrlMap. An up-to-date fingerprint must be + * provided in order to update the UrlMap. + */ + fingerprint: string; + /** + * The list of HostRules to use against the URL. + */ + hostRules: Schema$HostRule[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The list of named PathMatchers to use against the URL. + */ + pathMatchers: Schema$PathMatcher[]; + /** + * [Output Only] URL of the region where the regional URL map resides. This + * field is not applicable to global URL maps. You must specify this field + * as part of the HTTP request URL. It is not settable as a field in the + * request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The list of expected URL mapping tests. Request to update this UrlMap + * will succeed only if all of the test cases pass. You can specify a + * maximum of 100 tests per UrlMap. + */ + tests: Schema$UrlMapTest[]; + } + /** + * Contains a list of UrlMap resources. + */ + export interface Schema$UrlMapList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of UrlMap resources. + */ + items: Schema$UrlMap[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$UrlMapReference { urlMap: string; } + export interface Schema$UrlMapsValidateRequest { + /** + * Content of the UrlMap to be validated. + */ + resource: Schema$UrlMap; + } + export interface Schema$UrlMapsValidateResponse { + result: Schema$UrlMapValidationResult; + } + /** + * Message for the expected URL mappings. + */ + export interface Schema$UrlMapTest { + /** + * Description of this test case. + */ + description: string; + /** + * Host portion of the URL. + */ + host: string; + /** + * Path portion of the URL. + */ + path: string; + /** + * Expected BackendService resource the given URL should be mapped to. + */ + service: string; + } + /** + * Message representing the validation result for a UrlMap. + */ + export interface Schema$UrlMapValidationResult { + loadErrors: string[]; + /** + * Whether the given UrlMap can be successfully loaded. If false, + * 'loadErrors' indicates the reasons. + */ + loadSucceeded: boolean; + testFailures: Schema$TestFailure[]; + /** + * If successfully loaded, this field indicates whether the test passed. If + * false, 'testFailures's indicate the reason of failure. + */ + testPassed: boolean; + } + /** + * Subnetwork which the current user has compute.subnetworks.use permission + * on. + */ + export interface Schema$UsableSubnetwork { + /** + * The range of internal addresses that are owned by this subnetwork. + */ + ipCidrRange: string; + /** + * Network URL. + */ + network: string; + /** + * Subnetwork URL. + */ + subnetwork: string; + } + export interface Schema$UsableSubnetworksAggregatedList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output] A list of usable subnetwork URLs. + */ + items: Schema$UsableSubnetwork[]; + /** + * [Output Only] Type of resource. Always + * compute#usableSubnetworksAggregatedList for aggregated lists of usable + * subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * The location in Cloud Storage and naming method of the daily usage report. + * Contains bucket_name and report_name prefix. + */ + export interface Schema$UsageExportLocation { + /** + * The name of an existing bucket in Cloud Storage where the usage report + * object is stored. The Google Service Account is granted write access to + * this bucket. This can either be the bucket name by itself, such as + * example-bucket, or the bucket name with gs:// or + * https://storage.googleapis.com/ in front of it, such as + * gs://example-bucket. + */ + bucketName: string; + /** + * An optional prefix for the name of the usage report object stored in + * bucketName. If not supplied, defaults to usage. The report is stored as a + * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the + * day of the usage according to Pacific Time. If you supply a prefix, it + * should conform to Cloud Storage object naming conventions. + */ + reportNamePrefix: string; + } + /** + * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for + * v1.vpnTunnels ==) + */ + export interface Schema$VpnTunnel { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Detailed status message for the VPN tunnel. + */ + detailedStatus: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * IKE protocol version to use when establishing the VPN tunnel with peer + * VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. + */ + ikeVersion: number; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this VpnTunnel, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a VpnTunnel. + */ + labelFingerprint: string; + /** + * Labels to apply to this VpnTunnel. These can be later modified by the + * setLabels method. Each label key/value pair must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * Local traffic selector to use when establishing the VPN tunnel with peer + * VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + localTrafficSelector: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + */ + peerIp: string; + /** + * [Output Only] URL of the region where the VPN tunnel resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with + * peer VPN gateway. The value should be a CIDR formatted string, for + * example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is + * supported. + */ + remoteTrafficSelector: string[]; + /** + * URL of router resource to be used for dynamic routing. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Shared secret used to set the secure session between the Cloud VPN + * gateway and the peer VPN gateway. + */ + sharedSecret: string; + /** + * Hash of the shared secret. + */ + sharedSecretHash: string; + /** + * [Output Only] The status of the VPN tunnel. + */ + status: string; + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. + * Provided by the client when the VPN tunnel is created. + */ + targetVpnGateway: string; + } + export interface Schema$VpnTunnelAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnelsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of VpnTunnel resources. + */ + export interface Schema$VpnTunnelList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnel resources. + */ + items: Schema$VpnTunnel[]; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$VpnTunnelsScopedList { + /** + * A list of vpn tunnels contained in this scope. + */ + vpnTunnels: Schema$VpnTunnel[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$XpnHostList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * [Output Only] A list of shared VPC host project URLs. + */ + items: Schema$Project[]; + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of + * shared VPC hosts. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zones.list - * @desc Retrieves the list of Zone resources available to the specified - * project. - * @alias compute.zones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Service resource (a.k.a service project) ID. */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/alpha/projects/{project}/zones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$XpnResourceId { + /** + * The ID of the service resource. In the case of projects, this field + * matches the project ID (e.g., my-project), not the project number (e.g., + * 12345678). + */ + id: string; + /** + * The type of the service resource. + */ + type: string; + } + /** + * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones + * ==) + */ + export interface Schema$Zone { + /** + * [Output Only] Available cpu/platform selections for the zone. + */ + availableCpuPlatforms: string[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this zone. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Full URL reference to the region which hosts the zone. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the zone, either UP or DOWN. + */ + status: string; + } + /** + * Contains a list of zone resources. + */ + export interface Schema$ZoneList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Zone resources. + */ + items: Schema$Zone[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ZoneSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash in order to update or + * change labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * The labels to set for this resource. + */ + labels: any; + } + + export class Resource$Acceleratortypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.acceleratorTypes.aggregatedList + * @desc Retrieves an aggregated list of accelerator types. + * @alias compute.acceleratorTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.acceleratorTypes.get + * @desc Returns the specified accelerator type. Get a list of available + * accelerator types by making a list() request. + * @alias compute.acceleratorTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.acceleratorType Name of the accelerator type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'acceleratorType'], + pathParams: ['acceleratorType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.acceleratorTypes.list + * @desc Retrieves a list of accelerator types available to the specified + * project. + * @alias compute.acceleratorTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Addresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.addresses.aggregatedList + * @desc Retrieves an aggregated list of addresses. + * @alias compute.addresses.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.delete + * @desc Deletes the specified address resource. + * @alias compute.addresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.get + * @desc Returns the specified address resource. + * @alias compute.addresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @alias compute.addresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.list + * @desc Retrieves a list of addresses contained within the specified + * region. + * @alias compute.addresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.setLabels + * @desc Sets the labels on an Address. To learn more about labels, read the + * Labeling Resources documentation. + * @alias compute.addresses.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.addresses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Autoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.autoscalers.aggregatedList + * @desc Retrieves an aggregated list of autoscalers. + * @alias compute.autoscalers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.delete + * @desc Deletes the specified autoscaler. + * @alias compute.autoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.get + * @desc Returns the specified autoscaler resource. Get a list of available + * autoscalers by making a list() request. + * @alias compute.autoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @alias compute.autoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * zone. + * @alias compute.autoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @alias compute.autoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.autoscalers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @alias compute.autoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendbuckets { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendBuckets.addSignedUrlKey + * @desc Adds the given Signed URL Key to the backend bucket. + * @alias compute.backendBuckets.addSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SignedUrlKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.delete + * @desc Deletes the specified BackendBucket resource. + * @alias compute.backendBuckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.deleteSignedUrlKey + * @desc Deletes the given Signed URL Key from the backend bucket. + * @alias compute.backendBuckets.deleteSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.keyName The name of the Signed URL Key to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendBucket', 'keyName'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.get + * @desc Returns the specified BackendBucket resource. Get a list of + * available backend buckets by making a list() request. + * @alias compute.backendBuckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.backendBuckets.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.insert + * @desc Creates a BackendBucket resource in the specified project using the + * data included in the request. + * @alias compute.backendBuckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.list + * @desc Retrieves the list of BackendBucket resources available to the + * specified project. + * @alias compute.backendBuckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.patch + * @desc Updates the specified BackendBucket resource with the data included + * in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + * @alias compute.backendBuckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.backendBuckets.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.backendBuckets.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.update + * @desc Updates the specified BackendBucket resource with the data included + * in the request. + * @alias compute.backendBuckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendServices.addSignedUrlKey + * @desc Adds the given Signed URL Key to the specified backend service. + * @alias compute.backendServices.addSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SignedUrlKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}/addSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.aggregatedList + * @desc Retrieves the list of all BackendService resources, regional and + * global, available to the specified project. + * @alias compute.backendServices.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Name of the project scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.backendServices.delete + * @desc Deletes the specified BackendService resource. + * @alias compute.backendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.deleteSignedUrlKey + * @desc Deletes the given Signed URL Key from the specified backend + * service. + * @alias compute.backendServices.deleteSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.keyName The name of the Signed URL Key to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService', 'keyName'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.get + * @desc Returns the specified BackendService resource. Get a list of + * available backend services by making a list() request. + * @alias compute.backendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.getHealth + * @desc Gets the most recent health check results for this BackendService. + * @alias compute.backendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. + * @param {string} params.project + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.insert + * @desc Creates a BackendService resource in the specified project using + * the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a backend service. Read + * Restrictions and Guidelines for more information. + * @alias compute.backendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.list + * @desc Retrieves the list of BackendService resources available to the + * specified project. + * @alias compute.backendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.patch + * @desc Patches the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @alias compute.backendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.setSecurityPolicy + * @desc Sets the security policy for the specified backend service. + * @alias compute.backendServices.setSecurityPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SecurityPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSecurityPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSecurityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSecurityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}/setSecurityPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.backendServices.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.update + * @desc Updates the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. + * @alias compute.backendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.disks.aggregatedList + * @desc Retrieves an aggregated list of persistent disks. + * @alias compute.disks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.createSnapshot + * @desc Creates a snapshot of a specified persistent disk. + * @alias compute.disks.createSnapshot + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to snapshot. + * @param {boolean=} params.guestFlush + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Snapshot} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSnapshot(params?: any, options?: MethodOptions): + AxiosPromise; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.delete + * @desc Deletes the specified persistent disk. Deleting a disk removes its + * data permanently and is irreversible. However, deleting a disk does not + * delete any snapshots previously made from the disk. You must separately + * delete snapshots. + * @alias compute.disks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.get + * @desc Returns a specified persistent disk. Get a list of available + * persistent disks by making a list() request. + * @alias compute.disks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.disks.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.insert + * @desc Creates a persistent disk in the specified project using the data + * in the request. You can create a disk with a sourceImage, a + * sourceSnapshot, or create an empty 500 GB data disk by omitting all + * properties. You can also create a disk that is larger than the default + * size by specifying the sizeGb property. + * @alias compute.disks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. + * @param {string} params.zone The name of the zone for this request. + * @param {().Disk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.list + * @desc Retrieves a list of persistent disks contained within the specified + * zone. + * @alias compute.disks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.resize + * @desc Resizes the specified persistent disk. You can only increase the + * size of the disk. + * @alias compute.disks.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk The name of the persistent disk. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().DisksResizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{disk}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.disks.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.setLabels + * @desc Sets the labels on a disk. To learn more about labels, read the + * Labeling Resources documentation. + * @alias compute.disks.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().ZoneSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.disks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disktypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.diskTypes.aggregatedList + * @desc Retrieves an aggregated list of disk types. + * @alias compute.diskTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.get + * @desc Returns the specified disk type. Get a list of available disk types + * by making a list() request. + * @alias compute.diskTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.diskType Name of the disk type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/diskTypes/{diskType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'diskType'], + pathParams: ['diskType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.list + * @desc Retrieves a list of disk types available to the specified project. + * @alias compute.diskTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Firewalls { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.firewalls.delete + * @desc Deletes the specified firewall. + * @alias compute.firewalls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.get + * @desc Returns the specified firewall. + * @alias compute.firewalls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.insert + * @desc Creates a firewall rule in the specified project using the data + * included in the request. + * @alias compute.firewalls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.list + * @desc Retrieves the list of firewall rules available to the specified + * project. + * @alias compute.firewalls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.patch + * @desc Updates the specified firewall rule with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @alias compute.firewalls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.firewalls.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.update + * @desc Updates the specified firewall rule with the data included in the + * request. The PUT method can only update the following fields of firewall + * rule: allowed, description, sourceRanges, sourceTags, targetTags. + * @alias compute.firewalls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Forwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.forwardingRules.aggregatedList + * @desc Retrieves an aggregated list of forwarding rules. + * @alias compute.forwardingRules.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.forwardingRules.delete + * @desc Deletes the specified ForwardingRule resource. + * @alias compute.forwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.get + * @desc Returns the specified ForwardingRule resource. + * @alias compute.forwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.insert + * @desc Creates a ForwardingRule resource in the specified project and + * region using the data included in the request. + * @alias compute.forwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.list + * @desc Retrieves a list of ForwardingRule resources available to the + * specified project and region. + * @alias compute.forwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.patch + * @desc Updates the specified forwarding rule with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. Currently, you can only patch the + * network_tier field. + * @alias compute.forwardingRules.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.setLabels + * @desc Sets the labels on the specified resource. To learn more about + * labels, read the Labeling Resources documentation. + * @alias compute.forwardingRules.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.setTarget + * @desc Changes target URL for forwarding rule. The new target should be of + * the same type as the old target. + * @alias compute.forwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.forwardingRules.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaladdresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalAddresses.delete + * @desc Deletes the specified address resource. + * @alias compute.globalAddresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.get + * @desc Returns the specified address resource. Get a list of available + * addresses by making a list() request. + * @alias compute.globalAddresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @alias compute.globalAddresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.list + * @desc Retrieves a list of global addresses. + * @alias compute.globalAddresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.setLabels + * @desc Sets the labels on a GlobalAddress. To learn more about labels, + * read the Labeling Resources documentation. + * @alias compute.globalAddresses.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/addresses/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.globalAddresses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/addresses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globalforwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalForwardingRules.delete + * @desc Deletes the specified GlobalForwardingRule resource. + * @alias compute.globalForwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.get + * @desc Returns the specified GlobalForwardingRule resource. Get a list of + * available forwarding rules by making a list() request. + * @alias compute.globalForwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.insert + * @desc Creates a GlobalForwardingRule resource in the specified project + * using the data included in the request. + * @alias compute.globalForwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.list + * @desc Retrieves a list of GlobalForwardingRule resources available to the + * specified project. + * @alias compute.globalForwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.patch + * @desc Updates the specified forwarding rule with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. Currently, you can only patch the + * network_tier field. + * @alias compute.globalForwardingRules.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.setLabels + * @desc Sets the labels on the specified resource. To learn more about + * labels, read the Labeling Resources documentation. + * @alias compute.globalForwardingRules.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.setTarget + * @desc Changes target URL for the GlobalForwardingRule resource. The new + * target should be of the same type as the old target. + * @alias compute.globalForwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.globalForwardingRules.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/forwardingRules/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaloperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalOperations.aggregatedList + * @desc Retrieves an aggregated list of all operations. + * @alias compute.globalOperations.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.delete + * @desc Deletes the specified Operations resource. + * @alias compute.globalOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.get + * @desc Retrieves the specified Operations resource. Get a list of + * operations by making a list() request. + * @alias compute.globalOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified project. + * @alias compute.globalOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Healthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.healthChecks.aggregatedList + * @desc Retrieves the list of all HealthCheck resources, regional and + * global, available to the specified project. + * @alias compute.healthChecks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Name of the project scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.delete + * @desc Deletes the specified HealthCheck resource. + * @alias compute.healthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.get + * @desc Returns the specified HealthCheck resource. Get a list of available + * health checks by making a list() request. + * @alias compute.healthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.insert + * @desc Creates a HealthCheck resource in the specified project using the + * data included in the request. + * @alias compute.healthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.list + * @desc Retrieves the list of HealthCheck resources available to the + * specified project. + * @alias compute.healthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.patch + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @alias compute.healthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.healthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.update + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. + * @alias compute.healthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Hosts { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.hosts.aggregatedList + * @desc Retrieves an aggregated list of hosts. + * @alias compute.hosts.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/hosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.delete + * @desc Deletes the specified Host resource. + * @alias compute.hosts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.host Name of the Host resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts/{host}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'host'], + pathParams: ['host', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.get + * @desc Returns the specified host. Get a list of available hosts by making + * a list() request. + * @alias compute.hosts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.host Name of the host to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts/{host}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'host'], + pathParams: ['host', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.hosts.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.insert + * @desc Creates a host resource in the specified project using the data + * included in the request. + * @alias compute.hosts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Host} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.list + * @desc Retrieves a list of hosts available to the specified project. + * @alias compute.hosts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.hosts.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hosts.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.hosts.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hosts/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Hosttypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.hostTypes.aggregatedList + * @desc Retrieves an aggregated list of host types. + * @alias compute.hostTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/hostTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hostTypes.get + * @desc Returns the specified host type. Get a list of available host types + * by making a list() request. + * @alias compute.hostTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostType Name of the host type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hostTypes/{hostType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'hostType'], + pathParams: ['hostType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.hostTypes.list + * @desc Retrieves a list of host types available to the specified project. + * @alias compute.hostTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/hostTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httphealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpHealthChecks.delete + * @desc Deletes the specified HttpHealthCheck resource. + * @alias compute.httpHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.get + * @desc Returns the specified HttpHealthCheck resource. Get a list of + * available HTTP health checks by making a list() request. + * @alias compute.httpHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.insert + * @desc Creates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @alias compute.httpHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.list + * @desc Retrieves the list of HttpHealthCheck resources available to the + * specified project. + * @alias compute.httpHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.patch + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @alias compute.httpHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.httpHealthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.update + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @alias compute.httpHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httpshealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpsHealthChecks.delete + * @desc Deletes the specified HttpsHealthCheck resource. + * @alias compute.httpsHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.get + * @desc Returns the specified HttpsHealthCheck resource. Get a list of + * available HTTPS health checks by making a list() request. + * @alias compute.httpsHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.insert + * @desc Creates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @alias compute.httpsHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.list + * @desc Retrieves the list of HttpsHealthCheck resources available to the + * specified project. + * @alias compute.httpsHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.patch + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @alias compute.httpsHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.httpsHealthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.update + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @alias compute.httpsHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Images { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.images.delete + * @desc Deletes the specified image. + * @alias compute.images.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.deprecate + * @desc Sets the deprecation status of an image. If an empty request body + * is given, clears the deprecation status instead. + * @alias compute.images.deprecate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Image name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DeprecationStatus} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deprecate(params?: any, options?: MethodOptions): + AxiosPromise; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/{image}/deprecate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.get + * @desc Returns the specified image. Get a list of available images by + * making a list() request. + * @alias compute.images.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.getFromFamily + * @desc Returns the latest image that is part of an image family and is not + * deprecated. + * @alias compute.images.getFromFamily + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.family Name of the image family to search for. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getFromFamily(params?: any, options?: MethodOptions): + AxiosPromise; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/family/{family}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'family'], + pathParams: ['family', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.images.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.insert + * @desc Creates an image in the specified project using the data included + * in the request. + * @alias compute.images.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.forceCreate Force image creation if true. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Image} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.list + * @desc Retrieves the list of custom images available to the specified + * project. Custom images are images you create that belong to your project. + * This method does not get any images that belong to other projects, + * including publicly-available images, like Debian 8. If you want to get a + * list of publicly-available images, use this method to make a request to + * the respective image project, such as debian-cloud or windows-cloud. + * @alias compute.images.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.images.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.setLabels + * @desc Sets the labels on an image. To learn more about labels, read the + * Labeling Resources documentation. + * @alias compute.images.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.images.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/images/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @alias compute.instanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.aggregatedList + * @desc Retrieves the list of managed instance groups and groups them by + * zone. + * @alias compute.instanceGroupManagers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.applyUpdatesToInstances + * @desc Apply changes to selected instances on the managed instance group. + * This method can be used to apply new overrides and/or new versions. + * @alias compute.instanceGroupManagers.applyUpdatesToInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. Should conform to RFC1035. + * @param {().InstanceGroupManagersApplyUpdatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + applyUpdatesToInstances(params?: any, options?: MethodOptions): + AxiosPromise; + applyUpdatesToInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + applyUpdatesToInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. Note that the instance group must not belong to + * a backend service. Read Deleting an instance group for more information. + * @alias compute.instanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @alias compute.instanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.deletePerInstanceConfigs + * @desc Deletes selected per-instance configs for the managed instance + * group. + * @alias compute.instanceGroupManagers.deletePerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {().InstanceGroupManagersDeletePerInstanceConfigsReq} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deletePerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + deletePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deletePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. Gets a list of available managed instance groups by making a + * list() request. + * @alias compute.instanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A managed instance group can have up to + * 1000 VM instances per group. Please contact Cloud Support if you need an + * increase in this limit. + * @alias compute.instanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.list + * @desc Retrieves a list of managed instance groups that are contained + * within the specified project and zone. + * @alias compute.instanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.listManagedInstances + * @desc Lists all of the instances in the managed instance group. Each + * instance in the list has a currentAction, which indicates the action that + * the managed instance group is performing on the instance. For example, if + * the group is still creating an instance, the currentAction is CREATING. + * If a previous action failed, the list displays the errors for that failed + * action. + * @alias compute.instanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.listPerInstanceConfigs + * @desc Lists all of the per-instance configs defined for the managed + * instance group. + * @alias compute.instanceGroupManagers.listPerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listPerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + listPerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>): void; + listPerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>( + parameters, callback); + } else { + return createAPIRequest< + Schema$InstanceGroupManagersListPerInstanceConfigsResp>(parameters); + } + } + + + /** + * compute.instanceGroupManagers.patch + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is patched even if the instances in the group are still in the process of + * being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @alias compute.instanceGroupManagers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @alias compute.instanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.resize + * @desc Resizes the managed instance group. If you increase the size, the + * group creates new instances using the current instance template. If you + * decrease the size, the group deletes instances. The resize operation is + * marked DONE when the resize actions are scheduled even if the group has + * not yet added or deleted any instances. You must separately verify the + * status of the creating or deleting actions with the listmanagedinstances + * method. If the group is part of a backend service that has enabled + * connection draining, it can take up to 60 seconds after the connection + * draining duration has elapsed before the VM instance is removed or + * deleted. + * @alias compute.instanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.resizeAdvanced + * @desc Resizes the managed instance group with advanced configuration + * options like disabling creation retries. This is an extended version of + * the resize method. If you increase the size of the instance group, the + * group creates new instances using the current instance template. If you + * decrease the size, the group deletes instances. The resize operation is + * marked DONE when the resize actions are scheduled even if the group has + * not yet added or deleted any instances. You must separately verify the + * status of the creating, creatingWithoutRetries, or deleting actions with + * the get or listmanagedinstances method. If the group is part of a + * backend service that has enabled connection draining, it can take up to + * 60 seconds after the connection draining duration has elapsed before the + * VM instance is removed or deleted. + * @alias compute.instanceGroupManagers.resizeAdvanced + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersResizeAdvancedRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resizeAdvanced(params?: any, options?: MethodOptions): + AxiosPromise; + resizeAdvanced( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resizeAdvanced( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setAutoHealingPolicies + * @desc Modifies the autohealing policies. + * @alias compute.instanceGroupManagers.setAutoHealingPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetAutoHealingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoHealingPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setInstanceTemplate + * @desc Specifies the instance template to use when creating new instances + * in this group. The templates for existing instances in the group do not + * change unless you recreate them. + * @alias compute.instanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all instances in this managed + * instance group are assigned. The target pools automatically apply to all + * of the instances in the managed instance group. This operation is marked + * DONE when you make the request even if the instances have not yet been + * added to their target pools. The change might take some time to apply to + * all of the instances in the group depending on the size of the group. + * @alias compute.instanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.instanceGroupManagers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.update + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is updated even if the instances in the group have not yet been updated. + * You must separately verify the status of the individual instances with + * the listManagedInstances method. + * @alias compute.instanceGroupManagers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.updatePerInstanceConfigs + * @desc Insert or patch (for the ones that already exist) per-instance + * configs for the managed instance group. perInstanceConfig.instance serves + * as a key used to distinguish whether to perform insert or patch. + * @alias compute.instanceGroupManagers.updatePerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. It should conform to RFC1035. + * @param {().InstanceGroupManagersUpdatePerInstanceConfigsReq} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatePerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + updatePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updatePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroups.addInstances + * @desc Adds a list of instances to the specified instance group. All of + * the instances in the instance group must be in the same + * network/subnetwork. Read Adding instances for more information. + * @alias compute.instanceGroups.addInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where you are adding instances. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstances(params?: any, options?: MethodOptions): + AxiosPromise; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.aggregatedList + * @desc Retrieves the list of instance groups and sorts them by zone. + * @alias compute.instanceGroups.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.delete + * @desc Deletes the specified instance group. The instances in the group + * are not deleted. Note that instance group must not belong to a backend + * service. Read Deleting an instance group for more information. + * @alias compute.instanceGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.get + * @desc Returns the specified instance group. Get a list of available + * instance groups by making a list() request. + * @alias compute.instanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.insert + * @desc Creates an instance group in the specified project using the + * parameters that are included in the request. + * @alias compute.instanceGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the instance group. + * @param {().InstanceGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.list + * @desc Retrieves the list of instance groups that are located in the + * specified project and zone. + * @alias compute.instanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.listInstances + * @desc Lists the instances in the specified instance group. + * @alias compute.instanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.removeInstances + * @desc Removes one or more instances from the specified instance group, + * but does not delete those instances. If the group is part of a backend + * service that has enabled connection draining, it can take up to 60 + * seconds after the connection draining duration before the VM instance is + * removed or deleted. + * @alias compute.instanceGroups.removeInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstances(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.setNamedPorts + * @desc Sets the named ports for the specified instance group. + * @alias compute.instanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.instanceGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instances.addAccessConfig + * @desc Adds an access config to an instance's network interface. + * @alias compute.instances.addAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to add to this instance. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.aggregatedList + * @desc Retrieves aggregated list of instances. + * @alias compute.instances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.attachDisk + * @desc Attaches an existing Disk resource to an instance. You must first + * create the disk before you can attach it. It is not possible to create + * and attach a disk at the same time. For more information, read Adding a + * persistent disk to your instance. + * @alias compute.instances.attachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.forceAttach Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks. + * @param {string} params.instance The instance name for this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AttachedDisk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + attachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.delete + * @desc Deletes the specified Instance resource. For more information, see + * Stopping or Deleting an Instance. + * @alias compute.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.deleteAccessConfig + * @desc Deletes an access config from an instance's network interface. + * @alias compute.instances.deleteAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accessConfig The name of the access config to delete. + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.detachDisk + * @desc Detaches a disk from an instance. + * @alias compute.instances.detachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceName Disk device name to detach. + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.get + * @desc Returns the specified Instance resource. Get a list of available + * instances by making a list() request. + * @alias compute.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.getGuestAttributes + * @desc Returns the specified guest attributes entry. + * @alias compute.instances.getGuestAttributes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.variableKey Specifies the key for the guest attributes entry. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getGuestAttributes(params?: any, options?: MethodOptions): + AxiosPromise; + getGuestAttributes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getGuestAttributes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/getGuestAttributes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.instances.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.getSerialPortOutput + * @desc Returns the specified instance's serial port output. + * @alias compute.instances.getSerialPortOutput + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSerialPortOutput(params?: any, options?: MethodOptions): + AxiosPromise; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/serialPort') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.insert + * @desc Creates an instance resource in the specified project using the + * data included in the request. + * @alias compute.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate + * @param {string} params.zone The name of the zone for this request. + * @param {().Instance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.list + * @desc Retrieves the list of instances contained within the specified + * zone. + * @alias compute.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.listReferrers + * @desc Retrieves the list of referrers to instances contained within the + * specified zone. + * @alias compute.instances.listReferrers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listReferrers(params?: any, options?: MethodOptions): + AxiosPromise; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/referrers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.reset + * @desc Performs a reset on the instance. For more information, see + * Resetting an instance. + * @alias compute.instances.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.resume + * @desc Resumes an instance that was suspended using the + * instances().suspend method. + * @alias compute.instances.resume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to resume. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesResumeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resume(params?: any, options?: MethodOptions): + AxiosPromise; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/resume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDeletionProtection + * @desc Sets deletion protection on the instance. + * @alias compute.instances.setDeletionProtection + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDeletionProtection(params?: any, options?: MethodOptions): + AxiosPromise; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDiskAutoDelete + * @desc Sets the auto-delete flag for a disk attached to an instance. + * @alias compute.instances.setDiskAutoDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param {string} params.deviceName The device name of the disk to modify. + * @param {string} params.instance The instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDiskAutoDelete(params?: any, options?: MethodOptions): + AxiosPromise; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.instances.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setLabels + * @desc Sets labels on an instance. To learn more about labels, read the + * Labeling Resources documentation. + * @alias compute.instances.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineResources + * @desc Changes the number and/or type of accelerator for a stopped + * instance to the values specified in the request. + * @alias compute.instances.setMachineResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineResources(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineType + * @desc Changes the machine type for a stopped instance to the machine type + * specified in the request. + * @alias compute.instances.setMachineType + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineTypeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineType(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMetadata + * @desc Sets metadata for the specified instance to the data included in + * the request. + * @alias compute.instances.setMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMinCpuPlatform + * @desc Changes the minimum CPU platform that this instance should use. + * This method can only be called on a stopped instance. For more + * information, read Specifying a Minimum CPU Platform. + * @alias compute.instances.setMinCpuPlatform + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMinCpuPlatform(params?: any, options?: MethodOptions): + AxiosPromise; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setScheduling + * @desc Sets an instance's scheduling options. + * @alias compute.instances.setScheduling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Scheduling} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setScheduling(params?: any, options?: MethodOptions): + AxiosPromise; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setServiceAccount + * @desc Sets the service account on the instance. For more information, + * read Changing the service account and access scopes for an instance. + * @alias compute.instances.setServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetServiceAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setShieldedVmIntegrityPolicy + * @desc Sets the Shielded VM integrity policy for an instance. This method + * supports PATCH semantics and uses the JSON merge patch format and + * processing rules. + * @alias compute.instances.setShieldedVmIntegrityPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().ShieldedVmIntegrityPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setShieldedVmIntegrityPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setShieldedVmIntegrityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setShieldedVmIntegrityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setShieldedVmIntegrityPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setTags + * @desc Sets tags for the specified instance to the data included in the + * request. + * @alias compute.instances.setTags + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Tags} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTags(params?: any, options?: MethodOptions): + AxiosPromise; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/setTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.simulateMaintenanceEvent + * @desc Simulates a maintenance event on the instance. + * @alias compute.instances.simulateMaintenanceEvent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + simulateMaintenanceEvent(params?: any, options?: MethodOptions): + AxiosPromise; + simulateMaintenanceEvent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + simulateMaintenanceEvent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.start + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @alias compute.instances.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.startWithEncryptionKey + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @alias compute.instances.startWithEncryptionKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startWithEncryptionKey(params?: any, options?: MethodOptions): + AxiosPromise; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.stop + * @desc Stops a running instance, shutting it down cleanly, and allows you + * to restart the instance at a later time. Stopped instances do not incur + * VM usage charges while they are stopped. However, resources that the VM + * is using, such as persistent disks and static IP addresses, will continue + * to be charged until they are deleted. For more information, see Stopping + * an instance. + * @alias compute.instances.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.discardLocalSsd If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). + * @param {string} params.instance Name of the instance resource to stop. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.suspend + * @desc This method suspends a running instance, saving its state to + * persistent storage, and allows you to resume the instance at a later + * time. Suspended instances incur reduced per-minute, virtual machine usage + * charges while they are suspended. Any resources the virtual machine is + * using, such as persistent disks and static IP addresses, will continue to + * be charged until they are deleted. + * @alias compute.instances.suspend + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.discardLocalSsd If true, discard the contents of any attached localSSD partitions. Default value is false (== preserve localSSD data). + * @param {string} params.instance Name of the instance resource to suspend. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + suspend(params?: any, options?: MethodOptions): + AxiosPromise; + suspend( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + suspend( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/suspend') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.instances.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateAccessConfig + * @desc Updates the specified access config from an instance's network + * interface with the data included in the request. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @alias compute.instances.updateAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface where the access config is attached. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateNetworkInterface + * @desc Updates an instance's network interface. This method follows PATCH + * semantics. + * @alias compute.instances.updateNetworkInterface + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NetworkInterface} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateNetworkInterface(params?: any, options?: MethodOptions): + AxiosPromise; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateShieldedVmConfig + * @desc Updates the Shielded VM config for an instance. This method + * supports PATCH semantics and uses the JSON merge patch format and + * processing rules. + * @alias compute.instances.updateShieldedVmConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().ShieldedVmConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateShieldedVmConfig(params?: any, options?: MethodOptions): + AxiosPromise; + updateShieldedVmConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateShieldedVmConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/instances/{instance}/updateShieldedVmConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancetemplates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceTemplates.delete + * @desc Deletes the specified instance template. Deleting an instance + * template is permanent and cannot be undone. It's not possible to delete + * templates which are in use by an instance group. + * @alias compute.instanceTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.get + * @desc Returns the specified instance template. Gets a list of available + * instance templates by making a list() request. + * @alias compute.instanceTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.insert + * @desc Creates an instance template in the specified project using the + * data that is included in the request. If you are creating a new template + * to update an existing instance group, your new instance template must use + * the same network or, if applicable, the same subnetwork as the original + * template. + * @alias compute.instanceTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.list + * @desc Retrieves a list of instance templates that are contained within + * the specified project and zone. + * @alias compute.instanceTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.instanceTemplates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectattachments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectAttachments.aggregatedList + * @desc Retrieves an aggregated list of interconnect attachments. + * @alias compute.interconnectAttachments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.interconnectAttachments.delete + * @desc Deletes the specified interconnect attachment. + * @alias compute.interconnectAttachments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.get + * @desc Returns the specified interconnect attachment. + * @alias compute.interconnectAttachments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.interconnectAttachments.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.insert + * @desc Creates an InterconnectAttachment in the specified project using + * the data included in the request. + * @alias compute.interconnectAttachments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InterconnectAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.list + * @desc Retrieves the list of interconnect attachments contained within the + * specified region. + * @alias compute.interconnectAttachments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.patch + * @desc Updates the specified interconnect attachment with the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @alias compute.interconnectAttachments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InterconnectAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.interconnectAttachments.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.setLabels + * @desc Sets the labels on an InterconnectAttachment. To learn more about + * labels, read the Labeling Resources documentation. + * @alias compute.interconnectAttachments.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.interconnectAttachments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectlocations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectLocations.get + * @desc Returns the details for the specified interconnect location. Get a + * list of available interconnect locations by making a list() request. + * @alias compute.interconnectLocations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectLocation Name of the interconnect location to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnectLocations/{interconnectLocation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnectLocation'], + pathParams: ['interconnectLocation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectLocations.list + * @desc Retrieves the list of interconnect locations available to the + * specified project. + * @alias compute.interconnectLocations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnectLocations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectLocations.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.interconnectLocations.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnectLocations/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnects.delete + * @desc Deletes the specified interconnect. + * @alias compute.interconnects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.get + * @desc Returns the specified interconnect. Get a list of available + * interconnects by making a list() request. + * @alias compute.interconnects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.interconnects.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.insert + * @desc Creates a Interconnect in the specified project using the data + * included in the request. + * @alias compute.interconnects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.list + * @desc Retrieves the list of interconnect available to the specified + * project. + * @alias compute.interconnects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.patch + * @desc Updates the specified interconnect with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @alias compute.interconnects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.interconnects.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.setLabels + * @desc Sets the labels on an Interconnect. To learn more about labels, + * read the Labeling Resources documentation. + * @alias compute.interconnects.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.interconnects.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/interconnects/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licensecodes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenseCodes.get + * @desc Return a specified license code. License codes are mirrored across + * all projects that have permissions to read the License Code. + * @alias compute.licenseCodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.licenseCode Number corresponding to the License code resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenseCodes/{licenseCode}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'licenseCode'], + pathParams: ['licenseCode', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenseCodes.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.licenseCodes.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenseCodes.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.licenseCodes.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenseCodes.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.licenseCodes.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenseCodes/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licenses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenses.delete + * @desc Deletes the specified license. + * @alias compute.licenses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the license resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.get + * @desc Returns the specified License resource. + * @alias compute.licenses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the License resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.licenses.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenses/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.insert + * @desc Create a License resource in the specified project. + * @alias compute.licenses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().License} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.list + * @desc Retrieves the list of licenses available in the specified project. + * This method does not get any licenses that belong to other projects, + * including licenses attached to publicly-available images, like Debian 8. + * If you want to get a list of publicly-available licenses, use this method + * to make a request to the respective image project, such as debian-cloud + * or windows-cloud. + * @alias compute.licenses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.licenses.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenses/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.licenses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/licenses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Machinetypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.machineTypes.aggregatedList + * @desc Retrieves an aggregated list of machine types. + * @alias compute.machineTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.get + * @desc Returns the specified machine type. Gets a list of available + * machine types by making a list() request. + * @alias compute.machineTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.machineType Name of the machine type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/machineTypes/{machineType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'machineType'], + pathParams: ['machineType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.list + * @desc Retrieves a list of machine types available to the specified + * project. + * @alias compute.machineTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Networkendpointgroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.networkEndpointGroups.aggregatedList + * @desc Retrieves the list of network endpoint groups and sorts them by + * zone. + * @alias compute.networkEndpointGroups.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/networkEndpointGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.networkEndpointGroups.attachNetworkEndpoints + * @desc Attach a list of network endpoints to the specified network + * endpoint group. + * @alias compute.networkEndpointGroups.attachNetworkEndpoints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.networkEndpointGroup The name of the network endpoint group where you are attaching network endpoints to. It should comply with RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {().NetworkEndpointGroupsAttachEndpointsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + attachNetworkEndpoints(params?: any, options?: MethodOptions): + AxiosPromise; + attachNetworkEndpoints( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + attachNetworkEndpoints( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/attachNetworkEndpoints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'networkEndpointGroup'], + pathParams: ['networkEndpointGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.delete + * @desc Deletes the specified network endpoint group. The network endpoints + * in the NEG and the VM instances they belong to are not terminated when + * the NEG is deleted. Note that the NEG cannot be deleted if there are + * backend services referencing it. + * @alias compute.networkEndpointGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.networkEndpointGroup The name of the network endpoint group to delete. It should comply with RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'networkEndpointGroup'], + pathParams: ['networkEndpointGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.detachNetworkEndpoints + * @desc Detach a list of network endpoints from the specified network + * endpoint group. + * @alias compute.networkEndpointGroups.detachNetworkEndpoints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.networkEndpointGroup The name of the network endpoint group where you are removing network endpoints. It should comply with RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {().NetworkEndpointGroupsDetachEndpointsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detachNetworkEndpoints(params?: any, options?: MethodOptions): + AxiosPromise; + detachNetworkEndpoints( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + detachNetworkEndpoints( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/detachNetworkEndpoints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'networkEndpointGroup'], + pathParams: ['networkEndpointGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.get + * @desc Returns the specified network endpoint group. Get a list of + * available network endpoint groups by making a list() request. + * @alias compute.networkEndpointGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'networkEndpointGroup'], + pathParams: ['networkEndpointGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.insert + * @desc Creates a network endpoint group in the specified project using the + * parameters that are included in the request. + * @alias compute.networkEndpointGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the network endpoint group. It should comply with RFC1035. + * @param {().NetworkEndpointGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.list + * @desc Retrieves the list of network endpoint groups that are located in + * the specified project and zone. + * @alias compute.networkEndpointGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networkEndpointGroups.listNetworkEndpoints + * @desc Lists the network endpoints in the specified network endpoint + * group. + * @alias compute.networkEndpointGroups.listNetworkEndpoints + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string} params.networkEndpointGroup The name of the network endpoint group from which you want to generate a list of included network endpoints. It should comply with RFC1035. + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the network endpoint group is located. It should comply with RFC1035. + * @param {().NetworkEndpointGroupsListEndpointsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listNetworkEndpoints(params?: any, options?: MethodOptions): + AxiosPromise; + listNetworkEndpoints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$NetworkEndpointGroupsListNetworkEndpoints>): void; + listNetworkEndpoints( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$NetworkEndpointGroupsListNetworkEndpoints>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{networkEndpointGroup}/listNetworkEndpoints') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'networkEndpointGroup'], + pathParams: ['networkEndpointGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$NetworkEndpointGroupsListNetworkEndpoints>(parameters); + } + } + + + /** + * compute.networkEndpointGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.networkEndpointGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/networkEndpointGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Networks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.networks.addPeering + * @desc Adds a peering to the specified network. + * @alias compute.networks.addPeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to add peering to. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksAddPeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addPeering(params?: any, options?: MethodOptions): + AxiosPromise; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}/addPeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.delete + * @desc Deletes the specified network. + * @alias compute.networks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.get + * @desc Returns the specified network. Get a list of available networks by + * making a list() request. + * @alias compute.networks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.insert + * @desc Creates a network in the specified project using the data included + * in the request. + * @alias compute.networks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.list + * @desc Retrieves the list of networks available to the specified project. + * @alias compute.networks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.listIpOwners + * @desc Lists the internal IP owners in the specified network. + * @alias compute.networks.listIpOwners + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string=} params.ipCidrRange (Optional) IP CIDR range filter, example: "10.128.10.0/30". + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string} params.network Name of the network to return. + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.ownerProjects (Optional) Project IDs filter, example: "project-1,project-2". + * @param {string=} params.ownerTypes (Optional) Owner types filter, example: "instance,forwardingRule". + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string=} params.subnetName (Optional) Subnetwork name filter. + * @param {string=} params.subnetRegion (Optional) Subnetwork region filter. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listIpOwners(params?: any, options?: MethodOptions): + AxiosPromise; + listIpOwners( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listIpOwners( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}/listIpOwners') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.patch + * @desc Patches the specified network with the data included in the + * request. Only the following fields can be modified: + * routingConfig.routingMode. + * @alias compute.networks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.removePeering + * @desc Removes a peering from the specified network. + * @alias compute.networks.removePeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to remove peering from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksRemovePeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removePeering(params?: any, options?: MethodOptions): + AxiosPromise; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}/removePeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.switchToCustomMode + * @desc Switches the network mode from auto subnet mode to custom subnet + * mode. + * @alias compute.networks.switchToCustomMode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to be updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + switchToCustomMode(params?: any, options?: MethodOptions): + AxiosPromise; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{network}/switchToCustomMode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.networks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/networks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Nodegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.nodeGroups.addNodes + * @desc Adds specified number of nodes to the node group. + * @alias compute.nodeGroups.addNodes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NodeGroupsAddNodesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addNodes(params?: any, options?: MethodOptions): + AxiosPromise; + addNodes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addNodes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/addNodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeGroup'], + pathParams: ['nodeGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.aggregatedList + * @desc Retrieves an aggregated list of node groups. + * @alias compute.nodeGroups.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/nodeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.delete + * @desc Deletes the specified NodeGroup resource. + * @alias compute.nodeGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeGroup'], + pathParams: ['nodeGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.deleteNodes + * @desc Deletes specified nodes from the node group. + * @alias compute.nodeGroups.deleteNodes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NodeGroupsDeleteNodesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteNodes(params?: any, options?: MethodOptions): + AxiosPromise; + deleteNodes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteNodes( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/deleteNodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeGroup'], + pathParams: ['nodeGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.get + * @desc Returns the specified NodeGroup. Get a list of available NodeGroups + * by making a list() request. + * @alias compute.nodeGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeGroup Name of the node group to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeGroup'], + pathParams: ['nodeGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.nodeGroups.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.insert + * @desc Creates a NodeGroup resource in the specified project using the + * data included in the request. + * @alias compute.nodeGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.initialNodeCount Initial count of nodes in the node group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NodeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'initialNodeCount'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.list + * @desc Retrieves a list of node groups available to the specified project. + * @alias compute.nodeGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.nodeGroups.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.setNodeTemplate + * @desc Updates the node template of the node group. + * @alias compute.nodeGroups.setNodeTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeGroup Name of the NodeGroup resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NodeGroupsSetNodeTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNodeTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setNodeTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNodeTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{nodeGroup}/setNodeTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeGroup'], + pathParams: ['nodeGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.nodeGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Nodetemplates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.nodeTemplates.aggregatedList + * @desc Retrieves an aggregated list of node templates. + * @alias compute.nodeTemplates.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/nodeTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.delete + * @desc Deletes the specified NodeTemplate resource. + * @alias compute.nodeTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeTemplate Name of the NodeTemplate resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'nodeTemplate'], + pathParams: ['nodeTemplate', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.get + * @desc Returns the specified node template. Get a list of available node + * templates by making a list() request. + * @alias compute.nodeTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeTemplate Name of the node template to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{nodeTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'nodeTemplate'], + pathParams: ['nodeTemplate', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.nodeTemplates.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.insert + * @desc Creates a NodeTemplate resource in the specified project using the + * data included in the request. + * @alias compute.nodeTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NodeTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.list + * @desc Retrieves a list of node templates available to the specified + * project. + * @alias compute.nodeTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.nodeTemplates.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTemplates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.nodeTemplates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/nodeTemplates/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Nodetypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.nodeTypes.aggregatedList + * @desc Retrieves an aggregated list of node types. + * @alias compute.nodeTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/nodeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTypes.get + * @desc Returns the specified node type. Get a list of available node types + * by making a list() request. + * @alias compute.nodeTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.nodeType Name of the node type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeTypes/{nodeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'nodeType'], + pathParams: ['nodeType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.nodeTypes.list + * @desc Retrieves a list of node types available to the specified project. + * @alias compute.nodeTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/nodeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.projects.disableXpnHost + * @desc Disable this project as a shared VPC host project. + * @alias compute.projects.disableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/alpha/projects/{project}/disableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.disableXpnResource + * @desc Disable a serivce resource (a.k.a service project) associated with + * this host project. + * @alias compute.projects.disableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/disableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnHost + * @desc Enable this project as a shared VPC host project. + * @alias compute.projects.enableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/enableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnResource + * @desc Enable service resource (a.k.a service project) for a host project, + * so that subnets in the host project can be used by instances in the + * service project. + * @alias compute.projects.enableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/enableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.get + * @desc Returns the specified Project resource. + * @alias compute.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnHost + * @desc Gets the shared VPC host project that this project links to. May be + * empty if no link exists. + * @alias compute.projects.getXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/getXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnResources + * @desc Gets service resources (a.k.a service project) associated with this + * host project. + * @alias compute.projects.getXpnResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnResources(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/getXpnResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.listXpnHosts + * @desc Lists all shared VPC host projects visible to the user in an + * organization. + * @alias compute.projects.listXpnHosts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {().ProjectsListXpnHostsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listXpnHosts(params?: any, options?: MethodOptions): + AxiosPromise; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/listXpnHosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveDisk + * @desc Moves a persistent disk from one zone to another. + * @alias compute.projects.moveDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DiskMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveDisk(params?: any, options?: MethodOptions): + AxiosPromise; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/moveDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveInstance + * @desc Moves an instance and its attached persistent disks from one zone + * to another. + * @alias compute.projects.moveInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveInstance(params?: any, options?: MethodOptions): + AxiosPromise; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/moveInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setCommonInstanceMetadata + * @desc Sets metadata common to all instances within the specified project + * using the data included in the request. + * @alias compute.projects.setCommonInstanceMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setCommonInstanceMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/setCommonInstanceMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setDefaultNetworkTier + * @desc Sets the default network tier of the project. The default network + * tier is used when an address/forwardingRule/instance is created without + * specifying the network tier field. + * @alias compute.projects.setDefaultNetworkTier + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsSetDefaultNetworkTierRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDefaultNetworkTier(params?: any, options?: MethodOptions): + AxiosPromise; + setDefaultNetworkTier( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDefaultNetworkTier( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/setDefaultNetworkTier') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setDefaultServiceAccount + * @desc Sets the default service account of the project. The default + * service account is used when a VM instance is created with the service + * account email address set to "default". + * @alias compute.projects.setDefaultServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsSetDefaultServiceAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDefaultServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + setDefaultServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDefaultServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/setDefaultServiceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setUsageExportBucket + * @desc Enables the usage export feature and sets the usage export bucket + * where reports are stored. If you provide an empty request body using this + * method, the usage export feature will be disabled. + * @alias compute.projects.setUsageExportBucket + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UsageExportLocation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUsageExportBucket(params?: any, options?: MethodOptions): + AxiosPromise; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/setUsageExportBucket') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionautoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionAutoscalers.delete + * @desc Deletes the specified autoscaler. + * @alias compute.regionAutoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.get + * @desc Returns the specified autoscaler. + * @alias compute.regionAutoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @alias compute.regionAutoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * region. + * @alias compute.regionAutoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @alias compute.regionAutoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionAutoscalers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @alias compute.regionAutoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionbackendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionBackendServices.delete + * @desc Deletes the specified regional BackendService resource. + * @alias compute.regionBackendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.get + * @desc Returns the specified regional BackendService resource. + * @alias compute.regionBackendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.getHealth + * @desc Gets the most recent health check results for this regional + * BackendService. + * @alias compute.regionBackendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource for which to get health. + * @param {string} params.project + * @param {string} params.region Name of the region scoping this request. + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.insert + * @desc Creates a regional BackendService resource in the specified project + * using the data included in the request. There are several restrictions + * and guidelines to keep in mind when creating a regional backend service. + * Read Restrictions and Guidelines for more information. + * @alias compute.regionBackendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.list + * @desc Retrieves the list of regional BackendService resources available + * to the specified project in the given region. + * @alias compute.regionBackendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.patch + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @alias compute.regionBackendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionBackendServices.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.update + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * @alias compute.regionBackendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioncommitments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionCommitments.aggregatedList + * @desc Retrieves an aggregated list of commitments. + * @alias compute.regionCommitments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.get + * @desc Returns the specified commitment resource. Get a list of available + * commitments by making a list() request. + * @alias compute.regionCommitments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commitment Name of the commitment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/commitments/{commitment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'commitment'], + pathParams: ['commitment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.insert + * @desc Creates a commitment in the specified project using the data + * included in the request. + * @alias compute.regionCommitments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Commitment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.list + * @desc Retrieves a list of commitments contained within the specified + * region. + * @alias compute.regionCommitments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionCommitments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/commitments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regiondisks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionDisks.createSnapshot + * @desc Creates a snapshot of this regional disk. + * @alias compute.regionDisks.createSnapshot + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to snapshot. + * @param {boolean=} params.guestFlush + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Snapshot} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSnapshot(params?: any, options?: MethodOptions): + AxiosPromise; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}/createSnapshot') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.delete + * @desc Deletes the specified regional persistent disk. Deleting a regional + * disk removes all the replicas of its data permanently and is + * irreversible. However, deleting a disk does not delete any snapshots + * previously made from the disk. You must separately delete snapshots. + * @alias compute.regionDisks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.get + * @desc Returns a specified regional persistent disk. + * @alias compute.regionDisks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.insert + * @desc Creates a persistent regional disk in the specified project using + * the data included in the request. + * @alias compute.regionDisks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. + * @param {().Disk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.list + * @desc Retrieves the list of persistent disks contained within the + * specified region. + * @alias compute.regionDisks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.resize + * @desc Resizes the specified regional persistent disk. + * @alias compute.regionDisks.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk. + * @param {string} params.project The project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionDisksResizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{disk}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.setLabels + * @desc Sets the labels on the target regional disk. + * @alias compute.regionDisks.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionDisks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regiondisktypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionDiskTypes.get + * @desc Returns the specified regional disk type. Get a list of available + * disk types by making a list() request. + * @alias compute.regionDiskTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.diskType Name of the disk type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/diskTypes/{diskType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'diskType'], + pathParams: ['diskType', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDiskTypes.list + * @desc Retrieves a list of regional disk types available to the specified + * project. + * @alias compute.regionDiskTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionhealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionHealthChecks.delete + * @desc Deletes the specified HealthCheck resource. + * @alias compute.regionHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'healthCheck'], + pathParams: ['healthCheck', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.get + * @desc Returns the specified HealthCheck resource. Get a list of available + * health checks by making a list() request. + * @alias compute.regionHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'healthCheck'], + pathParams: ['healthCheck', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.insert + * @desc Creates a HealthCheck resource in the specified project using the + * data included in the request. + * @alias compute.regionHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.list + * @desc Retrieves the list of HealthCheck resources available to the + * specified project. + * @alias compute.regionHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.patch + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @alias compute.regionHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'healthCheck'], + pathParams: ['healthCheck', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionHealthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionHealthChecks.update + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. + * @alias compute.regionHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'healthCheck'], + pathParams: ['healthCheck', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @alias compute.regionInstanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.applyUpdatesToInstances + * @desc Apply updates to selected instances the managed instance group. + * @alias compute.regionInstanceGroupManagers.applyUpdatesToInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group, should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. + * @param {().RegionInstanceGroupManagersApplyUpdatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + applyUpdatesToInstances(params?: any, options?: MethodOptions): + AxiosPromise; + applyUpdatesToInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + applyUpdatesToInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/applyUpdatesToInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. + * @alias compute.regionInstanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @alias compute.regionInstanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.deletePerInstanceConfigs + * @desc Deletes selected per-instance configs for the managed instance + * group. + * @alias compute.regionInstanceGroupManagers.deletePerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. + * @param {().RegionInstanceGroupManagerDeleteInstanceConfigReq} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deletePerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + deletePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deletePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deletePerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. + * @alias compute.regionInstanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A regional managed instance group can + * contain up to 2000 instances. + * @alias compute.regionInstanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.list + * @desc Retrieves the list of managed instance groups that are contained + * within the specified region. + * @alias compute.regionInstanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.listManagedInstances + * @desc Lists the instances in the managed instance group and instances + * that are scheduled to be created. The list includes any current actions + * that the group has scheduled for its instances. + * @alias compute.regionInstanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.listPerInstanceConfigs + * @desc Lists all of the per-instance configs defined for the managed + * instance group. + * @alias compute.regionInstanceGroupManagers.listPerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listPerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + listPerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>): void; + listPerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>): + void|AxiosPromise< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listPerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>( + parameters, callback); + } else { + return createAPIRequest< + Schema$RegionInstanceGroupManagersListInstanceConfigsResp>( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.patch + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is patched even if the instances in the group are still in the process of + * being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @alias compute.regionInstanceGroupManagers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @alias compute.regionInstanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.resize + * @desc Changes the intended size for the managed instance group. If you + * increase the size, the group schedules actions to create new instances + * using the current instance template. If you decrease the size, the group + * schedules delete actions on one or more instances. The resize operation + * is marked DONE when the resize actions are scheduled even if the group + * has not yet added or deleted any instances. You must separately verify + * the status of the creating or deleting actions with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. + * @alias compute.regionInstanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size Number of instances that should exist in this instance group manager. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setAutoHealingPolicies + * @desc Modifies the autohealing policy for the instances in this managed + * instance group. + * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetAutoHealingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoHealingPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setInstanceTemplate + * @desc Sets the instance template to use when creating new instances or + * recreating instances in this group. Existing instances are not affected. + * @alias compute.regionInstanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all new instances in this group + * are assigned. Existing instances in the group are not affected. + * @alias compute.regionInstanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionInstanceGroupManagers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.update + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is updated even if the instances in the group have not yet been updated. + * You must separately verify the status of the individual instances with + * the listmanagedinstances method. + * @alias compute.regionInstanceGroupManagers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.updatePerInstanceConfigs + * @desc Insert or patch (for the ones that already exist) per-instance + * configs for the managed instance group. perInstanceConfig.instance serves + * as a key used to distinguish whether to perform insert or patch. + * @alias compute.regionInstanceGroupManagers.updatePerInstanceConfigs + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. It should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request, should conform to RFC1035. + * @param {().RegionInstanceGroupManagerUpdateInstanceConfigReq} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatePerInstanceConfigs(params?: any, options?: MethodOptions): + AxiosPromise; + updatePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updatePerInstanceConfigs( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/updatePerInstanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroups.get + * @desc Returns the specified instance group resource. + * @alias compute.regionInstanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup Name of the instance group resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.list + * @desc Retrieves the list of instance group resources contained within the + * specified region. + * @alias compute.regionInstanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.listInstances + * @desc Lists the instances in the specified instance group and displays + * information about the named ports. Depending on the specified options, + * this method can list all instances or only the instances that are + * running. + * @alias compute.regionInstanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroups.setNamedPorts + * @desc Sets the named ports for the specified regional instance group. + * @alias compute.regionInstanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionInstanceGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionOperations.delete + * @desc Deletes the specified region-specific Operations resource. + * @alias compute.regionOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.get + * @desc Retrieves the specified region-specific Operations resource. + * @alias compute.regionOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified region. + * @alias compute.regionOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regions { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regions.get + * @desc Returns the specified Region resource. Get a list of available + * regions by making a list() request. + * @alias compute.regions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regions.list + * @desc Retrieves the list of region resources available to the specified + * project. + * @alias compute.regions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/regions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regiontargethttpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionTargetHttpProxies.delete + * @desc Deletes the specified TargetHttpProxy resource. + * @alias compute.regionTargetHttpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetHttpProxy'], + pathParams: ['project', 'region', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionTargetHttpProxies.get + * @desc Returns the specified TargetHttpProxy resource in the specified + * region. Gets a list of available target HTTP proxies by making a list() + * request. + * @alias compute.regionTargetHttpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetHttpProxy'], + pathParams: ['project', 'region', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionTargetHttpProxies.insert + * @desc Creates a TargetHttpProxy resource in the specified project and + * region using the data included in the request. + * @alias compute.regionTargetHttpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionTargetHttpProxies.list + * @desc Retrieves the list of TargetHttpProxy resources available to the + * specified project in the specified region. + * @alias compute.regionTargetHttpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionTargetHttpProxies.setUrlMap + * @desc Changes the URL map for TargetHttpProxy. + * @alias compute.regionTargetHttpProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{targetHttpProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetHttpProxy'], + pathParams: ['project', 'region', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionTargetHttpProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionTargetHttpProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetHttpProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionurlmaps { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionUrlMaps.delete + * @desc Deletes the specified UrlMap resource. + * @alias compute.regionUrlMaps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} params.urlMap Name of the UrlMap resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'urlMap'], + pathParams: ['project', 'region', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.get + * @desc Returns the specified UrlMap resource. Get a list of available URL + * maps by making a list() request. + * @alias compute.regionUrlMaps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.urlMap Name of the UrlMap resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'urlMap'], + pathParams: ['project', 'region', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.insert + * @desc Creates a UrlMap resource in the specified project using the data + * included in the request. + * @alias compute.regionUrlMaps.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.list + * @desc Retrieves the list of UrlMap resources available to the specified + * project in the specified region. + * @alias compute.regionUrlMaps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.patch + * @desc Patches the specified UrlMap resource with the data included in the + * request. This method supports PATCH semantics and uses JSON merge patch + * format and processing rules. + * @alias compute.regionUrlMaps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} params.urlMap Name of the UrlMap resource to patch. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'urlMap'], + pathParams: ['project', 'region', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionUrlMaps.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.update + * @desc Updates the specified UrlMap resource with the data included in the + * request. + * @alias compute.regionUrlMaps.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. + * @param {string} params.urlMap Name of the UrlMap resource to update. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'urlMap'], + pathParams: ['project', 'region', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionUrlMaps.validate + * @desc Runs static validation for the UrlMap. In particular, the tests of + * the provided UrlMap will be run. Calling this method does NOT create the + * UrlMap. + * @alias compute.regionUrlMaps.validate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.urlMap Name of the UrlMap resource to be validated as. + * @param {().RegionUrlMapsValidateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + validate(params?: any, options?: MethodOptions): + AxiosPromise; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/urlMaps/{urlMap}/validate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'urlMap'], + pathParams: ['project', 'region', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routers.aggregatedList + * @desc Retrieves an aggregated list of routers. + * @alias compute.routers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.delete + * @desc Deletes the specified Router resource. + * @alias compute.routers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.get + * @desc Returns the specified Router resource. Get a list of available + * routers by making a list() request. + * @alias compute.routers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.getRouterStatus + * @desc Retrieves runtime information of the specified router. + * @alias compute.routers.getRouterStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRouterStatus(params?: any, options?: MethodOptions): + AxiosPromise; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.insert + * @desc Creates a Router resource in the specified project and region using + * the data included in the request. + * @alias compute.routers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.list + * @desc Retrieves a list of Router resources available to the specified + * project. + * @alias compute.routers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.patch + * @desc Patches the specified Router resource with the data included in the + * request. This method supports PATCH semantics and uses JSON merge patch + * format and processing rules. + * @alias compute.routers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to patch. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.preview + * @desc Preview fields auto-generated during router create and update + * operations. Calling this method does NOT create or update the router. + * @alias compute.routers.preview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + preview(params?: any, options?: MethodOptions): + AxiosPromise; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}/preview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.routers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.update + * @desc Updates the specified Router resource with the data included in the + * request. + * @alias compute.routers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to update. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routes.delete + * @desc Deletes the specified Route resource. + * @alias compute.routes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.route Name of the Route resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.get + * @desc Returns the specified Route resource. Get a list of available + * routes by making a list() request. + * @alias compute.routes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.route Name of the Route resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.insert + * @desc Creates a Route resource in the specified project using the data + * included in the request. + * @alias compute.routes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Route} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.list + * @desc Retrieves the list of Route resources available to the specified + * project. + * @alias compute.routes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.routes.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/routes/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Securitypolicies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.securityPolicies.addRule + * @desc Inserts a rule into a security policy. + * @alias compute.securityPolicies.addRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {boolean=} params.validateOnly If true, the request will not be committed. + * @param {().SecurityPolicyRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addRule(params?: any, options?: MethodOptions): + AxiosPromise; + addRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/addRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.delete + * @desc Deletes the specified policy. + * @alias compute.securityPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.securityPolicy Name of the security policy to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.get + * @desc List all of the ordered rules present in a single specified policy. + * @alias compute.securityPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.getRule + * @desc Gets a rule at the specified priority. + * @alias compute.securityPolicies.getRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to get from the security policy. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to which the queried rule belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRule(params?: any, options?: MethodOptions): + AxiosPromise; + getRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/getRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.insert + * @desc Creates a new policy in the specified project using the data + * included in the request. + * @alias compute.securityPolicies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean=} params.validateOnly If true, the request will not be committed. + * @param {().SecurityPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.list + * @desc List all the policies that have been configured for the specified + * project. + * @alias compute.securityPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.patch + * @desc Patches the specified policy with the data included in the request. + * @alias compute.securityPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {().SecurityPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.patchRule + * @desc Patches a rule at the specified priority. + * @alias compute.securityPolicies.patchRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {boolean=} params.validateOnly If true, the request will not be committed. + * @param {().SecurityPolicyRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patchRule(params?: any, options?: MethodOptions): + AxiosPromise; + patchRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patchRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/patchRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.removeRule + * @desc Deletes a rule at the specified priority. + * @alias compute.securityPolicies.removeRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to remove from the security policy. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeRule(params?: any, options?: MethodOptions): + AxiosPromise; + removeRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{securityPolicy}/removeRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.securityPolicies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/securityPolicies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Snapshots { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.snapshots.delete + * @desc Deletes the specified Snapshot resource. Keep in mind that deleting + * a single snapshot might not necessarily delete all the data on that + * snapshot. If any data on the snapshot that is marked for deletion is + * needed for subsequent snapshots, the data will be moved to the next + * corresponding snapshot. For more information, see Deleting snaphots. + * @alias compute.snapshots.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.snapshot Name of the Snapshot resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.get + * @desc Returns the specified Snapshot resource. Get a list of available + * snapshots by making a list() request. + * @alias compute.snapshots.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.snapshot Name of the Snapshot resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.snapshots.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.list + * @desc Retrieves the list of Snapshot resources contained within the + * specified project. + * @alias compute.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.snapshots.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.setLabels + * @desc Sets the labels on a snapshot. To learn more about labels, read the + * Labeling Resources documentation. + * @alias compute.snapshots.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.snapshots.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/snapshots/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslcertificates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslCertificates.delete + * @desc Deletes the specified SslCertificate resource. + * @alias compute.sslCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.get + * @desc Returns the specified SslCertificate resource. Get a list of + * available SSL certificates by making a list() request. + * @alias compute.sslCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslCertificate Name of the SslCertificate resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.insert + * @desc Creates a SslCertificate resource in the specified project using + * the data included in the request. + * @alias compute.sslCertificates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.list + * @desc Retrieves the list of SslCertificate resources available to the + * specified project. + * @alias compute.sslCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.sslCertificates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslCertificates/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslpolicies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslPolicies.delete + * @desc Deletes the specified SSL policy. The SSL policy resource can be + * deleted only if it is not in use by any TargetHttpsProxy or + * TargetSslProxy resources. + * @alias compute.sslPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.get + * @desc Lists all of the ordered rules present in a single specified + * policy. + * @alias compute.sslPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.insert + * @desc Returns the specified SSL policy resource. Get a list of available + * SSL policies by making a list() request. + * @alias compute.sslPolicies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.list + * @desc Lists all the SSL policies that have been configured for the + * specified project. + * @alias compute.sslPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.listAvailableFeatures + * @desc Lists all features that can be specified in the SSL policy when + * using custom profile. + * @alias compute.sslPolicies.listAvailableFeatures + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableFeatures(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): void; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies/listAvailableFeatures') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$SslPoliciesListAvailableFeaturesResponse>(parameters); + } + } + + + /** + * compute.sslPolicies.patch + * @desc Patches the specified SSL policy with the data included in the + * request. + * @alias compute.sslPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.sslPolicies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/sslPolicies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subnetworks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.subnetworks.aggregatedList + * @desc Retrieves an aggregated list of subnetworks. + * @alias compute.subnetworks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.delete + * @desc Deletes the specified subnetwork. + * @alias compute.subnetworks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.expandIpCidrRange + * @desc Expands the IP CIDR range of the subnetwork to a specified value. + * @alias compute.subnetworks.expandIpCidrRange + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to update. + * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + expandIpCidrRange(params?: any, options?: MethodOptions): + AxiosPromise; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.get + * @desc Returns the specified subnetwork. Get a list of available + * subnetworks list() request. + * @alias compute.subnetworks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.subnetwork Name of the Subnetwork resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias compute.subnetworks.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.insert + * @desc Creates a subnetwork in the specified project using the data + * included in the request. + * @alias compute.subnetworks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.list + * @desc Retrieves a list of subnetworks available to the specified project. + * @alias compute.subnetworks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.listUsable + * @desc Retrieves an aggregated list of usable subnetworks. + * @alias compute.subnetworks.listUsable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listUsable(params?: any, options?: MethodOptions): + AxiosPromise; + listUsable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + listUsable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/subnetworks/listUsable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.subnetworks.patch + * @desc Patches the specified subnetwork with the data included in the + * request. Only the following fields within the subnetwork resource can be + * specified in the request: secondary_ip_range, + * allow_subnet_cidr_routes_overlap and role. It is also mandatory to + * specify the current fingeprint of the subnetwork resource being patched. + * @alias compute.subnetworks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to patch. + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias compute.subnetworks.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.setPrivateIpGoogleAccess + * @desc Set whether VMs in this subnet can access Google services without + * assigning external IP addresses through Private Google Access. + * @alias compute.subnetworks.setPrivateIpGoogleAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource. + * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): + AxiosPromise; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.subnetworks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpProxies.aggregatedList + * @desc Retrieves the list of all TargetHttpProxy resources, regional and + * global, available to the specified project. + * @alias compute.targetHttpProxies.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Name of the project scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetHttpProxies.delete + * @desc Deletes the specified TargetHttpProxy resource. + * @alias compute.targetHttpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.get + * @desc Returns the specified TargetHttpProxy resource. Get a list of + * available target HTTP proxies by making a list() request. + * @alias compute.targetHttpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.insert + * @desc Creates a TargetHttpProxy resource in the specified project using + * the data included in the request. + * @alias compute.targetHttpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.list + * @desc Retrieves the list of TargetHttpProxy resources available to the + * specified project. + * @alias compute.targetHttpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.setUrlMap + * @desc Changes the URL map for TargetHttpProxy. + * @alias compute.targetHttpProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetHttpProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpsproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpsProxies.delete + * @desc Deletes the specified TargetHttpsProxy resource. + * @alias compute.targetHttpsProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.get + * @desc Returns the specified TargetHttpsProxy resource. Get a list of + * available target HTTPS proxies by making a list() request. + * @alias compute.targetHttpsProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.insert + * @desc Creates a TargetHttpsProxy resource in the specified project using + * the data included in the request. + * @alias compute.targetHttpsProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpsProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.list + * @desc Retrieves the list of TargetHttpsProxy resources available to the + * specified project. + * @alias compute.targetHttpsProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setQuicOverride + * @desc Sets the QUIC override policy for TargetHttpsProxy. + * @alias compute.targetHttpsProxies.setQuicOverride + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * @param {().TargetHttpsProxiesSetQuicOverrideRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setQuicOverride(params?: any, options?: MethodOptions): + AxiosPromise; + setQuicOverride( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setQuicOverride( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslCertificates + * @desc Replaces SslCertificates for TargetHttpsProxy. + * @alias compute.targetHttpsProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslPolicy + * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the HTTPS proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetHttpsProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setUrlMap + * @desc Changes the URL map for TargetHttpsProxy. + * @alias compute.targetHttpsProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetHttpsProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetHttpsProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetinstances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetInstances.aggregatedList + * @desc Retrieves an aggregated list of target instances. + * @alias compute.targetInstances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetInstances.delete + * @desc Deletes the specified TargetInstance resource. + * @alias compute.targetInstances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetInstance Name of the TargetInstance resource to delete. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.get + * @desc Returns the specified TargetInstance resource. Get a list of + * available target instances by making a list() request. + * @alias compute.targetInstances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetInstance Name of the TargetInstance resource to return. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.insert + * @desc Creates a TargetInstance resource in the specified project and zone + * using the data included in the request. + * @alias compute.targetInstances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone scoping this request. + * @param {().TargetInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.list + * @desc Retrieves a list of TargetInstance resources available to the + * specified project and zone. + * @alias compute.targetInstances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetInstances.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetpools { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetPools.addHealthCheck + * @desc Adds health check URLs to a target pool. + * @alias compute.targetPools.addHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to add a health check to. + * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.addInstance + * @desc Adds an instance to a target pool. + * @alias compute.targetPools.addInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to add instances to. + * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstance(params?: any, options?: MethodOptions): + AxiosPromise; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.aggregatedList + * @desc Retrieves an aggregated list of target pools. + * @alias compute.targetPools.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.delete + * @desc Deletes the specified target pool. + * @alias compute.targetPools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.get + * @desc Returns the specified target pool. Get a list of available target + * pools by making a list() request. + * @alias compute.targetPools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.getHealth + * @desc Gets the most recent health check results for each IP for the + * instance that is referenced by the given target pool. + * @alias compute.targetPools.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param {().InstanceReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.insert + * @desc Creates a target pool in the specified project and region using the + * data included in the request. + * @alias compute.targetPools.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetPool} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.list + * @desc Retrieves a list of target pools available to the specified project + * and region. + * @alias compute.targetPools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeHealthCheck + * @desc Removes health check URL from a target pool. + * @alias compute.targetPools.removeHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to remove health checks from. + * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeInstance + * @desc Removes instance URL from a target pool. + * @alias compute.targetPools.removeInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. + * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstance(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.setBackup + * @desc Changes a backup target pool's configurations. + * @alias compute.targetPools.setBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {number=} params.failoverRatio New failoverRatio value for the target pool. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackup(params?: any, options?: MethodOptions): + AxiosPromise; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetPools.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetPools/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetsslproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetSslProxies.delete + * @desc Deletes the specified TargetSslProxy resource. + * @alias compute.targetSslProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.get + * @desc Returns the specified TargetSslProxy resource. Get a list of + * available target SSL proxies by making a list() request. + * @alias compute.targetSslProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.insert + * @desc Creates a TargetSslProxy resource in the specified project using + * the data included in the request. + * @alias compute.targetSslProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetSslProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.list + * @desc Retrieves the list of TargetSslProxy resources available to the + * specified project. + * @alias compute.targetSslProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setBackendService + * @desc Changes the BackendService for TargetSslProxy. + * @alias compute.targetSslProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetSslProxy. + * @alias compute.targetSslProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslCertificates + * @desc Changes SslCertificates for TargetSslProxy. + * @alias compute.targetSslProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslPolicy + * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the SSL proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetSslProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetSslProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetSslProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targettcpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetTcpProxies.delete + * @desc Deletes the specified TargetTcpProxy resource. + * @alias compute.targetTcpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.get + * @desc Returns the specified TargetTcpProxy resource. Get a list of + * available target TCP proxies by making a list() request. + * @alias compute.targetTcpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.insert + * @desc Creates a TargetTcpProxy resource in the specified project using + * the data included in the request. + * @alias compute.targetTcpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetTcpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.list + * @desc Retrieves the list of TargetTcpProxy resources available to the + * specified project. + * @alias compute.targetTcpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setBackendService + * @desc Changes the BackendService for TargetTcpProxy. + * @alias compute.targetTcpProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetTcpProxy. + * @alias compute.targetTcpProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetTcpProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/targetTcpProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetvpngateways { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetVpnGateways.aggregatedList + * @desc Retrieves an aggregated list of target VPN gateways. + * @alias compute.targetVpnGateways.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/aggregated/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetVpnGateways.delete + * @desc Deletes the specified target VPN gateway. + * @alias compute.targetVpnGateways.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.get + * @desc Returns the specified target VPN gateway. Get a list of available + * target VPN gateways by making a list() request. + * @alias compute.targetVpnGateways.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.insert + * @desc Creates a target VPN gateway in the specified project and region + * using the data included in the request. + * @alias compute.targetVpnGateways.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetVpnGateway} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.list + * @desc Retrieves a list of target VPN gateways available to the specified + * project and region. + * @alias compute.targetVpnGateways.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.setLabels + * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, + * read the Labeling Resources documentation. + * @alias compute.targetVpnGateways.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.targetVpnGateways.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Urlmaps { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.urlMaps.delete + * @desc Deletes the specified UrlMap resource. + * @alias compute.urlMaps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.get + * @desc Returns the specified UrlMap resource. Get a list of available URL + * maps by making a list() request. + * @alias compute.urlMaps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.insert + * @desc Creates a UrlMap resource in the specified project using the data + * included in the request. + * @alias compute.urlMaps.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/alpha/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.invalidateCache + * @desc Initiates a cache invalidation operation, invalidating the + * specified path, scoped to the specified UrlMap. + * @alias compute.urlMaps.invalidateCache + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap scoping this request. + * @param {().CacheInvalidationRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + invalidateCache(params?: any, options?: MethodOptions): + AxiosPromise; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.list + * @desc Retrieves the list of UrlMap resources available to the specified + * project. + * @alias compute.urlMaps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/alpha/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.patch + * @desc Patches the specified UrlMap resource with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @alias compute.urlMaps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to patch. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.urlMaps.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.update + * @desc Updates the specified UrlMap resource with the data included in the + * request. + * @alias compute.urlMaps.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to update. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.validate + * @desc Runs static validation for the UrlMap. In particular, the tests of + * the provided UrlMap will be run. Calling this method does NOT create the + * UrlMap. + * @alias compute.urlMaps.validate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to be validated as. + * @param {().UrlMapsValidateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + validate(params?: any, options?: MethodOptions): + AxiosPromise; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/global/urlMaps/{urlMap}/validate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Vpntunnels { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.vpnTunnels.aggregatedList + * @desc Retrieves an aggregated list of VPN tunnels. + * @alias compute.vpnTunnels.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/aggregated/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.delete + * @desc Deletes the specified VpnTunnel resource. + * @alias compute.vpnTunnels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.get + * @desc Returns the specified VpnTunnel resource. Get a list of available + * VPN tunnels by making a list() request. + * @alias compute.vpnTunnels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.insert + * @desc Creates a VpnTunnel resource in the specified project and region + * using the data included in the request. + * @alias compute.vpnTunnels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().VpnTunnel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.list + * @desc Retrieves a list of VpnTunnel resources contained in the specified + * project and region. + * @alias compute.vpnTunnels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.setLabels + * @desc Sets the labels on a VpnTunnel. To learn more about labels, read + * the Labeling Resources documentation. + * @alias compute.vpnTunnels.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.vpnTunnels.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zoneoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zoneOperations.delete + * @desc Deletes the specified zone-specific Operations resource. + * @alias compute.zoneOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.get + * @desc Retrieves the specified zone-specific Operations resource. + * @alias compute.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified zone. + * @alias compute.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/alpha/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zones { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zones.get + * @desc Returns the specified Zone resource. Get a list of available zones + * by making a list() request. + * @alias compute.zones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/zones/{zone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zones.list + * @desc Retrieves the list of Zone resources available to the specified + * project. + * @alias compute.zones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/alpha/projects/{project}/zones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/compute/beta.ts b/src/apis/compute/beta.ts index e700132e2df..9aa45c400d1 100644 --- a/src/apis/compute/beta.ts +++ b/src/apis/compute/beta.ts @@ -27,56226 +27,56917 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format - -/** - * Compute Engine API - * - * Creates and runs virtual machines on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const compute = google.compute('beta'); - * - * @namespace compute - * @type {Function} - * @version beta - * @variation beta - * @param {object=} options Options for Compute - */ -export class Compute { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - acceleratorTypes: Resource$Acceleratortypes; - addresses: Resource$Addresses; - autoscalers: Resource$Autoscalers; - backendBuckets: Resource$Backendbuckets; - backendServices: Resource$Backendservices; - disks: Resource$Disks; - diskTypes: Resource$Disktypes; - firewalls: Resource$Firewalls; - forwardingRules: Resource$Forwardingrules; - globalAddresses: Resource$Globaladdresses; - globalForwardingRules: Resource$Globalforwardingrules; - globalOperations: Resource$Globaloperations; - healthChecks: Resource$Healthchecks; - httpHealthChecks: Resource$Httphealthchecks; - httpsHealthChecks: Resource$Httpshealthchecks; - images: Resource$Images; - instanceGroupManagers: Resource$Instancegroupmanagers; - instanceGroups: Resource$Instancegroups; - instances: Resource$Instances; - instanceTemplates: Resource$Instancetemplates; - interconnectAttachments: Resource$Interconnectattachments; - interconnectLocations: Resource$Interconnectlocations; - interconnects: Resource$Interconnects; - licenseCodes: Resource$Licensecodes; - licenses: Resource$Licenses; - machineTypes: Resource$Machinetypes; - networks: Resource$Networks; - projects: Resource$Projects; - regionAutoscalers: Resource$Regionautoscalers; - regionBackendServices: Resource$Regionbackendservices; - regionCommitments: Resource$Regioncommitments; - regionDisks: Resource$Regiondisks; - regionDiskTypes: Resource$Regiondisktypes; - regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; - regionInstanceGroups: Resource$Regioninstancegroups; - regionOperations: Resource$Regionoperations; - regions: Resource$Regions; - routers: Resource$Routers; - routes: Resource$Routes; - securityPolicies: Resource$Securitypolicies; - snapshots: Resource$Snapshots; - sslCertificates: Resource$Sslcertificates; - sslPolicies: Resource$Sslpolicies; - subnetworks: Resource$Subnetworks; - targetHttpProxies: Resource$Targethttpproxies; - targetHttpsProxies: Resource$Targethttpsproxies; - targetInstances: Resource$Targetinstances; - targetPools: Resource$Targetpools; - targetSslProxies: Resource$Targetsslproxies; - targetTcpProxies: Resource$Targettcpproxies; - targetVpnGateways: Resource$Targetvpngateways; - urlMaps: Resource$Urlmaps; - vpnTunnels: Resource$Vpntunnels; - zoneOperations: Resource$Zoneoperations; - zones: Resource$Zones; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.acceleratorTypes = new Resource$Acceleratortypes(this); - this.addresses = new Resource$Addresses(this); - this.autoscalers = new Resource$Autoscalers(this); - this.backendBuckets = new Resource$Backendbuckets(this); - this.backendServices = new Resource$Backendservices(this); - this.disks = new Resource$Disks(this); - this.diskTypes = new Resource$Disktypes(this); - this.firewalls = new Resource$Firewalls(this); - this.forwardingRules = new Resource$Forwardingrules(this); - this.globalAddresses = new Resource$Globaladdresses(this); - this.globalForwardingRules = new Resource$Globalforwardingrules(this); - this.globalOperations = new Resource$Globaloperations(this); - this.healthChecks = new Resource$Healthchecks(this); - this.httpHealthChecks = new Resource$Httphealthchecks(this); - this.httpsHealthChecks = new Resource$Httpshealthchecks(this); - this.images = new Resource$Images(this); - this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); - this.instanceGroups = new Resource$Instancegroups(this); - this.instances = new Resource$Instances(this); - this.instanceTemplates = new Resource$Instancetemplates(this); - this.interconnectAttachments = new Resource$Interconnectattachments(this); - this.interconnectLocations = new Resource$Interconnectlocations(this); - this.interconnects = new Resource$Interconnects(this); - this.licenseCodes = new Resource$Licensecodes(this); - this.licenses = new Resource$Licenses(this); - this.machineTypes = new Resource$Machinetypes(this); - this.networks = new Resource$Networks(this); - this.projects = new Resource$Projects(this); - this.regionAutoscalers = new Resource$Regionautoscalers(this); - this.regionBackendServices = new Resource$Regionbackendservices(this); - this.regionCommitments = new Resource$Regioncommitments(this); - this.regionDisks = new Resource$Regiondisks(this); - this.regionDiskTypes = new Resource$Regiondisktypes(this); - this.regionInstanceGroupManagers = - new Resource$Regioninstancegroupmanagers(this); - this.regionInstanceGroups = new Resource$Regioninstancegroups(this); - this.regionOperations = new Resource$Regionoperations(this); - this.regions = new Resource$Regions(this); - this.routers = new Resource$Routers(this); - this.routes = new Resource$Routes(this); - this.securityPolicies = new Resource$Securitypolicies(this); - this.snapshots = new Resource$Snapshots(this); - this.sslCertificates = new Resource$Sslcertificates(this); - this.sslPolicies = new Resource$Sslpolicies(this); - this.subnetworks = new Resource$Subnetworks(this); - this.targetHttpProxies = new Resource$Targethttpproxies(this); - this.targetHttpsProxies = new Resource$Targethttpsproxies(this); - this.targetInstances = new Resource$Targetinstances(this); - this.targetPools = new Resource$Targetpools(this); - this.targetSslProxies = new Resource$Targetsslproxies(this); - this.targetTcpProxies = new Resource$Targettcpproxies(this); - this.targetVpnGateways = new Resource$Targetvpngateways(this); - this.urlMaps = new Resource$Urlmaps(this); - this.vpnTunnels = new Resource$Vpntunnels(this); - this.zoneOperations = new Resource$Zoneoperations(this); - this.zones = new Resource$Zones(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A specification of the type and number of accelerator cards attached to the - * instance. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the guest accelerator cards exposed to this instance. - */ - acceleratorCount: number; - /** - * Full or partial URL of the accelerator type resource to attach to this - * instance. If you are creating an instance template, specify only the - * accelerator name. - */ - acceleratorType: string; -} -/** - * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== - * resource_for v1.acceleratorTypes ==) - */ -export interface Schema$AcceleratorType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this accelerator type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#acceleratorType for - * accelerator types. - */ - kind: string; - /** - * [Output Only] Maximum accelerator cards allowed per instance. - */ - maximumCardsPerInstance: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the accelerator type resides, such - * as us-central1-a. You must specify this field as part of the HTTP request - * URL. It is not settable as a field in the request body. - */ - zone: string; -} -export interface Schema$AcceleratorTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator - * types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of accelerator types. - */ -export interface Schema$AcceleratorTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorType resources. - */ - items: Schema$AcceleratorType[]; - /** - * [Output Only] Type of resource. Always compute#acceleratorTypeList for - * lists of accelerator types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AcceleratorTypesScopedList { - /** - * [Output Only] A list of accelerator types contained in this scope. - */ - acceleratorTypes: Schema$AcceleratorType[]; - /** - * [Output Only] An informational warning that appears when the accelerator - * types list is empty. - */ - warning: any; -} -/** - * An access configuration attached to an instance's network interface. Only - * one access config per instance is supported. - */ -export interface Schema$AccessConfig { - /** - * [Output Only] Type of the resource. Always compute#accessConfig for access - * configs. - */ - kind: string; - /** - * The name of this access configuration. The default and recommended name is - * External NAT but you can use any arbitrary string you would like. For - * example, My external IP or Network Access. - */ - name: string; - /** - * An external IP address associated with this instance. Specify an unused - * static external IP address available to the project or leave this field - * undefined to use an IP from a shared ephemeral IP address pool. If you - * specify a static external IP address, it must live in the same region as - * the zone of the instance. - */ - natIP: string; - /** - * This signifies the networking tier used for configuring this access - * configuration and can only take the following values: PREMIUM, STANDARD. If - * an AccessConfig is specified without a valid external IP address, an - * ephemeral IP will be created with this networkTier. If an AccessConfig - * with a valid external IP address is specified, it must match that of the - * networkTier associated with the Address resource owning that IP. - */ - networkTier: string; - /** - * The DNS domain name for the public PTR record. This field can only be set - * when the set_public_ptr field is enabled. - */ - publicPtrDomainName: string; - /** - * Specifies whether a public DNS ?PTR? record should be created to map the - * external IP address of the instance to a DNS domain name. - */ - setPublicPtr: boolean; - /** - * The type of configuration. The default and only option is ONE_TO_ONE_NAT. - */ - type: string; -} -/** - * A reserved address resource. (== resource_for beta.addresses ==) (== - * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== - * resource_for v1.globalAddresses ==) - */ -export interface Schema$Address { - /** - * The static IP address represented by this resource. - */ - address: string; - /** - * The type of address to reserve, either INTERNAL or EXTERNAL. If - * unspecified, defaults to EXTERNAL. - */ - addressType: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP Version that will be used by this address. Valid options are IPV4 or - * IPV6. This can only be specified for a global address. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#address for addresses. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this Address, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an Address. - */ - labelFingerprint: string; - /** - * Labels to apply to this Address resource. These can be later modified by - * the setLabels method. Each label key/value must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * This signifies the networking tier used for configuring this Address and - * can only take the following values: PREMIUM , STANDARD. If this field is - * not specified, it is assumed to be PREMIUM. - */ - networkTier: string; - /** - * [Output Only] URL of the region where the regional address resides. This - * field is not applicable to global addresses. You must specify this field as - * part of the HTTP request URL. You cannot set this field in the request - * body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the address, which can be one of RESERVING, - * RESERVED, or IN_USE. An address that is RESERVING is currently in the - * process of being reserved. A RESERVED address is currently reserved and - * available to use. An IN_USE address is currently being used by another - * resource and is not available. - */ - status: string; - /** - * The URL of the subnetwork in which to reserve the address. If an IP address - * is specified, it must be within the subnetwork's IP range. This field - * can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER - * purposes. - */ - subnetwork: string; - /** - * [Output Only] The URLs of the resources that are using this address. - */ - users: string[]; -} -export interface Schema$AddressAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AddressesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#addressAggregatedList for - * aggregated lists of addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AddressesScopedList { - /** - * [Output Only] A list of addresses contained in this scope. - */ - addresses: Schema$Address[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -/** - * Contains a list of addresses. - */ -export interface Schema$AddressList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Address resources. - */ - items: Schema$Address[]; - /** - * [Output Only] Type of resource. Always compute#addressList for lists of - * addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An alias IP range attached to an instance's network interface. - */ -export interface Schema$AliasIpRange { - /** - * The IP CIDR range represented by this alias IP range. This IP CIDR range - * must belong to the specified subnetwork and cannot contain IP addresses - * reserved by system or used by other network interfaces. This range may be a - * single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format - * string (e.g. 10.1.2.0/24). - */ - ipCidrRange: string; - /** - * Optional subnetwork secondary range name specifying the secondary range - * from which to allocate the IP CIDR range for this alias IP range. If left - * unspecified, the primary range of the subnetwork will be used. - */ - subnetworkRangeName: string; -} -/** - * An instance-attached disk resource. - */ -export interface Schema$AttachedDisk { - /** - * Specifies whether the disk will be auto-deleted when the instance is - * deleted (but not when the disk is detached from the instance). - */ - autoDelete: boolean; - /** - * Indicates that this is a boot disk. The virtual machine will use the first - * partition of the disk for its root filesystem. - */ - boot: boolean; - /** - * Specifies a unique device name of your choice that is reflected into the - * /dev/disk/by-id/google-* tree of a Linux operating system running within - * the instance. This name can be used to reference the device for mounting, - * resizing, and so on, from within the instance. If not specified, the - * server chooses a default device name to apply to this disk, in the form - * persistent-disks-x, where x is a number assigned by Google Compute Engine. - * This field is only applicable for persistent disks. - */ - deviceName: string; - /** - * Encrypts or decrypts a disk using a customer-supplied encryption key. If - * you are creating a new disk, this field encrypts the new disk using an - * encryption key that you provide. If you are attaching an existing disk that - * is already encrypted, this field decrypts the disk using the - * customer-supplied encryption key. If you encrypt a disk using a - * customer-supplied key, you must provide the same key again when you attempt - * to use this resource at a later time. For example, you must provide the key - * when you create a snapshot or an image from the disk or when you attach the - * disk to a virtual machine instance. If you do not provide an encryption - * key, then the disk will be encrypted using an automatically generated key - * and you do not need to provide a key to use the disk later. Instance - * templates do not store customer-supplied encryption keys, so you cannot use - * your own keys to encrypt disks in a managed instance group. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] A zero-based index to this disk, where 0 is reserved for the - * boot disk. If you have many disks attached to an instance, each disk would - * have a unique index number. - */ - index: number; - /** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is - * mutually exclusive with the source property; you can only define one or the - * other, but not both. - */ - initializeParams: Schema$AttachedDiskInitializeParams; - /** - * Specifies the disk interface to use for attaching this disk, which is - * either SCSI or NVME. The default is SCSI. Persistent disks must always use - * SCSI and the request will fail if you attempt to attach a persistent disk - * in any other format than SCSI. Local SSDs can use either NVME or SCSI. For - * performance characteristics of SCSI over NVMe, see Local SSD performance. - */ - interface: string; - /** - * [Output Only] Type of the resource. Always compute#attachedDisk for - * attached disks. - */ - kind: string; - /** - * [Output Only] Any valid publicly visible licenses. - */ - licenses: string[]; - /** - * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If - * not specified, the default is to attach the disk in READ_WRITE mode. - */ - mode: string; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. When creating a new instance, one of initializeParams.sourceImage - * or disks.source is required except for local SSD. If desired, you can also - * attach existing non-root persistent disks using this property. This field - * is only applicable for persistent disks. Note that for InstanceTemplate, - * specify the disk name, not the URL for the disk. - */ - source: string; - /** - * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not - * specified, the default is PERSISTENT. - */ - type: string; -} -/** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is mutually - * exclusive with the source property; you can only define one or the other, but - * not both. - */ -export interface Schema$AttachedDiskInitializeParams { - /** - * Specifies the disk name. If not specified, the default is to use the name - * of the instance. - */ - diskName: string; - /** - * Specifies the size of the disk in base-2 GB. - */ - diskSizeGb: string; - /** - * [Deprecated] Storage type of the disk. - */ - diskStorageType: string; - /** - * Specifies the disk type to use to create the instance. If not specified, - * the default is pd-standard, specified using the full URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard - * Other values include pd-ssd and local-ssd. If you define this field, you - * can provide either the full or partial URL. For example, the following are - * valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - * - projects/project/zones/zone/diskTypes/diskType - - * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the - * name of the disk type, not URL. - */ - diskType: string; - /** - * Labels to apply to this disk. These can be later modified by the - * disks.setLabels method. This field is only applicable for persistent disks. - */ - labels: any; - /** - * The source image to create this disk. When creating a new instance, one of - * initializeParams.sourceImage or disks.source is required except for local - * SSD. To create a disk with one of the public operating system images, - * specify the image by its family name. For example, specify family/debian-8 - * to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family If the source image is deleted - * later, this field will not be set. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. Instance - * templates do not store customer-supplied encryption keys, so you cannot - * create disks for instances in a managed instance group if the source images - * are encrypted with your own keys. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": "allServices" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", }, { "log_type": "ADMIN_READ", } - * ] }, { "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": "DATA_WRITE", - * "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } - * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - exemptedMembers: string[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", } ] } This enables 'DATA_READ' and - * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ - * logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of [Binding.members][]. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Authorization-related information used by Cloud Audit Logging. - */ -export interface Schema$AuthorizationLoggingOptions { - /** - * The type of the permission that was checked. - */ - permissionType: string; -} -/** - * Represents an Autoscaler resource. Autoscalers allow you to automatically - * scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling - * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for - * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== - * resource_for v1.regionAutoscalers ==) - */ -export interface Schema$Autoscaler { - /** - * The configuration parameters for the autoscaling algorithm. You can define - * one or more of the policies for an autoscaler: cpuUtilization, - * customMetricUtilizations, and loadBalancingUtilization. If none of these - * are specified, the default will be to autoscale based on cpuUtilization to - * 0.6 or 60%. - */ - autoscalingPolicy: Schema$AutoscalingPolicy; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#autoscaler for - * autoscalers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the instance group resides (for - * autoscalers living in regional scope). - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the autoscaler configuration. - */ - status: string; - /** - * [Output Only] Human-readable details about the current state of the - * autoscaler. Read the documentation for Commonly returned status messages - * for examples of status messages you might encounter. - */ - statusDetails: Schema$AutoscalerStatusDetails[]; - /** - * URL of the managed instance group that this autoscaler will scale. - */ - target: string; - /** - * [Output Only] URL of the zone where the instance group resides (for - * autoscalers living in zonal scope). - */ - zone: string; -} -export interface Schema$AutoscalerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AutoscalersScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for - * aggregated lists of autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Autoscaler resources. - */ -export interface Schema$AutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * [Output Only] Type of resource. Always compute#autoscalerList for lists of - * autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AutoscalersScopedList { - /** - * [Output Only] A list of autoscalers contained in this scope. - */ - autoscalers: Schema$Autoscaler[]; - /** - * [Output Only] Informational warning which replaces the list of autoscalers - * when the list is empty. - */ - warning: any; -} -export interface Schema$AutoscalerStatusDetails { - /** - * The status message. - */ - message: string; - /** - * The type of error returned. - */ - type: string; -} -/** - * Cloud Autoscaler policy. - */ -export interface Schema$AutoscalingPolicy { - /** - * The number of seconds that the autoscaler should wait before it starts - * collecting information from a new instance. This prevents the autoscaler - * from collecting information when the instance is initializing, during which - * the collected usage would not be reliable. The default time autoscaler - * waits is 60 seconds. Virtual machine initialization times might vary - * because of numerous factors. We recommend that you test how long an - * instance may take to initialize. To do this, create an instance and time - * the startup process. - */ - coolDownPeriodSec: number; - /** - * Defines the CPU utilization policy that allows the autoscaler to scale - * based on the average CPU utilization of a managed instance group. - */ - cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; - /** - * Configuration parameters of autoscaling based on a custom metric. - */ - customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; - /** - * Configuration parameters of autoscaling based on load balancer. - */ - loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; - /** - * The maximum number of instances that the autoscaler can scale up to. This - * is required when creating or updating an autoscaler. The maximum number of - * replicas should not be lower than minimal number of replicas. - */ - maxNumReplicas: number; - /** - * The minimum number of replicas that the autoscaler can scale down to. This - * cannot be less than 0. If not provided, autoscaler will choose a default - * value depending on maximum number of instances allowed. - */ - minNumReplicas: number; -} -/** - * CPU utilization policy. - */ -export interface Schema$AutoscalingPolicyCpuUtilization { - /** - * The target CPU utilization that the autoscaler should maintain. Must be a - * float value in the range (0, 1]. If not specified, the default is 0.6. If - * the CPU level is below the target utilization, the autoscaler scales down - * the number of instances until it reaches the minimum number of instances - * you specified or until the average CPU of your instances reaches the target - * utilization. If the average CPU is above the target utilization, the - * autoscaler scales up until it reaches the maximum number of instances you - * specified or until the average utilization reaches the target utilization. - */ - utilizationTarget: number; -} -/** - * Custom utilization metric policy. - */ -export interface Schema$AutoscalingPolicyCustomMetricUtilization { - /** - * A filter string, compatible with a Stackdriver Monitoring filter string for - * TimeSeries.list API call. This filter is used to select a specific - * TimeSeries for the purpose of autoscaling and to determine whether the - * metric is exporting per-instance or per-group data. For the filter to be - * valid for autoscaling purposes, the following rules apply: - You can only - * use the AND operator for joining selectors. - You can only use direct - * equality comparison operator (=) without any functions for each selector. - * - You can specify the metric in both the filter string and in the metric - * field. However, if specified in both places, the metric must be identical. - * - The monitored resource type determines what kind of values are expected - * for the metric. If it is a gce_instance, the autoscaler expects the metric - * to include a separate TimeSeries for each instance in a group. In such a - * case, you cannot filter on resource labels. If the resource type is any - * other value, the autoscaler expects this metric to contain values that - * apply to the entire autoscaled instance group and resource label filtering - * can be performed to point autoscaler at the correct TimeSeries to scale - * upon. This is called a per-group metric for the purpose of autoscaling. If - * not specified, the type defaults to gce_instance. You should provide a - * filter that is selective enough to pick just one TimeSeries for the - * autoscaled group or for each of the instances (if you are using - * gce_instance resource type). If multiple TimeSeries are returned upon the - * query execution, the autoscaler will sum their respective values to obtain - * its scaling value. - */ - filter: string; - /** - * The identifier (type) of the Stackdriver Monitoring metric. The metric - * cannot have negative values. The metric must have a value type of INT64 or - * DOUBLE. - */ - metric: string; - /** - * If scaling is based on a per-group metric value that represents the total - * amount of work to be done or resource usage, set this value to an amount - * assigned for a single instance of the scaled group. Autoscaler will keep - * the number of instances proportional to the value of this metric, the - * metric itself should not change value due to group resizing. A good metric - * to use with the target is for example - * pubsub.googleapis.com/subscription/num_undelivered_messages or a custom - * metric exporting the total number of requests coming to your instances. A - * bad example would be a metric exporting an average or median latency, since - * this value can't include a chunk assignable to a single instance, it - * could be better used with utilization_target instead. - */ - singleInstanceAssignment: number; - /** - * The target value of the metric that autoscaler should maintain. This must - * be a positive value. A utilization metric scales number of virtual machines - * handling requests to increase or decrease proportionally to the metric. For - * example, a good metric to use as a utilization_target is - * compute.googleapis.com/instance/network/received_bytes_count. The - * autoscaler will work to keep this value constant for each of the instances. - */ - utilizationTarget: number; - /** - * Defines how target utilization value is expressed for a Stackdriver - * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If - * not specified, the default is GAUGE. - */ - utilizationTargetType: string; -} -/** - * Configuration parameters of autoscaling based on load balancing. - */ -export interface Schema$AutoscalingPolicyLoadBalancingUtilization { - /** - * Fraction of backend capacity utilization (set in HTTP(s) load balancing - * configuration) that autoscaler should maintain. Must be a positive float - * value. If not defined, the default is 0.8. - */ - utilizationTarget: number; -} -/** - * Message containing information of one individual backend. - */ -export interface Schema$Backend { - /** - * Specifies the balancing mode for this backend. For global HTTP(S) or - * TCP/SSL load balancing, the default is UTILIZATION. Valid values are - * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For Internal - * Load Balancing, the default and only supported mode is CONNECTION. - */ - balancingMode: string; - /** - * A multiplier applied to the group's maximum servicing capacity (based - * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the - * group will serve up to 100% of its configured capacity (depending on - * balancingMode). A setting of 0 means the group is completely drained, - * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This - * cannot be used for internal load balancing. - */ - capacityScaler: number; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The fully-qualified URL of a Instance Group resource. This instance group - * defines the list of instances that serve traffic. Member virtual machine - * instances from each instance group must live in the same zone as the - * instance group itself. No two backends in a backend service are allowed to - * use same Instance Group resource. Note that you must specify an Instance - * Group resource using the fully-qualified URL, rather than a partial URL. - * When the BackendService has load balancing scheme INTERNAL, the instance - * group must be within the same region as the BackendService. - */ - group: string; - /** - * The max number of simultaneous connections for the group. Can be used with - * either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, - * either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnections: number; - /** - * The max number of simultaneous connections that a single backend instance - * can handle. This is used to calculate the capacity of the group. Can be - * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION - * mode, either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnectionsPerInstance: number; - /** - * The max requests per second (RPS) of the group. Can be used with either - * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE - * mode, either maxRate or maxRatePerInstance must be set. This cannot be - * used for internal load balancing. - */ - maxRate: number; - /** - * The max requests per second (RPS) that a single backend instance can - * handle. This is used to calculate the capacity of the group. Can be used in - * either balancing mode. For RATE mode, either maxRate or maxRatePerInstance - * must be set. This cannot be used for internal load balancing. - */ - maxRatePerInstance: number; - /** - * Used when balancingMode is UTILIZATION. This ratio defines the CPU - * utilization target for the group. The default is 0.8. Valid range is - * [0.0, 1.0]. This cannot be used for internal load balancing. - */ - maxUtilization: number; -} -/** - * A BackendBucket resource. This resource defines a Cloud Storage bucket. - */ -export interface Schema$BackendBucket { - /** - * Cloud Storage bucket name. - */ - bucketName: string; - /** - * Cloud CDN Coniguration for this BackendBucket. - */ - cdnPolicy: Schema$BackendBucketCdnPolicy; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendBucket. - */ - enableCdn: boolean; - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Message containing Cloud CDN configuration for a backend bucket. - */ -export interface Schema$BackendBucketCdnPolicy { - /** - * Number of seconds up to which the response to a signed URL request will be - * cached in the CDN. After this time period, the Signed URL will be - * revalidated before being served. Defaults to 1hr (3600s). If this field is - * set, Cloud CDN will internally act as though all responses from this bucket - * had a ?Cache-Control: public, max-age=[TTL]? header, regardless of any - * existing Cache-Control header. The actual headers served in responses will - * not be altered. - */ - signedUrlCacheMaxAgeSec: string; - /** - * [Output Only] Names of the keys currently configured for Cloud CDN Signed - * URL on this backend bucket. - */ - signedUrlKeyNames: string[]; -} -/** - * Contains a list of BackendBucket resources. - */ -export interface Schema$BackendBucketList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendBucket resources. - */ - items: Schema$BackendBucket[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A BackendService resource. This resource defines a group of backend virtual - * machines and their serving capacity. (== resource_for v1.backendService ==) - * (== resource_for beta.backendService ==) - */ -export interface Schema$BackendService { - /** - * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If - * set to 0, the cookie is non-persistent and lasts only until the end of the - * browser session (or equivalent). The maximum allowed value for TTL is one - * day. When the load balancing scheme is INTERNAL, this field is not used. - */ - affinityCookieTtlSec: number; - /** - * The list of backends that serve this BackendService. - */ - backends: Schema$Backend[]; - /** - * Cloud CDN configuration for this BackendService. - */ - cdnPolicy: Schema$BackendServiceCdnPolicy; - connectionDraining: Schema$ConnectionDraining; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Headers that the HTTP/S load balancer should add to proxied requests. - */ - customRequestHeaders: string[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendService. When the load balancing - * scheme is INTERNAL, this field is not used. - */ - enableCDN: boolean; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a BackendService. An up-to-date fingerprint must be provided in - * order to update the BackendService. - */ - fingerprint: string; - /** - * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for - * health checking this BackendService. Currently at most one health check can - * be specified, and a health check is required for Compute Engine backend - * services. A health check must not be specified for App Engine backend and - * Cloud Function backend. For internal load balancing, a URL to a - * HealthCheck resource must be specified instead. - */ - healthChecks: string[]; - iap: Schema$BackendServiceIAP; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#backendService for backend - * services. - */ - kind: string; - /** - * Indicates whether the backend service will be used with internal or - * external load balancing. A backend service created for one type of load - * balancing cannot be used with the other. Possible values are INTERNAL and - * EXTERNAL. - */ - loadBalancingScheme: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Deprecated in favor of portName. The TCP port to connect on the backend. - * The default value is 80. This cannot be used for internal load balancing. - */ - port: number; - /** - * Name of backend port. The same name should appear in the instance groups - * referenced by this service. Required when the load balancing scheme is - * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not - * used. - */ - portName: string; - /** - * The protocol this BackendService uses to communicate with backends. - * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For - * internal load balancing, the possible values are TCP and UDP, and the - * default is TCP. - */ - protocol: string; - /** - * [Output Only] URL of the region where the regional backend service resides. - * This field is not applicable to global backend services. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] The resource URL for the security policy associated with this - * backend service. - */ - securityPolicy: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Type of session affinity to use. The default is NONE. When the load - * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. - * When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, - * CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the protocol is UDP, this - * field is not used. - */ - sessionAffinity: string; - /** - * How many seconds to wait for the backend before considering it a failed - * request. Default is 30 seconds. - */ - timeoutSec: number; -} -/** - * Contains a list of BackendServicesScopedList. - */ -export interface Schema$BackendServiceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendServicesScopedList resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Message containing Cloud CDN configuration for a backend service. - */ -export interface Schema$BackendServiceCdnPolicy { - /** - * The CacheKeyPolicy for this CdnPolicy. - */ - cacheKeyPolicy: Schema$CacheKeyPolicy; - /** - * Number of seconds up to which the response to a signed URL request will be - * cached in the CDN. After this time period, the Signed URL will be - * revalidated before being served. Defaults to 1hr (3600s). If this field is - * set, Cloud CDN will internally act as though all responses from this - * backend had a ?Cache-Control: public, max-age=[TTL]? header, regardless of - * any existing Cache-Control header. The actual headers served in responses - * will not be altered. - */ - signedUrlCacheMaxAgeSec: string; - /** - * [Output Only] Names of the keys currently configured for Cloud CDN Signed - * URL on this backend service. - */ - signedUrlKeyNames: string[]; -} -export interface Schema$BackendServiceGroupHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceGroupHealth - * for the health of backend services. - */ - kind: string; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$BackendServiceIAP { - enabled: boolean; - oauth2ClientId: string; - oauth2ClientSecret: string; - /** - * [Output Only] SHA256 hash value for the field oauth2_client_secret above. - */ - oauth2ClientSecretSha256: string; -} -/** - * Contains a list of BackendService resources. - */ -export interface Schema$BackendServiceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendService resources. - */ - items: Schema$BackendService[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceList for lists - * of backend services. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$BackendServicesScopedList { - /** - * A list of BackendServices contained in this scope. - */ - backendServices: Schema$BackendService[]; - /** - * Informational warning which replaces the list of backend services when the - * list is empty. - */ - warning: any; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * The condition that is associated with this binding. NOTE: an unsatisfied - * condition will not allow user access via current binding. Different - * bindings, including their conditions, are examined independently. This - * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. - */ - condition: Schema$Expr; - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or without a - * Google account. * `allAuthenticatedUsers`: A special identifier that - * represents anyone who is authenticated with a Google account or a service - * account. * `user:{emailid}`: An email address that represents a specific - * Google account. For example, `alice@gmail.com` or `joe@example.com`. * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. - */ - role: string; -} -export interface Schema$CacheInvalidationRule { - /** - * If set, this invalidation rule will only apply to requests with a Host - * header matching host. - */ - host: string; - path: string; -} -/** - * Message containing what to include in the cache key for a request for Cloud - * CDN. - */ -export interface Schema$CacheKeyPolicy { - /** - * If true, requests to different hosts will be cached separately. - */ - includeHost: boolean; - /** - * If true, http and https requests will be cached separately. - */ - includeProtocol: boolean; - /** - * If true, include query string parameters in the cache key according to - * query_string_whitelist and query_string_blacklist. If neither is set, the - * entire query string will be included. If false, the query string will be - * excluded from the cache key entirely. - */ - includeQueryString: boolean; - /** - * Names of query string parameters to exclude in cache keys. All other - * parameters will be included. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringBlacklist: string[]; - /** - * Names of query string parameters to include in cache keys. All other - * parameters will be excluded. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringWhitelist: string[]; -} -/** - * Represents a Commitment resource. Creating a Commitment resource means that - * you are purchasing a committed use contract with an explicit start and end - * time. You can create commitments based on vCPUs and memory usage and receive - * discounted rates. For full details, read Signing Up for Committed Use - * Discounts. Committed use discounts are subject to Google Cloud - * Platform's Service Specific Terms. By purchasing a committed use - * discount, you agree to these terms. Committed use discounts will not renew, - * so you must purchase a new commitment to continue receiving discounts. (== - * resource_for beta.commitments ==) (== resource_for v1.commitments ==) - */ -export interface Schema$Commitment { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Commitment end time in RFC3339 text format. - */ - endTimestamp: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#commitment for - * commitments. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The plan for this commitment, which determines duration and discount rate. - * The currently supported plans are TWELVE_MONTH (1 year), and - * THIRTY_SIX_MONTH (3 years). - */ - plan: string; - /** - * [Output Only] URL of the region where this commitment may be used. - */ - region: string; - /** - * A list of commitment amounts for particular resources. Note that VCPU and - * MEMORY resource commitments must occur together. - */ - resources: Schema$ResourceCommitment[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Commitment start time in RFC3339 text format. - */ - startTimestamp: string; - /** - * [Output Only] Status of the commitment with regards to eventual expiration - * (each commitment has an end date defined). One of the following values: - * NOT_YET_ACTIVE, ACTIVE, EXPIRED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; -} -export interface Schema$CommitmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of CommitmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#commitmentAggregatedList for - * aggregated lists of commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Commitment resources. - */ -export interface Schema$CommitmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Commitment resources. - */ - items: Schema$Commitment[]; - /** - * [Output Only] Type of resource. Always compute#commitmentList for lists of - * commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$CommitmentsScopedList { - /** - * [Output Only] A list of commitments contained in this scope. - */ - commitments: Schema$Commitment[]; - /** - * [Output Only] Informational warning which replaces the list of commitments - * when the list is empty. - */ - warning: any; -} -/** - * A condition to be met. - */ -export interface Schema$Condition { - /** - * Trusted attributes supplied by the IAM system. - */ - iam: string; - /** - * An operator to apply the subject with. - */ - op: string; - /** - * Trusted attributes discharged by the service. - */ - svc: string; - /** - * Trusted attributes supplied by any service that owns resources and uses the - * IAM system for access control. - */ - sys: string; - /** - * DEPRECATED. Use 'values' instead. - */ - value: string; - /** - * The objects of the condition. This is mutually exclusive with - * 'value'. - */ - values: string[]; -} -/** - * Message containing connection draining configuration. - */ -export interface Schema$ConnectionDraining { - /** - * Time for which instance will be drained (not accept new connections, but - * still work to finish started). - */ - drainingTimeoutSec: number; -} -/** - * Represents a customer-supplied encryption key - */ -export interface Schema$CustomerEncryptionKey { - /** - * The name of the encryption key that is stored in Google Cloud KMS. - */ - kmsKeyName: string; - /** - * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - * base64 to either encrypt or decrypt this resource. - */ - rawKey: string; - /** - * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit - * customer-supplied encryption key to either encrypt or decrypt this - * resource. The key must meet the following requirements before you can - * provide it to Compute Engine: - The key is wrapped using a RSA public key - * certificate provided by Google. - After being wrapped, the key must be - * encoded in RFC 4648 base64 encoding. Gets the RSA public key certificate - * provided by Google at: - * https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem - */ - rsaEncryptedKey: string; - /** - * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the - * customer-supplied encryption key that protects this resource. - */ - sha256: string; -} -export interface Schema$CustomerEncryptionKeyProtectedDisk { - /** - * Decrypts data associated with the disk with a customer-supplied encryption - * key. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. This field is only applicable for persistent disks. - */ - source: string; -} -/** - * Deprecation status for a public resource. - */ -export interface Schema$DeprecationStatus { - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DELETED. This is only informational and the status - * will not change unless the client explicitly changes it. - */ - deleted: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DEPRECATED. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - deprecated: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to OBSOLETE. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - obsolete: string; - /** - * The URL of the suggested replacement for a deprecated resource. The - * suggested replacement resource must be the same kind of resource as the - * deprecated resource. - */ - replacement: string; - /** - * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, - * or DELETED. Operations which create a new resource using a DEPRECATED - * resource will return successfully, but with a warning indicating the - * deprecated resource and recommending its replacement. Operations which use - * OBSOLETE or DELETED resources will be rejected and result in an error. - */ - state: string; -} -/** - * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks - * ==) - */ -export interface Schema$Disk { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Encrypts the disk using a customer-supplied encryption key. After you - * encrypt a disk with a customer-supplied key, you must provide the same key - * if you use the disk later (e.g. to create a disk snapshot or an image, or - * to attach the disk to a virtual machine). Customer-supplied encryption - * keys do not protect access to metadata of the disk. If you do not provide - * an encryption key when creating the disk, then the disk will be encrypted - * using an automatically generated key and you do not need to provide a key - * to use the disk later. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#disk for disks. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this disk, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a disk. - */ - labelFingerprint: string; - /** - * Labels to apply to this disk. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * [Output Only] Last attach timestamp in RFC3339 text format. - */ - lastAttachTimestamp: string; - /** - * [Output Only] Last detach timestamp in RFC3339 text format. - */ - lastDetachTimestamp: string; - /** - * Integer license codes indicating which licenses are attached to this disk. - */ - licenseCodes: string[]; - /** - * Any applicable publicly visible licenses. - */ - licenses: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Internal use only. - */ - options: string; - /** - * [Output Only] URL of the region where the disk resides. Only applicable for - * regional resources. You must specify this field as part of the HTTP request - * URL. It is not settable as a field in the request body. - */ - region: string; - /** - * URLs of the zones where the disk should be replicated to. Only applicable - * for regional resources. - */ - replicaZones: string[]; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * Size of the persistent disk, specified in GB. You can specify this field - * when creating a persistent disk using the sourceImage or sourceSnapshot - * parameter, or specify it alone to create an empty persistent disk. If you - * specify this field along with sourceImage or sourceSnapshot, the value of - * sizeGb must not be less than the size of the sourceImage or the size of the - * snapshot. Acceptable values are 1 to 65536, inclusive. - */ - sizeGb: string; - /** - * The source image used to create this disk. If the source image is deleted, - * this field will not be set. To create a disk with one of the public - * operating system images, specify the image by its family name. For example, - * specify family/debian-8 to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this disk. This - * value identifies the exact image that was used to create this persistent - * disk. For example, if you created the persistent disk from an image that - * was later deleted and recreated under the same name, the source image ID - * would identify the exact version of the image that was used. - */ - sourceImageId: string; - /** - * The source snapshot used to create this disk. You can provide this as a - * partial or full URL to the resource. For example, the following are valid - * values: - - * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot - * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The unique ID of the snapshot used to create this disk. This - * value identifies the exact snapshot that was used to create this persistent - * disk. For example, if you created the persistent disk from a snapshot that - * was later deleted and recreated under the same name, the source snapshot ID - * would identify the exact version of the snapshot that was used. - */ - sourceSnapshotId: string; - /** - * [Output Only] The status of disk creation. - */ - status: string; - /** - * [Deprecated] Storage type of the persistent disk. - */ - storageType: string; - /** - * URL of the disk type resource describing which disk type to use to create - * the disk. Provide this when creating the disk. For example: - * project/zones/zone/diskTypes/pd-standard or pd-ssd - */ - type: string; - /** - * [Output Only] Links to the users of the disk (attached instances) in form: - * project/zones/zone/instances/instance - */ - users: string[]; - /** - * [Output Only] URL of the zone where the disk resides. You must specify this - * field as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$DiskAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DisksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskAggregatedList for - * aggregated lists of persistent disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A specification of the desired way to instantiate a disk in the instance - * template when its created from a source instance. - */ -export interface Schema$DiskInstantiationConfig { - /** - * Specifies whether the disk will be auto-deleted when the instance is - * deleted (but not when the disk is detached from the instance). - */ - autoDelete: boolean; - /** - * The custom source image to be used to restore this disk when instantiating - * this instance template. - */ - customImage: string; - /** - * Specifies the device name of the disk to which the configurations apply to. - */ - deviceName: string; - /** - * Specifies whether to include the disk and what image to use. Possible - * values are: - source-image: to use the same image that was used to create - * the source instance's corresponding disk. Applicable to the boot disk - * and additional read-write disks. - source-image-family: to use the same - * image family that was used to create the source instance's - * corresponding disk. Applicable to the boot disk and additional read-write - * disks. - custom-image: to use a user-provided image url for disk creation. - * Applicable to the boot disk and additional read-write disks. - - * attach-read-only: to attach a read-only disk. Applicable to read-only - * disks. - do-not-include: to exclude a disk from the template. Applicable - * to additional read-write disks, local SSDs, and read-only disks. - */ - instantiateFrom: string; -} -/** - * A list of Disk resources. - */ -export interface Schema$DiskList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Disk resources. - */ - items: Schema$Disk[]; - /** - * [Output Only] Type of resource. Always compute#diskList for lists of disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskMoveRequest { - /** - * The URL of the destination zone to move the disk. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target disk to move. This can be a full or partial URL. For - * example, the following are all valid URLs to a disk: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - targetDisk: string; -} -export interface Schema$DisksResizeRequest { - /** - * The new size of the persistent disk, which is specified in GB. - */ - sizeGb: string; -} -export interface Schema$DisksScopedList { - /** - * [Output Only] A list of disks contained in this scope. - */ - disks: Schema$Disk[]; - /** - * [Output Only] Informational warning which replaces the list of disks when - * the list is empty. - */ - warning: any; -} -/** - * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for - * v1.diskTypes ==) - */ -export interface Schema$DiskType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Server-defined default disk size in GB. - */ - defaultDiskSizeGb: string; - /** - * [Output Only] The deprecation status associated with this disk type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional description of this resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#diskType for disk types. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] An optional textual description of the valid disk size, such - * as "10GB-10TB". - */ - validDiskSize: string; - /** - * [Output Only] URL of the zone where the disk type resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$DiskTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of disk types. - */ -export interface Schema$DiskTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskType resources. - */ - items: Schema$DiskType[]; - /** - * [Output Only] Type of resource. Always compute#diskTypeList for disk types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskTypesScopedList { - /** - * [Output Only] A list of disk types contained in this scope. - */ - diskTypes: Schema$DiskType[]; - /** - * [Output Only] Informational warning which replaces the list of disk types - * when the list is empty. - */ - warning: any; -} -export interface Schema$DistributionPolicy { - zones: Schema$DistributionPolicyZoneConfiguration[]; -} -export interface Schema$DistributionPolicyZoneConfiguration { - /** - * URL of the zone where managed instance group is spawning instances (for - * regional resources). Zone has to belong to the region where managed - * instance group is located. - */ - zone: string; -} -/** - * Represents an expression text. Example: title: "User account - * presence" description: "Determines whether the request has a user - * account" expression: "size(request.user) > 0" - */ -export interface Schema$Expr { - /** - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - */ - description: string; - /** - * Textual representation of an expression in Common Expression Language - * syntax. The application context of the containing message determines which - * well-known feature set of CEL is supported. - */ - expression: string; - /** - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - */ - location: string; - /** - * An optional title for the expression, i.e. a short string describing its - * purpose. This can be used e.g. in UIs which allow to enter the expression. - */ - title: string; -} -/** - * Represents a Firewall resource. - */ -export interface Schema$Firewall { - /** - * The list of ALLOW rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a permitted connection. - */ - allowed: any[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The list of DENY rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a denied connection. - */ - denied: any[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If destination ranges are specified, the firewall will apply only to - * traffic that has destination IP address in these ranges. These ranges must - * be expressed in CIDR format. Only IPv4 is supported. - */ - destinationRanges: string[]; - /** - * Direction of traffic to which this firewall applies; default is INGRESS. - * Note: For INGRESS traffic, it is NOT supported to specify - * destinationRanges; For EGRESS traffic, it is NOT supported to specify - * sourceRanges OR sourceTags. - */ - direction: string; - /** - * Denotes whether the firewall rule is disabled, i.e not applied to the - * network it is associated with. When set to true, the firewall rule is not - * enforced and the network behaves as if it did not exist. If this is - * unspecified, the firewall rule will be enabled. - */ - disabled: boolean; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#firewall for firewall - * rules. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network resource for this firewall rule. If not specified when - * creating a firewall rule, the default network is used: - * global/networks/default If you choose to specify this property, you can - * specify the network as a full or partial URL. For example, the following - * are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - * - projects/myproject/global/networks/my-network - global/networks/default - */ - network: string; - /** - * Priority for this rule. This is an integer between 0 and 65535, both - * inclusive. When not specified, the value assumed is 1000. Relative - * priorities determine precedence of conflicting rules. Lower value of - * priority implies higher precedence (eg, a rule with priority 0 has higher - * precedence than a rule with priority 1). DENY rules take precedence over - * ALLOW rules having equal priority. - */ - priority: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If source ranges are specified, the firewall will apply only to traffic - * that has source IP address in these ranges. These ranges must be expressed - * in CIDR format. One or both of sourceRanges and sourceTags may be set. If - * both properties are set, the firewall will apply to traffic that has source - * IP address within sourceRanges OR the source IP that belongs to a tag - * listed in the sourceTags property. The connection does not need to match - * both properties for the firewall to apply. Only IPv4 is supported. - */ - sourceRanges: string[]; - /** - * If source service accounts are specified, the firewall will apply only to - * traffic originating from an instance with a service account in this list. - * Source service accounts cannot be used to control traffic to an - * instance's external IP address because service accounts are associated - * with an instance, not an IP address. sourceRanges can be set at the same - * time as sourceServiceAccounts. If both are set, the firewall will apply to - * traffic that has source IP address within sourceRanges OR the source IP - * belongs to an instance with service account listed in sourceServiceAccount. - * The connection does not need to match both properties for the firewall to - * apply. sourceServiceAccounts cannot be used at the same time as sourceTags - * or targetTags. - */ - sourceServiceAccounts: string[]; - /** - * If source tags are specified, the firewall rule applies only to traffic - * with source IPs that match the primary network interfaces of VM instances - * that have the tag and are in the same VPC network. Source tags cannot be - * used to control traffic to an instance's external IP address, it only - * applies to traffic between instances in the same virtual network. Because - * tags are associated with instances, not IP addresses. One or both of - * sourceRanges and sourceTags may be set. If both properties are set, the - * firewall will apply to traffic that has source IP address within - * sourceRanges OR the source IP that belongs to a tag listed in the - * sourceTags property. The connection does not need to match both properties - * for the firewall to apply. - */ - sourceTags: string[]; - /** - * A list of service accounts indicating sets of instances located in the - * network that may make network connections as specified in allowed[]. - * targetServiceAccounts cannot be used at the same time as targetTags or - * sourceTags. If neither targetServiceAccounts nor targetTags are specified, - * the firewall rule applies to all instances on the specified network. - */ - targetServiceAccounts: string[]; - /** - * A list of tags that controls which instances the firewall rule applies to. - * If targetTags are specified, then the firewall rule applies only to - * instances in the VPC network that have one of those tags. If no targetTags - * are specified, the firewall rule applies to all instances on the specified - * network. - */ - targetTags: string[]; -} -/** - * Contains a list of firewalls. - */ -export interface Schema$FirewallList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Firewall resources. - */ - items: Schema$Firewall[]; - /** - * [Output Only] Type of resource. Always compute#firewallList for lists of - * firewalls. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Encapsulates numeric value that can be either absolute or relative. - */ -export interface Schema$FixedOrPercent { - /** - * [Output Only] Absolute value of VM instances calculated based on the - * specific mode. - If the value is fixed, then the caculated value is - * equal to the fixed value. - If the value is a percent, then the calculated - * value is percent/100 * targetSize. For example, the calculated value of a - * 80% of a managed instance group with 150 instances would be (80/100 * 150) - * = 120 VM instances. If there is a remainder, the number is rounded up. - */ - calculated: number; - /** - * Specifies a fixed number of VM instances. This must be a positive integer. - */ - fixed: number; - /** - * Specifies a percentage of instances between 0 to 100%, inclusive. For - * example, specify 80 for 80%. - */ - percent: number; -} -/** - * A ForwardingRule resource. A ForwardingRule resource specifies which pool of - * target virtual machines to forward a packet to if it matches the given - * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules - * ==) (== resource_for v1.forwardingRules ==) (== resource_for - * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) - * (== resource_for beta.regionForwardingRules ==) (== resource_for - * v1.regionForwardingRules ==) - */ -export interface Schema$ForwardingRule { - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the BackendService resource to receive the - * matched traffic. - */ - backendService: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP address that this forwarding rule is serving on behalf of. Addresses - * are restricted based on the forwarding rule's load balancing scheme - * (EXTERNAL or INTERNAL) and scope (global or regional). When the load - * balancing scheme is EXTERNAL, for global forwarding rules, the address must - * be a global IP, and for regional forwarding rules, the address must live in - * the same region as the forwarding rule. If this field is empty, an - * ephemeral IPv4 address from the same scope (global or regional) will be - * assigned. A regional forwarding rule supports IPv4 only. A global - * forwarding rule supports either IPv4 or IPv6. When the load balancing - * scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to - * the network/subnet configured for the forwarding rule. By default, if this - * field is empty, an ephemeral internal IP address will be automatically - * allocated from the IP range of the subnet or network configured for this - * forwarding rule. An address can be specified either by a literal IP - * address or a URL reference to an existing Address resource. The following - * examples are all valid: - 100.1.2.3 - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address - * - projects/project/regions/region/addresses/address - - * regions/region/addresses/address - global/addresses/address - address - */ - IPAddress: string; - /** - * The IP protocol to which this rule applies. Valid options are TCP, UDP, - * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only - * TCP and UDP are valid. - */ - IPProtocol: string; - /** - * The IP Version that will be used by this forwarding rule. Valid options are - * IPV4 or IPV6. This can only be specified for a global forwarding rule. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#forwardingRule for - * Forwarding Rule resources. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this resource, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a ForwardingRule. - */ - labelFingerprint: string; - /** - * Labels to apply to this resource. These can be later modified by the - * setLabels method. Each label key/value pair must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * This signifies what the ForwardingRule will be used for and can only take - * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that - * this will be used for Internal Network Load Balancing (TCP, UDP). The value - * of EXTERNAL means that this will be used for External Load Balancing - * (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) - */ - loadBalancingScheme: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the network that the load balanced IP - * should belong to for this Forwarding Rule. If this field is not specified, - * the default network will be used. - */ - network: string; - /** - * This signifies the networking tier used for configuring this load balancer - * and can only take the following values: PREMIUM , STANDARD. For regional - * ForwardingRule, the valid values are PREMIUM and STANDARD. For - * GlobalForwardingRule, the valid value is PREMIUM. If this field is not - * specified, it is assumed to be PREMIUM. If IPAddress is specified, this - * value must be equal to the networkTier of the Address. - */ - networkTier: string; - /** - * This field is used along with the target field for TargetHttpProxy, - * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, - * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, - * or SCTP, only packets addressed to ports in the specified range will be - * forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] - * pair must have disjoint port ranges. Some types of forwarding target have - * constraints on the acceptable ports: - TargetHttpProxy: 80, 8080 - - * TargetHttpsProxy: 443 - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, - * 587, 700, 993, 995, 1688, 1883, 5222 - TargetSslProxy: 25, 43, 110, 143, - * 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - TargetVpnGateway: - * 500, 4500 - */ - portRange: string; - /** - * This field is used along with the backend_service field for internal load - * balancing. When the load balancing scheme is INTERNAL, a single port or a - * comma separated list of ports can be configured. Only packets addressed to - * these ports will be forwarded to the backends configured with this - * forwarding rule. You may specify a maximum of up to 5 ports. - */ - ports: string[]; - /** - * [Output Only] URL of the region where the regional forwarding rule resides. - * This field is not applicable to global forwarding rules. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * An optional prefix to the service name for this Forwarding Rule. If - * specified, will be the first label of the fully qualified service name. The - * label must be 1-63 characters long, and comply with RFC1035. Specifically, - * the label must be 1-63 characters long and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a - * lowercase letter, and all following characters must be a dash, lowercase - * letter, or digit, except the last character, which cannot be a dash. This - * field is only used for internal load balancing. - */ - serviceLabel: string; - /** - * [Output Only] The internal fully qualified service name for this Forwarding - * Rule. This field is only used for internal load balancing. - */ - serviceName: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the subnetwork that the load balanced IP - * should belong to for this Forwarding Rule. If the network specified is in - * auto subnet mode, this field is optional. However, if the network is in - * custom subnet mode, a subnetwork must be specified. - */ - subnetwork: string; - /** - * The URL of the target resource to receive the matched traffic. For regional - * forwarding rules, this target must live in the same region as the - * forwarding rule. For global forwarding rules, this target must be a global - * load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. - */ - target: string; -} -export interface Schema$ForwardingRuleAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRulesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList - * for lists of forwarding rules. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of ForwardingRule resources. - */ -export interface Schema$ForwardingRuleList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRule resources. - */ - items: Schema$ForwardingRule[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ForwardingRulesScopedList { - /** - * A list of forwarding rules contained in this scope. - */ - forwardingRules: Schema$ForwardingRule[]; - /** - * Informational warning which replaces the list of forwarding rules when the - * list is empty. - */ - warning: any; -} -export interface Schema$GlobalSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash when updating or changing labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * A list of labels to apply for this resource. Each label key & value - * must comply with RFC1035. Specifically, the name must be 1-63 characters - * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which - * means the first character must be a lowercase letter, and all following - * characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. For example, - * "webserver-frontend": "images". A label value can also - * be empty (e.g. "my-label": ""). - */ - labels: any; -} -/** - * Guest OS features. - */ -export interface Schema$GuestOsFeature { - /** - * The ID of a supported feature. Read Enabling guest operating system - * features to see a list of available options. - */ - type: string; -} -/** - * An HealthCheck resource. This resource defines a template for how individual - * virtual machines should be checked for health, via one of the supported - * protocols. - */ -export interface Schema$HealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in 3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - httpHealthCheck: Schema$HTTPHealthCheck; - httpsHealthCheck: Schema$HTTPSHealthCheck; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - sslHealthCheck: Schema$SSLHealthCheck; - tcpHealthCheck: Schema$TCPHealthCheck; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If - * not specified, the default is TCP. Exactly one of the protocol-specific - * health check field must be specified, which must match type field. - */ - type: string; - udpHealthCheck: Schema$UDPHealthCheck; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -/** - * Contains a list of HealthCheck resources. - */ -export interface Schema$HealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HealthCheck resources. - */ - items: Schema$HealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A full or valid partial URL to a health check. For example, the following are - * valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check - * - projects/project-id/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ -export interface Schema$HealthCheckReference { healthCheck: string; } -export interface Schema$HealthStatus { - /** - * Health state of the instance. - */ - healthState: string; - /** - * URL of the instance resource. - */ - instance: string; - /** - * The IP address represented by this resource. - */ - ipAddress: string; - /** - * The port on the instance. - */ - port: number; -} -/** - * UrlMaps A host-matching rule for a URL. If matched, will use the named - * PathMatcher to select the BackendService. - */ -export interface Schema$HostRule { - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The list of host patterns to match. They must be valid hostnames, except * - * will match any string of ([a-z0-9-.]*). In that case, * must be the first - * character and must be followed in the pattern by either - or .. - */ - hosts: string[]; - /** - * The name of the PathMatcher to use to match the path portion of the URL if - * the hostRule matches the URL's host portion. - */ - pathMatcher: string; -} -/** - * An HttpHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTP. - */ -export interface Schema$HttpHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#httpHealthCheck for HTTP - * health checks. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTP health check request. The default value - * is 80. - */ - port: number; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPHealthCheck { - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; - /** - * The string to match anywhere in the first 1024 bytes of the response body. - * If left empty (the default value), the status code determines health. The - * response data can only be ASCII. - */ - response: string; -} -/** - * Contains a list of HttpHealthCheck resources. - */ -export interface Schema$HttpHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpHealthCheck resources. - */ - items: Schema$HttpHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An HttpsHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTPS. - */ -export interface Schema$HttpsHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTPS health check request. The default value - * is 443. - */ - port: number; - /** - * The request path of the HTTPS health check request. The default value is - * "/". - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have a greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPSHealthCheck { - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTPS health check request. The default value is /. - */ - requestPath: string; - /** - * The string to match anywhere in the first 1024 bytes of the response body. - * If left empty (the default value), the status code determines health. The - * response data can only be ASCII. - */ - response: string; -} -/** - * Contains a list of HttpsHealthCheck resources. - */ -export interface Schema$HttpsHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpsHealthCheck resources. - */ - items: Schema$HttpsHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Image resource. (== resource_for beta.images ==) (== resource_for - * v1.images ==) - */ -export interface Schema$Image { - /** - * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). - */ - archiveSizeBytes: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The deprecation status associated with this image. - */ - deprecated: Schema$DeprecationStatus; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Size of the image when restored onto a persistent disk (in GB). - */ - diskSizeGb: string; - /** - * The name of the image family to which this image belongs. You can create - * disks by specifying an image family instead of a specific image name. The - * image family always returns its latest image that is not deprecated. The - * name of the image family must comply with RFC1035. - */ - family: string; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Encrypts the image using a customer-supplied encryption key. After you - * encrypt an image with a customer-supplied key, you must provide the same - * key if you use the image later (e.g. to create a disk from the image). - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the image, - * then the disk will be encrypted using an automatically generated key and - * you do not need to provide a key to use the image later. - */ - imageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] Type of the resource. Always compute#image for images. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this image, which is - * essentially a hash of the labels used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an image. - */ - labelFingerprint: string; - /** - * Labels to apply to this image. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this image. - */ - licenseCodes: string[]; - /** - * Any applicable license URI. - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The parameters of the raw disk image. - */ - rawDisk: any; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL of the source disk used to create this image. This can be a full or - * valid partial URL. You must provide either this property or the - * rawDisk.source property but not both to create an image. For example, the - * following are valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * The ID value of the disk used to create this image. This value may be used - * to determine whether the image was taken from the current or a previous - * instance of a given disk name. - */ - sourceDiskId: string; - /** - * URL of the source image used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the rawDisk.source property, or - the sourceDisk property in order to - * create an image. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this image. This - * value may be used to determine whether the image was taken from the current - * or a previous instance of a given image name. - */ - sourceImageId: string; - /** - * URL of the source snapshot used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the sourceImage property, or - the rawDisk.source property, or - the - * sourceDisk property in order to create an image. - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the snapshot used to create this image. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given snapshot name. - */ - sourceSnapshotId: string; - /** - * The type of the image used to create this disk. The default and only value - * is RAW - */ - sourceType: string; - /** - * [Output Only] The status of the image. An image can be used to create other - * resources, such as instances, only after the image has been successfully - * created and the status is set to READY. Possible values are FAILED, - * PENDING, or READY. - */ - status: string; -} -/** - * Contains a list of images. - */ -export interface Schema$ImageList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Image resources. - */ - items: Schema$Image[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance resource. (== resource_for beta.instances ==) (== resource_for - * v1.instances ==) - */ -export interface Schema$Instance { - /** - * Allows this instance to send and receive packets with non-matching - * destination or source IPs. This is required if you plan to use this - * instance to forward routes. For more information, see Enabling IP - * Forwarding. - */ - canIpForward: boolean; - /** - * [Output Only] The CPU platform used by this instance. - */ - cpuPlatform: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Whether the resource should be protected against deletion. - */ - deletionProtection: boolean; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Array of disks associated with this instance. Persistent disks must be - * created before you can assign them. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#instance for instances. - */ - kind: string; - /** - * A fingerprint for this request, which is essentially a hash of the - * metadata's contents and used for optimistic locking. The fingerprint is - * initially generated by Compute Engine and changes after every request to - * modify or update metadata. You must always provide an up-to-date - * fingerprint hash in order to update or change metadata. To see the latest - * fingerprint, make get() request to the instance. - */ - labelFingerprint: string; - /** - * Labels to apply to this instance. These can be later modified by the - * setLabels method. - */ - labels: any; - /** - * Full or partial URL of the machine type resource to use for this instance, - * in the format: zones/zone/machineTypes/machine-type. This is provided by - * the client when the instance is created. For example, the following is a - * valid partial url to a predefined machine type: - * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine - * type, provide a URL to a machine type in the following format, where CPUS - * is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the - * total memory for this instance. Memory must be a multiple of 256 MB and - * must be supplied in MB (e.g. 5 GB of memory is 5120 MB): - * zones/zone/machineTypes/custom-CPUS-MEMORY For example: - * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of - * restrictions, read the Specifications for custom machine types. - */ - machineType: string; - /** - * The metadata key/value pairs assigned to this instance. This includes - * custom metadata and predefined keys. - */ - metadata: Schema$Metadata; - /** - * Specifies a minimum CPU platform for the VM instance. Applicable values are - * the friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". - */ - minCpuPlatform: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * An array of network configurations for this instance. These specify how - * interfaces are configured to interact with other network services, such as - * connecting to the internet. Multiple interfaces are supported per instance. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Sets the scheduling options for this instance. - */ - scheduling: Schema$Scheduling; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * A list of service accounts, with their specified scopes, authorized for - * this instance. Only one service account per VM instance is supported. - * Service accounts generate access tokens that can be accessed through the - * metadata server and used to authenticate applications on the instance. See - * Service Accounts for more information. - */ - serviceAccounts: Schema$ServiceAccount[]; - /** - * [Output Only] Whether a VM has been restricted for start because Compute - * Engine has detected suspicious activity. - */ - startRestricted: boolean; - /** - * [Output Only] The status of the instance. One of the following values: - * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, - * and TERMINATED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; - /** - * A list of tags to apply to this instance. Tags are used to identify valid - * sources or targets for network firewalls and are specified by the client - * during instance creation. The tags can be later modified by the setTags - * method. Each tag within the list must comply with RFC1035. - */ - tags: Schema$Tags; - /** - * [Output Only] URL of the zone where the instance resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$InstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstancesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#instanceAggregatedList for - * aggregated lists of Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for - * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== - * resource_for v1.regionInstanceGroups ==) - */ -export interface Schema$InstanceGroup { - /** - * [Output Only] The creation timestamp for this instance group in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The fingerprint of the named ports. The system uses this - * fingerprint to detect conflicts when multiple users change the named ports - * concurrently. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this instance group, generated by the - * server. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceGroup for - * instance groups. - */ - kind: string; - /** - * The name of the instance group. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * Assigns a name to a port number. For example: {name: "http", - * port: 80} This allows the system to reference ports by the assigned name - * instead of a port number. Named ports can also contain multiple ports. For - * example: [{name: "http", port: 80},{name: "http", port: - * 8080}] Named ports apply to all instances in this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * The URL of the network to which all instances in the instance group belong. - */ - network: string; - /** - * [Output Only] The URL of the region where the instance group is located - * (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this instance group. The server generates this - * URL. - */ - selfLink: string; - /** - * [Output Only] The total number of instances in the instance group. - */ - size: number; - /** - * [Output Only] The URL of the subnetwork to which all instances in the - * instance group belong. - */ - subnetwork: string; - /** - * [Output Only] The URL of the zone where the instance group is located (for - * zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupsScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupAggregatedList for aggregated lists of instance - * groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A list of InstanceGroup resources. - */ -export interface Schema$InstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * [Output Only] The resource type, which is always compute#instanceGroupList - * for instance group lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance Group Manager resource. (== resource_for - * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) - * (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for - * v1.regionInstanceGroupManagers ==) - */ -export interface Schema$InstanceGroupManager { - /** - * The autohealing policy for this managed instance group. You can specify - * only one value. - */ - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; - /** - * The base instance name to use for instances in this group. The value must - * be 1-58 characters long. Instances are named by appending a hyphen and a - * random four-character string to the base instance name. The base instance - * name must comply with RFC1035. - */ - baseInstanceName: string; - /** - * [Output Only] The creation timestamp for this managed instance group in - * RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The list of instance actions and the number of instances in - * this managed instance group that are scheduled for each of those actions. - */ - currentActions: Schema$InstanceGroupManagerActionsSummary; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Policy valid only for regional managed instance groups. - */ - distributionPolicy: Schema$DistributionPolicy; - /** - * The action to perform in case of zone failure. Only one value is supported, - * NO_FAILOVER. The default is NO_FAILOVER. - */ - failoverAction: string; - /** - * [Output Only] The fingerprint of the resource data. You can use this - * optional field for optimistic locking when you update the resource. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this resource type. The server - * generates this identifier. - */ - id: string; - /** - * [Output Only] The URL of the Instance Group resource. - */ - instanceGroup: string; - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManager for managed instance groups. - */ - kind: string; - /** - * The name of the managed instance group. The name must be 1-63 characters - * long, and comply with RFC1035. - */ - name: string; - /** - * Named ports configured for the Instance Groups complementary to this - * Instance Group Manager. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The list of instance actions and the number of instances in - * this managed instance group that are pending for each of those actions. - */ - pendingActions: Schema$InstanceGroupManagerPendingActionsSummary; - /** - * [Output Only] The URL of the region where the managed instance group - * resides (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this managed instance group. The server defines - * this URL. - */ - selfLink: string; - /** - * [Output Only] The service account to be used as credentials for all - * operations performed by the managed instance group on instances. The - * service accounts needs all permissions required to create and delete - * instances. By default, the service account - * {projectNumber}@cloudservices.gserviceaccount.com is used. - */ - serviceAccount: string; - /** - * The URLs for all TargetPool resources to which instances in the - * instanceGroup field are added. The target pools automatically apply to all - * of the instances in the managed instance group. - */ - targetPools: string[]; - /** - * The target number of running instances for this managed instance group. - * Deleting or abandoning instances reduces this number. Resizing the group - * changes this number. - */ - targetSize: number; - /** - * The update policy for this managed instance group. - */ - updatePolicy: Schema$InstanceGroupManagerUpdatePolicy; - /** - * Specifies the instance templates used by this managed instance group to - * create instances. Each version is defined by an instanceTemplate. Every - * template can appear at most once per instance group. This field overrides - * the top-level instanceTemplate field. Read more about the relationships - * between these fields. Exactly one version must leave the targetSize field - * unset. That version will be applied to all remaining instances. For more - * information, read about canary updates. - */ - versions: Schema$InstanceGroupManagerVersion[]; - /** - * [Output Only] The URL of the zone where the managed instance group is - * located (for zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupManagerActionsSummary { - /** - * [Output Only] The total number of instances in the managed instance group - * that are scheduled to be abandoned. Abandoning an instance removes it from - * the managed instance group without deleting it. - */ - abandoning: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be created or are currently being created. If the group - * fails to create any of these instances, it tries again until it creates the - * instance successfully. If you have disabled creation retries, this field - * will not be populated; instead, the creatingWithoutRetries field will be - * populated. - */ - creating: number; - /** - * [Output Only] The number of instances that the managed instance group will - * attempt to create. The group attempts to create each instance only once. If - * the group fails to create any of these instances, it decreases the - * group's targetSize value accordingly. - */ - creatingWithoutRetries: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be deleted or are currently being deleted. - */ - deleting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are running and have no scheduled actions. - */ - none: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be recreated or are currently being being recreated. - * Recreating an instance deletes the existing root persistent disk and - * creates a new disk from the image that is defined in the instance template. - */ - recreating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are being reconfigured with properties that do not require a restart or a - * recreate action. For example, setting or removing target pools for the - * instance. - */ - refreshing: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be restarted or are currently being restarted. - */ - restarting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are being verified. See the managedInstances[].currentAction property in - * the listManagedInstances method documentation. - */ - verifying: number; -} -export interface Schema$InstanceGroupManagerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManagersScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerAggregatedList for an aggregated list of - * managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagerAutoHealingPolicy { - /** - * The URL for the health check that signals autohealing. - */ - healthCheck: string; - /** - * The number of seconds that the managed instance group waits before it - * applies autohealing policies to new instances or recently recreated - * instances. This initial delay allows instances to initialize and run their - * startup scripts before the instance group determines that they are - * UNHEALTHY. This prevents the managed instance group from recreating its - * instances prematurely. This value must be from range [0, 3600]. - */ - initialDelaySec: number; -} -/** - * [Output Only] A list of managed instance groups. - */ -export interface Schema$InstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagerPendingActionsSummary { - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be created. - */ - creating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be deleted. - */ - deleting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be recreated. - */ - recreating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are pending to be restarted. - */ - restarting: number; -} -export interface Schema$InstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersListManagedInstancesResponse { - /** - * [Output Only] The list of instances in the managed instance group. - */ - managedInstances: Schema$ManagedInstance[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; -} -export interface Schema$InstanceGroupManagersRecreateInstancesRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersResizeAdvancedRequest { - /** - * If this flag is true, the managed instance group attempts to create all - * instances initiated by this resize request only once. If there is an error - * during creation, the managed instance group does not retry create this - * instance, and we will decrease the targetSize of the request instead. If - * the flag is false, the group attemps to recreate each instance continuously - * until it succeeds. This flag matters only in the first attempt of creation - * of an instance. After an instance is successfully created while this flag - * is enabled, the instance behaves the same way as all the other instances - * created with a regular resize request. In particular, if a running instance - * dies unexpectedly at a later time and needs to be recreated, this mode does - * not affect the recreation behavior in that scenario. This flag is - * applicable only to the current resize request. It does not influence other - * resize requests in any way. You can see which instances is being creating - * in which mode by calling the get or listManagedInstances API. - */ - noCreationRetries: boolean; - /** - * The number of running instances that the managed instance group should - * maintain at any given time. The group automatically adds or removes - * instances to maintain the number of instances specified by this parameter. - */ - targetSize: number; -} -export interface Schema$InstanceGroupManagersScopedList { - /** - * [Output Only] The list of managed instance groups that are contained in the - * specified project and zone. - */ - instanceGroupManagers: Schema$InstanceGroupManager[]; - /** - * [Output Only] The warning that replaces the list of managed instance groups - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupManagersSetAutoHealingRequest { - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; -} -export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; -} -export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { - /** - * The fingerprint of the target pools information. Use this optional property - * to prevent conflicts when multiple users change the target pools settings - * concurrently. Obtain the fingerprint with the instanceGroupManagers.get - * method. Then, include the fingerprint in your request to ensure that you do - * not overwrite changes that were applied from another concurrent request. - */ - fingerprint: string; - /** - * The list of target pool URLs that instances in this managed instance group - * belong to. The managed instance group applies these target pools to all of - * the instances in the group. Existing instances and new instances in the - * group all receive these target pool settings. - */ - targetPools: string[]; -} -export interface Schema$InstanceGroupManagerUpdatePolicy { - /** - * The maximum number of instances that can be created above the specified - * targetSize during the update process. By default, a fixed value of 1 is - * used. This value can be either a fixed number or a percentage if the - * instance group has 10 or more instances. If you set a percentage, the - * number of instances will be rounded up if necessary. At least one of - * either maxSurge or maxUnavailable must be greater than 0. Learn more about - * maxSurge. - */ - maxSurge: Schema$FixedOrPercent; - /** - * The maximum number of instances that can be unavailable during the update - * process. An instance is considered available if all of the following - * conditions are satisfied: - The instance's status is RUNNING. - If - * there is a health check on the instance group, the instance's liveness - * health check result must be HEALTHY at least once. If there is no health - * check on the group, then the instance only needs to have a status of - * RUNNING to be considered available. By default, a fixed value of 1 is - * used. This value can be either a fixed number or a percentage if the - * instance group has 10 or more instances. If you set a percentage, the - * number of instances will be rounded up if necessary. At least one of - * either maxSurge or maxUnavailable must be greater than 0. Learn more about - * maxUnavailable. - */ - maxUnavailable: Schema$FixedOrPercent; - /** - * Minimal action to be taken on an instance. You can specify either RESTART - * to restart existing instances or REPLACE to delete and create new instances - * from the target template. If you specify a code>RESTART, the Updater - * will attempt to perform that action only. However, if the Updater - * determines that the minimal action you specify is not enough to perform the - * update, it might perform a more disruptive action. - */ - minimalAction: string; - /** - * Minimum number of seconds to wait for after a newly created instance - * becomes available. This value must be from range [0, 3600]. - */ - minReadySec: number; - type: string; -} -export interface Schema$InstanceGroupManagerVersion { - instanceTemplate: string; - /** - * Name of the version. Unique among all versions in the scope of this managed - * instance group. - */ - name: string; - /** - * Specifies the intended number of instances to be created from the - * instanceTemplate. The final number of instances created from the template - * will be equal to: - If expressed as a fixed number, the minimum of either - * targetSize.fixed or instanceGroupManager.targetSize is used. - if - * expressed as a percent, the targetSize would be (targetSize.percent/100 * - * InstanceGroupManager.targetSize) If there is a remainder, the number is - * rounded up. If unset, this version will update any remaining instances not - * updated by another version. Read Starting a canary update for more - * information. - */ - targetSize: Schema$FixedOrPercent; -} -export interface Schema$InstanceGroupsAddInstancesRequest { - /** - * The list of instances to add to the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupsListInstances for the list of instances in the - * specified instance group. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupsListInstancesRequest { - /** - * A filter for the state of the instances in the instance group. Valid - * options are ALL or RUNNING. If you do not specify this parameter the list - * includes all instances regardless of their state. - */ - instanceState: string; -} -export interface Schema$InstanceGroupsRemoveInstancesRequest { - /** - * The list of instances to remove from the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsScopedList { - /** - * [Output Only] The list of instance groups that are contained in this scope. - */ - instanceGroups: Schema$InstanceGroup[]; - /** - * [Output Only] An informational warning that replaces the list of instance - * groups when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of instances. - */ -export interface Schema$InstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Instance resources. - */ - items: Schema$Instance[]; - /** - * [Output Only] Type of resource. Always compute#instanceList for lists of - * Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of instance referrers. - */ -export interface Schema$InstanceListReferrers { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Reference resources. - */ - items: Schema$Reference[]; - /** - * [Output Only] Type of resource. Always compute#instanceListReferrers for - * lists of Instance referrers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceMoveRequest { - /** - * The URL of the destination zone to move the instance. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target instance to move. This can be a full or partial URL. - * For example, the following are all valid URLs to an instance: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - targetInstance: string; -} -export interface Schema$InstanceProperties { - /** - * Enables instances created based on this template to send packets with - * source IP addresses other than their own and receive packets with - * destination IP addresses other than their own. If these instances will be - * used as an IP gateway or it will be set as the next-hop in a Route - * resource, specify true. If unsure, leave this set to false. See the Enable - * IP forwarding documentation for more information. - */ - canIpForward: boolean; - /** - * An optional text description for the instances that are created from this - * instance template. - */ - description: string; - /** - * An array of disks that are associated with the instances that are created - * from this template. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of guest accelerator cards' type and count to use for instances - * created from the instance template. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * Labels to apply to instances that are created from this template. - */ - labels: any; - /** - * The machine type to use for instances that are created from this template. - */ - machineType: string; - /** - * The metadata key/value pairs to assign to instances that are created from - * this template. These pairs can consist of custom metadata or predefined - * keys. See Project and instance metadata for more information. - */ - metadata: Schema$Metadata; - /** - * Minimum cpu/platform to be used by this instance. The instance may be - * scheduled on the specified or newer cpu/platform. Applicable values are the - * friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more - * information, read Specifying a Minimum CPU Platform. - */ - minCpuPlatform: string; - /** - * An array of network access configurations for this interface. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Specifies the scheduling options for the instances that are created from - * this template. - */ - scheduling: Schema$Scheduling; - /** - * A list of service accounts with specified scopes. Access tokens for these - * service accounts are available to the instances that are created from this - * template. Use metadata queries to obtain the access tokens for these - * instances. - */ - serviceAccounts: Schema$ServiceAccount[]; - /** - * A list of tags to apply to the instances that are created from this - * template. The tags identify valid sources or targets for network firewalls. - * The setTags method can modify this list of tags. Each tag within the list - * must comply with RFC1035. - */ - tags: Schema$Tags; -} -export interface Schema$InstanceReference { - /** - * The URL for a specific instance. - */ - instance: string; -} -export interface Schema$InstancesScopedList { - /** - * [Output Only] A list of instances contained in this scope. - */ - instances: Schema$Instance[]; - /** - * [Output Only] Informational warning which replaces the list of instances - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstancesSetLabelsRequest { - /** - * Fingerprint of the previous set of labels for this resource, used to - * prevent conflicts. Provide the latest fingerprint value when making a - * request to add or change labels. - */ - labelFingerprint: string; - labels: any; -} -export interface Schema$InstancesSetMachineResourcesRequest { - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; -} -export interface Schema$InstancesSetMachineTypeRequest { - /** - * Full or partial URL of the machine type resource. See Machine Types for a - * full list of machine types. For example: - * zones/us-central1-f/machineTypes/n1-standard-1 - */ - machineType: string; -} -export interface Schema$InstancesSetMinCpuPlatformRequest { - /** - * Minimum cpu/platform this instance should be started at. - */ - minCpuPlatform: string; -} -export interface Schema$InstancesSetServiceAccountRequest { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -export interface Schema$InstancesStartWithEncryptionKeyRequest { - /** - * Array of disks associated with this instance that are protected with a - * customer-supplied encryption key. In order to start the instance, the disk - * url and its corresponding key must be provided. If the disk is not - * protected with a customer-supplied encryption key it should not be - * specified. - */ - disks: Schema$CustomerEncryptionKeyProtectedDisk[]; -} -/** - * An Instance Template resource. (== resource_for beta.instanceTemplates ==) - * (== resource_for v1.instanceTemplates ==) - */ -export interface Schema$InstanceTemplate { - /** - * [Output Only] The creation timestamp for this instance template in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A unique identifier for this instance template. The server - * defines this identifier. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceTemplate - * for instance templates. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The instance properties for this instance template. - */ - properties: Schema$InstanceProperties; - /** - * [Output Only] The URL for this instance template. The server defines this - * URL. - */ - selfLink: string; - /** - * The source instance used to create the template. You can provide this as a - * partial or full URL to the resource. For example, the following are valid - * values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - */ - sourceInstance: string; - /** - * The source instance params to use to create this instance template. - */ - sourceInstanceParams: Schema$SourceInstanceParams; -} -/** - * A list of instance templates. - */ -export interface Schema$InstanceTemplateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceTemplate resources. - */ - items: Schema$InstanceTemplate[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceTemplatesListResponse for instance template lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceWithNamedPorts { - /** - * [Output Only] The URL of the instance. - */ - instance: string; - /** - * [Output Only] The named ports that belong to this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The status of the instance. - */ - status: string; -} -/** - * Represents an Interconnects resource. The Interconnects resource is a - * dedicated connection between Google's network and your on-premises - * network. For more information, see the Dedicated overview page. (== - * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) - */ -export interface Schema$Interconnect { - /** - * Administrative status of the interconnect. When this is set to true, the - * Interconnect is functional and can carry traffic. When set to false, no - * packets can be carried over the interconnect and no BGP routes are - * exchanged over it. By default, the status is set to true. - */ - adminEnabled: boolean; - /** - * [Output Only] A list of CircuitInfo objects, that describe the individual - * circuits in this LAG. - */ - circuitInfos: Schema$InterconnectCircuitInfo[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Customer name, to put in the Letter of Authorization as the party - * authorized to request a crossconnect. - */ - customerName: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of outages expected for this Interconnect. - */ - expectedOutages: Schema$InterconnectOutageNotification[]; - /** - * [Output Only] IP address configured on the Google side of the Interconnect - * link. This can be used only for ping tests. - */ - googleIpAddress: string; - /** - * [Output Only] Google reference ID; to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of the URLs of all InterconnectAttachments configured - * to use this Interconnect. - */ - interconnectAttachments: string[]; - /** - * Type of interconnect. Note that "IT_PRIVATE" has been deprecated - * in favor of "DEDICATED" - */ - interconnectType: string; - /** - * [Output Only] Type of the resource. Always compute#interconnect for - * interconnects. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this Interconnect, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an Interconnect. - */ - labelFingerprint: string; - /** - * Labels to apply to this Interconnect resource. These can be later modified - * by the setLabels method. Each label key/value must comply with RFC1035. - * Label values may be empty. - */ - labels: any; - /** - * Type of link requested. This field indicates speed of each of the links in - * the bundle, not the entire bundle. Only 10G per link is allowed for a - * dedicated interconnect. Options: Ethernet_10G_LR - */ - linkType: string; - /** - * URL of the InterconnectLocation object that represents where this - * connection is to be provisioned. - */ - location: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Email address to contact the customer NOC for operations and maintenance - * notifications regarding this Interconnect. If specified, this will be used - * for notifications in addition to all other forms described, such as - * Stackdriver logs alerting and Cloud Notifications. - */ - nocContactEmail: string; - /** - * [Output Only] The current status of whether or not this Interconnect is - * functional. - */ - operationalStatus: string; - /** - * [Output Only] IP address configured on the customer side of the - * Interconnect link. The customer should configure this IP address during - * turnup when prompted by Google NOC. This can be used only for ping tests. - */ - peerIpAddress: string; - /** - * [Output Only] Number of links actually provisioned in this interconnect. - */ - provisionedLinkCount: number; - /** - * Target number of physical links in the link bundle, as requested by the - * customer. - */ - requestedLinkCount: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The current state of whether or not this Interconnect is - * functional. - */ - state: string; -} -/** - * Represents an InterconnectAttachment (VLAN attachment) resource. For more - * information, see Creating VLAN Attachments. (== resource_for - * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments - * ==) - */ -export interface Schema$InterconnectAttachment { - /** - * Determines whether this Attachment will carry packets. Not present for - * PARTNER_PROVIDER. - */ - adminEnabled: boolean; - /** - * Provisioned bandwidth capacity for the interconnectAttachment. Can be set - * by the partner to update the customer's provisioned bandwidth. Output - * only for for PARTNER type, mutable for PARTNER_PROVIDER, not available for - * DEDICATED. - */ - bandwidth: string; - /** - * Up to 16 candidate prefixes that can be used to restrict the allocation of - * cloudRouterIpAddress and customerRouterIpAddress for this attachment. All - * prefixes must be within link-local address space (169.254.0.0/16) and must - * be /29 or shorter (/28, /27, etc). Google will attempt to select an unused - * /29 from the supplied candidate prefix(es). The request will fail if all - * possible /29s are in use on Google?s edge. If not supplied, Google will - * randomly select an unused /29 from all of link-local space. - */ - candidateSubnets: string[]; - /** - * [Output Only] IPv4 address + prefix length to be configured on Cloud Router - * Interface for this interconnect attachment. - */ - cloudRouterIpAddress: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] IPv4 address + prefix length to be configured on the customer - * router subinterface for this interconnect attachment. - */ - customerRouterIpAddress: string; - /** - * An optional description of this resource. - */ - description: string; - /** - * Desired availability domain for the attachment. Only available for type - * PARTNER, at creation time. For improved reliability, customers should - * configure a pair of attachments with one per availability domain. The - * selected availability domain will be provided to the Partner via the - * pairing key so that the provisioned circuit will lie in the specified - * domain. If not specified, the value will default to - * AVAILABILITY_DOMAIN_ANY. - */ - edgeAvailabilityDomain: string; - /** - * [Output Only] Google reference ID, to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * URL of the underlying Interconnect object that this attachment's - * traffic will traverse through. - */ - interconnect: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectAttachment - * for interconnect attachments. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this InterconnectAttachment, - * which is essentially a hash of the labels set used for optimistic locking. - * The fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an - * InterconnectAttachment. - */ - labelFingerprint: string; - /** - * Labels to apply to this InterconnectAttachment resource. These can be later - * modified by the setLabels method. Each label key/value must comply with - * RFC1035. Label values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] The current status of whether or not this interconnect - * attachment is functional. - */ - operationalStatus: string; - /** - * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not present - * for DEDICATED]. The opaque identifier of an PARTNER attachment used to - * initiate provisioning with a selected partner. Of the form - * "XXXXX/region/domain" - */ - pairingKey: string; - /** - * Optional BGP ASN for the router that should be supplied by a layer 3 - * Partner if they configured BGP on behalf of the customer. Output only for - * PARTNER type, input only for PARTNER_PROVIDER, not available for DEDICATED. - */ - partnerAsn: string; - /** - * Informational metadata about Partner attachments from Partners to display - * to customers. Output only for for PARTNER type, mutable for - * PARTNER_PROVIDER, not available for DEDICATED. - */ - partnerMetadata: Schema$InterconnectAttachmentPartnerMetadata; - /** - * [Output Only] Information specific to an InterconnectAttachment. This - * property is populated if the interconnect that this is attached to is of - * type DEDICATED. - */ - privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; - /** - * [Output Only] URL of the region where the regional interconnect attachment - * resides. You must specify this field as part of the HTTP request URL. It is - * not settable as a field in the request body. - */ - region: string; - /** - * URL of the cloud router to be used for dynamic routing. This router must be - * in the same region as this InterconnectAttachment. The - * InterconnectAttachment will automatically connect the Interconnect to the - * network & region within which the Cloud Router is configured. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The current state of this attachment's functionality. - */ - state: string; - type: string; - /** - * Available only for DEDICATED and PARTNER_PROVIDER. Desired VLAN tag for - * this attachment, in the range 2-4094. This field refers to 802.1q VLAN tag, - * also known as IEEE 802.1Q Only specified at creation time. - */ - vlanTag8021q: number; -} -export interface Schema$InterconnectAttachmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#interconnectAttachmentAggregatedList for aggregated lists of - * interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Response to the list request, and contains a list of interconnect - * attachments. - */ -export interface Schema$InterconnectAttachmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachment resources. - */ - items: Schema$InterconnectAttachment[]; - /** - * [Output Only] Type of resource. Always compute#interconnectAttachmentList - * for lists of interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Informational metadata about Partner attachments from Partners to display to - * customers. These fields are propagated from PARTNER_PROVIDER attachments to - * their corresponding PARTNER attachments. - */ -export interface Schema$InterconnectAttachmentPartnerMetadata { - /** - * Plain text name of the Interconnect this attachment is connected to, as - * displayed in the Partner?s portal. For instance ?Chicago 1?. This value may - * be validated to match approved Partner values. - */ - interconnectName: string; - /** - * Plain text name of the Partner providing this attachment. This value may be - * validated to match approved Partner values. - */ - partnerName: string; - /** - * URL of the Partner?s portal for this Attachment. Partners may customise - * this to be a deep-link to the specific resource on the Partner portal. This - * value may be validated to match approved Partner values. - */ - portalUrl: string; -} -/** - * Information for an interconnect attachment when this belongs to an - * interconnect of type DEDICATED. - */ -export interface Schema$InterconnectAttachmentPrivateInfo { - /** - * [Output Only] 802.1q encapsulation tag to be used for traffic between - * Google and the customer, going to and from this network and region. - */ - tag8021q: number; -} -export interface Schema$InterconnectAttachmentsScopedList { - /** - * A list of interconnect attachments contained in this scope. - */ - interconnectAttachments: Schema$InterconnectAttachment[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * Describes a single physical circuit between the Customer and Google. - * CircuitInfo objects are created by Google, so all fields are output only. - * Next id: 4 - */ -export interface Schema$InterconnectCircuitInfo { - /** - * Customer-side demarc ID for this circuit. - */ - customerDemarcId: string; - /** - * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. - */ - googleCircuitId: string; - /** - * Google-side demarc ID for this circuit. Assigned at circuit turn-up and - * provided by Google to the customer in the LOA. - */ - googleDemarcId: string; -} -/** - * Response to the list request, and contains a list of interconnects. - */ -export interface Schema$InterconnectList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Interconnect resources. - */ - items: Schema$Interconnect[]; - /** - * [Output Only] Type of resource. Always compute#interconnectList for lists - * of interconnects. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents an InterconnectLocations resource. The InterconnectLocations - * resource describes the locations where you can connect to Google's - * networks. For more information, see Colocation Facilities. - */ -export interface Schema$InterconnectLocation { - /** - * [Output Only] The postal address of the Point of Presence, each line in the - * address is separated by a newline character. - */ - address: string; - /** - * [Output Only] Availability zone for this location. Within a metropolitan - * area (metro), maintenance will not be simultaneously scheduled in more than - * one availability zone. Example: "zone1" or "zone2". - */ - availabilityZone: string; - /** - * [Output Only] Metropolitan area designator that indicates which city an - * interconnect is located. For example: "Chicago, IL", - * "Amsterdam, Netherlands". - */ - city: string; - /** - * [Output Only] Continent for this location. - */ - continent: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] An optional description of the resource. - */ - description: string; - /** - * [Output Only] The name of the provider for this facility (e.g., EQUINIX). - */ - facilityProvider: string; - /** - * [Output Only] A provider-assigned Identifier for this facility (e.g., - * Ashburn-DC1). - */ - facilityProviderFacilityId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectLocation for - * interconnect locations. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The peeringdb identifier for this facility (corresponding - * with a netfac type in peeringdb). - */ - peeringdbFacilityId: string; - /** - * [Output Only] A list of InterconnectLocation.RegionInfo objects, that - * describe parameters pertaining to the relation between this - * InterconnectLocation and various Google Cloud regions. - */ - regionInfos: Schema$InterconnectLocationRegionInfo[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Response to the list request, and contains a list of interconnect locations. - */ -export interface Schema$InterconnectLocationList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectLocation resources. - */ - items: Schema$InterconnectLocation[]; - /** - * [Output Only] Type of resource. Always compute#interconnectLocationList for - * lists of interconnect locations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Information about any potential InterconnectAttachments between an - * Interconnect at a specific InterconnectLocation, and a specific Cloud Region. - */ -export interface Schema$InterconnectLocationRegionInfo { - /** - * Expected round-trip time in milliseconds, from this InterconnectLocation to - * a VM in this region. - */ - expectedRttMs: string; - /** - * Identifies the network presence of this location. - */ - locationPresence: string; - /** - * URL for the region of this location. - */ - region: string; -} -/** - * Description of a planned outage on this Interconnect. Next id: 9 - */ -export interface Schema$InterconnectOutageNotification { - /** - * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs - * that will be affected. - */ - affectedCircuits: string[]; - /** - * A description about the purpose of the outage. - */ - description: string; - /** - * Scheduled end time for the outage (milliseconds since Unix epoch). - */ - endTime: string; - /** - * Form this outage is expected to take. Note that the "IT_" - * versions of this enum have been deprecated in favor of the unprefixed - * values. - */ - issueType: string; - /** - * Unique identifier for this outage notification. - */ - name: string; - /** - * The party that generated this notification. Note that - * "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE" - */ - source: string; - /** - * Scheduled start time for the outage (milliseconds since Unix epoch). - */ - startTime: string; - /** - * State of this notification. Note that the "NS_" versions of this - * enum have been deprecated in favor of the unprefixed values. - */ - state: string; -} -/** - * A license resource. - */ -export interface Schema$License { - /** - * [Output Only] Deprecated. This field no longer reflects whether a license - * charges a usage fee. - */ - chargesUseFee: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#license for licenses. - */ - kind: string; - /** - * [Output Only] The unique code used to attach this license to images, - * snapshots, and disks. - */ - licenseCode: string; - /** - * [Output Only] Name of the resource. The name is 1-63 characters long and - * complies with RFC1035. - */ - name: string; - resourceRequirements: Schema$LicenseResourceRequirements; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If false, licenses will not be copied from the source resource when - * creating an image from a disk, disk from snapshot, or snapshot from disk. - */ - transferable: boolean; -} -export interface Schema$LicenseCode { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#licenseCode for licenses. - */ - kind: string; - /** - * [Output Only] URL and description aliases of Licenses with the same License - * Code. - */ - licenseAlias: Schema$LicenseCodeLicenseAlias[]; - /** - * [Output Only] Name of the resource. The name is 1-20 characters long and - * must be a valid 64 bit integer. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Current state of this License Code. - */ - state: string; - /** - * [Output Only] If true, the license will remain attached when creating - * images or snapshots from disks. Otherwise, the license is not transferred. - */ - transferable: boolean; -} -export interface Schema$LicenseCodeLicenseAlias { - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] URL of license corresponding to this License Code. - */ - selfLink: string; -} -export interface Schema$LicenseResourceRequirements { - /** - * Minimum number of guest cpus required to use the Instance. Enforced at - * Instance creation and Instance start. - */ - minGuestCpuCount: number; - /** - * Minimum memory required to use the Instance. Enforced at Instance creation - * and Instance start. - */ - minMemoryMb: number; -} -export interface Schema$LicensesListResponse { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of License resources. - */ - items: Schema$License[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Specifies what kind of log the caller must write - */ -export interface Schema$LogConfig { - /** - * Cloud audit options. - */ - cloudAudit: Schema$LogConfigCloudAuditOptions; - /** - * Counter options. - */ - counter: Schema$LogConfigCounterOptions; - /** - * Data access options. - */ - dataAccess: Schema$LogConfigDataAccessOptions; -} -/** - * Write a Cloud Audit log - */ -export interface Schema$LogConfigCloudAuditOptions { - /** - * Information used by the Cloud Audit Logging pipeline. - */ - authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; - /** - * The log_name to populate in the Cloud Audit Record. - */ - logName: string; -} -/** - * Increment a streamz counter with the specified metric and field names. Metric - * names should start with a '/', generally be lowercase-only, and end - * in "_count". Field names should not contain an initial slash. The - * actual exported metric names will have "/iam/policy" prepended. - * Field names correspond to IAM request parameters and field values are their - * respective values. At present the only supported field names are - - * "iam_principal", corresponding to IAMContext.principal; - - * "" (empty string), resulting in one aggretated counter with no - * field. Examples: counter { metric: "/debug_access_count" field: - * "iam_principal" } ==> increment counter - * /iam/policy/backend_debug_access_count {iam_principal=[value of - * IAMContext.principal]} At this time we do not support: * multiple field - * names (though this may be supported in the future) * decrementing the counter - * * incrementing it by anything other than 1 - */ -export interface Schema$LogConfigCounterOptions { - /** - * The field value to attribute. - */ - field: string; - /** - * The metric to update. - */ - metric: string; -} -/** - * Write a Data Access (Gin) log - */ -export interface Schema$LogConfigDataAccessOptions { - /** - * Whether Gin logging should happen in a fail-closed manner at the caller. - * This is relevant only in the LocalIAM implementation, for now. - */ - logMode: string; -} -/** - * A Machine Type resource. (== resource_for v1.machineTypes ==) (== - * resource_for beta.machineTypes ==) - */ -export interface Schema$MachineType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this machine type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The number of virtual CPUs that are available to the - * instance. - */ - guestCpus: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Whether this machine type has a shared CPU. See Shared-core - * machine types for more information. - */ - isSharedCpu: boolean; - /** - * [Output Only] The type of the resource. Always compute#machineType for - * machine types. - */ - kind: string; - /** - * [Output Only] Maximum persistent disks allowed. - */ - maximumPersistentDisks: number; - /** - * [Output Only] Maximum total persistent disks size (GB) allowed. - */ - maximumPersistentDisksSizeGb: string; - /** - * [Output Only] The amount of physical memory available to the instance, - * defined in MB. - */ - memoryMb: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the machine type resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$MachineTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#machineTypeAggregatedList - * for aggregated lists of machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of machine types. - */ -export interface Schema$MachineTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineType resources. - */ - items: Schema$MachineType[]; - /** - * [Output Only] Type of resource. Always compute#machineTypeList for lists of - * machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$MachineTypesScopedList { - /** - * [Output Only] A list of machine types contained in this scope. - */ - machineTypes: Schema$MachineType[]; - /** - * [Output Only] An informational warning that appears when the machine types - * list is empty. - */ - warning: any; -} -/** - * Next available tag: 12 - */ -export interface Schema$ManagedInstance { - /** - * [Output Only] The current action that the managed instance group has - * scheduled for the instance. Possible values: - NONE The instance is - * running, and the managed instance group does not have any scheduled actions - * for this instance. - CREATING The managed instance group is creating this - * instance. If the group fails to create this instance, it will try again - * until it is successful. - CREATING_WITHOUT_RETRIES The managed instance - * group is attempting to create this instance only once. If the group fails - * to create this instance, it does not try again and the group's - * targetSize value is decreased instead. - RECREATING The managed instance - * group is recreating this instance. - DELETING The managed instance group - * is permanently deleting this instance. - ABANDONING The managed instance - * group is abandoning this instance. The instance will be removed from the - * instance group and from any target pools that are associated with this - * group. - RESTARTING The managed instance group is restarting the instance. - * - REFRESHING The managed instance group is applying configuration changes - * to the instance without stopping it. For example, the group can update the - * target pool list for an instance without stopping that instance. - - * VERIFYING The managed instance group has created the instance and it is in - * the process of being verified. - */ - currentAction: string; - /** - * [Output only] The unique identifier for this resource. This field is empty - * when instance does not exist. - */ - id: string; - /** - * [Output Only] The URL of the instance. The URL can exist even if the - * instance has not yet been created. - */ - instance: string; - /** - * [Output Only] The status of the instance. This field is empty when the - * instance does not exist. - */ - instanceStatus: string; - /** - * [Output Only] Information about the last attempt to create or delete the - * instance. - */ - lastAttempt: Schema$ManagedInstanceLastAttempt; - /** - * [Output Only] Intended version of this instance. - */ - version: Schema$ManagedInstanceVersion; -} -export interface Schema$ManagedInstanceLastAttempt { - /** - * [Output Only] Encountered errors during the last attempt to create or - * delete the instance. - */ - errors: any; -} -export interface Schema$ManagedInstanceVersion { - /** - * [Output Only] The intended template of the instance. This field is empty - * when current_action is one of { DELETING, ABANDONING }. - */ - instanceTemplate: string; - /** - * [Output Only] Name of the version. - */ - name: string; -} -/** - * A metadata key/value entry. - */ -export interface Schema$Metadata { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. - */ - fingerprint: string; - /** - * Array of key/value pairs. The total size of all keys and values must be - * less than 512 KB. - */ - items: any[]; - /** - * [Output Only] Type of the resource. Always compute#metadata for metadata. - */ - kind: string; -} -/** - * The named port. For example: . - */ -export interface Schema$NamedPort { - /** - * The name for this named port. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * The port number, which can be a value between 1 and 65535. - */ - port: number; -} -/** - * Represents a Network resource. Read Networks and Firewalls for more - * information. (== resource_for v1.networks ==) (== resource_for beta.networks - * ==) - */ -export interface Schema$Network { - /** - * When set to true, the network is created in "auto subnet mode". - * When set to false, the network is in "custom subnet mode". In - * "auto subnet mode", a newly created network is assigned the - * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork - * per region. - */ - autoCreateSubnetworks: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A gateway address for default routing to other networks. This value is read - * only and is selected by the Google Compute Engine, typically as the first - * usable address in the IPv4Range. - */ - gatewayIPv4: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are legal on this network. This range - * is a CIDR specification, for example: 192.168.0.0/16. Provided by the - * client when the network is created. - */ - IPv4Range: string; - /** - * [Output Only] Type of the resource. Always compute#network for networks. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] A list of network peerings for the resource. - */ - peerings: Schema$NetworkPeering[]; - /** - * The network-level routing configuration for this network. Used by Cloud - * Router to determine what type of network-wide routing behavior to enforce. - */ - routingConfig: Schema$NetworkRoutingConfig; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Server-defined fully-qualified URLs for all subnetworks in - * this network. - */ - subnetworks: string[]; -} -/** - * A network interface resource attached to an instance. - */ -export interface Schema$NetworkInterface { - /** - * An array of configurations for this interface. Currently, only one access - * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs - * specified, then this instance will have no external internet access. - */ - accessConfigs: Schema$AccessConfig[]; - /** - * An array of alias IP ranges for this network interface. Can only be - * specified for network interfaces on subnet-mode networks. - */ - aliasIpRanges: Schema$AliasIpRange[]; - /** - * Fingerprint hash of contents stored in this network interface. This field - * will be ignored when inserting an Instance or adding a NetworkInterface. An - * up-to-date fingerprint must be provided in order to update the - * NetworkInterface. - */ - fingerprint: string; - /** - * [Output Only] Type of the resource. Always compute#networkInterface for - * network interfaces. - */ - kind: string; - /** - * [Output Only] The name of the network interface, generated by the server. - * For network devices, these are eth0, eth1, etc. - */ - name: string; - /** - * URL of the network resource for this instance. When creating an instance, - * if neither the network nor the subnetwork is specified, the default network - * global/networks/default is used; if the network is not specified but the - * subnetwork is specified, the network is inferred. This field is optional - * when creating a firewall rule. If not specified when creating a firewall - * rule, the default network global/networks/default is used. If you specify - * this property, you can specify the network as a full or partial URL. For - * example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/global/networks/network - * - projects/project/global/networks/network - global/networks/default - */ - network: string; - /** - * An IPv4 internal network address to assign to the instance for this network - * interface. If not specified by the user, an unused internal IP is assigned - * by the system. - */ - networkIP: string; - /** - * The URL of the Subnetwork resource for this instance. If the network - * resource is in legacy mode, do not provide this property. If the network is - * in auto subnet mode, providing the subnetwork is optional. If the network - * is in custom subnet mode, then this field should be specified. If you - * specify this property, you can specify the subnetwork as a full or partial - * URL. For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork - * - regions/region/subnetworks/subnetwork - */ - subnetwork: string; -} -/** - * Contains a list of networks. - */ -export interface Schema$NetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Network resources. - */ - items: Schema$Network[]; - /** - * [Output Only] Type of resource. Always compute#networkList for lists of - * networks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A network peering attached to a network resource. The message includes the - * peering name, peer network, peering state, and a flag indicating whether - * Google Compute Engine should automatically create routes for the peering. - */ -export interface Schema$NetworkPeering { - /** - * Whether full mesh connectivity is created and managed automatically. When - * it is set to true, Google Compute Engine will automatically create and - * manage the routes between two networks when the state is ACTIVE. Otherwise, - * user needs to create routes manually to route packets to peer network. - */ - autoCreateRoutes: boolean; - /** - * Name of this peering. Provided by the client when the peering is created. - * The name must comply with RFC1035. Specifically, the name must be 1-63 - * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` - * which means the first character must be a lowercase letter, and all the - * following characters must be a dash, lowercase letter, or digit, except the - * last character, which cannot be a dash. - */ - name: string; - /** - * The URL of the peer network. It can be either full URL or partial URL. The - * peer network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - network: string; - /** - * [Output Only] State for the peering. - */ - state: string; - /** - * [Output Only] Details about the current state of the peering. - */ - stateDetails: string; -} -/** - * A routing configuration attached to a network resource. The message includes - * the list of routers associated with the network, and a flag indicating the - * type of routing behavior to enforce network-wide. - */ -export interface Schema$NetworkRoutingConfig { - /** - * The network-wide routing mode to use. If set to REGIONAL, this - * network's cloud routers will only advertise routes with subnetworks of - * this network in the same region as the router. If set to GLOBAL, this - * network's cloud routers will advertise routes with all subnetworks of - * this network, across regions. - */ - routingMode: string; -} -export interface Schema$NetworksAddPeeringRequest { - /** - * Whether Google Compute Engine manages the routes automatically. - */ - autoCreateRoutes: boolean; - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; - /** - * URL of the peer network. It can be either full URL or partial URL. The peer - * network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - peerNetwork: string; -} -export interface Schema$NetworksRemovePeeringRequest { - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; - /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$OperationAggregatedList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A map of scoped operation lists. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#operationAggregatedList for - * aggregated lists of operations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Operation resources. - */ -export interface Schema$OperationList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of Operation resources. - */ - items: Schema$Operation[]; - /** - * [Output Only] Type of resource. Always compute#operations for Operations - * resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$OperationsScopedList { - /** - * [Output Only] A list of operations contained in this scope. - */ - operations: Schema$Operation[]; - /** - * [Output Only] Informational warning which replaces the list of operations - * when the list is empty. - */ - warning: any; -} -/** - * A matcher for the path portion of the URL. The BackendService from the - * longest-matched rule will serve the URL. If no rule was matched, the default - * service will be used. - */ -export interface Schema$PathMatcher { - /** - * The full or partial URL to the BackendService resource. This will be used - * if none of the pathRules defined by this PathMatcher is matched by the - * URL's path portion. For example, the following are all valid URLs to a - * BackendService resource: - - * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService - * - compute/v1/projects/project/global/backendServices/backendService - - * global/backendServices/backendService - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The name to which this PathMatcher is referred by the HostRule. - */ - name: string; - /** - * The list of path rules. - */ - pathRules: Schema$PathRule[]; -} -/** - * A path-matching rule for a URL. If matched, will use the specified - * BackendService to handle the traffic arriving at this URL. - */ -export interface Schema$PathRule { - /** - * The list of path patterns to match. Each must start with / and the only - * place a * is allowed is at the end following a /. The string fed to the - * path matcher does not include any text after the first ? or #, and those - * chars are not allowed here. - */ - paths: string[]; - /** - * The URL of the BackendService resource if this rule is matched. - */ - service: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a description of IAM and its - * features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - iamOwned: boolean; - /** - * If more than one rule is specified, the rules are applied in the following - * manner: - All matching LOG rules are always applied. - If any - * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if any - * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if no - * rule applies, permission is denied. - */ - rules: Schema$Rule[]; - /** - * Deprecated. - */ - version: number; -} -/** - * A Project resource. For an overview of projects, see Cloud Platform Resource - * Hierarchy. (== resource_for v1.projects ==) (== resource_for beta.projects - * ==) - */ -export interface Schema$Project { - /** - * Metadata key/value pairs available to all instances contained in this - * project. See Custom metadata for more information. - */ - commonInstanceMetadata: Schema$Metadata; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * This signifies the default network tier used for configuring resources of - * the project and can only take the following values: PREMIUM, STANDARD. - * Initially the default network tier is PREMIUM. - */ - defaultNetworkTier: string; - /** - * [Output Only] Default service account used by VMs running in this project. - */ - defaultServiceAccount: string; - /** - * An optional textual description of the resource. - */ - description: string; - /** - * Restricted features enabled for use on this project. - */ - enabledFeatures: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. This is not the project ID, and is just a unique ID - * used by Compute Engine to identify resources. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#project for projects. - */ - kind: string; - /** - * The project ID. For example: my-example-project. Use the project ID to make - * requests to Compute Engine. - */ - name: string; - /** - * [Output Only] Quotas assigned to this project. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The naming prefix for daily usage reports and the Google Cloud Storage - * bucket where they are stored. - */ - usageExportLocation: Schema$UsageExportLocation; - /** - * [Output Only] The role this project has in a shared VPC configuration. - * Currently only HOST projects are differentiated. - */ - xpnProjectStatus: string; -} -export interface Schema$ProjectsDisableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsEnableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsGetXpnResources { - /** - * [Output Only] Type of resource. Always compute#projectsGetXpnResources for - * lists of service resources (a.k.a service projects) - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * Service resources (a.k.a service projects) attached to this project as - * their shared VPC host. - */ - resources: Schema$XpnResourceId[]; -} -export interface Schema$ProjectsListXpnHostsRequest { - /** - * Optional organization ID managed by Cloud Resource Manager, for which to - * list shared VPC host projects. If not specified, the organization will be - * inferred from the project. - */ - organization: string; -} -export interface Schema$ProjectsSetDefaultNetworkTierRequest { - /** - * Default network tier to be set. - */ - networkTier: string; -} -/** - * A quotas entry. - */ -export interface Schema$Quota { - /** - * [Output Only] Quota limit for this metric. - */ - limit: number; - /** - * [Output Only] Name of the quota metric. - */ - metric: string; - /** - * [Output Only] Current usage of this metric. - */ - usage: number; -} -/** - * Represents a reference to a resource. - */ -export interface Schema$Reference { - /** - * [Output Only] Type of the resource. Always compute#reference for - * references. - */ - kind: string; - /** - * A description of the reference type with no implied semantics. Possible - * values include: - MEMBER_OF - */ - referenceType: string; - /** - * URL of the resource which refers to the target. - */ - referrer: string; - /** - * URL of the resource to which this reference points. - */ - target: string; -} -/** - * Region resource. (== resource_for beta.regions ==) (== resource_for - * v1.regions ==) - */ -export interface Schema$Region { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this region. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#region for regions. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Quotas assigned to this region. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the region, either UP or DOWN. - */ - status: string; - /** - * [Output Only] A list of zones available in this region, in the form of - * resource URLs. - */ - zones: string[]; -} -/** - * Contains a list of autoscalers. - */ -export interface Schema$RegionAutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionDisksResizeRequest { - /** - * The new size of the regional persistent disk, which is specified in GB. - */ - sizeGb: string; -} -export interface Schema$RegionDiskTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskType resources. - */ - items: Schema$DiskType[]; - /** - * [Output Only] Type of resource. Always compute#regionDiskTypeList for - * region disk types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of InstanceGroup resources. - */ -export interface Schema$RegionInstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of managed instance groups. - */ -export interface Schema$RegionInstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups that - * exist in th regional scope. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersListInstancesResponse { - /** - * A list of managed instances. - */ - managedInstances: Schema$ManagedInstance[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; -} -export interface Schema$RegionInstanceGroupManagersRecreateRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetAutoHealingRequest { - autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; -} -export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { - /** - * Fingerprint of the target pools information, which is a hash of the - * contents. This field is used for optimistic locking when you update the - * target pool entries. This field is optional. - */ - fingerprint: string; - /** - * The URL of all TargetPool resources to which instances in the instanceGroup - * field are added. The target pools automatically apply to all of the - * instances in the managed instance group. - */ - targetPools: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { - /** - * URL of the InstanceTemplate resource from which all new instances will be - * created. - */ - instanceTemplate: string; -} -export interface Schema$RegionInstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupsListInstancesRequest { - /** - * Instances in which state should be returned. Valid options are: - * 'ALL', 'RUNNING'. By default, it lists all instances. - */ - instanceState: string; - /** - * Name of port user is interested in. It is optional. If it is set, only - * information about this ports will be returned. If it is not set, all the - * named ports will be returned. Always lists all instances. - */ - portName: string; -} -export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of region resources. - */ -export interface Schema$RegionList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Region resources. - */ - items: Schema$Region[]; - /** - * [Output Only] Type of resource. Always compute#regionList for lists of - * regions. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash in order to update or change labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The labels to set for this resource. - */ - labels: any; -} -/** - * Commitment for a particular resource (a Commitment is composed of one or more - * of these). - */ -export interface Schema$ResourceCommitment { - /** - * The amount of the resource purchased (in a type-dependent unit, such as - * bytes). For vCPUs, this can just be an integer. For memory, this must be - * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of - * memory per every vCPU. - */ - amount: string; - /** - * Type of resource for which this commitment applies. Possible values are - * VCPU and MEMORY - */ - type: string; -} -export interface Schema$ResourceGroupReference { - /** - * A URI referencing one of the instance groups listed in the backend service. - */ - group: string; -} -/** - * Represents a Route resource. A route specifies how certain packets should be - * handled by the network. Routes are associated with instances by tags and the - * set of routes for a particular instance is called its routing table. For - * each packet leaving an instance, the system searches that instance's - * routing table for a single best matching route. Routes match packets by - * destination IP address, preferring smaller or more specific ranges over - * larger ones. If there is a tie, the system selects the route with the - * smallest priority value. If there is still a tie, it uses the layer three and - * four packet headers to select just one of the remaining matching routes. The - * packet is then forwarded as specified by the nextHop field of the winning - * route - either to another instance destination, an instance gateway, or a - * Google Compute Engine-operated gateway. Packets that do not match any route - * in the sending instance's routing table are dropped. (== resource_for - * beta.routes ==) (== resource_for v1.routes ==) - */ -export interface Schema$Route { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The destination range of outgoing packets that this route applies to. Only - * IPv4 is supported. - */ - destRange: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of this resource. Always compute#routes for Route - * resources. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Fully-qualified URL of the network that this route applies to. - */ - network: string; - /** - * The URL to a gateway that should handle matching packets. You can only - * specify the internet gateway using a full or partial valid URL: - * projects/<project-id>/global/gateways/default-internet-gateway - */ - nextHopGateway: string; - /** - * The URL to an instance that should handle matching packets. You can specify - * this as a full or partial URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ - */ - nextHopInstance: string; - /** - * The network IP address of an instance that should handle matching packets. - * Only IPv4 is supported. - */ - nextHopIp: string; - /** - * The URL of the local network if it should handle matching packets. - */ - nextHopNetwork: string; - /** - * [Output Only] The network peering name that should handle matching packets, - * which should conform to RFC1035. - */ - nextHopPeering: string; - /** - * The URL to a VpnTunnel that should handle matching packets. - */ - nextHopVpnTunnel: string; - /** - * The priority of this route. Priority is used to break ties in cases where - * there is more than one matching route of equal prefix length. In the case - * of two routes with equal prefix length, the one with the lowest-numbered - * priority value wins. Default value is 1000. Valid range is 0 through 65535. - */ - priority: number; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * A list of instance tags to which this route applies. - */ - tags: string[]; - /** - * [Output Only] If potential misconfigurations are detected for this route, - * this field will be populated with warning messages. - */ - warnings: any[]; -} -/** - * Contains a list of Route resources. - */ -export interface Schema$RouteList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Route resources. - */ - items: Schema$Route[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Router resource. - */ -export interface Schema$Router { - /** - * BGP information specific to this router. - */ - bgp: Schema$RouterBgp; - /** - * BGP information that needs to be configured into the routing stack to - * establish the BGP peering. It must specify peer ASN and either interface - * name, IP, or peer IP. Please refer to RFC4273. - */ - bgpPeers: Schema$RouterBgpPeer[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Router interfaces. Each interface requires either one linked resource (e.g. - * linkedVpnTunnel), or IP address and IP address range (e.g. ipRange), or - * both. - */ - interfaces: Schema$RouterInterface[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URI of the network to which this router belongs. - */ - network: string; - /** - * [Output Only] URI of the region where the router resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Description-tagged IP ranges for the router to advertise. - */ -export interface Schema$RouterAdvertisedIpRange { - /** - * User-specified description for the IP range. - */ - description: string; - /** - * The IP range to advertise. The value must be a CIDR-formatted string. - */ - range: string; -} -/** - * Contains a list of routers. - */ -export interface Schema$RouterAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RouterBgp { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and is advertised - * to all peers of the router. These groups will be advertised in addition to - * any specified prefixes. Leave this field blank to advertise no custom - * groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and is - * advertised to all peers of the router. These IP ranges will be advertised - * in addition to any specified groups. Leave this field blank to advertise no - * custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, - * either 16-bit or 32-bit. The value will be fixed for this router resource. - * All VPN tunnels that link to this router will have the same local ASN. - */ - asn: number; -} -export interface Schema$RouterBgpPeer { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and overrides the - * list defined for the router (in Bgp message). These groups will be - * advertised in addition to any specified prefixes. Leave this field blank to - * advertise no custom groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and overrides - * the list defined for the router (in Bgp message). These IP ranges will be - * advertised in addition to any specified groups. Leave this field blank to - * advertise no custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * The priority of routes advertised to this BGP peer. In the case where there - * is more than one matching route of maximum length, the routes with lowest - * priority value win. - */ - advertisedRoutePriority: number; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Name of the interface the BGP peer is associated with. - */ - interfaceName: string; - /** - * IP address of the interface inside Google Cloud Platform. Only IPv4 is - * supported. - */ - ipAddress: string; - /** - * [Output Only] Type of how the resource/configuration of the BGP peer is - * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT - * represents an BGP peer that is automatically created for PARTNER - * interconnectAttachment, Google will automatically create/delete this type - * of BGP peer when the PARTNER interconnectAttachment is created/deleted. - */ - managementType: string; - /** - * Name of this BGP peer. The name must be 1-63 characters long and comply - * with RFC1035. - */ - name: string; - /** - * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can - * be different for every tunnel. - */ - peerAsn: number; - /** - * IP address of the BGP interface outside Google cloud. Only IPv4 is - * supported. - */ - peerIpAddress: string; -} -export interface Schema$RouterInterface { - /** - * IP address and range of the interface. The IP range must be in the RFC3927 - * link-local IP space. The value must be a CIDR-formatted string, for - * example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents - * the IP address of the interface. - */ - ipRange: string; - /** - * URI of the linked interconnect attachment. It must be in the same region as - * the router. Each interface can have at most one linked resource and it - * could either be a VPN Tunnel or an interconnect attachment. - */ - linkedInterconnectAttachment: string; - /** - * URI of the linked VPN tunnel. It must be in the same region as the router. - * Each interface can have at most one linked resource and it could either be - * a VPN Tunnel or an interconnect attachment. - */ - linkedVpnTunnel: string; - /** - * [Output Only] Type of how the resource/configuration of the interface is - * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT - * represents an interface that is automatically created for PARTNER type - * interconnectAttachment, Google will automatically create/update/delete this - * type of interface when the PARTNER interconnectAttachment is - * created/provisioned/deleted. - */ - managementType: string; - /** - * Name of this interface entry. The name must be 1-63 characters long and - * comply with RFC1035. - */ - name: string; -} -/** - * Contains a list of Router resources. - */ -export interface Schema$RouterList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: Schema$Router[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RoutersPreviewResponse { - /** - * Preview of given router. - */ - resource: Schema$Router; -} -export interface Schema$RoutersScopedList { - /** - * A list of routers contained in this scope. - */ - routers: Schema$Router[]; - /** - * Informational warning which replaces the list of routers when the list is - * empty. - */ - warning: any; -} -export interface Schema$RouterStatus { - /** - * Best routes for this router's network. - */ - bestRoutes: Schema$Route[]; - /** - * Best routes learned by this router. - */ - bestRoutesForRouter: Schema$Route[]; - bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; - /** - * URI of the network to which this router belongs. - */ - network: string; -} -export interface Schema$RouterStatusBgpPeerStatus { - /** - * Routes that were advertised to the remote BGP peer - */ - advertisedRoutes: Schema$Route[]; - /** - * IP address of the local BGP interface. - */ - ipAddress: string; - /** - * URL of the VPN tunnel that this BGP peer controls. - */ - linkedVpnTunnel: string; - /** - * Name of this BGP peer. Unique within the Routers resource. - */ - name: string; - /** - * Number of routes learned from the remote BGP Peer. - */ - numLearnedRoutes: number; - /** - * IP address of the remote BGP interface. - */ - peerIpAddress: string; - /** - * BGP state as specified in RFC1771. - */ - state: string; - /** - * Status of the BGP peer: {UP, DOWN} - */ - status: string; - /** - * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 - * hours, 59 minutes, 59 seconds - */ - uptime: string; - /** - * Time this session has been up, in seconds. Format: 145 - */ - uptimeSeconds: string; -} -export interface Schema$RouterStatusResponse { - /** - * Type of resource. - */ - kind: string; - result: Schema$RouterStatus; -} -/** - * A rule to be applied in a Policy. - */ -export interface Schema$Rule { - /** - * Required - */ - action: string; - /** - * Additional restrictions that must be met. All conditions must pass for the - * rule to match. - */ - conditions: Schema$Condition[]; - /** - * Human-readable description of the rule. - */ - description: string; - /** - * If one or more 'in' clauses are specified, the rule matches if the - * PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - */ - ins: string[]; - /** - * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - * that match the LOG action. - */ - logConfigs: Schema$LogConfig[]; - /** - * If one or more 'not_in' clauses are specified, the rule matches if - * the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - */ - notIns: string[]; - /** - * A permission is a string of form '..' (e.g., - * 'storage.buckets.list'). A value of '*' matches all - * permissions, and a verb part of '*' (e.g., - * 'storage.buckets.*') matches all verbs. - */ - permissions: string[]; -} -/** - * Sets the scheduling options for an Instance. - */ -export interface Schema$Scheduling { - /** - * Specifies whether the instance should be automatically restarted if it is - * terminated by Compute Engine (not terminated by a user). You can only set - * the automatic restart option for standard instances. Preemptible instances - * cannot be automatically restarted. By default, this is set to true so an - * instance is automatically restarted if it is terminated by Compute Engine. - */ - automaticRestart: boolean; - /** - * Defines the maintenance behavior for this instance. For standard instances, - * the default behavior is MIGRATE. For preemptible instances, the default and - * only possible behavior is TERMINATE. For more information, see Setting - * Instance Scheduling Options. - */ - onHostMaintenance: string; - /** - * Defines whether the instance is preemptible. This can only be set during - * instance creation, it cannot be set or changed after the instance has been - * created. - */ - preemptible: boolean; -} -/** - * A security policy is comprised of one or more rules. It can also be - * associated with one or more 'targets'. - */ -export interface Schema$SecurityPolicy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Specifies a fingerprint for this resource, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. To see - * the latest fingerprint, make get() request to the security policy. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output only] Type of the resource. Always compute#securityPolicyfor - * security policies - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A list of rules that belong to this policy. There must always be a default - * rule (rule with priority 2147483647 and match "*"). If no rules - * are provided when creating a security policy, a default rule with action - * "allow" will be added. - */ - rules: Schema$SecurityPolicyRule[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$SecurityPolicyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SecurityPolicy resources. - */ - items: Schema$SecurityPolicy[]; - /** - * [Output Only] Type of resource. Always compute#securityPolicyList for - * listsof securityPolicies - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SecurityPolicyReference { securityPolicy: string; } -/** - * Represents a rule that describes one or more match conditions along with the - * action to be taken when traffic matches this condition (allow or deny). - */ -export interface Schema$SecurityPolicyRule { - /** - * The Action to preform when the client connection triggers the rule. Can - * currently be either "allow" or "deny()" where valid - * values for status are 403, 404, and 502. - */ - action: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output only] Type of the resource. Always compute#securityPolicyRule for - * security policy rules - */ - kind: string; - /** - * A match condition that incoming traffic is evaluated against. If it - * evaluates to true, the corresponding ?action? is enforced. - */ - match: Schema$SecurityPolicyRuleMatcher; - /** - * If set to true, the specified action is not enforced. - */ - preview: boolean; - /** - * An integer indicating the priority of a rule in the list. The priority must - * be a positive value between 0 and 2147483647. Rules are evaluated in the - * increasing order of priority. - */ - priority: number; -} -/** - * Represents a match condition that incoming traffic is evaluated against. - * Exactly one field must be specified. - */ -export interface Schema$SecurityPolicyRuleMatcher { - /** - * The configuration options available when specifying versioned_expr. This - * field must be specified if versioned_expr is specified and cannot be - * specified if versioned_expr is not specified. - */ - config: Schema$SecurityPolicyRuleMatcherConfig; - /** - * User defined CEVAL expression. A CEVAL expression is used to specify match - * criteria such as origin.ip, source.region_code and contents in the request - * header. - */ - expr: Schema$Expr; - /** - * CIDR IP address range. - */ - srcIpRanges: string[]; - /** - * Preconfigured versioned expression. If this field is specified, config must - * also be specified. Available preconfigured expressions along with their - * requirements are: SRC_IPS_V1 - must specify the corresponding src_ip_range - * field in config. - */ - versionedExpr: string; -} -export interface Schema$SecurityPolicyRuleMatcherConfig { - /** - * CIDR IP address range. - */ - srcIpRanges: string[]; -} -/** - * An instance's serial console output. - */ -export interface Schema$SerialPortOutput { - /** - * [Output Only] The contents of the console output. - */ - contents: string; - /** - * [Output Only] Type of the resource. Always compute#serialPortOutput for - * serial port output. - */ - kind: string; - /** - * [Output Only] The position of the next byte of content from the serial - * console output. Use this value in the next request as the start parameter. - */ - next: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * The starting byte position of the output that was returned. This should - * match the start parameter sent with the request. If the serial console - * output exceeds the size of the buffer, older output will be overwritten by - * newer content and the start values will be mismatched. - */ - start: string; -} -/** - * A service account. - */ -export interface Schema$ServiceAccount { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -/** - * Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs - */ -export interface Schema$SignedUrlKey { - /** - * Name of the key. The name must be 1-63 characters long, and comply with - * RFC1035. Specifically, the name must be 1-63 characters long and match the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - keyName: string; - /** - * 128-bit key value used for signing the URL. The key value must be a valid - * RFC 4648 Section 5 base64url encoded string. - */ - keyValue: string; -} -/** - * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== - * resource_for v1.snapshots ==) - */ -export interface Schema$Snapshot { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Size of the snapshot, specified in GB. - */ - diskSizeGb: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#snapshot for Snapshot - * resources. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this snapshot, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a snapshot. - */ - labelFingerprint: string; - /** - * Labels to apply to this snapshot. These can be later modified by the - * setLabels method. Label values may be empty. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this - * snapshot. - */ - licenseCodes: string[]; - /** - * [Output Only] A list of public visible licenses that apply to this - * snapshot. This can be because the original image had licenses attached - * (such as a Windows image). - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Encrypts the snapshot using a customer-supplied encryption key. After you - * encrypt a snapshot using a customer-supplied key, you must provide the same - * key if you use the image later For example, you must provide the encryption - * key when you create a disk from the encrypted snapshot in a future request. - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the snapshot, - * then the snapshot will be encrypted using an automatically generated key - * and you do not need to provide a key to use the snapshot later. - */ - snapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The source disk used to create this snapshot. - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the disk used to create this snapshot. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given disk name. - */ - sourceDiskId: string; - /** - * [Output Only] The status of the snapshot. This can be CREATING, DELETING, - * FAILED, READY, or UPLOADING. - */ - status: string; - /** - * [Output Only] A size of the storage used by the snapshot. As snapshots - * share storage, this number is expected to change with snapshot - * creation/deletion. - */ - storageBytes: string; - /** - * [Output Only] An indicator whether storageBytes is in a stable state or it - * is being adjusted as a result of shared storage reallocation. This status - * can either be UPDATING, meaning the size of the snapshot is being updated, - * or UP_TO_DATE, meaning the size of the snapshot is up-to-date. - */ - storageBytesStatus: string; -} -/** - * Contains a list of Snapshot resources. - */ -export interface Schema$SnapshotList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Snapshot resources. - */ - items: Schema$Snapshot[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A specification of the parameters to use when creating the instance template - * from a source instance. - */ -export interface Schema$SourceInstanceParams { - /** - * Attached disks configuration. If not provided, defaults are applied: For - * boot disk and any other R/W disks, new custom images will be created from - * each disk. For read-only disks, they will be attached in read-only mode. - * Local SSD disks will be created as blank volumes. - */ - diskConfigs: Schema$DiskInstantiationConfig[]; -} -/** - * An SslCertificate resource. This resource provides a mechanism to upload an - * SSL key and certificate to the load balancer to serve secure connections from - * the user. (== resource_for beta.sslCertificates ==) (== resource_for - * v1.sslCertificates ==) - */ -export interface Schema$SslCertificate { - /** - * A local certificate file. The certificate must be in PEM format. The - * certificate chain must be no greater than 5 certs long. The chain must - * include at least one intermediate cert. - */ - certificate: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#sslCertificate for SSL - * certificates. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A write-only private key in PEM format. Only insert requests will include - * this field. - */ - privateKey: string; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Contains a list of SslCertificate resources. - */ -export interface Schema$SslCertificateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslCertificate resources. - */ - items: Schema$SslCertificate[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SSLHealthCheck { - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the SSL connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$SslPoliciesList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslPolicy resources. - */ - items: Schema$SslPolicy[]; - /** - * [Output Only] Type of the resource. Always compute#sslPoliciesList for - * lists of sslPolicies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SslPoliciesListAvailableFeaturesResponse { - features: string[]; -} -/** - * A SSL policy specifies the server-side support for SSL features. This can be - * attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections - * between clients and the HTTPS or SSL proxy load balancer. They do not affect - * the connection between the load balancers and the backends. - */ -export interface Schema$SslPolicy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * A list of features enabled when the selected profile is CUSTOM. The - - * method returns the set of features that can be specified in this list. This - * field must be empty if the profile is not CUSTOM. - */ - customFeatures: string[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The list of features enabled in the SSL policy. - */ - enabledFeatures: string[]; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a SslPolicy. An up-to-date fingerprint must be provided in order - * to update the SslPolicy. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output only] Type of the resource. Always compute#sslPolicyfor SSL - * policies. - */ - kind: string; - /** - * The minimum version of SSL protocol that can be used by the clients to - * establish a connection with the load balancer. This can be one of TLS_1_0, - * TLS_1_1, TLS_1_2. - */ - minTlsVersion: string; - /** - * Name of the resource. The name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * Profile specifies the set of SSL features that can be used by the load - * balancer when negotiating SSL with clients. This can be one of COMPATIBLE, - * MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to - * enable must be specified in the customFeatures field. - */ - profile: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] If potential misconfigurations are detected for this SSL - * policy, this field will be populated with warning messages. - */ - warnings: any[]; -} -export interface Schema$SslPolicyReference { - /** - * URL of the SSL policy resource. Set this to empty string to clear any - * existing SSL policy associated with the target proxy resource. - */ - sslPolicy: string; -} -/** - * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for - * v1.subnetworks ==) - */ -export interface Schema$Subnetwork { - /** - * Whether this subnetwork can conflict with static routes. Setting this to - * true allows this subnetwork's primary and secondary ranges to conflict - * with routes that have already been configured on the corresponding network. - * Static routes will take precedence over the subnetwork route if the route - * prefix length is at least as large as the subnetwork prefix length. Also, - * packets destined to IPs within subnetwork may contain private/sensitive - * data and are prevented from leaving the virtual network. Setting this field - * to true will disable this feature. The default value is false and applies - * to all existing subnetworks and automatically created subnetworks. This - * field cannot be set to true at resource creation time. - */ - allowSubnetCidrRoutesOverlap: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. This field can be set only at resource creation time. - */ - description: string; - /** - * Whether to enable flow logging for this subnetwork. - */ - enableFlowLogs: boolean; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a Subnetwork. An up-to-date fingerprint must be provided in order - * to update the Subnetwork. - */ - fingerprint: string; - /** - * [Output Only] The gateway address for default routes to reach destination - * addresses outside this subnetwork. - */ - gatewayAddress: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are owned by this subnetwork. Provide - * this property when you create the subnetwork. For example, 10.0.0.0/8 or - * 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. - * Only IPv4 is supported. This field can be set only at resource creation - * time. - */ - ipCidrRange: string; - /** - * [Output Only] Type of the resource. Always compute#subnetwork for - * Subnetwork resources. - */ - kind: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The name must be 1-63 characters long, and comply with - * RFC1035. Specifically, the name must be 1-63 characters long and match the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * The URL of the network to which this subnetwork belongs, provided by the - * client when initially creating the subnetwork. Only networks that are in - * the distributed mode can have subnetworks. This field can be set only at - * resource creation time. - */ - network: string; - /** - * Whether the VMs in this subnet can access Google services without assigned - * external IP addresses. This field can be both set at resource creation time - * and updated using setPrivateIpGoogleAccess. - */ - privateIpGoogleAccess: boolean; - /** - * URL of the region where the Subnetwork resides. This field can be set only - * at resource creation time. - */ - region: string; - /** - * An array of configurations for secondary IP ranges for VM instances - * contained in this subnetwork. The primary IP of such VM must belong to the - * primary ipCidrRange of the subnetwork. The alias IPs may belong to either - * primary or secondary ranges. - */ - secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$SubnetworkAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SubnetworksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for - * aggregated lists of subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Subnetwork resources. - */ -export interface Schema$SubnetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Subnetwork resources. - */ - items: Schema$Subnetwork[]; - /** - * [Output Only] Type of resource. Always compute#subnetworkList for lists of - * subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a secondary IP range of a subnetwork. - */ -export interface Schema$SubnetworkSecondaryRange { - /** - * The range of IP addresses belonging to this subnetwork secondary range. - * Provide this property when you create the subnetwork. Ranges must be unique - * and non-overlapping with all primary and secondary IP ranges within a - * network. Only IPv4 is supported. - */ - ipCidrRange: string; - /** - * The name associated with this subnetwork secondary range, used when adding - * an alias IP range to a VM instance. The name must be 1-63 characters long, - * and comply with RFC1035. The name must be unique within the subnetwork. - */ - rangeName: string; -} -export interface Schema$SubnetworksExpandIpCidrRangeRequest { - /** - * The IP (in CIDR format or netmask) of internal addresses that are legal on - * this Subnetwork. This range should be disjoint from other subnetworks - * within this network. This range can only be larger than (i.e. a superset - * of) the range previously defined before the update. - */ - ipCidrRange: string; -} -export interface Schema$SubnetworksScopedList { - /** - * A list of subnetworks contained in this scope. - */ - subnetworks: Schema$Subnetwork[]; - /** - * An informational warning that appears when the list of addresses is empty. - */ - warning: any; -} -export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { - privateIpGoogleAccess: boolean; -} -/** - * A set of instance tags. - */ -export interface Schema$Tags { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. To see - * the latest fingerprint, make get() request to the instance. - */ - fingerprint: string; - /** - * An array of tags. Each tag must be 1-63 characters long, and comply with - * RFC1035. - */ - items: string[]; -} -/** - * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== - * resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies - * ==) - */ -export interface Schema$TargetHttpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpProxy for target - * HTTP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the UrlMap resource that defines the mapping from URL to the - * BackendService. - */ - urlMap: string; -} -/** - * A list of TargetHttpProxy resources. - */ -export interface Schema$TargetHttpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpProxy resources. - */ - items: Schema$TargetHttpProxy[]; - /** - * Type of resource. Always compute#targetHttpProxyList for lists of target - * HTTP proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetHttpsProxiesSetQuicOverrideRequest { - /** - * QUIC policy for the TargetHttpsProxy resource. - */ - quicOverride: string; -} -export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { - /** - * New set of SslCertificate resources to associate with this TargetHttpsProxy - * resource. Currently exactly one SslCertificate resource must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== - * resource_for beta.targetHttpsProxies ==) (== resource_for - * v1.targetHttpsProxies ==) - */ -export interface Schema$TargetHttpsProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpsProxy for target - * HTTPS proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the QUIC override policy for this TargetHttpsProxy resource. This - * determines whether the load balancer will attempt to negotiate QUIC with - * clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify ENABLE - * to always enable QUIC, Enables QUIC when set to ENABLE, and disables QUIC - * when set to DISABLE. If NONE is specified, uses the QUIC policy with no - * user overrides, which is equivalent to DISABLE. Not specifying this field - * is equivalent to specifying NONE. - */ - quicOverride: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * between users and the load balancer. Currently, exactly one SSL certificate - * must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetHttpsProxy - * resource. If not set, the TargetHttpsProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; - /** - * A fully-qualified or valid partial URL to the UrlMap resource that defines - * the mapping from URL to the BackendService. For example, the following are - * all valid URLs for specifying a URL map: - - * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map - * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map - */ - urlMap: string; -} -/** - * Contains a list of TargetHttpsProxy resources. - */ -export interface Schema$TargetHttpsProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpsProxy resources. - */ - items: Schema$TargetHttpsProxy[]; - /** - * Type of resource. Always compute#targetHttpsProxyList for lists of target - * HTTPS proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A TargetInstance resource. This resource defines an endpoint instance that - * terminates traffic of certain protocols. (== resource_for - * beta.targetInstances ==) (== resource_for v1.targetInstances ==) - */ -export interface Schema$TargetInstance { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A URL to the virtual machine instance that handles traffic for this target - * instance. When creating a target instance, you can provide the - * fully-qualified URL or a valid partial URL to the desired virtual machine. - * For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - instance: string; - /** - * [Output Only] The type of the resource. Always compute#targetInstance for - * target instances. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * NAT option controlling how IPs are NAT'ed to the instance. Currently - * only NO_NAT (default value) is supported. - */ - natPolicy: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] URL of the zone where the target instance resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - zone: string; -} -export interface Schema$TargetInstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetInstance resources. - */ -export interface Schema$TargetInstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: Schema$TargetInstance[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetInstancesScopedList { - /** - * A list of target instances contained in this scope. - */ - targetInstances: Schema$TargetInstance[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * A TargetPool resource. This resource defines a pool of instances, an - * associated HttpHealthCheck resource, and the fallback target pool. (== - * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) - */ -export interface Schema$TargetPool { - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool, and its failoverRatio field is - * properly set to a value between [0, 1]. backupPool and failoverRatio - * together define the fallback behavior of the primary target pool: if the - * ratio of the healthy instances in the primary pool is at or below - * failoverRatio, traffic arriving at the load-balanced IP will be directed to - * the backup pool. In case where failoverRatio and backupPool are not set, - * or all the instances in the backup pool are unhealthy, the traffic will be - * directed back to the primary pool in the "force" mode, where - * traffic will be spread to the healthy instances with the best effort, or to - * all instances when no instance is healthy. - */ - backupPool: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool (i.e., not as a backup pool to some - * other target pool). The value of the field must be in [0, 1]. If set, - * backupPool must also be set. They together define the fallback behavior of - * the primary target pool: if the ratio of the healthy instances in the - * primary pool is at or below this number, traffic arriving at the - * load-balanced IP will be directed to the backup pool. In case where - * failoverRatio is not set or all the instances in the backup pool are - * unhealthy, the traffic will be directed back to the primary pool in the - * "force" mode, where traffic will be spread to the healthy - * instances with the best effort, or to all instances when no instance is - * healthy. - */ - failoverRatio: number; - /** - * The URL of the HttpHealthCheck resource. A member instance in this pool is - * considered healthy if and only if the health checks pass. An empty list - * means all member instances will be considered healthy at all times. Only - * HttpHealthChecks are supported. Only one health check may be specified. - */ - healthChecks: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A list of resource URLs to the virtual machine instances serving this pool. - * They must live in zones contained in the same region as this pool. - */ - instances: string[]; - /** - * [Output Only] Type of the resource. Always compute#targetPool for target - * pools. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the target pool resides. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Sesssion affinity option, must be one of the following values: NONE: - * Connections from the same client IP may go to any instance in the pool. - * CLIENT_IP: Connections from the same client IP will go to the same instance - * in the pool while that instance remains healthy. CLIENT_IP_PROTO: - * Connections from the same client IP with the same IP protocol will go to - * the same instance in the pool while that instance remains healthy. - */ - sessionAffinity: string; -} -export interface Schema$TargetPoolAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for - * aggregated lists of target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolInstanceHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth - * when checking the health of an instance. - */ - kind: string; -} -/** - * Contains a list of TargetPool resources. - */ -export interface Schema$TargetPoolList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: Schema$TargetPool[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolList for lists of - * target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolsAddHealthCheckRequest { - /** - * The HttpHealthCheck to add to the target pool. - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsAddInstanceRequest { - /** - * A full or partial URL to an instance to add to this target pool. This can - * be a full or partial URL. For example, the following are valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name - * - projects/project-id/zones/zone/instances/instance-name - - * zones/zone/instances/instance-name - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsRemoveHealthCheckRequest { - /** - * Health check URL to be removed. This can be a full or valid partial URL. - * For example, the following are valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check - * - projects/project/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsRemoveInstanceRequest { - /** - * URLs of the instances to be removed from target pool. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsScopedList { - /** - * A list of target pools contained in this scope. - */ - targetPools: Schema$TargetPool[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$TargetReference { target: string; } -export interface Schema$TargetSslProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetSslProxy. - */ - service: string; -} -export interface Schema$TargetSslProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -export interface Schema$TargetSslProxiesSetSslCertificatesRequest { - /** - * New set of URLs to SslCertificate resources to associate with this - * TargetSslProxy. Currently exactly one ssl certificate must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetSslProxy resource. This resource defines an SSL proxy. (== - * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies - * ==) - */ -export interface Schema$TargetSslProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetSslProxy for - * target SSL proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * to Backends. Currently exactly one SSL certificate must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetSslProxy - * resource. If not set, the TargetSslProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; -} -/** - * Contains a list of TargetSslProxy resources. - */ -export interface Schema$TargetSslProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetSslProxy resources. - */ - items: Schema$TargetSslProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetTcpProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetTcpProxy. - */ - service: string; -} -export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -/** - * A TargetTcpProxy resource. This resource defines a TCP proxy. (== - * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies - * ==) - */ -export interface Schema$TargetTcpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetTcpProxy for - * target TCP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; -} -/** - * Contains a list of TargetTcpProxy resources. - */ -export interface Schema$TargetTcpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetTcpProxy resources. - */ - items: Schema$TargetTcpProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a Target VPN gateway resource. (== resource_for - * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) - */ -export interface Schema$TargetVpnGateway { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of URLs to the ForwardingRule resources. - * ForwardingRules are created using compute.forwardingRules.insert and - * associated to a VPN gateway. - */ - forwardingRules: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this TargetVpnGateway, which - * is essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an - * TargetVpnGateway. - */ - labelFingerprint: string; - /** - * Labels to apply to this TargetVpnGateway resource. These can be later - * modified by the setLabels method. Each label key/value must comply with - * RFC1035. Label values may be empty. - */ - labels: any; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network to which this VPN gateway is attached. Provided by the - * client when the VPN gateway is created. - */ - network: string; - /** - * [Output Only] URL of the region where the target VPN gateway resides. You - * must specify this field as part of the HTTP request URL. It is not settable - * as a field in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the VPN gateway. - */ - status: string; - /** - * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created - * using compute.vpntunnels.insert method and associated to a VPN gateway. - */ - tunnels: string[]; -} -export interface Schema$TargetVpnGatewayAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetVpnGateway resources. - */ -export interface Schema$TargetVpnGatewayList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: Schema$TargetVpnGateway[]; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetVpnGatewaysScopedList { - /** - * [Output Only] A list of target vpn gateways contained in this scope. - */ - targetVpnGateways: Schema$TargetVpnGateway[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -export interface Schema$TCPHealthCheck { - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the TCP connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$TestFailure { - actualService: string; - expectedService: string; - host: string; - path: string; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -export interface Schema$UDPHealthCheck { - /** - * The UDP port number for the health check request. Valid values are 1 - * through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Raw data of request to send in payload of UDP packet. It is an error if - * this is empty. The request data can only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. It is an - * error if this is empty. The response data can only be ASCII. - */ - response: string; -} -/** - * A UrlMap resource. This resource defines the mapping from URL to the - * BackendService resource, based on the "longest-match" of the - * URL's host and path. - */ -export interface Schema$UrlMap { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The URL of the BackendService resource if none of the hostRules match. - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a UrlMap. An up-to-date fingerprint must be provided in order to - * update the UrlMap. - */ - fingerprint: string; - /** - * The list of HostRules to use against the URL. - */ - hostRules: Schema$HostRule[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#urlMaps for url maps. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The list of named PathMatchers to use against the URL. - */ - pathMatchers: Schema$PathMatcher[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The list of expected URL mapping tests. Request to update this UrlMap will - * succeed only if all of the test cases pass. You can specify a maximum of - * 100 tests per UrlMap. - */ - tests: Schema$UrlMapTest[]; -} -/** - * Contains a list of UrlMap resources. - */ -export interface Schema$UrlMapList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of UrlMap resources. - */ - items: Schema$UrlMap[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$UrlMapReference { urlMap: string; } -export interface Schema$UrlMapsValidateRequest { - /** - * Content of the UrlMap to be validated. - */ - resource: Schema$UrlMap; -} -export interface Schema$UrlMapsValidateResponse { - result: Schema$UrlMapValidationResult; -} -/** - * Message for the expected URL mappings. - */ -export interface Schema$UrlMapTest { - /** - * Description of this test case. - */ - description: string; - /** - * Host portion of the URL. - */ - host: string; - /** - * Path portion of the URL. - */ - path: string; - /** - * Expected BackendService resource the given URL should be mapped to. - */ - service: string; -} -/** - * Message representing the validation result for a UrlMap. - */ -export interface Schema$UrlMapValidationResult { - loadErrors: string[]; - /** - * Whether the given UrlMap can be successfully loaded. If false, - * 'loadErrors' indicates the reasons. - */ - loadSucceeded: boolean; - testFailures: Schema$TestFailure[]; - /** - * If successfully loaded, this field indicates whether the test passed. If - * false, 'testFailures's indicate the reason of failure. - */ - testPassed: boolean; -} -/** - * Subnetwork which the current user has compute.subnetworks.use permission on. - */ -export interface Schema$UsableSubnetwork { - /** - * The range of internal addresses that are owned by this subnetwork. - */ - ipCidrRange: string; - /** - * Network URL. - */ - network: string; - /** - * Subnetwork URL. - */ - subnetwork: string; -} -export interface Schema$UsableSubnetworksAggregatedList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output] A list of usable subnetwork URLs. - */ - items: Schema$UsableSubnetwork[]; - /** - * [Output Only] Type of resource. Always - * compute#usableSubnetworksAggregatedList for aggregated lists of usable - * subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * The location in Cloud Storage and naming method of the daily usage report. - * Contains bucket_name and report_name prefix. - */ -export interface Schema$UsageExportLocation { - /** - * The name of an existing bucket in Cloud Storage where the usage report - * object is stored. The Google Service Account is granted write access to - * this bucket. This can either be the bucket name by itself, such as - * example-bucket, or the bucket name with gs:// or - * https://storage.googleapis.com/ in front of it, such as - * gs://example-bucket. - */ - bucketName: string; - /** - * An optional prefix for the name of the usage report object stored in - * bucketName. If not supplied, defaults to usage. The report is stored as a - * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the - * day of the usage according to Pacific Time. If you supply a prefix, it - * should conform to Cloud Storage object naming conventions. - */ - reportNamePrefix: string; -} -/** - * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for - * v1.vpnTunnels ==) - */ -export interface Schema$VpnTunnel { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Detailed status message for the VPN tunnel. - */ - detailedStatus: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * IKE protocol version to use when establishing the VPN tunnel with peer VPN - * gateway. Acceptable IKE versions are 1 or 2. Default version is 2. - */ - ikeVersion: number; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this VpnTunnel, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a VpnTunnel. - */ - labelFingerprint: string; - /** - * Labels to apply to this VpnTunnel. These can be later modified by the - * setLabels method. Each label key/value pair must comply with RFC1035. Label - * values may be empty. - */ - labels: any; - /** - * Local traffic selector to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - localTrafficSelector: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * IP address of the peer VPN gateway. Only IPv4 is supported. - */ - peerIp: string; - /** - * [Output Only] URL of the region where the VPN tunnel resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - region: string; - /** - * Remote traffic selectors to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - remoteTrafficSelector: string[]; - /** - * URL of router resource to be used for dynamic routing. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Shared secret used to set the secure session between the Cloud VPN gateway - * and the peer VPN gateway. - */ - sharedSecret: string; - /** - * Hash of the shared secret. - */ - sharedSecretHash: string; - /** - * [Output Only] The status of the VPN tunnel. - */ - status: string; - /** - * URL of the Target VPN gateway with which this VPN tunnel is associated. - * Provided by the client when the VPN tunnel is created. - */ - targetVpnGateway: string; -} -export interface Schema$VpnTunnelAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnelsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of VpnTunnel resources. - */ -export interface Schema$VpnTunnelList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnel resources. - */ - items: Schema$VpnTunnel[]; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$VpnTunnelsScopedList { - /** - * A list of vpn tunnels contained in this scope. - */ - vpnTunnels: Schema$VpnTunnel[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$XpnHostList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * [Output Only] A list of shared VPC host project URLs. - */ - items: Schema$Project[]; - /** - * [Output Only] Type of resource. Always compute#xpnHostList for lists of - * shared VPC hosts. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Service resource (a.k.a service project) ID. - */ -export interface Schema$XpnResourceId { - /** - * The ID of the service resource. In the case of projects, this field matches - * the project ID (e.g., my-project), not the project number (e.g., 12345678). - */ - id: string; - /** - * The type of the service resource. - */ - type: string; -} -/** - * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones - * ==) - */ -export interface Schema$Zone { - /** - * [Output Only] Available cpu/platform selections for the zone. - */ - availableCpuPlatforms: string[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this zone. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#zone for zones. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Full URL reference to the region which hosts the zone. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the zone, either UP or DOWN. - */ - status: string; -} -/** - * Contains a list of zone resources. - */ -export interface Schema$ZoneList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Zone resources. - */ - items: Schema$Zone[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ZoneSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash in order to update or change labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The labels to set for this resource. - */ - labels: any; -} - -export class Resource$Acceleratortypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.acceleratorTypes.aggregatedList - * @desc Retrieves an aggregated list of accelerator types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/aggregated/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.get - * @desc Returns the specified accelerator type. Get a list of available - * accelerator types by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the accelerator type to return. - * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.acceleratorTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.acceleratorType Name of the accelerator type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'acceleratorType'], - pathParams: ['acceleratorType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.list - * @desc Retrieves a list of accelerator types available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.list(request, handlePage); - * } - * }; - * - * compute.acceleratorTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Addresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.addresses.aggregatedList - * @desc Retrieves an aggregated list of addresses. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.aggregatedList(request, handlePage); - * } - * }; - * - * compute.addresses.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.delete - * @desc Deletes the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.get - * @desc Returns the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.addresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.list - * @desc Retrieves a list of addresses contained within the specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.list(request, handlePage); - * } - * }; - * - * compute.addresses.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.setLabels - * @desc Sets the labels on an Address. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.addresses.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.addresses.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Autoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.autoscalers.aggregatedList - * @desc Retrieves an aggregated list of autoscalers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.autoscalers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.delete - * @desc Deletes the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.get - * @desc Returns the specified autoscaler resource. Get a list of available - * autoscalers by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.list(request, handlePage); - * } - * }; - * - * compute.autoscalers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendbuckets { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendBuckets.addSignedUrlKey - * @desc Adds the given Signed URL Key to the backend bucket. - * @alias compute.backendBuckets.addSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SignedUrlKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.delete - * @desc Deletes the specified BackendBucket resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to delete. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.deleteSignedUrlKey - * @desc Deletes the given Signed URL Key from the backend bucket. - * @alias compute.backendBuckets.deleteSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.keyName The name of the Signed URL Key to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendBucket', 'keyName'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.get - * @desc Returns the specified BackendBucket resource. Get a list of available - * backend buckets by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to return. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.insert - * @desc Creates a BackendBucket resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.list - * @desc Retrieves the list of BackendBucket resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendBuckets.list(request, handlePage); - * } - * }; - * - * compute.backendBuckets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.patch - * @desc Updates the specified BackendBucket resource with the data included - * in the request. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to patch. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.update - * @desc Updates the specified BackendBucket resource with the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to update. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendServices.addSignedUrlKey - * @desc Adds the given Signed URL Key to the specified backend service. - * @alias compute.backendServices.addSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SignedUrlKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}/addSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.aggregatedList - * @desc Retrieves the list of all BackendService resources, regional and - * global, available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the project scoping this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.aggregatedList(request, handlePage); - * } - * }; - * - * compute.backendServices.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Name of the project scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.delete - * @desc Deletes the specified BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.backendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.deleteSignedUrlKey - * @desc Deletes the given Signed URL Key from the specified backend service. - * @alias compute.backendServices.deleteSignedUrlKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. - * @param {string} params.keyName The name of the Signed URL Key to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteSignedUrlKey(params?: any, options?: MethodOptions): - AxiosPromise; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteSignedUrlKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService', 'keyName'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.get - * @desc Returns the specified BackendService resource. Get a list of - * available backend services by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.backendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.getHealth - * @desc Gets the most recent health check results for this BackendService. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance - * belongs. backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. - * @param {string} params.project - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.insert - * @desc Creates a BackendService resource in the specified project using the - * data included in the request. There are several restrictions and guidelines - * to keep in mind when creating a backend service. Read Restrictions and - * Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.list - * @desc Retrieves the list of BackendService resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.list(request, handlePage); - * } - * }; - * - * compute.backendServices.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.patch - * @desc Patches the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.setSecurityPolicy - * @desc Sets the security policy for the specified backend service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the security policy - * should be set. The name should - * // conform to RFC1035. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.setSecurityPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.setSecurityPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SecurityPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSecurityPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSecurityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSecurityPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}/setSecurityPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.update - * @desc Updates the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.disks.aggregatedList - * @desc Retrieves an aggregated list of persistent disks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.aggregatedList(request, handlePage); - * } - * }; - * - * compute.disks.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/aggregated/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.createSnapshot - * @desc Creates a snapshot of a specified persistent disk. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to snapshot. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.createSnapshot(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.createSnapshot - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to snapshot. - * @param {boolean=} params.guestFlush - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Snapshot} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSnapshot(params?: any, options?: MethodOptions): - AxiosPromise; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.delete - * @desc Deletes the specified persistent disk. Deleting a disk removes its - * data permanently and is irreversible. However, deleting a disk does not - * delete any snapshots previously made from the disk. You must separately - * delete snapshots. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to delete. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.get - * @desc Returns a specified persistent disk. Get a list of available - * persistent disks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to return. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.insert - * @desc Creates a persistent disk in the specified project using the data in - * the request. You can create a disk with a sourceImage, a sourceSnapshot, or - * create an empty 500 GB data disk by omitting all properties. You can also - * create a disk that is larger than the default size by specifying the sizeGb - * property. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. - * @param {string} params.zone The name of the zone for this request. - * @param {().Disk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.list - * @desc Retrieves a list of persistent disks contained within the specified - * zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.list(request, handlePage); - * } - * }; - * - * compute.disks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.resize - * @desc Resizes the specified persistent disk. You can only increase the size - * of the disk. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the persistent disk. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk The name of the persistent disk. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().DisksResizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.setLabels - * @desc Sets the labels on a disk. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().ZoneSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disktypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.diskTypes.aggregatedList - * @desc Retrieves an aggregated list of disk types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.diskTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.get - * @desc Returns the specified disk type. Get a list of available disk types - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the disk type to return. - * diskType: 'my-disk-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.diskTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.diskType Name of the disk type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/diskTypes/{diskType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'diskType'], - pathParams: ['diskType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.list - * @desc Retrieves a list of disk types available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.list(request, handlePage); - * } - * }; - * - * compute.diskTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Firewalls { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.firewalls.delete - * @desc Deletes the specified firewall. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to delete. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.get - * @desc Returns the specified firewall. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to return. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.insert - * @desc Creates a firewall rule in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.list - * @desc Retrieves the list of firewall rules available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.firewalls.list(request, handlePage); - * } - * }; - * - * compute.firewalls.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.patch - * @desc Updates the specified firewall rule with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to patch. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/firewalls/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.update - * @desc Updates the specified firewall rule with the data included in the - * request. The PUT method can only update the following fields of firewall - * rule: allowed, description, sourceRanges, sourceTags, targetTags. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to update. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Forwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.forwardingRules.aggregatedList - * @desc Retrieves an aggregated list of forwarding rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.aggregatedList(request, handlePage); - * } - * }; - * - * compute.forwardingRules.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.delete - * @desc Deletes the specified ForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.get - * @desc Returns the specified ForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.insert - * @desc Creates a ForwardingRule resource in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.list - * @desc Retrieves a list of ForwardingRule resources available to the - * specified project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.list(request, handlePage); - * } - * }; - * - * compute.forwardingRules.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.setLabels - * @desc Sets the labels on the specified resource. To learn more about - * labels, read the Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.setTarget - * @desc Changes target URL for forwarding rule. The new target should be of - * the same type as the old target. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaladdresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalAddresses.delete - * @desc Deletes the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.get - * @desc Returns the specified address resource. Get a list of available - * addresses by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.list - * @desc Retrieves a list of global addresses. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalAddresses.list(request, handlePage); - * } - * }; - * - * compute.globalAddresses.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.setLabels - * @desc Sets the labels on a GlobalAddress. To learn more about labels, read - * the Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/addresses/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/addresses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globalforwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalForwardingRules.delete - * @desc Deletes the specified GlobalForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.get - * @desc Returns the specified GlobalForwardingRule resource. Get a list of - * available forwarding rules by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.insert - * @desc Creates a GlobalForwardingRule resource in the specified project - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.list - * @desc Retrieves a list of GlobalForwardingRule resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalForwardingRules.list(request, handlePage); - * } - * }; - * - * compute.globalForwardingRules.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.setLabels - * @desc Sets the labels on the specified resource. To learn more about - * labels, read the Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setLabels(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.setTarget - * @desc Changes target URL for the GlobalForwardingRule resource. The new - * target should be of the same type as the old target. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setTarget(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/forwardingRules/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaloperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalOperations.aggregatedList - * @desc Retrieves an aggregated list of all operations. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.aggregatedList(request, handlePage); - * } - * }; - * - * compute.globalOperations.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.delete - * @desc Deletes the specified Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.get - * @desc Retrieves the specified Operations resource. Get a list of operations - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.list(request, handlePage); - * } - * }; - * - * compute.globalOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/beta/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Healthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.healthChecks.delete - * @desc Deletes the specified HealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to delete. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.get - * @desc Returns the specified HealthCheck resource. Get a list of available - * health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to return. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.insert - * @desc Creates a HealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.list - * @desc Retrieves the list of HealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.healthChecks.list(request, handlePage); - * } - * }; - * - * compute.healthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.patch - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to patch. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.testIamPermissions(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.update - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to update. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httphealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpHealthChecks.delete - * @desc Deletes the specified HttpHealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to delete. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.get - * @desc Returns the specified HttpHealthCheck resource. Get a list of - * available HTTP health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to return. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.insert - * @desc Creates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.list - * @desc Retrieves the list of HttpHealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpHealthChecks.list(request, handlePage); - * } - * }; - * - * compute.httpHealthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.patch - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to patch. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.update - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to update. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httpshealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpsHealthChecks.delete - * @desc Deletes the specified HttpsHealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to delete. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.get - * @desc Returns the specified HttpsHealthCheck resource. Get a list of - * available HTTPS health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to return. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.insert - * @desc Creates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.list - * @desc Retrieves the list of HttpsHealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpsHealthChecks.list(request, handlePage); - * } - * }; - * - * compute.httpsHealthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.patch - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to patch. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.update - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to update. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Images { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.images.delete - * @desc Deletes the specified image. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image resource to delete. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.deprecate - * @desc Sets the deprecation status of an image. If an empty request body is - * given, clears the deprecation status instead. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Image name. - * image: 'my-image', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.deprecate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.deprecate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Image name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DeprecationStatus} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deprecate(params?: any, options?: MethodOptions): - AxiosPromise; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/images/{image}/deprecate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.get - * @desc Returns the specified image. Get a list of available images by making - * a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image resource to return. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.getFromFamily - * @desc Returns the latest image that is part of an image family and is not - * deprecated. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image family to search for. - * family: 'my-family', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.getFromFamily(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.getFromFamily - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.family Name of the image family to search for. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getFromFamily(params?: any, options?: MethodOptions): - AxiosPromise; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/images/family/{family}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'family'], - pathParams: ['family', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.insert - * @desc Creates an image in the specified project using the data included in - * the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.forceCreate Force image creation if true. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Image} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.list - * @desc Retrieves the list of custom images available to the specified - * project. Custom images are images you create that belong to your project. - * This method does not get any images that belong to other projects, - * including publicly-available images, like Debian 8. If you want to get a - * list of publicly-available images, use this method to make a request to the - * respective image project, such as debian-cloud or windows-cloud. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.images.list(request, handlePage); - * } - * }; - * - * compute.images.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.setLabels - * @desc Sets the labels on an image. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/images/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/images/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.abandonInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.aggregatedList - * @desc Retrieves the list of managed instance groups and groups them by - * zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/aggregated/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.instanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. Note that the instance group must not belong to a backend - * service. Read Deleting an instance group for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.deleteInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. Gets a list of available managed instance groups by making a list() - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A managed instance group can have up to 1000 VM instances per - * group. Please contact Cloud Support if you need an increase in this limit. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the managed instance - * group. zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.list - * @desc Retrieves a list of managed instance groups that are contained within - * the specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.list(request, handlePage); - * } - * }; - * - * compute.instanceGroupManagers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.listManagedInstances - * @desc Lists all of the instances in the managed instance group. Each - * instance in the list has a currentAction, which indicates the action that - * the managed instance group is performing on the instance. For example, if - * the group is still creating an instance, the currentAction is CREATING. If - * a previous action failed, the list displays the errors for that failed - * action. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedInstancesPage = response['managedInstances']; - * if (!managedInstancesPage) { - * return; - * } - * for (var i = 0; i < managedInstancesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `managedInstancesPage`: console.log(JSON.stringify(managedInstancesPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.listManagedInstances(request, - * handlePage); - * } - * }; - * - * compute.instanceGroupManagers.listManagedInstances(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>(parameters); - } - } - - - /** - * compute.instanceGroupManagers.patch - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * patched even if the instances in the group are still in the process of - * being patched. You must separately verify the status of the individual - * instances with the listManagedInstances method. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the managed instance - * group. zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.recreateInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.resize - * @desc Resizes the managed instance group. If you increase the size, the - * group creates new instances using the current instance template. If you - * decrease the size, the group deletes instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * // The number of running instances that the managed instance group - * should maintain at any given time. - * // The group automatically adds or removes instances to maintain the - * number of instances specified by - * // this parameter. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.resizeAdvanced - * @desc Resizes the managed instance group with advanced configuration - * options like disabling creation retries. This is an extended version of the - * resize method. If you increase the size of the instance group, the group - * creates new instances using the current instance template. If you decrease - * the size, the group deletes instances. The resize operation is marked DONE - * when the resize actions are scheduled even if the group has not yet added - * or deleted any instances. You must separately verify the status of the - * creating, creatingWithoutRetries, or deleting actions with the get or - * listmanagedinstances method. If the group is part of a backend service - * that has enabled connection draining, it can take up to 60 seconds after - * the connection draining duration has elapsed before the VM instance is - * removed or deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resizeAdvanced(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.resizeAdvanced - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersResizeAdvancedRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resizeAdvanced(params?: any, options?: MethodOptions): - AxiosPromise; - resizeAdvanced( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resizeAdvanced( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setAutoHealingPolicies - * @desc Modifies the autohealing policies. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setAutoHealingPolicies(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.setAutoHealingPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetAutoHealingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAutoHealingPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setInstanceTemplate - * @desc Specifies the instance template to use when creating new instances in - * this group. The templates for existing instances in the group do not change - * unless you recreate them. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setInstanceTemplate(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all instances in this managed - * instance group are assigned. The target pools automatically apply to all of - * the instances in the managed instance group. This operation is marked DONE - * when you make the request even if the instances have not yet been added to - * their target pools. The change might take some time to apply to all of the - * instances in the group depending on the size of the group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setTargetPools(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.update - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * updated even if the instances in the group have not yet been updated. You - * must separately verify the status of the individual instances with the - * listManagedInstances method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the managed instance - * group. zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroups.addInstances - * @desc Adds a list of instances to the specified instance group. All of the - * instances in the instance group must be in the same network/subnetwork. - * Read Adding instances for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where you are adding instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.addInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.addInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where you are adding instances. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstances(params?: any, options?: MethodOptions): - AxiosPromise; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.aggregatedList - * @desc Retrieves the list of instance groups and sorts them by zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instanceGroups.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.delete - * @desc Deletes the specified instance group. The instances in the group are - * not deleted. Note that instance group must not belong to a backend service. - * Read Deleting an instance group for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group to delete. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.get - * @desc Returns the specified instance group. Get a list of available - * instance groups by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.insert - * @desc Creates an instance group in the specified project using the - * parameters that are included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the instance group. - * @param {().InstanceGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.list - * @desc Retrieves the list of instance groups that are located in the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.list(request, handlePage); - * } - * }; - * - * compute.instanceGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.listInstances - * @desc Lists the instances in the specified instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group from which you want to generate a - * list of included instances. instanceGroup: 'my-instance-group', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.instanceGroups.listInstances(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.removeInstances - * @desc Removes one or more instances from the specified instance group, but - * does not delete those instances. If the group is part of a backend service - * that has enabled connection draining, it can take up to 60 seconds after - * the connection draining duration before the VM instance is removed or - * deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the specified instances will be - * removed. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.removeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.removeInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstances(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.setNamedPorts - * @desc Sets the named ports for the specified instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instances.addAccessConfig - * @desc Adds an access config to an instance's network interface. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the network interface to add to this instance. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.addAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.addAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to add to this instance. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.aggregatedList - * @desc Retrieves aggregated list of instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instances.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.attachDisk - * @desc Attaches an existing Disk resource to an instance. You must first - * create the disk before you can attach it. It is not possible to create and - * attach a disk at the same time. For more information, read Adding a - * persistent disk to your instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.attachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.attachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.forceAttach Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks. - * @param {string} params.instance The instance name for this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AttachedDisk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - attachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.delete - * @desc Deletes the specified Instance resource. For more information, see - * Stopping or Deleting an Instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to delete. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.deleteAccessConfig - * @desc Deletes an access config from an instance's network interface. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the access config to delete. - * accessConfig: '', // TODO: Update placeholder value. - * - * // The name of the network interface. - * networkInterface: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.deleteAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.deleteAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accessConfig The name of the access config to delete. - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.detachDisk - * @desc Detaches a disk from an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Disk device name to detach. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.detachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.detachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceName Disk device name to detach. - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.get - * @desc Returns the specified Instance resource. Get a list of available - * instances by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to return. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.getSerialPortOutput - * @desc Returns the specified instance's serial port output. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.getSerialPortOutput(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.getSerialPortOutput - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSerialPortOutput(params?: any, options?: MethodOptions): - AxiosPromise; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/serialPort') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.insert - * @desc Creates an instance resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate - * @param {string} params.zone The name of the zone for this request. - * @param {().Instance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.list - * @desc Retrieves the list of instances contained within the specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.list(request, handlePage); - * } - * }; - * - * compute.instances.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.listReferrers - * @desc Retrieves the list of referrers to instances contained within the - * specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the target instance scoping this request, or '-' if the - * request should span over all - * // instances in the container. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.listReferrers(request, handlePage); - * } - * }; - * - * compute.instances.listReferrers(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.listReferrers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listReferrers(params?: any, options?: MethodOptions): - AxiosPromise; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/referrers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.reset - * @desc Performs a reset on the instance. For more information, see Resetting - * an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.reset(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDeletionProtection - * @desc Sets deletion protection on the instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDeletionProtection(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setDeletionProtection - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDeletionProtection(params?: any, options?: MethodOptions): - AxiosPromise; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDiskAutoDelete - * @desc Sets the auto-delete flag for a disk attached to an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Whether to auto-delete the disk when the instance is deleted. - * autoDelete: false, // TODO: Update placeholder value. - * - * // The device name of the disk to modify. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDiskAutoDelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setDiskAutoDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. - * @param {string} params.deviceName The device name of the disk to modify. - * @param {string} params.instance The instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDiskAutoDelete(params?: any, options?: MethodOptions): - AxiosPromise; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setLabels - * @desc Sets labels on an instance. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineResources - * @desc Changes the number and/or type of accelerator for a stopped instance - * to the values specified in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineResources(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMachineResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineResources(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineType - * @desc Changes the machine type for a stopped instance to the machine type - * specified in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineType(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMachineType - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineTypeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineType(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMetadata - * @desc Sets metadata for the specified instance to the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMinCpuPlatform - * @desc Changes the minimum CPU platform that this instance should use. This - * method can only be called on a stopped instance. For more information, read - * Specifying a Minimum CPU Platform. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMinCpuPlatform(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMinCpuPlatform - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMinCpuPlatform(params?: any, options?: MethodOptions): - AxiosPromise; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setScheduling - * @desc Sets an instance's scheduling options. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setScheduling(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setScheduling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Scheduling} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setScheduling(params?: any, options?: MethodOptions): - AxiosPromise; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setServiceAccount - * @desc Sets the service account on the instance. For more information, read - * Changing the service account and access scopes for an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetServiceAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setTags - * @desc Sets tags for the specified instance to the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setTags(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setTags - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Tags} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTags(params?: any, options?: MethodOptions): - AxiosPromise; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.simulateMaintenanceEvent - * @desc Simulates a maintenance event on the instance. - * @alias compute.instances.simulateMaintenanceEvent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - simulateMaintenanceEvent(params?: any, options?: MethodOptions): - AxiosPromise; - simulateMaintenanceEvent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - simulateMaintenanceEvent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.start - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.start(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.startWithEncryptionKey - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.startWithEncryptionKey(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.startWithEncryptionKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startWithEncryptionKey(params?: any, options?: MethodOptions): - AxiosPromise; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.stop - * @desc Stops a running instance, shutting it down cleanly, and allows you to - * restart the instance at a later time. Stopped instances do not incur VM - * usage charges while they are stopped. However, resources that the VM is - * using, such as persistent disks and static IP addresses, will continue to - * be charged until they are deleted. For more information, see Stopping an - * instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to stop. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to stop. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateAccessConfig - * @desc Updates the specified access config from an instance's network - * interface with the data included in the request. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the network interface where the access config is - * attached. networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.updateAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.updateAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface where the access config is attached. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateNetworkInterface - * @desc Updates an instance's network interface. This method follows PATCH - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the network interface to update. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.updateNetworkInterface(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.updateNetworkInterface - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NetworkInterface} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateNetworkInterface(params?: any, options?: MethodOptions): - AxiosPromise; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancetemplates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceTemplates.delete - * @desc Deletes the specified instance template. Deleting an instance - * template is permanent and cannot be undone. It's not possible to delete - * templates which are in use by an instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the instance template to delete. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.get - * @desc Returns the specified instance template. Gets a list of available - * instance templates by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the instance template. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.insert - * @desc Creates an instance template in the specified project using the data - * that is included in the request. If you are creating a new template to - * update an existing instance group, your new instance template must use the - * same network or, if applicable, the same subnetwork as the original - * template. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.list - * @desc Retrieves a list of instance templates that are contained within the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceTemplates.list(request, handlePage); - * } - * }; - * - * compute.instanceTemplates.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectattachments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectAttachments.aggregatedList - * @desc Retrieves an aggregated list of interconnect attachments. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * } - * }; - * - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/aggregated/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.interconnectAttachments.delete - * @desc Deletes the specified interconnect attachment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to delete. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.get - * @desc Returns the specified interconnect attachment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to return. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.insert - * @desc Creates an InterconnectAttachment in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InterconnectAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.list - * @desc Retrieves the list of interconnect attachments contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.list(request, handlePage); - * } - * }; - * - * compute.interconnectAttachments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.patch - * @desc Updates the specified interconnect attachment with the data included - * in the request. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @alias compute.interconnectAttachments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InterconnectAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.setLabels - * @desc Sets the labels on an InterconnectAttachment. To learn more about - * labels, read the Labeling Resources documentation. - * @alias compute.interconnectAttachments.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectlocations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectLocations.get - * @desc Returns the details for the specified interconnect location. Get a - * list of available interconnect locations by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect location to return. - * interconnectLocation: 'my-interconnect-location', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectLocations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectLocations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectLocation Name of the interconnect location to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnectLocations/{interconnectLocation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnectLocation'], - pathParams: ['interconnectLocation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectLocations.list - * @desc Retrieves the list of interconnect locations available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectLocations.list(request, handlePage); - * } - * }; - * - * compute.interconnectLocations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectLocations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnectLocations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnects.delete - * @desc Deletes the specified interconnect. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to delete. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.get - * @desc Returns the specified interconnect. Get a list of available - * interconnects by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to return. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.insert - * @desc Creates a Interconnect in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.list - * @desc Retrieves the list of interconnect available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnects.list(request, handlePage); - * } - * }; - * - * compute.interconnects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.patch - * @desc Updates the specified interconnect with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to update. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.setLabels - * @desc Sets the labels on an Interconnect. To learn more about labels, read - * the Labeling Resources documentation. - * @alias compute.interconnects.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnects/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.testIamPermissions(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/interconnects/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licensecodes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenseCodes.get - * @desc Return a specified license code. License codes are mirrored across - * all projects that have permissions to read the License Code. - * @alias compute.licenseCodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.licenseCode Number corresponding to the License code resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/licenseCodes/{licenseCode}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'licenseCode'], - pathParams: ['licenseCode', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licenses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenses.delete - * @desc Deletes the specified license. - * @alias compute.licenses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the license resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.get - * @desc Returns the specified License resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the License resource to return. - * license: 'my-license', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.licenses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.licenses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the License resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.insert - * @desc Create a License resource in the specified project. - * @alias compute.licenses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().License} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.list - * @desc Retrieves the list of licenses available in the specified project. - * This method does not get any licenses that belong to other projects, - * including licenses attached to publicly-available images, like Debian 8. If - * you want to get a list of publicly-available licenses, use this method to - * make a request to the respective image project, such as debian-cloud or - * windows-cloud. - * @alias compute.licenses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Machinetypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.machineTypes.aggregatedList - * @desc Retrieves an aggregated list of machine types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.machineTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.get - * @desc Returns the specified machine type. Gets a list of available machine - * types by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the machine type to return. - * machineType: 'my-machine-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.machineTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.machineType Name of the machine type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/machineTypes/{machineType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'machineType'], - pathParams: ['machineType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.list - * @desc Retrieves a list of machine types available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.list(request, handlePage); - * } - * }; - * - * compute.machineTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Networks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.networks.addPeering - * @desc Adds a peering to the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network resource to add peering to. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.addPeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.addPeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to add peering to. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksAddPeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addPeering(params?: any, options?: MethodOptions): - AxiosPromise; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}/addPeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.delete - * @desc Deletes the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to delete. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.get - * @desc Returns the specified network. Get a list of available networks by - * making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to return. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.insert - * @desc Creates a network in the specified project using the data included in - * the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.list - * @desc Retrieves the list of networks available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.networks.list(request, handlePage); - * } - * }; - * - * compute.networks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.patch - * @desc Patches the specified network with the data included in the request. - * Only the following fields can be modified: routingConfig.routingMode. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to update. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.removePeering - * @desc Removes a peering from the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network resource to remove peering from. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.removePeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.removePeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to remove peering from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksRemovePeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removePeering(params?: any, options?: MethodOptions): - AxiosPromise; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}/removePeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.switchToCustomMode - * @desc Switches the network mode from auto subnet mode to custom subnet - * mode. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to be updated. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.switchToCustomMode(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.switchToCustomMode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to be updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - switchToCustomMode(params?: any, options?: MethodOptions): - AxiosPromise; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/networks/{network}/switchToCustomMode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/networks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.projects.disableXpnHost - * @desc Disable this project as a shared VPC host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.disableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/disableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.disableXpnResource - * @desc Disable a serivce resource (a.k.a service project) associated with - * this host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.disableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/disableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnHost - * @desc Enable this project as a shared VPC host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.enableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/enableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnResource - * @desc Enable service resource (a.k.a service project) for a host project, - * so that subnets in the host project can be used by instances in the service - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.enableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/beta/projects/{project}/enableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.get - * @desc Returns the specified Project resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnHost - * @desc Gets the shared VPC host project that this project links to. May be - * empty if no link exists. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.getXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.getXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/getXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnResources - * @desc Gets service resources (a.k.a service project) associated with this - * host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.getXpnResources(request, handlePage); - * } - * }; - * - * compute.projects.getXpnResources(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.getXpnResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnResources(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/getXpnResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.listXpnHosts - * @desc Lists all shared VPC host projects visible to the user in an - * organization. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.listXpnHosts(request, handlePage); - * } - * }; - * - * compute.projects.listXpnHosts(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.listXpnHosts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {().ProjectsListXpnHostsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listXpnHosts(params?: any, options?: MethodOptions): - AxiosPromise; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/listXpnHosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveDisk - * @desc Moves a persistent disk from one zone to another. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.moveDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DiskMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveDisk(params?: any, options?: MethodOptions): - AxiosPromise; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/moveDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveInstance - * @desc Moves an instance and its attached persistent disks from one zone to - * another. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.moveInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveInstance(params?: any, options?: MethodOptions): - AxiosPromise; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/moveInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setCommonInstanceMetadata - * @desc Sets metadata common to all instances within the specified project - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.setCommonInstanceMetadata(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.setCommonInstanceMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setCommonInstanceMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/setCommonInstanceMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setDefaultNetworkTier - * @desc Sets the default network tier of the project. The default network - * tier is used when an address/forwardingRule/instance is created without - * specifying the network tier field. - * @alias compute.projects.setDefaultNetworkTier - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsSetDefaultNetworkTierRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDefaultNetworkTier(params?: any, options?: MethodOptions): - AxiosPromise; - setDefaultNetworkTier( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDefaultNetworkTier( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/setDefaultNetworkTier') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setUsageExportBucket - * @desc Enables the usage export feature and sets the usage export bucket - * where reports are stored. If you provide an empty request body using this - * method, the usage export feature will be disabled. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.setUsageExportBucket(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.setUsageExportBucket - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UsageExportLocation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUsageExportBucket(params?: any, options?: MethodOptions): - AxiosPromise; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/setUsageExportBucket') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionautoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionAutoscalers.delete - * @desc Deletes the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.get - * @desc Returns the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified - * region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionAutoscalers.list(request, handlePage); - * } - * }; - * - * compute.regionAutoscalers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionbackendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionBackendServices.delete - * @desc Deletes the specified regional BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.get - * @desc Returns the specified regional BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.getHealth - * @desc Gets the most recent health check results for this regional - * BackendService. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance - * belongs. backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.getHealth(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource for which to get health. - * @param {string} params.project - * @param {string} params.region Name of the region scoping this request. - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.insert - * @desc Creates a regional BackendService resource in the specified project - * using the data included in the request. There are several restrictions and - * guidelines to keep in mind when creating a regional backend service. Read - * Restrictions and Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.list - * @desc Retrieves the list of regional BackendService resources available to - * the specified project in the given region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionBackendServices.list(request, handlePage); - * } - * }; - * - * compute.regionBackendServices.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.patch - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.update - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioncommitments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionCommitments.aggregatedList - * @desc Retrieves an aggregated list of commitments. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.aggregatedList(request, handlePage); - * } - * }; - * - * compute.regionCommitments.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.get - * @desc Returns the specified commitment resource. Get a list of available - * commitments by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the commitment to return. - * commitment: 'my-commitment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionCommitments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commitment Name of the commitment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/commitments/{commitment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'commitment'], - pathParams: ['commitment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.insert - * @desc Creates a commitment in the specified project using the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionCommitments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Commitment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.list - * @desc Retrieves a list of commitments contained within the specified - * region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.list(request, handlePage); - * } - * }; - * - * compute.regionCommitments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regiondisks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionDisks.createSnapshot - * @desc Creates a snapshot of this regional disk. - * @alias compute.regionDisks.createSnapshot - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to snapshot. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Snapshot} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSnapshot(params?: any, options?: MethodOptions): - AxiosPromise; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{disk}/createSnapshot') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.delete - * @desc Deletes the specified regional persistent disk. Deleting a regional - * disk removes all the replicas of its data permanently and is irreversible. - * However, deleting a disk does not delete any snapshots previously made from - * the disk. You must separately delete snapshots. - * @alias compute.regionDisks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.get - * @desc Returns a specified regional persistent disk. - * @alias compute.regionDisks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.insert - * @desc Creates a persistent regional disk in the specified project using the - * data included in the request. - * @alias compute.regionDisks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. - * @param {().Disk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.list - * @desc Retrieves the list of persistent disks contained within the specified - * region. - * @alias compute.regionDisks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.resize - * @desc Resizes the specified regional persistent disk. - * @alias compute.regionDisks.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the regional persistent disk. - * @param {string} params.project The project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionDisksResizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{disk}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'disk'], - pathParams: ['disk', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.setLabels - * @desc Sets the labels on the target regional disk. - * @alias compute.regionDisks.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDisks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.regionDisks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regiondisktypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionDiskTypes.get - * @desc Returns the specified regional disk type. Get a list of available - * disk types by making a list() request. - * @alias compute.regionDiskTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.diskType Name of the disk type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/diskTypes/{diskType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'diskType'], - pathParams: ['diskType', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionDiskTypes.list - * @desc Retrieves a list of regional disk types available to the specified - * project. - * @alias compute.regionDiskTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.abandonInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.delete(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.deleteInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to return. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A regional managed instance group can contain up to 2000 - * instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.insert(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.list - * @desc Retrieves the list of managed instance groups that are contained - * within the specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.list(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroupManagers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.listManagedInstances - * @desc Lists the instances in the managed instance group and instances that - * are scheduled to be created. The list includes any current actions that the - * group has scheduled for its instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedInstancesPage = response['managedInstances']; - * if (!managedInstancesPage) { - * return; - * } - * for (var i = 0; i < managedInstancesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `managedInstancesPage`: console.log(JSON.stringify(managedInstancesPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.listManagedInstances(request, - * handlePage); - * } - * }; - * - * compute.regionInstanceGroupManagers.listManagedInstances(request, - * handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$RegionInstanceGroupManagersListInstancesResponse>(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.patch - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * patched even if the instances in the group are still in the process of - * being patched. You must separately verify the status of the individual - * instances with the listmanagedinstances method. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.patch(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.recreateInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.resize - * @desc Changes the intended size for the managed instance group. If you - * increase the size, the group schedules actions to create new instances - * using the current instance template. If you decrease the size, the group - * schedules delete actions on one or more instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * // Number of instances that should exist in this instance group - * manager. size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.resize(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size Number of instances that should exist in this instance group manager. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setAutoHealingPolicies - * @desc Modifies the autohealing policy for the instances in this managed - * instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setAutoHealingPolicies(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetAutoHealingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAutoHealingPolicies(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoHealingPolicies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setInstanceTemplate - * @desc Sets the instance template to use when creating new instances or - * recreating instances in this group. Existing instances are not affected. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setInstanceTemplate(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all new instances in this group - * are assigned. Existing instances in the group are not affected. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setTargetPools(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.testIamPermissions(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.update - * @desc Updates a managed instance group using the information that you - * specify in the request. This operation is marked as DONE when the group is - * updated even if the instances in the group have not yet been updated. You - * must separately verify the status of the individual instances with the - * listmanagedinstances method. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the instance group manager. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroups.get - * @desc Returns the specified instance group resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the instance group resource to return. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup Name of the instance group resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.list - * @desc Retrieves the list of instance group resources contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.list(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.listInstances - * @desc Lists the instances in the specified instance group and displays - * information about the named ports. Depending on the specified options, this - * method can list all instances or only the instances that are running. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the regional instance group for which we want to list the - * instances. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.listInstances(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroups.setNamedPorts - * @desc Sets the named ports for the specified regional instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the regional instance group where the named ports are - * updated. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.setNamedPorts(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionOperations.delete - * @desc Deletes the specified region-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.get - * @desc Retrieves the specified region-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionOperations.list(request, handlePage); - * } - * }; - * - * compute.regionOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regions { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regions.get - * @desc Returns the specified Region resource. Get a list of available - * regions by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region resource to return. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/regions/{region}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regions.list - * @desc Retrieves the list of region resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regions.list(request, handlePage); - * } - * }; - * - * compute.regions.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/regions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routers.aggregatedList - * @desc Retrieves an aggregated list of routers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.routers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.delete - * @desc Deletes the specified Router resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to delete. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.get - * @desc Returns the specified Router resource. Get a list of available - * routers by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to return. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.getRouterStatus - * @desc Retrieves runtime information of the specified router. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.getRouterStatus(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.getRouterStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRouterStatus(params?: any, options?: MethodOptions): - AxiosPromise; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.insert - * @desc Creates a Router resource in the specified project and region using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.list - * @desc Retrieves a list of Router resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.list(request, handlePage); - * } - * }; - * - * compute.routers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.patch - * @desc Patches the specified Router resource with the data included in the - * request. This method supports PATCH semantics and uses JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to patch. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to patch. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.preview - * @desc Preview fields auto-generated during router create and update - * operations. Calling this method does NOT create or update the router. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.preview(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.preview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - preview(params?: any, options?: MethodOptions): - AxiosPromise; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}/preview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.update - * @desc Updates the specified Router resource with the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to update. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to update. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routes.delete - * @desc Deletes the specified Route resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Route resource to delete. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.route Name of the Route resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.get - * @desc Returns the specified Route resource. Get a list of available routes - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Route resource to return. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.route Name of the Route resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.insert - * @desc Creates a Route resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routes.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Route} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.list - * @desc Retrieves the list of Route resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routes.list(request, handlePage); - * } - * }; - * - * compute.routes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routes.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/routes/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Securitypolicies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.securityPolicies.addRule - * @desc Inserts a rule into a security policy. - * @alias compute.securityPolicies.addRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {().SecurityPolicyRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addRule(params?: any, options?: MethodOptions): - AxiosPromise; - addRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/addRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.delete - * @desc Deletes the specified policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the security policy to delete. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.securityPolicies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.securityPolicy Name of the security policy to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.get - * @desc List all of the ordered rules present in a single specified policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the security policy to get. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.securityPolicies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.getRule - * @desc Gets a rule at the specified priority. - * @alias compute.securityPolicies.getRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to get from the security policy. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to which the queried rule belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRule(params?: any, options?: MethodOptions): - AxiosPromise; - getRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/getRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.insert - * @desc Creates a new policy in the specified project using the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.securityPolicies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SecurityPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.list - * @desc List all the policies that have been configured for the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.securityPolicies.list(request, handlePage); - * } - * }; - * - * compute.securityPolicies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.patch - * @desc Patches the specified policy with the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the security policy to update. - * securityPolicy: 'my-security-policy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.securityPolicies.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {().SecurityPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.patchRule - * @desc Patches a rule at the specified priority. - * @alias compute.securityPolicies.patchRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {().SecurityPolicyRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patchRule(params?: any, options?: MethodOptions): - AxiosPromise; - patchRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patchRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/patchRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.removeRule - * @desc Deletes a rule at the specified priority. - * @alias compute.securityPolicies.removeRule - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.priority The priority of the rule to remove from the security policy. - * @param {string} params.project Project ID for this request. - * @param {string} params.securityPolicy Name of the security policy to update. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeRule(params?: any, options?: MethodOptions): - AxiosPromise; - removeRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeRule( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/removeRule') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'securityPolicy'], - pathParams: ['project', 'securityPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.securityPolicies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.securityPolicies.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.securityPolicies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/securityPolicies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Snapshots { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.snapshots.delete - * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a - * single snapshot might not necessarily delete all the data on that snapshot. - * If any data on the snapshot that is marked for deletion is needed for - * subsequent snapshots, the data will be moved to the next corresponding - * snapshot. For more information, see Deleting snaphots. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Snapshot resource to delete. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.snapshot Name of the Snapshot resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.get - * @desc Returns the specified Snapshot resource. Get a list of available - * snapshots by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Snapshot resource to return. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.snapshot Name of the Snapshot resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.list - * @desc Retrieves the list of Snapshot resources contained within the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.snapshots.list(request, handlePage); - * } - * }; - * - * compute.snapshots.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.setLabels - * @desc Sets the labels on a snapshot. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.snapshots.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/snapshots/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.snapshots.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/snapshots/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslcertificates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslCertificates.delete - * @desc Deletes the specified SslCertificate resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the SslCertificate resource to delete. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.get - * @desc Returns the specified SslCertificate resource. Get a list of - * available SSL certificates by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the SslCertificate resource to return. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslCertificate Name of the SslCertificate resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.insert - * @desc Creates a SslCertificate resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.sslCertificates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.list - * @desc Retrieves the list of SslCertificate resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.sslCertificates.list(request, handlePage); - * } - * }; - * - * compute.sslCertificates.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.sslCertificates.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslCertificates/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslpolicies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslPolicies.delete - * @desc Deletes the specified SSL policy. The SSL policy resource can be - * deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy - * resources. - * @alias compute.sslPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.get - * @desc Lists all of the ordered rules present in a single specified policy. - * @alias compute.sslPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.insert - * @desc Returns the specified SSL policy resource. Get a list of available - * SSL policies by making a list() request. - * @alias compute.sslPolicies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.list - * @desc Lists all the SSL policies that have been configured for the - * specified project. - * @alias compute.sslPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.listAvailableFeatures - * @desc Lists all features that can be specified in the SSL policy when using - * custom profile. - * @alias compute.sslPolicies.listAvailableFeatures - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableFeatures(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): void; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies/listAvailableFeatures') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.sslPolicies.patch - * @desc Patches the specified SSL policy with the data included in the - * request. - * @alias compute.sslPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.sslPolicies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/sslPolicies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subnetworks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.subnetworks.aggregatedList - * @desc Retrieves an aggregated list of subnetworks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.aggregatedList(request, handlePage); - * } - * }; - * - * compute.subnetworks.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.delete - * @desc Deletes the specified subnetwork. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to delete. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.expandIpCidrRange - * @desc Expands the IP CIDR range of the subnetwork to a specified value. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to update. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.expandIpCidrRange(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.expandIpCidrRange - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to update. - * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - expandIpCidrRange(params?: any, options?: MethodOptions): - AxiosPromise; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.get - * @desc Returns the specified subnetwork. Get a list of available subnetworks - * list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to return. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.subnetwork Name of the Subnetwork resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.insert - * @desc Creates a subnetwork in the specified project using the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.list - * @desc Retrieves a list of subnetworks available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.list(request, handlePage); - * } - * }; - * - * compute.subnetworks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.listUsable - * @desc Retrieves an aggregated list of usable subnetworks. - * @alias compute.subnetworks.listUsable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listUsable(params?: any, options?: MethodOptions): - AxiosPromise; - listUsable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listUsable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/aggregated/subnetworks/listUsable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.subnetworks.patch - * @desc Patches the specified subnetwork with the data included in the - * request. Only the following fields within the subnetwork resource can be - * specified in the request: secondary_ip_range, - * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify - * the current fingeprint of the subnetwork resource being patched. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to patch. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to patch. - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.setPrivateIpGoogleAccess - * @desc Set whether VMs in this subnet can access Google services without - * assigning external IP addresses through Private Google Access. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.setPrivateIpGoogleAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource. - * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): - AxiosPromise; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpProxies.delete - * @desc Deletes the specified TargetHttpProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy resource to delete. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.get - * @desc Returns the specified TargetHttpProxy resource. Get a list of - * available target HTTP proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy resource to return. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.insert - * @desc Creates a TargetHttpProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.list - * @desc Retrieves the list of TargetHttpProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpProxies.list(request, handlePage); - * } - * }; - * - * compute.targetHttpProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.setUrlMap - * @desc Changes the URL map for TargetHttpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy to set a URL map for. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpsproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpsProxies.delete - * @desc Deletes the specified TargetHttpsProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to delete. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.get - * @desc Returns the specified TargetHttpsProxy resource. Get a list of - * available target HTTPS proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to return. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.insert - * @desc Creates a TargetHttpsProxy resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpsProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.list - * @desc Retrieves the list of TargetHttpsProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpsProxies.list(request, handlePage); - * } - * }; - * - * compute.targetHttpsProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setQuicOverride - * @desc Sets the QUIC override policy for TargetHttpsProxy. - * @alias compute.targetHttpsProxies.setQuicOverride - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. - * @param {().TargetHttpsProxiesSetQuicOverrideRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setQuicOverride(params?: any, options?: MethodOptions): - AxiosPromise; - setQuicOverride( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setQuicOverride( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslCertificates - * @desc Replaces SslCertificates for TargetHttpsProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to set an SslCertificates - * resource for. targetHttpsProxy: 'my-target-https-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setSslCertificates(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslPolicy - * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies - * the server-side support for SSL features. This affects connections between - * clients and the HTTPS proxy load balancer. They do not affect the - * connection between the load balancer and the backends. - * @alias compute.targetHttpsProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setUrlMap - * @desc Changes the URL map for TargetHttpsProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource whose URL map is to be set. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetHttpsProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetinstances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetInstances.aggregatedList - * @desc Retrieves an aggregated list of target instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetInstances.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.delete - * @desc Deletes the specified TargetInstance resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the TargetInstance resource to delete. - * targetInstance: 'my-target-instance', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetInstance Name of the TargetInstance resource to delete. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.get - * @desc Returns the specified TargetInstance resource. Get a list of - * available target instances by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the TargetInstance resource to return. - * targetInstance: 'my-target-instance', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetInstance Name of the TargetInstance resource to return. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.insert - * @desc Creates a TargetInstance resource in the specified project and zone - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetInstances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone scoping this request. - * @param {().TargetInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.list - * @desc Retrieves a list of TargetInstance resources available to the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.list(request, handlePage); - * } - * }; - * - * compute.targetInstances.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetInstances.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetpools { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetPools.addHealthCheck - * @desc Adds health check URLs to a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target pool to add a health check to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.addHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to add a health check to. - * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.addInstance - * @desc Adds an instance to a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to add instances to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.addInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to add instances to. - * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstance(params?: any, options?: MethodOptions): - AxiosPromise; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.aggregatedList - * @desc Retrieves an aggregated list of target pools. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetPools.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.delete - * @desc Deletes the specified target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to delete. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.get - * @desc Returns the specified target pool. Get a list of available target - * pools by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to return. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.getHealth - * @desc Gets the most recent health check results for each IP for the - * instance that is referenced by the given target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to which the queried instance - * belongs. targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. - * @param {().InstanceReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.insert - * @desc Creates a target pool in the specified project and region using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetPool} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.list - * @desc Retrieves a list of target pools available to the specified project - * and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.list(request, handlePage); - * } - * }; - * - * compute.targetPools.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeHealthCheck - * @desc Removes health check URL from a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target pool to remove health checks from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.removeHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to remove health checks from. - * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeInstance - * @desc Removes instance URL from a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to remove instances from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.removeInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. - * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstance(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.setBackup - * @desc Changes a backup target pool's configurations. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to set a backup pool for. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.setBackup(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.setBackup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {number=} params.failoverRatio New failoverRatio value for the target pool. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackup(params?: any, options?: MethodOptions): - AxiosPromise; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetPools/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetsslproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetSslProxies.delete - * @desc Deletes the specified TargetSslProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource to delete. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.get - * @desc Returns the specified TargetSslProxy resource. Get a list of - * available target SSL proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource to return. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.insert - * @desc Creates a TargetSslProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetSslProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.list - * @desc Retrieves the list of TargetSslProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetSslProxies.list(request, handlePage); - * } - * }; - * - * compute.targetSslProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setBackendService - * @desc Changes the BackendService for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose BackendService resource is - * to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setBackendService(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. - * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setProxyHeader(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslCertificates - * @desc Changes SslCertificates for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose SslCertificate resource is - * to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setSslCertificates(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslPolicy - * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the - * server-side support for SSL features. This affects connections between - * clients and the SSL proxy load balancer. They do not affect the connection - * between the load balancer and the backends. - * @alias compute.targetSslProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetSslProxies/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targettcpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetTcpProxies.delete - * @desc Deletes the specified TargetTcpProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource to delete. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.get - * @desc Returns the specified TargetTcpProxy resource. Get a list of - * available target TCP proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource to return. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.insert - * @desc Creates a TargetTcpProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetTcpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.list - * @desc Retrieves the list of TargetTcpProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetTcpProxies.list(request, handlePage); - * } - * }; - * - * compute.targetTcpProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setBackendService - * @desc Changes the BackendService for TargetTcpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource whose BackendService resource is - * to be set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setBackendService(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. - * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetTcpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setProxyHeader(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetvpngateways { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetVpnGateways.aggregatedList - * @desc Retrieves an aggregated list of target VPN gateways. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/aggregated/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.targetVpnGateways.delete - * @desc Deletes the specified target VPN gateway. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target VPN gateway to delete. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.get - * @desc Returns the specified target VPN gateway. Get a list of available - * target VPN gateways by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target VPN gateway to return. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.insert - * @desc Creates a target VPN gateway in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetVpnGateway} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.list - * @desc Retrieves a list of target VPN gateways available to the specified - * project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.list(request, handlePage); - * } - * }; - * - * compute.targetVpnGateways.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.setLabels - * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, - * read the Labeling Resources documentation. - * @alias compute.targetVpnGateways.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Urlmaps { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.urlMaps.delete - * @desc Deletes the specified UrlMap resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to delete. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.get - * @desc Returns the specified UrlMap resource. Get a list of available URL - * maps by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to return. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.insert - * @desc Creates a UrlMap resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.invalidateCache - * @desc Initiates a cache invalidation operation, invalidating the specified - * path, scoped to the specified UrlMap. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap scoping this request. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.invalidateCache(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.invalidateCache - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap scoping this request. - * @param {().CacheInvalidationRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - invalidateCache(params?: any, options?: MethodOptions): - AxiosPromise; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.list - * @desc Retrieves the list of UrlMap resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.urlMaps.list(request, handlePage); - * } - * }; - * - * compute.urlMaps.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.patch - * @desc Patches the specified UrlMap resource with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to patch. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to patch. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.update - * @desc Updates the specified UrlMap resource with the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to update. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to update. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.validate - * @desc Runs static validation for the UrlMap. In particular, the tests of - * the provided UrlMap will be run. Calling this method does NOT create the - * UrlMap. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to be validated as. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.validate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.validate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to be validated as. - * @param {().UrlMapsValidateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - validate(params?: any, options?: MethodOptions): - AxiosPromise; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/validate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Vpntunnels { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.vpnTunnels.aggregatedList - * @desc Retrieves an aggregated list of VPN tunnels. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.aggregatedList(request, handlePage); - * } - * }; - * - * compute.vpnTunnels.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/aggregated/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.delete - * @desc Deletes the specified VpnTunnel resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the VpnTunnel resource to delete. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.get - * @desc Returns the specified VpnTunnel resource. Get a list of available VPN - * tunnels by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the VpnTunnel resource to return. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.insert - * @desc Creates a VpnTunnel resource in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().VpnTunnel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.list - * @desc Retrieves a list of VpnTunnel resources contained in the specified - * project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.list(request, handlePage); - * } - * }; - * - * compute.vpnTunnels.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object +// tslint:disable: no-namespace + +export namespace compute_beta { + /** + * Compute Engine API + * + * Creates and runs virtual machines on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const compute = google.compute('beta'); + * + * @namespace compute + * @type {Function} + * @version beta + * @variation beta + * @param {object=} options Options for Compute + */ + export class Compute { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + acceleratorTypes: Resource$Acceleratortypes; + addresses: Resource$Addresses; + autoscalers: Resource$Autoscalers; + backendBuckets: Resource$Backendbuckets; + backendServices: Resource$Backendservices; + disks: Resource$Disks; + diskTypes: Resource$Disktypes; + firewalls: Resource$Firewalls; + forwardingRules: Resource$Forwardingrules; + globalAddresses: Resource$Globaladdresses; + globalForwardingRules: Resource$Globalforwardingrules; + globalOperations: Resource$Globaloperations; + healthChecks: Resource$Healthchecks; + httpHealthChecks: Resource$Httphealthchecks; + httpsHealthChecks: Resource$Httpshealthchecks; + images: Resource$Images; + instanceGroupManagers: Resource$Instancegroupmanagers; + instanceGroups: Resource$Instancegroups; + instances: Resource$Instances; + instanceTemplates: Resource$Instancetemplates; + interconnectAttachments: Resource$Interconnectattachments; + interconnectLocations: Resource$Interconnectlocations; + interconnects: Resource$Interconnects; + licenseCodes: Resource$Licensecodes; + licenses: Resource$Licenses; + machineTypes: Resource$Machinetypes; + networks: Resource$Networks; + projects: Resource$Projects; + regionAutoscalers: Resource$Regionautoscalers; + regionBackendServices: Resource$Regionbackendservices; + regionCommitments: Resource$Regioncommitments; + regionDisks: Resource$Regiondisks; + regionDiskTypes: Resource$Regiondisktypes; + regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; + regionInstanceGroups: Resource$Regioninstancegroups; + regionOperations: Resource$Regionoperations; + regions: Resource$Regions; + routers: Resource$Routers; + routes: Resource$Routes; + securityPolicies: Resource$Securitypolicies; + snapshots: Resource$Snapshots; + sslCertificates: Resource$Sslcertificates; + sslPolicies: Resource$Sslpolicies; + subnetworks: Resource$Subnetworks; + targetHttpProxies: Resource$Targethttpproxies; + targetHttpsProxies: Resource$Targethttpsproxies; + targetInstances: Resource$Targetinstances; + targetPools: Resource$Targetpools; + targetSslProxies: Resource$Targetsslproxies; + targetTcpProxies: Resource$Targettcpproxies; + targetVpnGateways: Resource$Targetvpngateways; + urlMaps: Resource$Urlmaps; + vpnTunnels: Resource$Vpntunnels; + zoneOperations: Resource$Zoneoperations; + zones: Resource$Zones; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.acceleratorTypes = new Resource$Acceleratortypes(this); + this.addresses = new Resource$Addresses(this); + this.autoscalers = new Resource$Autoscalers(this); + this.backendBuckets = new Resource$Backendbuckets(this); + this.backendServices = new Resource$Backendservices(this); + this.disks = new Resource$Disks(this); + this.diskTypes = new Resource$Disktypes(this); + this.firewalls = new Resource$Firewalls(this); + this.forwardingRules = new Resource$Forwardingrules(this); + this.globalAddresses = new Resource$Globaladdresses(this); + this.globalForwardingRules = new Resource$Globalforwardingrules(this); + this.globalOperations = new Resource$Globaloperations(this); + this.healthChecks = new Resource$Healthchecks(this); + this.httpHealthChecks = new Resource$Httphealthchecks(this); + this.httpsHealthChecks = new Resource$Httpshealthchecks(this); + this.images = new Resource$Images(this); + this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); + this.instanceGroups = new Resource$Instancegroups(this); + this.instances = new Resource$Instances(this); + this.instanceTemplates = new Resource$Instancetemplates(this); + this.interconnectAttachments = new Resource$Interconnectattachments(this); + this.interconnectLocations = new Resource$Interconnectlocations(this); + this.interconnects = new Resource$Interconnects(this); + this.licenseCodes = new Resource$Licensecodes(this); + this.licenses = new Resource$Licenses(this); + this.machineTypes = new Resource$Machinetypes(this); + this.networks = new Resource$Networks(this); + this.projects = new Resource$Projects(this); + this.regionAutoscalers = new Resource$Regionautoscalers(this); + this.regionBackendServices = new Resource$Regionbackendservices(this); + this.regionCommitments = new Resource$Regioncommitments(this); + this.regionDisks = new Resource$Regiondisks(this); + this.regionDiskTypes = new Resource$Regiondisktypes(this); + this.regionInstanceGroupManagers = + new Resource$Regioninstancegroupmanagers(this); + this.regionInstanceGroups = new Resource$Regioninstancegroups(this); + this.regionOperations = new Resource$Regionoperations(this); + this.regions = new Resource$Regions(this); + this.routers = new Resource$Routers(this); + this.routes = new Resource$Routes(this); + this.securityPolicies = new Resource$Securitypolicies(this); + this.snapshots = new Resource$Snapshots(this); + this.sslCertificates = new Resource$Sslcertificates(this); + this.sslPolicies = new Resource$Sslpolicies(this); + this.subnetworks = new Resource$Subnetworks(this); + this.targetHttpProxies = new Resource$Targethttpproxies(this); + this.targetHttpsProxies = new Resource$Targethttpsproxies(this); + this.targetInstances = new Resource$Targetinstances(this); + this.targetPools = new Resource$Targetpools(this); + this.targetSslProxies = new Resource$Targetsslproxies(this); + this.targetTcpProxies = new Resource$Targettcpproxies(this); + this.targetVpnGateways = new Resource$Targetvpngateways(this); + this.urlMaps = new Resource$Urlmaps(this); + this.vpnTunnels = new Resource$Vpntunnels(this); + this.zoneOperations = new Resource$Zoneoperations(this); + this.zones = new Resource$Zones(this); + } + + getRoot() { + return this.root; + } + } + + /** + * A specification of the type and number of accelerator cards attached to the + * instance. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AcceleratorConfig { + /** + * The number of the guest accelerator cards exposed to this instance. + */ + acceleratorCount: number; + /** + * Full or partial URL of the accelerator type resource to attach to this + * instance. If you are creating an instance template, specify only the + * accelerator name. + */ + acceleratorType: string; + } + /** + * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) + * (== resource_for v1.acceleratorTypes ==) + */ + export interface Schema$AcceleratorType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this accelerator + * type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#acceleratorType + * for accelerator types. + */ + kind: string; + /** + * [Output Only] Maximum accelerator cards allowed per instance. + */ + maximumCardsPerInstance: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the accelerator type resides, + * such as us-central1-a. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + zone: string; + } + export interface Schema$AcceleratorTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of accelerator types. + */ + export interface Schema$AcceleratorTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorType resources. + */ + items: Schema$AcceleratorType[]; + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for + * lists of accelerator types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AcceleratorTypesScopedList { + /** + * [Output Only] A list of accelerator types contained in this scope. + */ + acceleratorTypes: Schema$AcceleratorType[]; + /** + * [Output Only] An informational warning that appears when the accelerator + * types list is empty. + */ + warning: any; + } + /** + * An access configuration attached to an instance's network interface. + * Only one access config per instance is supported. + */ + export interface Schema$AccessConfig { + /** + * [Output Only] Type of the resource. Always compute#accessConfig for + * access configs. + */ + kind: string; + /** + * The name of this access configuration. The default and recommended name + * is External NAT but you can use any arbitrary string you would like. For + * example, My external IP or Network Access. + */ + name: string; + /** + * An external IP address associated with this instance. Specify an unused + * static external IP address available to the project or leave this field + * undefined to use an IP from a shared ephemeral IP address pool. If you + * specify a static external IP address, it must live in the same region as + * the zone of the instance. + */ + natIP: string; + /** + * This signifies the networking tier used for configuring this access + * configuration and can only take the following values: PREMIUM, STANDARD. + * If an AccessConfig is specified without a valid external IP address, an + * ephemeral IP will be created with this networkTier. If an AccessConfig + * with a valid external IP address is specified, it must match that of the + * networkTier associated with the Address resource owning that IP. + */ + networkTier: string; + /** + * The DNS domain name for the public PTR record. This field can only be set + * when the set_public_ptr field is enabled. + */ + publicPtrDomainName: string; + /** + * Specifies whether a public DNS ?PTR? record should be created to map the + * external IP address of the instance to a DNS domain name. + */ + setPublicPtr: boolean; + /** + * The type of configuration. The default and only option is ONE_TO_ONE_NAT. + */ + type: string; + } + /** + * A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== + * resource_for v1.globalAddresses ==) + */ + export interface Schema$Address { + /** + * The static IP address represented by this resource. + */ + address: string; + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If + * unspecified, defaults to EXTERNAL. + */ + addressType: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP Version that will be used by this address. Valid options are IPV4 + * or IPV6. This can only be specified for a global address. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this Address, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an Address. + */ + labelFingerprint: string; + /** + * Labels to apply to this Address resource. These can be later modified by + * the setLabels method. Each label key/value must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * This signifies the networking tier used for configuring this Address and + * can only take the following values: PREMIUM , STANDARD. If this field is + * not specified, it is assumed to be PREMIUM. + */ + networkTier: string; + /** + * [Output Only] URL of the region where the regional address resides. This + * field is not applicable to global addresses. You must specify this field + * as part of the HTTP request URL. You cannot set this field in the request + * body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the address, which can be one of RESERVING, + * RESERVED, or IN_USE. An address that is RESERVING is currently in the + * process of being reserved. A RESERVED address is currently reserved and + * available to use. An IN_USE address is currently being used by another + * resource and is not available. + */ + status: string; + /** + * The URL of the subnetwork in which to reserve the address. If an IP + * address is specified, it must be within the subnetwork's IP range. + * This field can only be used with INTERNAL type with + * GCE_ENDPOINT/DNS_RESOLVER purposes. + */ + subnetwork: string; + /** + * [Output Only] The URLs of the resources that are using this address. + */ + users: string[]; + } + export interface Schema$AddressAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AddressesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for + * aggregated lists of addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AddressesScopedList { + /** + * [Output Only] A list of addresses contained in this scope. + */ + addresses: Schema$Address[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + /** + * Contains a list of addresses. + */ + export interface Schema$AddressList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Address resources. + */ + items: Schema$Address[]; + /** + * [Output Only] Type of resource. Always compute#addressList for lists of + * addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An alias IP range attached to an instance's network interface. + */ + export interface Schema$AliasIpRange { + /** + * The IP CIDR range represented by this alias IP range. This IP CIDR range + * must belong to the specified subnetwork and cannot contain IP addresses + * reserved by system or used by other network interfaces. This range may be + * a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR + * format string (e.g. 10.1.2.0/24). + */ + ipCidrRange: string; + /** + * Optional subnetwork secondary range name specifying the secondary range + * from which to allocate the IP CIDR range for this alias IP range. If left + * unspecified, the primary range of the subnetwork will be used. + */ + subnetworkRangeName: string; + } + /** + * An instance-attached disk resource. + */ + export interface Schema$AttachedDisk { + /** + * Specifies whether the disk will be auto-deleted when the instance is + * deleted (but not when the disk is detached from the instance). + */ + autoDelete: boolean; + /** + * Indicates that this is a boot disk. The virtual machine will use the + * first partition of the disk for its root filesystem. + */ + boot: boolean; + /** + * Specifies a unique device name of your choice that is reflected into the + * /dev/disk/by-id/google-* tree of a Linux operating system running within + * the instance. This name can be used to reference the device for mounting, + * resizing, and so on, from within the instance. If not specified, the + * server chooses a default device name to apply to this disk, in the form + * persistent-disks-x, where x is a number assigned by Google Compute + * Engine. This field is only applicable for persistent disks. + */ + deviceName: string; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If + * you are creating a new disk, this field encrypts the new disk using an + * encryption key that you provide. If you are attaching an existing disk + * that is already encrypted, this field decrypts the disk using the + * customer-supplied encryption key. If you encrypt a disk using a + * customer-supplied key, you must provide the same key again when you + * attempt to use this resource at a later time. For example, you must + * provide the key when you create a snapshot or an image from the disk or + * when you attach the disk to a virtual machine instance. If you do not + * provide an encryption key, then the disk will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the disk later. Instance templates do not store customer-supplied + * encryption keys, so you cannot use your own keys to encrypt disks in a + * managed instance group. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for + * the boot disk. If you have many disks attached to an instance, each disk + * would have a unique index number. + */ + index: number; + /** + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or + * the other, but not both. + */ + initializeParams: Schema$AttachedDiskInitializeParams; + /** + * Specifies the disk interface to use for attaching this disk, which is + * either SCSI or NVME. The default is SCSI. Persistent disks must always + * use SCSI and the request will fail if you attempt to attach a persistent + * disk in any other format than SCSI. Local SSDs can use either NVME or + * SCSI. For performance characteristics of SCSI over NVMe, see Local SSD + * performance. + */ + interface: string; + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for + * attached disks. + */ + kind: string; + /** + * [Output Only] Any valid publicly visible licenses. + */ + licenses: string[]; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If + * not specified, the default is to attach the disk in READ_WRITE mode. + */ + mode: string; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. When creating a new instance, one of + * initializeParams.sourceImage or disks.source is required except for local + * SSD. If desired, you can also attach existing non-root persistent disks + * using this property. This field is only applicable for persistent disks. + * Note that for InstanceTemplate, specify the disk name, not the URL for + * the disk. + */ + source: string; + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not + * specified, the default is PERSISTENT. + */ + type: string; } - - /** - * compute.vpnTunnels.setLabels - * @desc Sets the labels on a VpnTunnel. To learn more about labels, read the - * Labeling Resources documentation. - * @alias compute.vpnTunnels.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {().RegionSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or the + * other, but not both. */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AttachedDiskInitializeParams { + /** + * Specifies the disk name. If not specified, the default is to use the name + * of the instance. + */ + diskName: string; + /** + * Specifies the size of the disk in base-2 GB. + */ + diskSizeGb: string; + /** + * [Deprecated] Storage type of the disk. + */ + diskStorageType: string; + /** + * Specifies the disk type to use to create the instance. If not specified, + * the default is pd-standard, specified using the full URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + * Other values include pd-ssd and local-ssd. If you define this field, you + * can provide either the full or partial URL. For example, the following + * are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + * - projects/project/zones/zone/diskTypes/diskType - + * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is + * the name of the disk type, not URL. + */ + diskType: string; + /** + * Labels to apply to this disk. These can be later modified by the + * disks.setLabels method. This field is only applicable for persistent + * disks. + */ + labels: any; + /** + * The source image to create this disk. When creating a new instance, one + * of initializeParams.sourceImage or disks.source is required except for + * local SSD. To create a disk with one of the public operating system + * images, specify the image by its family name. For example, specify + * family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family If the source + * image is deleted later, this field will not be set. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. Instance + * templates do not store customer-supplied encryption keys, so you cannot + * create disks for instances in a managed instance group if the source + * images are encrypted with your own keys. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + } + /** + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { "log_type": + * "ADMIN_READ", } ] }, { "service": + * "fooservice.googleapis.com" "audit_log_configs": [ { + * "log_type": "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } ] } For fooservice, this policy + * enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts + * foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE + * logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + exemptedMembers: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } + /** + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { "log_type": + * "DATA_WRITE", } ] } This enables 'DATA_READ' and + * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ + * logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of [Binding.members][]. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } + /** + * Authorization-related information used by Cloud Audit Logging. + */ + export interface Schema$AuthorizationLoggingOptions { + /** + * The type of the permission that was checked. + */ + permissionType: string; + } + /** + * Represents an Autoscaler resource. Autoscalers allow you to automatically + * scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling + * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for + * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== + * resource_for v1.regionAutoscalers ==) + */ + export interface Schema$Autoscaler { + /** + * The configuration parameters for the autoscaling algorithm. You can + * define one or more of the policies for an autoscaler: cpuUtilization, + * customMetricUtilizations, and loadBalancingUtilization. If none of these + * are specified, the default will be to autoscale based on cpuUtilization + * to 0.6 or 60%. + */ + autoscalingPolicy: Schema$AutoscalingPolicy; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#autoscaler for + * autoscalers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the instance group resides (for + * autoscalers living in regional scope). + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the autoscaler configuration. + */ + status: string; + /** + * [Output Only] Human-readable details about the current state of the + * autoscaler. Read the documentation for Commonly returned status messages + * for examples of status messages you might encounter. + */ + statusDetails: Schema$AutoscalerStatusDetails[]; + /** + * URL of the managed instance group that this autoscaler will scale. + */ + target: string; + /** + * [Output Only] URL of the zone where the instance group resides (for + * autoscalers living in zonal scope). + */ + zone: string; + } + export interface Schema$AutoscalerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AutoscalersScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList + * for aggregated lists of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Autoscaler resources. + */ + export interface Schema$AutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists + * of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AutoscalersScopedList { + /** + * [Output Only] A list of autoscalers contained in this scope. + */ + autoscalers: Schema$Autoscaler[]; + /** + * [Output Only] Informational warning which replaces the list of + * autoscalers when the list is empty. + */ + warning: any; + } + export interface Schema$AutoscalerStatusDetails { + /** + * The status message. + */ + message: string; + /** + * The type of error returned. + */ + type: string; + } + /** + * Cloud Autoscaler policy. + */ + export interface Schema$AutoscalingPolicy { + /** + * The number of seconds that the autoscaler should wait before it starts + * collecting information from a new instance. This prevents the autoscaler + * from collecting information when the instance is initializing, during + * which the collected usage would not be reliable. The default time + * autoscaler waits is 60 seconds. Virtual machine initialization times + * might vary because of numerous factors. We recommend that you test how + * long an instance may take to initialize. To do this, create an instance + * and time the startup process. + */ + coolDownPeriodSec: number; + /** + * Defines the CPU utilization policy that allows the autoscaler to scale + * based on the average CPU utilization of a managed instance group. + */ + cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; + /** + * Configuration parameters of autoscaling based on a custom metric. + */ + customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; + /** + * Configuration parameters of autoscaling based on load balancer. + */ + loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; + /** + * The maximum number of instances that the autoscaler can scale up to. This + * is required when creating or updating an autoscaler. The maximum number + * of replicas should not be lower than minimal number of replicas. + */ + maxNumReplicas: number; + /** + * The minimum number of replicas that the autoscaler can scale down to. + * This cannot be less than 0. If not provided, autoscaler will choose a + * default value depending on maximum number of instances allowed. + */ + minNumReplicas: number; + } + /** + * CPU utilization policy. + */ + export interface Schema$AutoscalingPolicyCpuUtilization { + /** + * The target CPU utilization that the autoscaler should maintain. Must be a + * float value in the range (0, 1]. If not specified, the default is 0.6. If + * the CPU level is below the target utilization, the autoscaler scales down + * the number of instances until it reaches the minimum number of instances + * you specified or until the average CPU of your instances reaches the + * target utilization. If the average CPU is above the target utilization, + * the autoscaler scales up until it reaches the maximum number of instances + * you specified or until the average utilization reaches the target + * utilization. + */ + utilizationTarget: number; + } + /** + * Custom utilization metric policy. + */ + export interface Schema$AutoscalingPolicyCustomMetricUtilization { + /** + * A filter string, compatible with a Stackdriver Monitoring filter string + * for TimeSeries.list API call. This filter is used to select a specific + * TimeSeries for the purpose of autoscaling and to determine whether the + * metric is exporting per-instance or per-group data. For the filter to be + * valid for autoscaling purposes, the following rules apply: - You can + * only use the AND operator for joining selectors. - You can only use + * direct equality comparison operator (=) without any functions for each + * selector. - You can specify the metric in both the filter string and in + * the metric field. However, if specified in both places, the metric must + * be identical. - The monitored resource type determines what kind of + * values are expected for the metric. If it is a gce_instance, the + * autoscaler expects the metric to include a separate TimeSeries for each + * instance in a group. In such a case, you cannot filter on resource + * labels. If the resource type is any other value, the autoscaler expects + * this metric to contain values that apply to the entire autoscaled + * instance group and resource label filtering can be performed to point + * autoscaler at the correct TimeSeries to scale upon. This is called a + * per-group metric for the purpose of autoscaling. If not specified, the + * type defaults to gce_instance. You should provide a filter that is + * selective enough to pick just one TimeSeries for the autoscaled group or + * for each of the instances (if you are using gce_instance resource type). + * If multiple TimeSeries are returned upon the query execution, the + * autoscaler will sum their respective values to obtain its scaling value. + */ + filter: string; + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric + * cannot have negative values. The metric must have a value type of INT64 + * or DOUBLE. + */ + metric: string; + /** + * If scaling is based on a per-group metric value that represents the total + * amount of work to be done or resource usage, set this value to an amount + * assigned for a single instance of the scaled group. Autoscaler will keep + * the number of instances proportional to the value of this metric, the + * metric itself should not change value due to group resizing. A good + * metric to use with the target is for example + * pubsub.googleapis.com/subscription/num_undelivered_messages or a custom + * metric exporting the total number of requests coming to your instances. + * A bad example would be a metric exporting an average or median latency, + * since this value can't include a chunk assignable to a single + * instance, it could be better used with utilization_target instead. + */ + singleInstanceAssignment: number; + /** + * The target value of the metric that autoscaler should maintain. This must + * be a positive value. A utilization metric scales number of virtual + * machines handling requests to increase or decrease proportionally to the + * metric. For example, a good metric to use as a utilization_target is + * compute.googleapis.com/instance/network/received_bytes_count. The + * autoscaler will work to keep this value constant for each of the + * instances. + */ + utilizationTarget: number; + /** + * Defines how target utilization value is expressed for a Stackdriver + * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * If not specified, the default is GAUGE. + */ + utilizationTargetType: string; + } + /** + * Configuration parameters of autoscaling based on load balancing. + */ + export interface Schema$AutoscalingPolicyLoadBalancingUtilization { + /** + * Fraction of backend capacity utilization (set in HTTP(s) load balancing + * configuration) that autoscaler should maintain. Must be a positive float + * value. If not defined, the default is 0.8. + */ + utilizationTarget: number; + } + /** + * Message containing information of one individual backend. + */ + export interface Schema$Backend { + /** + * Specifies the balancing mode for this backend. For global HTTP(S) or + * TCP/SSL load balancing, the default is UTILIZATION. Valid values are + * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For + * Internal Load Balancing, the default and only supported mode is + * CONNECTION. + */ + balancingMode: string; + /** + * A multiplier applied to the group's maximum servicing capacity (based + * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the + * group will serve up to 100% of its configured capacity (depending on + * balancingMode). A setting of 0 means the group is completely drained, + * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This + * cannot be used for internal load balancing. + */ + capacityScaler: number; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The fully-qualified URL of a Instance Group resource. This instance group + * defines the list of instances that serve traffic. Member virtual machine + * instances from each instance group must live in the same zone as the + * instance group itself. No two backends in a backend service are allowed + * to use same Instance Group resource. Note that you must specify an + * Instance Group resource using the fully-qualified URL, rather than a + * partial URL. When the BackendService has load balancing scheme INTERNAL, + * the instance group must be within the same region as the BackendService. + */ + group: string; + /** + * The max number of simultaneous connections for the group. Can be used + * with either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnections: number; + /** + * The max number of simultaneous connections that a single backend instance + * can handle. This is used to calculate the capacity of the group. Can be + * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnectionsPerInstance: number; + /** + * The max requests per second (RPS) of the group. Can be used with either + * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE + * mode, either maxRate or maxRatePerInstance must be set. This cannot be + * used for internal load balancing. + */ + maxRate: number; + /** + * The max requests per second (RPS) that a single backend instance can + * handle. This is used to calculate the capacity of the group. Can be used + * in either balancing mode. For RATE mode, either maxRate or + * maxRatePerInstance must be set. This cannot be used for internal load + * balancing. + */ + maxRatePerInstance: number; + /** + * Used when balancingMode is UTILIZATION. This ratio defines the CPU + * utilization target for the group. The default is 0.8. Valid range is + * [0.0, 1.0]. This cannot be used for internal load balancing. + */ + maxUtilization: number; + } + /** + * A BackendBucket resource. This resource defines a Cloud Storage bucket. + */ + export interface Schema$BackendBucket { + /** + * Cloud Storage bucket name. + */ + bucketName: string; + /** + * Cloud CDN Coniguration for this BackendBucket. + */ + cdnPolicy: Schema$BackendBucketCdnPolicy; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendBucket. + */ + enableCdn: boolean; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Message containing Cloud CDN configuration for a backend bucket. + */ + export interface Schema$BackendBucketCdnPolicy { + /** + * Number of seconds up to which the response to a signed URL request will + * be cached in the CDN. After this time period, the Signed URL will be + * revalidated before being served. Defaults to 1hr (3600s). If this field + * is set, Cloud CDN will internally act as though all responses from this + * bucket had a ?Cache-Control: public, max-age=[TTL]? header, regardless of + * any existing Cache-Control header. The actual headers served in responses + * will not be altered. + */ + signedUrlCacheMaxAgeSec: string; + /** + * [Output Only] Names of the keys currently configured for Cloud CDN Signed + * URL on this backend bucket. + */ + signedUrlKeyNames: string[]; + } + /** + * Contains a list of BackendBucket resources. + */ + export interface Schema$BackendBucketList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendBucket resources. + */ + items: Schema$BackendBucket[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A BackendService resource. This resource defines a group of backend virtual + * machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) + */ + export interface Schema$BackendService { + /** + * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. + * If set to 0, the cookie is non-persistent and lasts only until the end of + * the browser session (or equivalent). The maximum allowed value for TTL is + * one day. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + affinityCookieTtlSec: number; + /** + * The list of backends that serve this BackendService. + */ + backends: Schema$Backend[]; + /** + * Cloud CDN configuration for this BackendService. + */ + cdnPolicy: Schema$BackendServiceCdnPolicy; + connectionDraining: Schema$ConnectionDraining; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Headers that the HTTP/S load balancer should add to proxied requests. + */ + customRequestHeaders: string[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendService. When the load + * balancing scheme is INTERNAL, this field is not used. + */ + enableCDN: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a BackendService. An up-to-date fingerprint must + * be provided in order to update the BackendService. + */ + fingerprint: string; + /** + * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for + * health checking this BackendService. Currently at most one health check + * can be specified, and a health check is required for Compute Engine + * backend services. A health check must not be specified for App Engine + * backend and Cloud Function backend. For internal load balancing, a URL + * to a HealthCheck resource must be specified instead. + */ + healthChecks: string[]; + iap: Schema$BackendServiceIAP; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#backendService for backend + * services. + */ + kind: string; + /** + * Indicates whether the backend service will be used with internal or + * external load balancing. A backend service created for one type of load + * balancing cannot be used with the other. Possible values are INTERNAL and + * EXTERNAL. + */ + loadBalancingScheme: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. + * The default value is 80. This cannot be used for internal load + * balancing. + */ + port: number; + /** + * Name of backend port. The same name should appear in the instance groups + * referenced by this service. Required when the load balancing scheme is + * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + portName: string; + /** + * The protocol this BackendService uses to communicate with backends. + * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For + * internal load balancing, the possible values are TCP and UDP, and the + * default is TCP. + */ + protocol: string; + /** + * [Output Only] URL of the region where the regional backend service + * resides. This field is not applicable to global backend services. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] The resource URL for the security policy associated with + * this backend service. + */ + securityPolicy: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Type of session affinity to use. The default is NONE. When the load + * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or + * GENERATED_COOKIE. When the load balancing scheme is INTERNAL, can be + * NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the + * protocol is UDP, this field is not used. + */ + sessionAffinity: string; + /** + * How many seconds to wait for the backend before considering it a failed + * request. Default is 30 seconds. + */ + timeoutSec: number; + } + /** + * Contains a list of BackendServicesScopedList. + */ + export interface Schema$BackendServiceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendServicesScopedList resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Message containing Cloud CDN configuration for a backend service. + */ + export interface Schema$BackendServiceCdnPolicy { + /** + * The CacheKeyPolicy for this CdnPolicy. + */ + cacheKeyPolicy: Schema$CacheKeyPolicy; + /** + * Number of seconds up to which the response to a signed URL request will + * be cached in the CDN. After this time period, the Signed URL will be + * revalidated before being served. Defaults to 1hr (3600s). If this field + * is set, Cloud CDN will internally act as though all responses from this + * backend had a ?Cache-Control: public, max-age=[TTL]? header, regardless + * of any existing Cache-Control header. The actual headers served in + * responses will not be altered. + */ + signedUrlCacheMaxAgeSec: string; + /** + * [Output Only] Names of the keys currently configured for Cloud CDN Signed + * URL on this backend service. + */ + signedUrlKeyNames: string[]; + } + export interface Schema$BackendServiceGroupHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth + * for the health of backend services. + */ + kind: string; + } + /** + * Identity-Aware Proxy + */ + export interface Schema$BackendServiceIAP { + enabled: boolean; + oauth2ClientId: string; + oauth2ClientSecret: string; + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + */ + oauth2ClientSecretSha256: string; + } + /** + * Contains a list of BackendService resources. + */ + export interface Schema$BackendServiceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendService resources. + */ + items: Schema$BackendService[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceList for + * lists of backend services. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$BackendServicesScopedList { + /** + * A list of BackendServices contained in this scope. + */ + backendServices: Schema$BackendService[]; + /** + * Informational warning which replaces the list of backend services when + * the list is empty. + */ + warning: any; + } + /** + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied + * condition will not allow user access via current binding. Different + * bindings, including their conditions, are examined independently. This + * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. + */ + condition: Schema$Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or without + * a Google account. * `allAuthenticatedUsers`: A special identifier that + * represents anyone who is authenticated with a Google account or a service + * account. * `user:{emailid}`: An email address that represents a specific + * Google account. For example, `alice@gmail.com` or `joe@example.com`. * + * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. + */ + role: string; + } + export interface Schema$CacheInvalidationRule { + /** + * If set, this invalidation rule will only apply to requests with a Host + * header matching host. + */ + host: string; + path: string; + } + /** + * Message containing what to include in the cache key for a request for Cloud + * CDN. + */ + export interface Schema$CacheKeyPolicy { + /** + * If true, requests to different hosts will be cached separately. + */ + includeHost: boolean; + /** + * If true, http and https requests will be cached separately. + */ + includeProtocol: boolean; + /** + * If true, include query string parameters in the cache key according to + * query_string_whitelist and query_string_blacklist. If neither is set, the + * entire query string will be included. If false, the query string will be + * excluded from the cache key entirely. + */ + includeQueryString: boolean; + /** + * Names of query string parameters to exclude in cache keys. All other + * parameters will be included. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringBlacklist: string[]; + /** + * Names of query string parameters to include in cache keys. All other + * parameters will be excluded. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringWhitelist: string[]; + } + /** + * Represents a Commitment resource. Creating a Commitment resource means that + * you are purchasing a committed use contract with an explicit start and end + * time. You can create commitments based on vCPUs and memory usage and + * receive discounted rates. For full details, read Signing Up for Committed + * Use Discounts. Committed use discounts are subject to Google Cloud + * Platform's Service Specific Terms. By purchasing a committed use + * discount, you agree to these terms. Committed use discounts will not renew, + * so you must purchase a new commitment to continue receiving discounts. (== + * resource_for beta.commitments ==) (== resource_for v1.commitments ==) + */ + export interface Schema$Commitment { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Commitment end time in RFC3339 text format. + */ + endTimestamp: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#commitment for + * commitments. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The plan for this commitment, which determines duration and discount + * rate. The currently supported plans are TWELVE_MONTH (1 year), and + * THIRTY_SIX_MONTH (3 years). + */ + plan: string; + /** + * [Output Only] URL of the region where this commitment may be used. + */ + region: string; + /** + * A list of commitment amounts for particular resources. Note that VCPU and + * MEMORY resource commitments must occur together. + */ + resources: Schema$ResourceCommitment[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Commitment start time in RFC3339 text format. + */ + startTimestamp: string; + /** + * [Output Only] Status of the commitment with regards to eventual + * expiration (each commitment has an end date defined). One of the + * following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + } + export interface Schema$CommitmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of CommitmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList + * for aggregated lists of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Commitment resources. + */ + export interface Schema$CommitmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Commitment resources. + */ + items: Schema$Commitment[]; + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists + * of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$CommitmentsScopedList { + /** + * [Output Only] A list of commitments contained in this scope. + */ + commitments: Schema$Commitment[]; + /** + * [Output Only] Informational warning which replaces the list of + * commitments when the list is empty. + */ + warning: any; + } + /** + * A condition to be met. + */ + export interface Schema$Condition { + /** + * Trusted attributes supplied by the IAM system. + */ + iam: string; + /** + * An operator to apply the subject with. + */ + op: string; + /** + * Trusted attributes discharged by the service. + */ + svc: string; + /** + * Trusted attributes supplied by any service that owns resources and uses + * the IAM system for access control. + */ + sys: string; + /** + * DEPRECATED. Use 'values' instead. + */ + value: string; + /** + * The objects of the condition. This is mutually exclusive with + * 'value'. + */ + values: string[]; + } + /** + * Message containing connection draining configuration. + */ + export interface Schema$ConnectionDraining { + /** + * Time for which instance will be drained (not accept new connections, but + * still work to finish started). + */ + drainingTimeoutSec: number; + } + /** + * Represents a customer-supplied encryption key + */ + export interface Schema$CustomerEncryptionKey { + /** + * The name of the encryption key that is stored in Google Cloud KMS. + */ + kmsKeyName: string; + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 + * base64 to either encrypt or decrypt this resource. + */ + rawKey: string; + /** + * Specifies an RFC 4648 base64 encoded, RSA-wrapped 2048-bit + * customer-supplied encryption key to either encrypt or decrypt this + * resource. The key must meet the following requirements before you can + * provide it to Compute Engine: - The key is wrapped using a RSA public + * key certificate provided by Google. - After being wrapped, the key must + * be encoded in RFC 4648 base64 encoding. Gets the RSA public key + * certificate provided by Google at: + * https://cloud-certs.storage.googleapis.com/google-cloud-csek-ingress.pem + */ + rsaEncryptedKey: string; + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the + * customer-supplied encryption key that protects this resource. + */ + sha256: string; + } + export interface Schema$CustomerEncryptionKeyProtectedDisk { + /** + * Decrypts data associated with the disk with a customer-supplied + * encryption key. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. This field is only applicable for persistent disks. + */ + source: string; + } + /** + * Deprecation status for a public resource. + */ + export interface Schema$DeprecationStatus { + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DELETED. This is only informational and + * the status will not change unless the client explicitly changes it. + */ + deleted: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DEPRECATED. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + deprecated: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to OBSOLETE. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + obsolete: string; + /** + * The URL of the suggested replacement for a deprecated resource. The + * suggested replacement resource must be the same kind of resource as the + * deprecated resource. + */ + replacement: string; + /** + * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, + * or DELETED. Operations which create a new resource using a DEPRECATED + * resource will return successfully, but with a warning indicating the + * deprecated resource and recommending its replacement. Operations which + * use OBSOLETE or DELETED resources will be rejected and result in an + * error. + */ + state: string; + } + /** + * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) + */ + export interface Schema$Disk { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Encrypts the disk using a customer-supplied encryption key. After you + * encrypt a disk with a customer-supplied key, you must provide the same + * key if you use the disk later (e.g. to create a disk snapshot or an + * image, or to attach the disk to a virtual machine). Customer-supplied + * encryption keys do not protect access to metadata of the disk. If you do + * not provide an encryption key when creating the disk, then the disk will + * be encrypted using an automatically generated key and you do not need to + * provide a key to use the disk later. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this disk, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a disk. + */ + labelFingerprint: string; + /** + * Labels to apply to this disk. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + */ + lastAttachTimestamp: string; + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + */ + lastDetachTimestamp: string; + /** + * Integer license codes indicating which licenses are attached to this + * disk. + */ + licenseCodes: string[]; + /** + * Any applicable publicly visible licenses. + */ + licenses: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Internal use only. + */ + options: string; + /** + * [Output Only] URL of the region where the disk resides. Only applicable + * for regional resources. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + region: string; + /** + * URLs of the zones where the disk should be replicated to. Only applicable + * for regional resources. + */ + replicaZones: string[]; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * Size of the persistent disk, specified in GB. You can specify this field + * when creating a persistent disk using the sourceImage or sourceSnapshot + * parameter, or specify it alone to create an empty persistent disk. If + * you specify this field along with sourceImage or sourceSnapshot, the + * value of sizeGb must not be less than the size of the sourceImage or the + * size of the snapshot. Acceptable values are 1 to 65536, inclusive. + */ + sizeGb: string; + /** + * The source image used to create this disk. If the source image is + * deleted, this field will not be set. To create a disk with one of the + * public operating system images, specify the image by its family name. For + * example, specify family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this disk. This + * value identifies the exact image that was used to create this persistent + * disk. For example, if you created the persistent disk from an image that + * was later deleted and recreated under the same name, the source image ID + * would identify the exact version of the image that was used. + */ + sourceImageId: string; + /** + * The source snapshot used to create this disk. You can provide this as a + * partial or full URL to the resource. For example, the following are valid + * values: - + * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. + * This value identifies the exact snapshot that was used to create this + * persistent disk. For example, if you created the persistent disk from a + * snapshot that was later deleted and recreated under the same name, the + * source snapshot ID would identify the exact version of the snapshot that + * was used. + */ + sourceSnapshotId: string; + /** + * [Output Only] The status of disk creation. + */ + status: string; + /** + * [Deprecated] Storage type of the persistent disk. + */ + storageType: string; + /** + * URL of the disk type resource describing which disk type to use to create + * the disk. Provide this when creating the disk. For example: + * project/zones/zone/diskTypes/pd-standard or pd-ssd + */ + type: string; + /** + * [Output Only] Links to the users of the disk (attached instances) in + * form: project/zones/zone/instances/instance + */ + users: string[]; + /** + * [Output Only] URL of the zone where the disk resides. You must specify + * this field as part of the HTTP request URL. It is not settable as a field + * in the request body. + */ + zone: string; + } + export interface Schema$DiskAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DisksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for + * aggregated lists of persistent disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A specification of the desired way to instantiate a disk in the instance + * template when its created from a source instance. + */ + export interface Schema$DiskInstantiationConfig { + /** + * Specifies whether the disk will be auto-deleted when the instance is + * deleted (but not when the disk is detached from the instance). + */ + autoDelete: boolean; + /** + * The custom source image to be used to restore this disk when + * instantiating this instance template. + */ + customImage: string; + /** + * Specifies the device name of the disk to which the configurations apply + * to. + */ + deviceName: string; + /** + * Specifies whether to include the disk and what image to use. Possible + * values are: - source-image: to use the same image that was used to + * create the source instance's corresponding disk. Applicable to the + * boot disk and additional read-write disks. - source-image-family: to use + * the same image family that was used to create the source instance's + * corresponding disk. Applicable to the boot disk and additional read-write + * disks. - custom-image: to use a user-provided image url for disk + * creation. Applicable to the boot disk and additional read-write disks. - + * attach-read-only: to attach a read-only disk. Applicable to read-only + * disks. - do-not-include: to exclude a disk from the template. Applicable + * to additional read-write disks, local SSDs, and read-only disks. + */ + instantiateFrom: string; } - - /** - * compute.vpnTunnels.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region The name of the region for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of Disk resources. */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'resource'], - pathParams: ['project', 'region', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Zoneoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.zoneOperations.delete - * @desc Deletes the specified zone-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$DiskList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Disk resources. + */ + items: Schema$Disk[]; + /** + * [Output Only] Type of resource. Always compute#diskList for lists of + * disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskMoveRequest { + /** + * The URL of the destination zone to move the disk. This can be a full or + * partial URL. For example, the following are all valid URLs to a zone: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target disk to move. This can be a full or partial URL. + * For example, the following are all valid URLs to a disk: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + targetDisk: string; + } + export interface Schema$DisksResizeRequest { + /** + * The new size of the persistent disk, which is specified in GB. + */ + sizeGb: string; + } + export interface Schema$DisksScopedList { + /** + * [Output Only] A list of disks contained in this scope. + */ + disks: Schema$Disk[]; + /** + * [Output Only] Informational warning which replaces the list of disks when + * the list is empty. + */ + warning: any; + } + /** + * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for + * v1.diskTypes ==) + */ + export interface Schema$DiskType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Server-defined default disk size in GB. + */ + defaultDiskSizeGb: string; + /** + * [Output Only] The deprecation status associated with this disk type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional description of this resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#diskType for disk + * types. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] An optional textual description of the valid disk size, + * such as "10GB-10TB". + */ + validDiskSize: string; + /** + * [Output Only] URL of the zone where the disk type resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$DiskTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of disk types. + */ + export interface Schema$DiskTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskType resources. + */ + items: Schema$DiskType[]; + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskTypesScopedList { + /** + * [Output Only] A list of disk types contained in this scope. + */ + diskTypes: Schema$DiskType[]; + /** + * [Output Only] Informational warning which replaces the list of disk types + * when the list is empty. + */ + warning: any; + } + export interface Schema$DistributionPolicy { + zones: Schema$DistributionPolicyZoneConfiguration[]; + } + export interface Schema$DistributionPolicyZoneConfiguration { + /** + * URL of the zone where managed instance group is spawning instances (for + * regional resources). Zone has to belong to the region where managed + * instance group is located. + */ + zone: string; + } + /** + * Represents an expression text. Example: title: "User account + * presence" description: "Determines whether the request has a user + * account" expression: "size(request.user) > 0" + */ + export interface Schema$Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description: string; + /** + * Textual representation of an expression in Common Expression Language + * syntax. The application context of the containing message determines + * which well-known feature set of CEL is supported. + */ + expression: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location: string; + /** + * An optional title for the expression, i.e. a short string describing its + * purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title: string; + } + /** + * Represents a Firewall resource. + */ + export interface Schema$Firewall { + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a permitted connection. + */ + allowed: any[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The list of DENY rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a denied connection. + */ + denied: any[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If destination ranges are specified, the firewall will apply only to + * traffic that has destination IP address in these ranges. These ranges + * must be expressed in CIDR format. Only IPv4 is supported. + */ + destinationRanges: string[]; + /** + * Direction of traffic to which this firewall applies; default is INGRESS. + * Note: For INGRESS traffic, it is NOT supported to specify + * destinationRanges; For EGRESS traffic, it is NOT supported to specify + * sourceRanges OR sourceTags. + */ + direction: string; + /** + * Denotes whether the firewall rule is disabled, i.e not applied to the + * network it is associated with. When set to true, the firewall rule is not + * enforced and the network behaves as if it did not exist. If this is + * unspecified, the firewall rule will be enabled. + */ + disabled: boolean; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall + * rules. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network resource for this firewall rule. If not specified when + * creating a firewall rule, the default network is used: + * global/networks/default If you choose to specify this property, you can + * specify the network as a full or partial URL. For example, the following + * are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + * - projects/myproject/global/networks/my-network - + * global/networks/default + */ + network: string; + /** + * Priority for this rule. This is an integer between 0 and 65535, both + * inclusive. When not specified, the value assumed is 1000. Relative + * priorities determine precedence of conflicting rules. Lower value of + * priority implies higher precedence (eg, a rule with priority 0 has higher + * precedence than a rule with priority 1). DENY rules take precedence over + * ALLOW rules having equal priority. + */ + priority: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If source ranges are specified, the firewall will apply only to traffic + * that has source IP address in these ranges. These ranges must be + * expressed in CIDR format. One or both of sourceRanges and sourceTags may + * be set. If both properties are set, the firewall will apply to traffic + * that has source IP address within sourceRanges OR the source IP that + * belongs to a tag listed in the sourceTags property. The connection does + * not need to match both properties for the firewall to apply. Only IPv4 is + * supported. + */ + sourceRanges: string[]; + /** + * If source service accounts are specified, the firewall will apply only to + * traffic originating from an instance with a service account in this list. + * Source service accounts cannot be used to control traffic to an + * instance's external IP address because service accounts are + * associated with an instance, not an IP address. sourceRanges can be set + * at the same time as sourceServiceAccounts. If both are set, the firewall + * will apply to traffic that has source IP address within sourceRanges OR + * the source IP belongs to an instance with service account listed in + * sourceServiceAccount. The connection does not need to match both + * properties for the firewall to apply. sourceServiceAccounts cannot be + * used at the same time as sourceTags or targetTags. + */ + sourceServiceAccounts: string[]; + /** + * If source tags are specified, the firewall rule applies only to traffic + * with source IPs that match the primary network interfaces of VM instances + * that have the tag and are in the same VPC network. Source tags cannot be + * used to control traffic to an instance's external IP address, it only + * applies to traffic between instances in the same virtual network. Because + * tags are associated with instances, not IP addresses. One or both of + * sourceRanges and sourceTags may be set. If both properties are set, the + * firewall will apply to traffic that has source IP address within + * sourceRanges OR the source IP that belongs to a tag listed in the + * sourceTags property. The connection does not need to match both + * properties for the firewall to apply. + */ + sourceTags: string[]; + /** + * A list of service accounts indicating sets of instances located in the + * network that may make network connections as specified in allowed[]. + * targetServiceAccounts cannot be used at the same time as targetTags or + * sourceTags. If neither targetServiceAccounts nor targetTags are + * specified, the firewall rule applies to all instances on the specified + * network. + */ + targetServiceAccounts: string[]; + /** + * A list of tags that controls which instances the firewall rule applies + * to. If targetTags are specified, then the firewall rule applies only to + * instances in the VPC network that have one of those tags. If no + * targetTags are specified, the firewall rule applies to all instances on + * the specified network. + */ + targetTags: string[]; + } + /** + * Contains a list of firewalls. + */ + export interface Schema$FirewallList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Firewall resources. + */ + items: Schema$Firewall[]; + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of + * firewalls. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Encapsulates numeric value that can be either absolute or relative. + */ + export interface Schema$FixedOrPercent { + /** + * [Output Only] Absolute value of VM instances calculated based on the + * specific mode. - If the value is fixed, then the caculated value is + * equal to the fixed value. - If the value is a percent, then the + * calculated value is percent/100 * targetSize. For example, the calculated + * value of a 80% of a managed instance group with 150 instances would be + * (80/100 * 150) = 120 VM instances. If there is a remainder, the number is + * rounded up. + */ + calculated: number; + /** + * Specifies a fixed number of VM instances. This must be a positive + * integer. + */ + fixed: number; + /** + * Specifies a percentage of instances between 0 to 100%, inclusive. For + * example, specify 80 for 80%. + */ + percent: number; + } + /** + * A ForwardingRule resource. A ForwardingRule resource specifies which pool + * of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules + * ==) (== resource_for v1.forwardingRules ==) (== resource_for + * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules + * ==) (== resource_for beta.regionForwardingRules ==) (== resource_for + * v1.regionForwardingRules ==) + */ + export interface Schema$ForwardingRule { + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the BackendService resource to receive + * the matched traffic. + */ + backendService: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP address that this forwarding rule is serving on behalf of. + * Addresses are restricted based on the forwarding rule's load + * balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). + * When the load balancing scheme is EXTERNAL, for global forwarding rules, + * the address must be a global IP, and for regional forwarding rules, the + * address must live in the same region as the forwarding rule. If this + * field is empty, an ephemeral IPv4 address from the same scope (global or + * regional) will be assigned. A regional forwarding rule supports IPv4 + * only. A global forwarding rule supports either IPv4 or IPv6. When the + * load balancing scheme is INTERNAL, this can only be an RFC 1918 IP + * address belonging to the network/subnet configured for the forwarding + * rule. By default, if this field is empty, an ephemeral internal IP + * address will be automatically allocated from the IP range of the subnet + * or network configured for this forwarding rule. An address can be + * specified either by a literal IP address or a URL reference to an + * existing Address resource. The following examples are all valid: - + * 100.1.2.3 - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address + * - projects/project/regions/region/addresses/address - + * regions/region/addresses/address - global/addresses/address - address + */ + IPAddress: string; + /** + * The IP protocol to which this rule applies. Valid options are TCP, UDP, + * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only + * TCP and UDP are valid. + */ + IPProtocol: string; + /** + * The IP Version that will be used by this forwarding rule. Valid options + * are IPV4 or IPV6. This can only be specified for a global forwarding + * rule. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for + * Forwarding Rule resources. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this resource, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a + * ForwardingRule. + */ + labelFingerprint: string; + /** + * Labels to apply to this resource. These can be later modified by the + * setLabels method. Each label key/value pair must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * This signifies what the ForwardingRule will be used for and can only take + * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that + * this will be used for Internal Network Load Balancing (TCP, UDP). The + * value of EXTERNAL means that this will be used for External Load + * Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) + */ + loadBalancingScheme: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the network that the load balanced IP + * should belong to for this Forwarding Rule. If this field is not + * specified, the default network will be used. + */ + network: string; + /** + * This signifies the networking tier used for configuring this load + * balancer and can only take the following values: PREMIUM , STANDARD. For + * regional ForwardingRule, the valid values are PREMIUM and STANDARD. For + * GlobalForwardingRule, the valid value is PREMIUM. If this field is not + * specified, it is assumed to be PREMIUM. If IPAddress is specified, this + * value must be equal to the networkTier of the Address. + */ + networkTier: string; + /** + * This field is used along with the target field for TargetHttpProxy, + * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, + * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, + * or SCTP, only packets addressed to ports in the specified range will be + * forwarded to target. Forwarding rules with the same [IPAddress, + * IPProtocol] pair must have disjoint port ranges. Some types of + * forwarding target have constraints on the acceptable ports: - + * TargetHttpProxy: 80, 8080 - TargetHttpsProxy: 443 - TargetTcpProxy: 25, + * 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - + * TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, + * 1688, 1883, 5222 - TargetVpnGateway: 500, 4500 + */ + portRange: string; + /** + * This field is used along with the backend_service field for internal load + * balancing. When the load balancing scheme is INTERNAL, a single port or + * a comma separated list of ports can be configured. Only packets addressed + * to these ports will be forwarded to the backends configured with this + * forwarding rule. You may specify a maximum of up to 5 ports. + */ + ports: string[]; + /** + * [Output Only] URL of the region where the regional forwarding rule + * resides. This field is not applicable to global forwarding rules. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * An optional prefix to the service name for this Forwarding Rule. If + * specified, will be the first label of the fully qualified service name. + * The label must be 1-63 characters long, and comply with RFC1035. + * Specifically, the label must be 1-63 characters long and match the + * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. This field is only used for internal load balancing. + */ + serviceLabel: string; + /** + * [Output Only] The internal fully qualified service name for this + * Forwarding Rule. This field is only used for internal load balancing. + */ + serviceName: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the subnetwork that the load balanced IP + * should belong to for this Forwarding Rule. If the network specified is + * in auto subnet mode, this field is optional. However, if the network is + * in custom subnet mode, a subnetwork must be specified. + */ + subnetwork: string; + /** + * The URL of the target resource to receive the matched traffic. For + * regional forwarding rules, this target must live in the same region as + * the forwarding rule. For global forwarding rules, this target must be a + * global load balancing resource. The forwarded traffic must be of a type + * appropriate to the target object. + */ + target: string; + } + export interface Schema$ForwardingRuleAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRulesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#forwardingRuleAggregatedList for lists of forwarding rules. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of ForwardingRule resources. + */ + export interface Schema$ForwardingRuleList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRule resources. + */ + items: Schema$ForwardingRule[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ForwardingRulesScopedList { + /** + * A list of forwarding rules contained in this scope. + */ + forwardingRules: Schema$ForwardingRule[]; + /** + * Informational warning which replaces the list of forwarding rules when + * the list is empty. + */ + warning: any; + } + export interface Schema$GlobalSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash when updating or + * changing labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * A list of labels to apply for this resource. Each label key & value + * must comply with RFC1035. Specifically, the name must be 1-63 characters + * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which + * means the first character must be a lowercase letter, and all following + * characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. For example, + * "webserver-frontend": "images". A label value can + * also be empty (e.g. "my-label": ""). + */ + labels: any; + } + /** + * Guest OS features. + */ + export interface Schema$GuestOsFeature { + /** + * The ID of a supported feature. Read Enabling guest operating system + * features to see a list of available options. + */ + type: string; + } + /** + * An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the + * supported protocols. + */ + export interface Schema$HealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in 3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + httpHealthCheck: Schema$HTTPHealthCheck; + httpsHealthCheck: Schema$HTTPSHealthCheck; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + sslHealthCheck: Schema$SSLHealthCheck; + tcpHealthCheck: Schema$TCPHealthCheck; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If + * not specified, the default is TCP. Exactly one of the protocol-specific + * health check field must be specified, which must match type field. + */ + type: string; + udpHealthCheck: Schema$UDPHealthCheck; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + /** + * Contains a list of HealthCheck resources. + */ + export interface Schema$HealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HealthCheck resources. + */ + items: Schema$HealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A full or valid partial URL to a health check. For example, the following + * are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check + * - projects/project-id/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$HealthCheckReference { healthCheck: string; } + export interface Schema$HealthStatus { + /** + * Health state of the instance. + */ + healthState: string; + /** + * URL of the instance resource. + */ + instance: string; + /** + * The IP address represented by this resource. + */ + ipAddress: string; + /** + * The port on the instance. + */ + port: number; + } + /** + * UrlMaps A host-matching rule for a URL. If matched, will use the named + * PathMatcher to select the BackendService. + */ + export interface Schema$HostRule { + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The list of host patterns to match. They must be valid hostnames, except + * * will match any string of ([a-z0-9-.]*). In that case, * must be the + * first character and must be followed in the pattern by either - or .. + */ + hosts: string[]; + /** + * The name of the PathMatcher to use to match the path portion of the URL + * if the hostRule matches the URL's host portion. + */ + pathMatcher: string; + } + /** + * An HttpHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTP. + */ + export interface Schema$HttpHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#httpHealthCheck for + * HTTP health checks. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTP health check request. The default value + * is 80. + */ + port: number; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPHealthCheck { + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + /** + * The string to match anywhere in the first 1024 bytes of the response + * body. If left empty (the default value), the status code determines + * health. The response data can only be ASCII. + */ + response: string; + } + /** + * Contains a list of HttpHealthCheck resources. + */ + export interface Schema$HttpHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpHealthCheck resources. + */ + items: Schema$HttpHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An HttpsHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTPS. + */ + export interface Schema$HttpsHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTPS health check request. The default value + * is 443. + */ + port: number; + /** + * The request path of the HTTPS health check request. The default value is + * "/". + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have a greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPSHealthCheck { + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTPS health check request. The default value is + * /. + */ + requestPath: string; + /** + * The string to match anywhere in the first 1024 bytes of the response + * body. If left empty (the default value), the status code determines + * health. The response data can only be ASCII. + */ + response: string; + } + /** + * Contains a list of HttpsHealthCheck resources. + */ + export interface Schema$HttpsHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpsHealthCheck resources. + */ + items: Schema$HttpsHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Image resource. (== resource_for beta.images ==) (== resource_for + * v1.images ==) + */ + export interface Schema$Image { + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in + * bytes). + */ + archiveSizeBytes: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The deprecation status associated with this image. + */ + deprecated: Schema$DeprecationStatus; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Size of the image when restored onto a persistent disk (in GB). + */ + diskSizeGb: string; + /** + * The name of the image family to which this image belongs. You can create + * disks by specifying an image family instead of a specific image name. The + * image family always returns its latest image that is not deprecated. The + * name of the image family must comply with RFC1035. + */ + family: string; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Encrypts the image using a customer-supplied encryption key. After you + * encrypt an image with a customer-supplied key, you must provide the same + * key if you use the image later (e.g. to create a disk from the image). + * Customer-supplied encryption keys do not protect access to metadata of + * the disk. If you do not provide an encryption key when creating the + * image, then the disk will be encrypted using an automatically generated + * key and you do not need to provide a key to use the image later. + */ + imageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] Type of the resource. Always compute#image for images. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this image, which is + * essentially a hash of the labels used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an image. + */ + labelFingerprint: string; + /** + * Labels to apply to this image. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * image. + */ + licenseCodes: string[]; + /** + * Any applicable license URI. + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The parameters of the raw disk image. + */ + rawDisk: any; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL of the source disk used to create this image. This can be a full or + * valid partial URL. You must provide either this property or the + * rawDisk.source property but not both to create an image. For example, the + * following are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * The ID value of the disk used to create this image. This value may be + * used to determine whether the image was taken from the current or a + * previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * URL of the source image used to create this image. This can be a full or + * valid partial URL. You must provide exactly one of: - this property, or + * - the rawDisk.source property, or - the sourceDisk property in order + * to create an image. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this image. This + * value may be used to determine whether the image was taken from the + * current or a previous instance of a given image name. + */ + sourceImageId: string; + /** + * URL of the source snapshot used to create this image. This can be a full + * or valid partial URL. You must provide exactly one of: - this property, + * or - the sourceImage property, or - the rawDisk.source property, or + * - the sourceDisk property in order to create an image. + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the snapshot used to create this image. + * This value may be used to determine whether the snapshot was taken from + * the current or a previous instance of a given snapshot name. + */ + sourceSnapshotId: string; + /** + * The type of the image used to create this disk. The default and only + * value is RAW + */ + sourceType: string; + /** + * [Output Only] The status of the image. An image can be used to create + * other resources, such as instances, only after the image has been + * successfully created and the status is set to READY. Possible values are + * FAILED, PENDING, or READY. + */ + status: string; + } + /** + * Contains a list of images. + */ + export interface Schema$ImageList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Image resources. + */ + items: Schema$Image[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance resource. (== resource_for beta.instances ==) (== resource_for + * v1.instances ==) + */ + export interface Schema$Instance { + /** + * Allows this instance to send and receive packets with non-matching + * destination or source IPs. This is required if you plan to use this + * instance to forward routes. For more information, see Enabling IP + * Forwarding. + */ + canIpForward: boolean; + /** + * [Output Only] The CPU platform used by this instance. + */ + cpuPlatform: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Whether the resource should be protected against deletion. + */ + deletionProtection: boolean; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Array of disks associated with this instance. Persistent disks must be + * created before you can assign them. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#instance for + * instances. + */ + kind: string; + /** + * A fingerprint for this request, which is essentially a hash of the + * metadata's contents and used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request + * to modify or update metadata. You must always provide an up-to-date + * fingerprint hash in order to update or change metadata. To see the + * latest fingerprint, make get() request to the instance. + */ + labelFingerprint: string; + /** + * Labels to apply to this instance. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Full or partial URL of the machine type resource to use for this + * instance, in the format: zones/zone/machineTypes/machine-type. This is + * provided by the client when the instance is created. For example, the + * following is a valid partial url to a predefined machine type: + * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom + * machine type, provide a URL to a machine type in the following format, + * where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and + * MEMORY is the total memory for this instance. Memory must be a multiple + * of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): + * zones/zone/machineTypes/custom-CPUS-MEMORY For example: + * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of + * restrictions, read the Specifications for custom machine types. + */ + machineType: string; + /** + * The metadata key/value pairs assigned to this instance. This includes + * custom metadata and predefined keys. + */ + metadata: Schema$Metadata; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values + * are the friendly names of CPU platforms, such as minCpuPlatform: + * "Intel Haswell" or minCpuPlatform: "Intel Sandy + * Bridge". + */ + minCpuPlatform: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * An array of network configurations for this instance. These specify how + * interfaces are configured to interact with other network services, such + * as connecting to the internet. Multiple interfaces are supported per + * instance. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Sets the scheduling options for this instance. + */ + scheduling: Schema$Scheduling; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * A list of service accounts, with their specified scopes, authorized for + * this instance. Only one service account per VM instance is supported. + * Service accounts generate access tokens that can be accessed through the + * metadata server and used to authenticate applications on the instance. + * See Service Accounts for more information. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * [Output Only] Whether a VM has been restricted for start because Compute + * Engine has detected suspicious activity. + */ + startRestricted: boolean; + /** + * [Output Only] The status of the instance. One of the following values: + * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, + * and TERMINATED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + /** + * A list of tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. The tags can be later modified by the setTags + * method. Each tag within the list must comply with RFC1035. + */ + tags: Schema$Tags; + /** + * [Output Only] URL of the zone where the instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$InstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstancesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for + * aggregated lists of Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for + * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== + * resource_for v1.regionInstanceGroups ==) + */ + export interface Schema$InstanceGroup { + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 + * text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The fingerprint of the named ports. The system uses this + * fingerprint to detect conflicts when multiple users change the named + * ports concurrently. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this instance group, generated by + * the server. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceGroup + * for instance groups. + */ + kind: string; + /** + * The name of the instance group. The name must be 1-63 characters long, + * and comply with RFC1035. + */ + name: string; + /** + * Assigns a name to a port number. For example: {name: "http", + * port: 80} This allows the system to reference ports by the assigned name + * instead of a port number. Named ports can also contain multiple ports. + * For example: [{name: "http", port: 80},{name: "http", + * port: 8080}] Named ports apply to all instances in this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * The URL of the network to which all instances in the instance group + * belong. + */ + network: string; + /** + * [Output Only] The URL of the region where the instance group is located + * (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this instance group. The server generates this + * URL. + */ + selfLink: string; + /** + * [Output Only] The total number of instances in the instance group. + */ + size: number; + /** + * [Output Only] The URL of the subnetwork to which all instances in the + * instance group belong. + */ + subnetwork: string; + /** + * [Output Only] The URL of the zone where the instance group is located + * (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupsScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupAggregatedList for aggregated lists of instance + * groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zoneOperations.get - * @desc Retrieves the specified zone-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of InstanceGroup resources. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupList for instance group lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers + * ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + */ + export interface Schema$InstanceGroupManager { + /** + * The autohealing policy for this managed instance group. You can specify + * only one value. + */ + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + /** + * The base instance name to use for instances in this group. The value must + * be 1-58 characters long. Instances are named by appending a hyphen and a + * random four-character string to the base instance name. The base instance + * name must comply with RFC1035. + */ + baseInstanceName: string; + /** + * [Output Only] The creation timestamp for this managed instance group in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The list of instance actions and the number of instances in + * this managed instance group that are scheduled for each of those actions. + */ + currentActions: Schema$InstanceGroupManagerActionsSummary; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Policy valid only for regional managed instance groups. + */ + distributionPolicy: Schema$DistributionPolicy; + /** + * The action to perform in case of zone failure. Only one value is + * supported, NO_FAILOVER. The default is NO_FAILOVER. + */ + failoverAction: string; + /** + * [Output Only] The fingerprint of the resource data. You can use this + * optional field for optimistic locking when you update the resource. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this resource type. The server + * generates this identifier. + */ + id: string; + /** + * [Output Only] The URL of the Instance Group resource. + */ + instanceGroup: string; + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManager for managed instance groups. + */ + kind: string; + /** + * The name of the managed instance group. The name must be 1-63 characters + * long, and comply with RFC1035. + */ + name: string; + /** + * Named ports configured for the Instance Groups complementary to this + * Instance Group Manager. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The list of instance actions and the number of instances in + * this managed instance group that are pending for each of those actions. + */ + pendingActions: Schema$InstanceGroupManagerPendingActionsSummary; + /** + * [Output Only] The URL of the region where the managed instance group + * resides (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this managed instance group. The server defines + * this URL. + */ + selfLink: string; + /** + * [Output Only] The service account to be used as credentials for all + * operations performed by the managed instance group on instances. The + * service accounts needs all permissions required to create and delete + * instances. By default, the service account + * {projectNumber}@cloudservices.gserviceaccount.com is used. + */ + serviceAccount: string; + /** + * The URLs for all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + /** + * The target number of running instances for this managed instance group. + * Deleting or abandoning instances reduces this number. Resizing the group + * changes this number. + */ + targetSize: number; + /** + * The update policy for this managed instance group. + */ + updatePolicy: Schema$InstanceGroupManagerUpdatePolicy; + /** + * Specifies the instance templates used by this managed instance group to + * create instances. Each version is defined by an instanceTemplate. Every + * template can appear at most once per instance group. This field overrides + * the top-level instanceTemplate field. Read more about the relationships + * between these fields. Exactly one version must leave the targetSize field + * unset. That version will be applied to all remaining instances. For more + * information, read about canary updates. + */ + versions: Schema$InstanceGroupManagerVersion[]; + /** + * [Output Only] The URL of the zone where the managed instance group is + * located (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupManagerActionsSummary { + /** + * [Output Only] The total number of instances in the managed instance group + * that are scheduled to be abandoned. Abandoning an instance removes it + * from the managed instance group without deleting it. + */ + abandoning: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be created or are currently being created. If the group + * fails to create any of these instances, it tries again until it creates + * the instance successfully. If you have disabled creation retries, this + * field will not be populated; instead, the creatingWithoutRetries field + * will be populated. + */ + creating: number; + /** + * [Output Only] The number of instances that the managed instance group + * will attempt to create. The group attempts to create each instance only + * once. If the group fails to create any of these instances, it decreases + * the group's targetSize value accordingly. + */ + creatingWithoutRetries: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be deleted or are currently being deleted. + */ + deleting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are running and have no scheduled actions. + */ + none: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be recreated or are currently being being recreated. + * Recreating an instance deletes the existing root persistent disk and + * creates a new disk from the image that is defined in the instance + * template. + */ + recreating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are being reconfigured with properties that do not require a restart or a + * recreate action. For example, setting or removing target pools for the + * instance. + */ + refreshing: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be restarted or are currently being restarted. + */ + restarting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are being verified. See the managedInstances[].currentAction property in + * the listManagedInstances method documentation. + */ + verifying: number; + } + export interface Schema$InstanceGroupManagerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManagersScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerAggregatedList for an aggregated list of + * managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagerAutoHealingPolicy { + /** + * The URL for the health check that signals autohealing. + */ + healthCheck: string; + /** + * The number of seconds that the managed instance group waits before it + * applies autohealing policies to new instances or recently recreated + * instances. This initial delay allows instances to initialize and run + * their startup scripts before the instance group determines that they are + * UNHEALTHY. This prevents the managed instance group from recreating its + * instances prematurely. This value must be from range [0, 3600]. + */ + initialDelaySec: number; + } + /** + * [Output Only] A list of managed instance groups. + */ + export interface Schema$InstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagerPendingActionsSummary { + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be created. + */ + creating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be deleted. + */ + deleting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be recreated. + */ + recreating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are pending to be restarted. + */ + restarting: number; + } + export interface Schema$InstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersListManagedInstancesResponse { + /** + * [Output Only] The list of instances in the managed instance group. + */ + managedInstances: Schema$ManagedInstance[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + } + export interface Schema$InstanceGroupManagersRecreateInstancesRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersResizeAdvancedRequest { + /** + * If this flag is true, the managed instance group attempts to create all + * instances initiated by this resize request only once. If there is an + * error during creation, the managed instance group does not retry create + * this instance, and we will decrease the targetSize of the request + * instead. If the flag is false, the group attemps to recreate each + * instance continuously until it succeeds. This flag matters only in the + * first attempt of creation of an instance. After an instance is + * successfully created while this flag is enabled, the instance behaves the + * same way as all the other instances created with a regular resize + * request. In particular, if a running instance dies unexpectedly at a + * later time and needs to be recreated, this mode does not affect the + * recreation behavior in that scenario. This flag is applicable only to + * the current resize request. It does not influence other resize requests + * in any way. You can see which instances is being creating in which mode + * by calling the get or listManagedInstances API. + */ + noCreationRetries: boolean; + /** + * The number of running instances that the managed instance group should + * maintain at any given time. The group automatically adds or removes + * instances to maintain the number of instances specified by this + * parameter. + */ + targetSize: number; + } + export interface Schema$InstanceGroupManagersScopedList { + /** + * [Output Only] The list of managed instance groups that are contained in + * the specified project and zone. + */ + instanceGroupManagers: Schema$InstanceGroupManager[]; + /** + * [Output Only] The warning that replaces the list of managed instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupManagersSetAutoHealingRequest { + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + } + export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + } + export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { + /** + * The fingerprint of the target pools information. Use this optional + * property to prevent conflicts when multiple users change the target pools + * settings concurrently. Obtain the fingerprint with the + * instanceGroupManagers.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of target pool URLs that instances in this managed instance + * group belong to. The managed instance group applies these target pools to + * all of the instances in the group. Existing instances and new instances + * in the group all receive these target pool settings. + */ + targetPools: string[]; + } + export interface Schema$InstanceGroupManagerUpdatePolicy { + /** + * The maximum number of instances that can be created above the specified + * targetSize during the update process. By default, a fixed value of 1 is + * used. This value can be either a fixed number or a percentage if the + * instance group has 10 or more instances. If you set a percentage, the + * number of instances will be rounded up if necessary. At least one of + * either maxSurge or maxUnavailable must be greater than 0. Learn more + * about maxSurge. + */ + maxSurge: Schema$FixedOrPercent; + /** + * The maximum number of instances that can be unavailable during the update + * process. An instance is considered available if all of the following + * conditions are satisfied: - The instance's status is RUNNING. - + * If there is a health check on the instance group, the instance's + * liveness health check result must be HEALTHY at least once. If there is + * no health check on the group, then the instance only needs to have a + * status of RUNNING to be considered available. By default, a fixed value + * of 1 is used. This value can be either a fixed number or a percentage if + * the instance group has 10 or more instances. If you set a percentage, the + * number of instances will be rounded up if necessary. At least one of + * either maxSurge or maxUnavailable must be greater than 0. Learn more + * about maxUnavailable. + */ + maxUnavailable: Schema$FixedOrPercent; + /** + * Minimal action to be taken on an instance. You can specify either RESTART + * to restart existing instances or REPLACE to delete and create new + * instances from the target template. If you specify a code>RESTART, the + * Updater will attempt to perform that action only. However, if the Updater + * determines that the minimal action you specify is not enough to perform + * the update, it might perform a more disruptive action. + */ + minimalAction: string; + /** + * Minimum number of seconds to wait for after a newly created instance + * becomes available. This value must be from range [0, 3600]. + */ + minReadySec: number; + type: string; + } + export interface Schema$InstanceGroupManagerVersion { + instanceTemplate: string; + /** + * Name of the version. Unique among all versions in the scope of this + * managed instance group. + */ + name: string; + /** + * Specifies the intended number of instances to be created from the + * instanceTemplate. The final number of instances created from the template + * will be equal to: - If expressed as a fixed number, the minimum of + * either targetSize.fixed or instanceGroupManager.targetSize is used. - if + * expressed as a percent, the targetSize would be (targetSize.percent/100 * + * InstanceGroupManager.targetSize) If there is a remainder, the number is + * rounded up. If unset, this version will update any remaining instances + * not updated by another version. Read Starting a canary update for more + * information. + */ + targetSize: Schema$FixedOrPercent; + } + export interface Schema$InstanceGroupsAddInstancesRequest { + /** + * The list of instances to add to the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupsListInstances for the list of instances in the + * specified instance group. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupsListInstancesRequest { + /** + * A filter for the state of the instances in the instance group. Valid + * options are ALL or RUNNING. If you do not specify this parameter the list + * includes all instances regardless of their state. + */ + instanceState: string; + } + export interface Schema$InstanceGroupsRemoveInstancesRequest { + /** + * The list of instances to remove from the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsScopedList { + /** + * [Output Only] The list of instance groups that are contained in this + * scope. + */ + instanceGroups: Schema$InstanceGroup[]; + /** + * [Output Only] An informational warning that replaces the list of instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of instances. + */ + export interface Schema$InstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Instance resources. + */ + items: Schema$Instance[]; + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of + * Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of instance referrers. + */ + export interface Schema$InstanceListReferrers { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Reference resources. + */ + items: Schema$Reference[]; + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for + * lists of Instance referrers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceMoveRequest { + /** + * The URL of the destination zone to move the instance. This can be a full + * or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target instance to move. This can be a full or partial + * URL. For example, the following are all valid URLs to an instance: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + targetInstance: string; + } + export interface Schema$InstanceProperties { + /** + * Enables instances created based on this template to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify true. If unsure, leave this set to false. See the + * Enable IP forwarding documentation for more information. + */ + canIpForward: boolean; + /** + * An optional text description for the instances that are created from this + * instance template. + */ + description: string; + /** + * An array of disks that are associated with the instances that are created + * from this template. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of guest accelerator cards' type and count to use for + * instances created from the instance template. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * Labels to apply to instances that are created from this template. + */ + labels: any; + /** + * The machine type to use for instances that are created from this + * template. + */ + machineType: string; + /** + * The metadata key/value pairs to assign to instances that are created from + * this template. These pairs can consist of custom metadata or predefined + * keys. See Project and instance metadata for more information. + */ + metadata: Schema$Metadata; + /** + * Minimum cpu/platform to be used by this instance. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are + * the friendly names of CPU platforms, such as minCpuPlatform: "Intel + * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more + * information, read Specifying a Minimum CPU Platform. + */ + minCpuPlatform: string; + /** + * An array of network access configurations for this interface. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Specifies the scheduling options for the instances that are created from + * this template. + */ + scheduling: Schema$Scheduling; + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * this template. Use metadata queries to obtain the access tokens for these + * instances. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * A list of tags to apply to the instances that are created from this + * template. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag + * within the list must comply with RFC1035. + */ + tags: Schema$Tags; + } + export interface Schema$InstanceReference { + /** + * The URL for a specific instance. + */ + instance: string; + } + export interface Schema$InstancesScopedList { + /** + * [Output Only] A list of instances contained in this scope. + */ + instances: Schema$Instance[]; + /** + * [Output Only] Informational warning which replaces the list of instances + * when the list is empty. + */ + warning: any; + } + export interface Schema$InstancesSetLabelsRequest { + /** + * Fingerprint of the previous set of labels for this resource, used to + * prevent conflicts. Provide the latest fingerprint value when making a + * request to add or change labels. + */ + labelFingerprint: string; + labels: any; + } + export interface Schema$InstancesSetMachineResourcesRequest { + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + } + export interface Schema$InstancesSetMachineTypeRequest { + /** + * Full or partial URL of the machine type resource. See Machine Types for a + * full list of machine types. For example: + * zones/us-central1-f/machineTypes/n1-standard-1 + */ + machineType: string; + } + export interface Schema$InstancesSetMinCpuPlatformRequest { + /** + * Minimum cpu/platform this instance should be started at. + */ + minCpuPlatform: string; + } + export interface Schema$InstancesSetServiceAccountRequest { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + export interface Schema$InstancesStartWithEncryptionKeyRequest { + /** + * Array of disks associated with this instance that are protected with a + * customer-supplied encryption key. In order to start the instance, the + * disk url and its corresponding key must be provided. If the disk is not + * protected with a customer-supplied encryption key it should not be + * specified. + */ + disks: Schema$CustomerEncryptionKeyProtectedDisk[]; + } + /** + * An Instance Template resource. (== resource_for beta.instanceTemplates ==) + * (== resource_for v1.instanceTemplates ==) + */ + export interface Schema$InstanceTemplate { + /** + * [Output Only] The creation timestamp for this instance template in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A unique identifier for this instance template. The server + * defines this identifier. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceTemplate + * for instance templates. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The instance properties for this instance template. + */ + properties: Schema$InstanceProperties; + /** + * [Output Only] The URL for this instance template. The server defines this + * URL. + */ + selfLink: string; + /** + * The source instance used to create the template. You can provide this as + * a partial or full URL to the resource. For example, the following are + * valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance + */ + sourceInstance: string; + /** + * The source instance params to use to create this instance template. + */ + sourceInstanceParams: Schema$SourceInstanceParams; + } + /** + * A list of instance templates. + */ + export interface Schema$InstanceTemplateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceTemplate resources. + */ + items: Schema$InstanceTemplate[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceTemplatesListResponse for instance template lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceWithNamedPorts { + /** + * [Output Only] The URL of the instance. + */ + instance: string; + /** + * [Output Only] The named ports that belong to this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The status of the instance. + */ + status: string; + } + /** + * Represents an Interconnects resource. The Interconnects resource is a + * dedicated connection between Google's network and your on-premises + * network. For more information, see the Dedicated overview page. (== + * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + */ + export interface Schema$Interconnect { + /** + * Administrative status of the interconnect. When this is set to true, the + * Interconnect is functional and can carry traffic. When set to false, no + * packets can be carried over the interconnect and no BGP routes are + * exchanged over it. By default, the status is set to true. + */ + adminEnabled: boolean; + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual + * circuits in this LAG. + */ + circuitInfos: Schema$InterconnectCircuitInfo[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Customer name, to put in the Letter of Authorization as the party + * authorized to request a crossconnect. + */ + customerName: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of outages expected for this Interconnect. + */ + expectedOutages: Schema$InterconnectOutageNotification[]; + /** + * [Output Only] IP address configured on the Google side of the + * Interconnect link. This can be used only for ping tests. + */ + googleIpAddress: string; + /** + * [Output Only] Google reference ID; to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of the URLs of all InterconnectAttachments + * configured to use this Interconnect. + */ + interconnectAttachments: string[]; + /** + * Type of interconnect. Note that "IT_PRIVATE" has been + * deprecated in favor of "DEDICATED" + */ + interconnectType: string; + /** + * [Output Only] Type of the resource. Always compute#interconnect for + * interconnects. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this Interconnect, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an Interconnect. + */ + labelFingerprint: string; + /** + * Labels to apply to this Interconnect resource. These can be later + * modified by the setLabels method. Each label key/value must comply with + * RFC1035. Label values may be empty. + */ + labels: any; + /** + * Type of link requested. This field indicates speed of each of the links + * in the bundle, not the entire bundle. Only 10G per link is allowed for a + * dedicated interconnect. Options: Ethernet_10G_LR + */ + linkType: string; + /** + * URL of the InterconnectLocation object that represents where this + * connection is to be provisioned. + */ + location: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Email address to contact the customer NOC for operations and maintenance + * notifications regarding this Interconnect. If specified, this will be + * used for notifications in addition to all other forms described, such as + * Stackdriver logs alerting and Cloud Notifications. + */ + nocContactEmail: string; + /** + * [Output Only] The current status of whether or not this Interconnect is + * functional. + */ + operationalStatus: string; + /** + * [Output Only] IP address configured on the customer side of the + * Interconnect link. The customer should configure this IP address during + * turnup when prompted by Google NOC. This can be used only for ping tests. + */ + peerIpAddress: string; + /** + * [Output Only] Number of links actually provisioned in this interconnect. + */ + provisionedLinkCount: number; + /** + * Target number of physical links in the link bundle, as requested by the + * customer. + */ + requestedLinkCount: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The current state of whether or not this Interconnect is + * functional. + */ + state: string; + } + /** + * Represents an InterconnectAttachment (VLAN attachment) resource. For more + * information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for + * v1.interconnectAttachments ==) + */ + export interface Schema$InterconnectAttachment { + /** + * Determines whether this Attachment will carry packets. Not present for + * PARTNER_PROVIDER. + */ + adminEnabled: boolean; + /** + * Provisioned bandwidth capacity for the interconnectAttachment. Can be set + * by the partner to update the customer's provisioned bandwidth. Output + * only for for PARTNER type, mutable for PARTNER_PROVIDER, not available + * for DEDICATED. + */ + bandwidth: string; + /** + * Up to 16 candidate prefixes that can be used to restrict the allocation + * of cloudRouterIpAddress and customerRouterIpAddress for this attachment. + * All prefixes must be within link-local address space (169.254.0.0/16) and + * must be /29 or shorter (/28, /27, etc). Google will attempt to select an + * unused /29 from the supplied candidate prefix(es). The request will fail + * if all possible /29s are in use on Google?s edge. If not supplied, Google + * will randomly select an unused /29 from all of link-local space. + */ + candidateSubnets: string[]; + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud + * Router Interface for this interconnect attachment. + */ + cloudRouterIpAddress: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] IPv4 address + prefix length to be configured on the + * customer router subinterface for this interconnect attachment. + */ + customerRouterIpAddress: string; + /** + * An optional description of this resource. + */ + description: string; + /** + * Desired availability domain for the attachment. Only available for type + * PARTNER, at creation time. For improved reliability, customers should + * configure a pair of attachments with one per availability domain. The + * selected availability domain will be provided to the Partner via the + * pairing key so that the provisioned circuit will lie in the specified + * domain. If not specified, the value will default to + * AVAILABILITY_DOMAIN_ANY. + */ + edgeAvailabilityDomain: string; + /** + * [Output Only] Google reference ID, to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * URL of the underlying Interconnect object that this attachment's + * traffic will traverse through. + */ + interconnect: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment + * for interconnect attachments. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this + * InterconnectAttachment, which is essentially a hash of the labels set + * used for optimistic locking. The fingerprint is initially generated by + * Compute Engine and changes after every request to modify or update + * labels. You must always provide an up-to-date fingerprint hash in order + * to update or change labels. To see the latest fingerprint, make a get() + * request to retrieve an InterconnectAttachment. + */ + labelFingerprint: string; + /** + * Labels to apply to this InterconnectAttachment resource. These can be + * later modified by the setLabels method. Each label key/value must comply + * with RFC1035. Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] The current status of whether or not this interconnect + * attachment is functional. + */ + operationalStatus: string; + /** + * [Output only for type PARTNER. Input only for PARTNER_PROVIDER. Not + * present for DEDICATED]. The opaque identifier of an PARTNER attachment + * used to initiate provisioning with a selected partner. Of the form + * "XXXXX/region/domain" + */ + pairingKey: string; + /** + * Optional BGP ASN for the router that should be supplied by a layer 3 + * Partner if they configured BGP on behalf of the customer. Output only for + * PARTNER type, input only for PARTNER_PROVIDER, not available for + * DEDICATED. + */ + partnerAsn: string; + /** + * Informational metadata about Partner attachments from Partners to display + * to customers. Output only for for PARTNER type, mutable for + * PARTNER_PROVIDER, not available for DEDICATED. + */ + partnerMetadata: Schema$InterconnectAttachmentPartnerMetadata; + /** + * [Output Only] Information specific to an InterconnectAttachment. This + * property is populated if the interconnect that this is attached to is of + * type DEDICATED. + */ + privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; + /** + * [Output Only] URL of the region where the regional interconnect + * attachment resides. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + region: string; + /** + * URL of the cloud router to be used for dynamic routing. This router must + * be in the same region as this InterconnectAttachment. The + * InterconnectAttachment will automatically connect the Interconnect to the + * network & region within which the Cloud Router is configured. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The current state of this attachment's functionality. + */ + state: string; + type: string; + /** + * Available only for DEDICATED and PARTNER_PROVIDER. Desired VLAN tag for + * this attachment, in the range 2-4094. This field refers to 802.1q VLAN + * tag, also known as IEEE 802.1Q Only specified at creation time. + */ + vlanTag8021q: number; + } + export interface Schema$InterconnectAttachmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#interconnectAttachmentAggregatedList for aggregated lists of + * interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Response to the list request, and contains a list of interconnect + * attachments. + */ + export interface Schema$InterconnectAttachmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachment resources. + */ + items: Schema$InterconnectAttachment[]; + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList + * for lists of interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zoneOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zoneOperations.list(request, handlePage); - * } - * }; - * - * compute.zoneOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/beta/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Zones { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Informational metadata about Partner attachments from Partners to display + * to customers. These fields are propagated from PARTNER_PROVIDER attachments + * to their corresponding PARTNER attachments. + */ + export interface Schema$InterconnectAttachmentPartnerMetadata { + /** + * Plain text name of the Interconnect this attachment is connected to, as + * displayed in the Partner?s portal. For instance ?Chicago 1?. This value + * may be validated to match approved Partner values. + */ + interconnectName: string; + /** + * Plain text name of the Partner providing this attachment. This value may + * be validated to match approved Partner values. + */ + partnerName: string; + /** + * URL of the Partner?s portal for this Attachment. Partners may customise + * this to be a deep-link to the specific resource on the Partner portal. + * This value may be validated to match approved Partner values. + */ + portalUrl: string; + } + /** + * Information for an interconnect attachment when this belongs to an + * interconnect of type DEDICATED. + */ + export interface Schema$InterconnectAttachmentPrivateInfo { + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between + * Google and the customer, going to and from this network and region. + */ + tag8021q: number; + } + export interface Schema$InterconnectAttachmentsScopedList { + /** + * A list of interconnect attachments contained in this scope. + */ + interconnectAttachments: Schema$InterconnectAttachment[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * Describes a single physical circuit between the Customer and Google. + * CircuitInfo objects are created by Google, so all fields are output only. + * Next id: 4 + */ + export interface Schema$InterconnectCircuitInfo { + /** + * Customer-side demarc ID for this circuit. + */ + customerDemarcId: string; + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + */ + googleCircuitId: string; + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and + * provided by Google to the customer in the LOA. + */ + googleDemarcId: string; + } + /** + * Response to the list request, and contains a list of interconnects. + */ + export interface Schema$InterconnectList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Interconnect resources. + */ + items: Schema$Interconnect[]; + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists + * of interconnects. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents an InterconnectLocations resource. The InterconnectLocations + * resource describes the locations where you can connect to Google's + * networks. For more information, see Colocation Facilities. + */ + export interface Schema$InterconnectLocation { + /** + * [Output Only] The postal address of the Point of Presence, each line in + * the address is separated by a newline character. + */ + address: string; + /** + * [Output Only] Availability zone for this location. Within a metropolitan + * area (metro), maintenance will not be simultaneously scheduled in more + * than one availability zone. Example: "zone1" or + * "zone2". + */ + availabilityZone: string; + /** + * [Output Only] Metropolitan area designator that indicates which city an + * interconnect is located. For example: "Chicago, IL", + * "Amsterdam, Netherlands". + */ + city: string; + /** + * [Output Only] Continent for this location. + */ + continent: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] An optional description of the resource. + */ + description: string; + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + */ + facilityProvider: string; + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., + * Ashburn-DC1). + */ + facilityProviderFacilityId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation + * for interconnect locations. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The peeringdb identifier for this facility (corresponding + * with a netfac type in peeringdb). + */ + peeringdbFacilityId: string; + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that + * describe parameters pertaining to the relation between this + * InterconnectLocation and various Google Cloud regions. + */ + regionInfos: Schema$InterconnectLocationRegionInfo[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Response to the list request, and contains a list of interconnect + * locations. + */ + export interface Schema$InterconnectLocationList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectLocation resources. + */ + items: Schema$InterconnectLocation[]; + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList + * for lists of interconnect locations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Information about any potential InterconnectAttachments between an + * Interconnect at a specific InterconnectLocation, and a specific Cloud + * Region. + */ + export interface Schema$InterconnectLocationRegionInfo { + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation + * to a VM in this region. + */ + expectedRttMs: string; + /** + * Identifies the network presence of this location. + */ + locationPresence: string; + /** + * URL for the region of this location. + */ + region: string; + } + /** + * Description of a planned outage on this Interconnect. Next id: 9 + */ + export interface Schema$InterconnectOutageNotification { + /** + * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit + * IDs that will be affected. + */ + affectedCircuits: string[]; + /** + * A description about the purpose of the outage. + */ + description: string; + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + */ + endTime: string; + /** + * Form this outage is expected to take. Note that the "IT_" + * versions of this enum have been deprecated in favor of the unprefixed + * values. + */ + issueType: string; + /** + * Unique identifier for this outage notification. + */ + name: string; + /** + * The party that generated this notification. Note that + * "NSRC_GOOGLE" has been deprecated in favor of + * "GOOGLE" + */ + source: string; + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + */ + startTime: string; + /** + * State of this notification. Note that the "NS_" versions of + * this enum have been deprecated in favor of the unprefixed values. + */ + state: string; + } + /** + * A license resource. + */ + export interface Schema$License { + /** + * [Output Only] Deprecated. This field no longer reflects whether a license + * charges a usage fee. + */ + chargesUseFee: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#license for licenses. + */ + kind: string; + /** + * [Output Only] The unique code used to attach this license to images, + * snapshots, and disks. + */ + licenseCode: string; + /** + * [Output Only] Name of the resource. The name is 1-63 characters long and + * complies with RFC1035. + */ + name: string; + resourceRequirements: Schema$LicenseResourceRequirements; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If false, licenses will not be copied from the source resource when + * creating an image from a disk, disk from snapshot, or snapshot from disk. + */ + transferable: boolean; + } + export interface Schema$LicenseCode { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + */ + kind: string; + /** + * [Output Only] URL and description aliases of Licenses with the same + * License Code. + */ + licenseAlias: Schema$LicenseCodeLicenseAlias[]; + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and + * must be a valid 64 bit integer. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Current state of this License Code. + */ + state: string; + /** + * [Output Only] If true, the license will remain attached when creating + * images or snapshots from disks. Otherwise, the license is not + * transferred. + */ + transferable: boolean; + } + export interface Schema$LicenseCodeLicenseAlias { + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] URL of license corresponding to this License Code. + */ + selfLink: string; + } + export interface Schema$LicenseResourceRequirements { + /** + * Minimum number of guest cpus required to use the Instance. Enforced at + * Instance creation and Instance start. + */ + minGuestCpuCount: number; + /** + * Minimum memory required to use the Instance. Enforced at Instance + * creation and Instance start. + */ + minMemoryMb: number; + } + export interface Schema$LicensesListResponse { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of License resources. + */ + items: Schema$License[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Specifies what kind of log the caller must write + */ + export interface Schema$LogConfig { + /** + * Cloud audit options. + */ + cloudAudit: Schema$LogConfigCloudAuditOptions; + /** + * Counter options. + */ + counter: Schema$LogConfigCounterOptions; + /** + * Data access options. + */ + dataAccess: Schema$LogConfigDataAccessOptions; + } + /** + * Write a Cloud Audit log + */ + export interface Schema$LogConfigCloudAuditOptions { + /** + * Information used by the Cloud Audit Logging pipeline. + */ + authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; + /** + * The log_name to populate in the Cloud Audit Record. + */ + logName: string; + } + /** + * Increment a streamz counter with the specified metric and field names. + * Metric names should start with a '/', generally be lowercase-only, + * and end in "_count". Field names should not contain an initial + * slash. The actual exported metric names will have "/iam/policy" + * prepended. Field names correspond to IAM request parameters and field + * values are their respective values. At present the only supported field + * names are - "iam_principal", corresponding to + * IAMContext.principal; - "" (empty string), resulting in one + * aggretated counter with no field. Examples: counter { metric: + * "/debug_access_count" field: "iam_principal" } ==> + * increment counter /iam/policy/backend_debug_access_count + * {iam_principal=[value of IAMContext.principal]} At this time we do not + * support: * multiple field names (though this may be supported in the + * future) * decrementing the counter * incrementing it by anything other than + * 1 + */ + export interface Schema$LogConfigCounterOptions { + /** + * The field value to attribute. + */ + field: string; + /** + * The metric to update. + */ + metric: string; + } + /** + * Write a Data Access (Gin) log + */ + export interface Schema$LogConfigDataAccessOptions { + /** + * Whether Gin logging should happen in a fail-closed manner at the caller. + * This is relevant only in the LocalIAM implementation, for now. + */ + logMode: string; + } + /** + * A Machine Type resource. (== resource_for v1.machineTypes ==) (== + * resource_for beta.machineTypes ==) + */ + export interface Schema$MachineType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this machine type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The number of virtual CPUs that are available to the + * instance. + */ + guestCpus: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core + * machine types for more information. + */ + isSharedCpu: boolean; + /** + * [Output Only] The type of the resource. Always compute#machineType for + * machine types. + */ + kind: string; + /** + * [Output Only] Maximum persistent disks allowed. + */ + maximumPersistentDisks: number; + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + */ + maximumPersistentDisksSizeGb: string; + /** + * [Output Only] The amount of physical memory available to the instance, + * defined in MB. + */ + memoryMb: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the machine type resides, such + * as us-central1-a. + */ + zone: string; + } + export interface Schema$MachineTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList + * for aggregated lists of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of machine types. + */ + export interface Schema$MachineTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineType resources. + */ + items: Schema$MachineType[]; + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists + * of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$MachineTypesScopedList { + /** + * [Output Only] A list of machine types contained in this scope. + */ + machineTypes: Schema$MachineType[]; + /** + * [Output Only] An informational warning that appears when the machine + * types list is empty. + */ + warning: any; + } + /** + * Next available tag: 12 + */ + export interface Schema$ManagedInstance { + /** + * [Output Only] The current action that the managed instance group has + * scheduled for the instance. Possible values: - NONE The instance is + * running, and the managed instance group does not have any scheduled + * actions for this instance. - CREATING The managed instance group is + * creating this instance. If the group fails to create this instance, it + * will try again until it is successful. - CREATING_WITHOUT_RETRIES The + * managed instance group is attempting to create this instance only once. + * If the group fails to create this instance, it does not try again and the + * group's targetSize value is decreased instead. - RECREATING The + * managed instance group is recreating this instance. - DELETING The + * managed instance group is permanently deleting this instance. - + * ABANDONING The managed instance group is abandoning this instance. The + * instance will be removed from the instance group and from any target + * pools that are associated with this group. - RESTARTING The managed + * instance group is restarting the instance. - REFRESHING The managed + * instance group is applying configuration changes to the instance without + * stopping it. For example, the group can update the target pool list for + * an instance without stopping that instance. - VERIFYING The managed + * instance group has created the instance and it is in the process of being + * verified. + */ + currentAction: string; + /** + * [Output only] The unique identifier for this resource. This field is + * empty when instance does not exist. + */ + id: string; + /** + * [Output Only] The URL of the instance. The URL can exist even if the + * instance has not yet been created. + */ + instance: string; + /** + * [Output Only] The status of the instance. This field is empty when the + * instance does not exist. + */ + instanceStatus: string; + /** + * [Output Only] Information about the last attempt to create or delete the + * instance. + */ + lastAttempt: Schema$ManagedInstanceLastAttempt; + /** + * [Output Only] Intended version of this instance. + */ + version: Schema$ManagedInstanceVersion; + } + export interface Schema$ManagedInstanceLastAttempt { + /** + * [Output Only] Encountered errors during the last attempt to create or + * delete the instance. + */ + errors: any; + } + export interface Schema$ManagedInstanceVersion { + /** + * [Output Only] The intended template of the instance. This field is empty + * when current_action is one of { DELETING, ABANDONING }. + */ + instanceTemplate: string; + /** + * [Output Only] Name of the version. + */ + name: string; + } + /** + * A metadata key/value entry. + */ + export interface Schema$Metadata { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. + */ + fingerprint: string; + /** + * Array of key/value pairs. The total size of all keys and values must be + * less than 512 KB. + */ + items: any[]; + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + */ + kind: string; + } + /** + * The named port. For example: . + */ + export interface Schema$NamedPort { + /** + * The name for this named port. The name must be 1-63 characters long, and + * comply with RFC1035. + */ + name: string; + /** + * The port number, which can be a value between 1 and 65535. + */ + port: number; + } + /** + * Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for + * beta.networks ==) + */ + export interface Schema$Network { + /** + * When set to true, the network is created in "auto subnet mode". + * When set to false, the network is in "custom subnet mode". In + * "auto subnet mode", a newly created network is assigned the + * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork + * per region. + */ + autoCreateSubnetworks: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A gateway address for default routing to other networks. This value is + * read only and is selected by the Google Compute Engine, typically as the + * first usable address in the IPv4Range. + */ + gatewayIPv4: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are legal on this network. This + * range is a CIDR specification, for example: 192.168.0.0/16. Provided by + * the client when the network is created. + */ + IPv4Range: string; + /** + * [Output Only] Type of the resource. Always compute#network for networks. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] A list of network peerings for the resource. + */ + peerings: Schema$NetworkPeering[]; + /** + * The network-level routing configuration for this network. Used by Cloud + * Router to determine what type of network-wide routing behavior to + * enforce. + */ + routingConfig: Schema$NetworkRoutingConfig; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in + * this network. + */ + subnetworks: string[]; + } + /** + * A network interface resource attached to an instance. + */ + export interface Schema$NetworkInterface { + /** + * An array of configurations for this interface. Currently, only one access + * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs + * specified, then this instance will have no external internet access. + */ + accessConfigs: Schema$AccessConfig[]; + /** + * An array of alias IP ranges for this network interface. Can only be + * specified for network interfaces on subnet-mode networks. + */ + aliasIpRanges: Schema$AliasIpRange[]; + /** + * Fingerprint hash of contents stored in this network interface. This field + * will be ignored when inserting an Instance or adding a NetworkInterface. + * An up-to-date fingerprint must be provided in order to update the + * NetworkInterface. + */ + fingerprint: string; + /** + * [Output Only] Type of the resource. Always compute#networkInterface for + * network interfaces. + */ + kind: string; + /** + * [Output Only] The name of the network interface, generated by the server. + * For network devices, these are eth0, eth1, etc. + */ + name: string; + /** + * URL of the network resource for this instance. When creating an instance, + * if neither the network nor the subnetwork is specified, the default + * network global/networks/default is used; if the network is not specified + * but the subnetwork is specified, the network is inferred. This field is + * optional when creating a firewall rule. If not specified when creating a + * firewall rule, the default network global/networks/default is used. If + * you specify this property, you can specify the network as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/global/networks/network + * - projects/project/global/networks/network - global/networks/default + */ + network: string; + /** + * An IPv4 internal network address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + */ + networkIP: string; + /** + * The URL of the Subnetwork resource for this instance. If the network + * resource is in legacy mode, do not provide this property. If the network + * is in auto subnet mode, providing the subnetwork is optional. If the + * network is in custom subnet mode, then this field should be specified. If + * you specify this property, you can specify the subnetwork as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + * - regions/region/subnetworks/subnetwork + */ + subnetwork: string; + } + /** + * Contains a list of networks. + */ + export interface Schema$NetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Network resources. + */ + items: Schema$Network[]; + /** + * [Output Only] Type of resource. Always compute#networkList for lists of + * networks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A network peering attached to a network resource. The message includes the + * peering name, peer network, peering state, and a flag indicating whether + * Google Compute Engine should automatically create routes for the peering. + */ + export interface Schema$NetworkPeering { + /** + * Whether full mesh connectivity is created and managed automatically. When + * it is set to true, Google Compute Engine will automatically create and + * manage the routes between two networks when the state is ACTIVE. + * Otherwise, user needs to create routes manually to route packets to peer + * network. + */ + autoCreateRoutes: boolean; + /** + * Name of this peering. Provided by the client when the peering is created. + * The name must comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all the + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + */ + name: string; + /** + * The URL of the peer network. It can be either full URL or partial URL. + * The peer network may belong to a different project. If the partial URL + * does not contain project, it is assumed that the peer network is in the + * same project as the current network. + */ + network: string; + /** + * [Output Only] State for the peering. + */ + state: string; + /** + * [Output Only] Details about the current state of the peering. + */ + stateDetails: string; + } + /** + * A routing configuration attached to a network resource. The message + * includes the list of routers associated with the network, and a flag + * indicating the type of routing behavior to enforce network-wide. + */ + export interface Schema$NetworkRoutingConfig { + /** + * The network-wide routing mode to use. If set to REGIONAL, this + * network's cloud routers will only advertise routes with subnetworks + * of this network in the same region as the router. If set to GLOBAL, this + * network's cloud routers will advertise routes with all subnetworks of + * this network, across regions. + */ + routingMode: string; + } + export interface Schema$NetworksAddPeeringRequest { + /** + * Whether Google Compute Engine manages the routes automatically. + */ + autoCreateRoutes: boolean; + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + /** + * URL of the peer network. It can be either full URL or partial URL. The + * peer network may belong to a different project. If the partial URL does + * not contain project, it is assumed that the peer network is in the same + * project as the current network. + */ + peerNetwork: string; + } + export interface Schema$NetworksRemovePeeringRequest { + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + } + /** + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; + } + export interface Schema$OperationAggregatedList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A map of scoped operation lists. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#operationAggregatedList + * for aggregated lists of operations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Operation resources. + */ + export interface Schema$OperationList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of Operation resources. + */ + items: Schema$Operation[]; + /** + * [Output Only] Type of resource. Always compute#operations for Operations + * resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$OperationsScopedList { + /** + * [Output Only] A list of operations contained in this scope. + */ + operations: Schema$Operation[]; + /** + * [Output Only] Informational warning which replaces the list of operations + * when the list is empty. + */ + warning: any; + } + /** + * A matcher for the path portion of the URL. The BackendService from the + * longest-matched rule will serve the URL. If no rule was matched, the + * default service will be used. + */ + export interface Schema$PathMatcher { + /** + * The full or partial URL to the BackendService resource. This will be used + * if none of the pathRules defined by this PathMatcher is matched by the + * URL's path portion. For example, the following are all valid URLs to + * a BackendService resource: - + * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + * - compute/v1/projects/project/global/backendServices/backendService - + * global/backendServices/backendService + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The name to which this PathMatcher is referred by the HostRule. + */ + name: string; + /** + * The list of path rules. + */ + pathRules: Schema$PathRule[]; + } + /** + * A path-matching rule for a URL. If matched, will use the specified + * BackendService to handle the traffic arriving at this URL. + */ + export interface Schema$PathRule { + /** + * The list of path patterns to match. Each must start with / and the only + * place a * is allowed is at the end following a /. The string fed to the + * path matcher does not include any text after the first ? or #, and those + * chars are not allowed here. + */ + paths: string[]; + /** + * The URL of the BackendService resource if this rule is matched. + */ + service: string; + } + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { "role": + * "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } For a description of IAM and its + * features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + iamOwned: boolean; + /** + * If more than one rule is specified, the rules are applied in the + * following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be + * applied if one or more matching rule requires logging. - Otherwise, if + * any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging + * will be applied if one or more matching rule requires logging. - + * Otherwise, if no rule applies, permission is denied. + */ + rules: Schema$Rule[]; + /** + * Deprecated. + */ + version: number; + } + /** + * A Project resource. For an overview of projects, see Cloud Platform + * Resource Hierarchy. (== resource_for v1.projects ==) (== resource_for + * beta.projects ==) + */ + export interface Schema$Project { + /** + * Metadata key/value pairs available to all instances contained in this + * project. See Custom metadata for more information. + */ + commonInstanceMetadata: Schema$Metadata; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * This signifies the default network tier used for configuring resources of + * the project and can only take the following values: PREMIUM, STANDARD. + * Initially the default network tier is PREMIUM. + */ + defaultNetworkTier: string; + /** + * [Output Only] Default service account used by VMs running in this + * project. + */ + defaultServiceAccount: string; + /** + * An optional textual description of the resource. + */ + description: string; + /** + * Restricted features enabled for use on this project. + */ + enabledFeatures: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. This is not the project ID, and is just a unique + * ID used by Compute Engine to identify resources. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#project for projects. + */ + kind: string; + /** + * The project ID. For example: my-example-project. Use the project ID to + * make requests to Compute Engine. + */ + name: string; + /** + * [Output Only] Quotas assigned to this project. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The naming prefix for daily usage reports and the Google Cloud Storage + * bucket where they are stored. + */ + usageExportLocation: Schema$UsageExportLocation; + /** + * [Output Only] The role this project has in a shared VPC configuration. + * Currently only HOST projects are differentiated. + */ + xpnProjectStatus: string; + } + export interface Schema$ProjectsDisableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsEnableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsGetXpnResources { + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources + * for lists of service resources (a.k.a service projects) + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * Service resources (a.k.a service projects) attached to this project as + * their shared VPC host. + */ + resources: Schema$XpnResourceId[]; + } + export interface Schema$ProjectsListXpnHostsRequest { + /** + * Optional organization ID managed by Cloud Resource Manager, for which to + * list shared VPC host projects. If not specified, the organization will be + * inferred from the project. + */ + organization: string; + } + export interface Schema$ProjectsSetDefaultNetworkTierRequest { + /** + * Default network tier to be set. + */ + networkTier: string; + } + /** + * A quotas entry. + */ + export interface Schema$Quota { + /** + * [Output Only] Quota limit for this metric. + */ + limit: number; + /** + * [Output Only] Name of the quota metric. + */ + metric: string; + /** + * [Output Only] Current usage of this metric. + */ + usage: number; + } + /** + * Represents a reference to a resource. + */ + export interface Schema$Reference { + /** + * [Output Only] Type of the resource. Always compute#reference for + * references. + */ + kind: string; + /** + * A description of the reference type with no implied semantics. Possible + * values include: - MEMBER_OF + */ + referenceType: string; + /** + * URL of the resource which refers to the target. + */ + referrer: string; + /** + * URL of the resource to which this reference points. + */ + target: string; + } + /** + * Region resource. (== resource_for beta.regions ==) (== resource_for + * v1.regions ==) + */ + export interface Schema$Region { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this region. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#region for regions. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Quotas assigned to this region. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the region, either UP or DOWN. + */ + status: string; + /** + * [Output Only] A list of zones available in this region, in the form of + * resource URLs. + */ + zones: string[]; + } + /** + * Contains a list of autoscalers. + */ + export interface Schema$RegionAutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionDisksResizeRequest { + /** + * The new size of the regional persistent disk, which is specified in GB. + */ + sizeGb: string; + } + export interface Schema$RegionDiskTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskType resources. + */ + items: Schema$DiskType[]; + /** + * [Output Only] Type of resource. Always compute#regionDiskTypeList for + * region disk types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of InstanceGroup resources. + */ + export interface Schema$RegionInstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of managed instance groups. + */ + export interface Schema$RegionInstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups + * that exist in th regional scope. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersListInstancesResponse { + /** + * A list of managed instances. + */ + managedInstances: Schema$ManagedInstance[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + } + export interface Schema$RegionInstanceGroupManagersRecreateRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetAutoHealingRequest { + autoHealingPolicies: Schema$InstanceGroupManagerAutoHealingPolicy[]; + } + export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { + /** + * Fingerprint of the target pools information, which is a hash of the + * contents. This field is used for optimistic locking when you update the + * target pool entries. This field is optional. + */ + fingerprint: string; + /** + * The URL of all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { + /** + * URL of the InstanceTemplate resource from which all new instances will be + * created. + */ + instanceTemplate: string; + } + export interface Schema$RegionInstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupsListInstancesRequest { + /** + * Instances in which state should be returned. Valid options are: + * 'ALL', 'RUNNING'. By default, it lists all instances. + */ + instanceState: string; + /** + * Name of port user is interested in. It is optional. If it is set, only + * information about this ports will be returned. If it is not set, all the + * named ports will be returned. Always lists all instances. + */ + portName: string; + } + export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of region resources. + */ + export interface Schema$RegionList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Region resources. + */ + items: Schema$Region[]; + /** + * [Output Only] Type of resource. Always compute#regionList for lists of + * regions. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash in order to update or + * change labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * The labels to set for this resource. + */ + labels: any; + } + /** + * Commitment for a particular resource (a Commitment is composed of one or + * more of these). + */ + export interface Schema$ResourceCommitment { + /** + * The amount of the resource purchased (in a type-dependent unit, such as + * bytes). For vCPUs, this can just be an integer. For memory, this must be + * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of + * memory per every vCPU. + */ + amount: string; + /** + * Type of resource for which this commitment applies. Possible values are + * VCPU and MEMORY + */ + type: string; + } + export interface Schema$ResourceGroupReference { + /** + * A URI referencing one of the instance groups listed in the backend + * service. + */ + group: string; + } + /** + * Represents a Route resource. A route specifies how certain packets should + * be handled by the network. Routes are associated with instances by tags and + * the set of routes for a particular instance is called its routing table. + * For each packet leaving an instance, the system searches that + * instance's routing table for a single best matching route. Routes match + * packets by destination IP address, preferring smaller or more specific + * ranges over larger ones. If there is a tie, the system selects the route + * with the smallest priority value. If there is still a tie, it uses the + * layer three and four packet headers to select just one of the remaining + * matching routes. The packet is then forwarded as specified by the nextHop + * field of the winning route - either to another instance destination, an + * instance gateway, or a Google Compute Engine-operated gateway. Packets + * that do not match any route in the sending instance's routing table are + * dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) + */ + export interface Schema$Route { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The destination range of outgoing packets that this route applies to. + * Only IPv4 is supported. + */ + destRange: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of this resource. Always compute#routes for Route + * resources. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Fully-qualified URL of the network that this route applies to. + */ + network: string; + /** + * The URL to a gateway that should handle matching packets. You can only + * specify the internet gateway using a full or partial valid URL: + * projects/<project-id>/global/gateways/default-internet-gateway + */ + nextHopGateway: string; + /** + * The URL to an instance that should handle matching packets. You can + * specify this as a full or partial URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + */ + nextHopInstance: string; + /** + * The network IP address of an instance that should handle matching + * packets. Only IPv4 is supported. + */ + nextHopIp: string; + /** + * The URL of the local network if it should handle matching packets. + */ + nextHopNetwork: string; + /** + * [Output Only] The network peering name that should handle matching + * packets, which should conform to RFC1035. + */ + nextHopPeering: string; + /** + * The URL to a VpnTunnel that should handle matching packets. + */ + nextHopVpnTunnel: string; + /** + * The priority of this route. Priority is used to break ties in cases where + * there is more than one matching route of equal prefix length. In the case + * of two routes with equal prefix length, the one with the lowest-numbered + * priority value wins. Default value is 1000. Valid range is 0 through + * 65535. + */ + priority: number; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * A list of instance tags to which this route applies. + */ + tags: string[]; + /** + * [Output Only] If potential misconfigurations are detected for this route, + * this field will be populated with warning messages. + */ + warnings: any[]; + } + /** + * Contains a list of Route resources. + */ + export interface Schema$RouteList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Route resources. + */ + items: Schema$Route[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Router resource. + */ + export interface Schema$Router { + /** + * BGP information specific to this router. + */ + bgp: Schema$RouterBgp; + /** + * BGP information that needs to be configured into the routing stack to + * establish the BGP peering. It must specify peer ASN and either interface + * name, IP, or peer IP. Please refer to RFC4273. + */ + bgpPeers: Schema$RouterBgpPeer[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Router interfaces. Each interface requires either one linked resource + * (e.g. linkedVpnTunnel), or IP address and IP address range (e.g. + * ipRange), or both. + */ + interfaces: Schema$RouterInterface[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URI of the network to which this router belongs. + */ + network: string; + /** + * [Output Only] URI of the region where the router resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Description-tagged IP ranges for the router to advertise. + */ + export interface Schema$RouterAdvertisedIpRange { + /** + * User-specified description for the IP range. + */ + description: string; + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + */ + range: string; + } + /** + * Contains a list of routers. + */ + export interface Schema$RouterAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RouterBgp { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and is advertised + * to all peers of the router. These groups will be advertised in addition + * to any specified prefixes. Leave this field blank to advertise no custom + * groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and is + * advertised to all peers of the router. These IP ranges will be advertised + * in addition to any specified groups. Leave this field blank to advertise + * no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, + * either 16-bit or 32-bit. The value will be fixed for this router + * resource. All VPN tunnels that link to this router will have the same + * local ASN. + */ + asn: number; + } + export interface Schema$RouterBgpPeer { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and overrides the + * list defined for the router (in Bgp message). These groups will be + * advertised in addition to any specified prefixes. Leave this field blank + * to advertise no custom groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and + * overrides the list defined for the router (in Bgp message). These IP + * ranges will be advertised in addition to any specified groups. Leave this + * field blank to advertise no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * The priority of routes advertised to this BGP peer. In the case where + * there is more than one matching route of maximum length, the routes with + * lowest priority value win. + */ + advertisedRoutePriority: number; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Name of the interface the BGP peer is associated with. + */ + interfaceName: string; + /** + * IP address of the interface inside Google Cloud Platform. Only IPv4 is + * supported. + */ + ipAddress: string; + /** + * [Output Only] Type of how the resource/configuration of the BGP peer is + * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT + * represents an BGP peer that is automatically created for PARTNER + * interconnectAttachment, Google will automatically create/delete this type + * of BGP peer when the PARTNER interconnectAttachment is created/deleted. + */ + managementType: string; + /** + * Name of this BGP peer. The name must be 1-63 characters long and comply + * with RFC1035. + */ + name: string; + /** + * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can + * be different for every tunnel. + */ + peerAsn: number; + /** + * IP address of the BGP interface outside Google cloud. Only IPv4 is + * supported. + */ + peerIpAddress: string; + } + export interface Schema$RouterInterface { + /** + * IP address and range of the interface. The IP range must be in the + * RFC3927 link-local IP space. The value must be a CIDR-formatted string, + * for example: 169.254.0.1/30. NOTE: Do not truncate the address as it + * represents the IP address of the interface. + */ + ipRange: string; + /** + * URI of the linked interconnect attachment. It must be in the same region + * as the router. Each interface can have at most one linked resource and it + * could either be a VPN Tunnel or an interconnect attachment. + */ + linkedInterconnectAttachment: string; + /** + * URI of the linked VPN tunnel. It must be in the same region as the + * router. Each interface can have at most one linked resource and it could + * either be a VPN Tunnel or an interconnect attachment. + */ + linkedVpnTunnel: string; + /** + * [Output Only] Type of how the resource/configuration of the interface is + * managed. MANAGED_BY_USER is the default value; MANAGED_BY_ATTACHMENT + * represents an interface that is automatically created for PARTNER type + * interconnectAttachment, Google will automatically create/update/delete + * this type of interface when the PARTNER interconnectAttachment is + * created/provisioned/deleted. + */ + managementType: string; + /** + * Name of this interface entry. The name must be 1-63 characters long and + * comply with RFC1035. + */ + name: string; + } + /** + * Contains a list of Router resources. + */ + export interface Schema$RouterList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: Schema$Router[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RoutersPreviewResponse { + /** + * Preview of given router. + */ + resource: Schema$Router; + } + export interface Schema$RoutersScopedList { + /** + * A list of routers contained in this scope. + */ + routers: Schema$Router[]; + /** + * Informational warning which replaces the list of routers when the list is + * empty. + */ + warning: any; + } + export interface Schema$RouterStatus { + /** + * Best routes for this router's network. + */ + bestRoutes: Schema$Route[]; + /** + * Best routes learned by this router. + */ + bestRoutesForRouter: Schema$Route[]; + bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; + /** + * URI of the network to which this router belongs. + */ + network: string; + } + export interface Schema$RouterStatusBgpPeerStatus { + /** + * Routes that were advertised to the remote BGP peer + */ + advertisedRoutes: Schema$Route[]; + /** + * IP address of the local BGP interface. + */ + ipAddress: string; + /** + * URL of the VPN tunnel that this BGP peer controls. + */ + linkedVpnTunnel: string; + /** + * Name of this BGP peer. Unique within the Routers resource. + */ + name: string; + /** + * Number of routes learned from the remote BGP Peer. + */ + numLearnedRoutes: number; + /** + * IP address of the remote BGP interface. + */ + peerIpAddress: string; + /** + * BGP state as specified in RFC1771. + */ + state: string; + /** + * Status of the BGP peer: {UP, DOWN} + */ + status: string; + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 + * hours, 59 minutes, 59 seconds + */ + uptime: string; + /** + * Time this session has been up, in seconds. Format: 145 + */ + uptimeSeconds: string; + } + export interface Schema$RouterStatusResponse { + /** + * Type of resource. + */ + kind: string; + result: Schema$RouterStatus; + } + /** + * A rule to be applied in a Policy. + */ + export interface Schema$Rule { + /** + * Required + */ + action: string; + /** + * Additional restrictions that must be met. All conditions must pass for + * the rule to match. + */ + conditions: Schema$Condition[]; + /** + * Human-readable description of the rule. + */ + description: string; + /** + * If one or more 'in' clauses are specified, the rule matches if + * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + */ + ins: string[]; + /** + * The config returned to callers of tech.iam.IAM.CheckPolicy for any + * entries that match the LOG action. + */ + logConfigs: Schema$LogConfig[]; + /** + * If one or more 'not_in' clauses are specified, the rule matches + * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + */ + notIns: string[]; + /** + * A permission is a string of form '..' (e.g., + * 'storage.buckets.list'). A value of '*' matches all + * permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions: string[]; + } + /** + * Sets the scheduling options for an Instance. + */ + export interface Schema$Scheduling { + /** + * Specifies whether the instance should be automatically restarted if it is + * terminated by Compute Engine (not terminated by a user). You can only set + * the automatic restart option for standard instances. Preemptible + * instances cannot be automatically restarted. By default, this is set to + * true so an instance is automatically restarted if it is terminated by + * Compute Engine. + */ + automaticRestart: boolean; + /** + * Defines the maintenance behavior for this instance. For standard + * instances, the default behavior is MIGRATE. For preemptible instances, + * the default and only possible behavior is TERMINATE. For more + * information, see Setting Instance Scheduling Options. + */ + onHostMaintenance: string; + /** + * Defines whether the instance is preemptible. This can only be set during + * instance creation, it cannot be set or changed after the instance has + * been created. + */ + preemptible: boolean; + } + /** + * A security policy is comprised of one or more rules. It can also be + * associated with one or more 'targets'. + */ + export interface Schema$SecurityPolicy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Specifies a fingerprint for this resource, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. To + * see the latest fingerprint, make get() request to the security policy. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output only] Type of the resource. Always compute#securityPolicyfor + * security policies + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A list of rules that belong to this policy. There must always be a + * default rule (rule with priority 2147483647 and match "*"). If + * no rules are provided when creating a security policy, a default rule + * with action "allow" will be added. + */ + rules: Schema$SecurityPolicyRule[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$SecurityPolicyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SecurityPolicy resources. + */ + items: Schema$SecurityPolicy[]; + /** + * [Output Only] Type of resource. Always compute#securityPolicyList for + * listsof securityPolicies + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SecurityPolicyReference { securityPolicy: string; } + /** + * Represents a rule that describes one or more match conditions along with + * the action to be taken when traffic matches this condition (allow or deny). + */ + export interface Schema$SecurityPolicyRule { + /** + * The Action to preform when the client connection triggers the rule. Can + * currently be either "allow" or "deny()" where valid + * values for status are 403, 404, and 502. + */ + action: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output only] Type of the resource. Always compute#securityPolicyRule for + * security policy rules + */ + kind: string; + /** + * A match condition that incoming traffic is evaluated against. If it + * evaluates to true, the corresponding ?action? is enforced. + */ + match: Schema$SecurityPolicyRuleMatcher; + /** + * If set to true, the specified action is not enforced. + */ + preview: boolean; + /** + * An integer indicating the priority of a rule in the list. The priority + * must be a positive value between 0 and 2147483647. Rules are evaluated in + * the increasing order of priority. + */ + priority: number; + } + /** + * Represents a match condition that incoming traffic is evaluated against. + * Exactly one field must be specified. + */ + export interface Schema$SecurityPolicyRuleMatcher { + /** + * The configuration options available when specifying versioned_expr. This + * field must be specified if versioned_expr is specified and cannot be + * specified if versioned_expr is not specified. + */ + config: Schema$SecurityPolicyRuleMatcherConfig; + /** + * User defined CEVAL expression. A CEVAL expression is used to specify + * match criteria such as origin.ip, source.region_code and contents in the + * request header. + */ + expr: Schema$Expr; + /** + * CIDR IP address range. + */ + srcIpRanges: string[]; + /** + * Preconfigured versioned expression. If this field is specified, config + * must also be specified. Available preconfigured expressions along with + * their requirements are: SRC_IPS_V1 - must specify the corresponding + * src_ip_range field in config. + */ + versionedExpr: string; + } + export interface Schema$SecurityPolicyRuleMatcherConfig { + /** + * CIDR IP address range. + */ + srcIpRanges: string[]; + } + /** + * An instance's serial console output. + */ + export interface Schema$SerialPortOutput { + /** + * [Output Only] The contents of the console output. + */ + contents: string; + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for + * serial port output. + */ + kind: string; + /** + * [Output Only] The position of the next byte of content from the serial + * console output. Use this value in the next request as the start + * parameter. + */ + next: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * The starting byte position of the output that was returned. This should + * match the start parameter sent with the request. If the serial console + * output exceeds the size of the buffer, older output will be overwritten + * by newer content and the start values will be mismatched. + */ + start: string; + } + /** + * A service account. + */ + export interface Schema$ServiceAccount { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + /** + * Represents a customer-supplied Signing Key used by Cloud CDN Signed URLs + */ + export interface Schema$SignedUrlKey { + /** + * Name of the key. The name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match + * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ + keyName: string; + /** + * 128-bit key value used for signing the URL. The key value must be a valid + * RFC 4648 Section 5 base64url encoded string. + */ + keyValue: string; + } + /** + * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) + * (== resource_for v1.snapshots ==) + */ + export interface Schema$Snapshot { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Size of the snapshot, specified in GB. + */ + diskSizeGb: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot + * resources. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this snapshot, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a snapshot. + */ + labelFingerprint: string; + /** + * Labels to apply to this snapshot. These can be later modified by the + * setLabels method. Label values may be empty. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * snapshot. + */ + licenseCodes: string[]; + /** + * [Output Only] A list of public visible licenses that apply to this + * snapshot. This can be because the original image had licenses attached + * (such as a Windows image). + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Encrypts the snapshot using a customer-supplied encryption key. After + * you encrypt a snapshot using a customer-supplied key, you must provide + * the same key if you use the image later For example, you must provide the + * encryption key when you create a disk from the encrypted snapshot in a + * future request. Customer-supplied encryption keys do not protect access + * to metadata of the disk. If you do not provide an encryption key when + * creating the snapshot, then the snapshot will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the snapshot later. + */ + snapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The source disk used to create this snapshot. + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This + * value may be used to determine whether the snapshot was taken from the + * current or a previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, + * FAILED, READY, or UPLOADING. + */ + status: string; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots + * share storage, this number is expected to change with snapshot + * creation/deletion. + */ + storageBytes: string; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or + * it is being adjusted as a result of shared storage reallocation. This + * status can either be UPDATING, meaning the size of the snapshot is being + * updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + */ + storageBytesStatus: string; + } + /** + * Contains a list of Snapshot resources. + */ + export interface Schema$SnapshotList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Snapshot resources. + */ + items: Schema$Snapshot[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A specification of the parameters to use when creating the instance + * template from a source instance. + */ + export interface Schema$SourceInstanceParams { + /** + * Attached disks configuration. If not provided, defaults are applied: For + * boot disk and any other R/W disks, new custom images will be created from + * each disk. For read-only disks, they will be attached in read-only mode. + * Local SSD disks will be created as blank volumes. + */ + diskConfigs: Schema$DiskInstantiationConfig[]; + } + /** + * An SslCertificate resource. This resource provides a mechanism to upload an + * SSL key and certificate to the load balancer to serve secure connections + * from the user. (== resource_for beta.sslCertificates ==) (== resource_for + * v1.sslCertificates ==) + */ + export interface Schema$SslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The + * certificate chain must be no greater than 5 certs long. The chain must + * include at least one intermediate cert. + */ + certificate: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL + * certificates. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A write-only private key in PEM format. Only insert requests will include + * this field. + */ + privateKey: string; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Contains a list of SslCertificate resources. + */ + export interface Schema$SslCertificateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslCertificate resources. + */ + items: Schema$SslCertificate[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SSLHealthCheck { + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the SSL connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$SslPoliciesList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslPolicy resources. + */ + items: Schema$SslPolicy[]; + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for + * lists of sslPolicies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SslPoliciesListAvailableFeaturesResponse { + features: string[]; + } + /** + * A SSL policy specifies the server-side support for SSL features. This can + * be attached to a TargetHttpsProxy or a TargetSslProxy. This affects + * connections between clients and the HTTPS or SSL proxy load balancer. They + * do not affect the connection between the load balancers and the backends. + */ + export interface Schema$SslPolicy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * A list of features enabled when the selected profile is CUSTOM. The - + * method returns the set of features that can be specified in this list. + * This field must be empty if the profile is not CUSTOM. + */ + customFeatures: string[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The list of features enabled in the SSL policy. + */ + enabledFeatures: string[]; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a SslPolicy. An up-to-date fingerprint must be + * provided in order to update the SslPolicy. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL + * policies. + */ + kind: string; + /** + * The minimum version of SSL protocol that can be used by the clients to + * establish a connection with the load balancer. This can be one of + * TLS_1_0, TLS_1_1, TLS_1_2. + */ + minTlsVersion: string; + /** + * Name of the resource. The name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * Profile specifies the set of SSL features that can be used by the load + * balancer when negotiating SSL with clients. This can be one of + * COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of + * SSL features to enable must be specified in the customFeatures field. + */ + profile: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] If potential misconfigurations are detected for this SSL + * policy, this field will be populated with warning messages. + */ + warnings: any[]; + } + export interface Schema$SslPolicyReference { + /** + * URL of the SSL policy resource. Set this to empty string to clear any + * existing SSL policy associated with the target proxy resource. + */ + sslPolicy: string; + } + /** + * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) + */ + export interface Schema$Subnetwork { + /** + * Whether this subnetwork can conflict with static routes. Setting this to + * true allows this subnetwork's primary and secondary ranges to + * conflict with routes that have already been configured on the + * corresponding network. Static routes will take precedence over the + * subnetwork route if the route prefix length is at least as large as the + * subnetwork prefix length. Also, packets destined to IPs within + * subnetwork may contain private/sensitive data and are prevented from + * leaving the virtual network. Setting this field to true will disable this + * feature. The default value is false and applies to all existing + * subnetworks and automatically created subnetworks. This field cannot be + * set to true at resource creation time. + */ + allowSubnetCidrRoutesOverlap: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. This field can be set only at resource creation + * time. + */ + description: string; + /** + * Whether to enable flow logging for this subnetwork. + */ + enableFlowLogs: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a Subnetwork. An up-to-date fingerprint must be + * provided in order to update the Subnetwork. + */ + fingerprint: string; + /** + * [Output Only] The gateway address for default routes to reach destination + * addresses outside this subnetwork. + */ + gatewayAddress: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are owned by this subnetwork. + * Provide this property when you create the subnetwork. For + * example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + * non-overlapping within a network. Only IPv4 is supported. This field can + * be set only at resource creation time. + */ + ipCidrRange: string; + /** + * [Output Only] Type of the resource. Always compute#subnetwork for + * Subnetwork resources. + */ + kind: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match + * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ + name: string; + /** + * The URL of the network to which this subnetwork belongs, provided by the + * client when initially creating the subnetwork. Only networks that are in + * the distributed mode can have subnetworks. This field can be set only at + * resource creation time. + */ + network: string; + /** + * Whether the VMs in this subnet can access Google services without + * assigned external IP addresses. This field can be both set at resource + * creation time and updated using setPrivateIpGoogleAccess. + */ + privateIpGoogleAccess: boolean; + /** + * URL of the region where the Subnetwork resides. This field can be set + * only at resource creation time. + */ + region: string; + /** + * An array of configurations for secondary IP ranges for VM instances + * contained in this subnetwork. The primary IP of such VM must belong to + * the primary ipCidrRange of the subnetwork. The alias IPs may belong to + * either primary or secondary ranges. + */ + secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$SubnetworkAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SubnetworksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList + * for aggregated lists of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Subnetwork resources. + */ + export interface Schema$SubnetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Subnetwork resources. + */ + items: Schema$Subnetwork[]; + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists + * of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a secondary IP range of a subnetwork. + */ + export interface Schema$SubnetworkSecondaryRange { + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * Provide this property when you create the subnetwork. Ranges must be + * unique and non-overlapping with all primary and secondary IP ranges + * within a network. Only IPv4 is supported. + */ + ipCidrRange: string; + /** + * The name associated with this subnetwork secondary range, used when + * adding an alias IP range to a VM instance. The name must be 1-63 + * characters long, and comply with RFC1035. The name must be unique within + * the subnetwork. + */ + rangeName: string; + } + export interface Schema$SubnetworksExpandIpCidrRangeRequest { + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal + * on this Subnetwork. This range should be disjoint from other subnetworks + * within this network. This range can only be larger than (i.e. a superset + * of) the range previously defined before the update. + */ + ipCidrRange: string; + } + export interface Schema$SubnetworksScopedList { + /** + * A list of subnetworks contained in this scope. + */ + subnetworks: Schema$Subnetwork[]; + /** + * An informational warning that appears when the list of addresses is + * empty. + */ + warning: any; + } + export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { + privateIpGoogleAccess: boolean; + } + /** + * A set of instance tags. + */ + export interface Schema$Tags { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. To + * see the latest fingerprint, make get() request to the instance. + */ + fingerprint: string; + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with + * RFC1035. + */ + items: string[]; + } + /** + * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== + * resource_for beta.targetHttpProxies ==) (== resource_for + * v1.targetHttpProxies ==) + */ + export interface Schema$TargetHttpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target + * HTTP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the UrlMap resource that defines the mapping from URL to the + * BackendService. + */ + urlMap: string; } - - /** - * compute.zones.get - * @desc Returns the specified Zone resource. Get a list of available zones by - * making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone resource to return. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of TargetHttpProxy resources. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TargetHttpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpProxy resources. + */ + items: Schema$TargetHttpProxy[]; + /** + * Type of resource. Always compute#targetHttpProxyList for lists of target + * HTTP proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetHttpsProxiesSetQuicOverrideRequest { + /** + * QUIC policy for the TargetHttpsProxy resource. + */ + quicOverride: string; + } + export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { + /** + * New set of SslCertificate resources to associate with this + * TargetHttpsProxy resource. Currently exactly one SslCertificate resource + * must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== + * resource_for beta.targetHttpsProxies ==) (== resource_for + * v1.targetHttpsProxies ==) + */ + export interface Schema$TargetHttpsProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for + * target HTTPS proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the QUIC override policy for this TargetHttpsProxy resource. + * This determines whether the load balancer will attempt to negotiate QUIC + * with clients or not. Can specify one of NONE, ENABLE, or DISABLE. Specify + * ENABLE to always enable QUIC, Enables QUIC when set to ENABLE, and + * disables QUIC when set to DISABLE. If NONE is specified, uses the QUIC + * policy with no user overrides, which is equivalent to DISABLE. Not + * specifying this field is equivalent to specifying NONE. + */ + quicOverride: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections between users and the load balancer. Currently, exactly one + * SSL certificate must be specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the + * TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will + * not have any SSL policy configured. + */ + sslPolicy: string; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that + * defines the mapping from URL to the BackendService. For example, the + * following are all valid URLs for specifying a URL map: - + * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + */ + urlMap: string; + } + /** + * Contains a list of TargetHttpsProxy resources. + */ + export interface Schema$TargetHttpsProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpsProxy resources. + */ + items: Schema$TargetHttpsProxy[]; + /** + * Type of resource. Always compute#targetHttpsProxyList for lists of target + * HTTPS proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A TargetInstance resource. This resource defines an endpoint instance that + * terminates traffic of certain protocols. (== resource_for + * beta.targetInstances ==) (== resource_for v1.targetInstances ==) + */ + export interface Schema$TargetInstance { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A URL to the virtual machine instance that handles traffic for this + * target instance. When creating a target instance, you can provide the + * fully-qualified URL or a valid partial URL to the desired virtual + * machine. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + instance: string; + /** + * [Output Only] The type of the resource. Always compute#targetInstance for + * target instances. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * NAT option controlling how IPs are NAT'ed to the instance. Currently + * only NO_NAT (default value) is supported. + */ + natPolicy: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] URL of the zone where the target instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$TargetInstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetInstance resources. + */ + export interface Schema$TargetInstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: Schema$TargetInstance[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetInstancesScopedList { + /** + * A list of target instances contained in this scope. + */ + targetInstances: Schema$TargetInstance[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * A TargetPool resource. This resource defines a pool of instances, an + * associated HttpHealthCheck resource, and the fallback target pool. (== + * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) + */ + export interface Schema$TargetPool { + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool, and its failoverRatio field is + * properly set to a value between [0, 1]. backupPool and failoverRatio + * together define the fallback behavior of the primary target pool: if the + * ratio of the healthy instances in the primary pool is at or below + * failoverRatio, traffic arriving at the load-balanced IP will be directed + * to the backup pool. In case where failoverRatio and backupPool are not + * set, or all the instances in the backup pool are unhealthy, the traffic + * will be directed back to the primary pool in the "force" mode, + * where traffic will be spread to the healthy instances with the best + * effort, or to all instances when no instance is healthy. + */ + backupPool: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool (i.e., not as a backup pool to some + * other target pool). The value of the field must be in [0, 1]. If set, + * backupPool must also be set. They together define the fallback behavior + * of the primary target pool: if the ratio of the healthy instances in the + * primary pool is at or below this number, traffic arriving at the + * load-balanced IP will be directed to the backup pool. In case where + * failoverRatio is not set or all the instances in the backup pool are + * unhealthy, the traffic will be directed back to the primary pool in the + * "force" mode, where traffic will be spread to the healthy + * instances with the best effort, or to all instances when no instance is + * healthy. + */ + failoverRatio: number; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool + * is considered healthy if and only if the health checks pass. An empty + * list means all member instances will be considered healthy at all times. + * Only HttpHealthChecks are supported. Only one health check may be + * specified. + */ + healthChecks: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A list of resource URLs to the virtual machine instances serving this + * pool. They must live in zones contained in the same region as this pool. + */ + instances: string[]; + /** + * [Output Only] Type of the resource. Always compute#targetPool for target + * pools. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the target pool resides. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Sesssion affinity option, must be one of the following values: NONE: + * Connections from the same client IP may go to any instance in the pool. + * CLIENT_IP: Connections from the same client IP will go to the same + * instance in the pool while that instance remains healthy. + * CLIENT_IP_PROTO: Connections from the same client IP with the same IP + * protocol will go to the same instance in the pool while that instance + * remains healthy. + */ + sessionAffinity: string; + } + export interface Schema$TargetPoolAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList + * for aggregated lists of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolInstanceHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth + * when checking the health of an instance. + */ + kind: string; + } + /** + * Contains a list of TargetPool resources. + */ + export interface Schema$TargetPoolList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: Schema$TargetPool[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists + * of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolsAddHealthCheckRequest { + /** + * The HttpHealthCheck to add to the target pool. + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsAddInstanceRequest { + /** + * A full or partial URL to an instance to add to this target pool. This can + * be a full or partial URL. For example, the following are valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + * - projects/project-id/zones/zone/instances/instance-name - + * zones/zone/instances/instance-name + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsRemoveHealthCheckRequest { + /** + * Health check URL to be removed. This can be a full or valid partial URL. + * For example, the following are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + * - projects/project/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsRemoveInstanceRequest { + /** + * URLs of the instances to be removed from target pool. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsScopedList { + /** + * A list of target pools contained in this scope. + */ + targetPools: Schema$TargetPool[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$TargetReference { target: string; } + export interface Schema$TargetSslProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetSslProxy. + */ + service: string; + } + export interface Schema$TargetSslProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + export interface Schema$TargetSslProxiesSetSslCertificatesRequest { + /** + * New set of URLs to SslCertificate resources to associate with this + * TargetSslProxy. Currently exactly one ssl certificate must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetSslProxy resource. This resource defines an SSL proxy. (== + * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies + * ==) + */ + export interface Schema$TargetSslProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for + * target SSL proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections to Backends. Currently exactly one SSL certificate must be + * specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy + * resource. If not set, the TargetSslProxy resource will not have any SSL + * policy configured. + */ + sslPolicy: string; + } + /** + * Contains a list of TargetSslProxy resources. + */ + export interface Schema$TargetSslProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetSslProxy resources. + */ + items: Schema$TargetSslProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetTcpProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetTcpProxy. + */ + service: string; + } + export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + /** + * A TargetTcpProxy resource. This resource defines a TCP proxy. (== + * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies + * ==) + */ + export interface Schema$TargetTcpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for + * target TCP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + } + /** + * Contains a list of TargetTcpProxy resources. + */ + export interface Schema$TargetTcpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetTcpProxy resources. + */ + items: Schema$TargetTcpProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a Target VPN gateway resource. (== resource_for + * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) + */ + export interface Schema$TargetVpnGateway { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. + * ForwardingRules are created using compute.forwardingRules.insert and + * associated to a VPN gateway. + */ + forwardingRules: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this TargetVpnGateway, + * which is essentially a hash of the labels set used for optimistic + * locking. The fingerprint is initially generated by Compute Engine and + * changes after every request to modify or update labels. You must always + * provide an up-to-date fingerprint hash in order to update or change + * labels. To see the latest fingerprint, make a get() request to retrieve + * an TargetVpnGateway. + */ + labelFingerprint: string; + /** + * Labels to apply to this TargetVpnGateway resource. These can be later + * modified by the setLabels method. Each label key/value must comply with + * RFC1035. Label values may be empty. + */ + labels: any; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network to which this VPN gateway is attached. Provided by the + * client when the VPN gateway is created. + */ + network: string; + /** + * [Output Only] URL of the region where the target VPN gateway resides. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the VPN gateway. + */ + status: string; + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are + * created using compute.vpntunnels.insert method and associated to a VPN + * gateway. + */ + tunnels: string[]; + } + export interface Schema$TargetVpnGatewayAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetVpnGateway resources. + */ + export interface Schema$TargetVpnGatewayList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: Schema$TargetVpnGateway[]; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetVpnGatewaysScopedList { + /** + * [Output Only] A list of target vpn gateways contained in this scope. + */ + targetVpnGateways: Schema$TargetVpnGateway[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + export interface Schema$TCPHealthCheck { + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the TCP connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$TestFailure { + actualService: string; + expectedService: string; + host: string; + path: string; + } + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; + } + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } + export interface Schema$UDPHealthCheck { + /** + * The UDP port number for the health check request. Valid values are 1 + * through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Raw data of request to send in payload of UDP packet. It is an error if + * this is empty. The request data can only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. It is an + * error if this is empty. The response data can only be ASCII. + */ + response: string; + } + /** + * A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the + * URL's host and path. + */ + export interface Schema$UrlMap { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The URL of the BackendService resource if none of the hostRules match. + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a UrlMap. An up-to-date fingerprint must be + * provided in order to update the UrlMap. + */ + fingerprint: string; + /** + * The list of HostRules to use against the URL. + */ + hostRules: Schema$HostRule[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The list of named PathMatchers to use against the URL. + */ + pathMatchers: Schema$PathMatcher[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The list of expected URL mapping tests. Request to update this UrlMap + * will succeed only if all of the test cases pass. You can specify a + * maximum of 100 tests per UrlMap. + */ + tests: Schema$UrlMapTest[]; + } + /** + * Contains a list of UrlMap resources. + */ + export interface Schema$UrlMapList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of UrlMap resources. + */ + items: Schema$UrlMap[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$UrlMapReference { urlMap: string; } + export interface Schema$UrlMapsValidateRequest { + /** + * Content of the UrlMap to be validated. + */ + resource: Schema$UrlMap; + } + export interface Schema$UrlMapsValidateResponse { + result: Schema$UrlMapValidationResult; + } + /** + * Message for the expected URL mappings. + */ + export interface Schema$UrlMapTest { + /** + * Description of this test case. + */ + description: string; + /** + * Host portion of the URL. + */ + host: string; + /** + * Path portion of the URL. + */ + path: string; + /** + * Expected BackendService resource the given URL should be mapped to. + */ + service: string; + } + /** + * Message representing the validation result for a UrlMap. + */ + export interface Schema$UrlMapValidationResult { + loadErrors: string[]; + /** + * Whether the given UrlMap can be successfully loaded. If false, + * 'loadErrors' indicates the reasons. + */ + loadSucceeded: boolean; + testFailures: Schema$TestFailure[]; + /** + * If successfully loaded, this field indicates whether the test passed. If + * false, 'testFailures's indicate the reason of failure. + */ + testPassed: boolean; + } + /** + * Subnetwork which the current user has compute.subnetworks.use permission + * on. + */ + export interface Schema$UsableSubnetwork { + /** + * The range of internal addresses that are owned by this subnetwork. + */ + ipCidrRange: string; + /** + * Network URL. + */ + network: string; + /** + * Subnetwork URL. + */ + subnetwork: string; + } + export interface Schema$UsableSubnetworksAggregatedList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output] A list of usable subnetwork URLs. + */ + items: Schema$UsableSubnetwork[]; + /** + * [Output Only] Type of resource. Always + * compute#usableSubnetworksAggregatedList for aggregated lists of usable + * subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * The location in Cloud Storage and naming method of the daily usage report. + * Contains bucket_name and report_name prefix. + */ + export interface Schema$UsageExportLocation { + /** + * The name of an existing bucket in Cloud Storage where the usage report + * object is stored. The Google Service Account is granted write access to + * this bucket. This can either be the bucket name by itself, such as + * example-bucket, or the bucket name with gs:// or + * https://storage.googleapis.com/ in front of it, such as + * gs://example-bucket. + */ + bucketName: string; + /** + * An optional prefix for the name of the usage report object stored in + * bucketName. If not supplied, defaults to usage. The report is stored as a + * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the + * day of the usage according to Pacific Time. If you supply a prefix, it + * should conform to Cloud Storage object naming conventions. + */ + reportNamePrefix: string; + } + /** + * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for + * v1.vpnTunnels ==) + */ + export interface Schema$VpnTunnel { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Detailed status message for the VPN tunnel. + */ + detailedStatus: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * IKE protocol version to use when establishing the VPN tunnel with peer + * VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. + */ + ikeVersion: number; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this VpnTunnel, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a VpnTunnel. + */ + labelFingerprint: string; + /** + * Labels to apply to this VpnTunnel. These can be later modified by the + * setLabels method. Each label key/value pair must comply with RFC1035. + * Label values may be empty. + */ + labels: any; + /** + * Local traffic selector to use when establishing the VPN tunnel with peer + * VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + localTrafficSelector: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + */ + peerIp: string; + /** + * [Output Only] URL of the region where the VPN tunnel resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with + * peer VPN gateway. The value should be a CIDR formatted string, for + * example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is + * supported. + */ + remoteTrafficSelector: string[]; + /** + * URL of router resource to be used for dynamic routing. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Shared secret used to set the secure session between the Cloud VPN + * gateway and the peer VPN gateway. + */ + sharedSecret: string; + /** + * Hash of the shared secret. + */ + sharedSecretHash: string; + /** + * [Output Only] The status of the VPN tunnel. + */ + status: string; + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. + * Provided by the client when the VPN tunnel is created. + */ + targetVpnGateway: string; + } + export interface Schema$VpnTunnelAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnelsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of VpnTunnel resources. + */ + export interface Schema$VpnTunnelList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnel resources. + */ + items: Schema$VpnTunnel[]; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$VpnTunnelsScopedList { + /** + * A list of vpn tunnels contained in this scope. + */ + vpnTunnels: Schema$VpnTunnel[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$XpnHostList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * [Output Only] A list of shared VPC host project URLs. + */ + items: Schema$Project[]; + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of + * shared VPC hosts. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zones.list - * @desc Retrieves the list of Zone resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('beta'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zones.list(request, handlePage); - * } - * }; - * - * compute.zones.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Service resource (a.k.a service project) ID. */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/beta/projects/{project}/zones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$XpnResourceId { + /** + * The ID of the service resource. In the case of projects, this field + * matches the project ID (e.g., my-project), not the project number (e.g., + * 12345678). + */ + id: string; + /** + * The type of the service resource. + */ + type: string; + } + /** + * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones + * ==) + */ + export interface Schema$Zone { + /** + * [Output Only] Available cpu/platform selections for the zone. + */ + availableCpuPlatforms: string[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this zone. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Full URL reference to the region which hosts the zone. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the zone, either UP or DOWN. + */ + status: string; + } + /** + * Contains a list of zone resources. + */ + export interface Schema$ZoneList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Zone resources. + */ + items: Schema$Zone[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ZoneSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash in order to update or + * change labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * The labels to set for this resource. + */ + labels: any; + } + + export class Resource$Acceleratortypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.acceleratorTypes.aggregatedList + * @desc Retrieves an aggregated list of accelerator types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.acceleratorTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.acceleratorTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.acceleratorTypes.get + * @desc Returns the specified accelerator type. Get a list of available + * accelerator types by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the accelerator type to return. + * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.acceleratorTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.acceleratorType Name of the accelerator type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'acceleratorType'], + pathParams: ['acceleratorType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.acceleratorTypes.list + * @desc Retrieves a list of accelerator types available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.acceleratorTypes.list(request, handlePage); + * } + * }; + * + * compute.acceleratorTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Addresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.addresses.aggregatedList + * @desc Retrieves an aggregated list of addresses. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.addresses.aggregatedList(request, handlePage); + * } + * }; + * + * compute.addresses.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.delete + * @desc Deletes the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the address resource to delete. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.addresses.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.get + * @desc Returns the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the address resource to return. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.addresses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.addresses.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.list + * @desc Retrieves a list of addresses contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.addresses.list(request, handlePage); + * } + * }; + * + * compute.addresses.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.setLabels + * @desc Sets the labels on an Address. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.addresses.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.addresses.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/addresses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Autoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.autoscalers.aggregatedList + * @desc Retrieves an aggregated list of autoscalers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.autoscalers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.autoscalers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.delete + * @desc Deletes the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the autoscaler to delete. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.autoscalers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.get + * @desc Returns the specified autoscaler resource. Get a list of available + * autoscalers by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the autoscaler to return. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.autoscalers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.autoscalers.list(request, handlePage); + * } + * }; + * + * compute.autoscalers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.testIamPermissions(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendbuckets { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendBuckets.addSignedUrlKey + * @desc Adds the given Signed URL Key to the backend bucket. + * @alias compute.backendBuckets.addSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SignedUrlKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}/addSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.delete + * @desc Deletes the specified BackendBucket resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to delete. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendBuckets.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.deleteSignedUrlKey + * @desc Deletes the given Signed URL Key from the backend bucket. + * @alias compute.backendBuckets.deleteSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.keyName The name of the Signed URL Key to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}/deleteSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendBucket', 'keyName'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.get + * @desc Returns the specified BackendBucket resource. Get a list of + * available backend buckets by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to return. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendBuckets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.insert + * @desc Creates a BackendBucket resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.list + * @desc Retrieves the list of BackendBucket resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendBuckets.list(request, handlePage); + * } + * }; + * + * compute.backendBuckets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.patch + * @desc Updates the specified BackendBucket resource with the data included + * in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to patch. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.update + * @desc Updates the specified BackendBucket resource with the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to update. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendServices.addSignedUrlKey + * @desc Adds the given Signed URL Key to the specified backend service. + * @alias compute.backendServices.addSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SignedUrlKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}/addSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.aggregatedList + * @desc Retrieves the list of all BackendService resources, regional and + * global, available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the project scoping this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendServices.aggregatedList(request, handlePage); + * } + * }; + * + * compute.backendServices.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Name of the project scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.backendServices.delete + * @desc Deletes the specified BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to delete. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendServices.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.deleteSignedUrlKey + * @desc Deletes the given Signed URL Key from the specified backend + * service. + * @alias compute.backendServices.deleteSignedUrlKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the Signed URL Key should be added. The name should conform to RFC1035. + * @param {string} params.keyName The name of the Signed URL Key to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteSignedUrlKey(params?: any, options?: MethodOptions): + AxiosPromise; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteSignedUrlKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}/deleteSignedUrlKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService', 'keyName'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.get + * @desc Returns the specified BackendService resource. Get a list of + * available backend services by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to return. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendServices.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.getHealth + * @desc Gets the most recent health check results for this BackendService. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to which the queried instance + * belongs. backendService: 'my-backend-service', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.getHealth(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. + * @param {string} params.project + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.insert + * @desc Creates a BackendService resource in the specified project using + * the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a backend service. Read + * Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.list + * @desc Retrieves the list of BackendService resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendServices.list(request, handlePage); + * } + * }; + * + * compute.backendServices.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.patch + * @desc Patches the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to patch. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.setSecurityPolicy + * @desc Sets the security policy for the specified backend service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to which the security policy + * should be set. The name should + * // conform to RFC1035. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.setSecurityPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.setSecurityPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the security policy should be set. The name should conform to RFC1035. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SecurityPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSecurityPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSecurityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSecurityPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}/setSecurityPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.update + * @desc Updates the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to update. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.disks.aggregatedList + * @desc Retrieves an aggregated list of persistent disks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.disks.aggregatedList(request, handlePage); + * } + * }; + * + * compute.disks.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.createSnapshot + * @desc Creates a snapshot of a specified persistent disk. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to snapshot. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.createSnapshot(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.createSnapshot + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to snapshot. + * @param {boolean=} params.guestFlush + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Snapshot} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSnapshot(params?: any, options?: MethodOptions): + AxiosPromise; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.delete + * @desc Deletes the specified persistent disk. Deleting a disk removes its + * data permanently and is irreversible. However, deleting a disk does not + * delete any snapshots previously made from the disk. You must separately + * delete snapshots. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to delete. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.disks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.get + * @desc Returns a specified persistent disk. Get a list of available + * persistent disks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to return. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.disks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.insert + * @desc Creates a persistent disk in the specified project using the data + * in the request. You can create a disk with a sourceImage, a + * sourceSnapshot, or create an empty 500 GB data disk by omitting all + * properties. You can also create a disk that is larger than the default + * size by specifying the sizeGb property. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. + * @param {string} params.zone The name of the zone for this request. + * @param {().Disk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.list + * @desc Retrieves a list of persistent disks contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.disks.list(request, handlePage); + * } + * }; + * + * compute.disks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.resize + * @desc Resizes the specified persistent disk. You can only increase the + * size of the disk. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the persistent disk. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.resize(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk The name of the persistent disk. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().DisksResizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{disk}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.setLabels + * @desc Sets the labels on a disk. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().ZoneSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/disks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disktypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.diskTypes.aggregatedList + * @desc Retrieves an aggregated list of disk types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.diskTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.diskTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.get + * @desc Returns the specified disk type. Get a list of available disk types + * by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the disk type to return. + * diskType: 'my-disk-type', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.diskTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.diskType Name of the disk type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/diskTypes/{diskType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'diskType'], + pathParams: ['diskType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.list + * @desc Retrieves a list of disk types available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.diskTypes.list(request, handlePage); + * } + * }; + * + * compute.diskTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Firewalls { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.firewalls.delete + * @desc Deletes the specified firewall. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to delete. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.firewalls.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.get + * @desc Returns the specified firewall. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to return. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.firewalls.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.insert + * @desc Creates a firewall rule in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.list + * @desc Retrieves the list of firewall rules available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.firewalls.list(request, handlePage); + * } + * }; + * + * compute.firewalls.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.patch + * @desc Updates the specified firewall rule with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to patch. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/firewalls/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.update + * @desc Updates the specified firewall rule with the data included in the + * request. The PUT method can only update the following fields of firewall + * rule: allowed, description, sourceRanges, sourceTags, targetTags. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to update. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Forwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.forwardingRules.aggregatedList + * @desc Retrieves an aggregated list of forwarding rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.forwardingRules.aggregatedList(request, handlePage); + * } + * }; + * + * compute.forwardingRules.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.forwardingRules.delete + * @desc Deletes the specified ForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to delete. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.forwardingRules.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.get + * @desc Returns the specified ForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to return. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.forwardingRules.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.insert + * @desc Creates a ForwardingRule resource in the specified project and + * region using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.list + * @desc Retrieves a list of ForwardingRule resources available to the + * specified project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.forwardingRules.list(request, handlePage); + * } + * }; + * + * compute.forwardingRules.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.setLabels + * @desc Sets the labels on the specified resource. To learn more about + * labels, read the Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.setTarget + * @desc Changes target URL for forwarding rule. The new target should be of + * the same type as the old target. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.setTarget(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/forwardingRules/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaladdresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalAddresses.delete + * @desc Deletes the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the address resource to delete. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalAddresses.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.get + * @desc Returns the specified address resource. Get a list of available + * addresses by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the address resource to return. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalAddresses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalAddresses.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.list + * @desc Retrieves a list of global addresses. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalAddresses.list(request, handlePage); + * } + * }; + * + * compute.globalAddresses.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.setLabels + * @desc Sets the labels on a GlobalAddress. To learn more about labels, + * read the Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalAddresses.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/addresses/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalAddresses.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/addresses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globalforwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalForwardingRules.delete + * @desc Deletes the specified GlobalForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to delete. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.get + * @desc Returns the specified GlobalForwardingRule resource. Get a list of + * available forwarding rules by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to return. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.insert + * @desc Creates a GlobalForwardingRule resource in the specified project + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.list + * @desc Retrieves a list of GlobalForwardingRule resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalForwardingRules.list(request, handlePage); + * } + * }; + * + * compute.globalForwardingRules.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.setLabels + * @desc Sets the labels on the specified resource. To learn more about + * labels, read the Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.setLabels(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.setTarget + * @desc Changes target URL for the GlobalForwardingRule resource. The new + * target should be of the same type as the old target. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.setTarget(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/forwardingRules/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaloperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalOperations.aggregatedList + * @desc Retrieves an aggregated list of all operations. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalOperations.aggregatedList(request, handlePage); + * } + * }; + * + * compute.globalOperations.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.delete + * @desc Deletes the specified Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.get + * @desc Retrieves the specified Operations resource. Get a list of + * operations by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalOperations.list(request, handlePage); + * } + * }; + * + * compute.globalOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Healthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.healthChecks.delete + * @desc Deletes the specified HealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to delete. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.healthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.get + * @desc Returns the specified HealthCheck resource. Get a list of available + * health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to return. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.healthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.insert + * @desc Creates a HealthCheck resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.list + * @desc Retrieves the list of HealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.healthChecks.list(request, handlePage); + * } + * }; + * + * compute.healthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.patch + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to patch. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.update + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to update. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httphealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpHealthChecks.delete + * @desc Deletes the specified HttpHealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to delete. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.get + * @desc Returns the specified HttpHealthCheck resource. Get a list of + * available HTTP health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to return. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.insert + * @desc Creates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.list + * @desc Retrieves the list of HttpHealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.httpHealthChecks.list(request, handlePage); + * } + * }; + * + * compute.httpHealthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.patch + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to patch. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.update + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to update. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httpshealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpsHealthChecks.delete + * @desc Deletes the specified HttpsHealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to delete. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.get + * @desc Returns the specified HttpsHealthCheck resource. Get a list of + * available HTTPS health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to return. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.insert + * @desc Creates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.list + * @desc Retrieves the list of HttpsHealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.httpsHealthChecks.list(request, handlePage); + * } + * }; + * + * compute.httpsHealthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.patch + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to patch. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.update + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to update. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Images { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.images.delete + * @desc Deletes the specified image. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image resource to delete. + * image: 'my-image', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.deprecate + * @desc Sets the deprecation status of an image. If an empty request body + * is given, clears the deprecation status instead. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Image name. + * image: 'my-image', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.deprecate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.deprecate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Image name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DeprecationStatus} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deprecate(params?: any, options?: MethodOptions): + AxiosPromise; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/images/{image}/deprecate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.get + * @desc Returns the specified image. Get a list of available images by + * making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image resource to return. + * image: 'my-image', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.getFromFamily + * @desc Returns the latest image that is part of an image family and is not + * deprecated. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image family to search for. + * family: 'my-family', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.getFromFamily(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.getFromFamily + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.family Name of the image family to search for. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getFromFamily(params?: any, options?: MethodOptions): + AxiosPromise; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/images/family/{family}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'family'], + pathParams: ['family', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.insert + * @desc Creates an image in the specified project using the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.forceCreate Force image creation if true. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Image} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.list + * @desc Retrieves the list of custom images available to the specified + * project. Custom images are images you create that belong to your project. + * This method does not get any images that belong to other projects, + * including publicly-available images, like Debian 8. If you want to get a + * list of publicly-available images, use this method to make a request to + * the respective image project, such as debian-cloud or windows-cloud. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.images.list(request, handlePage); + * } + * }; + * + * compute.images.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.setLabels + * @desc Sets the labels on an image. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/images/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/images/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.abandonInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.aggregatedList + * @desc Retrieves the list of managed instance groups and groups them by + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. Note that the instance group must not belong to + * a backend service. Read Deleting an instance group for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group to delete. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.deleteInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. Gets a list of available managed instance groups by making a + * list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A managed instance group can have up to + * 1000 VM instances per group. Please contact Cloud Support if you need an + * increase in this limit. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the managed instance + * group. zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.list + * @desc Retrieves a list of managed instance groups that are contained + * within the specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroupManagers.list(request, handlePage); + * } + * }; + * + * compute.instanceGroupManagers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.listManagedInstances + * @desc Lists all of the instances in the managed instance group. Each + * instance in the list has a currentAction, which indicates the action that + * the managed instance group is performing on the instance. For example, if + * the group is still creating an instance, the currentAction is CREATING. + * If a previous action failed, the list displays the errors for that failed + * action. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var managedInstancesPage = response['managedInstances']; + * if (!managedInstancesPage) { + * return; + * } + * for (var i = 0; i < managedInstancesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `managedInstancesPage`: + * console.log(JSON.stringify(managedInstancesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroupManagers.listManagedInstances(request, + * handlePage); + * } + * }; + * + * compute.instanceGroupManagers.listManagedInstances(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.patch + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is patched even if the instances in the group are still in the process of + * being patched. You must separately verify the status of the individual + * instances with the listManagedInstances method. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the managed instance + * group. zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group manager. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.recreateInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.resize + * @desc Resizes the managed instance group. If you increase the size, the + * group creates new instances using the current instance template. If you + * decrease the size, the group deletes instances. The resize operation is + * marked DONE when the resize actions are scheduled even if the group has + * not yet added or deleted any instances. You must separately verify the + * status of the creating or deleting actions with the listmanagedinstances + * method. If the group is part of a backend service that has enabled + * connection draining, it can take up to 60 seconds after the connection + * draining duration has elapsed before the VM instance is removed or + * deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * // The number of running instances that the managed instance group + * should maintain at any given time. + * // The group automatically adds or removes instances to maintain the + * number of instances specified by + * // this parameter. + * size: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.resize(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.resizeAdvanced + * @desc Resizes the managed instance group with advanced configuration + * options like disabling creation retries. This is an extended version of + * the resize method. If you increase the size of the instance group, the + * group creates new instances using the current instance template. If you + * decrease the size, the group deletes instances. The resize operation is + * marked DONE when the resize actions are scheduled even if the group has + * not yet added or deleted any instances. You must separately verify the + * status of the creating, creatingWithoutRetries, or deleting actions with + * the get or listmanagedinstances method. If the group is part of a + * backend service that has enabled connection draining, it can take up to + * 60 seconds after the connection draining duration has elapsed before the + * VM instance is removed or deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.resizeAdvanced(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.resizeAdvanced + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersResizeAdvancedRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resizeAdvanced(params?: any, options?: MethodOptions): + AxiosPromise; + resizeAdvanced( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resizeAdvanced( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resizeAdvanced') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setAutoHealingPolicies + * @desc Modifies the autohealing policies. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group manager. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.setAutoHealingPolicies(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.setAutoHealingPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetAutoHealingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoHealingPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setInstanceTemplate + * @desc Specifies the instance template to use when creating new instances + * in this group. The templates for existing instances in the group do not + * change unless you recreate them. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.setInstanceTemplate(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all instances in this managed + * instance group are assigned. The target pools automatically apply to all + * of the instances in the managed instance group. This operation is marked + * DONE when you make the request even if the instances have not yet been + * added to their target pools. The change might take some time to apply to + * all of the instances in the group depending on the size of the group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.setTargetPools(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.update + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is updated even if the instances in the group have not yet been updated. + * You must separately verify the status of the individual instances with + * the listManagedInstances method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the managed instance + * group. zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group manager. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroups.addInstances + * @desc Adds a list of instances to the specified instance group. All of + * the instances in the instance group must be in the same + * network/subnetwork. Read Adding instances for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where you are adding instances. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.addInstances(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.addInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where you are adding instances. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstances(params?: any, options?: MethodOptions): + AxiosPromise; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.aggregatedList + * @desc Retrieves the list of instance groups and sorts them by zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instanceGroups.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.delete + * @desc Deletes the specified instance group. The instances in the group + * are not deleted. Note that instance group must not belong to a backend + * service. Read Deleting an instance group for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group to delete. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.instanceGroups.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.get + * @desc Returns the specified instance group. Get a list of available + * instance groups by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.instanceGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.insert + * @desc Creates an instance group in the specified project using the + * parameters that are included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the instance group. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the instance group. + * @param {().InstanceGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.list + * @desc Retrieves the list of instance groups that are located in the + * specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.list(request, handlePage); + * } + * }; + * + * compute.instanceGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.listInstances + * @desc Lists the instances in the specified instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group from which you want to generate a + * list of included instances. instanceGroup: 'my-instance-group', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.listInstances(request, handlePage); + * } + * }; + * + * compute.instanceGroups.listInstances(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.removeInstances + * @desc Removes one or more instances from the specified instance group, + * but does not delete those instances. If the group is part of a backend + * service that has enabled connection draining, it can take up to 60 + * seconds after the connection draining duration before the VM instance is + * removed or deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where the specified instances will + * be removed. instanceGroup: 'my-instance-group', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.removeInstances(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.removeInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstances(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.setNamedPorts + * @desc Sets the named ports for the specified instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where the named ports are updated. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.setNamedPorts(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instanceGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instances.addAccessConfig + * @desc Adds an access config to an instance's network interface. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the network interface to add to this instance. + * networkInterface: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.addAccessConfig(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.addAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to add to this instance. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.aggregatedList + * @desc Retrieves aggregated list of instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instances.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instances.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.attachDisk + * @desc Attaches an existing Disk resource to an instance. You must first + * create the disk before you can attach it. It is not possible to create + * and attach a disk at the same time. For more information, read Adding a + * persistent disk to your instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.attachDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.attachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.forceAttach Whether to force attach the disk even if it's currently attached to another instance. This is only available for regional disks. + * @param {string} params.instance The instance name for this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AttachedDisk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + attachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.delete + * @desc Deletes the specified Instance resource. For more information, see + * Stopping or Deleting an Instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to delete. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.deleteAccessConfig + * @desc Deletes an access config from an instance's network interface. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the access config to delete. + * accessConfig: '', // TODO: Update placeholder value. + * + * // The name of the network interface. + * networkInterface: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.deleteAccessConfig(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.deleteAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accessConfig The name of the access config to delete. + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.detachDisk + * @desc Detaches a disk from an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // Disk device name to detach. + * deviceName: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.detachDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.detachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceName Disk device name to detach. + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.get + * @desc Returns the specified Instance resource. Get a list of available + * instances by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to return. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.getSerialPortOutput + * @desc Returns the specified instance's serial port output. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.getSerialPortOutput(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.getSerialPortOutput + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSerialPortOutput(params?: any, options?: MethodOptions): + AxiosPromise; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/serialPort') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.insert + * @desc Creates an instance resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate + * @param {string} params.zone The name of the zone for this request. + * @param {().Instance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.list + * @desc Retrieves the list of instances contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instances.list(request, handlePage); + * } + * }; + * + * compute.instances.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.listReferrers + * @desc Retrieves the list of referrers to instances contained within the + * specified zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the target instance scoping this request, or '-' if the + * request should span over all + * // instances in the container. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instances.listReferrers(request, handlePage); + * } + * }; + * + * compute.instances.listReferrers(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.listReferrers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listReferrers(params?: any, options?: MethodOptions): + AxiosPromise; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/referrers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.reset + * @desc Performs a reset on the instance. For more information, see + * Resetting an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.reset(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDeletionProtection + * @desc Sets deletion protection on the instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.setDeletionProtection(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setDeletionProtection + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDeletionProtection(params?: any, options?: MethodOptions): + AxiosPromise; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDiskAutoDelete + * @desc Sets the auto-delete flag for a disk attached to an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // Whether to auto-delete the disk when the instance is deleted. + * autoDelete: false, // TODO: Update placeholder value. + * + * // The device name of the disk to modify. + * deviceName: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.setDiskAutoDelete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setDiskAutoDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param {string} params.deviceName The device name of the disk to modify. + * @param {string} params.instance The instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDiskAutoDelete(params?: any, options?: MethodOptions): + AxiosPromise; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setLabels + * @desc Sets labels on an instance. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineResources + * @desc Changes the number and/or type of accelerator for a stopped + * instance to the values specified in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMachineResources(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMachineResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineResources(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineType + * @desc Changes the machine type for a stopped instance to the machine type + * specified in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMachineType(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMachineType + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineTypeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineType(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMetadata + * @desc Sets metadata for the specified instance to the data included in + * the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMetadata(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMinCpuPlatform + * @desc Changes the minimum CPU platform that this instance should use. + * This method can only be called on a stopped instance. For more + * information, read Specifying a Minimum CPU Platform. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMinCpuPlatform(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMinCpuPlatform + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMinCpuPlatform(params?: any, options?: MethodOptions): + AxiosPromise; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setScheduling + * @desc Sets an instance's scheduling options. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setScheduling(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setScheduling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Scheduling} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setScheduling(params?: any, options?: MethodOptions): + AxiosPromise; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setServiceAccount + * @desc Sets the service account on the instance. For more information, + * read Changing the service account and access scopes for an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setServiceAccount(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetServiceAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setTags + * @desc Sets tags for the specified instance to the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setTags(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setTags + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Tags} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTags(params?: any, options?: MethodOptions): + AxiosPromise; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/setTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.simulateMaintenanceEvent + * @desc Simulates a maintenance event on the instance. + * @alias compute.instances.simulateMaintenanceEvent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + simulateMaintenanceEvent(params?: any, options?: MethodOptions): + AxiosPromise; + simulateMaintenanceEvent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + simulateMaintenanceEvent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/simulateMaintenanceEvent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.start + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.start(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.startWithEncryptionKey + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.startWithEncryptionKey(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.startWithEncryptionKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startWithEncryptionKey(params?: any, options?: MethodOptions): + AxiosPromise; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.stop + * @desc Stops a running instance, shutting it down cleanly, and allows you + * to restart the instance at a later time. Stopped instances do not incur + * VM usage charges while they are stopped. However, resources that the VM + * is using, such as persistent disks and static IP addresses, will continue + * to be charged until they are deleted. For more information, see Stopping + * an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to stop. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.stop(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to stop. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateAccessConfig + * @desc Updates the specified access config from an instance's network + * interface with the data included in the request. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the network interface where the access config is + * attached. networkInterface: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.updateAccessConfig(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.updateAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface where the access config is attached. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateNetworkInterface + * @desc Updates an instance's network interface. This method follows PATCH + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the network interface to update. + * networkInterface: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.updateNetworkInterface(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.updateNetworkInterface + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NetworkInterface} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateNetworkInterface(params?: any, options?: MethodOptions): + AxiosPromise; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancetemplates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceTemplates.delete + * @desc Deletes the specified instance template. Deleting an instance + * template is permanent and cannot be undone. It's not possible to delete + * templates which are in use by an instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the instance template to delete. + * instanceTemplate: 'my-instance-template', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.get + * @desc Returns the specified instance template. Gets a list of available + * instance templates by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the instance template. + * instanceTemplate: 'my-instance-template', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.insert + * @desc Creates an instance template in the specified project using the + * data that is included in the request. If you are creating a new template + * to update an existing instance group, your new instance template must use + * the same network or, if applicable, the same subnetwork as the original + * template. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.list + * @desc Retrieves a list of instance templates that are contained within + * the specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceTemplates.list(request, handlePage); + * } + * }; + * + * compute.instanceTemplates.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/instanceTemplates/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectattachments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectAttachments.aggregatedList + * @desc Retrieves an aggregated list of interconnect attachments. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectAttachments.aggregatedList(request, + * handlePage); + * } + * }; + * + * compute.interconnectAttachments.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.interconnectAttachments.delete + * @desc Deletes the specified interconnect attachment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the interconnect attachment to delete. + * interconnectAttachment: 'my-interconnect-attachment', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.delete(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.get + * @desc Returns the specified interconnect attachment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the interconnect attachment to return. + * interconnectAttachment: 'my-interconnect-attachment', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.insert + * @desc Creates an InterconnectAttachment in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.insert(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InterconnectAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.list + * @desc Retrieves the list of interconnect attachments contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectAttachments.list(request, handlePage); + * } + * }; + * + * compute.interconnectAttachments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.patch + * @desc Updates the specified interconnect attachment with the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @alias compute.interconnectAttachments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InterconnectAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.setLabels + * @desc Sets the labels on an InterconnectAttachment. To learn more about + * labels, read the Labeling Resources documentation. + * @alias compute.interconnectAttachments.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.testIamPermissions(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/interconnectAttachments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectlocations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectLocations.get + * @desc Returns the details for the specified interconnect location. Get a + * list of available interconnect locations by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect location to return. + * interconnectLocation: 'my-interconnect-location', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectLocations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectLocations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectLocation Name of the interconnect location to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnectLocations/{interconnectLocation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnectLocation'], + pathParams: ['interconnectLocation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectLocations.list + * @desc Retrieves the list of interconnect locations available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectLocations.list(request, handlePage); + * } + * }; + * + * compute.interconnectLocations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectLocations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnectLocations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnects.delete + * @desc Deletes the specified interconnect. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to delete. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnects.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.get + * @desc Returns the specified interconnect. Get a list of available + * interconnects by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to return. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.insert + * @desc Creates a Interconnect in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnects.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.list + * @desc Retrieves the list of interconnect available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnects.list(request, handlePage); + * } + * }; + * + * compute.interconnects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.patch + * @desc Updates the specified interconnect with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to update. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnects.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.setLabels + * @desc Sets the labels on an Interconnect. To learn more about labels, + * read the Labeling Resources documentation. + * @alias compute.interconnects.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnects/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnects.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/interconnects/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licensecodes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenseCodes.get + * @desc Return a specified license code. License codes are mirrored across + * all projects that have permissions to read the License Code. + * @alias compute.licenseCodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.licenseCode Number corresponding to the License code resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/licenseCodes/{licenseCode}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'licenseCode'], + pathParams: ['licenseCode', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licenses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenses.delete + * @desc Deletes the specified license. + * @alias compute.licenses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the license resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.get + * @desc Returns the specified License resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the License resource to return. + * license: 'my-license', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.licenses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.licenses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the License resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.insert + * @desc Create a License resource in the specified project. + * @alias compute.licenses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().License} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/beta/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.list + * @desc Retrieves the list of licenses available in the specified project. + * This method does not get any licenses that belong to other projects, + * including licenses attached to publicly-available images, like Debian 8. + * If you want to get a list of publicly-available licenses, use this method + * to make a request to the respective image project, such as debian-cloud + * or windows-cloud. + * @alias compute.licenses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/beta/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Machinetypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.machineTypes.aggregatedList + * @desc Retrieves an aggregated list of machine types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.machineTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.machineTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.get + * @desc Returns the specified machine type. Gets a list of available + * machine types by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the machine type to return. + * machineType: 'my-machine-type', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.machineTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.machineType Name of the machine type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/machineTypes/{machineType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'machineType'], + pathParams: ['machineType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.list + * @desc Retrieves a list of machine types available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.machineTypes.list(request, handlePage); + * } + * }; + * + * compute.machineTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Networks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.networks.addPeering + * @desc Adds a peering to the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network resource to add peering to. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.addPeering(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.addPeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to add peering to. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksAddPeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addPeering(params?: any, options?: MethodOptions): + AxiosPromise; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}/addPeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.delete + * @desc Deletes the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to delete. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.get + * @desc Returns the specified network. Get a list of available networks by + * making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to return. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.insert + * @desc Creates a network in the specified project using the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/beta/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.list + * @desc Retrieves the list of networks available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.networks.list(request, handlePage); + * } + * }; + * + * compute.networks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/beta/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.patch + * @desc Patches the specified network with the data included in the + * request. Only the following fields can be modified: + * routingConfig.routingMode. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to update. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.removePeering + * @desc Removes a peering from the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network resource to remove peering from. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.removePeering(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.removePeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to remove peering from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksRemovePeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removePeering(params?: any, options?: MethodOptions): + AxiosPromise; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}/removePeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.switchToCustomMode + * @desc Switches the network mode from auto subnet mode to custom subnet + * mode. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to be updated. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.switchToCustomMode(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.switchToCustomMode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to be updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + switchToCustomMode(params?: any, options?: MethodOptions): + AxiosPromise; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{network}/switchToCustomMode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/networks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.projects.disableXpnHost + * @desc Disable this project as a shared VPC host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.disableXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.disableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/disableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.disableXpnResource + * @desc Disable a serivce resource (a.k.a service project) associated with + * this host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.disableXpnResource(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.disableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/disableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnHost + * @desc Enable this project as a shared VPC host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.enableXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.enableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/enableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnResource + * @desc Enable service resource (a.k.a service project) for a host project, + * so that subnets in the host project can be used by instances in the + * service project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.enableXpnResource(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.enableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/enableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.get + * @desc Returns the specified Project resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnHost + * @desc Gets the shared VPC host project that this project links to. May be + * empty if no link exists. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.getXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.getXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/getXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnResources + * @desc Gets service resources (a.k.a service project) associated with this + * host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var resourcesPage = response['resources']; + * if (!resourcesPage) { + * return; + * } + * for (var i = 0; i < resourcesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.projects.getXpnResources(request, handlePage); + * } + * }; + * + * compute.projects.getXpnResources(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.getXpnResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnResources(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/beta/projects/{project}/getXpnResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.listXpnHosts + * @desc Lists all shared VPC host projects visible to the user in an + * organization. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.projects.listXpnHosts(request, handlePage); + * } + * }; + * + * compute.projects.listXpnHosts(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.listXpnHosts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {().ProjectsListXpnHostsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listXpnHosts(params?: any, options?: MethodOptions): + AxiosPromise; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/listXpnHosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveDisk + * @desc Moves a persistent disk from one zone to another. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.moveDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.moveDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DiskMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveDisk(params?: any, options?: MethodOptions): + AxiosPromise; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/moveDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveInstance + * @desc Moves an instance and its attached persistent disks from one zone + * to another. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.moveInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.moveInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveInstance(params?: any, options?: MethodOptions): + AxiosPromise; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/moveInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setCommonInstanceMetadata + * @desc Sets metadata common to all instances within the specified project + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.setCommonInstanceMetadata(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.setCommonInstanceMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setCommonInstanceMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/setCommonInstanceMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setDefaultNetworkTier + * @desc Sets the default network tier of the project. The default network + * tier is used when an address/forwardingRule/instance is created without + * specifying the network tier field. + * @alias compute.projects.setDefaultNetworkTier + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsSetDefaultNetworkTierRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDefaultNetworkTier(params?: any, options?: MethodOptions): + AxiosPromise; + setDefaultNetworkTier( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDefaultNetworkTier( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/setDefaultNetworkTier') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setUsageExportBucket + * @desc Enables the usage export feature and sets the usage export bucket + * where reports are stored. If you provide an empty request body using this + * method, the usage export feature will be disabled. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.setUsageExportBucket(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.setUsageExportBucket + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UsageExportLocation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUsageExportBucket(params?: any, options?: MethodOptions): + AxiosPromise; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/setUsageExportBucket') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionautoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionAutoscalers.delete + * @desc Deletes the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the autoscaler to delete. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.get + * @desc Returns the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the autoscaler to return. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionAutoscalers.list(request, handlePage); + * } + * }; + * + * compute.regionAutoscalers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionbackendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionBackendServices.delete + * @desc Deletes the specified regional BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to delete. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.get + * @desc Returns the specified regional BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to return. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.getHealth + * @desc Gets the most recent health check results for this regional + * BackendService. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to which the queried instance + * belongs. backendService: 'my-backend-service', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.getHealth(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource for which to get health. + * @param {string} params.project + * @param {string} params.region Name of the region scoping this request. + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.insert + * @desc Creates a regional BackendService resource in the specified project + * using the data included in the request. There are several restrictions + * and guidelines to keep in mind when creating a regional backend service. + * Read Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.list + * @desc Retrieves the list of regional BackendService resources available + * to the specified project in the given region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionBackendServices.list(request, handlePage); + * } + * }; + * + * compute.regionBackendServices.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.patch + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to patch. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.update + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to update. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioncommitments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionCommitments.aggregatedList + * @desc Retrieves an aggregated list of commitments. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionCommitments.aggregatedList(request, handlePage); + * } + * }; + * + * compute.regionCommitments.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.get + * @desc Returns the specified commitment resource. Get a list of available + * commitments by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the commitment to return. + * commitment: 'my-commitment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionCommitments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commitment Name of the commitment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/commitments/{commitment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'commitment'], + pathParams: ['commitment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.insert + * @desc Creates a commitment in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionCommitments.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Commitment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.list + * @desc Retrieves a list of commitments contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionCommitments.list(request, handlePage); + * } + * }; + * + * compute.regionCommitments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regiondisks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionDisks.createSnapshot + * @desc Creates a snapshot of this regional disk. + * @alias compute.regionDisks.createSnapshot + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to snapshot. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Snapshot} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSnapshot(params?: any, options?: MethodOptions): + AxiosPromise; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{disk}/createSnapshot') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.delete + * @desc Deletes the specified regional persistent disk. Deleting a regional + * disk removes all the replicas of its data permanently and is + * irreversible. However, deleting a disk does not delete any snapshots + * previously made from the disk. You must separately delete snapshots. + * @alias compute.regionDisks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.get + * @desc Returns a specified regional persistent disk. + * @alias compute.regionDisks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.insert + * @desc Creates a persistent regional disk in the specified project using + * the data included in the request. + * @alias compute.regionDisks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. + * @param {().Disk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.list + * @desc Retrieves the list of persistent disks contained within the + * specified region. + * @alias compute.regionDisks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.resize + * @desc Resizes the specified regional persistent disk. + * @alias compute.regionDisks.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the regional persistent disk. + * @param {string} params.project The project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionDisksResizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{disk}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'disk'], + pathParams: ['disk', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.setLabels + * @desc Sets the labels on the target regional disk. + * @alias compute.regionDisks.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDisks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.regionDisks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/disks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regiondisktypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionDiskTypes.get + * @desc Returns the specified regional disk type. Get a list of available + * disk types by making a list() request. + * @alias compute.regionDiskTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.diskType Name of the disk type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/diskTypes/{diskType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'diskType'], + pathParams: ['diskType', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionDiskTypes.list + * @desc Retrieves a list of regional disk types available to the specified + * project. + * @alias compute.regionDiskTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.abandonInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group to delete. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.delete(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.deleteInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group to return. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A regional managed instance group can + * contain up to 2000 instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.list + * @desc Retrieves the list of managed instance groups that are contained + * within the specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroupManagers.list(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroupManagers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.listManagedInstances + * @desc Lists the instances in the managed instance group and instances + * that are scheduled to be created. The list includes any current actions + * that the group has scheduled for its instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var managedInstancesPage = response['managedInstances']; + * if (!managedInstancesPage) { + * return; + * } + * for (var i = 0; i < managedInstancesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `managedInstancesPage`: + * console.log(JSON.stringify(managedInstancesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroupManagers.listManagedInstances(request, + * handlePage); + * } + * }; + * + * compute.regionInstanceGroupManagers.listManagedInstances(request, + * handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.patch + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is patched even if the instances in the group are still in the process of + * being patched. You must separately verify the status of the individual + * instances with the listmanagedinstances method. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the instance group manager. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.recreateInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.resize + * @desc Changes the intended size for the managed instance group. If you + * increase the size, the group schedules actions to create new instances + * using the current instance template. If you decrease the size, the group + * schedules delete actions on one or more instances. The resize operation + * is marked DONE when the resize actions are scheduled even if the group + * has not yet added or deleted any instances. You must separately verify + * the status of the creating or deleting actions with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * // Number of instances that should exist in this instance group + * manager. size: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.resize(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size Number of instances that should exist in this instance group manager. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setAutoHealingPolicies + * @desc Modifies the autohealing policy for the instances in this managed + * instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.setAutoHealingPolicies(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.setAutoHealingPolicies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetAutoHealingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoHealingPolicies(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoHealingPolicies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setAutoHealingPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setInstanceTemplate + * @desc Sets the instance template to use when creating new instances or + * recreating instances in this group. Existing instances are not affected. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.setInstanceTemplate(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all new instances in this group + * are assigned. Existing instances in the group are not affected. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.setTargetPools(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.testIamPermissions(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.update + * @desc Updates a managed instance group using the information that you + * specify in the request. This operation is marked as DONE when the group + * is updated even if the instances in the group have not yet been updated. + * You must separately verify the status of the individual instances with + * the listmanagedinstances method. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the instance group manager. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroups.get + * @desc Returns the specified instance group resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the instance group resource to return. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup Name of the instance group resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.list + * @desc Retrieves the list of instance group resources contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroups.list(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.listInstances + * @desc Lists the instances in the specified instance group and displays + * information about the named ports. Depending on the specified options, + * this method can list all instances or only the instances that are + * running. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the regional instance group for which we want to list the + * instances. instanceGroup: 'my-instance-group', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroups.listInstances(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroups.listInstances(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroups.setNamedPorts + * @desc Sets the named ports for the specified regional instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the regional instance group where the named ports are + * updated. instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroups.setNamedPorts(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroups.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/instanceGroups/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionOperations.delete + * @desc Deletes the specified region-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.get + * @desc Retrieves the specified region-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionOperations.list(request, handlePage); + * } + * }; + * + * compute.regionOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regions { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regions.get + * @desc Returns the specified Region resource. Get a list of available + * regions by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region resource to return. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regions.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/regions/{region}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regions.list + * @desc Retrieves the list of region resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regions.list(request, handlePage); + * } + * }; + * + * compute.regions.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/regions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routers.aggregatedList + * @desc Retrieves an aggregated list of routers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.routers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.delete + * @desc Deletes the specified Router resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to delete. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.get + * @desc Returns the specified Router resource. Get a list of available + * routers by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to return. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.getRouterStatus + * @desc Retrieves runtime information of the specified router. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to query. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.getRouterStatus(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.getRouterStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRouterStatus(params?: any, options?: MethodOptions): + AxiosPromise; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.insert + * @desc Creates a Router resource in the specified project and region using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.list + * @desc Retrieves a list of Router resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routers.list(request, handlePage); + * } + * }; + * + * compute.routers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.patch + * @desc Patches the specified Router resource with the data included in the + * request. This method supports PATCH semantics and uses JSON merge patch + * format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to patch. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to patch. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.preview + * @desc Preview fields auto-generated during router create and update + * operations. Calling this method does NOT create or update the router. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to query. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.preview(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.preview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + preview(params?: any, options?: MethodOptions): + AxiosPromise; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}/preview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.update + * @desc Updates the specified Router resource with the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to update. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to update. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routes.delete + * @desc Deletes the specified Route resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Route resource to delete. + * route: 'my-route', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routes.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.route Name of the Route resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.get + * @desc Returns the specified Route resource. Get a list of available + * routes by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Route resource to return. + * route: 'my-route', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.route Name of the Route resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.insert + * @desc Creates a Route resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routes.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Route} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.list + * @desc Retrieves the list of Route resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routes.list(request, handlePage); + * } + * }; + * + * compute.routes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routes.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/routes/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Securitypolicies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.securityPolicies.addRule + * @desc Inserts a rule into a security policy. + * @alias compute.securityPolicies.addRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {().SecurityPolicyRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addRule(params?: any, options?: MethodOptions): + AxiosPromise; + addRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/addRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.delete + * @desc Deletes the specified policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the security policy to delete. + * securityPolicy: 'my-security-policy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.securityPolicies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.securityPolicy Name of the security policy to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.get + * @desc List all of the ordered rules present in a single specified policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the security policy to get. + * securityPolicy: 'my-security-policy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.securityPolicies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.getRule + * @desc Gets a rule at the specified priority. + * @alias compute.securityPolicies.getRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to get from the security policy. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to which the queried rule belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRule(params?: any, options?: MethodOptions): + AxiosPromise; + getRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/getRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.insert + * @desc Creates a new policy in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.securityPolicies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SecurityPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.list + * @desc List all the policies that have been configured for the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.securityPolicies.list(request, handlePage); + * } + * }; + * + * compute.securityPolicies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.patch + * @desc Patches the specified policy with the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the security policy to update. + * securityPolicy: 'my-security-policy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.securityPolicies.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {().SecurityPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.patchRule + * @desc Patches a rule at the specified priority. + * @alias compute.securityPolicies.patchRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {().SecurityPolicyRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patchRule(params?: any, options?: MethodOptions): + AxiosPromise; + patchRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patchRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/patchRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.removeRule + * @desc Deletes a rule at the specified priority. + * @alias compute.securityPolicies.removeRule + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.priority The priority of the rule to remove from the security policy. + * @param {string} params.project Project ID for this request. + * @param {string} params.securityPolicy Name of the security policy to update. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeRule(params?: any, options?: MethodOptions): + AxiosPromise; + removeRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeRule( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{securityPolicy}/removeRule') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'securityPolicy'], + pathParams: ['project', 'securityPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.securityPolicies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.securityPolicies.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.securityPolicies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/securityPolicies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Snapshots { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.snapshots.delete + * @desc Deletes the specified Snapshot resource. Keep in mind that deleting + * a single snapshot might not necessarily delete all the data on that + * snapshot. If any data on the snapshot that is marked for deletion is + * needed for subsequent snapshots, the data will be moved to the next + * corresponding snapshot. For more information, see Deleting snaphots. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Snapshot resource to delete. + * snapshot: 'my-snapshot', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.snapshots.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.snapshot Name of the Snapshot resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.get + * @desc Returns the specified Snapshot resource. Get a list of available + * snapshots by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Snapshot resource to return. + * snapshot: 'my-snapshot', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.snapshots.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.snapshot Name of the Snapshot resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.list + * @desc Retrieves the list of Snapshot resources contained within the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.snapshots.list(request, handlePage); + * } + * }; + * + * compute.snapshots.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.setLabels + * @desc Sets the labels on a snapshot. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.snapshots.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/snapshots/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.snapshots.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/snapshots/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslcertificates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslCertificates.delete + * @desc Deletes the specified SslCertificate resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the SslCertificate resource to delete. + * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.sslCertificates.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.get + * @desc Returns the specified SslCertificate resource. Get a list of + * available SSL certificates by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the SslCertificate resource to return. + * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.sslCertificates.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslCertificate Name of the SslCertificate resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.insert + * @desc Creates a SslCertificate resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.sslCertificates.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.list + * @desc Retrieves the list of SslCertificate resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.sslCertificates.list(request, handlePage); + * } + * }; + * + * compute.sslCertificates.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.sslCertificates.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslCertificates/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslpolicies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslPolicies.delete + * @desc Deletes the specified SSL policy. The SSL policy resource can be + * deleted only if it is not in use by any TargetHttpsProxy or + * TargetSslProxy resources. + * @alias compute.sslPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.get + * @desc Lists all of the ordered rules present in a single specified + * policy. + * @alias compute.sslPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.insert + * @desc Returns the specified SSL policy resource. Get a list of available + * SSL policies by making a list() request. + * @alias compute.sslPolicies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.list + * @desc Lists all the SSL policies that have been configured for the + * specified project. + * @alias compute.sslPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.listAvailableFeatures + * @desc Lists all features that can be specified in the SSL policy when + * using custom profile. + * @alias compute.sslPolicies.listAvailableFeatures + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableFeatures(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): void; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies/listAvailableFeatures') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$SslPoliciesListAvailableFeaturesResponse>(parameters); + } + } + + + /** + * compute.sslPolicies.patch + * @desc Patches the specified SSL policy with the data included in the + * request. + * @alias compute.sslPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.sslPolicies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/sslPolicies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subnetworks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.subnetworks.aggregatedList + * @desc Retrieves an aggregated list of subnetworks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.subnetworks.aggregatedList(request, handlePage); + * } + * }; + * + * compute.subnetworks.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.delete + * @desc Deletes the specified subnetwork. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to delete. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.subnetworks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.expandIpCidrRange + * @desc Expands the IP CIDR range of the subnetwork to a specified value. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to update. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.expandIpCidrRange(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.expandIpCidrRange + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to update. + * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + expandIpCidrRange(params?: any, options?: MethodOptions): + AxiosPromise; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.get + * @desc Returns the specified subnetwork. Get a list of available + * subnetworks list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to return. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.subnetworks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.subnetwork Name of the Subnetwork resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.subnetworks.getIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.insert + * @desc Creates a subnetwork in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.list + * @desc Retrieves a list of subnetworks available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.subnetworks.list(request, handlePage); + * } + * }; + * + * compute.subnetworks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.listUsable + * @desc Retrieves an aggregated list of usable subnetworks. + * @alias compute.subnetworks.listUsable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listUsable(params?: any, options?: MethodOptions): + AxiosPromise; + listUsable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + listUsable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/subnetworks/listUsable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.subnetworks.patch + * @desc Patches the specified subnetwork with the data included in the + * request. Only the following fields within the subnetwork resource can be + * specified in the request: secondary_ip_range, + * allow_subnet_cidr_routes_overlap and role. It is also mandatory to + * specify the current fingeprint of the subnetwork resource being patched. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to patch. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to patch. + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.setIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.setPrivateIpGoogleAccess + * @desc Set whether VMs in this subnet can access Google services without + * assigning external IP addresses through Private Google Access. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.setPrivateIpGoogleAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource. + * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): + AxiosPromise; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.testIamPermissions(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/subnetworks/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpProxies.delete + * @desc Deletes the specified TargetHttpProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.get + * @desc Returns the specified TargetHttpProxy resource. Get a list of + * available target HTTP proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.insert + * @desc Creates a TargetHttpProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.list + * @desc Retrieves the list of TargetHttpProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetHttpProxies.list(request, handlePage); + * } + * }; + * + * compute.targetHttpProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.setUrlMap + * @desc Changes the URL map for TargetHttpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.setUrlMap(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpsproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpsProxies.delete + * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.get + * @desc Returns the specified TargetHttpsProxy resource. Get a list of + * available target HTTPS proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.insert + * @desc Creates a TargetHttpsProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpsProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.list + * @desc Retrieves the list of TargetHttpsProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetHttpsProxies.list(request, handlePage); + * } + * }; + * + * compute.targetHttpsProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setQuicOverride + * @desc Sets the QUIC override policy for TargetHttpsProxy. + * @alias compute.targetHttpsProxies.setQuicOverride + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set the QUIC override policy for. The name should conform to RFC1035. + * @param {().TargetHttpsProxiesSetQuicOverrideRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setQuicOverride(params?: any, options?: MethodOptions): + AxiosPromise; + setQuicOverride( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setQuicOverride( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setQuicOverride') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslCertificates + * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to set an SslCertificates + * resource for. targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.setSslCertificates(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslPolicy + * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the HTTPS proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetHttpsProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setUrlMap + * @desc Changes the URL map for TargetHttpsProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource whose URL map is to be set. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetHttpsProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetinstances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetInstances.aggregatedList + * @desc Retrieves an aggregated list of target instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetInstances.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetInstances.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetInstances.delete + * @desc Deletes the specified TargetInstance resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the TargetInstance resource to delete. + * targetInstance: 'my-target-instance', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetInstances.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetInstance Name of the TargetInstance resource to delete. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.get + * @desc Returns the specified TargetInstance resource. Get a list of + * available target instances by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the TargetInstance resource to return. + * targetInstance: 'my-target-instance', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetInstances.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetInstance Name of the TargetInstance resource to return. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.insert + * @desc Creates a TargetInstance resource in the specified project and zone + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetInstances.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone scoping this request. + * @param {().TargetInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.list + * @desc Retrieves a list of TargetInstance resources available to the + * specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetInstances.list(request, handlePage); + * } + * }; + * + * compute.targetInstances.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetInstances.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/targetInstances/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetpools { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetPools.addHealthCheck + * @desc Adds health check URLs to a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target pool to add a health check to. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.addHealthCheck(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.addHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to add a health check to. + * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.addInstance + * @desc Adds an instance to a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to add instances to. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.addInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.addInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to add instances to. + * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstance(params?: any, options?: MethodOptions): + AxiosPromise; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.aggregatedList + * @desc Retrieves an aggregated list of target pools. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetPools.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetPools.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.delete + * @desc Deletes the specified target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to delete. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetPools.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.get + * @desc Returns the specified target pool. Get a list of available target + * pools by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to return. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetPools.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.getHealth + * @desc Gets the most recent health check results for each IP for the + * instance that is referenced by the given target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to which the queried instance + * belongs. targetPool: 'my-target-pool', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.getHealth(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param {().InstanceReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.insert + * @desc Creates a target pool in the specified project and region using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetPool} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.list + * @desc Retrieves a list of target pools available to the specified project + * and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetPools.list(request, handlePage); + * } + * }; + * + * compute.targetPools.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeHealthCheck + * @desc Removes health check URL from a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target pool to remove health checks from. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.removeHealthCheck(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.removeHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to remove health checks from. + * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeInstance + * @desc Removes instance URL from a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to remove instances from. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.removeInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.removeInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. + * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstance(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.setBackup + * @desc Changes a backup target pool's configurations. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to set a backup pool for. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.setBackup(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.setBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {number=} params.failoverRatio New failoverRatio value for the target pool. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackup(params?: any, options?: MethodOptions): + AxiosPromise; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.testIamPermissions(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetPools/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetsslproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetSslProxies.delete + * @desc Deletes the specified TargetSslProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource to delete. + * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.get + * @desc Returns the specified TargetSslProxy resource. Get a list of + * available target SSL proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource to return. + * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.insert + * @desc Creates a TargetSslProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetSslProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.list + * @desc Retrieves the list of TargetSslProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetSslProxies.list(request, handlePage); + * } + * }; + * + * compute.targetSslProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setBackendService + * @desc Changes the BackendService for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose BackendService resource + * is to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setBackendService(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose ProxyHeader is to be + * set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setProxyHeader(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslCertificates + * @desc Changes SslCertificates for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose SslCertificate resource + * is to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setSslCertificates(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslPolicy + * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the SSL proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetSslProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetSslProxies/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targettcpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetTcpProxies.delete + * @desc Deletes the specified TargetTcpProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource to delete. + * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.get + * @desc Returns the specified TargetTcpProxy resource. Get a list of + * available target TCP proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource to return. + * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.insert + * @desc Creates a TargetTcpProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetTcpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.list + * @desc Retrieves the list of TargetTcpProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetTcpProxies.list(request, handlePage); + * } + * }; + * + * compute.targetTcpProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setBackendService + * @desc Changes the BackendService for TargetTcpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource whose BackendService resource + * is to be set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.setBackendService(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetTcpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource whose ProxyHeader is to be + * set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.setProxyHeader(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetvpngateways { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetVpnGateways.aggregatedList + * @desc Retrieves an aggregated list of target VPN gateways. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetVpnGateways.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetVpnGateways.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/aggregated/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetVpnGateways.delete + * @desc Deletes the specified target VPN gateway. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target VPN gateway to delete. + * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.get + * @desc Returns the specified target VPN gateway. Get a list of available + * target VPN gateways by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target VPN gateway to return. + * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.insert + * @desc Creates a target VPN gateway in the specified project and region + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetVpnGateway} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.list + * @desc Retrieves a list of target VPN gateways available to the specified + * project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetVpnGateways.list(request, handlePage); + * } + * }; + * + * compute.targetVpnGateways.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.setLabels + * @desc Sets the labels on a TargetVpnGateway. To learn more about labels, + * read the Labeling Resources documentation. + * @alias compute.targetVpnGateways.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/targetVpnGateways/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Urlmaps { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.urlMaps.delete + * @desc Deletes the specified UrlMap resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to delete. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.urlMaps.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.get + * @desc Returns the specified UrlMap resource. Get a list of available URL + * maps by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to return. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.urlMaps.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.insert + * @desc Creates a UrlMap resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.invalidateCache + * @desc Initiates a cache invalidation operation, invalidating the + * specified path, scoped to the specified UrlMap. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap scoping this request. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.invalidateCache(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.invalidateCache + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap scoping this request. + * @param {().CacheInvalidationRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + invalidateCache(params?: any, options?: MethodOptions): + AxiosPromise; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.list + * @desc Retrieves the list of UrlMap resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.urlMaps.list(request, handlePage); + * } + * }; + * + * compute.urlMaps.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.patch + * @desc Patches the specified UrlMap resource with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to patch. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to patch. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.update + * @desc Updates the specified UrlMap resource with the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to update. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to update. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.validate + * @desc Runs static validation for the UrlMap. In particular, the tests of + * the provided UrlMap will be run. Calling this method does NOT create the + * UrlMap. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to be validated as. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.validate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.validate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to be validated as. + * @param {().UrlMapsValidateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + validate(params?: any, options?: MethodOptions): + AxiosPromise; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/global/urlMaps/{urlMap}/validate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Vpntunnels { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.vpnTunnels.aggregatedList + * @desc Retrieves an aggregated list of VPN tunnels. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.vpnTunnels.aggregatedList(request, handlePage); + * } + * }; + * + * compute.vpnTunnels.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/aggregated/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.delete + * @desc Deletes the specified VpnTunnel resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the VpnTunnel resource to delete. + * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.get + * @desc Returns the specified VpnTunnel resource. Get a list of available + * VPN tunnels by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the VpnTunnel resource to return. + * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.insert + * @desc Creates a VpnTunnel resource in the specified project and region + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().VpnTunnel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.list + * @desc Retrieves a list of VpnTunnel resources contained in the specified + * project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.vpnTunnels.list(request, handlePage); + * } + * }; + * + * compute.vpnTunnels.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.setLabels + * @desc Sets the labels on a VpnTunnel. To learn more about labels, read + * the Labeling Resources documentation. + * @alias compute.vpnTunnels.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {().RegionSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.testIamPermissions(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region The name of the region for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/regions/{region}/vpnTunnels/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'resource'], + pathParams: ['project', 'region', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zoneoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zoneOperations.delete + * @desc Deletes the specified zone-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zoneOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.get + * @desc Retrieves the specified zone-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zoneOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.zoneOperations.list(request, handlePage); + * } + * }; + * + * compute.zoneOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/beta/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zones { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zones.get + * @desc Returns the specified Zone resource. Get a list of available zones + * by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone resource to return. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zones.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/zones/{zone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zones.list + * @desc Retrieves the list of Zone resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('beta'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.zones.list(request, handlePage); + * } + * }; + * + * compute.zones.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/beta/projects/{project}/zones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/compute/v1.ts b/src/apis/compute/v1.ts index 6491618e119..571507b44be 100644 --- a/src/apis/compute/v1.ts +++ b/src/apis/compute/v1.ts @@ -27,46243 +27,46851 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format - -/** - * Compute Engine API - * - * Creates and runs virtual machines on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const compute = google.compute('v1'); - * - * @namespace compute - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Compute - */ -export class Compute { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - acceleratorTypes: Resource$Acceleratortypes; - addresses: Resource$Addresses; - autoscalers: Resource$Autoscalers; - backendBuckets: Resource$Backendbuckets; - backendServices: Resource$Backendservices; - disks: Resource$Disks; - diskTypes: Resource$Disktypes; - firewalls: Resource$Firewalls; - forwardingRules: Resource$Forwardingrules; - globalAddresses: Resource$Globaladdresses; - globalForwardingRules: Resource$Globalforwardingrules; - globalOperations: Resource$Globaloperations; - healthChecks: Resource$Healthchecks; - httpHealthChecks: Resource$Httphealthchecks; - httpsHealthChecks: Resource$Httpshealthchecks; - images: Resource$Images; - instanceGroupManagers: Resource$Instancegroupmanagers; - instanceGroups: Resource$Instancegroups; - instances: Resource$Instances; - instanceTemplates: Resource$Instancetemplates; - interconnectAttachments: Resource$Interconnectattachments; - interconnectLocations: Resource$Interconnectlocations; - interconnects: Resource$Interconnects; - licenseCodes: Resource$Licensecodes; - licenses: Resource$Licenses; - machineTypes: Resource$Machinetypes; - networks: Resource$Networks; - projects: Resource$Projects; - regionAutoscalers: Resource$Regionautoscalers; - regionBackendServices: Resource$Regionbackendservices; - regionCommitments: Resource$Regioncommitments; - regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; - regionInstanceGroups: Resource$Regioninstancegroups; - regionOperations: Resource$Regionoperations; - regions: Resource$Regions; - routers: Resource$Routers; - routes: Resource$Routes; - snapshots: Resource$Snapshots; - sslCertificates: Resource$Sslcertificates; - sslPolicies: Resource$Sslpolicies; - subnetworks: Resource$Subnetworks; - targetHttpProxies: Resource$Targethttpproxies; - targetHttpsProxies: Resource$Targethttpsproxies; - targetInstances: Resource$Targetinstances; - targetPools: Resource$Targetpools; - targetSslProxies: Resource$Targetsslproxies; - targetTcpProxies: Resource$Targettcpproxies; - targetVpnGateways: Resource$Targetvpngateways; - urlMaps: Resource$Urlmaps; - vpnTunnels: Resource$Vpntunnels; - zoneOperations: Resource$Zoneoperations; - zones: Resource$Zones; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.acceleratorTypes = new Resource$Acceleratortypes(this); - this.addresses = new Resource$Addresses(this); - this.autoscalers = new Resource$Autoscalers(this); - this.backendBuckets = new Resource$Backendbuckets(this); - this.backendServices = new Resource$Backendservices(this); - this.disks = new Resource$Disks(this); - this.diskTypes = new Resource$Disktypes(this); - this.firewalls = new Resource$Firewalls(this); - this.forwardingRules = new Resource$Forwardingrules(this); - this.globalAddresses = new Resource$Globaladdresses(this); - this.globalForwardingRules = new Resource$Globalforwardingrules(this); - this.globalOperations = new Resource$Globaloperations(this); - this.healthChecks = new Resource$Healthchecks(this); - this.httpHealthChecks = new Resource$Httphealthchecks(this); - this.httpsHealthChecks = new Resource$Httpshealthchecks(this); - this.images = new Resource$Images(this); - this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); - this.instanceGroups = new Resource$Instancegroups(this); - this.instances = new Resource$Instances(this); - this.instanceTemplates = new Resource$Instancetemplates(this); - this.interconnectAttachments = new Resource$Interconnectattachments(this); - this.interconnectLocations = new Resource$Interconnectlocations(this); - this.interconnects = new Resource$Interconnects(this); - this.licenseCodes = new Resource$Licensecodes(this); - this.licenses = new Resource$Licenses(this); - this.machineTypes = new Resource$Machinetypes(this); - this.networks = new Resource$Networks(this); - this.projects = new Resource$Projects(this); - this.regionAutoscalers = new Resource$Regionautoscalers(this); - this.regionBackendServices = new Resource$Regionbackendservices(this); - this.regionCommitments = new Resource$Regioncommitments(this); - this.regionInstanceGroupManagers = - new Resource$Regioninstancegroupmanagers(this); - this.regionInstanceGroups = new Resource$Regioninstancegroups(this); - this.regionOperations = new Resource$Regionoperations(this); - this.regions = new Resource$Regions(this); - this.routers = new Resource$Routers(this); - this.routes = new Resource$Routes(this); - this.snapshots = new Resource$Snapshots(this); - this.sslCertificates = new Resource$Sslcertificates(this); - this.sslPolicies = new Resource$Sslpolicies(this); - this.subnetworks = new Resource$Subnetworks(this); - this.targetHttpProxies = new Resource$Targethttpproxies(this); - this.targetHttpsProxies = new Resource$Targethttpsproxies(this); - this.targetInstances = new Resource$Targetinstances(this); - this.targetPools = new Resource$Targetpools(this); - this.targetSslProxies = new Resource$Targetsslproxies(this); - this.targetTcpProxies = new Resource$Targettcpproxies(this); - this.targetVpnGateways = new Resource$Targetvpngateways(this); - this.urlMaps = new Resource$Urlmaps(this); - this.vpnTunnels = new Resource$Vpntunnels(this); - this.zoneOperations = new Resource$Zoneoperations(this); - this.zones = new Resource$Zones(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A specification of the type and number of accelerator cards attached to the - * instance. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the guest accelerator cards exposed to this instance. - */ - acceleratorCount: number; - /** - * Full or partial URL of the accelerator type resource to attach to this - * instance. If you are creating an instance template, specify only the - * accelerator name. - */ - acceleratorType: string; -} -/** - * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) (== - * resource_for v1.acceleratorTypes ==) - */ -export interface Schema$AcceleratorType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this accelerator type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The type of the resource. Always compute#acceleratorType for - * accelerator types. - */ - kind: string; - /** - * [Output Only] Maximum accelerator cards allowed per instance. - */ - maximumCardsPerInstance: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the accelerator type resides, such - * as us-central1-a. You must specify this field as part of the HTTP request - * URL. It is not settable as a field in the request body. - */ - zone: string; -} -export interface Schema$AcceleratorTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator - * types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of accelerator types. - */ -export interface Schema$AcceleratorTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AcceleratorType resources. - */ - items: Schema$AcceleratorType[]; - /** - * [Output Only] Type of resource. Always compute#acceleratorTypeList for - * lists of accelerator types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AcceleratorTypesScopedList { - /** - * [Output Only] A list of accelerator types contained in this scope. - */ - acceleratorTypes: Schema$AcceleratorType[]; - /** - * [Output Only] An informational warning that appears when the accelerator - * types list is empty. - */ - warning: any; -} -/** - * An access configuration attached to an instance's network interface. Only - * one access config per instance is supported. - */ -export interface Schema$AccessConfig { - /** - * [Output Only] Type of the resource. Always compute#accessConfig for access - * configs. - */ - kind: string; - /** - * The name of this access configuration. The default and recommended name is - * External NAT but you can use any arbitrary string you would like. For - * example, My external IP or Network Access. - */ - name: string; - /** - * An external IP address associated with this instance. Specify an unused - * static external IP address available to the project or leave this field - * undefined to use an IP from a shared ephemeral IP address pool. If you - * specify a static external IP address, it must live in the same region as - * the zone of the instance. - */ - natIP: string; - /** - * The DNS domain name for the public PTR record. This field can only be set - * when the set_public_ptr field is enabled. - */ - publicPtrDomainName: string; - /** - * Specifies whether a public DNS ?PTR? record should be created to map the - * external IP address of the instance to a DNS domain name. - */ - setPublicPtr: boolean; - /** - * The type of configuration. The default and only option is ONE_TO_ONE_NAT. - */ - type: string; -} -/** - * A reserved address resource. (== resource_for beta.addresses ==) (== - * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== - * resource_for v1.globalAddresses ==) - */ -export interface Schema$Address { - /** - * The static IP address represented by this resource. - */ - address: string; - /** - * The type of address to reserve, either INTERNAL or EXTERNAL. If - * unspecified, defaults to EXTERNAL. - */ - addressType: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP Version that will be used by this address. Valid options are IPV4 or - * IPV6. This can only be specified for a global address. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#address for addresses. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the regional address resides. This - * field is not applicable to global addresses. You must specify this field as - * part of the HTTP request URL. You cannot set this field in the request - * body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the address, which can be one of RESERVING, - * RESERVED, or IN_USE. An address that is RESERVING is currently in the - * process of being reserved. A RESERVED address is currently reserved and - * available to use. An IN_USE address is currently being used by another - * resource and is not available. - */ - status: string; - /** - * The URL of the subnetwork in which to reserve the address. If an IP address - * is specified, it must be within the subnetwork's IP range. This field - * can only be used with INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER - * purposes. - */ - subnetwork: string; - /** - * [Output Only] The URLs of the resources that are using this address. - */ - users: string[]; -} -export interface Schema$AddressAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AddressesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#addressAggregatedList for - * aggregated lists of addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AddressesScopedList { - /** - * [Output Only] A list of addresses contained in this scope. - */ - addresses: Schema$Address[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -/** - * Contains a list of addresses. - */ -export interface Schema$AddressList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Address resources. - */ - items: Schema$Address[]; - /** - * [Output Only] Type of resource. Always compute#addressList for lists of - * addresses. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An alias IP range attached to an instance's network interface. - */ -export interface Schema$AliasIpRange { - /** - * The IP CIDR range represented by this alias IP range. This IP CIDR range - * must belong to the specified subnetwork and cannot contain IP addresses - * reserved by system or used by other network interfaces. This range may be a - * single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR format - * string (e.g. 10.1.2.0/24). - */ - ipCidrRange: string; - /** - * Optional subnetwork secondary range name specifying the secondary range - * from which to allocate the IP CIDR range for this alias IP range. If left - * unspecified, the primary range of the subnetwork will be used. - */ - subnetworkRangeName: string; -} -/** - * An instance-attached disk resource. - */ -export interface Schema$AttachedDisk { - /** - * Specifies whether the disk will be auto-deleted when the instance is - * deleted (but not when the disk is detached from the instance). - */ - autoDelete: boolean; - /** - * Indicates that this is a boot disk. The virtual machine will use the first - * partition of the disk for its root filesystem. - */ - boot: boolean; - /** - * Specifies a unique device name of your choice that is reflected into the - * /dev/disk/by-id/google-* tree of a Linux operating system running within - * the instance. This name can be used to reference the device for mounting, - * resizing, and so on, from within the instance. If not specified, the - * server chooses a default device name to apply to this disk, in the form - * persistent-disks-x, where x is a number assigned by Google Compute Engine. - * This field is only applicable for persistent disks. - */ - deviceName: string; - /** - * Encrypts or decrypts a disk using a customer-supplied encryption key. If - * you are creating a new disk, this field encrypts the new disk using an - * encryption key that you provide. If you are attaching an existing disk that - * is already encrypted, this field decrypts the disk using the - * customer-supplied encryption key. If you encrypt a disk using a - * customer-supplied key, you must provide the same key again when you attempt - * to use this resource at a later time. For example, you must provide the key - * when you create a snapshot or an image from the disk or when you attach the - * disk to a virtual machine instance. If you do not provide an encryption - * key, then the disk will be encrypted using an automatically generated key - * and you do not need to provide a key to use the disk later. Instance - * templates do not store customer-supplied encryption keys, so you cannot use - * your own keys to encrypt disks in a managed instance group. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] A zero-based index to this disk, where 0 is reserved for the - * boot disk. If you have many disks attached to an instance, each disk would - * have a unique index number. - */ - index: number; - /** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is - * mutually exclusive with the source property; you can only define one or the - * other, but not both. - */ - initializeParams: Schema$AttachedDiskInitializeParams; - /** - * Specifies the disk interface to use for attaching this disk, which is - * either SCSI or NVME. The default is SCSI. Persistent disks must always use - * SCSI and the request will fail if you attempt to attach a persistent disk - * in any other format than SCSI. Local SSDs can use either NVME or SCSI. For - * performance characteristics of SCSI over NVMe, see Local SSD performance. - */ - interface: string; - /** - * [Output Only] Type of the resource. Always compute#attachedDisk for - * attached disks. - */ - kind: string; - /** - * [Output Only] Any valid publicly visible licenses. - */ - licenses: string[]; - /** - * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If - * not specified, the default is to attach the disk in READ_WRITE mode. - */ - mode: string; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. When creating a new instance, one of initializeParams.sourceImage - * or disks.source is required except for local SSD. If desired, you can also - * attach existing non-root persistent disks using this property. This field - * is only applicable for persistent disks. Note that for InstanceTemplate, - * specify the disk name, not the URL for the disk. - */ - source: string; - /** - * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not - * specified, the default is PERSISTENT. - */ - type: string; -} -/** - * [Input Only] Specifies the parameters for a new disk that will be created - * alongside the new instance. Use initialization parameters to create boot - * disks or local SSDs attached to the new instance. This property is mutually - * exclusive with the source property; you can only define one or the other, but - * not both. - */ -export interface Schema$AttachedDiskInitializeParams { - /** - * Specifies the disk name. If not specified, the default is to use the name - * of the instance. - */ - diskName: string; - /** - * Specifies the size of the disk in base-2 GB. - */ - diskSizeGb: string; - /** - * Specifies the disk type to use to create the instance. If not specified, - * the default is pd-standard, specified using the full URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard - * Other values include pd-ssd and local-ssd. If you define this field, you - * can provide either the full or partial URL. For example, the following are - * valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType - * - projects/project/zones/zone/diskTypes/diskType - - * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is the - * name of the disk type, not URL. - */ - diskType: string; - /** - * Labels to apply to this disk. These can be later modified by the - * disks.setLabels method. This field is only applicable for persistent disks. - */ - labels: any; - /** - * The source image to create this disk. When creating a new instance, one of - * initializeParams.sourceImage or disks.source is required except for local - * SSD. To create a disk with one of the public operating system images, - * specify the image by its family name. For example, specify family/debian-8 - * to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family If the source image is deleted - * later, this field will not be set. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. Instance - * templates do not store customer-supplied encryption keys, so you cannot - * create disks for instances in a managed instance group if the source images - * are encrypted with your own keys. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; -} -/** - * Represents an Autoscaler resource. Autoscalers allow you to automatically - * scale virtual machine instances in managed instance groups according to an - * autoscaling policy that you define. For more information, read Autoscaling - * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for - * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== - * resource_for v1.regionAutoscalers ==) - */ -export interface Schema$Autoscaler { - /** - * The configuration parameters for the autoscaling algorithm. You can define - * one or more of the policies for an autoscaler: cpuUtilization, - * customMetricUtilizations, and loadBalancingUtilization. If none of these - * are specified, the default will be to autoscale based on cpuUtilization to - * 0.6 or 60%. - */ - autoscalingPolicy: Schema$AutoscalingPolicy; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#autoscaler for - * autoscalers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the instance group resides (for - * autoscalers living in regional scope). - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the autoscaler configuration. - */ - status: string; - /** - * [Output Only] Human-readable details about the current state of the - * autoscaler. Read the documentation for Commonly returned status messages - * for examples of status messages you might encounter. - */ - statusDetails: Schema$AutoscalerStatusDetails[]; - /** - * URL of the managed instance group that this autoscaler will scale. - */ - target: string; - /** - * [Output Only] URL of the zone where the instance group resides (for - * autoscalers living in zonal scope). - */ - zone: string; -} -export interface Schema$AutoscalerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of AutoscalersScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#autoscalerAggregatedList for - * aggregated lists of autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Autoscaler resources. - */ -export interface Schema$AutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * [Output Only] Type of resource. Always compute#autoscalerList for lists of - * autoscalers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$AutoscalersScopedList { - /** - * [Output Only] A list of autoscalers contained in this scope. - */ - autoscalers: Schema$Autoscaler[]; - /** - * [Output Only] Informational warning which replaces the list of autoscalers - * when the list is empty. - */ - warning: any; -} -export interface Schema$AutoscalerStatusDetails { - /** - * The status message. - */ - message: string; - /** - * The type of error returned. - */ - type: string; -} -/** - * Cloud Autoscaler policy. - */ -export interface Schema$AutoscalingPolicy { - /** - * The number of seconds that the autoscaler should wait before it starts - * collecting information from a new instance. This prevents the autoscaler - * from collecting information when the instance is initializing, during which - * the collected usage would not be reliable. The default time autoscaler - * waits is 60 seconds. Virtual machine initialization times might vary - * because of numerous factors. We recommend that you test how long an - * instance may take to initialize. To do this, create an instance and time - * the startup process. - */ - coolDownPeriodSec: number; - /** - * Defines the CPU utilization policy that allows the autoscaler to scale - * based on the average CPU utilization of a managed instance group. - */ - cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; - /** - * Configuration parameters of autoscaling based on a custom metric. - */ - customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; - /** - * Configuration parameters of autoscaling based on load balancer. - */ - loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; - /** - * The maximum number of instances that the autoscaler can scale up to. This - * is required when creating or updating an autoscaler. The maximum number of - * replicas should not be lower than minimal number of replicas. - */ - maxNumReplicas: number; - /** - * The minimum number of replicas that the autoscaler can scale down to. This - * cannot be less than 0. If not provided, autoscaler will choose a default - * value depending on maximum number of instances allowed. - */ - minNumReplicas: number; -} -/** - * CPU utilization policy. - */ -export interface Schema$AutoscalingPolicyCpuUtilization { - /** - * The target CPU utilization that the autoscaler should maintain. Must be a - * float value in the range (0, 1]. If not specified, the default is 0.6. If - * the CPU level is below the target utilization, the autoscaler scales down - * the number of instances until it reaches the minimum number of instances - * you specified or until the average CPU of your instances reaches the target - * utilization. If the average CPU is above the target utilization, the - * autoscaler scales up until it reaches the maximum number of instances you - * specified or until the average utilization reaches the target utilization. - */ - utilizationTarget: number; -} -/** - * Custom utilization metric policy. - */ -export interface Schema$AutoscalingPolicyCustomMetricUtilization { - /** - * The identifier (type) of the Stackdriver Monitoring metric. The metric - * cannot have negative values. The metric must have a value type of INT64 or - * DOUBLE. - */ - metric: string; - /** - * The target value of the metric that autoscaler should maintain. This must - * be a positive value. A utilization metric scales number of virtual machines - * handling requests to increase or decrease proportionally to the metric. For - * example, a good metric to use as a utilization_target is - * compute.googleapis.com/instance/network/received_bytes_count. The - * autoscaler will work to keep this value constant for each of the instances. - */ - utilizationTarget: number; - /** - * Defines how target utilization value is expressed for a Stackdriver - * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. If - * not specified, the default is GAUGE. - */ - utilizationTargetType: string; -} -/** - * Configuration parameters of autoscaling based on load balancing. - */ -export interface Schema$AutoscalingPolicyLoadBalancingUtilization { - /** - * Fraction of backend capacity utilization (set in HTTP(s) load balancing - * configuration) that autoscaler should maintain. Must be a positive float - * value. If not defined, the default is 0.8. - */ - utilizationTarget: number; -} -/** - * Message containing information of one individual backend. - */ -export interface Schema$Backend { - /** - * Specifies the balancing mode for this backend. For global HTTP(S) or - * TCP/SSL load balancing, the default is UTILIZATION. Valid values are - * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For Internal - * Load Balancing, the default and only supported mode is CONNECTION. - */ - balancingMode: string; - /** - * A multiplier applied to the group's maximum servicing capacity (based - * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the - * group will serve up to 100% of its configured capacity (depending on - * balancingMode). A setting of 0 means the group is completely drained, - * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This - * cannot be used for internal load balancing. - */ - capacityScaler: number; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The fully-qualified URL of a Instance Group resource. This instance group - * defines the list of instances that serve traffic. Member virtual machine - * instances from each instance group must live in the same zone as the - * instance group itself. No two backends in a backend service are allowed to - * use same Instance Group resource. Note that you must specify an Instance - * Group resource using the fully-qualified URL, rather than a partial URL. - * When the BackendService has load balancing scheme INTERNAL, the instance - * group must be within the same region as the BackendService. - */ - group: string; - /** - * The max number of simultaneous connections for the group. Can be used with - * either CONNECTION or UTILIZATION balancing modes. For CONNECTION mode, - * either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnections: number; - /** - * The max number of simultaneous connections that a single backend instance - * can handle. This is used to calculate the capacity of the group. Can be - * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION - * mode, either maxConnections or maxConnectionsPerInstance must be set. This - * cannot be used for internal load balancing. - */ - maxConnectionsPerInstance: number; - /** - * The max requests per second (RPS) of the group. Can be used with either - * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE - * mode, either maxRate or maxRatePerInstance must be set. This cannot be - * used for internal load balancing. - */ - maxRate: number; - /** - * The max requests per second (RPS) that a single backend instance can - * handle. This is used to calculate the capacity of the group. Can be used in - * either balancing mode. For RATE mode, either maxRate or maxRatePerInstance - * must be set. This cannot be used for internal load balancing. - */ - maxRatePerInstance: number; - /** - * Used when balancingMode is UTILIZATION. This ratio defines the CPU - * utilization target for the group. The default is 0.8. Valid range is - * [0.0, 1.0]. This cannot be used for internal load balancing. - */ - maxUtilization: number; -} -/** - * A BackendBucket resource. This resource defines a Cloud Storage bucket. - */ -export interface Schema$BackendBucket { - /** - * Cloud Storage bucket name. - */ - bucketName: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendBucket. - */ - enableCdn: boolean; - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Contains a list of BackendBucket resources. - */ -export interface Schema$BackendBucketList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendBucket resources. - */ - items: Schema$BackendBucket[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A BackendService resource. This resource defines a group of backend virtual - * machines and their serving capacity. (== resource_for v1.backendService ==) - * (== resource_for beta.backendService ==) - */ -export interface Schema$BackendService { - /** - * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. If - * set to 0, the cookie is non-persistent and lasts only until the end of the - * browser session (or equivalent). The maximum allowed value for TTL is one - * day. When the load balancing scheme is INTERNAL, this field is not used. - */ - affinityCookieTtlSec: number; - /** - * The list of backends that serve this BackendService. - */ - backends: Schema$Backend[]; - /** - * Cloud CDN configuration for this BackendService. - */ - cdnPolicy: Schema$BackendServiceCdnPolicy; - connectionDraining: Schema$ConnectionDraining; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If true, enable Cloud CDN for this BackendService. When the load balancing - * scheme is INTERNAL, this field is not used. - */ - enableCDN: boolean; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a BackendService. An up-to-date fingerprint must be provided in - * order to update the BackendService. - */ - fingerprint: string; - /** - * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for - * health checking this BackendService. Currently at most one health check can - * be specified, and a health check is required for Compute Engine backend - * services. A health check must not be specified for App Engine backend and - * Cloud Function backend. For internal load balancing, a URL to a - * HealthCheck resource must be specified instead. - */ - healthChecks: string[]; - iap: Schema$BackendServiceIAP; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#backendService for backend - * services. - */ - kind: string; - /** - * Indicates whether the backend service will be used with internal or - * external load balancing. A backend service created for one type of load - * balancing cannot be used with the other. Possible values are INTERNAL and - * EXTERNAL. - */ - loadBalancingScheme: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Deprecated in favor of portName. The TCP port to connect on the backend. - * The default value is 80. This cannot be used for internal load balancing. - */ - port: number; - /** - * Name of backend port. The same name should appear in the instance groups - * referenced by this service. Required when the load balancing scheme is - * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not - * used. - */ - portName: string; - /** - * The protocol this BackendService uses to communicate with backends. - * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For - * internal load balancing, the possible values are TCP and UDP, and the - * default is TCP. - */ - protocol: string; - /** - * [Output Only] URL of the region where the regional backend service resides. - * This field is not applicable to global backend services. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Type of session affinity to use. The default is NONE. When the load - * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or GENERATED_COOKIE. - * When the load balancing scheme is INTERNAL, can be NONE, CLIENT_IP, - * CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the protocol is UDP, this - * field is not used. - */ - sessionAffinity: string; - /** - * How many seconds to wait for the backend before considering it a failed - * request. Default is 30 seconds. - */ - timeoutSec: number; -} -/** - * Contains a list of BackendServicesScopedList. - */ -export interface Schema$BackendServiceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendServicesScopedList resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Message containing Cloud CDN configuration for a backend service. - */ -export interface Schema$BackendServiceCdnPolicy { - /** - * The CacheKeyPolicy for this CdnPolicy. - */ - cacheKeyPolicy: Schema$CacheKeyPolicy; -} -export interface Schema$BackendServiceGroupHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceGroupHealth - * for the health of backend services. - */ - kind: string; -} -/** - * Identity-Aware Proxy - */ -export interface Schema$BackendServiceIAP { - enabled: boolean; - oauth2ClientId: string; - oauth2ClientSecret: string; - /** - * [Output Only] SHA256 hash value for the field oauth2_client_secret above. - */ - oauth2ClientSecretSha256: string; -} -/** - * Contains a list of BackendService resources. - */ -export interface Schema$BackendServiceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of BackendService resources. - */ - items: Schema$BackendService[]; - /** - * [Output Only] Type of resource. Always compute#backendServiceList for lists - * of backend services. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$BackendServicesScopedList { - /** - * A list of BackendServices contained in this scope. - */ - backendServices: Schema$BackendService[]; - /** - * Informational warning which replaces the list of backend services when the - * list is empty. - */ - warning: any; -} -export interface Schema$CacheInvalidationRule { - /** - * If set, this invalidation rule will only apply to requests with a Host - * header matching host. - */ - host: string; - path: string; -} -/** - * Message containing what to include in the cache key for a request for Cloud - * CDN. - */ -export interface Schema$CacheKeyPolicy { - /** - * If true, requests to different hosts will be cached separately. - */ - includeHost: boolean; - /** - * If true, http and https requests will be cached separately. - */ - includeProtocol: boolean; - /** - * If true, include query string parameters in the cache key according to - * query_string_whitelist and query_string_blacklist. If neither is set, the - * entire query string will be included. If false, the query string will be - * excluded from the cache key entirely. - */ - includeQueryString: boolean; - /** - * Names of query string parameters to exclude in cache keys. All other - * parameters will be included. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringBlacklist: string[]; - /** - * Names of query string parameters to include in cache keys. All other - * parameters will be excluded. Either specify query_string_whitelist or - * query_string_blacklist, not both. '&' and '=' will be - * percent encoded and not treated as delimiters. - */ - queryStringWhitelist: string[]; -} -/** - * Represents a Commitment resource. Creating a Commitment resource means that - * you are purchasing a committed use contract with an explicit start and end - * time. You can create commitments based on vCPUs and memory usage and receive - * discounted rates. For full details, read Signing Up for Committed Use - * Discounts. Committed use discounts are subject to Google Cloud - * Platform's Service Specific Terms. By purchasing a committed use - * discount, you agree to these terms. Committed use discounts will not renew, - * so you must purchase a new commitment to continue receiving discounts. (== - * resource_for beta.commitments ==) (== resource_for v1.commitments ==) - */ -export interface Schema$Commitment { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Commitment end time in RFC3339 text format. - */ - endTimestamp: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#commitment for - * commitments. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The plan for this commitment, which determines duration and discount rate. - * The currently supported plans are TWELVE_MONTH (1 year), and - * THIRTY_SIX_MONTH (3 years). - */ - plan: string; - /** - * [Output Only] URL of the region where this commitment may be used. - */ - region: string; - /** - * A list of commitment amounts for particular resources. Note that VCPU and - * MEMORY resource commitments must occur together. - */ - resources: Schema$ResourceCommitment[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Commitment start time in RFC3339 text format. - */ - startTimestamp: string; - /** - * [Output Only] Status of the commitment with regards to eventual expiration - * (each commitment has an end date defined). One of the following values: - * NOT_YET_ACTIVE, ACTIVE, EXPIRED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; -} -export interface Schema$CommitmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of CommitmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#commitmentAggregatedList for - * aggregated lists of commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Commitment resources. - */ -export interface Schema$CommitmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Commitment resources. - */ - items: Schema$Commitment[]; - /** - * [Output Only] Type of resource. Always compute#commitmentList for lists of - * commitments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$CommitmentsScopedList { - /** - * [Output Only] A list of commitments contained in this scope. - */ - commitments: Schema$Commitment[]; - /** - * [Output Only] Informational warning which replaces the list of commitments - * when the list is empty. - */ - warning: any; -} -/** - * Message containing connection draining configuration. - */ -export interface Schema$ConnectionDraining { - /** - * Time for which instance will be drained (not accept new connections, but - * still work to finish started). - */ - drainingTimeoutSec: number; -} -/** - * Represents a customer-supplied encryption key - */ -export interface Schema$CustomerEncryptionKey { - /** - * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 - * base64 to either encrypt or decrypt this resource. - */ - rawKey: string; - /** - * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the - * customer-supplied encryption key that protects this resource. - */ - sha256: string; -} -export interface Schema$CustomerEncryptionKeyProtectedDisk { - /** - * Decrypts data associated with the disk with a customer-supplied encryption - * key. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * Specifies a valid partial or full URL to an existing Persistent Disk - * resource. This field is only applicable for persistent disks. - */ - source: string; -} -/** - * Deprecation status for a public resource. - */ -export interface Schema$DeprecationStatus { - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DELETED. This is only informational and the status - * will not change unless the client explicitly changes it. - */ - deleted: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to DEPRECATED. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - deprecated: string; - /** - * An optional RFC3339 timestamp on or after which the state of this resource - * is intended to change to OBSOLETE. This is only informational and the - * status will not change unless the client explicitly changes it. - */ - obsolete: string; - /** - * The URL of the suggested replacement for a deprecated resource. The - * suggested replacement resource must be the same kind of resource as the - * deprecated resource. - */ - replacement: string; - /** - * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, - * or DELETED. Operations which create a new resource using a DEPRECATED - * resource will return successfully, but with a warning indicating the - * deprecated resource and recommending its replacement. Operations which use - * OBSOLETE or DELETED resources will be rejected and result in an error. - */ - state: string; -} -/** - * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks - * ==) - */ -export interface Schema$Disk { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Encrypts the disk using a customer-supplied encryption key. After you - * encrypt a disk with a customer-supplied key, you must provide the same key - * if you use the disk later (e.g. to create a disk snapshot or an image, or - * to attach the disk to a virtual machine). Customer-supplied encryption - * keys do not protect access to metadata of the disk. If you do not provide - * an encryption key when creating the disk, then the disk will be encrypted - * using an automatically generated key and you do not need to provide a key - * to use the disk later. - */ - diskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#disk for disks. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this disk, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a disk. - */ - labelFingerprint: string; - /** - * Labels to apply to this disk. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * [Output Only] Last attach timestamp in RFC3339 text format. - */ - lastAttachTimestamp: string; - /** - * [Output Only] Last detach timestamp in RFC3339 text format. - */ - lastDetachTimestamp: string; - /** - * Integer license codes indicating which licenses are attached to this disk. - */ - licenseCodes: string[]; - /** - * Any applicable publicly visible licenses. - */ - licenses: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Internal use only. - */ - options: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * Size of the persistent disk, specified in GB. You can specify this field - * when creating a persistent disk using the sourceImage or sourceSnapshot - * parameter, or specify it alone to create an empty persistent disk. If you - * specify this field along with sourceImage or sourceSnapshot, the value of - * sizeGb must not be less than the size of the sourceImage or the size of the - * snapshot. Acceptable values are 1 to 65536, inclusive. - */ - sizeGb: string; - /** - * The source image used to create this disk. If the source image is deleted, - * this field will not be set. To create a disk with one of the public - * operating system images, specify the image by its family name. For example, - * specify family/debian-8 to use the latest Debian 8 image: - * projects/debian-cloud/global/images/family/debian-8 Alternatively, use a - * specific version of a public operating system image: - * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create a - * disk with a custom image that you created, specify the image name in the - * following format: global/images/my-custom-image You can also specify a - * custom image by its image family, which returns the latest version of the - * image in that family. Replace the image name with family/family-name: - * global/images/family/my-image-family - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this disk. This - * value identifies the exact image that was used to create this persistent - * disk. For example, if you created the persistent disk from an image that - * was later deleted and recreated under the same name, the source image ID - * would identify the exact version of the image that was used. - */ - sourceImageId: string; - /** - * The source snapshot used to create this disk. You can provide this as a - * partial or full URL to the resource. For example, the following are valid - * values: - - * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot - * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The unique ID of the snapshot used to create this disk. This - * value identifies the exact snapshot that was used to create this persistent - * disk. For example, if you created the persistent disk from a snapshot that - * was later deleted and recreated under the same name, the source snapshot ID - * would identify the exact version of the snapshot that was used. - */ - sourceSnapshotId: string; - /** - * [Output Only] The status of disk creation. - */ - status: string; - /** - * URL of the disk type resource describing which disk type to use to create - * the disk. Provide this when creating the disk. For example: - * project/zones/zone/diskTypes/pd-standard or pd-ssd - */ - type: string; - /** - * [Output Only] Links to the users of the disk (attached instances) in form: - * project/zones/zone/instances/instance - */ - users: string[]; - /** - * [Output Only] URL of the zone where the disk resides. You must specify this - * field as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$DiskAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DisksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskAggregatedList for - * aggregated lists of persistent disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A list of Disk resources. - */ -export interface Schema$DiskList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Disk resources. - */ - items: Schema$Disk[]; - /** - * [Output Only] Type of resource. Always compute#diskList for lists of disks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskMoveRequest { - /** - * The URL of the destination zone to move the disk. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target disk to move. This can be a full or partial URL. For - * example, the following are all valid URLs to a disk: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - targetDisk: string; -} -export interface Schema$DisksResizeRequest { - /** - * The new size of the persistent disk, which is specified in GB. - */ - sizeGb: string; -} -export interface Schema$DisksScopedList { - /** - * [Output Only] A list of disks contained in this scope. - */ - disks: Schema$Disk[]; - /** - * [Output Only] Informational warning which replaces the list of disks when - * the list is empty. - */ - warning: any; -} -/** - * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for - * v1.diskTypes ==) - */ -export interface Schema$DiskType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Server-defined default disk size in GB. - */ - defaultDiskSizeGb: string; - /** - * [Output Only] The deprecation status associated with this disk type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional description of this resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#diskType for disk types. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] An optional textual description of the valid disk size, such - * as "10GB-10TB". - */ - validDiskSize: string; - /** - * [Output Only] URL of the zone where the disk type resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$DiskTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of disk types. - */ -export interface Schema$DiskTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of DiskType resources. - */ - items: Schema$DiskType[]; - /** - * [Output Only] Type of resource. Always compute#diskTypeList for disk types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$DiskTypesScopedList { - /** - * [Output Only] A list of disk types contained in this scope. - */ - diskTypes: Schema$DiskType[]; - /** - * [Output Only] Informational warning which replaces the list of disk types - * when the list is empty. - */ - warning: any; -} -/** - * Represents a Firewall resource. - */ -export interface Schema$Firewall { - /** - * The list of ALLOW rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a permitted connection. - */ - allowed: any[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The list of DENY rules specified by this firewall. Each rule specifies a - * protocol and port-range tuple that describes a denied connection. - */ - denied: any[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * If destination ranges are specified, the firewall will apply only to - * traffic that has destination IP address in these ranges. These ranges must - * be expressed in CIDR format. Only IPv4 is supported. - */ - destinationRanges: string[]; - /** - * Direction of traffic to which this firewall applies; default is INGRESS. - * Note: For INGRESS traffic, it is NOT supported to specify - * destinationRanges; For EGRESS traffic, it is NOT supported to specify - * sourceRanges OR sourceTags. - */ - direction: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#firewall for firewall - * rules. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network resource for this firewall rule. If not specified when - * creating a firewall rule, the default network is used: - * global/networks/default If you choose to specify this property, you can - * specify the network as a full or partial URL. For example, the following - * are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network - * - projects/myproject/global/networks/my-network - global/networks/default - */ - network: string; - /** - * Priority for this rule. This is an integer between 0 and 65535, both - * inclusive. When not specified, the value assumed is 1000. Relative - * priorities determine precedence of conflicting rules. Lower value of - * priority implies higher precedence (eg, a rule with priority 0 has higher - * precedence than a rule with priority 1). DENY rules take precedence over - * ALLOW rules having equal priority. - */ - priority: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If source ranges are specified, the firewall will apply only to traffic - * that has source IP address in these ranges. These ranges must be expressed - * in CIDR format. One or both of sourceRanges and sourceTags may be set. If - * both properties are set, the firewall will apply to traffic that has source - * IP address within sourceRanges OR the source IP that belongs to a tag - * listed in the sourceTags property. The connection does not need to match - * both properties for the firewall to apply. Only IPv4 is supported. - */ - sourceRanges: string[]; - /** - * If source service accounts are specified, the firewall will apply only to - * traffic originating from an instance with a service account in this list. - * Source service accounts cannot be used to control traffic to an - * instance's external IP address because service accounts are associated - * with an instance, not an IP address. sourceRanges can be set at the same - * time as sourceServiceAccounts. If both are set, the firewall will apply to - * traffic that has source IP address within sourceRanges OR the source IP - * belongs to an instance with service account listed in sourceServiceAccount. - * The connection does not need to match both properties for the firewall to - * apply. sourceServiceAccounts cannot be used at the same time as sourceTags - * or targetTags. - */ - sourceServiceAccounts: string[]; - /** - * If source tags are specified, the firewall rule applies only to traffic - * with source IPs that match the primary network interfaces of VM instances - * that have the tag and are in the same VPC network. Source tags cannot be - * used to control traffic to an instance's external IP address, it only - * applies to traffic between instances in the same virtual network. Because - * tags are associated with instances, not IP addresses. One or both of - * sourceRanges and sourceTags may be set. If both properties are set, the - * firewall will apply to traffic that has source IP address within - * sourceRanges OR the source IP that belongs to a tag listed in the - * sourceTags property. The connection does not need to match both properties - * for the firewall to apply. - */ - sourceTags: string[]; - /** - * A list of service accounts indicating sets of instances located in the - * network that may make network connections as specified in allowed[]. - * targetServiceAccounts cannot be used at the same time as targetTags or - * sourceTags. If neither targetServiceAccounts nor targetTags are specified, - * the firewall rule applies to all instances on the specified network. - */ - targetServiceAccounts: string[]; - /** - * A list of tags that controls which instances the firewall rule applies to. - * If targetTags are specified, then the firewall rule applies only to - * instances in the VPC network that have one of those tags. If no targetTags - * are specified, the firewall rule applies to all instances on the specified - * network. - */ - targetTags: string[]; -} -/** - * Contains a list of firewalls. - */ -export interface Schema$FirewallList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Firewall resources. - */ - items: Schema$Firewall[]; - /** - * [Output Only] Type of resource. Always compute#firewallList for lists of - * firewalls. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A ForwardingRule resource. A ForwardingRule resource specifies which pool of - * target virtual machines to forward a packet to if it matches the given - * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules - * ==) (== resource_for v1.forwardingRules ==) (== resource_for - * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules ==) - * (== resource_for beta.regionForwardingRules ==) (== resource_for - * v1.regionForwardingRules ==) - */ -export interface Schema$ForwardingRule { - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the BackendService resource to receive the - * matched traffic. - */ - backendService: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The IP address that this forwarding rule is serving on behalf of. Addresses - * are restricted based on the forwarding rule's load balancing scheme - * (EXTERNAL or INTERNAL) and scope (global or regional). When the load - * balancing scheme is EXTERNAL, for global forwarding rules, the address must - * be a global IP, and for regional forwarding rules, the address must live in - * the same region as the forwarding rule. If this field is empty, an - * ephemeral IPv4 address from the same scope (global or regional) will be - * assigned. A regional forwarding rule supports IPv4 only. A global - * forwarding rule supports either IPv4 or IPv6. When the load balancing - * scheme is INTERNAL, this can only be an RFC 1918 IP address belonging to - * the network/subnet configured for the forwarding rule. By default, if this - * field is empty, an ephemeral internal IP address will be automatically - * allocated from the IP range of the subnet or network configured for this - * forwarding rule. An address can be specified either by a literal IP - * address or a URL reference to an existing Address resource. The following - * examples are all valid: - 100.1.2.3 - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address - * - projects/project/regions/region/addresses/address - - * regions/region/addresses/address - global/addresses/address - address - */ - IPAddress: string; - /** - * The IP protocol to which this rule applies. Valid options are TCP, UDP, - * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only - * TCP and UDP are valid. - */ - IPProtocol: string; - /** - * The IP Version that will be used by this forwarding rule. Valid options are - * IPV4 or IPV6. This can only be specified for a global forwarding rule. - */ - ipVersion: string; - /** - * [Output Only] Type of the resource. Always compute#forwardingRule for - * Forwarding Rule resources. - */ - kind: string; - /** - * This signifies what the ForwardingRule will be used for and can only take - * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that - * this will be used for Internal Network Load Balancing (TCP, UDP). The value - * of EXTERNAL means that this will be used for External Load Balancing - * (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) - */ - loadBalancingScheme: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the network that the load balanced IP - * should belong to for this Forwarding Rule. If this field is not specified, - * the default network will be used. - */ - network: string; - /** - * This field is used along with the target field for TargetHttpProxy, - * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, - * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, - * or SCTP, only packets addressed to ports in the specified range will be - * forwarded to target. Forwarding rules with the same [IPAddress, IPProtocol] - * pair must have disjoint port ranges. Some types of forwarding target have - * constraints on the acceptable ports: - TargetHttpProxy: 80, 8080 - - * TargetHttpsProxy: 443 - TargetTcpProxy: 25, 43, 110, 143, 195, 443, 465, - * 587, 700, 993, 995, 1688, 1883, 5222 - TargetSslProxy: 25, 43, 110, 143, - * 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - TargetVpnGateway: - * 500, 4500 - */ - portRange: string; - /** - * This field is used along with the backend_service field for internal load - * balancing. When the load balancing scheme is INTERNAL, a single port or a - * comma separated list of ports can be configured. Only packets addressed to - * these ports will be forwarded to the backends configured with this - * forwarding rule. You may specify a maximum of up to 5 ports. - */ - ports: string[]; - /** - * [Output Only] URL of the region where the regional forwarding rule resides. - * This field is not applicable to global forwarding rules. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * This field is not used for external load balancing. For internal load - * balancing, this field identifies the subnetwork that the load balanced IP - * should belong to for this Forwarding Rule. If the network specified is in - * auto subnet mode, this field is optional. However, if the network is in - * custom subnet mode, a subnetwork must be specified. - */ - subnetwork: string; - /** - * The URL of the target resource to receive the matched traffic. For regional - * forwarding rules, this target must live in the same region as the - * forwarding rule. For global forwarding rules, this target must be a global - * load balancing resource. The forwarded traffic must be of a type - * appropriate to the target object. - */ - target: string; -} -export interface Schema$ForwardingRuleAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRulesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#forwardingRuleAggregatedList - * for lists of forwarding rules. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of ForwardingRule resources. - */ -export interface Schema$ForwardingRuleList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of ForwardingRule resources. - */ - items: Schema$ForwardingRule[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ForwardingRulesScopedList { - /** - * A list of forwarding rules contained in this scope. - */ - forwardingRules: Schema$ForwardingRule[]; - /** - * Informational warning which replaces the list of forwarding rules when the - * list is empty. - */ - warning: any; -} -export interface Schema$GlobalSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash when updating or changing labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * A list of labels to apply for this resource. Each label key & value - * must comply with RFC1035. Specifically, the name must be 1-63 characters - * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which - * means the first character must be a lowercase letter, and all following - * characters must be a dash, lowercase letter, or digit, except the last - * character, which cannot be a dash. For example, - * "webserver-frontend": "images". A label value can also - * be empty (e.g. "my-label": ""). - */ - labels: any; -} -/** - * Guest OS features. - */ -export interface Schema$GuestOsFeature { - /** - * The ID of a supported feature. Read Enabling guest operating system - * features to see a list of available options. - */ - type: string; -} -/** - * An HealthCheck resource. This resource defines a template for how individual - * virtual machines should be checked for health, via one of the supported - * protocols. - */ -export interface Schema$HealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in 3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - httpHealthCheck: Schema$HTTPHealthCheck; - httpsHealthCheck: Schema$HTTPSHealthCheck; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - sslHealthCheck: Schema$SSLHealthCheck; - tcpHealthCheck: Schema$TCPHealthCheck; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If - * not specified, the default is TCP. Exactly one of the protocol-specific - * health check field must be specified, which must match type field. - */ - type: string; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -/** - * Contains a list of HealthCheck resources. - */ -export interface Schema$HealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HealthCheck resources. - */ - items: Schema$HealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A full or valid partial URL to a health check. For example, the following are - * valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check - * - projects/project-id/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ -export interface Schema$HealthCheckReference { healthCheck: string; } -export interface Schema$HealthStatus { - /** - * Health state of the instance. - */ - healthState: string; - /** - * URL of the instance resource. - */ - instance: string; - /** - * The IP address represented by this resource. - */ - ipAddress: string; - /** - * The port on the instance. - */ - port: number; -} -/** - * UrlMaps A host-matching rule for a URL. If matched, will use the named - * PathMatcher to select the BackendService. - */ -export interface Schema$HostRule { - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The list of host patterns to match. They must be valid hostnames, except * - * will match any string of ([a-z0-9-.]*). In that case, * must be the first - * character and must be followed in the pattern by either - or .. - */ - hosts: string[]; - /** - * The name of the PathMatcher to use to match the path portion of the URL if - * the hostRule matches the URL's host portion. - */ - pathMatcher: string; -} -/** - * An HttpHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTP. - */ -export interface Schema$HttpHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#httpHealthCheck for HTTP - * health checks. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTP health check request. The default value - * is 80. - */ - port: number; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPHealthCheck { - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTP health check request. The default value is /. - */ - requestPath: string; -} -/** - * Contains a list of HttpHealthCheck resources. - */ -export interface Schema$HttpHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpHealthCheck resources. - */ - items: Schema$HttpHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An HttpsHealthCheck resource. This resource defines a template for how - * individual instances should be checked for health, via HTTPS. - */ -export interface Schema$HttpsHealthCheck { - /** - * How often (in seconds) to send a health check. The default value is 5 - * seconds. - */ - checkIntervalSec: number; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A so-far unhealthy instance will be marked healthy after this many - * consecutive successes. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the public IP on behalf of which this health check - * is performed will be used. - */ - host: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The TCP port number for the HTTPS health check request. The default value - * is 443. - */ - port: number; - /** - * The request path of the HTTPS health check request. The default value is - * "/". - */ - requestPath: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * How long (in seconds) to wait before claiming failure. The default value is - * 5 seconds. It is invalid for timeoutSec to have a greater value than - * checkIntervalSec. - */ - timeoutSec: number; - /** - * A so-far healthy instance will be marked unhealthy after this many - * consecutive failures. The default value is 2. - */ - unhealthyThreshold: number; -} -export interface Schema$HTTPSHealthCheck { - /** - * The value of the host header in the HTTPS health check request. If left - * empty (default value), the IP on behalf of which this health check is - * performed will be used. - */ - host: string; - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The request path of the HTTPS health check request. The default value is /. - */ - requestPath: string; -} -/** - * Contains a list of HttpsHealthCheck resources. - */ -export interface Schema$HttpsHealthCheckList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of HttpsHealthCheck resources. - */ - items: Schema$HttpsHealthCheck[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Image resource. (== resource_for beta.images ==) (== resource_for - * v1.images ==) - */ -export interface Schema$Image { - /** - * Size of the image tar.gz archive stored in Google Cloud Storage (in bytes). - */ - archiveSizeBytes: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The deprecation status associated with this image. - */ - deprecated: Schema$DeprecationStatus; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Size of the image when restored onto a persistent disk (in GB). - */ - diskSizeGb: string; - /** - * The name of the image family to which this image belongs. You can create - * disks by specifying an image family instead of a specific image name. The - * image family always returns its latest image that is not deprecated. The - * name of the image family must comply with RFC1035. - */ - family: string; - /** - * A list of features to enable on the guest operating system. Applicable only - * for bootable images. Read Enabling guest operating system features to see - * a list of available options. - */ - guestOsFeatures: Schema$GuestOsFeature[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Encrypts the image using a customer-supplied encryption key. After you - * encrypt an image with a customer-supplied key, you must provide the same - * key if you use the image later (e.g. to create a disk from the image). - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the image, - * then the disk will be encrypted using an automatically generated key and - * you do not need to provide a key to use the image later. - */ - imageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] Type of the resource. Always compute#image for images. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this image, which is - * essentially a hash of the labels used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve an image. - */ - labelFingerprint: string; - /** - * Labels to apply to this image. These can be later modified by the setLabels - * method. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this image. - */ - licenseCodes: string[]; - /** - * Any applicable license URI. - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The parameters of the raw disk image. - */ - rawDisk: any; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL of the source disk used to create this image. This can be a full or - * valid partial URL. You must provide either this property or the - * rawDisk.source property but not both to create an image. For example, the - * following are valid values: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk - * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * The ID value of the disk used to create this image. This value may be used - * to determine whether the image was taken from the current or a previous - * instance of a given disk name. - */ - sourceDiskId: string; - /** - * URL of the source image used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the rawDisk.source property, or - the sourceDisk property in order to - * create an image. - */ - sourceImage: string; - /** - * The customer-supplied encryption key of the source image. Required if the - * source image is protected by a customer-supplied encryption key. - */ - sourceImageEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the image used to create this image. This - * value may be used to determine whether the image was taken from the current - * or a previous instance of a given image name. - */ - sourceImageId: string; - /** - * URL of the source snapshot used to create this image. This can be a full or - * valid partial URL. You must provide exactly one of: - this property, or - * - the sourceImage property, or - the rawDisk.source property, or - the - * sourceDisk property in order to create an image. - */ - sourceSnapshot: string; - /** - * The customer-supplied encryption key of the source snapshot. Required if - * the source snapshot is protected by a customer-supplied encryption key. - */ - sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the snapshot used to create this image. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given snapshot name. - */ - sourceSnapshotId: string; - /** - * The type of the image used to create this disk. The default and only value - * is RAW - */ - sourceType: string; - /** - * [Output Only] The status of the image. An image can be used to create other - * resources, such as instances, only after the image has been successfully - * created and the status is set to READY. Possible values are FAILED, - * PENDING, or READY. - */ - status: string; -} -/** - * Contains a list of images. - */ -export interface Schema$ImageList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Image resources. - */ - items: Schema$Image[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance resource. (== resource_for beta.instances ==) (== resource_for - * v1.instances ==) - */ -export interface Schema$Instance { - /** - * Allows this instance to send and receive packets with non-matching - * destination or source IPs. This is required if you plan to use this - * instance to forward routes. For more information, see Enabling IP - * Forwarding. - */ - canIpForward: boolean; - /** - * [Output Only] The CPU platform used by this instance. - */ - cpuPlatform: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Whether the resource should be protected against deletion. - */ - deletionProtection: boolean; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Array of disks associated with this instance. Persistent disks must be - * created before you can assign them. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#instance for instances. - */ - kind: string; - /** - * A fingerprint for this request, which is essentially a hash of the - * metadata's contents and used for optimistic locking. The fingerprint is - * initially generated by Compute Engine and changes after every request to - * modify or update metadata. You must always provide an up-to-date - * fingerprint hash in order to update or change metadata. To see the latest - * fingerprint, make get() request to the instance. - */ - labelFingerprint: string; - /** - * Labels to apply to this instance. These can be later modified by the - * setLabels method. - */ - labels: any; - /** - * Full or partial URL of the machine type resource to use for this instance, - * in the format: zones/zone/machineTypes/machine-type. This is provided by - * the client when the instance is created. For example, the following is a - * valid partial url to a predefined machine type: - * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom machine - * type, provide a URL to a machine type in the following format, where CPUS - * is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and MEMORY is the - * total memory for this instance. Memory must be a multiple of 256 MB and - * must be supplied in MB (e.g. 5 GB of memory is 5120 MB): - * zones/zone/machineTypes/custom-CPUS-MEMORY For example: - * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of - * restrictions, read the Specifications for custom machine types. - */ - machineType: string; - /** - * The metadata key/value pairs assigned to this instance. This includes - * custom metadata and predefined keys. - */ - metadata: Schema$Metadata; - /** - * Specifies a minimum CPU platform for the VM instance. Applicable values are - * the friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". - */ - minCpuPlatform: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The resource name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * An array of network configurations for this instance. These specify how - * interfaces are configured to interact with other network services, such as - * connecting to the internet. Multiple interfaces are supported per instance. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Sets the scheduling options for this instance. - */ - scheduling: Schema$Scheduling; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * A list of service accounts, with their specified scopes, authorized for - * this instance. Only one service account per VM instance is supported. - * Service accounts generate access tokens that can be accessed through the - * metadata server and used to authenticate applications on the instance. See - * Service Accounts for more information. - */ - serviceAccounts: Schema$ServiceAccount[]; - /** - * [Output Only] Whether a VM has been restricted for start because Compute - * Engine has detected suspicious activity. - */ - startRestricted: boolean; - /** - * [Output Only] The status of the instance. One of the following values: - * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, - * and TERMINATED. - */ - status: string; - /** - * [Output Only] An optional, human-readable explanation of the status. - */ - statusMessage: string; - /** - * A list of tags to apply to this instance. Tags are used to identify valid - * sources or targets for network firewalls and are specified by the client - * during instance creation. The tags can be later modified by the setTags - * method. Each tag within the list must comply with RFC1035. - */ - tags: Schema$Tags; - /** - * [Output Only] URL of the zone where the instance resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - zone: string; -} -export interface Schema$InstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstancesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#instanceAggregatedList for - * aggregated lists of Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for - * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== - * resource_for v1.regionInstanceGroups ==) - */ -export interface Schema$InstanceGroup { - /** - * [Output Only] The creation timestamp for this instance group in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The fingerprint of the named ports. The system uses this - * fingerprint to detect conflicts when multiple users change the named ports - * concurrently. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this instance group, generated by the - * server. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceGroup for - * instance groups. - */ - kind: string; - /** - * The name of the instance group. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * Assigns a name to a port number. For example: {name: "http", - * port: 80} This allows the system to reference ports by the assigned name - * instead of a port number. Named ports can also contain multiple ports. For - * example: [{name: "http", port: 80},{name: "http", port: - * 8080}] Named ports apply to all instances in this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * The URL of the network to which all instances in the instance group belong. - */ - network: string; - /** - * [Output Only] The URL of the region where the instance group is located - * (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this instance group. The server generates this - * URL. - */ - selfLink: string; - /** - * [Output Only] The total number of instances in the instance group. - */ - size: number; - /** - * [Output Only] The URL of the subnetwork to which all instances in the - * instance group belong. - */ - subnetwork: string; - /** - * [Output Only] The URL of the zone where the instance group is located (for - * zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupsScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupAggregatedList for aggregated lists of instance - * groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A list of InstanceGroup resources. - */ -export interface Schema$InstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * [Output Only] The resource type, which is always compute#instanceGroupList - * for instance group lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An Instance Group Manager resource. (== resource_for - * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers ==) - * (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for - * v1.regionInstanceGroupManagers ==) - */ -export interface Schema$InstanceGroupManager { - /** - * The base instance name to use for instances in this group. The value must - * be 1-58 characters long. Instances are named by appending a hyphen and a - * random four-character string to the base instance name. The base instance - * name must comply with RFC1035. - */ - baseInstanceName: string; - /** - * [Output Only] The creation timestamp for this managed instance group in - * RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The list of instance actions and the number of instances in - * this managed instance group that are scheduled for each of those actions. - */ - currentActions: Schema$InstanceGroupManagerActionsSummary; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The fingerprint of the resource data. You can use this - * optional field for optimistic locking when you update the resource. - */ - fingerprint: string; - /** - * [Output Only] A unique identifier for this resource type. The server - * generates this identifier. - */ - id: string; - /** - * [Output Only] The URL of the Instance Group resource. - */ - instanceGroup: string; - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManager for managed instance groups. - */ - kind: string; - /** - * The name of the managed instance group. The name must be 1-63 characters - * long, and comply with RFC1035. - */ - name: string; - /** - * Named ports configured for the Instance Groups complementary to this - * Instance Group Manager. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The URL of the region where the managed instance group - * resides (for regional resources). - */ - region: string; - /** - * [Output Only] The URL for this managed instance group. The server defines - * this URL. - */ - selfLink: string; - /** - * The URLs for all TargetPool resources to which instances in the - * instanceGroup field are added. The target pools automatically apply to all - * of the instances in the managed instance group. - */ - targetPools: string[]; - /** - * The target number of running instances for this managed instance group. - * Deleting or abandoning instances reduces this number. Resizing the group - * changes this number. - */ - targetSize: number; - /** - * [Output Only] The URL of the zone where the managed instance group is - * located (for zonal resources). - */ - zone: string; -} -export interface Schema$InstanceGroupManagerActionsSummary { - /** - * [Output Only] The total number of instances in the managed instance group - * that are scheduled to be abandoned. Abandoning an instance removes it from - * the managed instance group without deleting it. - */ - abandoning: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be created or are currently being created. If the group - * fails to create any of these instances, it tries again until it creates the - * instance successfully. If you have disabled creation retries, this field - * will not be populated; instead, the creatingWithoutRetries field will be - * populated. - */ - creating: number; - /** - * [Output Only] The number of instances that the managed instance group will - * attempt to create. The group attempts to create each instance only once. If - * the group fails to create any of these instances, it decreases the - * group's targetSize value accordingly. - */ - creatingWithoutRetries: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be deleted or are currently being deleted. - */ - deleting: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are running and have no scheduled actions. - */ - none: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be recreated or are currently being being recreated. - * Recreating an instance deletes the existing root persistent disk and - * creates a new disk from the image that is defined in the instance template. - */ - recreating: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are being reconfigured with properties that do not require a restart or a - * recreate action. For example, setting or removing target pools for the - * instance. - */ - refreshing: number; - /** - * [Output Only] The number of instances in the managed instance group that - * are scheduled to be restarted or are currently being restarted. - */ - restarting: number; -} -export interface Schema$InstanceGroupManagerAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManagersScopedList resources. - */ - items: any; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerAggregatedList for an aggregated list of - * managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * [Output Only] A list of managed instance groups. - */ -export interface Schema$InstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersListManagedInstancesResponse { - /** - * [Output Only] The list of instances in the managed instance group. - */ - managedInstances: Schema$ManagedInstance[]; -} -export interface Schema$InstanceGroupManagersRecreateInstancesRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersScopedList { - /** - * [Output Only] The list of managed instance groups that are contained in the - * specified project and zone. - */ - instanceGroupManagers: Schema$InstanceGroupManager[]; - /** - * [Output Only] The warning that replaces the list of managed instance groups - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { - /** - * The URL of the instance template that is specified for this managed - * instance group. The group uses this template to create all new instances in - * the managed instance group. - */ - instanceTemplate: string; -} -export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { - /** - * The fingerprint of the target pools information. Use this optional property - * to prevent conflicts when multiple users change the target pools settings - * concurrently. Obtain the fingerprint with the instanceGroupManagers.get - * method. Then, include the fingerprint in your request to ensure that you do - * not overwrite changes that were applied from another concurrent request. - */ - fingerprint: string; - /** - * The list of target pool URLs that instances in this managed instance group - * belong to. The managed instance group applies these target pools to all of - * the instances in the group. Existing instances and new instances in the - * group all receive these target pool settings. - */ - targetPools: string[]; -} -export interface Schema$InstanceGroupsAddInstancesRequest { - /** - * The list of instances to add to the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupsListInstances for the list of instances in the - * specified instance group. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceGroupsListInstancesRequest { - /** - * A filter for the state of the instances in the instance group. Valid - * options are ALL or RUNNING. If you do not specify this parameter the list - * includes all instances regardless of their state. - */ - instanceState: string; -} -export interface Schema$InstanceGroupsRemoveInstancesRequest { - /** - * The list of instances to remove from the instance group. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$InstanceGroupsScopedList { - /** - * [Output Only] The list of instance groups that are contained in this scope. - */ - instanceGroups: Schema$InstanceGroup[]; - /** - * [Output Only] An informational warning that replaces the list of instance - * groups when the list is empty. - */ - warning: any; -} -export interface Schema$InstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of instances. - */ -export interface Schema$InstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Instance resources. - */ - items: Schema$Instance[]; - /** - * [Output Only] Type of resource. Always compute#instanceList for lists of - * Instance resources. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of instance referrers. - */ -export interface Schema$InstanceListReferrers { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Reference resources. - */ - items: Schema$Reference[]; - /** - * [Output Only] Type of resource. Always compute#instanceListReferrers for - * lists of Instance referrers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceMoveRequest { - /** - * The URL of the destination zone to move the instance. This can be a full or - * partial URL. For example, the following are all valid URLs to a zone: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone - - * projects/project/zones/zone - zones/zone - */ - destinationZone: string; - /** - * The URL of the target instance to move. This can be a full or partial URL. - * For example, the following are all valid URLs to an instance: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - targetInstance: string; -} -export interface Schema$InstanceProperties { - /** - * Enables instances created based on this template to send packets with - * source IP addresses other than their own and receive packets with - * destination IP addresses other than their own. If these instances will be - * used as an IP gateway or it will be set as the next-hop in a Route - * resource, specify true. If unsure, leave this set to false. See the Enable - * IP forwarding documentation for more information. - */ - canIpForward: boolean; - /** - * An optional text description for the instances that are created from this - * instance template. - */ - description: string; - /** - * An array of disks that are associated with the instances that are created - * from this template. - */ - disks: Schema$AttachedDisk[]; - /** - * A list of guest accelerator cards' type and count to use for instances - * created from the instance template. - */ - guestAccelerators: Schema$AcceleratorConfig[]; - /** - * Labels to apply to instances that are created from this template. - */ - labels: any; - /** - * The machine type to use for instances that are created from this template. - */ - machineType: string; - /** - * The metadata key/value pairs to assign to instances that are created from - * this template. These pairs can consist of custom metadata or predefined - * keys. See Project and instance metadata for more information. - */ - metadata: Schema$Metadata; - /** - * Minimum cpu/platform to be used by this instance. The instance may be - * scheduled on the specified or newer cpu/platform. Applicable values are the - * friendly names of CPU platforms, such as minCpuPlatform: "Intel - * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more - * information, read Specifying a Minimum CPU Platform. - */ - minCpuPlatform: string; - /** - * An array of network access configurations for this interface. - */ - networkInterfaces: Schema$NetworkInterface[]; - /** - * Specifies the scheduling options for the instances that are created from - * this template. - */ - scheduling: Schema$Scheduling; - /** - * A list of service accounts with specified scopes. Access tokens for these - * service accounts are available to the instances that are created from this - * template. Use metadata queries to obtain the access tokens for these - * instances. - */ - serviceAccounts: Schema$ServiceAccount[]; - /** - * A list of tags to apply to the instances that are created from this - * template. The tags identify valid sources or targets for network firewalls. - * The setTags method can modify this list of tags. Each tag within the list - * must comply with RFC1035. - */ - tags: Schema$Tags; -} -export interface Schema$InstanceReference { - /** - * The URL for a specific instance. - */ - instance: string; -} -export interface Schema$InstancesScopedList { - /** - * [Output Only] A list of instances contained in this scope. - */ - instances: Schema$Instance[]; - /** - * [Output Only] Informational warning which replaces the list of instances - * when the list is empty. - */ - warning: any; -} -export interface Schema$InstancesSetLabelsRequest { - /** - * Fingerprint of the previous set of labels for this resource, used to - * prevent conflicts. Provide the latest fingerprint value when making a - * request to add or change labels. - */ - labelFingerprint: string; - labels: any; -} -export interface Schema$InstancesSetMachineResourcesRequest { - /** - * A list of the type and count of accelerator cards attached to the instance. - */ - guestAccelerators: Schema$AcceleratorConfig[]; -} -export interface Schema$InstancesSetMachineTypeRequest { - /** - * Full or partial URL of the machine type resource. See Machine Types for a - * full list of machine types. For example: - * zones/us-central1-f/machineTypes/n1-standard-1 - */ - machineType: string; -} -export interface Schema$InstancesSetMinCpuPlatformRequest { - /** - * Minimum cpu/platform this instance should be started at. - */ - minCpuPlatform: string; -} -export interface Schema$InstancesSetServiceAccountRequest { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -export interface Schema$InstancesStartWithEncryptionKeyRequest { - /** - * Array of disks associated with this instance that are protected with a - * customer-supplied encryption key. In order to start the instance, the disk - * url and its corresponding key must be provided. If the disk is not - * protected with a customer-supplied encryption key it should not be - * specified. - */ - disks: Schema$CustomerEncryptionKeyProtectedDisk[]; -} -/** - * An Instance Template resource. (== resource_for beta.instanceTemplates ==) - * (== resource_for v1.instanceTemplates ==) - */ -export interface Schema$InstanceTemplate { - /** - * [Output Only] The creation timestamp for this instance template in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A unique identifier for this instance template. The server - * defines this identifier. - */ - id: string; - /** - * [Output Only] The resource type, which is always compute#instanceTemplate - * for instance templates. - */ - kind: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The instance properties for this instance template. - */ - properties: Schema$InstanceProperties; - /** - * [Output Only] The URL for this instance template. The server defines this - * URL. - */ - selfLink: string; -} -/** - * A list of instance templates. - */ -export interface Schema$InstanceTemplateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceTemplate resources. - */ - items: Schema$InstanceTemplate[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceTemplatesListResponse for instance template lists. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$InstanceWithNamedPorts { - /** - * [Output Only] The URL of the instance. - */ - instance: string; - /** - * [Output Only] The named ports that belong to this instance group. - */ - namedPorts: Schema$NamedPort[]; - /** - * [Output Only] The status of the instance. - */ - status: string; -} -/** - * Represents an Interconnects resource. The Interconnects resource is a - * dedicated connection between Google's network and your on-premises - * network. For more information, see the Dedicated overview page. (== - * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) - */ -export interface Schema$Interconnect { - /** - * Administrative status of the interconnect. When this is set to true, the - * Interconnect is functional and can carry traffic. When set to false, no - * packets can be carried over the interconnect and no BGP routes are - * exchanged over it. By default, the status is set to true. - */ - adminEnabled: boolean; - /** - * [Output Only] A list of CircuitInfo objects, that describe the individual - * circuits in this LAG. - */ - circuitInfos: Schema$InterconnectCircuitInfo[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * Customer name, to put in the Letter of Authorization as the party - * authorized to request a crossconnect. - */ - customerName: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of outages expected for this Interconnect. - */ - expectedOutages: Schema$InterconnectOutageNotification[]; - /** - * [Output Only] IP address configured on the Google side of the Interconnect - * link. This can be used only for ping tests. - */ - googleIpAddress: string; - /** - * [Output Only] Google reference ID; to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of the URLs of all InterconnectAttachments configured - * to use this Interconnect. - */ - interconnectAttachments: string[]; - /** - * Type of interconnect. Note that "IT_PRIVATE" has been deprecated - * in favor of "DEDICATED" - */ - interconnectType: string; - /** - * [Output Only] Type of the resource. Always compute#interconnect for - * interconnects. - */ - kind: string; - /** - * Type of link requested. This field indicates speed of each of the links in - * the bundle, not the entire bundle. Only 10G per link is allowed for a - * dedicated interconnect. Options: Ethernet_10G_LR - */ - linkType: string; - /** - * URL of the InterconnectLocation object that represents where this - * connection is to be provisioned. - */ - location: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Email address to contact the customer NOC for operations and maintenance - * notifications regarding this Interconnect. If specified, this will be used - * for notifications in addition to all other forms described, such as - * Stackdriver logs alerting and Cloud Notifications. - */ - nocContactEmail: string; - /** - * [Output Only] The current status of whether or not this Interconnect is - * functional. - */ - operationalStatus: string; - /** - * [Output Only] IP address configured on the customer side of the - * Interconnect link. The customer should configure this IP address during - * turnup when prompted by Google NOC. This can be used only for ping tests. - */ - peerIpAddress: string; - /** - * [Output Only] Number of links actually provisioned in this interconnect. - */ - provisionedLinkCount: number; - /** - * Target number of physical links in the link bundle, as requested by the - * customer. - */ - requestedLinkCount: number; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Represents an InterconnectAttachment (VLAN attachment) resource. For more - * information, see Creating VLAN Attachments. (== resource_for - * beta.interconnectAttachments ==) (== resource_for v1.interconnectAttachments - * ==) - */ -export interface Schema$InterconnectAttachment { - /** - * [Output Only] IPv4 address + prefix length to be configured on Cloud Router - * Interface for this interconnect attachment. - */ - cloudRouterIpAddress: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] IPv4 address + prefix length to be configured on the customer - * router subinterface for this interconnect attachment. - */ - customerRouterIpAddress: string; - /** - * An optional description of this resource. - */ - description: string; - /** - * [Output Only] Google reference ID, to be used when raising support tickets - * with Google or otherwise to debug backend connectivity issues. - */ - googleReferenceId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * URL of the underlying Interconnect object that this attachment's - * traffic will traverse through. - */ - interconnect: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectAttachment - * for interconnect attachments. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] The current status of whether or not this interconnect - * attachment is functional. - */ - operationalStatus: string; - /** - * [Output Only] Information specific to an InterconnectAttachment. This - * property is populated if the interconnect that this is attached to is of - * type DEDICATED. - */ - privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; - /** - * [Output Only] URL of the region where the regional interconnect attachment - * resides. You must specify this field as part of the HTTP request URL. It is - * not settable as a field in the request body. - */ - region: string; - /** - * URL of the cloud router to be used for dynamic routing. This router must be - * in the same region as this InterconnectAttachment. The - * InterconnectAttachment will automatically connect the Interconnect to the - * network & region within which the Cloud Router is configured. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$InterconnectAttachmentAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachmentsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always - * compute#interconnectAttachmentAggregatedList for aggregated lists of - * interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Response to the list request, and contains a list of interconnect - * attachments. - */ -export interface Schema$InterconnectAttachmentList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectAttachment resources. - */ - items: Schema$InterconnectAttachment[]; - /** - * [Output Only] Type of resource. Always compute#interconnectAttachmentList - * for lists of interconnect attachments. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Information for an interconnect attachment when this belongs to an - * interconnect of type DEDICATED. - */ -export interface Schema$InterconnectAttachmentPrivateInfo { - /** - * [Output Only] 802.1q encapsulation tag to be used for traffic between - * Google and the customer, going to and from this network and region. - */ - tag8021q: number; -} -export interface Schema$InterconnectAttachmentsScopedList { - /** - * A list of interconnect attachments contained in this scope. - */ - interconnectAttachments: Schema$InterconnectAttachment[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * Describes a single physical circuit between the Customer and Google. - * CircuitInfo objects are created by Google, so all fields are output only. - * Next id: 4 - */ -export interface Schema$InterconnectCircuitInfo { - /** - * Customer-side demarc ID for this circuit. - */ - customerDemarcId: string; - /** - * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. - */ - googleCircuitId: string; - /** - * Google-side demarc ID for this circuit. Assigned at circuit turn-up and - * provided by Google to the customer in the LOA. - */ - googleDemarcId: string; -} -/** - * Response to the list request, and contains a list of interconnects. - */ -export interface Schema$InterconnectList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Interconnect resources. - */ - items: Schema$Interconnect[]; - /** - * [Output Only] Type of resource. Always compute#interconnectList for lists - * of interconnects. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents an InterconnectLocations resource. The InterconnectLocations - * resource describes the locations where you can connect to Google's - * networks. For more information, see Colocation Facilities. - */ -export interface Schema$InterconnectLocation { - /** - * [Output Only] The postal address of the Point of Presence, each line in the - * address is separated by a newline character. - */ - address: string; - /** - * [Output Only] Availability zone for this location. Within a metropolitan - * area (metro), maintenance will not be simultaneously scheduled in more than - * one availability zone. Example: "zone1" or "zone2". - */ - availabilityZone: string; - /** - * [Output Only] Metropolitan area designator that indicates which city an - * interconnect is located. For example: "Chicago, IL", - * "Amsterdam, Netherlands". - */ - city: string; - /** - * [Output Only] Continent for this location. - */ - continent: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] An optional description of the resource. - */ - description: string; - /** - * [Output Only] The name of the provider for this facility (e.g., EQUINIX). - */ - facilityProvider: string; - /** - * [Output Only] A provider-assigned Identifier for this facility (e.g., - * Ashburn-DC1). - */ - facilityProviderFacilityId: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#interconnectLocation for - * interconnect locations. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The peeringdb identifier for this facility (corresponding - * with a netfac type in peeringdb). - */ - peeringdbFacilityId: string; - /** - * [Output Only] A list of InterconnectLocation.RegionInfo objects, that - * describe parameters pertaining to the relation between this - * InterconnectLocation and various Google Cloud regions. - */ - regionInfos: Schema$InterconnectLocationRegionInfo[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Response to the list request, and contains a list of interconnect locations. - */ -export interface Schema$InterconnectLocationList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InterconnectLocation resources. - */ - items: Schema$InterconnectLocation[]; - /** - * [Output Only] Type of resource. Always compute#interconnectLocationList for - * lists of interconnect locations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Information about any potential InterconnectAttachments between an - * Interconnect at a specific InterconnectLocation, and a specific Cloud Region. - */ -export interface Schema$InterconnectLocationRegionInfo { - /** - * Expected round-trip time in milliseconds, from this InterconnectLocation to - * a VM in this region. - */ - expectedRttMs: string; - /** - * Identifies the network presence of this location. - */ - locationPresence: string; - /** - * URL for the region of this location. - */ - region: string; -} -/** - * Description of a planned outage on this Interconnect. Next id: 9 - */ -export interface Schema$InterconnectOutageNotification { - /** - * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit IDs - * that will be affected. - */ - affectedCircuits: string[]; - /** - * A description about the purpose of the outage. - */ - description: string; - /** - * Scheduled end time for the outage (milliseconds since Unix epoch). - */ - endTime: string; - /** - * Form this outage is expected to take. Note that the "IT_" - * versions of this enum have been deprecated in favor of the unprefixed - * values. - */ - issueType: string; - /** - * Unique identifier for this outage notification. - */ - name: string; - /** - * The party that generated this notification. Note that - * "NSRC_GOOGLE" has been deprecated in favor of "GOOGLE" - */ - source: string; - /** - * Scheduled start time for the outage (milliseconds since Unix epoch). - */ - startTime: string; - /** - * State of this notification. Note that the "NS_" versions of this - * enum have been deprecated in favor of the unprefixed values. - */ - state: string; -} -/** - * A license resource. - */ -export interface Schema$License { - /** - * [Output Only] Deprecated. This field no longer reflects whether a license - * charges a usage fee. - */ - chargesUseFee: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#license for licenses. - */ - kind: string; - /** - * [Output Only] The unique code used to attach this license to images, - * snapshots, and disks. - */ - licenseCode: string; - /** - * [Output Only] Name of the resource. The name is 1-63 characters long and - * complies with RFC1035. - */ - name: string; - resourceRequirements: Schema$LicenseResourceRequirements; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * If false, licenses will not be copied from the source resource when - * creating an image from a disk, disk from snapshot, or snapshot from disk. - */ - transferable: boolean; -} -export interface Schema$LicenseCode { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#licenseCode for licenses. - */ - kind: string; - /** - * [Output Only] URL and description aliases of Licenses with the same License - * Code. - */ - licenseAlias: Schema$LicenseCodeLicenseAlias[]; - /** - * [Output Only] Name of the resource. The name is 1-20 characters long and - * must be a valid 64 bit integer. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Current state of this License Code. - */ - state: string; - /** - * [Output Only] If true, the license will remain attached when creating - * images or snapshots from disks. Otherwise, the license is not transferred. - */ - transferable: boolean; -} -export interface Schema$LicenseCodeLicenseAlias { - /** - * [Output Only] Description of this License Code. - */ - description: string; - /** - * [Output Only] URL of license corresponding to this License Code. - */ - selfLink: string; -} -export interface Schema$LicenseResourceRequirements { - /** - * Minimum number of guest cpus required to use the Instance. Enforced at - * Instance creation and Instance start. - */ - minGuestCpuCount: number; - /** - * Minimum memory required to use the Instance. Enforced at Instance creation - * and Instance start. - */ - minMemoryMb: number; -} -export interface Schema$LicensesListResponse { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of License resources. - */ - items: Schema$License[]; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A Machine Type resource. (== resource_for v1.machineTypes ==) (== - * resource_for beta.machineTypes ==) - */ -export interface Schema$MachineType { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this machine type. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] An optional textual description of the resource. - */ - description: string; - /** - * [Output Only] The number of virtual CPUs that are available to the - * instance. - */ - guestCpus: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Deprecated] This property is deprecated and will never be populated with - * any relevant values. - */ - imageSpaceGb: number; - /** - * [Output Only] Whether this machine type has a shared CPU. See Shared-core - * machine types for more information. - */ - isSharedCpu: boolean; - /** - * [Output Only] The type of the resource. Always compute#machineType for - * machine types. - */ - kind: string; - /** - * [Output Only] Maximum persistent disks allowed. - */ - maximumPersistentDisks: number; - /** - * [Output Only] Maximum total persistent disks size (GB) allowed. - */ - maximumPersistentDisksSizeGb: string; - /** - * [Output Only] The amount of physical memory available to the instance, - * defined in MB. - */ - memoryMb: number; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] A list of extended scratch disks assigned to the instance. - */ - scratchDisks: any[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The name of the zone where the machine type resides, such as - * us-central1-a. - */ - zone: string; -} -export interface Schema$MachineTypeAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineTypesScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#machineTypeAggregatedList - * for aggregated lists of machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of machine types. - */ -export interface Schema$MachineTypeList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of MachineType resources. - */ - items: Schema$MachineType[]; - /** - * [Output Only] Type of resource. Always compute#machineTypeList for lists of - * machine types. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$MachineTypesScopedList { - /** - * [Output Only] A list of machine types contained in this scope. - */ - machineTypes: Schema$MachineType[]; - /** - * [Output Only] An informational warning that appears when the machine types - * list is empty. - */ - warning: any; -} -/** - * Next available tag: 12 - */ -export interface Schema$ManagedInstance { - /** - * [Output Only] The current action that the managed instance group has - * scheduled for the instance. Possible values: - NONE The instance is - * running, and the managed instance group does not have any scheduled actions - * for this instance. - CREATING The managed instance group is creating this - * instance. If the group fails to create this instance, it will try again - * until it is successful. - CREATING_WITHOUT_RETRIES The managed instance - * group is attempting to create this instance only once. If the group fails - * to create this instance, it does not try again and the group's - * targetSize value is decreased instead. - RECREATING The managed instance - * group is recreating this instance. - DELETING The managed instance group - * is permanently deleting this instance. - ABANDONING The managed instance - * group is abandoning this instance. The instance will be removed from the - * instance group and from any target pools that are associated with this - * group. - RESTARTING The managed instance group is restarting the instance. - * - REFRESHING The managed instance group is applying configuration changes - * to the instance without stopping it. For example, the group can update the - * target pool list for an instance without stopping that instance. - - * VERIFYING The managed instance group has created the instance and it is in - * the process of being verified. - */ - currentAction: string; - /** - * [Output only] The unique identifier for this resource. This field is empty - * when instance does not exist. - */ - id: string; - /** - * [Output Only] The URL of the instance. The URL can exist even if the - * instance has not yet been created. - */ - instance: string; - /** - * [Output Only] The status of the instance. This field is empty when the - * instance does not exist. - */ - instanceStatus: string; - /** - * [Output Only] Information about the last attempt to create or delete the - * instance. - */ - lastAttempt: Schema$ManagedInstanceLastAttempt; -} -export interface Schema$ManagedInstanceLastAttempt { - /** - * [Output Only] Encountered errors during the last attempt to create or - * delete the instance. - */ - errors: any; -} -/** - * A metadata key/value entry. - */ -export interface Schema$Metadata { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. - */ - fingerprint: string; - /** - * Array of key/value pairs. The total size of all keys and values must be - * less than 512 KB. - */ - items: any[]; - /** - * [Output Only] Type of the resource. Always compute#metadata for metadata. - */ - kind: string; -} -/** - * The named port. For example: . - */ -export interface Schema$NamedPort { - /** - * The name for this named port. The name must be 1-63 characters long, and - * comply with RFC1035. - */ - name: string; - /** - * The port number, which can be a value between 1 and 65535. - */ - port: number; -} -/** - * Represents a Network resource. Read Networks and Firewalls for more - * information. (== resource_for v1.networks ==) (== resource_for beta.networks - * ==) - */ -export interface Schema$Network { - /** - * When set to true, the network is created in "auto subnet mode". - * When set to false, the network is in "custom subnet mode". In - * "auto subnet mode", a newly created network is assigned the - * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork - * per region. - */ - autoCreateSubnetworks: boolean; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * A gateway address for default routing to other networks. This value is read - * only and is selected by the Google Compute Engine, typically as the first - * usable address in the IPv4Range. - */ - gatewayIPv4: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are legal on this network. This range - * is a CIDR specification, for example: 192.168.0.0/16. Provided by the - * client when the network is created. - */ - IPv4Range: string; - /** - * [Output Only] Type of the resource. Always compute#network for networks. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] A list of network peerings for the resource. - */ - peerings: Schema$NetworkPeering[]; - /** - * The network-level routing configuration for this network. Used by Cloud - * Router to determine what type of network-wide routing behavior to enforce. - */ - routingConfig: Schema$NetworkRoutingConfig; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Server-defined fully-qualified URLs for all subnetworks in - * this network. - */ - subnetworks: string[]; -} -/** - * A network interface resource attached to an instance. - */ -export interface Schema$NetworkInterface { - /** - * An array of configurations for this interface. Currently, only one access - * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs - * specified, then this instance will have no external internet access. - */ - accessConfigs: Schema$AccessConfig[]; - /** - * An array of alias IP ranges for this network interface. Can only be - * specified for network interfaces on subnet-mode networks. - */ - aliasIpRanges: Schema$AliasIpRange[]; - /** - * Fingerprint hash of contents stored in this network interface. This field - * will be ignored when inserting an Instance or adding a NetworkInterface. An - * up-to-date fingerprint must be provided in order to update the - * NetworkInterface. - */ - fingerprint: string; - /** - * [Output Only] Type of the resource. Always compute#networkInterface for - * network interfaces. - */ - kind: string; - /** - * [Output Only] The name of the network interface, generated by the server. - * For network devices, these are eth0, eth1, etc. - */ - name: string; - /** - * URL of the network resource for this instance. When creating an instance, - * if neither the network nor the subnetwork is specified, the default network - * global/networks/default is used; if the network is not specified but the - * subnetwork is specified, the network is inferred. This field is optional - * when creating a firewall rule. If not specified when creating a firewall - * rule, the default network global/networks/default is used. If you specify - * this property, you can specify the network as a full or partial URL. For - * example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/global/networks/network - * - projects/project/global/networks/network - global/networks/default - */ - network: string; - /** - * An IPv4 internal network address to assign to the instance for this network - * interface. If not specified by the user, an unused internal IP is assigned - * by the system. - */ - networkIP: string; - /** - * The URL of the Subnetwork resource for this instance. If the network - * resource is in legacy mode, do not provide this property. If the network is - * in auto subnet mode, providing the subnetwork is optional. If the network - * is in custom subnet mode, then this field should be specified. If you - * specify this property, you can specify the subnetwork as a full or partial - * URL. For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork - * - regions/region/subnetworks/subnetwork - */ - subnetwork: string; -} -/** - * Contains a list of networks. - */ -export interface Schema$NetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Network resources. - */ - items: Schema$Network[]; - /** - * [Output Only] Type of resource. Always compute#networkList for lists of - * networks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A network peering attached to a network resource. The message includes the - * peering name, peer network, peering state, and a flag indicating whether - * Google Compute Engine should automatically create routes for the peering. - */ -export interface Schema$NetworkPeering { - /** - * Whether full mesh connectivity is created and managed automatically. When - * it is set to true, Google Compute Engine will automatically create and - * manage the routes between two networks when the state is ACTIVE. Otherwise, - * user needs to create routes manually to route packets to peer network. - */ - autoCreateRoutes: boolean; - /** - * Name of this peering. Provided by the client when the peering is created. - * The name must comply with RFC1035. Specifically, the name must be 1-63 - * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` - * which means the first character must be a lowercase letter, and all the - * following characters must be a dash, lowercase letter, or digit, except the - * last character, which cannot be a dash. - */ - name: string; - /** - * The URL of the peer network. It can be either full URL or partial URL. The - * peer network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - network: string; - /** - * [Output Only] State for the peering. - */ - state: string; - /** - * [Output Only] Details about the current state of the peering. - */ - stateDetails: string; -} -/** - * A routing configuration attached to a network resource. The message includes - * the list of routers associated with the network, and a flag indicating the - * type of routing behavior to enforce network-wide. - */ -export interface Schema$NetworkRoutingConfig { - /** - * The network-wide routing mode to use. If set to REGIONAL, this - * network's cloud routers will only advertise routes with subnetworks of - * this network in the same region as the router. If set to GLOBAL, this - * network's cloud routers will advertise routes with all subnetworks of - * this network, across regions. - */ - routingMode: string; -} -export interface Schema$NetworksAddPeeringRequest { - /** - * Whether Google Compute Engine manages the routes automatically. - */ - autoCreateRoutes: boolean; - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; - /** - * URL of the peer network. It can be either full URL or partial URL. The peer - * network may belong to a different project. If the partial URL does not - * contain project, it is assumed that the peer network is in the same project - * as the current network. - */ - peerNetwork: string; -} -export interface Schema$NetworksRemovePeeringRequest { - /** - * Name of the peering, which should conform to RFC1035. - */ - name: string; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; - /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -export interface Schema$OperationAggregatedList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A map of scoped operation lists. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#operationAggregatedList for - * aggregated lists of operations. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Operation resources. - */ -export interface Schema$OperationList { - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] A list of Operation resources. - */ - items: Schema$Operation[]; - /** - * [Output Only] Type of resource. Always compute#operations for Operations - * resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$OperationsScopedList { - /** - * [Output Only] A list of operations contained in this scope. - */ - operations: Schema$Operation[]; - /** - * [Output Only] Informational warning which replaces the list of operations - * when the list is empty. - */ - warning: any; -} -/** - * A matcher for the path portion of the URL. The BackendService from the - * longest-matched rule will serve the URL. If no rule was matched, the default - * service will be used. - */ -export interface Schema$PathMatcher { - /** - * The full or partial URL to the BackendService resource. This will be used - * if none of the pathRules defined by this PathMatcher is matched by the - * URL's path portion. For example, the following are all valid URLs to a - * BackendService resource: - - * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService - * - compute/v1/projects/project/global/backendServices/backendService - - * global/backendServices/backendService - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The name to which this PathMatcher is referred by the HostRule. - */ - name: string; - /** - * The list of path rules. - */ - pathRules: Schema$PathRule[]; -} -/** - * A path-matching rule for a URL. If matched, will use the specified - * BackendService to handle the traffic arriving at this URL. - */ -export interface Schema$PathRule { - /** - * The list of path patterns to match. Each must start with / and the only - * place a * is allowed is at the end following a /. The string fed to the - * path matcher does not include any text after the first ? or #, and those - * chars are not allowed here. - */ - paths: string[]; - /** - * The URL of the BackendService resource if this rule is matched. - */ - service: string; -} -/** - * A Project resource. For an overview of projects, see Cloud Platform Resource - * Hierarchy. (== resource_for v1.projects ==) (== resource_for beta.projects - * ==) - */ -export interface Schema$Project { - /** - * Metadata key/value pairs available to all instances contained in this - * project. See Custom metadata for more information. - */ - commonInstanceMetadata: Schema$Metadata; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] Default service account used by VMs running in this project. - */ - defaultServiceAccount: string; - /** - * An optional textual description of the resource. - */ - description: string; - /** - * Restricted features enabled for use on this project. - */ - enabledFeatures: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. This is not the project ID, and is just a unique ID - * used by Compute Engine to identify resources. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#project for projects. - */ - kind: string; - /** - * The project ID. For example: my-example-project. Use the project ID to make - * requests to Compute Engine. - */ - name: string; - /** - * [Output Only] Quotas assigned to this project. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The naming prefix for daily usage reports and the Google Cloud Storage - * bucket where they are stored. - */ - usageExportLocation: Schema$UsageExportLocation; - /** - * [Output Only] The role this project has in a shared VPC configuration. - * Currently only HOST projects are differentiated. - */ - xpnProjectStatus: string; -} -export interface Schema$ProjectsDisableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsEnableXpnResourceRequest { - /** - * Service resource (a.k.a service project) ID. - */ - xpnResource: Schema$XpnResourceId; -} -export interface Schema$ProjectsGetXpnResources { - /** - * [Output Only] Type of resource. Always compute#projectsGetXpnResources for - * lists of service resources (a.k.a service projects) - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * Service resources (a.k.a service projects) attached to this project as - * their shared VPC host. - */ - resources: Schema$XpnResourceId[]; -} -export interface Schema$ProjectsListXpnHostsRequest { - /** - * Optional organization ID managed by Cloud Resource Manager, for which to - * list shared VPC host projects. If not specified, the organization will be - * inferred from the project. - */ - organization: string; -} -/** - * A quotas entry. - */ -export interface Schema$Quota { - /** - * [Output Only] Quota limit for this metric. - */ - limit: number; - /** - * [Output Only] Name of the quota metric. - */ - metric: string; - /** - * [Output Only] Current usage of this metric. - */ - usage: number; -} -/** - * Represents a reference to a resource. - */ -export interface Schema$Reference { - /** - * [Output Only] Type of the resource. Always compute#reference for - * references. - */ - kind: string; - /** - * A description of the reference type with no implied semantics. Possible - * values include: - MEMBER_OF - */ - referenceType: string; - /** - * URL of the resource which refers to the target. - */ - referrer: string; - /** - * URL of the resource to which this reference points. - */ - target: string; -} -/** - * Region resource. (== resource_for beta.regions ==) (== resource_for - * v1.regions ==) - */ -export interface Schema$Region { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this region. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#region for regions. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Quotas assigned to this region. - */ - quotas: Schema$Quota[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the region, either UP or DOWN. - */ - status: string; - /** - * [Output Only] A list of zones available in this region, in the form of - * resource URLs. - */ - zones: string[]; -} -/** - * Contains a list of autoscalers. - */ -export interface Schema$RegionAutoscalerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Autoscaler resources. - */ - items: Schema$Autoscaler[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of InstanceGroup resources. - */ -export interface Schema$RegionInstanceGroupList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroup resources. - */ - items: Schema$InstanceGroup[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of managed instance groups. - */ -export interface Schema$RegionInstanceGroupManagerList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceGroupManager resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * [Output Only] The resource type, which is always - * compute#instanceGroupManagerList for a list of managed instance groups that - * exist in th regional scope. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { - /** - * The URLs of one or more instances to abandon. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { - /** - * The URLs of one or more instances to delete. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersListInstancesResponse { - /** - * A list of managed instances. - */ - managedInstances: Schema$ManagedInstance[]; -} -export interface Schema$RegionInstanceGroupManagersRecreateRequest { - /** - * The URLs of one or more instances to recreate. This can be a full URL or a - * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. - */ - instances: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { - /** - * Fingerprint of the target pools information, which is a hash of the - * contents. This field is used for optimistic locking when you update the - * target pool entries. This field is optional. - */ - fingerprint: string; - /** - * The URL of all TargetPool resources to which instances in the instanceGroup - * field are added. The target pools automatically apply to all of the - * instances in the managed instance group. - */ - targetPools: string[]; -} -export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { - /** - * URL of the InstanceTemplate resource from which all new instances will be - * created. - */ - instanceTemplate: string; -} -export interface Schema$RegionInstanceGroupsListInstances { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of InstanceWithNamedPorts resources. - */ - items: Schema$InstanceWithNamedPorts[]; - /** - * The resource type. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RegionInstanceGroupsListInstancesRequest { - /** - * Instances in which state should be returned. Valid options are: - * 'ALL', 'RUNNING'. By default, it lists all instances. - */ - instanceState: string; - /** - * Name of port user is interested in. It is optional. If it is set, only - * information about this ports will be returned. If it is not set, all the - * named ports will be returned. Always lists all instances. - */ - portName: string; -} -export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { - /** - * The fingerprint of the named ports information for this instance group. Use - * this optional property to prevent conflicts when multiple users change the - * named ports settings concurrently. Obtain the fingerprint with the - * instanceGroups.get method. Then, include the fingerprint in your request to - * ensure that you do not overwrite changes that were applied from another - * concurrent request. - */ - fingerprint: string; - /** - * The list of named ports to set for this instance group. - */ - namedPorts: Schema$NamedPort[]; -} -/** - * Contains a list of region resources. - */ -export interface Schema$RegionList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Region resources. - */ - items: Schema$Region[]; - /** - * [Output Only] Type of resource. Always compute#regionList for lists of - * regions. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Commitment for a particular resource (a Commitment is composed of one or more - * of these). - */ -export interface Schema$ResourceCommitment { - /** - * The amount of the resource purchased (in a type-dependent unit, such as - * bytes). For vCPUs, this can just be an integer. For memory, this must be - * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of - * memory per every vCPU. - */ - amount: string; - /** - * Type of resource for which this commitment applies. Possible values are - * VCPU and MEMORY - */ - type: string; -} -export interface Schema$ResourceGroupReference { - /** - * A URI referencing one of the instance groups listed in the backend service. - */ - group: string; -} -/** - * Represents a Route resource. A route specifies how certain packets should be - * handled by the network. Routes are associated with instances by tags and the - * set of routes for a particular instance is called its routing table. For - * each packet leaving an instance, the system searches that instance's - * routing table for a single best matching route. Routes match packets by - * destination IP address, preferring smaller or more specific ranges over - * larger ones. If there is a tie, the system selects the route with the - * smallest priority value. If there is still a tie, it uses the layer three and - * four packet headers to select just one of the remaining matching routes. The - * packet is then forwarded as specified by the nextHop field of the winning - * route - either to another instance destination, an instance gateway, or a - * Google Compute Engine-operated gateway. Packets that do not match any route - * in the sending instance's routing table are dropped. (== resource_for - * beta.routes ==) (== resource_for v1.routes ==) - */ -export interface Schema$Route { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * The destination range of outgoing packets that this route applies to. Only - * IPv4 is supported. - */ - destRange: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of this resource. Always compute#routes for Route - * resources. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Fully-qualified URL of the network that this route applies to. - */ - network: string; - /** - * The URL to a gateway that should handle matching packets. You can only - * specify the internet gateway using a full or partial valid URL: - * projects/<project-id>/global/gateways/default-internet-gateway - */ - nextHopGateway: string; - /** - * The URL to an instance that should handle matching packets. You can specify - * this as a full or partial URL. For example: - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ - */ - nextHopInstance: string; - /** - * The network IP address of an instance that should handle matching packets. - * Only IPv4 is supported. - */ - nextHopIp: string; - /** - * The URL of the local network if it should handle matching packets. - */ - nextHopNetwork: string; - /** - * [Output Only] The network peering name that should handle matching packets, - * which should conform to RFC1035. - */ - nextHopPeering: string; - /** - * The URL to a VpnTunnel that should handle matching packets. - */ - nextHopVpnTunnel: string; - /** - * The priority of this route. Priority is used to break ties in cases where - * there is more than one matching route of equal prefix length. In the case - * of two routes with equal prefix length, the one with the lowest-numbered - * priority value wins. Default value is 1000. Valid range is 0 through 65535. - */ - priority: number; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * A list of instance tags to which this route applies. - */ - tags: string[]; - /** - * [Output Only] If potential misconfigurations are detected for this route, - * this field will be populated with warning messages. - */ - warnings: any[]; -} -/** - * Contains a list of Route resources. - */ -export interface Schema$RouteList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Route resources. - */ - items: Schema$Route[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Router resource. - */ -export interface Schema$Router { - /** - * BGP information specific to this router. - */ - bgp: Schema$RouterBgp; - /** - * BGP information that needs to be configured into the routing stack to - * establish the BGP peering. It must specify peer ASN and either interface - * name, IP, or peer IP. Please refer to RFC4273. - */ - bgpPeers: Schema$RouterBgpPeer[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * Router interfaces. Each interface requires either one linked resource (e.g. - * linkedVpnTunnel), or IP address and IP address range (e.g. ipRange), or - * both. - */ - interfaces: Schema$RouterInterface[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URI of the network to which this router belongs. - */ - network: string; - /** - * [Output Only] URI of the region where the router resides. You must specify - * this field as part of the HTTP request URL. It is not settable as a field - * in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Description-tagged IP ranges for the router to advertise. - */ -export interface Schema$RouterAdvertisedIpRange { - /** - * User-specified description for the IP range. - */ - description: string; - /** - * The IP range to advertise. The value must be a CIDR-formatted string. - */ - range: string; -} -/** - * Contains a list of routers. - */ -export interface Schema$RouterAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RouterBgp { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and is advertised - * to all peers of the router. These groups will be advertised in addition to - * any specified prefixes. Leave this field blank to advertise no custom - * groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and is - * advertised to all peers of the router. These IP ranges will be advertised - * in addition to any specified groups. Leave this field blank to advertise no - * custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, - * either 16-bit or 32-bit. The value will be fixed for this router resource. - * All VPN tunnels that link to this router will have the same local ASN. - */ - asn: number; -} -export interface Schema$RouterBgpPeer { - /** - * User-specified list of prefix groups to advertise in custom mode. This - * field can only be populated if advertise_mode is CUSTOM and overrides the - * list defined for the router (in Bgp message). These groups will be - * advertised in addition to any specified prefixes. Leave this field blank to - * advertise no custom groups. - */ - advertisedGroups: string[]; - /** - * User-specified list of individual IP ranges to advertise in custom mode. - * This field can only be populated if advertise_mode is CUSTOM and overrides - * the list defined for the router (in Bgp message). These IP ranges will be - * advertised in addition to any specified groups. Leave this field blank to - * advertise no custom IP ranges. - */ - advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; - /** - * The priority of routes advertised to this BGP peer. In the case where there - * is more than one matching route of maximum length, the routes with lowest - * priority value win. - */ - advertisedRoutePriority: number; - /** - * User-specified flag to indicate which mode to use for advertisement. - */ - advertiseMode: string; - /** - * Name of the interface the BGP peer is associated with. - */ - interfaceName: string; - /** - * IP address of the interface inside Google Cloud Platform. Only IPv4 is - * supported. - */ - ipAddress: string; - /** - * Name of this BGP peer. The name must be 1-63 characters long and comply - * with RFC1035. - */ - name: string; - /** - * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can - * be different for every tunnel. - */ - peerAsn: number; - /** - * IP address of the BGP interface outside Google cloud. Only IPv4 is - * supported. - */ - peerIpAddress: string; -} -export interface Schema$RouterInterface { - /** - * IP address and range of the interface. The IP range must be in the RFC3927 - * link-local IP space. The value must be a CIDR-formatted string, for - * example: 169.254.0.1/30. NOTE: Do not truncate the address as it represents - * the IP address of the interface. - */ - ipRange: string; - /** - * URI of the linked interconnect attachment. It must be in the same region as - * the router. Each interface can have at most one linked resource and it - * could either be a VPN Tunnel or an interconnect attachment. - */ - linkedInterconnectAttachment: string; - /** - * URI of the linked VPN tunnel. It must be in the same region as the router. - * Each interface can have at most one linked resource and it could either be - * a VPN Tunnel or an interconnect attachment. - */ - linkedVpnTunnel: string; - /** - * Name of this interface entry. The name must be 1-63 characters long and - * comply with RFC1035. - */ - name: string; -} -/** - * Contains a list of Router resources. - */ -export interface Schema$RouterList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Router resources. - */ - items: Schema$Router[]; - /** - * [Output Only] Type of resource. Always compute#router for routers. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$RoutersPreviewResponse { - /** - * Preview of given router. - */ - resource: Schema$Router; -} -export interface Schema$RoutersScopedList { - /** - * A list of routers contained in this scope. - */ - routers: Schema$Router[]; - /** - * Informational warning which replaces the list of routers when the list is - * empty. - */ - warning: any; -} -export interface Schema$RouterStatus { - /** - * Best routes for this router's network. - */ - bestRoutes: Schema$Route[]; - /** - * Best routes learned by this router. - */ - bestRoutesForRouter: Schema$Route[]; - bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; - /** - * URI of the network to which this router belongs. - */ - network: string; -} -export interface Schema$RouterStatusBgpPeerStatus { - /** - * Routes that were advertised to the remote BGP peer - */ - advertisedRoutes: Schema$Route[]; - /** - * IP address of the local BGP interface. - */ - ipAddress: string; - /** - * URL of the VPN tunnel that this BGP peer controls. - */ - linkedVpnTunnel: string; - /** - * Name of this BGP peer. Unique within the Routers resource. - */ - name: string; - /** - * Number of routes learned from the remote BGP Peer. - */ - numLearnedRoutes: number; - /** - * IP address of the remote BGP interface. - */ - peerIpAddress: string; - /** - * BGP state as specified in RFC1771. - */ - state: string; - /** - * Status of the BGP peer: {UP, DOWN} - */ - status: string; - /** - * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 - * hours, 59 minutes, 59 seconds - */ - uptime: string; - /** - * Time this session has been up, in seconds. Format: 145 - */ - uptimeSeconds: string; -} -export interface Schema$RouterStatusResponse { - /** - * Type of resource. - */ - kind: string; - result: Schema$RouterStatus; -} -/** - * Sets the scheduling options for an Instance. - */ -export interface Schema$Scheduling { - /** - * Specifies whether the instance should be automatically restarted if it is - * terminated by Compute Engine (not terminated by a user). You can only set - * the automatic restart option for standard instances. Preemptible instances - * cannot be automatically restarted. By default, this is set to true so an - * instance is automatically restarted if it is terminated by Compute Engine. - */ - automaticRestart: boolean; - /** - * Defines the maintenance behavior for this instance. For standard instances, - * the default behavior is MIGRATE. For preemptible instances, the default and - * only possible behavior is TERMINATE. For more information, see Setting - * Instance Scheduling Options. - */ - onHostMaintenance: string; - /** - * Defines whether the instance is preemptible. This can only be set during - * instance creation, it cannot be set or changed after the instance has been - * created. - */ - preemptible: boolean; -} -/** - * An instance's serial console output. - */ -export interface Schema$SerialPortOutput { - /** - * [Output Only] The contents of the console output. - */ - contents: string; - /** - * [Output Only] Type of the resource. Always compute#serialPortOutput for - * serial port output. - */ - kind: string; - /** - * [Output Only] The position of the next byte of content from the serial - * console output. Use this value in the next request as the start parameter. - */ - next: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * The starting byte position of the output that was returned. This should - * match the start parameter sent with the request. If the serial console - * output exceeds the size of the buffer, older output will be overwritten by - * newer content and the start values will be mismatched. - */ - start: string; -} -/** - * A service account. - */ -export interface Schema$ServiceAccount { - /** - * Email address of the service account. - */ - email: string; - /** - * The list of scopes to be made available for this service account. - */ - scopes: string[]; -} -/** - * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) (== - * resource_for v1.snapshots ==) - */ -export interface Schema$Snapshot { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Size of the snapshot, specified in GB. - */ - diskSizeGb: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#snapshot for Snapshot - * resources. - */ - kind: string; - /** - * A fingerprint for the labels being applied to this snapshot, which is - * essentially a hash of the labels set used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update labels. You must always provide an - * up-to-date fingerprint hash in order to update or change labels. To see - * the latest fingerprint, make a get() request to retrieve a snapshot. - */ - labelFingerprint: string; - /** - * Labels to apply to this snapshot. These can be later modified by the - * setLabels method. Label values may be empty. - */ - labels: any; - /** - * Integer license codes indicating which licenses are attached to this - * snapshot. - */ - licenseCodes: string[]; - /** - * [Output Only] A list of public visible licenses that apply to this - * snapshot. This can be because the original image had licenses attached - * (such as a Windows image). - */ - licenses: string[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Encrypts the snapshot using a customer-supplied encryption key. After you - * encrypt a snapshot using a customer-supplied key, you must provide the same - * key if you use the image later For example, you must provide the encryption - * key when you create a disk from the encrypted snapshot in a future request. - * Customer-supplied encryption keys do not protect access to metadata of the - * disk. If you do not provide an encryption key when creating the snapshot, - * then the snapshot will be encrypted using an automatically generated key - * and you do not need to provide a key to use the snapshot later. - */ - snapshotEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The source disk used to create this snapshot. - */ - sourceDisk: string; - /** - * The customer-supplied encryption key of the source disk. Required if the - * source disk is protected by a customer-supplied encryption key. - */ - sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; - /** - * [Output Only] The ID value of the disk used to create this snapshot. This - * value may be used to determine whether the snapshot was taken from the - * current or a previous instance of a given disk name. - */ - sourceDiskId: string; - /** - * [Output Only] The status of the snapshot. This can be CREATING, DELETING, - * FAILED, READY, or UPLOADING. - */ - status: string; - /** - * [Output Only] A size of the storage used by the snapshot. As snapshots - * share storage, this number is expected to change with snapshot - * creation/deletion. - */ - storageBytes: string; - /** - * [Output Only] An indicator whether storageBytes is in a stable state or it - * is being adjusted as a result of shared storage reallocation. This status - * can either be UPDATING, meaning the size of the snapshot is being updated, - * or UP_TO_DATE, meaning the size of the snapshot is up-to-date. - */ - storageBytesStatus: string; -} -/** - * Contains a list of Snapshot resources. - */ -export interface Schema$SnapshotList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Snapshot resources. - */ - items: Schema$Snapshot[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * An SslCertificate resource. This resource provides a mechanism to upload an - * SSL key and certificate to the load balancer to serve secure connections from - * the user. (== resource_for beta.sslCertificates ==) (== resource_for - * v1.sslCertificates ==) - */ -export interface Schema$SslCertificate { - /** - * A local certificate file. The certificate must be in PEM format. The - * certificate chain must be no greater than 5 certs long. The chain must - * include at least one intermediate cert. - */ - certificate: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#sslCertificate for SSL - * certificates. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * A write-only private key in PEM format. Only insert requests will include - * this field. - */ - privateKey: string; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; -} -/** - * Contains a list of SslCertificate resources. - */ -export interface Schema$SslCertificateList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslCertificate resources. - */ - items: Schema$SslCertificate[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SSLHealthCheck { - /** - * The TCP port number for the health check request. The default value is 443. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the SSL connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$SslPoliciesList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SslPolicy resources. - */ - items: Schema$SslPolicy[]; - /** - * [Output Only] Type of the resource. Always compute#sslPoliciesList for - * lists of sslPolicies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$SslPoliciesListAvailableFeaturesResponse { - features: string[]; -} -/** - * A SSL policy specifies the server-side support for SSL features. This can be - * attached to a TargetHttpsProxy or a TargetSslProxy. This affects connections - * between clients and the HTTPS or SSL proxy load balancer. They do not affect - * the connection between the load balancers and the backends. - */ -export interface Schema$SslPolicy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * A list of features enabled when the selected profile is CUSTOM. The - - * method returns the set of features that can be specified in this list. This - * field must be empty if the profile is not CUSTOM. - */ - customFeatures: string[]; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The list of features enabled in the SSL policy. - */ - enabledFeatures: string[]; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a SslPolicy. An up-to-date fingerprint must be provided in order - * to update the SslPolicy. - */ - fingerprint: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output only] Type of the resource. Always compute#sslPolicyfor SSL - * policies. - */ - kind: string; - /** - * The minimum version of SSL protocol that can be used by the clients to - * establish a connection with the load balancer. This can be one of TLS_1_0, - * TLS_1_1, TLS_1_2. - */ - minTlsVersion: string; - /** - * Name of the resource. The name must be 1-63 characters long, and comply - * with RFC1035. Specifically, the name must be 1-63 characters long and match - * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * Profile specifies the set of SSL features that can be used by the load - * balancer when negotiating SSL with clients. This can be one of COMPATIBLE, - * MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of SSL features to - * enable must be specified in the customFeatures field. - */ - profile: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] If potential misconfigurations are detected for this SSL - * policy, this field will be populated with warning messages. - */ - warnings: any[]; -} -export interface Schema$SslPolicyReference { - /** - * URL of the SSL policy resource. Set this to empty string to clear any - * existing SSL policy associated with the target proxy resource. - */ - sslPolicy: string; -} -/** - * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== resource_for - * v1.subnetworks ==) - */ -export interface Schema$Subnetwork { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. This field can be set only at resource creation time. - */ - description: string; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a Subnetwork. An up-to-date fingerprint must be provided in order - * to update the Subnetwork. - */ - fingerprint: string; - /** - * [Output Only] The gateway address for default routes to reach destination - * addresses outside this subnetwork. - */ - gatewayAddress: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * The range of internal addresses that are owned by this subnetwork. Provide - * this property when you create the subnetwork. For example, 10.0.0.0/8 or - * 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. - * Only IPv4 is supported. This field can be set only at resource creation - * time. - */ - ipCidrRange: string; - /** - * [Output Only] Type of the resource. Always compute#subnetwork for - * Subnetwork resources. - */ - kind: string; - /** - * The name of the resource, provided by the client when initially creating - * the resource. The name must be 1-63 characters long, and comply with - * RFC1035. Specifically, the name must be 1-63 characters long and match the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first - * character must be a lowercase letter, and all following characters must be - * a dash, lowercase letter, or digit, except the last character, which cannot - * be a dash. - */ - name: string; - /** - * The URL of the network to which this subnetwork belongs, provided by the - * client when initially creating the subnetwork. Only networks that are in - * the distributed mode can have subnetworks. This field can be set only at - * resource creation time. - */ - network: string; - /** - * Whether the VMs in this subnet can access Google services without assigned - * external IP addresses. This field can be both set at resource creation time - * and updated using setPrivateIpGoogleAccess. - */ - privateIpGoogleAccess: boolean; - /** - * URL of the region where the Subnetwork resides. This field can be set only - * at resource creation time. - */ - region: string; - /** - * An array of configurations for secondary IP ranges for VM instances - * contained in this subnetwork. The primary IP of such VM must belong to the - * primary ipCidrRange of the subnetwork. The alias IPs may belong to either - * primary or secondary ranges. - */ - secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; -} -export interface Schema$SubnetworkAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of SubnetworksScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#subnetworkAggregatedList for - * aggregated lists of subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of Subnetwork resources. - */ -export interface Schema$SubnetworkList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Subnetwork resources. - */ - items: Schema$Subnetwork[]; - /** - * [Output Only] Type of resource. Always compute#subnetworkList for lists of - * subnetworks. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a secondary IP range of a subnetwork. - */ -export interface Schema$SubnetworkSecondaryRange { - /** - * The range of IP addresses belonging to this subnetwork secondary range. - * Provide this property when you create the subnetwork. Ranges must be unique - * and non-overlapping with all primary and secondary IP ranges within a - * network. Only IPv4 is supported. - */ - ipCidrRange: string; - /** - * The name associated with this subnetwork secondary range, used when adding - * an alias IP range to a VM instance. The name must be 1-63 characters long, - * and comply with RFC1035. The name must be unique within the subnetwork. - */ - rangeName: string; -} -export interface Schema$SubnetworksExpandIpCidrRangeRequest { - /** - * The IP (in CIDR format or netmask) of internal addresses that are legal on - * this Subnetwork. This range should be disjoint from other subnetworks - * within this network. This range can only be larger than (i.e. a superset - * of) the range previously defined before the update. - */ - ipCidrRange: string; -} -export interface Schema$SubnetworksScopedList { - /** - * A list of subnetworks contained in this scope. - */ - subnetworks: Schema$Subnetwork[]; - /** - * An informational warning that appears when the list of addresses is empty. - */ - warning: any; -} -export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { - privateIpGoogleAccess: boolean; -} -/** - * A set of instance tags. - */ -export interface Schema$Tags { - /** - * Specifies a fingerprint for this request, which is essentially a hash of - * the metadata's contents and used for optimistic locking. The - * fingerprint is initially generated by Compute Engine and changes after - * every request to modify or update metadata. You must always provide an - * up-to-date fingerprint hash in order to update or change metadata. To see - * the latest fingerprint, make get() request to the instance. - */ - fingerprint: string; - /** - * An array of tags. Each tag must be 1-63 characters long, and comply with - * RFC1035. - */ - items: string[]; -} -/** - * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== - * resource_for beta.targetHttpProxies ==) (== resource_for v1.targetHttpProxies - * ==) - */ -export interface Schema$TargetHttpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpProxy for target - * HTTP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the UrlMap resource that defines the mapping from URL to the - * BackendService. - */ - urlMap: string; -} -/** - * A list of TargetHttpProxy resources. - */ -export interface Schema$TargetHttpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpProxy resources. - */ - items: Schema$TargetHttpProxy[]; - /** - * Type of resource. Always compute#targetHttpProxyList for lists of target - * HTTP proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { - /** - * New set of SslCertificate resources to associate with this TargetHttpsProxy - * resource. Currently exactly one SslCertificate resource must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== - * resource_for beta.targetHttpsProxies ==) (== resource_for - * v1.targetHttpsProxies ==) - */ -export interface Schema$TargetHttpsProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetHttpsProxy for target - * HTTPS proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * between users and the load balancer. Currently, exactly one SSL certificate - * must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetHttpsProxy - * resource. If not set, the TargetHttpsProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; - /** - * A fully-qualified or valid partial URL to the UrlMap resource that defines - * the mapping from URL to the BackendService. For example, the following are - * all valid URLs for specifying a URL map: - - * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map - * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map - */ - urlMap: string; -} -/** - * Contains a list of TargetHttpsProxy resources. - */ -export interface Schema$TargetHttpsProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetHttpsProxy resources. - */ - items: Schema$TargetHttpsProxy[]; - /** - * Type of resource. Always compute#targetHttpsProxyList for lists of target - * HTTPS proxies. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * A TargetInstance resource. This resource defines an endpoint instance that - * terminates traffic of certain protocols. (== resource_for - * beta.targetInstances ==) (== resource_for v1.targetInstances ==) - */ -export interface Schema$TargetInstance { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A URL to the virtual machine instance that handles traffic for this target - * instance. When creating a target instance, you can provide the - * fully-qualified URL or a valid partial URL to the desired virtual machine. - * For example, the following are all valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - * - projects/project/zones/zone/instances/instance - - * zones/zone/instances/instance - */ - instance: string; - /** - * [Output Only] The type of the resource. Always compute#targetInstance for - * target instances. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * NAT option controlling how IPs are NAT'ed to the instance. Currently - * only NO_NAT (default value) is supported. - */ - natPolicy: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] URL of the zone where the target instance resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - zone: string; -} -export interface Schema$TargetInstanceAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: any; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetInstance resources. - */ -export interface Schema$TargetInstanceList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetInstance resources. - */ - items: Schema$TargetInstance[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetInstancesScopedList { - /** - * A list of target instances contained in this scope. - */ - targetInstances: Schema$TargetInstance[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -/** - * A TargetPool resource. This resource defines a pool of instances, an - * associated HttpHealthCheck resource, and the fallback target pool. (== - * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) - */ -export interface Schema$TargetPool { - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool, and its failoverRatio field is - * properly set to a value between [0, 1]. backupPool and failoverRatio - * together define the fallback behavior of the primary target pool: if the - * ratio of the healthy instances in the primary pool is at or below - * failoverRatio, traffic arriving at the load-balanced IP will be directed to - * the backup pool. In case where failoverRatio and backupPool are not set, - * or all the instances in the backup pool are unhealthy, the traffic will be - * directed back to the primary pool in the "force" mode, where - * traffic will be spread to the healthy instances with the best effort, or to - * all instances when no instance is healthy. - */ - backupPool: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * This field is applicable only when the containing target pool is serving a - * forwarding rule as the primary pool (i.e., not as a backup pool to some - * other target pool). The value of the field must be in [0, 1]. If set, - * backupPool must also be set. They together define the fallback behavior of - * the primary target pool: if the ratio of the healthy instances in the - * primary pool is at or below this number, traffic arriving at the - * load-balanced IP will be directed to the backup pool. In case where - * failoverRatio is not set or all the instances in the backup pool are - * unhealthy, the traffic will be directed back to the primary pool in the - * "force" mode, where traffic will be spread to the healthy - * instances with the best effort, or to all instances when no instance is - * healthy. - */ - failoverRatio: number; - /** - * The URL of the HttpHealthCheck resource. A member instance in this pool is - * considered healthy if and only if the health checks pass. An empty list - * means all member instances will be considered healthy at all times. Only - * HttpHealthChecks are supported. Only one health check may be specified. - */ - healthChecks: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * A list of resource URLs to the virtual machine instances serving this pool. - * They must live in zones contained in the same region as this pool. - */ - instances: string[]; - /** - * [Output Only] Type of the resource. Always compute#targetPool for target - * pools. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * [Output Only] URL of the region where the target pool resides. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Sesssion affinity option, must be one of the following values: NONE: - * Connections from the same client IP may go to any instance in the pool. - * CLIENT_IP: Connections from the same client IP will go to the same instance - * in the pool while that instance remains healthy. CLIENT_IP_PROTO: - * Connections from the same client IP with the same IP protocol will go to - * the same instance in the pool while that instance remains healthy. - */ - sessionAffinity: string; -} -export interface Schema$TargetPoolAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetPoolAggregatedList for - * aggregated lists of target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolInstanceHealth { - healthStatus: Schema$HealthStatus[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth - * when checking the health of an instance. - */ - kind: string; -} -/** - * Contains a list of TargetPool resources. - */ -export interface Schema$TargetPoolList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetPool resources. - */ - items: Schema$TargetPool[]; - /** - * [Output Only] Type of resource. Always compute#targetPoolList for lists of - * target pools. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetPoolsAddHealthCheckRequest { - /** - * The HttpHealthCheck to add to the target pool. - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsAddInstanceRequest { - /** - * A full or partial URL to an instance to add to this target pool. This can - * be a full or partial URL. For example, the following are valid URLs: - - * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name - * - projects/project-id/zones/zone/instances/instance-name - - * zones/zone/instances/instance-name - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsRemoveHealthCheckRequest { - /** - * Health check URL to be removed. This can be a full or valid partial URL. - * For example, the following are valid URLs: - - * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check - * - projects/project/global/httpHealthChecks/health-check - - * global/httpHealthChecks/health-check - */ - healthChecks: Schema$HealthCheckReference[]; -} -export interface Schema$TargetPoolsRemoveInstanceRequest { - /** - * URLs of the instances to be removed from target pool. - */ - instances: Schema$InstanceReference[]; -} -export interface Schema$TargetPoolsScopedList { - /** - * A list of target pools contained in this scope. - */ - targetPools: Schema$TargetPool[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$TargetReference { target: string; } -export interface Schema$TargetSslProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetSslProxy. - */ - service: string; -} -export interface Schema$TargetSslProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -export interface Schema$TargetSslProxiesSetSslCertificatesRequest { - /** - * New set of URLs to SslCertificate resources to associate with this - * TargetSslProxy. Currently exactly one ssl certificate must be specified. - */ - sslCertificates: string[]; -} -/** - * A TargetSslProxy resource. This resource defines an SSL proxy. (== - * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies - * ==) - */ -export interface Schema$TargetSslProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetSslProxy for - * target SSL proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; - /** - * URLs to SslCertificate resources that are used to authenticate connections - * to Backends. Currently exactly one SSL certificate must be specified. - */ - sslCertificates: string[]; - /** - * URL of SslPolicy resource that will be associated with the TargetSslProxy - * resource. If not set, the TargetSslProxy resource will not have any SSL - * policy configured. - */ - sslPolicy: string; -} -/** - * Contains a list of TargetSslProxy resources. - */ -export interface Schema$TargetSslProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetSslProxy resources. - */ - items: Schema$TargetSslProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetTcpProxiesSetBackendServiceRequest { - /** - * The URL of the new BackendService resource for the targetTcpProxy. - */ - service: string; -} -export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { - /** - * The new type of proxy header to append before sending data to the backend. - * NONE or PROXY_V1 are allowed. - */ - proxyHeader: string; -} -/** - * A TargetTcpProxy resource. This resource defines a TCP proxy. (== - * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies - * ==) - */ -export interface Schema$TargetTcpProxy { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#targetTcpProxy for - * target TCP proxies. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * URL to the BackendService resource. - */ - service: string; -} -/** - * Contains a list of TargetTcpProxy resources. - */ -export interface Schema$TargetTcpProxyList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetTcpProxy resources. - */ - items: Schema$TargetTcpProxy[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Represents a Target VPN gateway resource. (== resource_for - * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) - */ -export interface Schema$TargetVpnGateway { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] A list of URLs to the ForwardingRule resources. - * ForwardingRules are created using compute.forwardingRules.insert and - * associated to a VPN gateway. - */ - forwardingRules: string[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * URL of the network to which this VPN gateway is attached. Provided by the - * client when the VPN gateway is created. - */ - network: string; - /** - * [Output Only] URL of the region where the target VPN gateway resides. You - * must specify this field as part of the HTTP request URL. It is not settable - * as a field in the request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The status of the VPN gateway. - */ - status: string; - /** - * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created - * using compute.vpntunnels.insert method and associated to a VPN gateway. - */ - tunnels: string[]; -} -export interface Schema$TargetVpnGatewayAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of TargetVpnGateway resources. - */ -export interface Schema$TargetVpnGatewayList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of TargetVpnGateway resources. - */ - items: Schema$TargetVpnGateway[]; - /** - * [Output Only] Type of resource. Always compute#targetVpnGateway for target - * VPN gateways. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$TargetVpnGatewaysScopedList { - /** - * [Output Only] A list of target vpn gateways contained in this scope. - */ - targetVpnGateways: Schema$TargetVpnGateway[]; - /** - * [Output Only] Informational warning which replaces the list of addresses - * when the list is empty. - */ - warning: any; -} -export interface Schema$TCPHealthCheck { - /** - * The TCP port number for the health check request. The default value is 80. - * Valid values are 1 through 65535. - */ - port: number; - /** - * Port name as defined in InstanceGroup#NamedPort#name. If both port and - * port_name are defined, port takes precedence. - */ - portName: string; - /** - * Specifies the type of proxy header to append before sending data to the - * backend, either NONE or PROXY_V1. The default is NONE. - */ - proxyHeader: string; - /** - * The application data to send once the TCP connection has been established - * (default value is empty). If both request and response are empty, the - * connection establishment alone will indicate health. The request data can - * only be ASCII. - */ - request: string; - /** - * The bytes to match against the beginning of the response data. If left - * empty (the default value), any response will indicate health. The response - * data can only be ASCII. - */ - response: string; -} -export interface Schema$TestFailure { - actualService: string; - expectedService: string; - host: string; - path: string; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A UrlMap resource. This resource defines the mapping from URL to the - * BackendService resource, based on the "longest-match" of the - * URL's host and path. - */ -export interface Schema$UrlMap { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * The URL of the BackendService resource if none of the hostRules match. - */ - defaultService: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * Fingerprint of this resource. A hash of the contents stored in this object. - * This field is used in optimistic locking. This field will be ignored when - * inserting a UrlMap. An up-to-date fingerprint must be provided in order to - * update the UrlMap. - */ - fingerprint: string; - /** - * The list of HostRules to use against the URL. - */ - hostRules: Schema$HostRule[]; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#urlMaps for url maps. - */ - kind: string; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * The list of named PathMatchers to use against the URL. - */ - pathMatchers: Schema$PathMatcher[]; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * The list of expected URL mapping tests. Request to update this UrlMap will - * succeed only if all of the test cases pass. You can specify a maximum of - * 100 tests per UrlMap. - */ - tests: Schema$UrlMapTest[]; -} -/** - * Contains a list of UrlMap resources. - */ -export interface Schema$UrlMapList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of UrlMap resources. - */ - items: Schema$UrlMap[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$UrlMapReference { urlMap: string; } -export interface Schema$UrlMapsValidateRequest { - /** - * Content of the UrlMap to be validated. - */ - resource: Schema$UrlMap; -} -export interface Schema$UrlMapsValidateResponse { - result: Schema$UrlMapValidationResult; -} -/** - * Message for the expected URL mappings. - */ -export interface Schema$UrlMapTest { - /** - * Description of this test case. - */ - description: string; - /** - * Host portion of the URL. - */ - host: string; - /** - * Path portion of the URL. - */ - path: string; - /** - * Expected BackendService resource the given URL should be mapped to. - */ - service: string; -} -/** - * Message representing the validation result for a UrlMap. - */ -export interface Schema$UrlMapValidationResult { - loadErrors: string[]; - /** - * Whether the given UrlMap can be successfully loaded. If false, - * 'loadErrors' indicates the reasons. - */ - loadSucceeded: boolean; - testFailures: Schema$TestFailure[]; - /** - * If successfully loaded, this field indicates whether the test passed. If - * false, 'testFailures's indicate the reason of failure. - */ - testPassed: boolean; -} -/** - * The location in Cloud Storage and naming method of the daily usage report. - * Contains bucket_name and report_name prefix. - */ -export interface Schema$UsageExportLocation { - /** - * The name of an existing bucket in Cloud Storage where the usage report - * object is stored. The Google Service Account is granted write access to - * this bucket. This can either be the bucket name by itself, such as - * example-bucket, or the bucket name with gs:// or - * https://storage.googleapis.com/ in front of it, such as - * gs://example-bucket. - */ - bucketName: string; - /** - * An optional prefix for the name of the usage report object stored in - * bucketName. If not supplied, defaults to usage. The report is stored as a - * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the - * day of the usage according to Pacific Time. If you supply a prefix, it - * should conform to Cloud Storage object naming conventions. - */ - reportNamePrefix: string; -} -/** - * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for - * v1.vpnTunnels ==) - */ -export interface Schema$VpnTunnel { - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional description of this resource. Provide this property when you - * create the resource. - */ - description: string; - /** - * [Output Only] Detailed status message for the VPN tunnel. - */ - detailedStatus: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * IKE protocol version to use when establishing the VPN tunnel with peer VPN - * gateway. Acceptable IKE versions are 1 or 2. Default version is 2. - */ - ikeVersion: number; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * Local traffic selector to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - localTrafficSelector: string[]; - /** - * Name of the resource. Provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * IP address of the peer VPN gateway. Only IPv4 is supported. - */ - peerIp: string; - /** - * [Output Only] URL of the region where the VPN tunnel resides. You must - * specify this field as part of the HTTP request URL. It is not settable as a - * field in the request body. - */ - region: string; - /** - * Remote traffic selectors to use when establishing the VPN tunnel with peer - * VPN gateway. The value should be a CIDR formatted string, for example: - * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. - */ - remoteTrafficSelector: string[]; - /** - * URL of router resource to be used for dynamic routing. - */ - router: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * Shared secret used to set the secure session between the Cloud VPN gateway - * and the peer VPN gateway. - */ - sharedSecret: string; - /** - * Hash of the shared secret. - */ - sharedSecretHash: string; - /** - * [Output Only] The status of the VPN tunnel. - */ - status: string; - /** - * URL of the Target VPN gateway with which this VPN tunnel is associated. - * Provided by the client when the VPN tunnel is created. - */ - targetVpnGateway: string; -} -export interface Schema$VpnTunnelAggregatedList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnelsScopedList resources. - */ - items: any; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Contains a list of VpnTunnel resources. - */ -export interface Schema$VpnTunnelList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of VpnTunnel resources. - */ - items: Schema$VpnTunnel[]; - /** - * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$VpnTunnelsScopedList { - /** - * A list of vpn tunnels contained in this scope. - */ - vpnTunnels: Schema$VpnTunnel[]; - /** - * Informational warning which replaces the list of addresses when the list is - * empty. - */ - warning: any; -} -export interface Schema$XpnHostList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * [Output Only] A list of shared VPC host project URLs. - */ - items: Schema$Project[]; - /** - * [Output Only] Type of resource. Always compute#xpnHostList for lists of - * shared VPC hosts. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -/** - * Service resource (a.k.a service project) ID. - */ -export interface Schema$XpnResourceId { - /** - * The ID of the service resource. In the case of projects, this field matches - * the project ID (e.g., my-project), not the project number (e.g., 12345678). - */ - id: string; - /** - * The type of the service resource. - */ - type: string; -} -/** - * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones - * ==) - */ -export interface Schema$Zone { - /** - * [Output Only] Available cpu/platform selections for the zone. - */ - availableCpuPlatforms: string[]; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * [Output Only] The deprecation status associated with this zone. - */ - deprecated: Schema$DeprecationStatus; - /** - * [Output Only] Textual description of the resource. - */ - description: string; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] Type of the resource. Always compute#zone for zones. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] Full URL reference to the region which hosts the zone. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the zone, either UP or DOWN. - */ - status: string; -} -/** - * Contains a list of zone resources. - */ -export interface Schema$ZoneList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * A list of Zone resources. - */ - items: Schema$Zone[]; - /** - * Type of resource. - */ - kind: string; - /** - * [Output Only] This token allows you to get the next page of results for - * list requests. If the number of results is larger than maxResults, use the - * nextPageToken as a value for the query parameter pageToken in the next list - * request. Subsequent list requests will have their own nextPageToken to - * continue paging through the results. - */ - nextPageToken: string; - /** - * [Output Only] Server-defined URL for this resource. - */ - selfLink: string; - /** - * [Output Only] Informational warning message. - */ - warning: any; -} -export interface Schema$ZoneSetLabelsRequest { - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Compute Engine - * and changes after every request to modify or update labels. You must always - * provide an up-to-date fingerprint hash in order to update or change labels. - * Make a get() request to the resource to get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The labels to set for this resource. - */ - labels: any; -} - -export class Resource$Acceleratortypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.acceleratorTypes.aggregatedList - * @desc Retrieves an aggregated list of accelerator types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.acceleratorTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.get - * @desc Returns the specified accelerator type. Get a list of available - * accelerator types by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the accelerator type to return. - * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.acceleratorTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.acceleratorType Name of the accelerator type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'acceleratorType'], - pathParams: ['acceleratorType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.acceleratorTypes.list - * @desc Retrieves a list of accelerator types available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.acceleratorTypes.list(request, handlePage); - * } - * }; - * - * compute.acceleratorTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.acceleratorTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Addresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.addresses.aggregatedList - * @desc Retrieves an aggregated list of addresses. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.aggregatedList(request, handlePage); - * } - * }; - * - * compute.addresses.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.delete - * @desc Deletes the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.get - * @desc Returns the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.addresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'address'], - pathParams: ['address', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.addresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.addresses.list - * @desc Retrieves a list of addresses contained within the specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.addresses.list(request, handlePage); - * } - * }; - * - * compute.addresses.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.addresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Autoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.autoscalers.aggregatedList - * @desc Retrieves an aggregated list of autoscalers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.autoscalers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.delete - * @desc Deletes the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.get - * @desc Returns the specified autoscaler resource. Get a list of available - * autoscalers by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.autoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.autoscalers.list(request, handlePage); - * } - * }; - * - * compute.autoscalers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.autoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.autoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.autoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone for this request. - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendbuckets { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendBuckets.delete - * @desc Deletes the specified BackendBucket resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to delete. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.get - * @desc Returns the specified BackendBucket resource. Get a list of available - * backend buckets by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to return. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.backendBuckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.insert - * @desc Creates a BackendBucket resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.list - * @desc Retrieves the list of BackendBucket resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendBuckets.list(request, handlePage); - * } - * }; - * - * compute.backendBuckets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.patch - * @desc Updates the specified BackendBucket resource with the data included - * in the request. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to patch. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendBuckets.update - * @desc Updates the specified BackendBucket resource with the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendBucket resource to update. - * backendBucket: 'my-backend-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.backendBuckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendBuckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendBucket Name of the BackendBucket resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendBucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendBucket'], - pathParams: ['backendBucket', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Backendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.backendServices.aggregatedList - * @desc Retrieves the list of all BackendService resources, regional and - * global, available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the project scoping this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.aggregatedList(request, handlePage); - * } - * }; - * - * compute.backendServices.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Name of the project scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.delete - * @desc Deletes the specified BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.backendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.get - * @desc Returns the specified BackendService resource. Get a list of - * available backend services by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.backendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.getHealth - * @desc Gets the most recent health check results for this BackendService. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance - * belongs. backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. - * @param {string} params.project - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.insert - * @desc Creates a BackendService resource in the specified project using the - * data included in the request. There are several restrictions and guidelines - * to keep in mind when creating a backend service. Read Restrictions and - * Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.list - * @desc Retrieves the list of BackendService resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.backendServices.list(request, handlePage); - * } - * }; - * - * compute.backendServices.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.patch - * @desc Patches the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. This method supports PATCH semantics and uses the JSON - * merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.backendServices.update - * @desc Updates the specified BackendService resource with the data included - * in the request. There are several restrictions and guidelines to keep in - * mind when updating a backend service. Read Restrictions and Guidelines for - * more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.backendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.backendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'backendService'], - pathParams: ['backendService', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.disks.aggregatedList - * @desc Retrieves an aggregated list of persistent disks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.aggregatedList(request, handlePage); - * } - * }; - * - * compute.disks.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/aggregated/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.createSnapshot - * @desc Creates a snapshot of a specified persistent disk. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to snapshot. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.createSnapshot(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.createSnapshot - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to snapshot. - * @param {boolean=} params.guestFlush - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Snapshot} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createSnapshot(params?: any, options?: MethodOptions): - AxiosPromise; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createSnapshot( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.delete - * @desc Deletes the specified persistent disk. Deleting a disk removes its - * data permanently and is irreversible. However, deleting a disk does not - * delete any snapshots previously made from the disk. You must separately - * delete snapshots. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to delete. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.get - * @desc Returns a specified persistent disk. Get a list of available - * persistent disks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the persistent disk to return. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.disks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk Name of the persistent disk to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.insert - * @desc Creates a persistent disk in the specified project using the data in - * the request. You can create a disk with a sourceImage, a sourceSnapshot, or - * create an empty 500 GB data disk by omitting all properties. You can also - * create a disk that is larger than the default size by specifying the sizeGb - * property. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. - * @param {string} params.zone The name of the zone for this request. - * @param {().Disk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.list - * @desc Retrieves a list of persistent disks contained within the specified - * zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.disks.list(request, handlePage); - * } - * }; - * - * compute.disks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/zones/{zone}/disks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.resize - * @desc Resizes the specified persistent disk. You can only increase the size - * of the disk. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the persistent disk. - * disk: 'my-disk', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.disk The name of the persistent disk. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().DisksResizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'disk'], - pathParams: ['disk', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.disks.setLabels - * @desc Sets the labels on a disk. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.disks.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.disks.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {().ZoneSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Disktypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.diskTypes.aggregatedList - * @desc Retrieves an aggregated list of disk types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.diskTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.get - * @desc Returns the specified disk type. Get a list of available disk types - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the disk type to return. - * diskType: 'my-disk-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.diskTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.diskType Name of the disk type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/diskTypes/{diskType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'diskType'], - pathParams: ['diskType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.diskTypes.list - * @desc Retrieves a list of disk types available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.diskTypes.list(request, handlePage); - * } - * }; - * - * compute.diskTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.diskTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/diskTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Firewalls { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.firewalls.delete - * @desc Deletes the specified firewall. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to delete. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.get - * @desc Returns the specified firewall. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to return. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.firewalls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.insert - * @desc Creates a firewall rule in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.list - * @desc Retrieves the list of firewall rules available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.firewalls.list(request, handlePage); - * } - * }; - * - * compute.firewalls.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/firewalls') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.patch - * @desc Updates the specified firewall rule with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to patch. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.firewalls.update - * @desc Updates the specified firewall rule with the data included in the - * request. The PUT method can only update the following fields of firewall - * rule: allowed, description, sourceRanges, sourceTags, targetTags. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the firewall rule to update. - * firewall: 'my-firewall', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.firewalls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.firewalls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.firewall Name of the firewall rule to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Firewall} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/firewalls/{firewall}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'firewall'], - pathParams: ['firewall', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Forwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.forwardingRules.aggregatedList - * @desc Retrieves an aggregated list of forwarding rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.aggregatedList(request, handlePage); - * } - * }; - * - * compute.forwardingRules.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.delete - * @desc Deletes the specified ForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.get - * @desc Returns the specified ForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.forwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.insert - * @desc Creates a ForwardingRule resource in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.list - * @desc Retrieves a list of ForwardingRule resources available to the - * specified project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.forwardingRules.list(request, handlePage); - * } - * }; - * - * compute.forwardingRules.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.forwardingRules.setTarget - * @desc Changes target URL for forwarding rule. The new target should be of - * the same type as the old target. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.forwardingRules.setTarget(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.forwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'forwardingRule'], - pathParams: ['forwardingRule', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaladdresses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalAddresses.delete - * @desc Deletes the specified address resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the address resource to delete. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.get - * @desc Returns the specified address resource. Get a list of available - * addresses by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the address resource to return. - * address: 'my-address', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalAddresses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.address Name of the address resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/addresses/{address}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'address'], - pathParams: ['address', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.insert - * @desc Creates an address resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalAddresses.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Address} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalAddresses.list - * @desc Retrieves a list of global addresses. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalAddresses.list(request, handlePage); - * } - * }; - * - * compute.globalAddresses.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalAddresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/addresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globalforwardingrules { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalForwardingRules.delete - * @desc Deletes the specified GlobalForwardingRule resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to delete. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.get - * @desc Returns the specified GlobalForwardingRule resource. Get a list of - * available forwarding rules by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource to return. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.insert - * @desc Creates a GlobalForwardingRule resource in the specified project - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ForwardingRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.list - * @desc Retrieves a list of GlobalForwardingRule resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalForwardingRules.list(request, handlePage); - * } - * }; - * - * compute.globalForwardingRules.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/forwardingRules') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalForwardingRules.setTarget - * @desc Changes target URL for the GlobalForwardingRule resource. The new - * target should be of the same type as the old target. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the ForwardingRule resource in which target is to be set. - * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.globalForwardingRules.setTarget(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalForwardingRules.setTarget - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTarget(params?: any, options?: MethodOptions): - AxiosPromise; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTarget( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'forwardingRule'], - pathParams: ['forwardingRule', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Globaloperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.globalOperations.aggregatedList - * @desc Retrieves an aggregated list of all operations. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.aggregatedList(request, handlePage); - * } - * }; - * - * compute.globalOperations.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.delete - * @desc Deletes the specified Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.get - * @desc Retrieves the specified Operations resource. Get a list of operations - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.globalOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.globalOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.globalOperations.list(request, handlePage); - * } - * }; - * - * compute.globalOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.globalOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Healthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.healthChecks.delete - * @desc Deletes the specified HealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to delete. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.get - * @desc Returns the specified HealthCheck resource. Get a list of available - * health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to return. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.healthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.insert - * @desc Creates a HealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/v1/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.list - * @desc Retrieves the list of HealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.healthChecks.list(request, handlePage); - * } - * }; - * - * compute.healthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/compute/v1/projects/{project}/global/healthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.patch - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to patch. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.healthChecks.update - * @desc Updates a HealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HealthCheck resource to update. - * healthCheck: 'my-health-check', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.healthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.healthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.healthCheck Name of the HealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'healthCheck'], - pathParams: ['healthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httphealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpHealthChecks.delete - * @desc Deletes the specified HttpHealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to delete. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.get - * @desc Returns the specified HttpHealthCheck resource. Get a list of - * available HTTP health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to return. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.insert - * @desc Creates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.list - * @desc Retrieves the list of HttpHealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpHealthChecks.list(request, handlePage); - * } - * }; - * - * compute.httpHealthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.patch - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. This method supports PATCH semantics and uses - * the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to patch. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpHealthChecks.update - * @desc Updates a HttpHealthCheck resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpHealthCheck resource to update. - * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.httpHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpHealthCheck'], - pathParams: ['httpHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Httpshealthchecks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.httpsHealthChecks.delete - * @desc Deletes the specified HttpsHealthCheck resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to delete. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.get - * @desc Returns the specified HttpsHealthCheck resource. Get a list of - * available HTTPS health checks by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to return. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.insert - * @desc Creates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.list - * @desc Retrieves the list of HttpsHealthCheck resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.httpsHealthChecks.list(request, handlePage); - * } - * }; - * - * compute.httpsHealthChecks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.patch - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to patch. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.httpsHealthChecks.update - * @desc Updates a HttpsHealthCheck resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the HttpsHealthCheck resource to update. - * httpsHealthCheck: 'my-https-health-check', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.httpsHealthChecks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.httpsHealthChecks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().HttpsHealthCheck} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'httpsHealthCheck'], - pathParams: ['httpsHealthCheck', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Images { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.images.delete - * @desc Deletes the specified image. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image resource to delete. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.deprecate - * @desc Sets the deprecation status of an image. If an empty request body is - * given, clears the deprecation status instead. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Image name. - * image: 'my-image', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.deprecate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.deprecate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Image name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DeprecationStatus} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deprecate(params?: any, options?: MethodOptions): - AxiosPromise; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deprecate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/images/{image}/deprecate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.get - * @desc Returns the specified image. Get a list of available images by making - * a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image resource to return. - * image: 'my-image', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.image Name of the image resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/images/{image}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'image'], - pathParams: ['image', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.getFromFamily - * @desc Returns the latest image that is part of an image family and is not - * deprecated. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the image family to search for. - * family: 'my-family', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.images.getFromFamily(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.getFromFamily - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.family Name of the image family to search for. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getFromFamily(params?: any, options?: MethodOptions): - AxiosPromise; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getFromFamily( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/images/family/{family}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'family'], - pathParams: ['family', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.insert - * @desc Creates an image in the specified project using the data included in - * the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.forceCreate Force image creation if true. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Image} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.list - * @desc Retrieves the list of custom images available to the specified - * project. Custom images are images you create that belong to your project. - * This method does not get any images that belong to other projects, - * including publicly-available images, like Debian 8. If you want to get a - * list of publicly-available images, use this method to make a request to the - * respective image project, such as debian-cloud or windows-cloud. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.images.list(request, handlePage); - * } - * }; - * - * compute.images.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/images') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.images.setLabels - * @desc Sets the labels on an image. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.images.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.images.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/images/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.abandonInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.aggregatedList - * @desc Retrieves the list of managed instance groups and groups them by - * zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instanceGroupManagers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/aggregated/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.instanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. Note that the instance group must not belong to a backend - * service. Read Deleting an instance group for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.deleteInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. Gets a list of available managed instance groups by making a list() - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A managed instance group can have up to 1000 VM instances per - * group. Please contact Cloud Support if you need an increase in this limit. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the managed instance - * group. zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the managed instance group. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.list - * @desc Retrieves a list of managed instance groups that are contained within - * the specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroupManagers.list(request, handlePage); - * } - * }; - * - * compute.instanceGroupManagers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.listManagedInstances - * @desc Lists all of the instances in the managed instance group. Each - * instance in the list has a currentAction, which indicates the action that - * the managed instance group is performing on the instance. For example, if - * the group is still creating an instance, the currentAction is CREATING. If - * a previous action failed, the list displays the errors for that failed - * action. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.listManagedInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>, - callback?: BodyResponseCallback< - Schema$InstanceGroupManagersListManagedInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$InstanceGroupManagersListManagedInstancesResponse>(parameters); - } - } - - - /** - * compute.instanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.recreateInstances(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.resize - * @desc Resizes the managed instance group. If you increase the size, the - * group creates new instances using the current instance template. If you - * decrease the size, the group deletes instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * // The number of running instances that the managed instance group - * should maintain at any given time. - * // The group automatically adds or removes instances to maintain the - * number of instances specified by - * // this parameter. - * size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.resize(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setInstanceTemplate - * @desc Specifies the instance template to use when creating new instances in - * this group. The templates for existing instances in the group do not change - * unless you recreate them. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setInstanceTemplate(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all instances in this managed - * instance group are assigned. The target pools automatically apply to all of - * the instances in the managed instance group. This operation is marked DONE - * when you make the request even if the instances have not yet been added to - * their target pools. The change might take some time to apply to all of the - * instances in the group depending on the size of the group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the managed instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroupManagers.setTargetPools(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the managed instance group is located. - * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceGroups.addInstances - * @desc Adds a list of instances to the specified instance group. All of the - * instances in the instance group must be in the same network/subnetwork. - * Read Adding instances for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where you are adding instances. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.addInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.addInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where you are adding instances. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstances(params?: any, options?: MethodOptions): - AxiosPromise; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.aggregatedList - * @desc Retrieves the list of instance groups and sorts them by zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instanceGroups.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.delete - * @desc Deletes the specified instance group. The instances in the group are - * not deleted. Note that instance group must not belong to a backend service. - * Read Deleting an instance group for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group to delete. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.get - * @desc Returns the specified instance group. Get a list of available - * instance groups by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.insert - * @desc Creates an instance group in the specified project using the - * parameters that are included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where you want to create the instance group. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where you want to create the instance group. - * @param {().InstanceGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.list - * @desc Retrieves the list of instance groups that are located in the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.list(request, handlePage); - * } - * }; - * - * compute.instanceGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.listInstances - * @desc Lists the instances in the specified instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group from which you want to generate a - * list of included instances. instanceGroup: 'my-instance-group', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.instanceGroups.listInstances(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.removeInstances - * @desc Removes one or more instances from the specified instance group, but - * does not delete those instances. If the group is part of a backend service - * that has enabled connection draining, it can take up to 60 seconds after - * the connection draining duration before the VM instance is removed or - * deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the specified instances will be - * removed. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.removeInstances(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.removeInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstances(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceGroups.setNamedPorts - * @desc Sets the named ports for the specified instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone where the instance group is located. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the instance group where the named ports are updated. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceGroups.setNamedPorts(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone where the instance group is located. - * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instances.addAccessConfig - * @desc Adds an access config to an instance's network interface. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the network interface to add to this instance. - * networkInterface: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.addAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.addAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to add to this instance. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.aggregatedList - * @desc Retrieves aggregated list of instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.aggregatedList(request, handlePage); - * } - * }; - * - * compute.instances.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.attachDisk - * @desc Attaches an existing Disk resource to an instance. You must first - * create the disk before you can attach it. It is not possible to create and - * attach a disk at the same time. For more information, read Adding a - * persistent disk to your instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.attachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.attachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AttachedDisk} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - attachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - attachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.delete - * @desc Deletes the specified Instance resource. For more information, see - * Stopping or Deleting an Instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to delete. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.deleteAccessConfig - * @desc Deletes an access config from an instance's network interface. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name for this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // The name of the access config to delete. - * accessConfig: '', // TODO: Update placeholder value. - * - * // The name of the network interface. - * networkInterface: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.deleteAccessConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.deleteAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accessConfig The name of the access config to delete. - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.detachDisk - * @desc Detaches a disk from an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Disk device name to detach. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.detachDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.detachDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deviceName Disk device name to detach. - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detachDisk(params?: any, options?: MethodOptions): - AxiosPromise; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - detachDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.get - * @desc Returns the specified Instance resource. Get a list of available - * instances by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to return. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.getSerialPortOutput - * @desc Returns the specified instance's serial port output. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.getSerialPortOutput(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.getSerialPortOutput - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSerialPortOutput(params?: any, options?: MethodOptions): - AxiosPromise; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getSerialPortOutput( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.insert - * @desc Creates an instance resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate - * @param {string} params.zone The name of the zone for this request. - * @param {().Instance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.list - * @desc Retrieves the list of instances contained within the specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instances.list(request, handlePage); - * } - * }; - * - * compute.instances.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.listReferrers - * @desc Retrieves the list of referrers to instances contained within the - * specified zone. - * @alias compute.instances.listReferrers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listReferrers(params?: any, options?: MethodOptions): - AxiosPromise; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listReferrers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.reset - * @desc Performs a reset on the instance. For more information, see Resetting - * an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.reset(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDeletionProtection - * @desc Sets deletion protection on the instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDeletionProtection(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setDeletionProtection - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.resource_ Name of the resource for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDeletionProtection(params?: any, options?: MethodOptions): - AxiosPromise; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDeletionProtection( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resource'], - pathParams: ['project', 'resource', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setDiskAutoDelete - * @desc Sets the auto-delete flag for a disk attached to an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * // Whether to auto-delete the disk when the instance is deleted. - * autoDelete: false, // TODO: Update placeholder value. - * - * // The device name of the disk to modify. - * deviceName: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.setDiskAutoDelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setDiskAutoDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. - * @param {string} params.deviceName The device name of the disk to modify. - * @param {string} params.instance The instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDiskAutoDelete(params?: any, options?: MethodOptions): - AxiosPromise; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDiskAutoDelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setLabels - * @desc Sets labels on an instance. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineResources - * @desc Changes the number and/or type of accelerator for a stopped instance - * to the values specified in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineResources(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMachineResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineResources(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMachineType - * @desc Changes the machine type for a stopped instance to the machine type - * specified in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMachineType(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMachineType - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMachineTypeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMachineType(params?: any, options?: MethodOptions): - AxiosPromise; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMachineType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMetadata - * @desc Sets metadata for the specified instance to the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMetadata(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setMinCpuPlatform - * @desc Changes the minimum CPU platform that this instance should use. This - * method can only be called on a stopped instance. For more information, read - * Specifying a Minimum CPU Platform. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setMinCpuPlatform(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setMinCpuPlatform - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMinCpuPlatform(params?: any, options?: MethodOptions): - AxiosPromise; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMinCpuPlatform( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setScheduling - * @desc Sets an instance's scheduling options. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Instance name. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setScheduling(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setScheduling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Instance name. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Scheduling} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setScheduling(params?: any, options?: MethodOptions): - AxiosPromise; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setScheduling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setServiceAccount - * @desc Sets the service account on the instance. For more information, read - * Changing the service account and access scopes for an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setServiceAccount(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setServiceAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesSetServiceAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setServiceAccount(params?: any, options?: MethodOptions): - AxiosPromise; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setServiceAccount( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.setTags - * @desc Sets tags for the specified instance to the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance scoping this request. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.setTags(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.setTags - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance scoping this request. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().Tags} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTags(params?: any, options?: MethodOptions): - AxiosPromise; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTags( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.start - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.start(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.startWithEncryptionKey - * @desc Starts an instance that was stopped using the using the - * instances().stop method. For more information, see Restart an instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to start. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instances.startWithEncryptionKey(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.startWithEncryptionKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to start. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startWithEncryptionKey(params?: any, options?: MethodOptions): - AxiosPromise; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startWithEncryptionKey( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.stop - * @desc Stops a running instance, shutting it down cleanly, and allows you to - * restart the instance at a later time. Stopped instances do not incur VM - * usage charges while they are stopped. However, resources that the VM is - * using, such as persistent disks and static IP addresses, will continue to - * be charged until they are deleted. For more information, see Stopping an - * instance. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the instance resource to stop. - * instance: 'my-instance', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.instances.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instances.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Name of the instance resource to stop. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateAccessConfig - * @desc Updates the specified access config from an instance's network - * interface with the data included in the request. This method supports PATCH - * semantics and uses the JSON merge patch format and processing rules. - * @alias compute.instances.updateAccessConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface where the access config is attached. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().AccessConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateAccessConfig(params?: any, options?: MethodOptions): - AxiosPromise; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateAccessConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instances.updateNetworkInterface - * @desc Updates an instance's network interface. This method follows PATCH - * semantics. - * @alias compute.instances.updateNetworkInterface - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The instance name for this request. - * @param {string} params.networkInterface The name of the network interface to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone The name of the zone for this request. - * @param {().NetworkInterface} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateNetworkInterface(params?: any, options?: MethodOptions): - AxiosPromise; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateNetworkInterface( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'zone', 'instance', 'networkInterface'], - pathParams: ['instance', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Instancetemplates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.instanceTemplates.delete - * @desc Deletes the specified instance template. Deleting an instance - * template is permanent and cannot be undone. It's not possible to delete - * templates which are in use by an instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the instance template to delete. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.get - * @desc Returns the specified instance template. Gets a list of available - * instance templates by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the instance template. - * instanceTemplate: 'my-instance-template', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceTemplate The name of the instance template. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/instanceTemplates/{instanceTemplate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instanceTemplate'], - pathParams: ['instanceTemplate', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.insert - * @desc Creates an instance template in the specified project using the data - * that is included in the request. If you are creating a new template to - * update an existing instance group, your new instance template must use the - * same network or, if applicable, the same subnetwork as the original - * template. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.instanceTemplates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.instanceTemplates.list - * @desc Retrieves a list of instance templates that are contained within the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.instanceTemplates.list(request, handlePage); - * } - * }; - * - * compute.instanceTemplates.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.instanceTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/instanceTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectattachments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectAttachments.aggregatedList - * @desc Retrieves an aggregated list of interconnect attachments. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * } - * }; - * - * compute.interconnectAttachments.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/aggregated/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.interconnectAttachments.delete - * @desc Deletes the specified interconnect attachment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to delete. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.get - * @desc Returns the specified interconnect attachment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the interconnect attachment to return. - * interconnectAttachment: 'my-interconnect-attachment', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'interconnectAttachment'], - pathParams: ['interconnectAttachment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.insert - * @desc Creates an InterconnectAttachment in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnectAttachments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InterconnectAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectAttachments.list - * @desc Retrieves the list of interconnect attachments contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectAttachments.list(request, handlePage); - * } - * }; - * - * compute.interconnectAttachments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectAttachments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnectlocations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnectLocations.get - * @desc Returns the details for the specified interconnect location. Get a - * list of available interconnect locations by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect location to return. - * interconnectLocation: 'my-interconnect-location', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnectLocations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectLocations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnectLocation Name of the interconnect location to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/interconnectLocations/{interconnectLocation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnectLocation'], - pathParams: ['interconnectLocation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnectLocations.list - * @desc Retrieves the list of interconnect locations available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnectLocations.list(request, handlePage); - * } - * }; - * - * compute.interconnectLocations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnectLocations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/interconnectLocations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Interconnects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.interconnects.delete - * @desc Deletes the specified interconnect. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to delete. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.get - * @desc Returns the specified interconnect. Get a list of available - * interconnects by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to return. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.interconnects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.insert - * @desc Creates a Interconnect in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.list - * @desc Retrieves the list of interconnect available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.interconnects.list(request, handlePage); - * } - * }; - * - * compute.interconnects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/interconnects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.interconnects.patch - * @desc Updates the specified interconnect with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the interconnect to update. - * interconnect: 'my-interconnect', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.interconnects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.interconnects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.interconnect Name of the interconnect to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Interconnect} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/interconnects/{interconnect}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'interconnect'], - pathParams: ['interconnect', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licensecodes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenseCodes.get - * @desc Return a specified license code. License codes are mirrored across - * all projects that have permissions to read the License Code. - * @alias compute.licenseCodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.licenseCode Number corresponding to the License code resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/licenseCodes/{licenseCode}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'licenseCode'], - pathParams: ['licenseCode', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenseCodes.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.licenseCodes.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Licenses { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.licenses.delete - * @desc Deletes the specified license. - * @alias compute.licenses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the license resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.get - * @desc Returns the specified License resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the License resource to return. - * license: 'my-license', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.licenses.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.licenses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.license Name of the License resource to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/licenses/{license}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'license'], - pathParams: ['license', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.insert - * @desc Create a License resource in the specified project. - * @alias compute.licenses.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().License} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.list - * @desc Retrieves the list of licenses available in the specified project. - * This method does not get any licenses that belong to other projects, - * including licenses attached to publicly-available images, like Debian 8. If - * you want to get a list of publicly-available licenses, use this method to - * make a request to the respective image project, such as debian-cloud or - * windows-cloud. - * @alias compute.licenses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/licenses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.licenses.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias compute.licenses.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Machinetypes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.machineTypes.aggregatedList - * @desc Retrieves an aggregated list of machine types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.aggregatedList(request, handlePage); - * } - * }; - * - * compute.machineTypes.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.get - * @desc Returns the specified machine type. Gets a list of available machine - * types by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the machine type to return. - * machineType: 'my-machine-type', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.machineTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.machineType Name of the machine type to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machineType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'machineType'], - pathParams: ['machineType', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.machineTypes.list - * @desc Retrieves a list of machine types available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.machineTypes.list(request, handlePage); - * } - * }; - * - * compute.machineTypes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.machineTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone The name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/machineTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Networks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.networks.addPeering - * @desc Adds a peering to the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network resource to add peering to. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.addPeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.addPeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to add peering to. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksAddPeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addPeering(params?: any, options?: MethodOptions): - AxiosPromise; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addPeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}/addPeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.delete - * @desc Deletes the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to delete. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to delete. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.get - * @desc Returns the specified network. Get a list of available networks by - * making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to return. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to return. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.insert - * @desc Creates a network in the specified project using the data included in - * the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.list - * @desc Retrieves the list of networks available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.networks.list(request, handlePage); - * } - * }; - * - * compute.networks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/networks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.patch - * @desc Patches the specified network with the data included in the request. - * Only the following fields can be modified: routingConfig.routingMode. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to update. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to update. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Network} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.removePeering - * @desc Removes a peering from the specified network. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network resource to remove peering from. - * network: 'my-network', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.networks.removePeering(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.removePeering - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network resource to remove peering from. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().NetworksRemovePeeringRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removePeering(params?: any, options?: MethodOptions): - AxiosPromise; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removePeering( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}/removePeering') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.networks.switchToCustomMode - * @desc Switches the network mode from auto subnet mode to custom subnet - * mode. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the network to be updated. - * network: 'my-network', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.networks.switchToCustomMode(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.networks.switchToCustomMode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.network Name of the network to be updated. - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - switchToCustomMode(params?: any, options?: MethodOptions): - AxiosPromise; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - switchToCustomMode( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'network'], - pathParams: ['network', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.projects.disableXpnHost - * @desc Disable this project as a shared VPC host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.disableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/disableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.disableXpnResource - * @desc Disable a serivce resource (a.k.a service project) associated with - * this host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.disableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.disableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/disableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnHost - * @desc Enable this project as a shared VPC host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.enableXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/enableXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.enableXpnResource - * @desc Enable service resource (a.k.a service project) for a host project, - * so that subnets in the host project can be used by instances in the service - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.enableXpnResource(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.enableXpnResource - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enableXpnResource(params?: any, options?: MethodOptions): - AxiosPromise; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enableXpnResource( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/enableXpnResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.get - * @desc Returns the specified Project resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnHost - * @desc Gets the shared VPC host project that this project links to. May be - * empty if no link exists. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.projects.getXpnHost(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.getXpnHost - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnHost(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnHost( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/getXpnHost') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.getXpnResources - * @desc Gets service resources (a.k.a service project) associated with this - * host project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.getXpnResources(request, handlePage); - * } - * }; - * - * compute.projects.getXpnResources(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.getXpnResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getXpnResources(params?: any, options?: MethodOptions): - AxiosPromise; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getXpnResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/getXpnResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.listXpnHosts - * @desc Lists all shared VPC host projects visible to the user in an - * organization. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.projects.listXpnHosts(request, handlePage); - * } - * }; - * - * compute.projects.listXpnHosts(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.listXpnHosts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {().ProjectsListXpnHostsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listXpnHosts(params?: any, options?: MethodOptions): - AxiosPromise; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listXpnHosts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/listXpnHosts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveDisk - * @desc Moves a persistent disk from one zone to another. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveDisk(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.moveDisk - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().DiskMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveDisk(params?: any, options?: MethodOptions): - AxiosPromise; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveDisk( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/moveDisk') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.moveInstance - * @desc Moves an instance and its attached persistent disks from one zone to - * another. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.moveInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.moveInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceMoveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - moveInstance(params?: any, options?: MethodOptions): - AxiosPromise; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - moveInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/moveInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setCommonInstanceMetadata - * @desc Sets metadata common to all instances within the specified project - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.setCommonInstanceMetadata(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.setCommonInstanceMetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Metadata} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setCommonInstanceMetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setCommonInstanceMetadata( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/setCommonInstanceMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.projects.setUsageExportBucket - * @desc Enables the usage export feature and sets the usage export bucket - * where reports are stored. If you provide an empty request body using this - * method, the usage export feature will be disabled. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.projects.setUsageExportBucket(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.projects.setUsageExportBucket - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UsageExportLocation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUsageExportBucket(params?: any, options?: MethodOptions): - AxiosPromise; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUsageExportBucket( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/setUsageExportBucket') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionautoscalers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionAutoscalers.delete - * @desc Deletes the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to delete. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.get - * @desc Returns the specified autoscaler. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the autoscaler to return. - * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.autoscaler Name of the autoscaler to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'autoscaler'], - pathParams: ['autoscaler', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.insert - * @desc Creates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.list - * @desc Retrieves a list of autoscalers contained within the specified - * region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionAutoscalers.list(request, handlePage); - * } - * }; - * - * compute.regionAutoscalers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.patch - * @desc Updates an autoscaler in the specified project using the data - * included in the request. This method supports PATCH semantics and uses the - * JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionAutoscalers.update - * @desc Updates an autoscaler in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.regionAutoscalers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionAutoscalers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.autoscaler Name of the autoscaler to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Autoscaler} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/autoscalers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionbackendservices { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionBackendServices.delete - * @desc Deletes the specified regional BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to delete. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.get - * @desc Returns the specified regional BackendService resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to return. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.getHealth - * @desc Gets the most recent health check results for this regional - * BackendService. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to which the queried instance - * belongs. backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.getHealth(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource for which to get health. - * @param {string} params.project - * @param {string} params.region Name of the region scoping this request. - * @param {().ResourceGroupReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.insert - * @desc Creates a regional BackendService resource in the specified project - * using the data included in the request. There are several restrictions and - * guidelines to keep in mind when creating a regional backend service. Read - * Restrictions and Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.list - * @desc Retrieves the list of regional BackendService resources available to - * the specified project in the given region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionBackendServices.list(request, handlePage); - * } - * }; - * - * compute.regionBackendServices.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.patch - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. This method supports PATCH semantics and - * uses the JSON merge patch format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to patch. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to patch. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionBackendServices.update - * @desc Updates the specified regional BackendService resource with the data - * included in the request. There are several restrictions and guidelines to - * keep in mind when updating a backend service. Read Restrictions and - * Guidelines for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the BackendService resource to update. - * backendService: 'my-backend-service', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.regionBackendServices.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionBackendServices.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backendService Name of the BackendService resource to update. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().BackendService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'backendService'], - pathParams: ['backendService', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioncommitments { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionCommitments.aggregatedList - * @desc Retrieves an aggregated list of commitments. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.aggregatedList(request, handlePage); - * } - * }; - * - * compute.regionCommitments.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.get - * @desc Returns the specified commitment resource. Get a list of available - * commitments by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the commitment to return. - * commitment: 'my-commitment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionCommitments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commitment Name of the commitment to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'commitment'], - pathParams: ['commitment', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.insert - * @desc Creates a commitment in the specified project using the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionCommitments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Commitment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionCommitments.list - * @desc Retrieves a list of commitments contained within the specified - * region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionCommitments.list(request, handlePage); - * } - * }; - * - * compute.regionCommitments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionCommitments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/commitments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroupmanagers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroupManagers.abandonInstances - * @desc Schedules a group action to remove the specified instances from the - * managed instance group. Abandoning an instance does not delete the - * instance, but it does remove the instance from any target pools that are - * applied by the managed instance group. This method reduces the targetSize - * of the managed instance group by the number of instances that you abandon. - * This operation is marked as DONE when the action is scheduled even if the - * instances have not yet been removed from the group. You must separately - * verify the status of the abandoning action with the listmanagedinstances - * method. If the group is part of a backend service that has enabled - * connection draining, it can take up to 60 seconds after the connection - * draining duration has elapsed before the VM instance is removed or deleted. - * You can specify a maximum of 1000 instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.abandonInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.delete - * @desc Deletes the specified managed instance group and all of the instances - * in that group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to delete. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.delete(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.deleteInstances - * @desc Schedules a group action to delete the specified instances in the - * managed instance group. The instances are also removed from any target - * pools of which they were a member. This method reduces the targetSize of - * the managed instance group by the number of instances that you delete. This - * operation is marked as DONE when the action is scheduled even if the - * instances are still being deleted. You must separately verify the status of - * the deleting action with the listmanagedinstances method. If the group is - * part of a backend service that has enabled connection draining, it can take - * up to 60 seconds after the connection draining duration has elapsed before - * the VM instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.deleteInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.get - * @desc Returns all of the details about the specified managed instance - * group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group to return. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.insert - * @desc Creates a managed instance group using the information that you - * specify in the request. After the group is created, it schedules an action - * to create instances in the group using the specified instance template. - * This operation is marked as DONE when the group is created even if the - * instances in the group have not yet been created. You must separately - * verify the status of the individual instances with the listmanagedinstances - * method. A regional managed instance group can contain up to 2000 - * instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.insert(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.list - * @desc Retrieves the list of managed instance groups that are contained - * within the specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroupManagers.list(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroupManagers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.listManagedInstances - * @desc Lists the instances in the managed instance group and instances that - * are scheduled to be created. The list includes any current actions that the - * group has scheduled for its instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.listManagedInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.listManagedInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {integer=} params.maxResults - * @param {string=} params.order_by - * @param {string=} params.pageToken - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listManagedInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void; - listManagedInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>, - callback?: BodyResponseCallback< - Schema$RegionInstanceGroupManagersListInstancesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$RegionInstanceGroupManagersListInstancesResponse>(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.recreateInstances - * @desc Schedules a group action to recreate the specified instances in the - * managed instance group. The instances are deleted and recreated using the - * current instance template for the managed instance group. This operation is - * marked as DONE when the action is scheduled even if the instances have not - * yet been recreated. You must separately verify the status of the recreating - * action with the listmanagedinstances method. If the group is part of a - * backend service that has enabled connection draining, it can take up to 60 - * seconds after the connection draining duration has elapsed before the VM - * instance is removed or deleted. You can specify a maximum of 1000 - * instances with this method per request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.recreateInstances(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.resize - * @desc Changes the intended size for the managed instance group. If you - * increase the size, the group schedules actions to create new instances - * using the current instance template. If you decrease the size, the group - * schedules delete actions on one or more instances. The resize operation is - * marked DONE when the resize actions are scheduled even if the group has not - * yet added or deleted any instances. You must separately verify the status - * of the creating or deleting actions with the listmanagedinstances method. - * If the group is part of a backend service that has enabled connection - * draining, it can take up to 60 seconds after the connection draining - * duration has elapsed before the VM instance is removed or deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * // Number of instances that should exist in this instance group - * manager. size: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.resize(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {integer} params.size Number of instances that should exist in this instance group manager. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setInstanceTemplate - * @desc Sets the instance template to use when creating new instances or - * recreating instances in this group. Existing instances are not affected. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setInstanceTemplate(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all new instances in this group - * are assigned. Existing instances in the group are not affected. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the managed instance group. - * instanceGroupManager: 'my-instance-group-manager', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroupManagers.setTargetPools(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the managed instance group. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regioninstancegroups { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionInstanceGroups.get - * @desc Returns the specified instance group resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the instance group resource to return. - * instanceGroup: 'my-instance-group', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup Name of the instance group resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.list - * @desc Retrieves the list of instance group resources contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.list(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionInstanceGroups.listInstances - * @desc Lists the instances in the specified instance group and displays - * information about the named ports. Depending on the specified options, this - * method can list all instances or only the instances that are running. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the regional instance group for which we want to list the - * instances. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionInstanceGroups.listInstances(request, handlePage); - * } - * }; - * - * compute.regionInstanceGroups.listInstances(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.listInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstances(params?: any, options?: MethodOptions): - AxiosPromise; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - listInstances( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.regionInstanceGroups.setNamedPorts - * @desc Sets the named ports for the specified regional instance group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // The name of the regional instance group where the named ports are - * updated. instanceGroup: 'my-instance-group', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.regionInstanceGroups.setNamedPorts(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionInstanceGroups.setNamedPorts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNamedPorts(params?: any, options?: MethodOptions): - AxiosPromise; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNamedPorts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'instanceGroup'], - pathParams: ['instanceGroup', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regionoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regionOperations.delete - * @desc Deletes the specified region-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.get - * @desc Retrieves the specified region-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regionOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'operation'], - pathParams: ['operation', 'project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regionOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regionOperations.list(request, handlePage); - * } - * }; - * - * compute.regionOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regionOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regions { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.regions.get - * @desc Returns the specified Region resource. Get a list of available - * regions by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region resource to return. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.regions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/regions/{region}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.regions.list - * @desc Retrieves the list of region resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.regions.list(request, handlePage); - * } - * }; - * - * compute.regions.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.regions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/regions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routers { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routers.aggregatedList - * @desc Retrieves an aggregated list of routers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.aggregatedList(request, handlePage); - * } - * }; - * - * compute.routers.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/aggregated/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.delete - * @desc Deletes the specified Router resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to delete. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.get - * @desc Returns the specified Router resource. Get a list of available - * routers by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to return. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.getRouterStatus - * @desc Retrieves runtime information of the specified router. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routers.getRouterStatus(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.getRouterStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRouterStatus(params?: any, options?: MethodOptions): - AxiosPromise; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRouterStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.insert - * @desc Creates a Router resource in the specified project and region using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.list - * @desc Retrieves a list of Router resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routers.list(request, handlePage); - * } - * }; - * - * compute.routers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.patch - * @desc Patches the specified Router resource with the data included in the - * request. This method supports PATCH semantics and uses JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to patch. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to patch. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.preview - * @desc Preview fields auto-generated during router create and update - * operations. Calling this method does NOT create or update the router. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to query. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.preview(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.preview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.router Name of the Router resource to query. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - preview(params?: any, options?: MethodOptions): - AxiosPromise; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - preview( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routers.update - * @desc Updates the specified Router resource with the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Router resource to update. - * router: 'my-router', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.routers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.router Name of the Router resource to update. - * @param {().Router} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/routers/{router}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'region', 'router'], - pathParams: ['project', 'region', 'router'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Routes { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.routes.delete - * @desc Deletes the specified Route resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Route resource to delete. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.route Name of the Route resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.get - * @desc Returns the specified Route resource. Get a list of available routes - * by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Route resource to return. - * route: 'my-route', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.routes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.route Name of the Route resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/routes/{route}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'route'], - pathParams: ['project', 'route'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.insert - * @desc Creates a Route resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.routes.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Route} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.routes.list - * @desc Retrieves the list of Route resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.routes.list(request, handlePage); - * } - * }; - * - * compute.routes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.routes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/routes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Snapshots { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.snapshots.delete - * @desc Deletes the specified Snapshot resource. Keep in mind that deleting a - * single snapshot might not necessarily delete all the data on that snapshot. - * If any data on the snapshot that is marked for deletion is needed for - * subsequent snapshots, the data will be moved to the next corresponding - * snapshot. For more information, see Deleting snaphots. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Snapshot resource to delete. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.snapshot Name of the Snapshot resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.get - * @desc Returns the specified Snapshot resource. Get a list of available - * snapshots by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the Snapshot resource to return. - * snapshot: 'my-snapshot', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.snapshots.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.snapshot Name of the Snapshot resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/snapshots/{snapshot}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'snapshot'], - pathParams: ['project', 'snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.list - * @desc Retrieves the list of Snapshot resources contained within the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.snapshots.list(request, handlePage); - * } - * }; - * - * compute.snapshots.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.snapshots.setLabels - * @desc Sets the labels on a snapshot. To learn more about labels, read the - * Labeling Resources documentation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.snapshots.setLabels(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.snapshots.setLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().GlobalSetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslcertificates { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslCertificates.delete - * @desc Deletes the specified SslCertificate resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the SslCertificate resource to delete. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.get - * @desc Returns the specified SslCertificate resource. Get a list of - * available SSL certificates by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the SslCertificate resource to return. - * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.sslCertificates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslCertificate Name of the SslCertificate resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslCertificates/{sslCertificate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslCertificate'], - pathParams: ['project', 'sslCertificate'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.insert - * @desc Creates a SslCertificate resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.sslCertificates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslCertificate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslCertificates.list - * @desc Retrieves the list of SslCertificate resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.sslCertificates.list(request, handlePage); - * } - * }; - * - * compute.sslCertificates.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.sslCertificates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/sslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sslpolicies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.sslPolicies.delete - * @desc Deletes the specified SSL policy. The SSL policy resource can be - * deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy - * resources. - * @alias compute.sslPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.get - * @desc Lists all of the ordered rules present in a single specified policy. - * @alias compute.sslPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.insert - * @desc Returns the specified SSL policy resource. Get a list of available - * SSL policies by making a list() request. - * @alias compute.sslPolicies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.list - * @desc Lists all the SSL policies that have been configured for the - * specified project. - * @alias compute.sslPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/sslPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.sslPolicies.listAvailableFeatures - * @desc Lists all features that can be specified in the SSL policy when using - * custom profile. - * @alias compute.sslPolicies.listAvailableFeatures - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listAvailableFeatures(params?: any, options?: MethodOptions): - AxiosPromise; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): void; - listAvailableFeatures( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SslPoliciesListAvailableFeaturesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.sslPolicies.patch - * @desc Patches the specified SSL policy with the data included in the - * request. - * @alias compute.sslPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'sslPolicy'], - pathParams: ['project', 'sslPolicy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subnetworks { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.subnetworks.aggregatedList - * @desc Retrieves an aggregated list of subnetworks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.aggregatedList(request, handlePage); - * } - * }; - * - * compute.subnetworks.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.delete - * @desc Deletes the specified subnetwork. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to delete. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.expandIpCidrRange - * @desc Expands the IP CIDR range of the subnetwork to a specified value. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to update. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.expandIpCidrRange(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.expandIpCidrRange - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to update. - * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - expandIpCidrRange(params?: any, options?: MethodOptions): - AxiosPromise; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - expandIpCidrRange( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.get - * @desc Returns the specified subnetwork. Get a list of available subnetworks - * list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource to return. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.subnetworks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.subnetwork Name of the Subnetwork resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.insert - * @desc Creates a subnetwork in the specified project using the data included - * in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.list - * @desc Retrieves a list of subnetworks available to the specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.subnetworks.list(request, handlePage); - * } - * }; - * - * compute.subnetworks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.patch - * @desc Patches the specified subnetwork with the data included in the - * request. Only the following fields within the subnetwork resource can be - * specified in the request: secondary_ip_range, - * allow_subnet_cidr_routes_overlap and role. It is also mandatory to specify - * the current fingeprint of the subnetwork resource being patched. - * @alias compute.subnetworks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource to patch. - * @param {().Subnetwork} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.subnetworks.setPrivateIpGoogleAccess - * @desc Set whether VMs in this subnet can access Google services without - * assigning external IP addresses through Private Google Access. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the Subnetwork resource. - * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.subnetworks.setPrivateIpGoogleAccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.subnetwork Name of the Subnetwork resource. - * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): - AxiosPromise; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setPrivateIpGoogleAccess( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'subnetwork'], - pathParams: ['project', 'region', 'subnetwork'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpProxies.delete - * @desc Deletes the specified TargetHttpProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy resource to delete. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.get - * @desc Returns the specified TargetHttpProxy resource. Get a list of - * available target HTTP proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy resource to return. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.insert - * @desc Creates a TargetHttpProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.list - * @desc Retrieves the list of TargetHttpProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpProxies.list(request, handlePage); - * } - * }; - * - * compute.targetHttpProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpProxies.setUrlMap - * @desc Changes the URL map for TargetHttpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpProxy to set a URL map for. - * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpProxy'], - pathParams: ['project', 'targetHttpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targethttpsproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetHttpsProxies.delete - * @desc Deletes the specified TargetHttpsProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to delete. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.get - * @desc Returns the specified TargetHttpsProxy resource. Get a list of - * available target HTTPS proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to return. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.insert - * @desc Creates a TargetHttpsProxy resource in the specified project using - * the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetHttpsProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.list - * @desc Retrieves the list of TargetHttpsProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetHttpsProxies.list(request, handlePage); - * } - * }; - * - * compute.targetHttpsProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpsProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslCertificates - * @desc Replaces SslCertificates for TargetHttpsProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource to set an SslCertificates - * resource for. targetHttpsProxy: 'my-target-https-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setSslCertificates(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. - * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setSslPolicy - * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies - * the server-side support for SSL features. This affects connections between - * clients and the HTTPS proxy load balancer. They do not affect the - * connection between the load balancer and the backends. - * @alias compute.targetHttpsProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetHttpsProxies.setUrlMap - * @desc Changes the URL map for TargetHttpsProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetHttpsProxy resource whose URL map is to be set. - * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetHttpsProxies.setUrlMap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. - * @param {().UrlMapReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setUrlMap(params?: any, options?: MethodOptions): - AxiosPromise; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setUrlMap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetHttpsProxy'], - pathParams: ['project', 'targetHttpsProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetinstances { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetInstances.aggregatedList - * @desc Retrieves an aggregated list of target instances. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetInstances.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.delete - * @desc Deletes the specified TargetInstance resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the TargetInstance resource to delete. - * targetInstance: 'my-target-instance', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetInstance Name of the TargetInstance resource to delete. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.get - * @desc Returns the specified TargetInstance resource. Get a list of - * available target instances by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the TargetInstance resource to return. - * targetInstance: 'my-target-instance', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetInstances.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetInstance Name of the TargetInstance resource to return. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'targetInstance'], - pathParams: ['project', 'targetInstance', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.insert - * @desc Creates a TargetInstance resource in the specified project and zone - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetInstances.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.zone Name of the zone scoping this request. - * @param {().TargetInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetInstances.list - * @desc Retrieves a list of TargetInstance resources available to the - * specified project and zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone scoping this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetInstances.list(request, handlePage); - * } - * }; - * - * compute.targetInstances.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetInstances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/targetInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetpools { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetPools.addHealthCheck - * @desc Adds health check URLs to a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target pool to add a health check to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.addHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to add a health check to. - * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.addInstance - * @desc Adds an instance to a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to add instances to. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.addInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.addInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to add instances to. - * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addInstance(params?: any, options?: MethodOptions): - AxiosPromise; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.aggregatedList - * @desc Retrieves an aggregated list of target pools. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetPools.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.delete - * @desc Deletes the specified target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to delete. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.get - * @desc Returns the specified target pool. Get a list of available target - * pools by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to return. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.targetPools.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.getHealth - * @desc Gets the most recent health check results for each IP for the - * instance that is referenced by the given target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to which the queried instance - * belongs. targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.getHealth(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.getHealth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. - * @param {().InstanceReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getHealth(params?: any, options?: MethodOptions): - AxiosPromise; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getHealth( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.insert - * @desc Creates a target pool in the specified project and region using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetPool} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.list - * @desc Retrieves a list of target pools available to the specified project - * and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetPools.list(request, handlePage); - * } - * }; - * - * compute.targetPools.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeHealthCheck - * @desc Removes health check URL from a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target pool to remove health checks from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeHealthCheck(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.removeHealthCheck - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the target pool to remove health checks from. - * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeHealthCheck(params?: any, options?: MethodOptions): - AxiosPromise; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeHealthCheck( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.removeInstance - * @desc Removes instance URL from a target pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to remove instances from. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.removeInstance(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.removeInstance - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. - * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeInstance(params?: any, options?: MethodOptions): - AxiosPromise; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeInstance( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetPools.setBackup - * @desc Changes a backup target pool's configurations. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region scoping this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the TargetPool resource to set a backup pool for. - * targetPool: 'my-target-pool', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetPools.setBackup(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetPools.setBackup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {number=} params.failoverRatio New failoverRatio value for the target pool. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region scoping this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. - * @param {().TargetReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackup(params?: any, options?: MethodOptions): - AxiosPromise; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region', 'targetPool'], - pathParams: ['project', 'region', 'targetPool'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetsslproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetSslProxies.delete - * @desc Deletes the specified TargetSslProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource to delete. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.get - * @desc Returns the specified TargetSslProxy resource. Get a list of - * available target SSL proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource to return. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.insert - * @desc Creates a TargetSslProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetSslProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.list - * @desc Retrieves the list of TargetSslProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetSslProxies.list(request, handlePage); - * } - * }; - * - * compute.targetSslProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setBackendService - * @desc Changes the BackendService for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose BackendService resource is - * to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setBackendService(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. - * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setProxyHeader(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. - * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslCertificates - * @desc Changes SslCertificates for TargetSslProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetSslProxy resource whose SslCertificate resource is - * to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetSslProxies.setSslCertificates(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetSslProxies.setSslCertificates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. - * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslCertificates(params?: any, options?: MethodOptions): - AxiosPromise; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslCertificates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetSslProxies.setSslPolicy - * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies the - * server-side support for SSL features. This affects connections between - * clients and the SSL proxy load balancer. They do not affect the connection - * between the load balancer and the backends. - * @alias compute.targetSslProxies.setSslPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. - * @param {().SslPolicyReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSslPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSslPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetSslProxy'], - pathParams: ['project', 'targetSslProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targettcpproxies { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetTcpProxies.delete - * @desc Deletes the specified TargetTcpProxy resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource to delete. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.get - * @desc Returns the specified TargetTcpProxy resource. Get a list of - * available target TCP proxies by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource to return. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.insert - * @desc Creates a TargetTcpProxy resource in the specified project using the - * data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetTcpProxy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.list - * @desc Retrieves the list of TargetTcpProxy resources available to the - * specified project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetTcpProxies.list(request, handlePage); - * } - * }; - * - * compute.targetTcpProxies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setBackendService - * @desc Changes the BackendService for TargetTcpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource whose BackendService resource is - * to be set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setBackendService(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.setBackendService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. - * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setBackendService(params?: any, options?: MethodOptions): - AxiosPromise; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setBackendService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetTcpProxies.setProxyHeader - * @desc Changes the ProxyHeaderType for TargetTcpProxy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetTcpProxies.setProxyHeader(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetTcpProxies.setProxyHeader - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. - * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProxyHeader(params?: any, options?: MethodOptions): - AxiosPromise; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setProxyHeader( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'targetTcpProxy'], - pathParams: ['project', 'targetTcpProxy'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetvpngateways { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.targetVpnGateways.aggregatedList - * @desc Retrieves an aggregated list of target VPN gateways. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * } - * }; - * - * compute.targetVpnGateways.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * compute.targetVpnGateways.delete - * @desc Deletes the specified target VPN gateway. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target VPN gateway to delete. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.get - * @desc Returns the specified target VPN gateway. Get a list of available - * target VPN gateways by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the target VPN gateway to return. - * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'targetVpnGateway'], - pathParams: ['project', 'region', 'targetVpnGateway'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.insert - * @desc Creates a target VPN gateway in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.targetVpnGateways.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().TargetVpnGateway} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.targetVpnGateways.list - * @desc Retrieves a list of target VPN gateways available to the specified - * project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.targetVpnGateways.list(request, handlePage); - * } - * }; - * - * compute.targetVpnGateways.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.targetVpnGateways.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Urlmaps { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.urlMaps.delete - * @desc Deletes the specified UrlMap resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to delete. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.get - * @desc Returns the specified UrlMap resource. Get a list of available URL - * maps by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to return. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.urlMaps.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.insert - * @desc Creates a UrlMap resource in the specified project using the data - * included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.invalidateCache - * @desc Initiates a cache invalidation operation, invalidating the specified - * path, scoped to the specified UrlMap. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap scoping this request. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.invalidateCache(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.invalidateCache - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap scoping this request. - * @param {().CacheInvalidationRule} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - invalidateCache(params?: any, options?: MethodOptions): - AxiosPromise; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - invalidateCache( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.list - * @desc Retrieves the list of UrlMap resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.urlMaps.list(request, handlePage); - * } - * }; - * - * compute.urlMaps.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/global/urlMaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.patch - * @desc Patches the specified UrlMap resource with the data included in the - * request. This method supports PATCH semantics and uses the JSON merge patch - * format and processing rules. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to patch. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to patch. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.update - * @desc Updates the specified UrlMap resource with the data included in the - * request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to update. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.urlMap Name of the UrlMap resource to update. - * @param {().UrlMap} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.urlMaps.validate - * @desc Runs static validation for the UrlMap. In particular, the tests of - * the provided UrlMap will be run. Calling this method does NOT create the - * UrlMap. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the UrlMap resource to be validated as. - * urlMap: 'my-url-map', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.urlMaps.validate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.urlMaps.validate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.urlMap Name of the UrlMap resource to be validated as. - * @param {().UrlMapsValidateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - validate(params?: any, options?: MethodOptions): - AxiosPromise; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - validate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/global/urlMaps/{urlMap}/validate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'urlMap'], - pathParams: ['project', 'urlMap'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Vpntunnels { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * compute.vpnTunnels.aggregatedList - * @desc Retrieves an aggregated list of VPN tunnels. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * Object.keys(itemsPage).forEach(function(name) { - * // TODO: Change code below to process each `name` property: - * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, 2)); - * }); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.aggregatedList(request, handlePage); - * } - * }; - * - * compute.vpnTunnels.aggregatedList(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.aggregatedList - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregatedList(params?: any, options?: MethodOptions): - AxiosPromise; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregatedList( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/aggregated/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.delete - * @desc Deletes the specified VpnTunnel resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the VpnTunnel resource to delete. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.get - * @desc Returns the specified VpnTunnel resource. Get a list of available VPN - * tunnels by making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Name of the VpnTunnel resource to return. - * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region', 'vpnTunnel'], - pathParams: ['project', 'region', 'vpnTunnel'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.vpnTunnels.insert - * @desc Creates a VpnTunnel resource in the specified project and region - * using the data included in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * compute.vpnTunnels.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). - * @param {().VpnTunnel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object +// tslint:disable: no-namespace + +export namespace compute_v1 { + /** + * Compute Engine API + * + * Creates and runs virtual machines on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const compute = google.compute('v1'); + * + * @namespace compute + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Compute + */ + export class Compute { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + acceleratorTypes: Resource$Acceleratortypes; + addresses: Resource$Addresses; + autoscalers: Resource$Autoscalers; + backendBuckets: Resource$Backendbuckets; + backendServices: Resource$Backendservices; + disks: Resource$Disks; + diskTypes: Resource$Disktypes; + firewalls: Resource$Firewalls; + forwardingRules: Resource$Forwardingrules; + globalAddresses: Resource$Globaladdresses; + globalForwardingRules: Resource$Globalforwardingrules; + globalOperations: Resource$Globaloperations; + healthChecks: Resource$Healthchecks; + httpHealthChecks: Resource$Httphealthchecks; + httpsHealthChecks: Resource$Httpshealthchecks; + images: Resource$Images; + instanceGroupManagers: Resource$Instancegroupmanagers; + instanceGroups: Resource$Instancegroups; + instances: Resource$Instances; + instanceTemplates: Resource$Instancetemplates; + interconnectAttachments: Resource$Interconnectattachments; + interconnectLocations: Resource$Interconnectlocations; + interconnects: Resource$Interconnects; + licenseCodes: Resource$Licensecodes; + licenses: Resource$Licenses; + machineTypes: Resource$Machinetypes; + networks: Resource$Networks; + projects: Resource$Projects; + regionAutoscalers: Resource$Regionautoscalers; + regionBackendServices: Resource$Regionbackendservices; + regionCommitments: Resource$Regioncommitments; + regionInstanceGroupManagers: Resource$Regioninstancegroupmanagers; + regionInstanceGroups: Resource$Regioninstancegroups; + regionOperations: Resource$Regionoperations; + regions: Resource$Regions; + routers: Resource$Routers; + routes: Resource$Routes; + snapshots: Resource$Snapshots; + sslCertificates: Resource$Sslcertificates; + sslPolicies: Resource$Sslpolicies; + subnetworks: Resource$Subnetworks; + targetHttpProxies: Resource$Targethttpproxies; + targetHttpsProxies: Resource$Targethttpsproxies; + targetInstances: Resource$Targetinstances; + targetPools: Resource$Targetpools; + targetSslProxies: Resource$Targetsslproxies; + targetTcpProxies: Resource$Targettcpproxies; + targetVpnGateways: Resource$Targetvpngateways; + urlMaps: Resource$Urlmaps; + vpnTunnels: Resource$Vpntunnels; + zoneOperations: Resource$Zoneoperations; + zones: Resource$Zones; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.acceleratorTypes = new Resource$Acceleratortypes(this); + this.addresses = new Resource$Addresses(this); + this.autoscalers = new Resource$Autoscalers(this); + this.backendBuckets = new Resource$Backendbuckets(this); + this.backendServices = new Resource$Backendservices(this); + this.disks = new Resource$Disks(this); + this.diskTypes = new Resource$Disktypes(this); + this.firewalls = new Resource$Firewalls(this); + this.forwardingRules = new Resource$Forwardingrules(this); + this.globalAddresses = new Resource$Globaladdresses(this); + this.globalForwardingRules = new Resource$Globalforwardingrules(this); + this.globalOperations = new Resource$Globaloperations(this); + this.healthChecks = new Resource$Healthchecks(this); + this.httpHealthChecks = new Resource$Httphealthchecks(this); + this.httpsHealthChecks = new Resource$Httpshealthchecks(this); + this.images = new Resource$Images(this); + this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); + this.instanceGroups = new Resource$Instancegroups(this); + this.instances = new Resource$Instances(this); + this.instanceTemplates = new Resource$Instancetemplates(this); + this.interconnectAttachments = new Resource$Interconnectattachments(this); + this.interconnectLocations = new Resource$Interconnectlocations(this); + this.interconnects = new Resource$Interconnects(this); + this.licenseCodes = new Resource$Licensecodes(this); + this.licenses = new Resource$Licenses(this); + this.machineTypes = new Resource$Machinetypes(this); + this.networks = new Resource$Networks(this); + this.projects = new Resource$Projects(this); + this.regionAutoscalers = new Resource$Regionautoscalers(this); + this.regionBackendServices = new Resource$Regionbackendservices(this); + this.regionCommitments = new Resource$Regioncommitments(this); + this.regionInstanceGroupManagers = + new Resource$Regioninstancegroupmanagers(this); + this.regionInstanceGroups = new Resource$Regioninstancegroups(this); + this.regionOperations = new Resource$Regionoperations(this); + this.regions = new Resource$Regions(this); + this.routers = new Resource$Routers(this); + this.routes = new Resource$Routes(this); + this.snapshots = new Resource$Snapshots(this); + this.sslCertificates = new Resource$Sslcertificates(this); + this.sslPolicies = new Resource$Sslpolicies(this); + this.subnetworks = new Resource$Subnetworks(this); + this.targetHttpProxies = new Resource$Targethttpproxies(this); + this.targetHttpsProxies = new Resource$Targethttpsproxies(this); + this.targetInstances = new Resource$Targetinstances(this); + this.targetPools = new Resource$Targetpools(this); + this.targetSslProxies = new Resource$Targetsslproxies(this); + this.targetTcpProxies = new Resource$Targettcpproxies(this); + this.targetVpnGateways = new Resource$Targetvpngateways(this); + this.urlMaps = new Resource$Urlmaps(this); + this.vpnTunnels = new Resource$Vpntunnels(this); + this.zoneOperations = new Resource$Zoneoperations(this); + this.zones = new Resource$Zones(this); + } + + getRoot() { + return this.root; + } + } + + /** + * A specification of the type and number of accelerator cards attached to the + * instance. */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AcceleratorConfig { + /** + * The number of the guest accelerator cards exposed to this instance. + */ + acceleratorCount: number; + /** + * Full or partial URL of the accelerator type resource to attach to this + * instance. If you are creating an instance template, specify only the + * accelerator name. + */ + acceleratorType: string; + } + /** + * An Accelerator Type resource. (== resource_for beta.acceleratorTypes ==) + * (== resource_for v1.acceleratorTypes ==) + */ + export interface Schema$AcceleratorType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this accelerator + * type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The type of the resource. Always compute#acceleratorType + * for accelerator types. + */ + kind: string; + /** + * [Output Only] Maximum accelerator cards allowed per instance. + */ + maximumCardsPerInstance: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the accelerator type resides, + * such as us-central1-a. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + zone: string; + } + export interface Schema$AcceleratorTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#acceleratorTypeAggregatedList for aggregated lists of accelerator + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of accelerator types. + */ + export interface Schema$AcceleratorTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AcceleratorType resources. + */ + items: Schema$AcceleratorType[]; + /** + * [Output Only] Type of resource. Always compute#acceleratorTypeList for + * lists of accelerator types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AcceleratorTypesScopedList { + /** + * [Output Only] A list of accelerator types contained in this scope. + */ + acceleratorTypes: Schema$AcceleratorType[]; + /** + * [Output Only] An informational warning that appears when the accelerator + * types list is empty. + */ + warning: any; + } + /** + * An access configuration attached to an instance's network interface. + * Only one access config per instance is supported. + */ + export interface Schema$AccessConfig { + /** + * [Output Only] Type of the resource. Always compute#accessConfig for + * access configs. + */ + kind: string; + /** + * The name of this access configuration. The default and recommended name + * is External NAT but you can use any arbitrary string you would like. For + * example, My external IP or Network Access. + */ + name: string; + /** + * An external IP address associated with this instance. Specify an unused + * static external IP address available to the project or leave this field + * undefined to use an IP from a shared ephemeral IP address pool. If you + * specify a static external IP address, it must live in the same region as + * the zone of the instance. + */ + natIP: string; + /** + * The DNS domain name for the public PTR record. This field can only be set + * when the set_public_ptr field is enabled. + */ + publicPtrDomainName: string; + /** + * Specifies whether a public DNS ?PTR? record should be created to map the + * external IP address of the instance to a DNS domain name. + */ + setPublicPtr: boolean; + /** + * The type of configuration. The default and only option is ONE_TO_ONE_NAT. + */ + type: string; + } + /** + * A reserved address resource. (== resource_for beta.addresses ==) (== + * resource_for v1.addresses ==) (== resource_for beta.globalAddresses ==) (== + * resource_for v1.globalAddresses ==) + */ + export interface Schema$Address { + /** + * The static IP address represented by this resource. + */ + address: string; + /** + * The type of address to reserve, either INTERNAL or EXTERNAL. If + * unspecified, defaults to EXTERNAL. + */ + addressType: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP Version that will be used by this address. Valid options are IPV4 + * or IPV6. This can only be specified for a global address. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#address for addresses. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the regional address resides. This + * field is not applicable to global addresses. You must specify this field + * as part of the HTTP request URL. You cannot set this field in the request + * body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the address, which can be one of RESERVING, + * RESERVED, or IN_USE. An address that is RESERVING is currently in the + * process of being reserved. A RESERVED address is currently reserved and + * available to use. An IN_USE address is currently being used by another + * resource and is not available. + */ + status: string; + /** + * The URL of the subnetwork in which to reserve the address. If an IP + * address is specified, it must be within the subnetwork's IP range. + * This field can only be used with INTERNAL type with + * GCE_ENDPOINT/DNS_RESOLVER purposes. + */ + subnetwork: string; + /** + * [Output Only] The URLs of the resources that are using this address. + */ + users: string[]; + } + export interface Schema$AddressAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AddressesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#addressAggregatedList for + * aggregated lists of addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AddressesScopedList { + /** + * [Output Only] A list of addresses contained in this scope. + */ + addresses: Schema$Address[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + /** + * Contains a list of addresses. + */ + export interface Schema$AddressList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Address resources. + */ + items: Schema$Address[]; + /** + * [Output Only] Type of resource. Always compute#addressList for lists of + * addresses. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An alias IP range attached to an instance's network interface. + */ + export interface Schema$AliasIpRange { + /** + * The IP CIDR range represented by this alias IP range. This IP CIDR range + * must belong to the specified subnetwork and cannot contain IP addresses + * reserved by system or used by other network interfaces. This range may be + * a single IP address (e.g. 10.2.3.4), a netmask (e.g. /24) or a CIDR + * format string (e.g. 10.1.2.0/24). + */ + ipCidrRange: string; + /** + * Optional subnetwork secondary range name specifying the secondary range + * from which to allocate the IP CIDR range for this alias IP range. If left + * unspecified, the primary range of the subnetwork will be used. + */ + subnetworkRangeName: string; + } + /** + * An instance-attached disk resource. + */ + export interface Schema$AttachedDisk { + /** + * Specifies whether the disk will be auto-deleted when the instance is + * deleted (but not when the disk is detached from the instance). + */ + autoDelete: boolean; + /** + * Indicates that this is a boot disk. The virtual machine will use the + * first partition of the disk for its root filesystem. + */ + boot: boolean; + /** + * Specifies a unique device name of your choice that is reflected into the + * /dev/disk/by-id/google-* tree of a Linux operating system running within + * the instance. This name can be used to reference the device for mounting, + * resizing, and so on, from within the instance. If not specified, the + * server chooses a default device name to apply to this disk, in the form + * persistent-disks-x, where x is a number assigned by Google Compute + * Engine. This field is only applicable for persistent disks. + */ + deviceName: string; + /** + * Encrypts or decrypts a disk using a customer-supplied encryption key. If + * you are creating a new disk, this field encrypts the new disk using an + * encryption key that you provide. If you are attaching an existing disk + * that is already encrypted, this field decrypts the disk using the + * customer-supplied encryption key. If you encrypt a disk using a + * customer-supplied key, you must provide the same key again when you + * attempt to use this resource at a later time. For example, you must + * provide the key when you create a snapshot or an image from the disk or + * when you attach the disk to a virtual machine instance. If you do not + * provide an encryption key, then the disk will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the disk later. Instance templates do not store customer-supplied + * encryption keys, so you cannot use your own keys to encrypt disks in a + * managed instance group. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] A zero-based index to this disk, where 0 is reserved for + * the boot disk. If you have many disks attached to an instance, each disk + * would have a unique index number. + */ + index: number; + /** + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or + * the other, but not both. + */ + initializeParams: Schema$AttachedDiskInitializeParams; + /** + * Specifies the disk interface to use for attaching this disk, which is + * either SCSI or NVME. The default is SCSI. Persistent disks must always + * use SCSI and the request will fail if you attempt to attach a persistent + * disk in any other format than SCSI. Local SSDs can use either NVME or + * SCSI. For performance characteristics of SCSI over NVMe, see Local SSD + * performance. + */ + interface: string; + /** + * [Output Only] Type of the resource. Always compute#attachedDisk for + * attached disks. + */ + kind: string; + /** + * [Output Only] Any valid publicly visible licenses. + */ + licenses: string[]; + /** + * The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If + * not specified, the default is to attach the disk in READ_WRITE mode. + */ + mode: string; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. When creating a new instance, one of + * initializeParams.sourceImage or disks.source is required except for local + * SSD. If desired, you can also attach existing non-root persistent disks + * using this property. This field is only applicable for persistent disks. + * Note that for InstanceTemplate, specify the disk name, not the URL for + * the disk. + */ + source: string; + /** + * Specifies the type of the disk, either SCRATCH or PERSISTENT. If not + * specified, the default is PERSISTENT. + */ + type: string; } - - /** - * compute.vpnTunnels.list - * @desc Retrieves a list of VpnTunnel resources contained in the specified - * project and region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the region for this request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.vpnTunnels.list(request, handlePage); - * } - * }; - * - * compute.vpnTunnels.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.vpnTunnels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.region Name of the region for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * [Input Only] Specifies the parameters for a new disk that will be created + * alongside the new instance. Use initialization parameters to create boot + * disks or local SSDs attached to the new instance. This property is + * mutually exclusive with the source property; you can only define one or the + * other, but not both. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/regions/{region}/vpnTunnels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'region'], - pathParams: ['project', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AttachedDiskInitializeParams { + /** + * Specifies the disk name. If not specified, the default is to use the name + * of the instance. + */ + diskName: string; + /** + * Specifies the size of the disk in base-2 GB. + */ + diskSizeGb: string; + /** + * Specifies the disk type to use to create the instance. If not specified, + * the default is pd-standard, specified using the full URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/pd-standard + * Other values include pd-ssd and local-ssd. If you define this field, you + * can provide either the full or partial URL. For example, the following + * are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/diskTypes/diskType + * - projects/project/zones/zone/diskTypes/diskType - + * zones/zone/diskTypes/diskType Note that for InstanceTemplate, this is + * the name of the disk type, not URL. + */ + diskType: string; + /** + * Labels to apply to this disk. These can be later modified by the + * disks.setLabels method. This field is only applicable for persistent + * disks. + */ + labels: any; + /** + * The source image to create this disk. When creating a new instance, one + * of initializeParams.sourceImage or disks.source is required except for + * local SSD. To create a disk with one of the public operating system + * images, specify the image by its family name. For example, specify + * family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family If the source + * image is deleted later, this field will not be set. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. Instance + * templates do not store customer-supplied encryption keys, so you cannot + * create disks for instances in a managed instance group if the source + * images are encrypted with your own keys. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + } + /** + * Represents an Autoscaler resource. Autoscalers allow you to automatically + * scale virtual machine instances in managed instance groups according to an + * autoscaling policy that you define. For more information, read Autoscaling + * Groups of Instances. (== resource_for beta.autoscalers ==) (== resource_for + * v1.autoscalers ==) (== resource_for beta.regionAutoscalers ==) (== + * resource_for v1.regionAutoscalers ==) + */ + export interface Schema$Autoscaler { + /** + * The configuration parameters for the autoscaling algorithm. You can + * define one or more of the policies for an autoscaler: cpuUtilization, + * customMetricUtilizations, and loadBalancingUtilization. If none of these + * are specified, the default will be to autoscale based on cpuUtilization + * to 0.6 or 60%. + */ + autoscalingPolicy: Schema$AutoscalingPolicy; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#autoscaler for + * autoscalers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the instance group resides (for + * autoscalers living in regional scope). + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the autoscaler configuration. + */ + status: string; + /** + * [Output Only] Human-readable details about the current state of the + * autoscaler. Read the documentation for Commonly returned status messages + * for examples of status messages you might encounter. + */ + statusDetails: Schema$AutoscalerStatusDetails[]; + /** + * URL of the managed instance group that this autoscaler will scale. + */ + target: string; + /** + * [Output Only] URL of the zone where the instance group resides (for + * autoscalers living in zonal scope). + */ + zone: string; + } + export interface Schema$AutoscalerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of AutoscalersScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#autoscalerAggregatedList + * for aggregated lists of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Autoscaler resources. + */ + export interface Schema$AutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * [Output Only] Type of resource. Always compute#autoscalerList for lists + * of autoscalers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$AutoscalersScopedList { + /** + * [Output Only] A list of autoscalers contained in this scope. + */ + autoscalers: Schema$Autoscaler[]; + /** + * [Output Only] Informational warning which replaces the list of + * autoscalers when the list is empty. + */ + warning: any; + } + export interface Schema$AutoscalerStatusDetails { + /** + * The status message. + */ + message: string; + /** + * The type of error returned. + */ + type: string; + } + /** + * Cloud Autoscaler policy. + */ + export interface Schema$AutoscalingPolicy { + /** + * The number of seconds that the autoscaler should wait before it starts + * collecting information from a new instance. This prevents the autoscaler + * from collecting information when the instance is initializing, during + * which the collected usage would not be reliable. The default time + * autoscaler waits is 60 seconds. Virtual machine initialization times + * might vary because of numerous factors. We recommend that you test how + * long an instance may take to initialize. To do this, create an instance + * and time the startup process. + */ + coolDownPeriodSec: number; + /** + * Defines the CPU utilization policy that allows the autoscaler to scale + * based on the average CPU utilization of a managed instance group. + */ + cpuUtilization: Schema$AutoscalingPolicyCpuUtilization; + /** + * Configuration parameters of autoscaling based on a custom metric. + */ + customMetricUtilizations: Schema$AutoscalingPolicyCustomMetricUtilization[]; + /** + * Configuration parameters of autoscaling based on load balancer. + */ + loadBalancingUtilization: Schema$AutoscalingPolicyLoadBalancingUtilization; + /** + * The maximum number of instances that the autoscaler can scale up to. This + * is required when creating or updating an autoscaler. The maximum number + * of replicas should not be lower than minimal number of replicas. + */ + maxNumReplicas: number; + /** + * The minimum number of replicas that the autoscaler can scale down to. + * This cannot be less than 0. If not provided, autoscaler will choose a + * default value depending on maximum number of instances allowed. + */ + minNumReplicas: number; + } + /** + * CPU utilization policy. + */ + export interface Schema$AutoscalingPolicyCpuUtilization { + /** + * The target CPU utilization that the autoscaler should maintain. Must be a + * float value in the range (0, 1]. If not specified, the default is 0.6. If + * the CPU level is below the target utilization, the autoscaler scales down + * the number of instances until it reaches the minimum number of instances + * you specified or until the average CPU of your instances reaches the + * target utilization. If the average CPU is above the target utilization, + * the autoscaler scales up until it reaches the maximum number of instances + * you specified or until the average utilization reaches the target + * utilization. + */ + utilizationTarget: number; + } + /** + * Custom utilization metric policy. + */ + export interface Schema$AutoscalingPolicyCustomMetricUtilization { + /** + * The identifier (type) of the Stackdriver Monitoring metric. The metric + * cannot have negative values. The metric must have a value type of INT64 + * or DOUBLE. + */ + metric: string; + /** + * The target value of the metric that autoscaler should maintain. This must + * be a positive value. A utilization metric scales number of virtual + * machines handling requests to increase or decrease proportionally to the + * metric. For example, a good metric to use as a utilization_target is + * compute.googleapis.com/instance/network/received_bytes_count. The + * autoscaler will work to keep this value constant for each of the + * instances. + */ + utilizationTarget: number; + /** + * Defines how target utilization value is expressed for a Stackdriver + * Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE. + * If not specified, the default is GAUGE. + */ + utilizationTargetType: string; + } + /** + * Configuration parameters of autoscaling based on load balancing. + */ + export interface Schema$AutoscalingPolicyLoadBalancingUtilization { + /** + * Fraction of backend capacity utilization (set in HTTP(s) load balancing + * configuration) that autoscaler should maintain. Must be a positive float + * value. If not defined, the default is 0.8. + */ + utilizationTarget: number; + } + /** + * Message containing information of one individual backend. + */ + export interface Schema$Backend { + /** + * Specifies the balancing mode for this backend. For global HTTP(S) or + * TCP/SSL load balancing, the default is UTILIZATION. Valid values are + * UTILIZATION, RATE (for HTTP(S)) and CONNECTION (for TCP/SSL). For + * Internal Load Balancing, the default and only supported mode is + * CONNECTION. + */ + balancingMode: string; + /** + * A multiplier applied to the group's maximum servicing capacity (based + * on UTILIZATION, RATE or CONNECTION). Default value is 1, which means the + * group will serve up to 100% of its configured capacity (depending on + * balancingMode). A setting of 0 means the group is completely drained, + * offering 0% of its available Capacity. Valid range is [0.0,1.0]. This + * cannot be used for internal load balancing. + */ + capacityScaler: number; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The fully-qualified URL of a Instance Group resource. This instance group + * defines the list of instances that serve traffic. Member virtual machine + * instances from each instance group must live in the same zone as the + * instance group itself. No two backends in a backend service are allowed + * to use same Instance Group resource. Note that you must specify an + * Instance Group resource using the fully-qualified URL, rather than a + * partial URL. When the BackendService has load balancing scheme INTERNAL, + * the instance group must be within the same region as the BackendService. + */ + group: string; + /** + * The max number of simultaneous connections for the group. Can be used + * with either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnections: number; + /** + * The max number of simultaneous connections that a single backend instance + * can handle. This is used to calculate the capacity of the group. Can be + * used in either CONNECTION or UTILIZATION balancing modes. For CONNECTION + * mode, either maxConnections or maxConnectionsPerInstance must be set. + * This cannot be used for internal load balancing. + */ + maxConnectionsPerInstance: number; + /** + * The max requests per second (RPS) of the group. Can be used with either + * RATE or UTILIZATION balancing modes, but required if RATE mode. For RATE + * mode, either maxRate or maxRatePerInstance must be set. This cannot be + * used for internal load balancing. + */ + maxRate: number; + /** + * The max requests per second (RPS) that a single backend instance can + * handle. This is used to calculate the capacity of the group. Can be used + * in either balancing mode. For RATE mode, either maxRate or + * maxRatePerInstance must be set. This cannot be used for internal load + * balancing. + */ + maxRatePerInstance: number; + /** + * Used when balancingMode is UTILIZATION. This ratio defines the CPU + * utilization target for the group. The default is 0.8. Valid range is + * [0.0, 1.0]. This cannot be used for internal load balancing. + */ + maxUtilization: number; + } + /** + * A BackendBucket resource. This resource defines a Cloud Storage bucket. + */ + export interface Schema$BackendBucket { + /** + * Cloud Storage bucket name. + */ + bucketName: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendBucket. + */ + enableCdn: boolean; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Contains a list of BackendBucket resources. + */ + export interface Schema$BackendBucketList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendBucket resources. + */ + items: Schema$BackendBucket[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A BackendService resource. This resource defines a group of backend virtual + * machines and their serving capacity. (== resource_for v1.backendService ==) + * (== resource_for beta.backendService ==) + */ + export interface Schema$BackendService { + /** + * Lifetime of cookies in seconds if session_affinity is GENERATED_COOKIE. + * If set to 0, the cookie is non-persistent and lasts only until the end of + * the browser session (or equivalent). The maximum allowed value for TTL is + * one day. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + affinityCookieTtlSec: number; + /** + * The list of backends that serve this BackendService. + */ + backends: Schema$Backend[]; + /** + * Cloud CDN configuration for this BackendService. + */ + cdnPolicy: Schema$BackendServiceCdnPolicy; + connectionDraining: Schema$ConnectionDraining; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If true, enable Cloud CDN for this BackendService. When the load + * balancing scheme is INTERNAL, this field is not used. + */ + enableCDN: boolean; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a BackendService. An up-to-date fingerprint must + * be provided in order to update the BackendService. + */ + fingerprint: string; + /** + * The list of URLs to the HttpHealthCheck or HttpsHealthCheck resource for + * health checking this BackendService. Currently at most one health check + * can be specified, and a health check is required for Compute Engine + * backend services. A health check must not be specified for App Engine + * backend and Cloud Function backend. For internal load balancing, a URL + * to a HealthCheck resource must be specified instead. + */ + healthChecks: string[]; + iap: Schema$BackendServiceIAP; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#backendService for backend + * services. + */ + kind: string; + /** + * Indicates whether the backend service will be used with internal or + * external load balancing. A backend service created for one type of load + * balancing cannot be used with the other. Possible values are INTERNAL and + * EXTERNAL. + */ + loadBalancingScheme: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Deprecated in favor of portName. The TCP port to connect on the backend. + * The default value is 80. This cannot be used for internal load + * balancing. + */ + port: number; + /** + * Name of backend port. The same name should appear in the instance groups + * referenced by this service. Required when the load balancing scheme is + * EXTERNAL. When the load balancing scheme is INTERNAL, this field is not + * used. + */ + portName: string; + /** + * The protocol this BackendService uses to communicate with backends. + * Possible values are HTTP, HTTPS, TCP, and SSL. The default is HTTP. For + * internal load balancing, the possible values are TCP and UDP, and the + * default is TCP. + */ + protocol: string; + /** + * [Output Only] URL of the region where the regional backend service + * resides. This field is not applicable to global backend services. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Type of session affinity to use. The default is NONE. When the load + * balancing scheme is EXTERNAL, can be NONE, CLIENT_IP, or + * GENERATED_COOKIE. When the load balancing scheme is INTERNAL, can be + * NONE, CLIENT_IP, CLIENT_IP_PROTO, or CLIENT_IP_PORT_PROTO. When the + * protocol is UDP, this field is not used. + */ + sessionAffinity: string; + /** + * How many seconds to wait for the backend before considering it a failed + * request. Default is 30 seconds. + */ + timeoutSec: number; + } + /** + * Contains a list of BackendServicesScopedList. + */ + export interface Schema$BackendServiceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendServicesScopedList resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Message containing Cloud CDN configuration for a backend service. + */ + export interface Schema$BackendServiceCdnPolicy { + /** + * The CacheKeyPolicy for this CdnPolicy. + */ + cacheKeyPolicy: Schema$CacheKeyPolicy; + } + export interface Schema$BackendServiceGroupHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceGroupHealth + * for the health of backend services. + */ + kind: string; + } + /** + * Identity-Aware Proxy + */ + export interface Schema$BackendServiceIAP { + enabled: boolean; + oauth2ClientId: string; + oauth2ClientSecret: string; + /** + * [Output Only] SHA256 hash value for the field oauth2_client_secret above. + */ + oauth2ClientSecretSha256: string; + } + /** + * Contains a list of BackendService resources. + */ + export interface Schema$BackendServiceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of BackendService resources. + */ + items: Schema$BackendService[]; + /** + * [Output Only] Type of resource. Always compute#backendServiceList for + * lists of backend services. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$BackendServicesScopedList { + /** + * A list of BackendServices contained in this scope. + */ + backendServices: Schema$BackendService[]; + /** + * Informational warning which replaces the list of backend services when + * the list is empty. + */ + warning: any; + } + export interface Schema$CacheInvalidationRule { + /** + * If set, this invalidation rule will only apply to requests with a Host + * header matching host. + */ + host: string; + path: string; + } + /** + * Message containing what to include in the cache key for a request for Cloud + * CDN. + */ + export interface Schema$CacheKeyPolicy { + /** + * If true, requests to different hosts will be cached separately. + */ + includeHost: boolean; + /** + * If true, http and https requests will be cached separately. + */ + includeProtocol: boolean; + /** + * If true, include query string parameters in the cache key according to + * query_string_whitelist and query_string_blacklist. If neither is set, the + * entire query string will be included. If false, the query string will be + * excluded from the cache key entirely. + */ + includeQueryString: boolean; + /** + * Names of query string parameters to exclude in cache keys. All other + * parameters will be included. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringBlacklist: string[]; + /** + * Names of query string parameters to include in cache keys. All other + * parameters will be excluded. Either specify query_string_whitelist or + * query_string_blacklist, not both. '&' and '=' will be + * percent encoded and not treated as delimiters. + */ + queryStringWhitelist: string[]; + } + /** + * Represents a Commitment resource. Creating a Commitment resource means that + * you are purchasing a committed use contract with an explicit start and end + * time. You can create commitments based on vCPUs and memory usage and + * receive discounted rates. For full details, read Signing Up for Committed + * Use Discounts. Committed use discounts are subject to Google Cloud + * Platform's Service Specific Terms. By purchasing a committed use + * discount, you agree to these terms. Committed use discounts will not renew, + * so you must purchase a new commitment to continue receiving discounts. (== + * resource_for beta.commitments ==) (== resource_for v1.commitments ==) + */ + export interface Schema$Commitment { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Commitment end time in RFC3339 text format. + */ + endTimestamp: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#commitment for + * commitments. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The plan for this commitment, which determines duration and discount + * rate. The currently supported plans are TWELVE_MONTH (1 year), and + * THIRTY_SIX_MONTH (3 years). + */ + plan: string; + /** + * [Output Only] URL of the region where this commitment may be used. + */ + region: string; + /** + * A list of commitment amounts for particular resources. Note that VCPU and + * MEMORY resource commitments must occur together. + */ + resources: Schema$ResourceCommitment[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Commitment start time in RFC3339 text format. + */ + startTimestamp: string; + /** + * [Output Only] Status of the commitment with regards to eventual + * expiration (each commitment has an end date defined). One of the + * following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + } + export interface Schema$CommitmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of CommitmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#commitmentAggregatedList + * for aggregated lists of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Commitment resources. + */ + export interface Schema$CommitmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Commitment resources. + */ + items: Schema$Commitment[]; + /** + * [Output Only] Type of resource. Always compute#commitmentList for lists + * of commitments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$CommitmentsScopedList { + /** + * [Output Only] A list of commitments contained in this scope. + */ + commitments: Schema$Commitment[]; + /** + * [Output Only] Informational warning which replaces the list of + * commitments when the list is empty. + */ + warning: any; + } + /** + * Message containing connection draining configuration. + */ + export interface Schema$ConnectionDraining { + /** + * Time for which instance will be drained (not accept new connections, but + * still work to finish started). + */ + drainingTimeoutSec: number; + } + /** + * Represents a customer-supplied encryption key + */ + export interface Schema$CustomerEncryptionKey { + /** + * Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 + * base64 to either encrypt or decrypt this resource. + */ + rawKey: string; + /** + * [Output only] The RFC 4648 base64 encoded SHA-256 hash of the + * customer-supplied encryption key that protects this resource. + */ + sha256: string; + } + export interface Schema$CustomerEncryptionKeyProtectedDisk { + /** + * Decrypts data associated with the disk with a customer-supplied + * encryption key. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * Specifies a valid partial or full URL to an existing Persistent Disk + * resource. This field is only applicable for persistent disks. + */ + source: string; + } + /** + * Deprecation status for a public resource. + */ + export interface Schema$DeprecationStatus { + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DELETED. This is only informational and + * the status will not change unless the client explicitly changes it. + */ + deleted: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to DEPRECATED. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + deprecated: string; + /** + * An optional RFC3339 timestamp on or after which the state of this + * resource is intended to change to OBSOLETE. This is only informational + * and the status will not change unless the client explicitly changes it. + */ + obsolete: string; + /** + * The URL of the suggested replacement for a deprecated resource. The + * suggested replacement resource must be the same kind of resource as the + * deprecated resource. + */ + replacement: string; + /** + * The deprecation state of this resource. This can be DEPRECATED, OBSOLETE, + * or DELETED. Operations which create a new resource using a DEPRECATED + * resource will return successfully, but with a warning indicating the + * deprecated resource and recommending its replacement. Operations which + * use OBSOLETE or DELETED resources will be rejected and result in an + * error. + */ + state: string; + } + /** + * A Disk resource. (== resource_for beta.disks ==) (== resource_for v1.disks + * ==) + */ + export interface Schema$Disk { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Encrypts the disk using a customer-supplied encryption key. After you + * encrypt a disk with a customer-supplied key, you must provide the same + * key if you use the disk later (e.g. to create a disk snapshot or an + * image, or to attach the disk to a virtual machine). Customer-supplied + * encryption keys do not protect access to metadata of the disk. If you do + * not provide an encryption key when creating the disk, then the disk will + * be encrypted using an automatically generated key and you do not need to + * provide a key to use the disk later. + */ + diskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#disk for disks. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this disk, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a disk. + */ + labelFingerprint: string; + /** + * Labels to apply to this disk. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * [Output Only] Last attach timestamp in RFC3339 text format. + */ + lastAttachTimestamp: string; + /** + * [Output Only] Last detach timestamp in RFC3339 text format. + */ + lastDetachTimestamp: string; + /** + * Integer license codes indicating which licenses are attached to this + * disk. + */ + licenseCodes: string[]; + /** + * Any applicable publicly visible licenses. + */ + licenses: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Internal use only. + */ + options: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * Size of the persistent disk, specified in GB. You can specify this field + * when creating a persistent disk using the sourceImage or sourceSnapshot + * parameter, or specify it alone to create an empty persistent disk. If + * you specify this field along with sourceImage or sourceSnapshot, the + * value of sizeGb must not be less than the size of the sourceImage or the + * size of the snapshot. Acceptable values are 1 to 65536, inclusive. + */ + sizeGb: string; + /** + * The source image used to create this disk. If the source image is + * deleted, this field will not be set. To create a disk with one of the + * public operating system images, specify the image by its family name. For + * example, specify family/debian-8 to use the latest Debian 8 image: + * projects/debian-cloud/global/images/family/debian-8 Alternatively, use + * a specific version of a public operating system image: + * projects/debian-cloud/global/images/debian-8-jessie-vYYYYMMDD To create + * a disk with a custom image that you created, specify the image name in + * the following format: global/images/my-custom-image You can also + * specify a custom image by its image family, which returns the latest + * version of the image in that family. Replace the image name with + * family/family-name: global/images/family/my-image-family + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this disk. This + * value identifies the exact image that was used to create this persistent + * disk. For example, if you created the persistent disk from an image that + * was later deleted and recreated under the same name, the source image ID + * would identify the exact version of the image that was used. + */ + sourceImageId: string; + /** + * The source snapshot used to create this disk. You can provide this as a + * partial or full URL to the resource. For example, the following are valid + * values: - + * https://www.googleapis.com/compute/v1/projects/project/global/snapshots/snapshot + * - projects/project/global/snapshots/snapshot - global/snapshots/snapshot + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The unique ID of the snapshot used to create this disk. + * This value identifies the exact snapshot that was used to create this + * persistent disk. For example, if you created the persistent disk from a + * snapshot that was later deleted and recreated under the same name, the + * source snapshot ID would identify the exact version of the snapshot that + * was used. + */ + sourceSnapshotId: string; + /** + * [Output Only] The status of disk creation. + */ + status: string; + /** + * URL of the disk type resource describing which disk type to use to create + * the disk. Provide this when creating the disk. For example: + * project/zones/zone/diskTypes/pd-standard or pd-ssd + */ + type: string; + /** + * [Output Only] Links to the users of the disk (attached instances) in + * form: project/zones/zone/instances/instance + */ + users: string[]; + /** + * [Output Only] URL of the zone where the disk resides. You must specify + * this field as part of the HTTP request URL. It is not settable as a field + * in the request body. + */ + zone: string; + } + export interface Schema$DiskAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DisksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskAggregatedList for + * aggregated lists of persistent disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } -} - -export class Resource$Zoneoperations { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * compute.zoneOperations.delete - * @desc Deletes the specified zone-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to delete. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to delete. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of Disk resources. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * compute.zoneOperations.get - * @desc Retrieves the specified zone-specific Operations resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for this request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // Name of the Operations resource to return. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the Operations resource to return. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$DiskList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Disk resources. + */ + items: Schema$Disk[]; + /** + * [Output Only] Type of resource. Always compute#diskList for lists of + * disks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskMoveRequest { + /** + * The URL of the destination zone to move the disk. This can be a full or + * partial URL. For example, the following are all valid URLs to a zone: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target disk to move. This can be a full or partial URL. + * For example, the following are all valid URLs to a disk: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + targetDisk: string; + } + export interface Schema$DisksResizeRequest { + /** + * The new size of the persistent disk, which is specified in GB. + */ + sizeGb: string; + } + export interface Schema$DisksScopedList { + /** + * [Output Only] A list of disks contained in this scope. + */ + disks: Schema$Disk[]; + /** + * [Output Only] Informational warning which replaces the list of disks when + * the list is empty. + */ + warning: any; + } + /** + * A DiskType resource. (== resource_for beta.diskTypes ==) (== resource_for + * v1.diskTypes ==) + */ + export interface Schema$DiskType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Server-defined default disk size in GB. + */ + defaultDiskSizeGb: string; + /** + * [Output Only] The deprecation status associated with this disk type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional description of this resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#diskType for disk + * types. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] An optional textual description of the valid disk size, + * such as "10GB-10TB". + */ + validDiskSize: string; + /** + * [Output Only] URL of the zone where the disk type resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$DiskTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#diskTypeAggregatedList. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of disk types. + */ + export interface Schema$DiskTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of DiskType resources. + */ + items: Schema$DiskType[]; + /** + * [Output Only] Type of resource. Always compute#diskTypeList for disk + * types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$DiskTypesScopedList { + /** + * [Output Only] A list of disk types contained in this scope. + */ + diskTypes: Schema$DiskType[]; + /** + * [Output Only] Informational warning which replaces the list of disk types + * when the list is empty. + */ + warning: any; + } + /** + * Represents a Firewall resource. + */ + export interface Schema$Firewall { + /** + * The list of ALLOW rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a permitted connection. + */ + allowed: any[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The list of DENY rules specified by this firewall. Each rule specifies a + * protocol and port-range tuple that describes a denied connection. + */ + denied: any[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * If destination ranges are specified, the firewall will apply only to + * traffic that has destination IP address in these ranges. These ranges + * must be expressed in CIDR format. Only IPv4 is supported. + */ + destinationRanges: string[]; + /** + * Direction of traffic to which this firewall applies; default is INGRESS. + * Note: For INGRESS traffic, it is NOT supported to specify + * destinationRanges; For EGRESS traffic, it is NOT supported to specify + * sourceRanges OR sourceTags. + */ + direction: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#firewall for firewall + * rules. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network resource for this firewall rule. If not specified when + * creating a firewall rule, the default network is used: + * global/networks/default If you choose to specify this property, you can + * specify the network as a full or partial URL. For example, the following + * are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network + * - projects/myproject/global/networks/my-network - + * global/networks/default + */ + network: string; + /** + * Priority for this rule. This is an integer between 0 and 65535, both + * inclusive. When not specified, the value assumed is 1000. Relative + * priorities determine precedence of conflicting rules. Lower value of + * priority implies higher precedence (eg, a rule with priority 0 has higher + * precedence than a rule with priority 1). DENY rules take precedence over + * ALLOW rules having equal priority. + */ + priority: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If source ranges are specified, the firewall will apply only to traffic + * that has source IP address in these ranges. These ranges must be + * expressed in CIDR format. One or both of sourceRanges and sourceTags may + * be set. If both properties are set, the firewall will apply to traffic + * that has source IP address within sourceRanges OR the source IP that + * belongs to a tag listed in the sourceTags property. The connection does + * not need to match both properties for the firewall to apply. Only IPv4 is + * supported. + */ + sourceRanges: string[]; + /** + * If source service accounts are specified, the firewall will apply only to + * traffic originating from an instance with a service account in this list. + * Source service accounts cannot be used to control traffic to an + * instance's external IP address because service accounts are + * associated with an instance, not an IP address. sourceRanges can be set + * at the same time as sourceServiceAccounts. If both are set, the firewall + * will apply to traffic that has source IP address within sourceRanges OR + * the source IP belongs to an instance with service account listed in + * sourceServiceAccount. The connection does not need to match both + * properties for the firewall to apply. sourceServiceAccounts cannot be + * used at the same time as sourceTags or targetTags. + */ + sourceServiceAccounts: string[]; + /** + * If source tags are specified, the firewall rule applies only to traffic + * with source IPs that match the primary network interfaces of VM instances + * that have the tag and are in the same VPC network. Source tags cannot be + * used to control traffic to an instance's external IP address, it only + * applies to traffic between instances in the same virtual network. Because + * tags are associated with instances, not IP addresses. One or both of + * sourceRanges and sourceTags may be set. If both properties are set, the + * firewall will apply to traffic that has source IP address within + * sourceRanges OR the source IP that belongs to a tag listed in the + * sourceTags property. The connection does not need to match both + * properties for the firewall to apply. + */ + sourceTags: string[]; + /** + * A list of service accounts indicating sets of instances located in the + * network that may make network connections as specified in allowed[]. + * targetServiceAccounts cannot be used at the same time as targetTags or + * sourceTags. If neither targetServiceAccounts nor targetTags are + * specified, the firewall rule applies to all instances on the specified + * network. + */ + targetServiceAccounts: string[]; + /** + * A list of tags that controls which instances the firewall rule applies + * to. If targetTags are specified, then the firewall rule applies only to + * instances in the VPC network that have one of those tags. If no + * targetTags are specified, the firewall rule applies to all instances on + * the specified network. + */ + targetTags: string[]; + } + /** + * Contains a list of firewalls. + */ + export interface Schema$FirewallList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Firewall resources. + */ + items: Schema$Firewall[]; + /** + * [Output Only] Type of resource. Always compute#firewallList for lists of + * firewalls. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A ForwardingRule resource. A ForwardingRule resource specifies which pool + * of target virtual machines to forward a packet to if it matches the given + * [IPAddress, IPProtocol, ports] tuple. (== resource_for beta.forwardingRules + * ==) (== resource_for v1.forwardingRules ==) (== resource_for + * beta.globalForwardingRules ==) (== resource_for v1.globalForwardingRules + * ==) (== resource_for beta.regionForwardingRules ==) (== resource_for + * v1.regionForwardingRules ==) + */ + export interface Schema$ForwardingRule { + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the BackendService resource to receive + * the matched traffic. + */ + backendService: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The IP address that this forwarding rule is serving on behalf of. + * Addresses are restricted based on the forwarding rule's load + * balancing scheme (EXTERNAL or INTERNAL) and scope (global or regional). + * When the load balancing scheme is EXTERNAL, for global forwarding rules, + * the address must be a global IP, and for regional forwarding rules, the + * address must live in the same region as the forwarding rule. If this + * field is empty, an ephemeral IPv4 address from the same scope (global or + * regional) will be assigned. A regional forwarding rule supports IPv4 + * only. A global forwarding rule supports either IPv4 or IPv6. When the + * load balancing scheme is INTERNAL, this can only be an RFC 1918 IP + * address belonging to the network/subnet configured for the forwarding + * rule. By default, if this field is empty, an ephemeral internal IP + * address will be automatically allocated from the IP range of the subnet + * or network configured for this forwarding rule. An address can be + * specified either by a literal IP address or a URL reference to an + * existing Address resource. The following examples are all valid: - + * 100.1.2.3 - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/addresses/address + * - projects/project/regions/region/addresses/address - + * regions/region/addresses/address - global/addresses/address - address + */ + IPAddress: string; + /** + * The IP protocol to which this rule applies. Valid options are TCP, UDP, + * ESP, AH, SCTP or ICMP. When the load balancing scheme is INTERNAL, only + * TCP and UDP are valid. + */ + IPProtocol: string; + /** + * The IP Version that will be used by this forwarding rule. Valid options + * are IPV4 or IPV6. This can only be specified for a global forwarding + * rule. + */ + ipVersion: string; + /** + * [Output Only] Type of the resource. Always compute#forwardingRule for + * Forwarding Rule resources. + */ + kind: string; + /** + * This signifies what the ForwardingRule will be used for and can only take + * the following values: INTERNAL, EXTERNAL The value of INTERNAL means that + * this will be used for Internal Network Load Balancing (TCP, UDP). The + * value of EXTERNAL means that this will be used for External Load + * Balancing (HTTP(S) LB, External TCP/UDP LB, SSL Proxy) + */ + loadBalancingScheme: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the network that the load balanced IP + * should belong to for this Forwarding Rule. If this field is not + * specified, the default network will be used. + */ + network: string; + /** + * This field is used along with the target field for TargetHttpProxy, + * TargetHttpsProxy, TargetSslProxy, TargetTcpProxy, TargetVpnGateway, + * TargetPool, TargetInstance. Applicable only when IPProtocol is TCP, UDP, + * or SCTP, only packets addressed to ports in the specified range will be + * forwarded to target. Forwarding rules with the same [IPAddress, + * IPProtocol] pair must have disjoint port ranges. Some types of + * forwarding target have constraints on the acceptable ports: - + * TargetHttpProxy: 80, 8080 - TargetHttpsProxy: 443 - TargetTcpProxy: 25, + * 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, 1688, 1883, 5222 - + * TargetSslProxy: 25, 43, 110, 143, 195, 443, 465, 587, 700, 993, 995, + * 1688, 1883, 5222 - TargetVpnGateway: 500, 4500 + */ + portRange: string; + /** + * This field is used along with the backend_service field for internal load + * balancing. When the load balancing scheme is INTERNAL, a single port or + * a comma separated list of ports can be configured. Only packets addressed + * to these ports will be forwarded to the backends configured with this + * forwarding rule. You may specify a maximum of up to 5 ports. + */ + ports: string[]; + /** + * [Output Only] URL of the region where the regional forwarding rule + * resides. This field is not applicable to global forwarding rules. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * This field is not used for external load balancing. For internal load + * balancing, this field identifies the subnetwork that the load balanced IP + * should belong to for this Forwarding Rule. If the network specified is + * in auto subnet mode, this field is optional. However, if the network is + * in custom subnet mode, a subnetwork must be specified. + */ + subnetwork: string; + /** + * The URL of the target resource to receive the matched traffic. For + * regional forwarding rules, this target must live in the same region as + * the forwarding rule. For global forwarding rules, this target must be a + * global load balancing resource. The forwarded traffic must be of a type + * appropriate to the target object. + */ + target: string; + } + export interface Schema$ForwardingRuleAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRulesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#forwardingRuleAggregatedList for lists of forwarding rules. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of ForwardingRule resources. + */ + export interface Schema$ForwardingRuleList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of ForwardingRule resources. + */ + items: Schema$ForwardingRule[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ForwardingRulesScopedList { + /** + * A list of forwarding rules contained in this scope. + */ + forwardingRules: Schema$ForwardingRule[]; + /** + * Informational warning which replaces the list of forwarding rules when + * the list is empty. + */ + warning: any; + } + export interface Schema$GlobalSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash when updating or + * changing labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * A list of labels to apply for this resource. Each label key & value + * must comply with RFC1035. Specifically, the name must be 1-63 characters + * long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which + * means the first character must be a lowercase letter, and all following + * characters must be a dash, lowercase letter, or digit, except the last + * character, which cannot be a dash. For example, + * "webserver-frontend": "images". A label value can + * also be empty (e.g. "my-label": ""). + */ + labels: any; + } + /** + * Guest OS features. + */ + export interface Schema$GuestOsFeature { + /** + * The ID of a supported feature. Read Enabling guest operating system + * features to see a list of available options. + */ + type: string; + } + /** + * An HealthCheck resource. This resource defines a template for how + * individual virtual machines should be checked for health, via one of the + * supported protocols. + */ + export interface Schema$HealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in 3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + httpHealthCheck: Schema$HTTPHealthCheck; + httpsHealthCheck: Schema$HTTPSHealthCheck; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + sslHealthCheck: Schema$SSLHealthCheck; + tcpHealthCheck: Schema$TCPHealthCheck; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * Specifies the type of the healthCheck, either TCP, SSL, HTTP or HTTPS. If + * not specified, the default is TCP. Exactly one of the protocol-specific + * health check field must be specified, which must match type field. + */ + type: string; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + /** + * Contains a list of HealthCheck resources. + */ + export interface Schema$HealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HealthCheck resources. + */ + items: Schema$HealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A full or valid partial URL to a health check. For example, the following + * are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project-id/global/httpHealthChecks/health-check + * - projects/project-id/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$HealthCheckReference { healthCheck: string; } + export interface Schema$HealthStatus { + /** + * Health state of the instance. + */ + healthState: string; + /** + * URL of the instance resource. + */ + instance: string; + /** + * The IP address represented by this resource. + */ + ipAddress: string; + /** + * The port on the instance. + */ + port: number; + } + /** + * UrlMaps A host-matching rule for a URL. If matched, will use the named + * PathMatcher to select the BackendService. + */ + export interface Schema$HostRule { + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The list of host patterns to match. They must be valid hostnames, except + * * will match any string of ([a-z0-9-.]*). In that case, * must be the + * first character and must be followed in the pattern by either - or .. + */ + hosts: string[]; + /** + * The name of the PathMatcher to use to match the path portion of the URL + * if the hostRule matches the URL's host portion. + */ + pathMatcher: string; + } + /** + * An HttpHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTP. + */ + export interface Schema$HttpHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#httpHealthCheck for + * HTTP health checks. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTP health check request. The default value + * is 80. + */ + port: number; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPHealthCheck { + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTP health check request. The default value is + * /. + */ + requestPath: string; + } + /** + * Contains a list of HttpHealthCheck resources. + */ + export interface Schema$HttpHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpHealthCheck resources. + */ + items: Schema$HttpHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An HttpsHealthCheck resource. This resource defines a template for how + * individual instances should be checked for health, via HTTPS. + */ + export interface Schema$HttpsHealthCheck { + /** + * How often (in seconds) to send a health check. The default value is 5 + * seconds. + */ + checkIntervalSec: number; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A so-far unhealthy instance will be marked healthy after this many + * consecutive successes. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the public IP on behalf of which this health check + * is performed will be used. + */ + host: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The TCP port number for the HTTPS health check request. The default value + * is 443. + */ + port: number; + /** + * The request path of the HTTPS health check request. The default value is + * "/". + */ + requestPath: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * How long (in seconds) to wait before claiming failure. The default value + * is 5 seconds. It is invalid for timeoutSec to have a greater value than + * checkIntervalSec. + */ + timeoutSec: number; + /** + * A so-far healthy instance will be marked unhealthy after this many + * consecutive failures. The default value is 2. + */ + unhealthyThreshold: number; + } + export interface Schema$HTTPSHealthCheck { + /** + * The value of the host header in the HTTPS health check request. If left + * empty (default value), the IP on behalf of which this health check is + * performed will be used. + */ + host: string; + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The request path of the HTTPS health check request. The default value is + * /. + */ + requestPath: string; + } + /** + * Contains a list of HttpsHealthCheck resources. + */ + export interface Schema$HttpsHealthCheckList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of HttpsHealthCheck resources. + */ + items: Schema$HttpsHealthCheck[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Image resource. (== resource_for beta.images ==) (== resource_for + * v1.images ==) + */ + export interface Schema$Image { + /** + * Size of the image tar.gz archive stored in Google Cloud Storage (in + * bytes). + */ + archiveSizeBytes: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The deprecation status associated with this image. + */ + deprecated: Schema$DeprecationStatus; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Size of the image when restored onto a persistent disk (in GB). + */ + diskSizeGb: string; + /** + * The name of the image family to which this image belongs. You can create + * disks by specifying an image family instead of a specific image name. The + * image family always returns its latest image that is not deprecated. The + * name of the image family must comply with RFC1035. + */ + family: string; + /** + * A list of features to enable on the guest operating system. Applicable + * only for bootable images. Read Enabling guest operating system features + * to see a list of available options. + */ + guestOsFeatures: Schema$GuestOsFeature[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Encrypts the image using a customer-supplied encryption key. After you + * encrypt an image with a customer-supplied key, you must provide the same + * key if you use the image later (e.g. to create a disk from the image). + * Customer-supplied encryption keys do not protect access to metadata of + * the disk. If you do not provide an encryption key when creating the + * image, then the disk will be encrypted using an automatically generated + * key and you do not need to provide a key to use the image later. + */ + imageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] Type of the resource. Always compute#image for images. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this image, which is + * essentially a hash of the labels used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve an image. + */ + labelFingerprint: string; + /** + * Labels to apply to this image. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * image. + */ + licenseCodes: string[]; + /** + * Any applicable license URI. + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The parameters of the raw disk image. + */ + rawDisk: any; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL of the source disk used to create this image. This can be a full or + * valid partial URL. You must provide either this property or the + * rawDisk.source property but not both to create an image. For example, the + * following are valid values: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/disks/disk + * - projects/project/zones/zone/disks/disk - zones/zone/disks/disk + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * The ID value of the disk used to create this image. This value may be + * used to determine whether the image was taken from the current or a + * previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * URL of the source image used to create this image. This can be a full or + * valid partial URL. You must provide exactly one of: - this property, or + * - the rawDisk.source property, or - the sourceDisk property in order + * to create an image. + */ + sourceImage: string; + /** + * The customer-supplied encryption key of the source image. Required if the + * source image is protected by a customer-supplied encryption key. + */ + sourceImageEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the image used to create this image. This + * value may be used to determine whether the image was taken from the + * current or a previous instance of a given image name. + */ + sourceImageId: string; + /** + * URL of the source snapshot used to create this image. This can be a full + * or valid partial URL. You must provide exactly one of: - this property, + * or - the sourceImage property, or - the rawDisk.source property, or + * - the sourceDisk property in order to create an image. + */ + sourceSnapshot: string; + /** + * The customer-supplied encryption key of the source snapshot. Required if + * the source snapshot is protected by a customer-supplied encryption key. + */ + sourceSnapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the snapshot used to create this image. + * This value may be used to determine whether the snapshot was taken from + * the current or a previous instance of a given snapshot name. + */ + sourceSnapshotId: string; + /** + * The type of the image used to create this disk. The default and only + * value is RAW + */ + sourceType: string; + /** + * [Output Only] The status of the image. An image can be used to create + * other resources, such as instances, only after the image has been + * successfully created and the status is set to READY. Possible values are + * FAILED, PENDING, or READY. + */ + status: string; + } + /** + * Contains a list of images. + */ + export interface Schema$ImageList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Image resources. + */ + items: Schema$Image[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance resource. (== resource_for beta.instances ==) (== resource_for + * v1.instances ==) + */ + export interface Schema$Instance { + /** + * Allows this instance to send and receive packets with non-matching + * destination or source IPs. This is required if you plan to use this + * instance to forward routes. For more information, see Enabling IP + * Forwarding. + */ + canIpForward: boolean; + /** + * [Output Only] The CPU platform used by this instance. + */ + cpuPlatform: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Whether the resource should be protected against deletion. + */ + deletionProtection: boolean; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Array of disks associated with this instance. Persistent disks must be + * created before you can assign them. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#instance for + * instances. + */ + kind: string; + /** + * A fingerprint for this request, which is essentially a hash of the + * metadata's contents and used for optimistic locking. The fingerprint + * is initially generated by Compute Engine and changes after every request + * to modify or update metadata. You must always provide an up-to-date + * fingerprint hash in order to update or change metadata. To see the + * latest fingerprint, make get() request to the instance. + */ + labelFingerprint: string; + /** + * Labels to apply to this instance. These can be later modified by the + * setLabels method. + */ + labels: any; + /** + * Full or partial URL of the machine type resource to use for this + * instance, in the format: zones/zone/machineTypes/machine-type. This is + * provided by the client when the instance is created. For example, the + * following is a valid partial url to a predefined machine type: + * zones/us-central1-f/machineTypes/n1-standard-1 To create a custom + * machine type, provide a URL to a machine type in the following format, + * where CPUS is 1 or an even number up to 32 (2, 4, 6, ... 24, etc), and + * MEMORY is the total memory for this instance. Memory must be a multiple + * of 256 MB and must be supplied in MB (e.g. 5 GB of memory is 5120 MB): + * zones/zone/machineTypes/custom-CPUS-MEMORY For example: + * zones/us-central1-f/machineTypes/custom-4-5120 For a full list of + * restrictions, read the Specifications for custom machine types. + */ + machineType: string; + /** + * The metadata key/value pairs assigned to this instance. This includes + * custom metadata and predefined keys. + */ + metadata: Schema$Metadata; + /** + * Specifies a minimum CPU platform for the VM instance. Applicable values + * are the friendly names of CPU platforms, such as minCpuPlatform: + * "Intel Haswell" or minCpuPlatform: "Intel Sandy + * Bridge". + */ + minCpuPlatform: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The resource name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * An array of network configurations for this instance. These specify how + * interfaces are configured to interact with other network services, such + * as connecting to the internet. Multiple interfaces are supported per + * instance. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Sets the scheduling options for this instance. + */ + scheduling: Schema$Scheduling; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * A list of service accounts, with their specified scopes, authorized for + * this instance. Only one service account per VM instance is supported. + * Service accounts generate access tokens that can be accessed through the + * metadata server and used to authenticate applications on the instance. + * See Service Accounts for more information. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * [Output Only] Whether a VM has been restricted for start because Compute + * Engine has detected suspicious activity. + */ + startRestricted: boolean; + /** + * [Output Only] The status of the instance. One of the following values: + * PROVISIONING, STAGING, RUNNING, STOPPING, STOPPED, SUSPENDING, SUSPENDED, + * and TERMINATED. + */ + status: string; + /** + * [Output Only] An optional, human-readable explanation of the status. + */ + statusMessage: string; + /** + * A list of tags to apply to this instance. Tags are used to identify valid + * sources or targets for network firewalls and are specified by the client + * during instance creation. The tags can be later modified by the setTags + * method. Each tag within the list must comply with RFC1035. + */ + tags: Schema$Tags; + /** + * [Output Only] URL of the zone where the instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$InstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstancesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#instanceAggregatedList for + * aggregated lists of Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * InstanceGroups (== resource_for beta.instanceGroups ==) (== resource_for + * v1.instanceGroups ==) (== resource_for beta.regionInstanceGroups ==) (== + * resource_for v1.regionInstanceGroups ==) + */ + export interface Schema$InstanceGroup { + /** + * [Output Only] The creation timestamp for this instance group in RFC3339 + * text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The fingerprint of the named ports. The system uses this + * fingerprint to detect conflicts when multiple users change the named + * ports concurrently. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this instance group, generated by + * the server. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceGroup + * for instance groups. + */ + kind: string; + /** + * The name of the instance group. The name must be 1-63 characters long, + * and comply with RFC1035. + */ + name: string; + /** + * Assigns a name to a port number. For example: {name: "http", + * port: 80} This allows the system to reference ports by the assigned name + * instead of a port number. Named ports can also contain multiple ports. + * For example: [{name: "http", port: 80},{name: "http", + * port: 8080}] Named ports apply to all instances in this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * The URL of the network to which all instances in the instance group + * belong. + */ + network: string; + /** + * [Output Only] The URL of the region where the instance group is located + * (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this instance group. The server generates this + * URL. + */ + selfLink: string; + /** + * [Output Only] The total number of instances in the instance group. + */ + size: number; + /** + * [Output Only] The URL of the subnetwork to which all instances in the + * instance group belong. + */ + subnetwork: string; + /** + * [Output Only] The URL of the zone where the instance group is located + * (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupsScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupAggregatedList for aggregated lists of instance + * groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zoneOperations.list - * @desc Retrieves a list of Operation resources contained within the - * specified zone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone for request. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zoneOperations.list(request, handlePage); - * } - * }; - * - * compute.zoneOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone for request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of InstanceGroup resources. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/compute/v1/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Zones { - root: Compute; - constructor(root: Compute) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$InstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupList for instance group lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An Instance Group Manager resource. (== resource_for + * beta.instanceGroupManagers ==) (== resource_for v1.instanceGroupManagers + * ==) (== resource_for beta.regionInstanceGroupManagers ==) (== resource_for + * v1.regionInstanceGroupManagers ==) + */ + export interface Schema$InstanceGroupManager { + /** + * The base instance name to use for instances in this group. The value must + * be 1-58 characters long. Instances are named by appending a hyphen and a + * random four-character string to the base instance name. The base instance + * name must comply with RFC1035. + */ + baseInstanceName: string; + /** + * [Output Only] The creation timestamp for this managed instance group in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The list of instance actions and the number of instances in + * this managed instance group that are scheduled for each of those actions. + */ + currentActions: Schema$InstanceGroupManagerActionsSummary; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The fingerprint of the resource data. You can use this + * optional field for optimistic locking when you update the resource. + */ + fingerprint: string; + /** + * [Output Only] A unique identifier for this resource type. The server + * generates this identifier. + */ + id: string; + /** + * [Output Only] The URL of the Instance Group resource. + */ + instanceGroup: string; + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManager for managed instance groups. + */ + kind: string; + /** + * The name of the managed instance group. The name must be 1-63 characters + * long, and comply with RFC1035. + */ + name: string; + /** + * Named ports configured for the Instance Groups complementary to this + * Instance Group Manager. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The URL of the region where the managed instance group + * resides (for regional resources). + */ + region: string; + /** + * [Output Only] The URL for this managed instance group. The server defines + * this URL. + */ + selfLink: string; + /** + * The URLs for all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + /** + * The target number of running instances for this managed instance group. + * Deleting or abandoning instances reduces this number. Resizing the group + * changes this number. + */ + targetSize: number; + /** + * [Output Only] The URL of the zone where the managed instance group is + * located (for zonal resources). + */ + zone: string; + } + export interface Schema$InstanceGroupManagerActionsSummary { + /** + * [Output Only] The total number of instances in the managed instance group + * that are scheduled to be abandoned. Abandoning an instance removes it + * from the managed instance group without deleting it. + */ + abandoning: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be created or are currently being created. If the group + * fails to create any of these instances, it tries again until it creates + * the instance successfully. If you have disabled creation retries, this + * field will not be populated; instead, the creatingWithoutRetries field + * will be populated. + */ + creating: number; + /** + * [Output Only] The number of instances that the managed instance group + * will attempt to create. The group attempts to create each instance only + * once. If the group fails to create any of these instances, it decreases + * the group's targetSize value accordingly. + */ + creatingWithoutRetries: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be deleted or are currently being deleted. + */ + deleting: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are running and have no scheduled actions. + */ + none: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be recreated or are currently being being recreated. + * Recreating an instance deletes the existing root persistent disk and + * creates a new disk from the image that is defined in the instance + * template. + */ + recreating: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are being reconfigured with properties that do not require a restart or a + * recreate action. For example, setting or removing target pools for the + * instance. + */ + refreshing: number; + /** + * [Output Only] The number of instances in the managed instance group that + * are scheduled to be restarted or are currently being restarted. + */ + restarting: number; + } + export interface Schema$InstanceGroupManagerAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManagersScopedList resources. + */ + items: any; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerAggregatedList for an aggregated list of + * managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * [Output Only] A list of managed instance groups. + */ + export interface Schema$InstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersListManagedInstancesResponse { + /** + * [Output Only] The list of instances in the managed instance group. + */ + managedInstances: Schema$ManagedInstance[]; + } + export interface Schema$InstanceGroupManagersRecreateInstancesRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersScopedList { + /** + * [Output Only] The list of managed instance groups that are contained in + * the specified project and zone. + */ + instanceGroupManagers: Schema$InstanceGroupManager[]; + /** + * [Output Only] The warning that replaces the list of managed instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The URL of the instance template that is specified for this managed + * instance group. The group uses this template to create all new instances + * in the managed instance group. + */ + instanceTemplate: string; + } + export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { + /** + * The fingerprint of the target pools information. Use this optional + * property to prevent conflicts when multiple users change the target pools + * settings concurrently. Obtain the fingerprint with the + * instanceGroupManagers.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of target pool URLs that instances in this managed instance + * group belong to. The managed instance group applies these target pools to + * all of the instances in the group. Existing instances and new instances + * in the group all receive these target pool settings. + */ + targetPools: string[]; + } + export interface Schema$InstanceGroupsAddInstancesRequest { + /** + * The list of instances to add to the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupsListInstances for the list of instances in the + * specified instance group. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceGroupsListInstancesRequest { + /** + * A filter for the state of the instances in the instance group. Valid + * options are ALL or RUNNING. If you do not specify this parameter the list + * includes all instances regardless of their state. + */ + instanceState: string; + } + export interface Schema$InstanceGroupsRemoveInstancesRequest { + /** + * The list of instances to remove from the instance group. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$InstanceGroupsScopedList { + /** + * [Output Only] The list of instance groups that are contained in this + * scope. + */ + instanceGroups: Schema$InstanceGroup[]; + /** + * [Output Only] An informational warning that replaces the list of instance + * groups when the list is empty. + */ + warning: any; + } + export interface Schema$InstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of instances. + */ + export interface Schema$InstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Instance resources. + */ + items: Schema$Instance[]; + /** + * [Output Only] Type of resource. Always compute#instanceList for lists of + * Instance resources. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of instance referrers. + */ + export interface Schema$InstanceListReferrers { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Reference resources. + */ + items: Schema$Reference[]; + /** + * [Output Only] Type of resource. Always compute#instanceListReferrers for + * lists of Instance referrers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceMoveRequest { + /** + * The URL of the destination zone to move the instance. This can be a full + * or partial URL. For example, the following are all valid URLs to a zone: + * - https://www.googleapis.com/compute/v1/projects/project/zones/zone - + * projects/project/zones/zone - zones/zone + */ + destinationZone: string; + /** + * The URL of the target instance to move. This can be a full or partial + * URL. For example, the following are all valid URLs to an instance: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + targetInstance: string; + } + export interface Schema$InstanceProperties { + /** + * Enables instances created based on this template to send packets with + * source IP addresses other than their own and receive packets with + * destination IP addresses other than their own. If these instances will be + * used as an IP gateway or it will be set as the next-hop in a Route + * resource, specify true. If unsure, leave this set to false. See the + * Enable IP forwarding documentation for more information. + */ + canIpForward: boolean; + /** + * An optional text description for the instances that are created from this + * instance template. + */ + description: string; + /** + * An array of disks that are associated with the instances that are created + * from this template. + */ + disks: Schema$AttachedDisk[]; + /** + * A list of guest accelerator cards' type and count to use for + * instances created from the instance template. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + /** + * Labels to apply to instances that are created from this template. + */ + labels: any; + /** + * The machine type to use for instances that are created from this + * template. + */ + machineType: string; + /** + * The metadata key/value pairs to assign to instances that are created from + * this template. These pairs can consist of custom metadata or predefined + * keys. See Project and instance metadata for more information. + */ + metadata: Schema$Metadata; + /** + * Minimum cpu/platform to be used by this instance. The instance may be + * scheduled on the specified or newer cpu/platform. Applicable values are + * the friendly names of CPU platforms, such as minCpuPlatform: "Intel + * Haswell" or minCpuPlatform: "Intel Sandy Bridge". For more + * information, read Specifying a Minimum CPU Platform. + */ + minCpuPlatform: string; + /** + * An array of network access configurations for this interface. + */ + networkInterfaces: Schema$NetworkInterface[]; + /** + * Specifies the scheduling options for the instances that are created from + * this template. + */ + scheduling: Schema$Scheduling; + /** + * A list of service accounts with specified scopes. Access tokens for these + * service accounts are available to the instances that are created from + * this template. Use metadata queries to obtain the access tokens for these + * instances. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * A list of tags to apply to the instances that are created from this + * template. The tags identify valid sources or targets for network + * firewalls. The setTags method can modify this list of tags. Each tag + * within the list must comply with RFC1035. + */ + tags: Schema$Tags; + } + export interface Schema$InstanceReference { + /** + * The URL for a specific instance. + */ + instance: string; + } + export interface Schema$InstancesScopedList { + /** + * [Output Only] A list of instances contained in this scope. + */ + instances: Schema$Instance[]; + /** + * [Output Only] Informational warning which replaces the list of instances + * when the list is empty. + */ + warning: any; + } + export interface Schema$InstancesSetLabelsRequest { + /** + * Fingerprint of the previous set of labels for this resource, used to + * prevent conflicts. Provide the latest fingerprint value when making a + * request to add or change labels. + */ + labelFingerprint: string; + labels: any; + } + export interface Schema$InstancesSetMachineResourcesRequest { + /** + * A list of the type and count of accelerator cards attached to the + * instance. + */ + guestAccelerators: Schema$AcceleratorConfig[]; + } + export interface Schema$InstancesSetMachineTypeRequest { + /** + * Full or partial URL of the machine type resource. See Machine Types for a + * full list of machine types. For example: + * zones/us-central1-f/machineTypes/n1-standard-1 + */ + machineType: string; + } + export interface Schema$InstancesSetMinCpuPlatformRequest { + /** + * Minimum cpu/platform this instance should be started at. + */ + minCpuPlatform: string; + } + export interface Schema$InstancesSetServiceAccountRequest { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + export interface Schema$InstancesStartWithEncryptionKeyRequest { + /** + * Array of disks associated with this instance that are protected with a + * customer-supplied encryption key. In order to start the instance, the + * disk url and its corresponding key must be provided. If the disk is not + * protected with a customer-supplied encryption key it should not be + * specified. + */ + disks: Schema$CustomerEncryptionKeyProtectedDisk[]; + } + /** + * An Instance Template resource. (== resource_for beta.instanceTemplates ==) + * (== resource_for v1.instanceTemplates ==) + */ + export interface Schema$InstanceTemplate { + /** + * [Output Only] The creation timestamp for this instance template in + * RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A unique identifier for this instance template. The server + * defines this identifier. + */ + id: string; + /** + * [Output Only] The resource type, which is always compute#instanceTemplate + * for instance templates. + */ + kind: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The instance properties for this instance template. + */ + properties: Schema$InstanceProperties; + /** + * [Output Only] The URL for this instance template. The server defines this + * URL. + */ + selfLink: string; + } + /** + * A list of instance templates. + */ + export interface Schema$InstanceTemplateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceTemplate resources. + */ + items: Schema$InstanceTemplate[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceTemplatesListResponse for instance template lists. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$InstanceWithNamedPorts { + /** + * [Output Only] The URL of the instance. + */ + instance: string; + /** + * [Output Only] The named ports that belong to this instance group. + */ + namedPorts: Schema$NamedPort[]; + /** + * [Output Only] The status of the instance. + */ + status: string; + } + /** + * Represents an Interconnects resource. The Interconnects resource is a + * dedicated connection between Google's network and your on-premises + * network. For more information, see the Dedicated overview page. (== + * resource_for v1.interconnects ==) (== resource_for beta.interconnects ==) + */ + export interface Schema$Interconnect { + /** + * Administrative status of the interconnect. When this is set to true, the + * Interconnect is functional and can carry traffic. When set to false, no + * packets can be carried over the interconnect and no BGP routes are + * exchanged over it. By default, the status is set to true. + */ + adminEnabled: boolean; + /** + * [Output Only] A list of CircuitInfo objects, that describe the individual + * circuits in this LAG. + */ + circuitInfos: Schema$InterconnectCircuitInfo[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * Customer name, to put in the Letter of Authorization as the party + * authorized to request a crossconnect. + */ + customerName: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of outages expected for this Interconnect. + */ + expectedOutages: Schema$InterconnectOutageNotification[]; + /** + * [Output Only] IP address configured on the Google side of the + * Interconnect link. This can be used only for ping tests. + */ + googleIpAddress: string; + /** + * [Output Only] Google reference ID; to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of the URLs of all InterconnectAttachments + * configured to use this Interconnect. + */ + interconnectAttachments: string[]; + /** + * Type of interconnect. Note that "IT_PRIVATE" has been + * deprecated in favor of "DEDICATED" + */ + interconnectType: string; + /** + * [Output Only] Type of the resource. Always compute#interconnect for + * interconnects. + */ + kind: string; + /** + * Type of link requested. This field indicates speed of each of the links + * in the bundle, not the entire bundle. Only 10G per link is allowed for a + * dedicated interconnect. Options: Ethernet_10G_LR + */ + linkType: string; + /** + * URL of the InterconnectLocation object that represents where this + * connection is to be provisioned. + */ + location: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Email address to contact the customer NOC for operations and maintenance + * notifications regarding this Interconnect. If specified, this will be + * used for notifications in addition to all other forms described, such as + * Stackdriver logs alerting and Cloud Notifications. + */ + nocContactEmail: string; + /** + * [Output Only] The current status of whether or not this Interconnect is + * functional. + */ + operationalStatus: string; + /** + * [Output Only] IP address configured on the customer side of the + * Interconnect link. The customer should configure this IP address during + * turnup when prompted by Google NOC. This can be used only for ping tests. + */ + peerIpAddress: string; + /** + * [Output Only] Number of links actually provisioned in this interconnect. + */ + provisionedLinkCount: number; + /** + * Target number of physical links in the link bundle, as requested by the + * customer. + */ + requestedLinkCount: number; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Represents an InterconnectAttachment (VLAN attachment) resource. For more + * information, see Creating VLAN Attachments. (== resource_for + * beta.interconnectAttachments ==) (== resource_for + * v1.interconnectAttachments ==) + */ + export interface Schema$InterconnectAttachment { + /** + * [Output Only] IPv4 address + prefix length to be configured on Cloud + * Router Interface for this interconnect attachment. + */ + cloudRouterIpAddress: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] IPv4 address + prefix length to be configured on the + * customer router subinterface for this interconnect attachment. + */ + customerRouterIpAddress: string; + /** + * An optional description of this resource. + */ + description: string; + /** + * [Output Only] Google reference ID, to be used when raising support + * tickets with Google or otherwise to debug backend connectivity issues. + */ + googleReferenceId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * URL of the underlying Interconnect object that this attachment's + * traffic will traverse through. + */ + interconnect: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectAttachment + * for interconnect attachments. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] The current status of whether or not this interconnect + * attachment is functional. + */ + operationalStatus: string; + /** + * [Output Only] Information specific to an InterconnectAttachment. This + * property is populated if the interconnect that this is attached to is of + * type DEDICATED. + */ + privateInterconnectInfo: Schema$InterconnectAttachmentPrivateInfo; + /** + * [Output Only] URL of the region where the regional interconnect + * attachment resides. You must specify this field as part of the HTTP + * request URL. It is not settable as a field in the request body. + */ + region: string; + /** + * URL of the cloud router to be used for dynamic routing. This router must + * be in the same region as this InterconnectAttachment. The + * InterconnectAttachment will automatically connect the Interconnect to the + * network & region within which the Cloud Router is configured. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$InterconnectAttachmentAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachmentsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always + * compute#interconnectAttachmentAggregatedList for aggregated lists of + * interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Response to the list request, and contains a list of interconnect + * attachments. + */ + export interface Schema$InterconnectAttachmentList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectAttachment resources. + */ + items: Schema$InterconnectAttachment[]; + /** + * [Output Only] Type of resource. Always compute#interconnectAttachmentList + * for lists of interconnect attachments. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Information for an interconnect attachment when this belongs to an + * interconnect of type DEDICATED. + */ + export interface Schema$InterconnectAttachmentPrivateInfo { + /** + * [Output Only] 802.1q encapsulation tag to be used for traffic between + * Google and the customer, going to and from this network and region. + */ + tag8021q: number; + } + export interface Schema$InterconnectAttachmentsScopedList { + /** + * A list of interconnect attachments contained in this scope. + */ + interconnectAttachments: Schema$InterconnectAttachment[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * Describes a single physical circuit between the Customer and Google. + * CircuitInfo objects are created by Google, so all fields are output only. + * Next id: 4 + */ + export interface Schema$InterconnectCircuitInfo { + /** + * Customer-side demarc ID for this circuit. + */ + customerDemarcId: string; + /** + * Google-assigned unique ID for this circuit. Assigned at circuit turn-up. + */ + googleCircuitId: string; + /** + * Google-side demarc ID for this circuit. Assigned at circuit turn-up and + * provided by Google to the customer in the LOA. + */ + googleDemarcId: string; + } + /** + * Response to the list request, and contains a list of interconnects. + */ + export interface Schema$InterconnectList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Interconnect resources. + */ + items: Schema$Interconnect[]; + /** + * [Output Only] Type of resource. Always compute#interconnectList for lists + * of interconnects. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents an InterconnectLocations resource. The InterconnectLocations + * resource describes the locations where you can connect to Google's + * networks. For more information, see Colocation Facilities. + */ + export interface Schema$InterconnectLocation { + /** + * [Output Only] The postal address of the Point of Presence, each line in + * the address is separated by a newline character. + */ + address: string; + /** + * [Output Only] Availability zone for this location. Within a metropolitan + * area (metro), maintenance will not be simultaneously scheduled in more + * than one availability zone. Example: "zone1" or + * "zone2". + */ + availabilityZone: string; + /** + * [Output Only] Metropolitan area designator that indicates which city an + * interconnect is located. For example: "Chicago, IL", + * "Amsterdam, Netherlands". + */ + city: string; + /** + * [Output Only] Continent for this location. + */ + continent: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] An optional description of the resource. + */ + description: string; + /** + * [Output Only] The name of the provider for this facility (e.g., EQUINIX). + */ + facilityProvider: string; + /** + * [Output Only] A provider-assigned Identifier for this facility (e.g., + * Ashburn-DC1). + */ + facilityProviderFacilityId: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#interconnectLocation + * for interconnect locations. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The peeringdb identifier for this facility (corresponding + * with a netfac type in peeringdb). + */ + peeringdbFacilityId: string; + /** + * [Output Only] A list of InterconnectLocation.RegionInfo objects, that + * describe parameters pertaining to the relation between this + * InterconnectLocation and various Google Cloud regions. + */ + regionInfos: Schema$InterconnectLocationRegionInfo[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Response to the list request, and contains a list of interconnect + * locations. + */ + export interface Schema$InterconnectLocationList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InterconnectLocation resources. + */ + items: Schema$InterconnectLocation[]; + /** + * [Output Only] Type of resource. Always compute#interconnectLocationList + * for lists of interconnect locations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Information about any potential InterconnectAttachments between an + * Interconnect at a specific InterconnectLocation, and a specific Cloud + * Region. + */ + export interface Schema$InterconnectLocationRegionInfo { + /** + * Expected round-trip time in milliseconds, from this InterconnectLocation + * to a VM in this region. + */ + expectedRttMs: string; + /** + * Identifies the network presence of this location. + */ + locationPresence: string; + /** + * URL for the region of this location. + */ + region: string; + } + /** + * Description of a planned outage on this Interconnect. Next id: 9 + */ + export interface Schema$InterconnectOutageNotification { + /** + * Iff issue_type is IT_PARTIAL_OUTAGE, a list of the Google-side circuit + * IDs that will be affected. + */ + affectedCircuits: string[]; + /** + * A description about the purpose of the outage. + */ + description: string; + /** + * Scheduled end time for the outage (milliseconds since Unix epoch). + */ + endTime: string; + /** + * Form this outage is expected to take. Note that the "IT_" + * versions of this enum have been deprecated in favor of the unprefixed + * values. + */ + issueType: string; + /** + * Unique identifier for this outage notification. + */ + name: string; + /** + * The party that generated this notification. Note that + * "NSRC_GOOGLE" has been deprecated in favor of + * "GOOGLE" + */ + source: string; + /** + * Scheduled start time for the outage (milliseconds since Unix epoch). + */ + startTime: string; + /** + * State of this notification. Note that the "NS_" versions of + * this enum have been deprecated in favor of the unprefixed values. + */ + state: string; + } + /** + * A license resource. + */ + export interface Schema$License { + /** + * [Output Only] Deprecated. This field no longer reflects whether a license + * charges a usage fee. + */ + chargesUseFee: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#license for licenses. + */ + kind: string; + /** + * [Output Only] The unique code used to attach this license to images, + * snapshots, and disks. + */ + licenseCode: string; + /** + * [Output Only] Name of the resource. The name is 1-63 characters long and + * complies with RFC1035. + */ + name: string; + resourceRequirements: Schema$LicenseResourceRequirements; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * If false, licenses will not be copied from the source resource when + * creating an image from a disk, disk from snapshot, or snapshot from disk. + */ + transferable: boolean; + } + export interface Schema$LicenseCode { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#licenseCode for licenses. + */ + kind: string; + /** + * [Output Only] URL and description aliases of Licenses with the same + * License Code. + */ + licenseAlias: Schema$LicenseCodeLicenseAlias[]; + /** + * [Output Only] Name of the resource. The name is 1-20 characters long and + * must be a valid 64 bit integer. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Current state of this License Code. + */ + state: string; + /** + * [Output Only] If true, the license will remain attached when creating + * images or snapshots from disks. Otherwise, the license is not + * transferred. + */ + transferable: boolean; + } + export interface Schema$LicenseCodeLicenseAlias { + /** + * [Output Only] Description of this License Code. + */ + description: string; + /** + * [Output Only] URL of license corresponding to this License Code. + */ + selfLink: string; + } + export interface Schema$LicenseResourceRequirements { + /** + * Minimum number of guest cpus required to use the Instance. Enforced at + * Instance creation and Instance start. + */ + minGuestCpuCount: number; + /** + * Minimum memory required to use the Instance. Enforced at Instance + * creation and Instance start. + */ + minMemoryMb: number; + } + export interface Schema$LicensesListResponse { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of License resources. + */ + items: Schema$License[]; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A Machine Type resource. (== resource_for v1.machineTypes ==) (== + * resource_for beta.machineTypes ==) + */ + export interface Schema$MachineType { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this machine type. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] An optional textual description of the resource. + */ + description: string; + /** + * [Output Only] The number of virtual CPUs that are available to the + * instance. + */ + guestCpus: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Deprecated] This property is deprecated and will never be populated with + * any relevant values. + */ + imageSpaceGb: number; + /** + * [Output Only] Whether this machine type has a shared CPU. See Shared-core + * machine types for more information. + */ + isSharedCpu: boolean; + /** + * [Output Only] The type of the resource. Always compute#machineType for + * machine types. + */ + kind: string; + /** + * [Output Only] Maximum persistent disks allowed. + */ + maximumPersistentDisks: number; + /** + * [Output Only] Maximum total persistent disks size (GB) allowed. + */ + maximumPersistentDisksSizeGb: string; + /** + * [Output Only] The amount of physical memory available to the instance, + * defined in MB. + */ + memoryMb: number; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] A list of extended scratch disks assigned to the instance. + */ + scratchDisks: any[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The name of the zone where the machine type resides, such + * as us-central1-a. + */ + zone: string; + } + export interface Schema$MachineTypeAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineTypesScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#machineTypeAggregatedList + * for aggregated lists of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of machine types. + */ + export interface Schema$MachineTypeList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of MachineType resources. + */ + items: Schema$MachineType[]; + /** + * [Output Only] Type of resource. Always compute#machineTypeList for lists + * of machine types. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$MachineTypesScopedList { + /** + * [Output Only] A list of machine types contained in this scope. + */ + machineTypes: Schema$MachineType[]; + /** + * [Output Only] An informational warning that appears when the machine + * types list is empty. + */ + warning: any; + } + /** + * Next available tag: 12 + */ + export interface Schema$ManagedInstance { + /** + * [Output Only] The current action that the managed instance group has + * scheduled for the instance. Possible values: - NONE The instance is + * running, and the managed instance group does not have any scheduled + * actions for this instance. - CREATING The managed instance group is + * creating this instance. If the group fails to create this instance, it + * will try again until it is successful. - CREATING_WITHOUT_RETRIES The + * managed instance group is attempting to create this instance only once. + * If the group fails to create this instance, it does not try again and the + * group's targetSize value is decreased instead. - RECREATING The + * managed instance group is recreating this instance. - DELETING The + * managed instance group is permanently deleting this instance. - + * ABANDONING The managed instance group is abandoning this instance. The + * instance will be removed from the instance group and from any target + * pools that are associated with this group. - RESTARTING The managed + * instance group is restarting the instance. - REFRESHING The managed + * instance group is applying configuration changes to the instance without + * stopping it. For example, the group can update the target pool list for + * an instance without stopping that instance. - VERIFYING The managed + * instance group has created the instance and it is in the process of being + * verified. + */ + currentAction: string; + /** + * [Output only] The unique identifier for this resource. This field is + * empty when instance does not exist. + */ + id: string; + /** + * [Output Only] The URL of the instance. The URL can exist even if the + * instance has not yet been created. + */ + instance: string; + /** + * [Output Only] The status of the instance. This field is empty when the + * instance does not exist. + */ + instanceStatus: string; + /** + * [Output Only] Information about the last attempt to create or delete the + * instance. + */ + lastAttempt: Schema$ManagedInstanceLastAttempt; + } + export interface Schema$ManagedInstanceLastAttempt { + /** + * [Output Only] Encountered errors during the last attempt to create or + * delete the instance. + */ + errors: any; + } + /** + * A metadata key/value entry. + */ + export interface Schema$Metadata { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. + */ + fingerprint: string; + /** + * Array of key/value pairs. The total size of all keys and values must be + * less than 512 KB. + */ + items: any[]; + /** + * [Output Only] Type of the resource. Always compute#metadata for metadata. + */ + kind: string; + } + /** + * The named port. For example: . + */ + export interface Schema$NamedPort { + /** + * The name for this named port. The name must be 1-63 characters long, and + * comply with RFC1035. + */ + name: string; + /** + * The port number, which can be a value between 1 and 65535. + */ + port: number; + } + /** + * Represents a Network resource. Read Networks and Firewalls for more + * information. (== resource_for v1.networks ==) (== resource_for + * beta.networks ==) + */ + export interface Schema$Network { + /** + * When set to true, the network is created in "auto subnet mode". + * When set to false, the network is in "custom subnet mode". In + * "auto subnet mode", a newly created network is assigned the + * default CIDR of 10.128.0.0/9 and it automatically creates one subnetwork + * per region. + */ + autoCreateSubnetworks: boolean; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * A gateway address for default routing to other networks. This value is + * read only and is selected by the Google Compute Engine, typically as the + * first usable address in the IPv4Range. + */ + gatewayIPv4: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are legal on this network. This + * range is a CIDR specification, for example: 192.168.0.0/16. Provided by + * the client when the network is created. + */ + IPv4Range: string; + /** + * [Output Only] Type of the resource. Always compute#network for networks. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] A list of network peerings for the resource. + */ + peerings: Schema$NetworkPeering[]; + /** + * The network-level routing configuration for this network. Used by Cloud + * Router to determine what type of network-wide routing behavior to + * enforce. + */ + routingConfig: Schema$NetworkRoutingConfig; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Server-defined fully-qualified URLs for all subnetworks in + * this network. + */ + subnetworks: string[]; + } + /** + * A network interface resource attached to an instance. + */ + export interface Schema$NetworkInterface { + /** + * An array of configurations for this interface. Currently, only one access + * config, ONE_TO_ONE_NAT, is supported. If there are no accessConfigs + * specified, then this instance will have no external internet access. + */ + accessConfigs: Schema$AccessConfig[]; + /** + * An array of alias IP ranges for this network interface. Can only be + * specified for network interfaces on subnet-mode networks. + */ + aliasIpRanges: Schema$AliasIpRange[]; + /** + * Fingerprint hash of contents stored in this network interface. This field + * will be ignored when inserting an Instance or adding a NetworkInterface. + * An up-to-date fingerprint must be provided in order to update the + * NetworkInterface. + */ + fingerprint: string; + /** + * [Output Only] Type of the resource. Always compute#networkInterface for + * network interfaces. + */ + kind: string; + /** + * [Output Only] The name of the network interface, generated by the server. + * For network devices, these are eth0, eth1, etc. + */ + name: string; + /** + * URL of the network resource for this instance. When creating an instance, + * if neither the network nor the subnetwork is specified, the default + * network global/networks/default is used; if the network is not specified + * but the subnetwork is specified, the network is inferred. This field is + * optional when creating a firewall rule. If not specified when creating a + * firewall rule, the default network global/networks/default is used. If + * you specify this property, you can specify the network as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/global/networks/network + * - projects/project/global/networks/network - global/networks/default + */ + network: string; + /** + * An IPv4 internal network address to assign to the instance for this + * network interface. If not specified by the user, an unused internal IP is + * assigned by the system. + */ + networkIP: string; + /** + * The URL of the Subnetwork resource for this instance. If the network + * resource is in legacy mode, do not provide this property. If the network + * is in auto subnet mode, providing the subnetwork is optional. If the + * network is in custom subnet mode, then this field should be specified. If + * you specify this property, you can specify the subnetwork as a full or + * partial URL. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/regions/region/subnetworks/subnetwork + * - regions/region/subnetworks/subnetwork + */ + subnetwork: string; + } + /** + * Contains a list of networks. + */ + export interface Schema$NetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Network resources. + */ + items: Schema$Network[]; + /** + * [Output Only] Type of resource. Always compute#networkList for lists of + * networks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A network peering attached to a network resource. The message includes the + * peering name, peer network, peering state, and a flag indicating whether + * Google Compute Engine should automatically create routes for the peering. + */ + export interface Schema$NetworkPeering { + /** + * Whether full mesh connectivity is created and managed automatically. When + * it is set to true, Google Compute Engine will automatically create and + * manage the routes between two networks when the state is ACTIVE. + * Otherwise, user needs to create routes manually to route packets to peer + * network. + */ + autoCreateRoutes: boolean; + /** + * Name of this peering. Provided by the client when the peering is created. + * The name must comply with RFC1035. Specifically, the name must be 1-63 + * characters long and match regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` + * which means the first character must be a lowercase letter, and all the + * following characters must be a dash, lowercase letter, or digit, except + * the last character, which cannot be a dash. + */ + name: string; + /** + * The URL of the peer network. It can be either full URL or partial URL. + * The peer network may belong to a different project. If the partial URL + * does not contain project, it is assumed that the peer network is in the + * same project as the current network. + */ + network: string; + /** + * [Output Only] State for the peering. + */ + state: string; + /** + * [Output Only] Details about the current state of the peering. + */ + stateDetails: string; + } + /** + * A routing configuration attached to a network resource. The message + * includes the list of routers associated with the network, and a flag + * indicating the type of routing behavior to enforce network-wide. + */ + export interface Schema$NetworkRoutingConfig { + /** + * The network-wide routing mode to use. If set to REGIONAL, this + * network's cloud routers will only advertise routes with subnetworks + * of this network in the same region as the router. If set to GLOBAL, this + * network's cloud routers will advertise routes with all subnetworks of + * this network, across regions. + */ + routingMode: string; + } + export interface Schema$NetworksAddPeeringRequest { + /** + * Whether Google Compute Engine manages the routes automatically. + */ + autoCreateRoutes: boolean; + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + /** + * URL of the peer network. It can be either full URL or partial URL. The + * peer network may belong to a different project. If the partial URL does + * not contain project, it is assumed that the peer network is in the same + * project as the current network. + */ + peerNetwork: string; + } + export interface Schema$NetworksRemovePeeringRequest { + /** + * Name of the peering, which should conform to RFC1035. + */ + name: string; + } + /** + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; + } + export interface Schema$OperationAggregatedList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A map of scoped operation lists. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#operationAggregatedList + * for aggregated lists of operations. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Operation resources. + */ + export interface Schema$OperationList { + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] A list of Operation resources. + */ + items: Schema$Operation[]; + /** + * [Output Only] Type of resource. Always compute#operations for Operations + * resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$OperationsScopedList { + /** + * [Output Only] A list of operations contained in this scope. + */ + operations: Schema$Operation[]; + /** + * [Output Only] Informational warning which replaces the list of operations + * when the list is empty. + */ + warning: any; + } + /** + * A matcher for the path portion of the URL. The BackendService from the + * longest-matched rule will serve the URL. If no rule was matched, the + * default service will be used. + */ + export interface Schema$PathMatcher { + /** + * The full or partial URL to the BackendService resource. This will be used + * if none of the pathRules defined by this PathMatcher is matched by the + * URL's path portion. For example, the following are all valid URLs to + * a BackendService resource: - + * https://www.googleapis.com/compute/v1/projects/project/global/backendServices/backendService + * - compute/v1/projects/project/global/backendServices/backendService - + * global/backendServices/backendService + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The name to which this PathMatcher is referred by the HostRule. + */ + name: string; + /** + * The list of path rules. + */ + pathRules: Schema$PathRule[]; + } + /** + * A path-matching rule for a URL. If matched, will use the specified + * BackendService to handle the traffic arriving at this URL. + */ + export interface Schema$PathRule { + /** + * The list of path patterns to match. Each must start with / and the only + * place a * is allowed is at the end following a /. The string fed to the + * path matcher does not include any text after the first ? or #, and those + * chars are not allowed here. + */ + paths: string[]; + /** + * The URL of the BackendService resource if this rule is matched. + */ + service: string; + } + /** + * A Project resource. For an overview of projects, see Cloud Platform + * Resource Hierarchy. (== resource_for v1.projects ==) (== resource_for + * beta.projects ==) + */ + export interface Schema$Project { + /** + * Metadata key/value pairs available to all instances contained in this + * project. See Custom metadata for more information. + */ + commonInstanceMetadata: Schema$Metadata; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] Default service account used by VMs running in this + * project. + */ + defaultServiceAccount: string; + /** + * An optional textual description of the resource. + */ + description: string; + /** + * Restricted features enabled for use on this project. + */ + enabledFeatures: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. This is not the project ID, and is just a unique + * ID used by Compute Engine to identify resources. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#project for projects. + */ + kind: string; + /** + * The project ID. For example: my-example-project. Use the project ID to + * make requests to Compute Engine. + */ + name: string; + /** + * [Output Only] Quotas assigned to this project. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The naming prefix for daily usage reports and the Google Cloud Storage + * bucket where they are stored. + */ + usageExportLocation: Schema$UsageExportLocation; + /** + * [Output Only] The role this project has in a shared VPC configuration. + * Currently only HOST projects are differentiated. + */ + xpnProjectStatus: string; + } + export interface Schema$ProjectsDisableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsEnableXpnResourceRequest { + /** + * Service resource (a.k.a service project) ID. + */ + xpnResource: Schema$XpnResourceId; + } + export interface Schema$ProjectsGetXpnResources { + /** + * [Output Only] Type of resource. Always compute#projectsGetXpnResources + * for lists of service resources (a.k.a service projects) + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * Service resources (a.k.a service projects) attached to this project as + * their shared VPC host. + */ + resources: Schema$XpnResourceId[]; + } + export interface Schema$ProjectsListXpnHostsRequest { + /** + * Optional organization ID managed by Cloud Resource Manager, for which to + * list shared VPC host projects. If not specified, the organization will be + * inferred from the project. + */ + organization: string; + } + /** + * A quotas entry. + */ + export interface Schema$Quota { + /** + * [Output Only] Quota limit for this metric. + */ + limit: number; + /** + * [Output Only] Name of the quota metric. + */ + metric: string; + /** + * [Output Only] Current usage of this metric. + */ + usage: number; + } + /** + * Represents a reference to a resource. + */ + export interface Schema$Reference { + /** + * [Output Only] Type of the resource. Always compute#reference for + * references. + */ + kind: string; + /** + * A description of the reference type with no implied semantics. Possible + * values include: - MEMBER_OF + */ + referenceType: string; + /** + * URL of the resource which refers to the target. + */ + referrer: string; + /** + * URL of the resource to which this reference points. + */ + target: string; + } + /** + * Region resource. (== resource_for beta.regions ==) (== resource_for + * v1.regions ==) + */ + export interface Schema$Region { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this region. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#region for regions. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Quotas assigned to this region. + */ + quotas: Schema$Quota[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the region, either UP or DOWN. + */ + status: string; + /** + * [Output Only] A list of zones available in this region, in the form of + * resource URLs. + */ + zones: string[]; + } + /** + * Contains a list of autoscalers. + */ + export interface Schema$RegionAutoscalerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Autoscaler resources. + */ + items: Schema$Autoscaler[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of InstanceGroup resources. + */ + export interface Schema$RegionInstanceGroupList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroup resources. + */ + items: Schema$InstanceGroup[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of managed instance groups. + */ + export interface Schema$RegionInstanceGroupManagerList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceGroupManager resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * [Output Only] The resource type, which is always + * compute#instanceGroupManagerList for a list of managed instance groups + * that exist in th regional scope. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupManagersAbandonInstancesRequest { + /** + * The URLs of one or more instances to abandon. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersDeleteInstancesRequest { + /** + * The URLs of one or more instances to delete. This can be a full URL or a + * partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersListInstancesResponse { + /** + * A list of managed instances. + */ + managedInstances: Schema$ManagedInstance[]; + } + export interface Schema$RegionInstanceGroupManagersRecreateRequest { + /** + * The URLs of one or more instances to recreate. This can be a full URL or + * a partial URL, such as zones/[ZONE]/instances/[INSTANCE_NAME]. + */ + instances: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetTargetPoolsRequest { + /** + * Fingerprint of the target pools information, which is a hash of the + * contents. This field is used for optimistic locking when you update the + * target pool entries. This field is optional. + */ + fingerprint: string; + /** + * The URL of all TargetPool resources to which instances in the + * instanceGroup field are added. The target pools automatically apply to + * all of the instances in the managed instance group. + */ + targetPools: string[]; + } + export interface Schema$RegionInstanceGroupManagersSetTemplateRequest { + /** + * URL of the InstanceTemplate resource from which all new instances will be + * created. + */ + instanceTemplate: string; + } + export interface Schema$RegionInstanceGroupsListInstances { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of InstanceWithNamedPorts resources. + */ + items: Schema$InstanceWithNamedPorts[]; + /** + * The resource type. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RegionInstanceGroupsListInstancesRequest { + /** + * Instances in which state should be returned. Valid options are: + * 'ALL', 'RUNNING'. By default, it lists all instances. + */ + instanceState: string; + /** + * Name of port user is interested in. It is optional. If it is set, only + * information about this ports will be returned. If it is not set, all the + * named ports will be returned. Always lists all instances. + */ + portName: string; + } + export interface Schema$RegionInstanceGroupsSetNamedPortsRequest { + /** + * The fingerprint of the named ports information for this instance group. + * Use this optional property to prevent conflicts when multiple users + * change the named ports settings concurrently. Obtain the fingerprint with + * the instanceGroups.get method. Then, include the fingerprint in your + * request to ensure that you do not overwrite changes that were applied + * from another concurrent request. + */ + fingerprint: string; + /** + * The list of named ports to set for this instance group. + */ + namedPorts: Schema$NamedPort[]; + } + /** + * Contains a list of region resources. + */ + export interface Schema$RegionList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Region resources. + */ + items: Schema$Region[]; + /** + * [Output Only] Type of resource. Always compute#regionList for lists of + * regions. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Commitment for a particular resource (a Commitment is composed of one or + * more of these). + */ + export interface Schema$ResourceCommitment { + /** + * The amount of the resource purchased (in a type-dependent unit, such as + * bytes). For vCPUs, this can just be an integer. For memory, this must be + * provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of + * memory per every vCPU. + */ + amount: string; + /** + * Type of resource for which this commitment applies. Possible values are + * VCPU and MEMORY + */ + type: string; + } + export interface Schema$ResourceGroupReference { + /** + * A URI referencing one of the instance groups listed in the backend + * service. + */ + group: string; + } + /** + * Represents a Route resource. A route specifies how certain packets should + * be handled by the network. Routes are associated with instances by tags and + * the set of routes for a particular instance is called its routing table. + * For each packet leaving an instance, the system searches that + * instance's routing table for a single best matching route. Routes match + * packets by destination IP address, preferring smaller or more specific + * ranges over larger ones. If there is a tie, the system selects the route + * with the smallest priority value. If there is still a tie, it uses the + * layer three and four packet headers to select just one of the remaining + * matching routes. The packet is then forwarded as specified by the nextHop + * field of the winning route - either to another instance destination, an + * instance gateway, or a Google Compute Engine-operated gateway. Packets + * that do not match any route in the sending instance's routing table are + * dropped. (== resource_for beta.routes ==) (== resource_for v1.routes ==) + */ + export interface Schema$Route { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * The destination range of outgoing packets that this route applies to. + * Only IPv4 is supported. + */ + destRange: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of this resource. Always compute#routes for Route + * resources. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Fully-qualified URL of the network that this route applies to. + */ + network: string; + /** + * The URL to a gateway that should handle matching packets. You can only + * specify the internet gateway using a full or partial valid URL: + * projects/<project-id>/global/gateways/default-internet-gateway + */ + nextHopGateway: string; + /** + * The URL to an instance that should handle matching packets. You can + * specify this as a full or partial URL. For example: + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/ + */ + nextHopInstance: string; + /** + * The network IP address of an instance that should handle matching + * packets. Only IPv4 is supported. + */ + nextHopIp: string; + /** + * The URL of the local network if it should handle matching packets. + */ + nextHopNetwork: string; + /** + * [Output Only] The network peering name that should handle matching + * packets, which should conform to RFC1035. + */ + nextHopPeering: string; + /** + * The URL to a VpnTunnel that should handle matching packets. + */ + nextHopVpnTunnel: string; + /** + * The priority of this route. Priority is used to break ties in cases where + * there is more than one matching route of equal prefix length. In the case + * of two routes with equal prefix length, the one with the lowest-numbered + * priority value wins. Default value is 1000. Valid range is 0 through + * 65535. + */ + priority: number; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * A list of instance tags to which this route applies. + */ + tags: string[]; + /** + * [Output Only] If potential misconfigurations are detected for this route, + * this field will be populated with warning messages. + */ + warnings: any[]; + } + /** + * Contains a list of Route resources. + */ + export interface Schema$RouteList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Route resources. + */ + items: Schema$Route[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Router resource. + */ + export interface Schema$Router { + /** + * BGP information specific to this router. + */ + bgp: Schema$RouterBgp; + /** + * BGP information that needs to be configured into the routing stack to + * establish the BGP peering. It must specify peer ASN and either interface + * name, IP, or peer IP. Please refer to RFC4273. + */ + bgpPeers: Schema$RouterBgpPeer[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * Router interfaces. Each interface requires either one linked resource + * (e.g. linkedVpnTunnel), or IP address and IP address range (e.g. + * ipRange), or both. + */ + interfaces: Schema$RouterInterface[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URI of the network to which this router belongs. + */ + network: string; + /** + * [Output Only] URI of the region where the router resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Description-tagged IP ranges for the router to advertise. + */ + export interface Schema$RouterAdvertisedIpRange { + /** + * User-specified description for the IP range. + */ + description: string; + /** + * The IP range to advertise. The value must be a CIDR-formatted string. + */ + range: string; + } + /** + * Contains a list of routers. + */ + export interface Schema$RouterAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RouterBgp { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and is advertised + * to all peers of the router. These groups will be advertised in addition + * to any specified prefixes. Leave this field blank to advertise no custom + * groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and is + * advertised to all peers of the router. These IP ranges will be advertised + * in addition to any specified groups. Leave this field blank to advertise + * no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Local BGP Autonomous System Number (ASN). Must be an RFC6996 private ASN, + * either 16-bit or 32-bit. The value will be fixed for this router + * resource. All VPN tunnels that link to this router will have the same + * local ASN. + */ + asn: number; + } + export interface Schema$RouterBgpPeer { + /** + * User-specified list of prefix groups to advertise in custom mode. This + * field can only be populated if advertise_mode is CUSTOM and overrides the + * list defined for the router (in Bgp message). These groups will be + * advertised in addition to any specified prefixes. Leave this field blank + * to advertise no custom groups. + */ + advertisedGroups: string[]; + /** + * User-specified list of individual IP ranges to advertise in custom mode. + * This field can only be populated if advertise_mode is CUSTOM and + * overrides the list defined for the router (in Bgp message). These IP + * ranges will be advertised in addition to any specified groups. Leave this + * field blank to advertise no custom IP ranges. + */ + advertisedIpRanges: Schema$RouterAdvertisedIpRange[]; + /** + * The priority of routes advertised to this BGP peer. In the case where + * there is more than one matching route of maximum length, the routes with + * lowest priority value win. + */ + advertisedRoutePriority: number; + /** + * User-specified flag to indicate which mode to use for advertisement. + */ + advertiseMode: string; + /** + * Name of the interface the BGP peer is associated with. + */ + interfaceName: string; + /** + * IP address of the interface inside Google Cloud Platform. Only IPv4 is + * supported. + */ + ipAddress: string; + /** + * Name of this BGP peer. The name must be 1-63 characters long and comply + * with RFC1035. + */ + name: string; + /** + * Peer BGP Autonomous System Number (ASN). For VPN use case, this value can + * be different for every tunnel. + */ + peerAsn: number; + /** + * IP address of the BGP interface outside Google cloud. Only IPv4 is + * supported. + */ + peerIpAddress: string; + } + export interface Schema$RouterInterface { + /** + * IP address and range of the interface. The IP range must be in the + * RFC3927 link-local IP space. The value must be a CIDR-formatted string, + * for example: 169.254.0.1/30. NOTE: Do not truncate the address as it + * represents the IP address of the interface. + */ + ipRange: string; + /** + * URI of the linked interconnect attachment. It must be in the same region + * as the router. Each interface can have at most one linked resource and it + * could either be a VPN Tunnel or an interconnect attachment. + */ + linkedInterconnectAttachment: string; + /** + * URI of the linked VPN tunnel. It must be in the same region as the + * router. Each interface can have at most one linked resource and it could + * either be a VPN Tunnel or an interconnect attachment. + */ + linkedVpnTunnel: string; + /** + * Name of this interface entry. The name must be 1-63 characters long and + * comply with RFC1035. + */ + name: string; + } + /** + * Contains a list of Router resources. + */ + export interface Schema$RouterList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Router resources. + */ + items: Schema$Router[]; + /** + * [Output Only] Type of resource. Always compute#router for routers. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$RoutersPreviewResponse { + /** + * Preview of given router. + */ + resource: Schema$Router; + } + export interface Schema$RoutersScopedList { + /** + * A list of routers contained in this scope. + */ + routers: Schema$Router[]; + /** + * Informational warning which replaces the list of routers when the list is + * empty. + */ + warning: any; + } + export interface Schema$RouterStatus { + /** + * Best routes for this router's network. + */ + bestRoutes: Schema$Route[]; + /** + * Best routes learned by this router. + */ + bestRoutesForRouter: Schema$Route[]; + bgpPeerStatus: Schema$RouterStatusBgpPeerStatus[]; + /** + * URI of the network to which this router belongs. + */ + network: string; + } + export interface Schema$RouterStatusBgpPeerStatus { + /** + * Routes that were advertised to the remote BGP peer + */ + advertisedRoutes: Schema$Route[]; + /** + * IP address of the local BGP interface. + */ + ipAddress: string; + /** + * URL of the VPN tunnel that this BGP peer controls. + */ + linkedVpnTunnel: string; + /** + * Name of this BGP peer. Unique within the Routers resource. + */ + name: string; + /** + * Number of routes learned from the remote BGP Peer. + */ + numLearnedRoutes: number; + /** + * IP address of the remote BGP interface. + */ + peerIpAddress: string; + /** + * BGP state as specified in RFC1771. + */ + state: string; + /** + * Status of the BGP peer: {UP, DOWN} + */ + status: string; + /** + * Time this session has been up. Format: 14 years, 51 weeks, 6 days, 23 + * hours, 59 minutes, 59 seconds + */ + uptime: string; + /** + * Time this session has been up, in seconds. Format: 145 + */ + uptimeSeconds: string; + } + export interface Schema$RouterStatusResponse { + /** + * Type of resource. + */ + kind: string; + result: Schema$RouterStatus; + } + /** + * Sets the scheduling options for an Instance. + */ + export interface Schema$Scheduling { + /** + * Specifies whether the instance should be automatically restarted if it is + * terminated by Compute Engine (not terminated by a user). You can only set + * the automatic restart option for standard instances. Preemptible + * instances cannot be automatically restarted. By default, this is set to + * true so an instance is automatically restarted if it is terminated by + * Compute Engine. + */ + automaticRestart: boolean; + /** + * Defines the maintenance behavior for this instance. For standard + * instances, the default behavior is MIGRATE. For preemptible instances, + * the default and only possible behavior is TERMINATE. For more + * information, see Setting Instance Scheduling Options. + */ + onHostMaintenance: string; + /** + * Defines whether the instance is preemptible. This can only be set during + * instance creation, it cannot be set or changed after the instance has + * been created. + */ + preemptible: boolean; + } + /** + * An instance's serial console output. + */ + export interface Schema$SerialPortOutput { + /** + * [Output Only] The contents of the console output. + */ + contents: string; + /** + * [Output Only] Type of the resource. Always compute#serialPortOutput for + * serial port output. + */ + kind: string; + /** + * [Output Only] The position of the next byte of content from the serial + * console output. Use this value in the next request as the start + * parameter. + */ + next: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * The starting byte position of the output that was returned. This should + * match the start parameter sent with the request. If the serial console + * output exceeds the size of the buffer, older output will be overwritten + * by newer content and the start values will be mismatched. + */ + start: string; + } + /** + * A service account. + */ + export interface Schema$ServiceAccount { + /** + * Email address of the service account. + */ + email: string; + /** + * The list of scopes to be made available for this service account. + */ + scopes: string[]; + } + /** + * A persistent disk snapshot resource. (== resource_for beta.snapshots ==) + * (== resource_for v1.snapshots ==) + */ + export interface Schema$Snapshot { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Size of the snapshot, specified in GB. + */ + diskSizeGb: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#snapshot for Snapshot + * resources. + */ + kind: string; + /** + * A fingerprint for the labels being applied to this snapshot, which is + * essentially a hash of the labels set used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update labels. You must always provide an + * up-to-date fingerprint hash in order to update or change labels. To see + * the latest fingerprint, make a get() request to retrieve a snapshot. + */ + labelFingerprint: string; + /** + * Labels to apply to this snapshot. These can be later modified by the + * setLabels method. Label values may be empty. + */ + labels: any; + /** + * Integer license codes indicating which licenses are attached to this + * snapshot. + */ + licenseCodes: string[]; + /** + * [Output Only] A list of public visible licenses that apply to this + * snapshot. This can be because the original image had licenses attached + * (such as a Windows image). + */ + licenses: string[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Encrypts the snapshot using a customer-supplied encryption key. After + * you encrypt a snapshot using a customer-supplied key, you must provide + * the same key if you use the image later For example, you must provide the + * encryption key when you create a disk from the encrypted snapshot in a + * future request. Customer-supplied encryption keys do not protect access + * to metadata of the disk. If you do not provide an encryption key when + * creating the snapshot, then the snapshot will be encrypted using an + * automatically generated key and you do not need to provide a key to use + * the snapshot later. + */ + snapshotEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The source disk used to create this snapshot. + */ + sourceDisk: string; + /** + * The customer-supplied encryption key of the source disk. Required if the + * source disk is protected by a customer-supplied encryption key. + */ + sourceDiskEncryptionKey: Schema$CustomerEncryptionKey; + /** + * [Output Only] The ID value of the disk used to create this snapshot. This + * value may be used to determine whether the snapshot was taken from the + * current or a previous instance of a given disk name. + */ + sourceDiskId: string; + /** + * [Output Only] The status of the snapshot. This can be CREATING, DELETING, + * FAILED, READY, or UPLOADING. + */ + status: string; + /** + * [Output Only] A size of the storage used by the snapshot. As snapshots + * share storage, this number is expected to change with snapshot + * creation/deletion. + */ + storageBytes: string; + /** + * [Output Only] An indicator whether storageBytes is in a stable state or + * it is being adjusted as a result of shared storage reallocation. This + * status can either be UPDATING, meaning the size of the snapshot is being + * updated, or UP_TO_DATE, meaning the size of the snapshot is up-to-date. + */ + storageBytesStatus: string; + } + /** + * Contains a list of Snapshot resources. + */ + export interface Schema$SnapshotList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Snapshot resources. + */ + items: Schema$Snapshot[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * An SslCertificate resource. This resource provides a mechanism to upload an + * SSL key and certificate to the load balancer to serve secure connections + * from the user. (== resource_for beta.sslCertificates ==) (== resource_for + * v1.sslCertificates ==) + */ + export interface Schema$SslCertificate { + /** + * A local certificate file. The certificate must be in PEM format. The + * certificate chain must be no greater than 5 certs long. The chain must + * include at least one intermediate cert. + */ + certificate: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#sslCertificate for SSL + * certificates. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * A write-only private key in PEM format. Only insert requests will include + * this field. + */ + privateKey: string; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + } + /** + * Contains a list of SslCertificate resources. + */ + export interface Schema$SslCertificateList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslCertificate resources. + */ + items: Schema$SslCertificate[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SSLHealthCheck { + /** + * The TCP port number for the health check request. The default value is + * 443. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the SSL connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$SslPoliciesList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SslPolicy resources. + */ + items: Schema$SslPolicy[]; + /** + * [Output Only] Type of the resource. Always compute#sslPoliciesList for + * lists of sslPolicies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$SslPoliciesListAvailableFeaturesResponse { + features: string[]; + } + /** + * A SSL policy specifies the server-side support for SSL features. This can + * be attached to a TargetHttpsProxy or a TargetSslProxy. This affects + * connections between clients and the HTTPS or SSL proxy load balancer. They + * do not affect the connection between the load balancers and the backends. + */ + export interface Schema$SslPolicy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * A list of features enabled when the selected profile is CUSTOM. The - + * method returns the set of features that can be specified in this list. + * This field must be empty if the profile is not CUSTOM. + */ + customFeatures: string[]; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The list of features enabled in the SSL policy. + */ + enabledFeatures: string[]; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a SslPolicy. An up-to-date fingerprint must be + * provided in order to update the SslPolicy. + */ + fingerprint: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output only] Type of the resource. Always compute#sslPolicyfor SSL + * policies. + */ + kind: string; + /** + * The minimum version of SSL protocol that can be used by the clients to + * establish a connection with the load balancer. This can be one of + * TLS_1_0, TLS_1_1, TLS_1_2. + */ + minTlsVersion: string; + /** + * Name of the resource. The name must be 1-63 characters long, and comply + * with RFC1035. Specifically, the name must be 1-63 characters long and + * match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the + * first character must be a lowercase letter, and all following characters + * must be a dash, lowercase letter, or digit, except the last character, + * which cannot be a dash. + */ + name: string; + /** + * Profile specifies the set of SSL features that can be used by the load + * balancer when negotiating SSL with clients. This can be one of + * COMPATIBLE, MODERN, RESTRICTED, or CUSTOM. If using CUSTOM, the set of + * SSL features to enable must be specified in the customFeatures field. + */ + profile: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] If potential misconfigurations are detected for this SSL + * policy, this field will be populated with warning messages. + */ + warnings: any[]; + } + export interface Schema$SslPolicyReference { + /** + * URL of the SSL policy resource. Set this to empty string to clear any + * existing SSL policy associated with the target proxy resource. + */ + sslPolicy: string; + } + /** + * A Subnetwork resource. (== resource_for beta.subnetworks ==) (== + * resource_for v1.subnetworks ==) + */ + export interface Schema$Subnetwork { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. This field can be set only at resource creation + * time. + */ + description: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a Subnetwork. An up-to-date fingerprint must be + * provided in order to update the Subnetwork. + */ + fingerprint: string; + /** + * [Output Only] The gateway address for default routes to reach destination + * addresses outside this subnetwork. + */ + gatewayAddress: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * The range of internal addresses that are owned by this subnetwork. + * Provide this property when you create the subnetwork. For + * example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and + * non-overlapping within a network. Only IPv4 is supported. This field can + * be set only at resource creation time. + */ + ipCidrRange: string; + /** + * [Output Only] Type of the resource. Always compute#subnetwork for + * Subnetwork resources. + */ + kind: string; + /** + * The name of the resource, provided by the client when initially creating + * the resource. The name must be 1-63 characters long, and comply with + * RFC1035. Specifically, the name must be 1-63 characters long and match + * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first + * character must be a lowercase letter, and all following characters must + * be a dash, lowercase letter, or digit, except the last character, which + * cannot be a dash. + */ + name: string; + /** + * The URL of the network to which this subnetwork belongs, provided by the + * client when initially creating the subnetwork. Only networks that are in + * the distributed mode can have subnetworks. This field can be set only at + * resource creation time. + */ + network: string; + /** + * Whether the VMs in this subnet can access Google services without + * assigned external IP addresses. This field can be both set at resource + * creation time and updated using setPrivateIpGoogleAccess. + */ + privateIpGoogleAccess: boolean; + /** + * URL of the region where the Subnetwork resides. This field can be set + * only at resource creation time. + */ + region: string; + /** + * An array of configurations for secondary IP ranges for VM instances + * contained in this subnetwork. The primary IP of such VM must belong to + * the primary ipCidrRange of the subnetwork. The alias IPs may belong to + * either primary or secondary ranges. + */ + secondaryIpRanges: Schema$SubnetworkSecondaryRange[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + } + export interface Schema$SubnetworkAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of SubnetworksScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#subnetworkAggregatedList + * for aggregated lists of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of Subnetwork resources. + */ + export interface Schema$SubnetworkList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Subnetwork resources. + */ + items: Schema$Subnetwork[]; + /** + * [Output Only] Type of resource. Always compute#subnetworkList for lists + * of subnetworks. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a secondary IP range of a subnetwork. + */ + export interface Schema$SubnetworkSecondaryRange { + /** + * The range of IP addresses belonging to this subnetwork secondary range. + * Provide this property when you create the subnetwork. Ranges must be + * unique and non-overlapping with all primary and secondary IP ranges + * within a network. Only IPv4 is supported. + */ + ipCidrRange: string; + /** + * The name associated with this subnetwork secondary range, used when + * adding an alias IP range to a VM instance. The name must be 1-63 + * characters long, and comply with RFC1035. The name must be unique within + * the subnetwork. + */ + rangeName: string; + } + export interface Schema$SubnetworksExpandIpCidrRangeRequest { + /** + * The IP (in CIDR format or netmask) of internal addresses that are legal + * on this Subnetwork. This range should be disjoint from other subnetworks + * within this network. This range can only be larger than (i.e. a superset + * of) the range previously defined before the update. + */ + ipCidrRange: string; + } + export interface Schema$SubnetworksScopedList { + /** + * A list of subnetworks contained in this scope. + */ + subnetworks: Schema$Subnetwork[]; + /** + * An informational warning that appears when the list of addresses is + * empty. + */ + warning: any; + } + export interface Schema$SubnetworksSetPrivateIpGoogleAccessRequest { + privateIpGoogleAccess: boolean; + } + /** + * A set of instance tags. + */ + export interface Schema$Tags { + /** + * Specifies a fingerprint for this request, which is essentially a hash of + * the metadata's contents and used for optimistic locking. The + * fingerprint is initially generated by Compute Engine and changes after + * every request to modify or update metadata. You must always provide an + * up-to-date fingerprint hash in order to update or change metadata. To + * see the latest fingerprint, make get() request to the instance. + */ + fingerprint: string; + /** + * An array of tags. Each tag must be 1-63 characters long, and comply with + * RFC1035. + */ + items: string[]; + } + /** + * A TargetHttpProxy resource. This resource defines an HTTP proxy. (== + * resource_for beta.targetHttpProxies ==) (== resource_for + * v1.targetHttpProxies ==) + */ + export interface Schema$TargetHttpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpProxy for target + * HTTP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the UrlMap resource that defines the mapping from URL to the + * BackendService. + */ + urlMap: string; } - - getRoot() { - return this.root; - } - - /** - * compute.zones.get - * @desc Returns the specified Zone resource. Get a list of available zones by - * making a list() request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the zone resource to return. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * compute.zones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.zone Name of the zone resource to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A list of TargetHttpProxy resources. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/zones/{zone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TargetHttpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpProxy resources. + */ + items: Schema$TargetHttpProxy[]; + /** + * Type of resource. Always compute#targetHttpProxyList for lists of target + * HTTP proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetHttpsProxiesSetSslCertificatesRequest { + /** + * New set of SslCertificate resources to associate with this + * TargetHttpsProxy resource. Currently exactly one SslCertificate resource + * must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetHttpsProxy resource. This resource defines an HTTPS proxy. (== + * resource_for beta.targetHttpsProxies ==) (== resource_for + * v1.targetHttpsProxies ==) + */ + export interface Schema$TargetHttpsProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetHttpsProxy for + * target HTTPS proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections between users and the load balancer. Currently, exactly one + * SSL certificate must be specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the + * TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource will + * not have any SSL policy configured. + */ + sslPolicy: string; + /** + * A fully-qualified or valid partial URL to the UrlMap resource that + * defines the mapping from URL to the BackendService. For example, the + * following are all valid URLs for specifying a URL map: - + * https://www.googleapis.compute/v1/projects/project/global/urlMaps/url-map + * - projects/project/global/urlMaps/url-map - global/urlMaps/url-map + */ + urlMap: string; + } + /** + * Contains a list of TargetHttpsProxy resources. + */ + export interface Schema$TargetHttpsProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetHttpsProxy resources. + */ + items: Schema$TargetHttpsProxy[]; + /** + * Type of resource. Always compute#targetHttpsProxyList for lists of target + * HTTPS proxies. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * A TargetInstance resource. This resource defines an endpoint instance that + * terminates traffic of certain protocols. (== resource_for + * beta.targetInstances ==) (== resource_for v1.targetInstances ==) + */ + export interface Schema$TargetInstance { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A URL to the virtual machine instance that handles traffic for this + * target instance. When creating a target instance, you can provide the + * fully-qualified URL or a valid partial URL to the desired virtual + * machine. For example, the following are all valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + * - projects/project/zones/zone/instances/instance - + * zones/zone/instances/instance + */ + instance: string; + /** + * [Output Only] The type of the resource. Always compute#targetInstance for + * target instances. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * NAT option controlling how IPs are NAT'ed to the instance. Currently + * only NO_NAT (default value) is supported. + */ + natPolicy: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] URL of the zone where the target instance resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + zone: string; + } + export interface Schema$TargetInstanceAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: any; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetInstance resources. + */ + export interface Schema$TargetInstanceList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetInstance resources. + */ + items: Schema$TargetInstance[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetInstancesScopedList { + /** + * A list of target instances contained in this scope. + */ + targetInstances: Schema$TargetInstance[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + /** + * A TargetPool resource. This resource defines a pool of instances, an + * associated HttpHealthCheck resource, and the fallback target pool. (== + * resource_for beta.targetPools ==) (== resource_for v1.targetPools ==) + */ + export interface Schema$TargetPool { + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool, and its failoverRatio field is + * properly set to a value between [0, 1]. backupPool and failoverRatio + * together define the fallback behavior of the primary target pool: if the + * ratio of the healthy instances in the primary pool is at or below + * failoverRatio, traffic arriving at the load-balanced IP will be directed + * to the backup pool. In case where failoverRatio and backupPool are not + * set, or all the instances in the backup pool are unhealthy, the traffic + * will be directed back to the primary pool in the "force" mode, + * where traffic will be spread to the healthy instances with the best + * effort, or to all instances when no instance is healthy. + */ + backupPool: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * This field is applicable only when the containing target pool is serving + * a forwarding rule as the primary pool (i.e., not as a backup pool to some + * other target pool). The value of the field must be in [0, 1]. If set, + * backupPool must also be set. They together define the fallback behavior + * of the primary target pool: if the ratio of the healthy instances in the + * primary pool is at or below this number, traffic arriving at the + * load-balanced IP will be directed to the backup pool. In case where + * failoverRatio is not set or all the instances in the backup pool are + * unhealthy, the traffic will be directed back to the primary pool in the + * "force" mode, where traffic will be spread to the healthy + * instances with the best effort, or to all instances when no instance is + * healthy. + */ + failoverRatio: number; + /** + * The URL of the HttpHealthCheck resource. A member instance in this pool + * is considered healthy if and only if the health checks pass. An empty + * list means all member instances will be considered healthy at all times. + * Only HttpHealthChecks are supported. Only one health check may be + * specified. + */ + healthChecks: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * A list of resource URLs to the virtual machine instances serving this + * pool. They must live in zones contained in the same region as this pool. + */ + instances: string[]; + /** + * [Output Only] Type of the resource. Always compute#targetPool for target + * pools. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * [Output Only] URL of the region where the target pool resides. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Sesssion affinity option, must be one of the following values: NONE: + * Connections from the same client IP may go to any instance in the pool. + * CLIENT_IP: Connections from the same client IP will go to the same + * instance in the pool while that instance remains healthy. + * CLIENT_IP_PROTO: Connections from the same client IP with the same IP + * protocol will go to the same instance in the pool while that instance + * remains healthy. + */ + sessionAffinity: string; + } + export interface Schema$TargetPoolAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetPoolAggregatedList + * for aggregated lists of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolInstanceHealth { + healthStatus: Schema$HealthStatus[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolInstanceHealth + * when checking the health of an instance. + */ + kind: string; + } + /** + * Contains a list of TargetPool resources. + */ + export interface Schema$TargetPoolList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetPool resources. + */ + items: Schema$TargetPool[]; + /** + * [Output Only] Type of resource. Always compute#targetPoolList for lists + * of target pools. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetPoolsAddHealthCheckRequest { + /** + * The HttpHealthCheck to add to the target pool. + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsAddInstanceRequest { + /** + * A full or partial URL to an instance to add to this target pool. This can + * be a full or partial URL. For example, the following are valid URLs: - + * https://www.googleapis.com/compute/v1/projects/project-id/zones/zone/instances/instance-name + * - projects/project-id/zones/zone/instances/instance-name - + * zones/zone/instances/instance-name + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsRemoveHealthCheckRequest { + /** + * Health check URL to be removed. This can be a full or valid partial URL. + * For example, the following are valid URLs: - + * https://www.googleapis.com/compute/beta/projects/project/global/httpHealthChecks/health-check + * - projects/project/global/httpHealthChecks/health-check - + * global/httpHealthChecks/health-check + */ + healthChecks: Schema$HealthCheckReference[]; + } + export interface Schema$TargetPoolsRemoveInstanceRequest { + /** + * URLs of the instances to be removed from target pool. + */ + instances: Schema$InstanceReference[]; + } + export interface Schema$TargetPoolsScopedList { + /** + * A list of target pools contained in this scope. + */ + targetPools: Schema$TargetPool[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$TargetReference { target: string; } + export interface Schema$TargetSslProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetSslProxy. + */ + service: string; + } + export interface Schema$TargetSslProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + export interface Schema$TargetSslProxiesSetSslCertificatesRequest { + /** + * New set of URLs to SslCertificate resources to associate with this + * TargetSslProxy. Currently exactly one ssl certificate must be specified. + */ + sslCertificates: string[]; + } + /** + * A TargetSslProxy resource. This resource defines an SSL proxy. (== + * resource_for beta.targetSslProxies ==) (== resource_for v1.targetSslProxies + * ==) + */ + export interface Schema$TargetSslProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetSslProxy for + * target SSL proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + /** + * URLs to SslCertificate resources that are used to authenticate + * connections to Backends. Currently exactly one SSL certificate must be + * specified. + */ + sslCertificates: string[]; + /** + * URL of SslPolicy resource that will be associated with the TargetSslProxy + * resource. If not set, the TargetSslProxy resource will not have any SSL + * policy configured. + */ + sslPolicy: string; + } + /** + * Contains a list of TargetSslProxy resources. + */ + export interface Schema$TargetSslProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetSslProxy resources. + */ + items: Schema$TargetSslProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetTcpProxiesSetBackendServiceRequest { + /** + * The URL of the new BackendService resource for the targetTcpProxy. + */ + service: string; + } + export interface Schema$TargetTcpProxiesSetProxyHeaderRequest { + /** + * The new type of proxy header to append before sending data to the + * backend. NONE or PROXY_V1 are allowed. + */ + proxyHeader: string; + } + /** + * A TargetTcpProxy resource. This resource defines a TCP proxy. (== + * resource_for beta.targetTcpProxies ==) (== resource_for v1.targetTcpProxies + * ==) + */ + export interface Schema$TargetTcpProxy { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#targetTcpProxy for + * target TCP proxies. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * URL to the BackendService resource. + */ + service: string; + } + /** + * Contains a list of TargetTcpProxy resources. + */ + export interface Schema$TargetTcpProxyList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetTcpProxy resources. + */ + items: Schema$TargetTcpProxy[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Represents a Target VPN gateway resource. (== resource_for + * beta.targetVpnGateways ==) (== resource_for v1.targetVpnGateways ==) + */ + export interface Schema$TargetVpnGateway { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] A list of URLs to the ForwardingRule resources. + * ForwardingRules are created using compute.forwardingRules.insert and + * associated to a VPN gateway. + */ + forwardingRules: string[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * URL of the network to which this VPN gateway is attached. Provided by the + * client when the VPN gateway is created. + */ + network: string; + /** + * [Output Only] URL of the region where the target VPN gateway resides. You + * must specify this field as part of the HTTP request URL. It is not + * settable as a field in the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The status of the VPN gateway. + */ + status: string; + /** + * [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are + * created using compute.vpntunnels.insert method and associated to a VPN + * gateway. + */ + tunnels: string[]; + } + export interface Schema$TargetVpnGatewayAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of TargetVpnGateway resources. + */ + export interface Schema$TargetVpnGatewayList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of TargetVpnGateway resources. + */ + items: Schema$TargetVpnGateway[]; + /** + * [Output Only] Type of resource. Always compute#targetVpnGateway for + * target VPN gateways. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$TargetVpnGatewaysScopedList { + /** + * [Output Only] A list of target vpn gateways contained in this scope. + */ + targetVpnGateways: Schema$TargetVpnGateway[]; + /** + * [Output Only] Informational warning which replaces the list of addresses + * when the list is empty. + */ + warning: any; + } + export interface Schema$TCPHealthCheck { + /** + * The TCP port number for the health check request. The default value + * is 80. Valid values are 1 through 65535. + */ + port: number; + /** + * Port name as defined in InstanceGroup#NamedPort#name. If both port and + * port_name are defined, port takes precedence. + */ + portName: string; + /** + * Specifies the type of proxy header to append before sending data to the + * backend, either NONE or PROXY_V1. The default is NONE. + */ + proxyHeader: string; + /** + * The application data to send once the TCP connection has been established + * (default value is empty). If both request and response are empty, the + * connection establishment alone will indicate health. The request data can + * only be ASCII. + */ + request: string; + /** + * The bytes to match against the beginning of the response data. If left + * empty (the default value), any response will indicate health. The + * response data can only be ASCII. + */ + response: string; + } + export interface Schema$TestFailure { + actualService: string; + expectedService: string; + host: string; + path: string; + } + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; + } + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } + /** + * A UrlMap resource. This resource defines the mapping from URL to the + * BackendService resource, based on the "longest-match" of the + * URL's host and path. + */ + export interface Schema$UrlMap { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * The URL of the BackendService resource if none of the hostRules match. + */ + defaultService: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * Fingerprint of this resource. A hash of the contents stored in this + * object. This field is used in optimistic locking. This field will be + * ignored when inserting a UrlMap. An up-to-date fingerprint must be + * provided in order to update the UrlMap. + */ + fingerprint: string; + /** + * The list of HostRules to use against the URL. + */ + hostRules: Schema$HostRule[]; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#urlMaps for url maps. + */ + kind: string; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * The list of named PathMatchers to use against the URL. + */ + pathMatchers: Schema$PathMatcher[]; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * The list of expected URL mapping tests. Request to update this UrlMap + * will succeed only if all of the test cases pass. You can specify a + * maximum of 100 tests per UrlMap. + */ + tests: Schema$UrlMapTest[]; + } + /** + * Contains a list of UrlMap resources. + */ + export interface Schema$UrlMapList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of UrlMap resources. + */ + items: Schema$UrlMap[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$UrlMapReference { urlMap: string; } + export interface Schema$UrlMapsValidateRequest { + /** + * Content of the UrlMap to be validated. + */ + resource: Schema$UrlMap; + } + export interface Schema$UrlMapsValidateResponse { + result: Schema$UrlMapValidationResult; + } + /** + * Message for the expected URL mappings. + */ + export interface Schema$UrlMapTest { + /** + * Description of this test case. + */ + description: string; + /** + * Host portion of the URL. + */ + host: string; + /** + * Path portion of the URL. + */ + path: string; + /** + * Expected BackendService resource the given URL should be mapped to. + */ + service: string; + } + /** + * Message representing the validation result for a UrlMap. + */ + export interface Schema$UrlMapValidationResult { + loadErrors: string[]; + /** + * Whether the given UrlMap can be successfully loaded. If false, + * 'loadErrors' indicates the reasons. + */ + loadSucceeded: boolean; + testFailures: Schema$TestFailure[]; + /** + * If successfully loaded, this field indicates whether the test passed. If + * false, 'testFailures's indicate the reason of failure. + */ + testPassed: boolean; + } + /** + * The location in Cloud Storage and naming method of the daily usage report. + * Contains bucket_name and report_name prefix. + */ + export interface Schema$UsageExportLocation { + /** + * The name of an existing bucket in Cloud Storage where the usage report + * object is stored. The Google Service Account is granted write access to + * this bucket. This can either be the bucket name by itself, such as + * example-bucket, or the bucket name with gs:// or + * https://storage.googleapis.com/ in front of it, such as + * gs://example-bucket. + */ + bucketName: string; + /** + * An optional prefix for the name of the usage report object stored in + * bucketName. If not supplied, defaults to usage. The report is stored as a + * CSV file named report_name_prefix_gce_YYYYMMDD.csv where YYYYMMDD is the + * day of the usage according to Pacific Time. If you supply a prefix, it + * should conform to Cloud Storage object naming conventions. + */ + reportNamePrefix: string; + } + /** + * VPN tunnel resource. (== resource_for beta.vpnTunnels ==) (== resource_for + * v1.vpnTunnels ==) + */ + export interface Schema$VpnTunnel { + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional description of this resource. Provide this property when you + * create the resource. + */ + description: string; + /** + * [Output Only] Detailed status message for the VPN tunnel. + */ + detailedStatus: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * IKE protocol version to use when establishing the VPN tunnel with peer + * VPN gateway. Acceptable IKE versions are 1 or 2. Default version is 2. + */ + ikeVersion: number; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * Local traffic selector to use when establishing the VPN tunnel with peer + * VPN gateway. The value should be a CIDR formatted string, for example: + * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported. + */ + localTrafficSelector: string[]; + /** + * Name of the resource. Provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * IP address of the peer VPN gateway. Only IPv4 is supported. + */ + peerIp: string; + /** + * [Output Only] URL of the region where the VPN tunnel resides. You must + * specify this field as part of the HTTP request URL. It is not settable as + * a field in the request body. + */ + region: string; + /** + * Remote traffic selectors to use when establishing the VPN tunnel with + * peer VPN gateway. The value should be a CIDR formatted string, for + * example: 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is + * supported. + */ + remoteTrafficSelector: string[]; + /** + * URL of router resource to be used for dynamic routing. + */ + router: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * Shared secret used to set the secure session between the Cloud VPN + * gateway and the peer VPN gateway. + */ + sharedSecret: string; + /** + * Hash of the shared secret. + */ + sharedSecretHash: string; + /** + * [Output Only] The status of the VPN tunnel. + */ + status: string; + /** + * URL of the Target VPN gateway with which this VPN tunnel is associated. + * Provided by the client when the VPN tunnel is created. + */ + targetVpnGateway: string; + } + export interface Schema$VpnTunnelAggregatedList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnelsScopedList resources. + */ + items: any; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + /** + * Contains a list of VpnTunnel resources. + */ + export interface Schema$VpnTunnelList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of VpnTunnel resources. + */ + items: Schema$VpnTunnel[]; + /** + * [Output Only] Type of resource. Always compute#vpnTunnel for VPN tunnels. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$VpnTunnelsScopedList { + /** + * A list of vpn tunnels contained in this scope. + */ + vpnTunnels: Schema$VpnTunnel[]; + /** + * Informational warning which replaces the list of addresses when the list + * is empty. + */ + warning: any; + } + export interface Schema$XpnHostList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * [Output Only] A list of shared VPC host project URLs. + */ + items: Schema$Project[]; + /** + * [Output Only] Type of resource. Always compute#xpnHostList for lists of + * shared VPC hosts. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; } - - /** - * compute.zones.list - * @desc Retrieves the list of Zone resources available to the specified - * project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Compute Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/compute - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var compute = google.compute('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * compute.zones.list(request, handlePage); - * } - * }; - * - * compute.zones.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias compute.zones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project Project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Service resource (a.k.a service project) ID. */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/compute/v1/projects/{project}/zones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$XpnResourceId { + /** + * The ID of the service resource. In the case of projects, this field + * matches the project ID (e.g., my-project), not the project number (e.g., + * 12345678). + */ + id: string; + /** + * The type of the service resource. + */ + type: string; + } + /** + * A Zone resource. (== resource_for beta.zones ==) (== resource_for v1.zones + * ==) + */ + export interface Schema$Zone { + /** + * [Output Only] Available cpu/platform selections for the zone. + */ + availableCpuPlatforms: string[]; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * [Output Only] The deprecation status associated with this zone. + */ + deprecated: Schema$DeprecationStatus; + /** + * [Output Only] Textual description of the resource. + */ + description: string; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] Type of the resource. Always compute#zone for zones. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] Full URL reference to the region which hosts the zone. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the zone, either UP or DOWN. + */ + status: string; + } + /** + * Contains a list of zone resources. + */ + export interface Schema$ZoneList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * A list of Zone resources. + */ + items: Schema$Zone[]; + /** + * Type of resource. + */ + kind: string; + /** + * [Output Only] This token allows you to get the next page of results for + * list requests. If the number of results is larger than maxResults, use + * the nextPageToken as a value for the query parameter pageToken in the + * next list request. Subsequent list requests will have their own + * nextPageToken to continue paging through the results. + */ + nextPageToken: string; + /** + * [Output Only] Server-defined URL for this resource. + */ + selfLink: string; + /** + * [Output Only] Informational warning message. + */ + warning: any; + } + export interface Schema$ZoneSetLabelsRequest { + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Compute + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash in order to update or + * change labels. Make a get() request to the resource to get the latest + * fingerprint. + */ + labelFingerprint: string; + /** + * The labels to set for this resource. + */ + labels: any; + } + + export class Resource$Acceleratortypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.acceleratorTypes.aggregatedList + * @desc Retrieves an aggregated list of accelerator types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.acceleratorTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.acceleratorTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/aggregated/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.acceleratorTypes.get + * @desc Returns the specified accelerator type. Get a list of available + * accelerator types by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the accelerator type to return. + * acceleratorType: 'my-accelerator-type', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.acceleratorTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.acceleratorType Name of the accelerator type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes/{acceleratorType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'acceleratorType'], + pathParams: ['acceleratorType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.acceleratorTypes.list + * @desc Retrieves a list of accelerator types available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.acceleratorTypes.list(request, handlePage); + * } + * }; + * + * compute.acceleratorTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.acceleratorTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Addresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.addresses.aggregatedList + * @desc Retrieves an aggregated list of addresses. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.addresses.aggregatedList(request, handlePage); + * } + * }; + * + * compute.addresses.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.delete + * @desc Deletes the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the address resource to delete. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.addresses.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.get + * @desc Returns the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the address resource to return. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.addresses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'address'], + pathParams: ['address', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.addresses.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.addresses.list + * @desc Retrieves a list of addresses contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.addresses.list(request, handlePage); + * } + * }; + * + * compute.addresses.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.addresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Autoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.autoscalers.aggregatedList + * @desc Retrieves an aggregated list of autoscalers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.autoscalers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.autoscalers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.delete + * @desc Deletes the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the autoscaler to delete. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.autoscalers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.get + * @desc Returns the specified autoscaler resource. Get a list of available + * autoscalers by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the autoscaler to return. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.autoscalers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.autoscalers.list(request, handlePage); + * } + * }; + * + * compute.autoscalers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.autoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.autoscalers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.autoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone for this request. + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendbuckets { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendBuckets.delete + * @desc Deletes the specified BackendBucket resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to delete. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendBuckets.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.get + * @desc Returns the specified BackendBucket resource. Get a list of + * available backend buckets by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to return. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendBuckets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.insert + * @desc Creates a BackendBucket resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.list + * @desc Retrieves the list of BackendBucket resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendBuckets.list(request, handlePage); + * } + * }; + * + * compute.backendBuckets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.patch + * @desc Updates the specified BackendBucket resource with the data included + * in the request. This method supports PATCH semantics and uses the JSON + * merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to patch. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendBuckets.update + * @desc Updates the specified BackendBucket resource with the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendBucket resource to update. + * backendBucket: 'my-backend-bucket', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.backendBuckets.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendBuckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendBucket Name of the BackendBucket resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendBucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendBuckets/{backendBucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendBucket'], + pathParams: ['backendBucket', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Backendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.backendServices.aggregatedList + * @desc Retrieves the list of all BackendService resources, regional and + * global, available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the project scoping this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendServices.aggregatedList(request, handlePage); + * } + * }; + * + * compute.backendServices.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Name of the project scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.backendServices.delete + * @desc Deletes the specified BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to delete. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendServices.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.get + * @desc Returns the specified BackendService resource. Get a list of + * available backend services by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to return. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.backendServices.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.getHealth + * @desc Gets the most recent health check results for this BackendService. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to which the queried instance + * belongs. backendService: 'my-backend-service', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.getHealth(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to which the queried instance belongs. + * @param {string} params.project + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.insert + * @desc Creates a BackendService resource in the specified project using + * the data included in the request. There are several restrictions and + * guidelines to keep in mind when creating a backend service. Read + * Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.list + * @desc Retrieves the list of BackendService resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.backendServices.list(request, handlePage); + * } + * }; + * + * compute.backendServices.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.patch + * @desc Patches the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to patch. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.backendServices.update + * @desc Updates the specified BackendService resource with the data + * included in the request. There are several restrictions and guidelines to + * keep in mind when updating a backend service. Read Restrictions and + * Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to update. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.backendServices.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.backendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'backendService'], + pathParams: ['backendService', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.disks.aggregatedList + * @desc Retrieves an aggregated list of persistent disks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.disks.aggregatedList(request, handlePage); + * } + * }; + * + * compute.disks.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/aggregated/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.createSnapshot + * @desc Creates a snapshot of a specified persistent disk. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to snapshot. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.createSnapshot(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.createSnapshot + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to snapshot. + * @param {boolean=} params.guestFlush + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Snapshot} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createSnapshot(params?: any, options?: MethodOptions): + AxiosPromise; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createSnapshot( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/createSnapshot') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.delete + * @desc Deletes the specified persistent disk. Deleting a disk removes its + * data permanently and is irreversible. However, deleting a disk does not + * delete any snapshots previously made from the disk. You must separately + * delete snapshots. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to delete. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.disks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.get + * @desc Returns a specified persistent disk. Get a list of available + * persistent disks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the persistent disk to return. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.disks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk Name of the persistent disk to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.insert + * @desc Creates a persistent disk in the specified project using the data + * in the request. You can create a disk with a sourceImage, a + * sourceSnapshot, or create an empty 500 GB data disk by omitting all + * properties. You can also create a disk that is larger than the default + * size by specifying the sizeGb property. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceImage Optional. Source image to restore onto a disk. + * @param {string} params.zone The name of the zone for this request. + * @param {().Disk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.list + * @desc Retrieves a list of persistent disks contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.disks.list(request, handlePage); + * } + * }; + * + * compute.disks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.resize + * @desc Resizes the specified persistent disk. You can only increase the + * size of the disk. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the persistent disk. + * disk: 'my-disk', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.resize(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.disk The name of the persistent disk. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().DisksResizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks/{disk}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'disk'], + pathParams: ['disk', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.disks.setLabels + * @desc Sets the labels on a disk. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.disks.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.disks.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {().ZoneSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/disks/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Disktypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.diskTypes.aggregatedList + * @desc Retrieves an aggregated list of disk types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.diskTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.diskTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.get + * @desc Returns the specified disk type. Get a list of available disk types + * by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the disk type to return. + * diskType: 'my-disk-type', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.diskTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.diskType Name of the disk type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/diskTypes/{diskType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'diskType'], + pathParams: ['diskType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.diskTypes.list + * @desc Retrieves a list of disk types available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.diskTypes.list(request, handlePage); + * } + * }; + * + * compute.diskTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.diskTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/diskTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Firewalls { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.firewalls.delete + * @desc Deletes the specified firewall. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to delete. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.firewalls.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.get + * @desc Returns the specified firewall. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to return. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.firewalls.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.insert + * @desc Creates a firewall rule in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.list + * @desc Retrieves the list of firewall rules available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.firewalls.list(request, handlePage); + * } + * }; + * + * compute.firewalls.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/firewalls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.patch + * @desc Updates the specified firewall rule with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to patch. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.firewalls.update + * @desc Updates the specified firewall rule with the data included in the + * request. The PUT method can only update the following fields of firewall + * rule: allowed, description, sourceRanges, sourceTags, targetTags. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the firewall rule to update. + * firewall: 'my-firewall', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.firewalls.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.firewalls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.firewall Name of the firewall rule to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Firewall} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/firewalls/{firewall}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'firewall'], + pathParams: ['firewall', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Forwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.forwardingRules.aggregatedList + * @desc Retrieves an aggregated list of forwarding rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.forwardingRules.aggregatedList(request, handlePage); + * } + * }; + * + * compute.forwardingRules.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.forwardingRules.delete + * @desc Deletes the specified ForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to delete. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.forwardingRules.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.get + * @desc Returns the specified ForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to return. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.forwardingRules.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.insert + * @desc Creates a ForwardingRule resource in the specified project and + * region using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.list + * @desc Retrieves a list of ForwardingRule resources available to the + * specified project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.forwardingRules.list(request, handlePage); + * } + * }; + * + * compute.forwardingRules.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.forwardingRules.setTarget + * @desc Changes target URL for forwarding rule. The new target should be of + * the same type as the old target. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.forwardingRules.setTarget(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.forwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'forwardingRule'], + pathParams: ['forwardingRule', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaladdresses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalAddresses.delete + * @desc Deletes the specified address resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the address resource to delete. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalAddresses.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.get + * @desc Returns the specified address resource. Get a list of available + * addresses by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the address resource to return. + * address: 'my-address', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalAddresses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.address Name of the address resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/addresses/{address}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'address'], + pathParams: ['address', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.insert + * @desc Creates an address resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalAddresses.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Address} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalAddresses.list + * @desc Retrieves a list of global addresses. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalAddresses.list(request, handlePage); + * } + * }; + * + * compute.globalAddresses.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalAddresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/addresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globalforwardingrules { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalForwardingRules.delete + * @desc Deletes the specified GlobalForwardingRule resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to delete. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.get + * @desc Returns the specified GlobalForwardingRule resource. Get a list of + * available forwarding rules by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource to return. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.insert + * @desc Creates a GlobalForwardingRule resource in the specified project + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ForwardingRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.list + * @desc Retrieves a list of GlobalForwardingRule resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalForwardingRules.list(request, handlePage); + * } + * }; + * + * compute.globalForwardingRules.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/forwardingRules') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalForwardingRules.setTarget + * @desc Changes target URL for the GlobalForwardingRule resource. The new + * target should be of the same type as the old target. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the ForwardingRule resource in which target is to be set. + * forwardingRule: 'my-forwarding-rule', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.globalForwardingRules.setTarget(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalForwardingRules.setTarget + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingRule Name of the ForwardingRule resource in which target is to be set. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTarget(params?: any, options?: MethodOptions): + AxiosPromise; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTarget( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/forwardingRules/{forwardingRule}/setTarget') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'forwardingRule'], + pathParams: ['forwardingRule', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Globaloperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.globalOperations.aggregatedList + * @desc Retrieves an aggregated list of all operations. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalOperations.aggregatedList(request, handlePage); + * } + * }; + * + * compute.globalOperations.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.delete + * @desc Deletes the specified Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.get + * @desc Retrieves the specified Operations resource. Get a list of + * operations by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.globalOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.globalOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.globalOperations.list(request, handlePage); + * } + * }; + * + * compute.globalOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.globalOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/v1/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Healthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.healthChecks.delete + * @desc Deletes the specified HealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to delete. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.healthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.get + * @desc Returns the specified HealthCheck resource. Get a list of available + * health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to return. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.healthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.insert + * @desc Creates a HealthCheck resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.list + * @desc Retrieves the list of HealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.healthChecks.list(request, handlePage); + * } + * }; + * + * compute.healthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.patch + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. This method supports PATCH semantics and + * uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to patch. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.healthChecks.update + * @desc Updates a HealthCheck resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HealthCheck resource to update. + * healthCheck: 'my-health-check', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.healthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.healthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.healthCheck Name of the HealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/healthChecks/{healthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'healthCheck'], + pathParams: ['healthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httphealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpHealthChecks.delete + * @desc Deletes the specified HttpHealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to delete. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.get + * @desc Returns the specified HttpHealthCheck resource. Get a list of + * available HTTP health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to return. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.insert + * @desc Creates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.list + * @desc Retrieves the list of HttpHealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.httpHealthChecks.list(request, handlePage); + * } + * }; + * + * compute.httpHealthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.patch + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to patch. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpHealthChecks.update + * @desc Updates a HttpHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpHealthCheck resource to update. + * httpHealthCheck: 'my-http-health-check', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.httpHealthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpHealthCheck Name of the HttpHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpHealthChecks/{httpHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpHealthCheck'], + pathParams: ['httpHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Httpshealthchecks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.httpsHealthChecks.delete + * @desc Deletes the specified HttpsHealthCheck resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to delete. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.get + * @desc Returns the specified HttpsHealthCheck resource. Get a list of + * available HTTPS health checks by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to return. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.insert + * @desc Creates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.list + * @desc Retrieves the list of HttpsHealthCheck resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.httpsHealthChecks.list(request, handlePage); + * } + * }; + * + * compute.httpsHealthChecks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.patch + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. This method supports PATCH semantics + * and uses the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to patch. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.httpsHealthChecks.update + * @desc Updates a HttpsHealthCheck resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the HttpsHealthCheck resource to update. + * httpsHealthCheck: 'my-https-health-check', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.httpsHealthChecks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.httpsHealthChecks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.httpsHealthCheck Name of the HttpsHealthCheck resource to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().HttpsHealthCheck} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/httpsHealthChecks/{httpsHealthCheck}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'httpsHealthCheck'], + pathParams: ['httpsHealthCheck', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Images { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.images.delete + * @desc Deletes the specified image. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image resource to delete. + * image: 'my-image', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.deprecate + * @desc Sets the deprecation status of an image. If an empty request body + * is given, clears the deprecation status instead. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Image name. + * image: 'my-image', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.deprecate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.deprecate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Image name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DeprecationStatus} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deprecate(params?: any, options?: MethodOptions): + AxiosPromise; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deprecate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/images/{image}/deprecate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.get + * @desc Returns the specified image. Get a list of available images by + * making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image resource to return. + * image: 'my-image', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.image Name of the image resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/images/{image}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'image'], + pathParams: ['image', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.getFromFamily + * @desc Returns the latest image that is part of an image family and is not + * deprecated. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the image family to search for. + * family: 'my-family', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.images.getFromFamily(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.getFromFamily + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.family Name of the image family to search for. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getFromFamily(params?: any, options?: MethodOptions): + AxiosPromise; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getFromFamily( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/images/family/{family}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'family'], + pathParams: ['family', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.insert + * @desc Creates an image in the specified project using the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.forceCreate Force image creation if true. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Image} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.list + * @desc Retrieves the list of custom images available to the specified + * project. Custom images are images you create that belong to your project. + * This method does not get any images that belong to other projects, + * including publicly-available images, like Debian 8. If you want to get a + * list of publicly-available images, use this method to make a request to + * the respective image project, such as debian-cloud or windows-cloud. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.images.list(request, handlePage); + * } + * }; + * + * compute.images.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/images') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.images.setLabels + * @desc Sets the labels on an image. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.images.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.images.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/images/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.abandonInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.aggregatedList + * @desc Retrieves the list of managed instance groups and groups them by + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instanceGroupManagers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/aggregated/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. Note that the instance group must not belong to + * a backend service. Read Deleting an instance group for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group to delete. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.deleteInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. Gets a list of available managed instance groups by making a + * list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A managed instance group can have up to + * 1000 VM instances per group. Please contact Cloud Support if you need an + * increase in this limit. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the managed instance + * group. zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the managed instance group. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.list + * @desc Retrieves a list of managed instance groups that are contained + * within the specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroupManagers.list(request, handlePage); + * } + * }; + * + * compute.instanceGroupManagers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.listManagedInstances + * @desc Lists all of the instances in the managed instance group. Each + * instance in the list has a currentAction, which indicates the action that + * the managed instance group is performing on the instance. For example, if + * the group is still creating an instance, the currentAction is CREATING. + * If a previous action failed, the list displays the errors for that failed + * action. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.listManagedInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>, + callback?: BodyResponseCallback< + Schema$InstanceGroupManagersListManagedInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$InstanceGroupManagersListManagedInstancesResponse>( + parameters); + } + } + + + /** + * compute.instanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.recreateInstances(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.resize + * @desc Resizes the managed instance group. If you increase the size, the + * group creates new instances using the current instance template. If you + * decrease the size, the group deletes instances. The resize operation is + * marked DONE when the resize actions are scheduled even if the group has + * not yet added or deleted any instances. You must separately verify the + * status of the creating or deleting actions with the listmanagedinstances + * method. If the group is part of a backend service that has enabled + * connection draining, it can take up to 60 seconds after the connection + * draining duration has elapsed before the VM instance is removed or + * deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * // The number of running instances that the managed instance group + * should maintain at any given time. + * // The group automatically adds or removes instances to maintain the + * number of instances specified by + * // this parameter. + * size: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.resize(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size The number of running instances that the managed instance group should maintain at any given time. The group automatically adds or removes instances to maintain the number of instances specified by this parameter. + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setInstanceTemplate + * @desc Specifies the instance template to use when creating new instances + * in this group. The templates for existing instances in the group do not + * change unless you recreate them. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.setInstanceTemplate(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all instances in this managed + * instance group are assigned. The target pools automatically apply to all + * of the instances in the managed instance group. This operation is marked + * DONE when you make the request even if the instances have not yet been + * added to their target pools. The change might take some time to apply to + * all of the instances in the group depending on the size of the group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the managed instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroupManagers.setTargetPools(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the managed instance group is located. + * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceGroups.addInstances + * @desc Adds a list of instances to the specified instance group. All of + * the instances in the instance group must be in the same + * network/subnetwork. Read Adding instances for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where you are adding instances. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.addInstances(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.addInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where you are adding instances. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsAddInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstances(params?: any, options?: MethodOptions): + AxiosPromise; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/addInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.aggregatedList + * @desc Retrieves the list of instance groups and sorts them by zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instanceGroups.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.delete + * @desc Deletes the specified instance group. The instances in the group + * are not deleted. Note that instance group must not belong to a backend + * service. Read Deleting an instance group for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group to delete. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.instanceGroups.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.get + * @desc Returns the specified instance group. Get a list of available + * instance groups by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.instanceGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.insert + * @desc Creates an instance group in the specified project using the + * parameters that are included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where you want to create the instance group. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where you want to create the instance group. + * @param {().InstanceGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.list + * @desc Retrieves the list of instance groups that are located in the + * specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.list(request, handlePage); + * } + * }; + * + * compute.instanceGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.listInstances + * @desc Lists the instances in the specified instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group from which you want to generate a + * list of included instances. instanceGroup: 'my-instance-group', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceGroups.listInstances(request, handlePage); + * } + * }; + * + * compute.instanceGroups.listInstances(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup The name of the instance group from which you want to generate a list of included instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.removeInstances + * @desc Removes one or more instances from the specified instance group, + * but does not delete those instances. If the group is part of a backend + * service that has enabled connection draining, it can take up to 60 + * seconds after the connection draining duration before the VM instance is + * removed or deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where the specified instances will + * be removed. instanceGroup: 'my-instance-group', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.removeInstances(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.removeInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the specified instances will be removed. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsRemoveInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstances(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/removeInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceGroups.setNamedPorts + * @desc Sets the named ports for the specified instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone where the instance group is located. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the instance group where the named ports are updated. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceGroups.setNamedPorts(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone where the instance group is located. + * @param {().InstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instances.addAccessConfig + * @desc Adds an access config to an instance's network interface. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the network interface to add to this instance. + * networkInterface: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.addAccessConfig(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.addAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to add to this instance. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/addAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.aggregatedList + * @desc Retrieves aggregated list of instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instances.aggregatedList(request, handlePage); + * } + * }; + * + * compute.instances.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.attachDisk + * @desc Attaches an existing Disk resource to an instance. You must first + * create the disk before you can attach it. It is not possible to create + * and attach a disk at the same time. For more information, read Adding a + * persistent disk to your instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.attachDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.attachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AttachedDisk} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + attachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + attachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/attachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.delete + * @desc Deletes the specified Instance resource. For more information, see + * Stopping or Deleting an Instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to delete. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.deleteAccessConfig + * @desc Deletes an access config from an instance's network interface. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name for this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // The name of the access config to delete. + * accessConfig: '', // TODO: Update placeholder value. + * + * // The name of the network interface. + * networkInterface: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.deleteAccessConfig(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.deleteAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accessConfig The name of the access config to delete. + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/deleteAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'accessConfig', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.detachDisk + * @desc Detaches a disk from an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // Disk device name to detach. + * deviceName: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.detachDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.detachDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deviceName Disk device name to detach. + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detachDisk(params?: any, options?: MethodOptions): + AxiosPromise; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + detachDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/detachDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.get + * @desc Returns the specified Instance resource. Get a list of available + * instances by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to return. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.getSerialPortOutput + * @desc Returns the specified instance's serial port output. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.getSerialPortOutput(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.getSerialPortOutput + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {integer=} params.port Specifies which COM or serial port to retrieve data from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.start Returns output starting from a specific byte position. Use this to page through output when the output is too large to return in a single request. For the initial request, leave this field unspecified. For subsequent calls, this field should be set to the next value returned in the previous call. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSerialPortOutput(params?: any, options?: MethodOptions): + AxiosPromise; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getSerialPortOutput( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/serialPort') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.insert + * @desc Creates an instance resource in the specified project using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string=} params.sourceInstanceTemplate Specifies instance template to create the instance. This field is optional. It can be a full or partial URL. For example, the following are all valid URLs to an instance template: - https://www.googleapis.com/compute/v1/projects/project/global/global/instanceTemplates/instanceTemplate - projects/project/global/global/instanceTemplates/instanceTemplate - global/instancesTemplates/instanceTemplate + * @param {string} params.zone The name of the zone for this request. + * @param {().Instance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.list + * @desc Retrieves the list of instances contained within the specified + * zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instances.list(request, handlePage); + * } + * }; + * + * compute.instances.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.listReferrers + * @desc Retrieves the list of referrers to instances contained within the + * specified zone. + * @alias compute.instances.listReferrers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instance Name of the target instance scoping this request, or '-' if the request should span over all instances in the container. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listReferrers(params?: any, options?: MethodOptions): + AxiosPromise; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listReferrers( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/referrers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.reset + * @desc Performs a reset on the instance. For more information, see + * Resetting an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.reset(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDeletionProtection + * @desc Sets deletion protection on the instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.setDeletionProtection(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setDeletionProtection + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deletionProtection Whether the resource should be protected against deletion. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.resource_ Name of the resource for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDeletionProtection(params?: any, options?: MethodOptions): + AxiosPromise; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDeletionProtection( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{resource}/setDeletionProtection') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resource'], + pathParams: ['project', 'resource', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setDiskAutoDelete + * @desc Sets the auto-delete flag for a disk attached to an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * // Whether to auto-delete the disk when the instance is deleted. + * autoDelete: false, // TODO: Update placeholder value. + * + * // The device name of the disk to modify. + * deviceName: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.setDiskAutoDelete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setDiskAutoDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean} params.autoDelete Whether to auto-delete the disk when the instance is deleted. + * @param {string} params.deviceName The device name of the disk to modify. + * @param {string} params.instance The instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDiskAutoDelete(params?: any, options?: MethodOptions): + AxiosPromise; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDiskAutoDelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setDiskAutoDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'zone', 'instance', 'autoDelete', 'deviceName'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setLabels + * @desc Sets labels on an instance. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineResources + * @desc Changes the number and/or type of accelerator for a stopped + * instance to the values specified in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMachineResources(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMachineResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineResources(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMachineType + * @desc Changes the machine type for a stopped instance to the machine type + * specified in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMachineType(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMachineType + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMachineTypeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMachineType(params?: any, options?: MethodOptions): + AxiosPromise; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMachineType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMachineType') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMetadata + * @desc Sets metadata for the specified instance to the data included in + * the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMetadata(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setMinCpuPlatform + * @desc Changes the minimum CPU platform that this instance should use. + * This method can only be called on a stopped instance. For more + * information, read Specifying a Minimum CPU Platform. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setMinCpuPlatform(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setMinCpuPlatform + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetMinCpuPlatformRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMinCpuPlatform(params?: any, options?: MethodOptions): + AxiosPromise; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMinCpuPlatform( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setMinCpuPlatform') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setScheduling + * @desc Sets an instance's scheduling options. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Instance name. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setScheduling(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setScheduling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Instance name. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Scheduling} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setScheduling(params?: any, options?: MethodOptions): + AxiosPromise; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setScheduling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setScheduling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setServiceAccount + * @desc Sets the service account on the instance. For more information, + * read Changing the service account and access scopes for an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setServiceAccount(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setServiceAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesSetServiceAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setServiceAccount(params?: any, options?: MethodOptions): + AxiosPromise; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setServiceAccount( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setServiceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.setTags + * @desc Sets tags for the specified instance to the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance scoping this request. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.setTags(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.setTags + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance scoping this request. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().Tags} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTags(params?: any, options?: MethodOptions): + AxiosPromise; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTags( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/setTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.start + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.start(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.startWithEncryptionKey + * @desc Starts an instance that was stopped using the using the + * instances().stop method. For more information, see Restart an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to start. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instances.startWithEncryptionKey(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.startWithEncryptionKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to start. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().InstancesStartWithEncryptionKeyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startWithEncryptionKey(params?: any, options?: MethodOptions): + AxiosPromise; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startWithEncryptionKey( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/startWithEncryptionKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.stop + * @desc Stops a running instance, shutting it down cleanly, and allows you + * to restart the instance at a later time. Stopped instances do not incur + * VM usage charges while they are stopped. However, resources that the VM + * is using, such as persistent disks and static IP addresses, will continue + * to be charged until they are deleted. For more information, see Stopping + * an instance. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the instance resource to stop. + * instance: 'my-instance', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.instances.stop(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instances.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Name of the instance resource to stop. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateAccessConfig + * @desc Updates the specified access config from an instance's network + * interface with the data included in the request. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @alias compute.instances.updateAccessConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface where the access config is attached. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().AccessConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateAccessConfig(params?: any, options?: MethodOptions): + AxiosPromise; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateAccessConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateAccessConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instances.updateNetworkInterface + * @desc Updates an instance's network interface. This method follows PATCH + * semantics. + * @alias compute.instances.updateNetworkInterface + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The instance name for this request. + * @param {string} params.networkInterface The name of the network interface to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone The name of the zone for this request. + * @param {().NetworkInterface} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateNetworkInterface(params?: any, options?: MethodOptions): + AxiosPromise; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateNetworkInterface( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/instances/{instance}/updateNetworkInterface') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'zone', 'instance', 'networkInterface'], + pathParams: ['instance', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Instancetemplates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.instanceTemplates.delete + * @desc Deletes the specified instance template. Deleting an instance + * template is permanent and cannot be undone. It's not possible to delete + * templates which are in use by an instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the instance template to delete. + * instanceTemplate: 'my-instance-template', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.get + * @desc Returns the specified instance template. Gets a list of available + * instance templates by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the instance template. + * instanceTemplate: 'my-instance-template', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceTemplate The name of the instance template. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/instanceTemplates/{instanceTemplate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instanceTemplate'], + pathParams: ['instanceTemplate', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.insert + * @desc Creates an instance template in the specified project using the + * data that is included in the request. If you are creating a new template + * to update an existing instance group, your new instance template must use + * the same network or, if applicable, the same subnetwork as the original + * template. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.instanceTemplates.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.instanceTemplates.list + * @desc Retrieves a list of instance templates that are contained within + * the specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.instanceTemplates.list(request, handlePage); + * } + * }; + * + * compute.instanceTemplates.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.instanceTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/instanceTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectattachments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectAttachments.aggregatedList + * @desc Retrieves an aggregated list of interconnect attachments. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectAttachments.aggregatedList(request, + * handlePage); + * } + * }; + * + * compute.interconnectAttachments.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/aggregated/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.interconnectAttachments.delete + * @desc Deletes the specified interconnect attachment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the interconnect attachment to delete. + * interconnectAttachment: 'my-interconnect-attachment', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.delete(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.get + * @desc Returns the specified interconnect attachment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the interconnect attachment to return. + * interconnectAttachment: 'my-interconnect-attachment', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectAttachment Name of the interconnect attachment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments/{interconnectAttachment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'interconnectAttachment'], + pathParams: ['interconnectAttachment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.insert + * @desc Creates an InterconnectAttachment in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnectAttachments.insert(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InterconnectAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectAttachments.list + * @desc Retrieves the list of interconnect attachments contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectAttachments.list(request, handlePage); + * } + * }; + * + * compute.interconnectAttachments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectAttachments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/interconnectAttachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnectlocations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnectLocations.get + * @desc Returns the details for the specified interconnect location. Get a + * list of available interconnect locations by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect location to return. + * interconnectLocation: 'my-interconnect-location', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnectLocations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectLocations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnectLocation Name of the interconnect location to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/interconnectLocations/{interconnectLocation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnectLocation'], + pathParams: ['interconnectLocation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnectLocations.list + * @desc Retrieves the list of interconnect locations available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnectLocations.list(request, handlePage); + * } + * }; + * + * compute.interconnectLocations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnectLocations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/interconnectLocations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Interconnects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.interconnects.delete + * @desc Deletes the specified interconnect. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to delete. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnects.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.get + * @desc Returns the specified interconnect. Get a list of available + * interconnects by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to return. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.interconnects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.insert + * @desc Creates a Interconnect in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnects.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.list + * @desc Retrieves the list of interconnect available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.interconnects.list(request, handlePage); + * } + * }; + * + * compute.interconnects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/interconnects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.interconnects.patch + * @desc Updates the specified interconnect with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the interconnect to update. + * interconnect: 'my-interconnect', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.interconnects.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.interconnects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.interconnect Name of the interconnect to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Interconnect} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/interconnects/{interconnect}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'interconnect'], + pathParams: ['interconnect', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licensecodes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenseCodes.get + * @desc Return a specified license code. License codes are mirrored across + * all projects that have permissions to read the License Code. + * @alias compute.licenseCodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.licenseCode Number corresponding to the License code resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/licenseCodes/{licenseCode}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'licenseCode'], + pathParams: ['licenseCode', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenseCodes.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.licenseCodes.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/licenseCodes/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Licenses { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.licenses.delete + * @desc Deletes the specified license. + * @alias compute.licenses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the license resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.get + * @desc Returns the specified License resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the License resource to return. + * license: 'my-license', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.licenses.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.licenses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.license Name of the License resource to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/licenses/{license}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'license'], + pathParams: ['license', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.insert + * @desc Create a License resource in the specified project. + * @alias compute.licenses.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().License} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.list + * @desc Retrieves the list of licenses available in the specified project. + * This method does not get any licenses that belong to other projects, + * including licenses attached to publicly-available images, like Debian 8. + * If you want to get a list of publicly-available licenses, use this method + * to make a request to the respective image project, such as debian-cloud + * or windows-cloud. + * @alias compute.licenses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/licenses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.licenses.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias compute.licenses.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/licenses/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Machinetypes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.machineTypes.aggregatedList + * @desc Retrieves an aggregated list of machine types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.machineTypes.aggregatedList(request, handlePage); + * } + * }; + * + * compute.machineTypes.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.get + * @desc Returns the specified machine type. Gets a list of available + * machine types by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the machine type to return. + * machineType: 'my-machine-type', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.machineTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.machineType Name of the machine type to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/machineTypes/{machineType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'machineType'], + pathParams: ['machineType', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.machineTypes.list + * @desc Retrieves a list of machine types available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.machineTypes.list(request, handlePage); + * } + * }; + * + * compute.machineTypes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.machineTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone The name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/machineTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Networks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.networks.addPeering + * @desc Adds a peering to the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network resource to add peering to. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.addPeering(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.addPeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to add peering to. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksAddPeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addPeering(params?: any, options?: MethodOptions): + AxiosPromise; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addPeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}/addPeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.delete + * @desc Deletes the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to delete. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to delete. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.get + * @desc Returns the specified network. Get a list of available networks by + * making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to return. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to return. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.insert + * @desc Creates a network in the specified project using the data included + * in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.list + * @desc Retrieves the list of networks available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.networks.list(request, handlePage); + * } + * }; + * + * compute.networks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/networks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.patch + * @desc Patches the specified network with the data included in the + * request. Only the following fields can be modified: + * routingConfig.routingMode. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to update. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to update. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Network} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.removePeering + * @desc Removes a peering from the specified network. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network resource to remove peering from. + * network: 'my-network', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.networks.removePeering(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.removePeering + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network resource to remove peering from. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().NetworksRemovePeeringRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removePeering(params?: any, options?: MethodOptions): + AxiosPromise; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removePeering( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}/removePeering') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.networks.switchToCustomMode + * @desc Switches the network mode from auto subnet mode to custom subnet + * mode. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the network to be updated. + * network: 'my-network', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.networks.switchToCustomMode(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.networks.switchToCustomMode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.network Name of the network to be updated. + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + switchToCustomMode(params?: any, options?: MethodOptions): + AxiosPromise; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + switchToCustomMode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/networks/{network}/switchToCustomMode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'network'], + pathParams: ['network', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.projects.disableXpnHost + * @desc Disable this project as a shared VPC host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.disableXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.disableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/disableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.disableXpnResource + * @desc Disable a serivce resource (a.k.a service project) associated with + * this host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.disableXpnResource(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.disableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsDisableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/disableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnHost + * @desc Enable this project as a shared VPC host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.enableXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.enableXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/enableXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.enableXpnResource + * @desc Enable service resource (a.k.a service project) for a host project, + * so that subnets in the host project can be used by instances in the + * service project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.enableXpnResource(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.enableXpnResource + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().ProjectsEnableXpnResourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enableXpnResource(params?: any, options?: MethodOptions): + AxiosPromise; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enableXpnResource( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/compute/v1/projects/{project}/enableXpnResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.get + * @desc Returns the specified Project resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnHost + * @desc Gets the shared VPC host project that this project links to. May be + * empty if no link exists. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.projects.getXpnHost(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.getXpnHost + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnHost(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnHost( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/getXpnHost') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.getXpnResources + * @desc Gets service resources (a.k.a service project) associated with this + * host project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var resourcesPage = response['resources']; + * if (!resourcesPage) { + * return; + * } + * for (var i = 0; i < resourcesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.projects.getXpnResources(request, handlePage); + * } + * }; + * + * compute.projects.getXpnResources(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.getXpnResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getXpnResources(params?: any, options?: MethodOptions): + AxiosPromise; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getXpnResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/getXpnResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.listXpnHosts + * @desc Lists all shared VPC host projects visible to the user in an + * organization. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.projects.listXpnHosts(request, handlePage); + * } + * }; + * + * compute.projects.listXpnHosts(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.listXpnHosts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {().ProjectsListXpnHostsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listXpnHosts(params?: any, options?: MethodOptions): + AxiosPromise; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listXpnHosts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/listXpnHosts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveDisk + * @desc Moves a persistent disk from one zone to another. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.moveDisk(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.moveDisk + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().DiskMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveDisk(params?: any, options?: MethodOptions): + AxiosPromise; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveDisk( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/moveDisk') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.moveInstance + * @desc Moves an instance and its attached persistent disks from one zone + * to another. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.moveInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.moveInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceMoveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + moveInstance(params?: any, options?: MethodOptions): + AxiosPromise; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + moveInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/moveInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setCommonInstanceMetadata + * @desc Sets metadata common to all instances within the specified project + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.setCommonInstanceMetadata(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.setCommonInstanceMetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Metadata} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setCommonInstanceMetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setCommonInstanceMetadata( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/setCommonInstanceMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.projects.setUsageExportBucket + * @desc Enables the usage export feature and sets the usage export bucket + * where reports are stored. If you provide an empty request body using this + * method, the usage export feature will be disabled. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.projects.setUsageExportBucket(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.projects.setUsageExportBucket + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UsageExportLocation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUsageExportBucket(params?: any, options?: MethodOptions): + AxiosPromise; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUsageExportBucket( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/setUsageExportBucket') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionautoscalers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionAutoscalers.delete + * @desc Deletes the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the autoscaler to delete. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.get + * @desc Returns the specified autoscaler. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the autoscaler to return. + * autoscaler: 'my-autoscaler', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.autoscaler Name of the autoscaler to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers/{autoscaler}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'autoscaler'], + pathParams: ['autoscaler', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.insert + * @desc Creates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.list + * @desc Retrieves a list of autoscalers contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionAutoscalers.list(request, handlePage); + * } + * }; + * + * compute.regionAutoscalers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.patch + * @desc Updates an autoscaler in the specified project using the data + * included in the request. This method supports PATCH semantics and uses + * the JSON merge patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionAutoscalers.update + * @desc Updates an autoscaler in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.regionAutoscalers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionAutoscalers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.autoscaler Name of the autoscaler to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Autoscaler} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/autoscalers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionbackendservices { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionBackendServices.delete + * @desc Deletes the specified regional BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to delete. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.get + * @desc Returns the specified regional BackendService resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to return. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.getHealth + * @desc Gets the most recent health check results for this regional + * BackendService. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to which the queried instance + * belongs. backendService: 'my-backend-service', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.getHealth(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource for which to get health. + * @param {string} params.project + * @param {string} params.region Name of the region scoping this request. + * @param {().ResourceGroupReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.insert + * @desc Creates a regional BackendService resource in the specified project + * using the data included in the request. There are several restrictions + * and guidelines to keep in mind when creating a regional backend service. + * Read Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.list + * @desc Retrieves the list of regional BackendService resources available + * to the specified project in the given region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionBackendServices.list(request, handlePage); + * } + * }; + * + * compute.regionBackendServices.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.patch + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. This method supports + * PATCH semantics and uses the JSON merge patch format and processing + * rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to patch. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to patch. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionBackendServices.update + * @desc Updates the specified regional BackendService resource with the + * data included in the request. There are several restrictions and + * guidelines to keep in mind when updating a backend service. Read + * Restrictions and Guidelines for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the BackendService resource to update. + * backendService: 'my-backend-service', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.regionBackendServices.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionBackendServices.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backendService Name of the BackendService resource to update. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().BackendService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/backendServices/{backendService}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'backendService'], + pathParams: ['backendService', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioncommitments { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionCommitments.aggregatedList + * @desc Retrieves an aggregated list of commitments. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionCommitments.aggregatedList(request, handlePage); + * } + * }; + * + * compute.regionCommitments.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.get + * @desc Returns the specified commitment resource. Get a list of available + * commitments by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the commitment to return. + * commitment: 'my-commitment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionCommitments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commitment Name of the commitment to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/commitments/{commitment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'commitment'], + pathParams: ['commitment', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.insert + * @desc Creates a commitment in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionCommitments.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Commitment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionCommitments.list + * @desc Retrieves a list of commitments contained within the specified + * region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionCommitments.list(request, handlePage); + * } + * }; + * + * compute.regionCommitments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionCommitments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/commitments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroupmanagers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroupManagers.abandonInstances + * @desc Schedules a group action to remove the specified instances from the + * managed instance group. Abandoning an instance does not delete the + * instance, but it does remove the instance from any target pools that are + * applied by the managed instance group. This method reduces the targetSize + * of the managed instance group by the number of instances that you + * abandon. This operation is marked as DONE when the action is scheduled + * even if the instances have not yet been removed from the group. You must + * separately verify the status of the abandoning action with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. You can specify a maximum of 1000 instances with + * this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.abandonInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.delete + * @desc Deletes the specified managed instance group and all of the + * instances in that group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group to delete. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.delete(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.deleteInstances + * @desc Schedules a group action to delete the specified instances in the + * managed instance group. The instances are also removed from any target + * pools of which they were a member. This method reduces the targetSize of + * the managed instance group by the number of instances that you delete. + * This operation is marked as DONE when the action is scheduled even if the + * instances are still being deleted. You must separately verify the status + * of the deleting action with the listmanagedinstances method. If the + * group is part of a backend service that has enabled connection draining, + * it can take up to 60 seconds after the connection draining duration has + * elapsed before the VM instance is removed or deleted. You can specify a + * maximum of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.deleteInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.get + * @desc Returns all of the details about the specified managed instance + * group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group to return. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.insert + * @desc Creates a managed instance group using the information that you + * specify in the request. After the group is created, it schedules an + * action to create instances in the group using the specified instance + * template. This operation is marked as DONE when the group is created even + * if the instances in the group have not yet been created. You must + * separately verify the status of the individual instances with the + * listmanagedinstances method. A regional managed instance group can + * contain up to 2000 instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.list + * @desc Retrieves the list of managed instance groups that are contained + * within the specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroupManagers.list(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroupManagers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.listManagedInstances + * @desc Lists the instances in the managed instance group and instances + * that are scheduled to be created. The list includes any current actions + * that the group has scheduled for its instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.listManagedInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.listManagedInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {integer=} params.maxResults + * @param {string=} params.order_by + * @param {string=} params.pageToken + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listManagedInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void; + listManagedInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>, + callback?: BodyResponseCallback< + Schema$RegionInstanceGroupManagersListInstancesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$RegionInstanceGroupManagersListInstancesResponse>( + parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.recreateInstances + * @desc Schedules a group action to recreate the specified instances in the + * managed instance group. The instances are deleted and recreated using the + * current instance template for the managed instance group. This operation + * is marked as DONE when the action is scheduled even if the instances have + * not yet been recreated. You must separately verify the status of the + * recreating action with the listmanagedinstances method. If the group is + * part of a backend service that has enabled connection draining, it can + * take up to 60 seconds after the connection draining duration has elapsed + * before the VM instance is removed or deleted. You can specify a maximum + * of 1000 instances with this method per request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.recreateInstances(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersRecreateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.resize + * @desc Changes the intended size for the managed instance group. If you + * increase the size, the group schedules actions to create new instances + * using the current instance template. If you decrease the size, the group + * schedules delete actions on one or more instances. The resize operation + * is marked DONE when the resize actions are scheduled even if the group + * has not yet added or deleted any instances. You must separately verify + * the status of the creating or deleting actions with the + * listmanagedinstances method. If the group is part of a backend service + * that has enabled connection draining, it can take up to 60 seconds after + * the connection draining duration has elapsed before the VM instance is + * removed or deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * // Number of instances that should exist in this instance group + * manager. size: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.resize(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {integer} params.size Number of instances that should exist in this instance group manager. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setInstanceTemplate + * @desc Sets the instance template to use when creating new instances or + * recreating instances in this group. Existing instances are not affected. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.setInstanceTemplate(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all new instances in this group + * are assigned. Existing instances in the group are not affected. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the managed instance group. + * instanceGroupManager: 'my-instance-group-manager', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroupManagers.setTargetPools(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the managed instance group. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regioninstancegroups { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionInstanceGroups.get + * @desc Returns the specified instance group resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the instance group resource to return. + * instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup Name of the instance group resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.list + * @desc Retrieves the list of instance group resources contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroups.list(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionInstanceGroups.listInstances + * @desc Lists the instances in the specified instance group and displays + * information about the named ports. Depending on the specified options, + * this method can list all instances or only the instances that are + * running. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the regional instance group for which we want to list the + * instances. instanceGroup: 'my-instance-group', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionInstanceGroups.listInstances(request, handlePage); + * } + * }; + * + * compute.regionInstanceGroups.listInstances(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.listInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {string} params.instanceGroup Name of the regional instance group for which we want to list the instances. + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {().RegionInstanceGroupsListInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstances(params?: any, options?: MethodOptions): + AxiosPromise; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + listInstances( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/listInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.regionInstanceGroups.setNamedPorts + * @desc Sets the named ports for the specified regional instance group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // The name of the regional instance group where the named ports are + * updated. instanceGroup: 'my-instance-group', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.regionInstanceGroups.setNamedPorts(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionInstanceGroups.setNamedPorts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroup The name of the regional instance group where the named ports are updated. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().RegionInstanceGroupsSetNamedPortsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNamedPorts(params?: any, options?: MethodOptions): + AxiosPromise; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNamedPorts( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/instanceGroups/{instanceGroup}/setNamedPorts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'instanceGroup'], + pathParams: ['instanceGroup', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regionoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regionOperations.delete + * @desc Deletes the specified region-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.get + * @desc Retrieves the specified region-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regionOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'operation'], + pathParams: ['operation', 'project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regionOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regionOperations.list(request, handlePage); + * } + * }; + * + * compute.regionOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regionOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regions { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.regions.get + * @desc Returns the specified Region resource. Get a list of available + * regions by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region resource to return. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.regions.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/regions/{region}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.regions.list + * @desc Retrieves the list of region resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.regions.list(request, handlePage); + * } + * }; + * + * compute.regions.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.regions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/regions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routers { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routers.aggregatedList + * @desc Retrieves an aggregated list of routers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routers.aggregatedList(request, handlePage); + * } + * }; + * + * compute.routers.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.delete + * @desc Deletes the specified Router resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to delete. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.get + * @desc Returns the specified Router resource. Get a list of available + * routers by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to return. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.getRouterStatus + * @desc Retrieves runtime information of the specified router. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to query. + * router: 'my-router', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routers.getRouterStatus(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.getRouterStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRouterStatus(params?: any, options?: MethodOptions): + AxiosPromise; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRouterStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRouterStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.insert + * @desc Creates a Router resource in the specified project and region using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.list + * @desc Retrieves a list of Router resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routers.list(request, handlePage); + * } + * }; + * + * compute.routers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.patch + * @desc Patches the specified Router resource with the data included in the + * request. This method supports PATCH semantics and uses JSON merge patch + * format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to patch. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to patch. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.preview + * @desc Preview fields auto-generated during router create and update + * operations. Calling this method does NOT create or update the router. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to query. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.preview(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.preview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.router Name of the Router resource to query. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + preview(params?: any, options?: MethodOptions): + AxiosPromise; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}/preview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routers.update + * @desc Updates the specified Router resource with the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Router resource to update. + * router: 'my-router', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.routers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.router Name of the Router resource to update. + * @param {().Router} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/routers/{router}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'region', 'router'], + pathParams: ['project', 'region', 'router'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Routes { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.routes.delete + * @desc Deletes the specified Route resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Route resource to delete. + * route: 'my-route', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routes.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.route Name of the Route resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.get + * @desc Returns the specified Route resource. Get a list of available + * routes by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Route resource to return. + * route: 'my-route', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.routes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.route Name of the Route resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/routes/{route}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'route'], + pathParams: ['project', 'route'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.insert + * @desc Creates a Route resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.routes.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Route} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.routes.list + * @desc Retrieves the list of Route resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.routes.list(request, handlePage); + * } + * }; + * + * compute.routes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.routes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/routes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Snapshots { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.snapshots.delete + * @desc Deletes the specified Snapshot resource. Keep in mind that deleting + * a single snapshot might not necessarily delete all the data on that + * snapshot. If any data on the snapshot that is marked for deletion is + * needed for subsequent snapshots, the data will be moved to the next + * corresponding snapshot. For more information, see Deleting snaphots. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Snapshot resource to delete. + * snapshot: 'my-snapshot', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.snapshots.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.snapshot Name of the Snapshot resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.get + * @desc Returns the specified Snapshot resource. Get a list of available + * snapshots by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the Snapshot resource to return. + * snapshot: 'my-snapshot', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.snapshots.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.snapshot Name of the Snapshot resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/snapshots/{snapshot}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'snapshot'], + pathParams: ['project', 'snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.list + * @desc Retrieves the list of Snapshot resources contained within the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.snapshots.list(request, handlePage); + * } + * }; + * + * compute.snapshots.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.snapshots.setLabels + * @desc Sets the labels on a snapshot. To learn more about labels, read the + * Labeling Resources documentation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.snapshots.setLabels(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.snapshots.setLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().GlobalSetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/snapshots/{resource}/setLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslcertificates { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslCertificates.delete + * @desc Deletes the specified SslCertificate resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the SslCertificate resource to delete. + * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.sslCertificates.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslCertificate Name of the SslCertificate resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.get + * @desc Returns the specified SslCertificate resource. Get a list of + * available SSL certificates by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the SslCertificate resource to return. + * sslCertificate: 'my-ssl-certificate', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.sslCertificates.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslCertificate Name of the SslCertificate resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslCertificates/{sslCertificate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslCertificate'], + pathParams: ['project', 'sslCertificate'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.insert + * @desc Creates a SslCertificate resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.sslCertificates.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslCertificate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslCertificates.list + * @desc Retrieves the list of SslCertificate resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.sslCertificates.list(request, handlePage); + * } + * }; + * + * compute.sslCertificates.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.sslCertificates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/sslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sslpolicies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.sslPolicies.delete + * @desc Deletes the specified SSL policy. The SSL policy resource can be + * deleted only if it is not in use by any TargetHttpsProxy or + * TargetSslProxy resources. + * @alias compute.sslPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to delete. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.get + * @desc Lists all of the ordered rules present in a single specified + * policy. + * @alias compute.sslPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.insert + * @desc Returns the specified SSL policy resource. Get a list of available + * SSL policies by making a list() request. + * @alias compute.sslPolicies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.list + * @desc Lists all the SSL policies that have been configured for the + * specified project. + * @alias compute.sslPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.sslPolicies.listAvailableFeatures + * @desc Lists all features that can be specified in the SSL policy when + * using custom profile. + * @alias compute.sslPolicies.listAvailableFeatures + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listAvailableFeatures(params?: any, options?: MethodOptions): + AxiosPromise; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): void; + listAvailableFeatures( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SslPoliciesListAvailableFeaturesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies/listAvailableFeatures') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$SslPoliciesListAvailableFeaturesResponse>(parameters); + } + } + + + /** + * compute.sslPolicies.patch + * @desc Patches the specified SSL policy with the data included in the + * request. + * @alias compute.sslPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.sslPolicy Name of the SSL policy to update. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/sslPolicies/{sslPolicy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'sslPolicy'], + pathParams: ['project', 'sslPolicy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subnetworks { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.subnetworks.aggregatedList + * @desc Retrieves an aggregated list of subnetworks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.subnetworks.aggregatedList(request, handlePage); + * } + * }; + * + * compute.subnetworks.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.delete + * @desc Deletes the specified subnetwork. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to delete. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.subnetworks.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.expandIpCidrRange + * @desc Expands the IP CIDR range of the subnetwork to a specified value. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to update. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.expandIpCidrRange(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.expandIpCidrRange + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to update. + * @param {().SubnetworksExpandIpCidrRangeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + expandIpCidrRange(params?: any, options?: MethodOptions): + AxiosPromise; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + expandIpCidrRange( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/expandIpCidrRange') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.get + * @desc Returns the specified subnetwork. Get a list of available + * subnetworks list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource to return. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.subnetworks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.subnetwork Name of the Subnetwork resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.insert + * @desc Creates a subnetwork in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.list + * @desc Retrieves a list of subnetworks available to the specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.subnetworks.list(request, handlePage); + * } + * }; + * + * compute.subnetworks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.patch + * @desc Patches the specified subnetwork with the data included in the + * request. Only the following fields within the subnetwork resource can be + * specified in the request: secondary_ip_range, + * allow_subnet_cidr_routes_overlap and role. It is also mandatory to + * specify the current fingeprint of the subnetwork resource being patched. + * @alias compute.subnetworks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource to patch. + * @param {().Subnetwork} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.subnetworks.setPrivateIpGoogleAccess + * @desc Set whether VMs in this subnet can access Google services without + * assigning external IP addresses through Private Google Access. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the Subnetwork resource. + * subnetwork: 'my-subnetwork', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.subnetworks.setPrivateIpGoogleAccess(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.subnetworks.setPrivateIpGoogleAccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.subnetwork Name of the Subnetwork resource. + * @param {().SubnetworksSetPrivateIpGoogleAccessRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setPrivateIpGoogleAccess(params?: any, options?: MethodOptions): + AxiosPromise; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setPrivateIpGoogleAccess( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/subnetworks/{subnetwork}/setPrivateIpGoogleAccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'subnetwork'], + pathParams: ['project', 'region', 'subnetwork'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpProxies.delete + * @desc Deletes the specified TargetHttpProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy resource to delete. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.get + * @desc Returns the specified TargetHttpProxy resource. Get a list of + * available target HTTP proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy resource to return. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpProxies/{targetHttpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.insert + * @desc Creates a TargetHttpProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.list + * @desc Retrieves the list of TargetHttpProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetHttpProxies.list(request, handlePage); + * } + * }; + * + * compute.targetHttpProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpProxies.setUrlMap + * @desc Changes the URL map for TargetHttpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpProxy to set a URL map for. + * targetHttpProxy: 'my-target-http-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpProxies.setUrlMap(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpProxy Name of the TargetHttpProxy to set a URL map for. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/targetHttpProxies/{targetHttpProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpProxy'], + pathParams: ['project', 'targetHttpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targethttpsproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetHttpsProxies.delete + * @desc Deletes the specified TargetHttpsProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to delete. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.get + * @desc Returns the specified TargetHttpsProxy resource. Get a list of + * available target HTTPS proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to return. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.insert + * @desc Creates a TargetHttpsProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetHttpsProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.list + * @desc Retrieves the list of TargetHttpsProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetHttpsProxies.list(request, handlePage); + * } + * }; + * + * compute.targetHttpsProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpsProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslCertificates + * @desc Replaces SslCertificates for TargetHttpsProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource to set an SslCertificates + * resource for. targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.setSslCertificates(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource to set an SslCertificates resource for. + * @param {().TargetHttpsProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setSslPolicy + * @desc Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the HTTPS proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetHttpsProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetHttpsProxies/{targetHttpsProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetHttpsProxies.setUrlMap + * @desc Changes the URL map for TargetHttpsProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetHttpsProxy resource whose URL map is to be set. + * targetHttpsProxy: 'my-target-https-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetHttpsProxies.setUrlMap(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetHttpsProxies.setUrlMap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetHttpsProxy Name of the TargetHttpsProxy resource whose URL map is to be set. + * @param {().UrlMapReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setUrlMap(params?: any, options?: MethodOptions): + AxiosPromise; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setUrlMap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/targetHttpsProxies/{targetHttpsProxy}/setUrlMap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetHttpsProxy'], + pathParams: ['project', 'targetHttpsProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetinstances { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetInstances.aggregatedList + * @desc Retrieves an aggregated list of target instances. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetInstances.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetInstances.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetInstances.delete + * @desc Deletes the specified TargetInstance resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the TargetInstance resource to delete. + * targetInstance: 'my-target-instance', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetInstances.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetInstance Name of the TargetInstance resource to delete. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.get + * @desc Returns the specified TargetInstance resource. Get a list of + * available target instances by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the TargetInstance resource to return. + * targetInstance: 'my-target-instance', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetInstances.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetInstance Name of the TargetInstance resource to return. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/targetInstances/{targetInstance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'targetInstance'], + pathParams: ['project', 'targetInstance', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.insert + * @desc Creates a TargetInstance resource in the specified project and zone + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetInstances.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.zone Name of the zone scoping this request. + * @param {().TargetInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetInstances.list + * @desc Retrieves a list of TargetInstance resources available to the + * specified project and zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone scoping this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetInstances.list(request, handlePage); + * } + * }; + * + * compute.targetInstances.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetInstances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/targetInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetpools { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetPools.addHealthCheck + * @desc Adds health check URLs to a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target pool to add a health check to. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.addHealthCheck(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.addHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to add a health check to. + * @param {().TargetPoolsAddHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/addHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.addInstance + * @desc Adds an instance to a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to add instances to. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.addInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.addInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to add instances to. + * @param {().TargetPoolsAddInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addInstance(params?: any, options?: MethodOptions): + AxiosPromise; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/addInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.aggregatedList + * @desc Retrieves an aggregated list of target pools. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetPools.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetPools.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.delete + * @desc Deletes the specified target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to delete. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetPools.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.get + * @desc Returns the specified target pool. Get a list of available target + * pools by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to return. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetPools.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.getHealth + * @desc Gets the most recent health check results for each IP for the + * instance that is referenced by the given target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to which the queried instance + * belongs. targetPool: 'my-target-pool', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.getHealth(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.getHealth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string} params.targetPool Name of the TargetPool resource to which the queried instance belongs. + * @param {().InstanceReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getHealth(params?: any, options?: MethodOptions): + AxiosPromise; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getHealth( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/getHealth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.insert + * @desc Creates a target pool in the specified project and region using the + * data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetPool} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.list + * @desc Retrieves a list of target pools available to the specified project + * and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetPools.list(request, handlePage); + * } + * }; + * + * compute.targetPools.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeHealthCheck + * @desc Removes health check URL from a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target pool to remove health checks from. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.removeHealthCheck(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.removeHealthCheck + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the target pool to remove health checks from. + * @param {().TargetPoolsRemoveHealthCheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeHealthCheck(params?: any, options?: MethodOptions): + AxiosPromise; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeHealthCheck( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/removeHealthCheck') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.removeInstance + * @desc Removes instance URL from a target pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to remove instances from. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.removeInstance(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.removeInstance + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to remove instances from. + * @param {().TargetPoolsRemoveInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeInstance(params?: any, options?: MethodOptions): + AxiosPromise; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeInstance( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/removeInstance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetPools.setBackup + * @desc Changes a backup target pool's configurations. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region scoping this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the TargetPool resource to set a backup pool for. + * targetPool: 'my-target-pool', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetPools.setBackup(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetPools.setBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {number=} params.failoverRatio New failoverRatio value for the target pool. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region scoping this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetPool Name of the TargetPool resource to set a backup pool for. + * @param {().TargetReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackup(params?: any, options?: MethodOptions): + AxiosPromise; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetPools/{targetPool}/setBackup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region', 'targetPool'], + pathParams: ['project', 'region', 'targetPool'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetsslproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetSslProxies.delete + * @desc Deletes the specified TargetSslProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource to delete. + * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.get + * @desc Returns the specified TargetSslProxy resource. Get a list of + * available target SSL proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource to return. + * targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.insert + * @desc Creates a TargetSslProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetSslProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.list + * @desc Retrieves the list of TargetSslProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetSslProxies.list(request, handlePage); + * } + * }; + * + * compute.targetSslProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setBackendService + * @desc Changes the BackendService for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose BackendService resource + * is to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setBackendService(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose BackendService resource is to be set. + * @param {().TargetSslProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose ProxyHeader is to be + * set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setProxyHeader(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose ProxyHeader is to be set. + * @param {().TargetSslProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslCertificates + * @desc Changes SslCertificates for TargetSslProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetSslProxy resource whose SslCertificate resource + * is to be set. targetSslProxy: 'my-target-ssl-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetSslProxies.setSslCertificates(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetSslProxies.setSslCertificates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SslCertificate resource is to be set. + * @param {().TargetSslProxiesSetSslCertificatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslCertificates(params?: any, options?: MethodOptions): + AxiosPromise; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslCertificates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslCertificates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetSslProxies.setSslPolicy + * @desc Sets the SSL policy for TargetSslProxy. The SSL policy specifies + * the server-side support for SSL features. This affects connections + * between clients and the SSL proxy load balancer. They do not affect the + * connection between the load balancer and the backends. + * @alias compute.targetSslProxies.setSslPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetSslProxy Name of the TargetSslProxy resource whose SSL policy is to be set. The name must be 1-63 characters long, and comply with RFC1035. + * @param {().SslPolicyReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSslPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSslPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetSslProxies/{targetSslProxy}/setSslPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetSslProxy'], + pathParams: ['project', 'targetSslProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targettcpproxies { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetTcpProxies.delete + * @desc Deletes the specified TargetTcpProxy resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource to delete. + * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.get + * @desc Returns the specified TargetTcpProxy resource. Get a list of + * available target TCP proxies by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource to return. + * targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.insert + * @desc Creates a TargetTcpProxy resource in the specified project using + * the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetTcpProxy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.list + * @desc Retrieves the list of TargetTcpProxy resources available to the + * specified project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetTcpProxies.list(request, handlePage); + * } + * }; + * + * compute.targetTcpProxies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setBackendService + * @desc Changes the BackendService for TargetTcpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource whose BackendService resource + * is to be set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.setBackendService(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.setBackendService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose BackendService resource is to be set. + * @param {().TargetTcpProxiesSetBackendServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setBackendService(params?: any, options?: MethodOptions): + AxiosPromise; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setBackendService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setBackendService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetTcpProxies.setProxyHeader + * @desc Changes the ProxyHeaderType for TargetTcpProxy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the TargetTcpProxy resource whose ProxyHeader is to be + * set. targetTcpProxy: 'my-target-tcp-proxy', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetTcpProxies.setProxyHeader(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetTcpProxies.setProxyHeader + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetTcpProxy Name of the TargetTcpProxy resource whose ProxyHeader is to be set. + * @param {().TargetTcpProxiesSetProxyHeaderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProxyHeader(params?: any, options?: MethodOptions): + AxiosPromise; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setProxyHeader( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/targetTcpProxies/{targetTcpProxy}/setProxyHeader') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'targetTcpProxy'], + pathParams: ['project', 'targetTcpProxy'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetvpngateways { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.targetVpnGateways.aggregatedList + * @desc Retrieves an aggregated list of target VPN gateways. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetVpnGateways.aggregatedList(request, handlePage); + * } + * }; + * + * compute.targetVpnGateways.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/aggregated/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * compute.targetVpnGateways.delete + * @desc Deletes the specified target VPN gateway. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target VPN gateway to delete. + * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.targetVpnGateway Name of the target VPN gateway to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.get + * @desc Returns the specified target VPN gateway. Get a list of available + * target VPN gateways by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the target VPN gateway to return. + * targetVpnGateway: 'my-target-vpn-gateway', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.targetVpnGateway Name of the target VPN gateway to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways/{targetVpnGateway}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'targetVpnGateway'], + pathParams: ['project', 'region', 'targetVpnGateway'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.insert + * @desc Creates a target VPN gateway in the specified project and region + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.targetVpnGateways.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().TargetVpnGateway} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.targetVpnGateways.list + * @desc Retrieves a list of target VPN gateways available to the specified + * project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.targetVpnGateways.list(request, handlePage); + * } + * }; + * + * compute.targetVpnGateways.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.targetVpnGateways.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/targetVpnGateways') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Urlmaps { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.urlMaps.delete + * @desc Deletes the specified UrlMap resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to delete. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.urlMaps.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.get + * @desc Returns the specified UrlMap resource. Get a list of available URL + * maps by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to return. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.urlMaps.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.insert + * @desc Creates a UrlMap resource in the specified project using the data + * included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.invalidateCache + * @desc Initiates a cache invalidation operation, invalidating the + * specified path, scoped to the specified UrlMap. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap scoping this request. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.invalidateCache(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.invalidateCache + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap scoping this request. + * @param {().CacheInvalidationRule} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + invalidateCache(params?: any, options?: MethodOptions): + AxiosPromise; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + invalidateCache( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}/invalidateCache') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.list + * @desc Retrieves the list of UrlMap resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.urlMaps.list(request, handlePage); + * } + * }; + * + * compute.urlMaps.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/global/urlMaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.patch + * @desc Patches the specified UrlMap resource with the data included in the + * request. This method supports PATCH semantics and uses the JSON merge + * patch format and processing rules. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to patch. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to patch. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.update + * @desc Updates the specified UrlMap resource with the data included in the + * request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to update. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.urlMap Name of the UrlMap resource to update. + * @param {().UrlMap} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.urlMaps.validate + * @desc Runs static validation for the UrlMap. In particular, the tests of + * the provided UrlMap will be run. Calling this method does NOT create the + * UrlMap. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the UrlMap resource to be validated as. + * urlMap: 'my-url-map', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.urlMaps.validate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.urlMaps.validate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.urlMap Name of the UrlMap resource to be validated as. + * @param {().UrlMapsValidateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + validate(params?: any, options?: MethodOptions): + AxiosPromise; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + validate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/global/urlMaps/{urlMap}/validate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'urlMap'], + pathParams: ['project', 'urlMap'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Vpntunnels { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.vpnTunnels.aggregatedList + * @desc Retrieves an aggregated list of VPN tunnels. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * Object.keys(itemsPage).forEach(function(name) { + * // TODO: Change code below to process each `name` property: + * console.log(name + ': ' + JSON.stringify(itemsPage[name], null, + * 2)); + * }); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.vpnTunnels.aggregatedList(request, handlePage); + * } + * }; + * + * compute.vpnTunnels.aggregatedList(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.aggregatedList + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregatedList(params?: any, options?: MethodOptions): + AxiosPromise; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregatedList( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/aggregated/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.delete + * @desc Deletes the specified VpnTunnel resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the VpnTunnel resource to delete. + * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.get + * @desc Returns the specified VpnTunnel resource. Get a list of available + * VPN tunnels by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * // Name of the VpnTunnel resource to return. + * vpnTunnel: 'my-vpn-tunnel', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string} params.vpnTunnel Name of the VpnTunnel resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/vpnTunnels/{vpnTunnel}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region', 'vpnTunnel'], + pathParams: ['project', 'region', 'vpnTunnel'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.insert + * @desc Creates a VpnTunnel resource in the specified project and region + * using the data included in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * compute.vpnTunnels.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {string=} params.requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {().VpnTunnel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.vpnTunnels.list + * @desc Retrieves a list of VpnTunnel resources contained in the specified + * project and region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the region for this request. + * region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.vpnTunnels.list(request, handlePage); + * } + * }; + * + * compute.vpnTunnels.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.vpnTunnels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.region Name of the region for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/regions/{region}/vpnTunnels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'region'], + pathParams: ['project', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zoneoperations { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zoneOperations.delete + * @desc Deletes the specified zone-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the Operations resource to delete. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zoneOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to delete. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.get + * @desc Retrieves the specified zone-specific Operations resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for this request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // Name of the Operations resource to return. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zoneOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the Operations resource to return. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zoneOperations.list + * @desc Retrieves a list of Operation resources contained within the + * specified zone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone for request. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.zoneOperations.list(request, handlePage); + * } + * }; + * + * compute.zoneOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone for request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/compute/v1/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Zones { + root: Compute; + constructor(root: Compute) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * compute.zones.get + * @desc Returns the specified Zone resource. Get a list of available zones + * by making a list() request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the zone resource to return. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * compute.zones.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.zone Name of the zone resource to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/zones/{zone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * compute.zones.list + * @desc Retrieves the list of Zone resources available to the specified + * project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Compute Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/compute + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var compute = google.compute('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * compute.zones.list(request, handlePage); + * } + * }; + * + * compute.zones.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias compute.zones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project Project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/compute/v1/projects/{project}/zones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/container/v1.ts b/src/apis/container/v1.ts index f4788f00c3b..0757651d224 100644 --- a/src/apis/container/v1.ts +++ b/src/apis/container/v1.ts @@ -27,7126 +27,7200 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Kubernetes Engine API - * - * The Google Kubernetes Engine API is used for building and managing container - * based applications, powered by the open source Kubernetes technology. - * - * @example - * const google = require('googleapis'); - * const container = google.container('v1'); - * - * @namespace container - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Container - */ -export class Container { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace container_v1 { + /** + * Kubernetes Engine API + * + * The Google Kubernetes Engine API is used for building and managing + * container based applications, powered by the open source Kubernetes + * technology. + * + * @example + * const google = require('googleapis'); + * const container = google.container('v1'); + * + * @namespace container + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Container + */ + export class Container { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * AcceleratorConfig represents a Hardware Accelerator request. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the accelerator cards exposed to an instance. - */ - acceleratorCount: string; - /** - * The accelerator type resource name. List of supported accelerators - * [here](/compute/docs/gpus/#Introduction) - */ - acceleratorType: string; -} -/** - * Configuration for the addons that can be automatically spun up in the - * cluster, enabling additional functionality. - */ -export interface Schema$AddonsConfig { - /** - * Configuration for the horizontal pod autoscaling feature, which increases - * or decreases the number of replica pods a replication controller has based - * on the resource usage of the existing pods. - */ - horizontalPodAutoscaling: Schema$HorizontalPodAutoscaling; - /** - * Configuration for the HTTP (L7) load balancing controller addon, which - * makes it easy to set up HTTP load balancers for services in a cluster. - */ - httpLoadBalancing: Schema$HttpLoadBalancing; - /** - * Configuration for the Kubernetes Dashboard. - */ - kubernetesDashboard: Schema$KubernetesDashboard; - /** - * Configuration for NetworkPolicy. This only tracks whether the addon is - * enabled or not on the Master, it does not track whether network policy is - * enabled for the nodes. - */ - networkPolicyConfig: Schema$NetworkPolicyConfig; -} -/** - * AutoUpgradeOptions defines the set of options for the user to control how the - * Auto Upgrades will proceed. - */ -export interface Schema$AutoUpgradeOptions { - /** - * [Output only] This field is set when upgrades are about to commence with - * the approximate start time for the upgrades, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - autoUpgradeStartTime: string; - /** - * [Output only] This field is set when upgrades are about to commence with - * the description of the upgrade. - */ - description: string; -} -/** - * CancelOperationRequest cancels a single operation. - */ -export interface Schema$CancelOperationRequest { - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format 'projects/x/locations/x/operations/*'. - */ - name: string; /** - * Deprecated. The server-assigned `name` of the operation. This field has - * been deprecated and replaced by the name field. + * AcceleratorConfig represents a Hardware Accelerator request. */ - operationId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the operation resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * CidrBlock contains an optional name and one CIDR block. - */ -export interface Schema$CidrBlock { - /** - * cidr_block must be specified in CIDR notation. - */ - cidrBlock: string; - /** - * display_name is an optional field for users to identify CIDR blocks. - */ - displayName: string; -} -/** - * Configuration for client certificates on the cluster. - */ -export interface Schema$ClientCertificateConfig { + export interface Schema$AcceleratorConfig { + /** + * The number of the accelerator cards exposed to an instance. + */ + acceleratorCount: string; + /** + * The accelerator type resource name. List of supported accelerators + * [here](/compute/docs/gpus/#Introduction) + */ + acceleratorType: string; + } /** - * Issue a client certificate. - */ - issueClientCertificate: boolean; -} -/** - * A Google Kubernetes Engine cluster. - */ -export interface Schema$Cluster { + * Configuration for the addons that can be automatically spun up in the + * cluster, enabling additional functionality. + */ + export interface Schema$AddonsConfig { + /** + * Configuration for the horizontal pod autoscaling feature, which increases + * or decreases the number of replica pods a replication controller has + * based on the resource usage of the existing pods. + */ + horizontalPodAutoscaling: Schema$HorizontalPodAutoscaling; + /** + * Configuration for the HTTP (L7) load balancing controller addon, which + * makes it easy to set up HTTP load balancers for services in a cluster. + */ + httpLoadBalancing: Schema$HttpLoadBalancing; + /** + * Configuration for the Kubernetes Dashboard. + */ + kubernetesDashboard: Schema$KubernetesDashboard; + /** + * Configuration for NetworkPolicy. This only tracks whether the addon is + * enabled or not on the Master, it does not track whether network policy is + * enabled for the nodes. + */ + networkPolicyConfig: Schema$NetworkPolicyConfig; + } /** - * Configurations for the various addons available to run in the cluster. - */ - addonsConfig: Schema$AddonsConfig; + * AutoUpgradeOptions defines the set of options for the user to control how + * the Auto Upgrades will proceed. + */ + export interface Schema$AutoUpgradeOptions { + /** + * [Output only] This field is set when upgrades are about to commence with + * the approximate start time for the upgrades, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + autoUpgradeStartTime: string; + /** + * [Output only] This field is set when upgrades are about to commence with + * the description of the upgrade. + */ + description: string; + } /** - * The IP address range of the container pods in this cluster, in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically - * chosen or specify a `/14` block in `10.0.0.0/8`. - */ - clusterIpv4Cidr: string; + * CancelOperationRequest cancels a single operation. + */ + export interface Schema$CancelOperationRequest { + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format 'projects/x/locations/x/operations/*'. + */ + name: string; + /** + * Deprecated. The server-assigned `name` of the operation. This field has + * been deprecated and replaced by the name field. + */ + operationId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation resides. + * This field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * [Output only] The time the cluster was created, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - createTime: string; + * CidrBlock contains an optional name and one CIDR block. + */ + export interface Schema$CidrBlock { + /** + * cidr_block must be specified in CIDR notation. + */ + cidrBlock: string; + /** + * display_name is an optional field for users to identify CIDR blocks. + */ + displayName: string; + } /** - * [Output only] The current software version of the master endpoint. + * Configuration for client certificates on the cluster. */ - currentMasterVersion: string; + export interface Schema$ClientCertificateConfig { + /** + * Issue a client certificate. + */ + issueClientCertificate: boolean; + } /** - * [Output only] The number of nodes currently in the cluster. - */ - currentNodeCount: number; + * A Google Kubernetes Engine cluster. + */ + export interface Schema$Cluster { + /** + * Configurations for the various addons available to run in the cluster. + */ + addonsConfig: Schema$AddonsConfig; + /** + * The IP address range of the container pods in this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically + * chosen or specify a `/14` block in `10.0.0.0/8`. + */ + clusterIpv4Cidr: string; + /** + * [Output only] The time the cluster was created, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + createTime: string; + /** + * [Output only] The current software version of the master endpoint. + */ + currentMasterVersion: string; + /** + * [Output only] The number of nodes currently in the cluster. + */ + currentNodeCount: number; + /** + * [Output only] The current version of the node software components. If + * they are currently at multiple versions because they're in the + * process of being upgraded, this reflects the minimum version of all + * nodes. + */ + currentNodeVersion: string; + /** + * An optional description of this cluster. + */ + description: string; + /** + * Kubernetes alpha features are enabled on this cluster. This includes + * alpha API groups (e.g. v1alpha1) and features that may not be production + * ready in the kubernetes version of the master and nodes. The cluster has + * no SLA for uptime and master/node upgrades are disabled. Alpha enabled + * clusters are automatically deleted thirty days after creation. + */ + enableKubernetesAlpha: boolean; + /** + * [Output only] The IP address of this cluster's master endpoint. The + * endpoint can be accessed from the internet at + * `https://username:password@endpoint/`. See the `masterAuth` property of + * this resource for username and password information. + */ + endpoint: string; + /** + * [Output only] The time the cluster will be automatically deleted in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + expireTime: string; + /** + * The initial Kubernetes version for this cluster. Valid versions are + * those found in validMasterVersions returned by getServerConfig. The + * version can be upgraded over time; such upgrades are reflected in + * currentMasterVersion and currentNodeVersion. Users may specify either + * explicit versions offered by Kubernetes Engine or version aliases, which + * have the following behavior: - "latest": picks the highest + * valid Kubernetes version - "1.X": picks the highest valid + * patch+gke.N patch in the 1.X version - "1.X.Y": picks the + * highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": + * picks an explicit Kubernetes version - "","-": picks + * the default Kubernetes version + */ + initialClusterVersion: string; + /** + * The number of nodes to create in this cluster. You must ensure that your + * Compute Engine <a + * href="/compute/docs/resource-quotas">resource + * quota</a> is sufficient for this number of instances. You must also + * have available firewall and routes quota. For requests, this field should + * only be used in lieu of a "node_pool" object, since this + * configuration (along with the "node_config") will be used to + * create a "NodePool" object with an auto-generated name. Do not + * use this and a node_pool at the same time. + */ + initialNodeCount: number; + /** + * Deprecated. Use node_pools.instance_group_urls. + */ + instanceGroupUrls: string[]; + /** + * Configuration for cluster IP allocation. + */ + ipAllocationPolicy: Schema$IPAllocationPolicy; + /** + * The fingerprint of the set of labels for this cluster. + */ + labelFingerprint: string; + /** + * Configuration for the legacy ABAC authorization mode. + */ + legacyAbac: Schema$LegacyAbac; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/regions-zones/regions-zones#available) or + * [region](/compute/docs/regions-zones/regions-zones#available) in which + * the cluster resides. + */ + location: string; + /** + * The list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. + */ + locations: string[]; + /** + * The logging service the cluster should use to write logs. Currently + * available options: * `logging.googleapis.com` - the Google Cloud Logging + * service. * `none` - no logs will be exported from the cluster. * if left + * as an empty string,`logging.googleapis.com` will be used. + */ + loggingService: string; + /** + * Configure the maintenance policy for this cluster. + */ + maintenancePolicy: Schema$MaintenancePolicy; + /** + * The authentication information for accessing the master endpoint. + */ + masterAuth: Schema$MasterAuth; + /** + * Master authorized networks is a Beta feature. The configuration options + * for master authorized networks feature. + */ + masterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * `monitoring.googleapis.com` - the Google Cloud + * Monitoring service. * `none` - no metrics will be exported from the + * cluster. * if left as an empty string, `monitoring.googleapis.com` will + * be used. + */ + monitoringService: string; + /** + * The name of this cluster. The name must be unique within this project and + * zone, and can be up to 40 characters with the following restrictions: * + * Lowercase letters, numbers, and hyphens only. * Must start with a letter. + * * Must end with a number or a letter. + */ + name: string; + /** + * The name of the Google Compute Engine + * [network](/compute/docs/networks-and-firewalls#networks) to which the + * cluster is connected. If left unspecified, the `default` network will be + * used. + */ + network: string; + /** + * Configuration options for the NetworkPolicy feature. + */ + networkPolicy: Schema$NetworkPolicy; + /** + * Parameters used in creating the cluster's nodes. See `nodeConfig` for + * the description of its properties. For requests, this field should only + * be used in lieu of a "node_pool" object, since this + * configuration (along with the "initial_node_count") will be + * used to create a "NodePool" object with an auto-generated name. + * Do not use this and a node_pool at the same time. For responses, this + * field will be populated with the node configuration of the first node + * pool. If unspecified, the defaults are used. + */ + nodeConfig: Schema$NodeConfig; + /** + * [Output only] The size of the address space on each node for hosting + * containers. This is provisioned from within the `container_ipv4_cidr` + * range. + */ + nodeIpv4CidrSize: number; + /** + * The node pools associated with this cluster. This field should not be set + * if "node_config" or "initial_node_count" are + * specified. + */ + nodePools: Schema$NodePool[]; + /** + * The resource labels for the cluster to use to annotate any related Google + * Compute Engine resources. + */ + resourceLabels: any; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The IP address range of the Kubernetes services in this + * cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the + * last `/16` from the container CIDR. + */ + servicesIpv4Cidr: string; + /** + * [Output only] The current status of this cluster. + */ + status: string; + /** + * [Output only] Additional information about the current status of this + * cluster, if available. + */ + statusMessage: string; + /** + * The name of the Google Compute Engine + * [subnetwork](/compute/docs/subnetworks) to which the cluster is + * connected. + */ + subnetwork: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field is deprecated, use location instead. + */ + zone: string; + } /** - * [Output only] The current version of the node software components. If they - * are currently at multiple versions because they're in the process of - * being upgraded, this reflects the minimum version of all nodes. - */ - currentNodeVersion: string; + * ClusterUpdate describes an update to the cluster. Exactly one update can be + * applied to a cluster with each request, so at most one field can be + * provided. + */ + export interface Schema$ClusterUpdate { + /** + * Configurations for the various addons available to run in the cluster. + */ + desiredAddonsConfig: Schema$AddonsConfig; + /** + * The desired image type for the node pool. NOTE: Set the + * "desired_node_pool" field as well. + */ + desiredImageType: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. Changing the locations a cluster is in will + * result in nodes being either created or removed from the cluster, + * depending on whether locations are being added or removed. This list + * must always include the cluster's primary zone. + */ + desiredLocations: string[]; + /** + * Master authorized networks is a Beta feature. The desired configuration + * options for master authorized networks feature. + */ + desiredMasterAuthorizedNetworksConfig: + Schema$MasterAuthorizedNetworksConfig; + /** + * The Kubernetes version to change the master to. Users may specify either + * explicit versions offered by Kubernetes Engine or version aliases, which + * have the following behavior: - "latest": picks the highest + * valid Kubernetes version - "1.X": picks the highest valid + * patch+gke.N patch in the 1.X version - "1.X.Y": picks the + * highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": + * picks an explicit Kubernetes version - "-": picks the default + * Kubernetes version + */ + desiredMasterVersion: string; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * "monitoring.googleapis.com" - the Google + * Cloud Monitoring service * "none" - no metrics will be exported + * from the cluster + */ + desiredMonitoringService: string; + /** + * Autoscaler configuration for the node pool specified in + * desired_node_pool_id. If there is only one pool in the cluster and + * desired_node_pool_id is not provided then the change applies to that + * single node pool. + */ + desiredNodePoolAutoscaling: Schema$NodePoolAutoscaling; + /** + * The node pool to be upgraded. This field is mandatory if + * "desired_node_version", "desired_image_family" or + * "desired_node_pool_autoscaling" is specified and there is more + * than one node pool on the cluster. + */ + desiredNodePoolId: string; + /** + * The Kubernetes version to change the nodes to (typically an upgrade). + * Users may specify either explicit versions offered by Kubernetes Engine + * or version aliases, which have the following behavior: - + * "latest": picks the highest valid Kubernetes version - + * "1.X": picks the highest valid patch+gke.N patch in the 1.X + * version - "1.X.Y": picks the highest valid gke.N patch in + * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes + * version - "-": picks the Kubernetes master version + */ + desiredNodeVersion: string; + } /** - * An optional description of this cluster. - */ - description: string; + * CompleteIPRotationRequest moves the cluster master back into single-IP + * mode. + */ + export interface Schema$CompleteIPRotationRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to complete IP + * rotation. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Kubernetes alpha features are enabled on this cluster. This includes alpha - * API groups (e.g. v1alpha1) and features that may not be production ready in - * the kubernetes version of the master and nodes. The cluster has no SLA for - * uptime and master/node upgrades are disabled. Alpha enabled clusters are - * automatically deleted thirty days after creation. - */ - enableKubernetesAlpha: boolean; + * CreateClusterRequest creates a cluster. + */ + export interface Schema$CreateClusterRequest { + /** + * A [cluster + * resource](/container-engine/reference/rest/v1/projects.zones.clusters) + */ + cluster: Schema$Cluster; + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format 'projects/x/locations/*'. + */ + parent: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the parent field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the parent field. + */ + zone: string; + } /** - * [Output only] The IP address of this cluster's master endpoint. The - * endpoint can be accessed from the internet at - * `https://username:password@endpoint/`. See the `masterAuth` property of - * this resource for username and password information. - */ - endpoint: string; + * CreateNodePoolRequest creates a node pool for a cluster. + */ + export interface Schema$CreateNodePoolRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the parent field. + */ + clusterId: string; + /** + * The node pool to create. + */ + nodePool: Schema$NodePool; + /** + * The parent (project, location, cluster id) where the node pool will be + * created. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + parent: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the parent field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the parent field. + */ + zone: string; + } /** - * [Output only] The time the cluster will be automatically deleted in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - expireTime: string; + * Time window specified for daily maintenance operations. + */ + export interface Schema$DailyMaintenanceWindow { + /** + * [Output only] Duration of the time window, automatically chosen to be + * smallest possible in the given scenario. Duration will be in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format + * "PTnHnMnS". + */ + duration: string; + /** + * Time within the maintenance window to start the maintenance operations. + * Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) + * format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. + */ + startTime: string; + } /** - * The initial Kubernetes version for this cluster. Valid versions are those - * found in validMasterVersions returned by getServerConfig. The version can - * be upgraded over time; such upgrades are reflected in currentMasterVersion - * and currentNodeVersion. Users may specify either explicit versions offered - * by Kubernetes Engine or version aliases, which have the following behavior: - * - "latest": picks the highest valid Kubernetes version - - * "1.X": picks the highest valid patch+gke.N patch in the 1.X - * version - "1.X.Y": picks the highest valid gke.N patch in - * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes - * version - "","-": picks the default Kubernetes version - */ - initialClusterVersion: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Configuration options for the horizontal pod autoscaling feature, which + * increases or decreases the number of replica pods a replication controller + * has based on the resource usage of the existing pods. + */ + export interface Schema$HorizontalPodAutoscaling { + /** + * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + * When enabled, it ensures that a Heapster pod is running in the cluster, + * which is also used by the Cloud Monitoring service. + */ + disabled: boolean; + } /** - * The number of nodes to create in this cluster. You must ensure that your - * Compute Engine <a - * href="/compute/docs/resource-quotas">resource quota</a> - * is sufficient for this number of instances. You must also have available - * firewall and routes quota. For requests, this field should only be used in - * lieu of a "node_pool" object, since this configuration (along - * with the "node_config") will be used to create a - * "NodePool" object with an auto-generated name. Do not use this - * and a node_pool at the same time. + * Configuration options for the HTTP (L7) load balancing controller addon, + * which makes it easy to set up HTTP load balancers for services in a + * cluster. */ - initialNodeCount: number; + export interface Schema$HttpLoadBalancing { + /** + * Whether the HTTP Load Balancing controller is enabled in the cluster. + * When enabled, it runs a small pod in the cluster that manages the load + * balancers. + */ + disabled: boolean; + } /** - * Deprecated. Use node_pools.instance_group_urls. - */ - instanceGroupUrls: string[]; + * Configuration for controlling how IPs are allocated in the cluster. + */ + export interface Schema$IPAllocationPolicy { + /** + * This field is deprecated, use cluster_ipv4_cidr_block. + */ + clusterIpv4Cidr: string; + /** + * The IP address range for the cluster pod IPs. If this field is set, then + * `cluster.cluster_ipv4_cidr` must be left blank. This field is only + * applicable when `use_ip_aliases` is true. Set to blank to have a range + * chosen with the default size. Set to /netmask (e.g. `/14`) to have a + * range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + clusterIpv4CidrBlock: string; + /** + * The name of the secondary range to be used for the cluster CIDR block. + * The secondary range will be used for pod IP addresses. This must be an + * existing secondary range associated with the cluster subnetwork. This + * field is only applicable with use_ip_aliases is true and + * create_subnetwork is false. + */ + clusterSecondaryRangeName: string; + /** + * Whether a new subnetwork will be created automatically for the cluster. + * This field is only applicable when `use_ip_aliases` is true. + */ + createSubnetwork: boolean; + /** + * This field is deprecated, use node_ipv4_cidr_block. + */ + nodeIpv4Cidr: string; + /** + * The IP address range of the instance IPs in this cluster. This is + * applicable only if `create_subnetwork` is true. Set to blank to have a + * range chosen with the default size. Set to /netmask (e.g. `/14`) to have + * a range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + nodeIpv4CidrBlock: string; + /** + * This field is deprecated, use services_ipv4_cidr_block. + */ + servicesIpv4Cidr: string; + /** + * The IP address range of the services IPs in this cluster. If blank, a + * range will be automatically chosen with the default size. This field is + * only applicable when `use_ip_aliases` is true. Set to blank to have a + * range chosen with the default size. Set to /netmask (e.g. `/14`) to have + * a range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + servicesIpv4CidrBlock: string; + /** + * The name of the secondary range to be used as for the services CIDR + * block. The secondary range will be used for service ClusterIPs. This + * must be an existing secondary range associated with the cluster + * subnetwork. This field is only applicable with use_ip_aliases is true + * and create_subnetwork is false. + */ + servicesSecondaryRangeName: string; + /** + * A custom subnetwork name to be used if `create_subnetwork` is true. If + * this field is empty, then an automatic name will be chosen for the new + * subnetwork. + */ + subnetworkName: string; + /** + * Whether alias IPs will be used for pod IPs in the cluster. + */ + useIpAliases: boolean; + } /** - * Configuration for cluster IP allocation. + * Configuration for the Kubernetes Dashboard. */ - ipAllocationPolicy: Schema$IPAllocationPolicy; + export interface Schema$KubernetesDashboard { + /** + * Whether the Kubernetes Dashboard is enabled for this cluster. + */ + disabled: boolean; + } /** - * The fingerprint of the set of labels for this cluster. - */ - labelFingerprint: string; + * Configuration for the legacy Attribute Based Access Control authorization + * mode. + */ + export interface Schema$LegacyAbac { + /** + * Whether the ABAC authorizer is enabled for this cluster. When enabled, + * identities in the system, including service accounts, nodes, and + * controllers, will have statically granted permissions beyond those + * provided by the RBAC configuration or IAM. + */ + enabled: boolean; + } /** - * Configuration for the legacy ABAC authorization mode. - */ - legacyAbac: Schema$LegacyAbac; + * ListClustersResponse is the result of ListClustersRequest. + */ + export interface Schema$ListClustersResponse { + /** + * A list of clusters in the project in the specified zone, or across all + * ones. + */ + clusters: Schema$Cluster[]; + /** + * If any zones are listed here, the list of clusters returned may be + * missing those zones. + */ + missingZones: string[]; + } /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/regions-zones/regions-zones#available) or - * [region](/compute/docs/regions-zones/regions-zones#available) in which the - * cluster resides. + * ListNodePoolsResponse is the result of ListNodePoolsRequest. */ - location: string; + export interface Schema$ListNodePoolsResponse { + /** + * A list of node pools for a cluster. + */ + nodePools: Schema$NodePool[]; + } /** - * The list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. - */ - locations: string[]; + * ListOperationsResponse is the result of ListOperationsRequest. + */ + export interface Schema$ListOperationsResponse { + /** + * If any zones are listed here, the list of operations returned may be + * missing the operations from those zones. + */ + missingZones: string[]; + /** + * A list of operations in the project in the specified zone. + */ + operations: Schema$Operation[]; + } /** - * The logging service the cluster should use to write logs. Currently - * available options: * `logging.googleapis.com` - the Google Cloud Logging - * service. * `none` - no logs will be exported from the cluster. * if left as - * an empty string,`logging.googleapis.com` will be used. + * MaintenancePolicy defines the maintenance policy to be used for the + * cluster. */ - loggingService: string; + export interface Schema$MaintenancePolicy { + /** + * Specifies the maintenance window in which maintenance may be performed. + */ + window: Schema$MaintenanceWindow; + } /** - * Configure the maintenance policy for this cluster. + * MaintenanceWindow defines the maintenance window to be used for the + * cluster. */ - maintenancePolicy: Schema$MaintenancePolicy; + export interface Schema$MaintenanceWindow { + /** + * DailyMaintenanceWindow specifies a daily maintenance operation window. + */ + dailyMaintenanceWindow: Schema$DailyMaintenanceWindow; + } /** * The authentication information for accessing the master endpoint. - */ - masterAuth: Schema$MasterAuth; - /** - * Master authorized networks is a Beta feature. The configuration options for - * master authorized networks feature. - */ - masterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * `monitoring.googleapis.com` - the Google Cloud - * Monitoring service. * `none` - no metrics will be exported from the - * cluster. * if left as an empty string, `monitoring.googleapis.com` will be - * used. - */ - monitoringService: string; - /** - * The name of this cluster. The name must be unique within this project and - * zone, and can be up to 40 characters with the following restrictions: * - * Lowercase letters, numbers, and hyphens only. * Must start with a letter. * - * Must end with a number or a letter. - */ - name: string; + * Authentication can be done using HTTP basic auth or using client + * certificates. + */ + export interface Schema$MasterAuth { + /** + * [Output only] Base64-encoded public certificate used by clients to + * authenticate to the cluster endpoint. + */ + clientCertificate: string; + /** + * Configuration for client certificate authentication on the cluster. If + * no configuration is specified, a client certificate is issued. + */ + clientCertificateConfig: Schema$ClientCertificateConfig; + /** + * [Output only] Base64-encoded private key used by clients to authenticate + * to the cluster endpoint. + */ + clientKey: string; + /** + * [Output only] Base64-encoded public certificate that is the root of trust + * for the cluster. + */ + clusterCaCertificate: string; + /** + * The password to use for HTTP basic authentication to the master endpoint. + * Because the master endpoint is open to the Internet, you should create a + * strong password. If a password is provided for cluster creation, + * username must be non-empty. + */ + password: string; + /** + * The username to use for HTTP basic authentication to the master endpoint. + * For clusters v1.6.0 and later, you can disable basic authentication by + * providing an empty username. + */ + username: string; + } /** - * The name of the Google Compute Engine - * [network](/compute/docs/networks-and-firewalls#networks) to which the - * cluster is connected. If left unspecified, the `default` network will be - * used. - */ - network: string; + * Master authorized networks is a Beta feature. Configuration options for the + * master authorized networks feature. Enabled master authorized networks will + * disallow all external traffic to access Kubernetes master through HTTPS + * except traffic from the given CIDR blocks, Google Compute Engine Public IPs + * and Google Prod IPs. + */ + export interface Schema$MasterAuthorizedNetworksConfig { + /** + * cidr_blocks define up to 10 external networks that could access + * Kubernetes master through HTTPS. + */ + cidrBlocks: Schema$CidrBlock[]; + /** + * Whether or not master authorized networks is enabled. + */ + enabled: boolean; + } /** * Configuration options for the NetworkPolicy feature. - */ - networkPolicy: Schema$NetworkPolicy; - /** - * Parameters used in creating the cluster's nodes. See `nodeConfig` for - * the description of its properties. For requests, this field should only be - * used in lieu of a "node_pool" object, since this configuration - * (along with the "initial_node_count") will be used to create a - * "NodePool" object with an auto-generated name. Do not use this - * and a node_pool at the same time. For responses, this field will be - * populated with the node configuration of the first node pool. If - * unspecified, the defaults are used. - */ - nodeConfig: Schema$NodeConfig; - /** - * [Output only] The size of the address space on each node for hosting - * containers. This is provisioned from within the `container_ipv4_cidr` - * range. - */ - nodeIpv4CidrSize: number; - /** - * The node pools associated with this cluster. This field should not be set - * if "node_config" or "initial_node_count" are specified. - */ - nodePools: Schema$NodePool[]; - /** - * The resource labels for the cluster to use to annotate any related Google - * Compute Engine resources. - */ - resourceLabels: any; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The IP address range of the Kubernetes services in this - * cluster, in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the - * last `/16` from the container CIDR. - */ - servicesIpv4Cidr: string; - /** - * [Output only] The current status of this cluster. - */ - status: string; - /** - * [Output only] Additional information about the current status of this - * cluster, if available. - */ - statusMessage: string; - /** - * The name of the Google Compute Engine - * [subnetwork](/compute/docs/subnetworks) to which the cluster is connected. - */ - subnetwork: string; - /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field is deprecated, use location instead. - */ - zone: string; -} -/** - * ClusterUpdate describes an update to the cluster. Exactly one update can be - * applied to a cluster with each request, so at most one field can be provided. - */ -export interface Schema$ClusterUpdate { - /** - * Configurations for the various addons available to run in the cluster. - */ - desiredAddonsConfig: Schema$AddonsConfig; - /** - * The desired image type for the node pool. NOTE: Set the - * "desired_node_pool" field as well. - */ - desiredImageType: string; - /** - * The desired list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. Changing the locations a cluster is in will result in - * nodes being either created or removed from the cluster, depending on - * whether locations are being added or removed. This list must always - * include the cluster's primary zone. - */ - desiredLocations: string[]; - /** - * Master authorized networks is a Beta feature. The desired configuration - * options for master authorized networks feature. - */ - desiredMasterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; - /** - * The Kubernetes version to change the master to. Users may specify either - * explicit versions offered by Kubernetes Engine or version aliases, which - * have the following behavior: - "latest": picks the highest valid - * Kubernetes version - "1.X": picks the highest valid patch+gke.N - * patch in the 1.X version - "1.X.Y": picks the highest valid gke.N - * patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit - * Kubernetes version - "-": picks the default Kubernetes version - */ - desiredMasterVersion: string; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * "monitoring.googleapis.com" - the Google - * Cloud Monitoring service * "none" - no metrics will be exported - * from the cluster - */ - desiredMonitoringService: string; - /** - * Autoscaler configuration for the node pool specified in - * desired_node_pool_id. If there is only one pool in the cluster and - * desired_node_pool_id is not provided then the change applies to that single - * node pool. - */ - desiredNodePoolAutoscaling: Schema$NodePoolAutoscaling; - /** - * The node pool to be upgraded. This field is mandatory if - * "desired_node_version", "desired_image_family" or - * "desired_node_pool_autoscaling" is specified and there is more - * than one node pool on the cluster. - */ - desiredNodePoolId: string; - /** - * The Kubernetes version to change the nodes to (typically an upgrade). Users - * may specify either explicit versions offered by Kubernetes Engine or - * version aliases, which have the following behavior: - "latest": - * picks the highest valid Kubernetes version - "1.X": picks the - * highest valid patch+gke.N patch in the 1.X version - "1.X.Y": - * picks the highest valid gke.N patch in the 1.X.Y version - - * "1.X.Y-gke.N": picks an explicit Kubernetes version - - * "-": picks the Kubernetes master version - */ - desiredNodeVersion: string; -} -/** - * CompleteIPRotationRequest moves the cluster master back into single-IP mode. - */ -export interface Schema$CompleteIPRotationRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to complete IP - * rotation. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * CreateClusterRequest creates a cluster. - */ -export interface Schema$CreateClusterRequest { - /** - * A [cluster - * resource](/container-engine/reference/rest/v1/projects.zones.clusters) - */ - cluster: Schema$Cluster; - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format 'projects/x/locations/*'. - */ - parent: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the parent field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the parent field. - */ - zone: string; -} -/** - * CreateNodePoolRequest creates a node pool for a cluster. - */ -export interface Schema$CreateNodePoolRequest { + * https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ + */ + export interface Schema$NetworkPolicy { + /** + * Whether network policy is enabled on the cluster. + */ + enabled: boolean; + /** + * The selected network policy provider. + */ + provider: string; + } /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the parent field. + * Configuration for NetworkPolicy. This only tracks whether the addon is + * enabled or not on the Master, it does not track whether network policy is + * enabled for the nodes. */ - clusterId: string; + export interface Schema$NetworkPolicyConfig { + /** + * Whether NetworkPolicy is enabled for this cluster. + */ + disabled: boolean; + } /** - * The node pool to create. - */ - nodePool: Schema$NodePool; + * Parameters that describe the nodes in a cluster. + */ + export interface Schema$NodeConfig { + /** + * A list of hardware accelerators to be attached to each node. See + * https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + */ + accelerators: Schema$AcceleratorConfig[]; + /** + * Size of the disk attached to each node, specified in GB. The smallest + * allowed disk size is 10GB. If unspecified, the default disk size is + * 100GB. + */ + diskSizeGb: number; + /** + * The image type to use for this node. Note that for a given image type, + * the latest version of it will be used. + */ + imageType: string; + /** + * The map of Kubernetes labels (key/value pairs) to be applied to each + * node. These will added in addition to any default label(s) that + * Kubernetes may apply to the node. In case of conflict in label keys, the + * applied set may differ depending on the Kubernetes version -- it's + * best to assume the behavior is undefined and conflicts should be avoided. + * For more information, including usage and the valid values, see: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + */ + labels: any; + /** + * The number of local SSD disks to be attached to the node. The limit for + * this value is dependant upon the maximum number of disks available on a + * machine per zone. See: + * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + * for more information. + */ + localSsdCount: number; + /** + * The name of a Google Compute Engine [machine + * type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If + * unspecified, the default machine type is `n1-standard-1`. + */ + machineType: string; + /** + * The metadata key/value pairs assigned to instances in the cluster. Keys + * must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in + * length. These are reflected as part of a URL in the metadata server. + * Additionally, to avoid ambiguity, keys must not conflict with any other + * metadata keys for the project or be one of the reserved keys: + * "cluster-location" "cluster-name" + * "cluster-uid" "configure-sh" + * "gci-update-strategy" "gci-ensure-gke-docker" + * "instance-template" "kube-env" + * "startup-script" "user-data" Values are free-form + * strings, and only have meaning as interpreted by the image running in the + * instance. The only restriction placed on them is that each value's + * size must be less than or equal to 32 KB. The total size of all keys and + * values must be less than 512 KB. + */ + metadata: any; + /** + * Minimum CPU platform to be used by this instance. The instance may be + * scheduled on the specified or newer CPU platform. Applicable values are + * the friendly names of CPU platforms, such as <code>minCpuPlatform: + * &quot;Intel Haswell&quot;</code> or + * <code>minCpuPlatform: &quot;Intel Sandy + * Bridge&quot;</code>. For more information, read [how to specify + * min CPU + * platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + */ + minCpuPlatform: string; + /** + * The set of Google API scopes to be made available on all of the node VMs + * under the "default" service account. The following scopes are + * recommended, but not required, and by default are not included: * + * `https://www.googleapis.com/auth/compute` is required for mounting + * persistent storage on your nodes. * + * `https://www.googleapis.com/auth/devstorage.read_only` is required for + * communicating with **gcr.io** (the [Google Container + * Registry](/container-registry/)). If unspecified, no scopes are added, + * unless Cloud Logging or Cloud Monitoring are enabled, in which case their + * required scopes will be added. + */ + oauthScopes: string[]; + /** + * Whether the nodes are created as preemptible VM instances. See: + * https://cloud.google.com/compute/docs/instances/preemptible for more + * information about preemptible VM instances. + */ + preemptible: boolean; + /** + * The Google Cloud Platform Service Account to be used by the node VMs. If + * no Service Account is specified, the "default" service account + * is used. + */ + serviceAccount: string; + /** + * The list of instance tags applied to all nodes. Tags are used to identify + * valid sources or targets for network firewalls and are specified by the + * client during cluster or node pool creation. Each tag within the list + * must comply with RFC1035. + */ + tags: string[]; + } /** - * The parent (project, location, cluster id) where the node pool will be - * created. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - parent: string; + * NodeManagement defines the set of node management services turned on for + * the node pool. + */ + export interface Schema$NodeManagement { + /** + * A flag that specifies whether the node auto-repair is enabled for the + * node pool. If enabled, the nodes in this node pool will be monitored and, + * if they fail health checks too many times, an automatic repair action + * will be triggered. + */ + autoRepair: boolean; + /** + * A flag that specifies whether node auto-upgrade is enabled for the node + * pool. If enabled, node auto-upgrade helps keep the nodes in your node + * pool up to date with the latest release version of Kubernetes. + */ + autoUpgrade: boolean; + /** + * Specifies the Auto Upgrade knobs for the node pool. + */ + upgradeOptions: Schema$AutoUpgradeOptions; + } /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the parent field. - */ - projectId: string; + * NodePool contains the name and configuration for a cluster's node pool. + * Node pools are a set of nodes (i.e. VM's), with a common configuration + * and specification, under the control of the cluster master. They may have a + * set of Kubernetes labels applied to them, which may be used to reference + * them during pod scheduling. They may also be resized up or down, to + * accommodate the workload. + */ + export interface Schema$NodePool { + /** + * Autoscaler configuration for this NodePool. Autoscaler is enabled only if + * a valid configuration is present. + */ + autoscaling: Schema$NodePoolAutoscaling; + /** + * The node configuration of the pool. + */ + config: Schema$NodeConfig; + /** + * The initial node count for the pool. You must ensure that your Compute + * Engine <a href="/compute/docs/resource-quotas">resource + * quota</a> is sufficient for this number of instances. You must also + * have available firewall and routes quota. + */ + initialNodeCount: number; + /** + * [Output only] The resource URLs of the [managed instance + * groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) + * associated with this node pool. + */ + instanceGroupUrls: string[]; + /** + * NodeManagement configuration for this NodePool. + */ + management: Schema$NodeManagement; + /** + * The name of the node pool. + */ + name: string; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The status of the nodes in this pool instance. + */ + status: string; + /** + * [Output only] Additional information about the current status of this + * node pool instance, if available. + */ + statusMessage: string; + /** + * The version of the Kubernetes of this node. + */ + version: string; + } /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the parent field. - */ - zone: string; -} -/** - * Time window specified for daily maintenance operations. - */ -export interface Schema$DailyMaintenanceWindow { + * NodePoolAutoscaling contains information required by cluster autoscaler to + * adjust the size of the node pool to the current cluster usage. + */ + export interface Schema$NodePoolAutoscaling { + /** + * Is autoscaling enabled for this node pool. + */ + enabled: boolean; + /** + * Maximum number of nodes in the NodePool. Must be >= min_node_count. + * There has to enough quota to scale up the cluster. + */ + maxNodeCount: number; + /** + * Minimum number of nodes in the NodePool. Must be >= 1 and <= + * max_node_count. + */ + minNodeCount: number; + } /** - * [Output only] Duration of the time window, automatically chosen to be - * smallest possible in the given scenario. Duration will be in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) format - * "PTnHnMnS". - */ - duration: string; + * This operation resource represents operations that may have happened or are + * happening on the cluster. All fields are output only. + */ + export interface Schema$Operation { + /** + * Detailed operation progress, if available. + */ + detail: string; + /** + * [Output only] The time the operation completed, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + endTime: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/regions-zones/regions-zones#available) or + * [region](/compute/docs/regions-zones/regions-zones#available) in which + * the cluster resides. + */ + location: string; + /** + * The server-assigned ID for the operation. + */ + name: string; + /** + * The operation type. + */ + operationType: string; + /** + * Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The time the operation started, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + startTime: string; + /** + * The current status of the operation. + */ + status: string; + /** + * If an error has occurred, a textual description of the error. + */ + statusMessage: string; + /** + * Server-defined URL for the target of the operation. + */ + targetLink: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation is taking + * place. This field is deprecated, use location instead. + */ + zone: string; + } /** - * Time within the maintenance window to start the maintenance operations. - * Time format should be in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) - * format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. - */ - startTime: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Configuration options for the horizontal pod autoscaling feature, which - * increases or decreases the number of replica pods a replication controller - * has based on the resource usage of the existing pods. - */ -export interface Schema$HorizontalPodAutoscaling { + * RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed + * NodePool upgrade. This will be an no-op if the last upgrade successfully + * completed. + */ + export interface Schema$RollbackNodePoolUpgradeRequest { + /** + * Deprecated. The name of the cluster to rollback. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to rollback. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - * When enabled, it ensures that a Heapster pod is running in the cluster, - * which is also used by the Cloud Monitoring service. - */ - disabled: boolean; -} -/** - * Configuration options for the HTTP (L7) load balancing controller addon, - * which makes it easy to set up HTTP load balancers for services in a cluster. - */ -export interface Schema$HttpLoadBalancing { + * Kubernetes Engine service configuration. + */ + export interface Schema$ServerConfig { + /** + * Version of Kubernetes the service deploys by default. + */ + defaultClusterVersion: string; + /** + * Default image type. + */ + defaultImageType: string; + /** + * List of valid image types. + */ + validImageTypes: string[]; + /** + * List of valid master versions. + */ + validMasterVersions: string[]; + /** + * List of valid node upgrade target versions. + */ + validNodeVersions: string[]; + } /** - * Whether the HTTP Load Balancing controller is enabled in the cluster. When - * enabled, it runs a small pod in the cluster that manages the load - * balancers. - */ - disabled: boolean; -} -/** - * Configuration for controlling how IPs are allocated in the cluster. - */ -export interface Schema$IPAllocationPolicy { + * SetAddonsConfigRequest sets the addons associated with the cluster. + */ + export interface Schema$SetAddonsConfigRequest { + /** + * The desired configurations for the various addons available to run in the + * cluster. + */ + addonsConfig: Schema$AddonsConfig; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * This field is deprecated, use cluster_ipv4_cidr_block. - */ - clusterIpv4Cidr: string; + * SetLabelsRequest sets the Google Cloud Platform labels on a Google + * Container Engine cluster, which will in turn set them for Google Compute + * Engine resources used by that cluster + */ + export interface Schema$SetLabelsRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Kubernetes + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash when updating or + * changing labels. Make a <code>get()</code> request to the + * resource to get the latest fingerprint. + */ + labelFingerprint: string; + /** + * The name (project, location, cluster id) of the cluster to set labels. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * The labels to set for that cluster. + */ + resourceLabels: any; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * The IP address range for the cluster pod IPs. If this field is set, then - * `cluster.cluster_ipv4_cidr` must be left blank. This field is only - * applicable when `use_ip_aliases` is true. Set to blank to have a range - * chosen with the default size. Set to /netmask (e.g. `/14`) to have a range - * chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - clusterIpv4CidrBlock: string; + * SetLegacyAbacRequest enables or disables the ABAC authorization mechanism + * for a cluster. + */ + export interface Schema$SetLegacyAbacRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * Whether ABAC authorization will be enabled in the cluster. + */ + enabled: boolean; + /** + * The name (project, location, cluster id) of the cluster to set legacy + * abac. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * The name of the secondary range to be used for the cluster CIDR block. The - * secondary range will be used for pod IP addresses. This must be an existing - * secondary range associated with the cluster subnetwork. This field is only - * applicable with use_ip_aliases is true and create_subnetwork is false. - */ - clusterSecondaryRangeName: string; + * SetLocationsRequest sets the locations of the cluster. + */ + export interface Schema$SetLocationsRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. Changing the locations a cluster is in will + * result in nodes being either created or removed from the cluster, + * depending on whether locations are being added or removed. This list + * must always include the cluster's primary zone. + */ + locations: string[]; + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Whether a new subnetwork will be created automatically for the cluster. - * This field is only applicable when `use_ip_aliases` is true. - */ - createSubnetwork: boolean; + * SetLoggingServiceRequest sets the logging service of a cluster. + */ + export interface Schema$SetLoggingServiceRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The logging service the cluster should use to write metrics. Currently + * available options: * "logging.googleapis.com" - the Google + * Cloud Logging service * "none" - no metrics will be exported + * from the cluster + */ + loggingService: string; + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * This field is deprecated, use node_ipv4_cidr_block. - */ - nodeIpv4Cidr: string; + * SetMaintenancePolicyRequest sets the maintenance policy for a cluster. + */ + export interface Schema$SetMaintenancePolicyRequest { + /** + * The name of the cluster to update. + */ + clusterId: string; + /** + * The maintenance policy to be set for the cluster. An empty field clears + * the existing maintenance policy. + */ + maintenancePolicy: Schema$MaintenancePolicy; + /** + * The name (project, location, cluster id) of the cluster to set + * maintenance policy. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. + */ + zone: string; + } /** - * The IP address range of the instance IPs in this cluster. This is - * applicable only if `create_subnetwork` is true. Set to blank to have a - * range chosen with the default size. Set to /netmask (e.g. `/14`) to have a - * range chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - nodeIpv4CidrBlock: string; + * SetMasterAuthRequest updates the admin password of a cluster. + */ + export interface Schema$SetMasterAuthRequest { + /** + * The exact form of action to be taken on the master auth. + */ + action: string; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * A description of the update. + */ + update: Schema$MasterAuth; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * This field is deprecated, use services_ipv4_cidr_block. - */ - servicesIpv4Cidr: string; + * SetMonitoringServiceRequest sets the monitoring service of a cluster. + */ + export interface Schema$SetMonitoringServiceRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * "monitoring.googleapis.com" - the Google + * Cloud Monitoring service * "none" - no metrics will be exported + * from the cluster + */ + monitoringService: string; + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * The IP address range of the services IPs in this cluster. If blank, a range - * will be automatically chosen with the default size. This field is only - * applicable when `use_ip_aliases` is true. Set to blank to have a range - * chosen with the default size. Set to /netmask (e.g. `/14`) to have a range - * chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - servicesIpv4CidrBlock: string; + * SetNetworkPolicyRequest enables/disables network policy for a cluster. + */ + export interface Schema$SetNetworkPolicyRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to set networking + * policy. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Configuration options for the NetworkPolicy feature. + */ + networkPolicy: Schema$NetworkPolicy; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * The name of the secondary range to be used as for the services CIDR block. - * The secondary range will be used for service ClusterIPs. This must be an - * existing secondary range associated with the cluster subnetwork. This - * field is only applicable with use_ip_aliases is true and create_subnetwork - * is false. - */ - servicesSecondaryRangeName: string; + * SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. + */ + export interface Schema$SetNodePoolAutoscalingRequest { + /** + * Autoscaling configuration for the node pool. + */ + autoscaling: Schema$NodePoolAutoscaling; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to upgrade. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * A custom subnetwork name to be used if `create_subnetwork` is true. If - * this field is empty, then an automatic name will be chosen for the new - * subnetwork. - */ - subnetworkName: string; + * SetNodePoolManagementRequest sets the node management properties of a node + * pool. + */ + export interface Schema$SetNodePoolManagementRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * NodeManagement configuration for the node pool. + */ + management: Schema$NodeManagement; + /** + * The name (project, location, cluster, node pool id) of the node pool to + * set management properties. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to update. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Whether alias IPs will be used for pod IPs in the cluster. - */ - useIpAliases: boolean; -} -/** - * Configuration for the Kubernetes Dashboard. - */ -export interface Schema$KubernetesDashboard { + * SetNodePoolSizeRequest sets the size a node pool. + */ + export interface Schema$SetNodePoolSizeRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool id) of the node pool to + * set size. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * The desired node count for the pool. + */ + nodeCount: number; + /** + * Deprecated. The name of the node pool to update. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Whether the Kubernetes Dashboard is enabled for this cluster. - */ - disabled: boolean; -} -/** - * Configuration for the legacy Attribute Based Access Control authorization - * mode. - */ -export interface Schema$LegacyAbac { + * StartIPRotationRequest creates a new IP for the cluster and then performs a + * node upgrade on each node pool to point to the new IP. + */ + export interface Schema$StartIPRotationRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to start IP + * rotation. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Whether to rotate credentials during IP rotation. + */ + rotateCredentials: boolean; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * Whether the ABAC authorizer is enabled for this cluster. When enabled, - * identities in the system, including service accounts, nodes, and - * controllers, will have statically granted permissions beyond those provided - * by the RBAC configuration or IAM. - */ - enabled: boolean; -} -/** - * ListClustersResponse is the result of ListClustersRequest. - */ -export interface Schema$ListClustersResponse { + * UpdateClusterRequest updates the settings of a cluster. + */ + export interface Schema$UpdateClusterRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to update. Specified + * in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * A description of the update. + */ + update: Schema$ClusterUpdate; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * A list of clusters in the project in the specified zone, or across all - * ones. - */ - clusters: Schema$Cluster[]; + * UpdateMasterRequest updates the master of the cluster. + */ + export interface Schema$UpdateMasterRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The Kubernetes version to change the master to. Users may specify either + * explicit versions offered by Kubernetes Engine or version aliases, which + * have the following behavior: - "latest": picks the highest + * valid Kubernetes version - "1.X": picks the highest valid + * patch+gke.N patch in the 1.X version - "1.X.Y": picks the + * highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": + * picks an explicit Kubernetes version - "-": picks the default + * Kubernetes version + */ + masterVersion: string; + /** + * The name (project, location, cluster) of the cluster to update. Specified + * in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; + } /** - * If any zones are listed here, the list of clusters returned may be missing - * those zones. - */ - missingZones: string[]; -} -/** - * ListNodePoolsResponse is the result of ListNodePoolsRequest. - */ -export interface Schema$ListNodePoolsResponse { - /** - * A list of node pools for a cluster. - */ - nodePools: Schema$NodePool[]; -} -/** - * ListOperationsResponse is the result of ListOperationsRequest. - */ -export interface Schema$ListOperationsResponse { - /** - * If any zones are listed here, the list of operations returned may be - * missing the operations from those zones. - */ - missingZones: string[]; - /** - * A list of operations in the project in the specified zone. - */ - operations: Schema$Operation[]; -} -/** - * MaintenancePolicy defines the maintenance policy to be used for the cluster. - */ -export interface Schema$MaintenancePolicy { - /** - * Specifies the maintenance window in which maintenance may be performed. - */ - window: Schema$MaintenanceWindow; -} -/** - * MaintenanceWindow defines the maintenance window to be used for the cluster. - */ -export interface Schema$MaintenanceWindow { - /** - * DailyMaintenanceWindow specifies a daily maintenance operation window. - */ - dailyMaintenanceWindow: Schema$DailyMaintenanceWindow; -} -/** - * The authentication information for accessing the master endpoint. - * Authentication can be done using HTTP basic auth or using client - * certificates. - */ -export interface Schema$MasterAuth { - /** - * [Output only] Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. - */ - clientCertificate: string; - /** - * Configuration for client certificate authentication on the cluster. If no - * configuration is specified, a client certificate is issued. - */ - clientCertificateConfig: Schema$ClientCertificateConfig; - /** - * [Output only] Base64-encoded private key used by clients to authenticate to - * the cluster endpoint. - */ - clientKey: string; - /** - * [Output only] Base64-encoded public certificate that is the root of trust - * for the cluster. - */ - clusterCaCertificate: string; - /** - * The password to use for HTTP basic authentication to the master endpoint. - * Because the master endpoint is open to the Internet, you should create a - * strong password. If a password is provided for cluster creation, username - * must be non-empty. - */ - password: string; - /** - * The username to use for HTTP basic authentication to the master endpoint. - * For clusters v1.6.0 and later, you can disable basic authentication by - * providing an empty username. - */ - username: string; -} -/** - * Master authorized networks is a Beta feature. Configuration options for the - * master authorized networks feature. Enabled master authorized networks will - * disallow all external traffic to access Kubernetes master through HTTPS - * except traffic from the given CIDR blocks, Google Compute Engine Public IPs - * and Google Prod IPs. - */ -export interface Schema$MasterAuthorizedNetworksConfig { - /** - * cidr_blocks define up to 10 external networks that could access Kubernetes - * master through HTTPS. - */ - cidrBlocks: Schema$CidrBlock[]; - /** - * Whether or not master authorized networks is enabled. - */ - enabled: boolean; -} -/** - * Configuration options for the NetworkPolicy feature. - * https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ - */ -export interface Schema$NetworkPolicy { - /** - * Whether network policy is enabled on the cluster. - */ - enabled: boolean; - /** - * The selected network policy provider. - */ - provider: string; -} -/** - * Configuration for NetworkPolicy. This only tracks whether the addon is - * enabled or not on the Master, it does not track whether network policy is - * enabled for the nodes. - */ -export interface Schema$NetworkPolicyConfig { - /** - * Whether NetworkPolicy is enabled for this cluster. - */ - disabled: boolean; -} -/** - * Parameters that describe the nodes in a cluster. - */ -export interface Schema$NodeConfig { - /** - * A list of hardware accelerators to be attached to each node. See - * https://cloud.google.com/compute/docs/gpus for more information about - * support for GPUs. - */ - accelerators: Schema$AcceleratorConfig[]; - /** - * Size of the disk attached to each node, specified in GB. The smallest - * allowed disk size is 10GB. If unspecified, the default disk size is 100GB. - */ - diskSizeGb: number; - /** - * The image type to use for this node. Note that for a given image type, the - * latest version of it will be used. - */ - imageType: string; - /** - * The map of Kubernetes labels (key/value pairs) to be applied to each node. - * These will added in addition to any default label(s) that Kubernetes may - * apply to the node. In case of conflict in label keys, the applied set may - * differ depending on the Kubernetes version -- it's best to assume the - * behavior is undefined and conflicts should be avoided. For more - * information, including usage and the valid values, see: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - */ - labels: any; - /** - * The number of local SSD disks to be attached to the node. The limit for - * this value is dependant upon the maximum number of disks available on a - * machine per zone. See: - * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits for - * more information. - */ - localSsdCount: number; - /** - * The name of a Google Compute Engine [machine - * type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If unspecified, - * the default machine type is `n1-standard-1`. - */ - machineType: string; - /** - * The metadata key/value pairs assigned to instances in the cluster. Keys - * must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in - * length. These are reflected as part of a URL in the metadata server. - * Additionally, to avoid ambiguity, keys must not conflict with any other - * metadata keys for the project or be one of the reserved keys: - * "cluster-location" "cluster-name" - * "cluster-uid" "configure-sh" - * "gci-update-strategy" "gci-ensure-gke-docker" - * "instance-template" "kube-env" - * "startup-script" "user-data" Values are free-form - * strings, and only have meaning as interpreted by the image running in the - * instance. The only restriction placed on them is that each value's size - * must be less than or equal to 32 KB. The total size of all keys and values - * must be less than 512 KB. - */ - metadata: any; - /** - * Minimum CPU platform to be used by this instance. The instance may be - * scheduled on the specified or newer CPU platform. Applicable values are the - * friendly names of CPU platforms, such as <code>minCpuPlatform: - * &quot;Intel Haswell&quot;</code> or - * <code>minCpuPlatform: &quot;Intel Sandy - * Bridge&quot;</code>. For more information, read [how to specify - * min CPU - * platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - */ - minCpuPlatform: string; - /** - * The set of Google API scopes to be made available on all of the node VMs - * under the "default" service account. The following scopes are - * recommended, but not required, and by default are not included: * - * `https://www.googleapis.com/auth/compute` is required for mounting - * persistent storage on your nodes. * - * `https://www.googleapis.com/auth/devstorage.read_only` is required for - * communicating with **gcr.io** (the [Google Container - * Registry](/container-registry/)). If unspecified, no scopes are added, - * unless Cloud Logging or Cloud Monitoring are enabled, in which case their - * required scopes will be added. - */ - oauthScopes: string[]; - /** - * Whether the nodes are created as preemptible VM instances. See: - * https://cloud.google.com/compute/docs/instances/preemptible for more - * information about preemptible VM instances. - */ - preemptible: boolean; - /** - * The Google Cloud Platform Service Account to be used by the node VMs. If no - * Service Account is specified, the "default" service account is - * used. - */ - serviceAccount: string; - /** - * The list of instance tags applied to all nodes. Tags are used to identify - * valid sources or targets for network firewalls and are specified by the - * client during cluster or node pool creation. Each tag within the list must - * comply with RFC1035. - */ - tags: string[]; -} -/** - * NodeManagement defines the set of node management services turned on for the - * node pool. - */ -export interface Schema$NodeManagement { - /** - * A flag that specifies whether the node auto-repair is enabled for the node - * pool. If enabled, the nodes in this node pool will be monitored and, if - * they fail health checks too many times, an automatic repair action will be - * triggered. - */ - autoRepair: boolean; - /** - * A flag that specifies whether node auto-upgrade is enabled for the node - * pool. If enabled, node auto-upgrade helps keep the nodes in your node pool - * up to date with the latest release version of Kubernetes. - */ - autoUpgrade: boolean; - /** - * Specifies the Auto Upgrade knobs for the node pool. - */ - upgradeOptions: Schema$AutoUpgradeOptions; -} -/** - * NodePool contains the name and configuration for a cluster's node pool. - * Node pools are a set of nodes (i.e. VM's), with a common configuration - * and specification, under the control of the cluster master. They may have a - * set of Kubernetes labels applied to them, which may be used to reference them - * during pod scheduling. They may also be resized up or down, to accommodate - * the workload. - */ -export interface Schema$NodePool { - /** - * Autoscaler configuration for this NodePool. Autoscaler is enabled only if a - * valid configuration is present. - */ - autoscaling: Schema$NodePoolAutoscaling; - /** - * The node configuration of the pool. - */ - config: Schema$NodeConfig; - /** - * The initial node count for the pool. You must ensure that your Compute - * Engine <a href="/compute/docs/resource-quotas">resource - * quota</a> is sufficient for this number of instances. You must also - * have available firewall and routes quota. - */ - initialNodeCount: number; - /** - * [Output only] The resource URLs of the [managed instance - * groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) - * associated with this node pool. - */ - instanceGroupUrls: string[]; - /** - * NodeManagement configuration for this NodePool. - */ - management: Schema$NodeManagement; - /** - * The name of the node pool. - */ - name: string; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The status of the nodes in this pool instance. - */ - status: string; - /** - * [Output only] Additional information about the current status of this node - * pool instance, if available. - */ - statusMessage: string; - /** - * The version of the Kubernetes of this node. - */ - version: string; -} -/** - * NodePoolAutoscaling contains information required by cluster autoscaler to - * adjust the size of the node pool to the current cluster usage. - */ -export interface Schema$NodePoolAutoscaling { - /** - * Is autoscaling enabled for this node pool. - */ - enabled: boolean; - /** - * Maximum number of nodes in the NodePool. Must be >= min_node_count. - * There has to enough quota to scale up the cluster. - */ - maxNodeCount: number; - /** - * Minimum number of nodes in the NodePool. Must be >= 1 and <= - * max_node_count. - */ - minNodeCount: number; -} -/** - * This operation resource represents operations that may have happened or are - * happening on the cluster. All fields are output only. - */ -export interface Schema$Operation { - /** - * Detailed operation progress, if available. - */ - detail: string; - /** - * [Output only] The time the operation completed, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - endTime: string; - /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/regions-zones/regions-zones#available) or - * [region](/compute/docs/regions-zones/regions-zones#available) in which the - * cluster resides. - */ - location: string; - /** - * The server-assigned ID for the operation. - */ - name: string; - /** - * The operation type. - */ - operationType: string; - /** - * Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The time the operation started, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - startTime: string; - /** - * The current status of the operation. - */ - status: string; - /** - * If an error has occurred, a textual description of the error. - */ - statusMessage: string; - /** - * Server-defined URL for the target of the operation. - */ - targetLink: string; - /** - * The name of the Google Compute Engine [zone](/compute/docs/zones#available) - * in which the operation is taking place. This field is deprecated, use - * location instead. - */ - zone: string; -} -/** - * RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed - * NodePool upgrade. This will be an no-op if the last upgrade successfully - * completed. - */ -export interface Schema$RollbackNodePoolUpgradeRequest { - /** - * Deprecated. The name of the cluster to rollback. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to rollback. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * Kubernetes Engine service configuration. - */ -export interface Schema$ServerConfig { - /** - * Version of Kubernetes the service deploys by default. - */ - defaultClusterVersion: string; - /** - * Default image type. - */ - defaultImageType: string; - /** - * List of valid image types. - */ - validImageTypes: string[]; - /** - * List of valid master versions. - */ - validMasterVersions: string[]; - /** - * List of valid node upgrade target versions. - */ - validNodeVersions: string[]; -} -/** - * SetAddonsConfigRequest sets the addons associated with the cluster. - */ -export interface Schema$SetAddonsConfigRequest { - /** - * The desired configurations for the various addons available to run in the - * cluster. - */ - addonsConfig: Schema$AddonsConfig; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLabelsRequest sets the Google Cloud Platform labels on a Google Container - * Engine cluster, which will in turn set them for Google Compute Engine - * resources used by that cluster - */ -export interface Schema$SetLabelsRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Kubernetes - * Engine and changes after every request to modify or update labels. You must - * always provide an up-to-date fingerprint hash when updating or changing - * labels. Make a <code>get()</code> request to the resource to - * get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The name (project, location, cluster id) of the cluster to set labels. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * The labels to set for that cluster. - */ - resourceLabels: any; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for - * a cluster. - */ -export interface Schema$SetLegacyAbacRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * Whether ABAC authorization will be enabled in the cluster. - */ - enabled: boolean; - /** - * The name (project, location, cluster id) of the cluster to set legacy abac. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLocationsRequest sets the locations of the cluster. - */ -export interface Schema$SetLocationsRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The desired list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. Changing the locations a cluster is in will result in - * nodes being either created or removed from the cluster, depending on - * whether locations are being added or removed. This list must always - * include the cluster's primary zone. - */ - locations: string[]; - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLoggingServiceRequest sets the logging service of a cluster. - */ -export interface Schema$SetLoggingServiceRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The logging service the cluster should use to write metrics. Currently - * available options: * "logging.googleapis.com" - the Google Cloud - * Logging service * "none" - no metrics will be exported from the - * cluster - */ - loggingService: string; - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - */ -export interface Schema$SetMaintenancePolicyRequest { - /** - * The name of the cluster to update. - */ - clusterId: string; - /** - * The maintenance policy to be set for the cluster. An empty field clears the - * existing maintenance policy. - */ - maintenancePolicy: Schema$MaintenancePolicy; - /** - * The name (project, location, cluster id) of the cluster to set maintenance - * policy. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). - */ - projectId: string; - /** - * The name of the Google Compute Engine [zone](/compute/docs/zones#available) - * in which the cluster resides. - */ - zone: string; -} -/** - * SetMasterAuthRequest updates the admin password of a cluster. - */ -export interface Schema$SetMasterAuthRequest { - /** - * The exact form of action to be taken on the master auth. - */ - action: string; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to set auth. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * A description of the update. - */ - update: Schema$MasterAuth; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetMonitoringServiceRequest sets the monitoring service of a cluster. - */ -export interface Schema$SetMonitoringServiceRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * "monitoring.googleapis.com" - the Google - * Cloud Monitoring service * "none" - no metrics will be exported - * from the cluster - */ - monitoringService: string; - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNetworkPolicyRequest enables/disables network policy for a cluster. - */ -export interface Schema$SetNetworkPolicyRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to set networking - * policy. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Configuration options for the NetworkPolicy feature. - */ - networkPolicy: Schema$NetworkPolicy; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. - */ -export interface Schema$SetNodePoolAutoscalingRequest { - /** - * Autoscaling configuration for the node pool. - */ - autoscaling: Schema$NodePoolAutoscaling; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to upgrade. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolManagementRequest sets the node management properties of a node - * pool. - */ -export interface Schema$SetNodePoolManagementRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * NodeManagement configuration for the node pool. - */ - management: Schema$NodeManagement; - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to update. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolSizeRequest sets the size a node pool. - */ -export interface Schema$SetNodePoolSizeRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * The desired node count for the pool. - */ - nodeCount: number; - /** - * Deprecated. The name of the node pool to update. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * StartIPRotationRequest creates a new IP for the cluster and then performs a - * node upgrade on each node pool to point to the new IP. - */ -export interface Schema$StartIPRotationRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to start IP - * rotation. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Whether to rotate credentials during IP rotation. - */ - rotateCredentials: boolean; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UpdateClusterRequest updates the settings of a cluster. - */ -export interface Schema$UpdateClusterRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to update. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * A description of the update. - */ - update: Schema$ClusterUpdate; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UpdateMasterRequest updates the master of the cluster. - */ -export interface Schema$UpdateMasterRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The Kubernetes version to change the master to. Users may specify either - * explicit versions offered by Kubernetes Engine or version aliases, which - * have the following behavior: - "latest": picks the highest valid - * Kubernetes version - "1.X": picks the highest valid patch+gke.N - * patch in the 1.X version - "1.X.Y": picks the highest valid gke.N - * patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit - * Kubernetes version - "-": picks the default Kubernetes version - */ - masterVersion: string; - /** - * The name (project, location, cluster) of the cluster to update. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UpdateNodePoolRequests update a node pool's image and/or version. - */ -export interface Schema$UpdateNodePoolRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The desired image type for the node pool. - */ - imageType: string; - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to upgrade. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * The Kubernetes version to change the nodes to (typically an upgrade). Users - * may specify either explicit versions offered by Kubernetes Engine or - * version aliases, which have the following behavior: - "latest": - * picks the highest valid Kubernetes version - "1.X": picks the - * highest valid patch+gke.N patch in the 1.X version - "1.X.Y": - * picks the highest valid gke.N patch in the 1.X.Y version - - * "1.X.Y-gke.N": picks an explicit Kubernetes version - - * "-": picks the Kubernetes master version - */ - nodeVersion: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} - -export class Resource$Projects { - root: Container; - locations: Resource$Projects$Locations; - zones: Resource$Projects$Zones; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - this.zones = new Resource$Projects$Zones(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations { - root: Container; - clusters: Resource$Projects$Locations$Clusters; - operations: Resource$Projects$Locations$Operations; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Locations$Clusters(root); - this.operations = new Resource$Projects$Locations$Operations(root); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.locations.getServerConfig - * @desc Returns configuration info about the Kubernetes Engine service. - * @alias container.projects.locations.getServerConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getServerConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getServerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/serverConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Clusters { - root: Container; - nodePools: Resource$Projects$Locations$Clusters$Nodepools; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.nodePools = new Resource$Projects$Locations$Clusters$Nodepools(root); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.locations.clusters.completeIpRotation - * @desc Completes master IP rotation. - * @alias container.projects.locations.clusters.completeIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().CompleteIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - completeIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:completeIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.create - * @desc Creates a cluster, consisting of the specified number and type of - * Google Compute Engine instances. By default, the cluster is created in the - * project's [default network](/compute/docs/networks-and-firewalls#networks). - * One firewall is added for the cluster. After cluster creation, the cluster - * creates routes for each node to allow the containers on that node to - * communicate with all other instances in the cluster. Finally, an entry is - * added to the project's global metadata indicating which CIDR range is being - * used by the cluster. - * @alias container.projects.locations.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the cluster will be created. Specified in the format 'projects/x/locations/x'. - * @param {().CreateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.delete - * @desc Deletes the cluster, including the Kubernetes endpoint and all worker - * nodes. Firewalls and routes that were configured during cluster creation - * are also deleted. Other Google Compute Engine resources that might be in - * use by the cluster (e.g. load balancer resources) will not be deleted if - * they weren't present at the initial create time. - * @alias container.projects.locations.clusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.get - * @desc Gets the details of a specific cluster. - * @alias container.projects.locations.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.list - * @desc Lists all clusters owned by a project in either the specified zone or - * all zones. - * @alias container.projects.locations.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setAddons - * @desc Sets the addons of a specific cluster. - * @alias container.projects.locations.clusters.setAddons - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set addons. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetAddonsConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAddons(params?: any, options?: MethodOptions): - AxiosPromise; - setAddons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAddons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setAddons') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setLegacyAbac - * @desc Enables or disables the ABAC authorization mechanism on a cluster. - * @alias container.projects.locations.clusters.setLegacyAbac - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLegacyAbacRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLegacyAbac(params?: any, options?: MethodOptions): - AxiosPromise; - setLegacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLegacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setLegacyAbac') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setLocations - * @desc Sets the locations of a specific cluster. - * @alias container.projects.locations.clusters.setLocations - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set locations. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLocationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLocations(params?: any, options?: MethodOptions): - AxiosPromise; - setLocations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLocations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setLocations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setLogging - * @desc Sets the logging service of a specific cluster. - * @alias container.projects.locations.clusters.setLogging - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set logging. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLoggingServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLogging(params?: any, options?: MethodOptions): - AxiosPromise; - setLogging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLogging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setLogging') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setMaintenancePolicy - * @desc Sets the maintenance policy for a cluster. - * @alias container.projects.locations.clusters.setMaintenancePolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMaintenancePolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMaintenancePolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setMaintenancePolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setMasterAuth - * @desc Used to set master auth materials. Currently supports :- Changing the - * admin password of a specific cluster. This can be either via password - * generation or explicitly set the password. - * @alias container.projects.locations.clusters.setMasterAuth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set auth. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMasterAuthRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMasterAuth(params?: any, options?: MethodOptions): - AxiosPromise; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setMasterAuth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setMonitoring - * @desc Sets the monitoring service of a specific cluster. - * @alias container.projects.locations.clusters.setMonitoring - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set monitoring. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMonitoringServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMonitoring(params?: any, options?: MethodOptions): - AxiosPromise; - setMonitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMonitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setMonitoring') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setNetworkPolicy - * @desc Enables/Disables Network Policy for a cluster. - * @alias container.projects.locations.clusters.setNetworkPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetNetworkPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNetworkPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setNetworkPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.setResourceLabels - * @desc Sets labels on a cluster. - * @alias container.projects.locations.clusters.setResourceLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set labels. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setResourceLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setResourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setResourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setResourceLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.startIpRotation - * @desc Start master IP rotation. - * @alias container.projects.locations.clusters.startIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().StartIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:startIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.update - * @desc Updates the settings of a specific cluster. - * @alias container.projects.locations.clusters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().UpdateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.updateMaster - * @desc Updates the master of a specific cluster. - * @alias container.projects.locations.clusters.updateMaster - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().UpdateMasterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateMaster(params?: any, options?: MethodOptions): - AxiosPromise; - updateMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:updateMaster') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Clusters$Nodepools { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.locations.clusters.nodePools.create - * @desc Creates a node pool for a cluster. - * @alias container.projects.locations.clusters.nodePools.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project, location, cluster id) where the node pool will be created. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().CreateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.delete - * @desc Deletes a node pool from a cluster. - * @alias container.projects.locations.clusters.nodePools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string=} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.get - * @desc Retrieves the node pool requested. - * @alias container.projects.locations.clusters.nodePools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string=} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.list - * @desc Lists the node pools for a cluster. - * @alias container.projects.locations.clusters.nodePools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.rollback - * @desc Roll back the previously Aborted or Failed NodePool upgrade. This - * will be an no-op if the last upgrade successfully completed. - * @alias container.projects.locations.clusters.nodePools.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.setAutoscaling - * @desc Sets the autoscaling settings of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.setAutoscaling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAutoscaling(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setAutoscaling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.setManagement - * @desc Sets the NodeManagement options for a node pool. - * @alias container.projects.locations.clusters.nodePools.setManagement - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set management properties. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolManagementRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setManagement(params?: any, options?: MethodOptions): - AxiosPromise; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setManagement') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.setSize - * @desc Sets the size of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.setSize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set size. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolSizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSize(params?: any, options?: MethodOptions): - AxiosPromise; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:setSize').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.nodePools.update - * @desc Updates the version and/or image type of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to update. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().UpdateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Projects$Locations$Operations { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.locations.operations.cancel - * @desc Cancels the specified operation. - * @alias container.projects.locations.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, operation id) of the operation to cancel. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.operations.get - * @desc Gets the specified operation. - * @alias container.projects.locations.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {string=} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.operations.list - * @desc Lists all operations in a project in a specific zone or all zones. - * @alias container.projects.locations.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Projects$Zones { - root: Container; - clusters: Resource$Projects$Zones$Clusters; - operations: Resource$Projects$Zones$Operations; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Zones$Clusters(root); - this.operations = new Resource$Projects$Zones$Operations(root); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.zones.getServerconfig - * @desc Returns configuration info about the Kubernetes Engine service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) - * // to return operations for. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.getServerconfig(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.getServerconfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getServerconfig(params?: any, options?: MethodOptions): - AxiosPromise; - getServerconfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServerconfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{projectId}/zones/{zone}/serverconfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Zones$Clusters { - root: Container; - nodePools: Resource$Projects$Zones$Clusters$Nodepools; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.nodePools = new Resource$Projects$Zones$Clusters$Nodepools(root); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.zones.clusters.addons - * @desc Sets the addons of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.addons(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.addons - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetAddonsConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addons(params?: any, options?: MethodOptions): AxiosPromise; - addons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.completeIpRotation - * @desc Completes master IP rotation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.completeIpRotation(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.completeIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().CompleteIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - completeIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.create - * @desc Creates a cluster, consisting of the specified number and type of - * Google Compute Engine instances. By default, the cluster is created in the - * project's [default network](/compute/docs/networks-and-firewalls#networks). - * One firewall is added for the cluster. After cluster creation, the cluster - * creates routes for each node to allow the containers on that node to - * communicate with all other instances in the cluster. Finally, an entry is - * added to the project's global metadata indicating which CIDR range is being - * used by the cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.create(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {().CreateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/zones/{zone}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.delete - * @desc Deletes the cluster, including the Kubernetes endpoint and all worker - * nodes. Firewalls and routes that were configured during cluster creation - * are also deleted. Other Google Compute Engine resources that might be in - * use by the cluster (e.g. load balancer resources) will not be deleted if - * they weren't present at the initial create time. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to delete. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.delete(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.get - * @desc Gets the details of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to retrieve. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.legacyAbac - * @desc Enables or disables the ABAC authorization mechanism on a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to update. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.legacyAbac(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.legacyAbac - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLegacyAbacRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - legacyAbac(params?: any, options?: MethodOptions): - AxiosPromise; - legacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - legacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.list - * @desc Lists all clusters owned by a project in either the specified zone or - * all zones. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides, or "-" for all zones. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/zones/{zone}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.locations - * @desc Sets the locations of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.locations(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.locations - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLocationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - locations(params?: any, options?: MethodOptions): - AxiosPromise; - locations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - locations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.logging - * @desc Sets the logging service of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.logging(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.logging - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLoggingServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - logging(params?: any, options?: MethodOptions): - AxiosPromise; - logging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - logging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.master - * @desc Updates the master of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.master(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.master - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateMasterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - master(params?: any, options?: MethodOptions): AxiosPromise; - master( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - master( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.monitoring - * @desc Sets the monitoring service of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.monitoring(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.monitoring - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetMonitoringServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - monitoring(params?: any, options?: MethodOptions): - AxiosPromise; - monitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - monitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.resourceLabels - * @desc Sets labels on a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.resourceLabels(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.resourceLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resourceLabels(params?: any, options?: MethodOptions): - AxiosPromise; - resourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.setMaintenancePolicy - * @desc Sets the maintenance policy for a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to update. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setMaintenancePolicy(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.setMaintenancePolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The name of the cluster to update. - * @param {string} params.projectId The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - * @param {string} params.zone The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. - * @param {().SetMaintenancePolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMaintenancePolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.setMasterAuth - * @desc Used to set master auth materials. Currently supports :- Changing the - * admin password of a specific cluster. This can be either via password - * generation or explicitly set the password. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setMasterAuth(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.setMasterAuth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetMasterAuthRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMasterAuth(params?: any, options?: MethodOptions): - AxiosPromise; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.setNetworkPolicy - * @desc Enables/Disables Network Policy for a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.setNetworkPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.setNetworkPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNetworkPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNetworkPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.startIpRotation - * @desc Start master IP rotation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.startIpRotation(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.startIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().StartIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.update - * @desc Updates the settings of a specific cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.update(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Zones$Clusters$Nodepools { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.zones.clusters.nodePools.autoscaling - * @desc Sets the autoscaling settings of a specific node pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to upgrade. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.autoscaling(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.autoscaling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - autoscaling(params?: any, options?: MethodOptions): - AxiosPromise; - autoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - autoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.zones.clusters.nodePools.create - * @desc Creates a node pool for a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.create(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {().CreateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * UpdateNodePoolRequests update a node pool's image and/or version. + */ + export interface Schema$UpdateNodePoolRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The desired image type for the node pool. + */ + imageType: string; + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to upgrade. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * The Kubernetes version to change the nodes to (typically an upgrade). + * Users may specify either explicit versions offered by Kubernetes Engine + * or version aliases, which have the following behavior: - + * "latest": picks the highest valid Kubernetes version - + * "1.X": picks the highest valid patch+gke.N patch in the 1.X + * version - "1.X.Y": picks the highest valid gke.N patch in + * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes + * version - "-": picks the Kubernetes master version + */ + nodeVersion: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.delete - * @desc Deletes a node pool from a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to delete. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.delete(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects { + root: Container; + locations: Resource$Projects$Locations; + zones: Resource$Projects$Zones; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); + this.zones = new Resource$Projects$Zones(root); } - } - - /** - * container.projects.zones.clusters.nodePools.get - * @desc Retrieves the node pool requested. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - - - /** - * container.projects.zones.clusters.nodePools.list - * @desc Lists the node pools for a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // - * number](https://developers.google.com/console/help/new/#projectnumber). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string=} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations { + root: Container; + clusters: Resource$Projects$Locations$Clusters; + operations: Resource$Projects$Locations$Operations; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Locations$Clusters(root); + this.operations = new Resource$Projects$Locations$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.getServerConfig + * @desc Returns configuration info about the Kubernetes Engine service. + * @alias container.projects.locations.getServerConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServerConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getServerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getServerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/serverConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * container.projects.zones.clusters.nodePools.rollback - * @desc Roll back the previously Aborted or Failed NodePool upgrade. This - * will be an no-op if the last upgrade successfully completed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to rollback. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to rollback. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.rollback(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Clusters { + root: Container; + nodePools: Resource$Projects$Locations$Clusters$Nodepools; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.nodePools = new Resource$Projects$Locations$Clusters$Nodepools(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.clusters.completeIpRotation + * @desc Completes master IP rotation. + * @alias container.projects.locations.clusters.completeIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().CompleteIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + completeIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:completeIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.create + * @desc Creates a cluster, consisting of the specified number and type of + * Google Compute Engine instances. By default, the cluster is created in + * the project's [default + * network](/compute/docs/networks-and-firewalls#networks). One firewall is + * added for the cluster. After cluster creation, the cluster creates routes + * for each node to allow the containers on that node to communicate with + * all other instances in the cluster. Finally, an entry is added to the + * project's global metadata indicating which CIDR range is being used by + * the cluster. + * @alias container.projects.locations.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the cluster will be created. Specified in the format 'projects/x/locations/x'. + * @param {().CreateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.delete + * @desc Deletes the cluster, including the Kubernetes endpoint and all + * worker nodes. Firewalls and routes that were configured during cluster + * creation are also deleted. Other Google Compute Engine resources that + * might be in use by the cluster (e.g. load balancer resources) will not be + * deleted if they weren't present at the initial create time. + * @alias container.projects.locations.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.get + * @desc Gets the details of a specific cluster. + * @alias container.projects.locations.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.list + * @desc Lists all clusters owned by a project in either the specified zone + * or all zones. + * @alias container.projects.locations.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setAddons + * @desc Sets the addons of a specific cluster. + * @alias container.projects.locations.clusters.setAddons + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set addons. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetAddonsConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAddons(params?: any, options?: MethodOptions): + AxiosPromise; + setAddons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAddons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setAddons') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLegacyAbac + * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @alias container.projects.locations.clusters.setLegacyAbac + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLegacyAbacRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLegacyAbac(params?: any, options?: MethodOptions): + AxiosPromise; + setLegacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLegacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setLegacyAbac') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLocations + * @desc Sets the locations of a specific cluster. + * @alias container.projects.locations.clusters.setLocations + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set locations. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLocationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLocations(params?: any, options?: MethodOptions): + AxiosPromise; + setLocations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLocations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setLocations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLogging + * @desc Sets the logging service of a specific cluster. + * @alias container.projects.locations.clusters.setLogging + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set logging. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLoggingServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLogging(params?: any, options?: MethodOptions): + AxiosPromise; + setLogging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLogging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setLogging') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMaintenancePolicy + * @desc Sets the maintenance policy for a cluster. + * @alias container.projects.locations.clusters.setMaintenancePolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMaintenancePolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMaintenancePolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setMaintenancePolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMasterAuth + * @desc Used to set master auth materials. Currently supports :- Changing + * the admin password of a specific cluster. This can be either via password + * generation or explicitly set the password. + * @alias container.projects.locations.clusters.setMasterAuth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set auth. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMasterAuthRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMasterAuth(params?: any, options?: MethodOptions): + AxiosPromise; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setMasterAuth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMonitoring + * @desc Sets the monitoring service of a specific cluster. + * @alias container.projects.locations.clusters.setMonitoring + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set monitoring. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMonitoringServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMonitoring(params?: any, options?: MethodOptions): + AxiosPromise; + setMonitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMonitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setMonitoring') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setNetworkPolicy + * @desc Enables/Disables Network Policy for a cluster. + * @alias container.projects.locations.clusters.setNetworkPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetNetworkPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNetworkPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setNetworkPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setResourceLabels + * @desc Sets labels on a cluster. + * @alias container.projects.locations.clusters.setResourceLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set labels. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setResourceLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setResourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setResourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setResourceLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.startIpRotation + * @desc Start master IP rotation. + * @alias container.projects.locations.clusters.startIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().StartIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:startIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.update + * @desc Updates the settings of a specific cluster. + * @alias container.projects.locations.clusters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().UpdateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.updateMaster + * @desc Updates the master of a specific cluster. + * @alias container.projects.locations.clusters.updateMaster + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().UpdateMasterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateMaster(params?: any, options?: MethodOptions): + AxiosPromise; + updateMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:updateMaster') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * container.projects.zones.clusters.nodePools.setManagement - * @desc Sets the NodeManagement options for a node pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to update. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to update. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.setManagement(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.setManagement - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolManagementRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setManagement(params?: any, options?: MethodOptions): - AxiosPromise; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Clusters$Nodepools { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.clusters.nodePools.create + * @desc Creates a node pool for a cluster. + * @alias container.projects.locations.clusters.nodePools.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project, location, cluster id) where the node pool will be created. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().CreateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.delete + * @desc Deletes a node pool from a cluster. + * @alias container.projects.locations.clusters.nodePools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string=} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.get + * @desc Retrieves the node pool requested. + * @alias container.projects.locations.clusters.nodePools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string=} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.list + * @desc Lists the node pools for a cluster. + * @alias container.projects.locations.clusters.nodePools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.rollback + * @desc Roll back the previously Aborted or Failed NodePool upgrade. This + * will be an no-op if the last upgrade successfully completed. + * @alias container.projects.locations.clusters.nodePools.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setAutoscaling + * @desc Sets the autoscaling settings of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.setAutoscaling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoscaling(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setAutoscaling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setManagement + * @desc Sets the NodeManagement options for a node pool. + * @alias container.projects.locations.clusters.nodePools.setManagement + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set management properties. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolManagementRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setManagement(params?: any, options?: MethodOptions): + AxiosPromise; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setManagement') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setSize + * @desc Sets the size of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.setSize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set size. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolSizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSize(params?: any, options?: MethodOptions): + AxiosPromise; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setSize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.update + * @desc Updates the version and/or image type of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to update. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().UpdateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * container.projects.zones.clusters.nodePools.setSize - * @desc Sets the size of a specific node pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to update. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to update. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.setSize(request, - * function(err, response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.setSize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolSizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSize(params?: any, options?: MethodOptions): - AxiosPromise; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Operations { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.operations.cancel + * @desc Cancels the specified operation. + * @alias container.projects.locations.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, operation id) of the operation to cancel. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.operations.get + * @desc Gets the specified operation. + * @alias container.projects.locations.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {string=} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.operations.list + * @desc Lists all operations in a project in a specific zone or all zones. + * @alias container.projects.locations.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * container.projects.zones.clusters.nodePools.update - * @desc Updates the version and/or image type of a specific node pool. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The name of the cluster to upgrade. - * clusterId: 'my-cluster-id', // TODO: Update placeholder value. - * - * // The name of the node pool to upgrade. - * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.clusters.nodePools.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.clusters.nodePools.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Zones { + root: Container; + clusters: Resource$Projects$Zones$Clusters; + operations: Resource$Projects$Zones$Operations; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Zones$Clusters(root); + this.operations = new Resource$Projects$Zones$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.getServerconfig + * @desc Returns configuration info about the Kubernetes Engine service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) + * // to return operations for. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.getServerconfig(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.getServerconfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServerconfig(params?: any, options?: MethodOptions): + AxiosPromise; + getServerconfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getServerconfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/serverconfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Projects$Zones$Operations { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - - /** - * container.projects.zones.operations.cancel - * @desc Cancels the specified operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the operation - * resides. zone: 'my-zone', // TODO: Update placeholder value. - * - * // The server-assigned `name` of the operation. - * operationId: 'my-operation-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * container.projects.zones.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation resides. This field has been deprecated and replaced by the name field. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'operationId'], - pathParams: ['operationId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Zones$Clusters { + root: Container; + nodePools: Resource$Projects$Zones$Clusters$Nodepools; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.nodePools = new Resource$Projects$Zones$Clusters$Nodepools(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.clusters.addons + * @desc Sets the addons of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.addons(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.addons + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetAddonsConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addons(params?: any, options?: MethodOptions): + AxiosPromise; + addons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.completeIpRotation + * @desc Completes master IP rotation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.completeIpRotation(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.completeIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().CompleteIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + completeIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.create + * @desc Creates a cluster, consisting of the specified number and type of + * Google Compute Engine instances. By default, the cluster is created in + * the project's [default + * network](/compute/docs/networks-and-firewalls#networks). One firewall is + * added for the cluster. After cluster creation, the cluster creates routes + * for each node to allow the containers on that node to communicate with + * all other instances in the cluster. Finally, an entry is added to the + * project's global metadata indicating which CIDR range is being used by + * the cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.create(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {().CreateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/zones/{zone}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.delete + * @desc Deletes the cluster, including the Kubernetes endpoint and all + * worker nodes. Firewalls and routes that were configured during cluster + * creation are also deleted. Other Google Compute Engine resources that + * might be in use by the cluster (e.g. load balancer resources) will not be + * deleted if they weren't present at the initial create time. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to delete. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.delete(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.get + * @desc Gets the details of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to retrieve. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.legacyAbac + * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to update. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.legacyAbac(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.legacyAbac + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLegacyAbacRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + legacyAbac(params?: any, options?: MethodOptions): + AxiosPromise; + legacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + legacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.list + * @desc Lists all clusters owned by a project in either the specified zone + * or all zones. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides, or "-" for all zones. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.list(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/zones/{zone}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.locations + * @desc Sets the locations of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.locations(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.locations + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLocationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + locations(params?: any, options?: MethodOptions): + AxiosPromise; + locations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + locations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.logging + * @desc Sets the logging service of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.logging(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.logging + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLoggingServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + logging(params?: any, options?: MethodOptions): + AxiosPromise; + logging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + logging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.master + * @desc Updates the master of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.master(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.master + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateMasterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + master(params?: any, options?: MethodOptions): + AxiosPromise; + master( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + master( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.monitoring + * @desc Sets the monitoring service of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.monitoring(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.monitoring + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetMonitoringServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + monitoring(params?: any, options?: MethodOptions): + AxiosPromise; + monitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + monitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.resourceLabels + * @desc Sets labels on a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.resourceLabels(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.resourceLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resourceLabels(params?: any, options?: MethodOptions): + AxiosPromise; + resourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setMaintenancePolicy + * @desc Sets the maintenance policy for a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to update. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.setMaintenancePolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.setMaintenancePolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The name of the cluster to update. + * @param {string} params.projectId The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). + * @param {string} params.zone The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + * @param {().SetMaintenancePolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMaintenancePolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setMasterAuth + * @desc Used to set master auth materials. Currently supports :- Changing + * the admin password of a specific cluster. This can be either via password + * generation or explicitly set the password. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.setMasterAuth(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.setMasterAuth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetMasterAuthRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMasterAuth(params?: any, options?: MethodOptions): + AxiosPromise; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setNetworkPolicy + * @desc Enables/Disables Network Policy for a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.setNetworkPolicy(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.setNetworkPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNetworkPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNetworkPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.startIpRotation + * @desc Start master IP rotation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.startIpRotation(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.startIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().StartIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.update + * @desc Updates the settings of a specific cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * container.projects.zones.operations.get - * @desc Gets the specified operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * // [zone](/compute/docs/zones#available) in which the cluster - * // resides. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * // The server-assigned `name` of the operation. - * operationId: 'my-operation-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.operations.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/zones/{zone}/operations/{operationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'operationId'], - pathParams: ['operationId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Zones$Clusters$Nodepools { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.clusters.nodePools.autoscaling + * @desc Sets the autoscaling settings of a specific node pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to upgrade. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.autoscaling(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.autoscaling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + autoscaling(params?: any, options?: MethodOptions): + AxiosPromise; + autoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + autoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.create + * @desc Creates a node pool for a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.create(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {().CreateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.delete + * @desc Deletes a node pool from a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to delete. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.delete(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.get + * @desc Retrieves the node pool requested. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.list + * @desc Lists the node pools for a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // + * number](https://developers.google.com/console/help/new/#projectnumber). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string=} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.rollback + * @desc Roll back the previously Aborted or Failed NodePool upgrade. This + * will be an no-op if the last upgrade successfully completed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to rollback. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to rollback. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.rollback(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.setManagement + * @desc Sets the NodeManagement options for a node pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to update. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to update. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.setManagement(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.setManagement + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolManagementRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setManagement(params?: any, options?: MethodOptions): + AxiosPromise; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.setSize + * @desc Sets the size of a specific node pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to update. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to update. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.setSize(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.setSize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolSizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSize(params?: any, options?: MethodOptions): + AxiosPromise; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.update + * @desc Updates the version and/or image type of a specific node pool. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The name of the cluster to upgrade. + * clusterId: 'my-cluster-id', // TODO: Update placeholder value. + * + * // The name of the node pool to upgrade. + * nodePoolId: 'my-node-pool-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.clusters.nodePools.update(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.clusters.nodePools.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * container.projects.zones.operations.list - * @desc Lists all operations in a project in a specific zone or all zones. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Container Engine API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/container - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var container = google.container('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The Google Developers Console [project ID or project - * // number](https://support.google.com/cloud/answer/6158840). - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) - * // to return operations for, or `-` for all zones. - * zone: 'my-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * container.projects.zones.operations.list(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias container.projects.zones.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Zones$Operations { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.operations.cancel + * @desc Cancels the specified operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the operation + * resides. zone: 'my-zone', // TODO: Update placeholder value. + * + * // The server-assigned `name` of the operation. + * operationId: 'my-operation-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * container.projects.zones.operations.cancel(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation resides. This field has been deprecated and replaced by the name field. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'operationId'], + pathParams: ['operationId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.operations.get + * @desc Gets the specified operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * // [zone](/compute/docs/zones#available) in which the cluster + * // resides. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * // The server-assigned `name` of the operation. + * operationId: 'my-operation-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.operations.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/zones/{zone}/operations/{operationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'operationId'], + pathParams: ['operationId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.operations.list + * @desc Lists all operations in a project in a specific zone or all zones. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Container Engine API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/container + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var container = google.container('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The Google Developers Console [project ID or project + * // number](https://support.google.com/cloud/answer/6158840). + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * // The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) + * // to return operations for, or `-` for all zones. + * zone: 'my-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * container.projects.zones.operations.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias container.projects.zones.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/projects/{projectId}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/container/v1beta1.ts b/src/apis/container/v1beta1.ts index 19d5a3f38b8..56806eebd62 100644 --- a/src/apis/container/v1beta1.ts +++ b/src/apis/container/v1beta1.ts @@ -27,5482 +27,5527 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Kubernetes Engine API - * - * The Google Kubernetes Engine API is used for building and managing container - * based applications, powered by the open source Kubernetes technology. - * - * @example - * const google = require('googleapis'); - * const container = google.container('v1beta1'); - * - * @namespace container - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Container - */ -export class Container { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * AcceleratorConfig represents a Hardware Accelerator request. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the accelerator cards exposed to an instance. - */ - acceleratorCount: string; - /** - * The accelerator type resource name. List of supported accelerators - * [here](/compute/docs/gpus/#Introduction) - */ - acceleratorType: string; -} -/** - * Configuration for the addons that can be automatically spun up in the - * cluster, enabling additional functionality. - */ -export interface Schema$AddonsConfig { - /** - * Configuration for the horizontal pod autoscaling feature, which increases - * or decreases the number of replica pods a replication controller has based - * on the resource usage of the existing pods. - */ - horizontalPodAutoscaling: Schema$HorizontalPodAutoscaling; - /** - * Configuration for the HTTP (L7) load balancing controller addon, which - * makes it easy to set up HTTP load balancers for services in a cluster. - */ - httpLoadBalancing: Schema$HttpLoadBalancing; - /** - * Configuration for the Kubernetes Dashboard. - */ - kubernetesDashboard: Schema$KubernetesDashboard; - /** - * Configuration for NetworkPolicy. This only tracks whether the addon is - * enabled or not on the Master, it does not track whether network policy is - * enabled for the nodes. - */ - networkPolicyConfig: Schema$NetworkPolicyConfig; -} -/** - * AutoUpgradeOptions defines the set of options for the user to control how the - * Auto Upgrades will proceed. - */ -export interface Schema$AutoUpgradeOptions { - /** - * [Output only] This field is set when upgrades are about to commence with - * the approximate start time for the upgrades, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - autoUpgradeStartTime: string; - /** - * [Output only] This field is set when upgrades are about to commence with - * the description of the upgrade. - */ - description: string; -} -/** - * CancelOperationRequest cancels a single operation. - */ -export interface Schema$CancelOperationRequest { - /** - * The name (project, location, operation id) of the operation to cancel. - * Specified in the format 'projects/x/locations/x/operations/*'. - */ - name: string; - /** - * Deprecated. The server-assigned `name` of the operation. This field has - * been deprecated and replaced by the name field. - */ - operationId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the operation resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * CidrBlock contains an optional name and one CIDR block. - */ -export interface Schema$CidrBlock { - /** - * cidr_block must be specified in CIDR notation. - */ - cidrBlock: string; - /** - * display_name is an optional field for users to identify CIDR blocks. - */ - displayName: string; -} -/** - * Configuration for client certificates on the cluster. - */ -export interface Schema$ClientCertificateConfig { - /** - * Issue a client certificate. - */ - issueClientCertificate: boolean; -} -/** - * A Google Kubernetes Engine cluster. - */ -export interface Schema$Cluster { - /** - * Configurations for the various addons available to run in the cluster. - */ - addonsConfig: Schema$AddonsConfig; - /** - * The IP address range of the container pods in this cluster, in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically - * chosen or specify a `/14` block in `10.0.0.0/8`. - */ - clusterIpv4Cidr: string; - /** - * [Output only] The time the cluster was created, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - createTime: string; - /** - * [Output only] The current software version of the master endpoint. - */ - currentMasterVersion: string; - /** - * [Output only] The number of nodes currently in the cluster. - */ - currentNodeCount: number; - /** - * [Output only] The current version of the node software components. If they - * are currently at multiple versions because they're in the process of - * being upgraded, this reflects the minimum version of all nodes. - */ - currentNodeVersion: string; - /** - * An optional description of this cluster. - */ - description: string; - /** - * Kubernetes alpha features are enabled on this cluster. This includes alpha - * API groups (e.g. v1beta1) and features that may not be production ready in - * the kubernetes version of the master and nodes. The cluster has no SLA for - * uptime and master/node upgrades are disabled. Alpha enabled clusters are - * automatically deleted thirty days after creation. - */ - enableKubernetesAlpha: boolean; - /** - * [Output only] The IP address of this cluster's master endpoint. The - * endpoint can be accessed from the internet at - * `https://username:password@endpoint/`. See the `masterAuth` property of - * this resource for username and password information. - */ - endpoint: string; - /** - * [Output only] The time the cluster will be automatically deleted in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - expireTime: string; - /** - * The initial Kubernetes version for this cluster. Valid versions are those - * found in validMasterVersions returned by getServerConfig. The version can - * be upgraded over time; such upgrades are reflected in currentMasterVersion - * and currentNodeVersion. Users may specify either explicit versions offered - * by Kubernetes Engine or version aliases, which have the following behavior: - * - "latest": picks the highest valid Kubernetes version - - * "1.X": picks the highest valid patch+gke.N patch in the 1.X - * version - "1.X.Y": picks the highest valid gke.N patch in - * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes - * version - "","-": picks the default Kubernetes version - */ - initialClusterVersion: string; - /** - * The number of nodes to create in this cluster. You must ensure that your - * Compute Engine <a - * href="/compute/docs/resource-quotas">resource quota</a> - * is sufficient for this number of instances. You must also have available - * firewall and routes quota. For requests, this field should only be used in - * lieu of a "node_pool" object, since this configuration (along - * with the "node_config") will be used to create a - * "NodePool" object with an auto-generated name. Do not use this - * and a node_pool at the same time. - */ - initialNodeCount: number; - /** - * Deprecated. Use node_pools.instance_group_urls. - */ - instanceGroupUrls: string[]; - /** - * Configuration for cluster IP allocation. - */ - ipAllocationPolicy: Schema$IPAllocationPolicy; - /** - * The fingerprint of the set of labels for this cluster. - */ - labelFingerprint: string; - /** - * Configuration for the legacy ABAC authorization mode. - */ - legacyAbac: Schema$LegacyAbac; - /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/regions-zones/regions-zones#available) or - * [region](/compute/docs/regions-zones/regions-zones#available) in which the - * cluster resides. - */ - location: string; - /** - * The list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. - */ - locations: string[]; - /** - * The logging service the cluster should use to write logs. Currently - * available options: * `logging.googleapis.com` - the Google Cloud Logging - * service. * `none` - no logs will be exported from the cluster. * if left as - * an empty string,`logging.googleapis.com` will be used. - */ - loggingService: string; - /** - * Configure the maintenance policy for this cluster. - */ - maintenancePolicy: Schema$MaintenancePolicy; - /** - * The authentication information for accessing the master endpoint. - */ - masterAuth: Schema$MasterAuth; - /** - * The configuration options for master authorized networks feature. - */ - masterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; - /** - * The IP prefix in CIDR notation to use for the hosted master network. This - * prefix will be used for assigning private IP addresses to the master or set - * of masters, as well as the ILB VIP. - */ - masterIpv4CidrBlock: string; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * `monitoring.googleapis.com` - the Google Cloud - * Monitoring service. * `none` - no metrics will be exported from the - * cluster. * if left as an empty string, `monitoring.googleapis.com` will be - * used. - */ - monitoringService: string; - /** - * The name of this cluster. The name must be unique within this project and - * zone, and can be up to 40 characters with the following restrictions: * - * Lowercase letters, numbers, and hyphens only. * Must start with a letter. * - * Must end with a number or a letter. - */ - name: string; - /** - * The name of the Google Compute Engine - * [network](/compute/docs/networks-and-firewalls#networks) to which the - * cluster is connected. If left unspecified, the `default` network will be - * used. On output this shows the network ID instead of the name. - */ - network: string; - /** - * Configuration for cluster networking. - */ - networkConfig: Schema$NetworkConfig; - /** - * Configuration options for the NetworkPolicy feature. - */ - networkPolicy: Schema$NetworkPolicy; - /** - * Parameters used in creating the cluster's nodes. See `nodeConfig` for - * the description of its properties. For requests, this field should only be - * used in lieu of a "node_pool" object, since this configuration - * (along with the "initial_node_count") will be used to create a - * "NodePool" object with an auto-generated name. Do not use this - * and a node_pool at the same time. For responses, this field will be - * populated with the node configuration of the first node pool. If - * unspecified, the defaults are used. - */ - nodeConfig: Schema$NodeConfig; - /** - * [Output only] The size of the address space on each node for hosting - * containers. This is provisioned from within the `container_ipv4_cidr` - * range. - */ - nodeIpv4CidrSize: number; - /** - * The node pools associated with this cluster. This field should not be set - * if "node_config" or "initial_node_count" are specified. - */ - nodePools: Schema$NodePool[]; - /** - * Configuration for the PodSecurityPolicy feature. - */ - podSecurityPolicyConfig: Schema$PodSecurityPolicyConfig; - /** - * If this is a private cluster setup. Private clusters are clusters that, by - * default have no external IP addresses on the nodes and where nodes and the - * master communicate over private IP addresses. - */ - privateCluster: boolean; - /** - * The resource labels for the cluster to use to annotate any related Google - * Compute Engine resources. - */ - resourceLabels: any; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The IP address range of the Kubernetes services in this - * cluster, in - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the - * last `/16` from the container CIDR. - */ - servicesIpv4Cidr: string; - /** - * [Output only] The current status of this cluster. - */ - status: string; - /** - * [Output only] Additional information about the current status of this - * cluster, if available. - */ - statusMessage: string; - /** - * The name of the Google Compute Engine - * [subnetwork](/compute/docs/subnetworks) to which the cluster is connected. - * On output this shows the subnetwork ID instead of the name. - */ - subnetwork: string; - /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field is deprecated, use location instead. - */ - zone: string; -} -/** - * ClusterUpdate describes an update to the cluster. Exactly one update can be - * applied to a cluster with each request, so at most one field can be provided. - */ -export interface Schema$ClusterUpdate { - /** - * Configurations for the various addons available to run in the cluster. - */ - desiredAddonsConfig: Schema$AddonsConfig; - /** - * The desired image type for the node pool. NOTE: Set the - * "desired_node_pool" field as well. - */ - desiredImageType: string; - /** - * The desired list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. Changing the locations a cluster is in will result in - * nodes being either created or removed from the cluster, depending on - * whether locations are being added or removed. This list must always - * include the cluster's primary zone. - */ - desiredLocations: string[]; - /** - * The desired configuration options for master authorized networks feature. - */ - desiredMasterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; - /** - * The Kubernetes version to change the master to. The only valid value is the - * latest supported version. Users may specify either explicit versions - * offered by Kubernetes Engine or version aliases, which have the following - * behavior: - "latest": picks the highest valid Kubernetes version - * - "1.X": picks the highest valid patch+gke.N patch in the 1.X - * version - "1.X.Y": picks the highest valid gke.N patch in - * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes - * version - "-": picks the default Kubernetes version - */ - desiredMasterVersion: string; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * "monitoring.googleapis.com" - the Google - * Cloud Monitoring service * "none" - no metrics will be exported - * from the cluster - */ - desiredMonitoringService: string; - /** - * Autoscaler configuration for the node pool specified in - * desired_node_pool_id. If there is only one pool in the cluster and - * desired_node_pool_id is not provided then the change applies to that single - * node pool. - */ - desiredNodePoolAutoscaling: Schema$NodePoolAutoscaling; - /** - * The node pool to be upgraded. This field is mandatory if - * "desired_node_version", "desired_image_family" or - * "desired_node_pool_autoscaling" is specified and there is more - * than one node pool on the cluster. - */ - desiredNodePoolId: string; - /** - * The Kubernetes version to change the nodes to (typically an upgrade). Users - * may specify either explicit versions offered by Kubernetes Engine or - * version aliases, which have the following behavior: - "latest": - * picks the highest valid Kubernetes version - "1.X": picks the - * highest valid patch+gke.N patch in the 1.X version - "1.X.Y": - * picks the highest valid gke.N patch in the 1.X.Y version - - * "1.X.Y-gke.N": picks an explicit Kubernetes version - - * "-": picks the Kubernetes master version - */ - desiredNodeVersion: string; - /** - * The desired configuration options for the PodSecurityPolicy feature. - */ - desiredPodSecurityPolicyConfig: Schema$PodSecurityPolicyConfig; -} -/** - * CompleteIPRotationRequest moves the cluster master back into single-IP mode. - */ -export interface Schema$CompleteIPRotationRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to complete IP - * rotation. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * CreateClusterRequest creates a cluster. - */ -export interface Schema$CreateClusterRequest { - /** - * A [cluster - * resource](/container-engine/reference/rest/v1beta1/projects.zones.clusters) - */ - cluster: Schema$Cluster; - /** - * The parent (project and location) where the cluster will be created. - * Specified in the format 'projects/x/locations/*'. - */ - parent: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the parent field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the parent field. - */ - zone: string; -} -/** - * CreateNodePoolRequest creates a node pool for a cluster. - */ -export interface Schema$CreateNodePoolRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the parent field. - */ - clusterId: string; - /** - * The node pool to create. - */ - nodePool: Schema$NodePool; - /** - * The parent (project, location, cluster id) where the node pool will be - * created. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - parent: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the parent field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the parent field. - */ - zone: string; -} -/** - * Time window specified for daily maintenance operations. - */ -export interface Schema$DailyMaintenanceWindow { - /** - * [Output only] Duration of the time window, automatically chosen to be - * smallest possible in the given scenario. - */ - duration: string; - /** - * Time within the maintenance window to start the maintenance operations. It - * must be in format "HH:MM”, where HH : [00-23] and MM : [00-59] GMT. - */ - startTime: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Configuration options for the horizontal pod autoscaling feature, which - * increases or decreases the number of replica pods a replication controller - * has based on the resource usage of the existing pods. - */ -export interface Schema$HorizontalPodAutoscaling { - /** - * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. - * When enabled, it ensures that a Heapster pod is running in the cluster, - * which is also used by the Cloud Monitoring service. - */ - disabled: boolean; -} -/** - * Configuration options for the HTTP (L7) load balancing controller addon, - * which makes it easy to set up HTTP load balancers for services in a cluster. - */ -export interface Schema$HttpLoadBalancing { - /** - * Whether the HTTP Load Balancing controller is enabled in the cluster. When - * enabled, it runs a small pod in the cluster that manages the load - * balancers. - */ - disabled: boolean; -} -/** - * Configuration for controlling how IPs are allocated in the cluster. - */ -export interface Schema$IPAllocationPolicy { - /** - * If true, allow allocation of cluster CIDR ranges that overlap with certain - * kinds of network routes. By default we do not allow cluster CIDR ranges to - * intersect with any user declared routes. With allow_route_overlap == true, - * we allow overlapping with CIDR ranges that are larger than the cluster CIDR - * range. If this field is set to true, then cluster and services CIDRs must - * be fully-specified (e.g. `10.96.0.0/14`, but not `/14`), which means: 1) - * When `use_ip_aliases` is true, `cluster_ipv4_cidr_block` and - * `services_ipv4_cidr_block` must be fully-specified. 2) When - * `use_ip_aliases` is false, `cluster.cluster_ipv4_cidr` muse be - * fully-specified. - */ - allowRouteOverlap: boolean; - /** - * This field is deprecated, use cluster_ipv4_cidr_block. - */ - clusterIpv4Cidr: string; - /** - * The IP address range for the cluster pod IPs. If this field is set, then - * `cluster.cluster_ipv4_cidr` must be left blank. This field is only - * applicable when `use_ip_aliases` is true. Set to blank to have a range - * chosen with the default size. Set to /netmask (e.g. `/14`) to have a range - * chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - clusterIpv4CidrBlock: string; - /** - * The name of the secondary range to be used for the cluster CIDR block. The - * secondary range will be used for pod IP addresses. This must be an existing - * secondary range associated with the cluster subnetwork. This field is only - * applicable with use_ip_aliases and create_subnetwork is false. - */ - clusterSecondaryRangeName: string; - /** - * Whether a new subnetwork will be created automatically for the cluster. - * This field is only applicable when `use_ip_aliases` is true. - */ - createSubnetwork: boolean; - /** - * This field is deprecated, use node_ipv4_cidr_block. - */ - nodeIpv4Cidr: string; - /** - * The IP address range of the instance IPs in this cluster. This is - * applicable only if `create_subnetwork` is true. Set to blank to have a - * range chosen with the default size. Set to /netmask (e.g. `/14`) to have a - * range chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - nodeIpv4CidrBlock: string; - /** - * This field is deprecated, use services_ipv4_cidr_block. - */ - servicesIpv4Cidr: string; - /** - * The IP address range of the services IPs in this cluster. If blank, a range - * will be automatically chosen with the default size. This field is only - * applicable when `use_ip_aliases` is true. Set to blank to have a range - * chosen with the default size. Set to /netmask (e.g. `/14`) to have a range - * chosen with a specific netmask. Set to a - * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) - * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. - * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range - * to use. - */ - servicesIpv4CidrBlock: string; - /** - * The name of the secondary range to be used as for the services CIDR block. - * The secondary range will be used for service ClusterIPs. This must be an - * existing secondary range associated with the cluster subnetwork. This - * field is only applicable with use_ip_aliases and create_subnetwork is - * false. - */ - servicesSecondaryRangeName: string; - /** - * A custom subnetwork name to be used if `create_subnetwork` is true. If - * this field is empty, then an automatic name will be chosen for the new - * subnetwork. - */ - subnetworkName: string; - /** - * Whether alias IPs will be used for pod IPs in the cluster. - */ - useIpAliases: boolean; -} -/** - * Configuration for the Kubernetes Dashboard. - */ -export interface Schema$KubernetesDashboard { - /** - * Whether the Kubernetes Dashboard is enabled for this cluster. - */ - disabled: boolean; -} -/** - * Configuration for the legacy Attribute Based Access Control authorization - * mode. - */ -export interface Schema$LegacyAbac { - /** - * Whether the ABAC authorizer is enabled for this cluster. When enabled, - * identities in the system, including service accounts, nodes, and - * controllers, will have statically granted permissions beyond those provided - * by the RBAC configuration or IAM. - */ - enabled: boolean; -} -/** - * ListClustersResponse is the result of ListClustersRequest. - */ -export interface Schema$ListClustersResponse { - /** - * A list of clusters in the project in the specified zone, or across all - * ones. - */ - clusters: Schema$Cluster[]; - /** - * If any zones are listed here, the list of clusters returned may be missing - * those zones. - */ - missingZones: string[]; -} -/** - * ListNodePoolsResponse is the result of ListNodePoolsRequest. - */ -export interface Schema$ListNodePoolsResponse { - /** - * A list of node pools for a cluster. - */ - nodePools: Schema$NodePool[]; -} -/** - * ListOperationsResponse is the result of ListOperationsRequest. - */ -export interface Schema$ListOperationsResponse { - /** - * If any zones are listed here, the list of operations returned may be - * missing the operations from those zones. - */ - missingZones: string[]; - /** - * A list of operations in the project in the specified zone. - */ - operations: Schema$Operation[]; -} -/** - * ListUsableSubnetworksResponse is the response of - * ListUsableSubnetworksRequest. - */ -export interface Schema$ListUsableSubnetworksResponse { - /** - * This token allows you to get the next page of results for list requests. If - * the number of results is larger than `page_size`, use the `next_page_token` - * as a value for the query parameter `page_token` in the next request. The - * value will become empty when there are no more pages. - */ - nextPageToken: string; - /** - * A list of usable subnetworks in the specified network project. - */ - subnetworks: Schema$UsableSubnetwork[]; -} -/** - * MaintenancePolicy defines the maintenance policy to be used for the cluster. - */ -export interface Schema$MaintenancePolicy { - /** - * Specifies the maintenance window in which maintenance may be performed. - */ - window: Schema$MaintenanceWindow; -} -/** - * MaintenanceWindow defines the maintenance window to be used for the cluster. - */ -export interface Schema$MaintenanceWindow { - /** - * DailyMaintenanceWindow specifies a daily maintenance operation window. - */ - dailyMaintenanceWindow: Schema$DailyMaintenanceWindow; -} -/** - * The authentication information for accessing the master endpoint. - * Authentication can be done using HTTP basic auth or using client - * certificates. - */ -export interface Schema$MasterAuth { - /** - * [Output only] Base64-encoded public certificate used by clients to - * authenticate to the cluster endpoint. - */ - clientCertificate: string; - /** - * Configuration for client certificate authentication on the cluster. If no - * configuration is specified, a client certificate is issued. - */ - clientCertificateConfig: Schema$ClientCertificateConfig; - /** - * [Output only] Base64-encoded private key used by clients to authenticate to - * the cluster endpoint. - */ - clientKey: string; - /** - * [Output only] Base64-encoded public certificate that is the root of trust - * for the cluster. - */ - clusterCaCertificate: string; - /** - * The password to use for HTTP basic authentication to the master endpoint. - * Because the master endpoint is open to the Internet, you should create a - * strong password. If a password is provided for cluster creation, username - * must be non-empty. - */ - password: string; - /** - * The username to use for HTTP basic authentication to the master endpoint. - * For clusters v1.6.0 and later, you can disable basic authentication by - * providing an empty username. - */ - username: string; -} -/** - * Configuration options for the master authorized networks feature. Enabled - * master authorized networks will disallow all external traffic to access - * Kubernetes master through HTTPS except traffic from the given CIDR blocks, - * Google Compute Engine Public IPs and Google Prod IPs. - */ -export interface Schema$MasterAuthorizedNetworksConfig { - /** - * cidr_blocks define up to 10 external networks that could access Kubernetes - * master through HTTPS. - */ - cidrBlocks: Schema$CidrBlock[]; - /** - * Whether or not master authorized networks is enabled. - */ - enabled: boolean; -} -/** - * NetworkConfig reports the relative names of network & subnetwork. - */ -export interface Schema$NetworkConfig { - /** - * Output only. The name of the Google Compute Engine - * network(/compute/docs/networks-and-firewalls#networks). Example: - * projects/my-project/global/networks/my-network - */ - network: string; - /** - * Output only. The name of the Google Compute Engine - * [subnetwork](/compute/docs/vpc). Example: - * projects/my-project/regions/us-central1/subnetworks/my-subnet - */ - subnetwork: string; -} -/** - * Configuration options for the NetworkPolicy feature. - * https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ - */ -export interface Schema$NetworkPolicy { - /** - * Whether network policy is enabled on the cluster. - */ - enabled: boolean; - /** - * The selected network policy provider. - */ - provider: string; -} -/** - * Configuration for NetworkPolicy. This only tracks whether the addon is - * enabled or not on the Master, it does not track whether network policy is - * enabled for the nodes. - */ -export interface Schema$NetworkPolicyConfig { - /** - * Whether NetworkPolicy is enabled for this cluster. - */ - disabled: boolean; -} -/** - * Parameters that describe the nodes in a cluster. - */ -export interface Schema$NodeConfig { - /** - * A list of hardware accelerators to be attached to each node. See - * https://cloud.google.com/compute/docs/gpus for more information about - * support for GPUs. - */ - accelerators: Schema$AcceleratorConfig[]; - /** - * Size of the disk attached to each node, specified in GB. The smallest - * allowed disk size is 10GB. If unspecified, the default disk size is 100GB. - */ - diskSizeGb: number; - /** - * The image type to use for this node. Note that for a given image type, the - * latest version of it will be used. - */ - imageType: string; - /** - * The map of Kubernetes labels (key/value pairs) to be applied to each node. - * These will added in addition to any default label(s) that Kubernetes may - * apply to the node. In case of conflict in label keys, the applied set may - * differ depending on the Kubernetes version -- it's best to assume the - * behavior is undefined and conflicts should be avoided. For more - * information, including usage and the valid values, see: - * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - */ - labels: any; - /** - * The number of local SSD disks to be attached to the node. The limit for - * this value is dependant upon the maximum number of disks available on a - * machine per zone. See: - * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits for - * more information. - */ - localSsdCount: number; - /** - * The name of a Google Compute Engine [machine - * type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If unspecified, - * the default machine type is `n1-standard-1`. - */ - machineType: string; - /** - * The metadata key/value pairs assigned to instances in the cluster. Keys - * must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in - * length. These are reflected as part of a URL in the metadata server. - * Additionally, to avoid ambiguity, keys must not conflict with any other - * metadata keys for the project or be one of the reserved keys: - * "cluster-location" "cluster-name" - * "cluster-uid" "configure-sh" - * "gci-update-strategy" "gci-ensure-gke-docker" - * "instance-template" "kube-env" - * "startup-script" "user-data" Values are free-form - * strings, and only have meaning as interpreted by the image running in the - * instance. The only restriction placed on them is that each value's size - * must be less than or equal to 32 KB. The total size of all keys and values - * must be less than 512 KB. - */ - metadata: any; - /** - * Minimum CPU platform to be used by this instance. The instance may be - * scheduled on the specified or newer CPU platform. Applicable values are the - * friendly names of CPU platforms, such as <code>minCpuPlatform: - * &quot;Intel Haswell&quot;</code> or - * <code>minCpuPlatform: &quot;Intel Sandy - * Bridge&quot;</code>. For more information, read [how to specify - * min CPU - * platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) - */ - minCpuPlatform: string; - /** - * The set of Google API scopes to be made available on all of the node VMs - * under the "default" service account. The following scopes are - * recommended, but not required, and by default are not included: * - * `https://www.googleapis.com/auth/compute` is required for mounting - * persistent storage on your nodes. * - * `https://www.googleapis.com/auth/devstorage.read_only` is required for - * communicating with **gcr.io** (the [Google Container - * Registry](/container-registry/)). If unspecified, no scopes are added, - * unless Cloud Logging or Cloud Monitoring are enabled, in which case their - * required scopes will be added. - */ - oauthScopes: string[]; - /** - * Whether the nodes are created as preemptible VM instances. See: - * https://cloud.google.com/compute/docs/instances/preemptible for more - * inforamtion about preemptible VM instances. - */ - preemptible: boolean; - /** - * The Google Cloud Platform Service Account to be used by the node VMs. If no - * Service Account is specified, the "default" service account is - * used. - */ - serviceAccount: string; - /** - * The list of instance tags applied to all nodes. Tags are used to identify - * valid sources or targets for network firewalls and are specified by the - * client during cluster or node pool creation. Each tag within the list must - * comply with RFC1035. - */ - tags: string[]; - /** - * List of kubernetes taints to be applied to each node. For more - * information, including usage and the valid values, see: - * https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - */ - taints: Schema$NodeTaint[]; - /** - * The workload metadata configuration for this node. - */ - workloadMetadataConfig: Schema$WorkloadMetadataConfig; -} -/** - * NodeManagement defines the set of node management services turned on for the - * node pool. - */ -export interface Schema$NodeManagement { - /** - * Whether the nodes will be automatically repaired. - */ - autoRepair: boolean; - /** - * Whether the nodes will be automatically upgraded. - */ - autoUpgrade: boolean; - /** - * Specifies the Auto Upgrade knobs for the node pool. - */ - upgradeOptions: Schema$AutoUpgradeOptions; -} -/** - * NodePool contains the name and configuration for a cluster's node pool. - * Node pools are a set of nodes (i.e. VM's), with a common configuration - * and specification, under the control of the cluster master. They may have a - * set of Kubernetes labels applied to them, which may be used to reference them - * during pod scheduling. They may also be resized up or down, to accommodate - * the workload. - */ -export interface Schema$NodePool { - /** - * Autoscaler configuration for this NodePool. Autoscaler is enabled only if a - * valid configuration is present. - */ - autoscaling: Schema$NodePoolAutoscaling; - /** - * The node configuration of the pool. - */ - config: Schema$NodeConfig; - /** - * The initial node count for the pool. You must ensure that your Compute - * Engine <a href="/compute/docs/resource-quotas">resource - * quota</a> is sufficient for this number of instances. You must also - * have available firewall and routes quota. - */ - initialNodeCount: number; - /** - * [Output only] The resource URLs of the [managed instance - * groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) - * associated with this node pool. - */ - instanceGroupUrls: string[]; - /** - * NodeManagement configuration for this NodePool. - */ - management: Schema$NodeManagement; - /** - * The name of the node pool. - */ - name: string; - /** - * [Output only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The status of the nodes in this pool instance. - */ - status: string; - /** - * [Output only] Additional information about the current status of this node - * pool instance, if available. - */ - statusMessage: string; - /** - * The version of the Kubernetes of this node. - */ - version: string; -} -/** - * NodePoolAutoscaling contains information required by cluster autoscaler to - * adjust the size of the node pool to the current cluster usage. - */ -export interface Schema$NodePoolAutoscaling { - /** - * Is autoscaling enabled for this node pool. - */ - enabled: boolean; - /** - * Maximum number of nodes in the NodePool. Must be >= min_node_count. - * There has to enough quota to scale up the cluster. - */ - maxNodeCount: number; - /** - * Minimum number of nodes in the NodePool. Must be >= 1 and <= - * max_node_count. - */ - minNodeCount: number; -} -/** - * Kubernetes taint is comprised of three fields: key, value, and effect. Effect - * can only be one of three types: NoSchedule, PreferNoSchedule or NoExecute. - * For more information, including usage and the valid values, see: - * https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - */ -export interface Schema$NodeTaint { - /** - * Effect for taint. - */ - effect: string; - /** - * Key for taint. - */ - key: string; - /** - * Value for taint. - */ - value: string; -} -/** - * This operation resource represents operations that may have happened or are - * happening on the cluster. All fields are output only. - */ -export interface Schema$Operation { - /** - * Detailed operation progress, if available. - */ - detail: string; - /** - * [Output only] The time the operation completed, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - endTime: string; - /** - * [Output only] The name of the Google Compute Engine - * [zone](/compute/docs/regions-zones/regions-zones#available) or - * [region](/compute/docs/regions-zones/regions-zones#available) in which the - * cluster resides. - */ - location: string; - /** - * The server-assigned ID for the operation. - */ - name: string; - /** - * The operation type. - */ - operationType: string; - /** - * Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output only] The time the operation started, in - * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - */ - startTime: string; - /** - * The current status of the operation. - */ - status: string; - /** - * If an error has occurred, a textual description of the error. - */ - statusMessage: string; - /** - * Server-defined URL for the target of the operation. - */ - targetLink: string; - /** - * The name of the Google Compute Engine [zone](/compute/docs/zones#available) - * in which the operation is taking place. This field is deprecated, use - * location instead. - */ - zone: string; -} -/** - * Configuration for the PodSecurityPolicy feature. - */ -export interface Schema$PodSecurityPolicyConfig { - /** - * Enable the PodSecurityPolicy controller for this cluster. If enabled, pods - * must be valid under a PodSecurityPolicy to be created. - */ - enabled: boolean; -} -/** - * RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed - * NodePool upgrade. This will be an no-op if the last upgrade successfully - * completed. - */ -export interface Schema$RollbackNodePoolUpgradeRequest { - /** - * Deprecated. The name of the cluster to rollback. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool id) of the node poll to - * rollback upgrade. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to rollback. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * Kubernetes Engine service configuration. - */ -export interface Schema$ServerConfig { - /** - * Version of Kubernetes the service deploys by default. - */ - defaultClusterVersion: string; - /** - * Default image type. - */ - defaultImageType: string; - /** - * List of valid image types. - */ - validImageTypes: string[]; - /** - * List of valid master versions. - */ - validMasterVersions: string[]; - /** - * List of valid node upgrade target versions. - */ - validNodeVersions: string[]; -} -/** - * SetAddonsRequest sets the addons associated with the cluster. - */ -export interface Schema$SetAddonsConfigRequest { - /** - * The desired configurations for the various addons available to run in the - * cluster. - */ - addonsConfig: Schema$AddonsConfig; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to set addons. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLabelsRequest sets the Google Cloud Platform labels on a Google Container - * Engine cluster, which will in turn set them for Google Compute Engine - * resources used by that cluster - */ -export interface Schema$SetLabelsRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The fingerprint of the previous set of labels for this resource, used to - * detect conflicts. The fingerprint is initially generated by Kubernetes - * Engine and changes after every request to modify or update labels. You must - * always provide an up-to-date fingerprint hash when updating or changing - * labels. Make a <code>get()</code> request to the resource to - * get the latest fingerprint. - */ - labelFingerprint: string; - /** - * The name (project, location, cluster id) of the cluster to set labels. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * The labels to set for that cluster. - */ - resourceLabels: any; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for - * a cluster. - */ -export interface Schema$SetLegacyAbacRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * Whether ABAC authorization will be enabled in the cluster. - */ - enabled: boolean; - /** - * The name (project, location, cluster id) of the cluster to set legacy abac. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLocationsRequest sets the locations of the cluster. - */ -export interface Schema$SetLocationsRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The desired list of Google Compute Engine - * [locations](/compute/docs/zones#available) in which the cluster's nodes - * should be located. Changing the locations a cluster is in will result in - * nodes being either created or removed from the cluster, depending on - * whether locations are being added or removed. This list must always - * include the cluster's primary zone. - */ - locations: string[]; - /** - * The name (project, location, cluster) of the cluster to set locations. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetLoggingServiceRequest sets the logging service of a cluster. - */ -export interface Schema$SetLoggingServiceRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The logging service the cluster should use to write metrics. Currently - * available options: * "logging.googleapis.com" - the Google Cloud - * Logging service * "none" - no metrics will be exported from the - * cluster - */ - loggingService: string; - /** - * The name (project, location, cluster) of the cluster to set logging. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - */ -export interface Schema$SetMaintenancePolicyRequest { - /** - * The name of the cluster to update. - */ - clusterId: string; - /** - * The maintenance policy to be set for the cluster. An empty field clears the - * existing maintenance policy. - */ - maintenancePolicy: Schema$MaintenancePolicy; - /** - * The name (project, location, cluster id) of the cluster to set maintenance - * policy. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). - */ - projectId: string; - /** - * The name of the Google Compute Engine [zone](/compute/docs/zones#available) - * in which the cluster resides. - */ - zone: string; -} -/** - * SetMasterAuthRequest updates the admin password of a cluster. - */ -export interface Schema$SetMasterAuthRequest { - /** - * The exact form of action to be taken on the master auth. - */ - action: string; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to set auth. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * A description of the update. - */ - update: Schema$MasterAuth; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetMonitoringServiceRequest sets the monitoring service of a cluster. - */ -export interface Schema$SetMonitoringServiceRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The monitoring service the cluster should use to write metrics. Currently - * available options: * "monitoring.googleapis.com" - the Google - * Cloud Monitoring service * "none" - no metrics will be exported - * from the cluster - */ - monitoringService: string; - /** - * The name (project, location, cluster) of the cluster to set monitoring. - * Specified in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNetworkPolicyRequest enables/disables network policy for a cluster. - */ -export interface Schema$SetNetworkPolicyRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to set networking - * policy. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Configuration options for the NetworkPolicy feature. - */ - networkPolicy: Schema$NetworkPolicy; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. - */ -export interface Schema$SetNodePoolAutoscalingRequest { - /** - * Autoscaling configuration for the node pool. - */ - autoscaling: Schema$NodePoolAutoscaling; - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool) of the node pool to set - * autoscaler settings. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to upgrade. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolManagementRequest sets the node management properties of a node - * pool. - */ -export interface Schema$SetNodePoolManagementRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * NodeManagement configuration for the node pool. - */ - management: Schema$NodeManagement; - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * management properties. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to update. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolSizeRequest sets the size a node pool. - */ -export interface Schema$SetNodePoolSizeRequest { - /** - * Deprecated. The name of the cluster to update. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster, node pool id) of the node pool to set - * size. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * The desired node count for the pool. - */ - nodeCount: number; - /** - * Deprecated. The name of the node pool to update. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * StartIPRotationRequest creates a new IP for the cluster and then performs a - * node upgrade on each node pool to point to the new IP. - */ -export interface Schema$StartIPRotationRequest { - /** - * Deprecated. The name of the cluster. This field has been deprecated and - * replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster id) of the cluster to start IP - * rotation. Specified in the format - * 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://developers.google.com/console/help/new/#projectnumber). - * This field has been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Whether to rotate credentials during IP rotation. - */ - rotateCredentials: boolean; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UpdateClusterRequest updates the settings of a cluster. - */ -export interface Schema$UpdateClusterRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The name (project, location, cluster) of the cluster to update. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * A description of the update. - */ - update: Schema$ClusterUpdate; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UpdateMasterRequest updates the master of the cluster. - */ -export interface Schema$UpdateMasterRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The Kubernetes version to change the master to. Users may specify either - * explicit versions offered by Kubernetes Engine or version aliases, which - * have the following behavior: - "latest": picks the highest valid - * Kubernetes version - "1.X": picks the highest valid patch+gke.N - * patch in the 1.X version - "1.X.Y": picks the highest valid gke.N - * patch in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit - * Kubernetes version - "-": picks the default Kubernetes version - */ - masterVersion: string; - /** - * The name (project, location, cluster) of the cluster to update. Specified - * in the format 'projects/x/locations/x/clusters/*'. - */ - name: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * SetNodePoolVersionRequest updates the version of a node pool. - */ -export interface Schema$UpdateNodePoolRequest { - /** - * Deprecated. The name of the cluster to upgrade. This field has been - * deprecated and replaced by the name field. - */ - clusterId: string; - /** - * The desired image type for the node pool. - */ - imageType: string; - /** - * The name (project, location, cluster, node pool) of the node pool to - * update. Specified in the format - * 'projects/x/locations/x/clusters/x/nodePools/*'. - */ - name: string; - /** - * Deprecated. The name of the node pool to upgrade. This field has been - * deprecated and replaced by the name field. - */ - nodePoolId: string; - /** - * The Kubernetes version to change the nodes to (typically an upgrade). Users - * may specify either explicit versions offered by Kubernetes Engine or - * version aliases, which have the following behavior: - "latest": - * picks the highest valid Kubernetes version - "1.X": picks the - * highest valid patch+gke.N patch in the 1.X version - "1.X.Y": - * picks the highest valid gke.N patch in the 1.X.Y version - - * "1.X.Y-gke.N": picks an explicit Kubernetes version - - * "-": picks the Kubernetes master version - */ - nodeVersion: string; - /** - * Deprecated. The Google Developers Console [project ID or project - * number](https://support.google.com/cloud/answer/6158840). This field has - * been deprecated and replaced by the name field. - */ - projectId: string; - /** - * Deprecated. The name of the Google Compute Engine - * [zone](/compute/docs/zones#available) in which the cluster resides. This - * field has been deprecated and replaced by the name field. - */ - zone: string; -} -/** - * UsableSubnetwork resource returns the subnetwork name, its associated network - * and the primary CIDR range. - */ -export interface Schema$UsableSubnetwork { - /** - * The range of internal addresses that are owned by this subnetwork. - */ - ipCidrRange: string; - /** - * Network Name. Example: projects/my-project/global/networks/my-network - */ - network: string; - /** - * Subnetwork Name. Example: - * projects/my-project/regions/us-central1/subnetworks/my-subnet - */ - subnetwork: string; -} -/** - * WorkloadMetadataConfig defines the metadata configuration to expose to - * workloads on the node pool. - */ -export interface Schema$WorkloadMetadataConfig { - /** - * NodeMetadata is the configuration for how to expose the node metadata to - * the workload running on the node. - */ - nodeMetadata: string; -} - -export class Resource$Projects { - root: Container; - aggregated: Resource$Projects$Aggregated; - locations: Resource$Projects$Locations; - zones: Resource$Projects$Zones; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.aggregated = new Resource$Projects$Aggregated(root); - this.locations = new Resource$Projects$Locations(root); - this.zones = new Resource$Projects$Zones(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Aggregated { - root: Container; - usableSubnetworks: Resource$Projects$Aggregated$Usablesubnetworks; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.usableSubnetworks = - new Resource$Projects$Aggregated$Usablesubnetworks(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Aggregated$Usablesubnetworks { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.aggregated.usableSubnetworks.list - * @desc Lists subnetworks that are usable for creating clusters in a project. - * @alias container.projects.aggregated.usableSubnetworks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` is the project which owns the listed subnetworks. This defaults to the parent project ID. - * @param {integer=} params.pageSize The max number of results per page that should be returned. If the number of available results is larger than `page_size`, a `next_page_token` is returned which can be used to get the next page of results in subsequent requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.pageToken Specifies a page token to use. Set this to the nextPageToken returned by previous list requests to get the next page of results. - * @param {string} params.parent The parent project where subnetworks are usable. Specified in the format 'projects/x'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/aggregated/usableSubnetworks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Projects$Locations { - root: Container; - clusters: Resource$Projects$Locations$Clusters; - operations: Resource$Projects$Locations$Operations; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Locations$Clusters(root); - this.operations = new Resource$Projects$Locations$Operations(root); - } - - getRoot() { - return this.root; - } - - +export namespace container_v1beta1 { /** - * container.projects.locations.getServerConfig - * @desc Returns configuration info about the Kubernetes Engine service. - * @alias container.projects.locations.getServerConfig - * @memberOf! () + * Kubernetes Engine API * - * @param {object} params Parameters for request - * @param {string} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getServerConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getServerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}/serverConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Clusters { - root: Container; - nodePools: Resource$Projects$Locations$Clusters$Nodepools; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.nodePools = new Resource$Projects$Locations$Clusters$Nodepools(root); - } - - getRoot() { - return this.root; - } - - - /** - * container.projects.locations.clusters.completeIpRotation - * @desc Completes master IP rotation. - * @alias container.projects.locations.clusters.completeIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().CompleteIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - completeIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:completeIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.create - * @desc Creates a cluster, consisting of the specified number and type of - * Google Compute Engine instances. By default, the cluster is created in the - * project's [default network](/compute/docs/networks-and-firewalls#networks). - * One firewall is added for the cluster. After cluster creation, the cluster - * creates routes for each node to allow the containers on that node to - * communicate with all other instances in the cluster. Finally, an entry is - * added to the project's global metadata indicating which CIDR range is being - * used by the cluster. - * @alias container.projects.locations.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the cluster will be created. Specified in the format 'projects/x/locations/x'. - * @param {().CreateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.delete - * @desc Deletes the cluster, including the Kubernetes endpoint and all worker - * nodes. Firewalls and routes that were configured during cluster creation - * are also deleted. Other Google Compute Engine resources that might be in - * use by the cluster (e.g. load balancer resources) will not be deleted if - * they weren't present at the initial create time. - * @alias container.projects.locations.clusters.delete - * @memberOf! () + * The Google Kubernetes Engine API is used for building and managing + * container based applications, powered by the open source Kubernetes + * technology. * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * container.projects.locations.clusters.get - * @desc Gets the details of a specific cluster. - * @alias container.projects.locations.clusters.get - * @memberOf! () + * @example + * const google = require('googleapis'); + * const container = google.container('v1beta1'); * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace container + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Container */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + export class Container { + _options: GlobalOptions; + google: GoogleApis; + root = this; + projects: Resource$Projects; - /** - * container.projects.locations.clusters.list - * @desc Lists all clusters owned by a project in either the specified zone or - * all zones. - * @alias container.projects.locations.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * container.projects.locations.clusters.setAddons - * @desc Sets the addons of a specific cluster. - * @alias container.projects.locations.clusters.setAddons - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set addons. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetAddonsConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAddons(params?: any, options?: MethodOptions): - AxiosPromise; - setAddons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAddons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.projects = new Resource$Projects(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setAddons') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * container.projects.locations.clusters.setLegacyAbac - * @desc Enables or disables the ABAC authorization mechanism on a cluster. - * @alias container.projects.locations.clusters.setLegacyAbac - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLegacyAbacRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLegacyAbac(params?: any, options?: MethodOptions): - AxiosPromise; - setLegacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLegacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setLegacyAbac') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * container.projects.locations.clusters.setLocations - * @desc Sets the locations of a specific cluster. - * @alias container.projects.locations.clusters.setLocations - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set locations. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLocationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * AcceleratorConfig represents a Hardware Accelerator request. */ - setLocations(params?: any, options?: MethodOptions): - AxiosPromise; - setLocations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLocations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setLocations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AcceleratorConfig { + /** + * The number of the accelerator cards exposed to an instance. + */ + acceleratorCount: string; + /** + * The accelerator type resource name. List of supported accelerators + * [here](/compute/docs/gpus/#Introduction) + */ + acceleratorType: string; } - - /** - * container.projects.locations.clusters.setLogging - * @desc Sets the logging service of a specific cluster. - * @alias container.projects.locations.clusters.setLogging - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set logging. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLoggingServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setLogging(params?: any, options?: MethodOptions): - AxiosPromise; - setLogging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setLogging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setLogging') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Configuration for the addons that can be automatically spun up in the + * cluster, enabling additional functionality. + */ + export interface Schema$AddonsConfig { + /** + * Configuration for the horizontal pod autoscaling feature, which increases + * or decreases the number of replica pods a replication controller has + * based on the resource usage of the existing pods. + */ + horizontalPodAutoscaling: Schema$HorizontalPodAutoscaling; + /** + * Configuration for the HTTP (L7) load balancing controller addon, which + * makes it easy to set up HTTP load balancers for services in a cluster. + */ + httpLoadBalancing: Schema$HttpLoadBalancing; + /** + * Configuration for the Kubernetes Dashboard. + */ + kubernetesDashboard: Schema$KubernetesDashboard; + /** + * Configuration for NetworkPolicy. This only tracks whether the addon is + * enabled or not on the Master, it does not track whether network policy is + * enabled for the nodes. + */ + networkPolicyConfig: Schema$NetworkPolicyConfig; } - - /** - * container.projects.locations.clusters.setMaintenancePolicy - * @desc Sets the maintenance policy for a cluster. - * @alias container.projects.locations.clusters.setMaintenancePolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMaintenancePolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMaintenancePolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setMaintenancePolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * AutoUpgradeOptions defines the set of options for the user to control how + * the Auto Upgrades will proceed. + */ + export interface Schema$AutoUpgradeOptions { + /** + * [Output only] This field is set when upgrades are about to commence with + * the approximate start time for the upgrades, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + autoUpgradeStartTime: string; + /** + * [Output only] This field is set when upgrades are about to commence with + * the description of the upgrade. + */ + description: string; } - - /** - * container.projects.locations.clusters.setMasterAuth - * @desc Used to set master auth materials. Currently supports :- Changing the - * admin password of a specific cluster. This can be either via password - * generation or explicitly set. Modify basic_auth.csv and reset the K8S API - * server. - * @alias container.projects.locations.clusters.setMasterAuth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set auth. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMasterAuthRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMasterAuth(params?: any, options?: MethodOptions): - AxiosPromise; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setMasterAuth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CancelOperationRequest cancels a single operation. + */ + export interface Schema$CancelOperationRequest { + /** + * The name (project, location, operation id) of the operation to cancel. + * Specified in the format 'projects/x/locations/x/operations/*'. + */ + name: string; + /** + * Deprecated. The server-assigned `name` of the operation. This field has + * been deprecated and replaced by the name field. + */ + operationId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation resides. + * This field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.locations.clusters.setMonitoring - * @desc Sets the monitoring service of a specific cluster. - * @alias container.projects.locations.clusters.setMonitoring - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to set monitoring. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetMonitoringServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMonitoring(params?: any, options?: MethodOptions): - AxiosPromise; - setMonitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMonitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setMonitoring') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CidrBlock contains an optional name and one CIDR block. + */ + export interface Schema$CidrBlock { + /** + * cidr_block must be specified in CIDR notation. + */ + cidrBlock: string; + /** + * display_name is an optional field for users to identify CIDR blocks. + */ + displayName: string; } - - /** - * container.projects.locations.clusters.setNetworkPolicy - * @desc Enables/Disables Network Policy for a cluster. - * @alias container.projects.locations.clusters.setNetworkPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetNetworkPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration for client certificates on the cluster. */ - setNetworkPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setNetworkPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ClientCertificateConfig { + /** + * Issue a client certificate. + */ + issueClientCertificate: boolean; } - - /** - * container.projects.locations.clusters.setResourceLabels - * @desc Sets labels on a cluster. - * @alias container.projects.locations.clusters.setResourceLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to set labels. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().SetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setResourceLabels(params?: any, options?: MethodOptions): - AxiosPromise; - setResourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setResourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setResourceLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Google Kubernetes Engine cluster. + */ + export interface Schema$Cluster { + /** + * Configurations for the various addons available to run in the cluster. + */ + addonsConfig: Schema$AddonsConfig; + /** + * The IP address range of the container pods in this cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically + * chosen or specify a `/14` block in `10.0.0.0/8`. + */ + clusterIpv4Cidr: string; + /** + * [Output only] The time the cluster was created, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + createTime: string; + /** + * [Output only] The current software version of the master endpoint. + */ + currentMasterVersion: string; + /** + * [Output only] The number of nodes currently in the cluster. + */ + currentNodeCount: number; + /** + * [Output only] The current version of the node software components. If + * they are currently at multiple versions because they're in the + * process of being upgraded, this reflects the minimum version of all + * nodes. + */ + currentNodeVersion: string; + /** + * An optional description of this cluster. + */ + description: string; + /** + * Kubernetes alpha features are enabled on this cluster. This includes + * alpha API groups (e.g. v1beta1) and features that may not be production + * ready in the kubernetes version of the master and nodes. The cluster has + * no SLA for uptime and master/node upgrades are disabled. Alpha enabled + * clusters are automatically deleted thirty days after creation. + */ + enableKubernetesAlpha: boolean; + /** + * [Output only] The IP address of this cluster's master endpoint. The + * endpoint can be accessed from the internet at + * `https://username:password@endpoint/`. See the `masterAuth` property of + * this resource for username and password information. + */ + endpoint: string; + /** + * [Output only] The time the cluster will be automatically deleted in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + expireTime: string; + /** + * The initial Kubernetes version for this cluster. Valid versions are + * those found in validMasterVersions returned by getServerConfig. The + * version can be upgraded over time; such upgrades are reflected in + * currentMasterVersion and currentNodeVersion. Users may specify either + * explicit versions offered by Kubernetes Engine or version aliases, which + * have the following behavior: - "latest": picks the highest + * valid Kubernetes version - "1.X": picks the highest valid + * patch+gke.N patch in the 1.X version - "1.X.Y": picks the + * highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": + * picks an explicit Kubernetes version - "","-": picks + * the default Kubernetes version + */ + initialClusterVersion: string; + /** + * The number of nodes to create in this cluster. You must ensure that your + * Compute Engine <a + * href="/compute/docs/resource-quotas">resource + * quota</a> is sufficient for this number of instances. You must also + * have available firewall and routes quota. For requests, this field should + * only be used in lieu of a "node_pool" object, since this + * configuration (along with the "node_config") will be used to + * create a "NodePool" object with an auto-generated name. Do not + * use this and a node_pool at the same time. + */ + initialNodeCount: number; + /** + * Deprecated. Use node_pools.instance_group_urls. + */ + instanceGroupUrls: string[]; + /** + * Configuration for cluster IP allocation. + */ + ipAllocationPolicy: Schema$IPAllocationPolicy; + /** + * The fingerprint of the set of labels for this cluster. + */ + labelFingerprint: string; + /** + * Configuration for the legacy ABAC authorization mode. + */ + legacyAbac: Schema$LegacyAbac; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/regions-zones/regions-zones#available) or + * [region](/compute/docs/regions-zones/regions-zones#available) in which + * the cluster resides. + */ + location: string; + /** + * The list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. + */ + locations: string[]; + /** + * The logging service the cluster should use to write logs. Currently + * available options: * `logging.googleapis.com` - the Google Cloud Logging + * service. * `none` - no logs will be exported from the cluster. * if left + * as an empty string,`logging.googleapis.com` will be used. + */ + loggingService: string; + /** + * Configure the maintenance policy for this cluster. + */ + maintenancePolicy: Schema$MaintenancePolicy; + /** + * The authentication information for accessing the master endpoint. + */ + masterAuth: Schema$MasterAuth; + /** + * The configuration options for master authorized networks feature. + */ + masterAuthorizedNetworksConfig: Schema$MasterAuthorizedNetworksConfig; + /** + * The IP prefix in CIDR notation to use for the hosted master network. This + * prefix will be used for assigning private IP addresses to the master or + * set of masters, as well as the ILB VIP. + */ + masterIpv4CidrBlock: string; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * `monitoring.googleapis.com` - the Google Cloud + * Monitoring service. * `none` - no metrics will be exported from the + * cluster. * if left as an empty string, `monitoring.googleapis.com` will + * be used. + */ + monitoringService: string; + /** + * The name of this cluster. The name must be unique within this project and + * zone, and can be up to 40 characters with the following restrictions: * + * Lowercase letters, numbers, and hyphens only. * Must start with a letter. + * * Must end with a number or a letter. + */ + name: string; + /** + * The name of the Google Compute Engine + * [network](/compute/docs/networks-and-firewalls#networks) to which the + * cluster is connected. If left unspecified, the `default` network will be + * used. On output this shows the network ID instead of the name. + */ + network: string; + /** + * Configuration for cluster networking. + */ + networkConfig: Schema$NetworkConfig; + /** + * Configuration options for the NetworkPolicy feature. + */ + networkPolicy: Schema$NetworkPolicy; + /** + * Parameters used in creating the cluster's nodes. See `nodeConfig` for + * the description of its properties. For requests, this field should only + * be used in lieu of a "node_pool" object, since this + * configuration (along with the "initial_node_count") will be + * used to create a "NodePool" object with an auto-generated name. + * Do not use this and a node_pool at the same time. For responses, this + * field will be populated with the node configuration of the first node + * pool. If unspecified, the defaults are used. + */ + nodeConfig: Schema$NodeConfig; + /** + * [Output only] The size of the address space on each node for hosting + * containers. This is provisioned from within the `container_ipv4_cidr` + * range. + */ + nodeIpv4CidrSize: number; + /** + * The node pools associated with this cluster. This field should not be set + * if "node_config" or "initial_node_count" are + * specified. + */ + nodePools: Schema$NodePool[]; + /** + * Configuration for the PodSecurityPolicy feature. + */ + podSecurityPolicyConfig: Schema$PodSecurityPolicyConfig; + /** + * If this is a private cluster setup. Private clusters are clusters that, + * by default have no external IP addresses on the nodes and where nodes and + * the master communicate over private IP addresses. + */ + privateCluster: boolean; + /** + * The resource labels for the cluster to use to annotate any related Google + * Compute Engine resources. + */ + resourceLabels: any; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The IP address range of the Kubernetes services in this + * cluster, in + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the + * last `/16` from the container CIDR. + */ + servicesIpv4Cidr: string; + /** + * [Output only] The current status of this cluster. + */ + status: string; + /** + * [Output only] Additional information about the current status of this + * cluster, if available. + */ + statusMessage: string; + /** + * The name of the Google Compute Engine + * [subnetwork](/compute/docs/subnetworks) to which the cluster is + * connected. On output this shows the subnetwork ID instead of the name. + */ + subnetwork: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field is deprecated, use location instead. + */ + zone: string; } - - /** - * container.projects.locations.clusters.startIpRotation - * @desc Start master IP rotation. - * @alias container.projects.locations.clusters.startIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().StartIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:startIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * ClusterUpdate describes an update to the cluster. Exactly one update can be + * applied to a cluster with each request, so at most one field can be + * provided. + */ + export interface Schema$ClusterUpdate { + /** + * Configurations for the various addons available to run in the cluster. + */ + desiredAddonsConfig: Schema$AddonsConfig; + /** + * The desired image type for the node pool. NOTE: Set the + * "desired_node_pool" field as well. + */ + desiredImageType: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. Changing the locations a cluster is in will + * result in nodes being either created or removed from the cluster, + * depending on whether locations are being added or removed. This list + * must always include the cluster's primary zone. + */ + desiredLocations: string[]; + /** + * The desired configuration options for master authorized networks feature. + */ + desiredMasterAuthorizedNetworksConfig: + Schema$MasterAuthorizedNetworksConfig; + /** + * The Kubernetes version to change the master to. The only valid value is + * the latest supported version. Users may specify either explicit versions + * offered by Kubernetes Engine or version aliases, which have the following + * behavior: - "latest": picks the highest valid Kubernetes + * version - "1.X": picks the highest valid patch+gke.N patch in + * the 1.X version - "1.X.Y": picks the highest valid gke.N patch + * in the 1.X.Y version - "1.X.Y-gke.N": picks an explicit + * Kubernetes version - "-": picks the default Kubernetes version + */ + desiredMasterVersion: string; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * "monitoring.googleapis.com" - the Google + * Cloud Monitoring service * "none" - no metrics will be exported + * from the cluster + */ + desiredMonitoringService: string; + /** + * Autoscaler configuration for the node pool specified in + * desired_node_pool_id. If there is only one pool in the cluster and + * desired_node_pool_id is not provided then the change applies to that + * single node pool. + */ + desiredNodePoolAutoscaling: Schema$NodePoolAutoscaling; + /** + * The node pool to be upgraded. This field is mandatory if + * "desired_node_version", "desired_image_family" or + * "desired_node_pool_autoscaling" is specified and there is more + * than one node pool on the cluster. + */ + desiredNodePoolId: string; + /** + * The Kubernetes version to change the nodes to (typically an upgrade). + * Users may specify either explicit versions offered by Kubernetes Engine + * or version aliases, which have the following behavior: - + * "latest": picks the highest valid Kubernetes version - + * "1.X": picks the highest valid patch+gke.N patch in the 1.X + * version - "1.X.Y": picks the highest valid gke.N patch in + * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes + * version - "-": picks the Kubernetes master version + */ + desiredNodeVersion: string; + /** + * The desired configuration options for the PodSecurityPolicy feature. + */ + desiredPodSecurityPolicyConfig: Schema$PodSecurityPolicyConfig; } - - /** - * container.projects.locations.clusters.update - * @desc Updates the settings of a specific cluster. - * @alias container.projects.locations.clusters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().UpdateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CompleteIPRotationRequest moves the cluster master back into single-IP + * mode. + */ + export interface Schema$CompleteIPRotationRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to complete IP + * rotation. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.locations.clusters.updateMaster - * @desc Updates the master of a specific cluster. - * @alias container.projects.locations.clusters.updateMaster - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {().UpdateMasterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateMaster(params?: any, options?: MethodOptions): - AxiosPromise; - updateMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:updateMaster') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Clusters$Nodepools { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * CreateClusterRequest creates a cluster. + */ + export interface Schema$CreateClusterRequest { + /** + * A [cluster + * resource](/container-engine/reference/rest/v1beta1/projects.zones.clusters) + */ + cluster: Schema$Cluster; + /** + * The parent (project and location) where the cluster will be created. + * Specified in the format 'projects/x/locations/*'. + */ + parent: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the parent field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the parent field. + */ + zone: string; } - - /** - * container.projects.locations.clusters.nodePools.create - * @desc Creates a node pool for a cluster. - * @alias container.projects.locations.clusters.nodePools.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project, location, cluster id) where the node pool will be created. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().CreateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CreateNodePoolRequest creates a node pool for a cluster. + */ + export interface Schema$CreateNodePoolRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the parent field. + */ + clusterId: string; + /** + * The node pool to create. + */ + nodePool: Schema$NodePool; + /** + * The parent (project, location, cluster id) where the node pool will be + * created. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + parent: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the parent field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the parent field. + */ + zone: string; } - - /** - * container.projects.locations.clusters.nodePools.delete - * @desc Deletes a node pool from a cluster. - * @alias container.projects.locations.clusters.nodePools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string=} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Time window specified for daily maintenance operations. + */ + export interface Schema$DailyMaintenanceWindow { + /** + * [Output only] Duration of the time window, automatically chosen to be + * smallest possible in the given scenario. + */ + duration: string; + /** + * Time within the maintenance window to start the maintenance operations. + * It must be in format "HH:MM”, where HH : [00-23] and MM : [00-59] + * GMT. + */ + startTime: string; } - - /** - * container.projects.locations.clusters.nodePools.get - * @desc Retrieves the node pool requested. - * @alias container.projects.locations.clusters.nodePools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string=} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Configuration options for the horizontal pod autoscaling feature, which + * increases or decreases the number of replica pods a replication controller + * has based on the resource usage of the existing pods. + */ + export interface Schema$HorizontalPodAutoscaling { + /** + * Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + * When enabled, it ensures that a Heapster pod is running in the cluster, + * which is also used by the Cloud Monitoring service. + */ + disabled: boolean; } - - /** - * container.projects.locations.clusters.nodePools.list - * @desc Lists the node pools for a cluster. - * @alias container.projects.locations.clusters.nodePools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration options for the HTTP (L7) load balancing controller addon, + * which makes it easy to set up HTTP load balancers for services in a + * cluster. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$HttpLoadBalancing { + /** + * Whether the HTTP Load Balancing controller is enabled in the cluster. + * When enabled, it runs a small pod in the cluster that manages the load + * balancers. + */ + disabled: boolean; } - - /** - * container.projects.locations.clusters.nodePools.rollback - * @desc Roll back the previously Aborted or Failed NodePool upgrade. This - * will be an no-op if the last upgrade successfully completed. - * @alias container.projects.locations.clusters.nodePools.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Configuration for controlling how IPs are allocated in the cluster. + */ + export interface Schema$IPAllocationPolicy { + /** + * If true, allow allocation of cluster CIDR ranges that overlap with + * certain kinds of network routes. By default we do not allow cluster CIDR + * ranges to intersect with any user declared routes. With + * allow_route_overlap == true, we allow overlapping with CIDR ranges that + * are larger than the cluster CIDR range. If this field is set to true, + * then cluster and services CIDRs must be fully-specified (e.g. + * `10.96.0.0/14`, but not `/14`), which means: 1) When `use_ip_aliases` is + * true, `cluster_ipv4_cidr_block` and `services_ipv4_cidr_block` must be + * fully-specified. 2) When `use_ip_aliases` is false, + * `cluster.cluster_ipv4_cidr` muse be fully-specified. + */ + allowRouteOverlap: boolean; + /** + * This field is deprecated, use cluster_ipv4_cidr_block. + */ + clusterIpv4Cidr: string; + /** + * The IP address range for the cluster pod IPs. If this field is set, then + * `cluster.cluster_ipv4_cidr` must be left blank. This field is only + * applicable when `use_ip_aliases` is true. Set to blank to have a range + * chosen with the default size. Set to /netmask (e.g. `/14`) to have a + * range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + clusterIpv4CidrBlock: string; + /** + * The name of the secondary range to be used for the cluster CIDR block. + * The secondary range will be used for pod IP addresses. This must be an + * existing secondary range associated with the cluster subnetwork. This + * field is only applicable with use_ip_aliases and create_subnetwork is + * false. + */ + clusterSecondaryRangeName: string; + /** + * Whether a new subnetwork will be created automatically for the cluster. + * This field is only applicable when `use_ip_aliases` is true. + */ + createSubnetwork: boolean; + /** + * This field is deprecated, use node_ipv4_cidr_block. + */ + nodeIpv4Cidr: string; + /** + * The IP address range of the instance IPs in this cluster. This is + * applicable only if `create_subnetwork` is true. Set to blank to have a + * range chosen with the default size. Set to /netmask (e.g. `/14`) to have + * a range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + nodeIpv4CidrBlock: string; + /** + * This field is deprecated, use services_ipv4_cidr_block. + */ + servicesIpv4Cidr: string; + /** + * The IP address range of the services IPs in this cluster. If blank, a + * range will be automatically chosen with the default size. This field is + * only applicable when `use_ip_aliases` is true. Set to blank to have a + * range chosen with the default size. Set to /netmask (e.g. `/14`) to have + * a range chosen with a specific netmask. Set to a + * [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + * notation (e.g. `10.96.0.0/14`) from the RFC-1918 private networks (e.g. + * `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`) to pick a specific range + * to use. + */ + servicesIpv4CidrBlock: string; + /** + * The name of the secondary range to be used as for the services CIDR + * block. The secondary range will be used for service ClusterIPs. This + * must be an existing secondary range associated with the cluster + * subnetwork. This field is only applicable with use_ip_aliases and + * create_subnetwork is false. + */ + servicesSecondaryRangeName: string; + /** + * A custom subnetwork name to be used if `create_subnetwork` is true. If + * this field is empty, then an automatic name will be chosen for the new + * subnetwork. + */ + subnetworkName: string; + /** + * Whether alias IPs will be used for pod IPs in the cluster. + */ + useIpAliases: boolean; } - - /** - * container.projects.locations.clusters.nodePools.setAutoscaling - * @desc Sets the autoscaling settings of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.setAutoscaling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration for the Kubernetes Dashboard. */ - setAutoscaling(params?: any, options?: MethodOptions): - AxiosPromise; - setAutoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAutoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setAutoscaling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$KubernetesDashboard { + /** + * Whether the Kubernetes Dashboard is enabled for this cluster. + */ + disabled: boolean; } - - /** - * container.projects.locations.clusters.nodePools.setManagement - * @desc Sets the NodeManagement options for a node pool. - * @alias container.projects.locations.clusters.nodePools.setManagement - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set management properties. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolManagementRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setManagement(params?: any, options?: MethodOptions): - AxiosPromise; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setManagement') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Configuration for the legacy Attribute Based Access Control authorization + * mode. + */ + export interface Schema$LegacyAbac { + /** + * Whether the ABAC authorizer is enabled for this cluster. When enabled, + * identities in the system, including service accounts, nodes, and + * controllers, will have statically granted permissions beyond those + * provided by the RBAC configuration or IAM. + */ + enabled: boolean; } - - /** - * container.projects.locations.clusters.nodePools.setSize - * @desc Sets the size of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.setSize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set size. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().SetNodePoolSizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSize(params?: any, options?: MethodOptions): - AxiosPromise; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:setSize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * ListClustersResponse is the result of ListClustersRequest. + */ + export interface Schema$ListClustersResponse { + /** + * A list of clusters in the project in the specified zone, or across all + * ones. + */ + clusters: Schema$Cluster[]; + /** + * If any zones are listed here, the list of clusters returned may be + * missing those zones. + */ + missingZones: string[]; } - - /** - * container.projects.locations.clusters.nodePools.update - * @desc Updates the version and/or image type of a specific node pool. - * @alias container.projects.locations.clusters.nodePools.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to update. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {().UpdateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * ListNodePoolsResponse is the result of ListNodePoolsRequest. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListNodePoolsResponse { + /** + * A list of node pools for a cluster. + */ + nodePools: Schema$NodePool[]; } -} - - -export class Resource$Projects$Locations$Operations { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); + /** + * ListOperationsResponse is the result of ListOperationsRequest. + */ + export interface Schema$ListOperationsResponse { + /** + * If any zones are listed here, the list of operations returned may be + * missing the operations from those zones. + */ + missingZones: string[]; + /** + * A list of operations in the project in the specified zone. + */ + operations: Schema$Operation[]; } - - getRoot() { - return this.root; + /** + * ListUsableSubnetworksResponse is the response of + * ListUsableSubnetworksRequest. + */ + export interface Schema$ListUsableSubnetworksResponse { + /** + * This token allows you to get the next page of results for list requests. + * If the number of results is larger than `page_size`, use the + * `next_page_token` as a value for the query parameter `page_token` in the + * next request. The value will become empty when there are no more pages. + */ + nextPageToken: string; + /** + * A list of usable subnetworks in the specified network project. + */ + subnetworks: Schema$UsableSubnetwork[]; } - - /** - * container.projects.locations.operations.cancel - * @desc Cancels the specified operation. - * @alias container.projects.locations.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, operation id) of the operation to cancel. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * MaintenancePolicy defines the maintenance policy to be used for the + * cluster. */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$MaintenancePolicy { + /** + * Specifies the maintenance window in which maintenance may be performed. + */ + window: Schema$MaintenanceWindow; } - - /** - * container.projects.locations.operations.get - * @desc Gets the specified operation. - * @alias container.projects.locations.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {string=} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * MaintenanceWindow defines the maintenance window to be used for the + * cluster. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$MaintenanceWindow { + /** + * DailyMaintenanceWindow specifies a daily maintenance operation window. + */ + dailyMaintenanceWindow: Schema$DailyMaintenanceWindow; } - - /** - * container.projects.locations.operations.list - * @desc Lists all operations in a project in a specific zone or all zones. - * @alias container.projects.locations.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The authentication information for accessing the master endpoint. + * Authentication can be done using HTTP basic auth or using client + * certificates. + */ + export interface Schema$MasterAuth { + /** + * [Output only] Base64-encoded public certificate used by clients to + * authenticate to the cluster endpoint. + */ + clientCertificate: string; + /** + * Configuration for client certificate authentication on the cluster. If + * no configuration is specified, a client certificate is issued. + */ + clientCertificateConfig: Schema$ClientCertificateConfig; + /** + * [Output only] Base64-encoded private key used by clients to authenticate + * to the cluster endpoint. + */ + clientKey: string; + /** + * [Output only] Base64-encoded public certificate that is the root of trust + * for the cluster. + */ + clusterCaCertificate: string; + /** + * The password to use for HTTP basic authentication to the master endpoint. + * Because the master endpoint is open to the Internet, you should create a + * strong password. If a password is provided for cluster creation, + * username must be non-empty. + */ + password: string; + /** + * The username to use for HTTP basic authentication to the master endpoint. + * For clusters v1.6.0 and later, you can disable basic authentication by + * providing an empty username. + */ + username: string; } -} - - -export class Resource$Projects$Zones { - root: Container; - clusters: Resource$Projects$Zones$Clusters; - operations: Resource$Projects$Zones$Operations; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Zones$Clusters(root); - this.operations = new Resource$Projects$Zones$Operations(root); + /** + * Configuration options for the master authorized networks feature. Enabled + * master authorized networks will disallow all external traffic to access + * Kubernetes master through HTTPS except traffic from the given CIDR blocks, + * Google Compute Engine Public IPs and Google Prod IPs. + */ + export interface Schema$MasterAuthorizedNetworksConfig { + /** + * cidr_blocks define up to 10 external networks that could access + * Kubernetes master through HTTPS. + */ + cidrBlocks: Schema$CidrBlock[]; + /** + * Whether or not master authorized networks is enabled. + */ + enabled: boolean; } - - getRoot() { - return this.root; + /** + * NetworkConfig reports the relative names of network & subnetwork. + */ + export interface Schema$NetworkConfig { + /** + * Output only. The name of the Google Compute Engine + * network(/compute/docs/networks-and-firewalls#networks). Example: + * projects/my-project/global/networks/my-network + */ + network: string; + /** + * Output only. The name of the Google Compute Engine + * [subnetwork](/compute/docs/vpc). Example: + * projects/my-project/regions/us-central1/subnetworks/my-subnet + */ + subnetwork: string; } - - /** - * container.projects.zones.getServerconfig - * @desc Returns configuration info about the Kubernetes Engine service. - * @alias container.projects.zones.getServerconfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration options for the NetworkPolicy feature. + * https://kubernetes.io/docs/concepts/services-networking/networkpolicies/ + */ + export interface Schema$NetworkPolicy { + /** + * Whether network policy is enabled on the cluster. + */ + enabled: boolean; + /** + * The selected network policy provider. + */ + provider: string; + } + /** + * Configuration for NetworkPolicy. This only tracks whether the addon is + * enabled or not on the Master, it does not track whether network policy is + * enabled for the nodes. */ - getServerconfig(params?: any, options?: MethodOptions): - AxiosPromise; - getServerconfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getServerconfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/serverconfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$NetworkPolicyConfig { + /** + * Whether NetworkPolicy is enabled for this cluster. + */ + disabled: boolean; } -} -export class Resource$Projects$Zones$Clusters { - root: Container; - nodePools: Resource$Projects$Zones$Clusters$Nodepools; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); - this.nodePools = new Resource$Projects$Zones$Clusters$Nodepools(root); + /** + * Parameters that describe the nodes in a cluster. + */ + export interface Schema$NodeConfig { + /** + * A list of hardware accelerators to be attached to each node. See + * https://cloud.google.com/compute/docs/gpus for more information about + * support for GPUs. + */ + accelerators: Schema$AcceleratorConfig[]; + /** + * Size of the disk attached to each node, specified in GB. The smallest + * allowed disk size is 10GB. If unspecified, the default disk size is + * 100GB. + */ + diskSizeGb: number; + /** + * The image type to use for this node. Note that for a given image type, + * the latest version of it will be used. + */ + imageType: string; + /** + * The map of Kubernetes labels (key/value pairs) to be applied to each + * node. These will added in addition to any default label(s) that + * Kubernetes may apply to the node. In case of conflict in label keys, the + * applied set may differ depending on the Kubernetes version -- it's + * best to assume the behavior is undefined and conflicts should be avoided. + * For more information, including usage and the valid values, see: + * https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ + */ + labels: any; + /** + * The number of local SSD disks to be attached to the node. The limit for + * this value is dependant upon the maximum number of disks available on a + * machine per zone. See: + * https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + * for more information. + */ + localSsdCount: number; + /** + * The name of a Google Compute Engine [machine + * type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If + * unspecified, the default machine type is `n1-standard-1`. + */ + machineType: string; + /** + * The metadata key/value pairs assigned to instances in the cluster. Keys + * must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in + * length. These are reflected as part of a URL in the metadata server. + * Additionally, to avoid ambiguity, keys must not conflict with any other + * metadata keys for the project or be one of the reserved keys: + * "cluster-location" "cluster-name" + * "cluster-uid" "configure-sh" + * "gci-update-strategy" "gci-ensure-gke-docker" + * "instance-template" "kube-env" + * "startup-script" "user-data" Values are free-form + * strings, and only have meaning as interpreted by the image running in the + * instance. The only restriction placed on them is that each value's + * size must be less than or equal to 32 KB. The total size of all keys and + * values must be less than 512 KB. + */ + metadata: any; + /** + * Minimum CPU platform to be used by this instance. The instance may be + * scheduled on the specified or newer CPU platform. Applicable values are + * the friendly names of CPU platforms, such as <code>minCpuPlatform: + * &quot;Intel Haswell&quot;</code> or + * <code>minCpuPlatform: &quot;Intel Sandy + * Bridge&quot;</code>. For more information, read [how to specify + * min CPU + * platform](https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform) + */ + minCpuPlatform: string; + /** + * The set of Google API scopes to be made available on all of the node VMs + * under the "default" service account. The following scopes are + * recommended, but not required, and by default are not included: * + * `https://www.googleapis.com/auth/compute` is required for mounting + * persistent storage on your nodes. * + * `https://www.googleapis.com/auth/devstorage.read_only` is required for + * communicating with **gcr.io** (the [Google Container + * Registry](/container-registry/)). If unspecified, no scopes are added, + * unless Cloud Logging or Cloud Monitoring are enabled, in which case their + * required scopes will be added. + */ + oauthScopes: string[]; + /** + * Whether the nodes are created as preemptible VM instances. See: + * https://cloud.google.com/compute/docs/instances/preemptible for more + * inforamtion about preemptible VM instances. + */ + preemptible: boolean; + /** + * The Google Cloud Platform Service Account to be used by the node VMs. If + * no Service Account is specified, the "default" service account + * is used. + */ + serviceAccount: string; + /** + * The list of instance tags applied to all nodes. Tags are used to identify + * valid sources or targets for network firewalls and are specified by the + * client during cluster or node pool creation. Each tag within the list + * must comply with RFC1035. + */ + tags: string[]; + /** + * List of kubernetes taints to be applied to each node. For more + * information, including usage and the valid values, see: + * https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ + */ + taints: Schema$NodeTaint[]; + /** + * The workload metadata configuration for this node. + */ + workloadMetadataConfig: Schema$WorkloadMetadataConfig; } - - getRoot() { - return this.root; + /** + * NodeManagement defines the set of node management services turned on for + * the node pool. + */ + export interface Schema$NodeManagement { + /** + * Whether the nodes will be automatically repaired. + */ + autoRepair: boolean; + /** + * Whether the nodes will be automatically upgraded. + */ + autoUpgrade: boolean; + /** + * Specifies the Auto Upgrade knobs for the node pool. + */ + upgradeOptions: Schema$AutoUpgradeOptions; } - - /** - * container.projects.zones.clusters.addons - * @desc Sets the addons of a specific cluster. - * @alias container.projects.zones.clusters.addons - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetAddonsConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addons(params?: any, options?: MethodOptions): AxiosPromise; - addons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addons( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * NodePool contains the name and configuration for a cluster's node pool. + * Node pools are a set of nodes (i.e. VM's), with a common configuration + * and specification, under the control of the cluster master. They may have a + * set of Kubernetes labels applied to them, which may be used to reference + * them during pod scheduling. They may also be resized up or down, to + * accommodate the workload. + */ + export interface Schema$NodePool { + /** + * Autoscaler configuration for this NodePool. Autoscaler is enabled only if + * a valid configuration is present. + */ + autoscaling: Schema$NodePoolAutoscaling; + /** + * The node configuration of the pool. + */ + config: Schema$NodeConfig; + /** + * The initial node count for the pool. You must ensure that your Compute + * Engine <a href="/compute/docs/resource-quotas">resource + * quota</a> is sufficient for this number of instances. You must also + * have available firewall and routes quota. + */ + initialNodeCount: number; + /** + * [Output only] The resource URLs of the [managed instance + * groups](/compute/docs/instance-groups/creating-groups-of-managed-instances) + * associated with this node pool. + */ + instanceGroupUrls: string[]; + /** + * NodeManagement configuration for this NodePool. + */ + management: Schema$NodeManagement; + /** + * The name of the node pool. + */ + name: string; + /** + * [Output only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The status of the nodes in this pool instance. + */ + status: string; + /** + * [Output only] Additional information about the current status of this + * node pool instance, if available. + */ + statusMessage: string; + /** + * The version of the Kubernetes of this node. + */ + version: string; } - - /** - * container.projects.zones.clusters.completeIpRotation - * @desc Completes master IP rotation. - * @alias container.projects.zones.clusters.completeIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().CompleteIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - completeIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - completeIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * NodePoolAutoscaling contains information required by cluster autoscaler to + * adjust the size of the node pool to the current cluster usage. + */ + export interface Schema$NodePoolAutoscaling { + /** + * Is autoscaling enabled for this node pool. + */ + enabled: boolean; + /** + * Maximum number of nodes in the NodePool. Must be >= min_node_count. + * There has to enough quota to scale up the cluster. + */ + maxNodeCount: number; + /** + * Minimum number of nodes in the NodePool. Must be >= 1 and <= + * max_node_count. + */ + minNodeCount: number; } - - /** - * container.projects.zones.clusters.create - * @desc Creates a cluster, consisting of the specified number and type of - * Google Compute Engine instances. By default, the cluster is created in the - * project's [default network](/compute/docs/networks-and-firewalls#networks). - * One firewall is added for the cluster. After cluster creation, the cluster - * creates routes for each node to allow the containers on that node to - * communicate with all other instances in the cluster. Finally, an entry is - * added to the project's global metadata indicating which CIDR range is being - * used by the cluster. - * @alias container.projects.zones.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {().CreateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Kubernetes taint is comprised of three fields: key, value, and effect. + * Effect can only be one of three types: NoSchedule, PreferNoSchedule or + * NoExecute. For more information, including usage and the valid values, + * see: + * https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$NodeTaint { + /** + * Effect for taint. + */ + effect: string; + /** + * Key for taint. + */ + key: string; + /** + * Value for taint. + */ + value: string; } - - /** - * container.projects.zones.clusters.delete - * @desc Deletes the cluster, including the Kubernetes endpoint and all worker - * nodes. Firewalls and routes that were configured during cluster creation - * are also deleted. Other Google Compute Engine resources that might be in - * use by the cluster (e.g. load balancer resources) will not be deleted if - * they weren't present at the initial create time. - * @alias container.projects.zones.clusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This operation resource represents operations that may have happened or are + * happening on the cluster. All fields are output only. + */ + export interface Schema$Operation { + /** + * Detailed operation progress, if available. + */ + detail: string; + /** + * [Output only] The time the operation completed, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + endTime: string; + /** + * [Output only] The name of the Google Compute Engine + * [zone](/compute/docs/regions-zones/regions-zones#available) or + * [region](/compute/docs/regions-zones/regions-zones#available) in which + * the cluster resides. + */ + location: string; + /** + * The server-assigned ID for the operation. + */ + name: string; + /** + * The operation type. + */ + operationType: string; + /** + * Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output only] The time the operation started, in + * [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + */ + startTime: string; + /** + * The current status of the operation. + */ + status: string; + /** + * If an error has occurred, a textual description of the error. + */ + statusMessage: string; + /** + * Server-defined URL for the target of the operation. + */ + targetLink: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the operation is taking + * place. This field is deprecated, use location instead. + */ + zone: string; } - - /** - * container.projects.zones.clusters.get - * @desc Gets the details of a specific cluster. - * @alias container.projects.zones.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration for the PodSecurityPolicy feature. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PodSecurityPolicyConfig { + /** + * Enable the PodSecurityPolicy controller for this cluster. If enabled, + * pods must be valid under a PodSecurityPolicy to be created. + */ + enabled: boolean; } - - /** - * container.projects.zones.clusters.legacyAbac - * @desc Enables or disables the ABAC authorization mechanism on a cluster. - * @alias container.projects.zones.clusters.legacyAbac - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLegacyAbacRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - legacyAbac(params?: any, options?: MethodOptions): - AxiosPromise; - legacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - legacyAbac( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed + * NodePool upgrade. This will be an no-op if the last upgrade successfully + * completed. + */ + export interface Schema$RollbackNodePoolUpgradeRequest { + /** + * Deprecated. The name of the cluster to rollback. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool id) of the node poll to + * rollback upgrade. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to rollback. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.list - * @desc Lists all clusters owned by a project in either the specified zone or - * all zones. - * @alias container.projects.zones.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Kubernetes Engine service configuration. + */ + export interface Schema$ServerConfig { + /** + * Version of Kubernetes the service deploys by default. + */ + defaultClusterVersion: string; + /** + * Default image type. + */ + defaultImageType: string; + /** + * List of valid image types. + */ + validImageTypes: string[]; + /** + * List of valid master versions. + */ + validMasterVersions: string[]; + /** + * List of valid node upgrade target versions. + */ + validNodeVersions: string[]; } - - /** - * container.projects.zones.clusters.locations - * @desc Sets the locations of a specific cluster. - * @alias container.projects.zones.clusters.locations - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLocationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - locations(params?: any, options?: MethodOptions): - AxiosPromise; - locations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - locations( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetAddonsRequest sets the addons associated with the cluster. + */ + export interface Schema$SetAddonsConfigRequest { + /** + * The desired configurations for the various addons available to run in the + * cluster. + */ + addonsConfig: Schema$AddonsConfig; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to set addons. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.logging - * @desc Sets the logging service of a specific cluster. - * @alias container.projects.zones.clusters.logging - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLoggingServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - logging(params?: any, options?: MethodOptions): - AxiosPromise; - logging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - logging( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetLabelsRequest sets the Google Cloud Platform labels on a Google + * Container Engine cluster, which will in turn set them for Google Compute + * Engine resources used by that cluster + */ + export interface Schema$SetLabelsRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The fingerprint of the previous set of labels for this resource, used to + * detect conflicts. The fingerprint is initially generated by Kubernetes + * Engine and changes after every request to modify or update labels. You + * must always provide an up-to-date fingerprint hash when updating or + * changing labels. Make a <code>get()</code> request to the + * resource to get the latest fingerprint. + */ + labelFingerprint: string; + /** + * The name (project, location, cluster id) of the cluster to set labels. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * The labels to set for that cluster. + */ + resourceLabels: any; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.master - * @desc Updates the master of a specific cluster. - * @alias container.projects.zones.clusters.master - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateMasterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - master(params?: any, options?: MethodOptions): AxiosPromise; - master( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - master( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetLegacyAbacRequest enables or disables the ABAC authorization mechanism + * for a cluster. + */ + export interface Schema$SetLegacyAbacRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * Whether ABAC authorization will be enabled in the cluster. + */ + enabled: boolean; + /** + * The name (project, location, cluster id) of the cluster to set legacy + * abac. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.monitoring - * @desc Sets the monitoring service of a specific cluster. - * @alias container.projects.zones.clusters.monitoring - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetMonitoringServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - monitoring(params?: any, options?: MethodOptions): - AxiosPromise; - monitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - monitoring( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetLocationsRequest sets the locations of the cluster. + */ + export interface Schema$SetLocationsRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The desired list of Google Compute Engine + * [locations](/compute/docs/zones#available) in which the cluster's + * nodes should be located. Changing the locations a cluster is in will + * result in nodes being either created or removed from the cluster, + * depending on whether locations are being added or removed. This list + * must always include the cluster's primary zone. + */ + locations: string[]; + /** + * The name (project, location, cluster) of the cluster to set locations. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.resourceLabels - * @desc Sets labels on a cluster. - * @alias container.projects.zones.clusters.resourceLabels - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetLabelsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resourceLabels(params?: any, options?: MethodOptions): - AxiosPromise; - resourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resourceLabels( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetLoggingServiceRequest sets the logging service of a cluster. + */ + export interface Schema$SetLoggingServiceRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The logging service the cluster should use to write metrics. Currently + * available options: * "logging.googleapis.com" - the Google + * Cloud Logging service * "none" - no metrics will be exported + * from the cluster + */ + loggingService: string; + /** + * The name (project, location, cluster) of the cluster to set logging. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.setMaintenancePolicy - * @desc Sets the maintenance policy for a cluster. - * @alias container.projects.zones.clusters.setMaintenancePolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId The name of the cluster to update. - * @param {string} params.projectId The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - * @param {string} params.zone The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. - * @param {().SetMaintenancePolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMaintenancePolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMaintenancePolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetMaintenancePolicyRequest sets the maintenance policy for a cluster. + */ + export interface Schema$SetMaintenancePolicyRequest { + /** + * The name of the cluster to update. + */ + clusterId: string; + /** + * The maintenance policy to be set for the cluster. An empty field clears + * the existing maintenance policy. + */ + maintenancePolicy: Schema$MaintenancePolicy; + /** + * The name (project, location, cluster id) of the cluster to set + * maintenance policy. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). + */ + projectId: string; + /** + * The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. + */ + zone: string; } - - /** - * container.projects.zones.clusters.setMasterAuth - * @desc Used to set master auth materials. Currently supports :- Changing the - * admin password of a specific cluster. This can be either via password - * generation or explicitly set. Modify basic_auth.csv and reset the K8S API - * server. - * @alias container.projects.zones.clusters.setMasterAuth - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetMasterAuthRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setMasterAuth(params?: any, options?: MethodOptions): - AxiosPromise; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setMasterAuth( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetMasterAuthRequest updates the admin password of a cluster. + */ + export interface Schema$SetMasterAuthRequest { + /** + * The exact form of action to be taken on the master auth. + */ + action: string; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to set auth. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * A description of the update. + */ + update: Schema$MasterAuth; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.setNetworkPolicy - * @desc Enables/Disables Network Policy for a cluster. - * @alias container.projects.zones.clusters.setNetworkPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNetworkPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setNetworkPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setNetworkPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetMonitoringServiceRequest sets the monitoring service of a cluster. + */ + export interface Schema$SetMonitoringServiceRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The monitoring service the cluster should use to write metrics. Currently + * available options: * "monitoring.googleapis.com" - the Google + * Cloud Monitoring service * "none" - no metrics will be exported + * from the cluster + */ + monitoringService: string; + /** + * The name (project, location, cluster) of the cluster to set monitoring. + * Specified in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.startIpRotation - * @desc Start master IP rotation. - * @alias container.projects.zones.clusters.startIpRotation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().StartIPRotationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startIpRotation(params?: any, options?: MethodOptions): - AxiosPromise; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startIpRotation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetNetworkPolicyRequest enables/disables network policy for a cluster. + */ + export interface Schema$SetNetworkPolicyRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to set networking + * policy. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Configuration options for the NetworkPolicy feature. + */ + networkPolicy: Schema$NetworkPolicy; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.update - * @desc Updates the settings of a specific cluster. - * @alias container.projects.zones.clusters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. + */ + export interface Schema$SetNodePoolAutoscalingRequest { + /** + * Autoscaling configuration for the node pool. + */ + autoscaling: Schema$NodePoolAutoscaling; + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool) of the node pool to set + * autoscaler settings. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to upgrade. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } -} -export class Resource$Projects$Zones$Clusters$Nodepools { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); + /** + * SetNodePoolManagementRequest sets the node management properties of a node + * pool. + */ + export interface Schema$SetNodePoolManagementRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * NodeManagement configuration for the node pool. + */ + management: Schema$NodeManagement; + /** + * The name (project, location, cluster, node pool id) of the node pool to + * set management properties. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to update. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - getRoot() { - return this.root; + /** + * SetNodePoolSizeRequest sets the size a node pool. + */ + export interface Schema$SetNodePoolSizeRequest { + /** + * Deprecated. The name of the cluster to update. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster, node pool id) of the node pool to + * set size. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * The desired node count for the pool. + */ + nodeCount: number; + /** + * Deprecated. The name of the node pool to update. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.autoscaling - * @desc Sets the autoscaling settings of a specific node pool. - * @alias container.projects.zones.clusters.nodePools.autoscaling - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - autoscaling(params?: any, options?: MethodOptions): - AxiosPromise; - autoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - autoscaling( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * StartIPRotationRequest creates a new IP for the cluster and then performs a + * node upgrade on each node pool to point to the new IP. + */ + export interface Schema$StartIPRotationRequest { + /** + * Deprecated. The name of the cluster. This field has been deprecated and + * replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster id) of the cluster to start IP + * rotation. Specified in the format + * 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://developers.google.com/console/help/new/#projectnumber). + * This field has been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Whether to rotate credentials during IP rotation. + */ + rotateCredentials: boolean; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.create - * @desc Creates a node pool for a cluster. - * @alias container.projects.zones.clusters.nodePools.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {().CreateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * UpdateClusterRequest updates the settings of a cluster. + */ + export interface Schema$UpdateClusterRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The name (project, location, cluster) of the cluster to update. Specified + * in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * A description of the update. + */ + update: Schema$ClusterUpdate; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.delete - * @desc Deletes a node pool from a cluster. - * @alias container.projects.zones.clusters.nodePools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * UpdateMasterRequest updates the master of the cluster. + */ + export interface Schema$UpdateMasterRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The Kubernetes version to change the master to. Users may specify either + * explicit versions offered by Kubernetes Engine or version aliases, which + * have the following behavior: - "latest": picks the highest + * valid Kubernetes version - "1.X": picks the highest valid + * patch+gke.N patch in the 1.X version - "1.X.Y": picks the + * highest valid gke.N patch in the 1.X.Y version - "1.X.Y-gke.N": + * picks an explicit Kubernetes version - "-": picks the default + * Kubernetes version + */ + masterVersion: string; + /** + * The name (project, location, cluster) of the cluster to update. Specified + * in the format 'projects/x/locations/x/clusters/*'. + */ + name: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.get - * @desc Retrieves the node pool requested. - * @alias container.projects.zones.clusters.nodePools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. - * @param {string} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SetNodePoolVersionRequest updates the version of a node pool. + */ + export interface Schema$UpdateNodePoolRequest { + /** + * Deprecated. The name of the cluster to upgrade. This field has been + * deprecated and replaced by the name field. + */ + clusterId: string; + /** + * The desired image type for the node pool. + */ + imageType: string; + /** + * The name (project, location, cluster, node pool) of the node pool to + * update. Specified in the format + * 'projects/x/locations/x/clusters/x/nodePools/*'. + */ + name: string; + /** + * Deprecated. The name of the node pool to upgrade. This field has been + * deprecated and replaced by the name field. + */ + nodePoolId: string; + /** + * The Kubernetes version to change the nodes to (typically an upgrade). + * Users may specify either explicit versions offered by Kubernetes Engine + * or version aliases, which have the following behavior: - + * "latest": picks the highest valid Kubernetes version - + * "1.X": picks the highest valid patch+gke.N patch in the 1.X + * version - "1.X.Y": picks the highest valid gke.N patch in + * the 1.X.Y version - "1.X.Y-gke.N": picks an explicit Kubernetes + * version - "-": picks the Kubernetes master version + */ + nodeVersion: string; + /** + * Deprecated. The Google Developers Console [project ID or project + * number](https://support.google.com/cloud/answer/6158840). This field has + * been deprecated and replaced by the name field. + */ + projectId: string; + /** + * Deprecated. The name of the Google Compute Engine + * [zone](/compute/docs/zones#available) in which the cluster resides. This + * field has been deprecated and replaced by the name field. + */ + zone: string; } - - /** - * container.projects.zones.clusters.nodePools.list - * @desc Lists the node pools for a cluster. - * @alias container.projects.zones.clusters.nodePools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - * @param {string=} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId'], - pathParams: ['clusterId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * UsableSubnetwork resource returns the subnetwork name, its associated + * network and the primary CIDR range. + */ + export interface Schema$UsableSubnetwork { + /** + * The range of internal addresses that are owned by this subnetwork. + */ + ipCidrRange: string; + /** + * Network Name. Example: projects/my-project/global/networks/my-network + */ + network: string; + /** + * Subnetwork Name. Example: + * projects/my-project/regions/us-central1/subnetworks/my-subnet + */ + subnetwork: string; } - - /** - * container.projects.zones.clusters.nodePools.rollback - * @desc Roll back the previously Aborted or Failed NodePool upgrade. This - * will be an no-op if the last upgrade successfully completed. - * @alias container.projects.zones.clusters.nodePools.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * WorkloadMetadataConfig defines the metadata configuration to expose to + * workloads on the node pool. */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$WorkloadMetadataConfig { + /** + * NodeMetadata is the configuration for how to expose the node metadata to + * the workload running on the node. + */ + nodeMetadata: string; } - - /** - * container.projects.zones.clusters.nodePools.setManagement - * @desc Sets the NodeManagement options for a node pool. - * @alias container.projects.zones.clusters.nodePools.setManagement - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolManagementRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setManagement(params?: any, options?: MethodOptions): - AxiosPromise; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setManagement( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Container; + aggregated: Resource$Projects$Aggregated; + locations: Resource$Projects$Locations; + zones: Resource$Projects$Zones; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.aggregated = new Resource$Projects$Aggregated(root); + this.locations = new Resource$Projects$Locations(root); + this.zones = new Resource$Projects$Zones(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - - - /** - * container.projects.zones.clusters.nodePools.setSize - * @desc Sets the size of a specific node pool. - * @alias container.projects.zones.clusters.nodePools.setSize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().SetNodePoolSizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setSize(params?: any, options?: MethodOptions): - AxiosPromise; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setSize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Aggregated { + root: Container; + usableSubnetworks: Resource$Projects$Aggregated$Usablesubnetworks; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.usableSubnetworks = + new Resource$Projects$Aggregated$Usablesubnetworks(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Aggregated$Usablesubnetworks { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.aggregated.usableSubnetworks.list + * @desc Lists subnetworks that are usable for creating clusters in a + * project. + * @alias container.projects.aggregated.usableSubnetworks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Filtering currently only supports equality on the networkProjectId and must be in the form: "networkProjectId=[PROJECTID]", where `networkProjectId` is the project which owns the listed subnetworks. This defaults to the parent project ID. + * @param {integer=} params.pageSize The max number of results per page that should be returned. If the number of available results is larger than `page_size`, a `next_page_token` is returned which can be used to get the next page of results in subsequent requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.pageToken Specifies a page token to use. Set this to the nextPageToken returned by previous list requests to get the next page of results. + * @param {string} params.parent The parent project where subnetworks are usable. Specified in the format 'projects/x'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/aggregated/usableSubnetworks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - /** - * container.projects.zones.clusters.nodePools.update - * @desc Updates the version and/or image type of a specific node pool. - * @alias container.projects.zones.clusters.nodePools.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {().UpdateNodePoolRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], - pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations { + root: Container; + clusters: Resource$Projects$Locations$Clusters; + operations: Resource$Projects$Locations$Operations; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Locations$Clusters(root); + this.operations = new Resource$Projects$Locations$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.getServerConfig + * @desc Returns configuration info about the Kubernetes Engine service. + * @alias container.projects.locations.getServerConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServerConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getServerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getServerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}/serverConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - - -export class Resource$Projects$Zones$Operations { - root: Container; - constructor(root: Container) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Projects$Locations$Clusters { + root: Container; + nodePools: Resource$Projects$Locations$Clusters$Nodepools; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.nodePools = new Resource$Projects$Locations$Clusters$Nodepools(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.clusters.completeIpRotation + * @desc Completes master IP rotation. + * @alias container.projects.locations.clusters.completeIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().CompleteIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + completeIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:completeIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.create + * @desc Creates a cluster, consisting of the specified number and type of + * Google Compute Engine instances. By default, the cluster is created in + * the project's [default + * network](/compute/docs/networks-and-firewalls#networks). One firewall is + * added for the cluster. After cluster creation, the cluster creates routes + * for each node to allow the containers on that node to communicate with + * all other instances in the cluster. Finally, an entry is added to the + * project's global metadata indicating which CIDR range is being used by + * the cluster. + * @alias container.projects.locations.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the cluster will be created. Specified in the format 'projects/x/locations/x'. + * @param {().CreateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.delete + * @desc Deletes the cluster, including the Kubernetes endpoint and all + * worker nodes. Firewalls and routes that were configured during cluster + * creation are also deleted. Other Google Compute Engine resources that + * might be in use by the cluster (e.g. load balancer resources) will not be + * deleted if they weren't present at the initial create time. + * @alias container.projects.locations.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.get + * @desc Gets the details of a specific cluster. + * @alias container.projects.locations.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.list + * @desc Lists all clusters owned by a project in either the specified zone + * or all zones. + * @alias container.projects.locations.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setAddons + * @desc Sets the addons of a specific cluster. + * @alias container.projects.locations.clusters.setAddons + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set addons. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetAddonsConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAddons(params?: any, options?: MethodOptions): + AxiosPromise; + setAddons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAddons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setAddons') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLegacyAbac + * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @alias container.projects.locations.clusters.setLegacyAbac + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLegacyAbacRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLegacyAbac(params?: any, options?: MethodOptions): + AxiosPromise; + setLegacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLegacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setLegacyAbac') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLocations + * @desc Sets the locations of a specific cluster. + * @alias container.projects.locations.clusters.setLocations + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set locations. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLocationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLocations(params?: any, options?: MethodOptions): + AxiosPromise; + setLocations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLocations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setLocations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setLogging + * @desc Sets the logging service of a specific cluster. + * @alias container.projects.locations.clusters.setLogging + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set logging. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLoggingServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setLogging(params?: any, options?: MethodOptions): + AxiosPromise; + setLogging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setLogging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setLogging') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMaintenancePolicy + * @desc Sets the maintenance policy for a cluster. + * @alias container.projects.locations.clusters.setMaintenancePolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMaintenancePolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMaintenancePolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setMaintenancePolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMasterAuth + * @desc Used to set master auth materials. Currently supports :- Changing + * the admin password of a specific cluster. This can be either via password + * generation or explicitly set. Modify basic_auth.csv and reset the K8S API + * server. + * @alias container.projects.locations.clusters.setMasterAuth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set auth. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMasterAuthRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMasterAuth(params?: any, options?: MethodOptions): + AxiosPromise; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setMasterAuth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setMonitoring + * @desc Sets the monitoring service of a specific cluster. + * @alias container.projects.locations.clusters.setMonitoring + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to set monitoring. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetMonitoringServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMonitoring(params?: any, options?: MethodOptions): + AxiosPromise; + setMonitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMonitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setMonitoring') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setNetworkPolicy + * @desc Enables/Disables Network Policy for a cluster. + * @alias container.projects.locations.clusters.setNetworkPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetNetworkPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNetworkPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setNetworkPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.setResourceLabels + * @desc Sets labels on a cluster. + * @alias container.projects.locations.clusters.setResourceLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to set labels. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().SetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setResourceLabels(params?: any, options?: MethodOptions): + AxiosPromise; + setResourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setResourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setResourceLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.startIpRotation + * @desc Start master IP rotation. + * @alias container.projects.locations.clusters.startIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().StartIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:startIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.update + * @desc Updates the settings of a specific cluster. + * @alias container.projects.locations.clusters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().UpdateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.updateMaster + * @desc Updates the master of a specific cluster. + * @alias container.projects.locations.clusters.updateMaster + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster) of the cluster to update. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {().UpdateMasterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateMaster(params?: any, options?: MethodOptions): + AxiosPromise; + updateMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:updateMaster') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - getRoot() { - return this.root; + export class Resource$Projects$Locations$Clusters$Nodepools { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.clusters.nodePools.create + * @desc Creates a node pool for a cluster. + * @alias container.projects.locations.clusters.nodePools.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project, location, cluster id) where the node pool will be created. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().CreateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.delete + * @desc Deletes a node pool from a cluster. + * @alias container.projects.locations.clusters.nodePools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string=} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.get + * @desc Retrieves the node pool requested. + * @alias container.projects.locations.clusters.nodePools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string=} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.list + * @desc Lists the node pools for a cluster. + * @alias container.projects.locations.clusters.nodePools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.rollback + * @desc Roll back the previously Aborted or Failed NodePool upgrade. This + * will be an no-op if the last upgrade successfully completed. + * @alias container.projects.locations.clusters.nodePools.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setAutoscaling + * @desc Sets the autoscaling settings of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.setAutoscaling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to set autoscaler settings. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAutoscaling(params?: any, options?: MethodOptions): + AxiosPromise; + setAutoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAutoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setAutoscaling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setManagement + * @desc Sets the NodeManagement options for a node pool. + * @alias container.projects.locations.clusters.nodePools.setManagement + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set management properties. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolManagementRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setManagement(params?: any, options?: MethodOptions): + AxiosPromise; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setManagement') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.setSize + * @desc Sets the size of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.setSize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool id) of the node pool to set size. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().SetNodePoolSizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSize(params?: any, options?: MethodOptions): + AxiosPromise; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:setSize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.clusters.nodePools.update + * @desc Updates the version and/or image type of a specific node pool. + * @alias container.projects.locations.clusters.nodePools.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, cluster, node pool) of the node pool to update. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {().UpdateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * container.projects.zones.operations.cancel - * @desc Cancels the specified operation. - * @alias container.projects.zones.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation resides. This field has been deprecated and replaced by the name field. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'operationId'], - pathParams: ['operationId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Operations { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.locations.operations.cancel + * @desc Cancels the specified operation. + * @alias container.projects.locations.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, operation id) of the operation to cancel. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.operations.get + * @desc Gets the specified operation. + * @alias container.projects.locations.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {string=} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.locations.operations.list + * @desc Lists all operations in a project in a specific zone or all zones. + * @alias container.projects.locations.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string=} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string=} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * container.projects.zones.operations.get - * @desc Gets the specified operation. - * @alias container.projects.zones.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. - * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Zones { + root: Container; + clusters: Resource$Projects$Zones$Clusters; + operations: Resource$Projects$Zones$Operations; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Zones$Clusters(root); + this.operations = new Resource$Projects$Zones$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.getServerconfig + * @desc Returns configuration info about the Kubernetes Engine service. + * @alias container.projects.zones.getServerconfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.name The name (project and location) of the server config to get Specified in the format 'projects/x/locations/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getServerconfig(params?: any, options?: MethodOptions): + AxiosPromise; + getServerconfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getServerconfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/serverconfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Zones$Clusters { + root: Container; + nodePools: Resource$Projects$Zones$Clusters$Nodepools; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + this.nodePools = new Resource$Projects$Zones$Clusters$Nodepools(root); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.clusters.addons + * @desc Sets the addons of a specific cluster. + * @alias container.projects.zones.clusters.addons + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetAddonsConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addons(params?: any, options?: MethodOptions): + AxiosPromise; + addons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addons( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/addons') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.completeIpRotation + * @desc Completes master IP rotation. + * @alias container.projects.zones.clusters.completeIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().CompleteIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + completeIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + completeIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.create + * @desc Creates a cluster, consisting of the specified number and type of + * Google Compute Engine instances. By default, the cluster is created in + * the project's [default + * network](/compute/docs/networks-and-firewalls#networks). One firewall is + * added for the cluster. After cluster creation, the cluster creates routes + * for each node to allow the containers on that node to communicate with + * all other instances in the cluster. Finally, an entry is added to the + * project's global metadata indicating which CIDR range is being used by + * the cluster. + * @alias container.projects.zones.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {().CreateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.delete + * @desc Deletes the cluster, including the Kubernetes endpoint and all + * worker nodes. Firewalls and routes that were configured during cluster + * creation are also deleted. Other Google Compute Engine resources that + * might be in use by the cluster (e.g. load balancer resources) will not be + * deleted if they weren't present at the initial create time. + * @alias container.projects.zones.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster) of the cluster to delete. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.get + * @desc Gets the details of a specific cluster. + * @alias container.projects.zones.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster) of the cluster to retrieve. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.legacyAbac + * @desc Enables or disables the ABAC authorization mechanism on a cluster. + * @alias container.projects.zones.clusters.legacyAbac + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLegacyAbacRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + legacyAbac(params?: any, options?: MethodOptions): + AxiosPromise; + legacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + legacyAbac( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.list + * @desc Lists all clusters owned by a project in either the specified zone + * or all zones. + * @alias container.projects.zones.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The parent (project and location) where the clusters will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.locations + * @desc Sets the locations of a specific cluster. + * @alias container.projects.zones.clusters.locations + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLocationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + locations(params?: any, options?: MethodOptions): + AxiosPromise; + locations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + locations( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.logging + * @desc Sets the logging service of a specific cluster. + * @alias container.projects.zones.clusters.logging + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLoggingServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + logging(params?: any, options?: MethodOptions): + AxiosPromise; + logging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + logging( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/logging') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.master + * @desc Updates the master of a specific cluster. + * @alias container.projects.zones.clusters.master + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateMasterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + master(params?: any, options?: MethodOptions): + AxiosPromise; + master( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + master( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/master') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.monitoring + * @desc Sets the monitoring service of a specific cluster. + * @alias container.projects.zones.clusters.monitoring + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetMonitoringServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + monitoring(params?: any, options?: MethodOptions): + AxiosPromise; + monitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + monitoring( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/monitoring') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.resourceLabels + * @desc Sets labels on a cluster. + * @alias container.projects.zones.clusters.resourceLabels + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetLabelsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resourceLabels(params?: any, options?: MethodOptions): + AxiosPromise; + resourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resourceLabels( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setMaintenancePolicy + * @desc Sets the maintenance policy for a cluster. + * @alias container.projects.zones.clusters.setMaintenancePolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId The name of the cluster to update. + * @param {string} params.projectId The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). + * @param {string} params.zone The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + * @param {().SetMaintenancePolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMaintenancePolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMaintenancePolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMaintenancePolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setMasterAuth + * @desc Used to set master auth materials. Currently supports :- Changing + * the admin password of a specific cluster. This can be either via password + * generation or explicitly set. Modify basic_auth.csv and reset the K8S API + * server. + * @alias container.projects.zones.clusters.setMasterAuth + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetMasterAuthRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setMasterAuth(params?: any, options?: MethodOptions): + AxiosPromise; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setMasterAuth( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.setNetworkPolicy + * @desc Enables/Disables Network Policy for a cluster. + * @alias container.projects.zones.clusters.setNetworkPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNetworkPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setNetworkPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setNetworkPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setNetworkPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.startIpRotation + * @desc Start master IP rotation. + * @alias container.projects.zones.clusters.startIpRotation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().StartIPRotationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startIpRotation(params?: any, options?: MethodOptions): + AxiosPromise; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startIpRotation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:startIpRotation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.update + * @desc Updates the settings of a specific cluster. + * @alias container.projects.zones.clusters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone', 'operationId'], - pathParams: ['operationId', 'projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Zones$Clusters$Nodepools { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.clusters.nodePools.autoscaling + * @desc Sets the autoscaling settings of a specific node pool. + * @alias container.projects.zones.clusters.nodePools.autoscaling + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolAutoscalingRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + autoscaling(params?: any, options?: MethodOptions): + AxiosPromise; + autoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + autoscaling( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/autoscaling') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.create + * @desc Creates a node pool for a cluster. + * @alias container.projects.zones.clusters.nodePools.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {().CreateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.delete + * @desc Deletes a node pool from a cluster. + * @alias container.projects.zones.clusters.nodePools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.get + * @desc Retrieves the node pool requested. + * @alias container.projects.zones.clusters.nodePools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + * @param {string=} params.name The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format 'projects/x/locations/x/clusters/x/nodePools/x'. + * @param {string} params.nodePoolId Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.list + * @desc Lists the node pools for a cluster. + * @alias container.projects.zones.clusters.nodePools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + * @param {string=} params.parent The parent (project, location, cluster id) where the node pools will be listed. Specified in the format 'projects/x/locations/x/clusters/x'. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId'], + pathParams: ['clusterId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.rollback + * @desc Roll back the previously Aborted or Failed NodePool upgrade. This + * will be an no-op if the last upgrade successfully completed. + * @alias container.projects.zones.clusters.nodePools.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().RollbackNodePoolUpgradeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.setManagement + * @desc Sets the NodeManagement options for a node pool. + * @alias container.projects.zones.clusters.nodePools.setManagement + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolManagementRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setManagement(params?: any, options?: MethodOptions): + AxiosPromise; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setManagement( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.setSize + * @desc Sets the size of a specific node pool. + * @alias container.projects.zones.clusters.nodePools.setSize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().SetNodePoolSizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setSize(params?: any, options?: MethodOptions): + AxiosPromise; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setSize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setSize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.clusters.nodePools.update + * @desc Updates the version and/or image type of a specific node pool. + * @alias container.projects.zones.clusters.nodePools.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.nodePoolId Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {().UpdateNodePoolRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/update') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'clusterId', 'nodePoolId'], + pathParams: ['clusterId', 'nodePoolId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * container.projects.zones.operations.list - * @desc Lists all operations in a project in a specific zone or all zones. - * @alias container.projects.zones.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. - * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. - * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta1/projects/{projectId}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'zone'], - pathParams: ['projectId', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Zones$Operations { + root: Container; + constructor(root: Container) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * container.projects.zones.operations.cancel + * @desc Cancels the specified operation. + * @alias container.projects.zones.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation resides. This field has been deprecated and replaced by the name field. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'operationId'], + pathParams: ['operationId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.operations.get + * @desc Gets the specified operation. + * @alias container.projects.zones.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.name The name (project, location, operation id) of the operation to get. Specified in the format 'projects/x/locations/x/operations/x'. + * @param {string} params.operationId Deprecated. The server-assigned `name` of the operation. This field has been deprecated and replaced by the name field. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the name field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. This field has been deprecated and replaced by the name field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/operations/{operationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone', 'operationId'], + pathParams: ['operationId', 'projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * container.projects.zones.operations.list + * @desc Lists all operations in a project in a specific zone or all zones. + * @alias container.projects.zones.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The parent (project and location) where the operations will be listed. Specified in the format 'projects/x/locations/x'. Location "-" matches all zones and all regions. + * @param {string} params.projectId Deprecated. The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). This field has been deprecated and replaced by the parent field. + * @param {string} params.zone Deprecated. The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. This field has been deprecated and replaced by the parent field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://container.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta1/projects/{projectId}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'zone'], + pathParams: ['projectId', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/content/v2.ts b/src/apis/content/v2.ts index 23113bec836..e496ece826b 100644 --- a/src/apis/content/v2.ts +++ b/src/apis/content/v2.ts @@ -27,9674 +27,9739 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Content API for Shopping - * - * Manages product items, inventory, and Merchant Center accounts for Google - * Shopping. - * - * @example - * const google = require('googleapis'); - * const content = google.content('v2'); - * - * @namespace content - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Content - */ -export class Content { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - accountstatuses: Resource$Accountstatuses; - accounttax: Resource$Accounttax; - datafeeds: Resource$Datafeeds; - datafeedstatuses: Resource$Datafeedstatuses; - inventory: Resource$Inventory; - liasettings: Resource$Liasettings; - orders: Resource$Orders; - pos: Resource$Pos; - products: Resource$Products; - productstatuses: Resource$Productstatuses; - shippingsettings: Resource$Shippingsettings; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.accountstatuses = new Resource$Accountstatuses(this); - this.accounttax = new Resource$Accounttax(this); - this.datafeeds = new Resource$Datafeeds(this); - this.datafeedstatuses = new Resource$Datafeedstatuses(this); - this.inventory = new Resource$Inventory(this); - this.liasettings = new Resource$Liasettings(this); - this.orders = new Resource$Orders(this); - this.pos = new Resource$Pos(this); - this.products = new Resource$Products(this); - this.productstatuses = new Resource$Productstatuses(this); - this.shippingsettings = new Resource$Shippingsettings(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Account data. - */ -export interface Schema$Account { - /** - * Indicates whether the merchant sells adult content. - */ - adultContent: boolean; - /** - * List of linked AdWords accounts that are active or pending approval. To - * create a new link request, add a new link with status active to the list. - * It will remain in a pending state until approved or rejected either in the - * AdWords interface or through the AdWords API. To delete an active link, or - * to cancel a link request, remove it from the list. - */ - adwordsLinks: Schema$AccountAdwordsLink[]; - /** - * The GMB account which is linked or in the process of being linked with the - * Merchant Center accounnt. - */ - googleMyBusinessLink: Schema$AccountGoogleMyBusinessLink; - /** - * Merchant Center account ID. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#account". - */ - kind: string; - /** - * Display name for the account. - */ - name: string; - /** - * [DEPRECATED] This field is never returned and will be ignored if provided. - */ - reviewsUrl: string; - /** - * Client-specific, locally-unique, internal ID for the child account. - */ - sellerId: string; - /** - * Users with access to the account. Every account (except for subaccounts) - * must have at least one admin user. - */ - users: Schema$AccountUser[]; - /** - * The merchant's website. - */ - websiteUrl: string; - /** - * List of linked YouTube channels that are active or pending approval. To - * create a new link request, add a new link with status active to the list. - * It will remain in a pending state until approved or rejected in the YT - * Creator Studio interface. To delete an active link, or to cancel a link - * request, remove it from the list. - */ - youtubeChannelLinks: Schema$AccountYouTubeChannelLink[]; -} -export interface Schema$AccountAdwordsLink { - /** - * Customer ID of the AdWords account. - */ - adwordsId: string; - /** - * Status of the link between this Merchant Center account and the AdWords - * account. Upon retrieval, it represents the actual status of the link and - * can be either active if it was approved in Google AdWords or pending if - * it's pending approval. Upon insertion, it represents the intended - * status of the link. Re-uploading a link with status active when it's - * still pending or with status pending when it's already active will have - * no effect: the status will remain unchanged. Re-uploading a link with - * deprecated status inactive is equivalent to not submitting the link at all - * and will delete the link if it was active or cancel the link request if it - * was pending. - */ - status: string; -} -export interface Schema$AccountGoogleMyBusinessLink { - /** - * The GMB email address of which a specific account within a GMB account. A - * sample account within a GMB account could be a business account with set of - * locations, managed under the GMB account. - */ - gmbEmail: string; - /** - * Status of the link between this Merchant Center account and the GMB - * account. - */ - status: string; -} -export interface Schema$AccountIdentifier { - /** - * The aggregator ID, set for aggregators and subaccounts (in that case, it - * represents the aggregator of the subaccount). - */ - aggregatorId: string; - /** - * The merchant account ID, set for individual accounts and subaccounts. - */ - merchantId: string; -} -export interface Schema$AccountsAuthInfoResponse { - /** - * The account identifiers corresponding to the authenticated user. - For an - * individual account: only the merchant ID is defined - For an aggregator: - * only the aggregator ID is defined - For a subaccount of an MCA: both the - * merchant ID and the aggregator ID are defined. - */ - accountIdentifiers: Schema$AccountIdentifier[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountsAuthInfoResponse". - */ - kind: string; -} -export interface Schema$AccountsClaimWebsiteResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountsClaimWebsiteResponse". - */ - kind: string; -} -export interface Schema$AccountsCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$AccountsCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch accounts request. - */ -export interface Schema$AccountsCustomBatchRequestEntry { - /** - * The account to create or update. Only defined if the method is insert or - * update. - */ - account: Schema$Account; - /** - * The ID of the targeted account. Only defined if the method is get, delete - * or claimwebsite. - */ - accountId: string; - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * Whether the account should be deleted if the account has offers. Only - * applicable if the method is delete. - */ - force: boolean; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; - /** - * Only applicable if the method is claimwebsite. Indicates whether or not to - * take the claim from another account in case there is a conflict. - */ - overwrite: boolean; -} -export interface Schema$AccountsCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$AccountsCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountsCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch accounts response. - */ -export interface Schema$AccountsCustomBatchResponseEntry { - /** - * The retrieved, created, or updated account. Not defined if the method was - * delete or claimwebsite. - */ - account: Schema$Account; - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountsCustomBatchResponseEntry". - */ - kind: string; -} -export interface Schema$AccountsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountsListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of accounts. - */ - nextPageToken: string; - resources: Schema$Account[]; -} -/** - * The status of an account, i.e., information about its products, which is - * computed offline and not returned immediately at insertion time. - */ -export interface Schema$AccountStatus { - /** - * The ID of the account for which the status is reported. - */ - accountId: string; - /** - * A list of account level issues. - */ - accountLevelIssues: Schema$AccountStatusAccountLevelIssue[]; - /** - * A list of data quality issues. - */ - dataQualityIssues: Schema$AccountStatusDataQualityIssue[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountStatus". - */ - kind: string; - /** - * Whether the account's website is claimed or not. - */ - websiteClaimed: boolean; -} -export interface Schema$AccountStatusAccountLevelIssue { - /** - * Country for which this issue is reported. - */ - country: string; - /** - * The destination the issue applies to. - */ - destination: string; - /** - * Additional details about the issue. - */ - detail: string; - /** - * Issue identifier. - */ - id: string; - /** - * Severity of the issue. - */ - severity: string; - /** - * Short description of the issue. - */ - title: string; -} -export interface Schema$AccountStatusDataQualityIssue { - /** - * Country for which this issue is reported. - */ - country: string; - /** - * The destination the issue applies to. - */ - destination: string; - /** - * A more detailed description of the issue. - */ - detail: string; - /** - * Actual value displayed on the landing page. - */ - displayedValue: string; - /** - * Example items featuring the issue. - */ - exampleItems: Schema$AccountStatusExampleItem[]; - /** - * Issue identifier. - */ - id: string; - /** - * Last time the account was checked for this issue. - */ - lastChecked: string; - /** - * The attribute name that is relevant for the issue. - */ - location: string; - /** - * Number of items in the account found to have the said issue. - */ - numItems: number; - /** - * Severity of the problem. - */ - severity: string; - /** - * Submitted value that causes the issue. - */ - submittedValue: string; -} -export interface Schema$AccountstatusesCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$AccountstatusesCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch accountstatuses request. - */ -export interface Schema$AccountstatusesCustomBatchRequestEntry { - /** - * The ID of the (sub-)account whose status to get. - */ - accountId: string; - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * If set, only issues for the specified destinations are returned, otherwise - * only issues for the Shopping destination. - */ - destinations: string[]; - /** - * The ID of the managing account. - */ - merchantId: string; - /** - * The method (get). - */ - method: string; -} -export interface Schema$AccountstatusesCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$AccountstatusesCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountstatusesCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch accountstatuses response. - */ -export interface Schema$AccountstatusesCustomBatchResponseEntry { - /** - * The requested account status. Defined if and only if the request was - * successful. - */ - accountStatus: Schema$AccountStatus; - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; -} -export interface Schema$AccountstatusesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountstatusesListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of account statuses. - */ - nextPageToken: string; - resources: Schema$AccountStatus[]; -} -/** - * An example of an item that has poor data quality. An item value on the - * landing page differs from what is submitted, or conflicts with a policy. - */ -export interface Schema$AccountStatusExampleItem { - /** - * Unique item ID as specified in the uploaded product data. - */ - itemId: string; - /** - * Landing page of the item. - */ - link: string; - /** - * The item value that was submitted. - */ - submittedValue: string; - /** - * Title of the item. - */ - title: string; - /** - * The actual value on the landing page. - */ - valueOnLandingPage: string; -} -/** - * The tax settings of a merchant account. - */ -export interface Schema$AccountTax { - /** - * The ID of the account to which these account tax settings belong. - */ - accountId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accountTax". - */ - kind: string; - /** - * Tax rules. Updating the tax rules will enable US taxes (not reversible). - * Defining no rules is equivalent to not charging tax at all. - */ - rules: Schema$AccountTaxTaxRule[]; -} -export interface Schema$AccounttaxCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$AccounttaxCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch accounttax request. - */ -export interface Schema$AccounttaxCustomBatchRequestEntry { - /** - * The ID of the account for which to get/update account tax settings. - */ - accountId: string; - /** - * The account tax settings to update. Only defined if the method is update. - */ - accountTax: Schema$AccountTax; - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; -} -export interface Schema$AccounttaxCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$AccounttaxCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accounttaxCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch accounttax response. - */ -export interface Schema$AccounttaxCustomBatchResponseEntry { - /** - * The retrieved or updated account tax settings. - */ - accountTax: Schema$AccountTax; - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accounttaxCustomBatchResponseEntry". - */ - kind: string; -} -export interface Schema$AccounttaxListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#accounttaxListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of account tax settings. - */ - nextPageToken: string; - resources: Schema$AccountTax[]; -} -/** - * Tax calculation rule to apply in a state or province (USA only). - */ -export interface Schema$AccountTaxTaxRule { - /** - * Country code in which tax is applicable. - */ - country: string; - /** - * State (or province) is which the tax is applicable, described by its - * location id (also called criteria id). - */ - locationId: string; - /** - * Explicit tax rate in percent, represented as a floating point number - * without the percentage character. Must not be negative. - */ - ratePercent: string; - /** - * If true, shipping charges are also taxed. - */ - shippingTaxed: boolean; - /** - * Whether the tax rate is taken from a global tax table or specified - * explicitly. - */ - useGlobalRate: boolean; -} -export interface Schema$AccountUser { - /** - * Whether user is an admin. - */ - admin: boolean; - /** - * User's email address. - */ - emailAddress: string; -} -export interface Schema$AccountYouTubeChannelLink { - /** - * Channel ID. - */ - channelId: string; - /** - * Status of the link between this Merchant Center account and the YouTube - * channel. Upon retrieval, it represents the actual status of the link and - * can be either active if it was approved in YT Creator Studio or pending if - * it's pending approval. Upon insertion, it represents the intended - * status of the link. Re-uploading a link with status active when it's - * still pending or with status pending when it's already active will have - * no effect: the status will remain unchanged. Re-uploading a link with - * deprecated status inactive is equivalent to not submitting the link at all - * and will delete the link if it was active or cancel the link request if it - * was pending. - */ - status: string; -} -export interface Schema$CarrierRate { - /** - * Carrier service, such as "UPS" or "Fedex". The list of - * supported carriers can be retrieved via the getSupportedCarriers method. - * Required. - */ - carrierName: string; - /** - * Carrier service, such as "ground" or "2 days". The list - * of supported services for a carrier can be retrieved via the - * getSupportedCarriers method. Required. - */ - carrierService: string; - /** - * Additive shipping rate modifier. Can be negative. For example { - * "value": "1", "currency" : "USD" } - * adds $1 to the rate, { "value": "-3", - * "currency" : "USD" } removes $3 from the rate. - * Optional. - */ - flatAdjustment: Schema$Price; - /** - * Name of the carrier rate. Must be unique per rate group. Required. - */ - name: string; - /** - * Shipping origin for this carrier rate. Required. - */ - originPostalCode: string; - /** - * Multiplicative shipping rate modifier as a number in decimal notation. Can - * be negative. For example "5.4" increases the rate by 5.4%, - * "-3" decreases the rate by 3%. Optional. - */ - percentageAdjustment: string; -} -export interface Schema$CarriersCarrier { - /** - * The CLDR country code of the carrier (e.g., "US"). Always - * present. - */ - country: string; - /** - * The name of the carrier (e.g., "UPS"). Always present. - */ - name: string; - /** - * A list of supported services (e.g., "ground") for that carrier. - * Contains at least one service. - */ - services: string[]; -} -/** - * Datafeed configuration data. - */ -export interface Schema$Datafeed { - /** - * The two-letter ISO 639-1 language in which the attributes are defined in - * the data feed. - */ - attributeLanguage: string; - /** - * [DEPRECATED] Please use targets[].language instead. The two-letter ISO - * 639-1 language of the items in the feed. Must be a valid language for - * targetCountry. - */ - contentLanguage: string; - /** - * The type of data feed. For product inventory feeds, only feeds for local - * stores, not online stores, are supported. - */ - contentType: string; - /** - * Fetch schedule for the feed file. - */ - fetchSchedule: Schema$DatafeedFetchSchedule; - /** - * The filename of the feed. All feeds must have a unique file name. - */ - fileName: string; - /** - * Format of the feed file. - */ - format: Schema$DatafeedFormat; - /** - * The ID of the data feed. - */ - id: string; - /** - * [DEPRECATED] Please use targets[].includedDestinations instead. The list of - * intended destinations (corresponds to checked check boxes in Merchant - * Center). - */ - intendedDestinations: string[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeed". - */ - kind: string; - /** - * A descriptive name of the data feed. - */ - name: string; - /** - * [DEPRECATED] Please use targets[].country instead. The country where the - * items in the feed will be included in the search index, represented as a - * CLDR territory code. - */ - targetCountry: string; - /** - * The targets this feed should apply to (country, language, destinations). - */ - targets: Schema$DatafeedTarget[]; -} -/** - * The required fields vary based on the frequency of fetching. For a monthly - * fetch schedule, day_of_month and hour are required. For a weekly fetch - * schedule, weekday and hour are required. For a daily fetch schedule, only - * hour is required. - */ -export interface Schema$DatafeedFetchSchedule { - /** - * The day of the month the feed file should be fetched (1-31). - */ - dayOfMonth: number; - /** - * The URL where the feed file can be fetched. Google Merchant Center will - * support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP - * protocols, so the value will need to be a valid link using one of those - * four protocols. - */ - fetchUrl: string; - /** - * The hour of the day the feed file should be fetched (0-23). - */ - hour: number; - /** - * The minute of the hour the feed file should be fetched (0-59). Read-only. - */ - minuteOfHour: number; - /** - * An optional password for fetch_url. - */ - password: string; - /** - * Whether the scheduled fetch is paused or not. - */ - paused: boolean; - /** - * Time zone used for schedule. UTC by default. E.g., - * "America/Los_Angeles". - */ - timeZone: string; - /** - * An optional user name for fetch_url. - */ - username: string; - /** - * The day of the week the feed file should be fetched. - */ - weekday: string; -} -export interface Schema$DatafeedFormat { - /** - * Delimiter for the separation of values in a delimiter-separated values - * feed. If not specified, the delimiter will be auto-detected. Ignored for - * non-DSV data feeds. - */ - columnDelimiter: string; - /** - * Character encoding scheme of the data feed. If not specified, the encoding - * will be auto-detected. - */ - fileEncoding: string; - /** - * Specifies how double quotes are interpreted. If not specified, the mode - * will be auto-detected. Ignored for non-DSV data feeds. - */ - quotingMode: string; -} -export interface Schema$DatafeedsCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$DatafeedsCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch datafeeds request. - */ -export interface Schema$DatafeedsCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The data feed to insert. - */ - datafeed: Schema$Datafeed; - /** - * The ID of the data feed to get, delete or fetch. - */ - datafeedId: string; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; -} -export interface Schema$DatafeedsCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$DatafeedsCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedsCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch datafeeds response. - */ -export interface Schema$DatafeedsCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * The requested data feed. Defined if and only if the request was successful. - */ - datafeed: Schema$Datafeed; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; -} -export interface Schema$DatafeedsFetchNowResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedsFetchNowResponse". - */ - kind: string; -} -export interface Schema$DatafeedsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedsListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of datafeeds. - */ - nextPageToken: string; - resources: Schema$Datafeed[]; -} -/** - * The status of a datafeed, i.e., the result of the last retrieval of the - * datafeed computed asynchronously when the feed processing is finished. - */ -export interface Schema$DatafeedStatus { - /** - * The country for which the status is reported, represented as a CLDR - * territory code. - */ - country: string; - /** - * The ID of the feed for which the status is reported. - */ - datafeedId: string; - /** - * The list of errors occurring in the feed. - */ - errors: Schema$DatafeedStatusError[]; - /** - * The number of items in the feed that were processed. - */ - itemsTotal: string; - /** - * The number of items in the feed that were valid. - */ - itemsValid: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedStatus". - */ - kind: string; - /** - * The two-letter ISO 639-1 language for which the status is reported. - */ - language: string; - /** - * The last date at which the feed was uploaded. - */ - lastUploadDate: string; - /** - * The processing status of the feed. - */ - processingStatus: string; - /** - * The list of errors occurring in the feed. - */ - warnings: Schema$DatafeedStatusError[]; -} -/** - * An error occurring in the feed, like "invalid price". - */ -export interface Schema$DatafeedStatusError { - /** - * The code of the error, e.g., "validation/invalid_value". - */ - code: string; - /** - * The number of occurrences of the error in the feed. - */ - count: string; - /** - * A list of example occurrences of the error, grouped by product. - */ - examples: Schema$DatafeedStatusExample[]; - /** - * The error message, e.g., "Invalid price". - */ - message: string; -} -export interface Schema$DatafeedstatusesCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$DatafeedstatusesCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch datafeedstatuses request. - */ -export interface Schema$DatafeedstatusesCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The country for which to get the datafeed status. If this parameter is - * provided then language must also be provided. Note that for multi-target - * datafeeds this parameter is required. - */ - country: string; - /** - * The ID of the data feed to get. - */ - datafeedId: string; - /** - * The language for which to get the datafeed status. If this parameter is - * provided then country must also be provided. Note that for multi-target - * datafeeds this parameter is required. - */ - language: string; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; -} -export interface Schema$DatafeedstatusesCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$DatafeedstatusesCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedstatusesCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch datafeedstatuses response. - */ -export interface Schema$DatafeedstatusesCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * The requested data feed status. Defined if and only if the request was - * successful. - */ - datafeedStatus: Schema$DatafeedStatus; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; -} -export interface Schema$DatafeedstatusesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#datafeedstatusesListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of datafeed statuses. - */ - nextPageToken: string; - resources: Schema$DatafeedStatus[]; -} -/** - * An example occurrence for a particular error. - */ -export interface Schema$DatafeedStatusExample { - /** - * The ID of the example item. - */ - itemId: string; - /** - * Line number in the data feed where the example is found. - */ - lineNumber: string; - /** - * The problematic value. - */ - value: string; -} -export interface Schema$DatafeedTarget { - /** - * The country where the items in the feed will be included in the search - * index, represented as a CLDR territory code. - */ - country: string; - /** - * The list of destinations to exclude for this target (corresponds to - * unchecked check boxes in Merchant Center). - */ - excludedDestinations: string[]; - /** - * The list of destinations to include for this target (corresponds to checked - * check boxes in Merchant Center). Default destinations are always included - * unless provided in the excluded_destination field. - */ - includedDestinations: string[]; - /** - * The two-letter ISO 639-1 language of the items in the feed. Must be a valid - * language for targets[].country. - */ - language: string; -} -export interface Schema$DeliveryTime { - /** - * Holiday cutoff definitions. If configured, they specify order cutoff times - * for holiday-specific shipping. - */ - holidayCutoffs: Schema$HolidayCutoff[]; - /** - * Maximum number of business days that is spent in transit. 0 means same day - * delivery, 1 means next day delivery. Must be greater than or equal to - * minTransitTimeInDays. Required. - */ - maxTransitTimeInDays: number; - /** - * Minimum number of business days that is spent in transit. 0 means same day - * delivery, 1 means next day delivery. Required. - */ - minTransitTimeInDays: number; -} -/** - * An error returned by the API. - */ -export interface Schema$Error { - /** - * The domain of the error. - */ - domain: string; - /** - * A description of the error. - */ - message: string; - /** - * The error code. - */ - reason: string; -} -/** - * A list of errors returned by a failed batch entry. - */ -export interface Schema$Errors { - /** - * The HTTP status of the first error in errors. - */ - code: number; - /** - * A list of errors. - */ - errors: Schema$Error[]; - /** - * The message of the first error in errors. - */ - message: string; -} -export interface Schema$GmbAccounts { - /** - * The ID of the account. - */ - accountId: string; - /** - * A list of GMB accounts which are available to the merchant. - */ - gmbAccounts: Schema$GmbAccountsGmbAccount[]; -} -export interface Schema$GmbAccountsGmbAccount { - /** - * The email which identifies the GMB account. - */ - email: string; - /** - * Number of listings under this account. - */ - listingCount: string; - /** - * The name of the GMB account. - */ - name: string; - /** - * The type of the GMB account (User or Business). - */ - type: string; -} -/** - * A non-empty list of row or column headers for a table. Exactly one of prices, - * weights, numItems, postalCodeGroupNames, or locations must be set. - */ -export interface Schema$Headers { - /** - * A list of location ID sets. Must be non-empty. Can only be set if all other - * fields are not set. - */ - locations: Schema$LocationIdSet[]; - /** - * A list of inclusive number of items upper bounds. The last value can be - * "infinity". For example ["10", "50", - * "infinity"] represents the headers "<= 10 items", - * " 50 items". Must be non-empty. Can only be set if all other - * fields are not set. - */ - numberOfItems: string[]; - /** - * A list of postal group names. The last value can be "all other - * locations". Example: ["zone 1", "zone 2", - * "all other locations"]. The referred postal code groups must - * match the delivery country of the service. Must be non-empty. Can only be - * set if all other fields are not set. - */ - postalCodeGroupNames: string[]; - /** - * A list of inclusive order price upper bounds. The last price's value - * can be "infinity". For example [{"value": - * "10", "currency": "USD"}, {"value": - * "500", "currency": "USD"}, - * {"value": "infinity", "currency": - * "USD"}] represents the headers "<= $10", " - * $500". All prices within a service must have the same currency. Must - * be non-empty. Can only be set if all other fields are not set. - */ - prices: Schema$Price[]; - /** - * A list of inclusive order weight upper bounds. The last weight's value - * can be "infinity". For example [{"value": - * "10", "unit": "kg"}, {"value": - * "50", "unit": "kg"}, {"value": - * "infinity", "unit": "kg"}] represents the - * headers "<= 10kg", " 50kg". All weights within a - * service must have the same unit. Must be non-empty. Can only be set if all - * other fields are not set. - */ - weights: Schema$Weight[]; -} -export interface Schema$HolidayCutoff { - /** - * Date of the order deadline, in ISO 8601 format. E.g. "2016-11-29" - * for 29th November 2016. Required. - */ - deadlineDate: string; - /** - * Hour of the day on the deadline date until which the order has to be placed - * to qualify for the delivery guarantee. Possible values are: 0 (midnight), - * 1, ..., 12 (noon), 13, ..., 23. Required. - */ - deadlineHour: number; - /** - * Timezone identifier for the deadline hour. A list of identifiers can be - * found in the AdWords API documentation. E.g. "Europe/Zurich". - * Required. - */ - deadlineTimezone: string; - /** - * Unique identifier for the holiday. Required. - */ - holidayId: string; - /** - * Date on which the deadline will become visible to consumers in ISO 8601 - * format. E.g. "2016-10-31" for 31st October 2016. Required. - */ - visibleFromDate: string; -} -export interface Schema$HolidaysHoliday { - /** - * The CLDR territory code of the country in which the holiday is available. - * E.g. "US", "DE", "GB". A holiday cutoff can - * only be configured in a shipping settings service with matching delivery - * country. Always present. - */ - countryCode: string; - /** - * Date of the holiday, in ISO 8601 format. E.g. "2016-12-25" for - * Christmas 2016. Always present. - */ - date: string; - /** - * Date on which the order has to arrive at the customer's, in ISO 8601 - * format. E.g. "2016-12-24" for 24th December 2016. Always present. - */ - deliveryGuaranteeDate: string; - /** - * Hour of the day in the delivery location's timezone on the guaranteed - * delivery date by which the order has to arrive at the customer's. - * Possible values are: 0 (midnight), 1, ..., 12 (noon), 13, ..., 23. Always - * present. - */ - deliveryGuaranteeHour: string; - /** - * Unique identifier for the holiday to be used when configuring holiday - * cutoffs. Always present. - */ - id: string; - /** - * The holiday type. Always present. - */ - type: string; -} -export interface Schema$Installment { - /** - * The amount the buyer has to pay per month. - */ - amount: Schema$Price; - /** - * The number of installments the buyer has to pay. - */ - months: string; -} -export interface Schema$Inventory { - /** - * The availability of the product. - */ - availability: string; - /** - * Number and amount of installments to pay for an item. Brazil only. - */ - installment: Schema$Installment; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#inventory". - */ - kind: string; - /** - * Loyalty points that users receive after purchasing the item. Japan only. - */ - loyaltyPoints: Schema$LoyaltyPoints; - /** - * Store pickup information. Only supported for local inventory. Not setting - * pickup means "don't update" while setting it to the empty - * value ({} in JSON) means "delete". Otherwise, pickupMethod and - * pickupSla must be set together, unless pickupMethod is "not - * supported". - */ - pickup: Schema$InventoryPickup; - /** - * The price of the product. - */ - price: Schema$Price; - /** - * The quantity of the product. Must be equal to or greater than zero. - * Supported only for local products. - */ - quantity: number; - /** - * The sale price of the product. Mandatory if sale_price_effective_date is - * defined. - */ - salePrice: Schema$Price; - /** - * A date range represented by a pair of ISO 8601 dates separated by a space, - * comma, or slash. Both dates might be specified as 'null' if - * undecided. - */ - salePriceEffectiveDate: string; - /** - * The quantity of the product that is reserved for sell-on-google ads. - * Supported only for online products. - */ - sellOnGoogleQuantity: number; -} -export interface Schema$InventoryCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$InventoryCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch inventory request. - */ -export interface Schema$InventoryCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * Price and availability of the product. - */ - inventory: Schema$Inventory; - /** - * The ID of the managing account. - */ - merchantId: string; - /** - * The ID of the product for which to update price and availability. - */ - productId: string; - /** - * The code of the store for which to update price and availability. Use - * online to update price and availability of an online product. - */ - storeCode: string; -} -export interface Schema$InventoryCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$InventoryCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#inventoryCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch inventory response. - */ -export interface Schema$InventoryCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#inventoryCustomBatchResponseEntry". - */ - kind: string; -} -export interface Schema$InventoryPickup { - /** - * Whether store pickup is available for this offer and whether the pickup - * option should be shown as buy, reserve, or not supported. Only supported - * for local inventory. Unless the value is "not supported", must be - * submitted together with pickupSla. - */ - pickupMethod: string; - /** - * The expected date that an order will be ready for pickup, relative to when - * the order is placed. Only supported for local inventory. Must be submitted - * together with pickupMethod. - */ - pickupSla: string; -} -export interface Schema$InventorySetRequest { - /** - * The availability of the product. - */ - availability: string; - /** - * Number and amount of installments to pay for an item. Brazil only. - */ - installment: Schema$Installment; - /** - * Loyalty points that users receive after purchasing the item. Japan only. - */ - loyaltyPoints: Schema$LoyaltyPoints; - /** - * Store pickup information. Only supported for local inventory. Not setting - * pickup means "don't update" while setting it to the empty - * value ({} in JSON) means "delete". Otherwise, pickupMethod and - * pickupSla must be set together, unless pickupMethod is "not - * supported". - */ - pickup: Schema$InventoryPickup; - /** - * The price of the product. - */ - price: Schema$Price; - /** - * The quantity of the product. Must be equal to or greater than zero. - * Supported only for local products. - */ - quantity: number; - /** - * The sale price of the product. Mandatory if sale_price_effective_date is - * defined. - */ - salePrice: Schema$Price; - /** - * A date range represented by a pair of ISO 8601 dates separated by a space, - * comma, or slash. Both dates might be specified as 'null' if - * undecided. - */ - salePriceEffectiveDate: string; - /** - * The quantity of the product that is reserved for sell-on-google ads. - * Supported only for online products. - */ - sellOnGoogleQuantity: number; -} -export interface Schema$InventorySetResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#inventorySetResponse". - */ - kind: string; -} -export interface Schema$LiaAboutPageSettings { - /** - * The status of the verification process for the About page. - */ - status: string; - /** - * The URL for the About page. - */ - url: string; -} -export interface Schema$LiaCountrySettings { - /** - * The settings for the About page. - */ - about: Schema$LiaAboutPageSettings; - /** - * CLDR country code (e.g. "US"). - */ - country: string; - /** - * The status of the "Merchant hosted local storefront" feature. - */ - hostedLocalStorefrontActive: boolean; - /** - * LIA inventory verification settings. - */ - inventory: Schema$LiaInventorySettings; - /** - * LIA "On Display To Order" settings. - */ - onDisplayToOrder: Schema$LiaOnDisplayToOrderSettings; - /** - * The status of the "Store pickup" feature. - */ - storePickupActive: boolean; -} -export interface Schema$LiaInventorySettings { - /** - * The email of the contact for the inventory verification process. - */ - inventoryVerificationContactEmail: string; - /** - * The name of the contact for the inventory verification process. - */ - inventoryVerificationContactName: string; - /** - * The status of the verification contact. - */ - inventoryVerificationContactStatus: string; - /** - * The status of the inventory verification process. - */ - status: string; -} -export interface Schema$LiaOnDisplayToOrderSettings { - /** - * Shipping cost and policy URL. - */ - shippingCostPolicyUrl: string; - /** - * The status of the ?On display to order? feature. - */ - status: string; -} -export interface Schema$LiaSettings { - /** - * The ID of the account to which these LIA settings belong. Ignored upon - * update, always present in get request responses. - */ - accountId: string; - /** - * The LIA settings for each country. - */ - countrySettings: Schema$LiaCountrySettings[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liaSettings". - */ - kind: string; -} -export interface Schema$LiasettingsCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$LiasettingsCustomBatchRequestEntry[]; -} -export interface Schema$LiasettingsCustomBatchRequestEntry { - /** - * The ID of the account for which to get/update account shipping settings. - */ - accountId: string; - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * Inventory validation contact email. Required only for - * SetInventoryValidationContact. - */ - contactEmail: string; - /** - * Inventory validation contact name. Required only for - * SetInventoryValidationContact. - */ - contactName: string; - /** - * The country code. Required only for RequestInventoryVerification. - */ - country: string; - /** - * The GMB account. Required only for RequestGmbAccess. - */ - gmbEmail: string; - /** - * The account Lia settings to update. Only defined if the method is update. - */ - liaSettings: Schema$LiaSettings; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; -} -export interface Schema$LiasettingsCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$LiasettingsCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsCustomBatchResponse". - */ - kind: string; -} -export interface Schema$LiasettingsCustomBatchResponseEntry { - /** - * The ID of the request entry to which this entry responds. - */ - batchId: number; - /** - * A list of errors defined if, and only if, the request failed. - */ - errors: Schema$Errors; - /** - * The the list of accessible GMB accounts. - */ - gmbAccounts: Schema$GmbAccounts; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsCustomBatchResponseEntry". - */ - kind: string; - /** - * The retrieved or updated Lia settings. - */ - liaSettings: Schema$LiaSettings; -} -export interface Schema$LiasettingsGetAccessibleGmbAccountsResponse { - /** - * The ID of the account. - */ - accountId: string; - /** - * A list of GMB accounts which are available to the merchant. - */ - gmbAccounts: Schema$GmbAccountsGmbAccount[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsGetAccessibleGmbAccountsResponse". - */ - kind: string; -} -export interface Schema$LiasettingsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of LIA settings. - */ - nextPageToken: string; - resources: Schema$LiaSettings[]; -} -export interface Schema$LiasettingsRequestGmbAccessResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsRequestGmbAccessResponse". - */ - kind: string; -} -export interface Schema$LiasettingsRequestInventoryVerificationResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsRequestInventoryVerificationResponse". - */ - kind: string; -} -export interface Schema$LiasettingsSetInventoryVerificationContactResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#liasettingsSetInventoryVerificationContactResponse". - */ - kind: string; -} -export interface Schema$LocationIdSet { - /** - * A non-empty list of location IDs. They must all be of the same location - * type (e.g., state). - */ - locationIds: string[]; -} -export interface Schema$LoyaltyPoints { - /** - * Name of loyalty points program. It is recommended to limit the name to 12 - * full-width characters or 24 Roman characters. - */ - name: string; - /** - * The retailer's loyalty points in absolute value. - */ - pointsValue: string; - /** - * The ratio of a point when converted to currency. Google assumes currency - * based on Merchant Center settings. If ratio is left out, it defaults - * to 1.0. - */ - ratio: number; -} -export interface Schema$Order { - /** - * Whether the order was acknowledged. - */ - acknowledged: boolean; - /** - * The channel type of the order: "purchaseOnGoogle" or - * "googleExpress". - */ - channelType: string; - /** - * The details of the customer who placed the order. - */ - customer: Schema$OrderCustomer; - /** - * The details for the delivery. - */ - deliveryDetails: Schema$OrderDeliveryDetails; - /** - * The REST id of the order. Globally unique. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#order". - */ - kind: string; - /** - * Line items that are ordered. - */ - lineItems: Schema$OrderLineItem[]; - merchantId: string; - /** - * Merchant-provided id of the order. - */ - merchantOrderId: string; - /** - * The net amount for the order. For example, if an order was originally for a - * grand total of $100 and a refund was issued for $20, the net amount will be - * $80. - */ - netAmount: Schema$Price; - /** - * The details of the payment method. - */ - paymentMethod: Schema$OrderPaymentMethod; - /** - * The status of the payment. - */ - paymentStatus: string; - /** - * The date when the order was placed, in ISO 8601 format. - */ - placedDate: string; - /** - * The details of the merchant provided promotions applied to the order. More - * details about the program are here. - */ - promotions: Schema$OrderPromotion[]; - /** - * Refunds for the order. - */ - refunds: Schema$OrderRefund[]; - /** - * Shipments of the order. - */ - shipments: Schema$OrderShipment[]; - /** - * The total cost of shipping for all items. - */ - shippingCost: Schema$Price; - /** - * The tax for the total shipping cost. - */ - shippingCostTax: Schema$Price; - /** - * The requested shipping option. - */ - shippingOption: string; - /** - * The status of the order. - */ - status: string; -} -export interface Schema$OrderAddress { - /** - * CLDR country code (e.g. "US"). - */ - country: string; - /** - * Strings representing the lines of the printed label for mailing the order, - * for example: John Smith 1600 Amphitheatre Parkway Mountain View, CA, 94043 - * United States - */ - fullAddress: string[]; - /** - * Whether the address is a post office box. - */ - isPostOfficeBox: boolean; - /** - * City, town or commune. May also include dependent localities or - * sublocalities (e.g. neighborhoods or suburbs). - */ - locality: string; - /** - * Postal Code or ZIP (e.g. "94043"). - */ - postalCode: string; - /** - * Name of the recipient. - */ - recipientName: string; - /** - * Top-level administrative subdivision of the country (e.g. "CA"). - */ - region: string; - /** - * Street-level part of the address. - */ - streetAddress: string[]; -} -export interface Schema$OrderCancellation { - /** - * The actor that created the cancellation. - */ - actor: string; - /** - * Date on which the cancellation has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * The quantity that was canceled. - */ - quantity: number; - /** - * The reason for the cancellation. Orders that are cancelled with a - * noInventory reason will lead to the removal of the product from POG until - * you make an update to that product. This will not affect your Shopping ads. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrderCustomer { - /** - * Email address that should be used for order related communications. In - * certain cases this might not be a real users email, but a proxy email. - */ - email: string; - /** - * Deprecated. Please use marketingRightsInfo instead. - */ - explicitMarketingPreference: boolean; - /** - * Full name of the customer. - */ - fullName: string; - /** - * Customer's marketing preferences. - */ - marketingRightsInfo: Schema$OrderCustomerMarketingRightsInfo; -} -export interface Schema$OrderCustomerMarketingRightsInfo { - /** - * Last known user selection regarding marketing preferences. In certain cases - * this selection might not be known, so this field would be empty. - */ - explicitMarketingPreference: string; - /** - * Timestamp when last time marketing preference was updated. Could be empty, - * if user wasn't offered a selection yet. - */ - lastUpdatedTimestamp: string; - /** - * Email address that can be used for marketing purposes. This field is only - * filled when explicitMarketingPreference is equal to 'granted'. - */ - marketingEmailAddress: string; -} -export interface Schema$OrderDeliveryDetails { - /** - * The delivery address - */ - address: Schema$OrderAddress; - /** - * The phone number of the person receiving the delivery. - */ - phoneNumber: string; -} -export interface Schema$OrderLineItem { - /** - * Annotations that are attached to the line item. - */ - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * Cancellations of the line item. - */ - cancellations: Schema$OrderCancellation[]; - /** - * The id of the line item. - */ - id: string; - /** - * Total price for the line item. For example, if two items for $10 are - * purchased, the total price will be $20. - */ - price: Schema$Price; - /** - * Product data from the time of the order placement. - */ - product: Schema$OrderLineItemProduct; - /** - * Number of items canceled. - */ - quantityCanceled: number; - /** - * Number of items delivered. - */ - quantityDelivered: number; - /** - * Number of items ordered. - */ - quantityOrdered: number; - /** - * Number of items pending. - */ - quantityPending: number; - /** - * Number of items returned. - */ - quantityReturned: number; - /** - * Number of items shipped. - */ - quantityShipped: number; - /** - * Details of the return policy for the line item. - */ - returnInfo: Schema$OrderLineItemReturnInfo; - /** - * Returns of the line item. - */ - returns: Schema$OrderReturn[]; - /** - * Details of the requested shipping for the line item. - */ - shippingDetails: Schema$OrderLineItemShippingDetails; - /** - * Total tax amount for the line item. For example, if two items are - * purchased, and each have a cost tax of $2, the total tax amount will be $4. - */ - tax: Schema$Price; -} -export interface Schema$OrderLineItemProduct { - /** - * Brand of the item. - */ - brand: string; - /** - * The item's channel (online or local). - */ - channel: string; - /** - * Condition or state of the item. - */ - condition: string; - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number (GTIN) of the item. - */ - gtin: string; - /** - * The REST id of the product. - */ - id: string; - /** - * URL of an image of the item. - */ - imageLink: string; - /** - * Shared identifier for all variants of the same product. - */ - itemGroupId: string; - /** - * Manufacturer Part Number (MPN) of the item. - */ - mpn: string; - /** - * An identifier of the item. - */ - offerId: string; - /** - * Price of the item. - */ - price: Schema$Price; - /** - * URL to the cached image shown to the user when order was placed. - */ - shownImage: string; - /** - * The CLDR territory code of the target country of the product. - */ - targetCountry: string; - /** - * The title of the product. - */ - title: string; - /** - * Variant attributes for the item. These are dimensions of the product, such - * as color, gender, material, pattern, and size. You can find a comprehensive - * list of variant attributes here. - */ - variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; -} -export interface Schema$OrderLineItemProductVariantAttribute { - /** - * The dimension of the variant. - */ - dimension: string; - /** - * The value for the dimension. - */ - value: string; -} -export interface Schema$OrderLineItemReturnInfo { - /** - * How many days later the item can be returned. - */ - daysToReturn: number; - /** - * Whether the item is returnable. - */ - isReturnable: boolean; - /** - * URL of the item return policy. - */ - policyUrl: string; -} -export interface Schema$OrderLineItemShippingDetails { - /** - * The delivery by date, in ISO 8601 format. - */ - deliverByDate: string; - /** - * Details of the shipping method. - */ - method: Schema$OrderLineItemShippingDetailsMethod; - /** - * The ship by date, in ISO 8601 format. - */ - shipByDate: string; -} -export interface Schema$OrderLineItemShippingDetailsMethod { - /** - * The carrier for the shipping. Optional. See shipments[].carrier for a list - * of acceptable values. - */ - carrier: string; - /** - * Maximum transit time. - */ - maxDaysInTransit: number; - /** - * The name of the shipping method. - */ - methodName: string; - /** - * Minimum transit time. - */ - minDaysInTransit: number; -} -export interface Schema$OrderMerchantProvidedAnnotation { - /** - * Key for additional merchant provided (as key-value pairs) annotation about - * the line item. - */ - key: string; - /** - * Value for additional merchant provided (as key-value pairs) annotation - * about the line item. - */ - value: string; -} -export interface Schema$OrderPaymentMethod { - /** - * The billing address. - */ - billingAddress: Schema$OrderAddress; - /** - * The card expiration month (January = 1, February = 2 etc.). - */ - expirationMonth: number; - /** - * The card expiration year (4-digit, e.g. 2015). - */ - expirationYear: number; - /** - * The last four digits of the card number. - */ - lastFourDigits: string; - /** - * The billing phone number. - */ - phoneNumber: string; - /** - * The type of instrument. Acceptable values are: - "AMEX" - - * "DISCOVER" - "JCB" - "MASTERCARD" - - * "UNIONPAY" - "VISA" - "" - */ - type: string; -} -export interface Schema$OrderPromotion { - benefits: Schema$OrderPromotionBenefit[]; - /** - * The date and time frame when the promotion is active and ready for - * validation review. Note that the promotion live time may be delayed for a - * few hours due to the validation review. Start date and end date are - * separated by a forward slash (/). The start date is specified by the format - * (YYYY-MM-DD), followed by the letter ?T?, the time of the day when the sale - * starts (in Greenwich Mean Time, GMT), followed by an expression of the time - * zone for the sale. The end date is in the same format. - */ - effectiveDates: string; - /** - * Optional. The text code that corresponds to the promotion when applied on - * the retailer?s website. - */ - genericRedemptionCode: string; - /** - * The unique ID of the promotion. - */ - id: string; - /** - * The full title of the promotion. - */ - longTitle: string; - /** - * Whether the promotion is applicable to all products or only specific - * products. - */ - productApplicability: string; - /** - * Indicates that the promotion is valid online. - */ - redemptionChannel: string; -} -export interface Schema$OrderPromotionBenefit { - /** - * The discount in the order price when the promotion is applied. - */ - discount: Schema$Price; - /** - * The OfferId(s) that were purchased in this order and map to this specific - * benefit of the promotion. - */ - offerIds: string[]; - /** - * Further describes the benefit of the promotion. Note that we will expand on - * this enumeration as we support new promotion sub-types. - */ - subType: string; - /** - * The impact on tax when the promotion is applied. - */ - taxImpact: Schema$Price; - /** - * Describes whether the promotion applies to products (e.g. 20% off) or to - * shipping (e.g. Free Shipping). - */ - type: string; -} -export interface Schema$OrderRefund { - /** - * The actor that created the refund. - */ - actor: string; - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * Date on which the item has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrderReturn { - /** - * The actor that created the refund. - */ - actor: string; - /** - * Date on which the item has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * Quantity that is returned. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersAcknowledgeRequest { - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; -} -export interface Schema$OrdersAcknowledgeResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersAcknowledgeResponse". - */ - kind: string; -} -export interface Schema$OrdersAdvanceTestOrderResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersAdvanceTestOrderResponse". - */ - kind: string; -} -export interface Schema$OrdersCancelLineItemRequest { - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amount: Schema$Price; - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to cancellation amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to cancel. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to cancel. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to cancel. - */ - quantity: number; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCancelLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCancelLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersCancelRequest { - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCancelResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCancelResponse". - */ - kind: string; -} -export interface Schema$OrdersCreateTestOrderRequest { - /** - * The test order template to use. Specify as an alternative to testOrder as a - * shortcut for retrieving a template and then creating an order using that - * template. - */ - templateName: string; - /** - * The test order to create. - */ - testOrder: Schema$TestOrder; -} -export interface Schema$OrdersCreateTestOrderResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCreateTestOrderResponse". - */ - kind: string; - /** - * The ID of the newly created test order. - */ - orderId: string; -} -export interface Schema$OrdersCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$OrdersCustomBatchRequestEntry[]; -} -export interface Schema$OrdersCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * Required for cancel method. - */ - cancel: Schema$OrdersCustomBatchRequestEntryCancel; - /** - * Required for cancelLineItem method. - */ - cancelLineItem: Schema$OrdersCustomBatchRequestEntryCancelLineItem; - /** - * Required for inStoreReturnLineItem method. - */ - inStoreRefundLineItem: - Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem; - /** - * The ID of the managing account. - */ - merchantId: string; - /** - * The merchant order id. Required for updateMerchantOrderId and - * getByMerchantOrderId methods. - */ - merchantOrderId: string; - /** - * The method to apply. - */ - method: string; - /** - * The ID of the operation. Unique across all operations for a given order. - * Required for all methods beside get and getByMerchantOrderId. - */ - operationId: string; - /** - * The ID of the order. Required for all methods beside getByMerchantOrderId. - */ - orderId: string; - /** - * Required for refund method. - */ - refund: Schema$OrdersCustomBatchRequestEntryRefund; - /** - * Required for rejectReturnLineItem method. - */ - rejectReturnLineItem: - Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem; - /** - * Required for returnLineItem method. - */ - returnLineItem: Schema$OrdersCustomBatchRequestEntryReturnLineItem; - /** - * Required for returnRefundLineItem method. - */ - returnRefundLineItem: - Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem; - /** - * Required for setLineItemMetadata method. - */ - setLineItemMetadata: Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata; - /** - * Required for shipLineItems method. - */ - shipLineItems: Schema$OrdersCustomBatchRequestEntryShipLineItems; - /** - * Required for updateLineItemShippingDate method. - */ - updateLineItemShippingDetails: - Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails; - /** - * Required for updateShipment method. - */ - updateShipment: Schema$OrdersCustomBatchRequestEntryUpdateShipment; -} -export interface Schema$OrdersCustomBatchRequestEntryCancel { - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryCancelLineItem { - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amount: Schema$Price; - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to cancellation amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to cancel. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to cancel. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to cancel. - */ - quantity: number; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem { - /** - * The amount that is refunded. Required. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. Required. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryRefund { - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * The amount that is refunded. Either amount or amountPretax and amountTax - * should be filled. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryReturnLineItem { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem { - /** - * The amount that is refunded. Optional, but if filled then both amountPretax - * and amountTax must be set. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata { - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryShipLineItems { - /** - * Deprecated. Please use shipmentInfo instead. The carrier handling the - * shipment. See shipments[].carrier in the Orders resource representation - * for a list of acceptable values. - */ - carrier: string; - /** - * Line items to ship. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * Deprecated. Please use shipmentInfo instead. The ID of the shipment. - */ - shipmentId: string; - /** - * Shipment information. This field is repeated because a single line item can - * be shipped in several packages (and have several tracking IDs). - */ - shipmentInfos: - Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; - /** - * Deprecated. Please use shipmentInfo instead. The tracking id for the - * shipment. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { - /** - * The carrier handling the shipment. See shipments[].carrier in the Orders - * resource representation for a list of acceptable values. - */ - carrier: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * The tracking id for the shipment. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { - /** - * Updated delivery by date, in ISO 8601 format. If not specified only ship by - * date is updated. - */ - deliverByDate: string; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; - /** - * Updated ship by date, in ISO 8601 format. If not specified only deliver by - * date is updated. - */ - shipByDate: string; -} -export interface Schema$OrdersCustomBatchRequestEntryUpdateShipment { - /** - * The carrier handling the shipment. Not updated if missing. See - * shipments[].carrier in the Orders resource representation for a list of - * acceptable values. - */ - carrier: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * New status for the shipment. Not updated if missing. - */ - status: string; - /** - * The tracking id for the shipment. Not updated if missing. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$OrdersCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCustomBatchResponse". - */ - kind: string; -} -export interface Schema$OrdersCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * The status of the execution. Only defined if the method is not get or - * getByMerchantOrderId and if the request was successful. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCustomBatchResponseEntry". - */ - kind: string; - /** - * The retrieved order. Only defined if the method is get and if the request - * was successful. - */ - order: Schema$Order; -} -export interface Schema$OrdersGetByMerchantOrderIdResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersGetByMerchantOrderIdResponse". - */ - kind: string; - /** - * The requested order. - */ - order: Schema$Order; -} -export interface Schema$OrdersGetTestOrderTemplateResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersGetTestOrderTemplateResponse". - */ - kind: string; - /** - * The requested test order template. - */ - template: Schema$TestOrder; -} -export interface Schema$OrderShipment { - /** - * The carrier handling the shipment. Acceptable values are: - - * "gsx" - "ups" - "usps" - "fedex" - * - "dhl" - "ecourier" - "cxt" - - * "google" - "ontrac" - "emsy" - - * "ont" - "deliv" - "dynamex" - - * "lasership" - "mpx" - "uds" - */ - carrier: string; - /** - * Date on which the shipment has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * Date on which the shipment has been delivered, in ISO 8601 format. Present - * only if status is delievered - */ - deliveryDate: string; - /** - * The id of the shipment. - */ - id: string; - /** - * The line items that are shipped. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * The status of the shipment. - */ - status: string; - /** - * The tracking id for the shipment. - */ - trackingId: string; -} -export interface Schema$OrderShipmentLineItemShipment { - /** - * The id of the line item that is shipped. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to ship. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity that is shipped. - */ - quantity: number; -} -export interface Schema$OrdersInStoreRefundLineItemRequest { - /** - * The amount that is refunded. Required. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. Required. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersInStoreRefundLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersInStoreRefundLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of orders. - */ - nextPageToken: string; - resources: Schema$Order[]; -} -export interface Schema$OrdersRefundRequest { - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * The amount that is refunded. Either amount or amountPretax and amountTax - * should be filled. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersRefundResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersRefundResponse". - */ - kind: string; -} -export interface Schema$OrdersRejectReturnLineItemRequest { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersRejectReturnLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersRejectReturnLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersReturnLineItemRequest { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersReturnLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersReturnLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersReturnRefundLineItemRequest { - /** - * The amount that is refunded. Optional, but if filled then both amountPretax - * and amountTax must be set. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersReturnRefundLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersReturnRefundLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersSetLineItemMetadataRequest { - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; -} -export interface Schema$OrdersSetLineItemMetadataResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersSetLineItemMetadataResponse". - */ - kind: string; -} -export interface Schema$OrdersShipLineItemsRequest { - /** - * Deprecated. Please use shipmentInfo instead. The carrier handling the - * shipment. See shipments[].carrier in the Orders resource representation - * for a list of acceptable values. - */ - carrier: string; - /** - * Line items to ship. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * Deprecated. Please use shipmentInfo instead. The ID of the shipment. - */ - shipmentId: string; - /** - * Shipment information. This field is repeated because a single line item can - * be shipped in several packages (and have several tracking IDs). - */ - shipmentInfos: - Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; - /** - * Deprecated. Please use shipmentInfo instead. The tracking id for the - * shipment. - */ - trackingId: string; -} -export interface Schema$OrdersShipLineItemsResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersShipLineItemsResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateLineItemShippingDetailsRequest { - /** - * Updated delivery by date, in ISO 8601 format. If not specified only ship by - * date is updated. - */ - deliverByDate: string; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; - /** - * Updated ship by date, in ISO 8601 format. If not specified only deliver by - * date is updated. - */ - shipByDate: string; -} -export interface Schema$OrdersUpdateLineItemShippingDetailsResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateLineItemShippingDetailsResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateMerchantOrderIdRequest { - /** - * The merchant order id to be assigned to the order. Must be unique per - * merchant. - */ - merchantOrderId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; -} -export interface Schema$OrdersUpdateMerchantOrderIdResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateMerchantOrderIdResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateShipmentRequest { - /** - * The carrier handling the shipment. Not updated if missing. See - * shipments[].carrier in the Orders resource representation for a list of - * acceptable values. - */ - carrier: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * New status for the shipment. Not updated if missing. - */ - status: string; - /** - * The tracking id for the shipment. Not updated if missing. - */ - trackingId: string; -} -export interface Schema$OrdersUpdateShipmentResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateShipmentResponse". - */ - kind: string; -} -export interface Schema$PosCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$PosCustomBatchRequestEntry[]; -} -export interface Schema$PosCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The inventory to submit. Set this only if the method is inventory. - */ - inventory: Schema$PosInventory; - /** - * The ID of the POS provider. - */ - merchantId: string; - method: string; - /** - * The sale information to submit. Set this only if the method is sale. - */ - sale: Schema$PosSale; - /** - * The store information to submit. Set this only if the method is insert. - */ - store: Schema$PosStore; - /** - * The store code. Set this only if the method is delete or get. - */ - storeCode: string; - /** - * The ID of the account for which to get/submit data. - */ - targetMerchantId: string; -} -export interface Schema$PosCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$PosCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posCustomBatchResponse". - */ - kind: string; -} -export interface Schema$PosCustomBatchResponseEntry { - /** - * The ID of the request entry to which this entry responds. - */ - batchId: number; - /** - * A list of errors defined if, and only if, the request failed. - */ - errors: Schema$Errors; - /** - * The updated inventory information. - */ - inventory: Schema$PosInventory; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posCustomBatchResponseEntry". - */ - kind: string; - /** - * The updated sale information. - */ - sale: Schema$PosSale; - /** - * The retrieved or updated store information. - */ - store: Schema$PosStore; -} -/** - * The absolute quantity of an item available at the given store. - */ -export interface Schema$PosInventory { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posInventory". - */ - kind: string; - /** - * The current price of the item. - */ - price: Schema$Price; - /** - * The available quantity of the item. - */ - quantity: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -export interface Schema$PosInventoryRequest { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * The current price of the item. - */ - price: Schema$Price; - /** - * The available quantity of the item. - */ - quantity: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -export interface Schema$PosInventoryResponse { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posInventoryResponse". - */ - kind: string; - /** - * The current price of the item. - */ - price: Schema$Price; - /** - * The available quantity of the item. - */ - quantity: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -export interface Schema$PosListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posListResponse". - */ - kind: string; - resources: Schema$PosStore[]; -} -/** - * The change of the available quantity of an item at the given store. - */ -export interface Schema$PosSale { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posSale". - */ - kind: string; - /** - * The price of the item. - */ - price: Schema$Price; - /** - * The relative change of the available quantity. Negative for items sold. - */ - quantity: string; - /** - * A unique ID to group items from the same sale event. - */ - saleId: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -export interface Schema$PosSaleRequest { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * The price of the item. - */ - price: Schema$Price; - /** - * The relative change of the available quantity. Negative for items sold. - */ - quantity: string; - /** - * A unique ID to group items from the same sale event. - */ - saleId: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -export interface Schema$PosSaleResponse { - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number. - */ - gtin: string; - /** - * A unique identifier for the item. - */ - itemId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posSaleResponse". - */ - kind: string; - /** - * The price of the item. - */ - price: Schema$Price; - /** - * The relative change of the available quantity. Negative for items sold. - */ - quantity: string; - /** - * A unique ID to group items from the same sale event. - */ - saleId: string; - /** - * The identifier of the merchant's store. Either a storeCode inserted via - * the API or the code of the store in Google My Business. - */ - storeCode: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * The inventory timestamp, in ISO 8601 format. - */ - timestamp: string; -} -/** - * Store resource. - */ -export interface Schema$PosStore { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#posStore". - */ - kind: string; - /** - * The street address of the store. - */ - storeAddress: string; - /** - * A store identifier that is unique for the given merchant. - */ - storeCode: string; -} -export interface Schema$PostalCodeGroup { - /** - * The CLDR territory code of the country the postal code group applies to. - * Required. - */ - country: string; - /** - * The name of the postal code group, referred to in headers. Required. - */ - name: string; - /** - * A range of postal codes. Required. - */ - postalCodeRanges: Schema$PostalCodeRange[]; -} -export interface Schema$PostalCodeRange { - /** - * A postal code or a pattern of the form prefix* denoting the inclusive lower - * bound of the range defining the area. Examples values: "94108", - * "9410*", "9*". Required. - */ - postalCodeRangeBegin: string; - /** - * A postal code or a pattern of the form prefix* denoting the inclusive upper - * bound of the range defining the area. It must have the same length as - * postalCodeRangeBegin: if postalCodeRangeBegin is a postal code then - * postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin is a - * pattern then postalCodeRangeEnd must be a pattern with the same prefix - * length. Optional: if not set, then the area is defined as being all the - * postal codes matching postalCodeRangeBegin. - */ - postalCodeRangeEnd: string; -} -export interface Schema$Price { - /** - * The currency of the price. - */ - currency: string; - /** - * The price represented as a number. - */ - value: string; -} -/** - * Product data. - */ -export interface Schema$Product { - /** - * Additional URLs of images of the item. - */ - additionalImageLinks: string[]; - /** - * Additional categories of the item (formatted as in products feed - * specification). - */ - additionalProductTypes: string[]; - /** - * Set to true if the item is targeted towards adults. - */ - adult: boolean; - /** - * Used to group items in an arbitrary way. Only for CPA%, discouraged - * otherwise. - */ - adwordsGrouping: string; - /** - * Similar to adwords_grouping, but only works on CPC. - */ - adwordsLabels: string[]; - /** - * Allows advertisers to override the item URL when the product is shown - * within the context of Product Ads. - */ - adwordsRedirect: string; - /** - * Target age group of the item. - */ - ageGroup: string; - /** - * Specifies the intended aspects for the product. - */ - aspects: Schema$ProductAspect[]; - /** - * Availability status of the item. - */ - availability: string; - /** - * The day a pre-ordered product becomes available for delivery, in ISO 8601 - * format. - */ - availabilityDate: string; - /** - * Brand of the item. - */ - brand: string; - /** - * The item's channel (online or local). - */ - channel: string; - /** - * Color of the item. - */ - color: string; - /** - * Condition or state of the item. - */ - condition: string; - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * A list of custom (merchant-provided) attributes. It can also be used for - * submitting any attribute of the feed specification in its generic form - * (e.g., { "name": "size type", "type": - * "text", "value": "regular" }). This is useful - * for submitting attributes not explicitly exposed by the API. - */ - customAttributes: Schema$ProductCustomAttribute[]; - /** - * A list of custom (merchant-provided) custom attribute groups. - */ - customGroups: Schema$ProductCustomGroup[]; - /** - * Custom label 0 for custom grouping of items in a Shopping campaign. - */ - customLabel0: string; - /** - * Custom label 1 for custom grouping of items in a Shopping campaign. - */ - customLabel1: string; - /** - * Custom label 2 for custom grouping of items in a Shopping campaign. - */ - customLabel2: string; - /** - * Custom label 3 for custom grouping of items in a Shopping campaign. - */ - customLabel3: string; - /** - * Custom label 4 for custom grouping of items in a Shopping campaign. - */ - customLabel4: string; - /** - * Description of the item. - */ - description: string; - /** - * Specifies the intended destinations for the product. - */ - destinations: Schema$ProductDestination[]; - /** - * An identifier for an item for dynamic remarketing campaigns. - */ - displayAdsId: string; - /** - * URL directly to your item's landing page for dynamic remarketing - * campaigns. - */ - displayAdsLink: string; - /** - * Advertiser-specified recommendations. - */ - displayAdsSimilarIds: string[]; - /** - * Title of an item for dynamic remarketing campaigns. - */ - displayAdsTitle: string; - /** - * Offer margin for dynamic remarketing campaigns. - */ - displayAdsValue: number; - /** - * The energy efficiency class as defined in EU directive 2010/30/EU. - */ - energyEfficiencyClass: string; - /** - * Date on which the item should expire, as specified upon insertion, in ISO - * 8601 format. The actual expiration date in Google Shopping is exposed in - * productstatuses as googleExpirationDate and might be earlier if - * expirationDate is too far in the future. - */ - expirationDate: string; - /** - * Target gender of the item. - */ - gender: string; - /** - * Google's category of the item (see Google product taxonomy). - */ - googleProductCategory: string; - /** - * Global Trade Item Number (GTIN) of the item. - */ - gtin: string; - /** - * The REST id of the product. Content API methods that operate on products - * take this as their productId parameter. The REST id for a product is of the - * form channel:contentLanguage:targetCountry:offerId. - */ - id: string; - /** - * False when the item does not have unique product identifiers appropriate to - * its category, such as GTIN, MPN, and brand. Required according to the - * Unique Product Identifier Rules for all target countries except for Canada. - */ - identifierExists: boolean; - /** - * URL of an image of the item. - */ - imageLink: string; - /** - * Number and amount of installments to pay for an item. Brazil only. - */ - installment: Schema$Installment; - /** - * Whether the item is a merchant-defined bundle. A bundle is a custom - * grouping of different products sold by a merchant for a single price. - */ - isBundle: boolean; - /** - * Shared identifier for all variants of the same product. - */ - itemGroupId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#product". - */ - kind: string; - /** - * URL directly linking to your item's page on your website. - */ - link: string; - /** - * Loyalty points that users receive after purchasing the item. Japan only. - */ - loyaltyPoints: Schema$LoyaltyPoints; - /** - * The material of which the item is made. - */ - material: string; - /** - * Maximal product handling time (in business days). - */ - maxHandlingTime: string; - /** - * Minimal product handling time (in business days). - */ - minHandlingTime: string; - /** - * Link to a mobile-optimized version of the landing page. - */ - mobileLink: string; - /** - * Manufacturer Part Number (MPN) of the item. - */ - mpn: string; - /** - * The number of identical products in a merchant-defined multipack. - */ - multipack: string; - /** - * A unique identifier for the item. Leading and trailing whitespaces are - * stripped and multiple whitespaces are replaced by a single whitespace upon - * submission. Only valid unicode characters are accepted. See the products - * feed specification for details. Note: Content API methods that operate on - * products take the REST id of the product, not this identifier. - */ - offerId: string; - /** - * Whether an item is available for purchase only online. - */ - onlineOnly: boolean; - /** - * The item's pattern (e.g. polka dots). - */ - pattern: string; - /** - * Price of the item. - */ - price: Schema$Price; - /** - * Your category of the item (formatted as in products feed specification). - */ - productType: string; - /** - * The unique ID of a promotion. - */ - promotionIds: string[]; - /** - * Advertised sale price of the item. - */ - salePrice: Schema$Price; - /** - * Date range during which the item is on sale (see products feed - * specification). - */ - salePriceEffectiveDate: string; - /** - * The quantity of the product that is reserved for sell-on-google ads. - */ - sellOnGoogleQuantity: string; - /** - * Shipping rules. - */ - shipping: Schema$ProductShipping[]; - /** - * Height of the item for shipping. - */ - shippingHeight: Schema$ProductShippingDimension; - /** - * The shipping label of the product, used to group product in account-level - * shipping rules. - */ - shippingLabel: string; - /** - * Length of the item for shipping. - */ - shippingLength: Schema$ProductShippingDimension; - /** - * Weight of the item for shipping. - */ - shippingWeight: Schema$ProductShippingWeight; - /** - * Width of the item for shipping. - */ - shippingWidth: Schema$ProductShippingDimension; - /** - * Size of the item. - */ - sizes: string[]; - /** - * System in which the size is specified. Recommended for apparel items. - */ - sizeSystem: string; - /** - * The cut of the item. Recommended for apparel items. - */ - sizeType: string; - /** - * The CLDR territory code for the item. - */ - targetCountry: string; - /** - * Tax information. - */ - taxes: Schema$ProductTax[]; - /** - * Title of the item. - */ - title: string; - /** - * The preference of the denominator of the unit price. - */ - unitPricingBaseMeasure: Schema$ProductUnitPricingBaseMeasure; - /** - * The measure and dimension of an item. - */ - unitPricingMeasure: Schema$ProductUnitPricingMeasure; - /** - * The read-only list of intended destinations which passed validation. - */ - validatedDestinations: string[]; - /** - * Read-only warnings. - */ - warnings: Schema$Error[]; -} -export interface Schema$ProductAspect { - /** - * The name of the aspect. - */ - aspectName: string; - /** - * The name of the destination. Leave out to apply to all destinations. - */ - destinationName: string; - /** - * Whether the aspect is required, excluded or should be validated. - */ - intention: string; -} -export interface Schema$ProductCustomAttribute { - /** - * The name of the attribute. Underscores will be replaced by spaces upon - * insertion. - */ - name: string; - /** - * The type of the attribute. - */ - type: string; - /** - * Free-form unit of the attribute. Unit can only be used for values of type - * INT or FLOAT. - */ - unit: string; - /** - * The value of the attribute. - */ - value: string; -} -export interface Schema$ProductCustomGroup { - /** - * The sub-attributes. - */ - attributes: Schema$ProductCustomAttribute[]; - /** - * The name of the group. Underscores will be replaced by spaces upon - * insertion. - */ - name: string; -} -export interface Schema$ProductDestination { - /** - * The name of the destination. - */ - destinationName: string; - /** - * Whether the destination is required, excluded or should be validated. - */ - intention: string; -} -export interface Schema$ProductsCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$ProductsCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch products request. - */ -export interface Schema$ProductsCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; - /** - * The product to insert. Only required if the method is insert. - */ - product: Schema$Product; - /** - * The ID of the product to get or delete. Only defined if the method is get - * or delete. - */ - productId: string; -} -export interface Schema$ProductsCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$ProductsCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productsCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch products response. - */ -export interface Schema$ProductsCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productsCustomBatchResponseEntry". - */ - kind: string; - /** - * The inserted product. Only defined if the method is insert and if the - * request was successful. - */ - product: Schema$Product; -} -export interface Schema$ProductShipping { - /** - * The CLDR territory code of the country to which an item will ship. - */ - country: string; - /** - * The location where the shipping is applicable, represented by a location - * group name. - */ - locationGroupName: string; - /** - * The numeric id of a location that the shipping rate applies to as defined - * in the AdWords API. - */ - locationId: string; - /** - * The postal code range that the shipping rate applies to, represented by a - * postal code, a postal code prefix followed by a * wildcard, a range between - * two postal codes or two postal code prefixes of equal length. - */ - postalCode: string; - /** - * Fixed shipping price, represented as a number. - */ - price: Schema$Price; - /** - * The geographic region to which a shipping rate applies. - */ - region: string; - /** - * A free-form description of the service class or delivery speed. - */ - service: string; -} -export interface Schema$ProductShippingDimension { - /** - * The unit of value. Acceptable values are: - "cm" - - * "in" - */ - unit: string; - /** - * The dimension of the product used to calculate the shipping cost of the - * item. - */ - value: number; -} -export interface Schema$ProductShippingWeight { - /** - * The unit of value. - */ - unit: string; - /** - * The weight of the product used to calculate the shipping cost of the item. - */ - value: number; -} -export interface Schema$ProductsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productsListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of products. - */ - nextPageToken: string; - resources: Schema$Product[]; -} -/** - * The status of a product, i.e., information about a product computed - * asynchronously by the data quality analysis. - */ -export interface Schema$ProductStatus { - /** - * Date on which the item has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * A list of data quality issues associated with the product. - */ - dataQualityIssues: Schema$ProductStatusDataQualityIssue[]; - /** - * The intended destinations for the product. - */ - destinationStatuses: Schema$ProductStatusDestinationStatus[]; - /** - * Date on which the item expires in Google Shopping, in ISO 8601 format. - */ - googleExpirationDate: string; - /** - * A list of all issues associated with the product. - */ - itemLevelIssues: Schema$ProductStatusItemLevelIssue[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productStatus". - */ - kind: string; - /** - * Date on which the item has been last updated, in ISO 8601 format. - */ - lastUpdateDate: string; - /** - * The link to the product. - */ - link: string; - /** - * Product data after applying all the join inputs. - */ - product: Schema$Product; - /** - * The id of the product for which status is reported. - */ - productId: string; - /** - * The title of the product. - */ - title: string; -} -export interface Schema$ProductStatusDataQualityIssue { - /** - * The destination the issue applies to. - */ - destination: string; - /** - * A more detailed error string. - */ - detail: string; - /** - * The fetch status for landing_page_errors. - */ - fetchStatus: string; - /** - * The id of the data quality issue. - */ - id: string; - /** - * The attribute name that is relevant for the issue. - */ - location: string; - /** - * The severity of the data quality issue. - */ - severity: string; - /** - * The time stamp of the data quality issue. - */ - timestamp: string; - /** - * The value of that attribute that was found on the landing page - */ - valueOnLandingPage: string; - /** - * The value the attribute had at time of evaluation. - */ - valueProvided: string; -} -export interface Schema$ProductStatusDestinationStatus { - /** - * Whether the approval status might change due to further processing. - */ - approvalPending: boolean; - /** - * The destination's approval status. - */ - approvalStatus: string; - /** - * The name of the destination - */ - destination: string; - /** - * Provided for backward compatibility only. Always set to - * "required". - */ - intention: string; -} -export interface Schema$ProductstatusesCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$ProductstatusesCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch productstatuses request. - */ -export interface Schema$ProductstatusesCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * If set, only issues for the specified destinations are returned, otherwise - * only issues for the Shopping destination. - */ - destinations: string[]; - includeAttributes: boolean; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; - /** - * The ID of the product whose status to get. - */ - productId: string; -} -export interface Schema$ProductstatusesCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$ProductstatusesCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productstatusesCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch productstatuses response. - */ -export interface Schema$ProductstatusesCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors, if the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productstatusesCustomBatchResponseEntry". - */ - kind: string; - /** - * The requested product status. Only defined if the request was successful. - */ - productStatus: Schema$ProductStatus; -} -export interface Schema$ProductstatusesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#productstatusesListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of products statuses. - */ - nextPageToken: string; - resources: Schema$ProductStatus[]; -} -export interface Schema$ProductStatusItemLevelIssue { - /** - * The attribute's name, if the issue is caused by a single attribute. - */ - attributeName: string; - /** - * The error code of the issue. - */ - code: string; - /** - * A short issue description in English. - */ - description: string; - /** - * The destination the issue applies to. - */ - destination: string; - /** - * A detailed issue description in English. - */ - detail: string; - /** - * The URL of a web page to help with resolving this issue. - */ - documentation: string; - /** - * Whether the issue can be resolved by the merchant. - */ - resolution: string; - /** - * How this issue affects serving of the offer. - */ - servability: string; -} -export interface Schema$ProductTax { - /** - * The country within which the item is taxed, specified as a CLDR territory - * code. - */ - country: string; - /** - * The numeric id of a location that the tax rate applies to as defined in the - * AdWords API. - */ - locationId: string; - /** - * The postal code range that the tax rate applies to, represented by a ZIP - * code, a ZIP code prefix using * wildcard, a range between two ZIP codes or - * two ZIP code prefixes of equal length. Examples: 94114, 94*, 94002-95460, - * 94*-95*. - */ - postalCode: string; - /** - * The percentage of tax rate that applies to the item price. - */ - rate: number; - /** - * The geographic region to which the tax rate applies. - */ - region: string; - /** - * Set to true if tax is charged on shipping. - */ - taxShip: boolean; -} -export interface Schema$ProductUnitPricingBaseMeasure { - /** - * The unit of the denominator. - */ - unit: string; - /** - * The denominator of the unit price. - */ - value: string; -} -export interface Schema$ProductUnitPricingMeasure { - /** - * The unit of the measure. - */ - unit: string; - /** - * The measure of an item. - */ - value: number; -} -export interface Schema$RateGroup { - /** - * A list of shipping labels defining the products to which this rate group - * applies to. This is a disjunction: only one of the labels has to match for - * the rate group to apply. May only be empty for the last rate group of a - * service. Required. - */ - applicableShippingLabels: string[]; - /** - * A list of carrier rates that can be referred to by mainTable or - * singleValue. - */ - carrierRates: Schema$CarrierRate[]; - /** - * A table defining the rate group, when singleValue is not expressive enough. - * Can only be set if singleValue is not set. - */ - mainTable: Schema$Table; - /** - * The value of the rate group (e.g. flat rate $10). Can only be set if - * mainTable and subtables are not set. - */ - singleValue: Schema$Value; - /** - * A list of subtables referred to by mainTable. Can only be set if mainTable - * is set. - */ - subtables: Schema$Table[]; -} -export interface Schema$Row { - /** - * The list of cells that constitute the row. Must have the same length as - * columnHeaders for two-dimensional tables, a length of 1 for one-dimensional - * tables. Required. - */ - cells: Schema$Value[]; -} -export interface Schema$Service { - /** - * A boolean exposing the active status of the shipping service. Required. - */ - active: boolean; - /** - * The CLDR code of the currency to which this service applies. Must match - * that of the prices in rate groups. - */ - currency: string; - /** - * The CLDR territory code of the country to which the service applies. - * Required. - */ - deliveryCountry: string; - /** - * Time spent in various aspects from order to the delivery of the product. - * Required. - */ - deliveryTime: Schema$DeliveryTime; - /** - * Eligibility for this service. - */ - eligibility: string; - /** - * Minimum order value for this service. If set, indicates that customers will - * have to spend at least this amount. All prices within a service must have - * the same currency. - */ - minimumOrderValue: Schema$Price; - /** - * Free-form name of the service. Must be unique within target account. - * Required. - */ - name: string; - /** - * Shipping rate group definitions. Only the last one is allowed to have an - * empty applicableShippingLabels, which means "everything else". - * The other applicableShippingLabels must not overlap. - */ - rateGroups: Schema$RateGroup[]; -} -/** - * The merchant account's shipping settings. - */ -export interface Schema$ShippingSettings { - /** - * The ID of the account to which these account shipping settings belong. - * Ignored upon update, always present in get request responses. - */ - accountId: string; - /** - * A list of postal code groups that can be referred to in services. Optional. - */ - postalCodeGroups: Schema$PostalCodeGroup[]; - /** - * The target account's list of services. Optional. - */ - services: Schema$Service[]; -} -export interface Schema$ShippingsettingsCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$ShippingsettingsCustomBatchRequestEntry[]; -} -/** - * A batch entry encoding a single non-batch shippingsettings request. - */ -export interface Schema$ShippingsettingsCustomBatchRequestEntry { - /** - * The ID of the account for which to get/update account shipping settings. - */ - accountId: string; - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * The ID of the managing account. - */ - merchantId: string; - method: string; - /** - * The account shipping settings to update. Only defined if the method is - * update. - */ - shippingSettings: Schema$ShippingSettings; -} -export interface Schema$ShippingsettingsCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$ShippingsettingsCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#shippingsettingsCustomBatchResponse". - */ - kind: string; -} -/** - * A batch entry encoding a single non-batch shipping settings response. - */ -export interface Schema$ShippingsettingsCustomBatchResponseEntry { - /** - * The ID of the request entry to which this entry responds. - */ - batchId: number; - /** - * A list of errors defined if, and only if, the request failed. - */ - errors: Schema$Errors; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#shippingsettingsCustomBatchResponseEntry". - */ - kind: string; - /** - * The retrieved or updated account shipping settings. - */ - shippingSettings: Schema$ShippingSettings; -} -export interface Schema$ShippingsettingsGetSupportedCarriersResponse { - /** - * A list of supported carriers. May be empty. - */ - carriers: Schema$CarriersCarrier[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#shippingsettingsGetSupportedCarriersResponse". - */ - kind: string; -} -export interface Schema$ShippingsettingsGetSupportedHolidaysResponse { - /** - * A list of holidays applicable for delivery guarantees. May be empty. - */ - holidays: Schema$HolidaysHoliday[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#shippingsettingsGetSupportedHolidaysResponse". - */ - kind: string; -} -export interface Schema$ShippingsettingsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#shippingsettingsListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of shipping settings. - */ - nextPageToken: string; - resources: Schema$ShippingSettings[]; -} -export interface Schema$Table { - /** - * Headers of the table's columns. Optional: if not set then the table has - * only one dimension. - */ - columnHeaders: Schema$Headers; - /** - * Name of the table. Required for subtables, ignored for the main table. - */ - name: string; - /** - * Headers of the table's rows. Required. - */ - rowHeaders: Schema$Headers; - /** - * The list of rows that constitute the table. Must have the same length as - * rowHeaders. Required. - */ - rows: Schema$Row[]; -} -export interface Schema$TestOrder { - /** - * The details of the customer who placed the order. - */ - customer: Schema$TestOrderCustomer; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#testOrder". - */ - kind: string; - /** - * Line items that are ordered. At least one line item must be provided. - */ - lineItems: Schema$TestOrderLineItem[]; - /** - * Determines if test order must be pulled by merchant or pushed to merchant - * via push integration. - */ - notificationMode: string; - /** - * The details of the payment method. - */ - paymentMethod: Schema$TestOrderPaymentMethod; - /** - * Identifier of one of the predefined delivery addresses for the delivery. - */ - predefinedDeliveryAddress: string; - /** - * The details of the merchant provided promotions applied to the order. More - * details about the program are here. - */ - promotions: Schema$OrderPromotion[]; - /** - * The total cost of shipping for all items. - */ - shippingCost: Schema$Price; - /** - * The tax for the total shipping cost. - */ - shippingCostTax: Schema$Price; - /** - * The requested shipping option. - */ - shippingOption: string; -} -export interface Schema$TestOrderCustomer { - /** - * Email address of the customer. - */ - email: string; - /** - * Deprecated. Please use marketingRightsInfo instead. - */ - explicitMarketingPreference: boolean; - /** - * Full name of the customer. - */ - fullName: string; - /** - * Customer's marketing preferences. - */ - marketingRightsInfo: Schema$TestOrderCustomerMarketingRightsInfo; -} -export interface Schema$TestOrderCustomerMarketingRightsInfo { - /** - * Last know user use selection regards marketing preferences. In certain - * cases selection might not be known, so this field would be empty. - */ - explicitMarketingPreference: string; - /** - * Timestamp when last time marketing preference was updated. Could be empty, - * if user wasn't offered a selection yet. - */ - lastUpdatedTimestamp: string; -} -export interface Schema$TestOrderLineItem { - /** - * Product data from the time of the order placement. - */ - product: Schema$TestOrderLineItemProduct; - /** - * Number of items ordered. - */ - quantityOrdered: number; - /** - * Details of the return policy for the line item. - */ - returnInfo: Schema$OrderLineItemReturnInfo; - /** - * Details of the requested shipping for the line item. - */ - shippingDetails: Schema$OrderLineItemShippingDetails; - /** - * Unit tax for the line item. - */ - unitTax: Schema$Price; -} -export interface Schema$TestOrderLineItemProduct { - /** - * Brand of the item. - */ - brand: string; - /** - * The item's channel. - */ - channel: string; - /** - * Condition or state of the item. - */ - condition: string; - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number (GTIN) of the item. Optional. - */ - gtin: string; - /** - * URL of an image of the item. - */ - imageLink: string; - /** - * Shared identifier for all variants of the same product. Optional. - */ - itemGroupId: string; - /** - * Manufacturer Part Number (MPN) of the item. Optional. - */ - mpn: string; - /** - * An identifier of the item. - */ - offerId: string; - /** - * The price for the product. - */ - price: Schema$Price; - /** - * The CLDR territory code of the target country of the product. - */ - targetCountry: string; - /** - * The title of the product. - */ - title: string; - /** - * Variant attributes for the item. Optional. - */ - variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; -} -export interface Schema$TestOrderPaymentMethod { - /** - * The card expiration month (January = 1, February = 2 etc.). - */ - expirationMonth: number; - /** - * The card expiration year (4-digit, e.g. 2015). - */ - expirationYear: number; - /** - * The last four digits of the card number. - */ - lastFourDigits: string; - /** - * The billing address. - */ - predefinedBillingAddress: string; - /** - * The type of instrument. Note that real orders might have different values - * than the four values accepted by createTestOrder. - */ - type: string; -} -/** - * The single value of a rate group or the value of a rate group table's - * cell. Exactly one of noShipping, flatRate, pricePercentage, carrierRateName, - * subtableName must be set. - */ -export interface Schema$Value { - /** - * The name of a carrier rate referring to a carrier rate defined in the same - * rate group. Can only be set if all other fields are not set. - */ - carrierRateName: string; - /** - * A flat rate. Can only be set if all other fields are not set. - */ - flatRate: Schema$Price; - /** - * If true, then the product can't ship. Must be true when set, can only - * be set if all other fields are not set. - */ - noShipping: boolean; - /** - * A percentage of the price represented as a number in decimal notation - * (e.g., "5.4"). Can only be set if all other fields are not set. - */ - pricePercentage: string; - /** - * The name of a subtable. Can only be set in table cells (i.e., not for - * single values), and only if all other fields are not set. - */ - subtableName: string; -} -export interface Schema$Weight { - /** - * The weight unit. - */ - unit: string; - /** - * The weight represented as a number. - */ - value: string; -} - -export class Resource$Accounts { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * content.accounts.authinfo - * @desc Returns information about the authenticated user. - * @alias content.accounts.authinfo - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - authinfo(params?: any, options?: MethodOptions): - AxiosPromise; - authinfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - authinfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/accounts/authinfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.claimwebsite - * @desc Claims the website of a Merchant Center sub-account. - * @alias content.accounts.claimwebsite - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account whose website is claimed. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {boolean=} params.overwrite Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - claimwebsite(params?: any, options?: MethodOptions): - AxiosPromise; - claimwebsite( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - claimwebsite( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/accounts/{accountId}/claimwebsite') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.custombatch - * @desc Retrieves, inserts, updates, and deletes multiple Merchant Center - * (sub-)accounts in a single request. - * @alias content.accounts.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().AccountsCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/accounts/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.delete - * @desc Deletes a Merchant Center sub-account. - * @alias content.accounts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {boolean=} params.force Flag to delete sub-accounts with products. The default value is false. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.get - * @desc Retrieves a Merchant Center account. - * @alias content.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.insert - * @desc Creates a Merchant Center sub-account. - * @alias content.accounts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.list - * @desc Lists the sub-accounts in your Merchant Center account. - * @alias content.accounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of accounts to return in the response, used for paging. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.patch - * @desc Updates a Merchant Center account. This method supports patch - * semantics. - * @alias content.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounts.update - * @desc Updates a Merchant Center account. - * @alias content.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accountstatuses { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * content.accountstatuses.custombatch - * @alias content.accountstatuses.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AccountstatusesCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/accountstatuses/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * content.accountstatuses.get - * @desc Retrieves the status of a Merchant Center account. - * @alias content.accountstatuses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account. - * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/accountstatuses/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accountstatuses.list - * @desc Lists the statuses of the sub-accounts in your Merchant Center - * account. - * @alias content.accountstatuses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. - * @param {integer=} params.maxResults The maximum number of account statuses to return in the response, used for paging. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accountstatuses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounttax { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * content.accounttax.custombatch - * @desc Retrieves and updates tax settings of multiple accounts in a single - * request. - * @alias content.accounttax.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().AccounttaxCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/accounttax/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounttax.get - * @desc Retrieves the tax settings of the account. - * @alias content.accounttax.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update account tax settings. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounttax.list - * @desc Lists the tax settings of the sub-accounts in your Merchant Center - * account. - * @alias content.accounttax.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of tax settings to return in the response, used for paging. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounttax') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounttax.patch - * @desc Updates the tax settings of the account. This method supports patch - * semantics. - * @alias content.accounttax.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update account tax settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().AccountTax} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.accounttax.update - * @desc Updates the tax settings of the account. - * @alias content.accounttax.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update account tax settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().AccountTax} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Datafeeds { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace content_v2 { /** - * content.datafeeds.custombatch - * @alias content.datafeeds.custombatch - * @memberOf! () + * Content API for Shopping * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().DatafeedsCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/datafeeds/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.datafeeds.delete - * @desc Deletes a datafeed configuration from your Merchant Center account. - * @alias content.datafeeds.delete - * @memberOf! () + * Manages product items, inventory, and Merchant Center accounts for Google + * Shopping. * - * @param {object} params Parameters for request - * @param {string} params.datafeedId The ID of the datafeed. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * content.datafeeds.fetchnow - * @desc Invokes a fetch for the datafeed in your Merchant Center account. - * @alias content.datafeeds.fetchnow - * @memberOf! () + * @example + * const google = require('googleapis'); + * const content = google.content('v2'); * - * @param {object} params Parameters for request - * @param {string} params.datafeedId The ID of the datafeed to be fetched. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - fetchnow(params?: any, options?: MethodOptions): - AxiosPromise; - fetchnow( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - fetchnow( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/datafeeds/{datafeedId}/fetchNow') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace content + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Content + */ + export class Content { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + accountstatuses: Resource$Accountstatuses; + accounttax: Resource$Accounttax; + datafeeds: Resource$Datafeeds; + datafeedstatuses: Resource$Datafeedstatuses; + inventory: Resource$Inventory; + liasettings: Resource$Liasettings; + orders: Resource$Orders; + pos: Resource$Pos; + products: Resource$Products; + productstatuses: Resource$Productstatuses; + shippingsettings: Resource$Shippingsettings; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.accountstatuses = new Resource$Accountstatuses(this); + this.accounttax = new Resource$Accounttax(this); + this.datafeeds = new Resource$Datafeeds(this); + this.datafeedstatuses = new Resource$Datafeedstatuses(this); + this.inventory = new Resource$Inventory(this); + this.liasettings = new Resource$Liasettings(this); + this.orders = new Resource$Orders(this); + this.pos = new Resource$Pos(this); + this.products = new Resource$Products(this); + this.productstatuses = new Resource$Productstatuses(this); + this.shippingsettings = new Resource$Shippingsettings(this); + } + + getRoot() { + return this.root; } } - /** - * content.datafeeds.get - * @desc Retrieves a datafeed configuration from your Merchant Center account. - * @alias content.datafeeds.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datafeedId The ID of the datafeed. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Account data. + */ + export interface Schema$Account { + /** + * Indicates whether the merchant sells adult content. + */ + adultContent: boolean; + /** + * List of linked AdWords accounts that are active or pending approval. To + * create a new link request, add a new link with status active to the list. + * It will remain in a pending state until approved or rejected either in + * the AdWords interface or through the AdWords API. To delete an active + * link, or to cancel a link request, remove it from the list. + */ + adwordsLinks: Schema$AccountAdwordsLink[]; + /** + * The GMB account which is linked or in the process of being linked with + * the Merchant Center accounnt. + */ + googleMyBusinessLink: Schema$AccountGoogleMyBusinessLink; + /** + * Merchant Center account ID. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#account". + */ + kind: string; + /** + * Display name for the account. + */ + name: string; + /** + * [DEPRECATED] This field is never returned and will be ignored if + * provided. + */ + reviewsUrl: string; + /** + * Client-specific, locally-unique, internal ID for the child account. + */ + sellerId: string; + /** + * Users with access to the account. Every account (except for subaccounts) + * must have at least one admin user. + */ + users: Schema$AccountUser[]; + /** + * The merchant's website. + */ + websiteUrl: string; + /** + * List of linked YouTube channels that are active or pending approval. To + * create a new link request, add a new link with status active to the list. + * It will remain in a pending state until approved or rejected in the YT + * Creator Studio interface. To delete an active link, or to cancel a link + * request, remove it from the list. + */ + youtubeChannelLinks: Schema$AccountYouTubeChannelLink[]; } - - - /** - * content.datafeeds.insert - * @desc Registers a datafeed configuration with your Merchant Center account. - * @alias content.datafeeds.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {().Datafeed} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountAdwordsLink { + /** + * Customer ID of the AdWords account. + */ + adwordsId: string; + /** + * Status of the link between this Merchant Center account and the AdWords + * account. Upon retrieval, it represents the actual status of the link and + * can be either active if it was approved in Google AdWords or pending if + * it's pending approval. Upon insertion, it represents the intended + * status of the link. Re-uploading a link with status active when it's + * still pending or with status pending when it's already active will + * have no effect: the status will remain unchanged. Re-uploading a link + * with deprecated status inactive is equivalent to not submitting the link + * at all and will delete the link if it was active or cancel the link + * request if it was pending. + */ + status: string; } - - - /** - * content.datafeeds.list - * @desc Lists the configurations for datafeeds in your Merchant Center - * account. - * @alias content.datafeeds.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. - * @param {string} params.merchantId The ID of the account that manages the datafeeds. This account cannot be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountGoogleMyBusinessLink { + /** + * The GMB email address of which a specific account within a GMB account. A + * sample account within a GMB account could be a business account with set + * of locations, managed under the GMB account. + */ + gmbEmail: string; + /** + * Status of the link between this Merchant Center account and the GMB + * account. + */ + status: string; } - - - /** - * content.datafeeds.patch - * @desc Updates a datafeed configuration of your Merchant Center account. - * This method supports patch semantics. - * @alias content.datafeeds.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datafeedId The ID of the datafeed. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {().Datafeed} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountIdentifier { + /** + * The aggregator ID, set for aggregators and subaccounts (in that case, it + * represents the aggregator of the subaccount). + */ + aggregatorId: string; + /** + * The merchant account ID, set for individual accounts and subaccounts. + */ + merchantId: string; } - - - /** - * content.datafeeds.update - * @desc Updates a datafeed configuration of your Merchant Center account. - * @alias content.datafeeds.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datafeedId The ID of the datafeed. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {().Datafeed} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountsAuthInfoResponse { + /** + * The account identifiers corresponding to the authenticated user. - For an + * individual account: only the merchant ID is defined - For an aggregator: + * only the aggregator ID is defined - For a subaccount of an MCA: both the + * merchant ID and the aggregator ID are defined. + */ + accountIdentifiers: Schema$AccountIdentifier[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountsAuthInfoResponse". + */ + kind: string; } -} - -export class Resource$Datafeedstatuses { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AccountsClaimWebsiteResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountsClaimWebsiteResponse". + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$AccountsCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$AccountsCustomBatchRequestEntry[]; } - - /** - * content.datafeedstatuses.custombatch - * @alias content.datafeedstatuses.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().DatafeedstatusesCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/datafeedstatuses/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A batch entry encoding a single non-batch accounts request. + */ + export interface Schema$AccountsCustomBatchRequestEntry { + /** + * The account to create or update. Only defined if the method is insert or + * update. + */ + account: Schema$Account; + /** + * The ID of the targeted account. Only defined if the method is get, delete + * or claimwebsite. + */ + accountId: string; + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * Whether the account should be deleted if the account has offers. Only + * applicable if the method is delete. + */ + force: boolean; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + /** + * Only applicable if the method is claimwebsite. Indicates whether or not + * to take the claim from another account in case there is a conflict. + */ + overwrite: boolean; } - - - /** - * content.datafeedstatuses.get - * @desc Retrieves the status of a datafeed from your Merchant Center account. - * @alias content.datafeedstatuses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.country The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. - * @param {string} params.datafeedId The ID of the datafeed. - * @param {string=} params.language The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. - * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/datafeedstatuses/{datafeedId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'datafeedId'], - pathParams: ['datafeedId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountsCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$AccountsCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountsCustomBatchResponse". + */ + kind: string; } - - /** - * content.datafeedstatuses.list - * @desc Lists the statuses of the datafeeds in your Merchant Center account. - * @alias content.datafeedstatuses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. - * @param {string} params.merchantId The ID of the account that manages the datafeeds. This account cannot be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/datafeedstatuses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Inventory { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + * A batch entry encoding a single non-batch accounts response. + */ + export interface Schema$AccountsCustomBatchResponseEntry { + /** + * The retrieved, created, or updated account. Not defined if the method was + * delete or claimwebsite. + */ + account: Schema$Account; + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountsCustomBatchResponseEntry". + */ + kind: string; } - - getRoot() { - return this.root; - } - - - /** - * content.inventory.custombatch - * @desc Updates price and availability for multiple products or stores in a - * single request. This operation does not update the expiration date of the - * products. - * @alias content.inventory.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().InventoryCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/inventory/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountsListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of accounts. + */ + nextPageToken: string; + resources: Schema$Account[]; } - - /** - * content.inventory.set - * @desc Updates price and availability of a product in your Merchant Center - * account. - * @alias content.inventory.set - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. - * @param {string} params.productId The REST id of the product for which to update price and availability. - * @param {string} params.storeCode The code of the store for which to update price and availability. Use online to update price and availability of an online product. - * @param {().InventorySetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - set(params?: any, - options?: MethodOptions): AxiosPromise; - set(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - set(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/inventory/{storeCode}/products/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'storeCode', 'productId'], - pathParams: ['merchantId', 'productId', 'storeCode'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The status of an account, i.e., information about its products, which is + * computed offline and not returned immediately at insertion time. + */ + export interface Schema$AccountStatus { + /** + * The ID of the account for which the status is reported. + */ + accountId: string; + /** + * A list of account level issues. + */ + accountLevelIssues: Schema$AccountStatusAccountLevelIssue[]; + /** + * A list of data quality issues. + */ + dataQualityIssues: Schema$AccountStatusDataQualityIssue[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountStatus". + */ + kind: string; + /** + * Whether the account's website is claimed or not. + */ + websiteClaimed: boolean; } -} - -export class Resource$Liasettings { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AccountStatusAccountLevelIssue { + /** + * Country for which this issue is reported. + */ + country: string; + /** + * The destination the issue applies to. + */ + destination: string; + /** + * Additional details about the issue. + */ + detail: string; + /** + * Issue identifier. + */ + id: string; + /** + * Severity of the issue. + */ + severity: string; + /** + * Short description of the issue. + */ + title: string; } - - getRoot() { - return this.root; + export interface Schema$AccountStatusDataQualityIssue { + /** + * Country for which this issue is reported. + */ + country: string; + /** + * The destination the issue applies to. + */ + destination: string; + /** + * A more detailed description of the issue. + */ + detail: string; + /** + * Actual value displayed on the landing page. + */ + displayedValue: string; + /** + * Example items featuring the issue. + */ + exampleItems: Schema$AccountStatusExampleItem[]; + /** + * Issue identifier. + */ + id: string; + /** + * Last time the account was checked for this issue. + */ + lastChecked: string; + /** + * The attribute name that is relevant for the issue. + */ + location: string; + /** + * Number of items in the account found to have the said issue. + */ + numItems: number; + /** + * Severity of the problem. + */ + severity: string; + /** + * Submitted value that causes the issue. + */ + submittedValue: string; } - - - /** - * content.liasettings.custombatch - * @desc Retrieves and/or updates the LIA settings of multiple accounts in a - * single request. - * @alias content.liasettings.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().LiasettingsCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/liasettings/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$AccountstatusesCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$AccountstatusesCustomBatchRequestEntry[]; } - - /** - * content.liasettings.get - * @desc Retrieves the LIA settings of the account. - * @alias content.liasettings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get or update LIA settings. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch accountstatuses request. + */ + export interface Schema$AccountstatusesCustomBatchRequestEntry { + /** + * The ID of the (sub-)account whose status to get. + */ + accountId: string; + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * If set, only issues for the specified destinations are returned, + * otherwise only issues for the Shopping destination. + */ + destinations: string[]; + /** + * The ID of the managing account. + */ + merchantId: string; + /** + * The method (get). + */ + method: string; + } + export interface Schema$AccountstatusesCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$AccountstatusesCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountstatusesCustomBatchResponse". + */ + kind: string; } - - /** - * content.liasettings.getaccessiblegmbaccounts - * @desc Retrieves the list of accessible Google My Business accounts. - * @alias content.liasettings.getaccessiblegmbaccounts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to retrieve accessible Google My Business accounts. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getaccessiblegmbaccounts(params?: any, options?: MethodOptions): - AxiosPromise; - getaccessiblegmbaccounts( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$LiasettingsGetAccessibleGmbAccountsResponse>): void; - getaccessiblegmbaccounts( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$LiasettingsGetAccessibleGmbAccountsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/liasettings/{accountId}/accessiblegmbaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$LiasettingsGetAccessibleGmbAccountsResponse>(parameters); - } + * A batch entry encoding a single non-batch accountstatuses response. + */ + export interface Schema$AccountstatusesCustomBatchResponseEntry { + /** + * The requested account status. Defined if and only if the request was + * successful. + */ + accountStatus: Schema$AccountStatus; + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + } + export interface Schema$AccountstatusesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountstatusesListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of account statuses. + */ + nextPageToken: string; + resources: Schema$AccountStatus[]; } - - /** - * content.liasettings.list - * @desc Lists the LIA settings of the sub-accounts in your Merchant Center - * account. - * @alias content.liasettings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of LIA settings to return in the response, used for paging. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/liasettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An example of an item that has poor data quality. An item value on the + * landing page differs from what is submitted, or conflicts with a policy. + */ + export interface Schema$AccountStatusExampleItem { + /** + * Unique item ID as specified in the uploaded product data. + */ + itemId: string; + /** + * Landing page of the item. + */ + link: string; + /** + * The item value that was submitted. + */ + submittedValue: string; + /** + * Title of the item. + */ + title: string; + /** + * The actual value on the landing page. + */ + valueOnLandingPage: string; } - - /** - * content.liasettings.patch - * @desc Updates the LIA settings of the account. This method supports patch - * semantics. - * @alias content.liasettings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get or update LIA settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().LiaSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The tax settings of a merchant account. + */ + export interface Schema$AccountTax { + /** + * The ID of the account to which these account tax settings belong. + */ + accountId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accountTax". + */ + kind: string; + /** + * Tax rules. Updating the tax rules will enable US taxes (not reversible). + * Defining no rules is equivalent to not charging tax at all. + */ + rules: Schema$AccountTaxTaxRule[]; + } + export interface Schema$AccounttaxCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$AccounttaxCustomBatchRequestEntry[]; } - - /** - * content.liasettings.requestgmbaccess - * @desc Requests access to a specified Google My Business account. - * @alias content.liasettings.requestgmbaccess - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which GMB access is requested. - * @param {string=} params.gmbEmail The email of the Google My Business account. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - requestgmbaccess(params?: any, options?: MethodOptions): - AxiosPromise; - requestgmbaccess( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - requestgmbaccess( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/liasettings/{accountId}/requestgmbaccess') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A batch entry encoding a single non-batch accounttax request. + */ + export interface Schema$AccounttaxCustomBatchRequestEntry { + /** + * The ID of the account for which to get/update account tax settings. + */ + accountId: string; + /** + * The account tax settings to update. Only defined if the method is update. + */ + accountTax: Schema$AccountTax; + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + } + export interface Schema$AccounttaxCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$AccounttaxCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accounttaxCustomBatchResponse". + */ + kind: string; } - - /** - * content.liasettings.requestinventoryverification - * @desc Requests inventory validation for the specified country. - * @alias content.liasettings.requestinventoryverification - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.country The country for which inventory validation is requested. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - requestinventoryverification(params?: any, options?: MethodOptions): - AxiosPromise; - requestinventoryverification( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$LiasettingsRequestInventoryVerificationResponse>, - callback?: BodyResponseCallback< - Schema$LiasettingsRequestInventoryVerificationResponse>): void; - requestinventoryverification( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$LiasettingsRequestInventoryVerificationResponse>, - callback?: BodyResponseCallback< - Schema$LiasettingsRequestInventoryVerificationResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/liasettings/{accountId}/requestinventoryverification/{country}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'accountId', 'country'], - pathParams: ['accountId', 'country', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$LiasettingsRequestInventoryVerificationResponse>(parameters); - } + * A batch entry encoding a single non-batch accounttax response. + */ + export interface Schema$AccounttaxCustomBatchResponseEntry { + /** + * The retrieved or updated account tax settings. + */ + accountTax: Schema$AccountTax; + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accounttaxCustomBatchResponseEntry". + */ + kind: string; + } + export interface Schema$AccounttaxListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#accounttaxListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of account tax settings. + */ + nextPageToken: string; + resources: Schema$AccountTax[]; } - - /** - * content.liasettings.setinventoryverificationcontact - * @desc Sets the inventory verification contract for the specified country. - * @alias content.liasettings.setinventoryverificationcontact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string=} params.contactEmail The email of the inventory verification contact. - * @param {string=} params.contactName The name of the inventory verification contact. - * @param {string=} params.country The country for which inventory verification is requested. - * @param {string=} params.language The language for which inventory verification is requested. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setinventoryverificationcontact(params?: any, options?: MethodOptions): - AxiosPromise; - setinventoryverificationcontact( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$LiasettingsSetInventoryVerificationContactResponse>, - callback?: BodyResponseCallback< - Schema$LiasettingsSetInventoryVerificationContactResponse>): void; - setinventoryverificationcontact( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$LiasettingsSetInventoryVerificationContactResponse>, - callback?: BodyResponseCallback< - Schema$LiasettingsSetInventoryVerificationContactResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/liasettings/{accountId}/setinventoryverificationcontact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$LiasettingsSetInventoryVerificationContactResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$LiasettingsSetInventoryVerificationContactResponse>( - parameters); - } + * Tax calculation rule to apply in a state or province (USA only). + */ + export interface Schema$AccountTaxTaxRule { + /** + * Country code in which tax is applicable. + */ + country: string; + /** + * State (or province) is which the tax is applicable, described by its + * location id (also called criteria id). + */ + locationId: string; + /** + * Explicit tax rate in percent, represented as a floating point number + * without the percentage character. Must not be negative. + */ + ratePercent: string; + /** + * If true, shipping charges are also taxed. + */ + shippingTaxed: boolean; + /** + * Whether the tax rate is taken from a global tax table or specified + * explicitly. + */ + useGlobalRate: boolean; + } + export interface Schema$AccountUser { + /** + * Whether user is an admin. + */ + admin: boolean; + /** + * User's email address. + */ + emailAddress: string; + } + export interface Schema$AccountYouTubeChannelLink { + /** + * Channel ID. + */ + channelId: string; + /** + * Status of the link between this Merchant Center account and the YouTube + * channel. Upon retrieval, it represents the actual status of the link and + * can be either active if it was approved in YT Creator Studio or pending + * if it's pending approval. Upon insertion, it represents the intended + * status of the link. Re-uploading a link with status active when it's + * still pending or with status pending when it's already active will + * have no effect: the status will remain unchanged. Re-uploading a link + * with deprecated status inactive is equivalent to not submitting the link + * at all and will delete the link if it was active or cancel the link + * request if it was pending. + */ + status: string; + } + export interface Schema$CarrierRate { + /** + * Carrier service, such as "UPS" or "Fedex". The list + * of supported carriers can be retrieved via the getSupportedCarriers + * method. Required. + */ + carrierName: string; + /** + * Carrier service, such as "ground" or "2 days". The + * list of supported services for a carrier can be retrieved via the + * getSupportedCarriers method. Required. + */ + carrierService: string; + /** + * Additive shipping rate modifier. Can be negative. For example { + * "value": "1", "currency" : "USD" + * } adds $1 to the rate, { "value": "-3", + * "currency" : "USD" } removes $3 from the rate. + * Optional. + */ + flatAdjustment: Schema$Price; + /** + * Name of the carrier rate. Must be unique per rate group. Required. + */ + name: string; + /** + * Shipping origin for this carrier rate. Required. + */ + originPostalCode: string; + /** + * Multiplicative shipping rate modifier as a number in decimal notation. + * Can be negative. For example "5.4" increases the rate by 5.4%, + * "-3" decreases the rate by 3%. Optional. + */ + percentageAdjustment: string; + } + export interface Schema$CarriersCarrier { + /** + * The CLDR country code of the carrier (e.g., "US"). Always + * present. + */ + country: string; + /** + * The name of the carrier (e.g., "UPS"). Always present. + */ + name: string; + /** + * A list of supported services (e.g., "ground") for that carrier. + * Contains at least one service. + */ + services: string[]; } - - /** - * content.liasettings.update - * @desc Updates the LIA settings of the account. - * @alias content.liasettings.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get or update LIA settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().LiaSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Datafeed configuration data. + */ + export interface Schema$Datafeed { + /** + * The two-letter ISO 639-1 language in which the attributes are defined in + * the data feed. + */ + attributeLanguage: string; + /** + * [DEPRECATED] Please use targets[].language instead. The two-letter ISO + * 639-1 language of the items in the feed. Must be a valid language for + * targetCountry. + */ + contentLanguage: string; + /** + * The type of data feed. For product inventory feeds, only feeds for local + * stores, not online stores, are supported. + */ + contentType: string; + /** + * Fetch schedule for the feed file. + */ + fetchSchedule: Schema$DatafeedFetchSchedule; + /** + * The filename of the feed. All feeds must have a unique file name. + */ + fileName: string; + /** + * Format of the feed file. + */ + format: Schema$DatafeedFormat; + /** + * The ID of the data feed. + */ + id: string; + /** + * [DEPRECATED] Please use targets[].includedDestinations instead. The list + * of intended destinations (corresponds to checked check boxes in Merchant + * Center). + */ + intendedDestinations: string[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeed". + */ + kind: string; + /** + * A descriptive name of the data feed. + */ + name: string; + /** + * [DEPRECATED] Please use targets[].country instead. The country where the + * items in the feed will be included in the search index, represented as a + * CLDR territory code. + */ + targetCountry: string; + /** + * The targets this feed should apply to (country, language, destinations). + */ + targets: Schema$DatafeedTarget[]; } -} - -export class Resource$Orders { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + /** + * The required fields vary based on the frequency of fetching. For a monthly + * fetch schedule, day_of_month and hour are required. For a weekly fetch + * schedule, weekday and hour are required. For a daily fetch schedule, only + * hour is required. + */ + export interface Schema$DatafeedFetchSchedule { + /** + * The day of the month the feed file should be fetched (1-31). + */ + dayOfMonth: number; + /** + * The URL where the feed file can be fetched. Google Merchant Center will + * support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP + * protocols, so the value will need to be a valid link using one of those + * four protocols. + */ + fetchUrl: string; + /** + * The hour of the day the feed file should be fetched (0-23). + */ + hour: number; + /** + * The minute of the hour the feed file should be fetched (0-59). Read-only. + */ + minuteOfHour: number; + /** + * An optional password for fetch_url. + */ + password: string; + /** + * Whether the scheduled fetch is paused or not. + */ + paused: boolean; + /** + * Time zone used for schedule. UTC by default. E.g., + * "America/Los_Angeles". + */ + timeZone: string; + /** + * An optional user name for fetch_url. + */ + username: string; + /** + * The day of the week the feed file should be fetched. + */ + weekday: string; } - - getRoot() { - return this.root; + export interface Schema$DatafeedFormat { + /** + * Delimiter for the separation of values in a delimiter-separated values + * feed. If not specified, the delimiter will be auto-detected. Ignored for + * non-DSV data feeds. + */ + columnDelimiter: string; + /** + * Character encoding scheme of the data feed. If not specified, the + * encoding will be auto-detected. + */ + fileEncoding: string; + /** + * Specifies how double quotes are interpreted. If not specified, the mode + * will be auto-detected. Ignored for non-DSV data feeds. + */ + quotingMode: string; + } + export interface Schema$DatafeedsCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$DatafeedsCustomBatchRequestEntry[]; } - - /** - * content.orders.acknowledge - * @desc Marks an order as acknowledged. - * @alias content.orders.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersAcknowledgeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch datafeeds request. + */ + export interface Schema$DatafeedsCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The data feed to insert. + */ + datafeed: Schema$Datafeed; + /** + * The ID of the data feed to get, delete or fetch. + */ + datafeedId: string; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + } + export interface Schema$DatafeedsCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$DatafeedsCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedsCustomBatchResponse". + */ + kind: string; } - - /** - * content.orders.advancetestorder - * @desc Sandbox only. Moves a test order from state "inProgress" to state - * "pendingShipment". - * @alias content.orders.advancetestorder - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the test order to modify. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - advancetestorder(params?: any, options?: MethodOptions): - AxiosPromise; - advancetestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - advancetestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/testorders/{orderId}/advance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A batch entry encoding a single non-batch datafeeds response. + */ + export interface Schema$DatafeedsCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * The requested data feed. Defined if and only if the request was + * successful. + */ + datafeed: Schema$Datafeed; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + } + export interface Schema$DatafeedsFetchNowResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedsFetchNowResponse". + */ + kind: string; + } + export interface Schema$DatafeedsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedsListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of datafeeds. + */ + nextPageToken: string; + resources: Schema$Datafeed[]; } - - /** - * content.orders.cancel - * @desc Cancels all line items in an order, making a full refund. - * @alias content.orders.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order to cancel. - * @param {().OrdersCancelRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/orders/{orderId}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The status of a datafeed, i.e., the result of the last retrieval of the + * datafeed computed asynchronously when the feed processing is finished. + */ + export interface Schema$DatafeedStatus { + /** + * The country for which the status is reported, represented as a CLDR + * territory code. + */ + country: string; + /** + * The ID of the feed for which the status is reported. + */ + datafeedId: string; + /** + * The list of errors occurring in the feed. + */ + errors: Schema$DatafeedStatusError[]; + /** + * The number of items in the feed that were processed. + */ + itemsTotal: string; + /** + * The number of items in the feed that were valid. + */ + itemsValid: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedStatus". + */ + kind: string; + /** + * The two-letter ISO 639-1 language for which the status is reported. + */ + language: string; + /** + * The last date at which the feed was uploaded. + */ + lastUploadDate: string; + /** + * The processing status of the feed. + */ + processingStatus: string; + /** + * The list of errors occurring in the feed. + */ + warnings: Schema$DatafeedStatusError[]; } - - /** - * content.orders.cancellineitem - * @desc Cancels a line item, making a full refund. - * @alias content.orders.cancellineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersCancelLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancellineitem(params?: any, options?: MethodOptions): - AxiosPromise; - cancellineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - cancellineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/cancelLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An error occurring in the feed, like "invalid price". + */ + export interface Schema$DatafeedStatusError { + /** + * The code of the error, e.g., "validation/invalid_value". + */ + code: string; + /** + * The number of occurrences of the error in the feed. + */ + count: string; + /** + * A list of example occurrences of the error, grouped by product. + */ + examples: Schema$DatafeedStatusExample[]; + /** + * The error message, e.g., "Invalid price". + */ + message: string; + } + export interface Schema$DatafeedstatusesCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$DatafeedstatusesCustomBatchRequestEntry[]; } - - /** - * content.orders.createtestorder - * @desc Sandbox only. Creates a test order. - * @alias content.orders.createtestorder - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. - * @param {().OrdersCreateTestOrderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createtestorder(params?: any, options?: MethodOptions): - AxiosPromise; - createtestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - createtestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/testorders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch datafeedstatuses request. + */ + export interface Schema$DatafeedstatusesCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The country for which to get the datafeed status. If this parameter is + * provided then language must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + country: string; + /** + * The ID of the data feed to get. + */ + datafeedId: string; + /** + * The language for which to get the datafeed status. If this parameter is + * provided then country must also be provided. Note that for multi-target + * datafeeds this parameter is required. + */ + language: string; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + } + export interface Schema$DatafeedstatusesCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$DatafeedstatusesCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedstatusesCustomBatchResponse". + */ + kind: string; } - - /** - * content.orders.custombatch - * @desc Retrieves or modifies multiple orders in a single request. - * @alias content.orders.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().OrdersCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/orders/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch datafeedstatuses response. + */ + export interface Schema$DatafeedstatusesCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * The requested data feed status. Defined if and only if the request was + * successful. + */ + datafeedStatus: Schema$DatafeedStatus; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + } + export interface Schema$DatafeedstatusesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#datafeedstatusesListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of datafeed statuses. + */ + nextPageToken: string; + resources: Schema$DatafeedStatus[]; } - - /** - * content.orders.get - * @desc Retrieves an order from your Merchant Center account. - * @alias content.orders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/orders/{orderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An example occurrence for a particular error. + */ + export interface Schema$DatafeedStatusExample { + /** + * The ID of the example item. + */ + itemId: string; + /** + * Line number in the data feed where the example is found. + */ + lineNumber: string; + /** + * The problematic value. + */ + value: string; + } + export interface Schema$DatafeedTarget { + /** + * The country where the items in the feed will be included in the search + * index, represented as a CLDR territory code. + */ + country: string; + /** + * The list of destinations to exclude for this target (corresponds to + * unchecked check boxes in Merchant Center). + */ + excludedDestinations: string[]; + /** + * The list of destinations to include for this target (corresponds to + * checked check boxes in Merchant Center). Default destinations are always + * included unless provided in the excluded_destination field. + */ + includedDestinations: string[]; + /** + * The two-letter ISO 639-1 language of the items in the feed. Must be a + * valid language for targets[].country. + */ + language: string; + } + export interface Schema$DeliveryTime { + /** + * Holiday cutoff definitions. If configured, they specify order cutoff + * times for holiday-specific shipping. + */ + holidayCutoffs: Schema$HolidayCutoff[]; + /** + * Maximum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Must be greater than or equal to + * minTransitTimeInDays. Required. + */ + maxTransitTimeInDays: number; + /** + * Minimum number of business days that is spent in transit. 0 means same + * day delivery, 1 means next day delivery. Required. + */ + minTransitTimeInDays: number; } - - /** - * content.orders.getbymerchantorderid - * @desc Retrieves an order using merchant order id. - * @alias content.orders.getbymerchantorderid - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.merchantOrderId The merchant order id to be looked for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getbymerchantorderid(params?: any, options?: MethodOptions): - AxiosPromise; - getbymerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - getbymerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/ordersbymerchantid/{merchantOrderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'merchantOrderId'], - pathParams: ['merchantId', 'merchantOrderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * An error returned by the API. + */ + export interface Schema$Error { + /** + * The domain of the error. + */ + domain: string; + /** + * A description of the error. + */ + message: string; + /** + * The error code. + */ + reason: string; } - - /** - * content.orders.gettestordertemplate - * @desc Sandbox only. Retrieves an order template that can be used to quickly - * create a new order in sandbox. - * @alias content.orders.gettestordertemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. - * @param {string} params.templateName The name of the template to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - gettestordertemplate(params?: any, options?: MethodOptions): - AxiosPromise; - gettestordertemplate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - gettestordertemplate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/testordertemplates/{templateName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'templateName'], - pathParams: ['merchantId', 'templateName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A list of errors returned by a failed batch entry. + */ + export interface Schema$Errors { + /** + * The HTTP status of the first error in errors. + */ + code: number; + /** + * A list of errors. + */ + errors: Schema$Error[]; + /** + * The message of the first error in errors. + */ + message: string; + } + export interface Schema$GmbAccounts { + /** + * The ID of the account. + */ + accountId: string; + /** + * A list of GMB accounts which are available to the merchant. + */ + gmbAccounts: Schema$GmbAccountsGmbAccount[]; + } + export interface Schema$GmbAccountsGmbAccount { + /** + * The email which identifies the GMB account. + */ + email: string; + /** + * Number of listings under this account. + */ + listingCount: string; + /** + * The name of the GMB account. + */ + name: string; + /** + * The type of the GMB account (User or Business). + */ + type: string; } - - /** - * content.orders.instorerefundlineitem - * @desc Notifies that item return and refund was handled directly in store. - * @alias content.orders.instorerefundlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersInStoreRefundLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instorerefundlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - instorerefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - instorerefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/inStoreRefundLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A non-empty list of row or column headers for a table. Exactly one of + * prices, weights, numItems, postalCodeGroupNames, or locations must be set. + */ + export interface Schema$Headers { + /** + * A list of location ID sets. Must be non-empty. Can only be set if all + * other fields are not set. + */ + locations: Schema$LocationIdSet[]; + /** + * A list of inclusive number of items upper bounds. The last value can be + * "infinity". For example ["10", "50", + * "infinity"] represents the headers "<= 10 items", + * " 50 items". Must be non-empty. Can only be set if all other + * fields are not set. + */ + numberOfItems: string[]; + /** + * A list of postal group names. The last value can be "all other + * locations". Example: ["zone 1", "zone 2", + * "all other locations"]. The referred postal code groups must + * match the delivery country of the service. Must be non-empty. Can only be + * set if all other fields are not set. + */ + postalCodeGroupNames: string[]; + /** + * A list of inclusive order price upper bounds. The last price's value + * can be "infinity". For example [{"value": + * "10", "currency": "USD"}, + * {"value": "500", "currency": + * "USD"}, {"value": "infinity", + * "currency": "USD"}] represents the headers + * "<= $10", " $500". All prices within a service + * must have the same currency. Must be non-empty. Can only be set if all + * other fields are not set. + */ + prices: Schema$Price[]; + /** + * A list of inclusive order weight upper bounds. The last weight's + * value can be "infinity". For example [{"value": + * "10", "unit": "kg"}, {"value": + * "50", "unit": "kg"}, {"value": + * "infinity", "unit": "kg"}] represents the + * headers "<= 10kg", " 50kg". All weights within a + * service must have the same unit. Must be non-empty. Can only be set if + * all other fields are not set. + */ + weights: Schema$Weight[]; + } + export interface Schema$HolidayCutoff { + /** + * Date of the order deadline, in ISO 8601 format. E.g. + * "2016-11-29" for 29th November 2016. Required. + */ + deadlineDate: string; + /** + * Hour of the day on the deadline date until which the order has to be + * placed to qualify for the delivery guarantee. Possible values are: 0 + * (midnight), 1, ..., 12 (noon), 13, ..., 23. Required. + */ + deadlineHour: number; + /** + * Timezone identifier for the deadline hour. A list of identifiers can be + * found in the AdWords API documentation. E.g. "Europe/Zurich". + * Required. + */ + deadlineTimezone: string; + /** + * Unique identifier for the holiday. Required. + */ + holidayId: string; + /** + * Date on which the deadline will become visible to consumers in ISO 8601 + * format. E.g. "2016-10-31" for 31st October 2016. Required. + */ + visibleFromDate: string; + } + export interface Schema$HolidaysHoliday { + /** + * The CLDR territory code of the country in which the holiday is available. + * E.g. "US", "DE", "GB". A holiday cutoff can + * only be configured in a shipping settings service with matching delivery + * country. Always present. + */ + countryCode: string; + /** + * Date of the holiday, in ISO 8601 format. E.g. "2016-12-25" for + * Christmas 2016. Always present. + */ + date: string; + /** + * Date on which the order has to arrive at the customer's, in ISO 8601 + * format. E.g. "2016-12-24" for 24th December 2016. Always + * present. + */ + deliveryGuaranteeDate: string; + /** + * Hour of the day in the delivery location's timezone on the guaranteed + * delivery date by which the order has to arrive at the customer's. + * Possible values are: 0 (midnight), 1, ..., 12 (noon), 13, ..., 23. Always + * present. + */ + deliveryGuaranteeHour: string; + /** + * Unique identifier for the holiday to be used when configuring holiday + * cutoffs. Always present. + */ + id: string; + /** + * The holiday type. Always present. + */ + type: string; + } + export interface Schema$Installment { + /** + * The amount the buyer has to pay per month. + */ + amount: Schema$Price; + /** + * The number of installments the buyer has to pay. + */ + months: string; + } + export interface Schema$Inventory { + /** + * The availability of the product. + */ + availability: string; + /** + * Number and amount of installments to pay for an item. Brazil only. + */ + installment: Schema$Installment; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#inventory". + */ + kind: string; + /** + * Loyalty points that users receive after purchasing the item. Japan only. + */ + loyaltyPoints: Schema$LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting + * pickup means "don't update" while setting it to the empty + * value ({} in JSON) means "delete". Otherwise, pickupMethod and + * pickupSla must be set together, unless pickupMethod is "not + * supported". + */ + pickup: Schema$InventoryPickup; + /** + * The price of the product. + */ + price: Schema$Price; + /** + * The quantity of the product. Must be equal to or greater than zero. + * Supported only for local products. + */ + quantity: number; + /** + * The sale price of the product. Mandatory if sale_price_effective_date is + * defined. + */ + salePrice: Schema$Price; + /** + * A date range represented by a pair of ISO 8601 dates separated by a + * space, comma, or slash. Both dates might be specified as 'null' + * if undecided. + */ + salePriceEffectiveDate: string; + /** + * The quantity of the product that is reserved for sell-on-google ads. + * Supported only for online products. + */ + sellOnGoogleQuantity: number; + } + export interface Schema$InventoryCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$InventoryCustomBatchRequestEntry[]; } - - /** - * content.orders.list - * @desc Lists the orders in your Merchant Center account. - * @alias content.orders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledged Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. - * @param {integer=} params.maxResults The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. Known issue: All List calls will return all Orders without limit regardless of the value of this field. - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string=} params.orderBy The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string=} params.placedDateEnd Obtains orders placed before this date (exclusively), in ISO 8601 format. - * @param {string=} params.placedDateStart Obtains orders placed after this date (inclusively), in ISO 8601 format. - * @param {string=} params.statuses Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/orders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch inventory request. + */ + export interface Schema$InventoryCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * Price and availability of the product. + */ + inventory: Schema$Inventory; + /** + * The ID of the managing account. + */ + merchantId: string; + /** + * The ID of the product for which to update price and availability. + */ + productId: string; + /** + * The code of the store for which to update price and availability. Use + * online to update price and availability of an online product. + */ + storeCode: string; + } + export interface Schema$InventoryCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$InventoryCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#inventoryCustomBatchResponse". + */ + kind: string; } - - /** - * content.orders.refund - * @desc Refund a portion of the order, up to the full amount paid. - * @alias content.orders.refund - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order to refund. - * @param {().OrdersRefundRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - refund(params?: any, options?: MethodOptions): - AxiosPromise; - refund( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - refund( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/orders/{orderId}/refund') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch inventory response. + */ + export interface Schema$InventoryCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#inventoryCustomBatchResponseEntry". + */ + kind: string; + } + export interface Schema$InventoryPickup { + /** + * Whether store pickup is available for this offer and whether the pickup + * option should be shown as buy, reserve, or not supported. Only supported + * for local inventory. Unless the value is "not supported", must + * be submitted together with pickupSla. + */ + pickupMethod: string; + /** + * The expected date that an order will be ready for pickup, relative to + * when the order is placed. Only supported for local inventory. Must be + * submitted together with pickupMethod. + */ + pickupSla: string; + } + export interface Schema$InventorySetRequest { + /** + * The availability of the product. + */ + availability: string; + /** + * Number and amount of installments to pay for an item. Brazil only. + */ + installment: Schema$Installment; + /** + * Loyalty points that users receive after purchasing the item. Japan only. + */ + loyaltyPoints: Schema$LoyaltyPoints; + /** + * Store pickup information. Only supported for local inventory. Not setting + * pickup means "don't update" while setting it to the empty + * value ({} in JSON) means "delete". Otherwise, pickupMethod and + * pickupSla must be set together, unless pickupMethod is "not + * supported". + */ + pickup: Schema$InventoryPickup; + /** + * The price of the product. + */ + price: Schema$Price; + /** + * The quantity of the product. Must be equal to or greater than zero. + * Supported only for local products. + */ + quantity: number; + /** + * The sale price of the product. Mandatory if sale_price_effective_date is + * defined. + */ + salePrice: Schema$Price; + /** + * A date range represented by a pair of ISO 8601 dates separated by a + * space, comma, or slash. Both dates might be specified as 'null' + * if undecided. + */ + salePriceEffectiveDate: string; + /** + * The quantity of the product that is reserved for sell-on-google ads. + * Supported only for online products. + */ + sellOnGoogleQuantity: number; + } + export interface Schema$InventorySetResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#inventorySetResponse". + */ + kind: string; + } + export interface Schema$LiaAboutPageSettings { + /** + * The status of the verification process for the About page. + */ + status: string; + /** + * The URL for the About page. + */ + url: string; + } + export interface Schema$LiaCountrySettings { + /** + * The settings for the About page. + */ + about: Schema$LiaAboutPageSettings; + /** + * CLDR country code (e.g. "US"). + */ + country: string; + /** + * The status of the "Merchant hosted local storefront" feature. + */ + hostedLocalStorefrontActive: boolean; + /** + * LIA inventory verification settings. + */ + inventory: Schema$LiaInventorySettings; + /** + * LIA "On Display To Order" settings. + */ + onDisplayToOrder: Schema$LiaOnDisplayToOrderSettings; + /** + * The status of the "Store pickup" feature. + */ + storePickupActive: boolean; + } + export interface Schema$LiaInventorySettings { + /** + * The email of the contact for the inventory verification process. + */ + inventoryVerificationContactEmail: string; + /** + * The name of the contact for the inventory verification process. + */ + inventoryVerificationContactName: string; + /** + * The status of the verification contact. + */ + inventoryVerificationContactStatus: string; + /** + * The status of the inventory verification process. + */ + status: string; + } + export interface Schema$LiaOnDisplayToOrderSettings { + /** + * Shipping cost and policy URL. + */ + shippingCostPolicyUrl: string; + /** + * The status of the ?On display to order? feature. + */ + status: string; + } + export interface Schema$LiaSettings { + /** + * The ID of the account to which these LIA settings belong. Ignored upon + * update, always present in get request responses. + */ + accountId: string; + /** + * The LIA settings for each country. + */ + countrySettings: Schema$LiaCountrySettings[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liaSettings". + */ + kind: string; + } + export interface Schema$LiasettingsCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$LiasettingsCustomBatchRequestEntry[]; + } + export interface Schema$LiasettingsCustomBatchRequestEntry { + /** + * The ID of the account for which to get/update account shipping settings. + */ + accountId: string; + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * Inventory validation contact email. Required only for + * SetInventoryValidationContact. + */ + contactEmail: string; + /** + * Inventory validation contact name. Required only for + * SetInventoryValidationContact. + */ + contactName: string; + /** + * The country code. Required only for RequestInventoryVerification. + */ + country: string; + /** + * The GMB account. Required only for RequestGmbAccess. + */ + gmbEmail: string; + /** + * The account Lia settings to update. Only defined if the method is update. + */ + liaSettings: Schema$LiaSettings; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + } + export interface Schema$LiasettingsCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$LiasettingsCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsCustomBatchResponse". + */ + kind: string; + } + export interface Schema$LiasettingsCustomBatchResponseEntry { + /** + * The ID of the request entry to which this entry responds. + */ + batchId: number; + /** + * A list of errors defined if, and only if, the request failed. + */ + errors: Schema$Errors; + /** + * The the list of accessible GMB accounts. + */ + gmbAccounts: Schema$GmbAccounts; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsCustomBatchResponseEntry". + */ + kind: string; + /** + * The retrieved or updated Lia settings. + */ + liaSettings: Schema$LiaSettings; + } + export interface Schema$LiasettingsGetAccessibleGmbAccountsResponse { + /** + * The ID of the account. + */ + accountId: string; + /** + * A list of GMB accounts which are available to the merchant. + */ + gmbAccounts: Schema$GmbAccountsGmbAccount[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsGetAccessibleGmbAccountsResponse". + */ + kind: string; + } + export interface Schema$LiasettingsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of LIA settings. + */ + nextPageToken: string; + resources: Schema$LiaSettings[]; + } + export interface Schema$LiasettingsRequestGmbAccessResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsRequestGmbAccessResponse". + */ + kind: string; + } + export interface Schema$LiasettingsRequestInventoryVerificationResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsRequestInventoryVerificationResponse". + */ + kind: string; + } + export interface Schema$LiasettingsSetInventoryVerificationContactResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#liasettingsSetInventoryVerificationContactResponse". + */ + kind: string; + } + export interface Schema$LocationIdSet { + /** + * A non-empty list of location IDs. They must all be of the same location + * type (e.g., state). + */ + locationIds: string[]; + } + export interface Schema$LoyaltyPoints { + /** + * Name of loyalty points program. It is recommended to limit the name to 12 + * full-width characters or 24 Roman characters. + */ + name: string; + /** + * The retailer's loyalty points in absolute value. + */ + pointsValue: string; + /** + * The ratio of a point when converted to currency. Google assumes currency + * based on Merchant Center settings. If ratio is left out, it defaults + * to 1.0. + */ + ratio: number; + } + export interface Schema$Order { + /** + * Whether the order was acknowledged. + */ + acknowledged: boolean; + /** + * The channel type of the order: "purchaseOnGoogle" or + * "googleExpress". + */ + channelType: string; + /** + * The details of the customer who placed the order. + */ + customer: Schema$OrderCustomer; + /** + * The details for the delivery. + */ + deliveryDetails: Schema$OrderDeliveryDetails; + /** + * The REST id of the order. Globally unique. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#order". + */ + kind: string; + /** + * Line items that are ordered. + */ + lineItems: Schema$OrderLineItem[]; + merchantId: string; + /** + * Merchant-provided id of the order. + */ + merchantOrderId: string; + /** + * The net amount for the order. For example, if an order was originally for + * a grand total of $100 and a refund was issued for $20, the net amount + * will be $80. + */ + netAmount: Schema$Price; + /** + * The details of the payment method. + */ + paymentMethod: Schema$OrderPaymentMethod; + /** + * The status of the payment. + */ + paymentStatus: string; + /** + * The date when the order was placed, in ISO 8601 format. + */ + placedDate: string; + /** + * The details of the merchant provided promotions applied to the order. + * More details about the program are here. + */ + promotions: Schema$OrderPromotion[]; + /** + * Refunds for the order. + */ + refunds: Schema$OrderRefund[]; + /** + * Shipments of the order. + */ + shipments: Schema$OrderShipment[]; + /** + * The total cost of shipping for all items. + */ + shippingCost: Schema$Price; + /** + * The tax for the total shipping cost. + */ + shippingCostTax: Schema$Price; + /** + * The requested shipping option. + */ + shippingOption: string; + /** + * The status of the order. + */ + status: string; + } + export interface Schema$OrderAddress { + /** + * CLDR country code (e.g. "US"). + */ + country: string; + /** + * Strings representing the lines of the printed label for mailing the + * order, for example: John Smith 1600 Amphitheatre Parkway Mountain View, + * CA, 94043 United States + */ + fullAddress: string[]; + /** + * Whether the address is a post office box. + */ + isPostOfficeBox: boolean; + /** + * City, town or commune. May also include dependent localities or + * sublocalities (e.g. neighborhoods or suburbs). + */ + locality: string; + /** + * Postal Code or ZIP (e.g. "94043"). + */ + postalCode: string; + /** + * Name of the recipient. + */ + recipientName: string; + /** + * Top-level administrative subdivision of the country (e.g. + * "CA"). + */ + region: string; + /** + * Street-level part of the address. + */ + streetAddress: string[]; + } + export interface Schema$OrderCancellation { + /** + * The actor that created the cancellation. + */ + actor: string; + /** + * Date on which the cancellation has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * The quantity that was canceled. + */ + quantity: number; + /** + * The reason for the cancellation. Orders that are cancelled with a + * noInventory reason will lead to the removal of the product from POG until + * you make an update to that product. This will not affect your Shopping + * ads. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrderCustomer { + /** + * Email address that should be used for order related communications. In + * certain cases this might not be a real users email, but a proxy email. + */ + email: string; + /** + * Deprecated. Please use marketingRightsInfo instead. + */ + explicitMarketingPreference: boolean; + /** + * Full name of the customer. + */ + fullName: string; + /** + * Customer's marketing preferences. + */ + marketingRightsInfo: Schema$OrderCustomerMarketingRightsInfo; + } + export interface Schema$OrderCustomerMarketingRightsInfo { + /** + * Last known user selection regarding marketing preferences. In certain + * cases this selection might not be known, so this field would be empty. + */ + explicitMarketingPreference: string; + /** + * Timestamp when last time marketing preference was updated. Could be + * empty, if user wasn't offered a selection yet. + */ + lastUpdatedTimestamp: string; + /** + * Email address that can be used for marketing purposes. This field is only + * filled when explicitMarketingPreference is equal to 'granted'. + */ + marketingEmailAddress: string; + } + export interface Schema$OrderDeliveryDetails { + /** + * The delivery address + */ + address: Schema$OrderAddress; + /** + * The phone number of the person receiving the delivery. + */ + phoneNumber: string; + } + export interface Schema$OrderLineItem { + /** + * Annotations that are attached to the line item. + */ + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * Cancellations of the line item. + */ + cancellations: Schema$OrderCancellation[]; + /** + * The id of the line item. + */ + id: string; + /** + * Total price for the line item. For example, if two items for $10 are + * purchased, the total price will be $20. + */ + price: Schema$Price; + /** + * Product data from the time of the order placement. + */ + product: Schema$OrderLineItemProduct; + /** + * Number of items canceled. + */ + quantityCanceled: number; + /** + * Number of items delivered. + */ + quantityDelivered: number; + /** + * Number of items ordered. + */ + quantityOrdered: number; + /** + * Number of items pending. + */ + quantityPending: number; + /** + * Number of items returned. + */ + quantityReturned: number; + /** + * Number of items shipped. + */ + quantityShipped: number; + /** + * Details of the return policy for the line item. + */ + returnInfo: Schema$OrderLineItemReturnInfo; + /** + * Returns of the line item. + */ + returns: Schema$OrderReturn[]; + /** + * Details of the requested shipping for the line item. + */ + shippingDetails: Schema$OrderLineItemShippingDetails; + /** + * Total tax amount for the line item. For example, if two items are + * purchased, and each have a cost tax of $2, the total tax amount will be + * $4. + */ + tax: Schema$Price; + } + export interface Schema$OrderLineItemProduct { + /** + * Brand of the item. + */ + brand: string; + /** + * The item's channel (online or local). + */ + channel: string; + /** + * Condition or state of the item. + */ + condition: string; + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number (GTIN) of the item. + */ + gtin: string; + /** + * The REST id of the product. + */ + id: string; + /** + * URL of an image of the item. + */ + imageLink: string; + /** + * Shared identifier for all variants of the same product. + */ + itemGroupId: string; + /** + * Manufacturer Part Number (MPN) of the item. + */ + mpn: string; + /** + * An identifier of the item. + */ + offerId: string; + /** + * Price of the item. + */ + price: Schema$Price; + /** + * URL to the cached image shown to the user when order was placed. + */ + shownImage: string; + /** + * The CLDR territory code of the target country of the product. + */ + targetCountry: string; + /** + * The title of the product. + */ + title: string; + /** + * Variant attributes for the item. These are dimensions of the product, + * such as color, gender, material, pattern, and size. You can find a + * comprehensive list of variant attributes here. + */ + variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; + } + export interface Schema$OrderLineItemProductVariantAttribute { + /** + * The dimension of the variant. + */ + dimension: string; + /** + * The value for the dimension. + */ + value: string; + } + export interface Schema$OrderLineItemReturnInfo { + /** + * How many days later the item can be returned. + */ + daysToReturn: number; + /** + * Whether the item is returnable. + */ + isReturnable: boolean; + /** + * URL of the item return policy. + */ + policyUrl: string; + } + export interface Schema$OrderLineItemShippingDetails { + /** + * The delivery by date, in ISO 8601 format. + */ + deliverByDate: string; + /** + * Details of the shipping method. + */ + method: Schema$OrderLineItemShippingDetailsMethod; + /** + * The ship by date, in ISO 8601 format. + */ + shipByDate: string; + } + export interface Schema$OrderLineItemShippingDetailsMethod { + /** + * The carrier for the shipping. Optional. See shipments[].carrier for a + * list of acceptable values. + */ + carrier: string; + /** + * Maximum transit time. + */ + maxDaysInTransit: number; + /** + * The name of the shipping method. + */ + methodName: string; + /** + * Minimum transit time. + */ + minDaysInTransit: number; + } + export interface Schema$OrderMerchantProvidedAnnotation { + /** + * Key for additional merchant provided (as key-value pairs) annotation + * about the line item. + */ + key: string; + /** + * Value for additional merchant provided (as key-value pairs) annotation + * about the line item. + */ + value: string; + } + export interface Schema$OrderPaymentMethod { + /** + * The billing address. + */ + billingAddress: Schema$OrderAddress; + /** + * The card expiration month (January = 1, February = 2 etc.). + */ + expirationMonth: number; + /** + * The card expiration year (4-digit, e.g. 2015). + */ + expirationYear: number; + /** + * The last four digits of the card number. + */ + lastFourDigits: string; + /** + * The billing phone number. + */ + phoneNumber: string; + /** + * The type of instrument. Acceptable values are: - "AMEX" - + * "DISCOVER" - "JCB" - "MASTERCARD" - + * "UNIONPAY" - "VISA" - "" + */ + type: string; + } + export interface Schema$OrderPromotion { + benefits: Schema$OrderPromotionBenefit[]; + /** + * The date and time frame when the promotion is active and ready for + * validation review. Note that the promotion live time may be delayed for a + * few hours due to the validation review. Start date and end date are + * separated by a forward slash (/). The start date is specified by the + * format (YYYY-MM-DD), followed by the letter ?T?, the time of the day when + * the sale starts (in Greenwich Mean Time, GMT), followed by an expression + * of the time zone for the sale. The end date is in the same format. + */ + effectiveDates: string; + /** + * Optional. The text code that corresponds to the promotion when applied on + * the retailer?s website. + */ + genericRedemptionCode: string; + /** + * The unique ID of the promotion. + */ + id: string; + /** + * The full title of the promotion. + */ + longTitle: string; + /** + * Whether the promotion is applicable to all products or only specific + * products. + */ + productApplicability: string; + /** + * Indicates that the promotion is valid online. + */ + redemptionChannel: string; + } + export interface Schema$OrderPromotionBenefit { + /** + * The discount in the order price when the promotion is applied. + */ + discount: Schema$Price; + /** + * The OfferId(s) that were purchased in this order and map to this specific + * benefit of the promotion. + */ + offerIds: string[]; + /** + * Further describes the benefit of the promotion. Note that we will expand + * on this enumeration as we support new promotion sub-types. + */ + subType: string; + /** + * The impact on tax when the promotion is applied. + */ + taxImpact: Schema$Price; + /** + * Describes whether the promotion applies to products (e.g. 20% off) or to + * shipping (e.g. Free Shipping). + */ + type: string; + } + export interface Schema$OrderRefund { + /** + * The actor that created the refund. + */ + actor: string; + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * Date on which the item has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrderReturn { + /** + * The actor that created the refund. + */ + actor: string; + /** + * Date on which the item has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * Quantity that is returned. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersAcknowledgeRequest { + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + } + export interface Schema$OrdersAcknowledgeResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersAcknowledgeResponse". + */ + kind: string; + } + export interface Schema$OrdersAdvanceTestOrderResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersAdvanceTestOrderResponse". + */ + kind: string; + } + export interface Schema$OrdersCancelLineItemRequest { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amount: Schema$Price; + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to cancellation amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to cancel. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to cancel. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to cancel. + */ + quantity: number; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCancelLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCancelLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersCancelRequest { + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCancelResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCancelResponse". + */ + kind: string; + } + export interface Schema$OrdersCreateTestOrderRequest { + /** + * The test order template to use. Specify as an alternative to testOrder as + * a shortcut for retrieving a template and then creating an order using + * that template. + */ + templateName: string; + /** + * The test order to create. + */ + testOrder: Schema$TestOrder; + } + export interface Schema$OrdersCreateTestOrderResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCreateTestOrderResponse". + */ + kind: string; + /** + * The ID of the newly created test order. + */ + orderId: string; + } + export interface Schema$OrdersCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$OrdersCustomBatchRequestEntry[]; + } + export interface Schema$OrdersCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * Required for cancel method. + */ + cancel: Schema$OrdersCustomBatchRequestEntryCancel; + /** + * Required for cancelLineItem method. + */ + cancelLineItem: Schema$OrdersCustomBatchRequestEntryCancelLineItem; + /** + * Required for inStoreReturnLineItem method. + */ + inStoreRefundLineItem: + Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem; + /** + * The ID of the managing account. + */ + merchantId: string; + /** + * The merchant order id. Required for updateMerchantOrderId and + * getByMerchantOrderId methods. + */ + merchantOrderId: string; + /** + * The method to apply. + */ + method: string; + /** + * The ID of the operation. Unique across all operations for a given order. + * Required for all methods beside get and getByMerchantOrderId. + */ + operationId: string; + /** + * The ID of the order. Required for all methods beside + * getByMerchantOrderId. + */ + orderId: string; + /** + * Required for refund method. + */ + refund: Schema$OrdersCustomBatchRequestEntryRefund; + /** + * Required for rejectReturnLineItem method. + */ + rejectReturnLineItem: + Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem; + /** + * Required for returnLineItem method. + */ + returnLineItem: Schema$OrdersCustomBatchRequestEntryReturnLineItem; + /** + * Required for returnRefundLineItem method. + */ + returnRefundLineItem: + Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem; + /** + * Required for setLineItemMetadata method. + */ + setLineItemMetadata: + Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata; + /** + * Required for shipLineItems method. + */ + shipLineItems: Schema$OrdersCustomBatchRequestEntryShipLineItems; + /** + * Required for updateLineItemShippingDate method. + */ + updateLineItemShippingDetails: + Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails; + /** + * Required for updateShipment method. + */ + updateShipment: Schema$OrdersCustomBatchRequestEntryUpdateShipment; + } + export interface Schema$OrdersCustomBatchRequestEntryCancel { + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryCancelLineItem { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amount: Schema$Price; + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to cancellation amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to cancel. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to cancel. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to cancel. + */ + quantity: number; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem { + /** + * The amount that is refunded. Required. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. Required. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryRefund { + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * The amount that is refunded. Either amount or amountPretax and amountTax + * should be filled. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryReturnLineItem { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem { + /** + * The amount that is refunded. Optional, but if filled then both + * amountPretax and amountTax must be set. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata { + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryShipLineItems { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the + * shipment. See shipments[].carrier in the Orders resource representation + * for a list of acceptable values. + */ + carrier: string; + /** + * Line items to ship. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * Deprecated. Please use shipmentInfo instead. The ID of the shipment. + */ + shipmentId: string; + /** + * Shipment information. This field is repeated because a single line item + * can be shipped in several packages (and have several tracking IDs). + */ + shipmentInfos: + Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** + * Deprecated. Please use shipmentInfo instead. The tracking id for the + * shipment. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /** + * The carrier handling the shipment. See shipments[].carrier in the Orders + * resource representation for a list of acceptable values. + */ + carrier: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * The tracking id for the shipment. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { + /** + * Updated delivery by date, in ISO 8601 format. If not specified only ship + * by date is updated. + */ + deliverByDate: string; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + /** + * Updated ship by date, in ISO 8601 format. If not specified only deliver + * by date is updated. + */ + shipByDate: string; + } + export interface Schema$OrdersCustomBatchRequestEntryUpdateShipment { + /** + * The carrier handling the shipment. Not updated if missing. See + * shipments[].carrier in the Orders resource representation for a list of + * acceptable values. + */ + carrier: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * New status for the shipment. Not updated if missing. + */ + status: string; + /** + * The tracking id for the shipment. Not updated if missing. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$OrdersCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCustomBatchResponse". + */ + kind: string; + } + export interface Schema$OrdersCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * The status of the execution. Only defined if the method is not get or + * getByMerchantOrderId and if the request was successful. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCustomBatchResponseEntry". + */ + kind: string; + /** + * The retrieved order. Only defined if the method is get and if the request + * was successful. + */ + order: Schema$Order; + } + export interface Schema$OrdersGetByMerchantOrderIdResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersGetByMerchantOrderIdResponse". + */ + kind: string; + /** + * The requested order. + */ + order: Schema$Order; + } + export interface Schema$OrdersGetTestOrderTemplateResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersGetTestOrderTemplateResponse". + */ + kind: string; + /** + * The requested test order template. + */ + template: Schema$TestOrder; + } + export interface Schema$OrderShipment { + /** + * The carrier handling the shipment. Acceptable values are: - + * "gsx" - "ups" - "usps" - + * "fedex" - "dhl" - "ecourier" - + * "cxt" - "google" - "ontrac" - + * "emsy" - "ont" - "deliv" - + * "dynamex" - "lasership" - "mpx" - + * "uds" + */ + carrier: string; + /** + * Date on which the shipment has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * Date on which the shipment has been delivered, in ISO 8601 format. + * Present only if status is delievered + */ + deliveryDate: string; + /** + * The id of the shipment. + */ + id: string; + /** + * The line items that are shipped. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * The status of the shipment. + */ + status: string; + /** + * The tracking id for the shipment. + */ + trackingId: string; + } + export interface Schema$OrderShipmentLineItemShipment { + /** + * The id of the line item that is shipped. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to ship. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity that is shipped. + */ + quantity: number; + } + export interface Schema$OrdersInStoreRefundLineItemRequest { + /** + * The amount that is refunded. Required. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. Required. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersInStoreRefundLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersInStoreRefundLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of orders. + */ + nextPageToken: string; + resources: Schema$Order[]; + } + export interface Schema$OrdersRefundRequest { + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * The amount that is refunded. Either amount or amountPretax and amountTax + * should be filled. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersRefundResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersRefundResponse". + */ + kind: string; + } + export interface Schema$OrdersRejectReturnLineItemRequest { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersRejectReturnLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersRejectReturnLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersReturnLineItemRequest { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersReturnLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersReturnLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersReturnRefundLineItemRequest { + /** + * The amount that is refunded. Optional, but if filled then both + * amountPretax and amountTax must be set. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersReturnRefundLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersReturnRefundLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersSetLineItemMetadataRequest { + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + } + export interface Schema$OrdersSetLineItemMetadataResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersSetLineItemMetadataResponse". + */ + kind: string; + } + export interface Schema$OrdersShipLineItemsRequest { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the + * shipment. See shipments[].carrier in the Orders resource representation + * for a list of acceptable values. + */ + carrier: string; + /** + * Line items to ship. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * Deprecated. Please use shipmentInfo instead. The ID of the shipment. + */ + shipmentId: string; + /** + * Shipment information. This field is repeated because a single line item + * can be shipped in several packages (and have several tracking IDs). + */ + shipmentInfos: + Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** + * Deprecated. Please use shipmentInfo instead. The tracking id for the + * shipment. + */ + trackingId: string; + } + export interface Schema$OrdersShipLineItemsResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersShipLineItemsResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateLineItemShippingDetailsRequest { + /** + * Updated delivery by date, in ISO 8601 format. If not specified only ship + * by date is updated. + */ + deliverByDate: string; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + /** + * Updated ship by date, in ISO 8601 format. If not specified only deliver + * by date is updated. + */ + shipByDate: string; + } + export interface Schema$OrdersUpdateLineItemShippingDetailsResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateLineItemShippingDetailsResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateMerchantOrderIdRequest { + /** + * The merchant order id to be assigned to the order. Must be unique per + * merchant. + */ + merchantOrderId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + } + export interface Schema$OrdersUpdateMerchantOrderIdResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateMerchantOrderIdResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateShipmentRequest { + /** + * The carrier handling the shipment. Not updated if missing. See + * shipments[].carrier in the Orders resource representation for a list of + * acceptable values. + */ + carrier: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * New status for the shipment. Not updated if missing. + */ + status: string; + /** + * The tracking id for the shipment. Not updated if missing. + */ + trackingId: string; } - - - /** - * content.orders.rejectreturnlineitem - * @desc Rejects return on an line item. - * @alias content.orders.rejectreturnlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersRejectReturnLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rejectreturnlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - rejectreturnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - rejectreturnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/rejectReturnLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$OrdersUpdateShipmentResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateShipmentResponse". + */ + kind: string; } - - - /** - * content.orders.returnlineitem - * @desc Returns a line item. - * @alias content.orders.returnlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersReturnLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - returnlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - returnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - returnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/returnLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PosCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$PosCustomBatchRequestEntry[]; } - - - /** - * content.orders.returnrefundlineitem - * @desc Returns and refunds a line item. Note that this method can only be - * called on fully shipped orders. - * @alias content.orders.returnrefundlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersReturnRefundLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - returnrefundlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - returnrefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - returnrefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/returnRefundLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$PosCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The inventory to submit. Set this only if the method is inventory. + */ + inventory: Schema$PosInventory; + /** + * The ID of the POS provider. + */ + merchantId: string; + method: string; + /** + * The sale information to submit. Set this only if the method is sale. + */ + sale: Schema$PosSale; + /** + * The store information to submit. Set this only if the method is insert. + */ + store: Schema$PosStore; + /** + * The store code. Set this only if the method is delete or get. + */ + storeCode: string; + /** + * The ID of the account for which to get/submit data. + */ + targetMerchantId: string; } - - - /** - * content.orders.setlineitemmetadata - * @desc Sets (overrides) merchant provided annotations on the line item. - * @alias content.orders.setlineitemmetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersSetLineItemMetadataRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setlineitemmetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setlineitemmetadata( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - setlineitemmetadata( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/setLineItemMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$PosCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$PosCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posCustomBatchResponse". + */ + kind: string; } - - - /** - * content.orders.shiplineitems - * @desc Marks line item(s) as shipped. - * @alias content.orders.shiplineitems - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersShipLineItemsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - shiplineitems(params?: any, options?: MethodOptions): - AxiosPromise; - shiplineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - shiplineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/shipLineItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PosCustomBatchResponseEntry { + /** + * The ID of the request entry to which this entry responds. + */ + batchId: number; + /** + * A list of errors defined if, and only if, the request failed. + */ + errors: Schema$Errors; + /** + * The updated inventory information. + */ + inventory: Schema$PosInventory; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posCustomBatchResponseEntry". + */ + kind: string; + /** + * The updated sale information. + */ + sale: Schema$PosSale; + /** + * The retrieved or updated store information. + */ + store: Schema$PosStore; } - - /** - * content.orders.updatelineitemshippingdetails - * @desc Updates ship by and delivery by dates for a line item. - * @alias content.orders.updatelineitemshippingdetails - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateLineItemShippingDetailsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatelineitemshippingdetails(params?: any, options?: MethodOptions): - AxiosPromise; - updatelineitemshippingdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$OrdersUpdateLineItemShippingDetailsResponse>): void; - updatelineitemshippingdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$OrdersUpdateLineItemShippingDetailsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/updateLineItemShippingDetails') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$OrdersUpdateLineItemShippingDetailsResponse>(parameters); - } + * The absolute quantity of an item available at the given store. + */ + export interface Schema$PosInventory { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posInventory". + */ + kind: string; + /** + * The current price of the item. + */ + price: Schema$Price; + /** + * The available quantity of the item. + */ + quantity: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; } - - - /** - * content.orders.updatemerchantorderid - * @desc Updates the merchant order ID for a given order. - * @alias content.orders.updatemerchantorderid - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateMerchantOrderIdRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatemerchantorderid(params?: any, options?: MethodOptions): - AxiosPromise; - updatemerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - updatemerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/updateMerchantOrderId') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$PosInventoryRequest { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * The current price of the item. + */ + price: Schema$Price; + /** + * The available quantity of the item. + */ + quantity: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; + } + export interface Schema$PosInventoryResponse { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posInventoryResponse". + */ + kind: string; + /** + * The current price of the item. + */ + price: Schema$Price; + /** + * The available quantity of the item. + */ + quantity: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; + } + export interface Schema$PosListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posListResponse". + */ + kind: string; + resources: Schema$PosStore[]; } - - /** - * content.orders.updateshipment - * @desc Updates a shipment's status, carrier, and/or tracking ID. - * @alias content.orders.updateshipment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateShipmentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateshipment(params?: any, options?: MethodOptions): - AxiosPromise; - updateshipment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - updateshipment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/orders/{orderId}/updateShipment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The change of the available quantity of an item at the given store. + */ + export interface Schema$PosSale { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posSale". + */ + kind: string; + /** + * The price of the item. + */ + price: Schema$Price; + /** + * The relative change of the available quantity. Negative for items sold. + */ + quantity: string; + /** + * A unique ID to group items from the same sale event. + */ + saleId: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; } -} - -export class Resource$Pos { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$PosSaleRequest { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * The price of the item. + */ + price: Schema$Price; + /** + * The relative change of the available quantity. Negative for items sold. + */ + quantity: string; + /** + * A unique ID to group items from the same sale event. + */ + saleId: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; } - - getRoot() { - return this.root; + export interface Schema$PosSaleResponse { + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number. + */ + gtin: string; + /** + * A unique identifier for the item. + */ + itemId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posSaleResponse". + */ + kind: string; + /** + * The price of the item. + */ + price: Schema$Price; + /** + * The relative change of the available quantity. Negative for items sold. + */ + quantity: string; + /** + * A unique ID to group items from the same sale event. + */ + saleId: string; + /** + * The identifier of the merchant's store. Either a storeCode inserted + * via the API or the code of the store in Google My Business. + */ + storeCode: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * The inventory timestamp, in ISO 8601 format. + */ + timestamp: string; } - - /** - * content.pos.custombatch - * @desc Batches multiple POS-related calls in a single request. - * @alias content.pos.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().PosCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/pos/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Store resource. + */ + export interface Schema$PosStore { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#posStore". + */ + kind: string; + /** + * The street address of the store. + */ + storeAddress: string; + /** + * A store identifier that is unique for the given merchant. + */ + storeCode: string; } - - - /** - * content.pos.delete - * @desc Deletes a store for the given merchant. - * @alias content.pos.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.storeCode A store code that is unique per merchant. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/store/{storeCode}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId', 'storeCode'], - pathParams: ['merchantId', 'storeCode', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostalCodeGroup { + /** + * The CLDR territory code of the country the postal code group applies to. + * Required. + */ + country: string; + /** + * The name of the postal code group, referred to in headers. Required. + */ + name: string; + /** + * A range of postal codes. Required. + */ + postalCodeRanges: Schema$PostalCodeRange[]; } - - - /** - * content.pos.get - * @desc Retrieves information about the given store. - * @alias content.pos.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.storeCode A store code that is unique per merchant. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/store/{storeCode}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId', 'storeCode'], - pathParams: ['merchantId', 'storeCode', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PostalCodeRange { + /** + * A postal code or a pattern of the form prefix* denoting the inclusive + * lower bound of the range defining the area. Examples values: + * "94108", "9410*", "9*". Required. + */ + postalCodeRangeBegin: string; + /** + * A postal code or a pattern of the form prefix* denoting the inclusive + * upper bound of the range defining the area. It must have the same length + * as postalCodeRangeBegin: if postalCodeRangeBegin is a postal code then + * postalCodeRangeEnd must be a postal code too; if postalCodeRangeBegin is + * a pattern then postalCodeRangeEnd must be a pattern with the same prefix + * length. Optional: if not set, then the area is defined as being all the + * postal codes matching postalCodeRangeBegin. + */ + postalCodeRangeEnd: string; + } + export interface Schema$Price { + /** + * The currency of the price. + */ + currency: string; + /** + * The price represented as a number. + */ + value: string; } - - /** - * content.pos.insert - * @desc Creates a store for the given merchant. - * @alias content.pos.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {().PosStore} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/store') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId'], - pathParams: ['merchantId', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Product data. + */ + export interface Schema$Product { + /** + * Additional URLs of images of the item. + */ + additionalImageLinks: string[]; + /** + * Additional categories of the item (formatted as in products feed + * specification). + */ + additionalProductTypes: string[]; + /** + * Set to true if the item is targeted towards adults. + */ + adult: boolean; + /** + * Used to group items in an arbitrary way. Only for CPA%, discouraged + * otherwise. + */ + adwordsGrouping: string; + /** + * Similar to adwords_grouping, but only works on CPC. + */ + adwordsLabels: string[]; + /** + * Allows advertisers to override the item URL when the product is shown + * within the context of Product Ads. + */ + adwordsRedirect: string; + /** + * Target age group of the item. + */ + ageGroup: string; + /** + * Specifies the intended aspects for the product. + */ + aspects: Schema$ProductAspect[]; + /** + * Availability status of the item. + */ + availability: string; + /** + * The day a pre-ordered product becomes available for delivery, in ISO 8601 + * format. + */ + availabilityDate: string; + /** + * Brand of the item. + */ + brand: string; + /** + * The item's channel (online or local). + */ + channel: string; + /** + * Color of the item. + */ + color: string; + /** + * Condition or state of the item. + */ + condition: string; + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * A list of custom (merchant-provided) attributes. It can also be used for + * submitting any attribute of the feed specification in its generic form + * (e.g., { "name": "size type", "type": + * "text", "value": "regular" }). This is + * useful for submitting attributes not explicitly exposed by the API. + */ + customAttributes: Schema$ProductCustomAttribute[]; + /** + * A list of custom (merchant-provided) custom attribute groups. + */ + customGroups: Schema$ProductCustomGroup[]; + /** + * Custom label 0 for custom grouping of items in a Shopping campaign. + */ + customLabel0: string; + /** + * Custom label 1 for custom grouping of items in a Shopping campaign. + */ + customLabel1: string; + /** + * Custom label 2 for custom grouping of items in a Shopping campaign. + */ + customLabel2: string; + /** + * Custom label 3 for custom grouping of items in a Shopping campaign. + */ + customLabel3: string; + /** + * Custom label 4 for custom grouping of items in a Shopping campaign. + */ + customLabel4: string; + /** + * Description of the item. + */ + description: string; + /** + * Specifies the intended destinations for the product. + */ + destinations: Schema$ProductDestination[]; + /** + * An identifier for an item for dynamic remarketing campaigns. + */ + displayAdsId: string; + /** + * URL directly to your item's landing page for dynamic remarketing + * campaigns. + */ + displayAdsLink: string; + /** + * Advertiser-specified recommendations. + */ + displayAdsSimilarIds: string[]; + /** + * Title of an item for dynamic remarketing campaigns. + */ + displayAdsTitle: string; + /** + * Offer margin for dynamic remarketing campaigns. + */ + displayAdsValue: number; + /** + * The energy efficiency class as defined in EU directive 2010/30/EU. + */ + energyEfficiencyClass: string; + /** + * Date on which the item should expire, as specified upon insertion, in ISO + * 8601 format. The actual expiration date in Google Shopping is exposed in + * productstatuses as googleExpirationDate and might be earlier if + * expirationDate is too far in the future. + */ + expirationDate: string; + /** + * Target gender of the item. + */ + gender: string; + /** + * Google's category of the item (see Google product taxonomy). + */ + googleProductCategory: string; + /** + * Global Trade Item Number (GTIN) of the item. + */ + gtin: string; + /** + * The REST id of the product. Content API methods that operate on products + * take this as their productId parameter. The REST id for a product is of + * the form channel:contentLanguage:targetCountry:offerId. + */ + id: string; + /** + * False when the item does not have unique product identifiers appropriate + * to its category, such as GTIN, MPN, and brand. Required according to the + * Unique Product Identifier Rules for all target countries except for + * Canada. + */ + identifierExists: boolean; + /** + * URL of an image of the item. + */ + imageLink: string; + /** + * Number and amount of installments to pay for an item. Brazil only. + */ + installment: Schema$Installment; + /** + * Whether the item is a merchant-defined bundle. A bundle is a custom + * grouping of different products sold by a merchant for a single price. + */ + isBundle: boolean; + /** + * Shared identifier for all variants of the same product. + */ + itemGroupId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#product". + */ + kind: string; + /** + * URL directly linking to your item's page on your website. + */ + link: string; + /** + * Loyalty points that users receive after purchasing the item. Japan only. + */ + loyaltyPoints: Schema$LoyaltyPoints; + /** + * The material of which the item is made. + */ + material: string; + /** + * Maximal product handling time (in business days). + */ + maxHandlingTime: string; + /** + * Minimal product handling time (in business days). + */ + minHandlingTime: string; + /** + * Link to a mobile-optimized version of the landing page. + */ + mobileLink: string; + /** + * Manufacturer Part Number (MPN) of the item. + */ + mpn: string; + /** + * The number of identical products in a merchant-defined multipack. + */ + multipack: string; + /** + * A unique identifier for the item. Leading and trailing whitespaces are + * stripped and multiple whitespaces are replaced by a single whitespace + * upon submission. Only valid unicode characters are accepted. See the + * products feed specification for details. Note: Content API methods that + * operate on products take the REST id of the product, not this identifier. + */ + offerId: string; + /** + * Whether an item is available for purchase only online. + */ + onlineOnly: boolean; + /** + * The item's pattern (e.g. polka dots). + */ + pattern: string; + /** + * Price of the item. + */ + price: Schema$Price; + /** + * Your category of the item (formatted as in products feed specification). + */ + productType: string; + /** + * The unique ID of a promotion. + */ + promotionIds: string[]; + /** + * Advertised sale price of the item. + */ + salePrice: Schema$Price; + /** + * Date range during which the item is on sale (see products feed + * specification). + */ + salePriceEffectiveDate: string; + /** + * The quantity of the product that is reserved for sell-on-google ads. + */ + sellOnGoogleQuantity: string; + /** + * Shipping rules. + */ + shipping: Schema$ProductShipping[]; + /** + * Height of the item for shipping. + */ + shippingHeight: Schema$ProductShippingDimension; + /** + * The shipping label of the product, used to group product in account-level + * shipping rules. + */ + shippingLabel: string; + /** + * Length of the item for shipping. + */ + shippingLength: Schema$ProductShippingDimension; + /** + * Weight of the item for shipping. + */ + shippingWeight: Schema$ProductShippingWeight; + /** + * Width of the item for shipping. + */ + shippingWidth: Schema$ProductShippingDimension; + /** + * Size of the item. + */ + sizes: string[]; + /** + * System in which the size is specified. Recommended for apparel items. + */ + sizeSystem: string; + /** + * The cut of the item. Recommended for apparel items. + */ + sizeType: string; + /** + * The CLDR territory code for the item. + */ + targetCountry: string; + /** + * Tax information. + */ + taxes: Schema$ProductTax[]; + /** + * Title of the item. + */ + title: string; + /** + * The preference of the denominator of the unit price. + */ + unitPricingBaseMeasure: Schema$ProductUnitPricingBaseMeasure; + /** + * The measure and dimension of an item. + */ + unitPricingMeasure: Schema$ProductUnitPricingMeasure; + /** + * The read-only list of intended destinations which passed validation. + */ + validatedDestinations: string[]; + /** + * Read-only warnings. + */ + warnings: Schema$Error[]; + } + export interface Schema$ProductAspect { + /** + * The name of the aspect. + */ + aspectName: string; + /** + * The name of the destination. Leave out to apply to all destinations. + */ + destinationName: string; + /** + * Whether the aspect is required, excluded or should be validated. + */ + intention: string; + } + export interface Schema$ProductCustomAttribute { + /** + * The name of the attribute. Underscores will be replaced by spaces upon + * insertion. + */ + name: string; + /** + * The type of the attribute. + */ + type: string; + /** + * Free-form unit of the attribute. Unit can only be used for values of type + * INT or FLOAT. + */ + unit: string; + /** + * The value of the attribute. + */ + value: string; + } + export interface Schema$ProductCustomGroup { + /** + * The sub-attributes. + */ + attributes: Schema$ProductCustomAttribute[]; + /** + * The name of the group. Underscores will be replaced by spaces upon + * insertion. + */ + name: string; + } + export interface Schema$ProductDestination { + /** + * The name of the destination. + */ + destinationName: string; + /** + * Whether the destination is required, excluded or should be validated. + */ + intention: string; + } + export interface Schema$ProductsCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$ProductsCustomBatchRequestEntry[]; } - - /** - * content.pos.inventory - * @desc Submit inventory for the given merchant. - * @alias content.pos.inventory - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {().PosInventoryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - inventory(params?: any, options?: MethodOptions): - AxiosPromise; - inventory( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - inventory( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/inventory') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId'], - pathParams: ['merchantId', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch products request. + */ + export interface Schema$ProductsCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + /** + * The product to insert. Only required if the method is insert. + */ + product: Schema$Product; + /** + * The ID of the product to get or delete. Only defined if the method is get + * or delete. + */ + productId: string; + } + export interface Schema$ProductsCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$ProductsCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productsCustomBatchResponse". + */ + kind: string; } - - /** - * content.pos.list - * @desc Lists the stores of the target merchant. - * @alias content.pos.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/store') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId'], - pathParams: ['merchantId', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch products response. + */ + export interface Schema$ProductsCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productsCustomBatchResponseEntry". + */ + kind: string; + /** + * The inserted product. Only defined if the method is insert and if the + * request was successful. + */ + product: Schema$Product; + } + export interface Schema$ProductShipping { + /** + * The CLDR territory code of the country to which an item will ship. + */ + country: string; + /** + * The location where the shipping is applicable, represented by a location + * group name. + */ + locationGroupName: string; + /** + * The numeric id of a location that the shipping rate applies to as defined + * in the AdWords API. + */ + locationId: string; + /** + * The postal code range that the shipping rate applies to, represented by a + * postal code, a postal code prefix followed by a * wildcard, a range + * between two postal codes or two postal code prefixes of equal length. + */ + postalCode: string; + /** + * Fixed shipping price, represented as a number. + */ + price: Schema$Price; + /** + * The geographic region to which a shipping rate applies. + */ + region: string; + /** + * A free-form description of the service class or delivery speed. + */ + service: string; + } + export interface Schema$ProductShippingDimension { + /** + * The unit of value. Acceptable values are: - "cm" - + * "in" + */ + unit: string; + /** + * The dimension of the product used to calculate the shipping cost of the + * item. + */ + value: number; + } + export interface Schema$ProductShippingWeight { + /** + * The unit of value. + */ + unit: string; + /** + * The weight of the product used to calculate the shipping cost of the + * item. + */ + value: number; + } + export interface Schema$ProductsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productsListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of products. + */ + nextPageToken: string; + resources: Schema$Product[]; } - - /** - * content.pos.sale - * @desc Submit a sale event for the given merchant. - * @alias content.pos.sale - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the POS or inventory data provider. - * @param {string} params.targetMerchantId The ID of the target merchant. - * @param {().PosSaleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sale(params?: any, options?: MethodOptions): - AxiosPromise; - sale( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sale( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/pos/{targetMerchantId}/sale') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'targetMerchantId'], - pathParams: ['merchantId', 'targetMerchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The status of a product, i.e., information about a product computed + * asynchronously by the data quality analysis. + */ + export interface Schema$ProductStatus { + /** + * Date on which the item has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * A list of data quality issues associated with the product. + */ + dataQualityIssues: Schema$ProductStatusDataQualityIssue[]; + /** + * The intended destinations for the product. + */ + destinationStatuses: Schema$ProductStatusDestinationStatus[]; + /** + * Date on which the item expires in Google Shopping, in ISO 8601 format. + */ + googleExpirationDate: string; + /** + * A list of all issues associated with the product. + */ + itemLevelIssues: Schema$ProductStatusItemLevelIssue[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productStatus". + */ + kind: string; + /** + * Date on which the item has been last updated, in ISO 8601 format. + */ + lastUpdateDate: string; + /** + * The link to the product. + */ + link: string; + /** + * Product data after applying all the join inputs. + */ + product: Schema$Product; + /** + * The id of the product for which status is reported. + */ + productId: string; + /** + * The title of the product. + */ + title: string; } -} - -export class Resource$Products { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ProductStatusDataQualityIssue { + /** + * The destination the issue applies to. + */ + destination: string; + /** + * A more detailed error string. + */ + detail: string; + /** + * The fetch status for landing_page_errors. + */ + fetchStatus: string; + /** + * The id of the data quality issue. + */ + id: string; + /** + * The attribute name that is relevant for the issue. + */ + location: string; + /** + * The severity of the data quality issue. + */ + severity: string; + /** + * The time stamp of the data quality issue. + */ + timestamp: string; + /** + * The value of that attribute that was found on the landing page + */ + valueOnLandingPage: string; + /** + * The value the attribute had at time of evaluation. + */ + valueProvided: string; } - - getRoot() { - return this.root; + export interface Schema$ProductStatusDestinationStatus { + /** + * Whether the approval status might change due to further processing. + */ + approvalPending: boolean; + /** + * The destination's approval status. + */ + approvalStatus: string; + /** + * The name of the destination + */ + destination: string; + /** + * Provided for backward compatibility only. Always set to + * "required". + */ + intention: string; + } + export interface Schema$ProductstatusesCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$ProductstatusesCustomBatchRequestEntry[]; } - - /** - * content.products.custombatch - * @desc Retrieves, inserts, and deletes multiple products in a single - * request. - * @alias content.products.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().ProductsCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/products/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch productstatuses request. + */ + export interface Schema$ProductstatusesCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * If set, only issues for the specified destinations are returned, + * otherwise only issues for the Shopping destination. + */ + destinations: string[]; + includeAttributes: boolean; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + /** + * The ID of the product whose status to get. + */ + productId: string; + } + export interface Schema$ProductstatusesCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$ProductstatusesCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productstatusesCustomBatchResponse". + */ + kind: string; } - - /** - * content.products.delete - * @desc Deletes a product from your Merchant Center account. - * @alias content.products.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. - * @param {string} params.productId The REST id of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/products/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['merchantId', 'productId'], - pathParams: ['merchantId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch productstatuses response. + */ + export interface Schema$ProductstatusesCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors, if the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productstatusesCustomBatchResponseEntry". + */ + kind: string; + /** + * The requested product status. Only defined if the request was successful. + */ + productStatus: Schema$ProductStatus; + } + export interface Schema$ProductstatusesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#productstatusesListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of products statuses. + */ + nextPageToken: string; + resources: Schema$ProductStatus[]; + } + export interface Schema$ProductStatusItemLevelIssue { + /** + * The attribute's name, if the issue is caused by a single attribute. + */ + attributeName: string; + /** + * The error code of the issue. + */ + code: string; + /** + * A short issue description in English. + */ + description: string; + /** + * The destination the issue applies to. + */ + destination: string; + /** + * A detailed issue description in English. + */ + detail: string; + /** + * The URL of a web page to help with resolving this issue. + */ + documentation: string; + /** + * Whether the issue can be resolved by the merchant. + */ + resolution: string; + /** + * How this issue affects serving of the offer. + */ + servability: string; + } + export interface Schema$ProductTax { + /** + * The country within which the item is taxed, specified as a CLDR territory + * code. + */ + country: string; + /** + * The numeric id of a location that the tax rate applies to as defined in + * the AdWords API. + */ + locationId: string; + /** + * The postal code range that the tax rate applies to, represented by a ZIP + * code, a ZIP code prefix using * wildcard, a range between two ZIP codes + * or two ZIP code prefixes of equal length. Examples: 94114, 94*, + * 94002-95460, 94*-95*. + */ + postalCode: string; + /** + * The percentage of tax rate that applies to the item price. + */ + rate: number; + /** + * The geographic region to which the tax rate applies. + */ + region: string; + /** + * Set to true if tax is charged on shipping. + */ + taxShip: boolean; + } + export interface Schema$ProductUnitPricingBaseMeasure { + /** + * The unit of the denominator. + */ + unit: string; + /** + * The denominator of the unit price. + */ + value: string; + } + export interface Schema$ProductUnitPricingMeasure { + /** + * The unit of the measure. + */ + unit: string; + /** + * The measure of an item. + */ + value: number; + } + export interface Schema$RateGroup { + /** + * A list of shipping labels defining the products to which this rate group + * applies to. This is a disjunction: only one of the labels has to match + * for the rate group to apply. May only be empty for the last rate group of + * a service. Required. + */ + applicableShippingLabels: string[]; + /** + * A list of carrier rates that can be referred to by mainTable or + * singleValue. + */ + carrierRates: Schema$CarrierRate[]; + /** + * A table defining the rate group, when singleValue is not expressive + * enough. Can only be set if singleValue is not set. + */ + mainTable: Schema$Table; + /** + * The value of the rate group (e.g. flat rate $10). Can only be set if + * mainTable and subtables are not set. + */ + singleValue: Schema$Value; + /** + * A list of subtables referred to by mainTable. Can only be set if + * mainTable is set. + */ + subtables: Schema$Table[]; + } + export interface Schema$Row { + /** + * The list of cells that constitute the row. Must have the same length as + * columnHeaders for two-dimensional tables, a length of 1 for + * one-dimensional tables. Required. + */ + cells: Schema$Value[]; + } + export interface Schema$Service { + /** + * A boolean exposing the active status of the shipping service. Required. + */ + active: boolean; + /** + * The CLDR code of the currency to which this service applies. Must match + * that of the prices in rate groups. + */ + currency: string; + /** + * The CLDR territory code of the country to which the service applies. + * Required. + */ + deliveryCountry: string; + /** + * Time spent in various aspects from order to the delivery of the product. + * Required. + */ + deliveryTime: Schema$DeliveryTime; + /** + * Eligibility for this service. + */ + eligibility: string; + /** + * Minimum order value for this service. If set, indicates that customers + * will have to spend at least this amount. All prices within a service must + * have the same currency. + */ + minimumOrderValue: Schema$Price; + /** + * Free-form name of the service. Must be unique within target account. + * Required. + */ + name: string; + /** + * Shipping rate group definitions. Only the last one is allowed to have an + * empty applicableShippingLabels, which means "everything else". + * The other applicableShippingLabels must not overlap. + */ + rateGroups: Schema$RateGroup[]; } - - /** - * content.products.get - * @desc Retrieves a product from your Merchant Center account. - * @alias content.products.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. - * @param {string} params.productId The REST id of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/products/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'productId'], - pathParams: ['merchantId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The merchant account's shipping settings. + */ + export interface Schema$ShippingSettings { + /** + * The ID of the account to which these account shipping settings belong. + * Ignored upon update, always present in get request responses. + */ + accountId: string; + /** + * A list of postal code groups that can be referred to in services. + * Optional. + */ + postalCodeGroups: Schema$PostalCodeGroup[]; + /** + * The target account's list of services. Optional. + */ + services: Schema$Service[]; + } + export interface Schema$ShippingsettingsCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$ShippingsettingsCustomBatchRequestEntry[]; } - - /** - * content.products.insert - * @desc Uploads a product to your Merchant Center account. If an item with - * the same channel, contentLanguage, offerId, and targetCountry already - * exists, this method updates that entry. - * @alias content.products.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. - * @param {().Product} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/products') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch shippingsettings request. + */ + export interface Schema$ShippingsettingsCustomBatchRequestEntry { + /** + * The ID of the account for which to get/update account shipping settings. + */ + accountId: string; + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * The ID of the managing account. + */ + merchantId: string; + method: string; + /** + * The account shipping settings to update. Only defined if the method is + * update. + */ + shippingSettings: Schema$ShippingSettings; + } + export interface Schema$ShippingsettingsCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$ShippingsettingsCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#shippingsettingsCustomBatchResponse". + */ + kind: string; } - - /** - * content.products.list - * @desc Lists the products in your Merchant Center account. - * @alias content.products.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeInvalidInsertedItems Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). - * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. - * @param {string} params.merchantId The ID of the account that contains the products. This account cannot be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/products') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A batch entry encoding a single non-batch shipping settings response. + */ + export interface Schema$ShippingsettingsCustomBatchResponseEntry { + /** + * The ID of the request entry to which this entry responds. + */ + batchId: number; + /** + * A list of errors defined if, and only if, the request failed. + */ + errors: Schema$Errors; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#shippingsettingsCustomBatchResponseEntry". + */ + kind: string; + /** + * The retrieved or updated account shipping settings. + */ + shippingSettings: Schema$ShippingSettings; } -} - -export class Resource$Productstatuses { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ShippingsettingsGetSupportedCarriersResponse { + /** + * A list of supported carriers. May be empty. + */ + carriers: Schema$CarriersCarrier[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#shippingsettingsGetSupportedCarriersResponse". + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$ShippingsettingsGetSupportedHolidaysResponse { + /** + * A list of holidays applicable for delivery guarantees. May be empty. + */ + holidays: Schema$HolidaysHoliday[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#shippingsettingsGetSupportedHolidaysResponse". + */ + kind: string; + } + export interface Schema$ShippingsettingsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#shippingsettingsListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of shipping settings. + */ + nextPageToken: string; + resources: Schema$ShippingSettings[]; + } + export interface Schema$Table { + /** + * Headers of the table's columns. Optional: if not set then the table + * has only one dimension. + */ + columnHeaders: Schema$Headers; + /** + * Name of the table. Required for subtables, ignored for the main table. + */ + name: string; + /** + * Headers of the table's rows. Required. + */ + rowHeaders: Schema$Headers; + /** + * The list of rows that constitute the table. Must have the same length as + * rowHeaders. Required. + */ + rows: Schema$Row[]; + } + export interface Schema$TestOrder { + /** + * The details of the customer who placed the order. + */ + customer: Schema$TestOrderCustomer; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#testOrder". + */ + kind: string; + /** + * Line items that are ordered. At least one line item must be provided. + */ + lineItems: Schema$TestOrderLineItem[]; + /** + * Determines if test order must be pulled by merchant or pushed to merchant + * via push integration. + */ + notificationMode: string; + /** + * The details of the payment method. + */ + paymentMethod: Schema$TestOrderPaymentMethod; + /** + * Identifier of one of the predefined delivery addresses for the delivery. + */ + predefinedDeliveryAddress: string; + /** + * The details of the merchant provided promotions applied to the order. + * More details about the program are here. + */ + promotions: Schema$OrderPromotion[]; + /** + * The total cost of shipping for all items. + */ + shippingCost: Schema$Price; + /** + * The tax for the total shipping cost. + */ + shippingCostTax: Schema$Price; + /** + * The requested shipping option. + */ + shippingOption: string; + } + export interface Schema$TestOrderCustomer { + /** + * Email address of the customer. + */ + email: string; + /** + * Deprecated. Please use marketingRightsInfo instead. + */ + explicitMarketingPreference: boolean; + /** + * Full name of the customer. + */ + fullName: string; + /** + * Customer's marketing preferences. + */ + marketingRightsInfo: Schema$TestOrderCustomerMarketingRightsInfo; + } + export interface Schema$TestOrderCustomerMarketingRightsInfo { + /** + * Last know user use selection regards marketing preferences. In certain + * cases selection might not be known, so this field would be empty. + */ + explicitMarketingPreference: string; + /** + * Timestamp when last time marketing preference was updated. Could be + * empty, if user wasn't offered a selection yet. + */ + lastUpdatedTimestamp: string; + } + export interface Schema$TestOrderLineItem { + /** + * Product data from the time of the order placement. + */ + product: Schema$TestOrderLineItemProduct; + /** + * Number of items ordered. + */ + quantityOrdered: number; + /** + * Details of the return policy for the line item. + */ + returnInfo: Schema$OrderLineItemReturnInfo; + /** + * Details of the requested shipping for the line item. + */ + shippingDetails: Schema$OrderLineItemShippingDetails; + /** + * Unit tax for the line item. + */ + unitTax: Schema$Price; + } + export interface Schema$TestOrderLineItemProduct { + /** + * Brand of the item. + */ + brand: string; + /** + * The item's channel. + */ + channel: string; + /** + * Condition or state of the item. + */ + condition: string; + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number (GTIN) of the item. Optional. + */ + gtin: string; + /** + * URL of an image of the item. + */ + imageLink: string; + /** + * Shared identifier for all variants of the same product. Optional. + */ + itemGroupId: string; + /** + * Manufacturer Part Number (MPN) of the item. Optional. + */ + mpn: string; + /** + * An identifier of the item. + */ + offerId: string; + /** + * The price for the product. + */ + price: Schema$Price; + /** + * The CLDR territory code of the target country of the product. + */ + targetCountry: string; + /** + * The title of the product. + */ + title: string; + /** + * Variant attributes for the item. Optional. + */ + variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; + } + export interface Schema$TestOrderPaymentMethod { + /** + * The card expiration month (January = 1, February = 2 etc.). + */ + expirationMonth: number; + /** + * The card expiration year (4-digit, e.g. 2015). + */ + expirationYear: number; + /** + * The last four digits of the card number. + */ + lastFourDigits: string; + /** + * The billing address. + */ + predefinedBillingAddress: string; + /** + * The type of instrument. Note that real orders might have different values + * than the four values accepted by createTestOrder. + */ + type: string; } - - /** - * content.productstatuses.custombatch - * @desc Gets the statuses of multiple products in a single request. - * @alias content.productstatuses.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeAttributes Flag to include full product data in the results of this request. The default value is false. - * @param {().ProductstatusesCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/productstatuses/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * The single value of a rate group or the value of a rate group table's + * cell. Exactly one of noShipping, flatRate, pricePercentage, + * carrierRateName, subtableName must be set. + */ + export interface Schema$Value { + /** + * The name of a carrier rate referring to a carrier rate defined in the + * same rate group. Can only be set if all other fields are not set. + */ + carrierRateName: string; + /** + * A flat rate. Can only be set if all other fields are not set. + */ + flatRate: Schema$Price; + /** + * If true, then the product can't ship. Must be true when set, can only + * be set if all other fields are not set. + */ + noShipping: boolean; + /** + * A percentage of the price represented as a number in decimal notation + * (e.g., "5.4"). Can only be set if all other fields are not set. + */ + pricePercentage: string; + /** + * The name of a subtable. Can only be set in table cells (i.e., not for + * single values), and only if all other fields are not set. + */ + subtableName: string; + } + export interface Schema$Weight { + /** + * The weight unit. + */ + unit: string; + /** + * The weight represented as a number. + */ + value: string; } - - /** - * content.productstatuses.get - * @desc Gets the status of a product from your Merchant Center account. - * @alias content.productstatuses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. - * @param {boolean=} params.includeAttributes Flag to include full product data in the result of this get request. The default value is false. - * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. - * @param {string} params.productId The REST id of the product. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/productstatuses/{productId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'productId'], - pathParams: ['merchantId', 'productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.accounts.authinfo + * @desc Returns information about the authenticated user. + * @alias content.accounts.authinfo + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + authinfo(params?: any, options?: MethodOptions): + AxiosPromise; + authinfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + authinfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/accounts/authinfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.claimwebsite + * @desc Claims the website of a Merchant Center sub-account. + * @alias content.accounts.claimwebsite + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account whose website is claimed. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {boolean=} params.overwrite Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + claimwebsite(params?: any, options?: MethodOptions): + AxiosPromise; + claimwebsite( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + claimwebsite( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/accounts/{accountId}/claimwebsite') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.accounts.custombatch + * @desc Retrieves, inserts, updates, and deletes multiple Merchant Center + * (sub-)accounts in a single request. + * @alias content.accounts.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().AccountsCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/accounts/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.delete + * @desc Deletes a Merchant Center sub-account. + * @alias content.accounts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {boolean=} params.force Flag to delete sub-accounts with products. The default value is false. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.get + * @desc Retrieves a Merchant Center account. + * @alias content.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.insert + * @desc Creates a Merchant Center sub-account. + * @alias content.accounts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.list + * @desc Lists the sub-accounts in your Merchant Center account. + * @alias content.accounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of accounts to return in the response, used for paging. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.patch + * @desc Updates a Merchant Center account. This method supports patch + * semantics. + * @alias content.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounts.update + * @desc Updates a Merchant Center account. + * @alias content.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * content.productstatuses.list - * @desc Lists the statuses of the products in your Merchant Center account. - * @alias content.productstatuses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. - * @param {boolean=} params.includeAttributes Flag to include full product data in the results of the list request. The default value is false. - * @param {boolean=} params.includeInvalidInsertedItems Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). - * @param {integer=} params.maxResults The maximum number of product statuses to return in the response, used for paging. - * @param {string} params.merchantId The ID of the account that contains the products. This account cannot be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/productstatuses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accountstatuses { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.accountstatuses.custombatch + * @alias content.accountstatuses.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AccountstatusesCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/accountstatuses/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.accountstatuses.get + * @desc Retrieves the status of a Merchant Center account. + * @alias content.accountstatuses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account. + * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/accountstatuses/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accountstatuses.list + * @desc Lists the statuses of the sub-accounts in your Merchant Center + * account. + * @alias content.accountstatuses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * @param {integer=} params.maxResults The maximum number of account statuses to return in the response, used for paging. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accountstatuses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Shippingsettings { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Accounttax { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.accounttax.custombatch + * @desc Retrieves and updates tax settings of multiple accounts in a single + * request. + * @alias content.accounttax.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().AccounttaxCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/accounttax/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.accounttax.get + * @desc Retrieves the tax settings of the account. + * @alias content.accounttax.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update account tax settings. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounttax.list + * @desc Lists the tax settings of the sub-accounts in your Merchant Center + * account. + * @alias content.accounttax.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of tax settings to return in the response, used for paging. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounttax') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounttax.patch + * @desc Updates the tax settings of the account. This method supports patch + * semantics. + * @alias content.accounttax.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update account tax settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().AccountTax} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.accounttax.update + * @desc Updates the tax settings of the account. + * @alias content.accounttax.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update account tax settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().AccountTax} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/accounttax/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Datafeeds { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.datafeeds.custombatch + * @alias content.datafeeds.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().DatafeedsCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/datafeeds/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.datafeeds.delete + * @desc Deletes a datafeed configuration from your Merchant Center account. + * @alias content.datafeeds.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datafeedId The ID of the datafeed. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.fetchnow + * @desc Invokes a fetch for the datafeed in your Merchant Center account. + * @alias content.datafeeds.fetchnow + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datafeedId The ID of the datafeed to be fetched. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + fetchnow(params?: any, options?: MethodOptions): + AxiosPromise; + fetchnow( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + fetchnow( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/datafeeds/{datafeedId}/fetchNow') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.get + * @desc Retrieves a datafeed configuration from your Merchant Center + * account. + * @alias content.datafeeds.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datafeedId The ID of the datafeed. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.insert + * @desc Registers a datafeed configuration with your Merchant Center + * account. + * @alias content.datafeeds.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {().Datafeed} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.list + * @desc Lists the configurations for datafeeds in your Merchant Center + * account. + * @alias content.datafeeds.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. + * @param {string} params.merchantId The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.patch + * @desc Updates a datafeed configuration of your Merchant Center account. + * This method supports patch semantics. + * @alias content.datafeeds.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datafeedId The ID of the datafeed. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {().Datafeed} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeeds.update + * @desc Updates a datafeed configuration of your Merchant Center account. + * @alias content.datafeeds.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datafeedId The ID of the datafeed. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {().Datafeed} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeeds/{datafeedId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * content.shippingsettings.custombatch - * @desc Retrieves and updates the shipping settings of multiple accounts in a - * single request. - * @alias content.shippingsettings.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {().ShippingsettingsCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/shippingsettings/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Datafeedstatuses { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.datafeedstatuses.custombatch + * @alias content.datafeedstatuses.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().DatafeedstatusesCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/datafeedstatuses/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.datafeedstatuses.get + * @desc Retrieves the status of a datafeed from your Merchant Center + * account. + * @alias content.datafeedstatuses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.country The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * @param {string} params.datafeedId The ID of the datafeed. + * @param {string=} params.language The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target. + * @param {string} params.merchantId The ID of the account that manages the datafeed. This account cannot be a multi-client account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/datafeedstatuses/{datafeedId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'datafeedId'], + pathParams: ['datafeedId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.datafeedstatuses.list + * @desc Lists the statuses of the datafeeds in your Merchant Center + * account. + * @alias content.datafeedstatuses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. + * @param {string} params.merchantId The ID of the account that manages the datafeeds. This account cannot be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/datafeedstatuses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * content.shippingsettings.get - * @desc Retrieves the shipping settings of the account. - * @alias content.shippingsettings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update shipping settings. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/shippingsettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Inventory { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.inventory.custombatch + * @desc Updates price and availability for multiple products or stores in a + * single request. This operation does not update the expiration date of the + * products. + * @alias content.inventory.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().InventoryCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/inventory/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.inventory.set + * @desc Updates price and availability of a product in your Merchant Center + * account. + * @alias content.inventory.set + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. + * @param {string} params.productId The REST id of the product for which to update price and availability. + * @param {string} params.storeCode The code of the store for which to update price and availability. Use online to update price and availability of an online product. + * @param {().InventorySetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + set(params?: any, + options?: MethodOptions): AxiosPromise; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/inventory/{storeCode}/products/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'storeCode', 'productId'], + pathParams: ['merchantId', 'productId', 'storeCode'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * content.shippingsettings.getsupportedcarriers - * @desc Retrieves supported carriers and carrier services for an account. - * @alias content.shippingsettings.getsupportedcarriers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account for which to retrieve the supported carriers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getsupportedcarriers(params?: any, options?: MethodOptions): - AxiosPromise; - getsupportedcarriers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ShippingsettingsGetSupportedCarriersResponse>): void; - getsupportedcarriers( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ShippingsettingsGetSupportedCarriersResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/supportedCarriers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ShippingsettingsGetSupportedCarriersResponse>(parameters); + export class Resource$Liasettings { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.liasettings.custombatch + * @desc Retrieves and/or updates the LIA settings of multiple accounts in a + * single request. + * @alias content.liasettings.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().LiasettingsCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/liasettings/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.liasettings.get + * @desc Retrieves the LIA settings of the account. + * @alias content.liasettings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get or update LIA settings. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.liasettings.getaccessiblegmbaccounts + * @desc Retrieves the list of accessible Google My Business accounts. + * @alias content.liasettings.getaccessiblegmbaccounts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to retrieve accessible Google My Business accounts. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getaccessiblegmbaccounts(params?: any, options?: MethodOptions): + AxiosPromise; + getaccessiblegmbaccounts( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsGetAccessibleGmbAccountsResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsGetAccessibleGmbAccountsResponse>): void; + getaccessiblegmbaccounts( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsGetAccessibleGmbAccountsResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsGetAccessibleGmbAccountsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/liasettings/{accountId}/accessiblegmbaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$LiasettingsGetAccessibleGmbAccountsResponse>(parameters); + } + } + + + /** + * content.liasettings.list + * @desc Lists the LIA settings of the sub-accounts in your Merchant Center + * account. + * @alias content.liasettings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of LIA settings to return in the response, used for paging. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/liasettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.liasettings.patch + * @desc Updates the LIA settings of the account. This method supports patch + * semantics. + * @alias content.liasettings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get or update LIA settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().LiaSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.liasettings.requestgmbaccess + * @desc Requests access to a specified Google My Business account. + * @alias content.liasettings.requestgmbaccess + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which GMB access is requested. + * @param {string=} params.gmbEmail The email of the Google My Business account. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + requestgmbaccess(params?: any, options?: MethodOptions): + AxiosPromise; + requestgmbaccess( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + requestgmbaccess( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/liasettings/{accountId}/requestgmbaccess') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.liasettings.requestinventoryverification + * @desc Requests inventory validation for the specified country. + * @alias content.liasettings.requestinventoryverification + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.country The country for which inventory validation is requested. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + requestinventoryverification(params?: any, options?: MethodOptions): + AxiosPromise; + requestinventoryverification( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsRequestInventoryVerificationResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsRequestInventoryVerificationResponse>): void; + requestinventoryverification( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsRequestInventoryVerificationResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsRequestInventoryVerificationResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/liasettings/{accountId}/requestinventoryverification/{country}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'accountId', 'country'], + pathParams: ['accountId', 'country', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$LiasettingsRequestInventoryVerificationResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$LiasettingsRequestInventoryVerificationResponse>(parameters); + } + } + + + /** + * content.liasettings.setinventoryverificationcontact + * @desc Sets the inventory verification contract for the specified country. + * @alias content.liasettings.setinventoryverificationcontact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string=} params.contactEmail The email of the inventory verification contact. + * @param {string=} params.contactName The name of the inventory verification contact. + * @param {string=} params.country The country for which inventory verification is requested. + * @param {string=} params.language The language for which inventory verification is requested. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setinventoryverificationcontact(params?: any, options?: MethodOptions): + AxiosPromise; + setinventoryverificationcontact( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsSetInventoryVerificationContactResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsSetInventoryVerificationContactResponse>): void; + setinventoryverificationcontact( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$LiasettingsSetInventoryVerificationContactResponse>, + callback?: BodyResponseCallback< + Schema$LiasettingsSetInventoryVerificationContactResponse>): + void|AxiosPromise< + Schema$LiasettingsSetInventoryVerificationContactResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/liasettings/{accountId}/setinventoryverificationcontact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$LiasettingsSetInventoryVerificationContactResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$LiasettingsSetInventoryVerificationContactResponse>( + parameters); + } + } + + + /** + * content.liasettings.update + * @desc Updates the LIA settings of the account. + * @alias content.liasettings.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get or update LIA settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().LiaSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2/{merchantId}/liasettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * content.shippingsettings.getsupportedholidays - * @desc Retrieves supported holidays for an account. - * @alias content.shippingsettings.getsupportedholidays - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account for which to retrieve the supported holidays. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getsupportedholidays(params?: any, options?: MethodOptions): - AxiosPromise; - getsupportedholidays( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ShippingsettingsGetSupportedHolidaysResponse>): void; - getsupportedholidays( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ShippingsettingsGetSupportedHolidaysResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/supportedHolidays') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ShippingsettingsGetSupportedHolidaysResponse>(parameters); + export class Resource$Orders { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.orders.acknowledge + * @desc Marks an order as acknowledged. + * @alias content.orders.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersAcknowledgeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + acknowledge( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.advancetestorder + * @desc Sandbox only. Moves a test order from state "inProgress" to state + * "pendingShipment". + * @alias content.orders.advancetestorder + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the test order to modify. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + advancetestorder(params?: any, options?: MethodOptions): + AxiosPromise; + advancetestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + advancetestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/testorders/{orderId}/advance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.cancel + * @desc Cancels all line items in an order, making a full refund. + * @alias content.orders.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order to cancel. + * @param {().OrdersCancelRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2/{merchantId}/orders/{orderId}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.cancellineitem + * @desc Cancels a line item, making a full refund. + * @alias content.orders.cancellineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersCancelLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancellineitem(params?: any, options?: MethodOptions): + AxiosPromise; + cancellineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + cancellineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/cancelLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.createtestorder + * @desc Sandbox only. Creates a test order. + * @alias content.orders.createtestorder + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. + * @param {().OrdersCreateTestOrderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createtestorder(params?: any, options?: MethodOptions): + AxiosPromise; + createtestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + createtestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/testorders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.custombatch + * @desc Retrieves or modifies multiple orders in a single request. + * @alias content.orders.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().OrdersCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/orders/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.get + * @desc Retrieves an order from your Merchant Center account. + * @alias content.orders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/orders/{orderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.getbymerchantorderid + * @desc Retrieves an order using merchant order id. + * @alias content.orders.getbymerchantorderid + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.merchantOrderId The merchant order id to be looked for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getbymerchantorderid(params?: any, options?: MethodOptions): + AxiosPromise; + getbymerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getbymerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/ordersbymerchantid/{merchantOrderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'merchantOrderId'], + pathParams: ['merchantId', 'merchantOrderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.gettestordertemplate + * @desc Sandbox only. Retrieves an order template that can be used to + * quickly create a new order in sandbox. + * @alias content.orders.gettestordertemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. + * @param {string} params.templateName The name of the template to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + gettestordertemplate(params?: any, options?: MethodOptions): + AxiosPromise; + gettestordertemplate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + gettestordertemplate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/testordertemplates/{templateName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'templateName'], + pathParams: ['merchantId', 'templateName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.instorerefundlineitem + * @desc Notifies that item return and refund was handled directly in store. + * @alias content.orders.instorerefundlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersInStoreRefundLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instorerefundlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + instorerefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + instorerefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/inStoreRefundLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.list + * @desc Lists the orders in your Merchant Center account. + * @alias content.orders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledged Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. + * @param {integer=} params.maxResults The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. Known issue: All List calls will return all Orders without limit regardless of the value of this field. + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string=} params.orderBy The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string=} params.placedDateEnd Obtains orders placed before this date (exclusively), in ISO 8601 format. + * @param {string=} params.placedDateStart Obtains orders placed after this date (inclusively), in ISO 8601 format. + * @param {string=} params.statuses Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/orders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.refund + * @desc Refund a portion of the order, up to the full amount paid. + * @alias content.orders.refund + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order to refund. + * @param {().OrdersRefundRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + refund(params?: any, options?: MethodOptions): + AxiosPromise; + refund( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + refund( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2/{merchantId}/orders/{orderId}/refund') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.rejectreturnlineitem + * @desc Rejects return on an line item. + * @alias content.orders.rejectreturnlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersRejectReturnLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rejectreturnlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + rejectreturnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + rejectreturnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/rejectReturnLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.returnlineitem + * @desc Returns a line item. + * @alias content.orders.returnlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersReturnLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + returnlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + returnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + returnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/returnLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.returnrefundlineitem + * @desc Returns and refunds a line item. Note that this method can only be + * called on fully shipped orders. + * @alias content.orders.returnrefundlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersReturnRefundLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + returnrefundlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + returnrefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + returnrefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/returnRefundLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.setlineitemmetadata + * @desc Sets (overrides) merchant provided annotations on the line item. + * @alias content.orders.setlineitemmetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersSetLineItemMetadataRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setlineitemmetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setlineitemmetadata( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + setlineitemmetadata( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/setLineItemMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.shiplineitems + * @desc Marks line item(s) as shipped. + * @alias content.orders.shiplineitems + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersShipLineItemsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + shiplineitems(params?: any, options?: MethodOptions): + AxiosPromise; + shiplineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + shiplineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/shipLineItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.orders.updatelineitemshippingdetails + * @desc Updates ship by and delivery by dates for a line item. + * @alias content.orders.updatelineitemshippingdetails + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateLineItemShippingDetailsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatelineitemshippingdetails(params?: any, options?: MethodOptions): + AxiosPromise; + updatelineitemshippingdetails( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>, + callback?: BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>): void; + updatelineitemshippingdetails( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>, + callback?: BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/updateLineItemShippingDetails') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$OrdersUpdateLineItemShippingDetailsResponse>(parameters); + } + } + + + /** + * content.orders.updatemerchantorderid + * @desc Updates the merchant order ID for a given order. + * @alias content.orders.updatemerchantorderid + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateMerchantOrderIdRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatemerchantorderid(params?: any, options?: MethodOptions): + AxiosPromise; + updatemerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + updatemerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/updateMerchantOrderId') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.orders.updateshipment + * @desc Updates a shipment's status, carrier, and/or tracking ID. + * @alias content.orders.updateshipment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateShipmentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateshipment(params?: any, options?: MethodOptions): + AxiosPromise; + updateshipment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + updateshipment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/orders/{orderId}/updateShipment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * content.shippingsettings.list - * @desc Lists the shipping settings of the sub-accounts in your Merchant - * Center account. - * @alias content.shippingsettings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of shipping settings to return in the response, used for paging. - * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2/{merchantId}/shippingsettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Pos { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.pos.custombatch + * @desc Batches multiple POS-related calls in a single request. + * @alias content.pos.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().PosCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/pos/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.delete + * @desc Deletes a store for the given merchant. + * @alias content.pos.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.storeCode A store code that is unique per merchant. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/store/{storeCode}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId', 'storeCode'], + pathParams: ['merchantId', 'storeCode', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.get + * @desc Retrieves information about the given store. + * @alias content.pos.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.storeCode A store code that is unique per merchant. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/store/{storeCode}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId', 'storeCode'], + pathParams: ['merchantId', 'storeCode', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.insert + * @desc Creates a store for the given merchant. + * @alias content.pos.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {().PosStore} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/store') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId'], + pathParams: ['merchantId', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.inventory + * @desc Submit inventory for the given merchant. + * @alias content.pos.inventory + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {().PosInventoryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + inventory(params?: any, options?: MethodOptions): + AxiosPromise; + inventory( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + inventory( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/inventory') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId'], + pathParams: ['merchantId', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.list + * @desc Lists the stores of the target merchant. + * @alias content.pos.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/store') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId'], + pathParams: ['merchantId', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.pos.sale + * @desc Submit a sale event for the given merchant. + * @alias content.pos.sale + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the POS or inventory data provider. + * @param {string} params.targetMerchantId The ID of the target merchant. + * @param {().PosSaleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sale(params?: any, options?: MethodOptions): + AxiosPromise; + sale( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sale( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/pos/{targetMerchantId}/sale') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'targetMerchantId'], + pathParams: ['merchantId', 'targetMerchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * content.shippingsettings.patch - * @desc Updates the shipping settings of the account. This method supports - * patch semantics. - * @alias content.shippingsettings.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update shipping settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().ShippingSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/shippingsettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Products { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.products.custombatch + * @desc Retrieves, inserts, and deletes multiple products in a single + * request. + * @alias content.products.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().ProductsCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/products/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.products.delete + * @desc Deletes a product from your Merchant Center account. + * @alias content.products.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. + * @param {string} params.productId The REST id of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/products/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['merchantId', 'productId'], + pathParams: ['merchantId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.products.get + * @desc Retrieves a product from your Merchant Center account. + * @alias content.products.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. + * @param {string} params.productId The REST id of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/products/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'productId'], + pathParams: ['merchantId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.products.insert + * @desc Uploads a product to your Merchant Center account. If an item with + * the same channel, contentLanguage, offerId, and targetCountry already + * exists, this method updates that entry. + * @alias content.products.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. + * @param {().Product} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/products') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.products.list + * @desc Lists the products in your Merchant Center account. + * @alias content.products.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeInvalidInsertedItems Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). + * @param {integer=} params.maxResults The maximum number of products to return in the response, used for paging. + * @param {string} params.merchantId The ID of the account that contains the products. This account cannot be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/products') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * content.shippingsettings.update - * @desc Updates the shipping settings of the account. - * @alias content.shippingsettings.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account for which to get/update shipping settings. - * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. - * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. - * @param {().ShippingSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Productstatuses { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.productstatuses.custombatch + * @desc Gets the statuses of multiple products in a single request. + * @alias content.productstatuses.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeAttributes Flag to include full product data in the results of this request. The default value is false. + * @param {().ProductstatusesCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/productstatuses/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.productstatuses.get + * @desc Gets the status of a product from your Merchant Center account. + * @alias content.productstatuses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * @param {boolean=} params.includeAttributes Flag to include full product data in the result of this get request. The default value is false. + * @param {string} params.merchantId The ID of the account that contains the product. This account cannot be a multi-client account. + * @param {string} params.productId The REST id of the product. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/productstatuses/{productId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'productId'], + pathParams: ['merchantId', 'productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.productstatuses.list + * @desc Lists the statuses of the products in your Merchant Center account. + * @alias content.productstatuses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.destinations If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination. + * @param {boolean=} params.includeAttributes Flag to include full product data in the results of the list request. The default value is false. + * @param {boolean=} params.includeInvalidInsertedItems Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false). + * @param {integer=} params.maxResults The maximum number of product statuses to return in the response, used for paging. + * @param {string} params.merchantId The ID of the account that contains the products. This account cannot be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/productstatuses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2/{merchantId}/shippingsettings/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['merchantId', 'accountId'], - pathParams: ['accountId', 'merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Shippingsettings { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * content.shippingsettings.custombatch + * @desc Retrieves and updates the shipping settings of multiple accounts in + * a single request. + * @alias content.shippingsettings.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {().ShippingsettingsCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/shippingsettings/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.shippingsettings.get + * @desc Retrieves the shipping settings of the account. + * @alias content.shippingsettings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update shipping settings. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/shippingsettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.shippingsettings.getsupportedcarriers + * @desc Retrieves supported carriers and carrier services for an account. + * @alias content.shippingsettings.getsupportedcarriers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account for which to retrieve the supported carriers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getsupportedcarriers(params?: any, options?: MethodOptions): + AxiosPromise; + getsupportedcarriers( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ShippingsettingsGetSupportedCarriersResponse>, + callback?: BodyResponseCallback< + Schema$ShippingsettingsGetSupportedCarriersResponse>): void; + getsupportedcarriers( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ShippingsettingsGetSupportedCarriersResponse>, + callback?: BodyResponseCallback< + Schema$ShippingsettingsGetSupportedCarriersResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/supportedCarriers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ShippingsettingsGetSupportedCarriersResponse>(parameters); + } + } + + + /** + * content.shippingsettings.getsupportedholidays + * @desc Retrieves supported holidays for an account. + * @alias content.shippingsettings.getsupportedholidays + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account for which to retrieve the supported holidays. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getsupportedholidays(params?: any, options?: MethodOptions): + AxiosPromise; + getsupportedholidays( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ShippingsettingsGetSupportedHolidaysResponse>, + callback?: BodyResponseCallback< + Schema$ShippingsettingsGetSupportedHolidaysResponse>): void; + getsupportedholidays( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$ShippingsettingsGetSupportedHolidaysResponse>, + callback?: BodyResponseCallback< + Schema$ShippingsettingsGetSupportedHolidaysResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/supportedHolidays') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ShippingsettingsGetSupportedHolidaysResponse>(parameters); + } + } + + + /** + * content.shippingsettings.list + * @desc Lists the shipping settings of the sub-accounts in your Merchant + * Center account. + * @alias content.shippingsettings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of shipping settings to return in the response, used for paging. + * @param {string} params.merchantId The ID of the managing account. This must be a multi-client account. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2/{merchantId}/shippingsettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * content.shippingsettings.patch + * @desc Updates the shipping settings of the account. This method supports + * patch semantics. + * @alias content.shippingsettings.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update shipping settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().ShippingSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/shippingsettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * content.shippingsettings.update + * @desc Updates the shipping settings of the account. + * @alias content.shippingsettings.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account for which to get/update shipping settings. + * @param {boolean=} params.dryRun Flag to run the request in dry-run mode. + * @param {string} params.merchantId The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account. + * @param {().ShippingSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2/{merchantId}/shippingsettings/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['merchantId', 'accountId'], + pathParams: ['accountId', 'merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/content/v2sandbox.ts b/src/apis/content/v2sandbox.ts index b79eaf9f6b0..26f4180ae44 100644 --- a/src/apis/content/v2sandbox.ts +++ b/src/apis/content/v2sandbox.ts @@ -27,3008 +27,3033 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Content API for Shopping - * - * Manages product items, inventory, and Merchant Center accounts for Google - * Shopping. - * - * @example - * const google = require('googleapis'); - * const content = google.content('v2sandbox'); - * - * @namespace content - * @type {Function} - * @version v2sandbox - * @variation v2sandbox - * @param {object=} options Options for Content - */ -export class Content { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - orders: Resource$Orders; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.orders = new Resource$Orders(this); - } - - getRoot() { - return this.root; - } -} - -/** - * An error returned by the API. - */ -export interface Schema$Error { - /** - * The domain of the error. - */ - domain: string; - /** - * A description of the error. - */ - message: string; - /** - * The error code. - */ - reason: string; -} -/** - * A list of errors returned by a failed batch entry. - */ -export interface Schema$Errors { - /** - * The HTTP status of the first error in errors. - */ - code: number; - /** - * A list of errors. - */ - errors: Schema$Error[]; - /** - * The message of the first error in errors. - */ - message: string; -} -export interface Schema$Order { - /** - * Whether the order was acknowledged. - */ - acknowledged: boolean; - /** - * The channel type of the order: "purchaseOnGoogle" or - * "googleExpress". - */ - channelType: string; - /** - * The details of the customer who placed the order. - */ - customer: Schema$OrderCustomer; - /** - * The details for the delivery. - */ - deliveryDetails: Schema$OrderDeliveryDetails; - /** - * The REST id of the order. Globally unique. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#order". - */ - kind: string; - /** - * Line items that are ordered. - */ - lineItems: Schema$OrderLineItem[]; - merchantId: string; - /** - * Merchant-provided id of the order. - */ - merchantOrderId: string; - /** - * The net amount for the order. For example, if an order was originally for a - * grand total of $100 and a refund was issued for $20, the net amount will be - * $80. - */ - netAmount: Schema$Price; - /** - * The details of the payment method. - */ - paymentMethod: Schema$OrderPaymentMethod; - /** - * The status of the payment. - */ - paymentStatus: string; - /** - * The date when the order was placed, in ISO 8601 format. - */ - placedDate: string; - /** - * The details of the merchant provided promotions applied to the order. More - * details about the program are here. - */ - promotions: Schema$OrderPromotion[]; - /** - * Refunds for the order. - */ - refunds: Schema$OrderRefund[]; - /** - * Shipments of the order. - */ - shipments: Schema$OrderShipment[]; - /** - * The total cost of shipping for all items. - */ - shippingCost: Schema$Price; - /** - * The tax for the total shipping cost. - */ - shippingCostTax: Schema$Price; - /** - * The requested shipping option. - */ - shippingOption: string; - /** - * The status of the order. - */ - status: string; -} -export interface Schema$OrderAddress { - /** - * CLDR country code (e.g. "US"). - */ - country: string; - /** - * Strings representing the lines of the printed label for mailing the order, - * for example: John Smith 1600 Amphitheatre Parkway Mountain View, CA, 94043 - * United States - */ - fullAddress: string[]; - /** - * Whether the address is a post office box. - */ - isPostOfficeBox: boolean; - /** - * City, town or commune. May also include dependent localities or - * sublocalities (e.g. neighborhoods or suburbs). - */ - locality: string; - /** - * Postal Code or ZIP (e.g. "94043"). - */ - postalCode: string; - /** - * Name of the recipient. - */ - recipientName: string; - /** - * Top-level administrative subdivision of the country (e.g. "CA"). - */ - region: string; - /** - * Street-level part of the address. - */ - streetAddress: string[]; -} -export interface Schema$OrderCancellation { - /** - * The actor that created the cancellation. - */ - actor: string; - /** - * Date on which the cancellation has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * The quantity that was canceled. - */ - quantity: number; - /** - * The reason for the cancellation. Orders that are cancelled with a - * noInventory reason will lead to the removal of the product from POG until - * you make an update to that product. This will not affect your Shopping ads. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrderCustomer { - /** - * Email address that should be used for order related communications. In - * certain cases this might not be a real users email, but a proxy email. - */ - email: string; - /** - * Deprecated. Please use marketingRightsInfo instead. - */ - explicitMarketingPreference: boolean; - /** - * Full name of the customer. - */ - fullName: string; - /** - * Customer's marketing preferences. - */ - marketingRightsInfo: Schema$OrderCustomerMarketingRightsInfo; -} -export interface Schema$OrderCustomerMarketingRightsInfo { - /** - * Last known user selection regarding marketing preferences. In certain cases - * this selection might not be known, so this field would be empty. - */ - explicitMarketingPreference: string; - /** - * Timestamp when last time marketing preference was updated. Could be empty, - * if user wasn't offered a selection yet. - */ - lastUpdatedTimestamp: string; - /** - * Email address that can be used for marketing purposes. This field is only - * filled when explicitMarketingPreference is equal to 'granted'. - */ - marketingEmailAddress: string; -} -export interface Schema$OrderDeliveryDetails { - /** - * The delivery address - */ - address: Schema$OrderAddress; - /** - * The phone number of the person receiving the delivery. - */ - phoneNumber: string; -} -export interface Schema$OrderLineItem { - /** - * Annotations that are attached to the line item. - */ - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * Cancellations of the line item. - */ - cancellations: Schema$OrderCancellation[]; - /** - * The id of the line item. - */ - id: string; - /** - * Total price for the line item. For example, if two items for $10 are - * purchased, the total price will be $20. - */ - price: Schema$Price; - /** - * Product data from the time of the order placement. - */ - product: Schema$OrderLineItemProduct; - /** - * Number of items canceled. - */ - quantityCanceled: number; - /** - * Number of items delivered. - */ - quantityDelivered: number; - /** - * Number of items ordered. - */ - quantityOrdered: number; - /** - * Number of items pending. - */ - quantityPending: number; - /** - * Number of items returned. - */ - quantityReturned: number; - /** - * Number of items shipped. - */ - quantityShipped: number; - /** - * Details of the return policy for the line item. - */ - returnInfo: Schema$OrderLineItemReturnInfo; - /** - * Returns of the line item. - */ - returns: Schema$OrderReturn[]; - /** - * Details of the requested shipping for the line item. - */ - shippingDetails: Schema$OrderLineItemShippingDetails; - /** - * Total tax amount for the line item. For example, if two items are - * purchased, and each have a cost tax of $2, the total tax amount will be $4. - */ - tax: Schema$Price; -} -export interface Schema$OrderLineItemProduct { - /** - * Brand of the item. - */ - brand: string; - /** - * The item's channel (online or local). - */ - channel: string; - /** - * Condition or state of the item. - */ - condition: string; - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number (GTIN) of the item. - */ - gtin: string; - /** - * The REST id of the product. - */ - id: string; - /** - * URL of an image of the item. - */ - imageLink: string; - /** - * Shared identifier for all variants of the same product. - */ - itemGroupId: string; - /** - * Manufacturer Part Number (MPN) of the item. - */ - mpn: string; - /** - * An identifier of the item. - */ - offerId: string; - /** - * Price of the item. - */ - price: Schema$Price; - /** - * URL to the cached image shown to the user when order was placed. - */ - shownImage: string; - /** - * The CLDR territory code of the target country of the product. - */ - targetCountry: string; - /** - * The title of the product. - */ - title: string; - /** - * Variant attributes for the item. These are dimensions of the product, such - * as color, gender, material, pattern, and size. You can find a comprehensive - * list of variant attributes here. - */ - variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; -} -export interface Schema$OrderLineItemProductVariantAttribute { - /** - * The dimension of the variant. - */ - dimension: string; - /** - * The value for the dimension. - */ - value: string; -} -export interface Schema$OrderLineItemReturnInfo { - /** - * How many days later the item can be returned. - */ - daysToReturn: number; - /** - * Whether the item is returnable. - */ - isReturnable: boolean; - /** - * URL of the item return policy. - */ - policyUrl: string; -} -export interface Schema$OrderLineItemShippingDetails { - /** - * The delivery by date, in ISO 8601 format. - */ - deliverByDate: string; - /** - * Details of the shipping method. - */ - method: Schema$OrderLineItemShippingDetailsMethod; - /** - * The ship by date, in ISO 8601 format. - */ - shipByDate: string; -} -export interface Schema$OrderLineItemShippingDetailsMethod { - /** - * The carrier for the shipping. Optional. See shipments[].carrier for a list - * of acceptable values. - */ - carrier: string; - /** - * Maximum transit time. - */ - maxDaysInTransit: number; - /** - * The name of the shipping method. - */ - methodName: string; - /** - * Minimum transit time. - */ - minDaysInTransit: number; -} -export interface Schema$OrderMerchantProvidedAnnotation { - /** - * Key for additional merchant provided (as key-value pairs) annotation about - * the line item. - */ - key: string; - /** - * Value for additional merchant provided (as key-value pairs) annotation - * about the line item. - */ - value: string; -} -export interface Schema$OrderPaymentMethod { - /** - * The billing address. - */ - billingAddress: Schema$OrderAddress; - /** - * The card expiration month (January = 1, February = 2 etc.). - */ - expirationMonth: number; - /** - * The card expiration year (4-digit, e.g. 2015). - */ - expirationYear: number; - /** - * The last four digits of the card number. - */ - lastFourDigits: string; - /** - * The billing phone number. - */ - phoneNumber: string; - /** - * The type of instrument. Acceptable values are: - "AMEX" - - * "DISCOVER" - "JCB" - "MASTERCARD" - - * "UNIONPAY" - "VISA" - "" - */ - type: string; -} -export interface Schema$OrderPromotion { - benefits: Schema$OrderPromotionBenefit[]; - /** - * The date and time frame when the promotion is active and ready for - * validation review. Note that the promotion live time may be delayed for a - * few hours due to the validation review. Start date and end date are - * separated by a forward slash (/). The start date is specified by the format - * (YYYY-MM-DD), followed by the letter ?T?, the time of the day when the sale - * starts (in Greenwich Mean Time, GMT), followed by an expression of the time - * zone for the sale. The end date is in the same format. - */ - effectiveDates: string; - /** - * Optional. The text code that corresponds to the promotion when applied on - * the retailer?s website. - */ - genericRedemptionCode: string; - /** - * The unique ID of the promotion. - */ - id: string; - /** - * The full title of the promotion. - */ - longTitle: string; - /** - * Whether the promotion is applicable to all products or only specific - * products. - */ - productApplicability: string; - /** - * Indicates that the promotion is valid online. - */ - redemptionChannel: string; -} -export interface Schema$OrderPromotionBenefit { - /** - * The discount in the order price when the promotion is applied. - */ - discount: Schema$Price; - /** - * The OfferId(s) that were purchased in this order and map to this specific - * benefit of the promotion. - */ - offerIds: string[]; - /** - * Further describes the benefit of the promotion. Note that we will expand on - * this enumeration as we support new promotion sub-types. - */ - subType: string; - /** - * The impact on tax when the promotion is applied. - */ - taxImpact: Schema$Price; - /** - * Describes whether the promotion applies to products (e.g. 20% off) or to - * shipping (e.g. Free Shipping). - */ - type: string; -} -export interface Schema$OrderRefund { - /** - * The actor that created the refund. - */ - actor: string; - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * Date on which the item has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrderReturn { - /** - * The actor that created the refund. - */ - actor: string; - /** - * Date on which the item has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * Quantity that is returned. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersAcknowledgeRequest { - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; -} -export interface Schema$OrdersAcknowledgeResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersAcknowledgeResponse". - */ - kind: string; -} -export interface Schema$OrdersAdvanceTestOrderResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersAdvanceTestOrderResponse". - */ - kind: string; -} -export interface Schema$OrdersCancelLineItemRequest { - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amount: Schema$Price; - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to cancellation amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to cancel. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to cancel. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to cancel. - */ - quantity: number; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCancelLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCancelLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersCancelRequest { - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCancelResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCancelResponse". - */ - kind: string; -} -export interface Schema$OrdersCreateTestOrderRequest { - /** - * The test order template to use. Specify as an alternative to testOrder as a - * shortcut for retrieving a template and then creating an order using that - * template. - */ - templateName: string; - /** - * The test order to create. - */ - testOrder: Schema$TestOrder; -} -export interface Schema$OrdersCreateTestOrderResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCreateTestOrderResponse". - */ - kind: string; - /** - * The ID of the newly created test order. - */ - orderId: string; -} -export interface Schema$OrdersCustomBatchRequest { - /** - * The request entries to be processed in the batch. - */ - entries: Schema$OrdersCustomBatchRequestEntry[]; -} -export interface Schema$OrdersCustomBatchRequestEntry { - /** - * An entry ID, unique within the batch request. - */ - batchId: number; - /** - * Required for cancel method. - */ - cancel: Schema$OrdersCustomBatchRequestEntryCancel; - /** - * Required for cancelLineItem method. - */ - cancelLineItem: Schema$OrdersCustomBatchRequestEntryCancelLineItem; - /** - * Required for inStoreReturnLineItem method. - */ - inStoreRefundLineItem: - Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem; - /** - * The ID of the managing account. - */ - merchantId: string; - /** - * The merchant order id. Required for updateMerchantOrderId and - * getByMerchantOrderId methods. - */ - merchantOrderId: string; - /** - * The method to apply. - */ - method: string; - /** - * The ID of the operation. Unique across all operations for a given order. - * Required for all methods beside get and getByMerchantOrderId. - */ - operationId: string; - /** - * The ID of the order. Required for all methods beside getByMerchantOrderId. - */ - orderId: string; - /** - * Required for refund method. - */ - refund: Schema$OrdersCustomBatchRequestEntryRefund; - /** - * Required for rejectReturnLineItem method. - */ - rejectReturnLineItem: - Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem; - /** - * Required for returnLineItem method. - */ - returnLineItem: Schema$OrdersCustomBatchRequestEntryReturnLineItem; - /** - * Required for returnRefundLineItem method. - */ - returnRefundLineItem: - Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem; - /** - * Required for setLineItemMetadata method. - */ - setLineItemMetadata: Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata; - /** - * Required for shipLineItems method. - */ - shipLineItems: Schema$OrdersCustomBatchRequestEntryShipLineItems; - /** - * Required for updateLineItemShippingDate method. - */ - updateLineItemShippingDetails: - Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails; - /** - * Required for updateShipment method. - */ - updateShipment: Schema$OrdersCustomBatchRequestEntryUpdateShipment; -} -export interface Schema$OrdersCustomBatchRequestEntryCancel { - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryCancelLineItem { - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amount: Schema$Price; - /** - * Amount to refund for the cancelation. Optional. If not set, Google will - * calculate the default based on the price and tax of the items involved. The - * amount must not be larger than the net amount left on the order. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to cancellation amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to cancel. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to cancel. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to cancel. - */ - quantity: number; - /** - * The reason for the cancellation. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem { - /** - * The amount that is refunded. Required. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. Required. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryRefund { - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * The amount that is refunded. Either amount or amountPretax and amountTax - * should be filled. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryReturnLineItem { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem { - /** - * The amount that is refunded. Optional, but if filled then both amountPretax - * and amountTax must be set. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata { - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryShipLineItems { - /** - * Deprecated. Please use shipmentInfo instead. The carrier handling the - * shipment. See shipments[].carrier in the Orders resource representation - * for a list of acceptable values. - */ - carrier: string; - /** - * Line items to ship. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * Deprecated. Please use shipmentInfo instead. The ID of the shipment. - */ - shipmentId: string; - /** - * Shipment information. This field is repeated because a single line item can - * be shipped in several packages (and have several tracking IDs). - */ - shipmentInfos: - Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; - /** - * Deprecated. Please use shipmentInfo instead. The tracking id for the - * shipment. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { - /** - * The carrier handling the shipment. See shipments[].carrier in the Orders - * resource representation for a list of acceptable values. - */ - carrier: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * The tracking id for the shipment. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { - /** - * Updated delivery by date, in ISO 8601 format. If not specified only ship by - * date is updated. - */ - deliverByDate: string; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; - /** - * Updated ship by date, in ISO 8601 format. If not specified only deliver by - * date is updated. - */ - shipByDate: string; -} -export interface Schema$OrdersCustomBatchRequestEntryUpdateShipment { - /** - * The carrier handling the shipment. Not updated if missing. See - * shipments[].carrier in the Orders resource representation for a list of - * acceptable values. - */ - carrier: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * New status for the shipment. Not updated if missing. - */ - status: string; - /** - * The tracking id for the shipment. Not updated if missing. - */ - trackingId: string; -} -export interface Schema$OrdersCustomBatchResponse { - /** - * The result of the execution of the batch requests. - */ - entries: Schema$OrdersCustomBatchResponseEntry[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCustomBatchResponse". - */ - kind: string; -} -export interface Schema$OrdersCustomBatchResponseEntry { - /** - * The ID of the request entry this entry responds to. - */ - batchId: number; - /** - * A list of errors defined if and only if the request failed. - */ - errors: Schema$Errors; - /** - * The status of the execution. Only defined if the method is not get or - * getByMerchantOrderId and if the request was successful. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersCustomBatchResponseEntry". - */ - kind: string; - /** - * The retrieved order. Only defined if the method is get and if the request - * was successful. - */ - order: Schema$Order; -} -export interface Schema$OrdersGetByMerchantOrderIdResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersGetByMerchantOrderIdResponse". - */ - kind: string; - /** - * The requested order. - */ - order: Schema$Order; -} -export interface Schema$OrdersGetTestOrderTemplateResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersGetTestOrderTemplateResponse". - */ - kind: string; - /** - * The requested test order template. - */ - template: Schema$TestOrder; -} -export interface Schema$OrderShipment { - /** - * The carrier handling the shipment. Acceptable values are: - - * "gsx" - "ups" - "usps" - "fedex" - * - "dhl" - "ecourier" - "cxt" - - * "google" - "ontrac" - "emsy" - - * "ont" - "deliv" - "dynamex" - - * "lasership" - "mpx" - "uds" - */ - carrier: string; - /** - * Date on which the shipment has been created, in ISO 8601 format. - */ - creationDate: string; - /** - * Date on which the shipment has been delivered, in ISO 8601 format. Present - * only if status is delievered - */ - deliveryDate: string; - /** - * The id of the shipment. - */ - id: string; - /** - * The line items that are shipped. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * The status of the shipment. - */ - status: string; - /** - * The tracking id for the shipment. - */ - trackingId: string; -} -export interface Schema$OrderShipmentLineItemShipment { - /** - * The id of the line item that is shipped. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the product to ship. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity that is shipped. - */ - quantity: number; -} -export interface Schema$OrdersInStoreRefundLineItemRequest { - /** - * The amount that is refunded. Required. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. Required. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersInStoreRefundLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersInStoreRefundLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersListResponse". - */ - kind: string; - /** - * The token for the retrieval of the next page of orders. - */ - nextPageToken: string; - resources: Schema$Order[]; -} -export interface Schema$OrdersRefundRequest { - /** - * The amount that is refunded. - */ - amount: Schema$Price; - /** - * The amount that is refunded. Either amount or amountPretax and amountTax - * should be filled. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The reason for the refund. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersRefundResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersRefundResponse". - */ - kind: string; -} -export interface Schema$OrdersRejectReturnLineItemRequest { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersRejectReturnLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersRejectReturnLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersReturnLineItemRequest { - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersReturnLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersReturnLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersReturnRefundLineItemRequest { - /** - * The amount that is refunded. Optional, but if filled then both amountPretax - * and amountTax must be set. - */ - amountPretax: Schema$Price; - /** - * Tax amount that correspond to refund amount in amountPretax. - */ - amountTax: Schema$Price; - /** - * The ID of the line item to return. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to return. This is the REST ID used in the products - * service. Either lineItemId or productId is required. - */ - productId: string; - /** - * The quantity to return and refund. - */ - quantity: number; - /** - * The reason for the return. - */ - reason: string; - /** - * The explanation of the reason. - */ - reasonText: string; -} -export interface Schema$OrdersReturnRefundLineItemResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersReturnRefundLineItemResponse". - */ - kind: string; -} -export interface Schema$OrdersSetLineItemMetadataRequest { - annotations: Schema$OrderMerchantProvidedAnnotation[]; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; -} -export interface Schema$OrdersSetLineItemMetadataResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersSetLineItemMetadataResponse". - */ - kind: string; -} -export interface Schema$OrdersShipLineItemsRequest { - /** - * Deprecated. Please use shipmentInfo instead. The carrier handling the - * shipment. See shipments[].carrier in the Orders resource representation - * for a list of acceptable values. - */ - carrier: string; - /** - * Line items to ship. - */ - lineItems: Schema$OrderShipmentLineItemShipment[]; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * Deprecated. Please use shipmentInfo instead. The ID of the shipment. - */ - shipmentId: string; - /** - * Shipment information. This field is repeated because a single line item can - * be shipped in several packages (and have several tracking IDs). - */ - shipmentInfos: - Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; - /** - * Deprecated. Please use shipmentInfo instead. The tracking id for the - * shipment. - */ - trackingId: string; -} -export interface Schema$OrdersShipLineItemsResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersShipLineItemsResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateLineItemShippingDetailsRequest { - /** - * Updated delivery by date, in ISO 8601 format. If not specified only ship by - * date is updated. - */ - deliverByDate: string; - /** - * The ID of the line item to set metadata. Either lineItemId or productId is - * required. - */ - lineItemId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the product to set metadata. This is the REST ID used in the - * products service. Either lineItemId or productId is required. - */ - productId: string; - /** - * Updated ship by date, in ISO 8601 format. If not specified only deliver by - * date is updated. - */ - shipByDate: string; -} -export interface Schema$OrdersUpdateLineItemShippingDetailsResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateLineItemShippingDetailsResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateMerchantOrderIdRequest { - /** - * The merchant order id to be assigned to the order. Must be unique per - * merchant. - */ - merchantOrderId: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; -} -export interface Schema$OrdersUpdateMerchantOrderIdResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateMerchantOrderIdResponse". - */ - kind: string; -} -export interface Schema$OrdersUpdateShipmentRequest { - /** - * The carrier handling the shipment. Not updated if missing. See - * shipments[].carrier in the Orders resource representation for a list of - * acceptable values. - */ - carrier: string; - /** - * The ID of the operation. Unique across all operations for a given order. - */ - operationId: string; - /** - * The ID of the shipment. - */ - shipmentId: string; - /** - * New status for the shipment. Not updated if missing. - */ - status: string; - /** - * The tracking id for the shipment. Not updated if missing. - */ - trackingId: string; -} -export interface Schema$OrdersUpdateShipmentResponse { - /** - * The status of the execution. - */ - executionStatus: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#ordersUpdateShipmentResponse". - */ - kind: string; -} -export interface Schema$Price { - /** - * The currency of the price. - */ - currency: string; - /** - * The price represented as a number. - */ - value: string; -} -export interface Schema$TestOrder { - /** - * The details of the customer who placed the order. - */ - customer: Schema$TestOrderCustomer; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "content#testOrder". - */ - kind: string; - /** - * Line items that are ordered. At least one line item must be provided. - */ - lineItems: Schema$TestOrderLineItem[]; - /** - * Determines if test order must be pulled by merchant or pushed to merchant - * via push integration. - */ - notificationMode: string; - /** - * The details of the payment method. - */ - paymentMethod: Schema$TestOrderPaymentMethod; - /** - * Identifier of one of the predefined delivery addresses for the delivery. - */ - predefinedDeliveryAddress: string; - /** - * The details of the merchant provided promotions applied to the order. More - * details about the program are here. - */ - promotions: Schema$OrderPromotion[]; - /** - * The total cost of shipping for all items. - */ - shippingCost: Schema$Price; - /** - * The tax for the total shipping cost. - */ - shippingCostTax: Schema$Price; - /** - * The requested shipping option. - */ - shippingOption: string; -} -export interface Schema$TestOrderCustomer { - /** - * Email address of the customer. - */ - email: string; - /** - * Deprecated. Please use marketingRightsInfo instead. - */ - explicitMarketingPreference: boolean; - /** - * Full name of the customer. - */ - fullName: string; - /** - * Customer's marketing preferences. - */ - marketingRightsInfo: Schema$TestOrderCustomerMarketingRightsInfo; -} -export interface Schema$TestOrderCustomerMarketingRightsInfo { - /** - * Last know user use selection regards marketing preferences. In certain - * cases selection might not be known, so this field would be empty. - */ - explicitMarketingPreference: string; +export namespace content_v2sandbox { /** - * Timestamp when last time marketing preference was updated. Could be empty, - * if user wasn't offered a selection yet. - */ - lastUpdatedTimestamp: string; -} -export interface Schema$TestOrderLineItem { - /** - * Product data from the time of the order placement. - */ - product: Schema$TestOrderLineItemProduct; - /** - * Number of items ordered. - */ - quantityOrdered: number; - /** - * Details of the return policy for the line item. - */ - returnInfo: Schema$OrderLineItemReturnInfo; - /** - * Details of the requested shipping for the line item. - */ - shippingDetails: Schema$OrderLineItemShippingDetails; - /** - * Unit tax for the line item. - */ - unitTax: Schema$Price; -} -export interface Schema$TestOrderLineItemProduct { - /** - * Brand of the item. - */ - brand: string; - /** - * The item's channel. - */ - channel: string; - /** - * Condition or state of the item. - */ - condition: string; - /** - * The two-letter ISO 639-1 language code for the item. - */ - contentLanguage: string; - /** - * Global Trade Item Number (GTIN) of the item. Optional. - */ - gtin: string; - /** - * URL of an image of the item. - */ - imageLink: string; - /** - * Shared identifier for all variants of the same product. Optional. - */ - itemGroupId: string; - /** - * Manufacturer Part Number (MPN) of the item. Optional. - */ - mpn: string; - /** - * An identifier of the item. - */ - offerId: string; - /** - * The price for the product. - */ - price: Schema$Price; - /** - * The CLDR territory code of the target country of the product. - */ - targetCountry: string; - /** - * The title of the product. - */ - title: string; - /** - * Variant attributes for the item. Optional. - */ - variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; -} -export interface Schema$TestOrderPaymentMethod { - /** - * The card expiration month (January = 1, February = 2 etc.). - */ - expirationMonth: number; - /** - * The card expiration year (4-digit, e.g. 2015). - */ - expirationYear: number; - /** - * The last four digits of the card number. - */ - lastFourDigits: string; - /** - * The billing address. - */ - predefinedBillingAddress: string; - /** - * The type of instrument. Note that real orders might have different values - * than the four values accepted by createTestOrder. - */ - type: string; -} - -export class Resource$Orders { - root: Content; - constructor(root: Content) { - this.root = root; - this.getRoot.bind(this); - } + * Content API for Shopping + * + * Manages product items, inventory, and Merchant Center accounts for Google + * Shopping. + * + * @example + * const google = require('googleapis'); + * const content = google.content('v2sandbox'); + * + * @namespace content + * @type {Function} + * @version v2sandbox + * @variation v2sandbox + * @param {object=} options Options for Content + */ + export class Content { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + orders: Resource$Orders; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * content.orders.acknowledge - * @desc Marks an order as acknowledged. - * @alias content.orders.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersAcknowledgeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.orders = new Resource$Orders(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - /** - * content.orders.advancetestorder - * @desc Sandbox only. Moves a test order from state "inProgress" to state - * "pendingShipment". - * @alias content.orders.advancetestorder - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the test order to modify. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - advancetestorder(params?: any, options?: MethodOptions): - AxiosPromise; - advancetestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - advancetestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/testorders/{orderId}/advance') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * An error returned by the API. + */ + export interface Schema$Error { + /** + * The domain of the error. + */ + domain: string; + /** + * A description of the error. + */ + message: string; + /** + * The error code. + */ + reason: string; } - - /** - * content.orders.cancel - * @desc Cancels all line items in an order, making a full refund. - * @alias content.orders.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order to cancel. - * @param {().OrdersCancelRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of errors returned by a failed batch entry. + */ + export interface Schema$Errors { + /** + * The HTTP status of the first error in errors. + */ + code: number; + /** + * A list of errors. + */ + errors: Schema$Error[]; + /** + * The message of the first error in errors. + */ + message: string; + } + export interface Schema$Order { + /** + * Whether the order was acknowledged. + */ + acknowledged: boolean; + /** + * The channel type of the order: "purchaseOnGoogle" or + * "googleExpress". + */ + channelType: string; + /** + * The details of the customer who placed the order. + */ + customer: Schema$OrderCustomer; + /** + * The details for the delivery. + */ + deliveryDetails: Schema$OrderDeliveryDetails; + /** + * The REST id of the order. Globally unique. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#order". + */ + kind: string; + /** + * Line items that are ordered. + */ + lineItems: Schema$OrderLineItem[]; + merchantId: string; + /** + * Merchant-provided id of the order. + */ + merchantOrderId: string; + /** + * The net amount for the order. For example, if an order was originally for + * a grand total of $100 and a refund was issued for $20, the net amount + * will be $80. + */ + netAmount: Schema$Price; + /** + * The details of the payment method. + */ + paymentMethod: Schema$OrderPaymentMethod; + /** + * The status of the payment. + */ + paymentStatus: string; + /** + * The date when the order was placed, in ISO 8601 format. + */ + placedDate: string; + /** + * The details of the merchant provided promotions applied to the order. + * More details about the program are here. + */ + promotions: Schema$OrderPromotion[]; + /** + * Refunds for the order. + */ + refunds: Schema$OrderRefund[]; + /** + * Shipments of the order. + */ + shipments: Schema$OrderShipment[]; + /** + * The total cost of shipping for all items. + */ + shippingCost: Schema$Price; + /** + * The tax for the total shipping cost. + */ + shippingCostTax: Schema$Price; + /** + * The requested shipping option. + */ + shippingOption: string; + /** + * The status of the order. + */ + status: string; + } + export interface Schema$OrderAddress { + /** + * CLDR country code (e.g. "US"). + */ + country: string; + /** + * Strings representing the lines of the printed label for mailing the + * order, for example: John Smith 1600 Amphitheatre Parkway Mountain View, + * CA, 94043 United States + */ + fullAddress: string[]; + /** + * Whether the address is a post office box. + */ + isPostOfficeBox: boolean; + /** + * City, town or commune. May also include dependent localities or + * sublocalities (e.g. neighborhoods or suburbs). + */ + locality: string; + /** + * Postal Code or ZIP (e.g. "94043"). + */ + postalCode: string; + /** + * Name of the recipient. + */ + recipientName: string; + /** + * Top-level administrative subdivision of the country (e.g. + * "CA"). + */ + region: string; + /** + * Street-level part of the address. + */ + streetAddress: string[]; + } + export interface Schema$OrderCancellation { + /** + * The actor that created the cancellation. + */ + actor: string; + /** + * Date on which the cancellation has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * The quantity that was canceled. + */ + quantity: number; + /** + * The reason for the cancellation. Orders that are cancelled with a + * noInventory reason will lead to the removal of the product from POG until + * you make an update to that product. This will not affect your Shopping + * ads. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrderCustomer { + /** + * Email address that should be used for order related communications. In + * certain cases this might not be a real users email, but a proxy email. + */ + email: string; + /** + * Deprecated. Please use marketingRightsInfo instead. + */ + explicitMarketingPreference: boolean; + /** + * Full name of the customer. + */ + fullName: string; + /** + * Customer's marketing preferences. + */ + marketingRightsInfo: Schema$OrderCustomerMarketingRightsInfo; + } + export interface Schema$OrderCustomerMarketingRightsInfo { + /** + * Last known user selection regarding marketing preferences. In certain + * cases this selection might not be known, so this field would be empty. + */ + explicitMarketingPreference: string; + /** + * Timestamp when last time marketing preference was updated. Could be + * empty, if user wasn't offered a selection yet. + */ + lastUpdatedTimestamp: string; + /** + * Email address that can be used for marketing purposes. This field is only + * filled when explicitMarketingPreference is equal to 'granted'. + */ + marketingEmailAddress: string; + } + export interface Schema$OrderDeliveryDetails { + /** + * The delivery address + */ + address: Schema$OrderAddress; + /** + * The phone number of the person receiving the delivery. + */ + phoneNumber: string; + } + export interface Schema$OrderLineItem { + /** + * Annotations that are attached to the line item. + */ + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * Cancellations of the line item. + */ + cancellations: Schema$OrderCancellation[]; + /** + * The id of the line item. + */ + id: string; + /** + * Total price for the line item. For example, if two items for $10 are + * purchased, the total price will be $20. + */ + price: Schema$Price; + /** + * Product data from the time of the order placement. + */ + product: Schema$OrderLineItemProduct; + /** + * Number of items canceled. + */ + quantityCanceled: number; + /** + * Number of items delivered. + */ + quantityDelivered: number; + /** + * Number of items ordered. + */ + quantityOrdered: number; + /** + * Number of items pending. + */ + quantityPending: number; + /** + * Number of items returned. + */ + quantityReturned: number; + /** + * Number of items shipped. + */ + quantityShipped: number; + /** + * Details of the return policy for the line item. + */ + returnInfo: Schema$OrderLineItemReturnInfo; + /** + * Returns of the line item. + */ + returns: Schema$OrderReturn[]; + /** + * Details of the requested shipping for the line item. + */ + shippingDetails: Schema$OrderLineItemShippingDetails; + /** + * Total tax amount for the line item. For example, if two items are + * purchased, and each have a cost tax of $2, the total tax amount will be + * $4. + */ + tax: Schema$Price; + } + export interface Schema$OrderLineItemProduct { + /** + * Brand of the item. + */ + brand: string; + /** + * The item's channel (online or local). + */ + channel: string; + /** + * Condition or state of the item. + */ + condition: string; + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number (GTIN) of the item. + */ + gtin: string; + /** + * The REST id of the product. + */ + id: string; + /** + * URL of an image of the item. + */ + imageLink: string; + /** + * Shared identifier for all variants of the same product. + */ + itemGroupId: string; + /** + * Manufacturer Part Number (MPN) of the item. + */ + mpn: string; + /** + * An identifier of the item. + */ + offerId: string; + /** + * Price of the item. + */ + price: Schema$Price; + /** + * URL to the cached image shown to the user when order was placed. + */ + shownImage: string; + /** + * The CLDR territory code of the target country of the product. + */ + targetCountry: string; + /** + * The title of the product. + */ + title: string; + /** + * Variant attributes for the item. These are dimensions of the product, + * such as color, gender, material, pattern, and size. You can find a + * comprehensive list of variant attributes here. + */ + variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; + } + export interface Schema$OrderLineItemProductVariantAttribute { + /** + * The dimension of the variant. + */ + dimension: string; + /** + * The value for the dimension. + */ + value: string; + } + export interface Schema$OrderLineItemReturnInfo { + /** + * How many days later the item can be returned. + */ + daysToReturn: number; + /** + * Whether the item is returnable. + */ + isReturnable: boolean; + /** + * URL of the item return policy. + */ + policyUrl: string; + } + export interface Schema$OrderLineItemShippingDetails { + /** + * The delivery by date, in ISO 8601 format. + */ + deliverByDate: string; + /** + * Details of the shipping method. + */ + method: Schema$OrderLineItemShippingDetailsMethod; + /** + * The ship by date, in ISO 8601 format. + */ + shipByDate: string; + } + export interface Schema$OrderLineItemShippingDetailsMethod { + /** + * The carrier for the shipping. Optional. See shipments[].carrier for a + * list of acceptable values. + */ + carrier: string; + /** + * Maximum transit time. + */ + maxDaysInTransit: number; + /** + * The name of the shipping method. + */ + methodName: string; + /** + * Minimum transit time. + */ + minDaysInTransit: number; + } + export interface Schema$OrderMerchantProvidedAnnotation { + /** + * Key for additional merchant provided (as key-value pairs) annotation + * about the line item. + */ + key: string; + /** + * Value for additional merchant provided (as key-value pairs) annotation + * about the line item. + */ + value: string; + } + export interface Schema$OrderPaymentMethod { + /** + * The billing address. + */ + billingAddress: Schema$OrderAddress; + /** + * The card expiration month (January = 1, February = 2 etc.). + */ + expirationMonth: number; + /** + * The card expiration year (4-digit, e.g. 2015). + */ + expirationYear: number; + /** + * The last four digits of the card number. + */ + lastFourDigits: string; + /** + * The billing phone number. + */ + phoneNumber: string; + /** + * The type of instrument. Acceptable values are: - "AMEX" - + * "DISCOVER" - "JCB" - "MASTERCARD" - + * "UNIONPAY" - "VISA" - "" + */ + type: string; + } + export interface Schema$OrderPromotion { + benefits: Schema$OrderPromotionBenefit[]; + /** + * The date and time frame when the promotion is active and ready for + * validation review. Note that the promotion live time may be delayed for a + * few hours due to the validation review. Start date and end date are + * separated by a forward slash (/). The start date is specified by the + * format (YYYY-MM-DD), followed by the letter ?T?, the time of the day when + * the sale starts (in Greenwich Mean Time, GMT), followed by an expression + * of the time zone for the sale. The end date is in the same format. + */ + effectiveDates: string; + /** + * Optional. The text code that corresponds to the promotion when applied on + * the retailer?s website. + */ + genericRedemptionCode: string; + /** + * The unique ID of the promotion. + */ + id: string; + /** + * The full title of the promotion. + */ + longTitle: string; + /** + * Whether the promotion is applicable to all products or only specific + * products. + */ + productApplicability: string; + /** + * Indicates that the promotion is valid online. + */ + redemptionChannel: string; + } + export interface Schema$OrderPromotionBenefit { + /** + * The discount in the order price when the promotion is applied. + */ + discount: Schema$Price; + /** + * The OfferId(s) that were purchased in this order and map to this specific + * benefit of the promotion. + */ + offerIds: string[]; + /** + * Further describes the benefit of the promotion. Note that we will expand + * on this enumeration as we support new promotion sub-types. + */ + subType: string; + /** + * The impact on tax when the promotion is applied. + */ + taxImpact: Schema$Price; + /** + * Describes whether the promotion applies to products (e.g. 20% off) or to + * shipping (e.g. Free Shipping). + */ + type: string; + } + export interface Schema$OrderRefund { + /** + * The actor that created the refund. + */ + actor: string; + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * Date on which the item has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrderReturn { + /** + * The actor that created the refund. + */ + actor: string; + /** + * Date on which the item has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * Quantity that is returned. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersAcknowledgeRequest { + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + } + export interface Schema$OrdersAcknowledgeResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersAcknowledgeResponse". + */ + kind: string; + } + export interface Schema$OrdersAdvanceTestOrderResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersAdvanceTestOrderResponse". + */ + kind: string; + } + export interface Schema$OrdersCancelLineItemRequest { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amount: Schema$Price; + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to cancellation amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to cancel. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to cancel. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to cancel. + */ + quantity: number; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCancelLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCancelLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersCancelRequest { + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCancelResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCancelResponse". + */ + kind: string; + } + export interface Schema$OrdersCreateTestOrderRequest { + /** + * The test order template to use. Specify as an alternative to testOrder as + * a shortcut for retrieving a template and then creating an order using + * that template. + */ + templateName: string; + /** + * The test order to create. + */ + testOrder: Schema$TestOrder; + } + export interface Schema$OrdersCreateTestOrderResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCreateTestOrderResponse". + */ + kind: string; + /** + * The ID of the newly created test order. + */ + orderId: string; + } + export interface Schema$OrdersCustomBatchRequest { + /** + * The request entries to be processed in the batch. + */ + entries: Schema$OrdersCustomBatchRequestEntry[]; + } + export interface Schema$OrdersCustomBatchRequestEntry { + /** + * An entry ID, unique within the batch request. + */ + batchId: number; + /** + * Required for cancel method. + */ + cancel: Schema$OrdersCustomBatchRequestEntryCancel; + /** + * Required for cancelLineItem method. + */ + cancelLineItem: Schema$OrdersCustomBatchRequestEntryCancelLineItem; + /** + * Required for inStoreReturnLineItem method. + */ + inStoreRefundLineItem: + Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem; + /** + * The ID of the managing account. + */ + merchantId: string; + /** + * The merchant order id. Required for updateMerchantOrderId and + * getByMerchantOrderId methods. + */ + merchantOrderId: string; + /** + * The method to apply. + */ + method: string; + /** + * The ID of the operation. Unique across all operations for a given order. + * Required for all methods beside get and getByMerchantOrderId. + */ + operationId: string; + /** + * The ID of the order. Required for all methods beside + * getByMerchantOrderId. + */ + orderId: string; + /** + * Required for refund method. + */ + refund: Schema$OrdersCustomBatchRequestEntryRefund; + /** + * Required for rejectReturnLineItem method. + */ + rejectReturnLineItem: + Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem; + /** + * Required for returnLineItem method. + */ + returnLineItem: Schema$OrdersCustomBatchRequestEntryReturnLineItem; + /** + * Required for returnRefundLineItem method. + */ + returnRefundLineItem: + Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem; + /** + * Required for setLineItemMetadata method. + */ + setLineItemMetadata: + Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata; + /** + * Required for shipLineItems method. + */ + shipLineItems: Schema$OrdersCustomBatchRequestEntryShipLineItems; + /** + * Required for updateLineItemShippingDate method. + */ + updateLineItemShippingDetails: + Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails; + /** + * Required for updateShipment method. + */ + updateShipment: Schema$OrdersCustomBatchRequestEntryUpdateShipment; + } + export interface Schema$OrdersCustomBatchRequestEntryCancel { + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryCancelLineItem { + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amount: Schema$Price; + /** + * Amount to refund for the cancelation. Optional. If not set, Google will + * calculate the default based on the price and tax of the items involved. + * The amount must not be larger than the net amount left on the order. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to cancellation amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to cancel. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to cancel. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to cancel. + */ + quantity: number; + /** + * The reason for the cancellation. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryInStoreRefundLineItem { + /** + * The amount that is refunded. Required. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. Required. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryRefund { + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * The amount that is refunded. Either amount or amountPretax and amountTax + * should be filled. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryRejectReturnLineItem { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryReturnLineItem { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntryReturnRefundLineItem { + /** + * The amount that is refunded. Optional, but if filled then both + * amountPretax and amountTax must be set. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersCustomBatchRequestEntrySetLineItemMetadata { + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryShipLineItems { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the + * shipment. See shipments[].carrier in the Orders resource representation + * for a list of acceptable values. + */ + carrier: string; + /** + * Line items to ship. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * Deprecated. Please use shipmentInfo instead. The ID of the shipment. + */ + shipmentId: string; + /** + * Shipment information. This field is repeated because a single line item + * can be shipped in several packages (and have several tracking IDs). + */ + shipmentInfos: + Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** + * Deprecated. Please use shipmentInfo instead. The tracking id for the + * shipment. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo { + /** + * The carrier handling the shipment. See shipments[].carrier in the Orders + * resource representation for a list of acceptable values. + */ + carrier: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * The tracking id for the shipment. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails { + /** + * Updated delivery by date, in ISO 8601 format. If not specified only ship + * by date is updated. + */ + deliverByDate: string; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + /** + * Updated ship by date, in ISO 8601 format. If not specified only deliver + * by date is updated. + */ + shipByDate: string; + } + export interface Schema$OrdersCustomBatchRequestEntryUpdateShipment { + /** + * The carrier handling the shipment. Not updated if missing. See + * shipments[].carrier in the Orders resource representation for a list of + * acceptable values. + */ + carrier: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * New status for the shipment. Not updated if missing. + */ + status: string; + /** + * The tracking id for the shipment. Not updated if missing. + */ + trackingId: string; + } + export interface Schema$OrdersCustomBatchResponse { + /** + * The result of the execution of the batch requests. + */ + entries: Schema$OrdersCustomBatchResponseEntry[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCustomBatchResponse". + */ + kind: string; + } + export interface Schema$OrdersCustomBatchResponseEntry { + /** + * The ID of the request entry this entry responds to. + */ + batchId: number; + /** + * A list of errors defined if and only if the request failed. + */ + errors: Schema$Errors; + /** + * The status of the execution. Only defined if the method is not get or + * getByMerchantOrderId and if the request was successful. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersCustomBatchResponseEntry". + */ + kind: string; + /** + * The retrieved order. Only defined if the method is get and if the request + * was successful. + */ + order: Schema$Order; + } + export interface Schema$OrdersGetByMerchantOrderIdResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersGetByMerchantOrderIdResponse". + */ + kind: string; + /** + * The requested order. + */ + order: Schema$Order; + } + export interface Schema$OrdersGetTestOrderTemplateResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersGetTestOrderTemplateResponse". + */ + kind: string; + /** + * The requested test order template. + */ + template: Schema$TestOrder; + } + export interface Schema$OrderShipment { + /** + * The carrier handling the shipment. Acceptable values are: - + * "gsx" - "ups" - "usps" - + * "fedex" - "dhl" - "ecourier" - + * "cxt" - "google" - "ontrac" - + * "emsy" - "ont" - "deliv" - + * "dynamex" - "lasership" - "mpx" - + * "uds" + */ + carrier: string; + /** + * Date on which the shipment has been created, in ISO 8601 format. + */ + creationDate: string; + /** + * Date on which the shipment has been delivered, in ISO 8601 format. + * Present only if status is delievered + */ + deliveryDate: string; + /** + * The id of the shipment. + */ + id: string; + /** + * The line items that are shipped. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * The status of the shipment. + */ + status: string; + /** + * The tracking id for the shipment. + */ + trackingId: string; + } + export interface Schema$OrderShipmentLineItemShipment { + /** + * The id of the line item that is shipped. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the product to ship. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity that is shipped. + */ + quantity: number; + } + export interface Schema$OrdersInStoreRefundLineItemRequest { + /** + * The amount that is refunded. Required. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. Required. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersInStoreRefundLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersInStoreRefundLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersListResponse". + */ + kind: string; + /** + * The token for the retrieval of the next page of orders. + */ + nextPageToken: string; + resources: Schema$Order[]; + } + export interface Schema$OrdersRefundRequest { + /** + * The amount that is refunded. + */ + amount: Schema$Price; + /** + * The amount that is refunded. Either amount or amountPretax and amountTax + * should be filled. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The reason for the refund. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersRefundResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersRefundResponse". + */ + kind: string; + } + export interface Schema$OrdersRejectReturnLineItemRequest { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersRejectReturnLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersRejectReturnLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersReturnLineItemRequest { + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersReturnLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersReturnLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersReturnRefundLineItemRequest { + /** + * The amount that is refunded. Optional, but if filled then both + * amountPretax and amountTax must be set. + */ + amountPretax: Schema$Price; + /** + * Tax amount that correspond to refund amount in amountPretax. + */ + amountTax: Schema$Price; + /** + * The ID of the line item to return. Either lineItemId or productId is + * required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to return. This is the REST ID used in the products + * service. Either lineItemId or productId is required. + */ + productId: string; + /** + * The quantity to return and refund. + */ + quantity: number; + /** + * The reason for the return. + */ + reason: string; + /** + * The explanation of the reason. + */ + reasonText: string; + } + export interface Schema$OrdersReturnRefundLineItemResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersReturnRefundLineItemResponse". + */ + kind: string; + } + export interface Schema$OrdersSetLineItemMetadataRequest { + annotations: Schema$OrderMerchantProvidedAnnotation[]; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + } + export interface Schema$OrdersSetLineItemMetadataResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersSetLineItemMetadataResponse". + */ + kind: string; + } + export interface Schema$OrdersShipLineItemsRequest { + /** + * Deprecated. Please use shipmentInfo instead. The carrier handling the + * shipment. See shipments[].carrier in the Orders resource representation + * for a list of acceptable values. + */ + carrier: string; + /** + * Line items to ship. + */ + lineItems: Schema$OrderShipmentLineItemShipment[]; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * Deprecated. Please use shipmentInfo instead. The ID of the shipment. + */ + shipmentId: string; + /** + * Shipment information. This field is repeated because a single line item + * can be shipped in several packages (and have several tracking IDs). + */ + shipmentInfos: + Schema$OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo[]; + /** + * Deprecated. Please use shipmentInfo instead. The tracking id for the + * shipment. + */ + trackingId: string; + } + export interface Schema$OrdersShipLineItemsResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersShipLineItemsResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateLineItemShippingDetailsRequest { + /** + * Updated delivery by date, in ISO 8601 format. If not specified only ship + * by date is updated. + */ + deliverByDate: string; + /** + * The ID of the line item to set metadata. Either lineItemId or productId + * is required. + */ + lineItemId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the product to set metadata. This is the REST ID used in the + * products service. Either lineItemId or productId is required. + */ + productId: string; + /** + * Updated ship by date, in ISO 8601 format. If not specified only deliver + * by date is updated. + */ + shipByDate: string; + } + export interface Schema$OrdersUpdateLineItemShippingDetailsResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateLineItemShippingDetailsResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateMerchantOrderIdRequest { + /** + * The merchant order id to be assigned to the order. Must be unique per + * merchant. + */ + merchantOrderId: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + } + export interface Schema$OrdersUpdateMerchantOrderIdResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateMerchantOrderIdResponse". + */ + kind: string; + } + export interface Schema$OrdersUpdateShipmentRequest { + /** + * The carrier handling the shipment. Not updated if missing. See + * shipments[].carrier in the Orders resource representation for a list of + * acceptable values. + */ + carrier: string; + /** + * The ID of the operation. Unique across all operations for a given order. + */ + operationId: string; + /** + * The ID of the shipment. + */ + shipmentId: string; + /** + * New status for the shipment. Not updated if missing. + */ + status: string; + /** + * The tracking id for the shipment. Not updated if missing. + */ + trackingId: string; + } + export interface Schema$OrdersUpdateShipmentResponse { + /** + * The status of the execution. + */ + executionStatus: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#ordersUpdateShipmentResponse". + */ + kind: string; + } + export interface Schema$Price { + /** + * The currency of the price. + */ + currency: string; + /** + * The price represented as a number. + */ + value: string; + } + export interface Schema$TestOrder { + /** + * The details of the customer who placed the order. + */ + customer: Schema$TestOrderCustomer; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "content#testOrder". + */ + kind: string; + /** + * Line items that are ordered. At least one line item must be provided. + */ + lineItems: Schema$TestOrderLineItem[]; + /** + * Determines if test order must be pulled by merchant or pushed to merchant + * via push integration. + */ + notificationMode: string; + /** + * The details of the payment method. + */ + paymentMethod: Schema$TestOrderPaymentMethod; + /** + * Identifier of one of the predefined delivery addresses for the delivery. + */ + predefinedDeliveryAddress: string; + /** + * The details of the merchant provided promotions applied to the order. + * More details about the program are here. + */ + promotions: Schema$OrderPromotion[]; + /** + * The total cost of shipping for all items. + */ + shippingCost: Schema$Price; + /** + * The tax for the total shipping cost. + */ + shippingCostTax: Schema$Price; + /** + * The requested shipping option. + */ + shippingOption: string; + } + export interface Schema$TestOrderCustomer { + /** + * Email address of the customer. + */ + email: string; + /** + * Deprecated. Please use marketingRightsInfo instead. + */ + explicitMarketingPreference: boolean; + /** + * Full name of the customer. + */ + fullName: string; + /** + * Customer's marketing preferences. + */ + marketingRightsInfo: Schema$TestOrderCustomerMarketingRightsInfo; + } + export interface Schema$TestOrderCustomerMarketingRightsInfo { + /** + * Last know user use selection regards marketing preferences. In certain + * cases selection might not be known, so this field would be empty. + */ + explicitMarketingPreference: string; + /** + * Timestamp when last time marketing preference was updated. Could be + * empty, if user wasn't offered a selection yet. + */ + lastUpdatedTimestamp: string; + } + export interface Schema$TestOrderLineItem { + /** + * Product data from the time of the order placement. + */ + product: Schema$TestOrderLineItemProduct; + /** + * Number of items ordered. + */ + quantityOrdered: number; + /** + * Details of the return policy for the line item. + */ + returnInfo: Schema$OrderLineItemReturnInfo; + /** + * Details of the requested shipping for the line item. + */ + shippingDetails: Schema$OrderLineItemShippingDetails; + /** + * Unit tax for the line item. + */ + unitTax: Schema$Price; + } + export interface Schema$TestOrderLineItemProduct { + /** + * Brand of the item. + */ + brand: string; + /** + * The item's channel. + */ + channel: string; + /** + * Condition or state of the item. + */ + condition: string; + /** + * The two-letter ISO 639-1 language code for the item. + */ + contentLanguage: string; + /** + * Global Trade Item Number (GTIN) of the item. Optional. + */ + gtin: string; + /** + * URL of an image of the item. + */ + imageLink: string; + /** + * Shared identifier for all variants of the same product. Optional. + */ + itemGroupId: string; + /** + * Manufacturer Part Number (MPN) of the item. Optional. + */ + mpn: string; + /** + * An identifier of the item. + */ + offerId: string; + /** + * The price for the product. + */ + price: Schema$Price; + /** + * The CLDR territory code of the target country of the product. + */ + targetCountry: string; + /** + * The title of the product. + */ + title: string; + /** + * Variant attributes for the item. Optional. + */ + variantAttributes: Schema$OrderLineItemProductVariantAttribute[]; + } + export interface Schema$TestOrderPaymentMethod { + /** + * The card expiration month (January = 1, February = 2 etc.). + */ + expirationMonth: number; + /** + * The card expiration year (4-digit, e.g. 2015). + */ + expirationYear: number; + /** + * The last four digits of the card number. + */ + lastFourDigits: string; + /** + * The billing address. + */ + predefinedBillingAddress: string; + /** + * The type of instrument. Note that real orders might have different values + * than the four values accepted by createTestOrder. + */ + type: string; } - - /** - * content.orders.cancellineitem - * @desc Cancels a line item, making a full refund. - * @alias content.orders.cancellineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersCancelLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancellineitem(params?: any, options?: MethodOptions): - AxiosPromise; - cancellineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - cancellineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Orders { + root: Content; + constructor(root: Content) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/cancelLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * content.orders.createtestorder - * @desc Sandbox only. Creates a test order. - * @alias content.orders.createtestorder - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. - * @param {().OrdersCreateTestOrderRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createtestorder(params?: any, options?: MethodOptions): - AxiosPromise; - createtestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - createtestorder( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.acknowledge + * @desc Marks an order as acknowledged. + * @alias content.orders.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersAcknowledgeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + acknowledge( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2sandbox/{merchantId}/testorders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * content.orders.custombatch - * @desc Retrieves or modifies multiple orders in a single request. - * @alias content.orders.custombatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().OrdersCustomBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - custombatch(params?: any, options?: MethodOptions): - AxiosPromise; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - custombatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2sandbox/orders/batch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * content.orders.advancetestorder + * @desc Sandbox only. Moves a test order from state "inProgress" to state + * "pendingShipment". + * @alias content.orders.advancetestorder + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the test order to modify. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + advancetestorder(params?: any, options?: MethodOptions): + AxiosPromise; + advancetestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + advancetestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/testorders/{orderId}/advance') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * content.orders.get - * @desc Retrieves an order from your Merchant Center account. - * @alias content.orders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.cancel + * @desc Cancels all line items in an order, making a full refund. + * @alias content.orders.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order to cancel. + * @param {().OrdersCancelRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2sandbox/{merchantId}/orders/{orderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * content.orders.getbymerchantorderid - * @desc Retrieves an order using merchant order id. - * @alias content.orders.getbymerchantorderid - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.merchantOrderId The merchant order id to be looked for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getbymerchantorderid(params?: any, options?: MethodOptions): - AxiosPromise; - getbymerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - getbymerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/ordersbymerchantid/{merchantOrderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'merchantOrderId'], - pathParams: ['merchantId', 'merchantOrderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * content.orders.cancellineitem + * @desc Cancels a line item, making a full refund. + * @alias content.orders.cancellineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersCancelLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancellineitem(params?: any, options?: MethodOptions): + AxiosPromise; + cancellineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + cancellineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/cancelLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * content.orders.gettestordertemplate - * @desc Sandbox only. Retrieves an order template that can be used to quickly - * create a new order in sandbox. - * @alias content.orders.gettestordertemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. - * @param {string} params.templateName The name of the template to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - gettestordertemplate(params?: any, options?: MethodOptions): - AxiosPromise; - gettestordertemplate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - gettestordertemplate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.createtestorder + * @desc Sandbox only. Creates a test order. + * @alias content.orders.createtestorder + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. + * @param {().OrdersCreateTestOrderRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createtestorder(params?: any, options?: MethodOptions): + AxiosPromise; + createtestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + createtestorder( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2sandbox/{merchantId}/testorders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/testordertemplates/{templateName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId', 'templateName'], - pathParams: ['merchantId', 'templateName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * content.orders.instorerefundlineitem - * @desc Notifies that item return and refund was handled directly in store. - * @alias content.orders.instorerefundlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersInStoreRefundLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instorerefundlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - instorerefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - instorerefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/inStoreRefundLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * content.orders.custombatch + * @desc Retrieves or modifies multiple orders in a single request. + * @alias content.orders.custombatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().OrdersCustomBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + custombatch(params?: any, options?: MethodOptions): + AxiosPromise; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + custombatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2sandbox/orders/batch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * content.orders.list - * @desc Lists the orders in your Merchant Center account. - * @alias content.orders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledged Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. - * @param {integer=} params.maxResults The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. Known issue: All List calls will return all Orders without limit regardless of the value of this field. - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string=} params.orderBy The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string=} params.placedDateEnd Obtains orders placed before this date (exclusively), in ISO 8601 format. - * @param {string=} params.placedDateStart Obtains orders placed after this date (inclusively), in ISO 8601 format. - * @param {string=} params.statuses Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.get + * @desc Retrieves an order from your Merchant Center account. + * @alias content.orders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/content/v2sandbox/{merchantId}/orders/{orderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/content/v2sandbox/{merchantId}/orders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['merchantId'], - pathParams: ['merchantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * content.orders.refund - * @desc Refund a portion of the order, up to the full amount paid. - * @alias content.orders.refund - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order to refund. - * @param {().OrdersRefundRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - refund(params?: any, options?: MethodOptions): - AxiosPromise; - refund( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - refund( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/refund') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * content.orders.getbymerchantorderid + * @desc Retrieves an order using merchant order id. + * @alias content.orders.getbymerchantorderid + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.merchantOrderId The merchant order id to be looked for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getbymerchantorderid(params?: any, options?: MethodOptions): + AxiosPromise; + getbymerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getbymerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/ordersbymerchantid/{merchantOrderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'merchantOrderId'], + pathParams: ['merchantId', 'merchantOrderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * content.orders.rejectreturnlineitem - * @desc Rejects return on an line item. - * @alias content.orders.rejectreturnlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersRejectReturnLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rejectreturnlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - rejectreturnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - rejectreturnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.gettestordertemplate + * @desc Sandbox only. Retrieves an order template that can be used to + * quickly create a new order in sandbox. + * @alias content.orders.gettestordertemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that should manage the order. This cannot be a multi-client account. + * @param {string} params.templateName The name of the template to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + gettestordertemplate(params?: any, options?: MethodOptions): + AxiosPromise; + gettestordertemplate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + gettestordertemplate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/testordertemplates/{templateName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId', 'templateName'], + pathParams: ['merchantId', 'templateName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/rejectReturnLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * content.orders.returnlineitem - * @desc Returns a line item. - * @alias content.orders.returnlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersReturnLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - returnlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - returnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - returnlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/returnLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * content.orders.instorerefundlineitem + * @desc Notifies that item return and refund was handled directly in store. + * @alias content.orders.instorerefundlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersInStoreRefundLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instorerefundlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + instorerefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + instorerefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/inStoreRefundLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * content.orders.returnrefundlineitem - * @desc Returns and refunds a line item. Note that this method can only be - * called on fully shipped orders. - * @alias content.orders.returnrefundlineitem - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersReturnRefundLineItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - returnrefundlineitem(params?: any, options?: MethodOptions): - AxiosPromise; - returnrefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - returnrefundlineitem( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.list + * @desc Lists the orders in your Merchant Center account. + * @alias content.orders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledged Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged. We recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned. + * @param {integer=} params.maxResults The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page. Known issue: All List calls will return all Orders without limit regardless of the value of this field. + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string=} params.orderBy The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. "placedDate desc" stands for listing orders by placement date, from oldest to most recent. "placedDate asc" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string=} params.placedDateEnd Obtains orders placed before this date (exclusively), in ISO 8601 format. + * @param {string=} params.placedDateStart Obtains orders placed after this date (inclusively), in ISO 8601 format. + * @param {string=} params.statuses Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/content/v2sandbox/{merchantId}/orders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['merchantId'], + pathParams: ['merchantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/returnRefundLineItem') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * content.orders.setlineitemmetadata - * @desc Sets (overrides) merchant provided annotations on the line item. - * @alias content.orders.setlineitemmetadata - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersSetLineItemMetadataRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setlineitemmetadata(params?: any, options?: MethodOptions): - AxiosPromise; - setlineitemmetadata( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - setlineitemmetadata( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/setLineItemMetadata') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * content.orders.refund + * @desc Refund a portion of the order, up to the full amount paid. + * @alias content.orders.refund + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order to refund. + * @param {().OrdersRefundRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + refund(params?: any, options?: MethodOptions): + AxiosPromise; + refund( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + refund( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/refund') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * content.orders.shiplineitems - * @desc Marks line item(s) as shipped. - * @alias content.orders.shiplineitems - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersShipLineItemsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - shiplineitems(params?: any, options?: MethodOptions): - AxiosPromise; - shiplineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - shiplineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.rejectreturnlineitem + * @desc Rejects return on an line item. + * @alias content.orders.rejectreturnlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersRejectReturnLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rejectreturnlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + rejectreturnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + rejectreturnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/rejectReturnLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/shipLineItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * content.orders.updatelineitemshippingdetails - * @desc Updates ship by and delivery by dates for a line item. - * @alias content.orders.updatelineitemshippingdetails - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateLineItemShippingDetailsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatelineitemshippingdetails(params?: any, options?: MethodOptions): - AxiosPromise; - updatelineitemshippingdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$OrdersUpdateLineItemShippingDetailsResponse>): void; - updatelineitemshippingdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$OrdersUpdateLineItemShippingDetailsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/updateLineItemShippingDetails') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$OrdersUpdateLineItemShippingDetailsResponse>(parameters); + /** + * content.orders.returnlineitem + * @desc Returns a line item. + * @alias content.orders.returnlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersReturnLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + returnlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + returnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + returnlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/returnLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * content.orders.updatemerchantorderid - * @desc Updates the merchant order ID for a given order. - * @alias content.orders.updatemerchantorderid - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateMerchantOrderIdRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatemerchantorderid(params?: any, options?: MethodOptions): - AxiosPromise; - updatemerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - updatemerchantorderid( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.returnrefundlineitem + * @desc Returns and refunds a line item. Note that this method can only be + * called on fully shipped orders. + * @alias content.orders.returnrefundlineitem + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersReturnRefundLineItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + returnrefundlineitem(params?: any, options?: MethodOptions): + AxiosPromise; + returnrefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + returnrefundlineitem( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/returnRefundLineItem') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * content.orders.setlineitemmetadata + * @desc Sets (overrides) merchant provided annotations on the line item. + * @alias content.orders.setlineitemmetadata + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersSetLineItemMetadataRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setlineitemmetadata(params?: any, options?: MethodOptions): + AxiosPromise; + setlineitemmetadata( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + setlineitemmetadata( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/setLineItemMetadata') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/updateMerchantOrderId') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * content.orders.shiplineitems + * @desc Marks line item(s) as shipped. + * @alias content.orders.shiplineitems + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersShipLineItemsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + shiplineitems(params?: any, options?: MethodOptions): + AxiosPromise; + shiplineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + shiplineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/shipLineItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * content.orders.updateshipment - * @desc Updates a shipment's status, carrier, and/or tracking ID. - * @alias content.orders.updateshipment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. - * @param {string} params.orderId The ID of the order. - * @param {().OrdersUpdateShipmentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateshipment(params?: any, options?: MethodOptions): - AxiosPromise; - updateshipment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - updateshipment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * content.orders.updatelineitemshippingdetails + * @desc Updates ship by and delivery by dates for a line item. + * @alias content.orders.updatelineitemshippingdetails + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateLineItemShippingDetailsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatelineitemshippingdetails(params?: any, options?: MethodOptions): + AxiosPromise; + updatelineitemshippingdetails( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>, + callback?: BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>): void; + updatelineitemshippingdetails( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>, + callback?: BodyResponseCallback< + Schema$OrdersUpdateLineItemShippingDetailsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/updateLineItemShippingDetails') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$OrdersUpdateLineItemShippingDetailsResponse>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * content.orders.updatemerchantorderid + * @desc Updates the merchant order ID for a given order. + * @alias content.orders.updatemerchantorderid + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateMerchantOrderIdRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatemerchantorderid(params?: any, options?: MethodOptions): + AxiosPromise; + updatemerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + updatemerchantorderid( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/updateMerchantOrderId') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/content/v2sandbox/{merchantId}/orders/{orderId}/updateShipment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['merchantId', 'orderId'], - pathParams: ['merchantId', 'orderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * content.orders.updateshipment + * @desc Updates a shipment's status, carrier, and/or tracking ID. + * @alias content.orders.updateshipment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.merchantId The ID of the account that manages the order. This cannot be a multi-client account. + * @param {string} params.orderId The ID of the order. + * @param {().OrdersUpdateShipmentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateshipment(params?: any, options?: MethodOptions): + AxiosPromise; + updateshipment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + updateshipment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/content/v2sandbox/{merchantId}/orders/{orderId}/updateShipment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['merchantId', 'orderId'], + pathParams: ['merchantId', 'orderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/customsearch/v1.ts b/src/apis/customsearch/v1.ts index 9005aa69754..b673a41a25c 100644 --- a/src/apis/customsearch/v1.ts +++ b/src/apis/customsearch/v1.ts @@ -27,305 +27,312 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * CustomSearch API - * - * Searches over a website or collection of websites - * - * @example - * const google = require('googleapis'); - * const customsearch = google.customsearch('v1'); - * - * @namespace customsearch - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Customsearch - */ -export class Customsearch { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace customsearch_v1 { + /** + * CustomSearch API + * + * Searches over a website or collection of websites + * + * @example + * const google = require('googleapis'); + * const customsearch = google.customsearch('v1'); + * + * @namespace customsearch + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Customsearch + */ + export class Customsearch { + _options: GlobalOptions; + google: GoogleApis; + root = this; - cse: Resource$Cse; + cse: Resource$Cse; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.cse = new Resource$Cse(this); - } + this.cse = new Resource$Cse(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$Context { - facets: any[][]; - title: string; -} -export interface Schema$Promotion { - bodyLines: any[]; - displayLink: string; - htmlTitle: string; - image: any; - link: string; - title: string; -} -export interface Schema$Query { - count: number; - cr: string; - cx: string; - dateRestrict: string; - disableCnTwTranslation: string; - exactTerms: string; - excludeTerms: string; - fileType: string; - filter: string; - gl: string; - googleHost: string; - highRange: string; - hl: string; - hq: string; - imgColorType: string; - imgDominantColor: string; - imgSize: string; - imgType: string; - inputEncoding: string; - language: string; - linkSite: string; - lowRange: string; - orTerms: string; - outputEncoding: string; - relatedSite: string; - rights: string; - safe: string; - searchTerms: string; - searchType: string; - siteSearch: string; - siteSearchFilter: string; - sort: string; - startIndex: number; - startPage: number; - title: string; - totalResults: string; -} -export interface Schema$Result { - cacheId: string; - displayLink: string; - fileFormat: string; - formattedUrl: string; - htmlFormattedUrl: string; - htmlSnippet: string; - htmlTitle: string; - image: any; - kind: string; - labels: any[]; - link: string; - mime: string; - pagemap: any; - snippet: string; - title: string; -} -export interface Schema$Search { - context: Schema$Context; - items: Schema$Result[]; - kind: string; - promotions: Schema$Promotion[]; - queries: any; - searchInformation: any; - spelling: any; - url: any; -} -export class Resource$Cse { - root: Customsearch; - siterestrict: Resource$Cse$Siterestrict; - constructor(root: Customsearch) { - this.root = root; - this.getRoot.bind(this); - this.siterestrict = new Resource$Cse$Siterestrict(root); + export interface Schema$Context { + facets: any[][]; + title: string; } - - getRoot() { - return this.root; + export interface Schema$Promotion { + bodyLines: any[]; + displayLink: string; + htmlTitle: string; + image: any; + link: string; + title: string; + } + export interface Schema$Query { + count: number; + cr: string; + cx: string; + dateRestrict: string; + disableCnTwTranslation: string; + exactTerms: string; + excludeTerms: string; + fileType: string; + filter: string; + gl: string; + googleHost: string; + highRange: string; + hl: string; + hq: string; + imgColorType: string; + imgDominantColor: string; + imgSize: string; + imgType: string; + inputEncoding: string; + language: string; + linkSite: string; + lowRange: string; + orTerms: string; + outputEncoding: string; + relatedSite: string; + rights: string; + safe: string; + searchTerms: string; + searchType: string; + siteSearch: string; + siteSearchFilter: string; + sort: string; + startIndex: number; + startPage: number; + title: string; + totalResults: string; + } + export interface Schema$Result { + cacheId: string; + displayLink: string; + fileFormat: string; + formattedUrl: string; + htmlFormattedUrl: string; + htmlSnippet: string; + htmlTitle: string; + image: any; + kind: string; + labels: any[]; + link: string; + mime: string; + pagemap: any; + snippet: string; + title: string; + } + export interface Schema$Search { + context: Schema$Context; + items: Schema$Result[]; + kind: string; + promotions: Schema$Promotion[]; + queries: any; + searchInformation: any; + spelling: any; + url: any; } - - /** - * search.cse.list - * @desc Returns metadata about the search performed, metadata about the - * custom search engine used for the search, and the search results. - * @alias search.cse.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW. - * @param {string=} params.cr Country restrict(s). - * @param {string=} params.cx The custom search engine ID to scope this search query - * @param {string=} params.dateRestrict Specifies all search results are from a time period - * @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain - * @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results - * @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... - * @param {string=} params.filter Controls turning on or off the duplicate content filter. - * @param {string=} params.gl Geolocation of end user. - * @param {string=} params.googlehost The local Google domain to use to perform the search. - * @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query - * @param {string=} params.hl Sets the user interface language. - * @param {string=} params.hq Appends the extra query terms to the query. - * @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color. - * @param {string=} params.imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. - * @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. - * @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. - * @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL - * @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query - * @param {string=} params.lr The language restriction for the search results - * @param {integer=} params.num Number of search results to return - * @param {string=} params.orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms - * @param {string} params.q Query - * @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL - * @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. - * @param {string=} params.safe Search safety level - * @param {string=} params.searchType Specifies the search type: image. - * @param {string=} params.siteSearch Specifies all search results should be pages from a given site - * @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter - * @param {string=} params.sort The sort expression to apply to the results - * @param {integer=} params.start The index of the first result to return - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Cse { + root: Customsearch; + siterestrict: Resource$Cse$Siterestrict; + constructor(root: Customsearch) { + this.root = root; + this.getRoot.bind(this); + this.siterestrict = new Resource$Cse$Siterestrict(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/customsearch/v1').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['q'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * search.cse.list + * @desc Returns metadata about the search performed, metadata about the + * custom search engine used for the search, and the search results. + * @alias search.cse.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW. + * @param {string=} params.cr Country restrict(s). + * @param {string=} params.cx The custom search engine ID to scope this search query + * @param {string=} params.dateRestrict Specifies all search results are from a time period + * @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain + * @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results + * @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... + * @param {string=} params.filter Controls turning on or off the duplicate content filter. + * @param {string=} params.gl Geolocation of end user. + * @param {string=} params.googlehost The local Google domain to use to perform the search. + * @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * @param {string=} params.hl Sets the user interface language. + * @param {string=} params.hq Appends the extra query terms to the query. + * @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color. + * @param {string=} params.imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. + * @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. + * @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. + * @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL + * @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * @param {string=} params.lr The language restriction for the search results + * @param {integer=} params.num Number of search results to return + * @param {string=} params.orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms + * @param {string} params.q Query + * @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL + * @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. + * @param {string=} params.safe Search safety level + * @param {string=} params.searchType Specifies the search type: image. + * @param {string=} params.siteSearch Specifies all search results should be pages from a given site + * @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter + * @param {string=} params.sort The sort expression to apply to the results + * @param {integer=} params.start The index of the first result to return + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/customsearch/v1').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['q'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Cse$Siterestrict { - root: Customsearch; - constructor(root: Customsearch) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Cse$Siterestrict { + root: Customsearch; + constructor(root: Customsearch) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * search.cse.siterestrict.list - * @desc (Closed Beta API) Returns metadata about the search performed, - * metadata about the custom search engine used for the search, and the search - * results only for site-restrict cses. - * @alias search.cse.siterestrict.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW. - * @param {string=} params.cr Country restrict(s). - * @param {string=} params.cx The custom search engine ID to scope this search query - * @param {string=} params.dateRestrict Specifies all search results are from a time period - * @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain - * @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results - * @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... - * @param {string=} params.filter Controls turning on or off the duplicate content filter. - * @param {string=} params.gl Geolocation of end user. - * @param {string=} params.googlehost The local Google domain to use to perform the search. - * @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query - * @param {string=} params.hl Sets the user interface language. - * @param {string=} params.hq Appends the extra query terms to the query. - * @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color. - * @param {string=} params.imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. - * @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. - * @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. - * @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL - * @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query - * @param {string=} params.lr The language restriction for the search results - * @param {integer=} params.num Number of search results to return - * @param {string=} params.orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms - * @param {string} params.q Query - * @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL - * @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. - * @param {string=} params.safe Search safety level - * @param {string=} params.searchType Specifies the search type: image. - * @param {string=} params.siteSearch Specifies all search results should be pages from a given site - * @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter - * @param {string=} params.sort The sort expression to apply to the results - * @param {integer=} params.start The index of the first result to return - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/customsearch/v1/siterestrict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['q'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * search.cse.siterestrict.list + * @desc (Closed Beta API) Returns metadata about the search performed, + * metadata about the custom search engine used for the search, and the + * search results only for site-restrict cses. + * @alias search.cse.siterestrict.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.c2coff Turns off the translation between zh-CN and zh-TW. + * @param {string=} params.cr Country restrict(s). + * @param {string=} params.cx The custom search engine ID to scope this search query + * @param {string=} params.dateRestrict Specifies all search results are from a time period + * @param {string=} params.exactTerms Identifies a phrase that all documents in the search results must contain + * @param {string=} params.excludeTerms Identifies a word or phrase that should not appear in any documents in the search results + * @param {string=} params.fileType Returns images of a specified type. Some of the allowed values are: bmp, gif, png, jpg, svg, pdf, ... + * @param {string=} params.filter Controls turning on or off the duplicate content filter. + * @param {string=} params.gl Geolocation of end user. + * @param {string=} params.googlehost The local Google domain to use to perform the search. + * @param {string=} params.highRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * @param {string=} params.hl Sets the user interface language. + * @param {string=} params.hq Appends the extra query terms to the query. + * @param {string=} params.imgColorType Returns black and white, grayscale, or color images: mono, gray, and color. + * @param {string=} params.imgDominantColor Returns images of a specific dominant color: yellow, green, teal, blue, purple, pink, white, gray, black and brown. + * @param {string=} params.imgSize Returns images of a specified size, where size can be one of: icon, small, medium, large, xlarge, xxlarge, and huge. + * @param {string=} params.imgType Returns images of a type, which can be one of: clipart, face, lineart, news, and photo. + * @param {string=} params.linkSite Specifies that all search results should contain a link to a particular URL + * @param {string=} params.lowRange Creates a range in form as_nlo value..as_nhi value and attempts to append it to query + * @param {string=} params.lr The language restriction for the search results + * @param {integer=} params.num Number of search results to return + * @param {string=} params.orTerms Provides additional search terms to check for in a document, where each document in the search results must contain at least one of the additional search terms + * @param {string} params.q Query + * @param {string=} params.relatedSite Specifies that all search results should be pages that are related to the specified URL + * @param {string=} params.rights Filters based on licensing. Supported values include: cc_publicdomain, cc_attribute, cc_sharealike, cc_noncommercial, cc_nonderived and combinations of these. + * @param {string=} params.safe Search safety level + * @param {string=} params.searchType Specifies the search type: image. + * @param {string=} params.siteSearch Specifies all search results should be pages from a given site + * @param {string=} params.siteSearchFilter Controls whether to include or exclude results from the site named in the as_sitesearch parameter + * @param {string=} params.sort The sort expression to apply to the results + * @param {integer=} params.start The index of the first result to return + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/customsearch/v1/siterestrict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['q'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dataflow/v1b3.ts b/src/apis/dataflow/v1b3.ts index 213ecb9c6f1..2b7e2538ca8 100644 --- a/src/apis/dataflow/v1b3.ts +++ b/src/apis/dataflow/v1b3.ts @@ -27,5046 +27,5089 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Dataflow API - * - * Manages Google Cloud Dataflow projects on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const dataflow = google.dataflow('v1b3'); - * - * @namespace dataflow - * @type {Function} - * @version v1b3 - * @variation v1b3 - * @param {object=} options Options for Dataflow - */ -export class Dataflow { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dataflow_v1b3 { + /** + * Dataflow API + * + * Manages Google Cloud Dataflow projects on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const dataflow = google.dataflow('v1b3'); + * + * @namespace dataflow + * @type {Function} + * @version v1b3 + * @variation v1b3 + * @param {object=} options Options for Dataflow + */ + export class Dataflow { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Obsolete in favor of ApproximateReportedProgress and ApproximateSplitRequest. - */ -export interface Schema$ApproximateProgress { - /** - * Obsolete. - */ - percentComplete: number; - /** - * Obsolete. - */ - position: Schema$Position; - /** - * Obsolete. - */ - remainingTime: string; -} -/** - * A progress measurement of a WorkItem by a worker. - */ -export interface Schema$ApproximateReportedProgress { - /** - * Total amount of parallelism in the portion of input of this task that has - * already been consumed and is no longer active. In the first two examples - * above (see remaining_parallelism), the value should be 29 or 2 - * respectively. The sum of remaining_parallelism and consumed_parallelism - * should equal the total amount of parallelism in this work item. If - * specified, must be finite. - */ - consumedParallelism: Schema$ReportedParallelism; - /** - * Completion as fraction of the input consumed, from 0.0 (beginning, nothing - * consumed), to 1.0 (end of the input, entire input consumed). - */ - fractionConsumed: number; - /** - * A Position within the work to represent a progress. - */ - position: Schema$Position; - /** - * Total amount of parallelism in the input of this task that remains, (i.e. - * can be delegated to this task and any new tasks via dynamic splitting). - * Always at least 1 for non-finished work items and 0 for finished. - * "Amount of parallelism" refers to how many non-empty parts of the - * input can be read in parallel. This does not necessarily equal number of - * records. An input that can be read in parallel down to the individual - * records is called "perfectly splittable". An example of - * non-perfectly parallelizable input is a block-compressed file format where - * a block of records has to be read as a whole, but different blocks can be - * read in parallel. Examples: * If we are processing record #30 (starting at - * 1) out of 50 in a perfectly splittable 50-record input, this value should - * be 21 (20 remaining + 1 current). * If we are reading through block 3 in - * a block-compressed file consisting of 5 blocks, this value should be 3 - * (since blocks 4 and 5 can be processed in parallel by new tasks via - * dynamic splitting and the current task remains processing block 3). * If - * we are reading through the last block in a block-compressed file, or - * reading or processing the last record in a perfectly splittable input, - * this value should be 1, because apart from the current task, no additional - * remainder can be split off. - */ - remainingParallelism: Schema$ReportedParallelism; -} -/** - * A suggestion by the service to the worker to dynamically split the WorkItem. - */ -export interface Schema$ApproximateSplitRequest { - /** - * A fraction at which to split the work item, from 0.0 (beginning of the - * input) to 1.0 (end of the input). - */ - fractionConsumed: number; - /** - * A Position at which to split the work item. - */ - position: Schema$Position; -} -/** - * A structured message reporting an autoscaling decision made by the Dataflow - * service. - */ -export interface Schema$AutoscalingEvent { /** - * The current number of workers the job has. - */ - currentNumWorkers: string; + * Obsolete in favor of ApproximateReportedProgress and + * ApproximateSplitRequest. + */ + export interface Schema$ApproximateProgress { + /** + * Obsolete. + */ + percentComplete: number; + /** + * Obsolete. + */ + position: Schema$Position; + /** + * Obsolete. + */ + remainingTime: string; + } /** - * A message describing why the system decided to adjust the current number of - * workers, why it failed, or why the system decided to not make any changes - * to the number of workers. - */ - description: Schema$StructuredMessage; + * A progress measurement of a WorkItem by a worker. + */ + export interface Schema$ApproximateReportedProgress { + /** + * Total amount of parallelism in the portion of input of this task that has + * already been consumed and is no longer active. In the first two examples + * above (see remaining_parallelism), the value should be 29 or 2 + * respectively. The sum of remaining_parallelism and consumed_parallelism + * should equal the total amount of parallelism in this work item. If + * specified, must be finite. + */ + consumedParallelism: Schema$ReportedParallelism; + /** + * Completion as fraction of the input consumed, from 0.0 (beginning, + * nothing consumed), to 1.0 (end of the input, entire input consumed). + */ + fractionConsumed: number; + /** + * A Position within the work to represent a progress. + */ + position: Schema$Position; + /** + * Total amount of parallelism in the input of this task that remains, (i.e. + * can be delegated to this task and any new tasks via dynamic splitting). + * Always at least 1 for non-finished work items and 0 for finished. + * "Amount of parallelism" refers to how many non-empty parts of + * the input can be read in parallel. This does not necessarily equal number + * of records. An input that can be read in parallel down to the individual + * records is called "perfectly splittable". An example of + * non-perfectly parallelizable input is a block-compressed file format + * where a block of records has to be read as a whole, but different blocks + * can be read in parallel. Examples: * If we are processing record #30 + * (starting at 1) out of 50 in a perfectly splittable 50-record input, + * this value should be 21 (20 remaining + 1 current). * If we are reading + * through block 3 in a block-compressed file consisting of 5 blocks, this + * value should be 3 (since blocks 4 and 5 can be processed in parallel by + * new tasks via dynamic splitting and the current task remains processing + * block 3). * If we are reading through the last block in a + * block-compressed file, or reading or processing the last record in a + * perfectly splittable input, this value should be 1, because apart from + * the current task, no additional remainder can be split off. + */ + remainingParallelism: Schema$ReportedParallelism; + } /** - * The type of autoscaling event to report. + * A suggestion by the service to the worker to dynamically split the + * WorkItem. */ - eventType: string; + export interface Schema$ApproximateSplitRequest { + /** + * A fraction at which to split the work item, from 0.0 (beginning of the + * input) to 1.0 (end of the input). + */ + fractionConsumed: number; + /** + * A Position at which to split the work item. + */ + position: Schema$Position; + } /** - * The target number of workers the worker pool wants to resize to use. - */ - targetNumWorkers: string; + * A structured message reporting an autoscaling decision made by the Dataflow + * service. + */ + export interface Schema$AutoscalingEvent { + /** + * The current number of workers the job has. + */ + currentNumWorkers: string; + /** + * A message describing why the system decided to adjust the current number + * of workers, why it failed, or why the system decided to not make any + * changes to the number of workers. + */ + description: Schema$StructuredMessage; + /** + * The type of autoscaling event to report. + */ + eventType: string; + /** + * The target number of workers the worker pool wants to resize to use. + */ + targetNumWorkers: string; + /** + * The time this event was emitted to indicate a new target or current + * num_workers value. + */ + time: string; + /** + * A short and friendly name for the worker pool this event refers to, + * populated from the value of PoolStageRelation::user_pool_name. + */ + workerPool: string; + } /** - * The time this event was emitted to indicate a new target or current - * num_workers value. - */ - time: string; + * Settings for WorkerPool autoscaling. + */ + export interface Schema$AutoscalingSettings { + /** + * The algorithm to use for autoscaling. + */ + algorithm: string; + /** + * The maximum number of workers to cap scaling at. + */ + maxNumWorkers: number; + } /** - * A short and friendly name for the worker pool this event refers to, - * populated from the value of PoolStageRelation::user_pool_name. - */ - workerPool: string; -} -/** - * Settings for WorkerPool autoscaling. - */ -export interface Schema$AutoscalingSettings { + * Description of an interstitial value between transforms in an execution + * stage. + */ + export interface Schema$ComponentSource { + /** + * Dataflow service generated name for this source. + */ + name: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection: string; + /** + * Human-readable name for this transform; may be user or system generated. + */ + userName: string; + } /** - * The algorithm to use for autoscaling. - */ - algorithm: string; + * Description of a transform executed as part of an execution stage. + */ + export interface Schema$ComponentTransform { + /** + * Dataflow service generated name for this source. + */ + name: string; + /** + * User name for the original user transform with which this transform is + * most closely associated. + */ + originalTransform: string; + /** + * Human-readable name for this transform; may be user or system generated. + */ + userName: string; + } /** - * The maximum number of workers to cap scaling at. - */ - maxNumWorkers: number; -} -/** - * Description of an interstitial value between transforms in an execution - * stage. - */ -export interface Schema$ComponentSource { + * All configuration data for a particular Computation. + */ + export interface Schema$ComputationTopology { + /** + * The ID of the computation. + */ + computationId: string; + /** + * The inputs to the computation. + */ + inputs: Schema$StreamLocation[]; + /** + * The key ranges processed by the computation. + */ + keyRanges: Schema$KeyRangeLocation[]; + /** + * The outputs from the computation. + */ + outputs: Schema$StreamLocation[]; + /** + * The state family values. + */ + stateFamilies: Schema$StateFamilyConfig[]; + /** + * The system stage name. + */ + systemStageName: string; + } /** - * Dataflow service generated name for this source. - */ - name: string; + * A position that encapsulates an inner position and an index for the inner + * position. A ConcatPosition can be used by a reader of a source that + * encapsulates a set of other sources. + */ + export interface Schema$ConcatPosition { + /** + * Index of the inner source. + */ + index: number; + /** + * Position within the inner source. + */ + position: Schema$Position; + } /** - * User name for the original user transform or collection with which this - * source is most closely associated. - */ - originalTransformOrCollection: string; + * CounterMetadata includes all static non-name non-value counter attributes. + */ + export interface Schema$CounterMetadata { + /** + * Human-readable description of the counter semantics. + */ + description: string; + /** + * Counter aggregation kind. + */ + kind: string; + /** + * A string referring to the unit type. + */ + otherUnits: string; + /** + * System defined Units, see above enum. + */ + standardUnits: string; + } /** - * Human-readable name for this transform; may be user or system generated. - */ - userName: string; -} -/** - * Description of a transform executed as part of an execution stage. - */ -export interface Schema$ComponentTransform { + * Identifies a counter within a per-job namespace. Counters whose structured + * names are the same get merged into a single value for the job. + */ + export interface Schema$CounterStructuredName { + /** + * Name of the optimized step being executed by the workers. + */ + componentStepName: string; + /** + * Name of the stage. An execution step contains multiple component steps. + */ + executionStepName: string; + /** + * Index of an input collection that's being read from/written to as a + * side input. The index identifies a step's side inputs starting by 1 + * (e.g. the first side input has input_index 1, the third has input_index + * 3). Side inputs are identified by a pair of (original_step_name, + * input_index). This field helps uniquely identify them. + */ + inputIndex: number; + /** + * Counter name. Not necessarily globally-unique, but unique within the + * context of the other fields. Required. + */ + name: string; + /** + * One of the standard Origins defined above. + */ + origin: string; + /** + * The step name requesting an operation, such as GBK. I.e. the ParDo + * causing a read/write from shuffle to occur, or a read from side inputs. + */ + originalRequestingStepName: string; + /** + * System generated name of the original step in the user's graph, + * before optimization. + */ + originalStepName: string; + /** + * A string containing a more specific namespace of the counter's + * origin. + */ + originNamespace: string; + /** + * Portion of this counter, either key or value. + */ + portion: string; + /** + * ID of a particular worker. + */ + workerId: string; + } /** - * Dataflow service generated name for this source. - */ - name: string; + * A single message which encapsulates structured name and metadata for a + * given counter. + */ + export interface Schema$CounterStructuredNameAndMetadata { + /** + * Metadata associated with a counter + */ + metadata: Schema$CounterMetadata; + /** + * Structured name of the counter. + */ + name: Schema$CounterStructuredName; + } /** - * User name for the original user transform with which this transform is most - * closely associated. - */ - originalTransform: string; + * An update to a Counter sent from a worker. + */ + export interface Schema$CounterUpdate { + /** + * Boolean value for And, Or. + */ + boolean: boolean; + /** + * True if this counter is reported as the total cumulative aggregate value + * accumulated since the worker started working on this WorkItem. By default + * this is false, indicating that this counter is reported as a delta. + */ + cumulative: boolean; + /** + * Distribution data + */ + distribution: Schema$DistributionUpdate; + /** + * Floating point value for Sum, Max, Min. + */ + floatingPoint: number; + /** + * List of floating point numbers, for Set. + */ + floatingPointList: Schema$FloatingPointList; + /** + * Floating point mean aggregation value for Mean. + */ + floatingPointMean: Schema$FloatingPointMean; + /** + * Integer value for Sum, Max, Min. + */ + integer: Schema$SplitInt64; + /** + * Gauge data + */ + integerGauge: Schema$IntegerGauge; + /** + * List of integers, for Set. + */ + integerList: Schema$IntegerList; + /** + * Integer mean aggregation value for Mean. + */ + integerMean: Schema$IntegerMean; + /** + * Value for internally-defined counters used by the Dataflow service. + */ + internal: any; + /** + * Counter name and aggregation type. + */ + nameAndKind: Schema$NameAndKind; + /** + * The service-generated short identifier for this counter. The short_id + * -> (name, metadata) mapping is constant for the lifetime of a job. + */ + shortId: string; + /** + * List of strings, for Set. + */ + stringList: Schema$StringList; + /** + * Counter structured name and metadata. + */ + structuredNameAndMetadata: Schema$CounterStructuredNameAndMetadata; + } /** - * Human-readable name for this transform; may be user or system generated. - */ - userName: string; -} -/** - * All configuration data for a particular Computation. - */ -export interface Schema$ComputationTopology { + * Modeled after information exposed by /proc/stat. + */ + export interface Schema$CPUTime { + /** + * Average CPU utilization rate (% non-idle cpu / second) since previous + * sample. + */ + rate: number; + /** + * Timestamp of the measurement. + */ + timestamp: string; + /** + * Total active CPU time across all cores (ie., non-idle) in milliseconds + * since start-up. + */ + totalMs: string; + } /** - * The ID of the computation. - */ - computationId: string; + * A request to create a Cloud Dataflow job from a template. + */ + export interface Schema$CreateJobFromTemplateRequest { + /** + * The runtime environment for the job. + */ + environment: Schema$RuntimeEnvironment; + /** + * Required. A Cloud Storage path to the template from which to create the + * job. Must be a valid Cloud Storage URL, beginning with `gs://`. + */ + gcsPath: string; + /** + * Required. The job name to use for the created job. + */ + jobName: string; + /** + * The location to which to direct the request. + */ + location: string; + /** + * The runtime parameters to pass to the job. + */ + parameters: any; + } /** - * The inputs to the computation. + * Identifies the location of a custom souce. */ - inputs: Schema$StreamLocation[]; + export interface Schema$CustomSourceLocation { + /** + * Whether this source is stateful. + */ + stateful: boolean; + } /** - * The key ranges processed by the computation. - */ - keyRanges: Schema$KeyRangeLocation[]; + * Data disk assignment for a given VM instance. + */ + export interface Schema$DataDiskAssignment { + /** + * Mounted data disks. The order is important a data disk's 0-based + * index in this list defines which persistent directory the disk is mounted + * to, for example the list of { + * "myproject-1014-104817-4c2-harness-0-disk-0" }, { + * "myproject-1014-104817-4c2-harness-0-disk-1" }. + */ + dataDisks: string[]; + /** + * VM instance name the data disks mounted to, for example + * "myproject-1014-104817-4c2-harness-0". + */ + vmInstance: string; + } /** - * The outputs from the computation. - */ - outputs: Schema$StreamLocation[]; + * Specification of one of the bundles produced as a result of splitting a + * Source (e.g. when executing a SourceSplitRequest, or when splitting an + * active task using WorkItemStatus.dynamic_source_split), relative to the + * source being split. + */ + export interface Schema$DerivedSource { + /** + * What source to base the produced source on (if any). + */ + derivationMode: string; + /** + * Specification of the source. + */ + source: Schema$Source; + } /** - * The state family values. - */ - stateFamilies: Schema$StateFamilyConfig[]; + * Describes the data disk used by a workflow job. + */ + export interface Schema$Disk { + /** + * Disk storage type, as defined by Google Compute Engine. This must be a + * disk type appropriate to the project and zone in which the workers will + * run. If unknown or unspecified, the service will attempt to choose a + * reasonable default. For example, the standard persistent disk type is a + * resource name typically ending in "pd-standard". If SSD + * persistent disks are available, the resource name typically ends with + * "pd-ssd". The actual valid values are defined the Google + * Compute Engine API, not by the Cloud Dataflow API; consult the Google + * Compute Engine documentation for more information about determining the + * set of available disk types for a particular project and zone. Google + * Compute Engine Disk types are local to a particular project in a + * particular zone, and so the resource name will typically look something + * like this: + * compute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard + */ + diskType: string; + /** + * Directory in a VM where disk is mounted. + */ + mountPoint: string; + /** + * Size of disk in GB. If zero or unspecified, the service will attempt to + * choose a reasonable default. + */ + sizeGb: number; + } /** - * The system stage name. - */ - systemStageName: string; -} -/** - * A position that encapsulates an inner position and an index for the inner - * position. A ConcatPosition can be used by a reader of a source that - * encapsulates a set of other sources. - */ -export interface Schema$ConcatPosition { + * Data provided with a pipeline or transform to provide descriptive info. + */ + export interface Schema$DisplayData { + /** + * Contains value if the data is of a boolean type. + */ + boolValue: boolean; + /** + * Contains value if the data is of duration type. + */ + durationValue: string; + /** + * Contains value if the data is of float type. + */ + floatValue: number; + /** + * Contains value if the data is of int64 type. + */ + int64Value: string; + /** + * Contains value if the data is of java class type. + */ + javaClassValue: string; + /** + * The key identifying the display data. This is intended to be used as a + * label for the display data when viewed in a dax monitoring system. + */ + key: string; + /** + * An optional label to display in a dax UI for the element. + */ + label: string; + /** + * The namespace for the key. This is usually a class name or programming + * language namespace (i.e. python module) which defines the display data. + * This allows a dax monitoring system to specially handle the data and + * perform custom rendering. + */ + namespace: string; + /** + * A possible additional shorter value to display. For example a + * java_class_name_value of com.mypackage.MyDoFn will be stored with MyDoFn + * as the short_str_value and com.mypackage.MyDoFn as the java_class_name + * value. short_str_value can be displayed and java_class_name_value will be + * displayed as a tooltip. + */ + shortStrValue: string; + /** + * Contains value if the data is of string type. + */ + strValue: string; + /** + * Contains value if the data is of timestamp type. + */ + timestampValue: string; + /** + * An optional full URL. + */ + url: string; + } /** - * Index of the inner source. - */ - index: number; + * A metric value representing a distribution. + */ + export interface Schema$DistributionUpdate { + /** + * The count of the number of elements present in the distribution. + */ + count: Schema$SplitInt64; + /** + * (Optional) Histogram of value counts for the distribution. + */ + histogram: Schema$Histogram; + /** + * The maximum value present in the distribution. + */ + max: Schema$SplitInt64; + /** + * The minimum value present in the distribution. + */ + min: Schema$SplitInt64; + /** + * Use an int64 since we'd prefer the added precision. If overflow is a + * common problem we can detect it and use an additional int64 or a double. + */ + sum: Schema$SplitInt64; + /** + * Use a double since the sum of squares is likely to overflow int64. + */ + sumOfSquares: number; + } /** - * Position within the inner source. - */ - position: Schema$Position; -} -/** - * CounterMetadata includes all static non-name non-value counter attributes. - */ -export interface Schema$CounterMetadata { + * When a task splits using WorkItemStatus.dynamic_source_split, this message + * describes the two parts of the split relative to the description of the + * current task's input. + */ + export interface Schema$DynamicSourceSplit { + /** + * Primary part (continued to be processed by worker). Specified relative to + * the previously-current source. Becomes current. + */ + primary: Schema$DerivedSource; + /** + * Residual part (returned to the pool of work). Specified relative to the + * previously-current source. + */ + residual: Schema$DerivedSource; + } /** - * Human-readable description of the counter semantics. - */ - description: string; + * Describes the environment in which a Dataflow Job runs. + */ + export interface Schema$Environment { + /** + * The type of cluster manager API to use. If unknown or unspecified, the + * service will attempt to choose a reasonable default. This should be in + * the form of the API service name, e.g. + * "compute.googleapis.com". + */ + clusterManagerApiService: string; + /** + * The dataset for the current project where various workflow related tables + * are stored. The supported resource type is: Google BigQuery: + * bigquery.googleapis.com/{dataset} + */ + dataset: string; + /** + * The list of experiments to enable. + */ + experiments: string[]; + /** + * Experimental settings. + */ + internalExperiments: any; + /** + * The Cloud Dataflow SDK pipeline options specified by the user. These + * options are passed through the service and are used to recreate the SDK + * pipeline options on the worker in a language agnostic and platform + * independent way. + */ + sdkPipelineOptions: any; + /** + * Identity to run virtual machines as. Defaults to the default account. + */ + serviceAccountEmail: string; + /** + * The prefix of the resources the system should use for temporary storage. + * The system will append the suffix "/temp-{JOBNAME} to this resource + * prefix, where {JOBNAME} is the value of the job_name field. The + * resulting bucket and object prefix is used as the prefix of the resources + * used to store temporary data needed during the job execution. NOTE: This + * will override the value in taskrunner_settings. The supported resource + * type is: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix: string; + /** + * A description of the process that generated the request. + */ + userAgent: any; + /** + * A structure describing which components and their versions of the service + * are required in order to run the job. + */ + version: any; + /** + * The worker pools. At least one "harness" worker pool must be + * specified in order for the job to have workers. + */ + workerPools: Schema$WorkerPool[]; + } /** - * Counter aggregation kind. - */ - kind: string; + * A message describing the state of a particular execution stage. + */ + export interface Schema$ExecutionStageState { + /** + * The time at which the stage transitioned to this state. + */ + currentStateTime: string; + /** + * The name of the execution stage. + */ + executionStageName: string; + /** + * Executions stage states allow the same set of values as JobState. + */ + executionStageState: string; + } /** - * A string referring to the unit type. - */ - otherUnits: string; + * Description of the composing transforms, names/ids, and input/outputs of a + * stage of execution. Some composing transforms and sources may have been + * generated by the Dataflow service during execution planning. + */ + export interface Schema$ExecutionStageSummary { + /** + * Collections produced and consumed by component transforms of this stage. + */ + componentSource: Schema$ComponentSource[]; + /** + * Transforms that comprise this execution stage. + */ + componentTransform: Schema$ComponentTransform[]; + /** + * Dataflow service generated id for this stage. + */ + id: string; + /** + * Input sources for this stage. + */ + inputSource: Schema$StageSource[]; + /** + * Type of tranform this stage is executing. + */ + kind: string; + /** + * Dataflow service generated name for this stage. + */ + name: string; + /** + * Output sources for this stage. + */ + outputSource: Schema$StageSource[]; + } /** - * System defined Units, see above enum. + * Indicates which location failed to respond to a request for data. */ - standardUnits: string; -} -/** - * Identifies a counter within a per-job namespace. Counters whose structured - * names are the same get merged into a single value for the job. - */ -export interface Schema$CounterStructuredName { + export interface Schema$FailedLocation { + /** + * The name of the failed location. + */ + name: string; + } /** - * Name of the optimized step being executed by the workers. + * An instruction that copies its inputs (zero or more) to its (single) + * output. */ - componentStepName: string; + export interface Schema$FlattenInstruction { + /** + * Describes the inputs to the flatten instruction. + */ + inputs: Schema$InstructionInput[]; + } /** - * Name of the stage. An execution step contains multiple component steps. + * A metric value representing a list of floating point numbers. */ - executionStepName: string; + export interface Schema$FloatingPointList { + /** + * Elements of the list. + */ + elements: number[]; + } /** - * Index of an input collection that's being read from/written to as a - * side input. The index identifies a step's side inputs starting by 1 - * (e.g. the first side input has input_index 1, the third has input_index 3). - * Side inputs are identified by a pair of (original_step_name, input_index). - * This field helps uniquely identify them. - */ - inputIndex: number; + * A representation of a floating point mean metric contribution. + */ + export interface Schema$FloatingPointMean { + /** + * The number of values being aggregated. + */ + count: Schema$SplitInt64; + /** + * The sum of all values being aggregated. + */ + sum: number; + } /** - * Counter name. Not necessarily globally-unique, but unique within the - * context of the other fields. Required. - */ - name: string; + * Request to get updated debug configuration for component. + */ + export interface Schema$GetDebugConfigRequest { + /** + * The internal component id for which debug configuration is requested. + */ + componentId: string; + /** + * The location which contains the job specified by job_id. + */ + location: string; + /** + * The worker id, i.e., VM hostname. + */ + workerId: string; + } /** - * One of the standard Origins defined above. + * Response to a get debug configuration request. */ - origin: string; + export interface Schema$GetDebugConfigResponse { + /** + * The encoded debug configuration for the requested component. + */ + config: string; + } /** - * The step name requesting an operation, such as GBK. I.e. the ParDo causing - * a read/write from shuffle to occur, or a read from side inputs. - */ - originalRequestingStepName: string; + * The response to a GetTemplate request. + */ + export interface Schema$GetTemplateResponse { + /** + * The template metadata describing the template name, available parameters, + * etc. + */ + metadata: Schema$TemplateMetadata; + /** + * The status of the get template request. Any problems with the request + * will be indicated in the error_details. + */ + status: Schema$Status; + } /** - * System generated name of the original step in the user's graph, before - * optimization. + * Histogram of value counts for a distribution. Buckets have an inclusive + * lower bound and exclusive upper bound and use "1,2,5 bucketing": + * The first bucket range is from [0,1) and all subsequent bucket boundaries + * are powers of ten multiplied by 1, 2, or 5. Thus, bucket boundaries are 0, + * 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, ... Negative values are not + * supported. */ - originalStepName: string; + export interface Schema$Histogram { + /** + * Counts of values in each bucket. For efficiency, prefix and trailing + * buckets with count = 0 are elided. Buckets can store the full range of + * values of an unsigned long, with ULLONG_MAX falling into the 59th bucket + * with range [1e19, 2e19). + */ + bucketCounts: string[]; + /** + * Starting index of first stored bucket. The non-inclusive upper-bound of + * the ith bucket is given by: pow(10,(i-first_bucket_offset)/3) * + * (1,2,5)[(i-first_bucket_offset)%3] + */ + firstBucketOffset: number; + } /** - * A string containing a more specific namespace of the counter's origin. - */ - originNamespace: string; + * An input of an instruction, as a reference to an output of a producer + * instruction. + */ + export interface Schema$InstructionInput { + /** + * The output index (origin zero) within the producer. + */ + outputNum: number; + /** + * The index (origin zero) of the parallel instruction that produces the + * output to be consumed by this input. This index is relative to the list + * of instructions in this input's instruction's containing MapTask. + */ + producerInstructionIndex: number; + } /** - * Portion of this counter, either key or value. - */ - portion: string; + * An output of an instruction. + */ + export interface Schema$InstructionOutput { + /** + * The codec to use to encode data being written via this output. + */ + codec: any; + /** + * The user-provided name of this output. + */ + name: string; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the key size. + */ + onlyCountKeyBytes: boolean; + /** + * For system-generated byte and mean byte metrics, certain instructions + * should only report the value size. + */ + onlyCountValueBytes: boolean; + /** + * System-defined name for this output in the original workflow graph. + * Outputs that do not contribute to an original instruction do not set + * this. + */ + originalName: string; + /** + * System-defined name of this output. Unique across the workflow. + */ + systemName: string; + } /** - * ID of a particular worker. - */ - workerId: string; -} -/** - * A single message which encapsulates structured name and metadata for a given - * counter. - */ -export interface Schema$CounterStructuredNameAndMetadata { + * A metric value representing temporal values of a variable. + */ + export interface Schema$IntegerGauge { + /** + * The time at which this value was measured. Measured as msecs from epoch. + */ + timestamp: string; + /** + * The value of the variable represented by this gauge. + */ + value: Schema$SplitInt64; + } /** - * Metadata associated with a counter + * A metric value representing a list of integers. */ - metadata: Schema$CounterMetadata; + export interface Schema$IntegerList { + /** + * Elements of the list. + */ + elements: Schema$SplitInt64[]; + } /** - * Structured name of the counter. - */ - name: Schema$CounterStructuredName; -} -/** - * An update to a Counter sent from a worker. - */ -export interface Schema$CounterUpdate { + * A representation of an integer mean metric contribution. + */ + export interface Schema$IntegerMean { + /** + * The number of values being aggregated. + */ + count: Schema$SplitInt64; + /** + * The sum of all values being aggregated. + */ + sum: Schema$SplitInt64; + } /** - * Boolean value for And, Or. - */ - boolean: boolean; + * Defines a job to be run by the Cloud Dataflow service. + */ + export interface Schema$Job { + /** + * The client's unique identifier of the job, re-used across retried + * attempts. If this field is set, the service will ensure its uniqueness. + * The request to create a job will fail if the service has knowledge of a + * previously submitted job with the same client's ID and job name. The + * caller may use this field to ensure idempotence of job creation across + * retried attempts to create a job. By default, the field is empty and, in + * that case, the service ignores it. + */ + clientRequestId: string; + /** + * The timestamp when the job was initially created. Immutable and set by + * the Cloud Dataflow service. + */ + createTime: string; + /** + * The current state of the job. Jobs are created in the + * `JOB_STATE_STOPPED` state unless otherwise specified. A job in the + * `JOB_STATE_RUNNING` state may asynchronously enter a terminal state. + * After a job has reached a terminal state, no further state updates may be + * made. This field may be mutated by the Cloud Dataflow service; callers + * cannot mutate it. + */ + currentState: string; + /** + * The timestamp associated with the current state. + */ + currentStateTime: string; + /** + * The environment for the job. + */ + environment: Schema$Environment; + /** + * Deprecated. + */ + executionInfo: Schema$JobExecutionInfo; + /** + * The unique ID of this job. This field is set by the Cloud Dataflow + * service when the Job is created, and is immutable for the life of the + * job. + */ + id: string; + /** + * User-defined labels for this job. The labels map can contain no more + * than 64 entries. Entries of the labels map are UTF8 strings that comply + * with the following restrictions: * Keys must conform to regexp: + * \p{Ll}\p{Lo}{0,62} * Values must conform to regexp: + * [\p{Ll}\p{Lo}\p{N}_-]{0,63} * Both keys and values are additionally + * constrained to be <= 128 bytes in size. + */ + labels: any; + /** + * The location that contains this job. + */ + location: string; + /** + * The user-specified Cloud Dataflow job name. Only one Job with a given + * name may exist in a project at any given time. If a caller attempts to + * create a Job with the same name as an already-existing Job, the attempt + * returns the existing Job. The name must match the regular expression + * `[a-z]([-a-z0-9]{0,38}[a-z0-9])?` + */ + name: string; + /** + * Preliminary field: The format of this data may change at any time. A + * description of the user pipeline and stages through which it is executed. + * Created by Cloud Dataflow service. Only retrieved with + * JOB_VIEW_DESCRIPTION or JOB_VIEW_ALL. + */ + pipelineDescription: Schema$PipelineDescription; + /** + * The ID of the Cloud Platform project that the job belongs to. + */ + projectId: string; + /** + * If another job is an update of this job (and thus, this job is in + * `JOB_STATE_UPDATED`), this field contains the ID of that job. + */ + replacedByJobId: string; + /** + * If this job is an update of an existing job, this field is the job ID of + * the job it replaced. When sending a `CreateJobRequest`, you can update a + * job by specifying it here. The job named here is stopped, and its + * intermediate state is transferred to this job. + */ + replaceJobId: string; + /** + * The job's requested state. `UpdateJob` may be used to switch between + * the `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING` states, by setting + * requested_state. `UpdateJob` may also be used to directly set a + * job's requested state to `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, + * irrevocably terminating the job if it has not already reached a terminal + * state. + */ + requestedState: string; + /** + * This field may be mutated by the Cloud Dataflow service; callers cannot + * mutate it. + */ + stageStates: Schema$ExecutionStageState[]; + /** + * The top-level steps that constitute the entire job. + */ + steps: Schema$Step[]; + /** + * A set of files the system should be aware of that are used for temporary + * storage. These temporary files will be removed on job completion. No + * duplicates are allowed. No file patterns are supported. The supported + * files are: Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempFiles: string[]; + /** + * The map of transform name prefixes of the job to be replaced to the + * corresponding name prefixes of the new job. + */ + transformNameMapping: any; + /** + * The type of Cloud Dataflow job. + */ + type: string; + } /** - * True if this counter is reported as the total cumulative aggregate value - * accumulated since the worker started working on this WorkItem. By default - * this is false, indicating that this counter is reported as a delta. + * Additional information about how a Cloud Dataflow job will be executed that + * isn't contained in the submitted job. */ - cumulative: boolean; + export interface Schema$JobExecutionInfo { + /** + * A mapping from each stage to the information about that stage. + */ + stages: any; + } /** - * Distribution data + * Contains information about how a particular google.dataflow.v1beta3.Step + * will be executed. */ - distribution: Schema$DistributionUpdate; + export interface Schema$JobExecutionStageInfo { + /** + * The steps associated with the execution stage. Note that stages may have + * several steps, and that a given step might be run by more than one stage. + */ + stepName: string[]; + } /** - * Floating point value for Sum, Max, Min. - */ - floatingPoint: number; + * A particular message pertaining to a Dataflow job. + */ + export interface Schema$JobMessage { + /** + * Deprecated. + */ + id: string; + /** + * Importance level of the message. + */ + messageImportance: string; + /** + * The text of the message. + */ + messageText: string; + /** + * The timestamp of the message. + */ + time: string; + } /** - * List of floating point numbers, for Set. - */ - floatingPointList: Schema$FloatingPointList; + * JobMetrics contains a collection of metrics descibing the detailed progress + * of a Dataflow job. Metrics correspond to user-defined and system-defined + * metrics in the job. This resource captures only the most recent values of + * each metric; time-series data can be queried for them (under the same + * metric names) from Cloud Monitoring. + */ + export interface Schema$JobMetrics { + /** + * All metrics for this job. + */ + metrics: Schema$MetricUpdate[]; + /** + * Timestamp as of which metric values are current. + */ + metricTime: string; + } /** - * Floating point mean aggregation value for Mean. - */ - floatingPointMean: Schema$FloatingPointMean; + * Data disk assignment information for a specific key-range of a sharded + * computation. Currently we only support UTF-8 character splits to simplify + * encoding into JSON. + */ + export interface Schema$KeyRangeDataDiskAssignment { + /** + * The name of the data disk where data for this range is stored. This name + * is local to the Google Cloud Platform project and uniquely identifies the + * disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk: string; + /** + * The end (exclusive) of the key range. + */ + end: string; + /** + * The start (inclusive) of the key range. + */ + start: string; + } /** - * Integer value for Sum, Max, Min. - */ - integer: Schema$SplitInt64; + * Location information for a specific key-range of a sharded computation. + * Currently we only support UTF-8 character splits to simplify encoding into + * JSON. + */ + export interface Schema$KeyRangeLocation { + /** + * The name of the data disk where data for this range is stored. This name + * is local to the Google Cloud Platform project and uniquely identifies the + * disk within that project, for example + * "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk: string; + /** + * The physical location of this range assignment to be used for streaming + * computation cross-worker message delivery. + */ + deliveryEndpoint: string; + /** + * DEPRECATED. The location of the persistent state for this range, as a + * persistent directory in the worker local filesystem. + */ + deprecatedPersistentDirectory: string; + /** + * The end (exclusive) of the key range. + */ + end: string; + /** + * The start (inclusive) of the key range. + */ + start: string; + } /** - * Gauge data - */ - integerGauge: Schema$IntegerGauge; + * Parameters to provide to the template being launched. + */ + export interface Schema$LaunchTemplateParameters { + /** + * The runtime environment for the job. + */ + environment: Schema$RuntimeEnvironment; + /** + * Required. The job name to use for the created job. + */ + jobName: string; + /** + * The runtime parameters to pass to the job. + */ + parameters: any; + } /** - * List of integers, for Set. + * Response to the request to launch a template. */ - integerList: Schema$IntegerList; + export interface Schema$LaunchTemplateResponse { + /** + * The job that was launched, if the request was not a dry run and the job + * was successfully launched. + */ + job: Schema$Job; + } /** - * Integer mean aggregation value for Mean. - */ - integerMean: Schema$IntegerMean; + * Request to lease WorkItems. + */ + export interface Schema$LeaseWorkItemRequest { + /** + * The current timestamp at the worker. + */ + currentWorkerTime: string; + /** + * The location which contains the WorkItem's job. + */ + location: string; + /** + * The initial lease period. + */ + requestedLeaseDuration: string; + /** + * Worker capabilities. WorkItems might be limited to workers with specific + * capabilities. + */ + workerCapabilities: string[]; + /** + * Identifies the worker leasing work -- typically the ID of the virtual + * machine running the worker. + */ + workerId: string; + /** + * Filter for WorkItem type. + */ + workItemTypes: string[]; + } /** - * Value for internally-defined counters used by the Dataflow service. + * Response to a request to lease WorkItems. */ - internal: any; + export interface Schema$LeaseWorkItemResponse { + /** + * A list of the leased WorkItems. + */ + workItems: Schema$WorkItem[]; + } /** - * Counter name and aggregation type. - */ - nameAndKind: Schema$NameAndKind; + * Response to a request to list job messages. + */ + export interface Schema$ListJobMessagesResponse { + /** + * Autoscaling events in ascending timestamp order. + */ + autoscalingEvents: Schema$AutoscalingEvent[]; + /** + * Messages in ascending timestamp order. + */ + jobMessages: Schema$JobMessage[]; + /** + * The token to obtain the next page of results if there are more. + */ + nextPageToken: string; + } /** - * The service-generated short identifier for this counter. The short_id -> - * (name, metadata) mapping is constant for the lifetime of a job. - */ - shortId: string; + * Response to a request to list Cloud Dataflow jobs. This may be a partial + * response, depending on the page size in the ListJobsRequest. + */ + export interface Schema$ListJobsResponse { + /** + * Zero or more messages describing locations that failed to respond. + */ + failedLocation: Schema$FailedLocation[]; + /** + * A subset of the requested job information. + */ + jobs: Schema$Job[]; + /** + * Set if there may be more results than fit in this response. + */ + nextPageToken: string; + } /** - * List of strings, for Set. - */ - stringList: Schema$StringList; + * MapTask consists of an ordered set of instructions, each of which describes + * one particular low-level operation for the worker to perform in order to + * accomplish the MapTask's WorkItem. Each instruction must appear in the + * list before any instructions which depends on its output. + */ + export interface Schema$MapTask { + /** + * The instructions in the MapTask. + */ + instructions: Schema$ParallelInstruction[]; + /** + * System-defined name of the stage containing this MapTask. Unique across + * the workflow. + */ + stageName: string; + /** + * System-defined name of this MapTask. Unique across the workflow. + */ + systemName: string; + } /** - * Counter structured name and metadata. - */ - structuredNameAndMetadata: Schema$CounterStructuredNameAndMetadata; -} -/** - * Modeled after information exposed by /proc/stat. - */ -export interface Schema$CPUTime { + * The metric short id is returned to the user alongside an offset into + * ReportWorkItemStatusRequest + */ + export interface Schema$MetricShortId { + /** + * The index of the corresponding metric in the ReportWorkItemStatusRequest. + * Required. + */ + metricIndex: number; + /** + * The service-generated short identifier for the metric. + */ + shortId: string; + } /** - * Average CPU utilization rate (% non-idle cpu / second) since previous - * sample. - */ - rate: number; + * Identifies a metric, by describing the source which generated the metric. + */ + export interface Schema$MetricStructuredName { + /** + * Zero or more labeled fields which identify the part of the job this + * metric is associated with, such as the name of a step or collection. For + * example, built-in counters associated with steps will have + * context['step'] = <step-name>. Counters associated with + * PCollections in the SDK will have context['pcollection'] = + * <pcollection-name>. + */ + context: any; + /** + * Worker-defined metric name. + */ + name: string; + /** + * Origin (namespace) of metric name. May be blank for user-define metrics; + * will be "dataflow" for metrics defined by the Dataflow service + * or SDK. + */ + origin: string; + } /** - * Timestamp of the measurement. - */ - timestamp: string; + * Describes the state of a metric. + */ + export interface Schema$MetricUpdate { + /** + * True if this metric is reported as the total cumulative aggregate value + * accumulated since the worker started working on this WorkItem. By default + * this is false, indicating that this metric is reported as a delta that is + * not associated with any WorkItem. + */ + cumulative: boolean; + /** + * A struct value describing properties of a distribution of numeric values. + */ + distribution: any; + /** + * A struct value describing properties of a Gauge. Metrics of gauge type + * show the value of a metric across time, and is aggregated based on the + * newest value. + */ + gauge: any; + /** + * Worker-computed aggregate value for internal use by the Dataflow service. + */ + internal: any; + /** + * Metric aggregation kind. The possible metric aggregation kinds are + * "Sum", "Max", "Min", "Mean", + * "Set", "And", "Or", and + * "Distribution". The specified aggregation kind is + * case-insensitive. If omitted, this is not an aggregated value but + * instead a single metric sample value. + */ + kind: string; + /** + * Worker-computed aggregate value for the "Mean" aggregation + * kind. This holds the count of the aggregated values and is used in + * combination with mean_sum above to obtain the actual mean aggregate + * value. The only possible value type is Long. + */ + meanCount: any; + /** + * Worker-computed aggregate value for the "Mean" aggregation + * kind. This holds the sum of the aggregated values and is used in + * combination with mean_count below to obtain the actual mean aggregate + * value. The only possible value types are Long and Double. + */ + meanSum: any; + /** + * Name of the metric. + */ + name: Schema$MetricStructuredName; + /** + * Worker-computed aggregate value for aggregation kinds "Sum", + * "Max", "Min", "And", and "Or". + * The possible value types are Long, Double, and Boolean. + */ + scalar: any; + /** + * Worker-computed aggregate value for the "Set" aggregation kind. + * The only possible value type is a list of Values whose type can be Long, + * Double, or String, according to the metric's type. All Values in the + * list must be of the same type. + */ + set: any; + /** + * Timestamp associated with the metric value. Optional when workers are + * reporting work progress; it will be filled in responses from the metrics + * API. + */ + updateTime: string; + } /** - * Total active CPU time across all cores (ie., non-idle) in milliseconds - * since start-up. + * Describes mounted data disk. */ - totalMs: string; -} -/** - * A request to create a Cloud Dataflow job from a template. - */ -export interface Schema$CreateJobFromTemplateRequest { + export interface Schema$MountedDataDisk { + /** + * The name of the data disk. This name is local to the Google Cloud + * Platform project and uniquely identifies the disk within that project, + * for example "myproject-1014-104817-4c2-harness-0-disk-1". + */ + dataDisk: string; + } /** - * The runtime environment for the job. + * Information about an output of a multi-output DoFn. */ - environment: Schema$RuntimeEnvironment; + export interface Schema$MultiOutputInfo { + /** + * The id of the tag the user code will emit to this output by; this should + * correspond to the tag of some SideInputInfo. + */ + tag: string; + } /** - * Required. A Cloud Storage path to the template from which to create the - * job. Must be a valid Cloud Storage URL, beginning with `gs://`. - */ - gcsPath: string; + * Basic metadata about a counter. + */ + export interface Schema$NameAndKind { + /** + * Counter aggregation kind. + */ + kind: string; + /** + * Name of the counter. + */ + name: string; + } /** - * Required. The job name to use for the created job. - */ - jobName: string; + * The packages that must be installed in order for a worker to run the steps + * of the Cloud Dataflow job that will be assigned to its worker pool. This + * is the mechanism by which the Cloud Dataflow SDK causes code to be loaded + * onto the workers. For example, the Cloud Dataflow Java SDK might use this + * to install jars containing the user's code and all of the various + * dependencies (libraries, data files, etc.) required in order for that code + * to run. + */ + export interface Schema$Package { + /** + * The resource to read the package from. The supported resource type is: + * Google Cloud Storage: storage.googleapis.com/{bucket} + * bucket.storage.googleapis.com/ + */ + location: string; + /** + * The name of the package. + */ + name: string; + } /** - * The location to which to direct the request. - */ - location: string; + * Describes a particular operation comprising a MapTask. + */ + export interface Schema$ParallelInstruction { + /** + * Additional information for Flatten instructions. + */ + flatten: Schema$FlattenInstruction; + /** + * User-provided name of this operation. + */ + name: string; + /** + * System-defined name for the operation in the original workflow graph. + */ + originalName: string; + /** + * Describes the outputs of the instruction. + */ + outputs: Schema$InstructionOutput[]; + /** + * Additional information for ParDo instructions. + */ + parDo: Schema$ParDoInstruction; + /** + * Additional information for PartialGroupByKey instructions. + */ + partialGroupByKey: Schema$PartialGroupByKeyInstruction; + /** + * Additional information for Read instructions. + */ + read: Schema$ReadInstruction; + /** + * System-defined name of this operation. Unique across the workflow. + */ + systemName: string; + /** + * Additional information for Write instructions. + */ + write: Schema$WriteInstruction; + } /** - * The runtime parameters to pass to the job. - */ - parameters: any; -} -/** - * Identifies the location of a custom souce. - */ -export interface Schema$CustomSourceLocation { + * Structured data associated with this message. + */ + export interface Schema$Parameter { + /** + * Key or name for this parameter. + */ + key: string; + /** + * Value for this parameter. + */ + value: any; + } /** - * Whether this source is stateful. - */ - stateful: boolean; -} -/** - * Data disk assignment for a given VM instance. - */ -export interface Schema$DataDiskAssignment { + * Metadata for a specific parameter. + */ + export interface Schema$ParameterMetadata { + /** + * Required. The help text to display for the parameter. + */ + helpText: string; + /** + * Optional. Whether the parameter is optional. Defaults to false. + */ + isOptional: boolean; + /** + * Required. The label to display for the parameter. + */ + label: string; + /** + * Required. The name of the parameter. + */ + name: string; + /** + * Optional. Regexes that the parameter must match. + */ + regexes: string[]; + } /** - * Mounted data disks. The order is important a data disk's 0-based index - * in this list defines which persistent directory the disk is mounted to, for - * example the list of { - * "myproject-1014-104817-4c2-harness-0-disk-0" }, { - * "myproject-1014-104817-4c2-harness-0-disk-1" }. - */ - dataDisks: string[]; + * An instruction that does a ParDo operation. Takes one main input and zero + * or more side inputs, and produces zero or more outputs. Runs user code. + */ + export interface Schema$ParDoInstruction { + /** + * The input. + */ + input: Schema$InstructionInput; + /** + * Information about each of the outputs, if user_fn is a MultiDoFn. + */ + multiOutputInfos: Schema$MultiOutputInfo[]; + /** + * The number of outputs. + */ + numOutputs: number; + /** + * Zero or more side inputs. + */ + sideInputs: Schema$SideInputInfo[]; + /** + * The user function to invoke. + */ + userFn: any; + } /** - * VM instance name the data disks mounted to, for example - * "myproject-1014-104817-4c2-harness-0". - */ - vmInstance: string; -} -/** - * Specification of one of the bundles produced as a result of splitting a - * Source (e.g. when executing a SourceSplitRequest, or when splitting an active - * task using WorkItemStatus.dynamic_source_split), relative to the source being - * split. - */ -export interface Schema$DerivedSource { + * An instruction that does a partial group-by-key. One input and one output. + */ + export interface Schema$PartialGroupByKeyInstruction { + /** + * Describes the input to the partial group-by-key instruction. + */ + input: Schema$InstructionInput; + /** + * The codec to use for interpreting an element in the input PTable. + */ + inputElementCodec: any; + /** + * If this instruction includes a combining function this is the name of the + * intermediate store between the GBK and the CombineValues. + */ + originalCombineValuesInputStoreName: string; + /** + * If this instruction includes a combining function, this is the name of + * the CombineValues instruction lifted into this instruction. + */ + originalCombineValuesStepName: string; + /** + * Zero or more side inputs. + */ + sideInputs: Schema$SideInputInfo[]; + /** + * The value combining function to invoke. + */ + valueCombiningFn: any; + } /** - * What source to base the produced source on (if any). - */ - derivationMode: string; + * A descriptive representation of submitted pipeline as well as the executed + * form. This data is provided by the Dataflow service for ease of + * visualizing the pipeline and interpretting Dataflow provided metrics. + */ + export interface Schema$PipelineDescription { + /** + * Pipeline level display data. + */ + displayData: Schema$DisplayData[]; + /** + * Description of each stage of execution of the pipeline. + */ + executionPipelineStage: Schema$ExecutionStageSummary[]; + /** + * Description of each transform in the pipeline and collections between + * them. + */ + originalPipelineTransform: Schema$TransformSummary[]; + } /** - * Specification of the source. - */ - source: Schema$Source; -} -/** - * Describes the data disk used by a workflow job. - */ -export interface Schema$Disk { + * Position defines a position within a collection of data. The value can be + * either the end position, a key (used with ordered collections), a byte + * offset, or a record index. + */ + export interface Schema$Position { + /** + * Position is a byte offset. + */ + byteOffset: string; + /** + * CloudPosition is a concat position. + */ + concatPosition: Schema$ConcatPosition; + /** + * Position is past all other positions. Also useful for the end position of + * an unbounded range. + */ + end: boolean; + /** + * Position is a string key, ordered lexicographically. + */ + key: string; + /** + * Position is a record index. + */ + recordIndex: string; + /** + * CloudPosition is a base64 encoded BatchShufflePosition (with FIXED + * sharding). + */ + shufflePosition: string; + } /** - * Disk storage type, as defined by Google Compute Engine. This must be a - * disk type appropriate to the project and zone in which the workers will - * run. If unknown or unspecified, the service will attempt to choose a - * reasonable default. For example, the standard persistent disk type is a - * resource name typically ending in "pd-standard". If SSD - * persistent disks are available, the resource name typically ends with - * "pd-ssd". The actual valid values are defined the Google Compute - * Engine API, not by the Cloud Dataflow API; consult the Google Compute - * Engine documentation for more information about determining the set of - * available disk types for a particular project and zone. Google Compute - * Engine Disk types are local to a particular project in a particular zone, - * and so the resource name will typically look something like this: - * compute.googleapis.com/projects/project-id/zones/zone/diskTypes/pd-standard - */ - diskType: string; + * Identifies a pubsub location to use for transferring data into or out of a + * streaming Dataflow job. + */ + export interface Schema$PubsubLocation { + /** + * Indicates whether the pipeline allows late-arriving data. + */ + dropLateData: boolean; + /** + * If set, contains a pubsub label from which to extract record ids. If left + * empty, record deduplication will be strictly best effort. + */ + idLabel: string; + /** + * A pubsub subscription, in the form of + * "pubsub.googleapis.com/subscriptions/<project-id>/<subscription-name>" + */ + subscription: string; + /** + * If set, contains a pubsub label from which to extract record timestamps. + * If left empty, record timestamps will be generated upon arrival. + */ + timestampLabel: string; + /** + * A pubsub topic, in the form of + * "pubsub.googleapis.com/topics/<project-id>/<topic-name>" + */ + topic: string; + /** + * If set, specifies the pubsub subscription that will be used for tracking + * custom time timestamps for watermark estimation. + */ + trackingSubscription: string; + /** + * If true, then the client has requested to get pubsub attributes. + */ + withAttributes: boolean; + } /** - * Directory in a VM where disk is mounted. + * An instruction that reads records. Takes no inputs, produces one output. */ - mountPoint: string; + export interface Schema$ReadInstruction { + /** + * The source to read from. + */ + source: Schema$Source; + } /** - * Size of disk in GB. If zero or unspecified, the service will attempt to - * choose a reasonable default. - */ - sizeGb: number; -} -/** - * Data provided with a pipeline or transform to provide descriptive info. - */ -export interface Schema$DisplayData { + * Represents the level of parallelism in a WorkItem's input, reported by + * the worker. + */ + export interface Schema$ReportedParallelism { + /** + * Specifies whether the parallelism is infinite. If true, "value" + * is ignored. Infinite parallelism means the service will assume that the + * work item can always be split into more non-empty work items by dynamic + * splitting. This is a work-around for lack of support for infinity by the + * current JSON-based Java RPC stack. + */ + isInfinite: boolean; + /** + * Specifies the level of parallelism in case it is finite. + */ + value: number; + } /** - * Contains value if the data is of a boolean type. - */ - boolValue: boolean; + * Request to report the status of WorkItems. + */ + export interface Schema$ReportWorkItemStatusRequest { + /** + * The current timestamp at the worker. + */ + currentWorkerTime: string; + /** + * The location which contains the WorkItem's job. + */ + location: string; + /** + * The ID of the worker reporting the WorkItem status. If this does not + * match the ID of the worker which the Dataflow service believes currently + * has the lease on the WorkItem, the report will be dropped (with an error + * response). + */ + workerId: string; + /** + * The order is unimportant, except that the order of the + * WorkItemServiceState messages in the ReportWorkItemStatusResponse + * corresponds to the order of WorkItemStatus messages here. + */ + workItemStatuses: Schema$WorkItemStatus[]; + } /** - * Contains value if the data is of duration type. + * Response from a request to report the status of WorkItems. */ - durationValue: string; + export interface Schema$ReportWorkItemStatusResponse { + /** + * A set of messages indicating the service-side state for each WorkItem + * whose status was reported, in the same order as the WorkItemStatus + * messages in the ReportWorkItemStatusRequest which resulting in this + * response. + */ + workItemServiceStates: Schema$WorkItemServiceState[]; + } /** - * Contains value if the data is of float type. + * Worker metrics exported from workers. This contains resource utilization + * metrics accumulated from a variety of sources. For more information, see + * go/df-resource-signals. */ - floatValue: number; + export interface Schema$ResourceUtilizationReport { + /** + * CPU utilization samples. + */ + cpuTime: Schema$CPUTime[]; + } /** - * Contains value if the data is of int64 type. - */ - int64Value: string; + * Service-side response to WorkerMessage reporting resource utilization. + */ + export interface Schema$ResourceUtilizationReportResponse {} + /** + * The environment values to set at runtime. + */ + export interface Schema$RuntimeEnvironment { + /** + * Additional experiment flags for the job. + */ + additionalExperiments: string[]; + /** + * Whether to bypass the safety checks for the job's temporary + * directory. Use with caution. + */ + bypassTempDirValidation: boolean; + /** + * The machine type to use for the job. Defaults to the value from the + * template if not specified. + */ + machineType: string; + /** + * The maximum number of Google Compute Engine instances to be made + * available to your pipeline during execution, from 1 to 1000. + */ + maxWorkers: number; + /** + * Network to which VMs will be assigned. If empty or unspecified, the + * service will use the network "default". + */ + network: string; + /** + * The email address of the service account to run the job as. + */ + serviceAccountEmail: string; + /** + * Subnetwork to which VMs will be assigned, if desired. Expected to be of + * the form "regions/REGION/subnetworks/SUBNETWORK". + */ + subnetwork: string; + /** + * The Cloud Storage path to use for temporary files. Must be a valid Cloud + * Storage URL, beginning with `gs://`. + */ + tempLocation: string; + /** + * The Compute Engine [availability + * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) + * for launching worker instances to run your pipeline. + */ + zone: string; + } /** - * Contains value if the data is of java class type. - */ - javaClassValue: string; + * Request to send encoded debug information. + */ + export interface Schema$SendDebugCaptureRequest { + /** + * The internal component id for which debug information is sent. + */ + componentId: string; + /** + * The encoded debug information. + */ + data: string; + /** + * The location which contains the job specified by job_id. + */ + location: string; + /** + * The worker id, i.e., VM hostname. + */ + workerId: string; + } /** - * The key identifying the display data. This is intended to be used as a - * label for the display data when viewed in a dax monitoring system. + * Response to a send capture request. nothing */ - key: string; + export interface Schema$SendDebugCaptureResponse {} /** - * An optional label to display in a dax UI for the element. + * A request for sending worker messages to the service. */ - label: string; + export interface Schema$SendWorkerMessagesRequest { + /** + * The location which contains the job + */ + location: string; + /** + * The WorkerMessages to send. + */ + workerMessages: Schema$WorkerMessage[]; + } /** - * The namespace for the key. This is usually a class name or programming - * language namespace (i.e. python module) which defines the display data. - * This allows a dax monitoring system to specially handle the data and - * perform custom rendering. + * The response to the worker messages. */ - namespace: string; + export interface Schema$SendWorkerMessagesResponse { + /** + * The servers response to the worker messages. + */ + workerMessageResponses: Schema$WorkerMessageResponse[]; + } /** - * A possible additional shorter value to display. For example a - * java_class_name_value of com.mypackage.MyDoFn will be stored with MyDoFn as - * the short_str_value and com.mypackage.MyDoFn as the java_class_name value. - * short_str_value can be displayed and java_class_name_value will be - * displayed as a tooltip. - */ - shortStrValue: string; + * Describes a particular function to invoke. + */ + export interface Schema$SeqMapTask { + /** + * Information about each of the inputs. + */ + inputs: Schema$SideInputInfo[]; + /** + * The user-provided name of the SeqDo operation. + */ + name: string; + /** + * Information about each of the outputs. + */ + outputInfos: Schema$SeqMapTaskOutputInfo[]; + /** + * System-defined name of the stage containing the SeqDo operation. Unique + * across the workflow. + */ + stageName: string; + /** + * System-defined name of the SeqDo operation. Unique across the workflow. + */ + systemName: string; + /** + * The user function to invoke. + */ + userFn: any; + } /** - * Contains value if the data is of string type. - */ - strValue: string; + * Information about an output of a SeqMapTask. + */ + export interface Schema$SeqMapTaskOutputInfo { + /** + * The sink to write the output value to. + */ + sink: Schema$Sink; + /** + * The id of the TupleTag the user code will tag the output value by. + */ + tag: string; + } /** - * Contains value if the data is of timestamp type. - */ - timestampValue: string; + * A task which consists of a shell command for the worker to execute. + */ + export interface Schema$ShellTask { + /** + * The shell command to run. + */ + command: string; + /** + * Exit code for the task. + */ + exitCode: number; + } /** - * An optional full URL. - */ - url: string; -} -/** - * A metric value representing a distribution. - */ -export interface Schema$DistributionUpdate { + * Information about a side input of a DoFn or an input of a SeqDoFn. + */ + export interface Schema$SideInputInfo { + /** + * How to interpret the source element(s) as a side input value. + */ + kind: any; + /** + * The source(s) to read element(s) from to get the value of this side + * input. If more than one source, then the elements are taken from the + * sources, in the specified order if order matters. At least one source is + * required. + */ + sources: Schema$Source[]; + /** + * The id of the tag the user code will access this side input by; this + * should correspond to the tag of some MultiOutputInfo. + */ + tag: string; + } /** - * The count of the number of elements present in the distribution. - */ - count: Schema$SplitInt64; + * A sink that records can be encoded and written to. + */ + export interface Schema$Sink { + /** + * The codec to use to encode data written to the sink. + */ + codec: any; + /** + * The sink to write to, plus its parameters. + */ + spec: any; + } /** - * (Optional) Histogram of value counts for the distribution. - */ - histogram: Schema$Histogram; + * A source that records can be read and decoded from. + */ + export interface Schema$Source { + /** + * While splitting, sources may specify the produced bundles as differences + * against another source, in order to save backend-side memory and allow + * bigger jobs. For details, see SourceSplitRequest. To support this use + * case, the full set of parameters of the source is logically obtained by + * taking the latest explicitly specified value of each parameter in the + * order: base_specs (later items win), spec (overrides anything in + * base_specs). + */ + baseSpecs: any[]; + /** + * The codec to use to decode data read from the source. + */ + codec: any; + /** + * Setting this value to true hints to the framework that the source + * doesn't need splitting, and using SourceSplitRequest on it would + * yield SOURCE_SPLIT_OUTCOME_USE_CURRENT. E.g. a file splitter may set + * this to true when splitting a single file into a set of byte ranges of + * appropriate size, and set this to false when splitting a filepattern into + * individual files. However, for efficiency, a file splitter may decide to + * produce file subranges directly from the filepattern to avoid a splitting + * round-trip. See SourceSplitRequest for an overview of the splitting + * process. This field is meaningful only in the Source objects populated + * by the user (e.g. when filling in a DerivedSource). Source objects + * supplied by the framework to the user don't have this field + * populated. + */ + doesNotNeedSplitting: boolean; + /** + * Optionally, metadata for this source can be supplied right away, avoiding + * a SourceGetMetadataOperation roundtrip (see SourceOperationRequest). This + * field is meaningful only in the Source objects populated by the user + * (e.g. when filling in a DerivedSource). Source objects supplied by the + * framework to the user don't have this field populated. + */ + metadata: Schema$SourceMetadata; + /** + * The source to read from, plus its parameters. + */ + spec: any; + } /** - * The maximum value present in the distribution. - */ - max: Schema$SplitInt64; + * DEPRECATED in favor of DynamicSourceSplit. + */ + export interface Schema$SourceFork { + /** + * DEPRECATED + */ + primary: Schema$SourceSplitShard; + /** + * DEPRECATED + */ + primarySource: Schema$DerivedSource; + /** + * DEPRECATED + */ + residual: Schema$SourceSplitShard; + /** + * DEPRECATED + */ + residualSource: Schema$DerivedSource; + } /** - * The minimum value present in the distribution. + * A request to compute the SourceMetadata of a Source. */ - min: Schema$SplitInt64; + export interface Schema$SourceGetMetadataRequest { + /** + * Specification of the source whose metadata should be computed. + */ + source: Schema$Source; + } /** - * Use an int64 since we'd prefer the added precision. If overflow is a - * common problem we can detect it and use an additional int64 or a double. + * The result of a SourceGetMetadataOperation. */ - sum: Schema$SplitInt64; + export interface Schema$SourceGetMetadataResponse { + /** + * The computed metadata. + */ + metadata: Schema$SourceMetadata; + } /** - * Use a double since the sum of squares is likely to overflow int64. - */ - sumOfSquares: number; -} -/** - * When a task splits using WorkItemStatus.dynamic_source_split, this message - * describes the two parts of the split relative to the description of the - * current task's input. - */ -export interface Schema$DynamicSourceSplit { + * Metadata about a Source useful for automatically optimizing and tuning the + * pipeline, etc. + */ + export interface Schema$SourceMetadata { + /** + * An estimate of the total size (in bytes) of the data that would be read + * from this source. This estimate is in terms of external storage size, + * before any decompression or other processing done by the reader. + */ + estimatedSizeBytes: string; + /** + * Specifies that the size of this source is known to be infinite (this is a + * streaming source). + */ + infinite: boolean; + /** + * Whether this source is known to produce key/value pairs with the + * (encoded) keys in lexicographically sorted order. + */ + producesSortedKeys: boolean; + } /** - * Primary part (continued to be processed by worker). Specified relative to - * the previously-current source. Becomes current. - */ - primary: Schema$DerivedSource; + * A work item that represents the different operations that can be performed + * on a user-defined Source specification. + */ + export interface Schema$SourceOperationRequest { + /** + * Information about a request to get metadata about a source. + */ + getMetadata: Schema$SourceGetMetadataRequest; + /** + * User-provided name of the Read instruction for this source. + */ + name: string; + /** + * System-defined name for the Read instruction for this source in the + * original workflow graph. + */ + originalName: string; + /** + * Information about a request to split a source. + */ + split: Schema$SourceSplitRequest; + /** + * System-defined name of the stage containing the source operation. Unique + * across the workflow. + */ + stageName: string; + /** + * System-defined name of the Read instruction for this source. Unique + * across the workflow. + */ + systemName: string; + } /** - * Residual part (returned to the pool of work). Specified relative to the - * previously-current source. - */ - residual: Schema$DerivedSource; -} -/** - * Describes the environment in which a Dataflow Job runs. - */ -export interface Schema$Environment { + * The result of a SourceOperationRequest, specified in + * ReportWorkItemStatusRequest.source_operation when the work item is + * completed. + */ + export interface Schema$SourceOperationResponse { + /** + * A response to a request to get metadata about a source. + */ + getMetadata: Schema$SourceGetMetadataResponse; + /** + * A response to a request to split a source. + */ + split: Schema$SourceSplitResponse; + } /** - * The type of cluster manager API to use. If unknown or unspecified, the - * service will attempt to choose a reasonable default. This should be in the - * form of the API service name, e.g. "compute.googleapis.com". - */ - clusterManagerApiService: string; + * Hints for splitting a Source into bundles (parts for parallel processing) + * using SourceSplitRequest. + */ + export interface Schema$SourceSplitOptions { + /** + * The source should be split into a set of bundles where the estimated size + * of each is approximately this many bytes. + */ + desiredBundleSizeBytes: string; + /** + * DEPRECATED in favor of desired_bundle_size_bytes. + */ + desiredShardSizeBytes: string; + } /** - * The dataset for the current project where various workflow related tables - * are stored. The supported resource type is: Google BigQuery: - * bigquery.googleapis.com/{dataset} - */ - dataset: string; + * Represents the operation to split a high-level Source specification into + * bundles (parts for parallel processing). At a high level, splitting of a + * source into bundles happens as follows: SourceSplitRequest is applied to + * the source. If it returns SOURCE_SPLIT_OUTCOME_USE_CURRENT, no further + * splitting happens and the source is used "as is". Otherwise, + * splitting is applied recursively to each produced DerivedSource. As an + * optimization, for any Source, if its does_not_need_splitting is true, the + * framework assumes that splitting this source would return + * SOURCE_SPLIT_OUTCOME_USE_CURRENT, and doesn't initiate a + * SourceSplitRequest. This applies both to the initial source being split and + * to bundles produced from it. + */ + export interface Schema$SourceSplitRequest { + /** + * Hints for tuning the splitting process. + */ + options: Schema$SourceSplitOptions; + /** + * Specification of the source to be split. + */ + source: Schema$Source; + } /** - * The list of experiments to enable. - */ - experiments: string[]; + * The response to a SourceSplitRequest. + */ + export interface Schema$SourceSplitResponse { + /** + * If outcome is SPLITTING_HAPPENED, then this is a list of bundles into + * which the source was split. Otherwise this field is ignored. This list + * can be empty, which means the source represents an empty input. + */ + bundles: Schema$DerivedSource[]; + /** + * Indicates whether splitting happened and produced a list of bundles. If + * this is USE_CURRENT_SOURCE_AS_IS, the current source should be processed + * "as is" without splitting. "bundles" is ignored in + * this case. If this is SPLITTING_HAPPENED, then "bundles" + * contains a list of bundles into which the source was split. + */ + outcome: string; + /** + * DEPRECATED in favor of bundles. + */ + shards: Schema$SourceSplitShard[]; + } /** - * Experimental settings. - */ - internalExperiments: any; + * DEPRECATED in favor of DerivedSource. + */ + export interface Schema$SourceSplitShard { + /** + * DEPRECATED + */ + derivationMode: string; + /** + * DEPRECATED + */ + source: Schema$Source; + } /** - * The Cloud Dataflow SDK pipeline options specified by the user. These - * options are passed through the service and are used to recreate the SDK - * pipeline options on the worker in a language agnostic and platform - * independent way. - */ - sdkPipelineOptions: any; - /** - * Identity to run virtual machines as. Defaults to the default account. - */ - serviceAccountEmail: string; - /** - * The prefix of the resources the system should use for temporary storage. - * The system will append the suffix "/temp-{JOBNAME} to this resource - * prefix, where {JOBNAME} is the value of the job_name field. The resulting - * bucket and object prefix is used as the prefix of the resources used to - * store temporary data needed during the job execution. NOTE: This will - * override the value in taskrunner_settings. The supported resource type is: - * Google Cloud Storage: storage.googleapis.com/{bucket}/{object} - * bucket.storage.googleapis.com/{object} - */ - tempStoragePrefix: string; - /** - * A description of the process that generated the request. - */ - userAgent: any; - /** - * A structure describing which components and their versions of the service - * are required in order to run the job. - */ - version: any; - /** - * The worker pools. At least one "harness" worker pool must be - * specified in order for the job to have workers. - */ - workerPools: Schema$WorkerPool[]; -} -/** - * A message describing the state of a particular execution stage. - */ -export interface Schema$ExecutionStageState { - /** - * The time at which the stage transitioned to this state. - */ - currentStateTime: string; - /** - * The name of the execution stage. - */ - executionStageName: string; - /** - * Executions stage states allow the same set of values as JobState. - */ - executionStageState: string; -} -/** - * Description of the composing transforms, names/ids, and input/outputs of a - * stage of execution. Some composing transforms and sources may have been - * generated by the Dataflow service during execution planning. - */ -export interface Schema$ExecutionStageSummary { - /** - * Collections produced and consumed by component transforms of this stage. - */ - componentSource: Schema$ComponentSource[]; - /** - * Transforms that comprise this execution stage. - */ - componentTransform: Schema$ComponentTransform[]; - /** - * Dataflow service generated id for this stage. - */ - id: string; - /** - * Input sources for this stage. - */ - inputSource: Schema$StageSource[]; - /** - * Type of tranform this stage is executing. - */ - kind: string; - /** - * Dataflow service generated name for this stage. - */ - name: string; - /** - * Output sources for this stage. - */ - outputSource: Schema$StageSource[]; -} -/** - * Indicates which location failed to respond to a request for data. - */ -export interface Schema$FailedLocation { - /** - * The name of the failed location. - */ - name: string; -} -/** - * An instruction that copies its inputs (zero or more) to its (single) output. - */ -export interface Schema$FlattenInstruction { - /** - * Describes the inputs to the flatten instruction. - */ - inputs: Schema$InstructionInput[]; -} -/** - * A metric value representing a list of floating point numbers. - */ -export interface Schema$FloatingPointList { - /** - * Elements of the list. - */ - elements: number[]; -} -/** - * A representation of a floating point mean metric contribution. - */ -export interface Schema$FloatingPointMean { - /** - * The number of values being aggregated. - */ - count: Schema$SplitInt64; - /** - * The sum of all values being aggregated. - */ - sum: number; -} -/** - * Request to get updated debug configuration for component. - */ -export interface Schema$GetDebugConfigRequest { - /** - * The internal component id for which debug configuration is requested. - */ - componentId: string; - /** - * The location which contains the job specified by job_id. - */ - location: string; - /** - * The worker id, i.e., VM hostname. - */ - workerId: string; -} -/** - * Response to a get debug configuration request. - */ -export interface Schema$GetDebugConfigResponse { - /** - * The encoded debug configuration for the requested component. - */ - config: string; -} -/** - * The response to a GetTemplate request. - */ -export interface Schema$GetTemplateResponse { - /** - * The template metadata describing the template name, available parameters, - * etc. - */ - metadata: Schema$TemplateMetadata; - /** - * The status of the get template request. Any problems with the request will - * be indicated in the error_details. - */ - status: Schema$Status; -} -/** - * Histogram of value counts for a distribution. Buckets have an inclusive - * lower bound and exclusive upper bound and use "1,2,5 bucketing": - * The first bucket range is from [0,1) and all subsequent bucket boundaries are - * powers of ten multiplied by 1, 2, or 5. Thus, bucket boundaries are 0, 1, 2, - * 5, 10, 20, 50, 100, 200, 500, 1000, ... Negative values are not supported. - */ -export interface Schema$Histogram { - /** - * Counts of values in each bucket. For efficiency, prefix and trailing - * buckets with count = 0 are elided. Buckets can store the full range of - * values of an unsigned long, with ULLONG_MAX falling into the 59th bucket - * with range [1e19, 2e19). - */ - bucketCounts: string[]; - /** - * Starting index of first stored bucket. The non-inclusive upper-bound of the - * ith bucket is given by: pow(10,(i-first_bucket_offset)/3) * - * (1,2,5)[(i-first_bucket_offset)%3] - */ - firstBucketOffset: number; -} -/** - * An input of an instruction, as a reference to an output of a producer - * instruction. - */ -export interface Schema$InstructionInput { - /** - * The output index (origin zero) within the producer. - */ - outputNum: number; - /** - * The index (origin zero) of the parallel instruction that produces the - * output to be consumed by this input. This index is relative to the list of - * instructions in this input's instruction's containing MapTask. - */ - producerInstructionIndex: number; -} -/** - * An output of an instruction. - */ -export interface Schema$InstructionOutput { - /** - * The codec to use to encode data being written via this output. - */ - codec: any; - /** - * The user-provided name of this output. - */ - name: string; - /** - * For system-generated byte and mean byte metrics, certain instructions - * should only report the key size. - */ - onlyCountKeyBytes: boolean; - /** - * For system-generated byte and mean byte metrics, certain instructions - * should only report the value size. - */ - onlyCountValueBytes: boolean; - /** - * System-defined name for this output in the original workflow graph. Outputs - * that do not contribute to an original instruction do not set this. - */ - originalName: string; - /** - * System-defined name of this output. Unique across the workflow. - */ - systemName: string; -} -/** - * A metric value representing temporal values of a variable. - */ -export interface Schema$IntegerGauge { - /** - * The time at which this value was measured. Measured as msecs from epoch. - */ - timestamp: string; - /** - * The value of the variable represented by this gauge. - */ - value: Schema$SplitInt64; -} -/** - * A metric value representing a list of integers. - */ -export interface Schema$IntegerList { - /** - * Elements of the list. - */ - elements: Schema$SplitInt64[]; -} -/** - * A representation of an integer mean metric contribution. - */ -export interface Schema$IntegerMean { - /** - * The number of values being aggregated. - */ - count: Schema$SplitInt64; - /** - * The sum of all values being aggregated. - */ - sum: Schema$SplitInt64; -} -/** - * Defines a job to be run by the Cloud Dataflow service. - */ -export interface Schema$Job { - /** - * The client's unique identifier of the job, re-used across retried - * attempts. If this field is set, the service will ensure its uniqueness. The - * request to create a job will fail if the service has knowledge of a - * previously submitted job with the same client's ID and job name. The - * caller may use this field to ensure idempotence of job creation across - * retried attempts to create a job. By default, the field is empty and, in - * that case, the service ignores it. - */ - clientRequestId: string; - /** - * The timestamp when the job was initially created. Immutable and set by the - * Cloud Dataflow service. - */ - createTime: string; - /** - * The current state of the job. Jobs are created in the `JOB_STATE_STOPPED` - * state unless otherwise specified. A job in the `JOB_STATE_RUNNING` state - * may asynchronously enter a terminal state. After a job has reached a - * terminal state, no further state updates may be made. This field may be - * mutated by the Cloud Dataflow service; callers cannot mutate it. - */ - currentState: string; - /** - * The timestamp associated with the current state. - */ - currentStateTime: string; - /** - * The environment for the job. - */ - environment: Schema$Environment; - /** - * Deprecated. - */ - executionInfo: Schema$JobExecutionInfo; - /** - * The unique ID of this job. This field is set by the Cloud Dataflow service - * when the Job is created, and is immutable for the life of the job. - */ - id: string; - /** - * User-defined labels for this job. The labels map can contain no more than - * 64 entries. Entries of the labels map are UTF8 strings that comply with - * the following restrictions: * Keys must conform to regexp: - * \p{Ll}\p{Lo}{0,62} * Values must conform to regexp: - * [\p{Ll}\p{Lo}\p{N}_-]{0,63} * Both keys and values are additionally - * constrained to be <= 128 bytes in size. - */ - labels: any; - /** - * The location that contains this job. - */ - location: string; - /** - * The user-specified Cloud Dataflow job name. Only one Job with a given name - * may exist in a project at any given time. If a caller attempts to create a - * Job with the same name as an already-existing Job, the attempt returns the - * existing Job. The name must match the regular expression - * `[a-z]([-a-z0-9]{0,38}[a-z0-9])?` - */ - name: string; - /** - * Preliminary field: The format of this data may change at any time. A - * description of the user pipeline and stages through which it is executed. - * Created by Cloud Dataflow service. Only retrieved with - * JOB_VIEW_DESCRIPTION or JOB_VIEW_ALL. - */ - pipelineDescription: Schema$PipelineDescription; - /** - * The ID of the Cloud Platform project that the job belongs to. - */ - projectId: string; - /** - * If another job is an update of this job (and thus, this job is in - * `JOB_STATE_UPDATED`), this field contains the ID of that job. - */ - replacedByJobId: string; - /** - * If this job is an update of an existing job, this field is the job ID of - * the job it replaced. When sending a `CreateJobRequest`, you can update a - * job by specifying it here. The job named here is stopped, and its - * intermediate state is transferred to this job. - */ - replaceJobId: string; - /** - * The job's requested state. `UpdateJob` may be used to switch between - * the `JOB_STATE_STOPPED` and `JOB_STATE_RUNNING` states, by setting - * requested_state. `UpdateJob` may also be used to directly set a job's - * requested state to `JOB_STATE_CANCELLED` or `JOB_STATE_DONE`, irrevocably - * terminating the job if it has not already reached a terminal state. - */ - requestedState: string; - /** - * This field may be mutated by the Cloud Dataflow service; callers cannot - * mutate it. - */ - stageStates: Schema$ExecutionStageState[]; - /** - * The top-level steps that constitute the entire job. - */ - steps: Schema$Step[]; - /** - * A set of files the system should be aware of that are used for temporary - * storage. These temporary files will be removed on job completion. No - * duplicates are allowed. No file patterns are supported. The supported - * files are: Google Cloud Storage: storage.googleapis.com/{bucket}/{object} - * bucket.storage.googleapis.com/{object} - */ - tempFiles: string[]; - /** - * The map of transform name prefixes of the job to be replaced to the - * corresponding name prefixes of the new job. - */ - transformNameMapping: any; - /** - * The type of Cloud Dataflow job. - */ - type: string; -} -/** - * Additional information about how a Cloud Dataflow job will be executed that - * isn't contained in the submitted job. - */ -export interface Schema$JobExecutionInfo { - /** - * A mapping from each stage to the information about that stage. - */ - stages: any; -} -/** - * Contains information about how a particular google.dataflow.v1beta3.Step will - * be executed. - */ -export interface Schema$JobExecutionStageInfo { - /** - * The steps associated with the execution stage. Note that stages may have - * several steps, and that a given step might be run by more than one stage. - */ - stepName: string[]; -} -/** - * A particular message pertaining to a Dataflow job. - */ -export interface Schema$JobMessage { - /** - * Deprecated. - */ - id: string; - /** - * Importance level of the message. - */ - messageImportance: string; - /** - * The text of the message. - */ - messageText: string; - /** - * The timestamp of the message. - */ - time: string; -} -/** - * JobMetrics contains a collection of metrics descibing the detailed progress - * of a Dataflow job. Metrics correspond to user-defined and system-defined - * metrics in the job. This resource captures only the most recent values of - * each metric; time-series data can be queried for them (under the same metric - * names) from Cloud Monitoring. - */ -export interface Schema$JobMetrics { - /** - * All metrics for this job. - */ - metrics: Schema$MetricUpdate[]; - /** - * Timestamp as of which metric values are current. - */ - metricTime: string; -} -/** - * Data disk assignment information for a specific key-range of a sharded - * computation. Currently we only support UTF-8 character splits to simplify - * encoding into JSON. - */ -export interface Schema$KeyRangeDataDiskAssignment { - /** - * The name of the data disk where data for this range is stored. This name is - * local to the Google Cloud Platform project and uniquely identifies the disk - * within that project, for example - * "myproject-1014-104817-4c2-harness-0-disk-1". - */ - dataDisk: string; - /** - * The end (exclusive) of the key range. - */ - end: string; - /** - * The start (inclusive) of the key range. - */ - start: string; -} -/** - * Location information for a specific key-range of a sharded computation. - * Currently we only support UTF-8 character splits to simplify encoding into - * JSON. - */ -export interface Schema$KeyRangeLocation { - /** - * The name of the data disk where data for this range is stored. This name is - * local to the Google Cloud Platform project and uniquely identifies the disk - * within that project, for example - * "myproject-1014-104817-4c2-harness-0-disk-1". - */ - dataDisk: string; - /** - * The physical location of this range assignment to be used for streaming - * computation cross-worker message delivery. - */ - deliveryEndpoint: string; - /** - * DEPRECATED. The location of the persistent state for this range, as a - * persistent directory in the worker local filesystem. - */ - deprecatedPersistentDirectory: string; - /** - * The end (exclusive) of the key range. - */ - end: string; - /** - * The start (inclusive) of the key range. - */ - start: string; -} -/** - * Parameters to provide to the template being launched. - */ -export interface Schema$LaunchTemplateParameters { - /** - * The runtime environment for the job. - */ - environment: Schema$RuntimeEnvironment; - /** - * Required. The job name to use for the created job. - */ - jobName: string; - /** - * The runtime parameters to pass to the job. - */ - parameters: any; -} -/** - * Response to the request to launch a template. - */ -export interface Schema$LaunchTemplateResponse { - /** - * The job that was launched, if the request was not a dry run and the job was - * successfully launched. - */ - job: Schema$Job; -} -/** - * Request to lease WorkItems. - */ -export interface Schema$LeaseWorkItemRequest { - /** - * The current timestamp at the worker. - */ - currentWorkerTime: string; - /** - * The location which contains the WorkItem's job. - */ - location: string; - /** - * The initial lease period. - */ - requestedLeaseDuration: string; - /** - * Worker capabilities. WorkItems might be limited to workers with specific - * capabilities. - */ - workerCapabilities: string[]; - /** - * Identifies the worker leasing work -- typically the ID of the virtual - * machine running the worker. - */ - workerId: string; - /** - * Filter for WorkItem type. - */ - workItemTypes: string[]; -} -/** - * Response to a request to lease WorkItems. - */ -export interface Schema$LeaseWorkItemResponse { - /** - * A list of the leased WorkItems. - */ - workItems: Schema$WorkItem[]; -} -/** - * Response to a request to list job messages. - */ -export interface Schema$ListJobMessagesResponse { - /** - * Autoscaling events in ascending timestamp order. - */ - autoscalingEvents: Schema$AutoscalingEvent[]; - /** - * Messages in ascending timestamp order. - */ - jobMessages: Schema$JobMessage[]; - /** - * The token to obtain the next page of results if there are more. - */ - nextPageToken: string; -} -/** - * Response to a request to list Cloud Dataflow jobs. This may be a partial - * response, depending on the page size in the ListJobsRequest. - */ -export interface Schema$ListJobsResponse { - /** - * Zero or more messages describing locations that failed to respond. - */ - failedLocation: Schema$FailedLocation[]; - /** - * A subset of the requested job information. - */ - jobs: Schema$Job[]; - /** - * Set if there may be more results than fit in this response. - */ - nextPageToken: string; -} -/** - * MapTask consists of an ordered set of instructions, each of which describes - * one particular low-level operation for the worker to perform in order to - * accomplish the MapTask's WorkItem. Each instruction must appear in the - * list before any instructions which depends on its output. - */ -export interface Schema$MapTask { - /** - * The instructions in the MapTask. - */ - instructions: Schema$ParallelInstruction[]; - /** - * System-defined name of the stage containing this MapTask. Unique across the - * workflow. - */ - stageName: string; - /** - * System-defined name of this MapTask. Unique across the workflow. - */ - systemName: string; -} -/** - * The metric short id is returned to the user alongside an offset into - * ReportWorkItemStatusRequest - */ -export interface Schema$MetricShortId { - /** - * The index of the corresponding metric in the ReportWorkItemStatusRequest. - * Required. - */ - metricIndex: number; - /** - * The service-generated short identifier for the metric. - */ - shortId: string; -} -/** - * Identifies a metric, by describing the source which generated the metric. - */ -export interface Schema$MetricStructuredName { - /** - * Zero or more labeled fields which identify the part of the job this metric - * is associated with, such as the name of a step or collection. For example, - * built-in counters associated with steps will have context['step'] = - * <step-name>. Counters associated with PCollections in the SDK will - * have context['pcollection'] = <pcollection-name>. - */ - context: any; - /** - * Worker-defined metric name. - */ - name: string; - /** - * Origin (namespace) of metric name. May be blank for user-define metrics; - * will be "dataflow" for metrics defined by the Dataflow service or - * SDK. - */ - origin: string; -} -/** - * Describes the state of a metric. - */ -export interface Schema$MetricUpdate { - /** - * True if this metric is reported as the total cumulative aggregate value - * accumulated since the worker started working on this WorkItem. By default - * this is false, indicating that this metric is reported as a delta that is - * not associated with any WorkItem. - */ - cumulative: boolean; - /** - * A struct value describing properties of a distribution of numeric values. - */ - distribution: any; - /** - * A struct value describing properties of a Gauge. Metrics of gauge type show - * the value of a metric across time, and is aggregated based on the newest - * value. - */ - gauge: any; - /** - * Worker-computed aggregate value for internal use by the Dataflow service. - */ - internal: any; - /** - * Metric aggregation kind. The possible metric aggregation kinds are - * "Sum", "Max", "Min", "Mean", - * "Set", "And", "Or", and - * "Distribution". The specified aggregation kind is - * case-insensitive. If omitted, this is not an aggregated value but instead - * a single metric sample value. - */ - kind: string; - /** - * Worker-computed aggregate value for the "Mean" aggregation kind. - * This holds the count of the aggregated values and is used in combination - * with mean_sum above to obtain the actual mean aggregate value. The only - * possible value type is Long. - */ - meanCount: any; - /** - * Worker-computed aggregate value for the "Mean" aggregation kind. - * This holds the sum of the aggregated values and is used in combination with - * mean_count below to obtain the actual mean aggregate value. The only - * possible value types are Long and Double. - */ - meanSum: any; - /** - * Name of the metric. - */ - name: Schema$MetricStructuredName; - /** - * Worker-computed aggregate value for aggregation kinds "Sum", - * "Max", "Min", "And", and "Or". The - * possible value types are Long, Double, and Boolean. - */ - scalar: any; - /** - * Worker-computed aggregate value for the "Set" aggregation kind. - * The only possible value type is a list of Values whose type can be Long, - * Double, or String, according to the metric's type. All Values in the - * list must be of the same type. - */ - set: any; - /** - * Timestamp associated with the metric value. Optional when workers are - * reporting work progress; it will be filled in responses from the metrics - * API. - */ - updateTime: string; -} -/** - * Describes mounted data disk. - */ -export interface Schema$MountedDataDisk { - /** - * The name of the data disk. This name is local to the Google Cloud Platform - * project and uniquely identifies the disk within that project, for example - * "myproject-1014-104817-4c2-harness-0-disk-1". - */ - dataDisk: string; -} -/** - * Information about an output of a multi-output DoFn. - */ -export interface Schema$MultiOutputInfo { - /** - * The id of the tag the user code will emit to this output by; this should - * correspond to the tag of some SideInputInfo. - */ - tag: string; -} -/** - * Basic metadata about a counter. - */ -export interface Schema$NameAndKind { - /** - * Counter aggregation kind. - */ - kind: string; - /** - * Name of the counter. - */ - name: string; -} -/** - * The packages that must be installed in order for a worker to run the steps of - * the Cloud Dataflow job that will be assigned to its worker pool. This is the - * mechanism by which the Cloud Dataflow SDK causes code to be loaded onto the - * workers. For example, the Cloud Dataflow Java SDK might use this to install - * jars containing the user's code and all of the various dependencies - * (libraries, data files, etc.) required in order for that code to run. - */ -export interface Schema$Package { - /** - * The resource to read the package from. The supported resource type is: - * Google Cloud Storage: storage.googleapis.com/{bucket} - * bucket.storage.googleapis.com/ - */ - location: string; - /** - * The name of the package. - */ - name: string; -} -/** - * Describes a particular operation comprising a MapTask. - */ -export interface Schema$ParallelInstruction { - /** - * Additional information for Flatten instructions. - */ - flatten: Schema$FlattenInstruction; - /** - * User-provided name of this operation. - */ - name: string; - /** - * System-defined name for the operation in the original workflow graph. - */ - originalName: string; - /** - * Describes the outputs of the instruction. - */ - outputs: Schema$InstructionOutput[]; - /** - * Additional information for ParDo instructions. - */ - parDo: Schema$ParDoInstruction; - /** - * Additional information for PartialGroupByKey instructions. - */ - partialGroupByKey: Schema$PartialGroupByKeyInstruction; - /** - * Additional information for Read instructions. - */ - read: Schema$ReadInstruction; - /** - * System-defined name of this operation. Unique across the workflow. - */ - systemName: string; - /** - * Additional information for Write instructions. - */ - write: Schema$WriteInstruction; -} -/** - * Structured data associated with this message. - */ -export interface Schema$Parameter { - /** - * Key or name for this parameter. - */ - key: string; - /** - * Value for this parameter. - */ - value: any; -} -/** - * Metadata for a specific parameter. - */ -export interface Schema$ParameterMetadata { - /** - * Required. The help text to display for the parameter. - */ - helpText: string; - /** - * Optional. Whether the parameter is optional. Defaults to false. - */ - isOptional: boolean; - /** - * Required. The label to display for the parameter. - */ - label: string; - /** - * Required. The name of the parameter. - */ - name: string; - /** - * Optional. Regexes that the parameter must match. - */ - regexes: string[]; -} -/** - * An instruction that does a ParDo operation. Takes one main input and zero or - * more side inputs, and produces zero or more outputs. Runs user code. - */ -export interface Schema$ParDoInstruction { - /** - * The input. - */ - input: Schema$InstructionInput; - /** - * Information about each of the outputs, if user_fn is a MultiDoFn. - */ - multiOutputInfos: Schema$MultiOutputInfo[]; - /** - * The number of outputs. - */ - numOutputs: number; - /** - * Zero or more side inputs. - */ - sideInputs: Schema$SideInputInfo[]; - /** - * The user function to invoke. - */ - userFn: any; -} -/** - * An instruction that does a partial group-by-key. One input and one output. - */ -export interface Schema$PartialGroupByKeyInstruction { - /** - * Describes the input to the partial group-by-key instruction. - */ - input: Schema$InstructionInput; - /** - * The codec to use for interpreting an element in the input PTable. - */ - inputElementCodec: any; - /** - * If this instruction includes a combining function this is the name of the - * intermediate store between the GBK and the CombineValues. - */ - originalCombineValuesInputStoreName: string; - /** - * If this instruction includes a combining function, this is the name of the - * CombineValues instruction lifted into this instruction. - */ - originalCombineValuesStepName: string; - /** - * Zero or more side inputs. - */ - sideInputs: Schema$SideInputInfo[]; - /** - * The value combining function to invoke. - */ - valueCombiningFn: any; -} -/** - * A descriptive representation of submitted pipeline as well as the executed - * form. This data is provided by the Dataflow service for ease of visualizing - * the pipeline and interpretting Dataflow provided metrics. - */ -export interface Schema$PipelineDescription { - /** - * Pipeline level display data. - */ - displayData: Schema$DisplayData[]; - /** - * Description of each stage of execution of the pipeline. - */ - executionPipelineStage: Schema$ExecutionStageSummary[]; - /** - * Description of each transform in the pipeline and collections between them. - */ - originalPipelineTransform: Schema$TransformSummary[]; -} -/** - * Position defines a position within a collection of data. The value can be - * either the end position, a key (used with ordered collections), a byte - * offset, or a record index. - */ -export interface Schema$Position { - /** - * Position is a byte offset. - */ - byteOffset: string; - /** - * CloudPosition is a concat position. - */ - concatPosition: Schema$ConcatPosition; - /** - * Position is past all other positions. Also useful for the end position of - * an unbounded range. - */ - end: boolean; - /** - * Position is a string key, ordered lexicographically. - */ - key: string; - /** - * Position is a record index. - */ - recordIndex: string; - /** - * CloudPosition is a base64 encoded BatchShufflePosition (with FIXED - * sharding). - */ - shufflePosition: string; -} -/** - * Identifies a pubsub location to use for transferring data into or out of a - * streaming Dataflow job. - */ -export interface Schema$PubsubLocation { - /** - * Indicates whether the pipeline allows late-arriving data. - */ - dropLateData: boolean; - /** - * If set, contains a pubsub label from which to extract record ids. If left - * empty, record deduplication will be strictly best effort. - */ - idLabel: string; - /** - * A pubsub subscription, in the form of - * "pubsub.googleapis.com/subscriptions/<project-id>/<subscription-name>" - */ - subscription: string; - /** - * If set, contains a pubsub label from which to extract record timestamps. If - * left empty, record timestamps will be generated upon arrival. - */ - timestampLabel: string; - /** - * A pubsub topic, in the form of - * "pubsub.googleapis.com/topics/<project-id>/<topic-name>" - */ - topic: string; - /** - * If set, specifies the pubsub subscription that will be used for tracking - * custom time timestamps for watermark estimation. - */ - trackingSubscription: string; - /** - * If true, then the client has requested to get pubsub attributes. - */ - withAttributes: boolean; -} -/** - * An instruction that reads records. Takes no inputs, produces one output. - */ -export interface Schema$ReadInstruction { - /** - * The source to read from. - */ - source: Schema$Source; -} -/** - * Represents the level of parallelism in a WorkItem's input, reported by - * the worker. - */ -export interface Schema$ReportedParallelism { - /** - * Specifies whether the parallelism is infinite. If true, "value" - * is ignored. Infinite parallelism means the service will assume that the - * work item can always be split into more non-empty work items by dynamic - * splitting. This is a work-around for lack of support for infinity by the - * current JSON-based Java RPC stack. - */ - isInfinite: boolean; - /** - * Specifies the level of parallelism in case it is finite. - */ - value: number; -} -/** - * Request to report the status of WorkItems. - */ -export interface Schema$ReportWorkItemStatusRequest { - /** - * The current timestamp at the worker. - */ - currentWorkerTime: string; - /** - * The location which contains the WorkItem's job. - */ - location: string; - /** - * The ID of the worker reporting the WorkItem status. If this does not match - * the ID of the worker which the Dataflow service believes currently has the - * lease on the WorkItem, the report will be dropped (with an error response). - */ - workerId: string; - /** - * The order is unimportant, except that the order of the WorkItemServiceState - * messages in the ReportWorkItemStatusResponse corresponds to the order of - * WorkItemStatus messages here. - */ - workItemStatuses: Schema$WorkItemStatus[]; -} -/** - * Response from a request to report the status of WorkItems. - */ -export interface Schema$ReportWorkItemStatusResponse { - /** - * A set of messages indicating the service-side state for each WorkItem whose - * status was reported, in the same order as the WorkItemStatus messages in - * the ReportWorkItemStatusRequest which resulting in this response. - */ - workItemServiceStates: Schema$WorkItemServiceState[]; -} -/** - * Worker metrics exported from workers. This contains resource utilization - * metrics accumulated from a variety of sources. For more information, see - * go/df-resource-signals. - */ -export interface Schema$ResourceUtilizationReport { - /** - * CPU utilization samples. - */ - cpuTime: Schema$CPUTime[]; -} -/** - * Service-side response to WorkerMessage reporting resource utilization. - */ -export interface Schema$ResourceUtilizationReportResponse {} -/** - * The environment values to set at runtime. - */ -export interface Schema$RuntimeEnvironment { - /** - * Additional experiment flags for the job. - */ - additionalExperiments: string[]; - /** - * Whether to bypass the safety checks for the job's temporary directory. - * Use with caution. - */ - bypassTempDirValidation: boolean; - /** - * The machine type to use for the job. Defaults to the value from the - * template if not specified. - */ - machineType: string; - /** - * The maximum number of Google Compute Engine instances to be made available - * to your pipeline during execution, from 1 to 1000. - */ - maxWorkers: number; - /** - * Network to which VMs will be assigned. If empty or unspecified, the - * service will use the network "default". - */ - network: string; - /** - * The email address of the service account to run the job as. - */ - serviceAccountEmail: string; - /** - * Subnetwork to which VMs will be assigned, if desired. Expected to be of - * the form "regions/REGION/subnetworks/SUBNETWORK". - */ - subnetwork: string; - /** - * The Cloud Storage path to use for temporary files. Must be a valid Cloud - * Storage URL, beginning with `gs://`. - */ - tempLocation: string; - /** - * The Compute Engine [availability - * zone](https://cloud.google.com/compute/docs/regions-zones/regions-zones) - * for launching worker instances to run your pipeline. - */ - zone: string; -} -/** - * Request to send encoded debug information. - */ -export interface Schema$SendDebugCaptureRequest { - /** - * The internal component id for which debug information is sent. - */ - componentId: string; - /** - * The encoded debug information. - */ - data: string; - /** - * The location which contains the job specified by job_id. - */ - location: string; - /** - * The worker id, i.e., VM hostname. - */ - workerId: string; -} -/** - * Response to a send capture request. nothing - */ -export interface Schema$SendDebugCaptureResponse {} -/** - * A request for sending worker messages to the service. - */ -export interface Schema$SendWorkerMessagesRequest { - /** - * The location which contains the job - */ - location: string; - /** - * The WorkerMessages to send. - */ - workerMessages: Schema$WorkerMessage[]; -} -/** - * The response to the worker messages. - */ -export interface Schema$SendWorkerMessagesResponse { - /** - * The servers response to the worker messages. - */ - workerMessageResponses: Schema$WorkerMessageResponse[]; -} -/** - * Describes a particular function to invoke. - */ -export interface Schema$SeqMapTask { - /** - * Information about each of the inputs. - */ - inputs: Schema$SideInputInfo[]; - /** - * The user-provided name of the SeqDo operation. - */ - name: string; - /** - * Information about each of the outputs. - */ - outputInfos: Schema$SeqMapTaskOutputInfo[]; - /** - * System-defined name of the stage containing the SeqDo operation. Unique - * across the workflow. - */ - stageName: string; - /** - * System-defined name of the SeqDo operation. Unique across the workflow. - */ - systemName: string; - /** - * The user function to invoke. - */ - userFn: any; -} -/** - * Information about an output of a SeqMapTask. - */ -export interface Schema$SeqMapTaskOutputInfo { - /** - * The sink to write the output value to. - */ - sink: Schema$Sink; - /** - * The id of the TupleTag the user code will tag the output value by. - */ - tag: string; -} -/** - * A task which consists of a shell command for the worker to execute. - */ -export interface Schema$ShellTask { - /** - * The shell command to run. - */ - command: string; - /** - * Exit code for the task. - */ - exitCode: number; -} -/** - * Information about a side input of a DoFn or an input of a SeqDoFn. - */ -export interface Schema$SideInputInfo { - /** - * How to interpret the source element(s) as a side input value. - */ - kind: any; - /** - * The source(s) to read element(s) from to get the value of this side input. - * If more than one source, then the elements are taken from the sources, in - * the specified order if order matters. At least one source is required. - */ - sources: Schema$Source[]; - /** - * The id of the tag the user code will access this side input by; this should - * correspond to the tag of some MultiOutputInfo. - */ - tag: string; -} -/** - * A sink that records can be encoded and written to. - */ -export interface Schema$Sink { - /** - * The codec to use to encode data written to the sink. - */ - codec: any; - /** - * The sink to write to, plus its parameters. - */ - spec: any; -} -/** - * A source that records can be read and decoded from. - */ -export interface Schema$Source { - /** - * While splitting, sources may specify the produced bundles as differences - * against another source, in order to save backend-side memory and allow - * bigger jobs. For details, see SourceSplitRequest. To support this use case, - * the full set of parameters of the source is logically obtained by taking - * the latest explicitly specified value of each parameter in the order: - * base_specs (later items win), spec (overrides anything in base_specs). - */ - baseSpecs: any[]; - /** - * The codec to use to decode data read from the source. - */ - codec: any; - /** - * Setting this value to true hints to the framework that the source - * doesn't need splitting, and using SourceSplitRequest on it would yield - * SOURCE_SPLIT_OUTCOME_USE_CURRENT. E.g. a file splitter may set this to - * true when splitting a single file into a set of byte ranges of appropriate - * size, and set this to false when splitting a filepattern into individual - * files. However, for efficiency, a file splitter may decide to produce file - * subranges directly from the filepattern to avoid a splitting round-trip. - * See SourceSplitRequest for an overview of the splitting process. This - * field is meaningful only in the Source objects populated by the user (e.g. - * when filling in a DerivedSource). Source objects supplied by the framework - * to the user don't have this field populated. - */ - doesNotNeedSplitting: boolean; - /** - * Optionally, metadata for this source can be supplied right away, avoiding a - * SourceGetMetadataOperation roundtrip (see SourceOperationRequest). This - * field is meaningful only in the Source objects populated by the user (e.g. - * when filling in a DerivedSource). Source objects supplied by the framework - * to the user don't have this field populated. - */ - metadata: Schema$SourceMetadata; - /** - * The source to read from, plus its parameters. - */ - spec: any; -} -/** - * DEPRECATED in favor of DynamicSourceSplit. - */ -export interface Schema$SourceFork { - /** - * DEPRECATED - */ - primary: Schema$SourceSplitShard; - /** - * DEPRECATED - */ - primarySource: Schema$DerivedSource; - /** - * DEPRECATED - */ - residual: Schema$SourceSplitShard; - /** - * DEPRECATED - */ - residualSource: Schema$DerivedSource; -} -/** - * A request to compute the SourceMetadata of a Source. - */ -export interface Schema$SourceGetMetadataRequest { - /** - * Specification of the source whose metadata should be computed. - */ - source: Schema$Source; -} -/** - * The result of a SourceGetMetadataOperation. - */ -export interface Schema$SourceGetMetadataResponse { - /** - * The computed metadata. - */ - metadata: Schema$SourceMetadata; -} -/** - * Metadata about a Source useful for automatically optimizing and tuning the - * pipeline, etc. - */ -export interface Schema$SourceMetadata { - /** - * An estimate of the total size (in bytes) of the data that would be read - * from this source. This estimate is in terms of external storage size, - * before any decompression or other processing done by the reader. - */ - estimatedSizeBytes: string; - /** - * Specifies that the size of this source is known to be infinite (this is a - * streaming source). - */ - infinite: boolean; - /** - * Whether this source is known to produce key/value pairs with the (encoded) - * keys in lexicographically sorted order. - */ - producesSortedKeys: boolean; -} -/** - * A work item that represents the different operations that can be performed on - * a user-defined Source specification. - */ -export interface Schema$SourceOperationRequest { - /** - * Information about a request to get metadata about a source. - */ - getMetadata: Schema$SourceGetMetadataRequest; - /** - * User-provided name of the Read instruction for this source. - */ - name: string; - /** - * System-defined name for the Read instruction for this source in the - * original workflow graph. - */ - originalName: string; - /** - * Information about a request to split a source. - */ - split: Schema$SourceSplitRequest; - /** - * System-defined name of the stage containing the source operation. Unique - * across the workflow. - */ - stageName: string; - /** - * System-defined name of the Read instruction for this source. Unique across - * the workflow. - */ - systemName: string; -} -/** - * The result of a SourceOperationRequest, specified in - * ReportWorkItemStatusRequest.source_operation when the work item is completed. - */ -export interface Schema$SourceOperationResponse { - /** - * A response to a request to get metadata about a source. - */ - getMetadata: Schema$SourceGetMetadataResponse; - /** - * A response to a request to split a source. - */ - split: Schema$SourceSplitResponse; -} -/** - * Hints for splitting a Source into bundles (parts for parallel processing) - * using SourceSplitRequest. - */ -export interface Schema$SourceSplitOptions { - /** - * The source should be split into a set of bundles where the estimated size - * of each is approximately this many bytes. - */ - desiredBundleSizeBytes: string; - /** - * DEPRECATED in favor of desired_bundle_size_bytes. - */ - desiredShardSizeBytes: string; -} -/** - * Represents the operation to split a high-level Source specification into - * bundles (parts for parallel processing). At a high level, splitting of a - * source into bundles happens as follows: SourceSplitRequest is applied to the - * source. If it returns SOURCE_SPLIT_OUTCOME_USE_CURRENT, no further splitting - * happens and the source is used "as is". Otherwise, splitting is - * applied recursively to each produced DerivedSource. As an optimization, for - * any Source, if its does_not_need_splitting is true, the framework assumes - * that splitting this source would return SOURCE_SPLIT_OUTCOME_USE_CURRENT, and - * doesn't initiate a SourceSplitRequest. This applies both to the initial - * source being split and to bundles produced from it. - */ -export interface Schema$SourceSplitRequest { - /** - * Hints for tuning the splitting process. - */ - options: Schema$SourceSplitOptions; - /** - * Specification of the source to be split. - */ - source: Schema$Source; -} -/** - * The response to a SourceSplitRequest. - */ -export interface Schema$SourceSplitResponse { - /** - * If outcome is SPLITTING_HAPPENED, then this is a list of bundles into which - * the source was split. Otherwise this field is ignored. This list can be - * empty, which means the source represents an empty input. - */ - bundles: Schema$DerivedSource[]; - /** - * Indicates whether splitting happened and produced a list of bundles. If - * this is USE_CURRENT_SOURCE_AS_IS, the current source should be processed - * "as is" without splitting. "bundles" is ignored in this - * case. If this is SPLITTING_HAPPENED, then "bundles" contains a - * list of bundles into which the source was split. - */ - outcome: string; - /** - * DEPRECATED in favor of bundles. - */ - shards: Schema$SourceSplitShard[]; -} -/** - * DEPRECATED in favor of DerivedSource. - */ -export interface Schema$SourceSplitShard { - /** - * DEPRECATED - */ - derivationMode: string; - /** - * DEPRECATED - */ - source: Schema$Source; -} -/** - * A representation of an int64, n, that is immune to precision loss when - * encoded in JSON. - */ -export interface Schema$SplitInt64 { - /** - * The high order bits, including the sign: n >> 32. - */ - highBits: number; - /** - * The low order bits: n & 0xffffffff. - */ - lowBits: number; -} -/** - * Description of an input or output of an execution stage. - */ -export interface Schema$StageSource { - /** - * Dataflow service generated name for this source. - */ - name: string; - /** - * User name for the original user transform or collection with which this - * source is most closely associated. - */ - originalTransformOrCollection: string; - /** - * Size of the source, if measurable. - */ - sizeBytes: string; - /** - * Human-readable name for this source; may be user or system generated. - */ - userName: string; -} -/** - * State family configuration. - */ -export interface Schema$StateFamilyConfig { - /** - * If true, this family corresponds to a read operation. - */ - isRead: boolean; - /** - * The state family value. - */ - stateFamily: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Defines a particular step within a Cloud Dataflow job. A job consists of - * multiple steps, each of which performs some specific operation as part of the - * overall job. Data is typically passed from one step to another as part of - * the job. Here's an example of a sequence of steps which together - * implement a Map-Reduce job: * Read a collection of data from some source, - * parsing the collection's elements. * Validate the elements. * - * Apply a user-defined function to map each element to some value and - * extract an element-specific key value. * Group elements with the same key - * into a single element with that key, transforming a multiply-keyed - * collection into a uniquely-keyed collection. * Write the elements out - * to some data sink. Note that the Cloud Dataflow service may be used to run - * many different types of jobs, not just Map-Reduce. - */ -export interface Schema$Step { - /** - * The kind of step in the Cloud Dataflow job. - */ - kind: string; - /** - * The name that identifies the step. This must be unique for each step with - * respect to all other steps in the Cloud Dataflow job. - */ - name: string; - /** - * Named properties associated with the step. Each kind of predefined step has - * its own required set of properties. Must be provided on Create. Only - * retrieved with JOB_VIEW_ALL. - */ - properties: any; -} -/** - * Configuration information for a single streaming computation. - */ -export interface Schema$StreamingComputationConfig { - /** - * Unique identifier for this computation. - */ - computationId: string; - /** - * Instructions that comprise the computation. - */ - instructions: Schema$ParallelInstruction[]; - /** - * Stage name of this computation. - */ - stageName: string; - /** - * System defined name for this computation. - */ - systemName: string; -} -/** - * Describes full or partial data disk assignment information of the computation - * ranges. - */ -export interface Schema$StreamingComputationRanges { - /** - * The ID of the computation. - */ - computationId: string; - /** - * Data disk assignments for ranges from this computation. - */ - rangeAssignments: Schema$KeyRangeDataDiskAssignment[]; -} -/** - * A task which describes what action should be performed for the specified - * streaming computation ranges. - */ -export interface Schema$StreamingComputationTask { - /** - * Contains ranges of a streaming computation this task should apply to. - */ - computationRanges: Schema$StreamingComputationRanges[]; - /** - * Describes the set of data disks this task should apply to. - */ - dataDisks: Schema$MountedDataDisk[]; - /** - * A type of streaming computation task. - */ - taskType: string; -} -/** - * A task that carries configuration information for streaming computations. - */ -export interface Schema$StreamingConfigTask { - /** - * Set of computation configuration information. - */ - streamingComputationConfigs: Schema$StreamingComputationConfig[]; - /** - * Map from user step names to state families. - */ - userStepToStateFamilyNameMap: any; - /** - * If present, the worker must use this endpoint to communicate with Windmill - * Service dispatchers, otherwise the worker must continue to use whatever - * endpoint it had been using. - */ - windmillServiceEndpoint: string; - /** - * If present, the worker must use this port to communicate with Windmill - * Service dispatchers. Only applicable when windmill_service_endpoint is - * specified. - */ - windmillServicePort: string; -} -/** - * A task which initializes part of a streaming Dataflow job. - */ -export interface Schema$StreamingSetupTask { - /** - * The user has requested drain. - */ - drain: boolean; - /** - * The TCP port on which the worker should listen for messages from other - * streaming computation workers. - */ - receiveWorkPort: number; - /** - * The global topology of the streaming Dataflow job. - */ - streamingComputationTopology: Schema$TopologyConfig; - /** - * The TCP port used by the worker to communicate with the Dataflow worker - * harness. - */ - workerHarnessPort: number; -} -/** - * Identifies the location of a streaming side input. - */ -export interface Schema$StreamingSideInputLocation { - /** - * Identifies the state family where this side input is stored. - */ - stateFamily: string; - /** - * Identifies the particular side input within the streaming Dataflow job. - */ - tag: string; -} -/** - * Identifies the location of a streaming computation stage, for stage-to-stage - * communication. - */ -export interface Schema$StreamingStageLocation { - /** - * Identifies the particular stream within the streaming Dataflow job. - */ - streamId: string; -} -/** - * Describes a stream of data, either as input to be processed or as output of a - * streaming Dataflow job. - */ -export interface Schema$StreamLocation { - /** - * The stream is a custom source. - */ - customSourceLocation: Schema$CustomSourceLocation; - /** - * The stream is a pubsub stream. - */ - pubsubLocation: Schema$PubsubLocation; - /** - * The stream is a streaming side input. - */ - sideInputLocation: Schema$StreamingSideInputLocation; - /** - * The stream is part of another computation within the current streaming - * Dataflow job. - */ - streamingStageLocation: Schema$StreamingStageLocation; -} -/** - * A metric value representing a list of strings. - */ -export interface Schema$StringList { - /** - * Elements of the list. - */ - elements: string[]; -} -/** - * A rich message format, including a human readable string, a key for - * identifying the message, and structured data associated with the message for - * programmatic consumption. - */ -export interface Schema$StructuredMessage { - /** - * Idenfier for this message type. Used by external systems to - * internationalize or personalize message. - */ - messageKey: string; - /** - * Human-readable version of message. - */ - messageText: string; - /** - * The structured data associated with this message. - */ - parameters: Schema$Parameter[]; -} -/** - * Taskrunner configuration settings. - */ -export interface Schema$TaskRunnerSettings { - /** - * Whether to also send taskrunner log info to stderr. - */ - alsologtostderr: boolean; - /** - * The location on the worker for task-specific subdirectories. - */ - baseTaskDir: string; - /** - * The base URL for the taskrunner to use when accessing Google Cloud APIs. - * When workers access Google Cloud APIs, they logically do so via relative - * URLs. If this field is specified, it supplies the base URL to use for - * resolving these relative URLs. The normative algorithm used is defined by - * RFC 1808, "Relative Uniform Resource Locators". If not - * specified, the default value is "http://www.googleapis.com/" - */ - baseUrl: string; - /** - * The file to store preprocessing commands in. - */ - commandlinesFileName: string; - /** - * Whether to continue taskrunner if an exception is hit. - */ - continueOnException: boolean; - /** - * The API version of endpoint, e.g. "v1b3" - */ - dataflowApiVersion: string; - /** - * The command to launch the worker harness. - */ - harnessCommand: string; - /** - * The suggested backend language. - */ - languageHint: string; - /** - * The directory on the VM to store logs. - */ - logDir: string; - /** - * Whether to send taskrunner log info to Google Compute Engine VM serial - * console. - */ - logToSerialconsole: boolean; - /** - * Indicates where to put logs. If this is not specified, the logs will not - * be uploaded. The supported resource type is: Google Cloud Storage: - * storage.googleapis.com/{bucket}/{object} - * bucket.storage.googleapis.com/{object} - */ - logUploadLocation: string; - /** - * The OAuth2 scopes to be requested by the taskrunner in order to access the - * Cloud Dataflow API. - */ - oauthScopes: string[]; - /** - * The settings to pass to the parallel worker harness. - */ - parallelWorkerSettings: Schema$WorkerSettings; - /** - * The streaming worker main class name. - */ - streamingWorkerMainClass: string; - /** - * The UNIX group ID on the worker VM to use for tasks launched by taskrunner; - * e.g. "wheel". - */ - taskGroup: string; - /** - * The UNIX user ID on the worker VM to use for tasks launched by taskrunner; - * e.g. "root". - */ - taskUser: string; - /** - * The prefix of the resources the taskrunner should use for temporary - * storage. The supported resource type is: Google Cloud Storage: - * storage.googleapis.com/{bucket}/{object} - * bucket.storage.googleapis.com/{object} - */ - tempStoragePrefix: string; - /** - * The ID string of the VM. - */ - vmId: string; - /** - * The file to store the workflow in. - */ - workflowFileName: string; -} -/** - * Metadata describing a template. - */ -export interface Schema$TemplateMetadata { - /** - * Optional. A description of the template. - */ - description: string; - /** - * Required. The name of the template. - */ - name: string; - /** - * The parameters for the template. - */ - parameters: Schema$ParameterMetadata[]; -} -/** - * Global topology of the streaming Dataflow job, including all computations and - * their sharded locations. - */ -export interface Schema$TopologyConfig { - /** - * The computations associated with a streaming Dataflow job. - */ - computations: Schema$ComputationTopology[]; - /** - * The disks assigned to a streaming Dataflow job. - */ - dataDiskAssignments: Schema$DataDiskAssignment[]; - /** - * The size (in bits) of keys that will be assigned to source messages. - */ - forwardingKeyBits: number; - /** - * Version number for persistent state. - */ - persistentStateVersion: number; - /** - * Maps user stage names to stable computation names. - */ - userStageToComputationNameMap: any; -} -/** - * Description of the type, names/ids, and input/outputs for a transform. - */ -export interface Schema$TransformSummary { - /** - * Transform-specific display data. - */ - displayData: Schema$DisplayData[]; - /** - * SDK generated id of this transform instance. - */ - id: string; - /** - * User names for all collection inputs to this transform. - */ - inputCollectionName: string[]; - /** - * Type of transform. - */ - kind: string; - /** - * User provided name for this transform instance. - */ - name: string; - /** - * User names for all collection outputs to this transform. - */ - outputCollectionName: string[]; -} -/** - * WorkerHealthReport contains information about the health of a worker. The VM - * should be identified by the labels attached to the WorkerMessage that this - * health ping belongs to. - */ -export interface Schema$WorkerHealthReport { - /** - * The pods running on the worker. See: - * http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod - * This field is used by the worker to send the status of the indvidual - * containers running on each worker. - */ - pods: any[]; - /** - * The interval at which the worker is sending health reports. The default - * value of 0 should be interpreted as the field is not being explicitly set - * by the worker. - */ - reportInterval: string; - /** - * Whether the VM is healthy. - */ - vmIsHealthy: boolean; - /** - * The time the VM was booted. - */ - vmStartupTime: string; -} -/** - * WorkerHealthReportResponse contains information returned to the worker in - * response to a health ping. - */ -export interface Schema$WorkerHealthReportResponse { - /** - * A positive value indicates the worker should change its reporting interval - * to the specified value. The default value of zero means no change in - * report rate is requested by the server. - */ - reportInterval: string; -} -/** - * A report of an event in a worker's lifecycle. The proto contains one - * event, because the worker is expected to asynchronously send each message - * immediately after the event. Due to this asynchrony, messages may arrive out - * of order (or missing), and it is up to the consumer to interpret. The - * timestamp of the event is in the enclosing WorkerMessage proto. - */ -export interface Schema$WorkerLifecycleEvent { - /** - * The start time of this container. All events will report this so that - * events can be grouped together across container/VM restarts. - */ - containerStartTime: string; - /** - * The event being reported. - */ - event: string; - /** - * Other stats that can accompany an event. E.g. { - * "downloaded_bytes" : "123456" } - */ - metadata: any; -} -/** - * WorkerMessage provides information to the backend about a worker. - */ -export interface Schema$WorkerMessage { - /** - * Labels are used to group WorkerMessages. For example, a worker_message - * about a particular container might have the labels: { "JOB_ID": - * "2015-04-22", "WORKER_ID": - * "wordcount-vm-2015…" "CONTAINER_TYPE": - * "worker", "CONTAINER_ID": "ac1234def"} - * Label tags typically correspond to Label enum values. However, for ease of - * development other strings can be used as tags. LABEL_UNSPECIFIED should not - * be used here. - */ - labels: any; - /** - * The timestamp of the worker_message. - */ - time: string; - /** - * The health of a worker. - */ - workerHealthReport: Schema$WorkerHealthReport; - /** - * Record of worker lifecycle events. - */ - workerLifecycleEvent: Schema$WorkerLifecycleEvent; - /** - * A worker message code. - */ - workerMessageCode: Schema$WorkerMessageCode; - /** - * Resource metrics reported by workers. - */ - workerMetrics: Schema$ResourceUtilizationReport; - /** - * Shutdown notice by workers. - */ - workerShutdownNotice: Schema$WorkerShutdownNotice; -} -/** - * A message code is used to report status and error messages to the service. - * The message codes are intended to be machine readable. The service will take - * care of translating these into user understandable messages if necessary. - * Example use cases: 1. Worker processes reporting successful startup. 2. - * Worker processes reporting specific errors (e.g. package staging failure). - */ -export interface Schema$WorkerMessageCode { - /** - * The code is a string intended for consumption by a machine that identifies - * the type of message being sent. Examples: 1. "HARNESS_STARTED" - * might be used to indicate the worker harness has started. 2. - * "GCS_DOWNLOAD_ERROR" might be used to indicate an error - * downloading a GCS file as part of the boot process of one of the worker - * containers. This is a string and not an enum to make it easy to add new - * codes without waiting for an API change. - */ - code: string; - /** - * Parameters contains specific information about the code. This is a struct - * to allow parameters of different types. Examples: 1. For a - * "HARNESS_STARTED" message parameters might provide the name of - * the worker and additional data like timing information. 2. For a - * "GCS_DOWNLOAD_ERROR" parameters might contain fields listing the - * GCS objects being downloaded and fields containing errors. In general - * complex data structures should be avoided. If a worker needs to send a - * specific and complicated data structure then please consider defining a new - * proto and adding it to the data oneof in WorkerMessageResponse. - * Conventions: Parameters should only be used for information that isn't - * typically passed as a label. hostname and other worker identifiers should - * almost always be passed as labels since they will be included on most - * messages. - */ - parameters: any; -} -/** - * A worker_message response allows the server to pass information to the - * sender. - */ -export interface Schema$WorkerMessageResponse { - /** - * The service's response to a worker's health report. - */ - workerHealthReportResponse: Schema$WorkerHealthReportResponse; - /** - * Service's response to reporting worker metrics (currently empty). - */ - workerMetricsResponse: Schema$ResourceUtilizationReportResponse; - /** - * Service's response to shutdown notice (currently empty). - */ - workerShutdownNoticeResponse: Schema$WorkerShutdownNoticeResponse; -} -/** - * Describes one particular pool of Cloud Dataflow workers to be instantiated by - * the Cloud Dataflow service in order to perform the computations required by a - * job. Note that a workflow job may use multiple pools, in order to match the - * various computational requirements of the various stages of the job. - */ -export interface Schema$WorkerPool { - /** - * Settings for autoscaling of this WorkerPool. - */ - autoscalingSettings: Schema$AutoscalingSettings; - /** - * Data disks that are used by a VM in this workflow. - */ - dataDisks: Schema$Disk[]; - /** - * The default package set to install. This allows the service to select a - * default set of packages which are useful to worker harnesses written in a - * particular language. - */ - defaultPackageSet: string; - /** - * Size of root disk for VMs, in GB. If zero or unspecified, the service will - * attempt to choose a reasonable default. - */ - diskSizeGb: number; - /** - * Fully qualified source image for disks. - */ - diskSourceImage: string; - /** - * Type of root disk for VMs. If empty or unspecified, the service will - * attempt to choose a reasonable default. - */ - diskType: string; - /** - * Configuration for VM IPs. - */ - ipConfiguration: string; - /** - * The kind of the worker pool; currently only `harness` and `shuffle` are - * supported. - */ - kind: string; - /** - * Machine type (e.g. "n1-standard-1"). If empty or unspecified, - * the service will attempt to choose a reasonable default. - */ - machineType: string; - /** - * Metadata to set on the Google Compute Engine VMs. - */ - metadata: any; - /** - * Network to which VMs will be assigned. If empty or unspecified, the - * service will use the network "default". - */ - network: string; - /** - * The number of threads per worker harness. If empty or unspecified, the - * service will choose a number of threads (according to the number of cores - * on the selected machine type for batch, or 1 by convention for streaming). - */ - numThreadsPerWorker: number; - /** - * Number of Google Compute Engine workers in this pool needed to execute the - * job. If zero or unspecified, the service will attempt to choose a - * reasonable default. - */ - numWorkers: number; - /** - * The action to take on host maintenance, as defined by the Google Compute - * Engine API. - */ - onHostMaintenance: string; - /** - * Packages to be installed on workers. - */ - packages: Schema$Package[]; - /** - * Extra arguments for this worker pool. - */ - poolArgs: any; - /** - * Subnetwork to which VMs will be assigned, if desired. Expected to be of - * the form "regions/REGION/subnetworks/SUBNETWORK". - */ - subnetwork: string; - /** - * Settings passed through to Google Compute Engine workers when using the - * standard Dataflow task runner. Users should ignore this field. - */ - taskrunnerSettings: Schema$TaskRunnerSettings; - /** - * Sets the policy for determining when to turndown worker pool. Allowed - * values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and `TEARDOWN_NEVER`. - * `TEARDOWN_ALWAYS` means workers are always torn down regardless of whether - * the job succeeds. `TEARDOWN_ON_SUCCESS` means workers are torn down if the - * job succeeds. `TEARDOWN_NEVER` means the workers are never torn down. If - * the workers are not torn down by the service, they will continue to run and - * use Google Compute Engine VM resources in the user's project until they - * are explicitly terminated by the user. Because of this, Google recommends - * using the `TEARDOWN_ALWAYS` policy except for small, manually supervised - * test jobs. If unknown or unspecified, the service will attempt to choose a - * reasonable default. - */ - teardownPolicy: string; - /** - * Required. Docker container image that executes the Cloud Dataflow worker - * harness, residing in Google Container Registry. - */ - workerHarnessContainerImage: string; - /** - * Zone to run the worker pools in. If empty or unspecified, the service will - * attempt to choose a reasonable default. - */ - zone: string; -} -/** - * Provides data to pass through to the worker harness. - */ -export interface Schema$WorkerSettings { - /** - * The base URL for accessing Google Cloud APIs. When workers access Google - * Cloud APIs, they logically do so via relative URLs. If this field is - * specified, it supplies the base URL to use for resolving these relative - * URLs. The normative algorithm used is defined by RFC 1808, "Relative - * Uniform Resource Locators". If not specified, the default value is - * "http://www.googleapis.com/" - */ - baseUrl: string; - /** - * Whether to send work progress updates to the service. - */ - reportingEnabled: boolean; - /** - * The Cloud Dataflow service path relative to the root URL, for example, - * "dataflow/v1b3/projects". - */ - servicePath: string; - /** - * The Shuffle service path relative to the root URL, for example, - * "shuffle/v1beta1". - */ - shuffleServicePath: string; - /** - * The prefix of the resources the system should use for temporary storage. - * The supported resource type is: Google Cloud Storage: - * storage.googleapis.com/{bucket}/{object} - * bucket.storage.googleapis.com/{object} - */ - tempStoragePrefix: string; - /** - * The ID of the worker running this pipeline. - */ - workerId: string; -} -/** - * Shutdown notification from workers. This is to be sent by the shutdown script - * of the worker VM so that the backend knows that the VM is being shut down. - */ -export interface Schema$WorkerShutdownNotice { - /** - * The reason for the worker shutdown. Current possible values are: - * "UNKNOWN": shutdown reason is unknown. "PREEMPTION": - * shutdown reason is preemption. Other possible reasons may be added in the - * future. - */ - reason: string; -} -/** - * Service-side response to WorkerMessage issuing shutdown notice. - */ -export interface Schema$WorkerShutdownNoticeResponse {} -/** - * WorkItem represents basic information about a WorkItem to be executed in the - * cloud. - */ -export interface Schema$WorkItem { - /** - * Work item-specific configuration as an opaque blob. - */ - configuration: string; - /** - * Identifies this WorkItem. - */ - id: string; - /** - * The initial index to use when reporting the status of the WorkItem. - */ - initialReportIndex: string; - /** - * Identifies the workflow job this WorkItem belongs to. - */ - jobId: string; - /** - * Time when the lease on this Work will expire. - */ - leaseExpireTime: string; - /** - * Additional information for MapTask WorkItems. - */ - mapTask: Schema$MapTask; - /** - * Any required packages that need to be fetched in order to execute this - * WorkItem. - */ - packages: Schema$Package[]; - /** - * Identifies the cloud project this WorkItem belongs to. - */ - projectId: string; - /** - * Recommended reporting interval. - */ - reportStatusInterval: string; - /** - * Additional information for SeqMapTask WorkItems. - */ - seqMapTask: Schema$SeqMapTask; - /** - * Additional information for ShellTask WorkItems. - */ - shellTask: Schema$ShellTask; - /** - * Additional information for source operation WorkItems. - */ - sourceOperationTask: Schema$SourceOperationRequest; + * A representation of an int64, n, that is immune to precision loss when + * encoded in JSON. + */ + export interface Schema$SplitInt64 { + /** + * The high order bits, including the sign: n >> 32. + */ + highBits: number; + /** + * The low order bits: n & 0xffffffff. + */ + lowBits: number; + } /** - * Additional information for StreamingComputationTask WorkItems. - */ - streamingComputationTask: Schema$StreamingComputationTask; + * Description of an input or output of an execution stage. + */ + export interface Schema$StageSource { + /** + * Dataflow service generated name for this source. + */ + name: string; + /** + * User name for the original user transform or collection with which this + * source is most closely associated. + */ + originalTransformOrCollection: string; + /** + * Size of the source, if measurable. + */ + sizeBytes: string; + /** + * Human-readable name for this source; may be user or system generated. + */ + userName: string; + } /** - * Additional information for StreamingConfigTask WorkItems. - */ - streamingConfigTask: Schema$StreamingConfigTask; + * State family configuration. + */ + export interface Schema$StateFamilyConfig { + /** + * If true, this family corresponds to a read operation. + */ + isRead: boolean; + /** + * The state family value. + */ + stateFamily: string; + } /** - * Additional information for StreamingSetupTask WorkItems. - */ - streamingSetupTask: Schema$StreamingSetupTask; -} -/** - * The Dataflow service's idea of the current state of a WorkItem being - * processed by a worker. - */ -export interface Schema$WorkItemServiceState { + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * Other data returned by the service, specific to the particular worker - * harness. - */ - harnessData: any; + * Defines a particular step within a Cloud Dataflow job. A job consists of + * multiple steps, each of which performs some specific operation as part of + * the overall job. Data is typically passed from one step to another as part + * of the job. Here's an example of a sequence of steps which together + * implement a Map-Reduce job: * Read a collection of data from some + * source, parsing the collection's elements. * Validate the + * elements. * Apply a user-defined function to map each element to some + * value and extract an element-specific key value. * Group elements + * with the same key into a single element with that key, transforming a + * multiply-keyed collection into a uniquely-keyed collection. * Write + * the elements out to some data sink. Note that the Cloud Dataflow service + * may be used to run many different types of jobs, not just Map-Reduce. + */ + export interface Schema$Step { + /** + * The kind of step in the Cloud Dataflow job. + */ + kind: string; + /** + * The name that identifies the step. This must be unique for each step with + * respect to all other steps in the Cloud Dataflow job. + */ + name: string; + /** + * Named properties associated with the step. Each kind of predefined step + * has its own required set of properties. Must be provided on Create. Only + * retrieved with JOB_VIEW_ALL. + */ + properties: any; + } /** - * Time at which the current lease will expire. - */ - leaseExpireTime: string; + * Configuration information for a single streaming computation. + */ + export interface Schema$StreamingComputationConfig { + /** + * Unique identifier for this computation. + */ + computationId: string; + /** + * Instructions that comprise the computation. + */ + instructions: Schema$ParallelInstruction[]; + /** + * Stage name of this computation. + */ + stageName: string; + /** + * System defined name for this computation. + */ + systemName: string; + } /** - * The short ids that workers should use in subsequent metric updates. Workers - * should strive to use short ids whenever possible, but it is ok to request - * the short_id again if a worker lost track of it (e.g. if the worker is - * recovering from a crash). NOTE: it is possible that the response may have - * short ids for a subset of the metrics. - */ - metricShortId: Schema$MetricShortId[]; + * Describes full or partial data disk assignment information of the + * computation ranges. + */ + export interface Schema$StreamingComputationRanges { + /** + * The ID of the computation. + */ + computationId: string; + /** + * Data disk assignments for ranges from this computation. + */ + rangeAssignments: Schema$KeyRangeDataDiskAssignment[]; + } /** - * The index value to use for the next report sent by the worker. Note: If the - * report call fails for whatever reason, the worker should reuse this index - * for subsequent report attempts. - */ - nextReportIndex: string; + * A task which describes what action should be performed for the specified + * streaming computation ranges. + */ + export interface Schema$StreamingComputationTask { + /** + * Contains ranges of a streaming computation this task should apply to. + */ + computationRanges: Schema$StreamingComputationRanges[]; + /** + * Describes the set of data disks this task should apply to. + */ + dataDisks: Schema$MountedDataDisk[]; + /** + * A type of streaming computation task. + */ + taskType: string; + } /** - * New recommended reporting interval. - */ - reportStatusInterval: string; + * A task that carries configuration information for streaming computations. + */ + export interface Schema$StreamingConfigTask { + /** + * Set of computation configuration information. + */ + streamingComputationConfigs: Schema$StreamingComputationConfig[]; + /** + * Map from user step names to state families. + */ + userStepToStateFamilyNameMap: any; + /** + * If present, the worker must use this endpoint to communicate with + * Windmill Service dispatchers, otherwise the worker must continue to use + * whatever endpoint it had been using. + */ + windmillServiceEndpoint: string; + /** + * If present, the worker must use this port to communicate with Windmill + * Service dispatchers. Only applicable when windmill_service_endpoint is + * specified. + */ + windmillServicePort: string; + } /** - * The progress point in the WorkItem where the Dataflow service suggests that - * the worker truncate the task. - */ - splitRequest: Schema$ApproximateSplitRequest; + * A task which initializes part of a streaming Dataflow job. + */ + export interface Schema$StreamingSetupTask { + /** + * The user has requested drain. + */ + drain: boolean; + /** + * The TCP port on which the worker should listen for messages from other + * streaming computation workers. + */ + receiveWorkPort: number; + /** + * The global topology of the streaming Dataflow job. + */ + streamingComputationTopology: Schema$TopologyConfig; + /** + * The TCP port used by the worker to communicate with the Dataflow worker + * harness. + */ + workerHarnessPort: number; + } /** - * DEPRECATED in favor of split_request. - */ - suggestedStopPoint: Schema$ApproximateProgress; + * Identifies the location of a streaming side input. + */ + export interface Schema$StreamingSideInputLocation { + /** + * Identifies the state family where this side input is stored. + */ + stateFamily: string; + /** + * Identifies the particular side input within the streaming Dataflow job. + */ + tag: string; + } /** - * Obsolete, always empty. + * Identifies the location of a streaming computation stage, for + * stage-to-stage communication. */ - suggestedStopPosition: Schema$Position; -} -/** - * Conveys a worker's progress through the work described by a WorkItem. - */ -export interface Schema$WorkItemStatus { + export interface Schema$StreamingStageLocation { + /** + * Identifies the particular stream within the streaming Dataflow job. + */ + streamId: string; + } /** - * True if the WorkItem was completed (successfully or unsuccessfully). - */ - completed: boolean; + * Describes a stream of data, either as input to be processed or as output of + * a streaming Dataflow job. + */ + export interface Schema$StreamLocation { + /** + * The stream is a custom source. + */ + customSourceLocation: Schema$CustomSourceLocation; + /** + * The stream is a pubsub stream. + */ + pubsubLocation: Schema$PubsubLocation; + /** + * The stream is a streaming side input. + */ + sideInputLocation: Schema$StreamingSideInputLocation; + /** + * The stream is part of another computation within the current streaming + * Dataflow job. + */ + streamingStageLocation: Schema$StreamingStageLocation; + } /** - * Worker output counters for this WorkItem. + * A metric value representing a list of strings. */ - counterUpdates: Schema$CounterUpdate[]; + export interface Schema$StringList { + /** + * Elements of the list. + */ + elements: string[]; + } /** - * See documentation of stop_position. - */ - dynamicSourceSplit: Schema$DynamicSourceSplit; + * A rich message format, including a human readable string, a key for + * identifying the message, and structured data associated with the message + * for programmatic consumption. + */ + export interface Schema$StructuredMessage { + /** + * Idenfier for this message type. Used by external systems to + * internationalize or personalize message. + */ + messageKey: string; + /** + * Human-readable version of message. + */ + messageText: string; + /** + * The structured data associated with this message. + */ + parameters: Schema$Parameter[]; + } /** - * Specifies errors which occurred during processing. If errors are provided, - * and completed = true, then the WorkItem is considered to have failed. - */ - errors: Schema$Status[]; + * Taskrunner configuration settings. + */ + export interface Schema$TaskRunnerSettings { + /** + * Whether to also send taskrunner log info to stderr. + */ + alsologtostderr: boolean; + /** + * The location on the worker for task-specific subdirectories. + */ + baseTaskDir: string; + /** + * The base URL for the taskrunner to use when accessing Google Cloud APIs. + * When workers access Google Cloud APIs, they logically do so via relative + * URLs. If this field is specified, it supplies the base URL to use for + * resolving these relative URLs. The normative algorithm used is defined + * by RFC 1808, "Relative Uniform Resource Locators". If not + * specified, the default value is "http://www.googleapis.com/" + */ + baseUrl: string; + /** + * The file to store preprocessing commands in. + */ + commandlinesFileName: string; + /** + * Whether to continue taskrunner if an exception is hit. + */ + continueOnException: boolean; + /** + * The API version of endpoint, e.g. "v1b3" + */ + dataflowApiVersion: string; + /** + * The command to launch the worker harness. + */ + harnessCommand: string; + /** + * The suggested backend language. + */ + languageHint: string; + /** + * The directory on the VM to store logs. + */ + logDir: string; + /** + * Whether to send taskrunner log info to Google Compute Engine VM serial + * console. + */ + logToSerialconsole: boolean; + /** + * Indicates where to put logs. If this is not specified, the logs will not + * be uploaded. The supported resource type is: Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + logUploadLocation: string; + /** + * The OAuth2 scopes to be requested by the taskrunner in order to access + * the Cloud Dataflow API. + */ + oauthScopes: string[]; + /** + * The settings to pass to the parallel worker harness. + */ + parallelWorkerSettings: Schema$WorkerSettings; + /** + * The streaming worker main class name. + */ + streamingWorkerMainClass: string; + /** + * The UNIX group ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "wheel". + */ + taskGroup: string; + /** + * The UNIX user ID on the worker VM to use for tasks launched by + * taskrunner; e.g. "root". + */ + taskUser: string; + /** + * The prefix of the resources the taskrunner should use for temporary + * storage. The supported resource type is: Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix: string; + /** + * The ID string of the VM. + */ + vmId: string; + /** + * The file to store the workflow in. + */ + workflowFileName: string; + } /** - * DEPRECATED in favor of counter_updates. - */ - metricUpdates: Schema$MetricUpdate[]; + * Metadata describing a template. + */ + export interface Schema$TemplateMetadata { + /** + * Optional. A description of the template. + */ + description: string; + /** + * Required. The name of the template. + */ + name: string; + /** + * The parameters for the template. + */ + parameters: Schema$ParameterMetadata[]; + } /** - * DEPRECATED in favor of reported_progress. - */ - progress: Schema$ApproximateProgress; + * Global topology of the streaming Dataflow job, including all computations + * and their sharded locations. + */ + export interface Schema$TopologyConfig { + /** + * The computations associated with a streaming Dataflow job. + */ + computations: Schema$ComputationTopology[]; + /** + * The disks assigned to a streaming Dataflow job. + */ + dataDiskAssignments: Schema$DataDiskAssignment[]; + /** + * The size (in bits) of keys that will be assigned to source messages. + */ + forwardingKeyBits: number; + /** + * Version number for persistent state. + */ + persistentStateVersion: number; + /** + * Maps user stage names to stable computation names. + */ + userStageToComputationNameMap: any; + } /** - * The worker's progress through this WorkItem. - */ - reportedProgress: Schema$ApproximateReportedProgress; + * Description of the type, names/ids, and input/outputs for a transform. + */ + export interface Schema$TransformSummary { + /** + * Transform-specific display data. + */ + displayData: Schema$DisplayData[]; + /** + * SDK generated id of this transform instance. + */ + id: string; + /** + * User names for all collection inputs to this transform. + */ + inputCollectionName: string[]; + /** + * Type of transform. + */ + kind: string; + /** + * User provided name for this transform instance. + */ + name: string; + /** + * User names for all collection outputs to this transform. + */ + outputCollectionName: string[]; + } /** - * The report index. When a WorkItem is leased, the lease will contain an - * initial report index. When a WorkItem's status is reported to the - * system, the report should be sent with that report index, and the response - * will contain the index the worker should use for the next report. Reports - * received with unexpected index values will be rejected by the service. In - * order to preserve idempotency, the worker should not alter the contents of - * a report, even if the worker must submit the same report multiple times - * before getting back a response. The worker should not submit a subsequent - * report until the response for the previous report had been received from - * the service. - */ - reportIndex: string; + * WorkerHealthReport contains information about the health of a worker. The + * VM should be identified by the labels attached to the WorkerMessage that + * this health ping belongs to. + */ + export interface Schema$WorkerHealthReport { + /** + * The pods running on the worker. See: + * http://kubernetes.io/v1.1/docs/api-reference/v1/definitions.html#_v1_pod + * This field is used by the worker to send the status of the indvidual + * containers running on each worker. + */ + pods: any[]; + /** + * The interval at which the worker is sending health reports. The default + * value of 0 should be interpreted as the field is not being explicitly set + * by the worker. + */ + reportInterval: string; + /** + * Whether the VM is healthy. + */ + vmIsHealthy: boolean; + /** + * The time the VM was booted. + */ + vmStartupTime: string; + } /** - * Amount of time the worker requests for its lease. + * WorkerHealthReportResponse contains information returned to the worker in + * response to a health ping. */ - requestedLeaseDuration: string; + export interface Schema$WorkerHealthReportResponse { + /** + * A positive value indicates the worker should change its reporting + * interval to the specified value. The default value of zero means no + * change in report rate is requested by the server. + */ + reportInterval: string; + } /** - * DEPRECATED in favor of dynamic_source_split. - */ - sourceFork: Schema$SourceFork; + * A report of an event in a worker's lifecycle. The proto contains one + * event, because the worker is expected to asynchronously send each message + * immediately after the event. Due to this asynchrony, messages may arrive + * out of order (or missing), and it is up to the consumer to interpret. The + * timestamp of the event is in the enclosing WorkerMessage proto. + */ + export interface Schema$WorkerLifecycleEvent { + /** + * The start time of this container. All events will report this so that + * events can be grouped together across container/VM restarts. + */ + containerStartTime: string; + /** + * The event being reported. + */ + event: string; + /** + * Other stats that can accompany an event. E.g. { + * "downloaded_bytes" : "123456" } + */ + metadata: any; + } /** - * If the work item represented a SourceOperationRequest, and the work is - * completed, contains the result of the operation. - */ - sourceOperationResponse: Schema$SourceOperationResponse; + * WorkerMessage provides information to the backend about a worker. + */ + export interface Schema$WorkerMessage { + /** + * Labels are used to group WorkerMessages. For example, a worker_message + * about a particular container might have the labels: { "JOB_ID": + * "2015-04-22", "WORKER_ID": + * "wordcount-vm-2015…" "CONTAINER_TYPE": + * "worker", "CONTAINER_ID": "ac1234def"} + * Label tags typically correspond to Label enum values. However, for ease + * of development other strings can be used as tags. LABEL_UNSPECIFIED + * should not be used here. + */ + labels: any; + /** + * The timestamp of the worker_message. + */ + time: string; + /** + * The health of a worker. + */ + workerHealthReport: Schema$WorkerHealthReport; + /** + * Record of worker lifecycle events. + */ + workerLifecycleEvent: Schema$WorkerLifecycleEvent; + /** + * A worker message code. + */ + workerMessageCode: Schema$WorkerMessageCode; + /** + * Resource metrics reported by workers. + */ + workerMetrics: Schema$ResourceUtilizationReport; + /** + * Shutdown notice by workers. + */ + workerShutdownNotice: Schema$WorkerShutdownNotice; + } /** - * A worker may split an active map task in two parts, "primary" and - * "residual", continuing to process the primary part and returning - * the residual part into the pool of available work. This event is called a - * "dynamic split" and is critical to the dynamic work rebalancing - * feature. The two obtained sub-tasks are called "parts" of the - * split. The parts, if concatenated, must represent the same input as would - * be read by the current task if the split did not happen. The exact way in - * which the original task is decomposed into the two parts is specified - * either as a position demarcating them (stop_position), or explicitly as two - * DerivedSources, if this task consumes a user-defined source type - * (dynamic_source_split). The "current" task is adjusted as a - * result of the split: after a task with range [A, B) sends a stop_position - * update at C, its range is considered to be [A, C), e.g.: * Progress should - * be interpreted relative to the new range, e.g. "75% completed" - * means "75% of [A, C) completed" * The worker should interpret - * proposed_stop_position relative to the new range, e.g. "split at - * 68%" should be interpreted as "split at 68% of [A, C)". * - * If the worker chooses to split again using stop_position, only - * stop_positions in [A, C) will be accepted. * Etc. dynamic_source_split has - * similar semantics: e.g., if a task with source S splits using - * dynamic_source_split into {P, R} (where P and R must be together equivalent - * to S), then subsequent progress and proposed_stop_position should be - * interpreted relative to P, and in a potential subsequent - * dynamic_source_split into {P', R'}, P' and R' must be - * together equivalent to P, etc. - */ - stopPosition: Schema$Position; + * A message code is used to report status and error messages to the service. + * The message codes are intended to be machine readable. The service will + * take care of translating these into user understandable messages if + * necessary. Example use cases: 1. Worker processes reporting successful + * startup. 2. Worker processes reporting specific errors (e.g. package + * staging failure). + */ + export interface Schema$WorkerMessageCode { + /** + * The code is a string intended for consumption by a machine that + * identifies the type of message being sent. Examples: 1. + * "HARNESS_STARTED" might be used to indicate the worker harness + * has started. 2. "GCS_DOWNLOAD_ERROR" might be used to + * indicate an error downloading a GCS file as part of the boot process + * of one of the worker containers. This is a string and not an enum to + * make it easy to add new codes without waiting for an API change. + */ + code: string; + /** + * Parameters contains specific information about the code. This is a + * struct to allow parameters of different types. Examples: 1. For a + * "HARNESS_STARTED" message parameters might provide the name of + * the worker and additional data like timing information. 2. For a + * "GCS_DOWNLOAD_ERROR" parameters might contain fields listing + * the GCS objects being downloaded and fields containing errors. In + * general complex data structures should be avoided. If a worker needs to + * send a specific and complicated data structure then please consider + * defining a new proto and adding it to the data oneof in + * WorkerMessageResponse. Conventions: Parameters should only be used for + * information that isn't typically passed as a label. hostname and + * other worker identifiers should almost always be passed as labels since + * they will be included on most messages. + */ + parameters: any; + } /** - * Total time the worker spent being throttled by external systems. - */ - totalThrottlerWaitTimeSeconds: number; + * A worker_message response allows the server to pass information to the + * sender. + */ + export interface Schema$WorkerMessageResponse { + /** + * The service's response to a worker's health report. + */ + workerHealthReportResponse: Schema$WorkerHealthReportResponse; + /** + * Service's response to reporting worker metrics (currently empty). + */ + workerMetricsResponse: Schema$ResourceUtilizationReportResponse; + /** + * Service's response to shutdown notice (currently empty). + */ + workerShutdownNoticeResponse: Schema$WorkerShutdownNoticeResponse; + } /** - * Identifies the WorkItem. - */ - workItemId: string; -} -/** - * An instruction that writes records. Takes one input, produces no outputs. - */ -export interface Schema$WriteInstruction { + * Describes one particular pool of Cloud Dataflow workers to be instantiated + * by the Cloud Dataflow service in order to perform the computations required + * by a job. Note that a workflow job may use multiple pools, in order to + * match the various computational requirements of the various stages of the + * job. + */ + export interface Schema$WorkerPool { + /** + * Settings for autoscaling of this WorkerPool. + */ + autoscalingSettings: Schema$AutoscalingSettings; + /** + * Data disks that are used by a VM in this workflow. + */ + dataDisks: Schema$Disk[]; + /** + * The default package set to install. This allows the service to select a + * default set of packages which are useful to worker harnesses written in a + * particular language. + */ + defaultPackageSet: string; + /** + * Size of root disk for VMs, in GB. If zero or unspecified, the service + * will attempt to choose a reasonable default. + */ + diskSizeGb: number; + /** + * Fully qualified source image for disks. + */ + diskSourceImage: string; + /** + * Type of root disk for VMs. If empty or unspecified, the service will + * attempt to choose a reasonable default. + */ + diskType: string; + /** + * Configuration for VM IPs. + */ + ipConfiguration: string; + /** + * The kind of the worker pool; currently only `harness` and `shuffle` are + * supported. + */ + kind: string; + /** + * Machine type (e.g. "n1-standard-1"). If empty or unspecified, + * the service will attempt to choose a reasonable default. + */ + machineType: string; + /** + * Metadata to set on the Google Compute Engine VMs. + */ + metadata: any; + /** + * Network to which VMs will be assigned. If empty or unspecified, the + * service will use the network "default". + */ + network: string; + /** + * The number of threads per worker harness. If empty or unspecified, the + * service will choose a number of threads (according to the number of cores + * on the selected machine type for batch, or 1 by convention for + * streaming). + */ + numThreadsPerWorker: number; + /** + * Number of Google Compute Engine workers in this pool needed to execute + * the job. If zero or unspecified, the service will attempt to choose a + * reasonable default. + */ + numWorkers: number; + /** + * The action to take on host maintenance, as defined by the Google Compute + * Engine API. + */ + onHostMaintenance: string; + /** + * Packages to be installed on workers. + */ + packages: Schema$Package[]; + /** + * Extra arguments for this worker pool. + */ + poolArgs: any; + /** + * Subnetwork to which VMs will be assigned, if desired. Expected to be of + * the form "regions/REGION/subnetworks/SUBNETWORK". + */ + subnetwork: string; + /** + * Settings passed through to Google Compute Engine workers when using the + * standard Dataflow task runner. Users should ignore this field. + */ + taskrunnerSettings: Schema$TaskRunnerSettings; + /** + * Sets the policy for determining when to turndown worker pool. Allowed + * values are: `TEARDOWN_ALWAYS`, `TEARDOWN_ON_SUCCESS`, and + * `TEARDOWN_NEVER`. `TEARDOWN_ALWAYS` means workers are always torn down + * regardless of whether the job succeeds. `TEARDOWN_ON_SUCCESS` means + * workers are torn down if the job succeeds. `TEARDOWN_NEVER` means the + * workers are never torn down. If the workers are not torn down by the + * service, they will continue to run and use Google Compute Engine VM + * resources in the user's project until they are explicitly terminated + * by the user. Because of this, Google recommends using the + * `TEARDOWN_ALWAYS` policy except for small, manually supervised test jobs. + * If unknown or unspecified, the service will attempt to choose a + * reasonable default. + */ + teardownPolicy: string; + /** + * Required. Docker container image that executes the Cloud Dataflow worker + * harness, residing in Google Container Registry. + */ + workerHarnessContainerImage: string; + /** + * Zone to run the worker pools in. If empty or unspecified, the service + * will attempt to choose a reasonable default. + */ + zone: string; + } /** - * The input. - */ - input: Schema$InstructionInput; + * Provides data to pass through to the worker harness. + */ + export interface Schema$WorkerSettings { + /** + * The base URL for accessing Google Cloud APIs. When workers access Google + * Cloud APIs, they logically do so via relative URLs. If this field is + * specified, it supplies the base URL to use for resolving these relative + * URLs. The normative algorithm used is defined by RFC 1808, + * "Relative Uniform Resource Locators". If not specified, the + * default value is "http://www.googleapis.com/" + */ + baseUrl: string; + /** + * Whether to send work progress updates to the service. + */ + reportingEnabled: boolean; + /** + * The Cloud Dataflow service path relative to the root URL, for example, + * "dataflow/v1b3/projects". + */ + servicePath: string; + /** + * The Shuffle service path relative to the root URL, for example, + * "shuffle/v1beta1". + */ + shuffleServicePath: string; + /** + * The prefix of the resources the system should use for temporary storage. + * The supported resource type is: Google Cloud Storage: + * storage.googleapis.com/{bucket}/{object} + * bucket.storage.googleapis.com/{object} + */ + tempStoragePrefix: string; + /** + * The ID of the worker running this pipeline. + */ + workerId: string; + } /** - * The sink to write to. - */ - sink: Schema$Sink; -} - -export class Resource$Projects { - root: Dataflow; - jobs: Resource$Projects$Jobs; - locations: Resource$Projects$Locations; - templates: Resource$Projects$Templates; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - this.jobs = new Resource$Projects$Jobs(root); - this.locations = new Resource$Projects$Locations(root); - this.templates = new Resource$Projects$Templates(root); + * Shutdown notification from workers. This is to be sent by the shutdown + * script of the worker VM so that the backend knows that the VM is being shut + * down. + */ + export interface Schema$WorkerShutdownNotice { + /** + * The reason for the worker shutdown. Current possible values are: + * "UNKNOWN": shutdown reason is unknown. "PREEMPTION": + * shutdown reason is preemption. Other possible reasons may be added in the + * future. + */ + reason: string; } - - getRoot() { - return this.root; + /** + * Service-side response to WorkerMessage issuing shutdown notice. + */ + export interface Schema$WorkerShutdownNoticeResponse {} + /** + * WorkItem represents basic information about a WorkItem to be executed in + * the cloud. + */ + export interface Schema$WorkItem { + /** + * Work item-specific configuration as an opaque blob. + */ + configuration: string; + /** + * Identifies this WorkItem. + */ + id: string; + /** + * The initial index to use when reporting the status of the WorkItem. + */ + initialReportIndex: string; + /** + * Identifies the workflow job this WorkItem belongs to. + */ + jobId: string; + /** + * Time when the lease on this Work will expire. + */ + leaseExpireTime: string; + /** + * Additional information for MapTask WorkItems. + */ + mapTask: Schema$MapTask; + /** + * Any required packages that need to be fetched in order to execute this + * WorkItem. + */ + packages: Schema$Package[]; + /** + * Identifies the cloud project this WorkItem belongs to. + */ + projectId: string; + /** + * Recommended reporting interval. + */ + reportStatusInterval: string; + /** + * Additional information for SeqMapTask WorkItems. + */ + seqMapTask: Schema$SeqMapTask; + /** + * Additional information for ShellTask WorkItems. + */ + shellTask: Schema$ShellTask; + /** + * Additional information for source operation WorkItems. + */ + sourceOperationTask: Schema$SourceOperationRequest; + /** + * Additional information for StreamingComputationTask WorkItems. + */ + streamingComputationTask: Schema$StreamingComputationTask; + /** + * Additional information for StreamingConfigTask WorkItems. + */ + streamingConfigTask: Schema$StreamingConfigTask; + /** + * Additional information for StreamingSetupTask WorkItems. + */ + streamingSetupTask: Schema$StreamingSetupTask; } - - /** - * dataflow.projects.workerMessages - * @desc Send a worker_message to the service. - * @alias dataflow.projects.workerMessages - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The project to send the WorkerMessages to. - * @param {().SendWorkerMessagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - workerMessages(params?: any, options?: MethodOptions): - AxiosPromise; - workerMessages( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - workerMessages( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/WorkerMessages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Dataflow service's idea of the current state of a WorkItem being + * processed by a worker. + */ + export interface Schema$WorkItemServiceState { + /** + * Other data returned by the service, specific to the particular worker + * harness. + */ + harnessData: any; + /** + * Time at which the current lease will expire. + */ + leaseExpireTime: string; + /** + * The short ids that workers should use in subsequent metric updates. + * Workers should strive to use short ids whenever possible, but it is ok to + * request the short_id again if a worker lost track of it (e.g. if the + * worker is recovering from a crash). NOTE: it is possible that the + * response may have short ids for a subset of the metrics. + */ + metricShortId: Schema$MetricShortId[]; + /** + * The index value to use for the next report sent by the worker. Note: If + * the report call fails for whatever reason, the worker should reuse this + * index for subsequent report attempts. + */ + nextReportIndex: string; + /** + * New recommended reporting interval. + */ + reportStatusInterval: string; + /** + * The progress point in the WorkItem where the Dataflow service suggests + * that the worker truncate the task. + */ + splitRequest: Schema$ApproximateSplitRequest; + /** + * DEPRECATED in favor of split_request. + */ + suggestedStopPoint: Schema$ApproximateProgress; + /** + * Obsolete, always empty. + */ + suggestedStopPosition: Schema$Position; } -} -export class Resource$Projects$Jobs { - root: Dataflow; - debug: Resource$Projects$Jobs$Debug; - messages: Resource$Projects$Jobs$Messages; - workItems: Resource$Projects$Jobs$Workitems; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - this.debug = new Resource$Projects$Jobs$Debug(root); - this.messages = new Resource$Projects$Jobs$Messages(root); - this.workItems = new Resource$Projects$Jobs$Workitems(root); + /** + * Conveys a worker's progress through the work described by a WorkItem. + */ + export interface Schema$WorkItemStatus { + /** + * True if the WorkItem was completed (successfully or unsuccessfully). + */ + completed: boolean; + /** + * Worker output counters for this WorkItem. + */ + counterUpdates: Schema$CounterUpdate[]; + /** + * See documentation of stop_position. + */ + dynamicSourceSplit: Schema$DynamicSourceSplit; + /** + * Specifies errors which occurred during processing. If errors are + * provided, and completed = true, then the WorkItem is considered to have + * failed. + */ + errors: Schema$Status[]; + /** + * DEPRECATED in favor of counter_updates. + */ + metricUpdates: Schema$MetricUpdate[]; + /** + * DEPRECATED in favor of reported_progress. + */ + progress: Schema$ApproximateProgress; + /** + * The worker's progress through this WorkItem. + */ + reportedProgress: Schema$ApproximateReportedProgress; + /** + * The report index. When a WorkItem is leased, the lease will contain an + * initial report index. When a WorkItem's status is reported to the + * system, the report should be sent with that report index, and the + * response will contain the index the worker should use for the next + * report. Reports received with unexpected index values will be rejected + * by the service. In order to preserve idempotency, the worker should not + * alter the contents of a report, even if the worker must submit the same + * report multiple times before getting back a response. The worker should + * not submit a subsequent report until the response for the previous report + * had been received from the service. + */ + reportIndex: string; + /** + * Amount of time the worker requests for its lease. + */ + requestedLeaseDuration: string; + /** + * DEPRECATED in favor of dynamic_source_split. + */ + sourceFork: Schema$SourceFork; + /** + * If the work item represented a SourceOperationRequest, and the work is + * completed, contains the result of the operation. + */ + sourceOperationResponse: Schema$SourceOperationResponse; + /** + * A worker may split an active map task in two parts, "primary" + * and "residual", continuing to process the primary part and + * returning the residual part into the pool of available work. This event + * is called a "dynamic split" and is critical to the dynamic work + * rebalancing feature. The two obtained sub-tasks are called + * "parts" of the split. The parts, if concatenated, must + * represent the same input as would be read by the current task if the + * split did not happen. The exact way in which the original task is + * decomposed into the two parts is specified either as a position + * demarcating them (stop_position), or explicitly as two DerivedSources, if + * this task consumes a user-defined source type (dynamic_source_split). The + * "current" task is adjusted as a result of the split: after a + * task with range [A, B) sends a stop_position update at C, its range is + * considered to be [A, C), e.g.: * Progress should be interpreted relative + * to the new range, e.g. "75% completed" means "75% of [A, + * C) completed" * The worker should interpret proposed_stop_position + * relative to the new range, e.g. "split at 68%" should be + * interpreted as "split at 68% of [A, C)". * If the worker + * chooses to split again using stop_position, only stop_positions in [A, + * C) will be accepted. * Etc. dynamic_source_split has similar semantics: + * e.g., if a task with source S splits using dynamic_source_split into {P, + * R} (where P and R must be together equivalent to S), then subsequent + * progress and proposed_stop_position should be interpreted relative to P, + * and in a potential subsequent dynamic_source_split into {P', R'}, + * P' and R' must be together equivalent to P, etc. + */ + stopPosition: Schema$Position; + /** + * Total time the worker spent being throttled by external systems. + */ + totalThrottlerWaitTimeSeconds: number; + /** + * Identifies the WorkItem. + */ + workItemId: string; } - - getRoot() { - return this.root; + /** + * An instruction that writes records. Takes one input, produces no outputs. + */ + export interface Schema$WriteInstruction { + /** + * The input. + */ + input: Schema$InstructionInput; + /** + * The sink to write to. + */ + sink: Schema$Sink; } - - /** - * dataflow.projects.jobs.aggregated - * @desc List the jobs of a project across all regions. - * @alias dataflow.projects.jobs.aggregated - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The kind of filter to use. - * @param {string=} params.location The location that contains this job. - * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. - * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. - * @param {string} params.projectId The project which owns the jobs. - * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - aggregated(params?: any, options?: MethodOptions): - AxiosPromise; - aggregated( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregated( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Dataflow; + jobs: Resource$Projects$Jobs; + locations: Resource$Projects$Locations; + templates: Resource$Projects$Templates; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + this.jobs = new Resource$Projects$Jobs(root); + this.locations = new Resource$Projects$Locations(root); + this.templates = new Resource$Projects$Templates(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs:aggregated') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.jobs.create - * @desc Creates a Cloud Dataflow job. - * @alias dataflow.projects.jobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.replaceJobId Deprecated. This field is now in the Job message. - * @param {string=} params.view The level of information requested in response. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.workerMessages + * @desc Send a worker_message to the service. + * @alias dataflow.projects.workerMessages + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The project to send the WorkerMessages to. + * @param {().SendWorkerMessagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + workerMessages(params?: any, options?: MethodOptions): + AxiosPromise; + workerMessages( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + workerMessages( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/WorkerMessages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Jobs { + root: Dataflow; + debug: Resource$Projects$Jobs$Debug; + messages: Resource$Projects$Jobs$Messages; + workItems: Resource$Projects$Jobs$Workitems; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + this.debug = new Resource$Projects$Jobs$Debug(root); + this.messages = new Resource$Projects$Jobs$Messages(root); + this.workItems = new Resource$Projects$Jobs$Workitems(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.jobs.get - * @desc Gets the state of the specified Cloud Dataflow job. - * @alias dataflow.projects.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job ID. - * @param {string=} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.view The level of information requested in response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.jobs.aggregated + * @desc List the jobs of a project across all regions. + * @alias dataflow.projects.jobs.aggregated + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The kind of filter to use. + * @param {string=} params.location The location that contains this job. + * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. + * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. + * @param {string} params.projectId The project which owns the jobs. + * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregated(params?: any, options?: MethodOptions): + AxiosPromise; + aggregated( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregated( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs:aggregated') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.jobs.getMetrics - * @desc Request the job status. - * @alias dataflow.projects.jobs.getMetrics - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job to get messages for. - * @param {string=} params.location The location which contains the job specified by job_id. - * @param {string} params.projectId A project id. - * @param {string=} params.startTime Return only metric data that has changed since this time. Default is to return all information about all metrics for the job. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getMetrics(params?: any, options?: MethodOptions): - AxiosPromise; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.jobs.create + * @desc Creates a Cloud Dataflow job. + * @alias dataflow.projects.jobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.replaceJobId Deprecated. This field is now in the Job message. + * @param {string=} params.view The level of information requested in response. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.jobs.list - * @desc List the jobs of a project in a given region. - * @alias dataflow.projects.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The kind of filter to use. - * @param {string=} params.location The location that contains this job. - * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. - * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. - * @param {string} params.projectId The project which owns the jobs. - * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.jobs.get + * @desc Gets the state of the specified Cloud Dataflow job. + * @alias dataflow.projects.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job ID. + * @param {string=} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.view The level of information requested in response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.jobs.update - * @desc Updates the state of an existing Cloud Dataflow job. - * @alias dataflow.projects.jobs.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job ID. - * @param {string=} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.jobs.getMetrics + * @desc Request the job status. + * @alias dataflow.projects.jobs.getMetrics + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job to get messages for. + * @param {string=} params.location The location which contains the job specified by job_id. + * @param {string} params.projectId A project id. + * @param {string=} params.startTime Return only metric data that has changed since this time. Default is to return all information about all metrics for the job. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getMetrics(params?: any, options?: MethodOptions): + AxiosPromise; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Jobs$Debug { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * dataflow.projects.jobs.debug.getConfig - * @desc Get encoded debug configuration for component. Not cacheable. - * @alias dataflow.projects.jobs.debug.getConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job id. - * @param {string} params.projectId The project id. - * @param {().GetDebugConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.jobs.list + * @desc List the jobs of a project in a given region. + * @alias dataflow.projects.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The kind of filter to use. + * @param {string=} params.location The location that contains this job. + * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. + * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. + * @param {string} params.projectId The project which owns the jobs. + * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.jobs.debug.sendCapture - * @desc Send encoded debug capture data for component. - * @alias dataflow.projects.jobs.debug.sendCapture - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job id. - * @param {string} params.projectId The project id. - * @param {().SendDebugCaptureRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sendCapture(params?: any, options?: MethodOptions): - AxiosPromise; - sendCapture( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - sendCapture( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.jobs.update + * @desc Updates the state of an existing Cloud Dataflow job. + * @alias dataflow.projects.jobs.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job ID. + * @param {string=} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Jobs$Debug { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Jobs$Messages { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataflow.projects.jobs.debug.getConfig + * @desc Get encoded debug configuration for component. Not cacheable. + * @alias dataflow.projects.jobs.debug.getConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job id. + * @param {string} params.projectId The project id. + * @param {().GetDebugConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/jobs/{jobId}/debug/getConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataflow.projects.jobs.messages.list - * @desc Request the job status. - * @alias dataflow.projects.jobs.messages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.endTime Return only messages with timestamps < end_time. The default is now (i.e. return up to the latest messages available). - * @param {string} params.jobId The job to get messages about. - * @param {string=} params.location The location which contains the job specified by job_id. - * @param {string=} params.minimumImportance Filter to only get messages with importance >= level - * @param {integer=} params.pageSize If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results. - * @param {string=} params.pageToken If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned. - * @param {string} params.projectId A project id. - * @param {string=} params.startTime If specified, return only messages with timestamps >= start_time. The default is the job creation time (i.e. beginning of messages). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.jobs.debug.sendCapture + * @desc Send encoded debug capture data for component. + * @alias dataflow.projects.jobs.debug.sendCapture + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job id. + * @param {string} params.projectId The project id. + * @param {().SendDebugCaptureRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sendCapture(params?: any, options?: MethodOptions): + AxiosPromise; + sendCapture( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + sendCapture( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/jobs/{jobId}/debug/sendCapture') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Jobs$Workitems { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Jobs$Messages { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dataflow.projects.jobs.workItems.lease - * @desc Leases a dataflow WorkItem to run. - * @alias dataflow.projects.jobs.workItems.lease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Identifies the workflow job this worker belongs to. - * @param {string} params.projectId Identifies the project this worker belongs to. - * @param {().LeaseWorkItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lease(params?: any, options?: MethodOptions): - AxiosPromise; - lease( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - lease( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.jobs.messages.list + * @desc Request the job status. + * @alias dataflow.projects.jobs.messages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.endTime Return only messages with timestamps < end_time. The default is now (i.e. return up to the latest messages available). + * @param {string} params.jobId The job to get messages about. + * @param {string=} params.location The location which contains the job specified by job_id. + * @param {string=} params.minimumImportance Filter to only get messages with importance >= level + * @param {integer=} params.pageSize If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results. + * @param {string=} params.pageToken If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned. + * @param {string} params.projectId A project id. + * @param {string=} params.startTime If specified, return only messages with timestamps >= start_time. The default is the job creation time (i.e. beginning of messages). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1b3/projects/{projectId}/jobs/{jobId}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataflow.projects.jobs.workItems.reportStatus - * @desc Reports the status of dataflow WorkItems leased by a worker. - * @alias dataflow.projects.jobs.workItems.reportStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job which the WorkItem is part of. - * @param {string} params.projectId The project which owns the WorkItem's job. - * @param {().ReportWorkItemStatusRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reportStatus(params?: any, options?: MethodOptions): - AxiosPromise; - reportStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - reportStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Jobs$Workitems { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'jobId'], - pathParams: ['jobId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + getRoot() { + return this.root; + } -export class Resource$Projects$Locations { - root: Dataflow; - jobs: Resource$Projects$Locations$Jobs; - templates: Resource$Projects$Locations$Templates; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - this.jobs = new Resource$Projects$Locations$Jobs(root); - this.templates = new Resource$Projects$Locations$Templates(root); - } - getRoot() { - return this.root; - } + /** + * dataflow.projects.jobs.workItems.lease + * @desc Leases a dataflow WorkItem to run. + * @alias dataflow.projects.jobs.workItems.lease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Identifies the workflow job this worker belongs to. + * @param {string} params.projectId Identifies the project this worker belongs to. + * @param {().LeaseWorkItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lease(params?: any, options?: MethodOptions): + AxiosPromise; + lease( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + lease( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/jobs/{jobId}/workItems:lease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataflow.projects.locations.workerMessages - * @desc Send a worker_message to the service. - * @alias dataflow.projects.locations.workerMessages - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The location which contains the job - * @param {string} params.projectId The project to send the WorkerMessages to. - * @param {().SendWorkerMessagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - workerMessages(params?: any, options?: MethodOptions): - AxiosPromise; - workerMessages( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - workerMessages( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.jobs.workItems.reportStatus + * @desc Reports the status of dataflow WorkItems leased by a worker. + * @alias dataflow.projects.jobs.workItems.reportStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job which the WorkItem is part of. + * @param {string} params.projectId The project which owns the WorkItem's job. + * @param {().ReportWorkItemStatusRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reportStatus(params?: any, options?: MethodOptions): + AxiosPromise; + reportStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + reportStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/jobs/{jobId}/workItems:reportStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'jobId'], + pathParams: ['jobId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/WorkerMessages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Jobs { - root: Dataflow; - debug: Resource$Projects$Locations$Jobs$Debug; - messages: Resource$Projects$Locations$Jobs$Messages; - workItems: Resource$Projects$Locations$Jobs$Workitems; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - this.debug = new Resource$Projects$Locations$Jobs$Debug(root); - this.messages = new Resource$Projects$Locations$Jobs$Messages(root); - this.workItems = new Resource$Projects$Locations$Jobs$Workitems(root); - } - - getRoot() { - return this.root; } - /** - * dataflow.projects.locations.jobs.create - * @desc Creates a Cloud Dataflow job. - * @alias dataflow.projects.locations.jobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.replaceJobId Deprecated. This field is now in the Job message. - * @param {string=} params.view The level of information requested in response. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Locations { + root: Dataflow; + jobs: Resource$Projects$Locations$Jobs; + templates: Resource$Projects$Locations$Templates; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + this.jobs = new Resource$Projects$Locations$Jobs(root); + this.templates = new Resource$Projects$Locations$Templates(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.locations.jobs.get - * @desc Gets the state of the specified Cloud Dataflow job. - * @alias dataflow.projects.locations.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job ID. - * @param {string} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.view The level of information requested in response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.locations.workerMessages + * @desc Send a worker_message to the service. + * @alias dataflow.projects.locations.workerMessages + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The location which contains the job + * @param {string} params.projectId The project to send the WorkerMessages to. + * @param {().SendWorkerMessagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + workerMessages(params?: any, options?: MethodOptions): + AxiosPromise; + workerMessages( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + workerMessages( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/WorkerMessages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Jobs { + root: Dataflow; + debug: Resource$Projects$Locations$Jobs$Debug; + messages: Resource$Projects$Locations$Jobs$Messages; + workItems: Resource$Projects$Locations$Jobs$Workitems; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + this.debug = new Resource$Projects$Locations$Jobs$Debug(root); + this.messages = new Resource$Projects$Locations$Jobs$Messages(root); + this.workItems = new Resource$Projects$Locations$Jobs$Workitems(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.locations.jobs.getMetrics - * @desc Request the job status. - * @alias dataflow.projects.locations.jobs.getMetrics - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job to get messages for. - * @param {string} params.location The location which contains the job specified by job_id. - * @param {string} params.projectId A project id. - * @param {string=} params.startTime Return only metric data that has changed since this time. Default is to return all information about all metrics for the job. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getMetrics(params?: any, options?: MethodOptions): - AxiosPromise; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.locations.jobs.create + * @desc Creates a Cloud Dataflow job. + * @alias dataflow.projects.locations.jobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.replaceJobId Deprecated. This field is now in the Job message. + * @param {string=} params.view The level of information requested in response. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.locations.jobs.list - * @desc List the jobs of a project in a given region. - * @alias dataflow.projects.locations.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The kind of filter to use. - * @param {string} params.location The location that contains this job. - * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. - * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. - * @param {string} params.projectId The project which owns the jobs. - * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.locations.jobs.get + * @desc Gets the state of the specified Cloud Dataflow job. + * @alias dataflow.projects.locations.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job ID. + * @param {string} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.view The level of information requested in response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataflow.projects.locations.jobs.update - * @desc Updates the state of an existing Cloud Dataflow job. - * @alias dataflow.projects.locations.jobs.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job ID. - * @param {string} params.location The location that contains this job. - * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.locations.jobs.getMetrics + * @desc Request the job status. + * @alias dataflow.projects.locations.jobs.getMetrics + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job to get messages for. + * @param {string} params.location The location which contains the job specified by job_id. + * @param {string} params.projectId A project id. + * @param {string=} params.startTime Return only metric data that has changed since this time. Default is to return all information about all metrics for the job. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getMetrics(params?: any, options?: MethodOptions): + AxiosPromise; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Jobs$Debug { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * dataflow.projects.locations.jobs.debug.getConfig - * @desc Get encoded debug configuration for component. Not cacheable. - * @alias dataflow.projects.locations.jobs.debug.getConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job id. - * @param {string} params.location The location which contains the job specified by job_id. - * @param {string} params.projectId The project id. - * @param {().GetDebugConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.locations.jobs.list + * @desc List the jobs of a project in a given region. + * @alias dataflow.projects.locations.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The kind of filter to use. + * @param {string} params.location The location that contains this job. + * @param {integer=} params.pageSize If there are many jobs, limit response to at most this many. The actual number of jobs returned will be the lesser of max_responses and an unspecified server-defined limit. + * @param {string=} params.pageToken Set this to the 'next_page_token' field of a previous response to request additional results in a long list. + * @param {string} params.projectId The project which owns the jobs. + * @param {string=} params.view Level of information requested in response. Default is `JOB_VIEW_SUMMARY`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataflow.projects.locations.jobs.debug.sendCapture - * @desc Send encoded debug capture data for component. - * @alias dataflow.projects.locations.jobs.debug.sendCapture - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job id. - * @param {string} params.location The location which contains the job specified by job_id. - * @param {string} params.projectId The project id. - * @param {().SendDebugCaptureRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sendCapture(params?: any, options?: MethodOptions): - AxiosPromise; - sendCapture( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - sendCapture( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.locations.jobs.update + * @desc Updates the state of an existing Cloud Dataflow job. + * @alias dataflow.projects.locations.jobs.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job ID. + * @param {string} params.location The location that contains this job. + * @param {string} params.projectId The ID of the Cloud Platform project that the job belongs to. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Jobs$Debug { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Locations$Jobs$Messages { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataflow.projects.locations.jobs.debug.getConfig + * @desc Get encoded debug configuration for component. Not cacheable. + * @alias dataflow.projects.locations.jobs.debug.getConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job id. + * @param {string} params.location The location which contains the job specified by job_id. + * @param {string} params.projectId The project id. + * @param {().GetDebugConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/getConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataflow.projects.locations.jobs.messages.list - * @desc Request the job status. - * @alias dataflow.projects.locations.jobs.messages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.endTime Return only messages with timestamps < end_time. The default is now (i.e. return up to the latest messages available). - * @param {string} params.jobId The job to get messages about. - * @param {string} params.location The location which contains the job specified by job_id. - * @param {string=} params.minimumImportance Filter to only get messages with importance >= level - * @param {integer=} params.pageSize If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results. - * @param {string=} params.pageToken If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned. - * @param {string} params.projectId A project id. - * @param {string=} params.startTime If specified, return only messages with timestamps >= start_time. The default is the job creation time (i.e. beginning of messages). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.locations.jobs.debug.sendCapture + * @desc Send encoded debug capture data for component. + * @alias dataflow.projects.locations.jobs.debug.sendCapture + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job id. + * @param {string} params.location The location which contains the job specified by job_id. + * @param {string} params.projectId The project id. + * @param {().SendDebugCaptureRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sendCapture(params?: any, options?: MethodOptions): + AxiosPromise; + sendCapture( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + sendCapture( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/debug/sendCapture') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Locations$Jobs$Workitems { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Locations$Jobs$Messages { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dataflow.projects.locations.jobs.workItems.lease - * @desc Leases a dataflow WorkItem to run. - * @alias dataflow.projects.locations.jobs.workItems.lease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Identifies the workflow job this worker belongs to. - * @param {string} params.location The location which contains the WorkItem's job. - * @param {string} params.projectId Identifies the project this worker belongs to. - * @param {().LeaseWorkItemRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lease(params?: any, options?: MethodOptions): - AxiosPromise; - lease( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - lease( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.locations.jobs.messages.list + * @desc Request the job status. + * @alias dataflow.projects.locations.jobs.messages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.endTime Return only messages with timestamps < end_time. The default is now (i.e. return up to the latest messages available). + * @param {string} params.jobId The job to get messages about. + * @param {string} params.location The location which contains the job specified by job_id. + * @param {string=} params.minimumImportance Filter to only get messages with importance >= level + * @param {integer=} params.pageSize If specified, determines the maximum number of messages to return. If unspecified, the service may choose an appropriate default, or may return an arbitrarily large number of results. + * @param {string=} params.pageToken If supplied, this should be the value of next_page_token returned by an earlier call. This will cause the next page of results to be returned. + * @param {string} params.projectId A project id. + * @param {string=} params.startTime If specified, return only messages with timestamps >= start_time. The default is the job creation time (i.e. beginning of messages). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataflow.projects.locations.jobs.workItems.reportStatus - * @desc Reports the status of dataflow WorkItems leased by a worker. - * @alias dataflow.projects.locations.jobs.workItems.reportStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The job which the WorkItem is part of. - * @param {string} params.location The location which contains the WorkItem's job. - * @param {string} params.projectId The project which owns the WorkItem's job. - * @param {().ReportWorkItemStatusRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reportStatus(params?: any, options?: MethodOptions): - AxiosPromise; - reportStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - reportStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location', 'jobId'], - pathParams: ['jobId', 'location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations$Jobs$Workitems { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - } -} + getRoot() { + return this.root; + } -export class Resource$Projects$Locations$Templates { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataflow.projects.locations.jobs.workItems.lease + * @desc Leases a dataflow WorkItem to run. + * @alias dataflow.projects.locations.jobs.workItems.lease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Identifies the workflow job this worker belongs to. + * @param {string} params.location The location which contains the WorkItem's job. + * @param {string} params.projectId Identifies the project this worker belongs to. + * @param {().LeaseWorkItemRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lease(params?: any, options?: MethodOptions): + AxiosPromise; + lease( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + lease( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:lease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataflow.projects.locations.templates.create - * @desc Creates a Cloud Dataflow job from a template. - * @alias dataflow.projects.locations.templates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.location The location to which to direct the request. - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {().CreateJobFromTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.locations.jobs.workItems.reportStatus + * @desc Reports the status of dataflow WorkItems leased by a worker. + * @alias dataflow.projects.locations.jobs.workItems.reportStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The job which the WorkItem is part of. + * @param {string} params.location The location which contains the WorkItem's job. + * @param {string} params.projectId The project which owns the WorkItem's job. + * @param {().ReportWorkItemStatusRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reportStatus(params?: any, options?: MethodOptions): + AxiosPromise; + reportStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + reportStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/jobs/{jobId}/workItems:reportStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location', 'jobId'], + pathParams: ['jobId', 'location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - /** - * dataflow.projects.locations.templates.get - * @desc Get the template associated with a template. - * @alias dataflow.projects.locations.templates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`. - * @param {string} params.location The location to which to direct the request. - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.view The view to retrieve. Defaults to METADATA_ONLY. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Locations$Templates { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/templates:get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.locations.templates.launch - * @desc Launch a template. - * @alias dataflow.projects.locations.templates.launch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'. - * @param {string} params.location The location to which to direct the request. - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {boolean=} params.validateOnly If true, the request is validated but not actually executed. Defaults to false. - * @param {().LaunchTemplateParameters} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - launch(params?: any, options?: MethodOptions): - AxiosPromise; - launch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - launch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataflow.projects.locations.templates.create + * @desc Creates a Cloud Dataflow job from a template. + * @alias dataflow.projects.locations.templates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.location The location to which to direct the request. + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {().CreateJobFromTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1b3/projects/{projectId}/locations/{location}/templates:launch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'location'], - pathParams: ['location', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects$Templates { - root: Dataflow; - constructor(root: Dataflow) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataflow.projects.locations.templates.get + * @desc Get the template associated with a template. + * @alias dataflow.projects.locations.templates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`. + * @param {string} params.location The location to which to direct the request. + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.view The view to retrieve. Defaults to METADATA_ONLY. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/templates:get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataflow.projects.templates.create - * @desc Creates a Cloud Dataflow job from a template. - * @alias dataflow.projects.templates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {().CreateJobFromTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataflow.projects.locations.templates.launch + * @desc Launch a template. + * @alias dataflow.projects.locations.templates.launch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'. + * @param {string} params.location The location to which to direct the request. + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {boolean=} params.validateOnly If true, the request is validated but not actually executed. Defaults to false. + * @param {().LaunchTemplateParameters} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + launch(params?: any, options?: MethodOptions): + AxiosPromise; + launch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + launch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1b3/projects/{projectId}/locations/{location}/templates:launch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'location'], + pathParams: ['location', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * dataflow.projects.templates.get - * @desc Get the template associated with a template. - * @alias dataflow.projects.templates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`. - * @param {string=} params.location The location to which to direct the request. - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {string=} params.view The view to retrieve. Defaults to METADATA_ONLY. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Templates { + root: Dataflow; + constructor(root: Dataflow) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/templates:get') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataflow.projects.templates.launch - * @desc Launch a template. - * @alias dataflow.projects.templates.launch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'. - * @param {string=} params.location The location to which to direct the request. - * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. - * @param {boolean=} params.validateOnly If true, the request is validated but not actually executed. Defaults to false. - * @param {().LaunchTemplateParameters} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - launch(params?: any, options?: MethodOptions): - AxiosPromise; - launch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - launch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataflow.projects.templates.create + * @desc Creates a Cloud Dataflow job from a template. + * @alias dataflow.projects.templates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {().CreateJobFromTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataflow.projects.templates.get + * @desc Get the template associated with a template. + * @alias dataflow.projects.templates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`. + * @param {string=} params.location The location to which to direct the request. + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {string=} params.view The view to retrieve. Defaults to METADATA_ONLY. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/templates:get') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1b3/projects/{projectId}/templates:launch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataflow.projects.templates.launch + * @desc Launch a template. + * @alias dataflow.projects.templates.launch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.gcsPath Required. A Cloud Storage path to the template from which to create the job. Must be valid Cloud Storage URL, beginning with 'gs://'. + * @param {string=} params.location The location to which to direct the request. + * @param {string} params.projectId Required. The ID of the Cloud Platform project that the job belongs to. + * @param {boolean=} params.validateOnly If true, the request is validated but not actually executed. Defaults to false. + * @param {().LaunchTemplateParameters} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + launch(params?: any, options?: MethodOptions): + AxiosPromise; + launch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + launch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1b3/projects/{projectId}/templates:launch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dataproc/v1.ts b/src/apis/dataproc/v1.ts index 96a400db835..44528ec0515 100644 --- a/src/apis/dataproc/v1.ts +++ b/src/apis/dataproc/v1.ts @@ -27,3019 +27,3062 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Dataproc API - * - * Manages Hadoop-based clusters and jobs on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const dataproc = google.dataproc('v1'); - * - * @namespace dataproc - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Dataproc - */ -export class Dataproc { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dataproc_v1 { + /** + * Cloud Dataproc API + * + * Manages Hadoop-based clusters and jobs on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const dataproc = google.dataproc('v1'); + * + * @namespace dataproc + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Dataproc + */ + export class Dataproc { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Specifies the type and number of accelerator cards attached to the instances - * of an instance. See GPUs on Compute Engine. - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the accelerator cards of this type exposed to this instance. - */ - acceleratorCount: number; /** - * Full URL, partial URI, or short name of the accelerator type resource to - * expose to this instance. See Compute Engine AcceleratorTypes.Examples: - * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc - * Auto Zone Placement feature, you must use the short name of the accelerator - * type resource, for example, nvidia-tesla-k80. - */ - acceleratorTypeUri: string; -} -/** - * A request to cancel a job. - */ -export interface Schema$CancelJobRequest {} -/** - * Describes the identifying information, config, and status of a cluster of - * Compute Engine instances. - */ -export interface Schema$Cluster { - /** - * Required. The cluster name. Cluster names within a project must be unique. - * Names of deleted clusters can be reused. - */ - clusterName: string; - /** - * Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc - * generates this value when it creates the cluster. - */ - clusterUuid: string; + * Specifies the type and number of accelerator cards attached to the + * instances of an instance. See GPUs on Compute Engine. + */ + export interface Schema$AcceleratorConfig { + /** + * The number of the accelerator cards of this type exposed to this + * instance. + */ + acceleratorCount: number; + /** + * Full URL, partial URI, or short name of the accelerator type resource to + * expose to this instance. See Compute Engine AcceleratorTypes.Examples: + * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc + * Auto Zone Placement feature, you must use the short name of the + * accelerator type resource, for example, nvidia-tesla-k80. + */ + acceleratorTypeUri: string; + } /** - * Required. The cluster config. Note that Cloud Dataproc may set default - * values, and values may change when clusters are updated. - */ - config: Schema$ClusterConfig; + * A request to cancel a job. + */ + export interface Schema$CancelJobRequest {} + /** + * Describes the identifying information, config, and status of a cluster of + * Compute Engine instances. + */ + export interface Schema$Cluster { + /** + * Required. The cluster name. Cluster names within a project must be + * unique. Names of deleted clusters can be reused. + */ + clusterName: string; + /** + * Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc + * generates this value when it creates the cluster. + */ + clusterUuid: string; + /** + * Required. The cluster config. Note that Cloud Dataproc may set default + * values, and values may change when clusters are updated. + */ + config: Schema$ClusterConfig; + /** + * Optional. The labels to associate with this cluster. Label keys must + * contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, + * if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + * associated with a cluster. + */ + labels: any; + /** + * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: + * This report is available for testing purposes only. It may be changed + * before final release. + */ + metrics: Schema$ClusterMetrics; + /** + * Required. The Google Cloud Platform project ID that the cluster belongs + * to. + */ + projectId: string; + /** + * Output only. Cluster status. + */ + status: Schema$ClusterStatus; + /** + * Output only. The previous cluster status. + */ + statusHistory: Schema$ClusterStatus[]; + } /** - * Optional. The labels to associate with this cluster. Label keys must - * contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if - * present, must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - * associated with a cluster. - */ - labels: any; + * The cluster config. + */ + export interface Schema$ClusterConfig { + /** + * Optional. A Cloud Storage staging bucket used for sharing generated SSH + * keys and config. If you do not specify a staging bucket, Cloud Dataproc + * will determine an appropriate Cloud Storage location (US, ASIA, or EU) + * for your cluster's staging bucket according to the Google Compute + * Engine zone where your cluster is deployed, and then it will create and + * manage this project-level, per-location bucket for you. + */ + configBucket: string; + /** + * Required. The shared Compute Engine config settings for all instances in + * a cluster. + */ + gceClusterConfig: Schema$GceClusterConfig; + /** + * Optional. Commands to execute on each node after config is completed. By + * default, executables are run on master and all worker nodes. You can test + * a node's role metadata to run an executable on a master or worker + * node, as shown below using curl (you can also use wget): ROLE=$(curl -H + * Metadata-Flavor:Google + * http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) if + * [[ "${ROLE}" == 'Master' ]]; then ... master specific + * actions ... else ... worker specific actions ... fi + */ + initializationActions: Schema$NodeInitializationAction[]; + /** + * Optional. The Compute Engine config settings for the master instance in a + * cluster. + */ + masterConfig: Schema$InstanceGroupConfig; + /** + * Optional. The Compute Engine config settings for additional worker + * instances in a cluster. + */ + secondaryWorkerConfig: Schema$InstanceGroupConfig; + /** + * Optional. The config settings for software inside the cluster. + */ + softwareConfig: Schema$SoftwareConfig; + /** + * Optional. The Compute Engine config settings for worker instances in a + * cluster. + */ + workerConfig: Schema$InstanceGroupConfig; + } /** - * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: + * Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: * This report is available for testing purposes only. It may be changed * before final release. */ - metrics: Schema$ClusterMetrics; - /** - * Required. The Google Cloud Platform project ID that the cluster belongs to. - */ - projectId: string; - /** - * Output only. Cluster status. - */ - status: Schema$ClusterStatus; - /** - * Output only. The previous cluster status. - */ - statusHistory: Schema$ClusterStatus[]; -} -/** - * The cluster config. - */ -export interface Schema$ClusterConfig { - /** - * Optional. A Cloud Storage staging bucket used for sharing generated SSH - * keys and config. If you do not specify a staging bucket, Cloud Dataproc - * will determine an appropriate Cloud Storage location (US, ASIA, or EU) for - * your cluster's staging bucket according to the Google Compute Engine - * zone where your cluster is deployed, and then it will create and manage - * this project-level, per-location bucket for you. - */ - configBucket: string; - /** - * Required. The shared Compute Engine config settings for all instances in a - * cluster. - */ - gceClusterConfig: Schema$GceClusterConfig; - /** - * Optional. Commands to execute on each node after config is completed. By - * default, executables are run on master and all worker nodes. You can test a - * node's role metadata to run an executable on a master or worker node, - * as shown below using curl (you can also use wget): ROLE=$(curl -H - * Metadata-Flavor:Google - * http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) if [[ - * "${ROLE}" == 'Master' ]]; then ... master specific - * actions ... else ... worker specific actions ... fi - */ - initializationActions: Schema$NodeInitializationAction[]; - /** - * Optional. The Compute Engine config settings for the master instance in a - * cluster. - */ - masterConfig: Schema$InstanceGroupConfig; - /** - * Optional. The Compute Engine config settings for additional worker - * instances in a cluster. - */ - secondaryWorkerConfig: Schema$InstanceGroupConfig; - /** - * Optional. The config settings for software inside the cluster. - */ - softwareConfig: Schema$SoftwareConfig; - /** - * Optional. The Compute Engine config settings for worker instances in a - * cluster. - */ - workerConfig: Schema$InstanceGroupConfig; -} -/** - * Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: - * This report is available for testing purposes only. It may be changed before - * final release. - */ -export interface Schema$ClusterMetrics { - /** - * The HDFS metrics. - */ - hdfsMetrics: any; - /** - * The YARN metrics. - */ - yarnMetrics: any; -} -/** - * Metadata describing the operation. - */ -export interface Schema$ClusterOperationMetadata { - /** - * Output only. Name of the cluster for the operation. - */ - clusterName: string; - /** - * Output only. Cluster UUID for the operation. - */ - clusterUuid: string; - /** - * Output only. Short description of operation. - */ - description: string; - /** - * Output only. Labels associated with the operation - */ - labels: any; - /** - * Output only. The operation type. - */ - operationType: string; - /** - * Output only. Current operation status. - */ - status: Schema$ClusterOperationStatus; - /** - * Output only. The previous operation status. - */ - statusHistory: Schema$ClusterOperationStatus[]; - /** - * Output only. Errors encountered during operation execution. - */ - warnings: string[]; -} -/** - * The status of the operation. - */ -export interface Schema$ClusterOperationStatus { - /** - * Output only. A message containing any operation metadata details. - */ - details: string; - /** - * Output only. A message containing the detailed operation state. - */ - innerState: string; - /** - * Output only. A message containing the operation state. - */ - state: string; - /** - * Output only. The time this state was entered. - */ - stateStartTime: string; -} -/** - * The status of a cluster and its instances. - */ -export interface Schema$ClusterStatus { - /** - * Output only. Optional details of cluster's state. - */ - detail: string; - /** - * Output only. The cluster's state. - */ - state: string; - /** - * Output only. Time when this state was entered. - */ - stateStartTime: string; - /** - * Output only. Additional state information that includes status reported by - * the agent. - */ - substate: string; -} -/** - * A request to collect cluster diagnostic information. - */ -export interface Schema$DiagnoseClusterRequest {} -/** - * The location of diagnostic output. - */ -export interface Schema$DiagnoseClusterResults { - /** - * Output only. The Cloud Storage URI of the diagnostic output. The output - * report is a plain text file with a summary of collected diagnostics. - */ - outputUri: string; -} -/** - * Specifies the config of disk options for a group of VM instances. - */ -export interface Schema$DiskConfig { - /** - * Optional. Size in GB of the boot disk (default is 500GB). - */ - bootDiskSizeGb: number; - /** - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are - * not attached, the boot disk is used to store runtime logs and HDFS - * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one - * or more SSDs are attached, this runtime bulk data is spread across them, - * and the boot disk contains only basic config and installed binaries. - */ - numLocalSsds: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Common config settings for resources of Compute Engine cluster instances, - * applicable to all instances in the cluster. - */ -export interface Schema$GceClusterConfig { - /** - * Optional. If true, all instances in the cluster will only have internal IP - * addresses. By default, clusters are not restricted to internal IP - * addresses, and will have ephemeral external IP addresses assigned to each - * instance. This internal_ip_only restriction can only be enabled for - * subnetwork enabled networks, and all off-cluster dependencies must be - * configured to be accessible without external IP addresses. - */ - internalIpOnly: boolean; - /** - * The Compute Engine metadata entries to add to all instances (see Project - * and instance metadata - * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). - */ - metadata: any; - /** - * Optional. The Compute Engine network to be used for machine communications. - * Cannot be specified with subnetwork_uri. If neither network_uri nor - * subnetwork_uri is specified, the "default" network of the project - * is used, if it exists. Cannot be a "Custom Subnet Network" (see - * Using Subnetworks for more information).A full URL, partial URI, or short - * name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default - * projects/[project_id]/regions/global/default default - */ - networkUri: string; - /** - * Optional. The service account of the instances. Defaults to the default - * Compute Engine service account. Custom service accounts need permissions - * equivalent to the following IAM roles: roles/logging.logWriter - * roles/storage.objectAdmin(see - * https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts - * for more information). Example: - * [account_id]@[project_id].iam.gserviceaccount.com - */ - serviceAccount: string; - /** - * Optional. The URIs of service account scopes to be included in Compute - * Engine instances. The following base set of scopes is always included: - * https://www.googleapis.com/auth/cloud.useraccounts.readonly - * https://www.googleapis.com/auth/devstorage.read_write - * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, - * the following defaults are also provided: - * https://www.googleapis.com/auth/bigquery - * https://www.googleapis.com/auth/bigtable.admin.table - * https://www.googleapis.com/auth/bigtable.data - * https://www.googleapis.com/auth/devstorage.full_control - */ - serviceAccountScopes: string[]; - /** - * Optional. The Compute Engine subnetwork to be used for machine - * communications. Cannot be specified with network_uri.A full URL, partial - * URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 - * projects/[project_id]/regions/us-east1/sub0 sub0 - */ - subnetworkUri: string; - /** - * The Compute Engine tags to add to all instances (see Tagging instances). - */ - tags: string[]; - /** - * Optional. The zone where the Compute Engine cluster will be located. On a - * create request, it is required in the "global" region. If omitted - * in a non-global Cloud Dataproc region, the service will pick a zone in the - * corresponding Compute Engine region. On a get request, zone will always be - * present.A full URL, partial URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] - * projects/[project_id]/zones/[zone] us-central1-f - */ - zoneUri: string; -} -/** - * A Cloud Dataproc job for running Apache Hadoop MapReduce - * (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) - * jobs on Apache Hadoop YARN - * (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). - */ -export interface Schema$HadoopJob { - /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, - * or .zip. - */ - archiveUris: string[]; - /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as -libjars or -Dfoo=bar, that can be set as job properties, since a - * collision may occur that causes an incorrect job submission. - */ - args: string[]; - /** - * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to - * the working directory of Hadoop drivers and distributed tasks. Useful for - * naively parallel tasks. - */ - fileUris: string[]; - /** - * Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and - * tasks. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * The name of the driver's main class. The jar file containing the class - * must be in the default CLASSPATH or specified in jar_file_uris. - */ - mainClass: string; - /** - * The HCFS URI of the jar file containing the main class. Examples: - * 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' - * 'hdfs:/tmp/test-samples/custom-wordcount.jar' - * 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' - */ - mainJarFileUri: string; - /** - * Optional. A mapping of property names to values, used to configure Hadoop. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site and - * classes in user code. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) - * queries on YARN. - */ -export interface Schema$HiveJob { - /** - * Optional. Whether to continue executing queries if a query fails. The - * default value is false. Setting to true can be useful when executing - * independent parallel queries. - */ - continueOnFailure: boolean; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server - * and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. - */ - jarFileUris: string[]; - /** - * Optional. A mapping of property names and values, used to configure Hive. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, - * /etc/hive/conf/hive-site.xml, and classes in user code. - */ - properties: any; - /** - * The HCFS URI of the script that contains Hive queries. - */ - queryFileUri: string; - /** - * A list of queries. - */ - queryList: Schema$QueryList; - /** - * Optional. Mapping of query variable names to values (equivalent to the Hive - * command: SET name="value";). - */ - scriptVariables: any; -} -/** - * Optional. The config settings for Compute Engine resources in an instance - * group, such as a master or worker group. - */ -export interface Schema$InstanceGroupConfig { - /** - * Optional. The Compute Engine accelerator configuration for these - * instances.Beta Feature: This feature is still under development. It may be - * changed before final release. - */ - accelerators: Schema$AcceleratorConfig[]; - /** - * Optional. Disk option config settings. - */ - diskConfig: Schema$DiskConfig; - /** - * Output only. The Compute Engine image resource used for cluster instances. - * Inferred from SoftwareConfig.image_version. - */ - imageUri: string; - /** - * Optional. The list of instance names. Cloud Dataproc derives the names from - * cluster_name, num_instances, and the instance group if not set by user - * (recommended practice is to let Cloud Dataproc derive the name). - */ - instanceNames: string[]; - /** - * Optional. Specifies that this instance group contains preemptible - * instances. - */ - isPreemptible: boolean; - /** - * Optional. The Compute Engine machine type used for cluster instances.A full - * URL, partial URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - * n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc Auto - * Zone Placement feature, you must use the short name of the machine type - * resource, for example, n1-standard-2. - */ - machineTypeUri: string; - /** - * Output only. The config for Compute Engine Instance Group Manager that - * manages this group. This is only used for preemptible instance groups. - */ - managedGroupConfig: Schema$ManagedGroupConfig; - /** - * Optional. The number of VM instances in the instance group. For master - * instance groups, must be set to 1. - */ - numInstances: number; -} -/** - * A Cloud Dataproc job resource. - */ -export interface Schema$Job { - /** - * Output only. If present, the location of miscellaneous control files which - * may be used as part of job setup and handling. If not present, control - * files may be placed in the same location as driver_output_uri. - */ - driverControlFilesUri: string; - /** - * Output only. A URI pointing to the location of the stdout of the job's - * driver program. - */ - driverOutputResourceUri: string; - /** - * Job is a Hadoop job. - */ - hadoopJob: Schema$HadoopJob; - /** - * Job is a Hive job. - */ - hiveJob: Schema$HiveJob; - /** - * Optional. The labels to associate with this job. Label keys must contain 1 - * to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if - * present, must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - * associated with a job. - */ - labels: any; - /** - * Job is a Pig job. - */ - pigJob: Schema$PigJob; - /** - * Required. Job information, including how, when, and where to run the job. - */ - placement: Schema$JobPlacement; - /** - * Job is a Pyspark job. - */ - pysparkJob: Schema$PySparkJob; - /** - * Optional. The fully qualified reference to the job, which can be used to - * obtain the equivalent REST path of the job resource. If this property is - * not specified when a job is created, the server generates a - * <code>job_id</code>. - */ - reference: Schema$JobReference; - /** - * Optional. Job scheduling configuration. - */ - scheduling: Schema$JobScheduling; - /** - * Job is a Spark job. - */ - sparkJob: Schema$SparkJob; - /** - * Job is a SparkSql job. - */ - sparkSqlJob: Schema$SparkSqlJob; - /** - * Output only. The job status. Additional application-specific status - * information may be contained in the <code>type_job</code> and - * <code>yarn_applications</code> fields. - */ - status: Schema$JobStatus; - /** - * Output only. The previous job status. - */ - statusHistory: Schema$JobStatus[]; - /** - * Output only. The collection of YARN applications spun up by this job.Beta - * Feature: This report is available for testing purposes only. It may be - * changed before final release. - */ - yarnApplications: Schema$YarnApplication[]; -} -/** - * Cloud Dataproc job config. - */ -export interface Schema$JobPlacement { - /** - * Required. The name of the cluster where the job will be submitted. - */ - clusterName: string; - /** - * Output only. A cluster UUID generated by the Cloud Dataproc service when - * the job is submitted. - */ - clusterUuid: string; -} -/** - * Encapsulates the full scoping used to reference a job. - */ -export interface Schema$JobReference { - /** - * Optional. The job ID, which must be unique within the project. The job ID - * is generated by the server upon job submission or provided by the user as a - * means to perform retries without creating duplicate jobs. The ID must - * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens - * (-). The maximum length is 100 characters. - */ - jobId: string; - /** - * Required. The ID of the Google Cloud Platform project that the job belongs - * to. - */ - projectId: string; -} -/** - * Job scheduling options. - */ -export interface Schema$JobScheduling { - /** - * Optional. Maximum number of times per hour a driver may be restarted as a - * result of driver terminating with non-zero code before job is reported - * failed.A job may be reported as thrashing if driver exits with non-zero - * code 4 times within 10 minute window.Maximum value is 10. - */ - maxFailuresPerHour: number; -} -/** - * Cloud Dataproc job status. - */ -export interface Schema$JobStatus { - /** - * Output only. Optional job state details, such as an error description if - * the state is <code>ERROR</code>. - */ - details: string; - /** - * Output only. A state message specifying the overall job state. - */ - state: string; - /** - * Output only. The time when this state was entered. - */ - stateStartTime: string; - /** - * Output only. Additional state information, which includes status reported - * by the agent. - */ - substate: string; -} -/** - * The list of all clusters in a project. - */ -export interface Schema$ListClustersResponse { - /** - * Output only. The clusters in the project. - */ - clusters: Schema$Cluster[]; - /** - * Output only. This token is included in the response if there are more - * results to fetch. To fetch additional results, provide this value as the - * page_token in a subsequent ListClustersRequest. - */ - nextPageToken: string; -} -/** - * A list of jobs in a project. - */ -export interface Schema$ListJobsResponse { - /** - * Output only. Jobs list. - */ - jobs: Schema$Job[]; - /** - * Optional. This token is included in the response if there are more results - * to fetch. To fetch additional results, provide this value as the page_token - * in a subsequent <code>ListJobsRequest</code>. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * The runtime logging config of the job. - */ -export interface Schema$LoggingConfig { - /** - * The per-package log levels for the driver. This may include - * "root" package name to configure rootLogger. Examples: - * 'com.google = FATAL', 'root = INFO', 'org.apache = - * DEBUG' - */ - driverLogLevels: any; -} -/** - * Specifies the resources used to actively manage an instance group. - */ -export interface Schema$ManagedGroupConfig { - /** - * Output only. The name of the Instance Group Manager for this group. - */ - instanceGroupManagerName: string; - /** - * Output only. The name of the Instance Template used for the Managed - * Instance Group. - */ - instanceTemplateName: string; -} -/** - * Specifies an executable to run on a fully configured node and a timeout - * period for executable completion. - */ -export interface Schema$NodeInitializationAction { - /** - * Required. Cloud Storage URI of executable file. - */ - executableFile: string; - /** - * Optional. Amount of time executable has to complete. Default is 10 minutes. - * Cluster creation fails with an explanatory error message (the name of the - * executable that caused the error and the exceeded timeout period) if the - * executable is not completed at end of the timeout period. - */ - executionTimeout: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries - * on YARN. - */ -export interface Schema$PigJob { - /** - * Optional. Whether to continue executing queries if a query fails. The - * default value is false. Setting to true can be useful when executing - * independent parallel queries. - */ - continueOnFailure: boolean; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client - * and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * Optional. A mapping of property names to values, used to configure Pig. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, - * /etc/pig/conf/pig.properties, and classes in user code. - */ - properties: any; - /** - * The HCFS URI of the script that contains the Pig queries. - */ - queryFileUri: string; - /** - * A list of queries. - */ - queryList: Schema$QueryList; - /** - * Optional. Mapping of query variable names to values (equivalent to the Pig - * command: name=[value]). - */ - scriptVariables: any; -} -/** - * A Cloud Dataproc job for running Apache PySpark - * (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) - * applications on YARN. - */ -export interface Schema$PySparkJob { - /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * .jar, .tar, .tar.gz, .tgz, and .zip. - */ - archiveUris: string[]; - /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as --conf, that can be set as job properties, since a collision may - * occur that causes an incorrect job submission. - */ - args: string[]; - /** - * Optional. HCFS URIs of files to be copied to the working directory of - * Python drivers and distributed tasks. Useful for naively parallel tasks. - */ - fileUris: string[]; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python - * driver and tasks. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * Required. The HCFS URI of the main Python file to use as the driver. Must - * be a .py file. - */ - mainPythonFileUri: string; - /** - * Optional. A mapping of property names to values, used to configure PySpark. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in - * /etc/spark/conf/spark-defaults.conf and classes in user code. - */ - properties: any; - /** - * Optional. HCFS file URIs of Python files to pass to the PySpark framework. - * Supported file types: .py, .egg, and .zip. - */ - pythonFileUris: string[]; -} -/** - * A list of queries to run on a cluster. - */ -export interface Schema$QueryList { - /** - * Required. The queries to execute. You do not need to terminate a query with - * a semicolon. Multiple queries can be specified in one string by separating - * each with a semicolon. Here is an example of an Cloud Dataproc API snippet - * that uses a QueryList to specify a HiveJob: "hiveJob": { - * "queryList": { "queries": [ "query1", - * "query2", "query3;query4", ] } } - */ - queries: string[]; -} -/** - * Specifies the selection and config of software inside the cluster. - */ -export interface Schema$SoftwareConfig { + export interface Schema$ClusterMetrics { + /** + * The HDFS metrics. + */ + hdfsMetrics: any; + /** + * The YARN metrics. + */ + yarnMetrics: any; + } /** - * Optional. The version of software inside the cluster. It must be one of the - * supported Cloud Dataproc Versions, such as "1.2" (including a - * subminor version, such as "1.2.29"), or the "preview" - * version. If unspecified, it defaults to the latest version. - */ - imageVersion: string; + * Metadata describing the operation. + */ + export interface Schema$ClusterOperationMetadata { + /** + * Output only. Name of the cluster for the operation. + */ + clusterName: string; + /** + * Output only. Cluster UUID for the operation. + */ + clusterUuid: string; + /** + * Output only. Short description of operation. + */ + description: string; + /** + * Output only. Labels associated with the operation + */ + labels: any; + /** + * Output only. The operation type. + */ + operationType: string; + /** + * Output only. Current operation status. + */ + status: Schema$ClusterOperationStatus; + /** + * Output only. The previous operation status. + */ + statusHistory: Schema$ClusterOperationStatus[]; + /** + * Output only. Errors encountered during operation execution. + */ + warnings: string[]; + } /** - * Optional. The properties to set on daemon config files.Property keys are - * specified in prefix:property format, such as core:fs.defaultFS. The - * following are supported prefixes and their mappings: capacity-scheduler: - * capacity-scheduler.xml core: core-site.xml distcp: distcp-default.xml hdfs: - * hdfs-site.xml hive: hive-site.xml mapred: mapred-site.xml pig: - * pig.properties spark: spark-defaults.conf yarn: yarn-site.xmlFor more - * information, see Cluster properties. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) - * applications on YARN. - */ -export interface Schema$SparkJob { + * The status of the operation. + */ + export interface Schema$ClusterOperationStatus { + /** + * Output only. A message containing any operation metadata details. + */ + details: string; + /** + * Output only. A message containing the detailed operation state. + */ + innerState: string; + /** + * Output only. A message containing the operation state. + */ + state: string; + /** + * Output only. The time this state was entered. + */ + stateStartTime: string; + } /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, - * and .zip. - */ - archiveUris: string[]; + * The status of a cluster and its instances. + */ + export interface Schema$ClusterStatus { + /** + * Output only. Optional details of cluster's state. + */ + detail: string; + /** + * Output only. The cluster's state. + */ + state: string; + /** + * Output only. Time when this state was entered. + */ + stateStartTime: string; + /** + * Output only. Additional state information that includes status reported + * by the agent. + */ + substate: string; + } /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as --conf, that can be set as job properties, since a collision may - * occur that causes an incorrect job submission. + * A request to collect cluster diagnostic information. */ - args: string[]; + export interface Schema$DiagnoseClusterRequest {} /** - * Optional. HCFS URIs of files to be copied to the working directory of Spark - * drivers and distributed tasks. Useful for naively parallel tasks. + * The location of diagnostic output. */ - fileUris: string[]; + export interface Schema$DiagnoseClusterResults { + /** + * Output only. The Cloud Storage URI of the diagnostic output. The output + * report is a plain text file with a summary of collected diagnostics. + */ + outputUri: string; + } /** - * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark - * driver and tasks. - */ - jarFileUris: string[]; + * Specifies the config of disk options for a group of VM instances. + */ + export interface Schema$DiskConfig { + /** + * Optional. Size in GB of the boot disk (default is 500GB). + */ + bootDiskSizeGb: number; + /** + * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs + * are not attached, the boot disk is used to store runtime logs and HDFS + * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one + * or more SSDs are attached, this runtime bulk data is spread across them, + * and the boot disk contains only basic config and installed binaries. + */ + numLocalSsds: number; + } /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Common config settings for resources of Compute Engine cluster instances, + * applicable to all instances in the cluster. + */ + export interface Schema$GceClusterConfig { + /** + * Optional. If true, all instances in the cluster will only have internal + * IP addresses. By default, clusters are not restricted to internal IP + * addresses, and will have ephemeral external IP addresses assigned to each + * instance. This internal_ip_only restriction can only be enabled for + * subnetwork enabled networks, and all off-cluster dependencies must be + * configured to be accessible without external IP addresses. + */ + internalIpOnly: boolean; + /** + * The Compute Engine metadata entries to add to all instances (see Project + * and instance metadata + * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + */ + metadata: any; + /** + * Optional. The Compute Engine network to be used for machine + * communications. Cannot be specified with subnetwork_uri. If neither + * network_uri nor subnetwork_uri is specified, the "default" + * network of the project is used, if it exists. Cannot be a "Custom + * Subnet Network" (see Using Subnetworks for more information).A full + * URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default + * projects/[project_id]/regions/global/default default + */ + networkUri: string; + /** + * Optional. The service account of the instances. Defaults to the default + * Compute Engine service account. Custom service accounts need permissions + * equivalent to the following IAM roles: roles/logging.logWriter + * roles/storage.objectAdmin(see + * https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts + * for more information). Example: + * [account_id]@[project_id].iam.gserviceaccount.com + */ + serviceAccount: string; + /** + * Optional. The URIs of service account scopes to be included in Compute + * Engine instances. The following base set of scopes is always included: + * https://www.googleapis.com/auth/cloud.useraccounts.readonly + * https://www.googleapis.com/auth/devstorage.read_write + * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, + * the following defaults are also provided: + * https://www.googleapis.com/auth/bigquery + * https://www.googleapis.com/auth/bigtable.admin.table + * https://www.googleapis.com/auth/bigtable.data + * https://www.googleapis.com/auth/devstorage.full_control + */ + serviceAccountScopes: string[]; + /** + * Optional. The Compute Engine subnetwork to be used for machine + * communications. Cannot be specified with network_uri.A full URL, partial + * URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 + * projects/[project_id]/regions/us-east1/sub0 sub0 + */ + subnetworkUri: string; + /** + * The Compute Engine tags to add to all instances (see Tagging instances). + */ + tags: string[]; + /** + * Optional. The zone where the Compute Engine cluster will be located. On a + * create request, it is required in the "global" region. If + * omitted in a non-global Cloud Dataproc region, the service will pick a + * zone in the corresponding Compute Engine region. On a get request, zone + * will always be present.A full URL, partial URI, or short name are valid. + * Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] + * projects/[project_id]/zones/[zone] us-central1-f + */ + zoneUri: string; + } /** - * The name of the driver's main class. The jar file that contains the - * class must be in the default CLASSPATH or specified in jar_file_uris. - */ - mainClass: string; + * A Cloud Dataproc job for running Apache Hadoop MapReduce + * (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) + * jobs on Apache Hadoop YARN + * (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). + */ + export interface Schema$HadoopJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, + * .tgz, or .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as -libjars or -Dfoo=bar, that can be set as job properties, since a + * collision may occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied + * to the working directory of Hadoop drivers and distributed tasks. Useful + * for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and + * tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * The name of the driver's main class. The jar file containing the + * class must be in the default CLASSPATH or specified in jar_file_uris. + */ + mainClass: string; + /** + * The HCFS URI of the jar file containing the main class. Examples: + * 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + * 'hdfs:/tmp/test-samples/custom-wordcount.jar' + * 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + */ + mainJarFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure + * Hadoop. Properties that conflict with values set by the Cloud Dataproc + * API may be overwritten. Can include properties set in + * /etc/hadoop/conf/*-site and classes in user code. + */ + properties: any; + } /** - * The HCFS URI of the jar file that contains the main class. - */ - mainJarFileUri: string; + * A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) + * queries on YARN. + */ + export interface Schema$HiveJob { + /** + * Optional. Whether to continue executing queries if a query fails. The + * default value is false. Setting to true can be useful when executing + * independent parallel queries. + */ + continueOnFailure: boolean; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive + * server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. + */ + jarFileUris: string[]; + /** + * Optional. A mapping of property names and values, used to configure Hive. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + * /etc/hive/conf/hive-site.xml, and classes in user code. + */ + properties: any; + /** + * The HCFS URI of the script that contains Hive queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Hive command: SET name="value";). + */ + scriptVariables: any; + } /** - * Optional. A mapping of property names to values, used to configure Spark. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in - * /etc/spark/conf/spark-defaults.conf and classes in user code. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Spark SQL - * (http://spark.apache.org/sql/) queries. - */ -export interface Schema$SparkSqlJob { + * Optional. The config settings for Compute Engine resources in an instance + * group, such as a master or worker group. + */ + export interface Schema$InstanceGroupConfig { + /** + * Optional. The Compute Engine accelerator configuration for these + * instances.Beta Feature: This feature is still under development. It may + * be changed before final release. + */ + accelerators: Schema$AcceleratorConfig[]; + /** + * Optional. Disk option config settings. + */ + diskConfig: Schema$DiskConfig; + /** + * Output only. The Compute Engine image resource used for cluster + * instances. Inferred from SoftwareConfig.image_version. + */ + imageUri: string; + /** + * Optional. The list of instance names. Cloud Dataproc derives the names + * from cluster_name, num_instances, and the instance group if not set by + * user (recommended practice is to let Cloud Dataproc derive the name). + */ + instanceNames: string[]; + /** + * Optional. Specifies that this instance group contains preemptible + * instances. + */ + isPreemptible: boolean; + /** + * Optional. The Compute Engine machine type used for cluster instances.A + * full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc + * Auto Zone Placement feature, you must use the short name of the machine + * type resource, for example, n1-standard-2. + */ + machineTypeUri: string; + /** + * Output only. The config for Compute Engine Instance Group Manager that + * manages this group. This is only used for preemptible instance groups. + */ + managedGroupConfig: Schema$ManagedGroupConfig; + /** + * Optional. The number of VM instances in the instance group. For master + * instance groups, must be set to 1. + */ + numInstances: number; + } /** - * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - */ - jarFileUris: string[]; + * A Cloud Dataproc job resource. + */ + export interface Schema$Job { + /** + * Output only. If present, the location of miscellaneous control files + * which may be used as part of job setup and handling. If not present, + * control files may be placed in the same location as driver_output_uri. + */ + driverControlFilesUri: string; + /** + * Output only. A URI pointing to the location of the stdout of the + * job's driver program. + */ + driverOutputResourceUri: string; + /** + * Job is a Hadoop job. + */ + hadoopJob: Schema$HadoopJob; + /** + * Job is a Hive job. + */ + hiveJob: Schema$HiveJob; + /** + * Optional. The labels to associate with this job. Label keys must contain + * 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, + * if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + * associated with a job. + */ + labels: any; + /** + * Job is a Pig job. + */ + pigJob: Schema$PigJob; + /** + * Required. Job information, including how, when, and where to run the job. + */ + placement: Schema$JobPlacement; + /** + * Job is a Pyspark job. + */ + pysparkJob: Schema$PySparkJob; + /** + * Optional. The fully qualified reference to the job, which can be used to + * obtain the equivalent REST path of the job resource. If this property is + * not specified when a job is created, the server generates a + * <code>job_id</code>. + */ + reference: Schema$JobReference; + /** + * Optional. Job scheduling configuration. + */ + scheduling: Schema$JobScheduling; + /** + * Job is a Spark job. + */ + sparkJob: Schema$SparkJob; + /** + * Job is a SparkSql job. + */ + sparkSqlJob: Schema$SparkSqlJob; + /** + * Output only. The job status. Additional application-specific status + * information may be contained in the <code>type_job</code> and + * <code>yarn_applications</code> fields. + */ + status: Schema$JobStatus; + /** + * Output only. The previous job status. + */ + statusHistory: Schema$JobStatus[]; + /** + * Output only. The collection of YARN applications spun up by this job.Beta + * Feature: This report is available for testing purposes only. It may be + * changed before final release. + */ + yarnApplications: Schema$YarnApplication[]; + } /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; + * Cloud Dataproc job config. + */ + export interface Schema$JobPlacement { + /** + * Required. The name of the cluster where the job will be submitted. + */ + clusterName: string; + /** + * Output only. A cluster UUID generated by the Cloud Dataproc service when + * the job is submitted. + */ + clusterUuid: string; + } /** - * Optional. A mapping of property names to values, used to configure Spark - * SQL's SparkConf. Properties that conflict with values set by the Cloud - * Dataproc API may be overwritten. - */ - properties: any; + * Encapsulates the full scoping used to reference a job. + */ + export interface Schema$JobReference { + /** + * Optional. The job ID, which must be unique within the project. The job ID + * is generated by the server upon job submission or provided by the user as + * a means to perform retries without creating duplicate jobs. The ID must + * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or + * hyphens (-). The maximum length is 100 characters. + */ + jobId: string; + /** + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + */ + projectId: string; + } /** - * The HCFS URI of the script that contains SQL queries. + * Job scheduling options. */ - queryFileUri: string; + export interface Schema$JobScheduling { + /** + * Optional. Maximum number of times per hour a driver may be restarted as a + * result of driver terminating with non-zero code before job is reported + * failed.A job may be reported as thrashing if driver exits with non-zero + * code 4 times within 10 minute window.Maximum value is 10. + */ + maxFailuresPerHour: number; + } /** - * A list of queries. - */ - queryList: Schema$QueryList; + * Cloud Dataproc job status. + */ + export interface Schema$JobStatus { + /** + * Output only. Optional job state details, such as an error description if + * the state is <code>ERROR</code>. + */ + details: string; + /** + * Output only. A state message specifying the overall job state. + */ + state: string; + /** + * Output only. The time when this state was entered. + */ + stateStartTime: string; + /** + * Output only. Additional state information, which includes status reported + * by the agent. + */ + substate: string; + } /** - * Optional. Mapping of query variable names to values (equivalent to the - * Spark SQL command: SET name="value";). - */ - scriptVariables: any; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { + * The list of all clusters in a project. + */ + export interface Schema$ListClustersResponse { + /** + * Output only. The clusters in the project. + */ + clusters: Schema$Cluster[]; + /** + * Output only. This token is included in the response if there are more + * results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent ListClustersRequest. + */ + nextPageToken: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A list of jobs in a project. + */ + export interface Schema$ListJobsResponse { + /** + * Output only. Jobs list. + */ + jobs: Schema$Job[]; + /** + * Optional. This token is included in the response if there are more + * results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent <code>ListJobsRequest</code>. + */ + nextPageToken: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * The runtime logging config of the job. */ - message: string; -} -/** - * A request to submit a job. - */ -export interface Schema$SubmitJobRequest { + export interface Schema$LoggingConfig { + /** + * The per-package log levels for the driver. This may include + * "root" package name to configure rootLogger. Examples: + * 'com.google = FATAL', 'root = INFO', 'org.apache = + * DEBUG' + */ + driverLogLevels: any; + } /** - * Required. The job resource. - */ - job: Schema$Job; + * Specifies the resources used to actively manage an instance group. + */ + export interface Schema$ManagedGroupConfig { + /** + * Output only. The name of the Instance Group Manager for this group. + */ + instanceGroupManagerName: string; + /** + * Output only. The name of the Instance Template used for the Managed + * Instance Group. + */ + instanceTemplateName: string; + } /** - * Optional. A unique id used to identify the request. If the server receives - * two SubmitJobRequest requests with the same id, then the second request - * will be ignored and the first Job created and stored in the backend is - * returned.It is recommended to always set this value to a UUID - * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must - * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and - * hyphens (-). The maximum length is 40 characters. - */ - requestId: string; -} -/** - * A YARN application created by a job. Application information is a subset of - * <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.Beta - * Feature: This report is available for testing purposes only. It may be - * changed before final release. - */ -export interface Schema$YarnApplication { + * Specifies an executable to run on a fully configured node and a timeout + * period for executable completion. + */ + export interface Schema$NodeInitializationAction { + /** + * Required. Cloud Storage URI of executable file. + */ + executableFile: string; + /** + * Optional. Amount of time executable has to complete. Default is 10 + * minutes. Cluster creation fails with an explanatory error message (the + * name of the executable that caused the error and the exceeded timeout + * period) if the executable is not completed at end of the timeout period. + */ + executionTimeout: string; + } /** - * Required. The application name. - */ - name: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; + } /** - * Required. The numerical progress of the application, from 1 to 100. - */ - progress: number; + * A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) + * queries on YARN. + */ + export interface Schema$PigJob { + /** + * Optional. Whether to continue executing queries if a query fails. The + * default value is false. Setting to true can be useful when executing + * independent parallel queries. + */ + continueOnFailure: boolean; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig + * Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Pig. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + * /etc/pig/conf/pig.properties, and classes in user code. + */ + properties: any; + /** + * The HCFS URI of the script that contains the Pig queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Pig command: name=[value]). + */ + scriptVariables: any; + } /** - * Required. The application state. - */ - state: string; + * A Cloud Dataproc job for running Apache PySpark + * (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) + * applications on YARN. + */ + export interface Schema$PySparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of .jar, .tar, .tar.gz, .tgz, and .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as --conf, that can be set as job properties, since a collision may + * occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS URIs of files to be copied to the working directory of + * Python drivers and distributed tasks. Useful for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python + * driver and tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Required. The HCFS URI of the main Python file to use as the driver. Must + * be a .py file. + */ + mainPythonFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure + * PySpark. Properties that conflict with values set by the Cloud Dataproc + * API may be overwritten. Can include properties set in + * /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties: any; + /** + * Optional. HCFS file URIs of Python files to pass to the PySpark + * framework. Supported file types: .py, .egg, and .zip. + */ + pythonFileUris: string[]; + } /** - * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or - * TimelineServer that provides application-specific information. The URL uses - * the internal hostname, and requires a proxy server for resolution and, - * possibly, access. - */ - trackingUrl: string; -} - -export class Resource$Projects { - root: Dataproc; - regions: Resource$Projects$Regions; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - this.regions = new Resource$Projects$Regions(root); + * A list of queries to run on a cluster. + */ + export interface Schema$QueryList { + /** + * Required. The queries to execute. You do not need to terminate a query + * with a semicolon. Multiple queries can be specified in one string by + * separating each with a semicolon. Here is an example of an Cloud Dataproc + * API snippet that uses a QueryList to specify a HiveJob: + * "hiveJob": { "queryList": { "queries": [ + * "query1", "query2", "query3;query4", + * ] } } + */ + queries: string[]; } - - getRoot() { - return this.root; + /** + * Specifies the selection and config of software inside the cluster. + */ + export interface Schema$SoftwareConfig { + /** + * Optional. The version of software inside the cluster. It must be one of + * the supported Cloud Dataproc Versions, such as "1.2" (including + * a subminor version, such as "1.2.29"), or the + * "preview" version. If unspecified, it defaults to the latest + * version. + */ + imageVersion: string; + /** + * Optional. The properties to set on daemon config files.Property keys are + * specified in prefix:property format, such as core:fs.defaultFS. The + * following are supported prefixes and their mappings: capacity-scheduler: + * capacity-scheduler.xml core: core-site.xml distcp: distcp-default.xml + * hdfs: hdfs-site.xml hive: hive-site.xml mapred: mapred-site.xml pig: + * pig.properties spark: spark-defaults.conf yarn: yarn-site.xmlFor more + * information, see Cluster properties. + */ + properties: any; } -} -export class Resource$Projects$Regions { - root: Dataproc; - clusters: Resource$Projects$Regions$Clusters; - jobs: Resource$Projects$Regions$Jobs; - operations: Resource$Projects$Regions$Operations; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Regions$Clusters(root); - this.jobs = new Resource$Projects$Regions$Jobs(root); - this.operations = new Resource$Projects$Regions$Operations(root); + /** + * A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) + * applications on YARN. + */ + export interface Schema$SparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, + * .tgz, and .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as --conf, that can be set as job properties, since a collision may + * occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS URIs of files to be copied to the working directory of + * Spark drivers and distributed tasks. Useful for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark + * driver and tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * The name of the driver's main class. The jar file that contains the + * class must be in the default CLASSPATH or specified in jar_file_uris. + */ + mainClass: string; + /** + * The HCFS URI of the jar file that contains the main class. + */ + mainJarFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure Spark. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in + * /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties: any; } - - getRoot() { - return this.root; + /** + * A Cloud Dataproc job for running Apache Spark SQL + * (http://spark.apache.org/sql/) queries. + */ + export interface Schema$SparkSqlJob { + /** + * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Spark + * SQL's SparkConf. Properties that conflict with values set by the + * Cloud Dataproc API may be overwritten. + */ + properties: any; + /** + * The HCFS URI of the script that contains SQL queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Spark SQL command: SET name="value";). + */ + scriptVariables: any; } -} -export class Resource$Projects$Regions$Clusters { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); + /** + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - getRoot() { - return this.root; + /** + * A request to submit a job. + */ + export interface Schema$SubmitJobRequest { + /** + * Required. The job resource. + */ + job: Schema$Job; + /** + * Optional. A unique id used to identify the request. If the server + * receives two SubmitJobRequest requests with the same id, then the second + * request will be ignored and the first Job created and stored in the + * backend is returned.It is recommended to always set this value to a UUID + * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must + * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + * hyphens (-). The maximum length is 40 characters. + */ + requestId: string; } - - /** - * dataproc.projects.regions.clusters.create - * @desc Creates a cluster in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the - * cluster belongs to. projectId: 'my-project-id', // TODO: Update - * placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.create(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {().Cluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A YARN application created by a job. Application information is a subset of + * <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.Beta + * Feature: This report is available for testing purposes only. It may be + * changed before final release. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{projectId}/regions/{region}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$YarnApplication { + /** + * Required. The application name. + */ + name: string; + /** + * Required. The numerical progress of the application, from 1 to 100. + */ + progress: number; + /** + * Required. The application state. + */ + state: string; + /** + * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or + * TimelineServer that provides application-specific information. The URL + * uses the internal hostname, and requires a proxy server for resolution + * and, possibly, access. + */ + trackingUrl: string; } - - /** - * dataproc.projects.regions.clusters.delete - * @desc Deletes a cluster in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the - * cluster belongs to. projectId: 'my-project-id', // TODO: Update - * placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.delete(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string=} params.clusterUuid Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Dataproc; + regions: Resource$Projects$Regions; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); + this.regions = new Resource$Projects$Regions(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } + export class Resource$Projects$Regions { + root: Dataproc; + clusters: Resource$Projects$Regions$Clusters; + jobs: Resource$Projects$Regions$Jobs; + operations: Resource$Projects$Regions$Operations; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Regions$Clusters(root); + this.jobs = new Resource$Projects$Regions$Jobs(root); + this.operations = new Resource$Projects$Regions$Operations(root); + } - - /** - * dataproc.projects.regions.clusters.diagnose - * @desc Gets cluster diagnostic information. After the operation completes, - * the Operation.response field contains DiagnoseClusterOutputLocation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the - * cluster belongs to. projectId: 'my-project-id', // TODO: Update - * placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.diagnose(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.diagnose - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().DiagnoseClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - diagnose(params?: any, options?: MethodOptions): - AxiosPromise; - diagnose( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - diagnose( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Regions$Clusters { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataproc.projects.regions.clusters.get - * @desc Gets the resource representation for a cluster in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the - * cluster belongs to. projectId: 'my-project-id', // TODO: Update - * placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.create + * @desc Creates a cluster in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the + * cluster belongs to. projectId: 'my-project-id', // TODO: Update + * placeholder value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.clusters.create(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {().Cluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.list - * @desc Lists all regions/{region}/clusters in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the - * cluster belongs to. projectId: 'my-project-id', // TODO: Update - * placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var clustersPage = response['clusters']; - * if (!clustersPage) { - * return; - * } - * for (var i = 0; i < clustersPage.length; i++) { - * // TODO: Change code below to process each resource in - * `clustersPage`: console.log(JSON.stringify(clustersPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.clusters.list(request, handlePage); - * } - * }; - * - * dataproc.projects.regions.clusters.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * - * @param {integer=} params.pageSize Optional. The standard List page size. - * @param {string=} params.pageToken Optional. The standard List page token. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.delete + * @desc Deletes a cluster in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the + * cluster belongs to. projectId: 'my-project-id', // TODO: Update + * placeholder value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The cluster name. + * clusterName: 'my-cluster-name', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.clusters.delete(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string=} params.clusterUuid Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{projectId}/regions/{region}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.patch - * @desc Updates a cluster in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project the cluster - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The cluster name. - * clusterName: 'my-cluster-name', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.clusters.patch(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.clusters.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string=} params.gracefulDecommissionTimeout Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day.Only supported on Dataproc image versions 1.2 and higher. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {string=} params.updateMask Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } Note: Currently, only the following fields can be updated:
Mask Purpose
labels Update labels
config.worker_config.num_instances Resize primary worker group
config.secondary_worker_config.num_instances Resize secondary worker group
- * @param {().Cluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.diagnose + * @desc Gets cluster diagnostic information. After the operation completes, + * the Operation.response field contains DiagnoseClusterOutputLocation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the + * cluster belongs to. projectId: 'my-project-id', // TODO: Update + * placeholder value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The cluster name. + * clusterName: 'my-cluster-name', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.clusters.diagnose(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.diagnose + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().DiagnoseClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + diagnose(params?: any, options?: MethodOptions): + AxiosPromise; + diagnose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + diagnose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Regions$Jobs { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataproc.projects.regions.clusters.get + * @desc Gets the resource representation for a cluster in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the + * cluster belongs to. projectId: 'my-project-id', // TODO: Update + * placeholder value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The cluster name. + * clusterName: 'my-cluster-name', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.clusters.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataproc.projects.regions.jobs.cancel - * @desc Starts a job cancellation request. To access the job resource after - * cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.cancel(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().CancelJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.list + * @desc Lists all regions/{region}/clusters in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the + * cluster belongs to. projectId: 'my-project-id', // TODO: Update + * placeholder value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var clustersPage = response['clusters']; + * if (!clustersPage) { + * return; + * } + * for (var i = 0; i < clustersPage.length; i++) { + * // TODO: Change code below to process each resource in + * `clustersPage`: console.log(JSON.stringify(clustersPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dataproc.projects.regions.clusters.list(request, handlePage); + * } + * }; + * + * dataproc.projects.regions.clusters.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * + * @param {integer=} params.pageSize Optional. The standard List page size. + * @param {string=} params.pageToken Optional. The standard List page token. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.delete - * @desc Deletes the job from the project. If the job is active, the delete - * fails, and the response returns FAILED_PRECONDITION. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataproc.projects.regions.clusters.patch + * @desc Updates a cluster in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project the cluster + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The cluster name. + * clusterName: 'my-cluster-name', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.clusters.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.clusters.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string=} params.gracefulDecommissionTimeout Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day.Only supported on Dataproc image versions 1.2 and higher. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {string=} params.updateMask Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } Note: Currently, only the following fields can be updated:
Mask Purpose
labels Update labels
config.worker_config.num_instances Resize primary worker group
config.secondary_worker_config.num_instances Resize secondary worker group
+ * @param {().Cluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataproc.projects.regions.jobs.get - * @desc Gets the resource representation for a job in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Regions$Jobs { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataproc.projects.regions.jobs.list - * @desc Lists regions/{region}/jobs in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var jobsPage = response['jobs']; - * if (!jobsPage) { - * return; - * } - * for (var i = 0; i < jobsPage.length; i++) { - * // TODO: Change code below to process each resource in `jobsPage`: - * console.log(JSON.stringify(jobsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.jobs.list(request, handlePage); - * } - * }; - * - * dataproc.projects.regions.jobs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterName Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. - * @param {string=} params.filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * - * @param {string=} params.jobStateMatcher Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. - * @param {integer=} params.pageSize Optional. The number of results to return in each response. - * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.jobs.cancel + * @desc Starts a job cancellation request. To access the job resource after + * cancellation, call regions/{region}/jobs.list or + * regions/{region}/jobs.get. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The job ID. + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.jobs.cancel(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().CancelJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/regions/{region}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.patch - * @desc Updates a job in a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * // Required. The job ID. - * jobId: 'my-job-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.updateMask Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.jobs.delete + * @desc Deletes the job from the project. If the job is active, the delete + * fails, and the response returns FAILED_PRECONDITION. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The job ID. + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.jobs.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.submit - * @desc Submits a job to a cluster. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the Google Cloud Platform project that the job - * belongs to. projectId: 'my-project-id', // TODO: Update placeholder value. - * - * // Required. The Cloud Dataproc region in which to handle the request. - * region: 'my-region', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.jobs.submit(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.jobs.submit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().SubmitJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submit(params?: any, options?: MethodOptions): AxiosPromise; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.get + * @desc Gets the resource representation for a job in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The job ID. + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.jobs.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/regions/{region}/jobs:submit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Regions$Operations { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataproc.projects.regions.jobs.list + * @desc Lists regions/{region}/jobs in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var jobsPage = response['jobs']; + * if (!jobsPage) { + * return; + * } + * for (var i = 0; i < jobsPage.length; i++) { + * // TODO: Change code below to process each resource in `jobsPage`: + * console.log(JSON.stringify(jobsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dataproc.projects.regions.jobs.list(request, handlePage); + * } + * }; + * + * dataproc.projects.regions.jobs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterName Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. + * @param {string=} params.filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * @param {string=} params.jobStateMatcher Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. + * @param {integer=} params.pageSize Optional. The number of results to return in each response. + * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/regions/{region}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataproc.projects.regions.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * Code.CANCELLED. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'projects/my-project/regions/my-region/operations/my-operation', - * // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.patch + * @desc Updates a job in a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * // Required. The job ID. + * jobId: 'my-job-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.jobs.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.updateMask Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be deleted. - * name: 'projects/my-project/regions/my-region/operations/my-operation', - * // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataproc.projects.regions.jobs.submit + * @desc Submits a job to a cluster. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the Google Cloud Platform project that the job + * belongs to. projectId: 'my-project-id', // TODO: Update placeholder + * value. + * + * // Required. The Cloud Dataproc region in which to handle the + * request. region: 'my-region', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.jobs.submit(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.jobs.submit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().SubmitJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submit(params?: any, options?: MethodOptions): AxiosPromise; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/regions/{region}/jobs:submit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataproc.projects.regions.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'projects/my-project/regions/my-region/operations/my-operation', - * // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dataproc.projects.regions.operations.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Regions$Operations { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, the + * operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to Code.CANCELLED. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be cancelled. + * name: + * 'projects/my-project/regions/my-region/operations/my-operation', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.operations.cancel(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Dataproc API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dataproc - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dataproc = google.dataproc('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'projects/my-project/regions/my-region/operations', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dataproc.projects.regions.operations.list(request, handlePage); - * } - * }; - * - * dataproc.projects.regions.operations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dataproc.projects.regions.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns google.rpc.Code.UNIMPLEMENTED. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be deleted. + * name: + * 'projects/my-project/regions/my-region/operations/my-operation', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.operations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource. + * name: + * 'projects/my-project/regions/my-region/operations/my-operation', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dataproc.projects.regions.operations.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Dataproc API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dataproc + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dataproc = google.dataproc('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation's parent resource. + * name: 'projects/my-project/regions/my-region/operations', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dataproc.projects.regions.operations.list(request, handlePage); + * } + * }; + * + * dataproc.projects.regions.operations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dataproc.projects.regions.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dataproc/v1beta2.ts b/src/apis/dataproc/v1beta2.ts index 8579a9d85c7..59f807e54a8 100644 --- a/src/apis/dataproc/v1beta2.ts +++ b/src/apis/dataproc/v1beta2.ts @@ -27,4183 +27,4251 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Dataproc API - * - * Manages Hadoop-based clusters and jobs on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const dataproc = google.dataproc('v1beta2'); - * - * @namespace dataproc - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Dataproc - */ -export class Dataproc { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Specifies the type and number of accelerator cards attached to the instances - * of an instance group (see GPUs on Compute Engine). - */ -export interface Schema$AcceleratorConfig { - /** - * The number of the accelerator cards of this type exposed to this instance. - */ - acceleratorCount: number; - /** - * Full URL, partial URI, or short name of the accelerator type resource to - * expose to this instance. See Compute Engine AcceleratorTypes( - * /compute/docs/reference/beta/acceleratorTypes)Examples * - * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - * * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 - * * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc - * Auto Zone Placement feature, you must use the short name of the accelerator - * type resource, for example, nvidia-tesla-k80. - */ - acceleratorTypeUri: string; -} -/** - * Associates members with a role. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * members can have the following values: allUsers: A special identifier that - * represents anyone who is on the internet; with or without a Google - * account. allAuthenticatedUsers: A special identifier that represents anyone - * who is authenticated with a Google account or a service account. - * user:{emailid}: An email address that represents a specific Google account. - * For example, alice@gmail.com or joe@example.com. serviceAccount:{emailid}: - * An email address that represents a service account. For example, - * my-other-app@appspot.gserviceaccount.com. group:{emailid}: An email address - * that represents a Google group. For example, admins@example.com. - * domain:{domain}: A Google Apps domain name that represents all the users - * of that domain. For example, google.com or example.com. - */ - members: string[]; - /** - * Role that is assigned to members. For example, roles/viewer, roles/editor, - * or roles/owner. Required - */ - role: string; -} -/** - * A request to cancel a job. - */ -export interface Schema$CancelJobRequest {} -/** - * Describes the identifying information, config, and status of a cluster of - * Compute Engine instances. - */ -export interface Schema$Cluster { - /** - * Required. The cluster name. Cluster names within a project must be unique. - * Names of deleted clusters can be reused. - */ - clusterName: string; - /** - * Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc - * generates this value when it creates the cluster. - */ - clusterUuid: string; - /** - * Required. The cluster config. Note that Cloud Dataproc may set default - * values, and values may change when clusters are updated. - */ - config: Schema$ClusterConfig; - /** - * Optional. The labels to associate with this cluster. Label keys must - * contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if - * present, must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - * associated with a cluster. - */ - labels: any; - /** - * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: - * This report is available for testing purposes only. It may be changed - * before final release. - */ - metrics: Schema$ClusterMetrics; - /** - * Required. The Google Cloud Platform project ID that the cluster belongs to. - */ - projectId: string; - /** - * Output only. Cluster status. - */ - status: Schema$ClusterStatus; - /** - * Output only. The previous cluster status. - */ - statusHistory: Schema$ClusterStatus[]; -} -/** - * The cluster config. - */ -export interface Schema$ClusterConfig { - /** - * Optional. A Cloud Storage staging bucket used for sharing generated SSH - * keys and config. If you do not specify a staging bucket, Cloud Dataproc - * will determine an appropriate Cloud Storage location (US, ASIA, or EU) for - * your cluster's staging bucket according to the Google Compute Engine - * zone where your cluster is deployed, and then it will create and manage - * this project-level, per-location bucket for you. - */ - configBucket: string; - /** - * Required. The shared Compute Engine config settings for all instances in a - * cluster. - */ - gceClusterConfig: Schema$GceClusterConfig; - /** - * Optional. Commands to execute on each node after config is completed. By - * default, executables are run on master and all worker nodes. You can test a - * node's <code>role</code> metadata to run an executable on a - * master or worker node, as shown below using curl (you can also use wget): - * ROLE=$(curl -H Metadata-Flavor:Google - * http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role) - * if [[ "${ROLE}" == 'Master' ]]; then ... master - * specific actions ... else ... worker specific actions ... fi - */ - initializationActions: Schema$NodeInitializationAction[]; - /** - * Optional. The config setting for auto delete cluster schedule. - */ - lifecycleConfig: Schema$LifecycleConfig; - /** - * Optional. The Compute Engine config settings for the master instance in a - * cluster. - */ - masterConfig: Schema$InstanceGroupConfig; - /** - * Optional. The Compute Engine config settings for additional worker - * instances in a cluster. - */ - secondaryWorkerConfig: Schema$InstanceGroupConfig; - /** - * Optional. The config settings for software inside the cluster. - */ - softwareConfig: Schema$SoftwareConfig; - /** - * Optional. The Compute Engine config settings for worker instances in a - * cluster. - */ - workerConfig: Schema$InstanceGroupConfig; -} -/** - * Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: - * This report is available for testing purposes only. It may be changed before - * final release. - */ -export interface Schema$ClusterMetrics { - /** - * The HDFS metrics. - */ - hdfsMetrics: any; - /** - * The YARN metrics. - */ - yarnMetrics: any; -} -/** - * The cluster operation triggered by a workflow. - */ -export interface Schema$ClusterOperation { - /** - * Output only. Indicates the operation is done. - */ - done: boolean; - /** - * Output only. Error, if operation failed. - */ - error: string; - /** - * Output only. The id of the cluster operation. - */ - operationId: string; -} -/** - * Metadata describing the operation. - */ -export interface Schema$ClusterOperationMetadata { - /** - * Output only. Name of the cluster for the operation. - */ - clusterName: string; - /** - * Output only. Cluster UUID for the operation. - */ - clusterUuid: string; - /** - * Output only. Short description of operation. - */ - description: string; - /** - * Output only. Labels associated with the operation - */ - labels: any; - /** - * Output only. The operation type. - */ - operationType: string; - /** - * Output only. Current operation status. - */ - status: Schema$ClusterOperationStatus; - /** - * Output only. The previous operation status. - */ - statusHistory: Schema$ClusterOperationStatus[]; - /** - * Output only. Errors encountered during operation execution. - */ - warnings: string[]; -} -/** - * The status of the operation. - */ -export interface Schema$ClusterOperationStatus { - /** - * Output only. A message containing any operation metadata details. - */ - details: string; - /** - * Output only. A message containing the detailed operation state. - */ - innerState: string; - /** - * Output only. A message containing the operation state. - */ - state: string; - /** - * Output only. The time this state was entered. - */ - stateStartTime: string; -} -/** - * A selector that chooses target cluster for jobs based on metadata. - */ -export interface Schema$ClusterSelector { - /** - * Required. The cluster labels. Cluster must have all labels to match. - */ - clusterLabels: any; - /** - * Optional. The zone where workflow process executes. This parameter does not - * affect the selection of the cluster.If unspecified, the zone of the first - * cluster matching the selector is used. - */ - zone: string; -} -/** - * The status of a cluster and its instances. - */ -export interface Schema$ClusterStatus { - /** - * Output only. Optional details of cluster's state. - */ - detail: string; - /** - * Output only. The cluster's state. - */ - state: string; - /** - * Output only. Time when this state was entered. - */ - stateStartTime: string; - /** - * Output only. Additional state information that includes status reported by - * the agent. - */ - substate: string; -} -/** - * A request to collect cluster diagnostic information. - */ -export interface Schema$DiagnoseClusterRequest {} -/** - * The location of diagnostic output. - */ -export interface Schema$DiagnoseClusterResults { - /** - * Output only. The Cloud Storage URI of the diagnostic output. The output - * report is a plain text file with a summary of collected diagnostics. - */ - outputUri: string; -} -/** - * Specifies the config of disk options for a group of VM instances. - */ -export interface Schema$DiskConfig { - /** - * Optional. Size in GB of the boot disk (default is 500GB). - */ - bootDiskSizeGb: number; - /** - * Optional. Type of the boot disk (default is "pd-standard"). Valid - * values: "pd-ssd" (Persistent Disk Solid State Drive) or - * "pd-standard" (Persistent Disk Hard Disk Drive). - */ - bootDiskType: string; - /** - * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs are - * not attached, the boot disk is used to store runtime logs and HDFS - * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one - * or more SSDs are attached, this runtime bulk data is spread across them, - * and the boot disk contains only basic config and installed binaries. - */ - numLocalSsds: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Common config settings for resources of Compute Engine cluster instances, - * applicable to all instances in the cluster. - */ -export interface Schema$GceClusterConfig { - /** - * Optional. If true, all instances in the cluster will only have internal IP - * addresses. By default, clusters are not restricted to internal IP - * addresses, and will have ephemeral external IP addresses assigned to each - * instance. This internal_ip_only restriction can only be enabled for - * subnetwork enabled networks, and all off-cluster dependencies must be - * configured to be accessible without external IP addresses. - */ - internalIpOnly: boolean; - /** - * The Compute Engine metadata entries to add to all instances (see Project - * and instance metadata - * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). - */ - metadata: any; - /** - * Optional. The Compute Engine network to be used for machine communications. - * Cannot be specified with subnetwork_uri. If neither network_uri nor - * subnetwork_uri is specified, the "default" network of the project - * is used, if it exists. Cannot be a "Custom Subnet Network" (see - * Using Subnetworks for more information).A full URL, partial URI, or short - * name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default - * projects/[project_id]/regions/global/default default - */ - networkUri: string; - /** - * Optional. The service account of the instances. Defaults to the default - * Compute Engine service account. Custom service accounts need permissions - * equivalent to the following IAM roles: roles/logging.logWriter - * roles/storage.objectAdmin(see - * https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts - * for more information). Example: - * [account_id]@[project_id].iam.gserviceaccount.com - */ - serviceAccount: string; - /** - * Optional. The URIs of service account scopes to be included in Compute - * Engine instances. The following base set of scopes is always included: - * https://www.googleapis.com/auth/cloud.useraccounts.readonly - * https://www.googleapis.com/auth/devstorage.read_write - * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, - * the following defaults are also provided: - * https://www.googleapis.com/auth/bigquery - * https://www.googleapis.com/auth/bigtable.admin.table - * https://www.googleapis.com/auth/bigtable.data - * https://www.googleapis.com/auth/devstorage.full_control - */ - serviceAccountScopes: string[]; - /** - * Optional. The Compute Engine subnetwork to be used for machine - * communications. Cannot be specified with network_uri.A full URL, partial - * URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 - * projects/[project_id]/regions/us-east1/sub0 sub0 - */ - subnetworkUri: string; - /** - * The Compute Engine tags to add to all instances (see Tagging instances). - */ - tags: string[]; - /** - * Optional. The zone where the Compute Engine cluster will be located. On a - * create request, it is required in the "global" region. If omitted - * in a non-global Cloud Dataproc region, the service will pick a zone in the - * corresponding Compute Engine region. On a get request, zone will always be - * present.A full URL, partial URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] - * projects/[project_id]/zones/[zone] us-central1-f - */ - zoneUri: string; -} -/** - * A Cloud Dataproc job for running Apache Hadoop MapReduce - * (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) - * jobs on Apache Hadoop YARN - * (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). - */ -export interface Schema$HadoopJob { - /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, - * or .zip. - */ - archiveUris: string[]; - /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as -libjars or -Dfoo=bar, that can be set as job properties, since a - * collision may occur that causes an incorrect job submission. - */ - args: string[]; - /** - * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied to - * the working directory of Hadoop drivers and distributed tasks. Useful for - * naively parallel tasks. - */ - fileUris: string[]; - /** - * Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and - * tasks. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * The name of the driver's main class. The jar file containing the class - * must be in the default CLASSPATH or specified in jar_file_uris. - */ - mainClass: string; - /** - * The HCFS URI of the jar file containing the main class. Examples: - * 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' - * 'hdfs:/tmp/test-samples/custom-wordcount.jar' - * 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' - */ - mainJarFileUri: string; - /** - * Optional. A mapping of property names to values, used to configure Hadoop. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site and - * classes in user code. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) - * queries on YARN. - */ -export interface Schema$HiveJob { - /** - * Optional. Whether to continue executing queries if a query fails. The - * default value is false. Setting to true can be useful when executing - * independent parallel queries. - */ - continueOnFailure: boolean; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive server - * and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. - */ - jarFileUris: string[]; - /** - * Optional. A mapping of property names and values, used to configure Hive. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, - * /etc/hive/conf/hive-site.xml, and classes in user code. - */ - properties: any; - /** - * The HCFS URI of the script that contains Hive queries. - */ - queryFileUri: string; - /** - * A list of queries. - */ - queryList: Schema$QueryList; - /** - * Optional. Mapping of query variable names to values (equivalent to the Hive - * command: SET name="value";). - */ - scriptVariables: any; -} -/** - * Optional. The config settings for Compute Engine resources in an instance - * group, such as a master or worker group. - */ -export interface Schema$InstanceGroupConfig { - /** - * Optional. The Compute Engine accelerator configuration for these - * instances.Beta Feature: This feature is still under development. It may be - * changed before final release. - */ - accelerators: Schema$AcceleratorConfig[]; - /** - * Optional. Disk option config settings. - */ - diskConfig: Schema$DiskConfig; - /** - * Output only. The Compute Engine image resource used for cluster instances. - * Inferred from SoftwareConfig.image_version. - */ - imageUri: string; - /** - * Optional. The list of instance names. Cloud Dataproc derives the names from - * cluster_name, num_instances, and the instance group if not set by user - * (recommended practice is to let Cloud Dataproc derive the name). - */ - instanceNames: string[]; - /** - * Optional. Specifies that this instance group contains preemptible - * instances. - */ - isPreemptible: boolean; - /** - * Optional. The Compute Engine machine type used for cluster instances.A full - * URL, partial URI, or short name are valid. Examples: - * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 - * n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc Auto - * Zone Placement feature, you must use the short name of the machine type - * resource, for example, n1-standard-2. - */ - machineTypeUri: string; - /** - * Output only. The config for Compute Engine Instance Group Manager that - * manages this group. This is only used for preemptible instance groups. - */ - managedGroupConfig: Schema$ManagedGroupConfig; - /** - * Optional. Specifies the minimum cpu platform for the Instance Group. See - * Cloud Dataproc&rarr;Minimum CPU Platform. - */ - minCpuPlatform: string; - /** - * Optional. The number of VM instances in the instance group. For master - * instance groups, must be set to 1. - */ - numInstances: number; -} -/** - * A request to instantiate a workflow template. - */ -export interface Schema$InstantiateWorkflowTemplateRequest { - /** - * Optional. A tag that prevents multiple concurrent workflow instances with - * the same tag from running. This mitigates risk of concurrent instances - * started due to retries.It is recommended to always set this value to a UUID - * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must - * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and - * hyphens (-). The maximum length is 40 characters. - */ - instanceId: string; - /** - * Optional. The version of workflow template to instantiate. If specified, - * the workflow will be instantiated only if the current version of the - * workflow template has the supplied version.This option cannot be used to - * instantiate a previous version of workflow template. - */ - version: number; -} -/** - * A Cloud Dataproc job resource. - */ -export interface Schema$Job { - /** - * Output only. If present, the location of miscellaneous control files which - * may be used as part of job setup and handling. If not present, control - * files may be placed in the same location as driver_output_uri. - */ - driverControlFilesUri: string; - /** - * Output only. A URI pointing to the location of the stdout of the job's - * driver program. - */ - driverOutputResourceUri: string; - /** - * Job is a Hadoop job. - */ - hadoopJob: Schema$HadoopJob; - /** - * Job is a Hive job. - */ - hiveJob: Schema$HiveJob; - /** - * Optional. The labels to associate with this job. Label keys must contain 1 - * to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if - * present, must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be - * associated with a job. - */ - labels: any; - /** - * Job is a Pig job. - */ - pigJob: Schema$PigJob; - /** - * Required. Job information, including how, when, and where to run the job. - */ - placement: Schema$JobPlacement; - /** - * Job is a Pyspark job. - */ - pysparkJob: Schema$PySparkJob; - /** - * Optional. The fully qualified reference to the job, which can be used to - * obtain the equivalent REST path of the job resource. If this property is - * not specified when a job is created, the server generates a - * <code>job_id</code>. - */ - reference: Schema$JobReference; - /** - * Optional. Job scheduling configuration. - */ - scheduling: Schema$JobScheduling; - /** - * Job is a Spark job. - */ - sparkJob: Schema$SparkJob; - /** - * Job is a SparkSql job. - */ - sparkSqlJob: Schema$SparkSqlJob; - /** - * Output only. The job status. Additional application-specific status - * information may be contained in the <code>type_job</code> and - * <code>yarn_applications</code> fields. - */ - status: Schema$JobStatus; - /** - * Output only. The previous job status. - */ - statusHistory: Schema$JobStatus[]; - /** - * Output only. The collection of YARN applications spun up by this job.Beta - * Feature: This report is available for testing purposes only. It may be - * changed before final release. - */ - yarnApplications: Schema$YarnApplication[]; -} -/** - * Cloud Dataproc job config. - */ -export interface Schema$JobPlacement { - /** - * Required. The name of the cluster where the job will be submitted. - */ - clusterName: string; - /** - * Output only. A cluster UUID generated by the Cloud Dataproc service when - * the job is submitted. - */ - clusterUuid: string; -} -/** - * Encapsulates the full scoping used to reference a job. - */ -export interface Schema$JobReference { - /** - * Optional. The job ID, which must be unique within the project. The job ID - * is generated by the server upon job submission or provided by the user as a - * means to perform retries without creating duplicate jobs. The ID must - * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or hyphens - * (-). The maximum length is 100 characters. - */ - jobId: string; - /** - * Required. The ID of the Google Cloud Platform project that the job belongs - * to. - */ - projectId: string; -} -/** - * Job scheduling options. - */ -export interface Schema$JobScheduling { - /** - * Optional. Maximum number of times per hour a driver may be restarted as a - * result of driver terminating with non-zero code before job is reported - * failed.A job may be reported as thrashing if driver exits with non-zero - * code 4 times within 10 minute window.Maximum value is 10. - */ - maxFailuresPerHour: number; -} -/** - * Cloud Dataproc job status. - */ -export interface Schema$JobStatus { - /** - * Output only. Optional job state details, such as an error description if - * the state is <code>ERROR</code>. - */ - details: string; - /** - * Output only. A state message specifying the overall job state. - */ - state: string; - /** - * Output only. The time when this state was entered. - */ - stateStartTime: string; - /** - * Output only. Additional state information, which includes status reported - * by the agent. - */ - substate: string; -} -/** - * Specifies the cluster auto delete related schedule configuration. - */ -export interface Schema$LifecycleConfig { - /** - * Optional. The time when cluster will be auto-deleted. - */ - autoDeleteTime: string; - /** - * Optional. The life duration of cluster, the cluster will be auto-deleted at - * the end of this duration. - */ - autoDeleteTtl: string; - /** - * Optional. The longest duration that cluster would keep alive while staying - * idle; passing this threshold will cause cluster to be auto-deleted. - */ - idleDeleteTtl: string; -} -/** - * The list of all clusters in a project. - */ -export interface Schema$ListClustersResponse { - /** - * Output only. The clusters in the project. - */ - clusters: Schema$Cluster[]; - /** - * Output only. This token is included in the response if there are more - * results to fetch. To fetch additional results, provide this value as the - * page_token in a subsequent <code>ListClustersRequest</code>. - */ - nextPageToken: string; -} -/** - * A list of jobs in a project. - */ -export interface Schema$ListJobsResponse { - /** - * Output only. Jobs list. - */ - jobs: Schema$Job[]; - /** - * Optional. This token is included in the response if there are more results - * to fetch. To fetch additional results, provide this value as the page_token - * in a subsequent <code>ListJobsRequest</code>. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * A response to a request to list workflow templates in a project. - */ -export interface Schema$ListWorkflowTemplatesResponse { - /** - * Output only. This token is included in the response if there are more - * results to fetch. To fetch additional results, provide this value as the - * page_token in a subsequent - * <code>ListWorkflowTemplatesRequest</code>. - */ - nextPageToken: string; - /** - * Output only. WorkflowTemplates list. - */ - templates: Schema$WorkflowTemplate[]; -} -/** - * The runtime logging config of the job. - */ -export interface Schema$LoggingConfig { - /** - * The per-package log levels for the driver. This may include - * "root" package name to configure rootLogger. Examples: - * 'com.google = FATAL', 'root = INFO', 'org.apache = - * DEBUG' - */ - driverLogLevels: any; -} -/** - * Cluster that is managed by the workflow. - */ -export interface Schema$ManagedCluster { - /** - * Required. The cluster name prefix. A unique cluster name will be formed by - * appending a random suffix.The name must contain only lower-case letters - * (a-z), numbers (0-9), and hyphens (-). Must begin with a letter. Cannot - * begin or end with hyphen. Must consist of between 2 and 35 characters. - */ - clusterName: string; - /** - * Required. The cluster configuration. - */ - config: Schema$ClusterConfig; - /** - * Optional. The labels to associate with this cluster.Label keys must be - * between 1 and 63 characters long, and must conform to the following PCRE - * regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 - * characters long, and must conform to the following PCRE regular expression: - * \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a - * given cluster. - */ - labels: any; -} -/** - * Specifies the resources used to actively manage an instance group. - */ -export interface Schema$ManagedGroupConfig { - /** - * Output only. The name of the Instance Group Manager for this group. - */ - instanceGroupManagerName: string; - /** - * Output only. The name of the Instance Template used for the Managed - * Instance Group. - */ - instanceTemplateName: string; -} -/** - * Specifies an executable to run on a fully configured node and a timeout - * period for executable completion. - */ -export interface Schema$NodeInitializationAction { - /** - * Required. Cloud Storage URI of executable file. - */ - executableFile: string; - /** - * Optional. Amount of time executable has to complete. Default is 10 minutes. - * Cluster creation fails with an explanatory error message (the name of the - * executable that caused the error and the exceeded timeout period) if the - * executable is not completed at end of the timeout period. - */ - executionTimeout: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is false, it means the operation is still in progress. If - * true, the operation is completed, and either error or response is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the name should - * have the format of operations/some/unique/name. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as Delete, the response is - * google.protobuf.Empty. If the original method is standard - * Get/Create/Update, the response should be the resource. For other methods, - * the response should have the type XxxResponse, where Xxx is the original - * method name. For example, if the original method name is TakeSnapshot(), - * the inferred response type is TakeSnapshotResponse. - */ - response: any; -} -/** - * A job executed by the workflow. - */ -export interface Schema$OrderedJob { - /** - * Job is a Hadoop job. - */ - hadoopJob: Schema$HadoopJob; - /** - * Job is a Hive job. - */ - hiveJob: Schema$HiveJob; - /** - * Optional. The labels to associate with this job.Label keys must be between - * 1 and 63 characters long, and must conform to the following regular - * expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and 63 - * characters long, and must conform to the following regular expression: - * \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a - * given job. - */ - labels: any; - /** - * Job is a Pig job. - */ - pigJob: Schema$PigJob; - /** - * Optional. The optional list of prerequisite job step_ids. If not specified, - * the job will start at the beginning of workflow. - */ - prerequisiteStepIds: string[]; - /** - * Job is a Pyspark job. - */ - pysparkJob: Schema$PySparkJob; - /** - * Optional. Job scheduling configuration. - */ - scheduling: Schema$JobScheduling; - /** - * Job is a Spark job. - */ - sparkJob: Schema$SparkJob; - /** - * Job is a SparkSql job. - */ - sparkSqlJob: Schema$SparkSqlJob; - /** - * Required. The step id. The id must be unique among all jobs within the - * template.The step id is used as prefix for job id, as job - * goog-dataproc-workflow-step-id label, and in prerequisiteStepIds field from - * other steps.The id must contain only letters (a-z, A-Z), numbers (0-9), - * underscores (_), and hyphens (-). Cannot begin or end with underscore or - * hyphen. Must consist of between 3 and 50 characters. - */ - stepId: string; -} -/** - * A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries - * on YARN. - */ -export interface Schema$PigJob { - /** - * Optional. Whether to continue executing queries if a query fails. The - * default value is false. Setting to true can be useful when executing - * independent parallel queries. - */ - continueOnFailure: boolean; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client - * and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * Optional. A mapping of property names to values, used to configure Pig. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, - * /etc/pig/conf/pig.properties, and classes in user code. - */ - properties: any; - /** - * The HCFS URI of the script that contains the Pig queries. - */ - queryFileUri: string; - /** - * A list of queries. - */ - queryList: Schema$QueryList; - /** - * Optional. Mapping of query variable names to values (equivalent to the Pig - * command: name=[value]). - */ - scriptVariables: any; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources.A Policy consists of a - * list of bindings. A binding binds a list of members to a role, where the - * members can be user accounts, Google groups, Google domains, and service - * accounts. A role is a named list of permissions defined by IAM.JSON Example { - * "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] - * }, { "role": "roles/viewer", - * "members": ["user:sean@example.com"] } ] } YAML - * Example bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner - - * members: - user:sean@example.com role: roles/viewer For a description of - * IAM and its features, see the IAM developer's guide - * (https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of members to a role. bindings with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * etag is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the etag in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An etag is returned in the response to getIamPolicy, and - * systems are expected to put that etag in the request to setIamPolicy to - * ensure that their change will be applied to the same version of the - * policy.If no etag is provided in the call to setIamPolicy, then the - * existing policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * A Cloud Dataproc job for running Apache PySpark - * (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) - * applications on YARN. - */ -export interface Schema$PySparkJob { - /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * .jar, .tar, .tar.gz, .tgz, and .zip. - */ - archiveUris: string[]; - /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as --conf, that can be set as job properties, since a collision may - * occur that causes an incorrect job submission. - */ - args: string[]; - /** - * Optional. HCFS URIs of files to be copied to the working directory of - * Python drivers and distributed tasks. Useful for naively parallel tasks. - */ - fileUris: string[]; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python - * driver and tasks. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * Required. The HCFS URI of the main Python file to use as the driver. Must - * be a .py file. - */ - mainPythonFileUri: string; - /** - * Optional. A mapping of property names to values, used to configure PySpark. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in - * /etc/spark/conf/spark-defaults.conf and classes in user code. - */ - properties: any; - /** - * Optional. HCFS file URIs of Python files to pass to the PySpark framework. - * Supported file types: .py, .egg, and .zip. - */ - pythonFileUris: string[]; -} -/** - * A list of queries to run on a cluster. - */ -export interface Schema$QueryList { - /** - * Required. The queries to execute. You do not need to terminate a query with - * a semicolon. Multiple queries can be specified in one string by separating - * each with a semicolon. Here is an example of an Cloud Dataproc API snippet - * that uses a QueryList to specify a HiveJob: "hiveJob": { - * "queryList": { "queries": [ "query1", - * "query2", "query3;query4", ] } } - */ - queries: string[]; -} -/** - * Request message for SetIamPolicy method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the resource. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * Specifies the selection and config of software inside the cluster. - */ -export interface Schema$SoftwareConfig { - /** - * Optional. The version of software inside the cluster. It must be one of the - * supported Cloud Dataproc Versions, such as "1.2" (including a - * subminor version, such as "1.2.29"), or the "preview" - * version. If unspecified, it defaults to the latest version. - */ - imageVersion: string; - /** - * Optional. The properties to set on daemon config files.Property keys are - * specified in prefix:property format, such as core:fs.defaultFS. The - * following are supported prefixes and their mappings: capacity-scheduler: - * capacity-scheduler.xml core: core-site.xml distcp: distcp-default.xml hdfs: - * hdfs-site.xml hive: hive-site.xml mapred: mapred-site.xml pig: - * pig.properties spark: spark-defaults.conf yarn: yarn-site.xmlFor more - * information, see Cluster properties. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) - * applications on YARN. - */ -export interface Schema$SparkJob { - /** - * Optional. HCFS URIs of archives to be extracted in the working directory of - * Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, .tgz, - * and .zip. - */ - archiveUris: string[]; - /** - * Optional. The arguments to pass to the driver. Do not include arguments, - * such as --conf, that can be set as job properties, since a collision may - * occur that causes an incorrect job submission. - */ - args: string[]; - /** - * Optional. HCFS URIs of files to be copied to the working directory of Spark - * drivers and distributed tasks. Useful for naively parallel tasks. - */ - fileUris: string[]; - /** - * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark - * driver and tasks. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * The name of the driver's main class. The jar file that contains the - * class must be in the default CLASSPATH or specified in jar_file_uris. - */ - mainClass: string; - /** - * The HCFS URI of the jar file that contains the main class. - */ - mainJarFileUri: string; - /** - * Optional. A mapping of property names to values, used to configure Spark. - * Properties that conflict with values set by the Cloud Dataproc API may be - * overwritten. Can include properties set in - * /etc/spark/conf/spark-defaults.conf and classes in user code. - */ - properties: any; -} -/** - * A Cloud Dataproc job for running Apache Spark SQL - * (http://spark.apache.org/sql/) queries. - */ -export interface Schema$SparkSqlJob { - /** - * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. - */ - jarFileUris: string[]; - /** - * Optional. The runtime log config for job execution. - */ - loggingConfig: Schema$LoggingConfig; - /** - * Optional. A mapping of property names to values, used to configure Spark - * SQL's SparkConf. Properties that conflict with values set by the Cloud - * Dataproc API may be overwritten. - */ - properties: any; - /** - * The HCFS URI of the script that contains SQL queries. - */ - queryFileUri: string; - /** - * A list of queries. - */ - queryList: Schema$QueryList; - /** - * Optional. Mapping of query variable names to values (equivalent to the - * Spark SQL command: SET name="value";). - */ - scriptVariables: any; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; +export namespace dataproc_v1beta2 { /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A request to submit a job. - */ -export interface Schema$SubmitJobRequest { + * Cloud Dataproc API + * + * Manages Hadoop-based clusters and jobs on Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const dataproc = google.dataproc('v1beta2'); + * + * @namespace dataproc + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Dataproc + */ + export class Dataproc { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + /** - * Required. The job resource. - */ - job: Schema$Job; + * Specifies the type and number of accelerator cards attached to the + * instances of an instance group (see GPUs on Compute Engine). + */ + export interface Schema$AcceleratorConfig { + /** + * The number of the accelerator cards of this type exposed to this + * instance. + */ + acceleratorCount: number; + /** + * Full URL, partial URI, or short name of the accelerator type resource to + * expose to this instance. See Compute Engine AcceleratorTypes( + * /compute/docs/reference/beta/acceleratorTypes)Examples * + * https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + * * + * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 + * * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud + * Dataproc Auto Zone Placement feature, you must use the short name of the + * accelerator type resource, for example, nvidia-tesla-k80. + */ + acceleratorTypeUri: string; + } /** - * Optional. A unique id used to identify the request. If the server receives - * two SubmitJobRequest requests with the same id, then the second request - * will be ignored and the first Job created and stored in the backend is - * returned.It is recommended to always set this value to a UUID - * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must - * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and - * hyphens (-). The maximum length is 40 characters. - */ - requestId: string; -} -/** - * Request message for TestIamPermissions method. - */ -export interface Schema$TestIamPermissionsRequest { + * Associates members with a role. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * members can have the following values: allUsers: A special identifier + * that represents anyone who is on the internet; with or without a Google + * account. allAuthenticatedUsers: A special identifier that represents + * anyone who is authenticated with a Google account or a service account. + * user:{emailid}: An email address that represents a specific Google + * account. For example, alice@gmail.com or joe@example.com. + * serviceAccount:{emailid}: An email address that represents a service + * account. For example, my-other-app@appspot.gserviceaccount.com. + * group:{emailid}: An email address that represents a Google group. For + * example, admins@example.com. domain:{domain}: A Google Apps domain name + * that represents all the users of that domain. For example, google.com or + * example.com. + */ + members: string[]; + /** + * Role that is assigned to members. For example, roles/viewer, + * roles/editor, or roles/owner. Required + */ + role: string; + } /** - * The set of permissions to check for the resource. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see IAM Overview - * (https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for TestIamPermissions method. - */ -export interface Schema$TestIamPermissionsResponse { + * A request to cancel a job. + */ + export interface Schema$CancelJobRequest {} + /** + * Describes the identifying information, config, and status of a cluster of + * Compute Engine instances. + */ + export interface Schema$Cluster { + /** + * Required. The cluster name. Cluster names within a project must be + * unique. Names of deleted clusters can be reused. + */ + clusterName: string; + /** + * Output only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc + * generates this value when it creates the cluster. + */ + clusterUuid: string; + /** + * Required. The cluster config. Note that Cloud Dataproc may set default + * values, and values may change when clusters are updated. + */ + config: Schema$ClusterConfig; + /** + * Optional. The labels to associate with this cluster. Label keys must + * contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, + * if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + * associated with a cluster. + */ + labels: any; + /** + * Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: + * This report is available for testing purposes only. It may be changed + * before final release. + */ + metrics: Schema$ClusterMetrics; + /** + * Required. The Google Cloud Platform project ID that the cluster belongs + * to. + */ + projectId: string; + /** + * Output only. Cluster status. + */ + status: Schema$ClusterStatus; + /** + * Output only. The previous cluster status. + */ + statusHistory: Schema$ClusterStatus[]; + } /** - * A subset of TestPermissionsRequest.permissions that the caller is allowed. - */ - permissions: string[]; -} -/** - * The workflow graph. - */ -export interface Schema$WorkflowGraph { + * The cluster config. + */ + export interface Schema$ClusterConfig { + /** + * Optional. A Cloud Storage staging bucket used for sharing generated SSH + * keys and config. If you do not specify a staging bucket, Cloud Dataproc + * will determine an appropriate Cloud Storage location (US, ASIA, or EU) + * for your cluster's staging bucket according to the Google Compute + * Engine zone where your cluster is deployed, and then it will create and + * manage this project-level, per-location bucket for you. + */ + configBucket: string; + /** + * Required. The shared Compute Engine config settings for all instances in + * a cluster. + */ + gceClusterConfig: Schema$GceClusterConfig; + /** + * Optional. Commands to execute on each node after config is completed. By + * default, executables are run on master and all worker nodes. You can test + * a node's <code>role</code> metadata to run an executable + * on a master or worker node, as shown below using curl (you can also use + * wget): ROLE=$(curl -H Metadata-Flavor:Google + * http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role) + * if [[ "${ROLE}" == 'Master' ]]; then ... master + * specific actions ... else ... worker specific actions ... fi + */ + initializationActions: Schema$NodeInitializationAction[]; + /** + * Optional. The config setting for auto delete cluster schedule. + */ + lifecycleConfig: Schema$LifecycleConfig; + /** + * Optional. The Compute Engine config settings for the master instance in a + * cluster. + */ + masterConfig: Schema$InstanceGroupConfig; + /** + * Optional. The Compute Engine config settings for additional worker + * instances in a cluster. + */ + secondaryWorkerConfig: Schema$InstanceGroupConfig; + /** + * Optional. The config settings for software inside the cluster. + */ + softwareConfig: Schema$SoftwareConfig; + /** + * Optional. The Compute Engine config settings for worker instances in a + * cluster. + */ + workerConfig: Schema$InstanceGroupConfig; + } /** - * Output only. The workflow nodes. + * Contains cluster daemon metrics, such as HDFS and YARN stats.Beta Feature: + * This report is available for testing purposes only. It may be changed + * before final release. */ - nodes: Schema$WorkflowNode[]; -} -/** - * A Cloud Dataproc workflow template resource. - */ -export interface Schema$WorkflowMetadata { + export interface Schema$ClusterMetrics { + /** + * The HDFS metrics. + */ + hdfsMetrics: any; + /** + * The YARN metrics. + */ + yarnMetrics: any; + } /** - * Output only. The name of the managed cluster. - */ - clusterName: string; + * The cluster operation triggered by a workflow. + */ + export interface Schema$ClusterOperation { + /** + * Output only. Indicates the operation is done. + */ + done: boolean; + /** + * Output only. Error, if operation failed. + */ + error: string; + /** + * Output only. The id of the cluster operation. + */ + operationId: string; + } /** - * Output only. The create cluster operation metadata. - */ - createCluster: Schema$ClusterOperation; + * Metadata describing the operation. + */ + export interface Schema$ClusterOperationMetadata { + /** + * Output only. Name of the cluster for the operation. + */ + clusterName: string; + /** + * Output only. Cluster UUID for the operation. + */ + clusterUuid: string; + /** + * Output only. Short description of operation. + */ + description: string; + /** + * Output only. Labels associated with the operation + */ + labels: any; + /** + * Output only. The operation type. + */ + operationType: string; + /** + * Output only. Current operation status. + */ + status: Schema$ClusterOperationStatus; + /** + * Output only. The previous operation status. + */ + statusHistory: Schema$ClusterOperationStatus[]; + /** + * Output only. Errors encountered during operation execution. + */ + warnings: string[]; + } /** - * Output only. The delete cluster operation metadata. - */ - deleteCluster: Schema$ClusterOperation; + * The status of the operation. + */ + export interface Schema$ClusterOperationStatus { + /** + * Output only. A message containing any operation metadata details. + */ + details: string; + /** + * Output only. A message containing the detailed operation state. + */ + innerState: string; + /** + * Output only. A message containing the operation state. + */ + state: string; + /** + * Output only. The time this state was entered. + */ + stateStartTime: string; + } /** - * Output only. The workflow graph. - */ - graph: Schema$WorkflowGraph; + * A selector that chooses target cluster for jobs based on metadata. + */ + export interface Schema$ClusterSelector { + /** + * Required. The cluster labels. Cluster must have all labels to match. + */ + clusterLabels: any; + /** + * Optional. The zone where workflow process executes. This parameter does + * not affect the selection of the cluster.If unspecified, the zone of the + * first cluster matching the selector is used. + */ + zone: string; + } /** - * Map from parameter names to values that were used for those parameters. - */ - parameters: any; + * The status of a cluster and its instances. + */ + export interface Schema$ClusterStatus { + /** + * Output only. Optional details of cluster's state. + */ + detail: string; + /** + * Output only. The cluster's state. + */ + state: string; + /** + * Output only. Time when this state was entered. + */ + stateStartTime: string; + /** + * Output only. Additional state information that includes status reported + * by the agent. + */ + substate: string; + } /** - * Output only. The workflow state. + * A request to collect cluster diagnostic information. */ - state: string; + export interface Schema$DiagnoseClusterRequest {} /** - * Output only. The "resource name" of the template. + * The location of diagnostic output. */ - template: string; + export interface Schema$DiagnoseClusterResults { + /** + * Output only. The Cloud Storage URI of the diagnostic output. The output + * report is a plain text file with a summary of collected diagnostics. + */ + outputUri: string; + } /** - * Output only. The version of template at the time of workflow instantiation. - */ - version: number; -} -/** - * The workflow node. - */ -export interface Schema$WorkflowNode { + * Specifies the config of disk options for a group of VM instances. + */ + export interface Schema$DiskConfig { + /** + * Optional. Size in GB of the boot disk (default is 500GB). + */ + bootDiskSizeGb: number; + /** + * Optional. Type of the boot disk (default is "pd-standard"). + * Valid values: "pd-ssd" (Persistent Disk Solid State Drive) or + * "pd-standard" (Persistent Disk Hard Disk Drive). + */ + bootDiskType: string; + /** + * Optional. Number of attached SSDs, from 0 to 4 (default is 0). If SSDs + * are not attached, the boot disk is used to store runtime logs and HDFS + * (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If one + * or more SSDs are attached, this runtime bulk data is spread across them, + * and the boot disk contains only basic config and installed binaries. + */ + numLocalSsds: number; + } /** - * Output only. The error detail. - */ - error: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Common config settings for resources of Compute Engine cluster instances, + * applicable to all instances in the cluster. + */ + export interface Schema$GceClusterConfig { + /** + * Optional. If true, all instances in the cluster will only have internal + * IP addresses. By default, clusters are not restricted to internal IP + * addresses, and will have ephemeral external IP addresses assigned to each + * instance. This internal_ip_only restriction can only be enabled for + * subnetwork enabled networks, and all off-cluster dependencies must be + * configured to be accessible without external IP addresses. + */ + internalIpOnly: boolean; + /** + * The Compute Engine metadata entries to add to all instances (see Project + * and instance metadata + * (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). + */ + metadata: any; + /** + * Optional. The Compute Engine network to be used for machine + * communications. Cannot be specified with subnetwork_uri. If neither + * network_uri nor subnetwork_uri is specified, the "default" + * network of the project is used, if it exists. Cannot be a "Custom + * Subnet Network" (see Using Subnetworks for more information).A full + * URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default + * projects/[project_id]/regions/global/default default + */ + networkUri: string; + /** + * Optional. The service account of the instances. Defaults to the default + * Compute Engine service account. Custom service accounts need permissions + * equivalent to the following IAM roles: roles/logging.logWriter + * roles/storage.objectAdmin(see + * https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts + * for more information). Example: + * [account_id]@[project_id].iam.gserviceaccount.com + */ + serviceAccount: string; + /** + * Optional. The URIs of service account scopes to be included in Compute + * Engine instances. The following base set of scopes is always included: + * https://www.googleapis.com/auth/cloud.useraccounts.readonly + * https://www.googleapis.com/auth/devstorage.read_write + * https://www.googleapis.com/auth/logging.writeIf no scopes are specified, + * the following defaults are also provided: + * https://www.googleapis.com/auth/bigquery + * https://www.googleapis.com/auth/bigtable.admin.table + * https://www.googleapis.com/auth/bigtable.data + * https://www.googleapis.com/auth/devstorage.full_control + */ + serviceAccountScopes: string[]; + /** + * Optional. The Compute Engine subnetwork to be used for machine + * communications. Cannot be specified with network_uri.A full URL, partial + * URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0 + * projects/[project_id]/regions/us-east1/sub0 sub0 + */ + subnetworkUri: string; + /** + * The Compute Engine tags to add to all instances (see Tagging instances). + */ + tags: string[]; + /** + * Optional. The zone where the Compute Engine cluster will be located. On a + * create request, it is required in the "global" region. If + * omitted in a non-global Cloud Dataproc region, the service will pick a + * zone in the corresponding Compute Engine region. On a get request, zone + * will always be present.A full URL, partial URI, or short name are valid. + * Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] + * projects/[project_id]/zones/[zone] us-central1-f + */ + zoneUri: string; + } /** - * Output only. The job id; populated after the node enters RUNNING state. - */ - jobId: string; + * A Cloud Dataproc job for running Apache Hadoop MapReduce + * (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) + * jobs on Apache Hadoop YARN + * (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). + */ + export interface Schema$HadoopJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of Hadoop drivers and tasks. Supported file types: .jar, .tar, .tar.gz, + * .tgz, or .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as -libjars or -Dfoo=bar, that can be set as job properties, since a + * collision may occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS (Hadoop Compatible Filesystem) URIs of files to be copied + * to the working directory of Hadoop drivers and distributed tasks. Useful + * for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and + * tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * The name of the driver's main class. The jar file containing the + * class must be in the default CLASSPATH or specified in jar_file_uris. + */ + mainClass: string; + /** + * The HCFS URI of the jar file containing the main class. Examples: + * 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' + * 'hdfs:/tmp/test-samples/custom-wordcount.jar' + * 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' + */ + mainJarFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure + * Hadoop. Properties that conflict with values set by the Cloud Dataproc + * API may be overwritten. Can include properties set in + * /etc/hadoop/conf/*-site and classes in user code. + */ + properties: any; + } /** - * Output only. Node's prerequisite nodes. - */ - prerequisiteStepIds: string[]; + * A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) + * queries on YARN. + */ + export interface Schema$HiveJob { + /** + * Optional. Whether to continue executing queries if a query fails. The + * default value is false. Setting to true can be useful when executing + * independent parallel queries. + */ + continueOnFailure: boolean; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Hive + * server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and UDFs. + */ + jarFileUris: string[]; + /** + * Optional. A mapping of property names and values, used to configure Hive. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + * /etc/hive/conf/hive-site.xml, and classes in user code. + */ + properties: any; + /** + * The HCFS URI of the script that contains Hive queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Hive command: SET name="value";). + */ + scriptVariables: any; + } /** - * Output only. The node state. - */ - state: string; + * Optional. The config settings for Compute Engine resources in an instance + * group, such as a master or worker group. + */ + export interface Schema$InstanceGroupConfig { + /** + * Optional. The Compute Engine accelerator configuration for these + * instances.Beta Feature: This feature is still under development. It may + * be changed before final release. + */ + accelerators: Schema$AcceleratorConfig[]; + /** + * Optional. Disk option config settings. + */ + diskConfig: Schema$DiskConfig; + /** + * Output only. The Compute Engine image resource used for cluster + * instances. Inferred from SoftwareConfig.image_version. + */ + imageUri: string; + /** + * Optional. The list of instance names. Cloud Dataproc derives the names + * from cluster_name, num_instances, and the instance group if not set by + * user (recommended practice is to let Cloud Dataproc derive the name). + */ + instanceNames: string[]; + /** + * Optional. Specifies that this instance group contains preemptible + * instances. + */ + isPreemptible: boolean; + /** + * Optional. The Compute Engine machine type used for cluster instances.A + * full URL, partial URI, or short name are valid. Examples: + * https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 + * n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc + * Auto Zone Placement feature, you must use the short name of the machine + * type resource, for example, n1-standard-2. + */ + machineTypeUri: string; + /** + * Output only. The config for Compute Engine Instance Group Manager that + * manages this group. This is only used for preemptible instance groups. + */ + managedGroupConfig: Schema$ManagedGroupConfig; + /** + * Optional. Specifies the minimum cpu platform for the Instance Group. See + * Cloud Dataproc&rarr;Minimum CPU Platform. + */ + minCpuPlatform: string; + /** + * Optional. The number of VM instances in the instance group. For master + * instance groups, must be set to 1. + */ + numInstances: number; + } /** - * Output only. The name of the node. - */ - stepId: string; -} -/** - * A Cloud Dataproc workflow template resource. - */ -export interface Schema$WorkflowTemplate { + * A request to instantiate a workflow template. + */ + export interface Schema$InstantiateWorkflowTemplateRequest { + /** + * Optional. A tag that prevents multiple concurrent workflow instances with + * the same tag from running. This mitigates risk of concurrent instances + * started due to retries.It is recommended to always set this value to a + * UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The + * tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), + * and hyphens (-). The maximum length is 40 characters. + */ + instanceId: string; + /** + * Optional. The version of workflow template to instantiate. If specified, + * the workflow will be instantiated only if the current version of the + * workflow template has the supplied version.This option cannot be used to + * instantiate a previous version of workflow template. + */ + version: number; + } /** - * Output only. The time template was created. - */ - createTime: string; + * A Cloud Dataproc job resource. + */ + export interface Schema$Job { + /** + * Output only. If present, the location of miscellaneous control files + * which may be used as part of job setup and handling. If not present, + * control files may be placed in the same location as driver_output_uri. + */ + driverControlFilesUri: string; + /** + * Output only. A URI pointing to the location of the stdout of the + * job's driver program. + */ + driverOutputResourceUri: string; + /** + * Job is a Hadoop job. + */ + hadoopJob: Schema$HadoopJob; + /** + * Job is a Hive job. + */ + hiveJob: Schema$HiveJob; + /** + * Optional. The labels to associate with this job. Label keys must contain + * 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, + * if present, must contain 1 to 63 characters, and must conform to RFC 1035 + * (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be + * associated with a job. + */ + labels: any; + /** + * Job is a Pig job. + */ + pigJob: Schema$PigJob; + /** + * Required. Job information, including how, when, and where to run the job. + */ + placement: Schema$JobPlacement; + /** + * Job is a Pyspark job. + */ + pysparkJob: Schema$PySparkJob; + /** + * Optional. The fully qualified reference to the job, which can be used to + * obtain the equivalent REST path of the job resource. If this property is + * not specified when a job is created, the server generates a + * <code>job_id</code>. + */ + reference: Schema$JobReference; + /** + * Optional. Job scheduling configuration. + */ + scheduling: Schema$JobScheduling; + /** + * Job is a Spark job. + */ + sparkJob: Schema$SparkJob; + /** + * Job is a SparkSql job. + */ + sparkSqlJob: Schema$SparkSqlJob; + /** + * Output only. The job status. Additional application-specific status + * information may be contained in the <code>type_job</code> and + * <code>yarn_applications</code> fields. + */ + status: Schema$JobStatus; + /** + * Output only. The previous job status. + */ + statusHistory: Schema$JobStatus[]; + /** + * Output only. The collection of YARN applications spun up by this job.Beta + * Feature: This report is available for testing purposes only. It may be + * changed before final release. + */ + yarnApplications: Schema$YarnApplication[]; + } /** - * Required. The template id.The id must contain only letters (a-z, A-Z), - * numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with - * underscore or hyphen. Must consist of between 3 and 50 characters. - */ - id: string; + * Cloud Dataproc job config. + */ + export interface Schema$JobPlacement { + /** + * Required. The name of the cluster where the job will be submitted. + */ + clusterName: string; + /** + * Output only. A cluster UUID generated by the Cloud Dataproc service when + * the job is submitted. + */ + clusterUuid: string; + } /** - * Required. The Directed Acyclic Graph of Jobs to submit. - */ - jobs: Schema$OrderedJob[]; + * Encapsulates the full scoping used to reference a job. + */ + export interface Schema$JobReference { + /** + * Optional. The job ID, which must be unique within the project. The job ID + * is generated by the server upon job submission or provided by the user as + * a means to perform retries without creating duplicate jobs. The ID must + * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), or + * hyphens (-). The maximum length is 100 characters. + */ + jobId: string; + /** + * Required. The ID of the Google Cloud Platform project that the job + * belongs to. + */ + projectId: string; + } /** - * Optional. The labels to associate with this template. These labels will be - * propagated to all jobs and clusters created by the workflow instance.Label - * keys must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt).Label values may be empty, but, if - * present, must contain 1 to 63 characters, and must conform to RFC 1035 - * (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be - * associated with a template. + * Job scheduling options. */ - labels: any; + export interface Schema$JobScheduling { + /** + * Optional. Maximum number of times per hour a driver may be restarted as a + * result of driver terminating with non-zero code before job is reported + * failed.A job may be reported as thrashing if driver exits with non-zero + * code 4 times within 10 minute window.Maximum value is 10. + */ + maxFailuresPerHour: number; + } /** - * Output only. The "resource name" of the template, as described in - * https://cloud.google.com/apis/design/resource_names of the form - * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - */ - name: string; + * Cloud Dataproc job status. + */ + export interface Schema$JobStatus { + /** + * Output only. Optional job state details, such as an error description if + * the state is <code>ERROR</code>. + */ + details: string; + /** + * Output only. A state message specifying the overall job state. + */ + state: string; + /** + * Output only. The time when this state was entered. + */ + stateStartTime: string; + /** + * Output only. Additional state information, which includes status reported + * by the agent. + */ + substate: string; + } /** - * Required. WorkflowTemplate scheduling information. - */ - placement: Schema$WorkflowTemplatePlacement; + * Specifies the cluster auto delete related schedule configuration. + */ + export interface Schema$LifecycleConfig { + /** + * Optional. The time when cluster will be auto-deleted. + */ + autoDeleteTime: string; + /** + * Optional. The life duration of cluster, the cluster will be auto-deleted + * at the end of this duration. + */ + autoDeleteTtl: string; + /** + * Optional. The longest duration that cluster would keep alive while + * staying idle; passing this threshold will cause cluster to be + * auto-deleted. + */ + idleDeleteTtl: string; + } /** - * Output only. The time template was last updated. - */ - updateTime: string; + * The list of all clusters in a project. + */ + export interface Schema$ListClustersResponse { + /** + * Output only. The clusters in the project. + */ + clusters: Schema$Cluster[]; + /** + * Output only. This token is included in the response if there are more + * results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent <code>ListClustersRequest</code>. + */ + nextPageToken: string; + } /** - * Optional. Used to perform a consistent read-modify-write.This field should - * be left blank for a CreateWorkflowTemplate request. It is required for an - * UpdateWorkflowTemplate request, and must match the current server version. - * A typical update template flow would fetch the current template with a - * GetWorkflowTemplate request, which will return the current template with - * the version field filled in with the current server version. The user - * updates other fields in the template, then returns it as part of the - * UpdateWorkflowTemplate request. - */ - version: number; -} -/** - * Specifies workflow execution target.Either managed_cluster or - * cluster_selector is required. - */ -export interface Schema$WorkflowTemplatePlacement { + * A list of jobs in a project. + */ + export interface Schema$ListJobsResponse { + /** + * Output only. Jobs list. + */ + jobs: Schema$Job[]; + /** + * Optional. This token is included in the response if there are more + * results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent <code>ListJobsRequest</code>. + */ + nextPageToken: string; + } /** - * Optional. A selector that chooses target cluster for jobs based on - * metadata.The selector is evaluated at the time each job is submitted. - */ - clusterSelector: Schema$ClusterSelector; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Optional. A cluster that is managed by the workflow. - */ - managedCluster: Schema$ManagedCluster; -} -/** - * A YARN application created by a job. Application information is a subset of - * <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.Beta - * Feature: This report is available for testing purposes only. It may be - * changed before final release. - */ -export interface Schema$YarnApplication { + * A response to a request to list workflow templates in a project. + */ + export interface Schema$ListWorkflowTemplatesResponse { + /** + * Output only. This token is included in the response if there are more + * results to fetch. To fetch additional results, provide this value as the + * page_token in a subsequent + * <code>ListWorkflowTemplatesRequest</code>. + */ + nextPageToken: string; + /** + * Output only. WorkflowTemplates list. + */ + templates: Schema$WorkflowTemplate[]; + } /** - * Required. The application name. + * The runtime logging config of the job. */ - name: string; + export interface Schema$LoggingConfig { + /** + * The per-package log levels for the driver. This may include + * "root" package name to configure rootLogger. Examples: + * 'com.google = FATAL', 'root = INFO', 'org.apache = + * DEBUG' + */ + driverLogLevels: any; + } /** - * Required. The numerical progress of the application, from 1 to 100. - */ - progress: number; + * Cluster that is managed by the workflow. + */ + export interface Schema$ManagedCluster { + /** + * Required. The cluster name prefix. A unique cluster name will be formed + * by appending a random suffix.The name must contain only lower-case + * letters (a-z), numbers (0-9), and hyphens (-). Must begin with a letter. + * Cannot begin or end with hyphen. Must consist of between 2 and 35 + * characters. + */ + clusterName: string; + /** + * Required. The cluster configuration. + */ + config: Schema$ClusterConfig; + /** + * Optional. The labels to associate with this cluster.Label keys must be + * between 1 and 63 characters long, and must conform to the following PCRE + * regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and + * 63 characters long, and must conform to the following PCRE regular + * expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be + * associated with a given cluster. + */ + labels: any; + } /** - * Required. The application state. - */ - state: string; + * Specifies the resources used to actively manage an instance group. + */ + export interface Schema$ManagedGroupConfig { + /** + * Output only. The name of the Instance Group Manager for this group. + */ + instanceGroupManagerName: string; + /** + * Output only. The name of the Instance Template used for the Managed + * Instance Group. + */ + instanceTemplateName: string; + } /** - * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or - * TimelineServer that provides application-specific information. The URL uses - * the internal hostname, and requires a proxy server for resolution and, - * possibly, access. - */ - trackingUrl: string; -} - -export class Resource$Projects { - root: Dataproc; - locations: Resource$Projects$Locations; - regions: Resource$Projects$Regions; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - this.regions = new Resource$Projects$Regions(root); + * Specifies an executable to run on a fully configured node and a timeout + * period for executable completion. + */ + export interface Schema$NodeInitializationAction { + /** + * Required. Cloud Storage URI of executable file. + */ + executableFile: string; + /** + * Optional. Amount of time executable has to complete. Default is 10 + * minutes. Cluster creation fails with an explanatory error message (the + * name of the executable that caused the error and the exceeded timeout + * period) if the executable is not completed at end of the timeout period. + */ + executionTimeout: string; } - - getRoot() { - return this.root; + /** + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is false, it means the operation is still in progress. If + * true, the operation is completed, and either error or response is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the name + * should have the format of operations/some/unique/name. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as Delete, the response is + * google.protobuf.Empty. If the original method is standard + * Get/Create/Update, the response should be the resource. For other + * methods, the response should have the type XxxResponse, where Xxx is the + * original method name. For example, if the original method name is + * TakeSnapshot(), the inferred response type is TakeSnapshotResponse. + */ + response: any; } -} -export class Resource$Projects$Locations { - root: Dataproc; - workflowTemplates: Resource$Projects$Locations$Workflowtemplates; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - this.workflowTemplates = - new Resource$Projects$Locations$Workflowtemplates(root); + /** + * A job executed by the workflow. + */ + export interface Schema$OrderedJob { + /** + * Job is a Hadoop job. + */ + hadoopJob: Schema$HadoopJob; + /** + * Job is a Hive job. + */ + hiveJob: Schema$HiveJob; + /** + * Optional. The labels to associate with this job.Label keys must be + * between 1 and 63 characters long, and must conform to the following + * regular expression: \p{Ll}\p{Lo}{0,62}Label values must be between 1 and + * 63 characters long, and must conform to the following regular expression: + * \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels can be associated with a + * given job. + */ + labels: any; + /** + * Job is a Pig job. + */ + pigJob: Schema$PigJob; + /** + * Optional. The optional list of prerequisite job step_ids. If not + * specified, the job will start at the beginning of workflow. + */ + prerequisiteStepIds: string[]; + /** + * Job is a Pyspark job. + */ + pysparkJob: Schema$PySparkJob; + /** + * Optional. Job scheduling configuration. + */ + scheduling: Schema$JobScheduling; + /** + * Job is a Spark job. + */ + sparkJob: Schema$SparkJob; + /** + * Job is a SparkSql job. + */ + sparkSqlJob: Schema$SparkSqlJob; + /** + * Required. The step id. The id must be unique among all jobs within the + * template.The step id is used as prefix for job id, as job + * goog-dataproc-workflow-step-id label, and in prerequisiteStepIds field + * from other steps.The id must contain only letters (a-z, A-Z), numbers + * (0-9), underscores (_), and hyphens (-). Cannot begin or end with + * underscore or hyphen. Must consist of between 3 and 50 characters. + */ + stepId: string; } - - getRoot() { - return this.root; + /** + * A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) + * queries on YARN. + */ + export interface Schema$PigJob { + /** + * Optional. Whether to continue executing queries if a query fails. The + * default value is false. Setting to true can be useful when executing + * independent parallel queries. + */ + continueOnFailure: boolean; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig + * Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Pig. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in /etc/hadoop/conf/*-site.xml, + * /etc/pig/conf/pig.properties, and classes in user code. + */ + properties: any; + /** + * The HCFS URI of the script that contains the Pig queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Pig command: name=[value]). + */ + scriptVariables: any; } -} -export class Resource$Projects$Locations$Workflowtemplates { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources.A Policy + * consists of a list of bindings. A binding binds a list of members to a + * role, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A role is a named list of permissions + * defined by IAM.JSON Example { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] + * }, { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] } YAML + * Example bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: roles/owner + * - members: - user:sean@example.com role: roles/viewer For a description + * of IAM and its features, see the IAM developer's guide + * (https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of members to a role. bindings with no members will + * result in an error. + */ + bindings: Schema$Binding[]; + /** + * etag is used for optimistic concurrency control as a way to help prevent + * simultaneous updates of a policy from overwriting each other. It is + * strongly suggested that systems make use of the etag in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An etag is returned in the response to getIamPolicy, and + * systems are expected to put that etag in the request to setIamPolicy to + * ensure that their change will be applied to the same version of the + * policy.If no etag is provided in the call to setIamPolicy, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - getRoot() { - return this.root; + /** + * A Cloud Dataproc job for running Apache PySpark + * (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) + * applications on YARN. + */ + export interface Schema$PySparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of .jar, .tar, .tar.gz, .tgz, and .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as --conf, that can be set as job properties, since a collision may + * occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS URIs of files to be copied to the working directory of + * Python drivers and distributed tasks. Useful for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python + * driver and tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Required. The HCFS URI of the main Python file to use as the driver. Must + * be a .py file. + */ + mainPythonFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure + * PySpark. Properties that conflict with values set by the Cloud Dataproc + * API may be overwritten. Can include properties set in + * /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties: any; + /** + * Optional. HCFS file URIs of Python files to pass to the PySpark + * framework. Supported file types: .py, .egg, and .zip. + */ + pythonFileUris: string[]; } - - /** - * dataproc.projects.locations.workflowTemplates.create - * @desc Creates new workflow template. - * @alias dataproc.projects.locations.workflowTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of queries to run on a cluster. + */ + export interface Schema$QueryList { + /** + * Required. The queries to execute. You do not need to terminate a query + * with a semicolon. Multiple queries can be specified in one string by + * separating each with a semicolon. Here is an example of an Cloud Dataproc + * API snippet that uses a QueryList to specify a HiveJob: + * "hiveJob": { "queryList": { "queries": [ + * "query1", "query2", "query3;query4", + * ] } } + */ + queries: string[]; } - - /** - * dataproc.projects.locations.workflowTemplates.delete - * @desc Deletes a workflow template. It does not cancel in-progress - * workflows. - * @alias dataproc.projects.locations.workflowTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {integer=} params.version Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for SetIamPolicy method. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the resource. The size of + * the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; } - - /** - * dataproc.projects.locations.workflowTemplates.get - * @desc Retrieves the latest workflow template.Can retrieve previously - * instantiated template by specifying optional version parameter. - * @alias dataproc.projects.locations.workflowTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {integer=} params.version Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the selection and config of software inside the cluster. + */ + export interface Schema$SoftwareConfig { + /** + * Optional. The version of software inside the cluster. It must be one of + * the supported Cloud Dataproc Versions, such as "1.2" (including + * a subminor version, such as "1.2.29"), or the + * "preview" version. If unspecified, it defaults to the latest + * version. + */ + imageVersion: string; + /** + * Optional. The properties to set on daemon config files.Property keys are + * specified in prefix:property format, such as core:fs.defaultFS. The + * following are supported prefixes and their mappings: capacity-scheduler: + * capacity-scheduler.xml core: core-site.xml distcp: distcp-default.xml + * hdfs: hdfs-site.xml hive: hive-site.xml mapred: mapred-site.xml pig: + * pig.properties spark: spark-defaults.conf yarn: yarn-site.xmlFor more + * information, see Cluster properties. + */ + properties: any; } - - /** - * dataproc.projects.locations.workflowTemplates.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias dataproc.projects.locations.workflowTemplates.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) + * applications on YARN. + */ + export interface Schema$SparkJob { + /** + * Optional. HCFS URIs of archives to be extracted in the working directory + * of Spark drivers and tasks. Supported file types: .jar, .tar, .tar.gz, + * .tgz, and .zip. + */ + archiveUris: string[]; + /** + * Optional. The arguments to pass to the driver. Do not include arguments, + * such as --conf, that can be set as job properties, since a collision may + * occur that causes an incorrect job submission. + */ + args: string[]; + /** + * Optional. HCFS URIs of files to be copied to the working directory of + * Spark drivers and distributed tasks. Useful for naively parallel tasks. + */ + fileUris: string[]; + /** + * Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark + * driver and tasks. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * The name of the driver's main class. The jar file that contains the + * class must be in the default CLASSPATH or specified in jar_file_uris. + */ + mainClass: string; + /** + * The HCFS URI of the jar file that contains the main class. + */ + mainJarFileUri: string; + /** + * Optional. A mapping of property names to values, used to configure Spark. + * Properties that conflict with values set by the Cloud Dataproc API may be + * overwritten. Can include properties set in + * /etc/spark/conf/spark-defaults.conf and classes in user code. + */ + properties: any; } - - /** - * dataproc.projects.locations.workflowTemplates.instantiate - * @desc Instantiates a template and begins execution.The returned Operation - * can be used to track execution of workflow by polling operations.get. The - * Operation will complete when entire workflow is finished.The running - * workflow can be aborted via operations.cancel. This will cause any inflight - * jobs to be cancelled and workflow-owned clusters to be deleted.The - * Operation.metadata will be WorkflowMetadata.On successful completion, - * Operation.response will be Empty. - * @alias dataproc.projects.locations.workflowTemplates.instantiate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {().InstantiateWorkflowTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instantiate(params?: any, options?: MethodOptions): - AxiosPromise; - instantiate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - instantiate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}:instantiate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Cloud Dataproc job for running Apache Spark SQL + * (http://spark.apache.org/sql/) queries. + */ + export interface Schema$SparkSqlJob { + /** + * Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. + */ + jarFileUris: string[]; + /** + * Optional. The runtime log config for job execution. + */ + loggingConfig: Schema$LoggingConfig; + /** + * Optional. A mapping of property names to values, used to configure Spark + * SQL's SparkConf. Properties that conflict with values set by the + * Cloud Dataproc API may be overwritten. + */ + properties: any; + /** + * The HCFS URI of the script that contains SQL queries. + */ + queryFileUri: string; + /** + * A list of queries. + */ + queryList: Schema$QueryList; + /** + * Optional. Mapping of query variable names to values (equivalent to the + * Spark SQL command: SET name="value";). + */ + scriptVariables: any; } - - /** - * dataproc.projects.locations.workflowTemplates.instantiateInline - * @desc Instantiates a template and begins execution.This method is - * equivalent to executing the sequence CreateWorkflowTemplate, - * InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation - * can be used to track execution of workflow by polling operations.get. The - * Operation will complete when entire workflow is finished.The running - * workflow can be aborted via operations.cancel. This will cause any inflight - * jobs to be cancelled and workflow-owned clusters to be deleted.The - * Operation.metadata will be WorkflowMetadata.On successful completion, - * Operation.response will be Empty. - * @alias dataproc.projects.locations.workflowTemplates.instantiateInline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.instanceId Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {string} params.parent Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instantiateInline(params?: any, options?: MethodOptions): - AxiosPromise; - instantiateInline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - instantiateInline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/{+parent}/workflowTemplates:instantiateInline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * dataproc.projects.locations.workflowTemplates.list - * @desc Lists workflows that match the specified filter in the request. - * @alias dataproc.projects.locations.workflowTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return in each response. - * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. - * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A request to submit a job. + */ + export interface Schema$SubmitJobRequest { + /** + * Required. The job resource. + */ + job: Schema$Job; + /** + * Optional. A unique id used to identify the request. If the server + * receives two SubmitJobRequest requests with the same id, then the second + * request will be ignored and the first Job created and stored in the + * backend is returned.It is recommended to always set this value to a UUID + * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must + * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and + * hyphens (-). The maximum length is 40 characters. + */ + requestId: string; } - - /** - * dataproc.projects.locations.workflowTemplates.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias dataproc.projects.locations.workflowTemplates.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for TestIamPermissions method. */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the resource. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see IAM Overview + * (https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * dataproc.projects.locations.workflowTemplates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error.Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias dataproc.projects.locations.workflowTemplates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for TestIamPermissions method. */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of TestPermissionsRequest.permissions that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * dataproc.projects.locations.workflowTemplates.update - * @desc Updates (replaces) workflow template. The updated template must - * contain version that matches the current server version. - * @alias dataproc.projects.locations.workflowTemplates.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The workflow graph. */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$WorkflowGraph { + /** + * Output only. The workflow nodes. + */ + nodes: Schema$WorkflowNode[]; } -} - - -export class Resource$Projects$Regions { - root: Dataproc; - clusters: Resource$Projects$Regions$Clusters; - jobs: Resource$Projects$Regions$Jobs; - operations: Resource$Projects$Regions$Operations; - workflowTemplates: Resource$Projects$Regions$Workflowtemplates; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Regions$Clusters(root); - this.jobs = new Resource$Projects$Regions$Jobs(root); - this.operations = new Resource$Projects$Regions$Operations(root); - this.workflowTemplates = - new Resource$Projects$Regions$Workflowtemplates(root); + /** + * A Cloud Dataproc workflow template resource. + */ + export interface Schema$WorkflowMetadata { + /** + * Output only. The name of the managed cluster. + */ + clusterName: string; + /** + * Output only. The create cluster operation metadata. + */ + createCluster: Schema$ClusterOperation; + /** + * Output only. The delete cluster operation metadata. + */ + deleteCluster: Schema$ClusterOperation; + /** + * Output only. The workflow graph. + */ + graph: Schema$WorkflowGraph; + /** + * Map from parameter names to values that were used for those parameters. + */ + parameters: any; + /** + * Output only. The workflow state. + */ + state: string; + /** + * Output only. The "resource name" of the template. + */ + template: string; + /** + * Output only. The version of template at the time of workflow + * instantiation. + */ + version: number; } - - getRoot() { - return this.root; + /** + * The workflow node. + */ + export interface Schema$WorkflowNode { + /** + * Output only. The error detail. + */ + error: string; + /** + * Output only. The job id; populated after the node enters RUNNING state. + */ + jobId: string; + /** + * Output only. Node's prerequisite nodes. + */ + prerequisiteStepIds: string[]; + /** + * Output only. The node state. + */ + state: string; + /** + * Output only. The name of the node. + */ + stepId: string; } -} -export class Resource$Projects$Regions$Clusters { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); + /** + * A Cloud Dataproc workflow template resource. + */ + export interface Schema$WorkflowTemplate { + /** + * Output only. The time template was created. + */ + createTime: string; + /** + * Required. The template id.The id must contain only letters (a-z, A-Z), + * numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end with + * underscore or hyphen. Must consist of between 3 and 50 characters. + */ + id: string; + /** + * Required. The Directed Acyclic Graph of Jobs to submit. + */ + jobs: Schema$OrderedJob[]; + /** + * Optional. The labels to associate with this template. These labels will + * be propagated to all jobs and clusters created by the workflow + * instance.Label keys must contain 1 to 63 characters, and must conform to + * RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label values may be + * empty, but, if present, must contain 1 to 63 characters, and must conform + * to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels + * can be associated with a template. + */ + labels: any; + /** + * Output only. The "resource name" of the template, as described + * in https://cloud.google.com/apis/design/resource_names of the form + * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + */ + name: string; + /** + * Required. WorkflowTemplate scheduling information. + */ + placement: Schema$WorkflowTemplatePlacement; + /** + * Output only. The time template was last updated. + */ + updateTime: string; + /** + * Optional. Used to perform a consistent read-modify-write.This field + * should be left blank for a CreateWorkflowTemplate request. It is required + * for an UpdateWorkflowTemplate request, and must match the current server + * version. A typical update template flow would fetch the current template + * with a GetWorkflowTemplate request, which will return the current + * template with the version field filled in with the current server + * version. The user updates other fields in the template, then returns it + * as part of the UpdateWorkflowTemplate request. + */ + version: number; } - - getRoot() { - return this.root; + /** + * Specifies workflow execution target.Either managed_cluster or + * cluster_selector is required. + */ + export interface Schema$WorkflowTemplatePlacement { + /** + * Optional. A selector that chooses target cluster for jobs based on + * metadata.The selector is evaluated at the time each job is submitted. + */ + clusterSelector: Schema$ClusterSelector; + /** + * Optional. A cluster that is managed by the workflow. + */ + managedCluster: Schema$ManagedCluster; } - - /** - * dataproc.projects.regions.clusters.create - * @desc Creates a cluster in a project. - * @alias dataproc.projects.regions.clusters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {().Cluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A YARN application created by a job. Application information is a subset of + * <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</code>.Beta + * Feature: This report is available for testing purposes only. It may be + * changed before final release. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$YarnApplication { + /** + * Required. The application name. + */ + name: string; + /** + * Required. The numerical progress of the application, from 1 to 100. + */ + progress: number; + /** + * Required. The application state. + */ + state: string; + /** + * Optional. The HTTP URL of the ApplicationMaster, HistoryServer, or + * TimelineServer that provides application-specific information. The URL + * uses the internal hostname, and requires a proxy server for resolution + * and, possibly, access. + */ + trackingUrl: string; } - - /** - * dataproc.projects.regions.clusters.delete - * @desc Deletes a cluster in a project. - * @alias dataproc.projects.regions.clusters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string=} params.clusterUuid Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Dataproc; + locations: Resource$Projects$Locations; + regions: Resource$Projects$Regions; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); + this.regions = new Resource$Projects$Regions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } + export class Resource$Projects$Locations { + root: Dataproc; + workflowTemplates: Resource$Projects$Locations$Workflowtemplates; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); + this.workflowTemplates = + new Resource$Projects$Locations$Workflowtemplates(root); + } - - /** - * dataproc.projects.regions.clusters.diagnose - * @desc Gets cluster diagnostic information. After the operation completes, - * the Operation.response field contains DiagnoseClusterOutputLocation. - * @alias dataproc.projects.regions.clusters.diagnose - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().DiagnoseClusterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - diagnose(params?: any, options?: MethodOptions): - AxiosPromise; - diagnose( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - diagnose( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Workflowtemplates { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataproc.projects.regions.clusters.get - * @desc Gets the resource representation for a cluster in a project. - * @alias dataproc.projects.regions.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.create + * @desc Creates new workflow template. + * @alias dataproc.projects.locations.workflowTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias dataproc.projects.regions.clusters.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.delete + * @desc Deletes a workflow template. It does not cancel in-progress + * workflows. + * @alias dataproc.projects.locations.workflowTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {integer=} params.version Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.list - * @desc Lists all regions/{region}/clusters in a project. - * @alias dataproc.projects.regions.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * - * @param {integer=} params.pageSize Optional. The standard List page size. - * @param {string=} params.pageToken Optional. The standard List page token. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.get + * @desc Retrieves the latest workflow template.Can retrieve previously + * instantiated template by specifying optional version parameter. + * @alias dataproc.projects.locations.workflowTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {integer=} params.version Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.patch - * @desc Updates a cluster in a project. - * @alias dataproc.projects.regions.clusters.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterName Required. The cluster name. - * @param {string=} params.gracefulDecommissionTimeout Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day.Only supported on Dataproc image versions 1.2 and higher. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {string=} params.updateMask Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } Note: currently only the following fields can be updated:
MaskPurpose
labelsUpdates labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.lifecycle_config.auto_delete_ttlReset MAX TTL duration
config.lifecycle_config.auto_delete_timeUpdate MAX TTL deletion timestamp
config.lifecycle_config.idle_delete_ttlUpdate Idle TTL duration
- * @param {().Cluster} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias dataproc.projects.locations.workflowTemplates.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'region', 'clusterName'], - pathParams: ['clusterName', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias dataproc.projects.regions.clusters.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.instantiate + * @desc Instantiates a template and begins execution.The returned Operation + * can be used to track execution of workflow by polling operations.get. The + * Operation will complete when entire workflow is finished.The running + * workflow can be aborted via operations.cancel. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be + * deleted.The Operation.metadata will be WorkflowMetadata.On successful + * completion, Operation.response will be Empty. + * @alias dataproc.projects.locations.workflowTemplates.instantiate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {().InstantiateWorkflowTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instantiate(params?: any, options?: MethodOptions): + AxiosPromise; + instantiate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + instantiate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}:instantiate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.clusters.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error.Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias dataproc.projects.regions.clusters.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.instantiateInline + * @desc Instantiates a template and begins execution.This method is + * equivalent to executing the sequence CreateWorkflowTemplate, + * InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned + * Operation can be used to track execution of workflow by polling + * operations.get. The Operation will complete when entire workflow is + * finished.The running workflow can be aborted via operations.cancel. This + * will cause any inflight jobs to be cancelled and workflow-owned clusters + * to be deleted.The Operation.metadata will be WorkflowMetadata.On + * successful completion, Operation.response will be Empty. + * @alias dataproc.projects.locations.workflowTemplates.instantiateInline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.instanceId Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} params.parent Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instantiateInline(params?: any, options?: MethodOptions): + AxiosPromise; + instantiateInline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + instantiateInline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta2/{+parent}/workflowTemplates:instantiateInline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Regions$Jobs { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataproc.projects.locations.workflowTemplates.list + * @desc Lists workflows that match the specified filter in the request. + * @alias dataproc.projects.locations.workflowTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return in each response. + * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. + * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - /** - * dataproc.projects.regions.jobs.cancel - * @desc Starts a job cancellation request. To access the job resource after - * cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. - * @alias dataproc.projects.regions.jobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().CancelJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias dataproc.projects.locations.workflowTemplates.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.delete - * @desc Deletes the job from the project. If the job is active, the delete - * fails, and the response returns FAILED_PRECONDITION. - * @alias dataproc.projects.regions.jobs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.locations.workflowTemplates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error.Note: This operation is designed to be + * used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias dataproc.projects.locations.workflowTemplates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.get - * @desc Gets the resource representation for a job in a project. - * @alias dataproc.projects.regions.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataproc.projects.locations.workflowTemplates.update + * @desc Updates (replaces) workflow template. The updated template must + * contain version that matches the current server version. + * @alias dataproc.projects.locations.workflowTemplates.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * dataproc.projects.regions.jobs.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias dataproc.projects.regions.jobs.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Regions { + root: Dataproc; + clusters: Resource$Projects$Regions$Clusters; + jobs: Resource$Projects$Regions$Jobs; + operations: Resource$Projects$Regions$Operations; + workflowTemplates: Resource$Projects$Regions$Workflowtemplates; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Regions$Clusters(root); + this.jobs = new Resource$Projects$Regions$Jobs(root); + this.operations = new Resource$Projects$Regions$Operations(root); + this.workflowTemplates = + new Resource$Projects$Regions$Workflowtemplates(root); } - } - - /** - * dataproc.projects.regions.jobs.list - * @desc Lists regions/{region}/jobs in a project. - * @alias dataproc.projects.regions.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clusterName Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. - * @param {string=} params.filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * - * @param {string=} params.jobStateMatcher Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. - * @param {integer=} params.pageSize Optional. The number of results to return in each response. - * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Regions$Clusters { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataproc.projects.regions.jobs.patch - * @desc Updates a job in a project. - * @alias dataproc.projects.regions.jobs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId Required. The job ID. - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {string=} params.updateMask Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.create + * @desc Creates a cluster in a project. + * @alias dataproc.projects.regions.clusters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {().Cluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'region', 'jobId'], - pathParams: ['jobId', 'projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias dataproc.projects.regions.jobs.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.delete + * @desc Deletes a cluster in a project. + * @alias dataproc.projects.regions.clusters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string=} params.clusterUuid Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.submit - * @desc Submits a job to a cluster. - * @alias dataproc.projects.regions.jobs.submit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. - * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. - * @param {().SubmitJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submit(params?: any, options?: MethodOptions): AxiosPromise; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.diagnose + * @desc Gets cluster diagnostic information. After the operation completes, + * the Operation.response field contains DiagnoseClusterOutputLocation. + * @alias dataproc.projects.regions.clusters.diagnose + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().DiagnoseClusterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + diagnose(params?: any, options?: MethodOptions): + AxiosPromise; + diagnose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + diagnose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/projects/{projectId}/regions/{region}/jobs:submit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'region'], - pathParams: ['projectId', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.jobs.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error.Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias dataproc.projects.regions.jobs.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.get + * @desc Gets the resource representation for a cluster in a project. + * @alias dataproc.projects.regions.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Regions$Operations { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataproc.projects.regions.clusters.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias dataproc.projects.regions.clusters.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataproc.projects.regions.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * Code.CANCELLED. - * @alias dataproc.projects.regions.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.list + * @desc Lists all regions/{region}/clusters in a project. + * @alias dataproc.projects.regions.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = * + * @param {integer=} params.pageSize Optional. The standard List page size. + * @param {string=} params.pageToken Optional. The standard List page token. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * google.rpc.Code.UNIMPLEMENTED. - * @alias dataproc.projects.regions.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.patch + * @desc Updates a cluster in a project. + * @alias dataproc.projects.regions.clusters.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterName Required. The cluster name. + * @param {string=} params.gracefulDecommissionTimeout Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day.Only supported on Dataproc image versions 1.2 and higher. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project the cluster belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.requestId Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {string=} params.updateMask Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } Note: currently only the following fields can be updated:
MaskPurpose
labelsUpdates labels
config.worker_config.num_instancesResize primary worker group
config.secondary_worker_config.num_instancesResize secondary worker group
config.lifecycle_config.auto_delete_ttlReset MAX TTL duration
config.lifecycle_config.auto_delete_timeUpdate MAX TTL deletion timestamp
config.lifecycle_config.idle_delete_ttlUpdate Idle TTL duration
+ * @param {().Cluster} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'region', 'clusterName'], + pathParams: ['clusterName', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias dataproc.projects.regions.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.clusters.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias dataproc.projects.regions.clusters.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.operations.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias dataproc.projects.regions.operations.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dataproc.projects.regions.clusters.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error.Note: This operation is designed to be + * used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias dataproc.projects.regions.clusters.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataproc.projects.regions.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the - * name binding allows API services to override the binding to use different - * resource name schemes, such as users/x/operations. To override the binding, - * API services can add a binding such as "/v1/{name=users/x}/operations" to - * their service configuration. For backwards compatibility, the default name - * includes the operations collection id, however overriding users must ensure - * the name binding is the parent resource, without the operations collection - * id. - * @alias dataproc.projects.regions.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Regions$Jobs { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dataproc.projects.regions.operations.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias dataproc.projects.regions.operations.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.cancel + * @desc Starts a job cancellation request. To access the job resource after + * cancellation, call regions/{region}/jobs.list or + * regions/{region}/jobs.get. + * @alias dataproc.projects.regions.jobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().CancelJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.operations.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error.Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias dataproc.projects.regions.operations.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.delete + * @desc Deletes the job from the project. If the job is active, the delete + * fails, and the response returns FAILED_PRECONDITION. + * @alias dataproc.projects.regions.jobs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Regions$Workflowtemplates { - root: Dataproc; - constructor(root: Dataproc) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dataproc.projects.regions.jobs.get + * @desc Gets the resource representation for a job in a project. + * @alias dataproc.projects.regions.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dataproc.projects.regions.workflowTemplates.create - * @desc Creates new workflow template. - * @alias dataproc.projects.regions.workflowTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias dataproc.projects.regions.jobs.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dataproc.projects.regions.workflowTemplates.delete - * @desc Deletes a workflow template. It does not cancel in-progress - * workflows. - * @alias dataproc.projects.regions.workflowTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {integer=} params.version Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dataproc.projects.regions.jobs.list + * @desc Lists regions/{region}/jobs in a project. + * @alias dataproc.projects.regions.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clusterName Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. + * @param {string=} params.filter Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = * + * @param {string=} params.jobStateMatcher Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored. + * @param {integer=} params.pageSize Optional. The number of results to return in each response. + * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.jobs.patch + * @desc Updates a job in a project. + * @alias dataproc.projects.regions.jobs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId Required. The job ID. + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {string=} params.updateMask Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'region', 'jobId'], + pathParams: ['jobId', 'projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.get - * @desc Retrieves the latest workflow template.Can retrieve previously - * instantiated template by specifying optional version parameter. - * @alias dataproc.projects.regions.workflowTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {integer=} params.version Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.jobs.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias dataproc.projects.regions.jobs.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.jobs.submit + * @desc Submits a job to a cluster. + * @alias dataproc.projects.regions.jobs.submit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Required. The ID of the Google Cloud Platform project that the job belongs to. + * @param {string} params.region Required. The Cloud Dataproc region in which to handle the request. + * @param {().SubmitJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submit(params?: any, options?: MethodOptions): AxiosPromise; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1beta2/projects/{projectId}/regions/{region}/jobs:submit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'region'], + pathParams: ['projectId', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.jobs.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error.Note: This operation is designed to be + * used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias dataproc.projects.regions.jobs.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataproc.projects.regions.workflowTemplates.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias dataproc.projects.regions.workflowTemplates.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Regions$Operations { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, the + * operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to Code.CANCELLED. + * @alias dataproc.projects.regions.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.instantiate - * @desc Instantiates a template and begins execution.The returned Operation - * can be used to track execution of workflow by polling operations.get. The - * Operation will complete when entire workflow is finished.The running - * workflow can be aborted via operations.cancel. This will cause any inflight - * jobs to be cancelled and workflow-owned clusters to be deleted.The - * Operation.metadata will be WorkflowMetadata.On successful completion, - * Operation.response will be Empty. - * @alias dataproc.projects.regions.workflowTemplates.instantiate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {().InstantiateWorkflowTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instantiate(params?: any, options?: MethodOptions): - AxiosPromise; - instantiate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - instantiate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns google.rpc.Code.UNIMPLEMENTED. + * @alias dataproc.projects.regions.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias dataproc.projects.regions.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}:instantiate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.operations.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias dataproc.projects.regions.operations.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.instantiateInline - * @desc Instantiates a template and begins execution.This method is - * equivalent to executing the sequence CreateWorkflowTemplate, - * InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation - * can be used to track execution of workflow by polling operations.get. The - * Operation will complete when entire workflow is finished.The running - * workflow can be aborted via operations.cancel. This will cause any inflight - * jobs to be cancelled and workflow-owned clusters to be deleted.The - * Operation.metadata will be WorkflowMetadata.On successful completion, - * Operation.response will be Empty. - * @alias dataproc.projects.regions.workflowTemplates.instantiateInline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.instanceId Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. - * @param {string} params.parent Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - instantiateInline(params?: any, options?: MethodOptions): - AxiosPromise; - instantiateInline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - instantiateInline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: + * the name binding allows API services to override the binding to use + * different resource name schemes, such as users/x/operations. To override + * the binding, API services can add a binding such as + * "/v1/{name=users/x}/operations" to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias dataproc.projects.regions.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.operations.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias dataproc.projects.regions.operations.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1beta2/{+parent}/workflowTemplates:instantiateInline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.operations.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error.Note: This operation is designed to be + * used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias dataproc.projects.regions.operations.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dataproc.projects.regions.workflowTemplates.list - * @desc Lists workflows that match the specified filter in the request. - * @alias dataproc.projects.regions.workflowTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return in each response. - * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. - * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Regions$Workflowtemplates { + root: Dataproc; + constructor(root: Dataproc) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.workflowTemplates.create + * @desc Creates new workflow template. + * @alias dataproc.projects.regions.workflowTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias dataproc.projects.regions.workflowTemplates.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.workflowTemplates.delete + * @desc Deletes a workflow template. It does not cancel in-progress + * workflows. + * @alias dataproc.projects.regions.workflowTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {integer=} params.version Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.workflowTemplates.get + * @desc Retrieves the latest workflow template.Can retrieve previously + * instantiated template by specifying optional version parameter. + * @alias dataproc.projects.regions.workflowTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {integer=} params.version Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.workflowTemplates.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias dataproc.projects.regions.workflowTemplates.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error.Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias dataproc.projects.regions.workflowTemplates.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.workflowTemplates.instantiate + * @desc Instantiates a template and begins execution.The returned Operation + * can be used to track execution of workflow by polling operations.get. The + * Operation will complete when entire workflow is finished.The running + * workflow can be aborted via operations.cancel. This will cause any + * inflight jobs to be cancelled and workflow-owned clusters to be + * deleted.The Operation.metadata will be WorkflowMetadata.On successful + * completion, Operation.response will be Empty. + * @alias dataproc.projects.regions.workflowTemplates.instantiate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The "resource name" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {().InstantiateWorkflowTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instantiate(params?: any, options?: MethodOptions): + AxiosPromise; + instantiate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + instantiate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}:instantiate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.workflowTemplates.instantiateInline + * @desc Instantiates a template and begins execution.This method is + * equivalent to executing the sequence CreateWorkflowTemplate, + * InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned + * Operation can be used to track execution of workflow by polling + * operations.get. The Operation will complete when entire workflow is + * finished.The running workflow can be aborted via operations.cancel. This + * will cause any inflight jobs to be cancelled and workflow-owned clusters + * to be deleted.The Operation.metadata will be WorkflowMetadata.On + * successful completion, Operation.response will be Empty. + * @alias dataproc.projects.regions.workflowTemplates.instantiateInline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.instanceId Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. + * @param {string} params.parent Required. The "resource name" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + instantiateInline(params?: any, options?: MethodOptions): + AxiosPromise; + instantiateInline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + instantiateInline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1beta2/{+parent}/workflowTemplates:instantiateInline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.workflowTemplates.list + * @desc Lists workflows that match the specified filter in the request. + * @alias dataproc.projects.regions.workflowTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return in each response. + * @param {string=} params.pageToken Optional. The page token, returned by a previous call, to request the next page of results. + * @param {string} params.parent Required. The "resource name" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+parent}/workflowTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dataproc.projects.regions.workflowTemplates.update - * @desc Updates (replaces) workflow template. The updated template must - * contain version that matches the current server version. - * @alias dataproc.projects.regions.workflowTemplates.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} - * @param {().WorkflowTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dataproc.projects.regions.workflowTemplates.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias dataproc.projects.regions.workflowTemplates.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dataproc.projects.regions.workflowTemplates.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error.Note: This operation is designed to be + * used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias dataproc.projects.regions.workflowTemplates.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dataproc.projects.regions.workflowTemplates.update + * @desc Updates (replaces) workflow template. The updated template must + * contain version that matches the current server version. + * @alias dataproc.projects.regions.workflowTemplates.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The "resource name" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id} + * @param {().WorkflowTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dataproc.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/datastore/v1.ts b/src/apis/datastore/v1.ts index 76f14f3aa87..44ae0b0cc12 100644 --- a/src/apis/datastore/v1.ts +++ b/src/apis/datastore/v1.ts @@ -27,1473 +27,1487 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Datastore API - * - * Accesses the schemaless NoSQL database to provide fully managed, robust, - * scalable storage for your application. - * - * @example - * const google = require('googleapis'); - * const datastore = google.datastore('v1'); - * - * @namespace datastore - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Datastore - */ -export class Datastore { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * The request for Datastore.AllocateIds. - */ -export interface Schema$AllocateIdsRequest { - /** - * A list of keys with incomplete key paths for which to allocate IDs. No key - * may be reserved/read-only. - */ - keys: Schema$Key[]; -} -/** - * The response for Datastore.AllocateIds. - */ -export interface Schema$AllocateIdsResponse { - /** - * The keys specified in the request (in the same order), each with its key - * path completed with a newly allocated ID. - */ - keys: Schema$Key[]; -} -/** - * An array value. - */ -export interface Schema$ArrayValue { - /** - * Values in the array. The order of this array may not be preserved if it - * contains a mix of indexed and unindexed values. - */ - values: Schema$Value[]; -} -/** - * The request for Datastore.BeginTransaction. - */ -export interface Schema$BeginTransactionRequest { - /** - * Options for a new transaction. - */ - transactionOptions: Schema$TransactionOptions; -} -/** - * The response for Datastore.BeginTransaction. - */ -export interface Schema$BeginTransactionResponse { - /** - * The transaction identifier (always present). - */ - transaction: string; -} -/** - * The request for Datastore.Commit. - */ -export interface Schema$CommitRequest { - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - */ - mode: string; - /** - * The mutations to perform. When mode is `TRANSACTIONAL`, mutations - * affecting a single entity are applied in order. The following sequences of - * mutations affecting a single entity are not permitted in a single `Commit` - * request: - `insert` followed by `insert` - `update` followed by `insert` - - * `upsert` followed by `insert` - `delete` followed by `update` When mode is - * `NON_TRANSACTIONAL`, no two mutations may affect a single entity. - */ - mutations: Schema$Mutation[]; - /** - * The identifier of the transaction associated with the commit. A transaction - * identifier is returned by a call to Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * The response for Datastore.Commit. - */ -export interface Schema$CommitResponse { - /** - * The number of index entries updated during the commit, or zero if none were - * updated. - */ - indexUpdates: number; - /** - * The result of performing the mutations. The i-th mutation result - * corresponds to the i-th mutation in the request. - */ - mutationResults: Schema$MutationResult[]; -} -/** - * A filter that merges multiple other filters using the given operator. - */ -export interface Schema$CompositeFilter { - /** - * The list of filters to combine. Must contain at least one filter. - */ - filters: Schema$Filter[]; - /** - * The operator for combining multiple filters. - */ - op: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A Datastore data object. An entity is limited to 1 megabyte when stored. - * That _roughly_ corresponds to a limit of 1 megabyte for the serialized form - * of this message. - */ -export interface Schema$Entity { - /** - * The entity's key. An entity must have a key, unless otherwise - * documented (for example, an entity in `Value.entity_value` may have no - * key). An entity's kind is its key path's last element's kind, - * or null if it has no key. - */ - key: Schema$Key; - /** - * The entity's properties. The map's keys are property names. A - * property name matching regex `__.*__` is reserved. A reserved property name - * is forbidden in certain documented contexts. The name must not contain more - * than 500 characters. The name cannot be `""`. - */ - properties: any; -} -/** - * The result of fetching an entity from Datastore. - */ -export interface Schema$EntityResult { - /** - * A cursor that points to the position after the result entity. Set only when - * the `EntityResult` is part of a `QueryResultBatch` message. - */ - cursor: string; - /** - * The resulting entity. - */ - entity: Schema$Entity; - /** - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. This field is set for `FULL` entity - * results. For missing entities in `LookupResponse`, this is the version of - * the snapshot that was used to look up the entity, and it is always set - * except for eventually consistent reads. - */ - version: string; -} -/** - * A holder for any type of filter. - */ -export interface Schema$Filter { - /** - * A composite filter. - */ - compositeFilter: Schema$CompositeFilter; - /** - * A filter on a property. - */ - propertyFilter: Schema$PropertyFilter; -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { - /** - * The time the operation ended, either successfully or otherwise. - */ - endTime: string; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; - /** - * The time that work began on the operation. - */ - startTime: string; - /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { - /** - * If empty, then this represents all kinds. - */ - kinds: string[]; - /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix - * field. The final output location is provided in - * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * The response for - * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only - * present if the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1beta1Progress { - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - */ - workCompleted: string; - /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. - */ - workEstimated: string; -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1CommonMetadata { - /** - * The time the operation ended, either successfully or otherwise. - */ - endTime: string; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; - /** - * The time that work began on the operation. - */ - startTime: string; - /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1EntityFilter { - /** - * If empty, then this represents all kinds. - */ - kinds: string[]; - /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; - /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. - * The final output location is provided in - * google.datastore.admin.v1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * The request for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesRequest { - /** - * Description of what data from the project is included in the export. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * Client-assigned labels. - */ - labels: any; - /** - * Location for the export metadata and data files. The full resource URL of - * the external storage location. Currently, only Google Cloud Storage is - * supported. So output_url_prefix should be of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the - * Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud Storage - * namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * google.datastore.admin.v1.ExportEntitiesResponse.output_url field. That - * value should be used for subsequent ImportEntities operations. By nesting - * the data files deeper, the same Cloud Storage bucket can be used in - * multiple ExportEntities operations without conflict. - */ - outputUrlPrefix: string; -} -/** - * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present if - * the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * The request for google.datastore.admin.v1.DatastoreAdmin.ImportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1ImportEntitiesRequest { - /** - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * google.datastore.admin.v1.ExportEntitiesResponse.output_url. - */ - inputUrl: string; - /** - * Client-assigned labels. - */ - labels: any; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1Progress { - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - */ - workCompleted: string; - /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. - */ - workEstimated: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$GoogleLongrunningListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$GoogleLongrunningOperation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A [GQL - * query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - */ -export interface Schema$GqlQuery { - /** - * When false, the query string must not contain any literals and instead must - * bind all values. For example, `SELECT * FROM Kind WHERE a = 'string - * literal'` is not allowed, while `SELECT * FROM Kind WHERE a = @value` - * is. - */ - allowLiterals: boolean; - /** - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. Key - * must match regex `A-Za-z_$*`, must not match regex `__.*__`, and must not - * be `""`. - */ - namedBindings: any; - /** - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. For each - * binding site numbered i in `query_string`, there must be an i-th numbered - * parameter. The inverse must also be true. - */ - positionalBindings: Schema$GqlQueryParameter[]; - /** - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - */ - queryString: string; -} -/** - * A binding parameter for a GQL query. - */ -export interface Schema$GqlQueryParameter { - /** - * A query cursor. Query cursors are returned in query result batches. - */ - cursor: string; - /** - * A value parameter. - */ - value: Schema$Value; -} -/** - * A unique identifier for an entity. If a key's partition ID or any of its - * path kinds or names are reserved/read-only, the key is reserved/read-only. A - * reserved/read-only key is forbidden in certain documented contexts. - */ -export interface Schema$Key { - /** - * Entities are partitioned into subsets, currently identified by a project ID - * and namespace ID. Queries are scoped to a single partition. - */ - partitionId: Schema$PartitionId; - /** - * The entity path. An entity path consists of one or more elements composed - * of a kind and a string or numerical identifier, which identify entities. - * The first element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of the - * path are called the element's _ancestors_. An entity path is always - * fully complete: *all* of the entity's ancestors are required to be in - * the path along with the entity identifier itself. The only exception is - * that in some documented cases, the identifier in the last path element (for - * the entity) itself may be omitted. For example, the last path element of - * the key of `Mutation.insert` may have no identifier. A path can never be - * empty, and a path can have at most 100 elements. - */ - path: Schema$PathElement[]; -} -/** - * A representation of a kind. - */ -export interface Schema$KindExpression { - /** - * The name of the kind. - */ - name: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * The request for Datastore.Lookup. - */ -export interface Schema$LookupRequest { - /** - * Keys of entities to look up. - */ - keys: Schema$Key[]; - /** - * The options for this lookup request. - */ - readOptions: Schema$ReadOptions; -} -/** - * The response for Datastore.Lookup. - */ -export interface Schema$LookupResponse { - /** - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - */ - deferred: Schema$Key[]; - /** - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - */ - found: Schema$EntityResult[]; - /** - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys in - * the input. - */ - missing: Schema$EntityResult[]; -} -/** - * A mutation to apply to an entity. - */ -export interface Schema$Mutation { - /** - * The version of the entity that this mutation is being applied to. If this - * does not match the current version on the server, the mutation conflicts. - */ - baseVersion: string; - /** - * The key of the entity to delete. The entity may or may not already exist. - * Must have a complete key path and must not be reserved/read-only. - */ - delete: Schema$Key; - /** - * The entity to insert. The entity must not already exist. The entity - * key's final path element may be incomplete. - */ - insert: Schema$Entity; - /** - * The entity to update. The entity must already exist. Must have a complete - * key path. - */ - update: Schema$Entity; - /** - * The entity to upsert. The entity may or may not already exist. The entity - * key's final path element may be incomplete. - */ - upsert: Schema$Entity; -} -/** - * The result of applying a mutation. - */ -export interface Schema$MutationResult { - /** - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - */ - conflictDetected: boolean; - /** - * The automatically allocated key. Set only when the mutation allocated a - * key. - */ - key: Schema$Key; - /** - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version - * will be the version of the current entity or, if no entity is present, a - * version that is strictly greater than the version of any previous entity - * and less than the version of any possible future entity. - */ - version: string; -} -/** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. A partition ID - * contains several dimensions: project ID and namespace ID. Partition - * dimensions: - May be `""`. - Must be valid UTF-8 bytes. - Must - * have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any - * dimension matches regex `__.*__`, the partition is reserved/read-only. A - * reserved/read-only partition ID is forbidden in certain documented contexts. - * Foreign partition IDs (in which the project ID does not match the context - * project ID ) are discouraged. Reads and writes of foreign partition IDs may - * fail if the project is not in an active state. - */ -export interface Schema$PartitionId { - /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; +export namespace datastore_v1 { /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * A (kind, ID/name) pair used to construct a key path. If either name or ID is - * set, the element is complete. If neither is set, the element is incomplete. - */ -export interface Schema$PathElement { - /** - * The auto-allocated ID of the entity. Never equal to zero. Values less than - * zero are discouraged and may not be supported in the future. - */ - id: string; - /** - * The kind of the entity. A kind matching regex `__.*__` is - * reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - kind: string; + * Cloud Datastore API + * + * Accesses the schemaless NoSQL database to provide fully managed, robust, + * scalable storage for your application. + * + * @example + * const google = require('googleapis'); + * const datastore = google.datastore('v1'); + * + * @namespace datastore + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Datastore + */ + export class Datastore { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + /** - * The name of the entity. A name matching regex `__.*__` is - * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. + * The request for Datastore.AllocateIds. */ - name: string; -} -/** - * A representation of a property in a projection. - */ -export interface Schema$Projection { + export interface Schema$AllocateIdsRequest { + /** + * A list of keys with incomplete key paths for which to allocate IDs. No + * key may be reserved/read-only. + */ + keys: Schema$Key[]; + } /** - * The property to project. + * The response for Datastore.AllocateIds. */ - property: Schema$PropertyReference; -} -/** - * A filter on a specific property. - */ -export interface Schema$PropertyFilter { + export interface Schema$AllocateIdsResponse { + /** + * The keys specified in the request (in the same order), each with its key + * path completed with a newly allocated ID. + */ + keys: Schema$Key[]; + } /** - * The operator to filter by. + * An array value. */ - op: string; + export interface Schema$ArrayValue { + /** + * Values in the array. The order of this array may not be preserved if it + * contains a mix of indexed and unindexed values. + */ + values: Schema$Value[]; + } /** - * The property to filter by. + * The request for Datastore.BeginTransaction. */ - property: Schema$PropertyReference; + export interface Schema$BeginTransactionRequest { + /** + * Options for a new transaction. + */ + transactionOptions: Schema$TransactionOptions; + } /** - * The value to compare the property to. + * The response for Datastore.BeginTransaction. */ - value: Schema$Value; -} -/** - * The desired order for a specific property. - */ -export interface Schema$PropertyOrder { + export interface Schema$BeginTransactionResponse { + /** + * The transaction identifier (always present). + */ + transaction: string; + } /** - * The direction to order by. Defaults to `ASCENDING`. - */ - direction: string; + * The request for Datastore.Commit. + */ + export interface Schema$CommitRequest { + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + */ + mode: string; + /** + * The mutations to perform. When mode is `TRANSACTIONAL`, mutations + * affecting a single entity are applied in order. The following sequences + * of mutations affecting a single entity are not permitted in a single + * `Commit` request: - `insert` followed by `insert` - `update` followed by + * `insert` - `upsert` followed by `insert` - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + */ + mutations: Schema$Mutation[]; + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction: string; + } /** - * The property to order by. - */ - property: Schema$PropertyReference; -} -/** - * A reference to a property relative to the kind expressions. - */ -export interface Schema$PropertyReference { + * The response for Datastore.Commit. + */ + export interface Schema$CommitResponse { + /** + * The number of index entries updated during the commit, or zero if none + * were updated. + */ + indexUpdates: number; + /** + * The result of performing the mutations. The i-th mutation result + * corresponds to the i-th mutation in the request. + */ + mutationResults: Schema$MutationResult[]; + } /** - * The name of the property. If name includes "."s, it may be - * interpreted as a property name path. - */ - name: string; -} -/** - * A query for entities. - */ -export interface Schema$Query { + * A filter that merges multiple other filters using the given operator. + */ + export interface Schema$CompositeFilter { + /** + * The list of filters to combine. Must contain at least one filter. + */ + filters: Schema$Filter[]; + /** + * The operator for combining multiple filters. + */ + op: string; + } /** - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties (if - * empty, all results are returned). - */ - distinctOn: Schema$PropertyReference[]; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A Datastore data object. An entity is limited to 1 megabyte when stored. + * That _roughly_ corresponds to a limit of 1 megabyte for the serialized form + * of this message. + */ + export interface Schema$Entity { + /** + * The entity's key. An entity must have a key, unless otherwise + * documented (for example, an entity in `Value.entity_value` may have no + * key). An entity's kind is its key path's last element's kind, + * or null if it has no key. + */ + key: Schema$Key; + /** + * The entity's properties. The map's keys are property names. A + * property name matching regex `__.*__` is reserved. A reserved property + * name is forbidden in certain documented contexts. The name must not + * contain more than 500 characters. The name cannot be `""`. + */ + properties: any; + } /** - * An ending point for the query results. Query cursors are returned in query - * result batches and [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - */ - endCursor: string; + * The result of fetching an entity from Datastore. + */ + export interface Schema$EntityResult { + /** + * A cursor that points to the position after the result entity. Set only + * when the `EntityResult` is part of a `QueryResultBatch` message. + */ + cursor: string; + /** + * The resulting entity. + */ + entity: Schema$Entity; + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. This field is set for `FULL` + * entity results. For missing entities in `LookupResponse`, this is the + * version of the snapshot that was used to look up the entity, and it is + * always set except for eventually consistent reads. + */ + version: string; + } /** - * The filter to apply. - */ - filter: Schema$Filter; + * A holder for any type of filter. + */ + export interface Schema$Filter { + /** + * A composite filter. + */ + compositeFilter: Schema$CompositeFilter; + /** + * A filter on a property. + */ + propertyFilter: Schema$PropertyFilter; + } /** - * The kinds to query (if empty, returns entities of all kinds). Currently at - * most 1 kind may be specified. + * Metadata common to all Datastore Admin operations. */ - kind: Schema$KindExpression[]; + export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * The maximum number of results to return. Applies after all other - * constraints. Optional. Unspecified is interpreted as no limit. Must be - * >= 0 if specified. - */ - limit: number; + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - */ - offset: number; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix + * field. The final output location is provided in + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * The order to apply to the query results (if empty, order is unspecified). - */ - order: Schema$PropertyOrder[]; + * The response for + * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only + * present if the operation completed successfully. + */ + outputUrl: string; + } /** - * The projection to return. Defaults to returning all properties. - */ - projection: Schema$Projection[]; + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url + * field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * A starting point for the query results. Query cursors are returned in query - * result batches and [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - */ - startCursor: string; -} -/** - * A batch of results produced by a query. - */ -export interface Schema$QueryResultBatch { + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1beta1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** - * A cursor that points to the position after the last result in the batch. + * Metadata common to all Datastore Admin operations. */ - endCursor: string; + export interface Schema$GoogleDatastoreAdminV1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * The results for this batch. - */ - entityResults: Schema$EntityResult[]; + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * The result type for every entity in `entity_results`. - */ - entityResultType: string; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. + * The final output location is provided in + * google.datastore.admin.v1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * The state of the query after the current batch. - */ - moreResults: string; + * The request for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesRequest { + /** + * Description of what data from the project is included in the export. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * Client-assigned labels. + */ + labels: any; + /** + * Location for the export metadata and data files. The full resource URL + * of the external storage location. Currently, only Google Cloud Storage is + * supported. So output_url_prefix should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of + * the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For + * more information about Cloud Storage namespace paths, see [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * google.datastore.admin.v1.ExportEntitiesResponse.output_url field. That + * value should be used for subsequent ImportEntities operations. By + * nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + */ + outputUrlPrefix: string; + } /** - * A cursor that points to the position after the last skipped result. Will be - * set when `skipped_results` != 0. + * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. */ - skippedCursor: string; + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present + * if the operation completed successfully. + */ + outputUrl: string; + } /** - * The number of results skipped, typically because of an offset. - */ - skippedResults: number; + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * The version number of the snapshot this batch was returned from. This - * applies to the range of results from the query's `start_cursor` (or the - * beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). In a single transaction, - * subsequent query result batches for the same query can have a greater - * snapshot version number. Each batch's snapshot version is valid for all - * preceding batches. The value will be zero for eventually consistent - * queries. - */ - snapshotVersion: string; -} -/** - * Options specific to read-only transactions. - */ -export interface Schema$ReadOnly {} -/** - * The options shared by read requests. - */ -export interface Schema$ReadOptions { + * The request for google.datastore.admin.v1.DatastoreAdmin.ImportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1ImportEntitiesRequest { + /** + * Optionally specify which kinds/namespaces are to be imported. If + * provided, the list must be a subset of the EntityFilter used in creating + * the export, otherwise a FAILED_PRECONDITION error will be returned. If no + * filter is specified then all entities from the export are imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So input_url should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` + * is an optional Cloud Storage namespace path (this is not a Cloud + * Datastore namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata + * file written by the ExportEntities operation. For more information about + * Cloud Storage namespace paths, see [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * google.datastore.admin.v1.ExportEntitiesResponse.output_url. + */ + inputUrl: string; + /** + * Client-assigned labels. + */ + labels: any; + } /** - * The non-transactional read consistency to use. Cannot be set to `STRONG` - * for global queries. - */ - readConsistency: string; + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** - * The identifier of the transaction in which to read. A transaction - * identifier is returned by a call to Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * Options specific to read / write transactions. - */ -export interface Schema$ReadWrite { + * The response message for Operations.ListOperations. + */ + export interface Schema$GoogleLongrunningListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$GoogleLongrunningOperation[]; + } /** - * The transaction identifier of the transaction being retried. - */ - previousTransaction: string; -} -/** - * The request for Datastore.ReserveIds. - */ -export interface Schema$ReserveIdsRequest { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * If not empty, the ID of the database against which to make the request. - */ - databaseId: string; + * A [GQL + * query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + export interface Schema$GqlQuery { + /** + * When false, the query string must not contain any literals and instead + * must bind all values. For example, `SELECT * FROM Kind WHERE a = + * 'string literal'` is not allowed, while `SELECT * FROM Kind WHERE + * a = @value` is. + */ + allowLiterals: boolean; + /** + * For each non-reserved named binding site in the query string, there must + * be a named parameter with that name, but not necessarily the inverse. Key + * must match regex `A-Za-z_$*`, must not match regex `__.*__`, and must not + * be `""`. + */ + namedBindings: any; + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. For each + * binding site numbered i in `query_string`, there must be an i-th numbered + * parameter. The inverse must also be true. + */ + positionalBindings: Schema$GqlQueryParameter[]; + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + queryString: string; + } /** - * A list of keys with complete key paths whose numeric IDs should not be - * auto-allocated. - */ - keys: Schema$Key[]; -} -/** - * The response for Datastore.ReserveIds. - */ -export interface Schema$ReserveIdsResponse {} -/** - * The request for Datastore.Rollback. - */ -export interface Schema$RollbackRequest { + * A binding parameter for a GQL query. + */ + export interface Schema$GqlQueryParameter { + /** + * A query cursor. Query cursors are returned in query result batches. + */ + cursor: string; + /** + * A value parameter. + */ + value: Schema$Value; + } /** - * The transaction identifier, returned by a call to - * Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * The response for Datastore.Rollback. (an empty message). - */ -export interface Schema$RollbackResponse {} -/** - * The request for Datastore.RunQuery. - */ -export interface Schema$RunQueryRequest { + * A unique identifier for an entity. If a key's partition ID or any of + * its path kinds or names are reserved/read-only, the key is + * reserved/read-only. A reserved/read-only key is forbidden in certain + * documented contexts. + */ + export interface Schema$Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. Queries are scoped to a single partition. + */ + partitionId: Schema$PartitionId; + /** + * The entity path. An entity path consists of one or more elements composed + * of a kind and a string or numerical identifier, which identify entities. + * The first element identifies a _root entity_, the second element + * identifies a _child_ of the root entity, the third element identifies a + * child of the second entity, and so forth. The entities identified by all + * prefixes of the path are called the element's _ancestors_. An entity + * path is always fully complete: *all* of the entity's ancestors are + * required to be in the path along with the entity identifier itself. The + * only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. A path can never be empty, and a path can have at most 100 + * elements. + */ + path: Schema$PathElement[]; + } /** - * The GQL query to run. + * A representation of a kind. */ - gqlQuery: Schema$GqlQuery; + export interface Schema$KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. This partition ID is normalized - * with the standard default context partition ID. - */ - partitionId: Schema$PartitionId; + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * The query to run. - */ - query: Schema$Query; + * The request for Datastore.Lookup. + */ + export interface Schema$LookupRequest { + /** + * Keys of entities to look up. + */ + keys: Schema$Key[]; + /** + * The options for this lookup request. + */ + readOptions: Schema$ReadOptions; + } /** - * The options for this query. - */ - readOptions: Schema$ReadOptions; -} -/** - * The response for Datastore.RunQuery. - */ -export interface Schema$RunQueryResponse { + * The response for Datastore.Lookup. + */ + export interface Schema$LookupResponse { + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + */ + deferred: Schema$Key[]; + /** + * Entities found as `ResultType.FULL` entities. The order of results in + * this field is undefined and has no relation to the order of the keys in + * the input. + */ + found: Schema$EntityResult[]; + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of + * results in this field is undefined and has no relation to the order of + * the keys in the input. + */ + missing: Schema$EntityResult[]; + } /** - * A batch of query results (always present). - */ - batch: Schema$QueryResultBatch; + * A mutation to apply to an entity. + */ + export interface Schema$Mutation { + /** + * The version of the entity that this mutation is being applied to. If this + * does not match the current version on the server, the mutation conflicts. + */ + baseVersion: string; + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + */ + delete: Schema$Key; + /** + * The entity to insert. The entity must not already exist. The entity + * key's final path element may be incomplete. + */ + insert: Schema$Entity; + /** + * The entity to update. The entity must already exist. Must have a complete + * key path. + */ + update: Schema$Entity; + /** + * The entity to upsert. The entity may or may not already exist. The entity + * key's final path element may be incomplete. + */ + upsert: Schema$Entity; + } /** - * The parsed form of the `GqlQuery` from the request, if it was set. - */ - query: Schema$Query; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * The result of applying a mutation. + */ + export interface Schema$MutationResult { + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + */ + conflictDetected: boolean; + /** + * The automatically allocated key. Set only when the mutation allocated a + * key. + */ + key: Schema$Key; + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version + * will be the version of the current entity or, if no entity is present, a + * version that is strictly greater than the version of any previous entity + * and less than the version of any possible future entity. + */ + version: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A partition ID identifies a grouping of entities. The grouping is always by + * project and namespace, however the namespace ID may be empty. A partition + * ID contains several dimensions: project ID and namespace ID. Partition + * dimensions: - May be `""`. - Must be valid UTF-8 bytes. - Must + * have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any + * dimension matches regex `__.*__`, the partition is reserved/read-only. A + * reserved/read-only partition ID is forbidden in certain documented + * contexts. Foreign partition IDs (in which the project ID does not match + * the context project ID ) are discouraged. Reads and writes of foreign + * partition IDs may fail if the project is not in an active state. + */ + export interface Schema$PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * A (kind, ID/name) pair used to construct a key path. If either name or ID + * is set, the element is complete. If neither is set, the element is + * incomplete. + */ + export interface Schema$PathElement { + /** + * The auto-allocated ID of the entity. Never equal to zero. Values less + * than zero are discouraged and may not be supported in the future. + */ + id: string; + /** + * The kind of the entity. A kind matching regex `__.*__` is + * reserved/read-only. A kind must not contain more than 1500 bytes when + * UTF-8 encoded. Cannot be `""`. + */ + kind: string; + /** + * The name of the entity. A name matching regex `__.*__` is + * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 + * encoded. Cannot be `""`. + */ + name: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * A representation of a property in a projection. */ - message: string; -} -/** - * Options for beginning a new transaction. Transactions can be created - * explicitly with calls to Datastore.BeginTransaction or implicitly by setting - * ReadOptions.new_transaction in read requests. - */ -export interface Schema$TransactionOptions { + export interface Schema$Projection { + /** + * The property to project. + */ + property: Schema$PropertyReference; + } /** - * The transaction should only allow reads. - */ - readOnly: Schema$ReadOnly; + * A filter on a specific property. + */ + export interface Schema$PropertyFilter { + /** + * The operator to filter by. + */ + op: string; + /** + * The property to filter by. + */ + property: Schema$PropertyReference; + /** + * The value to compare the property to. + */ + value: Schema$Value; + } /** - * The transaction should allow both reads and writes. - */ - readWrite: Schema$ReadWrite; -} -/** - * A message that can hold any of the supported value types and associated - * metadata. - */ -export interface Schema$Value { + * The desired order for a specific property. + */ + export interface Schema$PropertyOrder { + /** + * The direction to order by. Defaults to `ASCENDING`. + */ + direction: string; + /** + * The property to order by. + */ + property: Schema$PropertyReference; + } /** - * An array value. Cannot contain another array value. A `Value` instance that - * sets field `array_value` must not set fields `meaning` or - * `exclude_from_indexes`. + * A reference to a property relative to the kind expressions. */ - arrayValue: Schema$ArrayValue; + export interface Schema$PropertyReference { + /** + * The name of the property. If name includes "."s, it may be + * interpreted as a property name path. + */ + name: string; + } /** - * A blob value. May have at most 1,000,000 bytes. When `exclude_from_indexes` - * is false, may have at most 1500 bytes. In JSON requests, must be - * base64-encoded. - */ - blobValue: string; + * A query for entities. + */ + export interface Schema$Query { + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + */ + distinctOn: Schema$PropertyReference[]; + /** + * An ending point for the query results. Query cursors are returned in + * query result batches and [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + endCursor: string; + /** + * The filter to apply. + */ + filter: Schema$Filter; + /** + * The kinds to query (if empty, returns entities of all kinds). Currently + * at most 1 kind may be specified. + */ + kind: Schema$KindExpression[]; + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. Unspecified is interpreted as no limit. Must be + * >= 0 if specified. + */ + limit: number; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + */ + offset: number; + /** + * The order to apply to the query results (if empty, order is unspecified). + */ + order: Schema$PropertyOrder[]; + /** + * The projection to return. Defaults to returning all properties. + */ + projection: Schema$Projection[]; + /** + * A starting point for the query results. Query cursors are returned in + * query result batches and [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + startCursor: string; + } /** - * A boolean value. - */ - booleanValue: boolean; + * A batch of results produced by a query. + */ + export interface Schema$QueryResultBatch { + /** + * A cursor that points to the position after the last result in the batch. + */ + endCursor: string; + /** + * The results for this batch. + */ + entityResults: Schema$EntityResult[]; + /** + * The result type for every entity in `entity_results`. + */ + entityResultType: string; + /** + * The state of the query after the current batch. + */ + moreResults: string; + /** + * A cursor that points to the position after the last skipped result. Will + * be set when `skipped_results` != 0. + */ + skippedCursor: string; + /** + * The number of results skipped, typically because of an offset. + */ + skippedResults: number; + /** + * The version number of the snapshot this batch was returned from. This + * applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). In a single + * transaction, subsequent query result batches for the same query can have + * a greater snapshot version number. Each batch's snapshot version is + * valid for all preceding batches. The value will be zero for eventually + * consistent queries. + */ + snapshotVersion: string; + } /** - * A double value. + * Options specific to read-only transactions. */ - doubleValue: number; + export interface Schema$ReadOnly {} /** - * An entity value. - May have no key. - May have a key with an incomplete - * key path. - May have a reserved/read-only key. + * The options shared by read requests. */ - entityValue: Schema$Entity; + export interface Schema$ReadOptions { + /** + * The non-transactional read consistency to use. Cannot be set to `STRONG` + * for global queries. + */ + readConsistency: string; + /** + * The identifier of the transaction in which to read. A transaction + * identifier is returned by a call to Datastore.BeginTransaction. + */ + transaction: string; + } /** - * If the value should be excluded from all indexes including those defined - * explicitly. + * Options specific to read / write transactions. */ - excludeFromIndexes: boolean; + export interface Schema$ReadWrite { + /** + * The transaction identifier of the transaction being retried. + */ + previousTransaction: string; + } /** - * A geo point value representing a point on the surface of Earth. - */ - geoPointValue: Schema$LatLng; + * The request for Datastore.ReserveIds. + */ + export interface Schema$ReserveIdsRequest { + /** + * If not empty, the ID of the database against which to make the request. + */ + databaseId: string; + /** + * A list of keys with complete key paths whose numeric IDs should not be + * auto-allocated. + */ + keys: Schema$Key[]; + } /** - * An integer value. + * The response for Datastore.ReserveIds. */ - integerValue: string; + export interface Schema$ReserveIdsResponse {} /** - * A key value. + * The request for Datastore.Rollback. */ - keyValue: Schema$Key; + export interface Schema$RollbackRequest { + /** + * The transaction identifier, returned by a call to + * Datastore.BeginTransaction. + */ + transaction: string; + } /** - * The `meaning` field should only be populated for backwards compatibility. - */ - meaning: number; + * The response for Datastore.Rollback. (an empty message). + */ + export interface Schema$RollbackResponse {} + /** + * The request for Datastore.RunQuery. + */ + export interface Schema$RunQueryRequest { + /** + * The GQL query to run. + */ + gqlQuery: Schema$GqlQuery; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. This partition ID is normalized + * with the standard default context partition ID. + */ + partitionId: Schema$PartitionId; + /** + * The query to run. + */ + query: Schema$Query; + /** + * The options for this query. + */ + readOptions: Schema$ReadOptions; + } /** - * A null value. - */ - nullValue: string; + * The response for Datastore.RunQuery. + */ + export interface Schema$RunQueryResponse { + /** + * A batch of query results (always present). + */ + batch: Schema$QueryResultBatch; + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + */ + query: Schema$Query; + } /** - * A UTF-8 encoded string value. When `exclude_from_indexes` is false (it is - * indexed) , may have at most 1500 bytes. Otherwise, may be set to at least - * 1,000,000 bytes. - */ - stringValue: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * A timestamp value. When stored in the Datastore, precise only to - * microseconds; any additional precision is rounded down. - */ - timestampValue: string; -} - -export class Resource$Projects { - root: Datastore; - operations: Resource$Projects$Operations; - constructor(root: Datastore) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Projects$Operations(root); + * Options for beginning a new transaction. Transactions can be created + * explicitly with calls to Datastore.BeginTransaction or implicitly by + * setting ReadOptions.new_transaction in read requests. + */ + export interface Schema$TransactionOptions { + /** + * The transaction should only allow reads. + */ + readOnly: Schema$ReadOnly; + /** + * The transaction should allow both reads and writes. + */ + readWrite: Schema$ReadWrite; } - - getRoot() { - return this.root; + /** + * A message that can hold any of the supported value types and associated + * metadata. + */ + export interface Schema$Value { + /** + * An array value. Cannot contain another array value. A `Value` instance + * that sets field `array_value` must not set fields `meaning` or + * `exclude_from_indexes`. + */ + arrayValue: Schema$ArrayValue; + /** + * A blob value. May have at most 1,000,000 bytes. When + * `exclude_from_indexes` is false, may have at most 1500 bytes. In JSON + * requests, must be base64-encoded. + */ + blobValue: string; + /** + * A boolean value. + */ + booleanValue: boolean; + /** + * A double value. + */ + doubleValue: number; + /** + * An entity value. - May have no key. - May have a key with an incomplete + * key path. - May have a reserved/read-only key. + */ + entityValue: Schema$Entity; + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + */ + excludeFromIndexes: boolean; + /** + * A geo point value representing a point on the surface of Earth. + */ + geoPointValue: Schema$LatLng; + /** + * An integer value. + */ + integerValue: string; + /** + * A key value. + */ + keyValue: Schema$Key; + /** + * The `meaning` field should only be populated for backwards compatibility. + */ + meaning: number; + /** + * A null value. + */ + nullValue: string; + /** + * A UTF-8 encoded string value. When `exclude_from_indexes` is false (it is + * indexed) , may have at most 1500 bytes. Otherwise, may be set to at least + * 1,000,000 bytes. + */ + stringValue: string; + /** + * A timestamp value. When stored in the Datastore, precise only to + * microseconds; any additional precision is rounded down. + */ + timestampValue: string; } - - /** - * datastore.projects.allocateIds - * @desc Allocates IDs for the given keys, which is useful for referencing an - * entity before it is inserted. - * @alias datastore.projects.allocateIds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().AllocateIdsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - allocateIds(params?: any, options?: MethodOptions): - AxiosPromise; - allocateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - allocateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Datastore; + operations: Resource$Projects$Operations; + constructor(root: Datastore) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Projects$Operations(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:allocateIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * datastore.projects.beginTransaction - * @desc Begins a new transaction. - * @alias datastore.projects.beginTransaction - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().BeginTransactionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - beginTransaction(params?: any, options?: MethodOptions): - AxiosPromise; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datastore.projects.allocateIds + * @desc Allocates IDs for the given keys, which is useful for referencing + * an entity before it is inserted. + * @alias datastore.projects.allocateIds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().AllocateIdsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + allocateIds(params?: any, options?: MethodOptions): + AxiosPromise; + allocateIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + allocateIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:allocateIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:beginTransaction') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.commit - * @desc Commits a transaction, optionally creating, deleting or modifying - * some entities. - * @alias datastore.projects.commit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().CommitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - commit(params?: any, options?: MethodOptions): - AxiosPromise; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datastore.projects.beginTransaction + * @desc Begins a new transaction. + * @alias datastore.projects.beginTransaction + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().BeginTransactionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + beginTransaction(params?: any, options?: MethodOptions): + AxiosPromise; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:beginTransaction') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:commit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.export - * @desc Exports a copy of all or a subset of entities from Google Cloud - * Datastore to another storage system, such as Google Cloud Storage. Recent - * updates to entities may not be reflected in the export. The export occurs - * in the background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * @alias datastore.projects.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID against which to make the request. - * @param {().GoogleDatastoreAdminV1ExportEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): - AxiosPromise; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datastore.projects.commit + * @desc Commits a transaction, optionally creating, deleting or modifying + * some entities. + * @alias datastore.projects.commit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().CommitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + commit(params?: any, options?: MethodOptions): + AxiosPromise; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:commit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * datastore.projects.export + * @desc Exports a copy of all or a subset of entities from Google Cloud + * Datastore to another storage system, such as Google Cloud Storage. Recent + * updates to entities may not be reflected in the export. The export occurs + * in the background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * @alias datastore.projects.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID against which to make the request. + * @param {().GoogleDatastoreAdminV1ExportEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.import - * @desc Imports entities into Google Cloud Datastore. Existing entities with - * the same key are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportEntities operation is cancelled, it is possible that a - * subset of the data has already been imported to Cloud Datastore. - * @alias datastore.projects.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID against which to make the request. - * @param {().GoogleDatastoreAdminV1ImportEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ + /** + * datastore.projects.import + * @desc Imports entities into Google Cloud Datastore. Existing entities + * with the same key are overwritten. The import occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud + * Datastore. + * @alias datastore.projects.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID against which to make the request. + * @param {().GoogleDatastoreAdminV1ImportEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ import(params?: any, options?: MethodOptions): AxiosPromise; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { callback = options; options = {}; - } if(typeof params === 'function') { + } if(typeof params === 'function') { callback = params; params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/projects/{projectId}:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['projectId'], pathParams: ['projectId'], context: this.getRoot()}; if(callback) { + } options = options || {}; const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/projects/{projectId}:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['projectId'], pathParams: ['projectId'], context: this.getRoot()}; if(callback) { createAPIRequest(parameters, callback); - } else { + } else { return createAPIRequest(parameters); - }} + }} - /** + /** * datastore.projects.lookup * @desc Looks up entities by key. * @alias datastore.projects.lookup @@ -1506,458 +1520,465 @@ import(params?: any, options?: MethodOptions|BodyResponseCallback; - lookup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lookup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + lookup(params?: any, options?: MethodOptions): AxiosPromise; + lookup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lookup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:lookup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:lookup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.reserveIds - * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * @alias datastore.projects.reserveIds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().ReserveIdsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reserveIds(params?: any, options?: MethodOptions): - AxiosPromise; - reserveIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reserveIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datastore.projects.reserveIds + * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * @alias datastore.projects.reserveIds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().ReserveIdsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reserveIds(params?: any, options?: MethodOptions): + AxiosPromise; + reserveIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reserveIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:reserveIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:reserveIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.rollback - * @desc Rolls back a transaction. - * @alias datastore.projects.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().RollbackRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datastore.projects.rollback + * @desc Rolls back a transaction. + * @alias datastore.projects.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().RollbackRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.runQuery - * @desc Queries for entities. - * @alias datastore.projects.runQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().RunQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runQuery(params?: any, options?: MethodOptions): - AxiosPromise; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}:runQuery') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datastore.projects.runQuery + * @desc Queries for entities. + * @alias datastore.projects.runQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().RunQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runQuery(params?: any, options?: MethodOptions): + AxiosPromise; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}:runQuery') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Operations { - root: Datastore; - constructor(root: Datastore) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Operations { + root: Datastore; + constructor(root: Datastore) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * datastore.projects.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias datastore.projects.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datastore.projects.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias datastore.projects.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias datastore.projects.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datastore.projects.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias datastore.projects.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias datastore.projects.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datastore.projects.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias datastore.projects.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias datastore.projects.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * datastore.projects.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias datastore.projects.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/datastore/v1beta1.ts b/src/apis/datastore/v1beta1.ts index ec39ce91deb..50918de18d2 100644 --- a/src/apis/datastore/v1beta1.ts +++ b/src/apis/datastore/v1beta1.ts @@ -27,569 +27,578 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Datastore API - * - * Accesses the schemaless NoSQL database to provide fully managed, robust, - * scalable storage for your application. - * - * @example - * const google = require('googleapis'); - * const datastore = google.datastore('v1beta1'); - * - * @namespace datastore - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Datastore - */ -export class Datastore { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace datastore_v1beta1 { + /** + * Cloud Datastore API + * + * Accesses the schemaless NoSQL database to provide fully managed, robust, + * scalable storage for your application. + * + * @example + * const google = require('googleapis'); + * const datastore = google.datastore('v1beta1'); + * + * @namespace datastore + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Datastore + */ + export class Datastore { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { - /** - * The time the operation ended, either successfully or otherwise. - */ - endTime: string; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; - /** - * The time that work began on the operation. - */ - startTime: string; - /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { - /** - * If empty, then this represents all kinds. - */ - kinds: string[]; - /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { /** * Metadata common to all Datastore Admin operations. */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix - * field. The final output location is provided in - * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * The request for google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesRequest { - /** - * Description of what data from the project is included in the export. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * Client-assigned labels. - */ - labels: any; - /** - * Location for the export metadata and data files. The full resource URL of - * the external storage location. Currently, only Google Cloud Storage is - * supported. So output_url_prefix should be of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the - * Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud Storage - * namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. - * That value should be used for subsequent ImportEntities operations. By - * nesting the data files deeper, the same Cloud Storage bucket can be used in - * multiple ExportEntities operations without conflict. - */ - outputUrlPrefix: string; -} -/** - * The response for - * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only - * present if the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * The request for google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesRequest { - /** - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So input_url should be of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * For more information, see - * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. - */ - inputUrl: string; - /** - * Client-assigned labels. - */ - labels: any; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1beta1Progress { - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - */ - workCompleted: string; - /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. - */ - workEstimated: string; -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1CommonMetadata { - /** - * The time the operation ended, either successfully or otherwise. - */ - endTime: string; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; - /** - * The time that work began on the operation. - */ - startTime: string; - /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1EntityFilter { - /** - * If empty, then this represents all kinds. - */ - kinds: string[]; + export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix + * field. The final output location is provided in + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + * The request for + * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesRequest { + /** + * Description of what data from the project is included in the export. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Client-assigned labels. + */ + labels: any; + /** + * Location for the export metadata and data files. The full resource URL + * of the external storage location. Currently, only Google Cloud Storage is + * supported. So output_url_prefix should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of + * the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud + * Storage namespace path (this is not a Cloud Datastore namespace). For + * more information about Cloud Storage namespace paths, see [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * The resulting files will be nested deeper than the specified URL prefix. + * The final output URL will be provided in the + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. + * That value should be used for subsequent ImportEntities operations. By + * nesting the data files deeper, the same Cloud Storage bucket can be used + * in multiple ExportEntities operations without conflict. + */ + outputUrlPrefix: string; + } /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. - * The final output location is provided in - * google.datastore.admin.v1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; + * The response for + * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only + * present if the operation completed successfully. + */ + outputUrl: string; + } /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url + * field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { + * The request for + * google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesRequest { + /** + * Optionally specify which kinds/namespaces are to be imported. If + * provided, the list must be a subset of the EntityFilter used in creating + * the export, otherwise a FAILED_PRECONDITION error will be returned. If no + * filter is specified then all entities from the export are imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The full resource URL of the external storage location. Currently, only + * Google Cloud Storage is supported. So input_url should be of the form: + * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where + * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` + * is an optional Cloud Storage namespace path (this is not a Cloud + * Datastore namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata + * file written by the ExportEntities operation. For more information about + * Cloud Storage namespace paths, see [Object name + * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). + * For more information, see + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + inputUrl: string; + /** + * Client-assigned labels. + */ + labels: any; + } /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present if - * the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1beta1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** * Metadata common to all Datastore Admin operations. */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1Progress { - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - */ - workCompleted: string; - /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. - */ - workEstimated: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; + export interface Schema$GoogleDatastoreAdminV1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. + * The final output location is provided in + * google.datastore.admin.v1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. */ - response: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present + * if the operation completed successfully. + */ + outputUrl: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Projects { - root: Datastore; - constructor(root: Datastore) { - this.root = root; - this.getRoot.bind(this); + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * datastore.projects.export - * @desc Exports a copy of all or a subset of entities from Google Cloud - * Datastore to another storage system, such as Google Cloud Storage. Recent - * updates to entities may not be reflected in the export. The export occurs - * in the background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * @alias datastore.projects.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID against which to make the request. - * @param {().GoogleDatastoreAdminV1beta1ExportEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): - AxiosPromise; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Datastore; + constructor(root: Datastore) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/projects/{projectId}:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * datastore.projects.export + * @desc Exports a copy of all or a subset of entities from Google Cloud + * Datastore to another storage system, such as Google Cloud Storage. Recent + * updates to entities may not be reflected in the export. The export occurs + * in the background and its progress can be monitored and managed via the + * Operation resource that is created. The output of an export may only be + * used once the associated operation is done. If an export operation is + * cancelled before completion it may leave partial data behind in Google + * Cloud Storage. + * @alias datastore.projects.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID against which to make the request. + * @param {().GoogleDatastoreAdminV1beta1ExportEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/projects/{projectId}:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.import - * @desc Imports entities into Google Cloud Datastore. Existing entities with - * the same key are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportEntities operation is cancelled, it is possible that a - * subset of the data has already been imported to Cloud Datastore. - * @alias datastore.projects.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID against which to make the request. - * @param {().GoogleDatastoreAdminV1beta1ImportEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ + /** + * datastore.projects.import + * @desc Imports entities into Google Cloud Datastore. Existing entities + * with the same key are overwritten. The import occurs in the background + * and its progress can be monitored and managed via the Operation resource + * that is created. If an ImportEntities operation is cancelled, it is + * possible that a subset of the data has already been imported to Cloud + * Datastore. + * @alias datastore.projects.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID against which to make the request. + * @param {().GoogleDatastoreAdminV1beta1ImportEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ import(params?: any, options?: MethodOptions): AxiosPromise; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise { if (typeof options === 'function') { - callback = options; - options = {}; + callback = options; + options = {}; } if (typeof params === 'function') { - callback = params; - params = {}; + callback = params; + params = {}; } options = options || {}; const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; @@ -604,10 +613,14 @@ import(params?: any, options?: MethodOptions|BodyResponseCallback(parameters, callback); + createAPIRequest(parameters, callback); } else { - return createAPIRequest(parameters); + return createAPIRequest(parameters); } } } + + + +} diff --git a/src/apis/datastore/v1beta3.ts b/src/apis/datastore/v1beta3.ts index 750c2b54c52..159ad91c132 100644 --- a/src/apis/datastore/v1beta3.ts +++ b/src/apis/datastore/v1beta3.ts @@ -27,1419 +27,1430 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Datastore API - * - * Accesses the schemaless NoSQL database to provide fully managed, robust, - * scalable storage for your application. - * - * @example - * const google = require('googleapis'); - * const datastore = google.datastore('v1beta3'); - * - * @namespace datastore - * @type {Function} - * @version v1beta3 - * @variation v1beta3 - * @param {object=} options Options for Datastore - */ -export class Datastore { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace datastore_v1beta3 { + /** + * Cloud Datastore API + * + * Accesses the schemaless NoSQL database to provide fully managed, robust, + * scalable storage for your application. + * + * @example + * const google = require('googleapis'); + * const datastore = google.datastore('v1beta3'); + * + * @namespace datastore + * @type {Function} + * @version v1beta3 + * @variation v1beta3 + * @param {object=} options Options for Datastore + */ + export class Datastore { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The request for Datastore.AllocateIds. - */ -export interface Schema$AllocateIdsRequest { - /** - * A list of keys with incomplete key paths for which to allocate IDs. No key - * may be reserved/read-only. - */ - keys: Schema$Key[]; -} -/** - * The response for Datastore.AllocateIds. - */ -export interface Schema$AllocateIdsResponse { - /** - * The keys specified in the request (in the same order), each with its key - * path completed with a newly allocated ID. - */ - keys: Schema$Key[]; -} -/** - * An array value. - */ -export interface Schema$ArrayValue { - /** - * Values in the array. The order of this array may not be preserved if it - * contains a mix of indexed and unindexed values. - */ - values: Schema$Value[]; -} -/** - * The request for Datastore.BeginTransaction. - */ -export interface Schema$BeginTransactionRequest { - /** - * Options for a new transaction. - */ - transactionOptions: Schema$TransactionOptions; -} -/** - * The response for Datastore.BeginTransaction. - */ -export interface Schema$BeginTransactionResponse { - /** - * The transaction identifier (always present). - */ - transaction: string; -} -/** - * The request for Datastore.Commit. - */ -export interface Schema$CommitRequest { - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - */ - mode: string; - /** - * The mutations to perform. When mode is `TRANSACTIONAL`, mutations - * affecting a single entity are applied in order. The following sequences of - * mutations affecting a single entity are not permitted in a single `Commit` - * request: - `insert` followed by `insert` - `update` followed by `insert` - - * `upsert` followed by `insert` - `delete` followed by `update` When mode is - * `NON_TRANSACTIONAL`, no two mutations may affect a single entity. - */ - mutations: Schema$Mutation[]; - /** - * The identifier of the transaction associated with the commit. A transaction - * identifier is returned by a call to Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * The response for Datastore.Commit. - */ -export interface Schema$CommitResponse { - /** - * The number of index entries updated during the commit, or zero if none were - * updated. - */ - indexUpdates: number; - /** - * The result of performing the mutations. The i-th mutation result - * corresponds to the i-th mutation in the request. - */ - mutationResults: Schema$MutationResult[]; -} -/** - * A filter that merges multiple other filters using the given operator. - */ -export interface Schema$CompositeFilter { - /** - * The list of filters to combine. Must contain at least one filter. - */ - filters: Schema$Filter[]; - /** - * The operator for combining multiple filters. - */ - op: string; -} -/** - * A Datastore data object. An entity is limited to 1 megabyte when stored. - * That _roughly_ corresponds to a limit of 1 megabyte for the serialized form - * of this message. - */ -export interface Schema$Entity { - /** - * The entity's key. An entity must have a key, unless otherwise - * documented (for example, an entity in `Value.entity_value` may have no - * key). An entity's kind is its key path's last element's kind, - * or null if it has no key. - */ - key: Schema$Key; - /** - * The entity's properties. The map's keys are property names. A - * property name matching regex `__.*__` is reserved. A reserved property name - * is forbidden in certain documented contexts. The name must not contain more - * than 500 characters. The name cannot be `""`. - */ - properties: any; -} -/** - * The result of fetching an entity from Datastore. - */ -export interface Schema$EntityResult { - /** - * A cursor that points to the position after the result entity. Set only when - * the `EntityResult` is part of a `QueryResultBatch` message. - */ - cursor: string; - /** - * The resulting entity. - */ - entity: Schema$Entity; - /** - * The version of the entity, a strictly positive number that monotonically - * increases with changes to the entity. This field is set for `FULL` entity - * results. For missing entities in `LookupResponse`, this is the version of - * the snapshot that was used to look up the entity, and it is always set - * except for eventually consistent reads. - */ - version: string; -} -/** - * A holder for any type of filter. - */ -export interface Schema$Filter { - /** - * A composite filter. - */ - compositeFilter: Schema$CompositeFilter; - /** - * A filter on a property. - */ - propertyFilter: Schema$PropertyFilter; -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { - /** - * The time the operation ended, either successfully or otherwise. - */ - endTime: string; - /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; - /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; - /** - * The time that work began on the operation. - */ - startTime: string; - /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { - /** - * If empty, then this represents all kinds. - */ - kinds: string[]; - /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix - * field. The final output location is provided in - * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * The response for - * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { - /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only - * present if the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { - /** - * Metadata common to all Datastore Admin operations. - */ - common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; /** - * An estimate of the number of bytes processed. + * The request for Datastore.AllocateIds. */ - progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + export interface Schema$AllocateIdsRequest { + /** + * A list of keys with incomplete key paths for which to allocate IDs. No + * key may be reserved/read-only. + */ + keys: Schema$Key[]; + } /** - * An estimate of the number of entities processed. + * The response for Datastore.AllocateIds. */ - progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1beta1Progress { + export interface Schema$AllocateIdsResponse { + /** + * The keys specified in the request (in the same order), each with its key + * path completed with a newly allocated ID. + */ + keys: Schema$Key[]; + } /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. + * An array value. */ - workCompleted: string; + export interface Schema$ArrayValue { + /** + * Values in the array. The order of this array may not be preserved if it + * contains a mix of indexed and unindexed values. + */ + values: Schema$Value[]; + } /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. + * The request for Datastore.BeginTransaction. */ - workEstimated: string; -} -/** - * Metadata common to all Datastore Admin operations. - */ -export interface Schema$GoogleDatastoreAdminV1CommonMetadata { + export interface Schema$BeginTransactionRequest { + /** + * Options for a new transaction. + */ + transactionOptions: Schema$TransactionOptions; + } /** - * The time the operation ended, either successfully or otherwise. + * The response for Datastore.BeginTransaction. */ - endTime: string; + export interface Schema$BeginTransactionResponse { + /** + * The transaction identifier (always present). + */ + transaction: string; + } /** - * The client-assigned labels which were provided when the operation was - * created. May also include additional labels. - */ - labels: any; + * The request for Datastore.Commit. + */ + export interface Schema$CommitRequest { + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + */ + mode: string; + /** + * The mutations to perform. When mode is `TRANSACTIONAL`, mutations + * affecting a single entity are applied in order. The following sequences + * of mutations affecting a single entity are not permitted in a single + * `Commit` request: - `insert` followed by `insert` - `update` followed by + * `insert` - `upsert` followed by `insert` - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + */ + mutations: Schema$Mutation[]; + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction. + */ + transaction: string; + } /** - * The type of the operation. Can be used as a filter in - * ListOperationsRequest. - */ - operationType: string; + * The response for Datastore.Commit. + */ + export interface Schema$CommitResponse { + /** + * The number of index entries updated during the commit, or zero if none + * were updated. + */ + indexUpdates: number; + /** + * The result of performing the mutations. The i-th mutation result + * corresponds to the i-th mutation in the request. + */ + mutationResults: Schema$MutationResult[]; + } /** - * The time that work began on the operation. - */ - startTime: string; + * A filter that merges multiple other filters using the given operator. + */ + export interface Schema$CompositeFilter { + /** + * The list of filters to combine. Must contain at least one filter. + */ + filters: Schema$Filter[]; + /** + * The operator for combining multiple filters. + */ + op: string; + } /** - * The current state of the Operation. - */ - state: string; -} -/** - * Identifies a subset of entities in a project. This is specified as - * combinations of kinds and namespaces (either or both of which may be all, as - * described in the following examples). Example usage: Entire project: - * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: - * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar - * only in the default namespace: kinds=['Foo', 'Bar'], - * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz - * namespaces: kinds=['Foo', 'Bar'], - * namespace_ids=['', 'Baz'] The entire Baz namespace: - * kinds=[], namespace_ids=['Baz'] - */ -export interface Schema$GoogleDatastoreAdminV1EntityFilter { + * A Datastore data object. An entity is limited to 1 megabyte when stored. + * That _roughly_ corresponds to a limit of 1 megabyte for the serialized form + * of this message. + */ + export interface Schema$Entity { + /** + * The entity's key. An entity must have a key, unless otherwise + * documented (for example, an entity in `Value.entity_value` may have no + * key). An entity's kind is its key path's last element's kind, + * or null if it has no key. + */ + key: Schema$Key; + /** + * The entity's properties. The map's keys are property names. A + * property name matching regex `__.*__` is reserved. A reserved property + * name is forbidden in certain documented contexts. The name must not + * contain more than 500 characters. The name cannot be `""`. + */ + properties: any; + } /** - * If empty, then this represents all kinds. - */ - kinds: string[]; + * The result of fetching an entity from Datastore. + */ + export interface Schema$EntityResult { + /** + * A cursor that points to the position after the result entity. Set only + * when the `EntityResult` is part of a `QueryResultBatch` message. + */ + cursor: string; + /** + * The resulting entity. + */ + entity: Schema$Entity; + /** + * The version of the entity, a strictly positive number that monotonically + * increases with changes to the entity. This field is set for `FULL` + * entity results. For missing entities in `LookupResponse`, this is the + * version of the snapshot that was used to look up the entity, and it is + * always set except for eventually consistent reads. + */ + version: string; + } /** - * An empty list represents all namespaces. This is the preferred usage for - * projects that don't use namespaces. An empty string element represents - * the default namespace. This should be used if the project has data in - * non-default namespaces, but doesn't want to include them. Each - * namespace in this list must be unique. - */ - namespaceIds: string[]; -} -/** - * Metadata for ExportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { + * A holder for any type of filter. + */ + export interface Schema$Filter { + /** + * A composite filter. + */ + compositeFilter: Schema$CompositeFilter; + /** + * A filter on a property. + */ + propertyFilter: Schema$PropertyFilter; + } /** * Metadata common to all Datastore Admin operations. */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; + export interface Schema$GoogleDatastoreAdminV1beta1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * Description of which entities are being exported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1beta1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * Location for the export metadata and data files. This will be the same - * value as the - * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. - * The final output location is provided in - * google.datastore.admin.v1.ExportEntitiesResponse.output_url. - */ - outputUrlPrefix: string; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix + * field. The final output location is provided in + * google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; + * The response for + * google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only + * present if the operation completed successfully. + */ + outputUrl: string; + } /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. - */ -export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1beta1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1beta1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1beta1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url + * field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1beta1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1beta1Progress; + } /** - * Location of the output metadata file. This can be used to begin an import - * into Cloud Datastore (this project or another project). See - * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present if - * the operation completed successfully. - */ - outputUrl: string; -} -/** - * Metadata for ImportEntities operations. - */ -export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1beta1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** * Metadata common to all Datastore Admin operations. */ - common: Schema$GoogleDatastoreAdminV1CommonMetadata; - /** - * Description of which entities are being imported. - */ - entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; - /** - * The location of the import metadata file. This will be the same value as - * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. - */ - inputUrl: string; - /** - * An estimate of the number of bytes processed. - */ - progressBytes: Schema$GoogleDatastoreAdminV1Progress; - /** - * An estimate of the number of entities processed. - */ - progressEntities: Schema$GoogleDatastoreAdminV1Progress; -} -/** - * Measures the progress of a particular metric. - */ -export interface Schema$GoogleDatastoreAdminV1Progress { - /** - * The amount of work that has been completed. Note that this may be greater - * than work_estimated. - */ - workCompleted: string; - /** - * An estimate of how much work needs to be performed. May be zero if the work - * estimate is unavailable. - */ - workEstimated: string; -} -/** - * A [GQL - * query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - */ -export interface Schema$GqlQuery { - /** - * When false, the query string must not contain any literals and instead must - * bind all values. For example, `SELECT * FROM Kind WHERE a = 'string - * literal'` is not allowed, while `SELECT * FROM Kind WHERE a = @value` - * is. - */ - allowLiterals: boolean; - /** - * For each non-reserved named binding site in the query string, there must be - * a named parameter with that name, but not necessarily the inverse. Key - * must match regex `A-Za-z_$*`, must not match regex `__.*__`, and must not - * be `""`. - */ - namedBindings: any; - /** - * Numbered binding site @1 references the first numbered parameter, - * effectively using 1-based indexing, rather than the usual 0. For each - * binding site numbered i in `query_string`, there must be an i-th numbered - * parameter. The inverse must also be true. - */ - positionalBindings: Schema$GqlQueryParameter[]; - /** - * A string of the format described - * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - */ - queryString: string; -} -/** - * A binding parameter for a GQL query. - */ -export interface Schema$GqlQueryParameter { - /** - * A query cursor. Query cursors are returned in query result batches. - */ - cursor: string; - /** - * A value parameter. - */ - value: Schema$Value; -} -/** - * A unique identifier for an entity. If a key's partition ID or any of its - * path kinds or names are reserved/read-only, the key is reserved/read-only. A - * reserved/read-only key is forbidden in certain documented contexts. - */ -export interface Schema$Key { - /** - * Entities are partitioned into subsets, currently identified by a project ID - * and namespace ID. Queries are scoped to a single partition. - */ - partitionId: Schema$PartitionId; - /** - * The entity path. An entity path consists of one or more elements composed - * of a kind and a string or numerical identifier, which identify entities. - * The first element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of the - * path are called the element's _ancestors_. An entity path is always - * fully complete: *all* of the entity's ancestors are required to be in - * the path along with the entity identifier itself. The only exception is - * that in some documented cases, the identifier in the last path element (for - * the entity) itself may be omitted. For example, the last path element of - * the key of `Mutation.insert` may have no identifier. A path can never be - * empty, and a path can have at most 100 elements. - */ - path: Schema$PathElement[]; -} -/** - * A representation of a kind. - */ -export interface Schema$KindExpression { - /** - * The name of the kind. - */ - name: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * The request for Datastore.Lookup. - */ -export interface Schema$LookupRequest { - /** - * Keys of entities to look up. - */ - keys: Schema$Key[]; - /** - * The options for this lookup request. - */ - readOptions: Schema$ReadOptions; -} -/** - * The response for Datastore.Lookup. - */ -export interface Schema$LookupResponse { - /** - * A list of keys that were not looked up due to resource constraints. The - * order of results in this field is undefined and has no relation to the - * order of the keys in the input. - */ - deferred: Schema$Key[]; - /** - * Entities found as `ResultType.FULL` entities. The order of results in this - * field is undefined and has no relation to the order of the keys in the - * input. - */ - found: Schema$EntityResult[]; - /** - * Entities not found as `ResultType.KEY_ONLY` entities. The order of results - * in this field is undefined and has no relation to the order of the keys in - * the input. - */ - missing: Schema$EntityResult[]; -} -/** - * A mutation to apply to an entity. - */ -export interface Schema$Mutation { - /** - * The version of the entity that this mutation is being applied to. If this - * does not match the current version on the server, the mutation conflicts. - */ - baseVersion: string; - /** - * The key of the entity to delete. The entity may or may not already exist. - * Must have a complete key path and must not be reserved/read-only. - */ - delete: Schema$Key; - /** - * The entity to insert. The entity must not already exist. The entity - * key's final path element may be incomplete. - */ - insert: Schema$Entity; - /** - * The entity to update. The entity must already exist. Must have a complete - * key path. - */ - update: Schema$Entity; - /** - * The entity to upsert. The entity may or may not already exist. The entity - * key's final path element may be incomplete. - */ - upsert: Schema$Entity; -} -/** - * The result of applying a mutation. - */ -export interface Schema$MutationResult { - /** - * Whether a conflict was detected for this mutation. Always false when a - * conflict detection strategy field is not set in the mutation. - */ - conflictDetected: boolean; - /** - * The automatically allocated key. Set only when the mutation allocated a - * key. - */ - key: Schema$Key; - /** - * The version of the entity on the server after processing the mutation. If - * the mutation doesn't change anything on the server, then the version - * will be the version of the current entity or, if no entity is present, a - * version that is strictly greater than the version of any previous entity - * and less than the version of any possible future entity. - */ - version: string; -} -/** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. A partition ID - * contains several dimensions: project ID and namespace ID. Partition - * dimensions: - May be `""`. - Must be valid UTF-8 bytes. - Must - * have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any - * dimension matches regex `__.*__`, the partition is reserved/read-only. A - * reserved/read-only partition ID is forbidden in certain documented contexts. - * Foreign partition IDs (in which the project ID does not match the context - * project ID ) are discouraged. Reads and writes of foreign partition IDs may - * fail if the project is not in an active state. - */ -export interface Schema$PartitionId { - /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; - /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * A (kind, ID/name) pair used to construct a key path. If either name or ID is - * set, the element is complete. If neither is set, the element is incomplete. - */ -export interface Schema$PathElement { - /** - * The auto-allocated ID of the entity. Never equal to zero. Values less than - * zero are discouraged and may not be supported in the future. - */ - id: string; - /** - * The kind of the entity. A kind matching regex `__.*__` is - * reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - kind: string; - /** - * The name of the entity. A name matching regex `__.*__` is - * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - name: string; -} -/** - * A representation of a property in a projection. - */ -export interface Schema$Projection { - /** - * The property to project. - */ - property: Schema$PropertyReference; -} -/** - * A filter on a specific property. - */ -export interface Schema$PropertyFilter { - /** - * The operator to filter by. - */ - op: string; - /** - * The property to filter by. - */ - property: Schema$PropertyReference; - /** - * The value to compare the property to. - */ - value: Schema$Value; -} -/** - * The desired order for a specific property. - */ -export interface Schema$PropertyOrder { - /** - * The direction to order by. Defaults to `ASCENDING`. - */ - direction: string; - /** - * The property to order by. - */ - property: Schema$PropertyReference; -} -/** - * A reference to a property relative to the kind expressions. - */ -export interface Schema$PropertyReference { - /** - * The name of the property. If name includes "."s, it may be - * interpreted as a property name path. - */ - name: string; -} -/** - * A query for entities. - */ -export interface Schema$Query { - /** - * The properties to make distinct. The query results will contain the first - * result for each distinct combination of values for the given properties (if - * empty, all results are returned). - */ - distinctOn: Schema$PropertyReference[]; - /** - * An ending point for the query results. Query cursors are returned in query - * result batches and [can only be used to limit the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - */ - endCursor: string; - /** - * The filter to apply. - */ - filter: Schema$Filter; - /** - * The kinds to query (if empty, returns entities of all kinds). Currently at - * most 1 kind may be specified. - */ - kind: Schema$KindExpression[]; - /** - * The maximum number of results to return. Applies after all other - * constraints. Optional. Unspecified is interpreted as no limit. Must be - * >= 0 if specified. - */ - limit: number; - /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Optional. Must be >= 0 if specified. - */ - offset: number; - /** - * The order to apply to the query results (if empty, order is unspecified). - */ - order: Schema$PropertyOrder[]; - /** - * The projection to return. Defaults to returning all properties. - */ - projection: Schema$Projection[]; - /** - * A starting point for the query results. Query cursors are returned in query - * result batches and [can only be used to continue the same - * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - */ - startCursor: string; -} -/** - * A batch of results produced by a query. - */ -export interface Schema$QueryResultBatch { - /** - * A cursor that points to the position after the last result in the batch. - */ - endCursor: string; - /** - * The results for this batch. - */ - entityResults: Schema$EntityResult[]; - /** - * The result type for every entity in `entity_results`. - */ - entityResultType: string; + export interface Schema$GoogleDatastoreAdminV1CommonMetadata { + /** + * The time the operation ended, either successfully or otherwise. + */ + endTime: string; + /** + * The client-assigned labels which were provided when the operation was + * created. May also include additional labels. + */ + labels: any; + /** + * The type of the operation. Can be used as a filter in + * ListOperationsRequest. + */ + operationType: string; + /** + * The time that work began on the operation. + */ + startTime: string; + /** + * The current state of the Operation. + */ + state: string; + } /** - * The state of the query after the current batch. - */ - moreResults: string; + * Identifies a subset of entities in a project. This is specified as + * combinations of kinds and namespaces (either or both of which may be all, + * as described in the following examples). Example usage: Entire project: + * kinds=[], namespace_ids=[] Kinds Foo and Bar in all namespaces: + * kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar + * only in the default namespace: kinds=['Foo', 'Bar'], + * namespace_ids=[''] Kinds Foo and Bar in both the default and Baz + * namespaces: kinds=['Foo', 'Bar'], + * namespace_ids=['', 'Baz'] The entire Baz namespace: + * kinds=[], namespace_ids=['Baz'] + */ + export interface Schema$GoogleDatastoreAdminV1EntityFilter { + /** + * If empty, then this represents all kinds. + */ + kinds: string[]; + /** + * An empty list represents all namespaces. This is the preferred usage for + * projects that don't use namespaces. An empty string element + * represents the default namespace. This should be used if the project has + * data in non-default namespaces, but doesn't want to include them. + * Each namespace in this list must be unique. + */ + namespaceIds: string[]; + } /** - * A cursor that points to the position after the last skipped result. Will be - * set when `skipped_results` != 0. - */ - skippedCursor: string; + * Metadata for ExportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being exported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * Location for the export metadata and data files. This will be the same + * value as the + * google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. + * The final output location is provided in + * google.datastore.admin.v1.ExportEntitiesResponse.output_url. + */ + outputUrlPrefix: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * The number of results skipped, typically because of an offset. + * The response for google.datastore.admin.v1.DatastoreAdmin.ExportEntities. */ - skippedResults: number; + export interface Schema$GoogleDatastoreAdminV1ExportEntitiesResponse { + /** + * Location of the output metadata file. This can be used to begin an import + * into Cloud Datastore (this project or another project). See + * google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present + * if the operation completed successfully. + */ + outputUrl: string; + } /** - * The version number of the snapshot this batch was returned from. This - * applies to the range of results from the query's `start_cursor` (or the - * beginning of the query if no cursor was given) to this batch's - * `end_cursor` (not the query's `end_cursor`). In a single transaction, - * subsequent query result batches for the same query can have a greater - * snapshot version number. Each batch's snapshot version is valid for all - * preceding batches. The value will be zero for eventually consistent - * queries. - */ - snapshotVersion: string; -} -/** - * Options specific to read-only transactions. - */ -export interface Schema$ReadOnly {} -/** - * The options shared by read requests. - */ -export interface Schema$ReadOptions { + * Metadata for ImportEntities operations. + */ + export interface Schema$GoogleDatastoreAdminV1ImportEntitiesMetadata { + /** + * Metadata common to all Datastore Admin operations. + */ + common: Schema$GoogleDatastoreAdminV1CommonMetadata; + /** + * Description of which entities are being imported. + */ + entityFilter: Schema$GoogleDatastoreAdminV1EntityFilter; + /** + * The location of the import metadata file. This will be the same value as + * the google.datastore.admin.v1.ExportEntitiesResponse.output_url field. + */ + inputUrl: string; + /** + * An estimate of the number of bytes processed. + */ + progressBytes: Schema$GoogleDatastoreAdminV1Progress; + /** + * An estimate of the number of entities processed. + */ + progressEntities: Schema$GoogleDatastoreAdminV1Progress; + } /** - * The non-transactional read consistency to use. Cannot be set to `STRONG` - * for global queries. - */ - readConsistency: string; + * Measures the progress of a particular metric. + */ + export interface Schema$GoogleDatastoreAdminV1Progress { + /** + * The amount of work that has been completed. Note that this may be greater + * than work_estimated. + */ + workCompleted: string; + /** + * An estimate of how much work needs to be performed. May be zero if the + * work estimate is unavailable. + */ + workEstimated: string; + } /** - * The identifier of the transaction in which to read. A transaction - * identifier is returned by a call to Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * Options specific to read / write transactions. - */ -export interface Schema$ReadWrite { + * A [GQL + * query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + export interface Schema$GqlQuery { + /** + * When false, the query string must not contain any literals and instead + * must bind all values. For example, `SELECT * FROM Kind WHERE a = + * 'string literal'` is not allowed, while `SELECT * FROM Kind WHERE + * a = @value` is. + */ + allowLiterals: boolean; + /** + * For each non-reserved named binding site in the query string, there must + * be a named parameter with that name, but not necessarily the inverse. Key + * must match regex `A-Za-z_$*`, must not match regex `__.*__`, and must not + * be `""`. + */ + namedBindings: any; + /** + * Numbered binding site @1 references the first numbered parameter, + * effectively using 1-based indexing, rather than the usual 0. For each + * binding site numbered i in `query_string`, there must be an i-th numbered + * parameter. The inverse must also be true. + */ + positionalBindings: Schema$GqlQueryParameter[]; + /** + * A string of the format described + * [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). + */ + queryString: string; + } /** - * The transaction identifier of the transaction being retried. - */ - previousTransaction: string; -} -/** - * The request for Datastore.ReserveIds. - */ -export interface Schema$ReserveIdsRequest { + * A binding parameter for a GQL query. + */ + export interface Schema$GqlQueryParameter { + /** + * A query cursor. Query cursors are returned in query result batches. + */ + cursor: string; + /** + * A value parameter. + */ + value: Schema$Value; + } /** - * If not empty, the ID of the database against which to make the request. - */ - databaseId: string; + * A unique identifier for an entity. If a key's partition ID or any of + * its path kinds or names are reserved/read-only, the key is + * reserved/read-only. A reserved/read-only key is forbidden in certain + * documented contexts. + */ + export interface Schema$Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. Queries are scoped to a single partition. + */ + partitionId: Schema$PartitionId; + /** + * The entity path. An entity path consists of one or more elements composed + * of a kind and a string or numerical identifier, which identify entities. + * The first element identifies a _root entity_, the second element + * identifies a _child_ of the root entity, the third element identifies a + * child of the second entity, and so forth. The entities identified by all + * prefixes of the path are called the element's _ancestors_. An entity + * path is always fully complete: *all* of the entity's ancestors are + * required to be in the path along with the entity identifier itself. The + * only exception is that in some documented cases, the identifier in the + * last path element (for the entity) itself may be omitted. For example, + * the last path element of the key of `Mutation.insert` may have no + * identifier. A path can never be empty, and a path can have at most 100 + * elements. + */ + path: Schema$PathElement[]; + } /** - * A list of keys with complete key paths whose numeric IDs should not be - * auto-allocated. + * A representation of a kind. */ - keys: Schema$Key[]; -} -/** - * The response for Datastore.ReserveIds. - */ -export interface Schema$ReserveIdsResponse {} -/** - * The request for Datastore.Rollback. - */ -export interface Schema$RollbackRequest { + export interface Schema$KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * The transaction identifier, returned by a call to - * Datastore.BeginTransaction. - */ - transaction: string; -} -/** - * The response for Datastore.Rollback. (an empty message). - */ -export interface Schema$RollbackResponse {} -/** - * The request for Datastore.RunQuery. - */ -export interface Schema$RunQueryRequest { + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * The GQL query to run. - */ - gqlQuery: Schema$GqlQuery; + * The request for Datastore.Lookup. + */ + export interface Schema$LookupRequest { + /** + * Keys of entities to look up. + */ + keys: Schema$Key[]; + /** + * The options for this lookup request. + */ + readOptions: Schema$ReadOptions; + } /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. This partition ID is normalized - * with the standard default context partition ID. - */ - partitionId: Schema$PartitionId; + * The response for Datastore.Lookup. + */ + export interface Schema$LookupResponse { + /** + * A list of keys that were not looked up due to resource constraints. The + * order of results in this field is undefined and has no relation to the + * order of the keys in the input. + */ + deferred: Schema$Key[]; + /** + * Entities found as `ResultType.FULL` entities. The order of results in + * this field is undefined and has no relation to the order of the keys in + * the input. + */ + found: Schema$EntityResult[]; + /** + * Entities not found as `ResultType.KEY_ONLY` entities. The order of + * results in this field is undefined and has no relation to the order of + * the keys in the input. + */ + missing: Schema$EntityResult[]; + } /** - * The query to run. - */ - query: Schema$Query; + * A mutation to apply to an entity. + */ + export interface Schema$Mutation { + /** + * The version of the entity that this mutation is being applied to. If this + * does not match the current version on the server, the mutation conflicts. + */ + baseVersion: string; + /** + * The key of the entity to delete. The entity may or may not already exist. + * Must have a complete key path and must not be reserved/read-only. + */ + delete: Schema$Key; + /** + * The entity to insert. The entity must not already exist. The entity + * key's final path element may be incomplete. + */ + insert: Schema$Entity; + /** + * The entity to update. The entity must already exist. Must have a complete + * key path. + */ + update: Schema$Entity; + /** + * The entity to upsert. The entity may or may not already exist. The entity + * key's final path element may be incomplete. + */ + upsert: Schema$Entity; + } /** - * The options for this query. - */ - readOptions: Schema$ReadOptions; -} -/** - * The response for Datastore.RunQuery. - */ -export interface Schema$RunQueryResponse { + * The result of applying a mutation. + */ + export interface Schema$MutationResult { + /** + * Whether a conflict was detected for this mutation. Always false when a + * conflict detection strategy field is not set in the mutation. + */ + conflictDetected: boolean; + /** + * The automatically allocated key. Set only when the mutation allocated a + * key. + */ + key: Schema$Key; + /** + * The version of the entity on the server after processing the mutation. If + * the mutation doesn't change anything on the server, then the version + * will be the version of the current entity or, if no entity is present, a + * version that is strictly greater than the version of any previous entity + * and less than the version of any possible future entity. + */ + version: string; + } /** - * A batch of query results (always present). - */ - batch: Schema$QueryResultBatch; + * A partition ID identifies a grouping of entities. The grouping is always by + * project and namespace, however the namespace ID may be empty. A partition + * ID contains several dimensions: project ID and namespace ID. Partition + * dimensions: - May be `""`. - Must be valid UTF-8 bytes. - Must + * have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any + * dimension matches regex `__.*__`, the partition is reserved/read-only. A + * reserved/read-only partition ID is forbidden in certain documented + * contexts. Foreign partition IDs (in which the project ID does not match + * the context project ID ) are discouraged. Reads and writes of foreign + * partition IDs may fail if the project is not in an active state. + */ + export interface Schema$PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * The parsed form of the `GqlQuery` from the request, if it was set. - */ - query: Schema$Query; -} -/** - * Options for beginning a new transaction. Transactions can be created - * explicitly with calls to Datastore.BeginTransaction or implicitly by setting - * ReadOptions.new_transaction in read requests. - */ -export interface Schema$TransactionOptions { + * A (kind, ID/name) pair used to construct a key path. If either name or ID + * is set, the element is complete. If neither is set, the element is + * incomplete. + */ + export interface Schema$PathElement { + /** + * The auto-allocated ID of the entity. Never equal to zero. Values less + * than zero are discouraged and may not be supported in the future. + */ + id: string; + /** + * The kind of the entity. A kind matching regex `__.*__` is + * reserved/read-only. A kind must not contain more than 1500 bytes when + * UTF-8 encoded. Cannot be `""`. + */ + kind: string; + /** + * The name of the entity. A name matching regex `__.*__` is + * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 + * encoded. Cannot be `""`. + */ + name: string; + } /** - * The transaction should only allow reads. + * A representation of a property in a projection. */ - readOnly: Schema$ReadOnly; + export interface Schema$Projection { + /** + * The property to project. + */ + property: Schema$PropertyReference; + } /** - * The transaction should allow both reads and writes. - */ - readWrite: Schema$ReadWrite; -} -/** - * A message that can hold any of the supported value types and associated - * metadata. - */ -export interface Schema$Value { + * A filter on a specific property. + */ + export interface Schema$PropertyFilter { + /** + * The operator to filter by. + */ + op: string; + /** + * The property to filter by. + */ + property: Schema$PropertyReference; + /** + * The value to compare the property to. + */ + value: Schema$Value; + } /** - * An array value. Cannot contain another array value. A `Value` instance that - * sets field `array_value` must not set fields `meaning` or - * `exclude_from_indexes`. - */ - arrayValue: Schema$ArrayValue; + * The desired order for a specific property. + */ + export interface Schema$PropertyOrder { + /** + * The direction to order by. Defaults to `ASCENDING`. + */ + direction: string; + /** + * The property to order by. + */ + property: Schema$PropertyReference; + } /** - * A blob value. May have at most 1,000,000 bytes. When `exclude_from_indexes` - * is false, may have at most 1500 bytes. In JSON requests, must be - * base64-encoded. + * A reference to a property relative to the kind expressions. */ - blobValue: string; + export interface Schema$PropertyReference { + /** + * The name of the property. If name includes "."s, it may be + * interpreted as a property name path. + */ + name: string; + } /** - * A boolean value. - */ - booleanValue: boolean; + * A query for entities. + */ + export interface Schema$Query { + /** + * The properties to make distinct. The query results will contain the first + * result for each distinct combination of values for the given properties + * (if empty, all results are returned). + */ + distinctOn: Schema$PropertyReference[]; + /** + * An ending point for the query results. Query cursors are returned in + * query result batches and [can only be used to limit the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + endCursor: string; + /** + * The filter to apply. + */ + filter: Schema$Filter; + /** + * The kinds to query (if empty, returns entities of all kinds). Currently + * at most 1 kind may be specified. + */ + kind: Schema$KindExpression[]; + /** + * The maximum number of results to return. Applies after all other + * constraints. Optional. Unspecified is interpreted as no limit. Must be + * >= 0 if specified. + */ + limit: number; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Optional. Must be >= 0 if specified. + */ + offset: number; + /** + * The order to apply to the query results (if empty, order is unspecified). + */ + order: Schema$PropertyOrder[]; + /** + * The projection to return. Defaults to returning all properties. + */ + projection: Schema$Projection[]; + /** + * A starting point for the query results. Query cursors are returned in + * query result batches and [can only be used to continue the same + * query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). + */ + startCursor: string; + } /** - * A double value. - */ - doubleValue: number; + * A batch of results produced by a query. + */ + export interface Schema$QueryResultBatch { + /** + * A cursor that points to the position after the last result in the batch. + */ + endCursor: string; + /** + * The results for this batch. + */ + entityResults: Schema$EntityResult[]; + /** + * The result type for every entity in `entity_results`. + */ + entityResultType: string; + /** + * The state of the query after the current batch. + */ + moreResults: string; + /** + * A cursor that points to the position after the last skipped result. Will + * be set when `skipped_results` != 0. + */ + skippedCursor: string; + /** + * The number of results skipped, typically because of an offset. + */ + skippedResults: number; + /** + * The version number of the snapshot this batch was returned from. This + * applies to the range of results from the query's `start_cursor` (or + * the beginning of the query if no cursor was given) to this batch's + * `end_cursor` (not the query's `end_cursor`). In a single + * transaction, subsequent query result batches for the same query can have + * a greater snapshot version number. Each batch's snapshot version is + * valid for all preceding batches. The value will be zero for eventually + * consistent queries. + */ + snapshotVersion: string; + } /** - * An entity value. - May have no key. - May have a key with an incomplete - * key path. - May have a reserved/read-only key. + * Options specific to read-only transactions. */ - entityValue: Schema$Entity; + export interface Schema$ReadOnly {} /** - * If the value should be excluded from all indexes including those defined - * explicitly. + * The options shared by read requests. */ - excludeFromIndexes: boolean; + export interface Schema$ReadOptions { + /** + * The non-transactional read consistency to use. Cannot be set to `STRONG` + * for global queries. + */ + readConsistency: string; + /** + * The identifier of the transaction in which to read. A transaction + * identifier is returned by a call to Datastore.BeginTransaction. + */ + transaction: string; + } /** - * A geo point value representing a point on the surface of Earth. + * Options specific to read / write transactions. */ - geoPointValue: Schema$LatLng; + export interface Schema$ReadWrite { + /** + * The transaction identifier of the transaction being retried. + */ + previousTransaction: string; + } /** - * An integer value. - */ - integerValue: string; + * The request for Datastore.ReserveIds. + */ + export interface Schema$ReserveIdsRequest { + /** + * If not empty, the ID of the database against which to make the request. + */ + databaseId: string; + /** + * A list of keys with complete key paths whose numeric IDs should not be + * auto-allocated. + */ + keys: Schema$Key[]; + } /** - * A key value. + * The response for Datastore.ReserveIds. */ - keyValue: Schema$Key; + export interface Schema$ReserveIdsResponse {} /** - * The `meaning` field should only be populated for backwards compatibility. + * The request for Datastore.Rollback. */ - meaning: number; + export interface Schema$RollbackRequest { + /** + * The transaction identifier, returned by a call to + * Datastore.BeginTransaction. + */ + transaction: string; + } /** - * A null value. - */ - nullValue: string; + * The response for Datastore.Rollback. (an empty message). + */ + export interface Schema$RollbackResponse {} + /** + * The request for Datastore.RunQuery. + */ + export interface Schema$RunQueryRequest { + /** + * The GQL query to run. + */ + gqlQuery: Schema$GqlQuery; + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. This partition ID is normalized + * with the standard default context partition ID. + */ + partitionId: Schema$PartitionId; + /** + * The query to run. + */ + query: Schema$Query; + /** + * The options for this query. + */ + readOptions: Schema$ReadOptions; + } /** - * A UTF-8 encoded string value. When `exclude_from_indexes` is false (it is - * indexed) , may have at most 1500 bytes. Otherwise, may be set to at least - * 1,000,000 bytes. - */ - stringValue: string; + * The response for Datastore.RunQuery. + */ + export interface Schema$RunQueryResponse { + /** + * A batch of query results (always present). + */ + batch: Schema$QueryResultBatch; + /** + * The parsed form of the `GqlQuery` from the request, if it was set. + */ + query: Schema$Query; + } /** - * A timestamp value. When stored in the Datastore, precise only to - * microseconds; any additional precision is rounded down. - */ - timestampValue: string; -} - -export class Resource$Projects { - root: Datastore; - constructor(root: Datastore) { - this.root = root; - this.getRoot.bind(this); + * Options for beginning a new transaction. Transactions can be created + * explicitly with calls to Datastore.BeginTransaction or implicitly by + * setting ReadOptions.new_transaction in read requests. + */ + export interface Schema$TransactionOptions { + /** + * The transaction should only allow reads. + */ + readOnly: Schema$ReadOnly; + /** + * The transaction should allow both reads and writes. + */ + readWrite: Schema$ReadWrite; } - - getRoot() { - return this.root; + /** + * A message that can hold any of the supported value types and associated + * metadata. + */ + export interface Schema$Value { + /** + * An array value. Cannot contain another array value. A `Value` instance + * that sets field `array_value` must not set fields `meaning` or + * `exclude_from_indexes`. + */ + arrayValue: Schema$ArrayValue; + /** + * A blob value. May have at most 1,000,000 bytes. When + * `exclude_from_indexes` is false, may have at most 1500 bytes. In JSON + * requests, must be base64-encoded. + */ + blobValue: string; + /** + * A boolean value. + */ + booleanValue: boolean; + /** + * A double value. + */ + doubleValue: number; + /** + * An entity value. - May have no key. - May have a key with an incomplete + * key path. - May have a reserved/read-only key. + */ + entityValue: Schema$Entity; + /** + * If the value should be excluded from all indexes including those defined + * explicitly. + */ + excludeFromIndexes: boolean; + /** + * A geo point value representing a point on the surface of Earth. + */ + geoPointValue: Schema$LatLng; + /** + * An integer value. + */ + integerValue: string; + /** + * A key value. + */ + keyValue: Schema$Key; + /** + * The `meaning` field should only be populated for backwards compatibility. + */ + meaning: number; + /** + * A null value. + */ + nullValue: string; + /** + * A UTF-8 encoded string value. When `exclude_from_indexes` is false (it is + * indexed) , may have at most 1500 bytes. Otherwise, may be set to at least + * 1,000,000 bytes. + */ + stringValue: string; + /** + * A timestamp value. When stored in the Datastore, precise only to + * microseconds; any additional precision is rounded down. + */ + timestampValue: string; } - - /** - * datastore.projects.allocateIds - * @desc Allocates IDs for the given keys, which is useful for referencing an - * entity before it is inserted. - * @alias datastore.projects.allocateIds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().AllocateIdsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - allocateIds(params?: any, options?: MethodOptions): - AxiosPromise; - allocateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - allocateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Datastore; + constructor(root: Datastore) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:allocateIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * datastore.projects.beginTransaction - * @desc Begins a new transaction. - * @alias datastore.projects.beginTransaction - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().BeginTransactionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - beginTransaction(params?: any, options?: MethodOptions): - AxiosPromise; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datastore.projects.allocateIds + * @desc Allocates IDs for the given keys, which is useful for referencing + * an entity before it is inserted. + * @alias datastore.projects.allocateIds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().AllocateIdsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + allocateIds(params?: any, options?: MethodOptions): + AxiosPromise; + allocateIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + allocateIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:allocateIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:beginTransaction') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.commit - * @desc Commits a transaction, optionally creating, deleting or modifying - * some entities. - * @alias datastore.projects.commit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().CommitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - commit(params?: any, options?: MethodOptions): - AxiosPromise; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:commit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datastore.projects.beginTransaction + * @desc Begins a new transaction. + * @alias datastore.projects.beginTransaction + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().BeginTransactionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + beginTransaction(params?: any, options?: MethodOptions): + AxiosPromise; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:beginTransaction') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.lookup - * @desc Looks up entities by key. - * @alias datastore.projects.lookup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().LookupRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lookup(params?: any, options?: MethodOptions): - AxiosPromise; - lookup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lookup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datastore.projects.commit + * @desc Commits a transaction, optionally creating, deleting or modifying + * some entities. + * @alias datastore.projects.commit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().CommitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + commit(params?: any, options?: MethodOptions): + AxiosPromise; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:commit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:lookup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.reserveIds - * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * @alias datastore.projects.reserveIds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().ReserveIdsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reserveIds(params?: any, options?: MethodOptions): - AxiosPromise; - reserveIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reserveIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * datastore.projects.lookup + * @desc Looks up entities by key. + * @alias datastore.projects.lookup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().LookupRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lookup(params?: any, options?: MethodOptions): + AxiosPromise; + lookup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lookup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:lookup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:reserveIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * datastore.projects.rollback - * @desc Rolls back a transaction. - * @alias datastore.projects.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().RollbackRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * datastore.projects.reserveIds + * @desc Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * @alias datastore.projects.reserveIds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().ReserveIdsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reserveIds(params?: any, options?: MethodOptions): + AxiosPromise; + reserveIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reserveIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:reserveIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * datastore.projects.runQuery - * @desc Queries for entities. - * @alias datastore.projects.runQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the project against which to make the request. - * @param {().RunQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runQuery(params?: any, options?: MethodOptions): - AxiosPromise; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * datastore.projects.rollback + * @desc Rolls back a transaction. + * @alias datastore.projects.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().RollbackRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta3/projects/{projectId}:runQuery') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * datastore.projects.runQuery + * @desc Queries for entities. + * @alias datastore.projects.runQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the project against which to make the request. + * @param {().RunQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runQuery(params?: any, options?: MethodOptions): + AxiosPromise; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://datastore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta3/projects/{projectId}:runQuery') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/deploymentmanager/alpha.ts b/src/apis/deploymentmanager/alpha.ts index 8ff3ecde78a..73e56d5c226 100644 --- a/src/apis/deploymentmanager/alpha.ts +++ b/src/apis/deploymentmanager/alpha.ts @@ -27,3629 +27,3664 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Deployment Manager Alpha API - * - * The Deployment Manager API allows users to declaratively configure, deploy - * and run complex solutions on the Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const deploymentmanager = google.deploymentmanager('alpha'); - * - * @namespace deploymentmanager - * @type {Function} - * @version alpha - * @variation alpha - * @param {object=} options Options for Deploymentmanager - */ -export class Deploymentmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - compositeTypes: Resource$Compositetypes; - deployments: Resource$Deployments; - manifests: Resource$Manifests; - operations: Resource$Operations; - resources: Resource$Resources; - typeProviders: Resource$Typeproviders; - types: Resource$Types; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.compositeTypes = new Resource$Compositetypes(this); - this.deployments = new Resource$Deployments(this); - this.manifests = new Resource$Manifests(this); - this.operations = new Resource$Operations(this); - this.resources = new Resource$Resources(this); - this.typeProviders = new Resource$Typeproviders(this); - this.types = new Resource$Types(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Async options that determine when a resource should finish. - */ -export interface Schema$AsyncOptions { - /** - * Method regex where this policy will apply. - */ - methodMatch: string; - /** - * Deployment manager will poll instances for this API resource setting a - * RUNNING state, and blocking until polling conditions tell whether the - * resource is completed or failed. - */ - pollingOptions: Schema$PollingOptions; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": "allServices" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", }, { "log_type": "ADMIN_READ", } - * ] }, { "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": "DATA_WRITE", - * "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } - * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - exemptedMembers: string[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", } ] } This enables 'DATA_READ' and - * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ - * logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of [Binding.members][]. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Authorization-related information used by Cloud Audit Logging. - */ -export interface Schema$AuthorizationLoggingOptions { - /** - * The type of the permission that was checked. - */ - permissionType: string; -} -/** - * Basic Auth used as a credential. - */ -export interface Schema$BasicAuth { - password: string; - user: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * The condition that is associated with this binding. NOTE: an unsatisfied - * condition will not allow user access via current binding. Different - * bindings, including their conditions, are examined independently. This - * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. - */ - condition: Schema$Expr; - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or without a - * Google account. * `allAuthenticatedUsers`: A special identifier that - * represents anyone who is authenticated with a Google account or a service - * account. * `user:{emailid}`: An email address that represents a specific - * Google account. For example, `alice@gmail.com` or `joe@example.com`. * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. - */ - role: string; -} -/** - * CollectionOverride allows resource handling overrides for specific resources - * within a BaseType - */ -export interface Schema$CollectionOverride { - /** - * The collection that identifies this resource within its service. - */ - collection: string; - /** - * Custom verb method mappings to support unordered list API mappings. - */ - methodMap: Schema$MethodMap; - /** - * The options to apply to this resource-level override - */ - options: Schema$Options; -} -/** - * Holds the composite type. - */ -export interface Schema$CompositeType { - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the composite type was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$CompositeTypeLabelEntry[]; - /** - * Name of the composite type, must follow the expression: - * [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this composite type. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the type provider. - */ - selfLink: string; - status: string; - /** - * Files for the template type. - */ - templateContents: Schema$TemplateContents; -} -export interface Schema$CompositeTypeLabelEntry { - key: string; - value: string; -} -/** - * A response that returns all Composite Types supported by Deployment Manager - */ -export interface Schema$CompositeTypesListResponse { - /** - * Output only. A list of resource composite types supported by Deployment - * Manager. - */ - compositeTypes: Schema$CompositeType[]; - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; -} -/** - * A condition to be met. - */ -export interface Schema$Condition { - /** - * Trusted attributes supplied by the IAM system. - */ - iam: string; - /** - * An operator to apply the subject with. - */ - op: string; - /** - * Trusted attributes discharged by the service. - */ - svc: string; - /** - * Trusted attributes supplied by any service that owns resources and uses the - * IAM system for access control. - */ - sys: string; - /** - * DEPRECATED. Use 'values' instead. - */ - value: string; - /** - * The objects of the condition. This is mutually exclusive with - * 'value'. - */ - values: string[]; -} -export interface Schema$ConfigFile { - /** - * The contents of the file. - */ - content: string; -} -/** - * BaseType that describes a service-backed Type. - */ -export interface Schema$ConfigurableService { - /** - * Allows resource handling overrides for specific collections - */ - collectionOverrides: Schema$CollectionOverride[]; - /** - * Credential used when interacting with this type. - */ - credential: Schema$Credential; - /** - * Descriptor Url for the this type. - */ - descriptorUrl: string; - /** - * Options to apply when handling any resources in this service. - */ - options: Schema$Options; -} -/** - * The credential used by Deployment Manager and TypeProvider. Only one of the - * options is permitted. - */ -export interface Schema$Credential { - /** - * Basic Auth Credential, only used by TypeProvider. - */ - basicAuth: Schema$BasicAuth; - /** - * Service Account Credential, only used by Deployment. - */ - serviceAccount: Schema$ServiceAccount; - /** - * Specify to use the project default credential, only supported by - * Deployment. - */ - useProjectDefault: boolean; -} -export interface Schema$Deployment { - /** - * User provided default credential for the deployment. - */ - credential: Schema$Credential; - /** - * An optional user-provided description of the deployment. - */ - description: string; - /** - * Provides a fingerprint to use in requests to modify a deployment, such as - * update(), stop(), and cancelPreview() requests. A fingerprint is a randomly - * generated value that must be provided with update(), stop(), and - * cancelPreview() requests to perform optimistic locking. This ensures - * optimistic concurrency so that only one request happens at a time. The - * fingerprint is initially generated by Deployment Manager and changes after - * every request to modify data. To get the latest fingerprint value, perform - * a get() request to a deployment. - */ - fingerprint: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the deployment was created, in RFC3339 text - * format . - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentLabelEntry[]; - /** - * Output only. URL of the manifest representing the last manifest that was - * successfully deployed. - */ - manifest: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must - * be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this deployment. - */ - operation: Schema$Operation; - /** - * Output only. Map of outputs from the last manifest that deployed - * successfully. - */ - outputs: Schema$DeploymentOutputsEntry[]; - /** - * Output only. Self link for the deployment. - */ - selfLink: string; - /** - * [Input Only] The parameters that define your deployment, including the - * deployment configuration and relevant templates. - */ - target: Schema$TargetConfiguration; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this deployment, the updated configuration appears here. - */ - update: Schema$DeploymentUpdate; -} -export interface Schema$DeploymentLabelEntry { - key: string; - value: string; -} -export interface Schema$DeploymentOutputsEntry { - key: string; - value: string; -} -export interface Schema$DeploymentsCancelPreviewRequest { - /** - * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a - * randomly generated value that must be provided in cancelPreview() requests - * to perform optimistic locking. This ensures optimistic concurrency so that - * the deployment does not have conflicting requests (e.g. if someone attempts - * to make a new update request while another user attempts to cancel a - * preview, this would prevent one of the requests). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -/** - * A response containing a partial list of deployments and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$DeploymentsListResponse { - /** - * Output only. The deployments contained in this response. - */ - deployments: Schema$Deployment[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -export interface Schema$DeploymentsStopRequest { - /** - * Specifies a fingerprint for stop() requests. A fingerprint is a randomly - * generated value that must be provided in stop() requests to perform - * optimistic locking. This ensures optimistic concurrency so that the - * deployment does not have conflicting requests (e.g. if someone attempts to - * make a new update request while another user attempts to stop an ongoing - * update request, this would prevent a collision). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -export interface Schema$DeploymentUpdate { - /** - * Output only. The user-provided default credential to use when deploying - * this preview. - */ - credential: Schema$Credential; - /** - * Output only. An optional user-provided description of the deployment after - * the current update has been applied. - */ - description: string; - /** - * Output only. Map of labels; provided by the client when the resource is - * created or updated. Specifically: Label keys must be between 1 and 63 - * characters long and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentUpdateLabelEntry[]; - /** - * Output only. URL of the manifest representing the update configuration of - * this deployment. - */ - manifest: string; -} -export interface Schema$DeploymentUpdateLabelEntry { - key: string; - value: string; -} -export interface Schema$Diagnostic { - /** - * JsonPath expression on the resource that if non empty, indicates that this - * field needs to be extracted as a diagnostic. - */ - field: string; - /** - * Level to record this diagnostic. - */ - level: string; -} -/** - * Represents an expression text. Example: title: "User account - * presence" description: "Determines whether the request has a user - * account" expression: "size(request.user) > 0" - */ -export interface Schema$Expr { - /** - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - */ - description: string; - /** - * Textual representation of an expression in Common Expression Language - * syntax. The application context of the containing message determines which - * well-known feature set of CEL is supported. - */ - expression: string; - /** - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - */ - location: string; - /** - * An optional title for the expression, i.e. a short string describing its - * purpose. This can be used e.g. in UIs which allow to enter the expression. - */ - title: string; -} -export interface Schema$ImportFile { - /** - * The contents of the file. - */ - content: string; - /** - * The name of the file. - */ - name: string; -} -/** - * InputMapping creates a 'virtual' property that will be injected into - * the properties before sending the request to the underlying API. - */ -export interface Schema$InputMapping { - /** - * The name of the field that is going to be injected. - */ - fieldName: string; - /** - * The location where this mapping applies. - */ - location: string; - /** - * Regex to evaluate on method to decide if input applies. - */ - methodMatch: string; - /** - * A jsonPath expression to select an element. - */ - value: string; -} -/** - * Specifies what kind of log the caller must write - */ -export interface Schema$LogConfig { - /** - * Cloud audit options. - */ - cloudAudit: Schema$LogConfigCloudAuditOptions; - /** - * Counter options. - */ - counter: Schema$LogConfigCounterOptions; - /** - * Data access options. - */ - dataAccess: Schema$LogConfigDataAccessOptions; -} -/** - * Write a Cloud Audit log - */ -export interface Schema$LogConfigCloudAuditOptions { - /** - * Information used by the Cloud Audit Logging pipeline. - */ - authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; - /** - * The log_name to populate in the Cloud Audit Record. - */ - logName: string; -} -/** - * Increment a streamz counter with the specified metric and field names. Metric - * names should start with a '/', generally be lowercase-only, and end - * in "_count". Field names should not contain an initial slash. The - * actual exported metric names will have "/iam/policy" prepended. - * Field names correspond to IAM request parameters and field values are their - * respective values. At present the only supported field names are - - * "iam_principal", corresponding to IAMContext.principal; - - * "" (empty string), resulting in one aggretated counter with no - * field. Examples: counter { metric: "/debug_access_count" field: - * "iam_principal" } ==> increment counter - * /iam/policy/backend_debug_access_count {iam_principal=[value of - * IAMContext.principal]} At this time we do not support: * multiple field - * names (though this may be supported in the future) * decrementing the counter - * * incrementing it by anything other than 1 - */ -export interface Schema$LogConfigCounterOptions { - /** - * The field value to attribute. - */ - field: string; - /** - * The metric to update. - */ - metric: string; -} -/** - * Write a Data Access (Gin) log - */ -export interface Schema$LogConfigDataAccessOptions { - /** - * Whether Gin logging should happen in a fail-closed manner at the caller. - * This is relevant only in the LocalIAM implementation, for now. - */ - logMode: string; -} -export interface Schema$Manifest { - /** - * Output only. The YAML configuration for this manifest. - */ - config: Schema$ConfigFile; - /** - * Output only. The fully-expanded configuration file, including any templates - * and references. - */ - expandedConfig: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. The imported files for this manifest. - */ - imports: Schema$ImportFile[]; - /** - * Output only. Timestamp when the manifest was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Output only. The YAML layout for this manifest. - */ - layout: string; - /** - * Output only. The name of the manifest. - */ - name: string; - /** - * Output only. Self link for the manifest. - */ - selfLink: string; -} -/** - * A response containing a partial list of manifests and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ManifestsListResponse { - /** - * Output only. Manifests contained in this list response. - */ - manifests: Schema$Manifest[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -/** - * Deployment Manager will call these methods during the events of - * creation/deletion/update/get/setIamPolicy - */ -export interface Schema$MethodMap { - /** - * The action identifier for the create method to be used for this collection - */ - create: string; - /** - * The action identifier for the delete method to be used for this collection - */ - delete: string; - /** - * The action identifier for the get method to be used for this collection - */ - get: string; - /** - * The action identifier for the setIamPolicy method to be used for this - * collection - */ - setIamPolicy: string; - /** - * The action identifier for the update method to be used for this collection - */ - update: string; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; - /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -/** - * A response containing a partial list of operations and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$OperationsListResponse { - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. Operations contained in this list response. - */ - operations: Schema$Operation[]; -} -/** - * Options allows customized resource handling by Deployment Manager. - */ -export interface Schema$Options { - /** - * Options regarding how to thread async requests. - */ - asyncOptions: Schema$AsyncOptions[]; - /** - * The mappings that apply for requests. - */ - inputMappings: Schema$InputMapping[]; - /** - * The json path to the field in the resource JSON body into which the - * resource name should be mapped. Leaving this empty indicates that there - * should be no mapping performed. - */ - nameProperty: string; - /** - * Options for how to validate and process properties on a resource. - */ - validationOptions: Schema$ValidationOptions; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a description of IAM and its - * features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - iamOwned: boolean; - /** - * If more than one rule is specified, the rules are applied in the following - * manner: - All matching LOG rules are always applied. - If any - * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if any - * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if no - * rule applies, permission is denied. - */ - rules: Schema$Rule[]; - /** - * Deprecated. - */ - version: number; -} -export interface Schema$PollingOptions { - /** - * An array of diagnostics to be collected by Deployment Manager, these - * diagnostics will be displayed to the user. - */ - diagnostics: Schema$Diagnostic[]; - /** - * JsonPath expression that determines if the request failed. - */ - failCondition: string; - /** - * JsonPath expression that determines if the request is completed. - */ - finishCondition: string; - /** - * JsonPath expression that evaluates to string, it indicates where to poll. - */ - pollingLink: string; - /** - * JsonPath expression, after polling is completed, indicates where to fetch - * the resource. - */ - targetLink: string; -} -export interface Schema$Resource { - /** - * The Access Control Policy set on this resource. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. The evaluated properties of the resource with references - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the resource was created or acquired, in - * RFC3339 text format . - */ - insertTime: string; - /** - * Output only. The last used credential that successfully created/updated the - * resource. - */ - lastUsedCredential: Schema$Credential; - /** - * Output only. URL of the manifest representing the current configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The name of the resource as it appears in the YAML config. - */ - name: string; - /** - * Output only. The current properties of the resource before any references - * have been filled in. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. In case this is an action, it will show the runtimePolicies on - * which this action will run in the deployment - */ - runtimePolicies: string[]; - /** - * Output only. The type of the resource, for example compute.v1.instance, or - * cloudfunctions.v1beta1.function. - */ - type: string; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this resource, the updated configuration appears here. - */ - update: Schema$ResourceUpdate; - /** - * Output only. Timestamp when the resource was updated, in RFC3339 text - * format . - */ - updateTime: string; - /** - * Output only. The URL of the actual resource. - */ - url: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * The access controls set on the resource. - */ -export interface Schema$ResourceAccessControl { - /** - * The GCP IAM Policy to set on the resource. - */ - gcpIamPolicy: string; -} -/** - * A response containing a partial list of resources and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ResourcesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Resources contained in this list response. - */ - resources: Schema$Resource[]; -} -export interface Schema$ResourceUpdate { - /** - * The Access Control Policy to set on this resource after updating the - * resource itself. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. The credential that will be used creating/updating this - * resource. - */ - credential: Schema$Credential; - /** - * Output only. If errors are generated during update of the resource, this - * field will be populated. - */ - error: any; - /** - * Output only. The expanded properties of the resource with reference values - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. - */ - intent: string; - /** - * Output only. URL of the manifest representing the update configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The set of updated properties for this resource, before - * references are expanded. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. In case this is an action, it will show the runtimePolicies - * that this action will have after updating the deployment. - */ - runtimePolicies: string[]; - /** - * Output only. The state of the resource. - */ - state: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * A rule to be applied in a Policy. - */ -export interface Schema$Rule { - /** - * Required - */ - action: string; - /** - * Additional restrictions that must be met. All conditions must pass for the - * rule to match. - */ - conditions: Schema$Condition[]; - /** - * Human-readable description of the rule. - */ - description: string; - /** - * If one or more 'in' clauses are specified, the rule matches if the - * PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - */ - ins: string[]; - /** - * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - * that match the LOG action. - */ - logConfigs: Schema$LogConfig[]; - /** - * If one or more 'not_in' clauses are specified, the rule matches if - * the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - */ - notIns: string[]; - /** - * A permission is a string of form '..' (e.g., - * 'storage.buckets.list'). A value of '*' matches all - * permissions, and a verb part of '*' (e.g., - * 'storage.buckets.*') matches all verbs. - */ - permissions: string[]; -} -/** - * Service Account used as a credential. - */ -export interface Schema$ServiceAccount { - /** - * The IAM service account email address like - * test@myproject.iam.gserviceaccount.com - */ - email: string; -} -export interface Schema$TargetConfiguration { - /** - * The configuration to use for this deployment. - */ - config: Schema$ConfigFile; - /** - * Specifies any files to import for this configuration. This can be used to - * import templates or other files. For example, you might import a text file - * in order to use the file in a template. - */ - imports: Schema$ImportFile[]; -} -/** - * Files that make up the template contents of a template type. - */ -export interface Schema$TemplateContents { - /** - * Import files referenced by the main template. - */ - imports: Schema$ImportFile[]; - /** - * Which interpreter (python or jinja) should be used during expansion. - */ - interpreter: string; - /** - * The filename of the mainTemplate - */ - mainTemplate: string; - /** - * The contents of the template schema. - */ - schema: string; - /** - * The contents of the main template file. - */ - template: string; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A resource type supported by Deployment Manager. - */ -export interface Schema$Type { - /** - * Base Type (configurable service) that backs this Type. - */ - configurableService: Schema$ConfigurableService; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the type was created, in RFC3339 text format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$TypeLabelEntry[]; - /** - * Name of the type. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this type. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the type. - */ - selfLink: string; -} -/** - * Contains detailed information about a composite type, base type, or base type - * with specific collection. - */ -export interface Schema$TypeInfo { - /** - * The description of the type. - */ - description: string; - /** - * For swagger 2.0 externalDocs field will be used. For swagger 1.2 this field - * will be empty. - */ - documentationLink: string; - /** - * Output only. Type of the output. Always deploymentManager#TypeInfo for - * TypeInfo. - */ - kind: string; - /** - * The base type or composite type name. - */ - name: string; - /** - * For base types with a collection, we return a schema and documentation link - * For template types, we return only a schema - */ - schema: Schema$TypeInfoSchemaInfo; - /** - * Output only. Server-defined URL for the resource. - */ - selfLink: string; - /** - * The title on the API descriptor URL provided. - */ - title: string; -} -export interface Schema$TypeInfoSchemaInfo { - /** - * The properties that this composite type or base type collection accept as - * input, represented as a json blob, format is: JSON Schema Draft V4 - */ - input: string; - /** - * The properties that this composite type or base type collection exposes as - * output, these properties can be used for references, represented as json - * blob, format is: JSON Schema Draft V4 - */ - output: string; -} -export interface Schema$TypeLabelEntry { - key: string; - value: string; -} -/** - * A type provider that describes a service-backed Type. - */ -export interface Schema$TypeProvider { - /** - * Allows resource handling overrides for specific collections - */ - collectionOverrides: Schema$CollectionOverride[]; - /** - * Credential used when interacting with this type. - */ - credential: Schema$Credential; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Descriptor Url for the this type provider. - */ - descriptorUrl: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the type provider was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$TypeProviderLabelEntry[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must - * be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this type provider. - */ - operation: Schema$Operation; - /** - * Options to apply when handling any resources in this service. - */ - options: Schema$Options; - /** - * Output only. Self link for the type provider. - */ - selfLink: string; -} -export interface Schema$TypeProviderLabelEntry { - key: string; - value: string; -} -/** - * A response that returns all Type Providers supported by Deployment Manager - */ -export interface Schema$TypeProvidersListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource type providers supported by Deployment - * Manager. - */ - typeProviders: Schema$TypeProvider[]; -} -export interface Schema$TypeProvidersListTypesResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource type info. - */ - types: Schema$TypeInfo[]; -} -/** - * A response that returns all Types supported by Deployment Manager - */ -export interface Schema$TypesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource types supported by Deployment Manager. - */ - types: Schema$Type[]; -} -/** - * Options for how to validate and process properties on a resource. - */ -export interface Schema$ValidationOptions { - /** - * Customize how deployment manager will validate the resource against schema - * errors. - */ - schemaValidation: string; - /** - * Specify what to do with extra properties when executing a request. - */ - undeclaredProperties: string; -} - -export class Resource$Compositetypes { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * deploymentmanager.compositeTypes.delete - * @desc Deletes a composite type. - * @alias deploymentmanager.compositeTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the type for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.compositeTypes.get - * @desc Gets information about a specific composite type. - * @alias deploymentmanager.compositeTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.compositeTypes.insert - * @desc Creates a composite type. - * @alias deploymentmanager.compositeTypes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.compositeTypes.list - * @desc Lists all composite types for Deployment Manager. - * @alias deploymentmanager.compositeTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.compositeTypes.patch - * @desc Updates a composite type. This method supports patch semantics. - * @alias deploymentmanager.compositeTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.compositeTypes.update - * @desc Updates a composite type. - * @alias deploymentmanager.compositeTypes.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Deployments { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace deploymentmanager_alpha { /** - * deploymentmanager.deployments.cancelPreview - * @desc Cancels and removes the preview currently associated with the - * deployment. - * @alias deploymentmanager.deployments.cancelPreview - * @memberOf! () + * Google Cloud Deployment Manager Alpha API * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancelPreview(params?: any, options?: MethodOptions): - AxiosPromise; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/cancelPreview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * The Deployment Manager API allows users to declaratively configure, deploy + * and run complex solutions on the Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const deploymentmanager = google.deploymentmanager('alpha'); + * + * @namespace deploymentmanager + * @type {Function} + * @version alpha + * @variation alpha + * @param {object=} options Options for Deploymentmanager + */ + export class Deploymentmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + compositeTypes: Resource$Compositetypes; + deployments: Resource$Deployments; + manifests: Resource$Manifests; + operations: Resource$Operations; + resources: Resource$Resources; + typeProviders: Resource$Typeproviders; + types: Resource$Types; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.compositeTypes = new Resource$Compositetypes(this); + this.deployments = new Resource$Deployments(this); + this.manifests = new Resource$Manifests(this); + this.operations = new Resource$Operations(this); + this.resources = new Resource$Resources(this); + this.typeProviders = new Resource$Typeproviders(this); + this.types = new Resource$Types(this); + } + + getRoot() { + return this.root; } } - /** - * deploymentmanager.deployments.delete - * @desc Deletes a deployment and all of the resources in the deployment. - * @alias deploymentmanager.deployments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Async options that determine when a resource should finish. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AsyncOptions { + /** + * Method regex where this policy will apply. + */ + methodMatch: string; + /** + * Deployment manager will poll instances for this API resource setting a + * RUNNING state, and blocking until polling conditions tell whether the + * resource is completed or failed. + */ + pollingOptions: Schema$PollingOptions; } - - /** - * deploymentmanager.deployments.get - * @desc Gets information about a specific deployment. - * @alias deploymentmanager.deployments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { "log_type": + * "ADMIN_READ", } ] }, { "service": + * "fooservice.googleapis.com" "audit_log_configs": [ { + * "log_type": "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } ] } For fooservice, this policy + * enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts + * foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE + * logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + exemptedMembers: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; } - - /** - * deploymentmanager.deployments.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias deploymentmanager.deployments.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { "log_type": + * "DATA_WRITE", } ] } This enables 'DATA_READ' and + * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ + * logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of [Binding.members][]. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; } - - /** - * deploymentmanager.deployments.insert - * @desc Creates a deployment and all of the resources described by the - * deployment manifest. - * @alias deploymentmanager.deployments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Authorization-related information used by Cloud Audit Logging. */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AuthorizationLoggingOptions { + /** + * The type of the permission that was checked. + */ + permissionType: string; } - - /** - * deploymentmanager.deployments.list - * @desc Lists all deployments for a given project. - * @alias deploymentmanager.deployments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Basic Auth used as a credential. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BasicAuth { + password: string; + user: string; } - - /** - * deploymentmanager.deployments.patch - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. This method supports patch semantics. - * @alias deploymentmanager.deployments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied + * condition will not allow user access via current binding. Different + * bindings, including their conditions, are examined independently. This + * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. + */ + condition: Schema$Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or without + * a Google account. * `allAuthenticatedUsers`: A special identifier that + * represents anyone who is authenticated with a Google account or a service + * account. * `user:{emailid}`: An email address that represents a specific + * Google account. For example, `alice@gmail.com` or `joe@example.com`. * + * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. + */ + role: string; } - - /** - * deploymentmanager.deployments.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias deploymentmanager.deployments.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CollectionOverride allows resource handling overrides for specific + * resources within a BaseType + */ + export interface Schema$CollectionOverride { + /** + * The collection that identifies this resource within its service. + */ + collection: string; + /** + * Custom verb method mappings to support unordered list API mappings. + */ + methodMap: Schema$MethodMap; + /** + * The options to apply to this resource-level override + */ + options: Schema$Options; } - - /** - * deploymentmanager.deployments.stop - * @desc Stops an ongoing operation. This does not roll back any work that has - * already been completed, but prevents any new work from being started. - * @alias deploymentmanager.deployments.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsStopRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Holds the composite type. + */ + export interface Schema$CompositeType { + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the composite type was created, in RFC3339 + * text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$CompositeTypeLabelEntry[]; + /** + * Name of the composite type, must follow the expression: + * [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this composite type. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the type provider. + */ + selfLink: string; + status: string; + /** + * Files for the template type. + */ + templateContents: Schema$TemplateContents; + } + export interface Schema$CompositeTypeLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.deployments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias deploymentmanager.deployments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response that returns all Composite Types supported by Deployment Manager + */ + export interface Schema$CompositeTypesListResponse { + /** + * Output only. A list of resource composite types supported by Deployment + * Manager. + */ + compositeTypes: Schema$CompositeType[]; + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; } - - /** - * deploymentmanager.deployments.update - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. - * @alias deploymentmanager.deployments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A condition to be met. + */ + export interface Schema$Condition { + /** + * Trusted attributes supplied by the IAM system. + */ + iam: string; + /** + * An operator to apply the subject with. + */ + op: string; + /** + * Trusted attributes discharged by the service. + */ + svc: string; + /** + * Trusted attributes supplied by any service that owns resources and uses + * the IAM system for access control. + */ + sys: string; + /** + * DEPRECATED. Use 'values' instead. + */ + value: string; + /** + * The objects of the condition. This is mutually exclusive with + * 'value'. + */ + values: string[]; } -} - -export class Resource$Manifests { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ConfigFile { + /** + * The contents of the file. + */ + content: string; } - - getRoot() { - return this.root; + /** + * BaseType that describes a service-backed Type. + */ + export interface Schema$ConfigurableService { + /** + * Allows resource handling overrides for specific collections + */ + collectionOverrides: Schema$CollectionOverride[]; + /** + * Credential used when interacting with this type. + */ + credential: Schema$Credential; + /** + * Descriptor Url for the this type. + */ + descriptorUrl: string; + /** + * Options to apply when handling any resources in this service. + */ + options: Schema$Options; } - - /** - * deploymentmanager.manifests.get - * @desc Gets information about a specific manifest. - * @alias deploymentmanager.manifests.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.manifest The name of the manifest for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'manifest'], - pathParams: ['deployment', 'manifest', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The credential used by Deployment Manager and TypeProvider. Only one of the + * options is permitted. + */ + export interface Schema$Credential { + /** + * Basic Auth Credential, only used by TypeProvider. + */ + basicAuth: Schema$BasicAuth; + /** + * Service Account Credential, only used by Deployment. + */ + serviceAccount: Schema$ServiceAccount; + /** + * Specify to use the project default credential, only supported by + * Deployment. + */ + useProjectDefault: boolean; + } + export interface Schema$Deployment { + /** + * User provided default credential for the deployment. + */ + credential: Schema$Credential; + /** + * An optional user-provided description of the deployment. + */ + description: string; + /** + * Provides a fingerprint to use in requests to modify a deployment, such as + * update(), stop(), and cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided with update(), stop(), and + * cancelPreview() requests to perform optimistic locking. This ensures + * optimistic concurrency so that only one request happens at a time. The + * fingerprint is initially generated by Deployment Manager and changes + * after every request to modify data. To get the latest fingerprint value, + * perform a get() request to a deployment. + */ + fingerprint: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the deployment was created, in RFC3339 text + * format . + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentLabelEntry[]; + /** + * Output only. URL of the manifest representing the last manifest that was + * successfully deployed. + */ + manifest: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this deployment. + */ + operation: Schema$Operation; + /** + * Output only. Map of outputs from the last manifest that deployed + * successfully. + */ + outputs: Schema$DeploymentOutputsEntry[]; + /** + * Output only. Self link for the deployment. + */ + selfLink: string; + /** + * [Input Only] The parameters that define your deployment, including the + * deployment configuration and relevant templates. + */ + target: Schema$TargetConfiguration; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this deployment, the updated configuration appears here. + */ + update: Schema$DeploymentUpdate; + } + export interface Schema$DeploymentLabelEntry { + key: string; + value: string; + } + export interface Schema$DeploymentOutputsEntry { + key: string; + value: string; + } + export interface Schema$DeploymentsCancelPreviewRequest { + /** + * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided in cancelPreview() + * requests to perform optimistic locking. This ensures optimistic + * concurrency so that the deployment does not have conflicting requests + * (e.g. if someone attempts to make a new update request while another user + * attempts to cancel a preview, this would prevent one of the requests). + * The fingerprint is initially generated by Deployment Manager and changes + * after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint: string; } - - /** - * deploymentmanager.manifests.list - * @desc Lists all manifests for a given deployment. - * @alias deploymentmanager.manifests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of deployments and a page token used + * to build the next request if the request has been truncated. + */ + export interface Schema$DeploymentsListResponse { + /** + * Output only. The deployments contained in this response. + */ + deployments: Schema$Deployment[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; } -} - -export class Resource$Operations { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$DeploymentsStopRequest { + /** + * Specifies a fingerprint for stop() requests. A fingerprint is a randomly + * generated value that must be provided in stop() requests to perform + * optimistic locking. This ensures optimistic concurrency so that the + * deployment does not have conflicting requests (e.g. if someone attempts + * to make a new update request while another user attempts to stop an + * ongoing update request, this would prevent a collision). The fingerprint + * is initially generated by Deployment Manager and changes after every + * request to modify a deployment. To get the latest fingerprint value, + * perform a get() request on the deployment. + */ + fingerprint: string; } - - getRoot() { - return this.root; + export interface Schema$DeploymentUpdate { + /** + * Output only. The user-provided default credential to use when deploying + * this preview. + */ + credential: Schema$Credential; + /** + * Output only. An optional user-provided description of the deployment + * after the current update has been applied. + */ + description: string; + /** + * Output only. Map of labels; provided by the client when the resource is + * created or updated. Specifically: Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentUpdateLabelEntry[]; + /** + * Output only. URL of the manifest representing the update configuration of + * this deployment. + */ + manifest: string; + } + export interface Schema$DeploymentUpdateLabelEntry { + key: string; + value: string; + } + export interface Schema$Diagnostic { + /** + * JsonPath expression on the resource that if non empty, indicates that + * this field needs to be extracted as a diagnostic. + */ + field: string; + /** + * Level to record this diagnostic. + */ + level: string; } - - /** - * deploymentmanager.operations.get - * @desc Gets information about a specific operation. - * @alias deploymentmanager.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation The name of the operation for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an expression text. Example: title: "User account + * presence" description: "Determines whether the request has a user + * account" expression: "size(request.user) > 0" + */ + export interface Schema$Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description: string; + /** + * Textual representation of an expression in Common Expression Language + * syntax. The application context of the containing message determines + * which well-known feature set of CEL is supported. + */ + expression: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location: string; + /** + * An optional title for the expression, i.e. a short string describing its + * purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title: string; + } + export interface Schema$ImportFile { + /** + * The contents of the file. + */ + content: string; + /** + * The name of the file. + */ + name: string; } - - /** - * deploymentmanager.operations.list - * @desc Lists all operations for a project. - * @alias deploymentmanager.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * InputMapping creates a 'virtual' property that will be injected + * into the properties before sending the request to the underlying API. + */ + export interface Schema$InputMapping { + /** + * The name of the field that is going to be injected. + */ + fieldName: string; + /** + * The location where this mapping applies. + */ + location: string; + /** + * Regex to evaluate on method to decide if input applies. + */ + methodMatch: string; + /** + * A jsonPath expression to select an element. + */ + value: string; } -} - -export class Resource$Resources { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Specifies what kind of log the caller must write + */ + export interface Schema$LogConfig { + /** + * Cloud audit options. + */ + cloudAudit: Schema$LogConfigCloudAuditOptions; + /** + * Counter options. + */ + counter: Schema$LogConfigCounterOptions; + /** + * Data access options. + */ + dataAccess: Schema$LogConfigDataAccessOptions; } - - getRoot() { - return this.root; + /** + * Write a Cloud Audit log + */ + export interface Schema$LogConfigCloudAuditOptions { + /** + * Information used by the Cloud Audit Logging pipeline. + */ + authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; + /** + * The log_name to populate in the Cloud Audit Record. + */ + logName: string; } - - /** - * deploymentmanager.resources.get - * @desc Gets information about a single resource. - * @alias deploymentmanager.resources.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {string} params.resource_ The name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources/{resource}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'resource'], - pathParams: ['deployment', 'project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Increment a streamz counter with the specified metric and field names. + * Metric names should start with a '/', generally be lowercase-only, + * and end in "_count". Field names should not contain an initial + * slash. The actual exported metric names will have "/iam/policy" + * prepended. Field names correspond to IAM request parameters and field + * values are their respective values. At present the only supported field + * names are - "iam_principal", corresponding to + * IAMContext.principal; - "" (empty string), resulting in one + * aggretated counter with no field. Examples: counter { metric: + * "/debug_access_count" field: "iam_principal" } ==> + * increment counter /iam/policy/backend_debug_access_count + * {iam_principal=[value of IAMContext.principal]} At this time we do not + * support: * multiple field names (though this may be supported in the + * future) * decrementing the counter * incrementing it by anything other than + * 1 + */ + export interface Schema$LogConfigCounterOptions { + /** + * The field value to attribute. + */ + field: string; + /** + * The metric to update. + */ + metric: string; } - - /** - * deploymentmanager.resources.list - * @desc Lists all resources in a given deployment. - * @alias deploymentmanager.resources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Write a Data Access (Gin) log */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$LogConfigDataAccessOptions { + /** + * Whether Gin logging should happen in a fail-closed manner at the caller. + * This is relevant only in the LocalIAM implementation, for now. + */ + logMode: string; } -} - -export class Resource$Typeproviders { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Manifest { + /** + * Output only. The YAML configuration for this manifest. + */ + config: Schema$ConfigFile; + /** + * Output only. The fully-expanded configuration file, including any + * templates and references. + */ + expandedConfig: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. The imported files for this manifest. + */ + imports: Schema$ImportFile[]; + /** + * Output only. Timestamp when the manifest was created, in RFC3339 text + * format. + */ + insertTime: string; + /** + * Output only. The YAML layout for this manifest. + */ + layout: string; + /** + * Output only. The name of the manifest. + */ + name: string; + /** + * Output only. Self link for the manifest. + */ + selfLink: string; } - - getRoot() { - return this.root; + /** + * A response containing a partial list of manifests and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ManifestsListResponse { + /** + * Output only. Manifests contained in this list response. + */ + manifests: Schema$Manifest[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; } - - /** - * deploymentmanager.typeProviders.delete - * @desc Deletes a type provider. - * @alias deploymentmanager.typeProviders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Deployment Manager will call these methods during the events of + * creation/deletion/update/get/setIamPolicy + */ + export interface Schema$MethodMap { + /** + * The action identifier for the create method to be used for this + * collection + */ + create: string; + /** + * The action identifier for the delete method to be used for this + * collection + */ + delete: string; + /** + * The action identifier for the get method to be used for this collection + */ + get: string; + /** + * The action identifier for the setIamPolicy method to be used for this + * collection + */ + setIamPolicy: string; + /** + * The action identifier for the update method to be used for this + * collection + */ + update: string; } - - /** - * deploymentmanager.typeProviders.get - * @desc Gets information about a specific type provider. - * @alias deploymentmanager.typeProviders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; } - - /** - * deploymentmanager.typeProviders.getType - * @desc Gets a type info for a type provided by a TypeProvider. - * @alias deploymentmanager.typeProviders.getType - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type provider for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getType(params?: any, options?: MethodOptions): AxiosPromise; - getType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider', 'type'], - pathParams: ['project', 'type', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of operations and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$OperationsListResponse { + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. Operations contained in this list response. + */ + operations: Schema$Operation[]; } - - /** - * deploymentmanager.typeProviders.insert - * @desc Creates a type provider. - * @alias deploymentmanager.typeProviders.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Options allows customized resource handling by Deployment Manager. + */ + export interface Schema$Options { + /** + * Options regarding how to thread async requests. + */ + asyncOptions: Schema$AsyncOptions[]; + /** + * The mappings that apply for requests. + */ + inputMappings: Schema$InputMapping[]; + /** + * The json path to the field in the resource JSON body into which the + * resource name should be mapped. Leaving this empty indicates that there + * should be no mapping performed. + */ + nameProperty: string; + /** + * Options for how to validate and process properties on a resource. + */ + validationOptions: Schema$ValidationOptions; } - - /** - * deploymentmanager.typeProviders.list - * @desc Lists all resource type providers for Deployment Manager. - * @alias deploymentmanager.typeProviders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { "role": + * "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } For a description of IAM and its + * features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + iamOwned: boolean; + /** + * If more than one rule is specified, the rules are applied in the + * following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be + * applied if one or more matching rule requires logging. - Otherwise, if + * any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging + * will be applied if one or more matching rule requires logging. - + * Otherwise, if no rule applies, permission is denied. + */ + rules: Schema$Rule[]; + /** + * Deprecated. + */ + version: number; + } + export interface Schema$PollingOptions { + /** + * An array of diagnostics to be collected by Deployment Manager, these + * diagnostics will be displayed to the user. + */ + diagnostics: Schema$Diagnostic[]; + /** + * JsonPath expression that determines if the request failed. + */ + failCondition: string; + /** + * JsonPath expression that determines if the request is completed. + */ + finishCondition: string; + /** + * JsonPath expression that evaluates to string, it indicates where to poll. + */ + pollingLink: string; + /** + * JsonPath expression, after polling is completed, indicates where to fetch + * the resource. + */ + targetLink: string; + } + export interface Schema$Resource { + /** + * The Access Control Policy set on this resource. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. The evaluated properties of the resource with references + * expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the resource was created or acquired, in + * RFC3339 text format . + */ + insertTime: string; + /** + * Output only. The last used credential that successfully created/updated + * the resource. + */ + lastUsedCredential: Schema$Credential; + /** + * Output only. URL of the manifest representing the current configuration + * of this resource. + */ + manifest: string; + /** + * Output only. The name of the resource as it appears in the YAML config. + */ + name: string; + /** + * Output only. The current properties of the resource before any references + * have been filled in. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. In case this is an action, it will show the runtimePolicies + * on which this action will run in the deployment + */ + runtimePolicies: string[]; + /** + * Output only. The type of the resource, for example compute.v1.instance, + * or cloudfunctions.v1beta1.function. + */ + type: string; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this resource, the updated configuration appears here. + */ + update: Schema$ResourceUpdate; + /** + * Output only. Timestamp when the resource was updated, in RFC3339 text + * format . + */ + updateTime: string; + /** + * Output only. The URL of the actual resource. + */ + url: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; } - - /** - * deploymentmanager.typeProviders.listTypes - * @desc Lists all the type info for a TypeProvider. - * @alias deploymentmanager.typeProviders.listTypes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The access controls set on the resource. */ - listTypes(params?: any, options?: MethodOptions): - AxiosPromise; - listTypes( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listTypes( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$ResourceAccessControl { + /** + * The GCP IAM Policy to set on the resource. + */ + gcpIamPolicy: string; } - - /** - * deploymentmanager.typeProviders.patch - * @desc Updates a type provider. This method supports patch semantics. - * @alias deploymentmanager.typeProviders.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of resources and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ResourcesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Resources contained in this list response. + */ + resources: Schema$Resource[]; + } + export interface Schema$ResourceUpdate { + /** + * The Access Control Policy to set on this resource after updating the + * resource itself. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. The credential that will be used creating/updating this + * resource. + */ + credential: Schema$Credential; + /** + * Output only. If errors are generated during update of the resource, this + * field will be populated. + */ + error: any; + /** + * Output only. The expanded properties of the resource with reference + * values expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. + */ + intent: string; + /** + * Output only. URL of the manifest representing the update configuration of + * this resource. + */ + manifest: string; + /** + * Output only. The set of updated properties for this resource, before + * references are expanded. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. In case this is an action, it will show the runtimePolicies + * that this action will have after updating the deployment. + */ + runtimePolicies: string[]; + /** + * Output only. The state of the resource. + */ + state: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; } - - /** - * deploymentmanager.typeProviders.update - * @desc Updates a type provider. - * @alias deploymentmanager.typeProviders.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A rule to be applied in a Policy. + */ + export interface Schema$Rule { + /** + * Required + */ + action: string; + /** + * Additional restrictions that must be met. All conditions must pass for + * the rule to match. + */ + conditions: Schema$Condition[]; + /** + * Human-readable description of the rule. + */ + description: string; + /** + * If one or more 'in' clauses are specified, the rule matches if + * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + */ + ins: string[]; + /** + * The config returned to callers of tech.iam.IAM.CheckPolicy for any + * entries that match the LOG action. + */ + logConfigs: Schema$LogConfig[]; + /** + * If one or more 'not_in' clauses are specified, the rule matches + * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + */ + notIns: string[]; + /** + * A permission is a string of form '..' (e.g., + * 'storage.buckets.list'). A value of '*' matches all + * permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions: string[]; + } + /** + * Service Account used as a credential. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ServiceAccount { + /** + * The IAM service account email address like + * test@myproject.iam.gserviceaccount.com + */ + email: string; } -} - -export class Resource$Types { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$TargetConfiguration { + /** + * The configuration to use for this deployment. + */ + config: Schema$ConfigFile; + /** + * Specifies any files to import for this configuration. This can be used to + * import templates or other files. For example, you might import a text + * file in order to use the file in a template. + */ + imports: Schema$ImportFile[]; } - - getRoot() { - return this.root; + /** + * Files that make up the template contents of a template type. + */ + export interface Schema$TemplateContents { + /** + * Import files referenced by the main template. + */ + imports: Schema$ImportFile[]; + /** + * Which interpreter (python or jinja) should be used during expansion. + */ + interpreter: string; + /** + * The filename of the mainTemplate + */ + mainTemplate: string; + /** + * The contents of the template schema. + */ + schema: string; + /** + * The contents of the main template file. + */ + template: string; + } + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; + } + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * deploymentmanager.types.delete - * @desc Deletes a type and all of the resources in the type. - * @alias deploymentmanager.types.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'type'], - pathParams: ['project', 'type'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A resource type supported by Deployment Manager. + */ + export interface Schema$Type { + /** + * Base Type (configurable service) that backs this Type. + */ + configurableService: Schema$ConfigurableService; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the type was created, in RFC3339 text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$TypeLabelEntry[]; + /** + * Name of the type. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this type. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the type. + */ + selfLink: string; } - - /** - * deploymentmanager.types.get - * @desc Gets information about a specific type. - * @alias deploymentmanager.types.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'type'], - pathParams: ['project', 'type'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Contains detailed information about a composite type, base type, or base + * type with specific collection. + */ + export interface Schema$TypeInfo { + /** + * The description of the type. + */ + description: string; + /** + * For swagger 2.0 externalDocs field will be used. For swagger 1.2 this + * field will be empty. + */ + documentationLink: string; + /** + * Output only. Type of the output. Always deploymentManager#TypeInfo for + * TypeInfo. + */ + kind: string; + /** + * The base type or composite type name. + */ + name: string; + /** + * For base types with a collection, we return a schema and documentation + * link For template types, we return only a schema + */ + schema: Schema$TypeInfoSchemaInfo; + /** + * Output only. Server-defined URL for the resource. + */ + selfLink: string; + /** + * The title on the API descriptor URL provided. + */ + title: string; + } + export interface Schema$TypeInfoSchemaInfo { + /** + * The properties that this composite type or base type collection accept as + * input, represented as a json blob, format is: JSON Schema Draft V4 + */ + input: string; + /** + * The properties that this composite type or base type collection exposes + * as output, these properties can be used for references, represented as + * json blob, format is: JSON Schema Draft V4 + */ + output: string; + } + export interface Schema$TypeLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.types.insert - * @desc Creates a type. - * @alias deploymentmanager.types.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {().Type} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A type provider that describes a service-backed Type. + */ + export interface Schema$TypeProvider { + /** + * Allows resource handling overrides for specific collections + */ + collectionOverrides: Schema$CollectionOverride[]; + /** + * Credential used when interacting with this type. + */ + credential: Schema$Credential; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Descriptor Url for the this type provider. + */ + descriptorUrl: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the type provider was created, in RFC3339 + * text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$TypeProviderLabelEntry[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this type provider. + */ + operation: Schema$Operation; + /** + * Options to apply when handling any resources in this service. + */ + options: Schema$Options; + /** + * Output only. Self link for the type provider. + */ + selfLink: string; + } + export interface Schema$TypeProviderLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.types.list - * @desc Lists all resource types for Deployment Manager. - * @alias deploymentmanager.types.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response that returns all Type Providers supported by Deployment Manager + */ + export interface Schema$TypeProvidersListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource type providers supported by Deployment + * Manager. + */ + typeProviders: Schema$TypeProvider[]; + } + export interface Schema$TypeProvidersListTypesResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource type info. + */ + types: Schema$TypeInfo[]; } - - /** - * deploymentmanager.types.patch - * @desc Updates a type. This method supports patch semantics. - * @alias deploymentmanager.types.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type for this request. - * @param {().Type} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response that returns all Types supported by Deployment Manager + */ + export interface Schema$TypesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource types supported by Deployment Manager. + */ + types: Schema$Type[]; + } + /** + * Options for how to validate and process properties on a resource. */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export interface Schema$ValidationOptions { + /** + * Customize how deployment manager will validate the resource against + * schema errors. + */ + schemaValidation: string; + /** + * Specify what to do with extra properties when executing a request. + */ + undeclaredProperties: string; + } + + export class Resource$Compositetypes { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.compositeTypes.delete + * @desc Deletes a composite type. + * @alias deploymentmanager.compositeTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the type for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.get + * @desc Gets information about a specific composite type. + * @alias deploymentmanager.compositeTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.insert + * @desc Creates a composite type. + * @alias deploymentmanager.compositeTypes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.list + * @desc Lists all composite types for Deployment Manager. + * @alias deploymentmanager.compositeTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.patch + * @desc Updates a composite type. This method supports patch semantics. + * @alias deploymentmanager.compositeTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.update + * @desc Updates a composite type. + * @alias deploymentmanager.compositeTypes.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Deployments { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.deployments.cancelPreview + * @desc Cancels and removes the preview currently associated with the + * deployment. + * @alias deploymentmanager.deployments.cancelPreview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancelPreview(params?: any, options?: MethodOptions): + AxiosPromise; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/cancelPreview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.delete + * @desc Deletes a deployment and all of the resources in the deployment. + * @alias deploymentmanager.deployments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.get + * @desc Gets information about a specific deployment. + * @alias deploymentmanager.deployments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias deploymentmanager.deployments.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.insert + * @desc Creates a deployment and all of the resources described by the + * deployment manifest. + * @alias deploymentmanager.deployments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.list + * @desc Lists all deployments for a given project. + * @alias deploymentmanager.deployments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.patch + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. This method supports patch semantics. + * @alias deploymentmanager.deployments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias deploymentmanager.deployments.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.stop + * @desc Stops an ongoing operation. This does not roll back any work that + * has already been completed, but prevents any new work from being started. + * @alias deploymentmanager.deployments.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsStopRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias deploymentmanager.deployments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.update + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. + * @alias deploymentmanager.deployments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'type'], - pathParams: ['project', 'type'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Manifests { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.manifests.get + * @desc Gets information about a specific manifest. + * @alias deploymentmanager.manifests.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.manifest The name of the manifest for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'manifest'], + pathParams: ['deployment', 'manifest', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.manifests.list + * @desc Lists all manifests for a given deployment. + * @alias deploymentmanager.manifests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/manifests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Operations { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.operations.get + * @desc Gets information about a specific operation. + * @alias deploymentmanager.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation The name of the operation for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.operations.list + * @desc Lists all operations for a project. + * @alias deploymentmanager.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * deploymentmanager.types.update - * @desc Updates a type. - * @alias deploymentmanager.types.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type for this request. - * @param {().Type} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Resources { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.resources.get + * @desc Gets information about a single resource. + * @alias deploymentmanager.resources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {string} params.resource_ The name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources/{resource}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'resource'], + pathParams: ['deployment', 'project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.resources.list + * @desc Lists all resources in a given deployment. + * @alias deploymentmanager.resources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/deployments/{deployment}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Typeproviders { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.typeProviders.delete + * @desc Deletes a type provider. + * @alias deploymentmanager.typeProviders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.get + * @desc Gets information about a specific type provider. + * @alias deploymentmanager.typeProviders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.getType + * @desc Gets a type info for a type provided by a TypeProvider. + * @alias deploymentmanager.typeProviders.getType + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type provider for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getType(params?: any, options?: MethodOptions): + AxiosPromise; + getType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider', 'type'], + pathParams: ['project', 'type', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.insert + * @desc Creates a type provider. + * @alias deploymentmanager.typeProviders.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.list + * @desc Lists all resource type providers for Deployment Manager. + * @alias deploymentmanager.typeProviders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.listTypes + * @desc Lists all the type info for a TypeProvider. + * @alias deploymentmanager.typeProviders.listTypes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listTypes(params?: any, options?: MethodOptions): + AxiosPromise; + listTypes( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listTypes( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * deploymentmanager.typeProviders.patch + * @desc Updates a type provider. This method supports patch semantics. + * @alias deploymentmanager.typeProviders.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.update + * @desc Updates a type provider. + * @alias deploymentmanager.typeProviders.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/alpha/projects/{project}/global/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'type'], - pathParams: ['project', 'type'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Types { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.types.delete + * @desc Deletes a type and all of the resources in the type. + * @alias deploymentmanager.types.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'type'], + pathParams: ['project', 'type'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.types.get + * @desc Gets information about a specific type. + * @alias deploymentmanager.types.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'type'], + pathParams: ['project', 'type'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.types.insert + * @desc Creates a type. + * @alias deploymentmanager.types.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {().Type} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.types.list + * @desc Lists all resource types for Deployment Manager. + * @alias deploymentmanager.types.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.types.patch + * @desc Updates a type. This method supports patch semantics. + * @alias deploymentmanager.types.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type for this request. + * @param {().Type} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'type'], + pathParams: ['project', 'type'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.types.update + * @desc Updates a type. + * @alias deploymentmanager.types.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type for this request. + * @param {().Type} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/alpha/projects/{project}/global/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'type'], + pathParams: ['project', 'type'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/deploymentmanager/v2.ts b/src/apis/deploymentmanager/v2.ts index d3f180a14f2..261c5f6a425 100644 --- a/src/apis/deploymentmanager/v2.ts +++ b/src/apis/deploymentmanager/v2.ts @@ -27,3084 +27,3121 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Deployment Manager API - * - * Declares, configures, and deploys complex solutions on Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const deploymentmanager = google.deploymentmanager('v2'); - * - * @namespace deploymentmanager - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Deploymentmanager - */ -export class Deploymentmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - deployments: Resource$Deployments; - manifests: Resource$Manifests; - operations: Resource$Operations; - resources: Resource$Resources; - types: Resource$Types; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.deployments = new Resource$Deployments(this); - this.manifests = new Resource$Manifests(this); - this.operations = new Resource$Operations(this); - this.resources = new Resource$Resources(this); - this.types = new Resource$Types(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": "allServices" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", }, { "log_type": "ADMIN_READ", } - * ] }, { "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": "DATA_WRITE", - * "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } - * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - exemptedMembers: string[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", } ] } This enables 'DATA_READ' and - * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ - * logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of [Binding.members][]. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Authorization-related information used by Cloud Audit Logging. - */ -export interface Schema$AuthorizationLoggingOptions { - /** - * The type of the permission that was checked. - */ - permissionType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * The condition that is associated with this binding. NOTE: an unsatisfied - * condition will not allow user access via current binding. Different - * bindings, including their conditions, are examined independently. This - * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. - */ - condition: Schema$Expr; - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or without a - * Google account. * `allAuthenticatedUsers`: A special identifier that - * represents anyone who is authenticated with a Google account or a service - * account. * `user:{emailid}`: An email address that represents a specific - * Google account. For example, `alice@gmail.com` or `joe@example.com`. * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. - */ - role: string; -} -/** - * A condition to be met. - */ -export interface Schema$Condition { - /** - * Trusted attributes supplied by the IAM system. - */ - iam: string; - /** - * An operator to apply the subject with. - */ - op: string; - /** - * Trusted attributes discharged by the service. - */ - svc: string; - /** - * Trusted attributes supplied by any service that owns resources and uses the - * IAM system for access control. - */ - sys: string; - /** - * DEPRECATED. Use 'values' instead. - */ - value: string; - /** - * The objects of the condition. This is mutually exclusive with - * 'value'. - */ - values: string[]; -} -export interface Schema$ConfigFile { - /** - * The contents of the file. - */ - content: string; -} -export interface Schema$Deployment { - /** - * An optional user-provided description of the deployment. - */ - description: string; - /** - * Provides a fingerprint to use in requests to modify a deployment, such as - * update(), stop(), and cancelPreview() requests. A fingerprint is a randomly - * generated value that must be provided with update(), stop(), and - * cancelPreview() requests to perform optimistic locking. This ensures - * optimistic concurrency so that only one request happens at a time. The - * fingerprint is initially generated by Deployment Manager and changes after - * every request to modify data. To get the latest fingerprint value, perform - * a get() request to a deployment. - */ - fingerprint: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the deployment was created, in RFC3339 text - * format . - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentLabelEntry[]; - /** - * Output only. URL of the manifest representing the last manifest that was - * successfully deployed. - */ - manifest: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must - * be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this deployment. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the deployment. - */ - selfLink: string; - /** - * [Input Only] The parameters that define your deployment, including the - * deployment configuration and relevant templates. - */ - target: Schema$TargetConfiguration; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this deployment, the updated configuration appears here. - */ - update: Schema$DeploymentUpdate; -} -export interface Schema$DeploymentLabelEntry { - key: string; - value: string; -} -export interface Schema$DeploymentsCancelPreviewRequest { - /** - * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a - * randomly generated value that must be provided in cancelPreview() requests - * to perform optimistic locking. This ensures optimistic concurrency so that - * the deployment does not have conflicting requests (e.g. if someone attempts - * to make a new update request while another user attempts to cancel a - * preview, this would prevent one of the requests). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -/** - * A response containing a partial list of deployments and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$DeploymentsListResponse { - /** - * Output only. The deployments contained in this response. - */ - deployments: Schema$Deployment[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -export interface Schema$DeploymentsStopRequest { - /** - * Specifies a fingerprint for stop() requests. A fingerprint is a randomly - * generated value that must be provided in stop() requests to perform - * optimistic locking. This ensures optimistic concurrency so that the - * deployment does not have conflicting requests (e.g. if someone attempts to - * make a new update request while another user attempts to stop an ongoing - * update request, this would prevent a collision). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -export interface Schema$DeploymentUpdate { - /** - * Output only. An optional user-provided description of the deployment after - * the current update has been applied. - */ - description: string; - /** - * Output only. Map of labels; provided by the client when the resource is - * created or updated. Specifically: Label keys must be between 1 and 63 - * characters long and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentUpdateLabelEntry[]; - /** - * Output only. URL of the manifest representing the update configuration of - * this deployment. - */ - manifest: string; -} -export interface Schema$DeploymentUpdateLabelEntry { - key: string; - value: string; -} -/** - * Represents an expression text. Example: title: "User account - * presence" description: "Determines whether the request has a user - * account" expression: "size(request.user) > 0" - */ -export interface Schema$Expr { - /** - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - */ - description: string; - /** - * Textual representation of an expression in Common Expression Language - * syntax. The application context of the containing message determines which - * well-known feature set of CEL is supported. - */ - expression: string; - /** - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - */ - location: string; - /** - * An optional title for the expression, i.e. a short string describing its - * purpose. This can be used e.g. in UIs which allow to enter the expression. - */ - title: string; -} -export interface Schema$ImportFile { - /** - * The contents of the file. - */ - content: string; - /** - * The name of the file. - */ - name: string; -} -/** - * Specifies what kind of log the caller must write - */ -export interface Schema$LogConfig { - /** - * Cloud audit options. - */ - cloudAudit: Schema$LogConfigCloudAuditOptions; - /** - * Counter options. - */ - counter: Schema$LogConfigCounterOptions; - /** - * Data access options. - */ - dataAccess: Schema$LogConfigDataAccessOptions; -} -/** - * Write a Cloud Audit log - */ -export interface Schema$LogConfigCloudAuditOptions { - /** - * Information used by the Cloud Audit Logging pipeline. - */ - authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; - /** - * The log_name to populate in the Cloud Audit Record. - */ - logName: string; -} -/** - * Increment a streamz counter with the specified metric and field names. Metric - * names should start with a '/', generally be lowercase-only, and end - * in "_count". Field names should not contain an initial slash. The - * actual exported metric names will have "/iam/policy" prepended. - * Field names correspond to IAM request parameters and field values are their - * respective values. At present the only supported field names are - - * "iam_principal", corresponding to IAMContext.principal; - - * "" (empty string), resulting in one aggretated counter with no - * field. Examples: counter { metric: "/debug_access_count" field: - * "iam_principal" } ==> increment counter - * /iam/policy/backend_debug_access_count {iam_principal=[value of - * IAMContext.principal]} At this time we do not support: * multiple field - * names (though this may be supported in the future) * decrementing the counter - * * incrementing it by anything other than 1 - */ -export interface Schema$LogConfigCounterOptions { - /** - * The field value to attribute. - */ - field: string; - /** - * The metric to update. - */ - metric: string; -} -/** - * Write a Data Access (Gin) log - */ -export interface Schema$LogConfigDataAccessOptions { - /** - * Whether Gin logging should happen in a fail-closed manner at the caller. - * This is relevant only in the LocalIAM implementation, for now. - */ - logMode: string; -} -export interface Schema$Manifest { - /** - * Output only. The YAML configuration for this manifest. - */ - config: Schema$ConfigFile; - /** - * Output only. The fully-expanded configuration file, including any templates - * and references. - */ - expandedConfig: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. The imported files for this manifest. - */ - imports: Schema$ImportFile[]; - /** - * Output only. Timestamp when the manifest was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Output only. The YAML layout for this manifest. - */ - layout: string; - /** - * Output only. The name of the manifest. - */ - name: string; - /** - * Output only. Self link for the manifest. - */ - selfLink: string; -} -/** - * A response containing a partial list of manifests and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ManifestsListResponse { - /** - * Output only. Manifests contained in this list response. - */ - manifests: Schema$Manifest[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; - /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -/** - * A response containing a partial list of operations and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$OperationsListResponse { - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. Operations contained in this list response. - */ - operations: Schema$Operation[]; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a description of IAM and its - * features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - iamOwned: boolean; - /** - * If more than one rule is specified, the rules are applied in the following - * manner: - All matching LOG rules are always applied. - If any - * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if any - * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if no - * rule applies, permission is denied. - */ - rules: Schema$Rule[]; - /** - * Deprecated. - */ - version: number; -} -export interface Schema$Resource { - /** - * The Access Control Policy set on this resource. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. The evaluated properties of the resource with references - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the resource was created or acquired, in - * RFC3339 text format . - */ - insertTime: string; - /** - * Output only. URL of the manifest representing the current configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The name of the resource as it appears in the YAML config. - */ - name: string; - /** - * Output only. The current properties of the resource before any references - * have been filled in. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. The type of the resource, for example compute.v1.instance, or - * cloudfunctions.v1beta1.function. - */ - type: string; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this resource, the updated configuration appears here. - */ - update: Schema$ResourceUpdate; - /** - * Output only. Timestamp when the resource was updated, in RFC3339 text - * format . - */ - updateTime: string; - /** - * Output only. The URL of the actual resource. - */ - url: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * The access controls set on the resource. - */ -export interface Schema$ResourceAccessControl { - /** - * The GCP IAM Policy to set on the resource. - */ - gcpIamPolicy: string; -} -/** - * A response containing a partial list of resources and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ResourcesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Resources contained in this list response. - */ - resources: Schema$Resource[]; -} -export interface Schema$ResourceUpdate { - /** - * The Access Control Policy to set on this resource after updating the - * resource itself. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. If errors are generated during update of the resource, this - * field will be populated. - */ - error: any; - /** - * Output only. The expanded properties of the resource with reference values - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. - */ - intent: string; - /** - * Output only. URL of the manifest representing the update configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The set of updated properties for this resource, before - * references are expanded. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. The state of the resource. - */ - state: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * A rule to be applied in a Policy. - */ -export interface Schema$Rule { - /** - * Required - */ - action: string; - /** - * Additional restrictions that must be met. All conditions must pass for the - * rule to match. - */ - conditions: Schema$Condition[]; - /** - * Human-readable description of the rule. - */ - description: string; - /** - * If one or more 'in' clauses are specified, the rule matches if the - * PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - */ - ins: string[]; - /** - * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - * that match the LOG action. - */ - logConfigs: Schema$LogConfig[]; - /** - * If one or more 'not_in' clauses are specified, the rule matches if - * the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - */ - notIns: string[]; - /** - * A permission is a string of form '..' (e.g., - * 'storage.buckets.list'). A value of '*' matches all - * permissions, and a verb part of '*' (e.g., - * 'storage.buckets.*') matches all verbs. - */ - permissions: string[]; -} -export interface Schema$TargetConfiguration { - /** - * The configuration to use for this deployment. - */ - config: Schema$ConfigFile; - /** - * Specifies any files to import for this configuration. This can be used to - * import templates or other files. For example, you might import a text file - * in order to use the file in a template. - */ - imports: Schema$ImportFile[]; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A resource type supported by Deployment Manager. - */ -export interface Schema$Type { - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the type was created, in RFC3339 text format. - */ - insertTime: string; - /** - * Name of the type. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this type. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the type. - */ - selfLink: string; -} -/** - * A response that returns all Types supported by Deployment Manager - */ -export interface Schema$TypesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource types supported by Deployment Manager. - */ - types: Schema$Type[]; -} - -export class Resource$Deployments { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * deploymentmanager.deployments.cancelPreview - * @desc Cancels and removes the preview currently associated with the - * deployment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.cancelPreview(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.cancelPreview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancelPreview(params?: any, options?: MethodOptions): - AxiosPromise; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.deployments.delete - * @desc Deletes a deployment and all of the resources in the deployment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.deployments.get - * @desc Gets information about a specific deployment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.deployments.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.deployments.insert - * @desc Creates a deployment and all of the resources described by the - * deployment manifest. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * deploymentmanager.deployments.list - * @desc Lists all deployments for a given project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var deploymentsPage = response['deployments']; - * if (!deploymentsPage) { - * return; - * } - * for (var i = 0; i < deploymentsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `deploymentsPage`: console.log(JSON.stringify(deploymentsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.deployments.list(request, handlePage); - * } - * }; - * - * deploymentManager.deployments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace deploymentmanager_v2 { /** - * deploymentmanager.deployments.patch - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * Google Cloud Deployment Manager API * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); + * Declares, configures, and deploys complex solutions on Google Cloud + * Platform. * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + * @example + * const google = require('googleapis'); + * const deploymentmanager = google.deploymentmanager('v2'); + * + * @namespace deploymentmanager + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Deploymentmanager + */ + export class Deploymentmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; + deployments: Resource$Deployments; + manifests: Resource$Manifests; + operations: Resource$Operations; + resources: Resource$Resources; + types: Resource$Types; - /** - * deploymentmanager.deployments.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.deployments = new Resource$Deployments(this); + this.manifests = new Resource$Manifests(this); + this.operations = new Resource$Operations(this); + this.resources = new Resource$Resources(this); + this.types = new Resource$Types(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - /** - * deploymentmanager.deployments.stop - * @desc Stops an ongoing operation. This does not roll back any work that has - * already been completed, but prevents any new work from being started. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.stop(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsStopRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { "log_type": + * "ADMIN_READ", } ] }, { "service": + * "fooservice.googleapis.com" "audit_log_configs": [ { + * "log_type": "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } ] } For fooservice, this policy + * enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts + * foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE + * logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + exemptedMembers: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } + /** + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { "log_type": + * "DATA_WRITE", } ] } This enables 'DATA_READ' and + * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ + * logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of [Binding.members][]. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } + /** + * Authorization-related information used by Cloud Audit Logging. */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AuthorizationLoggingOptions { + /** + * The type of the permission that was checked. + */ + permissionType: string; } - - /** - * deploymentmanager.deployments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied + * condition will not allow user access via current binding. Different + * bindings, including their conditions, are examined independently. This + * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. + */ + condition: Schema$Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or without + * a Google account. * `allAuthenticatedUsers`: A special identifier that + * represents anyone who is authenticated with a Google account or a service + * account. * `user:{emailid}`: An email address that represents a specific + * Google account. For example, `alice@gmail.com` or `joe@example.com`. * + * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. + */ + role: string; + } + /** + * A condition to be met. + */ + export interface Schema$Condition { + /** + * Trusted attributes supplied by the IAM system. + */ + iam: string; + /** + * An operator to apply the subject with. + */ + op: string; + /** + * Trusted attributes discharged by the service. + */ + svc: string; + /** + * Trusted attributes supplied by any service that owns resources and uses + * the IAM system for access control. + */ + sys: string; + /** + * DEPRECATED. Use 'values' instead. + */ + value: string; + /** + * The objects of the condition. This is mutually exclusive with + * 'value'. + */ + values: string[]; + } + export interface Schema$ConfigFile { + /** + * The contents of the file. + */ + content: string; + } + export interface Schema$Deployment { + /** + * An optional user-provided description of the deployment. + */ + description: string; + /** + * Provides a fingerprint to use in requests to modify a deployment, such as + * update(), stop(), and cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided with update(), stop(), and + * cancelPreview() requests to perform optimistic locking. This ensures + * optimistic concurrency so that only one request happens at a time. The + * fingerprint is initially generated by Deployment Manager and changes + * after every request to modify data. To get the latest fingerprint value, + * perform a get() request to a deployment. + */ + fingerprint: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the deployment was created, in RFC3339 text + * format . + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentLabelEntry[]; + /** + * Output only. URL of the manifest representing the last manifest that was + * successfully deployed. + */ + manifest: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this deployment. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the deployment. + */ + selfLink: string; + /** + * [Input Only] The parameters that define your deployment, including the + * deployment configuration and relevant templates. + */ + target: Schema$TargetConfiguration; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this deployment, the updated configuration appears here. + */ + update: Schema$DeploymentUpdate; + } + export interface Schema$DeploymentLabelEntry { + key: string; + value: string; + } + export interface Schema$DeploymentsCancelPreviewRequest { + /** + * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided in cancelPreview() + * requests to perform optimistic locking. This ensures optimistic + * concurrency so that the deployment does not have conflicting requests + * (e.g. if someone attempts to make a new update request while another user + * attempts to cancel a preview, this would prevent one of the requests). + * The fingerprint is initially generated by Deployment Manager and changes + * after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint: string; + } + /** + * A response containing a partial list of deployments and a page token used + * to build the next request if the request has been truncated. + */ + export interface Schema$DeploymentsListResponse { + /** + * Output only. The deployments contained in this response. + */ + deployments: Schema$Deployment[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + } + export interface Schema$DeploymentsStopRequest { + /** + * Specifies a fingerprint for stop() requests. A fingerprint is a randomly + * generated value that must be provided in stop() requests to perform + * optimistic locking. This ensures optimistic concurrency so that the + * deployment does not have conflicting requests (e.g. if someone attempts + * to make a new update request while another user attempts to stop an + * ongoing update request, this would prevent a collision). The fingerprint + * is initially generated by Deployment Manager and changes after every + * request to modify a deployment. To get the latest fingerprint value, + * perform a get() request on the deployment. + */ + fingerprint: string; + } + export interface Schema$DeploymentUpdate { + /** + * Output only. An optional user-provided description of the deployment + * after the current update has been applied. + */ + description: string; + /** + * Output only. Map of labels; provided by the client when the resource is + * created or updated. Specifically: Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentUpdateLabelEntry[]; + /** + * Output only. URL of the manifest representing the update configuration of + * this deployment. + */ + manifest: string; + } + export interface Schema$DeploymentUpdateLabelEntry { + key: string; + value: string; + } + /** + * Represents an expression text. Example: title: "User account + * presence" description: "Determines whether the request has a user + * account" expression: "size(request.user) > 0" + */ + export interface Schema$Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description: string; + /** + * Textual representation of an expression in Common Expression Language + * syntax. The application context of the containing message determines + * which well-known feature set of CEL is supported. + */ + expression: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location: string; + /** + * An optional title for the expression, i.e. a short string describing its + * purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title: string; + } + export interface Schema$ImportFile { + /** + * The contents of the file. + */ + content: string; + /** + * The name of the file. + */ + name: string; + } + /** + * Specifies what kind of log the caller must write + */ + export interface Schema$LogConfig { + /** + * Cloud audit options. + */ + cloudAudit: Schema$LogConfigCloudAuditOptions; + /** + * Counter options. + */ + counter: Schema$LogConfigCounterOptions; + /** + * Data access options. + */ + dataAccess: Schema$LogConfigDataAccessOptions; + } + /** + * Write a Cloud Audit log + */ + export interface Schema$LogConfigCloudAuditOptions { + /** + * Information used by the Cloud Audit Logging pipeline. + */ + authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; + /** + * The log_name to populate in the Cloud Audit Record. + */ + logName: string; + } + /** + * Increment a streamz counter with the specified metric and field names. + * Metric names should start with a '/', generally be lowercase-only, + * and end in "_count". Field names should not contain an initial + * slash. The actual exported metric names will have "/iam/policy" + * prepended. Field names correspond to IAM request parameters and field + * values are their respective values. At present the only supported field + * names are - "iam_principal", corresponding to + * IAMContext.principal; - "" (empty string), resulting in one + * aggretated counter with no field. Examples: counter { metric: + * "/debug_access_count" field: "iam_principal" } ==> + * increment counter /iam/policy/backend_debug_access_count + * {iam_principal=[value of IAMContext.principal]} At this time we do not + * support: * multiple field names (though this may be supported in the + * future) * decrementing the counter * incrementing it by anything other than + * 1 + */ + export interface Schema$LogConfigCounterOptions { + /** + * The field value to attribute. + */ + field: string; + /** + * The metric to update. + */ + metric: string; + } + /** + * Write a Data Access (Gin) log */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$LogConfigDataAccessOptions { + /** + * Whether Gin logging should happen in a fail-closed manner at the caller. + * This is relevant only in the LocalIAM implementation, for now. + */ + logMode: string; + } + export interface Schema$Manifest { + /** + * Output only. The YAML configuration for this manifest. + */ + config: Schema$ConfigFile; + /** + * Output only. The fully-expanded configuration file, including any + * templates and references. + */ + expandedConfig: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. The imported files for this manifest. + */ + imports: Schema$ImportFile[]; + /** + * Output only. Timestamp when the manifest was created, in RFC3339 text + * format. + */ + insertTime: string; + /** + * Output only. The YAML layout for this manifest. + */ + layout: string; + /** + * Output only. The name of the manifest. + */ + name: string; + /** + * Output only. Self link for the manifest. + */ + selfLink: string; } - - /** - * deploymentmanager.deployments.update - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * deploymentManager.deployments.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.deployments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response containing a partial list of manifests and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ManifestsListResponse { + /** + * Output only. Manifests contained in this list response. + */ + manifests: Schema$Manifest[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + } + /** + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; + } + /** + * A response containing a partial list of operations and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$OperationsListResponse { + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. Operations contained in this list response. + */ + operations: Schema$Operation[]; + } + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { "role": + * "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } For a description of IAM and its + * features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + iamOwned: boolean; + /** + * If more than one rule is specified, the rules are applied in the + * following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be + * applied if one or more matching rule requires logging. - Otherwise, if + * any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging + * will be applied if one or more matching rule requires logging. - + * Otherwise, if no rule applies, permission is denied. + */ + rules: Schema$Rule[]; + /** + * Deprecated. + */ + version: number; + } + export interface Schema$Resource { + /** + * The Access Control Policy set on this resource. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. The evaluated properties of the resource with references + * expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the resource was created or acquired, in + * RFC3339 text format . + */ + insertTime: string; + /** + * Output only. URL of the manifest representing the current configuration + * of this resource. + */ + manifest: string; + /** + * Output only. The name of the resource as it appears in the YAML config. + */ + name: string; + /** + * Output only. The current properties of the resource before any references + * have been filled in. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. The type of the resource, for example compute.v1.instance, + * or cloudfunctions.v1beta1.function. + */ + type: string; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this resource, the updated configuration appears here. + */ + update: Schema$ResourceUpdate; + /** + * Output only. Timestamp when the resource was updated, in RFC3339 text + * format . + */ + updateTime: string; + /** + * Output only. The URL of the actual resource. + */ + url: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; + } + /** + * The access controls set on the resource. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export interface Schema$ResourceAccessControl { + /** + * The GCP IAM Policy to set on the resource. + */ + gcpIamPolicy: string; + } + /** + * A response containing a partial list of resources and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ResourcesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Resources contained in this list response. + */ + resources: Schema$Resource[]; + } + export interface Schema$ResourceUpdate { + /** + * The Access Control Policy to set on this resource after updating the + * resource itself. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. If errors are generated during update of the resource, this + * field will be populated. + */ + error: any; + /** + * Output only. The expanded properties of the resource with reference + * values expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. + */ + intent: string; + /** + * Output only. URL of the manifest representing the update configuration of + * this resource. + */ + manifest: string; + /** + * Output only. The set of updated properties for this resource, before + * references are expanded. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. The state of the resource. + */ + state: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; + } + /** + * A rule to be applied in a Policy. + */ + export interface Schema$Rule { + /** + * Required + */ + action: string; + /** + * Additional restrictions that must be met. All conditions must pass for + * the rule to match. + */ + conditions: Schema$Condition[]; + /** + * Human-readable description of the rule. + */ + description: string; + /** + * If one or more 'in' clauses are specified, the rule matches if + * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + */ + ins: string[]; + /** + * The config returned to callers of tech.iam.IAM.CheckPolicy for any + * entries that match the LOG action. + */ + logConfigs: Schema$LogConfig[]; + /** + * If one or more 'not_in' clauses are specified, the rule matches + * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + */ + notIns: string[]; + /** + * A permission is a string of form '..' (e.g., + * 'storage.buckets.list'). A value of '*' matches all + * permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions: string[]; + } + export interface Schema$TargetConfiguration { + /** + * The configuration to use for this deployment. + */ + config: Schema$ConfigFile; + /** + * Specifies any files to import for this configuration. This can be used to + * import templates or other files. For example, you might import a text + * file in order to use the file in a template. + */ + imports: Schema$ImportFile[]; + } + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; + } + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } + /** + * A resource type supported by Deployment Manager. + */ + export interface Schema$Type { + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the type was created, in RFC3339 text format. + */ + insertTime: string; + /** + * Name of the type. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this type. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the type. + */ + selfLink: string; + } + /** + * A response that returns all Types supported by Deployment Manager + */ + export interface Schema$TypesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource types supported by Deployment Manager. + */ + types: Schema$Type[]; + } + + export class Resource$Deployments { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Manifests { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * deploymentmanager.deployments.cancelPreview + * @desc Cancels and removes the preview currently associated with the + * deployment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.cancelPreview(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.cancelPreview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancelPreview(params?: any, options?: MethodOptions): + AxiosPromise; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/cancelPreview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * deploymentmanager.manifests.get - * @desc Gets information about a specific manifest. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * // The name of the manifest for this request. - * manifest: 'my-manifest', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.manifests.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.manifests.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.manifest The name of the manifest for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * deploymentmanager.deployments.delete + * @desc Deletes a deployment and all of the resources in the deployment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * deploymentmanager.deployments.get + * @desc Gets information about a specific deployment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'manifest'], - pathParams: ['deployment', 'manifest', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.deployments.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * deploymentmanager.manifests.list - * @desc Lists all manifests for a given deployment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var manifestsPage = response['manifests']; - * if (!manifestsPage) { - * return; - * } - * for (var i = 0; i < manifestsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `manifestsPage`: console.log(JSON.stringify(manifestsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.manifests.list(request, handlePage); - * } - * }; - * - * deploymentManager.manifests.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.manifests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * deploymentmanager.deployments.insert + * @desc Creates a deployment and all of the resources described by the + * deployment manifest. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * deploymentmanager.deployments.list + * @desc Lists all deployments for a given project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var deploymentsPage = response['deployments']; + * if (!deploymentsPage) { + * return; + * } + * for (var i = 0; i < deploymentsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `deploymentsPage`: console.log(JSON.stringify(deploymentsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * deploymentManager.deployments.list(request, handlePage); + * } + * }; + * + * deploymentManager.deployments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.deployments.patch + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Operations { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * deploymentmanager.deployments.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * deploymentmanager.operations.get - * @desc Gets information about a specific operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the operation for this request. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation The name of the operation for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * deploymentmanager.deployments.stop + * @desc Stops an ongoing operation. This does not roll back any work that + * has already been completed, but prevents any new work from being started. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.stop(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsStopRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * deploymentmanager.deployments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.deployments.update + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * deploymentManager.deployments.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.deployments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * deploymentmanager.operations.list - * @desc Lists all operations for a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.operations.list(request, handlePage); - * } - * }; - * - * deploymentManager.operations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Manifests { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.manifests.get + * @desc Gets information about a specific manifest. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * // The name of the manifest for this request. + * manifest: 'my-manifest', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.manifests.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.manifests.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.manifest The name of the manifest for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'manifest'], + pathParams: ['deployment', 'manifest', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Resources { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * deploymentmanager.manifests.list + * @desc Lists all manifests for a given deployment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var manifestsPage = response['manifests']; + * if (!manifestsPage) { + * return; + * } + * for (var i = 0; i < manifestsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `manifestsPage`: console.log(JSON.stringify(manifestsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * deploymentManager.manifests.list(request, handlePage); + * } + * }; + * + * deploymentManager.manifests.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.manifests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Operations { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } - /** - * deploymentmanager.resources.get - * @desc Gets information about a single resource. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * // The name of the resource for this request. - * resource_: 'my-resource', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * deploymentManager.resources.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.resources.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {string} params.resource_ The name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * deploymentmanager.operations.get + * @desc Gets information about a specific operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the operation for this request. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.operations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation The name of the operation for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'resource'], - pathParams: ['deployment', 'project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.operations.list + * @desc Lists all operations for a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * deploymentManager.operations.list(request, handlePage); + * } + * }; + * + * deploymentManager.operations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * deploymentmanager.resources.list - * @desc Lists all resources in a given deployment. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of the deployment for this request. - * deployment: 'my-deployment', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourcesPage = response['resources']; - * if (!resourcesPage) { - * return; - * } - * for (var i = 0; i < resourcesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.resources.list(request, handlePage); - * } - * }; - * - * deploymentManager.resources.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.resources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Resources { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.resources.get + * @desc Gets information about a single resource. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * // The name of the resource for this request. + * resource_: 'my-resource', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * deploymentManager.resources.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.resources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {string} params.resource_ The name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'resource'], + pathParams: ['deployment', 'project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Types { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * deploymentmanager.resources.list + * @desc Lists all resources in a given deployment. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of the deployment for this request. + * deployment: 'my-deployment', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var resourcesPage = response['resources']; + * if (!resourcesPage) { + * return; + * } + * for (var i = 0; i < resourcesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `resourcesPage`: console.log(JSON.stringify(resourcesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * deploymentManager.resources.list(request, handlePage); + * } + * }; + * + * deploymentManager.resources.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.resources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * deploymentmanager.types.list - * @desc Lists all resource types for Deployment Manager. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Deployment Manager API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/deploymentmanager - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var deploymentManager = google.deploymentmanager('v2'); - * - * authorize(function(authClient) { - * var request = { - * // The project ID for this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var typesPage = response['types']; - * if (!typesPage) { - * return; - * } - * for (var i = 0; i < typesPage.length; i++) { - * // TODO: Change code below to process each resource in `typesPage`: - * console.log(JSON.stringify(typesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * deploymentManager.types.list(request, handlePage); - * } - * }; - * - * deploymentManager.types.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias deploymentmanager.types.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Types { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/v2/projects/{project}/global/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * deploymentmanager.types.list + * @desc Lists all resource types for Deployment Manager. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Deployment Manager API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/deploymentmanager + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var deploymentManager = google.deploymentmanager('v2'); + * + * authorize(function(authClient) { + * var request = { + * // The project ID for this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var typesPage = response['types']; + * if (!typesPage) { + * return; + * } + * for (var i = 0; i < typesPage.length; i++) { + * // TODO: Change code below to process each resource in `typesPage`: + * console.log(JSON.stringify(typesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * deploymentManager.types.list(request, handlePage); + * } + * }; + * + * deploymentManager.types.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias deploymentmanager.types.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/deploymentmanager/v2/projects/{project}/global/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/deploymentmanager/v2beta.ts b/src/apis/deploymentmanager/v2beta.ts index c275d27e954..27dcef3a445 100644 --- a/src/apis/deploymentmanager/v2beta.ts +++ b/src/apis/deploymentmanager/v2beta.ts @@ -27,3287 +27,3315 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Deployment Manager API V2Beta Methods - * - * The Deployment Manager API allows users to declaratively configure, deploy - * and run complex solutions on the Google Cloud Platform. - * - * @example - * const google = require('googleapis'); - * const deploymentmanager = google.deploymentmanager('v2beta'); - * - * @namespace deploymentmanager - * @type {Function} - * @version v2beta - * @variation v2beta - * @param {object=} options Options for Deploymentmanager - */ -export class Deploymentmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - compositeTypes: Resource$Compositetypes; - deployments: Resource$Deployments; - manifests: Resource$Manifests; - operations: Resource$Operations; - resources: Resource$Resources; - typeProviders: Resource$Typeproviders; - types: Resource$Types; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.compositeTypes = new Resource$Compositetypes(this); - this.deployments = new Resource$Deployments(this); - this.manifests = new Resource$Manifests(this); - this.operations = new Resource$Operations(this); - this.resources = new Resource$Resources(this); - this.typeProviders = new Resource$Typeproviders(this); - this.types = new Resource$Types(this); - } - - getRoot() { - return this.root; +export namespace deploymentmanager_v2beta { + /** + * Google Cloud Deployment Manager API V2Beta Methods + * + * The Deployment Manager API allows users to declaratively configure, deploy + * and run complex solutions on the Google Cloud Platform. + * + * @example + * const google = require('googleapis'); + * const deploymentmanager = google.deploymentmanager('v2beta'); + * + * @namespace deploymentmanager + * @type {Function} + * @version v2beta + * @variation v2beta + * @param {object=} options Options for Deploymentmanager + */ + export class Deploymentmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + compositeTypes: Resource$Compositetypes; + deployments: Resource$Deployments; + manifests: Resource$Manifests; + operations: Resource$Operations; + resources: Resource$Resources; + typeProviders: Resource$Typeproviders; + types: Resource$Types; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.compositeTypes = new Resource$Compositetypes(this); + this.deployments = new Resource$Deployments(this); + this.manifests = new Resource$Manifests(this); + this.operations = new Resource$Operations(this); + this.resources = new Resource$Resources(this); + this.typeProviders = new Resource$Typeproviders(this); + this.types = new Resource$Types(this); + } + + getRoot() { + return this.root; + } } -} -/** - * Async options that determine when a resource should finish. - */ -export interface Schema$AsyncOptions { - /** - * Method regex where this policy will apply. - */ - methodMatch: string; - /** - * Deployment manager will poll instances for this API resource setting a - * RUNNING state, and blocking until polling conditions tell whether the - * resource is completed or failed. - */ - pollingOptions: Schema$PollingOptions; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": "allServices" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", }, { "log_type": "ADMIN_READ", } - * ] }, { "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": "DATA_WRITE", - * "exempted_members": [ "user:bar@gmail.com" ] } ] } ] } - * For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - exemptedMembers: string[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { "log_type": - * "DATA_WRITE", } ] } This enables 'DATA_READ' and - * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ - * logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of [Binding.members][]. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Authorization-related information used by Cloud Audit Logging. - */ -export interface Schema$AuthorizationLoggingOptions { - /** - * The type of the permission that was checked. - */ - permissionType: string; -} -/** - * BaseType that describes a service-backed Type. - */ -export interface Schema$BaseType { - /** - * Allows resource handling overrides for specific collections - */ - collectionOverrides: Schema$CollectionOverride[]; - /** - * Credential used when interacting with this type. - */ - credential: Schema$Credential; - /** - * Descriptor Url for the this type. - */ - descriptorUrl: string; - /** - * Options to apply when handling any resources in this service. - */ - options: Schema$Options; -} -/** - * Basic Auth used as a credential. - */ -export interface Schema$BasicAuth { - password: string; - user: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * The condition that is associated with this binding. NOTE: an unsatisfied - * condition will not allow user access via current binding. Different - * bindings, including their conditions, are examined independently. This - * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. - */ - condition: Schema$Expr; - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or without a - * Google account. * `allAuthenticatedUsers`: A special identifier that - * represents anyone who is authenticated with a Google account or a service - * account. * `user:{emailid}`: An email address that represents a specific - * Google account. For example, `alice@gmail.com` or `joe@example.com`. * - * `serviceAccount:{emailid}`: An email address that represents a service - * account. For example, `my-other-app@appspot.gserviceaccount.com`. * - * `group:{emailid}`: An email address that represents a Google group. For - * example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain - * name that represents all the users of that domain. For example, - * `google.com` or `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. - */ - role: string; -} -/** - * CollectionOverride allows resource handling overrides for specific resources - * within a BaseType - */ -export interface Schema$CollectionOverride { - /** - * The collection that identifies this resource within its service. - */ - collection: string; - /** - * The options to apply to this resource-level override - */ - options: Schema$Options; -} -/** - * Holds the composite type. - */ -export interface Schema$CompositeType { - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the composite type was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$CompositeTypeLabelEntry[]; - /** - * Name of the composite type, must follow the expression: - * [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this composite type. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the type provider. - */ - selfLink: string; - status: string; - /** - * Files for the template type. - */ - templateContents: Schema$TemplateContents; -} -export interface Schema$CompositeTypeLabelEntry { - key: string; - value: string; -} -/** - * A response that returns all Composite Types supported by Deployment Manager - */ -export interface Schema$CompositeTypesListResponse { - /** - * Output only. A list of resource composite types supported by Deployment - * Manager. - */ - compositeTypes: Schema$CompositeType[]; - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; -} -/** - * A condition to be met. - */ -export interface Schema$Condition { - /** - * Trusted attributes supplied by the IAM system. - */ - iam: string; - /** - * An operator to apply the subject with. - */ - op: string; - /** - * Trusted attributes discharged by the service. - */ - svc: string; - /** - * Trusted attributes supplied by any service that owns resources and uses the - * IAM system for access control. - */ - sys: string; - /** - * DEPRECATED. Use 'values' instead. - */ - value: string; - /** - * The objects of the condition. This is mutually exclusive with - * 'value'. - */ - values: string[]; -} -export interface Schema$ConfigFile { - /** - * The contents of the file. - */ - content: string; -} -/** - * The credential used by Deployment Manager and TypeProvider. Only one of the - * options is permitted. - */ -export interface Schema$Credential { - /** - * Basic Auth Credential, only used by TypeProvider. - */ - basicAuth: Schema$BasicAuth; - /** - * Service Account Credential, only used by Deployment. - */ - serviceAccount: Schema$ServiceAccount; - /** - * Specify to use the project default credential, only supported by - * Deployment. - */ - useProjectDefault: boolean; -} -export interface Schema$Deployment { - /** - * An optional user-provided description of the deployment. - */ - description: string; - /** - * Provides a fingerprint to use in requests to modify a deployment, such as - * update(), stop(), and cancelPreview() requests. A fingerprint is a randomly - * generated value that must be provided with update(), stop(), and - * cancelPreview() requests to perform optimistic locking. This ensures - * optimistic concurrency so that only one request happens at a time. The - * fingerprint is initially generated by Deployment Manager and changes after - * every request to modify data. To get the latest fingerprint value, perform - * a get() request to a deployment. - */ - fingerprint: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the deployment was created, in RFC3339 text - * format . - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentLabelEntry[]; - /** - * Output only. URL of the manifest representing the last manifest that was - * successfully deployed. - */ - manifest: string; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must - * be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this deployment. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the deployment. - */ - selfLink: string; - /** - * [Input Only] The parameters that define your deployment, including the - * deployment configuration and relevant templates. - */ - target: Schema$TargetConfiguration; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this deployment, the updated configuration appears here. - */ - update: Schema$DeploymentUpdate; -} -export interface Schema$DeploymentLabelEntry { - key: string; - value: string; -} -export interface Schema$DeploymentsCancelPreviewRequest { - /** - * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a - * randomly generated value that must be provided in cancelPreview() requests - * to perform optimistic locking. This ensures optimistic concurrency so that - * the deployment does not have conflicting requests (e.g. if someone attempts - * to make a new update request while another user attempts to cancel a - * preview, this would prevent one of the requests). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -/** - * A response containing a partial list of deployments and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$DeploymentsListResponse { - /** - * Output only. The deployments contained in this response. - */ - deployments: Schema$Deployment[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -export interface Schema$DeploymentsStopRequest { - /** - * Specifies a fingerprint for stop() requests. A fingerprint is a randomly - * generated value that must be provided in stop() requests to perform - * optimistic locking. This ensures optimistic concurrency so that the - * deployment does not have conflicting requests (e.g. if someone attempts to - * make a new update request while another user attempts to stop an ongoing - * update request, this would prevent a collision). The fingerprint is - * initially generated by Deployment Manager and changes after every request - * to modify a deployment. To get the latest fingerprint value, perform a - * get() request on the deployment. - */ - fingerprint: string; -} -export interface Schema$DeploymentUpdate { - /** - * Output only. An optional user-provided description of the deployment after - * the current update has been applied. - */ - description: string; - /** - * Output only. Map of labels; provided by the client when the resource is - * created or updated. Specifically: Label keys must be between 1 and 63 - * characters long and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$DeploymentUpdateLabelEntry[]; - /** - * Output only. URL of the manifest representing the update configuration of - * this deployment. - */ - manifest: string; -} -export interface Schema$DeploymentUpdateLabelEntry { - key: string; - value: string; -} -export interface Schema$Diagnostic { - /** - * JsonPath expression on the resource that if non empty, indicates that this - * field needs to be extracted as a diagnostic. - */ - field: string; - /** - * Level to record this diagnostic. - */ - level: string; -} -/** - * Represents an expression text. Example: title: "User account - * presence" description: "Determines whether the request has a user - * account" expression: "size(request.user) > 0" - */ -export interface Schema$Expr { - /** - * An optional description of the expression. This is a longer text which - * describes the expression, e.g. when hovered over it in a UI. - */ - description: string; - /** - * Textual representation of an expression in Common Expression Language - * syntax. The application context of the containing message determines which - * well-known feature set of CEL is supported. - */ - expression: string; - /** - * An optional string indicating the location of the expression for error - * reporting, e.g. a file name and a position in the file. - */ - location: string; - /** - * An optional title for the expression, i.e. a short string describing its - * purpose. This can be used e.g. in UIs which allow to enter the expression. - */ - title: string; -} -export interface Schema$ImportFile { - /** - * The contents of the file. - */ - content: string; - /** - * The name of the file. - */ - name: string; -} -/** - * InputMapping creates a 'virtual' property that will be injected into - * the properties before sending the request to the underlying API. - */ -export interface Schema$InputMapping { - /** - * The name of the field that is going to be injected. - */ - fieldName: string; - /** - * The location where this mapping applies. - */ - location: string; - /** - * Regex to evaluate on method to decide if input applies. - */ - methodMatch: string; - /** - * A jsonPath expression to select an element. - */ - value: string; -} -/** - * Specifies what kind of log the caller must write - */ -export interface Schema$LogConfig { - /** - * Cloud audit options. - */ - cloudAudit: Schema$LogConfigCloudAuditOptions; - /** - * Counter options. - */ - counter: Schema$LogConfigCounterOptions; - /** - * Data access options. - */ - dataAccess: Schema$LogConfigDataAccessOptions; -} -/** - * Write a Cloud Audit log - */ -export interface Schema$LogConfigCloudAuditOptions { - /** - * Information used by the Cloud Audit Logging pipeline. - */ - authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; - /** - * The log_name to populate in the Cloud Audit Record. - */ - logName: string; -} -/** - * Increment a streamz counter with the specified metric and field names. Metric - * names should start with a '/', generally be lowercase-only, and end - * in "_count". Field names should not contain an initial slash. The - * actual exported metric names will have "/iam/policy" prepended. - * Field names correspond to IAM request parameters and field values are their - * respective values. At present the only supported field names are - - * "iam_principal", corresponding to IAMContext.principal; - - * "" (empty string), resulting in one aggretated counter with no - * field. Examples: counter { metric: "/debug_access_count" field: - * "iam_principal" } ==> increment counter - * /iam/policy/backend_debug_access_count {iam_principal=[value of - * IAMContext.principal]} At this time we do not support: * multiple field - * names (though this may be supported in the future) * decrementing the counter - * * incrementing it by anything other than 1 - */ -export interface Schema$LogConfigCounterOptions { - /** - * The field value to attribute. - */ - field: string; - /** - * The metric to update. - */ - metric: string; -} -/** - * Write a Data Access (Gin) log - */ -export interface Schema$LogConfigDataAccessOptions { - /** - * Whether Gin logging should happen in a fail-closed manner at the caller. - * This is relevant only in the LocalIAM implementation, for now. - */ - logMode: string; -} -export interface Schema$Manifest { - /** - * Output only. The YAML configuration for this manifest. - */ - config: Schema$ConfigFile; - /** - * Output only. The fully-expanded configuration file, including any templates - * and references. - */ - expandedConfig: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. The imported files for this manifest. - */ - imports: Schema$ImportFile[]; - /** - * Output only. Timestamp when the manifest was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Output only. The YAML layout for this manifest. - */ - layout: string; - /** - * Output only. The name of the manifest. - */ - name: string; /** - * Output only. Self link for the manifest. + * Async options that determine when a resource should finish. */ - selfLink: string; -} -/** - * A response containing a partial list of manifests and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ManifestsListResponse { - /** - * Output only. Manifests contained in this list response. - */ - manifests: Schema$Manifest[]; - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; -} -/** - * An Operation resource, used to manage asynchronous API requests. (== - * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations - * ==) (== resource_for v1.regionOperations ==) (== resource_for - * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== - * resource_for beta.zoneOperations ==) - */ -export interface Schema$Operation { - /** - * [Output Only] Reserved for future use. - */ - clientOperationId: string; - /** - * [Deprecated] This field is deprecated. - */ - creationTimestamp: string; + export interface Schema$AsyncOptions { + /** + * Method regex where this policy will apply. + */ + methodMatch: string; + /** + * Deployment manager will poll instances for this API resource setting a + * RUNNING state, and blocking until polling conditions tell whether the + * resource is completed or failed. + */ + pollingOptions: Schema$PollingOptions; + } /** - * [Output Only] A textual description of the operation, which is set when the - * operation is created. - */ - description: string; - /** - * [Output Only] The time that this operation was completed. This value is in - * RFC3339 text format. - */ - endTime: string; - /** - * [Output Only] If errors are generated during processing of the operation, - * this field will be populated. - */ - error: any; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * message that was returned, such as NOT FOUND. - */ - httpErrorMessage: string; - /** - * [Output Only] If the operation fails, this field contains the HTTP error - * status code that was returned. For example, a 404 means the resource was - * not found. - */ - httpErrorStatusCode: number; - /** - * [Output Only] The unique identifier for the resource. This identifier is - * defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This value is in - * RFC3339 text format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always compute#operation for Operation - * resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output Only] The type of operation, such as insert, update, or delete, and - * so on. - */ - operationType: string; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess when the operation will be - * complete. This number should monotonically increase as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] The URL of the region where the operation resides. Only - * available when performing regional operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - region: string; - /** - * [Output Only] Server-defined URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * value is in RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] The status of the operation, which can be one of the - * following: PENDING, RUNNING, or DONE. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] The unique target ID, which identifies a specific incarnation - * of the target resource. - */ - targetId: string; - /** - * [Output Only] The URL of the resource that the operation modifies. For - * operations related to creating a snapshot, this points to the persistent - * disk that the snapshot was created from. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If warning messages are generated during processing of the - * operation, this field will be populated. - */ - warnings: any[]; - /** - * [Output Only] The URL of the zone where the operation resides. Only - * available when performing per-zone operations. You must specify this field - * as part of the HTTP request URL. It is not settable as a field in the - * request body. - */ - zone: string; -} -/** - * A response containing a partial list of operations and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$OperationsListResponse { - /** - * Output only. A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. Operations contained in this list response. - */ - operations: Schema$Operation[]; -} -/** - * Options allows customized resource handling by Deployment Manager. - */ -export interface Schema$Options { - /** - * Options regarding how to thread async requests. - */ - asyncOptions: Schema$AsyncOptions[]; - /** - * The mappings that apply for requests. - */ - inputMappings: Schema$InputMapping[]; - /** - * Options for how to validate and process properties on a resource. - */ - validationOptions: Schema$ValidationOptions; - /** - * Additional properties block described as a jsonSchema, these properties - * will never be part of the json payload, but they can be consumed by - * InputMappings, this must be a valid json schema draft-04. The properties - * specified here will be decouple in a different section. This schema will be - * merged to the schema validation, and properties here will be extracted From - * the payload and consumed explicitly by InputMappings. ex: field1: type: - * string field2: type: number - */ - virtualProperties: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a description of IAM and its - * features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - iamOwned: boolean; - /** - * If more than one rule is specified, the rules are applied in the following - * manner: - All matching LOG rules are always applied. - If any - * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if any - * ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be - * applied if one or more matching rule requires logging. - Otherwise, if no - * rule applies, permission is denied. - */ - rules: Schema$Rule[]; - /** - * Deprecated. - */ - version: number; -} -export interface Schema$PollingOptions { - /** - * An array of diagnostics to be collected by Deployment Manager, these - * diagnostics will be displayed to the user. - */ - diagnostics: Schema$Diagnostic[]; - /** - * JsonPath expression that determines if the request failed. - */ - failCondition: string; - /** - * JsonPath expression that determines if the request is completed. - */ - finishCondition: string; - /** - * JsonPath expression that evaluates to string, it indicates where to poll. - */ - pollingLink: string; - /** - * JsonPath expression, after polling is completed, indicates where to fetch - * the resource. - */ - targetLink: string; -} -export interface Schema$Resource { - /** - * The Access Control Policy set on this resource. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. The evaluated properties of the resource with references - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the resource was created or acquired, in - * RFC3339 text format . - */ - insertTime: string; - /** - * Output only. URL of the manifest representing the current configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The name of the resource as it appears in the YAML config. - */ - name: string; - /** - * Output only. The current properties of the resource before any references - * have been filled in. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. The type of the resource, for example compute.v1.instance, or - * cloudfunctions.v1beta1.function. - */ - type: string; - /** - * Output only. If Deployment Manager is currently updating or previewing an - * update to this resource, the updated configuration appears here. - */ - update: Schema$ResourceUpdate; - /** - * Output only. Timestamp when the resource was updated, in RFC3339 text - * format . - */ - updateTime: string; - /** - * Output only. The URL of the actual resource. - */ - url: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * The access controls set on the resource. - */ -export interface Schema$ResourceAccessControl { - /** - * The GCP IAM Policy to set on the resource. - */ - gcpIamPolicy: string; -} -/** - * A response containing a partial list of resources and a page token used to - * build the next request if the request has been truncated. - */ -export interface Schema$ResourcesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Resources contained in this list response. - */ - resources: Schema$Resource[]; -} -export interface Schema$ResourceUpdate { - /** - * The Access Control Policy to set on this resource after updating the - * resource itself. - */ - accessControl: Schema$ResourceAccessControl; - /** - * Output only. If errors are generated during update of the resource, this - * field will be populated. - */ - error: any; - /** - * Output only. The expanded properties of the resource with reference values - * expanded. Returned as serialized YAML. - */ - finalProperties: string; - /** - * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. - */ - intent: string; - /** - * Output only. URL of the manifest representing the update configuration of - * this resource. - */ - manifest: string; - /** - * Output only. The set of updated properties for this resource, before - * references are expanded. Returned as serialized YAML. - */ - properties: string; - /** - * Output only. The state of the resource. - */ - state: string; - /** - * Output only. If warning messages are generated during processing of this - * resource, this field will be populated. - */ - warnings: any[]; -} -/** - * A rule to be applied in a Policy. - */ -export interface Schema$Rule { - /** - * Required - */ - action: string; - /** - * Additional restrictions that must be met. All conditions must pass for the - * rule to match. - */ - conditions: Schema$Condition[]; - /** - * Human-readable description of the rule. - */ - description: string; - /** - * If one or more 'in' clauses are specified, the rule matches if the - * PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. - */ - ins: string[]; - /** - * The config returned to callers of tech.iam.IAM.CheckPolicy for any entries - * that match the LOG action. - */ - logConfigs: Schema$LogConfig[]; - /** - * If one or more 'not_in' clauses are specified, the rule matches if - * the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. - */ - notIns: string[]; - /** - * A permission is a string of form '..' (e.g., - * 'storage.buckets.list'). A value of '*' matches all - * permissions, and a verb part of '*' (e.g., - * 'storage.buckets.*') matches all verbs. - */ - permissions: string[]; -} -/** - * Service Account used as a credential. - */ -export interface Schema$ServiceAccount { - /** - * The IAM service account email address like - * test@myproject.iam.gserviceaccount.com - */ - email: string; -} -export interface Schema$TargetConfiguration { - /** - * The configuration to use for this deployment. - */ - config: Schema$ConfigFile; - /** - * Specifies any files to import for this configuration. This can be used to - * import templates or other files. For example, you might import a text file - * in order to use the file in a template. - */ - imports: Schema$ImportFile[]; -} -/** - * Files that make up the template contents of a template type. - */ -export interface Schema$TemplateContents { - /** - * Import files referenced by the main template. - */ - imports: Schema$ImportFile[]; - /** - * Which interpreter (python or jinja) should be used during expansion. - */ - interpreter: string; - /** - * The filename of the mainTemplate - */ - mainTemplate: string; - /** - * The contents of the template schema. - */ - schema: string; - /** - * The contents of the main template file. - */ - template: string; -} -export interface Schema$TestPermissionsRequest { - /** - * The set of permissions to check for the 'resource'. Permissions - * with wildcards (such as '*' or 'storage.*') are not - * allowed. - */ - permissions: string[]; -} -export interface Schema$TestPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A resource type supported by Deployment Manager. - */ -export interface Schema$Type { - /** - * Base Type (configurable service) that backs this Type. - */ - base: Schema$BaseType; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the type was created, in RFC3339 text format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$TypeLabelEntry[]; - /** - * Name of the type. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this type. - */ - operation: Schema$Operation; - /** - * Output only. Self link for the type. - */ - selfLink: string; -} -/** - * Contains detailed information about a composite type, base type, or base type - * with specific collection. - */ -export interface Schema$TypeInfo { - /** - * The description of the type. - */ - description: string; - /** - * For swagger 2.0 externalDocs field will be used. For swagger 1.2 this field - * will be empty. - */ - documentationLink: string; - /** - * Output only. Type of the output. Always deploymentManager#TypeInfo for - * TypeInfo. - */ - kind: string; - /** - * The base type or composite type name. - */ - name: string; - /** - * For base types with a collection, we return a schema and documentation link - * For template types, we return only a schema - */ - schema: Schema$TypeInfoSchemaInfo; - /** - * Output only. Server-defined URL for the resource. - */ - selfLink: string; - /** - * The title on the API descriptor URL provided. - */ - title: string; -} -export interface Schema$TypeInfoSchemaInfo { - /** - * The properties that this composite type or base type collection accept as - * input, represented as a json blob, format is: JSON Schema Draft V4 - */ - input: string; - /** - * The properties that this composite type or base type collection exposes as - * output, these properties can be used for references, represented as json - * blob, format is: JSON Schema Draft V4 - */ - output: string; -} -export interface Schema$TypeLabelEntry { - key: string; - value: string; -} -/** - * A type provider that describes a service-backed Type. - */ -export interface Schema$TypeProvider { - /** - * Allows resource handling overrides for specific collections - */ - collectionOverrides: Schema$CollectionOverride[]; - /** - * Credential used when interacting with this type. - */ - credential: Schema$Credential; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * Descriptor Url for the this type provider. - */ - descriptorUrl: string; - /** - * Output only. Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Output only. Timestamp when the type provider was created, in RFC3339 text - * format. - */ - insertTime: string; - /** - * Map of labels; provided by the client when the resource is created or - * updated. Specifically: Label keys must be between 1 and 63 characters long - * and must conform to the following regular expression: - * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters - * long and must conform to the regular expression - * ([a-z]([-a-z0-9]*[a-z0-9])?)? - */ - labels: Schema$TypeProviderLabelEntry[]; - /** - * Name of the resource; provided by the client when the resource is created. - * The name must be 1-63 characters long, and comply with RFC1035. - * Specifically, the name must be 1-63 characters long and match the regular - * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must - * be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - name: string; - /** - * Output only. The Operation that most recently ran, or is currently running, - * on this type provider. - */ - operation: Schema$Operation; - /** - * Options to apply when handling any resources in this service. - */ - options: Schema$Options; - /** - * Output only. Self link for the type provider. - */ - selfLink: string; -} -export interface Schema$TypeProviderLabelEntry { - key: string; - value: string; -} -/** - * A response that returns all Type Providers supported by Deployment Manager - */ -export interface Schema$TypeProvidersListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource type providers supported by Deployment - * Manager. - */ - typeProviders: Schema$TypeProvider[]; -} -export interface Schema$TypeProvidersListTypesResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource type info. - */ - types: Schema$TypeInfo[]; -} -/** - * A response that returns all Types supported by Deployment Manager - */ -export interface Schema$TypesListResponse { - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * Output only. A list of resource types supported by Deployment Manager. - */ - types: Schema$Type[]; -} -/** - * Options for how to validate and process properties on a resource. - */ -export interface Schema$ValidationOptions { + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { "log_type": + * "ADMIN_READ", } ] }, { "service": + * "fooservice.googleapis.com" "audit_log_configs": [ { + * "log_type": "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } ] } For fooservice, this policy + * enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts + * foo@gmail.com from DATA_READ logging, and bar@gmail.com from DATA_WRITE + * logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + exemptedMembers: string[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * Customize how deployment manager will validate the resource against schema - * errors. - */ - schemaValidation: string; + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { "log_type": + * "DATA_WRITE", } ] } This enables 'DATA_READ' and + * 'DATA_WRITE' logging, while exempting foo@gmail.com from DATA_READ + * logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of [Binding.members][]. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Specify what to do with extra properties when executing a request. + * Authorization-related information used by Cloud Audit Logging. */ - undeclaredProperties: string; -} - -export class Resource$Compositetypes { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AuthorizationLoggingOptions { + /** + * The type of the permission that was checked. + */ + permissionType: string; } - - getRoot() { - return this.root; + /** + * BaseType that describes a service-backed Type. + */ + export interface Schema$BaseType { + /** + * Allows resource handling overrides for specific collections + */ + collectionOverrides: Schema$CollectionOverride[]; + /** + * Credential used when interacting with this type. + */ + credential: Schema$Credential; + /** + * Descriptor Url for the this type. + */ + descriptorUrl: string; + /** + * Options to apply when handling any resources in this service. + */ + options: Schema$Options; } - - /** - * deploymentmanager.compositeTypes.delete - * @desc Deletes a composite type. - * @alias deploymentmanager.compositeTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the type for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Basic Auth used as a credential. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$BasicAuth { + password: string; + user: string; } - - /** - * deploymentmanager.compositeTypes.get - * @desc Gets information about a specific composite type. - * @alias deploymentmanager.compositeTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * The condition that is associated with this binding. NOTE: an unsatisfied + * condition will not allow user access via current binding. Different + * bindings, including their conditions, are examined independently. This + * field is only visible as GOOGLE_INTERNAL or CONDITION_TRUSTED_TESTER. + */ + condition: Schema$Expr; + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or without + * a Google account. * `allAuthenticatedUsers`: A special identifier that + * represents anyone who is authenticated with a Google account or a service + * account. * `user:{emailid}`: An email address that represents a specific + * Google account. For example, `alice@gmail.com` or `joe@example.com`. * + * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. + */ + role: string; } - - /** - * deploymentmanager.compositeTypes.insert - * @desc Creates a composite type. - * @alias deploymentmanager.compositeTypes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * CollectionOverride allows resource handling overrides for specific + * resources within a BaseType + */ + export interface Schema$CollectionOverride { + /** + * The collection that identifies this resource within its service. + */ + collection: string; + /** + * The options to apply to this resource-level override + */ + options: Schema$Options; } - - /** - * deploymentmanager.compositeTypes.list - * @desc Lists all composite types for Deployment Manager. - * @alias deploymentmanager.compositeTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Holds the composite type. + */ + export interface Schema$CompositeType { + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the composite type was created, in RFC3339 + * text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$CompositeTypeLabelEntry[]; + /** + * Name of the composite type, must follow the expression: + * [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this composite type. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the type provider. + */ + selfLink: string; + status: string; + /** + * Files for the template type. + */ + templateContents: Schema$TemplateContents; + } + export interface Schema$CompositeTypeLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.compositeTypes.patch - * @desc Updates a composite type. This method supports patch semantics. - * @alias deploymentmanager.compositeTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response that returns all Composite Types supported by Deployment Manager + */ + export interface Schema$CompositeTypesListResponse { + /** + * Output only. A list of resource composite types supported by Deployment + * Manager. + */ + compositeTypes: Schema$CompositeType[]; + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; } - - /** - * deploymentmanager.compositeTypes.update - * @desc Updates a composite type. - * @alias deploymentmanager.compositeTypes.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.compositeType The name of the composite type for this request. - * @param {string} params.project The project ID for this request. - * @param {().CompositeType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'compositeType'], - pathParams: ['compositeType', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A condition to be met. + */ + export interface Schema$Condition { + /** + * Trusted attributes supplied by the IAM system. + */ + iam: string; + /** + * An operator to apply the subject with. + */ + op: string; + /** + * Trusted attributes discharged by the service. + */ + svc: string; + /** + * Trusted attributes supplied by any service that owns resources and uses + * the IAM system for access control. + */ + sys: string; + /** + * DEPRECATED. Use 'values' instead. + */ + value: string; + /** + * The objects of the condition. This is mutually exclusive with + * 'value'. + */ + values: string[]; } -} - -export class Resource$Deployments { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ConfigFile { + /** + * The contents of the file. + */ + content: string; } - - getRoot() { - return this.root; + /** + * The credential used by Deployment Manager and TypeProvider. Only one of the + * options is permitted. + */ + export interface Schema$Credential { + /** + * Basic Auth Credential, only used by TypeProvider. + */ + basicAuth: Schema$BasicAuth; + /** + * Service Account Credential, only used by Deployment. + */ + serviceAccount: Schema$ServiceAccount; + /** + * Specify to use the project default credential, only supported by + * Deployment. + */ + useProjectDefault: boolean; + } + export interface Schema$Deployment { + /** + * An optional user-provided description of the deployment. + */ + description: string; + /** + * Provides a fingerprint to use in requests to modify a deployment, such as + * update(), stop(), and cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided with update(), stop(), and + * cancelPreview() requests to perform optimistic locking. This ensures + * optimistic concurrency so that only one request happens at a time. The + * fingerprint is initially generated by Deployment Manager and changes + * after every request to modify data. To get the latest fingerprint value, + * perform a get() request to a deployment. + */ + fingerprint: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the deployment was created, in RFC3339 text + * format . + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentLabelEntry[]; + /** + * Output only. URL of the manifest representing the last manifest that was + * successfully deployed. + */ + manifest: string; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this deployment. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the deployment. + */ + selfLink: string; + /** + * [Input Only] The parameters that define your deployment, including the + * deployment configuration and relevant templates. + */ + target: Schema$TargetConfiguration; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this deployment, the updated configuration appears here. + */ + update: Schema$DeploymentUpdate; + } + export interface Schema$DeploymentLabelEntry { + key: string; + value: string; + } + export interface Schema$DeploymentsCancelPreviewRequest { + /** + * Specifies a fingerprint for cancelPreview() requests. A fingerprint is a + * randomly generated value that must be provided in cancelPreview() + * requests to perform optimistic locking. This ensures optimistic + * concurrency so that the deployment does not have conflicting requests + * (e.g. if someone attempts to make a new update request while another user + * attempts to cancel a preview, this would prevent one of the requests). + * The fingerprint is initially generated by Deployment Manager and changes + * after every request to modify a deployment. To get the latest fingerprint + * value, perform a get() request on the deployment. + */ + fingerprint: string; } - - /** - * deploymentmanager.deployments.cancelPreview - * @desc Cancels and removes the preview currently associated with the - * deployment. - * @alias deploymentmanager.deployments.cancelPreview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancelPreview(params?: any, options?: MethodOptions): - AxiosPromise; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancelPreview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/cancelPreview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of deployments and a page token used + * to build the next request if the request has been truncated. + */ + export interface Schema$DeploymentsListResponse { + /** + * Output only. The deployments contained in this response. + */ + deployments: Schema$Deployment[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + } + export interface Schema$DeploymentsStopRequest { + /** + * Specifies a fingerprint for stop() requests. A fingerprint is a randomly + * generated value that must be provided in stop() requests to perform + * optimistic locking. This ensures optimistic concurrency so that the + * deployment does not have conflicting requests (e.g. if someone attempts + * to make a new update request while another user attempts to stop an + * ongoing update request, this would prevent a collision). The fingerprint + * is initially generated by Deployment Manager and changes after every + * request to modify a deployment. To get the latest fingerprint value, + * perform a get() request on the deployment. + */ + fingerprint: string; + } + export interface Schema$DeploymentUpdate { + /** + * Output only. An optional user-provided description of the deployment + * after the current update has been applied. + */ + description: string; + /** + * Output only. Map of labels; provided by the client when the resource is + * created or updated. Specifically: Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$DeploymentUpdateLabelEntry[]; + /** + * Output only. URL of the manifest representing the update configuration of + * this deployment. + */ + manifest: string; + } + export interface Schema$DeploymentUpdateLabelEntry { + key: string; + value: string; + } + export interface Schema$Diagnostic { + /** + * JsonPath expression on the resource that if non empty, indicates that + * this field needs to be extracted as a diagnostic. + */ + field: string; + /** + * Level to record this diagnostic. + */ + level: string; } - - /** - * deploymentmanager.deployments.delete - * @desc Deletes a deployment and all of the resources in the deployment. - * @alias deploymentmanager.deployments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an expression text. Example: title: "User account + * presence" description: "Determines whether the request has a user + * account" expression: "size(request.user) > 0" + */ + export interface Schema$Expr { + /** + * An optional description of the expression. This is a longer text which + * describes the expression, e.g. when hovered over it in a UI. + */ + description: string; + /** + * Textual representation of an expression in Common Expression Language + * syntax. The application context of the containing message determines + * which well-known feature set of CEL is supported. + */ + expression: string; + /** + * An optional string indicating the location of the expression for error + * reporting, e.g. a file name and a position in the file. + */ + location: string; + /** + * An optional title for the expression, i.e. a short string describing its + * purpose. This can be used e.g. in UIs which allow to enter the + * expression. + */ + title: string; + } + export interface Schema$ImportFile { + /** + * The contents of the file. + */ + content: string; + /** + * The name of the file. + */ + name: string; } - - /** - * deploymentmanager.deployments.get - * @desc Gets information about a specific deployment. - * @alias deploymentmanager.deployments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * InputMapping creates a 'virtual' property that will be injected + * into the properties before sending the request to the underlying API. + */ + export interface Schema$InputMapping { + /** + * The name of the field that is going to be injected. + */ + fieldName: string; + /** + * The location where this mapping applies. + */ + location: string; + /** + * Regex to evaluate on method to decide if input applies. + */ + methodMatch: string; + /** + * A jsonPath expression to select an element. + */ + value: string; } - - /** - * deploymentmanager.deployments.getIamPolicy - * @desc Gets the access control policy for a resource. May be empty if no - * such policy or resource exists. - * @alias deploymentmanager.deployments.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies what kind of log the caller must write + */ + export interface Schema$LogConfig { + /** + * Cloud audit options. + */ + cloudAudit: Schema$LogConfigCloudAuditOptions; + /** + * Counter options. + */ + counter: Schema$LogConfigCounterOptions; + /** + * Data access options. + */ + dataAccess: Schema$LogConfigDataAccessOptions; } - - /** - * deploymentmanager.deployments.insert - * @desc Creates a deployment and all of the resources described by the - * deployment manifest. - * @alias deploymentmanager.deployments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Write a Cloud Audit log + */ + export interface Schema$LogConfigCloudAuditOptions { + /** + * Information used by the Cloud Audit Logging pipeline. + */ + authorizationLoggingOptions: Schema$AuthorizationLoggingOptions; + /** + * The log_name to populate in the Cloud Audit Record. + */ + logName: string; } - - /** - * deploymentmanager.deployments.list - * @desc Lists all deployments for a given project. - * @alias deploymentmanager.deployments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Increment a streamz counter with the specified metric and field names. + * Metric names should start with a '/', generally be lowercase-only, + * and end in "_count". Field names should not contain an initial + * slash. The actual exported metric names will have "/iam/policy" + * prepended. Field names correspond to IAM request parameters and field + * values are their respective values. At present the only supported field + * names are - "iam_principal", corresponding to + * IAMContext.principal; - "" (empty string), resulting in one + * aggretated counter with no field. Examples: counter { metric: + * "/debug_access_count" field: "iam_principal" } ==> + * increment counter /iam/policy/backend_debug_access_count + * {iam_principal=[value of IAMContext.principal]} At this time we do not + * support: * multiple field names (though this may be supported in the + * future) * decrementing the counter * incrementing it by anything other than + * 1 + */ + export interface Schema$LogConfigCounterOptions { + /** + * The field value to attribute. + */ + field: string; + /** + * The metric to update. + */ + metric: string; } - - /** - * deploymentmanager.deployments.patch - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. This method supports patch semantics. - * @alias deploymentmanager.deployments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Write a Data Access (Gin) log */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$LogConfigDataAccessOptions { + /** + * Whether Gin logging should happen in a fail-closed manner at the caller. + * This is relevant only in the LocalIAM implementation, for now. + */ + logMode: string; + } + export interface Schema$Manifest { + /** + * Output only. The YAML configuration for this manifest. + */ + config: Schema$ConfigFile; + /** + * Output only. The fully-expanded configuration file, including any + * templates and references. + */ + expandedConfig: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. The imported files for this manifest. + */ + imports: Schema$ImportFile[]; + /** + * Output only. Timestamp when the manifest was created, in RFC3339 text + * format. + */ + insertTime: string; + /** + * Output only. The YAML layout for this manifest. + */ + layout: string; + /** + * Output only. The name of the manifest. + */ + name: string; + /** + * Output only. Self link for the manifest. + */ + selfLink: string; } - - /** - * deploymentmanager.deployments.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias deploymentmanager.deployments.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of manifests and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ManifestsListResponse { + /** + * Output only. Manifests contained in this list response. + */ + manifests: Schema$Manifest[]; + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; } - - /** - * deploymentmanager.deployments.stop - * @desc Stops an ongoing operation. This does not roll back any work that has - * already been completed, but prevents any new work from being started. - * @alias deploymentmanager.deployments.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {().DeploymentsStopRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An Operation resource, used to manage asynchronous API requests. (== + * resource_for v1.globalOperations ==) (== resource_for beta.globalOperations + * ==) (== resource_for v1.regionOperations ==) (== resource_for + * beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== + * resource_for beta.zoneOperations ==) + */ + export interface Schema$Operation { + /** + * [Output Only] Reserved for future use. + */ + clientOperationId: string; + /** + * [Deprecated] This field is deprecated. + */ + creationTimestamp: string; + /** + * [Output Only] A textual description of the operation, which is set when + * the operation is created. + */ + description: string; + /** + * [Output Only] The time that this operation was completed. This value is + * in RFC3339 text format. + */ + endTime: string; + /** + * [Output Only] If errors are generated during processing of the operation, + * this field will be populated. + */ + error: any; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * message that was returned, such as NOT FOUND. + */ + httpErrorMessage: string; + /** + * [Output Only] If the operation fails, this field contains the HTTP error + * status code that was returned. For example, a 404 means the resource was + * not found. + */ + httpErrorStatusCode: number; + /** + * [Output Only] The unique identifier for the resource. This identifier is + * defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This value is + * in RFC3339 text format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always compute#operation for + * Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output Only] The type of operation, such as insert, update, or delete, + * and so on. + */ + operationType: string; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess when the operation will be + * complete. This number should monotonically increase as the operation + * progresses. + */ + progress: number; + /** + * [Output Only] The URL of the region where the operation resides. Only + * available when performing regional operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + region: string; + /** + * [Output Only] Server-defined URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This value is in RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] The status of the operation, which can be one of the + * following: PENDING, RUNNING, or DONE. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] The unique target ID, which identifies a specific + * incarnation of the target resource. + */ + targetId: string; + /** + * [Output Only] The URL of the resource that the operation modifies. For + * operations related to creating a snapshot, this points to the persistent + * disk that the snapshot was created from. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If warning messages are generated during processing of the + * operation, this field will be populated. + */ + warnings: any[]; + /** + * [Output Only] The URL of the zone where the operation resides. Only + * available when performing per-zone operations. You must specify this + * field as part of the HTTP request URL. It is not settable as a field in + * the request body. + */ + zone: string; } - - /** - * deploymentmanager.deployments.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. - * @alias deploymentmanager.deployments.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID for this request. - * @param {string} params.resource_ Name of the resource for this request. - * @param {().TestPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'resource'], - pathParams: ['project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of operations and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$OperationsListResponse { + /** + * Output only. A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. Operations contained in this list response. + */ + operations: Schema$Operation[]; } - - /** - * deploymentmanager.deployments.update - * @desc Updates a deployment and all of the resources described by the - * deployment manifest. - * @alias deploymentmanager.deployments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createPolicy Sets the policy to use for creating new resources. - * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. - * @param {string} params.deployment The name of the deployment for this request. - * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. - * @param {string} params.project The project ID for this request. - * @param {().Deployment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Options allows customized resource handling by Deployment Manager. + */ + export interface Schema$Options { + /** + * Options regarding how to thread async requests. + */ + asyncOptions: Schema$AsyncOptions[]; + /** + * The mappings that apply for requests. + */ + inputMappings: Schema$InputMapping[]; + /** + * Options for how to validate and process properties on a resource. + */ + validationOptions: Schema$ValidationOptions; + /** + * Additional properties block described as a jsonSchema, these properties + * will never be part of the json payload, but they can be consumed by + * InputMappings, this must be a valid json schema draft-04. The properties + * specified here will be decouple in a different section. This schema will + * be merged to the schema validation, and properties here will be extracted + * From the payload and consumed explicitly by InputMappings. ex: field1: + * type: string field2: type: number + */ + virtualProperties: string; } -} - -export class Resource$Manifests { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { "role": + * "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } For a description of IAM and its + * features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + iamOwned: boolean; + /** + * If more than one rule is specified, the rules are applied in the + * following manner: - All matching LOG rules are always applied. - If any + * DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be + * applied if one or more matching rule requires logging. - Otherwise, if + * any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging + * will be applied if one or more matching rule requires logging. - + * Otherwise, if no rule applies, permission is denied. + */ + rules: Schema$Rule[]; + /** + * Deprecated. + */ + version: number; } - - getRoot() { - return this.root; + export interface Schema$PollingOptions { + /** + * An array of diagnostics to be collected by Deployment Manager, these + * diagnostics will be displayed to the user. + */ + diagnostics: Schema$Diagnostic[]; + /** + * JsonPath expression that determines if the request failed. + */ + failCondition: string; + /** + * JsonPath expression that determines if the request is completed. + */ + finishCondition: string; + /** + * JsonPath expression that evaluates to string, it indicates where to poll. + */ + pollingLink: string; + /** + * JsonPath expression, after polling is completed, indicates where to fetch + * the resource. + */ + targetLink: string; + } + export interface Schema$Resource { + /** + * The Access Control Policy set on this resource. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. The evaluated properties of the resource with references + * expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the resource was created or acquired, in + * RFC3339 text format . + */ + insertTime: string; + /** + * Output only. URL of the manifest representing the current configuration + * of this resource. + */ + manifest: string; + /** + * Output only. The name of the resource as it appears in the YAML config. + */ + name: string; + /** + * Output only. The current properties of the resource before any references + * have been filled in. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. The type of the resource, for example compute.v1.instance, + * or cloudfunctions.v1beta1.function. + */ + type: string; + /** + * Output only. If Deployment Manager is currently updating or previewing an + * update to this resource, the updated configuration appears here. + */ + update: Schema$ResourceUpdate; + /** + * Output only. Timestamp when the resource was updated, in RFC3339 text + * format . + */ + updateTime: string; + /** + * Output only. The URL of the actual resource. + */ + url: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; } - - /** - * deploymentmanager.manifests.get - * @desc Gets information about a specific manifest. - * @alias deploymentmanager.manifests.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.manifest The name of the manifest for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The access controls set on the resource. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'manifest'], - pathParams: ['deployment', 'manifest', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ResourceAccessControl { + /** + * The GCP IAM Policy to set on the resource. + */ + gcpIamPolicy: string; } - - /** - * deploymentmanager.manifests.list - * @desc Lists all manifests for a given deployment. - * @alias deploymentmanager.manifests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing a partial list of resources and a page token used to + * build the next request if the request has been truncated. + */ + export interface Schema$ResourcesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Resources contained in this list response. + */ + resources: Schema$Resource[]; } -} - -export class Resource$Operations { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ResourceUpdate { + /** + * The Access Control Policy to set on this resource after updating the + * resource itself. + */ + accessControl: Schema$ResourceAccessControl; + /** + * Output only. If errors are generated during update of the resource, this + * field will be populated. + */ + error: any; + /** + * Output only. The expanded properties of the resource with reference + * values expanded. Returned as serialized YAML. + */ + finalProperties: string; + /** + * Output only. The intent of the resource: PREVIEW, UPDATE, or CANCEL. + */ + intent: string; + /** + * Output only. URL of the manifest representing the update configuration of + * this resource. + */ + manifest: string; + /** + * Output only. The set of updated properties for this resource, before + * references are expanded. Returned as serialized YAML. + */ + properties: string; + /** + * Output only. The state of the resource. + */ + state: string; + /** + * Output only. If warning messages are generated during processing of this + * resource, this field will be populated. + */ + warnings: any[]; } - - getRoot() { - return this.root; + /** + * A rule to be applied in a Policy. + */ + export interface Schema$Rule { + /** + * Required + */ + action: string; + /** + * Additional restrictions that must be met. All conditions must pass for + * the rule to match. + */ + conditions: Schema$Condition[]; + /** + * Human-readable description of the rule. + */ + description: string; + /** + * If one or more 'in' clauses are specified, the rule matches if + * the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + */ + ins: string[]; + /** + * The config returned to callers of tech.iam.IAM.CheckPolicy for any + * entries that match the LOG action. + */ + logConfigs: Schema$LogConfig[]; + /** + * If one or more 'not_in' clauses are specified, the rule matches + * if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + */ + notIns: string[]; + /** + * A permission is a string of form '..' (e.g., + * 'storage.buckets.list'). A value of '*' matches all + * permissions, and a verb part of '*' (e.g., + * 'storage.buckets.*') matches all verbs. + */ + permissions: string[]; } - - /** - * deploymentmanager.operations.get - * @desc Gets information about a specific operation. - * @alias deploymentmanager.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation The name of the operation for this request. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Service Account used as a credential. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ServiceAccount { + /** + * The IAM service account email address like + * test@myproject.iam.gserviceaccount.com + */ + email: string; + } + export interface Schema$TargetConfiguration { + /** + * The configuration to use for this deployment. + */ + config: Schema$ConfigFile; + /** + * Specifies any files to import for this configuration. This can be used to + * import templates or other files. For example, you might import a text + * file in order to use the file in a template. + */ + imports: Schema$ImportFile[]; } - - /** - * deploymentmanager.operations.list - * @desc Lists all operations for a project. - * @alias deploymentmanager.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Files that make up the template contents of a template type. + */ + export interface Schema$TemplateContents { + /** + * Import files referenced by the main template. + */ + imports: Schema$ImportFile[]; + /** + * Which interpreter (python or jinja) should be used during expansion. + */ + interpreter: string; + /** + * The filename of the mainTemplate + */ + mainTemplate: string; + /** + * The contents of the template schema. + */ + schema: string; + /** + * The contents of the main template file. + */ + template: string; } -} - -export class Resource$Resources { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$TestPermissionsRequest { + /** + * The set of permissions to check for the 'resource'. Permissions + * with wildcards (such as '*' or 'storage.*') are not + * allowed. + */ + permissions: string[]; } - - getRoot() { - return this.root; + export interface Schema$TestPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * deploymentmanager.resources.get - * @desc Gets information about a single resource. - * @alias deploymentmanager.resources.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string} params.project The project ID for this request. - * @param {string} params.resource_ The name of the resource for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources/{resource}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment', 'resource'], - pathParams: ['deployment', 'project', 'resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A resource type supported by Deployment Manager. + */ + export interface Schema$Type { + /** + * Base Type (configurable service) that backs this Type. + */ + base: Schema$BaseType; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the type was created, in RFC3339 text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$TypeLabelEntry[]; + /** + * Name of the type. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this type. + */ + operation: Schema$Operation; + /** + * Output only. Self link for the type. + */ + selfLink: string; } - - /** - * deploymentmanager.resources.list - * @desc Lists all resources in a given deployment. - * @alias deploymentmanager.resources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deployment The name of the deployment for this request. - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'deployment'], - pathParams: ['deployment', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Contains detailed information about a composite type, base type, or base + * type with specific collection. + */ + export interface Schema$TypeInfo { + /** + * The description of the type. + */ + description: string; + /** + * For swagger 2.0 externalDocs field will be used. For swagger 1.2 this + * field will be empty. + */ + documentationLink: string; + /** + * Output only. Type of the output. Always deploymentManager#TypeInfo for + * TypeInfo. + */ + kind: string; + /** + * The base type or composite type name. + */ + name: string; + /** + * For base types with a collection, we return a schema and documentation + * link For template types, we return only a schema + */ + schema: Schema$TypeInfoSchemaInfo; + /** + * Output only. Server-defined URL for the resource. + */ + selfLink: string; + /** + * The title on the API descriptor URL provided. + */ + title: string; } -} - -export class Resource$Typeproviders { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$TypeInfoSchemaInfo { + /** + * The properties that this composite type or base type collection accept as + * input, represented as a json blob, format is: JSON Schema Draft V4 + */ + input: string; + /** + * The properties that this composite type or base type collection exposes + * as output, these properties can be used for references, represented as + * json blob, format is: JSON Schema Draft V4 + */ + output: string; } - - getRoot() { - return this.root; + export interface Schema$TypeLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.typeProviders.delete - * @desc Deletes a type provider. - * @alias deploymentmanager.typeProviders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A type provider that describes a service-backed Type. + */ + export interface Schema$TypeProvider { + /** + * Allows resource handling overrides for specific collections + */ + collectionOverrides: Schema$CollectionOverride[]; + /** + * Credential used when interacting with this type. + */ + credential: Schema$Credential; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * Descriptor Url for the this type provider. + */ + descriptorUrl: string; + /** + * Output only. Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Output only. Timestamp when the type provider was created, in RFC3339 + * text format. + */ + insertTime: string; + /** + * Map of labels; provided by the client when the resource is created or + * updated. Specifically: Label keys must be between 1 and 63 characters + * long and must conform to the following regular expression: + * [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * ([a-z]([-a-z0-9]*[a-z0-9])?)? + */ + labels: Schema$TypeProviderLabelEntry[]; + /** + * Name of the resource; provided by the client when the resource is + * created. The name must be 1-63 characters long, and comply with RFC1035. + * Specifically, the name must be 1-63 characters long and match the regular + * expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character + * must be a lowercase letter, and all following characters must be a dash, + * lowercase letter, or digit, except the last character, which cannot be a + * dash. + */ + name: string; + /** + * Output only. The Operation that most recently ran, or is currently + * running, on this type provider. + */ + operation: Schema$Operation; + /** + * Options to apply when handling any resources in this service. + */ + options: Schema$Options; + /** + * Output only. Self link for the type provider. + */ + selfLink: string; + } + export interface Schema$TypeProviderLabelEntry { + key: string; + value: string; } - - /** - * deploymentmanager.typeProviders.get - * @desc Gets information about a specific type provider. - * @alias deploymentmanager.typeProviders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response that returns all Type Providers supported by Deployment Manager + */ + export interface Schema$TypeProvidersListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource type providers supported by Deployment + * Manager. + */ + typeProviders: Schema$TypeProvider[]; + } + export interface Schema$TypeProvidersListTypesResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource type info. + */ + types: Schema$TypeInfo[]; } - - /** - * deploymentmanager.typeProviders.getType - * @desc Gets a type info for a type provided by a TypeProvider. - * @alias deploymentmanager.typeProviders.getType - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.type The name of the type provider for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getType(params?: any, options?: MethodOptions): AxiosPromise; - getType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getType( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types/{type}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider', 'type'], - pathParams: ['project', 'type', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response that returns all Types supported by Deployment Manager + */ + export interface Schema$TypesListResponse { + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * Output only. A list of resource types supported by Deployment Manager. + */ + types: Schema$Type[]; } - - /** - * deploymentmanager.typeProviders.insert - * @desc Creates a type provider. - * @alias deploymentmanager.typeProviders.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Options for how to validate and process properties on a resource. */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ValidationOptions { + /** + * Customize how deployment manager will validate the resource against + * schema errors. + */ + schemaValidation: string; + /** + * Specify what to do with extra properties when executing a request. + */ + undeclaredProperties: string; } - - /** - * deploymentmanager.typeProviders.list - * @desc Lists all resource type providers for Deployment Manager. - * @alias deploymentmanager.typeProviders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Compositetypes { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.compositeTypes.delete + * @desc Deletes a composite type. + * @alias deploymentmanager.compositeTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the type for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.get + * @desc Gets information about a specific composite type. + * @alias deploymentmanager.compositeTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.insert + * @desc Creates a composite type. + * @alias deploymentmanager.compositeTypes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.list + * @desc Lists all composite types for Deployment Manager. + * @alias deploymentmanager.compositeTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.patch + * @desc Updates a composite type. This method supports patch semantics. + * @alias deploymentmanager.compositeTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.compositeTypes.update + * @desc Updates a composite type. + * @alias deploymentmanager.compositeTypes.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.compositeType The name of the composite type for this request. + * @param {string} params.project The project ID for this request. + * @param {().CompositeType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/compositeTypes/{compositeType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'compositeType'], + pathParams: ['compositeType', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * deploymentmanager.typeProviders.listTypes - * @desc Lists all the type info for a TypeProvider. - * @alias deploymentmanager.typeProviders.listTypes - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listTypes(params?: any, options?: MethodOptions): - AxiosPromise; - listTypes( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listTypes( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Deployments { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.deployments.cancelPreview + * @desc Cancels and removes the preview currently associated with the + * deployment. + * @alias deploymentmanager.deployments.cancelPreview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsCancelPreviewRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancelPreview(params?: any, options?: MethodOptions): + AxiosPromise; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancelPreview( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/cancelPreview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.delete + * @desc Deletes a deployment and all of the resources in the deployment. + * @alias deploymentmanager.deployments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.get + * @desc Gets information about a specific deployment. + * @alias deploymentmanager.deployments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.getIamPolicy + * @desc Gets the access control policy for a resource. May be empty if no + * such policy or resource exists. + * @alias deploymentmanager.deployments.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.insert + * @desc Creates a deployment and all of the resources described by the + * deployment manifest. + * @alias deploymentmanager.deployments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {boolean=} params.preview If set to true, creates a deployment and creates "shell" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.list + * @desc Lists all deployments for a given project. + * @alias deploymentmanager.deployments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.patch + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. This method supports patch semantics. + * @alias deploymentmanager.deployments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias deploymentmanager.deployments.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.stop + * @desc Stops an ongoing operation. This does not roll back any work that + * has already been completed, but prevents any new work from being started. + * @alias deploymentmanager.deployments.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {().DeploymentsStopRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * @alias deploymentmanager.deployments.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID for this request. + * @param {string} params.resource_ Name of the resource for this request. + * @param {().TestPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{resource}/testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'resource'], + pathParams: ['project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.deployments.update + * @desc Updates a deployment and all of the resources described by the + * deployment manifest. + * @alias deploymentmanager.deployments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createPolicy Sets the policy to use for creating new resources. + * @param {string=} params.deletePolicy Sets the policy to use for deleting resources. + * @param {string} params.deployment The name of the deployment for this request. + * @param {boolean=} params.preview If set to true, updates the deployment and creates and updates the "shell" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it. + * @param {string} params.project The project ID for this request. + * @param {().Deployment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * deploymentmanager.typeProviders.patch - * @desc Updates a type provider. This method supports patch semantics. - * @alias deploymentmanager.typeProviders.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Manifests { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.manifests.get + * @desc Gets information about a specific manifest. + * @alias deploymentmanager.manifests.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.manifest The name of the manifest for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests/{manifest}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'manifest'], + pathParams: ['deployment', 'manifest', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.manifests.list + * @desc Lists all manifests for a given deployment. + * @alias deploymentmanager.manifests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/manifests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * deploymentmanager.typeProviders.update - * @desc Updates a type provider. - * @alias deploymentmanager.typeProviders.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project ID for this request. - * @param {string} params.typeProvider The name of the type provider for this request. - * @param {().TypeProvider} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'typeProvider'], - pathParams: ['project', 'typeProvider'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Operations { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.operations.get + * @desc Gets information about a specific operation. + * @alias deploymentmanager.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation The name of the operation for this request. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.operations.list + * @desc Lists all operations for a project. + * @alias deploymentmanager.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Types { - root: Deploymentmanager; - constructor(root: Deploymentmanager) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Resources { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.resources.get + * @desc Gets information about a single resource. + * @alias deploymentmanager.resources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string} params.project The project ID for this request. + * @param {string} params.resource_ The name of the resource for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources/{resource}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment', 'resource'], + pathParams: ['deployment', 'project', 'resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.resources.list + * @desc Lists all resources in a given deployment. + * @alias deploymentmanager.resources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deployment The name of the deployment for this request. + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/deployments/{deployment}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'deployment'], + pathParams: ['deployment', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Typeproviders { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.typeProviders.delete + * @desc Deletes a type provider. + * @alias deploymentmanager.typeProviders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.get + * @desc Gets information about a specific type provider. + * @alias deploymentmanager.typeProviders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.getType + * @desc Gets a type info for a type provided by a TypeProvider. + * @alias deploymentmanager.typeProviders.getType + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.type The name of the type provider for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getType(params?: any, options?: MethodOptions): + AxiosPromise; + getType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getType( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types/{type}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider', 'type'], + pathParams: ['project', 'type', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.insert + * @desc Creates a type provider. + * @alias deploymentmanager.typeProviders.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.list + * @desc Lists all resource type providers for Deployment Manager. + * @alias deploymentmanager.typeProviders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.listTypes + * @desc Lists all the type info for a TypeProvider. + * @alias deploymentmanager.typeProviders.listTypes + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listTypes(params?: any, options?: MethodOptions): + AxiosPromise; + listTypes( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listTypes( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * deploymentmanager.typeProviders.patch + * @desc Updates a type provider. This method supports patch semantics. + * @alias deploymentmanager.typeProviders.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * deploymentmanager.typeProviders.update + * @desc Updates a type provider. + * @alias deploymentmanager.typeProviders.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project ID for this request. + * @param {string} params.typeProvider The name of the type provider for this request. + * @param {().TypeProvider} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/typeProviders/{typeProvider}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'typeProvider'], + pathParams: ['project', 'typeProvider'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * deploymentmanager.types.list - * @desc Lists all resource types for Deployment Manager. - * @alias deploymentmanager.types.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). - * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) - * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. - * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. - * @param {string} params.project The project ID for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/deploymentmanager/v2beta/projects/{project}/global/types') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Types { + root: Deploymentmanager; + constructor(root: Deploymentmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * deploymentmanager.types.list + * @desc Lists all resource types for Deployment Manager. + * @alias deploymentmanager.types.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, >, or <. For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true). + * @param {integer=} params.maxResults The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500) + * @param {string=} params.orderBy Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by name or creationTimestamp desc is supported. + * @param {string=} params.pageToken Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results. + * @param {string} params.project The project ID for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/deploymentmanager/v2beta/projects/{project}/global/types') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dfareporting/v2.8.ts b/src/apis/dfareporting/v2.8.ts index bb10ee43c6e..4495d1b9136 100644 --- a/src/apis/dfareporting/v2.8.ts +++ b/src/apis/dfareporting/v2.8.ts @@ -27,30913 +27,31257 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * DCM/DFA Reporting And Trafficking API - * - * Manages your DoubleClick Campaign Manager ad campaigns and reports. - * - * @example - * const google = require('googleapis'); - * const dfareporting = google.dfareporting('v2.8'); - * - * @namespace dfareporting - * @type {Function} - * @version v2.8 - * @variation v2.8 - * @param {object=} options Options for Dfareporting - */ -export class Dfareporting { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accountActiveAdSummaries: Resource$Accountactiveadsummaries; - accountPermissionGroups: Resource$Accountpermissiongroups; - accountPermissions: Resource$Accountpermissions; - accounts: Resource$Accounts; - accountUserProfiles: Resource$Accountuserprofiles; - ads: Resource$Ads; - advertiserGroups: Resource$Advertisergroups; - advertisers: Resource$Advertisers; - browsers: Resource$Browsers; - campaignCreativeAssociations: Resource$Campaigncreativeassociations; - campaigns: Resource$Campaigns; - changeLogs: Resource$Changelogs; - cities: Resource$Cities; - connectionTypes: Resource$Connectiontypes; - contentCategories: Resource$Contentcategories; - conversions: Resource$Conversions; - countries: Resource$Countries; - creativeAssets: Resource$Creativeassets; - creativeFields: Resource$Creativefields; - creativeFieldValues: Resource$Creativefieldvalues; - creativeGroups: Resource$Creativegroups; - creatives: Resource$Creatives; - dimensionValues: Resource$Dimensionvalues; - directorySiteContacts: Resource$Directorysitecontacts; - directorySites: Resource$Directorysites; - dynamicTargetingKeys: Resource$Dynamictargetingkeys; - eventTags: Resource$Eventtags; - files: Resource$Files; - floodlightActivities: Resource$Floodlightactivities; - floodlightActivityGroups: Resource$Floodlightactivitygroups; - floodlightConfigurations: Resource$Floodlightconfigurations; - inventoryItems: Resource$Inventoryitems; - landingPages: Resource$Landingpages; - languages: Resource$Languages; - metros: Resource$Metros; - mobileCarriers: Resource$Mobilecarriers; - operatingSystems: Resource$Operatingsystems; - operatingSystemVersions: Resource$Operatingsystemversions; - orderDocuments: Resource$Orderdocuments; - orders: Resource$Orders; - placementGroups: Resource$Placementgroups; - placements: Resource$Placements; - placementStrategies: Resource$Placementstrategies; - platformTypes: Resource$Platformtypes; - postalCodes: Resource$Postalcodes; - projects: Resource$Projects; - regions: Resource$Regions; - remarketingLists: Resource$Remarketinglists; - remarketingListShares: Resource$Remarketinglistshares; - reports: Resource$Reports; - sites: Resource$Sites; - sizes: Resource$Sizes; - subaccounts: Resource$Subaccounts; - targetableRemarketingLists: Resource$Targetableremarketinglists; - targetingTemplates: Resource$Targetingtemplates; - userProfiles: Resource$Userprofiles; - userRolePermissionGroups: Resource$Userrolepermissiongroups; - userRolePermissions: Resource$Userrolepermissions; - userRoles: Resource$Userroles; - videoFormats: Resource$Videoformats; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accountActiveAdSummaries = new Resource$Accountactiveadsummaries(this); - this.accountPermissionGroups = new Resource$Accountpermissiongroups(this); - this.accountPermissions = new Resource$Accountpermissions(this); - this.accounts = new Resource$Accounts(this); - this.accountUserProfiles = new Resource$Accountuserprofiles(this); - this.ads = new Resource$Ads(this); - this.advertiserGroups = new Resource$Advertisergroups(this); - this.advertisers = new Resource$Advertisers(this); - this.browsers = new Resource$Browsers(this); - this.campaignCreativeAssociations = - new Resource$Campaigncreativeassociations(this); - this.campaigns = new Resource$Campaigns(this); - this.changeLogs = new Resource$Changelogs(this); - this.cities = new Resource$Cities(this); - this.connectionTypes = new Resource$Connectiontypes(this); - this.contentCategories = new Resource$Contentcategories(this); - this.conversions = new Resource$Conversions(this); - this.countries = new Resource$Countries(this); - this.creativeAssets = new Resource$Creativeassets(this); - this.creativeFields = new Resource$Creativefields(this); - this.creativeFieldValues = new Resource$Creativefieldvalues(this); - this.creativeGroups = new Resource$Creativegroups(this); - this.creatives = new Resource$Creatives(this); - this.dimensionValues = new Resource$Dimensionvalues(this); - this.directorySiteContacts = new Resource$Directorysitecontacts(this); - this.directorySites = new Resource$Directorysites(this); - this.dynamicTargetingKeys = new Resource$Dynamictargetingkeys(this); - this.eventTags = new Resource$Eventtags(this); - this.files = new Resource$Files(this); - this.floodlightActivities = new Resource$Floodlightactivities(this); - this.floodlightActivityGroups = new Resource$Floodlightactivitygroups(this); - this.floodlightConfigurations = new Resource$Floodlightconfigurations(this); - this.inventoryItems = new Resource$Inventoryitems(this); - this.landingPages = new Resource$Landingpages(this); - this.languages = new Resource$Languages(this); - this.metros = new Resource$Metros(this); - this.mobileCarriers = new Resource$Mobilecarriers(this); - this.operatingSystems = new Resource$Operatingsystems(this); - this.operatingSystemVersions = new Resource$Operatingsystemversions(this); - this.orderDocuments = new Resource$Orderdocuments(this); - this.orders = new Resource$Orders(this); - this.placementGroups = new Resource$Placementgroups(this); - this.placements = new Resource$Placements(this); - this.placementStrategies = new Resource$Placementstrategies(this); - this.platformTypes = new Resource$Platformtypes(this); - this.postalCodes = new Resource$Postalcodes(this); - this.projects = new Resource$Projects(this); - this.regions = new Resource$Regions(this); - this.remarketingLists = new Resource$Remarketinglists(this); - this.remarketingListShares = new Resource$Remarketinglistshares(this); - this.reports = new Resource$Reports(this); - this.sites = new Resource$Sites(this); - this.sizes = new Resource$Sizes(this); - this.subaccounts = new Resource$Subaccounts(this); - this.targetableRemarketingLists = - new Resource$Targetableremarketinglists(this); - this.targetingTemplates = new Resource$Targetingtemplates(this); - this.userProfiles = new Resource$Userprofiles(this); - this.userRolePermissionGroups = new Resource$Userrolepermissiongroups(this); - this.userRolePermissions = new Resource$Userrolepermissions(this); - this.userRoles = new Resource$Userroles(this); - this.videoFormats = new Resource$Videoformats(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Contains properties of a DCM account. - */ -export interface Schema$Account { - /** - * Account permissions assigned to this account. - */ - accountPermissionIds: string[]; - /** - * Profile for this account. This is a read-only field that can be left blank. - */ - accountProfile: string; - /** - * Whether this account is active. - */ - active: boolean; - /** - * Maximum number of active ads allowed for this account. - */ - activeAdsLimitTier: string; - /** - * Whether to serve creatives with Active View tags. If disabled, viewability - * data will not be available for any impressions. - */ - activeViewOptOut: boolean; - /** - * User role permissions available to the user roles of this account. - */ - availablePermissionIds: string[]; - /** - * ID of the country associated with this account. - */ - countryId: string; - /** - * ID of currency associated with this account. This is a required field. - * Acceptable values are: - "1" for USD - "2" for GBP - - * "3" for ESP - "4" for SEK - "5" for CAD - - * "6" for JPY - "7" for DEM - "8" for AUD - - * "9" for FRF - "10" for ITL - "11" for DKK - * - "12" for NOK - "13" for FIM - "14" for - * ZAR - "15" for IEP - "16" for NLG - "17" - * for EUR - "18" for KRW - "19" for TWD - - * "20" for SGD - "21" for CNY - "22" for HKD - * - "23" for NZD - "24" for MYR - "25" for - * BRL - "26" for PTE - "27" for MXP - "28" - * for CLP - "29" for TRY - "30" for ARS - - * "31" for PEN - "32" for ILS - "33" for CHF - * - "34" for VEF - "35" for COP - "36" for - * GTQ - "37" for PLN - "39" for INR - "40" - * for THB - "41" for IDR - "42" for CZK - - * "43" for RON - "44" for HUF - "45" for RUB - * - "46" for AED - "47" for BGN - "48" for - * HRK - "49" for MXN - "50" for NGN - */ - currencyId: string; - /** - * Default placement dimensions for this account. - */ - defaultCreativeSizeId: string; - /** - * Description of this account. - */ - description: string; - /** - * ID of this account. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#account". - */ - kind: string; - /** - * Locale of this account. Acceptable values are: - "cs" (Czech) - - * "de" (German) - "en" (English) - "en-GB" - * (English United Kingdom) - "es" (Spanish) - "fr" - * (French) - "it" (Italian) - "ja" (Japanese) - - * "ko" (Korean) - "pl" (Polish) - "pt-BR" - * (Portuguese Brazil) - "ru" (Russian) - "sv" (Swedish) - * - "tr" (Turkish) - "zh-CN" (Chinese Simplified) - - * "zh-TW" (Chinese Traditional) - */ - locale: string; - /** - * Maximum image size allowed for this account, in kilobytes. Value must be - * greater than or equal to 1. - */ - maximumImageSize: string; - /** - * Name of this account. This is a required field, and must be less than 128 - * characters long and be globally unique. - */ - name: string; - /** - * Whether campaigns created in this account will be enabled for Nielsen OCR - * reach ratings by default. - */ - nielsenOcrEnabled: boolean; - /** - * Reporting configuration of this account. - */ - reportsConfiguration: Schema$ReportsConfiguration; - /** - * Share Path to Conversion reports with Twitter. - */ - shareReportsWithTwitter: boolean; - /** - * File size limit in kilobytes of Rich Media teaser creatives. Acceptable - * values are 1 to 10240, inclusive. - */ - teaserSizeLimit: string; -} -/** - * Gets a summary of active ads in an account. - */ -export interface Schema$AccountActiveAdSummary { - /** - * ID of the account. - */ - accountId: string; - /** - * Ads that have been activated for the account - */ - activeAds: string; - /** - * Maximum number of active ads allowed for the account. - */ - activeAdsLimitTier: string; - /** - * Ads that can be activated for the account. - */ - availableAds: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountActiveAdSummary". - */ - kind: string; -} -/** - * AccountPermissions contains information about a particular account - * permission. Some features of DCM require an account permission to be present - * in the account. - */ -export interface Schema$AccountPermission { - /** - * Account profiles associated with this account permission. Possible values - * are: - "ACCOUNT_PROFILE_BASIC" - - * "ACCOUNT_PROFILE_STANDARD" - */ - accountProfiles: string[]; - /** - * ID of this account permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermission". - */ - kind: string; - /** - * Administrative level required to enable this account permission. - */ - level: string; - /** - * Name of this account permission. - */ - name: string; - /** - * Permission group of this account permission. - */ - permissionGroupId: string; -} -/** - * AccountPermissionGroups contains a mapping of permission group IDs to names. - * A permission group is a grouping of account permissions. - */ -export interface Schema$AccountPermissionGroup { - /** - * ID of this account permission group. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionGroup". - */ - kind: string; - /** - * Name of this account permission group. - */ - name: string; -} -/** - * Account Permission Group List Response - */ -export interface Schema$AccountPermissionGroupsListResponse { - /** - * Account permission group collection. - */ - accountPermissionGroups: Schema$AccountPermissionGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionGroupsListResponse". - */ - kind: string; -} -/** - * Account Permission List Response - */ -export interface Schema$AccountPermissionsListResponse { - /** - * Account permission collection. - */ - accountPermissions: Schema$AccountPermission[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionsListResponse". - */ - kind: string; -} -/** - * Account List Response - */ -export interface Schema$AccountsListResponse { - /** - * Account collection. - */ - accounts: Schema$Account[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * AccountUserProfiles contains properties of a DCM user profile. This resource - * is specifically for managing user profiles, whereas UserProfiles is for - * accessing the API. - */ -export interface Schema$AccountUserProfile { - /** - * Account ID of the user profile. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Whether this user profile is active. This defaults to false, and must be - * set true on insert for the user profile to be usable. - */ - active: boolean; - /** - * Filter that describes which advertisers are visible to the user profile. - */ - advertiserFilter: Schema$ObjectFilter; - /** - * Filter that describes which campaigns are visible to the user profile. - */ - campaignFilter: Schema$ObjectFilter; - /** - * Comments for this user profile. - */ - comments: string; - /** - * Email of the user profile. The email addresss must be linked to a Google - * Account. This field is required on insertion and is read-only after - * insertion. - */ - email: string; - /** - * ID of the user profile. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountUserProfile". - */ - kind: string; - /** - * Locale of the user profile. This is a required field. Acceptable values - * are: - "cs" (Czech) - "de" (German) - - * "en" (English) - "en-GB" (English United Kingdom) - - * "es" (Spanish) - "fr" (French) - "it" - * (Italian) - "ja" (Japanese) - "ko" (Korean) - - * "pl" (Polish) - "pt-BR" (Portuguese Brazil) - - * "ru" (Russian) - "sv" (Swedish) - "tr" - * (Turkish) - "zh-CN" (Chinese Simplified) - "zh-TW" - * (Chinese Traditional) - */ - locale: string; - /** - * Name of the user profile. This is a required field. Must be less than 64 - * characters long, must be globally unique, and cannot contain whitespace or - * any of the following characters: "&;"#%,". - */ - name: string; - /** - * Filter that describes which sites are visible to the user profile. - */ - siteFilter: Schema$ObjectFilter; - /** - * Subaccount ID of the user profile. This is a read-only field that can be - * left blank. - */ - subaccountId: string; - /** - * Trafficker type of this user profile. - */ - traffickerType: string; - /** - * User type of the user profile. This is a read-only field that can be left - * blank. - */ - userAccessType: string; - /** - * Filter that describes which user roles are visible to the user profile. - */ - userRoleFilter: Schema$ObjectFilter; - /** - * User role ID of the user profile. This is a required field. - */ - userRoleId: string; -} -/** - * Account User Profile List Response - */ -export interface Schema$AccountUserProfilesListResponse { - /** - * Account user profile collection. - */ - accountUserProfiles: Schema$AccountUserProfile[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountUserProfilesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Represents an activity group. - */ -export interface Schema$Activities { - /** - * List of activity filters. The dimension values need to be all either of - * type "dfa:activity" or "dfa:activityGroup". - */ - filters: Schema$DimensionValue[]; - /** - * The kind of resource this is, in this case dfareporting#activities. - */ - kind: string; - /** - * List of names of floodlight activity metrics. - */ - metricNames: string[]; -} -/** - * Contains properties of a DCM ad. - */ -export interface Schema$Ad { - /** - * Account ID of this ad. This is a read-only field that can be left blank. - */ - accountId: string; - /** - * Whether this ad is active. When true, archived must be false. - */ - active: boolean; - /** - * Advertiser ID of this ad. This is a required field on insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this ad is archived. When true, active must be false. - */ - archived: boolean; - /** - * Audience segment ID that is being targeted for this ad. Applicable when - * type is AD_SERVING_STANDARD_AD. - */ - audienceSegmentId: string; - /** - * Campaign ID of this ad. This is a required field on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Click-through URL for this ad. This is a required field on insertion. - * Applicable when type is AD_SERVING_CLICK_TRACKER. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Click-through URL suffix properties for this ad. Applies to the URL in the - * ad or (if overriding ad properties) the URL in the creative. - */ - clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; - /** - * Comments for this ad. - */ - comments: string; - /** - * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. - * DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on - * mobile devices or in mobile apps for regular or interstitial ads, - * respectively. APP and APP_INTERSTITIAL are only used for existing default - * ads. New mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL - * and default ads created for those placements will be limited to those - * compatibility types. IN_STREAM_VIDEO refers to rendering in-stream video - * ads developed with the VAST standard. - */ - compatibility: string; - /** - * Information about the creation of this ad. This is a read-only field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Creative group assignments for this ad. Applicable when type is - * AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is - * allowed for a maximum of two assignments. - */ - creativeGroupAssignments: Schema$CreativeGroupAssignment[]; - /** - * Creative rotation for this ad. Applicable when type is - * AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When - * type is AD_SERVING_DEFAULT_AD, this field should have exactly one - * creativeAssignment. - */ - creativeRotation: Schema$CreativeRotation; - /** - * Time and day targeting information for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - dayPartTargeting: Schema$DayPartTargeting; - /** - * Default click-through event tag properties for this ad. - */ - defaultClickThroughEventTagProperties: - Schema$DefaultClickThroughEventTagProperties; - /** - * Delivery schedule information for this ad. Applicable when type is - * AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with - * subfields priority and impressionRatio are required on insertion when type - * is AD_SERVING_STANDARD_AD. - */ - deliverySchedule: Schema$DeliverySchedule; - /** - * Whether this ad is a dynamic click tracker. Applicable when type is - * AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is - * read-only after insert. - */ - dynamicClickTracker: boolean; - /** - * Date and time that this ad should stop serving. Must be later than the - * start time. This is a required field on insertion. - */ - endTime: string; - /** - * Event tag overrides for this ad. - */ - eventTagOverrides: Schema$EventTagOverride[]; - /** - * Geographical targeting information for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - geoTargeting: Schema$GeoTargeting; - /** - * ID of this ad. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this ad. This is a read-only, auto-generated - * field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key-value targeting information for this ad. This field must be left blank - * if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - keyValueTargetingExpression: Schema$KeyValueTargetingExpression; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#ad". - */ - kind: string; - /** - * Language targeting information for this ad. This field must be left blank - * if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - languageTargeting: Schema$LanguageTargeting; - /** - * Information about the most recent modification of this ad. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this ad. This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Placement assignments for this ad. - */ - placementAssignments: Schema$PlacementAssignment[]; - /** - * Remarketing list targeting expression for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - remarketingListExpression: Schema$ListTargetingExpression; - /** - * Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. - */ - size: Schema$Size; - /** - * Whether this ad is ssl compliant. This is a read-only field that is - * auto-generated when the ad is inserted or updated. - */ - sslCompliant: boolean; - /** - * Whether this ad requires ssl. This is a read-only field that is - * auto-generated when the ad is inserted or updated. - */ - sslRequired: boolean; - /** - * Date and time that this ad should start serving. If creating an ad, this - * field must be a time in the future. This is a required field on insertion. - */ - startTime: string; - /** - * Subaccount ID of this ad. This is a read-only field that can be left blank. - */ - subaccountId: string; - /** - * Targeting template ID, used to apply preconfigured targeting information to - * this ad. This cannot be set while any of dayPartTargeting, geoTargeting, - * keyValueTargetingExpression, languageTargeting, remarketingListExpression, - * or technologyTargeting are set. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - targetingTemplateId: string; - /** - * Technology platform targeting information for this ad. This field must be - * left blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - technologyTargeting: Schema$TechnologyTargeting; - /** - * Type of ad. This is a required field on insertion. Note that default ads - * (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource). - */ - type: string; -} -/** - * Campaign ad blocking settings. - */ -export interface Schema$AdBlockingConfiguration { - /** - * Click-through URL used by brand-neutral ads. This is a required field when - * overrideClickThroughUrl is set to true. - */ - clickThroughUrl: string; - /** - * ID of a creative bundle to use for this campaign. If set, brand-neutral ads - * will select creatives from this bundle. Otherwise, a default transparent - * pixel will be used. - */ - creativeBundleId: string; - /** - * Whether this campaign has enabled ad blocking. When true, ad blocking is - * enabled for placements in the campaign, but this may be overridden by site - * and placement settings. When false, ad blocking is disabled for all - * placements under the campaign, regardless of site and placement settings. - */ - enabled: boolean; - /** - * Whether the brand-neutral ad's click-through URL comes from the - * campaign's creative bundle or the override URL. Must be set to true if - * ad blocking is enabled and no creative bundle is configured. - */ - overrideClickThroughUrl: boolean; -} -/** - * Ad List Response - */ -export interface Schema$AdsListResponse { - /** - * Ad collection. - */ - ads: Schema$Ad[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#adsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Ad Slot - */ -export interface Schema$AdSlot { - /** - * Comment for this ad slot. - */ - comment: string; - /** - * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering - * either on desktop, mobile devices or in mobile apps for regular or - * interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering - * in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads - * developed with the VAST standard. - */ - compatibility: string; - /** - * Height of this ad slot. - */ - height: string; - /** - * ID of the placement from an external platform that is linked to this ad - * slot. - */ - linkedPlacementId: string; - /** - * Name of this ad slot. - */ - name: string; - /** - * Payment source type of this ad slot. - */ - paymentSourceType: string; - /** - * Primary ad slot of a roadblock inventory item. - */ - primary: boolean; - /** - * Width of this ad slot. - */ - width: string; -} -/** - * Contains properties of a DCM advertiser. - */ -export interface Schema$Advertiser { - /** - * Account ID of this advertiser.This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * ID of the advertiser group this advertiser belongs to. You can group - * advertisers for reporting purposes, allowing you to see aggregated - * information for all advertisers in each group. - */ - advertiserGroupId: string; - /** - * Suffix added to click-through URL of ad creative associations under this - * advertiser. Must be less than 129 characters long. - */ - clickThroughUrlSuffix: string; - /** - * ID of the click-through event tag to apply by default to the landing pages - * of this advertiser's campaigns. - */ - defaultClickThroughEventTagId: string; - /** - * Default email address used in sender field for tag emails. - */ - defaultEmail: string; - /** - * Floodlight configuration ID of this advertiser. The floodlight - * configuration ID will be created automatically, so on insert this field - * should be left blank. This field can be set to another advertiser's - * floodlight configuration ID in order to share that advertiser's - * floodlight configuration with this advertiser, so long as: - This - * advertiser's original floodlight configuration is not already - * associated with floodlight activities or floodlight activity groups. - - * This advertiser's original floodlight configuration is not already - * shared with another advertiser. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * ID of this advertiser. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this advertiser. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiser". - */ - kind: string; - /** - * Name of this advertiser. This is a required field and must be less than 256 - * characters long and unique among advertisers of the same account. - */ - name: string; - /** - * Original floodlight configuration before any sharing occurred. Set the - * floodlightConfigurationId of this advertiser to - * originalFloodlightConfigurationId to unshare the advertiser's current - * floodlight configuration. You cannot unshare an advertiser's floodlight - * configuration if the shared configuration has activities associated with - * any campaign or placement. - */ - originalFloodlightConfigurationId: string; - /** - * Status of this advertiser. - */ - status: string; - /** - * Subaccount ID of this advertiser.This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Suspension status of this advertiser. - */ - suspended: boolean; -} -/** - * Groups advertisers together so that reports can be generated for the entire - * group at once. - */ -export interface Schema$AdvertiserGroup { - /** - * Account ID of this advertiser group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this advertiser group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiserGroup". - */ - kind: string; - /** - * Name of this advertiser group. This is a required field and must be less - * than 256 characters long and unique among advertiser groups of the same - * account. - */ - name: string; -} -/** - * Advertiser Group List Response - */ -export interface Schema$AdvertiserGroupsListResponse { - /** - * Advertiser group collection. - */ - advertiserGroups: Schema$AdvertiserGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiserGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Advertiser List Response - */ -export interface Schema$AdvertisersListResponse { - /** - * Advertiser collection. - */ - advertisers: Schema$Advertiser[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertisersListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Audience Segment. - */ -export interface Schema$AudienceSegment { - /** - * Weight allocated to this segment. The weight assigned will be understood in - * proportion to the weights assigned to other segments in the same segment - * group. Acceptable values are 1 to 1000, inclusive. - */ - allocation: number; - /** - * ID of this audience segment. This is a read-only, auto-generated field. - */ - id: string; - /** - * Name of this audience segment. This is a required field and must be less - * than 65 characters long. - */ - name: string; -} -/** - * Audience Segment Group. - */ -export interface Schema$AudienceSegmentGroup { - /** - * Audience segments assigned to this group. The number of segments must be - * between 2 and 100. - */ - audienceSegments: Schema$AudienceSegment[]; - /** - * ID of this audience segment group. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Name of this audience segment group. This is a required field and must be - * less than 65 characters long. - */ - name: string; -} -/** - * Contains information about a browser that can be targeted by ads. - */ -export interface Schema$Browser { - /** - * ID referring to this grouping of browser and version numbers. This is the - * ID used for targeting. - */ - browserVersionId: string; - /** - * DART ID of this browser. This is the ID used when generating reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#browser". - */ - kind: string; - /** - * Major version number (leftmost number) of this browser. For example, for - * Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may - * be used to target any version number, and a question mark (?) may be used - * to target cases where the version number cannot be identified. For example, - * Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. - * Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases - * where the ad server knows the browser is Firefox but can't tell which - * version it is. - */ - majorVersion: string; - /** - * Minor version number (number after first dot on left) of this browser. For - * example, for Chrome 5.0.375.86 beta, this field should be set to 0. An - * asterisk (*) may be used to target any version number, and a question mark - * (?) may be used to target cases where the version number cannot be - * identified. For example, Chrome *.* targets any version of Chrome: - * 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. - * Firefox ?.? targets cases where the ad server knows the browser is Firefox - * but can't tell which version it is. - */ - minorVersion: string; - /** - * Name of this browser. - */ - name: string; -} -/** - * Browser List Response - */ -export interface Schema$BrowsersListResponse { - /** - * Browser collection. - */ - browsers: Schema$Browser[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#browsersListResponse". - */ - kind: string; -} -/** - * Contains properties of a DCM campaign. - */ -export interface Schema$Campaign { - /** - * Account ID of this campaign. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Ad blocking settings for this campaign. - */ - adBlockingConfiguration: Schema$AdBlockingConfiguration; - /** - * Additional creative optimization configurations for the campaign. - */ - additionalCreativeOptimizationConfigurations: - Schema$CreativeOptimizationConfiguration[]; - /** - * Advertiser group ID of the associated advertiser. - */ - advertiserGroupId: string; - /** - * Advertiser ID of this campaign. This is a required field. - */ - advertiserId: string; - /** - * Dimension value for the advertiser ID of this campaign. This is a - * read-only, auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this campaign has been archived. - */ - archived: boolean; - /** - * Audience segment groups assigned to this campaign. Cannot have more than - * 300 segment groups. - */ - audienceSegmentGroups: Schema$AudienceSegmentGroup[]; - /** - * Billing invoice code included in the DCM client billing invoices associated - * with the campaign. - */ - billingInvoiceCode: string; - /** - * Click-through URL suffix override properties for this campaign. - */ - clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; - /** - * Arbitrary comments about this campaign. Must be less than 256 characters - * long. - */ - comment: string; - /** - * Information about the creation of this campaign. This is a read-only field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * List of creative group IDs that are assigned to the campaign. - */ - creativeGroupIds: string[]; - /** - * Creative optimization configuration for the campaign. - */ - creativeOptimizationConfiguration: Schema$CreativeOptimizationConfiguration; - /** - * Click-through event tag ID override properties for this campaign. - */ - defaultClickThroughEventTagProperties: - Schema$DefaultClickThroughEventTagProperties; - /** - * Date on which the campaign will stop running. On insert, the end date must - * be today or a future date. The end date must be later than or be the same - * as the start date. If, for example, you set 6/25/2015 as both the start and - * end dates, the effective campaign run date is just that day only, - * 6/25/2015. The hours, minutes, and seconds of the end date should not be - * set, as doing so will result in an error. This is a required field. - */ - endDate: string; - /** - * Overrides that can be used to activate or deactivate advertiser event tags. - */ - eventTagOverrides: Schema$EventTagOverride[]; - /** - * External ID for this campaign. - */ - externalId: string; - /** - * ID of this campaign. This is a read-only auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this campaign. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaign". - */ - kind: string; - /** - * Information about the most recent modification of this campaign. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Lookback window settings for the campaign. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Name of this campaign. This is a required field and must be less than 256 - * characters long and unique among campaigns of the same advertiser. - */ - name: string; - /** - * Whether Nielsen reports are enabled for this campaign. - */ - nielsenOcrEnabled: boolean; - /** - * Date on which the campaign starts running. The start date can be any date. - * The hours, minutes, and seconds of the start date should not be set, as - * doing so will result in an error. This is a required field. - */ - startDate: string; - /** - * Subaccount ID of this campaign. This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Campaign trafficker contact emails. - */ - traffickerEmails: string[]; -} -/** - * Identifies a creative which has been associated with a given campaign. - */ -export interface Schema$CampaignCreativeAssociation { - /** - * ID of the creative associated with the campaign. This is a required field. - */ - creativeId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignCreativeAssociation". - */ - kind: string; -} -/** - * Campaign Creative Association List Response - */ -export interface Schema$CampaignCreativeAssociationsListResponse { - /** - * Campaign creative association collection - */ - campaignCreativeAssociations: Schema$CampaignCreativeAssociation[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignCreativeAssociationsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Campaign List Response - */ -export interface Schema$CampaignsListResponse { - /** - * Campaign collection. - */ - campaigns: Schema$Campaign[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Describes a change that a user has made to a resource. - */ -export interface Schema$ChangeLog { - /** - * Account ID of the modified object. - */ - accountId: string; - /** - * Action which caused the change. - */ - action: string; - /** - * Time when the object was modified. - */ - changeTime: string; - /** - * Field name of the object which changed. - */ - fieldName: string; - /** - * ID of this change log. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#changeLog". - */ - kind: string; - /** - * New value of the object field. - */ - newValue: string; - /** - * ID of the object of this change log. The object could be a campaign, - * placement, ad, or other type. - */ - objectId: string; - /** - * Object type of the change log. - */ - objectType: string; - /** - * Old value of the object field. - */ - oldValue: string; - /** - * Subaccount ID of the modified object. - */ - subaccountId: string; - /** - * Transaction ID of this change log. When a single API call results in many - * changes, each change will have a separate ID in the change log but will - * share the same transactionId. - */ - transactionId: string; - /** - * ID of the user who modified the object. - */ - userProfileId: string; - /** - * User profile name of the user who modified the object. - */ - userProfileName: string; -} -/** - * Change Log List Response - */ -export interface Schema$ChangeLogsListResponse { - /** - * Change log collection. - */ - changeLogs: Schema$ChangeLog[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#changeLogsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * City List Response - */ -export interface Schema$CitiesListResponse { - /** - * City collection. - */ - cities: Schema$City[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#citiesListResponse". - */ - kind: string; -} -/** - * Contains information about a city that can be targeted by ads. - */ -export interface Schema$City { - /** - * Country code of the country to which this city belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this city belongs. - */ - countryDartId: string; - /** - * DART ID of this city. This is the ID used for targeting and generating - * reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#city". - */ - kind: string; - /** - * Metro region code of the metro region (DMA) to which this city belongs. - */ - metroCode: string; - /** - * ID of the metro region (DMA) to which this city belongs. - */ - metroDmaId: string; - /** - * Name of this city. - */ - name: string; - /** - * Region code of the region to which this city belongs. - */ - regionCode: string; - /** - * DART ID of the region to which this city belongs. - */ - regionDartId: string; -} -/** - * Creative Click Tag. - */ -export interface Schema$ClickTag { - /** - * Advertiser event name associated with the click tag. This field is used by - * DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - eventName: string; - /** - * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY - * creative assets, this field must match the value of the creative - * asset's creativeAssetId.name field. - */ - name: string; - /** - * Parameter value for the specified click tag. This field contains a - * click-through url. - */ - value: string; -} -/** - * Click-through URL - */ -export interface Schema$ClickThroughUrl { - /** - * Read-only convenience field representing the actual URL that will be used - * for this click-through. The URL is computed as follows: - If - * defaultLandingPage is enabled then the campaign's default landing page - * URL is assigned to this field. - If defaultLandingPage is not enabled and a - * landingPageId is specified then that landing page's URL is assigned to - * this field. - If neither of the above cases apply, then the - * customClickThroughUrl is assigned to this field. - */ - computedClickThroughUrl: string; - /** - * Custom click-through URL. Applicable if the defaultLandingPage field is set - * to false and the landingPageId field is left unset. - */ - customClickThroughUrl: string; - /** - * Whether the campaign default landing page is used. - */ - defaultLandingPage: boolean; - /** - * ID of the landing page for the click-through URL. Applicable if the - * defaultLandingPage field is set to false. - */ - landingPageId: string; -} -/** - * Click Through URL Suffix settings. - */ -export interface Schema$ClickThroughUrlSuffixProperties { - /** - * Click-through URL suffix to apply to all ads in this entity's scope. - * Must be less than 128 characters long. - */ - clickThroughUrlSuffix: string; - /** - * Whether this entity should override the inherited click-through URL suffix - * with its own defined value. - */ - overrideInheritedSuffix: boolean; -} -/** - * Companion Click-through override. - */ -export interface Schema$CompanionClickThroughOverride { - /** - * Click-through URL of this companion click-through override. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * ID of the creative for this companion click-through override. - */ - creativeId: string; -} -/** - * Companion Settings - */ -export interface Schema$CompanionSetting { - /** - * Whether companions are disabled for this placement. - */ - companionsDisabled: boolean; - /** - * Whitelist of companion sizes to be served to this placement. Set this list - * to null or empty to serve all companion sizes. - */ - enabledSizes: Schema$Size[]; - /** - * Whether to serve only static images as companions. - */ - imageOnly: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#companionSetting". - */ - kind: string; -} -/** - * Represents a response to the queryCompatibleFields method. - */ -export interface Schema$CompatibleFields { - /** - * Contains items that are compatible to be selected for a report of type - * "CROSS_DIMENSION_REACH". - */ - crossDimensionReachReportCompatibleFields: - Schema$CrossDimensionReachReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "FLOODLIGHT". - */ - floodlightReportCompatibleFields: Schema$FloodlightReportCompatibleFields; - /** - * The kind of resource this is, in this case dfareporting#compatibleFields. - */ - kind: string; - /** - * Contains items that are compatible to be selected for a report of type - * "PATH_TO_CONVERSION". - */ - pathToConversionReportCompatibleFields: - Schema$PathToConversionReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "REACH". - */ - reachReportCompatibleFields: Schema$ReachReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "STANDARD". - */ - reportCompatibleFields: Schema$ReportCompatibleFields; -} -/** - * Contains information about an internet connection type that can be targeted - * by ads. Clients can use the connection type to target mobile vs. broadband - * users. - */ -export interface Schema$ConnectionType { - /** - * ID of this connection type. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#connectionType". - */ - kind: string; - /** - * Name of this connection type. - */ - name: string; -} -/** - * Connection Type List Response - */ -export interface Schema$ConnectionTypesListResponse { - /** - * Collection of connection types such as broadband and mobile. - */ - connectionTypes: Schema$ConnectionType[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#connectionTypesListResponse". - */ - kind: string; -} -/** - * Content Category List Response - */ -export interface Schema$ContentCategoriesListResponse { - /** - * Content category collection. - */ - contentCategories: Schema$ContentCategory[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#contentCategoriesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Organizes placements according to the contents of their associated webpages. - */ -export interface Schema$ContentCategory { - /** - * Account ID of this content category. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this content category. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#contentCategory". - */ - kind: string; - /** - * Name of this content category. This is a required field and must be less - * than 256 characters long and unique among content categories of the same - * account. - */ - name: string; -} -/** - * A Conversion represents when a user successfully performs a desired action - * after seeing an ad. - */ -export interface Schema$Conversion { - /** - * Whether the conversion was directed toward children. - */ - childDirectedTreatment: boolean; - /** - * Custom floodlight variables. - */ - customVariables: Schema$CustomFloodlightVariable[]; - /** - * The alphanumeric encrypted user ID. When set, encryptionInfo should also be - * specified. This field is mutually exclusive with - * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or - * encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field. - */ - encryptedUserId: string; - /** - * A list of the alphanumeric encrypted user IDs. Any user ID with exposure - * prior to the conversion timestamp will be used in the inserted conversion. - * If no such user ID is found then the conversion will be rejected with - * NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be - * specified. This field may only be used when calling batchinsert; it is not - * supported by batchupdate. This field is mutually exclusive with - * encryptedUserId, mobileDeviceId and gclid. This or encryptedUserId or - * mobileDeviceId or gclid is a required field. - */ - encryptedUserIdCandidates: string[]; - /** - * Floodlight Activity ID of this conversion. This is a required field. - */ - floodlightActivityId: string; - /** - * Floodlight Configuration ID of this conversion. This is a required field. - */ - floodlightConfigurationId: string; - /** - * The Google click ID. This field is mutually exclusive with encryptedUserId, - * encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or - * encryptedUserIdCandidates[] or mobileDeviceId is a required field. - */ - gclid: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversion". - */ - kind: string; - /** - * Whether Limit Ad Tracking is enabled. When set to true, the conversion will - * be used for reporting but not targeting. This will prevent remarketing. - */ - limitAdTracking: boolean; - /** - * The mobile device ID. This field is mutually exclusive with - * encryptedUserId, encryptedUserIdCandidates[] and gclid. This or - * encryptedUserId or encryptedUserIdCandidates[] or gclid is a required - * field. - */ - mobileDeviceId: string; - /** - * The ordinal of the conversion. Use this field to control how conversions of - * the same user and day are de-duplicated. This is a required field. - */ - ordinal: string; - /** - * The quantity of the conversion. - */ - quantity: string; - /** - * The timestamp of conversion, in Unix epoch micros. This is a required - * field. - */ - timestampMicros: string; - /** - * The value of the conversion. - */ - value: number; -} -/** - * The error code and description for a conversion that failed to insert or - * update. - */ -export interface Schema$ConversionError { - /** - * The error code. - */ - code: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionError". - */ - kind: string; - /** - * A description of the error. - */ - message: string; -} -/** - * Insert Conversions Request. - */ -export interface Schema$ConversionsBatchInsertRequest { - /** - * The set of conversions to insert. - */ - conversions: Schema$Conversion[]; - /** - * Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. - * This is a required field if encryptedUserId or encryptedUserIdCandidates[] - * is used. - */ - encryptionInfo: Schema$EncryptionInfo; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchInsertRequest". - */ - kind: string; -} -/** - * Insert Conversions Response. - */ -export interface Schema$ConversionsBatchInsertResponse { - /** - * Indicates that some or all conversions failed to insert. - */ - hasFailures: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchInsertResponse". - */ - kind: string; - /** - * The insert status of each conversion. Statuses are returned in the same - * order that conversions are inserted. - */ - status: Schema$ConversionStatus[]; -} -/** - * Update Conversions Request. - */ -export interface Schema$ConversionsBatchUpdateRequest { - /** - * The set of conversions to update. - */ - conversions: Schema$Conversion[]; - /** - * Describes how encryptedUserId is encrypted. This is a required field if - * encryptedUserId is used. - */ - encryptionInfo: Schema$EncryptionInfo; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchUpdateRequest". - */ - kind: string; -} -/** - * Update Conversions Response. - */ -export interface Schema$ConversionsBatchUpdateResponse { - /** - * Indicates that some or all conversions failed to update. - */ - hasFailures: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchUpdateResponse". - */ - kind: string; - /** - * The update status of each conversion. Statuses are returned in the same - * order that conversions are updated. - */ - status: Schema$ConversionStatus[]; -} -/** - * The original conversion that was inserted or updated and whether there were - * any errors. - */ -export interface Schema$ConversionStatus { - /** - * The original conversion that was inserted or updated. - */ - conversion: Schema$Conversion; - /** - * A list of errors related to this conversion. - */ - errors: Schema$ConversionError[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionStatus". - */ - kind: string; -} -/** - * Country List Response - */ -export interface Schema$CountriesListResponse { - /** - * Country collection. - */ - countries: Schema$Country[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#countriesListResponse". - */ - kind: string; -} -/** - * Contains information about a country that can be targeted by ads. - */ -export interface Schema$Country { - /** - * Country code. - */ - countryCode: string; - /** - * DART ID of this country. This is the ID used for targeting and generating - * reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#country". - */ - kind: string; - /** - * Name of this country. - */ - name: string; - /** - * Whether ad serving supports secure servers in this country. - */ - sslEnabled: boolean; -} -/** - * Contains properties of a Creative. - */ -export interface Schema$Creative { - /** - * Account ID of this creative. This field, if left unset, will be - * auto-generated for both insert and update operations. Applicable to all - * creative types. - */ - accountId: string; - /** - * Whether the creative is active. Applicable to all creative types. - */ - active: boolean; - /** - * Ad parameters user for VPAID creative. This is a read-only field. - * Applicable to the following creative types: all VPAID. - */ - adParameters: string; - /** - * Keywords for a Rich Media creative. Keywords let you customize the creative - * settings of a Rich Media ad running on your site without having to contact - * the advertiser. You can use keywords to dynamically change the look or - * functionality of a creative. Applicable to the following creative types: - * all RICH_MEDIA, and all VPAID. - */ - adTagKeys: string[]; - /** - * Advertiser ID of this creative. This is a required field. Applicable to all - * creative types. - */ - advertiserId: string; - /** - * Whether script access is allowed for this creative. This is a read-only and - * deprecated field which will automatically be set to true on update. - * Applicable to the following creative types: FLASH_INPAGE. - */ - allowScriptAccess: boolean; - /** - * Whether the creative is archived. Applicable to all creative types. - */ - archived: boolean; - /** - * Type of artwork used for the creative. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA, and all VPAID. - */ - artworkType: string; - /** - * Source application where creative was authored. Presently, only DBM - * authored creatives will have this field set. Applicable to all creative - * types. - */ - authoringSource: string; - /** - * Authoring tool for HTML5 banner creatives. This is a read-only field. - * Applicable to the following creative types: HTML5_BANNER. - */ - authoringTool: string; - /** - * Whether images are automatically advanced for image gallery creatives. - * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. - */ - autoAdvanceImages: boolean; - /** - * The 6-character HTML color code, beginning with #, for the background of - * the window area where the Flash file is displayed. Default is white. - * Applicable to the following creative types: FLASH_INPAGE. - */ - backgroundColor: string; - /** - * Click-through URL for backup image. Applicable to the following creative - * types: FLASH_INPAGE, and HTML5_BANNER. Applicable to DISPLAY when the - * primary asset type is not HTML_IMAGE. - */ - backupImageClickThroughUrl: string; - /** - * List of feature dependencies that will cause a backup image to be served if - * the browser that serves the ad does not support them. Feature dependencies - * are features that a browser must be able to support in order to render your - * HTML5 creative asset correctly. This field is initially auto-generated to - * contain all features detected by DCM for all the assets of this creative - * and can then be modified by the client. To reset this field, copy over all - * the creativeAssets' detected features. Applicable to the following - * creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset - * type is not HTML_IMAGE. - */ - backupImageFeatures: string[]; - /** - * Reporting label used for HTML5 banner backup image. Applicable to the - * following creative types: DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - backupImageReportingLabel: string; - /** - * Target window for backup image. Applicable to the following creative types: - * FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset - * type is not HTML_IMAGE. - */ - backupImageTargetWindow: Schema$TargetWindow; - /** - * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER - * creatives, this is a subset of detected click tags for the assets - * associated with this creative. After creating a flash asset, detected click - * tags will be returned in the creativeAssetMetadata. When inserting the - * creative, populate the creative clickTags field using the - * creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, - * there should be exactly one entry in this list for each image creative - * asset. A click tag is matched with a corresponding creative asset by - * matching the clickTag.name field with the - * creativeAsset.assetIdentifier.name field. Applicable to the following - * creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - clickTags: Schema$ClickTag[]; - /** - * Industry standard ID assigned to creative for reach and frequency. - * Applicable to INSTREAM_VIDEO_REDIRECT creatives. - */ - commercialId: string; - /** - * List of companion creatives assigned to an in-Stream videocreative. - * Acceptable values include IDs of existing flash and image creatives. - * Applicable to the following creative types: all VPAID and all - * INSTREAM_VIDEO with dynamicAssetSelection set to false. - */ - companionCreatives: string[]; - /** - * Compatibilities associated with this creative. This is a read-only field. - * DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on - * mobile devices or in mobile apps for regular or interstitial ads, - * respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. - * Only pre-existing creatives may have these compatibilities since new - * creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. - * IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with - * the VAST standard. Applicable to all creative types. Acceptable values - * are: - "APP" - "APP_INTERSTITIAL" - - * "IN_STREAM_VIDEO" - "DISPLAY" - - * "DISPLAY_INTERSTITIAL" - */ - compatibility: string[]; - /** - * Whether Flash assets associated with the creative need to be automatically - * converted to HTML5. This flag is enabled by default and users can choose to - * disable it if they don't want the system to generate and use HTML5 - * asset for this creative. Applicable to the following creative type: - * FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - convertFlashToHtml5: boolean; - /** - * List of counter events configured for the creative. For - * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated - * from clickTags. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. - */ - counterCustomEvents: Schema$CreativeCustomEvent[]; - /** - * Assets associated with a creative. Applicable to all but the following - * creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and - * REDIRECT - */ - creativeAssets: Schema$CreativeAsset[]; - /** - * Required if dynamicAssetSelection is true. - */ - creativeAssetSelection: Schema$CreativeAssetSelection; - /** - * Creative field assignments for this creative. Applicable to all creative - * types. - */ - creativeFieldAssignments: Schema$CreativeFieldAssignment[]; - /** - * Custom key-values for a Rich Media creative. Key-values let you customize - * the creative settings of a Rich Media ad running on your site without - * having to contact the advertiser. You can use key-values to dynamically - * change the look or functionality of a creative. Applicable to the following - * creative types: all RICH_MEDIA, and all VPAID. - */ - customKeyValues: string[]; - /** - * Set this to true to enable the use of rules to target individual assets in - * this creative. When set to true creativeAssetSelection must be set. This - * also controls asset-level companions. When this is true, companion - * creatives should be assigned to creative assets. Learn more. Applicable to - * INSTREAM_VIDEO creatives. - */ - dynamicAssetSelection: boolean; - /** - * List of exit events configured for the creative. For DISPLAY and - * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated - * from clickTags, For DISPLAY, an event is also created from the - * backupImageReportingLabel. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - exitCustomEvents: Schema$CreativeCustomEvent[]; - /** - * OpenWindow FSCommand of this creative. This lets the SWF file communicate - * with either Flash Player or the program hosting Flash Player, such as a web - * browser. This is only triggered if allowScriptAccess field is true. - * Applicable to the following creative types: FLASH_INPAGE. - */ - fsCommand: Schema$FsCommand; - /** - * HTML code for the creative. This is a required field when applicable. This - * field is ignored if htmlCodeLocked is true. Applicable to the following - * creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all - * RICH_MEDIA. - */ - htmlCode: string; - /** - * Whether HTML code is DCM-generated or manually entered. Set to true to - * ignore changes to htmlCode. Applicable to the following creative types: - * FLASH_INPAGE and HTML5_BANNER. - */ - htmlCodeLocked: boolean; - /** - * ID of this creative. This is a read-only, auto-generated field. Applicable - * to all creative types. - */ - id: string; - /** - * Dimension value for the ID of this creative. This is a read-only field. - * Applicable to all creative types. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creative". - */ - kind: string; - /** - * Creative last modification information. This is a read-only field. - * Applicable to all creative types. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Latest Studio trafficked creative ID associated with rich media and VPAID - * creatives. This is a read-only field. Applicable to the following creative - * types: all RICH_MEDIA, and all VPAID. - */ - latestTraffickedCreativeId: string; - /** - * Name of the creative. This is a required field and must be less than 256 - * characters long. Applicable to all creative types. - */ - name: string; - /** - * Override CSS value for rich media creatives. Applicable to the following - * creative types: all RICH_MEDIA. - */ - overrideCss: string; - /** - * Amount of time to play the video before counting a view. Applicable to the - * following creative types: all INSTREAM_VIDEO. - */ - progressOffset: Schema$VideoOffset; - /** - * URL of hosted image or hosted video or another ad tag. For - * INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. - * The standard for a VAST (Video Ad Serving Template) ad response allows for - * a redirect link to another VAST 2.0 or 3.0 call. This is a required field - * when applicable. Applicable to the following creative types: - * DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and - * INSTREAM_VIDEO_REDIRECT - */ - redirectUrl: string; - /** - * ID of current rendering version. This is a read-only field. Applicable to - * all creative types. - */ - renderingId: string; - /** - * Dimension value for the rendering ID of this creative. This is a read-only - * field. Applicable to all creative types. - */ - renderingIdDimensionValue: Schema$DimensionValue; - /** - * The minimum required Flash plugin version for this creative. For - * example, 11.2.202.235. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA, and all VPAID. - */ - requiredFlashPluginVersion: string; - /** - * The internal Flash version for this creative as calculated by DoubleClick - * Studio. This is a read-only field. Applicable to the following creative - * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - requiredFlashVersion: number; - /** - * Size associated with this creative. When inserting or updating a creative - * either the size ID field or size width and height fields can be used. This - * is a required field when applicable; however for IMAGE, FLASH_INPAGE - * creatives, and for DISPLAY creatives with a primary asset of type - * HTML_IMAGE, if left blank, this field will be automatically set using the - * actual size of the associated image assets. Applicable to the following - * creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, - * IMAGE, and all RICH_MEDIA. - */ - size: Schema$Size; - /** - * Amount of time to play the video before the skip button appears. Applicable - * to the following creative types: all INSTREAM_VIDEO. - */ - skipOffset: Schema$VideoOffset; - /** - * Whether the user can choose to skip the creative. Applicable to the - * following creative types: all INSTREAM_VIDEO and all VPAID. - */ - skippable: boolean; - /** - * Whether the creative is SSL-compliant. This is a read-only field. - * Applicable to all creative types. - */ - sslCompliant: boolean; - /** - * Whether creative should be treated as SSL compliant even if the system scan - * shows it's not. Applicable to all creative types. - */ - sslOverride: boolean; - /** - * Studio advertiser ID associated with rich media and VPAID creatives. This - * is a read-only field. Applicable to the following creative types: all - * RICH_MEDIA, and all VPAID. - */ - studioAdvertiserId: string; - /** - * Studio creative ID associated with rich media and VPAID creatives. This is - * a read-only field. Applicable to the following creative types: all - * RICH_MEDIA, and all VPAID. - */ - studioCreativeId: string; - /** - * Studio trafficked creative ID associated with rich media and VPAID - * creatives. This is a read-only field. Applicable to the following creative - * types: all RICH_MEDIA, and all VPAID. - */ - studioTraffickedCreativeId: string; - /** - * Subaccount ID of this creative. This field, if left unset, will be - * auto-generated for both insert and update operations. Applicable to all - * creative types. - */ - subaccountId: string; - /** - * Third-party URL used to record backup image impressions. Applicable to the - * following creative types: all RICH_MEDIA. - */ - thirdPartyBackupImageImpressionsUrl: string; - /** - * Third-party URL used to record rich media impressions. Applicable to the - * following creative types: all RICH_MEDIA. - */ - thirdPartyRichMediaImpressionsUrl: string; - /** - * Third-party URLs for tracking in-stream video creative events. Applicable - * to the following creative types: all INSTREAM_VIDEO and all VPAID. - */ - thirdPartyUrls: Schema$ThirdPartyTrackingUrl[]; - /** - * List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY - * creatives, these are read-only and auto-generated from clickTags. - * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all - * RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is - * not HTML_IMAGE. - */ - timerCustomEvents: Schema$CreativeCustomEvent[]; - /** - * Combined size of all creative assets. This is a read-only field. Applicable - * to the following creative types: all RICH_MEDIA, and all VPAID. - */ - totalFileSize: string; - /** - * Type of this creative. This is a required field. Applicable to all creative - * types. Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for - * existing creatives. New creatives should use DISPLAY as a replacement for - * these types. - */ - type: string; - /** - * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following - * creative types: INSTREAM_VIDEO and VPAID. - */ - universalAdId: Schema$UniversalAdId; - /** - * The version number helps you keep track of multiple versions of your - * creative in your reports. The version number will always be auto-generated - * during insert operations to start at 1. For tracking creatives the version - * cannot be incremented and will always remain at 1. For all other creative - * types the version can be incremented only by 1 during update operations. In - * addition, the version will be automatically incremented by 1 when - * undergoing Rich Media creative merging. Applicable to all creative types. - */ - version: number; - /** - * Description of the video ad. Applicable to the following creative types: - * all INSTREAM_VIDEO and all VPAID. - */ - videoDescription: string; - /** - * Creative video duration in seconds. This is a read-only field. Applicable - * to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all - * VPAID. - */ - videoDuration: number; -} -/** - * Creative Asset. - */ -export interface Schema$CreativeAsset { - /** - * Whether ActionScript3 is enabled for the flash asset. This is a read-only - * field. Applicable to the following creative type: FLASH_INPAGE. Applicable - * to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - actionScript3: boolean; - /** - * Whether the video asset is active. This is a read-only field for - * VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: - * INSTREAM_VIDEO and all VPAID. - */ - active: boolean; - /** - * Possible alignments for an asset. This is a read-only field. Applicable to - * the following creative types: - * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. - */ - alignment: string; - /** - * Artwork type of rich media creative. This is a read-only field. Applicable - * to the following creative types: all RICH_MEDIA. - */ - artworkType: string; - /** - * Identifier of this asset. This is the same identifier returned during - * creative asset insert operation. This is a required field. Applicable to - * all but the following creative types: all REDIRECT and TRACKING_TEXT. - */ - assetIdentifier: Schema$CreativeAssetId; - /** - * Exit event configured for the backup image. Applicable to the following - * creative types: all RICH_MEDIA. - */ - backupImageExit: Schema$CreativeCustomEvent; - /** - * Detected bit-rate for video asset. This is a read-only field. Applicable to - * the following creative types: INSTREAM_VIDEO and all VPAID. - */ - bitRate: number; - /** - * Rich media child asset type. This is a read-only field. Applicable to the - * following creative types: all VPAID. - */ - childAssetType: string; - /** - * Size of an asset when collapsed. This is a read-only field. Applicable to - * the following creative types: all RICH_MEDIA and all VPAID. Additionally, - * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or - * ASSET_DISPLAY_TYPE_PEEL_DOWN. - */ - collapsedSize: Schema$Size; - /** - * List of companion creatives assigned to an in-stream video creative asset. - * Acceptable values include IDs of existing flash and image creatives. - * Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set - * to true. - */ - companionCreativeIds: string[]; - /** - * Custom start time in seconds for making the asset visible. Applicable to - * the following creative types: all RICH_MEDIA. Value must be greater than or - * equal to 0. - */ - customStartTimeValue: number; - /** - * List of feature dependencies for the creative asset that are detected by - * DCM. Feature dependencies are features that a browser must be able to - * support in order to render your HTML5 creative correctly. This is a - * read-only, auto-generated field. Applicable to the following creative - * types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is - * not HTML_IMAGE. - */ - detectedFeatures: string[]; - /** - * Type of rich media asset. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA. - */ - displayType: string; - /** - * Duration in seconds for which an asset will be displayed. Applicable to the - * following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must - * be greater than or equal to 1. - */ - duration: number; - /** - * Duration type for which an asset will be displayed. Applicable to the - * following creative types: all RICH_MEDIA. - */ - durationType: string; - /** - * Detected expanded dimension for video asset. This is a read-only field. - * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - expandedDimension: Schema$Size; - /** - * File size associated with this creative asset. This is a read-only field. - * Applicable to all but the following creative types: all REDIRECT and - * TRACKING_TEXT. - */ - fileSize: string; - /** - * Flash version of the asset. This is a read-only field. Applicable to the - * following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - flashVersion: number; - /** - * Whether to hide Flash objects flag for an asset. Applicable to the - * following creative types: all RICH_MEDIA. - */ - hideFlashObjects: boolean; - /** - * Whether to hide selection boxes flag for an asset. Applicable to the - * following creative types: all RICH_MEDIA. - */ - hideSelectionBoxes: boolean; - /** - * Whether the asset is horizontally locked. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA. - */ - horizontallyLocked: boolean; - /** - * Numeric ID of this creative asset. This is a required field and should not - * be modified. Applicable to all but the following creative types: all - * REDIRECT and TRACKING_TEXT. - */ - id: string; - /** - * Dimension value for the ID of the asset. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Detected MIME type for video asset. This is a read-only field. Applicable - * to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - mimeType: string; - /** - * Offset position for an asset in collapsed mode. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA and all VPAID. - * Additionally, only applicable to assets whose displayType is - * ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. - */ - offset: Schema$OffsetPosition; - /** - * Whether the backup asset is original or changed by the user in DCM. - * Applicable to the following creative types: all RICH_MEDIA. - */ - originalBackup: boolean; - /** - * Offset position for an asset. Applicable to the following creative types: - * all RICH_MEDIA. - */ - position: Schema$OffsetPosition; - /** - * Offset left unit for an asset. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA. - */ - positionLeftUnit: string; - /** - * Offset top unit for an asset. This is a read-only field if the asset - * displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following - * creative types: all RICH_MEDIA. - */ - positionTopUnit: string; - /** - * Progressive URL for video asset. This is a read-only field. Applicable to - * the following creative types: INSTREAM_VIDEO and all VPAID. - */ - progressiveServingUrl: string; - /** - * Whether the asset pushes down other content. Applicable to the following - * creative types: all RICH_MEDIA. Additionally, only applicable when the - * asset offsets are 0, the collapsedSize.width matches size.width, and the - * collapsedSize.height is less than size.height. - */ - pushdown: boolean; - /** - * Pushdown duration in seconds for an asset. Applicable to the following - * creative types: all RICH_MEDIA.Additionally, only applicable when the asset - * pushdown field is true, the offsets are 0, the collapsedSize.width matches - * size.width, and the collapsedSize.height is less than size.height. - * Acceptable values are 0 to 9.99, inclusive. - */ - pushdownDuration: number; - /** - * Role of the asset in relation to creative. Applicable to all but the - * following creative types: all REDIRECT and TRACKING_TEXT. This is a - * required field. PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, - * IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple - * primary assets), and all VPAID creatives. BACKUP_IMAGE applies to - * FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. - * OTHER refers to assets from sources other than DCM, such as Studio uploaded - * assets, applicable to all RICH_MEDIA and all VPAID creatives. PARENT_VIDEO - * refers to videos uploaded by the user in DCM and is applicable to - * INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. TRANSCODED_VIDEO refers to - * videos transcoded by DCM from PARENT_VIDEO assets and is applicable to - * INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. ALTERNATE_VIDEO refers to - * the DCM representation of child asset videos from Studio, and is applicable - * to VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within - * DCM. For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and - * ALTERNATE_VIDEO assets that are marked active serve as backup in case the - * VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or - * removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. - */ - role: string; - /** - * Size associated with this creative asset. This is a required field when - * applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, - * this field will be automatically set using the actual size of the - * associated image asset. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all - * RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - size: Schema$Size; - /** - * Whether the asset is SSL-compliant. This is a read-only field. Applicable - * to all but the following creative types: all REDIRECT and TRACKING_TEXT. - */ - sslCompliant: boolean; - /** - * Initial wait time type before making the asset visible. Applicable to the - * following creative types: all RICH_MEDIA. - */ - startTimeType: string; - /** - * Streaming URL for video asset. This is a read-only field. Applicable to the - * following creative types: INSTREAM_VIDEO and all VPAID. - */ - streamingServingUrl: string; - /** - * Whether the asset is transparent. Applicable to the following creative - * types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. - */ - transparency: boolean; - /** - * Whether the asset is vertically locked. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA. - */ - verticallyLocked: boolean; - /** - * Detected video duration for video asset. This is a read-only field. - * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - videoDuration: number; - /** - * Window mode options for flash assets. Applicable to the following creative - * types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, - * RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING. - */ - windowMode: string; - /** - * zIndex value of an asset. Applicable to the following creative types: all - * RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT - * one of the following types: ASSET_DISPLAY_TYPE_INPAGE or - * ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, - * inclusive. - */ - zIndex: number; - /** - * File name of zip file. This is a read-only field. Applicable to the - * following creative types: HTML5_BANNER. - */ - zipFilename: string; - /** - * Size of zip file. This is a read-only field. Applicable to the following - * creative types: HTML5_BANNER. - */ - zipFilesize: string; -} -/** - * Creative Asset ID. - */ -export interface Schema$CreativeAssetId { - /** - * Name of the creative asset. This is a required field while inserting an - * asset. After insertion, this assetIdentifier is used to identify the - * uploaded asset. Characters in the name must be alphanumeric or one of the - * following: ".-_ ". Spaces are allowed. - */ - name: string; - /** - * Type of asset to upload. This is a required field. FLASH and IMAGE are no - * longer supported for new uploads. All image assets should use HTML_IMAGE. - */ - type: string; -} -/** - * CreativeAssets contains properties of a creative asset file which will be - * uploaded or has already been uploaded. Refer to the creative sample code for - * how to upload assets and insert a creative. - */ -export interface Schema$CreativeAssetMetadata { - /** - * ID of the creative asset. This is a required field. - */ - assetIdentifier: Schema$CreativeAssetId; - /** - * List of detected click tags for assets. This is a read-only auto-generated - * field. - */ - clickTags: Schema$ClickTag[]; - /** - * List of feature dependencies for the creative asset that are detected by - * DCM. Feature dependencies are features that a browser must be able to - * support in order to render your HTML5 creative correctly. This is a - * read-only, auto-generated field. - */ - detectedFeatures: string[]; - /** - * Numeric ID of the asset. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the numeric ID of the asset. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeAssetMetadata". - */ - kind: string; - /** - * Rules validated during code generation that generated a warning. This is a - * read-only, auto-generated field. Possible values are: - - * "ADMOB_REFERENCED" - "ASSET_FORMAT_UNSUPPORTED_DCM" - - * "ASSET_INVALID" - "CLICK_TAG_HARD_CODED" - - * "CLICK_TAG_INVALID" - "CLICK_TAG_IN_GWD" - - * "CLICK_TAG_MISSING" - "CLICK_TAG_MORE_THAN_ONE" - - * "CLICK_TAG_NON_TOP_LEVEL" - "COMPONENT_UNSUPPORTED_DCM" - * - "ENABLER_UNSUPPORTED_METHOD_DCM" - - * "EXTERNAL_FILE_REFERENCED" - "FILE_DETAIL_EMPTY" - - * "FILE_TYPE_INVALID" - "GWD_PROPERTIES_INVALID" - - * "HTML5_FEATURE_UNSUPPORTED" - "LINKED_FILE_NOT_FOUND" - - * "MAX_FLASH_VERSION_11" - "MRAID_REFERENCED" - - * "NOT_SSL_COMPLIANT" - "ORPHANED_ASSET" - - * "PRIMARY_HTML_MISSING" - "SVG_INVALID" - - * "ZIP_INVALID" - */ - warnedValidationRules: string[]; -} -/** - * Encapsulates the list of rules for asset selection and a default asset in - * case none of the rules match. Applicable to INSTREAM_VIDEO creatives. - */ -export interface Schema$CreativeAssetSelection { - /** - * A creativeAssets[].id. This should refer to one of the parent assets in - * this creative, and will be served if none of the rules match. This is a - * required field. - */ - defaultAssetId: string; - /** - * Rules determine which asset will be served to a viewer. Rules will be - * evaluated in the order in which they are stored in this list. This list - * must contain at least one rule. Applicable to INSTREAM_VIDEO creatives. - */ - rules: Schema$Rule[]; -} -/** - * Creative Assignment. - */ -export interface Schema$CreativeAssignment { - /** - * Whether this creative assignment is active. When true, the creative will be - * included in the ad's rotation. - */ - active: boolean; - /** - * Whether applicable event tags should fire when this creative assignment is - * rendered. If this value is unset when the ad is inserted or updated, it - * will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, - * INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. - */ - applyEventTags: boolean; - /** - * Click-through URL of the creative assignment. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Companion creative overrides for this creative assignment. Applicable to - * video ads. - */ - companionCreativeOverrides: Schema$CompanionClickThroughOverride[]; - /** - * Creative group assignments for this creative assignment. Only one - * assignment per creative group number is allowed for a maximum of two - * assignments. - */ - creativeGroupAssignments: Schema$CreativeGroupAssignment[]; - /** - * ID of the creative to be assigned. This is a required field. - */ - creativeId: string; - /** - * Dimension value for the ID of the creative. This is a read-only, - * auto-generated field. - */ - creativeIdDimensionValue: Schema$DimensionValue; - /** - * Date and time that the assigned creative should stop serving. Must be later - * than the start time. - */ - endTime: string; - /** - * Rich media exit overrides for this creative assignment. Applicable when the - * creative type is any of the following: - DISPLAY - RICH_MEDIA_INPAGE - - * RICH_MEDIA_INPAGE_FLOATING - RICH_MEDIA_IM_EXPAND - RICH_MEDIA_EXPANDING - - * RICH_MEDIA_INTERSTITIAL_FLOAT - RICH_MEDIA_MOBILE_IN_APP - - * RICH_MEDIA_MULTI_FLOATING - RICH_MEDIA_PEEL_DOWN - VPAID_LINEAR - - * VPAID_NON_LINEAR - */ - richMediaExitOverrides: Schema$RichMediaExitOverride[]; - /** - * Sequence number of the creative assignment, applicable when the rotation - * type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to - * 65535, inclusive. - */ - sequence: number; - /** - * Whether the creative to be assigned is SSL-compliant. This is a read-only - * field that is auto-generated when the ad is inserted or updated. - */ - sslCompliant: boolean; - /** - * Date and time that the assigned creative should start serving. - */ - startTime: string; - /** - * Weight of the creative assignment, applicable when the rotation type is - * CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. - */ - weight: number; -} -/** - * Creative Custom Event. - */ -export interface Schema$CreativeCustomEvent { - /** - * Unique ID of this event used by DDM Reporting and Data Transfer. This is a - * read-only field. - */ - advertiserCustomEventId: string; - /** - * User-entered name for the event. - */ - advertiserCustomEventName: string; - /** - * Type of the event. This is a read-only field. - */ - advertiserCustomEventType: string; - /** - * Artwork label column, used to link events in DCM back to events in Studio. - * This is a required field and should not be modified after insertion. - */ - artworkLabel: string; - /** - * Artwork type used by the creative.This is a read-only field. - */ - artworkType: string; - /** - * Exit URL of the event. This field is used only for exit events. - */ - exitUrl: string; - /** - * ID of this event. This is a required field and should not be modified after - * insertion. - */ - id: string; - /** - * Properties for rich media popup windows. This field is used only for exit - * events. - */ - popupWindowProperties: Schema$PopupWindowProperties; - /** - * Target type used by the event. - */ - targetType: string; - /** - * Video reporting ID, used to differentiate multiple videos in a single - * creative. This is a read-only field. - */ - videoReportingId: string; -} -/** - * Contains properties of a creative field. - */ -export interface Schema$CreativeField { - /** - * Account ID of this creative field. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this creative field. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * ID of this creative field. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeField". - */ - kind: string; - /** - * Name of this creative field. This is a required field and must be less than - * 256 characters long and unique among creative fields of the same - * advertiser. - */ - name: string; - /** - * Subaccount ID of this creative field. This is a read-only field that can be - * left blank. - */ - subaccountId: string; -} -/** - * Creative Field Assignment. - */ -export interface Schema$CreativeFieldAssignment { - /** - * ID of the creative field. - */ - creativeFieldId: string; - /** - * ID of the creative field value. - */ - creativeFieldValueId: string; -} -/** - * Creative Field List Response - */ -export interface Schema$CreativeFieldsListResponse { - /** - * Creative field collection. - */ - creativeFields: Schema$CreativeField[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a creative field value. - */ -export interface Schema$CreativeFieldValue { - /** - * ID of this creative field value. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldValue". - */ - kind: string; - /** - * Value of this creative field value. It needs to be less than 256 characters - * in length and unique per creative field. - */ - value: string; -} -/** - * Creative Field Value List Response - */ -export interface Schema$CreativeFieldValuesListResponse { - /** - * Creative field value collection. - */ - creativeFieldValues: Schema$CreativeFieldValue[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldValuesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a creative group. - */ -export interface Schema$CreativeGroup { - /** - * Account ID of this creative group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this creative group. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Subgroup of the creative group. Assign your creative groups to a subgroup - * in order to filter or manage them more easily. This field is required on - * insertion and is read-only after insertion. Acceptable values are 1 to 2, - * inclusive. - */ - groupNumber: number; - /** - * ID of this creative group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeGroup". - */ - kind: string; - /** - * Name of this creative group. This is a required field and must be less than - * 256 characters long and unique among creative groups of the same - * advertiser. - */ - name: string; - /** - * Subaccount ID of this creative group. This is a read-only field that can be - * left blank. - */ - subaccountId: string; -} -/** - * Creative Group Assignment. - */ -export interface Schema$CreativeGroupAssignment { - /** - * ID of the creative group to be assigned. - */ - creativeGroupId: string; - /** - * Creative group number of the creative group assignment. - */ - creativeGroupNumber: string; -} -/** - * Creative Group List Response - */ -export interface Schema$CreativeGroupsListResponse { - /** - * Creative group collection. - */ - creativeGroups: Schema$CreativeGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Creative optimization settings. - */ -export interface Schema$CreativeOptimizationConfiguration { - /** - * ID of this creative optimization config. This field is auto-generated when - * the campaign is inserted or updated. It can be null for existing campaigns. - */ - id: string; - /** - * Name of this creative optimization config. This is a required field and - * must be less than 129 characters long. - */ - name: string; - /** - * List of optimization activities associated with this configuration. - */ - optimizationActivitys: Schema$OptimizationActivity[]; - /** - * Optimization model for this configuration. - */ - optimizationModel: string; -} -/** - * Creative Rotation. - */ -export interface Schema$CreativeRotation { - /** - * Creative assignments in this creative rotation. - */ - creativeAssignments: Schema$CreativeAssignment[]; - /** - * Creative optimization configuration that is used by this ad. It should - * refer to one of the existing optimization configurations in the ad's - * campaign. If it is unset or set to 0, then the campaign's default - * optimization configuration will be used for this ad. - */ - creativeOptimizationConfigurationId: string; - /** - * Type of creative rotation. Can be used to specify whether to use sequential - * or random rotation. - */ - type: string; - /** - * Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM. - */ - weightCalculationStrategy: string; -} -/** - * Creative Settings - */ -export interface Schema$CreativeSettings { - /** - * Header text for iFrames for this site. Must be less than or equal to 2000 - * characters long. - */ - iFrameFooter: string; - /** - * Header text for iFrames for this site. Must be less than or equal to 2000 - * characters long. - */ - iFrameHeader: string; -} -/** - * Creative List Response - */ -export interface Schema$CreativesListResponse { - /** - * Creative collection. - */ - creatives: Schema$Creative[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "CROSS_DIMENSION_REACH". - */ -export interface Schema$CrossDimensionReachReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the "breakdown" - * section of the report. - */ - breakdown: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#crossDimensionReachReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected in the - * "overlapMetricNames" section of the report. - */ - overlapMetrics: Schema$Metric[]; -} -/** - * A custom floodlight variable. - */ -export interface Schema$CustomFloodlightVariable { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#customFloodlightVariable". - */ - kind: string; - /** - * The type of custom floodlight variable to supply a value for. These map to - * the "u[1-20]=" in the tags. - */ - type: string; - /** - * The value of the custom floodlight variable. The length of string must not - * exceed 50 characters. - */ - value: string; -} -/** - * Represents a Custom Rich Media Events group. - */ -export interface Schema$CustomRichMediaEvents { - /** - * List of custom rich media event IDs. Dimension values must be all of type - * dfa:richMediaEventTypeIdAndName. - */ - filteredEventIds: Schema$DimensionValue[]; - /** - * The kind of resource this is, in this case - * dfareporting#customRichMediaEvents. - */ - kind: string; -} -/** - * Represents a date range. - */ -export interface Schema$DateRange { - /** - * The end date of the date range, inclusive. A string of the format: - * "yyyy-MM-dd". - */ - endDate: string; - /** - * The kind of resource this is, in this case dfareporting#dateRange. - */ - kind: string; - /** - * The date range relative to the date of when the report is run. - */ - relativeDateRange: string; - /** - * The start date of the date range, inclusive. A string of the format: - * "yyyy-MM-dd". - */ - startDate: string; -} -/** - * Day Part Targeting. - */ -export interface Schema$DayPartTargeting { - /** - * Days of the week when the ad will serve. Acceptable values are: - - * "SUNDAY" - "MONDAY" - "TUESDAY" - - * "WEDNESDAY" - "THURSDAY" - "FRIDAY" - - * "SATURDAY" - */ - daysOfWeek: string[]; - /** - * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 - * is 11 PM to midnight. Can be specified with days of week, in which case the - * ad would serve during these hours on the specified days. For example if - * Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm - * (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, - * and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive. - */ - hoursOfDay: number[]; - /** - * Whether or not to use the user's local time. If false, the America/New - * York time zone applies. - */ - userLocalTime: boolean; -} -/** - * Properties of inheriting and overriding the default click-through event tag. - * A campaign may override the event tag defined at the advertiser level, and an - * ad may also override the campaign's setting further. - */ -export interface Schema$DefaultClickThroughEventTagProperties { - /** - * ID of the click-through event tag to apply to all ads in this entity's - * scope. - */ - defaultClickThroughEventTagId: string; - /** - * Whether this entity should override the inherited default click-through - * event tag with its own defined value. - */ - overrideInheritedEventTag: boolean; -} -/** - * Delivery Schedule. - */ -export interface Schema$DeliverySchedule { - /** - * Limit on the number of times an individual user can be served the ad within - * a specified period of time. - */ - frequencyCap: Schema$FrequencyCap; - /** - * Whether or not hard cutoff is enabled. If true, the ad will not serve after - * the end date and time. Otherwise the ad will continue to be served until it - * has reached its delivery goals. - */ - hardCutoff: boolean; - /** - * Impression ratio for this ad. This ratio determines how often each ad is - * served relative to the others. For example, if ad A has an impression ratio - * of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three - * times as often as ad A. Acceptable values are 1 to 10, inclusive. - */ - impressionRatio: string; - /** - * Serving priority of an ad, with respect to other ads. The lower the - * priority number, the greater the priority with which it is served. - */ - priority: string; -} -/** - * DFP Settings - */ -export interface Schema$DfpSettings { - /** - * DFP network code for this directory site. - */ - dfpNetworkCode: string; - /** - * DFP network name for this directory site. - */ - dfpNetworkName: string; - /** - * Whether this directory site accepts programmatic placements. - */ - programmaticPlacementAccepted: boolean; - /** - * Whether this directory site is available only via DoubleClick Publisher - * Portal. - */ - publisherPortalOnly: boolean; - /** - * Whether this directory site accepts publisher-paid tags. - */ - pubPaidPlacementAccepted: boolean; -} -/** - * Represents a dimension. - */ -export interface Schema$Dimension { - /** - * The kind of resource this is, in this case dfareporting#dimension. - */ - kind: string; - /** - * The dimension name, e.g. dfa:advertiser - */ - name: string; -} -/** - * Represents a dimension filter. - */ -export interface Schema$DimensionFilter { - /** - * The name of the dimension to filter. - */ - dimensionName: string; - /** - * The kind of resource this is, in this case dfareporting#dimensionFilter. - */ - kind: string; - /** - * The value of the dimension to filter. - */ - value: string; -} -/** - * Represents a DimensionValue resource. - */ -export interface Schema$DimensionValue { - /** - * The name of the dimension. - */ - dimensionName: string; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The ID associated with the value if available. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#dimensionValue. - */ - kind: string; - /** - * Determines how the 'value' field is matched when filtering. If not - * specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is - * allowed as a placeholder for variable length character sequences, and it - * can be escaped with a backslash. Note, only paid search dimensions - * ('dfa:paidSearch*') allow a matchType other than EXACT. - */ - matchType: string; - /** - * The value of the dimension. - */ - value: string; -} -/** - * Represents the list of DimensionValue resources. - */ -export interface Schema$DimensionValueList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The dimension values returned in this response. - */ - items: Schema$DimensionValue[]; - /** - * The kind of list this is, in this case dfareporting#dimensionValueList. - */ - kind: string; - /** - * Continuation token used to page through dimension values. To retrieve the - * next page of results, set the next request's "pageToken" to - * the value of this field. The page token is only valid for a limited amount - * of time and should not be persisted. - */ - nextPageToken: string; -} -/** - * Represents a DimensionValuesRequest. - */ -export interface Schema$DimensionValueRequest { - /** - * The name of the dimension for which values should be requested. - */ - dimensionName: string; - /** - * The end date of the date range for which to retrieve dimension values. A - * string of the format "yyyy-MM-dd". - */ - endDate: string; - /** - * The list of filters by which to filter values. The filters are ANDed. - */ - filters: Schema$DimensionFilter[]; - /** - * The kind of request this is, in this case - * dfareporting#dimensionValueRequest. - */ - kind: string; - /** - * The start date of the date range for which to retrieve dimension values. A - * string of the format "yyyy-MM-dd". - */ - startDate: string; -} -/** - * DirectorySites contains properties of a website from the Site Directory. - * Sites need to be added to an account via the Sites resource before they can - * be assigned to a placement. - */ -export interface Schema$DirectorySite { - /** - * Whether this directory site is active. - */ - active: boolean; - /** - * Directory site contacts. - */ - contactAssignments: Schema$DirectorySiteContactAssignment[]; - /** - * Country ID of this directory site. This is a read-only field. - */ - countryId: string; - /** - * Currency ID of this directory site. This is a read-only field. Possible - * values are: - "1" for USD - "2" for GBP - - * "3" for ESP - "4" for SEK - "5" for CAD - - * "6" for JPY - "7" for DEM - "8" for AUD - - * "9" for FRF - "10" for ITL - "11" for DKK - * - "12" for NOK - "13" for FIM - "14" for - * ZAR - "15" for IEP - "16" for NLG - "17" - * for EUR - "18" for KRW - "19" for TWD - - * "20" for SGD - "21" for CNY - "22" for HKD - * - "23" for NZD - "24" for MYR - "25" for - * BRL - "26" for PTE - "27" for MXP - "28" - * for CLP - "29" for TRY - "30" for ARS - - * "31" for PEN - "32" for ILS - "33" for CHF - * - "34" for VEF - "35" for COP - "36" for - * GTQ - "37" for PLN - "39" for INR - "40" - * for THB - "41" for IDR - "42" for CZK - - * "43" for RON - "44" for HUF - "45" for RUB - * - "46" for AED - "47" for BGN - "48" for - * HRK - "49" for MXN - "50" for NGN - */ - currencyId: string; - /** - * Description of this directory site. This is a read-only field. - */ - description: string; - /** - * ID of this directory site. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this directory site. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Tag types for regular placements. Acceptable values are: - - * "STANDARD" - "IFRAME_JAVASCRIPT_INPAGE" - - * "INTERNAL_REDIRECT_INPAGE" - "JAVASCRIPT_INPAGE" - */ - inpageTagFormats: string[]; - /** - * Tag types for interstitial placements. Acceptable values are: - - * "IFRAME_JAVASCRIPT_INTERSTITIAL" - - * "INTERNAL_REDIRECT_INTERSTITIAL" - - * "JAVASCRIPT_INTERSTITIAL" - */ - interstitialTagFormats: string[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySite". - */ - kind: string; - /** - * Name of this directory site. - */ - name: string; - /** - * Parent directory site ID. - */ - parentId: string; - /** - * Directory site settings. - */ - settings: Schema$DirectorySiteSettings; - /** - * URL of this directory site. - */ - url: string; -} -/** - * Contains properties of a Site Directory contact. - */ -export interface Schema$DirectorySiteContact { - /** - * Address of this directory site contact. - */ - address: string; - /** - * Email address of this directory site contact. - */ - email: string; - /** - * First name of this directory site contact. - */ - firstName: string; - /** - * ID of this directory site contact. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySiteContact". - */ - kind: string; - /** - * Last name of this directory site contact. - */ - lastName: string; - /** - * Phone number of this directory site contact. - */ - phone: string; - /** - * Directory site contact role. - */ - role: string; - /** - * Title or designation of this directory site contact. - */ - title: string; - /** - * Directory site contact type. - */ - type: string; -} -/** - * Directory Site Contact Assignment - */ -export interface Schema$DirectorySiteContactAssignment { - /** - * ID of this directory site contact. This is a read-only, auto-generated - * field. - */ - contactId: string; - /** - * Visibility of this directory site contact assignment. When set to PUBLIC - * this contact assignment is visible to all account and agency users; when - * set to PRIVATE it is visible only to the site. - */ - visibility: string; -} -/** - * Directory Site Contact List Response - */ -export interface Schema$DirectorySiteContactsListResponse { - /** - * Directory site contact collection - */ - directorySiteContacts: Schema$DirectorySiteContact[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySiteContactsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Directory Site Settings - */ -export interface Schema$DirectorySiteSettings { - /** - * Whether this directory site has disabled active view creatives. - */ - activeViewOptOut: boolean; - /** - * Directory site DFP settings. - */ - dfpSettings: Schema$DfpSettings; - /** - * Whether this site accepts in-stream video ads. - */ - instreamVideoPlacementAccepted: boolean; - /** - * Whether this site accepts interstitial ads. - */ - interstitialPlacementAccepted: boolean; - /** - * Whether this directory site has disabled Nielsen OCR reach ratings. - */ - nielsenOcrOptOut: boolean; - /** - * Whether this directory site has disabled generation of Verification ins - * tags. - */ - verificationTagOptOut: boolean; - /** - * Whether this directory site has disabled active view for in-stream video - * creatives. This is a read-only field. - */ - videoActiveViewOptOut: boolean; -} -/** - * Directory Site List Response - */ -export interface Schema$DirectorySitesListResponse { - /** - * Directory site collection. - */ - directorySites: Schema$DirectorySite[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySitesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a dynamic targeting key. Dynamic targeting keys are - * unique, user-friendly labels, created at the advertiser level in DCM, that - * can be assigned to ads, creatives, and placements and used for targeting with - * DoubleClick Studio dynamic creatives. Use these labels instead of numeric DCM - * IDs (such as placement IDs) to save time and avoid errors in your dynamic - * feeds. - */ -export interface Schema$DynamicTargetingKey { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#dynamicTargetingKey". - */ - kind: string; - /** - * Name of this dynamic targeting key. This is a required field. Must be less - * than 256 characters long and cannot contain commas. All characters are - * converted to lowercase. - */ - name: string; - /** - * ID of the object of this dynamic targeting key. This is a required field. - */ - objectId: string; - /** - * Type of the object of this dynamic targeting key. This is a required field. - */ - objectType: string; -} -/** - * Dynamic Targeting Key List Response - */ -export interface Schema$DynamicTargetingKeysListResponse { - /** - * Dynamic targeting key collection. - */ - dynamicTargetingKeys: Schema$DynamicTargetingKey[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#dynamicTargetingKeysListResponse". - */ - kind: string; -} -/** - * A description of how user IDs are encrypted. - */ -export interface Schema$EncryptionInfo { - /** - * The encryption entity ID. This should match the encryption configuration - * for ad serving or Data Transfer. - */ - encryptionEntityId: string; - /** - * The encryption entity type. This should match the encryption configuration - * for ad serving or Data Transfer. - */ - encryptionEntityType: string; - /** - * Describes whether the encrypted cookie was received from ad serving (the %m - * macro) or from Data Transfer. - */ - encryptionSource: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#encryptionInfo". - */ - kind: string; -} -/** - * Contains properties of an event tag. - */ -export interface Schema$EventTag { - /** - * Account ID of this event tag. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Advertiser ID of this event tag. This field or the campaignId field is - * required on insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Campaign ID of this event tag. This field or the advertiserId field is - * required on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Whether this event tag should be automatically enabled for all of the - * advertiser's campaigns and ads. - */ - enabledByDefault: boolean; - /** - * Whether to remove this event tag from ads that are trafficked through - * DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag - * uses a pixel that is unapproved for Ad Exchange bids on one or more - * networks, such as the Google Display Network. - */ - excludeFromAdxRequests: boolean; - /** - * ID of this event tag. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#eventTag". - */ - kind: string; - /** - * Name of this event tag. This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Site filter type for this event tag. If no type is specified then the event - * tag will be applied to all sites. - */ - siteFilterType: string; - /** - * Filter list of site IDs associated with this event tag. The siteFilterType - * determines whether this is a whitelist or blacklist filter. - */ - siteIds: string[]; - /** - * Whether this tag is SSL-compliant or not. This is a read-only field. - */ - sslCompliant: boolean; - /** - * Status of this event tag. Must be ENABLED for this event tag to fire. This - * is a required field. - */ - status: string; - /** - * Subaccount ID of this event tag. This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Event tag type. Can be used to specify whether to use a third-party pixel, - * a third-party JavaScript URL, or a third-party click-through URL for either - * impression or click tracking. This is a required field. - */ - type: string; - /** - * Payload URL for this event tag. The URL on a click-through event tag should - * have a landing page URL appended to the end of it. This field is required - * on insertion. - */ - url: string; - /** - * Number of times the landing page URL should be URL-escaped before being - * appended to the click-through event tag URL. Only applies to click-through - * event tags as specified by the event tag type. - */ - urlEscapeLevels: number; -} -/** - * Event tag override information. - */ -export interface Schema$EventTagOverride { - /** - * Whether this override is enabled. - */ - enabled: boolean; - /** - * ID of this event tag override. This is a read-only, auto-generated field. - */ - id: string; -} -/** - * Event Tag List Response - */ -export interface Schema$EventTagsListResponse { - /** - * Event tag collection. - */ - eventTags: Schema$EventTag[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#eventTagsListResponse". - */ - kind: string; -} -/** - * Represents a File resource. A file contains the metadata for a report run. It - * shows the status of the run and holds the URLs to the generated report data - * if the run is finished and the status is "REPORT_AVAILABLE". - */ -export interface Schema$File { - /** - * The date range for which the file has report data. The date range will - * always be the absolute date range for which the report is run. - */ - dateRange: Schema$DateRange; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The filename of the file. - */ - fileName: string; - /** - * The output format of the report. Only available once the file is available. - */ - format: string; - /** - * The unique ID of this report file. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#file. - */ - kind: string; - /** - * The timestamp in milliseconds since epoch when this file was last modified. - */ - lastModifiedTime: string; - /** - * The ID of the report this file was generated from. - */ - reportId: string; - /** - * The status of the report file. - */ - status: string; - /** - * The URLs where the completed report file can be downloaded. - */ - urls: any; -} -/** - * Represents the list of File resources. - */ -export interface Schema$FileList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The files returned in this response. - */ - items: Schema$File[]; - /** - * The kind of list this is, in this case dfareporting#fileList. - */ - kind: string; - /** - * Continuation token used to page through files. To retrieve the next page of - * results, set the next request's "pageToken" to the value of - * this field. The page token is only valid for a limited amount of time and - * should not be persisted. - */ - nextPageToken: string; -} -/** - * Flight - */ -export interface Schema$Flight { - /** - * Inventory item flight end date. - */ - endDate: string; - /** - * Rate or cost of this flight. - */ - rateOrCost: string; - /** - * Inventory item flight start date. - */ - startDate: string; - /** - * Units of this flight. - */ - units: string; -} -/** - * Floodlight Activity GenerateTag Response - */ -export interface Schema$FloodlightActivitiesGenerateTagResponse { - /** - * Generated tag for this Floodlight activity. For global site tags, this is - * the event snippet. - */ - floodlightActivityTag: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivitiesGenerateTagResponse". - */ - kind: string; -} -/** - * Floodlight Activity List Response - */ -export interface Schema$FloodlightActivitiesListResponse { - /** - * Floodlight activity collection. - */ - floodlightActivities: Schema$FloodlightActivity[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivitiesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a Floodlight activity. - */ -export interface Schema$FloodlightActivity { - /** - * Account ID of this floodlight activity. This is a read-only field that can - * be left blank. - */ - accountId: string; - /** - * Advertiser ID of this floodlight activity. If this field is left blank, the - * value will be copied over either from the activity group's advertiser - * or the existing activity's advertiser. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Code type used for cache busting in the generated tag. Applicable only when - * floodlightActivityGroupType is COUNTER and countingMethod is - * STANDARD_COUNTING or UNIQUE_COUNTING. - */ - cacheBustingType: string; - /** - * Counting method for conversions for this floodlight activity. This is a - * required field. - */ - countingMethod: string; - /** - * Dynamic floodlight tags. - */ - defaultTags: Schema$FloodlightActivityDynamicTag[]; - /** - * URL where this tag will be deployed. If specified, must be less than 256 - * characters long. - */ - expectedUrl: string; - /** - * Floodlight activity group ID of this floodlight activity. This is a - * required field. - */ - floodlightActivityGroupId: string; - /** - * Name of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupName: string; - /** - * Tag string of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupTagString: string; - /** - * Type of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupType: string; - /** - * Floodlight configuration ID of this floodlight activity. If this field is - * left blank, the value will be copied over either from the activity - * group's floodlight configuration or from the existing activity's - * floodlight configuration. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * Whether this activity is archived. - */ - hidden: boolean; - /** - * ID of this floodlight activity. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight activity. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Whether the image tag is enabled for this activity. - */ - imageTagEnabled: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivity". - */ - kind: string; - /** - * Name of this floodlight activity. This is a required field. Must be less - * than 129 characters long and cannot contain quotes. - */ - name: string; - /** - * General notes or implementation instructions for the tag. - */ - notes: string; - /** - * Publisher dynamic floodlight tags. - */ - publisherTags: Schema$FloodlightActivityPublisherDynamicTag[]; - /** - * Whether this tag should use SSL. - */ - secure: boolean; - /** - * Whether the floodlight activity is SSL-compliant. This is a read-only - * field, its value detected by the system from the floodlight tags. - */ - sslCompliant: boolean; - /** - * Whether this floodlight activity must be SSL-compliant. - */ - sslRequired: boolean; - /** - * Subaccount ID of this floodlight activity. This is a read-only field that - * can be left blank. - */ - subaccountId: string; - /** - * Tag format type for the floodlight activity. If left blank, the tag format - * will default to HTML. - */ - tagFormat: string; - /** - * Value of the cat= parameter in the floodlight tag, which the ad servers use - * to identify the activity. This is optional: if empty, a new tag string will - * be generated for you. This string must be 1 to 8 characters long, with - * valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also - * be unique among activities of the same activity group. This field is - * read-only after insertion. - */ - tagString: string; - /** - * List of the user-defined variables used by this conversion tag. These map - * to the "u[1-100]=" in the tags. Each of these can have a user - * defined type. Acceptable values are U1 to U100, inclusive. - */ - userDefinedVariableTypes: string[]; -} -/** - * Dynamic Tag - */ -export interface Schema$FloodlightActivityDynamicTag { - /** - * ID of this dynamic tag. This is a read-only, auto-generated field. - */ - id: string; - /** - * Name of this tag. - */ - name: string; - /** - * Tag code. - */ - tag: string; -} -/** - * Contains properties of a Floodlight activity group. - */ -export interface Schema$FloodlightActivityGroup { - /** - * Account ID of this floodlight activity group. This is a read-only field - * that can be left blank. - */ - accountId: string; - /** - * Advertiser ID of this floodlight activity group. If this field is left - * blank, the value will be copied over either from the floodlight - * configuration's advertiser or from the existing activity group's - * advertiser. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Floodlight configuration ID of this floodlight activity group. This is a - * required field. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * ID of this floodlight activity group. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight activity group. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivityGroup". - */ - kind: string; - /** - * Name of this floodlight activity group. This is a required field. Must be - * less than 65 characters long and cannot contain quotes. - */ - name: string; - /** - * Subaccount ID of this floodlight activity group. This is a read-only field - * that can be left blank. - */ - subaccountId: string; - /** - * Value of the type= parameter in the floodlight tag, which the ad servers - * use to identify the activity group that the activity belongs to. This is - * optional: if empty, a new tag string will be generated for you. This string - * must be 1 to 8 characters long, with valid characters being - * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity - * groups of the same floodlight configuration. This field is read-only after - * insertion. - */ - tagString: string; - /** - * Type of the floodlight activity group. This is a required field that is - * read-only after insertion. - */ - type: string; -} -/** - * Floodlight Activity Group List Response - */ -export interface Schema$FloodlightActivityGroupsListResponse { - /** - * Floodlight activity group collection. - */ - floodlightActivityGroups: Schema$FloodlightActivityGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivityGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Publisher Dynamic Tag - */ -export interface Schema$FloodlightActivityPublisherDynamicTag { - /** - * Whether this tag is applicable only for click-throughs. - */ - clickThrough: boolean; - /** - * Directory site ID of this dynamic tag. This is a write-only field that can - * be used as an alternative to the siteId field. When this resource is - * retrieved, only the siteId field will be populated. - */ - directorySiteId: string; - /** - * Dynamic floodlight tag. - */ - dynamicTag: Schema$FloodlightActivityDynamicTag; - /** - * Site ID of this dynamic tag. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Whether this tag is applicable only for view-throughs. - */ - viewThrough: boolean; -} -/** - * Contains properties of a Floodlight configuration. - */ -export interface Schema$FloodlightConfiguration { - /** - * Account ID of this floodlight configuration. This is a read-only field that - * can be left blank. - */ - accountId: string; - /** - * Advertiser ID of the parent advertiser of this floodlight configuration. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether advertiser data is shared with Google Analytics. - */ - analyticsDataSharingEnabled: boolean; - /** - * Whether the exposure-to-conversion report is enabled. This report shows - * detailed pathway information on up to 10 of the most recent ad exposures - * seen by a user before converting. - */ - exposureToConversionEnabled: boolean; - /** - * Day that will be counted as the first day of the week in reports. This is a - * required field. - */ - firstDayOfWeek: string; - /** - * ID of this floodlight configuration. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight configuration. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Whether in-app attribution tracking is enabled. - */ - inAppAttributionTrackingEnabled: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightConfiguration". - */ - kind: string; - /** - * Lookback window settings for this floodlight configuration. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Types of attribution options for natural search conversions. - */ - naturalSearchConversionAttributionOption: string; - /** - * Settings for DCM Omniture integration. - */ - omnitureSettings: Schema$OmnitureSettings; - /** - * Subaccount ID of this floodlight configuration. This is a read-only field - * that can be left blank. - */ - subaccountId: string; - /** - * Configuration settings for dynamic and image floodlight tags. - */ - tagSettings: Schema$TagSettings; - /** - * List of third-party authentication tokens enabled for this configuration. - */ - thirdPartyAuthenticationTokens: Schema$ThirdPartyAuthenticationToken[]; - /** - * List of user defined variables enabled for this configuration. - */ - userDefinedVariableConfigurations: Schema$UserDefinedVariableConfiguration[]; -} -/** - * Floodlight Configuration List Response - */ -export interface Schema$FloodlightConfigurationsListResponse { - /** - * Floodlight configuration collection. - */ - floodlightConfigurations: Schema$FloodlightConfiguration[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightConfigurationsListResponse". - */ - kind: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "FlOODLIGHT". - */ -export interface Schema$FloodlightReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#floodlightReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; -} -/** - * Frequency Cap. - */ -export interface Schema$FrequencyCap { - /** - * Duration of time, in seconds, for this frequency cap. The maximum duration - * is 90 days. Acceptable values are 1 to 7776000, inclusive. - */ - duration: string; - /** - * Number of times an individual user can be served the ad within the - * specified duration. Acceptable values are 1 to 15, inclusive. - */ - impressions: string; -} -/** - * FsCommand. - */ -export interface Schema$FsCommand { - /** - * Distance from the left of the browser.Applicable when positionOption is - * DISTANCE_FROM_TOP_LEFT_CORNER. - */ - left: number; - /** - * Position in the browser where the window will open. - */ - positionOption: string; - /** - * Distance from the top of the browser. Applicable when positionOption is - * DISTANCE_FROM_TOP_LEFT_CORNER. - */ - top: number; - /** - * Height of the window. - */ - windowHeight: number; - /** - * Width of the window. - */ - windowWidth: number; -} -/** - * Geographical Targeting. - */ -export interface Schema$GeoTargeting { - /** - * Cities to be targeted. For each city only dartId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a city, do not target or exclude the country of the city, and do - * not target the metro or region of the city. - */ - cities: Schema$City[]; - /** - * Countries to be targeted or excluded from targeting, depending on the - * setting of the excludeCountries field. For each country only dartId is - * required. The other fields are populated automatically when the ad is - * inserted or updated. If targeting or excluding a country, do not target - * regions, cities, metros, or postal codes in the same country. - */ - countries: Schema$Country[]; - /** - * Whether or not to exclude the countries in the countries field from - * targeting. If false, the countries field refers to countries which will be - * targeted by the ad. - */ - excludeCountries: boolean; - /** - * Metros to be targeted. For each metro only dmaId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a metro, do not target or exclude the country of the metro. - */ - metros: Schema$Metro[]; - /** - * Postal codes to be targeted. For each postal code only id is required. The - * other fields are populated automatically when the ad is inserted or - * updated. If targeting a postal code, do not target or exclude the country - * of the postal code. - */ - postalCodes: Schema$PostalCode[]; - /** - * Regions to be targeted. For each region only dartId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a region, do not target or exclude the country of the region. - */ - regions: Schema$Region[]; -} -/** - * Represents a buy from the DoubleClick Planning inventory store. - */ -export interface Schema$InventoryItem { - /** - * Account ID of this inventory item. - */ - accountId: string; - /** - * Ad slots of this inventory item. If this inventory item represents a - * standalone placement, there will be exactly one ad slot. If this inventory - * item represents a placement group, there will be more than one ad slot, - * each representing one child placement in that placement group. - */ - adSlots: Schema$AdSlot[]; - /** - * Advertiser ID of this inventory item. - */ - advertiserId: string; - /** - * Content category ID of this inventory item. - */ - contentCategoryId: string; - /** - * Estimated click-through rate of this inventory item. - */ - estimatedClickThroughRate: string; - /** - * Estimated conversion rate of this inventory item. - */ - estimatedConversionRate: string; - /** - * ID of this inventory item. - */ - id: string; - /** - * Whether this inventory item is in plan. - */ - inPlan: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#inventoryItem". - */ - kind: string; - /** - * Information about the most recent modification of this inventory item. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this inventory item. For standalone inventory items, this is the - * same name as that of its only ad slot. For group inventory items, this can - * differ from the name of any of its ad slots. - */ - name: string; - /** - * Negotiation channel ID of this inventory item. - */ - negotiationChannelId: string; - /** - * Order ID of this inventory item. - */ - orderId: string; - /** - * Placement strategy ID of this inventory item. - */ - placementStrategyId: string; - /** - * Pricing of this inventory item. - */ - pricing: Schema$Pricing; - /** - * Project ID of this inventory item. - */ - projectId: string; - /** - * RFP ID of this inventory item. - */ - rfpId: string; - /** - * ID of the site this inventory item is associated with. - */ - siteId: string; - /** - * Subaccount ID of this inventory item. - */ - subaccountId: string; - /** - * Type of inventory item. - */ - type: string; -} -/** - * Inventory item List Response - */ -export interface Schema$InventoryItemsListResponse { - /** - * Inventory item collection - */ - inventoryItems: Schema$InventoryItem[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#inventoryItemsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Key Value Targeting Expression. - */ -export interface Schema$KeyValueTargetingExpression { - /** - * Keyword expression being targeted by the ad. - */ - expression: string; -} -/** - * Contains information about where a user's browser is taken after the user - * clicks an ad. - */ -export interface Schema$LandingPage { - /** - * Whether or not this landing page will be assigned to any ads or creatives - * that do not have a landing page assigned explicitly. Only one default - * landing page is allowed per campaign. - */ - default: boolean; - /** - * ID of this landing page. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#landingPage". - */ - kind: string; - /** - * Name of this landing page. This is a required field. It must be less than - * 256 characters long, and must be unique among landing pages of the same - * campaign. - */ - name: string; - /** - * URL of this landing page. This is a required field. - */ - url: string; -} -/** - * Landing Page List Response - */ -export interface Schema$LandingPagesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#landingPagesListResponse". - */ - kind: string; - /** - * Landing page collection - */ - landingPages: Schema$LandingPage[]; -} -/** - * Contains information about a language that can be targeted by ads. - */ -export interface Schema$Language { - /** - * Language ID of this language. This is the ID used for targeting and - * generating reports. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#language". - */ - kind: string; - /** - * Format of language code is an ISO 639 two-letter language code optionally - * followed by an underscore followed by an ISO 3166 code. Examples are - * "en" for English or "zh_CN" for Simplified Chinese. - */ - languageCode: string; - /** - * Name of this language. - */ - name: string; -} -/** - * Language List Response - */ -export interface Schema$LanguagesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#languagesListResponse". - */ - kind: string; - /** - * Language collection. - */ - languages: Schema$Language[]; -} -/** - * Language Targeting. - */ -export interface Schema$LanguageTargeting { - /** - * Languages that this ad targets. For each language only languageId is - * required. The other fields are populated automatically when the ad is - * inserted or updated. - */ - languages: Schema$Language[]; -} -/** - * Modification timestamp. - */ -export interface Schema$LastModifiedInfo { - /** - * Timestamp of the last change in milliseconds since epoch. - */ - time: string; -} -/** - * A group clause made up of list population terms representing constraints - * joined by ORs. - */ -export interface Schema$ListPopulationClause { - /** - * Terms of this list population clause. Each clause is made up of list - * population terms representing constraints and are joined by ORs. - */ - terms: Schema$ListPopulationTerm[]; -} -/** - * Remarketing List Population Rule. - */ -export interface Schema$ListPopulationRule { - /** - * Floodlight activity ID associated with this rule. This field can be left - * blank. - */ - floodlightActivityId: string; - /** - * Name of floodlight activity associated with this rule. This is a read-only, - * auto-generated field. - */ - floodlightActivityName: string; - /** - * Clauses that make up this list population rule. Clauses are joined by ANDs, - * and the clauses themselves are made up of list population terms which are - * joined by ORs. - */ - listPopulationClauses: Schema$ListPopulationClause[]; -} -/** - * Remarketing List Population Rule Term. - */ -export interface Schema$ListPopulationTerm { - /** - * Will be true if the term should check if the user is in the list and false - * if the term should check if the user is not in the list. This field is only - * relevant when type is set to LIST_MEMBERSHIP_TERM. False by default. - */ - contains: boolean; - /** - * Whether to negate the comparison result of this term during rule - * evaluation. This field is only relevant when type is left unset or set to - * CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - negation: boolean; - /** - * Comparison operator of this term. This field is only relevant when type is - * left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - operator: string; - /** - * ID of the list in question. This field is only relevant when type is set to - * LIST_MEMBERSHIP_TERM. - */ - remarketingListId: string; - /** - * List population term type determines the applicable fields in this object. - * If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, - * variableFriendlyName, operator, value, and negation are applicable. If set - * to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. - * If set to REFERRER_TERM then operator, value, and negation are applicable. - */ - type: string; - /** - * Literal to compare the variable to. This field is only relevant when type - * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - value: string; - /** - * Friendly name of this term's variable. This is a read-only, - * auto-generated field. This field is only relevant when type is left unset - * or set to CUSTOM_VARIABLE_TERM. - */ - variableFriendlyName: string; - /** - * Name of the variable (U1, U2, etc.) being compared in this term. This field - * is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or - * REFERRER_TERM. - */ - variableName: string; -} -/** - * Remarketing List Targeting Expression. - */ -export interface Schema$ListTargetingExpression { - /** - * Expression describing which lists are being targeted by the ad. - */ - expression: string; -} -/** - * Lookback configuration settings. - */ -export interface Schema$LookbackConfiguration { - /** - * Lookback window, in days, from the last time a given user clicked on one of - * your ads. If you enter 0, clicks will not be considered as triggering - * events for floodlight tracking. If you leave this field blank, the default - * value for your account will be used. Acceptable values are 0 to 90, - * inclusive. - */ - clickDuration: number; - /** - * Lookback window, in days, from the last time a given user viewed one of - * your ads. If you enter 0, impressions will not be considered as triggering - * events for floodlight tracking. If you leave this field blank, the default - * value for your account will be used. Acceptable values are 0 to 90, - * inclusive. - */ - postImpressionActivitiesDuration: number; -} -/** - * Represents a metric. - */ -export interface Schema$Metric { - /** - * The kind of resource this is, in this case dfareporting#metric. - */ - kind: string; - /** - * The metric name, e.g. dfa:impressions - */ - name: string; -} -/** - * Contains information about a metro region that can be targeted by ads. - */ -export interface Schema$Metro { - /** - * Country code of the country to which this metro region belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this metro region belongs. - */ - countryDartId: string; - /** - * DART ID of this metro region. - */ - dartId: string; - /** - * DMA ID of this metro region. This is the ID used for targeting and - * generating reports, and is equivalent to metro_code. - */ - dmaId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#metro". - */ - kind: string; - /** - * Metro code of this metro region. This is equivalent to dma_id. - */ - metroCode: string; - /** - * Name of this metro region. - */ - name: string; -} -/** - * Metro List Response - */ -export interface Schema$MetrosListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#metrosListResponse". - */ - kind: string; - /** - * Metro collection. - */ - metros: Schema$Metro[]; -} -/** - * Contains information about a mobile carrier that can be targeted by ads. - */ -export interface Schema$MobileCarrier { - /** - * Country code of the country to which this mobile carrier belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this mobile carrier belongs. - */ - countryDartId: string; - /** - * ID of this mobile carrier. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#mobileCarrier". - */ - kind: string; - /** - * Name of this mobile carrier. - */ - name: string; -} -/** - * Mobile Carrier List Response - */ -export interface Schema$MobileCarriersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#mobileCarriersListResponse". - */ - kind: string; - /** - * Mobile carrier collection. - */ - mobileCarriers: Schema$MobileCarrier[]; -} -/** - * Object Filter. - */ -export interface Schema$ObjectFilter { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#objectFilter". - */ - kind: string; - /** - * Applicable when status is ASSIGNED. The user has access to objects with - * these object IDs. - */ - objectIds: string[]; - /** - * Status of the filter. NONE means the user has access to none of the - * objects. ALL means the user has access to all objects. ASSIGNED means the - * user has access to the objects with IDs in the objectIds list. - */ - status: string; -} -/** - * Offset Position. - */ -export interface Schema$OffsetPosition { - /** - * Offset distance from left side of an asset or a window. - */ - left: number; - /** - * Offset distance from top side of an asset or a window. - */ - top: number; -} -/** - * Omniture Integration Settings. - */ -export interface Schema$OmnitureSettings { - /** - * Whether placement cost data will be sent to Omniture. This property can be - * enabled only if omnitureIntegrationEnabled is true. - */ - omnitureCostDataEnabled: boolean; - /** - * Whether Omniture integration is enabled. This property can be enabled only - * when the "Advanced Ad Serving" account setting is enabled. - */ - omnitureIntegrationEnabled: boolean; -} -/** - * Contains information about an operating system that can be targeted by ads. - */ -export interface Schema$OperatingSystem { - /** - * DART ID of this operating system. This is the ID used for targeting. - */ - dartId: string; - /** - * Whether this operating system is for desktop. - */ - desktop: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystem". - */ - kind: string; - /** - * Whether this operating system is for mobile. - */ - mobile: boolean; - /** - * Name of this operating system. - */ - name: string; -} -/** - * Operating System List Response - */ -export interface Schema$OperatingSystemsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemsListResponse". - */ - kind: string; - /** - * Operating system collection. - */ - operatingSystems: Schema$OperatingSystem[]; -} -/** - * Contains information about a particular version of an operating system that - * can be targeted by ads. - */ -export interface Schema$OperatingSystemVersion { - /** - * ID of this operating system version. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemVersion". - */ - kind: string; - /** - * Major version (leftmost number) of this operating system version. - */ - majorVersion: string; - /** - * Minor version (number after the first dot) of this operating system - * version. - */ - minorVersion: string; - /** - * Name of this operating system version. - */ - name: string; - /** - * Operating system of this operating system version. - */ - operatingSystem: Schema$OperatingSystem; -} -/** - * Operating System Version List Response - */ -export interface Schema$OperatingSystemVersionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemVersionsListResponse". - */ - kind: string; - /** - * Operating system version collection. - */ - operatingSystemVersions: Schema$OperatingSystemVersion[]; -} -/** - * Creative optimization activity. - */ -export interface Schema$OptimizationActivity { - /** - * Floodlight activity ID of this optimization activity. This is a required - * field. - */ - floodlightActivityId: string; - /** - * Dimension value for the ID of the floodlight activity. This is a read-only, - * auto-generated field. - */ - floodlightActivityIdDimensionValue: Schema$DimensionValue; - /** - * Weight associated with this optimization. The weight assigned will be - * understood in proportion to the weights assigned to the other optimization - * activities. Value must be greater than or equal to 1. - */ - weight: number; -} -/** - * Describes properties of a DoubleClick Planning order. - */ -export interface Schema$Order { - /** - * Account ID of this order. - */ - accountId: string; - /** - * Advertiser ID of this order. - */ - advertiserId: string; - /** - * IDs for users that have to approve documents created for this order. - */ - approverUserProfileIds: string[]; - /** - * Buyer invoice ID associated with this order. - */ - buyerInvoiceId: string; - /** - * Name of the buyer organization. - */ - buyerOrganizationName: string; - /** - * Comments in this order. - */ - comments: string; - /** - * Contacts for this order. - */ - contacts: Schema$OrderContact[]; - /** - * ID of this order. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#order". - */ - kind: string; - /** - * Information about the most recent modification of this order. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this order. - */ - name: string; - /** - * Notes of this order. - */ - notes: string; - /** - * ID of the terms and conditions template used in this order. - */ - planningTermId: string; - /** - * Project ID of this order. - */ - projectId: string; - /** - * Seller order ID associated with this order. - */ - sellerOrderId: string; - /** - * Name of the seller organization. - */ - sellerOrganizationName: string; - /** - * Site IDs this order is associated with. - */ - siteId: string[]; - /** - * Free-form site names this order is associated with. - */ - siteNames: string[]; - /** - * Subaccount ID of this order. - */ - subaccountId: string; - /** - * Terms and conditions of this order. - */ - termsAndConditions: string; -} -/** - * Contact of an order. - */ -export interface Schema$OrderContact { - /** - * Free-form information about this contact. It could be any information - * related to this contact in addition to type, title, name, and signature - * user profile ID. - */ - contactInfo: string; - /** - * Name of this contact. - */ - contactName: string; - /** - * Title of this contact. - */ - contactTitle: string; - /** - * Type of this contact. - */ - contactType: string; - /** - * ID of the user profile containing the signature that will be embedded into - * order documents. - */ - signatureUserProfileId: string; -} -/** - * Contains properties of a DoubleClick Planning order document. - */ -export interface Schema$OrderDocument { - /** - * Account ID of this order document. - */ - accountId: string; - /** - * Advertiser ID of this order document. - */ - advertiserId: string; - /** - * The amended order document ID of this order document. An order document can - * be created by optionally amending another order document so that the change - * history can be preserved. - */ - amendedOrderDocumentId: string; - /** - * IDs of users who have approved this order document. - */ - approvedByUserProfileIds: string[]; - /** - * Whether this order document is cancelled. - */ - cancelled: boolean; - /** - * Information about the creation of this order document. - */ - createdInfo: Schema$LastModifiedInfo; - /** - * Effective date of this order document. - */ - effectiveDate: string; - /** - * ID of this order document. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#orderDocument". - */ - kind: string; - /** - * List of email addresses that received the last sent document. - */ - lastSentRecipients: string[]; - /** - * Timestamp of the last email sent with this order document. - */ - lastSentTime: string; - /** - * ID of the order from which this order document is created. - */ - orderId: string; - /** - * Project ID of this order document. - */ - projectId: string; - /** - * Whether this order document has been signed. - */ - signed: boolean; - /** - * Subaccount ID of this order document. - */ - subaccountId: string; - /** - * Title of this order document. - */ - title: string; - /** - * Type of this order document - */ - type: string; -} -/** - * Order document List Response - */ -export interface Schema$OrderDocumentsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#orderDocumentsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Order document collection - */ - orderDocuments: Schema$OrderDocument[]; -} -/** - * Order List Response - */ -export interface Schema$OrdersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#ordersListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Order collection. - */ - orders: Schema$Order[]; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "PATH_TO_CONVERSION". - */ -export interface Schema$PathToConversionReportCompatibleFields { - /** - * Conversion dimensions which are compatible to be selected in the - * "conversionDimensions" section of the report. - */ - conversionDimensions: Schema$Dimension[]; - /** - * Custom floodlight variables which are compatible to be selected in the - * "customFloodlightVariables" section of the report. - */ - customFloodlightVariables: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#pathToConversionReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Per-interaction dimensions which are compatible to be selected in the - * "perInteractionDimensions" section of the report. - */ - perInteractionDimensions: Schema$Dimension[]; -} -/** - * Contains properties of a placement. - */ -export interface Schema$Placement { - /** - * Account ID of this placement. This field can be left blank. - */ - accountId: string; - /** - * Whether this placement opts out of ad blocking. When true, ad blocking is - * disabled for this placement. When false, the campaign and site settings - * take effect. - */ - adBlockingOptOut: boolean; - /** - * Advertiser ID of this placement. This field can be left blank. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this placement is archived. - */ - archived: boolean; - /** - * Campaign ID of this placement. This field is a required field on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Comments for this placement. - */ - comment: string; - /** - * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to - * rendering on desktop, on mobile devices or in mobile apps for regular or - * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer - * allowed for new placement insertions. Instead, use DISPLAY or - * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream - * video ads developed with the VAST standard. This field is required on - * insertion. - */ - compatibility: string; - /** - * ID of the content category assigned to this placement. - */ - contentCategoryId: string; - /** - * Information about the creation of this placement. This is a read-only - * field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Directory site ID of this placement. On insert, you must set either this - * field or the siteId field to specify the site associated with this - * placement. This is a required field that is read-only after insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * External ID for this placement. - */ - externalId: string; - /** - * ID of this placement. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this placement. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key name of this placement. This is a read-only, auto-generated field. - */ - keyName: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placement". - */ - kind: string; - /** - * Information about the most recent modification of this placement. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Lookback window settings for this placement. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Name of this placement.This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Whether payment was approved for this placement. This is a read-only field - * relevant only to publisher-paid placements. - */ - paymentApproved: boolean; - /** - * Payment source for this placement. This is a required field that is - * read-only after insertion. - */ - paymentSource: string; - /** - * ID of this placement's group, if applicable. - */ - placementGroupId: string; - /** - * Dimension value for the ID of the placement group. This is a read-only, - * auto-generated field. - */ - placementGroupIdDimensionValue: Schema$DimensionValue; - /** - * ID of the placement strategy assigned to this placement. - */ - placementStrategyId: string; - /** - * Pricing schedule of this placement. This field is required on insertion, - * specifically subfields startDate, endDate and pricingType. - */ - pricingSchedule: Schema$PricingSchedule; - /** - * Whether this placement is the primary placement of a roadblock (placement - * group). You cannot change this field from true to false. Setting this field - * to true will automatically set the primary field on the original primary - * placement of the roadblock to false, and it will automatically set the - * roadblock's primaryPlacementId field to the ID of this placement. - */ - primary: boolean; - /** - * Information about the last publisher update. This is a read-only field. - */ - publisherUpdateInfo: Schema$LastModifiedInfo; - /** - * Site ID associated with this placement. On insert, you must set either this - * field or the directorySiteId field to specify the site associated with this - * placement. This is a required field that is read-only after insertion. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Size associated with this placement. When inserting or updating a - * placement, only the size ID field is used. This field is required on - * insertion. - */ - size: Schema$Size; - /** - * Whether creatives assigned to this placement must be SSL-compliant. - */ - sslRequired: boolean; - /** - * Third-party placement status. - */ - status: string; - /** - * Subaccount ID of this placement. This field can be left blank. - */ - subaccountId: string; - /** - * Tag formats to generate for this placement. This field is required on - * insertion. Acceptable values are: - "PLACEMENT_TAG_STANDARD" - - * "PLACEMENT_TAG_IFRAME_JAVASCRIPT" - - * "PLACEMENT_TAG_IFRAME_ILAYER" - - * "PLACEMENT_TAG_INTERNAL_REDIRECT" - - * "PLACEMENT_TAG_JAVASCRIPT" - - * "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" - - * "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" - - * "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" - - * "PLACEMENT_TAG_CLICK_COMMANDS" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" - - * "PLACEMENT_TAG_TRACKING" - - * "PLACEMENT_TAG_TRACKING_IFRAME" - - * "PLACEMENT_TAG_TRACKING_JAVASCRIPT" - */ - tagFormats: string[]; - /** - * Tag settings for this placement. - */ - tagSetting: Schema$TagSetting; - /** - * Whether Verification and ActiveView are disabled for in-stream video - * creatives for this placement. The same setting videoActiveViewOptOut exists - * on the site level -- the opt out occurs if either of these settings are - * true. These settings are distinct from - * DirectorySites.settings.activeViewOptOut or - * Sites.siteSettings.activeViewOptOut which only apply to display ads. - * However, Accounts.activeViewOptOut opts out both video traffic, as well as - * display ads, from Verification and ActiveView. - */ - videoActiveViewOptOut: boolean; - /** - * A collection of settings which affect video creatives served through this - * placement. Applicable to placements with IN_STREAM_VIDEO compatibility. - */ - videoSettings: Schema$VideoSettings; - /** - * VPAID adapter setting for this placement. Controls which VPAID format the - * measurement adapter will use for in-stream video creatives assigned to this - * placement. Note: Flash is no longer supported. This field now defaults to - * HTML5 when the following values are provided: FLASH, BOTH. - */ - vpaidAdapterChoice: string; -} -/** - * Placement Assignment. - */ -export interface Schema$PlacementAssignment { - /** - * Whether this placement assignment is active. When true, the placement will - * be included in the ad's rotation. - */ - active: boolean; - /** - * ID of the placement to be assigned. This is a required field. - */ - placementId: string; - /** - * Dimension value for the ID of the placement. This is a read-only, - * auto-generated field. - */ - placementIdDimensionValue: Schema$DimensionValue; - /** - * Whether the placement to be assigned requires SSL. This is a read-only - * field that is auto-generated when the ad is inserted or updated. - */ - sslRequired: boolean; -} -/** - * Contains properties of a package or roadblock. - */ -export interface Schema$PlacementGroup { - /** - * Account ID of this placement group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this placement group. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this placement group is archived. - */ - archived: boolean; - /** - * Campaign ID of this placement group. This field is required on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * IDs of placements which are assigned to this placement group. This is a - * read-only, auto-generated field. - */ - childPlacementIds: string[]; - /** - * Comments for this placement group. - */ - comment: string; - /** - * ID of the content category assigned to this placement group. - */ - contentCategoryId: string; - /** - * Information about the creation of this placement group. This is a read-only - * field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Directory site ID associated with this placement group. On insert, you must - * set either this field or the site_id field to specify the site associated - * with this placement group. This is a required field that is read-only after - * insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * External ID for this placement. - */ - externalId: string; - /** - * ID of this placement group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this placement group. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementGroup". - */ - kind: string; - /** - * Information about the most recent modification of this placement group. - * This is a read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this placement group. This is a required field and must be less - * than 256 characters long. - */ - name: string; - /** - * Type of this placement group. A package is a simple group of placements - * that acts as a single pricing point for a group of tags. A roadblock is a - * group of placements that not only acts as a single pricing point, but also - * assumes that all the tags in it will be served at the same time. A - * roadblock requires one of its assigned placements to be marked as primary - * for reporting. This field is required on insertion. - */ - placementGroupType: string; - /** - * ID of the placement strategy assigned to this placement group. - */ - placementStrategyId: string; - /** - * Pricing schedule of this placement group. This field is required on - * insertion. - */ - pricingSchedule: Schema$PricingSchedule; - /** - * ID of the primary placement, used to calculate the media cost of a - * roadblock (placement group). Modifying this field will automatically modify - * the primary field on all affected roadblock child placements. - */ - primaryPlacementId: string; - /** - * Dimension value for the ID of the primary placement. This is a read-only, - * auto-generated field. - */ - primaryPlacementIdDimensionValue: Schema$DimensionValue; - /** - * Site ID associated with this placement group. On insert, you must set - * either this field or the directorySiteId field to specify the site - * associated with this placement group. This is a required field that is - * read-only after insertion. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Subaccount ID of this placement group. This is a read-only field that can - * be left blank. - */ - subaccountId: string; -} -/** - * Placement Group List Response - */ -export interface Schema$PlacementGroupsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement group collection. - */ - placementGroups: Schema$PlacementGroup[]; -} -/** - * Placement GenerateTags Response - */ -export interface Schema$PlacementsGenerateTagsResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementsGenerateTagsResponse". - */ - kind: string; - /** - * Set of generated tags for the specified placements. - */ - placementTags: Schema$PlacementTag[]; -} -/** - * Placement List Response - */ -export interface Schema$PlacementsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement collection. - */ - placements: Schema$Placement[]; -} -/** - * Placement Strategy List Response - */ -export interface Schema$PlacementStrategiesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementStrategiesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement strategy collection. - */ - placementStrategies: Schema$PlacementStrategy[]; -} -/** - * Contains properties of a placement strategy. - */ -export interface Schema$PlacementStrategy { - /** - * Account ID of this placement strategy.This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this placement strategy. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementStrategy". - */ - kind: string; - /** - * Name of this placement strategy. This is a required field. It must be less - * than 256 characters long and unique among placement strategies of the same - * account. - */ - name: string; -} -/** - * Placement Tag - */ -export interface Schema$PlacementTag { - /** - * Placement ID - */ - placementId: string; - /** - * Tags generated for this placement. - */ - tagDatas: Schema$TagData[]; -} -/** - * Contains information about a platform type that can be targeted by ads. - */ -export interface Schema$PlatformType { - /** - * ID of this platform type. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#platformType". - */ - kind: string; - /** - * Name of this platform type. - */ - name: string; -} -/** - * Platform Type List Response - */ -export interface Schema$PlatformTypesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#platformTypesListResponse". - */ - kind: string; - /** - * Platform type collection. - */ - platformTypes: Schema$PlatformType[]; -} -/** - * Popup Window Properties. - */ -export interface Schema$PopupWindowProperties { - /** - * Popup dimension for a creative. This is a read-only field. Applicable to - * the following creative types: all RICH_MEDIA and all VPAID - */ - dimension: Schema$Size; - /** - * Upper-left corner coordinates of the popup window. Applicable if - * positionType is COORDINATES. - */ - offset: Schema$OffsetPosition; - /** - * Popup window position either centered or at specific coordinate. - */ - positionType: string; - /** - * Whether to display the browser address bar. - */ - showAddressBar: boolean; - /** - * Whether to display the browser menu bar. - */ - showMenuBar: boolean; - /** - * Whether to display the browser scroll bar. - */ - showScrollBar: boolean; - /** - * Whether to display the browser status bar. - */ - showStatusBar: boolean; - /** - * Whether to display the browser tool bar. - */ - showToolBar: boolean; - /** - * Title of popup window. - */ - title: string; -} -/** - * Contains information about a postal code that can be targeted by ads. - */ -export interface Schema$PostalCode { - /** - * Postal code. This is equivalent to the id field. - */ - code: string; - /** - * Country code of the country to which this postal code belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this postal code belongs. - */ - countryDartId: string; - /** - * ID of this postal code. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#postalCode". - */ - kind: string; -} -/** - * Postal Code List Response - */ -export interface Schema$PostalCodesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#postalCodesListResponse". - */ - kind: string; - /** - * Postal code collection. - */ - postalCodes: Schema$PostalCode[]; -} -/** - * Pricing Information - */ -export interface Schema$Pricing { - /** - * Cap cost type of this inventory item. - */ - capCostType: string; - /** - * End date of this inventory item. - */ - endDate: string; - /** - * Flights of this inventory item. A flight (a.k.a. pricing period) represents - * the inventory item pricing information for a specific period of time. - */ - flights: Schema$Flight[]; - /** - * Group type of this inventory item if it represents a placement group. Is - * null otherwise. There are two type of placement groups: - * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items - * that acts as a single pricing point for a group of tags. - * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that - * not only acts as a single pricing point, but also assumes that all the tags - * in it will be served at the same time. A roadblock requires one of its - * assigned inventory items to be marked as primary. - */ - groupType: string; - /** - * Pricing type of this inventory item. - */ - pricingType: string; - /** - * Start date of this inventory item. - */ - startDate: string; -} -/** - * Pricing Schedule - */ -export interface Schema$PricingSchedule { - /** - * Placement cap cost option. - */ - capCostOption: string; - /** - * Whether cap costs are ignored by ad serving. - */ - disregardOverdelivery: boolean; - /** - * Placement end date. This date must be later than, or the same day as, the - * placement start date, but not later than the campaign end date. If, for - * example, you set 6/25/2015 as both the start and end dates, the effective - * placement date is just that day only, 6/25/2015. The hours, minutes, and - * seconds of the end date should not be set, as doing so will result in an - * error. This field is required on insertion. - */ - endDate: string; - /** - * Whether this placement is flighted. If true, pricing periods will be - * computed automatically. - */ - flighted: boolean; - /** - * Floodlight activity ID associated with this placement. This field should be - * set when placement pricing type is set to PRICING_TYPE_CPA. - */ - floodlightActivityId: string; - /** - * Pricing periods for this placement. - */ - pricingPeriods: Schema$PricingSchedulePricingPeriod[]; - /** - * Placement pricing type. This field is required on insertion. - */ - pricingType: string; - /** - * Placement start date. This date must be later than, or the same day as, the - * campaign start date. The hours, minutes, and seconds of the start date - * should not be set, as doing so will result in an error. This field is - * required on insertion. - */ - startDate: string; - /** - * Testing start date of this placement. The hours, minutes, and seconds of - * the start date should not be set, as doing so will result in an error. - */ - testingStartDate: string; -} -/** - * Pricing Period - */ -export interface Schema$PricingSchedulePricingPeriod { - /** - * Pricing period end date. This date must be later than, or the same day as, - * the pricing period start date, but not later than the placement end date. - * The period end date can be the same date as the period start date. If, for - * example, you set 6/25/2015 as both the start and end dates, the effective - * pricing period date is just that day only, 6/25/2015. The hours, minutes, - * and seconds of the end date should not be set, as doing so will result in - * an error. - */ - endDate: string; - /** - * Comments for this pricing period. - */ - pricingComment: string; - /** - * Rate or cost of this pricing period in nanos (i.e., multipled by - * 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. - */ - rateOrCostNanos: string; - /** - * Pricing period start date. This date must be later than, or the same day - * as, the placement start date. The hours, minutes, and seconds of the start - * date should not be set, as doing so will result in an error. - */ - startDate: string; - /** - * Units of this pricing period. Acceptable values are 0 to 10000000000, - * inclusive. - */ - units: string; -} -/** - * Contains properties of a DoubleClick Planning project. - */ -export interface Schema$Project { - /** - * Account ID of this project. - */ - accountId: string; - /** - * Advertiser ID of this project. - */ - advertiserId: string; - /** - * Audience age group of this project. - */ - audienceAgeGroup: string; - /** - * Audience gender of this project. - */ - audienceGender: string; - /** - * Budget of this project in the currency specified by the current account. - * The value stored in this field represents only the non-fractional amount. - * For example, for USD, the smallest value that can be represented by this - * field is 1 US dollar. - */ - budget: string; - /** - * Client billing code of this project. - */ - clientBillingCode: string; - /** - * Name of the project client. - */ - clientName: string; - /** - * End date of the project. - */ - endDate: string; - /** - * ID of this project. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#project". - */ - kind: string; - /** - * Information about the most recent modification of this project. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this project. - */ - name: string; - /** - * Overview of this project. - */ - overview: string; - /** - * Start date of the project. - */ - startDate: string; - /** - * Subaccount ID of this project. - */ - subaccountId: string; - /** - * Number of clicks that the advertiser is targeting. - */ - targetClicks: string; - /** - * Number of conversions that the advertiser is targeting. - */ - targetConversions: string; - /** - * CPA that the advertiser is targeting. - */ - targetCpaNanos: string; - /** - * CPC that the advertiser is targeting. - */ - targetCpcNanos: string; - /** - * vCPM from Active View that the advertiser is targeting. - */ - targetCpmActiveViewNanos: string; - /** - * CPM that the advertiser is targeting. - */ - targetCpmNanos: string; - /** - * Number of impressions that the advertiser is targeting. - */ - targetImpressions: string; -} -/** - * Project List Response - */ -export interface Schema$ProjectsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#projectsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Project collection. - */ - projects: Schema$Project[]; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "REACH". - */ -export interface Schema$ReachReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#reachReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected as activity metrics to pivot on - * in the "activities" section of the report. - */ - pivotedActivityMetrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected in the - * "reachByFrequencyMetricNames" section of the report. - */ - reachByFrequencyMetrics: Schema$Metric[]; -} -/** - * Represents a recipient. - */ -export interface Schema$Recipient { - /** - * The delivery type for the recipient. - */ - deliveryType: string; - /** - * The email address of the recipient. - */ - email: string; - /** - * The kind of resource this is, in this case dfareporting#recipient. - */ - kind: string; -} -/** - * Contains information about a region that can be targeted by ads. - */ -export interface Schema$Region { - /** - * Country code of the country to which this region belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this region belongs. - */ - countryDartId: string; - /** - * DART ID of this region. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#region". - */ - kind: string; - /** - * Name of this region. - */ - name: string; - /** - * Region code. - */ - regionCode: string; -} -/** - * Region List Response - */ -export interface Schema$RegionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#regionsListResponse". - */ - kind: string; - /** - * Region collection. - */ - regions: Schema$Region[]; -} -/** - * Contains properties of a remarketing list. Remarketing enables you to create - * lists of users who have performed specific actions on a site, then target ads - * to members of those lists. This resource can be used to manage remarketing - * lists that are owned by your advertisers. To see all remarketing lists that - * are visible to your advertisers, including those that are shared to your - * advertiser or account, use the TargetableRemarketingLists resource. - */ -export interface Schema$RemarketingList { - /** - * Account ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - accountId: string; - /** - * Whether this remarketing list is active. - */ - active: boolean; - /** - * Dimension value for the advertiser ID that owns this remarketing list. This - * is a required field. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Remarketing list description. - */ - description: string; - /** - * Remarketing list ID. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingList". - */ - kind: string; - /** - * Number of days that a user should remain in the remarketing list without an - * impression. Acceptable values are 1 to 540, inclusive. - */ - lifeSpan: string; - /** - * Rule used to populate the remarketing list with users. - */ - listPopulationRule: Schema$ListPopulationRule; - /** - * Number of users currently in the list. This is a read-only field. - */ - listSize: string; - /** - * Product from which this remarketing list was originated. - */ - listSource: string; - /** - * Name of the remarketing list. This is a required field. Must be no greater - * than 128 characters long. - */ - name: string; - /** - * Subaccount ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - subaccountId: string; -} -/** - * Contains properties of a remarketing list's sharing information. Sharing - * allows other accounts or advertisers to target to your remarketing lists. - * This resource can be used to manage remarketing list sharing to other - * accounts and advertisers. - */ -export interface Schema$RemarketingListShare { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingListShare". - */ - kind: string; - /** - * Remarketing list ID. This is a read-only, auto-generated field. - */ - remarketingListId: string; - /** - * Accounts that the remarketing list is shared with. - */ - sharedAccountIds: string[]; - /** - * Advertisers that the remarketing list is shared with. - */ - sharedAdvertiserIds: string[]; -} -/** - * Remarketing list response - */ -export interface Schema$RemarketingListsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingListsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Remarketing list collection. - */ - remarketingLists: Schema$RemarketingList[]; -} -/** - * Represents a Report resource. - */ -export interface Schema$Report { - /** - * The account ID to which this report belongs. - */ - accountId: string; - /** - * The report criteria for a report of type "STANDARD". - */ - criteria: any; - /** - * The report criteria for a report of type "CROSS_DIMENSION_REACH". - */ - crossDimensionReachCriteria: any; - /** - * The report's email delivery settings. - */ - delivery: any; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The filename used when generating report files for this report. - */ - fileName: string; - /** - * The report criteria for a report of type "FLOODLIGHT". - */ - floodlightCriteria: any; - /** - * The output format of the report. If not specified, default format is - * "CSV". Note that the actual format in the completed report file - * might differ if for instance the report's size exceeds the format's - * capabilities. "CSV" will then be the fallback format. - */ - format: string; - /** - * The unique ID identifying this report resource. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#report. - */ - kind: string; - /** - * The timestamp (in milliseconds since epoch) of when this report was last - * modified. - */ - lastModifiedTime: string; - /** - * The name of the report. - */ - name: string; - /** - * The user profile id of the owner of this report. - */ - ownerProfileId: string; - /** - * The report criteria for a report of type "PATH_TO_CONVERSION". - */ - pathToConversionCriteria: any; - /** - * The report criteria for a report of type "REACH". - */ - reachCriteria: any; - /** - * The report's schedule. Can only be set if the report's - * 'dateRange' is a relative date range and the relative date range is - * not "TODAY". - */ - schedule: any; - /** - * The subaccount ID to which this report belongs if applicable. - */ - subAccountId: string; - /** - * The type of the report. - */ - type: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "STANDARD". - */ -export interface Schema$ReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#reportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected as activity metrics to pivot on - * in the "activities" section of the report. - */ - pivotedActivityMetrics: Schema$Metric[]; -} -/** - * Represents the list of reports. - */ -export interface Schema$ReportList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The reports returned in this response. - */ - items: Schema$Report[]; - /** - * The kind of list this is, in this case dfareporting#reportList. - */ - kind: string; - /** - * Continuation token used to page through reports. To retrieve the next page - * of results, set the next request's "pageToken" to the value - * of this field. The page token is only valid for a limited amount of time - * and should not be persisted. - */ - nextPageToken: string; -} -/** - * Reporting Configuration - */ -export interface Schema$ReportsConfiguration { - /** - * Whether the exposure to conversion report is enabled. This report shows - * detailed pathway information on up to 10 of the most recent ad exposures - * seen by a user before converting. - */ - exposureToConversionEnabled: boolean; - /** - * Default lookback windows for new advertisers in this account. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Report generation time zone ID of this account. This is a required field - * that can only be changed by a superuser. Acceptable values are: - - * "1" for "America/New_York" - "2" for - * "Europe/London" - "3" for "Europe/Paris" - - * "4" for "Africa/Johannesburg" - "5" for - * "Asia/Jerusalem" - "6" for "Asia/Shanghai" - * - "7" for "Asia/Hong_Kong" - "8" for - * "Asia/Tokyo" - "9" for "Australia/Sydney" - - * "10" for "Asia/Dubai" - "11" for - * "America/Los_Angeles" - "12" for - * "Pacific/Auckland" - "13" for - * "America/Sao_Paulo" - */ - reportGenerationTimeZoneId: string; -} -/** - * Rich Media Exit Override. - */ -export interface Schema$RichMediaExitOverride { - /** - * Click-through URL of this rich media exit override. Applicable if the - * enabled field is set to true. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Whether to use the clickThroughUrl. If false, the creative-level exit will - * be used. - */ - enabled: boolean; - /** - * ID for the override to refer to a specific exit in the creative. - */ - exitId: string; -} -/** - * A rule associates an asset with a targeting template for asset-level - * targeting. Applicable to INSTREAM_VIDEO creatives. - */ -export interface Schema$Rule { - /** - * A creativeAssets[].id. This should refer to one of the parent assets in - * this creative. This is a required field. - */ - assetId: string; - /** - * A user-friendly name for this rule. This is a required field. - */ - name: string; - /** - * A targeting template ID. The targeting from the targeting template will be - * used to determine whether this asset should be served. This is a required - * field. - */ - targetingTemplateId: string; -} -/** - * Contains properties of a site. - */ -export interface Schema$Site { - /** - * Account ID of this site. This is a read-only field that can be left blank. - */ - accountId: string; - /** - * Whether this site is approved. - */ - approved: boolean; - /** - * Directory site associated with this site. This is a required field that is - * read-only after insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * ID of this site. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this site. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key name of this site. This is a read-only, auto-generated field. - */ - keyName: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#site". - */ - kind: string; - /** - * Name of this site.This is a required field. Must be less than 128 - * characters long. If this site is under a subaccount, the name must be - * unique among sites of the same subaccount. Otherwise, this site is a - * top-level site, and the name must be unique among top-level sites of the - * same account. - */ - name: string; - /** - * Site contacts. - */ - siteContacts: Schema$SiteContact[]; - /** - * Site-wide settings. - */ - siteSettings: Schema$SiteSettings; - /** - * Subaccount ID of this site. This is a read-only field that can be left - * blank. - */ - subaccountId: string; -} -/** - * Site Contact - */ -export interface Schema$SiteContact { - /** - * Address of this site contact. - */ - address: string; - /** - * Site contact type. - */ - contactType: string; - /** - * Email address of this site contact. This is a required field. - */ - email: string; - /** - * First name of this site contact. - */ - firstName: string; - /** - * ID of this site contact. This is a read-only, auto-generated field. - */ - id: string; - /** - * Last name of this site contact. - */ - lastName: string; - /** - * Primary phone number of this site contact. - */ - phone: string; - /** - * Title or designation of this site contact. - */ - title: string; -} -/** - * Site Settings - */ -export interface Schema$SiteSettings { - /** - * Whether active view creatives are disabled for this site. - */ - activeViewOptOut: boolean; - /** - * Whether this site opts out of ad blocking. When true, ad blocking is - * disabled for all placements under the site, regardless of the individual - * placement settings. When false, the campaign and placement settings take - * effect. - */ - adBlockingOptOut: boolean; - /** - * Site-wide creative settings. - */ - creativeSettings: Schema$CreativeSettings; - /** - * Whether new cookies are disabled for this site. - */ - disableNewCookie: boolean; - /** - * Lookback window settings for this site. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Configuration settings for dynamic and image floodlight tags. - */ - tagSetting: Schema$TagSetting; - /** - * Whether Verification and ActiveView for in-stream video creatives are - * disabled by default for new placements created under this site. This value - * will be used to populate the placement.videoActiveViewOptOut field, when no - * value is specified for the new placement. - */ - videoActiveViewOptOutTemplate: boolean; - /** - * Default VPAID adapter setting for new placements created under this site. - * This value will be used to populate the placements.vpaidAdapterChoice - * field, when no value is specified for the new placement. Controls which - * VPAID format the measurement adapter will use for in-stream video creatives - * assigned to the placement. The publisher's specifications will - * typically determine this setting. For VPAID creatives, the adapter format - * will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter). - * Note: Flash is no longer supported. This field now defaults to HTML5 when - * the following values are provided: FLASH, BOTH. - */ - vpaidAdapterChoiceTemplate: string; -} -/** - * Site List Response - */ -export interface Schema$SitesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#sitesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Site collection. - */ - sites: Schema$Site[]; -} -/** - * Represents the dimensions of ads, placements, creatives, or creative assets. - */ -export interface Schema$Size { - /** - * Height of this size. Acceptable values are 0 to 32767, inclusive. - */ - height: number; - /** - * IAB standard size. This is a read-only, auto-generated field. - */ - iab: boolean; - /** - * ID of this size. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#size". - */ - kind: string; - /** - * Width of this size. Acceptable values are 0 to 32767, inclusive. - */ - width: number; -} -/** - * Size List Response - */ -export interface Schema$SizesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#sizesListResponse". - */ - kind: string; - /** - * Size collection. - */ - sizes: Schema$Size[]; -} -/** - * Skippable Settings - */ -export interface Schema$SkippableSetting { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#skippableSetting". - */ - kind: string; - /** - * Amount of time to play videos served to this placement before counting a - * view. Applicable when skippable is true. - */ - progressOffset: Schema$VideoOffset; - /** - * Amount of time to play videos served to this placement before the skip - * button should appear. Applicable when skippable is true. - */ - skipOffset: Schema$VideoOffset; - /** - * Whether the user can skip creatives served to this placement. - */ - skippable: boolean; -} -/** - * Represents a sorted dimension. - */ -export interface Schema$SortedDimension { - /** - * The kind of resource this is, in this case dfareporting#sortedDimension. - */ - kind: string; - /** - * The name of the dimension. - */ - name: string; - /** - * An optional sort order for the dimension column. - */ - sortOrder: string; -} -/** - * Contains properties of a DCM subaccount. - */ -export interface Schema$Subaccount { - /** - * ID of the account that contains this subaccount. This is a read-only field - * that can be left blank. - */ - accountId: string; - /** - * IDs of the available user role permissions for this subaccount. - */ - availablePermissionIds: string[]; - /** - * ID of this subaccount. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#subaccount". - */ - kind: string; - /** - * Name of this subaccount. This is a required field. Must be less than 128 - * characters long and be unique among subaccounts of the same account. - */ - name: string; -} -/** - * Subaccount List Response - */ -export interface Schema$SubaccountsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#subaccountsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Subaccount collection. - */ - subaccounts: Schema$Subaccount[]; -} -/** - * Placement Tag Data - */ -export interface Schema$TagData { - /** - * Ad associated with this placement tag. Applicable only when format is - * PLACEMENT_TAG_TRACKING. - */ - adId: string; - /** - * Tag string to record a click. - */ - clickTag: string; - /** - * Creative associated with this placement tag. Applicable only when format is - * PLACEMENT_TAG_TRACKING. - */ - creativeId: string; - /** - * TagData tag format of this tag. - */ - format: string; - /** - * Tag string for serving an ad. - */ - impressionTag: string; -} -/** - * Tag Settings - */ -export interface Schema$TagSetting { - /** - * Additional key-values to be included in tags. Each key-value pair must be - * of the form key=value, and pairs must be separated by a semicolon (;). Keys - * and values must not contain commas. For example, id=2;color=red is a valid - * value for this field. - */ - additionalKeyValues: string; - /** - * Whether static landing page URLs should be included in the tags. This - * setting applies only to placements. - */ - includeClickThroughUrls: boolean; - /** - * Whether click-tracking string should be included in the tags. - */ - includeClickTracking: boolean; - /** - * Option specifying how keywords are embedded in ad tags. This setting can be - * used to specify whether keyword placeholders are inserted in placement tags - * for this site. Publishers can then add keywords to those placeholders. - */ - keywordOption: string; -} -/** - * Dynamic and Image Tag Settings. - */ -export interface Schema$TagSettings { - /** - * Whether dynamic floodlight tags are enabled. - */ - dynamicTagEnabled: boolean; - /** - * Whether image tags are enabled. - */ - imageTagEnabled: boolean; -} -/** - * Contains properties of a targetable remarketing list. Remarketing enables you - * to create lists of users who have performed specific actions on a site, then - * target ads to members of those lists. This resource is a read-only view of a - * remarketing list to be used to faciliate targeting ads to specific lists. - * Remarketing lists that are owned by your advertisers and those that are - * shared to your advertisers or account are accessible via this resource. To - * manage remarketing lists that are owned by your advertisers, use the - * RemarketingLists resource. - */ -export interface Schema$TargetableRemarketingList { - /** - * Account ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - accountId: string; - /** - * Whether this targetable remarketing list is active. - */ - active: boolean; - /** - * Dimension value for the advertiser ID that owns this targetable remarketing - * list. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Targetable remarketing list description. - */ - description: string; - /** - * Targetable remarketing list ID. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetableRemarketingList". - */ - kind: string; - /** - * Number of days that a user should remain in the targetable remarketing list - * without an impression. - */ - lifeSpan: string; - /** - * Number of users currently in the list. This is a read-only field. - */ - listSize: string; - /** - * Product from which this targetable remarketing list was originated. - */ - listSource: string; - /** - * Name of the targetable remarketing list. Is no greater than 128 characters - * long. - */ - name: string; - /** - * Subaccount ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - subaccountId: string; -} -/** - * Targetable remarketing list response - */ -export interface Schema$TargetableRemarketingListsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetableRemarketingListsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Targetable remarketing list collection. - */ - targetableRemarketingLists: Schema$TargetableRemarketingList[]; -} -/** - * Contains properties of a targeting template. A targeting template - * encapsulates targeting information which can be reused across multiple ads. - */ -export interface Schema$TargetingTemplate { - /** - * Account ID of this targeting template. This field, if left unset, will be - * auto-generated on insert and is read-only after insert. - */ - accountId: string; - /** - * Advertiser ID of this targeting template. This is a required field on - * insert and is read-only after insert. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Time and day targeting criteria. - */ - dayPartTargeting: Schema$DayPartTargeting; - /** - * Geographical targeting criteria. - */ - geoTargeting: Schema$GeoTargeting; - /** - * ID of this targeting template. This is a read-only, auto-generated field. - */ - id: string; - /** - * Key-value targeting criteria. - */ - keyValueTargetingExpression: Schema$KeyValueTargetingExpression; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetingTemplate". - */ - kind: string; - /** - * Language targeting criteria. - */ - languageTargeting: Schema$LanguageTargeting; - /** - * Remarketing list targeting criteria. - */ - listTargetingExpression: Schema$ListTargetingExpression; - /** - * Name of this targeting template. This field is required. It must be less - * than 256 characters long and unique within an advertiser. - */ - name: string; - /** - * Subaccount ID of this targeting template. This field, if left unset, will - * be auto-generated on insert and is read-only after insert. - */ - subaccountId: string; - /** - * Technology platform targeting criteria. - */ - technologyTargeting: Schema$TechnologyTargeting; -} -/** - * Targeting Template List Response - */ -export interface Schema$TargetingTemplatesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetingTemplatesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Targeting template collection. - */ - targetingTemplates: Schema$TargetingTemplate[]; -} -/** - * Target Window. - */ -export interface Schema$TargetWindow { - /** - * User-entered value. - */ - customHtml: string; - /** - * Type of browser window for which the backup image of the flash creative can - * be displayed. - */ - targetWindowOption: string; -} -/** - * Technology Targeting. - */ -export interface Schema$TechnologyTargeting { - /** - * Browsers that this ad targets. For each browser either set browserVersionId - * or dartId along with the version numbers. If both are specified, only - * browserVersionId will be used. The other fields are populated automatically - * when the ad is inserted or updated. - */ - browsers: Schema$Browser[]; - /** - * Connection types that this ad targets. For each connection type only id is - * required. The other fields are populated automatically when the ad is - * inserted or updated. - */ - connectionTypes: Schema$ConnectionType[]; - /** - * Mobile carriers that this ad targets. For each mobile carrier only id is - * required, and the other fields are populated automatically when the ad is - * inserted or updated. If targeting a mobile carrier, do not set targeting - * for any zip codes. - */ - mobileCarriers: Schema$MobileCarrier[]; - /** - * Operating systems that this ad targets. To target specific versions, use - * operatingSystemVersions. For each operating system only dartId is required. - * The other fields are populated automatically when the ad is inserted or - * updated. If targeting an operating system, do not set targeting for - * operating system versions for the same operating system. - */ - operatingSystems: Schema$OperatingSystem[]; - /** - * Operating system versions that this ad targets. To target all versions, use - * operatingSystems. For each operating system version, only id is required. - * The other fields are populated automatically when the ad is inserted or - * updated. If targeting an operating system version, do not set targeting for - * the corresponding operating system in operatingSystems. - */ - operatingSystemVersions: Schema$OperatingSystemVersion[]; - /** - * Platform types that this ad targets. For example, desktop, mobile, or - * tablet. For each platform type, only id is required, and the other fields - * are populated automatically when the ad is inserted or updated. - */ - platformTypes: Schema$PlatformType[]; -} -/** - * Third Party Authentication Token - */ -export interface Schema$ThirdPartyAuthenticationToken { - /** - * Name of the third-party authentication token. - */ - name: string; - /** - * Value of the third-party authentication token. This is a read-only, - * auto-generated field. - */ - value: string; -} -/** - * Third-party Tracking URL. - */ -export interface Schema$ThirdPartyTrackingUrl { - /** - * Third-party URL type for in-stream video creatives. - */ - thirdPartyUrlType: string; - /** - * URL for the specified third-party URL type. - */ - url: string; -} -/** - * Transcode Settings - */ -export interface Schema$TranscodeSetting { - /** - * Whitelist of video formats to be served to this placement. Set this list to - * null or empty to serve all video formats. - */ - enabledVideoFormats: number[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#transcodeSetting". - */ - kind: string; -} -/** - * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following - * creative types: INSTREAM_VIDEO and VPAID. - */ -export interface Schema$UniversalAdId { - /** - * Registry used for the Ad ID value. - */ - registry: string; - /** - * ID value for this creative. Only alphanumeric characters and the following - * symbols are valid: "_/\-". Maximum length is 64 characters. Read - * only when registry is DCM. - */ - value: string; -} -/** - * User Defined Variable configuration. - */ -export interface Schema$UserDefinedVariableConfiguration { - /** - * Data type for the variable. This is a required field. - */ - dataType: string; - /** - * User-friendly name for the variable which will appear in reports. This is a - * required field, must be less than 64 characters long, and cannot contain - * the following characters: ""<>". - */ - reportName: string; - /** - * Variable name in the tag. This is a required field. - */ - variableType: string; -} -/** - * Represents a UserProfile resource. - */ -export interface Schema$UserProfile { - /** - * The account ID to which this profile belongs. - */ - accountId: string; - /** - * The account name this profile belongs to. - */ - accountName: string; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The kind of resource this is, in this case dfareporting#userProfile. - */ - kind: string; - /** - * The unique ID of the user profile. - */ - profileId: string; - /** - * The sub account ID this profile belongs to if applicable. - */ - subAccountId: string; - /** - * The sub account name this profile belongs to if applicable. - */ - subAccountName: string; - /** - * The user name. - */ - userName: string; -} -/** - * Represents the list of user profiles. - */ -export interface Schema$UserProfileList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The user profiles returned in this response. - */ - items: Schema$UserProfile[]; - /** - * The kind of list this is, in this case dfareporting#userProfileList. - */ - kind: string; -} -/** - * Contains properties of auser role, which is used to manage user access. - */ -export interface Schema$UserRole { - /** - * Account ID of this user role. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Whether this is a default user role. Default user roles are created by the - * system for the account/subaccount and cannot be modified or deleted. Each - * default user role comes with a basic set of preassigned permissions. - */ - defaultUserRole: boolean; - /** - * ID of this user role. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRole". - */ - kind: string; - /** - * Name of this user role. This is a required field. Must be less than 256 - * characters long. If this user role is under a subaccount, the name must be - * unique among sites of the same subaccount. Otherwise, this user role is a - * top-level user role, and the name must be unique among top-level user roles - * of the same account. - */ - name: string; - /** - * ID of the user role that this user role is based on or copied from. This is - * a required field. - */ - parentUserRoleId: string; - /** - * List of permissions associated with this user role. - */ - permissions: Schema$UserRolePermission[]; - /** - * Subaccount ID of this user role. This is a read-only field that can be left - * blank. - */ - subaccountId: string; -} -/** - * Contains properties of a user role permission. - */ -export interface Schema$UserRolePermission { - /** - * Levels of availability for a user role permission. - */ - availability: string; - /** - * ID of this user role permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermission". - */ - kind: string; - /** - * Name of this user role permission. - */ - name: string; - /** - * ID of the permission group that this user role permission belongs to. - */ - permissionGroupId: string; -} -/** - * Represents a grouping of related user role permissions. - */ -export interface Schema$UserRolePermissionGroup { - /** - * ID of this user role permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionGroup". - */ - kind: string; - /** - * Name of this user role permission group. - */ - name: string; -} -/** - * User Role Permission Group List Response - */ -export interface Schema$UserRolePermissionGroupsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionGroupsListResponse". - */ - kind: string; - /** - * User role permission group collection. - */ - userRolePermissionGroups: Schema$UserRolePermissionGroup[]; -} -/** - * User Role Permission List Response - */ -export interface Schema$UserRolePermissionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionsListResponse". - */ - kind: string; - /** - * User role permission collection. - */ - userRolePermissions: Schema$UserRolePermission[]; -} -/** - * User Role List Response - */ -export interface Schema$UserRolesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * User role collection. - */ - userRoles: Schema$UserRole[]; -} -/** - * Contains information about supported video formats. - */ -export interface Schema$VideoFormat { - /** - * File type of the video format. - */ - fileType: string; - /** - * ID of the video format. - */ - id: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoFormat". - */ - kind: string; - /** - * The resolution of this video format. - */ - resolution: Schema$Size; - /** - * The target bit rate of this video format. - */ - targetBitRate: number; -} -/** - * Video Format List Response - */ -export interface Schema$VideoFormatsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoFormatsListResponse". - */ - kind: string; - /** - * Video format collection. - */ - videoFormats: Schema$VideoFormat[]; -} -/** - * Video Offset - */ -export interface Schema$VideoOffset { - /** - * Duration, as a percentage of video duration. Do not set when offsetSeconds - * is set. Acceptable values are 0 to 100, inclusive. - */ - offsetPercentage: number; - /** - * Duration, in seconds. Do not set when offsetPercentage is set. Acceptable - * values are 0 to 86399, inclusive. - */ - offsetSeconds: number; -} -/** - * Video Settings - */ -export interface Schema$VideoSettings { - /** - * Settings for the companion creatives of video creatives served to this - * placement. - */ - companionSettings: Schema$CompanionSetting; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoSettings". - */ - kind: string; - /** - * Settings for the skippability of video creatives served to this placement. - * If this object is provided, the creative-level skippable settings will be - * overridden. - */ - skippableSettings: Schema$SkippableSetting; - /** - * Settings for the transcodes of video creatives served to this placement. If - * this object is provided, the creative-level transcode settings will be - * overridden. - */ - transcodeSettings: Schema$TranscodeSetting; -} - -export class Resource$Accountactiveadsummaries { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountActiveAdSummaries.get - * @desc Gets the account's active ad summary by account ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Account ID. - * summaryAccountId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountActiveAdSummaries.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountActiveAdSummaries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.summaryAccountId Account ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'summaryAccountId'], - pathParams: ['profileId', 'summaryAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accountpermissiongroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountPermissionGroups.get - * @desc Gets one account permission group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Account permission group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountPermissionGroups.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountPermissionGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account permission group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissionGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountPermissionGroups.list - * @desc Retrieves the list of account permission groups. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountPermissionGroups.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountPermissionGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissionGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Accountpermissions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountPermissions.get - * @desc Gets one account permission by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Account permission ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountPermissions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountPermissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account permission ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountPermissions.list - * @desc Retrieves the list of account permissions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountPermissions.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountPermissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Accounts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accounts.get - * @desc Gets one account by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Account ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.list - * @desc Retrieves the list of accounts, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var accountsPage = response['accounts']; - * if (!accountsPage) { - * return; - * } - * for (var i = 0; i < accountsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `accountsPage`: console.log(JSON.stringify(accountsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.accounts.list(request, handlePage); - * } - * }; - * - * dfareporting.accounts.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active accounts. Don't set this field to select both active and non-active accounts. - * @param {string=} params.ids Select only accounts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.patch - * @desc Updates an existing account. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Account ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.accounts.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.update - * @desc Updates an existing account. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.accounts.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accountuserprofiles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountUserProfiles.get - * @desc Gets one account user profile by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User profile ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.accountUserProfiles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountUserProfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User profile ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.insert - * @desc Inserts a new account user profile. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.accountUserProfiles.insert(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountUserProfiles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.list - * @desc Retrieves a list of account user profiles, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var accountUserProfilesPage = response['accountUserProfiles']; - * if (!accountUserProfilesPage) { - * return; - * } - * for (var i = 0; i < accountUserProfilesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `accountUserProfilesPage`: - * console.log(JSON.stringify(accountUserProfilesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.accountUserProfiles.list(request, handlePage); - * } - * }; - * - * dfareporting.accountUserProfiles.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountUserProfiles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active user profiles. - * @param {string=} params.ids Select only user profiles with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only user profiles with the specified subaccount ID. - * @param {string=} params.userRoleId Select only user profiles with the specified user role ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.patch - * @desc Updates an existing account user profile. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User profile ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.accountUserProfiles.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountUserProfiles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User profile ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.update - * @desc Updates an existing account user profile. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.accountUserProfiles.update(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.accountUserProfiles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Ads { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.ads.get - * @desc Gets one ad by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Ad ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.ads.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.ads.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Ad ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/ads/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.insert - * @desc Inserts a new ad. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.ads.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.ads.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.list - * @desc Retrieves a list of ads, possibly filtered. This method supports - * paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var adsPage = response['ads']; - * if (!adsPage) { - * return; - * } - * for (var i = 0; i < adsPage.length; i++) { - * // TODO: Change code below to process each resource in `adsPage`: - * console.log(JSON.stringify(adsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.ads.list(request, handlePage); - * } - * }; - * - * dfareporting.ads.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.ads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active ads. - * @param {string=} params.advertiserId Select only ads with this advertiser ID. - * @param {boolean=} params.archived Select only archived ads. - * @param {string=} params.audienceSegmentIds Select only ads with these audience segment IDs. - * @param {string=} params.campaignIds Select only ads with these campaign IDs. - * @param {string=} params.compatibility Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. - * @param {string=} params.creativeIds Select only ads with these creative IDs assigned. - * @param {string=} params.creativeOptimizationConfigurationIds Select only ads with these creative optimization configuration IDs. - * @param {boolean=} params.dynamicClickTracker Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. - * @param {string=} params.ids Select only ads with these IDs. - * @param {string=} params.landingPageIds Select only ads with these landing page IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.overriddenEventTagId Select only ads with this event tag override ID. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.placementIds Select only ads with these placement IDs assigned. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.remarketingListIds Select only ads whose list targeting expression use these remarketing list IDs. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". - * @param {string=} params.sizeIds Select only ads with these size IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {boolean=} params.sslCompliant Select only ads that are SSL-compliant. - * @param {boolean=} params.sslRequired Select only ads that require SSL. - * @param {string=} params.type Select only ads with these types. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.patch - * @desc Updates an existing ad. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Ad ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.ads.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.ads.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Ad ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.update - * @desc Updates an existing ad. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.ads.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.ads.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Advertisergroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.advertiserGroups.delete - * @desc Deletes an existing advertiser group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.advertiserGroups.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.get - * @desc Gets one advertiser group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.advertiserGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.insert - * @desc Inserts a new advertiser group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertiserGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.list - * @desc Retrieves a list of advertiser groups, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var advertiserGroupsPage = response['advertiserGroups']; - * if (!advertiserGroupsPage) { - * return; - * } - * for (var i = 0; i < advertiserGroupsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `advertiserGroupsPage`: console.log(JSON.stringify(advertiserGroupsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.advertiserGroups.list(request, handlePage); - * } - * }; - * - * dfareporting.advertiserGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only advertiser groups with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.patch - * @desc Updates an existing advertiser group. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser group ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertiserGroups.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.update - * @desc Updates an existing advertiser group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertiserGroups.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertiserGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Advertisers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.advertisers.get - * @desc Gets one advertiser by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.advertisers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertisers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertisers/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.insert - * @desc Inserts a new advertiser. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertisers.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertisers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.list - * @desc Retrieves a list of advertisers, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var advertisersPage = response['advertisers']; - * if (!advertisersPage) { - * return; - * } - * for (var i = 0; i < advertisersPage.length; i++) { - * // TODO: Change code below to process each resource in - * `advertisersPage`: console.log(JSON.stringify(advertisersPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.advertisers.list(request, handlePage); - * } - * }; - * - * dfareporting.advertisers.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertisers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserGroupIds Select only advertisers with these advertiser group IDs. - * @param {string=} params.floodlightConfigurationIds Select only advertisers with these floodlight configuration IDs. - * @param {string=} params.ids Select only advertisers with these IDs. - * @param {boolean=} params.includeAdvertisersWithoutGroupsOnly Select only advertisers which do not belong to any advertiser group. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {boolean=} params.onlyParent Select only advertisers which use another advertiser's floodlight configuration. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.status Select only advertisers with the specified status. - * @param {string=} params.subaccountId Select only advertisers with these subaccount IDs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.patch - * @desc Updates an existing advertiser. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertisers.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertisers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.update - * @desc Updates an existing advertiser. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.advertisers.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.advertisers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Browsers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.browsers.list - * @desc Retrieves a list of browsers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.browsers.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.browsers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/browsers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Campaigncreativeassociations { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.campaignCreativeAssociations.insert - * @desc Associates a creative with the specified campaign. This method - * creates a default ad with dimensions matching the creative in the campaign - * if such a default ad does not exist already. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Campaign ID in this association. - * campaignId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.campaignCreativeAssociations.insert(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaignCreativeAssociations.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Campaign ID in this association. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CampaignCreativeAssociation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaignCreativeAssociations.list - * @desc Retrieves the list of creative IDs associated with the specified - * campaign. This method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Campaign ID in this association. - * campaignId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var campaignCreativeAssociationsPage = - * response['campaignCreativeAssociations']; if - * (!campaignCreativeAssociationsPage) { return; - * } - * for (var i = 0; i < campaignCreativeAssociationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `campaignCreativeAssociationsPage`: - * console.log(JSON.stringify(campaignCreativeAssociationsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.campaignCreativeAssociations.list(request, handlePage); - * } - * }; - * - * dfareporting.campaignCreativeAssociations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaignCreativeAssociations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Campaign ID in this association. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$CampaignCreativeAssociationsListResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$CampaignCreativeAssociationsListResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Campaigns { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.campaigns.get - * @desc Gets one campaign by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Campaign ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.campaigns.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaigns.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.insert - * @desc Inserts a new campaign. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Default landing page name for this new campaign. Must be less than - * 256 characters long. defaultLandingPageName: '', // TODO: Update - * placeholder value. - * - * // Default landing page URL for this new campaign. - * defaultLandingPageUrl: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.campaigns.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaigns.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.defaultLandingPageName Default landing page name for this new campaign. Must be less than 256 characters long. - * @param {string} params.defaultLandingPageUrl Default landing page URL for this new campaign. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['profileId', 'defaultLandingPageName', 'defaultLandingPageUrl'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.list - * @desc Retrieves a list of campaigns, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var campaignsPage = response['campaigns']; - * if (!campaignsPage) { - * return; - * } - * for (var i = 0; i < campaignsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `campaignsPage`: console.log(JSON.stringify(campaignsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.campaigns.list(request, handlePage); - * } - * }; - * - * dfareporting.campaigns.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaigns.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserGroupIds Select only campaigns whose advertisers belong to these advertiser groups. - * @param {string=} params.advertiserIds Select only campaigns that belong to these advertisers. - * @param {boolean=} params.archived Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. - * @param {boolean=} params.atLeastOneOptimizationActivity Select only campaigns that have at least one optimization activity. - * @param {string=} params.excludedIds Exclude campaigns with these IDs. - * @param {string=} params.ids Select only campaigns with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.overriddenEventTagId Select only campaigns that have overridden this event tag ID. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only campaigns that belong to this subaccount. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.patch - * @desc Updates an existing campaign. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Campaign ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.campaigns.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaigns.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.update - * @desc Updates an existing campaign. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.campaigns.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.campaigns.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Changelogs { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.changeLogs.get - * @desc Gets one change log by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Change log ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.changeLogs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.changeLogs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Change log ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/changeLogs/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.changeLogs.list - * @desc Retrieves a list of change logs. This method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var changeLogsPage = response['changeLogs']; - * if (!changeLogsPage) { - * return; - * } - * for (var i = 0; i < changeLogsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `changeLogsPage`: console.log(JSON.stringify(changeLogsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.changeLogs.list(request, handlePage); - * } - * }; - * - * dfareporting.changeLogs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.changeLogs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.action Select only change logs with the specified action. - * @param {string=} params.ids Select only change logs with these IDs. - * @param {string=} params.maxChangeTime Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.minChangeTime Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. - * @param {string=} params.objectIds Select only change logs with these object IDs. - * @param {string=} params.objectType Select only change logs with the specified object type. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Select only change logs whose object ID, user name, old or new values match the search string. - * @param {string=} params.userProfileIds Select only change logs with these user profile IDs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/changeLogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Cities { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.cities.list - * @desc Retrieves a list of cities, possibly filtered. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.cities.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.cities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.countryDartIds Select only cities from these countries. - * @param {string=} params.dartIds Select only cities with these DART IDs. - * @param {string=} params.namePrefix Select only cities with names starting with this prefix. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.regionDartIds Select only cities from these regions. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/cities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Connectiontypes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.connectionTypes.get - * @desc Gets one connection type by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Connection type ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.connectionTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.connectionTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Connection type ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/connectionTypes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.connectionTypes.list - * @desc Retrieves a list of connection types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.connectionTypes.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.connectionTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/connectionTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Contentcategories { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.contentCategories.delete - * @desc Deletes an existing content category. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Content category ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.contentCategories.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.get - * @desc Gets one content category by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Content category ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.contentCategories.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.insert - * @desc Inserts a new content category. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.contentCategories.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.list - * @desc Retrieves a list of content categories, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var contentCategoriesPage = response['contentCategories']; - * if (!contentCategoriesPage) { - * return; - * } - * for (var i = 0; i < contentCategoriesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `contentCategoriesPage`: - * console.log(JSON.stringify(contentCategoriesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.contentCategories.list(request, handlePage); - * } - * }; - * - * dfareporting.contentCategories.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only content categories with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.patch - * @desc Updates an existing content category. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Content category ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.contentCategories.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.update - * @desc Updates an existing content category. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.contentCategories.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.contentCategories.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Conversions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.conversions.batchinsert - * @desc Inserts conversions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.conversions.batchinsert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/ddmconversions' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.conversions.batchinsert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ConversionsBatchInsertRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchinsert(params?: any, options?: MethodOptions): - AxiosPromise; - batchinsert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchinsert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/conversions/batchinsert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.conversions.batchupdate - * @desc Updates existing conversions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.conversions.batchupdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/ddmconversions' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.conversions.batchupdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ConversionsBatchUpdateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchupdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchupdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchupdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/conversions/batchupdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Countries { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.countries.get - * @desc Gets one country by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Country DART ID. - * dartId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.countries.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.countries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dartId Country DART ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/countries/{dartId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'dartId'], - pathParams: ['dartId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.countries.list - * @desc Retrieves a list of countries. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.countries.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.countries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/countries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativeassets { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeAssets.insert - * @desc Inserts a new creative asset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Advertiser ID of this creative. This is a required field. - * advertiserId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * media: { - * // TODO: Add desired media content for upload. See - * // https://github.com/google/google-api-nodejs-client#media-uploads - * mimeType: '', // See - * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeAssets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeAssets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.advertiserId Advertiser ID of this creative. This is a required field. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['advertiserId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativefields { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeFields.delete - * @desc Deletes an existing creative field. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative Field ID - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creativeFields.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.get - * @desc Gets one creative field by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative Field ID - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creativeFields.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.insert - * @desc Inserts a new creative field. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFields.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.list - * @desc Retrieves a list of creative fields, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var creativeFieldsPage = response['creativeFields']; - * if (!creativeFieldsPage) { - * return; - * } - * for (var i = 0; i < creativeFieldsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `creativeFieldsPage`: console.log(JSON.stringify(creativeFieldsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.creativeFields.list(request, handlePage); - * } - * }; - * - * dfareporting.creativeFields.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only creative fields that belong to these advertisers. - * @param {string=} params.ids Select only creative fields with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.patch - * @desc Updates an existing creative field. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative Field ID - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFields.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.update - * @desc Updates an existing creative field. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFields.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFields.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativefieldvalues { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeFieldValues.delete - * @desc Deletes an existing creative field value. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * // Creative Field Value ID - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creativeFieldValues.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.get - * @desc Gets one creative field value by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * // Creative Field Value ID - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creativeFieldValues.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.insert - * @desc Inserts a new creative field value. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFieldValues.insert(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.list - * @desc Retrieves a list of creative field values, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var creativeFieldValuesPage = response['creativeFieldValues']; - * if (!creativeFieldValuesPage) { - * return; - * } - * for (var i = 0; i < creativeFieldValuesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `creativeFieldValuesPage`: - * console.log(JSON.stringify(creativeFieldValuesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.creativeFieldValues.list(request, handlePage); - * } - * }; - * - * dfareporting.creativeFieldValues.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string=} params.ids Select only creative field values with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.patch - * @desc Updates an existing creative field value. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * // Creative Field Value ID - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFieldValues.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.update - * @desc Updates an existing creative field value. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative field ID for this creative field value. - * creativeFieldId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeFieldValues.update(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeFieldValues.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativegroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeGroups.get - * @desc Gets one creative group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creativeGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.insert - * @desc Inserts a new creative group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.list - * @desc Retrieves a list of creative groups, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var creativeGroupsPage = response['creativeGroups']; - * if (!creativeGroupsPage) { - * return; - * } - * for (var i = 0; i < creativeGroupsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `creativeGroupsPage`: console.log(JSON.stringify(creativeGroupsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.creativeGroups.list(request, handlePage); - * } - * }; - * - * dfareporting.creativeGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only creative groups that belong to these advertisers. - * @param {integer=} params.groupNumber Select only creative groups that belong to this subgroup. - * @param {string=} params.ids Select only creative groups with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.patch - * @desc Updates an existing creative group. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative group ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeGroups.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.update - * @desc Updates an existing creative group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creativeGroups.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creativeGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creatives { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creatives.get - * @desc Gets one creative by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.creatives.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creatives/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.insert - * @desc Inserts a new creative. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creatives.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creatives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.list - * @desc Retrieves a list of creatives, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var creativesPage = response['creatives']; - * if (!creativesPage) { - * return; - * } - * for (var i = 0; i < creativesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `creativesPage`: console.log(JSON.stringify(creativesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.creatives.list(request, handlePage); - * } - * }; - * - * dfareporting.creatives.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creatives.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active creatives. Leave blank to select active and inactive creatives. - * @param {string=} params.advertiserId Select only creatives with this advertiser ID. - * @param {boolean=} params.archived Select only archived creatives. Leave blank to select archived and unarchived creatives. - * @param {string=} params.campaignId Select only creatives with this campaign ID. - * @param {string=} params.companionCreativeIds Select only in-stream video creatives with these companion IDs. - * @param {string=} params.creativeFieldIds Select only creatives with these creative field IDs. - * @param {string=} params.ids Select only creatives with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.renderingIds Select only creatives with these rendering IDs. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". - * @param {string=} params.sizeIds Select only creatives with these size IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.studioCreativeId Select only creatives corresponding to this Studio creative ID. - * @param {string=} params.types Select only creatives with these creative types. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.patch - * @desc Updates an existing creative. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Creative ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creatives.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creatives.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.update - * @desc Updates an existing creative. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.creatives.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.creatives.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Dimensionvalues { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.dimensionValues.query - * @desc Retrieves list of report dimension values for a list of filters. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.dimensionValues.query(request, handlePage); - * } - * }; - * - * dfareporting.dimensionValues.query(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.dimensionValues.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA user profile ID. - * @param {().DimensionValueRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/dimensionvalues/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Directorysitecontacts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.directorySiteContacts.get - * @desc Gets one directory site contact by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Directory site contact ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.directorySiteContacts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.directorySiteContacts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Directory site contact ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/directorySiteContacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySiteContacts.list - * @desc Retrieves a list of directory site contacts, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var directorySiteContactsPage = response['directorySiteContacts']; - * if (!directorySiteContactsPage) { - * return; - * } - * for (var i = 0; i < directorySiteContactsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `directorySiteContactsPage`: - * console.log(JSON.stringify(directorySiteContactsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.directorySiteContacts.list(request, handlePage); - * } - * }; - * - * dfareporting.directorySiteContacts.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.directorySiteContacts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.directorySiteIds Select only directory site contacts with these directory site IDs. This is a required field. - * @param {string=} params.ids Select only directory site contacts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with name "my directory site contact", "directory site contact 2015", or simply "directory site contact". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/directorySiteContacts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Directorysites { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.directorySites.get - * @desc Gets one directory site by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Directory site ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.directorySites.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.directorySites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Directory site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/directorySites/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySites.insert - * @desc Inserts a new directory site. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.directorySites.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.directorySites.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().DirectorySite} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/directorySites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySites.list - * @desc Retrieves a list of directory sites, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var directorySitesPage = response['directorySites']; - * if (!directorySitesPage) { - * return; - * } - * for (var i = 0; i < directorySitesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `directorySitesPage`: console.log(JSON.stringify(directorySitesPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.directorySites.list(request, handlePage); - * } - * }; - * - * dfareporting.directorySites.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.directorySites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsPublisherPaidPlacements Select only directory sites that accept publisher paid placements. This field can be left blank. - * @param {boolean=} params.active Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. - * @param {string=} params.countryId Select only directory sites with this country ID. - * @param {string=} params.dfpNetworkCode Select only directory sites with this DFP network code. - * @param {string=} params.ids Select only directory sites with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.parentId Select only directory sites with this parent ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/directorySites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Dynamictargetingkeys { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.dynamicTargetingKeys.delete - * @desc Deletes an existing dynamic targeting key. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // ID of the object of this dynamic targeting key. This is a required - * field. objectId: '0', // TODO: Update placeholder value. - * - * // Name of this dynamic targeting key. This is a required field. Must - * be less than 256 characters long - * // and cannot contain commas. All characters are converted to - * lowercase. name: '', // TODO: Update placeholder value. - * - * // Type of the object of this dynamic targeting key. This is a required - * field. objectType: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.dynamicTargetingKeys.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.dynamicTargetingKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. - * @param {string} params.objectId ID of the object of this dynamic targeting key. This is a required field. - * @param {string} params.objectType Type of the object of this dynamic targeting key. This is a required field. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys/{objectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'objectId', 'name', 'objectType'], - pathParams: ['objectId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.dynamicTargetingKeys.insert - * @desc Inserts a new dynamic targeting key. Keys must be created at the - * advertiser level before being assigned to the advertiser's ads, creatives, - * or placements. There is a maximum of 1000 keys per advertiser, out of which - * a maximum of 20 keys can be assigned per ad, creative, or placement. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.dynamicTargetingKeys.insert(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.dynamicTargetingKeys.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().DynamicTargetingKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.dynamicTargetingKeys.list - * @desc Retrieves a list of dynamic targeting keys. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.dynamicTargetingKeys.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.dynamicTargetingKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only dynamic targeting keys whose object has this advertiser ID. - * @param {string=} params.names Select only dynamic targeting keys exactly matching these names. - * @param {string=} params.objectId Select only dynamic targeting keys with this object ID. - * @param {string=} params.objectType Select only dynamic targeting keys with this object type. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Eventtags { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.eventTags.delete - * @desc Deletes an existing event tag. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Event tag ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.get - * @desc Gets one event tag by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Event tag ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.insert - * @desc Inserts a new event tag. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.list - * @desc Retrieves a list of event tags, possibly filtered. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.adId Select only event tags that belong to this ad. - * @param {string=} params.advertiserId Select only event tags that belong to this advertiser. - * @param {string=} params.campaignId Select only event tags that belong to this campaign. - * @param {boolean=} params.definitionsOnly Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. - * @param {boolean=} params.enabled Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. - * @param {string=} params.eventTagTypes Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. - * @param {string=} params.ids Select only event tags with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.patch - * @desc Updates an existing event tag. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Event tag ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.update - * @desc Updates an existing event tag. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.eventTags.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.eventTags.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Files { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.files.get - * @desc Retrieves a report file by its report ID and file ID. This method - * supports media download. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * // The ID of the report file. - * fileId: '0', // TODO: Update placeholder value. - * - * // TODO: To download media content, use: - * // - * // alt: 'media', - * - * auth: authClient, - * }; - * - * dfareporting.files.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the report file. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/reports/{reportId}/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['reportId', 'fileId'], - pathParams: ['fileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.files.list - * @desc Lists files for a user profile. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.files.list(request, handlePage); - * } - * }; - * - * dfareporting.files.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.files.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA profile ID. - * @param {string=} params.scope The scope that defines which results are returned. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/files') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightactivities { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightActivities.delete - * @desc Deletes an existing floodlight activity. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight activity ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.generatetag - * @desc Generates a tag for a floodlight activity. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.generatetag(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.generatetag - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.floodlightActivityId Floodlight activity ID for which we want to generate a tag. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generatetag(params?: any, options?: MethodOptions): - AxiosPromise; - generatetag( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - generatetag( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/generatetag') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivities.get - * @desc Gets one floodlight activity by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight activity ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.insert - * @desc Inserts a new floodlight activity. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.insert(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.list - * @desc Retrieves a list of floodlight activities, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var floodlightActivitiesPage = response['floodlightActivities']; - * if (!floodlightActivitiesPage) { - * return; - * } - * for (var i = 0; i < floodlightActivitiesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `floodlightActivitiesPage`: - * console.log(JSON.stringify(floodlightActivitiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.floodlightActivities.list(request, handlePage); - * } - * }; - * - * dfareporting.floodlightActivities.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.floodlightActivityGroupIds Select only floodlight activities with the specified floodlight activity group IDs. - * @param {string=} params.floodlightActivityGroupName Select only floodlight activities with the specified floodlight activity group name. - * @param {string=} params.floodlightActivityGroupTagString Select only floodlight activities with the specified floodlight activity group tag string. - * @param {string=} params.floodlightActivityGroupType Select only floodlight activities with the specified floodlight activity group type. - * @param {string=} params.floodlightConfigurationId Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.ids Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.tagString Select only floodlight activities with the specified tag string. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivities.patch - * @desc Updates an existing floodlight activity. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight activity ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.patch(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.update - * @desc Updates an existing floodlight activity. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivities.update(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivities.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightactivitygroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightActivityGroups.get - * @desc Gets one floodlight activity group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight activity Group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivityGroups.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivityGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity Group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.insert - * @desc Inserts a new floodlight activity group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivityGroups.insert(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivityGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.list - * @desc Retrieves a list of floodlight activity groups, possibly filtered. - * This method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var floodlightActivityGroupsPage = - * response['floodlightActivityGroups']; if (!floodlightActivityGroupsPage) { - * return; - * } - * for (var i = 0; i < floodlightActivityGroupsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `floodlightActivityGroupsPage`: - * console.log(JSON.stringify(floodlightActivityGroupsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.floodlightActivityGroups.list(request, handlePage); - * } - * }; - * - * dfareporting.floodlightActivityGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivityGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. - * @param {string=} params.floodlightConfigurationId Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.ids Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.type Select only floodlight activity groups with the specified floodlight activity group type. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.patch - * @desc Updates an existing floodlight activity group. This method supports - * patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight activity Group ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivityGroups.patch(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivityGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity Group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.update - * @desc Updates an existing floodlight activity group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightActivityGroups.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightActivityGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightconfigurations { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightConfigurations.get - * @desc Gets one floodlight configuration by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight configuration ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightConfigurations.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightConfigurations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight configuration ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.list - * @desc Retrieves a list of floodlight configurations, possibly filtered. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.floodlightConfigurations.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightConfigurations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.patch - * @desc Updates an existing floodlight configuration. This method supports - * patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Floodlight configuration ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightConfigurations.patch(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightConfigurations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight configuration ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.update - * @desc Updates an existing floodlight configuration. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.floodlightConfigurations.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.floodlightConfigurations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Inventoryitems { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.inventoryItems.get - * @desc Gets one inventory item by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for order documents. - * projectId: '0', // TODO: Update placeholder value. - * - * // Inventory item ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.inventoryItems.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.inventoryItems.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Inventory item ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.inventoryItems.list - * @desc Retrieves a list of inventory items, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for order documents. - * projectId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var inventoryItemsPage = response['inventoryItems']; - * if (!inventoryItemsPage) { - * return; - * } - * for (var i = 0; i < inventoryItemsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `inventoryItemsPage`: console.log(JSON.stringify(inventoryItemsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.inventoryItems.list(request, handlePage); - * } - * }; - * - * dfareporting.inventoryItems.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.inventoryItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only inventory items with these IDs. - * @param {boolean=} params.inPlan Select only inventory items that are in plan. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderId Select only inventory items that belong to specified orders. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {string=} params.siteId Select only inventory items that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.type Select only inventory items with this type. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/inventoryItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Landingpages { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.landingPages.delete - * @desc Deletes an existing campaign landing page. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * // Landing page ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.id Landing page ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'campaignId', 'id'], - pathParams: ['campaignId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.landingPages.get - * @desc Gets one campaign landing page by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * // Landing page ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.id Landing page ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'campaignId', 'id'], - pathParams: ['campaignId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.landingPages.insert - * @desc Inserts a new landing page for the specified campaign. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.landingPages.list - * @desc Retrieves the list of landing pages for the specified campaign. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.landingPages.patch - * @desc Updates an existing campaign landing page. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * // Landing page ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.id Landing page ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'campaignId', 'id'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.landingPages.update - * @desc Updates an existing campaign landing page. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Landing page campaign ID. - * campaignId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.landingPages.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.landingPages.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Landing page campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Languages { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.languages.list - * @desc Retrieves a list of languages. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.languages.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.languages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/languages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Metros { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.metros.list - * @desc Retrieves a list of metros. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.metros.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.metros.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/metros') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Mobilecarriers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.mobileCarriers.get - * @desc Gets one mobile carrier by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Mobile carrier ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.mobileCarriers.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.mobileCarriers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Mobile carrier ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/mobileCarriers/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.mobileCarriers.list - * @desc Retrieves a list of mobile carriers. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.mobileCarriers.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.mobileCarriers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/mobileCarriers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operatingsystems { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.operatingSystems.get - * @desc Gets one operating system by DART ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Operating system DART ID. - * dartId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.operatingSystems.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.operatingSystems.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dartId Operating system DART ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystems/{dartId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'dartId'], - pathParams: ['dartId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.operatingSystems.list - * @desc Retrieves a list of operating systems. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.operatingSystems.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.operatingSystems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operatingsystemversions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.operatingSystemVersions.get - * @desc Gets one operating system version by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Operating system version ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.operatingSystemVersions.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.operatingSystemVersions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Operating system version ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystemVersions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.operatingSystemVersions.list - * @desc Retrieves a list of operating system versions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.operatingSystemVersions.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.operatingSystemVersions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystemVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Orderdocuments { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.orderDocuments.get - * @desc Gets one order document by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for order documents. - * projectId: '0', // TODO: Update placeholder value. - * - * // Order document ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.orderDocuments.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.orderDocuments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Order document ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.orderDocuments.list - * @desc Retrieves a list of order documents, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for order documents. - * projectId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var orderDocumentsPage = response['orderDocuments']; - * if (!orderDocumentsPage) { - * return; - * } - * for (var i = 0; i < orderDocumentsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `orderDocumentsPage`: console.log(JSON.stringify(orderDocumentsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.orderDocuments.list(request, handlePage); - * } - * }; - * - * dfareporting.orderDocuments.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.orderDocuments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.approved Select only order documents that have been approved by at least one user. - * @param {string=} params.ids Select only order documents with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderId Select only order documents for specified orders. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {string=} params.searchString Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". - * @param {string=} params.siteId Select only order documents that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orderDocuments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Orders { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.orders.get - * @desc Gets one order by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for orders. - * projectId: '0', // TODO: Update placeholder value. - * - * // Order ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.orders.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.orders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Order ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for orders. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orders/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.orders.list - * @desc Retrieves a list of orders, possibly filtered. This method supports - * paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID for orders. - * projectId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var ordersPage = response['orders']; - * if (!ordersPage) { - * return; - * } - * for (var i = 0; i < ordersPage.length; i++) { - * // TODO: Change code below to process each resource in `ordersPage`: - * console.log(JSON.stringify(ordersPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.orders.list(request, handlePage); - * } - * }; - * - * dfareporting.orders.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.orders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only orders with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for orders. - * @param {string=} params.searchString Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". - * @param {string=} params.siteId Select only orders that are associated with these site IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placementgroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placementGroups.get - * @desc Gets one placement group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.placementGroups.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.insert - * @desc Inserts a new placement group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementGroups.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.list - * @desc Retrieves a list of placement groups, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var placementGroupsPage = response['placementGroups']; - * if (!placementGroupsPage) { - * return; - * } - * for (var i = 0; i < placementGroupsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `placementGroupsPage`: console.log(JSON.stringify(placementGroupsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.placementGroups.list(request, handlePage); - * } - * }; - * - * dfareporting.placementGroups.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only placement groups that belong to these advertisers. - * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. - * @param {string=} params.campaignIds Select only placement groups that belong to these campaigns. - * @param {string=} params.contentCategoryIds Select only placement groups that are associated with these content categories. - * @param {string=} params.directorySiteIds Select only placement groups that are associated with these directory sites. - * @param {string=} params.ids Select only placement groups with these IDs. - * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.placementGroupType Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. - * @param {string=} params.placementStrategyIds Select only placement groups that are associated with these placement strategies. - * @param {string=} params.pricingTypes Select only placement groups with these pricing types. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". - * @param {string=} params.siteIds Select only placement groups that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.patch - * @desc Updates an existing placement group. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement group ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementGroups.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.update - * @desc Updates an existing placement group. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementGroups.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placements { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placements.generatetags - * @desc Generates tags for a placement. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.placements.generatetags(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.generatetags - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.campaignId Generate placements belonging to this campaign. This is a required field. - * @param {string=} params.placementIds Generate tags for these placements. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.tagFormats Tag formats to generate for these placements. Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generatetags(params?: any, options?: MethodOptions): - AxiosPromise; - generatetags( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generatetags( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements/generatetags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.placements.get - * @desc Gets one placement by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.placements.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.insert - * @desc Inserts a new placement. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placements.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.list - * @desc Retrieves a list of placements, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var placementsPage = response['placements']; - * if (!placementsPage) { - * return; - * } - * for (var i = 0; i < placementsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `placementsPage`: console.log(JSON.stringify(placementsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.placements.list(request, handlePage); - * } - * }; - * - * dfareporting.placements.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only placements that belong to these advertisers. - * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. - * @param {string=} params.campaignIds Select only placements that belong to these campaigns. - * @param {string=} params.compatibilities Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. - * @param {string=} params.contentCategoryIds Select only placements that are associated with these content categories. - * @param {string=} params.directorySiteIds Select only placements that are associated with these directory sites. - * @param {string=} params.groupIds Select only placements that belong to these placement groups. - * @param {string=} params.ids Select only placements with these IDs. - * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.paymentSource Select only placements with this payment source. - * @param {string=} params.placementStrategyIds Select only placements that are associated with these placement strategies. - * @param {string=} params.pricingTypes Select only placements with these pricing types. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". - * @param {string=} params.siteIds Select only placements that are associated with these sites. - * @param {string=} params.sizeIds Select only placements that are associated with these sizes. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.patch - * @desc Updates an existing placement. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placements.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.update - * @desc Updates an existing placement. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placements.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placements.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placementstrategies { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placementStrategies.delete - * @desc Deletes an existing placement strategy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement strategy ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.placementStrategies.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.get - * @desc Gets one placement strategy by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement strategy ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.placementStrategies.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.insert - * @desc Inserts a new placement strategy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementStrategies.insert(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.list - * @desc Retrieves a list of placement strategies, possibly filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var placementStrategiesPage = response['placementStrategies']; - * if (!placementStrategiesPage) { - * return; - * } - * for (var i = 0; i < placementStrategiesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `placementStrategiesPage`: - * console.log(JSON.stringify(placementStrategiesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.placementStrategies.list(request, handlePage); - * } - * }; - * - * dfareporting.placementStrategies.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only placement strategies with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.placementStrategies.patch - * @desc Updates an existing placement strategy. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Placement strategy ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementStrategies.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.update - * @desc Updates an existing placement strategy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.placementStrategies.update(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.placementStrategies.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Platformtypes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.platformTypes.get - * @desc Gets one platform type by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Platform type ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.platformTypes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.platformTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Platform type ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/platformTypes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.platformTypes.list - * @desc Retrieves a list of platform types. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.platformTypes.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.platformTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/platformTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Postalcodes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.postalCodes.get - * @desc Gets one postal code by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Postal code ID. - * code: 'my-code', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.postalCodes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.postalCodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.code Postal code ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/postalCodes/{code}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'code'], - pathParams: ['code', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.postalCodes.list - * @desc Retrieves a list of postal codes. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.postalCodes.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.postalCodes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/postalCodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.projects.get - * @desc Gets one project by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Project ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Project ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.projects.list - * @desc Retrieves a list of projects, possibly filtered. This method supports - * paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var projectsPage = response['projects']; - * if (!projectsPage) { - * return; - * } - * for (var i = 0; i < projectsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.projects.list(request, handlePage); - * } - * }; - * - * dfareporting.projects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.projects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only projects with these advertiser IDs. - * @param {string=} params.ids Select only projects with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/projects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.regions.list - * @desc Retrieves a list of regions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.regions.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.regions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/regions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Remarketinglists { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.remarketingLists.get - * @desc Gets one remarketing list by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Remarketing list ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.remarketingLists.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingLists.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.insert - * @desc Inserts a new remarketing list. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.remarketingLists.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingLists.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.list - * @desc Retrieves a list of remarketing lists, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Select only remarketing lists owned by this advertiser. - * advertiserId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var remarketingListsPage = response['remarketingLists']; - * if (!remarketingListsPage) { - * return; - * } - * for (var i = 0; i < remarketingListsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `remarketingListsPage`: console.log(JSON.stringify(remarketingListsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.remarketingLists.list(request, handlePage); - * } - * }; - * - * dfareporting.remarketingLists.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingLists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active or only inactive remarketing lists. - * @param {string} params.advertiserId Select only remarketing lists owned by this advertiser. - * @param {string=} params.floodlightActivityId Select only remarketing lists that have this floodlight activity ID. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.patch - * @desc Updates an existing remarketing list. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Remarketing list ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.remarketingLists.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingLists.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.update - * @desc Updates an existing remarketing list. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.remarketingLists.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingLists.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Remarketinglistshares { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.remarketingListShares.get - * @desc Gets one remarketing list share by remarketing list ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Remarketing list ID. - * remarketingListId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.remarketingListShares.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingListShares.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.remarketingListId Remarketing list ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares/{remarketingListId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'remarketingListId'], - pathParams: ['profileId', 'remarketingListId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingListShares.patch - * @desc Updates an existing remarketing list share. This method supports - * patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Remarketing list ID. - * remarketingListId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.remarketingListShares.patch(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingListShares.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.remarketingListId Remarketing list ID. - * @param {().RemarketingListShare} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'remarketingListId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingListShares.update - * @desc Updates an existing remarketing list share. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.remarketingListShares.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.remarketingListShares.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingListShare} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports { - root: Dfareporting; - compatibleFields: Resource$Reports$Compatiblefields; - files: Resource$Reports$Files; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - this.compatibleFields = new Resource$Reports$Compatiblefields(root); - this.files = new Resource$Reports$Files(root); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.delete - * @desc Deletes a report by its ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.reports.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.get - * @desc Retrieves a report by its ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.reports.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.insert - * @desc Creates a report. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.reports.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.list - * @desc Retrieves list of reports. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.reports.list(request, handlePage); - * } - * }; - * - * dfareporting.reports.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA user profile ID. - * @param {string=} params.scope The scope that defines which results are returned. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.patch - * @desc Updates a report. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.reports.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.run - * @desc Runs a report. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.reports.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the report. - * @param {boolean=} params.synchronous If set and true, tries to run the report synchronously. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.update - * @desc Updates a report. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.reports.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Reports$Compatiblefields { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.compatibleFields.query - * @desc Returns the fields that are compatible to be selected in the - * respective sections of a report criteria, given the fields already selected - * in the input report and user permissions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.reports.compatibleFields.query(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.compatibleFields.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/compatiblefields/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports$Files { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.files.get - * @desc Retrieves a report file. This method supports media download. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the report. - * reportId: '0', // TODO: Update placeholder value. - * - * // The ID of the report file. - * fileId: '0', // TODO: Update placeholder value. - * - * // TODO: To download media content, use: - * // - * // alt: 'media', - * - * auth: authClient, - * }; - * - * dfareporting.reports.files.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the report file. - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId', 'fileId'], - pathParams: ['fileId', 'profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.files.list - * @desc Lists files for a report. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The DFA profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * // The ID of the parent report. - * reportId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.reports.files.list(request, handlePage); - * } - * }; - * - * dfareporting.reports.files.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfareporting' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.reports.files.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the parent report. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/files') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Sites { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.sites.get - * @desc Gets one site by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Site ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.sites.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/sites/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.insert - * @desc Inserts a new site. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.sites.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sites.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.list - * @desc Retrieves a list of sites, possibly filtered. This method supports - * paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var sitesPage = response['sites']; - * if (!sitesPage) { - * return; - * } - * for (var i = 0; i < sitesPage.length; i++) { - * // TODO: Change code below to process each resource in `sitesPage`: - * console.log(JSON.stringify(sitesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.sites.list(request, handlePage); - * } - * }; - * - * dfareporting.sites.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsPublisherPaidPlacements Select only sites that accept publisher paid placements. - * @param {boolean=} params.adWordsSite Select only AdWords sites. - * @param {boolean=} params.approved Select only approved sites. - * @param {string=} params.campaignIds Select only sites with these campaign IDs. - * @param {string=} params.directorySiteIds Select only sites with these directory site IDs. - * @param {string=} params.ids Select only sites with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only sites with this subaccount ID. - * @param {boolean=} params.unmappedSite Select only sites that have not been mapped to a directory site. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.patch - * @desc Updates an existing site. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Site ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.sites.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sites.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.update - * @desc Updates an existing site. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.sites.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sites.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sizes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.sizes.get - * @desc Gets one size by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Size ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.sizes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sizes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Size ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/sizes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sizes.insert - * @desc Inserts a new size. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.sizes.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sizes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Size} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sizes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sizes.list - * @desc Retrieves a list of sizes, possibly filtered. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.sizes.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.sizes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.height Select only sizes with this height. - * @param {boolean=} params.iabStandard Select only IAB standard sizes. - * @param {string=} params.ids Select only sizes with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {integer=} params.width Select only sizes with this width. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/sizes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subaccounts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.subaccounts.get - * @desc Gets one subaccount by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Subaccount ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.subaccounts.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.subaccounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Subaccount ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.insert - * @desc Inserts a new subaccount. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.subaccounts.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.subaccounts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.list - * @desc Gets a list of subaccounts, possibly filtered. This method supports - * paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var subaccountsPage = response['subaccounts']; - * if (!subaccountsPage) { - * return; - * } - * for (var i = 0; i < subaccountsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `subaccountsPage`: console.log(JSON.stringify(subaccountsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.subaccounts.list(request, handlePage); - * } - * }; - * - * dfareporting.subaccounts.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.subaccounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only subaccounts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.patch - * @desc Updates an existing subaccount. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Subaccount ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.subaccounts.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.subaccounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Subaccount ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.update - * @desc Updates an existing subaccount. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.subaccounts.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.subaccounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetableremarketinglists { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.targetableRemarketingLists.get - * @desc Gets one remarketing list by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Remarketing list ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.targetableRemarketingLists.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetableRemarketingLists.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetableRemarketingLists/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetableRemarketingLists.list - * @desc Retrieves a list of targetable remarketing lists, possibly filtered. - * This method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Select only targetable remarketing lists targetable by these - * advertisers. advertiserId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var targetableRemarketingListsPage = - * response['targetableRemarketingLists']; if - * (!targetableRemarketingListsPage) { return; - * } - * for (var i = 0; i < targetableRemarketingListsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `targetableRemarketingListsPage`: - * console.log(JSON.stringify(targetableRemarketingListsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.targetableRemarketingLists.list(request, handlePage); - * } - * }; - * - * dfareporting.targetableRemarketingLists.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetableRemarketingLists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active or only inactive targetable remarketing lists. - * @param {string} params.advertiserId Select only targetable remarketing lists targetable by these advertisers. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetableRemarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Targetingtemplates { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.targetingTemplates.get - * @desc Gets one targeting template by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Targeting template ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.targetingTemplates.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetingTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Targeting template ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.insert - * @desc Inserts a new targeting template. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.targetingTemplates.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetingTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.list - * @desc Retrieves a list of targeting templates, optionally filtered. This - * method supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var targetingTemplatesPage = response['targetingTemplates']; - * if (!targetingTemplatesPage) { - * return; - * } - * for (var i = 0; i < targetingTemplatesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `targetingTemplatesPage`: - * console.log(JSON.stringify(targetingTemplatesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.targetingTemplates.list(request, handlePage); - * } - * }; - * - * dfareporting.targetingTemplates.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetingTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only targeting templates with this advertiser ID. - * @param {string=} params.ids Select only targeting templates with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.targetingTemplates.patch - * @desc Updates an existing targeting template. This method supports patch - * semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Targeting template ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.targetingTemplates.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetingTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Targeting template ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.update - * @desc Updates an existing targeting template. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.targetingTemplates.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.targetingTemplates.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Userprofiles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userProfiles.get - * @desc Gets one user profile by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // The user profile ID. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userProfiles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/dfareporting' - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userProfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The user profile ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userProfiles.list - * @desc Retrieves list of user profiles for a user. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * dfareporting.userProfiles.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/dfareporting' - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userProfiles.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v2.8/userprofiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Userrolepermissiongroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRolePermissionGroups.get - * @desc Gets one user role permission group by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User role permission group ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userRolePermissionGroups.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRolePermissionGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role permission group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissionGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRolePermissionGroups.list - * @desc Gets a list of all supported user role permission groups. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userRolePermissionGroups.list(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRolePermissionGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissionGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Userrolepermissions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRolePermissions.get - * @desc Gets one user role permission by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User role permission ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userRolePermissions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRolePermissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role permission ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRolePermissions.list - * @desc Gets a list of user role permissions, possibly filtered. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userRolePermissions.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRolePermissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only user role permissions with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Userroles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRoles.delete - * @desc Deletes an existing user role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User role ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.userRoles.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace dfareporting_v2_8 { /** - * dfareporting.userRoles.get - * @desc Gets one user role by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User role ID. - * id: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; + * DCM/DFA Reporting And Trafficking API * - * dfareporting.userRoles.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } + * Manages your DoubleClick Campaign Manager ad campaigns and reports. * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.insert - * @desc Inserts a new user role. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.userRoles.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * const google = require('googleapis'); + * const dfareporting = google.dfareporting('v2.8'); + * + * @namespace dfareporting + * @type {Function} + * @version v2.8 + * @variation v2.8 + * @param {object=} options Options for Dfareporting + */ + export class Dfareporting { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accountActiveAdSummaries: Resource$Accountactiveadsummaries; + accountPermissionGroups: Resource$Accountpermissiongroups; + accountPermissions: Resource$Accountpermissions; + accounts: Resource$Accounts; + accountUserProfiles: Resource$Accountuserprofiles; + ads: Resource$Ads; + advertiserGroups: Resource$Advertisergroups; + advertisers: Resource$Advertisers; + browsers: Resource$Browsers; + campaignCreativeAssociations: Resource$Campaigncreativeassociations; + campaigns: Resource$Campaigns; + changeLogs: Resource$Changelogs; + cities: Resource$Cities; + connectionTypes: Resource$Connectiontypes; + contentCategories: Resource$Contentcategories; + conversions: Resource$Conversions; + countries: Resource$Countries; + creativeAssets: Resource$Creativeassets; + creativeFields: Resource$Creativefields; + creativeFieldValues: Resource$Creativefieldvalues; + creativeGroups: Resource$Creativegroups; + creatives: Resource$Creatives; + dimensionValues: Resource$Dimensionvalues; + directorySiteContacts: Resource$Directorysitecontacts; + directorySites: Resource$Directorysites; + dynamicTargetingKeys: Resource$Dynamictargetingkeys; + eventTags: Resource$Eventtags; + files: Resource$Files; + floodlightActivities: Resource$Floodlightactivities; + floodlightActivityGroups: Resource$Floodlightactivitygroups; + floodlightConfigurations: Resource$Floodlightconfigurations; + inventoryItems: Resource$Inventoryitems; + landingPages: Resource$Landingpages; + languages: Resource$Languages; + metros: Resource$Metros; + mobileCarriers: Resource$Mobilecarriers; + operatingSystems: Resource$Operatingsystems; + operatingSystemVersions: Resource$Operatingsystemversions; + orderDocuments: Resource$Orderdocuments; + orders: Resource$Orders; + placementGroups: Resource$Placementgroups; + placements: Resource$Placements; + placementStrategies: Resource$Placementstrategies; + platformTypes: Resource$Platformtypes; + postalCodes: Resource$Postalcodes; + projects: Resource$Projects; + regions: Resource$Regions; + remarketingLists: Resource$Remarketinglists; + remarketingListShares: Resource$Remarketinglistshares; + reports: Resource$Reports; + sites: Resource$Sites; + sizes: Resource$Sizes; + subaccounts: Resource$Subaccounts; + targetableRemarketingLists: Resource$Targetableremarketinglists; + targetingTemplates: Resource$Targetingtemplates; + userProfiles: Resource$Userprofiles; + userRolePermissionGroups: Resource$Userrolepermissiongroups; + userRolePermissions: Resource$Userrolepermissions; + userRoles: Resource$Userroles; + videoFormats: Resource$Videoformats; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accountActiveAdSummaries = + new Resource$Accountactiveadsummaries(this); + this.accountPermissionGroups = new Resource$Accountpermissiongroups(this); + this.accountPermissions = new Resource$Accountpermissions(this); + this.accounts = new Resource$Accounts(this); + this.accountUserProfiles = new Resource$Accountuserprofiles(this); + this.ads = new Resource$Ads(this); + this.advertiserGroups = new Resource$Advertisergroups(this); + this.advertisers = new Resource$Advertisers(this); + this.browsers = new Resource$Browsers(this); + this.campaignCreativeAssociations = + new Resource$Campaigncreativeassociations(this); + this.campaigns = new Resource$Campaigns(this); + this.changeLogs = new Resource$Changelogs(this); + this.cities = new Resource$Cities(this); + this.connectionTypes = new Resource$Connectiontypes(this); + this.contentCategories = new Resource$Contentcategories(this); + this.conversions = new Resource$Conversions(this); + this.countries = new Resource$Countries(this); + this.creativeAssets = new Resource$Creativeassets(this); + this.creativeFields = new Resource$Creativefields(this); + this.creativeFieldValues = new Resource$Creativefieldvalues(this); + this.creativeGroups = new Resource$Creativegroups(this); + this.creatives = new Resource$Creatives(this); + this.dimensionValues = new Resource$Dimensionvalues(this); + this.directorySiteContacts = new Resource$Directorysitecontacts(this); + this.directorySites = new Resource$Directorysites(this); + this.dynamicTargetingKeys = new Resource$Dynamictargetingkeys(this); + this.eventTags = new Resource$Eventtags(this); + this.files = new Resource$Files(this); + this.floodlightActivities = new Resource$Floodlightactivities(this); + this.floodlightActivityGroups = + new Resource$Floodlightactivitygroups(this); + this.floodlightConfigurations = + new Resource$Floodlightconfigurations(this); + this.inventoryItems = new Resource$Inventoryitems(this); + this.landingPages = new Resource$Landingpages(this); + this.languages = new Resource$Languages(this); + this.metros = new Resource$Metros(this); + this.mobileCarriers = new Resource$Mobilecarriers(this); + this.operatingSystems = new Resource$Operatingsystems(this); + this.operatingSystemVersions = new Resource$Operatingsystemversions(this); + this.orderDocuments = new Resource$Orderdocuments(this); + this.orders = new Resource$Orders(this); + this.placementGroups = new Resource$Placementgroups(this); + this.placements = new Resource$Placements(this); + this.placementStrategies = new Resource$Placementstrategies(this); + this.platformTypes = new Resource$Platformtypes(this); + this.postalCodes = new Resource$Postalcodes(this); + this.projects = new Resource$Projects(this); + this.regions = new Resource$Regions(this); + this.remarketingLists = new Resource$Remarketinglists(this); + this.remarketingListShares = new Resource$Remarketinglistshares(this); + this.reports = new Resource$Reports(this); + this.sites = new Resource$Sites(this); + this.sizes = new Resource$Sizes(this); + this.subaccounts = new Resource$Subaccounts(this); + this.targetableRemarketingLists = + new Resource$Targetableremarketinglists(this); + this.targetingTemplates = new Resource$Targetingtemplates(this); + this.userProfiles = new Resource$Userprofiles(this); + this.userRolePermissionGroups = + new Resource$Userrolepermissiongroups(this); + this.userRolePermissions = new Resource$Userrolepermissions(this); + this.userRoles = new Resource$Userroles(this); + this.videoFormats = new Resource$Videoformats(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Contains properties of a DCM account. + */ + export interface Schema$Account { + /** + * Account permissions assigned to this account. + */ + accountPermissionIds: string[]; + /** + * Profile for this account. This is a read-only field that can be left + * blank. + */ + accountProfile: string; + /** + * Whether this account is active. + */ + active: boolean; + /** + * Maximum number of active ads allowed for this account. + */ + activeAdsLimitTier: string; + /** + * Whether to serve creatives with Active View tags. If disabled, + * viewability data will not be available for any impressions. + */ + activeViewOptOut: boolean; + /** + * User role permissions available to the user roles of this account. + */ + availablePermissionIds: string[]; + /** + * ID of the country associated with this account. + */ + countryId: string; + /** + * ID of currency associated with this account. This is a required field. + * Acceptable values are: - "1" for USD - "2" for GBP + * - "3" for ESP - "4" for SEK - "5" for CAD + * - "6" for JPY - "7" for DEM - "8" for AUD + * - "9" for FRF - "10" for ITL - "11" for + * DKK - "12" for NOK - "13" for FIM - "14" + * for ZAR - "15" for IEP - "16" for NLG - + * "17" for EUR - "18" for KRW - "19" for + * TWD - "20" for SGD - "21" for CNY - "22" + * for HKD - "23" for NZD - "24" for MYR - + * "25" for BRL - "26" for PTE - "27" for + * MXP - "28" for CLP - "29" for TRY - "30" + * for ARS - "31" for PEN - "32" for ILS - + * "33" for CHF - "34" for VEF - "35" for + * COP - "36" for GTQ - "37" for PLN - "39" + * for INR - "40" for THB - "41" for IDR - + * "42" for CZK - "43" for RON - "44" for + * HUF - "45" for RUB - "46" for AED - "47" + * for BGN - "48" for HRK - "49" for MXN - + * "50" for NGN + */ + currencyId: string; + /** + * Default placement dimensions for this account. + */ + defaultCreativeSizeId: string; + /** + * Description of this account. + */ + description: string; + /** + * ID of this account. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#account". + */ + kind: string; + /** + * Locale of this account. Acceptable values are: - "cs" (Czech) + * - "de" (German) - "en" (English) - + * "en-GB" (English United Kingdom) - "es" (Spanish) - + * "fr" (French) - "it" (Italian) - "ja" + * (Japanese) - "ko" (Korean) - "pl" (Polish) - + * "pt-BR" (Portuguese Brazil) - "ru" (Russian) - + * "sv" (Swedish) - "tr" (Turkish) - "zh-CN" + * (Chinese Simplified) - "zh-TW" (Chinese Traditional) + */ + locale: string; + /** + * Maximum image size allowed for this account, in kilobytes. Value must be + * greater than or equal to 1. + */ + maximumImageSize: string; + /** + * Name of this account. This is a required field, and must be less than 128 + * characters long and be globally unique. + */ + name: string; + /** + * Whether campaigns created in this account will be enabled for Nielsen OCR + * reach ratings by default. + */ + nielsenOcrEnabled: boolean; + /** + * Reporting configuration of this account. + */ + reportsConfiguration: Schema$ReportsConfiguration; + /** + * Share Path to Conversion reports with Twitter. + */ + shareReportsWithTwitter: boolean; + /** + * File size limit in kilobytes of Rich Media teaser creatives. Acceptable + * values are 1 to 10240, inclusive. + */ + teaserSizeLimit: string; + } + /** + * Gets a summary of active ads in an account. + */ + export interface Schema$AccountActiveAdSummary { + /** + * ID of the account. + */ + accountId: string; + /** + * Ads that have been activated for the account + */ + activeAds: string; + /** + * Maximum number of active ads allowed for the account. + */ + activeAdsLimitTier: string; + /** + * Ads that can be activated for the account. + */ + availableAds: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountActiveAdSummary". + */ + kind: string; + } + /** + * AccountPermissions contains information about a particular account + * permission. Some features of DCM require an account permission to be + * present in the account. + */ + export interface Schema$AccountPermission { + /** + * Account profiles associated with this account permission. Possible + * values are: - "ACCOUNT_PROFILE_BASIC" - + * "ACCOUNT_PROFILE_STANDARD" + */ + accountProfiles: string[]; + /** + * ID of this account permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermission". + */ + kind: string; + /** + * Administrative level required to enable this account permission. + */ + level: string; + /** + * Name of this account permission. + */ + name: string; + /** + * Permission group of this account permission. + */ + permissionGroupId: string; + } + /** + * AccountPermissionGroups contains a mapping of permission group IDs to + * names. A permission group is a grouping of account permissions. + */ + export interface Schema$AccountPermissionGroup { + /** + * ID of this account permission group. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionGroup". + */ + kind: string; + /** + * Name of this account permission group. + */ + name: string; + } + /** + * Account Permission Group List Response + */ + export interface Schema$AccountPermissionGroupsListResponse { + /** + * Account permission group collection. + */ + accountPermissionGroups: Schema$AccountPermissionGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionGroupsListResponse". + */ + kind: string; + } + /** + * Account Permission List Response + */ + export interface Schema$AccountPermissionsListResponse { + /** + * Account permission collection. + */ + accountPermissions: Schema$AccountPermission[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionsListResponse". + */ + kind: string; + } + /** + * Account List Response + */ + export interface Schema$AccountsListResponse { + /** + * Account collection. + */ + accounts: Schema$Account[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * AccountUserProfiles contains properties of a DCM user profile. This + * resource is specifically for managing user profiles, whereas UserProfiles + * is for accessing the API. + */ + export interface Schema$AccountUserProfile { + /** + * Account ID of the user profile. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Whether this user profile is active. This defaults to false, and must be + * set true on insert for the user profile to be usable. + */ + active: boolean; + /** + * Filter that describes which advertisers are visible to the user profile. + */ + advertiserFilter: Schema$ObjectFilter; + /** + * Filter that describes which campaigns are visible to the user profile. + */ + campaignFilter: Schema$ObjectFilter; + /** + * Comments for this user profile. + */ + comments: string; + /** + * Email of the user profile. The email addresss must be linked to a Google + * Account. This field is required on insertion and is read-only after + * insertion. + */ + email: string; + /** + * ID of the user profile. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountUserProfile". + */ + kind: string; + /** + * Locale of the user profile. This is a required field. Acceptable values + * are: - "cs" (Czech) - "de" (German) - + * "en" (English) - "en-GB" (English United Kingdom) - + * "es" (Spanish) - "fr" (French) - "it" + * (Italian) - "ja" (Japanese) - "ko" (Korean) - + * "pl" (Polish) - "pt-BR" (Portuguese Brazil) - + * "ru" (Russian) - "sv" (Swedish) - "tr" + * (Turkish) - "zh-CN" (Chinese Simplified) - "zh-TW" + * (Chinese Traditional) + */ + locale: string; + /** + * Name of the user profile. This is a required field. Must be less than 64 + * characters long, must be globally unique, and cannot contain whitespace + * or any of the following characters: "&;"#%,". + */ + name: string; + /** + * Filter that describes which sites are visible to the user profile. + */ + siteFilter: Schema$ObjectFilter; + /** + * Subaccount ID of the user profile. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Trafficker type of this user profile. + */ + traffickerType: string; + /** + * User type of the user profile. This is a read-only field that can be left + * blank. + */ + userAccessType: string; + /** + * Filter that describes which user roles are visible to the user profile. + */ + userRoleFilter: Schema$ObjectFilter; + /** + * User role ID of the user profile. This is a required field. + */ + userRoleId: string; + } + /** + * Account User Profile List Response + */ + export interface Schema$AccountUserProfilesListResponse { + /** + * Account user profile collection. + */ + accountUserProfiles: Schema$AccountUserProfile[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountUserProfilesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Represents an activity group. + */ + export interface Schema$Activities { + /** + * List of activity filters. The dimension values need to be all either of + * type "dfa:activity" or "dfa:activityGroup". + */ + filters: Schema$DimensionValue[]; + /** + * The kind of resource this is, in this case dfareporting#activities. + */ + kind: string; + /** + * List of names of floodlight activity metrics. + */ + metricNames: string[]; + } + /** + * Contains properties of a DCM ad. + */ + export interface Schema$Ad { + /** + * Account ID of this ad. This is a read-only field that can be left blank. + */ + accountId: string; + /** + * Whether this ad is active. When true, archived must be false. + */ + active: boolean; + /** + * Advertiser ID of this ad. This is a required field on insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this ad is archived. When true, active must be false. + */ + archived: boolean; + /** + * Audience segment ID that is being targeted for this ad. Applicable when + * type is AD_SERVING_STANDARD_AD. + */ + audienceSegmentId: string; + /** + * Campaign ID of this ad. This is a required field on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Click-through URL for this ad. This is a required field on insertion. + * Applicable when type is AD_SERVING_CLICK_TRACKER. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Click-through URL suffix properties for this ad. Applies to the URL in + * the ad or (if overriding ad properties) the URL in the creative. + */ + clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; + /** + * Comments for this ad. + */ + comments: string; + /** + * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + * DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or + * on mobile devices or in mobile apps for regular or interstitial ads, + * respectively. APP and APP_INTERSTITIAL are only used for existing default + * ads. New mobile placements must be assigned DISPLAY or + * DISPLAY_INTERSTITIAL and default ads created for those placements will be + * limited to those compatibility types. IN_STREAM_VIDEO refers to rendering + * in-stream video ads developed with the VAST standard. + */ + compatibility: string; + /** + * Information about the creation of this ad. This is a read-only field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Creative group assignments for this ad. Applicable when type is + * AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number + * is allowed for a maximum of two assignments. + */ + creativeGroupAssignments: Schema$CreativeGroupAssignment[]; + /** + * Creative rotation for this ad. Applicable when type is + * AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. + * When type is AD_SERVING_DEFAULT_AD, this field should have exactly one + * creativeAssignment. + */ + creativeRotation: Schema$CreativeRotation; + /** + * Time and day targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + dayPartTargeting: Schema$DayPartTargeting; + /** + * Default click-through event tag properties for this ad. + */ + defaultClickThroughEventTagProperties: + Schema$DefaultClickThroughEventTagProperties; + /** + * Delivery schedule information for this ad. Applicable when type is + * AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with + * subfields priority and impressionRatio are required on insertion when + * type is AD_SERVING_STANDARD_AD. + */ + deliverySchedule: Schema$DeliverySchedule; + /** + * Whether this ad is a dynamic click tracker. Applicable when type is + * AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is + * read-only after insert. + */ + dynamicClickTracker: boolean; + /** + * Date and time that this ad should stop serving. Must be later than the + * start time. This is a required field on insertion. + */ + endTime: string; + /** + * Event tag overrides for this ad. + */ + eventTagOverrides: Schema$EventTagOverride[]; + /** + * Geographical targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + geoTargeting: Schema$GeoTargeting; + /** + * ID of this ad. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this ad. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key-value targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + keyValueTargetingExpression: Schema$KeyValueTargetingExpression; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#ad". + */ + kind: string; + /** + * Language targeting information for this ad. This field must be left blank + * if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + languageTargeting: Schema$LanguageTargeting; + /** + * Information about the most recent modification of this ad. This is a + * read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this ad. This is a required field and must be less than 256 + * characters long. + */ + name: string; + /** + * Placement assignments for this ad. + */ + placementAssignments: Schema$PlacementAssignment[]; + /** + * Remarketing list targeting expression for this ad. This field must be + * left blank if the ad is using a targeting template. Applicable when type + * is AD_SERVING_STANDARD_AD. + */ + remarketingListExpression: Schema$ListTargetingExpression; + /** + * Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + */ + size: Schema$Size; + /** + * Whether this ad is ssl compliant. This is a read-only field that is + * auto-generated when the ad is inserted or updated. + */ + sslCompliant: boolean; + /** + * Whether this ad requires ssl. This is a read-only field that is + * auto-generated when the ad is inserted or updated. + */ + sslRequired: boolean; + /** + * Date and time that this ad should start serving. If creating an ad, this + * field must be a time in the future. This is a required field on + * insertion. + */ + startTime: string; + /** + * Subaccount ID of this ad. This is a read-only field that can be left + * blank. + */ + subaccountId: string; + /** + * Targeting template ID, used to apply preconfigured targeting information + * to this ad. This cannot be set while any of dayPartTargeting, + * geoTargeting, keyValueTargetingExpression, languageTargeting, + * remarketingListExpression, or technologyTargeting are set. Applicable + * when type is AD_SERVING_STANDARD_AD. + */ + targetingTemplateId: string; + /** + * Technology platform targeting information for this ad. This field must be + * left blank if the ad is using a targeting template. Applicable when type + * is AD_SERVING_STANDARD_AD. + */ + technologyTargeting: Schema$TechnologyTargeting; + /** + * Type of ad. This is a required field on insertion. Note that default ads + * (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative + * resource). + */ + type: string; + } + /** + * Campaign ad blocking settings. + */ + export interface Schema$AdBlockingConfiguration { + /** + * Click-through URL used by brand-neutral ads. This is a required field + * when overrideClickThroughUrl is set to true. + */ + clickThroughUrl: string; + /** + * ID of a creative bundle to use for this campaign. If set, brand-neutral + * ads will select creatives from this bundle. Otherwise, a default + * transparent pixel will be used. + */ + creativeBundleId: string; + /** + * Whether this campaign has enabled ad blocking. When true, ad blocking is + * enabled for placements in the campaign, but this may be overridden by + * site and placement settings. When false, ad blocking is disabled for all + * placements under the campaign, regardless of site and placement settings. + */ + enabled: boolean; + /** + * Whether the brand-neutral ad's click-through URL comes from the + * campaign's creative bundle or the override URL. Must be set to true + * if ad blocking is enabled and no creative bundle is configured. + */ + overrideClickThroughUrl: boolean; + } + /** + * Ad List Response + */ + export interface Schema$AdsListResponse { + /** + * Ad collection. + */ + ads: Schema$Ad[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#adsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Ad Slot + */ + export interface Schema$AdSlot { + /** + * Comment for this ad slot. + */ + comment: string; + /** + * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to + * rendering either on desktop, mobile devices or in mobile apps for regular + * or interstitial ads respectively. APP and APP_INTERSTITIAL are for + * rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in + * in-stream video ads developed with the VAST standard. + */ + compatibility: string; + /** + * Height of this ad slot. + */ + height: string; + /** + * ID of the placement from an external platform that is linked to this ad + * slot. + */ + linkedPlacementId: string; + /** + * Name of this ad slot. + */ + name: string; + /** + * Payment source type of this ad slot. + */ + paymentSourceType: string; + /** + * Primary ad slot of a roadblock inventory item. + */ + primary: boolean; + /** + * Width of this ad slot. + */ + width: string; + } + /** + * Contains properties of a DCM advertiser. + */ + export interface Schema$Advertiser { + /** + * Account ID of this advertiser.This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * ID of the advertiser group this advertiser belongs to. You can group + * advertisers for reporting purposes, allowing you to see aggregated + * information for all advertisers in each group. + */ + advertiserGroupId: string; + /** + * Suffix added to click-through URL of ad creative associations under this + * advertiser. Must be less than 129 characters long. + */ + clickThroughUrlSuffix: string; + /** + * ID of the click-through event tag to apply by default to the landing + * pages of this advertiser's campaigns. + */ + defaultClickThroughEventTagId: string; + /** + * Default email address used in sender field for tag emails. + */ + defaultEmail: string; + /** + * Floodlight configuration ID of this advertiser. The floodlight + * configuration ID will be created automatically, so on insert this field + * should be left blank. This field can be set to another advertiser's + * floodlight configuration ID in order to share that advertiser's + * floodlight configuration with this advertiser, so long as: - This + * advertiser's original floodlight configuration is not already + * associated with floodlight activities or floodlight activity groups. - + * This advertiser's original floodlight configuration is not already + * shared with another advertiser. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * ID of this advertiser. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this advertiser. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiser". + */ + kind: string; + /** + * Name of this advertiser. This is a required field and must be less than + * 256 characters long and unique among advertisers of the same account. + */ + name: string; + /** + * Original floodlight configuration before any sharing occurred. Set the + * floodlightConfigurationId of this advertiser to + * originalFloodlightConfigurationId to unshare the advertiser's current + * floodlight configuration. You cannot unshare an advertiser's + * floodlight configuration if the shared configuration has activities + * associated with any campaign or placement. + */ + originalFloodlightConfigurationId: string; + /** + * Status of this advertiser. + */ + status: string; + /** + * Subaccount ID of this advertiser.This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Suspension status of this advertiser. + */ + suspended: boolean; + } + /** + * Groups advertisers together so that reports can be generated for the entire + * group at once. + */ + export interface Schema$AdvertiserGroup { + /** + * Account ID of this advertiser group. This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this advertiser group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiserGroup". + */ + kind: string; + /** + * Name of this advertiser group. This is a required field and must be less + * than 256 characters long and unique among advertiser groups of the same + * account. + */ + name: string; + } + /** + * Advertiser Group List Response + */ + export interface Schema$AdvertiserGroupsListResponse { + /** + * Advertiser group collection. + */ + advertiserGroups: Schema$AdvertiserGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiserGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Advertiser List Response + */ + export interface Schema$AdvertisersListResponse { + /** + * Advertiser collection. + */ + advertisers: Schema$Advertiser[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertisersListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Audience Segment. + */ + export interface Schema$AudienceSegment { + /** + * Weight allocated to this segment. The weight assigned will be understood + * in proportion to the weights assigned to other segments in the same + * segment group. Acceptable values are 1 to 1000, inclusive. + */ + allocation: number; + /** + * ID of this audience segment. This is a read-only, auto-generated field. + */ + id: string; + /** + * Name of this audience segment. This is a required field and must be less + * than 65 characters long. + */ + name: string; + } + /** + * Audience Segment Group. + */ + export interface Schema$AudienceSegmentGroup { + /** + * Audience segments assigned to this group. The number of segments must be + * between 2 and 100. + */ + audienceSegments: Schema$AudienceSegment[]; + /** + * ID of this audience segment group. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Name of this audience segment group. This is a required field and must be + * less than 65 characters long. + */ + name: string; + } + /** + * Contains information about a browser that can be targeted by ads. + */ + export interface Schema$Browser { + /** + * ID referring to this grouping of browser and version numbers. This is the + * ID used for targeting. + */ + browserVersionId: string; + /** + * DART ID of this browser. This is the ID used when generating reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#browser". + */ + kind: string; + /** + * Major version number (leftmost number) of this browser. For example, for + * Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) + * may be used to target any version number, and a question mark (?) may be + * used to target cases where the version number cannot be identified. For + * example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so + * on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets + * cases where the ad server knows the browser is Firefox but can't tell + * which version it is. + */ + majorVersion: string; + /** + * Minor version number (number after first dot on left) of this browser. + * For example, for Chrome 5.0.375.86 beta, this field should be set to 0. + * An asterisk (*) may be used to target any version number, and a question + * mark (?) may be used to target cases where the version number cannot be + * identified. For example, Chrome *.* targets any version of Chrome: + * 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but + * not 4.0. Firefox ?.? targets cases where the ad server knows the browser + * is Firefox but can't tell which version it is. + */ + minorVersion: string; + /** + * Name of this browser. + */ + name: string; + } + /** + * Browser List Response + */ + export interface Schema$BrowsersListResponse { + /** + * Browser collection. + */ + browsers: Schema$Browser[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#browsersListResponse". + */ + kind: string; + } + /** + * Contains properties of a DCM campaign. + */ + export interface Schema$Campaign { + /** + * Account ID of this campaign. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Ad blocking settings for this campaign. + */ + adBlockingConfiguration: Schema$AdBlockingConfiguration; + /** + * Additional creative optimization configurations for the campaign. + */ + additionalCreativeOptimizationConfigurations: + Schema$CreativeOptimizationConfiguration[]; + /** + * Advertiser group ID of the associated advertiser. + */ + advertiserGroupId: string; + /** + * Advertiser ID of this campaign. This is a required field. + */ + advertiserId: string; + /** + * Dimension value for the advertiser ID of this campaign. This is a + * read-only, auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this campaign has been archived. + */ + archived: boolean; + /** + * Audience segment groups assigned to this campaign. Cannot have more than + * 300 segment groups. + */ + audienceSegmentGroups: Schema$AudienceSegmentGroup[]; + /** + * Billing invoice code included in the DCM client billing invoices + * associated with the campaign. + */ + billingInvoiceCode: string; + /** + * Click-through URL suffix override properties for this campaign. + */ + clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; + /** + * Arbitrary comments about this campaign. Must be less than 256 characters + * long. + */ + comment: string; + /** + * Information about the creation of this campaign. This is a read-only + * field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * List of creative group IDs that are assigned to the campaign. + */ + creativeGroupIds: string[]; + /** + * Creative optimization configuration for the campaign. + */ + creativeOptimizationConfiguration: Schema$CreativeOptimizationConfiguration; + /** + * Click-through event tag ID override properties for this campaign. + */ + defaultClickThroughEventTagProperties: + Schema$DefaultClickThroughEventTagProperties; + /** + * Date on which the campaign will stop running. On insert, the end date + * must be today or a future date. The end date must be later than or be the + * same as the start date. If, for example, you set 6/25/2015 as both the + * start and end dates, the effective campaign run date is just that day + * only, 6/25/2015. The hours, minutes, and seconds of the end date should + * not be set, as doing so will result in an error. This is a required + * field. + */ + endDate: string; + /** + * Overrides that can be used to activate or deactivate advertiser event + * tags. + */ + eventTagOverrides: Schema$EventTagOverride[]; + /** + * External ID for this campaign. + */ + externalId: string; + /** + * ID of this campaign. This is a read-only auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this campaign. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaign". + */ + kind: string; + /** + * Information about the most recent modification of this campaign. This is + * a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Lookback window settings for the campaign. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Name of this campaign. This is a required field and must be less than 256 + * characters long and unique among campaigns of the same advertiser. + */ + name: string; + /** + * Whether Nielsen reports are enabled for this campaign. + */ + nielsenOcrEnabled: boolean; + /** + * Date on which the campaign starts running. The start date can be any + * date. The hours, minutes, and seconds of the start date should not be + * set, as doing so will result in an error. This is a required field. + */ + startDate: string; + /** + * Subaccount ID of this campaign. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Campaign trafficker contact emails. + */ + traffickerEmails: string[]; + } + /** + * Identifies a creative which has been associated with a given campaign. + */ + export interface Schema$CampaignCreativeAssociation { + /** + * ID of the creative associated with the campaign. This is a required + * field. + */ + creativeId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignCreativeAssociation". + */ + kind: string; + } + /** + * Campaign Creative Association List Response + */ + export interface Schema$CampaignCreativeAssociationsListResponse { + /** + * Campaign creative association collection + */ + campaignCreativeAssociations: Schema$CampaignCreativeAssociation[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignCreativeAssociationsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Campaign List Response + */ + export interface Schema$CampaignsListResponse { + /** + * Campaign collection. + */ + campaigns: Schema$Campaign[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Describes a change that a user has made to a resource. + */ + export interface Schema$ChangeLog { + /** + * Account ID of the modified object. + */ + accountId: string; + /** + * Action which caused the change. + */ + action: string; + /** + * Time when the object was modified. + */ + changeTime: string; + /** + * Field name of the object which changed. + */ + fieldName: string; + /** + * ID of this change log. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#changeLog". + */ + kind: string; + /** + * New value of the object field. + */ + newValue: string; + /** + * ID of the object of this change log. The object could be a campaign, + * placement, ad, or other type. + */ + objectId: string; + /** + * Object type of the change log. + */ + objectType: string; + /** + * Old value of the object field. + */ + oldValue: string; + /** + * Subaccount ID of the modified object. + */ + subaccountId: string; + /** + * Transaction ID of this change log. When a single API call results in many + * changes, each change will have a separate ID in the change log but will + * share the same transactionId. + */ + transactionId: string; + /** + * ID of the user who modified the object. + */ + userProfileId: string; + /** + * User profile name of the user who modified the object. + */ + userProfileName: string; + } + /** + * Change Log List Response + */ + export interface Schema$ChangeLogsListResponse { + /** + * Change log collection. + */ + changeLogs: Schema$ChangeLog[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#changeLogsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * City List Response + */ + export interface Schema$CitiesListResponse { + /** + * City collection. + */ + cities: Schema$City[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#citiesListResponse". + */ + kind: string; + } + /** + * Contains information about a city that can be targeted by ads. + */ + export interface Schema$City { + /** + * Country code of the country to which this city belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this city belongs. + */ + countryDartId: string; + /** + * DART ID of this city. This is the ID used for targeting and generating + * reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#city". + */ + kind: string; + /** + * Metro region code of the metro region (DMA) to which this city belongs. + */ + metroCode: string; + /** + * ID of the metro region (DMA) to which this city belongs. + */ + metroDmaId: string; + /** + * Name of this city. + */ + name: string; + /** + * Region code of the region to which this city belongs. + */ + regionCode: string; + /** + * DART ID of the region to which this city belongs. + */ + regionDartId: string; + } + /** + * Creative Click Tag. + */ + export interface Schema$ClickTag { + /** + * Advertiser event name associated with the click tag. This field is used + * by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + eventName: string; + /** + * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY + * creative assets, this field must match the value of the creative + * asset's creativeAssetId.name field. + */ + name: string; + /** + * Parameter value for the specified click tag. This field contains a + * click-through url. + */ + value: string; + } + /** + * Click-through URL + */ + export interface Schema$ClickThroughUrl { + /** + * Read-only convenience field representing the actual URL that will be used + * for this click-through. The URL is computed as follows: - If + * defaultLandingPage is enabled then the campaign's default landing + * page URL is assigned to this field. - If defaultLandingPage is not + * enabled and a landingPageId is specified then that landing page's URL + * is assigned to this field. - If neither of the above cases apply, then + * the customClickThroughUrl is assigned to this field. + */ + computedClickThroughUrl: string; + /** + * Custom click-through URL. Applicable if the defaultLandingPage field is + * set to false and the landingPageId field is left unset. + */ + customClickThroughUrl: string; + /** + * Whether the campaign default landing page is used. + */ + defaultLandingPage: boolean; + /** + * ID of the landing page for the click-through URL. Applicable if the + * defaultLandingPage field is set to false. + */ + landingPageId: string; + } + /** + * Click Through URL Suffix settings. + */ + export interface Schema$ClickThroughUrlSuffixProperties { + /** + * Click-through URL suffix to apply to all ads in this entity's scope. + * Must be less than 128 characters long. + */ + clickThroughUrlSuffix: string; + /** + * Whether this entity should override the inherited click-through URL + * suffix with its own defined value. + */ + overrideInheritedSuffix: boolean; + } + /** + * Companion Click-through override. + */ + export interface Schema$CompanionClickThroughOverride { + /** + * Click-through URL of this companion click-through override. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * ID of the creative for this companion click-through override. + */ + creativeId: string; + } + /** + * Companion Settings + */ + export interface Schema$CompanionSetting { + /** + * Whether companions are disabled for this placement. + */ + companionsDisabled: boolean; + /** + * Whitelist of companion sizes to be served to this placement. Set this + * list to null or empty to serve all companion sizes. + */ + enabledSizes: Schema$Size[]; + /** + * Whether to serve only static images as companions. + */ + imageOnly: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#companionSetting". + */ + kind: string; + } + /** + * Represents a response to the queryCompatibleFields method. + */ + export interface Schema$CompatibleFields { + /** + * Contains items that are compatible to be selected for a report of type + * "CROSS_DIMENSION_REACH". + */ + crossDimensionReachReportCompatibleFields: + Schema$CrossDimensionReachReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "FLOODLIGHT". + */ + floodlightReportCompatibleFields: Schema$FloodlightReportCompatibleFields; + /** + * The kind of resource this is, in this case dfareporting#compatibleFields. + */ + kind: string; + /** + * Contains items that are compatible to be selected for a report of type + * "PATH_TO_CONVERSION". + */ + pathToConversionReportCompatibleFields: + Schema$PathToConversionReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "REACH". + */ + reachReportCompatibleFields: Schema$ReachReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "STANDARD". + */ + reportCompatibleFields: Schema$ReportCompatibleFields; + } + /** + * Contains information about an internet connection type that can be targeted + * by ads. Clients can use the connection type to target mobile vs. broadband + * users. + */ + export interface Schema$ConnectionType { + /** + * ID of this connection type. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#connectionType". + */ + kind: string; + /** + * Name of this connection type. + */ + name: string; + } + /** + * Connection Type List Response + */ + export interface Schema$ConnectionTypesListResponse { + /** + * Collection of connection types such as broadband and mobile. + */ + connectionTypes: Schema$ConnectionType[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#connectionTypesListResponse". + */ + kind: string; + } + /** + * Content Category List Response + */ + export interface Schema$ContentCategoriesListResponse { + /** + * Content category collection. + */ + contentCategories: Schema$ContentCategory[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#contentCategoriesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Organizes placements according to the contents of their associated + * webpages. + */ + export interface Schema$ContentCategory { + /** + * Account ID of this content category. This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this content category. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#contentCategory". + */ + kind: string; + /** + * Name of this content category. This is a required field and must be less + * than 256 characters long and unique among content categories of the same + * account. + */ + name: string; + } + /** + * A Conversion represents when a user successfully performs a desired action + * after seeing an ad. + */ + export interface Schema$Conversion { + /** + * Whether the conversion was directed toward children. + */ + childDirectedTreatment: boolean; + /** + * Custom floodlight variables. + */ + customVariables: Schema$CustomFloodlightVariable[]; + /** + * The alphanumeric encrypted user ID. When set, encryptionInfo should also + * be specified. This field is mutually exclusive with + * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or + * encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required + * field. + */ + encryptedUserId: string; + /** + * A list of the alphanumeric encrypted user IDs. Any user ID with exposure + * prior to the conversion timestamp will be used in the inserted + * conversion. If no such user ID is found then the conversion will be + * rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo + * should also be specified. This field may only be used when calling + * batchinsert; it is not supported by batchupdate. This field is mutually + * exclusive with encryptedUserId, mobileDeviceId and gclid. This or + * encryptedUserId or mobileDeviceId or gclid is a required field. + */ + encryptedUserIdCandidates: string[]; + /** + * Floodlight Activity ID of this conversion. This is a required field. + */ + floodlightActivityId: string; + /** + * Floodlight Configuration ID of this conversion. This is a required field. + */ + floodlightConfigurationId: string; + /** + * The Google click ID. This field is mutually exclusive with + * encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or + * encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId is a + * required field. + */ + gclid: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversion". + */ + kind: string; + /** + * Whether Limit Ad Tracking is enabled. When set to true, the conversion + * will be used for reporting but not targeting. This will prevent + * remarketing. + */ + limitAdTracking: boolean; + /** + * The mobile device ID. This field is mutually exclusive with + * encryptedUserId, encryptedUserIdCandidates[] and gclid. This or + * encryptedUserId or encryptedUserIdCandidates[] or gclid is a required + * field. + */ + mobileDeviceId: string; + /** + * The ordinal of the conversion. Use this field to control how conversions + * of the same user and day are de-duplicated. This is a required field. + */ + ordinal: string; + /** + * The quantity of the conversion. + */ + quantity: string; + /** + * The timestamp of conversion, in Unix epoch micros. This is a required + * field. + */ + timestampMicros: string; + /** + * The value of the conversion. + */ + value: number; + } + /** + * The error code and description for a conversion that failed to insert or + * update. + */ + export interface Schema$ConversionError { + /** + * The error code. + */ + code: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionError". + */ + kind: string; + /** + * A description of the error. + */ + message: string; + } + /** + * Insert Conversions Request. + */ + export interface Schema$ConversionsBatchInsertRequest { + /** + * The set of conversions to insert. + */ + conversions: Schema$Conversion[]; + /** + * Describes how encryptedUserId or encryptedUserIdCandidates[] is + * encrypted. This is a required field if encryptedUserId or + * encryptedUserIdCandidates[] is used. + */ + encryptionInfo: Schema$EncryptionInfo; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchInsertRequest". + */ + kind: string; + } + /** + * Insert Conversions Response. + */ + export interface Schema$ConversionsBatchInsertResponse { + /** + * Indicates that some or all conversions failed to insert. + */ + hasFailures: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchInsertResponse". + */ + kind: string; + /** + * The insert status of each conversion. Statuses are returned in the same + * order that conversions are inserted. + */ + status: Schema$ConversionStatus[]; + } + /** + * Update Conversions Request. + */ + export interface Schema$ConversionsBatchUpdateRequest { + /** + * The set of conversions to update. + */ + conversions: Schema$Conversion[]; + /** + * Describes how encryptedUserId is encrypted. This is a required field if + * encryptedUserId is used. + */ + encryptionInfo: Schema$EncryptionInfo; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchUpdateRequest". + */ + kind: string; + } + /** + * Update Conversions Response. + */ + export interface Schema$ConversionsBatchUpdateResponse { + /** + * Indicates that some or all conversions failed to update. + */ + hasFailures: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchUpdateResponse". + */ + kind: string; + /** + * The update status of each conversion. Statuses are returned in the same + * order that conversions are updated. + */ + status: Schema$ConversionStatus[]; + } + /** + * The original conversion that was inserted or updated and whether there were + * any errors. + */ + export interface Schema$ConversionStatus { + /** + * The original conversion that was inserted or updated. + */ + conversion: Schema$Conversion; + /** + * A list of errors related to this conversion. + */ + errors: Schema$ConversionError[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionStatus". + */ + kind: string; + } + /** + * Country List Response + */ + export interface Schema$CountriesListResponse { + /** + * Country collection. + */ + countries: Schema$Country[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#countriesListResponse". + */ + kind: string; + } + /** + * Contains information about a country that can be targeted by ads. + */ + export interface Schema$Country { + /** + * Country code. + */ + countryCode: string; + /** + * DART ID of this country. This is the ID used for targeting and generating + * reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#country". + */ + kind: string; + /** + * Name of this country. + */ + name: string; + /** + * Whether ad serving supports secure servers in this country. + */ + sslEnabled: boolean; + } + /** + * Contains properties of a Creative. + */ + export interface Schema$Creative { + /** + * Account ID of this creative. This field, if left unset, will be + * auto-generated for both insert and update operations. Applicable to all + * creative types. + */ + accountId: string; + /** + * Whether the creative is active. Applicable to all creative types. + */ + active: boolean; + /** + * Ad parameters user for VPAID creative. This is a read-only field. + * Applicable to the following creative types: all VPAID. + */ + adParameters: string; + /** + * Keywords for a Rich Media creative. Keywords let you customize the + * creative settings of a Rich Media ad running on your site without having + * to contact the advertiser. You can use keywords to dynamically change the + * look or functionality of a creative. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + adTagKeys: string[]; + /** + * Advertiser ID of this creative. This is a required field. Applicable to + * all creative types. + */ + advertiserId: string; + /** + * Whether script access is allowed for this creative. This is a read-only + * and deprecated field which will automatically be set to true on update. + * Applicable to the following creative types: FLASH_INPAGE. + */ + allowScriptAccess: boolean; + /** + * Whether the creative is archived. Applicable to all creative types. + */ + archived: boolean; + /** + * Type of artwork used for the creative. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA, and all + * VPAID. + */ + artworkType: string; + /** + * Source application where creative was authored. Presently, only DBM + * authored creatives will have this field set. Applicable to all creative + * types. + */ + authoringSource: string; + /** + * Authoring tool for HTML5 banner creatives. This is a read-only field. + * Applicable to the following creative types: HTML5_BANNER. + */ + authoringTool: string; + /** + * Whether images are automatically advanced for image gallery creatives. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. + */ + autoAdvanceImages: boolean; + /** + * The 6-character HTML color code, beginning with #, for the background of + * the window area where the Flash file is displayed. Default is white. + * Applicable to the following creative types: FLASH_INPAGE. + */ + backgroundColor: string; + /** + * Click-through URL for backup image. Applicable to the following creative + * types: FLASH_INPAGE, and HTML5_BANNER. Applicable to DISPLAY when the + * primary asset type is not HTML_IMAGE. + */ + backupImageClickThroughUrl: string; + /** + * List of feature dependencies that will cause a backup image to be served + * if the browser that serves the ad does not support them. Feature + * dependencies are features that a browser must be able to support in order + * to render your HTML5 creative asset correctly. This field is initially + * auto-generated to contain all features detected by DCM for all the assets + * of this creative and can then be modified by the client. To reset this + * field, copy over all the creativeAssets' detected features. + * Applicable to the following creative types: HTML5_BANNER. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + backupImageFeatures: string[]; + /** + * Reporting label used for HTML5 banner backup image. Applicable to the + * following creative types: DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + backupImageReportingLabel: string; + /** + * Target window for backup image. Applicable to the following creative + * types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the + * primary asset type is not HTML_IMAGE. + */ + backupImageTargetWindow: Schema$TargetWindow; + /** + * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER + * creatives, this is a subset of detected click tags for the assets + * associated with this creative. After creating a flash asset, detected + * click tags will be returned in the creativeAssetMetadata. When inserting + * the creative, populate the creative clickTags field using the + * creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY + * creatives, there should be exactly one entry in this list for each image + * creative asset. A click tag is matched with a corresponding creative + * asset by matching the clickTag.name field with the + * creativeAsset.assetIdentifier.name field. Applicable to the following + * creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + clickTags: Schema$ClickTag[]; + /** + * Industry standard ID assigned to creative for reach and frequency. + * Applicable to INSTREAM_VIDEO_REDIRECT creatives. + */ + commercialId: string; + /** + * List of companion creatives assigned to an in-Stream videocreative. + * Acceptable values include IDs of existing flash and image creatives. + * Applicable to the following creative types: all VPAID and all + * INSTREAM_VIDEO with dynamicAssetSelection set to false. + */ + companionCreatives: string[]; + /** + * Compatibilities associated with this creative. This is a read-only field. + * DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or + * on mobile devices or in mobile apps for regular or interstitial ads, + * respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. + * Only pre-existing creatives may have these compatibilities since new + * creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL + * instead. IN_STREAM_VIDEO refers to rendering in in-stream video ads + * developed with the VAST standard. Applicable to all creative types. + * Acceptable values are: - "APP" - "APP_INTERSTITIAL" - + * "IN_STREAM_VIDEO" - "DISPLAY" - + * "DISPLAY_INTERSTITIAL" + */ + compatibility: string[]; + /** + * Whether Flash assets associated with the creative need to be + * automatically converted to HTML5. This flag is enabled by default and + * users can choose to disable it if they don't want the system to + * generate and use HTML5 asset for this creative. Applicable to the + * following creative type: FLASH_INPAGE. Applicable to DISPLAY when the + * primary asset type is not HTML_IMAGE. + */ + convertFlashToHtml5: boolean; + /** + * List of counter events configured for the creative. For + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. + */ + counterCustomEvents: Schema$CreativeCustomEvent[]; + /** + * Assets associated with a creative. Applicable to all but the following + * creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and + * REDIRECT + */ + creativeAssets: Schema$CreativeAsset[]; + /** + * Required if dynamicAssetSelection is true. + */ + creativeAssetSelection: Schema$CreativeAssetSelection; + /** + * Creative field assignments for this creative. Applicable to all creative + * types. + */ + creativeFieldAssignments: Schema$CreativeFieldAssignment[]; + /** + * Custom key-values for a Rich Media creative. Key-values let you customize + * the creative settings of a Rich Media ad running on your site without + * having to contact the advertiser. You can use key-values to dynamically + * change the look or functionality of a creative. Applicable to the + * following creative types: all RICH_MEDIA, and all VPAID. + */ + customKeyValues: string[]; + /** + * Set this to true to enable the use of rules to target individual assets + * in this creative. When set to true creativeAssetSelection must be set. + * This also controls asset-level companions. When this is true, companion + * creatives should be assigned to creative assets. Learn more. Applicable + * to INSTREAM_VIDEO creatives. + */ + dynamicAssetSelection: boolean; + /** + * List of exit events configured for the creative. For DISPLAY and + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags, For DISPLAY, an event is also created from the + * backupImageReportingLabel. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + exitCustomEvents: Schema$CreativeCustomEvent[]; + /** + * OpenWindow FSCommand of this creative. This lets the SWF file communicate + * with either Flash Player or the program hosting Flash Player, such as a + * web browser. This is only triggered if allowScriptAccess field is true. + * Applicable to the following creative types: FLASH_INPAGE. + */ + fsCommand: Schema$FsCommand; + /** + * HTML code for the creative. This is a required field when applicable. + * This field is ignored if htmlCodeLocked is true. Applicable to the + * following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and + * all RICH_MEDIA. + */ + htmlCode: string; + /** + * Whether HTML code is DCM-generated or manually entered. Set to true to + * ignore changes to htmlCode. Applicable to the following creative types: + * FLASH_INPAGE and HTML5_BANNER. + */ + htmlCodeLocked: boolean; + /** + * ID of this creative. This is a read-only, auto-generated field. + * Applicable to all creative types. + */ + id: string; + /** + * Dimension value for the ID of this creative. This is a read-only field. + * Applicable to all creative types. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creative". + */ + kind: string; + /** + * Creative last modification information. This is a read-only field. + * Applicable to all creative types. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Latest Studio trafficked creative ID associated with rich media and VPAID + * creatives. This is a read-only field. Applicable to the following + * creative types: all RICH_MEDIA, and all VPAID. + */ + latestTraffickedCreativeId: string; + /** + * Name of the creative. This is a required field and must be less than 256 + * characters long. Applicable to all creative types. + */ + name: string; + /** + * Override CSS value for rich media creatives. Applicable to the following + * creative types: all RICH_MEDIA. + */ + overrideCss: string; + /** + * Amount of time to play the video before counting a view. Applicable to + * the following creative types: all INSTREAM_VIDEO. + */ + progressOffset: Schema$VideoOffset; + /** + * URL of hosted image or hosted video or another ad tag. For + * INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect + * URL. The standard for a VAST (Video Ad Serving Template) ad response + * allows for a redirect link to another VAST 2.0 or 3.0 call. This is a + * required field when applicable. Applicable to the following creative + * types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, + * INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT + */ + redirectUrl: string; + /** + * ID of current rendering version. This is a read-only field. Applicable to + * all creative types. + */ + renderingId: string; + /** + * Dimension value for the rendering ID of this creative. This is a + * read-only field. Applicable to all creative types. + */ + renderingIdDimensionValue: Schema$DimensionValue; + /** + * The minimum required Flash plugin version for this creative. For + * example, 11.2.202.235. This is a read-only field. Applicable to the + * following creative types: all RICH_MEDIA, and all VPAID. + */ + requiredFlashPluginVersion: string; + /** + * The internal Flash version for this creative as calculated by DoubleClick + * Studio. This is a read-only field. Applicable to the following creative + * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY + * when the primary asset type is not HTML_IMAGE. + */ + requiredFlashVersion: number; + /** + * Size associated with this creative. When inserting or updating a creative + * either the size ID field or size width and height fields can be used. + * This is a required field when applicable; however for IMAGE, FLASH_INPAGE + * creatives, and for DISPLAY creatives with a primary asset of type + * HTML_IMAGE, if left blank, this field will be automatically set using the + * actual size of the associated image assets. Applicable to the following + * creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, + * HTML5_BANNER, IMAGE, and all RICH_MEDIA. + */ + size: Schema$Size; + /** + * Amount of time to play the video before the skip button appears. + * Applicable to the following creative types: all INSTREAM_VIDEO. + */ + skipOffset: Schema$VideoOffset; + /** + * Whether the user can choose to skip the creative. Applicable to the + * following creative types: all INSTREAM_VIDEO and all VPAID. + */ + skippable: boolean; + /** + * Whether the creative is SSL-compliant. This is a read-only field. + * Applicable to all creative types. + */ + sslCompliant: boolean; + /** + * Whether creative should be treated as SSL compliant even if the system + * scan shows it's not. Applicable to all creative types. + */ + sslOverride: boolean; + /** + * Studio advertiser ID associated with rich media and VPAID creatives. This + * is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioAdvertiserId: string; + /** + * Studio creative ID associated with rich media and VPAID creatives. This + * is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioCreativeId: string; + /** + * Studio trafficked creative ID associated with rich media and VPAID + * creatives. This is a read-only field. Applicable to the following + * creative types: all RICH_MEDIA, and all VPAID. + */ + studioTraffickedCreativeId: string; + /** + * Subaccount ID of this creative. This field, if left unset, will be + * auto-generated for both insert and update operations. Applicable to all + * creative types. + */ + subaccountId: string; + /** + * Third-party URL used to record backup image impressions. Applicable to + * the following creative types: all RICH_MEDIA. + */ + thirdPartyBackupImageImpressionsUrl: string; + /** + * Third-party URL used to record rich media impressions. Applicable to the + * following creative types: all RICH_MEDIA. + */ + thirdPartyRichMediaImpressionsUrl: string; + /** + * Third-party URLs for tracking in-stream video creative events. Applicable + * to the following creative types: all INSTREAM_VIDEO and all VPAID. + */ + thirdPartyUrls: Schema$ThirdPartyTrackingUrl[]; + /** + * List of timer events configured for the creative. For + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to + * DISPLAY when the primary asset is not HTML_IMAGE. + */ + timerCustomEvents: Schema$CreativeCustomEvent[]; + /** + * Combined size of all creative assets. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA, and all + * VPAID. + */ + totalFileSize: string; + /** + * Type of this creative. This is a required field. Applicable to all + * creative types. Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only + * used for existing creatives. New creatives should use DISPLAY as a + * replacement for these types. + */ + type: string; + /** + * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following + * creative types: INSTREAM_VIDEO and VPAID. + */ + universalAdId: Schema$UniversalAdId; + /** + * The version number helps you keep track of multiple versions of your + * creative in your reports. The version number will always be + * auto-generated during insert operations to start at 1. For tracking + * creatives the version cannot be incremented and will always remain at 1. + * For all other creative types the version can be incremented only by 1 + * during update operations. In addition, the version will be automatically + * incremented by 1 when undergoing Rich Media creative merging. Applicable + * to all creative types. + */ + version: number; + /** + * Description of the video ad. Applicable to the following creative types: + * all INSTREAM_VIDEO and all VPAID. + */ + videoDescription: string; + /** + * Creative video duration in seconds. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all + * VPAID. + */ + videoDuration: number; + } + /** + * Creative Asset. + */ + export interface Schema$CreativeAsset { + /** + * Whether ActionScript3 is enabled for the flash asset. This is a read-only + * field. Applicable to the following creative type: FLASH_INPAGE. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + actionScript3: boolean; + /** + * Whether the video asset is active. This is a read-only field for + * VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative + * types: INSTREAM_VIDEO and all VPAID. + */ + active: boolean; + /** + * Possible alignments for an asset. This is a read-only field. Applicable + * to the following creative types: + * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. + */ + alignment: string; + /** + * Artwork type of rich media creative. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + artworkType: string; + /** + * Identifier of this asset. This is the same identifier returned during + * creative asset insert operation. This is a required field. Applicable to + * all but the following creative types: all REDIRECT and TRACKING_TEXT. + */ + assetIdentifier: Schema$CreativeAssetId; + /** + * Exit event configured for the backup image. Applicable to the following + * creative types: all RICH_MEDIA. + */ + backupImageExit: Schema$CreativeCustomEvent; + /** + * Detected bit-rate for video asset. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + bitRate: number; + /** + * Rich media child asset type. This is a read-only field. Applicable to the + * following creative types: all VPAID. + */ + childAssetType: string; + /** + * Size of an asset when collapsed. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA and all VPAID. Additionally, + * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or + * ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + collapsedSize: Schema$Size; + /** + * List of companion creatives assigned to an in-stream video creative + * asset. Acceptable values include IDs of existing flash and image + * creatives. Applicable to INSTREAM_VIDEO creative type with + * dynamicAssetSelection set to true. + */ + companionCreativeIds: string[]; + /** + * Custom start time in seconds for making the asset visible. Applicable to + * the following creative types: all RICH_MEDIA. Value must be greater than + * or equal to 0. + */ + customStartTimeValue: number; + /** + * List of feature dependencies for the creative asset that are detected by + * DCM. Feature dependencies are features that a browser must be able to + * support in order to render your HTML5 creative correctly. This is a + * read-only, auto-generated field. Applicable to the following creative + * types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is + * not HTML_IMAGE. + */ + detectedFeatures: string[]; + /** + * Type of rich media asset. This is a read-only field. Applicable to the + * following creative types: all RICH_MEDIA. + */ + displayType: string; + /** + * Duration in seconds for which an asset will be displayed. Applicable to + * the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. + * Value must be greater than or equal to 1. + */ + duration: number; + /** + * Duration type for which an asset will be displayed. Applicable to the + * following creative types: all RICH_MEDIA. + */ + durationType: string; + /** + * Detected expanded dimension for video asset. This is a read-only field. + * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + expandedDimension: Schema$Size; + /** + * File size associated with this creative asset. This is a read-only field. + * Applicable to all but the following creative types: all REDIRECT and + * TRACKING_TEXT. + */ + fileSize: string; + /** + * Flash version of the asset. This is a read-only field. Applicable to the + * following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + flashVersion: number; + /** + * Whether to hide Flash objects flag for an asset. Applicable to the + * following creative types: all RICH_MEDIA. + */ + hideFlashObjects: boolean; + /** + * Whether to hide selection boxes flag for an asset. Applicable to the + * following creative types: all RICH_MEDIA. + */ + hideSelectionBoxes: boolean; + /** + * Whether the asset is horizontally locked. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + horizontallyLocked: boolean; + /** + * Numeric ID of this creative asset. This is a required field and should + * not be modified. Applicable to all but the following creative types: all + * REDIRECT and TRACKING_TEXT. + */ + id: string; + /** + * Dimension value for the ID of the asset. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Detected MIME type for video asset. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + mimeType: string; + /** + * Offset position for an asset in collapsed mode. This is a read-only + * field. Applicable to the following creative types: all RICH_MEDIA and all + * VPAID. Additionally, only applicable to assets whose displayType is + * ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + offset: Schema$OffsetPosition; + /** + * Whether the backup asset is original or changed by the user in DCM. + * Applicable to the following creative types: all RICH_MEDIA. + */ + originalBackup: boolean; + /** + * Offset position for an asset. Applicable to the following creative types: + * all RICH_MEDIA. + */ + position: Schema$OffsetPosition; + /** + * Offset left unit for an asset. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA. + */ + positionLeftUnit: string; + /** + * Offset top unit for an asset. This is a read-only field if the asset + * displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following + * creative types: all RICH_MEDIA. + */ + positionTopUnit: string; + /** + * Progressive URL for video asset. This is a read-only field. Applicable to + * the following creative types: INSTREAM_VIDEO and all VPAID. + */ + progressiveServingUrl: string; + /** + * Whether the asset pushes down other content. Applicable to the following + * creative types: all RICH_MEDIA. Additionally, only applicable when the + * asset offsets are 0, the collapsedSize.width matches size.width, and the + * collapsedSize.height is less than size.height. + */ + pushdown: boolean; + /** + * Pushdown duration in seconds for an asset. Applicable to the following + * creative types: all RICH_MEDIA.Additionally, only applicable when the + * asset pushdown field is true, the offsets are 0, the collapsedSize.width + * matches size.width, and the collapsedSize.height is less than + * size.height. Acceptable values are 0 to 9.99, inclusive. + */ + pushdownDuration: number; + /** + * Role of the asset in relation to creative. Applicable to all but the + * following creative types: all REDIRECT and TRACKING_TEXT. This is a + * required field. PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, + * IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple + * primary assets), and all VPAID creatives. BACKUP_IMAGE applies to + * FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. + * OTHER refers to assets from sources other than DCM, such as Studio + * uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives. + * PARENT_VIDEO refers to videos uploaded by the user in DCM and is + * applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO + * assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO + * creatives. ALTERNATE_VIDEO refers to the DCM representation of child + * asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO + * creatives. These cannot be added or removed within DCM. For + * VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and + * ALTERNATE_VIDEO assets that are marked active serve as backup in case the + * VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or + * removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. + */ + role: string; + /** + * Size associated with this creative asset. This is a required field when + * applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, + * this field will be automatically set using the actual size of the + * associated image asset. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all + * RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + size: Schema$Size; + /** + * Whether the asset is SSL-compliant. This is a read-only field. Applicable + * to all but the following creative types: all REDIRECT and TRACKING_TEXT. + */ + sslCompliant: boolean; + /** + * Initial wait time type before making the asset visible. Applicable to the + * following creative types: all RICH_MEDIA. + */ + startTimeType: string; + /** + * Streaming URL for video asset. This is a read-only field. Applicable to + * the following creative types: INSTREAM_VIDEO and all VPAID. + */ + streamingServingUrl: string; + /** + * Whether the asset is transparent. Applicable to the following creative + * types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. + */ + transparency: boolean; + /** + * Whether the asset is vertically locked. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + verticallyLocked: boolean; + /** + * Detected video duration for video asset. This is a read-only field. + * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + videoDuration: number; + /** + * Window mode options for flash assets. Applicable to the following + * creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, + * RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and + * RICH_MEDIA_INPAGE_FLOATING. + */ + windowMode: string; + /** + * zIndex value of an asset. Applicable to the following creative types: all + * RICH_MEDIA.Additionally, only applicable to assets whose displayType is + * NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or + * ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to + * 999999999, inclusive. + */ + zIndex: number; + /** + * File name of zip file. This is a read-only field. Applicable to the + * following creative types: HTML5_BANNER. + */ + zipFilename: string; + /** + * Size of zip file. This is a read-only field. Applicable to the following + * creative types: HTML5_BANNER. + */ + zipFilesize: string; + } + /** + * Creative Asset ID. + */ + export interface Schema$CreativeAssetId { + /** + * Name of the creative asset. This is a required field while inserting an + * asset. After insertion, this assetIdentifier is used to identify the + * uploaded asset. Characters in the name must be alphanumeric or one of the + * following: ".-_ ". Spaces are allowed. + */ + name: string; + /** + * Type of asset to upload. This is a required field. FLASH and IMAGE are no + * longer supported for new uploads. All image assets should use HTML_IMAGE. + */ + type: string; + } + /** + * CreativeAssets contains properties of a creative asset file which will be + * uploaded or has already been uploaded. Refer to the creative sample code + * for how to upload assets and insert a creative. + */ + export interface Schema$CreativeAssetMetadata { + /** + * ID of the creative asset. This is a required field. + */ + assetIdentifier: Schema$CreativeAssetId; + /** + * List of detected click tags for assets. This is a read-only + * auto-generated field. + */ + clickTags: Schema$ClickTag[]; + /** + * List of feature dependencies for the creative asset that are detected by + * DCM. Feature dependencies are features that a browser must be able to + * support in order to render your HTML5 creative correctly. This is a + * read-only, auto-generated field. + */ + detectedFeatures: string[]; + /** + * Numeric ID of the asset. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the numeric ID of the asset. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeAssetMetadata". + */ + kind: string; + /** + * Rules validated during code generation that generated a warning. This is + * a read-only, auto-generated field. Possible values are: - + * "ADMOB_REFERENCED" - "ASSET_FORMAT_UNSUPPORTED_DCM" - + * "ASSET_INVALID" - "CLICK_TAG_HARD_CODED" - + * "CLICK_TAG_INVALID" - "CLICK_TAG_IN_GWD" - + * "CLICK_TAG_MISSING" - "CLICK_TAG_MORE_THAN_ONE" - + * "CLICK_TAG_NON_TOP_LEVEL" - + * "COMPONENT_UNSUPPORTED_DCM" - + * "ENABLER_UNSUPPORTED_METHOD_DCM" - + * "EXTERNAL_FILE_REFERENCED" - "FILE_DETAIL_EMPTY" - + * "FILE_TYPE_INVALID" - "GWD_PROPERTIES_INVALID" - + * "HTML5_FEATURE_UNSUPPORTED" - "LINKED_FILE_NOT_FOUND" + * - "MAX_FLASH_VERSION_11" - "MRAID_REFERENCED" - + * "NOT_SSL_COMPLIANT" - "ORPHANED_ASSET" - + * "PRIMARY_HTML_MISSING" - "SVG_INVALID" - + * "ZIP_INVALID" + */ + warnedValidationRules: string[]; + } + /** + * Encapsulates the list of rules for asset selection and a default asset in + * case none of the rules match. Applicable to INSTREAM_VIDEO creatives. + */ + export interface Schema$CreativeAssetSelection { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in + * this creative, and will be served if none of the rules match. This is a + * required field. + */ + defaultAssetId: string; + /** + * Rules determine which asset will be served to a viewer. Rules will be + * evaluated in the order in which they are stored in this list. This list + * must contain at least one rule. Applicable to INSTREAM_VIDEO creatives. + */ + rules: Schema$Rule[]; + } + /** + * Creative Assignment. + */ + export interface Schema$CreativeAssignment { + /** + * Whether this creative assignment is active. When true, the creative will + * be included in the ad's rotation. + */ + active: boolean; + /** + * Whether applicable event tags should fire when this creative assignment + * is rendered. If this value is unset when the ad is inserted or updated, + * it will default to true for all creative types EXCEPT for + * INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. + */ + applyEventTags: boolean; + /** + * Click-through URL of the creative assignment. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Companion creative overrides for this creative assignment. Applicable to + * video ads. + */ + companionCreativeOverrides: Schema$CompanionClickThroughOverride[]; + /** + * Creative group assignments for this creative assignment. Only one + * assignment per creative group number is allowed for a maximum of two + * assignments. + */ + creativeGroupAssignments: Schema$CreativeGroupAssignment[]; + /** + * ID of the creative to be assigned. This is a required field. + */ + creativeId: string; + /** + * Dimension value for the ID of the creative. This is a read-only, + * auto-generated field. + */ + creativeIdDimensionValue: Schema$DimensionValue; + /** + * Date and time that the assigned creative should stop serving. Must be + * later than the start time. + */ + endTime: string; + /** + * Rich media exit overrides for this creative assignment. Applicable when + * the creative type is any of the following: - DISPLAY - RICH_MEDIA_INPAGE + * - RICH_MEDIA_INPAGE_FLOATING - RICH_MEDIA_IM_EXPAND - + * RICH_MEDIA_EXPANDING - RICH_MEDIA_INTERSTITIAL_FLOAT - + * RICH_MEDIA_MOBILE_IN_APP - RICH_MEDIA_MULTI_FLOATING - + * RICH_MEDIA_PEEL_DOWN - VPAID_LINEAR - VPAID_NON_LINEAR + */ + richMediaExitOverrides: Schema$RichMediaExitOverride[]; + /** + * Sequence number of the creative assignment, applicable when the rotation + * type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to + * 65535, inclusive. + */ + sequence: number; + /** + * Whether the creative to be assigned is SSL-compliant. This is a read-only + * field that is auto-generated when the ad is inserted or updated. + */ + sslCompliant: boolean; + /** + * Date and time that the assigned creative should start serving. + */ + startTime: string; + /** + * Weight of the creative assignment, applicable when the rotation type is + * CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. + */ + weight: number; + } + /** + * Creative Custom Event. + */ + export interface Schema$CreativeCustomEvent { + /** + * Unique ID of this event used by DDM Reporting and Data Transfer. This is + * a read-only field. + */ + advertiserCustomEventId: string; + /** + * User-entered name for the event. + */ + advertiserCustomEventName: string; + /** + * Type of the event. This is a read-only field. + */ + advertiserCustomEventType: string; + /** + * Artwork label column, used to link events in DCM back to events in + * Studio. This is a required field and should not be modified after + * insertion. + */ + artworkLabel: string; + /** + * Artwork type used by the creative.This is a read-only field. + */ + artworkType: string; + /** + * Exit URL of the event. This field is used only for exit events. + */ + exitUrl: string; + /** + * ID of this event. This is a required field and should not be modified + * after insertion. + */ + id: string; + /** + * Properties for rich media popup windows. This field is used only for exit + * events. + */ + popupWindowProperties: Schema$PopupWindowProperties; + /** + * Target type used by the event. + */ + targetType: string; + /** + * Video reporting ID, used to differentiate multiple videos in a single + * creative. This is a read-only field. + */ + videoReportingId: string; + } + /** + * Contains properties of a creative field. + */ + export interface Schema$CreativeField { + /** + * Account ID of this creative field. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this creative field. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * ID of this creative field. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeField". + */ + kind: string; + /** + * Name of this creative field. This is a required field and must be less + * than 256 characters long and unique among creative fields of the same + * advertiser. + */ + name: string; + /** + * Subaccount ID of this creative field. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Creative Field Assignment. + */ + export interface Schema$CreativeFieldAssignment { + /** + * ID of the creative field. + */ + creativeFieldId: string; + /** + * ID of the creative field value. + */ + creativeFieldValueId: string; + } + /** + * Creative Field List Response + */ + export interface Schema$CreativeFieldsListResponse { + /** + * Creative field collection. + */ + creativeFields: Schema$CreativeField[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a creative field value. + */ + export interface Schema$CreativeFieldValue { + /** + * ID of this creative field value. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldValue". + */ + kind: string; + /** + * Value of this creative field value. It needs to be less than 256 + * characters in length and unique per creative field. + */ + value: string; + } + /** + * Creative Field Value List Response + */ + export interface Schema$CreativeFieldValuesListResponse { + /** + * Creative field value collection. + */ + creativeFieldValues: Schema$CreativeFieldValue[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldValuesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a creative group. + */ + export interface Schema$CreativeGroup { + /** + * Account ID of this creative group. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this creative group. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Subgroup of the creative group. Assign your creative groups to a subgroup + * in order to filter or manage them more easily. This field is required on + * insertion and is read-only after insertion. Acceptable values are 1 to 2, + * inclusive. + */ + groupNumber: number; + /** + * ID of this creative group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeGroup". + */ + kind: string; + /** + * Name of this creative group. This is a required field and must be less + * than 256 characters long and unique among creative groups of the same + * advertiser. + */ + name: string; + /** + * Subaccount ID of this creative group. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Creative Group Assignment. + */ + export interface Schema$CreativeGroupAssignment { + /** + * ID of the creative group to be assigned. + */ + creativeGroupId: string; + /** + * Creative group number of the creative group assignment. + */ + creativeGroupNumber: string; + } + /** + * Creative Group List Response + */ + export interface Schema$CreativeGroupsListResponse { + /** + * Creative group collection. + */ + creativeGroups: Schema$CreativeGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Creative optimization settings. + */ + export interface Schema$CreativeOptimizationConfiguration { + /** + * ID of this creative optimization config. This field is auto-generated + * when the campaign is inserted or updated. It can be null for existing + * campaigns. + */ + id: string; + /** + * Name of this creative optimization config. This is a required field and + * must be less than 129 characters long. + */ + name: string; + /** + * List of optimization activities associated with this configuration. + */ + optimizationActivitys: Schema$OptimizationActivity[]; + /** + * Optimization model for this configuration. + */ + optimizationModel: string; + } + /** + * Creative Rotation. + */ + export interface Schema$CreativeRotation { + /** + * Creative assignments in this creative rotation. + */ + creativeAssignments: Schema$CreativeAssignment[]; + /** + * Creative optimization configuration that is used by this ad. It should + * refer to one of the existing optimization configurations in the ad's + * campaign. If it is unset or set to 0, then the campaign's default + * optimization configuration will be used for this ad. + */ + creativeOptimizationConfigurationId: string; + /** + * Type of creative rotation. Can be used to specify whether to use + * sequential or random rotation. + */ + type: string; + /** + * Strategy for calculating weights. Used with + * CREATIVE_ROTATION_TYPE_RANDOM. + */ + weightCalculationStrategy: string; + } + /** + * Creative Settings + */ + export interface Schema$CreativeSettings { + /** + * Header text for iFrames for this site. Must be less than or equal to 2000 + * characters long. + */ + iFrameFooter: string; + /** + * Header text for iFrames for this site. Must be less than or equal to 2000 + * characters long. + */ + iFrameHeader: string; + } + /** + * Creative List Response + */ + export interface Schema$CreativesListResponse { + /** + * Creative collection. + */ + creatives: Schema$Creative[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "CROSS_DIMENSION_REACH". */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.list - * @desc Retrieves a list of user roles, possibly filtered. This method - * supports paging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var userRolesPage = response['userRoles']; - * if (!userRolesPage) { - * return; - * } - * for (var i = 0; i < userRolesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `userRolesPage`: console.log(JSON.stringify(userRolesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dfareporting.userRoles.list(request, handlePage); - * } - * }; - * - * dfareporting.userRoles.list(request, handlePage); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.accountUserRoleOnly Select only account level user roles not associated with any specific subaccount. - * @param {string=} params.ids Select only user roles with the specified IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only user roles that belong to this subaccount. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$CrossDimensionReachReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "breakdown" section of the report. + */ + breakdown: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#crossDimensionReachReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected in the + * "overlapMetricNames" section of the report. + */ + overlapMetrics: Schema$Metric[]; + } + /** + * A custom floodlight variable. + */ + export interface Schema$CustomFloodlightVariable { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#customFloodlightVariable". + */ + kind: string; + /** + * The type of custom floodlight variable to supply a value for. These map + * to the "u[1-20]=" in the tags. + */ + type: string; + /** + * The value of the custom floodlight variable. The length of string must + * not exceed 50 characters. + */ + value: string; + } + /** + * Represents a Custom Rich Media Events group. + */ + export interface Schema$CustomRichMediaEvents { + /** + * List of custom rich media event IDs. Dimension values must be all of type + * dfa:richMediaEventTypeIdAndName. + */ + filteredEventIds: Schema$DimensionValue[]; + /** + * The kind of resource this is, in this case + * dfareporting#customRichMediaEvents. + */ + kind: string; + } + /** + * Represents a date range. + */ + export interface Schema$DateRange { + /** + * The end date of the date range, inclusive. A string of the format: + * "yyyy-MM-dd". + */ + endDate: string; + /** + * The kind of resource this is, in this case dfareporting#dateRange. + */ + kind: string; + /** + * The date range relative to the date of when the report is run. + */ + relativeDateRange: string; + /** + * The start date of the date range, inclusive. A string of the format: + * "yyyy-MM-dd". + */ + startDate: string; + } + /** + * Day Part Targeting. + */ + export interface Schema$DayPartTargeting { + /** + * Days of the week when the ad will serve. Acceptable values are: - + * "SUNDAY" - "MONDAY" - "TUESDAY" - + * "WEDNESDAY" - "THURSDAY" - "FRIDAY" - + * "SATURDAY" + */ + daysOfWeek: string[]; + /** + * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and + * 23 is 11 PM to midnight. Can be specified with days of week, in which + * case the ad would serve during these hours on the specified days. For + * example if Monday, Wednesday, Friday are the days of week specified and + * 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve + * Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values + * are 0 to 23, inclusive. + */ + hoursOfDay: number[]; + /** + * Whether or not to use the user's local time. If false, the + * America/New York time zone applies. + */ + userLocalTime: boolean; + } + /** + * Properties of inheriting and overriding the default click-through event + * tag. A campaign may override the event tag defined at the advertiser level, + * and an ad may also override the campaign's setting further. + */ + export interface Schema$DefaultClickThroughEventTagProperties { + /** + * ID of the click-through event tag to apply to all ads in this + * entity's scope. + */ + defaultClickThroughEventTagId: string; + /** + * Whether this entity should override the inherited default click-through + * event tag with its own defined value. + */ + overrideInheritedEventTag: boolean; + } + /** + * Delivery Schedule. + */ + export interface Schema$DeliverySchedule { + /** + * Limit on the number of times an individual user can be served the ad + * within a specified period of time. + */ + frequencyCap: Schema$FrequencyCap; + /** + * Whether or not hard cutoff is enabled. If true, the ad will not serve + * after the end date and time. Otherwise the ad will continue to be served + * until it has reached its delivery goals. + */ + hardCutoff: boolean; + /** + * Impression ratio for this ad. This ratio determines how often each ad is + * served relative to the others. For example, if ad A has an impression + * ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad + * B three times as often as ad A. Acceptable values are 1 to 10, inclusive. + */ + impressionRatio: string; + /** + * Serving priority of an ad, with respect to other ads. The lower the + * priority number, the greater the priority with which it is served. + */ + priority: string; + } + /** + * DFP Settings + */ + export interface Schema$DfpSettings { + /** + * DFP network code for this directory site. + */ + dfpNetworkCode: string; + /** + * DFP network name for this directory site. + */ + dfpNetworkName: string; + /** + * Whether this directory site accepts programmatic placements. + */ + programmaticPlacementAccepted: boolean; + /** + * Whether this directory site is available only via DoubleClick Publisher + * Portal. + */ + publisherPortalOnly: boolean; + /** + * Whether this directory site accepts publisher-paid tags. + */ + pubPaidPlacementAccepted: boolean; + } + /** + * Represents a dimension. + */ + export interface Schema$Dimension { + /** + * The kind of resource this is, in this case dfareporting#dimension. + */ + kind: string; + /** + * The dimension name, e.g. dfa:advertiser + */ + name: string; + } + /** + * Represents a dimension filter. + */ + export interface Schema$DimensionFilter { + /** + * The name of the dimension to filter. + */ + dimensionName: string; + /** + * The kind of resource this is, in this case dfareporting#dimensionFilter. + */ + kind: string; + /** + * The value of the dimension to filter. + */ + value: string; + } + /** + * Represents a DimensionValue resource. + */ + export interface Schema$DimensionValue { + /** + * The name of the dimension. + */ + dimensionName: string; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The ID associated with the value if available. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#dimensionValue. + */ + kind: string; + /** + * Determines how the 'value' field is matched when filtering. If + * not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, + * '*' is allowed as a placeholder for variable length character + * sequences, and it can be escaped with a backslash. Note, only paid search + * dimensions ('dfa:paidSearch*') allow a matchType other than + * EXACT. + */ + matchType: string; + /** + * The value of the dimension. + */ + value: string; + } + /** + * Represents the list of DimensionValue resources. + */ + export interface Schema$DimensionValueList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The dimension values returned in this response. + */ + items: Schema$DimensionValue[]; + /** + * The kind of list this is, in this case dfareporting#dimensionValueList. + */ + kind: string; + /** + * Continuation token used to page through dimension values. To retrieve the + * next page of results, set the next request's "pageToken" to + * the value of this field. The page token is only valid for a limited + * amount of time and should not be persisted. + */ + nextPageToken: string; + } + /** + * Represents a DimensionValuesRequest. + */ + export interface Schema$DimensionValueRequest { + /** + * The name of the dimension for which values should be requested. + */ + dimensionName: string; + /** + * The end date of the date range for which to retrieve dimension values. A + * string of the format "yyyy-MM-dd". + */ + endDate: string; + /** + * The list of filters by which to filter values. The filters are ANDed. + */ + filters: Schema$DimensionFilter[]; + /** + * The kind of request this is, in this case + * dfareporting#dimensionValueRequest. + */ + kind: string; + /** + * The start date of the date range for which to retrieve dimension values. + * A string of the format "yyyy-MM-dd". + */ + startDate: string; + } + /** + * DirectorySites contains properties of a website from the Site Directory. + * Sites need to be added to an account via the Sites resource before they can + * be assigned to a placement. + */ + export interface Schema$DirectorySite { + /** + * Whether this directory site is active. + */ + active: boolean; + /** + * Directory site contacts. + */ + contactAssignments: Schema$DirectorySiteContactAssignment[]; + /** + * Country ID of this directory site. This is a read-only field. + */ + countryId: string; + /** + * Currency ID of this directory site. This is a read-only field. Possible + * values are: - "1" for USD - "2" for GBP - + * "3" for ESP - "4" for SEK - "5" for CAD + * - "6" for JPY - "7" for DEM - "8" for AUD + * - "9" for FRF - "10" for ITL - "11" for + * DKK - "12" for NOK - "13" for FIM - "14" + * for ZAR - "15" for IEP - "16" for NLG - + * "17" for EUR - "18" for KRW - "19" for + * TWD - "20" for SGD - "21" for CNY - "22" + * for HKD - "23" for NZD - "24" for MYR - + * "25" for BRL - "26" for PTE - "27" for + * MXP - "28" for CLP - "29" for TRY - "30" + * for ARS - "31" for PEN - "32" for ILS - + * "33" for CHF - "34" for VEF - "35" for + * COP - "36" for GTQ - "37" for PLN - "39" + * for INR - "40" for THB - "41" for IDR - + * "42" for CZK - "43" for RON - "44" for + * HUF - "45" for RUB - "46" for AED - "47" + * for BGN - "48" for HRK - "49" for MXN - + * "50" for NGN + */ + currencyId: string; + /** + * Description of this directory site. This is a read-only field. + */ + description: string; + /** + * ID of this directory site. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this directory site. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Tag types for regular placements. Acceptable values are: - + * "STANDARD" - "IFRAME_JAVASCRIPT_INPAGE" - + * "INTERNAL_REDIRECT_INPAGE" - "JAVASCRIPT_INPAGE" + */ + inpageTagFormats: string[]; + /** + * Tag types for interstitial placements. Acceptable values are: - + * "IFRAME_JAVASCRIPT_INTERSTITIAL" - + * "INTERNAL_REDIRECT_INTERSTITIAL" - + * "JAVASCRIPT_INTERSTITIAL" + */ + interstitialTagFormats: string[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySite". + */ + kind: string; + /** + * Name of this directory site. + */ + name: string; + /** + * Parent directory site ID. + */ + parentId: string; + /** + * Directory site settings. + */ + settings: Schema$DirectorySiteSettings; + /** + * URL of this directory site. + */ + url: string; + } + /** + * Contains properties of a Site Directory contact. + */ + export interface Schema$DirectorySiteContact { + /** + * Address of this directory site contact. + */ + address: string; + /** + * Email address of this directory site contact. + */ + email: string; + /** + * First name of this directory site contact. + */ + firstName: string; + /** + * ID of this directory site contact. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySiteContact". + */ + kind: string; + /** + * Last name of this directory site contact. + */ + lastName: string; + /** + * Phone number of this directory site contact. + */ + phone: string; + /** + * Directory site contact role. + */ + role: string; + /** + * Title or designation of this directory site contact. + */ + title: string; + /** + * Directory site contact type. + */ + type: string; + } + /** + * Directory Site Contact Assignment + */ + export interface Schema$DirectorySiteContactAssignment { + /** + * ID of this directory site contact. This is a read-only, auto-generated + * field. + */ + contactId: string; + /** + * Visibility of this directory site contact assignment. When set to PUBLIC + * this contact assignment is visible to all account and agency users; when + * set to PRIVATE it is visible only to the site. + */ + visibility: string; + } + /** + * Directory Site Contact List Response + */ + export interface Schema$DirectorySiteContactsListResponse { + /** + * Directory site contact collection + */ + directorySiteContacts: Schema$DirectorySiteContact[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySiteContactsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Directory Site Settings + */ + export interface Schema$DirectorySiteSettings { + /** + * Whether this directory site has disabled active view creatives. + */ + activeViewOptOut: boolean; + /** + * Directory site DFP settings. + */ + dfpSettings: Schema$DfpSettings; + /** + * Whether this site accepts in-stream video ads. + */ + instreamVideoPlacementAccepted: boolean; + /** + * Whether this site accepts interstitial ads. + */ + interstitialPlacementAccepted: boolean; + /** + * Whether this directory site has disabled Nielsen OCR reach ratings. + */ + nielsenOcrOptOut: boolean; + /** + * Whether this directory site has disabled generation of Verification ins + * tags. + */ + verificationTagOptOut: boolean; + /** + * Whether this directory site has disabled active view for in-stream video + * creatives. This is a read-only field. + */ + videoActiveViewOptOut: boolean; + } + /** + * Directory Site List Response + */ + export interface Schema$DirectorySitesListResponse { + /** + * Directory site collection. + */ + directorySites: Schema$DirectorySite[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySitesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a dynamic targeting key. Dynamic targeting keys are + * unique, user-friendly labels, created at the advertiser level in DCM, that + * can be assigned to ads, creatives, and placements and used for targeting + * with DoubleClick Studio dynamic creatives. Use these labels instead of + * numeric DCM IDs (such as placement IDs) to save time and avoid errors in + * your dynamic feeds. + */ + export interface Schema$DynamicTargetingKey { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#dynamicTargetingKey". + */ + kind: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be + * less than 256 characters long and cannot contain commas. All characters + * are converted to lowercase. + */ + name: string; + /** + * ID of the object of this dynamic targeting key. This is a required field. + */ + objectId: string; + /** + * Type of the object of this dynamic targeting key. This is a required + * field. + */ + objectType: string; + } + /** + * Dynamic Targeting Key List Response + */ + export interface Schema$DynamicTargetingKeysListResponse { + /** + * Dynamic targeting key collection. + */ + dynamicTargetingKeys: Schema$DynamicTargetingKey[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#dynamicTargetingKeysListResponse". + */ + kind: string; + } + /** + * A description of how user IDs are encrypted. + */ + export interface Schema$EncryptionInfo { + /** + * The encryption entity ID. This should match the encryption configuration + * for ad serving or Data Transfer. + */ + encryptionEntityId: string; + /** + * The encryption entity type. This should match the encryption + * configuration for ad serving or Data Transfer. + */ + encryptionEntityType: string; + /** + * Describes whether the encrypted cookie was received from ad serving (the + * %m macro) or from Data Transfer. + */ + encryptionSource: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#encryptionInfo". + */ + kind: string; + } + /** + * Contains properties of an event tag. + */ + export interface Schema$EventTag { + /** + * Account ID of this event tag. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Advertiser ID of this event tag. This field or the campaignId field is + * required on insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Campaign ID of this event tag. This field or the advertiserId field is + * required on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Whether this event tag should be automatically enabled for all of the + * advertiser's campaigns and ads. + */ + enabledByDefault: boolean; + /** + * Whether to remove this event tag from ads that are trafficked through + * DoubleClick Bid Manager to Ad Exchange. This may be useful if the event + * tag uses a pixel that is unapproved for Ad Exchange bids on one or more + * networks, such as the Google Display Network. + */ + excludeFromAdxRequests: boolean; + /** + * ID of this event tag. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#eventTag". + */ + kind: string; + /** + * Name of this event tag. This is a required field and must be less than + * 256 characters long. + */ + name: string; + /** + * Site filter type for this event tag. If no type is specified then the + * event tag will be applied to all sites. + */ + siteFilterType: string; + /** + * Filter list of site IDs associated with this event tag. The + * siteFilterType determines whether this is a whitelist or blacklist + * filter. + */ + siteIds: string[]; + /** + * Whether this tag is SSL-compliant or not. This is a read-only field. + */ + sslCompliant: boolean; + /** + * Status of this event tag. Must be ENABLED for this event tag to fire. + * This is a required field. + */ + status: string; + /** + * Subaccount ID of this event tag. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Event tag type. Can be used to specify whether to use a third-party + * pixel, a third-party JavaScript URL, or a third-party click-through URL + * for either impression or click tracking. This is a required field. + */ + type: string; + /** + * Payload URL for this event tag. The URL on a click-through event tag + * should have a landing page URL appended to the end of it. This field is + * required on insertion. + */ + url: string; + /** + * Number of times the landing page URL should be URL-escaped before being + * appended to the click-through event tag URL. Only applies to + * click-through event tags as specified by the event tag type. + */ + urlEscapeLevels: number; + } + /** + * Event tag override information. + */ + export interface Schema$EventTagOverride { + /** + * Whether this override is enabled. + */ + enabled: boolean; + /** + * ID of this event tag override. This is a read-only, auto-generated field. + */ + id: string; + } + /** + * Event Tag List Response + */ + export interface Schema$EventTagsListResponse { + /** + * Event tag collection. + */ + eventTags: Schema$EventTag[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#eventTagsListResponse". + */ + kind: string; + } + /** + * Represents a File resource. A file contains the metadata for a report run. + * It shows the status of the run and holds the URLs to the generated report + * data if the run is finished and the status is "REPORT_AVAILABLE". + */ + export interface Schema$File { + /** + * The date range for which the file has report data. The date range will + * always be the absolute date range for which the report is run. + */ + dateRange: Schema$DateRange; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The filename of the file. + */ + fileName: string; + /** + * The output format of the report. Only available once the file is + * available. + */ + format: string; + /** + * The unique ID of this report file. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#file. + */ + kind: string; + /** + * The timestamp in milliseconds since epoch when this file was last + * modified. + */ + lastModifiedTime: string; + /** + * The ID of the report this file was generated from. + */ + reportId: string; + /** + * The status of the report file. + */ + status: string; + /** + * The URLs where the completed report file can be downloaded. + */ + urls: any; + } + /** + * Represents the list of File resources. + */ + export interface Schema$FileList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The files returned in this response. + */ + items: Schema$File[]; + /** + * The kind of list this is, in this case dfareporting#fileList. + */ + kind: string; + /** + * Continuation token used to page through files. To retrieve the next page + * of results, set the next request's "pageToken" to the value + * of this field. The page token is only valid for a limited amount of time + * and should not be persisted. + */ + nextPageToken: string; + } + /** + * Flight + */ + export interface Schema$Flight { + /** + * Inventory item flight end date. + */ + endDate: string; + /** + * Rate or cost of this flight. + */ + rateOrCost: string; + /** + * Inventory item flight start date. + */ + startDate: string; + /** + * Units of this flight. + */ + units: string; + } + /** + * Floodlight Activity GenerateTag Response + */ + export interface Schema$FloodlightActivitiesGenerateTagResponse { + /** + * Generated tag for this Floodlight activity. For global site tags, this is + * the event snippet. + */ + floodlightActivityTag: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivitiesGenerateTagResponse". + */ + kind: string; + } + /** + * Floodlight Activity List Response + */ + export interface Schema$FloodlightActivitiesListResponse { + /** + * Floodlight activity collection. + */ + floodlightActivities: Schema$FloodlightActivity[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivitiesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a Floodlight activity. + */ + export interface Schema$FloodlightActivity { + /** + * Account ID of this floodlight activity. This is a read-only field that + * can be left blank. + */ + accountId: string; + /** + * Advertiser ID of this floodlight activity. If this field is left blank, + * the value will be copied over either from the activity group's + * advertiser or the existing activity's advertiser. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Code type used for cache busting in the generated tag. Applicable only + * when floodlightActivityGroupType is COUNTER and countingMethod is + * STANDARD_COUNTING or UNIQUE_COUNTING. + */ + cacheBustingType: string; + /** + * Counting method for conversions for this floodlight activity. This is a + * required field. + */ + countingMethod: string; + /** + * Dynamic floodlight tags. + */ + defaultTags: Schema$FloodlightActivityDynamicTag[]; + /** + * URL where this tag will be deployed. If specified, must be less than 256 + * characters long. + */ + expectedUrl: string; + /** + * Floodlight activity group ID of this floodlight activity. This is a + * required field. + */ + floodlightActivityGroupId: string; + /** + * Name of the associated floodlight activity group. This is a read-only + * field. + */ + floodlightActivityGroupName: string; + /** + * Tag string of the associated floodlight activity group. This is a + * read-only field. + */ + floodlightActivityGroupTagString: string; + /** + * Type of the associated floodlight activity group. This is a read-only + * field. + */ + floodlightActivityGroupType: string; + /** + * Floodlight configuration ID of this floodlight activity. If this field is + * left blank, the value will be copied over either from the activity + * group's floodlight configuration or from the existing activity's + * floodlight configuration. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * Whether this activity is archived. + */ + hidden: boolean; + /** + * ID of this floodlight activity. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight activity. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Whether the image tag is enabled for this activity. + */ + imageTagEnabled: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivity". + */ + kind: string; + /** + * Name of this floodlight activity. This is a required field. Must be less + * than 129 characters long and cannot contain quotes. + */ + name: string; + /** + * General notes or implementation instructions for the tag. + */ + notes: string; + /** + * Publisher dynamic floodlight tags. + */ + publisherTags: Schema$FloodlightActivityPublisherDynamicTag[]; + /** + * Whether this tag should use SSL. + */ + secure: boolean; + /** + * Whether the floodlight activity is SSL-compliant. This is a read-only + * field, its value detected by the system from the floodlight tags. + */ + sslCompliant: boolean; + /** + * Whether this floodlight activity must be SSL-compliant. + */ + sslRequired: boolean; + /** + * Subaccount ID of this floodlight activity. This is a read-only field that + * can be left blank. + */ + subaccountId: string; + /** + * Tag format type for the floodlight activity. If left blank, the tag + * format will default to HTML. + */ + tagFormat: string; + /** + * Value of the cat= parameter in the floodlight tag, which the ad servers + * use to identify the activity. This is optional: if empty, a new tag + * string will be generated for you. This string must be 1 to 8 characters + * long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag + * string must also be unique among activities of the same activity group. + * This field is read-only after insertion. + */ + tagString: string; + /** + * List of the user-defined variables used by this conversion tag. These map + * to the "u[1-100]=" in the tags. Each of these can have a user + * defined type. Acceptable values are U1 to U100, inclusive. + */ + userDefinedVariableTypes: string[]; + } + /** + * Dynamic Tag + */ + export interface Schema$FloodlightActivityDynamicTag { + /** + * ID of this dynamic tag. This is a read-only, auto-generated field. + */ + id: string; + /** + * Name of this tag. + */ + name: string; + /** + * Tag code. + */ + tag: string; + } + /** + * Contains properties of a Floodlight activity group. + */ + export interface Schema$FloodlightActivityGroup { + /** + * Account ID of this floodlight activity group. This is a read-only field + * that can be left blank. + */ + accountId: string; + /** + * Advertiser ID of this floodlight activity group. If this field is left + * blank, the value will be copied over either from the floodlight + * configuration's advertiser or from the existing activity group's + * advertiser. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Floodlight configuration ID of this floodlight activity group. This is a + * required field. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * ID of this floodlight activity group. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight activity group. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivityGroup". + */ + kind: string; + /** + * Name of this floodlight activity group. This is a required field. Must be + * less than 65 characters long and cannot contain quotes. + */ + name: string; + /** + * Subaccount ID of this floodlight activity group. This is a read-only + * field that can be left blank. + */ + subaccountId: string; + /** + * Value of the type= parameter in the floodlight tag, which the ad servers + * use to identify the activity group that the activity belongs to. This is + * optional: if empty, a new tag string will be generated for you. This + * string must be 1 to 8 characters long, with valid characters being + * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among + * activity groups of the same floodlight configuration. This field is + * read-only after insertion. + */ + tagString: string; + /** + * Type of the floodlight activity group. This is a required field that is + * read-only after insertion. + */ + type: string; + } + /** + * Floodlight Activity Group List Response + */ + export interface Schema$FloodlightActivityGroupsListResponse { + /** + * Floodlight activity group collection. + */ + floodlightActivityGroups: Schema$FloodlightActivityGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivityGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Publisher Dynamic Tag + */ + export interface Schema$FloodlightActivityPublisherDynamicTag { + /** + * Whether this tag is applicable only for click-throughs. + */ + clickThrough: boolean; + /** + * Directory site ID of this dynamic tag. This is a write-only field that + * can be used as an alternative to the siteId field. When this resource is + * retrieved, only the siteId field will be populated. + */ + directorySiteId: string; + /** + * Dynamic floodlight tag. + */ + dynamicTag: Schema$FloodlightActivityDynamicTag; + /** + * Site ID of this dynamic tag. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Whether this tag is applicable only for view-throughs. + */ + viewThrough: boolean; + } + /** + * Contains properties of a Floodlight configuration. + */ + export interface Schema$FloodlightConfiguration { + /** + * Account ID of this floodlight configuration. This is a read-only field + * that can be left blank. + */ + accountId: string; + /** + * Advertiser ID of the parent advertiser of this floodlight configuration. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether advertiser data is shared with Google Analytics. + */ + analyticsDataSharingEnabled: boolean; + /** + * Whether the exposure-to-conversion report is enabled. This report shows + * detailed pathway information on up to 10 of the most recent ad exposures + * seen by a user before converting. + */ + exposureToConversionEnabled: boolean; + /** + * Day that will be counted as the first day of the week in reports. This is + * a required field. + */ + firstDayOfWeek: string; + /** + * ID of this floodlight configuration. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight configuration. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Whether in-app attribution tracking is enabled. + */ + inAppAttributionTrackingEnabled: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightConfiguration". + */ + kind: string; + /** + * Lookback window settings for this floodlight configuration. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Types of attribution options for natural search conversions. + */ + naturalSearchConversionAttributionOption: string; + /** + * Settings for DCM Omniture integration. + */ + omnitureSettings: Schema$OmnitureSettings; + /** + * Subaccount ID of this floodlight configuration. This is a read-only field + * that can be left blank. + */ + subaccountId: string; + /** + * Configuration settings for dynamic and image floodlight tags. + */ + tagSettings: Schema$TagSettings; + /** + * List of third-party authentication tokens enabled for this configuration. + */ + thirdPartyAuthenticationTokens: Schema$ThirdPartyAuthenticationToken[]; + /** + * List of user defined variables enabled for this configuration. + */ + userDefinedVariableConfigurations: + Schema$UserDefinedVariableConfiguration[]; + } + /** + * Floodlight Configuration List Response + */ + export interface Schema$FloodlightConfigurationsListResponse { + /** + * Floodlight configuration collection. + */ + floodlightConfigurations: Schema$FloodlightConfiguration[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightConfigurationsListResponse". + */ + kind: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "FlOODLIGHT". + */ + export interface Schema$FloodlightReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#floodlightReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + } + /** + * Frequency Cap. + */ + export interface Schema$FrequencyCap { + /** + * Duration of time, in seconds, for this frequency cap. The maximum + * duration is 90 days. Acceptable values are 1 to 7776000, inclusive. + */ + duration: string; + /** + * Number of times an individual user can be served the ad within the + * specified duration. Acceptable values are 1 to 15, inclusive. + */ + impressions: string; + } + /** + * FsCommand. + */ + export interface Schema$FsCommand { + /** + * Distance from the left of the browser.Applicable when positionOption is + * DISTANCE_FROM_TOP_LEFT_CORNER. + */ + left: number; + /** + * Position in the browser where the window will open. + */ + positionOption: string; + /** + * Distance from the top of the browser. Applicable when positionOption is + * DISTANCE_FROM_TOP_LEFT_CORNER. + */ + top: number; + /** + * Height of the window. + */ + windowHeight: number; + /** + * Width of the window. + */ + windowWidth: number; + } + /** + * Geographical Targeting. + */ + export interface Schema$GeoTargeting { + /** + * Cities to be targeted. For each city only dartId is required. The other + * fields are populated automatically when the ad is inserted or updated. If + * targeting a city, do not target or exclude the country of the city, and + * do not target the metro or region of the city. + */ + cities: Schema$City[]; + /** + * Countries to be targeted or excluded from targeting, depending on the + * setting of the excludeCountries field. For each country only dartId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting or excluding a country, do not target + * regions, cities, metros, or postal codes in the same country. + */ + countries: Schema$Country[]; + /** + * Whether or not to exclude the countries in the countries field from + * targeting. If false, the countries field refers to countries which will + * be targeted by the ad. + */ + excludeCountries: boolean; + /** + * Metros to be targeted. For each metro only dmaId is required. The other + * fields are populated automatically when the ad is inserted or updated. If + * targeting a metro, do not target or exclude the country of the metro. + */ + metros: Schema$Metro[]; + /** + * Postal codes to be targeted. For each postal code only id is required. + * The other fields are populated automatically when the ad is inserted or + * updated. If targeting a postal code, do not target or exclude the country + * of the postal code. + */ + postalCodes: Schema$PostalCode[]; + /** + * Regions to be targeted. For each region only dartId is required. The + * other fields are populated automatically when the ad is inserted or + * updated. If targeting a region, do not target or exclude the country of + * the region. + */ + regions: Schema$Region[]; + } + /** + * Represents a buy from the DoubleClick Planning inventory store. + */ + export interface Schema$InventoryItem { + /** + * Account ID of this inventory item. + */ + accountId: string; + /** + * Ad slots of this inventory item. If this inventory item represents a + * standalone placement, there will be exactly one ad slot. If this + * inventory item represents a placement group, there will be more than one + * ad slot, each representing one child placement in that placement group. + */ + adSlots: Schema$AdSlot[]; + /** + * Advertiser ID of this inventory item. + */ + advertiserId: string; + /** + * Content category ID of this inventory item. + */ + contentCategoryId: string; + /** + * Estimated click-through rate of this inventory item. + */ + estimatedClickThroughRate: string; + /** + * Estimated conversion rate of this inventory item. + */ + estimatedConversionRate: string; + /** + * ID of this inventory item. + */ + id: string; + /** + * Whether this inventory item is in plan. + */ + inPlan: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#inventoryItem". + */ + kind: string; + /** + * Information about the most recent modification of this inventory item. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this inventory item. For standalone inventory items, this is the + * same name as that of its only ad slot. For group inventory items, this + * can differ from the name of any of its ad slots. + */ + name: string; + /** + * Negotiation channel ID of this inventory item. + */ + negotiationChannelId: string; + /** + * Order ID of this inventory item. + */ + orderId: string; + /** + * Placement strategy ID of this inventory item. + */ + placementStrategyId: string; + /** + * Pricing of this inventory item. + */ + pricing: Schema$Pricing; + /** + * Project ID of this inventory item. + */ + projectId: string; + /** + * RFP ID of this inventory item. + */ + rfpId: string; + /** + * ID of the site this inventory item is associated with. + */ + siteId: string; + /** + * Subaccount ID of this inventory item. + */ + subaccountId: string; + /** + * Type of inventory item. + */ + type: string; + } + /** + * Inventory item List Response + */ + export interface Schema$InventoryItemsListResponse { + /** + * Inventory item collection + */ + inventoryItems: Schema$InventoryItem[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#inventoryItemsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Key Value Targeting Expression. + */ + export interface Schema$KeyValueTargetingExpression { + /** + * Keyword expression being targeted by the ad. + */ + expression: string; + } + /** + * Contains information about where a user's browser is taken after the + * user clicks an ad. + */ + export interface Schema$LandingPage { + /** + * Whether or not this landing page will be assigned to any ads or creatives + * that do not have a landing page assigned explicitly. Only one default + * landing page is allowed per campaign. + */ + default: boolean; + /** + * ID of this landing page. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#landingPage". + */ + kind: string; + /** + * Name of this landing page. This is a required field. It must be less than + * 256 characters long, and must be unique among landing pages of the same + * campaign. + */ + name: string; + /** + * URL of this landing page. This is a required field. + */ + url: string; + } + /** + * Landing Page List Response + */ + export interface Schema$LandingPagesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#landingPagesListResponse". + */ + kind: string; + /** + * Landing page collection + */ + landingPages: Schema$LandingPage[]; + } + /** + * Contains information about a language that can be targeted by ads. + */ + export interface Schema$Language { + /** + * Language ID of this language. This is the ID used for targeting and + * generating reports. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#language". + */ + kind: string; + /** + * Format of language code is an ISO 639 two-letter language code optionally + * followed by an underscore followed by an ISO 3166 code. Examples are + * "en" for English or "zh_CN" for Simplified Chinese. + */ + languageCode: string; + /** + * Name of this language. + */ + name: string; + } + /** + * Language List Response + */ + export interface Schema$LanguagesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#languagesListResponse". + */ + kind: string; + /** + * Language collection. + */ + languages: Schema$Language[]; + } + /** + * Language Targeting. + */ + export interface Schema$LanguageTargeting { + /** + * Languages that this ad targets. For each language only languageId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + languages: Schema$Language[]; + } + /** + * Modification timestamp. + */ + export interface Schema$LastModifiedInfo { + /** + * Timestamp of the last change in milliseconds since epoch. + */ + time: string; + } + /** + * A group clause made up of list population terms representing constraints + * joined by ORs. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.patch - * @desc Updates an existing user role. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // User role ID. - * id: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.userRoles.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ListPopulationClause { + /** + * Terms of this list population clause. Each clause is made up of list + * population terms representing constraints and are joined by ORs. + */ + terms: Schema$ListPopulationTerm[]; + } + /** + * Remarketing List Population Rule. + */ + export interface Schema$ListPopulationRule { + /** + * Floodlight activity ID associated with this rule. This field can be left + * blank. + */ + floodlightActivityId: string; + /** + * Name of floodlight activity associated with this rule. This is a + * read-only, auto-generated field. + */ + floodlightActivityName: string; + /** + * Clauses that make up this list population rule. Clauses are joined by + * ANDs, and the clauses themselves are made up of list population terms + * which are joined by ORs. + */ + listPopulationClauses: Schema$ListPopulationClause[]; + } + /** + * Remarketing List Population Rule Term. + */ + export interface Schema$ListPopulationTerm { + /** + * Will be true if the term should check if the user is in the list and + * false if the term should check if the user is not in the list. This field + * is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by + * default. + */ + contains: boolean; + /** + * Whether to negate the comparison result of this term during rule + * evaluation. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + negation: boolean; + /** + * Comparison operator of this term. This field is only relevant when type + * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + operator: string; + /** + * ID of the list in question. This field is only relevant when type is set + * to LIST_MEMBERSHIP_TERM. + */ + remarketingListId: string; + /** + * List population term type determines the applicable fields in this + * object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, + * variableFriendlyName, operator, value, and negation are applicable. If + * set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are + * applicable. If set to REFERRER_TERM then operator, value, and negation + * are applicable. + */ + type: string; + /** + * Literal to compare the variable to. This field is only relevant when type + * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + value: string; + /** + * Friendly name of this term's variable. This is a read-only, + * auto-generated field. This field is only relevant when type is left unset + * or set to CUSTOM_VARIABLE_TERM. + */ + variableFriendlyName: string; + /** + * Name of the variable (U1, U2, etc.) being compared in this term. This + * field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or + * REFERRER_TERM. + */ + variableName: string; + } + /** + * Remarketing List Targeting Expression. + */ + export interface Schema$ListTargetingExpression { + /** + * Expression describing which lists are being targeted by the ad. + */ + expression: string; + } + /** + * Lookback configuration settings. + */ + export interface Schema$LookbackConfiguration { + /** + * Lookback window, in days, from the last time a given user clicked on one + * of your ads. If you enter 0, clicks will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the + * default value for your account will be used. Acceptable values are 0 to + * 90, inclusive. + */ + clickDuration: number; + /** + * Lookback window, in days, from the last time a given user viewed one of + * your ads. If you enter 0, impressions will not be considered as + * triggering events for floodlight tracking. If you leave this field blank, + * the default value for your account will be used. Acceptable values are 0 + * to 90, inclusive. + */ + postImpressionActivitiesDuration: number; + } + /** + * Represents a metric. + */ + export interface Schema$Metric { + /** + * The kind of resource this is, in this case dfareporting#metric. + */ + kind: string; + /** + * The metric name, e.g. dfa:impressions + */ + name: string; + } + /** + * Contains information about a metro region that can be targeted by ads. + */ + export interface Schema$Metro { + /** + * Country code of the country to which this metro region belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this metro region belongs. + */ + countryDartId: string; + /** + * DART ID of this metro region. + */ + dartId: string; + /** + * DMA ID of this metro region. This is the ID used for targeting and + * generating reports, and is equivalent to metro_code. + */ + dmaId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#metro". + */ + kind: string; + /** + * Metro code of this metro region. This is equivalent to dma_id. + */ + metroCode: string; + /** + * Name of this metro region. + */ + name: string; + } + /** + * Metro List Response + */ + export interface Schema$MetrosListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#metrosListResponse". + */ + kind: string; + /** + * Metro collection. + */ + metros: Schema$Metro[]; + } + /** + * Contains information about a mobile carrier that can be targeted by ads. + */ + export interface Schema$MobileCarrier { + /** + * Country code of the country to which this mobile carrier belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this mobile carrier belongs. + */ + countryDartId: string; + /** + * ID of this mobile carrier. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#mobileCarrier". + */ + kind: string; + /** + * Name of this mobile carrier. + */ + name: string; + } + /** + * Mobile Carrier List Response + */ + export interface Schema$MobileCarriersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#mobileCarriersListResponse". + */ + kind: string; + /** + * Mobile carrier collection. + */ + mobileCarriers: Schema$MobileCarrier[]; + } + /** + * Object Filter. + */ + export interface Schema$ObjectFilter { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#objectFilter". + */ + kind: string; + /** + * Applicable when status is ASSIGNED. The user has access to objects with + * these object IDs. + */ + objectIds: string[]; + /** + * Status of the filter. NONE means the user has access to none of the + * objects. ALL means the user has access to all objects. ASSIGNED means the + * user has access to the objects with IDs in the objectIds list. + */ + status: string; + } + /** + * Offset Position. + */ + export interface Schema$OffsetPosition { + /** + * Offset distance from left side of an asset or a window. + */ + left: number; + /** + * Offset distance from top side of an asset or a window. + */ + top: number; + } + /** + * Omniture Integration Settings. + */ + export interface Schema$OmnitureSettings { + /** + * Whether placement cost data will be sent to Omniture. This property can + * be enabled only if omnitureIntegrationEnabled is true. + */ + omnitureCostDataEnabled: boolean; + /** + * Whether Omniture integration is enabled. This property can be enabled + * only when the "Advanced Ad Serving" account setting is enabled. + */ + omnitureIntegrationEnabled: boolean; + } + /** + * Contains information about an operating system that can be targeted by ads. + */ + export interface Schema$OperatingSystem { + /** + * DART ID of this operating system. This is the ID used for targeting. + */ + dartId: string; + /** + * Whether this operating system is for desktop. + */ + desktop: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystem". + */ + kind: string; + /** + * Whether this operating system is for mobile. + */ + mobile: boolean; + /** + * Name of this operating system. + */ + name: string; + } + /** + * Operating System List Response + */ + export interface Schema$OperatingSystemsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemsListResponse". + */ + kind: string; + /** + * Operating system collection. + */ + operatingSystems: Schema$OperatingSystem[]; + } + /** + * Contains information about a particular version of an operating system that + * can be targeted by ads. + */ + export interface Schema$OperatingSystemVersion { + /** + * ID of this operating system version. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemVersion". + */ + kind: string; + /** + * Major version (leftmost number) of this operating system version. + */ + majorVersion: string; + /** + * Minor version (number after the first dot) of this operating system + * version. + */ + minorVersion: string; + /** + * Name of this operating system version. + */ + name: string; + /** + * Operating system of this operating system version. + */ + operatingSystem: Schema$OperatingSystem; + } + /** + * Operating System Version List Response + */ + export interface Schema$OperatingSystemVersionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemVersionsListResponse". + */ + kind: string; + /** + * Operating system version collection. + */ + operatingSystemVersions: Schema$OperatingSystemVersion[]; + } + /** + * Creative optimization activity. + */ + export interface Schema$OptimizationActivity { + /** + * Floodlight activity ID of this optimization activity. This is a required + * field. + */ + floodlightActivityId: string; + /** + * Dimension value for the ID of the floodlight activity. This is a + * read-only, auto-generated field. + */ + floodlightActivityIdDimensionValue: Schema$DimensionValue; + /** + * Weight associated with this optimization. The weight assigned will be + * understood in proportion to the weights assigned to the other + * optimization activities. Value must be greater than or equal to 1. + */ + weight: number; + } + /** + * Describes properties of a DoubleClick Planning order. + */ + export interface Schema$Order { + /** + * Account ID of this order. + */ + accountId: string; + /** + * Advertiser ID of this order. + */ + advertiserId: string; + /** + * IDs for users that have to approve documents created for this order. + */ + approverUserProfileIds: string[]; + /** + * Buyer invoice ID associated with this order. + */ + buyerInvoiceId: string; + /** + * Name of the buyer organization. + */ + buyerOrganizationName: string; + /** + * Comments in this order. + */ + comments: string; + /** + * Contacts for this order. + */ + contacts: Schema$OrderContact[]; + /** + * ID of this order. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#order". + */ + kind: string; + /** + * Information about the most recent modification of this order. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this order. + */ + name: string; + /** + * Notes of this order. + */ + notes: string; + /** + * ID of the terms and conditions template used in this order. + */ + planningTermId: string; + /** + * Project ID of this order. + */ + projectId: string; + /** + * Seller order ID associated with this order. + */ + sellerOrderId: string; + /** + * Name of the seller organization. + */ + sellerOrganizationName: string; + /** + * Site IDs this order is associated with. + */ + siteId: string[]; + /** + * Free-form site names this order is associated with. + */ + siteNames: string[]; + /** + * Subaccount ID of this order. + */ + subaccountId: string; + /** + * Terms and conditions of this order. + */ + termsAndConditions: string; + } + /** + * Contact of an order. + */ + export interface Schema$OrderContact { + /** + * Free-form information about this contact. It could be any information + * related to this contact in addition to type, title, name, and signature + * user profile ID. + */ + contactInfo: string; + /** + * Name of this contact. + */ + contactName: string; + /** + * Title of this contact. + */ + contactTitle: string; + /** + * Type of this contact. + */ + contactType: string; + /** + * ID of the user profile containing the signature that will be embedded + * into order documents. + */ + signatureUserProfileId: string; + } + /** + * Contains properties of a DoubleClick Planning order document. + */ + export interface Schema$OrderDocument { + /** + * Account ID of this order document. + */ + accountId: string; + /** + * Advertiser ID of this order document. + */ + advertiserId: string; + /** + * The amended order document ID of this order document. An order document + * can be created by optionally amending another order document so that the + * change history can be preserved. + */ + amendedOrderDocumentId: string; + /** + * IDs of users who have approved this order document. + */ + approvedByUserProfileIds: string[]; + /** + * Whether this order document is cancelled. + */ + cancelled: boolean; + /** + * Information about the creation of this order document. + */ + createdInfo: Schema$LastModifiedInfo; + /** + * Effective date of this order document. + */ + effectiveDate: string; + /** + * ID of this order document. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#orderDocument". + */ + kind: string; + /** + * List of email addresses that received the last sent document. + */ + lastSentRecipients: string[]; + /** + * Timestamp of the last email sent with this order document. + */ + lastSentTime: string; + /** + * ID of the order from which this order document is created. + */ + orderId: string; + /** + * Project ID of this order document. + */ + projectId: string; + /** + * Whether this order document has been signed. + */ + signed: boolean; + /** + * Subaccount ID of this order document. + */ + subaccountId: string; + /** + * Title of this order document. + */ + title: string; + /** + * Type of this order document + */ + type: string; + } + /** + * Order document List Response + */ + export interface Schema$OrderDocumentsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#orderDocumentsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Order document collection + */ + orderDocuments: Schema$OrderDocument[]; + } + /** + * Order List Response + */ + export interface Schema$OrdersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#ordersListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Order collection. + */ + orders: Schema$Order[]; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "PATH_TO_CONVERSION". */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.update - * @desc Updates an existing user role. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dfareporting.userRoles.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.userRoles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$PathToConversionReportCompatibleFields { + /** + * Conversion dimensions which are compatible to be selected in the + * "conversionDimensions" section of the report. + */ + conversionDimensions: Schema$Dimension[]; + /** + * Custom floodlight variables which are compatible to be selected in the + * "customFloodlightVariables" section of the report. + */ + customFloodlightVariables: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#pathToConversionReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Per-interaction dimensions which are compatible to be selected in the + * "perInteractionDimensions" section of the report. + */ + perInteractionDimensions: Schema$Dimension[]; + } + /** + * Contains properties of a placement. + */ + export interface Schema$Placement { + /** + * Account ID of this placement. This field can be left blank. + */ + accountId: string; + /** + * Whether this placement opts out of ad blocking. When true, ad blocking is + * disabled for this placement. When false, the campaign and site settings + * take effect. + */ + adBlockingOptOut: boolean; + /** + * Advertiser ID of this placement. This field can be left blank. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this placement is archived. + */ + archived: boolean; + /** + * Campaign ID of this placement. This field is a required field on + * insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Comments for this placement. + */ + comment: string; + /** + * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to + * rendering on desktop, on mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer + * allowed for new placement insertions. Instead, use DISPLAY or + * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream + * video ads developed with the VAST standard. This field is required on + * insertion. + */ + compatibility: string; + /** + * ID of the content category assigned to this placement. + */ + contentCategoryId: string; + /** + * Information about the creation of this placement. This is a read-only + * field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Directory site ID of this placement. On insert, you must set either this + * field or the siteId field to specify the site associated with this + * placement. This is a required field that is read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * External ID for this placement. + */ + externalId: string; + /** + * ID of this placement. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this placement. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key name of this placement. This is a read-only, auto-generated field. + */ + keyName: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placement". + */ + kind: string; + /** + * Information about the most recent modification of this placement. This is + * a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Lookback window settings for this placement. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Name of this placement.This is a required field and must be less than 256 + * characters long. + */ + name: string; + /** + * Whether payment was approved for this placement. This is a read-only + * field relevant only to publisher-paid placements. + */ + paymentApproved: boolean; + /** + * Payment source for this placement. This is a required field that is + * read-only after insertion. + */ + paymentSource: string; + /** + * ID of this placement's group, if applicable. + */ + placementGroupId: string; + /** + * Dimension value for the ID of the placement group. This is a read-only, + * auto-generated field. + */ + placementGroupIdDimensionValue: Schema$DimensionValue; + /** + * ID of the placement strategy assigned to this placement. + */ + placementStrategyId: string; + /** + * Pricing schedule of this placement. This field is required on insertion, + * specifically subfields startDate, endDate and pricingType. + */ + pricingSchedule: Schema$PricingSchedule; + /** + * Whether this placement is the primary placement of a roadblock (placement + * group). You cannot change this field from true to false. Setting this + * field to true will automatically set the primary field on the original + * primary placement of the roadblock to false, and it will automatically + * set the roadblock's primaryPlacementId field to the ID of this + * placement. + */ + primary: boolean; + /** + * Information about the last publisher update. This is a read-only field. + */ + publisherUpdateInfo: Schema$LastModifiedInfo; + /** + * Site ID associated with this placement. On insert, you must set either + * this field or the directorySiteId field to specify the site associated + * with this placement. This is a required field that is read-only after + * insertion. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Size associated with this placement. When inserting or updating a + * placement, only the size ID field is used. This field is required on + * insertion. + */ + size: Schema$Size; + /** + * Whether creatives assigned to this placement must be SSL-compliant. + */ + sslRequired: boolean; + /** + * Third-party placement status. + */ + status: string; + /** + * Subaccount ID of this placement. This field can be left blank. + */ + subaccountId: string; + /** + * Tag formats to generate for this placement. This field is required on + * insertion. Acceptable values are: - "PLACEMENT_TAG_STANDARD" - + * "PLACEMENT_TAG_IFRAME_JAVASCRIPT" - + * "PLACEMENT_TAG_IFRAME_ILAYER" - + * "PLACEMENT_TAG_INTERNAL_REDIRECT" - + * "PLACEMENT_TAG_JAVASCRIPT" - + * "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" - + * "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" - + * "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" - + * "PLACEMENT_TAG_CLICK_COMMANDS" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" - + * "PLACEMENT_TAG_TRACKING" - + * "PLACEMENT_TAG_TRACKING_IFRAME" - + * "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + */ + tagFormats: string[]; + /** + * Tag settings for this placement. + */ + tagSetting: Schema$TagSetting; + /** + * Whether Verification and ActiveView are disabled for in-stream video + * creatives for this placement. The same setting videoActiveViewOptOut + * exists on the site level -- the opt out occurs if either of these + * settings are true. These settings are distinct from + * DirectorySites.settings.activeViewOptOut or + * Sites.siteSettings.activeViewOptOut which only apply to display ads. + * However, Accounts.activeViewOptOut opts out both video traffic, as well + * as display ads, from Verification and ActiveView. + */ + videoActiveViewOptOut: boolean; + /** + * A collection of settings which affect video creatives served through this + * placement. Applicable to placements with IN_STREAM_VIDEO compatibility. + */ + videoSettings: Schema$VideoSettings; + /** + * VPAID adapter setting for this placement. Controls which VPAID format the + * measurement adapter will use for in-stream video creatives assigned to + * this placement. Note: Flash is no longer supported. This field now + * defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoice: string; + } + /** + * Placement Assignment. + */ + export interface Schema$PlacementAssignment { + /** + * Whether this placement assignment is active. When true, the placement + * will be included in the ad's rotation. + */ + active: boolean; + /** + * ID of the placement to be assigned. This is a required field. + */ + placementId: string; + /** + * Dimension value for the ID of the placement. This is a read-only, + * auto-generated field. + */ + placementIdDimensionValue: Schema$DimensionValue; + /** + * Whether the placement to be assigned requires SSL. This is a read-only + * field that is auto-generated when the ad is inserted or updated. + */ + sslRequired: boolean; + } + /** + * Contains properties of a package or roadblock. + */ + export interface Schema$PlacementGroup { + /** + * Account ID of this placement group. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this placement group. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this placement group is archived. + */ + archived: boolean; + /** + * Campaign ID of this placement group. This field is required on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * IDs of placements which are assigned to this placement group. This is a + * read-only, auto-generated field. + */ + childPlacementIds: string[]; + /** + * Comments for this placement group. + */ + comment: string; + /** + * ID of the content category assigned to this placement group. + */ + contentCategoryId: string; + /** + * Information about the creation of this placement group. This is a + * read-only field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Directory site ID associated with this placement group. On insert, you + * must set either this field or the site_id field to specify the site + * associated with this placement group. This is a required field that is + * read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * External ID for this placement. + */ + externalId: string; + /** + * ID of this placement group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this placement group. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementGroup". + */ + kind: string; + /** + * Information about the most recent modification of this placement group. + * This is a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this placement group. This is a required field and must be less + * than 256 characters long. + */ + name: string; + /** + * Type of this placement group. A package is a simple group of placements + * that acts as a single pricing point for a group of tags. A roadblock is a + * group of placements that not only acts as a single pricing point, but + * also assumes that all the tags in it will be served at the same time. A + * roadblock requires one of its assigned placements to be marked as primary + * for reporting. This field is required on insertion. + */ + placementGroupType: string; + /** + * ID of the placement strategy assigned to this placement group. + */ + placementStrategyId: string; + /** + * Pricing schedule of this placement group. This field is required on + * insertion. + */ + pricingSchedule: Schema$PricingSchedule; + /** + * ID of the primary placement, used to calculate the media cost of a + * roadblock (placement group). Modifying this field will automatically + * modify the primary field on all affected roadblock child placements. + */ + primaryPlacementId: string; + /** + * Dimension value for the ID of the primary placement. This is a read-only, + * auto-generated field. + */ + primaryPlacementIdDimensionValue: Schema$DimensionValue; + /** + * Site ID associated with this placement group. On insert, you must set + * either this field or the directorySiteId field to specify the site + * associated with this placement group. This is a required field that is + * read-only after insertion. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Subaccount ID of this placement group. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Placement Group List Response + */ + export interface Schema$PlacementGroupsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement group collection. + */ + placementGroups: Schema$PlacementGroup[]; + } + /** + * Placement GenerateTags Response + */ + export interface Schema$PlacementsGenerateTagsResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementsGenerateTagsResponse". + */ + kind: string; + /** + * Set of generated tags for the specified placements. + */ + placementTags: Schema$PlacementTag[]; + } + /** + * Placement List Response + */ + export interface Schema$PlacementsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement collection. + */ + placements: Schema$Placement[]; + } + /** + * Placement Strategy List Response + */ + export interface Schema$PlacementStrategiesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementStrategiesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement strategy collection. + */ + placementStrategies: Schema$PlacementStrategy[]; + } + /** + * Contains properties of a placement strategy. + */ + export interface Schema$PlacementStrategy { + /** + * Account ID of this placement strategy.This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this placement strategy. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementStrategy". + */ + kind: string; + /** + * Name of this placement strategy. This is a required field. It must be + * less than 256 characters long and unique among placement strategies of + * the same account. + */ + name: string; + } + /** + * Placement Tag + */ + export interface Schema$PlacementTag { + /** + * Placement ID + */ + placementId: string; + /** + * Tags generated for this placement. + */ + tagDatas: Schema$TagData[]; + } + /** + * Contains information about a platform type that can be targeted by ads. + */ + export interface Schema$PlatformType { + /** + * ID of this platform type. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#platformType". + */ + kind: string; + /** + * Name of this platform type. + */ + name: string; + } + /** + * Platform Type List Response + */ + export interface Schema$PlatformTypesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#platformTypesListResponse". + */ + kind: string; + /** + * Platform type collection. + */ + platformTypes: Schema$PlatformType[]; + } + /** + * Popup Window Properties. + */ + export interface Schema$PopupWindowProperties { + /** + * Popup dimension for a creative. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA and all VPAID + */ + dimension: Schema$Size; + /** + * Upper-left corner coordinates of the popup window. Applicable if + * positionType is COORDINATES. + */ + offset: Schema$OffsetPosition; + /** + * Popup window position either centered or at specific coordinate. + */ + positionType: string; + /** + * Whether to display the browser address bar. + */ + showAddressBar: boolean; + /** + * Whether to display the browser menu bar. + */ + showMenuBar: boolean; + /** + * Whether to display the browser scroll bar. + */ + showScrollBar: boolean; + /** + * Whether to display the browser status bar. + */ + showStatusBar: boolean; + /** + * Whether to display the browser tool bar. + */ + showToolBar: boolean; + /** + * Title of popup window. + */ + title: string; + } + /** + * Contains information about a postal code that can be targeted by ads. + */ + export interface Schema$PostalCode { + /** + * Postal code. This is equivalent to the id field. + */ + code: string; + /** + * Country code of the country to which this postal code belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this postal code belongs. + */ + countryDartId: string; + /** + * ID of this postal code. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#postalCode". + */ + kind: string; + } + /** + * Postal Code List Response + */ + export interface Schema$PostalCodesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#postalCodesListResponse". + */ + kind: string; + /** + * Postal code collection. + */ + postalCodes: Schema$PostalCode[]; + } + /** + * Pricing Information + */ + export interface Schema$Pricing { + /** + * Cap cost type of this inventory item. + */ + capCostType: string; + /** + * End date of this inventory item. + */ + endDate: string; + /** + * Flights of this inventory item. A flight (a.k.a. pricing period) + * represents the inventory item pricing information for a specific period + * of time. + */ + flights: Schema$Flight[]; + /** + * Group type of this inventory item if it represents a placement group. Is + * null otherwise. There are two type of placement groups: + * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory + * items that acts as a single pricing point for a group of tags. + * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items + * that not only acts as a single pricing point, but also assumes that all + * the tags in it will be served at the same time. A roadblock requires one + * of its assigned inventory items to be marked as primary. + */ + groupType: string; + /** + * Pricing type of this inventory item. + */ + pricingType: string; + /** + * Start date of this inventory item. + */ + startDate: string; + } + /** + * Pricing Schedule + */ + export interface Schema$PricingSchedule { + /** + * Placement cap cost option. + */ + capCostOption: string; + /** + * Whether cap costs are ignored by ad serving. + */ + disregardOverdelivery: boolean; + /** + * Placement end date. This date must be later than, or the same day as, the + * placement start date, but not later than the campaign end date. If, for + * example, you set 6/25/2015 as both the start and end dates, the effective + * placement date is just that day only, 6/25/2015. The hours, minutes, and + * seconds of the end date should not be set, as doing so will result in an + * error. This field is required on insertion. + */ + endDate: string; + /** + * Whether this placement is flighted. If true, pricing periods will be + * computed automatically. + */ + flighted: boolean; + /** + * Floodlight activity ID associated with this placement. This field should + * be set when placement pricing type is set to PRICING_TYPE_CPA. + */ + floodlightActivityId: string; + /** + * Pricing periods for this placement. + */ + pricingPeriods: Schema$PricingSchedulePricingPeriod[]; + /** + * Placement pricing type. This field is required on insertion. + */ + pricingType: string; + /** + * Placement start date. This date must be later than, or the same day as, + * the campaign start date. The hours, minutes, and seconds of the start + * date should not be set, as doing so will result in an error. This field + * is required on insertion. + */ + startDate: string; + /** + * Testing start date of this placement. The hours, minutes, and seconds of + * the start date should not be set, as doing so will result in an error. + */ + testingStartDate: string; + } + /** + * Pricing Period + */ + export interface Schema$PricingSchedulePricingPeriod { + /** + * Pricing period end date. This date must be later than, or the same day + * as, the pricing period start date, but not later than the placement end + * date. The period end date can be the same date as the period start date. + * If, for example, you set 6/25/2015 as both the start and end dates, the + * effective pricing period date is just that day only, 6/25/2015. The + * hours, minutes, and seconds of the end date should not be set, as doing + * so will result in an error. + */ + endDate: string; + /** + * Comments for this pricing period. + */ + pricingComment: string; + /** + * Rate or cost of this pricing period in nanos (i.e., multipled by + * 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. + */ + rateOrCostNanos: string; + /** + * Pricing period start date. This date must be later than, or the same day + * as, the placement start date. The hours, minutes, and seconds of the + * start date should not be set, as doing so will result in an error. + */ + startDate: string; + /** + * Units of this pricing period. Acceptable values are 0 to 10000000000, + * inclusive. + */ + units: string; + } + /** + * Contains properties of a DoubleClick Planning project. + */ + export interface Schema$Project { + /** + * Account ID of this project. + */ + accountId: string; + /** + * Advertiser ID of this project. + */ + advertiserId: string; + /** + * Audience age group of this project. + */ + audienceAgeGroup: string; + /** + * Audience gender of this project. + */ + audienceGender: string; + /** + * Budget of this project in the currency specified by the current account. + * The value stored in this field represents only the non-fractional amount. + * For example, for USD, the smallest value that can be represented by this + * field is 1 US dollar. + */ + budget: string; + /** + * Client billing code of this project. + */ + clientBillingCode: string; + /** + * Name of the project client. + */ + clientName: string; + /** + * End date of the project. + */ + endDate: string; + /** + * ID of this project. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#project". + */ + kind: string; + /** + * Information about the most recent modification of this project. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this project. + */ + name: string; + /** + * Overview of this project. + */ + overview: string; + /** + * Start date of the project. + */ + startDate: string; + /** + * Subaccount ID of this project. + */ + subaccountId: string; + /** + * Number of clicks that the advertiser is targeting. + */ + targetClicks: string; + /** + * Number of conversions that the advertiser is targeting. + */ + targetConversions: string; + /** + * CPA that the advertiser is targeting. + */ + targetCpaNanos: string; + /** + * CPC that the advertiser is targeting. + */ + targetCpcNanos: string; + /** + * vCPM from Active View that the advertiser is targeting. + */ + targetCpmActiveViewNanos: string; + /** + * CPM that the advertiser is targeting. + */ + targetCpmNanos: string; + /** + * Number of impressions that the advertiser is targeting. + */ + targetImpressions: string; + } + /** + * Project List Response + */ + export interface Schema$ProjectsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#projectsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Project collection. + */ + projects: Schema$Project[]; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "REACH". */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Videoformats { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.videoFormats.get - * @desc Gets one video format by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * // Video format ID. - * id: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.videoFormats.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.videoFormats.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id Video format ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ReachReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#reachReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected as activity metrics to pivot + * on in the "activities" section of the report. + */ + pivotedActivityMetrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected in the + * "reachByFrequencyMetricNames" section of the report. + */ + reachByFrequencyMetrics: Schema$Metric[]; + } + /** + * Represents a recipient. + */ + export interface Schema$Recipient { + /** + * The delivery type for the recipient. + */ + deliveryType: string; + /** + * The email address of the recipient. + */ + email: string; + /** + * The kind of resource this is, in this case dfareporting#recipient. + */ + kind: string; + } + /** + * Contains information about a region that can be targeted by ads. + */ + export interface Schema$Region { + /** + * Country code of the country to which this region belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this region belongs. + */ + countryDartId: string; + /** + * DART ID of this region. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#region". + */ + kind: string; + /** + * Name of this region. + */ + name: string; + /** + * Region code. + */ + regionCode: string; + } + /** + * Region List Response + */ + export interface Schema$RegionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#regionsListResponse". + */ + kind: string; + /** + * Region collection. + */ + regions: Schema$Region[]; + } + /** + * Contains properties of a remarketing list. Remarketing enables you to + * create lists of users who have performed specific actions on a site, then + * target ads to members of those lists. This resource can be used to manage + * remarketing lists that are owned by your advertisers. To see all + * remarketing lists that are visible to your advertisers, including those + * that are shared to your advertiser or account, use the + * TargetableRemarketingLists resource. + */ + export interface Schema$RemarketingList { + /** + * Account ID of this remarketing list. This is a read-only, auto-generated + * field that is only returned in GET requests. + */ + accountId: string; + /** + * Whether this remarketing list is active. + */ + active: boolean; + /** + * Dimension value for the advertiser ID that owns this remarketing list. + * This is a required field. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Remarketing list description. + */ + description: string; + /** + * Remarketing list ID. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingList". + */ + kind: string; + /** + * Number of days that a user should remain in the remarketing list without + * an impression. Acceptable values are 1 to 540, inclusive. + */ + lifeSpan: string; + /** + * Rule used to populate the remarketing list with users. + */ + listPopulationRule: Schema$ListPopulationRule; + /** + * Number of users currently in the list. This is a read-only field. + */ + listSize: string; + /** + * Product from which this remarketing list was originated. + */ + listSource: string; + /** + * Name of the remarketing list. This is a required field. Must be no + * greater than 128 characters long. + */ + name: string; + /** + * Subaccount ID of this remarketing list. This is a read-only, + * auto-generated field that is only returned in GET requests. + */ + subaccountId: string; + } + /** + * Contains properties of a remarketing list's sharing information. + * Sharing allows other accounts or advertisers to target to your remarketing + * lists. This resource can be used to manage remarketing list sharing to + * other accounts and advertisers. + */ + export interface Schema$RemarketingListShare { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingListShare". + */ + kind: string; + /** + * Remarketing list ID. This is a read-only, auto-generated field. + */ + remarketingListId: string; + /** + * Accounts that the remarketing list is shared with. + */ + sharedAccountIds: string[]; + /** + * Advertisers that the remarketing list is shared with. + */ + sharedAdvertiserIds: string[]; + } + /** + * Remarketing list response + */ + export interface Schema$RemarketingListsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingListsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Remarketing list collection. + */ + remarketingLists: Schema$RemarketingList[]; + } + /** + * Represents a Report resource. + */ + export interface Schema$Report { + /** + * The account ID to which this report belongs. + */ + accountId: string; + /** + * The report criteria for a report of type "STANDARD". + */ + criteria: any; + /** + * The report criteria for a report of type + * "CROSS_DIMENSION_REACH". + */ + crossDimensionReachCriteria: any; + /** + * The report's email delivery settings. + */ + delivery: any; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The filename used when generating report files for this report. + */ + fileName: string; + /** + * The report criteria for a report of type "FLOODLIGHT". + */ + floodlightCriteria: any; + /** + * The output format of the report. If not specified, default format is + * "CSV". Note that the actual format in the completed report file + * might differ if for instance the report's size exceeds the + * format's capabilities. "CSV" will then be the fallback + * format. + */ + format: string; + /** + * The unique ID identifying this report resource. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#report. + */ + kind: string; + /** + * The timestamp (in milliseconds since epoch) of when this report was last + * modified. + */ + lastModifiedTime: string; + /** + * The name of the report. + */ + name: string; + /** + * The user profile id of the owner of this report. + */ + ownerProfileId: string; + /** + * The report criteria for a report of type "PATH_TO_CONVERSION". + */ + pathToConversionCriteria: any; + /** + * The report criteria for a report of type "REACH". + */ + reachCriteria: any; + /** + * The report's schedule. Can only be set if the report's + * 'dateRange' is a relative date range and the relative date range + * is not "TODAY". + */ + schedule: any; + /** + * The subaccount ID to which this report belongs if applicable. + */ + subAccountId: string; + /** + * The type of the report. + */ + type: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "STANDARD". */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/videoFormats/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#reportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected as activity metrics to pivot + * on in the "activities" section of the report. + */ + pivotedActivityMetrics: Schema$Metric[]; + } + /** + * Represents the list of reports. + */ + export interface Schema$ReportList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The reports returned in this response. + */ + items: Schema$Report[]; + /** + * The kind of list this is, in this case dfareporting#reportList. + */ + kind: string; + /** + * Continuation token used to page through reports. To retrieve the next + * page of results, set the next request's "pageToken" to the + * value of this field. The page token is only valid for a limited amount of + * time and should not be persisted. + */ + nextPageToken: string; + } + /** + * Reporting Configuration + */ + export interface Schema$ReportsConfiguration { + /** + * Whether the exposure to conversion report is enabled. This report shows + * detailed pathway information on up to 10 of the most recent ad exposures + * seen by a user before converting. + */ + exposureToConversionEnabled: boolean; + /** + * Default lookback windows for new advertisers in this account. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Report generation time zone ID of this account. This is a required field + * that can only be changed by a superuser. Acceptable values are: - + * "1" for "America/New_York" - "2" for + * "Europe/London" - "3" for "Europe/Paris" + * - "4" for "Africa/Johannesburg" - "5" for + * "Asia/Jerusalem" - "6" for "Asia/Shanghai" + * - "7" for "Asia/Hong_Kong" - "8" for + * "Asia/Tokyo" - "9" for "Australia/Sydney" + * - "10" for "Asia/Dubai" - "11" for + * "America/Los_Angeles" - "12" for + * "Pacific/Auckland" - "13" for + * "America/Sao_Paulo" + */ + reportGenerationTimeZoneId: string; + } + /** + * Rich Media Exit Override. + */ + export interface Schema$RichMediaExitOverride { + /** + * Click-through URL of this rich media exit override. Applicable if the + * enabled field is set to true. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Whether to use the clickThroughUrl. If false, the creative-level exit + * will be used. + */ + enabled: boolean; + /** + * ID for the override to refer to a specific exit in the creative. + */ + exitId: string; + } + /** + * A rule associates an asset with a targeting template for asset-level + * targeting. Applicable to INSTREAM_VIDEO creatives. + */ + export interface Schema$Rule { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in + * this creative. This is a required field. + */ + assetId: string; + /** + * A user-friendly name for this rule. This is a required field. + */ + name: string; + /** + * A targeting template ID. The targeting from the targeting template will + * be used to determine whether this asset should be served. This is a + * required field. + */ + targetingTemplateId: string; + } + /** + * Contains properties of a site. + */ + export interface Schema$Site { + /** + * Account ID of this site. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Whether this site is approved. + */ + approved: boolean; + /** + * Directory site associated with this site. This is a required field that + * is read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * ID of this site. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this site. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key name of this site. This is a read-only, auto-generated field. + */ + keyName: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#site". + */ + kind: string; + /** + * Name of this site.This is a required field. Must be less than 128 + * characters long. If this site is under a subaccount, the name must be + * unique among sites of the same subaccount. Otherwise, this site is a + * top-level site, and the name must be unique among top-level sites of the + * same account. + */ + name: string; + /** + * Site contacts. + */ + siteContacts: Schema$SiteContact[]; + /** + * Site-wide settings. + */ + siteSettings: Schema$SiteSettings; + /** + * Subaccount ID of this site. This is a read-only field that can be left + * blank. + */ + subaccountId: string; + } + /** + * Site Contact + */ + export interface Schema$SiteContact { + /** + * Address of this site contact. + */ + address: string; + /** + * Site contact type. + */ + contactType: string; + /** + * Email address of this site contact. This is a required field. + */ + email: string; + /** + * First name of this site contact. + */ + firstName: string; + /** + * ID of this site contact. This is a read-only, auto-generated field. + */ + id: string; + /** + * Last name of this site contact. + */ + lastName: string; + /** + * Primary phone number of this site contact. + */ + phone: string; + /** + * Title or designation of this site contact. + */ + title: string; + } + /** + * Site Settings + */ + export interface Schema$SiteSettings { + /** + * Whether active view creatives are disabled for this site. + */ + activeViewOptOut: boolean; + /** + * Whether this site opts out of ad blocking. When true, ad blocking is + * disabled for all placements under the site, regardless of the individual + * placement settings. When false, the campaign and placement settings take + * effect. + */ + adBlockingOptOut: boolean; + /** + * Site-wide creative settings. + */ + creativeSettings: Schema$CreativeSettings; + /** + * Whether new cookies are disabled for this site. + */ + disableNewCookie: boolean; + /** + * Lookback window settings for this site. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Configuration settings for dynamic and image floodlight tags. + */ + tagSetting: Schema$TagSetting; + /** + * Whether Verification and ActiveView for in-stream video creatives are + * disabled by default for new placements created under this site. This + * value will be used to populate the placement.videoActiveViewOptOut field, + * when no value is specified for the new placement. + */ + videoActiveViewOptOutTemplate: boolean; + /** + * Default VPAID adapter setting for new placements created under this site. + * This value will be used to populate the placements.vpaidAdapterChoice + * field, when no value is specified for the new placement. Controls which + * VPAID format the measurement adapter will use for in-stream video + * creatives assigned to the placement. The publisher's specifications + * will typically determine this setting. For VPAID creatives, the adapter + * format will match the VPAID format (HTML5 VPAID creatives use the HTML5 + * adapter). Note: Flash is no longer supported. This field now defaults to + * HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoiceTemplate: string; + } + /** + * Site List Response + */ + export interface Schema$SitesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#sitesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Site collection. + */ + sites: Schema$Site[]; + } + /** + * Represents the dimensions of ads, placements, creatives, or creative + * assets. + */ + export interface Schema$Size { + /** + * Height of this size. Acceptable values are 0 to 32767, inclusive. + */ + height: number; + /** + * IAB standard size. This is a read-only, auto-generated field. + */ + iab: boolean; + /** + * ID of this size. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#size". + */ + kind: string; + /** + * Width of this size. Acceptable values are 0 to 32767, inclusive. + */ + width: number; + } + /** + * Size List Response + */ + export interface Schema$SizesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#sizesListResponse". + */ + kind: string; + /** + * Size collection. + */ + sizes: Schema$Size[]; + } + /** + * Skippable Settings + */ + export interface Schema$SkippableSetting { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#skippableSetting". + */ + kind: string; + /** + * Amount of time to play videos served to this placement before counting a + * view. Applicable when skippable is true. + */ + progressOffset: Schema$VideoOffset; + /** + * Amount of time to play videos served to this placement before the skip + * button should appear. Applicable when skippable is true. + */ + skipOffset: Schema$VideoOffset; + /** + * Whether the user can skip creatives served to this placement. + */ + skippable: boolean; + } + /** + * Represents a sorted dimension. + */ + export interface Schema$SortedDimension { + /** + * The kind of resource this is, in this case dfareporting#sortedDimension. + */ + kind: string; + /** + * The name of the dimension. + */ + name: string; + /** + * An optional sort order for the dimension column. + */ + sortOrder: string; + } + /** + * Contains properties of a DCM subaccount. + */ + export interface Schema$Subaccount { + /** + * ID of the account that contains this subaccount. This is a read-only + * field that can be left blank. + */ + accountId: string; + /** + * IDs of the available user role permissions for this subaccount. + */ + availablePermissionIds: string[]; + /** + * ID of this subaccount. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#subaccount". + */ + kind: string; + /** + * Name of this subaccount. This is a required field. Must be less than 128 + * characters long and be unique among subaccounts of the same account. + */ + name: string; + } + /** + * Subaccount List Response + */ + export interface Schema$SubaccountsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#subaccountsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Subaccount collection. + */ + subaccounts: Schema$Subaccount[]; + } + /** + * Placement Tag Data + */ + export interface Schema$TagData { + /** + * Ad associated with this placement tag. Applicable only when format is + * PLACEMENT_TAG_TRACKING. + */ + adId: string; + /** + * Tag string to record a click. + */ + clickTag: string; + /** + * Creative associated with this placement tag. Applicable only when format + * is PLACEMENT_TAG_TRACKING. + */ + creativeId: string; + /** + * TagData tag format of this tag. + */ + format: string; + /** + * Tag string for serving an ad. + */ + impressionTag: string; + } + /** + * Tag Settings + */ + export interface Schema$TagSetting { + /** + * Additional key-values to be included in tags. Each key-value pair must be + * of the form key=value, and pairs must be separated by a semicolon (;). + * Keys and values must not contain commas. For example, id=2;color=red is a + * valid value for this field. + */ + additionalKeyValues: string; + /** + * Whether static landing page URLs should be included in the tags. This + * setting applies only to placements. + */ + includeClickThroughUrls: boolean; + /** + * Whether click-tracking string should be included in the tags. + */ + includeClickTracking: boolean; + /** + * Option specifying how keywords are embedded in ad tags. This setting can + * be used to specify whether keyword placeholders are inserted in placement + * tags for this site. Publishers can then add keywords to those + * placeholders. + */ + keywordOption: string; + } + /** + * Dynamic and Image Tag Settings. + */ + export interface Schema$TagSettings { + /** + * Whether dynamic floodlight tags are enabled. + */ + dynamicTagEnabled: boolean; + /** + * Whether image tags are enabled. + */ + imageTagEnabled: boolean; + } + /** + * Contains properties of a targetable remarketing list. Remarketing enables + * you to create lists of users who have performed specific actions on a site, + * then target ads to members of those lists. This resource is a read-only + * view of a remarketing list to be used to faciliate targeting ads to + * specific lists. Remarketing lists that are owned by your advertisers and + * those that are shared to your advertisers or account are accessible via + * this resource. To manage remarketing lists that are owned by your + * advertisers, use the RemarketingLists resource. + */ + export interface Schema$TargetableRemarketingList { + /** + * Account ID of this remarketing list. This is a read-only, auto-generated + * field that is only returned in GET requests. + */ + accountId: string; + /** + * Whether this targetable remarketing list is active. + */ + active: boolean; + /** + * Dimension value for the advertiser ID that owns this targetable + * remarketing list. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Targetable remarketing list description. + */ + description: string; + /** + * Targetable remarketing list ID. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetableRemarketingList". + */ + kind: string; + /** + * Number of days that a user should remain in the targetable remarketing + * list without an impression. + */ + lifeSpan: string; + /** + * Number of users currently in the list. This is a read-only field. + */ + listSize: string; + /** + * Product from which this targetable remarketing list was originated. + */ + listSource: string; + /** + * Name of the targetable remarketing list. Is no greater than 128 + * characters long. + */ + name: string; + /** + * Subaccount ID of this remarketing list. This is a read-only, + * auto-generated field that is only returned in GET requests. + */ + subaccountId: string; + } + /** + * Targetable remarketing list response + */ + export interface Schema$TargetableRemarketingListsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetableRemarketingListsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Targetable remarketing list collection. + */ + targetableRemarketingLists: Schema$TargetableRemarketingList[]; + } + /** + * Contains properties of a targeting template. A targeting template + * encapsulates targeting information which can be reused across multiple ads. + */ + export interface Schema$TargetingTemplate { + /** + * Account ID of this targeting template. This field, if left unset, will be + * auto-generated on insert and is read-only after insert. + */ + accountId: string; + /** + * Advertiser ID of this targeting template. This is a required field on + * insert and is read-only after insert. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Time and day targeting criteria. + */ + dayPartTargeting: Schema$DayPartTargeting; + /** + * Geographical targeting criteria. + */ + geoTargeting: Schema$GeoTargeting; + /** + * ID of this targeting template. This is a read-only, auto-generated field. + */ + id: string; + /** + * Key-value targeting criteria. + */ + keyValueTargetingExpression: Schema$KeyValueTargetingExpression; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetingTemplate". + */ + kind: string; + /** + * Language targeting criteria. + */ + languageTargeting: Schema$LanguageTargeting; + /** + * Remarketing list targeting criteria. + */ + listTargetingExpression: Schema$ListTargetingExpression; + /** + * Name of this targeting template. This field is required. It must be less + * than 256 characters long and unique within an advertiser. + */ + name: string; + /** + * Subaccount ID of this targeting template. This field, if left unset, will + * be auto-generated on insert and is read-only after insert. + */ + subaccountId: string; + /** + * Technology platform targeting criteria. + */ + technologyTargeting: Schema$TechnologyTargeting; + } + /** + * Targeting Template List Response + */ + export interface Schema$TargetingTemplatesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetingTemplatesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Targeting template collection. + */ + targetingTemplates: Schema$TargetingTemplate[]; + } + /** + * Target Window. + */ + export interface Schema$TargetWindow { + /** + * User-entered value. + */ + customHtml: string; + /** + * Type of browser window for which the backup image of the flash creative + * can be displayed. + */ + targetWindowOption: string; + } + /** + * Technology Targeting. + */ + export interface Schema$TechnologyTargeting { + /** + * Browsers that this ad targets. For each browser either set + * browserVersionId or dartId along with the version numbers. If both are + * specified, only browserVersionId will be used. The other fields are + * populated automatically when the ad is inserted or updated. + */ + browsers: Schema$Browser[]; + /** + * Connection types that this ad targets. For each connection type only id + * is required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + connectionTypes: Schema$ConnectionType[]; + /** + * Mobile carriers that this ad targets. For each mobile carrier only id is + * required, and the other fields are populated automatically when the ad is + * inserted or updated. If targeting a mobile carrier, do not set targeting + * for any zip codes. + */ + mobileCarriers: Schema$MobileCarrier[]; + /** + * Operating systems that this ad targets. To target specific versions, use + * operatingSystemVersions. For each operating system only dartId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting an operating system, do not set + * targeting for operating system versions for the same operating system. + */ + operatingSystems: Schema$OperatingSystem[]; + /** + * Operating system versions that this ad targets. To target all versions, + * use operatingSystems. For each operating system version, only id is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting an operating system version, do not set + * targeting for the corresponding operating system in operatingSystems. + */ + operatingSystemVersions: Schema$OperatingSystemVersion[]; + /** + * Platform types that this ad targets. For example, desktop, mobile, or + * tablet. For each platform type, only id is required, and the other fields + * are populated automatically when the ad is inserted or updated. + */ + platformTypes: Schema$PlatformType[]; + } + /** + * Third Party Authentication Token + */ + export interface Schema$ThirdPartyAuthenticationToken { + /** + * Name of the third-party authentication token. + */ + name: string; + /** + * Value of the third-party authentication token. This is a read-only, + * auto-generated field. + */ + value: string; + } + /** + * Third-party Tracking URL. + */ + export interface Schema$ThirdPartyTrackingUrl { + /** + * Third-party URL type for in-stream video creatives. + */ + thirdPartyUrlType: string; + /** + * URL for the specified third-party URL type. + */ + url: string; + } + /** + * Transcode Settings + */ + export interface Schema$TranscodeSetting { + /** + * Whitelist of video formats to be served to this placement. Set this list + * to null or empty to serve all video formats. + */ + enabledVideoFormats: number[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#transcodeSetting". + */ + kind: string; } - - /** - * dfareporting.videoFormats.list - * @desc Lists available video formats. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dfareporting - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dfareporting = google.dfareporting('v2.8'); - * - * authorize(function(authClient) { - * var request = { - * // User profile ID associated with this request. - * profileId: '0', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dfareporting.videoFormats.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/doubleclick-advertisers/authorizing#examples - * // - * // Authorize using the following scope: - * // 'https://www.googleapis.com/auth/dfatrafficking' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias dfareporting.videoFormats.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following + * creative types: INSTREAM_VIDEO and VPAID. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v2.8/userprofiles/{profileId}/videoFormats') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$UniversalAdId { + /** + * Registry used for the Ad ID value. + */ + registry: string; + /** + * ID value for this creative. Only alphanumeric characters and the + * following symbols are valid: "_/\-". Maximum length is 64 + * characters. Read only when registry is DCM. + */ + value: string; + } + /** + * User Defined Variable configuration. + */ + export interface Schema$UserDefinedVariableConfiguration { + /** + * Data type for the variable. This is a required field. + */ + dataType: string; + /** + * User-friendly name for the variable which will appear in reports. This is + * a required field, must be less than 64 characters long, and cannot + * contain the following characters: ""<>". + */ + reportName: string; + /** + * Variable name in the tag. This is a required field. + */ + variableType: string; + } + /** + * Represents a UserProfile resource. + */ + export interface Schema$UserProfile { + /** + * The account ID to which this profile belongs. + */ + accountId: string; + /** + * The account name this profile belongs to. + */ + accountName: string; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The kind of resource this is, in this case dfareporting#userProfile. + */ + kind: string; + /** + * The unique ID of the user profile. + */ + profileId: string; + /** + * The sub account ID this profile belongs to if applicable. + */ + subAccountId: string; + /** + * The sub account name this profile belongs to if applicable. + */ + subAccountName: string; + /** + * The user name. + */ + userName: string; + } + /** + * Represents the list of user profiles. + */ + export interface Schema$UserProfileList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The user profiles returned in this response. + */ + items: Schema$UserProfile[]; + /** + * The kind of list this is, in this case dfareporting#userProfileList. + */ + kind: string; + } + /** + * Contains properties of auser role, which is used to manage user access. + */ + export interface Schema$UserRole { + /** + * Account ID of this user role. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Whether this is a default user role. Default user roles are created by + * the system for the account/subaccount and cannot be modified or deleted. + * Each default user role comes with a basic set of preassigned permissions. + */ + defaultUserRole: boolean; + /** + * ID of this user role. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRole". + */ + kind: string; + /** + * Name of this user role. This is a required field. Must be less than 256 + * characters long. If this user role is under a subaccount, the name must + * be unique among sites of the same subaccount. Otherwise, this user role + * is a top-level user role, and the name must be unique among top-level + * user roles of the same account. + */ + name: string; + /** + * ID of the user role that this user role is based on or copied from. This + * is a required field. + */ + parentUserRoleId: string; + /** + * List of permissions associated with this user role. + */ + permissions: Schema$UserRolePermission[]; + /** + * Subaccount ID of this user role. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + } + /** + * Contains properties of a user role permission. + */ + export interface Schema$UserRolePermission { + /** + * Levels of availability for a user role permission. + */ + availability: string; + /** + * ID of this user role permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermission". + */ + kind: string; + /** + * Name of this user role permission. + */ + name: string; + /** + * ID of the permission group that this user role permission belongs to. + */ + permissionGroupId: string; + } + /** + * Represents a grouping of related user role permissions. + */ + export interface Schema$UserRolePermissionGroup { + /** + * ID of this user role permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionGroup". + */ + kind: string; + /** + * Name of this user role permission group. + */ + name: string; + } + /** + * User Role Permission Group List Response + */ + export interface Schema$UserRolePermissionGroupsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionGroupsListResponse". + */ + kind: string; + /** + * User role permission group collection. + */ + userRolePermissionGroups: Schema$UserRolePermissionGroup[]; + } + /** + * User Role Permission List Response + */ + export interface Schema$UserRolePermissionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionsListResponse". + */ + kind: string; + /** + * User role permission collection. + */ + userRolePermissions: Schema$UserRolePermission[]; + } + /** + * User Role List Response + */ + export interface Schema$UserRolesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * User role collection. + */ + userRoles: Schema$UserRole[]; + } + /** + * Contains information about supported video formats. + */ + export interface Schema$VideoFormat { + /** + * File type of the video format. + */ + fileType: string; + /** + * ID of the video format. + */ + id: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoFormat". + */ + kind: string; + /** + * The resolution of this video format. + */ + resolution: Schema$Size; + /** + * The target bit rate of this video format. + */ + targetBitRate: number; + } + /** + * Video Format List Response + */ + export interface Schema$VideoFormatsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoFormatsListResponse". + */ + kind: string; + /** + * Video format collection. + */ + videoFormats: Schema$VideoFormat[]; + } + /** + * Video Offset + */ + export interface Schema$VideoOffset { + /** + * Duration, as a percentage of video duration. Do not set when + * offsetSeconds is set. Acceptable values are 0 to 100, inclusive. + */ + offsetPercentage: number; + /** + * Duration, in seconds. Do not set when offsetPercentage is set. Acceptable + * values are 0 to 86399, inclusive. + */ + offsetSeconds: number; + } + /** + * Video Settings + */ + export interface Schema$VideoSettings { + /** + * Settings for the companion creatives of video creatives served to this + * placement. + */ + companionSettings: Schema$CompanionSetting; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoSettings". + */ + kind: string; + /** + * Settings for the skippability of video creatives served to this + * placement. If this object is provided, the creative-level skippable + * settings will be overridden. + */ + skippableSettings: Schema$SkippableSetting; + /** + * Settings for the transcodes of video creatives served to this placement. + * If this object is provided, the creative-level transcode settings will be + * overridden. + */ + transcodeSettings: Schema$TranscodeSetting; + } + + export class Resource$Accountactiveadsummaries { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountActiveAdSummaries.get + * @desc Gets the account's active ad summary by account ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Account ID. + * summaryAccountId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountActiveAdSummaries.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountActiveAdSummaries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.summaryAccountId Account ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'summaryAccountId'], + pathParams: ['profileId', 'summaryAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accountpermissiongroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountPermissionGroups.get + * @desc Gets one account permission group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Account permission group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountPermissionGroups.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountPermissionGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account permission group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissionGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountPermissionGroups.list + * @desc Retrieves the list of account permission groups. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountPermissionGroups.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountPermissionGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissionGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Accountpermissions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountPermissions.get + * @desc Gets one account permission by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Account permission ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountPermissions.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountPermissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account permission ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountPermissions.list + * @desc Retrieves the list of account permissions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountPermissions.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountPermissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Accounts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accounts.get + * @desc Gets one account by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Account ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accounts.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.list + * @desc Retrieves the list of accounts, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var accountsPage = response['accounts']; + * if (!accountsPage) { + * return; + * } + * for (var i = 0; i < accountsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `accountsPage`: console.log(JSON.stringify(accountsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.accounts.list(request, handlePage); + * } + * }; + * + * dfareporting.accounts.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active accounts. Don't set this field to select both active and non-active accounts. + * @param {string=} params.ids Select only accounts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.patch + * @desc Updates an existing account. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Account ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.accounts.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.update + * @desc Updates an existing account. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.accounts.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accountuserprofiles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountUserProfiles.get + * @desc Gets one account user profile by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User profile ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.accountUserProfiles.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountUserProfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User profile ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.insert + * @desc Inserts a new account user profile. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.accountUserProfiles.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountUserProfiles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.list + * @desc Retrieves a list of account user profiles, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var accountUserProfilesPage = response['accountUserProfiles']; + * if (!accountUserProfilesPage) { + * return; + * } + * for (var i = 0; i < accountUserProfilesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `accountUserProfilesPage`: + * console.log(JSON.stringify(accountUserProfilesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.accountUserProfiles.list(request, handlePage); + * } + * }; + * + * dfareporting.accountUserProfiles.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountUserProfiles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active user profiles. + * @param {string=} params.ids Select only user profiles with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only user profiles with the specified subaccount ID. + * @param {string=} params.userRoleId Select only user profiles with the specified user role ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.patch + * @desc Updates an existing account user profile. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User profile ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.accountUserProfiles.patch(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountUserProfiles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User profile ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.update + * @desc Updates an existing account user profile. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.accountUserProfiles.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.accountUserProfiles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Ads { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.ads.get + * @desc Gets one ad by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Ad ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.ads.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.ads.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Ad ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/ads/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.insert + * @desc Inserts a new ad. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.ads.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.ads.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.list + * @desc Retrieves a list of ads, possibly filtered. This method supports + * paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var adsPage = response['ads']; + * if (!adsPage) { + * return; + * } + * for (var i = 0; i < adsPage.length; i++) { + * // TODO: Change code below to process each resource in `adsPage`: + * console.log(JSON.stringify(adsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.ads.list(request, handlePage); + * } + * }; + * + * dfareporting.ads.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.ads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active ads. + * @param {string=} params.advertiserId Select only ads with this advertiser ID. + * @param {boolean=} params.archived Select only archived ads. + * @param {string=} params.audienceSegmentIds Select only ads with these audience segment IDs. + * @param {string=} params.campaignIds Select only ads with these campaign IDs. + * @param {string=} params.compatibility Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + * @param {string=} params.creativeIds Select only ads with these creative IDs assigned. + * @param {string=} params.creativeOptimizationConfigurationIds Select only ads with these creative optimization configuration IDs. + * @param {boolean=} params.dynamicClickTracker Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. + * @param {string=} params.ids Select only ads with these IDs. + * @param {string=} params.landingPageIds Select only ads with these landing page IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.overriddenEventTagId Select only ads with this event tag override ID. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.placementIds Select only ads with these placement IDs assigned. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.remarketingListIds Select only ads whose list targeting expression use these remarketing list IDs. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + * @param {string=} params.sizeIds Select only ads with these size IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {boolean=} params.sslCompliant Select only ads that are SSL-compliant. + * @param {boolean=} params.sslRequired Select only ads that require SSL. + * @param {string=} params.type Select only ads with these types. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.patch + * @desc Updates an existing ad. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Ad ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.ads.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.ads.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Ad ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.update + * @desc Updates an existing ad. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.ads.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.ads.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Advertisergroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.advertiserGroups.delete + * @desc Deletes an existing advertiser group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.advertiserGroups.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.get + * @desc Gets one advertiser group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.advertiserGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.insert + * @desc Inserts a new advertiser group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertiserGroups.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.list + * @desc Retrieves a list of advertiser groups, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var advertiserGroupsPage = response['advertiserGroups']; + * if (!advertiserGroupsPage) { + * return; + * } + * for (var i = 0; i < advertiserGroupsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `advertiserGroupsPage`: + * console.log(JSON.stringify(advertiserGroupsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.advertiserGroups.list(request, handlePage); + * } + * }; + * + * dfareporting.advertiserGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only advertiser groups with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.advertiserGroups.patch + * @desc Updates an existing advertiser group. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser group ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertiserGroups.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.update + * @desc Updates an existing advertiser group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertiserGroups.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertiserGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Advertisers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.advertisers.get + * @desc Gets one advertiser by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.advertisers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertisers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertisers/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.insert + * @desc Inserts a new advertiser. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertisers.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertisers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.list + * @desc Retrieves a list of advertisers, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var advertisersPage = response['advertisers']; + * if (!advertisersPage) { + * return; + * } + * for (var i = 0; i < advertisersPage.length; i++) { + * // TODO: Change code below to process each resource in + * `advertisersPage`: console.log(JSON.stringify(advertisersPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.advertisers.list(request, handlePage); + * } + * }; + * + * dfareporting.advertisers.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertisers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserGroupIds Select only advertisers with these advertiser group IDs. + * @param {string=} params.floodlightConfigurationIds Select only advertisers with these floodlight configuration IDs. + * @param {string=} params.ids Select only advertisers with these IDs. + * @param {boolean=} params.includeAdvertisersWithoutGroupsOnly Select only advertisers which do not belong to any advertiser group. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {boolean=} params.onlyParent Select only advertisers which use another advertiser's floodlight configuration. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.status Select only advertisers with the specified status. + * @param {string=} params.subaccountId Select only advertisers with these subaccount IDs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.patch + * @desc Updates an existing advertiser. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertisers.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertisers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.update + * @desc Updates an existing advertiser. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.advertisers.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.advertisers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Browsers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.browsers.list + * @desc Retrieves a list of browsers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.browsers.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.browsers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/browsers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Campaigncreativeassociations { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.campaignCreativeAssociations.insert + * @desc Associates a creative with the specified campaign. This method + * creates a default ad with dimensions matching the creative in the + * campaign if such a default ad does not exist already. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Campaign ID in this association. + * campaignId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.campaignCreativeAssociations.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaignCreativeAssociations.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Campaign ID in this association. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CampaignCreativeAssociation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaignCreativeAssociations.list + * @desc Retrieves the list of creative IDs associated with the specified + * campaign. This method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Campaign ID in this association. + * campaignId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var campaignCreativeAssociationsPage = + * response['campaignCreativeAssociations']; if + * (!campaignCreativeAssociationsPage) { return; + * } + * for (var i = 0; i < campaignCreativeAssociationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `campaignCreativeAssociationsPage`: + * console.log(JSON.stringify(campaignCreativeAssociationsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.campaignCreativeAssociations.list(request, + * handlePage); + * } + * }; + * + * dfareporting.campaignCreativeAssociations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaignCreativeAssociations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Campaign ID in this association. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$CampaignCreativeAssociationsListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$CampaignCreativeAssociationsListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$CampaignCreativeAssociationsListResponse>(parameters); + } + } + } + + export class Resource$Campaigns { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.campaigns.get + * @desc Gets one campaign by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Campaign ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.campaigns.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaigns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.insert + * @desc Inserts a new campaign. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Default landing page name for this new campaign. Must be less than + * 256 characters long. defaultLandingPageName: '', // TODO: Update + * placeholder value. + * + * // Default landing page URL for this new campaign. + * defaultLandingPageUrl: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.campaigns.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaigns.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.defaultLandingPageName Default landing page name for this new campaign. Must be less than 256 characters long. + * @param {string} params.defaultLandingPageUrl Default landing page URL for this new campaign. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['profileId', 'defaultLandingPageName', 'defaultLandingPageUrl'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.list + * @desc Retrieves a list of campaigns, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var campaignsPage = response['campaigns']; + * if (!campaignsPage) { + * return; + * } + * for (var i = 0; i < campaignsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `campaignsPage`: console.log(JSON.stringify(campaignsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.campaigns.list(request, handlePage); + * } + * }; + * + * dfareporting.campaigns.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaigns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserGroupIds Select only campaigns whose advertisers belong to these advertiser groups. + * @param {string=} params.advertiserIds Select only campaigns that belong to these advertisers. + * @param {boolean=} params.archived Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. + * @param {boolean=} params.atLeastOneOptimizationActivity Select only campaigns that have at least one optimization activity. + * @param {string=} params.excludedIds Exclude campaigns with these IDs. + * @param {string=} params.ids Select only campaigns with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.overriddenEventTagId Select only campaigns that have overridden this event tag ID. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only campaigns that belong to this subaccount. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.patch + * @desc Updates an existing campaign. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Campaign ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.campaigns.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaigns.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.update + * @desc Updates an existing campaign. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.campaigns.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.campaigns.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Changelogs { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.changeLogs.get + * @desc Gets one change log by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Change log ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.changeLogs.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.changeLogs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Change log ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/changeLogs/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.changeLogs.list + * @desc Retrieves a list of change logs. This method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var changeLogsPage = response['changeLogs']; + * if (!changeLogsPage) { + * return; + * } + * for (var i = 0; i < changeLogsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `changeLogsPage`: console.log(JSON.stringify(changeLogsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.changeLogs.list(request, handlePage); + * } + * }; + * + * dfareporting.changeLogs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.changeLogs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.action Select only change logs with the specified action. + * @param {string=} params.ids Select only change logs with these IDs. + * @param {string=} params.maxChangeTime Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.minChangeTime Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * @param {string=} params.objectIds Select only change logs with these object IDs. + * @param {string=} params.objectType Select only change logs with the specified object type. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Select only change logs whose object ID, user name, old or new values match the search string. + * @param {string=} params.userProfileIds Select only change logs with these user profile IDs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/changeLogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Cities { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.cities.list + * @desc Retrieves a list of cities, possibly filtered. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.cities.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.cities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.countryDartIds Select only cities from these countries. + * @param {string=} params.dartIds Select only cities with these DART IDs. + * @param {string=} params.namePrefix Select only cities with names starting with this prefix. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.regionDartIds Select only cities from these regions. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/cities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Connectiontypes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.connectionTypes.get + * @desc Gets one connection type by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Connection type ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.connectionTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.connectionTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Connection type ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/connectionTypes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.connectionTypes.list + * @desc Retrieves a list of connection types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.connectionTypes.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.connectionTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/connectionTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Contentcategories { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.contentCategories.delete + * @desc Deletes an existing content category. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Content category ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.contentCategories.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.get + * @desc Gets one content category by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Content category ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.contentCategories.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.insert + * @desc Inserts a new content category. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.contentCategories.insert(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.list + * @desc Retrieves a list of content categories, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var contentCategoriesPage = response['contentCategories']; + * if (!contentCategoriesPage) { + * return; + * } + * for (var i = 0; i < contentCategoriesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `contentCategoriesPage`: + * console.log(JSON.stringify(contentCategoriesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.contentCategories.list(request, handlePage); + * } + * }; + * + * dfareporting.contentCategories.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only content categories with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.contentCategories.patch + * @desc Updates an existing content category. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Content category ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.contentCategories.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.update + * @desc Updates an existing content category. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.contentCategories.update(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.contentCategories.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Conversions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.conversions.batchinsert + * @desc Inserts conversions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.conversions.batchinsert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/ddmconversions' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.conversions.batchinsert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ConversionsBatchInsertRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchinsert(params?: any, options?: MethodOptions): + AxiosPromise; + batchinsert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchinsert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/conversions/batchinsert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.conversions.batchupdate + * @desc Updates existing conversions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.conversions.batchupdate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/ddmconversions' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.conversions.batchupdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ConversionsBatchUpdateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchupdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchupdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchupdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/conversions/batchupdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Countries { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.countries.get + * @desc Gets one country by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Country DART ID. + * dartId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.countries.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.countries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dartId Country DART ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/countries/{dartId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'dartId'], + pathParams: ['dartId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.countries.list + * @desc Retrieves a list of countries. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.countries.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.countries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/countries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativeassets { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeAssets.insert + * @desc Inserts a new creative asset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Advertiser ID of this creative. This is a required field. + * advertiserId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * media: { + * // TODO: Add desired media content for upload. See + * // https://github.com/google/google-api-nodejs-client#media-uploads + * mimeType: '', // See + * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeAssets.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeAssets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.advertiserId Advertiser ID of this creative. This is a required field. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/dfareporting/v2.8/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['advertiserId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativefields { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeFields.delete + * @desc Deletes an existing creative field. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative Field ID + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creativeFields.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.get + * @desc Gets one creative field by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative Field ID + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creativeFields.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.insert + * @desc Inserts a new creative field. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFields.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.list + * @desc Retrieves a list of creative fields, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var creativeFieldsPage = response['creativeFields']; + * if (!creativeFieldsPage) { + * return; + * } + * for (var i = 0; i < creativeFieldsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `creativeFieldsPage`: console.log(JSON.stringify(creativeFieldsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.creativeFields.list(request, handlePage); + * } + * }; + * + * dfareporting.creativeFields.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only creative fields that belong to these advertisers. + * @param {string=} params.ids Select only creative fields with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.patch + * @desc Updates an existing creative field. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative Field ID + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFields.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.update + * @desc Updates an existing creative field. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFields.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFields.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativefieldvalues { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeFieldValues.delete + * @desc Deletes an existing creative field value. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * // Creative Field Value ID + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creativeFieldValues.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.get + * @desc Gets one creative field value by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * // Creative Field Value ID + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creativeFieldValues.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.insert + * @desc Inserts a new creative field value. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFieldValues.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.list + * @desc Retrieves a list of creative field values, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var creativeFieldValuesPage = response['creativeFieldValues']; + * if (!creativeFieldValuesPage) { + * return; + * } + * for (var i = 0; i < creativeFieldValuesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `creativeFieldValuesPage`: + * console.log(JSON.stringify(creativeFieldValuesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.creativeFieldValues.list(request, handlePage); + * } + * }; + * + * dfareporting.creativeFieldValues.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string=} params.ids Select only creative field values with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.patch + * @desc Updates an existing creative field value. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * // Creative Field Value ID + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFieldValues.patch(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.update + * @desc Updates an existing creative field value. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative field ID for this creative field value. + * creativeFieldId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeFieldValues.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeFieldValues.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativegroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeGroups.get + * @desc Gets one creative group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creativeGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.insert + * @desc Inserts a new creative group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeGroups.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.list + * @desc Retrieves a list of creative groups, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var creativeGroupsPage = response['creativeGroups']; + * if (!creativeGroupsPage) { + * return; + * } + * for (var i = 0; i < creativeGroupsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `creativeGroupsPage`: console.log(JSON.stringify(creativeGroupsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.creativeGroups.list(request, handlePage); + * } + * }; + * + * dfareporting.creativeGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only creative groups that belong to these advertisers. + * @param {integer=} params.groupNumber Select only creative groups that belong to this subgroup. + * @param {string=} params.ids Select only creative groups with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.patch + * @desc Updates an existing creative group. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative group ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeGroups.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.update + * @desc Updates an existing creative group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creativeGroups.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creativeGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creatives { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creatives.get + * @desc Gets one creative by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.creatives.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creatives/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.insert + * @desc Inserts a new creative. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creatives.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creatives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.list + * @desc Retrieves a list of creatives, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var creativesPage = response['creatives']; + * if (!creativesPage) { + * return; + * } + * for (var i = 0; i < creativesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `creativesPage`: console.log(JSON.stringify(creativesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.creatives.list(request, handlePage); + * } + * }; + * + * dfareporting.creatives.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creatives.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active creatives. Leave blank to select active and inactive creatives. + * @param {string=} params.advertiserId Select only creatives with this advertiser ID. + * @param {boolean=} params.archived Select only archived creatives. Leave blank to select archived and unarchived creatives. + * @param {string=} params.campaignId Select only creatives with this campaign ID. + * @param {string=} params.companionCreativeIds Select only in-stream video creatives with these companion IDs. + * @param {string=} params.creativeFieldIds Select only creatives with these creative field IDs. + * @param {string=} params.ids Select only creatives with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.renderingIds Select only creatives with these rendering IDs. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + * @param {string=} params.sizeIds Select only creatives with these size IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.studioCreativeId Select only creatives corresponding to this Studio creative ID. + * @param {string=} params.types Select only creatives with these creative types. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.patch + * @desc Updates an existing creative. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Creative ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creatives.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creatives.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.update + * @desc Updates an existing creative. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.creatives.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.creatives.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Dimensionvalues { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.dimensionValues.query + * @desc Retrieves list of report dimension values for a list of filters. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.dimensionValues.query(request, handlePage); + * } + * }; + * + * dfareporting.dimensionValues.query(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.dimensionValues.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA user profile ID. + * @param {().DimensionValueRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/dimensionvalues/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Directorysitecontacts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.directorySiteContacts.get + * @desc Gets one directory site contact by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Directory site contact ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.directorySiteContacts.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.directorySiteContacts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Directory site contact ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/directorySiteContacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySiteContacts.list + * @desc Retrieves a list of directory site contacts, possibly filtered. + * This method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var directorySiteContactsPage = response['directorySiteContacts']; + * if (!directorySiteContactsPage) { + * return; + * } + * for (var i = 0; i < directorySiteContactsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `directorySiteContactsPage`: + * console.log(JSON.stringify(directorySiteContactsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.directorySiteContacts.list(request, handlePage); + * } + * }; + * + * dfareporting.directorySiteContacts.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.directorySiteContacts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.directorySiteIds Select only directory site contacts with these directory site IDs. This is a required field. + * @param {string=} params.ids Select only directory site contacts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with name "my directory site contact", "directory site contact 2015", or simply "directory site contact". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/directorySiteContacts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Directorysites { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.directorySites.get + * @desc Gets one directory site by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Directory site ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.directorySites.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.directorySites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Directory site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/directorySites/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySites.insert + * @desc Inserts a new directory site. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.directorySites.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.directorySites.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().DirectorySite} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/directorySites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySites.list + * @desc Retrieves a list of directory sites, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var directorySitesPage = response['directorySites']; + * if (!directorySitesPage) { + * return; + * } + * for (var i = 0; i < directorySitesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `directorySitesPage`: console.log(JSON.stringify(directorySitesPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.directorySites.list(request, handlePage); + * } + * }; + * + * dfareporting.directorySites.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.directorySites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsPublisherPaidPlacements Select only directory sites that accept publisher paid placements. This field can be left blank. + * @param {boolean=} params.active Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. + * @param {string=} params.countryId Select only directory sites with this country ID. + * @param {string=} params.dfpNetworkCode Select only directory sites with this DFP network code. + * @param {string=} params.ids Select only directory sites with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.parentId Select only directory sites with this parent ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/directorySites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Dynamictargetingkeys { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.dynamicTargetingKeys.delete + * @desc Deletes an existing dynamic targeting key. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // ID of the object of this dynamic targeting key. This is a required + * field. objectId: '0', // TODO: Update placeholder value. + * + * // Name of this dynamic targeting key. This is a required field. Must + * be less than 256 characters long + * // and cannot contain commas. All characters are converted to + * lowercase. name: '', // TODO: Update placeholder value. + * + * // Type of the object of this dynamic targeting key. This is a + * required field. objectType: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.dynamicTargetingKeys.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.dynamicTargetingKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + * @param {string} params.objectId ID of the object of this dynamic targeting key. This is a required field. + * @param {string} params.objectType Type of the object of this dynamic targeting key. This is a required field. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys/{objectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'objectId', 'name', 'objectType'], + pathParams: ['objectId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.dynamicTargetingKeys.insert + * @desc Inserts a new dynamic targeting key. Keys must be created at the + * advertiser level before being assigned to the advertiser's ads, + * creatives, or placements. There is a maximum of 1000 keys per advertiser, + * out of which a maximum of 20 keys can be assigned per ad, creative, or + * placement. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.dynamicTargetingKeys.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.dynamicTargetingKeys.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().DynamicTargetingKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.dynamicTargetingKeys.list + * @desc Retrieves a list of dynamic targeting keys. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.dynamicTargetingKeys.list(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.dynamicTargetingKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only dynamic targeting keys whose object has this advertiser ID. + * @param {string=} params.names Select only dynamic targeting keys exactly matching these names. + * @param {string=} params.objectId Select only dynamic targeting keys with this object ID. + * @param {string=} params.objectType Select only dynamic targeting keys with this object type. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/dynamicTargetingKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Eventtags { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.eventTags.delete + * @desc Deletes an existing event tag. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Event tag ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.get + * @desc Gets one event tag by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Event tag ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.insert + * @desc Inserts a new event tag. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.list + * @desc Retrieves a list of event tags, possibly filtered. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.adId Select only event tags that belong to this ad. + * @param {string=} params.advertiserId Select only event tags that belong to this advertiser. + * @param {string=} params.campaignId Select only event tags that belong to this campaign. + * @param {boolean=} params.definitionsOnly Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + * @param {boolean=} params.enabled Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + * @param {string=} params.eventTagTypes Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. + * @param {string=} params.ids Select only event tags with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.patch + * @desc Updates an existing event tag. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Event tag ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.update + * @desc Updates an existing event tag. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.eventTags.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.eventTags.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Files { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.files.get + * @desc Retrieves a report file by its report ID and file ID. This method + * supports media download. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * // The ID of the report file. + * fileId: '0', // TODO: Update placeholder value. + * + * // TODO: To download media content, use: + * // + * // alt: 'media', + * + * auth: authClient, + * }; + * + * dfareporting.files.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the report file. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/reports/{reportId}/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['reportId', 'fileId'], + pathParams: ['fileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.files.list + * @desc Lists files for a user profile. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.files.list(request, handlePage); + * } + * }; + * + * dfareporting.files.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.files.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA profile ID. + * @param {string=} params.scope The scope that defines which results are returned. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/files') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightactivities { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightActivities.delete + * @desc Deletes an existing floodlight activity. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight activity ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.generatetag + * @desc Generates a tag for a floodlight activity. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.generatetag(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.generatetag + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.floodlightActivityId Floodlight activity ID for which we want to generate a tag. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generatetag(params?: any, options?: MethodOptions): + AxiosPromise; + generatetag( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$FloodlightActivitiesGenerateTagResponse>): void; + generatetag( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$FloodlightActivitiesGenerateTagResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/generatetag') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivities.get + * @desc Gets one floodlight activity by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight activity ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.insert + * @desc Inserts a new floodlight activity. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.list + * @desc Retrieves a list of floodlight activities, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var floodlightActivitiesPage = response['floodlightActivities']; + * if (!floodlightActivitiesPage) { + * return; + * } + * for (var i = 0; i < floodlightActivitiesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `floodlightActivitiesPage`: + * console.log(JSON.stringify(floodlightActivitiesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.floodlightActivities.list(request, handlePage); + * } + * }; + * + * dfareporting.floodlightActivities.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.floodlightActivityGroupIds Select only floodlight activities with the specified floodlight activity group IDs. + * @param {string=} params.floodlightActivityGroupName Select only floodlight activities with the specified floodlight activity group name. + * @param {string=} params.floodlightActivityGroupTagString Select only floodlight activities with the specified floodlight activity group tag string. + * @param {string=} params.floodlightActivityGroupType Select only floodlight activities with the specified floodlight activity group type. + * @param {string=} params.floodlightConfigurationId Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.ids Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.tagString Select only floodlight activities with the specified tag string. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivities.patch + * @desc Updates an existing floodlight activity. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight activity ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.update + * @desc Updates an existing floodlight activity. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivities.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivities.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightactivitygroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightActivityGroups.get + * @desc Gets one floodlight activity group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight activity Group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivityGroups.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivityGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity Group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.insert + * @desc Inserts a new floodlight activity group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivityGroups.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivityGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.list + * @desc Retrieves a list of floodlight activity groups, possibly filtered. + * This method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var floodlightActivityGroupsPage = + * response['floodlightActivityGroups']; if (!floodlightActivityGroupsPage) + * { return; + * } + * for (var i = 0; i < floodlightActivityGroupsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `floodlightActivityGroupsPage`: + * console.log(JSON.stringify(floodlightActivityGroupsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.floodlightActivityGroups.list(request, handlePage); + * } + * }; + * + * dfareporting.floodlightActivityGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivityGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * @param {string=} params.floodlightConfigurationId Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.ids Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.type Select only floodlight activity groups with the specified floodlight activity group type. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.patch + * @desc Updates an existing floodlight activity group. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight activity Group ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivityGroups.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivityGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity Group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.update + * @desc Updates an existing floodlight activity group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightActivityGroups.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightActivityGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightconfigurations { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightConfigurations.get + * @desc Gets one floodlight configuration by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight configuration ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightConfigurations.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightConfigurations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight configuration ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.list + * @desc Retrieves a list of floodlight configurations, possibly filtered. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.floodlightConfigurations.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightConfigurations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.patch + * @desc Updates an existing floodlight configuration. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Floodlight configuration ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightConfigurations.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightConfigurations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight configuration ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.update + * @desc Updates an existing floodlight configuration. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.floodlightConfigurations.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.floodlightConfigurations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Inventoryitems { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.inventoryItems.get + * @desc Gets one inventory item by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for order documents. + * projectId: '0', // TODO: Update placeholder value. + * + * // Inventory item ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.inventoryItems.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.inventoryItems.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Inventory item ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.inventoryItems.list + * @desc Retrieves a list of inventory items, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for order documents. + * projectId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var inventoryItemsPage = response['inventoryItems']; + * if (!inventoryItemsPage) { + * return; + * } + * for (var i = 0; i < inventoryItemsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `inventoryItemsPage`: console.log(JSON.stringify(inventoryItemsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.inventoryItems.list(request, handlePage); + * } + * }; + * + * dfareporting.inventoryItems.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.inventoryItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only inventory items with these IDs. + * @param {boolean=} params.inPlan Select only inventory items that are in plan. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderId Select only inventory items that belong to specified orders. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {string=} params.siteId Select only inventory items that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.type Select only inventory items with this type. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/inventoryItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Landingpages { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.landingPages.delete + * @desc Deletes an existing campaign landing page. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * // Landing page ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.id Landing page ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'campaignId', 'id'], + pathParams: ['campaignId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.landingPages.get + * @desc Gets one campaign landing page by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * // Landing page ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.id Landing page ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'campaignId', 'id'], + pathParams: ['campaignId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.landingPages.insert + * @desc Inserts a new landing page for the specified campaign. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.landingPages.list + * @desc Retrieves the list of landing pages for the specified campaign. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.landingPages.patch + * @desc Updates an existing campaign landing page. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * // Landing page ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.id Landing page ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'campaignId', 'id'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.landingPages.update + * @desc Updates an existing campaign landing page. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Landing page campaign ID. + * campaignId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.landingPages.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.landingPages.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Landing page campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/campaigns/{campaignId}/landingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Languages { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.languages.list + * @desc Retrieves a list of languages. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.languages.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.languages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/languages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Metros { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.metros.list + * @desc Retrieves a list of metros. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.metros.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.metros.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/metros') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Mobilecarriers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.mobileCarriers.get + * @desc Gets one mobile carrier by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Mobile carrier ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.mobileCarriers.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.mobileCarriers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Mobile carrier ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/mobileCarriers/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.mobileCarriers.list + * @desc Retrieves a list of mobile carriers. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.mobileCarriers.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.mobileCarriers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/mobileCarriers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Operatingsystems { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.operatingSystems.get + * @desc Gets one operating system by DART ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Operating system DART ID. + * dartId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.operatingSystems.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.operatingSystems.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dartId Operating system DART ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystems/{dartId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'dartId'], + pathParams: ['dartId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.operatingSystems.list + * @desc Retrieves a list of operating systems. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.operatingSystems.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.operatingSystems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Operatingsystemversions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.operatingSystemVersions.get + * @desc Gets one operating system version by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Operating system version ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.operatingSystemVersions.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.operatingSystemVersions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Operating system version ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystemVersions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.operatingSystemVersions.list + * @desc Retrieves a list of operating system versions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.operatingSystemVersions.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.operatingSystemVersions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/operatingSystemVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Orderdocuments { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.orderDocuments.get + * @desc Gets one order document by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for order documents. + * projectId: '0', // TODO: Update placeholder value. + * + * // Order document ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.orderDocuments.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.orderDocuments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Order document ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.orderDocuments.list + * @desc Retrieves a list of order documents, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for order documents. + * projectId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var orderDocumentsPage = response['orderDocuments']; + * if (!orderDocumentsPage) { + * return; + * } + * for (var i = 0; i < orderDocumentsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `orderDocumentsPage`: console.log(JSON.stringify(orderDocumentsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.orderDocuments.list(request, handlePage); + * } + * }; + * + * dfareporting.orderDocuments.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.orderDocuments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.approved Select only order documents that have been approved by at least one user. + * @param {string=} params.ids Select only order documents with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderId Select only order documents for specified orders. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {string=} params.searchString Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". + * @param {string=} params.siteId Select only order documents that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orderDocuments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Orders { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.orders.get + * @desc Gets one order by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for orders. + * projectId: '0', // TODO: Update placeholder value. + * + * // Order ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.orders.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.orders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Order ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for orders. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orders/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.orders.list + * @desc Retrieves a list of orders, possibly filtered. This method supports + * paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID for orders. + * projectId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var ordersPage = response['orders']; + * if (!ordersPage) { + * return; + * } + * for (var i = 0; i < ordersPage.length; i++) { + * // TODO: Change code below to process each resource in + * `ordersPage`: console.log(JSON.stringify(ordersPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.orders.list(request, handlePage); + * } + * }; + * + * dfareporting.orders.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.orders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only orders with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for orders. + * @param {string=} params.searchString Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + * @param {string=} params.siteId Select only orders that are associated with these site IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{projectId}/orders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placementgroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placementGroups.get + * @desc Gets one placement group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.placementGroups.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.insert + * @desc Inserts a new placement group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementGroups.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.list + * @desc Retrieves a list of placement groups, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var placementGroupsPage = response['placementGroups']; + * if (!placementGroupsPage) { + * return; + * } + * for (var i = 0; i < placementGroupsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `placementGroupsPage`: console.log(JSON.stringify(placementGroupsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.placementGroups.list(request, handlePage); + * } + * }; + * + * dfareporting.placementGroups.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only placement groups that belong to these advertisers. + * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. + * @param {string=} params.campaignIds Select only placement groups that belong to these campaigns. + * @param {string=} params.contentCategoryIds Select only placement groups that are associated with these content categories. + * @param {string=} params.directorySiteIds Select only placement groups that are associated with these directory sites. + * @param {string=} params.ids Select only placement groups with these IDs. + * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.placementGroupType Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + * @param {string=} params.placementStrategyIds Select only placement groups that are associated with these placement strategies. + * @param {string=} params.pricingTypes Select only placement groups with these pricing types. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". + * @param {string=} params.siteIds Select only placement groups that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.patch + * @desc Updates an existing placement group. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement group ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementGroups.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.update + * @desc Updates an existing placement group. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementGroups.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placements { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placements.generatetags + * @desc Generates tags for a placement. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.placements.generatetags(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.generatetags + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.campaignId Generate placements belonging to this campaign. This is a required field. + * @param {string=} params.placementIds Generate tags for these placements. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.tagFormats Tag formats to generate for these placements. Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generatetags(params?: any, options?: MethodOptions): + AxiosPromise; + generatetags( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generatetags( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements/generatetags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.placements.get + * @desc Gets one placement by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.placements.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.insert + * @desc Inserts a new placement. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placements.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.list + * @desc Retrieves a list of placements, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var placementsPage = response['placements']; + * if (!placementsPage) { + * return; + * } + * for (var i = 0; i < placementsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `placementsPage`: console.log(JSON.stringify(placementsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.placements.list(request, handlePage); + * } + * }; + * + * dfareporting.placements.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only placements that belong to these advertisers. + * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. + * @param {string=} params.campaignIds Select only placements that belong to these campaigns. + * @param {string=} params.compatibilities Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + * @param {string=} params.contentCategoryIds Select only placements that are associated with these content categories. + * @param {string=} params.directorySiteIds Select only placements that are associated with these directory sites. + * @param {string=} params.groupIds Select only placements that belong to these placement groups. + * @param {string=} params.ids Select only placements with these IDs. + * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.paymentSource Select only placements with this payment source. + * @param {string=} params.placementStrategyIds Select only placements that are associated with these placement strategies. + * @param {string=} params.pricingTypes Select only placements with these pricing types. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". + * @param {string=} params.siteIds Select only placements that are associated with these sites. + * @param {string=} params.sizeIds Select only placements that are associated with these sizes. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.patch + * @desc Updates an existing placement. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placements.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.update + * @desc Updates an existing placement. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placements.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placements.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placementstrategies { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placementStrategies.delete + * @desc Deletes an existing placement strategy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement strategy ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.placementStrategies.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.get + * @desc Gets one placement strategy by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement strategy ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.placementStrategies.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.insert + * @desc Inserts a new placement strategy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementStrategies.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.list + * @desc Retrieves a list of placement strategies, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var placementStrategiesPage = response['placementStrategies']; + * if (!placementStrategiesPage) { + * return; + * } + * for (var i = 0; i < placementStrategiesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `placementStrategiesPage`: + * console.log(JSON.stringify(placementStrategiesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.placementStrategies.list(request, handlePage); + * } + * }; + * + * dfareporting.placementStrategies.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only placement strategies with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.placementStrategies.patch + * @desc Updates an existing placement strategy. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Placement strategy ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementStrategies.patch(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.update + * @desc Updates an existing placement strategy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.placementStrategies.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.placementStrategies.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Platformtypes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.platformTypes.get + * @desc Gets one platform type by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Platform type ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.platformTypes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.platformTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Platform type ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/platformTypes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.platformTypes.list + * @desc Retrieves a list of platform types. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.platformTypes.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.platformTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/platformTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Postalcodes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.postalCodes.get + * @desc Gets one postal code by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Postal code ID. + * code: 'my-code', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.postalCodes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.postalCodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.code Postal code ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/postalCodes/{code}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'code'], + pathParams: ['code', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.postalCodes.list + * @desc Retrieves a list of postal codes. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.postalCodes.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.postalCodes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/postalCodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.projects.get + * @desc Gets one project by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Project ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Project ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.projects.list + * @desc Retrieves a list of projects, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var projectsPage = response['projects']; + * if (!projectsPage) { + * return; + * } + * for (var i = 0; i < projectsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `projectsPage`: console.log(JSON.stringify(projectsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.projects.list(request, handlePage); + * } + * }; + * + * dfareporting.projects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.projects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only projects with these advertiser IDs. + * @param {string=} params.ids Select only projects with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/projects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.regions.list + * @desc Retrieves a list of regions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.regions.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.regions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/regions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Remarketinglists { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.remarketingLists.get + * @desc Gets one remarketing list by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Remarketing list ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.remarketingLists.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingLists.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.insert + * @desc Inserts a new remarketing list. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.remarketingLists.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingLists.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.list + * @desc Retrieves a list of remarketing lists, possibly filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Select only remarketing lists owned by this advertiser. + * advertiserId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var remarketingListsPage = response['remarketingLists']; + * if (!remarketingListsPage) { + * return; + * } + * for (var i = 0; i < remarketingListsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `remarketingListsPage`: + * console.log(JSON.stringify(remarketingListsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.remarketingLists.list(request, handlePage); + * } + * }; + * + * dfareporting.remarketingLists.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingLists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active or only inactive remarketing lists. + * @param {string} params.advertiserId Select only remarketing lists owned by this advertiser. + * @param {string=} params.floodlightActivityId Select only remarketing lists that have this floodlight activity ID. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.remarketingLists.patch + * @desc Updates an existing remarketing list. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Remarketing list ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.remarketingLists.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingLists.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.update + * @desc Updates an existing remarketing list. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.remarketingLists.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingLists.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Remarketinglistshares { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.remarketingListShares.get + * @desc Gets one remarketing list share by remarketing list ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Remarketing list ID. + * remarketingListId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.remarketingListShares.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingListShares.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.remarketingListId Remarketing list ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares/{remarketingListId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'remarketingListId'], + pathParams: ['profileId', 'remarketingListId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingListShares.patch + * @desc Updates an existing remarketing list share. This method supports + * patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Remarketing list ID. + * remarketingListId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.remarketingListShares.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingListShares.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.remarketingListId Remarketing list ID. + * @param {().RemarketingListShare} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'remarketingListId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingListShares.update + * @desc Updates an existing remarketing list share. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.remarketingListShares.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.remarketingListShares.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingListShare} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/remarketingListShares') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Reports { + root: Dfareporting; + compatibleFields: Resource$Reports$Compatiblefields; + files: Resource$Reports$Files; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + this.compatibleFields = new Resource$Reports$Compatiblefields(root); + this.files = new Resource$Reports$Files(root); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.delete + * @desc Deletes a report by its ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.reports.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.get + * @desc Retrieves a report by its ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.reports.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.insert + * @desc Creates a report. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.reports.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.list + * @desc Retrieves list of reports. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.reports.list(request, handlePage); + * } + * }; + * + * dfareporting.reports.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA user profile ID. + * @param {string=} params.scope The scope that defines which results are returned. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.patch + * @desc Updates a report. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.reports.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.run + * @desc Runs a report. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.reports.run(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the report. + * @param {boolean=} params.synchronous If set and true, tries to run the report synchronously. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.update + * @desc Updates a report. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.reports.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Reports$Compatiblefields { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.compatibleFields.query + * @desc Returns the fields that are compatible to be selected in the + * respective sections of a report criteria, given the fields already + * selected in the input report and user permissions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.reports.compatibleFields.query(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.compatibleFields.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/compatiblefields/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Reports$Files { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.files.get + * @desc Retrieves a report file. This method supports media download. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the report. + * reportId: '0', // TODO: Update placeholder value. + * + * // The ID of the report file. + * fileId: '0', // TODO: Update placeholder value. + * + * // TODO: To download media content, use: + * // + * // alt: 'media', + * + * auth: authClient, + * }; + * + * dfareporting.reports.files.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the report file. + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId', 'fileId'], + pathParams: ['fileId', 'profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.files.list + * @desc Lists files for a report. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The DFA profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * // The ID of the parent report. + * reportId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.reports.files.list(request, handlePage); + * } + * }; + * + * dfareporting.reports.files.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfareporting' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.reports.files.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the parent report. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/reports/{reportId}/files') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Sites { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.sites.get + * @desc Gets one site by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Site ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.sites.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sites/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.insert + * @desc Inserts a new site. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.sites.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sites.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.list + * @desc Retrieves a list of sites, possibly filtered. This method supports + * paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var sitesPage = response['sites']; + * if (!sitesPage) { + * return; + * } + * for (var i = 0; i < sitesPage.length; i++) { + * // TODO: Change code below to process each resource in `sitesPage`: + * console.log(JSON.stringify(sitesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.sites.list(request, handlePage); + * } + * }; + * + * dfareporting.sites.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsPublisherPaidPlacements Select only sites that accept publisher paid placements. + * @param {boolean=} params.adWordsSite Select only AdWords sites. + * @param {boolean=} params.approved Select only approved sites. + * @param {string=} params.campaignIds Select only sites with these campaign IDs. + * @param {string=} params.directorySiteIds Select only sites with these directory site IDs. + * @param {string=} params.ids Select only sites with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only sites with this subaccount ID. + * @param {boolean=} params.unmappedSite Select only sites that have not been mapped to a directory site. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.patch + * @desc Updates an existing site. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Site ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.sites.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sites.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.update + * @desc Updates an existing site. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.sites.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sites.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sizes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.sizes.get + * @desc Gets one size by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Size ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.sizes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sizes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Size ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sizes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sizes.insert + * @desc Inserts a new size. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.sizes.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sizes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Size} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sizes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sizes.list + * @desc Retrieves a list of sizes, possibly filtered. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.sizes.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.sizes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.height Select only sizes with this height. + * @param {boolean=} params.iabStandard Select only IAB standard sizes. + * @param {string=} params.ids Select only sizes with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {integer=} params.width Select only sizes with this width. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/sizes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subaccounts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.subaccounts.get + * @desc Gets one subaccount by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Subaccount ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.subaccounts.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.subaccounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Subaccount ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.insert + * @desc Inserts a new subaccount. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.subaccounts.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.subaccounts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.list + * @desc Gets a list of subaccounts, possibly filtered. This method supports + * paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var subaccountsPage = response['subaccounts']; + * if (!subaccountsPage) { + * return; + * } + * for (var i = 0; i < subaccountsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `subaccountsPage`: console.log(JSON.stringify(subaccountsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.subaccounts.list(request, handlePage); + * } + * }; + * + * dfareporting.subaccounts.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.subaccounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only subaccounts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.patch + * @desc Updates an existing subaccount. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Subaccount ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.subaccounts.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.subaccounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Subaccount ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.update + * @desc Updates an existing subaccount. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.subaccounts.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.subaccounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetableremarketinglists { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.targetableRemarketingLists.get + * @desc Gets one remarketing list by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Remarketing list ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.targetableRemarketingLists.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetableRemarketingLists.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetableRemarketingLists/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetableRemarketingLists.list + * @desc Retrieves a list of targetable remarketing lists, possibly + * filtered. This method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Select only targetable remarketing lists targetable by these + * advertisers. advertiserId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var targetableRemarketingListsPage = + * response['targetableRemarketingLists']; if + * (!targetableRemarketingListsPage) { return; + * } + * for (var i = 0; i < targetableRemarketingListsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `targetableRemarketingListsPage`: + * console.log(JSON.stringify(targetableRemarketingListsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.targetableRemarketingLists.list(request, handlePage); + * } + * }; + * + * dfareporting.targetableRemarketingLists.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetableRemarketingLists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active or only inactive targetable remarketing lists. + * @param {string} params.advertiserId Select only targetable remarketing lists targetable by these advertisers. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$TargetableRemarketingListsListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$TargetableRemarketingListsListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetableRemarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Targetingtemplates { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.targetingTemplates.get + * @desc Gets one targeting template by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Targeting template ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.targetingTemplates.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetingTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Targeting template ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.insert + * @desc Inserts a new targeting template. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.targetingTemplates.insert(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetingTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.list + * @desc Retrieves a list of targeting templates, optionally filtered. This + * method supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var targetingTemplatesPage = response['targetingTemplates']; + * if (!targetingTemplatesPage) { + * return; + * } + * for (var i = 0; i < targetingTemplatesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `targetingTemplatesPage`: + * console.log(JSON.stringify(targetingTemplatesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.targetingTemplates.list(request, handlePage); + * } + * }; + * + * dfareporting.targetingTemplates.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetingTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only targeting templates with this advertiser ID. + * @param {string=} params.ids Select only targeting templates with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.targetingTemplates.patch + * @desc Updates an existing targeting template. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Targeting template ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.targetingTemplates.patch(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetingTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Targeting template ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.update + * @desc Updates an existing targeting template. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.targetingTemplates.update(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.targetingTemplates.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Userprofiles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userProfiles.get + * @desc Gets one user profile by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // The user profile ID. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userProfiles.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/dfareporting' + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userProfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The user profile ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userProfiles.list + * @desc Retrieves list of user profiles for a user. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * dfareporting.userProfiles.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/dfareporting' + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userProfiles.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v2.8/userprofiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Userrolepermissiongroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRolePermissionGroups.get + * @desc Gets one user role permission group by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User role permission group ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRolePermissionGroups.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRolePermissionGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role permission group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissionGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRolePermissionGroups.list + * @desc Gets a list of all supported user role permission groups. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRolePermissionGroups.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRolePermissionGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissionGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Userrolepermissions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRolePermissions.get + * @desc Gets one user role permission by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User role permission ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRolePermissions.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRolePermissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role permission ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRolePermissions.list + * @desc Gets a list of user role permissions, possibly filtered. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRolePermissions.list(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRolePermissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only user role permissions with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRolePermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Userroles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRoles.delete + * @desc Deletes an existing user role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User role ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRoles.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.get + * @desc Gets one user role by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User role ID. + * id: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.userRoles.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.insert + * @desc Inserts a new user role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.userRoles.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.list + * @desc Retrieves a list of user roles, possibly filtered. This method + * supports paging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var userRolesPage = response['userRoles']; + * if (!userRolesPage) { + * return; + * } + * for (var i = 0; i < userRolesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `userRolesPage`: console.log(JSON.stringify(userRolesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dfareporting.userRoles.list(request, handlePage); + * } + * }; + * + * dfareporting.userRoles.list(request, handlePage); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.accountUserRoleOnly Select only account level user roles not associated with any specific subaccount. + * @param {string=} params.ids Select only user roles with the specified IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only user roles that belong to this subaccount. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.patch + * @desc Updates an existing user role. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // User role ID. + * id: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.userRoles.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.update + * @desc Updates an existing user role. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dfareporting.userRoles.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.userRoles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Videoformats { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.videoFormats.get + * @desc Gets one video format by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * // Video format ID. + * id: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.videoFormats.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.videoFormats.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id Video format ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/videoFormats/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.videoFormats.list + * @desc Lists available video formats. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the DCM/DFA Reporting And Trafficking + * API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dfareporting + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dfareporting = google.dfareporting('v2.8'); + * + * authorize(function(authClient) { + * var request = { + * // User profile ID associated with this request. + * profileId: '0', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dfareporting.videoFormats.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/doubleclick-advertisers/authorizing#examples + * // + * // Authorize using the following scope: + * // 'https://www.googleapis.com/auth/dfatrafficking' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias dfareporting.videoFormats.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v2.8/userprofiles/{profileId}/videoFormats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dfareporting/v3.0.ts b/src/apis/dfareporting/v3.0.ts index b65175d298f..776774f06d4 100644 --- a/src/apis/dfareporting/v3.0.ts +++ b/src/apis/dfareporting/v3.0.ts @@ -27,20100 +27,20263 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * DCM/DFA Reporting And Trafficking API - * - * Manages your DoubleClick Campaign Manager ad campaigns and reports. - * - * @example - * const google = require('googleapis'); - * const dfareporting = google.dfareporting('v3.0'); - * - * @namespace dfareporting - * @type {Function} - * @version v3.0 - * @variation v3.0 - * @param {object=} options Options for Dfareporting - */ -export class Dfareporting { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accountActiveAdSummaries: Resource$Accountactiveadsummaries; - accountPermissionGroups: Resource$Accountpermissiongroups; - accountPermissions: Resource$Accountpermissions; - accounts: Resource$Accounts; - accountUserProfiles: Resource$Accountuserprofiles; - ads: Resource$Ads; - advertiserGroups: Resource$Advertisergroups; - advertiserLandingPages: Resource$Advertiserlandingpages; - advertisers: Resource$Advertisers; - browsers: Resource$Browsers; - campaignCreativeAssociations: Resource$Campaigncreativeassociations; - campaigns: Resource$Campaigns; - changeLogs: Resource$Changelogs; - cities: Resource$Cities; - connectionTypes: Resource$Connectiontypes; - contentCategories: Resource$Contentcategories; - conversions: Resource$Conversions; - countries: Resource$Countries; - creativeAssets: Resource$Creativeassets; - creativeFields: Resource$Creativefields; - creativeFieldValues: Resource$Creativefieldvalues; - creativeGroups: Resource$Creativegroups; - creatives: Resource$Creatives; - dimensionValues: Resource$Dimensionvalues; - directorySiteContacts: Resource$Directorysitecontacts; - directorySites: Resource$Directorysites; - dynamicTargetingKeys: Resource$Dynamictargetingkeys; - eventTags: Resource$Eventtags; - files: Resource$Files; - floodlightActivities: Resource$Floodlightactivities; - floodlightActivityGroups: Resource$Floodlightactivitygroups; - floodlightConfigurations: Resource$Floodlightconfigurations; - inventoryItems: Resource$Inventoryitems; - languages: Resource$Languages; - metros: Resource$Metros; - mobileCarriers: Resource$Mobilecarriers; - operatingSystems: Resource$Operatingsystems; - operatingSystemVersions: Resource$Operatingsystemversions; - orderDocuments: Resource$Orderdocuments; - orders: Resource$Orders; - placementGroups: Resource$Placementgroups; - placements: Resource$Placements; - placementStrategies: Resource$Placementstrategies; - platformTypes: Resource$Platformtypes; - postalCodes: Resource$Postalcodes; - projects: Resource$Projects; - regions: Resource$Regions; - remarketingLists: Resource$Remarketinglists; - remarketingListShares: Resource$Remarketinglistshares; - reports: Resource$Reports; - sites: Resource$Sites; - sizes: Resource$Sizes; - subaccounts: Resource$Subaccounts; - targetableRemarketingLists: Resource$Targetableremarketinglists; - targetingTemplates: Resource$Targetingtemplates; - userProfiles: Resource$Userprofiles; - userRolePermissionGroups: Resource$Userrolepermissiongroups; - userRolePermissions: Resource$Userrolepermissions; - userRoles: Resource$Userroles; - videoFormats: Resource$Videoformats; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accountActiveAdSummaries = new Resource$Accountactiveadsummaries(this); - this.accountPermissionGroups = new Resource$Accountpermissiongroups(this); - this.accountPermissions = new Resource$Accountpermissions(this); - this.accounts = new Resource$Accounts(this); - this.accountUserProfiles = new Resource$Accountuserprofiles(this); - this.ads = new Resource$Ads(this); - this.advertiserGroups = new Resource$Advertisergroups(this); - this.advertiserLandingPages = new Resource$Advertiserlandingpages(this); - this.advertisers = new Resource$Advertisers(this); - this.browsers = new Resource$Browsers(this); - this.campaignCreativeAssociations = - new Resource$Campaigncreativeassociations(this); - this.campaigns = new Resource$Campaigns(this); - this.changeLogs = new Resource$Changelogs(this); - this.cities = new Resource$Cities(this); - this.connectionTypes = new Resource$Connectiontypes(this); - this.contentCategories = new Resource$Contentcategories(this); - this.conversions = new Resource$Conversions(this); - this.countries = new Resource$Countries(this); - this.creativeAssets = new Resource$Creativeassets(this); - this.creativeFields = new Resource$Creativefields(this); - this.creativeFieldValues = new Resource$Creativefieldvalues(this); - this.creativeGroups = new Resource$Creativegroups(this); - this.creatives = new Resource$Creatives(this); - this.dimensionValues = new Resource$Dimensionvalues(this); - this.directorySiteContacts = new Resource$Directorysitecontacts(this); - this.directorySites = new Resource$Directorysites(this); - this.dynamicTargetingKeys = new Resource$Dynamictargetingkeys(this); - this.eventTags = new Resource$Eventtags(this); - this.files = new Resource$Files(this); - this.floodlightActivities = new Resource$Floodlightactivities(this); - this.floodlightActivityGroups = new Resource$Floodlightactivitygroups(this); - this.floodlightConfigurations = new Resource$Floodlightconfigurations(this); - this.inventoryItems = new Resource$Inventoryitems(this); - this.languages = new Resource$Languages(this); - this.metros = new Resource$Metros(this); - this.mobileCarriers = new Resource$Mobilecarriers(this); - this.operatingSystems = new Resource$Operatingsystems(this); - this.operatingSystemVersions = new Resource$Operatingsystemversions(this); - this.orderDocuments = new Resource$Orderdocuments(this); - this.orders = new Resource$Orders(this); - this.placementGroups = new Resource$Placementgroups(this); - this.placements = new Resource$Placements(this); - this.placementStrategies = new Resource$Placementstrategies(this); - this.platformTypes = new Resource$Platformtypes(this); - this.postalCodes = new Resource$Postalcodes(this); - this.projects = new Resource$Projects(this); - this.regions = new Resource$Regions(this); - this.remarketingLists = new Resource$Remarketinglists(this); - this.remarketingListShares = new Resource$Remarketinglistshares(this); - this.reports = new Resource$Reports(this); - this.sites = new Resource$Sites(this); - this.sizes = new Resource$Sizes(this); - this.subaccounts = new Resource$Subaccounts(this); - this.targetableRemarketingLists = - new Resource$Targetableremarketinglists(this); - this.targetingTemplates = new Resource$Targetingtemplates(this); - this.userProfiles = new Resource$Userprofiles(this); - this.userRolePermissionGroups = new Resource$Userrolepermissiongroups(this); - this.userRolePermissions = new Resource$Userrolepermissions(this); - this.userRoles = new Resource$Userroles(this); - this.videoFormats = new Resource$Videoformats(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Contains properties of a DCM account. - */ -export interface Schema$Account { - /** - * Account permissions assigned to this account. - */ - accountPermissionIds: string[]; - /** - * Profile for this account. This is a read-only field that can be left blank. - */ - accountProfile: string; - /** - * Whether this account is active. - */ - active: boolean; - /** - * Maximum number of active ads allowed for this account. - */ - activeAdsLimitTier: string; - /** - * Whether to serve creatives with Active View tags. If disabled, viewability - * data will not be available for any impressions. - */ - activeViewOptOut: boolean; - /** - * User role permissions available to the user roles of this account. - */ - availablePermissionIds: string[]; - /** - * ID of the country associated with this account. - */ - countryId: string; - /** - * ID of currency associated with this account. This is a required field. - * Acceptable values are: - "1" for USD - "2" for GBP - - * "3" for ESP - "4" for SEK - "5" for CAD - - * "6" for JPY - "7" for DEM - "8" for AUD - - * "9" for FRF - "10" for ITL - "11" for DKK - * - "12" for NOK - "13" for FIM - "14" for - * ZAR - "15" for IEP - "16" for NLG - "17" - * for EUR - "18" for KRW - "19" for TWD - - * "20" for SGD - "21" for CNY - "22" for HKD - * - "23" for NZD - "24" for MYR - "25" for - * BRL - "26" for PTE - "27" for MXP - "28" - * for CLP - "29" for TRY - "30" for ARS - - * "31" for PEN - "32" for ILS - "33" for CHF - * - "34" for VEF - "35" for COP - "36" for - * GTQ - "37" for PLN - "39" for INR - "40" - * for THB - "41" for IDR - "42" for CZK - - * "43" for RON - "44" for HUF - "45" for RUB - * - "46" for AED - "47" for BGN - "48" for - * HRK - "49" for MXN - "50" for NGN - */ - currencyId: string; - /** - * Default placement dimensions for this account. - */ - defaultCreativeSizeId: string; - /** - * Description of this account. - */ - description: string; - /** - * ID of this account. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#account". - */ - kind: string; - /** - * Locale of this account. Acceptable values are: - "cs" (Czech) - - * "de" (German) - "en" (English) - "en-GB" - * (English United Kingdom) - "es" (Spanish) - "fr" - * (French) - "it" (Italian) - "ja" (Japanese) - - * "ko" (Korean) - "pl" (Polish) - "pt-BR" - * (Portuguese Brazil) - "ru" (Russian) - "sv" (Swedish) - * - "tr" (Turkish) - "zh-CN" (Chinese Simplified) - - * "zh-TW" (Chinese Traditional) - */ - locale: string; - /** - * Maximum image size allowed for this account, in kilobytes. Value must be - * greater than or equal to 1. - */ - maximumImageSize: string; - /** - * Name of this account. This is a required field, and must be less than 128 - * characters long and be globally unique. - */ - name: string; - /** - * Whether campaigns created in this account will be enabled for Nielsen OCR - * reach ratings by default. - */ - nielsenOcrEnabled: boolean; - /** - * Reporting configuration of this account. - */ - reportsConfiguration: Schema$ReportsConfiguration; - /** - * Share Path to Conversion reports with Twitter. - */ - shareReportsWithTwitter: boolean; - /** - * File size limit in kilobytes of Rich Media teaser creatives. Acceptable - * values are 1 to 10240, inclusive. - */ - teaserSizeLimit: string; -} -/** - * Gets a summary of active ads in an account. - */ -export interface Schema$AccountActiveAdSummary { - /** - * ID of the account. - */ - accountId: string; - /** - * Ads that have been activated for the account - */ - activeAds: string; - /** - * Maximum number of active ads allowed for the account. - */ - activeAdsLimitTier: string; - /** - * Ads that can be activated for the account. - */ - availableAds: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountActiveAdSummary". - */ - kind: string; -} -/** - * AccountPermissions contains information about a particular account - * permission. Some features of DCM require an account permission to be present - * in the account. - */ -export interface Schema$AccountPermission { - /** - * Account profiles associated with this account permission. Possible values - * are: - "ACCOUNT_PROFILE_BASIC" - - * "ACCOUNT_PROFILE_STANDARD" - */ - accountProfiles: string[]; - /** - * ID of this account permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermission". - */ - kind: string; - /** - * Administrative level required to enable this account permission. - */ - level: string; - /** - * Name of this account permission. - */ - name: string; - /** - * Permission group of this account permission. - */ - permissionGroupId: string; -} -/** - * AccountPermissionGroups contains a mapping of permission group IDs to names. - * A permission group is a grouping of account permissions. - */ -export interface Schema$AccountPermissionGroup { - /** - * ID of this account permission group. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionGroup". - */ - kind: string; - /** - * Name of this account permission group. - */ - name: string; -} -/** - * Account Permission Group List Response - */ -export interface Schema$AccountPermissionGroupsListResponse { - /** - * Account permission group collection. - */ - accountPermissionGroups: Schema$AccountPermissionGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionGroupsListResponse". - */ - kind: string; -} -/** - * Account Permission List Response - */ -export interface Schema$AccountPermissionsListResponse { - /** - * Account permission collection. - */ - accountPermissions: Schema$AccountPermission[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountPermissionsListResponse". - */ - kind: string; -} -/** - * Account List Response - */ -export interface Schema$AccountsListResponse { - /** - * Account collection. - */ - accounts: Schema$Account[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * AccountUserProfiles contains properties of a DCM user profile. This resource - * is specifically for managing user profiles, whereas UserProfiles is for - * accessing the API. - */ -export interface Schema$AccountUserProfile { - /** - * Account ID of the user profile. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Whether this user profile is active. This defaults to false, and must be - * set true on insert for the user profile to be usable. - */ - active: boolean; - /** - * Filter that describes which advertisers are visible to the user profile. - */ - advertiserFilter: Schema$ObjectFilter; - /** - * Filter that describes which campaigns are visible to the user profile. - */ - campaignFilter: Schema$ObjectFilter; - /** - * Comments for this user profile. - */ - comments: string; - /** - * Email of the user profile. The email addresss must be linked to a Google - * Account. This field is required on insertion and is read-only after - * insertion. - */ - email: string; - /** - * ID of the user profile. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountUserProfile". - */ - kind: string; - /** - * Locale of the user profile. This is a required field. Acceptable values - * are: - "cs" (Czech) - "de" (German) - - * "en" (English) - "en-GB" (English United Kingdom) - - * "es" (Spanish) - "fr" (French) - "it" - * (Italian) - "ja" (Japanese) - "ko" (Korean) - - * "pl" (Polish) - "pt-BR" (Portuguese Brazil) - - * "ru" (Russian) - "sv" (Swedish) - "tr" - * (Turkish) - "zh-CN" (Chinese Simplified) - "zh-TW" - * (Chinese Traditional) - */ - locale: string; - /** - * Name of the user profile. This is a required field. Must be less than 64 - * characters long, must be globally unique, and cannot contain whitespace or - * any of the following characters: "&;"#%,". - */ - name: string; - /** - * Filter that describes which sites are visible to the user profile. - */ - siteFilter: Schema$ObjectFilter; - /** - * Subaccount ID of the user profile. This is a read-only field that can be - * left blank. - */ - subaccountId: string; - /** - * Trafficker type of this user profile. - */ - traffickerType: string; - /** - * User type of the user profile. This is a read-only field that can be left - * blank. - */ - userAccessType: string; - /** - * Filter that describes which user roles are visible to the user profile. - */ - userRoleFilter: Schema$ObjectFilter; - /** - * User role ID of the user profile. This is a required field. - */ - userRoleId: string; -} -/** - * Account User Profile List Response - */ -export interface Schema$AccountUserProfilesListResponse { - /** - * Account user profile collection. - */ - accountUserProfiles: Schema$AccountUserProfile[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#accountUserProfilesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Represents an activity group. - */ -export interface Schema$Activities { - /** - * List of activity filters. The dimension values need to be all either of - * type "dfa:activity" or "dfa:activityGroup". - */ - filters: Schema$DimensionValue[]; - /** - * The kind of resource this is, in this case dfareporting#activities. - */ - kind: string; - /** - * List of names of floodlight activity metrics. - */ - metricNames: string[]; -} -/** - * Contains properties of a DCM ad. - */ -export interface Schema$Ad { - /** - * Account ID of this ad. This is a read-only field that can be left blank. - */ - accountId: string; - /** - * Whether this ad is active. When true, archived must be false. - */ - active: boolean; - /** - * Advertiser ID of this ad. This is a required field on insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this ad is archived. When true, active must be false. - */ - archived: boolean; - /** - * Audience segment ID that is being targeted for this ad. Applicable when - * type is AD_SERVING_STANDARD_AD. - */ - audienceSegmentId: string; - /** - * Campaign ID of this ad. This is a required field on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Click-through URL for this ad. This is a required field on insertion. - * Applicable when type is AD_SERVING_CLICK_TRACKER. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Click-through URL suffix properties for this ad. Applies to the URL in the - * ad or (if overriding ad properties) the URL in the creative. - */ - clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; - /** - * Comments for this ad. - */ - comments: string; - /** - * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. - * DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or on - * mobile devices or in mobile apps for regular or interstitial ads, - * respectively. APP and APP_INTERSTITIAL are only used for existing default - * ads. New mobile placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL - * and default ads created for those placements will be limited to those - * compatibility types. IN_STREAM_VIDEO refers to rendering in-stream video - * ads developed with the VAST standard. - */ - compatibility: string; - /** - * Information about the creation of this ad. This is a read-only field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Creative group assignments for this ad. Applicable when type is - * AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number is - * allowed for a maximum of two assignments. - */ - creativeGroupAssignments: Schema$CreativeGroupAssignment[]; - /** - * Creative rotation for this ad. Applicable when type is - * AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. When - * type is AD_SERVING_DEFAULT_AD, this field should have exactly one - * creativeAssignment. - */ - creativeRotation: Schema$CreativeRotation; - /** - * Time and day targeting information for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - dayPartTargeting: Schema$DayPartTargeting; - /** - * Default click-through event tag properties for this ad. - */ - defaultClickThroughEventTagProperties: - Schema$DefaultClickThroughEventTagProperties; - /** - * Delivery schedule information for this ad. Applicable when type is - * AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with - * subfields priority and impressionRatio are required on insertion when type - * is AD_SERVING_STANDARD_AD. - */ - deliverySchedule: Schema$DeliverySchedule; - /** - * Whether this ad is a dynamic click tracker. Applicable when type is - * AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is - * read-only after insert. - */ - dynamicClickTracker: boolean; - /** - * Date and time that this ad should stop serving. Must be later than the - * start time. This is a required field on insertion. - */ - endTime: string; - /** - * Event tag overrides for this ad. - */ - eventTagOverrides: Schema$EventTagOverride[]; - /** - * Geographical targeting information for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - geoTargeting: Schema$GeoTargeting; - /** - * ID of this ad. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this ad. This is a read-only, auto-generated - * field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key-value targeting information for this ad. This field must be left blank - * if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - keyValueTargetingExpression: Schema$KeyValueTargetingExpression; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#ad". - */ - kind: string; - /** - * Language targeting information for this ad. This field must be left blank - * if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - languageTargeting: Schema$LanguageTargeting; - /** - * Information about the most recent modification of this ad. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this ad. This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Placement assignments for this ad. - */ - placementAssignments: Schema$PlacementAssignment[]; - /** - * Remarketing list targeting expression for this ad. This field must be left - * blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - remarketingListExpression: Schema$ListTargetingExpression; - /** - * Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. - */ - size: Schema$Size; - /** - * Whether this ad is ssl compliant. This is a read-only field that is - * auto-generated when the ad is inserted or updated. - */ - sslCompliant: boolean; - /** - * Whether this ad requires ssl. This is a read-only field that is - * auto-generated when the ad is inserted or updated. - */ - sslRequired: boolean; - /** - * Date and time that this ad should start serving. If creating an ad, this - * field must be a time in the future. This is a required field on insertion. - */ - startTime: string; - /** - * Subaccount ID of this ad. This is a read-only field that can be left blank. - */ - subaccountId: string; - /** - * Targeting template ID, used to apply preconfigured targeting information to - * this ad. This cannot be set while any of dayPartTargeting, geoTargeting, - * keyValueTargetingExpression, languageTargeting, remarketingListExpression, - * or technologyTargeting are set. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - targetingTemplateId: string; - /** - * Technology platform targeting information for this ad. This field must be - * left blank if the ad is using a targeting template. Applicable when type is - * AD_SERVING_STANDARD_AD. - */ - technologyTargeting: Schema$TechnologyTargeting; - /** - * Type of ad. This is a required field on insertion. Note that default ads - * (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative resource). - */ - type: string; -} -/** - * Campaign ad blocking settings. - */ -export interface Schema$AdBlockingConfiguration { - /** - * Click-through URL used by brand-neutral ads. This is a required field when - * overrideClickThroughUrl is set to true. - */ - clickThroughUrl: string; - /** - * ID of a creative bundle to use for this campaign. If set, brand-neutral ads - * will select creatives from this bundle. Otherwise, a default transparent - * pixel will be used. - */ - creativeBundleId: string; - /** - * Whether this campaign has enabled ad blocking. When true, ad blocking is - * enabled for placements in the campaign, but this may be overridden by site - * and placement settings. When false, ad blocking is disabled for all - * placements under the campaign, regardless of site and placement settings. - */ - enabled: boolean; - /** - * Whether the brand-neutral ad's click-through URL comes from the - * campaign's creative bundle or the override URL. Must be set to true if - * ad blocking is enabled and no creative bundle is configured. - */ - overrideClickThroughUrl: boolean; -} -/** - * Ad List Response - */ -export interface Schema$AdsListResponse { - /** - * Ad collection. - */ - ads: Schema$Ad[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#adsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Ad Slot - */ -export interface Schema$AdSlot { - /** - * Comment for this ad slot. - */ - comment: string; - /** - * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering - * either on desktop, mobile devices or in mobile apps for regular or - * interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering - * in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads - * developed with the VAST standard. - */ - compatibility: string; - /** - * Height of this ad slot. - */ - height: string; - /** - * ID of the placement from an external platform that is linked to this ad - * slot. - */ - linkedPlacementId: string; - /** - * Name of this ad slot. - */ - name: string; - /** - * Payment source type of this ad slot. - */ - paymentSourceType: string; - /** - * Primary ad slot of a roadblock inventory item. - */ - primary: boolean; - /** - * Width of this ad slot. - */ - width: string; -} -/** - * Contains properties of a DCM advertiser. - */ -export interface Schema$Advertiser { - /** - * Account ID of this advertiser.This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * ID of the advertiser group this advertiser belongs to. You can group - * advertisers for reporting purposes, allowing you to see aggregated - * information for all advertisers in each group. - */ - advertiserGroupId: string; - /** - * Suffix added to click-through URL of ad creative associations under this - * advertiser. Must be less than 129 characters long. - */ - clickThroughUrlSuffix: string; - /** - * ID of the click-through event tag to apply by default to the landing pages - * of this advertiser's campaigns. - */ - defaultClickThroughEventTagId: string; - /** - * Default email address used in sender field for tag emails. - */ - defaultEmail: string; - /** - * Floodlight configuration ID of this advertiser. The floodlight - * configuration ID will be created automatically, so on insert this field - * should be left blank. This field can be set to another advertiser's - * floodlight configuration ID in order to share that advertiser's - * floodlight configuration with this advertiser, so long as: - This - * advertiser's original floodlight configuration is not already - * associated with floodlight activities or floodlight activity groups. - - * This advertiser's original floodlight configuration is not already - * shared with another advertiser. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * ID of this advertiser. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this advertiser. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiser". - */ - kind: string; - /** - * Name of this advertiser. This is a required field and must be less than 256 - * characters long and unique among advertisers of the same account. - */ - name: string; - /** - * Original floodlight configuration before any sharing occurred. Set the - * floodlightConfigurationId of this advertiser to - * originalFloodlightConfigurationId to unshare the advertiser's current - * floodlight configuration. You cannot unshare an advertiser's floodlight - * configuration if the shared configuration has activities associated with - * any campaign or placement. - */ - originalFloodlightConfigurationId: string; - /** - * Status of this advertiser. - */ - status: string; - /** - * Subaccount ID of this advertiser.This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Suspension status of this advertiser. - */ - suspended: boolean; -} -/** - * Groups advertisers together so that reports can be generated for the entire - * group at once. - */ -export interface Schema$AdvertiserGroup { - /** - * Account ID of this advertiser group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this advertiser group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiserGroup". - */ - kind: string; - /** - * Name of this advertiser group. This is a required field and must be less - * than 256 characters long and unique among advertiser groups of the same - * account. - */ - name: string; -} -/** - * Advertiser Group List Response - */ -export interface Schema$AdvertiserGroupsListResponse { - /** - * Advertiser group collection. - */ - advertiserGroups: Schema$AdvertiserGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiserGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Landing Page List Response - */ -export interface Schema$AdvertiserLandingPagesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertiserLandingPagesListResponse". - */ - kind: string; - /** - * Landing page collection - */ - landingPages: Schema$LandingPage[]; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Advertiser List Response - */ -export interface Schema$AdvertisersListResponse { - /** - * Advertiser collection. - */ - advertisers: Schema$Advertiser[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#advertisersListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Audience Segment. - */ -export interface Schema$AudienceSegment { - /** - * Weight allocated to this segment. The weight assigned will be understood in - * proportion to the weights assigned to other segments in the same segment - * group. Acceptable values are 1 to 1000, inclusive. - */ - allocation: number; - /** - * ID of this audience segment. This is a read-only, auto-generated field. - */ - id: string; - /** - * Name of this audience segment. This is a required field and must be less - * than 65 characters long. - */ - name: string; -} -/** - * Audience Segment Group. - */ -export interface Schema$AudienceSegmentGroup { - /** - * Audience segments assigned to this group. The number of segments must be - * between 2 and 100. - */ - audienceSegments: Schema$AudienceSegment[]; - /** - * ID of this audience segment group. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Name of this audience segment group. This is a required field and must be - * less than 65 characters long. - */ - name: string; -} -/** - * Contains information about a browser that can be targeted by ads. - */ -export interface Schema$Browser { - /** - * ID referring to this grouping of browser and version numbers. This is the - * ID used for targeting. - */ - browserVersionId: string; - /** - * DART ID of this browser. This is the ID used when generating reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#browser". - */ - kind: string; - /** - * Major version number (leftmost number) of this browser. For example, for - * Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may - * be used to target any version number, and a question mark (?) may be used - * to target cases where the version number cannot be identified. For example, - * Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. - * Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases - * where the ad server knows the browser is Firefox but can't tell which - * version it is. - */ - majorVersion: string; - /** - * Minor version number (number after first dot on left) of this browser. For - * example, for Chrome 5.0.375.86 beta, this field should be set to 0. An - * asterisk (*) may be used to target any version number, and a question mark - * (?) may be used to target cases where the version number cannot be - * identified. For example, Chrome *.* targets any version of Chrome: - * 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. - * Firefox ?.? targets cases where the ad server knows the browser is Firefox - * but can't tell which version it is. - */ - minorVersion: string; - /** - * Name of this browser. - */ - name: string; -} -/** - * Browser List Response - */ -export interface Schema$BrowsersListResponse { - /** - * Browser collection. - */ - browsers: Schema$Browser[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#browsersListResponse". - */ - kind: string; -} -/** - * Contains properties of a DCM campaign. - */ -export interface Schema$Campaign { - /** - * Account ID of this campaign. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Ad blocking settings for this campaign. - */ - adBlockingConfiguration: Schema$AdBlockingConfiguration; - /** - * Additional creative optimization configurations for the campaign. - */ - additionalCreativeOptimizationConfigurations: - Schema$CreativeOptimizationConfiguration[]; - /** - * Advertiser group ID of the associated advertiser. - */ - advertiserGroupId: string; - /** - * Advertiser ID of this campaign. This is a required field. - */ - advertiserId: string; - /** - * Dimension value for the advertiser ID of this campaign. This is a - * read-only, auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this campaign has been archived. - */ - archived: boolean; - /** - * Audience segment groups assigned to this campaign. Cannot have more than - * 300 segment groups. - */ - audienceSegmentGroups: Schema$AudienceSegmentGroup[]; - /** - * Billing invoice code included in the DCM client billing invoices associated - * with the campaign. - */ - billingInvoiceCode: string; - /** - * Click-through URL suffix override properties for this campaign. - */ - clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; - /** - * Arbitrary comments about this campaign. Must be less than 256 characters - * long. - */ - comment: string; - /** - * Information about the creation of this campaign. This is a read-only field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * List of creative group IDs that are assigned to the campaign. - */ - creativeGroupIds: string[]; - /** - * Creative optimization configuration for the campaign. - */ - creativeOptimizationConfiguration: Schema$CreativeOptimizationConfiguration; - /** - * Click-through event tag ID override properties for this campaign. - */ - defaultClickThroughEventTagProperties: - Schema$DefaultClickThroughEventTagProperties; - /** - * The default landing page ID for this campaign. - */ - defaultLandingPageId: string; - /** - * Date on which the campaign will stop running. On insert, the end date must - * be today or a future date. The end date must be later than or be the same - * as the start date. If, for example, you set 6/25/2015 as both the start and - * end dates, the effective campaign run date is just that day only, - * 6/25/2015. The hours, minutes, and seconds of the end date should not be - * set, as doing so will result in an error. This is a required field. - */ - endDate: string; - /** - * Overrides that can be used to activate or deactivate advertiser event tags. - */ - eventTagOverrides: Schema$EventTagOverride[]; - /** - * External ID for this campaign. - */ - externalId: string; - /** - * ID of this campaign. This is a read-only auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this campaign. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaign". - */ - kind: string; - /** - * Information about the most recent modification of this campaign. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Lookback window settings for the campaign. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Name of this campaign. This is a required field and must be less than 256 - * characters long and unique among campaigns of the same advertiser. - */ - name: string; - /** - * Whether Nielsen reports are enabled for this campaign. - */ - nielsenOcrEnabled: boolean; - /** - * Date on which the campaign starts running. The start date can be any date. - * The hours, minutes, and seconds of the start date should not be set, as - * doing so will result in an error. This is a required field. - */ - startDate: string; - /** - * Subaccount ID of this campaign. This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Campaign trafficker contact emails. - */ - traffickerEmails: string[]; -} -/** - * Identifies a creative which has been associated with a given campaign. - */ -export interface Schema$CampaignCreativeAssociation { - /** - * ID of the creative associated with the campaign. This is a required field. - */ - creativeId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignCreativeAssociation". - */ - kind: string; -} -/** - * Campaign Creative Association List Response - */ -export interface Schema$CampaignCreativeAssociationsListResponse { - /** - * Campaign creative association collection - */ - campaignCreativeAssociations: Schema$CampaignCreativeAssociation[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignCreativeAssociationsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Campaign List Response - */ -export interface Schema$CampaignsListResponse { - /** - * Campaign collection. - */ - campaigns: Schema$Campaign[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#campaignsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Describes a change that a user has made to a resource. - */ -export interface Schema$ChangeLog { - /** - * Account ID of the modified object. - */ - accountId: string; - /** - * Action which caused the change. - */ - action: string; - /** - * Time when the object was modified. - */ - changeTime: string; - /** - * Field name of the object which changed. - */ - fieldName: string; - /** - * ID of this change log. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#changeLog". - */ - kind: string; - /** - * New value of the object field. - */ - newValue: string; - /** - * ID of the object of this change log. The object could be a campaign, - * placement, ad, or other type. - */ - objectId: string; - /** - * Object type of the change log. - */ - objectType: string; - /** - * Old value of the object field. - */ - oldValue: string; - /** - * Subaccount ID of the modified object. - */ - subaccountId: string; - /** - * Transaction ID of this change log. When a single API call results in many - * changes, each change will have a separate ID in the change log but will - * share the same transactionId. - */ - transactionId: string; - /** - * ID of the user who modified the object. - */ - userProfileId: string; - /** - * User profile name of the user who modified the object. - */ - userProfileName: string; -} -/** - * Change Log List Response - */ -export interface Schema$ChangeLogsListResponse { - /** - * Change log collection. - */ - changeLogs: Schema$ChangeLog[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#changeLogsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * City List Response - */ -export interface Schema$CitiesListResponse { - /** - * City collection. - */ - cities: Schema$City[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#citiesListResponse". - */ - kind: string; -} -/** - * Contains information about a city that can be targeted by ads. - */ -export interface Schema$City { - /** - * Country code of the country to which this city belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this city belongs. - */ - countryDartId: string; - /** - * DART ID of this city. This is the ID used for targeting and generating - * reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#city". - */ - kind: string; - /** - * Metro region code of the metro region (DMA) to which this city belongs. - */ - metroCode: string; - /** - * ID of the metro region (DMA) to which this city belongs. - */ - metroDmaId: string; - /** - * Name of this city. - */ - name: string; - /** - * Region code of the region to which this city belongs. - */ - regionCode: string; - /** - * DART ID of the region to which this city belongs. - */ - regionDartId: string; -} -/** - * Creative Click Tag. - */ -export interface Schema$ClickTag { - /** - * Parameter value for the specified click tag. This field contains a - * click-through url. - */ - clickThroughUrl: Schema$CreativeClickThroughUrl; - /** - * Advertiser event name associated with the click tag. This field is used by - * DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - eventName: string; - /** - * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY - * creative assets, this field must match the value of the creative - * asset's creativeAssetId.name field. - */ - name: string; -} -/** - * Click-through URL - */ -export interface Schema$ClickThroughUrl { - /** - * Read-only convenience field representing the actual URL that will be used - * for this click-through. The URL is computed as follows: - If - * defaultLandingPage is enabled then the campaign's default landing page - * URL is assigned to this field. - If defaultLandingPage is not enabled and a - * landingPageId is specified then that landing page's URL is assigned to - * this field. - If neither of the above cases apply, then the - * customClickThroughUrl is assigned to this field. - */ - computedClickThroughUrl: string; - /** - * Custom click-through URL. Applicable if the defaultLandingPage field is set - * to false and the landingPageId field is left unset. - */ - customClickThroughUrl: string; - /** - * Whether the campaign default landing page is used. - */ - defaultLandingPage: boolean; - /** - * ID of the landing page for the click-through URL. Applicable if the - * defaultLandingPage field is set to false. - */ - landingPageId: string; -} -/** - * Click Through URL Suffix settings. - */ -export interface Schema$ClickThroughUrlSuffixProperties { - /** - * Click-through URL suffix to apply to all ads in this entity's scope. - * Must be less than 128 characters long. - */ - clickThroughUrlSuffix: string; - /** - * Whether this entity should override the inherited click-through URL suffix - * with its own defined value. - */ - overrideInheritedSuffix: boolean; -} -/** - * Companion Click-through override. - */ -export interface Schema$CompanionClickThroughOverride { - /** - * Click-through URL of this companion click-through override. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * ID of the creative for this companion click-through override. - */ - creativeId: string; -} -/** - * Companion Settings - */ -export interface Schema$CompanionSetting { - /** - * Whether companions are disabled for this placement. - */ - companionsDisabled: boolean; - /** - * Whitelist of companion sizes to be served to this placement. Set this list - * to null or empty to serve all companion sizes. - */ - enabledSizes: Schema$Size[]; - /** - * Whether to serve only static images as companions. - */ - imageOnly: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#companionSetting". - */ - kind: string; -} -/** - * Represents a response to the queryCompatibleFields method. - */ -export interface Schema$CompatibleFields { - /** - * Contains items that are compatible to be selected for a report of type - * "CROSS_DIMENSION_REACH". - */ - crossDimensionReachReportCompatibleFields: - Schema$CrossDimensionReachReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "FLOODLIGHT". - */ - floodlightReportCompatibleFields: Schema$FloodlightReportCompatibleFields; - /** - * The kind of resource this is, in this case dfareporting#compatibleFields. - */ - kind: string; - /** - * Contains items that are compatible to be selected for a report of type - * "PATH_TO_CONVERSION". - */ - pathToConversionReportCompatibleFields: - Schema$PathToConversionReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "REACH". - */ - reachReportCompatibleFields: Schema$ReachReportCompatibleFields; - /** - * Contains items that are compatible to be selected for a report of type - * "STANDARD". - */ - reportCompatibleFields: Schema$ReportCompatibleFields; -} -/** - * Contains information about an internet connection type that can be targeted - * by ads. Clients can use the connection type to target mobile vs. broadband - * users. - */ -export interface Schema$ConnectionType { - /** - * ID of this connection type. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#connectionType". - */ - kind: string; - /** - * Name of this connection type. - */ - name: string; -} -/** - * Connection Type List Response - */ -export interface Schema$ConnectionTypesListResponse { - /** - * Collection of connection types such as broadband and mobile. - */ - connectionTypes: Schema$ConnectionType[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#connectionTypesListResponse". - */ - kind: string; -} -/** - * Content Category List Response - */ -export interface Schema$ContentCategoriesListResponse { - /** - * Content category collection. - */ - contentCategories: Schema$ContentCategory[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#contentCategoriesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Organizes placements according to the contents of their associated webpages. - */ -export interface Schema$ContentCategory { - /** - * Account ID of this content category. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this content category. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#contentCategory". - */ - kind: string; - /** - * Name of this content category. This is a required field and must be less - * than 256 characters long and unique among content categories of the same - * account. - */ - name: string; -} -/** - * A Conversion represents when a user successfully performs a desired action - * after seeing an ad. - */ -export interface Schema$Conversion { - /** - * Whether the conversion was directed toward children. - */ - childDirectedTreatment: boolean; - /** - * Custom floodlight variables. - */ - customVariables: Schema$CustomFloodlightVariable[]; - /** - * The alphanumeric encrypted user ID. When set, encryptionInfo should also be - * specified. This field is mutually exclusive with - * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or - * encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required field. - */ - encryptedUserId: string; - /** - * A list of the alphanumeric encrypted user IDs. Any user ID with exposure - * prior to the conversion timestamp will be used in the inserted conversion. - * If no such user ID is found then the conversion will be rejected with - * NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo should also be - * specified. This field may only be used when calling batchinsert; it is not - * supported by batchupdate. This field is mutually exclusive with - * encryptedUserId, mobileDeviceId and gclid. This or encryptedUserId or - * mobileDeviceId or gclid is a required field. - */ - encryptedUserIdCandidates: string[]; - /** - * Floodlight Activity ID of this conversion. This is a required field. - */ - floodlightActivityId: string; - /** - * Floodlight Configuration ID of this conversion. This is a required field. - */ - floodlightConfigurationId: string; - /** - * The Google click ID. This field is mutually exclusive with encryptedUserId, - * encryptedUserIdCandidates[] and mobileDeviceId. This or encryptedUserId or - * encryptedUserIdCandidates[] or mobileDeviceId is a required field. - */ - gclid: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversion". - */ - kind: string; - /** - * Whether Limit Ad Tracking is enabled. When set to true, the conversion will - * be used for reporting but not targeting. This will prevent remarketing. - */ - limitAdTracking: boolean; - /** - * The mobile device ID. This field is mutually exclusive with - * encryptedUserId, encryptedUserIdCandidates[] and gclid. This or - * encryptedUserId or encryptedUserIdCandidates[] or gclid is a required - * field. - */ - mobileDeviceId: string; - /** - * The ordinal of the conversion. Use this field to control how conversions of - * the same user and day are de-duplicated. This is a required field. - */ - ordinal: string; - /** - * The quantity of the conversion. - */ - quantity: string; - /** - * The timestamp of conversion, in Unix epoch micros. This is a required - * field. - */ - timestampMicros: string; - /** - * The value of the conversion. - */ - value: number; -} -/** - * The error code and description for a conversion that failed to insert or - * update. - */ -export interface Schema$ConversionError { - /** - * The error code. - */ - code: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionError". - */ - kind: string; - /** - * A description of the error. - */ - message: string; -} -/** - * Insert Conversions Request. - */ -export interface Schema$ConversionsBatchInsertRequest { - /** - * The set of conversions to insert. - */ - conversions: Schema$Conversion[]; - /** - * Describes how encryptedUserId or encryptedUserIdCandidates[] is encrypted. - * This is a required field if encryptedUserId or encryptedUserIdCandidates[] - * is used. - */ - encryptionInfo: Schema$EncryptionInfo; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchInsertRequest". - */ - kind: string; -} -/** - * Insert Conversions Response. - */ -export interface Schema$ConversionsBatchInsertResponse { - /** - * Indicates that some or all conversions failed to insert. - */ - hasFailures: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchInsertResponse". - */ - kind: string; - /** - * The insert status of each conversion. Statuses are returned in the same - * order that conversions are inserted. - */ - status: Schema$ConversionStatus[]; -} -/** - * Update Conversions Request. - */ -export interface Schema$ConversionsBatchUpdateRequest { - /** - * The set of conversions to update. - */ - conversions: Schema$Conversion[]; - /** - * Describes how encryptedUserId is encrypted. This is a required field if - * encryptedUserId is used. - */ - encryptionInfo: Schema$EncryptionInfo; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchUpdateRequest". - */ - kind: string; -} -/** - * Update Conversions Response. - */ -export interface Schema$ConversionsBatchUpdateResponse { - /** - * Indicates that some or all conversions failed to update. - */ - hasFailures: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionsBatchUpdateResponse". - */ - kind: string; - /** - * The update status of each conversion. Statuses are returned in the same - * order that conversions are updated. - */ - status: Schema$ConversionStatus[]; -} -/** - * The original conversion that was inserted or updated and whether there were - * any errors. - */ -export interface Schema$ConversionStatus { - /** - * The original conversion that was inserted or updated. - */ - conversion: Schema$Conversion; - /** - * A list of errors related to this conversion. - */ - errors: Schema$ConversionError[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#conversionStatus". - */ - kind: string; -} -/** - * Country List Response - */ -export interface Schema$CountriesListResponse { - /** - * Country collection. - */ - countries: Schema$Country[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#countriesListResponse". - */ - kind: string; -} -/** - * Contains information about a country that can be targeted by ads. - */ -export interface Schema$Country { - /** - * Country code. - */ - countryCode: string; - /** - * DART ID of this country. This is the ID used for targeting and generating - * reports. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#country". - */ - kind: string; - /** - * Name of this country. - */ - name: string; - /** - * Whether ad serving supports secure servers in this country. - */ - sslEnabled: boolean; -} -/** - * Contains properties of a Creative. - */ -export interface Schema$Creative { - /** - * Account ID of this creative. This field, if left unset, will be - * auto-generated for both insert and update operations. Applicable to all - * creative types. - */ - accountId: string; - /** - * Whether the creative is active. Applicable to all creative types. - */ - active: boolean; - /** - * Ad parameters user for VPAID creative. This is a read-only field. - * Applicable to the following creative types: all VPAID. - */ - adParameters: string; - /** - * Keywords for a Rich Media creative. Keywords let you customize the creative - * settings of a Rich Media ad running on your site without having to contact - * the advertiser. You can use keywords to dynamically change the look or - * functionality of a creative. Applicable to the following creative types: - * all RICH_MEDIA, and all VPAID. - */ - adTagKeys: string[]; - /** - * Advertiser ID of this creative. This is a required field. Applicable to all - * creative types. - */ - advertiserId: string; - /** - * Whether script access is allowed for this creative. This is a read-only and - * deprecated field which will automatically be set to true on update. - * Applicable to the following creative types: FLASH_INPAGE. - */ - allowScriptAccess: boolean; - /** - * Whether the creative is archived. Applicable to all creative types. - */ - archived: boolean; - /** - * Type of artwork used for the creative. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA, and all VPAID. - */ - artworkType: string; - /** - * Source application where creative was authored. Presently, only DBM - * authored creatives will have this field set. Applicable to all creative - * types. - */ - authoringSource: string; - /** - * Authoring tool for HTML5 banner creatives. This is a read-only field. - * Applicable to the following creative types: HTML5_BANNER. - */ - authoringTool: string; - /** - * Whether images are automatically advanced for image gallery creatives. - * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. - */ - autoAdvanceImages: boolean; - /** - * The 6-character HTML color code, beginning with #, for the background of - * the window area where the Flash file is displayed. Default is white. - * Applicable to the following creative types: FLASH_INPAGE. - */ - backgroundColor: string; - /** - * Click-through URL for backup image. Applicable to ENHANCED_BANNER when the - * primary asset type is not HTML_IMAGE. - */ - backupImageClickThroughUrl: Schema$CreativeClickThroughUrl; - /** - * List of feature dependencies that will cause a backup image to be served if - * the browser that serves the ad does not support them. Feature dependencies - * are features that a browser must be able to support in order to render your - * HTML5 creative asset correctly. This field is initially auto-generated to - * contain all features detected by DCM for all the assets of this creative - * and can then be modified by the client. To reset this field, copy over all - * the creativeAssets' detected features. Applicable to the following - * creative types: HTML5_BANNER. Applicable to DISPLAY when the primary asset - * type is not HTML_IMAGE. - */ - backupImageFeatures: string[]; - /** - * Reporting label used for HTML5 banner backup image. Applicable to the - * following creative types: DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - backupImageReportingLabel: string; - /** - * Target window for backup image. Applicable to the following creative types: - * FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the primary asset - * type is not HTML_IMAGE. - */ - backupImageTargetWindow: Schema$TargetWindow; - /** - * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER - * creatives, this is a subset of detected click tags for the assets - * associated with this creative. After creating a flash asset, detected click - * tags will be returned in the creativeAssetMetadata. When inserting the - * creative, populate the creative clickTags field using the - * creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY creatives, - * there should be exactly one entry in this list for each image creative - * asset. A click tag is matched with a corresponding creative asset by - * matching the clickTag.name field with the - * creativeAsset.assetIdentifier.name field. Applicable to the following - * creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - clickTags: Schema$ClickTag[]; - /** - * Industry standard ID assigned to creative for reach and frequency. - * Applicable to INSTREAM_VIDEO_REDIRECT creatives. - */ - commercialId: string; - /** - * List of companion creatives assigned to an in-Stream videocreative. - * Acceptable values include IDs of existing flash and image creatives. - * Applicable to the following creative types: all VPAID and all - * INSTREAM_VIDEO with dynamicAssetSelection set to false. - */ - companionCreatives: string[]; - /** - * Compatibilities associated with this creative. This is a read-only field. - * DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on - * mobile devices or in mobile apps for regular or interstitial ads, - * respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. - * Only pre-existing creatives may have these compatibilities since new - * creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead. - * IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with - * the VAST standard. Applicable to all creative types. Acceptable values - * are: - "APP" - "APP_INTERSTITIAL" - - * "IN_STREAM_VIDEO" - "DISPLAY" - - * "DISPLAY_INTERSTITIAL" - */ - compatibility: string[]; - /** - * Whether Flash assets associated with the creative need to be automatically - * converted to HTML5. This flag is enabled by default and users can choose to - * disable it if they don't want the system to generate and use HTML5 - * asset for this creative. Applicable to the following creative type: - * FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - convertFlashToHtml5: boolean; - /** - * List of counter events configured for the creative. For - * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated - * from clickTags. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. - */ - counterCustomEvents: Schema$CreativeCustomEvent[]; - /** - * Assets associated with a creative. Applicable to all but the following - * creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and - * REDIRECT - */ - creativeAssets: Schema$CreativeAsset[]; - /** - * Required if dynamicAssetSelection is true. - */ - creativeAssetSelection: Schema$CreativeAssetSelection; - /** - * Creative field assignments for this creative. Applicable to all creative - * types. - */ - creativeFieldAssignments: Schema$CreativeFieldAssignment[]; - /** - * Custom key-values for a Rich Media creative. Key-values let you customize - * the creative settings of a Rich Media ad running on your site without - * having to contact the advertiser. You can use key-values to dynamically - * change the look or functionality of a creative. Applicable to the following - * creative types: all RICH_MEDIA, and all VPAID. - */ - customKeyValues: string[]; - /** - * Set this to true to enable the use of rules to target individual assets in - * this creative. When set to true creativeAssetSelection must be set. This - * also controls asset-level companions. When this is true, companion - * creatives should be assigned to creative assets. Learn more. Applicable to - * INSTREAM_VIDEO creatives. - */ - dynamicAssetSelection: boolean; - /** - * List of exit events configured for the creative. For DISPLAY and - * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated - * from clickTags, For DISPLAY, an event is also created from the - * backupImageReportingLabel. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - exitCustomEvents: Schema$CreativeCustomEvent[]; - /** - * OpenWindow FSCommand of this creative. This lets the SWF file communicate - * with either Flash Player or the program hosting Flash Player, such as a web - * browser. This is only triggered if allowScriptAccess field is true. - * Applicable to the following creative types: FLASH_INPAGE. - */ - fsCommand: Schema$FsCommand; - /** - * HTML code for the creative. This is a required field when applicable. This - * field is ignored if htmlCodeLocked is true. Applicable to the following - * creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and all - * RICH_MEDIA. - */ - htmlCode: string; - /** - * Whether HTML code is DCM-generated or manually entered. Set to true to - * ignore changes to htmlCode. Applicable to the following creative types: - * FLASH_INPAGE and HTML5_BANNER. - */ - htmlCodeLocked: boolean; - /** - * ID of this creative. This is a read-only, auto-generated field. Applicable - * to all creative types. - */ - id: string; - /** - * Dimension value for the ID of this creative. This is a read-only field. - * Applicable to all creative types. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creative". - */ - kind: string; - /** - * Creative last modification information. This is a read-only field. - * Applicable to all creative types. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Latest Studio trafficked creative ID associated with rich media and VPAID - * creatives. This is a read-only field. Applicable to the following creative - * types: all RICH_MEDIA, and all VPAID. - */ - latestTraffickedCreativeId: string; - /** - * Name of the creative. This is a required field and must be less than 256 - * characters long. Applicable to all creative types. - */ - name: string; - /** - * Override CSS value for rich media creatives. Applicable to the following - * creative types: all RICH_MEDIA. - */ - overrideCss: string; - /** - * The asset ID of the polite load image asset. Applicable to the creative - * type: DISPLAY. - */ - politeLoadAssetId: string; - /** - * Amount of time to play the video before counting a view. Applicable to the - * following creative types: all INSTREAM_VIDEO. - */ - progressOffset: Schema$VideoOffset; - /** - * URL of hosted image or hosted video or another ad tag. For - * INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect URL. - * The standard for a VAST (Video Ad Serving Template) ad response allows for - * a redirect link to another VAST 2.0 or 3.0 call. This is a required field - * when applicable. Applicable to the following creative types: - * DISPLAY_REDIRECT, INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and - * INSTREAM_VIDEO_REDIRECT - */ - redirectUrl: string; - /** - * ID of current rendering version. This is a read-only field. Applicable to - * all creative types. - */ - renderingId: string; - /** - * Dimension value for the rendering ID of this creative. This is a read-only - * field. Applicable to all creative types. - */ - renderingIdDimensionValue: Schema$DimensionValue; - /** - * The minimum required Flash plugin version for this creative. For - * example, 11.2.202.235. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA, and all VPAID. - */ - requiredFlashPluginVersion: string; - /** - * The internal Flash version for this creative as calculated by DoubleClick - * Studio. This is a read-only field. Applicable to the following creative - * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY - * when the primary asset type is not HTML_IMAGE. - */ - requiredFlashVersion: number; - /** - * Size associated with this creative. When inserting or updating a creative - * either the size ID field or size width and height fields can be used. This - * is a required field when applicable; however for IMAGE, FLASH_INPAGE - * creatives, and for DISPLAY creatives with a primary asset of type - * HTML_IMAGE, if left blank, this field will be automatically set using the - * actual size of the associated image assets. Applicable to the following - * creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, - * IMAGE, and all RICH_MEDIA. - */ - size: Schema$Size; - /** - * Amount of time to play the video before the skip button appears. Applicable - * to the following creative types: all INSTREAM_VIDEO. - */ - skipOffset: Schema$VideoOffset; - /** - * Whether the user can choose to skip the creative. Applicable to the - * following creative types: all INSTREAM_VIDEO and all VPAID. - */ - skippable: boolean; - /** - * Whether the creative is SSL-compliant. This is a read-only field. - * Applicable to all creative types. - */ - sslCompliant: boolean; - /** - * Whether creative should be treated as SSL compliant even if the system scan - * shows it's not. Applicable to all creative types. - */ - sslOverride: boolean; - /** - * Studio advertiser ID associated with rich media and VPAID creatives. This - * is a read-only field. Applicable to the following creative types: all - * RICH_MEDIA, and all VPAID. - */ - studioAdvertiserId: string; - /** - * Studio creative ID associated with rich media and VPAID creatives. This is - * a read-only field. Applicable to the following creative types: all - * RICH_MEDIA, and all VPAID. - */ - studioCreativeId: string; - /** - * Studio trafficked creative ID associated with rich media and VPAID - * creatives. This is a read-only field. Applicable to the following creative - * types: all RICH_MEDIA, and all VPAID. - */ - studioTraffickedCreativeId: string; - /** - * Subaccount ID of this creative. This field, if left unset, will be - * auto-generated for both insert and update operations. Applicable to all - * creative types. - */ - subaccountId: string; - /** - * Third-party URL used to record backup image impressions. Applicable to the - * following creative types: all RICH_MEDIA. - */ - thirdPartyBackupImageImpressionsUrl: string; - /** - * Third-party URL used to record rich media impressions. Applicable to the - * following creative types: all RICH_MEDIA. - */ - thirdPartyRichMediaImpressionsUrl: string; - /** - * Third-party URLs for tracking in-stream video creative events. Applicable - * to the following creative types: all INSTREAM_VIDEO and all VPAID. - */ - thirdPartyUrls: Schema$ThirdPartyTrackingUrl[]; - /** - * List of timer events configured for the creative. For DISPLAY_IMAGE_GALLERY - * creatives, these are read-only and auto-generated from clickTags. - * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY, all - * RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary asset is - * not HTML_IMAGE. - */ - timerCustomEvents: Schema$CreativeCustomEvent[]; - /** - * Combined size of all creative assets. This is a read-only field. Applicable - * to the following creative types: all RICH_MEDIA, and all VPAID. - */ - totalFileSize: string; - /** - * Type of this creative. This is a required field. Applicable to all creative - * types. Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for - * existing creatives. New creatives should use DISPLAY as a replacement for - * these types. - */ - type: string; - /** - * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following - * creative types: INSTREAM_VIDEO and VPAID. - */ - universalAdId: Schema$UniversalAdId; - /** - * The version number helps you keep track of multiple versions of your - * creative in your reports. The version number will always be auto-generated - * during insert operations to start at 1. For tracking creatives the version - * cannot be incremented and will always remain at 1. For all other creative - * types the version can be incremented only by 1 during update operations. In - * addition, the version will be automatically incremented by 1 when - * undergoing Rich Media creative merging. Applicable to all creative types. - */ - version: number; - /** - * Description of the video ad. Applicable to the following creative types: - * all INSTREAM_VIDEO and all VPAID. - */ - videoDescription: string; - /** - * Creative video duration in seconds. This is a read-only field. Applicable - * to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all - * VPAID. - */ - videoDuration: number; -} -/** - * Creative Asset. - */ -export interface Schema$CreativeAsset { - /** - * Whether ActionScript3 is enabled for the flash asset. This is a read-only - * field. Applicable to the following creative type: FLASH_INPAGE. Applicable - * to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - actionScript3: boolean; - /** - * Whether the video asset is active. This is a read-only field for - * VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative types: - * INSTREAM_VIDEO and all VPAID. - */ - active: boolean; - /** - * Possible alignments for an asset. This is a read-only field. Applicable to - * the following creative types: - * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. - */ - alignment: string; - /** - * Artwork type of rich media creative. This is a read-only field. Applicable - * to the following creative types: all RICH_MEDIA. - */ - artworkType: string; - /** - * Identifier of this asset. This is the same identifier returned during - * creative asset insert operation. This is a required field. Applicable to - * all but the following creative types: all REDIRECT and TRACKING_TEXT. - */ - assetIdentifier: Schema$CreativeAssetId; - /** - * Exit event configured for the backup image. Applicable to the following - * creative types: all RICH_MEDIA. - */ - backupImageExit: Schema$CreativeCustomEvent; - /** - * Detected bit-rate for video asset. This is a read-only field. Applicable to - * the following creative types: INSTREAM_VIDEO and all VPAID. - */ - bitRate: number; - /** - * Rich media child asset type. This is a read-only field. Applicable to the - * following creative types: all VPAID. - */ - childAssetType: string; - /** - * Size of an asset when collapsed. This is a read-only field. Applicable to - * the following creative types: all RICH_MEDIA and all VPAID. Additionally, - * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or - * ASSET_DISPLAY_TYPE_PEEL_DOWN. - */ - collapsedSize: Schema$Size; - /** - * List of companion creatives assigned to an in-stream video creative asset. - * Acceptable values include IDs of existing flash and image creatives. - * Applicable to INSTREAM_VIDEO creative type with dynamicAssetSelection set - * to true. - */ - companionCreativeIds: string[]; - /** - * Custom start time in seconds for making the asset visible. Applicable to - * the following creative types: all RICH_MEDIA. Value must be greater than or - * equal to 0. - */ - customStartTimeValue: number; - /** - * List of feature dependencies for the creative asset that are detected by - * DCM. Feature dependencies are features that a browser must be able to - * support in order to render your HTML5 creative correctly. This is a - * read-only, auto-generated field. Applicable to the following creative - * types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is - * not HTML_IMAGE. - */ - detectedFeatures: string[]; - /** - * Type of rich media asset. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA. - */ - displayType: string; - /** - * Duration in seconds for which an asset will be displayed. Applicable to the - * following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. Value must - * be greater than or equal to 1. - */ - duration: number; - /** - * Duration type for which an asset will be displayed. Applicable to the - * following creative types: all RICH_MEDIA. - */ - durationType: string; - /** - * Detected expanded dimension for video asset. This is a read-only field. - * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - expandedDimension: Schema$Size; - /** - * File size associated with this creative asset. This is a read-only field. - * Applicable to all but the following creative types: all REDIRECT and - * TRACKING_TEXT. - */ - fileSize: string; - /** - * Flash version of the asset. This is a read-only field. Applicable to the - * following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - */ - flashVersion: number; - /** - * Whether to hide Flash objects flag for an asset. Applicable to the - * following creative types: all RICH_MEDIA. - */ - hideFlashObjects: boolean; - /** - * Whether to hide selection boxes flag for an asset. Applicable to the - * following creative types: all RICH_MEDIA. - */ - hideSelectionBoxes: boolean; - /** - * Whether the asset is horizontally locked. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA. - */ - horizontallyLocked: boolean; - /** - * Numeric ID of this creative asset. This is a required field and should not - * be modified. Applicable to all but the following creative types: all - * REDIRECT and TRACKING_TEXT. - */ - id: string; - /** - * Dimension value for the ID of the asset. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Detected MIME type for video asset. This is a read-only field. Applicable - * to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - mimeType: string; - /** - * Offset position for an asset in collapsed mode. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA and all VPAID. - * Additionally, only applicable to assets whose displayType is - * ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. - */ - offset: Schema$OffsetPosition; - /** - * Orientation of video asset. This is a read-only, auto-generated field. - */ - orientation: string; - /** - * Whether the backup asset is original or changed by the user in DCM. - * Applicable to the following creative types: all RICH_MEDIA. - */ - originalBackup: boolean; - /** - * Offset position for an asset. Applicable to the following creative types: - * all RICH_MEDIA. - */ - position: Schema$OffsetPosition; - /** - * Offset left unit for an asset. This is a read-only field. Applicable to the - * following creative types: all RICH_MEDIA. - */ - positionLeftUnit: string; - /** - * Offset top unit for an asset. This is a read-only field if the asset - * displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following - * creative types: all RICH_MEDIA. - */ - positionTopUnit: string; - /** - * Progressive URL for video asset. This is a read-only field. Applicable to - * the following creative types: INSTREAM_VIDEO and all VPAID. - */ - progressiveServingUrl: string; - /** - * Whether the asset pushes down other content. Applicable to the following - * creative types: all RICH_MEDIA. Additionally, only applicable when the - * asset offsets are 0, the collapsedSize.width matches size.width, and the - * collapsedSize.height is less than size.height. - */ - pushdown: boolean; - /** - * Pushdown duration in seconds for an asset. Applicable to the following - * creative types: all RICH_MEDIA.Additionally, only applicable when the asset - * pushdown field is true, the offsets are 0, the collapsedSize.width matches - * size.width, and the collapsedSize.height is less than size.height. - * Acceptable values are 0 to 9.99, inclusive. - */ - pushdownDuration: number; - /** - * Role of the asset in relation to creative. Applicable to all but the - * following creative types: all REDIRECT and TRACKING_TEXT. This is a - * required field. PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, - * IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple - * primary assets), and all VPAID creatives. BACKUP_IMAGE applies to - * FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. - * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. - * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. - * OTHER refers to assets from sources other than DCM, such as Studio uploaded - * assets, applicable to all RICH_MEDIA and all VPAID creatives. PARENT_VIDEO - * refers to videos uploaded by the user in DCM and is applicable to - * INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. TRANSCODED_VIDEO refers to - * videos transcoded by DCM from PARENT_VIDEO assets and is applicable to - * INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. ALTERNATE_VIDEO refers to - * the DCM representation of child asset videos from Studio, and is applicable - * to VPAID_LINEAR_VIDEO creatives. These cannot be added or removed within - * DCM. For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and - * ALTERNATE_VIDEO assets that are marked active serve as backup in case the - * VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or - * removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. - */ - role: string; - /** - * Size associated with this creative asset. This is a required field when - * applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, - * this field will be automatically set using the actual size of the - * associated image asset. Applicable to the following creative types: - * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all - * RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not - * HTML_IMAGE. - */ - size: Schema$Size; - /** - * Whether the asset is SSL-compliant. This is a read-only field. Applicable - * to all but the following creative types: all REDIRECT and TRACKING_TEXT. - */ - sslCompliant: boolean; - /** - * Initial wait time type before making the asset visible. Applicable to the - * following creative types: all RICH_MEDIA. - */ - startTimeType: string; - /** - * Streaming URL for video asset. This is a read-only field. Applicable to the - * following creative types: INSTREAM_VIDEO and all VPAID. - */ - streamingServingUrl: string; - /** - * Whether the asset is transparent. Applicable to the following creative - * types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. - */ - transparency: boolean; - /** - * Whether the asset is vertically locked. This is a read-only field. - * Applicable to the following creative types: all RICH_MEDIA. - */ - verticallyLocked: boolean; - /** - * Detected video duration for video asset. This is a read-only field. - * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. - */ - videoDuration: number; - /** - * Window mode options for flash assets. Applicable to the following creative - * types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, RICH_MEDIA_IM_EXPAND, - * RICH_MEDIA_DISPLAY_BANNER, and RICH_MEDIA_INPAGE_FLOATING. - */ - windowMode: string; - /** - * zIndex value of an asset. Applicable to the following creative types: all - * RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT - * one of the following types: ASSET_DISPLAY_TYPE_INPAGE or - * ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, - * inclusive. - */ - zIndex: number; - /** - * File name of zip file. This is a read-only field. Applicable to the - * following creative types: HTML5_BANNER. - */ - zipFilename: string; - /** - * Size of zip file. This is a read-only field. Applicable to the following - * creative types: HTML5_BANNER. - */ - zipFilesize: string; -} -/** - * Creative Asset ID. - */ -export interface Schema$CreativeAssetId { - /** - * Name of the creative asset. This is a required field while inserting an - * asset. After insertion, this assetIdentifier is used to identify the - * uploaded asset. Characters in the name must be alphanumeric or one of the - * following: ".-_ ". Spaces are allowed. - */ - name: string; - /** - * Type of asset to upload. This is a required field. FLASH and IMAGE are no - * longer supported for new uploads. All image assets should use HTML_IMAGE. - */ - type: string; -} -/** - * CreativeAssets contains properties of a creative asset file which will be - * uploaded or has already been uploaded. Refer to the creative sample code for - * how to upload assets and insert a creative. - */ -export interface Schema$CreativeAssetMetadata { - /** - * ID of the creative asset. This is a required field. - */ - assetIdentifier: Schema$CreativeAssetId; - /** - * List of detected click tags for assets. This is a read-only auto-generated - * field. - */ - clickTags: Schema$ClickTag[]; - /** - * List of feature dependencies for the creative asset that are detected by - * DCM. Feature dependencies are features that a browser must be able to - * support in order to render your HTML5 creative correctly. This is a - * read-only, auto-generated field. - */ - detectedFeatures: string[]; - /** - * Numeric ID of the asset. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the numeric ID of the asset. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeAssetMetadata". - */ - kind: string; - /** - * Rules validated during code generation that generated a warning. This is a - * read-only, auto-generated field. Possible values are: - - * "ADMOB_REFERENCED" - "ASSET_FORMAT_UNSUPPORTED_DCM" - - * "ASSET_INVALID" - "CLICK_TAG_HARD_CODED" - - * "CLICK_TAG_INVALID" - "CLICK_TAG_IN_GWD" - - * "CLICK_TAG_MISSING" - "CLICK_TAG_MORE_THAN_ONE" - - * "CLICK_TAG_NON_TOP_LEVEL" - "COMPONENT_UNSUPPORTED_DCM" - * - "ENABLER_UNSUPPORTED_METHOD_DCM" - - * "EXTERNAL_FILE_REFERENCED" - "FILE_DETAIL_EMPTY" - - * "FILE_TYPE_INVALID" - "GWD_PROPERTIES_INVALID" - - * "HTML5_FEATURE_UNSUPPORTED" - "LINKED_FILE_NOT_FOUND" - - * "MAX_FLASH_VERSION_11" - "MRAID_REFERENCED" - - * "NOT_SSL_COMPLIANT" - "ORPHANED_ASSET" - - * "PRIMARY_HTML_MISSING" - "SVG_INVALID" - - * "ZIP_INVALID" - */ - warnedValidationRules: string[]; -} -/** - * Encapsulates the list of rules for asset selection and a default asset in - * case none of the rules match. Applicable to INSTREAM_VIDEO creatives. - */ -export interface Schema$CreativeAssetSelection { - /** - * A creativeAssets[].id. This should refer to one of the parent assets in - * this creative, and will be served if none of the rules match. This is a - * required field. - */ - defaultAssetId: string; - /** - * Rules determine which asset will be served to a viewer. Rules will be - * evaluated in the order in which they are stored in this list. This list - * must contain at least one rule. Applicable to INSTREAM_VIDEO creatives. - */ - rules: Schema$Rule[]; -} -/** - * Creative Assignment. - */ -export interface Schema$CreativeAssignment { - /** - * Whether this creative assignment is active. When true, the creative will be - * included in the ad's rotation. - */ - active: boolean; - /** - * Whether applicable event tags should fire when this creative assignment is - * rendered. If this value is unset when the ad is inserted or updated, it - * will default to true for all creative types EXCEPT for INTERNAL_REDIRECT, - * INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. - */ - applyEventTags: boolean; - /** - * Click-through URL of the creative assignment. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Companion creative overrides for this creative assignment. Applicable to - * video ads. - */ - companionCreativeOverrides: Schema$CompanionClickThroughOverride[]; - /** - * Creative group assignments for this creative assignment. Only one - * assignment per creative group number is allowed for a maximum of two - * assignments. - */ - creativeGroupAssignments: Schema$CreativeGroupAssignment[]; - /** - * ID of the creative to be assigned. This is a required field. - */ - creativeId: string; - /** - * Dimension value for the ID of the creative. This is a read-only, - * auto-generated field. - */ - creativeIdDimensionValue: Schema$DimensionValue; - /** - * Date and time that the assigned creative should stop serving. Must be later - * than the start time. - */ - endTime: string; - /** - * Rich media exit overrides for this creative assignment. Applicable when the - * creative type is any of the following: - DISPLAY - RICH_MEDIA_INPAGE - - * RICH_MEDIA_INPAGE_FLOATING - RICH_MEDIA_IM_EXPAND - RICH_MEDIA_EXPANDING - - * RICH_MEDIA_INTERSTITIAL_FLOAT - RICH_MEDIA_MOBILE_IN_APP - - * RICH_MEDIA_MULTI_FLOATING - RICH_MEDIA_PEEL_DOWN - VPAID_LINEAR - - * VPAID_NON_LINEAR - */ - richMediaExitOverrides: Schema$RichMediaExitOverride[]; - /** - * Sequence number of the creative assignment, applicable when the rotation - * type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to - * 65535, inclusive. - */ - sequence: number; - /** - * Whether the creative to be assigned is SSL-compliant. This is a read-only - * field that is auto-generated when the ad is inserted or updated. - */ - sslCompliant: boolean; - /** - * Date and time that the assigned creative should start serving. - */ - startTime: string; - /** - * Weight of the creative assignment, applicable when the rotation type is - * CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. - */ - weight: number; -} -/** - * Click-through URL - */ -export interface Schema$CreativeClickThroughUrl { - /** - * Read-only convenience field representing the actual URL that will be used - * for this click-through. The URL is computed as follows: - If landingPageId - * is specified then that landing page's URL is assigned to this field. - - * Otherwise, the customClickThroughUrl is assigned to this field. - */ - computedClickThroughUrl: string; - /** - * Custom click-through URL. Applicable if the landingPageId field is left - * unset. - */ - customClickThroughUrl: string; - /** - * ID of the landing page for the click-through URL. - */ - landingPageId: string; -} -/** - * Creative Custom Event. - */ -export interface Schema$CreativeCustomEvent { - /** - * Unique ID of this event used by DDM Reporting and Data Transfer. This is a - * read-only field. - */ - advertiserCustomEventId: string; - /** - * User-entered name for the event. - */ - advertiserCustomEventName: string; - /** - * Type of the event. This is a read-only field. - */ - advertiserCustomEventType: string; - /** - * Artwork label column, used to link events in DCM back to events in Studio. - * This is a required field and should not be modified after insertion. - */ - artworkLabel: string; - /** - * Artwork type used by the creative.This is a read-only field. - */ - artworkType: string; - /** - * Exit click-through URL for the event. This field is used only for exit - * events. - */ - exitClickThroughUrl: Schema$CreativeClickThroughUrl; - /** - * ID of this event. This is a required field and should not be modified after - * insertion. - */ - id: string; - /** - * Properties for rich media popup windows. This field is used only for exit - * events. - */ - popupWindowProperties: Schema$PopupWindowProperties; - /** - * Target type used by the event. - */ - targetType: string; - /** - * Video reporting ID, used to differentiate multiple videos in a single - * creative. This is a read-only field. - */ - videoReportingId: string; -} -/** - * Contains properties of a creative field. - */ -export interface Schema$CreativeField { - /** - * Account ID of this creative field. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this creative field. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * ID of this creative field. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeField". - */ - kind: string; - /** - * Name of this creative field. This is a required field and must be less than - * 256 characters long and unique among creative fields of the same - * advertiser. - */ - name: string; - /** - * Subaccount ID of this creative field. This is a read-only field that can be - * left blank. - */ - subaccountId: string; -} -/** - * Creative Field Assignment. - */ -export interface Schema$CreativeFieldAssignment { - /** - * ID of the creative field. - */ - creativeFieldId: string; - /** - * ID of the creative field value. - */ - creativeFieldValueId: string; -} -/** - * Creative Field List Response - */ -export interface Schema$CreativeFieldsListResponse { - /** - * Creative field collection. - */ - creativeFields: Schema$CreativeField[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a creative field value. - */ -export interface Schema$CreativeFieldValue { - /** - * ID of this creative field value. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldValue". - */ - kind: string; - /** - * Value of this creative field value. It needs to be less than 256 characters - * in length and unique per creative field. - */ - value: string; -} -/** - * Creative Field Value List Response - */ -export interface Schema$CreativeFieldValuesListResponse { - /** - * Creative field value collection. - */ - creativeFieldValues: Schema$CreativeFieldValue[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeFieldValuesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a creative group. - */ -export interface Schema$CreativeGroup { - /** - * Account ID of this creative group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this creative group. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Subgroup of the creative group. Assign your creative groups to a subgroup - * in order to filter or manage them more easily. This field is required on - * insertion and is read-only after insertion. Acceptable values are 1 to 2, - * inclusive. - */ - groupNumber: number; - /** - * ID of this creative group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeGroup". - */ - kind: string; - /** - * Name of this creative group. This is a required field and must be less than - * 256 characters long and unique among creative groups of the same - * advertiser. - */ - name: string; - /** - * Subaccount ID of this creative group. This is a read-only field that can be - * left blank. - */ - subaccountId: string; -} -/** - * Creative Group Assignment. - */ -export interface Schema$CreativeGroupAssignment { - /** - * ID of the creative group to be assigned. - */ - creativeGroupId: string; - /** - * Creative group number of the creative group assignment. - */ - creativeGroupNumber: string; -} -/** - * Creative Group List Response - */ -export interface Schema$CreativeGroupsListResponse { - /** - * Creative group collection. - */ - creativeGroups: Schema$CreativeGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativeGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Creative optimization settings. - */ -export interface Schema$CreativeOptimizationConfiguration { - /** - * ID of this creative optimization config. This field is auto-generated when - * the campaign is inserted or updated. It can be null for existing campaigns. - */ - id: string; - /** - * Name of this creative optimization config. This is a required field and - * must be less than 129 characters long. - */ - name: string; - /** - * List of optimization activities associated with this configuration. - */ - optimizationActivitys: Schema$OptimizationActivity[]; - /** - * Optimization model for this configuration. - */ - optimizationModel: string; -} -/** - * Creative Rotation. - */ -export interface Schema$CreativeRotation { - /** - * Creative assignments in this creative rotation. - */ - creativeAssignments: Schema$CreativeAssignment[]; - /** - * Creative optimization configuration that is used by this ad. It should - * refer to one of the existing optimization configurations in the ad's - * campaign. If it is unset or set to 0, then the campaign's default - * optimization configuration will be used for this ad. - */ - creativeOptimizationConfigurationId: string; - /** - * Type of creative rotation. Can be used to specify whether to use sequential - * or random rotation. - */ - type: string; - /** - * Strategy for calculating weights. Used with CREATIVE_ROTATION_TYPE_RANDOM. - */ - weightCalculationStrategy: string; -} -/** - * Creative Settings - */ -export interface Schema$CreativeSettings { - /** - * Header text for iFrames for this site. Must be less than or equal to 2000 - * characters long. - */ - iFrameFooter: string; - /** - * Header text for iFrames for this site. Must be less than or equal to 2000 - * characters long. - */ - iFrameHeader: string; -} -/** - * Creative List Response - */ -export interface Schema$CreativesListResponse { - /** - * Creative collection. - */ - creatives: Schema$Creative[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#creativesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "CROSS_DIMENSION_REACH". - */ -export interface Schema$CrossDimensionReachReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the "breakdown" - * section of the report. - */ - breakdown: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#crossDimensionReachReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected in the - * "overlapMetricNames" section of the report. - */ - overlapMetrics: Schema$Metric[]; -} -/** - * A custom floodlight variable. - */ -export interface Schema$CustomFloodlightVariable { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#customFloodlightVariable". - */ - kind: string; - /** - * The type of custom floodlight variable to supply a value for. These map to - * the "u[1-20]=" in the tags. - */ - type: string; - /** - * The value of the custom floodlight variable. The length of string must not - * exceed 50 characters. - */ - value: string; -} -/** - * Represents a Custom Rich Media Events group. - */ -export interface Schema$CustomRichMediaEvents { - /** - * List of custom rich media event IDs. Dimension values must be all of type - * dfa:richMediaEventTypeIdAndName. - */ - filteredEventIds: Schema$DimensionValue[]; - /** - * The kind of resource this is, in this case - * dfareporting#customRichMediaEvents. - */ - kind: string; -} -/** - * Represents a date range. - */ -export interface Schema$DateRange { - /** - * The end date of the date range, inclusive. A string of the format: - * "yyyy-MM-dd". - */ - endDate: string; - /** - * The kind of resource this is, in this case dfareporting#dateRange. - */ - kind: string; - /** - * The date range relative to the date of when the report is run. - */ - relativeDateRange: string; - /** - * The start date of the date range, inclusive. A string of the format: - * "yyyy-MM-dd". - */ - startDate: string; -} -/** - * Day Part Targeting. - */ -export interface Schema$DayPartTargeting { - /** - * Days of the week when the ad will serve. Acceptable values are: - - * "SUNDAY" - "MONDAY" - "TUESDAY" - - * "WEDNESDAY" - "THURSDAY" - "FRIDAY" - - * "SATURDAY" - */ - daysOfWeek: string[]; - /** - * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 - * is 11 PM to midnight. Can be specified with days of week, in which case the - * ad would serve during these hours on the specified days. For example if - * Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm - * (hours 9, 15, and 16) is specified, the ad would serve Monday, Wednesdays, - * and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive. - */ - hoursOfDay: number[]; - /** - * Whether or not to use the user's local time. If false, the America/New - * York time zone applies. - */ - userLocalTime: boolean; -} -/** - * Properties of inheriting and overriding the default click-through event tag. - * A campaign may override the event tag defined at the advertiser level, and an - * ad may also override the campaign's setting further. - */ -export interface Schema$DefaultClickThroughEventTagProperties { - /** - * ID of the click-through event tag to apply to all ads in this entity's - * scope. - */ - defaultClickThroughEventTagId: string; - /** - * Whether this entity should override the inherited default click-through - * event tag with its own defined value. - */ - overrideInheritedEventTag: boolean; -} -/** - * Delivery Schedule. - */ -export interface Schema$DeliverySchedule { - /** - * Limit on the number of times an individual user can be served the ad within - * a specified period of time. - */ - frequencyCap: Schema$FrequencyCap; - /** - * Whether or not hard cutoff is enabled. If true, the ad will not serve after - * the end date and time. Otherwise the ad will continue to be served until it - * has reached its delivery goals. - */ - hardCutoff: boolean; - /** - * Impression ratio for this ad. This ratio determines how often each ad is - * served relative to the others. For example, if ad A has an impression ratio - * of 1 and ad B has an impression ratio of 3, then DCM will serve ad B three - * times as often as ad A. Acceptable values are 1 to 10, inclusive. - */ - impressionRatio: string; - /** - * Serving priority of an ad, with respect to other ads. The lower the - * priority number, the greater the priority with which it is served. - */ - priority: string; -} -/** - * DFP Settings - */ -export interface Schema$DfpSettings { - /** - * DFP network code for this directory site. - */ - dfpNetworkCode: string; - /** - * DFP network name for this directory site. - */ - dfpNetworkName: string; - /** - * Whether this directory site accepts programmatic placements. - */ - programmaticPlacementAccepted: boolean; - /** - * Whether this directory site is available only via DoubleClick Publisher - * Portal. - */ - publisherPortalOnly: boolean; - /** - * Whether this directory site accepts publisher-paid tags. - */ - pubPaidPlacementAccepted: boolean; -} -/** - * Represents a dimension. - */ -export interface Schema$Dimension { - /** - * The kind of resource this is, in this case dfareporting#dimension. - */ - kind: string; - /** - * The dimension name, e.g. dfa:advertiser - */ - name: string; -} -/** - * Represents a dimension filter. - */ -export interface Schema$DimensionFilter { - /** - * The name of the dimension to filter. - */ - dimensionName: string; - /** - * The kind of resource this is, in this case dfareporting#dimensionFilter. - */ - kind: string; - /** - * The value of the dimension to filter. - */ - value: string; -} -/** - * Represents a DimensionValue resource. - */ -export interface Schema$DimensionValue { - /** - * The name of the dimension. - */ - dimensionName: string; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The ID associated with the value if available. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#dimensionValue. - */ - kind: string; - /** - * Determines how the 'value' field is matched when filtering. If not - * specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is - * allowed as a placeholder for variable length character sequences, and it - * can be escaped with a backslash. Note, only paid search dimensions - * ('dfa:paidSearch*') allow a matchType other than EXACT. - */ - matchType: string; - /** - * The value of the dimension. - */ - value: string; -} -/** - * Represents the list of DimensionValue resources. - */ -export interface Schema$DimensionValueList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The dimension values returned in this response. - */ - items: Schema$DimensionValue[]; - /** - * The kind of list this is, in this case dfareporting#dimensionValueList. - */ - kind: string; - /** - * Continuation token used to page through dimension values. To retrieve the - * next page of results, set the next request's "pageToken" to - * the value of this field. The page token is only valid for a limited amount - * of time and should not be persisted. - */ - nextPageToken: string; -} -/** - * Represents a DimensionValuesRequest. - */ -export interface Schema$DimensionValueRequest { - /** - * The name of the dimension for which values should be requested. - */ - dimensionName: string; - /** - * The end date of the date range for which to retrieve dimension values. A - * string of the format "yyyy-MM-dd". - */ - endDate: string; - /** - * The list of filters by which to filter values. The filters are ANDed. - */ - filters: Schema$DimensionFilter[]; - /** - * The kind of request this is, in this case - * dfareporting#dimensionValueRequest. - */ - kind: string; - /** - * The start date of the date range for which to retrieve dimension values. A - * string of the format "yyyy-MM-dd". - */ - startDate: string; -} -/** - * DirectorySites contains properties of a website from the Site Directory. - * Sites need to be added to an account via the Sites resource before they can - * be assigned to a placement. - */ -export interface Schema$DirectorySite { - /** - * Whether this directory site is active. - */ - active: boolean; - /** - * Directory site contacts. - */ - contactAssignments: Schema$DirectorySiteContactAssignment[]; - /** - * Country ID of this directory site. This is a read-only field. - */ - countryId: string; - /** - * Currency ID of this directory site. This is a read-only field. Possible - * values are: - "1" for USD - "2" for GBP - - * "3" for ESP - "4" for SEK - "5" for CAD - - * "6" for JPY - "7" for DEM - "8" for AUD - - * "9" for FRF - "10" for ITL - "11" for DKK - * - "12" for NOK - "13" for FIM - "14" for - * ZAR - "15" for IEP - "16" for NLG - "17" - * for EUR - "18" for KRW - "19" for TWD - - * "20" for SGD - "21" for CNY - "22" for HKD - * - "23" for NZD - "24" for MYR - "25" for - * BRL - "26" for PTE - "27" for MXP - "28" - * for CLP - "29" for TRY - "30" for ARS - - * "31" for PEN - "32" for ILS - "33" for CHF - * - "34" for VEF - "35" for COP - "36" for - * GTQ - "37" for PLN - "39" for INR - "40" - * for THB - "41" for IDR - "42" for CZK - - * "43" for RON - "44" for HUF - "45" for RUB - * - "46" for AED - "47" for BGN - "48" for - * HRK - "49" for MXN - "50" for NGN - */ - currencyId: string; - /** - * Description of this directory site. This is a read-only field. - */ - description: string; - /** - * ID of this directory site. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this directory site. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Tag types for regular placements. Acceptable values are: - - * "STANDARD" - "IFRAME_JAVASCRIPT_INPAGE" - - * "INTERNAL_REDIRECT_INPAGE" - "JAVASCRIPT_INPAGE" - */ - inpageTagFormats: string[]; - /** - * Tag types for interstitial placements. Acceptable values are: - - * "IFRAME_JAVASCRIPT_INTERSTITIAL" - - * "INTERNAL_REDIRECT_INTERSTITIAL" - - * "JAVASCRIPT_INTERSTITIAL" - */ - interstitialTagFormats: string[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySite". - */ - kind: string; - /** - * Name of this directory site. - */ - name: string; - /** - * Parent directory site ID. - */ - parentId: string; - /** - * Directory site settings. - */ - settings: Schema$DirectorySiteSettings; - /** - * URL of this directory site. - */ - url: string; -} -/** - * Contains properties of a Site Directory contact. - */ -export interface Schema$DirectorySiteContact { - /** - * Address of this directory site contact. - */ - address: string; - /** - * Email address of this directory site contact. - */ - email: string; - /** - * First name of this directory site contact. - */ - firstName: string; - /** - * ID of this directory site contact. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySiteContact". - */ - kind: string; - /** - * Last name of this directory site contact. - */ - lastName: string; - /** - * Phone number of this directory site contact. - */ - phone: string; - /** - * Directory site contact role. - */ - role: string; - /** - * Title or designation of this directory site contact. - */ - title: string; - /** - * Directory site contact type. - */ - type: string; -} -/** - * Directory Site Contact Assignment - */ -export interface Schema$DirectorySiteContactAssignment { - /** - * ID of this directory site contact. This is a read-only, auto-generated - * field. - */ - contactId: string; - /** - * Visibility of this directory site contact assignment. When set to PUBLIC - * this contact assignment is visible to all account and agency users; when - * set to PRIVATE it is visible only to the site. - */ - visibility: string; -} -/** - * Directory Site Contact List Response - */ -export interface Schema$DirectorySiteContactsListResponse { - /** - * Directory site contact collection - */ - directorySiteContacts: Schema$DirectorySiteContact[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySiteContactsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Directory Site Settings - */ -export interface Schema$DirectorySiteSettings { - /** - * Whether this directory site has disabled active view creatives. - */ - activeViewOptOut: boolean; - /** - * Directory site DFP settings. - */ - dfpSettings: Schema$DfpSettings; - /** - * Whether this site accepts in-stream video ads. - */ - instreamVideoPlacementAccepted: boolean; - /** - * Whether this site accepts interstitial ads. - */ - interstitialPlacementAccepted: boolean; - /** - * Whether this directory site has disabled Nielsen OCR reach ratings. - */ - nielsenOcrOptOut: boolean; - /** - * Whether this directory site has disabled generation of Verification ins - * tags. - */ - verificationTagOptOut: boolean; - /** - * Whether this directory site has disabled active view for in-stream video - * creatives. This is a read-only field. - */ - videoActiveViewOptOut: boolean; -} -/** - * Directory Site List Response - */ -export interface Schema$DirectorySitesListResponse { - /** - * Directory site collection. - */ - directorySites: Schema$DirectorySite[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#directorySitesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a dynamic targeting key. Dynamic targeting keys are - * unique, user-friendly labels, created at the advertiser level in DCM, that - * can be assigned to ads, creatives, and placements and used for targeting with - * DoubleClick Studio dynamic creatives. Use these labels instead of numeric DCM - * IDs (such as placement IDs) to save time and avoid errors in your dynamic - * feeds. - */ -export interface Schema$DynamicTargetingKey { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#dynamicTargetingKey". - */ - kind: string; - /** - * Name of this dynamic targeting key. This is a required field. Must be less - * than 256 characters long and cannot contain commas. All characters are - * converted to lowercase. - */ - name: string; - /** - * ID of the object of this dynamic targeting key. This is a required field. - */ - objectId: string; - /** - * Type of the object of this dynamic targeting key. This is a required field. - */ - objectType: string; -} -/** - * Dynamic Targeting Key List Response - */ -export interface Schema$DynamicTargetingKeysListResponse { - /** - * Dynamic targeting key collection. - */ - dynamicTargetingKeys: Schema$DynamicTargetingKey[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#dynamicTargetingKeysListResponse". - */ - kind: string; -} -/** - * A description of how user IDs are encrypted. - */ -export interface Schema$EncryptionInfo { - /** - * The encryption entity ID. This should match the encryption configuration - * for ad serving or Data Transfer. - */ - encryptionEntityId: string; - /** - * The encryption entity type. This should match the encryption configuration - * for ad serving or Data Transfer. - */ - encryptionEntityType: string; - /** - * Describes whether the encrypted cookie was received from ad serving (the %m - * macro) or from Data Transfer. - */ - encryptionSource: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#encryptionInfo". - */ - kind: string; -} -/** - * Contains properties of an event tag. - */ -export interface Schema$EventTag { - /** - * Account ID of this event tag. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Advertiser ID of this event tag. This field or the campaignId field is - * required on insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Campaign ID of this event tag. This field or the advertiserId field is - * required on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Whether this event tag should be automatically enabled for all of the - * advertiser's campaigns and ads. - */ - enabledByDefault: boolean; - /** - * Whether to remove this event tag from ads that are trafficked through - * DoubleClick Bid Manager to Ad Exchange. This may be useful if the event tag - * uses a pixel that is unapproved for Ad Exchange bids on one or more - * networks, such as the Google Display Network. - */ - excludeFromAdxRequests: boolean; - /** - * ID of this event tag. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#eventTag". - */ - kind: string; - /** - * Name of this event tag. This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Site filter type for this event tag. If no type is specified then the event - * tag will be applied to all sites. - */ - siteFilterType: string; - /** - * Filter list of site IDs associated with this event tag. The siteFilterType - * determines whether this is a whitelist or blacklist filter. - */ - siteIds: string[]; - /** - * Whether this tag is SSL-compliant or not. This is a read-only field. - */ - sslCompliant: boolean; - /** - * Status of this event tag. Must be ENABLED for this event tag to fire. This - * is a required field. - */ - status: string; - /** - * Subaccount ID of this event tag. This is a read-only field that can be left - * blank. - */ - subaccountId: string; - /** - * Event tag type. Can be used to specify whether to use a third-party pixel, - * a third-party JavaScript URL, or a third-party click-through URL for either - * impression or click tracking. This is a required field. - */ - type: string; - /** - * Payload URL for this event tag. The URL on a click-through event tag should - * have a landing page URL appended to the end of it. This field is required - * on insertion. - */ - url: string; - /** - * Number of times the landing page URL should be URL-escaped before being - * appended to the click-through event tag URL. Only applies to click-through - * event tags as specified by the event tag type. - */ - urlEscapeLevels: number; -} -/** - * Event tag override information. - */ -export interface Schema$EventTagOverride { - /** - * Whether this override is enabled. - */ - enabled: boolean; - /** - * ID of this event tag override. This is a read-only, auto-generated field. - */ - id: string; -} -/** - * Event Tag List Response - */ -export interface Schema$EventTagsListResponse { - /** - * Event tag collection. - */ - eventTags: Schema$EventTag[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#eventTagsListResponse". - */ - kind: string; -} -/** - * Represents a File resource. A file contains the metadata for a report run. It - * shows the status of the run and holds the URLs to the generated report data - * if the run is finished and the status is "REPORT_AVAILABLE". - */ -export interface Schema$File { - /** - * The date range for which the file has report data. The date range will - * always be the absolute date range for which the report is run. - */ - dateRange: Schema$DateRange; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The filename of the file. - */ - fileName: string; - /** - * The output format of the report. Only available once the file is available. - */ - format: string; - /** - * The unique ID of this report file. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#file. - */ - kind: string; - /** - * The timestamp in milliseconds since epoch when this file was last modified. - */ - lastModifiedTime: string; - /** - * The ID of the report this file was generated from. - */ - reportId: string; - /** - * The status of the report file. - */ - status: string; - /** - * The URLs where the completed report file can be downloaded. - */ - urls: any; -} -/** - * Represents the list of File resources. - */ -export interface Schema$FileList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The files returned in this response. - */ - items: Schema$File[]; - /** - * The kind of list this is, in this case dfareporting#fileList. - */ - kind: string; - /** - * Continuation token used to page through files. To retrieve the next page of - * results, set the next request's "pageToken" to the value of - * this field. The page token is only valid for a limited amount of time and - * should not be persisted. - */ - nextPageToken: string; -} -/** - * Flight - */ -export interface Schema$Flight { - /** - * Inventory item flight end date. - */ - endDate: string; - /** - * Rate or cost of this flight. - */ - rateOrCost: string; - /** - * Inventory item flight start date. - */ - startDate: string; - /** - * Units of this flight. - */ - units: string; -} -/** - * Floodlight Activity GenerateTag Response - */ -export interface Schema$FloodlightActivitiesGenerateTagResponse { - /** - * Generated tag for this Floodlight activity. For global site tags, this is - * the event snippet. - */ - floodlightActivityTag: string; - /** - * The global snippet section of a global site tag. The global site tag sets - * new cookies on your domain, which will store a unique identifier for a user - * or the ad click that brought the user to your site. Learn more. - */ - globalSiteTagGlobalSnippet: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivitiesGenerateTagResponse". - */ - kind: string; -} -/** - * Floodlight Activity List Response - */ -export interface Schema$FloodlightActivitiesListResponse { - /** - * Floodlight activity collection. - */ - floodlightActivities: Schema$FloodlightActivity[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivitiesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Contains properties of a Floodlight activity. - */ -export interface Schema$FloodlightActivity { - /** - * Account ID of this floodlight activity. This is a read-only field that can - * be left blank. - */ - accountId: string; - /** - * Advertiser ID of this floodlight activity. If this field is left blank, the - * value will be copied over either from the activity group's advertiser - * or the existing activity's advertiser. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Code type used for cache busting in the generated tag. Applicable only when - * floodlightActivityGroupType is COUNTER and countingMethod is - * STANDARD_COUNTING or UNIQUE_COUNTING. - */ - cacheBustingType: string; - /** - * Counting method for conversions for this floodlight activity. This is a - * required field. - */ - countingMethod: string; - /** - * Dynamic floodlight tags. - */ - defaultTags: Schema$FloodlightActivityDynamicTag[]; - /** - * URL where this tag will be deployed. If specified, must be less than 256 - * characters long. - */ - expectedUrl: string; - /** - * Floodlight activity group ID of this floodlight activity. This is a - * required field. - */ - floodlightActivityGroupId: string; - /** - * Name of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupName: string; - /** - * Tag string of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupTagString: string; - /** - * Type of the associated floodlight activity group. This is a read-only - * field. - */ - floodlightActivityGroupType: string; - /** - * Floodlight configuration ID of this floodlight activity. If this field is - * left blank, the value will be copied over either from the activity - * group's floodlight configuration or from the existing activity's - * floodlight configuration. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * The type of Floodlight tag this activity will generate. This is a required - * field. - */ - floodlightTagType: string; - /** - * Whether this activity is archived. - */ - hidden: boolean; - /** - * ID of this floodlight activity. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight activity. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivity". - */ - kind: string; - /** - * Name of this floodlight activity. This is a required field. Must be less - * than 129 characters long and cannot contain quotes. - */ - name: string; - /** - * General notes or implementation instructions for the tag. - */ - notes: string; - /** - * Publisher dynamic floodlight tags. - */ - publisherTags: Schema$FloodlightActivityPublisherDynamicTag[]; - /** - * Whether this tag should use SSL. - */ - secure: boolean; - /** - * Whether the floodlight activity is SSL-compliant. This is a read-only - * field, its value detected by the system from the floodlight tags. - */ - sslCompliant: boolean; - /** - * Whether this floodlight activity must be SSL-compliant. - */ - sslRequired: boolean; - /** - * Subaccount ID of this floodlight activity. This is a read-only field that - * can be left blank. - */ - subaccountId: string; - /** - * Tag format type for the floodlight activity. If left blank, the tag format - * will default to HTML. - */ - tagFormat: string; - /** - * Value of the cat= parameter in the floodlight tag, which the ad servers use - * to identify the activity. This is optional: if empty, a new tag string will - * be generated for you. This string must be 1 to 8 characters long, with - * valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must also - * be unique among activities of the same activity group. This field is - * read-only after insertion. - */ - tagString: string; - /** - * List of the user-defined variables used by this conversion tag. These map - * to the "u[1-100]=" in the tags. Each of these can have a user - * defined type. Acceptable values are U1 to U100, inclusive. - */ - userDefinedVariableTypes: string[]; -} -/** - * Dynamic Tag - */ -export interface Schema$FloodlightActivityDynamicTag { - /** - * ID of this dynamic tag. This is a read-only, auto-generated field. - */ - id: string; - /** - * Name of this tag. - */ - name: string; - /** - * Tag code. - */ - tag: string; -} -/** - * Contains properties of a Floodlight activity group. - */ -export interface Schema$FloodlightActivityGroup { - /** - * Account ID of this floodlight activity group. This is a read-only field - * that can be left blank. - */ - accountId: string; - /** - * Advertiser ID of this floodlight activity group. If this field is left - * blank, the value will be copied over either from the floodlight - * configuration's advertiser or from the existing activity group's - * advertiser. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Floodlight configuration ID of this floodlight activity group. This is a - * required field. - */ - floodlightConfigurationId: string; - /** - * Dimension value for the ID of the floodlight configuration. This is a - * read-only, auto-generated field. - */ - floodlightConfigurationIdDimensionValue: Schema$DimensionValue; - /** - * ID of this floodlight activity group. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight activity group. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivityGroup". - */ - kind: string; - /** - * Name of this floodlight activity group. This is a required field. Must be - * less than 65 characters long and cannot contain quotes. - */ - name: string; - /** - * Subaccount ID of this floodlight activity group. This is a read-only field - * that can be left blank. - */ - subaccountId: string; - /** - * Value of the type= parameter in the floodlight tag, which the ad servers - * use to identify the activity group that the activity belongs to. This is - * optional: if empty, a new tag string will be generated for you. This string - * must be 1 to 8 characters long, with valid characters being - * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among activity - * groups of the same floodlight configuration. This field is read-only after - * insertion. - */ - tagString: string; - /** - * Type of the floodlight activity group. This is a required field that is - * read-only after insertion. - */ - type: string; -} -/** - * Floodlight Activity Group List Response - */ -export interface Schema$FloodlightActivityGroupsListResponse { - /** - * Floodlight activity group collection. - */ - floodlightActivityGroups: Schema$FloodlightActivityGroup[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightActivityGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Publisher Dynamic Tag - */ -export interface Schema$FloodlightActivityPublisherDynamicTag { - /** - * Whether this tag is applicable only for click-throughs. - */ - clickThrough: boolean; - /** - * Directory site ID of this dynamic tag. This is a write-only field that can - * be used as an alternative to the siteId field. When this resource is - * retrieved, only the siteId field will be populated. - */ - directorySiteId: string; - /** - * Dynamic floodlight tag. - */ - dynamicTag: Schema$FloodlightActivityDynamicTag; - /** - * Site ID of this dynamic tag. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Whether this tag is applicable only for view-throughs. - */ - viewThrough: boolean; -} -/** - * Contains properties of a Floodlight configuration. - */ -export interface Schema$FloodlightConfiguration { - /** - * Account ID of this floodlight configuration. This is a read-only field that - * can be left blank. - */ - accountId: string; - /** - * Advertiser ID of the parent advertiser of this floodlight configuration. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether advertiser data is shared with Google Analytics. - */ - analyticsDataSharingEnabled: boolean; - /** - * Whether the exposure-to-conversion report is enabled. This report shows - * detailed pathway information on up to 10 of the most recent ad exposures - * seen by a user before converting. - */ - exposureToConversionEnabled: boolean; - /** - * Day that will be counted as the first day of the week in reports. This is a - * required field. - */ - firstDayOfWeek: string; - /** - * ID of this floodlight configuration. This is a read-only, auto-generated - * field. - */ - id: string; - /** - * Dimension value for the ID of this floodlight configuration. This is a - * read-only, auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Whether in-app attribution tracking is enabled. - */ - inAppAttributionTrackingEnabled: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightConfiguration". - */ - kind: string; - /** - * Lookback window settings for this floodlight configuration. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Types of attribution options for natural search conversions. - */ - naturalSearchConversionAttributionOption: string; - /** - * Settings for DCM Omniture integration. - */ - omnitureSettings: Schema$OmnitureSettings; - /** - * Subaccount ID of this floodlight configuration. This is a read-only field - * that can be left blank. - */ - subaccountId: string; - /** - * Configuration settings for dynamic and image floodlight tags. - */ - tagSettings: Schema$TagSettings; - /** - * List of third-party authentication tokens enabled for this configuration. - */ - thirdPartyAuthenticationTokens: Schema$ThirdPartyAuthenticationToken[]; - /** - * List of user defined variables enabled for this configuration. - */ - userDefinedVariableConfigurations: Schema$UserDefinedVariableConfiguration[]; -} -/** - * Floodlight Configuration List Response - */ -export interface Schema$FloodlightConfigurationsListResponse { - /** - * Floodlight configuration collection. - */ - floodlightConfigurations: Schema$FloodlightConfiguration[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#floodlightConfigurationsListResponse". - */ - kind: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "FlOODLIGHT". - */ -export interface Schema$FloodlightReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#floodlightReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; -} -/** - * Frequency Cap. - */ -export interface Schema$FrequencyCap { - /** - * Duration of time, in seconds, for this frequency cap. The maximum duration - * is 90 days. Acceptable values are 1 to 7776000, inclusive. - */ - duration: string; - /** - * Number of times an individual user can be served the ad within the - * specified duration. Acceptable values are 1 to 15, inclusive. - */ - impressions: string; -} -/** - * FsCommand. - */ -export interface Schema$FsCommand { - /** - * Distance from the left of the browser.Applicable when positionOption is - * DISTANCE_FROM_TOP_LEFT_CORNER. - */ - left: number; - /** - * Position in the browser where the window will open. - */ - positionOption: string; - /** - * Distance from the top of the browser. Applicable when positionOption is - * DISTANCE_FROM_TOP_LEFT_CORNER. - */ - top: number; - /** - * Height of the window. - */ - windowHeight: number; - /** - * Width of the window. - */ - windowWidth: number; -} -/** - * Geographical Targeting. - */ -export interface Schema$GeoTargeting { - /** - * Cities to be targeted. For each city only dartId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a city, do not target or exclude the country of the city, and do - * not target the metro or region of the city. - */ - cities: Schema$City[]; - /** - * Countries to be targeted or excluded from targeting, depending on the - * setting of the excludeCountries field. For each country only dartId is - * required. The other fields are populated automatically when the ad is - * inserted or updated. If targeting or excluding a country, do not target - * regions, cities, metros, or postal codes in the same country. - */ - countries: Schema$Country[]; - /** - * Whether or not to exclude the countries in the countries field from - * targeting. If false, the countries field refers to countries which will be - * targeted by the ad. - */ - excludeCountries: boolean; - /** - * Metros to be targeted. For each metro only dmaId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a metro, do not target or exclude the country of the metro. - */ - metros: Schema$Metro[]; - /** - * Postal codes to be targeted. For each postal code only id is required. The - * other fields are populated automatically when the ad is inserted or - * updated. If targeting a postal code, do not target or exclude the country - * of the postal code. - */ - postalCodes: Schema$PostalCode[]; - /** - * Regions to be targeted. For each region only dartId is required. The other - * fields are populated automatically when the ad is inserted or updated. If - * targeting a region, do not target or exclude the country of the region. - */ - regions: Schema$Region[]; -} -/** - * Represents a buy from the DoubleClick Planning inventory store. - */ -export interface Schema$InventoryItem { - /** - * Account ID of this inventory item. - */ - accountId: string; - /** - * Ad slots of this inventory item. If this inventory item represents a - * standalone placement, there will be exactly one ad slot. If this inventory - * item represents a placement group, there will be more than one ad slot, - * each representing one child placement in that placement group. - */ - adSlots: Schema$AdSlot[]; - /** - * Advertiser ID of this inventory item. - */ - advertiserId: string; - /** - * Content category ID of this inventory item. - */ - contentCategoryId: string; - /** - * Estimated click-through rate of this inventory item. - */ - estimatedClickThroughRate: string; - /** - * Estimated conversion rate of this inventory item. - */ - estimatedConversionRate: string; - /** - * ID of this inventory item. - */ - id: string; - /** - * Whether this inventory item is in plan. - */ - inPlan: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#inventoryItem". - */ - kind: string; - /** - * Information about the most recent modification of this inventory item. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this inventory item. For standalone inventory items, this is the - * same name as that of its only ad slot. For group inventory items, this can - * differ from the name of any of its ad slots. - */ - name: string; - /** - * Negotiation channel ID of this inventory item. - */ - negotiationChannelId: string; - /** - * Order ID of this inventory item. - */ - orderId: string; - /** - * Placement strategy ID of this inventory item. - */ - placementStrategyId: string; - /** - * Pricing of this inventory item. - */ - pricing: Schema$Pricing; - /** - * Project ID of this inventory item. - */ - projectId: string; - /** - * RFP ID of this inventory item. - */ - rfpId: string; - /** - * ID of the site this inventory item is associated with. - */ - siteId: string; - /** - * Subaccount ID of this inventory item. - */ - subaccountId: string; - /** - * Type of inventory item. - */ - type: string; -} -/** - * Inventory item List Response - */ -export interface Schema$InventoryItemsListResponse { - /** - * Inventory item collection - */ - inventoryItems: Schema$InventoryItem[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#inventoryItemsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; -} -/** - * Key Value Targeting Expression. - */ -export interface Schema$KeyValueTargetingExpression { - /** - * Keyword expression being targeted by the ad. - */ - expression: string; -} -/** - * Contains information about where a user's browser is taken after the user - * clicks an ad. - */ -export interface Schema$LandingPage { - /** - * Advertiser ID of this landing page. This is a required field. - */ - advertiserId: string; - /** - * Whether this landing page has been archived. - */ - archived: boolean; - /** - * ID of this landing page. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#landingPage". - */ - kind: string; - /** - * Name of this landing page. This is a required field. It must be less than - * 256 characters long. - */ - name: string; - /** - * URL of this landing page. This is a required field. - */ - url: string; -} -/** - * Contains information about a language that can be targeted by ads. - */ -export interface Schema$Language { - /** - * Language ID of this language. This is the ID used for targeting and - * generating reports. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#language". - */ - kind: string; - /** - * Format of language code is an ISO 639 two-letter language code optionally - * followed by an underscore followed by an ISO 3166 code. Examples are - * "en" for English or "zh_CN" for Simplified Chinese. - */ - languageCode: string; - /** - * Name of this language. - */ - name: string; -} -/** - * Language List Response - */ -export interface Schema$LanguagesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#languagesListResponse". - */ - kind: string; - /** - * Language collection. - */ - languages: Schema$Language[]; -} -/** - * Language Targeting. - */ -export interface Schema$LanguageTargeting { - /** - * Languages that this ad targets. For each language only languageId is - * required. The other fields are populated automatically when the ad is - * inserted or updated. - */ - languages: Schema$Language[]; -} -/** - * Modification timestamp. - */ -export interface Schema$LastModifiedInfo { - /** - * Timestamp of the last change in milliseconds since epoch. - */ - time: string; -} -/** - * A group clause made up of list population terms representing constraints - * joined by ORs. - */ -export interface Schema$ListPopulationClause { - /** - * Terms of this list population clause. Each clause is made up of list - * population terms representing constraints and are joined by ORs. - */ - terms: Schema$ListPopulationTerm[]; -} -/** - * Remarketing List Population Rule. - */ -export interface Schema$ListPopulationRule { - /** - * Floodlight activity ID associated with this rule. This field can be left - * blank. - */ - floodlightActivityId: string; - /** - * Name of floodlight activity associated with this rule. This is a read-only, - * auto-generated field. - */ - floodlightActivityName: string; - /** - * Clauses that make up this list population rule. Clauses are joined by ANDs, - * and the clauses themselves are made up of list population terms which are - * joined by ORs. - */ - listPopulationClauses: Schema$ListPopulationClause[]; -} -/** - * Remarketing List Population Rule Term. - */ -export interface Schema$ListPopulationTerm { - /** - * Will be true if the term should check if the user is in the list and false - * if the term should check if the user is not in the list. This field is only - * relevant when type is set to LIST_MEMBERSHIP_TERM. False by default. - */ - contains: boolean; - /** - * Whether to negate the comparison result of this term during rule - * evaluation. This field is only relevant when type is left unset or set to - * CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - negation: boolean; - /** - * Comparison operator of this term. This field is only relevant when type is - * left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - operator: string; - /** - * ID of the list in question. This field is only relevant when type is set to - * LIST_MEMBERSHIP_TERM. - */ - remarketingListId: string; - /** - * List population term type determines the applicable fields in this object. - * If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, - * variableFriendlyName, operator, value, and negation are applicable. If set - * to LIST_MEMBERSHIP_TERM then remarketingListId and contains are applicable. - * If set to REFERRER_TERM then operator, value, and negation are applicable. - */ - type: string; - /** - * Literal to compare the variable to. This field is only relevant when type - * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. - */ - value: string; - /** - * Friendly name of this term's variable. This is a read-only, - * auto-generated field. This field is only relevant when type is left unset - * or set to CUSTOM_VARIABLE_TERM. - */ - variableFriendlyName: string; - /** - * Name of the variable (U1, U2, etc.) being compared in this term. This field - * is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or - * REFERRER_TERM. - */ - variableName: string; -} -/** - * Remarketing List Targeting Expression. - */ -export interface Schema$ListTargetingExpression { - /** - * Expression describing which lists are being targeted by the ad. - */ - expression: string; -} -/** - * Lookback configuration settings. - */ -export interface Schema$LookbackConfiguration { - /** - * Lookback window, in days, from the last time a given user clicked on one of - * your ads. If you enter 0, clicks will not be considered as triggering - * events for floodlight tracking. If you leave this field blank, the default - * value for your account will be used. Acceptable values are 0 to 90, - * inclusive. - */ - clickDuration: number; - /** - * Lookback window, in days, from the last time a given user viewed one of - * your ads. If you enter 0, impressions will not be considered as triggering - * events for floodlight tracking. If you leave this field blank, the default - * value for your account will be used. Acceptable values are 0 to 90, - * inclusive. - */ - postImpressionActivitiesDuration: number; -} -/** - * Represents a metric. - */ -export interface Schema$Metric { - /** - * The kind of resource this is, in this case dfareporting#metric. - */ - kind: string; - /** - * The metric name, e.g. dfa:impressions - */ - name: string; -} -/** - * Contains information about a metro region that can be targeted by ads. - */ -export interface Schema$Metro { - /** - * Country code of the country to which this metro region belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this metro region belongs. - */ - countryDartId: string; - /** - * DART ID of this metro region. - */ - dartId: string; - /** - * DMA ID of this metro region. This is the ID used for targeting and - * generating reports, and is equivalent to metro_code. - */ - dmaId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#metro". - */ - kind: string; - /** - * Metro code of this metro region. This is equivalent to dma_id. - */ - metroCode: string; - /** - * Name of this metro region. - */ - name: string; -} -/** - * Metro List Response - */ -export interface Schema$MetrosListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#metrosListResponse". - */ - kind: string; - /** - * Metro collection. - */ - metros: Schema$Metro[]; -} -/** - * Contains information about a mobile carrier that can be targeted by ads. - */ -export interface Schema$MobileCarrier { - /** - * Country code of the country to which this mobile carrier belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this mobile carrier belongs. - */ - countryDartId: string; - /** - * ID of this mobile carrier. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#mobileCarrier". - */ - kind: string; - /** - * Name of this mobile carrier. - */ - name: string; -} -/** - * Mobile Carrier List Response - */ -export interface Schema$MobileCarriersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#mobileCarriersListResponse". - */ - kind: string; - /** - * Mobile carrier collection. - */ - mobileCarriers: Schema$MobileCarrier[]; -} -/** - * Object Filter. - */ -export interface Schema$ObjectFilter { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#objectFilter". - */ - kind: string; - /** - * Applicable when status is ASSIGNED. The user has access to objects with - * these object IDs. - */ - objectIds: string[]; - /** - * Status of the filter. NONE means the user has access to none of the - * objects. ALL means the user has access to all objects. ASSIGNED means the - * user has access to the objects with IDs in the objectIds list. - */ - status: string; -} -/** - * Offset Position. - */ -export interface Schema$OffsetPosition { - /** - * Offset distance from left side of an asset or a window. - */ - left: number; - /** - * Offset distance from top side of an asset or a window. - */ - top: number; -} -/** - * Omniture Integration Settings. - */ -export interface Schema$OmnitureSettings { - /** - * Whether placement cost data will be sent to Omniture. This property can be - * enabled only if omnitureIntegrationEnabled is true. - */ - omnitureCostDataEnabled: boolean; - /** - * Whether Omniture integration is enabled. This property can be enabled only - * when the "Advanced Ad Serving" account setting is enabled. - */ - omnitureIntegrationEnabled: boolean; -} -/** - * Contains information about an operating system that can be targeted by ads. - */ -export interface Schema$OperatingSystem { - /** - * DART ID of this operating system. This is the ID used for targeting. - */ - dartId: string; - /** - * Whether this operating system is for desktop. - */ - desktop: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystem". - */ - kind: string; - /** - * Whether this operating system is for mobile. - */ - mobile: boolean; - /** - * Name of this operating system. - */ - name: string; -} -/** - * Operating System List Response - */ -export interface Schema$OperatingSystemsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemsListResponse". - */ - kind: string; - /** - * Operating system collection. - */ - operatingSystems: Schema$OperatingSystem[]; -} -/** - * Contains information about a particular version of an operating system that - * can be targeted by ads. - */ -export interface Schema$OperatingSystemVersion { - /** - * ID of this operating system version. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemVersion". - */ - kind: string; - /** - * Major version (leftmost number) of this operating system version. - */ - majorVersion: string; - /** - * Minor version (number after the first dot) of this operating system - * version. - */ - minorVersion: string; - /** - * Name of this operating system version. - */ - name: string; - /** - * Operating system of this operating system version. - */ - operatingSystem: Schema$OperatingSystem; -} -/** - * Operating System Version List Response - */ -export interface Schema$OperatingSystemVersionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#operatingSystemVersionsListResponse". - */ - kind: string; - /** - * Operating system version collection. - */ - operatingSystemVersions: Schema$OperatingSystemVersion[]; -} -/** - * Creative optimization activity. - */ -export interface Schema$OptimizationActivity { - /** - * Floodlight activity ID of this optimization activity. This is a required - * field. - */ - floodlightActivityId: string; - /** - * Dimension value for the ID of the floodlight activity. This is a read-only, - * auto-generated field. - */ - floodlightActivityIdDimensionValue: Schema$DimensionValue; - /** - * Weight associated with this optimization. The weight assigned will be - * understood in proportion to the weights assigned to the other optimization - * activities. Value must be greater than or equal to 1. - */ - weight: number; -} -/** - * Describes properties of a DoubleClick Planning order. - */ -export interface Schema$Order { - /** - * Account ID of this order. - */ - accountId: string; - /** - * Advertiser ID of this order. - */ - advertiserId: string; - /** - * IDs for users that have to approve documents created for this order. - */ - approverUserProfileIds: string[]; - /** - * Buyer invoice ID associated with this order. - */ - buyerInvoiceId: string; - /** - * Name of the buyer organization. - */ - buyerOrganizationName: string; - /** - * Comments in this order. - */ - comments: string; - /** - * Contacts for this order. - */ - contacts: Schema$OrderContact[]; - /** - * ID of this order. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#order". - */ - kind: string; - /** - * Information about the most recent modification of this order. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this order. - */ - name: string; - /** - * Notes of this order. - */ - notes: string; - /** - * ID of the terms and conditions template used in this order. - */ - planningTermId: string; - /** - * Project ID of this order. - */ - projectId: string; - /** - * Seller order ID associated with this order. - */ - sellerOrderId: string; - /** - * Name of the seller organization. - */ - sellerOrganizationName: string; - /** - * Site IDs this order is associated with. - */ - siteId: string[]; - /** - * Free-form site names this order is associated with. - */ - siteNames: string[]; - /** - * Subaccount ID of this order. - */ - subaccountId: string; - /** - * Terms and conditions of this order. - */ - termsAndConditions: string; -} -/** - * Contact of an order. - */ -export interface Schema$OrderContact { - /** - * Free-form information about this contact. It could be any information - * related to this contact in addition to type, title, name, and signature - * user profile ID. - */ - contactInfo: string; - /** - * Name of this contact. - */ - contactName: string; - /** - * Title of this contact. - */ - contactTitle: string; - /** - * Type of this contact. - */ - contactType: string; - /** - * ID of the user profile containing the signature that will be embedded into - * order documents. - */ - signatureUserProfileId: string; -} -/** - * Contains properties of a DoubleClick Planning order document. - */ -export interface Schema$OrderDocument { - /** - * Account ID of this order document. - */ - accountId: string; - /** - * Advertiser ID of this order document. - */ - advertiserId: string; - /** - * The amended order document ID of this order document. An order document can - * be created by optionally amending another order document so that the change - * history can be preserved. - */ - amendedOrderDocumentId: string; - /** - * IDs of users who have approved this order document. - */ - approvedByUserProfileIds: string[]; - /** - * Whether this order document is cancelled. - */ - cancelled: boolean; - /** - * Information about the creation of this order document. - */ - createdInfo: Schema$LastModifiedInfo; - /** - * Effective date of this order document. - */ - effectiveDate: string; - /** - * ID of this order document. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#orderDocument". - */ - kind: string; - /** - * List of email addresses that received the last sent document. - */ - lastSentRecipients: string[]; - /** - * Timestamp of the last email sent with this order document. - */ - lastSentTime: string; - /** - * ID of the order from which this order document is created. - */ - orderId: string; - /** - * Project ID of this order document. - */ - projectId: string; - /** - * Whether this order document has been signed. - */ - signed: boolean; - /** - * Subaccount ID of this order document. - */ - subaccountId: string; - /** - * Title of this order document. - */ - title: string; - /** - * Type of this order document - */ - type: string; -} -/** - * Order document List Response - */ -export interface Schema$OrderDocumentsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#orderDocumentsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Order document collection - */ - orderDocuments: Schema$OrderDocument[]; -} -/** - * Order List Response - */ -export interface Schema$OrdersListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#ordersListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Order collection. - */ - orders: Schema$Order[]; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "PATH_TO_CONVERSION". - */ -export interface Schema$PathToConversionReportCompatibleFields { - /** - * Conversion dimensions which are compatible to be selected in the - * "conversionDimensions" section of the report. - */ - conversionDimensions: Schema$Dimension[]; - /** - * Custom floodlight variables which are compatible to be selected in the - * "customFloodlightVariables" section of the report. - */ - customFloodlightVariables: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#pathToConversionReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Per-interaction dimensions which are compatible to be selected in the - * "perInteractionDimensions" section of the report. - */ - perInteractionDimensions: Schema$Dimension[]; -} -/** - * Contains properties of a placement. - */ -export interface Schema$Placement { - /** - * Account ID of this placement. This field can be left blank. - */ - accountId: string; - /** - * Whether this placement opts out of ad blocking. When true, ad blocking is - * disabled for this placement. When false, the campaign and site settings - * take effect. - */ - adBlockingOptOut: boolean; - /** - * Advertiser ID of this placement. This field can be left blank. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this placement is archived. - */ - archived: boolean; - /** - * Campaign ID of this placement. This field is a required field on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * Comments for this placement. - */ - comment: string; - /** - * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to - * rendering on desktop, on mobile devices or in mobile apps for regular or - * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer - * allowed for new placement insertions. Instead, use DISPLAY or - * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream - * video ads developed with the VAST standard. This field is required on - * insertion. - */ - compatibility: string; - /** - * ID of the content category assigned to this placement. - */ - contentCategoryId: string; - /** - * Information about the creation of this placement. This is a read-only - * field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Directory site ID of this placement. On insert, you must set either this - * field or the siteId field to specify the site associated with this - * placement. This is a required field that is read-only after insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * External ID for this placement. - */ - externalId: string; - /** - * ID of this placement. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this placement. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key name of this placement. This is a read-only, auto-generated field. - */ - keyName: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placement". - */ - kind: string; - /** - * Information about the most recent modification of this placement. This is a - * read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Lookback window settings for this placement. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Name of this placement.This is a required field and must be less than 256 - * characters long. - */ - name: string; - /** - * Whether payment was approved for this placement. This is a read-only field - * relevant only to publisher-paid placements. - */ - paymentApproved: boolean; - /** - * Payment source for this placement. This is a required field that is - * read-only after insertion. - */ - paymentSource: string; - /** - * ID of this placement's group, if applicable. - */ - placementGroupId: string; - /** - * Dimension value for the ID of the placement group. This is a read-only, - * auto-generated field. - */ - placementGroupIdDimensionValue: Schema$DimensionValue; - /** - * ID of the placement strategy assigned to this placement. - */ - placementStrategyId: string; - /** - * Pricing schedule of this placement. This field is required on insertion, - * specifically subfields startDate, endDate and pricingType. - */ - pricingSchedule: Schema$PricingSchedule; - /** - * Whether this placement is the primary placement of a roadblock (placement - * group). You cannot change this field from true to false. Setting this field - * to true will automatically set the primary field on the original primary - * placement of the roadblock to false, and it will automatically set the - * roadblock's primaryPlacementId field to the ID of this placement. - */ - primary: boolean; - /** - * Information about the last publisher update. This is a read-only field. - */ - publisherUpdateInfo: Schema$LastModifiedInfo; - /** - * Site ID associated with this placement. On insert, you must set either this - * field or the directorySiteId field to specify the site associated with this - * placement. This is a required field that is read-only after insertion. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Size associated with this placement. When inserting or updating a - * placement, only the size ID field is used. This field is required on - * insertion. - */ - size: Schema$Size; - /** - * Whether creatives assigned to this placement must be SSL-compliant. - */ - sslRequired: boolean; - /** - * Third-party placement status. - */ - status: string; - /** - * Subaccount ID of this placement. This field can be left blank. - */ - subaccountId: string; - /** - * Tag formats to generate for this placement. This field is required on - * insertion. Acceptable values are: - "PLACEMENT_TAG_STANDARD" - - * "PLACEMENT_TAG_IFRAME_JAVASCRIPT" - - * "PLACEMENT_TAG_IFRAME_ILAYER" - - * "PLACEMENT_TAG_INTERNAL_REDIRECT" - - * "PLACEMENT_TAG_JAVASCRIPT" - - * "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" - - * "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" - - * "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" - - * "PLACEMENT_TAG_CLICK_COMMANDS" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" - - * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" - - * "PLACEMENT_TAG_TRACKING" - - * "PLACEMENT_TAG_TRACKING_IFRAME" - - * "PLACEMENT_TAG_TRACKING_JAVASCRIPT" - */ - tagFormats: string[]; - /** - * Tag settings for this placement. - */ - tagSetting: Schema$TagSetting; - /** - * Whether Verification and ActiveView are disabled for in-stream video - * creatives for this placement. The same setting videoActiveViewOptOut exists - * on the site level -- the opt out occurs if either of these settings are - * true. These settings are distinct from - * DirectorySites.settings.activeViewOptOut or - * Sites.siteSettings.activeViewOptOut which only apply to display ads. - * However, Accounts.activeViewOptOut opts out both video traffic, as well as - * display ads, from Verification and ActiveView. - */ - videoActiveViewOptOut: boolean; - /** - * A collection of settings which affect video creatives served through this - * placement. Applicable to placements with IN_STREAM_VIDEO compatibility. - */ - videoSettings: Schema$VideoSettings; - /** - * VPAID adapter setting for this placement. Controls which VPAID format the - * measurement adapter will use for in-stream video creatives assigned to this - * placement. Note: Flash is no longer supported. This field now defaults to - * HTML5 when the following values are provided: FLASH, BOTH. - */ - vpaidAdapterChoice: string; -} -/** - * Placement Assignment. - */ -export interface Schema$PlacementAssignment { - /** - * Whether this placement assignment is active. When true, the placement will - * be included in the ad's rotation. - */ - active: boolean; - /** - * ID of the placement to be assigned. This is a required field. - */ - placementId: string; - /** - * Dimension value for the ID of the placement. This is a read-only, - * auto-generated field. - */ - placementIdDimensionValue: Schema$DimensionValue; - /** - * Whether the placement to be assigned requires SSL. This is a read-only - * field that is auto-generated when the ad is inserted or updated. - */ - sslRequired: boolean; -} -/** - * Contains properties of a package or roadblock. - */ -export interface Schema$PlacementGroup { - /** - * Account ID of this placement group. This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * Advertiser ID of this placement group. This is a required field on - * insertion. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Whether this placement group is archived. - */ - archived: boolean; - /** - * Campaign ID of this placement group. This field is required on insertion. - */ - campaignId: string; - /** - * Dimension value for the ID of the campaign. This is a read-only, - * auto-generated field. - */ - campaignIdDimensionValue: Schema$DimensionValue; - /** - * IDs of placements which are assigned to this placement group. This is a - * read-only, auto-generated field. - */ - childPlacementIds: string[]; - /** - * Comments for this placement group. - */ - comment: string; - /** - * ID of the content category assigned to this placement group. - */ - contentCategoryId: string; - /** - * Information about the creation of this placement group. This is a read-only - * field. - */ - createInfo: Schema$LastModifiedInfo; - /** - * Directory site ID associated with this placement group. On insert, you must - * set either this field or the site_id field to specify the site associated - * with this placement group. This is a required field that is read-only after - * insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * External ID for this placement. - */ - externalId: string; - /** - * ID of this placement group. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this placement group. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementGroup". - */ - kind: string; - /** - * Information about the most recent modification of this placement group. - * This is a read-only field. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this placement group. This is a required field and must be less - * than 256 characters long. - */ - name: string; - /** - * Type of this placement group. A package is a simple group of placements - * that acts as a single pricing point for a group of tags. A roadblock is a - * group of placements that not only acts as a single pricing point, but also - * assumes that all the tags in it will be served at the same time. A - * roadblock requires one of its assigned placements to be marked as primary - * for reporting. This field is required on insertion. - */ - placementGroupType: string; - /** - * ID of the placement strategy assigned to this placement group. - */ - placementStrategyId: string; - /** - * Pricing schedule of this placement group. This field is required on - * insertion. - */ - pricingSchedule: Schema$PricingSchedule; - /** - * ID of the primary placement, used to calculate the media cost of a - * roadblock (placement group). Modifying this field will automatically modify - * the primary field on all affected roadblock child placements. - */ - primaryPlacementId: string; - /** - * Dimension value for the ID of the primary placement. This is a read-only, - * auto-generated field. - */ - primaryPlacementIdDimensionValue: Schema$DimensionValue; - /** - * Site ID associated with this placement group. On insert, you must set - * either this field or the directorySiteId field to specify the site - * associated with this placement group. This is a required field that is - * read-only after insertion. - */ - siteId: string; - /** - * Dimension value for the ID of the site. This is a read-only, auto-generated - * field. - */ - siteIdDimensionValue: Schema$DimensionValue; - /** - * Subaccount ID of this placement group. This is a read-only field that can - * be left blank. - */ - subaccountId: string; -} -/** - * Placement Group List Response - */ -export interface Schema$PlacementGroupsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementGroupsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement group collection. - */ - placementGroups: Schema$PlacementGroup[]; -} -/** - * Placement GenerateTags Response - */ -export interface Schema$PlacementsGenerateTagsResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementsGenerateTagsResponse". - */ - kind: string; - /** - * Set of generated tags for the specified placements. - */ - placementTags: Schema$PlacementTag[]; -} -/** - * Placement List Response - */ -export interface Schema$PlacementsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement collection. - */ - placements: Schema$Placement[]; -} -/** - * Placement Strategy List Response - */ -export interface Schema$PlacementStrategiesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementStrategiesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Placement strategy collection. - */ - placementStrategies: Schema$PlacementStrategy[]; -} -/** - * Contains properties of a placement strategy. - */ -export interface Schema$PlacementStrategy { - /** - * Account ID of this placement strategy.This is a read-only field that can be - * left blank. - */ - accountId: string; - /** - * ID of this placement strategy. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#placementStrategy". - */ - kind: string; - /** - * Name of this placement strategy. This is a required field. It must be less - * than 256 characters long and unique among placement strategies of the same - * account. - */ - name: string; -} -/** - * Placement Tag - */ -export interface Schema$PlacementTag { - /** - * Placement ID - */ - placementId: string; - /** - * Tags generated for this placement. - */ - tagDatas: Schema$TagData[]; -} -/** - * Contains information about a platform type that can be targeted by ads. - */ -export interface Schema$PlatformType { - /** - * ID of this platform type. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#platformType". - */ - kind: string; - /** - * Name of this platform type. - */ - name: string; -} -/** - * Platform Type List Response - */ -export interface Schema$PlatformTypesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#platformTypesListResponse". - */ - kind: string; - /** - * Platform type collection. - */ - platformTypes: Schema$PlatformType[]; -} -/** - * Popup Window Properties. - */ -export interface Schema$PopupWindowProperties { - /** - * Popup dimension for a creative. This is a read-only field. Applicable to - * the following creative types: all RICH_MEDIA and all VPAID - */ - dimension: Schema$Size; - /** - * Upper-left corner coordinates of the popup window. Applicable if - * positionType is COORDINATES. - */ - offset: Schema$OffsetPosition; - /** - * Popup window position either centered or at specific coordinate. - */ - positionType: string; - /** - * Whether to display the browser address bar. - */ - showAddressBar: boolean; - /** - * Whether to display the browser menu bar. - */ - showMenuBar: boolean; - /** - * Whether to display the browser scroll bar. - */ - showScrollBar: boolean; - /** - * Whether to display the browser status bar. - */ - showStatusBar: boolean; - /** - * Whether to display the browser tool bar. - */ - showToolBar: boolean; - /** - * Title of popup window. - */ - title: string; -} -/** - * Contains information about a postal code that can be targeted by ads. - */ -export interface Schema$PostalCode { - /** - * Postal code. This is equivalent to the id field. - */ - code: string; - /** - * Country code of the country to which this postal code belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this postal code belongs. - */ - countryDartId: string; - /** - * ID of this postal code. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#postalCode". - */ - kind: string; -} -/** - * Postal Code List Response - */ -export interface Schema$PostalCodesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#postalCodesListResponse". - */ - kind: string; - /** - * Postal code collection. - */ - postalCodes: Schema$PostalCode[]; -} -/** - * Pricing Information - */ -export interface Schema$Pricing { - /** - * Cap cost type of this inventory item. - */ - capCostType: string; - /** - * End date of this inventory item. - */ - endDate: string; - /** - * Flights of this inventory item. A flight (a.k.a. pricing period) represents - * the inventory item pricing information for a specific period of time. - */ - flights: Schema$Flight[]; - /** - * Group type of this inventory item if it represents a placement group. Is - * null otherwise. There are two type of placement groups: - * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory items - * that acts as a single pricing point for a group of tags. - * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items that - * not only acts as a single pricing point, but also assumes that all the tags - * in it will be served at the same time. A roadblock requires one of its - * assigned inventory items to be marked as primary. - */ - groupType: string; - /** - * Pricing type of this inventory item. - */ - pricingType: string; - /** - * Start date of this inventory item. - */ - startDate: string; -} -/** - * Pricing Schedule - */ -export interface Schema$PricingSchedule { - /** - * Placement cap cost option. - */ - capCostOption: string; - /** - * Whether cap costs are ignored by ad serving. - */ - disregardOverdelivery: boolean; - /** - * Placement end date. This date must be later than, or the same day as, the - * placement start date, but not later than the campaign end date. If, for - * example, you set 6/25/2015 as both the start and end dates, the effective - * placement date is just that day only, 6/25/2015. The hours, minutes, and - * seconds of the end date should not be set, as doing so will result in an - * error. This field is required on insertion. - */ - endDate: string; - /** - * Whether this placement is flighted. If true, pricing periods will be - * computed automatically. - */ - flighted: boolean; - /** - * Floodlight activity ID associated with this placement. This field should be - * set when placement pricing type is set to PRICING_TYPE_CPA. - */ - floodlightActivityId: string; - /** - * Pricing periods for this placement. - */ - pricingPeriods: Schema$PricingSchedulePricingPeriod[]; - /** - * Placement pricing type. This field is required on insertion. - */ - pricingType: string; - /** - * Placement start date. This date must be later than, or the same day as, the - * campaign start date. The hours, minutes, and seconds of the start date - * should not be set, as doing so will result in an error. This field is - * required on insertion. - */ - startDate: string; - /** - * Testing start date of this placement. The hours, minutes, and seconds of - * the start date should not be set, as doing so will result in an error. - */ - testingStartDate: string; -} -/** - * Pricing Period - */ -export interface Schema$PricingSchedulePricingPeriod { - /** - * Pricing period end date. This date must be later than, or the same day as, - * the pricing period start date, but not later than the placement end date. - * The period end date can be the same date as the period start date. If, for - * example, you set 6/25/2015 as both the start and end dates, the effective - * pricing period date is just that day only, 6/25/2015. The hours, minutes, - * and seconds of the end date should not be set, as doing so will result in - * an error. - */ - endDate: string; - /** - * Comments for this pricing period. - */ - pricingComment: string; - /** - * Rate or cost of this pricing period in nanos (i.e., multipled by - * 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. - */ - rateOrCostNanos: string; - /** - * Pricing period start date. This date must be later than, or the same day - * as, the placement start date. The hours, minutes, and seconds of the start - * date should not be set, as doing so will result in an error. - */ - startDate: string; - /** - * Units of this pricing period. Acceptable values are 0 to 10000000000, - * inclusive. - */ - units: string; -} -/** - * Contains properties of a DoubleClick Planning project. - */ -export interface Schema$Project { - /** - * Account ID of this project. - */ - accountId: string; - /** - * Advertiser ID of this project. - */ - advertiserId: string; - /** - * Audience age group of this project. - */ - audienceAgeGroup: string; - /** - * Audience gender of this project. - */ - audienceGender: string; - /** - * Budget of this project in the currency specified by the current account. - * The value stored in this field represents only the non-fractional amount. - * For example, for USD, the smallest value that can be represented by this - * field is 1 US dollar. - */ - budget: string; - /** - * Client billing code of this project. - */ - clientBillingCode: string; - /** - * Name of the project client. - */ - clientName: string; - /** - * End date of the project. - */ - endDate: string; - /** - * ID of this project. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#project". - */ - kind: string; - /** - * Information about the most recent modification of this project. - */ - lastModifiedInfo: Schema$LastModifiedInfo; - /** - * Name of this project. - */ - name: string; - /** - * Overview of this project. - */ - overview: string; - /** - * Start date of the project. - */ - startDate: string; - /** - * Subaccount ID of this project. - */ - subaccountId: string; - /** - * Number of clicks that the advertiser is targeting. - */ - targetClicks: string; - /** - * Number of conversions that the advertiser is targeting. - */ - targetConversions: string; - /** - * CPA that the advertiser is targeting. - */ - targetCpaNanos: string; - /** - * CPC that the advertiser is targeting. - */ - targetCpcNanos: string; - /** - * vCPM from Active View that the advertiser is targeting. - */ - targetCpmActiveViewNanos: string; - /** - * CPM that the advertiser is targeting. - */ - targetCpmNanos: string; - /** - * Number of impressions that the advertiser is targeting. - */ - targetImpressions: string; -} -/** - * Project List Response - */ -export interface Schema$ProjectsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#projectsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Project collection. - */ - projects: Schema$Project[]; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "REACH". - */ -export interface Schema$ReachReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#reachReportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected as activity metrics to pivot on - * in the "activities" section of the report. - */ - pivotedActivityMetrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected in the - * "reachByFrequencyMetricNames" section of the report. - */ - reachByFrequencyMetrics: Schema$Metric[]; -} -/** - * Represents a recipient. - */ -export interface Schema$Recipient { - /** - * The delivery type for the recipient. - */ - deliveryType: string; - /** - * The email address of the recipient. - */ - email: string; - /** - * The kind of resource this is, in this case dfareporting#recipient. - */ - kind: string; -} -/** - * Contains information about a region that can be targeted by ads. - */ -export interface Schema$Region { - /** - * Country code of the country to which this region belongs. - */ - countryCode: string; - /** - * DART ID of the country to which this region belongs. - */ - countryDartId: string; - /** - * DART ID of this region. - */ - dartId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#region". - */ - kind: string; - /** - * Name of this region. - */ - name: string; - /** - * Region code. - */ - regionCode: string; -} -/** - * Region List Response - */ -export interface Schema$RegionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#regionsListResponse". - */ - kind: string; - /** - * Region collection. - */ - regions: Schema$Region[]; -} -/** - * Contains properties of a remarketing list. Remarketing enables you to create - * lists of users who have performed specific actions on a site, then target ads - * to members of those lists. This resource can be used to manage remarketing - * lists that are owned by your advertisers. To see all remarketing lists that - * are visible to your advertisers, including those that are shared to your - * advertiser or account, use the TargetableRemarketingLists resource. - */ -export interface Schema$RemarketingList { - /** - * Account ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - accountId: string; - /** - * Whether this remarketing list is active. - */ - active: boolean; - /** - * Dimension value for the advertiser ID that owns this remarketing list. This - * is a required field. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Remarketing list description. - */ - description: string; - /** - * Remarketing list ID. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingList". - */ - kind: string; - /** - * Number of days that a user should remain in the remarketing list without an - * impression. Acceptable values are 1 to 540, inclusive. - */ - lifeSpan: string; - /** - * Rule used to populate the remarketing list with users. - */ - listPopulationRule: Schema$ListPopulationRule; - /** - * Number of users currently in the list. This is a read-only field. - */ - listSize: string; - /** - * Product from which this remarketing list was originated. - */ - listSource: string; - /** - * Name of the remarketing list. This is a required field. Must be no greater - * than 128 characters long. - */ - name: string; - /** - * Subaccount ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - subaccountId: string; -} -/** - * Contains properties of a remarketing list's sharing information. Sharing - * allows other accounts or advertisers to target to your remarketing lists. - * This resource can be used to manage remarketing list sharing to other - * accounts and advertisers. - */ -export interface Schema$RemarketingListShare { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingListShare". - */ - kind: string; - /** - * Remarketing list ID. This is a read-only, auto-generated field. - */ - remarketingListId: string; - /** - * Accounts that the remarketing list is shared with. - */ - sharedAccountIds: string[]; - /** - * Advertisers that the remarketing list is shared with. - */ - sharedAdvertiserIds: string[]; -} -/** - * Remarketing list response - */ -export interface Schema$RemarketingListsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#remarketingListsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Remarketing list collection. - */ - remarketingLists: Schema$RemarketingList[]; -} -/** - * Represents a Report resource. - */ -export interface Schema$Report { - /** - * The account ID to which this report belongs. - */ - accountId: string; - /** - * The report criteria for a report of type "STANDARD". - */ - criteria: any; - /** - * The report criteria for a report of type "CROSS_DIMENSION_REACH". - */ - crossDimensionReachCriteria: any; - /** - * The report's email delivery settings. - */ - delivery: any; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The filename used when generating report files for this report. - */ - fileName: string; - /** - * The report criteria for a report of type "FLOODLIGHT". - */ - floodlightCriteria: any; - /** - * The output format of the report. If not specified, default format is - * "CSV". Note that the actual format in the completed report file - * might differ if for instance the report's size exceeds the format's - * capabilities. "CSV" will then be the fallback format. - */ - format: string; - /** - * The unique ID identifying this report resource. - */ - id: string; - /** - * The kind of resource this is, in this case dfareporting#report. - */ - kind: string; - /** - * The timestamp (in milliseconds since epoch) of when this report was last - * modified. - */ - lastModifiedTime: string; - /** - * The name of the report. - */ - name: string; - /** - * The user profile id of the owner of this report. - */ - ownerProfileId: string; - /** - * The report criteria for a report of type "PATH_TO_CONVERSION". - */ - pathToConversionCriteria: any; - /** - * The report criteria for a report of type "REACH". - */ - reachCriteria: any; - /** - * The report's schedule. Can only be set if the report's - * 'dateRange' is a relative date range and the relative date range is - * not "TODAY". - */ - schedule: any; - /** - * The subaccount ID to which this report belongs if applicable. - */ - subAccountId: string; - /** - * The type of the report. - */ - type: string; -} -/** - * Represents fields that are compatible to be selected for a report of type - * "STANDARD". - */ -export interface Schema$ReportCompatibleFields { - /** - * Dimensions which are compatible to be selected in the - * "dimensionFilters" section of the report. - */ - dimensionFilters: Schema$Dimension[]; - /** - * Dimensions which are compatible to be selected in the - * "dimensions" section of the report. - */ - dimensions: Schema$Dimension[]; - /** - * The kind of resource this is, in this case - * dfareporting#reportCompatibleFields. - */ - kind: string; - /** - * Metrics which are compatible to be selected in the "metricNames" - * section of the report. - */ - metrics: Schema$Metric[]; - /** - * Metrics which are compatible to be selected as activity metrics to pivot on - * in the "activities" section of the report. - */ - pivotedActivityMetrics: Schema$Metric[]; -} -/** - * Represents the list of reports. - */ -export interface Schema$ReportList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The reports returned in this response. - */ - items: Schema$Report[]; - /** - * The kind of list this is, in this case dfareporting#reportList. - */ - kind: string; - /** - * Continuation token used to page through reports. To retrieve the next page - * of results, set the next request's "pageToken" to the value - * of this field. The page token is only valid for a limited amount of time - * and should not be persisted. - */ - nextPageToken: string; -} -/** - * Reporting Configuration - */ -export interface Schema$ReportsConfiguration { - /** - * Whether the exposure to conversion report is enabled. This report shows - * detailed pathway information on up to 10 of the most recent ad exposures - * seen by a user before converting. - */ - exposureToConversionEnabled: boolean; - /** - * Default lookback windows for new advertisers in this account. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Report generation time zone ID of this account. This is a required field - * that can only be changed by a superuser. Acceptable values are: - - * "1" for "America/New_York" - "2" for - * "Europe/London" - "3" for "Europe/Paris" - - * "4" for "Africa/Johannesburg" - "5" for - * "Asia/Jerusalem" - "6" for "Asia/Shanghai" - * - "7" for "Asia/Hong_Kong" - "8" for - * "Asia/Tokyo" - "9" for "Australia/Sydney" - - * "10" for "Asia/Dubai" - "11" for - * "America/Los_Angeles" - "12" for - * "Pacific/Auckland" - "13" for - * "America/Sao_Paulo" - */ - reportGenerationTimeZoneId: string; -} -/** - * Rich Media Exit Override. - */ -export interface Schema$RichMediaExitOverride { - /** - * Click-through URL of this rich media exit override. Applicable if the - * enabled field is set to true. - */ - clickThroughUrl: Schema$ClickThroughUrl; - /** - * Whether to use the clickThroughUrl. If false, the creative-level exit will - * be used. - */ - enabled: boolean; - /** - * ID for the override to refer to a specific exit in the creative. - */ - exitId: string; -} -/** - * A rule associates an asset with a targeting template for asset-level - * targeting. Applicable to INSTREAM_VIDEO creatives. - */ -export interface Schema$Rule { - /** - * A creativeAssets[].id. This should refer to one of the parent assets in - * this creative. This is a required field. - */ - assetId: string; - /** - * A user-friendly name for this rule. This is a required field. - */ - name: string; - /** - * A targeting template ID. The targeting from the targeting template will be - * used to determine whether this asset should be served. This is a required - * field. - */ - targetingTemplateId: string; -} -/** - * Contains properties of a site. - */ -export interface Schema$Site { - /** - * Account ID of this site. This is a read-only field that can be left blank. - */ - accountId: string; - /** - * Whether this site is approved. - */ - approved: boolean; - /** - * Directory site associated with this site. This is a required field that is - * read-only after insertion. - */ - directorySiteId: string; - /** - * Dimension value for the ID of the directory site. This is a read-only, - * auto-generated field. - */ - directorySiteIdDimensionValue: Schema$DimensionValue; - /** - * ID of this site. This is a read-only, auto-generated field. - */ - id: string; - /** - * Dimension value for the ID of this site. This is a read-only, - * auto-generated field. - */ - idDimensionValue: Schema$DimensionValue; - /** - * Key name of this site. This is a read-only, auto-generated field. - */ - keyName: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#site". - */ - kind: string; - /** - * Name of this site.This is a required field. Must be less than 128 - * characters long. If this site is under a subaccount, the name must be - * unique among sites of the same subaccount. Otherwise, this site is a - * top-level site, and the name must be unique among top-level sites of the - * same account. - */ - name: string; - /** - * Site contacts. - */ - siteContacts: Schema$SiteContact[]; - /** - * Site-wide settings. - */ - siteSettings: Schema$SiteSettings; - /** - * Subaccount ID of this site. This is a read-only field that can be left - * blank. - */ - subaccountId: string; -} -/** - * Site Contact - */ -export interface Schema$SiteContact { - /** - * Address of this site contact. - */ - address: string; - /** - * Site contact type. - */ - contactType: string; - /** - * Email address of this site contact. This is a required field. - */ - email: string; - /** - * First name of this site contact. - */ - firstName: string; - /** - * ID of this site contact. This is a read-only, auto-generated field. - */ - id: string; - /** - * Last name of this site contact. - */ - lastName: string; - /** - * Primary phone number of this site contact. - */ - phone: string; - /** - * Title or designation of this site contact. - */ - title: string; -} -/** - * Site Settings - */ -export interface Schema$SiteSettings { - /** - * Whether active view creatives are disabled for this site. - */ - activeViewOptOut: boolean; - /** - * Whether this site opts out of ad blocking. When true, ad blocking is - * disabled for all placements under the site, regardless of the individual - * placement settings. When false, the campaign and placement settings take - * effect. - */ - adBlockingOptOut: boolean; - /** - * Site-wide creative settings. - */ - creativeSettings: Schema$CreativeSettings; - /** - * Whether new cookies are disabled for this site. - */ - disableNewCookie: boolean; - /** - * Lookback window settings for this site. - */ - lookbackConfiguration: Schema$LookbackConfiguration; - /** - * Configuration settings for dynamic and image floodlight tags. - */ - tagSetting: Schema$TagSetting; - /** - * Whether Verification and ActiveView for in-stream video creatives are - * disabled by default for new placements created under this site. This value - * will be used to populate the placement.videoActiveViewOptOut field, when no - * value is specified for the new placement. - */ - videoActiveViewOptOutTemplate: boolean; - /** - * Default VPAID adapter setting for new placements created under this site. - * This value will be used to populate the placements.vpaidAdapterChoice - * field, when no value is specified for the new placement. Controls which - * VPAID format the measurement adapter will use for in-stream video creatives - * assigned to the placement. The publisher's specifications will - * typically determine this setting. For VPAID creatives, the adapter format - * will match the VPAID format (HTML5 VPAID creatives use the HTML5 adapter). - * Note: Flash is no longer supported. This field now defaults to HTML5 when - * the following values are provided: FLASH, BOTH. - */ - vpaidAdapterChoiceTemplate: string; -} -/** - * Site List Response - */ -export interface Schema$SitesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#sitesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Site collection. - */ - sites: Schema$Site[]; -} -/** - * Represents the dimensions of ads, placements, creatives, or creative assets. - */ -export interface Schema$Size { - /** - * Height of this size. Acceptable values are 0 to 32767, inclusive. - */ - height: number; - /** - * IAB standard size. This is a read-only, auto-generated field. - */ - iab: boolean; - /** - * ID of this size. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#size". - */ - kind: string; - /** - * Width of this size. Acceptable values are 0 to 32767, inclusive. - */ - width: number; -} -/** - * Size List Response - */ -export interface Schema$SizesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#sizesListResponse". - */ - kind: string; - /** - * Size collection. - */ - sizes: Schema$Size[]; -} -/** - * Skippable Settings - */ -export interface Schema$SkippableSetting { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#skippableSetting". - */ - kind: string; - /** - * Amount of time to play videos served to this placement before counting a - * view. Applicable when skippable is true. - */ - progressOffset: Schema$VideoOffset; - /** - * Amount of time to play videos served to this placement before the skip - * button should appear. Applicable when skippable is true. - */ - skipOffset: Schema$VideoOffset; - /** - * Whether the user can skip creatives served to this placement. - */ - skippable: boolean; -} -/** - * Represents a sorted dimension. - */ -export interface Schema$SortedDimension { - /** - * The kind of resource this is, in this case dfareporting#sortedDimension. - */ - kind: string; - /** - * The name of the dimension. - */ - name: string; - /** - * An optional sort order for the dimension column. - */ - sortOrder: string; -} -/** - * Contains properties of a DCM subaccount. - */ -export interface Schema$Subaccount { - /** - * ID of the account that contains this subaccount. This is a read-only field - * that can be left blank. - */ - accountId: string; - /** - * IDs of the available user role permissions for this subaccount. - */ - availablePermissionIds: string[]; - /** - * ID of this subaccount. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#subaccount". - */ - kind: string; - /** - * Name of this subaccount. This is a required field. Must be less than 128 - * characters long and be unique among subaccounts of the same account. - */ - name: string; -} -/** - * Subaccount List Response - */ -export interface Schema$SubaccountsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#subaccountsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Subaccount collection. - */ - subaccounts: Schema$Subaccount[]; -} -/** - * Placement Tag Data - */ -export interface Schema$TagData { - /** - * Ad associated with this placement tag. Applicable only when format is - * PLACEMENT_TAG_TRACKING. - */ - adId: string; - /** - * Tag string to record a click. - */ - clickTag: string; - /** - * Creative associated with this placement tag. Applicable only when format is - * PLACEMENT_TAG_TRACKING. - */ - creativeId: string; - /** - * TagData tag format of this tag. - */ - format: string; - /** - * Tag string for serving an ad. - */ - impressionTag: string; -} -/** - * Tag Settings - */ -export interface Schema$TagSetting { - /** - * Additional key-values to be included in tags. Each key-value pair must be - * of the form key=value, and pairs must be separated by a semicolon (;). Keys - * and values must not contain commas. For example, id=2;color=red is a valid - * value for this field. - */ - additionalKeyValues: string; - /** - * Whether static landing page URLs should be included in the tags. This - * setting applies only to placements. - */ - includeClickThroughUrls: boolean; - /** - * Whether click-tracking string should be included in the tags. - */ - includeClickTracking: boolean; - /** - * Option specifying how keywords are embedded in ad tags. This setting can be - * used to specify whether keyword placeholders are inserted in placement tags - * for this site. Publishers can then add keywords to those placeholders. - */ - keywordOption: string; -} -/** - * Dynamic and Image Tag Settings. - */ -export interface Schema$TagSettings { - /** - * Whether dynamic floodlight tags are enabled. - */ - dynamicTagEnabled: boolean; - /** - * Whether image tags are enabled. - */ - imageTagEnabled: boolean; -} -/** - * Contains properties of a targetable remarketing list. Remarketing enables you - * to create lists of users who have performed specific actions on a site, then - * target ads to members of those lists. This resource is a read-only view of a - * remarketing list to be used to faciliate targeting ads to specific lists. - * Remarketing lists that are owned by your advertisers and those that are - * shared to your advertisers or account are accessible via this resource. To - * manage remarketing lists that are owned by your advertisers, use the - * RemarketingLists resource. - */ -export interface Schema$TargetableRemarketingList { - /** - * Account ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - accountId: string; - /** - * Whether this targetable remarketing list is active. - */ - active: boolean; - /** - * Dimension value for the advertiser ID that owns this targetable remarketing - * list. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Targetable remarketing list description. - */ - description: string; - /** - * Targetable remarketing list ID. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetableRemarketingList". - */ - kind: string; - /** - * Number of days that a user should remain in the targetable remarketing list - * without an impression. - */ - lifeSpan: string; - /** - * Number of users currently in the list. This is a read-only field. - */ - listSize: string; - /** - * Product from which this targetable remarketing list was originated. - */ - listSource: string; - /** - * Name of the targetable remarketing list. Is no greater than 128 characters - * long. - */ - name: string; - /** - * Subaccount ID of this remarketing list. This is a read-only, auto-generated - * field that is only returned in GET requests. - */ - subaccountId: string; -} -/** - * Targetable remarketing list response - */ -export interface Schema$TargetableRemarketingListsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetableRemarketingListsListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Targetable remarketing list collection. - */ - targetableRemarketingLists: Schema$TargetableRemarketingList[]; -} -/** - * Contains properties of a targeting template. A targeting template - * encapsulates targeting information which can be reused across multiple ads. - */ -export interface Schema$TargetingTemplate { - /** - * Account ID of this targeting template. This field, if left unset, will be - * auto-generated on insert and is read-only after insert. - */ - accountId: string; - /** - * Advertiser ID of this targeting template. This is a required field on - * insert and is read-only after insert. - */ - advertiserId: string; - /** - * Dimension value for the ID of the advertiser. This is a read-only, - * auto-generated field. - */ - advertiserIdDimensionValue: Schema$DimensionValue; - /** - * Time and day targeting criteria. - */ - dayPartTargeting: Schema$DayPartTargeting; - /** - * Geographical targeting criteria. - */ - geoTargeting: Schema$GeoTargeting; - /** - * ID of this targeting template. This is a read-only, auto-generated field. - */ - id: string; - /** - * Key-value targeting criteria. - */ - keyValueTargetingExpression: Schema$KeyValueTargetingExpression; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetingTemplate". - */ - kind: string; - /** - * Language targeting criteria. - */ - languageTargeting: Schema$LanguageTargeting; - /** - * Remarketing list targeting criteria. - */ - listTargetingExpression: Schema$ListTargetingExpression; - /** - * Name of this targeting template. This field is required. It must be less - * than 256 characters long and unique within an advertiser. - */ - name: string; - /** - * Subaccount ID of this targeting template. This field, if left unset, will - * be auto-generated on insert and is read-only after insert. - */ - subaccountId: string; - /** - * Technology platform targeting criteria. - */ - technologyTargeting: Schema$TechnologyTargeting; -} -/** - * Targeting Template List Response - */ -export interface Schema$TargetingTemplatesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#targetingTemplatesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * Targeting template collection. - */ - targetingTemplates: Schema$TargetingTemplate[]; -} -/** - * Target Window. - */ -export interface Schema$TargetWindow { - /** - * User-entered value. - */ - customHtml: string; - /** - * Type of browser window for which the backup image of the flash creative can - * be displayed. - */ - targetWindowOption: string; -} -/** - * Technology Targeting. - */ -export interface Schema$TechnologyTargeting { - /** - * Browsers that this ad targets. For each browser either set browserVersionId - * or dartId along with the version numbers. If both are specified, only - * browserVersionId will be used. The other fields are populated automatically - * when the ad is inserted or updated. - */ - browsers: Schema$Browser[]; - /** - * Connection types that this ad targets. For each connection type only id is - * required. The other fields are populated automatically when the ad is - * inserted or updated. - */ - connectionTypes: Schema$ConnectionType[]; - /** - * Mobile carriers that this ad targets. For each mobile carrier only id is - * required, and the other fields are populated automatically when the ad is - * inserted or updated. If targeting a mobile carrier, do not set targeting - * for any zip codes. - */ - mobileCarriers: Schema$MobileCarrier[]; - /** - * Operating systems that this ad targets. To target specific versions, use - * operatingSystemVersions. For each operating system only dartId is required. - * The other fields are populated automatically when the ad is inserted or - * updated. If targeting an operating system, do not set targeting for - * operating system versions for the same operating system. - */ - operatingSystems: Schema$OperatingSystem[]; - /** - * Operating system versions that this ad targets. To target all versions, use - * operatingSystems. For each operating system version, only id is required. - * The other fields are populated automatically when the ad is inserted or - * updated. If targeting an operating system version, do not set targeting for - * the corresponding operating system in operatingSystems. - */ - operatingSystemVersions: Schema$OperatingSystemVersion[]; - /** - * Platform types that this ad targets. For example, desktop, mobile, or - * tablet. For each platform type, only id is required, and the other fields - * are populated automatically when the ad is inserted or updated. - */ - platformTypes: Schema$PlatformType[]; -} -/** - * Third Party Authentication Token - */ -export interface Schema$ThirdPartyAuthenticationToken { - /** - * Name of the third-party authentication token. - */ - name: string; - /** - * Value of the third-party authentication token. This is a read-only, - * auto-generated field. - */ - value: string; -} -/** - * Third-party Tracking URL. - */ -export interface Schema$ThirdPartyTrackingUrl { - /** - * Third-party URL type for in-stream video creatives. - */ - thirdPartyUrlType: string; - /** - * URL for the specified third-party URL type. - */ - url: string; -} -/** - * Transcode Settings - */ -export interface Schema$TranscodeSetting { - /** - * Whitelist of video formats to be served to this placement. Set this list to - * null or empty to serve all video formats. - */ - enabledVideoFormats: number[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#transcodeSetting". - */ - kind: string; -} -/** - * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following - * creative types: INSTREAM_VIDEO and VPAID. - */ -export interface Schema$UniversalAdId { - /** - * Registry used for the Ad ID value. - */ - registry: string; - /** - * ID value for this creative. Only alphanumeric characters and the following - * symbols are valid: "_/\-". Maximum length is 64 characters. Read - * only when registry is DCM. - */ - value: string; -} -/** - * User Defined Variable configuration. - */ -export interface Schema$UserDefinedVariableConfiguration { - /** - * Data type for the variable. This is a required field. - */ - dataType: string; - /** - * User-friendly name for the variable which will appear in reports. This is a - * required field, must be less than 64 characters long, and cannot contain - * the following characters: ""<>". - */ - reportName: string; - /** - * Variable name in the tag. This is a required field. - */ - variableType: string; -} -/** - * Represents a UserProfile resource. - */ -export interface Schema$UserProfile { - /** - * The account ID to which this profile belongs. - */ - accountId: string; - /** - * The account name this profile belongs to. - */ - accountName: string; - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The kind of resource this is, in this case dfareporting#userProfile. - */ - kind: string; - /** - * The unique ID of the user profile. - */ - profileId: string; - /** - * The sub account ID this profile belongs to if applicable. - */ - subAccountId: string; - /** - * The sub account name this profile belongs to if applicable. - */ - subAccountName: string; - /** - * The user name. - */ - userName: string; -} -/** - * Represents the list of user profiles. - */ -export interface Schema$UserProfileList { - /** - * The eTag of this response for caching purposes. - */ - etag: string; - /** - * The user profiles returned in this response. - */ - items: Schema$UserProfile[]; - /** - * The kind of list this is, in this case dfareporting#userProfileList. - */ - kind: string; -} -/** - * Contains properties of auser role, which is used to manage user access. - */ -export interface Schema$UserRole { - /** - * Account ID of this user role. This is a read-only field that can be left - * blank. - */ - accountId: string; - /** - * Whether this is a default user role. Default user roles are created by the - * system for the account/subaccount and cannot be modified or deleted. Each - * default user role comes with a basic set of preassigned permissions. - */ - defaultUserRole: boolean; - /** - * ID of this user role. This is a read-only, auto-generated field. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRole". - */ - kind: string; - /** - * Name of this user role. This is a required field. Must be less than 256 - * characters long. If this user role is under a subaccount, the name must be - * unique among sites of the same subaccount. Otherwise, this user role is a - * top-level user role, and the name must be unique among top-level user roles - * of the same account. - */ - name: string; - /** - * ID of the user role that this user role is based on or copied from. This is - * a required field. - */ - parentUserRoleId: string; - /** - * List of permissions associated with this user role. - */ - permissions: Schema$UserRolePermission[]; - /** - * Subaccount ID of this user role. This is a read-only field that can be left - * blank. - */ - subaccountId: string; -} -/** - * Contains properties of a user role permission. - */ -export interface Schema$UserRolePermission { - /** - * Levels of availability for a user role permission. - */ - availability: string; - /** - * ID of this user role permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermission". - */ - kind: string; - /** - * Name of this user role permission. - */ - name: string; - /** - * ID of the permission group that this user role permission belongs to. - */ - permissionGroupId: string; -} -/** - * Represents a grouping of related user role permissions. - */ -export interface Schema$UserRolePermissionGroup { - /** - * ID of this user role permission. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionGroup". - */ - kind: string; - /** - * Name of this user role permission group. - */ - name: string; -} -/** - * User Role Permission Group List Response - */ -export interface Schema$UserRolePermissionGroupsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionGroupsListResponse". - */ - kind: string; - /** - * User role permission group collection. - */ - userRolePermissionGroups: Schema$UserRolePermissionGroup[]; -} -/** - * User Role Permission List Response - */ -export interface Schema$UserRolePermissionsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolePermissionsListResponse". - */ - kind: string; - /** - * User role permission collection. - */ - userRolePermissions: Schema$UserRolePermission[]; -} -/** - * User Role List Response - */ -export interface Schema$UserRolesListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#userRolesListResponse". - */ - kind: string; - /** - * Pagination token to be used for the next list operation. - */ - nextPageToken: string; - /** - * User role collection. - */ - userRoles: Schema$UserRole[]; -} -/** - * Contains information about supported video formats. - */ -export interface Schema$VideoFormat { - /** - * File type of the video format. - */ - fileType: string; - /** - * ID of the video format. - */ - id: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoFormat". - */ - kind: string; - /** - * The resolution of this video format. - */ - resolution: Schema$Size; - /** - * The target bit rate of this video format. - */ - targetBitRate: number; -} -/** - * Video Format List Response - */ -export interface Schema$VideoFormatsListResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoFormatsListResponse". - */ - kind: string; - /** - * Video format collection. - */ - videoFormats: Schema$VideoFormat[]; -} -/** - * Video Offset - */ -export interface Schema$VideoOffset { - /** - * Duration, as a percentage of video duration. Do not set when offsetSeconds - * is set. Acceptable values are 0 to 100, inclusive. - */ - offsetPercentage: number; - /** - * Duration, in seconds. Do not set when offsetPercentage is set. Acceptable - * values are 0 to 86399, inclusive. - */ - offsetSeconds: number; -} -/** - * Video Settings - */ -export interface Schema$VideoSettings { - /** - * Settings for the companion creatives of video creatives served to this - * placement. - */ - companionSettings: Schema$CompanionSetting; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dfareporting#videoSettings". - */ - kind: string; - /** - * Orientation of a video placement. If this value is set, placement will - * return assets matching the specified orientation. - */ - orientation: string; - /** - * Settings for the skippability of video creatives served to this placement. - * If this object is provided, the creative-level skippable settings will be - * overridden. - */ - skippableSettings: Schema$SkippableSetting; - /** - * Settings for the transcodes of video creatives served to this placement. If - * this object is provided, the creative-level transcode settings will be - * overridden. - */ - transcodeSettings: Schema$TranscodeSetting; -} - -export class Resource$Accountactiveadsummaries { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountActiveAdSummaries.get - * @desc Gets the account's active ad summary by account ID. - * @alias dfareporting.accountActiveAdSummaries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.summaryAccountId Account ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'summaryAccountId'], - pathParams: ['profileId', 'summaryAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accountpermissiongroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountPermissionGroups.get - * @desc Gets one account permission group by ID. - * @alias dfareporting.accountPermissionGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account permission group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissionGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountPermissionGroups.list - * @desc Retrieves the list of account permission groups. - * @alias dfareporting.accountPermissionGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissionGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Accountpermissions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountPermissions.get - * @desc Gets one account permission by ID. - * @alias dfareporting.accountPermissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account permission ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountPermissions.list - * @desc Retrieves the list of account permissions. - * @alias dfareporting.accountPermissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Accounts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accounts.get - * @desc Gets one account by ID. - * @alias dfareporting.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.list - * @desc Retrieves the list of accounts, possibly filtered. This method - * supports paging. - * @alias dfareporting.accounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active accounts. Don't set this field to select both active and non-active accounts. - * @param {string=} params.ids Select only accounts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.patch - * @desc Updates an existing account. This method supports patch semantics. - * @alias dfareporting.accounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Account ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accounts.update - * @desc Updates an existing account. - * @alias dfareporting.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accountuserprofiles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.accountUserProfiles.get - * @desc Gets one account user profile by ID. - * @alias dfareporting.accountUserProfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User profile ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.insert - * @desc Inserts a new account user profile. - * @alias dfareporting.accountUserProfiles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.list - * @desc Retrieves a list of account user profiles, possibly filtered. This - * method supports paging. - * @alias dfareporting.accountUserProfiles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active user profiles. - * @param {string=} params.ids Select only user profiles with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only user profiles with the specified subaccount ID. - * @param {string=} params.userRoleId Select only user profiles with the specified user role ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.patch - * @desc Updates an existing account user profile. This method supports patch - * semantics. - * @alias dfareporting.accountUserProfiles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User profile ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.accountUserProfiles.update - * @desc Updates an existing account user profile. - * @alias dfareporting.accountUserProfiles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AccountUserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Ads { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.ads.get - * @desc Gets one ad by ID. - * @alias dfareporting.ads.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Ad ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/ads/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.insert - * @desc Inserts a new ad. - * @alias dfareporting.ads.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.list - * @desc Retrieves a list of ads, possibly filtered. This method supports - * paging. - * @alias dfareporting.ads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active ads. - * @param {string=} params.advertiserId Select only ads with this advertiser ID. - * @param {boolean=} params.archived Select only archived ads. - * @param {string=} params.audienceSegmentIds Select only ads with these audience segment IDs. - * @param {string=} params.campaignIds Select only ads with these campaign IDs. - * @param {string=} params.compatibility Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. - * @param {string=} params.creativeIds Select only ads with these creative IDs assigned. - * @param {string=} params.creativeOptimizationConfigurationIds Select only ads with these creative optimization configuration IDs. - * @param {boolean=} params.dynamicClickTracker Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. - * @param {string=} params.ids Select only ads with these IDs. - * @param {string=} params.landingPageIds Select only ads with these landing page IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.overriddenEventTagId Select only ads with this event tag override ID. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.placementIds Select only ads with these placement IDs assigned. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.remarketingListIds Select only ads whose list targeting expression use these remarketing list IDs. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". - * @param {string=} params.sizeIds Select only ads with these size IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {boolean=} params.sslCompliant Select only ads that are SSL-compliant. - * @param {boolean=} params.sslRequired Select only ads that require SSL. - * @param {string=} params.type Select only ads with these types. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.patch - * @desc Updates an existing ad. This method supports patch semantics. - * @alias dfareporting.ads.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Ad ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.ads.update - * @desc Updates an existing ad. - * @alias dfareporting.ads.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Ad} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Advertisergroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.advertiserGroups.delete - * @desc Deletes an existing advertiser group. - * @alias dfareporting.advertiserGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.get - * @desc Gets one advertiser group by ID. - * @alias dfareporting.advertiserGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.insert - * @desc Inserts a new advertiser group. - * @alias dfareporting.advertiserGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.list - * @desc Retrieves a list of advertiser groups, possibly filtered. This method - * supports paging. - * @alias dfareporting.advertiserGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only advertiser groups with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.patch - * @desc Updates an existing advertiser group. This method supports patch - * semantics. - * @alias dfareporting.advertiserGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserGroups.update - * @desc Updates an existing advertiser group. - * @alias dfareporting.advertiserGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().AdvertiserGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Advertiserlandingpages { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.advertiserLandingPages.get - * @desc Gets one landing page by ID. - * @alias dfareporting.advertiserLandingPages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Landing page ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserLandingPages.insert - * @desc Inserts a new landing page. - * @alias dfareporting.advertiserLandingPages.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserLandingPages.list - * @desc Retrieves a list of landing pages. - * @alias dfareporting.advertiserLandingPages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only landing pages that belong to these advertisers. - * @param {boolean=} params.archived Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages. - * @param {string=} params.ids Select only landing pages with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only landing pages that belong to this subaccount. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.advertiserLandingPages.patch - * @desc Updates an existing landing page. This method supports patch - * semantics. - * @alias dfareporting.advertiserLandingPages.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Landing page ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertiserLandingPages.update - * @desc Updates an existing landing page. - * @alias dfareporting.advertiserLandingPages.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().LandingPage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Advertisers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.advertisers.get - * @desc Gets one advertiser by ID. - * @alias dfareporting.advertisers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertisers/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.insert - * @desc Inserts a new advertiser. - * @alias dfareporting.advertisers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.list - * @desc Retrieves a list of advertisers, possibly filtered. This method - * supports paging. - * @alias dfareporting.advertisers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserGroupIds Select only advertisers with these advertiser group IDs. - * @param {string=} params.floodlightConfigurationIds Select only advertisers with these floodlight configuration IDs. - * @param {string=} params.ids Select only advertisers with these IDs. - * @param {boolean=} params.includeAdvertisersWithoutGroupsOnly Select only advertisers which do not belong to any advertiser group. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {boolean=} params.onlyParent Select only advertisers which use another advertiser's floodlight configuration. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.status Select only advertisers with the specified status. - * @param {string=} params.subaccountId Select only advertisers with these subaccount IDs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.patch - * @desc Updates an existing advertiser. This method supports patch semantics. - * @alias dfareporting.advertisers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Advertiser ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.advertisers.update - * @desc Updates an existing advertiser. - * @alias dfareporting.advertisers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Advertiser} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Browsers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.browsers.list - * @desc Retrieves a list of browsers. - * @alias dfareporting.browsers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/browsers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Campaigncreativeassociations { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.campaignCreativeAssociations.insert - * @desc Associates a creative with the specified campaign. This method - * creates a default ad with dimensions matching the creative in the campaign - * if such a default ad does not exist already. - * @alias dfareporting.campaignCreativeAssociations.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Campaign ID in this association. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CampaignCreativeAssociation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaignCreativeAssociations.list - * @desc Retrieves the list of creative IDs associated with the specified - * campaign. This method supports paging. - * @alias dfareporting.campaignCreativeAssociations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.campaignId Campaign ID in this association. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$CampaignCreativeAssociationsListResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$CampaignCreativeAssociationsListResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'campaignId'], - pathParams: ['campaignId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Campaigns { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.campaigns.get - * @desc Gets one campaign by ID. - * @alias dfareporting.campaigns.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.insert - * @desc Inserts a new campaign. - * @alias dfareporting.campaigns.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.list - * @desc Retrieves a list of campaigns, possibly filtered. This method - * supports paging. - * @alias dfareporting.campaigns.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserGroupIds Select only campaigns whose advertisers belong to these advertiser groups. - * @param {string=} params.advertiserIds Select only campaigns that belong to these advertisers. - * @param {boolean=} params.archived Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. - * @param {boolean=} params.atLeastOneOptimizationActivity Select only campaigns that have at least one optimization activity. - * @param {string=} params.excludedIds Exclude campaigns with these IDs. - * @param {string=} params.ids Select only campaigns with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.overriddenEventTagId Select only campaigns that have overridden this event tag ID. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only campaigns that belong to this subaccount. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.patch - * @desc Updates an existing campaign. This method supports patch semantics. - * @alias dfareporting.campaigns.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Campaign ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.campaigns.update - * @desc Updates an existing campaign. - * @alias dfareporting.campaigns.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Campaign} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Changelogs { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.changeLogs.get - * @desc Gets one change log by ID. - * @alias dfareporting.changeLogs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Change log ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/changeLogs/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.changeLogs.list - * @desc Retrieves a list of change logs. This method supports paging. - * @alias dfareporting.changeLogs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.action Select only change logs with the specified action. - * @param {string=} params.ids Select only change logs with these IDs. - * @param {string=} params.maxChangeTime Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.minChangeTime Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. - * @param {string=} params.objectIds Select only change logs with these object IDs. - * @param {string=} params.objectType Select only change logs with the specified object type. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Select only change logs whose object ID, user name, old or new values match the search string. - * @param {string=} params.userProfileIds Select only change logs with these user profile IDs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/changeLogs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Cities { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.cities.list - * @desc Retrieves a list of cities, possibly filtered. - * @alias dfareporting.cities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.countryDartIds Select only cities from these countries. - * @param {string=} params.dartIds Select only cities with these DART IDs. - * @param {string=} params.namePrefix Select only cities with names starting with this prefix. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.regionDartIds Select only cities from these regions. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/cities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Connectiontypes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.connectionTypes.get - * @desc Gets one connection type by ID. - * @alias dfareporting.connectionTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Connection type ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/connectionTypes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.connectionTypes.list - * @desc Retrieves a list of connection types. - * @alias dfareporting.connectionTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/connectionTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Contentcategories { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.contentCategories.delete - * @desc Deletes an existing content category. - * @alias dfareporting.contentCategories.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.get - * @desc Gets one content category by ID. - * @alias dfareporting.contentCategories.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.insert - * @desc Inserts a new content category. - * @alias dfareporting.contentCategories.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.list - * @desc Retrieves a list of content categories, possibly filtered. This - * method supports paging. - * @alias dfareporting.contentCategories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only content categories with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.patch - * @desc Updates an existing content category. This method supports patch - * semantics. - * @alias dfareporting.contentCategories.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Content category ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.contentCategories.update - * @desc Updates an existing content category. - * @alias dfareporting.contentCategories.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ContentCategory} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Conversions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.conversions.batchinsert - * @desc Inserts conversions. - * @alias dfareporting.conversions.batchinsert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ConversionsBatchInsertRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchinsert(params?: any, options?: MethodOptions): - AxiosPromise; - batchinsert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchinsert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/conversions/batchinsert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.conversions.batchupdate - * @desc Updates existing conversions. - * @alias dfareporting.conversions.batchupdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().ConversionsBatchUpdateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchupdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchupdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchupdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/conversions/batchupdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Countries { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.countries.get - * @desc Gets one country by ID. - * @alias dfareporting.countries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dartId Country DART ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/countries/{dartId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'dartId'], - pathParams: ['dartId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.countries.list - * @desc Retrieves a list of countries. - * @alias dfareporting.countries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/countries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativeassets { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeAssets.insert - * @desc Inserts a new creative asset. - * @alias dfareporting.creativeAssets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.advertiserId Advertiser ID of this creative. This is a required field. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['advertiserId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativefields { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeFields.delete - * @desc Deletes an existing creative field. - * @alias dfareporting.creativeFields.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.get - * @desc Gets one creative field by ID. - * @alias dfareporting.creativeFields.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.insert - * @desc Inserts a new creative field. - * @alias dfareporting.creativeFields.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.list - * @desc Retrieves a list of creative fields, possibly filtered. This method - * supports paging. - * @alias dfareporting.creativeFields.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only creative fields that belong to these advertisers. - * @param {string=} params.ids Select only creative fields with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.patch - * @desc Updates an existing creative field. This method supports patch - * semantics. - * @alias dfareporting.creativeFields.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative Field ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFields.update - * @desc Updates an existing creative field. - * @alias dfareporting.creativeFields.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeField} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativefieldvalues { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeFieldValues.delete - * @desc Deletes an existing creative field value. - * @alias dfareporting.creativeFieldValues.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.get - * @desc Gets one creative field value by ID. - * @alias dfareporting.creativeFieldValues.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.insert - * @desc Inserts a new creative field value. - * @alias dfareporting.creativeFieldValues.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.list - * @desc Retrieves a list of creative field values, possibly filtered. This - * method supports paging. - * @alias dfareporting.creativeFieldValues.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string=} params.ids Select only creative field values with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.patch - * @desc Updates an existing creative field value. This method supports patch - * semantics. - * @alias dfareporting.creativeFieldValues.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.id Creative Field Value ID - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId', 'id'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeFieldValues.update - * @desc Updates an existing creative field value. - * @alias dfareporting.creativeFieldValues.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.creativeFieldId Creative field ID for this creative field value. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeFieldValue} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId', 'creativeFieldId'], - pathParams: ['creativeFieldId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creativegroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creativeGroups.get - * @desc Gets one creative group by ID. - * @alias dfareporting.creativeGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.insert - * @desc Inserts a new creative group. - * @alias dfareporting.creativeGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.list - * @desc Retrieves a list of creative groups, possibly filtered. This method - * supports paging. - * @alias dfareporting.creativeGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only creative groups that belong to these advertisers. - * @param {integer=} params.groupNumber Select only creative groups that belong to this subgroup. - * @param {string=} params.ids Select only creative groups with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.patch - * @desc Updates an existing creative group. This method supports patch - * semantics. - * @alias dfareporting.creativeGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creativeGroups.update - * @desc Updates an existing creative group. - * @alias dfareporting.creativeGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().CreativeGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Creatives { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.creatives.get - * @desc Gets one creative by ID. - * @alias dfareporting.creatives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creatives/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.insert - * @desc Inserts a new creative. - * @alias dfareporting.creatives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.list - * @desc Retrieves a list of creatives, possibly filtered. This method - * supports paging. - * @alias dfareporting.creatives.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active creatives. Leave blank to select active and inactive creatives. - * @param {string=} params.advertiserId Select only creatives with this advertiser ID. - * @param {boolean=} params.archived Select only archived creatives. Leave blank to select archived and unarchived creatives. - * @param {string=} params.campaignId Select only creatives with this campaign ID. - * @param {string=} params.companionCreativeIds Select only in-stream video creatives with these companion IDs. - * @param {string=} params.creativeFieldIds Select only creatives with these creative field IDs. - * @param {string=} params.ids Select only creatives with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.renderingIds Select only creatives with these rendering IDs. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". - * @param {string=} params.sizeIds Select only creatives with these size IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.studioCreativeId Select only creatives corresponding to this Studio creative ID. - * @param {string=} params.types Select only creatives with these creative types. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.patch - * @desc Updates an existing creative. This method supports patch semantics. - * @alias dfareporting.creatives.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Creative ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.creatives.update - * @desc Updates an existing creative. - * @alias dfareporting.creatives.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Creative} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/creatives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Dimensionvalues { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.dimensionValues.query - * @desc Retrieves list of report dimension values for a list of filters. - * @alias dfareporting.dimensionValues.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA user profile ID. - * @param {().DimensionValueRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/dimensionvalues/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Directorysitecontacts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.directorySiteContacts.get - * @desc Gets one directory site contact by ID. - * @alias dfareporting.directorySiteContacts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Directory site contact ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/directorySiteContacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySiteContacts.list - * @desc Retrieves a list of directory site contacts, possibly filtered. This - * method supports paging. - * @alias dfareporting.directorySiteContacts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.directorySiteIds Select only directory site contacts with these directory site IDs. This is a required field. - * @param {string=} params.ids Select only directory site contacts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with name "my directory site contact", "directory site contact 2015", or simply "directory site contact". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/directorySiteContacts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Directorysites { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.directorySites.get - * @desc Gets one directory site by ID. - * @alias dfareporting.directorySites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Directory site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/directorySites/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySites.insert - * @desc Inserts a new directory site. - * @alias dfareporting.directorySites.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().DirectorySite} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/directorySites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.directorySites.list - * @desc Retrieves a list of directory sites, possibly filtered. This method - * supports paging. - * @alias dfareporting.directorySites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsPublisherPaidPlacements Select only directory sites that accept publisher paid placements. This field can be left blank. - * @param {boolean=} params.active Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. - * @param {string=} params.countryId Select only directory sites with this country ID. - * @param {string=} params.dfpNetworkCode Select only directory sites with this DFP network code. - * @param {string=} params.ids Select only directory sites with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.parentId Select only directory sites with this parent ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/directorySites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Dynamictargetingkeys { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.dynamicTargetingKeys.delete - * @desc Deletes an existing dynamic targeting key. - * @alias dfareporting.dynamicTargetingKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. - * @param {string} params.objectId ID of the object of this dynamic targeting key. This is a required field. - * @param {string} params.objectType Type of the object of this dynamic targeting key. This is a required field. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys/{objectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'objectId', 'name', 'objectType'], - pathParams: ['objectId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.dynamicTargetingKeys.insert - * @desc Inserts a new dynamic targeting key. Keys must be created at the - * advertiser level before being assigned to the advertiser's ads, creatives, - * or placements. There is a maximum of 1000 keys per advertiser, out of which - * a maximum of 20 keys can be assigned per ad, creative, or placement. - * @alias dfareporting.dynamicTargetingKeys.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().DynamicTargetingKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.dynamicTargetingKeys.list - * @desc Retrieves a list of dynamic targeting keys. - * @alias dfareporting.dynamicTargetingKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only dynamic targeting keys whose object has this advertiser ID. - * @param {string=} params.names Select only dynamic targeting keys exactly matching these names. - * @param {string=} params.objectId Select only dynamic targeting keys with this object ID. - * @param {string=} params.objectType Select only dynamic targeting keys with this object type. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Eventtags { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.eventTags.delete - * @desc Deletes an existing event tag. - * @alias dfareporting.eventTags.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.get - * @desc Gets one event tag by ID. - * @alias dfareporting.eventTags.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.insert - * @desc Inserts a new event tag. - * @alias dfareporting.eventTags.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.list - * @desc Retrieves a list of event tags, possibly filtered. - * @alias dfareporting.eventTags.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.adId Select only event tags that belong to this ad. - * @param {string=} params.advertiserId Select only event tags that belong to this advertiser. - * @param {string=} params.campaignId Select only event tags that belong to this campaign. - * @param {boolean=} params.definitionsOnly Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. - * @param {boolean=} params.enabled Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. - * @param {string=} params.eventTagTypes Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. - * @param {string=} params.ids Select only event tags with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.patch - * @desc Updates an existing event tag. This method supports patch semantics. - * @alias dfareporting.eventTags.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Event tag ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.eventTags.update - * @desc Updates an existing event tag. - * @alias dfareporting.eventTags.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().EventTag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Files { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.files.get - * @desc Retrieves a report file by its report ID and file ID. This method - * supports media download. - * @alias dfareporting.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the report file. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/reports/{reportId}/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['reportId', 'fileId'], - pathParams: ['fileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.files.list - * @desc Lists files for a user profile. - * @alias dfareporting.files.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA profile ID. - * @param {string=} params.scope The scope that defines which results are returned. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/files') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightactivities { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightActivities.delete - * @desc Deletes an existing floodlight activity. - * @alias dfareporting.floodlightActivities.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.generatetag - * @desc Generates a tag for a floodlight activity. - * @alias dfareporting.floodlightActivities.generatetag - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.floodlightActivityId Floodlight activity ID for which we want to generate a tag. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generatetag(params?: any, options?: MethodOptions): - AxiosPromise; - generatetag( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - generatetag( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/generatetag') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivities.get - * @desc Gets one floodlight activity by ID. - * @alias dfareporting.floodlightActivities.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.insert - * @desc Inserts a new floodlight activity. - * @alias dfareporting.floodlightActivities.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.list - * @desc Retrieves a list of floodlight activities, possibly filtered. This - * method supports paging. - * @alias dfareporting.floodlightActivities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.floodlightActivityGroupIds Select only floodlight activities with the specified floodlight activity group IDs. - * @param {string=} params.floodlightActivityGroupName Select only floodlight activities with the specified floodlight activity group name. - * @param {string=} params.floodlightActivityGroupTagString Select only floodlight activities with the specified floodlight activity group tag string. - * @param {string=} params.floodlightActivityGroupType Select only floodlight activities with the specified floodlight activity group type. - * @param {string=} params.floodlightConfigurationId Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.ids Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.tagString Select only floodlight activities with the specified tag string. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivities.patch - * @desc Updates an existing floodlight activity. This method supports patch - * semantics. - * @alias dfareporting.floodlightActivities.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivities.update - * @desc Updates an existing floodlight activity. - * @alias dfareporting.floodlightActivities.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightactivitygroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightActivityGroups.get - * @desc Gets one floodlight activity group by ID. - * @alias dfareporting.floodlightActivityGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity Group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.insert - * @desc Inserts a new floodlight activity group. - * @alias dfareporting.floodlightActivityGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.list - * @desc Retrieves a list of floodlight activity groups, possibly filtered. - * This method supports paging. - * @alias dfareporting.floodlightActivityGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. - * @param {string=} params.floodlightConfigurationId Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. - * @param {string=} params.ids Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.type Select only floodlight activity groups with the specified floodlight activity group type. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.patch - * @desc Updates an existing floodlight activity group. This method supports - * patch semantics. - * @alias dfareporting.floodlightActivityGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight activity Group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightActivityGroups.update - * @desc Updates an existing floodlight activity group. - * @alias dfareporting.floodlightActivityGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightActivityGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Floodlightconfigurations { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.floodlightConfigurations.get - * @desc Gets one floodlight configuration by ID. - * @alias dfareporting.floodlightConfigurations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight configuration ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.list - * @desc Retrieves a list of floodlight configurations, possibly filtered. - * @alias dfareporting.floodlightConfigurations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.patch - * @desc Updates an existing floodlight configuration. This method supports - * patch semantics. - * @alias dfareporting.floodlightConfigurations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Floodlight configuration ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.floodlightConfigurations.update - * @desc Updates an existing floodlight configuration. - * @alias dfareporting.floodlightConfigurations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().FloodlightConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Inventoryitems { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.inventoryItems.get - * @desc Gets one inventory item by ID. - * @alias dfareporting.inventoryItems.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Inventory item ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.inventoryItems.list - * @desc Retrieves a list of inventory items, possibly filtered. This method - * supports paging. - * @alias dfareporting.inventoryItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only inventory items with these IDs. - * @param {boolean=} params.inPlan Select only inventory items that are in plan. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderId Select only inventory items that belong to specified orders. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {string=} params.siteId Select only inventory items that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.type Select only inventory items with this type. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/inventoryItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Languages { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.languages.list - * @desc Retrieves a list of languages. - * @alias dfareporting.languages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/languages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Metros { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.metros.list - * @desc Retrieves a list of metros. - * @alias dfareporting.metros.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/metros') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Mobilecarriers { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.mobileCarriers.get - * @desc Gets one mobile carrier by ID. - * @alias dfareporting.mobileCarriers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Mobile carrier ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/mobileCarriers/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.mobileCarriers.list - * @desc Retrieves a list of mobile carriers. - * @alias dfareporting.mobileCarriers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/mobileCarriers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operatingsystems { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.operatingSystems.get - * @desc Gets one operating system by DART ID. - * @alias dfareporting.operatingSystems.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dartId Operating system DART ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystems/{dartId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'dartId'], - pathParams: ['dartId', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.operatingSystems.list - * @desc Retrieves a list of operating systems. - * @alias dfareporting.operatingSystems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operatingsystemversions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.operatingSystemVersions.get - * @desc Gets one operating system version by ID. - * @alias dfareporting.operatingSystemVersions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Operating system version ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystemVersions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.operatingSystemVersions.list - * @desc Retrieves a list of operating system versions. - * @alias dfareporting.operatingSystemVersions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystemVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Orderdocuments { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.orderDocuments.get - * @desc Gets one order document by ID. - * @alias dfareporting.orderDocuments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Order document ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.orderDocuments.list - * @desc Retrieves a list of order documents, possibly filtered. This method - * supports paging. - * @alias dfareporting.orderDocuments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.approved Select only order documents that have been approved by at least one user. - * @param {string=} params.ids Select only order documents with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.orderId Select only order documents for specified orders. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for order documents. - * @param {string=} params.searchString Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". - * @param {string=} params.siteId Select only order documents that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orderDocuments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Orders { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.orders.get - * @desc Gets one order by ID. - * @alias dfareporting.orders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Order ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for orders. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orders/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId', 'id'], - pathParams: ['id', 'profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.orders.list - * @desc Retrieves a list of orders, possibly filtered. This method supports - * paging. - * @alias dfareporting.orders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only orders with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.projectId Project ID for orders. - * @param {string=} params.searchString Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". - * @param {string=} params.siteId Select only orders that are associated with these site IDs. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'projectId'], - pathParams: ['profileId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placementgroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placementGroups.get - * @desc Gets one placement group by ID. - * @alias dfareporting.placementGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.insert - * @desc Inserts a new placement group. - * @alias dfareporting.placementGroups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.list - * @desc Retrieves a list of placement groups, possibly filtered. This method - * supports paging. - * @alias dfareporting.placementGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only placement groups that belong to these advertisers. - * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. - * @param {string=} params.campaignIds Select only placement groups that belong to these campaigns. - * @param {string=} params.contentCategoryIds Select only placement groups that are associated with these content categories. - * @param {string=} params.directorySiteIds Select only placement groups that are associated with these directory sites. - * @param {string=} params.ids Select only placement groups with these IDs. - * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.placementGroupType Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. - * @param {string=} params.placementStrategyIds Select only placement groups that are associated with these placement strategies. - * @param {string=} params.pricingTypes Select only placement groups with these pricing types. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". - * @param {string=} params.siteIds Select only placement groups that are associated with these sites. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.patch - * @desc Updates an existing placement group. This method supports patch - * semantics. - * @alias dfareporting.placementGroups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementGroups.update - * @desc Updates an existing placement group. - * @alias dfareporting.placementGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementGroup} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placements { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placements.generatetags - * @desc Generates tags for a placement. - * @alias dfareporting.placements.generatetags - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.campaignId Generate placements belonging to this campaign. This is a required field. - * @param {string=} params.placementIds Generate tags for these placements. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.tagFormats Tag formats to generate for these placements. Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generatetags(params?: any, options?: MethodOptions): - AxiosPromise; - generatetags( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generatetags( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements/generatetags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.placements.get - * @desc Gets one placement by ID. - * @alias dfareporting.placements.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.insert - * @desc Inserts a new placement. - * @alias dfareporting.placements.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.list - * @desc Retrieves a list of placements, possibly filtered. This method - * supports paging. - * @alias dfareporting.placements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only placements that belong to these advertisers. - * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. - * @param {string=} params.campaignIds Select only placements that belong to these campaigns. - * @param {string=} params.compatibilities Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. - * @param {string=} params.contentCategoryIds Select only placements that are associated with these content categories. - * @param {string=} params.directorySiteIds Select only placements that are associated with these directory sites. - * @param {string=} params.groupIds Select only placements that belong to these placement groups. - * @param {string=} params.ids Select only placements with these IDs. - * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string=} params.paymentSource Select only placements with this payment source. - * @param {string=} params.placementStrategyIds Select only placements that are associated with these placement strategies. - * @param {string=} params.pricingTypes Select only placements with these pricing types. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". - * @param {string=} params.siteIds Select only placements that are associated with these sites. - * @param {string=} params.sizeIds Select only placements that are associated with these sizes. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.patch - * @desc Updates an existing placement. This method supports patch semantics. - * @alias dfareporting.placements.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placements.update - * @desc Updates an existing placement. - * @alias dfareporting.placements.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Placement} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Placementstrategies { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.placementStrategies.delete - * @desc Deletes an existing placement strategy. - * @alias dfareporting.placementStrategies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.get - * @desc Gets one placement strategy by ID. - * @alias dfareporting.placementStrategies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.insert - * @desc Inserts a new placement strategy. - * @alias dfareporting.placementStrategies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.list - * @desc Retrieves a list of placement strategies, possibly filtered. This - * method supports paging. - * @alias dfareporting.placementStrategies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only placement strategies with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dfareporting.placementStrategies.patch - * @desc Updates an existing placement strategy. This method supports patch - * semantics. - * @alias dfareporting.placementStrategies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Placement strategy ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.placementStrategies.update - * @desc Updates an existing placement strategy. - * @alias dfareporting.placementStrategies.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().PlacementStrategy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Platformtypes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.platformTypes.get - * @desc Gets one platform type by ID. - * @alias dfareporting.platformTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Platform type ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/platformTypes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.platformTypes.list - * @desc Retrieves a list of platform types. - * @alias dfareporting.platformTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/platformTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Postalcodes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.postalCodes.get - * @desc Gets one postal code by ID. - * @alias dfareporting.postalCodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.code Postal code ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/postalCodes/{code}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'code'], - pathParams: ['code', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.postalCodes.list - * @desc Retrieves a list of postal codes. - * @alias dfareporting.postalCodes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/postalCodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.projects.get - * @desc Gets one project by ID. - * @alias dfareporting.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Project ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.projects.list - * @desc Retrieves a list of projects, possibly filtered. This method supports - * paging. - * @alias dfareporting.projects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserIds Select only projects with these advertiser IDs. - * @param {string=} params.ids Select only projects with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/projects') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Regions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.regions.list - * @desc Retrieves a list of regions. - * @alias dfareporting.regions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/regions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Remarketinglists { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.remarketingLists.get - * @desc Gets one remarketing list by ID. - * @alias dfareporting.remarketingLists.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.insert - * @desc Inserts a new remarketing list. - * @alias dfareporting.remarketingLists.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.list - * @desc Retrieves a list of remarketing lists, possibly filtered. This method - * supports paging. - * @alias dfareporting.remarketingLists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active or only inactive remarketing lists. - * @param {string} params.advertiserId Select only remarketing lists owned by this advertiser. - * @param {string=} params.floodlightActivityId Select only remarketing lists that have this floodlight activity ID. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.patch - * @desc Updates an existing remarketing list. This method supports patch - * semantics. - * @alias dfareporting.remarketingLists.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingLists.update - * @desc Updates an existing remarketing list. - * @alias dfareporting.remarketingLists.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Remarketinglistshares { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.remarketingListShares.get - * @desc Gets one remarketing list share by remarketing list ID. - * @alias dfareporting.remarketingListShares.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.remarketingListId Remarketing list ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares/{remarketingListId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'remarketingListId'], - pathParams: ['profileId', 'remarketingListId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingListShares.patch - * @desc Updates an existing remarketing list share. This method supports - * patch semantics. - * @alias dfareporting.remarketingListShares.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {string} params.remarketingListId Remarketing list ID. - * @param {().RemarketingListShare} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'remarketingListId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.remarketingListShares.update - * @desc Updates an existing remarketing list share. - * @alias dfareporting.remarketingListShares.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().RemarketingListShare} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports { - root: Dfareporting; - compatibleFields: Resource$Reports$Compatiblefields; - files: Resource$Reports$Files; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - this.compatibleFields = new Resource$Reports$Compatiblefields(root); - this.files = new Resource$Reports$Files(root); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.delete - * @desc Deletes a report by its ID. - * @alias dfareporting.reports.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.get - * @desc Retrieves a report by its ID. - * @alias dfareporting.reports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.insert - * @desc Creates a report. - * @alias dfareporting.reports.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.list - * @desc Retrieves list of reports. - * @alias dfareporting.reports.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA user profile ID. - * @param {string=} params.scope The scope that defines which results are returned. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.patch - * @desc Updates a report. This method supports patch semantics. - * @alias dfareporting.reports.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.run - * @desc Runs a report. - * @alias dfareporting.reports.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the report. - * @param {boolean=} params.synchronous If set and true, tries to run the report synchronously. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.update - * @desc Updates a report. - * @alias dfareporting.reports.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {string} params.reportId The ID of the report. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Reports$Compatiblefields { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.compatibleFields.query - * @desc Returns the fields that are compatible to be selected in the - * respective sections of a report criteria, given the fields already selected - * in the input report and user permissions. - * @alias dfareporting.reports.compatibleFields.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The DFA user profile ID. - * @param {().Report} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/compatiblefields/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Reports$Files { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.reports.files.get - * @desc Retrieves a report file. This method supports media download. - * @alias dfareporting.reports.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the report file. - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId', 'fileId'], - pathParams: ['fileId', 'profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.reports.files.list - * @desc Lists files for a report. - * @alias dfareporting.reports.files.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken The value of the nextToken from the previous result page. - * @param {string} params.profileId The DFA profile ID. - * @param {string} params.reportId The ID of the parent report. - * @param {string=} params.sortField The field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/files') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'reportId'], - pathParams: ['profileId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Sites { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.sites.get - * @desc Gets one site by ID. - * @alias dfareporting.sites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/sites/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.insert - * @desc Inserts a new site. - * @alias dfareporting.sites.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.list - * @desc Retrieves a list of sites, possibly filtered. This method supports - * paging. - * @alias dfareporting.sites.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. - * @param {boolean=} params.acceptsPublisherPaidPlacements Select only sites that accept publisher paid placements. - * @param {boolean=} params.adWordsSite Select only AdWords sites. - * @param {boolean=} params.approved Select only approved sites. - * @param {string=} params.campaignIds Select only sites with these campaign IDs. - * @param {string=} params.directorySiteIds Select only sites with these directory site IDs. - * @param {string=} params.ids Select only sites with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only sites with this subaccount ID. - * @param {boolean=} params.unmappedSite Select only sites that have not been mapped to a directory site. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.patch - * @desc Updates an existing site. This method supports patch semantics. - * @alias dfareporting.sites.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Site ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sites.update - * @desc Updates an existing site. - * @alias dfareporting.sites.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Site} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sizes { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.sizes.get - * @desc Gets one size by ID. - * @alias dfareporting.sizes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Size ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/sizes/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sizes.insert - * @desc Inserts a new size. - * @alias dfareporting.sizes.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Size} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sizes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.sizes.list - * @desc Retrieves a list of sizes, possibly filtered. - * @alias dfareporting.sizes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.height Select only sizes with this height. - * @param {boolean=} params.iabStandard Select only IAB standard sizes. - * @param {string=} params.ids Select only sizes with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {integer=} params.width Select only sizes with this width. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/sizes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subaccounts { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.subaccounts.get - * @desc Gets one subaccount by ID. - * @alias dfareporting.subaccounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Subaccount ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.insert - * @desc Inserts a new subaccount. - * @alias dfareporting.subaccounts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.list - * @desc Gets a list of subaccounts, possibly filtered. This method supports - * paging. - * @alias dfareporting.subaccounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only subaccounts with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.patch - * @desc Updates an existing subaccount. This method supports patch semantics. - * @alias dfareporting.subaccounts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Subaccount ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.subaccounts.update - * @desc Updates an existing subaccount. - * @alias dfareporting.subaccounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().Subaccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Targetableremarketinglists { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.targetableRemarketingLists.get - * @desc Gets one remarketing list by ID. - * @alias dfareporting.targetableRemarketingLists.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Remarketing list ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetableRemarketingLists/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetableRemarketingLists.list - * @desc Retrieves a list of targetable remarketing lists, possibly filtered. - * This method supports paging. - * @alias dfareporting.targetableRemarketingLists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.active Select only active or only inactive targetable remarketing lists. - * @param {string} params.advertiserId Select only targetable remarketing lists targetable by these advertisers. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetableRemarketingLists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'advertiserId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Targetingtemplates { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.targetingTemplates.get - * @desc Gets one targeting template by ID. - * @alias dfareporting.targetingTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Targeting template ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.insert - * @desc Inserts a new targeting template. - * @alias dfareporting.targetingTemplates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.list - * @desc Retrieves a list of targeting templates, optionally filtered. This - * method supports paging. - * @alias dfareporting.targetingTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.advertiserId Select only targeting templates with this advertiser ID. - * @param {string=} params.ids Select only targeting templates with these IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - +export namespace dfareporting_v3_0 { /** - * dfareporting.targetingTemplates.patch - * @desc Updates an existing targeting template. This method supports patch - * semantics. - * @alias dfareporting.targetingTemplates.patch - * @memberOf! () + * DCM/DFA Reporting And Trafficking API * - * @param {object} params Parameters for request - * @param {string} params.id Targeting template ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.targetingTemplates.update - * @desc Updates an existing targeting template. - * @alias dfareporting.targetingTemplates.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().TargetingTemplate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Userprofiles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userProfiles.get - * @desc Gets one user profile by ID. - * @alias dfareporting.userProfiles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId The user profile ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userProfiles.list - * @desc Retrieves list of user profiles for a user. - * @alias dfareporting.userProfiles.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dfareporting/v3.0/userprofiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Userrolepermissiongroups { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRolePermissionGroups.get - * @desc Gets one user role permission group by ID. - * @alias dfareporting.userRolePermissionGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role permission group ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissionGroups/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRolePermissionGroups.list - * @desc Gets a list of all supported user role permission groups. - * @alias dfareporting.userRolePermissionGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissionGroups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Userrolepermissions { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRolePermissions.get - * @desc Gets one user role permission by ID. - * @alias dfareporting.userRolePermissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role permission ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRolePermissions.list - * @desc Gets a list of user role permissions, possibly filtered. - * @alias dfareporting.userRolePermissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids Select only user role permissions with these IDs. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Userroles { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.userRoles.delete - * @desc Deletes an existing user role. - * @alias dfareporting.userRoles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.get - * @desc Gets one user role by ID. - * @alias dfareporting.userRoles.get - * @memberOf! () + * Manages your DoubleClick Campaign Manager ad campaigns and reports. * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.insert - * @desc Inserts a new user role. - * @alias dfareporting.userRoles.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const dfareporting = google.dfareporting('v3.0'); * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace dfareporting + * @type {Function} + * @version v3.0 + * @variation v3.0 + * @param {object=} options Options for Dfareporting + */ + export class Dfareporting { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accountActiveAdSummaries: Resource$Accountactiveadsummaries; + accountPermissionGroups: Resource$Accountpermissiongroups; + accountPermissions: Resource$Accountpermissions; + accounts: Resource$Accounts; + accountUserProfiles: Resource$Accountuserprofiles; + ads: Resource$Ads; + advertiserGroups: Resource$Advertisergroups; + advertiserLandingPages: Resource$Advertiserlandingpages; + advertisers: Resource$Advertisers; + browsers: Resource$Browsers; + campaignCreativeAssociations: Resource$Campaigncreativeassociations; + campaigns: Resource$Campaigns; + changeLogs: Resource$Changelogs; + cities: Resource$Cities; + connectionTypes: Resource$Connectiontypes; + contentCategories: Resource$Contentcategories; + conversions: Resource$Conversions; + countries: Resource$Countries; + creativeAssets: Resource$Creativeassets; + creativeFields: Resource$Creativefields; + creativeFieldValues: Resource$Creativefieldvalues; + creativeGroups: Resource$Creativegroups; + creatives: Resource$Creatives; + dimensionValues: Resource$Dimensionvalues; + directorySiteContacts: Resource$Directorysitecontacts; + directorySites: Resource$Directorysites; + dynamicTargetingKeys: Resource$Dynamictargetingkeys; + eventTags: Resource$Eventtags; + files: Resource$Files; + floodlightActivities: Resource$Floodlightactivities; + floodlightActivityGroups: Resource$Floodlightactivitygroups; + floodlightConfigurations: Resource$Floodlightconfigurations; + inventoryItems: Resource$Inventoryitems; + languages: Resource$Languages; + metros: Resource$Metros; + mobileCarriers: Resource$Mobilecarriers; + operatingSystems: Resource$Operatingsystems; + operatingSystemVersions: Resource$Operatingsystemversions; + orderDocuments: Resource$Orderdocuments; + orders: Resource$Orders; + placementGroups: Resource$Placementgroups; + placements: Resource$Placements; + placementStrategies: Resource$Placementstrategies; + platformTypes: Resource$Platformtypes; + postalCodes: Resource$Postalcodes; + projects: Resource$Projects; + regions: Resource$Regions; + remarketingLists: Resource$Remarketinglists; + remarketingListShares: Resource$Remarketinglistshares; + reports: Resource$Reports; + sites: Resource$Sites; + sizes: Resource$Sizes; + subaccounts: Resource$Subaccounts; + targetableRemarketingLists: Resource$Targetableremarketinglists; + targetingTemplates: Resource$Targetingtemplates; + userProfiles: Resource$Userprofiles; + userRolePermissionGroups: Resource$Userrolepermissiongroups; + userRolePermissions: Resource$Userrolepermissions; + userRoles: Resource$Userroles; + videoFormats: Resource$Videoformats; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accountActiveAdSummaries = + new Resource$Accountactiveadsummaries(this); + this.accountPermissionGroups = new Resource$Accountpermissiongroups(this); + this.accountPermissions = new Resource$Accountpermissions(this); + this.accounts = new Resource$Accounts(this); + this.accountUserProfiles = new Resource$Accountuserprofiles(this); + this.ads = new Resource$Ads(this); + this.advertiserGroups = new Resource$Advertisergroups(this); + this.advertiserLandingPages = new Resource$Advertiserlandingpages(this); + this.advertisers = new Resource$Advertisers(this); + this.browsers = new Resource$Browsers(this); + this.campaignCreativeAssociations = + new Resource$Campaigncreativeassociations(this); + this.campaigns = new Resource$Campaigns(this); + this.changeLogs = new Resource$Changelogs(this); + this.cities = new Resource$Cities(this); + this.connectionTypes = new Resource$Connectiontypes(this); + this.contentCategories = new Resource$Contentcategories(this); + this.conversions = new Resource$Conversions(this); + this.countries = new Resource$Countries(this); + this.creativeAssets = new Resource$Creativeassets(this); + this.creativeFields = new Resource$Creativefields(this); + this.creativeFieldValues = new Resource$Creativefieldvalues(this); + this.creativeGroups = new Resource$Creativegroups(this); + this.creatives = new Resource$Creatives(this); + this.dimensionValues = new Resource$Dimensionvalues(this); + this.directorySiteContacts = new Resource$Directorysitecontacts(this); + this.directorySites = new Resource$Directorysites(this); + this.dynamicTargetingKeys = new Resource$Dynamictargetingkeys(this); + this.eventTags = new Resource$Eventtags(this); + this.files = new Resource$Files(this); + this.floodlightActivities = new Resource$Floodlightactivities(this); + this.floodlightActivityGroups = + new Resource$Floodlightactivitygroups(this); + this.floodlightConfigurations = + new Resource$Floodlightconfigurations(this); + this.inventoryItems = new Resource$Inventoryitems(this); + this.languages = new Resource$Languages(this); + this.metros = new Resource$Metros(this); + this.mobileCarriers = new Resource$Mobilecarriers(this); + this.operatingSystems = new Resource$Operatingsystems(this); + this.operatingSystemVersions = new Resource$Operatingsystemversions(this); + this.orderDocuments = new Resource$Orderdocuments(this); + this.orders = new Resource$Orders(this); + this.placementGroups = new Resource$Placementgroups(this); + this.placements = new Resource$Placements(this); + this.placementStrategies = new Resource$Placementstrategies(this); + this.platformTypes = new Resource$Platformtypes(this); + this.postalCodes = new Resource$Postalcodes(this); + this.projects = new Resource$Projects(this); + this.regions = new Resource$Regions(this); + this.remarketingLists = new Resource$Remarketinglists(this); + this.remarketingListShares = new Resource$Remarketinglistshares(this); + this.reports = new Resource$Reports(this); + this.sites = new Resource$Sites(this); + this.sizes = new Resource$Sizes(this); + this.subaccounts = new Resource$Subaccounts(this); + this.targetableRemarketingLists = + new Resource$Targetableremarketinglists(this); + this.targetingTemplates = new Resource$Targetingtemplates(this); + this.userProfiles = new Resource$Userprofiles(this); + this.userRolePermissionGroups = + new Resource$Userrolepermissiongroups(this); + this.userRolePermissions = new Resource$Userrolepermissions(this); + this.userRoles = new Resource$Userroles(this); + this.videoFormats = new Resource$Videoformats(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Contains properties of a DCM account. + */ + export interface Schema$Account { + /** + * Account permissions assigned to this account. + */ + accountPermissionIds: string[]; + /** + * Profile for this account. This is a read-only field that can be left + * blank. + */ + accountProfile: string; + /** + * Whether this account is active. + */ + active: boolean; + /** + * Maximum number of active ads allowed for this account. + */ + activeAdsLimitTier: string; + /** + * Whether to serve creatives with Active View tags. If disabled, + * viewability data will not be available for any impressions. + */ + activeViewOptOut: boolean; + /** + * User role permissions available to the user roles of this account. + */ + availablePermissionIds: string[]; + /** + * ID of the country associated with this account. + */ + countryId: string; + /** + * ID of currency associated with this account. This is a required field. + * Acceptable values are: - "1" for USD - "2" for GBP + * - "3" for ESP - "4" for SEK - "5" for CAD + * - "6" for JPY - "7" for DEM - "8" for AUD + * - "9" for FRF - "10" for ITL - "11" for + * DKK - "12" for NOK - "13" for FIM - "14" + * for ZAR - "15" for IEP - "16" for NLG - + * "17" for EUR - "18" for KRW - "19" for + * TWD - "20" for SGD - "21" for CNY - "22" + * for HKD - "23" for NZD - "24" for MYR - + * "25" for BRL - "26" for PTE - "27" for + * MXP - "28" for CLP - "29" for TRY - "30" + * for ARS - "31" for PEN - "32" for ILS - + * "33" for CHF - "34" for VEF - "35" for + * COP - "36" for GTQ - "37" for PLN - "39" + * for INR - "40" for THB - "41" for IDR - + * "42" for CZK - "43" for RON - "44" for + * HUF - "45" for RUB - "46" for AED - "47" + * for BGN - "48" for HRK - "49" for MXN - + * "50" for NGN + */ + currencyId: string; + /** + * Default placement dimensions for this account. + */ + defaultCreativeSizeId: string; + /** + * Description of this account. + */ + description: string; + /** + * ID of this account. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#account". + */ + kind: string; + /** + * Locale of this account. Acceptable values are: - "cs" (Czech) + * - "de" (German) - "en" (English) - + * "en-GB" (English United Kingdom) - "es" (Spanish) - + * "fr" (French) - "it" (Italian) - "ja" + * (Japanese) - "ko" (Korean) - "pl" (Polish) - + * "pt-BR" (Portuguese Brazil) - "ru" (Russian) - + * "sv" (Swedish) - "tr" (Turkish) - "zh-CN" + * (Chinese Simplified) - "zh-TW" (Chinese Traditional) + */ + locale: string; + /** + * Maximum image size allowed for this account, in kilobytes. Value must be + * greater than or equal to 1. + */ + maximumImageSize: string; + /** + * Name of this account. This is a required field, and must be less than 128 + * characters long and be globally unique. + */ + name: string; + /** + * Whether campaigns created in this account will be enabled for Nielsen OCR + * reach ratings by default. + */ + nielsenOcrEnabled: boolean; + /** + * Reporting configuration of this account. + */ + reportsConfiguration: Schema$ReportsConfiguration; + /** + * Share Path to Conversion reports with Twitter. + */ + shareReportsWithTwitter: boolean; + /** + * File size limit in kilobytes of Rich Media teaser creatives. Acceptable + * values are 1 to 10240, inclusive. + */ + teaserSizeLimit: string; + } + /** + * Gets a summary of active ads in an account. + */ + export interface Schema$AccountActiveAdSummary { + /** + * ID of the account. + */ + accountId: string; + /** + * Ads that have been activated for the account + */ + activeAds: string; + /** + * Maximum number of active ads allowed for the account. + */ + activeAdsLimitTier: string; + /** + * Ads that can be activated for the account. + */ + availableAds: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountActiveAdSummary". + */ + kind: string; + } + /** + * AccountPermissions contains information about a particular account + * permission. Some features of DCM require an account permission to be + * present in the account. + */ + export interface Schema$AccountPermission { + /** + * Account profiles associated with this account permission. Possible + * values are: - "ACCOUNT_PROFILE_BASIC" - + * "ACCOUNT_PROFILE_STANDARD" + */ + accountProfiles: string[]; + /** + * ID of this account permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermission". + */ + kind: string; + /** + * Administrative level required to enable this account permission. + */ + level: string; + /** + * Name of this account permission. + */ + name: string; + /** + * Permission group of this account permission. + */ + permissionGroupId: string; + } + /** + * AccountPermissionGroups contains a mapping of permission group IDs to + * names. A permission group is a grouping of account permissions. + */ + export interface Schema$AccountPermissionGroup { + /** + * ID of this account permission group. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionGroup". + */ + kind: string; + /** + * Name of this account permission group. + */ + name: string; + } + /** + * Account Permission Group List Response + */ + export interface Schema$AccountPermissionGroupsListResponse { + /** + * Account permission group collection. + */ + accountPermissionGroups: Schema$AccountPermissionGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionGroupsListResponse". + */ + kind: string; + } + /** + * Account Permission List Response + */ + export interface Schema$AccountPermissionsListResponse { + /** + * Account permission collection. + */ + accountPermissions: Schema$AccountPermission[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountPermissionsListResponse". + */ + kind: string; + } + /** + * Account List Response + */ + export interface Schema$AccountsListResponse { + /** + * Account collection. + */ + accounts: Schema$Account[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * AccountUserProfiles contains properties of a DCM user profile. This + * resource is specifically for managing user profiles, whereas UserProfiles + * is for accessing the API. + */ + export interface Schema$AccountUserProfile { + /** + * Account ID of the user profile. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Whether this user profile is active. This defaults to false, and must be + * set true on insert for the user profile to be usable. + */ + active: boolean; + /** + * Filter that describes which advertisers are visible to the user profile. + */ + advertiserFilter: Schema$ObjectFilter; + /** + * Filter that describes which campaigns are visible to the user profile. + */ + campaignFilter: Schema$ObjectFilter; + /** + * Comments for this user profile. + */ + comments: string; + /** + * Email of the user profile. The email addresss must be linked to a Google + * Account. This field is required on insertion and is read-only after + * insertion. + */ + email: string; + /** + * ID of the user profile. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountUserProfile". + */ + kind: string; + /** + * Locale of the user profile. This is a required field. Acceptable values + * are: - "cs" (Czech) - "de" (German) - + * "en" (English) - "en-GB" (English United Kingdom) - + * "es" (Spanish) - "fr" (French) - "it" + * (Italian) - "ja" (Japanese) - "ko" (Korean) - + * "pl" (Polish) - "pt-BR" (Portuguese Brazil) - + * "ru" (Russian) - "sv" (Swedish) - "tr" + * (Turkish) - "zh-CN" (Chinese Simplified) - "zh-TW" + * (Chinese Traditional) + */ + locale: string; + /** + * Name of the user profile. This is a required field. Must be less than 64 + * characters long, must be globally unique, and cannot contain whitespace + * or any of the following characters: "&;"#%,". + */ + name: string; + /** + * Filter that describes which sites are visible to the user profile. + */ + siteFilter: Schema$ObjectFilter; + /** + * Subaccount ID of the user profile. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Trafficker type of this user profile. + */ + traffickerType: string; + /** + * User type of the user profile. This is a read-only field that can be left + * blank. + */ + userAccessType: string; + /** + * Filter that describes which user roles are visible to the user profile. + */ + userRoleFilter: Schema$ObjectFilter; + /** + * User role ID of the user profile. This is a required field. + */ + userRoleId: string; + } + /** + * Account User Profile List Response + */ + export interface Schema$AccountUserProfilesListResponse { + /** + * Account user profile collection. + */ + accountUserProfiles: Schema$AccountUserProfile[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#accountUserProfilesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Represents an activity group. + */ + export interface Schema$Activities { + /** + * List of activity filters. The dimension values need to be all either of + * type "dfa:activity" or "dfa:activityGroup". + */ + filters: Schema$DimensionValue[]; + /** + * The kind of resource this is, in this case dfareporting#activities. + */ + kind: string; + /** + * List of names of floodlight activity metrics. + */ + metricNames: string[]; + } + /** + * Contains properties of a DCM ad. + */ + export interface Schema$Ad { + /** + * Account ID of this ad. This is a read-only field that can be left blank. + */ + accountId: string; + /** + * Whether this ad is active. When true, archived must be false. + */ + active: boolean; + /** + * Advertiser ID of this ad. This is a required field on insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this ad is archived. When true, active must be false. + */ + archived: boolean; + /** + * Audience segment ID that is being targeted for this ad. Applicable when + * type is AD_SERVING_STANDARD_AD. + */ + audienceSegmentId: string; + /** + * Campaign ID of this ad. This is a required field on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Click-through URL for this ad. This is a required field on insertion. + * Applicable when type is AD_SERVING_CLICK_TRACKER. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Click-through URL suffix properties for this ad. Applies to the URL in + * the ad or (if overriding ad properties) the URL in the creative. + */ + clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; + /** + * Comments for this ad. + */ + comments: string; + /** + * Compatibility of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + * DISPLAY and DISPLAY_INTERSTITIAL refer to either rendering on desktop or + * on mobile devices or in mobile apps for regular or interstitial ads, + * respectively. APP and APP_INTERSTITIAL are only used for existing default + * ads. New mobile placements must be assigned DISPLAY or + * DISPLAY_INTERSTITIAL and default ads created for those placements will be + * limited to those compatibility types. IN_STREAM_VIDEO refers to rendering + * in-stream video ads developed with the VAST standard. + */ + compatibility: string; + /** + * Information about the creation of this ad. This is a read-only field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Creative group assignments for this ad. Applicable when type is + * AD_SERVING_CLICK_TRACKER. Only one assignment per creative group number + * is allowed for a maximum of two assignments. + */ + creativeGroupAssignments: Schema$CreativeGroupAssignment[]; + /** + * Creative rotation for this ad. Applicable when type is + * AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or AD_SERVING_TRACKING. + * When type is AD_SERVING_DEFAULT_AD, this field should have exactly one + * creativeAssignment. + */ + creativeRotation: Schema$CreativeRotation; + /** + * Time and day targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + dayPartTargeting: Schema$DayPartTargeting; + /** + * Default click-through event tag properties for this ad. + */ + defaultClickThroughEventTagProperties: + Schema$DefaultClickThroughEventTagProperties; + /** + * Delivery schedule information for this ad. Applicable when type is + * AD_SERVING_STANDARD_AD or AD_SERVING_TRACKING. This field along with + * subfields priority and impressionRatio are required on insertion when + * type is AD_SERVING_STANDARD_AD. + */ + deliverySchedule: Schema$DeliverySchedule; + /** + * Whether this ad is a dynamic click tracker. Applicable when type is + * AD_SERVING_CLICK_TRACKER. This is a required field on insert, and is + * read-only after insert. + */ + dynamicClickTracker: boolean; + /** + * Date and time that this ad should stop serving. Must be later than the + * start time. This is a required field on insertion. + */ + endTime: string; + /** + * Event tag overrides for this ad. + */ + eventTagOverrides: Schema$EventTagOverride[]; + /** + * Geographical targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + geoTargeting: Schema$GeoTargeting; + /** + * ID of this ad. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this ad. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key-value targeting information for this ad. This field must be left + * blank if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + keyValueTargetingExpression: Schema$KeyValueTargetingExpression; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#ad". + */ + kind: string; + /** + * Language targeting information for this ad. This field must be left blank + * if the ad is using a targeting template. Applicable when type is + * AD_SERVING_STANDARD_AD. + */ + languageTargeting: Schema$LanguageTargeting; + /** + * Information about the most recent modification of this ad. This is a + * read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this ad. This is a required field and must be less than 256 + * characters long. + */ + name: string; + /** + * Placement assignments for this ad. + */ + placementAssignments: Schema$PlacementAssignment[]; + /** + * Remarketing list targeting expression for this ad. This field must be + * left blank if the ad is using a targeting template. Applicable when type + * is AD_SERVING_STANDARD_AD. + */ + remarketingListExpression: Schema$ListTargetingExpression; + /** + * Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD. + */ + size: Schema$Size; + /** + * Whether this ad is ssl compliant. This is a read-only field that is + * auto-generated when the ad is inserted or updated. + */ + sslCompliant: boolean; + /** + * Whether this ad requires ssl. This is a read-only field that is + * auto-generated when the ad is inserted or updated. + */ + sslRequired: boolean; + /** + * Date and time that this ad should start serving. If creating an ad, this + * field must be a time in the future. This is a required field on + * insertion. + */ + startTime: string; + /** + * Subaccount ID of this ad. This is a read-only field that can be left + * blank. + */ + subaccountId: string; + /** + * Targeting template ID, used to apply preconfigured targeting information + * to this ad. This cannot be set while any of dayPartTargeting, + * geoTargeting, keyValueTargetingExpression, languageTargeting, + * remarketingListExpression, or technologyTargeting are set. Applicable + * when type is AD_SERVING_STANDARD_AD. + */ + targetingTemplateId: string; + /** + * Technology platform targeting information for this ad. This field must be + * left blank if the ad is using a targeting template. Applicable when type + * is AD_SERVING_STANDARD_AD. + */ + technologyTargeting: Schema$TechnologyTargeting; + /** + * Type of ad. This is a required field on insertion. Note that default ads + * (AD_SERVING_DEFAULT_AD) cannot be created directly (see Creative + * resource). + */ + type: string; + } + /** + * Campaign ad blocking settings. + */ + export interface Schema$AdBlockingConfiguration { + /** + * Click-through URL used by brand-neutral ads. This is a required field + * when overrideClickThroughUrl is set to true. + */ + clickThroughUrl: string; + /** + * ID of a creative bundle to use for this campaign. If set, brand-neutral + * ads will select creatives from this bundle. Otherwise, a default + * transparent pixel will be used. + */ + creativeBundleId: string; + /** + * Whether this campaign has enabled ad blocking. When true, ad blocking is + * enabled for placements in the campaign, but this may be overridden by + * site and placement settings. When false, ad blocking is disabled for all + * placements under the campaign, regardless of site and placement settings. + */ + enabled: boolean; + /** + * Whether the brand-neutral ad's click-through URL comes from the + * campaign's creative bundle or the override URL. Must be set to true + * if ad blocking is enabled and no creative bundle is configured. + */ + overrideClickThroughUrl: boolean; + } + /** + * Ad List Response + */ + export interface Schema$AdsListResponse { + /** + * Ad collection. + */ + ads: Schema$Ad[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#adsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Ad Slot + */ + export interface Schema$AdSlot { + /** + * Comment for this ad slot. + */ + comment: string; + /** + * Ad slot compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to + * rendering either on desktop, mobile devices or in mobile apps for regular + * or interstitial ads respectively. APP and APP_INTERSTITIAL are for + * rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in + * in-stream video ads developed with the VAST standard. + */ + compatibility: string; + /** + * Height of this ad slot. + */ + height: string; + /** + * ID of the placement from an external platform that is linked to this ad + * slot. + */ + linkedPlacementId: string; + /** + * Name of this ad slot. + */ + name: string; + /** + * Payment source type of this ad slot. + */ + paymentSourceType: string; + /** + * Primary ad slot of a roadblock inventory item. + */ + primary: boolean; + /** + * Width of this ad slot. + */ + width: string; + } + /** + * Contains properties of a DCM advertiser. + */ + export interface Schema$Advertiser { + /** + * Account ID of this advertiser.This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * ID of the advertiser group this advertiser belongs to. You can group + * advertisers for reporting purposes, allowing you to see aggregated + * information for all advertisers in each group. + */ + advertiserGroupId: string; + /** + * Suffix added to click-through URL of ad creative associations under this + * advertiser. Must be less than 129 characters long. + */ + clickThroughUrlSuffix: string; + /** + * ID of the click-through event tag to apply by default to the landing + * pages of this advertiser's campaigns. + */ + defaultClickThroughEventTagId: string; + /** + * Default email address used in sender field for tag emails. + */ + defaultEmail: string; + /** + * Floodlight configuration ID of this advertiser. The floodlight + * configuration ID will be created automatically, so on insert this field + * should be left blank. This field can be set to another advertiser's + * floodlight configuration ID in order to share that advertiser's + * floodlight configuration with this advertiser, so long as: - This + * advertiser's original floodlight configuration is not already + * associated with floodlight activities or floodlight activity groups. - + * This advertiser's original floodlight configuration is not already + * shared with another advertiser. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * ID of this advertiser. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this advertiser. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiser". + */ + kind: string; + /** + * Name of this advertiser. This is a required field and must be less than + * 256 characters long and unique among advertisers of the same account. + */ + name: string; + /** + * Original floodlight configuration before any sharing occurred. Set the + * floodlightConfigurationId of this advertiser to + * originalFloodlightConfigurationId to unshare the advertiser's current + * floodlight configuration. You cannot unshare an advertiser's + * floodlight configuration if the shared configuration has activities + * associated with any campaign or placement. + */ + originalFloodlightConfigurationId: string; + /** + * Status of this advertiser. + */ + status: string; + /** + * Subaccount ID of this advertiser.This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Suspension status of this advertiser. + */ + suspended: boolean; + } + /** + * Groups advertisers together so that reports can be generated for the entire + * group at once. + */ + export interface Schema$AdvertiserGroup { + /** + * Account ID of this advertiser group. This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this advertiser group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiserGroup". + */ + kind: string; + /** + * Name of this advertiser group. This is a required field and must be less + * than 256 characters long and unique among advertiser groups of the same + * account. + */ + name: string; + } + /** + * Advertiser Group List Response + */ + export interface Schema$AdvertiserGroupsListResponse { + /** + * Advertiser group collection. + */ + advertiserGroups: Schema$AdvertiserGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiserGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Landing Page List Response + */ + export interface Schema$AdvertiserLandingPagesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertiserLandingPagesListResponse". + */ + kind: string; + /** + * Landing page collection + */ + landingPages: Schema$LandingPage[]; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Advertiser List Response + */ + export interface Schema$AdvertisersListResponse { + /** + * Advertiser collection. + */ + advertisers: Schema$Advertiser[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#advertisersListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Audience Segment. + */ + export interface Schema$AudienceSegment { + /** + * Weight allocated to this segment. The weight assigned will be understood + * in proportion to the weights assigned to other segments in the same + * segment group. Acceptable values are 1 to 1000, inclusive. + */ + allocation: number; + /** + * ID of this audience segment. This is a read-only, auto-generated field. + */ + id: string; + /** + * Name of this audience segment. This is a required field and must be less + * than 65 characters long. + */ + name: string; + } + /** + * Audience Segment Group. + */ + export interface Schema$AudienceSegmentGroup { + /** + * Audience segments assigned to this group. The number of segments must be + * between 2 and 100. + */ + audienceSegments: Schema$AudienceSegment[]; + /** + * ID of this audience segment group. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Name of this audience segment group. This is a required field and must be + * less than 65 characters long. + */ + name: string; + } + /** + * Contains information about a browser that can be targeted by ads. + */ + export interface Schema$Browser { + /** + * ID referring to this grouping of browser and version numbers. This is the + * ID used for targeting. + */ + browserVersionId: string; + /** + * DART ID of this browser. This is the ID used when generating reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#browser". + */ + kind: string; + /** + * Major version number (leftmost number) of this browser. For example, for + * Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) + * may be used to target any version number, and a question mark (?) may be + * used to target cases where the version number cannot be identified. For + * example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so + * on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets + * cases where the ad server knows the browser is Firefox but can't tell + * which version it is. + */ + majorVersion: string; + /** + * Minor version number (number after first dot on left) of this browser. + * For example, for Chrome 5.0.375.86 beta, this field should be set to 0. + * An asterisk (*) may be used to target any version number, and a question + * mark (?) may be used to target cases where the version number cannot be + * identified. For example, Chrome *.* targets any version of Chrome: + * 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but + * not 4.0. Firefox ?.? targets cases where the ad server knows the browser + * is Firefox but can't tell which version it is. + */ + minorVersion: string; + /** + * Name of this browser. + */ + name: string; + } + /** + * Browser List Response + */ + export interface Schema$BrowsersListResponse { + /** + * Browser collection. + */ + browsers: Schema$Browser[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#browsersListResponse". + */ + kind: string; + } + /** + * Contains properties of a DCM campaign. + */ + export interface Schema$Campaign { + /** + * Account ID of this campaign. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Ad blocking settings for this campaign. + */ + adBlockingConfiguration: Schema$AdBlockingConfiguration; + /** + * Additional creative optimization configurations for the campaign. + */ + additionalCreativeOptimizationConfigurations: + Schema$CreativeOptimizationConfiguration[]; + /** + * Advertiser group ID of the associated advertiser. + */ + advertiserGroupId: string; + /** + * Advertiser ID of this campaign. This is a required field. + */ + advertiserId: string; + /** + * Dimension value for the advertiser ID of this campaign. This is a + * read-only, auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this campaign has been archived. + */ + archived: boolean; + /** + * Audience segment groups assigned to this campaign. Cannot have more than + * 300 segment groups. + */ + audienceSegmentGroups: Schema$AudienceSegmentGroup[]; + /** + * Billing invoice code included in the DCM client billing invoices + * associated with the campaign. + */ + billingInvoiceCode: string; + /** + * Click-through URL suffix override properties for this campaign. + */ + clickThroughUrlSuffixProperties: Schema$ClickThroughUrlSuffixProperties; + /** + * Arbitrary comments about this campaign. Must be less than 256 characters + * long. + */ + comment: string; + /** + * Information about the creation of this campaign. This is a read-only + * field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * List of creative group IDs that are assigned to the campaign. + */ + creativeGroupIds: string[]; + /** + * Creative optimization configuration for the campaign. + */ + creativeOptimizationConfiguration: Schema$CreativeOptimizationConfiguration; + /** + * Click-through event tag ID override properties for this campaign. + */ + defaultClickThroughEventTagProperties: + Schema$DefaultClickThroughEventTagProperties; + /** + * The default landing page ID for this campaign. + */ + defaultLandingPageId: string; + /** + * Date on which the campaign will stop running. On insert, the end date + * must be today or a future date. The end date must be later than or be the + * same as the start date. If, for example, you set 6/25/2015 as both the + * start and end dates, the effective campaign run date is just that day + * only, 6/25/2015. The hours, minutes, and seconds of the end date should + * not be set, as doing so will result in an error. This is a required + * field. + */ + endDate: string; + /** + * Overrides that can be used to activate or deactivate advertiser event + * tags. + */ + eventTagOverrides: Schema$EventTagOverride[]; + /** + * External ID for this campaign. + */ + externalId: string; + /** + * ID of this campaign. This is a read-only auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this campaign. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaign". + */ + kind: string; + /** + * Information about the most recent modification of this campaign. This is + * a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Lookback window settings for the campaign. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Name of this campaign. This is a required field and must be less than 256 + * characters long and unique among campaigns of the same advertiser. + */ + name: string; + /** + * Whether Nielsen reports are enabled for this campaign. + */ + nielsenOcrEnabled: boolean; + /** + * Date on which the campaign starts running. The start date can be any + * date. The hours, minutes, and seconds of the start date should not be + * set, as doing so will result in an error. This is a required field. + */ + startDate: string; + /** + * Subaccount ID of this campaign. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Campaign trafficker contact emails. + */ + traffickerEmails: string[]; + } + /** + * Identifies a creative which has been associated with a given campaign. + */ + export interface Schema$CampaignCreativeAssociation { + /** + * ID of the creative associated with the campaign. This is a required + * field. + */ + creativeId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignCreativeAssociation". + */ + kind: string; + } + /** + * Campaign Creative Association List Response + */ + export interface Schema$CampaignCreativeAssociationsListResponse { + /** + * Campaign creative association collection + */ + campaignCreativeAssociations: Schema$CampaignCreativeAssociation[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignCreativeAssociationsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Campaign List Response + */ + export interface Schema$CampaignsListResponse { + /** + * Campaign collection. + */ + campaigns: Schema$Campaign[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#campaignsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Describes a change that a user has made to a resource. + */ + export interface Schema$ChangeLog { + /** + * Account ID of the modified object. + */ + accountId: string; + /** + * Action which caused the change. + */ + action: string; + /** + * Time when the object was modified. + */ + changeTime: string; + /** + * Field name of the object which changed. + */ + fieldName: string; + /** + * ID of this change log. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#changeLog". + */ + kind: string; + /** + * New value of the object field. + */ + newValue: string; + /** + * ID of the object of this change log. The object could be a campaign, + * placement, ad, or other type. + */ + objectId: string; + /** + * Object type of the change log. + */ + objectType: string; + /** + * Old value of the object field. + */ + oldValue: string; + /** + * Subaccount ID of the modified object. + */ + subaccountId: string; + /** + * Transaction ID of this change log. When a single API call results in many + * changes, each change will have a separate ID in the change log but will + * share the same transactionId. + */ + transactionId: string; + /** + * ID of the user who modified the object. + */ + userProfileId: string; + /** + * User profile name of the user who modified the object. + */ + userProfileName: string; + } + /** + * Change Log List Response + */ + export interface Schema$ChangeLogsListResponse { + /** + * Change log collection. + */ + changeLogs: Schema$ChangeLog[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#changeLogsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * City List Response + */ + export interface Schema$CitiesListResponse { + /** + * City collection. + */ + cities: Schema$City[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#citiesListResponse". + */ + kind: string; + } + /** + * Contains information about a city that can be targeted by ads. + */ + export interface Schema$City { + /** + * Country code of the country to which this city belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this city belongs. + */ + countryDartId: string; + /** + * DART ID of this city. This is the ID used for targeting and generating + * reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#city". + */ + kind: string; + /** + * Metro region code of the metro region (DMA) to which this city belongs. + */ + metroCode: string; + /** + * ID of the metro region (DMA) to which this city belongs. + */ + metroDmaId: string; + /** + * Name of this city. + */ + name: string; + /** + * Region code of the region to which this city belongs. + */ + regionCode: string; + /** + * DART ID of the region to which this city belongs. + */ + regionDartId: string; + } + /** + * Creative Click Tag. + */ + export interface Schema$ClickTag { + /** + * Parameter value for the specified click tag. This field contains a + * click-through url. + */ + clickThroughUrl: Schema$CreativeClickThroughUrl; + /** + * Advertiser event name associated with the click tag. This field is used + * by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + eventName: string; + /** + * Parameter name for the specified click tag. For DISPLAY_IMAGE_GALLERY + * creative assets, this field must match the value of the creative + * asset's creativeAssetId.name field. + */ + name: string; + } + /** + * Click-through URL + */ + export interface Schema$ClickThroughUrl { + /** + * Read-only convenience field representing the actual URL that will be used + * for this click-through. The URL is computed as follows: - If + * defaultLandingPage is enabled then the campaign's default landing + * page URL is assigned to this field. - If defaultLandingPage is not + * enabled and a landingPageId is specified then that landing page's URL + * is assigned to this field. - If neither of the above cases apply, then + * the customClickThroughUrl is assigned to this field. + */ + computedClickThroughUrl: string; + /** + * Custom click-through URL. Applicable if the defaultLandingPage field is + * set to false and the landingPageId field is left unset. + */ + customClickThroughUrl: string; + /** + * Whether the campaign default landing page is used. + */ + defaultLandingPage: boolean; + /** + * ID of the landing page for the click-through URL. Applicable if the + * defaultLandingPage field is set to false. + */ + landingPageId: string; + } + /** + * Click Through URL Suffix settings. + */ + export interface Schema$ClickThroughUrlSuffixProperties { + /** + * Click-through URL suffix to apply to all ads in this entity's scope. + * Must be less than 128 characters long. + */ + clickThroughUrlSuffix: string; + /** + * Whether this entity should override the inherited click-through URL + * suffix with its own defined value. + */ + overrideInheritedSuffix: boolean; + } + /** + * Companion Click-through override. + */ + export interface Schema$CompanionClickThroughOverride { + /** + * Click-through URL of this companion click-through override. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * ID of the creative for this companion click-through override. + */ + creativeId: string; + } + /** + * Companion Settings + */ + export interface Schema$CompanionSetting { + /** + * Whether companions are disabled for this placement. + */ + companionsDisabled: boolean; + /** + * Whitelist of companion sizes to be served to this placement. Set this + * list to null or empty to serve all companion sizes. + */ + enabledSizes: Schema$Size[]; + /** + * Whether to serve only static images as companions. + */ + imageOnly: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#companionSetting". + */ + kind: string; + } + /** + * Represents a response to the queryCompatibleFields method. + */ + export interface Schema$CompatibleFields { + /** + * Contains items that are compatible to be selected for a report of type + * "CROSS_DIMENSION_REACH". + */ + crossDimensionReachReportCompatibleFields: + Schema$CrossDimensionReachReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "FLOODLIGHT". + */ + floodlightReportCompatibleFields: Schema$FloodlightReportCompatibleFields; + /** + * The kind of resource this is, in this case dfareporting#compatibleFields. + */ + kind: string; + /** + * Contains items that are compatible to be selected for a report of type + * "PATH_TO_CONVERSION". + */ + pathToConversionReportCompatibleFields: + Schema$PathToConversionReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "REACH". + */ + reachReportCompatibleFields: Schema$ReachReportCompatibleFields; + /** + * Contains items that are compatible to be selected for a report of type + * "STANDARD". + */ + reportCompatibleFields: Schema$ReportCompatibleFields; + } + /** + * Contains information about an internet connection type that can be targeted + * by ads. Clients can use the connection type to target mobile vs. broadband + * users. + */ + export interface Schema$ConnectionType { + /** + * ID of this connection type. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#connectionType". + */ + kind: string; + /** + * Name of this connection type. + */ + name: string; + } + /** + * Connection Type List Response + */ + export interface Schema$ConnectionTypesListResponse { + /** + * Collection of connection types such as broadband and mobile. + */ + connectionTypes: Schema$ConnectionType[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#connectionTypesListResponse". + */ + kind: string; + } + /** + * Content Category List Response + */ + export interface Schema$ContentCategoriesListResponse { + /** + * Content category collection. + */ + contentCategories: Schema$ContentCategory[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#contentCategoriesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Organizes placements according to the contents of their associated + * webpages. + */ + export interface Schema$ContentCategory { + /** + * Account ID of this content category. This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this content category. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#contentCategory". + */ + kind: string; + /** + * Name of this content category. This is a required field and must be less + * than 256 characters long and unique among content categories of the same + * account. + */ + name: string; + } + /** + * A Conversion represents when a user successfully performs a desired action + * after seeing an ad. + */ + export interface Schema$Conversion { + /** + * Whether the conversion was directed toward children. + */ + childDirectedTreatment: boolean; + /** + * Custom floodlight variables. + */ + customVariables: Schema$CustomFloodlightVariable[]; + /** + * The alphanumeric encrypted user ID. When set, encryptionInfo should also + * be specified. This field is mutually exclusive with + * encryptedUserIdCandidates[], mobileDeviceId and gclid. This or + * encryptedUserIdCandidates[] or mobileDeviceId or gclid is a required + * field. + */ + encryptedUserId: string; + /** + * A list of the alphanumeric encrypted user IDs. Any user ID with exposure + * prior to the conversion timestamp will be used in the inserted + * conversion. If no such user ID is found then the conversion will be + * rejected with NO_COOKIE_MATCH_FOUND error. When set, encryptionInfo + * should also be specified. This field may only be used when calling + * batchinsert; it is not supported by batchupdate. This field is mutually + * exclusive with encryptedUserId, mobileDeviceId and gclid. This or + * encryptedUserId or mobileDeviceId or gclid is a required field. + */ + encryptedUserIdCandidates: string[]; + /** + * Floodlight Activity ID of this conversion. This is a required field. + */ + floodlightActivityId: string; + /** + * Floodlight Configuration ID of this conversion. This is a required field. + */ + floodlightConfigurationId: string; + /** + * The Google click ID. This field is mutually exclusive with + * encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This or + * encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId is a + * required field. + */ + gclid: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversion". + */ + kind: string; + /** + * Whether Limit Ad Tracking is enabled. When set to true, the conversion + * will be used for reporting but not targeting. This will prevent + * remarketing. + */ + limitAdTracking: boolean; + /** + * The mobile device ID. This field is mutually exclusive with + * encryptedUserId, encryptedUserIdCandidates[] and gclid. This or + * encryptedUserId or encryptedUserIdCandidates[] or gclid is a required + * field. + */ + mobileDeviceId: string; + /** + * The ordinal of the conversion. Use this field to control how conversions + * of the same user and day are de-duplicated. This is a required field. + */ + ordinal: string; + /** + * The quantity of the conversion. + */ + quantity: string; + /** + * The timestamp of conversion, in Unix epoch micros. This is a required + * field. + */ + timestampMicros: string; + /** + * The value of the conversion. + */ + value: number; + } + /** + * The error code and description for a conversion that failed to insert or + * update. + */ + export interface Schema$ConversionError { + /** + * The error code. + */ + code: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionError". + */ + kind: string; + /** + * A description of the error. + */ + message: string; + } + /** + * Insert Conversions Request. + */ + export interface Schema$ConversionsBatchInsertRequest { + /** + * The set of conversions to insert. + */ + conversions: Schema$Conversion[]; + /** + * Describes how encryptedUserId or encryptedUserIdCandidates[] is + * encrypted. This is a required field if encryptedUserId or + * encryptedUserIdCandidates[] is used. + */ + encryptionInfo: Schema$EncryptionInfo; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchInsertRequest". + */ + kind: string; + } + /** + * Insert Conversions Response. + */ + export interface Schema$ConversionsBatchInsertResponse { + /** + * Indicates that some or all conversions failed to insert. + */ + hasFailures: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchInsertResponse". + */ + kind: string; + /** + * The insert status of each conversion. Statuses are returned in the same + * order that conversions are inserted. + */ + status: Schema$ConversionStatus[]; + } + /** + * Update Conversions Request. + */ + export interface Schema$ConversionsBatchUpdateRequest { + /** + * The set of conversions to update. + */ + conversions: Schema$Conversion[]; + /** + * Describes how encryptedUserId is encrypted. This is a required field if + * encryptedUserId is used. + */ + encryptionInfo: Schema$EncryptionInfo; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchUpdateRequest". + */ + kind: string; + } + /** + * Update Conversions Response. + */ + export interface Schema$ConversionsBatchUpdateResponse { + /** + * Indicates that some or all conversions failed to update. + */ + hasFailures: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionsBatchUpdateResponse". + */ + kind: string; + /** + * The update status of each conversion. Statuses are returned in the same + * order that conversions are updated. + */ + status: Schema$ConversionStatus[]; + } + /** + * The original conversion that was inserted or updated and whether there were + * any errors. + */ + export interface Schema$ConversionStatus { + /** + * The original conversion that was inserted or updated. + */ + conversion: Schema$Conversion; + /** + * A list of errors related to this conversion. + */ + errors: Schema$ConversionError[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#conversionStatus". + */ + kind: string; + } + /** + * Country List Response + */ + export interface Schema$CountriesListResponse { + /** + * Country collection. + */ + countries: Schema$Country[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#countriesListResponse". + */ + kind: string; + } + /** + * Contains information about a country that can be targeted by ads. + */ + export interface Schema$Country { + /** + * Country code. + */ + countryCode: string; + /** + * DART ID of this country. This is the ID used for targeting and generating + * reports. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#country". + */ + kind: string; + /** + * Name of this country. + */ + name: string; + /** + * Whether ad serving supports secure servers in this country. + */ + sslEnabled: boolean; + } + /** + * Contains properties of a Creative. + */ + export interface Schema$Creative { + /** + * Account ID of this creative. This field, if left unset, will be + * auto-generated for both insert and update operations. Applicable to all + * creative types. + */ + accountId: string; + /** + * Whether the creative is active. Applicable to all creative types. + */ + active: boolean; + /** + * Ad parameters user for VPAID creative. This is a read-only field. + * Applicable to the following creative types: all VPAID. + */ + adParameters: string; + /** + * Keywords for a Rich Media creative. Keywords let you customize the + * creative settings of a Rich Media ad running on your site without having + * to contact the advertiser. You can use keywords to dynamically change the + * look or functionality of a creative. Applicable to the following creative + * types: all RICH_MEDIA, and all VPAID. + */ + adTagKeys: string[]; + /** + * Advertiser ID of this creative. This is a required field. Applicable to + * all creative types. + */ + advertiserId: string; + /** + * Whether script access is allowed for this creative. This is a read-only + * and deprecated field which will automatically be set to true on update. + * Applicable to the following creative types: FLASH_INPAGE. + */ + allowScriptAccess: boolean; + /** + * Whether the creative is archived. Applicable to all creative types. + */ + archived: boolean; + /** + * Type of artwork used for the creative. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA, and all + * VPAID. + */ + artworkType: string; + /** + * Source application where creative was authored. Presently, only DBM + * authored creatives will have this field set. Applicable to all creative + * types. + */ + authoringSource: string; + /** + * Authoring tool for HTML5 banner creatives. This is a read-only field. + * Applicable to the following creative types: HTML5_BANNER. + */ + authoringTool: string; + /** + * Whether images are automatically advanced for image gallery creatives. + * Applicable to the following creative types: DISPLAY_IMAGE_GALLERY. + */ + autoAdvanceImages: boolean; + /** + * The 6-character HTML color code, beginning with #, for the background of + * the window area where the Flash file is displayed. Default is white. + * Applicable to the following creative types: FLASH_INPAGE. + */ + backgroundColor: string; + /** + * Click-through URL for backup image. Applicable to ENHANCED_BANNER when + * the primary asset type is not HTML_IMAGE. + */ + backupImageClickThroughUrl: Schema$CreativeClickThroughUrl; + /** + * List of feature dependencies that will cause a backup image to be served + * if the browser that serves the ad does not support them. Feature + * dependencies are features that a browser must be able to support in order + * to render your HTML5 creative asset correctly. This field is initially + * auto-generated to contain all features detected by DCM for all the assets + * of this creative and can then be modified by the client. To reset this + * field, copy over all the creativeAssets' detected features. + * Applicable to the following creative types: HTML5_BANNER. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + backupImageFeatures: string[]; + /** + * Reporting label used for HTML5 banner backup image. Applicable to the + * following creative types: DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + backupImageReportingLabel: string; + /** + * Target window for backup image. Applicable to the following creative + * types: FLASH_INPAGE and HTML5_BANNER. Applicable to DISPLAY when the + * primary asset type is not HTML_IMAGE. + */ + backupImageTargetWindow: Schema$TargetWindow; + /** + * Click tags of the creative. For DISPLAY, FLASH_INPAGE, and HTML5_BANNER + * creatives, this is a subset of detected click tags for the assets + * associated with this creative. After creating a flash asset, detected + * click tags will be returned in the creativeAssetMetadata. When inserting + * the creative, populate the creative clickTags field using the + * creativeAssetMetadata.clickTags field. For DISPLAY_IMAGE_GALLERY + * creatives, there should be exactly one entry in this list for each image + * creative asset. A click tag is matched with a corresponding creative + * asset by matching the clickTag.name field with the + * creativeAsset.assetIdentifier.name field. Applicable to the following + * creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + clickTags: Schema$ClickTag[]; + /** + * Industry standard ID assigned to creative for reach and frequency. + * Applicable to INSTREAM_VIDEO_REDIRECT creatives. + */ + commercialId: string; + /** + * List of companion creatives assigned to an in-Stream videocreative. + * Acceptable values include IDs of existing flash and image creatives. + * Applicable to the following creative types: all VPAID and all + * INSTREAM_VIDEO with dynamicAssetSelection set to false. + */ + companionCreatives: string[]; + /** + * Compatibilities associated with this creative. This is a read-only field. + * DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or + * on mobile devices or in mobile apps for regular or interstitial ads, + * respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. + * Only pre-existing creatives may have these compatibilities since new + * creatives will either be assigned DISPLAY or DISPLAY_INTERSTITIAL + * instead. IN_STREAM_VIDEO refers to rendering in in-stream video ads + * developed with the VAST standard. Applicable to all creative types. + * Acceptable values are: - "APP" - "APP_INTERSTITIAL" - + * "IN_STREAM_VIDEO" - "DISPLAY" - + * "DISPLAY_INTERSTITIAL" + */ + compatibility: string[]; + /** + * Whether Flash assets associated with the creative need to be + * automatically converted to HTML5. This flag is enabled by default and + * users can choose to disable it if they don't want the system to + * generate and use HTML5 asset for this creative. Applicable to the + * following creative type: FLASH_INPAGE. Applicable to DISPLAY when the + * primary asset type is not HTML_IMAGE. + */ + convertFlashToHtml5: boolean; + /** + * List of counter events configured for the creative. For + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. + */ + counterCustomEvents: Schema$CreativeCustomEvent[]; + /** + * Assets associated with a creative. Applicable to all but the following + * creative types: INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and + * REDIRECT + */ + creativeAssets: Schema$CreativeAsset[]; + /** + * Required if dynamicAssetSelection is true. + */ + creativeAssetSelection: Schema$CreativeAssetSelection; + /** + * Creative field assignments for this creative. Applicable to all creative + * types. + */ + creativeFieldAssignments: Schema$CreativeFieldAssignment[]; + /** + * Custom key-values for a Rich Media creative. Key-values let you customize + * the creative settings of a Rich Media ad running on your site without + * having to contact the advertiser. You can use key-values to dynamically + * change the look or functionality of a creative. Applicable to the + * following creative types: all RICH_MEDIA, and all VPAID. + */ + customKeyValues: string[]; + /** + * Set this to true to enable the use of rules to target individual assets + * in this creative. When set to true creativeAssetSelection must be set. + * This also controls asset-level companions. When this is true, companion + * creatives should be assigned to creative assets. Learn more. Applicable + * to INSTREAM_VIDEO creatives. + */ + dynamicAssetSelection: boolean; + /** + * List of exit events configured for the creative. For DISPLAY and + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags, For DISPLAY, an event is also created from the + * backupImageReportingLabel. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to + * DISPLAY when the primary asset type is not HTML_IMAGE. + */ + exitCustomEvents: Schema$CreativeCustomEvent[]; + /** + * OpenWindow FSCommand of this creative. This lets the SWF file communicate + * with either Flash Player or the program hosting Flash Player, such as a + * web browser. This is only triggered if allowScriptAccess field is true. + * Applicable to the following creative types: FLASH_INPAGE. + */ + fsCommand: Schema$FsCommand; + /** + * HTML code for the creative. This is a required field when applicable. + * This field is ignored if htmlCodeLocked is true. Applicable to the + * following creative types: all CUSTOM, FLASH_INPAGE, and HTML5_BANNER, and + * all RICH_MEDIA. + */ + htmlCode: string; + /** + * Whether HTML code is DCM-generated or manually entered. Set to true to + * ignore changes to htmlCode. Applicable to the following creative types: + * FLASH_INPAGE and HTML5_BANNER. + */ + htmlCodeLocked: boolean; + /** + * ID of this creative. This is a read-only, auto-generated field. + * Applicable to all creative types. + */ + id: string; + /** + * Dimension value for the ID of this creative. This is a read-only field. + * Applicable to all creative types. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creative". + */ + kind: string; + /** + * Creative last modification information. This is a read-only field. + * Applicable to all creative types. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Latest Studio trafficked creative ID associated with rich media and VPAID + * creatives. This is a read-only field. Applicable to the following + * creative types: all RICH_MEDIA, and all VPAID. + */ + latestTraffickedCreativeId: string; + /** + * Name of the creative. This is a required field and must be less than 256 + * characters long. Applicable to all creative types. + */ + name: string; + /** + * Override CSS value for rich media creatives. Applicable to the following + * creative types: all RICH_MEDIA. + */ + overrideCss: string; + /** + * The asset ID of the polite load image asset. Applicable to the creative + * type: DISPLAY. + */ + politeLoadAssetId: string; + /** + * Amount of time to play the video before counting a view. Applicable to + * the following creative types: all INSTREAM_VIDEO. + */ + progressOffset: Schema$VideoOffset; + /** + * URL of hosted image or hosted video or another ad tag. For + * INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video redirect + * URL. The standard for a VAST (Video Ad Serving Template) ad response + * allows for a redirect link to another VAST 2.0 or 3.0 call. This is a + * required field when applicable. Applicable to the following creative + * types: DISPLAY_REDIRECT, INTERNAL_REDIRECT, + * INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT + */ + redirectUrl: string; + /** + * ID of current rendering version. This is a read-only field. Applicable to + * all creative types. + */ + renderingId: string; + /** + * Dimension value for the rendering ID of this creative. This is a + * read-only field. Applicable to all creative types. + */ + renderingIdDimensionValue: Schema$DimensionValue; + /** + * The minimum required Flash plugin version for this creative. For + * example, 11.2.202.235. This is a read-only field. Applicable to the + * following creative types: all RICH_MEDIA, and all VPAID. + */ + requiredFlashPluginVersion: string; + /** + * The internal Flash version for this creative as calculated by DoubleClick + * Studio. This is a read-only field. Applicable to the following creative + * types: FLASH_INPAGE all RICH_MEDIA, and all VPAID. Applicable to DISPLAY + * when the primary asset type is not HTML_IMAGE. + */ + requiredFlashVersion: number; + /** + * Size associated with this creative. When inserting or updating a creative + * either the size ID field or size width and height fields can be used. + * This is a required field when applicable; however for IMAGE, FLASH_INPAGE + * creatives, and for DISPLAY creatives with a primary asset of type + * HTML_IMAGE, if left blank, this field will be automatically set using the + * actual size of the associated image assets. Applicable to the following + * creative types: DISPLAY, DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, + * HTML5_BANNER, IMAGE, and all RICH_MEDIA. + */ + size: Schema$Size; + /** + * Amount of time to play the video before the skip button appears. + * Applicable to the following creative types: all INSTREAM_VIDEO. + */ + skipOffset: Schema$VideoOffset; + /** + * Whether the user can choose to skip the creative. Applicable to the + * following creative types: all INSTREAM_VIDEO and all VPAID. + */ + skippable: boolean; + /** + * Whether the creative is SSL-compliant. This is a read-only field. + * Applicable to all creative types. + */ + sslCompliant: boolean; + /** + * Whether creative should be treated as SSL compliant even if the system + * scan shows it's not. Applicable to all creative types. + */ + sslOverride: boolean; + /** + * Studio advertiser ID associated with rich media and VPAID creatives. This + * is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioAdvertiserId: string; + /** + * Studio creative ID associated with rich media and VPAID creatives. This + * is a read-only field. Applicable to the following creative types: all + * RICH_MEDIA, and all VPAID. + */ + studioCreativeId: string; + /** + * Studio trafficked creative ID associated with rich media and VPAID + * creatives. This is a read-only field. Applicable to the following + * creative types: all RICH_MEDIA, and all VPAID. + */ + studioTraffickedCreativeId: string; + /** + * Subaccount ID of this creative. This field, if left unset, will be + * auto-generated for both insert and update operations. Applicable to all + * creative types. + */ + subaccountId: string; + /** + * Third-party URL used to record backup image impressions. Applicable to + * the following creative types: all RICH_MEDIA. + */ + thirdPartyBackupImageImpressionsUrl: string; + /** + * Third-party URL used to record rich media impressions. Applicable to the + * following creative types: all RICH_MEDIA. + */ + thirdPartyRichMediaImpressionsUrl: string; + /** + * Third-party URLs for tracking in-stream video creative events. Applicable + * to the following creative types: all INSTREAM_VIDEO and all VPAID. + */ + thirdPartyUrls: Schema$ThirdPartyTrackingUrl[]; + /** + * List of timer events configured for the creative. For + * DISPLAY_IMAGE_GALLERY creatives, these are read-only and auto-generated + * from clickTags. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID. Applicable to + * DISPLAY when the primary asset is not HTML_IMAGE. + */ + timerCustomEvents: Schema$CreativeCustomEvent[]; + /** + * Combined size of all creative assets. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA, and all + * VPAID. + */ + totalFileSize: string; + /** + * Type of this creative. This is a required field. Applicable to all + * creative types. Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only + * used for existing creatives. New creatives should use DISPLAY as a + * replacement for these types. + */ + type: string; + /** + * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following + * creative types: INSTREAM_VIDEO and VPAID. + */ + universalAdId: Schema$UniversalAdId; + /** + * The version number helps you keep track of multiple versions of your + * creative in your reports. The version number will always be + * auto-generated during insert operations to start at 1. For tracking + * creatives the version cannot be incremented and will always remain at 1. + * For all other creative types the version can be incremented only by 1 + * during update operations. In addition, the version will be automatically + * incremented by 1 when undergoing Rich Media creative merging. Applicable + * to all creative types. + */ + version: number; + /** + * Description of the video ad. Applicable to the following creative types: + * all INSTREAM_VIDEO and all VPAID. + */ + videoDescription: string; + /** + * Creative video duration in seconds. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO, all RICH_MEDIA, and all + * VPAID. + */ + videoDuration: number; + } + /** + * Creative Asset. + */ + export interface Schema$CreativeAsset { + /** + * Whether ActionScript3 is enabled for the flash asset. This is a read-only + * field. Applicable to the following creative type: FLASH_INPAGE. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + actionScript3: boolean; + /** + * Whether the video asset is active. This is a read-only field for + * VPAID_NON_LINEAR_VIDEO assets. Applicable to the following creative + * types: INSTREAM_VIDEO and all VPAID. + */ + active: boolean; + /** + * Possible alignments for an asset. This is a read-only field. Applicable + * to the following creative types: + * RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL. + */ + alignment: string; + /** + * Artwork type of rich media creative. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + artworkType: string; + /** + * Identifier of this asset. This is the same identifier returned during + * creative asset insert operation. This is a required field. Applicable to + * all but the following creative types: all REDIRECT and TRACKING_TEXT. + */ + assetIdentifier: Schema$CreativeAssetId; + /** + * Exit event configured for the backup image. Applicable to the following + * creative types: all RICH_MEDIA. + */ + backupImageExit: Schema$CreativeCustomEvent; + /** + * Detected bit-rate for video asset. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + bitRate: number; + /** + * Rich media child asset type. This is a read-only field. Applicable to the + * following creative types: all VPAID. + */ + childAssetType: string; + /** + * Size of an asset when collapsed. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA and all VPAID. Additionally, + * applicable to assets whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or + * ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + collapsedSize: Schema$Size; + /** + * List of companion creatives assigned to an in-stream video creative + * asset. Acceptable values include IDs of existing flash and image + * creatives. Applicable to INSTREAM_VIDEO creative type with + * dynamicAssetSelection set to true. + */ + companionCreativeIds: string[]; + /** + * Custom start time in seconds for making the asset visible. Applicable to + * the following creative types: all RICH_MEDIA. Value must be greater than + * or equal to 0. + */ + customStartTimeValue: number; + /** + * List of feature dependencies for the creative asset that are detected by + * DCM. Feature dependencies are features that a browser must be able to + * support in order to render your HTML5 creative correctly. This is a + * read-only, auto-generated field. Applicable to the following creative + * types: HTML5_BANNER. Applicable to DISPLAY when the primary asset type is + * not HTML_IMAGE. + */ + detectedFeatures: string[]; + /** + * Type of rich media asset. This is a read-only field. Applicable to the + * following creative types: all RICH_MEDIA. + */ + displayType: string; + /** + * Duration in seconds for which an asset will be displayed. Applicable to + * the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. + * Value must be greater than or equal to 1. + */ + duration: number; + /** + * Duration type for which an asset will be displayed. Applicable to the + * following creative types: all RICH_MEDIA. + */ + durationType: string; + /** + * Detected expanded dimension for video asset. This is a read-only field. + * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + expandedDimension: Schema$Size; + /** + * File size associated with this creative asset. This is a read-only field. + * Applicable to all but the following creative types: all REDIRECT and + * TRACKING_TEXT. + */ + fileSize: string; + /** + * Flash version of the asset. This is a read-only field. Applicable to the + * following creative types: FLASH_INPAGE, all RICH_MEDIA, and all VPAID. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + */ + flashVersion: number; + /** + * Whether to hide Flash objects flag for an asset. Applicable to the + * following creative types: all RICH_MEDIA. + */ + hideFlashObjects: boolean; + /** + * Whether to hide selection boxes flag for an asset. Applicable to the + * following creative types: all RICH_MEDIA. + */ + hideSelectionBoxes: boolean; + /** + * Whether the asset is horizontally locked. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + horizontallyLocked: boolean; + /** + * Numeric ID of this creative asset. This is a required field and should + * not be modified. Applicable to all but the following creative types: all + * REDIRECT and TRACKING_TEXT. + */ + id: string; + /** + * Dimension value for the ID of the asset. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Detected MIME type for video asset. This is a read-only field. Applicable + * to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + mimeType: string; + /** + * Offset position for an asset in collapsed mode. This is a read-only + * field. Applicable to the following creative types: all RICH_MEDIA and all + * VPAID. Additionally, only applicable to assets whose displayType is + * ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN. + */ + offset: Schema$OffsetPosition; + /** + * Orientation of video asset. This is a read-only, auto-generated field. + */ + orientation: string; + /** + * Whether the backup asset is original or changed by the user in DCM. + * Applicable to the following creative types: all RICH_MEDIA. + */ + originalBackup: boolean; + /** + * Offset position for an asset. Applicable to the following creative types: + * all RICH_MEDIA. + */ + position: Schema$OffsetPosition; + /** + * Offset left unit for an asset. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA. + */ + positionLeftUnit: string; + /** + * Offset top unit for an asset. This is a read-only field if the asset + * displayType is ASSET_DISPLAY_TYPE_OVERLAY. Applicable to the following + * creative types: all RICH_MEDIA. + */ + positionTopUnit: string; + /** + * Progressive URL for video asset. This is a read-only field. Applicable to + * the following creative types: INSTREAM_VIDEO and all VPAID. + */ + progressiveServingUrl: string; + /** + * Whether the asset pushes down other content. Applicable to the following + * creative types: all RICH_MEDIA. Additionally, only applicable when the + * asset offsets are 0, the collapsedSize.width matches size.width, and the + * collapsedSize.height is less than size.height. + */ + pushdown: boolean; + /** + * Pushdown duration in seconds for an asset. Applicable to the following + * creative types: all RICH_MEDIA.Additionally, only applicable when the + * asset pushdown field is true, the offsets are 0, the collapsedSize.width + * matches size.width, and the collapsedSize.height is less than + * size.height. Acceptable values are 0 to 9.99, inclusive. + */ + pushdownDuration: number; + /** + * Role of the asset in relation to creative. Applicable to all but the + * following creative types: all REDIRECT and TRACKING_TEXT. This is a + * required field. PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, + * IMAGE, DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple + * primary assets), and all VPAID creatives. BACKUP_IMAGE applies to + * FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA, and all VPAID creatives. + * Applicable to DISPLAY when the primary asset type is not HTML_IMAGE. + * ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE creatives. + * OTHER refers to assets from sources other than DCM, such as Studio + * uploaded assets, applicable to all RICH_MEDIA and all VPAID creatives. + * PARENT_VIDEO refers to videos uploaded by the user in DCM and is + * applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO creatives. + * TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO + * assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO + * creatives. ALTERNATE_VIDEO refers to the DCM representation of child + * asset videos from Studio, and is applicable to VPAID_LINEAR_VIDEO + * creatives. These cannot be added or removed within DCM. For + * VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and + * ALTERNATE_VIDEO assets that are marked active serve as backup in case the + * VPAID creative cannot be served. Only PARENT_VIDEO assets can be added or + * removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO creative. + */ + role: string; + /** + * Size associated with this creative asset. This is a required field when + * applicable; however for IMAGE and FLASH_INPAGE, creatives if left blank, + * this field will be automatically set using the actual size of the + * associated image asset. Applicable to the following creative types: + * DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all + * RICH_MEDIA. Applicable to DISPLAY when the primary asset type is not + * HTML_IMAGE. + */ + size: Schema$Size; + /** + * Whether the asset is SSL-compliant. This is a read-only field. Applicable + * to all but the following creative types: all REDIRECT and TRACKING_TEXT. + */ + sslCompliant: boolean; + /** + * Initial wait time type before making the asset visible. Applicable to the + * following creative types: all RICH_MEDIA. + */ + startTimeType: string; + /** + * Streaming URL for video asset. This is a read-only field. Applicable to + * the following creative types: INSTREAM_VIDEO and all VPAID. + */ + streamingServingUrl: string; + /** + * Whether the asset is transparent. Applicable to the following creative + * types: all RICH_MEDIA. Additionally, only applicable to HTML5 assets. + */ + transparency: boolean; + /** + * Whether the asset is vertically locked. This is a read-only field. + * Applicable to the following creative types: all RICH_MEDIA. + */ + verticallyLocked: boolean; + /** + * Detected video duration for video asset. This is a read-only field. + * Applicable to the following creative types: INSTREAM_VIDEO and all VPAID. + */ + videoDuration: number; + /** + * Window mode options for flash assets. Applicable to the following + * creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING, + * RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and + * RICH_MEDIA_INPAGE_FLOATING. + */ + windowMode: string; + /** + * zIndex value of an asset. Applicable to the following creative types: all + * RICH_MEDIA.Additionally, only applicable to assets whose displayType is + * NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or + * ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to + * 999999999, inclusive. + */ + zIndex: number; + /** + * File name of zip file. This is a read-only field. Applicable to the + * following creative types: HTML5_BANNER. + */ + zipFilename: string; + /** + * Size of zip file. This is a read-only field. Applicable to the following + * creative types: HTML5_BANNER. + */ + zipFilesize: string; + } + /** + * Creative Asset ID. + */ + export interface Schema$CreativeAssetId { + /** + * Name of the creative asset. This is a required field while inserting an + * asset. After insertion, this assetIdentifier is used to identify the + * uploaded asset. Characters in the name must be alphanumeric or one of the + * following: ".-_ ". Spaces are allowed. + */ + name: string; + /** + * Type of asset to upload. This is a required field. FLASH and IMAGE are no + * longer supported for new uploads. All image assets should use HTML_IMAGE. + */ + type: string; + } + /** + * CreativeAssets contains properties of a creative asset file which will be + * uploaded or has already been uploaded. Refer to the creative sample code + * for how to upload assets and insert a creative. + */ + export interface Schema$CreativeAssetMetadata { + /** + * ID of the creative asset. This is a required field. + */ + assetIdentifier: Schema$CreativeAssetId; + /** + * List of detected click tags for assets. This is a read-only + * auto-generated field. + */ + clickTags: Schema$ClickTag[]; + /** + * List of feature dependencies for the creative asset that are detected by + * DCM. Feature dependencies are features that a browser must be able to + * support in order to render your HTML5 creative correctly. This is a + * read-only, auto-generated field. + */ + detectedFeatures: string[]; + /** + * Numeric ID of the asset. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the numeric ID of the asset. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeAssetMetadata". + */ + kind: string; + /** + * Rules validated during code generation that generated a warning. This is + * a read-only, auto-generated field. Possible values are: - + * "ADMOB_REFERENCED" - "ASSET_FORMAT_UNSUPPORTED_DCM" - + * "ASSET_INVALID" - "CLICK_TAG_HARD_CODED" - + * "CLICK_TAG_INVALID" - "CLICK_TAG_IN_GWD" - + * "CLICK_TAG_MISSING" - "CLICK_TAG_MORE_THAN_ONE" - + * "CLICK_TAG_NON_TOP_LEVEL" - + * "COMPONENT_UNSUPPORTED_DCM" - + * "ENABLER_UNSUPPORTED_METHOD_DCM" - + * "EXTERNAL_FILE_REFERENCED" - "FILE_DETAIL_EMPTY" - + * "FILE_TYPE_INVALID" - "GWD_PROPERTIES_INVALID" - + * "HTML5_FEATURE_UNSUPPORTED" - "LINKED_FILE_NOT_FOUND" + * - "MAX_FLASH_VERSION_11" - "MRAID_REFERENCED" - + * "NOT_SSL_COMPLIANT" - "ORPHANED_ASSET" - + * "PRIMARY_HTML_MISSING" - "SVG_INVALID" - + * "ZIP_INVALID" + */ + warnedValidationRules: string[]; + } + /** + * Encapsulates the list of rules for asset selection and a default asset in + * case none of the rules match. Applicable to INSTREAM_VIDEO creatives. + */ + export interface Schema$CreativeAssetSelection { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in + * this creative, and will be served if none of the rules match. This is a + * required field. + */ + defaultAssetId: string; + /** + * Rules determine which asset will be served to a viewer. Rules will be + * evaluated in the order in which they are stored in this list. This list + * must contain at least one rule. Applicable to INSTREAM_VIDEO creatives. + */ + rules: Schema$Rule[]; + } + /** + * Creative Assignment. + */ + export interface Schema$CreativeAssignment { + /** + * Whether this creative assignment is active. When true, the creative will + * be included in the ad's rotation. + */ + active: boolean; + /** + * Whether applicable event tags should fire when this creative assignment + * is rendered. If this value is unset when the ad is inserted or updated, + * it will default to true for all creative types EXCEPT for + * INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO. + */ + applyEventTags: boolean; + /** + * Click-through URL of the creative assignment. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Companion creative overrides for this creative assignment. Applicable to + * video ads. + */ + companionCreativeOverrides: Schema$CompanionClickThroughOverride[]; + /** + * Creative group assignments for this creative assignment. Only one + * assignment per creative group number is allowed for a maximum of two + * assignments. + */ + creativeGroupAssignments: Schema$CreativeGroupAssignment[]; + /** + * ID of the creative to be assigned. This is a required field. + */ + creativeId: string; + /** + * Dimension value for the ID of the creative. This is a read-only, + * auto-generated field. + */ + creativeIdDimensionValue: Schema$DimensionValue; + /** + * Date and time that the assigned creative should stop serving. Must be + * later than the start time. + */ + endTime: string; + /** + * Rich media exit overrides for this creative assignment. Applicable when + * the creative type is any of the following: - DISPLAY - RICH_MEDIA_INPAGE + * - RICH_MEDIA_INPAGE_FLOATING - RICH_MEDIA_IM_EXPAND - + * RICH_MEDIA_EXPANDING - RICH_MEDIA_INTERSTITIAL_FLOAT - + * RICH_MEDIA_MOBILE_IN_APP - RICH_MEDIA_MULTI_FLOATING - + * RICH_MEDIA_PEEL_DOWN - VPAID_LINEAR - VPAID_NON_LINEAR + */ + richMediaExitOverrides: Schema$RichMediaExitOverride[]; + /** + * Sequence number of the creative assignment, applicable when the rotation + * type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable values are 1 to + * 65535, inclusive. + */ + sequence: number; + /** + * Whether the creative to be assigned is SSL-compliant. This is a read-only + * field that is auto-generated when the ad is inserted or updated. + */ + sslCompliant: boolean; + /** + * Date and time that the assigned creative should start serving. + */ + startTime: string; + /** + * Weight of the creative assignment, applicable when the rotation type is + * CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater than or equal to 1. + */ + weight: number; + } + /** + * Click-through URL + */ + export interface Schema$CreativeClickThroughUrl { + /** + * Read-only convenience field representing the actual URL that will be used + * for this click-through. The URL is computed as follows: - If + * landingPageId is specified then that landing page's URL is assigned + * to this field. - Otherwise, the customClickThroughUrl is assigned to this + * field. + */ + computedClickThroughUrl: string; + /** + * Custom click-through URL. Applicable if the landingPageId field is left + * unset. + */ + customClickThroughUrl: string; + /** + * ID of the landing page for the click-through URL. + */ + landingPageId: string; + } + /** + * Creative Custom Event. + */ + export interface Schema$CreativeCustomEvent { + /** + * Unique ID of this event used by DDM Reporting and Data Transfer. This is + * a read-only field. + */ + advertiserCustomEventId: string; + /** + * User-entered name for the event. + */ + advertiserCustomEventName: string; + /** + * Type of the event. This is a read-only field. + */ + advertiserCustomEventType: string; + /** + * Artwork label column, used to link events in DCM back to events in + * Studio. This is a required field and should not be modified after + * insertion. + */ + artworkLabel: string; + /** + * Artwork type used by the creative.This is a read-only field. + */ + artworkType: string; + /** + * Exit click-through URL for the event. This field is used only for exit + * events. + */ + exitClickThroughUrl: Schema$CreativeClickThroughUrl; + /** + * ID of this event. This is a required field and should not be modified + * after insertion. + */ + id: string; + /** + * Properties for rich media popup windows. This field is used only for exit + * events. + */ + popupWindowProperties: Schema$PopupWindowProperties; + /** + * Target type used by the event. + */ + targetType: string; + /** + * Video reporting ID, used to differentiate multiple videos in a single + * creative. This is a read-only field. + */ + videoReportingId: string; + } + /** + * Contains properties of a creative field. + */ + export interface Schema$CreativeField { + /** + * Account ID of this creative field. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this creative field. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * ID of this creative field. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeField". + */ + kind: string; + /** + * Name of this creative field. This is a required field and must be less + * than 256 characters long and unique among creative fields of the same + * advertiser. + */ + name: string; + /** + * Subaccount ID of this creative field. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Creative Field Assignment. + */ + export interface Schema$CreativeFieldAssignment { + /** + * ID of the creative field. + */ + creativeFieldId: string; + /** + * ID of the creative field value. + */ + creativeFieldValueId: string; + } + /** + * Creative Field List Response + */ + export interface Schema$CreativeFieldsListResponse { + /** + * Creative field collection. + */ + creativeFields: Schema$CreativeField[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a creative field value. + */ + export interface Schema$CreativeFieldValue { + /** + * ID of this creative field value. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldValue". + */ + kind: string; + /** + * Value of this creative field value. It needs to be less than 256 + * characters in length and unique per creative field. + */ + value: string; + } + /** + * Creative Field Value List Response + */ + export interface Schema$CreativeFieldValuesListResponse { + /** + * Creative field value collection. + */ + creativeFieldValues: Schema$CreativeFieldValue[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeFieldValuesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a creative group. + */ + export interface Schema$CreativeGroup { + /** + * Account ID of this creative group. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this creative group. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Subgroup of the creative group. Assign your creative groups to a subgroup + * in order to filter or manage them more easily. This field is required on + * insertion and is read-only after insertion. Acceptable values are 1 to 2, + * inclusive. + */ + groupNumber: number; + /** + * ID of this creative group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeGroup". + */ + kind: string; + /** + * Name of this creative group. This is a required field and must be less + * than 256 characters long and unique among creative groups of the same + * advertiser. + */ + name: string; + /** + * Subaccount ID of this creative group. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Creative Group Assignment. + */ + export interface Schema$CreativeGroupAssignment { + /** + * ID of the creative group to be assigned. + */ + creativeGroupId: string; + /** + * Creative group number of the creative group assignment. + */ + creativeGroupNumber: string; + } + /** + * Creative Group List Response + */ + export interface Schema$CreativeGroupsListResponse { + /** + * Creative group collection. + */ + creativeGroups: Schema$CreativeGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativeGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Creative optimization settings. + */ + export interface Schema$CreativeOptimizationConfiguration { + /** + * ID of this creative optimization config. This field is auto-generated + * when the campaign is inserted or updated. It can be null for existing + * campaigns. + */ + id: string; + /** + * Name of this creative optimization config. This is a required field and + * must be less than 129 characters long. + */ + name: string; + /** + * List of optimization activities associated with this configuration. + */ + optimizationActivitys: Schema$OptimizationActivity[]; + /** + * Optimization model for this configuration. + */ + optimizationModel: string; + } + /** + * Creative Rotation. + */ + export interface Schema$CreativeRotation { + /** + * Creative assignments in this creative rotation. + */ + creativeAssignments: Schema$CreativeAssignment[]; + /** + * Creative optimization configuration that is used by this ad. It should + * refer to one of the existing optimization configurations in the ad's + * campaign. If it is unset or set to 0, then the campaign's default + * optimization configuration will be used for this ad. + */ + creativeOptimizationConfigurationId: string; + /** + * Type of creative rotation. Can be used to specify whether to use + * sequential or random rotation. + */ + type: string; + /** + * Strategy for calculating weights. Used with + * CREATIVE_ROTATION_TYPE_RANDOM. + */ + weightCalculationStrategy: string; + } + /** + * Creative Settings + */ + export interface Schema$CreativeSettings { + /** + * Header text for iFrames for this site. Must be less than or equal to 2000 + * characters long. + */ + iFrameFooter: string; + /** + * Header text for iFrames for this site. Must be less than or equal to 2000 + * characters long. + */ + iFrameHeader: string; + } + /** + * Creative List Response + */ + export interface Schema$CreativesListResponse { + /** + * Creative collection. + */ + creatives: Schema$Creative[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#creativesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "CROSS_DIMENSION_REACH". */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.list - * @desc Retrieves a list of user roles, possibly filtered. This method - * supports paging. - * @alias dfareporting.userRoles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.accountUserRoleOnly Select only account level user roles not associated with any specific subaccount. - * @param {string=} params.ids Select only user roles with the specified IDs. - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. - * @param {string} params.profileId User profile ID associated with this request. - * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". - * @param {string=} params.sortField Field by which to sort the list. - * @param {string=} params.sortOrder Order of sorted results. - * @param {string=} params.subaccountId Select only user roles that belong to this subaccount. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$CrossDimensionReachReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "breakdown" section of the report. + */ + breakdown: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#crossDimensionReachReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected in the + * "overlapMetricNames" section of the report. + */ + overlapMetrics: Schema$Metric[]; + } + /** + * A custom floodlight variable. + */ + export interface Schema$CustomFloodlightVariable { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#customFloodlightVariable". + */ + kind: string; + /** + * The type of custom floodlight variable to supply a value for. These map + * to the "u[1-20]=" in the tags. + */ + type: string; + /** + * The value of the custom floodlight variable. The length of string must + * not exceed 50 characters. + */ + value: string; + } + /** + * Represents a Custom Rich Media Events group. + */ + export interface Schema$CustomRichMediaEvents { + /** + * List of custom rich media event IDs. Dimension values must be all of type + * dfa:richMediaEventTypeIdAndName. + */ + filteredEventIds: Schema$DimensionValue[]; + /** + * The kind of resource this is, in this case + * dfareporting#customRichMediaEvents. + */ + kind: string; + } + /** + * Represents a date range. + */ + export interface Schema$DateRange { + /** + * The end date of the date range, inclusive. A string of the format: + * "yyyy-MM-dd". + */ + endDate: string; + /** + * The kind of resource this is, in this case dfareporting#dateRange. + */ + kind: string; + /** + * The date range relative to the date of when the report is run. + */ + relativeDateRange: string; + /** + * The start date of the date range, inclusive. A string of the format: + * "yyyy-MM-dd". + */ + startDate: string; + } + /** + * Day Part Targeting. + */ + export interface Schema$DayPartTargeting { + /** + * Days of the week when the ad will serve. Acceptable values are: - + * "SUNDAY" - "MONDAY" - "TUESDAY" - + * "WEDNESDAY" - "THURSDAY" - "FRIDAY" - + * "SATURDAY" + */ + daysOfWeek: string[]; + /** + * Hours of the day when the ad will serve, where 0 is midnight to 1 AM and + * 23 is 11 PM to midnight. Can be specified with days of week, in which + * case the ad would serve during these hours on the specified days. For + * example if Monday, Wednesday, Friday are the days of week specified and + * 9-10am, 3-5pm (hours 9, 15, and 16) is specified, the ad would serve + * Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values + * are 0 to 23, inclusive. + */ + hoursOfDay: number[]; + /** + * Whether or not to use the user's local time. If false, the + * America/New York time zone applies. + */ + userLocalTime: boolean; + } + /** + * Properties of inheriting and overriding the default click-through event + * tag. A campaign may override the event tag defined at the advertiser level, + * and an ad may also override the campaign's setting further. + */ + export interface Schema$DefaultClickThroughEventTagProperties { + /** + * ID of the click-through event tag to apply to all ads in this + * entity's scope. + */ + defaultClickThroughEventTagId: string; + /** + * Whether this entity should override the inherited default click-through + * event tag with its own defined value. + */ + overrideInheritedEventTag: boolean; + } + /** + * Delivery Schedule. + */ + export interface Schema$DeliverySchedule { + /** + * Limit on the number of times an individual user can be served the ad + * within a specified period of time. + */ + frequencyCap: Schema$FrequencyCap; + /** + * Whether or not hard cutoff is enabled. If true, the ad will not serve + * after the end date and time. Otherwise the ad will continue to be served + * until it has reached its delivery goals. + */ + hardCutoff: boolean; + /** + * Impression ratio for this ad. This ratio determines how often each ad is + * served relative to the others. For example, if ad A has an impression + * ratio of 1 and ad B has an impression ratio of 3, then DCM will serve ad + * B three times as often as ad A. Acceptable values are 1 to 10, inclusive. + */ + impressionRatio: string; + /** + * Serving priority of an ad, with respect to other ads. The lower the + * priority number, the greater the priority with which it is served. + */ + priority: string; + } + /** + * DFP Settings + */ + export interface Schema$DfpSettings { + /** + * DFP network code for this directory site. + */ + dfpNetworkCode: string; + /** + * DFP network name for this directory site. + */ + dfpNetworkName: string; + /** + * Whether this directory site accepts programmatic placements. + */ + programmaticPlacementAccepted: boolean; + /** + * Whether this directory site is available only via DoubleClick Publisher + * Portal. + */ + publisherPortalOnly: boolean; + /** + * Whether this directory site accepts publisher-paid tags. + */ + pubPaidPlacementAccepted: boolean; + } + /** + * Represents a dimension. + */ + export interface Schema$Dimension { + /** + * The kind of resource this is, in this case dfareporting#dimension. + */ + kind: string; + /** + * The dimension name, e.g. dfa:advertiser + */ + name: string; + } + /** + * Represents a dimension filter. + */ + export interface Schema$DimensionFilter { + /** + * The name of the dimension to filter. + */ + dimensionName: string; + /** + * The kind of resource this is, in this case dfareporting#dimensionFilter. + */ + kind: string; + /** + * The value of the dimension to filter. + */ + value: string; + } + /** + * Represents a DimensionValue resource. + */ + export interface Schema$DimensionValue { + /** + * The name of the dimension. + */ + dimensionName: string; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The ID associated with the value if available. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#dimensionValue. + */ + kind: string; + /** + * Determines how the 'value' field is matched when filtering. If + * not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, + * '*' is allowed as a placeholder for variable length character + * sequences, and it can be escaped with a backslash. Note, only paid search + * dimensions ('dfa:paidSearch*') allow a matchType other than + * EXACT. + */ + matchType: string; + /** + * The value of the dimension. + */ + value: string; + } + /** + * Represents the list of DimensionValue resources. + */ + export interface Schema$DimensionValueList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The dimension values returned in this response. + */ + items: Schema$DimensionValue[]; + /** + * The kind of list this is, in this case dfareporting#dimensionValueList. + */ + kind: string; + /** + * Continuation token used to page through dimension values. To retrieve the + * next page of results, set the next request's "pageToken" to + * the value of this field. The page token is only valid for a limited + * amount of time and should not be persisted. + */ + nextPageToken: string; + } + /** + * Represents a DimensionValuesRequest. + */ + export interface Schema$DimensionValueRequest { + /** + * The name of the dimension for which values should be requested. + */ + dimensionName: string; + /** + * The end date of the date range for which to retrieve dimension values. A + * string of the format "yyyy-MM-dd". + */ + endDate: string; + /** + * The list of filters by which to filter values. The filters are ANDed. + */ + filters: Schema$DimensionFilter[]; + /** + * The kind of request this is, in this case + * dfareporting#dimensionValueRequest. + */ + kind: string; + /** + * The start date of the date range for which to retrieve dimension values. + * A string of the format "yyyy-MM-dd". + */ + startDate: string; + } + /** + * DirectorySites contains properties of a website from the Site Directory. + * Sites need to be added to an account via the Sites resource before they can + * be assigned to a placement. + */ + export interface Schema$DirectorySite { + /** + * Whether this directory site is active. + */ + active: boolean; + /** + * Directory site contacts. + */ + contactAssignments: Schema$DirectorySiteContactAssignment[]; + /** + * Country ID of this directory site. This is a read-only field. + */ + countryId: string; + /** + * Currency ID of this directory site. This is a read-only field. Possible + * values are: - "1" for USD - "2" for GBP - + * "3" for ESP - "4" for SEK - "5" for CAD + * - "6" for JPY - "7" for DEM - "8" for AUD + * - "9" for FRF - "10" for ITL - "11" for + * DKK - "12" for NOK - "13" for FIM - "14" + * for ZAR - "15" for IEP - "16" for NLG - + * "17" for EUR - "18" for KRW - "19" for + * TWD - "20" for SGD - "21" for CNY - "22" + * for HKD - "23" for NZD - "24" for MYR - + * "25" for BRL - "26" for PTE - "27" for + * MXP - "28" for CLP - "29" for TRY - "30" + * for ARS - "31" for PEN - "32" for ILS - + * "33" for CHF - "34" for VEF - "35" for + * COP - "36" for GTQ - "37" for PLN - "39" + * for INR - "40" for THB - "41" for IDR - + * "42" for CZK - "43" for RON - "44" for + * HUF - "45" for RUB - "46" for AED - "47" + * for BGN - "48" for HRK - "49" for MXN - + * "50" for NGN + */ + currencyId: string; + /** + * Description of this directory site. This is a read-only field. + */ + description: string; + /** + * ID of this directory site. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this directory site. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Tag types for regular placements. Acceptable values are: - + * "STANDARD" - "IFRAME_JAVASCRIPT_INPAGE" - + * "INTERNAL_REDIRECT_INPAGE" - "JAVASCRIPT_INPAGE" + */ + inpageTagFormats: string[]; + /** + * Tag types for interstitial placements. Acceptable values are: - + * "IFRAME_JAVASCRIPT_INTERSTITIAL" - + * "INTERNAL_REDIRECT_INTERSTITIAL" - + * "JAVASCRIPT_INTERSTITIAL" + */ + interstitialTagFormats: string[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySite". + */ + kind: string; + /** + * Name of this directory site. + */ + name: string; + /** + * Parent directory site ID. + */ + parentId: string; + /** + * Directory site settings. + */ + settings: Schema$DirectorySiteSettings; + /** + * URL of this directory site. + */ + url: string; + } + /** + * Contains properties of a Site Directory contact. + */ + export interface Schema$DirectorySiteContact { + /** + * Address of this directory site contact. + */ + address: string; + /** + * Email address of this directory site contact. + */ + email: string; + /** + * First name of this directory site contact. + */ + firstName: string; + /** + * ID of this directory site contact. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySiteContact". + */ + kind: string; + /** + * Last name of this directory site contact. + */ + lastName: string; + /** + * Phone number of this directory site contact. + */ + phone: string; + /** + * Directory site contact role. + */ + role: string; + /** + * Title or designation of this directory site contact. + */ + title: string; + /** + * Directory site contact type. + */ + type: string; + } + /** + * Directory Site Contact Assignment + */ + export interface Schema$DirectorySiteContactAssignment { + /** + * ID of this directory site contact. This is a read-only, auto-generated + * field. + */ + contactId: string; + /** + * Visibility of this directory site contact assignment. When set to PUBLIC + * this contact assignment is visible to all account and agency users; when + * set to PRIVATE it is visible only to the site. + */ + visibility: string; + } + /** + * Directory Site Contact List Response + */ + export interface Schema$DirectorySiteContactsListResponse { + /** + * Directory site contact collection + */ + directorySiteContacts: Schema$DirectorySiteContact[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySiteContactsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Directory Site Settings + */ + export interface Schema$DirectorySiteSettings { + /** + * Whether this directory site has disabled active view creatives. + */ + activeViewOptOut: boolean; + /** + * Directory site DFP settings. + */ + dfpSettings: Schema$DfpSettings; + /** + * Whether this site accepts in-stream video ads. + */ + instreamVideoPlacementAccepted: boolean; + /** + * Whether this site accepts interstitial ads. + */ + interstitialPlacementAccepted: boolean; + /** + * Whether this directory site has disabled Nielsen OCR reach ratings. + */ + nielsenOcrOptOut: boolean; + /** + * Whether this directory site has disabled generation of Verification ins + * tags. + */ + verificationTagOptOut: boolean; + /** + * Whether this directory site has disabled active view for in-stream video + * creatives. This is a read-only field. + */ + videoActiveViewOptOut: boolean; + } + /** + * Directory Site List Response + */ + export interface Schema$DirectorySitesListResponse { + /** + * Directory site collection. + */ + directorySites: Schema$DirectorySite[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#directorySitesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a dynamic targeting key. Dynamic targeting keys are + * unique, user-friendly labels, created at the advertiser level in DCM, that + * can be assigned to ads, creatives, and placements and used for targeting + * with DoubleClick Studio dynamic creatives. Use these labels instead of + * numeric DCM IDs (such as placement IDs) to save time and avoid errors in + * your dynamic feeds. + */ + export interface Schema$DynamicTargetingKey { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#dynamicTargetingKey". + */ + kind: string; + /** + * Name of this dynamic targeting key. This is a required field. Must be + * less than 256 characters long and cannot contain commas. All characters + * are converted to lowercase. + */ + name: string; + /** + * ID of the object of this dynamic targeting key. This is a required field. + */ + objectId: string; + /** + * Type of the object of this dynamic targeting key. This is a required + * field. + */ + objectType: string; + } + /** + * Dynamic Targeting Key List Response + */ + export interface Schema$DynamicTargetingKeysListResponse { + /** + * Dynamic targeting key collection. + */ + dynamicTargetingKeys: Schema$DynamicTargetingKey[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#dynamicTargetingKeysListResponse". + */ + kind: string; + } + /** + * A description of how user IDs are encrypted. + */ + export interface Schema$EncryptionInfo { + /** + * The encryption entity ID. This should match the encryption configuration + * for ad serving or Data Transfer. + */ + encryptionEntityId: string; + /** + * The encryption entity type. This should match the encryption + * configuration for ad serving or Data Transfer. + */ + encryptionEntityType: string; + /** + * Describes whether the encrypted cookie was received from ad serving (the + * %m macro) or from Data Transfer. + */ + encryptionSource: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#encryptionInfo". + */ + kind: string; + } + /** + * Contains properties of an event tag. + */ + export interface Schema$EventTag { + /** + * Account ID of this event tag. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Advertiser ID of this event tag. This field or the campaignId field is + * required on insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Campaign ID of this event tag. This field or the advertiserId field is + * required on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Whether this event tag should be automatically enabled for all of the + * advertiser's campaigns and ads. + */ + enabledByDefault: boolean; + /** + * Whether to remove this event tag from ads that are trafficked through + * DoubleClick Bid Manager to Ad Exchange. This may be useful if the event + * tag uses a pixel that is unapproved for Ad Exchange bids on one or more + * networks, such as the Google Display Network. + */ + excludeFromAdxRequests: boolean; + /** + * ID of this event tag. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#eventTag". + */ + kind: string; + /** + * Name of this event tag. This is a required field and must be less than + * 256 characters long. + */ + name: string; + /** + * Site filter type for this event tag. If no type is specified then the + * event tag will be applied to all sites. + */ + siteFilterType: string; + /** + * Filter list of site IDs associated with this event tag. The + * siteFilterType determines whether this is a whitelist or blacklist + * filter. + */ + siteIds: string[]; + /** + * Whether this tag is SSL-compliant or not. This is a read-only field. + */ + sslCompliant: boolean; + /** + * Status of this event tag. Must be ENABLED for this event tag to fire. + * This is a required field. + */ + status: string; + /** + * Subaccount ID of this event tag. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + /** + * Event tag type. Can be used to specify whether to use a third-party + * pixel, a third-party JavaScript URL, or a third-party click-through URL + * for either impression or click tracking. This is a required field. + */ + type: string; + /** + * Payload URL for this event tag. The URL on a click-through event tag + * should have a landing page URL appended to the end of it. This field is + * required on insertion. + */ + url: string; + /** + * Number of times the landing page URL should be URL-escaped before being + * appended to the click-through event tag URL. Only applies to + * click-through event tags as specified by the event tag type. + */ + urlEscapeLevels: number; + } + /** + * Event tag override information. + */ + export interface Schema$EventTagOverride { + /** + * Whether this override is enabled. + */ + enabled: boolean; + /** + * ID of this event tag override. This is a read-only, auto-generated field. + */ + id: string; + } + /** + * Event Tag List Response + */ + export interface Schema$EventTagsListResponse { + /** + * Event tag collection. + */ + eventTags: Schema$EventTag[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#eventTagsListResponse". + */ + kind: string; + } + /** + * Represents a File resource. A file contains the metadata for a report run. + * It shows the status of the run and holds the URLs to the generated report + * data if the run is finished and the status is "REPORT_AVAILABLE". + */ + export interface Schema$File { + /** + * The date range for which the file has report data. The date range will + * always be the absolute date range for which the report is run. + */ + dateRange: Schema$DateRange; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The filename of the file. + */ + fileName: string; + /** + * The output format of the report. Only available once the file is + * available. + */ + format: string; + /** + * The unique ID of this report file. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#file. + */ + kind: string; + /** + * The timestamp in milliseconds since epoch when this file was last + * modified. + */ + lastModifiedTime: string; + /** + * The ID of the report this file was generated from. + */ + reportId: string; + /** + * The status of the report file. + */ + status: string; + /** + * The URLs where the completed report file can be downloaded. + */ + urls: any; + } + /** + * Represents the list of File resources. + */ + export interface Schema$FileList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The files returned in this response. + */ + items: Schema$File[]; + /** + * The kind of list this is, in this case dfareporting#fileList. + */ + kind: string; + /** + * Continuation token used to page through files. To retrieve the next page + * of results, set the next request's "pageToken" to the value + * of this field. The page token is only valid for a limited amount of time + * and should not be persisted. + */ + nextPageToken: string; + } + /** + * Flight + */ + export interface Schema$Flight { + /** + * Inventory item flight end date. + */ + endDate: string; + /** + * Rate or cost of this flight. + */ + rateOrCost: string; + /** + * Inventory item flight start date. + */ + startDate: string; + /** + * Units of this flight. + */ + units: string; + } + /** + * Floodlight Activity GenerateTag Response + */ + export interface Schema$FloodlightActivitiesGenerateTagResponse { + /** + * Generated tag for this Floodlight activity. For global site tags, this is + * the event snippet. + */ + floodlightActivityTag: string; + /** + * The global snippet section of a global site tag. The global site tag sets + * new cookies on your domain, which will store a unique identifier for a + * user or the ad click that brought the user to your site. Learn more. + */ + globalSiteTagGlobalSnippet: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivitiesGenerateTagResponse". + */ + kind: string; + } + /** + * Floodlight Activity List Response + */ + export interface Schema$FloodlightActivitiesListResponse { + /** + * Floodlight activity collection. + */ + floodlightActivities: Schema$FloodlightActivity[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivitiesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Contains properties of a Floodlight activity. + */ + export interface Schema$FloodlightActivity { + /** + * Account ID of this floodlight activity. This is a read-only field that + * can be left blank. + */ + accountId: string; + /** + * Advertiser ID of this floodlight activity. If this field is left blank, + * the value will be copied over either from the activity group's + * advertiser or the existing activity's advertiser. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Code type used for cache busting in the generated tag. Applicable only + * when floodlightActivityGroupType is COUNTER and countingMethod is + * STANDARD_COUNTING or UNIQUE_COUNTING. + */ + cacheBustingType: string; + /** + * Counting method for conversions for this floodlight activity. This is a + * required field. + */ + countingMethod: string; + /** + * Dynamic floodlight tags. + */ + defaultTags: Schema$FloodlightActivityDynamicTag[]; + /** + * URL where this tag will be deployed. If specified, must be less than 256 + * characters long. + */ + expectedUrl: string; + /** + * Floodlight activity group ID of this floodlight activity. This is a + * required field. + */ + floodlightActivityGroupId: string; + /** + * Name of the associated floodlight activity group. This is a read-only + * field. + */ + floodlightActivityGroupName: string; + /** + * Tag string of the associated floodlight activity group. This is a + * read-only field. + */ + floodlightActivityGroupTagString: string; + /** + * Type of the associated floodlight activity group. This is a read-only + * field. + */ + floodlightActivityGroupType: string; + /** + * Floodlight configuration ID of this floodlight activity. If this field is + * left blank, the value will be copied over either from the activity + * group's floodlight configuration or from the existing activity's + * floodlight configuration. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * The type of Floodlight tag this activity will generate. This is a + * required field. + */ + floodlightTagType: string; + /** + * Whether this activity is archived. + */ + hidden: boolean; + /** + * ID of this floodlight activity. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight activity. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivity". + */ + kind: string; + /** + * Name of this floodlight activity. This is a required field. Must be less + * than 129 characters long and cannot contain quotes. + */ + name: string; + /** + * General notes or implementation instructions for the tag. + */ + notes: string; + /** + * Publisher dynamic floodlight tags. + */ + publisherTags: Schema$FloodlightActivityPublisherDynamicTag[]; + /** + * Whether this tag should use SSL. + */ + secure: boolean; + /** + * Whether the floodlight activity is SSL-compliant. This is a read-only + * field, its value detected by the system from the floodlight tags. + */ + sslCompliant: boolean; + /** + * Whether this floodlight activity must be SSL-compliant. + */ + sslRequired: boolean; + /** + * Subaccount ID of this floodlight activity. This is a read-only field that + * can be left blank. + */ + subaccountId: string; + /** + * Tag format type for the floodlight activity. If left blank, the tag + * format will default to HTML. + */ + tagFormat: string; + /** + * Value of the cat= parameter in the floodlight tag, which the ad servers + * use to identify the activity. This is optional: if empty, a new tag + * string will be generated for you. This string must be 1 to 8 characters + * long, with valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag + * string must also be unique among activities of the same activity group. + * This field is read-only after insertion. + */ + tagString: string; + /** + * List of the user-defined variables used by this conversion tag. These map + * to the "u[1-100]=" in the tags. Each of these can have a user + * defined type. Acceptable values are U1 to U100, inclusive. + */ + userDefinedVariableTypes: string[]; + } + /** + * Dynamic Tag + */ + export interface Schema$FloodlightActivityDynamicTag { + /** + * ID of this dynamic tag. This is a read-only, auto-generated field. + */ + id: string; + /** + * Name of this tag. + */ + name: string; + /** + * Tag code. + */ + tag: string; + } + /** + * Contains properties of a Floodlight activity group. + */ + export interface Schema$FloodlightActivityGroup { + /** + * Account ID of this floodlight activity group. This is a read-only field + * that can be left blank. + */ + accountId: string; + /** + * Advertiser ID of this floodlight activity group. If this field is left + * blank, the value will be copied over either from the floodlight + * configuration's advertiser or from the existing activity group's + * advertiser. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Floodlight configuration ID of this floodlight activity group. This is a + * required field. + */ + floodlightConfigurationId: string; + /** + * Dimension value for the ID of the floodlight configuration. This is a + * read-only, auto-generated field. + */ + floodlightConfigurationIdDimensionValue: Schema$DimensionValue; + /** + * ID of this floodlight activity group. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight activity group. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivityGroup". + */ + kind: string; + /** + * Name of this floodlight activity group. This is a required field. Must be + * less than 65 characters long and cannot contain quotes. + */ + name: string; + /** + * Subaccount ID of this floodlight activity group. This is a read-only + * field that can be left blank. + */ + subaccountId: string; + /** + * Value of the type= parameter in the floodlight tag, which the ad servers + * use to identify the activity group that the activity belongs to. This is + * optional: if empty, a new tag string will be generated for you. This + * string must be 1 to 8 characters long, with valid characters being + * [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among + * activity groups of the same floodlight configuration. This field is + * read-only after insertion. + */ + tagString: string; + /** + * Type of the floodlight activity group. This is a required field that is + * read-only after insertion. + */ + type: string; + } + /** + * Floodlight Activity Group List Response + */ + export interface Schema$FloodlightActivityGroupsListResponse { + /** + * Floodlight activity group collection. + */ + floodlightActivityGroups: Schema$FloodlightActivityGroup[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightActivityGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Publisher Dynamic Tag + */ + export interface Schema$FloodlightActivityPublisherDynamicTag { + /** + * Whether this tag is applicable only for click-throughs. + */ + clickThrough: boolean; + /** + * Directory site ID of this dynamic tag. This is a write-only field that + * can be used as an alternative to the siteId field. When this resource is + * retrieved, only the siteId field will be populated. + */ + directorySiteId: string; + /** + * Dynamic floodlight tag. + */ + dynamicTag: Schema$FloodlightActivityDynamicTag; + /** + * Site ID of this dynamic tag. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Whether this tag is applicable only for view-throughs. + */ + viewThrough: boolean; + } + /** + * Contains properties of a Floodlight configuration. + */ + export interface Schema$FloodlightConfiguration { + /** + * Account ID of this floodlight configuration. This is a read-only field + * that can be left blank. + */ + accountId: string; + /** + * Advertiser ID of the parent advertiser of this floodlight configuration. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether advertiser data is shared with Google Analytics. + */ + analyticsDataSharingEnabled: boolean; + /** + * Whether the exposure-to-conversion report is enabled. This report shows + * detailed pathway information on up to 10 of the most recent ad exposures + * seen by a user before converting. + */ + exposureToConversionEnabled: boolean; + /** + * Day that will be counted as the first day of the week in reports. This is + * a required field. + */ + firstDayOfWeek: string; + /** + * ID of this floodlight configuration. This is a read-only, auto-generated + * field. + */ + id: string; + /** + * Dimension value for the ID of this floodlight configuration. This is a + * read-only, auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Whether in-app attribution tracking is enabled. + */ + inAppAttributionTrackingEnabled: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightConfiguration". + */ + kind: string; + /** + * Lookback window settings for this floodlight configuration. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Types of attribution options for natural search conversions. + */ + naturalSearchConversionAttributionOption: string; + /** + * Settings for DCM Omniture integration. + */ + omnitureSettings: Schema$OmnitureSettings; + /** + * Subaccount ID of this floodlight configuration. This is a read-only field + * that can be left blank. + */ + subaccountId: string; + /** + * Configuration settings for dynamic and image floodlight tags. + */ + tagSettings: Schema$TagSettings; + /** + * List of third-party authentication tokens enabled for this configuration. + */ + thirdPartyAuthenticationTokens: Schema$ThirdPartyAuthenticationToken[]; + /** + * List of user defined variables enabled for this configuration. + */ + userDefinedVariableConfigurations: + Schema$UserDefinedVariableConfiguration[]; + } + /** + * Floodlight Configuration List Response + */ + export interface Schema$FloodlightConfigurationsListResponse { + /** + * Floodlight configuration collection. + */ + floodlightConfigurations: Schema$FloodlightConfiguration[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#floodlightConfigurationsListResponse". + */ + kind: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "FlOODLIGHT". + */ + export interface Schema$FloodlightReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#floodlightReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + } + /** + * Frequency Cap. + */ + export interface Schema$FrequencyCap { + /** + * Duration of time, in seconds, for this frequency cap. The maximum + * duration is 90 days. Acceptable values are 1 to 7776000, inclusive. + */ + duration: string; + /** + * Number of times an individual user can be served the ad within the + * specified duration. Acceptable values are 1 to 15, inclusive. + */ + impressions: string; + } + /** + * FsCommand. + */ + export interface Schema$FsCommand { + /** + * Distance from the left of the browser.Applicable when positionOption is + * DISTANCE_FROM_TOP_LEFT_CORNER. + */ + left: number; + /** + * Position in the browser where the window will open. + */ + positionOption: string; + /** + * Distance from the top of the browser. Applicable when positionOption is + * DISTANCE_FROM_TOP_LEFT_CORNER. + */ + top: number; + /** + * Height of the window. + */ + windowHeight: number; + /** + * Width of the window. + */ + windowWidth: number; + } + /** + * Geographical Targeting. + */ + export interface Schema$GeoTargeting { + /** + * Cities to be targeted. For each city only dartId is required. The other + * fields are populated automatically when the ad is inserted or updated. If + * targeting a city, do not target or exclude the country of the city, and + * do not target the metro or region of the city. + */ + cities: Schema$City[]; + /** + * Countries to be targeted or excluded from targeting, depending on the + * setting of the excludeCountries field. For each country only dartId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting or excluding a country, do not target + * regions, cities, metros, or postal codes in the same country. + */ + countries: Schema$Country[]; + /** + * Whether or not to exclude the countries in the countries field from + * targeting. If false, the countries field refers to countries which will + * be targeted by the ad. + */ + excludeCountries: boolean; + /** + * Metros to be targeted. For each metro only dmaId is required. The other + * fields are populated automatically when the ad is inserted or updated. If + * targeting a metro, do not target or exclude the country of the metro. + */ + metros: Schema$Metro[]; + /** + * Postal codes to be targeted. For each postal code only id is required. + * The other fields are populated automatically when the ad is inserted or + * updated. If targeting a postal code, do not target or exclude the country + * of the postal code. + */ + postalCodes: Schema$PostalCode[]; + /** + * Regions to be targeted. For each region only dartId is required. The + * other fields are populated automatically when the ad is inserted or + * updated. If targeting a region, do not target or exclude the country of + * the region. + */ + regions: Schema$Region[]; + } + /** + * Represents a buy from the DoubleClick Planning inventory store. + */ + export interface Schema$InventoryItem { + /** + * Account ID of this inventory item. + */ + accountId: string; + /** + * Ad slots of this inventory item. If this inventory item represents a + * standalone placement, there will be exactly one ad slot. If this + * inventory item represents a placement group, there will be more than one + * ad slot, each representing one child placement in that placement group. + */ + adSlots: Schema$AdSlot[]; + /** + * Advertiser ID of this inventory item. + */ + advertiserId: string; + /** + * Content category ID of this inventory item. + */ + contentCategoryId: string; + /** + * Estimated click-through rate of this inventory item. + */ + estimatedClickThroughRate: string; + /** + * Estimated conversion rate of this inventory item. + */ + estimatedConversionRate: string; + /** + * ID of this inventory item. + */ + id: string; + /** + * Whether this inventory item is in plan. + */ + inPlan: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#inventoryItem". + */ + kind: string; + /** + * Information about the most recent modification of this inventory item. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this inventory item. For standalone inventory items, this is the + * same name as that of its only ad slot. For group inventory items, this + * can differ from the name of any of its ad slots. + */ + name: string; + /** + * Negotiation channel ID of this inventory item. + */ + negotiationChannelId: string; + /** + * Order ID of this inventory item. + */ + orderId: string; + /** + * Placement strategy ID of this inventory item. + */ + placementStrategyId: string; + /** + * Pricing of this inventory item. + */ + pricing: Schema$Pricing; + /** + * Project ID of this inventory item. + */ + projectId: string; + /** + * RFP ID of this inventory item. + */ + rfpId: string; + /** + * ID of the site this inventory item is associated with. + */ + siteId: string; + /** + * Subaccount ID of this inventory item. + */ + subaccountId: string; + /** + * Type of inventory item. + */ + type: string; + } + /** + * Inventory item List Response + */ + export interface Schema$InventoryItemsListResponse { + /** + * Inventory item collection + */ + inventoryItems: Schema$InventoryItem[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#inventoryItemsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + } + /** + * Key Value Targeting Expression. + */ + export interface Schema$KeyValueTargetingExpression { + /** + * Keyword expression being targeted by the ad. + */ + expression: string; + } + /** + * Contains information about where a user's browser is taken after the + * user clicks an ad. + */ + export interface Schema$LandingPage { + /** + * Advertiser ID of this landing page. This is a required field. + */ + advertiserId: string; + /** + * Whether this landing page has been archived. + */ + archived: boolean; + /** + * ID of this landing page. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#landingPage". + */ + kind: string; + /** + * Name of this landing page. This is a required field. It must be less than + * 256 characters long. + */ + name: string; + /** + * URL of this landing page. This is a required field. + */ + url: string; + } + /** + * Contains information about a language that can be targeted by ads. + */ + export interface Schema$Language { + /** + * Language ID of this language. This is the ID used for targeting and + * generating reports. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#language". + */ + kind: string; + /** + * Format of language code is an ISO 639 two-letter language code optionally + * followed by an underscore followed by an ISO 3166 code. Examples are + * "en" for English or "zh_CN" for Simplified Chinese. + */ + languageCode: string; + /** + * Name of this language. + */ + name: string; + } + /** + * Language List Response + */ + export interface Schema$LanguagesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#languagesListResponse". + */ + kind: string; + /** + * Language collection. + */ + languages: Schema$Language[]; + } + /** + * Language Targeting. + */ + export interface Schema$LanguageTargeting { + /** + * Languages that this ad targets. For each language only languageId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + languages: Schema$Language[]; + } + /** + * Modification timestamp. + */ + export interface Schema$LastModifiedInfo { + /** + * Timestamp of the last change in milliseconds since epoch. + */ + time: string; + } + /** + * A group clause made up of list population terms representing constraints + * joined by ORs. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.patch - * @desc Updates an existing user role. This method supports patch semantics. - * @alias dfareporting.userRoles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id User role ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ListPopulationClause { + /** + * Terms of this list population clause. Each clause is made up of list + * population terms representing constraints and are joined by ORs. + */ + terms: Schema$ListPopulationTerm[]; + } + /** + * Remarketing List Population Rule. + */ + export interface Schema$ListPopulationRule { + /** + * Floodlight activity ID associated with this rule. This field can be left + * blank. + */ + floodlightActivityId: string; + /** + * Name of floodlight activity associated with this rule. This is a + * read-only, auto-generated field. + */ + floodlightActivityName: string; + /** + * Clauses that make up this list population rule. Clauses are joined by + * ANDs, and the clauses themselves are made up of list population terms + * which are joined by ORs. + */ + listPopulationClauses: Schema$ListPopulationClause[]; + } + /** + * Remarketing List Population Rule Term. + */ + export interface Schema$ListPopulationTerm { + /** + * Will be true if the term should check if the user is in the list and + * false if the term should check if the user is not in the list. This field + * is only relevant when type is set to LIST_MEMBERSHIP_TERM. False by + * default. + */ + contains: boolean; + /** + * Whether to negate the comparison result of this term during rule + * evaluation. This field is only relevant when type is left unset or set to + * CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + negation: boolean; + /** + * Comparison operator of this term. This field is only relevant when type + * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + operator: string; + /** + * ID of the list in question. This field is only relevant when type is set + * to LIST_MEMBERSHIP_TERM. + */ + remarketingListId: string; + /** + * List population term type determines the applicable fields in this + * object. If left unset or set to CUSTOM_VARIABLE_TERM, then variableName, + * variableFriendlyName, operator, value, and negation are applicable. If + * set to LIST_MEMBERSHIP_TERM then remarketingListId and contains are + * applicable. If set to REFERRER_TERM then operator, value, and negation + * are applicable. + */ + type: string; + /** + * Literal to compare the variable to. This field is only relevant when type + * is left unset or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM. + */ + value: string; + /** + * Friendly name of this term's variable. This is a read-only, + * auto-generated field. This field is only relevant when type is left unset + * or set to CUSTOM_VARIABLE_TERM. + */ + variableFriendlyName: string; + /** + * Name of the variable (U1, U2, etc.) being compared in this term. This + * field is only relevant when type is set to null, CUSTOM_VARIABLE_TERM or + * REFERRER_TERM. + */ + variableName: string; + } + /** + * Remarketing List Targeting Expression. + */ + export interface Schema$ListTargetingExpression { + /** + * Expression describing which lists are being targeted by the ad. + */ + expression: string; + } + /** + * Lookback configuration settings. + */ + export interface Schema$LookbackConfiguration { + /** + * Lookback window, in days, from the last time a given user clicked on one + * of your ads. If you enter 0, clicks will not be considered as triggering + * events for floodlight tracking. If you leave this field blank, the + * default value for your account will be used. Acceptable values are 0 to + * 90, inclusive. + */ + clickDuration: number; + /** + * Lookback window, in days, from the last time a given user viewed one of + * your ads. If you enter 0, impressions will not be considered as + * triggering events for floodlight tracking. If you leave this field blank, + * the default value for your account will be used. Acceptable values are 0 + * to 90, inclusive. + */ + postImpressionActivitiesDuration: number; + } + /** + * Represents a metric. + */ + export interface Schema$Metric { + /** + * The kind of resource this is, in this case dfareporting#metric. + */ + kind: string; + /** + * The metric name, e.g. dfa:impressions + */ + name: string; + } + /** + * Contains information about a metro region that can be targeted by ads. + */ + export interface Schema$Metro { + /** + * Country code of the country to which this metro region belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this metro region belongs. + */ + countryDartId: string; + /** + * DART ID of this metro region. + */ + dartId: string; + /** + * DMA ID of this metro region. This is the ID used for targeting and + * generating reports, and is equivalent to metro_code. + */ + dmaId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#metro". + */ + kind: string; + /** + * Metro code of this metro region. This is equivalent to dma_id. + */ + metroCode: string; + /** + * Name of this metro region. + */ + name: string; + } + /** + * Metro List Response + */ + export interface Schema$MetrosListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#metrosListResponse". + */ + kind: string; + /** + * Metro collection. + */ + metros: Schema$Metro[]; + } + /** + * Contains information about a mobile carrier that can be targeted by ads. + */ + export interface Schema$MobileCarrier { + /** + * Country code of the country to which this mobile carrier belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this mobile carrier belongs. + */ + countryDartId: string; + /** + * ID of this mobile carrier. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#mobileCarrier". + */ + kind: string; + /** + * Name of this mobile carrier. + */ + name: string; + } + /** + * Mobile Carrier List Response + */ + export interface Schema$MobileCarriersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#mobileCarriersListResponse". + */ + kind: string; + /** + * Mobile carrier collection. + */ + mobileCarriers: Schema$MobileCarrier[]; + } + /** + * Object Filter. + */ + export interface Schema$ObjectFilter { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#objectFilter". + */ + kind: string; + /** + * Applicable when status is ASSIGNED. The user has access to objects with + * these object IDs. + */ + objectIds: string[]; + /** + * Status of the filter. NONE means the user has access to none of the + * objects. ALL means the user has access to all objects. ASSIGNED means the + * user has access to the objects with IDs in the objectIds list. + */ + status: string; + } + /** + * Offset Position. + */ + export interface Schema$OffsetPosition { + /** + * Offset distance from left side of an asset or a window. + */ + left: number; + /** + * Offset distance from top side of an asset or a window. + */ + top: number; + } + /** + * Omniture Integration Settings. + */ + export interface Schema$OmnitureSettings { + /** + * Whether placement cost data will be sent to Omniture. This property can + * be enabled only if omnitureIntegrationEnabled is true. + */ + omnitureCostDataEnabled: boolean; + /** + * Whether Omniture integration is enabled. This property can be enabled + * only when the "Advanced Ad Serving" account setting is enabled. + */ + omnitureIntegrationEnabled: boolean; + } + /** + * Contains information about an operating system that can be targeted by ads. + */ + export interface Schema$OperatingSystem { + /** + * DART ID of this operating system. This is the ID used for targeting. + */ + dartId: string; + /** + * Whether this operating system is for desktop. + */ + desktop: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystem". + */ + kind: string; + /** + * Whether this operating system is for mobile. + */ + mobile: boolean; + /** + * Name of this operating system. + */ + name: string; + } + /** + * Operating System List Response + */ + export interface Schema$OperatingSystemsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemsListResponse". + */ + kind: string; + /** + * Operating system collection. + */ + operatingSystems: Schema$OperatingSystem[]; + } + /** + * Contains information about a particular version of an operating system that + * can be targeted by ads. + */ + export interface Schema$OperatingSystemVersion { + /** + * ID of this operating system version. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemVersion". + */ + kind: string; + /** + * Major version (leftmost number) of this operating system version. + */ + majorVersion: string; + /** + * Minor version (number after the first dot) of this operating system + * version. + */ + minorVersion: string; + /** + * Name of this operating system version. + */ + name: string; + /** + * Operating system of this operating system version. + */ + operatingSystem: Schema$OperatingSystem; + } + /** + * Operating System Version List Response + */ + export interface Schema$OperatingSystemVersionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#operatingSystemVersionsListResponse". + */ + kind: string; + /** + * Operating system version collection. + */ + operatingSystemVersions: Schema$OperatingSystemVersion[]; + } + /** + * Creative optimization activity. + */ + export interface Schema$OptimizationActivity { + /** + * Floodlight activity ID of this optimization activity. This is a required + * field. + */ + floodlightActivityId: string; + /** + * Dimension value for the ID of the floodlight activity. This is a + * read-only, auto-generated field. + */ + floodlightActivityIdDimensionValue: Schema$DimensionValue; + /** + * Weight associated with this optimization. The weight assigned will be + * understood in proportion to the weights assigned to the other + * optimization activities. Value must be greater than or equal to 1. + */ + weight: number; + } + /** + * Describes properties of a DoubleClick Planning order. + */ + export interface Schema$Order { + /** + * Account ID of this order. + */ + accountId: string; + /** + * Advertiser ID of this order. + */ + advertiserId: string; + /** + * IDs for users that have to approve documents created for this order. + */ + approverUserProfileIds: string[]; + /** + * Buyer invoice ID associated with this order. + */ + buyerInvoiceId: string; + /** + * Name of the buyer organization. + */ + buyerOrganizationName: string; + /** + * Comments in this order. + */ + comments: string; + /** + * Contacts for this order. + */ + contacts: Schema$OrderContact[]; + /** + * ID of this order. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#order". + */ + kind: string; + /** + * Information about the most recent modification of this order. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this order. + */ + name: string; + /** + * Notes of this order. + */ + notes: string; + /** + * ID of the terms and conditions template used in this order. + */ + planningTermId: string; + /** + * Project ID of this order. + */ + projectId: string; + /** + * Seller order ID associated with this order. + */ + sellerOrderId: string; + /** + * Name of the seller organization. + */ + sellerOrganizationName: string; + /** + * Site IDs this order is associated with. + */ + siteId: string[]; + /** + * Free-form site names this order is associated with. + */ + siteNames: string[]; + /** + * Subaccount ID of this order. + */ + subaccountId: string; + /** + * Terms and conditions of this order. + */ + termsAndConditions: string; + } + /** + * Contact of an order. + */ + export interface Schema$OrderContact { + /** + * Free-form information about this contact. It could be any information + * related to this contact in addition to type, title, name, and signature + * user profile ID. + */ + contactInfo: string; + /** + * Name of this contact. + */ + contactName: string; + /** + * Title of this contact. + */ + contactTitle: string; + /** + * Type of this contact. + */ + contactType: string; + /** + * ID of the user profile containing the signature that will be embedded + * into order documents. + */ + signatureUserProfileId: string; + } + /** + * Contains properties of a DoubleClick Planning order document. + */ + export interface Schema$OrderDocument { + /** + * Account ID of this order document. + */ + accountId: string; + /** + * Advertiser ID of this order document. + */ + advertiserId: string; + /** + * The amended order document ID of this order document. An order document + * can be created by optionally amending another order document so that the + * change history can be preserved. + */ + amendedOrderDocumentId: string; + /** + * IDs of users who have approved this order document. + */ + approvedByUserProfileIds: string[]; + /** + * Whether this order document is cancelled. + */ + cancelled: boolean; + /** + * Information about the creation of this order document. + */ + createdInfo: Schema$LastModifiedInfo; + /** + * Effective date of this order document. + */ + effectiveDate: string; + /** + * ID of this order document. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#orderDocument". + */ + kind: string; + /** + * List of email addresses that received the last sent document. + */ + lastSentRecipients: string[]; + /** + * Timestamp of the last email sent with this order document. + */ + lastSentTime: string; + /** + * ID of the order from which this order document is created. + */ + orderId: string; + /** + * Project ID of this order document. + */ + projectId: string; + /** + * Whether this order document has been signed. + */ + signed: boolean; + /** + * Subaccount ID of this order document. + */ + subaccountId: string; + /** + * Title of this order document. + */ + title: string; + /** + * Type of this order document + */ + type: string; + } + /** + * Order document List Response + */ + export interface Schema$OrderDocumentsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#orderDocumentsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Order document collection + */ + orderDocuments: Schema$OrderDocument[]; + } + /** + * Order List Response + */ + export interface Schema$OrdersListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#ordersListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Order collection. + */ + orders: Schema$Order[]; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "PATH_TO_CONVERSION". */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dfareporting.userRoles.update - * @desc Updates an existing user role. - * @alias dfareporting.userRoles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {().UserRole} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$PathToConversionReportCompatibleFields { + /** + * Conversion dimensions which are compatible to be selected in the + * "conversionDimensions" section of the report. + */ + conversionDimensions: Schema$Dimension[]; + /** + * Custom floodlight variables which are compatible to be selected in the + * "customFloodlightVariables" section of the report. + */ + customFloodlightVariables: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#pathToConversionReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Per-interaction dimensions which are compatible to be selected in the + * "perInteractionDimensions" section of the report. + */ + perInteractionDimensions: Schema$Dimension[]; + } + /** + * Contains properties of a placement. + */ + export interface Schema$Placement { + /** + * Account ID of this placement. This field can be left blank. + */ + accountId: string; + /** + * Whether this placement opts out of ad blocking. When true, ad blocking is + * disabled for this placement. When false, the campaign and site settings + * take effect. + */ + adBlockingOptOut: boolean; + /** + * Advertiser ID of this placement. This field can be left blank. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this placement is archived. + */ + archived: boolean; + /** + * Campaign ID of this placement. This field is a required field on + * insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * Comments for this placement. + */ + comment: string; + /** + * Placement compatibility. DISPLAY and DISPLAY_INTERSTITIAL refer to + * rendering on desktop, on mobile devices or in mobile apps for regular or + * interstitial ads respectively. APP and APP_INTERSTITIAL are no longer + * allowed for new placement insertions. Instead, use DISPLAY or + * DISPLAY_INTERSTITIAL. IN_STREAM_VIDEO refers to rendering in in-stream + * video ads developed with the VAST standard. This field is required on + * insertion. + */ + compatibility: string; + /** + * ID of the content category assigned to this placement. + */ + contentCategoryId: string; + /** + * Information about the creation of this placement. This is a read-only + * field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Directory site ID of this placement. On insert, you must set either this + * field or the siteId field to specify the site associated with this + * placement. This is a required field that is read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * External ID for this placement. + */ + externalId: string; + /** + * ID of this placement. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this placement. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key name of this placement. This is a read-only, auto-generated field. + */ + keyName: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placement". + */ + kind: string; + /** + * Information about the most recent modification of this placement. This is + * a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Lookback window settings for this placement. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Name of this placement.This is a required field and must be less than 256 + * characters long. + */ + name: string; + /** + * Whether payment was approved for this placement. This is a read-only + * field relevant only to publisher-paid placements. + */ + paymentApproved: boolean; + /** + * Payment source for this placement. This is a required field that is + * read-only after insertion. + */ + paymentSource: string; + /** + * ID of this placement's group, if applicable. + */ + placementGroupId: string; + /** + * Dimension value for the ID of the placement group. This is a read-only, + * auto-generated field. + */ + placementGroupIdDimensionValue: Schema$DimensionValue; + /** + * ID of the placement strategy assigned to this placement. + */ + placementStrategyId: string; + /** + * Pricing schedule of this placement. This field is required on insertion, + * specifically subfields startDate, endDate and pricingType. + */ + pricingSchedule: Schema$PricingSchedule; + /** + * Whether this placement is the primary placement of a roadblock (placement + * group). You cannot change this field from true to false. Setting this + * field to true will automatically set the primary field on the original + * primary placement of the roadblock to false, and it will automatically + * set the roadblock's primaryPlacementId field to the ID of this + * placement. + */ + primary: boolean; + /** + * Information about the last publisher update. This is a read-only field. + */ + publisherUpdateInfo: Schema$LastModifiedInfo; + /** + * Site ID associated with this placement. On insert, you must set either + * this field or the directorySiteId field to specify the site associated + * with this placement. This is a required field that is read-only after + * insertion. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Size associated with this placement. When inserting or updating a + * placement, only the size ID field is used. This field is required on + * insertion. + */ + size: Schema$Size; + /** + * Whether creatives assigned to this placement must be SSL-compliant. + */ + sslRequired: boolean; + /** + * Third-party placement status. + */ + status: string; + /** + * Subaccount ID of this placement. This field can be left blank. + */ + subaccountId: string; + /** + * Tag formats to generate for this placement. This field is required on + * insertion. Acceptable values are: - "PLACEMENT_TAG_STANDARD" - + * "PLACEMENT_TAG_IFRAME_JAVASCRIPT" - + * "PLACEMENT_TAG_IFRAME_ILAYER" - + * "PLACEMENT_TAG_INTERNAL_REDIRECT" - + * "PLACEMENT_TAG_JAVASCRIPT" - + * "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT" - + * "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT" - + * "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT" - + * "PLACEMENT_TAG_CLICK_COMMANDS" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3" - + * "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4" - + * "PLACEMENT_TAG_TRACKING" - + * "PLACEMENT_TAG_TRACKING_IFRAME" - + * "PLACEMENT_TAG_TRACKING_JAVASCRIPT" + */ + tagFormats: string[]; + /** + * Tag settings for this placement. + */ + tagSetting: Schema$TagSetting; + /** + * Whether Verification and ActiveView are disabled for in-stream video + * creatives for this placement. The same setting videoActiveViewOptOut + * exists on the site level -- the opt out occurs if either of these + * settings are true. These settings are distinct from + * DirectorySites.settings.activeViewOptOut or + * Sites.siteSettings.activeViewOptOut which only apply to display ads. + * However, Accounts.activeViewOptOut opts out both video traffic, as well + * as display ads, from Verification and ActiveView. + */ + videoActiveViewOptOut: boolean; + /** + * A collection of settings which affect video creatives served through this + * placement. Applicable to placements with IN_STREAM_VIDEO compatibility. + */ + videoSettings: Schema$VideoSettings; + /** + * VPAID adapter setting for this placement. Controls which VPAID format the + * measurement adapter will use for in-stream video creatives assigned to + * this placement. Note: Flash is no longer supported. This field now + * defaults to HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoice: string; + } + /** + * Placement Assignment. + */ + export interface Schema$PlacementAssignment { + /** + * Whether this placement assignment is active. When true, the placement + * will be included in the ad's rotation. + */ + active: boolean; + /** + * ID of the placement to be assigned. This is a required field. + */ + placementId: string; + /** + * Dimension value for the ID of the placement. This is a read-only, + * auto-generated field. + */ + placementIdDimensionValue: Schema$DimensionValue; + /** + * Whether the placement to be assigned requires SSL. This is a read-only + * field that is auto-generated when the ad is inserted or updated. + */ + sslRequired: boolean; + } + /** + * Contains properties of a package or roadblock. + */ + export interface Schema$PlacementGroup { + /** + * Account ID of this placement group. This is a read-only field that can be + * left blank. + */ + accountId: string; + /** + * Advertiser ID of this placement group. This is a required field on + * insertion. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Whether this placement group is archived. + */ + archived: boolean; + /** + * Campaign ID of this placement group. This field is required on insertion. + */ + campaignId: string; + /** + * Dimension value for the ID of the campaign. This is a read-only, + * auto-generated field. + */ + campaignIdDimensionValue: Schema$DimensionValue; + /** + * IDs of placements which are assigned to this placement group. This is a + * read-only, auto-generated field. + */ + childPlacementIds: string[]; + /** + * Comments for this placement group. + */ + comment: string; + /** + * ID of the content category assigned to this placement group. + */ + contentCategoryId: string; + /** + * Information about the creation of this placement group. This is a + * read-only field. + */ + createInfo: Schema$LastModifiedInfo; + /** + * Directory site ID associated with this placement group. On insert, you + * must set either this field or the site_id field to specify the site + * associated with this placement group. This is a required field that is + * read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * External ID for this placement. + */ + externalId: string; + /** + * ID of this placement group. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this placement group. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementGroup". + */ + kind: string; + /** + * Information about the most recent modification of this placement group. + * This is a read-only field. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this placement group. This is a required field and must be less + * than 256 characters long. + */ + name: string; + /** + * Type of this placement group. A package is a simple group of placements + * that acts as a single pricing point for a group of tags. A roadblock is a + * group of placements that not only acts as a single pricing point, but + * also assumes that all the tags in it will be served at the same time. A + * roadblock requires one of its assigned placements to be marked as primary + * for reporting. This field is required on insertion. + */ + placementGroupType: string; + /** + * ID of the placement strategy assigned to this placement group. + */ + placementStrategyId: string; + /** + * Pricing schedule of this placement group. This field is required on + * insertion. + */ + pricingSchedule: Schema$PricingSchedule; + /** + * ID of the primary placement, used to calculate the media cost of a + * roadblock (placement group). Modifying this field will automatically + * modify the primary field on all affected roadblock child placements. + */ + primaryPlacementId: string; + /** + * Dimension value for the ID of the primary placement. This is a read-only, + * auto-generated field. + */ + primaryPlacementIdDimensionValue: Schema$DimensionValue; + /** + * Site ID associated with this placement group. On insert, you must set + * either this field or the directorySiteId field to specify the site + * associated with this placement group. This is a required field that is + * read-only after insertion. + */ + siteId: string; + /** + * Dimension value for the ID of the site. This is a read-only, + * auto-generated field. + */ + siteIdDimensionValue: Schema$DimensionValue; + /** + * Subaccount ID of this placement group. This is a read-only field that can + * be left blank. + */ + subaccountId: string; + } + /** + * Placement Group List Response + */ + export interface Schema$PlacementGroupsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementGroupsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement group collection. + */ + placementGroups: Schema$PlacementGroup[]; + } + /** + * Placement GenerateTags Response + */ + export interface Schema$PlacementsGenerateTagsResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementsGenerateTagsResponse". + */ + kind: string; + /** + * Set of generated tags for the specified placements. + */ + placementTags: Schema$PlacementTag[]; + } + /** + * Placement List Response + */ + export interface Schema$PlacementsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement collection. + */ + placements: Schema$Placement[]; + } + /** + * Placement Strategy List Response + */ + export interface Schema$PlacementStrategiesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementStrategiesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Placement strategy collection. + */ + placementStrategies: Schema$PlacementStrategy[]; + } + /** + * Contains properties of a placement strategy. + */ + export interface Schema$PlacementStrategy { + /** + * Account ID of this placement strategy.This is a read-only field that can + * be left blank. + */ + accountId: string; + /** + * ID of this placement strategy. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#placementStrategy". + */ + kind: string; + /** + * Name of this placement strategy. This is a required field. It must be + * less than 256 characters long and unique among placement strategies of + * the same account. + */ + name: string; + } + /** + * Placement Tag + */ + export interface Schema$PlacementTag { + /** + * Placement ID + */ + placementId: string; + /** + * Tags generated for this placement. + */ + tagDatas: Schema$TagData[]; + } + /** + * Contains information about a platform type that can be targeted by ads. + */ + export interface Schema$PlatformType { + /** + * ID of this platform type. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#platformType". + */ + kind: string; + /** + * Name of this platform type. + */ + name: string; + } + /** + * Platform Type List Response + */ + export interface Schema$PlatformTypesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#platformTypesListResponse". + */ + kind: string; + /** + * Platform type collection. + */ + platformTypes: Schema$PlatformType[]; + } + /** + * Popup Window Properties. + */ + export interface Schema$PopupWindowProperties { + /** + * Popup dimension for a creative. This is a read-only field. Applicable to + * the following creative types: all RICH_MEDIA and all VPAID + */ + dimension: Schema$Size; + /** + * Upper-left corner coordinates of the popup window. Applicable if + * positionType is COORDINATES. + */ + offset: Schema$OffsetPosition; + /** + * Popup window position either centered or at specific coordinate. + */ + positionType: string; + /** + * Whether to display the browser address bar. + */ + showAddressBar: boolean; + /** + * Whether to display the browser menu bar. + */ + showMenuBar: boolean; + /** + * Whether to display the browser scroll bar. + */ + showScrollBar: boolean; + /** + * Whether to display the browser status bar. + */ + showStatusBar: boolean; + /** + * Whether to display the browser tool bar. + */ + showToolBar: boolean; + /** + * Title of popup window. + */ + title: string; + } + /** + * Contains information about a postal code that can be targeted by ads. + */ + export interface Schema$PostalCode { + /** + * Postal code. This is equivalent to the id field. + */ + code: string; + /** + * Country code of the country to which this postal code belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this postal code belongs. + */ + countryDartId: string; + /** + * ID of this postal code. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#postalCode". + */ + kind: string; + } + /** + * Postal Code List Response + */ + export interface Schema$PostalCodesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#postalCodesListResponse". + */ + kind: string; + /** + * Postal code collection. + */ + postalCodes: Schema$PostalCode[]; + } + /** + * Pricing Information + */ + export interface Schema$Pricing { + /** + * Cap cost type of this inventory item. + */ + capCostType: string; + /** + * End date of this inventory item. + */ + endDate: string; + /** + * Flights of this inventory item. A flight (a.k.a. pricing period) + * represents the inventory item pricing information for a specific period + * of time. + */ + flights: Schema$Flight[]; + /** + * Group type of this inventory item if it represents a placement group. Is + * null otherwise. There are two type of placement groups: + * PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of inventory + * items that acts as a single pricing point for a group of tags. + * PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory items + * that not only acts as a single pricing point, but also assumes that all + * the tags in it will be served at the same time. A roadblock requires one + * of its assigned inventory items to be marked as primary. + */ + groupType: string; + /** + * Pricing type of this inventory item. + */ + pricingType: string; + /** + * Start date of this inventory item. + */ + startDate: string; + } + /** + * Pricing Schedule + */ + export interface Schema$PricingSchedule { + /** + * Placement cap cost option. + */ + capCostOption: string; + /** + * Whether cap costs are ignored by ad serving. + */ + disregardOverdelivery: boolean; + /** + * Placement end date. This date must be later than, or the same day as, the + * placement start date, but not later than the campaign end date. If, for + * example, you set 6/25/2015 as both the start and end dates, the effective + * placement date is just that day only, 6/25/2015. The hours, minutes, and + * seconds of the end date should not be set, as doing so will result in an + * error. This field is required on insertion. + */ + endDate: string; + /** + * Whether this placement is flighted. If true, pricing periods will be + * computed automatically. + */ + flighted: boolean; + /** + * Floodlight activity ID associated with this placement. This field should + * be set when placement pricing type is set to PRICING_TYPE_CPA. + */ + floodlightActivityId: string; + /** + * Pricing periods for this placement. + */ + pricingPeriods: Schema$PricingSchedulePricingPeriod[]; + /** + * Placement pricing type. This field is required on insertion. + */ + pricingType: string; + /** + * Placement start date. This date must be later than, or the same day as, + * the campaign start date. The hours, minutes, and seconds of the start + * date should not be set, as doing so will result in an error. This field + * is required on insertion. + */ + startDate: string; + /** + * Testing start date of this placement. The hours, minutes, and seconds of + * the start date should not be set, as doing so will result in an error. + */ + testingStartDate: string; + } + /** + * Pricing Period + */ + export interface Schema$PricingSchedulePricingPeriod { + /** + * Pricing period end date. This date must be later than, or the same day + * as, the pricing period start date, but not later than the placement end + * date. The period end date can be the same date as the period start date. + * If, for example, you set 6/25/2015 as both the start and end dates, the + * effective pricing period date is just that day only, 6/25/2015. The + * hours, minutes, and seconds of the end date should not be set, as doing + * so will result in an error. + */ + endDate: string; + /** + * Comments for this pricing period. + */ + pricingComment: string; + /** + * Rate or cost of this pricing period in nanos (i.e., multipled by + * 1000000000). Acceptable values are 0 to 1000000000000000000, inclusive. + */ + rateOrCostNanos: string; + /** + * Pricing period start date. This date must be later than, or the same day + * as, the placement start date. The hours, minutes, and seconds of the + * start date should not be set, as doing so will result in an error. + */ + startDate: string; + /** + * Units of this pricing period. Acceptable values are 0 to 10000000000, + * inclusive. + */ + units: string; + } + /** + * Contains properties of a DoubleClick Planning project. + */ + export interface Schema$Project { + /** + * Account ID of this project. + */ + accountId: string; + /** + * Advertiser ID of this project. + */ + advertiserId: string; + /** + * Audience age group of this project. + */ + audienceAgeGroup: string; + /** + * Audience gender of this project. + */ + audienceGender: string; + /** + * Budget of this project in the currency specified by the current account. + * The value stored in this field represents only the non-fractional amount. + * For example, for USD, the smallest value that can be represented by this + * field is 1 US dollar. + */ + budget: string; + /** + * Client billing code of this project. + */ + clientBillingCode: string; + /** + * Name of the project client. + */ + clientName: string; + /** + * End date of the project. + */ + endDate: string; + /** + * ID of this project. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#project". + */ + kind: string; + /** + * Information about the most recent modification of this project. + */ + lastModifiedInfo: Schema$LastModifiedInfo; + /** + * Name of this project. + */ + name: string; + /** + * Overview of this project. + */ + overview: string; + /** + * Start date of the project. + */ + startDate: string; + /** + * Subaccount ID of this project. + */ + subaccountId: string; + /** + * Number of clicks that the advertiser is targeting. + */ + targetClicks: string; + /** + * Number of conversions that the advertiser is targeting. + */ + targetConversions: string; + /** + * CPA that the advertiser is targeting. + */ + targetCpaNanos: string; + /** + * CPC that the advertiser is targeting. + */ + targetCpcNanos: string; + /** + * vCPM from Active View that the advertiser is targeting. + */ + targetCpmActiveViewNanos: string; + /** + * CPM that the advertiser is targeting. + */ + targetCpmNanos: string; + /** + * Number of impressions that the advertiser is targeting. + */ + targetImpressions: string; + } + /** + * Project List Response + */ + export interface Schema$ProjectsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#projectsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Project collection. + */ + projects: Schema$Project[]; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "REACH". */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Videoformats { - root: Dfareporting; - constructor(root: Dfareporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dfareporting.videoFormats.get - * @desc Gets one video format by ID. - * @alias dfareporting.videoFormats.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.id Video format ID. - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ReachReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#reachReportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected as activity metrics to pivot + * on in the "activities" section of the report. + */ + pivotedActivityMetrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected in the + * "reachByFrequencyMetricNames" section of the report. + */ + reachByFrequencyMetrics: Schema$Metric[]; + } + /** + * Represents a recipient. + */ + export interface Schema$Recipient { + /** + * The delivery type for the recipient. + */ + deliveryType: string; + /** + * The email address of the recipient. + */ + email: string; + /** + * The kind of resource this is, in this case dfareporting#recipient. + */ + kind: string; + } + /** + * Contains information about a region that can be targeted by ads. + */ + export interface Schema$Region { + /** + * Country code of the country to which this region belongs. + */ + countryCode: string; + /** + * DART ID of the country to which this region belongs. + */ + countryDartId: string; + /** + * DART ID of this region. + */ + dartId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#region". + */ + kind: string; + /** + * Name of this region. + */ + name: string; + /** + * Region code. + */ + regionCode: string; + } + /** + * Region List Response + */ + export interface Schema$RegionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#regionsListResponse". + */ + kind: string; + /** + * Region collection. + */ + regions: Schema$Region[]; + } + /** + * Contains properties of a remarketing list. Remarketing enables you to + * create lists of users who have performed specific actions on a site, then + * target ads to members of those lists. This resource can be used to manage + * remarketing lists that are owned by your advertisers. To see all + * remarketing lists that are visible to your advertisers, including those + * that are shared to your advertiser or account, use the + * TargetableRemarketingLists resource. + */ + export interface Schema$RemarketingList { + /** + * Account ID of this remarketing list. This is a read-only, auto-generated + * field that is only returned in GET requests. + */ + accountId: string; + /** + * Whether this remarketing list is active. + */ + active: boolean; + /** + * Dimension value for the advertiser ID that owns this remarketing list. + * This is a required field. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Remarketing list description. + */ + description: string; + /** + * Remarketing list ID. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingList". + */ + kind: string; + /** + * Number of days that a user should remain in the remarketing list without + * an impression. Acceptable values are 1 to 540, inclusive. + */ + lifeSpan: string; + /** + * Rule used to populate the remarketing list with users. + */ + listPopulationRule: Schema$ListPopulationRule; + /** + * Number of users currently in the list. This is a read-only field. + */ + listSize: string; + /** + * Product from which this remarketing list was originated. + */ + listSource: string; + /** + * Name of the remarketing list. This is a required field. Must be no + * greater than 128 characters long. + */ + name: string; + /** + * Subaccount ID of this remarketing list. This is a read-only, + * auto-generated field that is only returned in GET requests. + */ + subaccountId: string; + } + /** + * Contains properties of a remarketing list's sharing information. + * Sharing allows other accounts or advertisers to target to your remarketing + * lists. This resource can be used to manage remarketing list sharing to + * other accounts and advertisers. + */ + export interface Schema$RemarketingListShare { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingListShare". + */ + kind: string; + /** + * Remarketing list ID. This is a read-only, auto-generated field. + */ + remarketingListId: string; + /** + * Accounts that the remarketing list is shared with. + */ + sharedAccountIds: string[]; + /** + * Advertisers that the remarketing list is shared with. + */ + sharedAdvertiserIds: string[]; + } + /** + * Remarketing list response + */ + export interface Schema$RemarketingListsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#remarketingListsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Remarketing list collection. + */ + remarketingLists: Schema$RemarketingList[]; + } + /** + * Represents a Report resource. + */ + export interface Schema$Report { + /** + * The account ID to which this report belongs. + */ + accountId: string; + /** + * The report criteria for a report of type "STANDARD". + */ + criteria: any; + /** + * The report criteria for a report of type + * "CROSS_DIMENSION_REACH". + */ + crossDimensionReachCriteria: any; + /** + * The report's email delivery settings. + */ + delivery: any; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The filename used when generating report files for this report. + */ + fileName: string; + /** + * The report criteria for a report of type "FLOODLIGHT". + */ + floodlightCriteria: any; + /** + * The output format of the report. If not specified, default format is + * "CSV". Note that the actual format in the completed report file + * might differ if for instance the report's size exceeds the + * format's capabilities. "CSV" will then be the fallback + * format. + */ + format: string; + /** + * The unique ID identifying this report resource. + */ + id: string; + /** + * The kind of resource this is, in this case dfareporting#report. + */ + kind: string; + /** + * The timestamp (in milliseconds since epoch) of when this report was last + * modified. + */ + lastModifiedTime: string; + /** + * The name of the report. + */ + name: string; + /** + * The user profile id of the owner of this report. + */ + ownerProfileId: string; + /** + * The report criteria for a report of type "PATH_TO_CONVERSION". + */ + pathToConversionCriteria: any; + /** + * The report criteria for a report of type "REACH". + */ + reachCriteria: any; + /** + * The report's schedule. Can only be set if the report's + * 'dateRange' is a relative date range and the relative date range + * is not "TODAY". + */ + schedule: any; + /** + * The subaccount ID to which this report belongs if applicable. + */ + subAccountId: string; + /** + * The type of the report. + */ + type: string; + } + /** + * Represents fields that are compatible to be selected for a report of type + * "STANDARD". */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/videoFormats/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId', 'id'], - pathParams: ['id', 'profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ReportCompatibleFields { + /** + * Dimensions which are compatible to be selected in the + * "dimensionFilters" section of the report. + */ + dimensionFilters: Schema$Dimension[]; + /** + * Dimensions which are compatible to be selected in the + * "dimensions" section of the report. + */ + dimensions: Schema$Dimension[]; + /** + * The kind of resource this is, in this case + * dfareporting#reportCompatibleFields. + */ + kind: string; + /** + * Metrics which are compatible to be selected in the + * "metricNames" section of the report. + */ + metrics: Schema$Metric[]; + /** + * Metrics which are compatible to be selected as activity metrics to pivot + * on in the "activities" section of the report. + */ + pivotedActivityMetrics: Schema$Metric[]; + } + /** + * Represents the list of reports. + */ + export interface Schema$ReportList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The reports returned in this response. + */ + items: Schema$Report[]; + /** + * The kind of list this is, in this case dfareporting#reportList. + */ + kind: string; + /** + * Continuation token used to page through reports. To retrieve the next + * page of results, set the next request's "pageToken" to the + * value of this field. The page token is only valid for a limited amount of + * time and should not be persisted. + */ + nextPageToken: string; + } + /** + * Reporting Configuration + */ + export interface Schema$ReportsConfiguration { + /** + * Whether the exposure to conversion report is enabled. This report shows + * detailed pathway information on up to 10 of the most recent ad exposures + * seen by a user before converting. + */ + exposureToConversionEnabled: boolean; + /** + * Default lookback windows for new advertisers in this account. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Report generation time zone ID of this account. This is a required field + * that can only be changed by a superuser. Acceptable values are: - + * "1" for "America/New_York" - "2" for + * "Europe/London" - "3" for "Europe/Paris" + * - "4" for "Africa/Johannesburg" - "5" for + * "Asia/Jerusalem" - "6" for "Asia/Shanghai" + * - "7" for "Asia/Hong_Kong" - "8" for + * "Asia/Tokyo" - "9" for "Australia/Sydney" + * - "10" for "Asia/Dubai" - "11" for + * "America/Los_Angeles" - "12" for + * "Pacific/Auckland" - "13" for + * "America/Sao_Paulo" + */ + reportGenerationTimeZoneId: string; + } + /** + * Rich Media Exit Override. + */ + export interface Schema$RichMediaExitOverride { + /** + * Click-through URL of this rich media exit override. Applicable if the + * enabled field is set to true. + */ + clickThroughUrl: Schema$ClickThroughUrl; + /** + * Whether to use the clickThroughUrl. If false, the creative-level exit + * will be used. + */ + enabled: boolean; + /** + * ID for the override to refer to a specific exit in the creative. + */ + exitId: string; + } + /** + * A rule associates an asset with a targeting template for asset-level + * targeting. Applicable to INSTREAM_VIDEO creatives. + */ + export interface Schema$Rule { + /** + * A creativeAssets[].id. This should refer to one of the parent assets in + * this creative. This is a required field. + */ + assetId: string; + /** + * A user-friendly name for this rule. This is a required field. + */ + name: string; + /** + * A targeting template ID. The targeting from the targeting template will + * be used to determine whether this asset should be served. This is a + * required field. + */ + targetingTemplateId: string; + } + /** + * Contains properties of a site. + */ + export interface Schema$Site { + /** + * Account ID of this site. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Whether this site is approved. + */ + approved: boolean; + /** + * Directory site associated with this site. This is a required field that + * is read-only after insertion. + */ + directorySiteId: string; + /** + * Dimension value for the ID of the directory site. This is a read-only, + * auto-generated field. + */ + directorySiteIdDimensionValue: Schema$DimensionValue; + /** + * ID of this site. This is a read-only, auto-generated field. + */ + id: string; + /** + * Dimension value for the ID of this site. This is a read-only, + * auto-generated field. + */ + idDimensionValue: Schema$DimensionValue; + /** + * Key name of this site. This is a read-only, auto-generated field. + */ + keyName: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#site". + */ + kind: string; + /** + * Name of this site.This is a required field. Must be less than 128 + * characters long. If this site is under a subaccount, the name must be + * unique among sites of the same subaccount. Otherwise, this site is a + * top-level site, and the name must be unique among top-level sites of the + * same account. + */ + name: string; + /** + * Site contacts. + */ + siteContacts: Schema$SiteContact[]; + /** + * Site-wide settings. + */ + siteSettings: Schema$SiteSettings; + /** + * Subaccount ID of this site. This is a read-only field that can be left + * blank. + */ + subaccountId: string; + } + /** + * Site Contact + */ + export interface Schema$SiteContact { + /** + * Address of this site contact. + */ + address: string; + /** + * Site contact type. + */ + contactType: string; + /** + * Email address of this site contact. This is a required field. + */ + email: string; + /** + * First name of this site contact. + */ + firstName: string; + /** + * ID of this site contact. This is a read-only, auto-generated field. + */ + id: string; + /** + * Last name of this site contact. + */ + lastName: string; + /** + * Primary phone number of this site contact. + */ + phone: string; + /** + * Title or designation of this site contact. + */ + title: string; + } + /** + * Site Settings + */ + export interface Schema$SiteSettings { + /** + * Whether active view creatives are disabled for this site. + */ + activeViewOptOut: boolean; + /** + * Whether this site opts out of ad blocking. When true, ad blocking is + * disabled for all placements under the site, regardless of the individual + * placement settings. When false, the campaign and placement settings take + * effect. + */ + adBlockingOptOut: boolean; + /** + * Site-wide creative settings. + */ + creativeSettings: Schema$CreativeSettings; + /** + * Whether new cookies are disabled for this site. + */ + disableNewCookie: boolean; + /** + * Lookback window settings for this site. + */ + lookbackConfiguration: Schema$LookbackConfiguration; + /** + * Configuration settings for dynamic and image floodlight tags. + */ + tagSetting: Schema$TagSetting; + /** + * Whether Verification and ActiveView for in-stream video creatives are + * disabled by default for new placements created under this site. This + * value will be used to populate the placement.videoActiveViewOptOut field, + * when no value is specified for the new placement. + */ + videoActiveViewOptOutTemplate: boolean; + /** + * Default VPAID adapter setting for new placements created under this site. + * This value will be used to populate the placements.vpaidAdapterChoice + * field, when no value is specified for the new placement. Controls which + * VPAID format the measurement adapter will use for in-stream video + * creatives assigned to the placement. The publisher's specifications + * will typically determine this setting. For VPAID creatives, the adapter + * format will match the VPAID format (HTML5 VPAID creatives use the HTML5 + * adapter). Note: Flash is no longer supported. This field now defaults to + * HTML5 when the following values are provided: FLASH, BOTH. + */ + vpaidAdapterChoiceTemplate: string; + } + /** + * Site List Response + */ + export interface Schema$SitesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#sitesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Site collection. + */ + sites: Schema$Site[]; + } + /** + * Represents the dimensions of ads, placements, creatives, or creative + * assets. + */ + export interface Schema$Size { + /** + * Height of this size. Acceptable values are 0 to 32767, inclusive. + */ + height: number; + /** + * IAB standard size. This is a read-only, auto-generated field. + */ + iab: boolean; + /** + * ID of this size. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#size". + */ + kind: string; + /** + * Width of this size. Acceptable values are 0 to 32767, inclusive. + */ + width: number; + } + /** + * Size List Response + */ + export interface Schema$SizesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#sizesListResponse". + */ + kind: string; + /** + * Size collection. + */ + sizes: Schema$Size[]; + } + /** + * Skippable Settings + */ + export interface Schema$SkippableSetting { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#skippableSetting". + */ + kind: string; + /** + * Amount of time to play videos served to this placement before counting a + * view. Applicable when skippable is true. + */ + progressOffset: Schema$VideoOffset; + /** + * Amount of time to play videos served to this placement before the skip + * button should appear. Applicable when skippable is true. + */ + skipOffset: Schema$VideoOffset; + /** + * Whether the user can skip creatives served to this placement. + */ + skippable: boolean; + } + /** + * Represents a sorted dimension. + */ + export interface Schema$SortedDimension { + /** + * The kind of resource this is, in this case dfareporting#sortedDimension. + */ + kind: string; + /** + * The name of the dimension. + */ + name: string; + /** + * An optional sort order for the dimension column. + */ + sortOrder: string; + } + /** + * Contains properties of a DCM subaccount. + */ + export interface Schema$Subaccount { + /** + * ID of the account that contains this subaccount. This is a read-only + * field that can be left blank. + */ + accountId: string; + /** + * IDs of the available user role permissions for this subaccount. + */ + availablePermissionIds: string[]; + /** + * ID of this subaccount. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#subaccount". + */ + kind: string; + /** + * Name of this subaccount. This is a required field. Must be less than 128 + * characters long and be unique among subaccounts of the same account. + */ + name: string; + } + /** + * Subaccount List Response + */ + export interface Schema$SubaccountsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#subaccountsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Subaccount collection. + */ + subaccounts: Schema$Subaccount[]; + } + /** + * Placement Tag Data + */ + export interface Schema$TagData { + /** + * Ad associated with this placement tag. Applicable only when format is + * PLACEMENT_TAG_TRACKING. + */ + adId: string; + /** + * Tag string to record a click. + */ + clickTag: string; + /** + * Creative associated with this placement tag. Applicable only when format + * is PLACEMENT_TAG_TRACKING. + */ + creativeId: string; + /** + * TagData tag format of this tag. + */ + format: string; + /** + * Tag string for serving an ad. + */ + impressionTag: string; + } + /** + * Tag Settings + */ + export interface Schema$TagSetting { + /** + * Additional key-values to be included in tags. Each key-value pair must be + * of the form key=value, and pairs must be separated by a semicolon (;). + * Keys and values must not contain commas. For example, id=2;color=red is a + * valid value for this field. + */ + additionalKeyValues: string; + /** + * Whether static landing page URLs should be included in the tags. This + * setting applies only to placements. + */ + includeClickThroughUrls: boolean; + /** + * Whether click-tracking string should be included in the tags. + */ + includeClickTracking: boolean; + /** + * Option specifying how keywords are embedded in ad tags. This setting can + * be used to specify whether keyword placeholders are inserted in placement + * tags for this site. Publishers can then add keywords to those + * placeholders. + */ + keywordOption: string; + } + /** + * Dynamic and Image Tag Settings. + */ + export interface Schema$TagSettings { + /** + * Whether dynamic floodlight tags are enabled. + */ + dynamicTagEnabled: boolean; + /** + * Whether image tags are enabled. + */ + imageTagEnabled: boolean; + } + /** + * Contains properties of a targetable remarketing list. Remarketing enables + * you to create lists of users who have performed specific actions on a site, + * then target ads to members of those lists. This resource is a read-only + * view of a remarketing list to be used to faciliate targeting ads to + * specific lists. Remarketing lists that are owned by your advertisers and + * those that are shared to your advertisers or account are accessible via + * this resource. To manage remarketing lists that are owned by your + * advertisers, use the RemarketingLists resource. + */ + export interface Schema$TargetableRemarketingList { + /** + * Account ID of this remarketing list. This is a read-only, auto-generated + * field that is only returned in GET requests. + */ + accountId: string; + /** + * Whether this targetable remarketing list is active. + */ + active: boolean; + /** + * Dimension value for the advertiser ID that owns this targetable + * remarketing list. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Targetable remarketing list description. + */ + description: string; + /** + * Targetable remarketing list ID. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetableRemarketingList". + */ + kind: string; + /** + * Number of days that a user should remain in the targetable remarketing + * list without an impression. + */ + lifeSpan: string; + /** + * Number of users currently in the list. This is a read-only field. + */ + listSize: string; + /** + * Product from which this targetable remarketing list was originated. + */ + listSource: string; + /** + * Name of the targetable remarketing list. Is no greater than 128 + * characters long. + */ + name: string; + /** + * Subaccount ID of this remarketing list. This is a read-only, + * auto-generated field that is only returned in GET requests. + */ + subaccountId: string; + } + /** + * Targetable remarketing list response + */ + export interface Schema$TargetableRemarketingListsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetableRemarketingListsListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Targetable remarketing list collection. + */ + targetableRemarketingLists: Schema$TargetableRemarketingList[]; + } + /** + * Contains properties of a targeting template. A targeting template + * encapsulates targeting information which can be reused across multiple ads. + */ + export interface Schema$TargetingTemplate { + /** + * Account ID of this targeting template. This field, if left unset, will be + * auto-generated on insert and is read-only after insert. + */ + accountId: string; + /** + * Advertiser ID of this targeting template. This is a required field on + * insert and is read-only after insert. + */ + advertiserId: string; + /** + * Dimension value for the ID of the advertiser. This is a read-only, + * auto-generated field. + */ + advertiserIdDimensionValue: Schema$DimensionValue; + /** + * Time and day targeting criteria. + */ + dayPartTargeting: Schema$DayPartTargeting; + /** + * Geographical targeting criteria. + */ + geoTargeting: Schema$GeoTargeting; + /** + * ID of this targeting template. This is a read-only, auto-generated field. + */ + id: string; + /** + * Key-value targeting criteria. + */ + keyValueTargetingExpression: Schema$KeyValueTargetingExpression; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetingTemplate". + */ + kind: string; + /** + * Language targeting criteria. + */ + languageTargeting: Schema$LanguageTargeting; + /** + * Remarketing list targeting criteria. + */ + listTargetingExpression: Schema$ListTargetingExpression; + /** + * Name of this targeting template. This field is required. It must be less + * than 256 characters long and unique within an advertiser. + */ + name: string; + /** + * Subaccount ID of this targeting template. This field, if left unset, will + * be auto-generated on insert and is read-only after insert. + */ + subaccountId: string; + /** + * Technology platform targeting criteria. + */ + technologyTargeting: Schema$TechnologyTargeting; + } + /** + * Targeting Template List Response + */ + export interface Schema$TargetingTemplatesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#targetingTemplatesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * Targeting template collection. + */ + targetingTemplates: Schema$TargetingTemplate[]; + } + /** + * Target Window. + */ + export interface Schema$TargetWindow { + /** + * User-entered value. + */ + customHtml: string; + /** + * Type of browser window for which the backup image of the flash creative + * can be displayed. + */ + targetWindowOption: string; + } + /** + * Technology Targeting. + */ + export interface Schema$TechnologyTargeting { + /** + * Browsers that this ad targets. For each browser either set + * browserVersionId or dartId along with the version numbers. If both are + * specified, only browserVersionId will be used. The other fields are + * populated automatically when the ad is inserted or updated. + */ + browsers: Schema$Browser[]; + /** + * Connection types that this ad targets. For each connection type only id + * is required. The other fields are populated automatically when the ad is + * inserted or updated. + */ + connectionTypes: Schema$ConnectionType[]; + /** + * Mobile carriers that this ad targets. For each mobile carrier only id is + * required, and the other fields are populated automatically when the ad is + * inserted or updated. If targeting a mobile carrier, do not set targeting + * for any zip codes. + */ + mobileCarriers: Schema$MobileCarrier[]; + /** + * Operating systems that this ad targets. To target specific versions, use + * operatingSystemVersions. For each operating system only dartId is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting an operating system, do not set + * targeting for operating system versions for the same operating system. + */ + operatingSystems: Schema$OperatingSystem[]; + /** + * Operating system versions that this ad targets. To target all versions, + * use operatingSystems. For each operating system version, only id is + * required. The other fields are populated automatically when the ad is + * inserted or updated. If targeting an operating system version, do not set + * targeting for the corresponding operating system in operatingSystems. + */ + operatingSystemVersions: Schema$OperatingSystemVersion[]; + /** + * Platform types that this ad targets. For example, desktop, mobile, or + * tablet. For each platform type, only id is required, and the other fields + * are populated automatically when the ad is inserted or updated. + */ + platformTypes: Schema$PlatformType[]; + } + /** + * Third Party Authentication Token + */ + export interface Schema$ThirdPartyAuthenticationToken { + /** + * Name of the third-party authentication token. + */ + name: string; + /** + * Value of the third-party authentication token. This is a read-only, + * auto-generated field. + */ + value: string; + } + /** + * Third-party Tracking URL. + */ + export interface Schema$ThirdPartyTrackingUrl { + /** + * Third-party URL type for in-stream video creatives. + */ + thirdPartyUrlType: string; + /** + * URL for the specified third-party URL type. + */ + url: string; + } + /** + * Transcode Settings + */ + export interface Schema$TranscodeSetting { + /** + * Whitelist of video formats to be served to this placement. Set this list + * to null or empty to serve all video formats. + */ + enabledVideoFormats: number[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#transcodeSetting". + */ + kind: string; } - - /** - * dfareporting.videoFormats.list - * @desc Lists available video formats. - * @alias dfareporting.videoFormats.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.profileId User profile ID associated with this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A Universal Ad ID as per the VAST 4.0 spec. Applicable to the following + * creative types: INSTREAM_VIDEO and VPAID. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dfareporting/v3.0/userprofiles/{profileId}/videoFormats') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['profileId'], - pathParams: ['profileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$UniversalAdId { + /** + * Registry used for the Ad ID value. + */ + registry: string; + /** + * ID value for this creative. Only alphanumeric characters and the + * following symbols are valid: "_/\-". Maximum length is 64 + * characters. Read only when registry is DCM. + */ + value: string; + } + /** + * User Defined Variable configuration. + */ + export interface Schema$UserDefinedVariableConfiguration { + /** + * Data type for the variable. This is a required field. + */ + dataType: string; + /** + * User-friendly name for the variable which will appear in reports. This is + * a required field, must be less than 64 characters long, and cannot + * contain the following characters: ""<>". + */ + reportName: string; + /** + * Variable name in the tag. This is a required field. + */ + variableType: string; + } + /** + * Represents a UserProfile resource. + */ + export interface Schema$UserProfile { + /** + * The account ID to which this profile belongs. + */ + accountId: string; + /** + * The account name this profile belongs to. + */ + accountName: string; + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The kind of resource this is, in this case dfareporting#userProfile. + */ + kind: string; + /** + * The unique ID of the user profile. + */ + profileId: string; + /** + * The sub account ID this profile belongs to if applicable. + */ + subAccountId: string; + /** + * The sub account name this profile belongs to if applicable. + */ + subAccountName: string; + /** + * The user name. + */ + userName: string; + } + /** + * Represents the list of user profiles. + */ + export interface Schema$UserProfileList { + /** + * The eTag of this response for caching purposes. + */ + etag: string; + /** + * The user profiles returned in this response. + */ + items: Schema$UserProfile[]; + /** + * The kind of list this is, in this case dfareporting#userProfileList. + */ + kind: string; + } + /** + * Contains properties of auser role, which is used to manage user access. + */ + export interface Schema$UserRole { + /** + * Account ID of this user role. This is a read-only field that can be left + * blank. + */ + accountId: string; + /** + * Whether this is a default user role. Default user roles are created by + * the system for the account/subaccount and cannot be modified or deleted. + * Each default user role comes with a basic set of preassigned permissions. + */ + defaultUserRole: boolean; + /** + * ID of this user role. This is a read-only, auto-generated field. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRole". + */ + kind: string; + /** + * Name of this user role. This is a required field. Must be less than 256 + * characters long. If this user role is under a subaccount, the name must + * be unique among sites of the same subaccount. Otherwise, this user role + * is a top-level user role, and the name must be unique among top-level + * user roles of the same account. + */ + name: string; + /** + * ID of the user role that this user role is based on or copied from. This + * is a required field. + */ + parentUserRoleId: string; + /** + * List of permissions associated with this user role. + */ + permissions: Schema$UserRolePermission[]; + /** + * Subaccount ID of this user role. This is a read-only field that can be + * left blank. + */ + subaccountId: string; + } + /** + * Contains properties of a user role permission. + */ + export interface Schema$UserRolePermission { + /** + * Levels of availability for a user role permission. + */ + availability: string; + /** + * ID of this user role permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermission". + */ + kind: string; + /** + * Name of this user role permission. + */ + name: string; + /** + * ID of the permission group that this user role permission belongs to. + */ + permissionGroupId: string; + } + /** + * Represents a grouping of related user role permissions. + */ + export interface Schema$UserRolePermissionGroup { + /** + * ID of this user role permission. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionGroup". + */ + kind: string; + /** + * Name of this user role permission group. + */ + name: string; + } + /** + * User Role Permission Group List Response + */ + export interface Schema$UserRolePermissionGroupsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionGroupsListResponse". + */ + kind: string; + /** + * User role permission group collection. + */ + userRolePermissionGroups: Schema$UserRolePermissionGroup[]; + } + /** + * User Role Permission List Response + */ + export interface Schema$UserRolePermissionsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolePermissionsListResponse". + */ + kind: string; + /** + * User role permission collection. + */ + userRolePermissions: Schema$UserRolePermission[]; + } + /** + * User Role List Response + */ + export interface Schema$UserRolesListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#userRolesListResponse". + */ + kind: string; + /** + * Pagination token to be used for the next list operation. + */ + nextPageToken: string; + /** + * User role collection. + */ + userRoles: Schema$UserRole[]; + } + /** + * Contains information about supported video formats. + */ + export interface Schema$VideoFormat { + /** + * File type of the video format. + */ + fileType: string; + /** + * ID of the video format. + */ + id: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoFormat". + */ + kind: string; + /** + * The resolution of this video format. + */ + resolution: Schema$Size; + /** + * The target bit rate of this video format. + */ + targetBitRate: number; + } + /** + * Video Format List Response + */ + export interface Schema$VideoFormatsListResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoFormatsListResponse". + */ + kind: string; + /** + * Video format collection. + */ + videoFormats: Schema$VideoFormat[]; + } + /** + * Video Offset + */ + export interface Schema$VideoOffset { + /** + * Duration, as a percentage of video duration. Do not set when + * offsetSeconds is set. Acceptable values are 0 to 100, inclusive. + */ + offsetPercentage: number; + /** + * Duration, in seconds. Do not set when offsetPercentage is set. Acceptable + * values are 0 to 86399, inclusive. + */ + offsetSeconds: number; + } + /** + * Video Settings + */ + export interface Schema$VideoSettings { + /** + * Settings for the companion creatives of video creatives served to this + * placement. + */ + companionSettings: Schema$CompanionSetting; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dfareporting#videoSettings". + */ + kind: string; + /** + * Orientation of a video placement. If this value is set, placement will + * return assets matching the specified orientation. + */ + orientation: string; + /** + * Settings for the skippability of video creatives served to this + * placement. If this object is provided, the creative-level skippable + * settings will be overridden. + */ + skippableSettings: Schema$SkippableSetting; + /** + * Settings for the transcodes of video creatives served to this placement. + * If this object is provided, the creative-level transcode settings will be + * overridden. + */ + transcodeSettings: Schema$TranscodeSetting; + } + + export class Resource$Accountactiveadsummaries { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountActiveAdSummaries.get + * @desc Gets the account's active ad summary by account ID. + * @alias dfareporting.accountActiveAdSummaries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.summaryAccountId Account ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'summaryAccountId'], + pathParams: ['profileId', 'summaryAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accountpermissiongroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountPermissionGroups.get + * @desc Gets one account permission group by ID. + * @alias dfareporting.accountPermissionGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account permission group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissionGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountPermissionGroups.list + * @desc Retrieves the list of account permission groups. + * @alias dfareporting.accountPermissionGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissionGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Accountpermissions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountPermissions.get + * @desc Gets one account permission by ID. + * @alias dfareporting.accountPermissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account permission ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountPermissions.list + * @desc Retrieves the list of account permissions. + * @alias dfareporting.accountPermissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Accounts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accounts.get + * @desc Gets one account by ID. + * @alias dfareporting.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.list + * @desc Retrieves the list of accounts, possibly filtered. This method + * supports paging. + * @alias dfareporting.accounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active accounts. Don't set this field to select both active and non-active accounts. + * @param {string=} params.ids Select only accounts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "account*2015" will return objects with names like "account June 2015", "account April 2015", or simply "account 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "account" will match objects with name "my account", "account 2015", or simply "account". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.patch + * @desc Updates an existing account. This method supports patch semantics. + * @alias dfareporting.accounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Account ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accounts.update + * @desc Updates an existing account. + * @alias dfareporting.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accountuserprofiles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.accountUserProfiles.get + * @desc Gets one account user profile by ID. + * @alias dfareporting.accountUserProfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User profile ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.insert + * @desc Inserts a new account user profile. + * @alias dfareporting.accountUserProfiles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.list + * @desc Retrieves a list of account user profiles, possibly filtered. This + * method supports paging. + * @alias dfareporting.accountUserProfiles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active user profiles. + * @param {string=} params.ids Select only user profiles with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "user profile*2015" will return objects with names like "user profile June 2015", "user profile April 2015", or simply "user profile 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "user profile" will match objects with name "my user profile", "user profile 2015", or simply "user profile". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only user profiles with the specified subaccount ID. + * @param {string=} params.userRoleId Select only user profiles with the specified user role ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.patch + * @desc Updates an existing account user profile. This method supports + * patch semantics. + * @alias dfareporting.accountUserProfiles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User profile ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.accountUserProfiles.update + * @desc Updates an existing account user profile. + * @alias dfareporting.accountUserProfiles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AccountUserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/accountUserProfiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Ads { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.ads.get + * @desc Gets one ad by ID. + * @alias dfareporting.ads.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Ad ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/ads/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.insert + * @desc Inserts a new ad. + * @alias dfareporting.ads.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.list + * @desc Retrieves a list of ads, possibly filtered. This method supports + * paging. + * @alias dfareporting.ads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active ads. + * @param {string=} params.advertiserId Select only ads with this advertiser ID. + * @param {boolean=} params.archived Select only archived ads. + * @param {string=} params.audienceSegmentIds Select only ads with these audience segment IDs. + * @param {string=} params.campaignIds Select only ads with these campaign IDs. + * @param {string=} params.compatibility Select default ads with the specified compatibility. Applicable when type is AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads, respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an in-stream video ads developed with the VAST standard. + * @param {string=} params.creativeIds Select only ads with these creative IDs assigned. + * @param {string=} params.creativeOptimizationConfigurationIds Select only ads with these creative optimization configuration IDs. + * @param {boolean=} params.dynamicClickTracker Select only dynamic click trackers. Applicable when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click trackers. If false, select static click trackers. Leave unset to select both. + * @param {string=} params.ids Select only ads with these IDs. + * @param {string=} params.landingPageIds Select only ads with these landing page IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.overriddenEventTagId Select only ads with this event tag override ID. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.placementIds Select only ads with these placement IDs assigned. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.remarketingListIds Select only ads whose list targeting expression use these remarketing list IDs. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "ad*2015" will return objects with names like "ad June 2015", "ad April 2015", or simply "ad 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "ad" will match objects with name "my ad", "ad 2015", or simply "ad". + * @param {string=} params.sizeIds Select only ads with these size IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {boolean=} params.sslCompliant Select only ads that are SSL-compliant. + * @param {boolean=} params.sslRequired Select only ads that require SSL. + * @param {string=} params.type Select only ads with these types. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.patch + * @desc Updates an existing ad. This method supports patch semantics. + * @alias dfareporting.ads.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Ad ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.ads.update + * @desc Updates an existing ad. + * @alias dfareporting.ads.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Ad} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}/ads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Advertisergroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.advertiserGroups.delete + * @desc Deletes an existing advertiser group. + * @alias dfareporting.advertiserGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.get + * @desc Gets one advertiser group by ID. + * @alias dfareporting.advertiserGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.insert + * @desc Inserts a new advertiser group. + * @alias dfareporting.advertiserGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.list + * @desc Retrieves a list of advertiser groups, possibly filtered. This + * method supports paging. + * @alias dfareporting.advertiserGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only advertiser groups with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser group June 2015", "advertiser group April 2015", or simply "advertiser group 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertisergroup" will match objects with name "my advertisergroup", "advertisergroup 2015", or simply "advertisergroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.advertiserGroups.patch + * @desc Updates an existing advertiser group. This method supports patch + * semantics. + * @alias dfareporting.advertiserGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserGroups.update + * @desc Updates an existing advertiser group. + * @alias dfareporting.advertiserGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().AdvertiserGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Advertiserlandingpages { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.advertiserLandingPages.get + * @desc Gets one landing page by ID. + * @alias dfareporting.advertiserLandingPages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Landing page ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserLandingPages.insert + * @desc Inserts a new landing page. + * @alias dfareporting.advertiserLandingPages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserLandingPages.list + * @desc Retrieves a list of landing pages. + * @alias dfareporting.advertiserLandingPages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only landing pages that belong to these advertisers. + * @param {boolean=} params.archived Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages. + * @param {string=} params.ids Select only landing pages with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for landing pages by name or ID. Wildcards (*) are allowed. For example, "landingpage*2017" will return landing pages with names like "landingpage July 2017", "landingpage March 2017", or simply "landingpage 2017". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "landingpage" will match campaigns with name "my landingpage", "landingpage 2015", or simply "landingpage". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only landing pages that belong to this subaccount. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.advertiserLandingPages.patch + * @desc Updates an existing landing page. This method supports patch + * semantics. + * @alias dfareporting.advertiserLandingPages.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Landing page ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertiserLandingPages.update + * @desc Updates an existing landing page. + * @alias dfareporting.advertiserLandingPages.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().LandingPage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertiserLandingPages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Advertisers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.advertisers.get + * @desc Gets one advertiser by ID. + * @alias dfareporting.advertisers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertisers/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.insert + * @desc Inserts a new advertiser. + * @alias dfareporting.advertisers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.list + * @desc Retrieves a list of advertisers, possibly filtered. This method + * supports paging. + * @alias dfareporting.advertisers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserGroupIds Select only advertisers with these advertiser group IDs. + * @param {string=} params.floodlightConfigurationIds Select only advertisers with these floodlight configuration IDs. + * @param {string=} params.ids Select only advertisers with these IDs. + * @param {boolean=} params.includeAdvertisersWithoutGroupsOnly Select only advertisers which do not belong to any advertiser group. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {boolean=} params.onlyParent Select only advertisers which use another advertiser's floodlight configuration. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "advertiser*2015" will return objects with names like "advertiser June 2015", "advertiser April 2015", or simply "advertiser 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "advertiser" will match objects with name "my advertiser", "advertiser 2015", or simply "advertiser". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.status Select only advertisers with the specified status. + * @param {string=} params.subaccountId Select only advertisers with these subaccount IDs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.patch + * @desc Updates an existing advertiser. This method supports patch + * semantics. + * @alias dfareporting.advertisers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Advertiser ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.advertisers.update + * @desc Updates an existing advertiser. + * @alias dfareporting.advertisers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Advertiser} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/advertisers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Browsers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.browsers.list + * @desc Retrieves a list of browsers. + * @alias dfareporting.browsers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/browsers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Campaigncreativeassociations { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.campaignCreativeAssociations.insert + * @desc Associates a creative with the specified campaign. This method + * creates a default ad with dimensions matching the creative in the + * campaign if such a default ad does not exist already. + * @alias dfareporting.campaignCreativeAssociations.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Campaign ID in this association. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CampaignCreativeAssociation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaignCreativeAssociations.list + * @desc Retrieves the list of creative IDs associated with the specified + * campaign. This method supports paging. + * @alias dfareporting.campaignCreativeAssociations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.campaignId Campaign ID in this association. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$CampaignCreativeAssociationsListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$CampaignCreativeAssociationsListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'campaignId'], + pathParams: ['campaignId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$CampaignCreativeAssociationsListResponse>(parameters); + } + } + } + + export class Resource$Campaigns { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.campaigns.get + * @desc Gets one campaign by ID. + * @alias dfareporting.campaigns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.insert + * @desc Inserts a new campaign. + * @alias dfareporting.campaigns.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.list + * @desc Retrieves a list of campaigns, possibly filtered. This method + * supports paging. + * @alias dfareporting.campaigns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserGroupIds Select only campaigns whose advertisers belong to these advertiser groups. + * @param {string=} params.advertiserIds Select only campaigns that belong to these advertisers. + * @param {boolean=} params.archived Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns. + * @param {boolean=} params.atLeastOneOptimizationActivity Select only campaigns that have at least one optimization activity. + * @param {string=} params.excludedIds Exclude campaigns with these IDs. + * @param {string=} params.ids Select only campaigns with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.overriddenEventTagId Select only campaigns that have overridden this event tag ID. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only campaigns that belong to this subaccount. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.patch + * @desc Updates an existing campaign. This method supports patch semantics. + * @alias dfareporting.campaigns.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Campaign ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.campaigns.update + * @desc Updates an existing campaign. + * @alias dfareporting.campaigns.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Campaign} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/campaigns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Changelogs { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.changeLogs.get + * @desc Gets one change log by ID. + * @alias dfareporting.changeLogs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Change log ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/changeLogs/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.changeLogs.list + * @desc Retrieves a list of change logs. This method supports paging. + * @alias dfareporting.changeLogs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.action Select only change logs with the specified action. + * @param {string=} params.ids Select only change logs with these IDs. + * @param {string=} params.maxChangeTime Select only change logs whose change time is before the specified maxChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.minChangeTime Select only change logs whose change time is before the specified minChangeTime.The time should be formatted as an RFC3339 date/time string. For example, for 10:54 PM on July 18th, 2015, in the America/New York time zone, the format is "2015-07-18T22:54:00-04:00". In other words, the year, month, day, the letter T, the hour (24-hour clock system), minute, second, and then the time zone offset. + * @param {string=} params.objectIds Select only change logs with these object IDs. + * @param {string=} params.objectType Select only change logs with the specified object type. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Select only change logs whose object ID, user name, old or new values match the search string. + * @param {string=} params.userProfileIds Select only change logs with these user profile IDs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/changeLogs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Cities { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.cities.list + * @desc Retrieves a list of cities, possibly filtered. + * @alias dfareporting.cities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.countryDartIds Select only cities from these countries. + * @param {string=} params.dartIds Select only cities with these DART IDs. + * @param {string=} params.namePrefix Select only cities with names starting with this prefix. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.regionDartIds Select only cities from these regions. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/cities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Connectiontypes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.connectionTypes.get + * @desc Gets one connection type by ID. + * @alias dfareporting.connectionTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Connection type ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/connectionTypes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.connectionTypes.list + * @desc Retrieves a list of connection types. + * @alias dfareporting.connectionTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/connectionTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Contentcategories { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.contentCategories.delete + * @desc Deletes an existing content category. + * @alias dfareporting.contentCategories.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.get + * @desc Gets one content category by ID. + * @alias dfareporting.contentCategories.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.insert + * @desc Inserts a new content category. + * @alias dfareporting.contentCategories.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.list + * @desc Retrieves a list of content categories, possibly filtered. This + * method supports paging. + * @alias dfareporting.contentCategories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only content categories with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "contentcategory*2015" will return objects with names like "contentcategory June 2015", "contentcategory April 2015", or simply "contentcategory 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "contentcategory" will match objects with name "my contentcategory", "contentcategory 2015", or simply "contentcategory". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.contentCategories.patch + * @desc Updates an existing content category. This method supports patch + * semantics. + * @alias dfareporting.contentCategories.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Content category ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.contentCategories.update + * @desc Updates an existing content category. + * @alias dfareporting.contentCategories.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ContentCategory} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/contentCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Conversions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.conversions.batchinsert + * @desc Inserts conversions. + * @alias dfareporting.conversions.batchinsert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ConversionsBatchInsertRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchinsert(params?: any, options?: MethodOptions): + AxiosPromise; + batchinsert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchinsert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/conversions/batchinsert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.conversions.batchupdate + * @desc Updates existing conversions. + * @alias dfareporting.conversions.batchupdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().ConversionsBatchUpdateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchupdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchupdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchupdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/conversions/batchupdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Countries { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.countries.get + * @desc Gets one country by ID. + * @alias dfareporting.countries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dartId Country DART ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/countries/{dartId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'dartId'], + pathParams: ['dartId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.countries.list + * @desc Retrieves a list of countries. + * @alias dfareporting.countries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/countries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativeassets { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeAssets.insert + * @desc Inserts a new creative asset. + * @alias dfareporting.creativeAssets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.advertiserId Advertiser ID of this creative. This is a required field. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['advertiserId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativefields { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeFields.delete + * @desc Deletes an existing creative field. + * @alias dfareporting.creativeFields.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.get + * @desc Gets one creative field by ID. + * @alias dfareporting.creativeFields.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.insert + * @desc Inserts a new creative field. + * @alias dfareporting.creativeFields.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.list + * @desc Retrieves a list of creative fields, possibly filtered. This method + * supports paging. + * @alias dfareporting.creativeFields.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only creative fields that belong to these advertisers. + * @param {string=} params.ids Select only creative fields with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative fields by name or ID. Wildcards (*) are allowed. For example, "creativefield*2015" will return creative fields with names like "creativefield June 2015", "creativefield April 2015", or simply "creativefield 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativefield" will match creative fields with the name "my creativefield", "creativefield 2015", or simply "creativefield". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.patch + * @desc Updates an existing creative field. This method supports patch + * semantics. + * @alias dfareporting.creativeFields.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative Field ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFields.update + * @desc Updates an existing creative field. + * @alias dfareporting.creativeFields.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeField} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativefieldvalues { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeFieldValues.delete + * @desc Deletes an existing creative field value. + * @alias dfareporting.creativeFieldValues.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.get + * @desc Gets one creative field value by ID. + * @alias dfareporting.creativeFieldValues.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.insert + * @desc Inserts a new creative field value. + * @alias dfareporting.creativeFieldValues.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.list + * @desc Retrieves a list of creative field values, possibly filtered. This + * method supports paging. + * @alias dfareporting.creativeFieldValues.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string=} params.ids Select only creative field values with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.patch + * @desc Updates an existing creative field value. This method supports + * patch semantics. + * @alias dfareporting.creativeFieldValues.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.id Creative Field Value ID + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId', 'id'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeFieldValues.update + * @desc Updates an existing creative field value. + * @alias dfareporting.creativeFieldValues.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.creativeFieldId Creative field ID for this creative field value. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeFieldValue} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId', 'creativeFieldId'], + pathParams: ['creativeFieldId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creativegroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creativeGroups.get + * @desc Gets one creative group by ID. + * @alias dfareporting.creativeGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.insert + * @desc Inserts a new creative group. + * @alias dfareporting.creativeGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.list + * @desc Retrieves a list of creative groups, possibly filtered. This method + * supports paging. + * @alias dfareporting.creativeGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only creative groups that belong to these advertisers. + * @param {integer=} params.groupNumber Select only creative groups that belong to this subgroup. + * @param {string=} params.ids Select only creative groups with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for creative groups by name or ID. Wildcards (*) are allowed. For example, "creativegroup*2015" will return creative groups with names like "creativegroup June 2015", "creativegroup April 2015", or simply "creativegroup 2015". Most of the searches also add wild-cards implicitly at the start and the end of the search string. For example, a search string of "creativegroup" will match creative groups with the name "my creativegroup", "creativegroup 2015", or simply "creativegroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.patch + * @desc Updates an existing creative group. This method supports patch + * semantics. + * @alias dfareporting.creativeGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creativeGroups.update + * @desc Updates an existing creative group. + * @alias dfareporting.creativeGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().CreativeGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creativeGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Creatives { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.creatives.get + * @desc Gets one creative by ID. + * @alias dfareporting.creatives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creatives/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.insert + * @desc Inserts a new creative. + * @alias dfareporting.creatives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.list + * @desc Retrieves a list of creatives, possibly filtered. This method + * supports paging. + * @alias dfareporting.creatives.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active creatives. Leave blank to select active and inactive creatives. + * @param {string=} params.advertiserId Select only creatives with this advertiser ID. + * @param {boolean=} params.archived Select only archived creatives. Leave blank to select archived and unarchived creatives. + * @param {string=} params.campaignId Select only creatives with this campaign ID. + * @param {string=} params.companionCreativeIds Select only in-stream video creatives with these companion IDs. + * @param {string=} params.creativeFieldIds Select only creatives with these creative field IDs. + * @param {string=} params.ids Select only creatives with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.renderingIds Select only creatives with these rendering IDs. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "creative*2015" will return objects with names like "creative June 2015", "creative April 2015", or simply "creative 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "creative" will match objects with name "my creative", "creative 2015", or simply "creative". + * @param {string=} params.sizeIds Select only creatives with these size IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.studioCreativeId Select only creatives corresponding to this Studio creative ID. + * @param {string=} params.types Select only creatives with these creative types. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.patch + * @desc Updates an existing creative. This method supports patch semantics. + * @alias dfareporting.creatives.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Creative ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.creatives.update + * @desc Updates an existing creative. + * @alias dfareporting.creatives.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Creative} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/creatives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Dimensionvalues { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.dimensionValues.query + * @desc Retrieves list of report dimension values for a list of filters. + * @alias dfareporting.dimensionValues.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA user profile ID. + * @param {().DimensionValueRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/dimensionvalues/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Directorysitecontacts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.directorySiteContacts.get + * @desc Gets one directory site contact by ID. + * @alias dfareporting.directorySiteContacts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Directory site contact ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/directorySiteContacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySiteContacts.list + * @desc Retrieves a list of directory site contacts, possibly filtered. + * This method supports paging. + * @alias dfareporting.directorySiteContacts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.directorySiteIds Select only directory site contacts with these directory site IDs. This is a required field. + * @param {string=} params.ids Select only directory site contacts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or email. Wildcards (*) are allowed. For example, "directory site contact*2015" will return objects with names like "directory site contact June 2015", "directory site contact April 2015", or simply "directory site contact 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site contact" will match objects with name "my directory site contact", "directory site contact 2015", or simply "directory site contact". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/directorySiteContacts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Directorysites { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.directorySites.get + * @desc Gets one directory site by ID. + * @alias dfareporting.directorySites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Directory site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/directorySites/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySites.insert + * @desc Inserts a new directory site. + * @alias dfareporting.directorySites.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().DirectorySite} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/directorySites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.directorySites.list + * @desc Retrieves a list of directory sites, possibly filtered. This method + * supports paging. + * @alias dfareporting.directorySites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsPublisherPaidPlacements Select only directory sites that accept publisher paid placements. This field can be left blank. + * @param {boolean=} params.active Select only active directory sites. Leave blank to retrieve both active and inactive directory sites. + * @param {string=} params.countryId Select only directory sites with this country ID. + * @param {string=} params.dfpNetworkCode Select only directory sites with this DFP network code. + * @param {string=} params.ids Select only directory sites with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.parentId Select only directory sites with this parent ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or URL. Wildcards (*) are allowed. For example, "directory site*2015" will return objects with names like "directory site June 2015", "directory site April 2015", or simply "directory site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "directory site" will match objects with name "my directory site", "directory site 2015" or simply, "directory site". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/directorySites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Dynamictargetingkeys { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.dynamicTargetingKeys.delete + * @desc Deletes an existing dynamic targeting key. + * @alias dfareporting.dynamicTargetingKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of this dynamic targeting key. This is a required field. Must be less than 256 characters long and cannot contain commas. All characters are converted to lowercase. + * @param {string} params.objectId ID of the object of this dynamic targeting key. This is a required field. + * @param {string} params.objectType Type of the object of this dynamic targeting key. This is a required field. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys/{objectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'objectId', 'name', 'objectType'], + pathParams: ['objectId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.dynamicTargetingKeys.insert + * @desc Inserts a new dynamic targeting key. Keys must be created at the + * advertiser level before being assigned to the advertiser's ads, + * creatives, or placements. There is a maximum of 1000 keys per advertiser, + * out of which a maximum of 20 keys can be assigned per ad, creative, or + * placement. + * @alias dfareporting.dynamicTargetingKeys.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().DynamicTargetingKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.dynamicTargetingKeys.list + * @desc Retrieves a list of dynamic targeting keys. + * @alias dfareporting.dynamicTargetingKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only dynamic targeting keys whose object has this advertiser ID. + * @param {string=} params.names Select only dynamic targeting keys exactly matching these names. + * @param {string=} params.objectId Select only dynamic targeting keys with this object ID. + * @param {string=} params.objectType Select only dynamic targeting keys with this object type. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/dynamicTargetingKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Eventtags { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.eventTags.delete + * @desc Deletes an existing event tag. + * @alias dfareporting.eventTags.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.get + * @desc Gets one event tag by ID. + * @alias dfareporting.eventTags.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.insert + * @desc Inserts a new event tag. + * @alias dfareporting.eventTags.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.list + * @desc Retrieves a list of event tags, possibly filtered. + * @alias dfareporting.eventTags.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.adId Select only event tags that belong to this ad. + * @param {string=} params.advertiserId Select only event tags that belong to this advertiser. + * @param {string=} params.campaignId Select only event tags that belong to this campaign. + * @param {boolean=} params.definitionsOnly Examine only the specified campaign or advertiser's event tags for matching selector criteria. When set to false, the parent advertiser and parent campaign of the specified ad or campaign is examined as well. In addition, when set to false, the status field is examined as well, along with the enabledByDefault field. This parameter can not be set to true when adId is specified as ads do not define their own even tags. + * @param {boolean=} params.enabled Select only enabled event tags. What is considered enabled or disabled depends on the definitionsOnly parameter. When definitionsOnly is set to true, only the specified advertiser or campaign's event tags' enabledByDefault field is examined. When definitionsOnly is set to false, the specified ad or specified campaign's parent advertiser's or parent campaign's event tags' enabledByDefault and status fields are examined as well. + * @param {string=} params.eventTagTypes Select only event tags with the specified event tag types. Event tag types can be used to specify whether to use a third-party pixel, a third-party JavaScript URL, or a third-party click-through URL for either impression or click tracking. + * @param {string=} params.ids Select only event tags with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "eventtag*2015" will return objects with names like "eventtag June 2015", "eventtag April 2015", or simply "eventtag 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "eventtag" will match objects with name "my eventtag", "eventtag 2015", or simply "eventtag". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.patch + * @desc Updates an existing event tag. This method supports patch + * semantics. + * @alias dfareporting.eventTags.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Event tag ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.eventTags.update + * @desc Updates an existing event tag. + * @alias dfareporting.eventTags.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().EventTag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/eventTags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Files { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.files.get + * @desc Retrieves a report file by its report ID and file ID. This method + * supports media download. + * @alias dfareporting.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the report file. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/reports/{reportId}/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['reportId', 'fileId'], + pathParams: ['fileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.files.list + * @desc Lists files for a user profile. + * @alias dfareporting.files.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA profile ID. + * @param {string=} params.scope The scope that defines which results are returned. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/files') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightactivities { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightActivities.delete + * @desc Deletes an existing floodlight activity. + * @alias dfareporting.floodlightActivities.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.generatetag + * @desc Generates a tag for a floodlight activity. + * @alias dfareporting.floodlightActivities.generatetag + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.floodlightActivityId Floodlight activity ID for which we want to generate a tag. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generatetag(params?: any, options?: MethodOptions): + AxiosPromise; + generatetag( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$FloodlightActivitiesGenerateTagResponse>): void; + generatetag( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$FloodlightActivitiesGenerateTagResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/generatetag') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivities.get + * @desc Gets one floodlight activity by ID. + * @alias dfareporting.floodlightActivities.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.insert + * @desc Inserts a new floodlight activity. + * @alias dfareporting.floodlightActivities.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.list + * @desc Retrieves a list of floodlight activities, possibly filtered. This + * method supports paging. + * @alias dfareporting.floodlightActivities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.floodlightActivityGroupIds Select only floodlight activities with the specified floodlight activity group IDs. + * @param {string=} params.floodlightActivityGroupName Select only floodlight activities with the specified floodlight activity group name. + * @param {string=} params.floodlightActivityGroupTagString Select only floodlight activities with the specified floodlight activity group tag string. + * @param {string=} params.floodlightActivityGroupType Select only floodlight activities with the specified floodlight activity group type. + * @param {string=} params.floodlightConfigurationId Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.ids Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivity*2015" will return objects with names like "floodlightactivity June 2015", "floodlightactivity April 2015", or simply "floodlightactivity 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivity" will match objects with name "my floodlightactivity activity", "floodlightactivity 2015", or simply "floodlightactivity". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.tagString Select only floodlight activities with the specified tag string. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivities.patch + * @desc Updates an existing floodlight activity. This method supports patch + * semantics. + * @alias dfareporting.floodlightActivities.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivities.update + * @desc Updates an existing floodlight activity. + * @alias dfareporting.floodlightActivities.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightactivitygroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightActivityGroups.get + * @desc Gets one floodlight activity group by ID. + * @alias dfareporting.floodlightActivityGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity Group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.insert + * @desc Inserts a new floodlight activity group. + * @alias dfareporting.floodlightActivityGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.list + * @desc Retrieves a list of floodlight activity groups, possibly filtered. + * This method supports paging. + * @alias dfareporting.floodlightActivityGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * @param {string=} params.floodlightConfigurationId Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result. + * @param {string=} params.ids Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "floodlightactivitygroup*2015" will return objects with names like "floodlightactivitygroup June 2015", "floodlightactivitygroup April 2015", or simply "floodlightactivitygroup 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "floodlightactivitygroup" will match objects with name "my floodlightactivitygroup activity", "floodlightactivitygroup 2015", or simply "floodlightactivitygroup". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.type Select only floodlight activity groups with the specified floodlight activity group type. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.patch + * @desc Updates an existing floodlight activity group. This method supports + * patch semantics. + * @alias dfareporting.floodlightActivityGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight activity Group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightActivityGroups.update + * @desc Updates an existing floodlight activity group. + * @alias dfareporting.floodlightActivityGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightActivityGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightActivityGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Floodlightconfigurations { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.floodlightConfigurations.get + * @desc Gets one floodlight configuration by ID. + * @alias dfareporting.floodlightConfigurations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight configuration ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.list + * @desc Retrieves a list of floodlight configurations, possibly filtered. + * @alias dfareporting.floodlightConfigurations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.patch + * @desc Updates an existing floodlight configuration. This method supports + * patch semantics. + * @alias dfareporting.floodlightConfigurations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Floodlight configuration ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.floodlightConfigurations.update + * @desc Updates an existing floodlight configuration. + * @alias dfareporting.floodlightConfigurations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().FloodlightConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/floodlightConfigurations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Inventoryitems { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.inventoryItems.get + * @desc Gets one inventory item by ID. + * @alias dfareporting.inventoryItems.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Inventory item ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.inventoryItems.list + * @desc Retrieves a list of inventory items, possibly filtered. This method + * supports paging. + * @alias dfareporting.inventoryItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only inventory items with these IDs. + * @param {boolean=} params.inPlan Select only inventory items that are in plan. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderId Select only inventory items that belong to specified orders. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {string=} params.siteId Select only inventory items that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.type Select only inventory items with this type. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/inventoryItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Languages { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.languages.list + * @desc Retrieves a list of languages. + * @alias dfareporting.languages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/languages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Metros { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.metros.list + * @desc Retrieves a list of metros. + * @alias dfareporting.metros.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/metros') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Mobilecarriers { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.mobileCarriers.get + * @desc Gets one mobile carrier by ID. + * @alias dfareporting.mobileCarriers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Mobile carrier ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/mobileCarriers/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.mobileCarriers.list + * @desc Retrieves a list of mobile carriers. + * @alias dfareporting.mobileCarriers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/mobileCarriers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Operatingsystems { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.operatingSystems.get + * @desc Gets one operating system by DART ID. + * @alias dfareporting.operatingSystems.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dartId Operating system DART ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystems/{dartId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'dartId'], + pathParams: ['dartId', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.operatingSystems.list + * @desc Retrieves a list of operating systems. + * @alias dfareporting.operatingSystems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Operatingsystemversions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.operatingSystemVersions.get + * @desc Gets one operating system version by ID. + * @alias dfareporting.operatingSystemVersions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Operating system version ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystemVersions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.operatingSystemVersions.list + * @desc Retrieves a list of operating system versions. + * @alias dfareporting.operatingSystemVersions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/operatingSystemVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Orderdocuments { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.orderDocuments.get + * @desc Gets one order document by ID. + * @alias dfareporting.orderDocuments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Order document ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.orderDocuments.list + * @desc Retrieves a list of order documents, possibly filtered. This method + * supports paging. + * @alias dfareporting.orderDocuments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.approved Select only order documents that have been approved by at least one user. + * @param {string=} params.ids Select only order documents with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.orderId Select only order documents for specified orders. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for order documents. + * @param {string=} params.searchString Allows searching for order documents by name or ID. Wildcards (*) are allowed. For example, "orderdocument*2015" will return order documents with names like "orderdocument June 2015", "orderdocument April 2015", or simply "orderdocument 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "orderdocument" will match order documents with name "my orderdocument", "orderdocument 2015", or simply "orderdocument". + * @param {string=} params.siteId Select only order documents that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orderDocuments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Orders { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.orders.get + * @desc Gets one order by ID. + * @alias dfareporting.orders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Order ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for orders. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orders/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId', 'id'], + pathParams: ['id', 'profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.orders.list + * @desc Retrieves a list of orders, possibly filtered. This method supports + * paging. + * @alias dfareporting.orders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only orders with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.projectId Project ID for orders. + * @param {string=} params.searchString Allows searching for orders by name or ID. Wildcards (*) are allowed. For example, "order*2015" will return orders with names like "order June 2015", "order April 2015", or simply "order 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "order" will match orders with name "my order", "order 2015", or simply "order". + * @param {string=} params.siteId Select only orders that are associated with these site IDs. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{projectId}/orders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'projectId'], + pathParams: ['profileId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placementgroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placementGroups.get + * @desc Gets one placement group by ID. + * @alias dfareporting.placementGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.insert + * @desc Inserts a new placement group. + * @alias dfareporting.placementGroups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.list + * @desc Retrieves a list of placement groups, possibly filtered. This + * method supports paging. + * @alias dfareporting.placementGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only placement groups that belong to these advertisers. + * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. + * @param {string=} params.campaignIds Select only placement groups that belong to these campaigns. + * @param {string=} params.contentCategoryIds Select only placement groups that are associated with these content categories. + * @param {string=} params.directorySiteIds Select only placement groups that are associated with these directory sites. + * @param {string=} params.ids Select only placement groups with these IDs. + * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.placementGroupType Select only placement groups belonging with this group type. A package is a simple group of placements that acts as a single pricing point for a group of tags. A roadblock is a group of placements that not only acts as a single pricing point but also assumes that all the tags in it will be served at the same time. A roadblock requires one of its assigned placements to be marked as primary for reporting. + * @param {string=} params.placementStrategyIds Select only placement groups that are associated with these placement strategies. + * @param {string=} params.pricingTypes Select only placement groups with these pricing types. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for placement groups by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placement groups with names like "placement group June 2015", "placement group May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementgroup" will match placement groups with name "my placementgroup", "placementgroup 2015", or simply "placementgroup". + * @param {string=} params.siteIds Select only placement groups that are associated with these sites. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.patch + * @desc Updates an existing placement group. This method supports patch + * semantics. + * @alias dfareporting.placementGroups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementGroups.update + * @desc Updates an existing placement group. + * @alias dfareporting.placementGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementGroup} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placements { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placements.generatetags + * @desc Generates tags for a placement. + * @alias dfareporting.placements.generatetags + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.campaignId Generate placements belonging to this campaign. This is a required field. + * @param {string=} params.placementIds Generate tags for these placements. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.tagFormats Tag formats to generate for these placements. Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generatetags(params?: any, options?: MethodOptions): + AxiosPromise; + generatetags( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generatetags( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements/generatetags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.placements.get + * @desc Gets one placement by ID. + * @alias dfareporting.placements.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.insert + * @desc Inserts a new placement. + * @alias dfareporting.placements.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.list + * @desc Retrieves a list of placements, possibly filtered. This method + * supports paging. + * @alias dfareporting.placements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only placements that belong to these advertisers. + * @param {boolean=} params.archived Select only archived placements. Don't set this field to select both archived and non-archived placements. + * @param {string=} params.campaignIds Select only placements that belong to these campaigns. + * @param {string=} params.compatibilities Select only placements that are associated with these compatibilities. DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop or on mobile devices for regular or interstitial ads respectively. APP and APP_INTERSTITIAL are for rendering in mobile apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads developed with the VAST standard. + * @param {string=} params.contentCategoryIds Select only placements that are associated with these content categories. + * @param {string=} params.directorySiteIds Select only placements that are associated with these directory sites. + * @param {string=} params.groupIds Select only placements that belong to these placement groups. + * @param {string=} params.ids Select only placements with these IDs. + * @param {string=} params.maxEndDate Select only placements or placement groups whose end date is on or before the specified maxEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.maxStartDate Select only placements or placement groups whose start date is on or before the specified maxStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minEndDate Select only placements or placement groups whose end date is on or after the specified minEndDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.minStartDate Select only placements or placement groups whose start date is on or after the specified minStartDate. The date should be formatted as "yyyy-MM-dd". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string=} params.paymentSource Select only placements with this payment source. + * @param {string=} params.placementStrategyIds Select only placements that are associated with these placement strategies. + * @param {string=} params.pricingTypes Select only placements with these pricing types. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for placements by name or ID. Wildcards (*) are allowed. For example, "placement*2015" will return placements with names like "placement June 2015", "placement May 2015", or simply "placements 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placement" will match placements with name "my placement", "placement 2015", or simply "placement". + * @param {string=} params.siteIds Select only placements that are associated with these sites. + * @param {string=} params.sizeIds Select only placements that are associated with these sizes. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.patch + * @desc Updates an existing placement. This method supports patch + * semantics. + * @alias dfareporting.placements.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placements.update + * @desc Updates an existing placement. + * @alias dfareporting.placements.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Placement} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Placementstrategies { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.placementStrategies.delete + * @desc Deletes an existing placement strategy. + * @alias dfareporting.placementStrategies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.get + * @desc Gets one placement strategy by ID. + * @alias dfareporting.placementStrategies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.insert + * @desc Inserts a new placement strategy. + * @alias dfareporting.placementStrategies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.list + * @desc Retrieves a list of placement strategies, possibly filtered. This + * method supports paging. + * @alias dfareporting.placementStrategies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only placement strategies with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "placementstrategy*2015" will return objects with names like "placementstrategy June 2015", "placementstrategy April 2015", or simply "placementstrategy 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "placementstrategy" will match objects with name "my placementstrategy", "placementstrategy 2015", or simply "placementstrategy". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.placementStrategies.patch + * @desc Updates an existing placement strategy. This method supports patch + * semantics. + * @alias dfareporting.placementStrategies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Placement strategy ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.placementStrategies.update + * @desc Updates an existing placement strategy. + * @alias dfareporting.placementStrategies.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().PlacementStrategy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/placementStrategies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Platformtypes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.platformTypes.get + * @desc Gets one platform type by ID. + * @alias dfareporting.platformTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Platform type ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/platformTypes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.platformTypes.list + * @desc Retrieves a list of platform types. + * @alias dfareporting.platformTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/platformTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Postalcodes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.postalCodes.get + * @desc Gets one postal code by ID. + * @alias dfareporting.postalCodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.code Postal code ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/postalCodes/{code}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'code'], + pathParams: ['code', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.postalCodes.list + * @desc Retrieves a list of postal codes. + * @alias dfareporting.postalCodes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/postalCodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.projects.get + * @desc Gets one project by ID. + * @alias dfareporting.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Project ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.projects.list + * @desc Retrieves a list of projects, possibly filtered. This method + * supports paging. + * @alias dfareporting.projects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserIds Select only projects with these advertiser IDs. + * @param {string=} params.ids Select only projects with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for projects by name or ID. Wildcards (*) are allowed. For example, "project*2015" will return projects with names like "project June 2015", "project April 2015", or simply "project 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "project" will match projects with name "my project", "project 2015", or simply "project". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/projects') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Regions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.regions.list + * @desc Retrieves a list of regions. + * @alias dfareporting.regions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/regions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Remarketinglists { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.remarketingLists.get + * @desc Gets one remarketing list by ID. + * @alias dfareporting.remarketingLists.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.insert + * @desc Inserts a new remarketing list. + * @alias dfareporting.remarketingLists.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.list + * @desc Retrieves a list of remarketing lists, possibly filtered. This + * method supports paging. + * @alias dfareporting.remarketingLists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active or only inactive remarketing lists. + * @param {string} params.advertiserId Select only remarketing lists owned by this advertiser. + * @param {string=} params.floodlightActivityId Select only remarketing lists that have this floodlight activity ID. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.remarketingLists.patch + * @desc Updates an existing remarketing list. This method supports patch + * semantics. + * @alias dfareporting.remarketingLists.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingLists.update + * @desc Updates an existing remarketing list. + * @alias dfareporting.remarketingLists.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Remarketinglistshares { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.remarketingListShares.get + * @desc Gets one remarketing list share by remarketing list ID. + * @alias dfareporting.remarketingListShares.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.remarketingListId Remarketing list ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares/{remarketingListId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'remarketingListId'], + pathParams: ['profileId', 'remarketingListId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingListShares.patch + * @desc Updates an existing remarketing list share. This method supports + * patch semantics. + * @alias dfareporting.remarketingListShares.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {string} params.remarketingListId Remarketing list ID. + * @param {().RemarketingListShare} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'remarketingListId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.remarketingListShares.update + * @desc Updates an existing remarketing list share. + * @alias dfareporting.remarketingListShares.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().RemarketingListShare} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/remarketingListShares') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Reports { + root: Dfareporting; + compatibleFields: Resource$Reports$Compatiblefields; + files: Resource$Reports$Files; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + this.compatibleFields = new Resource$Reports$Compatiblefields(root); + this.files = new Resource$Reports$Files(root); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.delete + * @desc Deletes a report by its ID. + * @alias dfareporting.reports.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.get + * @desc Retrieves a report by its ID. + * @alias dfareporting.reports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.insert + * @desc Creates a report. + * @alias dfareporting.reports.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.list + * @desc Retrieves list of reports. + * @alias dfareporting.reports.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA user profile ID. + * @param {string=} params.scope The scope that defines which results are returned. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.patch + * @desc Updates a report. This method supports patch semantics. + * @alias dfareporting.reports.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.run + * @desc Runs a report. + * @alias dfareporting.reports.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the report. + * @param {boolean=} params.synchronous If set and true, tries to run the report synchronously. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.update + * @desc Updates a report. + * @alias dfareporting.reports.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {string} params.reportId The ID of the report. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Reports$Compatiblefields { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.compatibleFields.query + * @desc Returns the fields that are compatible to be selected in the + * respective sections of a report criteria, given the fields already + * selected in the input report and user permissions. + * @alias dfareporting.reports.compatibleFields.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The DFA user profile ID. + * @param {().Report} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/compatiblefields/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Reports$Files { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.reports.files.get + * @desc Retrieves a report file. This method supports media download. + * @alias dfareporting.reports.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the report file. + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId', 'fileId'], + pathParams: ['fileId', 'profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.reports.files.list + * @desc Lists files for a report. + * @alias dfareporting.reports.files.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken The value of the nextToken from the previous result page. + * @param {string} params.profileId The DFA profile ID. + * @param {string} params.reportId The ID of the parent report. + * @param {string=} params.sortField The field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/reports/{reportId}/files') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'reportId'], + pathParams: ['profileId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Sites { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.sites.get + * @desc Gets one site by ID. + * @alias dfareporting.sites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sites/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.insert + * @desc Inserts a new site. + * @alias dfareporting.sites.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.list + * @desc Retrieves a list of sites, possibly filtered. This method supports + * paging. + * @alias dfareporting.sites.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acceptsInStreamVideoPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsInterstitialPlacements This search filter is no longer supported and will have no effect on the results returned. + * @param {boolean=} params.acceptsPublisherPaidPlacements Select only sites that accept publisher paid placements. + * @param {boolean=} params.adWordsSite Select only AdWords sites. + * @param {boolean=} params.approved Select only approved sites. + * @param {string=} params.campaignIds Select only sites with these campaign IDs. + * @param {string=} params.directorySiteIds Select only sites with these directory site IDs. + * @param {string=} params.ids Select only sites with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name, ID or keyName. Wildcards (*) are allowed. For example, "site*2015" will return objects with names like "site June 2015", "site April 2015", or simply "site 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "site" will match objects with name "my site", "site 2015", or simply "site". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only sites with this subaccount ID. + * @param {boolean=} params.unmappedSite Select only sites that have not been mapped to a directory site. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.patch + * @desc Updates an existing site. This method supports patch semantics. + * @alias dfareporting.sites.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Site ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sites.update + * @desc Updates an existing site. + * @alias dfareporting.sites.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Site} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sizes { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.sizes.get + * @desc Gets one size by ID. + * @alias dfareporting.sizes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Size ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sizes/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sizes.insert + * @desc Inserts a new size. + * @alias dfareporting.sizes.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Size} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sizes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.sizes.list + * @desc Retrieves a list of sizes, possibly filtered. + * @alias dfareporting.sizes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.height Select only sizes with this height. + * @param {boolean=} params.iabStandard Select only IAB standard sizes. + * @param {string=} params.ids Select only sizes with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {integer=} params.width Select only sizes with this width. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/sizes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subaccounts { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.subaccounts.get + * @desc Gets one subaccount by ID. + * @alias dfareporting.subaccounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Subaccount ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.insert + * @desc Inserts a new subaccount. + * @alias dfareporting.subaccounts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.list + * @desc Gets a list of subaccounts, possibly filtered. This method supports + * paging. + * @alias dfareporting.subaccounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only subaccounts with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "subaccount*2015" will return objects with names like "subaccount June 2015", "subaccount April 2015", or simply "subaccount 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "subaccount" will match objects with name "my subaccount", "subaccount 2015", or simply "subaccount". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.patch + * @desc Updates an existing subaccount. This method supports patch + * semantics. + * @alias dfareporting.subaccounts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Subaccount ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.subaccounts.update + * @desc Updates an existing subaccount. + * @alias dfareporting.subaccounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().Subaccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/subaccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Targetableremarketinglists { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.targetableRemarketingLists.get + * @desc Gets one remarketing list by ID. + * @alias dfareporting.targetableRemarketingLists.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Remarketing list ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetableRemarketingLists/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetableRemarketingLists.list + * @desc Retrieves a list of targetable remarketing lists, possibly + * filtered. This method supports paging. + * @alias dfareporting.targetableRemarketingLists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.active Select only active or only inactive targetable remarketing lists. + * @param {string} params.advertiserId Select only targetable remarketing lists targetable by these advertisers. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.name Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "remarketing list*2015" will return objects with names like "remarketing list June 2015", "remarketing list April 2015", or simply "remarketing list 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "remarketing list" will match objects with name "my remarketing list", "remarketing list 2015", or simply "remarketing list". + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$TargetableRemarketingListsListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$TargetableRemarketingListsListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetableRemarketingLists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'advertiserId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Targetingtemplates { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.targetingTemplates.get + * @desc Gets one targeting template by ID. + * @alias dfareporting.targetingTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Targeting template ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.insert + * @desc Inserts a new targeting template. + * @alias dfareporting.targetingTemplates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.list + * @desc Retrieves a list of targeting templates, optionally filtered. This + * method supports paging. + * @alias dfareporting.targetingTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.advertiserId Select only targeting templates with this advertiser ID. + * @param {string=} params.ids Select only targeting templates with these IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "template*2015" will return objects with names like "template June 2015", "template April 2015", or simply "template 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "template" will match objects with name "my template", "template 2015", or simply "template". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dfareporting.targetingTemplates.patch + * @desc Updates an existing targeting template. This method supports patch + * semantics. + * @alias dfareporting.targetingTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Targeting template ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.targetingTemplates.update + * @desc Updates an existing targeting template. + * @alias dfareporting.targetingTemplates.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().TargetingTemplate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/targetingTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Userprofiles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userProfiles.get + * @desc Gets one user profile by ID. + * @alias dfareporting.userProfiles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId The user profile ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles/{profileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userProfiles.list + * @desc Retrieves list of user profiles for a user. + * @alias dfareporting.userProfiles.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dfareporting/v3.0/userprofiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Userrolepermissiongroups { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRolePermissionGroups.get + * @desc Gets one user role permission group by ID. + * @alias dfareporting.userRolePermissionGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role permission group ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissionGroups/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRolePermissionGroups.list + * @desc Gets a list of all supported user role permission groups. + * @alias dfareporting.userRolePermissionGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissionGroups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Userrolepermissions { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRolePermissions.get + * @desc Gets one user role permission by ID. + * @alias dfareporting.userRolePermissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role permission ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRolePermissions.list + * @desc Gets a list of user role permissions, possibly filtered. + * @alias dfareporting.userRolePermissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids Select only user role permissions with these IDs. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRolePermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Userroles { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.userRoles.delete + * @desc Deletes an existing user role. + * @alias dfareporting.userRoles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.get + * @desc Gets one user role by ID. + * @alias dfareporting.userRoles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.insert + * @desc Inserts a new user role. + * @alias dfareporting.userRoles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.list + * @desc Retrieves a list of user roles, possibly filtered. This method + * supports paging. + * @alias dfareporting.userRoles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.accountUserRoleOnly Select only account level user roles not associated with any specific subaccount. + * @param {string=} params.ids Select only user roles with the specified IDs. + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Value of the nextPageToken from the previous result page. + * @param {string} params.profileId User profile ID associated with this request. + * @param {string=} params.searchString Allows searching for objects by name or ID. Wildcards (*) are allowed. For example, "userrole*2015" will return objects with names like "userrole June 2015", "userrole April 2015", or simply "userrole 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "userrole" will match objects with name "my userrole", "userrole 2015", or simply "userrole". + * @param {string=} params.sortField Field by which to sort the list. + * @param {string=} params.sortOrder Order of sorted results. + * @param {string=} params.subaccountId Select only user roles that belong to this subaccount. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.patch + * @desc Updates an existing user role. This method supports patch + * semantics. + * @alias dfareporting.userRoles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id User role ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.userRoles.update + * @desc Updates an existing user role. + * @alias dfareporting.userRoles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {().UserRole} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/userRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Videoformats { + root: Dfareporting; + constructor(root: Dfareporting) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dfareporting.videoFormats.get + * @desc Gets one video format by ID. + * @alias dfareporting.videoFormats.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.id Video format ID. + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/videoFormats/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId', 'id'], + pathParams: ['id', 'profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dfareporting.videoFormats.list + * @desc Lists available video formats. + * @alias dfareporting.videoFormats.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.profileId User profile ID associated with this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dfareporting/v3.0/userprofiles/{profileId}/videoFormats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['profileId'], + pathParams: ['profileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dialogflow/v2.ts b/src/apis/dialogflow/v2.ts index cc6665648a6..a19e150b0e8 100644 --- a/src/apis/dialogflow/v2.ts +++ b/src/apis/dialogflow/v2.ts @@ -27,2552 +27,2574 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Dialogflow API - * - * An end-to-end development suite for conversational interfaces (e.g., - * chatbots, voice-powered apps and devices). - * - * @example - * const google = require('googleapis'); - * const dialogflow = google.dialogflow('v2'); - * - * @namespace dialogflow - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Dialogflow - */ -export class Dialogflow { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dialogflow_v2 { + /** + * Dialogflow API + * + * An end-to-end development suite for conversational interfaces (e.g., + * chatbots, voice-powered apps and devices). + * + * @example + * const google = require('googleapis'); + * const dialogflow = google.dialogflow('v2'); + * + * @namespace dialogflow + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Dialogflow + */ + export class Dialogflow { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Represents a conversational agent. - */ -export interface Schema$GoogleCloudDialogflowV2Agent { /** - * Optional. The URI of the agent's avatar. Avatars are used throughout - * the Dialogflow console and in the self-hosted [Web - * Demo](https://dialogflow.com/docs/integrations/web-demo) integration. - */ - avatarUri: string; + * Represents a conversational agent. + */ + export interface Schema$GoogleCloudDialogflowV2Agent { + /** + * Optional. The URI of the agent's avatar. Avatars are used throughout + * the Dialogflow console and in the self-hosted [Web + * Demo](https://dialogflow.com/docs/integrations/web-demo) integration. + */ + avatarUri: string; + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less + * than the threshold value, then a fallback intent is be triggered or, if + * there are no fallback intents defined, no intent will be triggered. The + * score values range from 0.0 (completely uncertain) to 1.0 (completely + * certain). If set to 0.0, the default of 0.3 is used. + */ + classificationThreshold: number; + /** + * Required. The default language of the agent as a language tag. See + * [Language Support](https://dialogflow.com/docs/reference/language) for a + * list of the currently supported language codes. This field cannot be set + * by the `Update` method. + */ + defaultLanguageCode: string; + /** + * Optional. The description of this agent. The maximum length is 500 + * characters. If exceeded, the request is rejected. + */ + description: string; + /** + * Required. The name of this agent. + */ + displayName: string; + /** + * Optional. Determines whether this agent should log conversation queries. + */ + enableLogging: boolean; + /** + * Optional. Determines how intents are detected from user queries. + */ + matchMode: string; + /** + * Required. The project of this agent. Format: `projects/<Project + * ID>`. + */ + parent: string; + /** + * Optional. The list of all languages supported by this agent (except for + * the `default_language_code`). + */ + supportedLanguageCodes: string[]; + /** + * Required. The time zone of this agent from the [time zone + * database](https://www.iana.org/time-zones), e.g., America/New_York, + * Europe/Paris. + */ + timeZone: string; + } /** - * Optional. To filter out false positive results and still get variety in - * matched natural language inputs for your agent, you can tune the machine - * learning classification threshold. If the returned score value is less than - * the threshold value, then a fallback intent is be triggered or, if there - * are no fallback intents defined, no intent will be triggered. The score - * values range from 0.0 (completely uncertain) to 1.0 (completely certain). - * If set to 0.0, the default of 0.3 is used. - */ - classificationThreshold: number; + * The request message for EntityTypes.BatchCreateEntities. + */ + export interface Schema$GoogleCloudDialogflowV2BatchCreateEntitiesRequest { + /** + * Required. The collection of entities to create. + */ + entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + } /** - * Required. The default language of the agent as a language tag. See - * [Language Support](https://dialogflow.com/docs/reference/language) for a - * list of the currently supported language codes. This field cannot be set by - * the `Update` method. - */ - defaultLanguageCode: string; + * The request message for EntityTypes.BatchDeleteEntities. + */ + export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { + /** + * Required. The canonical `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/<Project ID>`. + */ + entityValues: string[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + } /** - * Optional. The description of this agent. The maximum length is 500 - * characters. If exceeded, the request is rejected. + * The request message for EntityTypes.BatchDeleteEntityTypes. */ - description: string; + export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + */ + entityTypeNames: string[]; + } /** - * Required. The name of this agent. + * The request message for Intents.BatchDeleteIntents. */ - displayName: string; + export interface Schema$GoogleCloudDialogflowV2BatchDeleteIntentsRequest { + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + */ + intents: Schema$GoogleCloudDialogflowV2Intent[]; + } /** - * Optional. Determines whether this agent should log conversation queries. - */ - enableLogging: boolean; + * The response message for EntityTypes.BatchCreateEntities. + */ + export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { + /** + * Required. The collection of new entities to replace the existing + * entities. + */ + entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Optional. Determines how intents are detected from user queries. - */ - matchMode: string; + * The request message for EntityTypes.BatchUpdateEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { + /** + * The collection of entity type to update or create. + */ + entityTypeBatchInline: Schema$GoogleCloudDialogflowV2EntityTypeBatch; + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + */ + entityTypeBatchUri: string; + /** + * Optional. The language of entity synonyms defined in `entity_types`. If + * not specified, the agent's default language is used. [More than a + * dozen languages](https://dialogflow.com/docs/reference/language) are + * supported. Note: languages must be enabled in the agent, before they can + * be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Required. The project of this agent. Format: `projects/<Project ID>`. + * The response message for EntityTypes.BatchUpdateEntityTypes. */ - parent: string; + export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { + /** + * The collection of updated or created entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; + } /** - * Optional. The list of all languages supported by this agent (except for the - * `default_language_code`). - */ - supportedLanguageCodes: string[]; + * The request message for Intents.BatchUpdateIntents. + */ + export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsRequest { + /** + * The collection of intents to update or create. + */ + intentBatchInline: Schema$GoogleCloudDialogflowV2IntentBatch; + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + */ + intentBatchUri: string; + /** + * Optional. The resource view to apply to the returned intent. + */ + intentView: string; + /** + * Optional. The language of training phrases, parameters and rich messages + * defined in `intents`. If not specified, the agent's default language + * is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Required. The time zone of this agent from the [time zone - * database](https://www.iana.org/time-zones), e.g., America/New_York, - * Europe/Paris. + * The response message for Intents.BatchUpdateIntents. */ - timeZone: string; -} -/** - * The request message for EntityTypes.BatchCreateEntities. - */ -export interface Schema$GoogleCloudDialogflowV2BatchCreateEntitiesRequest { + export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { + /** + * The collection of updated or created intents. + */ + intents: Schema$GoogleCloudDialogflowV2Intent[]; + } /** - * Required. The collection of entities to create. + * The response message for EntityTypes.BatchUpdateEntityTypes. */ - entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { + /** + * The collection of updated or created entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. + * The response message for Intents.BatchUpdateIntents. */ - languageCode: string; -} -/** - * The request message for EntityTypes.BatchDeleteEntities. - */ -export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntitiesRequest { + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { + /** + * The collection of updated or created intents. + */ + intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; + } /** - * Required. The canonical `values` of the entities to delete. Note that these - * are not fully-qualified names, i.e. they don't start with - * `projects/<Project ID>`. - */ - entityValues: string[]; + * Represents a context. + */ + export interface Schema$GoogleCloudDialogflowV2beta1Context { + /** + * Optional. The number of conversational query requests after which the + * context expires. If set to `0` (the default) the context expires + * immediately. Contexts expire automatically after 10 minutes even if there + * are no matching queries. + */ + lifespanCount: number; + /** + * Required. The unique identifier of the context. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/contexts/<Context ID>`, or `projects/<Project + * ID>/agent/environments/<Environment ID>/users/<User + * ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: + * Environments and users are under construction and will be available soon. + * The Context ID is always converted to lowercase. If <Environment + * ID> is not specified, we assume default 'draft' environment. + * If <User ID> is not specified, we assume default '-' user. + */ + name: string; + /** + * Optional. The collection of parameters associated with this context. + * Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) + * for syntax. + */ + parameters: any; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; -} -/** - * The request message for EntityTypes.BatchDeleteEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest { + * Represents an entity type. Entity types serve as a tool for extracting + * parameter values from natural language queries. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EntityType { + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + */ + autoExpansionMode: string; + /** + * Required. The name of the entity. + */ + displayName: string; + /** + * Optional. The collection of entities associated with the entity type. + */ + entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + /** + * Required. Indicates the kind of entity type. + */ + kind: string; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of the entity type. Format: + * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. + */ + name: string; + } /** - * Required. The names entity types to delete. All names must point to the - * same agent as `parent`. - */ - entityTypeNames: string[]; -} -/** - * The request message for Intents.BatchDeleteIntents. - */ -export interface Schema$GoogleCloudDialogflowV2BatchDeleteIntentsRequest { + * Optional. Represents an entity. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { + /** + * Required. A collection of synonyms. For `KIND_LIST` entity types this + * must contain exactly one synonym equal to `value`. + */ + synonyms: string[]; + /** + * Required. For `KIND_MAP` entity types: A canonical name to be used in + * place of synonyms. For `KIND_LIST` entity types: A string that can + * contain references to other entity types (with or without aliases). + */ + value: string; + } /** - * Required. The collection of intents to delete. Only intent `name` must be - * filled in. - */ - intents: Schema$GoogleCloudDialogflowV2Intent[]; -} -/** - * The response message for EntityTypes.BatchCreateEntities. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntitiesRequest { + * Events allow for matching intents by event name instead of the natural + * language input. For instance, input `<event: { name: “welcome_event”, + * parameters: { name: “Sam” } }>` can trigger a personalized welcome + * response. The parameter `name` may be used by the agent in the response: + * `“Hello #welcome_event.name! What can I do for you today?”`. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EventInput { + /** + * Required. The language of this query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The unique identifier of the event. + */ + name: string; + /** + * Optional. The collection of parameters associated with the event. + */ + parameters: any; + } /** - * Required. The collection of new entities to replace the existing entities. - */ - entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + * The response message for Agents.ExportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { + /** + * The exported agent. Example for how to export an agent to a zip file via + * a command line: curl \ + * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ --data-binary + * '{}' \ | grep agentContent | sed -e + * 's/.*"agentContent": "\([^"]*\)".x/\1/' + * \ | base64 --decode > <agent zip file> + */ + agentContent: string; + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + */ + agentUri: string; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; + * Represents an intent. Intents convert a number of user expressions or + * patterns into an action. An action is an extraction of a user command or + * sentence semantics. + */ + export interface Schema$GoogleCloudDialogflowV2beta1Intent { + /** + * Optional. The name of the action associated with the intent. + */ + action: string; + /** + * Optional. The list of platforms for which the first response will be + * taken from among the messages assigned to the DEFAULT_PLATFORM. + */ + defaultResponsePlatforms: string[]; + /** + * Required. The name of this intent. + */ + displayName: string; + /** + * Optional. The collection of event names that trigger the intent. If the + * collection of input contexts is not empty, all of the contexts must be + * present in the active user session for an event to trigger this intent. + */ + events: string[]; + /** + * Optional. Collection of information about all followup intents that have + * name of this intent as a root_name. + */ + followupIntentInfo: + Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[]; + /** + * Optional. The list of context names required for this intent to be + * triggered. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + inputContextNames: string[]; + /** + * Optional. Indicates whether this is a fallback intent. + */ + isFallback: boolean; + /** + * Optional. The collection of rich messages corresponding to the `Response` + * field in the Dialogflow console. + */ + messages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + */ + mlDisabled: boolean; + /** + * Optional. Indicates whether Machine Learning is enabled for the intent. + * Note: If `ml_enabled` setting is set to false, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` + * field instead. NOTE: If neither `ml_enabled` nor `ml_disabled` field is + * set, then the default value is determined as follows: - Before April + * 15th, 2018 the default is: ml_enabled = false / ml_disabled = true. - + * After April 15th, 2018 the default is: ml_enabled = true / ml_disabled + * = false. + */ + mlEnabled: boolean; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of this intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + name: string; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the + * context when the intent is matched. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Optional. The collection of parameters associated with the intent. + */ + parameters: Schema$GoogleCloudDialogflowV2beta1IntentParameter[]; + /** + * The unique identifier of the parent intent in the chain of followup + * intents. It identifies the parent followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. Zero or negative numbers mean that the intent is disabled. + */ + priority: number; + /** + * Optional. Indicates whether to delete all contexts in the current session + * when this intent is matched. + */ + resetContexts: boolean; + /** + * The unique identifier of the root intent in the chain of followup + * intents. It identifies the correct followup intents chain for this + * intent. Format: `projects/<Project ID>/agent/intents/<Intent + * ID>`. + */ + rootFollowupIntentName: string; + /** + * Optional. The collection of examples/templates that the agent is trained + * on. + */ + trainingPhrases: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; + /** + * Required. Indicates whether webhooks are enabled for the intent. + */ + webhookState: string; + } /** - * Optional. The mask to control which fields get updated. - */ - updateMask: string; -} -/** - * The request message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest { + * Represents a single followup intent in the chain. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { + /** + * The unique identifier of the followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + followupIntentName: string; + /** + * The unique identifier of the followup intent parent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + } /** - * The collection of entity type to update or create. - */ - entityTypeBatchInline: Schema$GoogleCloudDialogflowV2EntityTypeBatch; + * Corresponds to the `Response` field in the Dialogflow console. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage { + /** + * Displays a basic card for Actions on Google. + */ + basicCard: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard; + /** + * Displays a card. + */ + card: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard; + /** + * Displays a carousel card for Actions on Google. + */ + carouselSelect: + Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; + /** + * Displays an image. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Displays a link out suggestion chip for Actions on Google. + */ + linkOutSuggestion: + Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; + /** + * Displays a list card for Actions on Google. + */ + listSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect; + /** + * Returns a response containing a custom, platform-specific payload. See + * the Intent.Message.Platform type for a description of the structure that + * may be required for your platform. + */ + payload: any; + /** + * Optional. The platform that this message is intended for. + */ + platform: string; + /** + * Displays quick replies. + */ + quickReplies: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; + /** + * Returns a voice or text-only response for Actions on Google. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; + /** + * Displays suggestion chips for Actions on Google. + */ + suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions; + /** + * Returns a text response. + */ + text: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; + } /** - * The URI to a Google Cloud Storage file containing entity types to update or - * create. The file format can either be a serialized proto (of EntityBatch - * type) or a JSON object. Note: The URI must start with "gs://". - */ - entityTypeBatchUri: string; + * The basic card message. Useful for displaying information. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[]; + /** + * Required, unless image is present. The body text of the card. + */ + formattedText: string; + /** + * Optional. The image for the card. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Optional. The language of entity synonyms defined in `entity_types`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; + * The button object that appears at the bottom of a card. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { + /** + * Required. Action to take when a user taps on the button. + */ + openUriAction: + Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; + /** + * Required. The title of the button. + */ + title: string; + } /** - * Optional. The mask to control which fields get updated. + * Opens the given URI. */ - updateMask: string; -} -/** - * The response message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { + /** + * Required. The HTTP or HTTPS scheme URI. + */ + uri: string; + } /** - * The collection of updated or created entity types. - */ - entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; -} -/** - * The request message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsRequest { + * The card response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[]; + /** + * Optional. The public URI to an image file for the card. + */ + imageUri: string; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * The collection of intents to update or create. - */ - intentBatchInline: Schema$GoogleCloudDialogflowV2IntentBatch; + * Optional. Contains information about a button. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton { + /** + * Optional. The text to send back to the Dialogflow API or a URI to open. + */ + postback: string; + /** + * Optional. The text to show on the button. + */ + text: string; + } /** - * The URI to a Google Cloud Storage file containing intents to update or - * create. The file format can either be a serialized proto (of IntentBatch - * type) or JSON object. Note: The URI must start with "gs://". + * The card for presenting a carousel of options to select from. */ - intentBatchUri: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { + /** + * Required. Carousel items. + */ + items: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; + } /** - * Optional. The resource view to apply to the returned intent. - */ - intentView: string; + * An item in the carousel. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { + /** + * Optional. The body text of the card. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Required. Additional info about the option item. + */ + info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; + /** + * Required. Title of the carousel item. + */ + title: string; + } /** - * Optional. The language of training phrases, parameters and rich messages - * defined in `intents`. If not specified, the agent's default language is - * used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; + * The image response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + */ + accessibilityText: string; + /** + * Optional. The public URI to an image file. + */ + imageUri: string; + } /** - * Optional. The mask to control which fields get updated. - */ - updateMask: string; -} -/** - * The response message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { + * The suggestion chip message that allows the user to jump out to the app or + * website associated with this agent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { + /** + * Required. The name of the app or site this chip is linking to. + */ + destinationName: string; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + */ + uri: string; + } /** - * The collection of updated or created intents. - */ - intents: Schema$GoogleCloudDialogflowV2Intent[]; -} -/** - * The response message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { + * The card for presenting a list of options to select from. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { + /** + * Required. List items. + */ + items: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; + /** + * Optional. The overall title of the list. + */ + title: string; + } /** - * The collection of updated or created entity types. - */ - entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; -} -/** - * The response message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { + * An item in the list. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { + /** + * Optional. The main text describing the item. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Required. Additional information about this option. + */ + info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; + /** + * Required. The title of the list item. + */ + title: string; + } /** - * The collection of updated or created intents. - */ - intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; -} -/** - * Represents a context. - */ -export interface Schema$GoogleCloudDialogflowV2beta1Context { + * The quick replies response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { + /** + * Optional. The collection of quick replies. + */ + quickReplies: string[]; + /** + * Optional. The title of the collection of quick replies. + */ + title: string; + } /** - * Optional. The number of conversational query requests after which the - * context expires. If set to `0` (the default) the context expires - * immediately. Contexts expire automatically after 10 minutes even if there - * are no matching queries. - */ - lifespanCount: number; + * Additional info about the select item for when it is triggered in a dialog. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + */ + key: string; + /** + * Optional. A list of synonyms that can also be used to trigger this item + * in dialog. + */ + synonyms: string[]; + } /** - * Required. The unique identifier of the context. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/contexts/<Context ID>`, or `projects/<Project - * ID>/agent/environments/<Environment ID>/users/<User - * ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: - * Environments and users are under construction and will be available soon. - * The Context ID is always converted to lowercase. If <Environment ID> - * is not specified, we assume default 'draft' environment. If - * <User ID> is not specified, we assume default '-' user. - */ - name: string; + * The simple response message containing speech or text. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { + /** + * Optional. The text to display. + */ + displayText: string; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + */ + ssml: string; + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + */ + textToSpeech: string; + } /** - * Optional. The collection of parameters associated with this context. Refer - * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for - * syntax. - */ - parameters: any; -} -/** - * Represents an entity type. Entity types serve as a tool for extracting - * parameter values from natural language queries. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EntityType { + * The collection of simple response candidates. This message in + * `QueryResult.fulfillment_messages` and + * `WebhookResponse.fulfillment_messages` should contain only one + * `SimpleResponse`. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { + /** + * Required. The list of simple responses. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[]; + } /** - * Optional. Indicates whether the entity type can be automatically expanded. + * The suggestion chip message that the user can tap to quickly post a reply + * to the conversation. */ - autoExpansionMode: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { + /** + * Required. The text shown the in the suggestion chip. + */ + title: string; + } /** - * Required. The name of the entity. + * The collection of suggestions. */ - displayName: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { + /** + * Required. The list of suggested replies. + */ + suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; + } /** - * Optional. The collection of entities associated with the entity type. + * The text response message. */ - entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { + /** + * Optional. The collection of the agent's responses. + */ + text: string[]; + } /** - * Required. Indicates the kind of entity type. - */ - kind: string; + * Represents intent parameters. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentParameter { + /** + * Optional. The default value to use when the `value` yields an empty + * result. Default values can be extracted from contexts by using the + * following syntax: `#context_name.parameter_name`. + */ + defaultValue: string; + /** + * Required. The name of the parameter. + */ + displayName: string; + /** + * Optional. The name of the entity type, prefixed with `@`, that describes + * values of the parameter. If the parameter is required, this must be + * provided. + */ + entityTypeDisplayName: string; + /** + * Optional. Indicates whether the parameter represents a list of values. + */ + isList: boolean; + /** + * Optional. Indicates whether the parameter is required. That is, whether + * the intent cannot be completed without collecting the parameter value. + */ + mandatory: boolean; + /** + * The unique identifier of this parameter. + */ + name: string; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect value for the parameter. + */ + prompts: string[]; + /** + * Optional. The definition of the parameter value. It can be: - a constant + * string, - a parameter value defined as `$parameter_name`, - an original + * parameter value defined as `$parameter_name.original`, - a parameter + * value from some context defined as `#context_name.parameter_name`. + */ + value: string; + } /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of the entity type. Format: - * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. - */ - name: string; -} -/** - * Optional. Represents an entity. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { + * Represents an example or template that the agent is trained on. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { + /** + * Required. The unique identifier of this training phrase. + */ + name: string; + /** + * Required. The collection of training phrase parts (can be annotated). + * Fields: `entity_type`, `alias` and `user_defined` should be populated + * only for the annotated parts of the training phrase. + */ + parts: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; + /** + * Optional. Indicates how many times this example or template was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + */ + timesAddedCount: number; + /** + * Required. The type of the training phrase. + */ + type: string; + } /** - * Required. A collection of synonyms. For `KIND_LIST` entity types this must - * contain exactly one synonym equal to `value`. - */ - synonyms: string[]; + * Represents a part of a training phrase. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { + /** + * Optional. The parameter name for the value extracted from the annotated + * part of the example. + */ + alias: string; + /** + * Optional. The entity type name prefixed with `@`. This field is required + * for the annotated part of the text and applies only to examples. + */ + entityType: string; + /** + * Required. The text corresponding to the example or template, if there are + * no annotations. For annotated examples, it is the text for one of the + * example's parts. + */ + text: string; + /** + * Optional. Indicates whether the text was manually annotated by the + * developer. + */ + userDefined: boolean; + } /** - * Required. For `KIND_MAP` entity types: A canonical name to be used in - * place of synonyms. For `KIND_LIST` entity types: A string that can - * contain references to other entity types (with or without aliases). + * Metadata in google::longrunning::Operation for Knowledge operations. */ - value: string; -} -/** - * Events allow for matching intents by event name instead of the natural - * language input. For instance, input `<event: { name: “welcome_event”, - * parameters: { name: “Sam” } }>` can trigger a personalized welcome - * response. The parameter `name` may be used by the agent in the response: - * `“Hello #welcome_event.name! What can I do for you today?”`. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EventInput { + export interface Schema$GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { + /** + * Required. The current state of this operation. + */ + state: string; + } /** - * Required. The language of this query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. + * Represents the contents of the original request that was passed to the + * `[Streaming]DetectIntent` call. */ - languageCode: string; + export interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { + /** + * Optional. This field is set to the value of `QueryParameters.payload` + * field passed in the request. + */ + payload: any; + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is + * set by Dialogflow-owned servers. + */ + source: string; + } /** - * Required. The unique identifier of the event. - */ - name: string; + * Represents the result of conversational query or event processing. + */ + export interface Schema$GoogleCloudDialogflowV2beta1QueryResult { + /** + * The action name from the matched intent. + */ + action: string; + /** + * This field is set to: - `false` if the matched intent has required + * parameters and not all of the required parameter values have been + * collected. - `true` if all required parameter values have been collected, + * or if the matched intent doesn't contain any required parameters. + */ + allRequiredParamsPresent: boolean; + /** + * The free-form diagnostic info. For example, this field could contain + * webhook call latency. + */ + diagnosticInfo: any; + /** + * The collection of rich messages to present to the user. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * The text to be pronounced to the user or shown on the screen. + */ + fulfillmentText: string; + /** + * The intent that matched the conversational query. Some, not all fields + * are filled in this message, including but not limited to: `name`, + * `display_name` and `webhook_state`. + */ + intent: Schema$GoogleCloudDialogflowV2beta1Intent; + /** + * The intent detection confidence. Values range from 0.0 (completely + * uncertain) to 1.0 (completely certain). + */ + intentDetectionConfidence: number; + /** + * The language that was triggered during intent detection. See [Language + * Support](https://dialogflow.com/docs/reference/language) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name `<parameter + * name>.original` containing the original parameter values before the + * query. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * The collection of extracted parameters. + */ + parameters: any; + /** + * The original conversational query text: - If natural language text was + * provided as input, `query_text` contains a copy of the input. - If + * natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. - If an event was + * provided as input, `query_text` is not set. + */ + queryText: string; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that + * confidence was not set. You should not rely on this field as it + * isn't guaranteed to be accurate, or even set. In particular this + * field isn't set in Webhook calls and for StreamingDetectIntent since + * the streaming endpoint has separate confidence estimates per portion of + * the audio in StreamingRecognitionResult. + */ + speechRecognitionConfidence: number; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + */ + webhookPayload: any; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + */ + webhookSource: string; + } /** - * Optional. The collection of parameters associated with the event. - */ - parameters: any; -} -/** - * The response message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { + * The request message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + */ + originalDetectIntentRequest: + Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + */ + queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + */ + responseId: string; + /** + * The unique identifier of detectIntent request session. Can be used to + * identify end-user inside webhook implementation. Format: + * `projects/<Project ID>/agent/sessions/<Session ID>`. + */ + session: string; + } /** - * The exported agent. Example for how to export an agent to a zip file via a - * command line: curl \ - * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * '{}' \ | grep agentContent | sed -e - * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ - * | base64 --decode > <agent zip file> - */ - agentContent: string; + * The response message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2beta1WebhookResponse { + /** + * Optional. Makes the platform immediately invoke another `DetectIntent` + * call internally with the specified event as input. + */ + followupEventInput: Schema$GoogleCloudDialogflowV2beta1EventInput; + /** + * Optional. The collection of rich messages to present to the user. This + * value is passed directly to `QueryResult.fulfillment_messages`. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * Optional. The text to be shown on the screen. This value is passed + * directly to `QueryResult.fulfillment_text`. + */ + fulfillmentText: string; + /** + * Optional. The collection of output contexts. This value is passed + * directly to `QueryResult.output_contexts`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Optional. This value is passed directly to `QueryResult.webhook_payload`. + * See the related `fulfillment_messages[i].payload field`, which may be + * used as an alternative to this field. This field can be used for Actions + * on Google responses. It should have a structure similar to the JSON + * message shown here. For more information, see [Actions on Google Webhook + * Format](https://developers.google.com/actions/dialogflow/webhook) + * <pre>{ "google": { "expectUserResponse": + * true, "richResponse": { "items": [ { + * "simpleResponse": { "textToSpeech": + * "this is a simple response" } } ] } + * } }</pre> + */ + payload: any; + /** + * Optional. This value is passed directly to `QueryResult.webhook_source`. + */ + source: string; + } /** - * The URI to a file containing the exported agent. This field is populated - * only if `agent_uri` is specified in `ExportAgentRequest`. - */ - agentUri: string; -} -/** - * Represents an intent. Intents convert a number of user expressions or - * patterns into an action. An action is an extraction of a user command or - * sentence semantics. - */ -export interface Schema$GoogleCloudDialogflowV2beta1Intent { + * Represents a context. + */ + export interface Schema$GoogleCloudDialogflowV2Context { + /** + * Optional. The number of conversational query requests after which the + * context expires. If set to `0` (the default) the context expires + * immediately. Contexts expire automatically after 10 minutes even if there + * are no matching queries. + */ + lifespanCount: number; + /** + * Required. The unique identifier of the context. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/contexts/<Context ID>`. + */ + name: string; + /** + * Optional. The collection of parameters associated with this context. + * Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) + * for syntax. + */ + parameters: any; + } /** - * Optional. The name of the action associated with the intent. - */ - action: string; + * The request to detect user's intent. + */ + export interface Schema$GoogleCloudDialogflowV2DetectIntentRequest { + /** + * Optional. The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. A + * single request can contain up to 1 minute of speech audio data. + */ + inputAudio: string; + /** + * Required. The input specification. It can be set to: 1. an audio config + * which instructs the speech recognizer how to process the speech audio, 2. + * a conversational query in the form of text, or 3. an event that + * specifies which intent to trigger. + */ + queryInput: Schema$GoogleCloudDialogflowV2QueryInput; + /** + * Optional. The parameters of this query. + */ + queryParams: Schema$GoogleCloudDialogflowV2QueryParameters; + } /** - * Optional. The list of platforms for which the first response will be taken - * from among the messages assigned to the DEFAULT_PLATFORM. - */ - defaultResponsePlatforms: string[]; + * The message returned from the DetectIntent method. + */ + export interface Schema$GoogleCloudDialogflowV2DetectIntentResponse { + /** + * The results of the conversational query or event processing. + */ + queryResult: Schema$GoogleCloudDialogflowV2QueryResult; + /** + * The unique identifier of the response. It can be used to locate a + * response in the training example set or for reporting issues. + */ + responseId: string; + /** + * Specifies the status of the webhook request. `webhook_status` is never + * populated in webhook requests. + */ + webhookStatus: Schema$GoogleRpcStatus; + } /** - * Required. The name of this intent. - */ - displayName: string; + * Represents an entity type. Entity types serve as a tool for extracting + * parameter values from natural language queries. + */ + export interface Schema$GoogleCloudDialogflowV2EntityType { + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + */ + autoExpansionMode: string; + /** + * Required. The name of the entity. + */ + displayName: string; + /** + * Optional. The collection of entities associated with the entity type. + */ + entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + /** + * Required. Indicates the kind of entity type. + */ + kind: string; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of the entity type. Format: + * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. + */ + name: string; + } /** - * Optional. The collection of event names that trigger the intent. If the - * collection of input contexts is not empty, all of the contexts must be - * present in the active user session for an event to trigger this intent. + * This message is a wrapper around a collection of entity types. */ - events: string[]; + export interface Schema$GoogleCloudDialogflowV2EntityTypeBatch { + /** + * A collection of entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; + } /** - * Optional. Collection of information about all followup intents that have - * name of this intent as a root_name. - */ - followupIntentInfo: - Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[]; + * Optional. Represents an entity. + */ + export interface Schema$GoogleCloudDialogflowV2EntityTypeEntity { + /** + * Required. A collection of synonyms. For `KIND_LIST` entity types this + * must contain exactly one synonym equal to `value`. + */ + synonyms: string[]; + /** + * Required. For `KIND_MAP` entity types: A canonical name to be used in + * place of synonyms. For `KIND_LIST` entity types: A string that can + * contain references to other entity types (with or without aliases). + */ + value: string; + } /** - * Optional. The list of context names required for this intent to be - * triggered. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - inputContextNames: string[]; + * Events allow for matching intents by event name instead of the natural + * language input. For instance, input `<event: { name: “welcome_event”, + * parameters: { name: “Sam” } }>` can trigger a personalized welcome + * response. The parameter `name` may be used by the agent in the response: + * `“Hello #welcome_event.name! What can I do for you today?”`. + */ + export interface Schema$GoogleCloudDialogflowV2EventInput { + /** + * Required. The language of this query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The unique identifier of the event. + */ + name: string; + /** + * Optional. The collection of parameters associated with the event. + */ + parameters: any; + } /** - * Optional. Indicates whether this is a fallback intent. + * The request message for Agents.ExportAgent. */ - isFallback: boolean; + export interface Schema$GoogleCloudDialogflowV2ExportAgentRequest { + /** + * Optional. The Google Cloud Storage URI to export the agent to. Note: The + * URI must start with "gs://". If left unspecified, the + * serialized agent is returned inline. + */ + agentUri: string; + } /** - * Optional. The collection of rich messages corresponding to the `Response` - * field in the Dialogflow console. - */ - messages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + * The response message for Agents.ExportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2ExportAgentResponse { + /** + * The exported agent. Example for how to export an agent to a zip file via + * a command line: curl \ + * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ --data-binary + * '{}' \ | grep agentContent | sed -e + * 's/.*"agentContent": "\([^"]*\)".x/\1/' + * \ | base64 --decode > <agent zip file> + */ + agentContent: string; + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + */ + agentUri: string; + } /** - * Optional. Indicates whether Machine Learning is disabled for the intent. - * Note: If `ml_disabled` setting is set to true, then this intent is not - * taken into account during inference in `ML ONLY` match mode. Also, - * auto-markup in the UI is turned off. - */ - mlDisabled: boolean; + * The request message for Agents.ImportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2ImportAgentRequest { + /** + * The agent to import. Example for how to import an agent via the command + * line: curl \ + * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ + * --data-binary "{ 'agentContent': '$(cat <agent + * zip file> | base64 -w 0)' }" + */ + agentContent: string; + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + */ + agentUri: string; + } /** - * Optional. Indicates whether Machine Learning is enabled for the intent. - * Note: If `ml_enabled` setting is set to false, then this intent is not - * taken into account during inference in `ML ONLY` match mode. Also, - * auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` - * field instead. NOTE: If neither `ml_enabled` nor `ml_disabled` field is - * set, then the default value is determined as follows: - Before April 15th, - * 2018 the default is: ml_enabled = false / ml_disabled = true. - After - * April 15th, 2018 the default is: ml_enabled = true / ml_disabled = false. - */ - mlEnabled: boolean; + * Instructs the speech recognizer how to process the audio content. + */ + export interface Schema$GoogleCloudDialogflowV2InputAudioConfig { + /** + * Required. Audio encoding of the audio content to process. + */ + audioEncoding: string; + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Optional. The collection of phrase hints which are used to boost accuracy + * of speech recognition. Refer to [Cloud Speech API + * documentation](/speech/docs/basics#phrase-hints) for more details. + */ + phraseHints: string[]; + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API documentation](/speech/docs/basics) for more + * details. + */ + sampleRateHertz: number; + } /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - name: string; + * Represents an intent. Intents convert a number of user expressions or + * patterns into an action. An action is an extraction of a user command or + * sentence semantics. + */ + export interface Schema$GoogleCloudDialogflowV2Intent { + /** + * Optional. The name of the action associated with the intent. + */ + action: string; + /** + * Optional. The list of platforms for which the first response will be + * taken from among the messages assigned to the DEFAULT_PLATFORM. + */ + defaultResponsePlatforms: string[]; + /** + * Required. The name of this intent. + */ + displayName: string; + /** + * Optional. The collection of event names that trigger the intent. If the + * collection of input contexts is not empty, all of the contexts must be + * present in the active user session for an event to trigger this intent. + */ + events: string[]; + /** + * Optional. Collection of information about all followup intents that have + * name of this intent as a root_name. + */ + followupIntentInfo: + Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo[]; + /** + * Optional. The list of context names required for this intent to be + * triggered. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + inputContextNames: string[]; + /** + * Optional. Indicates whether this is a fallback intent. + */ + isFallback: boolean; + /** + * Optional. The collection of rich messages corresponding to the `Response` + * field in the Dialogflow console. + */ + messages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_diabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + */ + mlDisabled: boolean; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of this intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + name: string; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the + * context when the intent is matched. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Optional. The collection of parameters associated with the intent. + */ + parameters: Schema$GoogleCloudDialogflowV2IntentParameter[]; + /** + * The unique identifier of the parent intent in the chain of followup + * intents. It identifies the parent followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. Zero or negative numbers mean that the intent is disabled. + */ + priority: number; + /** + * Optional. Indicates whether to delete all contexts in the current session + * when this intent is matched. + */ + resetContexts: boolean; + /** + * The unique identifier of the root intent in the chain of followup + * intents. It identifies the correct followup intents chain for this + * intent. Format: `projects/<Project ID>/agent/intents/<Intent + * ID>`. + */ + rootFollowupIntentName: string; + /** + * Optional. The collection of examples/templates that the agent is trained + * on. + */ + trainingPhrases: Schema$GoogleCloudDialogflowV2IntentTrainingPhrase[]; + /** + * Required. Indicates whether webhooks are enabled for the intent. + */ + webhookState: string; + } /** - * Optional. The collection of contexts that are activated when the intent is - * matched. Context messages in this collection should not set the parameters - * field. Setting the `lifespan_count` to 0 will reset the context when the - * intent is matched. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. + * This message is a wrapper around a collection of intents. */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + export interface Schema$GoogleCloudDialogflowV2IntentBatch { + /** + * A collection of intents. + */ + intents: Schema$GoogleCloudDialogflowV2Intent[]; + } /** - * Optional. The collection of parameters associated with the intent. - */ - parameters: Schema$GoogleCloudDialogflowV2beta1IntentParameter[]; + * Represents a single followup intent in the chain. + */ + export interface Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo { + /** + * The unique identifier of the followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + followupIntentName: string; + /** + * The unique identifier of the followup intent parent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + } /** - * The unique identifier of the parent intent in the chain of followup - * intents. It identifies the parent followup intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; + * Corresponds to the `Response` field in the Dialogflow console. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessage { + /** + * The basic card response for Actions on Google. + */ + basicCard: Schema$GoogleCloudDialogflowV2IntentMessageBasicCard; + /** + * The card response. + */ + card: Schema$GoogleCloudDialogflowV2IntentMessageCard; + /** + * The carousel card response for Actions on Google. + */ + carouselSelect: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect; + /** + * The image response. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * The link out suggestion chip for Actions on Google. + */ + linkOutSuggestion: + Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion; + /** + * The list card response for Actions on Google. + */ + listSelect: Schema$GoogleCloudDialogflowV2IntentMessageListSelect; + /** + * Returns a response containing a custom, platform-specific payload. See + * the Intent.Message.Platform type for a description of the structure that + * may be required for your platform. + */ + payload: any; + /** + * Optional. The platform that this message is intended for. + */ + platform: string; + /** + * The quick replies response. + */ + quickReplies: Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies; + /** + * The voice and text-only responses for Actions on Google. + */ + simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses; + /** + * The suggestion chips for Actions on Google. + */ + suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestions; + /** + * The text response. + */ + text: Schema$GoogleCloudDialogflowV2IntentMessageText; + } /** - * Optional. The priority of this intent. Higher numbers represent higher - * priorities. Zero or negative numbers mean that the intent is disabled. - */ - priority: number; + * The basic card message. Useful for displaying information. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton[]; + /** + * Required, unless image is present. The body text of the card. + */ + formattedText: string; + /** + * Optional. The image for the card. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Optional. Indicates whether to delete all contexts in the current session - * when this intent is matched. - */ - resetContexts: boolean; + * The button object that appears at the bottom of a card. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton { + /** + * Required. Action to take when a user taps on the button. + */ + openUriAction: + Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction; + /** + * Required. The title of the button. + */ + title: string; + } /** - * The unique identifier of the root intent in the chain of followup intents. - * It identifies the correct followup intents chain for this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. + * Opens the given URI. */ - rootFollowupIntentName: string; + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { + /** + * Required. The HTTP or HTTPS scheme URI. + */ + uri: string; + } /** - * Optional. The collection of examples/templates that the agent is trained - * on. - */ - trainingPhrases: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; + * The card response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2IntentMessageCardButton[]; + /** + * Optional. The public URI to an image file for the card. + */ + imageUri: string; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Required. Indicates whether webhooks are enabled for the intent. - */ - webhookState: string; -} -/** - * Represents a single followup intent in the chain. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { + * Optional. Contains information about a button. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCardButton { + /** + * Optional. The text to send back to the Dialogflow API or a URI to open. + */ + postback: string; + /** + * Optional. The text to show on the button. + */ + text: string; + } /** - * The unique identifier of the followup intent. Format: `projects/<Project - * ID>/agent/intents/<Intent ID>`. + * The card for presenting a carousel of options to select from. */ - followupIntentName: string; + export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect { + /** + * Required. Carousel items. + */ + items: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem[]; + } /** - * The unique identifier of the followup intent parent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; -} -/** - * Corresponds to the `Response` field in the Dialogflow console. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage { + * An item in the carousel. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { + /** + * Optional. The body text of the card. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Required. Additional info about the option item. + */ + info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; + /** + * Required. Title of the carousel item. + */ + title: string; + } /** - * Displays a basic card for Actions on Google. - */ - basicCard: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard; + * The image response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageImage { + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + */ + accessibilityText: string; + /** + * Optional. The public URI to an image file. + */ + imageUri: string; + } /** - * Displays a card. - */ - card: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard; + * The suggestion chip message that allows the user to jump out to the app or + * website associated with this agent. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { + /** + * Required. The name of the app or site this chip is linking to. + */ + destinationName: string; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + */ + uri: string; + } /** - * Displays a carousel card for Actions on Google. - */ - carouselSelect: - Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; + * The card for presenting a list of options to select from. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelect { + /** + * Required. List items. + */ + items: Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem[]; + /** + * Optional. The overall title of the list. + */ + title: string; + } /** - * Displays an image. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + * An item in the list. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem { + /** + * Optional. The main text describing the item. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Required. Additional information about this option. + */ + info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; + /** + * Required. The title of the list item. + */ + title: string; + } /** - * Displays a link out suggestion chip for Actions on Google. - */ - linkOutSuggestion: - Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; + * The quick replies response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies { + /** + * Optional. The collection of quick replies. + */ + quickReplies: string[]; + /** + * Optional. The title of the collection of quick replies. + */ + title: string; + } /** - * Displays a list card for Actions on Google. - */ - listSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect; + * Additional info about the select item for when it is triggered in a dialog. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo { + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + */ + key: string; + /** + * Optional. A list of synonyms that can also be used to trigger this item + * in dialog. + */ + synonyms: string[]; + } /** - * Returns a response containing a custom, platform-specific payload. See the - * Intent.Message.Platform type for a description of the structure that may be - * required for your platform. - */ - payload: any; + * The simple response message containing speech or text. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse { + /** + * Optional. The text to display. + */ + displayText: string; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + */ + ssml: string; + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + */ + textToSpeech: string; + } /** - * Optional. The platform that this message is intended for. - */ - platform: string; + * The collection of simple response candidates. This message in + * `QueryResult.fulfillment_messages` and + * `WebhookResponse.fulfillment_messages` should contain only one + * `SimpleResponse`. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses { + /** + * Required. The list of simple responses. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse[]; + } /** - * Displays quick replies. + * The suggestion chip message that the user can tap to quickly post a reply + * to the conversation. */ - quickReplies: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; + export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestion { + /** + * Required. The text shown the in the suggestion chip. + */ + title: string; + } /** - * Returns a voice or text-only response for Actions on Google. + * The collection of suggestions. */ - simpleResponses: - Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; + export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestions { + /** + * Required. The list of suggested replies. + */ + suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestion[]; + } /** - * Displays suggestion chips for Actions on Google. + * The text response message. */ - suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions; + export interface Schema$GoogleCloudDialogflowV2IntentMessageText { + /** + * Optional. The collection of the agent's responses. + */ + text: string[]; + } /** - * Returns a text response. - */ - text: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; -} -/** - * The basic card message. Useful for displaying information. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard { + * Represents intent parameters. + */ + export interface Schema$GoogleCloudDialogflowV2IntentParameter { + /** + * Optional. The default value to use when the `value` yields an empty + * result. Default values can be extracted from contexts by using the + * following syntax: `#context_name.parameter_name`. + */ + defaultValue: string; + /** + * Required. The name of the parameter. + */ + displayName: string; + /** + * Optional. The name of the entity type, prefixed with `@`, that describes + * values of the parameter. If the parameter is required, this must be + * provided. + */ + entityTypeDisplayName: string; + /** + * Optional. Indicates whether the parameter represents a list of values. + */ + isList: boolean; + /** + * Optional. Indicates whether the parameter is required. That is, whether + * the intent cannot be completed without collecting the parameter value. + */ + mandatory: boolean; + /** + * The unique identifier of this parameter. + */ + name: string; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect value for the parameter. + */ + prompts: string[]; + /** + * Optional. The definition of the parameter value. It can be: - a constant + * string, - a parameter value defined as `$parameter_name`, - an original + * parameter value defined as `$parameter_name.original`, - a parameter + * value from some context defined as `#context_name.parameter_name`. + */ + value: string; + } /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[]; + * Represents an example or template that the agent is trained on. + */ + export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrase { + /** + * Required. The unique identifier of this training phrase. + */ + name: string; + /** + * Required. The collection of training phrase parts (can be annotated). + * Fields: `entity_type`, `alias` and `user_defined` should be populated + * only for the annotated parts of the training phrase. + */ + parts: Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart[]; + /** + * Optional. Indicates how many times this example or template was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + */ + timesAddedCount: number; + /** + * Required. The type of the training phrase. + */ + type: string; + } /** - * Required, unless image is present. The body text of the card. - */ - formattedText: string; + * Represents a part of a training phrase. + */ + export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart { + /** + * Optional. The parameter name for the value extracted from the annotated + * part of the example. + */ + alias: string; + /** + * Optional. The entity type name prefixed with `@`. This field is required + * for the annotated part of the text and applies only to examples. + */ + entityType: string; + /** + * Required. The text corresponding to the example or template, if there are + * no annotations. For annotated examples, it is the text for one of the + * example's parts. + */ + text: string; + /** + * Optional. Indicates whether the text was manually annotated by the + * developer. + */ + userDefined: boolean; + } /** - * Optional. The image for the card. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + * The response message for Contexts.ListContexts. + */ + export interface Schema$GoogleCloudDialogflowV2ListContextsResponse { + /** + * The list of contexts. There will be a maximum number of items returned + * based on the page_size field in the request. + */ + contexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The subtitle of the card. - */ - subtitle: string; + * The response message for EntityTypes.ListEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2ListEntityTypesResponse { + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The title of the card. - */ - title: string; -} -/** - * The button object that appears at the bottom of a card. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { + * The response message for Intents.ListIntents. + */ + export interface Schema$GoogleCloudDialogflowV2ListIntentsResponse { + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + intents: Schema$GoogleCloudDialogflowV2Intent[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Required. Action to take when a user taps on the button. - */ - openUriAction: - Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; + * The response message for SessionEntityTypes.ListSessionEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse { + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + sessionEntityTypes: Schema$GoogleCloudDialogflowV2SessionEntityType[]; + } /** - * Required. The title of the button. + * Represents the contents of the original request that was passed to the + * `[Streaming]DetectIntent` call. */ - title: string; -} -/** - * Opens the given URI. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { + export interface Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest { + /** + * Optional. This field is set to the value of `QueryParameters.payload` + * field passed in the request. + */ + payload: any; + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is + * set by Dialogflow-owned servers. + */ + source: string; + } /** - * Required. The HTTP or HTTPS scheme URI. - */ - uri: string; -} -/** - * The card response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard { + * Represents the query input. It can contain either: 1. An audio config + * which instructs the speech recognizer how to process the speech audio. + * 2. A conversational query in the form of text,. 3. An event that + * specifies which intent to trigger. + */ + export interface Schema$GoogleCloudDialogflowV2QueryInput { + /** + * Instructs the speech recognizer how to process the speech audio. + */ + audioConfig: Schema$GoogleCloudDialogflowV2InputAudioConfig; + /** + * The event to be processed. + */ + event: Schema$GoogleCloudDialogflowV2EventInput; + /** + * The natural language text to be processed. + */ + text: Schema$GoogleCloudDialogflowV2TextInput; + } /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[]; + * Represents the parameters of the conversational query. + */ + export interface Schema$GoogleCloudDialogflowV2QueryParameters { + /** + * Optional. The collection of contexts to be activated before this query is + * executed. + */ + contexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Optional. The geo location of this conversational query. + */ + geoLocation: Schema$GoogleTypeLatLng; + /** + * Optional. This field can be used to pass custom data into the webhook + * associated with the agent. Arbitrary JSON objects are supported. + */ + payload: any; + /** + * Optional. Specifies whether to delete all contexts in the current session + * before the new ones are activated. + */ + resetContexts: boolean; + /** + * Optional. The collection of session entity types to replace or extend + * developer entities with for this query only. The entity synonyms apply to + * all languages. + */ + sessionEntityTypes: Schema$GoogleCloudDialogflowV2SessionEntityType[]; + /** + * Optional. The time zone of this conversational query from the [time zone + * database](https://www.iana.org/time-zones), e.g., America/New_York, + * Europe/Paris. If not provided, the time zone specified in agent settings + * is used. + */ + timeZone: string; + } /** - * Optional. The public URI to an image file for the card. - */ - imageUri: string; + * Represents the result of conversational query or event processing. + */ + export interface Schema$GoogleCloudDialogflowV2QueryResult { + /** + * The action name from the matched intent. + */ + action: string; + /** + * This field is set to: - `false` if the matched intent has required + * parameters and not all of the required parameter values have been + * collected. - `true` if all required parameter values have been collected, + * or if the matched intent doesn't contain any required parameters. + */ + allRequiredParamsPresent: boolean; + /** + * The free-form diagnostic info. For example, this field could contain + * webhook call latency. + */ + diagnosticInfo: any; + /** + * The collection of rich messages to present to the user. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * The text to be pronounced to the user or shown on the screen. + */ + fulfillmentText: string; + /** + * The intent that matched the conversational query. Some, not all fields + * are filled in this message, including but not limited to: `name`, + * `display_name` and `webhook_state`. + */ + intent: Schema$GoogleCloudDialogflowV2Intent; + /** + * The intent detection confidence. Values range from 0.0 (completely + * uncertain) to 1.0 (completely certain). + */ + intentDetectionConfidence: number; + /** + * The language that was triggered during intent detection. See [Language + * Support](https://dialogflow.com/docs/reference/language) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name `<parameter + * name>.original` containing the original parameter values before the + * query. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * The collection of extracted parameters. + */ + parameters: any; + /** + * The original conversational query text: - If natural language text was + * provided as input, `query_text` contains a copy of the input. - If + * natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. - If an event was + * provided as input, `query_text` is not set. + */ + queryText: string; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that + * confidence was not set. You should not rely on this field as it + * isn't guaranteed to be accurate, or even set. In particular this + * field isn't set in Webhook calls and for StreamingDetectIntent since + * the streaming endpoint has separate confidence estimates per portion of + * the audio in StreamingRecognitionResult. + */ + speechRecognitionConfidence: number; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + */ + webhookPayload: any; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + */ + webhookSource: string; + } /** - * Optional. The subtitle of the card. - */ - subtitle: string; + * The request message for Agents.RestoreAgent. + */ + export interface Schema$GoogleCloudDialogflowV2RestoreAgentRequest { + /** + * The agent to restore. Example for how to restore an agent via the + * command line: curl \ + * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ + * --data-binary "{ 'agentContent': '$(cat <agent + * zip file> | base64 -w 0)' }" \ + */ + agentContent: string; + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + */ + agentUri: string; + } /** - * Optional. The title of the card. - */ - title: string; -} -/** - * Optional. Contains information about a button. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton { + * The response message for Agents.SearchAgents. + */ + export interface Schema$GoogleCloudDialogflowV2SearchAgentsResponse { + /** + * The list of agents. There will be a maximum number of items returned + * based on the page_size field in the request. + */ + agents: Schema$GoogleCloudDialogflowV2Agent[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The text to send back to the Dialogflow API or a URI to open. - */ - postback: string; + * Represents a session entity type. Extends or replaces a developer entity + * type at the user session level (we refer to the entity types defined at the + * agent level as "developer entity types"). Note: session entity + * types apply to all queries, regardless of the language. + */ + export interface Schema$GoogleCloudDialogflowV2SessionEntityType { + /** + * Required. The collection of entities associated with this session entity + * type. + */ + entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + /** + * Required. Indicates whether the additional data should override or + * supplement the developer entity type definition. + */ + entityOverrideMode: string; + /** + * Required. The unique identifier of this session entity type. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/entityTypes/<Entity Type Display Name>`. + */ + name: string; + } /** - * Optional. The text to show on the button. - */ - text: string; -} -/** - * The card for presenting a carousel of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { - /** - * Required. Carousel items. - */ - items: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; -} -/** - * An item in the carousel. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { - /** - * Optional. The body text of the card. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; - /** - * Required. Additional info about the option item. - */ - info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; - /** - * Required. Title of the carousel item. - */ - title: string; -} -/** - * The image response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { - /** - * Optional. A text description of the image to be used for accessibility, - * e.g., screen readers. - */ - accessibilityText: string; - /** - * Optional. The public URI to an image file. - */ - imageUri: string; -} -/** - * The suggestion chip message that allows the user to jump out to the app or - * website associated with this agent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { - /** - * Required. The name of the app or site this chip is linking to. - */ - destinationName: string; - /** - * Required. The URI of the app or site to open when the user taps the - * suggestion chip. - */ - uri: string; -} -/** - * The card for presenting a list of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { - /** - * Required. List items. - */ - items: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; - /** - * Optional. The overall title of the list. - */ - title: string; -} -/** - * An item in the list. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { - /** - * Optional. The main text describing the item. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; - /** - * Required. Additional information about this option. - */ - info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; - /** - * Required. The title of the list item. - */ - title: string; -} -/** - * The quick replies response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { - /** - * Optional. The collection of quick replies. - */ - quickReplies: string[]; - /** - * Optional. The title of the collection of quick replies. - */ - title: string; -} -/** - * Additional info about the select item for when it is triggered in a dialog. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { - /** - * Required. A unique key that will be sent back to the agent if this response - * is given. - */ - key: string; - /** - * Optional. A list of synonyms that can also be used to trigger this item in - * dialog. - */ - synonyms: string[]; -} -/** - * The simple response message containing speech or text. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { - /** - * Optional. The text to display. - */ - displayText: string; - /** - * One of text_to_speech or ssml must be provided. Structured spoken response - * to the user in the SSML format. Mutually exclusive with text_to_speech. - */ - ssml: string; - /** - * One of text_to_speech or ssml must be provided. The plain text of the - * speech output. Mutually exclusive with ssml. - */ - textToSpeech: string; -} -/** - * The collection of simple response candidates. This message in - * `QueryResult.fulfillment_messages` and `WebhookResponse.fulfillment_messages` - * should contain only one `SimpleResponse`. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { - /** - * Required. The list of simple responses. - */ - simpleResponses: - Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[]; -} -/** - * The suggestion chip message that the user can tap to quickly post a reply to - * the conversation. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { - /** - * Required. The text shown the in the suggestion chip. - */ - title: string; -} -/** - * The collection of suggestions. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { - /** - * Required. The list of suggested replies. - */ - suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; -} -/** - * The text response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { - /** - * Optional. The collection of the agent's responses. - */ - text: string[]; -} -/** - * Represents intent parameters. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentParameter { - /** - * Optional. The default value to use when the `value` yields an empty result. - * Default values can be extracted from contexts by using the following - * syntax: `#context_name.parameter_name`. - */ - defaultValue: string; - /** - * Required. The name of the parameter. - */ - displayName: string; - /** - * Optional. The name of the entity type, prefixed with `@`, that describes - * values of the parameter. If the parameter is required, this must be - * provided. - */ - entityTypeDisplayName: string; - /** - * Optional. Indicates whether the parameter represents a list of values. - */ - isList: boolean; - /** - * Optional. Indicates whether the parameter is required. That is, whether the - * intent cannot be completed without collecting the parameter value. - */ - mandatory: boolean; - /** - * The unique identifier of this parameter. - */ - name: string; - /** - * Optional. The collection of prompts that the agent can present to the user - * in order to collect value for the parameter. - */ - prompts: string[]; - /** - * Optional. The definition of the parameter value. It can be: - a constant - * string, - a parameter value defined as `$parameter_name`, - an original - * parameter value defined as `$parameter_name.original`, - a parameter value - * from some context defined as `#context_name.parameter_name`. - */ - value: string; -} -/** - * Represents an example or template that the agent is trained on. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { - /** - * Required. The unique identifier of this training phrase. - */ - name: string; - /** - * Required. The collection of training phrase parts (can be annotated). - * Fields: `entity_type`, `alias` and `user_defined` should be populated only - * for the annotated parts of the training phrase. - */ - parts: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; - /** - * Optional. Indicates how many times this example or template was added to - * the intent. Each time a developer adds an existing sample by editing an - * intent or training, this counter is increased. - */ - timesAddedCount: number; - /** - * Required. The type of the training phrase. - */ - type: string; -} -/** - * Represents a part of a training phrase. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { - /** - * Optional. The parameter name for the value extracted from the annotated - * part of the example. - */ - alias: string; - /** - * Optional. The entity type name prefixed with `@`. This field is required - * for the annotated part of the text and applies only to examples. - */ - entityType: string; - /** - * Required. The text corresponding to the example or template, if there are - * no annotations. For annotated examples, it is the text for one of the - * example's parts. - */ - text: string; - /** - * Optional. Indicates whether the text was manually annotated by the - * developer. - */ - userDefined: boolean; -} -/** - * Metadata in google::longrunning::Operation for Knowledge operations. - */ -export interface Schema$GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { - /** - * Required. The current state of this operation. - */ - state: string; -} -/** - * Represents the contents of the original request that was passed to the - * `[Streaming]DetectIntent` call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { - /** - * Optional. This field is set to the value of `QueryParameters.payload` field - * passed in the request. - */ - payload: any; - /** - * The source of this request, e.g., `google`, `facebook`, `slack`. It is set - * by Dialogflow-owned servers. - */ - source: string; -} -/** - * Represents the result of conversational query or event processing. - */ -export interface Schema$GoogleCloudDialogflowV2beta1QueryResult { - /** - * The action name from the matched intent. - */ - action: string; - /** - * This field is set to: - `false` if the matched intent has required - * parameters and not all of the required parameter values have been - * collected. - `true` if all required parameter values have been collected, - * or if the matched intent doesn't contain any required parameters. - */ - allRequiredParamsPresent: boolean; - /** - * The free-form diagnostic info. For example, this field could contain - * webhook call latency. - */ - diagnosticInfo: any; - /** - * The collection of rich messages to present to the user. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; - /** - * The text to be pronounced to the user or shown on the screen. - */ - fulfillmentText: string; - /** - * The intent that matched the conversational query. Some, not all fields are - * filled in this message, including but not limited to: `name`, - * `display_name` and `webhook_state`. - */ - intent: Schema$GoogleCloudDialogflowV2beta1Intent; - /** - * The intent detection confidence. Values range from 0.0 (completely - * uncertain) to 1.0 (completely certain). - */ - intentDetectionConfidence: number; - /** - * The language that was triggered during intent detection. See [Language - * Support](https://dialogflow.com/docs/reference/language) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * The collection of output contexts. If applicable, - * `output_contexts.parameters` contains entries with name `<parameter - * name>.original` containing the original parameter values before the - * query. - */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * The collection of extracted parameters. - */ - parameters: any; - /** - * The original conversational query text: - If natural language text was - * provided as input, `query_text` contains a copy of the input. - If - * natural language speech audio was provided as input, `query_text` contains - * the speech recognition result. If speech recognizer produced multiple - * alternatives, a particular one is picked. - If an event was provided as - * input, `query_text` is not set. - */ - queryText: string; - /** - * The Speech recognition confidence between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. The default of 0.0 is a sentinel value indicating that confidence - * was not set. You should not rely on this field as it isn't guaranteed - * to be accurate, or even set. In particular this field isn't set in - * Webhook calls and for StreamingDetectIntent since the streaming endpoint - * has separate confidence estimates per portion of the audio in - * StreamingRecognitionResult. - */ - speechRecognitionConfidence: number; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `payload` field returned in the webhook response. - */ - webhookPayload: any; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `source` field returned in the webhook response. - */ - webhookSource: string; -} -/** - * The request message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { - /** - * Optional. The contents of the original request that was passed to - * `[Streaming]DetectIntent` call. - */ - originalDetectIntentRequest: - Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; - /** - * The result of the conversational query or event processing. Contains the - * same value as `[Streaming]DetectIntentResponse.query_result`. - */ - queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; - /** - * The unique identifier of the response. Contains the same value as - * `[Streaming]DetectIntentResponse.response_id`. - */ - responseId: string; - /** - * The unique identifier of detectIntent request session. Can be used to - * identify end-user inside webhook implementation. Format: - * `projects/<Project ID>/agent/sessions/<Session ID>`. - */ - session: string; -} -/** - * The response message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1WebhookResponse { - /** - * Optional. Makes the platform immediately invoke another `DetectIntent` call - * internally with the specified event as input. - */ - followupEventInput: Schema$GoogleCloudDialogflowV2beta1EventInput; - /** - * Optional. The collection of rich messages to present to the user. This - * value is passed directly to `QueryResult.fulfillment_messages`. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; - /** - * Optional. The text to be shown on the screen. This value is passed directly - * to `QueryResult.fulfillment_text`. - */ - fulfillmentText: string; - /** - * Optional. The collection of output contexts. This value is passed directly - * to `QueryResult.output_contexts`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * Optional. This value is passed directly to `QueryResult.webhook_payload`. - * See the related `fulfillment_messages[i].payload field`, which may be used - * as an alternative to this field. This field can be used for Actions on - * Google responses. It should have a structure similar to the JSON message - * shown here. For more information, see [Actions on Google Webhook - * Format](https://developers.google.com/actions/dialogflow/webhook) - * <pre>{ "google": { "expectUserResponse": - * true, "richResponse": { "items": [ { - * "simpleResponse": { "textToSpeech": - * "this is a simple response" } } ] } - * } }</pre> - */ - payload: any; - /** - * Optional. This value is passed directly to `QueryResult.webhook_source`. - */ - source: string; -} -/** - * Represents a context. - */ -export interface Schema$GoogleCloudDialogflowV2Context { - /** - * Optional. The number of conversational query requests after which the - * context expires. If set to `0` (the default) the context expires - * immediately. Contexts expire automatically after 10 minutes even if there - * are no matching queries. - */ - lifespanCount: number; - /** - * Required. The unique identifier of the context. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/contexts/<Context ID>`. - */ - name: string; - /** - * Optional. The collection of parameters associated with this context. Refer - * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for - * syntax. - */ - parameters: any; -} -/** - * The request to detect user's intent. - */ -export interface Schema$GoogleCloudDialogflowV2DetectIntentRequest { - /** - * Optional. The natural language speech audio to be processed. This field - * should be populated iff `query_input` is set to an input audio config. A - * single request can contain up to 1 minute of speech audio data. - */ - inputAudio: string; - /** - * Required. The input specification. It can be set to: 1. an audio config - * which instructs the speech recognizer how to process the speech audio, 2. - * a conversational query in the form of text, or 3. an event that specifies - * which intent to trigger. - */ - queryInput: Schema$GoogleCloudDialogflowV2QueryInput; - /** - * Optional. The parameters of this query. - */ - queryParams: Schema$GoogleCloudDialogflowV2QueryParameters; -} -/** - * The message returned from the DetectIntent method. - */ -export interface Schema$GoogleCloudDialogflowV2DetectIntentResponse { - /** - * The results of the conversational query or event processing. - */ - queryResult: Schema$GoogleCloudDialogflowV2QueryResult; - /** - * The unique identifier of the response. It can be used to locate a response - * in the training example set or for reporting issues. - */ - responseId: string; - /** - * Specifies the status of the webhook request. `webhook_status` is never - * populated in webhook requests. - */ - webhookStatus: Schema$GoogleRpcStatus; -} -/** - * Represents an entity type. Entity types serve as a tool for extracting - * parameter values from natural language queries. - */ -export interface Schema$GoogleCloudDialogflowV2EntityType { - /** - * Optional. Indicates whether the entity type can be automatically expanded. - */ - autoExpansionMode: string; - /** - * Required. The name of the entity. - */ - displayName: string; - /** - * Optional. The collection of entities associated with the entity type. - */ - entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; - /** - * Required. Indicates the kind of entity type. - */ - kind: string; - /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of the entity type. Format: - * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. - */ - name: string; -} -/** - * This message is a wrapper around a collection of entity types. - */ -export interface Schema$GoogleCloudDialogflowV2EntityTypeBatch { - /** - * A collection of entity types. - */ - entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; -} -/** - * Optional. Represents an entity. - */ -export interface Schema$GoogleCloudDialogflowV2EntityTypeEntity { - /** - * Required. A collection of synonyms. For `KIND_LIST` entity types this must - * contain exactly one synonym equal to `value`. - */ - synonyms: string[]; - /** - * Required. For `KIND_MAP` entity types: A canonical name to be used in - * place of synonyms. For `KIND_LIST` entity types: A string that can - * contain references to other entity types (with or without aliases). - */ - value: string; -} -/** - * Events allow for matching intents by event name instead of the natural - * language input. For instance, input `<event: { name: “welcome_event”, - * parameters: { name: “Sam” } }>` can trigger a personalized welcome - * response. The parameter `name` may be used by the agent in the response: - * `“Hello #welcome_event.name! What can I do for you today?”`. - */ -export interface Schema$GoogleCloudDialogflowV2EventInput { - /** - * Required. The language of this query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. - */ - languageCode: string; - /** - * Required. The unique identifier of the event. - */ - name: string; - /** - * Optional. The collection of parameters associated with the event. - */ - parameters: any; -} -/** - * The request message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2ExportAgentRequest { - /** - * Optional. The Google Cloud Storage URI to export the agent to. Note: The - * URI must start with "gs://". If left unspecified, the serialized - * agent is returned inline. - */ - agentUri: string; -} -/** - * The response message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2ExportAgentResponse { - /** - * The exported agent. Example for how to export an agent to a zip file via a - * command line: curl \ - * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * '{}' \ | grep agentContent | sed -e - * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ - * | base64 --decode > <agent zip file> - */ - agentContent: string; - /** - * The URI to a file containing the exported agent. This field is populated - * only if `agent_uri` is specified in `ExportAgentRequest`. - */ - agentUri: string; -} -/** - * The request message for Agents.ImportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2ImportAgentRequest { - /** - * The agent to import. Example for how to import an agent via the command - * line: curl \ - * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:import\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * "{ 'agentContent': '$(cat <agent zip file> | - * base64 -w 0)' }" - */ - agentContent: string; - /** - * The URI to a Google Cloud Storage file containing the agent to import. - * Note: The URI must start with "gs://". - */ - agentUri: string; -} -/** - * Instructs the speech recognizer how to process the audio content. - */ -export interface Schema$GoogleCloudDialogflowV2InputAudioConfig { - /** - * Required. Audio encoding of the audio content to process. - */ - audioEncoding: string; - /** - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language Support](https://dialogflow.com/docs/languages) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - */ - languageCode: string; - /** - * Optional. The collection of phrase hints which are used to boost accuracy - * of speech recognition. Refer to [Cloud Speech API - * documentation](/speech/docs/basics#phrase-hints) for more details. - */ - phraseHints: string[]; - /** - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API documentation](/speech/docs/basics) for more - * details. - */ - sampleRateHertz: number; -} -/** - * Represents an intent. Intents convert a number of user expressions or - * patterns into an action. An action is an extraction of a user command or - * sentence semantics. - */ -export interface Schema$GoogleCloudDialogflowV2Intent { - /** - * Optional. The name of the action associated with the intent. - */ - action: string; - /** - * Optional. The list of platforms for which the first response will be taken - * from among the messages assigned to the DEFAULT_PLATFORM. - */ - defaultResponsePlatforms: string[]; - /** - * Required. The name of this intent. - */ - displayName: string; - /** - * Optional. The collection of event names that trigger the intent. If the - * collection of input contexts is not empty, all of the contexts must be - * present in the active user session for an event to trigger this intent. - */ - events: string[]; - /** - * Optional. Collection of information about all followup intents that have - * name of this intent as a root_name. - */ - followupIntentInfo: Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo[]; - /** - * Optional. The list of context names required for this intent to be - * triggered. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - inputContextNames: string[]; - /** - * Optional. Indicates whether this is a fallback intent. - */ - isFallback: boolean; - /** - * Optional. The collection of rich messages corresponding to the `Response` - * field in the Dialogflow console. - */ - messages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * Optional. Indicates whether Machine Learning is disabled for the intent. - * Note: If `ml_diabled` setting is set to true, then this intent is not taken - * into account during inference in `ML ONLY` match mode. Also, auto-markup in - * the UI is turned off. - */ - mlDisabled: boolean; - /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - name: string; - /** - * Optional. The collection of contexts that are activated when the intent is - * matched. Context messages in this collection should not set the parameters - * field. Setting the `lifespan_count` to 0 will reset the context when the - * intent is matched. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Optional. The collection of parameters associated with the intent. - */ - parameters: Schema$GoogleCloudDialogflowV2IntentParameter[]; - /** - * The unique identifier of the parent intent in the chain of followup - * intents. It identifies the parent followup intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; - /** - * Optional. The priority of this intent. Higher numbers represent higher - * priorities. Zero or negative numbers mean that the intent is disabled. - */ - priority: number; - /** - * Optional. Indicates whether to delete all contexts in the current session - * when this intent is matched. - */ - resetContexts: boolean; - /** - * The unique identifier of the root intent in the chain of followup intents. - * It identifies the correct followup intents chain for this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - rootFollowupIntentName: string; - /** - * Optional. The collection of examples/templates that the agent is trained - * on. - */ - trainingPhrases: Schema$GoogleCloudDialogflowV2IntentTrainingPhrase[]; - /** - * Required. Indicates whether webhooks are enabled for the intent. - */ - webhookState: string; -} -/** - * This message is a wrapper around a collection of intents. - */ -export interface Schema$GoogleCloudDialogflowV2IntentBatch { - /** - * A collection of intents. - */ - intents: Schema$GoogleCloudDialogflowV2Intent[]; -} -/** - * Represents a single followup intent in the chain. - */ -export interface Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo { - /** - * The unique identifier of the followup intent. Format: `projects/<Project - * ID>/agent/intents/<Intent ID>`. - */ - followupIntentName: string; - /** - * The unique identifier of the followup intent parent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; -} -/** - * Corresponds to the `Response` field in the Dialogflow console. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessage { - /** - * The basic card response for Actions on Google. - */ - basicCard: Schema$GoogleCloudDialogflowV2IntentMessageBasicCard; - /** - * The card response. - */ - card: Schema$GoogleCloudDialogflowV2IntentMessageCard; - /** - * The carousel card response for Actions on Google. - */ - carouselSelect: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect; - /** - * The image response. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * The link out suggestion chip for Actions on Google. - */ - linkOutSuggestion: - Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion; - /** - * The list card response for Actions on Google. - */ - listSelect: Schema$GoogleCloudDialogflowV2IntentMessageListSelect; - /** - * Returns a response containing a custom, platform-specific payload. See the - * Intent.Message.Platform type for a description of the structure that may be - * required for your platform. - */ - payload: any; - /** - * Optional. The platform that this message is intended for. - */ - platform: string; - /** - * The quick replies response. - */ - quickReplies: Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies; - /** - * The voice and text-only responses for Actions on Google. - */ - simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses; - /** - * The suggestion chips for Actions on Google. - */ - suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestions; - /** - * The text response. - */ - text: Schema$GoogleCloudDialogflowV2IntentMessageText; -} -/** - * The basic card message. Useful for displaying information. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton[]; - /** - * Required, unless image is present. The body text of the card. - */ - formattedText: string; - /** - * Optional. The image for the card. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * The button object that appears at the bottom of a card. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton { - /** - * Required. Action to take when a user taps on the button. - */ - openUriAction: - Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction; - /** - * Required. The title of the button. - */ - title: string; -} -/** - * Opens the given URI. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { - /** - * Required. The HTTP or HTTPS scheme URI. - */ - uri: string; -} -/** - * The card response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2IntentMessageCardButton[]; - /** - * Optional. The public URI to an image file for the card. - */ - imageUri: string; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * Optional. Contains information about a button. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCardButton { - /** - * Optional. The text to send back to the Dialogflow API or a URI to open. - */ - postback: string; - /** - * Optional. The text to show on the button. - */ - text: string; -} -/** - * The card for presenting a carousel of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect { - /** - * Required. Carousel items. - */ - items: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem[]; -} -/** - * An item in the carousel. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { - /** - * Optional. The body text of the card. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Required. Additional info about the option item. - */ - info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; - /** - * Required. Title of the carousel item. - */ - title: string; -} -/** - * The image response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageImage { - /** - * Optional. A text description of the image to be used for accessibility, - * e.g., screen readers. - */ - accessibilityText: string; - /** - * Optional. The public URI to an image file. - */ - imageUri: string; -} -/** - * The suggestion chip message that allows the user to jump out to the app or - * website associated with this agent. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { - /** - * Required. The name of the app or site this chip is linking to. - */ - destinationName: string; - /** - * Required. The URI of the app or site to open when the user taps the - * suggestion chip. - */ - uri: string; -} -/** - * The card for presenting a list of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelect { - /** - * Required. List items. - */ - items: Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem[]; - /** - * Optional. The overall title of the list. - */ - title: string; -} -/** - * An item in the list. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem { - /** - * Optional. The main text describing the item. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Required. Additional information about this option. - */ - info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; - /** - * Required. The title of the list item. - */ - title: string; -} -/** - * The quick replies response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies { - /** - * Optional. The collection of quick replies. - */ - quickReplies: string[]; - /** - * Optional. The title of the collection of quick replies. - */ - title: string; -} -/** - * Additional info about the select item for when it is triggered in a dialog. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo { - /** - * Required. A unique key that will be sent back to the agent if this response - * is given. - */ - key: string; - /** - * Optional. A list of synonyms that can also be used to trigger this item in - * dialog. - */ - synonyms: string[]; -} -/** - * The simple response message containing speech or text. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse { - /** - * Optional. The text to display. - */ - displayText: string; - /** - * One of text_to_speech or ssml must be provided. Structured spoken response - * to the user in the SSML format. Mutually exclusive with text_to_speech. - */ - ssml: string; - /** - * One of text_to_speech or ssml must be provided. The plain text of the - * speech output. Mutually exclusive with ssml. - */ - textToSpeech: string; -} -/** - * The collection of simple response candidates. This message in - * `QueryResult.fulfillment_messages` and `WebhookResponse.fulfillment_messages` - * should contain only one `SimpleResponse`. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses { - /** - * Required. The list of simple responses. - */ - simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse[]; -} -/** - * The suggestion chip message that the user can tap to quickly post a reply to - * the conversation. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestion { - /** - * Required. The text shown the in the suggestion chip. - */ - title: string; -} -/** - * The collection of suggestions. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestions { - /** - * Required. The list of suggested replies. - */ - suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestion[]; -} -/** - * The text response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageText { - /** - * Optional. The collection of the agent's responses. - */ - text: string[]; -} -/** - * Represents intent parameters. - */ -export interface Schema$GoogleCloudDialogflowV2IntentParameter { - /** - * Optional. The default value to use when the `value` yields an empty result. - * Default values can be extracted from contexts by using the following - * syntax: `#context_name.parameter_name`. - */ - defaultValue: string; - /** - * Required. The name of the parameter. - */ - displayName: string; - /** - * Optional. The name of the entity type, prefixed with `@`, that describes - * values of the parameter. If the parameter is required, this must be - * provided. - */ - entityTypeDisplayName: string; - /** - * Optional. Indicates whether the parameter represents a list of values. - */ - isList: boolean; - /** - * Optional. Indicates whether the parameter is required. That is, whether the - * intent cannot be completed without collecting the parameter value. - */ - mandatory: boolean; - /** - * The unique identifier of this parameter. - */ - name: string; - /** - * Optional. The collection of prompts that the agent can present to the user - * in order to collect value for the parameter. - */ - prompts: string[]; - /** - * Optional. The definition of the parameter value. It can be: - a constant - * string, - a parameter value defined as `$parameter_name`, - an original - * parameter value defined as `$parameter_name.original`, - a parameter value - * from some context defined as `#context_name.parameter_name`. - */ - value: string; -} -/** - * Represents an example or template that the agent is trained on. - */ -export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrase { - /** - * Required. The unique identifier of this training phrase. - */ - name: string; - /** - * Required. The collection of training phrase parts (can be annotated). - * Fields: `entity_type`, `alias` and `user_defined` should be populated only - * for the annotated parts of the training phrase. - */ - parts: Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart[]; - /** - * Optional. Indicates how many times this example or template was added to - * the intent. Each time a developer adds an existing sample by editing an - * intent or training, this counter is increased. - */ - timesAddedCount: number; - /** - * Required. The type of the training phrase. - */ - type: string; -} -/** - * Represents a part of a training phrase. - */ -export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart { - /** - * Optional. The parameter name for the value extracted from the annotated - * part of the example. - */ - alias: string; - /** - * Optional. The entity type name prefixed with `@`. This field is required - * for the annotated part of the text and applies only to examples. - */ - entityType: string; - /** - * Required. The text corresponding to the example or template, if there are - * no annotations. For annotated examples, it is the text for one of the - * example's parts. - */ - text: string; - /** - * Optional. Indicates whether the text was manually annotated by the - * developer. - */ - userDefined: boolean; -} -/** - * The response message for Contexts.ListContexts. - */ -export interface Schema$GoogleCloudDialogflowV2ListContextsResponse { - /** - * The list of contexts. There will be a maximum number of items returned - * based on the page_size field in the request. - */ - contexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for EntityTypes.ListEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2ListEntityTypesResponse { - /** - * The list of agent entity types. There will be a maximum number of items - * returned based on the page_size field in the request. - */ - entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for Intents.ListIntents. - */ -export interface Schema$GoogleCloudDialogflowV2ListIntentsResponse { - /** - * The list of agent intents. There will be a maximum number of items returned - * based on the page_size field in the request. - */ - intents: Schema$GoogleCloudDialogflowV2Intent[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for SessionEntityTypes.ListSessionEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse { - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; - /** - * The list of session entity types. There will be a maximum number of items - * returned based on the page_size field in the request. - */ - sessionEntityTypes: Schema$GoogleCloudDialogflowV2SessionEntityType[]; -} -/** - * Represents the contents of the original request that was passed to the - * `[Streaming]DetectIntent` call. - */ -export interface Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest { - /** - * Optional. This field is set to the value of `QueryParameters.payload` field - * passed in the request. - */ - payload: any; - /** - * The source of this request, e.g., `google`, `facebook`, `slack`. It is set - * by Dialogflow-owned servers. - */ - source: string; -} -/** - * Represents the query input. It can contain either: 1. An audio config which - * instructs the speech recognizer how to process the speech audio. 2. A - * conversational query in the form of text,. 3. An event that specifies which - * intent to trigger. - */ -export interface Schema$GoogleCloudDialogflowV2QueryInput { - /** - * Instructs the speech recognizer how to process the speech audio. - */ - audioConfig: Schema$GoogleCloudDialogflowV2InputAudioConfig; - /** - * The event to be processed. - */ - event: Schema$GoogleCloudDialogflowV2EventInput; - /** - * The natural language text to be processed. - */ - text: Schema$GoogleCloudDialogflowV2TextInput; -} -/** - * Represents the parameters of the conversational query. - */ -export interface Schema$GoogleCloudDialogflowV2QueryParameters { - /** - * Optional. The collection of contexts to be activated before this query is - * executed. - */ - contexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Optional. The geo location of this conversational query. - */ - geoLocation: Schema$GoogleTypeLatLng; - /** - * Optional. This field can be used to pass custom data into the webhook - * associated with the agent. Arbitrary JSON objects are supported. - */ - payload: any; - /** - * Optional. Specifies whether to delete all contexts in the current session - * before the new ones are activated. - */ - resetContexts: boolean; - /** - * Optional. The collection of session entity types to replace or extend - * developer entities with for this query only. The entity synonyms apply to - * all languages. - */ - sessionEntityTypes: Schema$GoogleCloudDialogflowV2SessionEntityType[]; - /** - * Optional. The time zone of this conversational query from the [time zone - * database](https://www.iana.org/time-zones), e.g., America/New_York, - * Europe/Paris. If not provided, the time zone specified in agent settings is - * used. - */ - timeZone: string; -} -/** - * Represents the result of conversational query or event processing. - */ -export interface Schema$GoogleCloudDialogflowV2QueryResult { - /** - * The action name from the matched intent. - */ - action: string; - /** - * This field is set to: - `false` if the matched intent has required - * parameters and not all of the required parameter values have been - * collected. - `true` if all required parameter values have been collected, - * or if the matched intent doesn't contain any required parameters. - */ - allRequiredParamsPresent: boolean; - /** - * The free-form diagnostic info. For example, this field could contain - * webhook call latency. - */ - diagnosticInfo: any; - /** - * The collection of rich messages to present to the user. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * The text to be pronounced to the user or shown on the screen. - */ - fulfillmentText: string; - /** - * The intent that matched the conversational query. Some, not all fields are - * filled in this message, including but not limited to: `name`, - * `display_name` and `webhook_state`. - */ - intent: Schema$GoogleCloudDialogflowV2Intent; - /** - * The intent detection confidence. Values range from 0.0 (completely - * uncertain) to 1.0 (completely certain). - */ - intentDetectionConfidence: number; - /** - * The language that was triggered during intent detection. See [Language - * Support](https://dialogflow.com/docs/reference/language) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * The collection of output contexts. If applicable, - * `output_contexts.parameters` contains entries with name `<parameter - * name>.original` containing the original parameter values before the - * query. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * The collection of extracted parameters. - */ - parameters: any; - /** - * The original conversational query text: - If natural language text was - * provided as input, `query_text` contains a copy of the input. - If - * natural language speech audio was provided as input, `query_text` contains - * the speech recognition result. If speech recognizer produced multiple - * alternatives, a particular one is picked. - If an event was provided as - * input, `query_text` is not set. - */ - queryText: string; - /** - * The Speech recognition confidence between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. The default of 0.0 is a sentinel value indicating that confidence - * was not set. You should not rely on this field as it isn't guaranteed - * to be accurate, or even set. In particular this field isn't set in - * Webhook calls and for StreamingDetectIntent since the streaming endpoint - * has separate confidence estimates per portion of the audio in - * StreamingRecognitionResult. - */ - speechRecognitionConfidence: number; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `payload` field returned in the webhook response. - */ - webhookPayload: any; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `source` field returned in the webhook response. - */ - webhookSource: string; -} -/** - * The request message for Agents.RestoreAgent. - */ -export interface Schema$GoogleCloudDialogflowV2RestoreAgentRequest { - /** - * The agent to restore. Example for how to restore an agent via the command - * line: curl \ - * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:restore\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * "{ 'agentContent': '$(cat <agent zip file> | - * base64 -w 0)' }" \ - */ - agentContent: string; - /** - * The URI to a Google Cloud Storage file containing the agent to restore. - * Note: The URI must start with "gs://". - */ - agentUri: string; -} -/** - * The response message for Agents.SearchAgents. - */ -export interface Schema$GoogleCloudDialogflowV2SearchAgentsResponse { - /** - * The list of agents. There will be a maximum number of items returned based - * on the page_size field in the request. - */ - agents: Schema$GoogleCloudDialogflowV2Agent[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * Represents a session entity type. Extends or replaces a developer entity - * type at the user session level (we refer to the entity types defined at the - * agent level as "developer entity types"). Note: session entity - * types apply to all queries, regardless of the language. - */ -export interface Schema$GoogleCloudDialogflowV2SessionEntityType { - /** - * Required. The collection of entities associated with this session entity - * type. - */ - entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; - /** - * Required. Indicates whether the additional data should override or - * supplement the developer entity type definition. - */ - entityOverrideMode: string; - /** - * Required. The unique identifier of this session entity type. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/entityTypes/<Entity Type Display Name>`. - */ - name: string; -} -/** - * Represents the natural language text to be processed. - */ -export interface Schema$GoogleCloudDialogflowV2TextInput { - /** - * Required. The language of this conversational query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. - */ - languageCode: string; - /** - * Required. The UTF-8 encoded natural language text to be processed. Text - * length must not exceed 256 bytes. - */ - text: string; -} -/** - * The request message for Agents.TrainAgent. - */ -export interface Schema$GoogleCloudDialogflowV2TrainAgentRequest {} -/** - * The request message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2WebhookRequest { - /** - * Optional. The contents of the original request that was passed to - * `[Streaming]DetectIntent` call. - */ - originalDetectIntentRequest: - Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest; - /** - * The result of the conversational query or event processing. Contains the - * same value as `[Streaming]DetectIntentResponse.query_result`. - */ - queryResult: Schema$GoogleCloudDialogflowV2QueryResult; - /** - * The unique identifier of the response. Contains the same value as - * `[Streaming]DetectIntentResponse.response_id`. - */ - responseId: string; - /** - * The unique identifier of detectIntent request session. Can be used to - * identify end-user inside webhook implementation. Format: - * `projects/<Project ID>/agent/sessions/<Session ID>`. - */ - session: string; -} -/** - * The response message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2WebhookResponse { - /** - * Optional. Makes the platform immediately invoke another `DetectIntent` call - * internally with the specified event as input. - */ - followupEventInput: Schema$GoogleCloudDialogflowV2EventInput; - /** - * Optional. The collection of rich messages to present to the user. This - * value is passed directly to `QueryResult.fulfillment_messages`. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * Optional. The text to be shown on the screen. This value is passed directly - * to `QueryResult.fulfillment_text`. - */ - fulfillmentText: string; - /** - * Optional. The collection of output contexts. This value is passed directly - * to `QueryResult.output_contexts`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Optional. This value is passed directly to `QueryResult.webhook_payload`. - * See the related `fulfillment_messages[i].payload field`, which may be used - * as an alternative to this field. This field can be used for Actions on - * Google responses. It should have a structure similar to the JSON message - * shown here. For more information, see [Actions on Google Webhook - * Format](https://developers.google.com/actions/dialogflow/webhook) - * <pre>{ "google": { "expectUserResponse": - * true, "richResponse": { "items": [ { - * "simpleResponse": { "textToSpeech": - * "this is a simple response" } } ] } - * } }</pre> - */ - payload: any; - /** - * Optional. This value is passed directly to `QueryResult.webhook_source`. - */ - source: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpcStatus; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobufEmpty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpcStatus { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Represents the natural language text to be processed. + */ + export interface Schema$GoogleCloudDialogflowV2TextInput { + /** + * Required. The language of this conversational query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The UTF-8 encoded natural language text to be processed. Text + * length must not exceed 256 bytes. + */ + text: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * The request message for Agents.TrainAgent. + */ + export interface Schema$GoogleCloudDialogflowV2TrainAgentRequest {} + /** + * The request message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2WebhookRequest { + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + */ + originalDetectIntentRequest: + Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + */ + queryResult: Schema$GoogleCloudDialogflowV2QueryResult; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + */ + responseId: string; + /** + * The unique identifier of detectIntent request session. Can be used to + * identify end-user inside webhook implementation. Format: + * `projects/<Project ID>/agent/sessions/<Session ID>`. + */ + session: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$GoogleTypeLatLng { + * The response message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2WebhookResponse { + /** + * Optional. Makes the platform immediately invoke another `DetectIntent` + * call internally with the specified event as input. + */ + followupEventInput: Schema$GoogleCloudDialogflowV2EventInput; + /** + * Optional. The collection of rich messages to present to the user. This + * value is passed directly to `QueryResult.fulfillment_messages`. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * Optional. The text to be shown on the screen. This value is passed + * directly to `QueryResult.fulfillment_text`. + */ + fulfillmentText: string; + /** + * Optional. The collection of output contexts. This value is passed + * directly to `QueryResult.output_contexts`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Optional. This value is passed directly to `QueryResult.webhook_payload`. + * See the related `fulfillment_messages[i].payload field`, which may be + * used as an alternative to this field. This field can be used for Actions + * on Google responses. It should have a structure similar to the JSON + * message shown here. For more information, see [Actions on Google Webhook + * Format](https://developers.google.com/actions/dialogflow/webhook) + * <pre>{ "google": { "expectUserResponse": + * true, "richResponse": { "items": [ { + * "simpleResponse": { "textToSpeech": + * "this is a simple response" } } ] } + * } }</pre> + */ + payload: any; + /** + * Optional. This value is passed directly to `QueryResult.webhook_source`. + */ + source: string; + } /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpcStatus; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} - -export class Resource$Projects { - root: Dialogflow; - agent: Resource$Projects$Agent; - operations: Resource$Projects$Operations; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.agent = new Resource$Projects$Agent(root); - this.operations = new Resource$Projects$Operations(root); + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobufEmpty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpcStatus { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - getRoot() { - return this.root; + /** + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$GoogleTypeLatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; } - - /** - * dialogflow.projects.getAgent - * @desc Retrieves the specified agent. - * @alias dialogflow.projects.getAgent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to fetch is associated with. Format: `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAgent(params?: any, options?: MethodOptions): - AxiosPromise; - getAgent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getAgent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Dialogflow; + agent: Resource$Projects$Agent; + operations: Resource$Projects$Operations; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.agent = new Resource$Projects$Agent(root); + this.operations = new Resource$Projects$Operations(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/agent').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dialogflow.projects.getAgent + * @desc Retrieves the specified agent. + * @alias dialogflow.projects.getAgent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to fetch is associated with. Format: `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAgent(params?: any, options?: MethodOptions): + AxiosPromise; + getAgent( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getAgent( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/agent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Projects$Agent { - root: Dialogflow; - entityTypes: Resource$Projects$Agent$Entitytypes; - intents: Resource$Projects$Agent$Intents; - sessions: Resource$Projects$Agent$Sessions; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.entityTypes = new Resource$Projects$Agent$Entitytypes(root); - this.intents = new Resource$Projects$Agent$Intents(root); - this.sessions = new Resource$Projects$Agent$Sessions(root); - } + export class Resource$Projects$Agent { + root: Dialogflow; + entityTypes: Resource$Projects$Agent$Entitytypes; + intents: Resource$Projects$Agent$Intents; + sessions: Resource$Projects$Agent$Sessions; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.entityTypes = new Resource$Projects$Agent$Entitytypes(root); + this.intents = new Resource$Projects$Agent$Intents(root); + this.sessions = new Resource$Projects$Agent$Sessions(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.export - * @desc Exports the specified agent to a ZIP file. Operation - * @alias dialogflow.projects.agent.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to export is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2ExportAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): - AxiosPromise; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.export + * @desc Exports the specified agent to a ZIP file. Operation + * @alias dialogflow.projects.agent.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to export is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2ExportAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/agent:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/agent:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.import - * @desc Imports the specified agent from a ZIP file. Uploads new intents and - * entity types without deleting the existing ones. Intents and entity types - * with the same name are replaced with the new versions from - * ImportAgentRequest. Operation - * @alias dialogflow.projects.agent.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to import is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2ImportAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ + /** + * dialogflow.projects.agent.import + * @desc Imports the specified agent from a ZIP file. Uploads new intents + * and entity types without deleting the existing ones. Intents and entity + * types with the same name are replaced with the new versions from + * ImportAgentRequest. Operation + * @alias dialogflow.projects.agent.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to import is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2ImportAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ import(params?: any, options?: MethodOptions): AxiosPromise; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { callback = options; options = {}; - } if(typeof params === 'function') { + } if(typeof params === 'function') { callback = params; params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v2/{+parent}/agent:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['parent'], pathParams: ['parent'], context: this.getRoot()}; if(callback) { + } options = options || {}; const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v2/{+parent}/agent:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['parent'], pathParams: ['parent'], context: this.getRoot()}; if(callback) { createAPIRequest(parameters, callback); - } else { + } else { return createAPIRequest(parameters); - }} + }} - /** + /** * dialogflow.projects.agent.restore * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation * @alias dialogflow.projects.agent.restore @@ -2585,2024 +2607,2063 @@ import(params?: any, options?: MethodOptions|BodyResponseCallback; - restore( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - restore( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/agent:restore') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + restore(params?: any, options?: MethodOptions): AxiosPromise; + restore( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + restore( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/agent:restore') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.search - * @desc Returns the list of agents. Since there is at most one - * conversational agent per project, this method is useful primarily for - * listing all agents across projects the caller has access to. One can - * achieve that with a wildcard project collection id "-". Refer to [List - * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - * @alias dialogflow.projects.agent.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The project to list agents from. Format: `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SearchAgentsResponse>): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SearchAgentsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.search + * @desc Returns the list of agents. Since there is at most one + * conversational agent per project, this method is useful primarily for + * listing all agents across projects the caller has access to. One can + * achieve that with a wildcard project collection id "-". Refer to [List + * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * @alias dialogflow.projects.agent.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The project to list agents from. Format: `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SearchAgentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SearchAgentsResponse>): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SearchAgentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SearchAgentsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/agent:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2SearchAgentsResponse>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/agent:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2SearchAgentsResponse>(parameters); - } - } - /** - * dialogflow.projects.agent.train - * @desc Trains the specified agent. Operation - * @alias dialogflow.projects.agent.train - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to train is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2TrainAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - train(params?: any, options?: MethodOptions): - AxiosPromise; - train( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - train( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.train + * @desc Trains the specified agent. Operation + * @alias dialogflow.projects.agent.train + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to train is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2TrainAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + train(params?: any, options?: MethodOptions): + AxiosPromise; + train( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + train( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/agent:train') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/agent:train') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Agent$Entitytypes { - root: Dialogflow; - entities: Resource$Projects$Agent$Entitytypes$Entities; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.entities = new Resource$Projects$Agent$Entitytypes$Entities(root); } + export class Resource$Projects$Agent$Entitytypes { + root: Dialogflow; + entities: Resource$Projects$Agent$Entitytypes$Entities; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.entities = new Resource$Projects$Agent$Entitytypes$Entities(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.entityTypes.batchDelete - * @desc Deletes entity types in the specified agent. Operation - * @alias dialogflow.projects.agent.entityTypes.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.entityTypes.batchDelete + * @desc Deletes entity types in the specified agent. Operation + * @alias dialogflow.projects.agent.entityTypes.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2BatchDeleteEntityTypesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.entityTypes.batchUpdate - * @desc Updates/Creates multiple entity types in the specified agent. - * Operation - * @alias dialogflow.projects.agent.entityTypes.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to update or create entity types in. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.entityTypes.batchUpdate + * @desc Updates/Creates multiple entity types in the specified agent. + * Operation + * @alias dialogflow.projects.agent.entityTypes.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to update or create entity types in. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2BatchUpdateEntityTypesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.entityTypes.create - * @desc Creates an entity type in the specified agent. - * @alias dialogflow.projects.agent.entityTypes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.parent Required. The agent to create a entity type for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2EntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.entityTypes.create + * @desc Creates an entity type in the specified agent. + * @alias dialogflow.projects.agent.entityTypes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.parent Required. The agent to create a entity type for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2EntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dialogflow.projects.agent.entityTypes.delete - * @desc Deletes the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.entityTypes.delete + * @desc Deletes the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.entityTypes.get - * @desc Retrieves the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language to retrieve entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required. The name of the entity type. Format: `projects//agent/entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.entityTypes.get + * @desc Retrieves the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language to retrieve entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required. The name of the entity type. Format: `projects//agent/entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dialogflow.projects.agent.entityTypes.list - * @desc Returns the list of all entity types in the specified agent. - * @alias dialogflow.projects.agent.entityTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language to list entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The agent to list all entity types from. Format: `projects//agent`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>(parameters); + /** + * dialogflow.projects.agent.entityTypes.list + * @desc Returns the list of all entity types in the specified agent. + * @alias dialogflow.projects.agent.entityTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language to list entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The agent to list all entity types from. Format: `projects//agent`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2ListEntityTypesResponse>(parameters); + } } - } - /** - * dialogflow.projects.agent.entityTypes.patch - * @desc Updates the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of the entity type. Format: `projects//agent/entityTypes/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2EntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.entityTypes.patch + * @desc Updates the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of the entity type. Format: `projects//agent/entityTypes/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2EntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Projects$Agent$Entitytypes$Entities { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); } + export class Resource$Projects$Agent$Entitytypes$Entities { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.entityTypes.entities.batchCreate - * @desc Creates multiple new entities in the specified entity type (extends - * the existing collection of entries). Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to create entities in. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2BatchCreateEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchCreate(params?: any, options?: MethodOptions): - AxiosPromise; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.entityTypes.entities.batchCreate + * @desc Creates multiple new entities in the specified entity type (extends + * the existing collection of entries). Operation + * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to create entities in. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2BatchCreateEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchCreate(params?: any, options?: MethodOptions): + AxiosPromise; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entities:batchCreate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entities:batchCreate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.entityTypes.entities.batchDelete - * @desc Deletes entities in the specified entity type. Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to delete entries for. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2BatchDeleteEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entities:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.entityTypes.entities.batchDelete + * @desc Deletes entities in the specified entity type. Operation + * + * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to delete entries for. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2BatchDeleteEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entities:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.entityTypes.entities.batchUpdate - * @desc Updates entities in the specified entity type (replaces the existing - * collection of entries). Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to update the entities in. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2BatchUpdateEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entities:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.entityTypes.entities.batchUpdate + * @desc Updates entities in the specified entity type (replaces the + * existing collection of entries). Operation + * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to update the entities in. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2BatchUpdateEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entities:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Agent$Intents { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Agent$Intents { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.intents.batchDelete - * @desc Deletes intents in the specified agent. Operation - * @alias dialogflow.projects.agent.intents.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2BatchDeleteIntentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.intents.batchDelete + * @desc Deletes intents in the specified agent. Operation + * @alias dialogflow.projects.agent.intents.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2BatchDeleteIntentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/intents:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/intents:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.intents.batchUpdate - * @desc Updates/Creates multiple intents in the specified agent. Operation - * - * @alias dialogflow.projects.agent.intents.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to update or create intents in. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2BatchUpdateIntentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.intents.batchUpdate + * @desc Updates/Creates multiple intents in the specified agent. Operation + * + * @alias dialogflow.projects.agent.intents.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to update or create intents in. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2BatchUpdateIntentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/intents:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/intents:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.intents.create - * @desc Creates an intent in the specified agent. - * @alias dialogflow.projects.agent.intents.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.parent Required. The agent to create a intent for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2Intent} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/intents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.intents.create + * @desc Creates an intent in the specified agent. + * @alias dialogflow.projects.agent.intents.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.parent Required. The agent to create a intent for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2Intent} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dialogflow.projects.agent.intents.delete - * @desc Deletes the specified intent. - * @alias dialogflow.projects.agent.intents.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the intent to delete. Format: `projects//agent/intents/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.intents.delete + * @desc Deletes the specified intent. + * @alias dialogflow.projects.agent.intents.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the intent to delete. Format: `projects//agent/intents/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.intents.get - * @desc Retrieves the specified intent. - * @alias dialogflow.projects.agent.intents.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language to retrieve training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required. The name of the intent. Format: `projects//agent/intents/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.intents.get + * @desc Retrieves the specified intent. + * @alias dialogflow.projects.agent.intents.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language to retrieve training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required. The name of the intent. Format: `projects//agent/intents/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dialogflow.projects.agent.intents.list - * @desc Returns the list of all intents in the specified agent. - * @alias dialogflow.projects.agent.intents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language to list training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent before they can be used. - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The agent to list all intents from. Format: `projects//agent`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListIntentsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListIntentsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.intents.list + * @desc Returns the list of all intents in the specified agent. + * @alias dialogflow.projects.agent.intents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language to list training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent before they can be used. + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The agent to list all intents from. Format: `projects//agent`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListIntentsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListIntentsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2ListIntentsResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/intents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2ListIntentsResponse>(parameters); - } - } - /** - * dialogflow.projects.agent.intents.patch - * @desc Updates the specified intent. - * @alias dialogflow.projects.agent.intents.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of this intent. Format: `projects//agent/intents/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2Intent} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.intents.patch + * @desc Updates the specified intent. + * @alias dialogflow.projects.agent.intents.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of this intent. Format: `projects//agent/intents/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2Intent} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Projects$Agent$Sessions { - root: Dialogflow; - contexts: Resource$Projects$Agent$Sessions$Contexts; - entityTypes: Resource$Projects$Agent$Sessions$Entitytypes; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.contexts = new Resource$Projects$Agent$Sessions$Contexts(root); - this.entityTypes = new Resource$Projects$Agent$Sessions$Entitytypes(root); - } + export class Resource$Projects$Agent$Sessions { + root: Dialogflow; + contexts: Resource$Projects$Agent$Sessions$Contexts; + entityTypes: Resource$Projects$Agent$Sessions$Entitytypes; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.contexts = new Resource$Projects$Agent$Sessions$Contexts(root); + this.entityTypes = new Resource$Projects$Agent$Sessions$Entitytypes(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.sessions.deleteContexts - * @desc Deletes all active contexts in the specified session. - * @alias dialogflow.projects.agent.sessions.deleteContexts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteContexts(params?: any, options?: MethodOptions): - AxiosPromise; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.sessions.deleteContexts + * @desc Deletes all active contexts in the specified session. + * @alias dialogflow.projects.agent.sessions.deleteContexts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteContexts(params?: any, options?: MethodOptions): + AxiosPromise; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.sessions.detectIntent - * @desc Processes a natural language query and returns structured, actionable - * data as a result. This method is not idempotent, because it may cause - * contexts and session entity types to be updated, which in turn might affect - * results of future queries. - * @alias dialogflow.projects.agent.sessions.detectIntent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`. It's up to the API caller to choose an appropriate session ID. It can be a random number or some type of user identifier (preferably hashed). The length of the session ID must not exceed 36 bytes. - * @param {().GoogleCloudDialogflowV2DetectIntentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detectIntent(params?: any, options?: MethodOptions): - AxiosPromise; - detectIntent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2DetectIntentResponse>): void; - detectIntent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2DetectIntentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.sessions.detectIntent + * @desc Processes a natural language query and returns structured, + * actionable data as a result. This method is not idempotent, because it + * may cause contexts and session entity types to be updated, which in turn + * might affect results of future queries. + * @alias dialogflow.projects.agent.sessions.detectIntent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`. It's up to the API caller to choose an appropriate session ID. It can be a random number or some type of user identifier (preferably hashed). The length of the session ID must not exceed 36 bytes. + * @param {().GoogleCloudDialogflowV2DetectIntentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detectIntent(params?: any, options?: MethodOptions): + AxiosPromise; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2DetectIntentResponse>): void; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2DetectIntentResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+session}:detectIntent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2DetectIntentResponse>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+session}:detectIntent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2DetectIntentResponse>(parameters); - } - } -} -export class Resource$Projects$Agent$Sessions$Contexts { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); } + export class Resource$Projects$Agent$Sessions$Contexts { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.sessions.contexts.create - * @desc Creates a context. - * @alias dialogflow.projects.agent.sessions.contexts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/`. - * @param {().GoogleCloudDialogflowV2Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.sessions.contexts.create + * @desc Creates a context. + * @alias dialogflow.projects.agent.sessions.contexts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/`. + * @param {().GoogleCloudDialogflowV2Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dialogflow.projects.agent.sessions.contexts.delete - * @desc Deletes the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.sessions.contexts.delete + * @desc Deletes the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.sessions.contexts.get - * @desc Retrieves the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.sessions.contexts.get + * @desc Retrieves the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dialogflow.projects.agent.sessions.contexts.list - * @desc Returns the list of all contexts in the specified session. - * @alias dialogflow.projects.agent.sessions.contexts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListContextsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListContextsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.sessions.contexts.list + * @desc Returns the list of all contexts in the specified session. + * @alias dialogflow.projects.agent.sessions.contexts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListContextsResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListContextsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2ListContextsResponse>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2ListContextsResponse>(parameters); - } - } - /** - * dialogflow.projects.agent.sessions.contexts.patch - * @desc Updates the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.sessions.contexts.patch + * @desc Updates the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Projects$Agent$Sessions$Entitytypes { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Agent$Sessions$Entitytypes { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.agent.sessions.entityTypes.create - * @desc Creates a session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/`. - * @param {().GoogleCloudDialogflowV2SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.sessions.entityTypes.create + * @desc Creates a session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/`. + * @param {().GoogleCloudDialogflowV2SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2SessionEntityType>(parameters); + } } - } - /** - * dialogflow.projects.agent.sessions.entityTypes.delete - * @desc Deletes the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.agent.sessions.entityTypes.delete + * @desc Deletes the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dialogflow.projects.agent.sessions.entityTypes.get - * @desc Retrieves the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dialogflow.projects.agent.sessions.entityTypes.get + * @desc Retrieves the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2SessionEntityType>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dialogflow.projects.agent.sessions.entityTypes.list - * @desc Returns the list of all session entity types in the specified - * session. - * @alias dialogflow.projects.agent.sessions.entityTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>): - void|AxiosPromise< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dialogflow.projects.agent.sessions.entityTypes.list + * @desc Returns the list of all session entity types in the specified + * session. + * @alias dialogflow.projects.agent.sessions.entityTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>): + void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>): + void|AxiosPromise< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2ListSessionEntityTypesResponse>( - parameters); - } - } - /** - * dialogflow.projects.agent.sessions.entityTypes.patch - * @desc Updates the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.sessions.entityTypes.patch + * @desc Updates the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2SessionEntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2SessionEntityType>(parameters); + } } } -} -export class Resource$Projects$Operations { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Operations { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dialogflow.projects.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias dialogflow.projects.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dialogflow.projects.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias dialogflow.projects.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dialogflow/v2beta1.ts b/src/apis/dialogflow/v2beta1.ts index 56ce7a9029b..160bbddcdf8 100644 --- a/src/apis/dialogflow/v2beta1.ts +++ b/src/apis/dialogflow/v2beta1.ts @@ -27,5406 +27,5480 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Dialogflow API - * - * An end-to-end development suite for conversational interfaces (e.g., - * chatbots, voice-powered apps and devices). - * - * @example - * const google = require('googleapis'); - * const dialogflow = google.dialogflow('v2beta1'); - * - * @namespace dialogflow - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Dialogflow - */ -export class Dialogflow { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dialogflow_v2beta1 { + /** + * Dialogflow API + * + * An end-to-end development suite for conversational interfaces (e.g., + * chatbots, voice-powered apps and devices). + * + * @example + * const google = require('googleapis'); + * const dialogflow = google.dialogflow('v2beta1'); + * + * @namespace dialogflow + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Dialogflow + */ + export class Dialogflow { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The response message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { /** - * The collection of updated or created entity types. + * The response message for EntityTypes.BatchUpdateEntityTypes. */ - entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; -} -/** - * The response message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { + export interface Schema$GoogleCloudDialogflowV2BatchUpdateEntityTypesResponse { + /** + * The collection of updated or created entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2EntityType[]; + } /** - * The collection of updated or created intents. + * The response message for Intents.BatchUpdateIntents. */ - intents: Schema$GoogleCloudDialogflowV2Intent[]; -} -/** - * Represents a conversational agent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1Agent { + export interface Schema$GoogleCloudDialogflowV2BatchUpdateIntentsResponse { + /** + * The collection of updated or created intents. + */ + intents: Schema$GoogleCloudDialogflowV2Intent[]; + } /** - * Optional. The URI of the agent's avatar. Avatars are used throughout - * the Dialogflow console and in the self-hosted [Web - * Demo](https://dialogflow.com/docs/integrations/web-demo) integration. - */ - avatarUri: string; + * Represents a conversational agent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1Agent { + /** + * Optional. The URI of the agent's avatar. Avatars are used throughout + * the Dialogflow console and in the self-hosted [Web + * Demo](https://dialogflow.com/docs/integrations/web-demo) integration. + */ + avatarUri: string; + /** + * Optional. To filter out false positive results and still get variety in + * matched natural language inputs for your agent, you can tune the machine + * learning classification threshold. If the returned score value is less + * than the threshold value, then a fallback intent is be triggered or, if + * there are no fallback intents defined, no intent will be triggered. The + * score values range from 0.0 (completely uncertain) to 1.0 (completely + * certain). If set to 0.0, the default of 0.3 is used. + */ + classificationThreshold: number; + /** + * Required. The default language of the agent as a language tag. See + * [Language Support](https://dialogflow.com/docs/reference/language) for a + * list of the currently supported language codes. This field cannot be set + * by the `Update` method. + */ + defaultLanguageCode: string; + /** + * Optional. The description of this agent. The maximum length is 500 + * characters. If exceeded, the request is rejected. + */ + description: string; + /** + * Required. The name of this agent. + */ + displayName: string; + /** + * Optional. Determines whether this agent should log conversation queries. + */ + enableLogging: boolean; + /** + * Optional. Determines how intents are detected from user queries. + */ + matchMode: string; + /** + * Required. The project of this agent. Format: `projects/<Project + * ID>`. + */ + parent: string; + /** + * Optional. The list of all languages supported by this agent (except for + * the `default_language_code`). + */ + supportedLanguageCodes: string[]; + /** + * Required. The time zone of this agent from the [time zone + * database](https://www.iana.org/time-zones), e.g., America/New_York, + * Europe/Paris. + */ + timeZone: string; + } /** - * Optional. To filter out false positive results and still get variety in - * matched natural language inputs for your agent, you can tune the machine - * learning classification threshold. If the returned score value is less than - * the threshold value, then a fallback intent is be triggered or, if there - * are no fallback intents defined, no intent will be triggered. The score - * values range from 0.0 (completely uncertain) to 1.0 (completely certain). - * If set to 0.0, the default of 0.3 is used. - */ - classificationThreshold: number; + * The request message for EntityTypes.BatchCreateEntities. + */ + export interface Schema$GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest { + /** + * Required. The collection of entities to create. + */ + entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + } /** - * Required. The default language of the agent as a language tag. See - * [Language Support](https://dialogflow.com/docs/reference/language) for a - * list of the currently supported language codes. This field cannot be set by - * the `Update` method. - */ - defaultLanguageCode: string; + * The request message for EntityTypes.BatchDeleteEntities. + */ + export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest { + /** + * Required. The canonical `values` of the entities to delete. Note that + * these are not fully-qualified names, i.e. they don't start with + * `projects/<Project ID>`. + */ + entityValues: string[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + } /** - * Optional. The description of this agent. The maximum length is 500 - * characters. If exceeded, the request is rejected. + * The request message for EntityTypes.BatchDeleteEntityTypes. */ - description: string; + export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest { + /** + * Required. The names entity types to delete. All names must point to the + * same agent as `parent`. + */ + entityTypeNames: string[]; + } /** - * Required. The name of this agent. + * The request message for Intents.BatchDeleteIntents. */ - displayName: string; + export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest { + /** + * Required. The collection of intents to delete. Only intent `name` must be + * filled in. + */ + intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; + } /** - * Optional. Determines whether this agent should log conversation queries. - */ - enableLogging: boolean; + * The response message for EntityTypes.BatchCreateEntities. + */ + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { + /** + * Required. The collection of new entities to replace the existing + * entities. + */ + entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + /** + * Optional. The language of entity synonyms defined in `entities`. If not + * specified, the agent's default language is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Optional. Determines how intents are detected from user queries. - */ - matchMode: string; + * The request message for EntityTypes.BatchUpdateEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest { + /** + * The collection of entity type to update or create. + */ + entityTypeBatchInline: Schema$GoogleCloudDialogflowV2beta1EntityTypeBatch; + /** + * The URI to a Google Cloud Storage file containing entity types to update + * or create. The file format can either be a serialized proto (of + * EntityBatch type) or a JSON object. Note: The URI must start with + * "gs://". + */ + entityTypeBatchUri: string; + /** + * Optional. The language of entity synonyms defined in `entity_types`. If + * not specified, the agent's default language is used. [More than a + * dozen languages](https://dialogflow.com/docs/reference/language) are + * supported. Note: languages must be enabled in the agent, before they can + * be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Required. The project of this agent. Format: `projects/<Project ID>`. + * The response message for EntityTypes.BatchUpdateEntityTypes. */ - parent: string; + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { + /** + * The collection of updated or created entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; + } /** - * Optional. The list of all languages supported by this agent (except for the - * `default_language_code`). - */ - supportedLanguageCodes: string[]; + * The request message for Intents.BatchUpdateIntents. + */ + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest { + /** + * The collection of intents to update or create. + */ + intentBatchInline: Schema$GoogleCloudDialogflowV2beta1IntentBatch; + /** + * The URI to a Google Cloud Storage file containing intents to update or + * create. The file format can either be a serialized proto (of IntentBatch + * type) or JSON object. Note: The URI must start with "gs://". + */ + intentBatchUri: string; + /** + * Optional. The resource view to apply to the returned intent. + */ + intentView: string; + /** + * Optional. The language of training phrases, parameters and rich messages + * defined in `intents`. If not specified, the agent's default language + * is used. [More than a dozen + * languages](https://dialogflow.com/docs/reference/language) are supported. + * Note: languages must be enabled in the agent, before they can be used. + */ + languageCode: string; + /** + * Optional. The mask to control which fields get updated. + */ + updateMask: string; + } /** - * Required. The time zone of this agent from the [time zone - * database](https://www.iana.org/time-zones), e.g., America/New_York, - * Europe/Paris. + * The response message for Intents.BatchUpdateIntents. */ - timeZone: string; -} -/** - * The request message for EntityTypes.BatchCreateEntities. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest { + export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { + /** + * The collection of updated or created intents. + */ + intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; + } /** - * Required. The collection of entities to create. - */ - entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + * Represents a context. + */ + export interface Schema$GoogleCloudDialogflowV2beta1Context { + /** + * Optional. The number of conversational query requests after which the + * context expires. If set to `0` (the default) the context expires + * immediately. Contexts expire automatically after 10 minutes even if there + * are no matching queries. + */ + lifespanCount: number; + /** + * Required. The unique identifier of the context. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/contexts/<Context ID>`, or `projects/<Project + * ID>/agent/environments/<Environment ID>/users/<User + * ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: + * Environments and users are under construction and will be available soon. + * The Context ID is always converted to lowercase. If <Environment + * ID> is not specified, we assume default 'draft' environment. + * If <User ID> is not specified, we assume default '-' user. + */ + name: string; + /** + * Optional. The collection of parameters associated with this context. + * Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) + * for syntax. + */ + parameters: any; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; -} -/** - * The request message for EntityTypes.BatchDeleteEntities. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest { + * The request to detect user's intent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1DetectIntentRequest { + /** + * Optional. The natural language speech audio to be processed. This field + * should be populated iff `query_input` is set to an input audio config. A + * single request can contain up to 1 minute of speech audio data. + */ + inputAudio: string; + /** + * Required. The input specification. It can be set to: 1. an audio config + * which instructs the speech recognizer how to process the speech audio, 2. + * a conversational query in the form of text, or 3. an event that + * specifies which intent to trigger. + */ + queryInput: Schema$GoogleCloudDialogflowV2beta1QueryInput; + /** + * Optional. The parameters of this query. + */ + queryParams: Schema$GoogleCloudDialogflowV2beta1QueryParameters; + } /** - * Required. The canonical `values` of the entities to delete. Note that these - * are not fully-qualified names, i.e. they don't start with - * `projects/<Project ID>`. - */ - entityValues: string[]; + * The message returned from the DetectIntent method. + */ + export interface Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse { + /** + * The results of the conversational query or event processing. + */ + queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; + /** + * The unique identifier of the response. It can be used to locate a + * response in the training example set or for reporting issues. + */ + responseId: string; + /** + * Specifies the status of the webhook request. `webhook_status` is never + * populated in webhook requests. + */ + webhookStatus: Schema$GoogleRpcStatus; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; -} -/** - * The request message for EntityTypes.BatchDeleteEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest { + * Represents an entity type. Entity types serve as a tool for extracting + * parameter values from natural language queries. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EntityType { + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + */ + autoExpansionMode: string; + /** + * Required. The name of the entity. + */ + displayName: string; + /** + * Optional. The collection of entities associated with the entity type. + */ + entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + /** + * Required. Indicates the kind of entity type. + */ + kind: string; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of the entity type. Format: + * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. + */ + name: string; + } /** - * Required. The names entity types to delete. All names must point to the - * same agent as `parent`. + * This message is a wrapper around a collection of entity types. */ - entityTypeNames: string[]; -} -/** - * The request message for Intents.BatchDeleteIntents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest { + export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeBatch { + /** + * A collection of entity types. + */ + entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; + } /** - * Required. The collection of intents to delete. Only intent `name` must be - * filled in. - */ - intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; -} -/** - * The response message for EntityTypes.BatchCreateEntities. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest { + * Optional. Represents an entity. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { + /** + * Required. A collection of synonyms. For `KIND_LIST` entity types this + * must contain exactly one synonym equal to `value`. + */ + synonyms: string[]; + /** + * Required. For `KIND_MAP` entity types: A canonical name to be used in + * place of synonyms. For `KIND_LIST` entity types: A string that can + * contain references to other entity types (with or without aliases). + */ + value: string; + } /** - * Required. The collection of new entities to replace the existing entities. - */ - entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + * Events allow for matching intents by event name instead of the natural + * language input. For instance, input `<event: { name: “welcome_event”, + * parameters: { name: “Sam” } }>` can trigger a personalized welcome + * response. The parameter `name` may be used by the agent in the response: + * `“Hello #welcome_event.name! What can I do for you today?”`. + */ + export interface Schema$GoogleCloudDialogflowV2beta1EventInput { + /** + * Required. The language of this query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The unique identifier of the event. + */ + name: string; + /** + * Optional. The collection of parameters associated with the event. + */ + parameters: any; + } /** - * Optional. The language of entity synonyms defined in `entities`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. + * The request message for Agents.ExportAgent. */ - languageCode: string; + export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentRequest { + /** + * Optional. The Google Cloud Storage URI to export the agent to. Note: The + * URI must start with "gs://". If left unspecified, the + * serialized agent is returned inline. + */ + agentUri: string; + } /** - * Optional. The mask to control which fields get updated. - */ - updateMask: string; -} -/** - * The request message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest { + * The response message for Agents.ExportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { + /** + * The exported agent. Example for how to export an agent to a zip file via + * a command line: curl \ + * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ --data-binary + * '{}' \ | grep agentContent | sed -e + * 's/.*"agentContent": "\([^"]*\)".x/\1/' + * \ | base64 --decode > <agent zip file> + */ + agentContent: string; + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + */ + agentUri: string; + } /** - * The collection of entity type to update or create. - */ - entityTypeBatchInline: Schema$GoogleCloudDialogflowV2beta1EntityTypeBatch; + * The request message for Agents.ImportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ImportAgentRequest { + /** + * The agent to import. Example for how to import an agent via the command + * line: curl \ + * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:import\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ + * --data-binary "{ 'agentContent': '$(cat <agent + * zip file> | base64 -w 0)' }" + */ + agentContent: string; + /** + * The URI to a Google Cloud Storage file containing the agent to import. + * Note: The URI must start with "gs://". + */ + agentUri: string; + } /** - * The URI to a Google Cloud Storage file containing entity types to update or - * create. The file format can either be a serialized proto (of EntityBatch - * type) or a JSON object. Note: The URI must start with "gs://". - */ - entityTypeBatchUri: string; + * Instructs the speech recognizer how to process the audio content. + */ + export interface Schema$GoogleCloudDialogflowV2beta1InputAudioConfig { + /** + * Required. Audio encoding of the audio content to process. + */ + audioEncoding: string; + /** + * Required. The language of the supplied audio. Dialogflow does not do + * translations. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Optional. The collection of phrase hints which are used to boost accuracy + * of speech recognition. Refer to [Cloud Speech API + * documentation](/speech/docs/basics#phrase-hints) for more details. + */ + phraseHints: string[]; + /** + * Required. Sample rate (in Hertz) of the audio content sent in the query. + * Refer to [Cloud Speech API documentation](/speech/docs/basics) for more + * details. + */ + sampleRateHertz: number; + } /** - * Optional. The language of entity synonyms defined in `entity_types`. If not - * specified, the agent's default language is used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. - */ - languageCode: string; + * Represents an intent. Intents convert a number of user expressions or + * patterns into an action. An action is an extraction of a user command or + * sentence semantics. + */ + export interface Schema$GoogleCloudDialogflowV2beta1Intent { + /** + * Optional. The name of the action associated with the intent. + */ + action: string; + /** + * Optional. The list of platforms for which the first response will be + * taken from among the messages assigned to the DEFAULT_PLATFORM. + */ + defaultResponsePlatforms: string[]; + /** + * Required. The name of this intent. + */ + displayName: string; + /** + * Optional. The collection of event names that trigger the intent. If the + * collection of input contexts is not empty, all of the contexts must be + * present in the active user session for an event to trigger this intent. + */ + events: string[]; + /** + * Optional. Collection of information about all followup intents that have + * name of this intent as a root_name. + */ + followupIntentInfo: + Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[]; + /** + * Optional. The list of context names required for this intent to be + * triggered. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + inputContextNames: string[]; + /** + * Optional. Indicates whether this is a fallback intent. + */ + isFallback: boolean; + /** + * Optional. The collection of rich messages corresponding to the `Response` + * field in the Dialogflow console. + */ + messages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_disabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + */ + mlDisabled: boolean; + /** + * Optional. Indicates whether Machine Learning is enabled for the intent. + * Note: If `ml_enabled` setting is set to false, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` + * field instead. NOTE: If neither `ml_enabled` nor `ml_disabled` field is + * set, then the default value is determined as follows: - Before April + * 15th, 2018 the default is: ml_enabled = false / ml_disabled = true. - + * After April 15th, 2018 the default is: ml_enabled = true / ml_disabled + * = false. + */ + mlEnabled: boolean; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of this intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + name: string; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the + * context when the intent is matched. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Optional. The collection of parameters associated with the intent. + */ + parameters: Schema$GoogleCloudDialogflowV2beta1IntentParameter[]; + /** + * The unique identifier of the parent intent in the chain of followup + * intents. It identifies the parent followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. Zero or negative numbers mean that the intent is disabled. + */ + priority: number; + /** + * Optional. Indicates whether to delete all contexts in the current session + * when this intent is matched. + */ + resetContexts: boolean; + /** + * The unique identifier of the root intent in the chain of followup + * intents. It identifies the correct followup intents chain for this + * intent. Format: `projects/<Project ID>/agent/intents/<Intent + * ID>`. + */ + rootFollowupIntentName: string; + /** + * Optional. The collection of examples/templates that the agent is trained + * on. + */ + trainingPhrases: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; + /** + * Required. Indicates whether webhooks are enabled for the intent. + */ + webhookState: string; + } /** - * Optional. The mask to control which fields get updated. + * This message is a wrapper around a collection of intents. */ - updateMask: string; -} -/** - * The response message for EntityTypes.BatchUpdateEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesResponse { + export interface Schema$GoogleCloudDialogflowV2beta1IntentBatch { + /** + * A collection of intents. + */ + intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; + } /** - * The collection of updated or created entity types. - */ - entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; -} -/** - * The request message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest { + * Represents a single followup intent in the chain. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { + /** + * The unique identifier of the followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + followupIntentName: string; + /** + * The unique identifier of the followup intent parent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + } /** - * The collection of intents to update or create. - */ - intentBatchInline: Schema$GoogleCloudDialogflowV2beta1IntentBatch; + * Corresponds to the `Response` field in the Dialogflow console. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage { + /** + * Displays a basic card for Actions on Google. + */ + basicCard: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard; + /** + * Displays a card. + */ + card: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard; + /** + * Displays a carousel card for Actions on Google. + */ + carouselSelect: + Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; + /** + * Displays an image. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Displays a link out suggestion chip for Actions on Google. + */ + linkOutSuggestion: + Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; + /** + * Displays a list card for Actions on Google. + */ + listSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect; + /** + * Returns a response containing a custom, platform-specific payload. See + * the Intent.Message.Platform type for a description of the structure that + * may be required for your platform. + */ + payload: any; + /** + * Optional. The platform that this message is intended for. + */ + platform: string; + /** + * Displays quick replies. + */ + quickReplies: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; + /** + * Returns a voice or text-only response for Actions on Google. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; + /** + * Displays suggestion chips for Actions on Google. + */ + suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions; + /** + * Returns a text response. + */ + text: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; + } /** - * The URI to a Google Cloud Storage file containing intents to update or - * create. The file format can either be a serialized proto (of IntentBatch - * type) or JSON object. Note: The URI must start with "gs://". - */ - intentBatchUri: string; + * The basic card message. Useful for displaying information. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[]; + /** + * Required, unless image is present. The body text of the card. + */ + formattedText: string; + /** + * Optional. The image for the card. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Optional. The resource view to apply to the returned intent. - */ - intentView: string; + * The button object that appears at the bottom of a card. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { + /** + * Required. Action to take when a user taps on the button. + */ + openUriAction: + Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; + /** + * Required. The title of the button. + */ + title: string; + } /** - * Optional. The language of training phrases, parameters and rich messages - * defined in `intents`. If not specified, the agent's default language is - * used. [More than a dozen - * languages](https://dialogflow.com/docs/reference/language) are supported. - * Note: languages must be enabled in the agent, before they can be used. + * Opens the given URI. */ - languageCode: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { + /** + * Required. The HTTP or HTTPS scheme URI. + */ + uri: string; + } /** - * Optional. The mask to control which fields get updated. - */ - updateMask: string; -} -/** - * The response message for Intents.BatchUpdateIntents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1BatchUpdateIntentsResponse { + * The card response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[]; + /** + * Optional. The public URI to an image file for the card. + */ + imageUri: string; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * The collection of updated or created intents. - */ - intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; -} -/** - * Represents a context. - */ -export interface Schema$GoogleCloudDialogflowV2beta1Context { + * Optional. Contains information about a button. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton { + /** + * Optional. The text to send back to the Dialogflow API or a URI to open. + */ + postback: string; + /** + * Optional. The text to show on the button. + */ + text: string; + } /** - * Optional. The number of conversational query requests after which the - * context expires. If set to `0` (the default) the context expires - * immediately. Contexts expire automatically after 10 minutes even if there - * are no matching queries. + * The card for presenting a carousel of options to select from. */ - lifespanCount: number; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { + /** + * Required. Carousel items. + */ + items: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; + } /** - * Required. The unique identifier of the context. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/contexts/<Context ID>`, or `projects/<Project - * ID>/agent/environments/<Environment ID>/users/<User - * ID>/sessions/<Session ID>/contexts/<Context ID>`. Note: - * Environments and users are under construction and will be available soon. - * The Context ID is always converted to lowercase. If <Environment ID> - * is not specified, we assume default 'draft' environment. If - * <User ID> is not specified, we assume default '-' user. - */ - name: string; + * An item in the carousel. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { + /** + * Optional. The body text of the card. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Required. Additional info about the option item. + */ + info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; + /** + * Required. Title of the carousel item. + */ + title: string; + } /** - * Optional. The collection of parameters associated with this context. Refer - * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for - * syntax. - */ - parameters: any; -} -/** - * The request to detect user's intent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1DetectIntentRequest { + * The image response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + */ + accessibilityText: string; + /** + * Optional. The public URI to an image file. + */ + imageUri: string; + } /** - * Optional. The natural language speech audio to be processed. This field - * should be populated iff `query_input` is set to an input audio config. A - * single request can contain up to 1 minute of speech audio data. - */ - inputAudio: string; + * The suggestion chip message that allows the user to jump out to the app or + * website associated with this agent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { + /** + * Required. The name of the app or site this chip is linking to. + */ + destinationName: string; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + */ + uri: string; + } /** - * Required. The input specification. It can be set to: 1. an audio config - * which instructs the speech recognizer how to process the speech audio, 2. - * a conversational query in the form of text, or 3. an event that specifies - * which intent to trigger. - */ - queryInput: Schema$GoogleCloudDialogflowV2beta1QueryInput; + * The card for presenting a list of options to select from. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { + /** + * Required. List items. + */ + items: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; + /** + * Optional. The overall title of the list. + */ + title: string; + } /** - * Optional. The parameters of this query. - */ - queryParams: Schema$GoogleCloudDialogflowV2beta1QueryParameters; -} -/** - * The message returned from the DetectIntent method. - */ -export interface Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse { + * An item in the list. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { + /** + * Optional. The main text describing the item. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + /** + * Required. Additional information about this option. + */ + info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; + /** + * Required. The title of the list item. + */ + title: string; + } /** - * The results of the conversational query or event processing. - */ - queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; + * The quick replies response message. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { + /** + * Optional. The collection of quick replies. + */ + quickReplies: string[]; + /** + * Optional. The title of the collection of quick replies. + */ + title: string; + } /** - * The unique identifier of the response. It can be used to locate a response - * in the training example set or for reporting issues. - */ - responseId: string; + * Additional info about the select item for when it is triggered in a dialog. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + */ + key: string; + /** + * Optional. A list of synonyms that can also be used to trigger this item + * in dialog. + */ + synonyms: string[]; + } /** - * Specifies the status of the webhook request. `webhook_status` is never - * populated in webhook requests. - */ - webhookStatus: Schema$GoogleRpcStatus; -} -/** - * Represents an entity type. Entity types serve as a tool for extracting - * parameter values from natural language queries. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EntityType { + * The simple response message containing speech or text. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { + /** + * Optional. The text to display. + */ + displayText: string; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + */ + ssml: string; + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + */ + textToSpeech: string; + } /** - * Optional. Indicates whether the entity type can be automatically expanded. - */ - autoExpansionMode: string; + * The collection of simple response candidates. This message in + * `QueryResult.fulfillment_messages` and + * `WebhookResponse.fulfillment_messages` should contain only one + * `SimpleResponse`. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { + /** + * Required. The list of simple responses. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[]; + } /** - * Required. The name of the entity. + * The suggestion chip message that the user can tap to quickly post a reply + * to the conversation. */ - displayName: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { + /** + * Required. The text shown the in the suggestion chip. + */ + title: string; + } /** - * Optional. The collection of entities associated with the entity type. + * The collection of suggestions. */ - entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { + /** + * Required. The list of suggested replies. + */ + suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; + } /** - * Required. Indicates the kind of entity type. + * The text response message. */ - kind: string; + export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { + /** + * Optional. The collection of the agent's responses. + */ + text: string[]; + } /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of the entity type. Format: - * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. - */ - name: string; -} -/** - * This message is a wrapper around a collection of entity types. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeBatch { + * Represents intent parameters. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentParameter { + /** + * Optional. The default value to use when the `value` yields an empty + * result. Default values can be extracted from contexts by using the + * following syntax: `#context_name.parameter_name`. + */ + defaultValue: string; + /** + * Required. The name of the parameter. + */ + displayName: string; + /** + * Optional. The name of the entity type, prefixed with `@`, that describes + * values of the parameter. If the parameter is required, this must be + * provided. + */ + entityTypeDisplayName: string; + /** + * Optional. Indicates whether the parameter represents a list of values. + */ + isList: boolean; + /** + * Optional. Indicates whether the parameter is required. That is, whether + * the intent cannot be completed without collecting the parameter value. + */ + mandatory: boolean; + /** + * The unique identifier of this parameter. + */ + name: string; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect value for the parameter. + */ + prompts: string[]; + /** + * Optional. The definition of the parameter value. It can be: - a constant + * string, - a parameter value defined as `$parameter_name`, - an original + * parameter value defined as `$parameter_name.original`, - a parameter + * value from some context defined as `#context_name.parameter_name`. + */ + value: string; + } /** - * A collection of entity types. - */ - entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; -} -/** - * Optional. Represents an entity. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity { + * Represents an example or template that the agent is trained on. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { + /** + * Required. The unique identifier of this training phrase. + */ + name: string; + /** + * Required. The collection of training phrase parts (can be annotated). + * Fields: `entity_type`, `alias` and `user_defined` should be populated + * only for the annotated parts of the training phrase. + */ + parts: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; + /** + * Optional. Indicates how many times this example or template was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + */ + timesAddedCount: number; + /** + * Required. The type of the training phrase. + */ + type: string; + } /** - * Required. A collection of synonyms. For `KIND_LIST` entity types this must - * contain exactly one synonym equal to `value`. - */ - synonyms: string[]; + * Represents a part of a training phrase. + */ + export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { + /** + * Optional. The parameter name for the value extracted from the annotated + * part of the example. + */ + alias: string; + /** + * Optional. The entity type name prefixed with `@`. This field is required + * for the annotated part of the text and applies only to examples. + */ + entityType: string; + /** + * Required. The text corresponding to the example or template, if there are + * no annotations. For annotated examples, it is the text for one of the + * example's parts. + */ + text: string; + /** + * Optional. Indicates whether the text was manually annotated by the + * developer. + */ + userDefined: boolean; + } /** - * Required. For `KIND_MAP` entity types: A canonical name to be used in - * place of synonyms. For `KIND_LIST` entity types: A string that can - * contain references to other entity types (with or without aliases). + * Metadata in google::longrunning::Operation for Knowledge operations. */ - value: string; -} -/** - * Events allow for matching intents by event name instead of the natural - * language input. For instance, input `<event: { name: “welcome_event”, - * parameters: { name: “Sam” } }>` can trigger a personalized welcome - * response. The parameter `name` may be used by the agent in the response: - * `“Hello #welcome_event.name! What can I do for you today?”`. - */ -export interface Schema$GoogleCloudDialogflowV2beta1EventInput { + export interface Schema$GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { + /** + * Required. The current state of this operation. + */ + state: string; + } /** - * Required. The language of this query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. - */ - languageCode: string; + * The response message for Contexts.ListContexts. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ListContextsResponse { + /** + * The list of contexts. There will be a maximum number of items returned + * based on the page_size field in the request. + */ + contexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Required. The unique identifier of the event. - */ - name: string; + * The response message for EntityTypes.ListEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse { + /** + * The list of agent entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The collection of parameters associated with the event. - */ - parameters: any; -} -/** - * The request message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentRequest { + * The response message for Intents.ListIntents. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse { + /** + * The list of agent intents. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The Google Cloud Storage URI to export the agent to. Note: The - * URI must start with "gs://". If left unspecified, the serialized - * agent is returned inline. - */ - agentUri: string; -} -/** - * The response message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ExportAgentResponse { + * The response message for SessionEntityTypes.ListSessionEntityTypes. + */ + export interface Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse { + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + /** + * The list of session entity types. There will be a maximum number of items + * returned based on the page_size field in the request. + */ + sessionEntityTypes: Schema$GoogleCloudDialogflowV2beta1SessionEntityType[]; + } /** - * The exported agent. Example for how to export an agent to a zip file via a - * command line: curl \ - * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:export'\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * '{}' \ | grep agentContent | sed -e - * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ - * | base64 --decode > <agent zip file> + * Represents the contents of the original request that was passed to the + * `[Streaming]DetectIntent` call. */ - agentContent: string; + export interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { + /** + * Optional. This field is set to the value of `QueryParameters.payload` + * field passed in the request. + */ + payload: any; + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is + * set by Dialogflow-owned servers. + */ + source: string; + } /** - * The URI to a file containing the exported agent. This field is populated - * only if `agent_uri` is specified in `ExportAgentRequest`. - */ - agentUri: string; -} -/** - * The request message for Agents.ImportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ImportAgentRequest { + * Represents the query input. It can contain either: 1. An audio config + * which instructs the speech recognizer how to process the speech audio. + * 2. A conversational query in the form of text,. 3. An event that + * specifies which intent to trigger. + */ + export interface Schema$GoogleCloudDialogflowV2beta1QueryInput { + /** + * Instructs the speech recognizer how to process the speech audio. + */ + audioConfig: Schema$GoogleCloudDialogflowV2beta1InputAudioConfig; + /** + * The event to be processed. + */ + event: Schema$GoogleCloudDialogflowV2beta1EventInput; + /** + * The natural language text to be processed. + */ + text: Schema$GoogleCloudDialogflowV2beta1TextInput; + } /** - * The agent to import. Example for how to import an agent via the command - * line: curl \ - * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:import\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * "{ 'agentContent': '$(cat <agent zip file> | - * base64 -w 0)' }" - */ - agentContent: string; + * Represents the parameters of the conversational query. + */ + export interface Schema$GoogleCloudDialogflowV2beta1QueryParameters { + /** + * Optional. The collection of contexts to be activated before this query is + * executed. + */ + contexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Optional. The geo location of this conversational query. + */ + geoLocation: Schema$GoogleTypeLatLng; + /** + * Optional. This field can be used to pass custom data into the webhook + * associated with the agent. Arbitrary JSON objects are supported. + */ + payload: any; + /** + * Optional. Specifies whether to delete all contexts in the current session + * before the new ones are activated. + */ + resetContexts: boolean; + /** + * Optional. The collection of session entity types to replace or extend + * developer entities with for this query only. The entity synonyms apply to + * all languages. + */ + sessionEntityTypes: Schema$GoogleCloudDialogflowV2beta1SessionEntityType[]; + /** + * Optional. The time zone of this conversational query from the [time zone + * database](https://www.iana.org/time-zones), e.g., America/New_York, + * Europe/Paris. If not provided, the time zone specified in agent settings + * is used. + */ + timeZone: string; + } /** - * The URI to a Google Cloud Storage file containing the agent to import. - * Note: The URI must start with "gs://". - */ - agentUri: string; -} -/** - * Instructs the speech recognizer how to process the audio content. - */ -export interface Schema$GoogleCloudDialogflowV2beta1InputAudioConfig { + * Represents the result of conversational query or event processing. + */ + export interface Schema$GoogleCloudDialogflowV2beta1QueryResult { + /** + * The action name from the matched intent. + */ + action: string; + /** + * This field is set to: - `false` if the matched intent has required + * parameters and not all of the required parameter values have been + * collected. - `true` if all required parameter values have been collected, + * or if the matched intent doesn't contain any required parameters. + */ + allRequiredParamsPresent: boolean; + /** + * The free-form diagnostic info. For example, this field could contain + * webhook call latency. + */ + diagnosticInfo: any; + /** + * The collection of rich messages to present to the user. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * The text to be pronounced to the user or shown on the screen. + */ + fulfillmentText: string; + /** + * The intent that matched the conversational query. Some, not all fields + * are filled in this message, including but not limited to: `name`, + * `display_name` and `webhook_state`. + */ + intent: Schema$GoogleCloudDialogflowV2beta1Intent; + /** + * The intent detection confidence. Values range from 0.0 (completely + * uncertain) to 1.0 (completely certain). + */ + intentDetectionConfidence: number; + /** + * The language that was triggered during intent detection. See [Language + * Support](https://dialogflow.com/docs/reference/language) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name `<parameter + * name>.original` containing the original parameter values before the + * query. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * The collection of extracted parameters. + */ + parameters: any; + /** + * The original conversational query text: - If natural language text was + * provided as input, `query_text` contains a copy of the input. - If + * natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. - If an event was + * provided as input, `query_text` is not set. + */ + queryText: string; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that + * confidence was not set. You should not rely on this field as it + * isn't guaranteed to be accurate, or even set. In particular this + * field isn't set in Webhook calls and for StreamingDetectIntent since + * the streaming endpoint has separate confidence estimates per portion of + * the audio in StreamingRecognitionResult. + */ + speechRecognitionConfidence: number; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + */ + webhookPayload: any; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + */ + webhookSource: string; + } /** - * Required. Audio encoding of the audio content to process. - */ - audioEncoding: string; + * The request message for Agents.RestoreAgent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1RestoreAgentRequest { + /** + * The agent to restore. Example for how to restore an agent via the + * command line: curl \ + * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:restore\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ + * --data-binary "{ 'agentContent': '$(cat <agent + * zip file> | base64 -w 0)' }" \ + */ + agentContent: string; + /** + * The URI to a Google Cloud Storage file containing the agent to restore. + * Note: The URI must start with "gs://". + */ + agentUri: string; + } /** - * Required. The language of the supplied audio. Dialogflow does not do - * translations. See [Language Support](https://dialogflow.com/docs/languages) - * for a list of the currently supported language codes. Note that queries in - * the same session do not necessarily need to specify the same language. - */ - languageCode: string; + * The response message for Agents.SearchAgents. + */ + export interface Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse { + /** + * The list of agents. There will be a maximum number of items returned + * based on the page_size field in the request. + */ + agents: Schema$GoogleCloudDialogflowV2beta1Agent[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } /** - * Optional. The collection of phrase hints which are used to boost accuracy - * of speech recognition. Refer to [Cloud Speech API - * documentation](/speech/docs/basics#phrase-hints) for more details. - */ - phraseHints: string[]; + * Represents a session entity type. Extends or replaces a developer entity + * type at the user session level (we refer to the entity types defined at the + * agent level as "developer entity types"). Note: session entity + * types apply to all queries, regardless of the language. + */ + export interface Schema$GoogleCloudDialogflowV2beta1SessionEntityType { + /** + * Required. The collection of entities associated with this session entity + * type. + */ + entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; + /** + * Required. Indicates whether the additional data should override or + * supplement the developer entity type definition. + */ + entityOverrideMode: string; + /** + * Required. The unique identifier of this session entity type. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/entityTypes/<Entity Type Display Name>`, or + * `projects/<Project ID>/agent/environments/<Environment + * ID>/users/<User ID>/sessions /<Session + * ID>/entityTypes/<Entity Type Display Name>`. Note: Environments + * and users are under construction and will be available soon. If + * <Environment ID> is not specified, we assume default + * 'draft' environment. If <User ID> is not specified, we + * assume default '-' user. + */ + name: string; + } /** - * Required. Sample rate (in Hertz) of the audio content sent in the query. - * Refer to [Cloud Speech API documentation](/speech/docs/basics) for more - * details. - */ - sampleRateHertz: number; -} -/** - * Represents an intent. Intents convert a number of user expressions or - * patterns into an action. An action is an extraction of a user command or - * sentence semantics. - */ -export interface Schema$GoogleCloudDialogflowV2beta1Intent { + * Represents the natural language text to be processed. + */ + export interface Schema$GoogleCloudDialogflowV2beta1TextInput { + /** + * Required. The language of this conversational query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The UTF-8 encoded natural language text to be processed. Text + * length must not exceed 256 bytes. + */ + text: string; + } /** - * Optional. The name of the action associated with the intent. - */ - action: string; + * The request message for Agents.TrainAgent. + */ + export interface Schema$GoogleCloudDialogflowV2beta1TrainAgentRequest {} + /** + * The request message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + */ + originalDetectIntentRequest: + Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + */ + queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + */ + responseId: string; + /** + * The unique identifier of detectIntent request session. Can be used to + * identify end-user inside webhook implementation. Format: + * `projects/<Project ID>/agent/sessions/<Session ID>`. + */ + session: string; + } /** - * Optional. The list of platforms for which the first response will be taken - * from among the messages assigned to the DEFAULT_PLATFORM. - */ - defaultResponsePlatforms: string[]; + * The response message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2beta1WebhookResponse { + /** + * Optional. Makes the platform immediately invoke another `DetectIntent` + * call internally with the specified event as input. + */ + followupEventInput: Schema$GoogleCloudDialogflowV2beta1EventInput; + /** + * Optional. The collection of rich messages to present to the user. This + * value is passed directly to `QueryResult.fulfillment_messages`. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + /** + * Optional. The text to be shown on the screen. This value is passed + * directly to `QueryResult.fulfillment_text`. + */ + fulfillmentText: string; + /** + * Optional. The collection of output contexts. This value is passed + * directly to `QueryResult.output_contexts`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + /** + * Optional. This value is passed directly to `QueryResult.webhook_payload`. + * See the related `fulfillment_messages[i].payload field`, which may be + * used as an alternative to this field. This field can be used for Actions + * on Google responses. It should have a structure similar to the JSON + * message shown here. For more information, see [Actions on Google Webhook + * Format](https://developers.google.com/actions/dialogflow/webhook) + * <pre>{ "google": { "expectUserResponse": + * true, "richResponse": { "items": [ { + * "simpleResponse": { "textToSpeech": + * "this is a simple response" } } ] } + * } }</pre> + */ + payload: any; + /** + * Optional. This value is passed directly to `QueryResult.webhook_source`. + */ + source: string; + } /** - * Required. The name of this intent. - */ - displayName: string; + * Represents a context. + */ + export interface Schema$GoogleCloudDialogflowV2Context { + /** + * Optional. The number of conversational query requests after which the + * context expires. If set to `0` (the default) the context expires + * immediately. Contexts expire automatically after 10 minutes even if there + * are no matching queries. + */ + lifespanCount: number; + /** + * Required. The unique identifier of the context. Format: + * `projects/<Project ID>/agent/sessions/<Session + * ID>/contexts/<Context ID>`. + */ + name: string; + /** + * Optional. The collection of parameters associated with this context. + * Refer to [this doc](https://dialogflow.com/docs/actions-and-parameters) + * for syntax. + */ + parameters: any; + } /** - * Optional. The collection of event names that trigger the intent. If the - * collection of input contexts is not empty, all of the contexts must be - * present in the active user session for an event to trigger this intent. - */ - events: string[]; + * Represents an entity type. Entity types serve as a tool for extracting + * parameter values from natural language queries. + */ + export interface Schema$GoogleCloudDialogflowV2EntityType { + /** + * Optional. Indicates whether the entity type can be automatically + * expanded. + */ + autoExpansionMode: string; + /** + * Required. The name of the entity. + */ + displayName: string; + /** + * Optional. The collection of entities associated with the entity type. + */ + entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; + /** + * Required. Indicates the kind of entity type. + */ + kind: string; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of the entity type. Format: + * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. + */ + name: string; + } /** - * Optional. Collection of information about all followup intents that have - * name of this intent as a root_name. - */ - followupIntentInfo: - Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo[]; + * Optional. Represents an entity. + */ + export interface Schema$GoogleCloudDialogflowV2EntityTypeEntity { + /** + * Required. A collection of synonyms. For `KIND_LIST` entity types this + * must contain exactly one synonym equal to `value`. + */ + synonyms: string[]; + /** + * Required. For `KIND_MAP` entity types: A canonical name to be used in + * place of synonyms. For `KIND_LIST` entity types: A string that can + * contain references to other entity types (with or without aliases). + */ + value: string; + } /** - * Optional. The list of context names required for this intent to be - * triggered. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - inputContextNames: string[]; + * Events allow for matching intents by event name instead of the natural + * language input. For instance, input `<event: { name: “welcome_event”, + * parameters: { name: “Sam” } }>` can trigger a personalized welcome + * response. The parameter `name` may be used by the agent in the response: + * `“Hello #welcome_event.name! What can I do for you today?”`. + */ + export interface Schema$GoogleCloudDialogflowV2EventInput { + /** + * Required. The language of this query. See [Language + * Support](https://dialogflow.com/docs/languages) for a list of the + * currently supported language codes. Note that queries in the same session + * do not necessarily need to specify the same language. + */ + languageCode: string; + /** + * Required. The unique identifier of the event. + */ + name: string; + /** + * Optional. The collection of parameters associated with the event. + */ + parameters: any; + } /** - * Optional. Indicates whether this is a fallback intent. - */ - isFallback: boolean; + * The response message for Agents.ExportAgent. + */ + export interface Schema$GoogleCloudDialogflowV2ExportAgentResponse { + /** + * The exported agent. Example for how to export an agent to a zip file via + * a command line: curl \ + * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\ + * -X POST \ -H 'Authorization: Bearer '$(gcloud auth + * print-access-token) \ -H 'Accept: application/json' \ -H + * 'Content-Type: application/json' \ --compressed \ --data-binary + * '{}' \ | grep agentContent | sed -e + * 's/.*"agentContent": "\([^"]*\)".x/\1/' + * \ | base64 --decode > <agent zip file> + */ + agentContent: string; + /** + * The URI to a file containing the exported agent. This field is populated + * only if `agent_uri` is specified in `ExportAgentRequest`. + */ + agentUri: string; + } /** - * Optional. The collection of rich messages corresponding to the `Response` - * field in the Dialogflow console. - */ - messages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; + * Represents an intent. Intents convert a number of user expressions or + * patterns into an action. An action is an extraction of a user command or + * sentence semantics. + */ + export interface Schema$GoogleCloudDialogflowV2Intent { + /** + * Optional. The name of the action associated with the intent. + */ + action: string; + /** + * Optional. The list of platforms for which the first response will be + * taken from among the messages assigned to the DEFAULT_PLATFORM. + */ + defaultResponsePlatforms: string[]; + /** + * Required. The name of this intent. + */ + displayName: string; + /** + * Optional. The collection of event names that trigger the intent. If the + * collection of input contexts is not empty, all of the contexts must be + * present in the active user session for an event to trigger this intent. + */ + events: string[]; + /** + * Optional. Collection of information about all followup intents that have + * name of this intent as a root_name. + */ + followupIntentInfo: + Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo[]; + /** + * Optional. The list of context names required for this intent to be + * triggered. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + inputContextNames: string[]; + /** + * Optional. Indicates whether this is a fallback intent. + */ + isFallback: boolean; + /** + * Optional. The collection of rich messages corresponding to the `Response` + * field in the Dialogflow console. + */ + messages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * Optional. Indicates whether Machine Learning is disabled for the intent. + * Note: If `ml_diabled` setting is set to true, then this intent is not + * taken into account during inference in `ML ONLY` match mode. Also, + * auto-markup in the UI is turned off. + */ + mlDisabled: boolean; + /** + * Required for all methods except `create` (`create` populates the name + * automatically. The unique identifier of this intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + name: string; + /** + * Optional. The collection of contexts that are activated when the intent + * is matched. Context messages in this collection should not set the + * parameters field. Setting the `lifespan_count` to 0 will reset the + * context when the intent is matched. Format: `projects/<Project + * ID>/agent/sessions/-/contexts/<Context ID>`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Optional. The collection of parameters associated with the intent. + */ + parameters: Schema$GoogleCloudDialogflowV2IntentParameter[]; + /** + * The unique identifier of the parent intent in the chain of followup + * intents. It identifies the parent followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + /** + * Optional. The priority of this intent. Higher numbers represent higher + * priorities. Zero or negative numbers mean that the intent is disabled. + */ + priority: number; + /** + * Optional. Indicates whether to delete all contexts in the current session + * when this intent is matched. + */ + resetContexts: boolean; + /** + * The unique identifier of the root intent in the chain of followup + * intents. It identifies the correct followup intents chain for this + * intent. Format: `projects/<Project ID>/agent/intents/<Intent + * ID>`. + */ + rootFollowupIntentName: string; + /** + * Optional. The collection of examples/templates that the agent is trained + * on. + */ + trainingPhrases: Schema$GoogleCloudDialogflowV2IntentTrainingPhrase[]; + /** + * Required. Indicates whether webhooks are enabled for the intent. + */ + webhookState: string; + } /** - * Optional. Indicates whether Machine Learning is disabled for the intent. - * Note: If `ml_disabled` setting is set to true, then this intent is not - * taken into account during inference in `ML ONLY` match mode. Also, - * auto-markup in the UI is turned off. - */ - mlDisabled: boolean; + * Represents a single followup intent in the chain. + */ + export interface Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo { + /** + * The unique identifier of the followup intent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + followupIntentName: string; + /** + * The unique identifier of the followup intent parent. Format: + * `projects/<Project ID>/agent/intents/<Intent ID>`. + */ + parentFollowupIntentName: string; + } /** - * Optional. Indicates whether Machine Learning is enabled for the intent. - * Note: If `ml_enabled` setting is set to false, then this intent is not - * taken into account during inference in `ML ONLY` match mode. Also, - * auto-markup in the UI is turned off. DEPRECATED! Please use `ml_disabled` - * field instead. NOTE: If neither `ml_enabled` nor `ml_disabled` field is - * set, then the default value is determined as follows: - Before April 15th, - * 2018 the default is: ml_enabled = false / ml_disabled = true. - After - * April 15th, 2018 the default is: ml_enabled = true / ml_disabled = false. - */ - mlEnabled: boolean; + * Corresponds to the `Response` field in the Dialogflow console. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessage { + /** + * The basic card response for Actions on Google. + */ + basicCard: Schema$GoogleCloudDialogflowV2IntentMessageBasicCard; + /** + * The card response. + */ + card: Schema$GoogleCloudDialogflowV2IntentMessageCard; + /** + * The carousel card response for Actions on Google. + */ + carouselSelect: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect; + /** + * The image response. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * The link out suggestion chip for Actions on Google. + */ + linkOutSuggestion: + Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion; + /** + * The list card response for Actions on Google. + */ + listSelect: Schema$GoogleCloudDialogflowV2IntentMessageListSelect; + /** + * Returns a response containing a custom, platform-specific payload. See + * the Intent.Message.Platform type for a description of the structure that + * may be required for your platform. + */ + payload: any; + /** + * Optional. The platform that this message is intended for. + */ + platform: string; + /** + * The quick replies response. + */ + quickReplies: Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies; + /** + * The voice and text-only responses for Actions on Google. + */ + simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses; + /** + * The suggestion chips for Actions on Google. + */ + suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestions; + /** + * The text response. + */ + text: Schema$GoogleCloudDialogflowV2IntentMessageText; + } /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - name: string; + * The basic card message. Useful for displaying information. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton[]; + /** + * Required, unless image is present. The body text of the card. + */ + formattedText: string; + /** + * Optional. The image for the card. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Optional. The collection of contexts that are activated when the intent is - * matched. Context messages in this collection should not set the parameters - * field. Setting the `lifespan_count` to 0 will reset the context when the - * intent is matched. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; + * The button object that appears at the bottom of a card. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton { + /** + * Required. Action to take when a user taps on the button. + */ + openUriAction: + Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction; + /** + * Required. The title of the button. + */ + title: string; + } /** - * Optional. The collection of parameters associated with the intent. + * Opens the given URI. */ - parameters: Schema$GoogleCloudDialogflowV2beta1IntentParameter[]; + export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { + /** + * Required. The HTTP or HTTPS scheme URI. + */ + uri: string; + } /** - * The unique identifier of the parent intent in the chain of followup - * intents. It identifies the parent followup intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; + * The card response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCard { + /** + * Optional. The collection of card buttons. + */ + buttons: Schema$GoogleCloudDialogflowV2IntentMessageCardButton[]; + /** + * Optional. The public URI to an image file for the card. + */ + imageUri: string; + /** + * Optional. The subtitle of the card. + */ + subtitle: string; + /** + * Optional. The title of the card. + */ + title: string; + } /** - * Optional. The priority of this intent. Higher numbers represent higher - * priorities. Zero or negative numbers mean that the intent is disabled. - */ - priority: number; + * Optional. Contains information about a button. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCardButton { + /** + * Optional. The text to send back to the Dialogflow API or a URI to open. + */ + postback: string; + /** + * Optional. The text to show on the button. + */ + text: string; + } /** - * Optional. Indicates whether to delete all contexts in the current session - * when this intent is matched. + * The card for presenting a carousel of options to select from. */ - resetContexts: boolean; + export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect { + /** + * Required. Carousel items. + */ + items: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem[]; + } /** - * The unique identifier of the root intent in the chain of followup intents. - * It identifies the correct followup intents chain for this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - rootFollowupIntentName: string; + * An item in the carousel. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { + /** + * Optional. The body text of the card. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Required. Additional info about the option item. + */ + info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; + /** + * Required. Title of the carousel item. + */ + title: string; + } /** - * Optional. The collection of examples/templates that the agent is trained - * on. - */ - trainingPhrases: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase[]; + * The image response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageImage { + /** + * Optional. A text description of the image to be used for accessibility, + * e.g., screen readers. + */ + accessibilityText: string; + /** + * Optional. The public URI to an image file. + */ + imageUri: string; + } /** - * Required. Indicates whether webhooks are enabled for the intent. - */ - webhookState: string; -} -/** - * This message is a wrapper around a collection of intents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentBatch { + * The suggestion chip message that allows the user to jump out to the app or + * website associated with this agent. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { + /** + * Required. The name of the app or site this chip is linking to. + */ + destinationName: string; + /** + * Required. The URI of the app or site to open when the user taps the + * suggestion chip. + */ + uri: string; + } /** - * A collection of intents. - */ - intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; -} -/** - * Represents a single followup intent in the chain. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentFollowupIntentInfo { + * The card for presenting a list of options to select from. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelect { + /** + * Required. List items. + */ + items: Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem[]; + /** + * Optional. The overall title of the list. + */ + title: string; + } /** - * The unique identifier of the followup intent. Format: `projects/<Project - * ID>/agent/intents/<Intent ID>`. - */ - followupIntentName: string; + * An item in the list. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem { + /** + * Optional. The main text describing the item. + */ + description: string; + /** + * Optional. The image to display. + */ + image: Schema$GoogleCloudDialogflowV2IntentMessageImage; + /** + * Required. Additional information about this option. + */ + info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; + /** + * Required. The title of the list item. + */ + title: string; + } /** - * The unique identifier of the followup intent parent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; -} -/** - * Corresponds to the `Response` field in the Dialogflow console. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessage { + * The quick replies response message. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies { + /** + * Optional. The collection of quick replies. + */ + quickReplies: string[]; + /** + * Optional. The title of the collection of quick replies. + */ + title: string; + } /** - * Displays a basic card for Actions on Google. - */ - basicCard: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard; + * Additional info about the select item for when it is triggered in a dialog. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo { + /** + * Required. A unique key that will be sent back to the agent if this + * response is given. + */ + key: string; + /** + * Optional. A list of synonyms that can also be used to trigger this item + * in dialog. + */ + synonyms: string[]; + } /** - * Displays a card. - */ - card: Schema$GoogleCloudDialogflowV2beta1IntentMessageCard; + * The simple response message containing speech or text. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse { + /** + * Optional. The text to display. + */ + displayText: string; + /** + * One of text_to_speech or ssml must be provided. Structured spoken + * response to the user in the SSML format. Mutually exclusive with + * text_to_speech. + */ + ssml: string; + /** + * One of text_to_speech or ssml must be provided. The plain text of the + * speech output. Mutually exclusive with ssml. + */ + textToSpeech: string; + } /** - * Displays a carousel card for Actions on Google. - */ - carouselSelect: - Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect; + * The collection of simple response candidates. This message in + * `QueryResult.fulfillment_messages` and + * `WebhookResponse.fulfillment_messages` should contain only one + * `SimpleResponse`. + */ + export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses { + /** + * Required. The list of simple responses. + */ + simpleResponses: + Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse[]; + } /** - * Displays an image. + * The suggestion chip message that the user can tap to quickly post a reply + * to the conversation. */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; + export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestion { + /** + * Required. The text shown the in the suggestion chip. + */ + title: string; + } /** - * Displays a link out suggestion chip for Actions on Google. + * The collection of suggestions. */ - linkOutSuggestion: - Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion; + export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestions { + /** + * Required. The list of suggested replies. + */ + suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestion[]; + } /** - * Displays a list card for Actions on Google. + * The text response message. */ - listSelect: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect; + export interface Schema$GoogleCloudDialogflowV2IntentMessageText { + /** + * Optional. The collection of the agent's responses. + */ + text: string[]; + } /** - * Returns a response containing a custom, platform-specific payload. See the - * Intent.Message.Platform type for a description of the structure that may be - * required for your platform. - */ - payload: any; + * Represents intent parameters. + */ + export interface Schema$GoogleCloudDialogflowV2IntentParameter { + /** + * Optional. The default value to use when the `value` yields an empty + * result. Default values can be extracted from contexts by using the + * following syntax: `#context_name.parameter_name`. + */ + defaultValue: string; + /** + * Required. The name of the parameter. + */ + displayName: string; + /** + * Optional. The name of the entity type, prefixed with `@`, that describes + * values of the parameter. If the parameter is required, this must be + * provided. + */ + entityTypeDisplayName: string; + /** + * Optional. Indicates whether the parameter represents a list of values. + */ + isList: boolean; + /** + * Optional. Indicates whether the parameter is required. That is, whether + * the intent cannot be completed without collecting the parameter value. + */ + mandatory: boolean; + /** + * The unique identifier of this parameter. + */ + name: string; + /** + * Optional. The collection of prompts that the agent can present to the + * user in order to collect value for the parameter. + */ + prompts: string[]; + /** + * Optional. The definition of the parameter value. It can be: - a constant + * string, - a parameter value defined as `$parameter_name`, - an original + * parameter value defined as `$parameter_name.original`, - a parameter + * value from some context defined as `#context_name.parameter_name`. + */ + value: string; + } /** - * Optional. The platform that this message is intended for. - */ - platform: string; + * Represents an example or template that the agent is trained on. + */ + export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrase { + /** + * Required. The unique identifier of this training phrase. + */ + name: string; + /** + * Required. The collection of training phrase parts (can be annotated). + * Fields: `entity_type`, `alias` and `user_defined` should be populated + * only for the annotated parts of the training phrase. + */ + parts: Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart[]; + /** + * Optional. Indicates how many times this example or template was added to + * the intent. Each time a developer adds an existing sample by editing an + * intent or training, this counter is increased. + */ + timesAddedCount: number; + /** + * Required. The type of the training phrase. + */ + type: string; + } /** - * Displays quick replies. - */ - quickReplies: Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies; - /** - * Returns a voice or text-only response for Actions on Google. - */ - simpleResponses: - Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses; - /** - * Displays suggestion chips for Actions on Google. - */ - suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions; - /** - * Returns a text response. - */ - text: Schema$GoogleCloudDialogflowV2beta1IntentMessageText; -} -/** - * The basic card message. Useful for displaying information. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton[]; - /** - * Required, unless image is present. The body text of the card. - */ - formattedText: string; - /** - * Optional. The image for the card. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * The button object that appears at the bottom of a card. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButton { - /** - * Required. Action to take when a user taps on the button. - */ - openUriAction: - Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction; - /** - * Required. The title of the button. - */ - title: string; -} -/** - * Opens the given URI. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageBasicCardButtonOpenUriAction { - /** - * Required. The HTTP or HTTPS scheme URI. - */ - uri: string; -} -/** - * The card response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton[]; - /** - * Optional. The public URI to an image file for the card. - */ - imageUri: string; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * Optional. Contains information about a button. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCardButton { - /** - * Optional. The text to send back to the Dialogflow API or a URI to open. - */ - postback: string; - /** - * Optional. The text to show on the button. - */ - text: string; -} -/** - * The card for presenting a carousel of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelect { - /** - * Required. Carousel items. - */ - items: Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem[]; -} -/** - * An item in the carousel. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageCarouselSelectItem { - /** - * Optional. The body text of the card. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; - /** - * Required. Additional info about the option item. - */ - info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; - /** - * Required. Title of the carousel item. - */ - title: string; -} -/** - * The image response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageImage { - /** - * Optional. A text description of the image to be used for accessibility, - * e.g., screen readers. - */ - accessibilityText: string; - /** - * Optional. The public URI to an image file. - */ - imageUri: string; -} -/** - * The suggestion chip message that allows the user to jump out to the app or - * website associated with this agent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageLinkOutSuggestion { - /** - * Required. The name of the app or site this chip is linking to. - */ - destinationName: string; - /** - * Required. The URI of the app or site to open when the user taps the - * suggestion chip. - */ - uri: string; -} -/** - * The card for presenting a list of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelect { - /** - * Required. List items. - */ - items: Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem[]; - /** - * Optional. The overall title of the list. - */ - title: string; -} -/** - * An item in the list. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageListSelectItem { - /** - * Optional. The main text describing the item. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2beta1IntentMessageImage; - /** - * Required. Additional information about this option. - */ - info: Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo; - /** - * Required. The title of the list item. - */ - title: string; -} -/** - * The quick replies response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageQuickReplies { - /** - * Optional. The collection of quick replies. - */ - quickReplies: string[]; - /** - * Optional. The title of the collection of quick replies. - */ - title: string; -} -/** - * Additional info about the select item for when it is triggered in a dialog. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSelectItemInfo { - /** - * Required. A unique key that will be sent back to the agent if this response - * is given. - */ - key: string; - /** - * Optional. A list of synonyms that can also be used to trigger this item in - * dialog. - */ - synonyms: string[]; -} -/** - * The simple response message containing speech or text. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse { - /** - * Optional. The text to display. - */ - displayText: string; - /** - * One of text_to_speech or ssml must be provided. Structured spoken response - * to the user in the SSML format. Mutually exclusive with text_to_speech. - */ - ssml: string; - /** - * One of text_to_speech or ssml must be provided. The plain text of the - * speech output. Mutually exclusive with ssml. - */ - textToSpeech: string; -} -/** - * The collection of simple response candidates. This message in - * `QueryResult.fulfillment_messages` and `WebhookResponse.fulfillment_messages` - * should contain only one `SimpleResponse`. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponses { - /** - * Required. The list of simple responses. - */ - simpleResponses: - Schema$GoogleCloudDialogflowV2beta1IntentMessageSimpleResponse[]; -} -/** - * The suggestion chip message that the user can tap to quickly post a reply to - * the conversation. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion { - /** - * Required. The text shown the in the suggestion chip. - */ - title: string; -} -/** - * The collection of suggestions. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestions { - /** - * Required. The list of suggested replies. - */ - suggestions: Schema$GoogleCloudDialogflowV2beta1IntentMessageSuggestion[]; -} -/** - * The text response message. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentMessageText { - /** - * Optional. The collection of the agent's responses. - */ - text: string[]; -} -/** - * Represents intent parameters. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentParameter { - /** - * Optional. The default value to use when the `value` yields an empty result. - * Default values can be extracted from contexts by using the following - * syntax: `#context_name.parameter_name`. - */ - defaultValue: string; - /** - * Required. The name of the parameter. - */ - displayName: string; - /** - * Optional. The name of the entity type, prefixed with `@`, that describes - * values of the parameter. If the parameter is required, this must be - * provided. - */ - entityTypeDisplayName: string; - /** - * Optional. Indicates whether the parameter represents a list of values. - */ - isList: boolean; - /** - * Optional. Indicates whether the parameter is required. That is, whether the - * intent cannot be completed without collecting the parameter value. - */ - mandatory: boolean; - /** - * The unique identifier of this parameter. - */ - name: string; - /** - * Optional. The collection of prompts that the agent can present to the user - * in order to collect value for the parameter. - */ - prompts: string[]; - /** - * Optional. The definition of the parameter value. It can be: - a constant - * string, - a parameter value defined as `$parameter_name`, - an original - * parameter value defined as `$parameter_name.original`, - a parameter value - * from some context defined as `#context_name.parameter_name`. - */ - value: string; -} -/** - * Represents an example or template that the agent is trained on. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrase { - /** - * Required. The unique identifier of this training phrase. - */ - name: string; - /** - * Required. The collection of training phrase parts (can be annotated). - * Fields: `entity_type`, `alias` and `user_defined` should be populated only - * for the annotated parts of the training phrase. - */ - parts: Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart[]; - /** - * Optional. Indicates how many times this example or template was added to - * the intent. Each time a developer adds an existing sample by editing an - * intent or training, this counter is increased. - */ - timesAddedCount: number; - /** - * Required. The type of the training phrase. - */ - type: string; -} -/** - * Represents a part of a training phrase. - */ -export interface Schema$GoogleCloudDialogflowV2beta1IntentTrainingPhrasePart { - /** - * Optional. The parameter name for the value extracted from the annotated - * part of the example. - */ - alias: string; - /** - * Optional. The entity type name prefixed with `@`. This field is required - * for the annotated part of the text and applies only to examples. - */ - entityType: string; - /** - * Required. The text corresponding to the example or template, if there are - * no annotations. For annotated examples, it is the text for one of the - * example's parts. - */ - text: string; - /** - * Optional. Indicates whether the text was manually annotated by the - * developer. - */ - userDefined: boolean; -} -/** - * Metadata in google::longrunning::Operation for Knowledge operations. - */ -export interface Schema$GoogleCloudDialogflowV2beta1KnowledgeOperationMetadata { - /** - * Required. The current state of this operation. - */ - state: string; -} -/** - * The response message for Contexts.ListContexts. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ListContextsResponse { - /** - * The list of contexts. There will be a maximum number of items returned - * based on the page_size field in the request. - */ - contexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for EntityTypes.ListEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse { - /** - * The list of agent entity types. There will be a maximum number of items - * returned based on the page_size field in the request. - */ - entityTypes: Schema$GoogleCloudDialogflowV2beta1EntityType[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for Intents.ListIntents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse { - /** - * The list of agent intents. There will be a maximum number of items returned - * based on the page_size field in the request. - */ - intents: Schema$GoogleCloudDialogflowV2beta1Intent[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * The response message for SessionEntityTypes.ListSessionEntityTypes. - */ -export interface Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse { - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; - /** - * The list of session entity types. There will be a maximum number of items - * returned based on the page_size field in the request. - */ - sessionEntityTypes: Schema$GoogleCloudDialogflowV2beta1SessionEntityType[]; -} -/** - * Represents the contents of the original request that was passed to the - * `[Streaming]DetectIntent` call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest { - /** - * Optional. This field is set to the value of `QueryParameters.payload` field - * passed in the request. - */ - payload: any; - /** - * The source of this request, e.g., `google`, `facebook`, `slack`. It is set - * by Dialogflow-owned servers. - */ - source: string; -} -/** - * Represents the query input. It can contain either: 1. An audio config which - * instructs the speech recognizer how to process the speech audio. 2. A - * conversational query in the form of text,. 3. An event that specifies which - * intent to trigger. - */ -export interface Schema$GoogleCloudDialogflowV2beta1QueryInput { - /** - * Instructs the speech recognizer how to process the speech audio. - */ - audioConfig: Schema$GoogleCloudDialogflowV2beta1InputAudioConfig; - /** - * The event to be processed. - */ - event: Schema$GoogleCloudDialogflowV2beta1EventInput; - /** - * The natural language text to be processed. - */ - text: Schema$GoogleCloudDialogflowV2beta1TextInput; -} -/** - * Represents the parameters of the conversational query. - */ -export interface Schema$GoogleCloudDialogflowV2beta1QueryParameters { - /** - * Optional. The collection of contexts to be activated before this query is - * executed. - */ - contexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * Optional. The geo location of this conversational query. - */ - geoLocation: Schema$GoogleTypeLatLng; - /** - * Optional. This field can be used to pass custom data into the webhook - * associated with the agent. Arbitrary JSON objects are supported. - */ - payload: any; - /** - * Optional. Specifies whether to delete all contexts in the current session - * before the new ones are activated. - */ - resetContexts: boolean; - /** - * Optional. The collection of session entity types to replace or extend - * developer entities with for this query only. The entity synonyms apply to - * all languages. - */ - sessionEntityTypes: Schema$GoogleCloudDialogflowV2beta1SessionEntityType[]; - /** - * Optional. The time zone of this conversational query from the [time zone - * database](https://www.iana.org/time-zones), e.g., America/New_York, - * Europe/Paris. If not provided, the time zone specified in agent settings is - * used. - */ - timeZone: string; -} -/** - * Represents the result of conversational query or event processing. - */ -export interface Schema$GoogleCloudDialogflowV2beta1QueryResult { - /** - * The action name from the matched intent. - */ - action: string; - /** - * This field is set to: - `false` if the matched intent has required - * parameters and not all of the required parameter values have been - * collected. - `true` if all required parameter values have been collected, - * or if the matched intent doesn't contain any required parameters. - */ - allRequiredParamsPresent: boolean; - /** - * The free-form diagnostic info. For example, this field could contain - * webhook call latency. - */ - diagnosticInfo: any; - /** - * The collection of rich messages to present to the user. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; - /** - * The text to be pronounced to the user or shown on the screen. - */ - fulfillmentText: string; - /** - * The intent that matched the conversational query. Some, not all fields are - * filled in this message, including but not limited to: `name`, - * `display_name` and `webhook_state`. - */ - intent: Schema$GoogleCloudDialogflowV2beta1Intent; - /** - * The intent detection confidence. Values range from 0.0 (completely - * uncertain) to 1.0 (completely certain). - */ - intentDetectionConfidence: number; - /** - * The language that was triggered during intent detection. See [Language - * Support](https://dialogflow.com/docs/reference/language) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * The collection of output contexts. If applicable, - * `output_contexts.parameters` contains entries with name `<parameter - * name>.original` containing the original parameter values before the - * query. - */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * The collection of extracted parameters. - */ - parameters: any; - /** - * The original conversational query text: - If natural language text was - * provided as input, `query_text` contains a copy of the input. - If - * natural language speech audio was provided as input, `query_text` contains - * the speech recognition result. If speech recognizer produced multiple - * alternatives, a particular one is picked. - If an event was provided as - * input, `query_text` is not set. - */ - queryText: string; - /** - * The Speech recognition confidence between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. The default of 0.0 is a sentinel value indicating that confidence - * was not set. You should not rely on this field as it isn't guaranteed - * to be accurate, or even set. In particular this field isn't set in - * Webhook calls and for StreamingDetectIntent since the streaming endpoint - * has separate confidence estimates per portion of the audio in - * StreamingRecognitionResult. - */ - speechRecognitionConfidence: number; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `payload` field returned in the webhook response. - */ - webhookPayload: any; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `source` field returned in the webhook response. - */ - webhookSource: string; -} -/** - * The request message for Agents.RestoreAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1RestoreAgentRequest { - /** - * The agent to restore. Example for how to restore an agent via the command - * line: curl \ - * 'https://dialogflow.googleapis.com/v2beta1/projects/<project_name>/agent:restore\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * "{ 'agentContent': '$(cat <agent zip file> | - * base64 -w 0)' }" \ - */ - agentContent: string; - /** - * The URI to a Google Cloud Storage file containing the agent to restore. - * Note: The URI must start with "gs://". - */ - agentUri: string; -} -/** - * The response message for Agents.SearchAgents. - */ -export interface Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse { - /** - * The list of agents. There will be a maximum number of items returned based - * on the page_size field in the request. - */ - agents: Schema$GoogleCloudDialogflowV2beta1Agent[]; - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; -} -/** - * Represents a session entity type. Extends or replaces a developer entity - * type at the user session level (we refer to the entity types defined at the - * agent level as "developer entity types"). Note: session entity - * types apply to all queries, regardless of the language. - */ -export interface Schema$GoogleCloudDialogflowV2beta1SessionEntityType { - /** - * Required. The collection of entities associated with this session entity - * type. - */ - entities: Schema$GoogleCloudDialogflowV2beta1EntityTypeEntity[]; - /** - * Required. Indicates whether the additional data should override or - * supplement the developer entity type definition. - */ - entityOverrideMode: string; - /** - * Required. The unique identifier of this session entity type. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/entityTypes/<Entity Type Display Name>`, or - * `projects/<Project ID>/agent/environments/<Environment - * ID>/users/<User ID>/sessions /<Session - * ID>/entityTypes/<Entity Type Display Name>`. Note: Environments - * and users are under construction and will be available soon. If - * <Environment ID> is not specified, we assume default 'draft' - * environment. If <User ID> is not specified, we assume default - * '-' user. - */ - name: string; -} -/** - * Represents the natural language text to be processed. - */ -export interface Schema$GoogleCloudDialogflowV2beta1TextInput { - /** - * Required. The language of this conversational query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. - */ - languageCode: string; - /** - * Required. The UTF-8 encoded natural language text to be processed. Text - * length must not exceed 256 bytes. - */ - text: string; -} -/** - * The request message for Agents.TrainAgent. - */ -export interface Schema$GoogleCloudDialogflowV2beta1TrainAgentRequest {} -/** - * The request message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1WebhookRequest { - /** - * Optional. The contents of the original request that was passed to - * `[Streaming]DetectIntent` call. - */ - originalDetectIntentRequest: - Schema$GoogleCloudDialogflowV2beta1OriginalDetectIntentRequest; - /** - * The result of the conversational query or event processing. Contains the - * same value as `[Streaming]DetectIntentResponse.query_result`. - */ - queryResult: Schema$GoogleCloudDialogflowV2beta1QueryResult; - /** - * The unique identifier of the response. Contains the same value as - * `[Streaming]DetectIntentResponse.response_id`. - */ - responseId: string; - /** - * The unique identifier of detectIntent request session. Can be used to - * identify end-user inside webhook implementation. Format: - * `projects/<Project ID>/agent/sessions/<Session ID>`. - */ - session: string; -} -/** - * The response message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2beta1WebhookResponse { - /** - * Optional. Makes the platform immediately invoke another `DetectIntent` call - * internally with the specified event as input. - */ - followupEventInput: Schema$GoogleCloudDialogflowV2beta1EventInput; - /** - * Optional. The collection of rich messages to present to the user. This - * value is passed directly to `QueryResult.fulfillment_messages`. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2beta1IntentMessage[]; - /** - * Optional. The text to be shown on the screen. This value is passed directly - * to `QueryResult.fulfillment_text`. - */ - fulfillmentText: string; - /** - * Optional. The collection of output contexts. This value is passed directly - * to `QueryResult.output_contexts`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2beta1Context[]; - /** - * Optional. This value is passed directly to `QueryResult.webhook_payload`. - * See the related `fulfillment_messages[i].payload field`, which may be used - * as an alternative to this field. This field can be used for Actions on - * Google responses. It should have a structure similar to the JSON message - * shown here. For more information, see [Actions on Google Webhook - * Format](https://developers.google.com/actions/dialogflow/webhook) - * <pre>{ "google": { "expectUserResponse": - * true, "richResponse": { "items": [ { - * "simpleResponse": { "textToSpeech": - * "this is a simple response" } } ] } - * } }</pre> - */ - payload: any; - /** - * Optional. This value is passed directly to `QueryResult.webhook_source`. - */ - source: string; -} -/** - * Represents a context. - */ -export interface Schema$GoogleCloudDialogflowV2Context { - /** - * Optional. The number of conversational query requests after which the - * context expires. If set to `0` (the default) the context expires - * immediately. Contexts expire automatically after 10 minutes even if there - * are no matching queries. - */ - lifespanCount: number; - /** - * Required. The unique identifier of the context. Format: - * `projects/<Project ID>/agent/sessions/<Session - * ID>/contexts/<Context ID>`. - */ - name: string; - /** - * Optional. The collection of parameters associated with this context. Refer - * to [this doc](https://dialogflow.com/docs/actions-and-parameters) for - * syntax. - */ - parameters: any; -} -/** - * Represents an entity type. Entity types serve as a tool for extracting - * parameter values from natural language queries. - */ -export interface Schema$GoogleCloudDialogflowV2EntityType { - /** - * Optional. Indicates whether the entity type can be automatically expanded. - */ - autoExpansionMode: string; - /** - * Required. The name of the entity. - */ - displayName: string; - /** - * Optional. The collection of entities associated with the entity type. - */ - entities: Schema$GoogleCloudDialogflowV2EntityTypeEntity[]; - /** - * Required. Indicates the kind of entity type. - */ - kind: string; - /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of the entity type. Format: - * `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`. - */ - name: string; -} -/** - * Optional. Represents an entity. - */ -export interface Schema$GoogleCloudDialogflowV2EntityTypeEntity { - /** - * Required. A collection of synonyms. For `KIND_LIST` entity types this must - * contain exactly one synonym equal to `value`. - */ - synonyms: string[]; - /** - * Required. For `KIND_MAP` entity types: A canonical name to be used in - * place of synonyms. For `KIND_LIST` entity types: A string that can - * contain references to other entity types (with or without aliases). - */ - value: string; -} -/** - * Events allow for matching intents by event name instead of the natural - * language input. For instance, input `<event: { name: “welcome_event”, - * parameters: { name: “Sam” } }>` can trigger a personalized welcome - * response. The parameter `name` may be used by the agent in the response: - * `“Hello #welcome_event.name! What can I do for you today?”`. - */ -export interface Schema$GoogleCloudDialogflowV2EventInput { - /** - * Required. The language of this query. See [Language - * Support](https://dialogflow.com/docs/languages) for a list of the currently - * supported language codes. Note that queries in the same session do not - * necessarily need to specify the same language. - */ - languageCode: string; - /** - * Required. The unique identifier of the event. - */ - name: string; - /** - * Optional. The collection of parameters associated with the event. - */ - parameters: any; -} -/** - * The response message for Agents.ExportAgent. - */ -export interface Schema$GoogleCloudDialogflowV2ExportAgentResponse { - /** - * The exported agent. Example for how to export an agent to a zip file via a - * command line: curl \ - * 'https://dialogflow.googleapis.com/v2/projects/<project_name>/agent:export'\ - * -X POST \ -H 'Authorization: Bearer '$(gcloud auth - * print-access-token) \ -H 'Accept: application/json' \ -H - * 'Content-Type: application/json' \ --compressed \ --data-binary - * '{}' \ | grep agentContent | sed -e - * 's/.*"agentContent": "\([^"]*\)".x/\1/' \ - * | base64 --decode > <agent zip file> - */ - agentContent: string; - /** - * The URI to a file containing the exported agent. This field is populated - * only if `agent_uri` is specified in `ExportAgentRequest`. - */ - agentUri: string; -} -/** - * Represents an intent. Intents convert a number of user expressions or - * patterns into an action. An action is an extraction of a user command or - * sentence semantics. - */ -export interface Schema$GoogleCloudDialogflowV2Intent { - /** - * Optional. The name of the action associated with the intent. - */ - action: string; - /** - * Optional. The list of platforms for which the first response will be taken - * from among the messages assigned to the DEFAULT_PLATFORM. - */ - defaultResponsePlatforms: string[]; - /** - * Required. The name of this intent. - */ - displayName: string; - /** - * Optional. The collection of event names that trigger the intent. If the - * collection of input contexts is not empty, all of the contexts must be - * present in the active user session for an event to trigger this intent. - */ - events: string[]; - /** - * Optional. Collection of information about all followup intents that have - * name of this intent as a root_name. - */ - followupIntentInfo: Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo[]; - /** - * Optional. The list of context names required for this intent to be - * triggered. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - inputContextNames: string[]; - /** - * Optional. Indicates whether this is a fallback intent. - */ - isFallback: boolean; - /** - * Optional. The collection of rich messages corresponding to the `Response` - * field in the Dialogflow console. - */ - messages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * Optional. Indicates whether Machine Learning is disabled for the intent. - * Note: If `ml_diabled` setting is set to true, then this intent is not taken - * into account during inference in `ML ONLY` match mode. Also, auto-markup in - * the UI is turned off. - */ - mlDisabled: boolean; - /** - * Required for all methods except `create` (`create` populates the name - * automatically. The unique identifier of this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - name: string; - /** - * Optional. The collection of contexts that are activated when the intent is - * matched. Context messages in this collection should not set the parameters - * field. Setting the `lifespan_count` to 0 will reset the context when the - * intent is matched. Format: `projects/<Project - * ID>/agent/sessions/-/contexts/<Context ID>`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Optional. The collection of parameters associated with the intent. - */ - parameters: Schema$GoogleCloudDialogflowV2IntentParameter[]; - /** - * The unique identifier of the parent intent in the chain of followup - * intents. It identifies the parent followup intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; - /** - * Optional. The priority of this intent. Higher numbers represent higher - * priorities. Zero or negative numbers mean that the intent is disabled. - */ - priority: number; - /** - * Optional. Indicates whether to delete all contexts in the current session - * when this intent is matched. - */ - resetContexts: boolean; - /** - * The unique identifier of the root intent in the chain of followup intents. - * It identifies the correct followup intents chain for this intent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - rootFollowupIntentName: string; - /** - * Optional. The collection of examples/templates that the agent is trained - * on. - */ - trainingPhrases: Schema$GoogleCloudDialogflowV2IntentTrainingPhrase[]; - /** - * Required. Indicates whether webhooks are enabled for the intent. - */ - webhookState: string; -} -/** - * Represents a single followup intent in the chain. - */ -export interface Schema$GoogleCloudDialogflowV2IntentFollowupIntentInfo { - /** - * The unique identifier of the followup intent. Format: `projects/<Project - * ID>/agent/intents/<Intent ID>`. - */ - followupIntentName: string; - /** - * The unique identifier of the followup intent parent. Format: - * `projects/<Project ID>/agent/intents/<Intent ID>`. - */ - parentFollowupIntentName: string; -} -/** - * Corresponds to the `Response` field in the Dialogflow console. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessage { - /** - * The basic card response for Actions on Google. - */ - basicCard: Schema$GoogleCloudDialogflowV2IntentMessageBasicCard; - /** - * The card response. - */ - card: Schema$GoogleCloudDialogflowV2IntentMessageCard; - /** - * The carousel card response for Actions on Google. - */ - carouselSelect: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect; - /** - * The image response. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * The link out suggestion chip for Actions on Google. - */ - linkOutSuggestion: - Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion; - /** - * The list card response for Actions on Google. - */ - listSelect: Schema$GoogleCloudDialogflowV2IntentMessageListSelect; - /** - * Returns a response containing a custom, platform-specific payload. See the - * Intent.Message.Platform type for a description of the structure that may be - * required for your platform. - */ - payload: any; - /** - * Optional. The platform that this message is intended for. - */ - platform: string; - /** - * The quick replies response. - */ - quickReplies: Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies; - /** - * The voice and text-only responses for Actions on Google. - */ - simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses; - /** - * The suggestion chips for Actions on Google. - */ - suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestions; - /** - * The text response. - */ - text: Schema$GoogleCloudDialogflowV2IntentMessageText; -} -/** - * The basic card message. Useful for displaying information. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton[]; - /** - * Required, unless image is present. The body text of the card. - */ - formattedText: string; - /** - * Optional. The image for the card. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * The button object that appears at the bottom of a card. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButton { - /** - * Required. Action to take when a user taps on the button. - */ - openUriAction: - Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction; - /** - * Required. The title of the button. - */ - title: string; -} -/** - * Opens the given URI. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageBasicCardButtonOpenUriAction { - /** - * Required. The HTTP or HTTPS scheme URI. - */ - uri: string; -} -/** - * The card response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCard { - /** - * Optional. The collection of card buttons. - */ - buttons: Schema$GoogleCloudDialogflowV2IntentMessageCardButton[]; - /** - * Optional. The public URI to an image file for the card. - */ - imageUri: string; - /** - * Optional. The subtitle of the card. - */ - subtitle: string; - /** - * Optional. The title of the card. - */ - title: string; -} -/** - * Optional. Contains information about a button. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCardButton { - /** - * Optional. The text to send back to the Dialogflow API or a URI to open. - */ - postback: string; - /** - * Optional. The text to show on the button. - */ - text: string; -} -/** - * The card for presenting a carousel of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelect { - /** - * Required. Carousel items. - */ - items: Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem[]; -} -/** - * An item in the carousel. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageCarouselSelectItem { - /** - * Optional. The body text of the card. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Required. Additional info about the option item. - */ - info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; - /** - * Required. Title of the carousel item. - */ - title: string; -} -/** - * The image response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageImage { - /** - * Optional. A text description of the image to be used for accessibility, - * e.g., screen readers. - */ - accessibilityText: string; - /** - * Optional. The public URI to an image file. - */ - imageUri: string; -} -/** - * The suggestion chip message that allows the user to jump out to the app or - * website associated with this agent. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageLinkOutSuggestion { - /** - * Required. The name of the app or site this chip is linking to. - */ - destinationName: string; - /** - * Required. The URI of the app or site to open when the user taps the - * suggestion chip. - */ - uri: string; -} -/** - * The card for presenting a list of options to select from. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelect { - /** - * Required. List items. - */ - items: Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem[]; - /** - * Optional. The overall title of the list. - */ - title: string; -} -/** - * An item in the list. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageListSelectItem { - /** - * Optional. The main text describing the item. - */ - description: string; - /** - * Optional. The image to display. - */ - image: Schema$GoogleCloudDialogflowV2IntentMessageImage; - /** - * Required. Additional information about this option. - */ - info: Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo; - /** - * Required. The title of the list item. - */ - title: string; -} -/** - * The quick replies response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageQuickReplies { - /** - * Optional. The collection of quick replies. - */ - quickReplies: string[]; - /** - * Optional. The title of the collection of quick replies. - */ - title: string; -} -/** - * Additional info about the select item for when it is triggered in a dialog. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSelectItemInfo { - /** - * Required. A unique key that will be sent back to the agent if this response - * is given. - */ - key: string; - /** - * Optional. A list of synonyms that can also be used to trigger this item in - * dialog. - */ - synonyms: string[]; -} -/** - * The simple response message containing speech or text. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse { - /** - * Optional. The text to display. - */ - displayText: string; - /** - * One of text_to_speech or ssml must be provided. Structured spoken response - * to the user in the SSML format. Mutually exclusive with text_to_speech. - */ - ssml: string; - /** - * One of text_to_speech or ssml must be provided. The plain text of the - * speech output. Mutually exclusive with ssml. - */ - textToSpeech: string; -} -/** - * The collection of simple response candidates. This message in - * `QueryResult.fulfillment_messages` and `WebhookResponse.fulfillment_messages` - * should contain only one `SimpleResponse`. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponses { - /** - * Required. The list of simple responses. - */ - simpleResponses: Schema$GoogleCloudDialogflowV2IntentMessageSimpleResponse[]; -} -/** - * The suggestion chip message that the user can tap to quickly post a reply to - * the conversation. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestion { - /** - * Required. The text shown the in the suggestion chip. - */ - title: string; -} -/** - * The collection of suggestions. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageSuggestions { - /** - * Required. The list of suggested replies. - */ - suggestions: Schema$GoogleCloudDialogflowV2IntentMessageSuggestion[]; -} -/** - * The text response message. - */ -export interface Schema$GoogleCloudDialogflowV2IntentMessageText { - /** - * Optional. The collection of the agent's responses. - */ - text: string[]; -} -/** - * Represents intent parameters. - */ -export interface Schema$GoogleCloudDialogflowV2IntentParameter { - /** - * Optional. The default value to use when the `value` yields an empty result. - * Default values can be extracted from contexts by using the following - * syntax: `#context_name.parameter_name`. - */ - defaultValue: string; - /** - * Required. The name of the parameter. - */ - displayName: string; - /** - * Optional. The name of the entity type, prefixed with `@`, that describes - * values of the parameter. If the parameter is required, this must be - * provided. - */ - entityTypeDisplayName: string; - /** - * Optional. Indicates whether the parameter represents a list of values. - */ - isList: boolean; - /** - * Optional. Indicates whether the parameter is required. That is, whether the - * intent cannot be completed without collecting the parameter value. - */ - mandatory: boolean; - /** - * The unique identifier of this parameter. - */ - name: string; - /** - * Optional. The collection of prompts that the agent can present to the user - * in order to collect value for the parameter. - */ - prompts: string[]; - /** - * Optional. The definition of the parameter value. It can be: - a constant - * string, - a parameter value defined as `$parameter_name`, - an original - * parameter value defined as `$parameter_name.original`, - a parameter value - * from some context defined as `#context_name.parameter_name`. - */ - value: string; -} -/** - * Represents an example or template that the agent is trained on. - */ -export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrase { - /** - * Required. The unique identifier of this training phrase. - */ - name: string; - /** - * Required. The collection of training phrase parts (can be annotated). - * Fields: `entity_type`, `alias` and `user_defined` should be populated only - * for the annotated parts of the training phrase. - */ - parts: Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart[]; - /** - * Optional. Indicates how many times this example or template was added to - * the intent. Each time a developer adds an existing sample by editing an - * intent or training, this counter is increased. - */ - timesAddedCount: number; - /** - * Required. The type of the training phrase. - */ - type: string; -} -/** - * Represents a part of a training phrase. - */ -export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart { - /** - * Optional. The parameter name for the value extracted from the annotated - * part of the example. - */ - alias: string; - /** - * Optional. The entity type name prefixed with `@`. This field is required - * for the annotated part of the text and applies only to examples. - */ - entityType: string; - /** - * Required. The text corresponding to the example or template, if there are - * no annotations. For annotated examples, it is the text for one of the - * example's parts. - */ - text: string; - /** - * Optional. Indicates whether the text was manually annotated by the - * developer. - */ - userDefined: boolean; -} -/** - * Represents the contents of the original request that was passed to the - * `[Streaming]DetectIntent` call. - */ -export interface Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest { - /** - * Optional. This field is set to the value of `QueryParameters.payload` field - * passed in the request. - */ - payload: any; - /** - * The source of this request, e.g., `google`, `facebook`, `slack`. It is set - * by Dialogflow-owned servers. - */ - source: string; -} -/** - * Represents the result of conversational query or event processing. - */ -export interface Schema$GoogleCloudDialogflowV2QueryResult { - /** - * The action name from the matched intent. - */ - action: string; - /** - * This field is set to: - `false` if the matched intent has required - * parameters and not all of the required parameter values have been - * collected. - `true` if all required parameter values have been collected, - * or if the matched intent doesn't contain any required parameters. - */ - allRequiredParamsPresent: boolean; - /** - * The free-form diagnostic info. For example, this field could contain - * webhook call latency. - */ - diagnosticInfo: any; - /** - * The collection of rich messages to present to the user. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * The text to be pronounced to the user or shown on the screen. - */ - fulfillmentText: string; - /** - * The intent that matched the conversational query. Some, not all fields are - * filled in this message, including but not limited to: `name`, - * `display_name` and `webhook_state`. - */ - intent: Schema$GoogleCloudDialogflowV2Intent; - /** - * The intent detection confidence. Values range from 0.0 (completely - * uncertain) to 1.0 (completely certain). - */ - intentDetectionConfidence: number; - /** - * The language that was triggered during intent detection. See [Language - * Support](https://dialogflow.com/docs/reference/language) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * The collection of output contexts. If applicable, - * `output_contexts.parameters` contains entries with name `<parameter - * name>.original` containing the original parameter values before the - * query. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * The collection of extracted parameters. - */ - parameters: any; - /** - * The original conversational query text: - If natural language text was - * provided as input, `query_text` contains a copy of the input. - If - * natural language speech audio was provided as input, `query_text` contains - * the speech recognition result. If speech recognizer produced multiple - * alternatives, a particular one is picked. - If an event was provided as - * input, `query_text` is not set. - */ - queryText: string; - /** - * The Speech recognition confidence between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. The default of 0.0 is a sentinel value indicating that confidence - * was not set. You should not rely on this field as it isn't guaranteed - * to be accurate, or even set. In particular this field isn't set in - * Webhook calls and for StreamingDetectIntent since the streaming endpoint - * has separate confidence estimates per portion of the audio in - * StreamingRecognitionResult. - */ - speechRecognitionConfidence: number; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `payload` field returned in the webhook response. - */ - webhookPayload: any; - /** - * If the query was fulfilled by a webhook call, this field is set to the - * value of the `source` field returned in the webhook response. - */ - webhookSource: string; -} -/** - * The request message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2WebhookRequest { - /** - * Optional. The contents of the original request that was passed to - * `[Streaming]DetectIntent` call. - */ - originalDetectIntentRequest: - Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest; - /** - * The result of the conversational query or event processing. Contains the - * same value as `[Streaming]DetectIntentResponse.query_result`. - */ - queryResult: Schema$GoogleCloudDialogflowV2QueryResult; - /** - * The unique identifier of the response. Contains the same value as - * `[Streaming]DetectIntentResponse.response_id`. - */ - responseId: string; - /** - * The unique identifier of detectIntent request session. Can be used to - * identify end-user inside webhook implementation. Format: - * `projects/<Project ID>/agent/sessions/<Session ID>`. - */ - session: string; -} -/** - * The response message for a webhook call. - */ -export interface Schema$GoogleCloudDialogflowV2WebhookResponse { - /** - * Optional. Makes the platform immediately invoke another `DetectIntent` call - * internally with the specified event as input. - */ - followupEventInput: Schema$GoogleCloudDialogflowV2EventInput; - /** - * Optional. The collection of rich messages to present to the user. This - * value is passed directly to `QueryResult.fulfillment_messages`. - */ - fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; - /** - * Optional. The text to be shown on the screen. This value is passed directly - * to `QueryResult.fulfillment_text`. - */ - fulfillmentText: string; - /** - * Optional. The collection of output contexts. This value is passed directly - * to `QueryResult.output_contexts`. - */ - outputContexts: Schema$GoogleCloudDialogflowV2Context[]; - /** - * Optional. This value is passed directly to `QueryResult.webhook_payload`. - * See the related `fulfillment_messages[i].payload field`, which may be used - * as an alternative to this field. This field can be used for Actions on - * Google responses. It should have a structure similar to the JSON message - * shown here. For more information, see [Actions on Google Webhook - * Format](https://developers.google.com/actions/dialogflow/webhook) - * <pre>{ "google": { "expectUserResponse": - * true, "richResponse": { "items": [ { - * "simpleResponse": { "textToSpeech": - * "this is a simple response" } } ] } - * } }</pre> - */ - payload: any; - /** - * Optional. This value is passed directly to `QueryResult.webhook_source`. - */ - source: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpcStatus; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobufEmpty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpcStatus { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$GoogleTypeLatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} - -export class Resource$Projects { - root: Dialogflow; - agent: Resource$Projects$Agent; - operations: Resource$Projects$Operations; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.agent = new Resource$Projects$Agent(root); - this.operations = new Resource$Projects$Operations(root); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.getAgent - * @desc Retrieves the specified agent. - * @alias dialogflow.projects.getAgent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to fetch is associated with. Format: `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAgent(params?: any, options?: MethodOptions): - AxiosPromise; - getAgent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - getAgent( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/agent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Projects$Agent { - root: Dialogflow; - entityTypes: Resource$Projects$Agent$Entitytypes; - environments: Resource$Projects$Agent$Environments; - intents: Resource$Projects$Agent$Intents; - sessions: Resource$Projects$Agent$Sessions; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.entityTypes = new Resource$Projects$Agent$Entitytypes(root); - this.environments = new Resource$Projects$Agent$Environments(root); - this.intents = new Resource$Projects$Agent$Intents(root); - this.sessions = new Resource$Projects$Agent$Sessions(root); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.agent.export - * @desc Exports the specified agent to a ZIP file. Operation - * @alias dialogflow.projects.agent.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to export is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2beta1ExportAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): - AxiosPromise; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/agent:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.import - * @desc Imports the specified agent from a ZIP file. Uploads new intents and - * entity types without deleting the existing ones. Intents and entity types - * with the same name are replaced with the new versions from - * ImportAgentRequest. Operation - * @alias dialogflow.projects.agent.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to import is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2beta1ImportAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ -import(params?: any, options?: MethodOptions): AxiosPromise; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { - callback = options; - options = {}; - } if(typeof params === 'function') { - callback = params; - params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v2beta1/{+parent}/agent:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['parent'], pathParams: ['parent'], context: this.getRoot()}; if(callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - }} - - - /** - * dialogflow.projects.agent.restore - * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation - * @alias dialogflow.projects.agent.restore - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to restore is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2beta1RestoreAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restore(params?: any, options?: MethodOptions): AxiosPromise; - restore( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - restore( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/agent:restore') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.search - * @desc Returns the list of agents. Since there is at most one - * conversational agent per project, this method is useful primarily for - * listing all agents across projects the caller has access to. One can - * achieve that with a wildcard project collection id "-". Refer to [List - * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). - * @alias dialogflow.projects.agent.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The project to list agents from. Format: `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/agent:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>(parameters); - } - } - - - /** - * dialogflow.projects.agent.train - * @desc Trains the specified agent. Operation - * @alias dialogflow.projects.agent.train - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project that the agent to train is associated with. Format: `projects/`. - * @param {().GoogleCloudDialogflowV2beta1TrainAgentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - train(params?: any, options?: MethodOptions): - AxiosPromise; - train( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - train( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/agent:train') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Agent$Entitytypes { - root: Dialogflow; - entities: Resource$Projects$Agent$Entitytypes$Entities; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.entities = new Resource$Projects$Agent$Entitytypes$Entities(root); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.agent.entityTypes.batchDelete - * @desc Deletes entity types in the specified agent. Operation - * @alias dialogflow.projects.agent.entityTypes.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.batchUpdate - * @desc Updates/Creates multiple entity types in the specified agent. - * Operation - * @alias dialogflow.projects.agent.entityTypes.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to update or create entity types in. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.create - * @desc Creates an entity type in the specified agent. - * @alias dialogflow.projects.agent.entityTypes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.parent Required. The agent to create a entity type for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1EntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.delete - * @desc Deletes the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.get - * @desc Retrieves the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language to retrieve entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required. The name of the entity type. Format: `projects//agent/entityTypes/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.list - * @desc Returns the list of all entity types in the specified agent. - * @alias dialogflow.projects.agent.entityTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language to list entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The agent to list all entity types from. Format: `projects//agent`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>( - parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.patch - * @desc Updates the specified entity type. - * @alias dialogflow.projects.agent.entityTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of the entity type. Format: `projects//agent/entityTypes/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1EntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Projects$Agent$Entitytypes$Entities { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.agent.entityTypes.entities.batchCreate - * @desc Creates multiple new entities in the specified entity type (extends - * the existing collection of entries). Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to create entities in. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchCreate(params?: any, options?: MethodOptions): - AxiosPromise; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entities:batchCreate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.entities.batchDelete - * @desc Deletes entities in the specified entity type. Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to delete entries for. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entities:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.entityTypes.entities.batchUpdate - * @desc Updates entities in the specified entity type (replaces the existing - * collection of entries). Operation - * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the entity type to update the entities in. Format: `projects//agent/entityTypes/`. - * @param {().GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entities:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Projects$Agent$Environments { - root: Dialogflow; - users: Resource$Projects$Agent$Environments$Users; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.users = new Resource$Projects$Agent$Environments$Users(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Agent$Environments$Users { - root: Dialogflow; - sessions: Resource$Projects$Agent$Environments$Users$Sessions; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.sessions = - new Resource$Projects$Agent$Environments$Users$Sessions(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Agent$Environments$Users$Sessions { - root: Dialogflow; - contexts: Resource$Projects$Agent$Environments$Users$Sessions$Contexts; - entityTypes: Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.contexts = - new Resource$Projects$Agent$Environments$Users$Sessions$Contexts(root); - this.entityTypes = - new Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes( - root); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.deleteContexts - * @desc Deletes all active contexts in the specified session. - * @alias dialogflow.projects.agent.environments.users.sessions.deleteContexts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteContexts(params?: any, options?: MethodOptions): - AxiosPromise; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.detectIntent - * @desc Processes a natural language query and returns structured, actionable - * data as a result. This method is not idempotent, because it may cause - * contexts and session entity types to be updated, which in turn might affect - * results of future queries. - * @alias dialogflow.projects.agent.environments.users.sessions.detectIntent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we are using "-". It’s up to the API caller to choose an appropriate . and . They can be a random numbers or some type of user and session identifiers (preferably hashed). The length of the and must not exceed 36 characters. - * @param {().GoogleCloudDialogflowV2beta1DetectIntentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detectIntent(params?: any, options?: MethodOptions): - AxiosPromise; - detectIntent( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void; - detectIntent( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+session}:detectIntent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>(parameters); - } - } -} -export class Resource$Projects$Agent$Environments$Users$Sessions$Contexts { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.contexts.create - * @desc Creates a context. - * @alias - * dialogflow.projects.agent.environments.users.sessions.contexts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.contexts.delete - * @desc Deletes the specified context. - * @alias - * dialogflow.projects.agent.environments.users.sessions.contexts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.contexts.get - * @desc Retrieves the specified context. - * @alias dialogflow.projects.agent.environments.users.sessions.contexts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.contexts.list - * @desc Returns the list of all contexts in the specified session. - * @alias dialogflow.projects.agent.environments.users.sessions.contexts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>(parameters); - } - } - - - /** - * dialogflow.projects.agent.environments.users.sessions.contexts.patch - * @desc Updates the specified context. - * @alias dialogflow.projects.agent.environments.users.sessions.contexts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. The Context ID is always converted to lowercase. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); + * Represents a part of a training phrase. + */ + export interface Schema$GoogleCloudDialogflowV2IntentTrainingPhrasePart { + /** + * Optional. The parameter name for the value extracted from the annotated + * part of the example. + */ + alias: string; + /** + * Optional. The entity type name prefixed with `@`. This field is required + * for the annotated part of the text and applies only to examples. + */ + entityType: string; + /** + * Required. The text corresponding to the example or template, if there are + * no annotations. For annotated examples, it is the text for one of the + * example's parts. + */ + text: string; + /** + * Optional. Indicates whether the text was manually annotated by the + * developer. + */ + userDefined: boolean; } - - getRoot() { - return this.root; - } - - /** - * dialogflow.projects.agent.environments.users.sessions.entityTypes.create - * @desc Creates a session entity type. - * @alias - * dialogflow.projects.agent.environments.users.sessions.entityTypes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Represents the contents of the original request that was passed to the + * `[Streaming]DetectIntent` call. */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); - } + export interface Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest { + /** + * Optional. This field is set to the value of `QueryParameters.payload` + * field passed in the request. + */ + payload: any; + /** + * The source of this request, e.g., `google`, `facebook`, `slack`. It is + * set by Dialogflow-owned servers. + */ + source: string; } - - /** - * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete - * @desc Deletes the specified session entity type. - * @alias - * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the result of conversational query or event processing. + */ + export interface Schema$GoogleCloudDialogflowV2QueryResult { + /** + * The action name from the matched intent. + */ + action: string; + /** + * This field is set to: - `false` if the matched intent has required + * parameters and not all of the required parameter values have been + * collected. - `true` if all required parameter values have been collected, + * or if the matched intent doesn't contain any required parameters. + */ + allRequiredParamsPresent: boolean; + /** + * The free-form diagnostic info. For example, this field could contain + * webhook call latency. + */ + diagnosticInfo: any; + /** + * The collection of rich messages to present to the user. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * The text to be pronounced to the user or shown on the screen. + */ + fulfillmentText: string; + /** + * The intent that matched the conversational query. Some, not all fields + * are filled in this message, including but not limited to: `name`, + * `display_name` and `webhook_state`. + */ + intent: Schema$GoogleCloudDialogflowV2Intent; + /** + * The intent detection confidence. Values range from 0.0 (completely + * uncertain) to 1.0 (completely certain). + */ + intentDetectionConfidence: number; + /** + * The language that was triggered during intent detection. See [Language + * Support](https://dialogflow.com/docs/reference/language) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * The collection of output contexts. If applicable, + * `output_contexts.parameters` contains entries with name `<parameter + * name>.original` containing the original parameter values before the + * query. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * The collection of extracted parameters. + */ + parameters: any; + /** + * The original conversational query text: - If natural language text was + * provided as input, `query_text` contains a copy of the input. - If + * natural language speech audio was provided as input, `query_text` + * contains the speech recognition result. If speech recognizer produced + * multiple alternatives, a particular one is picked. - If an event was + * provided as input, `query_text` is not set. + */ + queryText: string; + /** + * The Speech recognition confidence between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. The default of 0.0 is a sentinel value indicating that + * confidence was not set. You should not rely on this field as it + * isn't guaranteed to be accurate, or even set. In particular this + * field isn't set in Webhook calls and for StreamingDetectIntent since + * the streaming endpoint has separate confidence estimates per portion of + * the audio in StreamingRecognitionResult. + */ + speechRecognitionConfidence: number; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `payload` field returned in the webhook response. + */ + webhookPayload: any; + /** + * If the query was fulfilled by a webhook call, this field is set to the + * value of the `source` field returned in the webhook response. + */ + webhookSource: string; } - - /** - * dialogflow.projects.agent.environments.users.sessions.entityTypes.get - * @desc Retrieves the specified session entity type. - * @alias - * dialogflow.projects.agent.environments.users.sessions.entityTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions// entityTypes/`. Note: Environments and users re under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); - } + * The request message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2WebhookRequest { + /** + * Optional. The contents of the original request that was passed to + * `[Streaming]DetectIntent` call. + */ + originalDetectIntentRequest: + Schema$GoogleCloudDialogflowV2OriginalDetectIntentRequest; + /** + * The result of the conversational query or event processing. Contains the + * same value as `[Streaming]DetectIntentResponse.query_result`. + */ + queryResult: Schema$GoogleCloudDialogflowV2QueryResult; + /** + * The unique identifier of the response. Contains the same value as + * `[Streaming]DetectIntentResponse.response_id`. + */ + responseId: string; + /** + * The unique identifier of detectIntent request session. Can be used to + * identify end-user inside webhook implementation. Format: + * `projects/<Project ID>/agent/sessions/<Session ID>`. + */ + session: string; } - - /** - * dialogflow.projects.agent.environments.users.sessions.entityTypes.list - * @desc Returns the list of all session entity types in the specified - * session. - * @alias - * dialogflow.projects.agent.environments.users.sessions.entityTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): - void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): - void|AxiosPromise< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( - parameters); - } + * The response message for a webhook call. + */ + export interface Schema$GoogleCloudDialogflowV2WebhookResponse { + /** + * Optional. Makes the platform immediately invoke another `DetectIntent` + * call internally with the specified event as input. + */ + followupEventInput: Schema$GoogleCloudDialogflowV2EventInput; + /** + * Optional. The collection of rich messages to present to the user. This + * value is passed directly to `QueryResult.fulfillment_messages`. + */ + fulfillmentMessages: Schema$GoogleCloudDialogflowV2IntentMessage[]; + /** + * Optional. The text to be shown on the screen. This value is passed + * directly to `QueryResult.fulfillment_text`. + */ + fulfillmentText: string; + /** + * Optional. The collection of output contexts. This value is passed + * directly to `QueryResult.output_contexts`. + */ + outputContexts: Schema$GoogleCloudDialogflowV2Context[]; + /** + * Optional. This value is passed directly to `QueryResult.webhook_payload`. + * See the related `fulfillment_messages[i].payload field`, which may be + * used as an alternative to this field. This field can be used for Actions + * on Google responses. It should have a structure similar to the JSON + * message shown here. For more information, see [Actions on Google Webhook + * Format](https://developers.google.com/actions/dialogflow/webhook) + * <pre>{ "google": { "expectUserResponse": + * true, "richResponse": { "items": [ { + * "simpleResponse": { "textToSpeech": + * "this is a simple response" } } ] } + * } }</pre> + */ + payload: any; + /** + * Optional. This value is passed directly to `QueryResult.webhook_source`. + */ + source: string; } - - /** - * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch - * @desc Updates the specified session entity type. - * @alias - * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions //entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); - } - } -} - - - -export class Resource$Projects$Agent$Intents { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpcStatus; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - /** - * dialogflow.projects.agent.intents.batchDelete - * @desc Deletes intents in the specified agent. Operation - * @alias dialogflow.projects.agent.intents.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/intents:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobufEmpty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpcStatus { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * dialogflow.projects.agent.intents.batchUpdate - * @desc Updates/Creates multiple intents in the specified agent. Operation - * - * @alias dialogflow.projects.agent.intents.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the agent to update or create intents in. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/intents:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$GoogleTypeLatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; } - - /** - * dialogflow.projects.agent.intents.create - * @desc Creates an intent in the specified agent. - * @alias dialogflow.projects.agent.intents.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.parent Required. The agent to create a intent for. Format: `projects//agent`. - * @param {().GoogleCloudDialogflowV2beta1Intent} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/intents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Projects { + root: Dialogflow; + agent: Resource$Projects$Agent; + operations: Resource$Projects$Operations; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.agent = new Resource$Projects$Agent(root); + this.operations = new Resource$Projects$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.getAgent + * @desc Retrieves the specified agent. + * @alias dialogflow.projects.getAgent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to fetch is associated with. Format: `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAgent(params?: any, options?: MethodOptions): + AxiosPromise; + getAgent( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getAgent( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/agent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - - /** - * dialogflow.projects.agent.intents.delete - * @desc Deletes the specified intent. - * @alias dialogflow.projects.agent.intents.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the intent to delete. Format: `projects//agent/intents/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); + export class Resource$Projects$Agent { + root: Dialogflow; + entityTypes: Resource$Projects$Agent$Entitytypes; + environments: Resource$Projects$Agent$Environments; + intents: Resource$Projects$Agent$Intents; + sessions: Resource$Projects$Agent$Sessions; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.entityTypes = new Resource$Projects$Agent$Entitytypes(root); + this.environments = new Resource$Projects$Agent$Environments(root); + this.intents = new Resource$Projects$Agent$Intents(root); + this.sessions = new Resource$Projects$Agent$Sessions(root); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.export + * @desc Exports the specified agent to a ZIP file. Operation + * @alias dialogflow.projects.agent.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to export is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2beta1ExportAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/agent:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.import + * @desc Imports the specified agent from a ZIP file. Uploads new intents + * and entity types without deleting the existing ones. Intents and entity + * types with the same name are replaced with the new versions from + * ImportAgentRequest. Operation + * @alias dialogflow.projects.agent.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to import is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2beta1ImportAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ +import(params?: any, options?: MethodOptions): AxiosPromise; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { + callback = options; + options = {}; + } if(typeof params === 'function') { + callback = params; + params = {}; + } options = options || {}; const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v2beta1/{+parent}/agent:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['parent'], pathParams: ['parent'], context: this.getRoot()}; if(callback) { + createAPIRequest(parameters, callback); } else { - return createAPIRequest(parameters); - } - } + return createAPIRequest(parameters); + }} - /** - * dialogflow.projects.agent.intents.get - * @desc Retrieves the specified intent. - * @alias dialogflow.projects.agent.intents.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language to retrieve training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required. The name of the intent. Format: `projects//agent/intents/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dialogflow.projects.agent.restore + * @desc Restores the specified agent from a ZIP file. Replaces the current agent version with a new one. All the intents and entity types in the older version are deleted. Operation + * @alias dialogflow.projects.agent.restore + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to restore is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2beta1RestoreAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restore(params?: any, options?: MethodOptions): AxiosPromise; + restore( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + restore( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/agent:restore') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.search + * @desc Returns the list of agents. Since there is at most one + * conversational agent per project, this method is useful primarily for + * listing all agents across projects the caller has access to. One can + * achieve that with a wildcard project collection id "-". Refer to [List + * Sub-Collections](https://cloud.google.com/apis/design/design_patterns#list_sub-collections). + * @alias dialogflow.projects.agent.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The project to list agents from. Format: `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/agent:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SearchAgentsResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.train + * @desc Trains the specified agent. Operation + * @alias dialogflow.projects.agent.train + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project that the agent to train is associated with. Format: `projects/`. + * @param {().GoogleCloudDialogflowV2beta1TrainAgentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + train(params?: any, options?: MethodOptions): + AxiosPromise; + train( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + train( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/agent:train') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * dialogflow.projects.agent.intents.list - * @desc Returns the list of all intents in the specified agent. - * @alias dialogflow.projects.agent.intents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language to list training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent before they can be used. - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The agent to list all intents from. Format: `projects//agent`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/intents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>(parameters); + export class Resource$Projects$Agent$Entitytypes { + root: Dialogflow; + entities: Resource$Projects$Agent$Entitytypes$Entities; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.entities = new Resource$Projects$Agent$Entitytypes$Entities(root); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.entityTypes.batchDelete + * @desc Deletes entity types in the specified agent. Operation + * @alias dialogflow.projects.agent.entityTypes.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1BatchDeleteEntityTypesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.batchUpdate + * @desc Updates/Creates multiple entity types in the specified agent. + * Operation + * @alias dialogflow.projects.agent.entityTypes.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to update or create entity types in. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1BatchUpdateEntityTypesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.create + * @desc Creates an entity type in the specified agent. + * @alias dialogflow.projects.agent.entityTypes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.parent Required. The agent to create a entity type for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1EntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.delete + * @desc Deletes the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.get + * @desc Retrieves the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language to retrieve entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required. The name of the entity type. Format: `projects//agent/entityTypes/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.list + * @desc Returns the list of all entity types in the specified agent. + * @alias dialogflow.projects.agent.entityTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language to list entity synonyms for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The agent to list all entity types from. Format: `projects//agent`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>): + void|AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListEntityTypesResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.patch + * @desc Updates the specified entity type. + * @alias dialogflow.projects.agent.entityTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional. The language of entity synonyms defined in `entity_type`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of the entity type. Format: `projects//agent/entityTypes/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1EntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1EntityType>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - - /** - * dialogflow.projects.agent.intents.patch - * @desc Updates the specified intent. - * @alias dialogflow.projects.agent.intents.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. - * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. - * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of this intent. Format: `projects//agent/intents/`. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1Intent} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Projects$Agent$Entitytypes$Entities { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.entityTypes.entities.batchCreate + * @desc Creates multiple new entities in the specified entity type (extends + * the existing collection of entries). Operation + * @alias dialogflow.projects.agent.entityTypes.entities.batchCreate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to create entities in. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2beta1BatchCreateEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchCreate(params?: any, options?: MethodOptions): + AxiosPromise; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entities:batchCreate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.entities.batchDelete + * @desc Deletes entities in the specified entity type. Operation + * + * @alias dialogflow.projects.agent.entityTypes.entities.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to delete entries for. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2beta1BatchDeleteEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entities:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.entityTypes.entities.batchUpdate + * @desc Updates entities in the specified entity type (replaces the + * existing collection of entries). Operation + * @alias dialogflow.projects.agent.entityTypes.entities.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the entity type to update the entities in. Format: `projects//agent/entityTypes/`. + * @param {().GoogleCloudDialogflowV2beta1BatchUpdateEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entities:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Projects$Agent$Sessions { - root: Dialogflow; - contexts: Resource$Projects$Agent$Sessions$Contexts; - entityTypes: Resource$Projects$Agent$Sessions$Entitytypes; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - this.contexts = new Resource$Projects$Agent$Sessions$Contexts(root); - this.entityTypes = new Resource$Projects$Agent$Sessions$Entitytypes(root); - } - - getRoot() { - return this.root; - } - /** - * dialogflow.projects.agent.sessions.deleteContexts - * @desc Deletes all active contexts in the specified session. - * @alias dialogflow.projects.agent.sessions.deleteContexts - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteContexts(params?: any, options?: MethodOptions): - AxiosPromise; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteContexts( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Agent$Environments { + root: Dialogflow; + users: Resource$Projects$Agent$Environments$Users; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.users = new Resource$Projects$Agent$Environments$Users(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * dialogflow.projects.agent.sessions.detectIntent - * @desc Processes a natural language query and returns structured, actionable - * data as a result. This method is not idempotent, because it may cause - * contexts and session entity types to be updated, which in turn might affect - * results of future queries. - * @alias dialogflow.projects.agent.sessions.detectIntent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we are using "-". It’s up to the API caller to choose an appropriate . and . They can be a random numbers or some type of user and session identifiers (preferably hashed). The length of the and must not exceed 36 characters. - * @param {().GoogleCloudDialogflowV2beta1DetectIntentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detectIntent(params?: any, options?: MethodOptions): - AxiosPromise; - detectIntent( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void; - detectIntent( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+session}:detectIntent') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>(parameters); - } - } -} -export class Resource$Projects$Agent$Sessions$Contexts { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - - /** - * dialogflow.projects.agent.sessions.contexts.create - * @desc Creates a context. - * @alias dialogflow.projects.agent.sessions.contexts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Agent$Environments$Users { + root: Dialogflow; + sessions: Resource$Projects$Agent$Environments$Users$Sessions; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.sessions = + new Resource$Projects$Agent$Environments$Users$Sessions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - /** - * dialogflow.projects.agent.sessions.contexts.delete - * @desc Deletes the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - - - /** - * dialogflow.projects.agent.sessions.contexts.get - * @desc Retrieves the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Projects$Agent$Environments$Users$Sessions { + root: Dialogflow; + contexts: Resource$Projects$Agent$Environments$Users$Sessions$Contexts; + entityTypes: + Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.contexts = + new Resource$Projects$Agent$Environments$Users$Sessions$Contexts( + root); + this.entityTypes = + new Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes( + root); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.deleteContexts + * @desc Deletes all active contexts in the specified session. + * @alias + * dialogflow.projects.agent.environments.users.sessions.deleteContexts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteContexts(params?: any, options?: MethodOptions): + AxiosPromise; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.detectIntent + * @desc Processes a natural language query and returns structured, + * actionable data as a result. This method is not idempotent, because it + * may cause contexts and session entity types to be updated, which in turn + * might affect results of future queries. + * @alias dialogflow.projects.agent.environments.users.sessions.detectIntent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we are using "-". It’s up to the API caller to choose an appropriate . and . They can be a random numbers or some type of user and session identifiers (preferably hashed). The length of the and must not exceed 36 characters. + * @param {().GoogleCloudDialogflowV2beta1DetectIntentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detectIntent(params?: any, options?: MethodOptions): + AxiosPromise; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+session}:detectIntent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>( + parameters); + } } } - - - /** - * dialogflow.projects.agent.sessions.contexts.list - * @desc Returns the list of all contexts in the specified session. - * @alias dialogflow.projects.agent.sessions.contexts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/contexts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>(parameters); + export class Resource$Projects$Agent$Environments$Users$Sessions$Contexts { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.contexts.create + * @desc Creates a context. + * @alias + * dialogflow.projects.agent.environments.users.sessions.contexts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.contexts.delete + * @desc Deletes the specified context. + * @alias + * dialogflow.projects.agent.environments.users.sessions.contexts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.contexts.get + * @desc Retrieves the specified context. + * @alias dialogflow.projects.agent.environments.users.sessions.contexts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.contexts.list + * @desc Returns the list of all contexts in the specified session. + * @alias + * dialogflow.projects.agent.environments.users.sessions.contexts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.contexts.patch + * @desc Updates the specified context. + * @alias + * dialogflow.projects.agent.environments.users.sessions.contexts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. The Context ID is always converted to lowercase. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dialogflow.projects.agent.sessions.contexts.patch - * @desc Updates the specified context. - * @alias dialogflow.projects.agent.sessions.contexts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. The Context ID is always converted to lowercase. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Agent$Environments$Users$Sessions$Entitytypes { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.entityTypes.create + * @desc Creates a session entity type. + * @alias + * dialogflow.projects.agent.environments.users.sessions.entityTypes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete + * @desc Deletes the specified session entity type. + * @alias + * dialogflow.projects.agent.environments.users.sessions.entityTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.entityTypes.get + * @desc Retrieves the specified session entity type. + * @alias + * dialogflow.projects.agent.environments.users.sessions.entityTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions// entityTypes/`. Note: Environments and users re under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.entityTypes.list + * @desc Returns the list of all session entity types in the specified + * session. + * @alias + * dialogflow.projects.agent.environments.users.sessions.entityTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): + void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): + void|AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch + * @desc Updates the specified session entity type. + * @alias + * dialogflow.projects.agent.environments.users.sessions.entityTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions //entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Projects$Agent$Sessions$Entitytypes { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - /** - * dialogflow.projects.agent.sessions.entityTypes.create - * @desc Creates a session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); - } - } - - /** - * dialogflow.projects.agent.sessions.entityTypes.delete - * @desc Deletes the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Agent$Intents { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.intents.batchDelete + * @desc Deletes intents in the specified agent. Operation + * @alias dialogflow.projects.agent.intents.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to delete all entities types for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1BatchDeleteIntentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/intents:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.batchUpdate + * @desc Updates/Creates multiple intents in the specified agent. Operation + * + * @alias dialogflow.projects.agent.intents.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the agent to update or create intents in. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1BatchUpdateIntentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/intents:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.create + * @desc Creates an intent in the specified agent. + * @alias dialogflow.projects.agent.intents.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.parent Required. The agent to create a intent for. Format: `projects//agent`. + * @param {().GoogleCloudDialogflowV2beta1Intent} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.delete + * @desc Deletes the specified intent. + * @alias dialogflow.projects.agent.intents.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the intent to delete. Format: `projects//agent/intents/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.get + * @desc Retrieves the specified intent. + * @alias dialogflow.projects.agent.intents.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language to retrieve training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required. The name of the intent. Format: `projects//agent/intents/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.list + * @desc Returns the list of all intents in the specified agent. + * @alias dialogflow.projects.agent.intents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language to list training phrases, parameters and rich messages for. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent before they can be used. + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The agent to list all intents from. Format: `projects//agent`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/intents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListIntentsResponse>(parameters); + } + } + + + /** + * dialogflow.projects.agent.intents.patch + * @desc Updates the specified intent. + * @alias dialogflow.projects.agent.intents.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.intentView Optional. The resource view to apply to the returned intent. + * @param {string=} params.languageCode Optional. The language of training phrases, parameters and rich messages defined in `intent`. If not specified, the agent's default language is used. [More than a dozen languages](https://dialogflow.com/docs/reference/language) are supported. Note: languages must be enabled in the agent, before they can be used. + * @param {string} params.name Required for all methods except `create` (`create` populates the name automatically. The unique identifier of this intent. Format: `projects//agent/intents/`. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1Intent} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dialogflow.projects.agent.sessions.entityTypes.get - * @desc Retrieves the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions// entityTypes/`. Note: Environments and users re under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + export class Resource$Projects$Agent$Sessions { + root: Dialogflow; + contexts: Resource$Projects$Agent$Sessions$Contexts; + entityTypes: Resource$Projects$Agent$Sessions$Entitytypes; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + this.contexts = new Resource$Projects$Agent$Sessions$Contexts(root); + this.entityTypes = new Resource$Projects$Agent$Sessions$Entitytypes(root); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.sessions.deleteContexts + * @desc Deletes all active contexts in the specified session. + * @alias dialogflow.projects.agent.sessions.deleteContexts + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the session to delete all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteContexts(params?: any, options?: MethodOptions): + AxiosPromise; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteContexts( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.detectIntent + * @desc Processes a natural language query and returns structured, + * actionable data as a result. This method is not idempotent, because it + * may cause contexts and session entity types to be updated, which in turn + * might affect results of future queries. + * @alias dialogflow.projects.agent.sessions.detectIntent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The name of the session this query is sent to. Format: `projects//agent/sessions/`, or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we are using "-". It’s up to the API caller to choose an appropriate . and . They can be a random numbers or some type of user and session identifiers (preferably hashed). The length of the and must not exceed 36 characters. + * @param {().GoogleCloudDialogflowV2beta1DetectIntentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detectIntent(params?: any, options?: MethodOptions): + AxiosPromise; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void; + detectIntent( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+session}:detectIntent') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1DetectIntentResponse>( + parameters); + } } } - - - /** - * dialogflow.projects.agent.sessions.entityTypes.list - * @desc Returns the list of all session entity types in the specified - * session. - * @alias dialogflow.projects.agent.sessions.entityTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. - * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. - * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): - void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): - void|AxiosPromise< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/entityTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( - parameters); + export class Resource$Projects$Agent$Sessions$Contexts { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.sessions.contexts.create + * @desc Creates a context. + * @alias dialogflow.projects.agent.sessions.contexts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a context for. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.contexts.delete + * @desc Deletes the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context to delete. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.contexts.get + * @desc Retrieves the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the context. Format: `projects//agent/sessions//contexts/` or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.contexts.list + * @desc Returns the list of all contexts in the specified session. + * @alias dialogflow.projects.agent.sessions.contexts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all contexts from. Format: `projects//agent/sessions/` or `projects//agent/environments//users//sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/contexts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListContextsResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.contexts.patch + * @desc Updates the specified context. + * @alias dialogflow.projects.agent.sessions.contexts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of the context. Format: `projects//agent/sessions//contexts/`, or `projects//agent/environments//users//sessions//contexts/`. Note: Environments and users are under construction and will be available soon. The Context ID is always converted to lowercase. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1Context} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dialogflow.projects.agent.sessions.entityTypes.patch - * @desc Updates the specified session entity type. - * @alias dialogflow.projects.agent.sessions.entityTypes.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions //entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. - * @param {string=} params.updateMask Optional. The mask to control which fields get updated. - * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, - callback?: BodyResponseCallback< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + export class Resource$Projects$Agent$Sessions$Entitytypes { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.agent.sessions.entityTypes.create + * @desc Creates a session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The session to create a session entity type for. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.entityTypes.delete + * @desc Deletes the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the entity type to delete. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions//entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.entityTypes.get + * @desc Retrieves the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the session entity type. Format: `projects//agent/sessions//entityTypes/` or `projects//agent/environments//users//sessions// entityTypes/`. Note: Environments and users re under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.entityTypes.list + * @desc Returns the list of all session entity types in the specified + * session. + * @alias dialogflow.projects.agent.sessions.entityTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of items to return in a single page. By default 100 and at most 1000. + * @param {string=} params.pageToken Optional. The next_page_token value returned from a previous list request. + * @param {string} params.parent Required. The session to list all session entity types from. Format: `projects//agent/sessions/` or `projects//agent/environments//users// sessions/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): + void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>): + void|AxiosPromise< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/entityTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1ListSessionEntityTypesResponse>( + parameters); + } + } + + + /** + * dialogflow.projects.agent.sessions.entityTypes.patch + * @desc Updates the specified session entity type. + * @alias dialogflow.projects.agent.sessions.entityTypes.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The unique identifier of this session entity type. Format: `projects//agent/sessions//entityTypes/`, or `projects//agent/environments//users//sessions //entityTypes/`. Note: Environments and users are under construction and will be available soon. If is not specified, we assume default 'draft' environment. If is not specified, we assume default '-' user. + * @param {string=} params.updateMask Optional. The mask to control which fields get updated. + * @param {().GoogleCloudDialogflowV2beta1SessionEntityType} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>, + callback?: BodyResponseCallback< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudDialogflowV2beta1SessionEntityType>(parameters); + } } } -} - - - -export class Resource$Projects$Operations { - root: Dialogflow; - constructor(root: Dialogflow) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } - /** - * dialogflow.projects.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias dialogflow.projects.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Operations { + root: Dialogflow; + constructor(root: Dialogflow) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * dialogflow.projects.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias dialogflow.projects.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dialogflow.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/digitalassetlinks/v1.ts b/src/apis/digitalassetlinks/v1.ts index 65df6d48d44..fe5bae1dd48 100644 --- a/src/apis/digitalassetlinks/v1.ts +++ b/src/apis/digitalassetlinks/v1.ts @@ -27,390 +27,396 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Digital Asset Links API - * - * API for discovering relationships between online assets such as web sites or - * mobile apps. - * - * @example - * const google = require('googleapis'); - * const digitalassetlinks = google.digitalassetlinks('v1'); - * - * @namespace digitalassetlinks - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Digitalassetlinks - */ -export class Digitalassetlinks { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace digitalassetlinks_v1 { + /** + * Digital Asset Links API + * + * API for discovering relationships between online assets such as web sites + * or mobile apps. + * + * @example + * const google = require('googleapis'); + * const digitalassetlinks = google.digitalassetlinks('v1'); + * + * @namespace digitalassetlinks + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Digitalassetlinks + */ + export class Digitalassetlinks { + _options: GlobalOptions; + google: GoogleApis; + root = this; - assetlinks: Resource$Assetlinks; - statements: Resource$Statements; + assetlinks: Resource$Assetlinks; + statements: Resource$Statements; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.assetlinks = new Resource$Assetlinks(this); - this.statements = new Resource$Statements(this); - } + this.assetlinks = new Resource$Assetlinks(this); + this.statements = new Resource$Statements(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Describes an android app asset. - */ -export interface Schema$AndroidAppAsset { - /** - * Because there is no global enforcement of package name uniqueness, we also - * require a signing certificate, which in combination with the package name - * uniquely identifies an app. Some apps' signing keys are rotated, so - * they may be signed by different keys over time. We treat these as distinct - * assets, since we use (package name, cert) as the unique ID. This should - * not normally pose any problems as both versions of the app will make the - * same or similar statements. Other assets making statements about the app - * will have to be updated when a key is rotated, however. (Note that the - * syntaxes for publishing and querying for statements contain syntactic sugar - * to easily let you specify apps that are known by multiple certificates.) - * REQUIRED - */ - certificate: Schema$CertificateInfo; - /** - * Android App assets are naturally identified by their Java package name. For - * example, the Google Maps app uses the package name - * `com.google.android.apps.maps`. REQUIRED - */ - packageName: string; -} -/** - * Uniquely identifies an asset. A digital asset is an identifiable and - * addressable online entity that typically provides some service or content. - * Examples of assets are websites, Android apps, Twitter feeds, and Plus Pages. - */ -export interface Schema$Asset { - /** - * Set if this is an Android App asset. - */ - androidApp: Schema$AndroidAppAsset; - /** - * Set if this is a web asset. - */ - web: Schema$WebAsset; -} -/** - * Describes an X509 certificate. - */ -export interface Schema$CertificateInfo { - /** - * The uppercase SHA-265 fingerprint of the certificate. From the PEM - * certificate, it can be acquired like this: $ keytool -printcert -file - * $CERTFILE | grep SHA256: SHA256: - * 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ - * 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 - * -in $CERTFILE -noout -fingerprint -sha256 SHA256 - * Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ - * 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the - * contents of this field would be `14:6D:E9:83:C5:73: - * 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: - * 44:E5`. If these tools are not available to you, you can convert the PEM - * certificate into the DER format, compute the SHA-256 hash of that string - * and represent the result as a hexstring (that is, uppercase hexadecimal - * representations of each octet, separated by colons). - */ - sha256Fingerprint: string; -} -/** - * Response message for the CheckAssetLinks call. - */ -export interface Schema$CheckResponse { - /** - * Human-readable message containing information intended to help end users - * understand, reproduce and debug the result. The message will be in - * English and we are currently not planning to offer any translations. Please - * note that no guarantees are made about the contents or format of this - * string. Any aspect of it may be subject to change without notice. You - * should not attempt to programmatically parse this data. For programmatic - * access, use the error_code field below. - */ - debugString: string; - /** - * Error codes that describe the result of the Check operation. - */ - errorCode: string[]; - /** - * Set to true if the assets specified in the request are linked by the - * relation specified in the request. - */ - linked: boolean; /** - * From serving time, how much longer the response should be considered valid - * barring further updates. REQUIRED + * Describes an android app asset. */ - maxAge: string; -} -/** - * Response message for the List call. - */ -export interface Schema$ListResponse { - /** - * Human-readable message containing information intended to help end users - * understand, reproduce and debug the result. The message will be in - * English and we are currently not planning to offer any translations. Please - * note that no guarantees are made about the contents or format of this - * string. Any aspect of it may be subject to change without notice. You - * should not attempt to programmatically parse this data. For programmatic - * access, use the error_code field below. - */ - debugString: string; - /** - * Error codes that describe the result of the List operation. - */ - errorCode: string[]; + export interface Schema$AndroidAppAsset { + /** + * Because there is no global enforcement of package name uniqueness, we + * also require a signing certificate, which in combination with the package + * name uniquely identifies an app. Some apps' signing keys are + * rotated, so they may be signed by different keys over time. We treat + * these as distinct assets, since we use (package name, cert) as the unique + * ID. This should not normally pose any problems as both versions of the + * app will make the same or similar statements. Other assets making + * statements about the app will have to be updated when a key is rotated, + * however. (Note that the syntaxes for publishing and querying for + * statements contain syntactic sugar to easily let you specify apps that + * are known by multiple certificates.) REQUIRED + */ + certificate: Schema$CertificateInfo; + /** + * Android App assets are naturally identified by their Java package name. + * For example, the Google Maps app uses the package name + * `com.google.android.apps.maps`. REQUIRED + */ + packageName: string; + } /** - * From serving time, how much longer the response should be considered valid - * barring further updates. REQUIRED + * Uniquely identifies an asset. A digital asset is an identifiable and + * addressable online entity that typically provides some service or content. + * Examples of assets are websites, Android apps, Twitter feeds, and Plus + * Pages. */ - maxAge: string; + export interface Schema$Asset { + /** + * Set if this is an Android App asset. + */ + androidApp: Schema$AndroidAppAsset; + /** + * Set if this is a web asset. + */ + web: Schema$WebAsset; + } /** - * A list of all the matching statements that have been found. + * Describes an X509 certificate. */ - statements: Schema$Statement[]; -} -/** - * Describes a reliable statement that has been made about the relationship - * between a source asset and a target asset. Statements are always made by the - * source asset, either directly or by delegating to a statement list that is - * stored elsewhere. For more detailed definitions of statements and assets, - * please refer to our [API documentation landing - * page](/digital-asset-links/v1/getting-started). - */ -export interface Schema$Statement { + export interface Schema$CertificateInfo { + /** + * The uppercase SHA-265 fingerprint of the certificate. From the PEM + * certificate, it can be acquired like this: $ keytool -printcert + * -file $CERTFILE | grep SHA256: SHA256: + * 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ + * 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 + * -in $CERTFILE -noout -fingerprint -sha256 SHA256 + * Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ + * 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the + * contents of this field would be `14:6D:E9:83:C5:73: + * 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: + * 44:E5`. If these tools are not available to you, you can convert the PEM + * certificate into the DER format, compute the SHA-256 hash of that string + * and represent the result as a hexstring (that is, uppercase hexadecimal + * representations of each octet, separated by colons). + */ + sha256Fingerprint: string; + } /** - * The relation identifies the use of the statement as intended by the source - * asset's owner (that is, the person or entity who issued the statement). - * Every complete statement has a relation. We identify relations with - * strings of the format `<kind>/<detail>`, where `<kind>` - * must be one of a set of pre-defined purpose categories, and - * `<detail>` is a free-form lowercase alphanumeric string that - * describes the specific use case of the statement. Refer to [our API - * documentation](/digital-asset-links/v1/relation-strings) for the current - * list of supported relations. Example: - * `delegate_permission/common.handle_all_urls` REQUIRED + * Response message for the CheckAssetLinks call. */ - relation: string; + export interface Schema$CheckResponse { + /** + * Human-readable message containing information intended to help end users + * understand, reproduce and debug the result. The message will be in + * English and we are currently not planning to offer any translations. + * Please note that no guarantees are made about the contents or format of + * this string. Any aspect of it may be subject to change without notice. + * You should not attempt to programmatically parse this data. For + * programmatic access, use the error_code field below. + */ + debugString: string; + /** + * Error codes that describe the result of the Check operation. + */ + errorCode: string[]; + /** + * Set to true if the assets specified in the request are linked by the + * relation specified in the request. + */ + linked: boolean; + /** + * From serving time, how much longer the response should be considered + * valid barring further updates. REQUIRED + */ + maxAge: string; + } /** - * Every statement has a source asset. REQUIRED + * Response message for the List call. */ - source: Schema$Asset; + export interface Schema$ListResponse { + /** + * Human-readable message containing information intended to help end users + * understand, reproduce and debug the result. The message will be in + * English and we are currently not planning to offer any translations. + * Please note that no guarantees are made about the contents or format of + * this string. Any aspect of it may be subject to change without notice. + * You should not attempt to programmatically parse this data. For + * programmatic access, use the error_code field below. + */ + debugString: string; + /** + * Error codes that describe the result of the List operation. + */ + errorCode: string[]; + /** + * From serving time, how much longer the response should be considered + * valid barring further updates. REQUIRED + */ + maxAge: string; + /** + * A list of all the matching statements that have been found. + */ + statements: Schema$Statement[]; + } /** - * Every statement has a target asset. REQUIRED + * Describes a reliable statement that has been made about the relationship + * between a source asset and a target asset. Statements are always made by + * the source asset, either directly or by delegating to a statement list that + * is stored elsewhere. For more detailed definitions of statements and + * assets, please refer to our [API documentation landing + * page](/digital-asset-links/v1/getting-started). */ - target: Schema$Asset; -} -/** - * Describes a web asset. - */ -export interface Schema$WebAsset { + export interface Schema$Statement { + /** + * The relation identifies the use of the statement as intended by the + * source asset's owner (that is, the person or entity who issued the + * statement). Every complete statement has a relation. We identify + * relations with strings of the format `<kind>/<detail>`, where + * `<kind>` must be one of a set of pre-defined purpose categories, + * and `<detail>` is a free-form lowercase alphanumeric string that + * describes the specific use case of the statement. Refer to [our API + * documentation](/digital-asset-links/v1/relation-strings) for the current + * list of supported relations. Example: + * `delegate_permission/common.handle_all_urls` REQUIRED + */ + relation: string; + /** + * Every statement has a source asset. REQUIRED + */ + source: Schema$Asset; + /** + * Every statement has a target asset. REQUIRED + */ + target: Schema$Asset; + } /** - * Web assets are identified by a URL that contains only the scheme, hostname - * and port parts. The format is http[s]://<hostname>[:<port>] - * Hostnames must be fully qualified: they must end in a single period - * ("`.`"). Only the schemes "http" and "https" - * are currently allowed. Port numbers are given as a decimal number, and - * they must be omitted if the standard port numbers are used: 80 for http and - * 443 for https. We call this limited URL the "site". All URLs - * that share the same scheme, hostname and port are considered to be a part - * of the site and thus belong to the web asset. Example: the asset with the - * site `https://www.google.com` contains all these URLs: * - * `https://www.google.com/` * `https://www.google.com:443/` * - * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * - * `https://www.google.com/foo#bar` * - * `https://user@password:www.google.com/` But it does not contain these - * URLs: * `http://www.google.com/` (wrong scheme) * - * `https://google.com/` (hostname does not match) * - * `https://www.google.com:444/` (port does not match) REQUIRED + * Describes a web asset. */ - site: string; -} - -export class Resource$Assetlinks { - root: Digitalassetlinks; - constructor(root: Digitalassetlinks) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$WebAsset { + /** + * Web assets are identified by a URL that contains only the scheme, + * hostname and port parts. The format is + * http[s]://<hostname>[:<port>] Hostnames must be fully + * qualified: they must end in a single period ("`.`"). Only the + * schemes "http" and "https" are currently allowed. + * Port numbers are given as a decimal number, and they must be omitted if + * the standard port numbers are used: 80 for http and 443 for https. We + * call this limited URL the "site". All URLs that share the same + * scheme, hostname and port are considered to be a part of the site and + * thus belong to the web asset. Example: the asset with the site + * `https://www.google.com` contains all these URLs: * + * `https://www.google.com/` * `https://www.google.com:443/` * + * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * + * `https://www.google.com/foo#bar` * + * `https://user@password:www.google.com/` But it does not contain these + * URLs: * `http://www.google.com/` (wrong scheme) * + * `https://google.com/` (hostname does not match) * + * `https://www.google.com:444/` (port does not match) REQUIRED + */ + site: string; } - - /** - * digitalassetlinks.assetlinks.check - * @desc Determines whether the specified (directional) relationship exists - * between the specified source and target assets. The relation describes the - * intent of the link between the two assets as claimed by the source asset. - * An example for such relationships is the delegation of privileges or - * permissions. This command is most often used by infrastructure systems to - * check preconditions for an action. For example, a client may want to know - * if it is OK to send a web URL to a particular mobile app instead. The - * client can check for the relevant asset link from the website to the mobile - * app to decide if the operation should be allowed. A note about security: - * if you specify a secure asset as the source, such as an HTTPS website or an - * Android app, the API will ensure that any statements used to generate the - * response have been made in a secure way by the owner of that asset. - * Conversely, if the source asset is an insecure HTTP website (that is, the - * URL starts with `http://` instead of `https://`), the API cannot verify its - * statements securely, and it is not possible to ensure that the website's - * statements have not been altered by a third party. For more information, - * see the [Digital Asset Links technical design - * specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). - * @alias digitalassetlinks.assetlinks.check - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.relation Query string for the relation. We identify relations with strings of the format `/`, where `` must be one of a set of pre-defined purpose categories, and `` is a free-form lowercase alphanumeric string that describes the specific use case of the statement. Refer to [our API documentation](/digital-asset-links/v1/relation-strings) for the current list of supported relations. For a query to match an asset link, both the query's and the asset link's relation strings must match exactly. Example: A query with relation `delegate_permission/common.handle_all_urls` matches an asset link with relation `delegate_permission/common.handle_all_urls`. - * @param {string=} params.source.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). - * @param {string=} params.source.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED - * @param {string=} params.source.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED - * @param {string=} params.target.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). - * @param {string=} params.target.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED - * @param {string=} params.target.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - check(params?: any, options?: MethodOptions): - AxiosPromise; - check( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - check( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Assetlinks { + root: Digitalassetlinks; + constructor(root: Digitalassetlinks) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://digitalassetlinks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/assetlinks:check') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Statements { - root: Digitalassetlinks; - constructor(root: Digitalassetlinks) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * digitalassetlinks.assetlinks.check + * @desc Determines whether the specified (directional) relationship exists + * between the specified source and target assets. The relation describes + * the intent of the link between the two assets as claimed by the source + * asset. An example for such relationships is the delegation of privileges + * or permissions. This command is most often used by infrastructure + * systems to check preconditions for an action. For example, a client may + * want to know if it is OK to send a web URL to a particular mobile app + * instead. The client can check for the relevant asset link from the + * website to the mobile app to decide if the operation should be allowed. + * A note about security: if you specify a secure asset as the source, such + * as an HTTPS website or an Android app, the API will ensure that any + * statements used to generate the response have been made in a secure way + * by the owner of that asset. Conversely, if the source asset is an + * insecure HTTP website (that is, the URL starts with `http://` instead of + * `https://`), the API cannot verify its statements securely, and it is not + * possible to ensure that the website's statements have not been altered by + * a third party. For more information, see the [Digital Asset Links + * technical design + * specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). + * @alias digitalassetlinks.assetlinks.check + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.relation Query string for the relation. We identify relations with strings of the format `/`, where `` must be one of a set of pre-defined purpose categories, and `` is a free-form lowercase alphanumeric string that describes the specific use case of the statement. Refer to [our API documentation](/digital-asset-links/v1/relation-strings) for the current list of supported relations. For a query to match an asset link, both the query's and the asset link's relation strings must match exactly. Example: A query with relation `delegate_permission/common.handle_all_urls` matches an asset link with relation `delegate_permission/common.handle_all_urls`. + * @param {string=} params.source.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). + * @param {string=} params.source.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED + * @param {string=} params.source.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED + * @param {string=} params.target.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). + * @param {string=} params.target.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED + * @param {string=} params.target.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + check(params?: any, options?: MethodOptions): + AxiosPromise; + check( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + check( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://digitalassetlinks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/assetlinks:check') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * digitalassetlinks.statements.list - * @desc Retrieves a list of all statements from a given source that match the - * specified target and statement string. The API guarantees that all - * statements with secure source assets, such as HTTPS websites or Android - * apps, have been made in a secure way by the owner of those assets, as - * described in the [Digital Asset Links technical design - * specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). - * Specifically, you should consider that for insecure websites (that is, - * where the URL starts with `http://` instead of `https://`), this guarantee - * cannot be made. The `List` command is most useful in cases where the API - * client wants to know all the ways in which two assets are related, or - * enumerate all the relationships from a particular source asset. Example: a - * feature that helps users navigate to related items. When a mobile app is - * running on a device, the feature would make it easy to navigate to the - * corresponding web site or Google+ profile. - * @alias digitalassetlinks.statements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.relation Use only associations that match the specified relation. See the [`Statement`](#Statement) message for a detailed definition of relation strings. For a query to match a statement, one of the following must be true: * both the query's and the statement's relation strings match exactly, or * the query's relation string is empty or missing. Example: A query with relation `delegate_permission/common.handle_all_urls` matches an asset link with relation `delegate_permission/common.handle_all_urls`. - * @param {string=} params.source.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). - * @param {string=} params.source.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED - * @param {string=} params.source.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Statements { + root: Digitalassetlinks; + constructor(root: Digitalassetlinks) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://digitalassetlinks.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/statements:list').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * digitalassetlinks.statements.list + * @desc Retrieves a list of all statements from a given source that match + * the specified target and statement string. The API guarantees that all + * statements with secure source assets, such as HTTPS websites or Android + * apps, have been made in a secure way by the owner of those assets, as + * described in the [Digital Asset Links technical design + * specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). + * Specifically, you should consider that for insecure websites (that is, + * where the URL starts with `http://` instead of `https://`), this + * guarantee cannot be made. The `List` command is most useful in cases + * where the API client wants to know all the ways in which two assets are + * related, or enumerate all the relationships from a particular source + * asset. Example: a feature that helps users navigate to related items. + * When a mobile app is running on a device, the feature would make it easy + * to navigate to the corresponding web site or Google+ profile. + * @alias digitalassetlinks.statements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.relation Use only associations that match the specified relation. See the [`Statement`](#Statement) message for a detailed definition of relation strings. For a query to match a statement, one of the following must be true: * both the query's and the statement's relation strings match exactly, or * the query's relation string is empty or missing. Example: A query with relation `delegate_permission/common.handle_all_urls` matches an asset link with relation `delegate_permission/common.handle_all_urls`. + * @param {string=} params.source.androidApp.certificate.sha256Fingerprint The uppercase SHA-265 fingerprint of the certificate. From the PEM certificate, it can be acquired like this: $ keytool -printcert -file $CERTFILE | grep SHA256: SHA256: 14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83: \ 42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 or like this: $ openssl x509 -in $CERTFILE -noout -fingerprint -sha256 SHA256 Fingerprint=14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64: \ 16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5 In this example, the contents of this field would be `14:6D:E9:83:C5:73: 06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF: 44:E5`. If these tools are not available to you, you can convert the PEM certificate into the DER format, compute the SHA-256 hash of that string and represent the result as a hexstring (that is, uppercase hexadecimal representations of each octet, separated by colons). + * @param {string=} params.source.androidApp.packageName Android App assets are naturally identified by their Java package name. For example, the Google Maps app uses the package name `com.google.android.apps.maps`. REQUIRED + * @param {string=} params.source.web.site Web assets are identified by a URL that contains only the scheme, hostname and port parts. The format is http[s]://[:] Hostnames must be fully qualified: they must end in a single period ("`.`"). Only the schemes "http" and "https" are currently allowed. Port numbers are given as a decimal number, and they must be omitted if the standard port numbers are used: 80 for http and 443 for https. We call this limited URL the "site". All URLs that share the same scheme, hostname and port are considered to be a part of the site and thus belong to the web asset. Example: the asset with the site `https://www.google.com` contains all these URLs: * `https://www.google.com/` * `https://www.google.com:443/` * `https://www.google.com/foo` * `https://www.google.com/foo?bar` * `https://www.google.com/foo#bar` * `https://user@password:www.google.com/` But it does not contain these URLs: * `http://www.google.com/` (wrong scheme) * `https://google.com/` (hostname does not match) * `https://www.google.com:444/` (port does not match) REQUIRED + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://digitalassetlinks.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/statements:list') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/discovery/v1.ts b/src/apis/discovery/v1.ts index 6ab01207488..9ee66f1adda 100644 --- a/src/apis/discovery/v1.ts +++ b/src/apis/discovery/v1.ts @@ -27,472 +27,476 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * APIs Discovery Service - * - * Provides information about other Google APIs, such as what APIs are - * available, the resource, and method details for each API. - * - * @example - * const google = require('googleapis'); - * const discovery = google.discovery('v1'); - * - * @namespace discovery - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Discovery - */ -export class Discovery { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace discovery_v1 { + /** + * APIs Discovery Service + * + * Provides information about other Google APIs, such as what APIs are + * available, the resource, and method details for each API. + * + * @example + * const google = require('googleapis'); + * const discovery = google.discovery('v1'); + * + * @namespace discovery + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Discovery + */ + export class Discovery { + _options: GlobalOptions; + google: GoogleApis; + root = this; - apis: Resource$Apis; + apis: Resource$Apis; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.apis = new Resource$Apis(this); - } + this.apis = new Resource$Apis(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$DirectoryList { - /** - * Indicate the version of the Discovery API used to generate this doc. - */ - discoveryVersion: string; - /** - * The individual directory entries. One entry per api/version pair. - */ - items: any[]; - /** - * The kind for this response. - */ - kind: string; -} -export interface Schema$JsonSchema { - /** - * A reference to another schema. The value of this property is the - * "id" of another schema. - */ - $ref: string; - /** - * If this is a schema for an object, this property is the schema for any - * additional properties with dynamic keys on this object. - */ - additionalProperties: Schema$JsonSchema; - /** - * Additional information about this property. - */ - annotations: any; - /** - * The default value of this property (if one exists). - */ - default: string; - /** - * A description of this object. - */ - description: string; - /** - * Values this parameter may take (if it is an enum). - */ - enum: string[]; - /** - * The descriptions for the enums. Each position maps to the corresponding - * value in the "enum" array. - */ - enumDescriptions: string[]; - /** - * An additional regular expression or key that helps constrain the value. For - * more details see: - * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 - */ - format: string; - /** - * Unique identifier for this schema. - */ - id: string; - /** - * If this is a schema for an array, this property is the schema for each - * element in the array. - */ - items: Schema$JsonSchema; - /** - * Whether this parameter goes in the query or the path for REST requests. - */ - location: string; - /** - * The maximum value of this parameter. - */ - maximum: string; - /** - * The minimum value of this parameter. - */ - minimum: string; - /** - * The regular expression this parameter must conform to. Uses Java 6 regex - * format: - * http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html - */ - pattern: string; - /** - * If this is a schema for an object, list the schema for each property of - * this object. - */ - properties: any; - /** - * The value is read-only, generated by the service. The value cannot be - * modified by the client. If the value is included in a POST, PUT, or PATCH - * request, it is ignored by the service. - */ - readOnly: boolean; - /** - * Whether this parameter may appear multiple times. - */ - repeated: boolean; - /** - * Whether the parameter is required. - */ - required: boolean; - /** - * The value type for this schema. A list of values can be found here: - * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 - */ - type: string; - /** - * In a variant data type, the value of one property is used to determine how - * to interpret the entire entity. Its value must exist in a map of - * descriminant values to schema names. - */ - variant: any; -} -export interface Schema$RestDescription { - /** - * Authentication information. - */ - auth: any; - /** - * [DEPRECATED] The base path for REST requests. - */ - basePath: string; - /** - * [DEPRECATED] The base URL for REST requests. - */ - baseUrl: string; - /** - * The path for REST batch requests. - */ - batchPath: string; - /** - * Indicates how the API name should be capitalized and split into various - * parts. Useful for generating pretty class names. - */ - canonicalName: string; - /** - * The description of this API. - */ - description: string; - /** - * Indicate the version of the Discovery API used to generate this doc. - */ - discoveryVersion: string; - /** - * A link to human readable documentation for the API. - */ - documentationLink: string; - /** - * The ETag for this response. - */ - etag: string; - /** - * Enable exponential backoff for suitable methods in the generated clients. - */ - exponentialBackoffDefault: boolean; - /** - * A list of supported features for this API. - */ - features: string[]; - /** - * Links to 16x16 and 32x32 icons representing the API. - */ - icons: any; - /** - * The ID of this API. - */ - id: string; - /** - * The kind for this response. - */ - kind: string; - /** - * Labels for the status of this API, such as labs or deprecated. - */ - labels: string[]; - /** - * API-level methods for this API. - */ - methods: any; - /** - * The name of this API. - */ - name: string; - /** - * The domain of the owner of this API. Together with the ownerName and a - * packagePath values, this can be used to generate a library for this API - * which would have a unique fully qualified name. - */ - ownerDomain: string; - /** - * The name of the owner of this API. See ownerDomain. - */ - ownerName: string; - /** - * The package of the owner of this API. See ownerDomain. - */ - packagePath: string; - /** - * Common parameters that apply across all apis. - */ - parameters: any; - /** - * The protocol described by this document. - */ - protocol: string; - /** - * The resources in this API. - */ - resources: any; - /** - * The version of this API. - */ - revision: string; - /** - * The root URL under which all API services live. - */ - rootUrl: string; - /** - * The schemas for this API. - */ - schemas: any; - /** - * The base path for all REST requests. - */ - servicePath: string; - /** - * The title of this API. - */ - title: string; - /** - * The version of this API. - */ - version: string; - version_module: boolean; -} -export interface Schema$RestMethod { - /** - * Description of this method. - */ - description: string; - /** - * Whether this method requires an ETag to be specified. The ETag is sent as - * an HTTP If-Match or If-None-Match header. - */ - etagRequired: boolean; - /** - * HTTP method used by this method. - */ - httpMethod: string; - /** - * A unique ID for this method. This property can be used to match methods - * between different versions of Discovery. - */ - id: string; - /** - * Media upload parameters. - */ - mediaUpload: any; - /** - * Ordered list of required parameters, serves as a hint to clients on how to - * structure their method signatures. The array is ordered such that the - * "most-significant" parameter appears first. - */ - parameterOrder: string[]; - /** - * Details for all parameters in this method. - */ - parameters: any; - /** - * The URI path of this REST method. Should be used in conjunction with the - * basePath property at the api-level. - */ - path: string; - /** - * The schema for the request. - */ - request: any; - /** - * The schema for the response. - */ - response: any; - /** - * OAuth 2.0 scopes applicable to this method. - */ - scopes: string[]; - /** - * Whether this method supports media downloads. - */ - supportsMediaDownload: boolean; - /** - * Whether this method supports media uploads. - */ - supportsMediaUpload: boolean; - /** - * Whether this method supports subscriptions. - */ - supportsSubscription: boolean; - /** - * Indicates that downloads from this method should use the download service - * URL (i.e. "/download"). Only applies if the method supports media - * download. - */ - useMediaDownloadService: boolean; -} -export interface Schema$RestResource { - /** - * Methods on this resource. - */ - methods: any; - /** - * Sub-resources on this resource. - */ - resources: any; -} -export class Resource$Apis { - root: Discovery; - constructor(root: Discovery) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$DirectoryList { + /** + * Indicate the version of the Discovery API used to generate this doc. + */ + discoveryVersion: string; + /** + * The individual directory entries. One entry per api/version pair. + */ + items: any[]; + /** + * The kind for this response. + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$JsonSchema { + /** + * A reference to another schema. The value of this property is the + * "id" of another schema. + */ + $ref: string; + /** + * If this is a schema for an object, this property is the schema for any + * additional properties with dynamic keys on this object. + */ + additionalProperties: Schema$JsonSchema; + /** + * Additional information about this property. + */ + annotations: any; + /** + * The default value of this property (if one exists). + */ + default: string; + /** + * A description of this object. + */ + description: string; + /** + * Values this parameter may take (if it is an enum). + */ + enum: string[]; + /** + * The descriptions for the enums. Each position maps to the corresponding + * value in the "enum" array. + */ + enumDescriptions: string[]; + /** + * An additional regular expression or key that helps constrain the value. + * For more details see: + * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.23 + */ + format: string; + /** + * Unique identifier for this schema. + */ + id: string; + /** + * If this is a schema for an array, this property is the schema for each + * element in the array. + */ + items: Schema$JsonSchema; + /** + * Whether this parameter goes in the query or the path for REST requests. + */ + location: string; + /** + * The maximum value of this parameter. + */ + maximum: string; + /** + * The minimum value of this parameter. + */ + minimum: string; + /** + * The regular expression this parameter must conform to. Uses Java 6 regex + * format: + * http://docs.oracle.com/javase/6/docs/api/java/util/regex/Pattern.html + */ + pattern: string; + /** + * If this is a schema for an object, list the schema for each property of + * this object. + */ + properties: any; + /** + * The value is read-only, generated by the service. The value cannot be + * modified by the client. If the value is included in a POST, PUT, or PATCH + * request, it is ignored by the service. + */ + readOnly: boolean; + /** + * Whether this parameter may appear multiple times. + */ + repeated: boolean; + /** + * Whether the parameter is required. + */ + required: boolean; + /** + * The value type for this schema. A list of values can be found here: + * http://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1 + */ + type: string; + /** + * In a variant data type, the value of one property is used to determine + * how to interpret the entire entity. Its value must exist in a map of + * descriminant values to schema names. + */ + variant: any; + } + export interface Schema$RestDescription { + /** + * Authentication information. + */ + auth: any; + /** + * [DEPRECATED] The base path for REST requests. + */ + basePath: string; + /** + * [DEPRECATED] The base URL for REST requests. + */ + baseUrl: string; + /** + * The path for REST batch requests. + */ + batchPath: string; + /** + * Indicates how the API name should be capitalized and split into various + * parts. Useful for generating pretty class names. + */ + canonicalName: string; + /** + * The description of this API. + */ + description: string; + /** + * Indicate the version of the Discovery API used to generate this doc. + */ + discoveryVersion: string; + /** + * A link to human readable documentation for the API. + */ + documentationLink: string; + /** + * The ETag for this response. + */ + etag: string; + /** + * Enable exponential backoff for suitable methods in the generated clients. + */ + exponentialBackoffDefault: boolean; + /** + * A list of supported features for this API. + */ + features: string[]; + /** + * Links to 16x16 and 32x32 icons representing the API. + */ + icons: any; + /** + * The ID of this API. + */ + id: string; + /** + * The kind for this response. + */ + kind: string; + /** + * Labels for the status of this API, such as labs or deprecated. + */ + labels: string[]; + /** + * API-level methods for this API. + */ + methods: any; + /** + * The name of this API. + */ + name: string; + /** + * The domain of the owner of this API. Together with the ownerName and a + * packagePath values, this can be used to generate a library for this API + * which would have a unique fully qualified name. + */ + ownerDomain: string; + /** + * The name of the owner of this API. See ownerDomain. + */ + ownerName: string; + /** + * The package of the owner of this API. See ownerDomain. + */ + packagePath: string; + /** + * Common parameters that apply across all apis. + */ + parameters: any; + /** + * The protocol described by this document. + */ + protocol: string; + /** + * The resources in this API. + */ + resources: any; + /** + * The version of this API. + */ + revision: string; + /** + * The root URL under which all API services live. + */ + rootUrl: string; + /** + * The schemas for this API. + */ + schemas: any; + /** + * The base path for all REST requests. + */ + servicePath: string; + /** + * The title of this API. + */ + title: string; + /** + * The version of this API. + */ + version: string; + version_module: boolean; + } + export interface Schema$RestMethod { + /** + * Description of this method. + */ + description: string; + /** + * Whether this method requires an ETag to be specified. The ETag is sent as + * an HTTP If-Match or If-None-Match header. + */ + etagRequired: boolean; + /** + * HTTP method used by this method. + */ + httpMethod: string; + /** + * A unique ID for this method. This property can be used to match methods + * between different versions of Discovery. + */ + id: string; + /** + * Media upload parameters. + */ + mediaUpload: any; + /** + * Ordered list of required parameters, serves as a hint to clients on how + * to structure their method signatures. The array is ordered such that the + * "most-significant" parameter appears first. + */ + parameterOrder: string[]; + /** + * Details for all parameters in this method. + */ + parameters: any; + /** + * The URI path of this REST method. Should be used in conjunction with the + * basePath property at the api-level. + */ + path: string; + /** + * The schema for the request. + */ + request: any; + /** + * The schema for the response. + */ + response: any; + /** + * OAuth 2.0 scopes applicable to this method. + */ + scopes: string[]; + /** + * Whether this method supports media downloads. + */ + supportsMediaDownload: boolean; + /** + * Whether this method supports media uploads. + */ + supportsMediaUpload: boolean; + /** + * Whether this method supports subscriptions. + */ + supportsSubscription: boolean; + /** + * Indicates that downloads from this method should use the download service + * URL (i.e. "/download"). Only applies if the method supports + * media download. + */ + useMediaDownloadService: boolean; + } + export interface Schema$RestResource { + /** + * Methods on this resource. + */ + methods: any; + /** + * Sub-resources on this resource. + */ + resources: any; } - - /** - * discovery.apis.getRest - * @desc Retrieve the description of a particular version of an api. - * @alias discovery.apis.getRest - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.api The name of the API. - * @param {string} params.version The version of the API. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRest(params?: any, options?: MethodOptions): - AxiosPromise; - getRest( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRest( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Apis { + root: Discovery; + constructor(root: Discovery) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/discovery/v1/apis/{api}/{version}/rest') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['api', 'version'], - pathParams: ['api', 'version'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * discovery.apis.list - * @desc Retrieve the list of APIs supported at this endpoint. - * @alias discovery.apis.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.name Only include APIs with the given name. - * @param {boolean=} params.preferred Return only the preferred version of an API. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * discovery.apis.getRest + * @desc Retrieve the description of a particular version of an api. + * @alias discovery.apis.getRest + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.api The name of the API. + * @param {string} params.version The version of the API. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRest(params?: any, options?: MethodOptions): + AxiosPromise; + getRest( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRest( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/discovery/v1/apis/{api}/{version}/rest') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['api', 'version'], + pathParams: ['api', 'version'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/discovery/v1/apis').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * discovery.apis.list + * @desc Retrieve the list of APIs supported at this endpoint. + * @alias discovery.apis.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.name Only include APIs with the given name. + * @param {boolean=} params.preferred Return only the preferred version of an API. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/discovery/v1/apis') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/dlp/v2.ts b/src/apis/dlp/v2.ts index 35a9c011bb0..7dc56dd1a79 100644 --- a/src/apis/dlp/v2.ts +++ b/src/apis/dlp/v2.ts @@ -27,5570 +27,5622 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Data Loss Prevention (DLP) API - * - * Provides methods for detection, risk analysis, and de-identification of - * privacy-sensitive fragments in text, images, and Google Cloud Platform - * storage repositories. - * - * @example - * const google = require('googleapis'); - * const dlp = google.dlp('v2'); - * - * @namespace dlp - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Dlp - */ -export class Dlp { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dlp_v2 { + /** + * Cloud Data Loss Prevention (DLP) API + * + * Provides methods for detection, risk analysis, and de-identification of + * privacy-sensitive fragments in text, images, and Google Cloud Platform + * storage repositories. + * + * @example + * const google = require('googleapis'); + * const dlp = google.dlp('v2'); + * + * @namespace dlp + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Dlp + */ + export class Dlp { + _options: GlobalOptions; + google: GoogleApis; + root = this; - infoTypes: Resource$Infotypes; - organizations: Resource$Organizations; - projects: Resource$Projects; + infoTypes: Resource$Infotypes; + organizations: Resource$Organizations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.infoTypes = new Resource$Infotypes(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - } + this.infoTypes = new Resource$Infotypes(this); + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A task to execute on the completion of a job. - */ -export interface Schema$GooglePrivacyDlpV2Action { /** - * Publish a notification to a pubsub topic. - */ - pubSub: Schema$GooglePrivacyDlpV2PublishToPubSub; + * A task to execute on the completion of a job. + */ + export interface Schema$GooglePrivacyDlpV2Action { + /** + * Publish a notification to a pubsub topic. + */ + pubSub: Schema$GooglePrivacyDlpV2PublishToPubSub; + /** + * Save resulting findings in a provided location. + */ + saveFindings: Schema$GooglePrivacyDlpV2SaveFindings; + } /** - * Save resulting findings in a provided location. - */ - saveFindings: Schema$GooglePrivacyDlpV2SaveFindings; -} -/** - * Result of a risk analysis operation request. - */ -export interface Schema$GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails { - categoricalStatsResult: Schema$GooglePrivacyDlpV2CategoricalStatsResult; - kAnonymityResult: Schema$GooglePrivacyDlpV2KAnonymityResult; - kMapEstimationResult: Schema$GooglePrivacyDlpV2KMapEstimationResult; - lDiversityResult: Schema$GooglePrivacyDlpV2LDiversityResult; - numericalStatsResult: Schema$GooglePrivacyDlpV2NumericalStatsResult; + * Result of a risk analysis operation request. + */ + export interface Schema$GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails { + categoricalStatsResult: Schema$GooglePrivacyDlpV2CategoricalStatsResult; + kAnonymityResult: Schema$GooglePrivacyDlpV2KAnonymityResult; + kMapEstimationResult: Schema$GooglePrivacyDlpV2KMapEstimationResult; + lDiversityResult: Schema$GooglePrivacyDlpV2LDiversityResult; + numericalStatsResult: Schema$GooglePrivacyDlpV2NumericalStatsResult; + /** + * Privacy metric to compute. + */ + requestedPrivacyMetric: Schema$GooglePrivacyDlpV2PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + requestedSourceTable: Schema$GooglePrivacyDlpV2BigQueryTable; + } /** - * Privacy metric to compute. - */ - requestedPrivacyMetric: Schema$GooglePrivacyDlpV2PrivacyMetric; + * An auxiliary table contains statistical information on the relative + * frequency of different quasi-identifiers values. It has one or several + * quasi-identifiers columns, and one column that indicates the relative + * frequency of each quasi-identifier tuple. If a tuple is present in the data + * but not in the auxiliary table, the corresponding relative frequency is + * assumed to be zero (and thus, the tuple is highly reidentifiable). + */ + export interface Schema$GooglePrivacyDlpV2AuxiliaryTable { + /** + * Quasi-identifier columns. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2QuasiIdField[]; + /** + * The relative frequency column must contain a floating-point number + * between 0 and 1 (inclusive). Null values are assumed to be zero. + * [required] + */ + relativeFrequency: Schema$GooglePrivacyDlpV2FieldId; + /** + * Auxiliary table location. [required] + */ + table: Schema$GooglePrivacyDlpV2BigQueryTable; + } /** - * Input dataset to compute metrics over. - */ - requestedSourceTable: Schema$GooglePrivacyDlpV2BigQueryTable; -} -/** - * An auxiliary table contains statistical information on the relative frequency - * of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. If a tuple is present in the data - * but not in the auxiliary table, the corresponding relative frequency is - * assumed to be zero (and thus, the tuple is highly reidentifiable). - */ -export interface Schema$GooglePrivacyDlpV2AuxiliaryTable { + * An auxiliary table contains statistical information on the relative + * frequency of different quasi-identifiers values. It has one or several + * quasi-identifiers columns, and one column that indicates the relative + * frequency of each quasi-identifier tuple. If a tuple is present in the data + * but not in the auxiliary table, the corresponding relative frequency is + * assumed to be zero (and thus, the tuple is highly reidentifiable). + */ + export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { + /** + * Quasi-identifier columns. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + /** + * The relative frequency column must contain a floating-point number + * between 0 and 1 (inclusive). Null values are assumed to be zero. + * [required] + */ + relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * Auxiliary table location. [required] + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Quasi-identifier columns. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2QuasiIdField[]; + * Options defining BigQuery table and row identifiers. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. Nested + * fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * The relative frequency column must contain a floating-point number between - * 0 and 1 (inclusive). Null values are assumed to be zero. [required] - */ - relativeFrequency: Schema$GooglePrivacyDlpV2FieldId; + * Message defining the location of a BigQuery table. A table is uniquely + * identified by its project_id, dataset_id, and table_name. Within a query a + * table is often referenced with a string in the format of: + * `<project_id>:<dataset_id>.<table_id>` or + * `<project_id>.<dataset_id>.<table_id>`. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + /** + * Dataset ID of the table. + */ + datasetId: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId: string; + /** + * Name of the table. + */ + tableId: string; + } /** - * Auxiliary table location. [required] + * Compute numerical stats over an individual column, including number of + * distinct values and value count distribution. */ - table: Schema$GooglePrivacyDlpV2BigQueryTable; -} -/** - * An auxiliary table contains statistical information on the relative frequency - * of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. If a tuple is present in the data - * but not in the auxiliary table, the corresponding relative frequency is - * assumed to be zero (and thus, the tuple is highly reidentifiable). - */ -export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are supported + * except for arrays and structs. However, it may be more informative to use + * NumericalStats when the field type is supported, depending on the data. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Quasi-identifier columns. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + * Histogram bucket of value frequencies in the column. + */ + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of value frequencies in this bucket. The total number of values + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + /** + * Lower bound on the value frequency of the values in this bucket. + */ + valueFrequencyLowerBound: string; + /** + * Upper bound on the value frequency of the values in this bucket. + */ + valueFrequencyUpperBound: string; + } /** - * The relative frequency column must contain a floating-point number between - * 0 and 1 (inclusive). Null values are assumed to be zero. [required] + * Result of the categorical stats computation. */ - relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + /** + * Histogram of value frequencies in the column. + */ + valueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; + } /** - * Auxiliary table location. [required] + * Options defining a file or a set of files (path ending with *) within a + * Google Cloud Storage bucket. */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Options defining BigQuery table and row identifiers. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { + fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; + } /** - * References to fields uniquely identifying rows within the table. Nested - * fields in the format, like `person.birthdate.year`, are allowed. + * A location in Cloud Storage. */ - identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + /** + * The url, in the format of `gs://bucket/<path>`. + */ + path: string; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query a - * table is often referenced with a string in the format of: - * `<project_id>:<dataset_id>.<table_id>` or - * `<project_id>.<dataset_id>.<table_id>`. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + * Custom information type provided by the user. Used to find domain-specific + * sensitive information configurable to the data in question. + */ + export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + /** + * Dictionary-based custom info type. + */ + dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + /** + * Info type configuration. All custom info types must have configurations + * that do not conflict with built-in info types or other custom info types. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Surrogate info type. + */ + surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; + } /** - * Dataset ID of the table. - */ - datasetId: string; + * Options defining a data set within Google Cloud Datastore. + */ + export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + /** + * The kind to process. + */ + kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + /** + * Properties to scan. If none are specified, all properties will be scanned + * by default. + */ + projection: Schema$GooglePrivacyDlpV2beta1Projection[]; + } /** - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. - */ - projectId: string; + * Custom information type based on a dictionary of words or phrases. This can + * be used to match sensitive information specific to the data, such as a list + * of employee IDs or job titles. Dictionary words are case-insensitive and + * all characters other than letters and digits in the unicode [Basic + * Multilingual + * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + * will be replaced with whitespace when scanning for matches, so the + * dictionary phrase "Sam Johnson" will match all three phrases + * "sam johnson", "Sam, Johnson", and "Sam + * (Johnson)". Additionally, the characters surrounding any match must be + * of a different type than the adjacent characters within the word, so + * letters must be next to non-letters and digits next to non-digits. For + * example, the dictionary word "jen" will match the first three + * letters of the text "jen123" but will return no matches for + * "jennifer". Dictionary words containing a large number of + * characters that are not letters or digits may result in unexpected findings + * because such characters are treated as whitespace. + */ + export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + /** + * List of words or phrases to search for. + */ + wordList: Schema$GooglePrivacyDlpV2beta1WordList; + } /** - * Name of the table. - */ - tableId: string; -} -/** - * Compute numerical stats over an individual column, including number of - * distinct values and value count distribution. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + * An entity in a dataset is a field or set of fields that correspond to a + * single person. For example, in medical records the `EntityId` might be a + * patient identifier, or for financial records it might be an account + * identifier. This message is used when generalizations or analysis must be + * consistent across multiple rows pertaining to the same entity. + */ + export interface Schema$GooglePrivacyDlpV2beta1EntityId { + /** + * Composite key indicating which field contains the entity identifier. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Field to compute categorical stats on. All column types are supported - * except for arrays and structs. However, it may be more informative to use - * NumericalStats when the field type is supported, depending on the data. + * General identifier of a data field in a storage service. */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Histogram bucket of value frequencies in the column. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + export interface Schema$GooglePrivacyDlpV2beta1FieldId { + /** + * Name describing the field. + */ + columnName: string; + } /** - * Total number of records in this bucket. + * Set of files to scan. */ - bucketSize: string; + export interface Schema$GooglePrivacyDlpV2beta1FileSet { + /** + * The url, in the format `gs://<bucket>/<path>`. Trailing + * wildcard in the path is allowed. + */ + url: string; + } /** - * Sample of value frequencies in this bucket. The total number of values - * returned per bucket is capped at 20. + * Type of information detected by the API. */ - bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + export interface Schema$GooglePrivacyDlpV2beta1InfoType { + /** + * Name of the information type. + */ + name: string; + } /** - * Lower bound on the value frequency of the values in this bucket. - */ - valueFrequencyLowerBound: string; + * Max findings configuration per info type, per content item or long running + * operation. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Max findings limit for the given infoType. + */ + maxFindings: number; + } /** - * Upper bound on the value frequency of the values in this bucket. - */ - valueFrequencyUpperBound: string; -} -/** - * Result of the categorical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + * Statistics regarding a specific InfoType. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { + /** + * Number of findings for this info type. + */ + count: string; + /** + * The type of finding this stat is for. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * Histogram of value frequencies in the column. - */ - valueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; -} -/** - * Options defining a file or a set of files (path ending with *) within a - * Google Cloud Storage bucket. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { - fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; -} -/** - * A location in Cloud Storage. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + * Configuration description of the scanning process. When used with + * redactContent only info_types and min_likelihood are currently used. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { + /** + * Custom info types provided by the user. + */ + customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; + /** + * When true, excludes type information of the findings. + */ + excludeTypes: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote: boolean; + /** + * Configuration of findings limit given for specified info types. + */ + infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + /** + * Limits the number of findings per content item or long running operation. + */ + maxFindings: number; + /** + * Only returns findings equal or above this threshold. + */ + minLikelihood: string; + } /** - * The url, in the format of `gs://bucket/<path>`. - */ - path: string; -} -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - */ -export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + * Metadata returned within GetOperation for an inspect request. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + /** + * Total size in bytes that were processed. + */ + processedBytes: string; + /** + * The inspect config used to create the Operation. + */ + requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * Optional location to store findings. + */ + requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + /** + * The storage config used to create the Operation. + */ + requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + /** + * Estimate of the number of bytes to process. + */ + totalEstimatedBytes: string; + } /** - * Dictionary-based custom info type. + * The operational data. */ - dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `inspect/results/{id}`. + */ + name: string; + } /** - * Info type configuration. All custom info types must have configurations - * that do not conflict with built-in info types or other custom info types. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + * k-anonymity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { + /** + * Optional message indicating that each distinct entity_id should not + * contribute to the k-anonymity count more than once per equivalence class. + * If an entity_id appears on several rows with different quasi-identifier + * tuples, it will contribute to each count exactly once. This can lead to + * unexpected results. Consider a table where ID 1 is associated to + * quasi-identifier "foo", ID 2 to "bar", and ID 3 to + * *both* quasi-identifiers "foo" and "bar" (on separate + * rows), and where this ID is used as entity_id. Then, the anonymity value + * associated to ID 3 will be 2, even if it is the only ID to be associated + * to both values "foo" and "bar". + */ + entityId: Schema$GooglePrivacyDlpV2beta1EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within a + * repeated field. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + } /** - * Surrogate info type. - */ - surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; -} -/** - * Options defining a data set within Google Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + * The set of columns' values that share the same k-anonymity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the above + * set of values. + */ + equivalenceClassSize: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * The kind to process. - */ - kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + * Histogram bucket of equivalence class sizes in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + /** + * Lower bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeLowerBound: string; + /** + * Upper bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeUpperBound: string; + } /** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. + * Result of the k-anonymity computation. */ - partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { + /** + * Histogram of k-anonymity equivalence classes. + */ + equivalenceClassHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; + } /** - * Properties to scan. If none are specified, all properties will be scanned - * by default. + * A representation of a Datastore kind. */ - projection: Schema$GooglePrivacyDlpV2beta1Projection[]; -} -/** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. Dictionary words are case-insensitive and all - * characters other than letters and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the dictionary - * phrase "Sam Johnson" will match all three phrases "sam - * johnson", "Sam, Johnson", and "Sam (Johnson)". - * Additionally, the characters surrounding any match must be of a different - * type than the adjacent characters within the word, so letters must be next to - * non-letters and digits next to non-digits. For example, the dictionary word - * "jen" will match the first three letters of the text - * "jen123" but will return no matches for "jennifer". - * Dictionary words containing a large number of characters that are not letters - * or digits may result in unexpected findings because such characters are - * treated as whitespace. - */ -export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + export interface Schema$GooglePrivacyDlpV2beta1KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * List of words or phrases to search for. - */ - wordList: Schema$GooglePrivacyDlpV2beta1WordList; -} -/** - * An entity in a dataset is a field or set of fields that correspond to a - * single person. For example, in medical records the `EntityId` might be a - * patient identifier, or for financial records it might be an account - * identifier. This message is used when generalizations or analysis must be - * consistent across multiple rows pertaining to the same entity. - */ -export interface Schema$GooglePrivacyDlpV2beta1EntityId { + * Reidentifiability metric. This corresponds to a risk model similar to what + * is called "journalist risk" in the literature, except the attack + * dataset is statistically modeled instead of being perfectly known. This can + * be done using publicly available data (like the US Census), or using a + * custom statistical model (indicated as one or several BigQuery tables), or + * by extrapolating from the distribution of values in the input dataset. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { + /** + * Several auxiliary tables can be used in the analysis. Each custom_tag + * used to tag a quasi-identifiers column must appear in exactly one column + * of one auxiliary table. + */ + auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; + /** + * Fields considered to be quasi-identifiers. No two columns can have the + * same tag. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; + /** + * ISO 3166-1 alpha-2 region code to use in the statistical modeling. + * Required if no column is tagged with a region-specific InfoType (like + * US_ZIP_5) or a region code. + */ + regionCode: string; + } /** - * Composite key indicating which field contains the entity identifier. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * General identifier of a data field in a storage service. - */ -export interface Schema$GooglePrivacyDlpV2beta1FieldId { + * A KMapEstimationHistogramBucket message with the following values: + * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 + * records whose quasi-identifier values correspond to 3, 4 or 5 people in the + * overlying population. An important particular case is when min_anonymity = + * max_anonymity = 1: the frequency field then corresponds to the number of + * uniquely identifiable records. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { + /** + * Number of records within these anonymity bounds. + */ + bucketSize: string; + /** + * Sample of quasi-identifier tuple values in this bucket. The total number + * of classes returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; + /** + * Always greater than or equal to min_anonymity. + */ + maxAnonymity: string; + /** + * Always positive. + */ + minAnonymity: string; + } /** - * Name describing the field. - */ - columnName: string; -} -/** - * Set of files to scan. - */ -export interface Schema$GooglePrivacyDlpV2beta1FileSet { + * A tuple of values for the quasi-identifier columns. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { + /** + * The estimated anonymity for these quasi-identifier values. + */ + estimatedAnonymity: string; + /** + * The quasi-identifier values. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * The url, in the format `gs://<bucket>/<path>`. Trailing - * wildcard in the path is allowed. - */ - url: string; -} -/** - * Type of information detected by the API. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoType { + * Result of the reidentifiability analysis. Note that these results are an + * estimation, not exact values. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { + /** + * The intervals [min_anonymity, max_anonymity] do not overlap. If a value + * doesn't correspond to any such interval, the associated frequency is + * zero. For example, the following records: {min_anonymity: 1, + * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, + * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} + * mean that there are no record with an estimated anonymity of 4, 5, or + * larger than 10. + */ + kMapEstimationHistogram: + Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; + } /** - * Name of the information type. - */ - name: string; -} -/** - * Max findings configuration per info type, per content item or long running - * operation. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { + * l-diversity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are defined + * for the l-diversity computation. When multiple fields are specified, they + * are considered a single composite key. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Sensitive field for computing the l-value. + */ + sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an info_type, - * the DLP API applies the limit against all info_types that are found but not - * specified in another InfoTypeLimit. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + * The set of columns' values that share the same l-diversity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + /** + * Size of the k-anonymity equivalence class. + */ + equivalenceClassSize: string; + /** + * Number of distinct sensitive values in this equivalence class. + */ + numDistinctSensitiveValues: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence class. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + /** + * Estimated frequencies of top sensitive values. + */ + topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + } /** - * Max findings limit for the given infoType. - */ - maxFindings: number; -} -/** - * Statistics regarding a specific InfoType. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { + * Histogram bucket of sensitive value frequencies in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyLowerBound: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyUpperBound: string; + } /** - * Number of findings for this info type. + * Result of the l-diversity computation. */ - count: string; + export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { + /** + * Histogram of l-diversity equivalence class sensitive value frequencies. + */ + sensitiveValueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; + } /** - * The type of finding this stat is for. + * Compute numerical stats over an individual column, including min, max, and + * quantiles. */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * Configuration description of the scanning process. When used with - * redactContent only info_types and min_likelihood are currently used. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are integer, float, + * date, datetime, timestamp, time. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Custom info types provided by the user. - */ - customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; + * Result of the numerical stats computation. + */ + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { + /** + * Maximum value appearing in the column. + */ + maxValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Minimum value appearing in the column. + */ + minValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * When true, excludes type information of the findings. - */ - excludeTypes: boolean; + * Cloud repository for storing output. + */ + export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { + /** + * The path to a Google Cloud Storage location to store output. The bucket + * must already exist and the Google APIs service account for DLP must have + * write permission to write to the given bucket. Results are split over + * multiple csv files with each file name matching the pattern + * "[operation_id]_[count].csv", for example + * `3094877188788974909_1.csv`. The `operation_id` matches the identifier + * for the Operation, and the `count` is a counter used for tracking the + * number of files written. The CSV file(s) contain the following columns + * regardless of storage type scanned: - id - info_type - likelihood - byte + * size of finding - quote - timestamp For Cloud Storage the next columns + * are: - file_path - start_offset For Cloud Datastore the next columns + * are: - project_id - namespace_id - path - column_name - offset For + * BigQuery the next columns are: - row_number - project_id - dataset_id - + * table_id + */ + storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; + /** + * Store findings in a new table in the dataset. + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. - */ - includeQuote: boolean; + * Datastore partition ID. A partition ID identifies a grouping of entities. + * The grouping is always by project and namespace, however the namespace ID + * may be empty. A partition ID contains several dimensions: project ID and + * namespace ID. + */ + export interface Schema$GooglePrivacyDlpV2beta1PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * Configuration of findings limit given for specified info types. + * Privacy metric to compute for reidentification risk analysis. */ - infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; + export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { + categoricalStatsConfig: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; + kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; + kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; + lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; + numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; + } /** - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or found in documentation. Empty - * info_types runs all enabled detectors. + * A representation of a Datastore property in a projection. */ - infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + export interface Schema$GooglePrivacyDlpV2beta1Projection { + /** + * The property to project. + */ + property: Schema$GooglePrivacyDlpV2beta1PropertyReference; + } /** - * Limits the number of findings per content item or long running operation. + * A reference to a property relative to the Datastore kind expressions. */ - maxFindings: number; + export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { + /** + * The name of the property. If name includes "."s, it may be + * interpreted as a property name path. + */ + name: string; + } /** - * Only returns findings equal or above this threshold. + * A quasi-identifier column has a custom_tag, used to know which column in + * the data corresponds to which column in the statistical model. */ - minLikelihood: string; -} -/** - * Metadata returned within GetOperation for an inspect request. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { + export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { + customTag: string; + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * The time which this request was started. - */ - createTime: string; - infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + * Metadata returned within the + * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) + * for risk analysis. + */ + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + /** + * Privacy metric to compute. + */ + requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Total size in bytes that were processed. + * Result of a risk analysis + * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. */ - processedBytes: string; + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { + categoricalStatsResult: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; + kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; + kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; + lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; + numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; + } /** - * The inspect config used to create the Operation. - */ - requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + * Shared message indicating Cloud storage type. + */ + export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + /** + * BigQuery options specification. + */ + bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + /** + * Google Cloud Storage options specification. + */ + cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + /** + * Google Cloud Datastore options specification. + */ + datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; + } /** - * Optional location to store findings. - */ - requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + * Message for detecting output from deidentification transformations such as + * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). + * These types of transformations are those that perform pseudonymization, + * thereby producing a "surrogate" as output. This should be used in + * conjunction with a field on the transformation such as + * `surrogate_info_type`. This custom info type does not support the use of + * `detection_rules`. + */ + export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} + /** + * A column with a semantic tag attached. + */ + export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + /** + * A column can be tagged with a custom tag. In this case, the user must + * indicate an auxiliary table that contains statistical information on the + * possible values of this column (below). + */ + customTag: string; + /** + * Identifies the column. [required] + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * If no semantic tag is indicated, we infer the statistical model from the + * distribution of values in the input data + */ + inferred: Schema$GoogleProtobufEmpty; + /** + * A column can be tagged with a InfoType to use the relevant public dataset + * as a statistical model of population, if available. We currently support + * US ZIP codes, region codes, ages and genders. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * The storage config used to create the Operation. - */ - requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + * Set of primitive values supported by the system. Note that for the purposes + * of inspection or transformation, the number of bytes considered to comprise + * a 'Value' is based on its representation as a UTF-8 encoded string. + * For example, if 'integer_value' is set to 123456789, the number of + * bytes would be counted as 9, even though an int64 only holds up to 8 bytes + * of data. + */ + export interface Schema$GooglePrivacyDlpV2beta1Value { + booleanValue: boolean; + dateValue: Schema$GoogleTypeDate; + floatValue: number; + integerValue: string; + stringValue: string; + timestampValue: string; + timeValue: Schema$GoogleTypeTimeOfDay; + } /** - * Estimate of the number of bytes to process. - */ - totalEstimatedBytes: string; -} -/** - * The operational data. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { + * A value of a field, including its frequency. + */ + export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + /** + * How many times the value is contained in the field. + */ + count: string; + /** + * A value contained in the field in question. + */ + value: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `inspect/results/{id}`. + * Message defining a list of words or phrases to search for in the data. */ - name: string; -} -/** - * k-anonymity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { - /** - * Optional message indicating that each distinct entity_id should not - * contribute to the k-anonymity count more than once per equivalence class. - * If an entity_id appears on several rows with different quasi-identifier - * tuples, it will contribute to each count exactly once. This can lead to - * unexpected results. Consider a table where ID 1 is associated to - * quasi-identifier "foo", ID 2 to "bar", and ID 3 to - * *both* quasi-identifiers "foo" and "bar" (on separate - * rows), and where this ID is used as entity_id. Then, the anonymity value - * associated to ID 3 will be 2, even if it is the only ID to be associated to - * both values "foo" and "bar". - */ - entityId: Schema$GooglePrivacyDlpV2beta1EntityId; - /** - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and repeated - * data types are not supported; however, nested fields are supported so long - * as they are not structs themselves or nested within a repeated field. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; -} -/** - * The set of columns' values that share the same k-anonymity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + export interface Schema$GooglePrivacyDlpV2beta1WordList { + /** + * Words or phrases defining the dictionary. The dictionary must contain at + * least one phrase and every phrase must contain at least 2 characters that + * are letters or digits. [required] + */ + words: string[]; + } /** - * Size of the equivalence class, for example number of rows with the above - * set of values. - */ - equivalenceClassSize: string; + * Row key for identifying a record in BigQuery table. + */ + export interface Schema$GooglePrivacyDlpV2BigQueryKey { + /** + * Absolute number of the row from the beginning of the table at the time of + * scanning. + */ + rowNumber: string; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2BigQueryTable; + } /** - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Histogram bucket of equivalence class sizes in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + * Options defining BigQuery table and row identifiers. + */ + export interface Schema$GooglePrivacyDlpV2BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. Nested + * fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields: Schema$GooglePrivacyDlpV2FieldId[]; + /** + * Max number of rows to scan. If the table has more rows than this value, + * the rest of the rows are omitted. If not set, or if set to 0, all rows + * will be scanned. Cannot be used in conjunction with TimespanConfig. + */ + rowsLimit: string; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2BigQueryTable; + } /** - * Total number of records in this bucket. - */ - bucketSize: string; + * Message defining the location of a BigQuery table. A table is uniquely + * identified by its project_id, dataset_id, and table_name. Within a query a + * table is often referenced with a string in the format of: + * `<project_id>:<dataset_id>.<table_id>` or + * `<project_id>.<dataset_id>.<table_id>`. + */ + export interface Schema$GooglePrivacyDlpV2BigQueryTable { + /** + * Dataset ID of the table. + */ + datasetId: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId: string; + /** + * Name of the table. + */ + tableId: string; + } /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + * Bounding box encompassing detected text within an image. + */ + export interface Schema$GooglePrivacyDlpV2BoundingBox { + /** + * Height of the bounding box in pixels. + */ + height: number; + /** + * Left coordinate of the bounding box. (0,0) is upper left. + */ + left: number; + /** + * Top coordinate of the bounding box. (0,0) is upper left. + */ + top: number; + /** + * Width of the bounding box in pixels. + */ + width: number; + } /** - * Lower bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeLowerBound: string; + * Bucket is represented as a range, along with replacement values. + */ + export interface Schema$GooglePrivacyDlpV2Bucket { + /** + * Upper bound of the range, exclusive; type must match min. + */ + max: Schema$GooglePrivacyDlpV2Value; + /** + * Lower bound of the range, inclusive. Type should be the same as max if + * used. + */ + min: Schema$GooglePrivacyDlpV2Value; + /** + * Replacement value for this bucket. If not provided the default behavior + * will be to hyphenate the min-max range. + */ + replacementValue: Schema$GooglePrivacyDlpV2Value; + } /** - * Upper bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeUpperBound: string; -} -/** - * Result of the k-anonymity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { + * Generalization function that buckets values based on ranges. The ranges and + * replacement values are dynamically provided by the user for custom + * behavior, such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This + * can be used on data of type: number, long, string, timestamp. If the bound + * `Value` type differs from the type of data being transformed, we will first + * attempt converting the type of the data to be transformed to match the type + * of the bound before comparing. + */ + export interface Schema$GooglePrivacyDlpV2BucketingConfig { + /** + * Set of buckets. Ranges must be non-overlapping. + */ + buckets: Schema$GooglePrivacyDlpV2Bucket[]; + } /** - * Histogram of k-anonymity equivalence classes. - */ - equivalenceClassHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; -} -/** - * A representation of a Datastore kind. - */ -export interface Schema$GooglePrivacyDlpV2beta1KindExpression { + * Container for bytes to inspect or redact. + */ + export interface Schema$GooglePrivacyDlpV2ByteContentItem { + /** + * Content data to inspect or redact. + */ + data: string; + /** + * The type of data stored in the bytes string. Default will be TEXT_UTF8. + */ + type: string; + } /** - * The name of the kind. + * The request message for canceling a DLP job. */ - name: string; -} -/** - * Reidentifiability metric. This corresponds to a risk model similar to what is - * called "journalist risk" in the literature, except the attack - * dataset is statistically modeled instead of being perfectly known. This can - * be done using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { + export interface Schema$GooglePrivacyDlpV2CancelDlpJobRequest {} /** - * Several auxiliary tables can be used in the analysis. Each custom_tag used - * to tag a quasi-identifiers column must appear in exactly one column of one - * auxiliary table. + * Compute numerical stats over an individual column, including number of + * distinct values and value count distribution. */ - auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; + export interface Schema$GooglePrivacyDlpV2CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are supported + * except for arrays and structs. However, it may be more informative to use + * NumericalStats when the field type is supported, depending on the data. + */ + field: Schema$GooglePrivacyDlpV2FieldId; + } + export interface Schema$GooglePrivacyDlpV2CategoricalStatsHistogramBucket { + /** + * Total number of values in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct values in this bucket. + */ + bucketValueCount: string; + /** + * Sample of value frequencies in this bucket. The total number of values + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2ValueFrequency[]; + /** + * Lower bound on the value frequency of the values in this bucket. + */ + valueFrequencyLowerBound: string; + /** + * Upper bound on the value frequency of the values in this bucket. + */ + valueFrequencyUpperBound: string; + } /** - * Fields considered to be quasi-identifiers. No two columns can have the same - * tag. [required] + * Result of the categorical stats computation. */ - quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; + export interface Schema$GooglePrivacyDlpV2CategoricalStatsResult { + /** + * Histogram of value frequencies in the column. + */ + valueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2CategoricalStatsHistogramBucket[]; + } /** - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. Required - * if no column is tagged with a region-specific InfoType (like US_ZIP_5) or a - * region code. - */ - regionCode: string; -} -/** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 - * records whose quasi-identifier values correspond to 3, 4 or 5 people in the - * overlying population. An important particular case is when min_anonymity = - * max_anonymity = 1: the frequency field then corresponds to the number of - * uniquely identifiable records. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { + * Partially mask a string by replacing a given number of characters with a + * fixed character. Masking can start from the beginning or end of the string. + * This can be used on data of any type (numbers, longs, and so on) and when + * de-identifying structured data we'll attempt to preserve the original + * data's type. (This allows you to take a long like 123 and modify it to + * a string like **3. + */ + export interface Schema$GooglePrivacyDlpV2CharacterMaskConfig { + /** + * When masking a string, items in this list will be skipped when replacing. + * For example, if your string is 555-555-5555 and you ask us to skip `-` + * and mask 5 chars with * we would produce ***-*55-5555. + */ + charactersToIgnore: Schema$GooglePrivacyDlpV2CharsToIgnore[]; + /** + * Character to mask the sensitive values&mdash;for example, + * "*" for an alphabetic string such as name, or "0" for + * a numeric string such as ZIP code or credit card number. String must have + * length 1. If not supplied, we will default to "*" for strings, + * 0 for digits. + */ + maskingCharacter: string; + /** + * Number of characters to mask. If not set, all matching chars will be + * masked. Skipped characters do not count towards this tally. + */ + numberToMask: number; + /** + * Mask characters in reverse order. For example, if `masking_character` is + * '0', number_to_mask is 14, and `reverse_order` is false, then + * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is + * '*', `number_to_mask` is 3, and `reverse_order` is true, then + * 12345 -> 12*** + */ + reverseOrder: boolean; + } /** - * Number of records within these anonymity bounds. + * Characters to skip when doing deidentification of a value. These will be + * left alone and skipped. */ - bucketSize: string; + export interface Schema$GooglePrivacyDlpV2CharsToIgnore { + charactersToSkip: string; + commonCharactersToIgnore: string; + } /** - * Sample of quasi-identifier tuple values in this bucket. The total number of - * classes returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; + * Options defining a file or a set of files (path ending with *) within a + * Google Cloud Storage bucket. + */ + export interface Schema$GooglePrivacyDlpV2CloudStorageOptions { + /** + * Max number of bytes to scan from a file. If a scanned file's size is + * bigger than this value then the rest of the bytes are omitted. + */ + bytesLimitPerFile: string; + fileSet: Schema$GooglePrivacyDlpV2FileSet; + /** + * List of file type groups to include in the scan. If empty, all files are + * scanned and available data format processors are applied. + */ + fileTypes: string[]; + } /** - * Always greater than or equal to min_anonymity. - */ - maxAnonymity: string; + * Represents a color in the RGB color space. + */ + export interface Schema$GooglePrivacyDlpV2Color { + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * Always positive. - */ - minAnonymity: string; -} -/** - * A tuple of values for the quasi-identifier columns. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { + * The field type of `value` and `field` do not need to match to be considered + * equal, but not all comparisons are possible. A `value` of type: - + * `string` can be compared against all other types - `boolean` can only be + * compared against other booleans - `integer` can be compared against doubles + * or a string if the string value can be parsed as an integer. - `double` can + * be compared against integers or a string if the string can be parsed as a + * double. - `Timestamp` can be compared against strings in RFC 3339 date + * string format. - `TimeOfDay` can be compared against timestamps and strings + * in the format of 'HH:mm:ss'. If we fail to compare do to type + * mismatch, a warning will be given and the condition will evaluate to false. + */ + export interface Schema$GooglePrivacyDlpV2Condition { + /** + * Field within the record this condition is evaluated against. [required] + */ + field: Schema$GooglePrivacyDlpV2FieldId; + /** + * Operator used to compare the field or infoType to the value. [required] + */ + operator: string; + /** + * Value to compare against. [Required, except for `EXISTS` tests.] + */ + value: Schema$GooglePrivacyDlpV2Value; + } /** - * The estimated anonymity for these quasi-identifier values. + * A collection of conditions. */ - estimatedAnonymity: string; + export interface Schema$GooglePrivacyDlpV2Conditions { + conditions: Schema$GooglePrivacyDlpV2Condition[]; + } /** - * The quasi-identifier values. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { - /** - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: {min_anonymity: 1, - * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, - * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} mean - * that there are no record with an estimated anonymity of 4, 5, or larger - * than 10. - */ - kMapEstimationHistogram: - Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; -} -/** - * l-diversity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { + * Container structure for the content to inspect. + */ + export interface Schema$GooglePrivacyDlpV2ContentItem { + /** + * Content data to inspect or redact. Replaces `type` and `data`. + */ + byteItem: Schema$GooglePrivacyDlpV2ByteContentItem; + /** + * Structured content for inspection. + */ + table: Schema$GooglePrivacyDlpV2Table; + /** + * String data to inspect or redact. + */ + value: string; + } /** - * Set of quasi-identifiers indicating how equivalence classes are defined for - * the l-diversity computation. When multiple fields are specified, they are - * considered a single composite key. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + * Findings container location data. + */ + export interface Schema$GooglePrivacyDlpV2ContentLocation { + /** + * Name of the container where the finding is located. The top level name is + * the source file name or table name. Nested names could be absent if the + * embedded object has no string identifier (for an example an image + * contained within a document). + */ + containerName: string; + /** + * Findings container modification timestamp, if applicable. For Google + * Cloud Storage contains last file modification timestamp. For BigQuery + * table contains last_modified_time property. For Datastore - not + * populated. + */ + containerTimestamp: string; + /** + * Findings container version, if available ("generation" for + * Google Cloud Storage). + */ + containerVersion: string; + /** + * Location data for document files. + */ + documentLocation: Schema$GooglePrivacyDlpV2DocumentLocation; + /** + * Location within an image's pixels. + */ + imageLocation: Schema$GooglePrivacyDlpV2ImageLocation; + /** + * Location within a row or record of a database table. + */ + recordLocation: Schema$GooglePrivacyDlpV2RecordLocation; + } /** - * Sensitive field for computing the l-value. - */ - sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * The set of columns' values that share the same l-diversity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + * Request message for CreateDeidentifyTemplate. + */ + export interface Schema$GooglePrivacyDlpV2CreateDeidentifyTemplateRequest { + /** + * The DeidentifyTemplate to create. + */ + deidentifyTemplate: Schema$GooglePrivacyDlpV2DeidentifyTemplate; + /** + * The template id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + templateId: string; + } /** - * Size of the k-anonymity equivalence class. - */ - equivalenceClassSize: string; + * Request message for CreateDlpJobRequest. Used to initiate long running jobs + * such as calculating risk metrics or inspecting Google Cloud Storage. + */ + export interface Schema$GooglePrivacyDlpV2CreateDlpJobRequest { + inspectJob: Schema$GooglePrivacyDlpV2InspectJobConfig; + /** + * The job id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + jobId: string; + riskJob: Schema$GooglePrivacyDlpV2RiskAnalysisJobConfig; + } /** - * Number of distinct sensitive values in this equivalence class. - */ - numDistinctSensitiveValues: string; + * Request message for CreateInspectTemplate. + */ + export interface Schema$GooglePrivacyDlpV2CreateInspectTemplateRequest { + /** + * The InspectTemplate to create. + */ + inspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; + /** + * The template id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + templateId: string; + } /** - * Quasi-identifier values defining the k-anonymity equivalence class. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + * Request message for CreateJobTrigger. + */ + export interface Schema$GooglePrivacyDlpV2CreateJobTriggerRequest { + /** + * The JobTrigger to create. + */ + jobTrigger: Schema$GooglePrivacyDlpV2JobTrigger; + /** + * The trigger id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + triggerId: string; + } /** - * Estimated frequencies of top sensitive values. - */ - topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; -} -/** - * Histogram bucket of sensitive value frequencies in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + * Pseudonymization method that generates surrogates via cryptographic + * hashing. Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs + * a 32 byte digest as an uppercase hex string (for example, + * 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and integer + * values can be hashed. + */ + export interface Schema$GooglePrivacyDlpV2CryptoHashConfig { + /** + * The key used by the hash function. + */ + cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; + } /** - * Total number of records in this bucket. + * This is a data encryption key (DEK) (as opposed to a key encryption key + * (KEK) stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an + * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker + * cannot unwrap the data crypto key. */ - bucketSize: string; + export interface Schema$GooglePrivacyDlpV2CryptoKey { + kmsWrapped: Schema$GooglePrivacyDlpV2KmsWrappedCryptoKey; + transient: Schema$GooglePrivacyDlpV2TransientCryptoKey; + unwrapped: Schema$GooglePrivacyDlpV2UnwrappedCryptoKey; + } /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + * Replaces an identifier with a surrogate using FPE with the FFX mode of + * operation; however when used in the `ReidentifyContent` API method, it + * serves the opposite function by reversing the surrogate back into the + * original identifier. The identifier must be encoded as ASCII. For a given + * crypto key and context, the same identifier will be replaced with the same + * surrogate. Identifiers must be at least two characters long. In the case + * that the identifier is the empty string, it will be skipped. See + * [Pseudonymization](/dlp/docs/pseudonymization) for example usage. + */ + export interface Schema$GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig { + commonAlphabet: string; + /** + * The 'tweak', a context may be used for higher security since the + * same identifier in two different contexts won't be given the same + * surrogate. If the context is not set, a default tweak will be used. If + * the context is set but: 1. there is no record present when transforming + * a given value or 1. the field is not present when transforming a given + * value, a default tweak will be used. Note that case (1) is expected + * when an `InfoTypeTransformation` is applied to both structured and + * non-structured `ContentItem`s. Currently, the referenced field may be of + * value type integer or string. The tweak is constructed as a sequence of + * bytes in big endian byte order such that: - a 64 bit integer is encoded + * followed by a single byte of value 1 - a string is encoded in UTF-8 + * format followed by a single byte of value å 2 + */ + context: Schema$GooglePrivacyDlpV2FieldId; + /** + * The key used by the encryption algorithm. [required] + */ + cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; + /** + * This is supported by mapping these to the alphanumeric characters that + * the FFX mode natively supports. This happens before/after + * encryption/decryption. Each character listed must appear only once. + * Number of characters must be in the range [2, 62]. This must be encoded + * as ASCII. The order of characters does not matter. + */ + customAlphabet: string; + /** + * The native way to select the alphabet. Must be in the range [2, 62]. + */ + radix: number; + /** + * The custom infoType to annotate the surrogate with. This annotation will + * be applied to the surrogate by prefixing it with the name of the custom + * infoType followed by the number of characters comprising the surrogate. + * The following scheme defines the format: + * info_type_name(surrogate_character_count):surrogate For example, if the + * name of custom infoType is 'MY_TOKEN_INFO_TYPE' and the surrogate + * is 'abc', the full replacement value will be: + * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the + * surrogate when inspecting content using the custom infoType + * [`SurrogateType`](/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype). + * This facilitates reversal of the surrogate when it occurs in free text. + * In order for inspection to work properly, the name of this infoType must + * not occur naturally anywhere in your data; otherwise, inspection may find + * a surrogate that does not correspond to an actual identifier. Therefore, + * choose your custom infoType name carefully after considering what your + * data looks like. One way to select a name that has a high chance of + * yielding reliable detection is to include one or more unicode characters + * that are highly improbable to exist in your data. For example, assuming + * your data is entered from a regular ASCII keyboard, the symbol with the + * hex code point 29DD might be used like so: ⧝MY_TOKEN_TYPE + */ + surrogateInfoType: Schema$GooglePrivacyDlpV2InfoType; + } /** - * Lower bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyLowerBound: string; + * Custom information type provided by the user. Used to find domain-specific + * sensitive information configurable to the data in question. + */ + export interface Schema$GooglePrivacyDlpV2CustomInfoType { + /** + * Set of detection rules to apply to all findings of this custom info type. + * Rules are applied in order that they are specified. Not supported for the + * `surrogate_type` custom info type. + */ + detectionRules: Schema$GooglePrivacyDlpV2DetectionRule[]; + /** + * Dictionary-based custom info type. + */ + dictionary: Schema$GooglePrivacyDlpV2Dictionary; + /** + * Info type configuration. All custom info types must have configurations + * that do not conflict with built-in info types or other custom info types. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + /** + * Likelihood to return for this custom info type. This base value can be + * altered by a detection rule if the finding meets the criteria specified + * by the rule. Defaults to `VERY_LIKELY` if not specified. + */ + likelihood: string; + /** + * Regex-based custom info type. + */ + regex: Schema$GooglePrivacyDlpV2Regex; + /** + * Surrogate info type. + */ + surrogateType: Schema$GooglePrivacyDlpV2SurrogateType; + } /** - * Upper bound on the sensitive value frequencies of the equivalence classes - * in this bucket. + * Record key for a finding in Cloud Datastore. */ - sensitiveValueFrequencyUpperBound: string; -} -/** - * Result of the l-diversity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { + export interface Schema$GooglePrivacyDlpV2DatastoreKey { + /** + * Datastore entity key. + */ + entityKey: Schema$GooglePrivacyDlpV2Key; + } /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - */ - sensitiveValueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; -} -/** - * Compute numerical stats over an individual column, including min, max, and - * quantiles. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { + * Options defining a data set within Google Cloud Datastore. + */ + export interface Schema$GooglePrivacyDlpV2DatastoreOptions { + /** + * The kind to process. + */ + kind: Schema$GooglePrivacyDlpV2KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId: Schema$GooglePrivacyDlpV2PartitionId; + } /** - * Field to compute numerical stats on. Supported types are integer, float, - * date, datetime, timestamp, time. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Result of the numerical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { + * Shifts dates by random number of days, with option to be consistent for the + * same context. + */ + export interface Schema$GooglePrivacyDlpV2DateShiftConfig { + /** + * Points to the field that contains the context, for example, an entity id. + * If set, must also set method. If set, shift will be consistent for the + * given context. + */ + context: Schema$GooglePrivacyDlpV2FieldId; + /** + * Causes the shift to be computed based on this key and the context. This + * results in the same shift for the same context and crypto_key. + */ + cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; + /** + * For example, -5 means shift date to at most 5 days back in the past. + * [Required] + */ + lowerBoundDays: number; + /** + * Range of shift in days. Actual shift will be selected at random within + * this range (inclusive ends). Negative means shift to earlier in time. + * Must not be more than 365250 days (1000 years) each direction. For + * example, 3 means shift date to at most 3 days into the future. [Required] + */ + upperBoundDays: number; + } /** - * Maximum value appearing in the column. - */ - maxValue: Schema$GooglePrivacyDlpV2beta1Value; + * Message for a date time object. + */ + export interface Schema$GooglePrivacyDlpV2DateTime { + /** + * One or more of the following must be set. All fields are optional, but + * when set must be valid date or time values. + */ + date: Schema$GoogleTypeDate; + dayOfWeek: string; + time: Schema$GoogleTypeTimeOfDay; + timeZone: Schema$GooglePrivacyDlpV2TimeZone; + } /** - * Minimum value appearing in the column. - */ - minValue: Schema$GooglePrivacyDlpV2beta1Value; + * The configuration that controls how the data will change. + */ + export interface Schema$GooglePrivacyDlpV2DeidentifyConfig { + /** + * Treat the dataset as free-form text and apply the same free text + * transformation everywhere. + */ + infoTypeTransformations: Schema$GooglePrivacyDlpV2InfoTypeTransformations; + /** + * Treat the dataset as structured. Transformations can be applied to + * specific locations within structured datasets, such as transforming a + * column within a table. + */ + recordTransformations: Schema$GooglePrivacyDlpV2RecordTransformations; + } /** - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. - */ - quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Cloud repository for storing output. - */ -export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { - /** - * The path to a Google Cloud Storage location to store output. The bucket - * must already exist and the Google APIs service account for DLP must have - * write permission to write to the given bucket. Results are split over - * multiple csv files with each file name matching the pattern - * "[operation_id]_[count].csv", for example - * `3094877188788974909_1.csv`. The `operation_id` matches the identifier for - * the Operation, and the `count` is a counter used for tracking the number of - * files written. The CSV file(s) contain the following columns regardless of - * storage type scanned: - id - info_type - likelihood - byte size of finding - * - quote - timestamp For Cloud Storage the next columns are: - file_path - - * start_offset For Cloud Datastore the next columns are: - project_id - - * namespace_id - path - column_name - offset For BigQuery the next columns - * are: - row_number - project_id - dataset_id - table_id - */ - storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; - /** - * Store findings in a new table in the dataset. - */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Datastore partition ID. A partition ID identifies a grouping of entities. The - * grouping is always by project and namespace, however the namespace ID may be - * empty. A partition ID contains several dimensions: project ID and namespace - * ID. - */ -export interface Schema$GooglePrivacyDlpV2beta1PartitionId { + * Request to de-identify a list of items. + */ + export interface Schema$GooglePrivacyDlpV2DeidentifyContentRequest { + /** + * Configuration for the de-identification of the content item. Items + * specified here will override the template referenced by the + * deidentify_template_name argument. + */ + deidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; + /** + * Optional template to use. Any configuration directly specified in + * deidentify_config will override those set in the template. Singular + * fields that are set in this request will replace their corresponding + * fields in the template. Repeated fields are appended. Singular + * sub-messages and groups are recursively merged. + */ + deidentifyTemplateName: string; + /** + * Configuration for the inspector. Items specified here will override the + * template referenced by the inspect_template_name argument. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to de-identify. Will be treated as text. + */ + item: Schema$GooglePrivacyDlpV2ContentItem; + } /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; + * Results of de-identifying a ContentItem. + */ + export interface Schema$GooglePrivacyDlpV2DeidentifyContentResponse { + /** + * The de-identified item. + */ + item: Schema$GooglePrivacyDlpV2ContentItem; + /** + * An overview of the changes that were made on the `item`. + */ + overview: Schema$GooglePrivacyDlpV2TransformationOverview; + } /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * Privacy metric to compute for reidentification risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { - categoricalStatsConfig: Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; - kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; - kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; - lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; - numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; -} -/** - * A representation of a Datastore property in a projection. - */ -export interface Schema$GooglePrivacyDlpV2beta1Projection { + * The DeidentifyTemplates contains instructions on how to deidentify content. + */ + export interface Schema$GooglePrivacyDlpV2DeidentifyTemplate { + /** + * The creation timestamp of a inspectTemplate, output only field. + */ + createTime: string; + /** + * ///////////// // The core content of the template // /////////////// + */ + deidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; + /** + * Short description (max 256 chars). + */ + description: string; + /** + * Display name (max 256 chars). + */ + displayName: string; + /** + * The template name. Output only. The template will have one of the + * following formats: `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` + * OR `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` + */ + name: string; + /** + * The last update timestamp of a inspectTemplate, output only field. + */ + updateTime: string; + } /** - * The property to project. + * Rule for modifying a custom info type to alter behavior under certain + * circumstances, depending on the specific details of the rule. Not supported + * for the `surrogate_type` custom info type. */ - property: Schema$GooglePrivacyDlpV2beta1PropertyReference; -} -/** - * A reference to a property relative to the Datastore kind expressions. - */ -export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { + export interface Schema$GooglePrivacyDlpV2DetectionRule { + /** + * Hotword-based detection rule. + */ + hotwordRule: Schema$GooglePrivacyDlpV2HotwordRule; + } /** - * The name of the property. If name includes "."s, it may be - * interpreted as a property name path. - */ - name: string; -} -/** - * A quasi-identifier column has a custom_tag, used to know which column in the - * data corresponds to which column in the statistical model. - */ -export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { - customTag: string; - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Metadata returned within the - * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) - * for risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + * Custom information type based on a dictionary of words or phrases. This can + * be used to match sensitive information specific to the data, such as a list + * of employee IDs or job titles. Dictionary words are case-insensitive and + * all characters other than letters and digits in the unicode [Basic + * Multilingual + * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + * will be replaced with whitespace when scanning for matches, so the + * dictionary phrase "Sam Johnson" will match all three phrases + * "sam johnson", "Sam, Johnson", and "Sam + * (Johnson)". Additionally, the characters surrounding any match must be + * of a different type than the adjacent characters within the word, so + * letters must be next to non-letters and digits next to non-digits. For + * example, the dictionary word "jen" will match the first three + * letters of the text "jen123" but will return no matches for + * "jennifer". Dictionary words containing a large number of + * characters that are not letters or digits may result in unexpected findings + * because such characters are treated as whitespace. + */ + export interface Schema$GooglePrivacyDlpV2Dictionary { + /** + * List of words or phrases to search for. + */ + wordList: Schema$GooglePrivacyDlpV2WordList; + } /** - * The time which this request was started. - */ - createTime: string; + * Combines all of the information about a DLP job. + */ + export interface Schema$GooglePrivacyDlpV2DlpJob { + /** + * Time when the job was created. + */ + createTime: string; + /** + * Time when the job finished. + */ + endTime: string; + /** + * A stream of errors encountered running the job. + */ + errors: Schema$GooglePrivacyDlpV2Error[]; + /** + * Results from inspecting a data source. + */ + inspectDetails: Schema$GooglePrivacyDlpV2InspectDataSourceDetails; + /** + * If created by a job trigger, the resource name of the trigger that + * instantiated the job. + */ + jobTriggerName: string; + /** + * The server-assigned name. + */ + name: string; + /** + * Results from analyzing risk of a data source. + */ + riskDetails: Schema$GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails; + /** + * Time when the job started. + */ + startTime: string; + /** + * State of a job. + */ + state: string; + /** + * The type of job. + */ + type: string; + } /** - * Privacy metric to compute. + * Location of a finding within a document. */ - requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + export interface Schema$GooglePrivacyDlpV2DocumentLocation { + /** + * Offset of the line, from the beginning of the file, where the finding is + * located. + */ + fileOffset: string; + } /** - * Input dataset to compute metrics over. + * Details information about an error encountered during job execution or the + * results of an unsuccessful activation of the JobTrigger. Output only field. */ - requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Result of a risk analysis - * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { - categoricalStatsResult: Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; - kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; - kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; - lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; - numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; -} -/** - * Shared message indicating Cloud storage type. - */ -export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + export interface Schema$GooglePrivacyDlpV2Error { + details: Schema$GoogleRpcStatus; + /** + * The times the error occurred. + */ + timestamps: string[]; + } /** - * BigQuery options specification. + * An expression, consisting or an operator and conditions. */ - bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + export interface Schema$GooglePrivacyDlpV2Expressions { + conditions: Schema$GooglePrivacyDlpV2Conditions; + /** + * The operator to apply to the result of conditions. Default and currently + * only supported value is `AND`. + */ + logicalOperator: string; + } /** - * Google Cloud Storage options specification. + * General identifier of a data field in a storage service. */ - cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + export interface Schema$GooglePrivacyDlpV2FieldId { + /** + * Name describing the field. + */ + name: string; + } /** - * Google Cloud Datastore options specification. - */ - datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; -} -/** - * Message for detecting output from deidentification transformations such as - * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). - * These types of transformations are those that perform pseudonymization, - * thereby producing a "surrogate" as output. This should be used in - * conjunction with a field on the transformation such as `surrogate_info_type`. - * This custom info type does not support the use of `detection_rules`. - */ -export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} -/** - * A column with a semantic tag attached. - */ -export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + * The transformation to apply to the field. + */ + export interface Schema$GooglePrivacyDlpV2FieldTransformation { + /** + * Only apply the transformation if the condition evaluates to true for the + * given `RecordCondition`. The conditions are allowed to reference fields + * that are not used in the actual transformation. [optional] Example Use + * Cases: - Apply a different bucket transformation to an age column if the + * zip code column for the same record is within a specific range. - Redact + * a field if the date of birth field is greater than 85. + */ + condition: Schema$GooglePrivacyDlpV2RecordCondition; + /** + * Input field(s) to apply the transformation to. [required] + */ + fields: Schema$GooglePrivacyDlpV2FieldId[]; + /** + * Treat the contents of the field as free text, and selectively transform + * content that matches an `InfoType`. + */ + infoTypeTransformations: Schema$GooglePrivacyDlpV2InfoTypeTransformations; + /** + * Apply the transformation to the entire field. + */ + primitiveTransformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; + } /** - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on the - * possible values of this column (below). + * Set of files to scan. */ - customTag: string; + export interface Schema$GooglePrivacyDlpV2FileSet { + /** + * The url, in the format `gs://<bucket>/<path>`. Trailing + * wildcard in the path is allowed. + */ + url: string; + } /** - * Identifies the column. [required] - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; + * Represents a piece of potentially sensitive content. + */ + export interface Schema$GooglePrivacyDlpV2Finding { + /** + * Timestamp when finding was detected. + */ + createTime: string; + /** + * The type of content that might have been found. Provided if requested by + * the `InspectConfig`. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + /** + * Estimate of how likely it is that the `info_type` is correct. + */ + likelihood: string; + /** + * Where the content was found. + */ + location: Schema$GooglePrivacyDlpV2Location; + /** + * The content that was found. Even if the content is not textual, it may be + * converted to a textual representation here. Provided if requested by the + * `InspectConfig` and the finding is less than or equal to 4096 bytes long. + * If the finding exceeds 4096 bytes in length, the quote may be omitted. + */ + quote: string; + /** + * Contains data parsed from quotes. Only populated if include_quote was set + * to true and a supported infoType was requested. Currently supported + * infoTypes: DATE, DATE_OF_BIRTH and TIME. + */ + quoteInfo: Schema$GooglePrivacyDlpV2QuoteInfo; + } + export interface Schema$GooglePrivacyDlpV2FindingLimits { + /** + * Configuration of findings limit given for specified infoTypes. + */ + maxFindingsPerInfoType: Schema$GooglePrivacyDlpV2InfoTypeLimit[]; + /** + * Max number of findings that will be returned for each item scanned. When + * set within `InspectDataSourceRequest`, the maximum returned is 1000 + * regardless if this is set higher. When set within + * `InspectContentRequest`, this field is ignored. + */ + maxFindingsPerItem: number; + /** + * Max number of findings that will be returned per request/job. When set + * within `InspectContentRequest`, the maximum returned is 1000 regardless + * if this is set higher. + */ + maxFindingsPerRequest: number; + } /** - * If no semantic tag is indicated, we infer the statistical model from the - * distribution of values in the input data - */ - inferred: Schema$GoogleProtobufEmpty; + * Buckets values based on fixed size ranges. The Bucketing transformation can + * provide all of this functionality, but requires more configuration. This + * message is provided as a convenience to the user for simple bucketing + * strategies. The transformed value will be a hyphenated string of + * <lower_bound>-<upper_bound>, i.e if lower_bound = 10 and + * upper_bound = 20 all values that are within this bucket will be replaced + * with "10-20". This can be used on data of type: double, long. If + * the bound Value type differs from the type of data being transformed, we + * will first attempt converting the type of the data to be transformed to + * match the type of the bound before comparing. + */ + export interface Schema$GooglePrivacyDlpV2FixedSizeBucketingConfig { + /** + * Size of each bucket (except for minimum and maximum buckets). So if + * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + */ + bucketSize: number; + /** + * Lower bound value of buckets. All values less than `lower_bound` are + * grouped together into a single bucket; for example if `lower_bound` = 10, + * then all values less than 10 are replaced with the value “-10”. + * [Required]. + */ + lowerBound: Schema$GooglePrivacyDlpV2Value; + /** + * Upper bound value of buckets. All values greater than upper_bound are + * grouped together into a single bucket; for example if `upper_bound` = 89, + * then all values greater than 89 are replaced with the value “89+”. + * [Required]. + */ + upperBound: Schema$GooglePrivacyDlpV2Value; + } /** - * A column can be tagged with a InfoType to use the relevant public dataset - * as a statistical model of population, if available. We currently support US - * ZIP codes, region codes, ages and genders. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * Set of primitive values supported by the system. Note that for the purposes - * of inspection or transformation, the number of bytes considered to comprise a - * 'Value' is based on its representation as a UTF-8 encoded string. For - * example, if 'integer_value' is set to 123456789, the number of bytes - * would be counted as 9, even though an int64 only holds up to 8 bytes of data. - */ -export interface Schema$GooglePrivacyDlpV2beta1Value { - booleanValue: boolean; - dateValue: Schema$GoogleTypeDate; - floatValue: number; - integerValue: string; - stringValue: string; - timestampValue: string; - timeValue: Schema$GoogleTypeTimeOfDay; -} -/** - * A value of a field, including its frequency. - */ -export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + * Detection rule that adjusts the likelihood of findings within a certain + * proximity of hotwords. + */ + export interface Schema$GooglePrivacyDlpV2HotwordRule { + /** + * Regex pattern defining what qualifies as a hotword. + */ + hotwordRegex: Schema$GooglePrivacyDlpV2Regex; + /** + * Likelihood adjustment to apply to all matching findings. + */ + likelihoodAdjustment: Schema$GooglePrivacyDlpV2LikelihoodAdjustment; + /** + * Proximity of the finding within which the entire hotword must reside. The + * total length of the window cannot exceed 1000 characters. Note that the + * finding itself will be included in the window, so that hotwords may be + * used to match substrings of the finding itself. For example, the + * certainty of a phone number regex "\(\d{3}\) \d{3}-\d{4}" could + * be adjusted upwards if the area code is known to be the local area code + * of a company office using the hotword regex "\(xxx\)", where + * "xxx" is the area code in question. + */ + proximity: Schema$GooglePrivacyDlpV2Proximity; + } /** - * How many times the value is contained in the field. + * Location of the finding within an image. */ - count: string; + export interface Schema$GooglePrivacyDlpV2ImageLocation { + /** + * Bounding boxes locating the pixels within the image containing the + * finding. + */ + boundingBoxes: Schema$GooglePrivacyDlpV2BoundingBox[]; + } /** - * A value contained in the field in question. - */ - value: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Message defining a list of words or phrases to search for in the data. - */ -export interface Schema$GooglePrivacyDlpV2beta1WordList { + * Configuration for determining how redaction of images should occur. + */ + export interface Schema$GooglePrivacyDlpV2ImageRedactionConfig { + /** + * Only one per info_type should be provided per request. If not specified, + * and redact_all_text is false, the DLP API will redact all text that it + * matches against all info_types that are found, but not specified in + * another ImageRedactionConfig. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + /** + * If true, all text found in the image, regardless whether it matches an + * info_type, is redacted. + */ + redactAllText: boolean; + /** + * The color to use when redacting content from an image. If not specified, + * the default is black. + */ + redactionColor: Schema$GooglePrivacyDlpV2Color; + } /** - * Words or phrases defining the dictionary. The dictionary must contain at - * least one phrase and every phrase must contain at least 2 characters that - * are letters or digits. [required] + * Type of information detected by the API. */ - words: string[]; -} -/** - * Row key for identifying a record in BigQuery table. - */ -export interface Schema$GooglePrivacyDlpV2BigQueryKey { + export interface Schema$GooglePrivacyDlpV2InfoType { + /** + * Name of the information type. + */ + name: string; + } /** - * Absolute number of the row from the beginning of the table at the time of - * scanning. - */ - rowNumber: string; + * InfoType description. + */ + export interface Schema$GooglePrivacyDlpV2InfoTypeDescription { + /** + * Human readable form of the infoType name. + */ + displayName: string; + /** + * Internal name of the infoType. + */ + name: string; + /** + * Which parts of the API supports this InfoType. + */ + supportedBy: string[]; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2BigQueryTable; -} -/** - * Options defining BigQuery table and row identifiers. - */ -export interface Schema$GooglePrivacyDlpV2BigQueryOptions { + * Max findings configuration per infoType, per content item or long running + * DlpJob. + */ + export interface Schema$GooglePrivacyDlpV2InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + /** + * Max findings limit for the given infoType. + */ + maxFindings: number; + } /** - * References to fields uniquely identifying rows within the table. Nested - * fields in the format, like `person.birthdate.year`, are allowed. - */ - identifyingFields: Schema$GooglePrivacyDlpV2FieldId[]; + * Statistics regarding a specific InfoType. + */ + export interface Schema$GooglePrivacyDlpV2InfoTypeStats { + /** + * Number of findings for this infoType. + */ + count: string; + /** + * The type of finding this stat is for. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + } /** - * Max number of rows to scan. If the table has more rows than this value, the - * rest of the rows are omitted. If not set, or if set to 0, all rows will be - * scanned. Cannot be used in conjunction with TimespanConfig. - */ - rowsLimit: string; + * A transformation to apply to text that is identified as a specific + * info_type. + */ + export interface Schema$GooglePrivacyDlpV2InfoTypeTransformation { + /** + * InfoTypes to apply the transformation to. Empty list will match all + * available infoTypes for this transformation. + */ + infoTypes: Schema$GooglePrivacyDlpV2InfoType[]; + /** + * Primitive transformation to apply to the infoType. [required] + */ + primitiveTransformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; + } /** - * Complete BigQuery table reference. + * A type of transformation that will scan unstructured text and apply various + * `PrimitiveTransformation`s to each finding, where the transformation is + * applied to only values that were identified as a specific info_type. */ - tableReference: Schema$GooglePrivacyDlpV2BigQueryTable; -} -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query a - * table is often referenced with a string in the format of: - * `<project_id>:<dataset_id>.<table_id>` or - * `<project_id>.<dataset_id>.<table_id>`. - */ -export interface Schema$GooglePrivacyDlpV2BigQueryTable { + export interface Schema$GooglePrivacyDlpV2InfoTypeTransformations { + /** + * Transformation for each infoType. Cannot specify more than one for a + * given infoType. [required] + */ + transformations: Schema$GooglePrivacyDlpV2InfoTypeTransformation[]; + } /** - * Dataset ID of the table. - */ - datasetId: string; + * Configuration description of the scanning process. When used with + * redactContent only info_types and min_likelihood are currently used. + */ + export interface Schema$GooglePrivacyDlpV2InspectConfig { + /** + * List of options defining data content to scan. If empty, text, images, + * and other content will be included. + */ + contentOptions: string[]; + /** + * Custom infoTypes provided by the user. + */ + customInfoTypes: Schema$GooglePrivacyDlpV2CustomInfoType[]; + /** + * When true, excludes type information of the findings. + */ + excludeInfoTypes: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote: boolean; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + */ + infoTypes: Schema$GooglePrivacyDlpV2InfoType[]; + limits: Schema$GooglePrivacyDlpV2FindingLimits; + /** + * Only returns findings equal or above this threshold. The default is + * POSSIBLE. + */ + minLikelihood: string; + } /** - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. - */ - projectId: string; + * Request to search for potentially sensitive info in a ContentItem. + */ + export interface Schema$GooglePrivacyDlpV2InspectContentRequest { + /** + * Configuration for the inspector. What specified here will override the + * template referenced by the inspect_template_name argument. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to inspect. + */ + item: Schema$GooglePrivacyDlpV2ContentItem; + } /** - * Name of the table. + * Results of inspecting an item. */ - tableId: string; -} -/** - * Bounding box encompassing detected text within an image. - */ -export interface Schema$GooglePrivacyDlpV2BoundingBox { + export interface Schema$GooglePrivacyDlpV2InspectContentResponse { + /** + * The findings. + */ + result: Schema$GooglePrivacyDlpV2InspectResult; + } /** - * Height of the bounding box in pixels. - */ - height: number; + * The results of an inspect DataSource job. + */ + export interface Schema$GooglePrivacyDlpV2InspectDataSourceDetails { + /** + * The configuration used for this job. + */ + requestedOptions: Schema$GooglePrivacyDlpV2RequestedOptions; + /** + * A summary of the outcome of this inspect job. + */ + result: Schema$GooglePrivacyDlpV2Result; + } + export interface Schema$GooglePrivacyDlpV2InspectJobConfig { + /** + * Actions to execute at the completion of the job. Are executed in the + * order provided. + */ + actions: Schema$GooglePrivacyDlpV2Action[]; + /** + * How and what to scan for. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + /** + * If provided, will be used as the default for all values in InspectConfig. + * `inspect_config` will be merged into the values persisted as part of the + * template. + */ + inspectTemplateName: string; + /** + * The data to scan. + */ + storageConfig: Schema$GooglePrivacyDlpV2StorageConfig; + } /** - * Left coordinate of the bounding box. (0,0) is upper left. - */ - left: number; + * All the findings for a single scanned item. + */ + export interface Schema$GooglePrivacyDlpV2InspectResult { + /** + * List of findings for an item. + */ + findings: Schema$GooglePrivacyDlpV2Finding[]; + /** + * If true, then this item might have more findings than were returned, and + * the findings returned are an arbitrary subset of all findings. The + * findings list might be truncated because the input items were too large, + * or because the server reached the maximum amount of resources allowed for + * a single API call. For best results, divide the input into smaller + * batches. + */ + findingsTruncated: boolean; + } /** - * Top coordinate of the bounding box. (0,0) is upper left. - */ - top: number; + * The inspectTemplate contains a configuration (set of types of sensitive + * data to be detected) to be used anywhere you otherwise would normally + * specify InspectConfig. + */ + export interface Schema$GooglePrivacyDlpV2InspectTemplate { + /** + * The creation timestamp of a inspectTemplate, output only field. + */ + createTime: string; + /** + * Short description (max 256 chars). + */ + description: string; + /** + * Display name (max 256 chars). + */ + displayName: string; + /** + * The core content of the template. Configuration of the scanning process. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + /** + * The template name. Output only. The template will have one of the + * following formats: `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR + * `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` + */ + name: string; + /** + * The last update timestamp of a inspectTemplate, output only field. + */ + updateTime: string; + } /** - * Width of the bounding box in pixels. - */ - width: number; -} -/** - * Bucket is represented as a range, along with replacement values. - */ -export interface Schema$GooglePrivacyDlpV2Bucket { + * Contains a configuration to make dlp api calls on a repeating basis. + */ + export interface Schema$GooglePrivacyDlpV2JobTrigger { + /** + * The creation timestamp of a triggeredJob, output only field. + */ + createTime: string; + /** + * User provided description (max 256 chars) + */ + description: string; + /** + * Display name (max 100 chars) + */ + displayName: string; + /** + * A stream of errors encountered when the trigger was activated. Repeated + * errors may result in the JobTrigger automaticaly being paused. Will + * return the last 100 errors. Whenever the JobTrigger is modified this list + * will be cleared. Output only field. + */ + errors: Schema$GooglePrivacyDlpV2Error[]; + inspectJob: Schema$GooglePrivacyDlpV2InspectJobConfig; + /** + * The timestamp of the last time this trigger executed, output only field. + */ + lastRunTime: string; + /** + * Unique resource name for the triggeredJob, assigned by the service when + * the triggeredJob is created, for example + * `projects/dlp-test-project/triggeredJobs/53234423`. + */ + name: string; + /** + * A status for this trigger. [required] + */ + status: string; + /** + * A list of triggers which will be OR'ed together. Only one in the list + * needs to trigger for a job to be started. The list may contain only a + * single Schedule trigger and must have at least one object. + */ + triggers: Schema$GooglePrivacyDlpV2Trigger[]; + /** + * The last update timestamp of a triggeredJob, output only field. + */ + updateTime: string; + } /** - * Upper bound of the range, exclusive; type must match min. - */ - max: Schema$GooglePrivacyDlpV2Value; + * k-anonymity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2KAnonymityConfig { + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within a + * repeated field. + */ + quasiIds: Schema$GooglePrivacyDlpV2FieldId[]; + } /** - * Lower bound of the range, inclusive. Type should be the same as max if - * used. - */ - min: Schema$GooglePrivacyDlpV2Value; + * The set of columns' values that share the same ldiversity value + */ + export interface Schema$GooglePrivacyDlpV2KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the above + * set of values. + */ + equivalenceClassSize: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; + } + export interface Schema$GooglePrivacyDlpV2KAnonymityHistogramBucket { + /** + * Total number of equivalence classes in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct equivalence classes in this bucket. + */ + bucketValueCount: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2KAnonymityEquivalenceClass[]; + /** + * Lower bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeLowerBound: string; + /** + * Upper bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeUpperBound: string; + } /** - * Replacement value for this bucket. If not provided the default behavior - * will be to hyphenate the min-max range. + * Result of the k-anonymity computation. */ - replacementValue: Schema$GooglePrivacyDlpV2Value; -} -/** - * Generalization function that buckets values based on ranges. The ranges and - * replacement values are dynamically provided by the user for custom behavior, - * such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This can be used - * on data of type: number, long, string, timestamp. If the bound `Value` type - * differs from the type of data being transformed, we will first attempt - * converting the type of the data to be transformed to match the type of the - * bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2BucketingConfig { + export interface Schema$GooglePrivacyDlpV2KAnonymityResult { + /** + * Histogram of k-anonymity equivalence classes. + */ + equivalenceClassHistogramBuckets: + Schema$GooglePrivacyDlpV2KAnonymityHistogramBucket[]; + } /** - * Set of buckets. Ranges must be non-overlapping. - */ - buckets: Schema$GooglePrivacyDlpV2Bucket[]; -} -/** - * Container for bytes to inspect or redact. - */ -export interface Schema$GooglePrivacyDlpV2ByteContentItem { + * A unique identifier for a Datastore entity. If a key's partition ID or + * any of its path kinds or names are reserved/read-only, the key is + * reserved/read-only. A reserved/read-only key is forbidden in certain + * documented contexts. + */ + export interface Schema$GooglePrivacyDlpV2Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. Queries are scoped to a single partition. + */ + partitionId: Schema$GooglePrivacyDlpV2PartitionId; + /** + * The entity path. An entity path consists of one or more elements composed + * of a kind and a string or numerical identifier, which identify entities. + * The first element identifies a _root entity_, the second element + * identifies a _child_ of the root entity, the third element identifies a + * child of the second entity, and so forth. The entities identified by all + * prefixes of the path are called the element's _ancestors_. A path + * can never be empty, and a path can have at most 100 elements. + */ + path: Schema$GooglePrivacyDlpV2PathElement[]; + } /** - * Content data to inspect or redact. + * A representation of a Datastore kind. */ - data: string; + export interface Schema$GooglePrivacyDlpV2KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * The type of data stored in the bytes string. Default will be TEXT_UTF8. - */ - type: string; -} -/** - * The request message for canceling a DLP job. - */ -export interface Schema$GooglePrivacyDlpV2CancelDlpJobRequest {} -/** - * Compute numerical stats over an individual column, including number of - * distinct values and value count distribution. - */ -export interface Schema$GooglePrivacyDlpV2CategoricalStatsConfig { + * Reidentifiability metric. This corresponds to a risk model similar to what + * is called "journalist risk" in the literature, except the attack + * dataset is statistically modeled instead of being perfectly known. This can + * be done using publicly available data (like the US Census), or using a + * custom statistical model (indicated as one or several BigQuery tables), or + * by extrapolating from the distribution of values in the input dataset. + */ + export interface Schema$GooglePrivacyDlpV2KMapEstimationConfig { + /** + * Several auxiliary tables can be used in the analysis. Each custom_tag + * used to tag a quasi-identifiers column must appear in exactly one column + * of one auxiliary table. + */ + auxiliaryTables: Schema$GooglePrivacyDlpV2AuxiliaryTable[]; + /** + * Fields considered to be quasi-identifiers. No two columns can have the + * same tag. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2TaggedField[]; + /** + * ISO 3166-1 alpha-2 region code to use in the statistical modeling. + * Required if no column is tagged with a region-specific InfoType (like + * US_ZIP_5) or a region code. + */ + regionCode: string; + } /** - * Field to compute categorical stats on. All column types are supported - * except for arrays and structs. However, it may be more informative to use - * NumericalStats when the field type is supported, depending on the data. - */ - field: Schema$GooglePrivacyDlpV2FieldId; -} -export interface Schema$GooglePrivacyDlpV2CategoricalStatsHistogramBucket { + * A KMapEstimationHistogramBucket message with the following values: + * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 + * records whose quasi-identifier values correspond to 3, 4 or 5 people in the + * overlying population. An important particular case is when min_anonymity = + * max_anonymity = 1: the frequency field then corresponds to the number of + * uniquely identifiable records. + */ + export interface Schema$GooglePrivacyDlpV2KMapEstimationHistogramBucket { + /** + * Number of records within these anonymity bounds. + */ + bucketSize: string; + /** + * Total number of distinct quasi-identifier tuple values in this bucket. + */ + bucketValueCount: string; + /** + * Sample of quasi-identifier tuple values in this bucket. The total number + * of classes returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2KMapEstimationQuasiIdValues[]; + /** + * Always greater than or equal to min_anonymity. + */ + maxAnonymity: string; + /** + * Always positive. + */ + minAnonymity: string; + } /** - * Total number of values in this bucket. - */ - bucketSize: string; + * A tuple of values for the quasi-identifier columns. + */ + export interface Schema$GooglePrivacyDlpV2KMapEstimationQuasiIdValues { + /** + * The estimated anonymity for these quasi-identifier values. + */ + estimatedAnonymity: string; + /** + * The quasi-identifier values. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; + } /** - * Total number of distinct values in this bucket. - */ - bucketValueCount: string; + * Result of the reidentifiability analysis. Note that these results are an + * estimation, not exact values. + */ + export interface Schema$GooglePrivacyDlpV2KMapEstimationResult { + /** + * The intervals [min_anonymity, max_anonymity] do not overlap. If a value + * doesn't correspond to any such interval, the associated frequency is + * zero. For example, the following records: {min_anonymity: 1, + * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, + * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} + * mean that there are no record with an estimated anonymity of 4, 5, or + * larger than 10. + */ + kMapEstimationHistogram: + Schema$GooglePrivacyDlpV2KMapEstimationHistogramBucket[]; + } /** - * Sample of value frequencies in this bucket. The total number of values - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2ValueFrequency[]; + * Include to use an existing data crypto key wrapped by KMS. Authorization + * requires the following IAM permissions when sending a request to perform a + * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt + */ + export interface Schema$GooglePrivacyDlpV2KmsWrappedCryptoKey { + /** + * The resource name of the KMS CryptoKey to use for unwrapping. [required] + */ + cryptoKeyName: string; + /** + * The wrapped data crypto key. [required] + */ + wrappedKey: string; + } /** - * Lower bound on the value frequency of the values in this bucket. - */ - valueFrequencyLowerBound: string; + * l-diversity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are defined + * for the l-diversity computation. When multiple fields are specified, they + * are considered a single composite key. + */ + quasiIds: Schema$GooglePrivacyDlpV2FieldId[]; + /** + * Sensitive field for computing the l-value. + */ + sensitiveAttribute: Schema$GooglePrivacyDlpV2FieldId; + } /** - * Upper bound on the value frequency of the values in this bucket. - */ - valueFrequencyUpperBound: string; -} -/** - * Result of the categorical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2CategoricalStatsResult { + * The set of columns' values that share the same ldiversity value. + */ + export interface Schema$GooglePrivacyDlpV2LDiversityEquivalenceClass { + /** + * Size of the k-anonymity equivalence class. + */ + equivalenceClassSize: string; + /** + * Number of distinct sensitive values in this equivalence class. + */ + numDistinctSensitiveValues: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence class. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; + /** + * Estimated frequencies of top sensitive values. + */ + topSensitiveValues: Schema$GooglePrivacyDlpV2ValueFrequency[]; + } + export interface Schema$GooglePrivacyDlpV2LDiversityHistogramBucket { + /** + * Total number of equivalence classes in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct equivalence classes in this bucket. + */ + bucketValueCount: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyLowerBound: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyUpperBound: string; + } /** - * Histogram of value frequencies in the column. + * Result of the l-diversity computation. */ - valueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2CategoricalStatsHistogramBucket[]; -} -/** - * Partially mask a string by replacing a given number of characters with a - * fixed character. Masking can start from the beginning or end of the string. - * This can be used on data of any type (numbers, longs, and so on) and when - * de-identifying structured data we'll attempt to preserve the original - * data's type. (This allows you to take a long like 123 and modify it to a - * string like **3. - */ -export interface Schema$GooglePrivacyDlpV2CharacterMaskConfig { + export interface Schema$GooglePrivacyDlpV2LDiversityResult { + /** + * Histogram of l-diversity equivalence class sensitive value frequencies. + */ + sensitiveValueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2LDiversityHistogramBucket[]; + } /** - * When masking a string, items in this list will be skipped when replacing. - * For example, if your string is 555-555-5555 and you ask us to skip `-` and - * mask 5 chars with * we would produce ***-*55-5555. - */ - charactersToIgnore: Schema$GooglePrivacyDlpV2CharsToIgnore[]; + * Message for specifying an adjustment to the likelihood of a finding as part + * of a detection rule. + */ + export interface Schema$GooglePrivacyDlpV2LikelihoodAdjustment { + /** + * Set the likelihood of a finding to a fixed value. + */ + fixedLikelihood: string; + /** + * Increase or decrease the likelihood by the specified number of levels. + * For example, if a finding would be `POSSIBLE` without the detection rule + * and `relative_likelihood` is 1, then it is upgraded to `LIKELY`, while a + * value of -1 would downgrade it to `UNLIKELY`. Likelihood may never drop + * below `VERY_UNLIKELY` or exceed `VERY_LIKELY`, so applying an adjustment + * of 1 followed by an adjustment of -1 when base likelihood is + * `VERY_LIKELY` will result in a final likelihood of `LIKELY`. + */ + relativeLikelihood: number; + } /** - * Character to mask the sensitive values&mdash;for example, "*" - * for an alphabetic string such as name, or "0" for a numeric - * string such as ZIP code or credit card number. String must have length 1. - * If not supplied, we will default to "*" for strings, 0 for - * digits. - */ - maskingCharacter: string; + * Response message for ListDeidentifyTemplates. + */ + export interface Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse { + /** + * List of deidentify templates, up to page_size in + * ListDeidentifyTemplatesRequest. + */ + deidentifyTemplates: Schema$GooglePrivacyDlpV2DeidentifyTemplate[]; + /** + * If the next page is available then the next page token to be used in + * following ListDeidentifyTemplates request. + */ + nextPageToken: string; + } /** - * Number of characters to mask. If not set, all matching chars will be - * masked. Skipped characters do not count towards this tally. - */ - numberToMask: number; + * The response message for listing DLP jobs. + */ + export interface Schema$GooglePrivacyDlpV2ListDlpJobsResponse { + /** + * A list of DlpJobs that matches the specified filter in the request. + */ + jobs: Schema$GooglePrivacyDlpV2DlpJob[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * Mask characters in reverse order. For example, if `masking_character` is - * '0', number_to_mask is 14, and `reverse_order` is false, then - * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is - * '*', `number_to_mask` is 3, and `reverse_order` is true, then 12345 - * -> 12*** + * Response to the ListInfoTypes request. */ - reverseOrder: boolean; -} -/** - * Characters to skip when doing deidentification of a value. These will be left - * alone and skipped. - */ -export interface Schema$GooglePrivacyDlpV2CharsToIgnore { - charactersToSkip: string; - commonCharactersToIgnore: string; -} -/** - * Options defining a file or a set of files (path ending with *) within a - * Google Cloud Storage bucket. - */ -export interface Schema$GooglePrivacyDlpV2CloudStorageOptions { + export interface Schema$GooglePrivacyDlpV2ListInfoTypesResponse { + /** + * Set of sensitive infoTypes. + */ + infoTypes: Schema$GooglePrivacyDlpV2InfoTypeDescription[]; + } /** - * Max number of bytes to scan from a file. If a scanned file's size is - * bigger than this value then the rest of the bytes are omitted. - */ - bytesLimitPerFile: string; - fileSet: Schema$GooglePrivacyDlpV2FileSet; + * Response message for ListInspectTemplates. + */ + export interface Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse { + /** + * List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. + */ + inspectTemplates: Schema$GooglePrivacyDlpV2InspectTemplate[]; + /** + * If the next page is available then the next page token to be used in + * following ListInspectTemplates request. + */ + nextPageToken: string; + } /** - * List of file type groups to include in the scan. If empty, all files are - * scanned and available data format processors are applied. - */ - fileTypes: string[]; -} -/** - * Represents a color in the RGB color space. - */ -export interface Schema$GooglePrivacyDlpV2Color { + * Response message for ListJobTriggers. + */ + export interface Schema$GooglePrivacyDlpV2ListJobTriggersResponse { + /** + * List of triggeredJobs, up to page_size in ListJobTriggersRequest. + */ + jobTriggers: Schema$GooglePrivacyDlpV2JobTrigger[]; + /** + * If the next page is available then the next page token to be used in + * following ListJobTriggers request. + */ + nextPageToken: string; + } /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; + * Specifies the location of the finding. + */ + export interface Schema$GooglePrivacyDlpV2Location { + /** + * Zero-based byte offsets delimiting the finding. These are relative to the + * finding's containing element. Note that when the content is not + * textual, this references the UTF-8 encoded textual representation of the + * content. Omitted if content is an image. + */ + byteRange: Schema$GooglePrivacyDlpV2Range; + /** + * Unicode character offsets delimiting the finding. These are relative to + * the finding's containing element. Provided when the content is text. + */ + codepointRange: Schema$GooglePrivacyDlpV2Range; + /** + * List of nested objects pointing to the precise location of the finding + * within the file or record. + */ + contentLocations: Schema$GooglePrivacyDlpV2ContentLocation[]; + } /** - * The amount of green in the color as a value in the interval [0, 1]. + * Compute numerical stats over an individual column, including min, max, and + * quantiles. */ - green: number; + export interface Schema$GooglePrivacyDlpV2NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are integer, float, + * date, datetime, timestamp, time. + */ + field: Schema$GooglePrivacyDlpV2FieldId; + } /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * The field type of `value` and `field` do not need to match to be considered - * equal, but not all comparisons are possible. A `value` of type: - `string` - * can be compared against all other types - `boolean` can only be compared - * against other booleans - `integer` can be compared against doubles or a - * string if the string value can be parsed as an integer. - `double` can be - * compared against integers or a string if the string can be parsed as a - * double. - `Timestamp` can be compared against strings in RFC 3339 date string - * format. - `TimeOfDay` can be compared against timestamps and strings in the - * format of 'HH:mm:ss'. If we fail to compare do to type mismatch, a - * warning will be given and the condition will evaluate to false. - */ -export interface Schema$GooglePrivacyDlpV2Condition { + * Result of the numerical stats computation. + */ + export interface Schema$GooglePrivacyDlpV2NumericalStatsResult { + /** + * Maximum value appearing in the column. + */ + maxValue: Schema$GooglePrivacyDlpV2Value; + /** + * Minimum value appearing in the column. + */ + minValue: Schema$GooglePrivacyDlpV2Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues: Schema$GooglePrivacyDlpV2Value[]; + } /** - * Field within the record this condition is evaluated against. [required] - */ - field: Schema$GooglePrivacyDlpV2FieldId; + * Cloud repository for storing output. + */ + export interface Schema$GooglePrivacyDlpV2OutputStorageConfig { + /** + * Schema used for writing the findings. Columns are derived from the + * `Finding` object. If appending to an existing table, any columns from the + * predefined schema that are missing will be added. No columns in the + * existing table will be deleted. If unspecified, then all available + * columns will be used for a new table, and no changes will be made to an + * existing table. + */ + outputSchema: string; + /** + * Store findings in an existing table or a new table in an existing + * dataset. Each column in an existing table must have the same name, type, + * and mode of a field in the `Finding` object. If table_id is not set a new + * one will be generated for you with the following format: + * dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for + * generating the date details. + */ + table: Schema$GooglePrivacyDlpV2BigQueryTable; + } /** - * Operator used to compare the field or infoType to the value. [required] - */ - operator: string; + * Datastore partition ID. A partition ID identifies a grouping of entities. + * The grouping is always by project and namespace, however the namespace ID + * may be empty. A partition ID contains several dimensions: project ID and + * namespace ID. + */ + export interface Schema$GooglePrivacyDlpV2PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * Value to compare against. [Required, except for `EXISTS` tests.] - */ - value: Schema$GooglePrivacyDlpV2Value; -} -/** - * A collection of conditions. - */ -export interface Schema$GooglePrivacyDlpV2Conditions { - conditions: Schema$GooglePrivacyDlpV2Condition[]; -} -/** - * Container structure for the content to inspect. - */ -export interface Schema$GooglePrivacyDlpV2ContentItem { + * A (kind, ID/name) pair used to construct a key path. If either name or ID + * is set, the element is complete. If neither is set, the element is + * incomplete. + */ + export interface Schema$GooglePrivacyDlpV2PathElement { + /** + * The auto-allocated ID of the entity. Never equal to zero. Values less + * than zero are discouraged and may not be supported in the future. + */ + id: string; + /** + * The kind of the entity. A kind matching regex `__.*__` is + * reserved/read-only. A kind must not contain more than 1500 bytes when + * UTF-8 encoded. Cannot be `""`. + */ + kind: string; + /** + * The name of the entity. A name matching regex `__.*__` is + * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 + * encoded. Cannot be `""`. + */ + name: string; + } /** - * Content data to inspect or redact. Replaces `type` and `data`. - */ - byteItem: Schema$GooglePrivacyDlpV2ByteContentItem; + * A rule for transforming a value. + */ + export interface Schema$GooglePrivacyDlpV2PrimitiveTransformation { + bucketingConfig: Schema$GooglePrivacyDlpV2BucketingConfig; + characterMaskConfig: Schema$GooglePrivacyDlpV2CharacterMaskConfig; + cryptoHashConfig: Schema$GooglePrivacyDlpV2CryptoHashConfig; + cryptoReplaceFfxFpeConfig: + Schema$GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig; + dateShiftConfig: Schema$GooglePrivacyDlpV2DateShiftConfig; + fixedSizeBucketingConfig: Schema$GooglePrivacyDlpV2FixedSizeBucketingConfig; + redactConfig: Schema$GooglePrivacyDlpV2RedactConfig; + replaceConfig: Schema$GooglePrivacyDlpV2ReplaceValueConfig; + replaceWithInfoTypeConfig: + Schema$GooglePrivacyDlpV2ReplaceWithInfoTypeConfig; + timePartConfig: Schema$GooglePrivacyDlpV2TimePartConfig; + } /** - * Structured content for inspection. + * Privacy metric to compute for reidentification risk analysis. */ - table: Schema$GooglePrivacyDlpV2Table; + export interface Schema$GooglePrivacyDlpV2PrivacyMetric { + categoricalStatsConfig: Schema$GooglePrivacyDlpV2CategoricalStatsConfig; + kAnonymityConfig: Schema$GooglePrivacyDlpV2KAnonymityConfig; + kMapEstimationConfig: Schema$GooglePrivacyDlpV2KMapEstimationConfig; + lDiversityConfig: Schema$GooglePrivacyDlpV2LDiversityConfig; + numericalStatsConfig: Schema$GooglePrivacyDlpV2NumericalStatsConfig; + } /** - * String data to inspect or redact. - */ - value: string; -} -/** - * Findings container location data. - */ -export interface Schema$GooglePrivacyDlpV2ContentLocation { + * Message for specifying a window around a finding to apply a detection rule. + */ + export interface Schema$GooglePrivacyDlpV2Proximity { + /** + * Number of characters after the finding to consider. + */ + windowAfter: number; + /** + * Number of characters before the finding to consider. + */ + windowBefore: number; + } /** - * Name of the container where the finding is located. The top level name is - * the source file name or table name. Nested names could be absent if the - * embedded object has no string identifier (for an example an image contained - * within a document). - */ - containerName: string; + * Publish the results of a DlpJob to a pub sub channel. Compatible with: + * Inspect, Risk + */ + export interface Schema$GooglePrivacyDlpV2PublishToPubSub { + /** + * Cloud Pub/Sub topic to send notifications to. The topic must have given + * publishing access rights to the DLP API service account executing the + * long running DlpJob sending the notifications. Format is + * projects/{project}/topics/{topic}. + */ + topic: string; + } /** - * Findings container modification timestamp, if applicable. For Google Cloud - * Storage contains last file modification timestamp. For BigQuery table - * contains last_modified_time property. For Datastore - not populated. + * A quasi-identifier column has a custom_tag, used to know which column in + * the data corresponds to which column in the statistical model. */ - containerTimestamp: string; + export interface Schema$GooglePrivacyDlpV2QuasiIdField { + customTag: string; + field: Schema$GooglePrivacyDlpV2FieldId; + } /** - * Findings container version, if available ("generation" for Google - * Cloud Storage). + * Message for infoType-dependent details parsed from quote. */ - containerVersion: string; + export interface Schema$GooglePrivacyDlpV2QuoteInfo { + dateTime: Schema$GooglePrivacyDlpV2DateTime; + } /** - * Location data for document files. - */ - documentLocation: Schema$GooglePrivacyDlpV2DocumentLocation; + * Generic half-open interval [start, end) + */ + export interface Schema$GooglePrivacyDlpV2Range { + /** + * Index of the last character of the range (exclusive). + */ + end: string; + /** + * Index of the first character of the range (inclusive). + */ + start: string; + } /** - * Location within an image's pixels. + * A condition for determining whether a transformation should be applied to a + * field. */ - imageLocation: Schema$GooglePrivacyDlpV2ImageLocation; + export interface Schema$GooglePrivacyDlpV2RecordCondition { + /** + * An expression. + */ + expressions: Schema$GooglePrivacyDlpV2Expressions; + } /** - * Location within a row or record of a database table. + * Message for a unique key indicating a record that contains a finding. */ - recordLocation: Schema$GooglePrivacyDlpV2RecordLocation; -} -/** - * Request message for CreateDeidentifyTemplate. - */ -export interface Schema$GooglePrivacyDlpV2CreateDeidentifyTemplateRequest { + export interface Schema$GooglePrivacyDlpV2RecordKey { + bigQueryKey: Schema$GooglePrivacyDlpV2BigQueryKey; + datastoreKey: Schema$GooglePrivacyDlpV2DatastoreKey; + } /** - * The DeidentifyTemplate to create. - */ - deidentifyTemplate: Schema$GooglePrivacyDlpV2DeidentifyTemplate; + * Location of a finding within a row or record. + */ + export interface Schema$GooglePrivacyDlpV2RecordLocation { + /** + * Field id of the field containing the finding. + */ + fieldId: Schema$GooglePrivacyDlpV2FieldId; + /** + * Key of the finding. + */ + recordKey: Schema$GooglePrivacyDlpV2RecordKey; + /** + * Location within a `ContentItem.Table`. + */ + tableLocation: Schema$GooglePrivacyDlpV2TableLocation; + } /** - * The template id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. + * Configuration to suppress records whose suppression conditions evaluate to + * true. */ - templateId: string; -} -/** - * Request message for CreateDlpJobRequest. Used to initiate long running jobs - * such as calculating risk metrics or inspecting Google Cloud Storage. - */ -export interface Schema$GooglePrivacyDlpV2CreateDlpJobRequest { - inspectJob: Schema$GooglePrivacyDlpV2InspectJobConfig; + export interface Schema$GooglePrivacyDlpV2RecordSuppression { + /** + * A condition that when it evaluates to true will result in the record + * being evaluated to be suppressed from the transformed content. + */ + condition: Schema$GooglePrivacyDlpV2RecordCondition; + } /** - * The job id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. + * A type of transformation that is applied over structured data such as a + * table. */ - jobId: string; - riskJob: Schema$GooglePrivacyDlpV2RiskAnalysisJobConfig; -} -/** - * Request message for CreateInspectTemplate. - */ -export interface Schema$GooglePrivacyDlpV2CreateInspectTemplateRequest { + export interface Schema$GooglePrivacyDlpV2RecordTransformations { + /** + * Transform the record by applying various field transformations. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2FieldTransformation[]; + /** + * Configuration defining which records get suppressed entirely. Records + * that match any suppression rule are omitted from the output [optional]. + */ + recordSuppressions: Schema$GooglePrivacyDlpV2RecordSuppression[]; + } /** - * The InspectTemplate to create. - */ - inspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; + * Redact a given value. For example, if used with an `InfoTypeTransformation` + * transforming PHONE_NUMBER, and input 'My phone number is + * 206-555-0123', the output would be 'My phone number is '. + */ + export interface Schema$GooglePrivacyDlpV2RedactConfig {} + /** + * Request to search for potentially sensitive info in a list of items and + * replace it with a default or provided content. + */ + export interface Schema$GooglePrivacyDlpV2RedactImageRequest { + /** + * The content must be PNG, JPEG, SVG or BMP. + */ + byteItem: Schema$GooglePrivacyDlpV2ByteContentItem; + /** + * The configuration for specifying what content to redact from images. + */ + imageRedactionConfigs: Schema$GooglePrivacyDlpV2ImageRedactionConfig[]; + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + } /** - * The template id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. - */ - templateId: string; -} -/** - * Request message for CreateJobTrigger. - */ -export interface Schema$GooglePrivacyDlpV2CreateJobTriggerRequest { + * Results of redacting an image. + */ + export interface Schema$GooglePrivacyDlpV2RedactImageResponse { + /** + * If an image was being inspected and the InspectConfig's include_quote + * was set to true, then this field will include all text, if any, that was + * found in the image. + */ + extractedText: string; + /** + * The redacted image. The type will be the same as the original image. + */ + redactedImage: string; + } /** - * The JobTrigger to create. + * Message defining a custom regular expression. */ - jobTrigger: Schema$GooglePrivacyDlpV2JobTrigger; + export interface Schema$GooglePrivacyDlpV2Regex { + /** + * Pattern defining the regular expression. + */ + pattern: string; + } /** - * The trigger id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. - */ - triggerId: string; -} -/** - * Pseudonymization method that generates surrogates via cryptographic hashing. - * Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs a 32 byte - * digest as an uppercase hex string (for example, - * 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and integer values - * can be hashed. - */ -export interface Schema$GooglePrivacyDlpV2CryptoHashConfig { + * Request to re-identify an item. + */ + export interface Schema$GooglePrivacyDlpV2ReidentifyContentRequest { + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * `inspect_config` will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to re-identify. Will be treated as text. + */ + item: Schema$GooglePrivacyDlpV2ContentItem; + /** + * Configuration for the re-identification of the content item. This field + * shares the same proto message type that is used for de-identification, + * however its usage here is for the reversal of the previous + * de-identification. Re-identification is performed by examining the + * transformations used to de-identify the items and executing the reverse. + * This requires that only reversible transformations be provided here. The + * reversible transformations are: - `CryptoReplaceFfxFpeConfig` + */ + reidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; + /** + * Optional template to use. References an instance of `DeidentifyTemplate`. + * Any configuration directly specified in `reidentify_config` or + * `inspect_config` will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + reidentifyTemplateName: string; + } /** - * The key used by the hash function. - */ - cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; -} -/** - * This is a data encryption key (DEK) (as opposed to a key encryption key (KEK) - * stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an - * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker - * cannot unwrap the data crypto key. - */ -export interface Schema$GooglePrivacyDlpV2CryptoKey { - kmsWrapped: Schema$GooglePrivacyDlpV2KmsWrappedCryptoKey; - transient: Schema$GooglePrivacyDlpV2TransientCryptoKey; - unwrapped: Schema$GooglePrivacyDlpV2UnwrappedCryptoKey; -} -/** - * Replaces an identifier with a surrogate using FPE with the FFX mode of - * operation; however when used in the `ReidentifyContent` API method, it serves - * the opposite function by reversing the surrogate back into the original - * identifier. The identifier must be encoded as ASCII. For a given crypto key - * and context, the same identifier will be replaced with the same surrogate. - * Identifiers must be at least two characters long. In the case that the - * identifier is the empty string, it will be skipped. See - * [Pseudonymization](/dlp/docs/pseudonymization) for example usage. - */ -export interface Schema$GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig { - commonAlphabet: string; - /** - * The 'tweak', a context may be used for higher security since the - * same identifier in two different contexts won't be given the same - * surrogate. If the context is not set, a default tweak will be used. If the - * context is set but: 1. there is no record present when transforming a - * given value or 1. the field is not present when transforming a given value, - * a default tweak will be used. Note that case (1) is expected when an - * `InfoTypeTransformation` is applied to both structured and non-structured - * `ContentItem`s. Currently, the referenced field may be of value type - * integer or string. The tweak is constructed as a sequence of bytes in big - * endian byte order such that: - a 64 bit integer is encoded followed by a - * single byte of value 1 - a string is encoded in UTF-8 format followed by a - * single byte of value å 2 - */ - context: Schema$GooglePrivacyDlpV2FieldId; - /** - * The key used by the encryption algorithm. [required] - */ - cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; - /** - * This is supported by mapping these to the alphanumeric characters that the - * FFX mode natively supports. This happens before/after - * encryption/decryption. Each character listed must appear only once. Number - * of characters must be in the range [2, 62]. This must be encoded as ASCII. - * The order of characters does not matter. - */ - customAlphabet: string; - /** - * The native way to select the alphabet. Must be in the range [2, 62]. - */ - radix: number; - /** - * The custom infoType to annotate the surrogate with. This annotation will be - * applied to the surrogate by prefixing it with the name of the custom - * infoType followed by the number of characters comprising the surrogate. The - * following scheme defines the format: - * info_type_name(surrogate_character_count):surrogate For example, if the - * name of custom infoType is 'MY_TOKEN_INFO_TYPE' and the surrogate - * is 'abc', the full replacement value will be: - * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the - * surrogate when inspecting content using the custom infoType - * [`SurrogateType`](/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype). - * This facilitates reversal of the surrogate when it occurs in free text. In - * order for inspection to work properly, the name of this infoType must not - * occur naturally anywhere in your data; otherwise, inspection may find a - * surrogate that does not correspond to an actual identifier. Therefore, - * choose your custom infoType name carefully after considering what your data - * looks like. One way to select a name that has a high chance of yielding - * reliable detection is to include one or more unicode characters that are - * highly improbable to exist in your data. For example, assuming your data is - * entered from a regular ASCII keyboard, the symbol with the hex code point - * 29DD might be used like so: ⧝MY_TOKEN_TYPE - */ - surrogateInfoType: Schema$GooglePrivacyDlpV2InfoType; -} -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - */ -export interface Schema$GooglePrivacyDlpV2CustomInfoType { + * Results of re-identifying a item. + */ + export interface Schema$GooglePrivacyDlpV2ReidentifyContentResponse { + /** + * The re-identified item. + */ + item: Schema$GooglePrivacyDlpV2ContentItem; + /** + * An overview of the changes that were made to the `item`. + */ + overview: Schema$GooglePrivacyDlpV2TransformationOverview; + } /** - * Set of detection rules to apply to all findings of this custom info type. - * Rules are applied in order that they are specified. Not supported for the - * `surrogate_type` custom info type. + * Replace each input value with a given `Value`. */ - detectionRules: Schema$GooglePrivacyDlpV2DetectionRule[]; + export interface Schema$GooglePrivacyDlpV2ReplaceValueConfig { + /** + * Value to replace it with. + */ + newValue: Schema$GooglePrivacyDlpV2Value; + } /** - * Dictionary-based custom info type. + * Replace each matching finding with the name of the info_type. */ - dictionary: Schema$GooglePrivacyDlpV2Dictionary; - /** - * Info type configuration. All custom info types must have configurations - * that do not conflict with built-in info types or other custom info types. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; - /** - * Likelihood to return for this custom info type. This base value can be - * altered by a detection rule if the finding meets the criteria specified by - * the rule. Defaults to `VERY_LIKELY` if not specified. - */ - likelihood: string; - /** - * Regex-based custom info type. - */ - regex: Schema$GooglePrivacyDlpV2Regex; - /** - * Surrogate info type. - */ - surrogateType: Schema$GooglePrivacyDlpV2SurrogateType; -} -/** - * Record key for a finding in Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2DatastoreKey { - /** - * Datastore entity key. - */ - entityKey: Schema$GooglePrivacyDlpV2Key; -} -/** - * Options defining a data set within Google Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2DatastoreOptions { - /** - * The kind to process. - */ - kind: Schema$GooglePrivacyDlpV2KindExpression; - /** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. - */ - partitionId: Schema$GooglePrivacyDlpV2PartitionId; -} -/** - * Shifts dates by random number of days, with option to be consistent for the - * same context. - */ -export interface Schema$GooglePrivacyDlpV2DateShiftConfig { - /** - * Points to the field that contains the context, for example, an entity id. - * If set, must also set method. If set, shift will be consistent for the - * given context. - */ - context: Schema$GooglePrivacyDlpV2FieldId; - /** - * Causes the shift to be computed based on this key and the context. This - * results in the same shift for the same context and crypto_key. - */ - cryptoKey: Schema$GooglePrivacyDlpV2CryptoKey; - /** - * For example, -5 means shift date to at most 5 days back in the past. - * [Required] - */ - lowerBoundDays: number; - /** - * Range of shift in days. Actual shift will be selected at random within this - * range (inclusive ends). Negative means shift to earlier in time. Must not - * be more than 365250 days (1000 years) each direction. For example, 3 means - * shift date to at most 3 days into the future. [Required] - */ - upperBoundDays: number; -} -/** - * Message for a date time object. - */ -export interface Schema$GooglePrivacyDlpV2DateTime { - /** - * One or more of the following must be set. All fields are optional, but when - * set must be valid date or time values. - */ - date: Schema$GoogleTypeDate; - dayOfWeek: string; - time: Schema$GoogleTypeTimeOfDay; - timeZone: Schema$GooglePrivacyDlpV2TimeZone; -} -/** - * The configuration that controls how the data will change. - */ -export interface Schema$GooglePrivacyDlpV2DeidentifyConfig { - /** - * Treat the dataset as free-form text and apply the same free text - * transformation everywhere. - */ - infoTypeTransformations: Schema$GooglePrivacyDlpV2InfoTypeTransformations; - /** - * Treat the dataset as structured. Transformations can be applied to specific - * locations within structured datasets, such as transforming a column within - * a table. - */ - recordTransformations: Schema$GooglePrivacyDlpV2RecordTransformations; -} -/** - * Request to de-identify a list of items. - */ -export interface Schema$GooglePrivacyDlpV2DeidentifyContentRequest { - /** - * Configuration for the de-identification of the content item. Items - * specified here will override the template referenced by the - * deidentify_template_name argument. - */ - deidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; - /** - * Optional template to use. Any configuration directly specified in - * deidentify_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - deidentifyTemplateName: string; - /** - * Configuration for the inspector. Items specified here will override the - * template referenced by the inspect_template_name argument. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to de-identify. Will be treated as text. - */ - item: Schema$GooglePrivacyDlpV2ContentItem; -} -/** - * Results of de-identifying a ContentItem. - */ -export interface Schema$GooglePrivacyDlpV2DeidentifyContentResponse { - /** - * The de-identified item. - */ - item: Schema$GooglePrivacyDlpV2ContentItem; - /** - * An overview of the changes that were made on the `item`. - */ - overview: Schema$GooglePrivacyDlpV2TransformationOverview; -} -/** - * The DeidentifyTemplates contains instructions on how to deidentify content. - */ -export interface Schema$GooglePrivacyDlpV2DeidentifyTemplate { - /** - * The creation timestamp of a inspectTemplate, output only field. - */ - createTime: string; - /** - * ///////////// // The core content of the template // /////////////// - */ - deidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; - /** - * Short description (max 256 chars). - */ - description: string; - /** - * Display name (max 256 chars). - */ - displayName: string; - /** - * The template name. Output only. The template will have one of the - * following formats: `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` - */ - name: string; - /** - * The last update timestamp of a inspectTemplate, output only field. - */ - updateTime: string; -} -/** - * Rule for modifying a custom info type to alter behavior under certain - * circumstances, depending on the specific details of the rule. Not supported - * for the `surrogate_type` custom info type. - */ -export interface Schema$GooglePrivacyDlpV2DetectionRule { - /** - * Hotword-based detection rule. - */ - hotwordRule: Schema$GooglePrivacyDlpV2HotwordRule; -} -/** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. Dictionary words are case-insensitive and all - * characters other than letters and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the dictionary - * phrase "Sam Johnson" will match all three phrases "sam - * johnson", "Sam, Johnson", and "Sam (Johnson)". - * Additionally, the characters surrounding any match must be of a different - * type than the adjacent characters within the word, so letters must be next to - * non-letters and digits next to non-digits. For example, the dictionary word - * "jen" will match the first three letters of the text - * "jen123" but will return no matches for "jennifer". - * Dictionary words containing a large number of characters that are not letters - * or digits may result in unexpected findings because such characters are - * treated as whitespace. - */ -export interface Schema$GooglePrivacyDlpV2Dictionary { - /** - * List of words or phrases to search for. - */ - wordList: Schema$GooglePrivacyDlpV2WordList; -} -/** - * Combines all of the information about a DLP job. - */ -export interface Schema$GooglePrivacyDlpV2DlpJob { - /** - * Time when the job was created. - */ - createTime: string; - /** - * Time when the job finished. - */ - endTime: string; - /** - * A stream of errors encountered running the job. - */ - errors: Schema$GooglePrivacyDlpV2Error[]; - /** - * Results from inspecting a data source. - */ - inspectDetails: Schema$GooglePrivacyDlpV2InspectDataSourceDetails; - /** - * If created by a job trigger, the resource name of the trigger that - * instantiated the job. - */ - jobTriggerName: string; - /** - * The server-assigned name. - */ - name: string; - /** - * Results from analyzing risk of a data source. - */ - riskDetails: Schema$GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails; - /** - * Time when the job started. - */ - startTime: string; - /** - * State of a job. - */ - state: string; - /** - * The type of job. - */ - type: string; -} -/** - * Location of a finding within a document. - */ -export interface Schema$GooglePrivacyDlpV2DocumentLocation { - /** - * Offset of the line, from the beginning of the file, where the finding is - * located. - */ - fileOffset: string; -} -/** - * Details information about an error encountered during job execution or the - * results of an unsuccessful activation of the JobTrigger. Output only field. - */ -export interface Schema$GooglePrivacyDlpV2Error { - details: Schema$GoogleRpcStatus; - /** - * The times the error occurred. - */ - timestamps: string[]; -} -/** - * An expression, consisting or an operator and conditions. - */ -export interface Schema$GooglePrivacyDlpV2Expressions { - conditions: Schema$GooglePrivacyDlpV2Conditions; - /** - * The operator to apply to the result of conditions. Default and currently - * only supported value is `AND`. - */ - logicalOperator: string; -} -/** - * General identifier of a data field in a storage service. - */ -export interface Schema$GooglePrivacyDlpV2FieldId { - /** - * Name describing the field. - */ - name: string; -} -/** - * The transformation to apply to the field. - */ -export interface Schema$GooglePrivacyDlpV2FieldTransformation { - /** - * Only apply the transformation if the condition evaluates to true for the - * given `RecordCondition`. The conditions are allowed to reference fields - * that are not used in the actual transformation. [optional] Example Use - * Cases: - Apply a different bucket transformation to an age column if the - * zip code column for the same record is within a specific range. - Redact a - * field if the date of birth field is greater than 85. - */ - condition: Schema$GooglePrivacyDlpV2RecordCondition; - /** - * Input field(s) to apply the transformation to. [required] - */ - fields: Schema$GooglePrivacyDlpV2FieldId[]; - /** - * Treat the contents of the field as free text, and selectively transform - * content that matches an `InfoType`. - */ - infoTypeTransformations: Schema$GooglePrivacyDlpV2InfoTypeTransformations; - /** - * Apply the transformation to the entire field. - */ - primitiveTransformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; -} -/** - * Set of files to scan. - */ -export interface Schema$GooglePrivacyDlpV2FileSet { - /** - * The url, in the format `gs://<bucket>/<path>`. Trailing - * wildcard in the path is allowed. - */ - url: string; -} -/** - * Represents a piece of potentially sensitive content. - */ -export interface Schema$GooglePrivacyDlpV2Finding { - /** - * Timestamp when finding was detected. - */ - createTime: string; - /** - * The type of content that might have been found. Provided if requested by - * the `InspectConfig`. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; - /** - * Estimate of how likely it is that the `info_type` is correct. - */ - likelihood: string; - /** - * Where the content was found. - */ - location: Schema$GooglePrivacyDlpV2Location; - /** - * The content that was found. Even if the content is not textual, it may be - * converted to a textual representation here. Provided if requested by the - * `InspectConfig` and the finding is less than or equal to 4096 bytes long. - * If the finding exceeds 4096 bytes in length, the quote may be omitted. - */ - quote: string; - /** - * Contains data parsed from quotes. Only populated if include_quote was set - * to true and a supported infoType was requested. Currently supported - * infoTypes: DATE, DATE_OF_BIRTH and TIME. - */ - quoteInfo: Schema$GooglePrivacyDlpV2QuoteInfo; -} -export interface Schema$GooglePrivacyDlpV2FindingLimits { - /** - * Configuration of findings limit given for specified infoTypes. - */ - maxFindingsPerInfoType: Schema$GooglePrivacyDlpV2InfoTypeLimit[]; - /** - * Max number of findings that will be returned for each item scanned. When - * set within `InspectDataSourceRequest`, the maximum returned is 1000 - * regardless if this is set higher. When set within `InspectContentRequest`, - * this field is ignored. - */ - maxFindingsPerItem: number; - /** - * Max number of findings that will be returned per request/job. When set - * within `InspectContentRequest`, the maximum returned is 1000 regardless if - * this is set higher. - */ - maxFindingsPerRequest: number; -} -/** - * Buckets values based on fixed size ranges. The Bucketing transformation can - * provide all of this functionality, but requires more configuration. This - * message is provided as a convenience to the user for simple bucketing - * strategies. The transformed value will be a hyphenated string of - * <lower_bound>-<upper_bound>, i.e if lower_bound = 10 and - * upper_bound = 20 all values that are within this bucket will be replaced with - * "10-20". This can be used on data of type: double, long. If the - * bound Value type differs from the type of data being transformed, we will - * first attempt converting the type of the data to be transformed to match the - * type of the bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2FixedSizeBucketingConfig { - /** - * Size of each bucket (except for minimum and maximum buckets). So if - * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the - * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. - */ - bucketSize: number; - /** - * Lower bound value of buckets. All values less than `lower_bound` are - * grouped together into a single bucket; for example if `lower_bound` = 10, - * then all values less than 10 are replaced with the value “-10”. [Required]. - */ - lowerBound: Schema$GooglePrivacyDlpV2Value; - /** - * Upper bound value of buckets. All values greater than upper_bound are - * grouped together into a single bucket; for example if `upper_bound` = 89, - * then all values greater than 89 are replaced with the value “89+”. - * [Required]. - */ - upperBound: Schema$GooglePrivacyDlpV2Value; -} -/** - * Detection rule that adjusts the likelihood of findings within a certain - * proximity of hotwords. - */ -export interface Schema$GooglePrivacyDlpV2HotwordRule { - /** - * Regex pattern defining what qualifies as a hotword. - */ - hotwordRegex: Schema$GooglePrivacyDlpV2Regex; - /** - * Likelihood adjustment to apply to all matching findings. - */ - likelihoodAdjustment: Schema$GooglePrivacyDlpV2LikelihoodAdjustment; - /** - * Proximity of the finding within which the entire hotword must reside. The - * total length of the window cannot exceed 1000 characters. Note that the - * finding itself will be included in the window, so that hotwords may be used - * to match substrings of the finding itself. For example, the certainty of a - * phone number regex "\(\d{3}\) \d{3}-\d{4}" could be adjusted - * upwards if the area code is known to be the local area code of a company - * office using the hotword regex "\(xxx\)", where "xxx" - * is the area code in question. - */ - proximity: Schema$GooglePrivacyDlpV2Proximity; -} -/** - * Location of the finding within an image. - */ -export interface Schema$GooglePrivacyDlpV2ImageLocation { - /** - * Bounding boxes locating the pixels within the image containing the finding. - */ - boundingBoxes: Schema$GooglePrivacyDlpV2BoundingBox[]; -} -/** - * Configuration for determining how redaction of images should occur. - */ -export interface Schema$GooglePrivacyDlpV2ImageRedactionConfig { - /** - * Only one per info_type should be provided per request. If not specified, - * and redact_all_text is false, the DLP API will redact all text that it - * matches against all info_types that are found, but not specified in another - * ImageRedactionConfig. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; - /** - * If true, all text found in the image, regardless whether it matches an - * info_type, is redacted. - */ - redactAllText: boolean; - /** - * The color to use when redacting content from an image. If not specified, - * the default is black. - */ - redactionColor: Schema$GooglePrivacyDlpV2Color; -} -/** - * Type of information detected by the API. - */ -export interface Schema$GooglePrivacyDlpV2InfoType { - /** - * Name of the information type. - */ - name: string; -} -/** - * InfoType description. - */ -export interface Schema$GooglePrivacyDlpV2InfoTypeDescription { - /** - * Human readable form of the infoType name. - */ - displayName: string; - /** - * Internal name of the infoType. - */ - name: string; - /** - * Which parts of the API supports this InfoType. - */ - supportedBy: string[]; -} -/** - * Max findings configuration per infoType, per content item or long running - * DlpJob. - */ -export interface Schema$GooglePrivacyDlpV2InfoTypeLimit { - /** - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an info_type, - * the DLP API applies the limit against all info_types that are found but not - * specified in another InfoTypeLimit. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; - /** - * Max findings limit for the given infoType. - */ - maxFindings: number; -} -/** - * Statistics regarding a specific InfoType. - */ -export interface Schema$GooglePrivacyDlpV2InfoTypeStats { - /** - * Number of findings for this infoType. - */ - count: string; - /** - * The type of finding this stat is for. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; -} -/** - * A transformation to apply to text that is identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2InfoTypeTransformation { - /** - * InfoTypes to apply the transformation to. Empty list will match all - * available infoTypes for this transformation. - */ - infoTypes: Schema$GooglePrivacyDlpV2InfoType[]; - /** - * Primitive transformation to apply to the infoType. [required] - */ - primitiveTransformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; -} -/** - * A type of transformation that will scan unstructured text and apply various - * `PrimitiveTransformation`s to each finding, where the transformation is - * applied to only values that were identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2InfoTypeTransformations { - /** - * Transformation for each infoType. Cannot specify more than one for a given - * infoType. [required] - */ - transformations: Schema$GooglePrivacyDlpV2InfoTypeTransformation[]; -} -/** - * Configuration description of the scanning process. When used with - * redactContent only info_types and min_likelihood are currently used. - */ -export interface Schema$GooglePrivacyDlpV2InspectConfig { - /** - * List of options defining data content to scan. If empty, text, images, and - * other content will be included. - */ - contentOptions: string[]; - /** - * Custom infoTypes provided by the user. - */ - customInfoTypes: Schema$GooglePrivacyDlpV2CustomInfoType[]; - /** - * When true, excludes type information of the findings. - */ - excludeInfoTypes: boolean; - /** - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. - */ - includeQuote: boolean; - /** - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or found in documentation. - */ - infoTypes: Schema$GooglePrivacyDlpV2InfoType[]; - limits: Schema$GooglePrivacyDlpV2FindingLimits; - /** - * Only returns findings equal or above this threshold. The default is - * POSSIBLE. - */ - minLikelihood: string; -} -/** - * Request to search for potentially sensitive info in a ContentItem. - */ -export interface Schema$GooglePrivacyDlpV2InspectContentRequest { - /** - * Configuration for the inspector. What specified here will override the - * template referenced by the inspect_template_name argument. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to inspect. - */ - item: Schema$GooglePrivacyDlpV2ContentItem; -} -/** - * Results of inspecting an item. - */ -export interface Schema$GooglePrivacyDlpV2InspectContentResponse { - /** - * The findings. - */ - result: Schema$GooglePrivacyDlpV2InspectResult; -} -/** - * The results of an inspect DataSource job. - */ -export interface Schema$GooglePrivacyDlpV2InspectDataSourceDetails { - /** - * The configuration used for this job. - */ - requestedOptions: Schema$GooglePrivacyDlpV2RequestedOptions; - /** - * A summary of the outcome of this inspect job. - */ - result: Schema$GooglePrivacyDlpV2Result; -} -export interface Schema$GooglePrivacyDlpV2InspectJobConfig { - /** - * Actions to execute at the completion of the job. Are executed in the order - * provided. - */ - actions: Schema$GooglePrivacyDlpV2Action[]; - /** - * How and what to scan for. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; - /** - * If provided, will be used as the default for all values in InspectConfig. - * `inspect_config` will be merged into the values persisted as part of the - * template. - */ - inspectTemplateName: string; - /** - * The data to scan. - */ - storageConfig: Schema$GooglePrivacyDlpV2StorageConfig; -} -/** - * All the findings for a single scanned item. - */ -export interface Schema$GooglePrivacyDlpV2InspectResult { - /** - * List of findings for an item. - */ - findings: Schema$GooglePrivacyDlpV2Finding[]; - /** - * If true, then this item might have more findings than were returned, and - * the findings returned are an arbitrary subset of all findings. The findings - * list might be truncated because the input items were too large, or because - * the server reached the maximum amount of resources allowed for a single API - * call. For best results, divide the input into smaller batches. - */ - findingsTruncated: boolean; -} -/** - * The inspectTemplate contains a configuration (set of types of sensitive data - * to be detected) to be used anywhere you otherwise would normally specify - * InspectConfig. - */ -export interface Schema$GooglePrivacyDlpV2InspectTemplate { - /** - * The creation timestamp of a inspectTemplate, output only field. - */ - createTime: string; - /** - * Short description (max 256 chars). - */ - description: string; - /** - * Display name (max 256 chars). - */ - displayName: string; - /** - * The core content of the template. Configuration of the scanning process. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; - /** - * The template name. Output only. The template will have one of the - * following formats: `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` - */ - name: string; - /** - * The last update timestamp of a inspectTemplate, output only field. - */ - updateTime: string; -} -/** - * Contains a configuration to make dlp api calls on a repeating basis. - */ -export interface Schema$GooglePrivacyDlpV2JobTrigger { - /** - * The creation timestamp of a triggeredJob, output only field. - */ - createTime: string; - /** - * User provided description (max 256 chars) - */ - description: string; - /** - * Display name (max 100 chars) - */ - displayName: string; - /** - * A stream of errors encountered when the trigger was activated. Repeated - * errors may result in the JobTrigger automaticaly being paused. Will return - * the last 100 errors. Whenever the JobTrigger is modified this list will be - * cleared. Output only field. - */ - errors: Schema$GooglePrivacyDlpV2Error[]; - inspectJob: Schema$GooglePrivacyDlpV2InspectJobConfig; - /** - * The timestamp of the last time this trigger executed, output only field. - */ - lastRunTime: string; - /** - * Unique resource name for the triggeredJob, assigned by the service when the - * triggeredJob is created, for example - * `projects/dlp-test-project/triggeredJobs/53234423`. - */ - name: string; - /** - * A status for this trigger. [required] - */ - status: string; - /** - * A list of triggers which will be OR'ed together. Only one in the list - * needs to trigger for a job to be started. The list may contain only a - * single Schedule trigger and must have at least one object. - */ - triggers: Schema$GooglePrivacyDlpV2Trigger[]; - /** - * The last update timestamp of a triggeredJob, output only field. - */ - updateTime: string; -} -/** - * k-anonymity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2KAnonymityConfig { - /** - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and repeated - * data types are not supported; however, nested fields are supported so long - * as they are not structs themselves or nested within a repeated field. - */ - quasiIds: Schema$GooglePrivacyDlpV2FieldId[]; -} -/** - * The set of columns' values that share the same ldiversity value - */ -export interface Schema$GooglePrivacyDlpV2KAnonymityEquivalenceClass { - /** - * Size of the equivalence class, for example number of rows with the above - * set of values. - */ - equivalenceClassSize: string; - /** - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; -} -export interface Schema$GooglePrivacyDlpV2KAnonymityHistogramBucket { - /** - * Total number of equivalence classes in this bucket. - */ - bucketSize: string; - /** - * Total number of distinct equivalence classes in this bucket. - */ - bucketValueCount: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2KAnonymityEquivalenceClass[]; - /** - * Lower bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeLowerBound: string; - /** - * Upper bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeUpperBound: string; -} -/** - * Result of the k-anonymity computation. - */ -export interface Schema$GooglePrivacyDlpV2KAnonymityResult { - /** - * Histogram of k-anonymity equivalence classes. - */ - equivalenceClassHistogramBuckets: - Schema$GooglePrivacyDlpV2KAnonymityHistogramBucket[]; -} -/** - * A unique identifier for a Datastore entity. If a key's partition ID or - * any of its path kinds or names are reserved/read-only, the key is - * reserved/read-only. A reserved/read-only key is forbidden in certain - * documented contexts. - */ -export interface Schema$GooglePrivacyDlpV2Key { - /** - * Entities are partitioned into subsets, currently identified by a project ID - * and namespace ID. Queries are scoped to a single partition. - */ - partitionId: Schema$GooglePrivacyDlpV2PartitionId; - /** - * The entity path. An entity path consists of one or more elements composed - * of a kind and a string or numerical identifier, which identify entities. - * The first element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of the - * path are called the element's _ancestors_. A path can never be empty, - * and a path can have at most 100 elements. - */ - path: Schema$GooglePrivacyDlpV2PathElement[]; -} -/** - * A representation of a Datastore kind. - */ -export interface Schema$GooglePrivacyDlpV2KindExpression { - /** - * The name of the kind. - */ - name: string; -} -/** - * Reidentifiability metric. This corresponds to a risk model similar to what is - * called "journalist risk" in the literature, except the attack - * dataset is statistically modeled instead of being perfectly known. This can - * be done using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - */ -export interface Schema$GooglePrivacyDlpV2KMapEstimationConfig { - /** - * Several auxiliary tables can be used in the analysis. Each custom_tag used - * to tag a quasi-identifiers column must appear in exactly one column of one - * auxiliary table. - */ - auxiliaryTables: Schema$GooglePrivacyDlpV2AuxiliaryTable[]; - /** - * Fields considered to be quasi-identifiers. No two columns can have the same - * tag. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2TaggedField[]; - /** - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. Required - * if no column is tagged with a region-specific InfoType (like US_ZIP_5) or a - * region code. - */ - regionCode: string; -} -/** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 - * records whose quasi-identifier values correspond to 3, 4 or 5 people in the - * overlying population. An important particular case is when min_anonymity = - * max_anonymity = 1: the frequency field then corresponds to the number of - * uniquely identifiable records. - */ -export interface Schema$GooglePrivacyDlpV2KMapEstimationHistogramBucket { - /** - * Number of records within these anonymity bounds. - */ - bucketSize: string; - /** - * Total number of distinct quasi-identifier tuple values in this bucket. - */ - bucketValueCount: string; - /** - * Sample of quasi-identifier tuple values in this bucket. The total number of - * classes returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2KMapEstimationQuasiIdValues[]; - /** - * Always greater than or equal to min_anonymity. - */ - maxAnonymity: string; - /** - * Always positive. - */ - minAnonymity: string; -} -/** - * A tuple of values for the quasi-identifier columns. - */ -export interface Schema$GooglePrivacyDlpV2KMapEstimationQuasiIdValues { - /** - * The estimated anonymity for these quasi-identifier values. - */ - estimatedAnonymity: string; - /** - * The quasi-identifier values. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; -} -/** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - */ -export interface Schema$GooglePrivacyDlpV2KMapEstimationResult { - /** - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: {min_anonymity: 1, - * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, - * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} mean - * that there are no record with an estimated anonymity of 4, 5, or larger - * than 10. - */ - kMapEstimationHistogram: - Schema$GooglePrivacyDlpV2KMapEstimationHistogramBucket[]; -} -/** - * Include to use an existing data crypto key wrapped by KMS. Authorization - * requires the following IAM permissions when sending a request to perform a - * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt - */ -export interface Schema$GooglePrivacyDlpV2KmsWrappedCryptoKey { - /** - * The resource name of the KMS CryptoKey to use for unwrapping. [required] - */ - cryptoKeyName: string; - /** - * The wrapped data crypto key. [required] - */ - wrappedKey: string; -} -/** - * l-diversity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2LDiversityConfig { - /** - * Set of quasi-identifiers indicating how equivalence classes are defined for - * the l-diversity computation. When multiple fields are specified, they are - * considered a single composite key. - */ - quasiIds: Schema$GooglePrivacyDlpV2FieldId[]; - /** - * Sensitive field for computing the l-value. - */ - sensitiveAttribute: Schema$GooglePrivacyDlpV2FieldId; -} -/** - * The set of columns' values that share the same ldiversity value. - */ -export interface Schema$GooglePrivacyDlpV2LDiversityEquivalenceClass { - /** - * Size of the k-anonymity equivalence class. - */ - equivalenceClassSize: string; - /** - * Number of distinct sensitive values in this equivalence class. - */ - numDistinctSensitiveValues: string; - /** - * Quasi-identifier values defining the k-anonymity equivalence class. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2Value[]; - /** - * Estimated frequencies of top sensitive values. - */ - topSensitiveValues: Schema$GooglePrivacyDlpV2ValueFrequency[]; -} -export interface Schema$GooglePrivacyDlpV2LDiversityHistogramBucket { - /** - * Total number of equivalence classes in this bucket. - */ - bucketSize: string; - /** - * Total number of distinct equivalence classes in this bucket. - */ - bucketValueCount: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2LDiversityEquivalenceClass[]; - /** - * Lower bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyLowerBound: string; - /** - * Upper bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyUpperBound: string; -} -/** - * Result of the l-diversity computation. - */ -export interface Schema$GooglePrivacyDlpV2LDiversityResult { - /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - */ - sensitiveValueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2LDiversityHistogramBucket[]; -} -/** - * Message for specifying an adjustment to the likelihood of a finding as part - * of a detection rule. - */ -export interface Schema$GooglePrivacyDlpV2LikelihoodAdjustment { - /** - * Set the likelihood of a finding to a fixed value. - */ - fixedLikelihood: string; - /** - * Increase or decrease the likelihood by the specified number of levels. For - * example, if a finding would be `POSSIBLE` without the detection rule and - * `relative_likelihood` is 1, then it is upgraded to `LIKELY`, while a value - * of -1 would downgrade it to `UNLIKELY`. Likelihood may never drop below - * `VERY_UNLIKELY` or exceed `VERY_LIKELY`, so applying an adjustment of 1 - * followed by an adjustment of -1 when base likelihood is `VERY_LIKELY` will - * result in a final likelihood of `LIKELY`. - */ - relativeLikelihood: number; -} -/** - * Response message for ListDeidentifyTemplates. - */ -export interface Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse { - /** - * List of deidentify templates, up to page_size in - * ListDeidentifyTemplatesRequest. - */ - deidentifyTemplates: Schema$GooglePrivacyDlpV2DeidentifyTemplate[]; - /** - * If the next page is available then the next page token to be used in - * following ListDeidentifyTemplates request. - */ - nextPageToken: string; -} -/** - * The response message for listing DLP jobs. - */ -export interface Schema$GooglePrivacyDlpV2ListDlpJobsResponse { - /** - * A list of DlpJobs that matches the specified filter in the request. - */ - jobs: Schema$GooglePrivacyDlpV2DlpJob[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * Response to the ListInfoTypes request. - */ -export interface Schema$GooglePrivacyDlpV2ListInfoTypesResponse { - /** - * Set of sensitive infoTypes. - */ - infoTypes: Schema$GooglePrivacyDlpV2InfoTypeDescription[]; -} -/** - * Response message for ListInspectTemplates. - */ -export interface Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse { - /** - * List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. - */ - inspectTemplates: Schema$GooglePrivacyDlpV2InspectTemplate[]; - /** - * If the next page is available then the next page token to be used in - * following ListInspectTemplates request. - */ - nextPageToken: string; -} -/** - * Response message for ListJobTriggers. - */ -export interface Schema$GooglePrivacyDlpV2ListJobTriggersResponse { - /** - * List of triggeredJobs, up to page_size in ListJobTriggersRequest. - */ - jobTriggers: Schema$GooglePrivacyDlpV2JobTrigger[]; - /** - * If the next page is available then the next page token to be used in - * following ListJobTriggers request. - */ - nextPageToken: string; -} -/** - * Specifies the location of the finding. - */ -export interface Schema$GooglePrivacyDlpV2Location { - /** - * Zero-based byte offsets delimiting the finding. These are relative to the - * finding's containing element. Note that when the content is not - * textual, this references the UTF-8 encoded textual representation of the - * content. Omitted if content is an image. - */ - byteRange: Schema$GooglePrivacyDlpV2Range; - /** - * Unicode character offsets delimiting the finding. These are relative to the - * finding's containing element. Provided when the content is text. - */ - codepointRange: Schema$GooglePrivacyDlpV2Range; - /** - * List of nested objects pointing to the precise location of the finding - * within the file or record. - */ - contentLocations: Schema$GooglePrivacyDlpV2ContentLocation[]; -} -/** - * Compute numerical stats over an individual column, including min, max, and - * quantiles. - */ -export interface Schema$GooglePrivacyDlpV2NumericalStatsConfig { - /** - * Field to compute numerical stats on. Supported types are integer, float, - * date, datetime, timestamp, time. - */ - field: Schema$GooglePrivacyDlpV2FieldId; -} -/** - * Result of the numerical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2NumericalStatsResult { - /** - * Maximum value appearing in the column. - */ - maxValue: Schema$GooglePrivacyDlpV2Value; - /** - * Minimum value appearing in the column. - */ - minValue: Schema$GooglePrivacyDlpV2Value; - /** - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. - */ - quantileValues: Schema$GooglePrivacyDlpV2Value[]; -} -/** - * Cloud repository for storing output. - */ -export interface Schema$GooglePrivacyDlpV2OutputStorageConfig { - /** - * Schema used for writing the findings. Columns are derived from the - * `Finding` object. If appending to an existing table, any columns from the - * predefined schema that are missing will be added. No columns in the - * existing table will be deleted. If unspecified, then all available columns - * will be used for a new table, and no changes will be made to an existing - * table. - */ - outputSchema: string; - /** - * Store findings in an existing table or a new table in an existing dataset. - * Each column in an existing table must have the same name, type, and mode of - * a field in the `Finding` object. If table_id is not set a new one will be - * generated for you with the following format: - * dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for - * generating the date details. - */ - table: Schema$GooglePrivacyDlpV2BigQueryTable; -} -/** - * Datastore partition ID. A partition ID identifies a grouping of entities. The - * grouping is always by project and namespace, however the namespace ID may be - * empty. A partition ID contains several dimensions: project ID and namespace - * ID. - */ -export interface Schema$GooglePrivacyDlpV2PartitionId { - /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; - /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * A (kind, ID/name) pair used to construct a key path. If either name or ID is - * set, the element is complete. If neither is set, the element is incomplete. - */ -export interface Schema$GooglePrivacyDlpV2PathElement { - /** - * The auto-allocated ID of the entity. Never equal to zero. Values less than - * zero are discouraged and may not be supported in the future. - */ - id: string; - /** - * The kind of the entity. A kind matching regex `__.*__` is - * reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - kind: string; - /** - * The name of the entity. A name matching regex `__.*__` is - * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - name: string; -} -/** - * A rule for transforming a value. - */ -export interface Schema$GooglePrivacyDlpV2PrimitiveTransformation { - bucketingConfig: Schema$GooglePrivacyDlpV2BucketingConfig; - characterMaskConfig: Schema$GooglePrivacyDlpV2CharacterMaskConfig; - cryptoHashConfig: Schema$GooglePrivacyDlpV2CryptoHashConfig; - cryptoReplaceFfxFpeConfig: Schema$GooglePrivacyDlpV2CryptoReplaceFfxFpeConfig; - dateShiftConfig: Schema$GooglePrivacyDlpV2DateShiftConfig; - fixedSizeBucketingConfig: Schema$GooglePrivacyDlpV2FixedSizeBucketingConfig; - redactConfig: Schema$GooglePrivacyDlpV2RedactConfig; - replaceConfig: Schema$GooglePrivacyDlpV2ReplaceValueConfig; - replaceWithInfoTypeConfig: Schema$GooglePrivacyDlpV2ReplaceWithInfoTypeConfig; - timePartConfig: Schema$GooglePrivacyDlpV2TimePartConfig; -} -/** - * Privacy metric to compute for reidentification risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2PrivacyMetric { - categoricalStatsConfig: Schema$GooglePrivacyDlpV2CategoricalStatsConfig; - kAnonymityConfig: Schema$GooglePrivacyDlpV2KAnonymityConfig; - kMapEstimationConfig: Schema$GooglePrivacyDlpV2KMapEstimationConfig; - lDiversityConfig: Schema$GooglePrivacyDlpV2LDiversityConfig; - numericalStatsConfig: Schema$GooglePrivacyDlpV2NumericalStatsConfig; -} -/** - * Message for specifying a window around a finding to apply a detection rule. - */ -export interface Schema$GooglePrivacyDlpV2Proximity { - /** - * Number of characters after the finding to consider. - */ - windowAfter: number; - /** - * Number of characters before the finding to consider. - */ - windowBefore: number; -} -/** - * Publish the results of a DlpJob to a pub sub channel. Compatible with: - * Inspect, Risk - */ -export interface Schema$GooglePrivacyDlpV2PublishToPubSub { - /** - * Cloud Pub/Sub topic to send notifications to. The topic must have given - * publishing access rights to the DLP API service account executing the long - * running DlpJob sending the notifications. Format is - * projects/{project}/topics/{topic}. - */ - topic: string; -} -/** - * A quasi-identifier column has a custom_tag, used to know which column in the - * data corresponds to which column in the statistical model. - */ -export interface Schema$GooglePrivacyDlpV2QuasiIdField { - customTag: string; - field: Schema$GooglePrivacyDlpV2FieldId; -} -/** - * Message for infoType-dependent details parsed from quote. - */ -export interface Schema$GooglePrivacyDlpV2QuoteInfo { - dateTime: Schema$GooglePrivacyDlpV2DateTime; -} -/** - * Generic half-open interval [start, end) - */ -export interface Schema$GooglePrivacyDlpV2Range { - /** - * Index of the last character of the range (exclusive). - */ - end: string; - /** - * Index of the first character of the range (inclusive). - */ - start: string; -} -/** - * A condition for determining whether a transformation should be applied to a - * field. - */ -export interface Schema$GooglePrivacyDlpV2RecordCondition { - /** - * An expression. - */ - expressions: Schema$GooglePrivacyDlpV2Expressions; -} -/** - * Message for a unique key indicating a record that contains a finding. - */ -export interface Schema$GooglePrivacyDlpV2RecordKey { - bigQueryKey: Schema$GooglePrivacyDlpV2BigQueryKey; - datastoreKey: Schema$GooglePrivacyDlpV2DatastoreKey; -} -/** - * Location of a finding within a row or record. - */ -export interface Schema$GooglePrivacyDlpV2RecordLocation { - /** - * Field id of the field containing the finding. - */ - fieldId: Schema$GooglePrivacyDlpV2FieldId; - /** - * Key of the finding. - */ - recordKey: Schema$GooglePrivacyDlpV2RecordKey; - /** - * Location within a `ContentItem.Table`. - */ - tableLocation: Schema$GooglePrivacyDlpV2TableLocation; -} -/** - * Configuration to suppress records whose suppression conditions evaluate to - * true. - */ -export interface Schema$GooglePrivacyDlpV2RecordSuppression { - /** - * A condition that when it evaluates to true will result in the record being - * evaluated to be suppressed from the transformed content. - */ - condition: Schema$GooglePrivacyDlpV2RecordCondition; -} -/** - * A type of transformation that is applied over structured data such as a - * table. - */ -export interface Schema$GooglePrivacyDlpV2RecordTransformations { - /** - * Transform the record by applying various field transformations. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2FieldTransformation[]; - /** - * Configuration defining which records get suppressed entirely. Records that - * match any suppression rule are omitted from the output [optional]. - */ - recordSuppressions: Schema$GooglePrivacyDlpV2RecordSuppression[]; -} -/** - * Redact a given value. For example, if used with an `InfoTypeTransformation` - * transforming PHONE_NUMBER, and input 'My phone number is - * 206-555-0123', the output would be 'My phone number is '. - */ -export interface Schema$GooglePrivacyDlpV2RedactConfig {} -/** - * Request to search for potentially sensitive info in a list of items and - * replace it with a default or provided content. - */ -export interface Schema$GooglePrivacyDlpV2RedactImageRequest { - /** - * The content must be PNG, JPEG, SVG or BMP. - */ - byteItem: Schema$GooglePrivacyDlpV2ByteContentItem; - /** - * The configuration for specifying what content to redact from images. - */ - imageRedactionConfigs: Schema$GooglePrivacyDlpV2ImageRedactionConfig[]; - /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; -} -/** - * Results of redacting an image. - */ -export interface Schema$GooglePrivacyDlpV2RedactImageResponse { - /** - * If an image was being inspected and the InspectConfig's include_quote - * was set to true, then this field will include all text, if any, that was - * found in the image. - */ - extractedText: string; - /** - * The redacted image. The type will be the same as the original image. - */ - redactedImage: string; -} -/** - * Message defining a custom regular expression. - */ -export interface Schema$GooglePrivacyDlpV2Regex { - /** - * Pattern defining the regular expression. - */ - pattern: string; -} -/** - * Request to re-identify an item. - */ -export interface Schema$GooglePrivacyDlpV2ReidentifyContentRequest { - /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * `inspect_config` will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to re-identify. Will be treated as text. - */ - item: Schema$GooglePrivacyDlpV2ContentItem; - /** - * Configuration for the re-identification of the content item. This field - * shares the same proto message type that is used for de-identification, - * however its usage here is for the reversal of the previous - * de-identification. Re-identification is performed by examining the - * transformations used to de-identify the items and executing the reverse. - * This requires that only reversible transformations be provided here. The - * reversible transformations are: - `CryptoReplaceFfxFpeConfig` - */ - reidentifyConfig: Schema$GooglePrivacyDlpV2DeidentifyConfig; - /** - * Optional template to use. References an instance of `DeidentifyTemplate`. - * Any configuration directly specified in `reidentify_config` or - * `inspect_config` will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - reidentifyTemplateName: string; -} -/** - * Results of re-identifying a item. - */ -export interface Schema$GooglePrivacyDlpV2ReidentifyContentResponse { - /** - * The re-identified item. - */ - item: Schema$GooglePrivacyDlpV2ContentItem; - /** - * An overview of the changes that were made to the `item`. - */ - overview: Schema$GooglePrivacyDlpV2TransformationOverview; -} -/** - * Replace each input value with a given `Value`. - */ -export interface Schema$GooglePrivacyDlpV2ReplaceValueConfig { - /** - * Value to replace it with. - */ - newValue: Schema$GooglePrivacyDlpV2Value; -} -/** - * Replace each matching finding with the name of the info_type. - */ -export interface Schema$GooglePrivacyDlpV2ReplaceWithInfoTypeConfig {} -export interface Schema$GooglePrivacyDlpV2RequestedOptions { - jobConfig: Schema$GooglePrivacyDlpV2InspectJobConfig; - /** - * If run with an InspectTemplate, a snapshot of its state at the time of this - * run. - */ - snapshotInspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; -} -export interface Schema$GooglePrivacyDlpV2Result { - /** - * Statistics of how many instances of each info type were found during - * inspect job. - */ - infoTypeStats: Schema$GooglePrivacyDlpV2InfoTypeStats[]; - /** - * Total size in bytes that were processed. - */ - processedBytes: string; - /** - * Estimate of the number of bytes to process. - */ - totalEstimatedBytes: string; -} -/** - * Configuration for a risk analysis job. - */ -export interface Schema$GooglePrivacyDlpV2RiskAnalysisJobConfig { - /** - * Actions to execute at the completion of the job. Are executed in the order - * provided. - */ - actions: Schema$GooglePrivacyDlpV2Action[]; - /** - * Privacy metric to compute. - */ - privacyMetric: Schema$GooglePrivacyDlpV2PrivacyMetric; - /** - * Input dataset to compute metrics over. - */ - sourceTable: Schema$GooglePrivacyDlpV2BigQueryTable; -} -export interface Schema$GooglePrivacyDlpV2Row { - values: Schema$GooglePrivacyDlpV2Value[]; -} -/** - * If set, the detailed findings will be persisted to the specified - * OutputStorageConfig. Only a single instance of this action can be specified. - * Compatible with: Inspect - */ -export interface Schema$GooglePrivacyDlpV2SaveFindings { - outputConfig: Schema$GooglePrivacyDlpV2OutputStorageConfig; -} -/** - * Schedule for triggeredJobs. - */ -export interface Schema$GooglePrivacyDlpV2Schedule { - /** - * With this option a job is started a regular periodic basis. For example: - * every 10 minutes. A scheduled start time will be skipped if the previous - * execution has not ended when its scheduled time occurs. This value must be - * set to a time duration greater than or equal to 60 minutes and can be no - * longer than 60 days. - */ - recurrencePeriodDuration: string; -} -/** - * Shared message indicating Cloud storage type. - */ -export interface Schema$GooglePrivacyDlpV2StorageConfig { - /** - * BigQuery options specification. - */ - bigQueryOptions: Schema$GooglePrivacyDlpV2BigQueryOptions; - /** - * Google Cloud Storage options specification. - */ - cloudStorageOptions: Schema$GooglePrivacyDlpV2CloudStorageOptions; - /** - * Google Cloud Datastore options specification. - */ - datastoreOptions: Schema$GooglePrivacyDlpV2DatastoreOptions; - timespanConfig: Schema$GooglePrivacyDlpV2TimespanConfig; -} -/** - * A collection that informs the user the number of times a particular - * `TransformationResultCode` and error details occurred. - */ -export interface Schema$GooglePrivacyDlpV2SummaryResult { - code: string; - count: string; - /** - * A place for warnings or errors to show up if a transformation didn't - * work as expected. - */ - details: string; -} -/** - * Message for detecting output from deidentification transformations such as - * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). - * These types of transformations are those that perform pseudonymization, - * thereby producing a "surrogate" as output. This should be used in - * conjunction with a field on the transformation such as `surrogate_info_type`. - * This custom info type does not support the use of `detection_rules`. - */ -export interface Schema$GooglePrivacyDlpV2SurrogateType {} -/** - * Structured content to inspect. Up to 50,000 `Value`s per request allowed. - */ -export interface Schema$GooglePrivacyDlpV2Table { - headers: Schema$GooglePrivacyDlpV2FieldId[]; - rows: Schema$GooglePrivacyDlpV2Row[]; -} -/** - * Location of a finding within a table. - */ -export interface Schema$GooglePrivacyDlpV2TableLocation { - /** - * The zero-based index of the row where the finding is located. - */ - rowIndex: string; -} -/** - * A column with a semantic tag attached. - */ -export interface Schema$GooglePrivacyDlpV2TaggedField { - /** - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on the - * possible values of this column (below). - */ - customTag: string; - /** - * Identifies the column. [required] - */ - field: Schema$GooglePrivacyDlpV2FieldId; - /** - * If no semantic tag is indicated, we infer the statistical model from the - * distribution of values in the input data - */ - inferred: Schema$GoogleProtobufEmpty; - /** - * A column can be tagged with a InfoType to use the relevant public dataset - * as a statistical model of population, if available. We currently support US - * ZIP codes, region codes, ages and genders. To programmatically obtain the - * list of supported InfoTypes, use ListInfoTypes with the - * supported_by=RISK_ANALYSIS filter. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; -} -/** - * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a - * portion of the value. - */ -export interface Schema$GooglePrivacyDlpV2TimePartConfig { - partToExtract: string; -} -/** - * Configuration of the timespan of the items to include in scanning. Currently - * only supported when inspecting Google Cloud Storage and BigQuery. - */ -export interface Schema$GooglePrivacyDlpV2TimespanConfig { - /** - * When the job is started by a JobTrigger we will automatically figure out a - * valid start_time to avoid scanning files that have not been modified since - * the last time the JobTrigger executed. This will be based on the time of - * the execution of the last run of the JobTrigger. - */ - enableAutoPopulationOfTimespanConfig: boolean; - /** - * Exclude files newer than this value. If set to zero, no upper time limit is - * applied. - */ - endTime: string; - /** - * Exclude files older than this value. - */ - startTime: string; - /** - * Specification of the field containing the timestamp of scanned items. - * Required for data sources like Datastore or BigQuery. The valid data types - * of the timestamp field are: for BigQuery - timestamp, date, datetime; for - * Datastore - timestamp. Datastore entity will be scanned if the timestamp - * property does not exist or its value is empty or invalid. - */ - timestampField: Schema$GooglePrivacyDlpV2FieldId; -} -export interface Schema$GooglePrivacyDlpV2TimeZone { - /** - * Set only if the offset can be determined. Positive for time ahead of UTC. - * E.g. For "UTC-9", this value is -540. - */ - offsetMinutes: number; -} -/** - * Overview of the modifications that occurred. - */ -export interface Schema$GooglePrivacyDlpV2TransformationOverview { - /** - * Transformations applied to the dataset. - */ - transformationSummaries: Schema$GooglePrivacyDlpV2TransformationSummary[]; - /** - * Total size in bytes that were transformed in some way. - */ - transformedBytes: string; -} -/** - * Summary of a single tranformation. Only one of 'transformation', - * 'field_transformation', or 'record_suppress' will be set. - */ -export interface Schema$GooglePrivacyDlpV2TransformationSummary { - /** - * Set if the transformation was limited to a specific FieldId. - */ - field: Schema$GooglePrivacyDlpV2FieldId; - /** - * The field transformation that was applied. If multiple field - * transformations are requested for a single field, this list will contain - * all of them; otherwise, only one is supplied. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2FieldTransformation[]; - /** - * Set if the transformation was limited to a specific info_type. - */ - infoType: Schema$GooglePrivacyDlpV2InfoType; - /** - * The specific suppression option these stats apply to. - */ - recordSuppress: Schema$GooglePrivacyDlpV2RecordSuppression; - results: Schema$GooglePrivacyDlpV2SummaryResult[]; - /** - * The specific transformation these stats apply to. - */ - transformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; - /** - * Total size in bytes that were transformed in some way. - */ - transformedBytes: string; -} -/** - * Use this to have a random data crypto key generated. It will be discarded - * after the request finishes. - */ -export interface Schema$GooglePrivacyDlpV2TransientCryptoKey { - /** - * Name of the key. [required] This is an arbitrary string used to - * differentiate different keys. A unique key is generated per name: two - * separate `TransientCryptoKey` protos share the same generated key if their - * names are the same. When the data crypto key is generated, this name is not - * used in any way (repeating the api call will result in a different key - * being generated). - */ - name: string; -} -/** - * What event needs to occur for a new job to be started. - */ -export interface Schema$GooglePrivacyDlpV2Trigger { - /** - * Create a job on a repeating basis based on the elapse of time. - */ - schedule: Schema$GooglePrivacyDlpV2Schedule; -} -/** - * Using raw keys is prone to security risks due to accidentally leaking the - * key. Choose another type of key if possible. - */ -export interface Schema$GooglePrivacyDlpV2UnwrappedCryptoKey { - /** - * The AES 128/192/256 bit key. [required] - */ - key: string; -} -/** - * Request message for UpdateDeidentifyTemplate. - */ -export interface Schema$GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest { - /** - * New DeidentifyTemplate value. - */ - deidentifyTemplate: Schema$GooglePrivacyDlpV2DeidentifyTemplate; - /** - * Mask to control which fields get updated. - */ - updateMask: string; -} -/** - * Request message for UpdateInspectTemplate. - */ -export interface Schema$GooglePrivacyDlpV2UpdateInspectTemplateRequest { - /** - * New InspectTemplate value. - */ - inspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; - /** - * Mask to control which fields get updated. - */ - updateMask: string; -} -/** - * Request message for UpdateJobTrigger. - */ -export interface Schema$GooglePrivacyDlpV2UpdateJobTriggerRequest { - /** - * New JobTrigger value. - */ - jobTrigger: Schema$GooglePrivacyDlpV2JobTrigger; - /** - * Mask to control which fields get updated. - */ - updateMask: string; -} -/** - * Set of primitive values supported by the system. Note that for the purposes - * of inspection or transformation, the number of bytes considered to comprise a - * 'Value' is based on its representation as a UTF-8 encoded string. For - * example, if 'integer_value' is set to 123456789, the number of bytes - * would be counted as 9, even though an int64 only holds up to 8 bytes of data. - */ -export interface Schema$GooglePrivacyDlpV2Value { - booleanValue: boolean; - dateValue: Schema$GoogleTypeDate; - dayOfWeekValue: string; - floatValue: number; - integerValue: string; - stringValue: string; - timestampValue: string; - timeValue: Schema$GoogleTypeTimeOfDay; -} -/** - * A value of a field, including its frequency. - */ -export interface Schema$GooglePrivacyDlpV2ValueFrequency { + export interface Schema$GooglePrivacyDlpV2ReplaceWithInfoTypeConfig {} + export interface Schema$GooglePrivacyDlpV2RequestedOptions { + jobConfig: Schema$GooglePrivacyDlpV2InspectJobConfig; + /** + * If run with an InspectTemplate, a snapshot of its state at the time of + * this run. + */ + snapshotInspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; + } + export interface Schema$GooglePrivacyDlpV2Result { + /** + * Statistics of how many instances of each info type were found during + * inspect job. + */ + infoTypeStats: Schema$GooglePrivacyDlpV2InfoTypeStats[]; + /** + * Total size in bytes that were processed. + */ + processedBytes: string; + /** + * Estimate of the number of bytes to process. + */ + totalEstimatedBytes: string; + } /** - * How many times the value is contained in the field. - */ - count: string; + * Configuration for a risk analysis job. + */ + export interface Schema$GooglePrivacyDlpV2RiskAnalysisJobConfig { + /** + * Actions to execute at the completion of the job. Are executed in the + * order provided. + */ + actions: Schema$GooglePrivacyDlpV2Action[]; + /** + * Privacy metric to compute. + */ + privacyMetric: Schema$GooglePrivacyDlpV2PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + sourceTable: Schema$GooglePrivacyDlpV2BigQueryTable; + } + export interface Schema$GooglePrivacyDlpV2Row { + values: Schema$GooglePrivacyDlpV2Value[]; + } /** - * A value contained in the field in question. + * If set, the detailed findings will be persisted to the specified + * OutputStorageConfig. Only a single instance of this action can be + * specified. Compatible with: Inspect */ - value: Schema$GooglePrivacyDlpV2Value; -} -/** - * Message defining a list of words or phrases to search for in the data. - */ -export interface Schema$GooglePrivacyDlpV2WordList { + export interface Schema$GooglePrivacyDlpV2SaveFindings { + outputConfig: Schema$GooglePrivacyDlpV2OutputStorageConfig; + } /** - * Words or phrases defining the dictionary. The dictionary must contain at - * least one phrase and every phrase must contain at least 2 characters that - * are letters or digits. [required] - */ - words: string[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobufEmpty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpcStatus { + * Schedule for triggeredJobs. + */ + export interface Schema$GooglePrivacyDlpV2Schedule { + /** + * With this option a job is started a regular periodic basis. For example: + * every 10 minutes. A scheduled start time will be skipped if the previous + * execution has not ended when its scheduled time occurs. This value must + * be set to a time duration greater than or equal to 60 minutes and can be + * no longer than 60 days. + */ + recurrencePeriodDuration: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Shared message indicating Cloud storage type. + */ + export interface Schema$GooglePrivacyDlpV2StorageConfig { + /** + * BigQuery options specification. + */ + bigQueryOptions: Schema$GooglePrivacyDlpV2BigQueryOptions; + /** + * Google Cloud Storage options specification. + */ + cloudStorageOptions: Schema$GooglePrivacyDlpV2CloudStorageOptions; + /** + * Google Cloud Datastore options specification. + */ + datastoreOptions: Schema$GooglePrivacyDlpV2DatastoreOptions; + timespanConfig: Schema$GooglePrivacyDlpV2TimespanConfig; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * A collection that informs the user the number of times a particular + * `TransformationResultCode` and error details occurred. + */ + export interface Schema$GooglePrivacyDlpV2SummaryResult { + code: string; + count: string; + /** + * A place for warnings or errors to show up if a transformation didn't + * work as expected. + */ + details: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Message for detecting output from deidentification transformations such as + * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2/organizations.deidentifyTemplates#cryptoreplaceffxfpeconfig). + * These types of transformations are those that perform pseudonymization, + * thereby producing a "surrogate" as output. This should be used in + * conjunction with a field on the transformation such as + * `surrogate_info_type`. This custom info type does not support the use of + * `detection_rules`. */ - message: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeDate { + export interface Schema$GooglePrivacyDlpV2SurrogateType {} /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. + * Structured content to inspect. Up to 50,000 `Value`s per request allowed. */ - day: number; + export interface Schema$GooglePrivacyDlpV2Table { + headers: Schema$GooglePrivacyDlpV2FieldId[]; + rows: Schema$GooglePrivacyDlpV2Row[]; + } /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. + * Location of a finding within a table. */ - month: number; + export interface Schema$GooglePrivacyDlpV2TableLocation { + /** + * The zero-based index of the row where the finding is located. + */ + rowIndex: string; + } /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeTimeOfDay { + * A column with a semantic tag attached. + */ + export interface Schema$GooglePrivacyDlpV2TaggedField { + /** + * A column can be tagged with a custom tag. In this case, the user must + * indicate an auxiliary table that contains statistical information on the + * possible values of this column (below). + */ + customTag: string; + /** + * Identifies the column. [required] + */ + field: Schema$GooglePrivacyDlpV2FieldId; + /** + * If no semantic tag is indicated, we infer the statistical model from the + * distribution of values in the input data + */ + inferred: Schema$GoogleProtobufEmpty; + /** + * A column can be tagged with a InfoType to use the relevant public dataset + * as a statistical model of population, if available. We currently support + * US ZIP codes, region codes, ages and genders. To programmatically obtain + * the list of supported InfoTypes, use ListInfoTypes with the + * supported_by=RISK_ANALYSIS filter. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + } /** - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing - * time. + * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a + * portion of the value. */ - hours: number; + export interface Schema$GooglePrivacyDlpV2TimePartConfig { + partToExtract: string; + } /** - * Minutes of hour of day. Must be from 0 to 59. - */ - minutes: number; + * Configuration of the timespan of the items to include in scanning. + * Currently only supported when inspecting Google Cloud Storage and BigQuery. + */ + export interface Schema$GooglePrivacyDlpV2TimespanConfig { + /** + * When the job is started by a JobTrigger we will automatically figure out + * a valid start_time to avoid scanning files that have not been modified + * since the last time the JobTrigger executed. This will be based on the + * time of the execution of the last run of the JobTrigger. + */ + enableAutoPopulationOfTimespanConfig: boolean; + /** + * Exclude files newer than this value. If set to zero, no upper time limit + * is applied. + */ + endTime: string; + /** + * Exclude files older than this value. + */ + startTime: string; + /** + * Specification of the field containing the timestamp of scanned items. + * Required for data sources like Datastore or BigQuery. The valid data + * types of the timestamp field are: for BigQuery - timestamp, date, + * datetime; for Datastore - timestamp. Datastore entity will be scanned if + * the timestamp property does not exist or its value is empty or invalid. + */ + timestampField: Schema$GooglePrivacyDlpV2FieldId; + } + export interface Schema$GooglePrivacyDlpV2TimeZone { + /** + * Set only if the offset can be determined. Positive for time ahead of UTC. + * E.g. For "UTC-9", this value is -540. + */ + offsetMinutes: number; + } + /** + * Overview of the modifications that occurred. + */ + export interface Schema$GooglePrivacyDlpV2TransformationOverview { + /** + * Transformations applied to the dataset. + */ + transformationSummaries: Schema$GooglePrivacyDlpV2TransformationSummary[]; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } + /** + * Summary of a single tranformation. Only one of 'transformation', + * 'field_transformation', or 'record_suppress' will be set. + */ + export interface Schema$GooglePrivacyDlpV2TransformationSummary { + /** + * Set if the transformation was limited to a specific FieldId. + */ + field: Schema$GooglePrivacyDlpV2FieldId; + /** + * The field transformation that was applied. If multiple field + * transformations are requested for a single field, this list will contain + * all of them; otherwise, only one is supplied. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2FieldTransformation[]; + /** + * Set if the transformation was limited to a specific info_type. + */ + infoType: Schema$GooglePrivacyDlpV2InfoType; + /** + * The specific suppression option these stats apply to. + */ + recordSuppress: Schema$GooglePrivacyDlpV2RecordSuppression; + results: Schema$GooglePrivacyDlpV2SummaryResult[]; + /** + * The specific transformation these stats apply to. + */ + transformation: Schema$GooglePrivacyDlpV2PrimitiveTransformation; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } + /** + * Use this to have a random data crypto key generated. It will be discarded + * after the request finishes. + */ + export interface Schema$GooglePrivacyDlpV2TransientCryptoKey { + /** + * Name of the key. [required] This is an arbitrary string used to + * differentiate different keys. A unique key is generated per name: two + * separate `TransientCryptoKey` protos share the same generated key if + * their names are the same. When the data crypto key is generated, this + * name is not used in any way (repeating the api call will result in a + * different key being generated). + */ + name: string; + } /** - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + * What event needs to occur for a new job to be started. */ - nanos: number; + export interface Schema$GooglePrivacyDlpV2Trigger { + /** + * Create a job on a repeating basis based on the elapse of time. + */ + schedule: Schema$GooglePrivacyDlpV2Schedule; + } /** - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. + * Using raw keys is prone to security risks due to accidentally leaking the + * key. Choose another type of key if possible. */ - seconds: number; -} - -export class Resource$Infotypes { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$GooglePrivacyDlpV2UnwrappedCryptoKey { + /** + * The AES 128/192/256 bit key. [required] + */ + key: string; } - - getRoot() { - return this.root; + /** + * Request message for UpdateDeidentifyTemplate. + */ + export interface Schema$GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest { + /** + * New DeidentifyTemplate value. + */ + deidentifyTemplate: Schema$GooglePrivacyDlpV2DeidentifyTemplate; + /** + * Mask to control which fields get updated. + */ + updateMask: string; } - - /** - * dlp.infoTypes.list - * @desc Returns a list of the sensitive information types that the DLP API - * supports. For more information, see [Listing supported predefined - * infoTypes](/dlp/docs/listing-infotypes). - * @alias dlp.infoTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional filter to only return infoTypes supported by certain parts of the API. Defaults to supported_by=INSPECT. - * @param {string=} params.languageCode Optional BCP-47 language code for localized infoType friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/infoTypes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Request message for UpdateInspectTemplate. + */ + export interface Schema$GooglePrivacyDlpV2UpdateInspectTemplateRequest { + /** + * New InspectTemplate value. + */ + inspectTemplate: Schema$GooglePrivacyDlpV2InspectTemplate; + /** + * Mask to control which fields get updated. + */ + updateMask: string; } -} - -export class Resource$Organizations { - root: Dlp; - deidentifyTemplates: Resource$Organizations$Deidentifytemplates; - inspectTemplates: Resource$Organizations$Inspecttemplates; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.deidentifyTemplates = - new Resource$Organizations$Deidentifytemplates(root); - this.inspectTemplates = new Resource$Organizations$Inspecttemplates(root); + /** + * Request message for UpdateJobTrigger. + */ + export interface Schema$GooglePrivacyDlpV2UpdateJobTriggerRequest { + /** + * New JobTrigger value. + */ + jobTrigger: Schema$GooglePrivacyDlpV2JobTrigger; + /** + * Mask to control which fields get updated. + */ + updateMask: string; } - - getRoot() { - return this.root; + /** + * Set of primitive values supported by the system. Note that for the purposes + * of inspection or transformation, the number of bytes considered to comprise + * a 'Value' is based on its representation as a UTF-8 encoded string. + * For example, if 'integer_value' is set to 123456789, the number of + * bytes would be counted as 9, even though an int64 only holds up to 8 bytes + * of data. + */ + export interface Schema$GooglePrivacyDlpV2Value { + booleanValue: boolean; + dateValue: Schema$GoogleTypeDate; + dayOfWeekValue: string; + floatValue: number; + integerValue: string; + stringValue: string; + timestampValue: string; + timeValue: Schema$GoogleTypeTimeOfDay; } -} -export class Resource$Organizations$Deidentifytemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); + /** + * A value of a field, including its frequency. + */ + export interface Schema$GooglePrivacyDlpV2ValueFrequency { + /** + * How many times the value is contained in the field. + */ + count: string; + /** + * A value contained in the field in question. + */ + value: Schema$GooglePrivacyDlpV2Value; } - - getRoot() { - return this.root; + /** + * Message defining a list of words or phrases to search for in the data. + */ + export interface Schema$GooglePrivacyDlpV2WordList { + /** + * Words or phrases defining the dictionary. The dictionary must contain at + * least one phrase and every phrase must contain at least 2 characters that + * are letters or digits. [required] + */ + words: string[]; } - - /** - * dlp.organizations.deidentifyTemplates.create - * @desc Creates a DeidentifyTemplate for re-using frequently used - * configuration for de-identifying content, images, and storage. - * @alias dlp.organizations.deidentifyTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2CreateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobufEmpty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpcStatus { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * dlp.organizations.deidentifyTemplates.delete - * @desc Deletes a DeidentifyTemplate. - * @alias dlp.organizations.deidentifyTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeDate { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; } - - /** - * dlp.organizations.deidentifyTemplates.get - * @desc Gets a DeidentifyTemplate. - * @alias dlp.organizations.deidentifyTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Represents a time of day. The date and time zone are either not significant + * or are specified elsewhere. An API may choose to allow leap seconds. + * Related types are google.type.Date and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeTimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business + * closing time. + */ + hours: number; + /** + * Minutes of hour of day. Must be from 0 to 59. + */ + minutes: number; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + */ + nanos: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds: number; } - - /** - * dlp.organizations.deidentifyTemplates.list - * @desc Lists DeidentifyTemplates. - * @alias dlp.organizations.deidentifyTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Infotypes { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>(parameters); + + + /** + * dlp.infoTypes.list + * @desc Returns a list of the sensitive information types that the DLP API + * supports. For more information, see [Listing supported predefined + * infoTypes](/dlp/docs/listing-infotypes). + * @alias dlp.infoTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional filter to only return infoTypes supported by certain parts of the API. Defaults to supported_by=INSPECT. + * @param {string=} params.languageCode Optional BCP-47 language code for localized infoType friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInfoTypesResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInfoTypesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/infoTypes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } + export class Resource$Organizations { + root: Dlp; + deidentifyTemplates: Resource$Organizations$Deidentifytemplates; + inspectTemplates: Resource$Organizations$Inspecttemplates; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.deidentifyTemplates = + new Resource$Organizations$Deidentifytemplates(root); + this.inspectTemplates = new Resource$Organizations$Inspecttemplates(root); + } - /** - * dlp.organizations.deidentifyTemplates.patch - * @desc Updates the DeidentifyTemplate. - * @alias dlp.organizations.deidentifyTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {().GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Organizations$Deidentifytemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Organizations$Inspecttemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.organizations.deidentifyTemplates.create + * @desc Creates a DeidentifyTemplate for re-using frequently used + * configuration for de-identifying content, images, and storage. + * @alias dlp.organizations.deidentifyTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2CreateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - /** - * dlp.organizations.inspectTemplates.create - * @desc Creates an InspectTemplate for re-using frequently used configuration - * for inspecting content, images, and storage. - * @alias dlp.organizations.inspectTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2CreateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.organizations.deidentifyTemplates.delete + * @desc Deletes a DeidentifyTemplate. + * @alias dlp.organizations.deidentifyTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.organizations.inspectTemplates.delete - * @desc Deletes an InspectTemplate. - * @alias dlp.organizations.inspectTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.organizations.deidentifyTemplates.get + * @desc Gets a DeidentifyTemplate. + * @alias dlp.organizations.deidentifyTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dlp.organizations.inspectTemplates.get - * @desc Gets an InspectTemplate. - * @alias dlp.organizations.inspectTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.organizations.deidentifyTemplates.list + * @desc Lists DeidentifyTemplates. + * @alias dlp.organizations.deidentifyTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.organizations.inspectTemplates.list - * @desc Lists InspectTemplates. - * @alias dlp.organizations.inspectTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>(parameters); + /** + * dlp.organizations.deidentifyTemplates.patch + * @desc Updates the DeidentifyTemplate. + * @alias dlp.organizations.deidentifyTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {().GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.organizations.inspectTemplates.patch - * @desc Updates the InspectTemplate. - * @alias dlp.organizations.inspectTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {().GooglePrivacyDlpV2UpdateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Organizations$Inspecttemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects { - root: Dlp; - content: Resource$Projects$Content; - deidentifyTemplates: Resource$Projects$Deidentifytemplates; - dlpJobs: Resource$Projects$Dlpjobs; - image: Resource$Projects$Image; - inspectTemplates: Resource$Projects$Inspecttemplates; - jobTriggers: Resource$Projects$Jobtriggers; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.content = new Resource$Projects$Content(root); - this.deidentifyTemplates = new Resource$Projects$Deidentifytemplates(root); - this.dlpJobs = new Resource$Projects$Dlpjobs(root); - this.image = new Resource$Projects$Image(root); - this.inspectTemplates = new Resource$Projects$Inspecttemplates(root); - this.jobTriggers = new Resource$Projects$Jobtriggers(root); - } + /** + * dlp.organizations.inspectTemplates.create + * @desc Creates an InspectTemplate for re-using frequently used + * configuration for inspecting content, images, and storage. + * @alias dlp.organizations.inspectTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2CreateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Content { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.organizations.inspectTemplates.delete + * @desc Deletes an InspectTemplate. + * @alias dlp.organizations.inspectTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dlp.projects.content.deidentify - * @desc De-identifies potentially sensitive info from a ContentItem. This - * method has limits on input size and output size. [How-to - * guide](/dlp/docs/deidentify-sensitive-data) - * @alias dlp.projects.content.deidentify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2DeidentifyContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deidentify(params?: any, options?: MethodOptions): - AxiosPromise; - deidentify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2DeidentifyContentResponse>): void; - deidentify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2DeidentifyContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/content:deidentify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2DeidentifyContentResponse>(parameters); + /** + * dlp.organizations.inspectTemplates.get + * @desc Gets an InspectTemplate. + * @alias dlp.organizations.inspectTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dlp.projects.content.inspect - * @desc Finds potentially sensitive info in content. This method has limits - * on input size, processing time, and output size. [How-to guide for - * text](/dlp/docs/inspecting-text), [How-to guide for - * images](/dlp/docs/inspecting-images) - * @alias dlp.projects.content.inspect - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2InspectContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - inspect(params?: any, options?: MethodOptions): - AxiosPromise; - inspect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2InspectContentResponse>): void; - inspect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2InspectContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.organizations.inspectTemplates.list + * @desc Lists InspectTemplates. + * @alias dlp.organizations.inspectTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/content:inspect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.projects.content.reidentify - * @desc Re-identifies content that has been de-identified. - * @alias dlp.projects.content.reidentify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name. - * @param {().GooglePrivacyDlpV2ReidentifyContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reidentify(params?: any, options?: MethodOptions): - AxiosPromise; - reidentify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ReidentifyContentResponse>): void; - reidentify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ReidentifyContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.organizations.inspectTemplates.patch + * @desc Updates the InspectTemplate. + * @alias dlp.organizations.inspectTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {().GooglePrivacyDlpV2UpdateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/content:reidentify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2ReidentifyContentResponse>(parameters); - } - } -} - -export class Resource$Projects$Deidentifytemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; - } + export class Resource$Projects { + root: Dlp; + content: Resource$Projects$Content; + deidentifyTemplates: Resource$Projects$Deidentifytemplates; + dlpJobs: Resource$Projects$Dlpjobs; + image: Resource$Projects$Image; + inspectTemplates: Resource$Projects$Inspecttemplates; + jobTriggers: Resource$Projects$Jobtriggers; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.content = new Resource$Projects$Content(root); + this.deidentifyTemplates = + new Resource$Projects$Deidentifytemplates(root); + this.dlpJobs = new Resource$Projects$Dlpjobs(root); + this.image = new Resource$Projects$Image(root); + this.inspectTemplates = new Resource$Projects$Inspecttemplates(root); + this.jobTriggers = new Resource$Projects$Jobtriggers(root); + } - /** - * dlp.projects.deidentifyTemplates.create - * @desc Creates a DeidentifyTemplate for re-using frequently used - * configuration for de-identifying content, images, and storage. - * @alias dlp.projects.deidentifyTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2CreateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Content { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.deidentifyTemplates.delete - * @desc Deletes a DeidentifyTemplate. - * @alias dlp.projects.deidentifyTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.content.deidentify + * @desc De-identifies potentially sensitive info from a ContentItem. This + * method has limits on input size and output size. [How-to + * guide](/dlp/docs/deidentify-sensitive-data) + * @alias dlp.projects.content.deidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2DeidentifyContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deidentify(params?: any, options?: MethodOptions): + AxiosPromise; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2DeidentifyContentResponse>): void; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2DeidentifyContentResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/content:deidentify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2DeidentifyContentResponse>(parameters); + } } - } - /** - * dlp.projects.deidentifyTemplates.get - * @desc Gets a DeidentifyTemplate. - * @alias dlp.projects.deidentifyTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.content.inspect + * @desc Finds potentially sensitive info in content. This method has limits + * on input size, processing time, and output size. [How-to guide for + * text](/dlp/docs/inspecting-text), [How-to guide for + * images](/dlp/docs/inspecting-images) + * @alias dlp.projects.content.inspect + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2InspectContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + inspect(params?: any, options?: MethodOptions): + AxiosPromise; + inspect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2InspectContentResponse>): void; + inspect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2InspectContentResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/content:inspect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2InspectContentResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.projects.deidentifyTemplates.list - * @desc Lists DeidentifyTemplates. - * @alias dlp.projects.deidentifyTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>(parameters); + /** + * dlp.projects.content.reidentify + * @desc Re-identifies content that has been de-identified. + * @alias dlp.projects.content.reidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name. + * @param {().GooglePrivacyDlpV2ReidentifyContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reidentify(params?: any, options?: MethodOptions): + AxiosPromise; + reidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ReidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ReidentifyContentResponse>): void; + reidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ReidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ReidentifyContentResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/content:reidentify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ReidentifyContentResponse>(parameters); + } } } - - /** - * dlp.projects.deidentifyTemplates.patch - * @desc Updates the DeidentifyTemplate. - * @alias dlp.projects.deidentifyTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {().GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Deidentifytemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Dlpjobs { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.deidentifyTemplates.create + * @desc Creates a DeidentifyTemplate for re-using frequently used + * configuration for de-identifying content, images, and storage. + * @alias dlp.projects.deidentifyTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2CreateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - /** - * dlp.projects.dlpJobs.cancel - * @desc Starts asynchronous cancellation on a long-running DlpJob. The server - * makes a best effort to cancel the DlpJob, but success is not guaranteed. - * @alias dlp.projects.dlpJobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource to be cancelled. - * @param {().GooglePrivacyDlpV2CancelDlpJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.deidentifyTemplates.delete + * @desc Deletes a DeidentifyTemplate. + * @alias dlp.projects.deidentifyTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dlp.projects.dlpJobs.create - * @desc Creates a new job to inspect storage or calculate risk metrics. - * [How-to guide](/dlp/docs/compute-risk-analysis). - * @alias dlp.projects.dlpJobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2CreateDlpJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.deidentifyTemplates.get + * @desc Gets a DeidentifyTemplate. + * @alias dlp.projects.deidentifyTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/dlpJobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.projects.dlpJobs.delete - * @desc Deletes a long-running DlpJob. This method indicates that the client - * is no longer interested in the DlpJob result. The job will be cancelled if - * possible. - * @alias dlp.projects.dlpJobs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.deidentifyTemplates.list + * @desc Lists DeidentifyTemplates. + * @alias dlp.projects.deidentifyTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ListDeidentifyTemplatesResponse>( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.projects.dlpJobs.get - * @desc Gets the latest state of a long-running DlpJob. - * @alias dlp.projects.dlpJobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.deidentifyTemplates.patch + * @desc Updates the DeidentifyTemplate. + * @alias dlp.projects.deidentifyTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {().GooglePrivacyDlpV2UpdateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.projects.dlpJobs.list - * @desc Lists DlpJobs that match the specified filter in the request. - * @alias dlp.projects.dlpJobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of ` `. * Supported fields/values for inspect jobs: - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The resource name of the trigger that created job. * Supported fields for risk analysis jobs: - `state` - RUNNING|CANCELED|FINISHED|FAILED * The operator must be `=` or `!=`. Examples: * inspected_storage = cloud_storage AND state = done * inspected_storage = cloud_storage OR inspected_storage = bigquery * inspected_storage = cloud_storage AND (state = done OR state = canceled) The length of this field should be no more than 500 characters. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {string=} params.type The type of job. Defaults to `DlpJobType.INSPECT` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Dlpjobs { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/dlpJobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Image { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.dlpJobs.cancel + * @desc Starts asynchronous cancellation on a long-running DlpJob. The + * server makes a best effort to cancel the DlpJob, but success is not + * guaranteed. + * @alias dlp.projects.dlpJobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource to be cancelled. + * @param {().GooglePrivacyDlpV2CancelDlpJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dlp.projects.image.redact - * @desc Redacts potentially sensitive info from an image. This method has - * limits on input size, processing time, and output size. [How-to - * guide](/dlp/docs/redacting-sensitive-data-images) - * @alias dlp.projects.image.redact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2RedactImageRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - redact(params?: any, options?: MethodOptions): - AxiosPromise; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.dlpJobs.create + * @desc Creates a new job to inspect storage or calculate risk metrics. + * [How-to guide](/dlp/docs/compute-risk-analysis). + * @alias dlp.projects.dlpJobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2CreateDlpJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/dlpJobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/image:redact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Projects$Inspecttemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.dlpJobs.delete + * @desc Deletes a long-running DlpJob. This method indicates that the + * client is no longer interested in the DlpJob result. The job will be + * cancelled if possible. + * @alias dlp.projects.dlpJobs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dlp.projects.inspectTemplates.create - * @desc Creates an InspectTemplate for re-using frequently used configuration - * for inspecting content, images, and storage. - * @alias dlp.projects.inspectTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2CreateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.dlpJobs.get + * @desc Gets the latest state of a long-running DlpJob. + * @alias dlp.projects.dlpJobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.projects.inspectTemplates.delete - * @desc Deletes an InspectTemplate. - * @alias dlp.projects.inspectTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.dlpJobs.list + * @desc Lists DlpJobs that match the specified filter in the request. + * @alias dlp.projects.dlpJobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of ` `. * Supported fields/values for inspect jobs: - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The resource name of the trigger that created job. * Supported fields for risk analysis jobs: - `state` - RUNNING|CANCELED|FINISHED|FAILED * The operator must be `=` or `!=`. Examples: * inspected_storage = cloud_storage AND state = done * inspected_storage = cloud_storage OR inspected_storage = bigquery * inspected_storage = cloud_storage AND (state = done OR state = canceled) The length of this field should be no more than 500 characters. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {string=} params.type The type of job. Defaults to `DlpJobType.INSPECT` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/dlpJobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.projects.inspectTemplates.get - * @desc Gets an InspectTemplate. - * @alias dlp.projects.inspectTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Image { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.inspectTemplates.list - * @desc Lists InspectTemplates. - * @alias dlp.projects.inspectTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>(parameters); + /** + * dlp.projects.image.redact + * @desc Redacts potentially sensitive info from an image. This method has + * limits on input size, processing time, and output size. [How-to + * guide](/dlp/docs/redacting-sensitive-data-images) + * @alias dlp.projects.image.redact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2RedactImageRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + redact(params?: any, options?: MethodOptions): + AxiosPromise; + redact( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + redact( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/image:redact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.projects.inspectTemplates.patch - * @desc Updates the InspectTemplate. - * @alias dlp.projects.inspectTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {().GooglePrivacyDlpV2UpdateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Inspecttemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Jobtriggers { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.inspectTemplates.create + * @desc Creates an InspectTemplate for re-using frequently used + * configuration for inspecting content, images, and storage. + * @alias dlp.projects.inspectTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2CreateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - /** - * dlp.projects.jobTriggers.create - * @desc Creates a job trigger to run DLP actions such as scanning storage for - * sensitive information on a set schedule. - * @alias dlp.projects.jobTriggers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2CreateJobTriggerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.inspectTemplates.delete + * @desc Deletes an InspectTemplate. + * @alias dlp.projects.inspectTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/jobTriggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.projects.jobTriggers.delete - * @desc Deletes a job trigger. - * @alias dlp.projects.jobTriggers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.inspectTemplates.get + * @desc Gets an InspectTemplate. + * @alias dlp.projects.inspectTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * dlp.projects.jobTriggers.get - * @desc Gets a job trigger. - * @alias dlp.projects.jobTriggers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.inspectTemplates.list + * @desc Lists InspectTemplates. + * @alias dlp.projects.inspectTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ListInspectTemplatesResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dlp.projects.inspectTemplates.patch + * @desc Updates the InspectTemplate. + * @alias dlp.projects.inspectTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {().GooglePrivacyDlpV2UpdateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } + export class Resource$Projects$Jobtriggers { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + } - /** - * dlp.projects.jobTriggers.list - * @desc Lists job triggers. - * @alias dlp.projects.jobTriggers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.orderBy Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. `"create_time asc,name desc,schedule_mode asc"`. This list is case-insensitive. Example: `"name asc,schedule_mode desc, status desc"` Supported filters keys and values are: - `create_time`: corresponds to time the triggeredJob was created. - `update_time`: corresponds to time the triggeredJob was last updated. - `name`: corresponds to JobTrigger's display name. - `status`: corresponds to the triggeredJob status. - * @param {integer=} params.pageSize Optional size of the page, can be limited by a server. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to ListJobTriggers. `order_by` and `filter` should not change for subsequent calls, but can be omitted if token is specified. - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListJobTriggersResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2ListJobTriggersResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dlp.projects.jobTriggers.create + * @desc Creates a job trigger to run DLP actions such as scanning storage + * for sensitive information on a set schedule. + * @alias dlp.projects.jobTriggers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2CreateJobTriggerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/jobTriggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/jobTriggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * dlp.projects.jobTriggers.delete + * @desc Deletes a job trigger. + * @alias dlp.projects.jobTriggers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dlp.projects.jobTriggers.patch - * @desc Updates a job trigger. - * @alias dlp.projects.jobTriggers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {().GooglePrivacyDlpV2UpdateJobTriggerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.jobTriggers.get + * @desc Gets a job trigger. + * @alias dlp.projects.jobTriggers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dlp.projects.jobTriggers.list + * @desc Lists job triggers. + * @alias dlp.projects.jobTriggers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.orderBy Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. `"create_time asc,name desc,schedule_mode asc"`. This list is case-insensitive. Example: `"name asc,schedule_mode desc, status desc"` Supported filters keys and values are: - `create_time`: corresponds to time the triggeredJob was created. - `update_time`: corresponds to time the triggeredJob was last updated. - `name`: corresponds to JobTrigger's display name. - `status`: corresponds to the triggeredJob status. + * @param {integer=} params.pageSize Optional size of the page, can be limited by a server. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to ListJobTriggers. `order_by` and `filter` should not change for subsequent calls, but can be omitted if token is specified. + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListJobTriggersResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2ListJobTriggersResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/jobTriggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2ListJobTriggersResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * dlp.projects.jobTriggers.patch + * @desc Updates a job trigger. + * @alias dlp.projects.jobTriggers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {().GooglePrivacyDlpV2UpdateJobTriggerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/dlp/v2beta1.ts b/src/apis/dlp/v2beta1.ts index 3753dd43351..b29d809320f 100644 --- a/src/apis/dlp/v2beta1.ts +++ b/src/apis/dlp/v2beta1.ts @@ -27,3054 +27,3093 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Data Loss Prevention (DLP) API - * - * Provides methods for detection, risk analysis, and de-identification of - * privacy-sensitive fragments in text, images, and Google Cloud Platform - * storage repositories. - * - * @example - * const google = require('googleapis'); - * const dlp = google.dlp('v2beta1'); - * - * @namespace dlp - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Dlp - */ -export class Dlp { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dlp_v2beta1 { + /** + * Cloud Data Loss Prevention (DLP) API + * + * Provides methods for detection, risk analysis, and de-identification of + * privacy-sensitive fragments in text, images, and Google Cloud Platform + * storage repositories. + * + * @example + * const google = require('googleapis'); + * const dlp = google.dlp('v2beta1'); + * + * @namespace dlp + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Dlp + */ + export class Dlp { + _options: GlobalOptions; + google: GoogleApis; + root = this; - content: Resource$Content; - dataSource: Resource$Datasource; - inspect: Resource$Inspect; - riskAnalysis: Resource$Riskanalysis; - rootCategories: Resource$Rootcategories; + content: Resource$Content; + dataSource: Resource$Datasource; + inspect: Resource$Inspect; + riskAnalysis: Resource$Riskanalysis; + rootCategories: Resource$Rootcategories; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.content = new Resource$Content(this); - this.dataSource = new Resource$Datasource(this); - this.inspect = new Resource$Inspect(this); - this.riskAnalysis = new Resource$Riskanalysis(this); - this.rootCategories = new Resource$Rootcategories(this); - } + this.content = new Resource$Content(this); + this.dataSource = new Resource$Datasource(this); + this.inspect = new Resource$Inspect(this); + this.riskAnalysis = new Resource$Riskanalysis(this); + this.rootCategories = new Resource$Rootcategories(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$GoogleLongrunningCancelOperationRequest {} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$GoogleLongrunningListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$GoogleLongrunningOperation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunningOperation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpcStatus; - /** - * This field will contain an InspectOperationMetadata object for - * `inspect.operations.create` or a RiskAnalysisOperationMetadata object for - * `dataSource.analyze`. This will always be returned with the Operation. - */ - metadata: any; - /** - * The server-assigned name. The `name` should have the format of - * `inspect/operations/<identifier>`. - */ - name: string; /** - * This field will contain an InspectOperationResult object for - * `inspect.operations.create` or a RiskAnalysisOperationResult object for - * `dataSource.analyze`. + * The request message for Operations.CancelOperation. */ - response: any; -} -/** - * Request for creating a risk analysis operation. - */ -export interface Schema$GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest { - /** - * Privacy metric to compute. - */ - privacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + export interface Schema$GoogleLongrunningCancelOperationRequest {} /** - * Input dataset to compute metrics over. + * The response message for Operations.ListOperations. */ - sourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * An auxiliary table contains statistical information on the relative frequency - * of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. If a tuple is present in the data - * but not in the auxiliary table, the corresponding relative frequency is - * assumed to be zero (and thus, the tuple is highly reidentifiable). - */ -export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { + export interface Schema$GoogleLongrunningListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$GoogleLongrunningOperation[]; + } /** - * Quasi-identifier columns. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunningOperation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpcStatus; + /** + * This field will contain an InspectOperationMetadata object for + * `inspect.operations.create` or a RiskAnalysisOperationMetadata object for + * `dataSource.analyze`. This will always be returned with the Operation. + */ + metadata: any; + /** + * The server-assigned name. The `name` should have the format of + * `inspect/operations/<identifier>`. + */ + name: string; + /** + * This field will contain an InspectOperationResult object for + * `inspect.operations.create` or a RiskAnalysisOperationResult object for + * `dataSource.analyze`. + */ + response: any; + } /** - * The relative frequency column must contain a floating-point number between - * 0 and 1 (inclusive). Null values are assumed to be zero. [required] - */ - relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + * Request for creating a risk analysis operation. + */ + export interface Schema$GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest { + /** + * Privacy metric to compute. + */ + privacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + sourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Auxiliary table location. [required] - */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * LINT.IfChange Row key for identifying a record in BigQuery table. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryKey { + * An auxiliary table contains statistical information on the relative + * frequency of different quasi-identifiers values. It has one or several + * quasi-identifiers columns, and one column that indicates the relative + * frequency of each quasi-identifier tuple. If a tuple is present in the data + * but not in the auxiliary table, the corresponding relative frequency is + * assumed to be zero (and thus, the tuple is highly reidentifiable). + */ + export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { + /** + * Quasi-identifier columns. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + /** + * The relative frequency column must contain a floating-point number + * between 0 and 1 (inclusive). Null values are assumed to be zero. + * [required] + */ + relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * Auxiliary table location. [required] + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Absolute number of the row from the beginning of the table at the time of - * scanning. - */ - rowNumber: string; + * LINT.IfChange Row key for identifying a record in BigQuery table. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryKey { + /** + * Absolute number of the row from the beginning of the table at the time of + * scanning. + */ + rowNumber: string; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Options defining BigQuery table and row identifiers. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + * Options defining BigQuery table and row identifiers. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. Nested + * fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * References to fields uniquely identifying rows within the table. Nested - * fields in the format, like `person.birthdate.year`, are allowed. - */ - identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + * Message defining the location of a BigQuery table. A table is uniquely + * identified by its project_id, dataset_id, and table_name. Within a query a + * table is often referenced with a string in the format of: + * `<project_id>:<dataset_id>.<table_id>` or + * `<project_id>.<dataset_id>.<table_id>`. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + /** + * Dataset ID of the table. + */ + datasetId: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId: string; + /** + * Name of the table. + */ + tableId: string; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query a - * table is often referenced with a string in the format of: - * `<project_id>:<dataset_id>.<table_id>` or - * `<project_id>.<dataset_id>.<table_id>`. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + * Buckets represented as ranges, along with replacement values. Ranges must + * be non-overlapping. + */ + export interface Schema$GooglePrivacyDlpV2beta1Bucket { + /** + * Upper bound of the range, exclusive; type must match min. + */ + max: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Lower bound of the range, inclusive. Type should be the same as max if + * used. + */ + min: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Replacement value for this bucket. If not provided the default behavior + * will be to hyphenate the min-max range. + */ + replacementValue: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * Dataset ID of the table. + * Generalization function that buckets values based on ranges. The ranges and + * replacement values are dynamically provided by the user for custom + * behavior, such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This + * can be used on data of type: number, long, string, timestamp. If the bound + * `Value` type differs from the type of data being transformed, we will first + * attempt converting the type of the data to be transformed to match the type + * of the bound before comparing. */ - datasetId: string; + export interface Schema$GooglePrivacyDlpV2beta1BucketingConfig { + buckets: Schema$GooglePrivacyDlpV2beta1Bucket[]; + } /** - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. + * Compute numerical stats over an individual column, including number of + * distinct values and value count distribution. */ - projectId: string; + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are supported + * except for arrays and structs. However, it may be more informative to use + * NumericalStats when the field type is supported, depending on the data. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Name of the table. - */ - tableId: string; -} -/** - * Buckets represented as ranges, along with replacement values. Ranges must be - * non-overlapping. - */ -export interface Schema$GooglePrivacyDlpV2beta1Bucket { + * Histogram bucket of value frequencies in the column. + */ + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of value frequencies in this bucket. The total number of values + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + /** + * Lower bound on the value frequency of the values in this bucket. + */ + valueFrequencyLowerBound: string; + /** + * Upper bound on the value frequency of the values in this bucket. + */ + valueFrequencyUpperBound: string; + } /** - * Upper bound of the range, exclusive; type must match min. + * Result of the categorical stats computation. */ - max: Schema$GooglePrivacyDlpV2beta1Value; + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + /** + * Histogram of value frequencies in the column. + */ + valueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; + } /** - * Lower bound of the range, inclusive. Type should be the same as max if - * used. - */ - min: Schema$GooglePrivacyDlpV2beta1Value; + * Info Type Category description. + */ + export interface Schema$GooglePrivacyDlpV2beta1CategoryDescription { + /** + * Human readable form of the category name. + */ + displayName: string; + /** + * Internal name of the category. + */ + name: string; + } /** - * Replacement value for this bucket. If not provided the default behavior - * will be to hyphenate the min-max range. - */ - replacementValue: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Generalization function that buckets values based on ranges. The ranges and - * replacement values are dynamically provided by the user for custom behavior, - * such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This can be used - * on data of type: number, long, string, timestamp. If the bound `Value` type - * differs from the type of data being transformed, we will first attempt - * converting the type of the data to be transformed to match the type of the - * bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2beta1BucketingConfig { - buckets: Schema$GooglePrivacyDlpV2beta1Bucket[]; -} -/** - * Compute numerical stats over an individual column, including number of - * distinct values and value count distribution. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + * Partially mask a string by replacing a given number of characters with a + * fixed character. Masking can start from the beginning or end of the string. + * This can be used on data of any type (numbers, longs, and so on) and when + * de-identifying structured data we'll attempt to preserve the original + * data's type. (This allows you to take a long like 123 and modify it to + * a string like **3. + */ + export interface Schema$GooglePrivacyDlpV2beta1CharacterMaskConfig { + /** + * When masking a string, items in this list will be skipped when replacing. + * For example, if your string is 555-555-5555 and you ask us to skip `-` + * and mask 5 chars with * we would produce ***-*55-5555. + */ + charactersToIgnore: Schema$GooglePrivacyDlpV2beta1CharsToIgnore[]; + /** + * Character to mask the sensitive values&mdash;for example, + * "*" for an alphabetic string such as name, or "0" for + * a numeric string such as ZIP code or credit card number. String must have + * length 1. If not supplied, we will default to "*" for strings, + * 0 for digits. + */ + maskingCharacter: string; + /** + * Number of characters to mask. If not set, all matching chars will be + * masked. Skipped characters do not count towards this tally. + */ + numberToMask: number; + /** + * Mask characters in reverse order. For example, if `masking_character` is + * '0', number_to_mask is 14, and `reverse_order` is false, then + * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is + * '*', `number_to_mask` is 3, and `reverse_order` is true, then + * 12345 -> 12*** + */ + reverseOrder: boolean; + } /** - * Field to compute categorical stats on. All column types are supported - * except for arrays and structs. However, it may be more informative to use - * NumericalStats when the field type is supported, depending on the data. + * Characters to skip when doing deidentification of a value. These will be + * left alone and skipped. */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Histogram bucket of value frequencies in the column. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + export interface Schema$GooglePrivacyDlpV2beta1CharsToIgnore { + charactersToSkip: string; + commonCharactersToIgnore: string; + } /** - * Total number of records in this bucket. - */ - bucketSize: string; + * Record key for a finding in a Cloud Storage file. + */ + export interface Schema$GooglePrivacyDlpV2beta1CloudStorageKey { + /** + * Path to the file. + */ + filePath: string; + /** + * Byte offset of the referenced data in the file. + */ + startOffset: string; + } /** - * Sample of value frequencies in this bucket. The total number of values - * returned per bucket is capped at 20. + * Options defining a file or a set of files (path ending with *) within a + * Google Cloud Storage bucket. */ - bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { + fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; + } /** - * Lower bound on the value frequency of the values in this bucket. + * A location in Cloud Storage. */ - valueFrequencyLowerBound: string; + export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + /** + * The url, in the format of `gs://bucket/<path>`. + */ + path: string; + } /** - * Upper bound on the value frequency of the values in this bucket. - */ - valueFrequencyUpperBound: string; -} -/** - * Result of the categorical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + * Represents a color in the RGB color space. + */ + export interface Schema$GooglePrivacyDlpV2beta1Color { + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * Histogram of value frequencies in the column. - */ - valueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; -} -/** - * Info Type Category description. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoryDescription { + * The field type of `value` and `field` do not need to match to be considered + * equal, but not all comparisons are possible. A `value` of type: - + * `string` can be compared against all other types - `boolean` can only be + * compared against other booleans - `integer` can be compared against doubles + * or a string if the string value can be parsed as an integer. - `double` can + * be compared against integers or a string if the string can be parsed as a + * double. - `Timestamp` can be compared against strings in RFC 3339 date + * string format. - `TimeOfDay` can be compared against timestamps and strings + * in the format of 'HH:mm:ss'. If we fail to compare do to type + * mismatch, a warning will be given and the condition will evaluate to false. + */ + export interface Schema$GooglePrivacyDlpV2beta1Condition { + /** + * Field within the record this condition is evaluated against. [required] + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * Operator used to compare the field or info type to the value. [required] + */ + operator: string; + /** + * Value to compare against. [Required, except for `EXISTS` tests.] + */ + value: Schema$GooglePrivacyDlpV2beta1Value; + } + export interface Schema$GooglePrivacyDlpV2beta1Conditions { + conditions: Schema$GooglePrivacyDlpV2beta1Condition[]; + } /** - * Human readable form of the category name. - */ - displayName: string; + * Container structure for the content to inspect. + */ + export interface Schema$GooglePrivacyDlpV2beta1ContentItem { + /** + * Content data to inspect or redact. + */ + data: string; + /** + * Structured content for inspection. + */ + table: Schema$GooglePrivacyDlpV2beta1Table; + /** + * Type of the content, as defined in Content-Type HTTP header. Supported + * types are: all "text" types, octet streams, PNG images, JPEG + * images. + */ + type: string; + /** + * String data to inspect or redact. + */ + value: string; + } /** - * Internal name of the category. + * Request for scheduling a scan of a data subset from a Google Platform data + * repository. */ - name: string; -} -/** - * Partially mask a string by replacing a given number of characters with a - * fixed character. Masking can start from the beginning or end of the string. - * This can be used on data of any type (numbers, longs, and so on) and when - * de-identifying structured data we'll attempt to preserve the original - * data's type. (This allows you to take a long like 123 and modify it to a - * string like **3. - */ -export interface Schema$GooglePrivacyDlpV2beta1CharacterMaskConfig { + export interface Schema$GooglePrivacyDlpV2beta1CreateInspectOperationRequest { + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * Additional configuration settings for long running operations. + */ + operationConfig: Schema$GooglePrivacyDlpV2beta1OperationConfig; + /** + * Optional location to store findings. + */ + outputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + /** + * Specification of the data set to process. + */ + storageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + } /** - * When masking a string, items in this list will be skipped when replacing. - * For example, if your string is 555-555-5555 and you ask us to skip `-` and - * mask 5 chars with * we would produce ***-*55-5555. + * Pseudonymization method that generates surrogates via cryptographic + * hashing. Uses SHA-256. Outputs a 32 byte digest as an uppercase hex string + * (for example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and + * integer values can be hashed. */ - charactersToIgnore: Schema$GooglePrivacyDlpV2beta1CharsToIgnore[]; + export interface Schema$GooglePrivacyDlpV2beta1CryptoHashConfig { + /** + * The key used by the hash function. + */ + cryptoKey: Schema$GooglePrivacyDlpV2beta1CryptoKey; + } /** - * Character to mask the sensitive values&mdash;for example, "*" - * for an alphabetic string such as name, or "0" for a numeric - * string such as ZIP code or credit card number. String must have length 1. - * If not supplied, we will default to "*" for strings, 0 for - * digits. + * This is a data encryption key (DEK) (as opposed to a key encryption key + * (KEK) stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an + * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker + * cannot unwrap the data crypto key. */ - maskingCharacter: string; + export interface Schema$GooglePrivacyDlpV2beta1CryptoKey { + kmsWrapped: Schema$GooglePrivacyDlpV2beta1KmsWrappedCryptoKey; + transient: Schema$GooglePrivacyDlpV2beta1TransientCryptoKey; + unwrapped: Schema$GooglePrivacyDlpV2beta1UnwrappedCryptoKey; + } /** - * Number of characters to mask. If not set, all matching chars will be - * masked. Skipped characters do not count towards this tally. - */ - numberToMask: number; + * Replaces an identifier with a surrogate using FPE with the FFX mode of + * operation. The identifier must be representable by the US-ASCII character + * set. For a given crypto key and context, the same identifier will be + * replaced with the same surrogate. Identifiers must be at least two + * characters long. In the case that the identifier is the empty string, it + * will be skipped. + */ + export interface Schema$GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { + commonAlphabet: string; + /** + * A context may be used for higher security since the same identifier in + * two different contexts likely will be given a distinct surrogate. The + * principle is that the likeliness is inversely related to the ratio of the + * number of distinct identifiers per context over the number of possible + * surrogates: As long as this ratio is small, the likehood is large. If + * the context is not set, a default tweak will be used. If the context is + * set but: 1. there is no record present when transforming a given value + * or 1. the field is not present when transforming a given value, a + * default tweak will be used. Note that case (1) is expected when an + * `InfoTypeTransformation` is applied to both structured and non-structured + * `ContentItem`s. Currently, the referenced field may be of value type + * integer or string. The tweak is constructed as a sequence of bytes in + * big endian byte order such that: - a 64 bit integer is encoded followed + * by a single byte of value 1 - a string is encoded in UTF-8 format + * followed by a single byte of value 2 This is also known as the + * 'tweak', as in tweakable encryption. + */ + context: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * The key used by the encryption algorithm. [required] + */ + cryptoKey: Schema$GooglePrivacyDlpV2beta1CryptoKey; + /** + * This is supported by mapping these to the alphanumeric characters that + * the FFX mode natively supports. This happens before/after + * encryption/decryption. Each character listed must appear only once. + * Number of characters must be in the range [2, 62]. This must be encoded + * as ASCII. The order of characters does not matter. + */ + customAlphabet: string; + /** + * The native way to select the alphabet. Must be in the range [2, 62]. + */ + radix: number; + /** + * The custom info type to annotate the surrogate with. This annotation will + * be applied to the surrogate by prefixing it with the name of the custom + * info type followed by the number of characters comprising the surrogate. + * The following scheme defines the format: + * info_type_name(surrogate_character_count):surrogate For example, if the + * name of custom info type is 'MY_TOKEN_INFO_TYPE' and the + * surrogate is 'abc', the full replacement value will be: + * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the + * surrogate when inspecting content using the custom info type + * [`SurrogateType`](/dlp/docs/reference/rest/v2beta1/InspectConfig#surrogatetype). + * This facilitates reversal of the surrogate when it occurs in free text. + * In order for inspection to work properly, the name of this info type must + * not occur naturally anywhere in your data; otherwise, inspection may find + * a surrogate that does not correspond to an actual identifier. Therefore, + * choose your custom info type name carefully after considering what your + * data looks like. One way to select a name that has a high chance of + * yielding reliable detection is to include one or more unicode characters + * that are highly improbable to exist in your data. For example, assuming + * your data is entered from a regular ASCII keyboard, the symbol with the + * hex code point 29DD might be used like so: ⧝MY_TOKEN_TYPE + */ + surrogateInfoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * Mask characters in reverse order. For example, if `masking_character` is - * '0', number_to_mask is 14, and `reverse_order` is false, then - * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is - * '*', `number_to_mask` is 3, and `reverse_order` is true, then 12345 - * -> 12*** - */ - reverseOrder: boolean; -} -/** - * Characters to skip when doing deidentification of a value. These will be left - * alone and skipped. - */ -export interface Schema$GooglePrivacyDlpV2beta1CharsToIgnore { - charactersToSkip: string; - commonCharactersToIgnore: string; -} -/** - * Record key for a finding in a Cloud Storage file. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStorageKey { + * Custom information type provided by the user. Used to find domain-specific + * sensitive information configurable to the data in question. + */ + export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + /** + * Dictionary-based custom info type. + */ + dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + /** + * Info type configuration. All custom info types must have configurations + * that do not conflict with built-in info types or other custom info types. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Surrogate info type. + */ + surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; + } /** - * Path to the file. + * Record key for a finding in Cloud Datastore. */ - filePath: string; + export interface Schema$GooglePrivacyDlpV2beta1DatastoreKey { + /** + * Datastore entity key. + */ + entityKey: Schema$GooglePrivacyDlpV2beta1Key; + } /** - * Byte offset of the referenced data in the file. - */ - startOffset: string; -} -/** - * Options defining a file or a set of files (path ending with *) within a - * Google Cloud Storage bucket. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { - fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; -} -/** - * A location in Cloud Storage. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + * Options defining a data set within Google Cloud Datastore. + */ + export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + /** + * The kind to process. + */ + kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + /** + * Properties to scan. If none are specified, all properties will be scanned + * by default. + */ + projection: Schema$GooglePrivacyDlpV2beta1Projection[]; + } /** - * The url, in the format of `gs://bucket/<path>`. - */ - path: string; -} -/** - * Represents a color in the RGB color space. - */ -export interface Schema$GooglePrivacyDlpV2beta1Color { + * High level summary of deidentification. + */ + export interface Schema$GooglePrivacyDlpV2beta1DeidentificationSummary { + /** + * Transformations applied to the dataset. + */ + transformationSummaries: + Schema$GooglePrivacyDlpV2beta1TransformationSummary[]; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; + * The configuration that controls how the data will change. + */ + export interface Schema$GooglePrivacyDlpV2beta1DeidentifyConfig { + /** + * Treat the dataset as free-form text and apply the same free text + * transformation everywhere. + */ + infoTypeTransformations: + Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** + * Treat the dataset as structured. Transformations can be applied to + * specific locations within structured datasets, such as transforming a + * column within a table. + */ + recordTransformations: Schema$GooglePrivacyDlpV2beta1RecordTransformations; + } /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; + * Request to de-identify a list of items. + */ + export interface Schema$GooglePrivacyDlpV2beta1DeidentifyContentRequest { + /** + * Configuration for the de-identification of the list of content items. + */ + deidentifyConfig: Schema$GooglePrivacyDlpV2beta1DeidentifyConfig; + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Up to 100 are allowed per request. All + * items will be treated as text/*. + */ + items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + } /** - * The amount of red in the color as a value in the interval [0, 1]. + * Results of de-identifying a list of items. */ - red: number; -} -/** - * The field type of `value` and `field` do not need to match to be considered - * equal, but not all comparisons are possible. A `value` of type: - `string` - * can be compared against all other types - `boolean` can only be compared - * against other booleans - `integer` can be compared against doubles or a - * string if the string value can be parsed as an integer. - `double` can be - * compared against integers or a string if the string can be parsed as a - * double. - `Timestamp` can be compared against strings in RFC 3339 date string - * format. - `TimeOfDay` can be compared against timestamps and strings in the - * format of 'HH:mm:ss'. If we fail to compare do to type mismatch, a - * warning will be given and the condition will evaluate to false. - */ -export interface Schema$GooglePrivacyDlpV2beta1Condition { + export interface Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse { + items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + /** + * A review of the transformations that took place for each item. + */ + summaries: Schema$GooglePrivacyDlpV2beta1DeidentificationSummary[]; + } /** - * Field within the record this condition is evaluated against. [required] - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; + * Custom information type based on a dictionary of words or phrases. This can + * be used to match sensitive information specific to the data, such as a list + * of employee IDs or job titles. Dictionary words are case-insensitive and + * all characters other than letters and digits in the unicode [Basic + * Multilingual + * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + * will be replaced with whitespace when scanning for matches, so the + * dictionary phrase "Sam Johnson" will match all three phrases + * "sam johnson", "Sam, Johnson", and "Sam + * (Johnson)". Additionally, the characters surrounding any match must be + * of a different type than the adjacent characters within the word, so + * letters must be next to non-letters and digits next to non-digits. For + * example, the dictionary word "jen" will match the first three + * letters of the text "jen123" but will return no matches for + * "jennifer". Dictionary words containing a large number of + * characters that are not letters or digits may result in unexpected findings + * because such characters are treated as whitespace. + */ + export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + /** + * List of words or phrases to search for. + */ + wordList: Schema$GooglePrivacyDlpV2beta1WordList; + } /** - * Operator used to compare the field or info type to the value. [required] - */ - operator: string; + * An entity in a dataset is a field or set of fields that correspond to a + * single person. For example, in medical records the `EntityId` might be a + * patient identifier, or for financial records it might be an account + * identifier. This message is used when generalizations or analysis must be + * consistent across multiple rows pertaining to the same entity. + */ + export interface Schema$GooglePrivacyDlpV2beta1EntityId { + /** + * Composite key indicating which field contains the entity identifier. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Value to compare against. [Required, except for `EXISTS` tests.] + * A collection of expressions */ - value: Schema$GooglePrivacyDlpV2beta1Value; -} -export interface Schema$GooglePrivacyDlpV2beta1Conditions { - conditions: Schema$GooglePrivacyDlpV2beta1Condition[]; -} -/** - * Container structure for the content to inspect. - */ -export interface Schema$GooglePrivacyDlpV2beta1ContentItem { + export interface Schema$GooglePrivacyDlpV2beta1Expressions { + conditions: Schema$GooglePrivacyDlpV2beta1Conditions; + /** + * The operator to apply to the result of conditions. Default and currently + * only supported value is `AND`. + */ + logicalOperator: string; + } /** - * Content data to inspect or redact. + * General identifier of a data field in a storage service. */ - data: string; + export interface Schema$GooglePrivacyDlpV2beta1FieldId { + /** + * Name describing the field. + */ + columnName: string; + } /** - * Structured content for inspection. - */ - table: Schema$GooglePrivacyDlpV2beta1Table; + * The transformation to apply to the field. + */ + export interface Schema$GooglePrivacyDlpV2beta1FieldTransformation { + /** + * Only apply the transformation if the condition evaluates to true for the + * given `RecordCondition`. The conditions are allowed to reference fields + * that are not used in the actual transformation. [optional] Example Use + * Cases: - Apply a different bucket transformation to an age column if the + * zip code column for the same record is within a specific range. - Redact + * a field if the date of birth field is greater than 85. + */ + condition: Schema$GooglePrivacyDlpV2beta1RecordCondition; + /** + * Input field(s) to apply the transformation to. [required] + */ + fields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Treat the contents of the field as free text, and selectively transform + * content that matches an `InfoType`. + */ + infoTypeTransformations: + Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations; + /** + * Apply the transformation to the entire field. + */ + primitiveTransformation: + Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; + } /** - * Type of the content, as defined in Content-Type HTTP header. Supported - * types are: all "text" types, octet streams, PNG images, JPEG - * images. + * Set of files to scan. */ - type: string; + export interface Schema$GooglePrivacyDlpV2beta1FileSet { + /** + * The url, in the format `gs://<bucket>/<path>`. Trailing + * wildcard in the path is allowed. + */ + url: string; + } /** - * String data to inspect or redact. - */ - value: string; -} -/** - * Request for scheduling a scan of a data subset from a Google Platform data - * repository. - */ -export interface Schema$GooglePrivacyDlpV2beta1CreateInspectOperationRequest { + * Represents a piece of potentially sensitive content. + */ + export interface Schema$GooglePrivacyDlpV2beta1Finding { + /** + * Timestamp when finding was detected. + */ + createTime: string; + /** + * The type of content that might have been found. Provided if requested by + * the `InspectConfig`. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Estimate of how likely it is that the `info_type` is correct. + */ + likelihood: string; + /** + * Where the content was found. + */ + location: Schema$GooglePrivacyDlpV2beta1Location; + /** + * The content that was found. Even if the content is not textual, it may be + * converted to a textual representation here. Provided if requested by the + * `InspectConfig` and the finding is less than or equal to 4096 bytes long. + * If the finding exceeds 4096 bytes in length, the quote may be omitted. + */ + quote: string; + } /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + * Buckets values based on fixed size ranges. The Bucketing transformation can + * provide all of this functionality, but requires more configuration. This + * message is provided as a convenience to the user for simple bucketing + * strategies. The resulting value will be a hyphenated string of + * lower_bound-upper_bound. This can be used on data of type: double, long. If + * the bound Value type differs from the type of data being transformed, we + * will first attempt converting the type of the data to be transformed to + * match the type of the bound before comparing. + */ + export interface Schema$GooglePrivacyDlpV2beta1FixedSizeBucketingConfig { + /** + * Size of each bucket (except for minimum and maximum buckets). So if + * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + */ + bucketSize: number; + /** + * Lower bound value of buckets. All values less than `lower_bound` are + * grouped together into a single bucket; for example if `lower_bound` = 10, + * then all values less than 10 are replaced with the value “-10”. + * [Required]. + */ + lowerBound: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Upper bound value of buckets. All values greater than upper_bound are + * grouped together into a single bucket; for example if `upper_bound` = 89, + * then all values greater than 89 are replaced with the value “89+”. + * [Required]. + */ + upperBound: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * Additional configuration settings for long running operations. - */ - operationConfig: Schema$GooglePrivacyDlpV2beta1OperationConfig; + * Bounding box encompassing detected text within an image. + */ + export interface Schema$GooglePrivacyDlpV2beta1ImageLocation { + /** + * Height of the bounding box in pixels. + */ + height: number; + /** + * Left coordinate of the bounding box. (0,0) is upper left. + */ + left: number; + /** + * Top coordinate of the bounding box. (0,0) is upper left. + */ + top: number; + /** + * Width of the bounding box in pixels. + */ + width: number; + } /** - * Optional location to store findings. - */ - outputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + * Configuration for determining how redaction of images should occur. + */ + export interface Schema$GooglePrivacyDlpV2beta1ImageRedactionConfig { + /** + * Only one per info_type should be provided per request. If not specified, + * and redact_all_text is false, the DLP API will redact all text that it + * matches against all info_types that are found, but not specified in + * another ImageRedactionConfig. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * If true, all text found in the image, regardless whether it matches an + * info_type, is redacted. + */ + redactAllText: boolean; + /** + * The color to use when redacting content from an image. If not specified, + * the default is black. + */ + redactionColor: Schema$GooglePrivacyDlpV2beta1Color; + } /** - * Specification of the data set to process. + * Type of information detected by the API. */ - storageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; -} -/** - * Pseudonymization method that generates surrogates via cryptographic hashing. - * Uses SHA-256. Outputs a 32 byte digest as an uppercase hex string (for - * example, 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and - * integer values can be hashed. - */ -export interface Schema$GooglePrivacyDlpV2beta1CryptoHashConfig { + export interface Schema$GooglePrivacyDlpV2beta1InfoType { + /** + * Name of the information type. + */ + name: string; + } /** - * The key used by the hash function. - */ - cryptoKey: Schema$GooglePrivacyDlpV2beta1CryptoKey; -} -/** - * This is a data encryption key (DEK) (as opposed to a key encryption key (KEK) - * stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an - * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker - * cannot unwrap the data crypto key. - */ -export interface Schema$GooglePrivacyDlpV2beta1CryptoKey { - kmsWrapped: Schema$GooglePrivacyDlpV2beta1KmsWrappedCryptoKey; - transient: Schema$GooglePrivacyDlpV2beta1TransientCryptoKey; - unwrapped: Schema$GooglePrivacyDlpV2beta1UnwrappedCryptoKey; -} -/** - * Replaces an identifier with a surrogate using FPE with the FFX mode of - * operation. The identifier must be representable by the US-ASCII character - * set. For a given crypto key and context, the same identifier will be replaced - * with the same surrogate. Identifiers must be at least two characters long. In - * the case that the identifier is the empty string, it will be skipped. - */ -export interface Schema$GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig { - commonAlphabet: string; - /** - * A context may be used for higher security since the same identifier in two - * different contexts likely will be given a distinct surrogate. The principle - * is that the likeliness is inversely related to the ratio of the number of - * distinct identifiers per context over the number of possible surrogates: As - * long as this ratio is small, the likehood is large. If the context is not - * set, a default tweak will be used. If the context is set but: 1. there is - * no record present when transforming a given value or 1. the field is not - * present when transforming a given value, a default tweak will be used. - * Note that case (1) is expected when an `InfoTypeTransformation` is applied - * to both structured and non-structured `ContentItem`s. Currently, the - * referenced field may be of value type integer or string. The tweak is - * constructed as a sequence of bytes in big endian byte order such that: - a - * 64 bit integer is encoded followed by a single byte of value 1 - a string - * is encoded in UTF-8 format followed by a single byte of value 2 This is - * also known as the 'tweak', as in tweakable encryption. - */ - context: Schema$GooglePrivacyDlpV2beta1FieldId; - /** - * The key used by the encryption algorithm. [required] - */ - cryptoKey: Schema$GooglePrivacyDlpV2beta1CryptoKey; - /** - * This is supported by mapping these to the alphanumeric characters that the - * FFX mode natively supports. This happens before/after - * encryption/decryption. Each character listed must appear only once. Number - * of characters must be in the range [2, 62]. This must be encoded as ASCII. - * The order of characters does not matter. - */ - customAlphabet: string; - /** - * The native way to select the alphabet. Must be in the range [2, 62]. - */ - radix: number; - /** - * The custom info type to annotate the surrogate with. This annotation will - * be applied to the surrogate by prefixing it with the name of the custom - * info type followed by the number of characters comprising the surrogate. - * The following scheme defines the format: - * info_type_name(surrogate_character_count):surrogate For example, if the - * name of custom info type is 'MY_TOKEN_INFO_TYPE' and the surrogate - * is 'abc', the full replacement value will be: - * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the - * surrogate when inspecting content using the custom info type - * [`SurrogateType`](/dlp/docs/reference/rest/v2beta1/InspectConfig#surrogatetype). - * This facilitates reversal of the surrogate when it occurs in free text. In - * order for inspection to work properly, the name of this info type must not - * occur naturally anywhere in your data; otherwise, inspection may find a - * surrogate that does not correspond to an actual identifier. Therefore, - * choose your custom info type name carefully after considering what your - * data looks like. One way to select a name that has a high chance of - * yielding reliable detection is to include one or more unicode characters - * that are highly improbable to exist in your data. For example, assuming - * your data is entered from a regular ASCII keyboard, the symbol with the hex - * code point 29DD might be used like so: ⧝MY_TOKEN_TYPE - */ - surrogateInfoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - */ -export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + * Description of the information type (infoType). + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeDescription { + /** + * List of categories this infoType belongs to. + */ + categories: Schema$GooglePrivacyDlpV2beta1CategoryDescription[]; + /** + * Human readable form of the infoType name. + */ + displayName: string; + /** + * Internal name of the infoType. + */ + name: string; + } /** - * Dictionary-based custom info type. - */ - dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + * Max findings configuration per info type, per content item or long running + * operation. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Max findings limit for the given infoType. + */ + maxFindings: number; + } /** - * Info type configuration. All custom info types must have configurations - * that do not conflict with built-in info types or other custom info types. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + * Statistics regarding a specific InfoType. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { + /** + * Number of findings for this info type. + */ + count: string; + /** + * The type of finding this stat is for. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * Surrogate info type. - */ - surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; -} -/** - * Record key for a finding in Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta1DatastoreKey { + * A transformation to apply to text that is identified as a specific + * info_type. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeTransformation { + /** + * Info types to apply the transformation to. Empty list will match all + * available info types for this transformation. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + /** + * Primitive transformation to apply to the info type. [required] + */ + primitiveTransformation: + Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; + } /** - * Datastore entity key. + * A type of transformation that will scan unstructured text and apply various + * `PrimitiveTransformation`s to each finding, where the transformation is + * applied to only values that were identified as a specific info_type. */ - entityKey: Schema$GooglePrivacyDlpV2beta1Key; -} -/** - * Options defining a data set within Google Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations { + /** + * Transformation for each info type. Cannot specify more than one for a + * given info type. [required] + */ + transformations: Schema$GooglePrivacyDlpV2beta1InfoTypeTransformation[]; + } /** - * The kind to process. - */ - kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + * Configuration description of the scanning process. When used with + * redactContent only info_types and min_likelihood are currently used. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { + /** + * Custom info types provided by the user. + */ + customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; + /** + * When true, excludes type information of the findings. + */ + excludeTypes: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote: boolean; + /** + * Configuration of findings limit given for specified info types. + */ + infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + /** + * Limits the number of findings per content item or long running operation. + */ + maxFindings: number; + /** + * Only returns findings equal or above this threshold. + */ + minLikelihood: string; + } /** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. - */ - partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + * Request to search for potentially sensitive info in a list of items. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectContentRequest { + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Items in a single request are considered + * "related" unless inspect_config.independent_inputs is true. Up + * to 100 are allowed per request. + */ + items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + } /** - * Properties to scan. If none are specified, all properties will be scanned - * by default. + * Results of inspecting a list of items. */ - projection: Schema$GooglePrivacyDlpV2beta1Projection[]; -} -/** - * High level summary of deidentification. - */ -export interface Schema$GooglePrivacyDlpV2beta1DeidentificationSummary { + export interface Schema$GooglePrivacyDlpV2beta1InspectContentResponse { + /** + * Each content_item from the request has a result in this list, in the same + * order as the request. + */ + results: Schema$GooglePrivacyDlpV2beta1InspectResult[]; + } /** - * Transformations applied to the dataset. - */ - transformationSummaries: - Schema$GooglePrivacyDlpV2beta1TransformationSummary[]; + * Metadata returned within GetOperation for an inspect request. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + /** + * Total size in bytes that were processed. + */ + processedBytes: string; + /** + * The inspect config used to create the Operation. + */ + requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * Optional location to store findings. + */ + requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + /** + * The storage config used to create the Operation. + */ + requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + /** + * Estimate of the number of bytes to process. + */ + totalEstimatedBytes: string; + } /** - * Total size in bytes that were transformed in some way. + * The operational data. */ - transformedBytes: string; -} -/** - * The configuration that controls how the data will change. - */ -export interface Schema$GooglePrivacyDlpV2beta1DeidentifyConfig { + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `inspect/results/{id}`. + */ + name: string; + } /** - * Treat the dataset as free-form text and apply the same free text - * transformation everywhere. - */ - infoTypeTransformations: - Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations; + * All the findings for a single scanned item. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectResult { + /** + * List of findings for an item. + */ + findings: Schema$GooglePrivacyDlpV2beta1Finding[]; + /** + * If true, then this item might have more findings than were returned, and + * the findings returned are an arbitrary subset of all findings. The + * findings list might be truncated because the input items were too large, + * or because the server reached the maximum amount of resources allowed for + * a single API call. For best results, divide the input into smaller + * batches. + */ + findingsTruncated: boolean; + } /** - * Treat the dataset as structured. Transformations can be applied to specific - * locations within structured datasets, such as transforming a column within - * a table. - */ - recordTransformations: Schema$GooglePrivacyDlpV2beta1RecordTransformations; -} -/** - * Request to de-identify a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta1DeidentifyContentRequest { + * k-anonymity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { + /** + * Optional message indicating that each distinct entity_id should not + * contribute to the k-anonymity count more than once per equivalence class. + * If an entity_id appears on several rows with different quasi-identifier + * tuples, it will contribute to each count exactly once. This can lead to + * unexpected results. Consider a table where ID 1 is associated to + * quasi-identifier "foo", ID 2 to "bar", and ID 3 to + * *both* quasi-identifiers "foo" and "bar" (on separate + * rows), and where this ID is used as entity_id. Then, the anonymity value + * associated to ID 3 will be 2, even if it is the only ID to be associated + * to both values "foo" and "bar". + */ + entityId: Schema$GooglePrivacyDlpV2beta1EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within a + * repeated field. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + } /** - * Configuration for the de-identification of the list of content items. - */ - deidentifyConfig: Schema$GooglePrivacyDlpV2beta1DeidentifyConfig; + * The set of columns' values that share the same k-anonymity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the above + * set of values. + */ + equivalenceClassSize: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + * Histogram bucket of equivalence class sizes in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + /** + * Lower bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeLowerBound: string; + /** + * Upper bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeUpperBound: string; + } /** - * The list of items to inspect. Up to 100 are allowed per request. All items - * will be treated as text/*. + * Result of the k-anonymity computation. */ - items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; -} -/** - * Results of de-identifying a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse { - items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { + /** + * Histogram of k-anonymity equivalence classes. + */ + equivalenceClassHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; + } /** - * A review of the transformations that took place for each item. - */ - summaries: Schema$GooglePrivacyDlpV2beta1DeidentificationSummary[]; -} -/** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. Dictionary words are case-insensitive and all - * characters other than letters and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the dictionary - * phrase "Sam Johnson" will match all three phrases "sam - * johnson", "Sam, Johnson", and "Sam (Johnson)". - * Additionally, the characters surrounding any match must be of a different - * type than the adjacent characters within the word, so letters must be next to - * non-letters and digits next to non-digits. For example, the dictionary word - * "jen" will match the first three letters of the text - * "jen123" but will return no matches for "jennifer". - * Dictionary words containing a large number of characters that are not letters - * or digits may result in unexpected findings because such characters are - * treated as whitespace. - */ -export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + * A unique identifier for a Datastore entity. If a key's partition ID or + * any of its path kinds or names are reserved/read-only, the key is + * reserved/read-only. A reserved/read-only key is forbidden in certain + * documented contexts. + */ + export interface Schema$GooglePrivacyDlpV2beta1Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. Queries are scoped to a single partition. + */ + partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + /** + * The entity path. An entity path consists of one or more elements composed + * of a kind and a string or numerical identifier, which identify entities. + * The first element identifies a _root entity_, the second element + * identifies a _child_ of the root entity, the third element identifies a + * child of the second entity, and so forth. The entities identified by all + * prefixes of the path are called the element's _ancestors_. A path + * can never be empty, and a path can have at most 100 elements. + */ + path: Schema$GooglePrivacyDlpV2beta1PathElement[]; + } /** - * List of words or phrases to search for. + * A representation of a Datastore kind. */ - wordList: Schema$GooglePrivacyDlpV2beta1WordList; -} -/** - * An entity in a dataset is a field or set of fields that correspond to a - * single person. For example, in medical records the `EntityId` might be a - * patient identifier, or for financial records it might be an account - * identifier. This message is used when generalizations or analysis must be - * consistent across multiple rows pertaining to the same entity. - */ -export interface Schema$GooglePrivacyDlpV2beta1EntityId { + export interface Schema$GooglePrivacyDlpV2beta1KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * Composite key indicating which field contains the entity identifier. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * A collection of expressions - */ -export interface Schema$GooglePrivacyDlpV2beta1Expressions { - conditions: Schema$GooglePrivacyDlpV2beta1Conditions; + * Reidentifiability metric. This corresponds to a risk model similar to what + * is called "journalist risk" in the literature, except the attack + * dataset is statistically modeled instead of being perfectly known. This can + * be done using publicly available data (like the US Census), or using a + * custom statistical model (indicated as one or several BigQuery tables), or + * by extrapolating from the distribution of values in the input dataset. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { + /** + * Several auxiliary tables can be used in the analysis. Each custom_tag + * used to tag a quasi-identifiers column must appear in exactly one column + * of one auxiliary table. + */ + auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; + /** + * Fields considered to be quasi-identifiers. No two columns can have the + * same tag. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; + /** + * ISO 3166-1 alpha-2 region code to use in the statistical modeling. + * Required if no column is tagged with a region-specific InfoType (like + * US_ZIP_5) or a region code. + */ + regionCode: string; + } /** - * The operator to apply to the result of conditions. Default and currently - * only supported value is `AND`. - */ - logicalOperator: string; -} -/** - * General identifier of a data field in a storage service. - */ -export interface Schema$GooglePrivacyDlpV2beta1FieldId { + * A KMapEstimationHistogramBucket message with the following values: + * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 + * records whose quasi-identifier values correspond to 3, 4 or 5 people in the + * overlying population. An important particular case is when min_anonymity = + * max_anonymity = 1: the frequency field then corresponds to the number of + * uniquely identifiable records. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { + /** + * Number of records within these anonymity bounds. + */ + bucketSize: string; + /** + * Sample of quasi-identifier tuple values in this bucket. The total number + * of classes returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; + /** + * Always greater than or equal to min_anonymity. + */ + maxAnonymity: string; + /** + * Always positive. + */ + minAnonymity: string; + } /** - * Name describing the field. - */ - columnName: string; -} -/** - * The transformation to apply to the field. - */ -export interface Schema$GooglePrivacyDlpV2beta1FieldTransformation { + * A tuple of values for the quasi-identifier columns. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { + /** + * The estimated anonymity for these quasi-identifier values. + */ + estimatedAnonymity: string; + /** + * The quasi-identifier values. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Only apply the transformation if the condition evaluates to true for the - * given `RecordCondition`. The conditions are allowed to reference fields - * that are not used in the actual transformation. [optional] Example Use - * Cases: - Apply a different bucket transformation to an age column if the - * zip code column for the same record is within a specific range. - Redact a - * field if the date of birth field is greater than 85. - */ - condition: Schema$GooglePrivacyDlpV2beta1RecordCondition; + * Result of the reidentifiability analysis. Note that these results are an + * estimation, not exact values. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { + /** + * The intervals [min_anonymity, max_anonymity] do not overlap. If a value + * doesn't correspond to any such interval, the associated frequency is + * zero. For example, the following records: {min_anonymity: 1, + * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, + * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} + * mean that there are no record with an estimated anonymity of 4, 5, or + * larger than 10. + */ + kMapEstimationHistogram: + Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; + } /** - * Input field(s) to apply the transformation to. [required] - */ - fields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + * Include to use an existing data crypto key wrapped by KMS. Authorization + * requires the following IAM permissions when sending a request to perform a + * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt + */ + export interface Schema$GooglePrivacyDlpV2beta1KmsWrappedCryptoKey { + /** + * The resource name of the KMS CryptoKey to use for unwrapping. [required] + */ + cryptoKeyName: string; + /** + * The wrapped data crypto key. [required] + */ + wrappedKey: string; + } /** - * Treat the contents of the field as free text, and selectively transform - * content that matches an `InfoType`. - */ - infoTypeTransformations: - Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations; + * l-diversity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are defined + * for the l-diversity computation. When multiple fields are specified, they + * are considered a single composite key. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Sensitive field for computing the l-value. + */ + sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Apply the transformation to the entire field. - */ - primitiveTransformation: - Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; -} -/** - * Set of files to scan. - */ -export interface Schema$GooglePrivacyDlpV2beta1FileSet { - /** - * The url, in the format `gs://<bucket>/<path>`. Trailing - * wildcard in the path is allowed. - */ - url: string; -} -/** - * Represents a piece of potentially sensitive content. - */ -export interface Schema$GooglePrivacyDlpV2beta1Finding { - /** - * Timestamp when finding was detected. - */ - createTime: string; - /** - * The type of content that might have been found. Provided if requested by - * the `InspectConfig`. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; - /** - * Estimate of how likely it is that the `info_type` is correct. - */ - likelihood: string; - /** - * Where the content was found. - */ - location: Schema$GooglePrivacyDlpV2beta1Location; - /** - * The content that was found. Even if the content is not textual, it may be - * converted to a textual representation here. Provided if requested by the - * `InspectConfig` and the finding is less than or equal to 4096 bytes long. - * If the finding exceeds 4096 bytes in length, the quote may be omitted. - */ - quote: string; -} -/** - * Buckets values based on fixed size ranges. The Bucketing transformation can - * provide all of this functionality, but requires more configuration. This - * message is provided as a convenience to the user for simple bucketing - * strategies. The resulting value will be a hyphenated string of - * lower_bound-upper_bound. This can be used on data of type: double, long. If - * the bound Value type differs from the type of data being transformed, we will - * first attempt converting the type of the data to be transformed to match the - * type of the bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2beta1FixedSizeBucketingConfig { - /** - * Size of each bucket (except for minimum and maximum buckets). So if - * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the - * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. - */ - bucketSize: number; - /** - * Lower bound value of buckets. All values less than `lower_bound` are - * grouped together into a single bucket; for example if `lower_bound` = 10, - * then all values less than 10 are replaced with the value “-10”. [Required]. - */ - lowerBound: Schema$GooglePrivacyDlpV2beta1Value; - /** - * Upper bound value of buckets. All values greater than upper_bound are - * grouped together into a single bucket; for example if `upper_bound` = 89, - * then all values greater than 89 are replaced with the value “89+”. - * [Required]. - */ - upperBound: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Bounding box encompassing detected text within an image. - */ -export interface Schema$GooglePrivacyDlpV2beta1ImageLocation { - /** - * Height of the bounding box in pixels. - */ - height: number; - /** - * Left coordinate of the bounding box. (0,0) is upper left. - */ - left: number; - /** - * Top coordinate of the bounding box. (0,0) is upper left. - */ - top: number; - /** - * Width of the bounding box in pixels. - */ - width: number; -} -/** - * Configuration for determining how redaction of images should occur. - */ -export interface Schema$GooglePrivacyDlpV2beta1ImageRedactionConfig { - /** - * Only one per info_type should be provided per request. If not specified, - * and redact_all_text is false, the DLP API will redact all text that it - * matches against all info_types that are found, but not specified in another - * ImageRedactionConfig. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; - /** - * If true, all text found in the image, regardless whether it matches an - * info_type, is redacted. - */ - redactAllText: boolean; - /** - * The color to use when redacting content from an image. If not specified, - * the default is black. - */ - redactionColor: Schema$GooglePrivacyDlpV2beta1Color; -} -/** - * Type of information detected by the API. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoType { - /** - * Name of the information type. - */ - name: string; -} -/** - * Description of the information type (infoType). - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeDescription { - /** - * List of categories this infoType belongs to. - */ - categories: Schema$GooglePrivacyDlpV2beta1CategoryDescription[]; - /** - * Human readable form of the infoType name. - */ - displayName: string; - /** - * Internal name of the infoType. - */ - name: string; -} -/** - * Max findings configuration per info type, per content item or long running - * operation. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { - /** - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an info_type, - * the DLP API applies the limit against all info_types that are found but not - * specified in another InfoTypeLimit. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; - /** - * Max findings limit for the given infoType. - */ - maxFindings: number; -} -/** - * Statistics regarding a specific InfoType. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { - /** - * Number of findings for this info type. - */ - count: string; - /** - * The type of finding this stat is for. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * A transformation to apply to text that is identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeTransformation { - /** - * Info types to apply the transformation to. Empty list will match all - * available info types for this transformation. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; - /** - * Primitive transformation to apply to the info type. [required] - */ - primitiveTransformation: - Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; -} -/** - * A type of transformation that will scan unstructured text and apply various - * `PrimitiveTransformation`s to each finding, where the transformation is - * applied to only values that were identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeTransformations { - /** - * Transformation for each info type. Cannot specify more than one for a given - * info type. [required] - */ - transformations: Schema$GooglePrivacyDlpV2beta1InfoTypeTransformation[]; -} -/** - * Configuration description of the scanning process. When used with - * redactContent only info_types and min_likelihood are currently used. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { - /** - * Custom info types provided by the user. - */ - customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; - /** - * When true, excludes type information of the findings. - */ - excludeTypes: boolean; - /** - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. - */ - includeQuote: boolean; - /** - * Configuration of findings limit given for specified info types. - */ - infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; - /** - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or found in documentation. Empty - * info_types runs all enabled detectors. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; - /** - * Limits the number of findings per content item or long running operation. - */ - maxFindings: number; - /** - * Only returns findings equal or above this threshold. - */ - minLikelihood: string; -} -/** - * Request to search for potentially sensitive info in a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectContentRequest { - /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; - /** - * The list of items to inspect. Items in a single request are considered - * "related" unless inspect_config.independent_inputs is true. Up to - * 100 are allowed per request. - */ - items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; -} -/** - * Results of inspecting a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectContentResponse { - /** - * Each content_item from the request has a result in this list, in the same - * order as the request. - */ - results: Schema$GooglePrivacyDlpV2beta1InspectResult[]; -} -/** - * Metadata returned within GetOperation for an inspect request. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { - /** - * The time which this request was started. - */ - createTime: string; - infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; - /** - * Total size in bytes that were processed. - */ - processedBytes: string; - /** - * The inspect config used to create the Operation. - */ - requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; - /** - * Optional location to store findings. - */ - requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; - /** - * The storage config used to create the Operation. - */ - requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; - /** - * Estimate of the number of bytes to process. - */ - totalEstimatedBytes: string; -} -/** - * The operational data. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `inspect/results/{id}`. - */ - name: string; -} -/** - * All the findings for a single scanned item. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectResult { - /** - * List of findings for an item. - */ - findings: Schema$GooglePrivacyDlpV2beta1Finding[]; - /** - * If true, then this item might have more findings than were returned, and - * the findings returned are an arbitrary subset of all findings. The findings - * list might be truncated because the input items were too large, or because - * the server reached the maximum amount of resources allowed for a single API - * call. For best results, divide the input into smaller batches. - */ - findingsTruncated: boolean; -} -/** - * k-anonymity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { - /** - * Optional message indicating that each distinct entity_id should not - * contribute to the k-anonymity count more than once per equivalence class. - * If an entity_id appears on several rows with different quasi-identifier - * tuples, it will contribute to each count exactly once. This can lead to - * unexpected results. Consider a table where ID 1 is associated to - * quasi-identifier "foo", ID 2 to "bar", and ID 3 to - * *both* quasi-identifiers "foo" and "bar" (on separate - * rows), and where this ID is used as entity_id. Then, the anonymity value - * associated to ID 3 will be 2, even if it is the only ID to be associated to - * both values "foo" and "bar". - */ - entityId: Schema$GooglePrivacyDlpV2beta1EntityId; - /** - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and repeated - * data types are not supported; however, nested fields are supported so long - * as they are not structs themselves or nested within a repeated field. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; -} -/** - * The set of columns' values that share the same k-anonymity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { - /** - * Size of the equivalence class, for example number of rows with the above - * set of values. - */ - equivalenceClassSize: string; - /** - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Histogram bucket of equivalence class sizes in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { - /** - * Total number of records in this bucket. - */ - bucketSize: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; - /** - * Lower bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeLowerBound: string; - /** - * Upper bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeUpperBound: string; -} -/** - * Result of the k-anonymity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { - /** - * Histogram of k-anonymity equivalence classes. - */ - equivalenceClassHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; -} -/** - * A unique identifier for a Datastore entity. If a key's partition ID or - * any of its path kinds or names are reserved/read-only, the key is - * reserved/read-only. A reserved/read-only key is forbidden in certain - * documented contexts. - */ -export interface Schema$GooglePrivacyDlpV2beta1Key { - /** - * Entities are partitioned into subsets, currently identified by a project ID - * and namespace ID. Queries are scoped to a single partition. - */ - partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; - /** - * The entity path. An entity path consists of one or more elements composed - * of a kind and a string or numerical identifier, which identify entities. - * The first element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of the - * path are called the element's _ancestors_. A path can never be empty, - * and a path can have at most 100 elements. - */ - path: Schema$GooglePrivacyDlpV2beta1PathElement[]; -} -/** - * A representation of a Datastore kind. - */ -export interface Schema$GooglePrivacyDlpV2beta1KindExpression { - /** - * The name of the kind. - */ - name: string; -} -/** - * Reidentifiability metric. This corresponds to a risk model similar to what is - * called "journalist risk" in the literature, except the attack - * dataset is statistically modeled instead of being perfectly known. This can - * be done using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { - /** - * Several auxiliary tables can be used in the analysis. Each custom_tag used - * to tag a quasi-identifiers column must appear in exactly one column of one - * auxiliary table. - */ - auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; - /** - * Fields considered to be quasi-identifiers. No two columns can have the same - * tag. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; - /** - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. Required - * if no column is tagged with a region-specific InfoType (like US_ZIP_5) or a - * region code. - */ - regionCode: string; -} -/** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 - * records whose quasi-identifier values correspond to 3, 4 or 5 people in the - * overlying population. An important particular case is when min_anonymity = - * max_anonymity = 1: the frequency field then corresponds to the number of - * uniquely identifiable records. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { - /** - * Number of records within these anonymity bounds. - */ - bucketSize: string; - /** - * Sample of quasi-identifier tuple values in this bucket. The total number of - * classes returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; - /** - * Always greater than or equal to min_anonymity. - */ - maxAnonymity: string; - /** - * Always positive. - */ - minAnonymity: string; -} -/** - * A tuple of values for the quasi-identifier columns. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { - /** - * The estimated anonymity for these quasi-identifier values. - */ - estimatedAnonymity: string; - /** - * The quasi-identifier values. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { - /** - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: {min_anonymity: 1, - * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, - * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} mean - * that there are no record with an estimated anonymity of 4, 5, or larger - * than 10. - */ - kMapEstimationHistogram: - Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; -} -/** - * Include to use an existing data crypto key wrapped by KMS. Authorization - * requires the following IAM permissions when sending a request to perform a - * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt - */ -export interface Schema$GooglePrivacyDlpV2beta1KmsWrappedCryptoKey { - /** - * The resource name of the KMS CryptoKey to use for unwrapping. [required] - */ - cryptoKeyName: string; - /** - * The wrapped data crypto key. [required] - */ - wrappedKey: string; -} -/** - * l-diversity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { - /** - * Set of quasi-identifiers indicating how equivalence classes are defined for - * the l-diversity computation. When multiple fields are specified, they are - * considered a single composite key. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; - /** - * Sensitive field for computing the l-value. - */ - sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * The set of columns' values that share the same l-diversity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { - /** - * Size of the k-anonymity equivalence class. - */ - equivalenceClassSize: string; - /** - * Number of distinct sensitive values in this equivalence class. - */ - numDistinctSensitiveValues: string; - /** - * Quasi-identifier values defining the k-anonymity equivalence class. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; - /** - * Estimated frequencies of top sensitive values. - */ - topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; -} -/** - * Histogram bucket of sensitive value frequencies in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { - /** - * Total number of records in this bucket. - */ - bucketSize: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; - /** - * Lower bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyLowerBound: string; - /** - * Upper bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyUpperBound: string; -} -/** - * Result of the l-diversity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { - /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - */ - sensitiveValueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; -} -/** - * Response to the ListInfoTypes request. - */ -export interface Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse { - /** - * Set of sensitive info types belonging to a category. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta1InfoTypeDescription[]; -} -/** - * Response to the ListInspectFindings request. - */ -export interface Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse { - /** - * If not empty, indicates that there may be more results that match the - * request; this value should be passed in a new `ListInspectFindingsRequest`. - */ - nextPageToken: string; - /** - * The results. - */ - result: Schema$GooglePrivacyDlpV2beta1InspectResult; -} -/** - * Response for ListRootCategories request. - */ -export interface Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse { - /** - * List of all into type categories supported by the API. - */ - categories: Schema$GooglePrivacyDlpV2beta1CategoryDescription[]; -} -/** - * Specifies the location of the finding. - */ -export interface Schema$GooglePrivacyDlpV2beta1Location { - /** - * Zero-based byte offsets delimiting the finding. These are relative to the - * finding's containing element. Note that when the content is not - * textual, this references the UTF-8 encoded textual representation of the - * content. Omitted if content is an image. - */ - byteRange: Schema$GooglePrivacyDlpV2beta1Range; - /** - * Unicode character offsets delimiting the finding. These are relative to the - * finding's containing element. Provided when the content is text. - */ - codepointRange: Schema$GooglePrivacyDlpV2beta1Range; - /** - * The pointer to the property or cell that contained the finding. Provided - * when the finding's containing element is a cell in a table or a - * property of storage object. - */ - fieldId: Schema$GooglePrivacyDlpV2beta1FieldId; - /** - * The area within the image that contained the finding. Provided when the - * content is an image. - */ - imageBoxes: Schema$GooglePrivacyDlpV2beta1ImageLocation[]; - /** - * The pointer to the record in storage that contained the field the finding - * was found in. Provided when the finding's containing element is a - * property of a storage object. - */ - recordKey: Schema$GooglePrivacyDlpV2beta1RecordKey; - /** - * The pointer to the row of the table that contained the finding. Provided - * when the finding's containing element is a cell of a table. - */ - tableLocation: Schema$GooglePrivacyDlpV2beta1TableLocation; -} -/** - * Compute numerical stats over an individual column, including min, max, and - * quantiles. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { - /** - * Field to compute numerical stats on. Supported types are integer, float, - * date, datetime, timestamp, time. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Result of the numerical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { - /** - * Maximum value appearing in the column. - */ - maxValue: Schema$GooglePrivacyDlpV2beta1Value; - /** - * Minimum value appearing in the column. - */ - minValue: Schema$GooglePrivacyDlpV2beta1Value; - /** - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. - */ - quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Additional configuration for inspect long running operations. - */ -export interface Schema$GooglePrivacyDlpV2beta1OperationConfig { - /** - * Max number of findings per file, Datastore entity, or database row. - */ - maxItemFindings: string; -} -/** - * Cloud repository for storing output. - */ -export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { - /** - * The path to a Google Cloud Storage location to store output. The bucket - * must already exist and the Google APIs service account for DLP must have - * write permission to write to the given bucket. Results are split over - * multiple csv files with each file name matching the pattern - * "[operation_id]_[count].csv", for example - * `3094877188788974909_1.csv`. The `operation_id` matches the identifier for - * the Operation, and the `count` is a counter used for tracking the number of - * files written. The CSV file(s) contain the following columns regardless of - * storage type scanned: - id - info_type - likelihood - byte size of finding - * - quote - timestamp For Cloud Storage the next columns are: - file_path - - * start_offset For Cloud Datastore the next columns are: - project_id - - * namespace_id - path - column_name - offset For BigQuery the next columns - * are: - row_number - project_id - dataset_id - table_id - */ - storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; - /** - * Store findings in a new table in the dataset. - */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Datastore partition ID. A partition ID identifies a grouping of entities. The - * grouping is always by project and namespace, however the namespace ID may be - * empty. A partition ID contains several dimensions: project ID and namespace - * ID. - */ -export interface Schema$GooglePrivacyDlpV2beta1PartitionId { - /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; - /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * A (kind, ID/name) pair used to construct a key path. If either name or ID is - * set, the element is complete. If neither is set, the element is incomplete. - */ -export interface Schema$GooglePrivacyDlpV2beta1PathElement { - /** - * The auto-allocated ID of the entity. Never equal to zero. Values less than - * zero are discouraged and may not be supported in the future. - */ - id: string; - /** - * The kind of the entity. A kind matching regex `__.*__` is - * reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - kind: string; - /** - * The name of the entity. A name matching regex `__.*__` is - * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - name: string; -} -/** - * A rule for transforming a value. - */ -export interface Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation { - bucketingConfig: Schema$GooglePrivacyDlpV2beta1BucketingConfig; - characterMaskConfig: Schema$GooglePrivacyDlpV2beta1CharacterMaskConfig; - cryptoHashConfig: Schema$GooglePrivacyDlpV2beta1CryptoHashConfig; - cryptoReplaceFfxFpeConfig: - Schema$GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig; - fixedSizeBucketingConfig: - Schema$GooglePrivacyDlpV2beta1FixedSizeBucketingConfig; - redactConfig: Schema$GooglePrivacyDlpV2beta1RedactConfig; - replaceConfig: Schema$GooglePrivacyDlpV2beta1ReplaceValueConfig; - replaceWithInfoTypeConfig: - Schema$GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig; - timePartConfig: Schema$GooglePrivacyDlpV2beta1TimePartConfig; -} -/** - * Privacy metric to compute for reidentification risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { - categoricalStatsConfig: Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; - kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; - kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; - lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; - numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; -} -/** - * A representation of a Datastore property in a projection. - */ -export interface Schema$GooglePrivacyDlpV2beta1Projection { - /** - * The property to project. - */ - property: Schema$GooglePrivacyDlpV2beta1PropertyReference; -} -/** - * A reference to a property relative to the Datastore kind expressions. - */ -export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { - /** - * The name of the property. If name includes "."s, it may be - * interpreted as a property name path. - */ - name: string; -} -/** - * A quasi-identifier column has a custom_tag, used to know which column in the - * data corresponds to which column in the statistical model. - */ -export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { - customTag: string; - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Generic half-open interval [start, end) - */ -export interface Schema$GooglePrivacyDlpV2beta1Range { - /** - * Index of the last character of the range (exclusive). - */ - end: string; - /** - * Index of the first character of the range (inclusive). - */ - start: string; -} -/** - * A condition for determining whether a transformation should be applied to a - * field. - */ -export interface Schema$GooglePrivacyDlpV2beta1RecordCondition { - expressions: Schema$GooglePrivacyDlpV2beta1Expressions; -} -/** - * Message for a unique key indicating a record that contains a finding. - */ -export interface Schema$GooglePrivacyDlpV2beta1RecordKey { - bigQueryKey: Schema$GooglePrivacyDlpV2beta1BigQueryKey; - cloudStorageKey: Schema$GooglePrivacyDlpV2beta1CloudStorageKey; - datastoreKey: Schema$GooglePrivacyDlpV2beta1DatastoreKey; -} -/** - * Configuration to suppress records whose suppression conditions evaluate to - * true. - */ -export interface Schema$GooglePrivacyDlpV2beta1RecordSuppression { - condition: Schema$GooglePrivacyDlpV2beta1RecordCondition; -} -/** - * A type of transformation that is applied over structured data such as a - * table. - */ -export interface Schema$GooglePrivacyDlpV2beta1RecordTransformations { - /** - * Transform the record by applying various field transformations. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2beta1FieldTransformation[]; + * The set of columns' values that share the same l-diversity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + /** + * Size of the k-anonymity equivalence class. + */ + equivalenceClassSize: string; + /** + * Number of distinct sensitive values in this equivalence class. + */ + numDistinctSensitiveValues: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence class. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + /** + * Estimated frequencies of top sensitive values. + */ + topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + } /** - * Configuration defining which records get suppressed entirely. Records that - * match any suppression rule are omitted from the output [optional]. - */ - recordSuppressions: Schema$GooglePrivacyDlpV2beta1RecordSuppression[]; -} -/** - * Redact a given value. For example, if used with an `InfoTypeTransformation` - * transforming PHONE_NUMBER, and input 'My phone number is - * 206-555-0123', the output would be 'My phone number is '. - */ -export interface Schema$GooglePrivacyDlpV2beta1RedactConfig {} -/** - * Request to search for potentially sensitive info in a list of items and - * replace it with a default or provided content. - */ -export interface Schema$GooglePrivacyDlpV2beta1RedactContentRequest { + * Histogram bucket of sensitive value frequencies in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyLowerBound: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyUpperBound: string; + } /** - * The configuration for specifying what content to redact from images. + * Result of the l-diversity computation. */ - imageRedactionConfigs: Schema$GooglePrivacyDlpV2beta1ImageRedactionConfig[]; + export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { + /** + * Histogram of l-diversity equivalence class sensitive value frequencies. + */ + sensitiveValueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; + } /** - * Configuration for the inspector. + * Response to the ListInfoTypes request. */ - inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + export interface Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse { + /** + * Set of sensitive info types belonging to a category. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta1InfoTypeDescription[]; + } /** - * The list of items to inspect. Up to 100 are allowed per request. - */ - items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + * Response to the ListInspectFindings request. + */ + export interface Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse { + /** + * If not empty, indicates that there may be more results that match the + * request; this value should be passed in a new + * `ListInspectFindingsRequest`. + */ + nextPageToken: string; + /** + * The results. + */ + result: Schema$GooglePrivacyDlpV2beta1InspectResult; + } /** - * The strings to replace findings text findings with. Must specify at least - * one of these or one ImageRedactionConfig if redacting images. + * Response for ListRootCategories request. */ - replaceConfigs: Schema$GooglePrivacyDlpV2beta1ReplaceConfig[]; -} -/** - * Results of redacting a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta1RedactContentResponse { + export interface Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse { + /** + * List of all into type categories supported by the API. + */ + categories: Schema$GooglePrivacyDlpV2beta1CategoryDescription[]; + } /** - * The redacted content. - */ - items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; -} -export interface Schema$GooglePrivacyDlpV2beta1ReplaceConfig { + * Specifies the location of the finding. + */ + export interface Schema$GooglePrivacyDlpV2beta1Location { + /** + * Zero-based byte offsets delimiting the finding. These are relative to the + * finding's containing element. Note that when the content is not + * textual, this references the UTF-8 encoded textual representation of the + * content. Omitted if content is an image. + */ + byteRange: Schema$GooglePrivacyDlpV2beta1Range; + /** + * Unicode character offsets delimiting the finding. These are relative to + * the finding's containing element. Provided when the content is text. + */ + codepointRange: Schema$GooglePrivacyDlpV2beta1Range; + /** + * The pointer to the property or cell that contained the finding. Provided + * when the finding's containing element is a cell in a table or a + * property of storage object. + */ + fieldId: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * The area within the image that contained the finding. Provided when the + * content is an image. + */ + imageBoxes: Schema$GooglePrivacyDlpV2beta1ImageLocation[]; + /** + * The pointer to the record in storage that contained the field the finding + * was found in. Provided when the finding's containing element is a + * property of a storage object. + */ + recordKey: Schema$GooglePrivacyDlpV2beta1RecordKey; + /** + * The pointer to the row of the table that contained the finding. Provided + * when the finding's containing element is a cell of a table. + */ + tableLocation: Schema$GooglePrivacyDlpV2beta1TableLocation; + } /** - * Type of information to replace. Only one ReplaceConfig per info_type should - * be provided. If ReplaceConfig does not have an info_type, the DLP API - * matches it against all info_types that are found but not specified in - * another ReplaceConfig. + * Compute numerical stats over an individual column, including min, max, and + * quantiles. */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are integer, float, + * date, datetime, timestamp, time. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Content replacing sensitive information of given type. Max 256 chars. - */ - replaceWith: string; -} -/** - * Replace each input value with a given `Value`. - */ -export interface Schema$GooglePrivacyDlpV2beta1ReplaceValueConfig { + * Result of the numerical stats computation. + */ + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { + /** + * Maximum value appearing in the column. + */ + maxValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Minimum value appearing in the column. + */ + minValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Value to replace it with. + * Additional configuration for inspect long running operations. */ - newValue: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Replace each matching finding with the name of the info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig {} -/** - * Metadata returned within the - * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) - * for risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + export interface Schema$GooglePrivacyDlpV2beta1OperationConfig { + /** + * Max number of findings per file, Datastore entity, or database row. + */ + maxItemFindings: string; + } /** - * The time which this request was started. - */ - createTime: string; + * Cloud repository for storing output. + */ + export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { + /** + * The path to a Google Cloud Storage location to store output. The bucket + * must already exist and the Google APIs service account for DLP must have + * write permission to write to the given bucket. Results are split over + * multiple csv files with each file name matching the pattern + * "[operation_id]_[count].csv", for example + * `3094877188788974909_1.csv`. The `operation_id` matches the identifier + * for the Operation, and the `count` is a counter used for tracking the + * number of files written. The CSV file(s) contain the following columns + * regardless of storage type scanned: - id - info_type - likelihood - byte + * size of finding - quote - timestamp For Cloud Storage the next columns + * are: - file_path - start_offset For Cloud Datastore the next columns + * are: - project_id - namespace_id - path - column_name - offset For + * BigQuery the next columns are: - row_number - project_id - dataset_id - + * table_id + */ + storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; + /** + * Store findings in a new table in the dataset. + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Privacy metric to compute. - */ - requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + * Datastore partition ID. A partition ID identifies a grouping of entities. + * The grouping is always by project and namespace, however the namespace ID + * may be empty. A partition ID contains several dimensions: project ID and + * namespace ID. + */ + export interface Schema$GooglePrivacyDlpV2beta1PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * Input dataset to compute metrics over. - */ - requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Result of a risk analysis - * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { - categoricalStatsResult: Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; - kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; - kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; - lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; - numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; -} -export interface Schema$GooglePrivacyDlpV2beta1Row { - values: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Shared message indicating Cloud storage type. - */ -export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + * A (kind, ID/name) pair used to construct a key path. If either name or ID + * is set, the element is complete. If neither is set, the element is + * incomplete. + */ + export interface Schema$GooglePrivacyDlpV2beta1PathElement { + /** + * The auto-allocated ID of the entity. Never equal to zero. Values less + * than zero are discouraged and may not be supported in the future. + */ + id: string; + /** + * The kind of the entity. A kind matching regex `__.*__` is + * reserved/read-only. A kind must not contain more than 1500 bytes when + * UTF-8 encoded. Cannot be `""`. + */ + kind: string; + /** + * The name of the entity. A name matching regex `__.*__` is + * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 + * encoded. Cannot be `""`. + */ + name: string; + } /** - * BigQuery options specification. - */ - bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + * A rule for transforming a value. + */ + export interface Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation { + bucketingConfig: Schema$GooglePrivacyDlpV2beta1BucketingConfig; + characterMaskConfig: Schema$GooglePrivacyDlpV2beta1CharacterMaskConfig; + cryptoHashConfig: Schema$GooglePrivacyDlpV2beta1CryptoHashConfig; + cryptoReplaceFfxFpeConfig: + Schema$GooglePrivacyDlpV2beta1CryptoReplaceFfxFpeConfig; + fixedSizeBucketingConfig: + Schema$GooglePrivacyDlpV2beta1FixedSizeBucketingConfig; + redactConfig: Schema$GooglePrivacyDlpV2beta1RedactConfig; + replaceConfig: Schema$GooglePrivacyDlpV2beta1ReplaceValueConfig; + replaceWithInfoTypeConfig: + Schema$GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig; + timePartConfig: Schema$GooglePrivacyDlpV2beta1TimePartConfig; + } /** - * Google Cloud Storage options specification. + * Privacy metric to compute for reidentification risk analysis. */ - cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { + categoricalStatsConfig: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; + kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; + kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; + lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; + numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; + } /** - * Google Cloud Datastore options specification. + * A representation of a Datastore property in a projection. */ - datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; -} -/** - * A collection that informs the user the number of times a particular - * `TransformationResultCode` and error details occurred. - */ -export interface Schema$GooglePrivacyDlpV2beta1SummaryResult { - code: string; - count: string; + export interface Schema$GooglePrivacyDlpV2beta1Projection { + /** + * The property to project. + */ + property: Schema$GooglePrivacyDlpV2beta1PropertyReference; + } /** - * A place for warnings or errors to show up if a transformation didn't - * work as expected. + * A reference to a property relative to the Datastore kind expressions. */ - details: string; -} -/** - * Message for detecting output from deidentification transformations such as - * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). - * These types of transformations are those that perform pseudonymization, - * thereby producing a "surrogate" as output. This should be used in - * conjunction with a field on the transformation such as `surrogate_info_type`. - * This custom info type does not support the use of `detection_rules`. - */ -export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} -/** - * Structured content to inspect. Up to 50,000 `Value`s per request allowed. - */ -export interface Schema$GooglePrivacyDlpV2beta1Table { - headers: Schema$GooglePrivacyDlpV2beta1FieldId[]; - rows: Schema$GooglePrivacyDlpV2beta1Row[]; -} -/** - * Location of a finding within a table. - */ -export interface Schema$GooglePrivacyDlpV2beta1TableLocation { + export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { + /** + * The name of the property. If name includes "."s, it may be + * interpreted as a property name path. + */ + name: string; + } /** - * The zero-based index of the row where the finding is located. + * A quasi-identifier column has a custom_tag, used to know which column in + * the data corresponds to which column in the statistical model. */ - rowIndex: string; -} -/** - * A column with a semantic tag attached. - */ -export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { + customTag: string; + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on the - * possible values of this column (below). - */ - customTag: string; + * Generic half-open interval [start, end) + */ + export interface Schema$GooglePrivacyDlpV2beta1Range { + /** + * Index of the last character of the range (exclusive). + */ + end: string; + /** + * Index of the first character of the range (inclusive). + */ + start: string; + } /** - * Identifies the column. [required] + * A condition for determining whether a transformation should be applied to a + * field. */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; + export interface Schema$GooglePrivacyDlpV2beta1RecordCondition { + expressions: Schema$GooglePrivacyDlpV2beta1Expressions; + } /** - * If no semantic tag is indicated, we infer the statistical model from the - * distribution of values in the input data + * Message for a unique key indicating a record that contains a finding. */ - inferred: Schema$GoogleProtobufEmpty; + export interface Schema$GooglePrivacyDlpV2beta1RecordKey { + bigQueryKey: Schema$GooglePrivacyDlpV2beta1BigQueryKey; + cloudStorageKey: Schema$GooglePrivacyDlpV2beta1CloudStorageKey; + datastoreKey: Schema$GooglePrivacyDlpV2beta1DatastoreKey; + } /** - * A column can be tagged with a InfoType to use the relevant public dataset - * as a statistical model of population, if available. We currently support US - * ZIP codes, region codes, ages and genders. + * Configuration to suppress records whose suppression conditions evaluate to + * true. */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a - * portion of the value. - */ -export interface Schema$GooglePrivacyDlpV2beta1TimePartConfig { - partToExtract: string; -} -/** - * Summary of a single tranformation. Only one of 'transformation', - * 'field_transformation', or 'record_suppress' will be set. - */ -export interface Schema$GooglePrivacyDlpV2beta1TransformationSummary { + export interface Schema$GooglePrivacyDlpV2beta1RecordSuppression { + condition: Schema$GooglePrivacyDlpV2beta1RecordCondition; + } /** - * Set if the transformation was limited to a specific FieldId. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; + * A type of transformation that is applied over structured data such as a + * table. + */ + export interface Schema$GooglePrivacyDlpV2beta1RecordTransformations { + /** + * Transform the record by applying various field transformations. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2beta1FieldTransformation[]; + /** + * Configuration defining which records get suppressed entirely. Records + * that match any suppression rule are omitted from the output [optional]. + */ + recordSuppressions: Schema$GooglePrivacyDlpV2beta1RecordSuppression[]; + } /** - * The field transformation that was applied. If multiple field - * transformations are requested for a single field, this list will contain - * all of them; otherwise, only one is supplied. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2beta1FieldTransformation[]; + * Redact a given value. For example, if used with an `InfoTypeTransformation` + * transforming PHONE_NUMBER, and input 'My phone number is + * 206-555-0123', the output would be 'My phone number is '. + */ + export interface Schema$GooglePrivacyDlpV2beta1RedactConfig {} + /** + * Request to search for potentially sensitive info in a list of items and + * replace it with a default or provided content. + */ + export interface Schema$GooglePrivacyDlpV2beta1RedactContentRequest { + /** + * The configuration for specifying what content to redact from images. + */ + imageRedactionConfigs: Schema$GooglePrivacyDlpV2beta1ImageRedactionConfig[]; + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * The list of items to inspect. Up to 100 are allowed per request. + */ + items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + /** + * The strings to replace findings text findings with. Must specify at least + * one of these or one ImageRedactionConfig if redacting images. + */ + replaceConfigs: Schema$GooglePrivacyDlpV2beta1ReplaceConfig[]; + } /** - * Set if the transformation was limited to a specific info_type. + * Results of redacting a list of items. */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + export interface Schema$GooglePrivacyDlpV2beta1RedactContentResponse { + /** + * The redacted content. + */ + items: Schema$GooglePrivacyDlpV2beta1ContentItem[]; + } + export interface Schema$GooglePrivacyDlpV2beta1ReplaceConfig { + /** + * Type of information to replace. Only one ReplaceConfig per info_type + * should be provided. If ReplaceConfig does not have an info_type, the DLP + * API matches it against all info_types that are found but not specified in + * another ReplaceConfig. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Content replacing sensitive information of given type. Max 256 chars. + */ + replaceWith: string; + } /** - * The specific suppression option these stats apply to. + * Replace each input value with a given `Value`. */ - recordSuppress: Schema$GooglePrivacyDlpV2beta1RecordSuppression; - results: Schema$GooglePrivacyDlpV2beta1SummaryResult[]; + export interface Schema$GooglePrivacyDlpV2beta1ReplaceValueConfig { + /** + * Value to replace it with. + */ + newValue: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * The specific transformation these stats apply to. - */ - transformation: Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; + * Replace each matching finding with the name of the info_type. + */ + export interface Schema$GooglePrivacyDlpV2beta1ReplaceWithInfoTypeConfig {} + /** + * Metadata returned within the + * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) + * for risk analysis. + */ + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + /** + * Privacy metric to compute. + */ + requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Total size in bytes that were transformed in some way. + * Result of a risk analysis + * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. */ - transformedBytes: string; -} -/** - * Use this to have a random data crypto key generated. It will be discarded - * after the operation/request finishes. - */ -export interface Schema$GooglePrivacyDlpV2beta1TransientCryptoKey { + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { + categoricalStatsResult: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; + kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; + kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; + lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; + numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; + } + export interface Schema$GooglePrivacyDlpV2beta1Row { + values: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Name of the key. [required] This is an arbitrary string used to - * differentiate different keys. A unique key is generated per name: two - * separate `TransientCryptoKey` protos share the same generated key if their - * names are the same. When the data crypto key is generated, this name is not - * used in any way (repeating the api call will result in a different key - * being generated). - */ - name: string; -} -/** - * Using raw keys is prone to security risks due to accidentally leaking the - * key. Choose another type of key if possible. - */ -export interface Schema$GooglePrivacyDlpV2beta1UnwrappedCryptoKey { + * Shared message indicating Cloud storage type. + */ + export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + /** + * BigQuery options specification. + */ + bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + /** + * Google Cloud Storage options specification. + */ + cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + /** + * Google Cloud Datastore options specification. + */ + datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; + } /** - * The AES 128/192/256 bit key. [required] - */ - key: string; -} -/** - * Set of primitive values supported by the system. Note that for the purposes - * of inspection or transformation, the number of bytes considered to comprise a - * 'Value' is based on its representation as a UTF-8 encoded string. For - * example, if 'integer_value' is set to 123456789, the number of bytes - * would be counted as 9, even though an int64 only holds up to 8 bytes of data. - */ -export interface Schema$GooglePrivacyDlpV2beta1Value { - booleanValue: boolean; - dateValue: Schema$GoogleTypeDate; - floatValue: number; - integerValue: string; - stringValue: string; - timestampValue: string; - timeValue: Schema$GoogleTypeTimeOfDay; -} -/** - * A value of a field, including its frequency. - */ -export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + * A collection that informs the user the number of times a particular + * `TransformationResultCode` and error details occurred. + */ + export interface Schema$GooglePrivacyDlpV2beta1SummaryResult { + code: string; + count: string; + /** + * A place for warnings or errors to show up if a transformation didn't + * work as expected. + */ + details: string; + } /** - * How many times the value is contained in the field. + * Message for detecting output from deidentification transformations such as + * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). + * These types of transformations are those that perform pseudonymization, + * thereby producing a "surrogate" as output. This should be used in + * conjunction with a field on the transformation such as + * `surrogate_info_type`. This custom info type does not support the use of + * `detection_rules`. */ - count: string; + export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} /** - * A value contained in the field in question. + * Structured content to inspect. Up to 50,000 `Value`s per request allowed. */ - value: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Message defining a list of words or phrases to search for in the data. - */ -export interface Schema$GooglePrivacyDlpV2beta1WordList { + export interface Schema$GooglePrivacyDlpV2beta1Table { + headers: Schema$GooglePrivacyDlpV2beta1FieldId[]; + rows: Schema$GooglePrivacyDlpV2beta1Row[]; + } /** - * Words or phrases defining the dictionary. The dictionary must contain at - * least one phrase and every phrase must contain at least 2 characters that - * are letters or digits. [required] + * Location of a finding within a table. */ - words: string[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobufEmpty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpcStatus { + export interface Schema$GooglePrivacyDlpV2beta1TableLocation { + /** + * The zero-based index of the row where the finding is located. + */ + rowIndex: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A column with a semantic tag attached. + */ + export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + /** + * A column can be tagged with a custom tag. In this case, the user must + * indicate an auxiliary table that contains statistical information on the + * possible values of this column (below). + */ + customTag: string; + /** + * Identifies the column. [required] + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * If no semantic tag is indicated, we infer the statistical model from the + * distribution of values in the input data + */ + inferred: Schema$GoogleProtobufEmpty; + /** + * A column can be tagged with a InfoType to use the relevant public dataset + * as a statistical model of population, if available. We currently support + * US ZIP codes, region codes, ages and genders. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a + * portion of the value. */ - details: any[]; + export interface Schema$GooglePrivacyDlpV2beta1TimePartConfig { + partToExtract: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeDate { + * Summary of a single tranformation. Only one of 'transformation', + * 'field_transformation', or 'record_suppress' will be set. + */ + export interface Schema$GooglePrivacyDlpV2beta1TransformationSummary { + /** + * Set if the transformation was limited to a specific FieldId. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * The field transformation that was applied. If multiple field + * transformations are requested for a single field, this list will contain + * all of them; otherwise, only one is supplied. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2beta1FieldTransformation[]; + /** + * Set if the transformation was limited to a specific info_type. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * The specific suppression option these stats apply to. + */ + recordSuppress: Schema$GooglePrivacyDlpV2beta1RecordSuppression; + results: Schema$GooglePrivacyDlpV2beta1SummaryResult[]; + /** + * The specific transformation these stats apply to. + */ + transformation: Schema$GooglePrivacyDlpV2beta1PrimitiveTransformation; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; + * Use this to have a random data crypto key generated. It will be discarded + * after the operation/request finishes. + */ + export interface Schema$GooglePrivacyDlpV2beta1TransientCryptoKey { + /** + * Name of the key. [required] This is an arbitrary string used to + * differentiate different keys. A unique key is generated per name: two + * separate `TransientCryptoKey` protos share the same generated key if + * their names are the same. When the data crypto key is generated, this + * name is not used in any way (repeating the api call will result in a + * different key being generated). + */ + name: string; + } /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. + * Using raw keys is prone to security risks due to accidentally leaking the + * key. Choose another type of key if possible. */ - month: number; + export interface Schema$GooglePrivacyDlpV2beta1UnwrappedCryptoKey { + /** + * The AES 128/192/256 bit key. [required] + */ + key: string; + } /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeTimeOfDay { + * Set of primitive values supported by the system. Note that for the purposes + * of inspection or transformation, the number of bytes considered to comprise + * a 'Value' is based on its representation as a UTF-8 encoded string. + * For example, if 'integer_value' is set to 123456789, the number of + * bytes would be counted as 9, even though an int64 only holds up to 8 bytes + * of data. + */ + export interface Schema$GooglePrivacyDlpV2beta1Value { + booleanValue: boolean; + dateValue: Schema$GoogleTypeDate; + floatValue: number; + integerValue: string; + stringValue: string; + timestampValue: string; + timeValue: Schema$GoogleTypeTimeOfDay; + } /** - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing - * time. - */ - hours: number; + * A value of a field, including its frequency. + */ + export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + /** + * How many times the value is contained in the field. + */ + count: string; + /** + * A value contained in the field in question. + */ + value: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * Minutes of hour of day. Must be from 0 to 59. + * Message defining a list of words or phrases to search for in the data. */ - minutes: number; + export interface Schema$GooglePrivacyDlpV2beta1WordList { + /** + * Words or phrases defining the dictionary. The dictionary must contain at + * least one phrase and every phrase must contain at least 2 characters that + * are letters or digits. [required] + */ + words: string[]; + } /** - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - */ - nanos: number; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobufEmpty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpcStatus { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. - */ - seconds: number; -} - -export class Resource$Content { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeDate { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; } - - getRoot() { - return this.root; + /** + * Represents a time of day. The date and time zone are either not significant + * or are specified elsewhere. An API may choose to allow leap seconds. + * Related types are google.type.Date and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeTimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business + * closing time. + */ + hours: number; + /** + * Minutes of hour of day. Must be from 0 to 59. + */ + minutes: number; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + */ + nanos: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds: number; } - - /** - * dlp.content.deidentify - * @desc De-identifies potentially sensitive info from a list of strings. This - * method has limits on input size and output size. - * @alias dlp.content.deidentify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GooglePrivacyDlpV2beta1DeidentifyContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deidentify(params?: any, options?: MethodOptions): - AxiosPromise; - deidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>): void; - deidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Content { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/content:deidentify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>(parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.content.inspect - * @desc Finds potentially sensitive info in a list of strings. This method - * has limits on input size, processing time, and output size. - * @alias dlp.content.inspect - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GooglePrivacyDlpV2beta1InspectContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - inspect(params?: any, options?: MethodOptions): - AxiosPromise; - inspect( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1InspectContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1InspectContentResponse>): void; - inspect( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1InspectContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1InspectContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/content:inspect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1InspectContentResponse>(parameters); + /** + * dlp.content.deidentify + * @desc De-identifies potentially sensitive info from a list of strings. + * This method has limits on input size and output size. + * @alias dlp.content.deidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GooglePrivacyDlpV2beta1DeidentifyContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deidentify(params?: any, options?: MethodOptions): + AxiosPromise; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>): void; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/content:deidentify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1DeidentifyContentResponse>( + parameters); + } } - } - /** - * dlp.content.redact - * @desc Redacts potentially sensitive info from a list of strings. This - * method has limits on input size, processing time, and output size. - * @alias dlp.content.redact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GooglePrivacyDlpV2beta1RedactContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - redact(params?: any, options?: MethodOptions): - AxiosPromise; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1RedactContentResponse>): void; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1RedactContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.content.inspect + * @desc Finds potentially sensitive info in a list of strings. This method + * has limits on input size, processing time, and output size. + * @alias dlp.content.inspect + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GooglePrivacyDlpV2beta1InspectContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + inspect(params?: any, options?: MethodOptions): + AxiosPromise; + inspect( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1InspectContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1InspectContentResponse>): void; + inspect( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1InspectContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1InspectContentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/content:inspect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1InspectContentResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/content:redact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1RedactContentResponse>(parameters); - } - } -} -export class Resource$Datasource { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dlp.content.redact + * @desc Redacts potentially sensitive info from a list of strings. This + * method has limits on input size, processing time, and output size. + * @alias dlp.content.redact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GooglePrivacyDlpV2beta1RedactContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + redact(params?: any, options?: MethodOptions): + AxiosPromise; + redact( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1RedactContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1RedactContentResponse>): void; + redact( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1RedactContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1RedactContentResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/content:redact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1RedactContentResponse>(parameters); + } + } } - - /** - * dlp.dataSource.analyze - * @desc Schedules a job to compute risk analysis metrics over content in a - * Google Cloud Platform repository. - * @alias dlp.dataSource.analyze - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyze(params?: any, options?: MethodOptions): - AxiosPromise; - analyze( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyze( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Datasource { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/dataSource:analyze') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Inspect { - root: Dlp; - operations: Resource$Inspect$Operations; - results: Resource$Inspect$Results; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Inspect$Operations(root); - this.results = new Resource$Inspect$Results(root); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } -} -export class Resource$Inspect$Operations { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dlp.dataSource.analyze + * @desc Schedules a job to compute risk analysis metrics over content in a + * Google Cloud Platform repository. + * @alias dlp.dataSource.analyze + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GooglePrivacyDlpV2beta1AnalyzeDataSourceRiskRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyze(params?: any, options?: MethodOptions): + AxiosPromise; + analyze( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + analyze( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/dataSource:analyze') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Inspect { + root: Dlp; + operations: Resource$Inspect$Operations; + results: Resource$Inspect$Results; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Inspect$Operations(root); + this.results = new Resource$Inspect$Results(root); + } - /** - * dlp.inspect.operations.cancel - * @desc Cancels an operation. Use the `inspect.operations.get` to check - * whether the cancellation succeeded or the operation completed despite - * cancellation. - * @alias dlp.inspect.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().GoogleLongrunningCancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Inspect$Operations { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.inspect.operations.create - * @desc Schedules a job scanning content in a Google Cloud Platform data - * repository. - * @alias dlp.inspect.operations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GooglePrivacyDlpV2beta1CreateInspectOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.inspect.operations.cancel + * @desc Cancels an operation. Use the `inspect.operations.get` to check + * whether the cancellation succeeded or the operation completed despite + * cancellation. + * @alias dlp.inspect.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().GoogleLongrunningCancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/inspect/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.inspect.operations.delete - * @desc This method is not supported and the server returns `UNIMPLEMENTED`. - * @alias dlp.inspect.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.inspect.operations.create + * @desc Schedules a job scanning content in a Google Cloud Platform data + * repository. + * @alias dlp.inspect.operations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GooglePrivacyDlpV2beta1CreateInspectOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/inspect/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.inspect.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias dlp.inspect.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.inspect.operations.delete + * @desc This method is not supported and the server returns + * `UNIMPLEMENTED`. + * @alias dlp.inspect.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.inspect.operations.list - * @desc Fetches the list of long running operations. - * @alias dlp.inspect.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Filters by `done`. That is, `done=true` or `done=false`. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The list page size. The maximum allowed value is 256 and the default is 100. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dlp.inspect.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias dlp.inspect.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} - -export class Resource$Inspect$Results { - root: Dlp; - findings: Resource$Inspect$Results$Findings; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.findings = new Resource$Inspect$Results$Findings(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Inspect$Results$Findings { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dlp.inspect.operations.list + * @desc Fetches the list of long running operations. + * @alias dlp.inspect.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Filters by `done`. That is, `done=true` or `done=false`. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The list page size. The maximum allowed value is 256 and the default is 100. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * dlp.inspect.results.findings.list - * @desc Returns list of results for given inspect operation result set id. - * @alias dlp.inspect.results.findings.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Restricts findings to items that match. Supports info_type and likelihood. Examples: - info_type=EMAIL_ADDRESS - info_type=PHONE_NUMBER,EMAIL_ADDRESS - likelihood=VERY_LIKELY - likelihood=VERY_LIKELY,LIKELY - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY - * @param {string} params.name Identifier of the results set returned as metadata of the longrunning operation created by a call to InspectDataSource. Should be in the format of `inspect/results/{id}`. - * @param {integer=} params.pageSize Maximum number of results to return. If 0, the implementation selects a reasonable value. - * @param {string=} params.pageToken The value returned by the last `ListInspectFindingsResponse`; indicates that this is a continuation of a prior `ListInspectFindings` call, and that the system should return the next page of data. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Inspect$Results { + root: Dlp; + findings: Resource$Inspect$Results$Findings; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.findings = new Resource$Inspect$Results$Findings(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}/findings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>( - parameters); + + getRoot() { + return this.root; } } -} + export class Resource$Inspect$Results$Findings { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + } + getRoot() { + return this.root; + } -export class Resource$Riskanalysis { - root: Dlp; - operations: Resource$Riskanalysis$Operations; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Riskanalysis$Operations(root); + /** + * dlp.inspect.results.findings.list + * @desc Returns list of results for given inspect operation result set id. + * @alias dlp.inspect.results.findings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Restricts findings to items that match. Supports info_type and likelihood. Examples: - info_type=EMAIL_ADDRESS - info_type=PHONE_NUMBER,EMAIL_ADDRESS - likelihood=VERY_LIKELY - likelihood=VERY_LIKELY,LIKELY - info_type=EMAIL_ADDRESS,likelihood=VERY_LIKELY,LIKELY + * @param {string} params.name Identifier of the results set returned as metadata of the longrunning operation created by a call to InspectDataSource. Should be in the format of `inspect/results/{id}`. + * @param {integer=} params.pageSize Maximum number of results to return. If 0, the implementation selects a reasonable value. + * @param {string=} params.pageToken The value returned by the last `ListInspectFindingsResponse`; indicates that this is a continuation of a prior `ListInspectFindings` call, and that the system should return the next page of data. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>): + void|AxiosPromise< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}/findings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1ListInspectFindingsResponse>( + parameters); + } + } } - getRoot() { - return this.root; - } -} -export class Resource$Riskanalysis$Operations { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + export class Resource$Riskanalysis { + root: Dlp; + operations: Resource$Riskanalysis$Operations; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Riskanalysis$Operations(root); + } - /** - * dlp.riskAnalysis.operations.cancel - * @desc Cancels an operation. Use the `inspect.operations.get` to check - * whether the cancellation succeeded or the operation completed despite - * cancellation. - * @alias dlp.riskAnalysis.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().GoogleLongrunningCancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Riskanalysis$Operations { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.riskAnalysis.operations.delete - * @desc This method is not supported and the server returns `UNIMPLEMENTED`. - * @alias dlp.riskAnalysis.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.riskAnalysis.operations.cancel + * @desc Cancels an operation. Use the `inspect.operations.get` to check + * whether the cancellation succeeded or the operation completed despite + * cancellation. + * @alias dlp.riskAnalysis.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().GoogleLongrunningCancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.riskAnalysis.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias dlp.riskAnalysis.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.riskAnalysis.operations.delete + * @desc This method is not supported and the server returns + * `UNIMPLEMENTED`. + * @alias dlp.riskAnalysis.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dlp.riskAnalysis.operations.list - * @desc Fetches the list of long running operations. - * @alias dlp.riskAnalysis.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Filters by `done`. That is, `done=true` or `done=false`. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The list page size. The maximum allowed value is 256 and the default is 100. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.riskAnalysis.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias dlp.riskAnalysis.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Rootcategories { - root: Dlp; - infoTypes: Resource$Rootcategories$Infotypes; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.infoTypes = new Resource$Rootcategories$Infotypes(root); - } - getRoot() { - return this.root; + /** + * dlp.riskAnalysis.operations.list + * @desc Fetches the list of long running operations. + * @alias dlp.riskAnalysis.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Filters by `done`. That is, `done=true` or `done=false`. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The list page size. The maximum allowed value is 256 and the default is 100. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunningListOperationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - /** - * dlp.rootCategories.list - * @desc Returns the list of root categories of sensitive information. - * @alias dlp.rootCategories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional language code for localized friendly category names. If omitted or if localized strings are not available, en-US strings will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Rootcategories { + root: Dlp; + infoTypes: Resource$Rootcategories$Infotypes; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.infoTypes = new Resource$Rootcategories$Infotypes(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/rootCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>(parameters); + + + /** + * dlp.rootCategories.list + * @desc Returns the list of root categories of sensitive information. + * @alias dlp.rootCategories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional language code for localized friendly category names. If omitted or if localized strings are not available, en-US strings will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/rootCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1ListRootCategoriesResponse>( + parameters); + } } } -} -export class Resource$Rootcategories$Infotypes { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Rootcategories$Infotypes { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dlp.rootCategories.infoTypes.list - * @desc Returns sensitive information types for given category. - * @alias dlp.rootCategories.infoTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.category Category name as returned by ListRootCategories. - * @param {string=} params.languageCode Optional BCP-47 language code for localized info type friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/rootCategories/{+category}/infoTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['category'], - pathParams: ['category'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>(parameters); + /** + * dlp.rootCategories.infoTypes.list + * @desc Returns sensitive information types for given category. + * @alias dlp.rootCategories.infoTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.category Category name as returned by ListRootCategories. + * @param {string=} params.languageCode Optional BCP-47 language code for localized info type friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/rootCategories/{+category}/infoTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['category'], + pathParams: ['category'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta1ListInfoTypesResponse>(parameters); + } } } } diff --git a/src/apis/dlp/v2beta2.ts b/src/apis/dlp/v2beta2.ts index f3242d16bdf..64e61102156 100644 --- a/src/apis/dlp/v2beta2.ts +++ b/src/apis/dlp/v2beta2.ts @@ -27,5651 +27,5700 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Data Loss Prevention (DLP) API - * - * Provides methods for detection, risk analysis, and de-identification of - * privacy-sensitive fragments in text, images, and Google Cloud Platform - * storage repositories. - * - * @example - * const google = require('googleapis'); - * const dlp = google.dlp('v2beta2'); - * - * @namespace dlp - * @type {Function} - * @version v2beta2 - * @variation v2beta2 - * @param {object=} options Options for Dlp - */ -export class Dlp { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dlp_v2beta2 { + /** + * Cloud Data Loss Prevention (DLP) API + * + * Provides methods for detection, risk analysis, and de-identification of + * privacy-sensitive fragments in text, images, and Google Cloud Platform + * storage repositories. + * + * @example + * const google = require('googleapis'); + * const dlp = google.dlp('v2beta2'); + * + * @namespace dlp + * @type {Function} + * @version v2beta2 + * @variation v2beta2 + * @param {object=} options Options for Dlp + */ + export class Dlp { + _options: GlobalOptions; + google: GoogleApis; + root = this; - infoTypes: Resource$Infotypes; - organizations: Resource$Organizations; - projects: Resource$Projects; + infoTypes: Resource$Infotypes; + organizations: Resource$Organizations; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.infoTypes = new Resource$Infotypes(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - } + this.infoTypes = new Resource$Infotypes(this); + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An auxiliary table contains statistical information on the relative frequency - * of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. If a tuple is present in the data - * but not in the auxiliary table, the corresponding relative frequency is - * assumed to be zero (and thus, the tuple is highly reidentifiable). - */ -export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { /** - * Quasi-identifier columns. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + * An auxiliary table contains statistical information on the relative + * frequency of different quasi-identifiers values. It has one or several + * quasi-identifiers columns, and one column that indicates the relative + * frequency of each quasi-identifier tuple. If a tuple is present in the data + * but not in the auxiliary table, the corresponding relative frequency is + * assumed to be zero (and thus, the tuple is highly reidentifiable). + */ + export interface Schema$GooglePrivacyDlpV2beta1AuxiliaryTable { + /** + * Quasi-identifier columns. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1QuasiIdField[]; + /** + * The relative frequency column must contain a floating-point number + * between 0 and 1 (inclusive). Null values are assumed to be zero. + * [required] + */ + relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * Auxiliary table location. [required] + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * The relative frequency column must contain a floating-point number between - * 0 and 1 (inclusive). Null values are assumed to be zero. [required] - */ - relativeFrequency: Schema$GooglePrivacyDlpV2beta1FieldId; + * Options defining BigQuery table and row identifiers. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. Nested + * fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Auxiliary table location. [required] - */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Options defining BigQuery table and row identifiers. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryOptions { + * Message defining the location of a BigQuery table. A table is uniquely + * identified by its project_id, dataset_id, and table_name. Within a query a + * table is often referenced with a string in the format of: + * `<project_id>:<dataset_id>.<table_id>` or + * `<project_id>.<dataset_id>.<table_id>`. + */ + export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + /** + * Dataset ID of the table. + */ + datasetId: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId: string; + /** + * Name of the table. + */ + tableId: string; + } /** - * References to fields uniquely identifying rows within the table. Nested - * fields in the format, like `person.birthdate.year`, are allowed. + * Compute numerical stats over an individual column, including number of + * distinct values and value count distribution. */ - identifyingFields: Schema$GooglePrivacyDlpV2beta1FieldId[]; + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are supported + * except for arrays and structs. However, it may be more informative to use + * NumericalStats when the field type is supported, depending on the data. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query a - * table is often referenced with a string in the format of: - * `<project_id>:<dataset_id>.<table_id>` or - * `<project_id>.<dataset_id>.<table_id>`. - */ -export interface Schema$GooglePrivacyDlpV2beta1BigQueryTable { + * Histogram bucket of value frequencies in the column. + */ + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of value frequencies in this bucket. The total number of values + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + /** + * Lower bound on the value frequency of the values in this bucket. + */ + valueFrequencyLowerBound: string; + /** + * Upper bound on the value frequency of the values in this bucket. + */ + valueFrequencyUpperBound: string; + } /** - * Dataset ID of the table. + * Result of the categorical stats computation. */ - datasetId: string; + export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + /** + * Histogram of value frequencies in the column. + */ + valueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; + } /** - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. + * Options defining a file or a set of files (path ending with *) within a + * Google Cloud Storage bucket. */ - projectId: string; + export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { + fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; + } /** - * Name of the table. + * A location in Cloud Storage. */ - tableId: string; -} -/** - * Compute numerical stats over an individual column, including number of - * distinct values and value count distribution. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig { + export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + /** + * The url, in the format of `gs://bucket/<path>`. + */ + path: string; + } /** - * Field to compute categorical stats on. All column types are supported - * except for arrays and structs. However, it may be more informative to use - * NumericalStats when the field type is supported, depending on the data. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Histogram bucket of value frequencies in the column. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket { + * Custom information type provided by the user. Used to find domain-specific + * sensitive information configurable to the data in question. + */ + export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + /** + * Dictionary-based custom info type. + */ + dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + /** + * Info type configuration. All custom info types must have configurations + * that do not conflict with built-in info types or other custom info types. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Surrogate info type. + */ + surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; + } /** - * Total number of records in this bucket. - */ - bucketSize: string; + * Options defining a data set within Google Cloud Datastore. + */ + export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + /** + * The kind to process. + */ + kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + /** + * Properties to scan. If none are specified, all properties will be scanned + * by default. + */ + projection: Schema$GooglePrivacyDlpV2beta1Projection[]; + } /** - * Sample of value frequencies in this bucket. The total number of values - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + * Custom information type based on a dictionary of words or phrases. This can + * be used to match sensitive information specific to the data, such as a list + * of employee IDs or job titles. Dictionary words are case-insensitive and + * all characters other than letters and digits in the unicode [Basic + * Multilingual + * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + * will be replaced with whitespace when scanning for matches, so the + * dictionary phrase "Sam Johnson" will match all three phrases + * "sam johnson", "Sam, Johnson", and "Sam + * (Johnson)". Additionally, the characters surrounding any match must be + * of a different type than the adjacent characters within the word, so + * letters must be next to non-letters and digits next to non-digits. For + * example, the dictionary word "jen" will match the first three + * letters of the text "jen123" but will return no matches for + * "jennifer". Dictionary words containing a large number of + * characters that are not letters or digits may result in unexpected findings + * because such characters are treated as whitespace. + */ + export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + /** + * List of words or phrases to search for. + */ + wordList: Schema$GooglePrivacyDlpV2beta1WordList; + } /** - * Lower bound on the value frequency of the values in this bucket. - */ - valueFrequencyLowerBound: string; + * An entity in a dataset is a field or set of fields that correspond to a + * single person. For example, in medical records the `EntityId` might be a + * patient identifier, or for financial records it might be an account + * identifier. This message is used when generalizations or analysis must be + * consistent across multiple rows pertaining to the same entity. + */ + export interface Schema$GooglePrivacyDlpV2beta1EntityId { + /** + * Composite key indicating which field contains the entity identifier. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Upper bound on the value frequency of the values in this bucket. + * General identifier of a data field in a storage service. */ - valueFrequencyUpperBound: string; -} -/** - * Result of the categorical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult { + export interface Schema$GooglePrivacyDlpV2beta1FieldId { + /** + * Name describing the field. + */ + columnName: string; + } /** - * Histogram of value frequencies in the column. + * Set of files to scan. */ - valueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1CategoricalStatsHistogramBucket[]; -} -/** - * Options defining a file or a set of files (path ending with *) within a - * Google Cloud Storage bucket. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStorageOptions { - fileSet: Schema$GooglePrivacyDlpV2beta1FileSet; -} -/** - * A location in Cloud Storage. - */ -export interface Schema$GooglePrivacyDlpV2beta1CloudStoragePath { + export interface Schema$GooglePrivacyDlpV2beta1FileSet { + /** + * The url, in the format `gs://<bucket>/<path>`. Trailing + * wildcard in the path is allowed. + */ + url: string; + } /** - * The url, in the format of `gs://bucket/<path>`. + * Type of information detected by the API. */ - path: string; -} -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - */ -export interface Schema$GooglePrivacyDlpV2beta1CustomInfoType { + export interface Schema$GooglePrivacyDlpV2beta1InfoType { + /** + * Name of the information type. + */ + name: string; + } /** - * Dictionary-based custom info type. - */ - dictionary: Schema$GooglePrivacyDlpV2beta1Dictionary; + * Max findings configuration per info type, per content item or long running + * operation. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + /** + * Max findings limit for the given infoType. + */ + maxFindings: number; + } /** - * Info type configuration. All custom info types must have configurations - * that do not conflict with built-in info types or other custom info types. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + * Statistics regarding a specific InfoType. + */ + export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { + /** + * Number of findings for this info type. + */ + count: string; + /** + * The type of finding this stat is for. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * Surrogate info type. - */ - surrogateType: Schema$GooglePrivacyDlpV2beta1SurrogateType; -} -/** - * Options defining a data set within Google Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta1DatastoreOptions { + * Configuration description of the scanning process. When used with + * redactContent only info_types and min_likelihood are currently used. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { + /** + * Custom info types provided by the user. + */ + customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; + /** + * When true, excludes type information of the findings. + */ + excludeTypes: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote: boolean; + /** + * Configuration of findings limit given for specified info types. + */ + infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + /** + * Limits the number of findings per content item or long running operation. + */ + maxFindings: number; + /** + * Only returns findings equal or above this threshold. + */ + minLikelihood: string; + } /** - * The kind to process. - */ - kind: Schema$GooglePrivacyDlpV2beta1KindExpression; + * Metadata returned within GetOperation for an inspect request. + */ + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + /** + * Total size in bytes that were processed. + */ + processedBytes: string; + /** + * The inspect config used to create the Operation. + */ + requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + /** + * Optional location to store findings. + */ + requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + /** + * The storage config used to create the Operation. + */ + requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + /** + * Estimate of the number of bytes to process. + */ + totalEstimatedBytes: string; + } /** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. + * The operational data. */ - partitionId: Schema$GooglePrivacyDlpV2beta1PartitionId; + export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `inspect/results/{id}`. + */ + name: string; + } /** - * Properties to scan. If none are specified, all properties will be scanned - * by default. - */ - projection: Schema$GooglePrivacyDlpV2beta1Projection[]; -} -/** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. Dictionary words are case-insensitive and all - * characters other than letters and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the dictionary - * phrase "Sam Johnson" will match all three phrases "sam - * johnson", "Sam, Johnson", and "Sam (Johnson)". - * Additionally, the characters surrounding any match must be of a different - * type than the adjacent characters within the word, so letters must be next to - * non-letters and digits next to non-digits. For example, the dictionary word - * "jen" will match the first three letters of the text - * "jen123" but will return no matches for "jennifer". - * Dictionary words containing a large number of characters that are not letters - * or digits may result in unexpected findings because such characters are - * treated as whitespace. - */ -export interface Schema$GooglePrivacyDlpV2beta1Dictionary { + * k-anonymity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { + /** + * Optional message indicating that each distinct entity_id should not + * contribute to the k-anonymity count more than once per equivalence class. + * If an entity_id appears on several rows with different quasi-identifier + * tuples, it will contribute to each count exactly once. This can lead to + * unexpected results. Consider a table where ID 1 is associated to + * quasi-identifier "foo", ID 2 to "bar", and ID 3 to + * *both* quasi-identifiers "foo" and "bar" (on separate + * rows), and where this ID is used as entity_id. Then, the anonymity value + * associated to ID 3 will be 2, even if it is the only ID to be associated + * to both values "foo" and "bar". + */ + entityId: Schema$GooglePrivacyDlpV2beta1EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within a + * repeated field. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + } /** - * List of words or phrases to search for. - */ - wordList: Schema$GooglePrivacyDlpV2beta1WordList; -} -/** - * An entity in a dataset is a field or set of fields that correspond to a - * single person. For example, in medical records the `EntityId` might be a - * patient identifier, or for financial records it might be an account - * identifier. This message is used when generalizations or analysis must be - * consistent across multiple rows pertaining to the same entity. - */ -export interface Schema$GooglePrivacyDlpV2beta1EntityId { + * The set of columns' values that share the same k-anonymity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the above + * set of values. + */ + equivalenceClassSize: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Composite key indicating which field contains the entity identifier. - */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * General identifier of a data field in a storage service. - */ -export interface Schema$GooglePrivacyDlpV2beta1FieldId { + * Histogram bucket of equivalence class sizes in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + /** + * Lower bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeLowerBound: string; + /** + * Upper bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeUpperBound: string; + } /** - * Name describing the field. + * Result of the k-anonymity computation. */ - columnName: string; -} -/** - * Set of files to scan. - */ -export interface Schema$GooglePrivacyDlpV2beta1FileSet { + export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { + /** + * Histogram of k-anonymity equivalence classes. + */ + equivalenceClassHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; + } /** - * The url, in the format `gs://<bucket>/<path>`. Trailing - * wildcard in the path is allowed. + * A representation of a Datastore kind. */ - url: string; -} -/** - * Type of information detected by the API. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoType { + export interface Schema$GooglePrivacyDlpV2beta1KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * Name of the information type. - */ - name: string; -} -/** - * Max findings configuration per info type, per content item or long running - * operation. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeLimit { + * Reidentifiability metric. This corresponds to a risk model similar to what + * is called "journalist risk" in the literature, except the attack + * dataset is statistically modeled instead of being perfectly known. This can + * be done using publicly available data (like the US Census), or using a + * custom statistical model (indicated as one or several BigQuery tables), or + * by extrapolating from the distribution of values in the input dataset. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { + /** + * Several auxiliary tables can be used in the analysis. Each custom_tag + * used to tag a quasi-identifiers column must appear in exactly one column + * of one auxiliary table. + */ + auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; + /** + * Fields considered to be quasi-identifiers. No two columns can have the + * same tag. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; + /** + * ISO 3166-1 alpha-2 region code to use in the statistical modeling. + * Required if no column is tagged with a region-specific InfoType (like + * US_ZIP_5) or a region code. + */ + regionCode: string; + } /** - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an info_type, - * the DLP API applies the limit against all info_types that are found but not - * specified in another InfoTypeLimit. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + * A KMapEstimationHistogramBucket message with the following values: + * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 + * records whose quasi-identifier values correspond to 3, 4 or 5 people in the + * overlying population. An important particular case is when min_anonymity = + * max_anonymity = 1: the frequency field then corresponds to the number of + * uniquely identifiable records. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { + /** + * Number of records within these anonymity bounds. + */ + bucketSize: string; + /** + * Sample of quasi-identifier tuple values in this bucket. The total number + * of classes returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; + /** + * Always greater than or equal to min_anonymity. + */ + maxAnonymity: string; + /** + * Always positive. + */ + minAnonymity: string; + } /** - * Max findings limit for the given infoType. - */ - maxFindings: number; -} -/** - * Statistics regarding a specific InfoType. - */ -export interface Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics { + * A tuple of values for the quasi-identifier columns. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { + /** + * The estimated anonymity for these quasi-identifier values. + */ + estimatedAnonymity: string; + /** + * The quasi-identifier values. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Number of findings for this info type. - */ - count: string; + * Result of the reidentifiability analysis. Note that these results are an + * estimation, not exact values. + */ + export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { + /** + * The intervals [min_anonymity, max_anonymity] do not overlap. If a value + * doesn't correspond to any such interval, the associated frequency is + * zero. For example, the following records: {min_anonymity: 1, + * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, + * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} + * mean that there are no record with an estimated anonymity of 4, 5, or + * larger than 10. + */ + kMapEstimationHistogram: + Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; + } /** - * The type of finding this stat is for. - */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * Configuration description of the scanning process. When used with - * redactContent only info_types and min_likelihood are currently used. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectConfig { + * l-diversity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are defined + * for the l-diversity computation. When multiple fields are specified, they + * are considered a single composite key. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + /** + * Sensitive field for computing the l-value. + */ + sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Custom info types provided by the user. - */ - customInfoTypes: Schema$GooglePrivacyDlpV2beta1CustomInfoType[]; + * The set of columns' values that share the same l-diversity value. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + /** + * Size of the k-anonymity equivalence class. + */ + equivalenceClassSize: string; + /** + * Number of distinct sensitive values in this equivalence class. + */ + numDistinctSensitiveValues: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence class. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + /** + * Estimated frequencies of top sensitive values. + */ + topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; + } /** - * When true, excludes type information of the findings. - */ - excludeTypes: boolean; + * Histogram bucket of sensitive value frequencies in the table. + */ + export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + /** + * Total number of records in this bucket. + */ + bucketSize: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyLowerBound: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyUpperBound: string; + } /** - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. + * Result of the l-diversity computation. */ - includeQuote: boolean; + export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { + /** + * Histogram of l-diversity equivalence class sensitive value frequencies. + */ + sensitiveValueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; + } /** - * Configuration of findings limit given for specified info types. + * Compute numerical stats over an individual column, including min, max, and + * quantiles. */ - infoTypeLimits: Schema$GooglePrivacyDlpV2beta1InfoTypeLimit[]; + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are integer, float, + * date, datetime, timestamp, time. + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or found in documentation. Empty - * info_types runs all enabled detectors. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta1InfoType[]; + * Result of the numerical stats computation. + */ + export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { + /** + * Maximum value appearing in the column. + */ + maxValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * Minimum value appearing in the column. + */ + minValue: Schema$GooglePrivacyDlpV2beta1Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; + } /** - * Limits the number of findings per content item or long running operation. - */ - maxFindings: number; + * Cloud repository for storing output. + */ + export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { + /** + * The path to a Google Cloud Storage location to store output. The bucket + * must already exist and the Google APIs service account for DLP must have + * write permission to write to the given bucket. Results are split over + * multiple csv files with each file name matching the pattern + * "[operation_id]_[count].csv", for example + * `3094877188788974909_1.csv`. The `operation_id` matches the identifier + * for the Operation, and the `count` is a counter used for tracking the + * number of files written. The CSV file(s) contain the following columns + * regardless of storage type scanned: - id - info_type - likelihood - byte + * size of finding - quote - timestamp For Cloud Storage the next columns + * are: - file_path - start_offset For Cloud Datastore the next columns + * are: - project_id - namespace_id - path - column_name - offset For + * BigQuery the next columns are: - row_number - project_id - dataset_id - + * table_id + */ + storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; + /** + * Store findings in a new table in the dataset. + */ + table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Only returns findings equal or above this threshold. - */ - minLikelihood: string; -} -/** - * Metadata returned within GetOperation for an inspect request. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationMetadata { + * Datastore partition ID. A partition ID identifies a grouping of entities. + * The grouping is always by project and namespace, however the namespace ID + * may be empty. A partition ID contains several dimensions: project ID and + * namespace ID. + */ + export interface Schema$GooglePrivacyDlpV2beta1PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * The time which this request was started. + * Privacy metric to compute for reidentification risk analysis. */ - createTime: string; - infoTypeStats: Schema$GooglePrivacyDlpV2beta1InfoTypeStatistics[]; + export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { + categoricalStatsConfig: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; + kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; + kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; + lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; + numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; + } /** - * Total size in bytes that were processed. + * A representation of a Datastore property in a projection. */ - processedBytes: string; + export interface Schema$GooglePrivacyDlpV2beta1Projection { + /** + * The property to project. + */ + property: Schema$GooglePrivacyDlpV2beta1PropertyReference; + } /** - * The inspect config used to create the Operation. + * A reference to a property relative to the Datastore kind expressions. */ - requestInspectConfig: Schema$GooglePrivacyDlpV2beta1InspectConfig; + export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { + /** + * The name of the property. If name includes "."s, it may be + * interpreted as a property name path. + */ + name: string; + } /** - * Optional location to store findings. + * A quasi-identifier column has a custom_tag, used to know which column in + * the data corresponds to which column in the statistical model. */ - requestOutputConfig: Schema$GooglePrivacyDlpV2beta1OutputStorageConfig; + export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { + customTag: string; + field: Schema$GooglePrivacyDlpV2beta1FieldId; + } /** - * The storage config used to create the Operation. - */ - requestStorageConfig: Schema$GooglePrivacyDlpV2beta1StorageConfig; + * Metadata returned within the + * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) + * for risk analysis. + */ + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + /** + * The time which this request was started. + */ + createTime: string; + /** + * Privacy metric to compute. + */ + requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; + } /** - * Estimate of the number of bytes to process. + * Result of a risk analysis + * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. */ - totalEstimatedBytes: string; -} -/** - * The operational data. - */ -export interface Schema$GooglePrivacyDlpV2beta1InspectOperationResult { + export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { + categoricalStatsResult: + Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; + kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; + kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; + lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; + numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `inspect/results/{id}`. - */ - name: string; -} -/** - * k-anonymity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityConfig { - /** - * Optional message indicating that each distinct entity_id should not - * contribute to the k-anonymity count more than once per equivalence class. - * If an entity_id appears on several rows with different quasi-identifier - * tuples, it will contribute to each count exactly once. This can lead to - * unexpected results. Consider a table where ID 1 is associated to - * quasi-identifier "foo", ID 2 to "bar", and ID 3 to - * *both* quasi-identifiers "foo" and "bar" (on separate - * rows), and where this ID is used as entity_id. Then, the anonymity value - * associated to ID 3 will be 2, even if it is the only ID to be associated to - * both values "foo" and "bar". - */ - entityId: Schema$GooglePrivacyDlpV2beta1EntityId; - /** - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and repeated - * data types are not supported; however, nested fields are supported so long - * as they are not structs themselves or nested within a repeated field. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; -} -/** - * The set of columns' values that share the same k-anonymity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass { + * Shared message indicating Cloud storage type. + */ + export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + /** + * BigQuery options specification. + */ + bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + /** + * Google Cloud Storage options specification. + */ + cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + /** + * Google Cloud Datastore options specification. + */ + datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; + } /** - * Size of the equivalence class, for example number of rows with the above - * set of values. - */ - equivalenceClassSize: string; + * Message for detecting output from deidentification transformations such as + * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). + * These types of transformations are those that perform pseudonymization, + * thereby producing a "surrogate" as output. This should be used in + * conjunction with a field on the transformation such as + * `surrogate_info_type`. This custom info type does not support the use of + * `detection_rules`. + */ + export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} + /** + * A column with a semantic tag attached. + */ + export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + /** + * A column can be tagged with a custom tag. In this case, the user must + * indicate an auxiliary table that contains statistical information on the + * possible values of this column (below). + */ + customTag: string; + /** + * Identifies the column. [required] + */ + field: Schema$GooglePrivacyDlpV2beta1FieldId; + /** + * If no semantic tag is indicated, we infer the statistical model from the + * distribution of values in the input data + */ + inferred: Schema$GoogleProtobufEmpty; + /** + * A column can be tagged with a InfoType to use the relevant public dataset + * as a statistical model of population, if available. We currently support + * US ZIP codes, region codes, ages and genders. + */ + infoType: Schema$GooglePrivacyDlpV2beta1InfoType; + } /** - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Histogram bucket of equivalence class sizes in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket { + * Set of primitive values supported by the system. Note that for the purposes + * of inspection or transformation, the number of bytes considered to comprise + * a 'Value' is based on its representation as a UTF-8 encoded string. + * For example, if 'integer_value' is set to 123456789, the number of + * bytes would be counted as 9, even though an int64 only holds up to 8 bytes + * of data. + */ + export interface Schema$GooglePrivacyDlpV2beta1Value { + booleanValue: boolean; + dateValue: Schema$GoogleTypeDate; + floatValue: number; + integerValue: string; + stringValue: string; + timestampValue: string; + timeValue: Schema$GoogleTypeTimeOfDay; + } /** - * Total number of records in this bucket. - */ - bucketSize: string; + * A value of a field, including its frequency. + */ + export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + /** + * How many times the value is contained in the field. + */ + count: string; + /** + * A value contained in the field in question. + */ + value: Schema$GooglePrivacyDlpV2beta1Value; + } /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. + * Message defining a list of words or phrases to search for in the data. */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KAnonymityEquivalenceClass[]; + export interface Schema$GooglePrivacyDlpV2beta1WordList { + /** + * Words or phrases defining the dictionary. The dictionary must contain at + * least one phrase and every phrase must contain at least 2 characters that + * are letters or digits. [required] + */ + words: string[]; + } /** - * Lower bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeLowerBound: string; + * A task to execute on the completion of a job. + */ + export interface Schema$GooglePrivacyDlpV2beta2Action { + /** + * Publish a notification to a pubsub topic. + */ + pubSub: Schema$GooglePrivacyDlpV2beta2PublishToPubSub; + /** + * Save resulting findings in a provided location. + */ + saveFindings: Schema$GooglePrivacyDlpV2beta2SaveFindings; + } /** - * Upper bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeUpperBound: string; -} -/** - * Result of the k-anonymity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1KAnonymityResult { + * Result of a risk analysis operation request. + */ + export interface Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskDetails { + categoricalStatsResult: + Schema$GooglePrivacyDlpV2beta2CategoricalStatsResult; + kAnonymityResult: Schema$GooglePrivacyDlpV2beta2KAnonymityResult; + kMapEstimationResult: Schema$GooglePrivacyDlpV2beta2KMapEstimationResult; + lDiversityResult: Schema$GooglePrivacyDlpV2beta2LDiversityResult; + numericalStatsResult: Schema$GooglePrivacyDlpV2beta2NumericalStatsResult; + /** + * Privacy metric to compute. + */ + requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta2PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + requestedSourceTable: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } /** - * Histogram of k-anonymity equivalence classes. - */ - equivalenceClassHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1KAnonymityHistogramBucket[]; -} -/** - * A representation of a Datastore kind. - */ -export interface Schema$GooglePrivacyDlpV2beta1KindExpression { + * Request for creating a risk analysis DlpJob. + */ + export interface Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskRequest { + /** + * Configuration for this risk analysis job. + */ + jobConfig: Schema$GooglePrivacyDlpV2beta2RiskAnalysisJobConfig; + /** + * Optional job ID to use for the created job. If not provided, a job ID + * will automatically be generated. Must be unique within the project. The + * job ID can contain uppercase and lowercase letters, numbers, and hyphens; + * that is, it must match the regular expression: `[a-zA-Z\\d-]+`. The + * maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + jobId: string; + } /** - * The name of the kind. - */ - name: string; -} -/** - * Reidentifiability metric. This corresponds to a risk model similar to what is - * called "journalist risk" in the literature, except the attack - * dataset is statistically modeled instead of being perfectly known. This can - * be done using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig { + * An auxiliary table contains statistical information on the relative + * frequency of different quasi-identifiers values. It has one or several + * quasi-identifiers columns, and one column that indicates the relative + * frequency of each quasi-identifier tuple. If a tuple is present in the data + * but not in the auxiliary table, the corresponding relative frequency is + * assumed to be zero (and thus, the tuple is highly reidentifiable). + */ + export interface Schema$GooglePrivacyDlpV2beta2AuxiliaryTable { + /** + * Quasi-identifier columns. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta2QuasiIdField[]; + /** + * The relative frequency column must contain a floating-point number + * between 0 and 1 (inclusive). Null values are assumed to be zero. + * [required] + */ + relativeFrequency: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * Auxiliary table location. [required] + */ + table: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } /** - * Several auxiliary tables can be used in the analysis. Each custom_tag used - * to tag a quasi-identifiers column must appear in exactly one column of one - * auxiliary table. - */ - auxiliaryTables: Schema$GooglePrivacyDlpV2beta1AuxiliaryTable[]; + * Row key for identifying a record in BigQuery table. + */ + export interface Schema$GooglePrivacyDlpV2beta2BigQueryKey { + /** + * Absolute number of the row from the beginning of the table at the time of + * scanning. + */ + rowNumber: string; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } /** - * Fields considered to be quasi-identifiers. No two columns can have the same - * tag. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta1TaggedField[]; + * Options defining BigQuery table and row identifiers. + */ + export interface Schema$GooglePrivacyDlpV2beta2BigQueryOptions { + /** + * References to fields uniquely identifying rows within the table. Nested + * fields in the format, like `person.birthdate.year`, are allowed. + */ + identifyingFields: Schema$GooglePrivacyDlpV2beta2FieldId[]; + /** + * Complete BigQuery table reference. + */ + tableReference: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } /** - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. Required - * if no column is tagged with a region-specific InfoType (like US_ZIP_5) or a - * region code. - */ - regionCode: string; -} -/** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 - * records whose quasi-identifier values correspond to 3, 4 or 5 people in the - * overlying population. An important particular case is when min_anonymity = - * max_anonymity = 1: the frequency field then corresponds to the number of - * uniquely identifiable records. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket { + * Message defining the location of a BigQuery table. A table is uniquely + * identified by its project_id, dataset_id, and table_name. Within a query a + * table is often referenced with a string in the format of: + * `<project_id>:<dataset_id>.<table_id>` or + * `<project_id>.<dataset_id>.<table_id>`. + */ + export interface Schema$GooglePrivacyDlpV2beta2BigQueryTable { + /** + * Dataset ID of the table. + */ + datasetId: string; + /** + * The Google Cloud Platform project ID of the project containing the table. + * If omitted, project ID is inferred from the API call. + */ + projectId: string; + /** + * Name of the table. + */ + tableId: string; + } /** - * Number of records within these anonymity bounds. - */ - bucketSize: string; + * Bucket is represented as a range, along with replacement values. + */ + export interface Schema$GooglePrivacyDlpV2beta2Bucket { + /** + * Upper bound of the range, exclusive; type must match min. + */ + max: Schema$GooglePrivacyDlpV2beta2Value; + /** + * Lower bound of the range, inclusive. Type should be the same as max if + * used. + */ + min: Schema$GooglePrivacyDlpV2beta2Value; + /** + * Replacement value for this bucket. If not provided the default behavior + * will be to hyphenate the min-max range. + */ + replacementValue: Schema$GooglePrivacyDlpV2beta2Value; + } /** - * Sample of quasi-identifier tuple values in this bucket. The total number of - * classes returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues[]; + * Generalization function that buckets values based on ranges. The ranges and + * replacement values are dynamically provided by the user for custom + * behavior, such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This + * can be used on data of type: number, long, string, timestamp. If the bound + * `Value` type differs from the type of data being transformed, we will first + * attempt converting the type of the data to be transformed to match the type + * of the bound before comparing. + */ + export interface Schema$GooglePrivacyDlpV2beta2BucketingConfig { + /** + * Set of buckets. Ranges must be non-overlapping. + */ + buckets: Schema$GooglePrivacyDlpV2beta2Bucket[]; + } /** - * Always greater than or equal to min_anonymity. + * The request message for canceling a DLP job. */ - maxAnonymity: string; + export interface Schema$GooglePrivacyDlpV2beta2CancelDlpJobRequest {} /** - * Always positive. + * Compute numerical stats over an individual column, including number of + * distinct values and value count distribution. */ - minAnonymity: string; -} -/** - * A tuple of values for the quasi-identifier columns. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationQuasiIdValues { + export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsConfig { + /** + * Field to compute categorical stats on. All column types are supported + * except for arrays and structs. However, it may be more informative to use + * NumericalStats when the field type is supported, depending on the data. + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + } + export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsHistogramBucket { + /** + * Total number of values in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct values in this bucket. + */ + bucketValueCount: string; + /** + * Sample of value frequencies in this bucket. The total number of values + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta2ValueFrequency[]; + /** + * Lower bound on the value frequency of the values in this bucket. + */ + valueFrequencyLowerBound: string; + /** + * Upper bound on the value frequency of the values in this bucket. + */ + valueFrequencyUpperBound: string; + } /** - * The estimated anonymity for these quasi-identifier values. + * Result of the categorical stats computation. */ - estimatedAnonymity: string; + export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsResult { + /** + * Histogram of value frequencies in the column. + */ + valueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta2CategoricalStatsHistogramBucket[]; + } /** - * The quasi-identifier values. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - */ -export interface Schema$GooglePrivacyDlpV2beta1KMapEstimationResult { - /** - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: {min_anonymity: 1, - * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, - * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} mean - * that there are no record with an estimated anonymity of 4, 5, or larger - * than 10. - */ - kMapEstimationHistogram: - Schema$GooglePrivacyDlpV2beta1KMapEstimationHistogramBucket[]; -} -/** - * l-diversity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityConfig { + * Partially mask a string by replacing a given number of characters with a + * fixed character. Masking can start from the beginning or end of the string. + * This can be used on data of any type (numbers, longs, and so on) and when + * de-identifying structured data we'll attempt to preserve the original + * data's type. (This allows you to take a long like 123 and modify it to + * a string like **3. + */ + export interface Schema$GooglePrivacyDlpV2beta2CharacterMaskConfig { + /** + * When masking a string, items in this list will be skipped when replacing. + * For example, if your string is 555-555-5555 and you ask us to skip `-` + * and mask 5 chars with * we would produce ***-*55-5555. + */ + charactersToIgnore: Schema$GooglePrivacyDlpV2beta2CharsToIgnore[]; + /** + * Character to mask the sensitive values&mdash;for example, + * "*" for an alphabetic string such as name, or "0" for + * a numeric string such as ZIP code or credit card number. String must have + * length 1. If not supplied, we will default to "*" for strings, + * 0 for digits. + */ + maskingCharacter: string; + /** + * Number of characters to mask. If not set, all matching chars will be + * masked. Skipped characters do not count towards this tally. + */ + numberToMask: number; + /** + * Mask characters in reverse order. For example, if `masking_character` is + * '0', number_to_mask is 14, and `reverse_order` is false, then + * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is + * '*', `number_to_mask` is 3, and `reverse_order` is true, then + * 12345 -> 12*** + */ + reverseOrder: boolean; + } /** - * Set of quasi-identifiers indicating how equivalence classes are defined for - * the l-diversity computation. When multiple fields are specified, they are - * considered a single composite key. + * Characters to skip when doing deidentification of a value. These will be + * left alone and skipped. */ - quasiIds: Schema$GooglePrivacyDlpV2beta1FieldId[]; + export interface Schema$GooglePrivacyDlpV2beta2CharsToIgnore { + charactersToSkip: string; + commonCharactersToIgnore: string; + } /** - * Sensitive field for computing the l-value. - */ - sensitiveAttribute: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * The set of columns' values that share the same l-diversity value. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass { + * Record key for a finding in a Cloud Storage file. + */ + export interface Schema$GooglePrivacyDlpV2beta2CloudStorageKey { + /** + * Path to the file. + */ + filePath: string; + /** + * Byte offset of the referenced data in the file. + */ + startOffset: string; + } /** - * Size of the k-anonymity equivalence class. + * Options defining a file or a set of files (path ending with *) within a + * Google Cloud Storage bucket. */ - equivalenceClassSize: string; + export interface Schema$GooglePrivacyDlpV2beta2CloudStorageOptions { + /** + * Max number of bytes to scan from a file. If a scanned file's size is + * bigger than this value then the rest of the bytes are omitted. + */ + bytesLimitPerFile: string; + fileSet: Schema$GooglePrivacyDlpV2beta2FileSet; + } /** - * Number of distinct sensitive values in this equivalence class. - */ - numDistinctSensitiveValues: string; + * Represents a color in the RGB color space. + */ + export interface Schema$GooglePrivacyDlpV2beta2Color { + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * Quasi-identifier values defining the k-anonymity equivalence class. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta1Value[]; + * The field type of `value` and `field` do not need to match to be considered + * equal, but not all comparisons are possible. A `value` of type: - + * `string` can be compared against all other types - `boolean` can only be + * compared against other booleans - `integer` can be compared against doubles + * or a string if the string value can be parsed as an integer. - `double` can + * be compared against integers or a string if the string can be parsed as a + * double. - `Timestamp` can be compared against strings in RFC 3339 date + * string format. - `TimeOfDay` can be compared against timestamps and strings + * in the format of 'HH:mm:ss'. If we fail to compare do to type + * mismatch, a warning will be given and the condition will evaluate to false. + */ + export interface Schema$GooglePrivacyDlpV2beta2Condition { + /** + * Field within the record this condition is evaluated against. [required] + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * Operator used to compare the field or infoType to the value. [required] + */ + operator: string; + /** + * Value to compare against. [Required, except for `EXISTS` tests.] + */ + value: Schema$GooglePrivacyDlpV2beta2Value; + } /** - * Estimated frequencies of top sensitive values. + * A collection of conditions. */ - topSensitiveValues: Schema$GooglePrivacyDlpV2beta1ValueFrequency[]; -} -/** - * Histogram bucket of sensitive value frequencies in the table. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket { + export interface Schema$GooglePrivacyDlpV2beta2Conditions { + conditions: Schema$GooglePrivacyDlpV2beta2Condition[]; + } /** - * Total number of records in this bucket. - */ - bucketSize: string; + * Container structure for the content to inspect. + */ + export interface Schema$GooglePrivacyDlpV2beta2ContentItem { + /** + * Content data to inspect or redact. + */ + data: string; + /** + * Structured content for inspection. + */ + table: Schema$GooglePrivacyDlpV2beta2Table; + /** + * Type of the content, as defined in Content-Type HTTP header. Supported + * types are: all "text" types, octet streams, PNG images, JPEG + * images. + */ + type: string; + /** + * String data to inspect or redact. + */ + value: string; + } /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta1LDiversityEquivalenceClass[]; + * Request message for CreateDeidentifyTemplate. + */ + export interface Schema$GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest { + /** + * The DeidentifyTemplate to create. + */ + deidentifyTemplate: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate; + /** + * The template id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + templateId: string; + } /** - * Lower bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyLowerBound: string; + * Request message for CreateInspectTemplate. + */ + export interface Schema$GooglePrivacyDlpV2beta2CreateInspectTemplateRequest { + /** + * The InspectTemplate to create. + */ + inspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; + /** + * The template id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + templateId: string; + } /** - * Upper bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyUpperBound: string; -} -/** - * Result of the l-diversity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1LDiversityResult { + * Request message for CreateJobTrigger. + */ + export interface Schema$GooglePrivacyDlpV2beta2CreateJobTriggerRequest { + /** + * The JobTrigger to create. + */ + jobTrigger: Schema$GooglePrivacyDlpV2beta2JobTrigger; + /** + * The trigger id can contain uppercase and lowercase letters, numbers, and + * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. + * The maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + triggerId: string; + } /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - */ - sensitiveValueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta1LDiversityHistogramBucket[]; -} -/** - * Compute numerical stats over an individual column, including min, max, and - * quantiles. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig { + * Pseudonymization method that generates surrogates via cryptographic + * hashing. Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs + * a 32 byte digest as an uppercase hex string (for example, + * 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and integer + * values can be hashed. + */ + export interface Schema$GooglePrivacyDlpV2beta2CryptoHashConfig { + /** + * The key used by the hash function. + */ + cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; + } /** - * Field to compute numerical stats on. Supported types are integer, float, - * date, datetime, timestamp, time. + * This is a data encryption key (DEK) (as opposed to a key encryption key + * (KEK) stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an + * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker + * cannot unwrap the data crypto key. */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Result of the numerical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta1NumericalStatsResult { + export interface Schema$GooglePrivacyDlpV2beta2CryptoKey { + kmsWrapped: Schema$GooglePrivacyDlpV2beta2KmsWrappedCryptoKey; + transient: Schema$GooglePrivacyDlpV2beta2TransientCryptoKey; + unwrapped: Schema$GooglePrivacyDlpV2beta2UnwrappedCryptoKey; + } /** - * Maximum value appearing in the column. - */ - maxValue: Schema$GooglePrivacyDlpV2beta1Value; + * Replaces an identifier with a surrogate using FPE with the FFX mode of + * operation; however when used in the `ReidentifyContent` API method, it + * serves the opposite function by reversing the surrogate back into the + * original identifier. The identifier must be encoded as ASCII. For a given + * crypto key and context, the same identifier will be replaced with the same + * surrogate. Identifiers must be at least two characters long. In the case + * that the identifier is the empty string, it will be skipped. See + * [Pseudonymization](/dlp/docs/pseudonymization) for example usage. + */ + export interface Schema$GooglePrivacyDlpV2beta2CryptoReplaceFfxFpeConfig { + commonAlphabet: string; + /** + * The 'tweak', a context may be used for higher security since the + * same identifier in two different contexts won't be given the same + * surrogate. If the context is not set, a default tweak will be used. If + * the context is set but: 1. there is no record present when transforming + * a given value or 1. the field is not present when transforming a given + * value, a default tweak will be used. Note that case (1) is expected + * when an `InfoTypeTransformation` is applied to both structured and + * non-structured `ContentItem`s. Currently, the referenced field may be of + * value type integer or string. The tweak is constructed as a sequence of + * bytes in big endian byte order such that: - a 64 bit integer is encoded + * followed by a single byte of value 1 - a string is encoded in UTF-8 + * format followed by a single byte of value å 2 + */ + context: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * The key used by the encryption algorithm. [required] + */ + cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; + /** + * This is supported by mapping these to the alphanumeric characters that + * the FFX mode natively supports. This happens before/after + * encryption/decryption. Each character listed must appear only once. + * Number of characters must be in the range [2, 62]. This must be encoded + * as ASCII. The order of characters does not matter. + */ + customAlphabet: string; + /** + * The native way to select the alphabet. Must be in the range [2, 62]. + */ + radix: number; + /** + * The custom infoType to annotate the surrogate with. This annotation will + * be applied to the surrogate by prefixing it with the name of the custom + * infoType followed by the number of characters comprising the surrogate. + * The following scheme defines the format: + * info_type_name(surrogate_character_count):surrogate For example, if the + * name of custom infoType is 'MY_TOKEN_INFO_TYPE' and the surrogate + * is 'abc', the full replacement value will be: + * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the + * surrogate when inspecting content using the custom infoType + * [`SurrogateType`](/dlp/docs/reference/rest/v2beta2/InspectConfig#surrogatetype). + * This facilitates reversal of the surrogate when it occurs in free text. + * In order for inspection to work properly, the name of this infoType must + * not occur naturally anywhere in your data; otherwise, inspection may find + * a surrogate that does not correspond to an actual identifier. Therefore, + * choose your custom infoType name carefully after considering what your + * data looks like. One way to select a name that has a high chance of + * yielding reliable detection is to include one or more unicode characters + * that are highly improbable to exist in your data. For example, assuming + * your data is entered from a regular ASCII keyboard, the symbol with the + * hex code point 29DD might be used like so: ⧝MY_TOKEN_TYPE + */ + surrogateInfoType: Schema$GooglePrivacyDlpV2beta2InfoType; + } /** - * Minimum value appearing in the column. - */ - minValue: Schema$GooglePrivacyDlpV2beta1Value; + * Custom information type provided by the user. Used to find domain-specific + * sensitive information configurable to the data in question. + */ + export interface Schema$GooglePrivacyDlpV2beta2CustomInfoType { + /** + * Set of detection rules to apply to all findings of this custom info type. + * Rules are applied in order that they are specified. Not supported for the + * `surrogate_type` custom info type. + */ + detectionRules: Schema$GooglePrivacyDlpV2beta2DetectionRule[]; + /** + * Dictionary-based custom info type. + */ + dictionary: Schema$GooglePrivacyDlpV2beta2Dictionary; + /** + * Info type configuration. All custom info types must have configurations + * that do not conflict with built-in info types or other custom info types. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + /** + * Likelihood to return for this custom info type. This base value can be + * altered by a detection rule if the finding meets the criteria specified + * by the rule. Defaults to `VERY_LIKELY` if not specified. + */ + likelihood: string; + /** + * Regex-based custom info type. + */ + regex: Schema$GooglePrivacyDlpV2beta2Regex; + /** + * Surrogate info type. + */ + surrogateType: Schema$GooglePrivacyDlpV2beta2SurrogateType; + } /** - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. + * Record key for a finding in Cloud Datastore. */ - quantileValues: Schema$GooglePrivacyDlpV2beta1Value[]; -} -/** - * Cloud repository for storing output. - */ -export interface Schema$GooglePrivacyDlpV2beta1OutputStorageConfig { - /** - * The path to a Google Cloud Storage location to store output. The bucket - * must already exist and the Google APIs service account for DLP must have - * write permission to write to the given bucket. Results are split over - * multiple csv files with each file name matching the pattern - * "[operation_id]_[count].csv", for example - * `3094877188788974909_1.csv`. The `operation_id` matches the identifier for - * the Operation, and the `count` is a counter used for tracking the number of - * files written. The CSV file(s) contain the following columns regardless of - * storage type scanned: - id - info_type - likelihood - byte size of finding - * - quote - timestamp For Cloud Storage the next columns are: - file_path - - * start_offset For Cloud Datastore the next columns are: - project_id - - * namespace_id - path - column_name - offset For BigQuery the next columns - * are: - row_number - project_id - dataset_id - table_id - */ - storagePath: Schema$GooglePrivacyDlpV2beta1CloudStoragePath; - /** - * Store findings in a new table in the dataset. - */ - table: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Datastore partition ID. A partition ID identifies a grouping of entities. The - * grouping is always by project and namespace, however the namespace ID may be - * empty. A partition ID contains several dimensions: project ID and namespace - * ID. - */ -export interface Schema$GooglePrivacyDlpV2beta1PartitionId { + export interface Schema$GooglePrivacyDlpV2beta2DatastoreKey { + /** + * Datastore entity key. + */ + entityKey: Schema$GooglePrivacyDlpV2beta2Key; + } /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; + * Options defining a data set within Google Cloud Datastore. + */ + export interface Schema$GooglePrivacyDlpV2beta2DatastoreOptions { + /** + * The kind to process. + */ + kind: Schema$GooglePrivacyDlpV2beta2KindExpression; + /** + * A partition ID identifies a grouping of entities. The grouping is always + * by project and namespace, however the namespace ID may be empty. + */ + partitionId: Schema$GooglePrivacyDlpV2beta2PartitionId; + } /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * Privacy metric to compute for reidentification risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1PrivacyMetric { - categoricalStatsConfig: Schema$GooglePrivacyDlpV2beta1CategoricalStatsConfig; - kAnonymityConfig: Schema$GooglePrivacyDlpV2beta1KAnonymityConfig; - kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta1KMapEstimationConfig; - lDiversityConfig: Schema$GooglePrivacyDlpV2beta1LDiversityConfig; - numericalStatsConfig: Schema$GooglePrivacyDlpV2beta1NumericalStatsConfig; -} -/** - * A representation of a Datastore property in a projection. - */ -export interface Schema$GooglePrivacyDlpV2beta1Projection { + * Shifts dates by random number of days, with option to be consistent for the + * same context. + */ + export interface Schema$GooglePrivacyDlpV2beta2DateShiftConfig { + /** + * Points to the field that contains the context, for example, an entity id. + * If set, must also set method. If set, shift will be consistent for the + * given context. + */ + context: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * Causes the shift to be computed based on this key and the context. This + * results in the same shift for the same context and crypto_key. + */ + cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; + /** + * For example, -5 means shift date to at most 5 days back in the past. + * [Required] + */ + lowerBoundDays: number; + /** + * Range of shift in days. Actual shift will be selected at random within + * this range (inclusive ends). Negative means shift to earlier in time. + * Must not be more than 365250 days (1000 years) each direction. For + * example, 3 means shift date to at most 3 days into the future. [Required] + */ + upperBoundDays: number; + } /** - * The property to project. - */ - property: Schema$GooglePrivacyDlpV2beta1PropertyReference; -} -/** - * A reference to a property relative to the Datastore kind expressions. - */ -export interface Schema$GooglePrivacyDlpV2beta1PropertyReference { + * Message for a date time object. + */ + export interface Schema$GooglePrivacyDlpV2beta2DateTime { + /** + * One or more of the following must be set. All fields are optional, but + * when set must be valid date or time values. + */ + date: Schema$GoogleTypeDate; + dayOfWeek: string; + time: Schema$GoogleTypeTimeOfDay; + timeZone: Schema$GooglePrivacyDlpV2beta2TimeZone; + } /** - * The name of the property. If name includes "."s, it may be - * interpreted as a property name path. - */ - name: string; -} -/** - * A quasi-identifier column has a custom_tag, used to know which column in the - * data corresponds to which column in the statistical model. - */ -export interface Schema$GooglePrivacyDlpV2beta1QuasiIdField { - customTag: string; - field: Schema$GooglePrivacyDlpV2beta1FieldId; -} -/** - * Metadata returned within the - * [`riskAnalysis.operations.get`](/dlp/docs/reference/rest/v2beta1/riskAnalysis.operations/get) - * for risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationMetadata { + * The configuration that controls how the data will change. + */ + export interface Schema$GooglePrivacyDlpV2beta2DeidentifyConfig { + /** + * Treat the dataset as free-form text and apply the same free text + * transformation everywhere. + */ + infoTypeTransformations: + Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations; + /** + * Treat the dataset as structured. Transformations can be applied to + * specific locations within structured datasets, such as transforming a + * column within a table. + */ + recordTransformations: Schema$GooglePrivacyDlpV2beta2RecordTransformations; + } /** - * The time which this request was started. - */ - createTime: string; + * Request to de-identify a list of items. + */ + export interface Schema$GooglePrivacyDlpV2beta2DeidentifyContentRequest { + /** + * Configuration for the de-identification of the content item. Items + * specified here will override the template referenced by the + * deidentify_template_name argument. + */ + deidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; + /** + * Optional template to use. Any configuration directly specified in + * deidentify_config will override those set in the template. Singular + * fields that are set in this request will replace their corresponding + * fields in the template. Repeated fields are appended. Singular + * sub-messages and groups are recursively merged. + */ + deidentifyTemplateName: string; + /** + * Configuration for the inspector. Items specified here will override the + * template referenced by the inspect_template_name argument. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to de-identify. Will be treated as text. + */ + item: Schema$GooglePrivacyDlpV2beta2ContentItem; + } /** - * Privacy metric to compute. - */ - requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta1PrivacyMetric; + * Results of de-identifying a ContentItem. + */ + export interface Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse { + /** + * The de-identified item. + */ + item: Schema$GooglePrivacyDlpV2beta2ContentItem; + /** + * An overview of the changes that were made on the `item`. + */ + overview: Schema$GooglePrivacyDlpV2beta2TransformationOverview; + } /** - * Input dataset to compute metrics over. - */ - requestedSourceTable: Schema$GooglePrivacyDlpV2beta1BigQueryTable; -} -/** - * Result of a risk analysis - * [`Operation`](/dlp/docs/reference/rest/v2beta1/inspect.operations) request. - */ -export interface Schema$GooglePrivacyDlpV2beta1RiskAnalysisOperationResult { - categoricalStatsResult: Schema$GooglePrivacyDlpV2beta1CategoricalStatsResult; - kAnonymityResult: Schema$GooglePrivacyDlpV2beta1KAnonymityResult; - kMapEstimationResult: Schema$GooglePrivacyDlpV2beta1KMapEstimationResult; - lDiversityResult: Schema$GooglePrivacyDlpV2beta1LDiversityResult; - numericalStatsResult: Schema$GooglePrivacyDlpV2beta1NumericalStatsResult; -} -/** - * Shared message indicating Cloud storage type. - */ -export interface Schema$GooglePrivacyDlpV2beta1StorageConfig { + * The DeidentifyTemplates contains instructions on how to deidentify content. + */ + export interface Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate { + /** + * The creation timestamp of a inspectTemplate, output only field. + */ + createTime: string; + /** + * ///////////// // The core content of the template // /////////////// + */ + deidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; + /** + * Short description (max 256 chars). + */ + description: string; + /** + * Display name (max 256 chars). + */ + displayName: string; + /** + * The template name. Output only. The template will have one of the + * following formats: `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` + * OR `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` + */ + name: string; + /** + * The last update timestamp of a inspectTemplate, output only field. + */ + updateTime: string; + } /** - * BigQuery options specification. + * Rule for modifying a custom info type to alter behavior under certain + * circumstances, depending on the specific details of the rule. Not supported + * for the `surrogate_type` custom info type. */ - bigQueryOptions: Schema$GooglePrivacyDlpV2beta1BigQueryOptions; + export interface Schema$GooglePrivacyDlpV2beta2DetectionRule { + /** + * Hotword-based detection rule. + */ + hotwordRule: Schema$GooglePrivacyDlpV2beta2HotwordRule; + } /** - * Google Cloud Storage options specification. - */ - cloudStorageOptions: Schema$GooglePrivacyDlpV2beta1CloudStorageOptions; + * Custom information type based on a dictionary of words or phrases. This can + * be used to match sensitive information specific to the data, such as a list + * of employee IDs or job titles. Dictionary words are case-insensitive and + * all characters other than letters and digits in the unicode [Basic + * Multilingual + * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) + * will be replaced with whitespace when scanning for matches, so the + * dictionary phrase "Sam Johnson" will match all three phrases + * "sam johnson", "Sam, Johnson", and "Sam + * (Johnson)". Additionally, the characters surrounding any match must be + * of a different type than the adjacent characters within the word, so + * letters must be next to non-letters and digits next to non-digits. For + * example, the dictionary word "jen" will match the first three + * letters of the text "jen123" but will return no matches for + * "jennifer". Dictionary words containing a large number of + * characters that are not letters or digits may result in unexpected findings + * because such characters are treated as whitespace. + */ + export interface Schema$GooglePrivacyDlpV2beta2Dictionary { + /** + * List of words or phrases to search for. + */ + wordList: Schema$GooglePrivacyDlpV2beta2WordList; + } /** - * Google Cloud Datastore options specification. - */ - datastoreOptions: Schema$GooglePrivacyDlpV2beta1DatastoreOptions; -} -/** - * Message for detecting output from deidentification transformations such as - * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). - * These types of transformations are those that perform pseudonymization, - * thereby producing a "surrogate" as output. This should be used in - * conjunction with a field on the transformation such as `surrogate_info_type`. - * This custom info type does not support the use of `detection_rules`. - */ -export interface Schema$GooglePrivacyDlpV2beta1SurrogateType {} -/** - * A column with a semantic tag attached. - */ -export interface Schema$GooglePrivacyDlpV2beta1TaggedField { + * Combines all of the information about a DLP job. + */ + export interface Schema$GooglePrivacyDlpV2beta2DlpJob { + /** + * Time when the job was created. + */ + createTime: string; + /** + * Time when the job finished. + */ + endTime: string; + /** + * A stream of errors encountered running the job. + */ + errorResults: Schema$GoogleRpcStatus[]; + /** + * Results from inspecting a data source. + */ + inspectDetails: Schema$GooglePrivacyDlpV2beta2InspectDataSourceDetails; + /** + * If created by a job trigger, the resource name of the trigger that + * instantiated the job. + */ + jobTriggerName: string; + /** + * The server-assigned name. + */ + name: string; + /** + * Results from analyzing risk of a data source. + */ + riskDetails: Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskDetails; + /** + * Time when the job started. + */ + startTime: string; + /** + * State of a job. + */ + state: string; + /** + * The type of job. + */ + type: string; + } /** - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on the - * possible values of this column (below). - */ - customTag: string; + * An entity in a dataset is a field or set of fields that correspond to a + * single person. For example, in medical records the `EntityId` might be a + * patient identifier, or for financial records it might be an account + * identifier. This message is used when generalizations or analysis must be + * consistent across multiple rows pertaining to the same entity. + */ + export interface Schema$GooglePrivacyDlpV2beta2EntityId { + /** + * Composite key indicating which field contains the entity identifier. + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + } /** - * Identifies the column. [required] + * The results of an unsuccessful activation of the JobTrigger. */ - field: Schema$GooglePrivacyDlpV2beta1FieldId; + export interface Schema$GooglePrivacyDlpV2beta2Error { + details: Schema$GoogleRpcStatus; + /** + * The times the error occurred. + */ + timestamps: string[]; + } /** - * If no semantic tag is indicated, we infer the statistical model from the - * distribution of values in the input data + * An expression, consisting or an operator and conditions. */ - inferred: Schema$GoogleProtobufEmpty; + export interface Schema$GooglePrivacyDlpV2beta2Expressions { + conditions: Schema$GooglePrivacyDlpV2beta2Conditions; + /** + * The operator to apply to the result of conditions. Default and currently + * only supported value is `AND`. + */ + logicalOperator: string; + } /** - * A column can be tagged with a InfoType to use the relevant public dataset - * as a statistical model of population, if available. We currently support US - * ZIP codes, region codes, ages and genders. + * General identifier of a data field in a storage service. */ - infoType: Schema$GooglePrivacyDlpV2beta1InfoType; -} -/** - * Set of primitive values supported by the system. Note that for the purposes - * of inspection or transformation, the number of bytes considered to comprise a - * 'Value' is based on its representation as a UTF-8 encoded string. For - * example, if 'integer_value' is set to 123456789, the number of bytes - * would be counted as 9, even though an int64 only holds up to 8 bytes of data. - */ -export interface Schema$GooglePrivacyDlpV2beta1Value { - booleanValue: boolean; - dateValue: Schema$GoogleTypeDate; - floatValue: number; - integerValue: string; - stringValue: string; - timestampValue: string; - timeValue: Schema$GoogleTypeTimeOfDay; -} -/** - * A value of a field, including its frequency. - */ -export interface Schema$GooglePrivacyDlpV2beta1ValueFrequency { + export interface Schema$GooglePrivacyDlpV2beta2FieldId { + /** + * Name describing the field. + */ + name: string; + } /** - * How many times the value is contained in the field. - */ - count: string; + * The transformation to apply to the field. + */ + export interface Schema$GooglePrivacyDlpV2beta2FieldTransformation { + /** + * Only apply the transformation if the condition evaluates to true for the + * given `RecordCondition`. The conditions are allowed to reference fields + * that are not used in the actual transformation. [optional] Example Use + * Cases: - Apply a different bucket transformation to an age column if the + * zip code column for the same record is within a specific range. - Redact + * a field if the date of birth field is greater than 85. + */ + condition: Schema$GooglePrivacyDlpV2beta2RecordCondition; + /** + * Input field(s) to apply the transformation to. [required] + */ + fields: Schema$GooglePrivacyDlpV2beta2FieldId[]; + /** + * Treat the contents of the field as free text, and selectively transform + * content that matches an `InfoType`. + */ + infoTypeTransformations: + Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations; + /** + * Apply the transformation to the entire field. + */ + primitiveTransformation: + Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; + } /** - * A value contained in the field in question. + * Set of files to scan. */ - value: Schema$GooglePrivacyDlpV2beta1Value; -} -/** - * Message defining a list of words or phrases to search for in the data. - */ -export interface Schema$GooglePrivacyDlpV2beta1WordList { + export interface Schema$GooglePrivacyDlpV2beta2FileSet { + /** + * The url, in the format `gs://<bucket>/<path>`. Trailing + * wildcard in the path is allowed. + */ + url: string; + } /** - * Words or phrases defining the dictionary. The dictionary must contain at - * least one phrase and every phrase must contain at least 2 characters that - * are letters or digits. [required] - */ - words: string[]; -} -/** - * A task to execute on the completion of a job. - */ -export interface Schema$GooglePrivacyDlpV2beta2Action { + * Represents a piece of potentially sensitive content. + */ + export interface Schema$GooglePrivacyDlpV2beta2Finding { + /** + * Timestamp when finding was detected. + */ + createTime: string; + /** + * The type of content that might have been found. Provided if requested by + * the `InspectConfig`. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + /** + * Estimate of how likely it is that the `info_type` is correct. + */ + likelihood: string; + /** + * Where the content was found. + */ + location: Schema$GooglePrivacyDlpV2beta2Location; + /** + * The content that was found. Even if the content is not textual, it may be + * converted to a textual representation here. Provided if requested by the + * `InspectConfig` and the finding is less than or equal to 4096 bytes long. + * If the finding exceeds 4096 bytes in length, the quote may be omitted. + */ + quote: string; + /** + * Contains data parsed from quotes. Only populated if include_quote was set + * to true and a supported infoType was requested. Currently supported + * infoTypes: DATE, DATE_OF_BIRTH and TIME. + */ + quoteInfo: Schema$GooglePrivacyDlpV2beta2QuoteInfo; + } + export interface Schema$GooglePrivacyDlpV2beta2FindingLimits { + /** + * Configuration of findings limit given for specified infoTypes. + */ + maxFindingsPerInfoType: Schema$GooglePrivacyDlpV2beta2InfoTypeLimit[]; + /** + * Max number of findings that will be returned for each item scanned. When + * set within `InspectDataSourceRequest`, the maximum returned is 1000 + * regardless if this is set higher. When set within + * `InspectContentRequest`, this field is ignored. + */ + maxFindingsPerItem: number; + /** + * Max number of findings that will be returned per request/job. When set + * within `InspectContentRequest`, the maximum returned is 1000 regardless + * if this is set higher. + */ + maxFindingsPerRequest: number; + } /** - * Publish a notification to a pubsub topic. - */ - pubSub: Schema$GooglePrivacyDlpV2beta2PublishToPubSub; + * Buckets values based on fixed size ranges. The Bucketing transformation can + * provide all of this functionality, but requires more configuration. This + * message is provided as a convenience to the user for simple bucketing + * strategies. The transformed value will be a hyphenated string of + * <lower_bound>-<upper_bound>, i.e if lower_bound = 10 and + * upper_bound = 20 all values that are within this bucket will be replaced + * with "10-20". This can be used on data of type: double, long. If + * the bound Value type differs from the type of data being transformed, we + * will first attempt converting the type of the data to be transformed to + * match the type of the bound before comparing. + */ + export interface Schema$GooglePrivacyDlpV2beta2FixedSizeBucketingConfig { + /** + * Size of each bucket (except for minimum and maximum buckets). So if + * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the + * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, + * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. + */ + bucketSize: number; + /** + * Lower bound value of buckets. All values less than `lower_bound` are + * grouped together into a single bucket; for example if `lower_bound` = 10, + * then all values less than 10 are replaced with the value “-10”. + * [Required]. + */ + lowerBound: Schema$GooglePrivacyDlpV2beta2Value; + /** + * Upper bound value of buckets. All values greater than upper_bound are + * grouped together into a single bucket; for example if `upper_bound` = 89, + * then all values greater than 89 are replaced with the value “89+”. + * [Required]. + */ + upperBound: Schema$GooglePrivacyDlpV2beta2Value; + } /** - * Save resulting findings in a provided location. - */ - saveFindings: Schema$GooglePrivacyDlpV2beta2SaveFindings; -} -/** - * Result of a risk analysis operation request. - */ -export interface Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskDetails { - categoricalStatsResult: Schema$GooglePrivacyDlpV2beta2CategoricalStatsResult; - kAnonymityResult: Schema$GooglePrivacyDlpV2beta2KAnonymityResult; - kMapEstimationResult: Schema$GooglePrivacyDlpV2beta2KMapEstimationResult; - lDiversityResult: Schema$GooglePrivacyDlpV2beta2LDiversityResult; - numericalStatsResult: Schema$GooglePrivacyDlpV2beta2NumericalStatsResult; + * Detection rule that adjusts the likelihood of findings within a certain + * proximity of hotwords. + */ + export interface Schema$GooglePrivacyDlpV2beta2HotwordRule { + /** + * Regex pattern defining what qualifies as a hotword. + */ + hotwordRegex: Schema$GooglePrivacyDlpV2beta2Regex; + /** + * Likelihood adjustment to apply to all matching findings. + */ + likelihoodAdjustment: Schema$GooglePrivacyDlpV2beta2LikelihoodAdjustment; + /** + * Proximity of the finding within which the entire hotword must reside. The + * total length of the window cannot exceed 1000 characters. Note that the + * finding itself will be included in the window, so that hotwords may be + * used to match substrings of the finding itself. For example, the + * certainty of a phone number regex "\(\d{3}\) \d{3}-\d{4}" could + * be adjusted upwards if the area code is known to be the local area code + * of a company office using the hotword regex "\(xxx\)", where + * "xxx" is the area code in question. + */ + proximity: Schema$GooglePrivacyDlpV2beta2Proximity; + } /** - * Privacy metric to compute. - */ - requestedPrivacyMetric: Schema$GooglePrivacyDlpV2beta2PrivacyMetric; + * Bounding box encompassing detected text within an image. + */ + export interface Schema$GooglePrivacyDlpV2beta2ImageLocation { + /** + * Height of the bounding box in pixels. + */ + height: number; + /** + * Left coordinate of the bounding box. (0,0) is upper left. + */ + left: number; + /** + * Top coordinate of the bounding box. (0,0) is upper left. + */ + top: number; + /** + * Width of the bounding box in pixels. + */ + width: number; + } /** - * Input dataset to compute metrics over. - */ - requestedSourceTable: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -/** - * Request for creating a risk analysis DlpJob. - */ -export interface Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskRequest { + * Configuration for determining how redaction of images should occur. + */ + export interface Schema$GooglePrivacyDlpV2beta2ImageRedactionConfig { + /** + * Only one per info_type should be provided per request. If not specified, + * and redact_all_text is false, the DLP API will redact all text that it + * matches against all info_types that are found, but not specified in + * another ImageRedactionConfig. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + /** + * If true, all text found in the image, regardless whether it matches an + * info_type, is redacted. + */ + redactAllText: boolean; + /** + * The color to use when redacting content from an image. If not specified, + * the default is black. + */ + redactionColor: Schema$GooglePrivacyDlpV2beta2Color; + } /** - * Configuration for this risk analysis job. + * Type of information detected by the API. */ - jobConfig: Schema$GooglePrivacyDlpV2beta2RiskAnalysisJobConfig; + export interface Schema$GooglePrivacyDlpV2beta2InfoType { + /** + * Name of the information type. + */ + name: string; + } /** - * Optional job ID to use for the created job. If not provided, a job ID will - * automatically be generated. Must be unique within the project. The job ID - * can contain uppercase and lowercase letters, numbers, and hyphens; that is, - * it must match the regular expression: `[a-zA-Z\\d-]+`. The maximum length - * is 100 characters. Can be empty to allow the system to generate one. - */ - jobId: string; -} -/** - * An auxiliary table contains statistical information on the relative frequency - * of different quasi-identifiers values. It has one or several - * quasi-identifiers columns, and one column that indicates the relative - * frequency of each quasi-identifier tuple. If a tuple is present in the data - * but not in the auxiliary table, the corresponding relative frequency is - * assumed to be zero (and thus, the tuple is highly reidentifiable). - */ -export interface Schema$GooglePrivacyDlpV2beta2AuxiliaryTable { + * InfoType description. + */ + export interface Schema$GooglePrivacyDlpV2beta2InfoTypeDescription { + /** + * Human readable form of the infoType name. + */ + displayName: string; + /** + * Internal name of the infoType. + */ + name: string; + /** + * Which parts of the API supports this InfoType. + */ + supportedBy: string[]; + } /** - * Quasi-identifier columns. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta2QuasiIdField[]; + * Max findings configuration per infoType, per content item or long running + * DlpJob. + */ + export interface Schema$GooglePrivacyDlpV2beta2InfoTypeLimit { + /** + * Type of information the findings limit applies to. Only one limit per + * info_type should be provided. If InfoTypeLimit does not have an + * info_type, the DLP API applies the limit against all info_types that are + * found but not specified in another InfoTypeLimit. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + /** + * Max findings limit for the given infoType. + */ + maxFindings: number; + } /** - * The relative frequency column must contain a floating-point number between - * 0 and 1 (inclusive). Null values are assumed to be zero. [required] - */ - relativeFrequency: Schema$GooglePrivacyDlpV2beta2FieldId; + * Statistics regarding a specific InfoType. + */ + export interface Schema$GooglePrivacyDlpV2beta2InfoTypeStatistics { + /** + * Number of findings for this infoType. + */ + count: string; + /** + * The type of finding this stat is for. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + } /** - * Auxiliary table location. [required] - */ - table: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -/** - * Row key for identifying a record in BigQuery table. - */ -export interface Schema$GooglePrivacyDlpV2beta2BigQueryKey { + * A transformation to apply to text that is identified as a specific + * info_type. + */ + export interface Schema$GooglePrivacyDlpV2beta2InfoTypeTransformation { + /** + * InfoTypes to apply the transformation to. Empty list will match all + * available infoTypes for this transformation. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta2InfoType[]; + /** + * Primitive transformation to apply to the infoType. [required] + */ + primitiveTransformation: + Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; + } /** - * Absolute number of the row from the beginning of the table at the time of - * scanning. + * A type of transformation that will scan unstructured text and apply various + * `PrimitiveTransformation`s to each finding, where the transformation is + * applied to only values that were identified as a specific info_type. */ - rowNumber: string; + export interface Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations { + /** + * Transformation for each infoType. Cannot specify more than one for a + * given infoType. [required] + */ + transformations: Schema$GooglePrivacyDlpV2beta2InfoTypeTransformation[]; + } /** - * Complete BigQuery table reference. - */ - tableReference: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -/** - * Options defining BigQuery table and row identifiers. - */ -export interface Schema$GooglePrivacyDlpV2beta2BigQueryOptions { + * Configuration description of the scanning process. When used with + * redactContent only info_types and min_likelihood are currently used. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectConfig { + /** + * Custom infoTypes provided by the user. + */ + customInfoTypes: Schema$GooglePrivacyDlpV2beta2CustomInfoType[]; + /** + * When true, excludes type information of the findings. + */ + excludeInfoTypes: boolean; + /** + * When true, a contextual quote from the data that triggered a finding is + * included in the response; see Finding.quote. + */ + includeQuote: boolean; + /** + * Restricts what info_types to look for. The values must correspond to + * InfoType values returned by ListInfoTypes or found in documentation. + * Empty info_types runs all enabled detectors. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta2InfoType[]; + limits: Schema$GooglePrivacyDlpV2beta2FindingLimits; + /** + * Only returns findings equal or above this threshold. The default is + * POSSIBLE. + */ + minLikelihood: string; + } /** - * References to fields uniquely identifying rows within the table. Nested - * fields in the format, like `person.birthdate.year`, are allowed. - */ - identifyingFields: Schema$GooglePrivacyDlpV2beta2FieldId[]; + * Request to search for potentially sensitive info in a ContentItem. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectContentRequest { + /** + * Configuration for the inspector. What specified here will override the + * template referenced by the inspect_template_name argument. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * inspect_config will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to inspect. + */ + item: Schema$GooglePrivacyDlpV2beta2ContentItem; + } /** - * Complete BigQuery table reference. + * Results of inspecting an item. */ - tableReference: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -/** - * Message defining the location of a BigQuery table. A table is uniquely - * identified by its project_id, dataset_id, and table_name. Within a query a - * table is often referenced with a string in the format of: - * `<project_id>:<dataset_id>.<table_id>` or - * `<project_id>.<dataset_id>.<table_id>`. - */ -export interface Schema$GooglePrivacyDlpV2beta2BigQueryTable { + export interface Schema$GooglePrivacyDlpV2beta2InspectContentResponse { + /** + * The findings. + */ + result: Schema$GooglePrivacyDlpV2beta2InspectResult; + } /** - * Dataset ID of the table. - */ - datasetId: string; + * The results of an inspect DataSource job. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectDataSourceDetails { + /** + * The configuration used for this job. + */ + requestedOptions: Schema$GooglePrivacyDlpV2beta2RequestedOptions; + /** + * A summary of the outcome of this inspect job. + */ + result: Schema$GooglePrivacyDlpV2beta2Result; + } /** - * The Google Cloud Platform project ID of the project containing the table. - * If omitted, project ID is inferred from the API call. - */ - projectId: string; + * Request for scheduling a scan of a data subset from a Google Platform data + * repository. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectDataSourceRequest { + /** + * A configuration for the job. + */ + jobConfig: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; + /** + * Optional job ID to use for the created job. If not provided, a job ID + * will automatically be generated. Must be unique within the project. The + * job ID can contain uppercase and lowercase letters, numbers, and hyphens; + * that is, it must match the regular expression: `[a-zA-Z\\d-]+`. The + * maximum length is 100 characters. Can be empty to allow the system to + * generate one. + */ + jobId: string; + } + export interface Schema$GooglePrivacyDlpV2beta2InspectJobConfig { + /** + * Actions to execute at the completion of the job. Are executed in the + * order provided. + */ + actions: Schema$GooglePrivacyDlpV2beta2Action[]; + /** + * How and what to scan for. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + /** + * If provided, will be used as the default for all values in InspectConfig. + * `inspect_config` will be merged into the values persisted as part of the + * template. + */ + inspectTemplateName: string; + /** + * Where to put the findings. + */ + outputConfig: Schema$GooglePrivacyDlpV2beta2OutputStorageConfig; + /** + * The data to scan. + */ + storageConfig: Schema$GooglePrivacyDlpV2beta2StorageConfig; + } /** - * Name of the table. - */ - tableId: string; -} -/** - * Bucket is represented as a range, along with replacement values. - */ -export interface Schema$GooglePrivacyDlpV2beta2Bucket { + * All the findings for a single scanned item. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectResult { + /** + * List of findings for an item. + */ + findings: Schema$GooglePrivacyDlpV2beta2Finding[]; + /** + * If true, then this item might have more findings than were returned, and + * the findings returned are an arbitrary subset of all findings. The + * findings list might be truncated because the input items were too large, + * or because the server reached the maximum amount of resources allowed for + * a single API call. For best results, divide the input into smaller + * batches. + */ + findingsTruncated: boolean; + } /** - * Upper bound of the range, exclusive; type must match min. - */ - max: Schema$GooglePrivacyDlpV2beta2Value; + * The inspectTemplate contains a configuration (set of types of sensitive + * data to be detected) to be used anywhere you otherwise would normally + * specify InspectConfig. + */ + export interface Schema$GooglePrivacyDlpV2beta2InspectTemplate { + /** + * The creation timestamp of a inspectTemplate, output only field. + */ + createTime: string; + /** + * Short description (max 256 chars). + */ + description: string; + /** + * Display name (max 256 chars). + */ + displayName: string; + /** + * The core content of the template. Configuration of the scanning process. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + /** + * The template name. Output only. The template will have one of the + * following formats: `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR + * `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` + */ + name: string; + /** + * The last update timestamp of a inspectTemplate, output only field. + */ + updateTime: string; + } /** - * Lower bound of the range, inclusive. Type should be the same as max if - * used. - */ - min: Schema$GooglePrivacyDlpV2beta2Value; + * Contains a configuration to make dlp api calls on a repeating basis. + */ + export interface Schema$GooglePrivacyDlpV2beta2JobTrigger { + /** + * The creation timestamp of a triggeredJob, output only field. + */ + createTime: string; + /** + * User provided description (max 256 chars) + */ + description: string; + /** + * Display name (max 100 chars) + */ + displayName: string; + /** + * A stream of errors encountered when the trigger was activated. Repeated + * errors may result in the JobTrigger automaticaly being paused. Will + * return the last 100 errors. Whenever the JobTrigger is modified this list + * will be cleared. Output only field. + */ + errors: Schema$GooglePrivacyDlpV2beta2Error[]; + inspectJob: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; + /** + * The timestamp of the last time this trigger executed. + */ + lastRunTime: string; + /** + * Unique resource name for the triggeredJob, assigned by the service when + * the triggeredJob is created, for example + * `projects/dlp-test-project/triggeredJobs/53234423`. + */ + name: string; + /** + * A status for this trigger. [required] + */ + status: string; + /** + * A list of triggers which will be OR'ed together. Only one in the list + * needs to trigger for a job to be started. The list may contain only a + * single Schedule trigger and must have at least one object. + */ + triggers: Schema$GooglePrivacyDlpV2beta2Trigger[]; + /** + * The last update timestamp of a triggeredJob, output only field. + */ + updateTime: string; + } /** - * Replacement value for this bucket. If not provided the default behavior - * will be to hyphenate the min-max range. - */ - replacementValue: Schema$GooglePrivacyDlpV2beta2Value; -} -/** - * Generalization function that buckets values based on ranges. The ranges and - * replacement values are dynamically provided by the user for custom behavior, - * such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This can be used - * on data of type: number, long, string, timestamp. If the bound `Value` type - * differs from the type of data being transformed, we will first attempt - * converting the type of the data to be transformed to match the type of the - * bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2beta2BucketingConfig { + * k-anonymity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta2KAnonymityConfig { + /** + * Optional message indicating that each distinct entity_id should not + * contribute to the k-anonymity count more than once per equivalence class. + * If an entity_id appears on several rows with different quasi-identifier + * tuples, it will contribute to each count exactly once. This can lead to + * unexpected results. Consider a table where ID 1 is associated to + * quasi-identifier "foo", ID 2 to "bar", and ID 3 to + * *both* quasi-identifiers "foo" and "bar" (on separate + * rows), and where this ID is used as entity_id. Then, the anonymity value + * associated to ID 3 will be 2, even if it is the only ID to be associated + * to both values "foo" and "bar". + */ + entityId: Schema$GooglePrivacyDlpV2beta2EntityId; + /** + * Set of fields to compute k-anonymity over. When multiple fields are + * specified, they are considered a single composite key. Structs and + * repeated data types are not supported; however, nested fields are + * supported so long as they are not structs themselves or nested within a + * repeated field. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta2FieldId[]; + } /** - * Set of buckets. Ranges must be non-overlapping. - */ - buckets: Schema$GooglePrivacyDlpV2beta2Bucket[]; -} -/** - * The request message for canceling a DLP job. - */ -export interface Schema$GooglePrivacyDlpV2beta2CancelDlpJobRequest {} -/** - * Compute numerical stats over an individual column, including number of - * distinct values and value count distribution. - */ -export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsConfig { + * The set of columns' values that share the same ldiversity value + */ + export interface Schema$GooglePrivacyDlpV2beta2KAnonymityEquivalenceClass { + /** + * Size of the equivalence class, for example number of rows with the above + * set of values. + */ + equivalenceClassSize: string; + /** + * Set of values defining the equivalence class. One value per + * quasi-identifier column in the original KAnonymity metric message. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; + } + export interface Schema$GooglePrivacyDlpV2beta2KAnonymityHistogramBucket { + /** + * Total number of equivalence classes in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct equivalence classes in this bucket. + */ + bucketValueCount: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta2KAnonymityEquivalenceClass[]; + /** + * Lower bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeLowerBound: string; + /** + * Upper bound on the size of the equivalence classes in this bucket. + */ + equivalenceClassSizeUpperBound: string; + } /** - * Field to compute categorical stats on. All column types are supported - * except for arrays and structs. However, it may be more informative to use - * NumericalStats when the field type is supported, depending on the data. + * Result of the k-anonymity computation. */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; -} -export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsHistogramBucket { + export interface Schema$GooglePrivacyDlpV2beta2KAnonymityResult { + /** + * Histogram of k-anonymity equivalence classes. + */ + equivalenceClassHistogramBuckets: + Schema$GooglePrivacyDlpV2beta2KAnonymityHistogramBucket[]; + } /** - * Total number of values in this bucket. - */ - bucketSize: string; + * A unique identifier for a Datastore entity. If a key's partition ID or + * any of its path kinds or names are reserved/read-only, the key is + * reserved/read-only. A reserved/read-only key is forbidden in certain + * documented contexts. + */ + export interface Schema$GooglePrivacyDlpV2beta2Key { + /** + * Entities are partitioned into subsets, currently identified by a project + * ID and namespace ID. Queries are scoped to a single partition. + */ + partitionId: Schema$GooglePrivacyDlpV2beta2PartitionId; + /** + * The entity path. An entity path consists of one or more elements composed + * of a kind and a string or numerical identifier, which identify entities. + * The first element identifies a _root entity_, the second element + * identifies a _child_ of the root entity, the third element identifies a + * child of the second entity, and so forth. The entities identified by all + * prefixes of the path are called the element's _ancestors_. A path + * can never be empty, and a path can have at most 100 elements. + */ + path: Schema$GooglePrivacyDlpV2beta2PathElement[]; + } /** - * Total number of distinct values in this bucket. + * A representation of a Datastore kind. */ - bucketValueCount: string; + export interface Schema$GooglePrivacyDlpV2beta2KindExpression { + /** + * The name of the kind. + */ + name: string; + } /** - * Sample of value frequencies in this bucket. The total number of values - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta2ValueFrequency[]; + * Reidentifiability metric. This corresponds to a risk model similar to what + * is called "journalist risk" in the literature, except the attack + * dataset is statistically modeled instead of being perfectly known. This can + * be done using publicly available data (like the US Census), or using a + * custom statistical model (indicated as one or several BigQuery tables), or + * by extrapolating from the distribution of values in the input dataset. + */ + export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationConfig { + /** + * Several auxiliary tables can be used in the analysis. Each custom_tag + * used to tag a quasi-identifiers column must appear in exactly one column + * of one auxiliary table. + */ + auxiliaryTables: Schema$GooglePrivacyDlpV2beta2AuxiliaryTable[]; + /** + * Fields considered to be quasi-identifiers. No two columns can have the + * same tag. [required] + */ + quasiIds: Schema$GooglePrivacyDlpV2beta2TaggedField[]; + /** + * ISO 3166-1 alpha-2 region code to use in the statistical modeling. + * Required if no column is tagged with a region-specific InfoType (like + * US_ZIP_5) or a region code. + */ + regionCode: string; + } /** - * Lower bound on the value frequency of the values in this bucket. - */ - valueFrequencyLowerBound: string; + * A KMapEstimationHistogramBucket message with the following values: + * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 + * records whose quasi-identifier values correspond to 3, 4 or 5 people in the + * overlying population. An important particular case is when min_anonymity = + * max_anonymity = 1: the frequency field then corresponds to the number of + * uniquely identifiable records. + */ + export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationHistogramBucket { + /** + * Number of records within these anonymity bounds. + */ + bucketSize: string; + /** + * Total number of distinct quasi-identifier tuple values in this bucket. + */ + bucketValueCount: string; + /** + * Sample of quasi-identifier tuple values in this bucket. The total number + * of classes returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta2KMapEstimationQuasiIdValues[]; + /** + * Always greater than or equal to min_anonymity. + */ + maxAnonymity: string; + /** + * Always positive. + */ + minAnonymity: string; + } /** - * Upper bound on the value frequency of the values in this bucket. - */ - valueFrequencyUpperBound: string; -} -/** - * Result of the categorical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta2CategoricalStatsResult { + * A tuple of values for the quasi-identifier columns. + */ + export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationQuasiIdValues { + /** + * The estimated anonymity for these quasi-identifier values. + */ + estimatedAnonymity: string; + /** + * The quasi-identifier values. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; + } /** - * Histogram of value frequencies in the column. - */ - valueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta2CategoricalStatsHistogramBucket[]; -} -/** - * Partially mask a string by replacing a given number of characters with a - * fixed character. Masking can start from the beginning or end of the string. - * This can be used on data of any type (numbers, longs, and so on) and when - * de-identifying structured data we'll attempt to preserve the original - * data's type. (This allows you to take a long like 123 and modify it to a - * string like **3. - */ -export interface Schema$GooglePrivacyDlpV2beta2CharacterMaskConfig { + * Result of the reidentifiability analysis. Note that these results are an + * estimation, not exact values. + */ + export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationResult { + /** + * The intervals [min_anonymity, max_anonymity] do not overlap. If a value + * doesn't correspond to any such interval, the associated frequency is + * zero. For example, the following records: {min_anonymity: 1, + * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, + * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} + * mean that there are no record with an estimated anonymity of 4, 5, or + * larger than 10. + */ + kMapEstimationHistogram: + Schema$GooglePrivacyDlpV2beta2KMapEstimationHistogramBucket[]; + } /** - * When masking a string, items in this list will be skipped when replacing. - * For example, if your string is 555-555-5555 and you ask us to skip `-` and - * mask 5 chars with * we would produce ***-*55-5555. - */ - charactersToIgnore: Schema$GooglePrivacyDlpV2beta2CharsToIgnore[]; + * Include to use an existing data crypto key wrapped by KMS. Authorization + * requires the following IAM permissions when sending a request to perform a + * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt + */ + export interface Schema$GooglePrivacyDlpV2beta2KmsWrappedCryptoKey { + /** + * The resource name of the KMS CryptoKey to use for unwrapping. [required] + */ + cryptoKeyName: string; + /** + * The wrapped data crypto key. [required] + */ + wrappedKey: string; + } /** - * Character to mask the sensitive values&mdash;for example, "*" - * for an alphabetic string such as name, or "0" for a numeric - * string such as ZIP code or credit card number. String must have length 1. - * If not supplied, we will default to "*" for strings, 0 for - * digits. - */ - maskingCharacter: string; + * l-diversity metric, used for analysis of reidentification risk. + */ + export interface Schema$GooglePrivacyDlpV2beta2LDiversityConfig { + /** + * Set of quasi-identifiers indicating how equivalence classes are defined + * for the l-diversity computation. When multiple fields are specified, they + * are considered a single composite key. + */ + quasiIds: Schema$GooglePrivacyDlpV2beta2FieldId[]; + /** + * Sensitive field for computing the l-value. + */ + sensitiveAttribute: Schema$GooglePrivacyDlpV2beta2FieldId; + } /** - * Number of characters to mask. If not set, all matching chars will be - * masked. Skipped characters do not count towards this tally. - */ - numberToMask: number; + * The set of columns' values that share the same ldiversity value. + */ + export interface Schema$GooglePrivacyDlpV2beta2LDiversityEquivalenceClass { + /** + * Size of the k-anonymity equivalence class. + */ + equivalenceClassSize: string; + /** + * Number of distinct sensitive values in this equivalence class. + */ + numDistinctSensitiveValues: string; + /** + * Quasi-identifier values defining the k-anonymity equivalence class. The + * order is always the same as the original request. + */ + quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; + /** + * Estimated frequencies of top sensitive values. + */ + topSensitiveValues: Schema$GooglePrivacyDlpV2beta2ValueFrequency[]; + } + export interface Schema$GooglePrivacyDlpV2beta2LDiversityHistogramBucket { + /** + * Total number of equivalence classes in this bucket. + */ + bucketSize: string; + /** + * Total number of distinct equivalence classes in this bucket. + */ + bucketValueCount: string; + /** + * Sample of equivalence classes in this bucket. The total number of classes + * returned per bucket is capped at 20. + */ + bucketValues: Schema$GooglePrivacyDlpV2beta2LDiversityEquivalenceClass[]; + /** + * Lower bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyLowerBound: string; + /** + * Upper bound on the sensitive value frequencies of the equivalence classes + * in this bucket. + */ + sensitiveValueFrequencyUpperBound: string; + } /** - * Mask characters in reverse order. For example, if `masking_character` is - * '0', number_to_mask is 14, and `reverse_order` is false, then - * 1234-5678-9012-3456 -> 00000000000000-3456 If `masking_character` is - * '*', `number_to_mask` is 3, and `reverse_order` is true, then 12345 - * -> 12*** + * Result of the l-diversity computation. */ - reverseOrder: boolean; -} -/** - * Characters to skip when doing deidentification of a value. These will be left - * alone and skipped. - */ -export interface Schema$GooglePrivacyDlpV2beta2CharsToIgnore { - charactersToSkip: string; - commonCharactersToIgnore: string; -} -/** - * Record key for a finding in a Cloud Storage file. - */ -export interface Schema$GooglePrivacyDlpV2beta2CloudStorageKey { + export interface Schema$GooglePrivacyDlpV2beta2LDiversityResult { + /** + * Histogram of l-diversity equivalence class sensitive value frequencies. + */ + sensitiveValueFrequencyHistogramBuckets: + Schema$GooglePrivacyDlpV2beta2LDiversityHistogramBucket[]; + } /** - * Path to the file. - */ - filePath: string; + * Message for specifying an adjustment to the likelihood of a finding as part + * of a detection rule. + */ + export interface Schema$GooglePrivacyDlpV2beta2LikelihoodAdjustment { + /** + * Set the likelihood of a finding to a fixed value. + */ + fixedLikelihood: string; + /** + * Increase or decrease the likelihood by the specified number of levels. + * For example, if a finding would be `POSSIBLE` without the detection rule + * and `relative_likelihood` is 1, then it is upgraded to `LIKELY`, while a + * value of -1 would downgrade it to `UNLIKELY`. Likelihood may never drop + * below `VERY_UNLIKELY` or exceed `VERY_LIKELY`, so applying an adjustment + * of 1 followed by an adjustment of -1 when base likelihood is + * `VERY_LIKELY` will result in a final likelihood of `LIKELY`. + */ + relativeLikelihood: number; + } /** - * Byte offset of the referenced data in the file. - */ - startOffset: string; -} -/** - * Options defining a file or a set of files (path ending with *) within a - * Google Cloud Storage bucket. - */ -export interface Schema$GooglePrivacyDlpV2beta2CloudStorageOptions { + * Response message for ListDeidentifyTemplates. + */ + export interface Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse { + /** + * List of deidentify templates, up to page_size in + * ListDeidentifyTemplatesRequest. + */ + deidentifyTemplates: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate[]; + /** + * If the next page is available then the next page token to be used in + * following ListDeidentifyTemplates request. + */ + nextPageToken: string; + } /** - * Max number of bytes to scan from a file. If a scanned file's size is - * bigger than this value then the rest of the bytes are omitted. - */ - bytesLimitPerFile: string; - fileSet: Schema$GooglePrivacyDlpV2beta2FileSet; -} -/** - * Represents a color in the RGB color space. - */ -export interface Schema$GooglePrivacyDlpV2beta2Color { + * The response message for listing DLP jobs. + */ + export interface Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse { + /** + * A list of DlpJobs that matches the specified filter in the request. + */ + jobs: Schema$GooglePrivacyDlpV2beta2DlpJob[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * The amount of blue in the color as a value in the interval [0, 1]. + * Response to the ListInfoTypes request. */ - blue: number; + export interface Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse { + /** + * Set of sensitive infoTypes. + */ + infoTypes: Schema$GooglePrivacyDlpV2beta2InfoTypeDescription[]; + } /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; + * Response message for ListInspectTemplates. + */ + export interface Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse { + /** + * List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. + */ + inspectTemplates: Schema$GooglePrivacyDlpV2beta2InspectTemplate[]; + /** + * If the next page is available then the next page token to be used in + * following ListInspectTemplates request. + */ + nextPageToken: string; + } /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * The field type of `value` and `field` do not need to match to be considered - * equal, but not all comparisons are possible. A `value` of type: - `string` - * can be compared against all other types - `boolean` can only be compared - * against other booleans - `integer` can be compared against doubles or a - * string if the string value can be parsed as an integer. - `double` can be - * compared against integers or a string if the string can be parsed as a - * double. - `Timestamp` can be compared against strings in RFC 3339 date string - * format. - `TimeOfDay` can be compared against timestamps and strings in the - * format of 'HH:mm:ss'. If we fail to compare do to type mismatch, a - * warning will be given and the condition will evaluate to false. - */ -export interface Schema$GooglePrivacyDlpV2beta2Condition { + * Response message for ListJobTriggers. + */ + export interface Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse { + /** + * List of triggeredJobs, up to page_size in ListJobTriggersRequest. + */ + jobTriggers: Schema$GooglePrivacyDlpV2beta2JobTrigger[]; + /** + * If the next page is available then the next page token to be used in + * following ListJobTriggers request. + */ + nextPageToken: string; + } /** - * Field within the record this condition is evaluated against. [required] - */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; + * Specifies the location of the finding. + */ + export interface Schema$GooglePrivacyDlpV2beta2Location { + /** + * Zero-based byte offsets delimiting the finding. These are relative to the + * finding's containing element. Note that when the content is not + * textual, this references the UTF-8 encoded textual representation of the + * content. Omitted if content is an image. + */ + byteRange: Schema$GooglePrivacyDlpV2beta2Range; + /** + * Unicode character offsets delimiting the finding. These are relative to + * the finding's containing element. Provided when the content is text. + */ + codepointRange: Schema$GooglePrivacyDlpV2beta2Range; + /** + * The pointer to the property or cell that contained the finding. Provided + * when the finding's containing element is a cell in a table or a + * property of storage object. + */ + fieldId: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * The area within the image that contained the finding. Provided when the + * content is an image. + */ + imageBoxes: Schema$GooglePrivacyDlpV2beta2ImageLocation[]; + /** + * The pointer to the record in storage that contained the field the finding + * was found in. Provided when the finding's containing element is a + * property of a storage object. + */ + recordKey: Schema$GooglePrivacyDlpV2beta2RecordKey; + /** + * The pointer to the row of the table that contained the finding. Provided + * when the finding's containing element is a cell of a table. + */ + tableLocation: Schema$GooglePrivacyDlpV2beta2TableLocation; + } /** - * Operator used to compare the field or infoType to the value. [required] + * Compute numerical stats over an individual column, including min, max, and + * quantiles. */ - operator: string; + export interface Schema$GooglePrivacyDlpV2beta2NumericalStatsConfig { + /** + * Field to compute numerical stats on. Supported types are integer, float, + * date, datetime, timestamp, time. + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + } /** - * Value to compare against. [Required, except for `EXISTS` tests.] - */ - value: Schema$GooglePrivacyDlpV2beta2Value; -} -/** - * A collection of conditions. - */ -export interface Schema$GooglePrivacyDlpV2beta2Conditions { - conditions: Schema$GooglePrivacyDlpV2beta2Condition[]; -} -/** - * Container structure for the content to inspect. - */ -export interface Schema$GooglePrivacyDlpV2beta2ContentItem { + * Result of the numerical stats computation. + */ + export interface Schema$GooglePrivacyDlpV2beta2NumericalStatsResult { + /** + * Maximum value appearing in the column. + */ + maxValue: Schema$GooglePrivacyDlpV2beta2Value; + /** + * Minimum value appearing in the column. + */ + minValue: Schema$GooglePrivacyDlpV2beta2Value; + /** + * List of 99 values that partition the set of field values into 100 equal + * sized buckets. + */ + quantileValues: Schema$GooglePrivacyDlpV2beta2Value[]; + } /** - * Content data to inspect or redact. - */ - data: string; + * Cloud repository for storing output. + */ + export interface Schema$GooglePrivacyDlpV2beta2OutputStorageConfig { + /** + * Schema used for writing the findings. Columns are derived from the + * `Finding` object. If appending to an existing table, any columns from the + * predefined schema that are missing will be added. No columns in the + * existing table will be deleted. If unspecified, then all available + * columns will be used for a new table, and no changes will be made to an + * existing table. + */ + outputSchema: string; + /** + * Store findings in an existing table or a new table in an existing + * dataset. Each column in an existing table must have the same name, type, + * and mode of a field in the `Finding` object. If table_id is not set a new + * one will be generated for you with the following format: + * dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for + * generating the date details. + */ + table: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } /** - * Structured content for inspection. - */ - table: Schema$GooglePrivacyDlpV2beta2Table; + * Datastore partition ID. A partition ID identifies a grouping of entities. + * The grouping is always by project and namespace, however the namespace ID + * may be empty. A partition ID contains several dimensions: project ID and + * namespace ID. + */ + export interface Schema$GooglePrivacyDlpV2beta2PartitionId { + /** + * If not empty, the ID of the namespace to which the entities belong. + */ + namespaceId: string; + /** + * The ID of the project to which the entities belong. + */ + projectId: string; + } /** - * Type of the content, as defined in Content-Type HTTP header. Supported - * types are: all "text" types, octet streams, PNG images, JPEG - * images. - */ - type: string; + * A (kind, ID/name) pair used to construct a key path. If either name or ID + * is set, the element is complete. If neither is set, the element is + * incomplete. + */ + export interface Schema$GooglePrivacyDlpV2beta2PathElement { + /** + * The auto-allocated ID of the entity. Never equal to zero. Values less + * than zero are discouraged and may not be supported in the future. + */ + id: string; + /** + * The kind of the entity. A kind matching regex `__.*__` is + * reserved/read-only. A kind must not contain more than 1500 bytes when + * UTF-8 encoded. Cannot be `""`. + */ + kind: string; + /** + * The name of the entity. A name matching regex `__.*__` is + * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 + * encoded. Cannot be `""`. + */ + name: string; + } /** - * String data to inspect or redact. - */ - value: string; -} -/** - * Request message for CreateDeidentifyTemplate. - */ -export interface Schema$GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest { + * A rule for transforming a value. + */ + export interface Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation { + bucketingConfig: Schema$GooglePrivacyDlpV2beta2BucketingConfig; + characterMaskConfig: Schema$GooglePrivacyDlpV2beta2CharacterMaskConfig; + cryptoHashConfig: Schema$GooglePrivacyDlpV2beta2CryptoHashConfig; + cryptoReplaceFfxFpeConfig: + Schema$GooglePrivacyDlpV2beta2CryptoReplaceFfxFpeConfig; + dateShiftConfig: Schema$GooglePrivacyDlpV2beta2DateShiftConfig; + fixedSizeBucketingConfig: + Schema$GooglePrivacyDlpV2beta2FixedSizeBucketingConfig; + redactConfig: Schema$GooglePrivacyDlpV2beta2RedactConfig; + replaceConfig: Schema$GooglePrivacyDlpV2beta2ReplaceValueConfig; + replaceWithInfoTypeConfig: + Schema$GooglePrivacyDlpV2beta2ReplaceWithInfoTypeConfig; + timePartConfig: Schema$GooglePrivacyDlpV2beta2TimePartConfig; + } /** - * The DeidentifyTemplate to create. + * Privacy metric to compute for reidentification risk analysis. */ - deidentifyTemplate: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate; + export interface Schema$GooglePrivacyDlpV2beta2PrivacyMetric { + categoricalStatsConfig: + Schema$GooglePrivacyDlpV2beta2CategoricalStatsConfig; + kAnonymityConfig: Schema$GooglePrivacyDlpV2beta2KAnonymityConfig; + kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta2KMapEstimationConfig; + lDiversityConfig: Schema$GooglePrivacyDlpV2beta2LDiversityConfig; + numericalStatsConfig: Schema$GooglePrivacyDlpV2beta2NumericalStatsConfig; + } /** - * The template id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. - */ - templateId: string; -} -/** - * Request message for CreateInspectTemplate. - */ -export interface Schema$GooglePrivacyDlpV2beta2CreateInspectTemplateRequest { + * Message for specifying a window around a finding to apply a detection rule. + */ + export interface Schema$GooglePrivacyDlpV2beta2Proximity { + /** + * Number of characters after the finding to consider. + */ + windowAfter: number; + /** + * Number of characters before the finding to consider. + */ + windowBefore: number; + } /** - * The InspectTemplate to create. - */ - inspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; + * Publish the results of a DlpJob to a pub sub channel. Compatible with: + * Inpect, Risk + */ + export interface Schema$GooglePrivacyDlpV2beta2PublishToPubSub { + /** + * Cloud Pub/Sub topic to send notifications to. The topic must have given + * publishing access rights to the DLP API service account executing the + * long running DlpJob sending the notifications. Format is + * projects/{project}/topics/{topic}. + */ + topic: string; + } /** - * The template id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. + * A quasi-identifier column has a custom_tag, used to know which column in + * the data corresponds to which column in the statistical model. */ - templateId: string; -} -/** - * Request message for CreateJobTrigger. - */ -export interface Schema$GooglePrivacyDlpV2beta2CreateJobTriggerRequest { + export interface Schema$GooglePrivacyDlpV2beta2QuasiIdField { + customTag: string; + field: Schema$GooglePrivacyDlpV2beta2FieldId; + } /** - * The JobTrigger to create. + * Message for infoType-dependent details parsed from quote. */ - jobTrigger: Schema$GooglePrivacyDlpV2beta2JobTrigger; + export interface Schema$GooglePrivacyDlpV2beta2QuoteInfo { + dateTime: Schema$GooglePrivacyDlpV2beta2DateTime; + } /** - * The trigger id can contain uppercase and lowercase letters, numbers, and - * hyphens; that is, it must match the regular expression: `[a-zA-Z\\d-]+`. - * The maximum length is 100 characters. Can be empty to allow the system to - * generate one. - */ - triggerId: string; -} -/** - * Pseudonymization method that generates surrogates via cryptographic hashing. - * Uses SHA-256. The key size must be either 32 or 64 bytes. Outputs a 32 byte - * digest as an uppercase hex string (for example, - * 41D1567F7F99F1DC2A5FAB886DEE5BEE). Currently, only string and integer values - * can be hashed. - */ -export interface Schema$GooglePrivacyDlpV2beta2CryptoHashConfig { + * Generic half-open interval [start, end) + */ + export interface Schema$GooglePrivacyDlpV2beta2Range { + /** + * Index of the last character of the range (exclusive). + */ + end: string; + /** + * Index of the first character of the range (inclusive). + */ + start: string; + } /** - * The key used by the hash function. + * A condition for determining whether a transformation should be applied to a + * field. */ - cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; -} -/** - * This is a data encryption key (DEK) (as opposed to a key encryption key (KEK) - * stored by KMS). When using KMS to wrap/unwrap DEKs, be sure to set an - * appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an attacker - * cannot unwrap the data crypto key. - */ -export interface Schema$GooglePrivacyDlpV2beta2CryptoKey { - kmsWrapped: Schema$GooglePrivacyDlpV2beta2KmsWrappedCryptoKey; - transient: Schema$GooglePrivacyDlpV2beta2TransientCryptoKey; - unwrapped: Schema$GooglePrivacyDlpV2beta2UnwrappedCryptoKey; -} -/** - * Replaces an identifier with a surrogate using FPE with the FFX mode of - * operation; however when used in the `ReidentifyContent` API method, it serves - * the opposite function by reversing the surrogate back into the original - * identifier. The identifier must be encoded as ASCII. For a given crypto key - * and context, the same identifier will be replaced with the same surrogate. - * Identifiers must be at least two characters long. In the case that the - * identifier is the empty string, it will be skipped. See - * [Pseudonymization](/dlp/docs/pseudonymization) for example usage. - */ -export interface Schema$GooglePrivacyDlpV2beta2CryptoReplaceFfxFpeConfig { - commonAlphabet: string; - /** - * The 'tweak', a context may be used for higher security since the - * same identifier in two different contexts won't be given the same - * surrogate. If the context is not set, a default tweak will be used. If the - * context is set but: 1. there is no record present when transforming a - * given value or 1. the field is not present when transforming a given value, - * a default tweak will be used. Note that case (1) is expected when an - * `InfoTypeTransformation` is applied to both structured and non-structured - * `ContentItem`s. Currently, the referenced field may be of value type - * integer or string. The tweak is constructed as a sequence of bytes in big - * endian byte order such that: - a 64 bit integer is encoded followed by a - * single byte of value 1 - a string is encoded in UTF-8 format followed by a - * single byte of value å 2 - */ - context: Schema$GooglePrivacyDlpV2beta2FieldId; - /** - * The key used by the encryption algorithm. [required] - */ - cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; - /** - * This is supported by mapping these to the alphanumeric characters that the - * FFX mode natively supports. This happens before/after - * encryption/decryption. Each character listed must appear only once. Number - * of characters must be in the range [2, 62]. This must be encoded as ASCII. - * The order of characters does not matter. - */ - customAlphabet: string; - /** - * The native way to select the alphabet. Must be in the range [2, 62]. - */ - radix: number; - /** - * The custom infoType to annotate the surrogate with. This annotation will be - * applied to the surrogate by prefixing it with the name of the custom - * infoType followed by the number of characters comprising the surrogate. The - * following scheme defines the format: - * info_type_name(surrogate_character_count):surrogate For example, if the - * name of custom infoType is 'MY_TOKEN_INFO_TYPE' and the surrogate - * is 'abc', the full replacement value will be: - * 'MY_TOKEN_INFO_TYPE(3):abc' This annotation identifies the - * surrogate when inspecting content using the custom infoType - * [`SurrogateType`](/dlp/docs/reference/rest/v2beta2/InspectConfig#surrogatetype). - * This facilitates reversal of the surrogate when it occurs in free text. In - * order for inspection to work properly, the name of this infoType must not - * occur naturally anywhere in your data; otherwise, inspection may find a - * surrogate that does not correspond to an actual identifier. Therefore, - * choose your custom infoType name carefully after considering what your data - * looks like. One way to select a name that has a high chance of yielding - * reliable detection is to include one or more unicode characters that are - * highly improbable to exist in your data. For example, assuming your data is - * entered from a regular ASCII keyboard, the symbol with the hex code point - * 29DD might be used like so: ⧝MY_TOKEN_TYPE - */ - surrogateInfoType: Schema$GooglePrivacyDlpV2beta2InfoType; -} -/** - * Custom information type provided by the user. Used to find domain-specific - * sensitive information configurable to the data in question. - */ -export interface Schema$GooglePrivacyDlpV2beta2CustomInfoType { + export interface Schema$GooglePrivacyDlpV2beta2RecordCondition { + /** + * An expression. + */ + expressions: Schema$GooglePrivacyDlpV2beta2Expressions; + } /** - * Set of detection rules to apply to all findings of this custom info type. - * Rules are applied in order that they are specified. Not supported for the - * `surrogate_type` custom info type. + * Message for a unique key indicating a record that contains a finding. */ - detectionRules: Schema$GooglePrivacyDlpV2beta2DetectionRule[]; + export interface Schema$GooglePrivacyDlpV2beta2RecordKey { + bigQueryKey: Schema$GooglePrivacyDlpV2beta2BigQueryKey; + cloudStorageKey: Schema$GooglePrivacyDlpV2beta2CloudStorageKey; + datastoreKey: Schema$GooglePrivacyDlpV2beta2DatastoreKey; + } /** - * Dictionary-based custom info type. + * Configuration to suppress records whose suppression conditions evaluate to + * true. */ - dictionary: Schema$GooglePrivacyDlpV2beta2Dictionary; + export interface Schema$GooglePrivacyDlpV2beta2RecordSuppression { + /** + * A condition that when it evaluates to true will result in the record + * being evaluated to be suppressed from the transformed content. + */ + condition: Schema$GooglePrivacyDlpV2beta2RecordCondition; + } /** - * Info type configuration. All custom info types must have configurations - * that do not conflict with built-in info types or other custom info types. + * A type of transformation that is applied over structured data such as a + * table. */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + export interface Schema$GooglePrivacyDlpV2beta2RecordTransformations { + /** + * Transform the record by applying various field transformations. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2beta2FieldTransformation[]; + /** + * Configuration defining which records get suppressed entirely. Records + * that match any suppression rule are omitted from the output [optional]. + */ + recordSuppressions: Schema$GooglePrivacyDlpV2beta2RecordSuppression[]; + } /** - * Likelihood to return for this custom info type. This base value can be - * altered by a detection rule if the finding meets the criteria specified by - * the rule. Defaults to `VERY_LIKELY` if not specified. - */ - likelihood: string; + * Redact a given value. For example, if used with an `InfoTypeTransformation` + * transforming PHONE_NUMBER, and input 'My phone number is + * 206-555-0123', the output would be 'My phone number is '. + */ + export interface Schema$GooglePrivacyDlpV2beta2RedactConfig {} + /** + * Request to search for potentially sensitive info in a list of items and + * replace it with a default or provided content. + */ + export interface Schema$GooglePrivacyDlpV2beta2RedactImageRequest { + /** + * The bytes of the image to redact. + */ + imageData: string; + /** + * The configuration for specifying what content to redact from images. + */ + imageRedactionConfigs: Schema$GooglePrivacyDlpV2beta2ImageRedactionConfig[]; + /** + * Type of the content, as defined in Content-Type HTTP header. Supported + * types are: PNG, JPEG, SVG, & BMP. + */ + imageType: string; + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + } /** - * Regex-based custom info type. - */ - regex: Schema$GooglePrivacyDlpV2beta2Regex; + * Results of redacting an image. + */ + export interface Schema$GooglePrivacyDlpV2beta2RedactImageResponse { + /** + * If an image was being inspected and the InspectConfig's include_quote + * was set to true, then this field will include all text, if any, that was + * found in the image. + */ + extractedText: string; + /** + * The redacted image. The type will be the same as the original image. + */ + redactedImage: string; + } /** - * Surrogate info type. + * Message defining a custom regular expression. */ - surrogateType: Schema$GooglePrivacyDlpV2beta2SurrogateType; -} -/** - * Record key for a finding in Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta2DatastoreKey { + export interface Schema$GooglePrivacyDlpV2beta2Regex { + /** + * Pattern defining the regular expression. + */ + pattern: string; + } /** - * Datastore entity key. - */ - entityKey: Schema$GooglePrivacyDlpV2beta2Key; -} -/** - * Options defining a data set within Google Cloud Datastore. - */ -export interface Schema$GooglePrivacyDlpV2beta2DatastoreOptions { + * Request to re-identify an item. + */ + export interface Schema$GooglePrivacyDlpV2beta2ReidentifyContentRequest { + /** + * Configuration for the inspector. + */ + inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; + /** + * Optional template to use. Any configuration directly specified in + * `inspect_config` will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + inspectTemplateName: string; + /** + * The item to re-identify. Will be treated as text. + */ + item: Schema$GooglePrivacyDlpV2beta2ContentItem; + /** + * Configuration for the re-identification of the content item. This field + * shares the same proto message type that is used for de-identification, + * however its usage here is for the reversal of the previous + * de-identification. Re-identification is performed by examining the + * transformations used to de-identify the items and executing the reverse. + * This requires that only reversible transformations be provided here. The + * reversible transformations are: - `CryptoReplaceFfxFpeConfig` + */ + reidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; + /** + * Optional template to use. References an instance of `DeidentifyTemplate`. + * Any configuration directly specified in `reidentify_config` or + * `inspect_config` will override those set in the template. Singular fields + * that are set in this request will replace their corresponding fields in + * the template. Repeated fields are appended. Singular sub-messages and + * groups are recursively merged. + */ + reidentifyTemplateName: string; + } /** - * The kind to process. - */ - kind: Schema$GooglePrivacyDlpV2beta2KindExpression; + * Results of re-identifying a item. + */ + export interface Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse { + /** + * The re-identified item. + */ + item: Schema$GooglePrivacyDlpV2beta2ContentItem; + /** + * An overview of the changes that were made to the `item`. + */ + overview: Schema$GooglePrivacyDlpV2beta2TransformationOverview; + } /** - * A partition ID identifies a grouping of entities. The grouping is always by - * project and namespace, however the namespace ID may be empty. + * Replace each input value with a given `Value`. */ - partitionId: Schema$GooglePrivacyDlpV2beta2PartitionId; -} -/** - * Shifts dates by random number of days, with option to be consistent for the - * same context. - */ -export interface Schema$GooglePrivacyDlpV2beta2DateShiftConfig { + export interface Schema$GooglePrivacyDlpV2beta2ReplaceValueConfig { + /** + * Value to replace it with. + */ + newValue: Schema$GooglePrivacyDlpV2beta2Value; + } /** - * Points to the field that contains the context, for example, an entity id. - * If set, must also set method. If set, shift will be consistent for the - * given context. + * Replace each matching finding with the name of the info_type. */ - context: Schema$GooglePrivacyDlpV2beta2FieldId; - /** - * Causes the shift to be computed based on this key and the context. This - * results in the same shift for the same context and crypto_key. - */ - cryptoKey: Schema$GooglePrivacyDlpV2beta2CryptoKey; - /** - * For example, -5 means shift date to at most 5 days back in the past. - * [Required] - */ - lowerBoundDays: number; - /** - * Range of shift in days. Actual shift will be selected at random within this - * range (inclusive ends). Negative means shift to earlier in time. Must not - * be more than 365250 days (1000 years) each direction. For example, 3 means - * shift date to at most 3 days into the future. [Required] - */ - upperBoundDays: number; -} -/** - * Message for a date time object. - */ -export interface Schema$GooglePrivacyDlpV2beta2DateTime { - /** - * One or more of the following must be set. All fields are optional, but when - * set must be valid date or time values. - */ - date: Schema$GoogleTypeDate; - dayOfWeek: string; - time: Schema$GoogleTypeTimeOfDay; - timeZone: Schema$GooglePrivacyDlpV2beta2TimeZone; -} -/** - * The configuration that controls how the data will change. - */ -export interface Schema$GooglePrivacyDlpV2beta2DeidentifyConfig { - /** - * Treat the dataset as free-form text and apply the same free text - * transformation everywhere. - */ - infoTypeTransformations: - Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations; - /** - * Treat the dataset as structured. Transformations can be applied to specific - * locations within structured datasets, such as transforming a column within - * a table. - */ - recordTransformations: Schema$GooglePrivacyDlpV2beta2RecordTransformations; -} -/** - * Request to de-identify a list of items. - */ -export interface Schema$GooglePrivacyDlpV2beta2DeidentifyContentRequest { - /** - * Configuration for the de-identification of the content item. Items - * specified here will override the template referenced by the - * deidentify_template_name argument. - */ - deidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; - /** - * Optional template to use. Any configuration directly specified in - * deidentify_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - deidentifyTemplateName: string; - /** - * Configuration for the inspector. Items specified here will override the - * template referenced by the inspect_template_name argument. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to de-identify. Will be treated as text. - */ - item: Schema$GooglePrivacyDlpV2beta2ContentItem; -} -/** - * Results of de-identifying a ContentItem. - */ -export interface Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse { - /** - * The de-identified item. - */ - item: Schema$GooglePrivacyDlpV2beta2ContentItem; - /** - * An overview of the changes that were made on the `item`. - */ - overview: Schema$GooglePrivacyDlpV2beta2TransformationOverview; -} -/** - * The DeidentifyTemplates contains instructions on how to deidentify content. - */ -export interface Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate { - /** - * The creation timestamp of a inspectTemplate, output only field. - */ - createTime: string; - /** - * ///////////// // The core content of the template // /////////////// - */ - deidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; - /** - * Short description (max 256 chars). - */ - description: string; - /** - * Display name (max 256 chars). - */ - displayName: string; - /** - * The template name. Output only. The template will have one of the - * following formats: `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID` - */ - name: string; - /** - * The last update timestamp of a inspectTemplate, output only field. - */ - updateTime: string; -} -/** - * Rule for modifying a custom info type to alter behavior under certain - * circumstances, depending on the specific details of the rule. Not supported - * for the `surrogate_type` custom info type. - */ -export interface Schema$GooglePrivacyDlpV2beta2DetectionRule { - /** - * Hotword-based detection rule. - */ - hotwordRule: Schema$GooglePrivacyDlpV2beta2HotwordRule; -} -/** - * Custom information type based on a dictionary of words or phrases. This can - * be used to match sensitive information specific to the data, such as a list - * of employee IDs or job titles. Dictionary words are case-insensitive and all - * characters other than letters and digits in the unicode [Basic Multilingual - * Plane](https://en.wikipedia.org/wiki/Plane_%28Unicode%29#Basic_Multilingual_Plane) - * will be replaced with whitespace when scanning for matches, so the dictionary - * phrase "Sam Johnson" will match all three phrases "sam - * johnson", "Sam, Johnson", and "Sam (Johnson)". - * Additionally, the characters surrounding any match must be of a different - * type than the adjacent characters within the word, so letters must be next to - * non-letters and digits next to non-digits. For example, the dictionary word - * "jen" will match the first three letters of the text - * "jen123" but will return no matches for "jennifer". - * Dictionary words containing a large number of characters that are not letters - * or digits may result in unexpected findings because such characters are - * treated as whitespace. - */ -export interface Schema$GooglePrivacyDlpV2beta2Dictionary { - /** - * List of words or phrases to search for. - */ - wordList: Schema$GooglePrivacyDlpV2beta2WordList; -} -/** - * Combines all of the information about a DLP job. - */ -export interface Schema$GooglePrivacyDlpV2beta2DlpJob { - /** - * Time when the job was created. - */ - createTime: string; - /** - * Time when the job finished. - */ - endTime: string; - /** - * A stream of errors encountered running the job. - */ - errorResults: Schema$GoogleRpcStatus[]; - /** - * Results from inspecting a data source. - */ - inspectDetails: Schema$GooglePrivacyDlpV2beta2InspectDataSourceDetails; - /** - * If created by a job trigger, the resource name of the trigger that - * instantiated the job. - */ - jobTriggerName: string; - /** - * The server-assigned name. - */ - name: string; - /** - * Results from analyzing risk of a data source. - */ - riskDetails: Schema$GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskDetails; - /** - * Time when the job started. - */ - startTime: string; - /** - * State of a job. - */ - state: string; - /** - * The type of job. - */ - type: string; -} -/** - * An entity in a dataset is a field or set of fields that correspond to a - * single person. For example, in medical records the `EntityId` might be a - * patient identifier, or for financial records it might be an account - * identifier. This message is used when generalizations or analysis must be - * consistent across multiple rows pertaining to the same entity. - */ -export interface Schema$GooglePrivacyDlpV2beta2EntityId { - /** - * Composite key indicating which field contains the entity identifier. - */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; -} -/** - * The results of an unsuccessful activation of the JobTrigger. - */ -export interface Schema$GooglePrivacyDlpV2beta2Error { - details: Schema$GoogleRpcStatus; - /** - * The times the error occurred. - */ - timestamps: string[]; -} -/** - * An expression, consisting or an operator and conditions. - */ -export interface Schema$GooglePrivacyDlpV2beta2Expressions { - conditions: Schema$GooglePrivacyDlpV2beta2Conditions; - /** - * The operator to apply to the result of conditions. Default and currently - * only supported value is `AND`. - */ - logicalOperator: string; -} -/** - * General identifier of a data field in a storage service. - */ -export interface Schema$GooglePrivacyDlpV2beta2FieldId { - /** - * Name describing the field. - */ - name: string; -} -/** - * The transformation to apply to the field. - */ -export interface Schema$GooglePrivacyDlpV2beta2FieldTransformation { - /** - * Only apply the transformation if the condition evaluates to true for the - * given `RecordCondition`. The conditions are allowed to reference fields - * that are not used in the actual transformation. [optional] Example Use - * Cases: - Apply a different bucket transformation to an age column if the - * zip code column for the same record is within a specific range. - Redact a - * field if the date of birth field is greater than 85. - */ - condition: Schema$GooglePrivacyDlpV2beta2RecordCondition; - /** - * Input field(s) to apply the transformation to. [required] - */ - fields: Schema$GooglePrivacyDlpV2beta2FieldId[]; - /** - * Treat the contents of the field as free text, and selectively transform - * content that matches an `InfoType`. - */ - infoTypeTransformations: - Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations; - /** - * Apply the transformation to the entire field. - */ - primitiveTransformation: - Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; -} -/** - * Set of files to scan. - */ -export interface Schema$GooglePrivacyDlpV2beta2FileSet { - /** - * The url, in the format `gs://<bucket>/<path>`. Trailing - * wildcard in the path is allowed. - */ - url: string; -} -/** - * Represents a piece of potentially sensitive content. - */ -export interface Schema$GooglePrivacyDlpV2beta2Finding { - /** - * Timestamp when finding was detected. - */ - createTime: string; - /** - * The type of content that might have been found. Provided if requested by - * the `InspectConfig`. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; - /** - * Estimate of how likely it is that the `info_type` is correct. - */ - likelihood: string; - /** - * Where the content was found. - */ - location: Schema$GooglePrivacyDlpV2beta2Location; - /** - * The content that was found. Even if the content is not textual, it may be - * converted to a textual representation here. Provided if requested by the - * `InspectConfig` and the finding is less than or equal to 4096 bytes long. - * If the finding exceeds 4096 bytes in length, the quote may be omitted. - */ - quote: string; - /** - * Contains data parsed from quotes. Only populated if include_quote was set - * to true and a supported infoType was requested. Currently supported - * infoTypes: DATE, DATE_OF_BIRTH and TIME. - */ - quoteInfo: Schema$GooglePrivacyDlpV2beta2QuoteInfo; -} -export interface Schema$GooglePrivacyDlpV2beta2FindingLimits { - /** - * Configuration of findings limit given for specified infoTypes. - */ - maxFindingsPerInfoType: Schema$GooglePrivacyDlpV2beta2InfoTypeLimit[]; - /** - * Max number of findings that will be returned for each item scanned. When - * set within `InspectDataSourceRequest`, the maximum returned is 1000 - * regardless if this is set higher. When set within `InspectContentRequest`, - * this field is ignored. - */ - maxFindingsPerItem: number; - /** - * Max number of findings that will be returned per request/job. When set - * within `InspectContentRequest`, the maximum returned is 1000 regardless if - * this is set higher. - */ - maxFindingsPerRequest: number; -} -/** - * Buckets values based on fixed size ranges. The Bucketing transformation can - * provide all of this functionality, but requires more configuration. This - * message is provided as a convenience to the user for simple bucketing - * strategies. The transformed value will be a hyphenated string of - * <lower_bound>-<upper_bound>, i.e if lower_bound = 10 and - * upper_bound = 20 all values that are within this bucket will be replaced with - * "10-20". This can be used on data of type: double, long. If the - * bound Value type differs from the type of data being transformed, we will - * first attempt converting the type of the data to be transformed to match the - * type of the bound before comparing. - */ -export interface Schema$GooglePrivacyDlpV2beta2FixedSizeBucketingConfig { - /** - * Size of each bucket (except for minimum and maximum buckets). So if - * `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the - * following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60, - * 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works. [Required]. - */ - bucketSize: number; - /** - * Lower bound value of buckets. All values less than `lower_bound` are - * grouped together into a single bucket; for example if `lower_bound` = 10, - * then all values less than 10 are replaced with the value “-10”. [Required]. - */ - lowerBound: Schema$GooglePrivacyDlpV2beta2Value; - /** - * Upper bound value of buckets. All values greater than upper_bound are - * grouped together into a single bucket; for example if `upper_bound` = 89, - * then all values greater than 89 are replaced with the value “89+”. - * [Required]. - */ - upperBound: Schema$GooglePrivacyDlpV2beta2Value; -} -/** - * Detection rule that adjusts the likelihood of findings within a certain - * proximity of hotwords. - */ -export interface Schema$GooglePrivacyDlpV2beta2HotwordRule { - /** - * Regex pattern defining what qualifies as a hotword. - */ - hotwordRegex: Schema$GooglePrivacyDlpV2beta2Regex; - /** - * Likelihood adjustment to apply to all matching findings. - */ - likelihoodAdjustment: Schema$GooglePrivacyDlpV2beta2LikelihoodAdjustment; - /** - * Proximity of the finding within which the entire hotword must reside. The - * total length of the window cannot exceed 1000 characters. Note that the - * finding itself will be included in the window, so that hotwords may be used - * to match substrings of the finding itself. For example, the certainty of a - * phone number regex "\(\d{3}\) \d{3}-\d{4}" could be adjusted - * upwards if the area code is known to be the local area code of a company - * office using the hotword regex "\(xxx\)", where "xxx" - * is the area code in question. - */ - proximity: Schema$GooglePrivacyDlpV2beta2Proximity; -} -/** - * Bounding box encompassing detected text within an image. - */ -export interface Schema$GooglePrivacyDlpV2beta2ImageLocation { - /** - * Height of the bounding box in pixels. - */ - height: number; - /** - * Left coordinate of the bounding box. (0,0) is upper left. - */ - left: number; - /** - * Top coordinate of the bounding box. (0,0) is upper left. - */ - top: number; - /** - * Width of the bounding box in pixels. - */ - width: number; -} -/** - * Configuration for determining how redaction of images should occur. - */ -export interface Schema$GooglePrivacyDlpV2beta2ImageRedactionConfig { - /** - * Only one per info_type should be provided per request. If not specified, - * and redact_all_text is false, the DLP API will redact all text that it - * matches against all info_types that are found, but not specified in another - * ImageRedactionConfig. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; - /** - * If true, all text found in the image, regardless whether it matches an - * info_type, is redacted. - */ - redactAllText: boolean; - /** - * The color to use when redacting content from an image. If not specified, - * the default is black. - */ - redactionColor: Schema$GooglePrivacyDlpV2beta2Color; -} -/** - * Type of information detected by the API. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoType { - /** - * Name of the information type. - */ - name: string; -} -/** - * InfoType description. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoTypeDescription { - /** - * Human readable form of the infoType name. - */ - displayName: string; - /** - * Internal name of the infoType. - */ - name: string; - /** - * Which parts of the API supports this InfoType. - */ - supportedBy: string[]; -} -/** - * Max findings configuration per infoType, per content item or long running - * DlpJob. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoTypeLimit { - /** - * Type of information the findings limit applies to. Only one limit per - * info_type should be provided. If InfoTypeLimit does not have an info_type, - * the DLP API applies the limit against all info_types that are found but not - * specified in another InfoTypeLimit. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; - /** - * Max findings limit for the given infoType. - */ - maxFindings: number; -} -/** - * Statistics regarding a specific InfoType. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoTypeStatistics { - /** - * Number of findings for this infoType. - */ - count: string; - /** - * The type of finding this stat is for. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; -} -/** - * A transformation to apply to text that is identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoTypeTransformation { - /** - * InfoTypes to apply the transformation to. Empty list will match all - * available infoTypes for this transformation. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta2InfoType[]; - /** - * Primitive transformation to apply to the infoType. [required] - */ - primitiveTransformation: - Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; -} -/** - * A type of transformation that will scan unstructured text and apply various - * `PrimitiveTransformation`s to each finding, where the transformation is - * applied to only values that were identified as a specific info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta2InfoTypeTransformations { - /** - * Transformation for each infoType. Cannot specify more than one for a given - * infoType. [required] - */ - transformations: Schema$GooglePrivacyDlpV2beta2InfoTypeTransformation[]; -} -/** - * Configuration description of the scanning process. When used with - * redactContent only info_types and min_likelihood are currently used. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectConfig { - /** - * Custom infoTypes provided by the user. - */ - customInfoTypes: Schema$GooglePrivacyDlpV2beta2CustomInfoType[]; - /** - * When true, excludes type information of the findings. - */ - excludeInfoTypes: boolean; - /** - * When true, a contextual quote from the data that triggered a finding is - * included in the response; see Finding.quote. - */ - includeQuote: boolean; - /** - * Restricts what info_types to look for. The values must correspond to - * InfoType values returned by ListInfoTypes or found in documentation. Empty - * info_types runs all enabled detectors. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta2InfoType[]; - limits: Schema$GooglePrivacyDlpV2beta2FindingLimits; - /** - * Only returns findings equal or above this threshold. The default is - * POSSIBLE. - */ - minLikelihood: string; -} -/** - * Request to search for potentially sensitive info in a ContentItem. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectContentRequest { - /** - * Configuration for the inspector. What specified here will override the - * template referenced by the inspect_template_name argument. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * inspect_config will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to inspect. - */ - item: Schema$GooglePrivacyDlpV2beta2ContentItem; -} -/** - * Results of inspecting an item. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectContentResponse { - /** - * The findings. - */ - result: Schema$GooglePrivacyDlpV2beta2InspectResult; -} -/** - * The results of an inspect DataSource job. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectDataSourceDetails { - /** - * The configuration used for this job. - */ - requestedOptions: Schema$GooglePrivacyDlpV2beta2RequestedOptions; - /** - * A summary of the outcome of this inspect job. - */ - result: Schema$GooglePrivacyDlpV2beta2Result; -} -/** - * Request for scheduling a scan of a data subset from a Google Platform data - * repository. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectDataSourceRequest { - /** - * A configuration for the job. - */ - jobConfig: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; - /** - * Optional job ID to use for the created job. If not provided, a job ID will - * automatically be generated. Must be unique within the project. The job ID - * can contain uppercase and lowercase letters, numbers, and hyphens; that is, - * it must match the regular expression: `[a-zA-Z\\d-]+`. The maximum length - * is 100 characters. Can be empty to allow the system to generate one. - */ - jobId: string; -} -export interface Schema$GooglePrivacyDlpV2beta2InspectJobConfig { - /** - * Actions to execute at the completion of the job. Are executed in the order - * provided. - */ - actions: Schema$GooglePrivacyDlpV2beta2Action[]; - /** - * How and what to scan for. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; - /** - * If provided, will be used as the default for all values in InspectConfig. - * `inspect_config` will be merged into the values persisted as part of the - * template. - */ - inspectTemplateName: string; - /** - * Where to put the findings. - */ - outputConfig: Schema$GooglePrivacyDlpV2beta2OutputStorageConfig; - /** - * The data to scan. - */ - storageConfig: Schema$GooglePrivacyDlpV2beta2StorageConfig; -} -/** - * All the findings for a single scanned item. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectResult { - /** - * List of findings for an item. - */ - findings: Schema$GooglePrivacyDlpV2beta2Finding[]; - /** - * If true, then this item might have more findings than were returned, and - * the findings returned are an arbitrary subset of all findings. The findings - * list might be truncated because the input items were too large, or because - * the server reached the maximum amount of resources allowed for a single API - * call. For best results, divide the input into smaller batches. - */ - findingsTruncated: boolean; -} -/** - * The inspectTemplate contains a configuration (set of types of sensitive data - * to be detected) to be used anywhere you otherwise would normally specify - * InspectConfig. - */ -export interface Schema$GooglePrivacyDlpV2beta2InspectTemplate { - /** - * The creation timestamp of a inspectTemplate, output only field. - */ - createTime: string; - /** - * Short description (max 256 chars). - */ - description: string; - /** - * Display name (max 256 chars). - */ - displayName: string; - /** - * The core content of the template. Configuration of the scanning process. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; - /** - * The template name. Output only. The template will have one of the - * following formats: `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR - * `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID` - */ - name: string; - /** - * The last update timestamp of a inspectTemplate, output only field. - */ - updateTime: string; -} -/** - * Contains a configuration to make dlp api calls on a repeating basis. - */ -export interface Schema$GooglePrivacyDlpV2beta2JobTrigger { - /** - * The creation timestamp of a triggeredJob, output only field. - */ - createTime: string; - /** - * User provided description (max 256 chars) - */ - description: string; - /** - * Display name (max 100 chars) - */ - displayName: string; - /** - * A stream of errors encountered when the trigger was activated. Repeated - * errors may result in the JobTrigger automaticaly being paused. Will return - * the last 100 errors. Whenever the JobTrigger is modified this list will be - * cleared. Output only field. - */ - errors: Schema$GooglePrivacyDlpV2beta2Error[]; - inspectJob: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; - /** - * The timestamp of the last time this trigger executed. - */ - lastRunTime: string; - /** - * Unique resource name for the triggeredJob, assigned by the service when the - * triggeredJob is created, for example - * `projects/dlp-test-project/triggeredJobs/53234423`. - */ - name: string; - /** - * A status for this trigger. [required] - */ - status: string; - /** - * A list of triggers which will be OR'ed together. Only one in the list - * needs to trigger for a job to be started. The list may contain only a - * single Schedule trigger and must have at least one object. - */ - triggers: Schema$GooglePrivacyDlpV2beta2Trigger[]; - /** - * The last update timestamp of a triggeredJob, output only field. - */ - updateTime: string; -} -/** - * k-anonymity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta2KAnonymityConfig { - /** - * Optional message indicating that each distinct entity_id should not - * contribute to the k-anonymity count more than once per equivalence class. - * If an entity_id appears on several rows with different quasi-identifier - * tuples, it will contribute to each count exactly once. This can lead to - * unexpected results. Consider a table where ID 1 is associated to - * quasi-identifier "foo", ID 2 to "bar", and ID 3 to - * *both* quasi-identifiers "foo" and "bar" (on separate - * rows), and where this ID is used as entity_id. Then, the anonymity value - * associated to ID 3 will be 2, even if it is the only ID to be associated to - * both values "foo" and "bar". - */ - entityId: Schema$GooglePrivacyDlpV2beta2EntityId; - /** - * Set of fields to compute k-anonymity over. When multiple fields are - * specified, they are considered a single composite key. Structs and repeated - * data types are not supported; however, nested fields are supported so long - * as they are not structs themselves or nested within a repeated field. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta2FieldId[]; -} -/** - * The set of columns' values that share the same ldiversity value - */ -export interface Schema$GooglePrivacyDlpV2beta2KAnonymityEquivalenceClass { - /** - * Size of the equivalence class, for example number of rows with the above - * set of values. - */ - equivalenceClassSize: string; - /** - * Set of values defining the equivalence class. One value per - * quasi-identifier column in the original KAnonymity metric message. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; -} -export interface Schema$GooglePrivacyDlpV2beta2KAnonymityHistogramBucket { - /** - * Total number of equivalence classes in this bucket. - */ - bucketSize: string; - /** - * Total number of distinct equivalence classes in this bucket. - */ - bucketValueCount: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta2KAnonymityEquivalenceClass[]; - /** - * Lower bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeLowerBound: string; - /** - * Upper bound on the size of the equivalence classes in this bucket. - */ - equivalenceClassSizeUpperBound: string; -} -/** - * Result of the k-anonymity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta2KAnonymityResult { - /** - * Histogram of k-anonymity equivalence classes. - */ - equivalenceClassHistogramBuckets: - Schema$GooglePrivacyDlpV2beta2KAnonymityHistogramBucket[]; -} -/** - * A unique identifier for a Datastore entity. If a key's partition ID or - * any of its path kinds or names are reserved/read-only, the key is - * reserved/read-only. A reserved/read-only key is forbidden in certain - * documented contexts. - */ -export interface Schema$GooglePrivacyDlpV2beta2Key { - /** - * Entities are partitioned into subsets, currently identified by a project ID - * and namespace ID. Queries are scoped to a single partition. - */ - partitionId: Schema$GooglePrivacyDlpV2beta2PartitionId; - /** - * The entity path. An entity path consists of one or more elements composed - * of a kind and a string or numerical identifier, which identify entities. - * The first element identifies a _root entity_, the second element identifies - * a _child_ of the root entity, the third element identifies a child of the - * second entity, and so forth. The entities identified by all prefixes of the - * path are called the element's _ancestors_. A path can never be empty, - * and a path can have at most 100 elements. - */ - path: Schema$GooglePrivacyDlpV2beta2PathElement[]; -} -/** - * A representation of a Datastore kind. - */ -export interface Schema$GooglePrivacyDlpV2beta2KindExpression { - /** - * The name of the kind. - */ - name: string; -} -/** - * Reidentifiability metric. This corresponds to a risk model similar to what is - * called "journalist risk" in the literature, except the attack - * dataset is statistically modeled instead of being perfectly known. This can - * be done using publicly available data (like the US Census), or using a custom - * statistical model (indicated as one or several BigQuery tables), or by - * extrapolating from the distribution of values in the input dataset. - */ -export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationConfig { - /** - * Several auxiliary tables can be used in the analysis. Each custom_tag used - * to tag a quasi-identifiers column must appear in exactly one column of one - * auxiliary table. - */ - auxiliaryTables: Schema$GooglePrivacyDlpV2beta2AuxiliaryTable[]; - /** - * Fields considered to be quasi-identifiers. No two columns can have the same - * tag. [required] - */ - quasiIds: Schema$GooglePrivacyDlpV2beta2TaggedField[]; - /** - * ISO 3166-1 alpha-2 region code to use in the statistical modeling. Required - * if no column is tagged with a region-specific InfoType (like US_ZIP_5) or a - * region code. - */ - regionCode: string; -} -/** - * A KMapEstimationHistogramBucket message with the following values: - * min_anonymity: 3 max_anonymity: 5 frequency: 42 means that there are 42 - * records whose quasi-identifier values correspond to 3, 4 or 5 people in the - * overlying population. An important particular case is when min_anonymity = - * max_anonymity = 1: the frequency field then corresponds to the number of - * uniquely identifiable records. - */ -export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationHistogramBucket { - /** - * Number of records within these anonymity bounds. - */ - bucketSize: string; - /** - * Total number of distinct quasi-identifier tuple values in this bucket. - */ - bucketValueCount: string; - /** - * Sample of quasi-identifier tuple values in this bucket. The total number of - * classes returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta2KMapEstimationQuasiIdValues[]; - /** - * Always greater than or equal to min_anonymity. - */ - maxAnonymity: string; - /** - * Always positive. - */ - minAnonymity: string; -} -/** - * A tuple of values for the quasi-identifier columns. - */ -export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationQuasiIdValues { - /** - * The estimated anonymity for these quasi-identifier values. - */ - estimatedAnonymity: string; - /** - * The quasi-identifier values. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; -} -/** - * Result of the reidentifiability analysis. Note that these results are an - * estimation, not exact values. - */ -export interface Schema$GooglePrivacyDlpV2beta2KMapEstimationResult { - /** - * The intervals [min_anonymity, max_anonymity] do not overlap. If a value - * doesn't correspond to any such interval, the associated frequency is - * zero. For example, the following records: {min_anonymity: 1, - * max_anonymity: 1, frequency: 17} {min_anonymity: 2, max_anonymity: 3, - * frequency: 42} {min_anonymity: 5, max_anonymity: 10, frequency: 99} mean - * that there are no record with an estimated anonymity of 4, 5, or larger - * than 10. - */ - kMapEstimationHistogram: - Schema$GooglePrivacyDlpV2beta2KMapEstimationHistogramBucket[]; -} -/** - * Include to use an existing data crypto key wrapped by KMS. Authorization - * requires the following IAM permissions when sending a request to perform a - * crypto transformation using a kms-wrapped crypto key: dlp.kms.encrypt - */ -export interface Schema$GooglePrivacyDlpV2beta2KmsWrappedCryptoKey { - /** - * The resource name of the KMS CryptoKey to use for unwrapping. [required] - */ - cryptoKeyName: string; - /** - * The wrapped data crypto key. [required] - */ - wrappedKey: string; -} -/** - * l-diversity metric, used for analysis of reidentification risk. - */ -export interface Schema$GooglePrivacyDlpV2beta2LDiversityConfig { - /** - * Set of quasi-identifiers indicating how equivalence classes are defined for - * the l-diversity computation. When multiple fields are specified, they are - * considered a single composite key. - */ - quasiIds: Schema$GooglePrivacyDlpV2beta2FieldId[]; - /** - * Sensitive field for computing the l-value. - */ - sensitiveAttribute: Schema$GooglePrivacyDlpV2beta2FieldId; -} -/** - * The set of columns' values that share the same ldiversity value. - */ -export interface Schema$GooglePrivacyDlpV2beta2LDiversityEquivalenceClass { - /** - * Size of the k-anonymity equivalence class. - */ - equivalenceClassSize: string; - /** - * Number of distinct sensitive values in this equivalence class. - */ - numDistinctSensitiveValues: string; - /** - * Quasi-identifier values defining the k-anonymity equivalence class. The - * order is always the same as the original request. - */ - quasiIdsValues: Schema$GooglePrivacyDlpV2beta2Value[]; - /** - * Estimated frequencies of top sensitive values. - */ - topSensitiveValues: Schema$GooglePrivacyDlpV2beta2ValueFrequency[]; -} -export interface Schema$GooglePrivacyDlpV2beta2LDiversityHistogramBucket { - /** - * Total number of equivalence classes in this bucket. - */ - bucketSize: string; - /** - * Total number of distinct equivalence classes in this bucket. - */ - bucketValueCount: string; - /** - * Sample of equivalence classes in this bucket. The total number of classes - * returned per bucket is capped at 20. - */ - bucketValues: Schema$GooglePrivacyDlpV2beta2LDiversityEquivalenceClass[]; - /** - * Lower bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyLowerBound: string; - /** - * Upper bound on the sensitive value frequencies of the equivalence classes - * in this bucket. - */ - sensitiveValueFrequencyUpperBound: string; -} -/** - * Result of the l-diversity computation. - */ -export interface Schema$GooglePrivacyDlpV2beta2LDiversityResult { - /** - * Histogram of l-diversity equivalence class sensitive value frequencies. - */ - sensitiveValueFrequencyHistogramBuckets: - Schema$GooglePrivacyDlpV2beta2LDiversityHistogramBucket[]; -} -/** - * Message for specifying an adjustment to the likelihood of a finding as part - * of a detection rule. - */ -export interface Schema$GooglePrivacyDlpV2beta2LikelihoodAdjustment { - /** - * Set the likelihood of a finding to a fixed value. - */ - fixedLikelihood: string; - /** - * Increase or decrease the likelihood by the specified number of levels. For - * example, if a finding would be `POSSIBLE` without the detection rule and - * `relative_likelihood` is 1, then it is upgraded to `LIKELY`, while a value - * of -1 would downgrade it to `UNLIKELY`. Likelihood may never drop below - * `VERY_UNLIKELY` or exceed `VERY_LIKELY`, so applying an adjustment of 1 - * followed by an adjustment of -1 when base likelihood is `VERY_LIKELY` will - * result in a final likelihood of `LIKELY`. - */ - relativeLikelihood: number; -} -/** - * Response message for ListDeidentifyTemplates. - */ -export interface Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse { - /** - * List of deidentify templates, up to page_size in - * ListDeidentifyTemplatesRequest. - */ - deidentifyTemplates: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate[]; - /** - * If the next page is available then the next page token to be used in - * following ListDeidentifyTemplates request. - */ - nextPageToken: string; -} -/** - * The response message for listing DLP jobs. - */ -export interface Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse { - /** - * A list of DlpJobs that matches the specified filter in the request. - */ - jobs: Schema$GooglePrivacyDlpV2beta2DlpJob[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * Response to the ListInfoTypes request. - */ -export interface Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse { - /** - * Set of sensitive infoTypes. - */ - infoTypes: Schema$GooglePrivacyDlpV2beta2InfoTypeDescription[]; -} -/** - * Response message for ListInspectTemplates. - */ -export interface Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse { - /** - * List of inspectTemplates, up to page_size in ListInspectTemplatesRequest. - */ - inspectTemplates: Schema$GooglePrivacyDlpV2beta2InspectTemplate[]; - /** - * If the next page is available then the next page token to be used in - * following ListInspectTemplates request. - */ - nextPageToken: string; -} -/** - * Response message for ListJobTriggers. - */ -export interface Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse { - /** - * List of triggeredJobs, up to page_size in ListJobTriggersRequest. - */ - jobTriggers: Schema$GooglePrivacyDlpV2beta2JobTrigger[]; - /** - * If the next page is available then the next page token to be used in - * following ListJobTriggers request. - */ - nextPageToken: string; -} -/** - * Specifies the location of the finding. - */ -export interface Schema$GooglePrivacyDlpV2beta2Location { - /** - * Zero-based byte offsets delimiting the finding. These are relative to the - * finding's containing element. Note that when the content is not - * textual, this references the UTF-8 encoded textual representation of the - * content. Omitted if content is an image. - */ - byteRange: Schema$GooglePrivacyDlpV2beta2Range; - /** - * Unicode character offsets delimiting the finding. These are relative to the - * finding's containing element. Provided when the content is text. - */ - codepointRange: Schema$GooglePrivacyDlpV2beta2Range; - /** - * The pointer to the property or cell that contained the finding. Provided - * when the finding's containing element is a cell in a table or a - * property of storage object. - */ - fieldId: Schema$GooglePrivacyDlpV2beta2FieldId; - /** - * The area within the image that contained the finding. Provided when the - * content is an image. - */ - imageBoxes: Schema$GooglePrivacyDlpV2beta2ImageLocation[]; - /** - * The pointer to the record in storage that contained the field the finding - * was found in. Provided when the finding's containing element is a - * property of a storage object. - */ - recordKey: Schema$GooglePrivacyDlpV2beta2RecordKey; - /** - * The pointer to the row of the table that contained the finding. Provided - * when the finding's containing element is a cell of a table. - */ - tableLocation: Schema$GooglePrivacyDlpV2beta2TableLocation; -} -/** - * Compute numerical stats over an individual column, including min, max, and - * quantiles. - */ -export interface Schema$GooglePrivacyDlpV2beta2NumericalStatsConfig { - /** - * Field to compute numerical stats on. Supported types are integer, float, - * date, datetime, timestamp, time. - */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; -} -/** - * Result of the numerical stats computation. - */ -export interface Schema$GooglePrivacyDlpV2beta2NumericalStatsResult { - /** - * Maximum value appearing in the column. - */ - maxValue: Schema$GooglePrivacyDlpV2beta2Value; - /** - * Minimum value appearing in the column. - */ - minValue: Schema$GooglePrivacyDlpV2beta2Value; - /** - * List of 99 values that partition the set of field values into 100 equal - * sized buckets. - */ - quantileValues: Schema$GooglePrivacyDlpV2beta2Value[]; -} -/** - * Cloud repository for storing output. - */ -export interface Schema$GooglePrivacyDlpV2beta2OutputStorageConfig { - /** - * Schema used for writing the findings. Columns are derived from the - * `Finding` object. If appending to an existing table, any columns from the - * predefined schema that are missing will be added. No columns in the - * existing table will be deleted. If unspecified, then all available columns - * will be used for a new table, and no changes will be made to an existing - * table. - */ - outputSchema: string; - /** - * Store findings in an existing table or a new table in an existing dataset. - * Each column in an existing table must have the same name, type, and mode of - * a field in the `Finding` object. If table_id is not set a new one will be - * generated for you with the following format: - * dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for - * generating the date details. - */ - table: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -/** - * Datastore partition ID. A partition ID identifies a grouping of entities. The - * grouping is always by project and namespace, however the namespace ID may be - * empty. A partition ID contains several dimensions: project ID and namespace - * ID. - */ -export interface Schema$GooglePrivacyDlpV2beta2PartitionId { - /** - * If not empty, the ID of the namespace to which the entities belong. - */ - namespaceId: string; - /** - * The ID of the project to which the entities belong. - */ - projectId: string; -} -/** - * A (kind, ID/name) pair used to construct a key path. If either name or ID is - * set, the element is complete. If neither is set, the element is incomplete. - */ -export interface Schema$GooglePrivacyDlpV2beta2PathElement { - /** - * The auto-allocated ID of the entity. Never equal to zero. Values less than - * zero are discouraged and may not be supported in the future. - */ - id: string; - /** - * The kind of the entity. A kind matching regex `__.*__` is - * reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - kind: string; - /** - * The name of the entity. A name matching regex `__.*__` is - * reserved/read-only. A name must not be more than 1500 bytes when UTF-8 - * encoded. Cannot be `""`. - */ - name: string; -} -/** - * A rule for transforming a value. - */ -export interface Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation { - bucketingConfig: Schema$GooglePrivacyDlpV2beta2BucketingConfig; - characterMaskConfig: Schema$GooglePrivacyDlpV2beta2CharacterMaskConfig; - cryptoHashConfig: Schema$GooglePrivacyDlpV2beta2CryptoHashConfig; - cryptoReplaceFfxFpeConfig: - Schema$GooglePrivacyDlpV2beta2CryptoReplaceFfxFpeConfig; - dateShiftConfig: Schema$GooglePrivacyDlpV2beta2DateShiftConfig; - fixedSizeBucketingConfig: - Schema$GooglePrivacyDlpV2beta2FixedSizeBucketingConfig; - redactConfig: Schema$GooglePrivacyDlpV2beta2RedactConfig; - replaceConfig: Schema$GooglePrivacyDlpV2beta2ReplaceValueConfig; - replaceWithInfoTypeConfig: - Schema$GooglePrivacyDlpV2beta2ReplaceWithInfoTypeConfig; - timePartConfig: Schema$GooglePrivacyDlpV2beta2TimePartConfig; -} -/** - * Privacy metric to compute for reidentification risk analysis. - */ -export interface Schema$GooglePrivacyDlpV2beta2PrivacyMetric { - categoricalStatsConfig: Schema$GooglePrivacyDlpV2beta2CategoricalStatsConfig; - kAnonymityConfig: Schema$GooglePrivacyDlpV2beta2KAnonymityConfig; - kMapEstimationConfig: Schema$GooglePrivacyDlpV2beta2KMapEstimationConfig; - lDiversityConfig: Schema$GooglePrivacyDlpV2beta2LDiversityConfig; - numericalStatsConfig: Schema$GooglePrivacyDlpV2beta2NumericalStatsConfig; -} -/** - * Message for specifying a window around a finding to apply a detection rule. - */ -export interface Schema$GooglePrivacyDlpV2beta2Proximity { - /** - * Number of characters after the finding to consider. - */ - windowAfter: number; - /** - * Number of characters before the finding to consider. - */ - windowBefore: number; -} -/** - * Publish the results of a DlpJob to a pub sub channel. Compatible with: - * Inpect, Risk - */ -export interface Schema$GooglePrivacyDlpV2beta2PublishToPubSub { - /** - * Cloud Pub/Sub topic to send notifications to. The topic must have given - * publishing access rights to the DLP API service account executing the long - * running DlpJob sending the notifications. Format is - * projects/{project}/topics/{topic}. - */ - topic: string; -} -/** - * A quasi-identifier column has a custom_tag, used to know which column in the - * data corresponds to which column in the statistical model. - */ -export interface Schema$GooglePrivacyDlpV2beta2QuasiIdField { - customTag: string; - field: Schema$GooglePrivacyDlpV2beta2FieldId; -} -/** - * Message for infoType-dependent details parsed from quote. - */ -export interface Schema$GooglePrivacyDlpV2beta2QuoteInfo { - dateTime: Schema$GooglePrivacyDlpV2beta2DateTime; -} -/** - * Generic half-open interval [start, end) - */ -export interface Schema$GooglePrivacyDlpV2beta2Range { - /** - * Index of the last character of the range (exclusive). - */ - end: string; - /** - * Index of the first character of the range (inclusive). - */ - start: string; -} -/** - * A condition for determining whether a transformation should be applied to a - * field. - */ -export interface Schema$GooglePrivacyDlpV2beta2RecordCondition { - /** - * An expression. - */ - expressions: Schema$GooglePrivacyDlpV2beta2Expressions; -} -/** - * Message for a unique key indicating a record that contains a finding. - */ -export interface Schema$GooglePrivacyDlpV2beta2RecordKey { - bigQueryKey: Schema$GooglePrivacyDlpV2beta2BigQueryKey; - cloudStorageKey: Schema$GooglePrivacyDlpV2beta2CloudStorageKey; - datastoreKey: Schema$GooglePrivacyDlpV2beta2DatastoreKey; -} -/** - * Configuration to suppress records whose suppression conditions evaluate to - * true. - */ -export interface Schema$GooglePrivacyDlpV2beta2RecordSuppression { - /** - * A condition that when it evaluates to true will result in the record being - * evaluated to be suppressed from the transformed content. - */ - condition: Schema$GooglePrivacyDlpV2beta2RecordCondition; -} -/** - * A type of transformation that is applied over structured data such as a - * table. - */ -export interface Schema$GooglePrivacyDlpV2beta2RecordTransformations { - /** - * Transform the record by applying various field transformations. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2beta2FieldTransformation[]; - /** - * Configuration defining which records get suppressed entirely. Records that - * match any suppression rule are omitted from the output [optional]. - */ - recordSuppressions: Schema$GooglePrivacyDlpV2beta2RecordSuppression[]; -} -/** - * Redact a given value. For example, if used with an `InfoTypeTransformation` - * transforming PHONE_NUMBER, and input 'My phone number is - * 206-555-0123', the output would be 'My phone number is '. - */ -export interface Schema$GooglePrivacyDlpV2beta2RedactConfig {} -/** - * Request to search for potentially sensitive info in a list of items and - * replace it with a default or provided content. - */ -export interface Schema$GooglePrivacyDlpV2beta2RedactImageRequest { - /** - * The bytes of the image to redact. - */ - imageData: string; - /** - * The configuration for specifying what content to redact from images. - */ - imageRedactionConfigs: Schema$GooglePrivacyDlpV2beta2ImageRedactionConfig[]; - /** - * Type of the content, as defined in Content-Type HTTP header. Supported - * types are: PNG, JPEG, SVG, & BMP. - */ - imageType: string; - /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; -} -/** - * Results of redacting an image. - */ -export interface Schema$GooglePrivacyDlpV2beta2RedactImageResponse { - /** - * If an image was being inspected and the InspectConfig's include_quote - * was set to true, then this field will include all text, if any, that was - * found in the image. - */ - extractedText: string; - /** - * The redacted image. The type will be the same as the original image. - */ - redactedImage: string; -} -/** - * Message defining a custom regular expression. - */ -export interface Schema$GooglePrivacyDlpV2beta2Regex { - /** - * Pattern defining the regular expression. - */ - pattern: string; -} -/** - * Request to re-identify an item. - */ -export interface Schema$GooglePrivacyDlpV2beta2ReidentifyContentRequest { - /** - * Configuration for the inspector. - */ - inspectConfig: Schema$GooglePrivacyDlpV2beta2InspectConfig; - /** - * Optional template to use. Any configuration directly specified in - * `inspect_config` will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - inspectTemplateName: string; - /** - * The item to re-identify. Will be treated as text. - */ - item: Schema$GooglePrivacyDlpV2beta2ContentItem; - /** - * Configuration for the re-identification of the content item. This field - * shares the same proto message type that is used for de-identification, - * however its usage here is for the reversal of the previous - * de-identification. Re-identification is performed by examining the - * transformations used to de-identify the items and executing the reverse. - * This requires that only reversible transformations be provided here. The - * reversible transformations are: - `CryptoReplaceFfxFpeConfig` - */ - reidentifyConfig: Schema$GooglePrivacyDlpV2beta2DeidentifyConfig; - /** - * Optional template to use. References an instance of `DeidentifyTemplate`. - * Any configuration directly specified in `reidentify_config` or - * `inspect_config` will override those set in the template. Singular fields - * that are set in this request will replace their corresponding fields in the - * template. Repeated fields are appended. Singular sub-messages and groups - * are recursively merged. - */ - reidentifyTemplateName: string; -} -/** - * Results of re-identifying a item. - */ -export interface Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse { - /** - * The re-identified item. - */ - item: Schema$GooglePrivacyDlpV2beta2ContentItem; - /** - * An overview of the changes that were made to the `item`. - */ - overview: Schema$GooglePrivacyDlpV2beta2TransformationOverview; -} -/** - * Replace each input value with a given `Value`. - */ -export interface Schema$GooglePrivacyDlpV2beta2ReplaceValueConfig { - /** - * Value to replace it with. - */ - newValue: Schema$GooglePrivacyDlpV2beta2Value; -} -/** - * Replace each matching finding with the name of the info_type. - */ -export interface Schema$GooglePrivacyDlpV2beta2ReplaceWithInfoTypeConfig {} -export interface Schema$GooglePrivacyDlpV2beta2RequestedOptions { - jobConfig: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; - /** - * If run with an inspect template, a snapshot of it's state at the time - * of this run. - */ - snapshotInspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; -} -export interface Schema$GooglePrivacyDlpV2beta2Result { - /** - * Statistics of how many instances of each info type were found during - * inspect job. - */ - infoTypeStats: Schema$GooglePrivacyDlpV2beta2InfoTypeStatistics[]; - /** - * Total size in bytes that were processed. - */ - processedBytes: string; - /** - * Estimate of the number of bytes to process. - */ - totalEstimatedBytes: string; -} -/** - * Configuration for a risk analysis job. - */ -export interface Schema$GooglePrivacyDlpV2beta2RiskAnalysisJobConfig { - /** - * Actions to execute at the completion of the job. Are executed in the order - * provided. - */ - actions: Schema$GooglePrivacyDlpV2beta2Action[]; - /** - * Privacy metric to compute. - */ - privacyMetric: Schema$GooglePrivacyDlpV2beta2PrivacyMetric; - /** - * Input dataset to compute metrics over. - */ - sourceTable: Schema$GooglePrivacyDlpV2beta2BigQueryTable; -} -export interface Schema$GooglePrivacyDlpV2beta2Row { - values: Schema$GooglePrivacyDlpV2beta2Value[]; -} -/** - * If set, the detailed findings will be persisted to the specified - * OutputStorageConfig. Compatible with: Inspect - */ -export interface Schema$GooglePrivacyDlpV2beta2SaveFindings { - outputConfig: Schema$GooglePrivacyDlpV2beta2OutputStorageConfig; -} -/** - * Schedule for triggeredJobs. - */ -export interface Schema$GooglePrivacyDlpV2beta2Schedule { - /** - * With this option a job is started a regular periodic basis. For example: - * every 10 minutes. A scheduled start time will be skipped if the previous - * execution has not ended when its scheduled time occurs. This value must be - * set to a time duration greater than or equal to 60 minutes and can be no - * longer than 60 days. - */ - reccurrencePeriodDuration: string; -} -/** - * Shared message indicating Cloud storage type. - */ -export interface Schema$GooglePrivacyDlpV2beta2StorageConfig { - /** - * BigQuery options specification. - */ - bigQueryOptions: Schema$GooglePrivacyDlpV2beta2BigQueryOptions; - /** - * Google Cloud Storage options specification. - */ - cloudStorageOptions: Schema$GooglePrivacyDlpV2beta2CloudStorageOptions; - /** - * Google Cloud Datastore options specification. - */ - datastoreOptions: Schema$GooglePrivacyDlpV2beta2DatastoreOptions; - timespanConfig: Schema$GooglePrivacyDlpV2beta2TimespanConfig; -} -/** - * A collection that informs the user the number of times a particular - * `TransformationResultCode` and error details occurred. - */ -export interface Schema$GooglePrivacyDlpV2beta2SummaryResult { - code: string; - count: string; - /** - * A place for warnings or errors to show up if a transformation didn't - * work as expected. - */ - details: string; -} -/** - * Message for detecting output from deidentification transformations such as - * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). - * These types of transformations are those that perform pseudonymization, - * thereby producing a "surrogate" as output. This should be used in - * conjunction with a field on the transformation such as `surrogate_info_type`. - * This custom info type does not support the use of `detection_rules`. - */ -export interface Schema$GooglePrivacyDlpV2beta2SurrogateType {} -/** - * Structured content to inspect. Up to 50,000 `Value`s per request allowed. - */ -export interface Schema$GooglePrivacyDlpV2beta2Table { - headers: Schema$GooglePrivacyDlpV2beta2FieldId[]; - rows: Schema$GooglePrivacyDlpV2beta2Row[]; -} -/** - * Location of a finding within a table. - */ -export interface Schema$GooglePrivacyDlpV2beta2TableLocation { - /** - * The zero-based index of the row where the finding is located. - */ - rowIndex: string; -} -/** - * A column with a semantic tag attached. - */ -export interface Schema$GooglePrivacyDlpV2beta2TaggedField { - /** - * A column can be tagged with a custom tag. In this case, the user must - * indicate an auxiliary table that contains statistical information on the - * possible values of this column (below). - */ - customTag: string; - /** - * Identifies the column. [required] - */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; - /** - * If no semantic tag is indicated, we infer the statistical model from the - * distribution of values in the input data - */ - inferred: Schema$GoogleProtobufEmpty; - /** - * A column can be tagged with a InfoType to use the relevant public dataset - * as a statistical model of population, if available. We currently support US - * ZIP codes, region codes, ages and genders. To programmatically obtain the - * list of supported InfoTypes, use ListInfoTypes with the - * supported_by=RISK_ANALYSIS filter. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; -} -/** - * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a - * portion of the value. - */ -export interface Schema$GooglePrivacyDlpV2beta2TimePartConfig { - partToExtract: string; -} -/** - * Configuration of the timespan of the items to include in scanning. Currently - * only supported when inspecting Google Cloud Storage and BigQuery. - */ -export interface Schema$GooglePrivacyDlpV2beta2TimespanConfig { - /** - * When the job is started by a JobTrigger we will automatically figure out a - * valid start_time to avoid scanning files that have not been modified since - * the last time the JobTrigger executed. This will be based on the time of - * the execution of the last run of the JobTrigger. - */ - enableAutoPopulationOfTimespanConfig: boolean; - /** - * Exclude files newer than this value. If set to zero, no upper time limit is - * applied. - */ - endTime: string; - /** - * Exclude files older than this value. - */ - startTime: string; -} -export interface Schema$GooglePrivacyDlpV2beta2TimeZone { - /** - * Set only if the offset can be determined. Positive for time ahead of UTC. - * E.g. For "UTC-9", this value is -540. - */ - offsetMinutes: number; -} -/** - * Overview of the modifications that occurred. - */ -export interface Schema$GooglePrivacyDlpV2beta2TransformationOverview { - /** - * Transformations applied to the dataset. - */ - transformationSummaries: - Schema$GooglePrivacyDlpV2beta2TransformationSummary[]; - /** - * Total size in bytes that were transformed in some way. - */ - transformedBytes: string; -} -/** - * Summary of a single tranformation. Only one of 'transformation', - * 'field_transformation', or 'record_suppress' will be set. - */ -export interface Schema$GooglePrivacyDlpV2beta2TransformationSummary { - /** - * Set if the transformation was limited to a specific FieldId. - */ - field: Schema$GooglePrivacyDlpV2beta2FieldId; - /** - * The field transformation that was applied. If multiple field - * transformations are requested for a single field, this list will contain - * all of them; otherwise, only one is supplied. - */ - fieldTransformations: Schema$GooglePrivacyDlpV2beta2FieldTransformation[]; - /** - * Set if the transformation was limited to a specific info_type. - */ - infoType: Schema$GooglePrivacyDlpV2beta2InfoType; - /** - * The specific suppression option these stats apply to. - */ - recordSuppress: Schema$GooglePrivacyDlpV2beta2RecordSuppression; - results: Schema$GooglePrivacyDlpV2beta2SummaryResult[]; - /** - * The specific transformation these stats apply to. - */ - transformation: Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; - /** - * Total size in bytes that were transformed in some way. - */ - transformedBytes: string; -} -/** - * Use this to have a random data crypto key generated. It will be discarded - * after the request finishes. - */ -export interface Schema$GooglePrivacyDlpV2beta2TransientCryptoKey { - /** - * Name of the key. [required] This is an arbitrary string used to - * differentiate different keys. A unique key is generated per name: two - * separate `TransientCryptoKey` protos share the same generated key if their - * names are the same. When the data crypto key is generated, this name is not - * used in any way (repeating the api call will result in a different key - * being generated). - */ - name: string; -} -/** - * What event needs to occur for a new job to be started. - */ -export interface Schema$GooglePrivacyDlpV2beta2Trigger { - /** - * Create a job on a repeating basis based on the elapse of time. - */ - schedule: Schema$GooglePrivacyDlpV2beta2Schedule; -} -/** - * Using raw keys is prone to security risks due to accidentally leaking the - * key. Choose another type of key if possible. - */ -export interface Schema$GooglePrivacyDlpV2beta2UnwrappedCryptoKey { - /** - * The AES 128/192/256 bit key. [required] - */ - key: string; -} -/** - * Request message for UpdateDeidentifyTemplate. - */ -export interface Schema$GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest { + export interface Schema$GooglePrivacyDlpV2beta2ReplaceWithInfoTypeConfig {} + export interface Schema$GooglePrivacyDlpV2beta2RequestedOptions { + jobConfig: Schema$GooglePrivacyDlpV2beta2InspectJobConfig; + /** + * If run with an inspect template, a snapshot of it's state at the time + * of this run. + */ + snapshotInspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; + } + export interface Schema$GooglePrivacyDlpV2beta2Result { + /** + * Statistics of how many instances of each info type were found during + * inspect job. + */ + infoTypeStats: Schema$GooglePrivacyDlpV2beta2InfoTypeStatistics[]; + /** + * Total size in bytes that were processed. + */ + processedBytes: string; + /** + * Estimate of the number of bytes to process. + */ + totalEstimatedBytes: string; + } /** - * New DeidentifyTemplate value. - */ - deidentifyTemplate: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate; + * Configuration for a risk analysis job. + */ + export interface Schema$GooglePrivacyDlpV2beta2RiskAnalysisJobConfig { + /** + * Actions to execute at the completion of the job. Are executed in the + * order provided. + */ + actions: Schema$GooglePrivacyDlpV2beta2Action[]; + /** + * Privacy metric to compute. + */ + privacyMetric: Schema$GooglePrivacyDlpV2beta2PrivacyMetric; + /** + * Input dataset to compute metrics over. + */ + sourceTable: Schema$GooglePrivacyDlpV2beta2BigQueryTable; + } + export interface Schema$GooglePrivacyDlpV2beta2Row { + values: Schema$GooglePrivacyDlpV2beta2Value[]; + } /** - * Mask to control which fields get updated. + * If set, the detailed findings will be persisted to the specified + * OutputStorageConfig. Compatible with: Inspect */ - updateMask: string; -} -/** - * Request message for UpdateInspectTemplate. - */ -export interface Schema$GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest { + export interface Schema$GooglePrivacyDlpV2beta2SaveFindings { + outputConfig: Schema$GooglePrivacyDlpV2beta2OutputStorageConfig; + } /** - * New InspectTemplate value. - */ - inspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; + * Schedule for triggeredJobs. + */ + export interface Schema$GooglePrivacyDlpV2beta2Schedule { + /** + * With this option a job is started a regular periodic basis. For example: + * every 10 minutes. A scheduled start time will be skipped if the previous + * execution has not ended when its scheduled time occurs. This value must + * be set to a time duration greater than or equal to 60 minutes and can be + * no longer than 60 days. + */ + reccurrencePeriodDuration: string; + } /** - * Mask to control which fields get updated. - */ - updateMask: string; -} -/** - * Request message for UpdateJobTrigger. - */ -export interface Schema$GooglePrivacyDlpV2beta2UpdateJobTriggerRequest { + * Shared message indicating Cloud storage type. + */ + export interface Schema$GooglePrivacyDlpV2beta2StorageConfig { + /** + * BigQuery options specification. + */ + bigQueryOptions: Schema$GooglePrivacyDlpV2beta2BigQueryOptions; + /** + * Google Cloud Storage options specification. + */ + cloudStorageOptions: Schema$GooglePrivacyDlpV2beta2CloudStorageOptions; + /** + * Google Cloud Datastore options specification. + */ + datastoreOptions: Schema$GooglePrivacyDlpV2beta2DatastoreOptions; + timespanConfig: Schema$GooglePrivacyDlpV2beta2TimespanConfig; + } /** - * New JobTrigger value. - */ - jobTrigger: Schema$GooglePrivacyDlpV2beta2JobTrigger; + * A collection that informs the user the number of times a particular + * `TransformationResultCode` and error details occurred. + */ + export interface Schema$GooglePrivacyDlpV2beta2SummaryResult { + code: string; + count: string; + /** + * A place for warnings or errors to show up if a transformation didn't + * work as expected. + */ + details: string; + } /** - * Mask to control which fields get updated. + * Message for detecting output from deidentification transformations such as + * [`CryptoReplaceFfxFpeConfig`](/dlp/docs/reference/rest/v2beta1/content/deidentify#CryptoReplaceFfxFpeConfig). + * These types of transformations are those that perform pseudonymization, + * thereby producing a "surrogate" as output. This should be used in + * conjunction with a field on the transformation such as + * `surrogate_info_type`. This custom info type does not support the use of + * `detection_rules`. */ - updateMask: string; -} -/** - * Set of primitive values supported by the system. Note that for the purposes - * of inspection or transformation, the number of bytes considered to comprise a - * 'Value' is based on its representation as a UTF-8 encoded string. For - * example, if 'integer_value' is set to 123456789, the number of bytes - * would be counted as 9, even though an int64 only holds up to 8 bytes of data. - */ -export interface Schema$GooglePrivacyDlpV2beta2Value { - booleanValue: boolean; - dateValue: Schema$GoogleTypeDate; - dayOfWeekValue: string; - floatValue: number; - integerValue: string; - stringValue: string; - timestampValue: string; - timeValue: Schema$GoogleTypeTimeOfDay; -} -/** - * A value of a field, including its frequency. - */ -export interface Schema$GooglePrivacyDlpV2beta2ValueFrequency { + export interface Schema$GooglePrivacyDlpV2beta2SurrogateType {} /** - * How many times the value is contained in the field. + * Structured content to inspect. Up to 50,000 `Value`s per request allowed. */ - count: string; + export interface Schema$GooglePrivacyDlpV2beta2Table { + headers: Schema$GooglePrivacyDlpV2beta2FieldId[]; + rows: Schema$GooglePrivacyDlpV2beta2Row[]; + } /** - * A value contained in the field in question. + * Location of a finding within a table. */ - value: Schema$GooglePrivacyDlpV2beta2Value; -} -/** - * Message defining a list of words or phrases to search for in the data. - */ -export interface Schema$GooglePrivacyDlpV2beta2WordList { + export interface Schema$GooglePrivacyDlpV2beta2TableLocation { + /** + * The zero-based index of the row where the finding is located. + */ + rowIndex: string; + } /** - * Words or phrases defining the dictionary. The dictionary must contain at - * least one phrase and every phrase must contain at least 2 characters that - * are letters or digits. [required] - */ - words: string[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobufEmpty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpcStatus { + * A column with a semantic tag attached. + */ + export interface Schema$GooglePrivacyDlpV2beta2TaggedField { + /** + * A column can be tagged with a custom tag. In this case, the user must + * indicate an auxiliary table that contains statistical information on the + * possible values of this column (below). + */ + customTag: string; + /** + * Identifies the column. [required] + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * If no semantic tag is indicated, we infer the statistical model from the + * distribution of values in the input data + */ + inferred: Schema$GoogleProtobufEmpty; + /** + * A column can be tagged with a InfoType to use the relevant public dataset + * as a statistical model of population, if available. We currently support + * US ZIP codes, region codes, ages and genders. To programmatically obtain + * the list of supported InfoTypes, use ListInfoTypes with the + * supported_by=RISK_ANALYSIS filter. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a + * portion of the value. */ - code: number; + export interface Schema$GooglePrivacyDlpV2beta2TimePartConfig { + partToExtract: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Configuration of the timespan of the items to include in scanning. + * Currently only supported when inspecting Google Cloud Storage and BigQuery. + */ + export interface Schema$GooglePrivacyDlpV2beta2TimespanConfig { + /** + * When the job is started by a JobTrigger we will automatically figure out + * a valid start_time to avoid scanning files that have not been modified + * since the last time the JobTrigger executed. This will be based on the + * time of the execution of the last run of the JobTrigger. + */ + enableAutoPopulationOfTimespanConfig: boolean; + /** + * Exclude files newer than this value. If set to zero, no upper time limit + * is applied. + */ + endTime: string; + /** + * Exclude files older than this value. + */ + startTime: string; + } + export interface Schema$GooglePrivacyDlpV2beta2TimeZone { + /** + * Set only if the offset can be determined. Positive for time ahead of UTC. + * E.g. For "UTC-9", this value is -540. + */ + offsetMinutes: number; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeDate { + * Overview of the modifications that occurred. + */ + export interface Schema$GooglePrivacyDlpV2beta2TransformationOverview { + /** + * Transformations applied to the dataset. + */ + transformationSummaries: + Schema$GooglePrivacyDlpV2beta2TransformationSummary[]; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; + * Summary of a single tranformation. Only one of 'transformation', + * 'field_transformation', or 'record_suppress' will be set. + */ + export interface Schema$GooglePrivacyDlpV2beta2TransformationSummary { + /** + * Set if the transformation was limited to a specific FieldId. + */ + field: Schema$GooglePrivacyDlpV2beta2FieldId; + /** + * The field transformation that was applied. If multiple field + * transformations are requested for a single field, this list will contain + * all of them; otherwise, only one is supplied. + */ + fieldTransformations: Schema$GooglePrivacyDlpV2beta2FieldTransformation[]; + /** + * Set if the transformation was limited to a specific info_type. + */ + infoType: Schema$GooglePrivacyDlpV2beta2InfoType; + /** + * The specific suppression option these stats apply to. + */ + recordSuppress: Schema$GooglePrivacyDlpV2beta2RecordSuppression; + results: Schema$GooglePrivacyDlpV2beta2SummaryResult[]; + /** + * The specific transformation these stats apply to. + */ + transformation: Schema$GooglePrivacyDlpV2beta2PrimitiveTransformation; + /** + * Total size in bytes that were transformed in some way. + */ + transformedBytes: string; + } /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; + * Use this to have a random data crypto key generated. It will be discarded + * after the request finishes. + */ + export interface Schema$GooglePrivacyDlpV2beta2TransientCryptoKey { + /** + * Name of the key. [required] This is an arbitrary string used to + * differentiate different keys. A unique key is generated per name: two + * separate `TransientCryptoKey` protos share the same generated key if + * their names are the same. When the data crypto key is generated, this + * name is not used in any way (repeating the api call will result in a + * different key being generated). + */ + name: string; + } /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. + * What event needs to occur for a new job to be started. */ - year: number; -} -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - */ -export interface Schema$GoogleTypeTimeOfDay { + export interface Schema$GooglePrivacyDlpV2beta2Trigger { + /** + * Create a job on a repeating basis based on the elapse of time. + */ + schedule: Schema$GooglePrivacyDlpV2beta2Schedule; + } /** - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing - * time. + * Using raw keys is prone to security risks due to accidentally leaking the + * key. Choose another type of key if possible. */ - hours: number; + export interface Schema$GooglePrivacyDlpV2beta2UnwrappedCryptoKey { + /** + * The AES 128/192/256 bit key. [required] + */ + key: string; + } /** - * Minutes of hour of day. Must be from 0 to 59. - */ - minutes: number; + * Request message for UpdateDeidentifyTemplate. + */ + export interface Schema$GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest { + /** + * New DeidentifyTemplate value. + */ + deidentifyTemplate: Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate; + /** + * Mask to control which fields get updated. + */ + updateMask: string; + } /** - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - */ - nanos: number; + * Request message for UpdateInspectTemplate. + */ + export interface Schema$GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest { + /** + * New InspectTemplate value. + */ + inspectTemplate: Schema$GooglePrivacyDlpV2beta2InspectTemplate; + /** + * Mask to control which fields get updated. + */ + updateMask: string; + } /** - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. - */ - seconds: number; -} - -export class Resource$Infotypes { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); + * Request message for UpdateJobTrigger. + */ + export interface Schema$GooglePrivacyDlpV2beta2UpdateJobTriggerRequest { + /** + * New JobTrigger value. + */ + jobTrigger: Schema$GooglePrivacyDlpV2beta2JobTrigger; + /** + * Mask to control which fields get updated. + */ + updateMask: string; } - - getRoot() { - return this.root; + /** + * Set of primitive values supported by the system. Note that for the purposes + * of inspection or transformation, the number of bytes considered to comprise + * a 'Value' is based on its representation as a UTF-8 encoded string. + * For example, if 'integer_value' is set to 123456789, the number of + * bytes would be counted as 9, even though an int64 only holds up to 8 bytes + * of data. + */ + export interface Schema$GooglePrivacyDlpV2beta2Value { + booleanValue: boolean; + dateValue: Schema$GoogleTypeDate; + dayOfWeekValue: string; + floatValue: number; + integerValue: string; + stringValue: string; + timestampValue: string; + timeValue: Schema$GoogleTypeTimeOfDay; } - - /** - * dlp.infoTypes.list - * @desc Returns sensitive information types DLP supports. - * @alias dlp.infoTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional filter to only return infoTypes supported by certain parts of the API. Defaults to supported_by=INSPECT. - * @param {string=} params.languageCode Optional BCP-47 language code for localized infoType friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/infoTypes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>(parameters); - } + * A value of a field, including its frequency. + */ + export interface Schema$GooglePrivacyDlpV2beta2ValueFrequency { + /** + * How many times the value is contained in the field. + */ + count: string; + /** + * A value contained in the field in question. + */ + value: Schema$GooglePrivacyDlpV2beta2Value; } -} - -export class Resource$Organizations { - root: Dlp; - deidentifyTemplates: Resource$Organizations$Deidentifytemplates; - inspectTemplates: Resource$Organizations$Inspecttemplates; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.deidentifyTemplates = - new Resource$Organizations$Deidentifytemplates(root); - this.inspectTemplates = new Resource$Organizations$Inspecttemplates(root); + /** + * Message defining a list of words or phrases to search for in the data. + */ + export interface Schema$GooglePrivacyDlpV2beta2WordList { + /** + * Words or phrases defining the dictionary. The dictionary must contain at + * least one phrase and every phrase must contain at least 2 characters that + * are letters or digits. [required] + */ + words: string[]; } - - getRoot() { - return this.root; + /** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobufEmpty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpcStatus { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } -} -export class Resource$Organizations$Deidentifytemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); + /** + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeDate { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; } - - getRoot() { - return this.root; + /** + * Represents a time of day. The date and time zone are either not significant + * or are specified elsewhere. An API may choose to allow leap seconds. + * Related types are google.type.Date and `google.protobuf.Timestamp`. + */ + export interface Schema$GoogleTypeTimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business + * closing time. + */ + hours: number; + /** + * Minutes of hour of day. Must be from 0 to 59. + */ + minutes: number; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + */ + nanos: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds: number; } - - /** - * dlp.organizations.deidentifyTemplates.create - * @desc Creates an Deidentify template for re-using frequently used - * configuration for Deidentifying content, images, and storage. - * @alias dlp.organizations.deidentifyTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Infotypes { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.organizations.deidentifyTemplates.delete - * @desc Deletes inspect templates. - * @alias dlp.organizations.deidentifyTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.infoTypes.list + * @desc Returns sensitive information types DLP supports. + * @alias dlp.infoTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional filter to only return infoTypes supported by certain parts of the API. Defaults to supported_by=INSPECT. + * @param {string=} params.languageCode Optional BCP-47 language code for localized infoType friendly names. If omitted, or if localized strings are not available, en-US strings will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/infoTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListInfoTypesResponse>(parameters); + } } } + export class Resource$Organizations { + root: Dlp; + deidentifyTemplates: Resource$Organizations$Deidentifytemplates; + inspectTemplates: Resource$Organizations$Inspecttemplates; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.deidentifyTemplates = + new Resource$Organizations$Deidentifytemplates(root); + this.inspectTemplates = new Resource$Organizations$Inspecttemplates(root); + } - /** - * dlp.organizations.deidentifyTemplates.get - * @desc Gets an inspect template. - * @alias dlp.organizations.deidentifyTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Organizations$Deidentifytemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.organizations.deidentifyTemplates.list - * @desc Lists inspect templates. - * @alias dlp.organizations.deidentifyTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): - void|AxiosPromise< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.organizations.deidentifyTemplates.create + * @desc Creates an Deidentify template for re-using frequently used + * configuration for Deidentifying content, images, and storage. + * @alias dlp.organizations.deidentifyTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( - parameters); - } - } - /** - * dlp.organizations.deidentifyTemplates.patch - * @desc Updates the inspect template. - * @alias dlp.organizations.deidentifyTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {().GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.organizations.deidentifyTemplates.delete + * @desc Deletes inspect templates. + * @alias dlp.organizations.deidentifyTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Organizations$Inspecttemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.organizations.deidentifyTemplates.get + * @desc Gets an inspect template. + * @alias dlp.organizations.deidentifyTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } + } - /** - * dlp.organizations.inspectTemplates.create - * @desc Creates an inspect template for re-using frequently used - * configuration for inspecting content, images, and storage. - * @alias dlp.organizations.inspectTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2beta2CreateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dlp.organizations.deidentifyTemplates.list + * @desc Lists inspect templates. + * @alias dlp.organizations.deidentifyTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): + void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): + void|AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( + parameters); + } } - } - /** - * dlp.organizations.inspectTemplates.delete - * @desc Deletes inspect templates. - * @alias dlp.organizations.inspectTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.organizations.deidentifyTemplates.patch + * @desc Updates the inspect template. + * @alias dlp.organizations.deidentifyTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {().GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } } } - - /** - * dlp.organizations.inspectTemplates.get - * @desc Gets an inspect template. - * @alias dlp.organizations.inspectTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Organizations$Inspecttemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.organizations.inspectTemplates.list - * @desc Lists inspect templates. - * @alias dlp.organizations.inspectTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.organizations.inspectTemplates.create + * @desc Creates an inspect template for re-using frequently used + * configuration for inspecting content, images, and storage. + * @alias dlp.organizations.inspectTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2beta2CreateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( - parameters); - } - } - /** - * dlp.organizations.inspectTemplates.patch - * @desc Updates the inspect template. - * @alias dlp.organizations.inspectTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {().GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dlp.organizations.inspectTemplates.delete + * @desc Deletes inspect templates. + * @alias dlp.organizations.inspectTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects { - root: Dlp; - content: Resource$Projects$Content; - dataSource: Resource$Projects$Datasource; - deidentifyTemplates: Resource$Projects$Deidentifytemplates; - dlpJobs: Resource$Projects$Dlpjobs; - image: Resource$Projects$Image; - inspectTemplates: Resource$Projects$Inspecttemplates; - jobTriggers: Resource$Projects$Jobtriggers; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - this.content = new Resource$Projects$Content(root); - this.dataSource = new Resource$Projects$Datasource(root); - this.deidentifyTemplates = new Resource$Projects$Deidentifytemplates(root); - this.dlpJobs = new Resource$Projects$Dlpjobs(root); - this.image = new Resource$Projects$Image(root); - this.inspectTemplates = new Resource$Projects$Inspecttemplates(root); - this.jobTriggers = new Resource$Projects$Jobtriggers(root); - } + /** + * dlp.organizations.inspectTemplates.get + * @desc Gets an inspect template. + * @alias dlp.organizations.inspectTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Content { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.organizations.inspectTemplates.list + * @desc Lists inspect templates. + * @alias dlp.organizations.inspectTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): + void|AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( + parameters); + } + } - /** - * dlp.projects.content.deidentify - * @desc De-identifies potentially sensitive info from a ContentItem. This - * method has limits on input size and output size. [How-to - * guide](/dlp/docs/deidentify-sensitive-data) - * @alias dlp.projects.content.deidentify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2DeidentifyContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deidentify(params?: any, options?: MethodOptions): - AxiosPromise; - deidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>): void; - deidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/content:deidentify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>(parameters); + /** + * dlp.organizations.inspectTemplates.patch + * @desc Updates the inspect template. + * @alias dlp.organizations.inspectTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {().GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - /** - * dlp.projects.content.inspect - * @desc Finds potentially sensitive info in content. This method has limits - * on input size, processing time, and output size. [How-to guide for - * text](/dlp/docs/inspecting-text), [How-to guide for - * images](/dlp/docs/inspecting-images) - * @alias dlp.projects.content.inspect - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2InspectContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - inspect(params?: any, options?: MethodOptions): - AxiosPromise; - inspect( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2InspectContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2InspectContentResponse>): void; - inspect( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2InspectContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2InspectContentResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Dlp; + content: Resource$Projects$Content; + dataSource: Resource$Projects$Datasource; + deidentifyTemplates: Resource$Projects$Deidentifytemplates; + dlpJobs: Resource$Projects$Dlpjobs; + image: Resource$Projects$Image; + inspectTemplates: Resource$Projects$Inspecttemplates; + jobTriggers: Resource$Projects$Jobtriggers; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + this.content = new Resource$Projects$Content(root); + this.dataSource = new Resource$Projects$Datasource(root); + this.deidentifyTemplates = + new Resource$Projects$Deidentifytemplates(root); + this.dlpJobs = new Resource$Projects$Dlpjobs(root); + this.image = new Resource$Projects$Image(root); + this.inspectTemplates = new Resource$Projects$Inspecttemplates(root); + this.jobTriggers = new Resource$Projects$Jobtriggers(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/content:inspect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2InspectContentResponse>(parameters); - } - } - - /** - * dlp.projects.content.reidentify - * @desc Re-identify content that has been de-identified. - * @alias dlp.projects.content.reidentify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name. - * @param {().GooglePrivacyDlpV2beta2ReidentifyContentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reidentify(params?: any, options?: MethodOptions): - AxiosPromise; - reidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>): void; - reidentify( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Content { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/content:reidentify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Datasource { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.content.deidentify + * @desc De-identifies potentially sensitive info from a ContentItem. This + * method has limits on input size and output size. [How-to + * guide](/dlp/docs/deidentify-sensitive-data) + * @alias dlp.projects.content.deidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2DeidentifyContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deidentify(params?: any, options?: MethodOptions): + AxiosPromise; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>): void; + deidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/content:deidentify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyContentResponse>( + parameters); + } + } - /** - * dlp.projects.dataSource.analyze - * @desc Schedules a job to compute risk analysis metrics over content in a - * Google Cloud Platform repository. [How-to - * guide](/dlp/docs/compute-risk-analysis) - * @alias dlp.projects.dataSource.analyze - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyze(params?: any, options?: MethodOptions): - AxiosPromise; - analyze( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - analyze( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/dataSource:analyze') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.content.inspect + * @desc Finds potentially sensitive info in content. This method has limits + * on input size, processing time, and output size. [How-to guide for + * text](/dlp/docs/inspecting-text), [How-to guide for + * images](/dlp/docs/inspecting-images) + * @alias dlp.projects.content.inspect + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2InspectContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + inspect(params?: any, options?: MethodOptions): + AxiosPromise; + inspect( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectContentResponse>): void; + inspect( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectContentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/content:inspect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2InspectContentResponse>(parameters); + } } - } - /** - * dlp.projects.dataSource.inspect - * @desc Schedules a job scanning content in a Google Cloud Platform data - * repository. [How-to guide](/dlp/docs/inspecting-storage) - * @alias dlp.projects.dataSource.inspect - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2InspectDataSourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - inspect(params?: any, options?: MethodOptions): - AxiosPromise; - inspect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - inspect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/dataSource:inspect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.content.reidentify + * @desc Re-identify content that has been de-identified. + * @alias dlp.projects.content.reidentify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name. + * @param {().GooglePrivacyDlpV2beta2ReidentifyContentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reidentify(params?: any, options?: MethodOptions): + AxiosPromise; + reidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>): void; + reidentify( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/content:reidentify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ReidentifyContentResponse>( + parameters); + } } } -} -export class Resource$Projects$Deidentifytemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Datasource { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * dlp.projects.deidentifyTemplates.create - * @desc Creates an Deidentify template for re-using frequently used - * configuration for Deidentifying content, images, and storage. - * @alias dlp.projects.deidentifyTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.dataSource.analyze + * @desc Schedules a job to compute risk analysis metrics over content in a + * Google Cloud Platform repository. [How-to + * guide](/dlp/docs/compute-risk-analysis) + * @alias dlp.projects.dataSource.analyze + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2AnalyzeDataSourceRiskRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyze(params?: any, options?: MethodOptions): + AxiosPromise; + analyze( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + analyze( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/dataSource:analyze') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.projects.deidentifyTemplates.delete - * @desc Deletes inspect templates. - * @alias dlp.projects.deidentifyTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.dataSource.inspect + * @desc Schedules a job scanning content in a Google Cloud Platform data + * repository. [How-to guide](/dlp/docs/inspecting-storage) + * @alias dlp.projects.dataSource.inspect + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2InspectDataSourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + inspect(params?: any, options?: MethodOptions): + AxiosPromise; + inspect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + inspect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/dataSource:inspect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.projects.deidentifyTemplates.get - * @desc Gets an inspect template. - * @alias dlp.projects.deidentifyTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Deidentifytemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.deidentifyTemplates.list - * @desc Lists inspect templates. - * @alias dlp.projects.deidentifyTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): - void|AxiosPromise< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.deidentifyTemplates.create + * @desc Creates an Deidentify template for re-using frequently used + * configuration for Deidentifying content, images, and storage. + * @alias dlp.projects.deidentifyTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2beta2CreateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( - parameters); - } - } - /** - * dlp.projects.deidentifyTemplates.patch - * @desc Updates the inspect template. - * @alias dlp.projects.deidentifyTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. - * @param {().GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.deidentifyTemplates.delete + * @desc Deletes inspect templates. + * @alias dlp.projects.deidentifyTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be deleted, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Projects$Dlpjobs { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.deidentifyTemplates.get + * @desc Gets an inspect template. + * @alias dlp.projects.deidentifyTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and deidentify template to be read, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } + } - /** - * dlp.projects.dlpJobs.cancel - * @desc Starts asynchronous cancellation on a long-running DlpJob. The - * server makes a best effort to cancel the DlpJob, but success is not - * guaranteed. - * @alias dlp.projects.dlpJobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource to be cancelled. - * @param {().GooglePrivacyDlpV2beta2CancelDlpJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.deidentifyTemplates.list + * @desc Lists inspect templates. + * @alias dlp.projects.deidentifyTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListDeidentifyTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): + void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>): + void|AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/deidentifyTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListDeidentifyTemplatesResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dlp.projects.dlpJobs.delete - * @desc Deletes a long-running DlpJob. This method indicates that the client - * is no longer interested in the DlpJob result. The job will be cancelled if - * possible. - * @alias dlp.projects.dlpJobs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.deidentifyTemplates.patch + * @desc Updates the inspect template. + * @alias dlp.projects.deidentifyTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and deidentify template to be updated, for example `organizations/433245324/deidentifyTemplates/432452342` or projects/project-id/deidentifyTemplates/432452342. + * @param {().GooglePrivacyDlpV2beta2UpdateDeidentifyTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2DeidentifyTemplate>(parameters); + } } } - - /** - * dlp.projects.dlpJobs.get - * @desc Gets the latest state of a long-running DlpJob. - * @alias dlp.projects.dlpJobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the DlpJob resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Dlpjobs { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.dlpJobs.list - * @desc Lists DlpJobs that match the specified filter in the request. - * @alias dlp.projects.dlpJobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of ` `. * Supported fields/values for inspect jobs: - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The resource name of the trigger that created job. * Supported fields for risk analysis jobs: - `state` - RUNNING|CANCELED|FINISHED|FAILED * The operator must be `=` or `!=`. Examples: * inspected_storage = cloud_storage AND state = done * inspected_storage = cloud_storage OR inspected_storage = bigquery * inspected_storage = cloud_storage AND (state = done OR state = canceled) The length of this field should be no more than 500 characters. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {string=} params.type The type of job. Defaults to `DlpJobType.INSPECT` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.dlpJobs.cancel + * @desc Starts asynchronous cancellation on a long-running DlpJob. The + * server makes a best effort to cancel the DlpJob, but success is not + * guaranteed. + * @alias dlp.projects.dlpJobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource to be cancelled. + * @param {().GooglePrivacyDlpV2beta2CancelDlpJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/dlpJobs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>(parameters); - } - } -} -export class Resource$Projects$Image { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.dlpJobs.delete + * @desc Deletes a long-running DlpJob. This method indicates that the + * client is no longer interested in the DlpJob result. The job will be + * cancelled if possible. + * @alias dlp.projects.dlpJobs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dlp.projects.image.redact - * @desc Redacts potentially sensitive info from an image. This method has - * limits on input size, processing time, and output size. [How-to - * guide](/dlp/docs/redacting-sensitive-data-images) - * @alias dlp.projects.image.redact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2RedactImageRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - redact(params?: any, options?: MethodOptions): - AxiosPromise; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2RedactImageResponse>): void; - redact( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2RedactImageResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.dlpJobs.get + * @desc Gets the latest state of a long-running DlpJob. + * @alias dlp.projects.dlpJobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the DlpJob resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/image:redact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2RedactImageResponse>(parameters); - } - } -} -export class Resource$Projects$Inspecttemplates { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dlp.projects.dlpJobs.list + * @desc Lists DlpJobs that match the specified filter in the request. + * @alias dlp.projects.dlpJobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions can be combined by `AND` or `OR` logical operators. A sequence of restrictions implicitly uses `AND`. * A restriction has the form of ` `. * Supported fields/values for inspect jobs: - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY - `trigger_name` - The resource name of the trigger that created job. * Supported fields for risk analysis jobs: - `state` - RUNNING|CANCELED|FINISHED|FAILED * The operator must be `=` or `!=`. Examples: * inspected_storage = cloud_storage AND state = done * inspected_storage = cloud_storage OR inspected_storage = bigquery * inspected_storage = cloud_storage AND (state = done OR state = canceled) The length of this field should be no more than 500 characters. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {string=} params.type The type of job. Defaults to `DlpJobType.INSPECT` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/dlpJobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListDlpJobsResponse>(parameters); + } + } } - - /** - * dlp.projects.inspectTemplates.create - * @desc Creates an inspect template for re-using frequently used - * configuration for inspecting content, images, and storage. - * @alias dlp.projects.inspectTemplates.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {().GooglePrivacyDlpV2beta2CreateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Image { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.inspectTemplates.delete - * @desc Deletes inspect templates. - * @alias dlp.projects.inspectTemplates.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.image.redact + * @desc Redacts potentially sensitive info from an image. This method has + * limits on input size, processing time, and output size. [How-to + * guide](/dlp/docs/redacting-sensitive-data-images) + * @alias dlp.projects.image.redact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2RedactImageRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + redact(params?: any, options?: MethodOptions): + AxiosPromise; + redact( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2RedactImageResponse>): void; + redact( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2RedactImageResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/image:redact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2RedactImageResponse>(parameters); + } } } - - /** - * dlp.projects.inspectTemplates.get - * @desc Gets an inspect template. - * @alias dlp.projects.inspectTemplates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Inspecttemplates { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.inspectTemplates.list - * @desc Lists inspect templates. - * @alias dlp.projects.inspectTemplates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. - * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.inspectTemplates.create + * @desc Creates an inspect template for re-using frequently used + * configuration for inspecting content, images, and storage. + * @alias dlp.projects.inspectTemplates.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {().GooglePrivacyDlpV2beta2CreateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( - parameters); - } - } - /** - * dlp.projects.inspectTemplates.patch - * @desc Updates the inspect template. - * @alias dlp.projects.inspectTemplates.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. - * @param {().GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * dlp.projects.inspectTemplates.delete + * @desc Deletes inspect templates. + * @alias dlp.projects.inspectTemplates.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be deleted, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Jobtriggers { - root: Dlp; - constructor(root: Dlp) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dlp.projects.inspectTemplates.get + * @desc Gets an inspect template. + * @alias dlp.projects.inspectTemplates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the organization and inspectTemplate to be read, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - /** - * dlp.projects.jobTriggers.create - * @desc Creates a job to run DLP actions such as scanning storage for - * sensitive information on a set schedule. - * @alias dlp.projects.jobTriggers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {().GooglePrivacyDlpV2beta2CreateJobTriggerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dlp.projects.inspectTemplates.list + * @desc Lists inspect templates. + * @alias dlp.projects.inspectTemplates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional size of the page, can be limited by server. If zero server returns a page of max size 100. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to `ListInspectTemplates`. + * @param {string} params.parent The parent resource name, for example projects/my-project-id or organizations/my-org-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>): + void|AxiosPromise< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/inspectTemplates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListInspectTemplatesResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/jobTriggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * dlp.projects.jobTriggers.delete - * @desc Deletes a job trigger. - * @alias dlp.projects.jobTriggers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dlp.projects.inspectTemplates.patch + * @desc Updates the inspect template. + * @alias dlp.projects.inspectTemplates.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of organization and inspectTemplate to be updated, for example `organizations/433245324/inspectTemplates/432452342` or projects/project-id/inspectTemplates/432452342. + * @param {().GooglePrivacyDlpV2beta2UpdateInspectTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2InspectTemplate>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dlp.projects.jobTriggers.get - * @desc Gets a job trigger. - * @alias dlp.projects.jobTriggers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Jobtriggers { + root: Dlp; + constructor(root: Dlp) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * dlp.projects.jobTriggers.list - * @desc Lists job triggers. - * @alias dlp.projects.jobTriggers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.orderBy Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. `"create_time asc,name desc,schedule_mode asc"`. This list is case-insensitive. Example: `"name asc,schedule_mode desc, status desc"` Supported filters keys and values are: - `create_time`: corresponds to time the triggeredJob was created. - `update_time`: corresponds to time the triggeredJob was last updated. - `name`: corresponds to JobTrigger's display name. - `status`: corresponds to the triggeredJob status. - * @param {integer=} params.pageSize Optional size of the page, can be limited by a server. - * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to ListJobTriggers. `order_by` and `filter` should not change for subsequent calls, but can be omitted if token is specified. - * @param {string} params.parent The parent resource name, for example projects/my-project-id. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>, - callback?: BodyResponseCallback< - Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.jobTriggers.create + * @desc Creates a job to run DLP actions such as scanning storage for + * sensitive information on a set schedule. + * @alias dlp.projects.jobTriggers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {().GooglePrivacyDlpV2beta2CreateJobTriggerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/jobTriggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+parent}/jobTriggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>(parameters); + + + /** + * dlp.projects.jobTriggers.delete + * @desc Deletes a job trigger. + * @alias dlp.projects.jobTriggers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dlp.projects.jobTriggers.patch - * @desc Updates a job trigger. - * @alias dlp.projects.jobTriggers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. - * @param {().GooglePrivacyDlpV2beta2UpdateJobTriggerRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dlp.projects.jobTriggers.get + * @desc Gets a job trigger. + * @alias dlp.projects.jobTriggers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * dlp.projects.jobTriggers.list + * @desc Lists job triggers. + * @alias dlp.projects.jobTriggers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.orderBy Optional comma separated list of triggeredJob fields to order by, followed by 'asc/desc' postfix, i.e. `"create_time asc,name desc,schedule_mode asc"`. This list is case-insensitive. Example: `"name asc,schedule_mode desc, status desc"` Supported filters keys and values are: - `create_time`: corresponds to time the triggeredJob was created. - `update_time`: corresponds to time the triggeredJob was last updated. - `name`: corresponds to JobTrigger's display name. - `status`: corresponds to the triggeredJob status. + * @param {integer=} params.pageSize Optional size of the page, can be limited by a server. + * @param {string=} params.pageToken Optional page token to continue retrieval. Comes from previous call to ListJobTriggers. `order_by` and `filter` should not change for subsequent calls, but can be omitted if token is specified. + * @param {string} params.parent The parent resource name, for example projects/my-project-id. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>, + callback?: BodyResponseCallback< + Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+parent}/jobTriggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GooglePrivacyDlpV2beta2ListJobTriggersResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * dlp.projects.jobTriggers.patch + * @desc Updates a job trigger. + * @alias dlp.projects.jobTriggers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the project and the triggeredJob, for example `projects/dlp-test-project/jobTriggers/53234423`. + * @param {().GooglePrivacyDlpV2beta2UpdateJobTriggerRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://dlp.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/dns/v1.ts b/src/apis/dns/v1.ts index a3b413397ba..3c880ac0ec4 100644 --- a/src/apis/dns/v1.ts +++ b/src/apis/dns/v1.ts @@ -27,2046 +27,2077 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud DNS API - * - * Configures and serves authoritative DNS records. - * - * @example - * const google = require('googleapis'); - * const dns = google.dns('v1'); - * - * @namespace dns - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Dns - */ -export class Dns { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dns_v1 { + /** + * Google Cloud DNS API + * + * Configures and serves authoritative DNS records. + * + * @example + * const google = require('googleapis'); + * const dns = google.dns('v1'); + * + * @namespace dns + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Dns + */ + export class Dns { + _options: GlobalOptions; + google: GoogleApis; + root = this; - changes: Resource$Changes; - dnsKeys: Resource$Dnskeys; - managedZoneOperations: Resource$Managedzoneoperations; - managedZones: Resource$Managedzones; - projects: Resource$Projects; - resourceRecordSets: Resource$Resourcerecordsets; + changes: Resource$Changes; + dnsKeys: Resource$Dnskeys; + managedZoneOperations: Resource$Managedzoneoperations; + managedZones: Resource$Managedzones; + projects: Resource$Projects; + resourceRecordSets: Resource$Resourcerecordsets; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.changes = new Resource$Changes(this); - this.dnsKeys = new Resource$Dnskeys(this); - this.managedZoneOperations = new Resource$Managedzoneoperations(this); - this.managedZones = new Resource$Managedzones(this); - this.projects = new Resource$Projects(this); - this.resourceRecordSets = new Resource$Resourcerecordsets(this); - } + this.changes = new Resource$Changes(this); + this.dnsKeys = new Resource$Dnskeys(this); + this.managedZoneOperations = new Resource$Managedzoneoperations(this); + this.managedZones = new Resource$Managedzones(this); + this.projects = new Resource$Projects(this); + this.resourceRecordSets = new Resource$Resourcerecordsets(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An atomic update to a collection of ResourceRecordSets. - */ -export interface Schema$Change { - /** - * Which ResourceRecordSets to add? - */ - additions: Schema$ResourceRecordSet[]; - /** - * Which ResourceRecordSets to remove? Must match existing data exactly. - */ - deletions: Schema$ResourceRecordSet[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * If the DNS queries for the zone will be served. - */ - isServing: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#change". - */ - kind: string; - /** - * The time that this operation was started by the server (output only). This - * is in RFC3339 text format. - */ - startTime: string; - /** - * Status of the operation (output only). - */ - status: string; -} -/** - * The response to a request to enumerate Changes to a ResourceRecordSets - * collection. - */ -export interface Schema$ChangesListResponse { - /** - * The requested changes. - */ - changes: Schema$Change[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * A DNSSEC key pair. - */ -export interface Schema$DnsKey { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. Immutable - * after creation time. - */ - algorithm: string; - /** - * The time that this resource was created in the control plane. This is in - * RFC3339 text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the resource's - * function. - */ - description: string; - /** - * Cryptographic hashes of the DNSKEY resource record associated with this - * DnsKey. These digests are needed to construct a DS record that points at - * this DNS key. Output only. - */ - digests: Schema$DnsKeyDigest[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * Active keys will be used to sign subsequent changes to the ManagedZone. - * Inactive keys will still be present as DNSKEY Resource Records for the use - * of resolvers validating existing signatures. - */ - isActive: boolean; /** - * Length of the key in bits. Specified at creation time then immutable. - */ - keyLength: number; - /** - * The key tag is a non-cryptographic hash of the a DNSKEY resource record - * associated with this DnsKey. The key tag can be used to identify a DNSKEY - * more quickly (but it is not a unique identifier). In particular, the key - * tag is used in a parent zone's DS record to point at the DNSKEY in this - * child ManagedZone. The key tag is a number in the range [0, 65535] and the - * algorithm to calculate it is specified in RFC4034 Appendix B. Output only. - */ - keyTag: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKey". - */ - kind: string; - /** - * Base64 encoded public half of this key. Output only. - */ - publicKey: string; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. Immutable after creation time. - */ - type: string; -} -export interface Schema$DnsKeyDigest { - /** - * The base-16 encoded bytes of this digest. Suitable for use in a DS resource - * record. - */ - digest: string; - /** - * Specifies the algorithm used to calculate this digest. - */ - type: string; -} -/** - * The response to a request to enumerate DnsKeys in a ManagedZone. - */ -export interface Schema$DnsKeysListResponse { - /** - * The requested resources. - */ - dnsKeys: Schema$DnsKey[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * Parameters for DnsKey key generation. Used for generating initial keys for a - * new ManagedZone and as default when adding a new DnsKey. - */ -export interface Schema$DnsKeySpec { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. - */ - algorithm: string; - /** - * Length of the keys in bits. - */ - keyLength: number; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. - */ - keyType: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKeySpec". - */ - kind: string; -} -/** - * A zone is a subtree of the DNS namespace under one administrative - * responsibility. A ManagedZone is a resource that represents a DNS zone hosted - * by the Cloud DNS service. - */ -export interface Schema$ManagedZone { - /** - * The time that this resource was created on the server. This is in RFC3339 - * text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the managed zone's - * function. - */ - description: string; - /** - * The DNS name of this managed zone, for instance "example.com.". - */ - dnsName: string; - /** - * DNSSEC configuration. - */ - dnssecConfig: Schema$ManagedZoneDnsSecConfig; - /** - * Unique identifier for the resource; defined by the server (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZone". - */ - kind: string; - /** - * User labels. - */ - labels: any; - /** - * User assigned name for this resource. Must be unique within the project. - * The name must be 1-63 characters long, must begin with a letter, end with a - * letter or digit, and only contain lowercase letters, digits or dashes. - */ - name: string; - /** - * Delegate your managed_zone to these virtual name servers; defined by the - * server (output only) - */ - nameServers: string[]; - /** - * Optionally specifies the NameServerSet for this ManagedZone. A - * NameServerSet is a set of DNS name servers that all host the same - * ManagedZones. Most users will leave this field unset. - */ - nameServerSet: string; -} -export interface Schema$ManagedZoneDnsSecConfig { - /** - * Specifies parameters that will be used for generating initial DnsKeys for - * this ManagedZone. Output only while state is not OFF. - */ - defaultKeySpecs: Schema$DnsKeySpec[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZoneDnsSecConfig". - */ - kind: string; - /** - * Specifies the mechanism used to provide authenticated denial-of-existence - * responses. Output only while state is not OFF. - */ - nonExistence: string; - /** - * Specifies whether DNSSEC is enabled, and what mode it is in. - */ - state: string; -} -export interface Schema$ManagedZoneOperationsListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; - /** - * The operation resources. - */ - operations: Schema$Operation[]; -} -export interface Schema$ManagedZonesListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The managed zone resources. - */ - managedZones: Schema$ManagedZone[]; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; -} -/** - * An operation represents a successful mutation performed on a Cloud DNS - * resource. Operations provide: - An audit log of server resource mutations. - - * A way to recover/retry API calls in the case where the response is never - * received by the caller. Use the caller specified client_operation_id. - */ -export interface Schema$Operation { - /** - * Only populated if the operation targeted a DnsKey (output only). - */ - dnsKeyContext: Schema$OperationDnsKeyContext; - /** - * Unique identifier for the resource. This is the client_operation_id if the - * client specified it when the mutation was initiated, otherwise, it is - * generated by the server. The name must be 1-63 characters long and match - * the regular expression [-a-z0-9]? (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#operation". - */ - kind: string; - /** - * The time that this operation was started by the server. This is in RFC3339 - * text format (output only). - */ - startTime: string; - /** - * Status of the operation. Can be one of the following: "PENDING" - * or "DONE" (output only). - */ - status: string; - /** - * Type of the operation. Operations include insert, update, and delete - * (output only). - */ - type: string; - /** - * User who requested the operation, for example: user@example.com. - * cloud-dns-system for operations automatically done by the system. (output - * only) - */ - user: string; - /** - * Only populated if the operation targeted a ManagedZone (output only). - */ - zoneContext: Schema$OperationManagedZoneContext; -} -export interface Schema$OperationDnsKeyContext { - /** - * The post-operation DnsKey resource. - */ - newValue: Schema$DnsKey; - /** - * The pre-operation DnsKey resource. - */ - oldValue: Schema$DnsKey; -} -export interface Schema$OperationManagedZoneContext { - /** - * The post-operation ManagedZone resource. - */ - newValue: Schema$ManagedZone; - /** - * The pre-operation ManagedZone resource. - */ - oldValue: Schema$ManagedZone; -} -/** - * A project resource. The project is a top level container for resources - * including Cloud DNS ManagedZones. Projects can be created only in the APIs - * console. - */ -export interface Schema$Project { - /** - * User assigned unique identifier for the resource (output only). - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#project". - */ - kind: string; - /** - * Unique numeric identifier for the resource; defined by the server (output - * only). - */ - number: string; - /** - * Quotas assigned to this project (output only). - */ - quota: Schema$Quota; -} -/** - * Limits associated with a Project. - */ -export interface Schema$Quota { - /** - * Whether a black hole zone should suppress system zones for this project. - */ - blackHoleHidesSystemZones: boolean; - /** - * Maximum allowed number of DnsKeys per ManagedZone. - */ - dnsKeysPerManagedZone: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#quota". - */ - kind: string; - /** - * Maximum allowed number of managed zones in the project. - */ - managedZones: number; - /** - * Maximum allowed number of ResourceRecords per ResourceRecordSet. - */ - resourceRecordsPerRrset: number; - /** - * Maximum allowed number of ResourceRecordSets to add per - * ChangesCreateRequest. - */ - rrsetAdditionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets to delete per - * ChangesCreateRequest. - */ - rrsetDeletionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets per zone in the project. - */ - rrsetsPerManagedZone: number; - /** - * Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes. - */ - totalRrdataSizePerChange: number; - /** - * DNSSEC algorithm and key length types that can be used for DnsKeys. - */ - whitelistedKeySpecs: Schema$DnsKeySpec[]; -} -/** - * A unit of data that will be returned by the DNS servers. - */ -export interface Schema$ResourceRecordSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#resourceRecordSet". - */ - kind: string; + * An atomic update to a collection of ResourceRecordSets. + */ + export interface Schema$Change { + /** + * Which ResourceRecordSets to add? + */ + additions: Schema$ResourceRecordSet[]; + /** + * Which ResourceRecordSets to remove? Must match existing data exactly. + */ + deletions: Schema$ResourceRecordSet[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * If the DNS queries for the zone will be served. + */ + isServing: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#change". + */ + kind: string; + /** + * The time that this operation was started by the server (output only). + * This is in RFC3339 text format. + */ + startTime: string; + /** + * Status of the operation (output only). + */ + status: string; + } /** - * For example, www.example.com. - */ - name: string; + * The response to a request to enumerate Changes to a ResourceRecordSets + * collection. + */ + export interface Schema$ChangesListResponse { + /** + * The requested changes. + */ + changes: Schema$Change[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). - */ - rrdatas: string[]; + * A DNSSEC key pair. + */ + export interface Schema$DnsKey { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. Immutable + * after creation time. + */ + algorithm: string; + /** + * The time that this resource was created in the control plane. This is in + * RFC3339 text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the resource's + * function. + */ + description: string; + /** + * Cryptographic hashes of the DNSKEY resource record associated with this + * DnsKey. These digests are needed to construct a DS record that points at + * this DNS key. Output only. + */ + digests: Schema$DnsKeyDigest[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * Active keys will be used to sign subsequent changes to the ManagedZone. + * Inactive keys will still be present as DNSKEY Resource Records for the + * use of resolvers validating existing signatures. + */ + isActive: boolean; + /** + * Length of the key in bits. Specified at creation time then immutable. + */ + keyLength: number; + /** + * The key tag is a non-cryptographic hash of the a DNSKEY resource record + * associated with this DnsKey. The key tag can be used to identify a DNSKEY + * more quickly (but it is not a unique identifier). In particular, the key + * tag is used in a parent zone's DS record to point at the DNSKEY in + * this child ManagedZone. The key tag is a number in the range [0, 65535] + * and the algorithm to calculate it is specified in RFC4034 Appendix B. + * Output only. + */ + keyTag: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKey". + */ + kind: string; + /** + * Base64 encoded public half of this key. Output only. + */ + publicKey: string; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. Immutable after creation time. + */ + type: string; + } + export interface Schema$DnsKeyDigest { + /** + * The base-16 encoded bytes of this digest. Suitable for use in a DS + * resource record. + */ + digest: string; + /** + * Specifies the algorithm used to calculate this digest. + */ + type: string; + } /** - * As defined in RFC 4034 (section 3.2). - */ - signatureRrdatas: string[]; + * The response to a request to enumerate DnsKeys in a ManagedZone. + */ + export interface Schema$DnsKeysListResponse { + /** + * The requested resources. + */ + dnsKeys: Schema$DnsKey[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * Number of seconds that this ResourceRecordSet can be cached by resolvers. - */ - ttl: number; + * Parameters for DnsKey key generation. Used for generating initial keys for + * a new ManagedZone and as default when adding a new DnsKey. + */ + export interface Schema$DnsKeySpec { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. + */ + algorithm: string; + /** + * Length of the keys in bits. + */ + keyLength: number; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. + */ + keyType: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKeySpec". + */ + kind: string; + } /** - * The identifier of a supported record type, for example, A, AAAA, MX, TXT, - * and so on. - */ - type: string; -} -export interface Schema$ResourceRecordSetsListResponse { - header: Schema$ResponseHeader; + * A zone is a subtree of the DNS namespace under one administrative + * responsibility. A ManagedZone is a resource that represents a DNS zone + * hosted by the Cloud DNS service. + */ + export interface Schema$ManagedZone { + /** + * The time that this resource was created on the server. This is in RFC3339 + * text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the managed zone's + * function. + */ + description: string; + /** + * The DNS name of this managed zone, for instance "example.com.". + */ + dnsName: string; + /** + * DNSSEC configuration. + */ + dnssecConfig: Schema$ManagedZoneDnsSecConfig; + /** + * Unique identifier for the resource; defined by the server (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZone". + */ + kind: string; + /** + * User labels. + */ + labels: any; + /** + * User assigned name for this resource. Must be unique within the project. + * The name must be 1-63 characters long, must begin with a letter, end with + * a letter or digit, and only contain lowercase letters, digits or dashes. + */ + name: string; + /** + * Delegate your managed_zone to these virtual name servers; defined by the + * server (output only) + */ + nameServers: string[]; + /** + * Optionally specifies the NameServerSet for this ManagedZone. A + * NameServerSet is a set of DNS name servers that all host the same + * ManagedZones. Most users will leave this field unset. + */ + nameServerSet: string; + } + export interface Schema$ManagedZoneDnsSecConfig { + /** + * Specifies parameters that will be used for generating initial DnsKeys for + * this ManagedZone. Output only while state is not OFF. + */ + defaultKeySpecs: Schema$DnsKeySpec[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZoneDnsSecConfig". + */ + kind: string; + /** + * Specifies the mechanism used to provide authenticated denial-of-existence + * responses. Output only while state is not OFF. + */ + nonExistence: string; + /** + * Specifies whether DNSSEC is enabled, and what mode it is in. + */ + state: string; + } + export interface Schema$ManagedZoneOperationsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + /** + * The operation resources. + */ + operations: Schema$Operation[]; + } + export interface Schema$ManagedZonesListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The managed zone resources. + */ + managedZones: Schema$ManagedZone[]; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + } /** - * Type of resource. - */ - kind: string; + * An operation represents a successful mutation performed on a Cloud DNS + * resource. Operations provide: - An audit log of server resource mutations. + * - A way to recover/retry API calls in the case where the response is never + * received by the caller. Use the caller specified client_operation_id. + */ + export interface Schema$Operation { + /** + * Only populated if the operation targeted a DnsKey (output only). + */ + dnsKeyContext: Schema$OperationDnsKeyContext; + /** + * Unique identifier for the resource. This is the client_operation_id if + * the client specified it when the mutation was initiated, otherwise, it is + * generated by the server. The name must be 1-63 characters long and match + * the regular expression [-a-z0-9]? (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#operation". + */ + kind: string; + /** + * The time that this operation was started by the server. This is in + * RFC3339 text format (output only). + */ + startTime: string; + /** + * Status of the operation. Can be one of the following: "PENDING" + * or "DONE" (output only). + */ + status: string; + /** + * Type of the operation. Operations include insert, update, and delete + * (output only). + */ + type: string; + /** + * User who requested the operation, for example: user@example.com. + * cloud-dns-system for operations automatically done by the system. (output + * only) + */ + user: string; + /** + * Only populated if the operation targeted a ManagedZone (output only). + */ + zoneContext: Schema$OperationManagedZoneContext; + } + export interface Schema$OperationDnsKeyContext { + /** + * The post-operation DnsKey resource. + */ + newValue: Schema$DnsKey; + /** + * The pre-operation DnsKey resource. + */ + oldValue: Schema$DnsKey; + } + export interface Schema$OperationManagedZoneContext { + /** + * The post-operation ManagedZone resource. + */ + newValue: Schema$ManagedZone; + /** + * The pre-operation ManagedZone resource. + */ + oldValue: Schema$ManagedZone; + } /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a consistent snapshot of a collection larger than the - * maximum page size. - */ - nextPageToken: string; + * A project resource. The project is a top level container for resources + * including Cloud DNS ManagedZones. Projects can be created only in the APIs + * console. + */ + export interface Schema$Project { + /** + * User assigned unique identifier for the resource (output only). + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#project". + */ + kind: string; + /** + * Unique numeric identifier for the resource; defined by the server (output + * only). + */ + number: string; + /** + * Quotas assigned to this project (output only). + */ + quota: Schema$Quota; + } /** - * The resource record set resources. - */ - rrsets: Schema$ResourceRecordSet[]; -} -/** - * Elements common to every response. - */ -export interface Schema$ResponseHeader { + * Limits associated with a Project. + */ + export interface Schema$Quota { + /** + * Whether a black hole zone should suppress system zones for this project. + */ + blackHoleHidesSystemZones: boolean; + /** + * Maximum allowed number of DnsKeys per ManagedZone. + */ + dnsKeysPerManagedZone: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#quota". + */ + kind: string; + /** + * Maximum allowed number of managed zones in the project. + */ + managedZones: number; + /** + * Maximum allowed number of ResourceRecords per ResourceRecordSet. + */ + resourceRecordsPerRrset: number; + /** + * Maximum allowed number of ResourceRecordSets to add per + * ChangesCreateRequest. + */ + rrsetAdditionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets to delete per + * ChangesCreateRequest. + */ + rrsetDeletionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets per zone in the project. + */ + rrsetsPerManagedZone: number; + /** + * Maximum allowed size for total rrdata in one ChangesCreateRequest in + * bytes. + */ + totalRrdataSizePerChange: number; + /** + * DNSSEC algorithm and key length types that can be used for DnsKeys. + */ + whitelistedKeySpecs: Schema$DnsKeySpec[]; + } /** - * For mutating operation requests that completed successfully. This is the - * client_operation_id if the client specified it, otherwise it is generated - * by the server (output only). - */ - operationId: string; -} - -export class Resource$Changes { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); + * A unit of data that will be returned by the DNS servers. + */ + export interface Schema$ResourceRecordSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#resourceRecordSet". + */ + kind: string; + /** + * For example, www.example.com. + */ + name: string; + /** + * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). + */ + rrdatas: string[]; + /** + * As defined in RFC 4034 (section 3.2). + */ + signatureRrdatas: string[]; + /** + * Number of seconds that this ResourceRecordSet can be cached by resolvers. + */ + ttl: number; + /** + * The identifier of a supported record type, for example, A, AAAA, MX, TXT, + * and so on. + */ + type: string; } - - getRoot() { - return this.root; + export interface Schema$ResourceRecordSetsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a consistent snapshot of a + * collection larger than the maximum page size. + */ + nextPageToken: string; + /** + * The resource record set resources. + */ + rrsets: Schema$ResourceRecordSet[]; } - - /** - * dns.changes.create - * @desc Atomically update the ResourceRecordSet collection. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dns.changes.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().Change} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Elements common to every response. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ResponseHeader { + /** + * For mutating operation requests that completed successfully. This is the + * client_operation_id if the client specified it, otherwise it is generated + * by the server (output only). + */ + operationId: string; } - - /** - * dns.changes.get - * @desc Fetch the representation of an existing Change. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * // The identifier of the requested change, from a previous - * ResourceRecordSetsChangeResponse. changeId: 'my-change-id', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.changes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Changes { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/changes/{changeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'changeId'], - pathParams: ['changeId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.changes.list - * @desc Enumerate Changes to a ResourceRecordSet collection. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var changesPage = response['changes']; - * if (!changesPage) { - * return; - * } - * for (var i = 0; i < changesPage.length; i++) { - * // TODO: Change code below to process each resource in `changesPage`: - * console.log(JSON.stringify(changesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.changes.list(request, handlePage); - * } - * }; - * - * dns.changes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. - * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.changes.create + * @desc Atomically update the ResourceRecordSet collection. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dns.changes.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().Change} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Dnskeys { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.changes.get + * @desc Fetch the representation of an existing Change. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * // The identifier of the requested change, from a previous + * ResourceRecordSetsChangeResponse. changeId: 'my-change-id', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.changes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/changes/{changeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'changeId'], + pathParams: ['changeId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.dnsKeys.get - * @desc Fetch the representation of an existing DnsKey. - * @alias dns.dnsKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.dnsKeyId The identifier of the requested DnsKey. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'dnsKeyId'], - pathParams: ['dnsKeyId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.changes.list + * @desc Enumerate Changes to a ResourceRecordSet collection. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var changesPage = response['changes']; + * if (!changesPage) { + * return; + * } + * for (var i = 0; i < changesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `changesPage`: console.log(JSON.stringify(changesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.changes.list(request, handlePage); + * } + * }; + * + * dns.changes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. + * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.dnsKeys.list - * @desc Enumerate DnsKeys to a ResourceRecordSet collection. - * @alias dns.dnsKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Dnskeys { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzoneoperations { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.dnsKeys.get + * @desc Fetch the representation of an existing DnsKey. + * @alias dns.dnsKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.dnsKeyId The identifier of the requested DnsKey. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'dnsKeyId'], + pathParams: ['dnsKeyId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZoneOperations.get - * @desc Fetch the representation of an existing Operation. - * @alias dns.managedZoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {string} params.operation Identifies the operation addressed by this request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'operation'], - pathParams: ['managedZone', 'operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.dnsKeys.list + * @desc Enumerate DnsKeys to a ResourceRecordSet collection. + * @alias dns.dnsKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/dnsKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.managedZoneOperations.list - * @desc Enumerate Operations for the given ManagedZone. - * @alias dns.managedZoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Managedzoneoperations { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzones { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZoneOperations.get + * @desc Fetch the representation of an existing Operation. + * @alias dns.managedZoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {string} params.operation Identifies the operation addressed by this request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'operation'], + pathParams: ['managedZone', 'operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZones.create - * @desc Create a new ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZoneOperations.list + * @desc Enumerate Operations for the given ManagedZone. + * @alias dns.managedZoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dns.managedZones.delete - * @desc Delete a previously created ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Managedzones { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.managedZones.get - * @desc Fetch the representation of an existing ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dns.managedZones.create + * @desc Create a new ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dns.managedZones.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.list - * @desc Enumerate ManagedZones that have been created but not yet deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedZonesPage = response['managedZones']; - * if (!managedZonesPage) { - * return; - * } - * for (var i = 0; i < managedZonesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `managedZonesPage`: console.log(JSON.stringify(managedZonesPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZones.list(request, handlePage); - * } - * }; - * - * dns.managedZones.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.delete + * @desc Delete a previously created ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * dns.managedZones.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.patch - * @desc Update an existing ManagedZone. This method supports patch semantics. - * @alias dns.managedZones.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZones.get + * @desc Fetch the representation of an existing ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * dns.managedZones.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dns.managedZones.update - * @desc Update an existing ManagedZone. - * @alias dns.managedZones.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZones.list + * @desc Enumerate ManagedZones that have been created but not yet deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var managedZonesPage = response['managedZones']; + * if (!managedZonesPage) { + * return; + * } + * for (var i = 0; i < managedZonesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `managedZonesPage`: console.log(JSON.stringify(managedZonesPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.managedZones.list(request, handlePage); + * } + * }; + * + * dns.managedZones.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZones.patch + * @desc Update an existing ManagedZone. This method supports patch + * semantics. + * @alias dns.managedZones.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.projects.get - * @desc Fetch the representation of an existing Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dns.managedZones.update + * @desc Update an existing ManagedZone. + * @alias dns.managedZones.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Projects { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Resourcerecordsets { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dns.projects.get + * @desc Fetch the representation of an existing Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * dns.resourceRecordSets.list - * @desc Enumerate ResourceRecordSets that have been created but not yet - * deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rrsetsPage = response['rrsets']; - * if (!rrsetsPage) { - * return; - * } - * for (var i = 0; i < rrsetsPage.length; i++) { - * // TODO: Change code below to process each resource in `rrsetsPage`: - * console.log(JSON.stringify(rrsetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.resourceRecordSets.list(request, handlePage); - * } - * }; - * - * dns.resourceRecordSets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.resourceRecordSets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Resourcerecordsets { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1/projects/{project}/managedZones/{managedZone}/rrsets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * dns.resourceRecordSets.list + * @desc Enumerate ResourceRecordSets that have been created but not yet + * deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var rrsetsPage = response['rrsets']; + * if (!rrsetsPage) { + * return; + * } + * for (var i = 0; i < rrsetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `rrsetsPage`: console.log(JSON.stringify(rrsetsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.resourceRecordSets.list(request, handlePage); + * } + * }; + * + * dns.resourceRecordSets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.resourceRecordSets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1/projects/{project}/managedZones/{managedZone}/rrsets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/dns/v1beta2.ts b/src/apis/dns/v1beta2.ts index 4d002b4460b..beb358106ce 100644 --- a/src/apis/dns/v1beta2.ts +++ b/src/apis/dns/v1beta2.ts @@ -27,1505 +27,1530 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud DNS API - * - * Configures and serves authoritative DNS records. - * - * @example - * const google = require('googleapis'); - * const dns = google.dns('v1beta2'); - * - * @namespace dns - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Dns - */ -export class Dns { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dns_v1beta2 { + /** + * Google Cloud DNS API + * + * Configures and serves authoritative DNS records. + * + * @example + * const google = require('googleapis'); + * const dns = google.dns('v1beta2'); + * + * @namespace dns + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Dns + */ + export class Dns { + _options: GlobalOptions; + google: GoogleApis; + root = this; - changes: Resource$Changes; - dnsKeys: Resource$Dnskeys; - managedZoneOperations: Resource$Managedzoneoperations; - managedZones: Resource$Managedzones; - projects: Resource$Projects; - resourceRecordSets: Resource$Resourcerecordsets; + changes: Resource$Changes; + dnsKeys: Resource$Dnskeys; + managedZoneOperations: Resource$Managedzoneoperations; + managedZones: Resource$Managedzones; + projects: Resource$Projects; + resourceRecordSets: Resource$Resourcerecordsets; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.changes = new Resource$Changes(this); - this.dnsKeys = new Resource$Dnskeys(this); - this.managedZoneOperations = new Resource$Managedzoneoperations(this); - this.managedZones = new Resource$Managedzones(this); - this.projects = new Resource$Projects(this); - this.resourceRecordSets = new Resource$Resourcerecordsets(this); - } + this.changes = new Resource$Changes(this); + this.dnsKeys = new Resource$Dnskeys(this); + this.managedZoneOperations = new Resource$Managedzoneoperations(this); + this.managedZones = new Resource$Managedzones(this); + this.projects = new Resource$Projects(this); + this.resourceRecordSets = new Resource$Resourcerecordsets(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An atomic update to a collection of ResourceRecordSets. - */ -export interface Schema$Change { - /** - * Which ResourceRecordSets to add? - */ - additions: Schema$ResourceRecordSet[]; - /** - * Which ResourceRecordSets to remove? Must match existing data exactly. - */ - deletions: Schema$ResourceRecordSet[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * If the DNS queries for the zone will be served. - */ - isServing: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#change". - */ - kind: string; - /** - * The time that this operation was started by the server (output only). This - * is in RFC3339 text format. - */ - startTime: string; - /** - * Status of the operation (output only). - */ - status: string; -} -/** - * The response to a request to enumerate Changes to a ResourceRecordSets - * collection. - */ -export interface Schema$ChangesListResponse { - /** - * The requested changes. - */ - changes: Schema$Change[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * A DNSSEC key pair. - */ -export interface Schema$DnsKey { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. Immutable - * after creation time. - */ - algorithm: string; - /** - * The time that this resource was created in the control plane. This is in - * RFC3339 text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the resource's - * function. - */ - description: string; - /** - * Cryptographic hashes of the DNSKEY resource record associated with this - * DnsKey. These digests are needed to construct a DS record that points at - * this DNS key. Output only. - */ - digests: Schema$DnsKeyDigest[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * Active keys will be used to sign subsequent changes to the ManagedZone. - * Inactive keys will still be present as DNSKEY Resource Records for the use - * of resolvers validating existing signatures. - */ - isActive: boolean; - /** - * Length of the key in bits. Specified at creation time then immutable. - */ - keyLength: number; - /** - * The key tag is a non-cryptographic hash of the a DNSKEY resource record - * associated with this DnsKey. The key tag can be used to identify a DNSKEY - * more quickly (but it is not a unique identifier). In particular, the key - * tag is used in a parent zone's DS record to point at the DNSKEY in this - * child ManagedZone. The key tag is a number in the range [0, 65535] and the - * algorithm to calculate it is specified in RFC4034 Appendix B. Output only. - */ - keyTag: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKey". - */ - kind: string; - /** - * Base64 encoded public half of this key. Output only. - */ - publicKey: string; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. Immutable after creation time. - */ - type: string; -} -export interface Schema$DnsKeyDigest { - /** - * The base-16 encoded bytes of this digest. Suitable for use in a DS resource - * record. - */ - digest: string; - /** - * Specifies the algorithm used to calculate this digest. - */ - type: string; -} -/** - * The response to a request to enumerate DnsKeys in a ManagedZone. - */ -export interface Schema$DnsKeysListResponse { - /** - * The requested resources. - */ - dnsKeys: Schema$DnsKey[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * Parameters for DnsKey key generation. Used for generating initial keys for a - * new ManagedZone and as default when adding a new DnsKey. - */ -export interface Schema$DnsKeySpec { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. - */ - algorithm: string; - /** - * Length of the keys in bits. - */ - keyLength: number; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. - */ - keyType: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKeySpec". - */ - kind: string; -} -/** - * A zone is a subtree of the DNS namespace under one administrative - * responsibility. A ManagedZone is a resource that represents a DNS zone hosted - * by the Cloud DNS service. - */ -export interface Schema$ManagedZone { - /** - * The time that this resource was created on the server. This is in RFC3339 - * text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the managed zone's - * function. - */ - description: string; - /** - * The DNS name of this managed zone, for instance "example.com.". - */ - dnsName: string; - /** - * DNSSEC configuration. - */ - dnssecConfig: Schema$ManagedZoneDnsSecConfig; - /** - * Unique identifier for the resource; defined by the server (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZone". - */ - kind: string; - /** - * User labels. - */ - labels: any; - /** - * User assigned name for this resource. Must be unique within the project. - * The name must be 1-63 characters long, must begin with a letter, end with a - * letter or digit, and only contain lowercase letters, digits or dashes. - */ - name: string; - /** - * Delegate your managed_zone to these virtual name servers; defined by the - * server (output only) - */ - nameServers: string[]; - /** - * Optionally specifies the NameServerSet for this ManagedZone. A - * NameServerSet is a set of DNS name servers that all host the same - * ManagedZones. Most users will leave this field unset. - */ - nameServerSet: string; -} -export interface Schema$ManagedZoneDnsSecConfig { - /** - * Specifies parameters that will be used for generating initial DnsKeys for - * this ManagedZone. Output only while state is not OFF. - */ - defaultKeySpecs: Schema$DnsKeySpec[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZoneDnsSecConfig". - */ - kind: string; - /** - * Specifies the mechanism used to provide authenticated denial-of-existence - * responses. Output only while state is not OFF. - */ - nonExistence: string; - /** - * Specifies whether DNSSEC is enabled, and what mode it is in. - */ - state: string; -} -export interface Schema$ManagedZoneOperationsListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; - /** - * The operation resources. - */ - operations: Schema$Operation[]; -} -export interface Schema$ManagedZonesListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The managed zone resources. - */ - managedZones: Schema$ManagedZone[]; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; -} -/** - * An operation represents a successful mutation performed on a Cloud DNS - * resource. Operations provide: - An audit log of server resource mutations. - - * A way to recover/retry API calls in the case where the response is never - * received by the caller. Use the caller specified client_operation_id. - */ -export interface Schema$Operation { - /** - * Only populated if the operation targeted a DnsKey (output only). - */ - dnsKeyContext: Schema$OperationDnsKeyContext; - /** - * Unique identifier for the resource. This is the client_operation_id if the - * client specified it when the mutation was initiated, otherwise, it is - * generated by the server. The name must be 1-63 characters long and match - * the regular expression [-a-z0-9]? (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#operation". - */ - kind: string; - /** - * The time that this operation was started by the server. This is in RFC3339 - * text format (output only). - */ - startTime: string; - /** - * Status of the operation. Can be one of the following: "PENDING" - * or "DONE" (output only). - */ - status: string; - /** - * Type of the operation. Operations include insert, update, and delete - * (output only). - */ - type: string; - /** - * User who requested the operation, for example: user@example.com. - * cloud-dns-system for operations automatically done by the system. (output - * only) - */ - user: string; - /** - * Only populated if the operation targeted a ManagedZone (output only). - */ - zoneContext: Schema$OperationManagedZoneContext; -} -export interface Schema$OperationDnsKeyContext { - /** - * The post-operation DnsKey resource. - */ - newValue: Schema$DnsKey; - /** - * The pre-operation DnsKey resource. - */ - oldValue: Schema$DnsKey; -} -export interface Schema$OperationManagedZoneContext { - /** - * The post-operation ManagedZone resource. - */ - newValue: Schema$ManagedZone; - /** - * The pre-operation ManagedZone resource. - */ - oldValue: Schema$ManagedZone; -} -/** - * A project resource. The project is a top level container for resources - * including Cloud DNS ManagedZones. Projects can be created only in the APIs - * console. - */ -export interface Schema$Project { - /** - * User assigned unique identifier for the resource (output only). - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#project". - */ - kind: string; - /** - * Unique numeric identifier for the resource; defined by the server (output - * only). - */ - number: string; /** - * Quotas assigned to this project (output only). - */ - quota: Schema$Quota; -} -/** - * Limits associated with a Project. - */ -export interface Schema$Quota { - /** - * Whether a black hole zone should suppress system zones for this project. - */ - blackHoleHidesSystemZones: boolean; - /** - * Maximum allowed number of DnsKeys per ManagedZone. - */ - dnsKeysPerManagedZone: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#quota". - */ - kind: string; - /** - * Maximum allowed number of managed zones in the project. - */ - managedZones: number; - /** - * Maximum allowed number of ResourceRecords per ResourceRecordSet. - */ - resourceRecordsPerRrset: number; - /** - * Maximum allowed number of ResourceRecordSets to add per - * ChangesCreateRequest. - */ - rrsetAdditionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets to delete per - * ChangesCreateRequest. - */ - rrsetDeletionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets per zone in the project. - */ - rrsetsPerManagedZone: number; - /** - * Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes. - */ - totalRrdataSizePerChange: number; - /** - * DNSSEC algorithm and key length types that can be used for DnsKeys. - */ - whitelistedKeySpecs: Schema$DnsKeySpec[]; -} -/** - * A unit of data that will be returned by the DNS servers. - */ -export interface Schema$ResourceRecordSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#resourceRecordSet". - */ - kind: string; + * An atomic update to a collection of ResourceRecordSets. + */ + export interface Schema$Change { + /** + * Which ResourceRecordSets to add? + */ + additions: Schema$ResourceRecordSet[]; + /** + * Which ResourceRecordSets to remove? Must match existing data exactly. + */ + deletions: Schema$ResourceRecordSet[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * If the DNS queries for the zone will be served. + */ + isServing: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#change". + */ + kind: string; + /** + * The time that this operation was started by the server (output only). + * This is in RFC3339 text format. + */ + startTime: string; + /** + * Status of the operation (output only). + */ + status: string; + } /** - * For example, www.example.com. - */ - name: string; + * The response to a request to enumerate Changes to a ResourceRecordSets + * collection. + */ + export interface Schema$ChangesListResponse { + /** + * The requested changes. + */ + changes: Schema$Change[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). - */ - rrdatas: string[]; + * A DNSSEC key pair. + */ + export interface Schema$DnsKey { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. Immutable + * after creation time. + */ + algorithm: string; + /** + * The time that this resource was created in the control plane. This is in + * RFC3339 text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the resource's + * function. + */ + description: string; + /** + * Cryptographic hashes of the DNSKEY resource record associated with this + * DnsKey. These digests are needed to construct a DS record that points at + * this DNS key. Output only. + */ + digests: Schema$DnsKeyDigest[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * Active keys will be used to sign subsequent changes to the ManagedZone. + * Inactive keys will still be present as DNSKEY Resource Records for the + * use of resolvers validating existing signatures. + */ + isActive: boolean; + /** + * Length of the key in bits. Specified at creation time then immutable. + */ + keyLength: number; + /** + * The key tag is a non-cryptographic hash of the a DNSKEY resource record + * associated with this DnsKey. The key tag can be used to identify a DNSKEY + * more quickly (but it is not a unique identifier). In particular, the key + * tag is used in a parent zone's DS record to point at the DNSKEY in + * this child ManagedZone. The key tag is a number in the range [0, 65535] + * and the algorithm to calculate it is specified in RFC4034 Appendix B. + * Output only. + */ + keyTag: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKey". + */ + kind: string; + /** + * Base64 encoded public half of this key. Output only. + */ + publicKey: string; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. Immutable after creation time. + */ + type: string; + } + export interface Schema$DnsKeyDigest { + /** + * The base-16 encoded bytes of this digest. Suitable for use in a DS + * resource record. + */ + digest: string; + /** + * Specifies the algorithm used to calculate this digest. + */ + type: string; + } /** - * As defined in RFC 4034 (section 3.2). - */ - signatureRrdatas: string[]; + * The response to a request to enumerate DnsKeys in a ManagedZone. + */ + export interface Schema$DnsKeysListResponse { + /** + * The requested resources. + */ + dnsKeys: Schema$DnsKey[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * Number of seconds that this ResourceRecordSet can be cached by resolvers. - */ - ttl: number; + * Parameters for DnsKey key generation. Used for generating initial keys for + * a new ManagedZone and as default when adding a new DnsKey. + */ + export interface Schema$DnsKeySpec { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. + */ + algorithm: string; + /** + * Length of the keys in bits. + */ + keyLength: number; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. + */ + keyType: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKeySpec". + */ + kind: string; + } /** - * The identifier of a supported record type, for example, A, AAAA, MX, TXT, - * and so on. - */ - type: string; -} -export interface Schema$ResourceRecordSetsListResponse { - header: Schema$ResponseHeader; + * A zone is a subtree of the DNS namespace under one administrative + * responsibility. A ManagedZone is a resource that represents a DNS zone + * hosted by the Cloud DNS service. + */ + export interface Schema$ManagedZone { + /** + * The time that this resource was created on the server. This is in RFC3339 + * text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the managed zone's + * function. + */ + description: string; + /** + * The DNS name of this managed zone, for instance "example.com.". + */ + dnsName: string; + /** + * DNSSEC configuration. + */ + dnssecConfig: Schema$ManagedZoneDnsSecConfig; + /** + * Unique identifier for the resource; defined by the server (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZone". + */ + kind: string; + /** + * User labels. + */ + labels: any; + /** + * User assigned name for this resource. Must be unique within the project. + * The name must be 1-63 characters long, must begin with a letter, end with + * a letter or digit, and only contain lowercase letters, digits or dashes. + */ + name: string; + /** + * Delegate your managed_zone to these virtual name servers; defined by the + * server (output only) + */ + nameServers: string[]; + /** + * Optionally specifies the NameServerSet for this ManagedZone. A + * NameServerSet is a set of DNS name servers that all host the same + * ManagedZones. Most users will leave this field unset. + */ + nameServerSet: string; + } + export interface Schema$ManagedZoneDnsSecConfig { + /** + * Specifies parameters that will be used for generating initial DnsKeys for + * this ManagedZone. Output only while state is not OFF. + */ + defaultKeySpecs: Schema$DnsKeySpec[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZoneDnsSecConfig". + */ + kind: string; + /** + * Specifies the mechanism used to provide authenticated denial-of-existence + * responses. Output only while state is not OFF. + */ + nonExistence: string; + /** + * Specifies whether DNSSEC is enabled, and what mode it is in. + */ + state: string; + } + export interface Schema$ManagedZoneOperationsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + /** + * The operation resources. + */ + operations: Schema$Operation[]; + } + export interface Schema$ManagedZonesListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The managed zone resources. + */ + managedZones: Schema$ManagedZone[]; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + } /** - * Type of resource. - */ - kind: string; + * An operation represents a successful mutation performed on a Cloud DNS + * resource. Operations provide: - An audit log of server resource mutations. + * - A way to recover/retry API calls in the case where the response is never + * received by the caller. Use the caller specified client_operation_id. + */ + export interface Schema$Operation { + /** + * Only populated if the operation targeted a DnsKey (output only). + */ + dnsKeyContext: Schema$OperationDnsKeyContext; + /** + * Unique identifier for the resource. This is the client_operation_id if + * the client specified it when the mutation was initiated, otherwise, it is + * generated by the server. The name must be 1-63 characters long and match + * the regular expression [-a-z0-9]? (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#operation". + */ + kind: string; + /** + * The time that this operation was started by the server. This is in + * RFC3339 text format (output only). + */ + startTime: string; + /** + * Status of the operation. Can be one of the following: "PENDING" + * or "DONE" (output only). + */ + status: string; + /** + * Type of the operation. Operations include insert, update, and delete + * (output only). + */ + type: string; + /** + * User who requested the operation, for example: user@example.com. + * cloud-dns-system for operations automatically done by the system. (output + * only) + */ + user: string; + /** + * Only populated if the operation targeted a ManagedZone (output only). + */ + zoneContext: Schema$OperationManagedZoneContext; + } + export interface Schema$OperationDnsKeyContext { + /** + * The post-operation DnsKey resource. + */ + newValue: Schema$DnsKey; + /** + * The pre-operation DnsKey resource. + */ + oldValue: Schema$DnsKey; + } + export interface Schema$OperationManagedZoneContext { + /** + * The post-operation ManagedZone resource. + */ + newValue: Schema$ManagedZone; + /** + * The pre-operation ManagedZone resource. + */ + oldValue: Schema$ManagedZone; + } /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a consistent snapshot of a collection larger than the - * maximum page size. - */ - nextPageToken: string; + * A project resource. The project is a top level container for resources + * including Cloud DNS ManagedZones. Projects can be created only in the APIs + * console. + */ + export interface Schema$Project { + /** + * User assigned unique identifier for the resource (output only). + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#project". + */ + kind: string; + /** + * Unique numeric identifier for the resource; defined by the server (output + * only). + */ + number: string; + /** + * Quotas assigned to this project (output only). + */ + quota: Schema$Quota; + } /** - * The resource record set resources. - */ - rrsets: Schema$ResourceRecordSet[]; -} -/** - * Elements common to every response. - */ -export interface Schema$ResponseHeader { + * Limits associated with a Project. + */ + export interface Schema$Quota { + /** + * Whether a black hole zone should suppress system zones for this project. + */ + blackHoleHidesSystemZones: boolean; + /** + * Maximum allowed number of DnsKeys per ManagedZone. + */ + dnsKeysPerManagedZone: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#quota". + */ + kind: string; + /** + * Maximum allowed number of managed zones in the project. + */ + managedZones: number; + /** + * Maximum allowed number of ResourceRecords per ResourceRecordSet. + */ + resourceRecordsPerRrset: number; + /** + * Maximum allowed number of ResourceRecordSets to add per + * ChangesCreateRequest. + */ + rrsetAdditionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets to delete per + * ChangesCreateRequest. + */ + rrsetDeletionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets per zone in the project. + */ + rrsetsPerManagedZone: number; + /** + * Maximum allowed size for total rrdata in one ChangesCreateRequest in + * bytes. + */ + totalRrdataSizePerChange: number; + /** + * DNSSEC algorithm and key length types that can be used for DnsKeys. + */ + whitelistedKeySpecs: Schema$DnsKeySpec[]; + } /** - * For mutating operation requests that completed successfully. This is the - * client_operation_id if the client specified it, otherwise it is generated - * by the server (output only). - */ - operationId: string; -} - -export class Resource$Changes { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); + * A unit of data that will be returned by the DNS servers. + */ + export interface Schema$ResourceRecordSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#resourceRecordSet". + */ + kind: string; + /** + * For example, www.example.com. + */ + name: string; + /** + * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). + */ + rrdatas: string[]; + /** + * As defined in RFC 4034 (section 3.2). + */ + signatureRrdatas: string[]; + /** + * Number of seconds that this ResourceRecordSet can be cached by resolvers. + */ + ttl: number; + /** + * The identifier of a supported record type, for example, A, AAAA, MX, TXT, + * and so on. + */ + type: string; } - - getRoot() { - return this.root; + export interface Schema$ResourceRecordSetsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a consistent snapshot of a + * collection larger than the maximum page size. + */ + nextPageToken: string; + /** + * The resource record set resources. + */ + rrsets: Schema$ResourceRecordSet[]; } - - /** - * dns.changes.create - * @desc Atomically update the ResourceRecordSet collection. - * @alias dns.changes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().Change} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Elements common to every response. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ResponseHeader { + /** + * For mutating operation requests that completed successfully. This is the + * client_operation_id if the client specified it, otherwise it is generated + * by the server (output only). + */ + operationId: string; } - - /** - * dns.changes.get - * @desc Fetch the representation of an existing Change. - * @alias dns.changes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Changes { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes/{changeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'changeId'], - pathParams: ['changeId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.changes.list - * @desc Enumerate Changes to a ResourceRecordSet collection. - * @alias dns.changes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. - * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dns.changes.create + * @desc Atomically update the ResourceRecordSet collection. + * @alias dns.changes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().Change} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Dnskeys { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.changes.get + * @desc Fetch the representation of an existing Change. + * @alias dns.changes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes/{changeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'changeId'], + pathParams: ['changeId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.dnsKeys.get - * @desc Fetch the representation of an existing DnsKey. - * @alias dns.dnsKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.dnsKeyId The identifier of the requested DnsKey. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'dnsKeyId'], - pathParams: ['dnsKeyId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.changes.list + * @desc Enumerate Changes to a ResourceRecordSet collection. + * @alias dns.changes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. + * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.dnsKeys.list - * @desc Enumerate DnsKeys to a ResourceRecordSet collection. - * @alias dns.dnsKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Dnskeys { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzoneoperations { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.dnsKeys.get + * @desc Fetch the representation of an existing DnsKey. + * @alias dns.dnsKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.dnsKeyId The identifier of the requested DnsKey. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'dnsKeyId'], + pathParams: ['dnsKeyId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZoneOperations.get - * @desc Fetch the representation of an existing Operation. - * @alias dns.managedZoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {string} params.operation Identifies the operation addressed by this request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'operation'], - pathParams: ['managedZone', 'operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.dnsKeys.list + * @desc Enumerate DnsKeys to a ResourceRecordSet collection. + * @alias dns.dnsKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/dnsKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.managedZoneOperations.list - * @desc Enumerate Operations for the given ManagedZone. - * @alias dns.managedZoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Managedzoneoperations { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzones { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZoneOperations.get + * @desc Fetch the representation of an existing Operation. + * @alias dns.managedZoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {string} params.operation Identifies the operation addressed by this request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'operation'], + pathParams: ['managedZone', 'operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZones.create - * @desc Create a new ManagedZone. - * @alias dns.managedZones.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1beta2/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZoneOperations.list + * @desc Enumerate Operations for the given ManagedZone. + * @alias dns.managedZoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dns.managedZones.delete - * @desc Delete a previously created ManagedZone. - * @alias dns.managedZones.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Managedzones { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.managedZones.get - * @desc Fetch the representation of an existing ManagedZone. - * @alias dns.managedZones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZones.create + * @desc Create a new ManagedZone. + * @alias dns.managedZones.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1beta2/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dns.managedZones.list - * @desc Enumerate ManagedZones that have been created but not yet deleted. - * @alias dns.managedZones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1beta2/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZones.delete + * @desc Delete a previously created ManagedZone. + * @alias dns.managedZones.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * dns.managedZones.patch - * @desc Apply a partial update to an existing ManagedZone. - * @alias dns.managedZones.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.get + * @desc Fetch the representation of an existing ManagedZone. + * @alias dns.managedZones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.update - * @desc Update an existing ManagedZone. - * @alias dns.managedZones.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.list + * @desc Enumerate ManagedZones that have been created but not yet deleted. + * @alias dns.managedZones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1beta2/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZones.patch + * @desc Apply a partial update to an existing ManagedZone. + * @alias dns.managedZones.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.projects.get - * @desc Fetch the representation of an existing Project. - * @alias dns.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dns.managedZones.update + * @desc Update an existing ManagedZone. + * @alias dns.managedZones.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Projects { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v1beta2/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Resourcerecordsets { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dns.projects.get + * @desc Fetch the representation of an existing Project. + * @alias dns.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v1beta2/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * dns.resourceRecordSets.list - * @desc Enumerate ResourceRecordSets that have been created but not yet - * deleted. - * @alias dns.resourceRecordSets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Resourcerecordsets { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/rrsets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * dns.resourceRecordSets.list + * @desc Enumerate ResourceRecordSets that have been created but not yet + * deleted. + * @alias dns.resourceRecordSets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v1beta2/projects/{project}/managedZones/{managedZone}/rrsets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/dns/v2beta1.ts b/src/apis/dns/v2beta1.ts index 40057d59c3a..179254bbfb9 100644 --- a/src/apis/dns/v2beta1.ts +++ b/src/apis/dns/v2beta1.ts @@ -27,2427 +27,2469 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud DNS API - * - * Configures and serves authoritative DNS records. - * - * @example - * const google = require('googleapis'); - * const dns = google.dns('v2beta1'); - * - * @namespace dns - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Dns - */ -export class Dns { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace dns_v2beta1 { + /** + * Google Cloud DNS API + * + * Configures and serves authoritative DNS records. + * + * @example + * const google = require('googleapis'); + * const dns = google.dns('v2beta1'); + * + * @namespace dns + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Dns + */ + export class Dns { + _options: GlobalOptions; + google: GoogleApis; + root = this; - changes: Resource$Changes; - dnsKeys: Resource$Dnskeys; - managedZoneOperations: Resource$Managedzoneoperations; - managedZones: Resource$Managedzones; - projects: Resource$Projects; - resourceRecordSets: Resource$Resourcerecordsets; + changes: Resource$Changes; + dnsKeys: Resource$Dnskeys; + managedZoneOperations: Resource$Managedzoneoperations; + managedZones: Resource$Managedzones; + projects: Resource$Projects; + resourceRecordSets: Resource$Resourcerecordsets; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.changes = new Resource$Changes(this); - this.dnsKeys = new Resource$Dnskeys(this); - this.managedZoneOperations = new Resource$Managedzoneoperations(this); - this.managedZones = new Resource$Managedzones(this); - this.projects = new Resource$Projects(this); - this.resourceRecordSets = new Resource$Resourcerecordsets(this); - } + this.changes = new Resource$Changes(this); + this.dnsKeys = new Resource$Dnskeys(this); + this.managedZoneOperations = new Resource$Managedzoneoperations(this); + this.managedZones = new Resource$Managedzones(this); + this.projects = new Resource$Projects(this); + this.resourceRecordSets = new Resource$Resourcerecordsets(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An atomic update to a collection of ResourceRecordSets. - */ -export interface Schema$Change { - /** - * Which ResourceRecordSets to add? - */ - additions: Schema$ResourceRecordSet[]; - /** - * Which ResourceRecordSets to remove? Must match existing data exactly. - */ - deletions: Schema$ResourceRecordSet[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * If the DNS queries for the zone will be served. - */ - isServing: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#change". - */ - kind: string; - /** - * The time that this operation was started by the server (output only). This - * is in RFC3339 text format. - */ - startTime: string; - /** - * Status of the operation (output only). - */ - status: string; -} -/** - * The response to a request to enumerate Changes to a ResourceRecordSets - * collection. - */ -export interface Schema$ChangesListResponse { - /** - * The requested changes. - */ - changes: Schema$Change[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * A DNSSEC key pair. - */ -export interface Schema$DnsKey { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. Immutable - * after creation time. - */ - algorithm: string; - /** - * The time that this resource was created in the control plane. This is in - * RFC3339 text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the resource's - * function. - */ - description: string; - /** - * Cryptographic hashes of the DNSKEY resource record associated with this - * DnsKey. These digests are needed to construct a DS record that points at - * this DNS key. Output only. - */ - digests: Schema$DnsKeyDigest[]; - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * Active keys will be used to sign subsequent changes to the ManagedZone. - * Inactive keys will still be present as DNSKEY Resource Records for the use - * of resolvers validating existing signatures. - */ - isActive: boolean; - /** - * Length of the key in bits. Specified at creation time then immutable. - */ - keyLength: number; - /** - * The key tag is a non-cryptographic hash of the a DNSKEY resource record - * associated with this DnsKey. The key tag can be used to identify a DNSKEY - * more quickly (but it is not a unique identifier). In particular, the key - * tag is used in a parent zone's DS record to point at the DNSKEY in this - * child ManagedZone. The key tag is a number in the range [0, 65535] and the - * algorithm to calculate it is specified in RFC4034 Appendix B. Output only. - */ - keyTag: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKey". - */ - kind: string; - /** - * Base64 encoded public half of this key. Output only. - */ - publicKey: string; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. Immutable after creation time. - */ - type: string; -} -export interface Schema$DnsKeyDigest { - /** - * The base-16 encoded bytes of this digest. Suitable for use in a DS resource - * record. - */ - digest: string; - /** - * Specifies the algorithm used to calculate this digest. - */ - type: string; -} -/** - * The response to a request to enumerate DnsKeys in a ManagedZone. - */ -export interface Schema$DnsKeysListResponse { - /** - * The requested resources. - */ - dnsKeys: Schema$DnsKey[]; - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a "snapshot" of collections larger than the - * maximum page size. - */ - nextPageToken: string; -} -/** - * Parameters for DnsKey key generation. Used for generating initial keys for a - * new ManagedZone and as default when adding a new DnsKey. - */ -export interface Schema$DnsKeySpec { - /** - * String mnemonic specifying the DNSSEC algorithm of this key. - */ - algorithm: string; - /** - * Length of the keys in bits. - */ - keyLength: number; - /** - * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type - * KEY_SIGNING have the Secure Entry Point flag set and, when active, will be - * used to sign only resource record sets of type DNSKEY. Otherwise, the - * Secure Entry Point flag will be cleared and this key will be used to sign - * only resource record sets of other types. - */ - keyType: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#dnsKeySpec". - */ - kind: string; -} -/** - * A zone is a subtree of the DNS namespace under one administrative - * responsibility. A ManagedZone is a resource that represents a DNS zone hosted - * by the Cloud DNS service. - */ -export interface Schema$ManagedZone { - /** - * The time that this resource was created on the server. This is in RFC3339 - * text format. Output only. - */ - creationTime: string; - /** - * A mutable string of at most 1024 characters associated with this resource - * for the user's convenience. Has no effect on the managed zone's - * function. - */ - description: string; - /** - * The DNS name of this managed zone, for instance "example.com.". - */ - dnsName: string; - /** - * DNSSEC configuration. - */ - dnssecConfig: Schema$ManagedZoneDnsSecConfig; - /** - * Unique identifier for the resource; defined by the server (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZone". - */ - kind: string; - /** - * User labels. - */ - labels: any; /** - * User assigned name for this resource. Must be unique within the project. - * The name must be 1-63 characters long, must begin with a letter, end with a - * letter or digit, and only contain lowercase letters, digits or dashes. - */ - name: string; - /** - * Delegate your managed_zone to these virtual name servers; defined by the - * server (output only) - */ - nameServers: string[]; - /** - * Optionally specifies the NameServerSet for this ManagedZone. A - * NameServerSet is a set of DNS name servers that all host the same - * ManagedZones. Most users will leave this field unset. - */ - nameServerSet: string; -} -export interface Schema$ManagedZoneDnsSecConfig { - /** - * Specifies parameters that will be used for generating initial DnsKeys for - * this ManagedZone. Output only while state is not OFF. - */ - defaultKeySpecs: Schema$DnsKeySpec[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#managedZoneDnsSecConfig". - */ - kind: string; - /** - * Specifies the mechanism used to provide authenticated denial-of-existence - * responses. Output only while state is not OFF. - */ - nonExistence: string; - /** - * Specifies whether DNSSEC is enabled, and what mode it is in. - */ - state: string; -} -export interface Schema$ManagedZoneOperationsListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; - /** - * The operation resources. - */ - operations: Schema$Operation[]; -} -export interface Schema$ManagedZonesListResponse { - header: Schema$ResponseHeader; - /** - * Type of resource. - */ - kind: string; - /** - * The managed zone resources. - */ - managedZones: Schema$ManagedZone[]; - /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your page token. In this way - * you can retrieve the complete contents of even very large collections one - * page at a time. However, if the contents of the collection change between - * the first and last paginated list request, the set of all elements returned - * will be an inconsistent view of the collection. There is no way to retrieve - * a consistent snapshot of a collection larger than the maximum page size. - */ - nextPageToken: string; -} -/** - * An operation represents a successful mutation performed on a Cloud DNS - * resource. Operations provide: - An audit log of server resource mutations. - - * A way to recover/retry API calls in the case where the response is never - * received by the caller. Use the caller specified client_operation_id. - */ -export interface Schema$Operation { - /** - * Only populated if the operation targeted a DnsKey (output only). - */ - dnsKeyContext: Schema$OperationDnsKeyContext; - /** - * Unique identifier for the resource. This is the client_operation_id if the - * client specified it when the mutation was initiated, otherwise, it is - * generated by the server. The name must be 1-63 characters long and match - * the regular expression [-a-z0-9]? (output only) - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#operation". - */ - kind: string; - /** - * The time that this operation was started by the server. This is in RFC3339 - * text format (output only). - */ - startTime: string; - /** - * Status of the operation. Can be one of the following: "PENDING" - * or "DONE" (output only). - */ - status: string; - /** - * Type of the operation. Operations include insert, update, and delete - * (output only). - */ - type: string; - /** - * User who requested the operation, for example: user@example.com. - * cloud-dns-system for operations automatically done by the system. (output - * only) - */ - user: string; - /** - * Only populated if the operation targeted a ManagedZone (output only). - */ - zoneContext: Schema$OperationManagedZoneContext; -} -export interface Schema$OperationDnsKeyContext { - /** - * The post-operation DnsKey resource. - */ - newValue: Schema$DnsKey; - /** - * The pre-operation DnsKey resource. - */ - oldValue: Schema$DnsKey; -} -export interface Schema$OperationManagedZoneContext { - /** - * The post-operation ManagedZone resource. - */ - newValue: Schema$ManagedZone; - /** - * The pre-operation ManagedZone resource. - */ - oldValue: Schema$ManagedZone; -} -/** - * A project resource. The project is a top level container for resources - * including Cloud DNS ManagedZones. Projects can be created only in the APIs - * console. - */ -export interface Schema$Project { - /** - * User assigned unique identifier for the resource (output only). - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#project". - */ - kind: string; - /** - * Unique numeric identifier for the resource; defined by the server (output - * only). - */ - number: string; - /** - * Quotas assigned to this project (output only). - */ - quota: Schema$Quota; -} -/** - * Limits associated with a Project. - */ -export interface Schema$Quota { - /** - * Whether a black hole zone should suppress system zones for this project. - */ - blackHoleHidesSystemZones: boolean; - /** - * Maximum allowed number of DnsKeys per ManagedZone. - */ - dnsKeysPerManagedZone: number; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#quota". - */ - kind: string; - /** - * Maximum allowed number of managed zones in the project. - */ - managedZones: number; - /** - * Maximum allowed number of ResourceRecords per ResourceRecordSet. - */ - resourceRecordsPerRrset: number; - /** - * Maximum allowed number of ResourceRecordSets to add per - * ChangesCreateRequest. - */ - rrsetAdditionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets to delete per - * ChangesCreateRequest. - */ - rrsetDeletionsPerChange: number; - /** - * Maximum allowed number of ResourceRecordSets per zone in the project. - */ - rrsetsPerManagedZone: number; - /** - * Maximum allowed size for total rrdata in one ChangesCreateRequest in bytes. - */ - totalRrdataSizePerChange: number; - /** - * DNSSEC algorithm and key length types that can be used for DnsKeys. - */ - whitelistedKeySpecs: Schema$DnsKeySpec[]; -} -/** - * A unit of data that will be returned by the DNS servers. - */ -export interface Schema$ResourceRecordSet { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "dns#resourceRecordSet". - */ - kind: string; + * An atomic update to a collection of ResourceRecordSets. + */ + export interface Schema$Change { + /** + * Which ResourceRecordSets to add? + */ + additions: Schema$ResourceRecordSet[]; + /** + * Which ResourceRecordSets to remove? Must match existing data exactly. + */ + deletions: Schema$ResourceRecordSet[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * If the DNS queries for the zone will be served. + */ + isServing: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#change". + */ + kind: string; + /** + * The time that this operation was started by the server (output only). + * This is in RFC3339 text format. + */ + startTime: string; + /** + * Status of the operation (output only). + */ + status: string; + } /** - * For example, www.example.com. - */ - name: string; + * The response to a request to enumerate Changes to a ResourceRecordSets + * collection. + */ + export interface Schema$ChangesListResponse { + /** + * The requested changes. + */ + changes: Schema$Change[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). - */ - rrdatas: string[]; + * A DNSSEC key pair. + */ + export interface Schema$DnsKey { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. Immutable + * after creation time. + */ + algorithm: string; + /** + * The time that this resource was created in the control plane. This is in + * RFC3339 text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the resource's + * function. + */ + description: string; + /** + * Cryptographic hashes of the DNSKEY resource record associated with this + * DnsKey. These digests are needed to construct a DS record that points at + * this DNS key. Output only. + */ + digests: Schema$DnsKeyDigest[]; + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * Active keys will be used to sign subsequent changes to the ManagedZone. + * Inactive keys will still be present as DNSKEY Resource Records for the + * use of resolvers validating existing signatures. + */ + isActive: boolean; + /** + * Length of the key in bits. Specified at creation time then immutable. + */ + keyLength: number; + /** + * The key tag is a non-cryptographic hash of the a DNSKEY resource record + * associated with this DnsKey. The key tag can be used to identify a DNSKEY + * more quickly (but it is not a unique identifier). In particular, the key + * tag is used in a parent zone's DS record to point at the DNSKEY in + * this child ManagedZone. The key tag is a number in the range [0, 65535] + * and the algorithm to calculate it is specified in RFC4034 Appendix B. + * Output only. + */ + keyTag: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKey". + */ + kind: string; + /** + * Base64 encoded public half of this key. Output only. + */ + publicKey: string; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. Immutable after creation time. + */ + type: string; + } + export interface Schema$DnsKeyDigest { + /** + * The base-16 encoded bytes of this digest. Suitable for use in a DS + * resource record. + */ + digest: string; + /** + * Specifies the algorithm used to calculate this digest. + */ + type: string; + } /** - * As defined in RFC 4034 (section 3.2). - */ - signatureRrdatas: string[]; + * The response to a request to enumerate DnsKeys in a ManagedZone. + */ + export interface Schema$DnsKeysListResponse { + /** + * The requested resources. + */ + dnsKeys: Schema$DnsKey[]; + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a "snapshot" of + * collections larger than the maximum page size. + */ + nextPageToken: string; + } /** - * Number of seconds that this ResourceRecordSet can be cached by resolvers. - */ - ttl: number; + * Parameters for DnsKey key generation. Used for generating initial keys for + * a new ManagedZone and as default when adding a new DnsKey. + */ + export interface Schema$DnsKeySpec { + /** + * String mnemonic specifying the DNSSEC algorithm of this key. + */ + algorithm: string; + /** + * Length of the keys in bits. + */ + keyLength: number; + /** + * One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type + * KEY_SIGNING have the Secure Entry Point flag set and, when active, will + * be used to sign only resource record sets of type DNSKEY. Otherwise, the + * Secure Entry Point flag will be cleared and this key will be used to sign + * only resource record sets of other types. + */ + keyType: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#dnsKeySpec". + */ + kind: string; + } /** - * The identifier of a supported record type, for example, A, AAAA, MX, TXT, - * and so on. - */ - type: string; -} -export interface Schema$ResourceRecordSetsListResponse { - header: Schema$ResponseHeader; + * A zone is a subtree of the DNS namespace under one administrative + * responsibility. A ManagedZone is a resource that represents a DNS zone + * hosted by the Cloud DNS service. + */ + export interface Schema$ManagedZone { + /** + * The time that this resource was created on the server. This is in RFC3339 + * text format. Output only. + */ + creationTime: string; + /** + * A mutable string of at most 1024 characters associated with this resource + * for the user's convenience. Has no effect on the managed zone's + * function. + */ + description: string; + /** + * The DNS name of this managed zone, for instance "example.com.". + */ + dnsName: string; + /** + * DNSSEC configuration. + */ + dnssecConfig: Schema$ManagedZoneDnsSecConfig; + /** + * Unique identifier for the resource; defined by the server (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZone". + */ + kind: string; + /** + * User labels. + */ + labels: any; + /** + * User assigned name for this resource. Must be unique within the project. + * The name must be 1-63 characters long, must begin with a letter, end with + * a letter or digit, and only contain lowercase letters, digits or dashes. + */ + name: string; + /** + * Delegate your managed_zone to these virtual name servers; defined by the + * server (output only) + */ + nameServers: string[]; + /** + * Optionally specifies the NameServerSet for this ManagedZone. A + * NameServerSet is a set of DNS name servers that all host the same + * ManagedZones. Most users will leave this field unset. + */ + nameServerSet: string; + } + export interface Schema$ManagedZoneDnsSecConfig { + /** + * Specifies parameters that will be used for generating initial DnsKeys for + * this ManagedZone. Output only while state is not OFF. + */ + defaultKeySpecs: Schema$DnsKeySpec[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#managedZoneDnsSecConfig". + */ + kind: string; + /** + * Specifies the mechanism used to provide authenticated denial-of-existence + * responses. Output only while state is not OFF. + */ + nonExistence: string; + /** + * Specifies whether DNSSEC is enabled, and what mode it is in. + */ + state: string; + } + export interface Schema$ManagedZoneOperationsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + /** + * The operation resources. + */ + operations: Schema$Operation[]; + } + export interface Schema$ManagedZonesListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The managed zone resources. + */ + managedZones: Schema$ManagedZone[]; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your page token. In this + * way you can retrieve the complete contents of even very large collections + * one page at a time. However, if the contents of the collection change + * between the first and last paginated list request, the set of all + * elements returned will be an inconsistent view of the collection. There + * is no way to retrieve a consistent snapshot of a collection larger than + * the maximum page size. + */ + nextPageToken: string; + } /** - * Type of resource. - */ - kind: string; + * An operation represents a successful mutation performed on a Cloud DNS + * resource. Operations provide: - An audit log of server resource mutations. + * - A way to recover/retry API calls in the case where the response is never + * received by the caller. Use the caller specified client_operation_id. + */ + export interface Schema$Operation { + /** + * Only populated if the operation targeted a DnsKey (output only). + */ + dnsKeyContext: Schema$OperationDnsKeyContext; + /** + * Unique identifier for the resource. This is the client_operation_id if + * the client specified it when the mutation was initiated, otherwise, it is + * generated by the server. The name must be 1-63 characters long and match + * the regular expression [-a-z0-9]? (output only) + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#operation". + */ + kind: string; + /** + * The time that this operation was started by the server. This is in + * RFC3339 text format (output only). + */ + startTime: string; + /** + * Status of the operation. Can be one of the following: "PENDING" + * or "DONE" (output only). + */ + status: string; + /** + * Type of the operation. Operations include insert, update, and delete + * (output only). + */ + type: string; + /** + * User who requested the operation, for example: user@example.com. + * cloud-dns-system for operations automatically done by the system. (output + * only) + */ + user: string; + /** + * Only populated if the operation targeted a ManagedZone (output only). + */ + zoneContext: Schema$OperationManagedZoneContext; + } + export interface Schema$OperationDnsKeyContext { + /** + * The post-operation DnsKey resource. + */ + newValue: Schema$DnsKey; + /** + * The pre-operation DnsKey resource. + */ + oldValue: Schema$DnsKey; + } + export interface Schema$OperationManagedZoneContext { + /** + * The post-operation ManagedZone resource. + */ + newValue: Schema$ManagedZone; + /** + * The pre-operation ManagedZone resource. + */ + oldValue: Schema$ManagedZone; + } /** - * The presence of this field indicates that there exist more results - * following your last page of results in pagination order. To fetch them, - * make another list request using this value as your pagination token. In - * this way you can retrieve the complete contents of even very large - * collections one page at a time. However, if the contents of the collection - * change between the first and last paginated list request, the set of all - * elements returned will be an inconsistent view of the collection. There is - * no way to retrieve a consistent snapshot of a collection larger than the - * maximum page size. - */ - nextPageToken: string; + * A project resource. The project is a top level container for resources + * including Cloud DNS ManagedZones. Projects can be created only in the APIs + * console. + */ + export interface Schema$Project { + /** + * User assigned unique identifier for the resource (output only). + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#project". + */ + kind: string; + /** + * Unique numeric identifier for the resource; defined by the server (output + * only). + */ + number: string; + /** + * Quotas assigned to this project (output only). + */ + quota: Schema$Quota; + } /** - * The resource record set resources. - */ - rrsets: Schema$ResourceRecordSet[]; -} -/** - * Elements common to every response. - */ -export interface Schema$ResponseHeader { + * Limits associated with a Project. + */ + export interface Schema$Quota { + /** + * Whether a black hole zone should suppress system zones for this project. + */ + blackHoleHidesSystemZones: boolean; + /** + * Maximum allowed number of DnsKeys per ManagedZone. + */ + dnsKeysPerManagedZone: number; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#quota". + */ + kind: string; + /** + * Maximum allowed number of managed zones in the project. + */ + managedZones: number; + /** + * Maximum allowed number of ResourceRecords per ResourceRecordSet. + */ + resourceRecordsPerRrset: number; + /** + * Maximum allowed number of ResourceRecordSets to add per + * ChangesCreateRequest. + */ + rrsetAdditionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets to delete per + * ChangesCreateRequest. + */ + rrsetDeletionsPerChange: number; + /** + * Maximum allowed number of ResourceRecordSets per zone in the project. + */ + rrsetsPerManagedZone: number; + /** + * Maximum allowed size for total rrdata in one ChangesCreateRequest in + * bytes. + */ + totalRrdataSizePerChange: number; + /** + * DNSSEC algorithm and key length types that can be used for DnsKeys. + */ + whitelistedKeySpecs: Schema$DnsKeySpec[]; + } /** - * For mutating operation requests that completed successfully. This is the - * client_operation_id if the client specified it, otherwise it is generated - * by the server (output only). - */ - operationId: string; -} - -export class Resource$Changes { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); + * A unit of data that will be returned by the DNS servers. + */ + export interface Schema$ResourceRecordSet { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "dns#resourceRecordSet". + */ + kind: string; + /** + * For example, www.example.com. + */ + name: string; + /** + * As defined in RFC 1035 (section 5) and RFC 1034 (section 3.6.1). + */ + rrdatas: string[]; + /** + * As defined in RFC 4034 (section 3.2). + */ + signatureRrdatas: string[]; + /** + * Number of seconds that this ResourceRecordSet can be cached by resolvers. + */ + ttl: number; + /** + * The identifier of a supported record type, for example, A, AAAA, MX, TXT, + * and so on. + */ + type: string; } - - getRoot() { - return this.root; + export interface Schema$ResourceRecordSetsListResponse { + header: Schema$ResponseHeader; + /** + * Type of resource. + */ + kind: string; + /** + * The presence of this field indicates that there exist more results + * following your last page of results in pagination order. To fetch them, + * make another list request using this value as your pagination token. In + * this way you can retrieve the complete contents of even very large + * collections one page at a time. However, if the contents of the + * collection change between the first and last paginated list request, the + * set of all elements returned will be an inconsistent view of the + * collection. There is no way to retrieve a consistent snapshot of a + * collection larger than the maximum page size. + */ + nextPageToken: string; + /** + * The resource record set resources. + */ + rrsets: Schema$ResourceRecordSet[]; } - - /** - * dns.changes.create - * @desc Atomically update the ResourceRecordSet collection. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dns.changes.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().Change} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Elements common to every response. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ResponseHeader { + /** + * For mutating operation requests that completed successfully. This is the + * client_operation_id if the client specified it, otherwise it is generated + * by the server (output only). + */ + operationId: string; } - - /** - * dns.changes.get - * @desc Fetch the representation of an existing Change. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * // The identifier of the requested change, from a previous - * ResourceRecordSetsChangeResponse. changeId: 'my-change-id', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.changes.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Changes { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes/{changeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'changeId'], - pathParams: ['changeId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.changes.list - * @desc Enumerate Changes to a ResourceRecordSet collection. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var changesPage = response['changes']; - * if (!changesPage) { - * return; - * } - * for (var i = 0; i < changesPage.length; i++) { - * // TODO: Change code below to process each resource in `changesPage`: - * console.log(JSON.stringify(changesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.changes.list(request, handlePage); - * } - * }; - * - * dns.changes.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.changes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. - * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.changes.create + * @desc Atomically update the ResourceRecordSet collection. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dns.changes.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().Change} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Dnskeys { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.changes.get + * @desc Fetch the representation of an existing Change. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * // The identifier of the requested change, from a previous + * ResourceRecordSetsChangeResponse. changeId: 'my-change-id', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.changes.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.changeId The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse. + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes/{changeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'changeId'], + pathParams: ['changeId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.dnsKeys.get - * @desc Fetch the representation of an existing DnsKey. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * // The identifier of the requested DnsKey. - * dnsKeyId: 'my-dns-key-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.dnsKeys.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.dnsKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.dnsKeyId The identifier of the requested DnsKey. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'dnsKeyId'], - pathParams: ['dnsKeyId', 'managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.changes.list + * @desc Enumerate Changes to a ResourceRecordSet collection. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var changesPage = response['changes']; + * if (!changesPage) { + * return; + * } + * for (var i = 0; i < changesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `changesPage`: console.log(JSON.stringify(changesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.changes.list(request, handlePage); + * } + * }; + * + * dns.changes.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.changes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported value is change sequence. + * @param {string=} params.sortOrder Sorting order direction: 'ascending' or 'descending'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/changes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.dnsKeys.list - * @desc Enumerate DnsKeys to a ResourceRecordSet collection. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var dnsKeysPage = response['dnsKeys']; - * if (!dnsKeysPage) { - * return; - * } - * for (var i = 0; i < dnsKeysPage.length; i++) { - * // TODO: Change code below to process each resource in `dnsKeysPage`: - * console.log(JSON.stringify(dnsKeysPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.dnsKeys.list(request, handlePage); - * } - * }; - * - * dns.dnsKeys.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.dnsKeys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Dnskeys { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/dnsKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzoneoperations { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.dnsKeys.get + * @desc Fetch the representation of an existing DnsKey. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * // The identifier of the requested DnsKey. + * dnsKeyId: 'my-dns-key-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.dnsKeys.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.dnsKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.dnsKeyId The identifier of the requested DnsKey. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'dnsKeyId'], + pathParams: ['dnsKeyId', 'managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZoneOperations.get - * @desc Fetch the representation of an existing Operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * // Identifies the operation addressed by this request. - * operation: 'my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZoneOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {string} params.operation Identifies the operation addressed by this request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone', 'operation'], - pathParams: ['managedZone', 'operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.dnsKeys.list + * @desc Enumerate DnsKeys to a ResourceRecordSet collection. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var dnsKeysPage = response['dnsKeys']; + * if (!dnsKeysPage) { + * return; + * } + * for (var i = 0; i < dnsKeysPage.length; i++) { + * // TODO: Change code below to process each resource in + * `dnsKeysPage`: console.log(JSON.stringify(dnsKeysPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.dnsKeys.list(request, handlePage); + * } + * }; + * + * dns.dnsKeys.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.dnsKeys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.digestType An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/dnsKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * dns.managedZoneOperations.list - * @desc Enumerate Operations for the given ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. - * managedZone: 'my-managed-zone', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZoneOperations.list(request, handlePage); - * } - * }; - * - * dns.managedZoneOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Managedzoneoperations { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Managedzones { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZoneOperations.get + * @desc Fetch the representation of an existing Operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. + * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * + * // Identifies the operation addressed by this request. + * operation: 'my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.managedZoneOperations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {string} params.operation Identifies the operation addressed by this request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone', 'operation'], + pathParams: ['managedZone', 'operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.managedZones.create - * @desc Create a new ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v2beta1/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * dns.managedZoneOperations.list + * @desc Enumerate Operations for the given ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. + * managedZone: 'my-managed-zone', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.managedZoneOperations.list(request, handlePage); + * } + * }; + * + * dns.managedZoneOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.sortBy Sorting criterion. The only supported values are START_TIME and ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * dns.managedZones.delete - * @desc Delete a previously created ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.delete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Managedzones { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * dns.managedZones.get - * @desc Fetch the representation of an existing ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * dns.managedZones.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.create + * @desc Create a new ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * dns.managedZones.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v2beta1/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.list - * @desc Enumerate ManagedZones that have been created but not yet deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var managedZonesPage = response['managedZones']; - * if (!managedZonesPage) { - * return; - * } - * for (var i = 0; i < managedZonesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `managedZonesPage`: console.log(JSON.stringify(managedZonesPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.managedZones.list(request, handlePage); - * } - * }; - * - * dns.managedZones.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.delete + * @desc Delete a previously created ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * dns.managedZones.delete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v2beta1/projects/{project}/managedZones') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.patch - * @desc Update an existing ManagedZone. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.get + * @desc Fetch the representation of an existing ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * dns.managedZones.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * dns.managedZones.update - * @desc Update an existing ManagedZone. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * dns.managedZones.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.managedZones.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {string} params.project Identifies the project addressed by this request. - * @param {().ManagedZone} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * dns.managedZones.list + * @desc Enumerate ManagedZones that have been created but not yet deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var managedZonesPage = response['managedZones']; + * if (!managedZonesPage) { + * return; + * } + * for (var i = 0; i < managedZonesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `managedZonesPage`: console.log(JSON.stringify(managedZonesPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.managedZones.list(request, handlePage); + * } + * }; + * + * dns.managedZones.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dnsName Restricts the list to return only zones with this domain name. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v2beta1/projects/{project}/managedZones') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * dns.managedZones.patch + * @desc Update an existing ManagedZone. This method supports patch + * semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * dns.managedZones.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * dns.projects.get - * @desc Fetch the representation of an existing Project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * dns.projects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. - * @param {string} params.project Identifies the project addressed by this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * dns.managedZones.update + * @desc Update an existing ManagedZone. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * dns.managedZones.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.managedZones.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {string} params.project Identifies the project addressed by this request. + * @param {().ManagedZone} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Projects { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/dns/v2beta1/projects/{project}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Resourcerecordsets { - root: Dns; - constructor(root: Dns) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * dns.projects.get + * @desc Fetch the representation of an existing Project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * dns.projects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientOperationId For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. + * @param {string} params.project Identifies the project addressed by this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/dns/v2beta1/projects/{project}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * dns.resourceRecordSets.list - * @desc Enumerate ResourceRecordSets that have been created but not yet - * deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud DNS API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/dns - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var dns = google.dns('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Identifies the project addressed by this request. - * project: 'my-project', // TODO: Update placeholder value. - * - * // Identifies the managed zone addressed by this request. Can be the - * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var rrsetsPage = response['rrsets']; - * if (!rrsetsPage) { - * return; - * } - * for (var i = 0; i < rrsetsPage.length; i++) { - * // TODO: Change code below to process each resource in `rrsetsPage`: - * console.log(JSON.stringify(rrsetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * dns.resourceRecordSets.list(request, handlePage); - * } - * }; - * - * dns.resourceRecordSets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias dns.resourceRecordSets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. - * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. - * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. - * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. - * @param {string} params.project Identifies the project addressed by this request. - * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Resourcerecordsets { + root: Dns; + constructor(root: Dns) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/rrsets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'managedZone'], - pathParams: ['managedZone', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * dns.resourceRecordSets.list + * @desc Enumerate ResourceRecordSets that have been created but not yet + * deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud DNS API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/dns + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var dns = google.dns('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Identifies the project addressed by this request. + * project: 'my-project', // TODO: Update placeholder value. + * + * // Identifies the managed zone addressed by this request. Can be the + * managed zone name or id. managedZone: 'my-managed-zone', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var rrsetsPage = response['rrsets']; + * if (!rrsetsPage) { + * return; + * } + * for (var i = 0; i < rrsetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `rrsetsPage`: console.log(JSON.stringify(rrsetsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * dns.resourceRecordSets.list(request, handlePage); + * } + * }; + * + * dns.resourceRecordSets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias dns.resourceRecordSets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.managedZone Identifies the managed zone addressed by this request. Can be the managed zone name or id. + * @param {integer=} params.maxResults Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return. + * @param {string=} params.name Restricts the list to return only records with this fully qualified domain name. + * @param {string=} params.pageToken Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request. + * @param {string} params.project Identifies the project addressed by this request. + * @param {string=} params.type Restricts the list to return only records of this type. If present, the "name" parameter must also be present. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/dns/v2beta1/projects/{project}/managedZones/{managedZone}/rrsets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'managedZone'], + pathParams: ['managedZone', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/doubleclickbidmanager/v1.ts b/src/apis/doubleclickbidmanager/v1.ts index beec3da6074..631d6d80b59 100644 --- a/src/apis/doubleclickbidmanager/v1.ts +++ b/src/apis/doubleclickbidmanager/v1.ts @@ -27,1023 +27,1039 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * DoubleClick Bid Manager API - * - * API for viewing and managing your reports in DoubleClick Bid Manager. - * - * @example - * const google = require('googleapis'); - * const doubleclickbidmanager = google.doubleclickbidmanager('v1'); - * - * @namespace doubleclickbidmanager - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Doubleclickbidmanager - */ -export class Doubleclickbidmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace doubleclickbidmanager_v1 { + /** + * DoubleClick Bid Manager API + * + * API for viewing and managing your reports in DoubleClick Bid Manager. + * + * @example + * const google = require('googleapis'); + * const doubleclickbidmanager = google.doubleclickbidmanager('v1'); + * + * @namespace doubleclickbidmanager + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Doubleclickbidmanager + */ + export class Doubleclickbidmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - lineitems: Resource$Lineitems; - queries: Resource$Queries; - reports: Resource$Reports; - sdf: Resource$Sdf; + lineitems: Resource$Lineitems; + queries: Resource$Queries; + reports: Resource$Reports; + sdf: Resource$Sdf; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.lineitems = new Resource$Lineitems(this); - this.queries = new Resource$Queries(this); - this.reports = new Resource$Reports(this); - this.sdf = new Resource$Sdf(this); - } + this.lineitems = new Resource$Lineitems(this); + this.queries = new Resource$Queries(this); + this.reports = new Resource$Reports(this); + this.sdf = new Resource$Sdf(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request to fetch stored line items. - */ -export interface Schema$DownloadLineItemsRequest { - /** - * File specification (column names, types, order) in which the line items - * will be returned. Default to EWF. - */ - fileSpec: string; - /** - * Ids of the specified filter type used to filter line items to fetch. If - * omitted, all the line items will be returned. - */ - filterIds: string[]; - /** - * Filter type used to filter line items to fetch. - */ - filterType: string; - /** - * Format in which the line items will be returned. Default to CSV. - */ - format: string; -} -/** - * Download line items response. - */ -export interface Schema$DownloadLineItemsResponse { - /** - * Retrieved line items in CSV format. For more information about file - * formats, see Entity Write File Format. - */ - lineItems: string; -} -/** - * Request to fetch stored insertion orders, line items, TrueView ad groups and - * ads. - */ -export interface Schema$DownloadRequest { - /** - * File types that will be returned. - */ - fileTypes: string[]; - /** - * The IDs of the specified filter type. This is used to filter entities to - * fetch. At least one ID must be specified. Only one ID is allowed for the - * ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter - * types, all IDs must be from the same Advertiser. - */ - filterIds: string[]; - /** - * Filter type used to filter line items to fetch. - */ - filterType: string; /** - * SDF Version (column names, types, order) in which the entities will be - * returned. Default to 3. - */ - version: string; -} -/** - * Download response. - */ -export interface Schema$DownloadResponse { - /** - * Retrieved ad groups in SDF format. - */ - adGroups: string; - /** - * Retrieved ads in SDF format. - */ - ads: string; - /** - * Retrieved campaigns in SDF format. - */ - campaigns: string; - /** - * Retrieved insertion orders in SDF format. - */ - insertionOrders: string; - /** - * Retrieved line items in SDF format. - */ - lineItems: string; -} -/** - * Filter used to match traffic data in your report. - */ -export interface Schema$FilterPair { - /** - * Filter type. - */ - type: string; - /** - * Filter value. - */ - value: string; -} -/** - * List queries response. - */ -export interface Schema$ListQueriesResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "doubleclickbidmanager#listQueriesResponse". - */ - kind: string; - /** - * Retrieved queries. - */ - queries: Schema$Query[]; -} -/** - * List reports response. - */ -export interface Schema$ListReportsResponse { + * Request to fetch stored line items. + */ + export interface Schema$DownloadLineItemsRequest { + /** + * File specification (column names, types, order) in which the line items + * will be returned. Default to EWF. + */ + fileSpec: string; + /** + * Ids of the specified filter type used to filter line items to fetch. If + * omitted, all the line items will be returned. + */ + filterIds: string[]; + /** + * Filter type used to filter line items to fetch. + */ + filterType: string; + /** + * Format in which the line items will be returned. Default to CSV. + */ + format: string; + } /** - * Identifies what kind of resource this is. Value: the fixed string - * "doubleclickbidmanager#listReportsResponse". + * Download line items response. */ - kind: string; + export interface Schema$DownloadLineItemsResponse { + /** + * Retrieved line items in CSV format. For more information about file + * formats, see Entity Write File Format. + */ + lineItems: string; + } /** - * Retrieved reports. - */ - reports: Schema$Report[]; -} -/** - * Parameters of a query or report. - */ -export interface Schema$Parameters { + * Request to fetch stored insertion orders, line items, TrueView ad groups + * and ads. + */ + export interface Schema$DownloadRequest { + /** + * File types that will be returned. + */ + fileTypes: string[]; + /** + * The IDs of the specified filter type. This is used to filter entities to + * fetch. At least one ID must be specified. Only one ID is allowed for the + * ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter + * types, all IDs must be from the same Advertiser. + */ + filterIds: string[]; + /** + * Filter type used to filter line items to fetch. + */ + filterType: string; + /** + * SDF Version (column names, types, order) in which the entities will be + * returned. Default to 3. + */ + version: string; + } /** - * Filters used to match traffic data in your report. - */ - filters: Schema$FilterPair[]; + * Download response. + */ + export interface Schema$DownloadResponse { + /** + * Retrieved ad groups in SDF format. + */ + adGroups: string; + /** + * Retrieved ads in SDF format. + */ + ads: string; + /** + * Retrieved campaigns in SDF format. + */ + campaigns: string; + /** + * Retrieved insertion orders in SDF format. + */ + insertionOrders: string; + /** + * Retrieved line items in SDF format. + */ + lineItems: string; + } /** - * Data is grouped by the filters listed in this field. - */ - groupBys: string[]; + * Filter used to match traffic data in your report. + */ + export interface Schema$FilterPair { + /** + * Filter type. + */ + type: string; + /** + * Filter value. + */ + value: string; + } /** - * Whether to include data from Invite Media. - */ - includeInviteData: boolean; + * List queries response. + */ + export interface Schema$ListQueriesResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "doubleclickbidmanager#listQueriesResponse". + */ + kind: string; + /** + * Retrieved queries. + */ + queries: Schema$Query[]; + } /** - * Metrics to include as columns in your report. - */ - metrics: string[]; + * List reports response. + */ + export interface Schema$ListReportsResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "doubleclickbidmanager#listReportsResponse". + */ + kind: string; + /** + * Retrieved reports. + */ + reports: Schema$Report[]; + } /** - * Report type. - */ - type: string; -} -/** - * Represents a query. - */ -export interface Schema$Query { + * Parameters of a query or report. + */ + export interface Schema$Parameters { + /** + * Filters used to match traffic data in your report. + */ + filters: Schema$FilterPair[]; + /** + * Data is grouped by the filters listed in this field. + */ + groupBys: string[]; + /** + * Whether to include data from Invite Media. + */ + includeInviteData: boolean; + /** + * Metrics to include as columns in your report. + */ + metrics: string[]; + /** + * Report type. + */ + type: string; + } /** - * Identifies what kind of resource this is. Value: the fixed string - * "doubleclickbidmanager#query". - */ - kind: string; + * Represents a query. + */ + export interface Schema$Query { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "doubleclickbidmanager#query". + */ + kind: string; + /** + * Query metadata. + */ + metadata: Schema$QueryMetadata; + /** + * Query parameters. + */ + params: Schema$Parameters; + /** + * Query ID. + */ + queryId: string; + /** + * The ending time for the data that is shown in the report. Note, + * reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and + * ignored otherwise. + */ + reportDataEndTimeMs: string; + /** + * The starting time for the data that is shown in the report. Note, + * reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES + * and ignored otherwise. + */ + reportDataStartTimeMs: string; + /** + * Information on how often and when to run a query. + */ + schedule: Schema$QuerySchedule; + /** + * Canonical timezone code for report data time. Defaults to + * America/New_York. + */ + timezoneCode: string; + } /** * Query metadata. */ - metadata: Schema$QueryMetadata; - /** - * Query parameters. - */ - params: Schema$Parameters; - /** - * Query ID. - */ - queryId: string; - /** - * The ending time for the data that is shown in the report. Note, - * reportDataEndTimeMs is required if metadata.dataRange is CUSTOM_DATES and - * ignored otherwise. - */ - reportDataEndTimeMs: string; - /** - * The starting time for the data that is shown in the report. Note, - * reportDataStartTimeMs is required if metadata.dataRange is CUSTOM_DATES and - * ignored otherwise. - */ - reportDataStartTimeMs: string; - /** - * Information on how often and when to run a query. - */ - schedule: Schema$QuerySchedule; - /** - * Canonical timezone code for report data time. Defaults to America/New_York. - */ - timezoneCode: string; -} -/** - * Query metadata. - */ -export interface Schema$QueryMetadata { - /** - * Range of report data. - */ - dataRange: string; - /** - * Format of the generated report. - */ - format: string; - /** - * The path to the location in Google Cloud Storage where the latest report is - * stored. - */ - googleCloudStoragePathForLatestReport: string; - /** - * The path in Google Drive for the latest report. - */ - googleDrivePathForLatestReport: string; - /** - * The time when the latest report started to run. - */ - latestReportRunTimeMs: string; - /** - * Locale of the generated reports. Valid values are cs CZECH de GERMAN en - * ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH - * pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN - * CHINA_CHINESE zh-TW TAIWAN_CHINESE An locale string not in the list above - * will generate reports in English. - */ - locale: string; - /** - * Number of reports that have been generated for the query. - */ - reportCount: number; - /** - * Whether the latest report is currently running. - */ - running: boolean; - /** - * Whether to send an email notification when a report is ready. Default to - * false. - */ - sendNotification: boolean; - /** - * List of email addresses which are sent email notifications when the report - * is finished. Separate from sendNotification. - */ - shareEmailAddress: string[]; - /** - * Query title. It is used to name the reports generated from this query. - */ - title: string; -} -/** - * Information on how frequently and when to run a query. - */ -export interface Schema$QuerySchedule { - /** - * Datetime to periodically run the query until. - */ - endTimeMs: string; + export interface Schema$QueryMetadata { + /** + * Range of report data. + */ + dataRange: string; + /** + * Format of the generated report. + */ + format: string; + /** + * The path to the location in Google Cloud Storage where the latest report + * is stored. + */ + googleCloudStoragePathForLatestReport: string; + /** + * The path in Google Drive for the latest report. + */ + googleDrivePathForLatestReport: string; + /** + * The time when the latest report started to run. + */ + latestReportRunTimeMs: string; + /** + * Locale of the generated reports. Valid values are cs CZECH de GERMAN en + * ENGLISH es SPANISH fr FRENCH it ITALIAN ja JAPANESE ko KOREAN pl POLISH + * pt-BR BRAZILIAN_PORTUGUESE ru RUSSIAN tr TURKISH uk UKRAINIAN zh-CN + * CHINA_CHINESE zh-TW TAIWAN_CHINESE An locale string not in the list + * above will generate reports in English. + */ + locale: string; + /** + * Number of reports that have been generated for the query. + */ + reportCount: number; + /** + * Whether the latest report is currently running. + */ + running: boolean; + /** + * Whether to send an email notification when a report is ready. Default to + * false. + */ + sendNotification: boolean; + /** + * List of email addresses which are sent email notifications when the + * report is finished. Separate from sendNotification. + */ + shareEmailAddress: string[]; + /** + * Query title. It is used to name the reports generated from this query. + */ + title: string; + } /** - * How often the query is run. - */ - frequency: string; + * Information on how frequently and when to run a query. + */ + export interface Schema$QuerySchedule { + /** + * Datetime to periodically run the query until. + */ + endTimeMs: string; + /** + * How often the query is run. + */ + frequency: string; + /** + * Time of day at which a new report will be generated, represented as + * minutes past midnight. Range is 0 to 1439. Only applies to scheduled + * reports. + */ + nextRunMinuteOfDay: number; + /** + * Canonical timezone code for report generation time. Defaults to + * America/New_York. + */ + nextRunTimezoneCode: string; + } /** - * Time of day at which a new report will be generated, represented as minutes - * past midnight. Range is 0 to 1439. Only applies to scheduled reports. - */ - nextRunMinuteOfDay: number; + * Represents a report. + */ + export interface Schema$Report { + /** + * Key used to identify a report. + */ + key: Schema$ReportKey; + /** + * Report metadata. + */ + metadata: Schema$ReportMetadata; + /** + * Report parameters. + */ + params: Schema$Parameters; + } /** - * Canonical timezone code for report generation time. Defaults to - * America/New_York. + * An explanation of a report failure. */ - nextRunTimezoneCode: string; -} -/** - * Represents a report. - */ -export interface Schema$Report { + export interface Schema$ReportFailure { + /** + * Error code that shows why the report was not created. + */ + errorCode: string; + } /** * Key used to identify a report. */ - key: Schema$ReportKey; + export interface Schema$ReportKey { + /** + * Query ID. + */ + queryId: string; + /** + * Report ID. + */ + reportId: string; + } /** * Report metadata. */ - metadata: Schema$ReportMetadata; - /** - * Report parameters. - */ - params: Schema$Parameters; -} -/** - * An explanation of a report failure. - */ -export interface Schema$ReportFailure { - /** - * Error code that shows why the report was not created. - */ - errorCode: string; -} -/** - * Key used to identify a report. - */ -export interface Schema$ReportKey { - /** - * Query ID. - */ - queryId: string; - /** - * Report ID. - */ - reportId: string; -} -/** - * Report metadata. - */ -export interface Schema$ReportMetadata { - /** - * The path to the location in Google Cloud Storage where the report is - * stored. - */ - googleCloudStoragePath: string; - /** - * The ending time for the data that is shown in the report. - */ - reportDataEndTimeMs: string; - /** - * The starting time for the data that is shown in the report. - */ - reportDataStartTimeMs: string; + export interface Schema$ReportMetadata { + /** + * The path to the location in Google Cloud Storage where the report is + * stored. + */ + googleCloudStoragePath: string; + /** + * The ending time for the data that is shown in the report. + */ + reportDataEndTimeMs: string; + /** + * The starting time for the data that is shown in the report. + */ + reportDataStartTimeMs: string; + /** + * Report status. + */ + status: Schema$ReportStatus; + } /** * Report status. */ - status: Schema$ReportStatus; -} -/** - * Report status. - */ -export interface Schema$ReportStatus { - /** - * If the report failed, this records the cause. - */ - failure: Schema$ReportFailure; - /** - * The time when this report either completed successfully or failed. - */ - finishTimeMs: string; - /** - * The file type of the report. - */ - format: string; - /** - * The state of the report. - */ - state: string; -} -/** - * Represents the upload status of a row in the request. - */ -export interface Schema$RowStatus { - /** - * Whether the stored entity is changed as a result of upload. - */ - changed: boolean; - /** - * Entity Id. - */ - entityId: string; - /** - * Entity name. - */ - entityName: string; - /** - * Reasons why the entity can't be uploaded. - */ - errors: string[]; - /** - * Whether the entity is persisted. - */ - persisted: boolean; - /** - * Row number. - */ - rowNumber: number; -} -/** - * Request to run a stored query to generate a report. - */ -export interface Schema$RunQueryRequest { - /** - * Report data range used to generate the report. - */ - dataRange: string; - /** - * The ending time for the data that is shown in the report. Note, - * reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored - * otherwise. - */ - reportDataEndTimeMs: string; - /** - * The starting time for the data that is shown in the report. Note, - * reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and ignored - * otherwise. - */ - reportDataStartTimeMs: string; - /** - * Canonical timezone code for report data time. Defaults to America/New_York. - */ - timezoneCode: string; -} -/** - * Request to upload line items. - */ -export interface Schema$UploadLineItemsRequest { - /** - * Set to true to get upload status without actually persisting the line - * items. - */ - dryRun: boolean; - /** - * Format the line items are in. Default to CSV. - */ - format: string; + export interface Schema$ReportStatus { + /** + * If the report failed, this records the cause. + */ + failure: Schema$ReportFailure; + /** + * The time when this report either completed successfully or failed. + */ + finishTimeMs: string; + /** + * The file type of the report. + */ + format: string; + /** + * The state of the report. + */ + state: string; + } /** - * Line items in CSV to upload. Refer to Entity Write File Format for more - * information on file format. - */ - lineItems: string; -} -/** - * Upload line items response. - */ -export interface Schema$UploadLineItemsResponse { + * Represents the upload status of a row in the request. + */ + export interface Schema$RowStatus { + /** + * Whether the stored entity is changed as a result of upload. + */ + changed: boolean; + /** + * Entity Id. + */ + entityId: string; + /** + * Entity name. + */ + entityName: string; + /** + * Reasons why the entity can't be uploaded. + */ + errors: string[]; + /** + * Whether the entity is persisted. + */ + persisted: boolean; + /** + * Row number. + */ + rowNumber: number; + } /** - * Status of upload. - */ - uploadStatus: Schema$UploadStatus; -} -/** - * Represents the status of upload. - */ -export interface Schema$UploadStatus { + * Request to run a stored query to generate a report. + */ + export interface Schema$RunQueryRequest { + /** + * Report data range used to generate the report. + */ + dataRange: string; + /** + * The ending time for the data that is shown in the report. Note, + * reportDataEndTimeMs is required if dataRange is CUSTOM_DATES and ignored + * otherwise. + */ + reportDataEndTimeMs: string; + /** + * The starting time for the data that is shown in the report. Note, + * reportDataStartTimeMs is required if dataRange is CUSTOM_DATES and + * ignored otherwise. + */ + reportDataStartTimeMs: string; + /** + * Canonical timezone code for report data time. Defaults to + * America/New_York. + */ + timezoneCode: string; + } /** - * Reasons why upload can't be completed. - */ - errors: string[]; + * Request to upload line items. + */ + export interface Schema$UploadLineItemsRequest { + /** + * Set to true to get upload status without actually persisting the line + * items. + */ + dryRun: boolean; + /** + * Format the line items are in. Default to CSV. + */ + format: string; + /** + * Line items in CSV to upload. Refer to Entity Write File Format for more + * information on file format. + */ + lineItems: string; + } /** - * Per-row upload status. + * Upload line items response. */ - rowStatus: Schema$RowStatus[]; -} - -export class Resource$Lineitems { - root: Doubleclickbidmanager; - constructor(root: Doubleclickbidmanager) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$UploadLineItemsResponse { + /** + * Status of upload. + */ + uploadStatus: Schema$UploadStatus; } - - getRoot() { - return this.root; + /** + * Represents the status of upload. + */ + export interface Schema$UploadStatus { + /** + * Reasons why upload can't be completed. + */ + errors: string[]; + /** + * Per-row upload status. + */ + rowStatus: Schema$RowStatus[]; } - - /** - * doubleclickbidmanager.lineitems.downloadlineitems - * @desc Retrieves line items in CSV format. TrueView line items are not - * supported. - * @alias doubleclickbidmanager.lineitems.downloadlineitems - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().DownloadLineItemsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - downloadlineitems(params?: any, options?: MethodOptions): - AxiosPromise; - downloadlineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - downloadlineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Lineitems { + root: Doubleclickbidmanager; + constructor(root: Doubleclickbidmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/doubleclickbidmanager/v1/lineitems/downloadlineitems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * doubleclickbidmanager.lineitems.uploadlineitems - * @desc Uploads line items in CSV format. TrueView line items are not - * supported. - * @alias doubleclickbidmanager.lineitems.uploadlineitems - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().UploadLineItemsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - uploadlineitems(params?: any, options?: MethodOptions): - AxiosPromise; - uploadlineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - uploadlineitems( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclickbidmanager.lineitems.downloadlineitems + * @desc Retrieves line items in CSV format. TrueView line items are not + * supported. + * @alias doubleclickbidmanager.lineitems.downloadlineitems + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().DownloadLineItemsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + downloadlineitems(params?: any, options?: MethodOptions): + AxiosPromise; + downloadlineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + downloadlineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/doubleclickbidmanager/v1/lineitems/downloadlineitems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/doubleclickbidmanager/v1/lineitems/uploadlineitems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Queries { - root: Doubleclickbidmanager; - constructor(root: Doubleclickbidmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * doubleclickbidmanager.lineitems.uploadlineitems + * @desc Uploads line items in CSV format. TrueView line items are not + * supported. + * @alias doubleclickbidmanager.lineitems.uploadlineitems + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().UploadLineItemsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + uploadlineitems(params?: any, options?: MethodOptions): + AxiosPromise; + uploadlineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + uploadlineitems( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/doubleclickbidmanager/v1/lineitems/uploadlineitems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * doubleclickbidmanager.queries.createquery - * @desc Creates a query. - * @alias doubleclickbidmanager.queries.createquery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Query} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createquery(params?: any, options?: MethodOptions): - AxiosPromise; - createquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Queries { + root: Doubleclickbidmanager; + constructor(root: Doubleclickbidmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * doubleclickbidmanager.queries.deletequery - * @desc Deletes a stored query as well as the associated stored reports. - * @alias doubleclickbidmanager.queries.deletequery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.queryId Query ID to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deletequery(params?: any, options?: MethodOptions): AxiosPromise; - deletequery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deletequery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclickbidmanager.queries.createquery + * @desc Creates a query. + * @alias doubleclickbidmanager.queries.createquery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Query} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createquery(params?: any, options?: MethodOptions): + AxiosPromise; + createquery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createquery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['queryId'], - pathParams: ['queryId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * doubleclickbidmanager.queries.getquery - * @desc Retrieves a stored query. - * @alias doubleclickbidmanager.queries.getquery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.queryId Query ID to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getquery(params?: any, options?: MethodOptions): AxiosPromise; - getquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['queryId'], - pathParams: ['queryId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * doubleclickbidmanager.queries.deletequery + * @desc Deletes a stored query as well as the associated stored reports. + * @alias doubleclickbidmanager.queries.deletequery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.queryId Query ID to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deletequery(params?: any, options?: MethodOptions): AxiosPromise; + deletequery( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deletequery( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['queryId'], + pathParams: ['queryId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * doubleclickbidmanager.queries.listqueries - * @desc Retrieves stored queries. - * @alias doubleclickbidmanager.queries.listqueries - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listqueries(params?: any, options?: MethodOptions): - AxiosPromise; - listqueries( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listqueries( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/queries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * doubleclickbidmanager.queries.getquery + * @desc Retrieves a stored query. + * @alias doubleclickbidmanager.queries.getquery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.queryId Query ID to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getquery(params?: any, options?: MethodOptions): AxiosPromise; + getquery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getquery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['queryId'], + pathParams: ['queryId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * doubleclickbidmanager.queries.runquery - * @desc Runs a stored query to generate a report. - * @alias doubleclickbidmanager.queries.runquery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.queryId Query ID to run. - * @param {().RunQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runquery(params?: any, options?: MethodOptions): AxiosPromise; - runquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runquery( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclickbidmanager.queries.listqueries + * @desc Retrieves stored queries. + * @alias doubleclickbidmanager.queries.listqueries + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listqueries(params?: any, options?: MethodOptions): + AxiosPromise; + listqueries( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listqueries( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/queries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['queryId'], - pathParams: ['queryId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Reports { - root: Doubleclickbidmanager; - constructor(root: Doubleclickbidmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * doubleclickbidmanager.queries.runquery + * @desc Runs a stored query to generate a report. + * @alias doubleclickbidmanager.queries.runquery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.queryId Query ID to run. + * @param {().RunQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runquery(params?: any, options?: MethodOptions): AxiosPromise; + runquery( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runquery( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/query/{queryId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['queryId'], + pathParams: ['queryId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * doubleclickbidmanager.reports.listreports - * @desc Retrieves stored reports. - * @alias doubleclickbidmanager.reports.listreports - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.queryId Query ID with which the reports are associated. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listreports(params?: any, options?: MethodOptions): - AxiosPromise; - listreports( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listreports( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Doubleclickbidmanager; + constructor(root: Doubleclickbidmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/doubleclickbidmanager/v1/queries/{queryId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['queryId'], - pathParams: ['queryId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Sdf { - root: Doubleclickbidmanager; - constructor(root: Doubleclickbidmanager) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * doubleclickbidmanager.reports.listreports + * @desc Retrieves stored reports. + * @alias doubleclickbidmanager.reports.listreports + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.queryId Query ID with which the reports are associated. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listreports(params?: any, options?: MethodOptions): + AxiosPromise; + listreports( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listreports( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/doubleclickbidmanager/v1/queries/{queryId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['queryId'], + pathParams: ['queryId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * doubleclickbidmanager.sdf.download - * @desc Retrieves entities in SDF format. - * @alias doubleclickbidmanager.sdf.download - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().DownloadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - download(params?: any, options?: MethodOptions): - AxiosPromise; - download( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - download( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Sdf { + root: Doubleclickbidmanager; + constructor(root: Doubleclickbidmanager) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclickbidmanager/v1/sdf/download') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * doubleclickbidmanager.sdf.download + * @desc Retrieves entities in SDF format. + * @alias doubleclickbidmanager.sdf.download + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().DownloadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + download(params?: any, options?: MethodOptions): + AxiosPromise; + download( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + download( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclickbidmanager/v1/sdf/download') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/doubleclicksearch/v2.ts b/src/apis/doubleclicksearch/v2.ts index 84137035166..354741c22a8 100644 --- a/src/apis/doubleclicksearch/v2.ts +++ b/src/apis/doubleclicksearch/v2.ts @@ -27,1135 +27,1151 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * DoubleClick Search API - * - * Reports and modifies your advertising data in DoubleClick Search (for - * example, campaigns, ad groups, keywords, and conversions). - * - * @example - * const google = require('googleapis'); - * const doubleclicksearch = google.doubleclicksearch('v2'); - * - * @namespace doubleclicksearch - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Doubleclicksearch - */ -export class Doubleclicksearch { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace doubleclicksearch_v2 { + /** + * DoubleClick Search API + * + * Reports and modifies your advertising data in DoubleClick Search (for + * example, campaigns, ad groups, keywords, and conversions). + * + * @example + * const google = require('googleapis'); + * const doubleclicksearch = google.doubleclicksearch('v2'); + * + * @namespace doubleclicksearch + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Doubleclicksearch + */ + export class Doubleclicksearch { + _options: GlobalOptions; + google: GoogleApis; + root = this; - conversion: Resource$Conversion; - reports: Resource$Reports; - savedColumns: Resource$Savedcolumns; + conversion: Resource$Conversion; + reports: Resource$Reports; + savedColumns: Resource$Savedcolumns; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.conversion = new Resource$Conversion(this); - this.reports = new Resource$Reports(this); - this.savedColumns = new Resource$Savedcolumns(this); - } + this.conversion = new Resource$Conversion(this); + this.reports = new Resource$Reports(this); + this.savedColumns = new Resource$Savedcolumns(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A message containing availability data relevant to DoubleClick Search. - */ -export interface Schema$Availability { - /** - * DS advertiser ID. - */ - advertiserId: string; - /** - * DS agency ID. - */ - agencyId: string; - /** - * The time by which all conversions have been uploaded, in epoch millis UTC. - */ - availabilityTimestamp: string; - /** - * The numeric segmentation identifier (for example, DoubleClick Search - * Floodlight activity ID). - */ - segmentationId: string; - /** - * The friendly segmentation identifier (for example, DoubleClick Search - * Floodlight activity name). - */ - segmentationName: string; - /** - * The segmentation type that this availability is for (its default value is - * FLOODLIGHT). - */ - segmentationType: string; -} -/** - * A conversion containing data relevant to DoubleClick Search. - */ -export interface Schema$Conversion { - /** - * DS ad group ID. - */ - adGroupId: string; - /** - * DS ad ID. - */ - adId: string; - /** - * DS advertiser ID. - */ - advertiserId: string; - /** - * DS agency ID. - */ - agencyId: string; - /** - * Available to advertisers only after contacting DoubleClick Search customer - * support. - */ - attributionModel: string; - /** - * DS campaign ID. - */ - campaignId: string; - /** - * Sales channel for the product. Acceptable values are: - - * "local": a physical store - "online": an online store - */ - channel: string; - /** - * DS click ID for the conversion. - */ - clickId: string; - /** - * For offline conversions, advertisers provide this ID. Advertisers can - * specify any ID that is meaningful to them. Each conversion in a request - * must specify a unique ID, and the combination of ID and timestamp must be - * unique amongst all conversions within the advertiser. For online - * conversions, DS copies the dsConversionId or floodlightOrderId into this - * property depending on the advertiser's Floodlight instructions. - */ - conversionId: string; - /** - * The time at which the conversion was last modified, in epoch millis UTC. - */ - conversionModifiedTimestamp: string; - /** - * The time at which the conversion took place, in epoch millis UTC. - */ - conversionTimestamp: string; - /** - * Available to advertisers only after contacting DoubleClick Search customer - * support. - */ - countMillis: string; - /** - * DS criterion (keyword) ID. - */ - criterionId: string; - /** - * The currency code for the conversion's revenue. Should be in ISO 4217 - * alphabetic (3-char) format. - */ - currencyCode: string; - /** - * Custom dimensions for the conversion, which can be used to filter data in a - * report. - */ - customDimension: Schema$CustomDimension[]; - /** - * Custom metrics for the conversion. - */ - customMetric: Schema$CustomMetric[]; - /** - * The type of device on which the conversion occurred. - */ - deviceType: string; - /** - * ID that DoubleClick Search generates for each conversion. - */ - dsConversionId: string; - /** - * DS engine account ID. - */ - engineAccountId: string; - /** - * The Floodlight order ID provided by the advertiser for the conversion. - */ - floodlightOrderId: string; - /** - * ID that DS generates and uses to uniquely identify the inventory account - * that contains the product. - */ - inventoryAccountId: string; - /** - * The country registered for the Merchant Center feed that contains the - * product. Use an ISO 3166 code to specify a country. - */ - productCountry: string; - /** - * DS product group ID. - */ - productGroupId: string; - /** - * The product ID (SKU). - */ - productId: string; - /** - * The language registered for the Merchant Center feed that contains the - * product. Use an ISO 639 code to specify a language. - */ - productLanguage: string; - /** - * The quantity of this conversion, in millis. - */ - quantityMillis: string; - /** - * The revenue amount of this TRANSACTION conversion, in micros (value - * multiplied by 1000000, no decimal). For example, to specify a revenue value - * of "10" enter "10000000" (10 million) in your request. - */ - revenueMicros: string; - /** - * The numeric segmentation identifier (for example, DoubleClick Search - * Floodlight activity ID). - */ - segmentationId: string; - /** - * The friendly segmentation identifier (for example, DoubleClick Search - * Floodlight activity name). - */ - segmentationName: string; - /** - * The segmentation type of this conversion (for example, FLOODLIGHT). - */ - segmentationType: string; - /** - * The state of the conversion, that is, either ACTIVE or REMOVED. Note: state - * DELETED is deprecated. - */ - state: string; - /** - * The ID of the local store for which the product was advertised. Applicable - * only when the channel is "local". - */ - storeId: string; - /** - * The type of the conversion, that is, either ACTION or TRANSACTION. An - * ACTION conversion is an action by the user that has no monetarily - * quantifiable value, while a TRANSACTION conversion is an action that does - * have a monetarily quantifiable value. Examples are email list signups - * (ACTION) versus ecommerce purchases (TRANSACTION). - */ - type: string; -} -/** - * A list of conversions. - */ -export interface Schema$ConversionList { - /** - * The conversions being requested. - */ - conversion: Schema$Conversion[]; - /** - * Identifies this as a ConversionList resource. Value: the fixed string - * doubleclicksearch#conversionList. - */ - kind: string; -} -/** - * A message containing the custome dimension. - */ -export interface Schema$CustomDimension { - /** - * Custom dimension name. - */ - name: string; - /** - * Custom dimension value. - */ - value: string; -} -/** - * A message containing the custome metric. - */ -export interface Schema$CustomMetric { - /** - * Custom metric name. - */ - name: string; - /** - * Custom metric numeric value. - */ - value: number; -} -/** - * A DoubleClick Search report. This object contains the report request, some - * report metadata such as currency code, and the generated report rows or - * report files. - */ -export interface Schema$Report { - /** - * Asynchronous report only. Contains a list of generated report files once - * the report has succesfully completed. - */ - files: any[]; - /** - * Asynchronous report only. Id of the report. - */ - id: string; - /** - * Asynchronous report only. True if and only if the report has completed - * successfully and the report files are ready to be downloaded. - */ - isReportReady: boolean; - /** - * Identifies this as a Report resource. Value: the fixed string - * doubleclicksearch#report. - */ - kind: string; - /** - * The request that created the report. Optional fields not specified in the - * original request are filled with default values. - */ - request: Schema$ReportRequest; - /** - * The number of report rows generated by the report, not including headers. - */ - rowCount: number; - /** - * Synchronous report only. Generated report rows. - */ - rows: Schema$ReportRow[]; - /** - * The currency code of all monetary values produced in the report, including - * values that are set by users (e.g., keyword bid settings) and metrics - * (e.g., cost and revenue). The currency code of a report is determined by - * the statisticsCurrency field of the report request. - */ - statisticsCurrencyCode: string; - /** - * If all statistics of the report are sourced from the same time zone, this - * would be it. Otherwise the field is unset. - */ - statisticsTimeZone: string; -} -/** - * A request object used to create a DoubleClick Search report. - */ -export interface Schema$ReportApiColumnSpec { - /** - * Name of a DoubleClick Search column to include in the report. - */ - columnName: string; - /** - * Segments a report by a custom dimension. The report must be scoped to an - * advertiser or lower, and the custom dimension must already be set up in - * DoubleClick Search. The custom dimension name, which appears in DoubleClick - * Search, is case sensitive. If used in a conversion report, returns the - * value of the specified custom dimension for the given conversion, if set. - * This column does not segment the conversion report. - */ - customDimensionName: string; /** - * Name of a custom metric to include in the report. The report must be scoped - * to an advertiser or lower, and the custom metric must already be set up in - * DoubleClick Search. The custom metric name, which appears in DoubleClick - * Search, is case sensitive. - */ - customMetricName: string; - /** - * Inclusive day in YYYY-MM-DD format. When provided, this overrides the - * overall time range of the report for this column only. Must be provided - * together with startDate. - */ - endDate: string; - /** - * Synchronous report only. Set to true to group by this column. Defaults to - * false. - */ - groupByColumn: boolean; - /** - * Text used to identify this column in the report output; defaults to - * columnName or savedColumnName when not specified. This can be used to - * prevent collisions between DoubleClick Search columns and saved columns - * with the same name. - */ - headerText: string; - /** - * The platform that is used to provide data for the custom dimension. - * Acceptable values are "floodlight". - */ - platformSource: string; - /** - * Returns metrics only for a specific type of product activity. Accepted - * values are: - "sold": returns metrics only for products that - * were sold - "advertised": returns metrics only for products that - * were advertised in a Shopping campaign, and that might or might not have - * been sold - */ - productReportPerspective: string; - /** - * Name of a saved column to include in the report. The report must be scoped - * at advertiser or lower, and this saved column must already be created in - * the DoubleClick Search UI. - */ - savedColumnName: string; - /** - * Inclusive date in YYYY-MM-DD format. When provided, this overrides the - * overall time range of the report for this column only. Must be provided - * together with endDate. - */ - startDate: string; -} -/** - * A request object used to create a DoubleClick Search report. - */ -export interface Schema$ReportRequest { - /** - * The columns to include in the report. This includes both DoubleClick Search - * columns and saved columns. For DoubleClick Search columns, only the - * columnName parameter is required. For saved columns only the - * savedColumnName parameter is required. Both columnName and savedColumnName - * cannot be set in the same stanza. The maximum number of columns per request - * is 300. - */ - columns: Schema$ReportApiColumnSpec[]; - /** - * Format that the report should be returned in. Currently csv or tsv is - * supported. - */ - downloadFormat: string; - /** - * A list of filters to be applied to the report. The maximum number of - * filters per request is 300. - */ - filters: any[]; - /** - * Determines if removed entities should be included in the report. Defaults - * to false. Deprecated, please use includeRemovedEntities instead. - */ - includeDeletedEntities: boolean; - /** - * Determines if removed entities should be included in the report. Defaults - * to false. - */ - includeRemovedEntities: boolean; - /** - * Asynchronous report only. The maximum number of rows per report file. A - * large report is split into many files based on this field. Acceptable - * values are 1000000 to 100000000, inclusive. - */ - maxRowsPerFile: number; - /** - * Synchronous report only. A list of columns and directions defining sorting - * to be performed on the report rows. The maximum number of orderings per - * request is 300. - */ - orderBy: any[]; - /** - * The reportScope is a set of IDs that are used to determine which subset of - * entities will be returned in the report. The full lineage of IDs from the - * lowest scoped level desired up through agency is required. - */ - reportScope: any; - /** - * Determines the type of rows that are returned in the report. For example, - * if you specify reportType: keyword, each row in the report will contain - * data about a keyword. See the Types of Reports reference for the columns - * that are available for each type. - */ - reportType: string; - /** - * Synchronous report only. The maxinum number of rows to return; additional - * rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults to - * 10000. - */ - rowCount: number; + * A message containing availability data relevant to DoubleClick Search. + */ + export interface Schema$Availability { + /** + * DS advertiser ID. + */ + advertiserId: string; + /** + * DS agency ID. + */ + agencyId: string; + /** + * The time by which all conversions have been uploaded, in epoch millis + * UTC. + */ + availabilityTimestamp: string; + /** + * The numeric segmentation identifier (for example, DoubleClick Search + * Floodlight activity ID). + */ + segmentationId: string; + /** + * The friendly segmentation identifier (for example, DoubleClick Search + * Floodlight activity name). + */ + segmentationName: string; + /** + * The segmentation type that this availability is for (its default value is + * FLOODLIGHT). + */ + segmentationType: string; + } /** - * Synchronous report only. Zero-based index of the first row to return. - * Acceptable values are 0 to 50000, inclusive. Defaults to 0. - */ - startRow: number; + * A conversion containing data relevant to DoubleClick Search. + */ + export interface Schema$Conversion { + /** + * DS ad group ID. + */ + adGroupId: string; + /** + * DS ad ID. + */ + adId: string; + /** + * DS advertiser ID. + */ + advertiserId: string; + /** + * DS agency ID. + */ + agencyId: string; + /** + * Available to advertisers only after contacting DoubleClick Search + * customer support. + */ + attributionModel: string; + /** + * DS campaign ID. + */ + campaignId: string; + /** + * Sales channel for the product. Acceptable values are: - + * "local": a physical store - "online": an online + * store + */ + channel: string; + /** + * DS click ID for the conversion. + */ + clickId: string; + /** + * For offline conversions, advertisers provide this ID. Advertisers can + * specify any ID that is meaningful to them. Each conversion in a request + * must specify a unique ID, and the combination of ID and timestamp must be + * unique amongst all conversions within the advertiser. For online + * conversions, DS copies the dsConversionId or floodlightOrderId into this + * property depending on the advertiser's Floodlight instructions. + */ + conversionId: string; + /** + * The time at which the conversion was last modified, in epoch millis UTC. + */ + conversionModifiedTimestamp: string; + /** + * The time at which the conversion took place, in epoch millis UTC. + */ + conversionTimestamp: string; + /** + * Available to advertisers only after contacting DoubleClick Search + * customer support. + */ + countMillis: string; + /** + * DS criterion (keyword) ID. + */ + criterionId: string; + /** + * The currency code for the conversion's revenue. Should be in ISO 4217 + * alphabetic (3-char) format. + */ + currencyCode: string; + /** + * Custom dimensions for the conversion, which can be used to filter data in + * a report. + */ + customDimension: Schema$CustomDimension[]; + /** + * Custom metrics for the conversion. + */ + customMetric: Schema$CustomMetric[]; + /** + * The type of device on which the conversion occurred. + */ + deviceType: string; + /** + * ID that DoubleClick Search generates for each conversion. + */ + dsConversionId: string; + /** + * DS engine account ID. + */ + engineAccountId: string; + /** + * The Floodlight order ID provided by the advertiser for the conversion. + */ + floodlightOrderId: string; + /** + * ID that DS generates and uses to uniquely identify the inventory account + * that contains the product. + */ + inventoryAccountId: string; + /** + * The country registered for the Merchant Center feed that contains the + * product. Use an ISO 3166 code to specify a country. + */ + productCountry: string; + /** + * DS product group ID. + */ + productGroupId: string; + /** + * The product ID (SKU). + */ + productId: string; + /** + * The language registered for the Merchant Center feed that contains the + * product. Use an ISO 639 code to specify a language. + */ + productLanguage: string; + /** + * The quantity of this conversion, in millis. + */ + quantityMillis: string; + /** + * The revenue amount of this TRANSACTION conversion, in micros (value + * multiplied by 1000000, no decimal). For example, to specify a revenue + * value of "10" enter "10000000" (10 million) in your + * request. + */ + revenueMicros: string; + /** + * The numeric segmentation identifier (for example, DoubleClick Search + * Floodlight activity ID). + */ + segmentationId: string; + /** + * The friendly segmentation identifier (for example, DoubleClick Search + * Floodlight activity name). + */ + segmentationName: string; + /** + * The segmentation type of this conversion (for example, FLOODLIGHT). + */ + segmentationType: string; + /** + * The state of the conversion, that is, either ACTIVE or REMOVED. Note: + * state DELETED is deprecated. + */ + state: string; + /** + * The ID of the local store for which the product was advertised. + * Applicable only when the channel is "local". + */ + storeId: string; + /** + * The type of the conversion, that is, either ACTION or TRANSACTION. An + * ACTION conversion is an action by the user that has no monetarily + * quantifiable value, while a TRANSACTION conversion is an action that does + * have a monetarily quantifiable value. Examples are email list signups + * (ACTION) versus ecommerce purchases (TRANSACTION). + */ + type: string; + } /** - * Specifies the currency in which monetary will be returned. Possible values - * are: usd, agency (valid if the report is scoped to agency or lower), - * advertiser (valid if the report is scoped to * advertiser or lower), or - * account (valid if the report is scoped to engine account or lower). - */ - statisticsCurrency: string; + * A list of conversions. + */ + export interface Schema$ConversionList { + /** + * The conversions being requested. + */ + conversion: Schema$Conversion[]; + /** + * Identifies this as a ConversionList resource. Value: the fixed string + * doubleclicksearch#conversionList. + */ + kind: string; + } /** - * If metrics are requested in a report, this argument will be used to - * restrict the metrics to a specific time range. - */ - timeRange: any; + * A message containing the custome dimension. + */ + export interface Schema$CustomDimension { + /** + * Custom dimension name. + */ + name: string; + /** + * Custom dimension value. + */ + value: string; + } /** - * If true, the report would only be created if all the requested stat data - * are sourced from a single timezone. Defaults to false. - */ - verifySingleTimeZone: boolean; -} -/** - * A row in a DoubleClick Search report. - */ -export interface Schema$ReportRow {} -/** - * A saved column - */ -export interface Schema$SavedColumn { + * A message containing the custome metric. + */ + export interface Schema$CustomMetric { + /** + * Custom metric name. + */ + name: string; + /** + * Custom metric numeric value. + */ + value: number; + } /** - * Identifies this as a SavedColumn resource. Value: the fixed string - * doubleclicksearch#savedColumn. - */ - kind: string; + * A DoubleClick Search report. This object contains the report request, some + * report metadata such as currency code, and the generated report rows or + * report files. + */ + export interface Schema$Report { + /** + * Asynchronous report only. Contains a list of generated report files once + * the report has succesfully completed. + */ + files: any[]; + /** + * Asynchronous report only. Id of the report. + */ + id: string; + /** + * Asynchronous report only. True if and only if the report has completed + * successfully and the report files are ready to be downloaded. + */ + isReportReady: boolean; + /** + * Identifies this as a Report resource. Value: the fixed string + * doubleclicksearch#report. + */ + kind: string; + /** + * The request that created the report. Optional fields not specified in the + * original request are filled with default values. + */ + request: Schema$ReportRequest; + /** + * The number of report rows generated by the report, not including headers. + */ + rowCount: number; + /** + * Synchronous report only. Generated report rows. + */ + rows: Schema$ReportRow[]; + /** + * The currency code of all monetary values produced in the report, + * including values that are set by users (e.g., keyword bid settings) and + * metrics (e.g., cost and revenue). The currency code of a report is + * determined by the statisticsCurrency field of the report request. + */ + statisticsCurrencyCode: string; + /** + * If all statistics of the report are sourced from the same time zone, this + * would be it. Otherwise the field is unset. + */ + statisticsTimeZone: string; + } /** - * The name of the saved column. - */ - savedColumnName: string; + * A request object used to create a DoubleClick Search report. + */ + export interface Schema$ReportApiColumnSpec { + /** + * Name of a DoubleClick Search column to include in the report. + */ + columnName: string; + /** + * Segments a report by a custom dimension. The report must be scoped to an + * advertiser or lower, and the custom dimension must already be set up in + * DoubleClick Search. The custom dimension name, which appears in + * DoubleClick Search, is case sensitive. If used in a conversion report, + * returns the value of the specified custom dimension for the given + * conversion, if set. This column does not segment the conversion report. + */ + customDimensionName: string; + /** + * Name of a custom metric to include in the report. The report must be + * scoped to an advertiser or lower, and the custom metric must already be + * set up in DoubleClick Search. The custom metric name, which appears in + * DoubleClick Search, is case sensitive. + */ + customMetricName: string; + /** + * Inclusive day in YYYY-MM-DD format. When provided, this overrides the + * overall time range of the report for this column only. Must be provided + * together with startDate. + */ + endDate: string; + /** + * Synchronous report only. Set to true to group by this column. Defaults to + * false. + */ + groupByColumn: boolean; + /** + * Text used to identify this column in the report output; defaults to + * columnName or savedColumnName when not specified. This can be used to + * prevent collisions between DoubleClick Search columns and saved columns + * with the same name. + */ + headerText: string; + /** + * The platform that is used to provide data for the custom dimension. + * Acceptable values are "floodlight". + */ + platformSource: string; + /** + * Returns metrics only for a specific type of product activity. Accepted + * values are: - "sold": returns metrics only for products that + * were sold - "advertised": returns metrics only for products + * that were advertised in a Shopping campaign, and that might or might not + * have been sold + */ + productReportPerspective: string; + /** + * Name of a saved column to include in the report. The report must be + * scoped at advertiser or lower, and this saved column must already be + * created in the DoubleClick Search UI. + */ + savedColumnName: string; + /** + * Inclusive date in YYYY-MM-DD format. When provided, this overrides the + * overall time range of the report for this column only. Must be provided + * together with endDate. + */ + startDate: string; + } /** - * The type of data this saved column will produce. - */ - type: string; -} -/** - * A list of saved columns. Advertisers create saved columns to report on - * Floodlight activities, Google Analytics goals, or custom KPIs. To request - * reports with saved columns, you'll need the saved column names that are - * available from this list. - */ -export interface Schema$SavedColumnList { + * A request object used to create a DoubleClick Search report. + */ + export interface Schema$ReportRequest { + /** + * The columns to include in the report. This includes both DoubleClick + * Search columns and saved columns. For DoubleClick Search columns, only + * the columnName parameter is required. For saved columns only the + * savedColumnName parameter is required. Both columnName and + * savedColumnName cannot be set in the same stanza. The maximum number of + * columns per request is 300. + */ + columns: Schema$ReportApiColumnSpec[]; + /** + * Format that the report should be returned in. Currently csv or tsv is + * supported. + */ + downloadFormat: string; + /** + * A list of filters to be applied to the report. The maximum number of + * filters per request is 300. + */ + filters: any[]; + /** + * Determines if removed entities should be included in the report. Defaults + * to false. Deprecated, please use includeRemovedEntities instead. + */ + includeDeletedEntities: boolean; + /** + * Determines if removed entities should be included in the report. Defaults + * to false. + */ + includeRemovedEntities: boolean; + /** + * Asynchronous report only. The maximum number of rows per report file. A + * large report is split into many files based on this field. Acceptable + * values are 1000000 to 100000000, inclusive. + */ + maxRowsPerFile: number; + /** + * Synchronous report only. A list of columns and directions defining + * sorting to be performed on the report rows. The maximum number of + * orderings per request is 300. + */ + orderBy: any[]; + /** + * The reportScope is a set of IDs that are used to determine which subset + * of entities will be returned in the report. The full lineage of IDs from + * the lowest scoped level desired up through agency is required. + */ + reportScope: any; + /** + * Determines the type of rows that are returned in the report. For example, + * if you specify reportType: keyword, each row in the report will contain + * data about a keyword. See the Types of Reports reference for the columns + * that are available for each type. + */ + reportType: string; + /** + * Synchronous report only. The maxinum number of rows to return; additional + * rows are dropped. Acceptable values are 0 to 10000, inclusive. Defaults + * to 10000. + */ + rowCount: number; + /** + * Synchronous report only. Zero-based index of the first row to return. + * Acceptable values are 0 to 50000, inclusive. Defaults to 0. + */ + startRow: number; + /** + * Specifies the currency in which monetary will be returned. Possible + * values are: usd, agency (valid if the report is scoped to agency or + * lower), advertiser (valid if the report is scoped to * advertiser or + * lower), or account (valid if the report is scoped to engine account or + * lower). + */ + statisticsCurrency: string; + /** + * If metrics are requested in a report, this argument will be used to + * restrict the metrics to a specific time range. + */ + timeRange: any; + /** + * If true, the report would only be created if all the requested stat data + * are sourced from a single timezone. Defaults to false. + */ + verifySingleTimeZone: boolean; + } /** - * The saved columns being requested. - */ - items: Schema$SavedColumn[]; + * A row in a DoubleClick Search report. + */ + export interface Schema$ReportRow {} + /** + * A saved column + */ + export interface Schema$SavedColumn { + /** + * Identifies this as a SavedColumn resource. Value: the fixed string + * doubleclicksearch#savedColumn. + */ + kind: string; + /** + * The name of the saved column. + */ + savedColumnName: string; + /** + * The type of data this saved column will produce. + */ + type: string; + } /** - * Identifies this as a SavedColumnList resource. Value: the fixed string - * doubleclicksearch#savedColumnList. - */ - kind: string; -} -/** - * The request to update availability. - */ -export interface Schema$UpdateAvailabilityRequest { + * A list of saved columns. Advertisers create saved columns to report on + * Floodlight activities, Google Analytics goals, or custom KPIs. To request + * reports with saved columns, you'll need the saved column names that are + * available from this list. + */ + export interface Schema$SavedColumnList { + /** + * The saved columns being requested. + */ + items: Schema$SavedColumn[]; + /** + * Identifies this as a SavedColumnList resource. Value: the fixed string + * doubleclicksearch#savedColumnList. + */ + kind: string; + } /** - * The availabilities being requested. + * The request to update availability. */ - availabilities: Schema$Availability[]; -} -/** - * The response to a update availability request. - */ -export interface Schema$UpdateAvailabilityResponse { + export interface Schema$UpdateAvailabilityRequest { + /** + * The availabilities being requested. + */ + availabilities: Schema$Availability[]; + } /** - * The availabilities being returned. + * The response to a update availability request. */ - availabilities: Schema$Availability[]; -} - -export class Resource$Conversion { - root: Doubleclicksearch; - constructor(root: Doubleclicksearch) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$UpdateAvailabilityResponse { + /** + * The availabilities being returned. + */ + availabilities: Schema$Availability[]; } - - /** - * doubleclicksearch.conversion.get - * @desc Retrieves a list of conversions from a DoubleClick Search engine - * account. - * @alias doubleclicksearch.conversion.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.adGroupId Numeric ID of the ad group. - * @param {string=} params.adId Numeric ID of the ad. - * @param {string} params.advertiserId Numeric ID of the advertiser. - * @param {string} params.agencyId Numeric ID of the agency. - * @param {string=} params.campaignId Numeric ID of the campaign. - * @param {string=} params.criterionId Numeric ID of the criterion. - * @param {integer} params.endDate Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - * @param {string} params.engineAccountId Numeric ID of the engine account. - * @param {integer} params.rowCount The number of conversions to return per call. - * @param {integer} params.startDate First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - * @param {integer} params.startRow The 0-based starting index for retrieving conversions results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Conversion { + root: Doubleclicksearch; + constructor(root: Doubleclicksearch) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [ - 'agencyId', 'advertiserId', 'engineAccountId', 'endDate', 'rowCount', - 'startDate', 'startRow' - ], - pathParams: ['advertiserId', 'agencyId', 'engineAccountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * doubleclicksearch.conversion.insert - * @desc Inserts a batch of new conversions into DoubleClick Search. - * @alias doubleclicksearch.conversion.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ConversionList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclicksearch.conversion.get + * @desc Retrieves a list of conversions from a DoubleClick Search engine + * account. + * @alias doubleclicksearch.conversion.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.adGroupId Numeric ID of the ad group. + * @param {string=} params.adId Numeric ID of the ad. + * @param {string} params.advertiserId Numeric ID of the advertiser. + * @param {string} params.agencyId Numeric ID of the agency. + * @param {string=} params.campaignId Numeric ID of the campaign. + * @param {string=} params.criterionId Numeric ID of the criterion. + * @param {integer} params.endDate Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * @param {string} params.engineAccountId Numeric ID of the engine account. + * @param {integer} params.rowCount The number of conversions to return per call. + * @param {integer} params.startDate First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * @param {integer} params.startRow The 0-based starting index for retrieving conversions results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [ + 'agencyId', 'advertiserId', 'engineAccountId', 'endDate', 'rowCount', + 'startDate', 'startRow' + ], + pathParams: ['advertiserId', 'agencyId', 'engineAccountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/conversion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * doubleclicksearch.conversion.patch - * @desc Updates a batch of conversions in DoubleClick Search. This method - * supports patch semantics. - * @alias doubleclicksearch.conversion.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.advertiserId Numeric ID of the advertiser. - * @param {string} params.agencyId Numeric ID of the agency. - * @param {integer} params.endDate Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - * @param {string} params.engineAccountId Numeric ID of the engine account. - * @param {integer} params.rowCount The number of conversions to return per call. - * @param {integer} params.startDate First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. - * @param {integer} params.startRow The 0-based starting index for retrieving conversions results. - * @param {().ConversionList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/conversion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: [ - 'advertiserId', 'agencyId', 'endDate', 'engineAccountId', 'rowCount', - 'startDate', 'startRow' - ], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * doubleclicksearch.conversion.insert + * @desc Inserts a batch of new conversions into DoubleClick Search. + * @alias doubleclicksearch.conversion.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ConversionList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/conversion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * doubleclicksearch.conversion.update - * @desc Updates a batch of conversions in DoubleClick Search. - * @alias doubleclicksearch.conversion.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ConversionList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/conversion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * doubleclicksearch.conversion.patch + * @desc Updates a batch of conversions in DoubleClick Search. This method + * supports patch semantics. + * @alias doubleclicksearch.conversion.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.advertiserId Numeric ID of the advertiser. + * @param {string} params.agencyId Numeric ID of the agency. + * @param {integer} params.endDate Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * @param {string} params.engineAccountId Numeric ID of the engine account. + * @param {integer} params.rowCount The number of conversions to return per call. + * @param {integer} params.startDate First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. + * @param {integer} params.startRow The 0-based starting index for retrieving conversions results. + * @param {().ConversionList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/conversion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: [ + 'advertiserId', 'agencyId', 'endDate', 'engineAccountId', 'rowCount', + 'startDate', 'startRow' + ], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * doubleclicksearch.conversion.updateAvailability - * @desc Updates the availabilities of a batch of floodlight activities in - * DoubleClick Search. - * @alias doubleclicksearch.conversion.updateAvailability - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().UpdateAvailabilityRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateAvailability(params?: any, options?: MethodOptions): - AxiosPromise; - updateAvailability( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateAvailability( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclicksearch.conversion.update + * @desc Updates a batch of conversions in DoubleClick Search. + * @alias doubleclicksearch.conversion.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ConversionList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/conversion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/doubleclicksearch/v2/conversion/updateAvailability') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Reports { - root: Doubleclicksearch; - constructor(root: Doubleclicksearch) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * doubleclicksearch.conversion.updateAvailability + * @desc Updates the availabilities of a batch of floodlight activities in + * DoubleClick Search. + * @alias doubleclicksearch.conversion.updateAvailability + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().UpdateAvailabilityRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateAvailability(params?: any, options?: MethodOptions): + AxiosPromise; + updateAvailability( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + updateAvailability( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/doubleclicksearch/v2/conversion/updateAvailability') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * doubleclicksearch.reports.generate - * @desc Generates and returns a report immediately. - * @alias doubleclicksearch.reports.generate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ReportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generate(params?: any, options?: MethodOptions): AxiosPromise; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Doubleclicksearch; + constructor(root: Doubleclicksearch) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/reports/generate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * doubleclicksearch.reports.get - * @desc Polls for the status of a report request. - * @alias doubleclicksearch.reports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.reportId ID of the report request being polled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclicksearch.reports.generate + * @desc Generates and returns a report immediately. + * @alias doubleclicksearch.reports.generate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ReportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generate(params?: any, options?: MethodOptions): + AxiosPromise; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/reports/generate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['reportId'], - pathParams: ['reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * doubleclicksearch.reports.getFile - * @desc Downloads a report file encoded in UTF-8. - * @alias doubleclicksearch.reports.getFile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.reportFragment The index of the report fragment to download. - * @param {string} params.reportId ID of the report. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getFile(params?: any, options?: MethodOptions): AxiosPromise; - getFile( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getFile( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * doubleclicksearch.reports.get + * @desc Polls for the status of a report request. + * @alias doubleclicksearch.reports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.reportId ID of the report request being polled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['reportId'], + pathParams: ['reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['reportId', 'reportFragment'], - pathParams: ['reportFragment', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * doubleclicksearch.reports.request - * @desc Inserts a report request into the reporting system. - * @alias doubleclicksearch.reports.request - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ReportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - request(params?: any, options?: MethodOptions): AxiosPromise; - request( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - request( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * doubleclicksearch.reports.getFile + * @desc Downloads a report file encoded in UTF-8. + * @alias doubleclicksearch.reports.getFile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.reportFragment The index of the report fragment to download. + * @param {string} params.reportId ID of the report. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getFile(params?: any, options?: MethodOptions): AxiosPromise; + getFile( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getFile( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['reportId', 'reportFragment'], + pathParams: ['reportFragment', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/doubleclicksearch/v2/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Savedcolumns { - root: Doubleclicksearch; - constructor(root: Doubleclicksearch) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * doubleclicksearch.reports.request + * @desc Inserts a report request into the reporting system. + * @alias doubleclicksearch.reports.request + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ReportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + request(params?: any, options?: MethodOptions): AxiosPromise; + request( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + request( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/doubleclicksearch/v2/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * doubleclicksearch.savedColumns.list - * @desc Retrieve the list of saved columns for a specified advertiser. - * @alias doubleclicksearch.savedColumns.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.advertiserId DS ID of the advertiser. - * @param {string} params.agencyId DS ID of the agency. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Savedcolumns { + root: Doubleclicksearch; + constructor(root: Doubleclicksearch) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['agencyId', 'advertiserId'], - pathParams: ['advertiserId', 'agencyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * doubleclicksearch.savedColumns.list + * @desc Retrieve the list of saved columns for a specified advertiser. + * @alias doubleclicksearch.savedColumns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.advertiserId DS ID of the advertiser. + * @param {string} params.agencyId DS ID of the agency. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['agencyId', 'advertiserId'], + pathParams: ['advertiserId', 'agencyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/drive/v2.ts b/src/apis/drive/v2.ts index fc2f9983b37..60d5416196a 100644 --- a/src/apis/drive/v2.ts +++ b/src/apis/drive/v2.ts @@ -27,5412 +27,5442 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Drive API - * - * Manages files in Drive including uploading, downloading, searching, detecting - * changes, and updating sharing permissions. - * - * @example - * const google = require('googleapis'); - * const drive = google.drive('v2'); - * - * @namespace drive - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Drive - */ -export class Drive { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - about: Resource$About; - apps: Resource$Apps; - changes: Resource$Changes; - channels: Resource$Channels; - children: Resource$Children; - comments: Resource$Comments; - files: Resource$Files; - parents: Resource$Parents; - permissions: Resource$Permissions; - properties: Resource$Properties; - realtime: Resource$Realtime; - replies: Resource$Replies; - revisions: Resource$Revisions; - teamdrives: Resource$Teamdrives; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.about = new Resource$About(this); - this.apps = new Resource$Apps(this); - this.changes = new Resource$Changes(this); - this.channels = new Resource$Channels(this); - this.children = new Resource$Children(this); - this.comments = new Resource$Comments(this); - this.files = new Resource$Files(this); - this.parents = new Resource$Parents(this); - this.permissions = new Resource$Permissions(this); - this.properties = new Resource$Properties(this); - this.realtime = new Resource$Realtime(this); - this.replies = new Resource$Replies(this); - this.revisions = new Resource$Revisions(this); - this.teamdrives = new Resource$Teamdrives(this); - } - - getRoot() { - return this.root; - } -} - -/** - * An item with user information and settings. - */ -export interface Schema$About { - /** - * Information about supported additional roles per file type. The most - * specific type takes precedence. - */ - additionalRoleInfo: any[]; - /** - * Whether the user can create Team Drives. - */ - canCreateTeamDrives: boolean; - /** - * The domain sharing policy for the current user. Possible values are: - - * allowed - allowedWithWarning - incomingOnly - disallowed - */ - domainSharingPolicy: string; - /** - * The ETag of the item. - */ - etag: string; - /** - * The allowable export formats. - */ - exportFormats: any[]; - /** - * List of additional features enabled on this account. - */ - features: any[]; - /** - * The palette of allowable folder colors as RGB hex strings. - */ - folderColorPalette: string[]; - /** - * The allowable import formats. - */ - importFormats: any[]; - /** - * A boolean indicating whether the authenticated app is installed by the - * authenticated user. - */ - isCurrentAppInstalled: boolean; - /** - * This is always drive#about. - */ - kind: string; - /** - * The user's language or locale code, as defined by BCP 47, with some - * extensions from Unicode's LDML format - * (http://www.unicode.org/reports/tr35/). - */ - languageCode: string; - /** - * The largest change id. - */ - largestChangeId: string; - /** - * List of max upload sizes for each file type. The most specific type takes - * precedence. - */ - maxUploadSizes: any[]; - /** - * The name of the current user. - */ - name: string; - /** - * The current user's ID as visible in the permissions collection. - */ - permissionId: string; - /** - * The amount of storage quota used by different Google services. - */ - quotaBytesByService: any[]; - /** - * The total number of quota bytes. - */ - quotaBytesTotal: string; - /** - * The number of quota bytes used by Google Drive. - */ - quotaBytesUsed: string; - /** - * The number of quota bytes used by all Google apps (Drive, Picasa, etc.). - */ - quotaBytesUsedAggregate: string; - /** - * The number of quota bytes used by trashed items. - */ - quotaBytesUsedInTrash: string; - /** - * The type of the user's storage quota. Possible values are: - LIMITED - * - UNLIMITED - */ - quotaType: string; - /** - * The number of remaining change ids, limited to no more than 2500. - */ - remainingChangeIds: string; - /** - * The id of the root folder. - */ - rootFolderId: string; - /** - * A link back to this item. - */ - selfLink: string; - /** - * A list of themes that are supported for Team Drives. - */ - teamDriveThemes: any[]; - /** - * The authenticated user. - */ - user: Schema$User; -} -/** - * The apps resource provides a list of the apps that a user has installed, with - * information about each app's supported MIME types, file extensions, and - * other details. - */ -export interface Schema$App { - /** - * Whether the app is authorized to access data on the user's Drive. - */ - authorized: boolean; - /** - * The template url to create a new file with this app in a given folder. The - * template will contain {folderId} to be replaced by the folder to create the - * new file in. - */ - createInFolderTemplate: string; - /** - * The url to create a new file with this app. - */ - createUrl: string; - /** - * Whether the app has drive-wide scope. An app with drive-wide scope can - * access all files in the user's drive. - */ - hasDriveWideScope: boolean; - /** - * The various icons for the app. - */ - icons: any[]; - /** - * The ID of the app. - */ - id: string; - /** - * Whether the app is installed. - */ - installed: boolean; - /** - * This is always drive#app. - */ - kind: string; - /** - * A long description of the app. - */ - longDescription: string; - /** - * The name of the app. - */ - name: string; - /** - * The type of object this app creates (e.g. Chart). If empty, the app name - * should be used instead. - */ - objectType: string; - /** - * The template url for opening files with this app. The template will contain - * {ids} and/or {exportIds} to be replaced by the actual file ids. See Open - * Files for the full documentation. - */ - openUrlTemplate: string; - /** - * The list of primary file extensions. - */ - primaryFileExtensions: string[]; - /** - * The list of primary mime types. - */ - primaryMimeTypes: string[]; - /** - * The ID of the product listing for this app. - */ - productId: string; - /** - * A link to the product listing for this app. - */ - productUrl: string; - /** - * The list of secondary file extensions. - */ - secondaryFileExtensions: string[]; - /** - * The list of secondary mime types. - */ - secondaryMimeTypes: string[]; - /** - * A short description of the app. - */ - shortDescription: string; - /** - * Whether this app supports creating new objects. - */ - supportsCreate: boolean; - /** - * Whether this app supports importing Google Docs. - */ - supportsImport: boolean; - /** - * Whether this app supports opening more than one file. - */ - supportsMultiOpen: boolean; - /** - * Whether this app supports creating new files when offline. - */ - supportsOfflineCreate: boolean; - /** - * Whether the app is selected as the default handler for the types it - * supports. - */ - useByDefault: boolean; -} -/** - * A list of third-party applications which the user has installed or given - * access to Google Drive. - */ -export interface Schema$AppList { - /** - * List of app IDs that the user has specified to use by default. The list is - * in reverse-priority order (lowest to highest). - */ - defaultAppIds: string[]; - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of apps. - */ - items: Schema$App[]; - /** - * This is always drive#appList. - */ - kind: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * Representation of a change to a file or Team Drive. - */ -export interface Schema$Change { - /** - * Whether the file or Team Drive has been removed from this list of changes, - * for example by deletion or loss of access. - */ - deleted: boolean; - /** - * The updated state of the file. Present if the type is file and the file has - * not been removed from this list of changes. - */ - file: Schema$File; - /** - * The ID of the file associated with this change. - */ - fileId: string; - /** - * The ID of the change. - */ - id: string; - /** - * This is always drive#change. - */ - kind: string; - /** - * The time of this modification. - */ - modificationDate: string; - /** - * A link back to this change. - */ - selfLink: string; - /** - * The updated state of the Team Drive. Present if the type is teamDrive, the - * user is still a member of the Team Drive, and the Team Drive has not been - * deleted. - */ - teamDrive: Schema$TeamDrive; - /** - * The ID of the Team Drive associated with this change. - */ - teamDriveId: string; - /** - * The type of the change. Possible values are file and teamDrive. - */ - type: string; -} -/** - * A list of changes for a user. - */ -export interface Schema$ChangeList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of changes. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$Change[]; - /** - * This is always drive#changeList. - */ - kind: string; - /** - * The current largest change ID. - */ - largestChangeId: string; - /** - * The starting page token for future changes. This will be present only if - * the end of the current changes list has been reached. - */ - newStartPageToken: string; - /** - * A link to the next page of changes. - */ - nextLink: string; - /** - * The page token for the next page of changes. This will be absent if the end - * of the changes list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * A list of children of a file. - */ -export interface Schema$ChildList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of children. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$ChildReference[]; - /** - * This is always drive#childList. - */ - kind: string; - /** - * A link to the next page of children. - */ - nextLink: string; - /** - * The page token for the next page of children. This will be absent if the - * end of the children list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * A reference to a folder's child. - */ -export interface Schema$ChildReference { - /** - * A link to the child. - */ - childLink: string; - /** - * The ID of the child. - */ - id: string; - /** - * This is always drive#childReference. - */ - kind: string; - /** - * A link back to this reference. - */ - selfLink: string; -} -/** - * A comment on a file in Google Drive. - */ -export interface Schema$Comment { - /** - * A region of the document represented as a JSON string. See anchor - * documentation for details on how to define and interpret anchor properties. - */ - anchor: string; - /** - * The user who wrote this comment. - */ - author: Schema$User; - /** - * The ID of the comment. - */ - commentId: string; - /** - * The plain text content used to create this comment. This is not HTML safe - * and should only be used as a starting point to make edits to a - * comment's content. - */ - content: string; - /** - * The context of the file which is being commented on. - */ - context: any; - /** - * The date when this comment was first created. - */ - createdDate: string; - /** - * Whether this comment has been deleted. If a comment has been deleted the - * content will be cleared and this will only represent a comment that once - * existed. - */ - deleted: boolean; - /** - * The file which this comment is addressing. - */ - fileId: string; - /** - * The title of the file which this comment is addressing. - */ - fileTitle: string; - /** - * HTML formatted content for this comment. - */ - htmlContent: string; - /** - * This is always drive#comment. - */ - kind: string; - /** - * The date when this comment or any of its replies were last modified. - */ - modifiedDate: string; - /** - * Replies to this post. - */ - replies: Schema$CommentReply[]; - /** - * A link back to this comment. - */ - selfLink: string; - /** - * The status of this comment. Status can be changed by posting a reply to a - * comment with the desired status. - "open" - The comment is - * still open. - "resolved" - The comment has been resolved by one - * of its replies. - */ - status: string; -} -/** - * A list of comments on a file in Google Drive. - */ -export interface Schema$CommentList { - /** - * The list of comments. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$Comment[]; - /** - * This is always drive#commentList. - */ - kind: string; - /** - * A link to the next page of comments. - */ - nextLink: string; - /** - * The page token for the next page of comments. This will be absent if the - * end of the comments list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * A comment on a file in Google Drive. - */ -export interface Schema$CommentReply { - /** - * The user who wrote this reply. - */ - author: Schema$User; - /** - * The plain text content used to create this reply. This is not HTML safe and - * should only be used as a starting point to make edits to a reply's - * content. This field is required on inserts if no verb is specified - * (resolve/reopen). - */ - content: string; - /** - * The date when this reply was first created. - */ - createdDate: string; - /** - * Whether this reply has been deleted. If a reply has been deleted the - * content will be cleared and this will only represent a reply that once - * existed. - */ - deleted: boolean; - /** - * HTML formatted content for this reply. - */ - htmlContent: string; - /** - * This is always drive#commentReply. - */ - kind: string; - /** - * The date when this reply was last modified. - */ - modifiedDate: string; - /** - * The ID of the reply. - */ - replyId: string; - /** - * The action this reply performed to the parent comment. When creating a new - * reply this is the action to be perform to the parent comment. Possible - * values are: - "resolve" - To resolve a comment. - - * "reopen" - To reopen (un-resolve) a comment. - */ - verb: string; -} -/** - * A list of replies to a comment on a file in Google Drive. - */ -export interface Schema$CommentReplyList { - /** - * The list of replies. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$CommentReply[]; - /** - * This is always drive#commentReplyList. - */ - kind: string; - /** - * A link to the next page of replies. - */ - nextLink: string; - /** - * The page token for the next page of replies. This will be absent if the end - * of the replies list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * The metadata for a file. - */ -export interface Schema$File { - /** - * A link for opening the file in a relevant Google editor or viewer. - */ - alternateLink: string; - /** - * Whether this file is in the Application Data folder. - */ - appDataContents: boolean; - /** - * Deprecated: use capabilities/canComment. - */ - canComment: boolean; - /** - * Deprecated: use capabilities/canReadRevisions. - */ - canReadRevisions: boolean; - /** - * Capabilities the current user has on this file. Each capability corresponds - * to a fine-grained action that a user may take. - */ - capabilities: any; - /** - * Deprecated: use capabilities/canCopy. - */ - copyable: boolean; - /** - * Create time for this file (formatted RFC 3339 timestamp). - */ - createdDate: string; - /** - * A link to open this file with the user's default app for this file. - * Only populated when the drive.apps.readonly scope is used. - */ - defaultOpenWithLink: string; - /** - * A short description of the file. - */ - description: string; - downloadUrl: string; - /** - * Deprecated: use capabilities/canEdit. - */ - editable: boolean; - /** - * A link for embedding the file. - */ - embedLink: string; - /** - * ETag of the file. - */ - etag: string; - /** - * Whether this file has been explicitly trashed, as opposed to recursively - * trashed. - */ - explicitlyTrashed: boolean; - /** - * Links for exporting Google Docs to specific formats. - */ - exportLinks: any; - /** - * The final component of fullFileExtension with trailing text that does not - * appear to be part of the extension removed. This field is only populated - * for files with content stored in Drive; it is not populated for Google Docs - * or shortcut files. - */ - fileExtension: string; - /** - * The size of the file in bytes. This field is only populated for files with - * content stored in Drive; it is not populated for Google Docs or shortcut - * files. - */ - fileSize: string; - /** - * Folder color as an RGB hex string if the file is a folder. The list of - * supported colors is available in the folderColorPalette field of the About - * resource. If an unsupported color is specified, it will be changed to the - * closest color in the palette. Not populated for Team Drive files. - */ - folderColorRgb: string; - /** - * The full file extension; extracted from the title. May contain multiple - * concatenated extensions, such as "tar.gz". Removing an extension - * from the title does not clear this field; however, changing the extension - * on the title does update this field. This field is only populated for files - * with content stored in Drive; it is not populated for Google Docs or - * shortcut files. - */ - fullFileExtension: string; - /** - * Whether any users are granted file access directly on this file. This field - * is only populated for Team Drive files. - */ - hasAugmentedPermissions: boolean; - /** - * Whether this file has a thumbnail. This does not indicate whether the - * requesting app has access to the thumbnail. To check access, look for the - * presence of the thumbnailLink field. - */ - hasThumbnail: boolean; - /** - * The ID of the file's head revision. This field is only populated for - * files with content stored in Drive; it is not populated for Google Docs or - * shortcut files. - */ - headRevisionId: string; - /** - * A link to the file's icon. - */ - iconLink: string; - /** - * The ID of the file. - */ - id: string; - /** - * Metadata about image media. This will only be present for image types, and - * its contents will depend on what can be parsed from the image content. - */ - imageMediaMetadata: any; - /** - * Indexable text attributes for the file (can only be written) - */ - indexableText: any; - /** - * Whether the file was created or opened by the requesting app. - */ - isAppAuthorized: boolean; - /** - * The type of file. This is always drive#file. - */ - kind: string; - /** - * A group of labels for the file. - */ - labels: any; - /** - * The last user to modify this file. - */ - lastModifyingUser: Schema$User; - /** - * Name of the last user to modify this file. - */ - lastModifyingUserName: string; - /** - * Last time this file was viewed by the user (formatted RFC 3339 timestamp). - */ - lastViewedByMeDate: string; - /** - * Deprecated. - */ - markedViewedByMeDate: string; - /** - * An MD5 checksum for the content of this file. This field is only populated - * for files with content stored in Drive; it is not populated for Google Docs - * or shortcut files. - */ - md5Checksum: string; - /** - * The MIME type of the file. This is only mutable on update when uploading - * new content. This field can be left blank, and the mimetype will be - * determined from the uploaded content's MIME type. - */ - mimeType: string; - /** - * Last time this file was modified by the user (formatted RFC 3339 - * timestamp). Note that setting modifiedDate will also update the - * modifiedByMe date for the user which set the date. - */ - modifiedByMeDate: string; - /** - * Last time this file was modified by anyone (formatted RFC 3339 timestamp). - * This is only mutable on update when the setModifiedDate parameter is set. - */ - modifiedDate: string; - /** - * A map of the id of each of the user's apps to a link to open this file - * with that app. Only populated when the drive.apps.readonly scope is used. - */ - openWithLinks: any; - /** - * The original filename of the uploaded content if available, or else the - * original value of the title field. This is only available for files with - * binary content in Drive. - */ - originalFilename: string; - /** - * Whether the file is owned by the current user. Not populated for Team Drive - * files. - */ - ownedByMe: boolean; - /** - * Name(s) of the owner(s) of this file. Not populated for Team Drive files. - */ - ownerNames: string[]; - /** - * The owner(s) of this file. Not populated for Team Drive files. - */ - owners: Schema$User[]; - /** - * Collection of parent folders which contain this file. If not specified as - * part of an insert request, the file will be placed directly in the - * user's My Drive folder. If not specified as part of a copy request, the - * file will inherit any discoverable parents of the source file. Update - * requests can also use the addParents and removeParents parameters to modify - * the parents list. - */ - parents: Schema$ParentReference[]; - /** - * List of permission IDs for users with access to this file. - */ - permissionIds: string[]; - /** - * The list of permissions for users with access to this file. Not populated - * for Team Drive files. - */ - permissions: Schema$Permission[]; - /** - * The list of properties. - */ - properties: Schema$Property[]; - /** - * The number of quota bytes used by this file. - */ - quotaBytesUsed: string; - /** - * A link back to this file. - */ - selfLink: string; - /** - * Deprecated: use capabilities/canShare. - */ - shareable: boolean; - /** - * Whether the file has been shared. Not populated for Team Drive files. - */ - shared: boolean; - /** - * Time at which this file was shared with the user (formatted RFC 3339 - * timestamp). - */ - sharedWithMeDate: string; - /** - * User that shared the item with the current user, if available. - */ - sharingUser: Schema$User; - /** - * The list of spaces which contain the file. Supported values are - * 'drive', 'appDataFolder' and 'photos'. - */ - spaces: string[]; - /** - * ID of the Team Drive the file resides in. - */ - teamDriveId: string; - /** - * A thumbnail for the file. This will only be used if Drive cannot generate a - * standard thumbnail. - */ - thumbnail: any; - /** - * A short-lived link to the file's thumbnail. Typically lasts on the - * order of hours. Only populated when the requesting app can access the - * file's content. - */ - thumbnailLink: string; - /** - * The thumbnail version for use in thumbnail cache invalidation. - */ - thumbnailVersion: string; - /** - * The title of this file. Note that for immutable items such as the top level - * folders of Team Drives, My Drive root folder, and Application Data folder - * the title is constant. - */ - title: string; - /** - * The time that the item was trashed (formatted RFC 3339 timestamp). Only - * populated for Team Drive files. - */ - trashedDate: string; - /** - * If the file has been explicitly trashed, the user who trashed it. Only - * populated for Team Drive files. - */ - trashingUser: Schema$User; - /** - * The permissions for the authenticated user on this file. - */ - userPermission: Schema$Permission; - /** - * A monotonically increasing version number for the file. This reflects every - * change made to the file on the server, even those not visible to the - * requesting user. - */ - version: string; - /** - * Metadata about video media. This will only be present for video types. - */ - videoMediaMetadata: any; - /** - * A link for downloading the content of the file in a browser using cookie - * based authentication. In cases where the content is shared publicly, the - * content can be downloaded without any credentials. - */ - webContentLink: string; - /** - * A link only available on public folders for viewing their static web assets - * (HTML, CSS, JS, etc) via Google Drive's Website Hosting. - */ - webViewLink: string; - /** - * Whether writers can share the document with other users. Not populated for - * Team Drive files. - */ - writersCanShare: boolean; -} -/** - * A list of files. - */ -export interface Schema$FileList { - /** - * The ETag of the list. - */ - etag: string; - /** - * Whether the search process was incomplete. If true, then some search - * results may be missing, since all documents were not searched. This may - * occur when searching multiple Team Drives with the - * "default,allTeamDrives" corpora, but all corpora could not be - * searched. When this happens, it is suggested that clients narrow their - * query by choosing a different corpus such as "default" or - * "teamDrive". - */ - incompleteSearch: boolean; - /** - * The list of files. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$File[]; - /** - * This is always drive#fileList. - */ - kind: string; - /** - * A link to the next page of files. - */ - nextLink: string; - /** - * The page token for the next page of files. This will be absent if the end - * of the files list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * A list of generated IDs which can be provided in insert requests - */ -export interface Schema$GeneratedIds { - /** - * The IDs generated for the requesting user in the specified space. - */ - ids: string[]; - /** - * This is always drive#generatedIds - */ - kind: string; - /** - * The type of file that can be created with these IDs. - */ - space: string; -} -/** - * A list of a file's parents. - */ -export interface Schema$ParentList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of parents. - */ - items: Schema$ParentReference[]; - /** - * This is always drive#parentList. - */ - kind: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * A reference to a file's parent. - */ -export interface Schema$ParentReference { - /** - * The ID of the parent. - */ - id: string; - /** - * Whether or not the parent is the root folder. - */ - isRoot: boolean; - /** - * This is always drive#parentReference. - */ - kind: string; - /** - * A link to the parent. - */ - parentLink: string; - /** - * A link back to this reference. - */ - selfLink: string; -} -/** - * A permission for a file. - */ -export interface Schema$Permission { - /** - * Additional roles for this user. Only commenter is currently allowed, though - * more may be supported in the future. - */ - additionalRoles: string[]; - /** - * Deprecated. - */ - authKey: string; - /** - * Whether the account associated with this permission has been deleted. This - * field only pertains to user and group permissions. - */ - deleted: boolean; - /** - * The domain name of the entity this permission refers to. This is an - * output-only field which is present when the permission type is user, group - * or domain. - */ - domain: string; - /** - * The email address of the user or group this permission refers to. This is - * an output-only field which is present when the permission type is user or - * group. - */ - emailAddress: string; - /** - * The ETag of the permission. - */ - etag: string; - /** - * The time at which this permission will expire (RFC 3339 date-time). - * Expiration dates have the following restrictions: - They can only be set - * on user and group permissions - The date must be in the future - The date - * cannot be more than a year in the future - The date can only be set on - * drive.permissions.update or drive.permissions.patch requests - */ - expirationDate: string; - /** - * The ID of the user this permission refers to, and identical to the - * permissionId in the About and Files resources. When making a - * drive.permissions.insert request, exactly one of the id or value fields - * must be specified unless the permission type is anyone, in which case both - * id and value are ignored. - */ - id: string; - /** - * This is always drive#permission. - */ - kind: string; - /** - * The name for this permission. - */ - name: string; - /** - * A link to the profile photo, if available. - */ - photoLink: string; - /** - * The primary role for this user. While new values may be supported in the - * future, the following are currently allowed: - organizer - owner - - * reader - writer - */ - role: string; - /** - * A link back to this permission. - */ - selfLink: string; - /** - * Details of whether the permissions on this Team Drive item are inherited or - * directly on this item. This is an output-only field which is present only - * for Team Drive items. - */ - teamDrivePermissionDetails: any[]; - /** - * The account type. Allowed values are: - user - group - domain - anyone - */ - type: string; - /** - * The email address or domain name for the entity. This is used during - * inserts and is not populated in responses. When making a - * drive.permissions.insert request, exactly one of the id or value fields - * must be specified unless the permission type is anyone, in which case both - * id and value are ignored. - */ - value: string; - /** - * Whether the link is required for this permission. - */ - withLink: boolean; -} -/** - * An ID for a user or group as seen in Permission items. - */ -export interface Schema$PermissionId { - /** - * The permission ID. - */ - id: string; - /** - * This is always drive#permissionId. - */ - kind: string; -} -/** - * A list of permissions associated with a file. - */ -export interface Schema$PermissionList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of permissions. - */ - items: Schema$Permission[]; - /** - * This is always drive#permissionList. - */ - kind: string; - /** - * The page token for the next page of permissions. This field will be absent - * if the end of the permissions list has been reached. If the token is - * rejected for any reason, it should be discarded, and pagination should be - * restarted from the first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -/** - * A key-value pair attached to a file that is either public or private to an - * application. The following limits apply to file properties: - Maximum of - * 100 properties total per file - Maximum of 30 private properties per app - - * Maximum of 30 public properties - Maximum of 124 bytes size limit on (key + - * value) string in UTF-8 encoding for a single property. - */ -export interface Schema$Property { - /** - * ETag of the property. - */ - etag: string; - /** - * The key of this property. - */ - key: string; - /** - * This is always drive#property. - */ - kind: string; - /** - * The link back to this property. - */ - selfLink: string; - /** - * The value of this property. - */ - value: string; - /** - * The visibility of this property. Allowed values are PRIVATE and PUBLIC. - * (Default: PRIVATE) - */ - visibility: string; -} -/** - * A collection of properties, key-value pairs that are either public or private - * to an application. - */ -export interface Schema$PropertyList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of properties. - */ - items: Schema$Property[]; - /** - * This is always drive#propertyList. - */ - kind: string; - /** - * The link back to this list. - */ - selfLink: string; -} -/** - * A revision of a file. - */ -export interface Schema$Revision { - /** - * Short term download URL for the file. This will only be populated on files - * with content stored in Drive. - */ - downloadUrl: string; - /** - * The ETag of the revision. - */ - etag: string; - /** - * Links for exporting Google Docs to specific formats. - */ - exportLinks: any; - /** - * The size of the revision in bytes. This will only be populated on files - * with content stored in Drive. - */ - fileSize: string; - /** - * The ID of the revision. - */ - id: string; - /** - * This is always drive#revision. - */ - kind: string; - /** - * The last user to modify this revision. - */ - lastModifyingUser: Schema$User; - /** - * Name of the last user to modify this revision. - */ - lastModifyingUserName: string; - /** - * An MD5 checksum for the content of this revision. This will only be - * populated on files with content stored in Drive. - */ - md5Checksum: string; - /** - * The MIME type of the revision. - */ - mimeType: string; - /** - * Last time this revision was modified (formatted RFC 3339 timestamp). - */ - modifiedDate: string; - /** - * The original filename when this revision was created. This will only be - * populated on files with content stored in Drive. - */ - originalFilename: string; - /** - * Whether this revision is pinned to prevent automatic purging. This will - * only be populated and can only be modified on files with content stored in - * Drive which are not Google Docs. Revisions can also be pinned when they are - * created through the drive.files.insert/update/copy by using the pinned - * query parameter. - */ - pinned: boolean; - /** - * Whether subsequent revisions will be automatically republished. This is - * only populated and can only be modified for Google Docs. - */ - publishAuto: boolean; - /** - * Whether this revision is published. This is only populated and can only be - * modified for Google Docs. - */ - published: boolean; - /** - * A link to the published revision. - */ - publishedLink: string; - /** - * Whether this revision is published outside the domain. This is only - * populated and can only be modified for Google Docs. - */ - publishedOutsideDomain: boolean; - /** - * A link back to this revision. - */ - selfLink: string; -} -/** - * A list of revisions of a file. - */ -export interface Schema$RevisionList { - /** - * The ETag of the list. - */ - etag: string; - /** - * The list of revisions. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - items: Schema$Revision[]; - /** - * This is always drive#revisionList. - */ - kind: string; - /** - * The page token for the next page of revisions. This field will be absent if - * the end of the revisions list has been reached. If the token is rejected - * for any reason, it should be discarded and pagination should be restarted - * from the first page of results. - */ - nextPageToken: string; - /** - * A link back to this list. - */ - selfLink: string; -} -export interface Schema$StartPageToken { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#startPageToken". - */ - kind: string; - /** - * The starting page token for listing changes. - */ - startPageToken: string; -} -/** - * Representation of a Team Drive. - */ -export interface Schema$TeamDrive { - /** - * An image file and cropping parameters from which a background image for - * this Team Drive is set. This is a write only field; it can only be set on - * drive.teamdrives.update requests that don't set themeId. When - * specified, all fields of the backgroundImageFile must be set. - */ - backgroundImageFile: any; - /** - * A short-lived link to this Team Drive's background image. - */ - backgroundImageLink: string; - /** - * Capabilities the current user has on this Team Drive. - */ - capabilities: any; - /** - * The color of this Team Drive as an RGB hex string. It can only be set on a - * drive.teamdrives.update request that does not set themeId. - */ - colorRgb: string; - /** - * The time at which the Team Drive was created (RFC 3339 date-time). - */ - createdDate: string; - /** - * The ID of this Team Drive which is also the ID of the top level folder for - * this Team Drive. - */ - id: string; - /** - * This is always drive#teamDrive - */ - kind: string; - /** - * The name of this Team Drive. - */ - name: string; - /** - * The ID of the theme from which the background image and color will be set. - * The set of possible teamDriveThemes can be retrieved from a drive.about.get - * response. When not specified on a drive.teamdrives.insert request, a random - * theme is chosen from which the background image and color are set. This is - * a write-only field; it can only be set on requests that don't set - * colorRgb or backgroundImageFile. - */ - themeId: string; -} -/** - * A list of Team Drives. - */ -export interface Schema$TeamDriveList { - /** - * The list of Team Drives. - */ - items: Schema$TeamDrive[]; - /** - * This is always drive#teamDriveList - */ - kind: string; - /** - * The page token for the next page of Team Drives. - */ - nextPageToken: string; -} -/** - * Information about a Drive user. - */ -export interface Schema$User { - /** - * A plain text displayable name for this user. - */ - displayName: string; - /** - * The email address of the user. - */ - emailAddress: string; - /** - * Whether this user is the same as the authenticated user for whom the - * request was made. - */ - isAuthenticatedUser: boolean; - /** - * This is always drive#user. - */ - kind: string; - /** - * The user's ID as visible in the permissions collection. - */ - permissionId: string; - /** - * The user's profile picture. - */ - picture: any; -} - -export class Resource$About { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.about.get - * @desc Gets the information about the current user along with Drive API - * settings - * @alias drive.about.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.includeSubscribed Whether to count changes outside the My Drive hierarchy. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the maxChangeIdCount. - * @param {string=} params.maxChangeIdCount Maximum number of remaining change IDs to count - * @param {string=} params.startChangeId Change ID to start counting from when calculating number of remaining change IDs - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/about').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Apps { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.apps.get - * @desc Gets a specific app. - * @alias drive.apps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.appId The ID of the app. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/apps/{appId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['appId'], - pathParams: ['appId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.apps.list - * @desc Lists a user's installed apps. - * @alias drive.apps.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.appFilterExtensions A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists. - * @param {string=} params.appFilterMimeTypes A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists. - * @param {string=} params.languageCode A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/apps').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Changes { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.changes.get - * @desc Deprecated - Use changes.getStartPageToken and changes.list to - * retrieve recent changes. - * @alias drive.changes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.changeId The ID of the change. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The Team Drive from which the change will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/changes/{changeId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['changeId'], - pathParams: ['changeId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.changes.getStartPageToken - * @desc Gets the starting pageToken for listing future changes. - * @alias drive.changes.getStartPageToken - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getStartPageToken(params?: any, options?: MethodOptions): - AxiosPromise; - getStartPageToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getStartPageToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/changes/startPageToken') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.changes.list - * @desc Lists the changes for a user or Team Drive. - * @alias drive.changes.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. - * @param {boolean=} params.includeDeleted Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. - * @param {boolean=} params.includeSubscribed Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the result. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. - * @param {integer=} params.maxResults Maximum number of changes to return. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {string=} params.startChangeId Deprecated - use pageToken instead. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/changes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.changes.watch - * @desc Subscribe to changes for a user. - * @alias drive.changes.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. - * @param {boolean=} params.includeDeleted Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. - * @param {boolean=} params.includeSubscribed Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the result. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. - * @param {integer=} params.maxResults Maximum number of changes to return. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {string=} params.startChangeId Deprecated - use pageToken instead. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/changes/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.channels.stop - * @desc Stop watching resources through this channel - * @alias drive.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Children { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.children.delete - * @desc Removes a child from a folder. - * @alias drive.children.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.childId The ID of the child. - * @param {string} params.folderId The ID of the folder. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['folderId', 'childId'], - pathParams: ['childId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.children.get - * @desc Gets a specific child reference. - * @alias drive.children.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.childId The ID of the child. - * @param {string} params.folderId The ID of the folder. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['folderId', 'childId'], - pathParams: ['childId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.children.insert - * @desc Inserts a file into a folder. - * @alias drive.children.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.folderId The ID of the folder. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {().ChildReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{folderId}/children') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['folderId'], - pathParams: ['folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.children.list - * @desc Lists a folder's children. - * @alias drive.children.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.folderId The ID of the folder. - * @param {integer=} params.maxResults Maximum number of children to return. - * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. - * @param {string=} params.pageToken Page token for children. - * @param {string=} params.q Query string for searching children. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{folderId}/children') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['folderId'], - pathParams: ['folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Comments { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.comments.delete - * @desc Deletes a comment. - * @alias drive.comments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.get - * @desc Gets a comment by ID. - * @alias drive.comments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted If set, this will succeed when retrieving a deleted comment, and will include any deleted replies. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.insert - * @desc Creates a new comment on the given file. - * @alias drive.comments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.list - * @desc Lists a file's comments. - * @alias drive.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned. - * @param {integer=} params.maxResults The maximum number of discussions to include in the response, used for paging. - * @param {string=} params.pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string=} params.updatedMin Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.patch - * @desc Updates an existing comment. This method supports patch semantics. - * @alias drive.comments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.update - * @desc Updates an existing comment. - * @alias drive.comments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Files { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.files.copy - * @desc Creates a copy of the specified file. - * @alias drive.files.copy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.convert Whether to convert this file to the corresponding Google Docs format. - * @param {string} params.fileId The ID of the file to copy. - * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. - * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. - * @param {boolean=} params.pinned Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.timedTextLanguage The language of the timed text. - * @param {string=} params.timedTextTrackName The timed text track name. - * @param {string=} params.visibility The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false. - * @param {().File} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/copy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.delete - * @desc Permanently deletes a file by ID. Skips the trash. The currently - * authenticated user must own the file or be an organizer on the parent for - * Team Drive files. - * @alias drive.files.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file to delete. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.emptyTrash - * @desc Permanently deletes all of the user's trashed files. - * @alias drive.files.emptyTrash - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - emptyTrash(params?: any, options?: MethodOptions): AxiosPromise; - emptyTrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - emptyTrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/trash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.export - * @desc Exports a Google Doc to the requested MIME type and returns the - * exported content. Please note that the exported content is limited to 10MB. - * @alias drive.files.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.mimeType The MIME type of the format requested for this export. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): AxiosPromise; - export( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'mimeType'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.generateIds - * @desc Generates a set of file IDs which can be provided in insert requests. - * @alias drive.files.generateIds - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of IDs to return. - * @param {string=} params.space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateIds(params?: any, options?: MethodOptions): - AxiosPromise; - generateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/generateIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.get - * @desc Gets a file's metadata by ID. - * @alias drive.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. - * @param {string} params.fileId The ID for the file in question. - * @param {string=} params.projection This parameter is deprecated and has no function. - * @param {string=} params.revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.insert - * @desc Insert a new file. - * @alias drive.files.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.convert Whether to convert this file to the corresponding Google Docs format. - * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. - * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. - * @param {boolean=} params.pinned Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.timedTextLanguage The language of the timed text. - * @param {string=} params.timedTextTrackName The timed text track name. - * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. - * @param {string=} params.visibility The visibility of the new file. This parameter is only relevant when convert=false. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + '/upload/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.list - * @desc Lists the user's files. - * @alias drive.files.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.corpora Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'default', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'default'; all other values must be used in isolation. Prefer 'default' or 'teamDrive' to 'allTeamDrives' for efficiency. - * @param {string=} params.corpus The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive items should be included in results. - * @param {integer=} params.maxResults The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. - * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. - * @param {string=} params.pageToken Page token for files. - * @param {string=} params.projection This parameter is deprecated and has no function. - * @param {string=} params.q Query string for searching files. - * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId ID of Team Drive to search. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.patch - * @desc Updates file metadata and/or content. This method supports patch - * semantics. - * @alias drive.files.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.addParents Comma-separated list of parent IDs to add. - * @param {boolean=} params.convert This parameter is deprecated and has no function. - * @param {string} params.fileId The ID of the file to update. - * @param {string=} params.modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. - * @param {boolean=} params.newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. - * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. - * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. - * @param {boolean=} params.pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. - * @param {string=} params.removeParents Comma-separated list of parent IDs to remove. - * @param {boolean=} params.setModifiedDate Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.timedTextLanguage The language of the timed text. - * @param {string=} params.timedTextTrackName The timed text track name. - * @param {boolean=} params.updateViewedDate Whether to update the view date after successfully updating the file. - * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. - * @param {().File} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.touch - * @desc Set the file's updated time to the current server time. - * @alias drive.files.touch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file to update. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - touch(params?: any, options?: MethodOptions): AxiosPromise; - touch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - touch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/touch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.trash - * @desc Moves a file to the trash. The currently authenticated user must own - * the file or be an organizer on the parent for Team Drive files. - * @alias drive.files.trash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file to trash. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - trash(params?: any, options?: MethodOptions): AxiosPromise; - trash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - trash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/trash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.untrash - * @desc Restores a file from the trash. - * @alias drive.files.untrash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file to untrash. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - untrash(params?: any, options?: MethodOptions): AxiosPromise; - untrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - untrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/untrash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.update - * @desc Updates file metadata and/or content. - * @alias drive.files.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.addParents Comma-separated list of parent IDs to add. - * @param {boolean=} params.convert This parameter is deprecated and has no function. - * @param {string} params.fileId The ID of the file to update. - * @param {string=} params.modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. - * @param {boolean=} params.newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. - * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. - * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. - * @param {boolean=} params.pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. - * @param {string=} params.removeParents Comma-separated list of parent IDs to remove. - * @param {boolean=} params.setModifiedDate Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.timedTextLanguage The language of the timed text. - * @param {string=} params.timedTextTrackName The timed text track name. - * @param {boolean=} params.updateViewedDate Whether to update the view date after successfully updating the file. - * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.files.watch - * @desc Subscribe to changes on a file - * @alias drive.files.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. - * @param {string} params.fileId The ID for the file in question. - * @param {string=} params.projection This parameter is deprecated and has no function. - * @param {string=} params.revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Parents { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.parents.delete - * @desc Removes a parent from a file. - * @alias drive.parents.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.parentId The ID of the parent. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'parentId'], - pathParams: ['fileId', 'parentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace drive_v2 { /** - * drive.parents.get - * @desc Gets a specific parent reference. - * @alias drive.parents.get - * @memberOf! () + * Drive API * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.parentId The ID of the parent. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'parentId'], - pathParams: ['fileId', 'parentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * Manages files in Drive including uploading, downloading, searching, + * detecting changes, and updating sharing permissions. + * + * @example + * const google = require('googleapis'); + * const drive = google.drive('v2'); + * + * @namespace drive + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Drive + */ + export class Drive { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + about: Resource$About; + apps: Resource$Apps; + changes: Resource$Changes; + channels: Resource$Channels; + children: Resource$Children; + comments: Resource$Comments; + files: Resource$Files; + parents: Resource$Parents; + permissions: Resource$Permissions; + properties: Resource$Properties; + realtime: Resource$Realtime; + replies: Resource$Replies; + revisions: Resource$Revisions; + teamdrives: Resource$Teamdrives; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.about = new Resource$About(this); + this.apps = new Resource$Apps(this); + this.changes = new Resource$Changes(this); + this.channels = new Resource$Channels(this); + this.children = new Resource$Children(this); + this.comments = new Resource$Comments(this); + this.files = new Resource$Files(this); + this.parents = new Resource$Parents(this); + this.permissions = new Resource$Permissions(this); + this.properties = new Resource$Properties(this); + this.realtime = new Resource$Realtime(this); + this.replies = new Resource$Replies(this); + this.revisions = new Resource$Revisions(this); + this.teamdrives = new Resource$Teamdrives(this); + } + + getRoot() { + return this.root; } } - /** - * drive.parents.insert - * @desc Adds a parent folder for a file. - * @alias drive.parents.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {().ParentReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/parents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An item with user information and settings. + */ + export interface Schema$About { + /** + * Information about supported additional roles per file type. The most + * specific type takes precedence. + */ + additionalRoleInfo: any[]; + /** + * Whether the user can create Team Drives. + */ + canCreateTeamDrives: boolean; + /** + * The domain sharing policy for the current user. Possible values are: - + * allowed - allowedWithWarning - incomingOnly - disallowed + */ + domainSharingPolicy: string; + /** + * The ETag of the item. + */ + etag: string; + /** + * The allowable export formats. + */ + exportFormats: any[]; + /** + * List of additional features enabled on this account. + */ + features: any[]; + /** + * The palette of allowable folder colors as RGB hex strings. + */ + folderColorPalette: string[]; + /** + * The allowable import formats. + */ + importFormats: any[]; + /** + * A boolean indicating whether the authenticated app is installed by the + * authenticated user. + */ + isCurrentAppInstalled: boolean; + /** + * This is always drive#about. + */ + kind: string; + /** + * The user's language or locale code, as defined by BCP 47, with some + * extensions from Unicode's LDML format + * (http://www.unicode.org/reports/tr35/). + */ + languageCode: string; + /** + * The largest change id. + */ + largestChangeId: string; + /** + * List of max upload sizes for each file type. The most specific type takes + * precedence. + */ + maxUploadSizes: any[]; + /** + * The name of the current user. + */ + name: string; + /** + * The current user's ID as visible in the permissions collection. + */ + permissionId: string; + /** + * The amount of storage quota used by different Google services. + */ + quotaBytesByService: any[]; + /** + * The total number of quota bytes. + */ + quotaBytesTotal: string; + /** + * The number of quota bytes used by Google Drive. + */ + quotaBytesUsed: string; + /** + * The number of quota bytes used by all Google apps (Drive, Picasa, etc.). + */ + quotaBytesUsedAggregate: string; + /** + * The number of quota bytes used by trashed items. + */ + quotaBytesUsedInTrash: string; + /** + * The type of the user's storage quota. Possible values are: - + * LIMITED - UNLIMITED + */ + quotaType: string; + /** + * The number of remaining change ids, limited to no more than 2500. + */ + remainingChangeIds: string; + /** + * The id of the root folder. + */ + rootFolderId: string; + /** + * A link back to this item. + */ + selfLink: string; + /** + * A list of themes that are supported for Team Drives. + */ + teamDriveThemes: any[]; + /** + * The authenticated user. + */ + user: Schema$User; } - - /** - * drive.parents.list - * @desc Lists a file's parents. - * @alias drive.parents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/parents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The apps resource provides a list of the apps that a user has installed, + * with information about each app's supported MIME types, file + * extensions, and other details. + */ + export interface Schema$App { + /** + * Whether the app is authorized to access data on the user's Drive. + */ + authorized: boolean; + /** + * The template url to create a new file with this app in a given folder. + * The template will contain {folderId} to be replaced by the folder to + * create the new file in. + */ + createInFolderTemplate: string; + /** + * The url to create a new file with this app. + */ + createUrl: string; + /** + * Whether the app has drive-wide scope. An app with drive-wide scope can + * access all files in the user's drive. + */ + hasDriveWideScope: boolean; + /** + * The various icons for the app. + */ + icons: any[]; + /** + * The ID of the app. + */ + id: string; + /** + * Whether the app is installed. + */ + installed: boolean; + /** + * This is always drive#app. + */ + kind: string; + /** + * A long description of the app. + */ + longDescription: string; + /** + * The name of the app. + */ + name: string; + /** + * The type of object this app creates (e.g. Chart). If empty, the app name + * should be used instead. + */ + objectType: string; + /** + * The template url for opening files with this app. The template will + * contain {ids} and/or {exportIds} to be replaced by the actual file ids. + * See Open Files for the full documentation. + */ + openUrlTemplate: string; + /** + * The list of primary file extensions. + */ + primaryFileExtensions: string[]; + /** + * The list of primary mime types. + */ + primaryMimeTypes: string[]; + /** + * The ID of the product listing for this app. + */ + productId: string; + /** + * A link to the product listing for this app. + */ + productUrl: string; + /** + * The list of secondary file extensions. + */ + secondaryFileExtensions: string[]; + /** + * The list of secondary mime types. + */ + secondaryMimeTypes: string[]; + /** + * A short description of the app. + */ + shortDescription: string; + /** + * Whether this app supports creating new objects. + */ + supportsCreate: boolean; + /** + * Whether this app supports importing Google Docs. + */ + supportsImport: boolean; + /** + * Whether this app supports opening more than one file. + */ + supportsMultiOpen: boolean; + /** + * Whether this app supports creating new files when offline. + */ + supportsOfflineCreate: boolean; + /** + * Whether the app is selected as the default handler for the types it + * supports. + */ + useByDefault: boolean; } -} - -export class Resource$Permissions { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); + /** + * A list of third-party applications which the user has installed or given + * access to Google Drive. + */ + export interface Schema$AppList { + /** + * List of app IDs that the user has specified to use by default. The list + * is in reverse-priority order (lowest to highest). + */ + defaultAppIds: string[]; + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of apps. + */ + items: Schema$App[]; + /** + * This is always drive#appList. + */ + kind: string; + /** + * A link back to this list. + */ + selfLink: string; } - - getRoot() { - return this.root; + /** + * Representation of a change to a file or Team Drive. + */ + export interface Schema$Change { + /** + * Whether the file or Team Drive has been removed from this list of + * changes, for example by deletion or loss of access. + */ + deleted: boolean; + /** + * The updated state of the file. Present if the type is file and the file + * has not been removed from this list of changes. + */ + file: Schema$File; + /** + * The ID of the file associated with this change. + */ + fileId: string; + /** + * The ID of the change. + */ + id: string; + /** + * This is always drive#change. + */ + kind: string; + /** + * The time of this modification. + */ + modificationDate: string; + /** + * A link back to this change. + */ + selfLink: string; + /** + * The updated state of the Team Drive. Present if the type is teamDrive, + * the user is still a member of the Team Drive, and the Team Drive has not + * been deleted. + */ + teamDrive: Schema$TeamDrive; + /** + * The ID of the Team Drive associated with this change. + */ + teamDriveId: string; + /** + * The type of the change. Possible values are file and teamDrive. + */ + type: string; } - - /** - * drive.permissions.delete - * @desc Deletes a permission from a file or Team Drive. - * @alias drive.permissions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {string} params.permissionId The ID for the permission. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of changes for a user. + */ + export interface Schema$ChangeList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of changes. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + items: Schema$Change[]; + /** + * This is always drive#changeList. + */ + kind: string; + /** + * The current largest change ID. + */ + largestChangeId: string; + /** + * The starting page token for future changes. This will be present only if + * the end of the current changes list has been reached. + */ + newStartPageToken: string; + /** + * A link to the next page of changes. + */ + nextLink: string; + /** + * The page token for the next page of changes. This will be absent if the + * end of the changes list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - /** - * drive.permissions.get - * @desc Gets a permission by ID. - * @alias drive.permissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {string} params.permissionId The ID for the permission. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; } - - /** - * drive.permissions.getIdForEmail - * @desc Returns the permission ID for an email address. - * @alias drive.permissions.getIdForEmail - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.email The email address for which to return a permission ID - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIdForEmail(params?: any, options?: MethodOptions): - AxiosPromise; - getIdForEmail( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIdForEmail( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/permissionIds/{email}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['email'], - pathParams: ['email'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of children of a file. + */ + export interface Schema$ChildList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of children. If nextPageToken is populated, then this list may + * be incomplete and an additional page of results should be fetched. + */ + items: Schema$ChildReference[]; + /** + * This is always drive#childList. + */ + kind: string; + /** + * A link to the next page of children. + */ + nextLink: string; + /** + * The page token for the next page of children. This will be absent if the + * end of the children list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - /** - * drive.permissions.insert - * @desc Inserts a permission for a file or Team Drive. - * @alias drive.permissions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.emailMessage A plain text custom message to include in notification emails. - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {boolean=} params.sendNotificationEmails Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {().Permission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A reference to a folder's child. + */ + export interface Schema$ChildReference { + /** + * A link to the child. + */ + childLink: string; + /** + * The ID of the child. + */ + id: string; + /** + * This is always drive#childReference. + */ + kind: string; + /** + * A link back to this reference. + */ + selfLink: string; } - - /** - * drive.permissions.list - * @desc Lists a file's or Team Drive's permissions. - * @alias drive.permissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {integer=} params.maxResults The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A comment on a file in Google Drive. + */ + export interface Schema$Comment { + /** + * A region of the document represented as a JSON string. See anchor + * documentation for details on how to define and interpret anchor + * properties. + */ + anchor: string; + /** + * The user who wrote this comment. + */ + author: Schema$User; + /** + * The ID of the comment. + */ + commentId: string; + /** + * The plain text content used to create this comment. This is not HTML safe + * and should only be used as a starting point to make edits to a + * comment's content. + */ + content: string; + /** + * The context of the file which is being commented on. + */ + context: any; + /** + * The date when this comment was first created. + */ + createdDate: string; + /** + * Whether this comment has been deleted. If a comment has been deleted the + * content will be cleared and this will only represent a comment that once + * existed. + */ + deleted: boolean; + /** + * The file which this comment is addressing. + */ + fileId: string; + /** + * The title of the file which this comment is addressing. + */ + fileTitle: string; + /** + * HTML formatted content for this comment. + */ + htmlContent: string; + /** + * This is always drive#comment. + */ + kind: string; + /** + * The date when this comment or any of its replies were last modified. + */ + modifiedDate: string; + /** + * Replies to this post. + */ + replies: Schema$CommentReply[]; + /** + * A link back to this comment. + */ + selfLink: string; + /** + * The status of this comment. Status can be changed by posting a reply to a + * comment with the desired status. - "open" - The comment is + * still open. - "resolved" - The comment has been resolved by + * one of its replies. + */ + status: string; } - - /** - * drive.permissions.patch - * @desc Updates a permission using patch semantics. - * @alias drive.permissions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {string} params.permissionId The ID for the permission. - * @param {boolean=} params.removeExpiration Whether to remove the expiration date. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.transferOwnership Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {().Permission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of comments on a file in Google Drive. + */ + export interface Schema$CommentList { + /** + * The list of comments. If nextPageToken is populated, then this list may + * be incomplete and an additional page of results should be fetched. + */ + items: Schema$Comment[]; + /** + * This is always drive#commentList. + */ + kind: string; + /** + * A link to the next page of comments. + */ + nextLink: string; + /** + * The page token for the next page of comments. This will be absent if the + * end of the comments list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - /** - * drive.permissions.update - * @desc Updates a permission. - * @alias drive.permissions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file or Team Drive. - * @param {string} params.permissionId The ID for the permission. - * @param {boolean=} params.removeExpiration Whether to remove the expiration date. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.transferOwnership Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {().Permission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A comment on a file in Google Drive. + */ + export interface Schema$CommentReply { + /** + * The user who wrote this reply. + */ + author: Schema$User; + /** + * The plain text content used to create this reply. This is not HTML safe + * and should only be used as a starting point to make edits to a + * reply's content. This field is required on inserts if no verb is + * specified (resolve/reopen). + */ + content: string; + /** + * The date when this reply was first created. + */ + createdDate: string; + /** + * Whether this reply has been deleted. If a reply has been deleted the + * content will be cleared and this will only represent a reply that once + * existed. + */ + deleted: boolean; + /** + * HTML formatted content for this reply. + */ + htmlContent: string; + /** + * This is always drive#commentReply. + */ + kind: string; + /** + * The date when this reply was last modified. + */ + modifiedDate: string; + /** + * The ID of the reply. + */ + replyId: string; + /** + * The action this reply performed to the parent comment. When creating a + * new reply this is the action to be perform to the parent comment. + * Possible values are: - "resolve" - To resolve a comment. - + * "reopen" - To reopen (un-resolve) a comment. + */ + verb: string; } -} - -export class Resource$Properties { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); + /** + * A list of replies to a comment on a file in Google Drive. + */ + export interface Schema$CommentReplyList { + /** + * The list of replies. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + items: Schema$CommentReply[]; + /** + * This is always drive#commentReplyList. + */ + kind: string; + /** + * A link to the next page of replies. + */ + nextLink: string; + /** + * The page token for the next page of replies. This will be absent if the + * end of the replies list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - getRoot() { - return this.root; + /** + * The metadata for a file. + */ + export interface Schema$File { + /** + * A link for opening the file in a relevant Google editor or viewer. + */ + alternateLink: string; + /** + * Whether this file is in the Application Data folder. + */ + appDataContents: boolean; + /** + * Deprecated: use capabilities/canComment. + */ + canComment: boolean; + /** + * Deprecated: use capabilities/canReadRevisions. + */ + canReadRevisions: boolean; + /** + * Capabilities the current user has on this file. Each capability + * corresponds to a fine-grained action that a user may take. + */ + capabilities: any; + /** + * Deprecated: use capabilities/canCopy. + */ + copyable: boolean; + /** + * Create time for this file (formatted RFC 3339 timestamp). + */ + createdDate: string; + /** + * A link to open this file with the user's default app for this file. + * Only populated when the drive.apps.readonly scope is used. + */ + defaultOpenWithLink: string; + /** + * A short description of the file. + */ + description: string; + downloadUrl: string; + /** + * Deprecated: use capabilities/canEdit. + */ + editable: boolean; + /** + * A link for embedding the file. + */ + embedLink: string; + /** + * ETag of the file. + */ + etag: string; + /** + * Whether this file has been explicitly trashed, as opposed to recursively + * trashed. + */ + explicitlyTrashed: boolean; + /** + * Links for exporting Google Docs to specific formats. + */ + exportLinks: any; + /** + * The final component of fullFileExtension with trailing text that does not + * appear to be part of the extension removed. This field is only populated + * for files with content stored in Drive; it is not populated for Google + * Docs or shortcut files. + */ + fileExtension: string; + /** + * The size of the file in bytes. This field is only populated for files + * with content stored in Drive; it is not populated for Google Docs or + * shortcut files. + */ + fileSize: string; + /** + * Folder color as an RGB hex string if the file is a folder. The list of + * supported colors is available in the folderColorPalette field of the + * About resource. If an unsupported color is specified, it will be changed + * to the closest color in the palette. Not populated for Team Drive files. + */ + folderColorRgb: string; + /** + * The full file extension; extracted from the title. May contain multiple + * concatenated extensions, such as "tar.gz". Removing an + * extension from the title does not clear this field; however, changing the + * extension on the title does update this field. This field is only + * populated for files with content stored in Drive; it is not populated for + * Google Docs or shortcut files. + */ + fullFileExtension: string; + /** + * Whether any users are granted file access directly on this file. This + * field is only populated for Team Drive files. + */ + hasAugmentedPermissions: boolean; + /** + * Whether this file has a thumbnail. This does not indicate whether the + * requesting app has access to the thumbnail. To check access, look for the + * presence of the thumbnailLink field. + */ + hasThumbnail: boolean; + /** + * The ID of the file's head revision. This field is only populated for + * files with content stored in Drive; it is not populated for Google Docs + * or shortcut files. + */ + headRevisionId: string; + /** + * A link to the file's icon. + */ + iconLink: string; + /** + * The ID of the file. + */ + id: string; + /** + * Metadata about image media. This will only be present for image types, + * and its contents will depend on what can be parsed from the image + * content. + */ + imageMediaMetadata: any; + /** + * Indexable text attributes for the file (can only be written) + */ + indexableText: any; + /** + * Whether the file was created or opened by the requesting app. + */ + isAppAuthorized: boolean; + /** + * The type of file. This is always drive#file. + */ + kind: string; + /** + * A group of labels for the file. + */ + labels: any; + /** + * The last user to modify this file. + */ + lastModifyingUser: Schema$User; + /** + * Name of the last user to modify this file. + */ + lastModifyingUserName: string; + /** + * Last time this file was viewed by the user (formatted RFC 3339 + * timestamp). + */ + lastViewedByMeDate: string; + /** + * Deprecated. + */ + markedViewedByMeDate: string; + /** + * An MD5 checksum for the content of this file. This field is only + * populated for files with content stored in Drive; it is not populated for + * Google Docs or shortcut files. + */ + md5Checksum: string; + /** + * The MIME type of the file. This is only mutable on update when uploading + * new content. This field can be left blank, and the mimetype will be + * determined from the uploaded content's MIME type. + */ + mimeType: string; + /** + * Last time this file was modified by the user (formatted RFC 3339 + * timestamp). Note that setting modifiedDate will also update the + * modifiedByMe date for the user which set the date. + */ + modifiedByMeDate: string; + /** + * Last time this file was modified by anyone (formatted RFC 3339 + * timestamp). This is only mutable on update when the setModifiedDate + * parameter is set. + */ + modifiedDate: string; + /** + * A map of the id of each of the user's apps to a link to open this + * file with that app. Only populated when the drive.apps.readonly scope is + * used. + */ + openWithLinks: any; + /** + * The original filename of the uploaded content if available, or else the + * original value of the title field. This is only available for files with + * binary content in Drive. + */ + originalFilename: string; + /** + * Whether the file is owned by the current user. Not populated for Team + * Drive files. + */ + ownedByMe: boolean; + /** + * Name(s) of the owner(s) of this file. Not populated for Team Drive files. + */ + ownerNames: string[]; + /** + * The owner(s) of this file. Not populated for Team Drive files. + */ + owners: Schema$User[]; + /** + * Collection of parent folders which contain this file. If not specified as + * part of an insert request, the file will be placed directly in the + * user's My Drive folder. If not specified as part of a copy request, + * the file will inherit any discoverable parents of the source file. Update + * requests can also use the addParents and removeParents parameters to + * modify the parents list. + */ + parents: Schema$ParentReference[]; + /** + * List of permission IDs for users with access to this file. + */ + permissionIds: string[]; + /** + * The list of permissions for users with access to this file. Not populated + * for Team Drive files. + */ + permissions: Schema$Permission[]; + /** + * The list of properties. + */ + properties: Schema$Property[]; + /** + * The number of quota bytes used by this file. + */ + quotaBytesUsed: string; + /** + * A link back to this file. + */ + selfLink: string; + /** + * Deprecated: use capabilities/canShare. + */ + shareable: boolean; + /** + * Whether the file has been shared. Not populated for Team Drive files. + */ + shared: boolean; + /** + * Time at which this file was shared with the user (formatted RFC 3339 + * timestamp). + */ + sharedWithMeDate: string; + /** + * User that shared the item with the current user, if available. + */ + sharingUser: Schema$User; + /** + * The list of spaces which contain the file. Supported values are + * 'drive', 'appDataFolder' and 'photos'. + */ + spaces: string[]; + /** + * ID of the Team Drive the file resides in. + */ + teamDriveId: string; + /** + * A thumbnail for the file. This will only be used if Drive cannot generate + * a standard thumbnail. + */ + thumbnail: any; + /** + * A short-lived link to the file's thumbnail. Typically lasts on the + * order of hours. Only populated when the requesting app can access the + * file's content. + */ + thumbnailLink: string; + /** + * The thumbnail version for use in thumbnail cache invalidation. + */ + thumbnailVersion: string; + /** + * The title of this file. Note that for immutable items such as the top + * level folders of Team Drives, My Drive root folder, and Application Data + * folder the title is constant. + */ + title: string; + /** + * The time that the item was trashed (formatted RFC 3339 timestamp). Only + * populated for Team Drive files. + */ + trashedDate: string; + /** + * If the file has been explicitly trashed, the user who trashed it. Only + * populated for Team Drive files. + */ + trashingUser: Schema$User; + /** + * The permissions for the authenticated user on this file. + */ + userPermission: Schema$Permission; + /** + * A monotonically increasing version number for the file. This reflects + * every change made to the file on the server, even those not visible to + * the requesting user. + */ + version: string; + /** + * Metadata about video media. This will only be present for video types. + */ + videoMediaMetadata: any; + /** + * A link for downloading the content of the file in a browser using cookie + * based authentication. In cases where the content is shared publicly, the + * content can be downloaded without any credentials. + */ + webContentLink: string; + /** + * A link only available on public folders for viewing their static web + * assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. + */ + webViewLink: string; + /** + * Whether writers can share the document with other users. Not populated + * for Team Drive files. + */ + writersCanShare: boolean; } - - /** - * drive.properties.delete - * @desc Deletes a property. - * @alias drive.properties.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.propertyKey The key of the property. - * @param {string=} params.visibility The visibility of the property. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'propertyKey'], - pathParams: ['fileId', 'propertyKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of files. + */ + export interface Schema$FileList { + /** + * The ETag of the list. + */ + etag: string; + /** + * Whether the search process was incomplete. If true, then some search + * results may be missing, since all documents were not searched. This may + * occur when searching multiple Team Drives with the + * "default,allTeamDrives" corpora, but all corpora could not be + * searched. When this happens, it is suggested that clients narrow their + * query by choosing a different corpus such as "default" or + * "teamDrive". + */ + incompleteSearch: boolean; + /** + * The list of files. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + items: Schema$File[]; + /** + * This is always drive#fileList. + */ + kind: string; + /** + * A link to the next page of files. + */ + nextLink: string; + /** + * The page token for the next page of files. This will be absent if the end + * of the files list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from + * the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - /** - * drive.properties.get - * @desc Gets a property by its key. - * @alias drive.properties.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.propertyKey The key of the property. - * @param {string=} params.visibility The visibility of the property. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'propertyKey'], - pathParams: ['fileId', 'propertyKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of generated IDs which can be provided in insert requests + */ + export interface Schema$GeneratedIds { + /** + * The IDs generated for the requesting user in the specified space. + */ + ids: string[]; + /** + * This is always drive#generatedIds + */ + kind: string; + /** + * The type of file that can be created with these IDs. + */ + space: string; } - - /** - * drive.properties.insert - * @desc Adds a property to a file, or updates it if it already exists. - * @alias drive.properties.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {().Property} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of a file's parents. + */ + export interface Schema$ParentList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of parents. + */ + items: Schema$ParentReference[]; + /** + * This is always drive#parentList. + */ + kind: string; + /** + * A link back to this list. + */ + selfLink: string; } - - /** - * drive.properties.list - * @desc Lists a file's properties. - * @alias drive.properties.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A reference to a file's parent. + */ + export interface Schema$ParentReference { + /** + * The ID of the parent. + */ + id: string; + /** + * Whether or not the parent is the root folder. + */ + isRoot: boolean; + /** + * This is always drive#parentReference. + */ + kind: string; + /** + * A link to the parent. + */ + parentLink: string; + /** + * A link back to this reference. + */ + selfLink: string; } - - /** - * drive.properties.patch - * @desc Updates a property. This method supports patch semantics. - * @alias drive.properties.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.propertyKey The key of the property. - * @param {string=} params.visibility The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) - * @param {().Property} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'propertyKey'], - pathParams: ['fileId', 'propertyKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A permission for a file. + */ + export interface Schema$Permission { + /** + * Additional roles for this user. Only commenter is currently allowed, + * though more may be supported in the future. + */ + additionalRoles: string[]; + /** + * Deprecated. + */ + authKey: string; + /** + * Whether the account associated with this permission has been deleted. + * This field only pertains to user and group permissions. + */ + deleted: boolean; + /** + * The domain name of the entity this permission refers to. This is an + * output-only field which is present when the permission type is user, + * group or domain. + */ + domain: string; + /** + * The email address of the user or group this permission refers to. This is + * an output-only field which is present when the permission type is user or + * group. + */ + emailAddress: string; + /** + * The ETag of the permission. + */ + etag: string; + /** + * The time at which this permission will expire (RFC 3339 date-time). + * Expiration dates have the following restrictions: - They can only be + * set on user and group permissions - The date must be in the future - + * The date cannot be more than a year in the future - The date can only be + * set on drive.permissions.update or drive.permissions.patch requests + */ + expirationDate: string; + /** + * The ID of the user this permission refers to, and identical to the + * permissionId in the About and Files resources. When making a + * drive.permissions.insert request, exactly one of the id or value fields + * must be specified unless the permission type is anyone, in which case + * both id and value are ignored. + */ + id: string; + /** + * This is always drive#permission. + */ + kind: string; + /** + * The name for this permission. + */ + name: string; + /** + * A link to the profile photo, if available. + */ + photoLink: string; + /** + * The primary role for this user. While new values may be supported in the + * future, the following are currently allowed: - organizer - owner - + * reader - writer + */ + role: string; + /** + * A link back to this permission. + */ + selfLink: string; + /** + * Details of whether the permissions on this Team Drive item are inherited + * or directly on this item. This is an output-only field which is present + * only for Team Drive items. + */ + teamDrivePermissionDetails: any[]; + /** + * The account type. Allowed values are: - user - group - domain - + * anyone + */ + type: string; + /** + * The email address or domain name for the entity. This is used during + * inserts and is not populated in responses. When making a + * drive.permissions.insert request, exactly one of the id or value fields + * must be specified unless the permission type is anyone, in which case + * both id and value are ignored. + */ + value: string; + /** + * Whether the link is required for this permission. + */ + withLink: boolean; } - - /** - * drive.properties.update - * @desc Updates a property. - * @alias drive.properties.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.propertyKey The key of the property. - * @param {string=} params.visibility The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) - * @param {().Property} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/properties/{propertyKey}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['fileId', 'propertyKey'], - pathParams: ['fileId', 'propertyKey'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An ID for a user or group as seen in Permission items. + */ + export interface Schema$PermissionId { + /** + * The permission ID. + */ + id: string; + /** + * This is always drive#permissionId. + */ + kind: string; } -} - -export class Resource$Realtime { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); + /** + * A list of permissions associated with a file. + */ + export interface Schema$PermissionList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of permissions. + */ + items: Schema$Permission[]; + /** + * This is always drive#permissionList. + */ + kind: string; + /** + * The page token for the next page of permissions. This field will be + * absent if the end of the permissions list has been reached. If the token + * is rejected for any reason, it should be discarded, and pagination should + * be restarted from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - getRoot() { - return this.root; + /** + * A key-value pair attached to a file that is either public or private to an + * application. The following limits apply to file properties: - Maximum of + * 100 properties total per file - Maximum of 30 private properties per app - + * Maximum of 30 public properties - Maximum of 124 bytes size limit on (key + + * value) string in UTF-8 encoding for a single property. + */ + export interface Schema$Property { + /** + * ETag of the property. + */ + etag: string; + /** + * The key of this property. + */ + key: string; + /** + * This is always drive#property. + */ + kind: string; + /** + * The link back to this property. + */ + selfLink: string; + /** + * The value of this property. + */ + value: string; + /** + * The visibility of this property. Allowed values are PRIVATE and PUBLIC. + * (Default: PRIVATE) + */ + visibility: string; } - - /** - * drive.realtime.get - * @desc Exports the contents of the Realtime API data model associated with - * this file as JSON. - * @alias drive.realtime.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file that the Realtime API data model is associated with. - * @param {integer=} params.revision The revision of the Realtime API data model to export. Revisions start at 1 (the initial empty data model) and are incremented with each change. If this parameter is excluded, the most recent data model will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/realtime') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A collection of properties, key-value pairs that are either public or + * private to an application. + */ + export interface Schema$PropertyList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of properties. + */ + items: Schema$Property[]; + /** + * This is always drive#propertyList. + */ + kind: string; + /** + * The link back to this list. + */ + selfLink: string; } - - /** - * drive.realtime.update - * @desc Overwrites the Realtime API data model associated with this file with - * the provided JSON data model. - * @alias drive.realtime.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.baseRevision The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server. - * @param {string} params.fileId The ID of the file that the Realtime API data model is associated with. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/realtime') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}/realtime') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A revision of a file. + */ + export interface Schema$Revision { + /** + * Short term download URL for the file. This will only be populated on + * files with content stored in Drive. + */ + downloadUrl: string; + /** + * The ETag of the revision. + */ + etag: string; + /** + * Links for exporting Google Docs to specific formats. + */ + exportLinks: any; + /** + * The size of the revision in bytes. This will only be populated on files + * with content stored in Drive. + */ + fileSize: string; + /** + * The ID of the revision. + */ + id: string; + /** + * This is always drive#revision. + */ + kind: string; + /** + * The last user to modify this revision. + */ + lastModifyingUser: Schema$User; + /** + * Name of the last user to modify this revision. + */ + lastModifyingUserName: string; + /** + * An MD5 checksum for the content of this revision. This will only be + * populated on files with content stored in Drive. + */ + md5Checksum: string; + /** + * The MIME type of the revision. + */ + mimeType: string; + /** + * Last time this revision was modified (formatted RFC 3339 timestamp). + */ + modifiedDate: string; + /** + * The original filename when this revision was created. This will only be + * populated on files with content stored in Drive. + */ + originalFilename: string; + /** + * Whether this revision is pinned to prevent automatic purging. This will + * only be populated and can only be modified on files with content stored + * in Drive which are not Google Docs. Revisions can also be pinned when + * they are created through the drive.files.insert/update/copy by using the + * pinned query parameter. + */ + pinned: boolean; + /** + * Whether subsequent revisions will be automatically republished. This is + * only populated and can only be modified for Google Docs. + */ + publishAuto: boolean; + /** + * Whether this revision is published. This is only populated and can only + * be modified for Google Docs. + */ + published: boolean; + /** + * A link to the published revision. + */ + publishedLink: string; + /** + * Whether this revision is published outside the domain. This is only + * populated and can only be modified for Google Docs. + */ + publishedOutsideDomain: boolean; + /** + * A link back to this revision. + */ + selfLink: string; } -} - -export class Resource$Replies { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); + /** + * A list of revisions of a file. + */ + export interface Schema$RevisionList { + /** + * The ETag of the list. + */ + etag: string; + /** + * The list of revisions. If nextPageToken is populated, then this list may + * be incomplete and an additional page of results should be fetched. + */ + items: Schema$Revision[]; + /** + * This is always drive#revisionList. + */ + kind: string; + /** + * The page token for the next page of revisions. This field will be absent + * if the end of the revisions list has been reached. If the token is + * rejected for any reason, it should be discarded and pagination should be + * restarted from the first page of results. + */ + nextPageToken: string; + /** + * A link back to this list. + */ + selfLink: string; } - - getRoot() { - return this.root; + export interface Schema$StartPageToken { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#startPageToken". + */ + kind: string; + /** + * The starting page token for listing changes. + */ + startPageToken: string; } - - /** - * drive.replies.delete - * @desc Deletes a reply. - * @alias drive.replies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {string} params.replyId The ID of the reply. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Representation of a Team Drive. + */ + export interface Schema$TeamDrive { + /** + * An image file and cropping parameters from which a background image for + * this Team Drive is set. This is a write only field; it can only be set on + * drive.teamdrives.update requests that don't set themeId. When + * specified, all fields of the backgroundImageFile must be set. + */ + backgroundImageFile: any; + /** + * A short-lived link to this Team Drive's background image. + */ + backgroundImageLink: string; + /** + * Capabilities the current user has on this Team Drive. + */ + capabilities: any; + /** + * The color of this Team Drive as an RGB hex string. It can only be set on + * a drive.teamdrives.update request that does not set themeId. + */ + colorRgb: string; + /** + * The time at which the Team Drive was created (RFC 3339 date-time). + */ + createdDate: string; + /** + * The ID of this Team Drive which is also the ID of the top level folder + * for this Team Drive. + */ + id: string; + /** + * This is always drive#teamDrive + */ + kind: string; + /** + * The name of this Team Drive. + */ + name: string; + /** + * The ID of the theme from which the background image and color will be + * set. The set of possible teamDriveThemes can be retrieved from a + * drive.about.get response. When not specified on a drive.teamdrives.insert + * request, a random theme is chosen from which the background image and + * color are set. This is a write-only field; it can only be set on requests + * that don't set colorRgb or backgroundImageFile. + */ + themeId: string; } - - /** - * drive.replies.get - * @desc Gets a reply. - * @alias drive.replies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted If set, this will succeed when retrieving a deleted reply. - * @param {string} params.replyId The ID of the reply. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of Team Drives. + */ + export interface Schema$TeamDriveList { + /** + * The list of Team Drives. + */ + items: Schema$TeamDrive[]; + /** + * This is always drive#teamDriveList + */ + kind: string; + /** + * The page token for the next page of Team Drives. + */ + nextPageToken: string; } - - /** - * drive.replies.insert - * @desc Creates a new reply to the given comment. - * @alias drive.replies.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {().CommentReply} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Information about a Drive user. + */ + export interface Schema$User { + /** + * A plain text displayable name for this user. + */ + displayName: string; + /** + * The email address of the user. + */ + emailAddress: string; + /** + * Whether this user is the same as the authenticated user for whom the + * request was made. + */ + isAuthenticatedUser: boolean; + /** + * This is always drive#user. + */ + kind: string; + /** + * The user's ID as visible in the permissions collection. + */ + permissionId: string; + /** + * The user's profile picture. + */ + picture: any; } - - /** - * drive.replies.list - * @desc Lists all of the replies to a comment. - * @alias drive.replies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted If set, all replies, including deleted replies (with content stripped) will be returned. - * @param {integer=} params.maxResults The maximum number of replies to include in the response, used for paging. - * @param {string=} params.pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$About { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.about.get + * @desc Gets the information about the current user along with Drive API + * settings + * @alias drive.about.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.includeSubscribed Whether to count changes outside the My Drive hierarchy. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the maxChangeIdCount. + * @param {string=} params.maxChangeIdCount Maximum number of remaining change IDs to count + * @param {string=} params.startChangeId Change ID to start counting from when calculating number of remaining change IDs + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/about').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.replies.patch - * @desc Updates an existing reply. This method supports patch semantics. - * @alias drive.replies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {string} params.replyId The ID of the reply. - * @param {().CommentReply} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Apps { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.apps.get + * @desc Gets a specific app. + * @alias drive.apps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.appId The ID of the app. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/apps/{appId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['appId'], + pathParams: ['appId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.apps.list + * @desc Lists a user's installed apps. + * @alias drive.apps.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.appFilterExtensions A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists. + * @param {string=} params.appFilterMimeTypes A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists. + * @param {string=} params.languageCode A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/apps').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.replies.update - * @desc Updates an existing reply. - * @alias drive.replies.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {string} params.replyId The ID of the reply. - * @param {().CommentReply} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Changes { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.changes.get + * @desc Deprecated - Use changes.getStartPageToken and changes.list to + * retrieve recent changes. + * @alias drive.changes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.changeId The ID of the change. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The Team Drive from which the change will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/changes/{changeId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['changeId'], + pathParams: ['changeId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.changes.getStartPageToken + * @desc Gets the starting pageToken for listing future changes. + * @alias drive.changes.getStartPageToken + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getStartPageToken(params?: any, options?: MethodOptions): + AxiosPromise; + getStartPageToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getStartPageToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/changes/startPageToken') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.changes.list + * @desc Lists the changes for a user or Team Drive. + * @alias drive.changes.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * @param {boolean=} params.includeDeleted Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * @param {boolean=} params.includeSubscribed Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the result. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. + * @param {integer=} params.maxResults Maximum number of changes to return. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {string=} params.startChangeId Deprecated - use pageToken instead. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/drive/v2/changes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.changes.watch + * @desc Subscribe to changes for a user. + * @alias drive.changes.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * @param {boolean=} params.includeDeleted Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * @param {boolean=} params.includeSubscribed Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the result. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. + * @param {integer=} params.maxResults Maximum number of changes to return. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {string=} params.startChangeId Deprecated - use pageToken instead. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/changes/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Revisions { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - /** - * drive.revisions.delete - * @desc Removes a revision. - * @alias drive.revisions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.revisionId The ID of the revision. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Channels { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.channels.stop + * @desc Stop watching resources through this channel + * @alias drive.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.get - * @desc Gets a specific revision. - * @alias drive.revisions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.revisionId The ID of the revision. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Children { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.children.delete + * @desc Removes a child from a folder. + * @alias drive.children.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.childId The ID of the child. + * @param {string} params.folderId The ID of the folder. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['folderId', 'childId'], + pathParams: ['childId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.children.get + * @desc Gets a specific child reference. + * @alias drive.children.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.childId The ID of the child. + * @param {string} params.folderId The ID of the folder. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{folderId}/children/{childId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['folderId', 'childId'], + pathParams: ['childId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.children.insert + * @desc Inserts a file into a folder. + * @alias drive.children.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.folderId The ID of the folder. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {().ChildReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{folderId}/children') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['folderId'], + pathParams: ['folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.children.list + * @desc Lists a folder's children. + * @alias drive.children.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.folderId The ID of the folder. + * @param {integer=} params.maxResults Maximum number of children to return. + * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * @param {string=} params.pageToken Page token for children. + * @param {string=} params.q Query string for searching children. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{folderId}/children') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['folderId'], + pathParams: ['folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.list - * @desc Lists a file's revisions. - * @alias drive.revisions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {integer=} params.maxResults Maximum number of revisions to return. - * @param {string=} params.pageToken Page token for revisions. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Comments { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.comments.delete + * @desc Deletes a comment. + * @alias drive.comments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.get + * @desc Gets a comment by ID. + * @alias drive.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted If set, this will succeed when retrieving a deleted comment, and will include any deleted replies. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.insert + * @desc Creates a new comment on the given file. + * @alias drive.comments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.list + * @desc Lists a file's comments. + * @alias drive.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned. + * @param {integer=} params.maxResults The maximum number of discussions to include in the response, used for paging. + * @param {string=} params.pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string=} params.updatedMin Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.patch + * @desc Updates an existing comment. This method supports patch semantics. + * @alias drive.comments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.update + * @desc Updates an existing comment. + * @alias drive.comments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.patch - * @desc Updates a revision. This method supports patch semantics. - * @alias drive.revisions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file. - * @param {string} params.revisionId The ID for the revision. - * @param {().Revision} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Files { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.files.copy + * @desc Creates a copy of the specified file. + * @alias drive.files.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.convert Whether to convert this file to the corresponding Google Docs format. + * @param {string} params.fileId The ID of the file to copy. + * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * @param {boolean=} params.pinned Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.timedTextLanguage The language of the timed text. + * @param {string=} params.timedTextTrackName The timed text track name. + * @param {string=} params.visibility The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false. + * @param {().File} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/copy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.delete + * @desc Permanently deletes a file by ID. Skips the trash. The currently + * authenticated user must own the file or be an organizer on the parent for + * Team Drive files. + * @alias drive.files.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file to delete. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.emptyTrash + * @desc Permanently deletes all of the user's trashed files. + * @alias drive.files.emptyTrash + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + emptyTrash(params?: any, options?: MethodOptions): AxiosPromise; + emptyTrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + emptyTrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/trash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.export + * @desc Exports a Google Doc to the requested MIME type and returns the + * exported content. Please note that the exported content is limited to + * 10MB. + * @alias drive.files.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.mimeType The MIME type of the format requested for this export. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): AxiosPromise; + export( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'mimeType'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.generateIds + * @desc Generates a set of file IDs which can be provided in insert + * requests. + * @alias drive.files.generateIds + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of IDs to return. + * @param {string=} params.space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateIds(params?: any, options?: MethodOptions): + AxiosPromise; + generateIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generateIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/generateIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.get + * @desc Gets a file's metadata by ID. + * @alias drive.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. + * @param {string} params.fileId The ID for the file in question. + * @param {string=} params.projection This parameter is deprecated and has no function. + * @param {string=} params.revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.insert + * @desc Insert a new file. + * @alias drive.files.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.convert Whether to convert this file to the corresponding Google Docs format. + * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * @param {boolean=} params.pinned Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.timedTextLanguage The language of the timed text. + * @param {string=} params.timedTextTrackName The timed text track name. + * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. + * @param {string=} params.visibility The visibility of the new file. This parameter is only relevant when convert=false. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + '/upload/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.list + * @desc Lists the user's files. + * @alias drive.files.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.corpora Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'default', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'default'; all other values must be used in isolation. Prefer 'default' or 'teamDrive' to 'allTeamDrives' for efficiency. + * @param {string=} params.corpus The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive items should be included in results. + * @param {integer=} params.maxResults The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. + * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * @param {string=} params.pageToken Page token for files. + * @param {string=} params.projection This parameter is deprecated and has no function. + * @param {string=} params.q Query string for searching files. + * @param {string=} params.spaces A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId ID of Team Drive to search. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.patch + * @desc Updates file metadata and/or content. This method supports patch + * semantics. + * @alias drive.files.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.addParents Comma-separated list of parent IDs to add. + * @param {boolean=} params.convert This parameter is deprecated and has no function. + * @param {string} params.fileId The ID of the file to update. + * @param {string=} params.modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. + * @param {boolean=} params.newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. + * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * @param {boolean=} params.pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. + * @param {string=} params.removeParents Comma-separated list of parent IDs to remove. + * @param {boolean=} params.setModifiedDate Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.timedTextLanguage The language of the timed text. + * @param {string=} params.timedTextTrackName The timed text track name. + * @param {boolean=} params.updateViewedDate Whether to update the view date after successfully updating the file. + * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. + * @param {().File} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.touch + * @desc Set the file's updated time to the current server time. + * @alias drive.files.touch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file to update. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + touch(params?: any, options?: MethodOptions): AxiosPromise; + touch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + touch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/touch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.trash + * @desc Moves a file to the trash. The currently authenticated user must + * own the file or be an organizer on the parent for Team Drive files. + * @alias drive.files.trash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file to trash. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + trash(params?: any, options?: MethodOptions): AxiosPromise; + trash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + trash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/trash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.untrash + * @desc Restores a file from the trash. + * @alias drive.files.untrash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file to untrash. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + untrash(params?: any, options?: MethodOptions): AxiosPromise; + untrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + untrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/untrash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.update + * @desc Updates file metadata and/or content. + * @alias drive.files.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.addParents Comma-separated list of parent IDs to add. + * @param {boolean=} params.convert This parameter is deprecated and has no function. + * @param {string} params.fileId The ID of the file to update. + * @param {string=} params.modifiedDateBehavior Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate. + * @param {boolean=} params.newRevision Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. + * @param {boolean=} params.ocr Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. + * @param {string=} params.ocrLanguage If ocr is true, hints at the language to use. Valid values are BCP 47 codes. + * @param {boolean=} params.pinned Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. + * @param {string=} params.removeParents Comma-separated list of parent IDs to remove. + * @param {boolean=} params.setModifiedDate Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.timedTextLanguage The language of the timed text. + * @param {string=} params.timedTextTrackName The timed text track name. + * @param {boolean=} params.updateViewedDate Whether to update the view date after successfully updating the file. + * @param {boolean=} params.useContentAsIndexableText Whether to use the content as indexable text. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.watch + * @desc Subscribe to changes on a file + * @alias drive.files.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. + * @param {string} params.fileId The ID for the file in question. + * @param {string=} params.projection This parameter is deprecated and has no function. + * @param {string=} params.revisionId Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.updateViewedDate Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.update - * @desc Updates a revision. - * @alias drive.revisions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID for the file. - * @param {string} params.revisionId The ID for the revision. - * @param {().Revision} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Parents { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.parents.delete + * @desc Removes a parent from a file. + * @alias drive.parents.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.parentId The ID of the parent. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'parentId'], + pathParams: ['fileId', 'parentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.parents.get + * @desc Gets a specific parent reference. + * @alias drive.parents.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.parentId The ID of the parent. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/parents/{parentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'parentId'], + pathParams: ['fileId', 'parentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.parents.insert + * @desc Adds a parent folder for a file. + * @alias drive.parents.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {().ParentReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/parents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.parents.list + * @desc Lists a file's parents. + * @alias drive.parents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/parents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Teamdrives { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; + export class Resource$Permissions { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.permissions.delete + * @desc Deletes a permission from a file or Team Drive. + * @alias drive.permissions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {string} params.permissionId The ID for the permission. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.get + * @desc Gets a permission by ID. + * @alias drive.permissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {string} params.permissionId The ID for the permission. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.getIdForEmail + * @desc Returns the permission ID for an email address. + * @alias drive.permissions.getIdForEmail + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.email The email address for which to return a permission ID + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIdForEmail(params?: any, options?: MethodOptions): + AxiosPromise; + getIdForEmail( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIdForEmail( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/permissionIds/{email}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['email'], + pathParams: ['email'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.insert + * @desc Inserts a permission for a file or Team Drive. + * @alias drive.permissions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.emailMessage A plain text custom message to include in notification emails. + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {boolean=} params.sendNotificationEmails Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {().Permission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.list + * @desc Lists a file's or Team Drive's permissions. + * @alias drive.permissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {integer=} params.maxResults The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.patch + * @desc Updates a permission using patch semantics. + * @alias drive.permissions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {string} params.permissionId The ID for the permission. + * @param {boolean=} params.removeExpiration Whether to remove the expiration date. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.transferOwnership Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {().Permission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.update + * @desc Updates a permission. + * @alias drive.permissions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file or Team Drive. + * @param {string} params.permissionId The ID for the permission. + * @param {boolean=} params.removeExpiration Whether to remove the expiration date. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.transferOwnership Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {().Permission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * drive.teamdrives.delete - * @desc Permanently deletes a Team Drive for which the user is an organizer. - * The Team Drive cannot contain any untrashed items. - * @alias drive.teamdrives.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Properties { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.properties.delete + * @desc Deletes a property. + * @alias drive.properties.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.propertyKey The key of the property. + * @param {string=} params.visibility The visibility of the property. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'propertyKey'], + pathParams: ['fileId', 'propertyKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.properties.get + * @desc Gets a property by its key. + * @alias drive.properties.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.propertyKey The key of the property. + * @param {string=} params.visibility The visibility of the property. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'propertyKey'], + pathParams: ['fileId', 'propertyKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.properties.insert + * @desc Adds a property to a file, or updates it if it already exists. + * @alias drive.properties.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {().Property} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/properties') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.properties.list + * @desc Lists a file's properties. + * @alias drive.properties.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/properties') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.properties.patch + * @desc Updates a property. This method supports patch semantics. + * @alias drive.properties.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.propertyKey The key of the property. + * @param {string=} params.visibility The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) + * @param {().Property} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'propertyKey'], + pathParams: ['fileId', 'propertyKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.properties.update + * @desc Updates a property. + * @alias drive.properties.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.propertyKey The key of the property. + * @param {string=} params.visibility The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE) + * @param {().Property} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/properties/{propertyKey}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['fileId', 'propertyKey'], + pathParams: ['fileId', 'propertyKey'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.get - * @desc Gets a Team Drive's metadata by ID. - * @alias drive.teamdrives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Realtime { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.realtime.get + * @desc Exports the contents of the Realtime API data model associated with + * this file as JSON. + * @alias drive.realtime.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file that the Realtime API data model is associated with. + * @param {integer=} params.revision The revision of the Realtime API data model to export. Revisions start at 1 (the initial empty data model) and are incremented with each change. If this parameter is excluded, the most recent data model will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/realtime') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.realtime.update + * @desc Overwrites the Realtime API data model associated with this file + * with the provided JSON data model. + * @alias drive.realtime.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.baseRevision The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server. + * @param {string} params.fileId The ID of the file that the Realtime API data model is associated with. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/realtime') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/drive/v2/files/{fileId}/realtime') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.insert - * @desc Creates a new Team Drive. - * @alias drive.teamdrives.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. - * @param {().TeamDrive} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/teamdrives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['requestId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Replies { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.replies.delete + * @desc Deletes a reply. + * @alias drive.replies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {string} params.replyId The ID of the reply. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.get + * @desc Gets a reply. + * @alias drive.replies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted If set, this will succeed when retrieving a deleted reply. + * @param {string} params.replyId The ID of the reply. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.insert + * @desc Creates a new reply to the given comment. + * @alias drive.replies.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {().CommentReply} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.list + * @desc Lists all of the replies to a comment. + * @alias drive.replies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted If set, all replies, including deleted replies (with content stripped) will be returned. + * @param {integer=} params.maxResults The maximum number of replies to include in the response, used for paging. + * @param {string=} params.pageToken The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.patch + * @desc Updates an existing reply. This method supports patch semantics. + * @alias drive.replies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {string} params.replyId The ID of the reply. + * @param {().CommentReply} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.update + * @desc Updates an existing reply. + * @alias drive.replies.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {string} params.replyId The ID of the reply. + * @param {().CommentReply} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.list - * @desc Lists the user's Team Drives. - * @alias drive.teamdrives.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of Team Drives to return. - * @param {string=} params.pageToken Page token for Team Drives. - * @param {string=} params.q Query string for searching Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/teamdrives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Revisions { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.revisions.delete + * @desc Removes a revision. + * @alias drive.revisions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.revisionId The ID of the revision. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.get + * @desc Gets a specific revision. + * @alias drive.revisions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.revisionId The ID of the revision. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.list + * @desc Lists a file's revisions. + * @alias drive.revisions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {integer=} params.maxResults Maximum number of revisions to return. + * @param {string=} params.pageToken Page token for revisions. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/revisions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.patch + * @desc Updates a revision. This method supports patch semantics. + * @alias drive.revisions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file. + * @param {string} params.revisionId The ID for the revision. + * @param {().Revision} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.update + * @desc Updates a revision. + * @alias drive.revisions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID for the file. + * @param {string} params.revisionId The ID for the revision. + * @param {().Revision} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.update - * @desc Updates a Team Drive's metadata - * @alias drive.teamdrives.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {().TeamDrive} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Teamdrives { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.teamdrives.delete + * @desc Permanently deletes a Team Drive for which the user is an + * organizer. The Team Drive cannot contain any untrashed items. + * @alias drive.teamdrives.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.get + * @desc Gets a Team Drive's metadata by ID. + * @alias drive.teamdrives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.insert + * @desc Creates a new Team Drive. + * @alias drive.teamdrives.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + * @param {().TeamDrive} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/teamdrives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['requestId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.list + * @desc Lists the user's Team Drives. + * @alias drive.teamdrives.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of Team Drives to return. + * @param {string=} params.pageToken Page token for Team Drives. + * @param {string=} params.q Query string for searching Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/teamdrives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.update + * @desc Updates a Team Drive's metadata + * @alias drive.teamdrives.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {().TeamDrive} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v2/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/drive/v3.ts b/src/apis/drive/v3.ts index ddd97ca19ee..677d65252f2 100644 --- a/src/apis/drive/v3.ts +++ b/src/apis/drive/v3.ts @@ -27,3236 +27,3261 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Drive API - * - * Manages files in Drive including uploading, downloading, searching, detecting - * changes, and updating sharing permissions. - * - * @example - * const google = require('googleapis'); - * const drive = google.drive('v3'); - * - * @namespace drive - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Drive - */ -export class Drive { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - about: Resource$About; - changes: Resource$Changes; - channels: Resource$Channels; - comments: Resource$Comments; - files: Resource$Files; - permissions: Resource$Permissions; - replies: Resource$Replies; - revisions: Resource$Revisions; - teamdrives: Resource$Teamdrives; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.about = new Resource$About(this); - this.changes = new Resource$Changes(this); - this.channels = new Resource$Channels(this); - this.comments = new Resource$Comments(this); - this.files = new Resource$Files(this); - this.permissions = new Resource$Permissions(this); - this.replies = new Resource$Replies(this); - this.revisions = new Resource$Revisions(this); - this.teamdrives = new Resource$Teamdrives(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Information about the user, the user's Drive, and system capabilities. - */ -export interface Schema$About { - /** - * Whether the user has installed the requesting app. - */ - appInstalled: boolean; - /** - * Whether the user can create Team Drives. - */ - canCreateTeamDrives: boolean; - /** - * A map of source MIME type to possible targets for all supported exports. - */ - exportFormats: any; - /** - * The currently supported folder colors as RGB hex strings. - */ - folderColorPalette: string[]; - /** - * A map of source MIME type to possible targets for all supported imports. - */ - importFormats: any; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#about". - */ - kind: string; - /** - * A map of maximum import sizes by MIME type, in bytes. - */ - maxImportSizes: any; - /** - * The maximum upload size in bytes. - */ - maxUploadSize: string; - /** - * The user's storage quota limits and usage. All fields are measured in - * bytes. - */ - storageQuota: any; - /** - * A list of themes that are supported for Team Drives. - */ - teamDriveThemes: any[]; - /** - * The authenticated user. - */ - user: Schema$User; -} -/** - * A change to a file or Team Drive. - */ -export interface Schema$Change { - /** - * The updated state of the file. Present if the type is file and the file has - * not been removed from this list of changes. - */ - file: Schema$File; - /** - * The ID of the file which has changed. - */ - fileId: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#change". - */ - kind: string; - /** - * Whether the file or Team Drive has been removed from this list of changes, - * for example by deletion or loss of access. - */ - removed: boolean; - /** - * The updated state of the Team Drive. Present if the type is teamDrive, the - * user is still a member of the Team Drive, and the Team Drive has not been - * removed. - */ - teamDrive: Schema$TeamDrive; - /** - * The ID of the Team Drive associated with this change. - */ - teamDriveId: string; - /** - * The time of this change (RFC 3339 date-time). - */ - time: string; - /** - * The type of the change. Possible values are file and teamDrive. - */ - type: string; -} -/** - * A list of changes for a user. - */ -export interface Schema$ChangeList { - /** - * The list of changes. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - changes: Schema$Change[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#changeList". - */ - kind: string; - /** - * The starting page token for future changes. This will be present only if - * the end of the current changes list has been reached. - */ - newStartPageToken: string; - /** - * The page token for the next page of changes. This will be absent if the end - * of the changes list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * A comment on a file. - */ -export interface Schema$Comment { - /** - * A region of the document represented as a JSON string. See anchor - * documentation for details on how to define and interpret anchor properties. - */ - anchor: string; - /** - * The user who created the comment. - */ - author: Schema$User; - /** - * The plain text content of the comment. This field is used for setting the - * content, while htmlContent should be displayed. - */ - content: string; - /** - * The time at which the comment was created (RFC 3339 date-time). - */ - createdTime: string; - /** - * Whether the comment has been deleted. A deleted comment has no content. - */ - deleted: boolean; - /** - * The content of the comment with HTML formatting. - */ - htmlContent: string; - /** - * The ID of the comment. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#comment". - */ - kind: string; - /** - * The last time the comment or any of its replies was modified (RFC 3339 - * date-time). - */ - modifiedTime: string; - /** - * The file content to which the comment refers, typically within the anchor - * region. For a text file, for example, this would be the text at the - * location of the comment. - */ - quotedFileContent: any; - /** - * The full list of replies to the comment in chronological order. - */ - replies: Schema$Reply[]; - /** - * Whether the comment has been resolved by one of its replies. - */ - resolved: boolean; -} -/** - * A list of comments on a file. - */ -export interface Schema$CommentList { - /** - * The list of comments. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - comments: Schema$Comment[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#commentList". - */ - kind: string; - /** - * The page token for the next page of comments. This will be absent if the - * end of the comments list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; -} -/** - * The metadata for a file. - */ -export interface Schema$File { - /** - * A collection of arbitrary key-value pairs which are private to the - * requesting app. Entries with null values are cleared in update and copy - * requests. - */ - appProperties: any; - /** - * Capabilities the current user has on this file. Each capability corresponds - * to a fine-grained action that a user may take. - */ - capabilities: any; - /** - * Additional information about the content of the file. These fields are - * never populated in responses. - */ - contentHints: any; - /** - * The time at which the file was created (RFC 3339 date-time). - */ - createdTime: string; - /** - * A short description of the file. - */ - description: string; - /** - * Whether the file has been explicitly trashed, as opposed to recursively - * trashed from a parent folder. - */ - explicitlyTrashed: boolean; - /** - * The final component of fullFileExtension. This is only available for files - * with binary content in Drive. - */ - fileExtension: string; - /** - * The color for a folder as an RGB hex string. The supported colors are - * published in the folderColorPalette field of the About resource. If an - * unsupported color is specified, the closest color in the palette will be - * used instead. - */ - folderColorRgb: string; - /** - * The full file extension extracted from the name field. May contain multiple - * concatenated extensions, such as "tar.gz". This is only available - * for files with binary content in Drive. This is automatically updated when - * the name field changes, however it is not cleared if the new name does not - * contain a valid extension. - */ - fullFileExtension: string; - /** - * Whether any users are granted file access directly on this file. This field - * is only populated for Team Drive files. - */ - hasAugmentedPermissions: boolean; - /** - * Whether this file has a thumbnail. This does not indicate whether the - * requesting app has access to the thumbnail. To check access, look for the - * presence of the thumbnailLink field. - */ - hasThumbnail: boolean; - /** - * The ID of the file's head revision. This is currently only available - * for files with binary content in Drive. - */ - headRevisionId: string; - /** - * A static, unauthenticated link to the file's icon. - */ - iconLink: string; - /** - * The ID of the file. - */ - id: string; - /** - * Additional metadata about image media, if available. - */ - imageMediaMetadata: any; - /** - * Whether the file was created or opened by the requesting app. - */ - isAppAuthorized: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#file". - */ - kind: string; - /** - * The last user to modify the file. - */ - lastModifyingUser: Schema$User; - /** - * The MD5 checksum for the content of the file. This is only applicable to - * files with binary content in Drive. - */ - md5Checksum: string; - /** - * The MIME type of the file. Drive will attempt to automatically detect an - * appropriate value from uploaded content if no value is provided. The value - * cannot be changed unless a new revision is uploaded. If a file is created - * with a Google Doc MIME type, the uploaded content will be imported if - * possible. The supported import formats are published in the About resource. - */ - mimeType: string; - /** - * Whether the file has been modified by this user. - */ - modifiedByMe: boolean; - /** - * The last time the file was modified by the user (RFC 3339 date-time). - */ - modifiedByMeTime: string; - /** - * The last time the file was modified by anyone (RFC 3339 date-time). Note - * that setting modifiedTime will also update modifiedByMeTime for the user. - */ - modifiedTime: string; - /** - * The name of the file. This is not necessarily unique within a folder. Note - * that for immutable items such as the top level folders of Team Drives, My - * Drive root folder, and Application Data folder the name is constant. - */ - name: string; - /** - * The original filename of the uploaded content if available, or else the - * original value of the name field. This is only available for files with - * binary content in Drive. - */ - originalFilename: string; - /** - * Whether the user owns the file. Not populated for Team Drive files. - */ - ownedByMe: boolean; - /** - * The owners of the file. Currently, only certain legacy files may have more - * than one owner. Not populated for Team Drive files. - */ - owners: Schema$User[]; - /** - * The IDs of the parent folders which contain the file. If not specified as - * part of a create request, the file will be placed directly in the - * user's My Drive folder. If not specified as part of a copy request, the - * file will inherit any discoverable parents of the source file. Update - * requests must use the addParents and removeParents parameters to modify the - * parents list. - */ - parents: string[]; - /** - * List of permission IDs for users with access to this file. - */ - permissionIds: string[]; - /** - * The full list of permissions for the file. This is only available if the - * requesting user can share the file. Not populated for Team Drive files. - */ - permissions: Schema$Permission[]; - /** - * A collection of arbitrary key-value pairs which are visible to all apps. - * Entries with null values are cleared in update and copy requests. - */ - properties: any; - /** - * The number of storage quota bytes used by the file. This includes the head - * revision as well as previous revisions with keepForever enabled. - */ - quotaBytesUsed: string; - /** - * Whether the file has been shared. Not populated for Team Drive files. - */ - shared: boolean; - /** - * The time at which the file was shared with the user, if applicable (RFC - * 3339 date-time). - */ - sharedWithMeTime: string; - /** - * The user who shared the file with the requesting user, if applicable. - */ - sharingUser: Schema$User; - /** - * The size of the file's content in bytes. This is only applicable to - * files with binary content in Drive. - */ - size: string; - /** - * The list of spaces which contain the file. The currently supported values - * are 'drive', 'appDataFolder' and 'photos'. - */ - spaces: string[]; - /** - * Whether the user has starred the file. - */ - starred: boolean; - /** - * ID of the Team Drive the file resides in. - */ - teamDriveId: string; - /** - * A short-lived link to the file's thumbnail, if available. Typically - * lasts on the order of hours. Only populated when the requesting app can - * access the file's content. - */ - thumbnailLink: string; - /** - * The thumbnail version for use in thumbnail cache invalidation. - */ - thumbnailVersion: string; - /** - * Whether the file has been trashed, either explicitly or from a trashed - * parent folder. Only the owner may trash a file, and other users cannot see - * files in the owner's trash. - */ - trashed: boolean; - /** - * The time that the item was trashed (RFC 3339 date-time). Only populated for - * Team Drive files. - */ - trashedTime: string; - /** - * If the file has been explicitly trashed, the user who trashed it. Only - * populated for Team Drive files. - */ - trashingUser: Schema$User; - /** - * A monotonically increasing version number for the file. This reflects every - * change made to the file on the server, even those not visible to the user. - */ - version: string; - /** - * Additional metadata about video media. This may not be available - * immediately upon upload. - */ - videoMediaMetadata: any; - /** - * Whether the file has been viewed by this user. - */ - viewedByMe: boolean; - /** - * The last time the file was viewed by the user (RFC 3339 date-time). - */ - viewedByMeTime: string; - /** - * Whether users with only reader or commenter permission can copy the - * file's content. This affects copy, download, and print operations. - */ - viewersCanCopyContent: boolean; - /** - * A link for downloading the content of the file in a browser. This is only - * available for files with binary content in Drive. - */ - webContentLink: string; - /** - * A link for opening the file in a relevant Google editor or viewer in a - * browser. - */ - webViewLink: string; - /** - * Whether users with only writer permission can modify the file's - * permissions. Not populated for Team Drive files. - */ - writersCanShare: boolean; -} -/** - * A list of files. - */ -export interface Schema$FileList { - /** - * The list of files. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - files: Schema$File[]; - /** - * Whether the search process was incomplete. If true, then some search - * results may be missing, since all documents were not searched. This may - * occur when searching multiple Team Drives with the - * "user,allTeamDrives" corpora, but all corpora could not be - * searched. When this happens, it is suggested that clients narrow their - * query by choosing a different corpus such as "user" or - * "teamDrive". - */ - incompleteSearch: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#fileList". - */ - kind: string; - /** - * The page token for the next page of files. This will be absent if the end - * of the files list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; -} -/** - * A list of generated file IDs which can be provided in create requests. - */ -export interface Schema$GeneratedIds { - /** - * The IDs generated for the requesting user in the specified space. - */ - ids: string[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#generatedIds". - */ - kind: string; - /** - * The type of file that can be created with these IDs. - */ - space: string; -} -/** - * A permission for a file. A permission grants a user, group, domain or the - * world access to a file or a folder hierarchy. - */ -export interface Schema$Permission { - /** - * Whether the permission allows the file to be discovered through search. - * This is only applicable for permissions of type domain or anyone. - */ - allowFileDiscovery: boolean; - /** - * Whether the account associated with this permission has been deleted. This - * field only pertains to user and group permissions. - */ - deleted: boolean; - /** - * A displayable name for users, groups or domains. - */ - displayName: string; - /** - * The domain to which this permission refers. - */ - domain: string; - /** - * The email address of the user or group to which this permission refers. - */ - emailAddress: string; - /** - * The time at which this permission will expire (RFC 3339 date-time). - * Expiration times have the following restrictions: - They can only be set - * on user and group permissions - The time must be in the future - The time - * cannot be more than a year in the future - */ - expirationTime: string; - /** - * The ID of this permission. This is a unique identifier for the grantee, and - * is published in User resources as permissionId. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#permission". - */ - kind: string; - /** - * A link to the user's profile photo, if available. - */ - photoLink: string; - /** - * The role granted by this permission. While new values may be supported in - * the future, the following are currently allowed: - organizer - owner - - * writer - commenter - reader - */ - role: string; - /** - * Details of whether the permissions on this Team Drive item are inherited or - * directly on this item. This is an output-only field which is present only - * for Team Drive items. - */ - teamDrivePermissionDetails: any[]; - /** - * The type of the grantee. Valid values are: - user - group - domain - - * anyone - */ - type: string; -} -/** - * A list of permissions for a file. - */ -export interface Schema$PermissionList { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#permissionList". - */ - kind: string; - /** - * The page token for the next page of permissions. This field will be absent - * if the end of the permissions list has been reached. If the token is - * rejected for any reason, it should be discarded, and pagination should be - * restarted from the first page of results. - */ - nextPageToken: string; - /** - * The list of permissions. If nextPageToken is populated, then this list may - * be incomplete and an additional page of results should be fetched. - */ - permissions: Schema$Permission[]; -} -/** - * A reply to a comment on a file. - */ -export interface Schema$Reply { - /** - * The action the reply performed to the parent comment. Valid values are: - - * resolve - reopen - */ - action: string; - /** - * The user who created the reply. - */ - author: Schema$User; - /** - * The plain text content of the reply. This field is used for setting the - * content, while htmlContent should be displayed. This is required on creates - * if no action is specified. - */ - content: string; - /** - * The time at which the reply was created (RFC 3339 date-time). - */ - createdTime: string; - /** - * Whether the reply has been deleted. A deleted reply has no content. - */ - deleted: boolean; - /** - * The content of the reply with HTML formatting. - */ - htmlContent: string; - /** - * The ID of the reply. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#reply". - */ - kind: string; - /** - * The last time the reply was modified (RFC 3339 date-time). - */ - modifiedTime: string; -} -/** - * A list of replies to a comment on a file. - */ -export interface Schema$ReplyList { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#replyList". - */ - kind: string; - /** - * The page token for the next page of replies. This will be absent if the end - * of the replies list has been reached. If the token is rejected for any - * reason, it should be discarded, and pagination should be restarted from the - * first page of results. - */ - nextPageToken: string; - /** - * The list of replies. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - replies: Schema$Reply[]; -} -/** - * The metadata for a revision to a file. - */ -export interface Schema$Revision { - /** - * The ID of the revision. - */ - id: string; - /** - * Whether to keep this revision forever, even if it is no longer the head - * revision. If not set, the revision will be automatically purged 30 days - * after newer content is uploaded. This can be set on a maximum of 200 - * revisions for a file. This field is only applicable to files with binary - * content in Drive. - */ - keepForever: boolean; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#revision". - */ - kind: string; - /** - * The last user to modify this revision. - */ - lastModifyingUser: Schema$User; - /** - * The MD5 checksum of the revision's content. This is only applicable to - * files with binary content in Drive. - */ - md5Checksum: string; - /** - * The MIME type of the revision. - */ - mimeType: string; - /** - * The last time the revision was modified (RFC 3339 date-time). - */ - modifiedTime: string; - /** - * The original filename used to create this revision. This is only applicable - * to files with binary content in Drive. - */ - originalFilename: string; - /** - * Whether subsequent revisions will be automatically republished. This is - * only applicable to Google Docs. - */ - publishAuto: boolean; - /** - * Whether this revision is published. This is only applicable to Google Docs. - */ - published: boolean; - /** - * Whether this revision is published outside the domain. This is only - * applicable to Google Docs. - */ - publishedOutsideDomain: boolean; - /** - * The size of the revision's content in bytes. This is only applicable to - * files with binary content in Drive. - */ - size: string; -} -/** - * A list of revisions of a file. - */ -export interface Schema$RevisionList { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#revisionList". - */ - kind: string; - /** - * The page token for the next page of revisions. This will be absent if the - * end of the revisions list has been reached. If the token is rejected for - * any reason, it should be discarded, and pagination should be restarted from - * the first page of results. - */ - nextPageToken: string; - /** - * The list of revisions. If nextPageToken is populated, then this list may be - * incomplete and an additional page of results should be fetched. - */ - revisions: Schema$Revision[]; -} -export interface Schema$StartPageToken { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#startPageToken". - */ - kind: string; - /** - * The starting page token for listing changes. - */ - startPageToken: string; -} -/** - * Representation of a Team Drive. - */ -export interface Schema$TeamDrive { - /** - * An image file and cropping parameters from which a background image for - * this Team Drive is set. This is a write only field; it can only be set on - * drive.teamdrives.update requests that don't set themeId. When - * specified, all fields of the backgroundImageFile must be set. - */ - backgroundImageFile: any; - /** - * A short-lived link to this Team Drive's background image. - */ - backgroundImageLink: string; - /** - * Capabilities the current user has on this Team Drive. - */ - capabilities: any; - /** - * The color of this Team Drive as an RGB hex string. It can only be set on a - * drive.teamdrives.update request that does not set themeId. - */ - colorRgb: string; - /** - * The time at which the Team Drive was created (RFC 3339 date-time). - */ - createdTime: string; - /** - * The ID of this Team Drive which is also the ID of the top level folder for - * this Team Drive. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#teamDrive". - */ - kind: string; - /** - * The name of this Team Drive. - */ - name: string; - /** - * The ID of the theme from which the background image and color will be set. - * The set of possible teamDriveThemes can be retrieved from a drive.about.get - * response. When not specified on a drive.teamdrives.create request, a random - * theme is chosen from which the background image and color are set. This is - * a write-only field; it can only be set on requests that don't set - * colorRgb or backgroundImageFile. - */ - themeId: string; -} -/** - * A list of Team Drives. - */ -export interface Schema$TeamDriveList { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#teamDriveList". - */ - kind: string; - /** - * The page token for the next page of Team Drives. This will be absent if the - * end of the Team Drives list has been reached. If the token is rejected for - * any reason, it should be discarded, and pagination should be restarted from - * the first page of results. - */ - nextPageToken: string; - /** - * The list of Team Drives. If nextPageToken is populated, then this list may - * be incomplete and an additional page of results should be fetched. - */ - teamDrives: Schema$TeamDrive[]; -} -/** - * Information about a Drive user. - */ -export interface Schema$User { - /** - * A plain text displayable name for this user. - */ - displayName: string; - /** - * The email address of the user. This may not be present in certain contexts - * if the user has not made their email address visible to the requester. - */ - emailAddress: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "drive#user". - */ - kind: string; - /** - * Whether this user is the requesting user. - */ - me: boolean; - /** - * The user's ID as visible in Permission resources. - */ - permissionId: string; - /** - * A link to the user's profile photo, if available. - */ - photoLink: string; -} - -export class Resource$About { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.about.get - * @desc Gets information about the user, the user's Drive, and system - * capabilities. - * @alias drive.about.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/about').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Changes { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.changes.getStartPageToken - * @desc Gets the starting pageToken for listing future changes. - * @alias drive.changes.getStartPageToken - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getStartPageToken(params?: any, options?: MethodOptions): - AxiosPromise; - getStartPageToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getStartPageToken( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/changes/startPageToken') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.changes.list - * @desc Lists the changes for a user or Team Drive. - * @alias drive.changes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. - * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. - * @param {integer=} params.pageSize The maximum number of changes to return per page. - * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. - * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/changes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['pageToken'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.changes.watch - * @desc Subscribes to changes for a user. - * @alias drive.changes.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. - * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. - * @param {integer=} params.pageSize The maximum number of changes to return per page. - * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. - * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/changes/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['pageToken'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.channels.stop - * @desc Stop watching resources through this channel - * @alias drive.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Comments { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.comments.create - * @desc Creates a new comment on a file. - * @alias drive.comments.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.delete - * @desc Deletes a comment. - * @alias drive.comments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace drive_v3 { /** - * drive.comments.get - * @desc Gets a comment by ID. - * @alias drive.comments.get - * @memberOf! () + * Drive API * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted Whether to return deleted comments. Deleted comments will not include their original content. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.list - * @desc Lists a file's comments. - * @alias drive.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted Whether to include deleted comments. Deleted comments will not include their original content. - * @param {integer=} params.pageSize The maximum number of comments to return per page. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {string=} params.startModifiedTime The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * drive.comments.update - * @desc Updates a comment with patch semantics. - * @alias drive.comments.update - * @memberOf! () + * Manages files in Drive including uploading, downloading, searching, + * detecting changes, and updating sharing permissions. * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Files { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * drive.files.copy - * @desc Creates a copy of a file and applies any requested updates with patch - * semantics. - * @alias drive.files.copy - * @memberOf! () + * @example + * const google = require('googleapis'); + * const drive = google.drive('v3'); * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. - * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. - * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {().File} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/copy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace drive + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Drive + */ + export class Drive { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + about: Resource$About; + changes: Resource$Changes; + channels: Resource$Channels; + comments: Resource$Comments; + files: Resource$Files; + permissions: Resource$Permissions; + replies: Resource$Replies; + revisions: Resource$Revisions; + teamdrives: Resource$Teamdrives; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.about = new Resource$About(this); + this.changes = new Resource$Changes(this); + this.channels = new Resource$Channels(this); + this.comments = new Resource$Comments(this); + this.files = new Resource$Files(this); + this.permissions = new Resource$Permissions(this); + this.replies = new Resource$Replies(this); + this.revisions = new Resource$Revisions(this); + this.teamdrives = new Resource$Teamdrives(this); + } + + getRoot() { + return this.root; } } - /** - * drive.files.create - * @desc Creates a new file. - * @alias drive.files.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. - * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. - * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + '/upload/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Information about the user, the user's Drive, and system capabilities. + */ + export interface Schema$About { + /** + * Whether the user has installed the requesting app. + */ + appInstalled: boolean; + /** + * Whether the user can create Team Drives. + */ + canCreateTeamDrives: boolean; + /** + * A map of source MIME type to possible targets for all supported exports. + */ + exportFormats: any; + /** + * The currently supported folder colors as RGB hex strings. + */ + folderColorPalette: string[]; + /** + * A map of source MIME type to possible targets for all supported imports. + */ + importFormats: any; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#about". + */ + kind: string; + /** + * A map of maximum import sizes by MIME type, in bytes. + */ + maxImportSizes: any; + /** + * The maximum upload size in bytes. + */ + maxUploadSize: string; + /** + * The user's storage quota limits and usage. All fields are measured in + * bytes. + */ + storageQuota: any; + /** + * A list of themes that are supported for Team Drives. + */ + teamDriveThemes: any[]; + /** + * The authenticated user. + */ + user: Schema$User; } - - /** - * drive.files.delete - * @desc Permanently deletes a file owned by the user without moving it to the - * trash. If the file belongs to a Team Drive the user must be an organizer on - * the parent. If the target is a folder, all descendants owned by the user - * are also deleted. - * @alias drive.files.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A change to a file or Team Drive. + */ + export interface Schema$Change { + /** + * The updated state of the file. Present if the type is file and the file + * has not been removed from this list of changes. + */ + file: Schema$File; + /** + * The ID of the file which has changed. + */ + fileId: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#change". + */ + kind: string; + /** + * Whether the file or Team Drive has been removed from this list of + * changes, for example by deletion or loss of access. + */ + removed: boolean; + /** + * The updated state of the Team Drive. Present if the type is teamDrive, + * the user is still a member of the Team Drive, and the Team Drive has not + * been removed. + */ + teamDrive: Schema$TeamDrive; + /** + * The ID of the Team Drive associated with this change. + */ + teamDriveId: string; + /** + * The time of this change (RFC 3339 date-time). + */ + time: string; + /** + * The type of the change. Possible values are file and teamDrive. + */ + type: string; } - - /** - * drive.files.emptyTrash - * @desc Permanently deletes all of the user's trashed files. - * @alias drive.files.emptyTrash - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - emptyTrash(params?: any, options?: MethodOptions): AxiosPromise; - emptyTrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - emptyTrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/trash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of changes for a user. + */ + export interface Schema$ChangeList { + /** + * The list of changes. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + changes: Schema$Change[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#changeList". + */ + kind: string; + /** + * The starting page token for future changes. This will be present only if + * the end of the current changes list has been reached. + */ + newStartPageToken: string; + /** + * The page token for the next page of changes. This will be absent if the + * end of the changes list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; } - - /** - * drive.files.export - * @desc Exports a Google Doc to the requested MIME type and returns the - * exported content. Please note that the exported content is limited to 10MB. - * @alias drive.files.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.mimeType The MIME type of the format requested for this export. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): AxiosPromise; - export( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'mimeType'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; } - - /** - * drive.files.generateIds - * @desc Generates a set of file IDs which can be provided in create requests. - * @alias drive.files.generateIds - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.count The number of IDs to return. - * @param {string=} params.space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateIds(params?: any, options?: MethodOptions): - AxiosPromise; - generateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - generateIds( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/generateIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A comment on a file. + */ + export interface Schema$Comment { + /** + * A region of the document represented as a JSON string. See anchor + * documentation for details on how to define and interpret anchor + * properties. + */ + anchor: string; + /** + * The user who created the comment. + */ + author: Schema$User; + /** + * The plain text content of the comment. This field is used for setting the + * content, while htmlContent should be displayed. + */ + content: string; + /** + * The time at which the comment was created (RFC 3339 date-time). + */ + createdTime: string; + /** + * Whether the comment has been deleted. A deleted comment has no content. + */ + deleted: boolean; + /** + * The content of the comment with HTML formatting. + */ + htmlContent: string; + /** + * The ID of the comment. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#comment". + */ + kind: string; + /** + * The last time the comment or any of its replies was modified (RFC 3339 + * date-time). + */ + modifiedTime: string; + /** + * The file content to which the comment refers, typically within the anchor + * region. For a text file, for example, this would be the text at the + * location of the comment. + */ + quotedFileContent: any; + /** + * The full list of replies to the comment in chronological order. + */ + replies: Schema$Reply[]; + /** + * Whether the comment has been resolved by one of its replies. + */ + resolved: boolean; } - - /** - * drive.files.get - * @desc Gets a file's metadata or content by ID. - * @alias drive.files.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of comments on a file. + */ + export interface Schema$CommentList { + /** + * The list of comments. If nextPageToken is populated, then this list may + * be incomplete and an additional page of results should be fetched. + */ + comments: Schema$Comment[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#commentList". + */ + kind: string; + /** + * The page token for the next page of comments. This will be absent if the + * end of the comments list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; } - - /** - * drive.files.list - * @desc Lists or searches files. - * @alias drive.files.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.corpora Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to 'allTeamDrives' for efficiency. - * @param {string=} params.corpus The source of files to list. Deprecated: use 'corpora' instead. - * @param {boolean=} params.includeTeamDriveItems Whether Team Drive items should be included in results. - * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. - * @param {integer=} params.pageSize The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {string=} params.q A query for filtering the file results. See the "Search for Files" guide for supported syntax. - * @param {string=} params.spaces A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {string=} params.teamDriveId ID of Team Drive to search. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The metadata for a file. + */ + export interface Schema$File { + /** + * A collection of arbitrary key-value pairs which are private to the + * requesting app. Entries with null values are cleared in update and copy + * requests. + */ + appProperties: any; + /** + * Capabilities the current user has on this file. Each capability + * corresponds to a fine-grained action that a user may take. + */ + capabilities: any; + /** + * Additional information about the content of the file. These fields are + * never populated in responses. + */ + contentHints: any; + /** + * The time at which the file was created (RFC 3339 date-time). + */ + createdTime: string; + /** + * A short description of the file. + */ + description: string; + /** + * Whether the file has been explicitly trashed, as opposed to recursively + * trashed from a parent folder. + */ + explicitlyTrashed: boolean; + /** + * The final component of fullFileExtension. This is only available for + * files with binary content in Drive. + */ + fileExtension: string; + /** + * The color for a folder as an RGB hex string. The supported colors are + * published in the folderColorPalette field of the About resource. If an + * unsupported color is specified, the closest color in the palette will be + * used instead. + */ + folderColorRgb: string; + /** + * The full file extension extracted from the name field. May contain + * multiple concatenated extensions, such as "tar.gz". This is + * only available for files with binary content in Drive. This is + * automatically updated when the name field changes, however it is not + * cleared if the new name does not contain a valid extension. + */ + fullFileExtension: string; + /** + * Whether any users are granted file access directly on this file. This + * field is only populated for Team Drive files. + */ + hasAugmentedPermissions: boolean; + /** + * Whether this file has a thumbnail. This does not indicate whether the + * requesting app has access to the thumbnail. To check access, look for the + * presence of the thumbnailLink field. + */ + hasThumbnail: boolean; + /** + * The ID of the file's head revision. This is currently only available + * for files with binary content in Drive. + */ + headRevisionId: string; + /** + * A static, unauthenticated link to the file's icon. + */ + iconLink: string; + /** + * The ID of the file. + */ + id: string; + /** + * Additional metadata about image media, if available. + */ + imageMediaMetadata: any; + /** + * Whether the file was created or opened by the requesting app. + */ + isAppAuthorized: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#file". + */ + kind: string; + /** + * The last user to modify the file. + */ + lastModifyingUser: Schema$User; + /** + * The MD5 checksum for the content of the file. This is only applicable to + * files with binary content in Drive. + */ + md5Checksum: string; + /** + * The MIME type of the file. Drive will attempt to automatically detect an + * appropriate value from uploaded content if no value is provided. The + * value cannot be changed unless a new revision is uploaded. If a file is + * created with a Google Doc MIME type, the uploaded content will be + * imported if possible. The supported import formats are published in the + * About resource. + */ + mimeType: string; + /** + * Whether the file has been modified by this user. + */ + modifiedByMe: boolean; + /** + * The last time the file was modified by the user (RFC 3339 date-time). + */ + modifiedByMeTime: string; + /** + * The last time the file was modified by anyone (RFC 3339 date-time). Note + * that setting modifiedTime will also update modifiedByMeTime for the user. + */ + modifiedTime: string; + /** + * The name of the file. This is not necessarily unique within a folder. + * Note that for immutable items such as the top level folders of Team + * Drives, My Drive root folder, and Application Data folder the name is + * constant. + */ + name: string; + /** + * The original filename of the uploaded content if available, or else the + * original value of the name field. This is only available for files with + * binary content in Drive. + */ + originalFilename: string; + /** + * Whether the user owns the file. Not populated for Team Drive files. + */ + ownedByMe: boolean; + /** + * The owners of the file. Currently, only certain legacy files may have + * more than one owner. Not populated for Team Drive files. + */ + owners: Schema$User[]; + /** + * The IDs of the parent folders which contain the file. If not specified as + * part of a create request, the file will be placed directly in the + * user's My Drive folder. If not specified as part of a copy request, + * the file will inherit any discoverable parents of the source file. Update + * requests must use the addParents and removeParents parameters to modify + * the parents list. + */ + parents: string[]; + /** + * List of permission IDs for users with access to this file. + */ + permissionIds: string[]; + /** + * The full list of permissions for the file. This is only available if the + * requesting user can share the file. Not populated for Team Drive files. + */ + permissions: Schema$Permission[]; + /** + * A collection of arbitrary key-value pairs which are visible to all apps. + * Entries with null values are cleared in update and copy requests. + */ + properties: any; + /** + * The number of storage quota bytes used by the file. This includes the + * head revision as well as previous revisions with keepForever enabled. + */ + quotaBytesUsed: string; + /** + * Whether the file has been shared. Not populated for Team Drive files. + */ + shared: boolean; + /** + * The time at which the file was shared with the user, if applicable (RFC + * 3339 date-time). + */ + sharedWithMeTime: string; + /** + * The user who shared the file with the requesting user, if applicable. + */ + sharingUser: Schema$User; + /** + * The size of the file's content in bytes. This is only applicable to + * files with binary content in Drive. + */ + size: string; + /** + * The list of spaces which contain the file. The currently supported values + * are 'drive', 'appDataFolder' and 'photos'. + */ + spaces: string[]; + /** + * Whether the user has starred the file. + */ + starred: boolean; + /** + * ID of the Team Drive the file resides in. + */ + teamDriveId: string; + /** + * A short-lived link to the file's thumbnail, if available. Typically + * lasts on the order of hours. Only populated when the requesting app can + * access the file's content. + */ + thumbnailLink: string; + /** + * The thumbnail version for use in thumbnail cache invalidation. + */ + thumbnailVersion: string; + /** + * Whether the file has been trashed, either explicitly or from a trashed + * parent folder. Only the owner may trash a file, and other users cannot + * see files in the owner's trash. + */ + trashed: boolean; + /** + * The time that the item was trashed (RFC 3339 date-time). Only populated + * for Team Drive files. + */ + trashedTime: string; + /** + * If the file has been explicitly trashed, the user who trashed it. Only + * populated for Team Drive files. + */ + trashingUser: Schema$User; + /** + * A monotonically increasing version number for the file. This reflects + * every change made to the file on the server, even those not visible to + * the user. + */ + version: string; + /** + * Additional metadata about video media. This may not be available + * immediately upon upload. + */ + videoMediaMetadata: any; + /** + * Whether the file has been viewed by this user. + */ + viewedByMe: boolean; + /** + * The last time the file was viewed by the user (RFC 3339 date-time). + */ + viewedByMeTime: string; + /** + * Whether users with only reader or commenter permission can copy the + * file's content. This affects copy, download, and print operations. + */ + viewersCanCopyContent: boolean; + /** + * A link for downloading the content of the file in a browser. This is only + * available for files with binary content in Drive. + */ + webContentLink: string; + /** + * A link for opening the file in a relevant Google editor or viewer in a + * browser. + */ + webViewLink: string; + /** + * Whether users with only writer permission can modify the file's + * permissions. Not populated for Team Drive files. + */ + writersCanShare: boolean; } - - /** - * drive.files.update - * @desc Updates a file's metadata and/or content with patch semantics. - * @alias drive.files.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.addParents A comma-separated list of parent IDs to add. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. - * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). - * @param {string=} params.removeParents A comma-separated list of parent IDs to remove. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/drive/v3/files/{fileId}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of files. + */ + export interface Schema$FileList { + /** + * The list of files. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + files: Schema$File[]; + /** + * Whether the search process was incomplete. If true, then some search + * results may be missing, since all documents were not searched. This may + * occur when searching multiple Team Drives with the + * "user,allTeamDrives" corpora, but all corpora could not be + * searched. When this happens, it is suggested that clients narrow their + * query by choosing a different corpus such as "user" or + * "teamDrive". + */ + incompleteSearch: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#fileList". + */ + kind: string; + /** + * The page token for the next page of files. This will be absent if the end + * of the files list has been reached. If the token is rejected for any + * reason, it should be discarded, and pagination should be restarted from + * the first page of results. + */ + nextPageToken: string; } - - /** - * drive.files.watch - * @desc Subscribes to changes to a file - * @alias drive.files.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Permissions { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * A list of generated file IDs which can be provided in create requests. + */ + export interface Schema$GeneratedIds { + /** + * The IDs generated for the requesting user in the specified space. + */ + ids: string[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#generatedIds". + */ + kind: string; + /** + * The type of file that can be created with these IDs. + */ + space: string; } - - /** - * drive.permissions.create - * @desc Creates a permission for a file or Team Drive. - * @alias drive.permissions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.emailMessage A plain text custom message to include in the notification email. - * @param {string} params.fileId The ID of the file or Team Drive. - * @param {boolean=} params.sendNotificationEmail Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {().Permission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A permission for a file. A permission grants a user, group, domain or the + * world access to a file or a folder hierarchy. + */ + export interface Schema$Permission { + /** + * Whether the permission allows the file to be discovered through search. + * This is only applicable for permissions of type domain or anyone. + */ + allowFileDiscovery: boolean; + /** + * Whether the account associated with this permission has been deleted. + * This field only pertains to user and group permissions. + */ + deleted: boolean; + /** + * A displayable name for users, groups or domains. + */ + displayName: string; + /** + * The domain to which this permission refers. + */ + domain: string; + /** + * The email address of the user or group to which this permission refers. + */ + emailAddress: string; + /** + * The time at which this permission will expire (RFC 3339 date-time). + * Expiration times have the following restrictions: - They can only be + * set on user and group permissions - The time must be in the future - + * The time cannot be more than a year in the future + */ + expirationTime: string; + /** + * The ID of this permission. This is a unique identifier for the grantee, + * and is published in User resources as permissionId. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#permission". + */ + kind: string; + /** + * A link to the user's profile photo, if available. + */ + photoLink: string; + /** + * The role granted by this permission. While new values may be supported in + * the future, the following are currently allowed: - organizer - owner + * - writer - commenter - reader + */ + role: string; + /** + * Details of whether the permissions on this Team Drive item are inherited + * or directly on this item. This is an output-only field which is present + * only for Team Drive items. + */ + teamDrivePermissionDetails: any[]; + /** + * The type of the grantee. Valid values are: - user - group - domain - + * anyone + */ + type: string; } - - /** - * drive.permissions.delete - * @desc Deletes a permission. - * @alias drive.permissions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file or Team Drive. - * @param {string} params.permissionId The ID of the permission. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v3/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of permissions for a file. + */ + export interface Schema$PermissionList { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#permissionList". + */ + kind: string; + /** + * The page token for the next page of permissions. This field will be + * absent if the end of the permissions list has been reached. If the token + * is rejected for any reason, it should be discarded, and pagination should + * be restarted from the first page of results. + */ + nextPageToken: string; + /** + * The list of permissions. If nextPageToken is populated, then this list + * may be incomplete and an additional page of results should be fetched. + */ + permissions: Schema$Permission[]; } - - /** - * drive.permissions.get - * @desc Gets a permission by ID. - * @alias drive.permissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.permissionId The ID of the permission. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v3/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A reply to a comment on a file. + */ + export interface Schema$Reply { + /** + * The action the reply performed to the parent comment. Valid values are: + * - resolve - reopen + */ + action: string; + /** + * The user who created the reply. + */ + author: Schema$User; + /** + * The plain text content of the reply. This field is used for setting the + * content, while htmlContent should be displayed. This is required on + * creates if no action is specified. + */ + content: string; + /** + * The time at which the reply was created (RFC 3339 date-time). + */ + createdTime: string; + /** + * Whether the reply has been deleted. A deleted reply has no content. + */ + deleted: boolean; + /** + * The content of the reply with HTML formatting. + */ + htmlContent: string; + /** + * The ID of the reply. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#reply". + */ + kind: string; + /** + * The last time the reply was modified (RFC 3339 date-time). + */ + modifiedTime: string; } - - /** - * drive.permissions.list - * @desc Lists a file's or Team Drive's permissions. - * @alias drive.permissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file or Team Drive. - * @param {integer=} params.pageSize The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of replies to a comment on a file. + */ + export interface Schema$ReplyList { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#replyList". + */ + kind: string; + /** + * The page token for the next page of replies. This will be absent if the + * end of the replies list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * The list of replies. If nextPageToken is populated, then this list may be + * incomplete and an additional page of results should be fetched. + */ + replies: Schema$Reply[]; } - - /** - * drive.permissions.update - * @desc Updates a permission with patch semantics. - * @alias drive.permissions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file or Team Drive. - * @param {string} params.permissionId The ID of the permission. - * @param {boolean=} params.removeExpiration Whether to remove the expiration date. - * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. - * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. - * @param {().Permission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v3/files/{fileId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'permissionId'], - pathParams: ['fileId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Replies { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * The metadata for a revision to a file. + */ + export interface Schema$Revision { + /** + * The ID of the revision. + */ + id: string; + /** + * Whether to keep this revision forever, even if it is no longer the head + * revision. If not set, the revision will be automatically purged 30 days + * after newer content is uploaded. This can be set on a maximum of 200 + * revisions for a file. This field is only applicable to files with binary + * content in Drive. + */ + keepForever: boolean; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#revision". + */ + kind: string; + /** + * The last user to modify this revision. + */ + lastModifyingUser: Schema$User; + /** + * The MD5 checksum of the revision's content. This is only applicable + * to files with binary content in Drive. + */ + md5Checksum: string; + /** + * The MIME type of the revision. + */ + mimeType: string; + /** + * The last time the revision was modified (RFC 3339 date-time). + */ + modifiedTime: string; + /** + * The original filename used to create this revision. This is only + * applicable to files with binary content in Drive. + */ + originalFilename: string; + /** + * Whether subsequent revisions will be automatically republished. This is + * only applicable to Google Docs. + */ + publishAuto: boolean; + /** + * Whether this revision is published. This is only applicable to Google + * Docs. + */ + published: boolean; + /** + * Whether this revision is published outside the domain. This is only + * applicable to Google Docs. + */ + publishedOutsideDomain: boolean; + /** + * The size of the revision's content in bytes. This is only applicable + * to files with binary content in Drive. + */ + size: string; } - - /** - * drive.replies.create - * @desc Creates a new reply to a comment. - * @alias drive.replies.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {().Reply} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v3/files/{fileId}/comments/{commentId}/replies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of revisions of a file. + */ + export interface Schema$RevisionList { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#revisionList". + */ + kind: string; + /** + * The page token for the next page of revisions. This will be absent if the + * end of the revisions list has been reached. If the token is rejected for + * any reason, it should be discarded, and pagination should be restarted + * from the first page of results. + */ + nextPageToken: string; + /** + * The list of revisions. If nextPageToken is populated, then this list may + * be incomplete and an additional page of results should be fetched. + */ + revisions: Schema$Revision[]; } - - - /** - * drive.replies.delete - * @desc Deletes a reply. - * @alias drive.replies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {string} params.replyId The ID of the reply. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$StartPageToken { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#startPageToken". + */ + kind: string; + /** + * The starting page token for listing changes. + */ + startPageToken: string; } - - /** - * drive.replies.get - * @desc Gets a reply by ID. - * @alias drive.replies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted Whether to return deleted replies. Deleted replies will not include their original content. - * @param {string} params.replyId The ID of the reply. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Representation of a Team Drive. + */ + export interface Schema$TeamDrive { + /** + * An image file and cropping parameters from which a background image for + * this Team Drive is set. This is a write only field; it can only be set on + * drive.teamdrives.update requests that don't set themeId. When + * specified, all fields of the backgroundImageFile must be set. + */ + backgroundImageFile: any; + /** + * A short-lived link to this Team Drive's background image. + */ + backgroundImageLink: string; + /** + * Capabilities the current user has on this Team Drive. + */ + capabilities: any; + /** + * The color of this Team Drive as an RGB hex string. It can only be set on + * a drive.teamdrives.update request that does not set themeId. + */ + colorRgb: string; + /** + * The time at which the Team Drive was created (RFC 3339 date-time). + */ + createdTime: string; + /** + * The ID of this Team Drive which is also the ID of the top level folder + * for this Team Drive. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#teamDrive". + */ + kind: string; + /** + * The name of this Team Drive. + */ + name: string; + /** + * The ID of the theme from which the background image and color will be + * set. The set of possible teamDriveThemes can be retrieved from a + * drive.about.get response. When not specified on a drive.teamdrives.create + * request, a random theme is chosen from which the background image and + * color are set. This is a write-only field; it can only be set on requests + * that don't set colorRgb or backgroundImageFile. + */ + themeId: string; } - - /** - * drive.replies.list - * @desc Lists a comment's replies. - * @alias drive.replies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {boolean=} params.includeDeleted Whether to include deleted replies. Deleted replies will not include their original content. - * @param {integer=} params.pageSize The maximum number of replies to return per page. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/drive/v3/files/{fileId}/comments/{commentId}/replies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'commentId'], - pathParams: ['commentId', 'fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of Team Drives. + */ + export interface Schema$TeamDriveList { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#teamDriveList". + */ + kind: string; + /** + * The page token for the next page of Team Drives. This will be absent if + * the end of the Team Drives list has been reached. If the token is + * rejected for any reason, it should be discarded, and pagination should be + * restarted from the first page of results. + */ + nextPageToken: string; + /** + * The list of Team Drives. If nextPageToken is populated, then this list + * may be incomplete and an additional page of results should be fetched. + */ + teamDrives: Schema$TeamDrive[]; } - - /** - * drive.replies.update - * @desc Updates a reply with patch semantics. - * @alias drive.replies.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment. - * @param {string} params.fileId The ID of the file. - * @param {string} params.replyId The ID of the reply. - * @param {().Reply} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'commentId', 'replyId'], - pathParams: ['commentId', 'fileId', 'replyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Information about a Drive user. + */ + export interface Schema$User { + /** + * A plain text displayable name for this user. + */ + displayName: string; + /** + * The email address of the user. This may not be present in certain + * contexts if the user has not made their email address visible to the + * requester. + */ + emailAddress: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "drive#user". + */ + kind: string; + /** + * Whether this user is the requesting user. + */ + me: boolean; + /** + * The user's ID as visible in Permission resources. + */ + permissionId: string; + /** + * A link to the user's profile photo, if available. + */ + photoLink: string; } -} - -export class Resource$Revisions { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * drive.revisions.delete - * @desc Permanently deletes a revision. This method is only applicable to - * files with binary content in Drive. - * @alias drive.revisions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.revisionId The ID of the revision. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$About { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.about.get + * @desc Gets information about the user, the user's Drive, and system + * capabilities. + * @alias drive.about.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/about').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.get - * @desc Gets a revision's metadata or content by ID. - * @alias drive.revisions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. - * @param {string} params.fileId The ID of the file. - * @param {string} params.revisionId The ID of the revision. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Changes { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.changes.getStartPageToken + * @desc Gets the starting pageToken for listing future changes. + * @alias drive.changes.getStartPageToken + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getStartPageToken(params?: any, options?: MethodOptions): + AxiosPromise; + getStartPageToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getStartPageToken( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/changes/startPageToken') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.changes.list + * @desc Lists the changes for a user or Team Drive. + * @alias drive.changes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. + * @param {integer=} params.pageSize The maximum number of changes to return per page. + * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. + * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/drive/v3/changes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['pageToken'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.changes.watch + * @desc Subscribes to changes for a user. + * @alias drive.changes.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeCorpusRemovals Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + * @param {boolean=} params.includeRemoved Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive files or changes should be included in results. + * @param {integer=} params.pageSize The maximum number of changes to return per page. + * @param {string} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + * @param {boolean=} params.restrictToMyDrive Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. + * @param {string=} params.spaces A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/changes/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['pageToken'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.list - * @desc Lists a file's revisions. - * @alias drive.revisions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {integer=} params.pageSize The maximum number of revisions to return per page. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/revisions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['fileId'], - pathParams: ['fileId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Channels { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.channels.stop + * @desc Stop watching resources through this channel + * @alias drive.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.revisions.update - * @desc Updates a revision with patch semantics. - * @alias drive.revisions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.fileId The ID of the file. - * @param {string} params.revisionId The ID of the revision. - * @param {().Revision} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Comments { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.comments.create + * @desc Creates a new comment on a file. + * @alias drive.comments.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.delete + * @desc Deletes a comment. + * @alias drive.comments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.get + * @desc Gets a comment by ID. + * @alias drive.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted Whether to return deleted comments. Deleted comments will not include their original content. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.list + * @desc Lists a file's comments. + * @alias drive.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted Whether to include deleted comments. Deleted comments will not include their original content. + * @param {integer=} params.pageSize The maximum number of comments to return per page. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {string=} params.startModifiedTime The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.comments.update + * @desc Updates a comment with patch semantics. + * @alias drive.comments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['fileId', 'revisionId'], - pathParams: ['fileId', 'revisionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Teamdrives { - root: Drive; - constructor(root: Drive) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; - } - - - /** - * drive.teamdrives.create - * @desc Creates a new Team Drive. - * @alias drive.teamdrives.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. - * @param {().TeamDrive} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/teamdrives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['requestId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Files { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.files.copy + * @desc Creates a copy of a file and applies any requested updates with + * patch semantics. + * @alias drive.files.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. + * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {().File} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/copy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.create + * @desc Creates a new file. + * @alias drive.files.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.ignoreDefaultVisibility Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. + * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + '/upload/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.delete + * @desc Permanently deletes a file owned by the user without moving it to + * the trash. If the file belongs to a Team Drive the user must be an + * organizer on the parent. If the target is a folder, all descendants owned + * by the user are also deleted. + * @alias drive.files.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.emptyTrash + * @desc Permanently deletes all of the user's trashed files. + * @alias drive.files.emptyTrash + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + emptyTrash(params?: any, options?: MethodOptions): AxiosPromise; + emptyTrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + emptyTrash( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/trash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.export + * @desc Exports a Google Doc to the requested MIME type and returns the + * exported content. Please note that the exported content is limited to + * 10MB. + * @alias drive.files.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.mimeType The MIME type of the format requested for this export. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): AxiosPromise; + export( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'mimeType'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.generateIds + * @desc Generates a set of file IDs which can be provided in create + * requests. + * @alias drive.files.generateIds + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.count The number of IDs to return. + * @param {string=} params.space The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateIds(params?: any, options?: MethodOptions): + AxiosPromise; + generateIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + generateIds( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/generateIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.get + * @desc Gets a file's metadata or content by ID. + * @alias drive.files.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.list + * @desc Lists or searches files. + * @alias drive.files.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.corpora Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to 'allTeamDrives' for efficiency. + * @param {string=} params.corpus The source of files to list. Deprecated: use 'corpora' instead. + * @param {boolean=} params.includeTeamDriveItems Whether Team Drive items should be included in results. + * @param {string=} params.orderBy A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored. + * @param {integer=} params.pageSize The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {string=} params.q A query for filtering the file results. See the "Search for Files" guide for supported syntax. + * @param {string=} params.spaces A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {string=} params.teamDriveId ID of Team Drive to search. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.update + * @desc Updates a file's metadata and/or content with patch semantics. + * @alias drive.files.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.addParents A comma-separated list of parent IDs to add. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.keepRevisionForever Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. + * @param {string=} params.ocrLanguage A language hint for OCR processing during image import (ISO 639-1 code). + * @param {string=} params.removeParents A comma-separated list of parent IDs to remove. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useContentAsIndexableText Whether to use the uploaded content as indexable text. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/drive/v3/files/{fileId}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.files.watch + * @desc Subscribes to changes to a file + * @alias drive.files.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.delete - * @desc Permanently deletes a Team Drive for which the user is an organizer. - * The Team Drive cannot contain any untrashed items. - * @alias drive.teamdrives.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Permissions { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.permissions.create + * @desc Creates a permission for a file or Team Drive. + * @alias drive.permissions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.emailMessage A plain text custom message to include in the notification email. + * @param {string} params.fileId The ID of the file or Team Drive. + * @param {boolean=} params.sendNotificationEmail Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {().Permission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.delete + * @desc Deletes a permission. + * @alias drive.permissions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file or Team Drive. + * @param {string} params.permissionId The ID of the permission. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v3/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.get + * @desc Gets a permission by ID. + * @alias drive.permissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.permissionId The ID of the permission. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v3/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.list + * @desc Lists a file's or Team Drive's permissions. + * @alias drive.permissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file or Team Drive. + * @param {integer=} params.pageSize The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.permissions.update + * @desc Updates a permission with patch semantics. + * @alias drive.permissions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file or Team Drive. + * @param {string} params.permissionId The ID of the permission. + * @param {boolean=} params.removeExpiration Whether to remove the expiration date. + * @param {boolean=} params.supportsTeamDrives Whether the requesting application supports Team Drives. + * @param {boolean=} params.transferOwnership Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the item belongs. + * @param {().Permission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v3/files/{fileId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'permissionId'], + pathParams: ['fileId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.get - * @desc Gets a Team Drive's metadata by ID. - * @alias drive.teamdrives.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Replies { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.replies.create + * @desc Creates a new reply to a comment. + * @alias drive.replies.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {().Reply} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v3/files/{fileId}/comments/{commentId}/replies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.delete + * @desc Deletes a reply. + * @alias drive.replies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {string} params.replyId The ID of the reply. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.get + * @desc Gets a reply by ID. + * @alias drive.replies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted Whether to return deleted replies. Deleted replies will not include their original content. + * @param {string} params.replyId The ID of the reply. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.list + * @desc Lists a comment's replies. + * @alias drive.replies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {boolean=} params.includeDeleted Whether to include deleted replies. Deleted replies will not include their original content. + * @param {integer=} params.pageSize The maximum number of replies to return per page. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/drive/v3/files/{fileId}/comments/{commentId}/replies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'commentId'], + pathParams: ['commentId', 'fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.replies.update + * @desc Updates a reply with patch semantics. + * @alias drive.replies.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment. + * @param {string} params.fileId The ID of the file. + * @param {string} params.replyId The ID of the reply. + * @param {().Reply} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'commentId', 'replyId'], + pathParams: ['commentId', 'fileId', 'replyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.list - * @desc Lists the user's Team Drives. - * @alias drive.teamdrives.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.pageSize Maximum number of Team Drives to return. - * @param {string=} params.pageToken Page token for Team Drives. - * @param {string=} params.q Query string for searching Team Drives. - * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/teamdrives') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Revisions { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.revisions.delete + * @desc Permanently deletes a revision. This method is only applicable to + * files with binary content in Drive. + * @alias drive.revisions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.revisionId The ID of the revision. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.get + * @desc Gets a revision's metadata or content by ID. + * @alias drive.revisions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.acknowledgeAbuse Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + * @param {string} params.fileId The ID of the file. + * @param {string} params.revisionId The ID of the revision. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.list + * @desc Lists a file's revisions. + * @alias drive.revisions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {integer=} params.pageSize The maximum number of revisions to return per page. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/revisions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['fileId'], + pathParams: ['fileId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.revisions.update + * @desc Updates a revision with patch semantics. + * @alias drive.revisions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.fileId The ID of the file. + * @param {string} params.revisionId The ID of the revision. + * @param {().Revision} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/files/{fileId}/revisions/{revisionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['fileId', 'revisionId'], + pathParams: ['fileId', 'revisionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * drive.teamdrives.update - * @desc Updates a Team Drive's metadata - * @alias drive.teamdrives.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.teamDriveId The ID of the Team Drive - * @param {().TeamDrive} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['teamDriveId'], - pathParams: ['teamDriveId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Teamdrives { + root: Drive; + constructor(root: Drive) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * drive.teamdrives.create + * @desc Creates a new Team Drive. + * @alias drive.teamdrives.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.requestId An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + * @param {().TeamDrive} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/teamdrives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['requestId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.delete + * @desc Permanently deletes a Team Drive for which the user is an + * organizer. The Team Drive cannot contain any untrashed items. + * @alias drive.teamdrives.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.get + * @desc Gets a Team Drive's metadata by ID. + * @alias drive.teamdrives.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.list + * @desc Lists the user's Team Drives. + * @alias drive.teamdrives.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.pageSize Maximum number of Team Drives to return. + * @param {string=} params.pageToken Page token for Team Drives. + * @param {string=} params.q Query string for searching Team Drives. + * @param {boolean=} params.useDomainAdminAccess Whether the request should be treated as if it was issued by a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/teamdrives') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * drive.teamdrives.update + * @desc Updates a Team Drive's metadata + * @alias drive.teamdrives.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.teamDriveId The ID of the Team Drive + * @param {().TeamDrive} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/drive/v3/teamdrives/{teamDriveId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['teamDriveId'], + pathParams: ['teamDriveId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/firebasedynamiclinks/v1.ts b/src/apis/firebasedynamiclinks/v1.ts index 43a1d61df10..7555ba35a69 100644 --- a/src/apis/firebasedynamiclinks/v1.ts +++ b/src/apis/firebasedynamiclinks/v1.ts @@ -27,873 +27,881 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Firebase Dynamic Links API - * - * Programmatically creates and manages Firebase Dynamic Links. - * - * @example - * const google = require('googleapis'); - * const firebasedynamiclinks = google.firebasedynamiclinks('v1'); - * - * @namespace firebasedynamiclinks - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Firebasedynamiclinks - */ -export class Firebasedynamiclinks { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace firebasedynamiclinks_v1 { + /** + * Firebase Dynamic Links API + * + * Programmatically creates and manages Firebase Dynamic Links. + * + * @example + * const google = require('googleapis'); + * const firebasedynamiclinks = google.firebasedynamiclinks('v1'); + * + * @namespace firebasedynamiclinks + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Firebasedynamiclinks + */ + export class Firebasedynamiclinks { + _options: GlobalOptions; + google: GoogleApis; + root = this; - managedShortLinks: Resource$Managedshortlinks; - shortLinks: Resource$Shortlinks; - v1: Resource$V1; + managedShortLinks: Resource$Managedshortlinks; + shortLinks: Resource$Shortlinks; + v1: Resource$V1; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.managedShortLinks = new Resource$Managedshortlinks(this); - this.shortLinks = new Resource$Shortlinks(this); - this.v1 = new Resource$V1(this); - } + this.managedShortLinks = new Resource$Managedshortlinks(this); + this.shortLinks = new Resource$Shortlinks(this); + this.v1 = new Resource$V1(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Tracking parameters supported by Dynamic Link. - */ -export interface Schema$AnalyticsInfo { - /** - * Google Play Campaign Measurements. - */ - googlePlayAnalytics: Schema$GooglePlayAnalytics; - /** - * iTunes Connect App Analytics. - */ - itunesConnectAnalytics: Schema$ITunesConnectAnalytics; -} -/** - * Android related attributes to the Dynamic Link. - */ -export interface Schema$AndroidInfo { - /** - * Link to open on Android if the app is not installed. - */ - androidFallbackLink: string; - /** - * If specified, this overrides the ‘link’ parameter on Android. - */ - androidLink: string; - /** - * Minimum version code for the Android app. If the installed app’s version - * code is lower, then the user is taken to the Play Store. - */ - androidMinPackageVersionCode: string; - /** - * Android package name of the app. - */ - androidPackageName: string; -} -/** - * Request to create a managed Short Dynamic Link. - */ -export interface Schema$CreateManagedShortLinkRequest { - /** - * Information about the Dynamic Link to be shortened. [Learn - * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). - */ - dynamicLinkInfo: Schema$DynamicLinkInfo; - /** - * Full long Dynamic Link URL with desired query parameters specified. For - * example, - * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", - * [Learn - * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). - */ - longDynamicLink: string; /** - * Link name to associate with the link. It's used for marketer to - * identify manually-created links in the Firebase console - * (https://console.firebase.google.com/). Links must be named to be tracked. - */ - name: string; - /** - * Short Dynamic Link suffix. Optional. - */ - suffix: Schema$Suffix; -} -/** - * Response to create a short Dynamic Link. - */ -export interface Schema$CreateManagedShortLinkResponse { - /** - * Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz - */ - managedShortLink: Schema$ManagedShortLink; - /** - * Preview link to show the link flow chart. (debug info.) - */ - previewLink: string; - /** - * Information about potential warnings on link creation. - */ - warning: Schema$DynamicLinkWarning[]; -} -/** - * Request to create a short Dynamic Link. - */ -export interface Schema$CreateShortDynamicLinkRequest { - /** - * Information about the Dynamic Link to be shortened. [Learn - * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). - */ - dynamicLinkInfo: Schema$DynamicLinkInfo; - /** - * Full long Dynamic Link URL with desired query parameters specified. For - * example, - * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", - * [Learn - * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). - */ - longDynamicLink: string; - /** - * Short Dynamic Link suffix. Optional. - */ - suffix: Schema$Suffix; -} -/** - * Response to create a short Dynamic Link. - */ -export interface Schema$CreateShortDynamicLinkResponse { - /** - * Preview link to show the link flow chart. (debug info.) - */ - previewLink: string; - /** - * Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz - */ - shortLink: string; - /** - * Information about potential warnings on link creation. - */ - warning: Schema$DynamicLinkWarning[]; -} -/** - * Desktop related attributes to the Dynamic Link. - */ -export interface Schema$DesktopInfo { - /** - * Link to open on desktop. - */ - desktopFallbackLink: string; -} -/** - * Signals associated with the device making the request. - */ -export interface Schema$DeviceInfo { + * Tracking parameters supported by Dynamic Link. + */ + export interface Schema$AnalyticsInfo { + /** + * Google Play Campaign Measurements. + */ + googlePlayAnalytics: Schema$GooglePlayAnalytics; + /** + * iTunes Connect App Analytics. + */ + itunesConnectAnalytics: Schema$ITunesConnectAnalytics; + } /** - * Device model name. - */ - deviceModelName: string; + * Android related attributes to the Dynamic Link. + */ + export interface Schema$AndroidInfo { + /** + * Link to open on Android if the app is not installed. + */ + androidFallbackLink: string; + /** + * If specified, this overrides the ‘link’ parameter on Android. + */ + androidLink: string; + /** + * Minimum version code for the Android app. If the installed app’s version + * code is lower, then the user is taken to the Play Store. + */ + androidMinPackageVersionCode: string; + /** + * Android package name of the app. + */ + androidPackageName: string; + } /** - * Device language code setting. - */ - languageCode: string; + * Request to create a managed Short Dynamic Link. + */ + export interface Schema$CreateManagedShortLinkRequest { + /** + * Information about the Dynamic Link to be shortened. [Learn + * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). + */ + dynamicLinkInfo: Schema$DynamicLinkInfo; + /** + * Full long Dynamic Link URL with desired query parameters specified. For + * example, + * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", + * [Learn + * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). + */ + longDynamicLink: string; + /** + * Link name to associate with the link. It's used for marketer to + * identify manually-created links in the Firebase console + * (https://console.firebase.google.com/). Links must be named to be + * tracked. + */ + name: string; + /** + * Short Dynamic Link suffix. Optional. + */ + suffix: Schema$Suffix; + } /** - * Device language code setting obtained by executing JavaScript code in - * WebView. - */ - languageCodeFromWebview: string; + * Response to create a short Dynamic Link. + */ + export interface Schema$CreateManagedShortLinkResponse { + /** + * Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz + */ + managedShortLink: Schema$ManagedShortLink; + /** + * Preview link to show the link flow chart. (debug info.) + */ + previewLink: string; + /** + * Information about potential warnings on link creation. + */ + warning: Schema$DynamicLinkWarning[]; + } /** - * Device language code raw setting. iOS does returns language code in - * different format than iOS WebView. For example WebView returns en_US, but - * iOS returns en-US. Field below will return raw value returned by iOS. - */ - languageCodeRaw: string; + * Request to create a short Dynamic Link. + */ + export interface Schema$CreateShortDynamicLinkRequest { + /** + * Information about the Dynamic Link to be shortened. [Learn + * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). + */ + dynamicLinkInfo: Schema$DynamicLinkInfo; + /** + * Full long Dynamic Link URL with desired query parameters specified. For + * example, + * "https://sample.app.goo.gl/?link=http://www.google.com&apn=com.sample", + * [Learn + * more](https://firebase.google.com/docs/reference/dynamic-links/link-shortener). + */ + longDynamicLink: string; + /** + * Short Dynamic Link suffix. Optional. + */ + suffix: Schema$Suffix; + } /** - * Device display resolution height. - */ - screenResolutionHeight: string; + * Response to create a short Dynamic Link. + */ + export interface Schema$CreateShortDynamicLinkResponse { + /** + * Preview link to show the link flow chart. (debug info.) + */ + previewLink: string; + /** + * Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz + */ + shortLink: string; + /** + * Information about potential warnings on link creation. + */ + warning: Schema$DynamicLinkWarning[]; + } /** - * Device display resolution width. + * Desktop related attributes to the Dynamic Link. */ - screenResolutionWidth: string; + export interface Schema$DesktopInfo { + /** + * Link to open on desktop. + */ + desktopFallbackLink: string; + } /** - * Device timezone setting. - */ - timezone: string; -} -/** - * Dynamic Link event stat. - */ -export interface Schema$DynamicLinkEventStat { + * Signals associated with the device making the request. + */ + export interface Schema$DeviceInfo { + /** + * Device model name. + */ + deviceModelName: string; + /** + * Device language code setting. + */ + languageCode: string; + /** + * Device language code setting obtained by executing JavaScript code in + * WebView. + */ + languageCodeFromWebview: string; + /** + * Device language code raw setting. iOS does returns language code in + * different format than iOS WebView. For example WebView returns en_US, but + * iOS returns en-US. Field below will return raw value returned by iOS. + */ + languageCodeRaw: string; + /** + * Device display resolution height. + */ + screenResolutionHeight: string; + /** + * Device display resolution width. + */ + screenResolutionWidth: string; + /** + * Device timezone setting. + */ + timezone: string; + } /** - * The number of times this event occurred. - */ - count: string; + * Dynamic Link event stat. + */ + export interface Schema$DynamicLinkEventStat { + /** + * The number of times this event occurred. + */ + count: string; + /** + * Link event. + */ + event: string; + /** + * Requested platform. + */ + platform: string; + } /** - * Link event. - */ - event: string; + * Information about a Dynamic Link. + */ + export interface Schema$DynamicLinkInfo { + /** + * Parameters used for tracking. See all tracking parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + analyticsInfo: Schema$AnalyticsInfo; + /** + * Android related information. See Android related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + androidInfo: Schema$AndroidInfo; + /** + * Desktop related information. See desktop related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + desktopInfo: Schema$DesktopInfo; + /** + * E.g. https://maps.app.goo.gl, https://maps.page.link, https://g.co/maps + * More examples can be found in description of getNormalizedUriPrefix in + * j/c/g/firebase/dynamiclinks/uri/DdlDomain.java + */ + domainUriPrefix: string; + /** + * Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl [Learn + * more](https://firebase.google.com/docs/dynamic-links/android/receive) on + * how to set up Dynamic Link domain associated with your Firebase project. + * Required. + */ + dynamicLinkDomain: string; + /** + * iOS related information. See iOS related parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + */ + iosInfo: Schema$IosInfo; + /** + * The link your app will open, You can specify any URL your app can handle. + * This link must be a well-formatted URL, be properly URL-encoded, and use + * the HTTP or HTTPS scheme. See 'link' parameters in the + * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). + * Required. + */ + link: string; + /** + * Information of navigation behavior of a Firebase Dynamic Links. + */ + navigationInfo: Schema$NavigationInfo; + /** + * Parameters for social meta tag params. Used to set meta tag data for link + * previews on social sites. + */ + socialMetaTagInfo: Schema$SocialMetaTagInfo; + } /** - * Requested platform. + * Analytics stats of a Dynamic Link for a given timeframe. */ - platform: string; -} -/** - * Information about a Dynamic Link. - */ -export interface Schema$DynamicLinkInfo { + export interface Schema$DynamicLinkStats { + /** + * Dynamic Link event stats. + */ + linkEventStats: Schema$DynamicLinkEventStat[]; + } /** - * Parameters used for tracking. See all tracking parameters in the - * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - */ - analyticsInfo: Schema$AnalyticsInfo; + * Dynamic Links warning messages. + */ + export interface Schema$DynamicLinkWarning { + /** + * The warning code. + */ + warningCode: string; + /** + * The document describing the warning, and helps resolve. + */ + warningDocumentLink: string; + /** + * The warning message to help developers improve their requests. + */ + warningMessage: string; + } /** - * Android related information. See Android related parameters in the - * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - */ - androidInfo: Schema$AndroidInfo; + * Request for iSDK to execute strong match flow for post-install attribution. + * This is meant for iOS requests only. Requests from other platforms will not + * be honored. + */ + export interface Schema$GetIosPostInstallAttributionRequest { + /** + * App installation epoch time (https://en.wikipedia.org/wiki/Unix_time). + * This is a client signal for a more accurate weak match. + */ + appInstallationTime: string; + /** + * APP bundle ID. + */ + bundleId: string; + /** + * Device information. + */ + device: Schema$DeviceInfo; + /** + * iOS version, ie: 9.3.5. Consider adding "build". + */ + iosVersion: string; + /** + * App post install attribution retrieval information. Disambiguates + * mechanism (iSDK or developer invoked) to retrieve payload from clicked + * link. + */ + retrievalMethod: string; + /** + * Google SDK version. + */ + sdkVersion: string; + /** + * Possible unique matched link that server need to check before performing + * fingerprint match. If passed link is short server need to expand the + * link. If link is long server need to vslidate the link. + */ + uniqueMatchLinkToCheck: string; + /** + * Strong match page information. Disambiguates between default UI and + * custom page to present when strong match succeeds/fails to find cookie. + */ + visualStyle: string; + } /** - * Desktop related information. See desktop related parameters in the - * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - */ - desktopInfo: Schema$DesktopInfo; + * Response for iSDK to execute strong match flow for post-install + * attribution. + */ + export interface Schema$GetIosPostInstallAttributionResponse { + /** + * The minimum version for app, specified by dev through ?imv= parameter. + * Return to iSDK to allow app to evaluate if current version meets this. + */ + appMinimumVersion: string; + /** + * The confidence of the returned attribution. + */ + attributionConfidence: string; + /** + * The deep-link attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + deepLink: string; + /** + * User-agent specific custom-scheme URIs for iSDK to open. This will be set + * according to the user-agent tha the click was originally made in. There + * is no Safari-equivalent custom-scheme open URLs. ie: + * googlechrome://www.example.com ie: + * firefox://open-url?url=http://www.example.com ie: + * opera-http://example.com + */ + externalBrowserDestinationLink: string; + /** + * The link to navigate to update the app if min version is not met. This is + * either (in order): 1) fallback link (from ?ifl= parameter, if specified + * by developer) or 2) AppStore URL (from ?isi= parameter, if specified), or + * 3) the payload link (from required link= parameter). + */ + fallbackLink: string; + /** + * Invitation ID attributed post-install via one of several techniques + * (fingerprint, copy unique). + */ + invitationId: string; + /** + * Instruction for iSDK to attemmpt to perform strong match. For instance, + * if browser does not support/allow cookie or outside of support browsers, + * this will be false. + */ + isStrongMatchExecutable: boolean; + /** + * Describes why match failed, ie: "discarded due to low + * confidence". This message will be publicly visible. + */ + matchMessage: string; + /** + * Entire FDL (short or long) attributed post-install via one of several + * techniques (fingerprint, copy unique). + */ + requestedLink: string; + /** + * The entire FDL, expanded from a short link. It is the same as the + * requested_link, if it is long. Parameters from this should not be used + * directly (ie: server can default utm_[campaign|medium|source] to a value + * when requested_link lack them, server determine the best fallback_link + * when requested_link specifies >1 fallback links). + */ + resolvedLink: string; + /** + * Scion campaign value to be propagated by iSDK to Scion at post-install. + */ + utmCampaign: string; + /** + * Scion medium value to be propagated by iSDK to Scion at post-install. + */ + utmMedium: string; + /** + * Scion source value to be propagated by iSDK to Scion at post-install. + */ + utmSource: string; + } /** - * E.g. https://maps.app.goo.gl, https://maps.page.link, https://g.co/maps - * More examples can be found in description of getNormalizedUriPrefix in - * j/c/g/firebase/dynamiclinks/uri/DdlDomain.java - */ - domainUriPrefix: string; + * Parameters for Google Play Campaign Measurements. [Learn + * more](https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#campaign-params) + */ + export interface Schema$GooglePlayAnalytics { + /** + * [AdWords autotagging + * parameter](https://support.google.com/analytics/answer/1033981?hl=en); + * used to measure Google AdWords ads. This value is generated dynamically + * and should never be modified. + */ + gclid: string; + /** + * Campaign name; used for keyword analysis to identify a specific product + * promotion or strategic campaign. + */ + utmCampaign: string; + /** + * Campaign content; used for A/B testing and content-targeted ads to + * differentiate ads or links that point to the same URL. + */ + utmContent: string; + /** + * Campaign medium; used to identify a medium such as email or + * cost-per-click. + */ + utmMedium: string; + /** + * Campaign source; used to identify a search engine, newsletter, or other + * source. + */ + utmSource: string; + /** + * Campaign term; used with paid search to supply the keywords for ads. + */ + utmTerm: string; + } /** - * Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl [Learn - * more](https://firebase.google.com/docs/dynamic-links/android/receive) on - * how to set up Dynamic Link domain associated with your Firebase project. - * Required. - */ - dynamicLinkDomain: string; + * iOS related attributes to the Dynamic Link.. + */ + export interface Schema$IosInfo { + /** + * iOS App Store ID. + */ + iosAppStoreId: string; + /** + * iOS bundle ID of the app. + */ + iosBundleId: string; + /** + * Custom (destination) scheme to use for iOS. By default, we’ll use the + * bundle ID as the custom scheme. Developer can override this behavior + * using this param. + */ + iosCustomScheme: string; + /** + * Link to open on iOS if the app is not installed. + */ + iosFallbackLink: string; + /** + * iPad bundle ID of the app. + */ + iosIpadBundleId: string; + /** + * If specified, this overrides the ios_fallback_link value on iPads. + */ + iosIpadFallbackLink: string; + } /** - * iOS related information. See iOS related parameters in the - * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - */ - iosInfo: Schema$IosInfo; + * Parameters for iTunes Connect App Analytics. + */ + export interface Schema$ITunesConnectAnalytics { + /** + * Affiliate token used to create affiliate-coded links. + */ + at: string; + /** + * Campaign text that developers can optionally add to any link in order to + * track sales from a specific marketing campaign. + */ + ct: string; + /** + * iTune media types, including music, podcasts, audiobooks and so on. + */ + mt: string; + /** + * Provider token that enables analytics for Dynamic Links from within + * iTunes Connect. + */ + pt: string; + } /** - * The link your app will open, You can specify any URL your app can handle. - * This link must be a well-formatted URL, be properly URL-encoded, and use - * the HTTP or HTTPS scheme. See 'link' parameters in the - * [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). - * Required. - */ - link: string; + * Managed Short Link. + */ + export interface Schema$ManagedShortLink { + /** + * Creation timestamp of the short link. + */ + creationTime: string; + /** + * Attributes that have been flagged about this short url. + */ + flaggedAttribute: string[]; + /** + * Full Dyamic Link info + */ + info: Schema$DynamicLinkInfo; + /** + * Short durable link url, for example, + * "https://sample.app.goo.gl/xyz123". Required. + */ + link: string; + /** + * Link name defined by the creator. Required. + */ + linkName: string; + /** + * Visibility status of link. + */ + visibility: string; + } /** - * Information of navigation behavior of a Firebase Dynamic Links. + * Information of navigation behavior. */ - navigationInfo: Schema$NavigationInfo; + export interface Schema$NavigationInfo { + /** + * If this option is on, FDL click will be forced to redirect rather than + * show an interstitial page. + */ + enableForcedRedirect: boolean; + } /** * Parameters for social meta tag params. Used to set meta tag data for link * previews on social sites. */ - socialMetaTagInfo: Schema$SocialMetaTagInfo; -} -/** - * Analytics stats of a Dynamic Link for a given timeframe. - */ -export interface Schema$DynamicLinkStats { - /** - * Dynamic Link event stats. - */ - linkEventStats: Schema$DynamicLinkEventStat[]; -} -/** - * Dynamic Links warning messages. - */ -export interface Schema$DynamicLinkWarning { - /** - * The warning code. - */ - warningCode: string; - /** - * The document describing the warning, and helps resolve. - */ - warningDocumentLink: string; - /** - * The warning message to help developers improve their requests. - */ - warningMessage: string; -} -/** - * Request for iSDK to execute strong match flow for post-install attribution. - * This is meant for iOS requests only. Requests from other platforms will not - * be honored. - */ -export interface Schema$GetIosPostInstallAttributionRequest { - /** - * App installation epoch time (https://en.wikipedia.org/wiki/Unix_time). This - * is a client signal for a more accurate weak match. - */ - appInstallationTime: string; - /** - * APP bundle ID. - */ - bundleId: string; - /** - * Device information. - */ - device: Schema$DeviceInfo; - /** - * iOS version, ie: 9.3.5. Consider adding "build". - */ - iosVersion: string; - /** - * App post install attribution retrieval information. Disambiguates mechanism - * (iSDK or developer invoked) to retrieve payload from clicked link. - */ - retrievalMethod: string; - /** - * Google SDK version. - */ - sdkVersion: string; - /** - * Possible unique matched link that server need to check before performing - * fingerprint match. If passed link is short server need to expand the link. - * If link is long server need to vslidate the link. - */ - uniqueMatchLinkToCheck: string; - /** - * Strong match page information. Disambiguates between default UI and custom - * page to present when strong match succeeds/fails to find cookie. - */ - visualStyle: string; -} -/** - * Response for iSDK to execute strong match flow for post-install attribution. - */ -export interface Schema$GetIosPostInstallAttributionResponse { - /** - * The minimum version for app, specified by dev through ?imv= parameter. - * Return to iSDK to allow app to evaluate if current version meets this. - */ - appMinimumVersion: string; - /** - * The confidence of the returned attribution. - */ - attributionConfidence: string; - /** - * The deep-link attributed post-install via one of several techniques - * (fingerprint, copy unique). - */ - deepLink: string; - /** - * User-agent specific custom-scheme URIs for iSDK to open. This will be set - * according to the user-agent tha the click was originally made in. There is - * no Safari-equivalent custom-scheme open URLs. ie: - * googlechrome://www.example.com ie: - * firefox://open-url?url=http://www.example.com ie: opera-http://example.com - */ - externalBrowserDestinationLink: string; - /** - * The link to navigate to update the app if min version is not met. This is - * either (in order): 1) fallback link (from ?ifl= parameter, if specified by - * developer) or 2) AppStore URL (from ?isi= parameter, if specified), or 3) - * the payload link (from required link= parameter). - */ - fallbackLink: string; - /** - * Invitation ID attributed post-install via one of several techniques - * (fingerprint, copy unique). - */ - invitationId: string; - /** - * Instruction for iSDK to attemmpt to perform strong match. For instance, if - * browser does not support/allow cookie or outside of support browsers, this - * will be false. - */ - isStrongMatchExecutable: boolean; - /** - * Describes why match failed, ie: "discarded due to low - * confidence". This message will be publicly visible. - */ - matchMessage: string; - /** - * Entire FDL (short or long) attributed post-install via one of several - * techniques (fingerprint, copy unique). - */ - requestedLink: string; - /** - * The entire FDL, expanded from a short link. It is the same as the - * requested_link, if it is long. Parameters from this should not be used - * directly (ie: server can default utm_[campaign|medium|source] to a value - * when requested_link lack them, server determine the best fallback_link when - * requested_link specifies >1 fallback links). - */ - resolvedLink: string; - /** - * Scion campaign value to be propagated by iSDK to Scion at post-install. - */ - utmCampaign: string; - /** - * Scion medium value to be propagated by iSDK to Scion at post-install. - */ - utmMedium: string; - /** - * Scion source value to be propagated by iSDK to Scion at post-install. - */ - utmSource: string; -} -/** - * Parameters for Google Play Campaign Measurements. [Learn - * more](https://developers.google.com/analytics/devguides/collection/android/v4/campaigns#campaign-params) - */ -export interface Schema$GooglePlayAnalytics { - /** - * [AdWords autotagging - * parameter](https://support.google.com/analytics/answer/1033981?hl=en); used - * to measure Google AdWords ads. This value is generated dynamically and - * should never be modified. - */ - gclid: string; - /** - * Campaign name; used for keyword analysis to identify a specific product - * promotion or strategic campaign. - */ - utmCampaign: string; - /** - * Campaign content; used for A/B testing and content-targeted ads to - * differentiate ads or links that point to the same URL. - */ - utmContent: string; - /** - * Campaign medium; used to identify a medium such as email or cost-per-click. - */ - utmMedium: string; - /** - * Campaign source; used to identify a search engine, newsletter, or other - * source. - */ - utmSource: string; - /** - * Campaign term; used with paid search to supply the keywords for ads. - */ - utmTerm: string; -} -/** - * iOS related attributes to the Dynamic Link.. - */ -export interface Schema$IosInfo { - /** - * iOS App Store ID. - */ - iosAppStoreId: string; - /** - * iOS bundle ID of the app. - */ - iosBundleId: string; - /** - * Custom (destination) scheme to use for iOS. By default, we’ll use the - * bundle ID as the custom scheme. Developer can override this behavior using - * this param. - */ - iosCustomScheme: string; - /** - * Link to open on iOS if the app is not installed. - */ - iosFallbackLink: string; - /** - * iPad bundle ID of the app. - */ - iosIpadBundleId: string; - /** - * If specified, this overrides the ios_fallback_link value on iPads. - */ - iosIpadFallbackLink: string; -} -/** - * Parameters for iTunes Connect App Analytics. - */ -export interface Schema$ITunesConnectAnalytics { - /** - * Affiliate token used to create affiliate-coded links. - */ - at: string; - /** - * Campaign text that developers can optionally add to any link in order to - * track sales from a specific marketing campaign. - */ - ct: string; - /** - * iTune media types, including music, podcasts, audiobooks and so on. - */ - mt: string; - /** - * Provider token that enables analytics for Dynamic Links from within iTunes - * Connect. - */ - pt: string; -} -/** - * Managed Short Link. - */ -export interface Schema$ManagedShortLink { - /** - * Creation timestamp of the short link. - */ - creationTime: string; - /** - * Attributes that have been flagged about this short url. - */ - flaggedAttribute: string[]; - /** - * Full Dyamic Link info - */ - info: Schema$DynamicLinkInfo; - /** - * Short durable link url, for example, - * "https://sample.app.goo.gl/xyz123". Required. - */ - link: string; - /** - * Link name defined by the creator. Required. - */ - linkName: string; - /** - * Visibility status of link. - */ - visibility: string; -} -/** - * Information of navigation behavior. - */ -export interface Schema$NavigationInfo { - /** - * If this option is on, FDL click will be forced to redirect rather than show - * an interstitial page. - */ - enableForcedRedirect: boolean; -} -/** - * Parameters for social meta tag params. Used to set meta tag data for link - * previews on social sites. - */ -export interface Schema$SocialMetaTagInfo { - /** - * A short description of the link. Optional. - */ - socialDescription: string; - /** - * An image url string. Optional. - */ - socialImageLink: string; - /** - * Title to be displayed. Optional. - */ - socialTitle: string; -} -/** - * Short Dynamic Link suffix. - */ -export interface Schema$Suffix { - /** - * Only applies to Option.CUSTOM. - */ - customSuffix: string; - /** - * Suffix option. - */ - option: string; -} - -export class Resource$Managedshortlinks { - root: Firebasedynamiclinks; - constructor(root: Firebasedynamiclinks) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$SocialMetaTagInfo { + /** + * A short description of the link. Optional. + */ + socialDescription: string; + /** + * An image url string. Optional. + */ + socialImageLink: string; + /** + * Title to be displayed. Optional. + */ + socialTitle: string; } - - getRoot() { - return this.root; + /** + * Short Dynamic Link suffix. + */ + export interface Schema$Suffix { + /** + * Only applies to Option.CUSTOM. + */ + customSuffix: string; + /** + * Suffix option. + */ + option: string; } - - /** - * firebasedynamiclinks.managedShortLinks.create - * @desc Creates a managed short Dynamic Link given either a valid long - * Dynamic Link or details such as Dynamic Link domain, Android and iOS app - * information. The created short Dynamic Link will not expire. This differs - * from CreateShortDynamicLink in the following ways: - The request will - * also contain a name for the link (non unique name for the front end). - * - The response must be authenticated with an auth token (generated with the - * admin service account). - The link will appear in the FDL list of links - * in the console front end. The Dynamic Link domain in the request must be - * owned by requester's Firebase project. - * @alias firebasedynamiclinks.managedShortLinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CreateManagedShortLinkRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Managedshortlinks { + root: Firebasedynamiclinks; + constructor(root: Firebasedynamiclinks) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://firebasedynamiclinks-ipv6.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/managedShortLinks:create') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Shortlinks { - root: Firebasedynamiclinks; - constructor(root: Firebasedynamiclinks) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * firebasedynamiclinks.managedShortLinks.create + * @desc Creates a managed short Dynamic Link given either a valid long + * Dynamic Link or details such as Dynamic Link domain, Android and iOS app + * information. The created short Dynamic Link will not expire. This + * differs from CreateShortDynamicLink in the following ways: - The + * request will also contain a name for the link (non unique name for + * the front end). - The response must be authenticated with an auth token + * (generated with the admin service account). - The link will appear + * in the FDL list of links in the console front end. The Dynamic Link + * domain in the request must be owned by requester's Firebase project. + * @alias firebasedynamiclinks.managedShortLinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CreateManagedShortLinkRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://firebasedynamiclinks-ipv6.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/managedShortLinks:create') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * firebasedynamiclinks.shortLinks.create - * @desc Creates a short Dynamic Link given either a valid long Dynamic Link - * or details such as Dynamic Link domain, Android and iOS app information. - * The created short Dynamic Link will not expire. Repeated calls with the - * same long Dynamic Link or Dynamic Link information will produce the same - * short Dynamic Link. The Dynamic Link domain in the request must be owned - * by requester's Firebase project. - * @alias firebasedynamiclinks.shortLinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CreateShortDynamicLinkRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Shortlinks { + root: Firebasedynamiclinks; + constructor(root: Firebasedynamiclinks) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://firebasedynamiclinks-ipv6.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/shortLinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$V1 { - root: Firebasedynamiclinks; - constructor(root: Firebasedynamiclinks) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * firebasedynamiclinks.shortLinks.create + * @desc Creates a short Dynamic Link given either a valid long Dynamic Link + * or details such as Dynamic Link domain, Android and iOS app information. + * The created short Dynamic Link will not expire. Repeated calls with the + * same long Dynamic Link or Dynamic Link information will produce the same + * short Dynamic Link. The Dynamic Link domain in the request must be owned + * by requester's Firebase project. + * @alias firebasedynamiclinks.shortLinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CreateShortDynamicLinkRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://firebasedynamiclinks-ipv6.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/shortLinks').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * firebasedynamiclinks.getLinkStats - * @desc Fetches analytics stats of a short Dynamic Link for a given duration. - * Metrics include number of clicks, redirects, installs, app first opens, and - * app reopens. - * @alias firebasedynamiclinks.getLinkStats - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.durationDays The span of time requested in days. - * @param {string} params.dynamicLink Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getLinkStats(params?: any, options?: MethodOptions): - AxiosPromise; - getLinkStats( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getLinkStats( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$V1 { + root: Firebasedynamiclinks; + constructor(root: Firebasedynamiclinks) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://firebasedynamiclinks-ipv6.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{dynamicLink}/linkStats') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['dynamicLink'], - pathParams: ['dynamicLink'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * firebasedynamiclinks.installAttribution - * @desc Get iOS strong/weak-match info for post-install attribution. - * @alias firebasedynamiclinks.installAttribution - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GetIosPostInstallAttributionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - installAttribution(params?: any, options?: MethodOptions): - AxiosPromise; - installAttribution( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - installAttribution( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firebasedynamiclinks.getLinkStats + * @desc Fetches analytics stats of a short Dynamic Link for a given + * duration. Metrics include number of clicks, redirects, installs, app + * first opens, and app reopens. + * @alias firebasedynamiclinks.getLinkStats + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.durationDays The span of time requested in days. + * @param {string} params.dynamicLink Dynamic Link URL. e.g. https://abcd.app.goo.gl/wxyz + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getLinkStats(params?: any, options?: MethodOptions): + AxiosPromise; + getLinkStats( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getLinkStats( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://firebasedynamiclinks-ipv6.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{dynamicLink}/linkStats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['dynamicLink'], + pathParams: ['dynamicLink'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://firebasedynamiclinks-ipv6.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/installAttribution') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * firebasedynamiclinks.installAttribution + * @desc Get iOS strong/weak-match info for post-install attribution. + * @alias firebasedynamiclinks.installAttribution + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GetIosPostInstallAttributionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + installAttribution(params?: any, options?: MethodOptions): + AxiosPromise; + installAttribution( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + installAttribution( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://firebasedynamiclinks-ipv6.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/installAttribution') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/firebaserules/v1.ts b/src/apis/firebaserules/v1.ts index 996b5d151c7..5f58dbf4cdf 100644 --- a/src/apis/firebaserules/v1.ts +++ b/src/apis/firebaserules/v1.ts @@ -27,1076 +27,1103 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Firebase Rules API - * - * Creates and manages rules that determine when a Firebase Rules-enabled - * service should permit a request. - * - * @example - * const google = require('googleapis'); - * const firebaserules = google.firebaserules('v1'); - * - * @namespace firebaserules - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Firebaserules - */ -export class Firebaserules { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace firebaserules_v1 { + /** + * Firebase Rules API + * + * Creates and manages rules that determine when a Firebase Rules-enabled + * service should permit a request. + * + * @example + * const google = require('googleapis'); + * const firebaserules = google.firebaserules('v1'); + * + * @namespace firebaserules + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Firebaserules + */ + export class Firebaserules { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Arg matchers for the mock function. - */ -export interface Schema$Arg { - /** - * Argument matches any value provided. - */ - anyValue: Schema$Empty; - /** - * Argument exactly matches value provided. - */ - exactValue: any; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * `File` containing source content. - */ -export interface Schema$File { - /** - * Textual Content. - */ - content: string; - /** - * Fingerprint (e.g. github sha) associated with the `File`. - */ - fingerprint: string; - /** - * File name. - */ - name: string; -} -/** - * Represents a service-defined function call that was invoked during test - * execution. - */ -export interface Schema$FunctionCall { - /** - * The arguments that were provided to the function. - */ - args: any[]; - /** - * Name of the function invoked. - */ - function: string; -} -/** - * Mock function definition. Mocks must refer to a function declared by the - * target service. The type of the function args and result will be inferred at - * test time. If either the arg or result values are not compatible with - * function type declaration, the request will be considered invalid. More than - * one `FunctionMock` may be provided for a given function name so long as the - * `Arg` matchers are distinct. There may be only one function for a given - * overload where all `Arg` values are `Arg.any_value`. - */ -export interface Schema$FunctionMock { - /** - * The list of `Arg` values to match. The order in which the arguments are - * provided is the order in which they must appear in the function invocation. - */ - args: Schema$Arg[]; - /** - * The name of the function. The function name must match one provided by a - * service declaration. - */ - function: string; - /** - * The mock result of the function call. - */ - result: Schema$Result; -} -/** - * The response for FirebaseRulesService.GetReleaseExecutable - */ -export interface Schema$GetReleaseExecutableResponse { - /** - * Executable view of the `Ruleset` referenced by the `Release`. - */ - executable: string; - /** - * The Rules runtime version of the executable. - */ - executableVersion: string; - /** - * `Language` used to generate the executable bytes. - */ - language: string; - /** - * `Ruleset` name associated with the `Release` executable. - */ - rulesetName: string; /** - * Timestamp for the most recent `Release.update_time`. + * Arg matchers for the mock function. */ - updateTime: string; -} -/** - * Issues include warnings, errors, and deprecation notices. - */ -export interface Schema$Issue { - /** - * Short error description. - */ - description: string; - /** - * The severity of the issue. - */ - severity: string; - /** - * Position of the issue in the `Source`. - */ - sourcePosition: Schema$SourcePosition; -} -/** - * The response for FirebaseRulesService.ListReleases. - */ -export interface Schema$ListReleasesResponse { - /** - * The pagination token to retrieve the next page of results. If the value is - * empty, no further results remain. - */ - nextPageToken: string; - /** - * List of `Release` instances. - */ - releases: Schema$Release[]; -} -/** - * The response for FirebaseRulesService.ListRulesets. - */ -export interface Schema$ListRulesetsResponse { - /** - * The pagination token to retrieve the next page of results. If the value is - * empty, no further results remain. - */ - nextPageToken: string; - /** - * List of `Ruleset` instances. - */ - rulesets: Schema$Ruleset[]; -} -/** - * `Release` is a named reference to a `Ruleset`. Once a `Release` refers to a - * `Ruleset`, rules-enabled services will be able to enforce the `Ruleset`. - */ -export interface Schema$Release { - /** - * Time the release was created. Output only. - */ - createTime: string; - /** - * Resource name for the `Release`. `Release` names may be structured - * `app1/prod/v2` or flat `app1_prod_v2` which affords developers a great deal - * of flexibility in mapping the name to the style that best fits their - * existing development practices. For example, a name could refer to an - * environment, an app, a version, or some combination of three. In the table - * below, for the project name `projects/foo`, the following relative release - * paths show how flat and structured names might be chosen to match a desired - * development / deployment strategy. Use Case | Flat Name | - * Structured Name -------------|---------------------|---------------- - * Environments | releases/qa | releases/qa Apps | - * releases/app1_qa | releases/app1/qa Versions | releases/app1_v2_qa | - * releases/app1/v2/qa The delimiter between the release name path elements - * can be almost anything and it should work equally well with the release - * name list filter, but in many ways the structured paths provide a clearer - * picture of the relationship between `Release` instances. Format: - * `projects/{project_id}/releases/{release_id}` - */ - name: string; - /** - * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must - * exist the `Release` to be created. - */ - rulesetName: string; - /** - * Time the release was updated. Output only. - */ - updateTime: string; -} -/** - * Possible result values from the function mock invocation. - */ -export interface Schema$Result { - /** - * The result is undefined, meaning the result could not be computed. - */ - undefined: Schema$Empty; - /** - * The result is an actual value. The type of the value must match that of the - * type declared by the service. - */ - value: any; -} -/** - * `Ruleset` is an immutable copy of `Source` with a globally unique identifier - * and a creation time. - */ -export interface Schema$Ruleset { - /** - * Time the `Ruleset` was created. Output only. - */ - createTime: string; - /** - * Name of the `Ruleset`. The ruleset_id is auto generated by the service. - * Format: `projects/{project_id}/rulesets/{ruleset_id}` Output only. - */ - name: string; - /** - * `Source` for the `Ruleset`. - */ - source: Schema$Source; -} -/** - * `Source` is one or more `File` messages comprising a logical set of rules. - */ -export interface Schema$Source { + export interface Schema$Arg { + /** + * Argument matches any value provided. + */ + anyValue: Schema$Empty; + /** + * Argument exactly matches value provided. + */ + exactValue: any; + } /** - * `File` set constituting the `Source` bundle. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - files: Schema$File[]; -} -/** - * Position in the `Source` content including its line, column number, and an - * index of the `File` in the `Source` message. Used for debug purposes. - */ -export interface Schema$SourcePosition { + export interface Schema$Empty {} /** - * First column on the source line associated with the source fragment. + * `File` containing source content. */ - column: number; + export interface Schema$File { + /** + * Textual Content. + */ + content: string; + /** + * Fingerprint (e.g. github sha) associated with the `File`. + */ + fingerprint: string; + /** + * File name. + */ + name: string; + } /** - * Name of the `File`. + * Represents a service-defined function call that was invoked during test + * execution. */ - fileName: string; + export interface Schema$FunctionCall { + /** + * The arguments that were provided to the function. + */ + args: any[]; + /** + * Name of the function invoked. + */ + function: string; + } /** - * Line number of the source fragment. 1-based. + * Mock function definition. Mocks must refer to a function declared by the + * target service. The type of the function args and result will be inferred + * at test time. If either the arg or result values are not compatible with + * function type declaration, the request will be considered invalid. More + * than one `FunctionMock` may be provided for a given function name so long + * as the `Arg` matchers are distinct. There may be only one function for a + * given overload where all `Arg` values are `Arg.any_value`. */ - line: number; -} -/** - * `TestCase` messages provide the request context and an expectation as to - * whether the given context will be allowed or denied. Test cases may specify - * the `request`, `resource`, and `function_mocks` to mock a function call to a - * service-provided function. The `request` object represents context present - * at request-time. The `resource` is the value of the target resource as it - * appears in persistent storage before the request is executed. - */ -export interface Schema$TestCase { + export interface Schema$FunctionMock { + /** + * The list of `Arg` values to match. The order in which the arguments are + * provided is the order in which they must appear in the function + * invocation. + */ + args: Schema$Arg[]; + /** + * The name of the function. The function name must match one provided by a + * service declaration. + */ + function: string; + /** + * The mock result of the function call. + */ + result: Schema$Result; + } /** - * Test expectation. + * The response for FirebaseRulesService.GetReleaseExecutable */ - expectation: string; + export interface Schema$GetReleaseExecutableResponse { + /** + * Executable view of the `Ruleset` referenced by the `Release`. + */ + executable: string; + /** + * The Rules runtime version of the executable. + */ + executableVersion: string; + /** + * `Language` used to generate the executable bytes. + */ + language: string; + /** + * `Ruleset` name associated with the `Release` executable. + */ + rulesetName: string; + /** + * Timestamp for the most recent `Release.update_time`. + */ + updateTime: string; + } /** - * Optional function mocks for service-defined functions. If not set, any - * service defined function is expected to return an error, which may or may - * not influence the test outcome. + * Issues include warnings, errors, and deprecation notices. */ - functionMocks: Schema$FunctionMock[]; + export interface Schema$Issue { + /** + * Short error description. + */ + description: string; + /** + * The severity of the issue. + */ + severity: string; + /** + * Position of the issue in the `Source`. + */ + sourcePosition: Schema$SourcePosition; + } /** - * Request context. The exact format of the request context is - * service-dependent. See the appropriate service documentation for - * information about the supported fields and types on the request. Minimally, - * all services support the following fields and types: Request field | Type - * ---------------|----------------- auth.uid | `string` auth.token | - * `map<string, string>` headers | `map<string, string>` - * method | `string` params | `map<string, string>` path - * | `string` time | `google.protobuf.Timestamp` If the request - * value is not well-formed for the service, the request will be rejected as - * an invalid argument. + * The response for FirebaseRulesService.ListReleases. */ - request: any; + export interface Schema$ListReleasesResponse { + /** + * The pagination token to retrieve the next page of results. If the value + * is empty, no further results remain. + */ + nextPageToken: string; + /** + * List of `Release` instances. + */ + releases: Schema$Release[]; + } /** - * Optional resource value as it appears in persistent storage before the - * request is fulfilled. The resource type depends on the `request.path` - * value. + * The response for FirebaseRulesService.ListRulesets. */ - resource: any; -} -/** - * Test result message containing the state of the test as well as a description - * and source position for test failures. - */ -export interface Schema$TestResult { + export interface Schema$ListRulesetsResponse { + /** + * The pagination token to retrieve the next page of results. If the value + * is empty, no further results remain. + */ + nextPageToken: string; + /** + * List of `Ruleset` instances. + */ + rulesets: Schema$Ruleset[]; + } /** - * Debug messages related to test execution issues encountered during - * evaluation. Debug messages may be related to too many or too few - * invocations of function mocks or to runtime errors that occur during - * evaluation. For example: ```Unable to read variable [name: - * "resource"]``` + * `Release` is a named reference to a `Ruleset`. Once a `Release` refers to a + * `Ruleset`, rules-enabled services will be able to enforce the `Ruleset`. */ - debugMessages: string[]; + export interface Schema$Release { + /** + * Time the release was created. Output only. + */ + createTime: string; + /** + * Resource name for the `Release`. `Release` names may be structured + * `app1/prod/v2` or flat `app1_prod_v2` which affords developers a great + * deal of flexibility in mapping the name to the style that best fits their + * existing development practices. For example, a name could refer to an + * environment, an app, a version, or some combination of three. In the + * table below, for the project name `projects/foo`, the following relative + * release paths show how flat and structured names might be chosen to match + * a desired development / deployment strategy. Use Case | Flat Name | + * Structured Name -------------|---------------------|---------------- + * Environments | releases/qa | releases/qa Apps | + * releases/app1_qa | releases/app1/qa Versions | releases/app1_v2_qa + * | releases/app1/v2/qa The delimiter between the release name path + * elements can be almost anything and it should work equally well with the + * release name list filter, but in many ways the structured paths provide a + * clearer picture of the relationship between `Release` instances. Format: + * `projects/{project_id}/releases/{release_id}` + */ + name: string; + /** + * Name of the `Ruleset` referred to by this `Release`. The `Ruleset` must + * exist the `Release` to be created. + */ + rulesetName: string; + /** + * Time the release was updated. Output only. + */ + updateTime: string; + } /** - * Position in the `Source` or `Ruleset` where the principle runtime error - * occurs. Evaluation of an expression may result in an error. Rules are deny - * by default, so a `DENY` expectation when an error is generated is valid. - * When there is a `DENY` with an error, the `SourcePosition` is returned. - * E.g. `error_position { line: 19 column: 37 }` + * Possible result values from the function mock invocation. */ - errorPosition: Schema$SourcePosition; + export interface Schema$Result { + /** + * The result is undefined, meaning the result could not be computed. + */ + undefined: Schema$Empty; + /** + * The result is an actual value. The type of the value must match that of + * the type declared by the service. + */ + value: any; + } /** - * The set of function calls made to service-defined methods. Function calls - * are included in the order in which they are encountered during evaluation, - * are provided for both mocked and unmocked functions, and included on the - * response regardless of the test `state`. + * `Ruleset` is an immutable copy of `Source` with a globally unique + * identifier and a creation time. */ - functionCalls: Schema$FunctionCall[]; + export interface Schema$Ruleset { + /** + * Time the `Ruleset` was created. Output only. + */ + createTime: string; + /** + * Name of the `Ruleset`. The ruleset_id is auto generated by the service. + * Format: `projects/{project_id}/rulesets/{ruleset_id}` Output only. + */ + name: string; + /** + * `Source` for the `Ruleset`. + */ + source: Schema$Source; + } /** - * State of the test. + * `Source` is one or more `File` messages comprising a logical set of rules. */ - state: string; -} -/** - * The request for FirebaseRulesService.TestRuleset. - */ -export interface Schema$TestRulesetRequest { + export interface Schema$Source { + /** + * `File` set constituting the `Source` bundle. + */ + files: Schema$File[]; + } /** - * Optional `Source` to be checked for correctness. This field must not be - * set when the resource name refers to a `Ruleset`. + * Position in the `Source` content including its line, column number, and an + * index of the `File` in the `Source` message. Used for debug purposes. */ - source: Schema$Source; + export interface Schema$SourcePosition { + /** + * First column on the source line associated with the source fragment. + */ + column: number; + /** + * Name of the `File`. + */ + fileName: string; + /** + * Line number of the source fragment. 1-based. + */ + line: number; + } /** - * Inline `TestSuite` to run. + * `TestCase` messages provide the request context and an expectation as to + * whether the given context will be allowed or denied. Test cases may specify + * the `request`, `resource`, and `function_mocks` to mock a function call to + * a service-provided function. The `request` object represents context + * present at request-time. The `resource` is the value of the target + * resource as it appears in persistent storage before the request is + * executed. */ - testSuite: Schema$TestSuite; -} -/** - * The response for FirebaseRulesService.TestRuleset. - */ -export interface Schema$TestRulesetResponse { + export interface Schema$TestCase { + /** + * Test expectation. + */ + expectation: string; + /** + * Optional function mocks for service-defined functions. If not set, any + * service defined function is expected to return an error, which may or may + * not influence the test outcome. + */ + functionMocks: Schema$FunctionMock[]; + /** + * Request context. The exact format of the request context is + * service-dependent. See the appropriate service documentation for + * information about the supported fields and types on the request. + * Minimally, all services support the following fields and types: Request + * field | Type ---------------|----------------- auth.uid | `string` + * auth.token | `map<string, string>` headers | + * `map<string, string>` method | `string` params | + * `map<string, string>` path | `string` time | + * `google.protobuf.Timestamp` If the request value is not well-formed for + * the service, the request will be rejected as an invalid argument. + */ + request: any; + /** + * Optional resource value as it appears in persistent storage before the + * request is fulfilled. The resource type depends on the `request.path` + * value. + */ + resource: any; + } /** - * Syntactic and semantic `Source` issues of varying severity. Issues of - * `ERROR` severity will prevent tests from executing. + * Test result message containing the state of the test as well as a + * description and source position for test failures. */ - issues: Schema$Issue[]; + export interface Schema$TestResult { + /** + * Debug messages related to test execution issues encountered during + * evaluation. Debug messages may be related to too many or too few + * invocations of function mocks or to runtime errors that occur during + * evaluation. For example: ```Unable to read variable [name: + * "resource"]``` + */ + debugMessages: string[]; + /** + * Position in the `Source` or `Ruleset` where the principle runtime error + * occurs. Evaluation of an expression may result in an error. Rules are + * deny by default, so a `DENY` expectation when an error is generated is + * valid. When there is a `DENY` with an error, the `SourcePosition` is + * returned. E.g. `error_position { line: 19 column: 37 }` + */ + errorPosition: Schema$SourcePosition; + /** + * The set of function calls made to service-defined methods. Function + * calls are included in the order in which they are encountered during + * evaluation, are provided for both mocked and unmocked functions, and + * included on the response regardless of the test `state`. + */ + functionCalls: Schema$FunctionCall[]; + /** + * State of the test. + */ + state: string; + } /** - * The set of test results given the test cases in the `TestSuite`. The - * results will appear in the same order as the test cases appear in the - * `TestSuite`. + * The request for FirebaseRulesService.TestRuleset. */ - testResults: Schema$TestResult[]; -} -/** - * `TestSuite` is a collection of `TestCase` instances that validate the logical - * correctness of a `Ruleset`. The `TestSuite` may be referenced in-line within - * a `TestRuleset` invocation or as part of a `Release` object as a pre-release - * check. - */ -export interface Schema$TestSuite { + export interface Schema$TestRulesetRequest { + /** + * Optional `Source` to be checked for correctness. This field must not be + * set when the resource name refers to a `Ruleset`. + */ + source: Schema$Source; + /** + * Inline `TestSuite` to run. + */ + testSuite: Schema$TestSuite; + } /** - * Collection of test cases associated with the `TestSuite`. + * The response for FirebaseRulesService.TestRuleset. */ - testCases: Schema$TestCase[]; -} -/** - * The request for FirebaseRulesService.UpdateReleasePatch. - */ -export interface Schema$UpdateReleaseRequest { + export interface Schema$TestRulesetResponse { + /** + * Syntactic and semantic `Source` issues of varying severity. Issues of + * `ERROR` severity will prevent tests from executing. + */ + issues: Schema$Issue[]; + /** + * The set of test results given the test cases in the `TestSuite`. The + * results will appear in the same order as the test cases appear in the + * `TestSuite`. + */ + testResults: Schema$TestResult[]; + } /** - * `Release` to update. + * `TestSuite` is a collection of `TestCase` instances that validate the + * logical correctness of a `Ruleset`. The `TestSuite` may be referenced + * in-line within a `TestRuleset` invocation or as part of a `Release` object + * as a pre-release check. */ - release: Schema$Release; + export interface Schema$TestSuite { + /** + * Collection of test cases associated with the `TestSuite`. + */ + testCases: Schema$TestCase[]; + } /** - * Specifies which fields to update. + * The request for FirebaseRulesService.UpdateReleasePatch. */ - updateMask: string; -} - -export class Resource$Projects { - root: Firebaserules; - releases: Resource$Projects$Releases; - rulesets: Resource$Projects$Rulesets; - constructor(root: Firebaserules) { - this.root = root; - this.getRoot.bind(this); - this.releases = new Resource$Projects$Releases(root); - this.rulesets = new Resource$Projects$Rulesets(root); - } - - getRoot() { - return this.root; + export interface Schema$UpdateReleaseRequest { + /** + * `Release` to update. + */ + release: Schema$Release; + /** + * Specifies which fields to update. + */ + updateMask: string; } - - /** - * firebaserules.projects.test - * @desc Test `Source` for syntactic and semantic correctness. Issues present, - * if any, will be returned to the caller with a description, severity, and - * source location. The test method may be executed with `Source` or a - * `Ruleset` name. Passing `Source` is useful for unit testing new rules. - * Passing a `Ruleset` name is useful for regression testing an existing rule. - * The following is an example of `Source` that permits users to upload images - * to a bucket bearing their user id and matching the correct metadata: - * _*Example*_ // Users are allowed to subscribe and unsubscribe to the - * blog. service firebase.storage { match - * /users/{userId}/images/{imageName} { allow write: if userId == - * request.auth.uid && (imageName.matches('*.png$') || - * imageName.matches('*.jpg$')) && - * resource.mimeType.matches('^image/') } } - * @alias firebaserules.projects.test - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Tests may either provide `source` or a `Ruleset` resource name. For tests against `source`, the resource name must refer to the project: Format: `projects/{project_id}` For tests against a `Ruleset`, this must be the `Ruleset` resource name: Format: `projects/{project_id}/rulesets/{ruleset_id}` - * @param {().TestRulesetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - test(params?: any, options?: MethodOptions): - AxiosPromise; - test( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - test( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Firebaserules; + releases: Resource$Projects$Releases; + rulesets: Resource$Projects$Rulesets; + constructor(root: Firebaserules) { + this.root = root; + this.getRoot.bind(this); + this.releases = new Resource$Projects$Releases(root); + this.rulesets = new Resource$Projects$Rulesets(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:test').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Releases { - root: Firebaserules; - constructor(root: Firebaserules) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * firebaserules.projects.releases.create - * @desc Create a `Release`. Release names should reflect the developer's - * deployment practices. For example, the release name may include the - * environment name, application name, application version, or any other name - * meaningful to the developer. Once a `Release` refers to a `Ruleset`, the - * rules can be enforced by Firebase Rules-enabled services. More than one - * `Release` may be 'live' concurrently. Consider the following three - * `Release` names for `projects/foo` and the `Ruleset` to which they refer. - * Release Name | Ruleset Name - * --------------------------------|------------- projects/foo/releases/prod - * | projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta | - * projects/foo/rulesets/uuid123 projects/foo/releases/prod/v23 | - * projects/foo/rulesets/uuid456 The table reflects the `Ruleset` rollout in - * progress. The `prod` and `prod/beta` releases refer to the same `Ruleset`. - * However, `prod/v23` refers to a new `Ruleset`. The `Ruleset` reference for - * a `Release` may be updated using the UpdateRelease method. - * @alias firebaserules.projects.releases.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the project which owns this `Release`. Format: `projects/{project_id}` - * @param {().Release} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * firebaserules.projects.test + * @desc Test `Source` for syntactic and semantic correctness. Issues + * present, if any, will be returned to the caller with a description, + * severity, and source location. The test method may be executed with + * `Source` or a `Ruleset` name. Passing `Source` is useful for unit testing + * new rules. Passing a `Ruleset` name is useful for regression testing an + * existing rule. The following is an example of `Source` that permits + * users to upload images to a bucket bearing their user id and matching the + * correct metadata: _*Example*_ // Users are allowed to subscribe and + * unsubscribe to the blog. service firebase.storage { match + * /users/{userId}/images/{imageName} { allow write: if userId == + * request.auth.uid && (imageName.matches('*.png$') || + * imageName.matches('*.jpg$')) && + * resource.mimeType.matches('^image/') } } + * @alias firebaserules.projects.test + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Tests may either provide `source` or a `Ruleset` resource name. For tests against `source`, the resource name must refer to the project: Format: `projects/{project_id}` For tests against a `Ruleset`, this must be the `Ruleset` resource name: Format: `projects/{project_id}/rulesets/{ruleset_id}` + * @param {().TestRulesetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + test(params?: any, options?: MethodOptions): + AxiosPromise; + test( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + test( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:test').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Releases { + root: Firebaserules; + constructor(root: Firebaserules) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/releases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * firebaserules.projects.releases.delete - * @desc Delete a `Release` by resource name. - * @alias firebaserules.projects.releases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the `Release` to delete. Format: `projects/{project_id}/releases/{release_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * firebaserules.projects.releases.create + * @desc Create a `Release`. Release names should reflect the developer's + * deployment practices. For example, the release name may include the + * environment name, application name, application version, or any other + * name meaningful to the developer. Once a `Release` refers to a `Ruleset`, + * the rules can be enforced by Firebase Rules-enabled services. More than + * one `Release` may be 'live' concurrently. Consider the following three + * `Release` names for `projects/foo` and the `Ruleset` to which they refer. + * Release Name | Ruleset Name + * --------------------------------|------------- projects/foo/releases/prod + * | projects/foo/rulesets/uuid123 projects/foo/releases/prod/beta | + * projects/foo/rulesets/uuid123 projects/foo/releases/prod/v23 | + * projects/foo/rulesets/uuid456 The table reflects the `Ruleset` rollout + * in progress. The `prod` and `prod/beta` releases refer to the same + * `Ruleset`. However, `prod/v23` refers to a new `Ruleset`. The `Ruleset` + * reference for a `Release` may be updated using the UpdateRelease method. + * @alias firebaserules.projects.releases.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the project which owns this `Release`. Format: `projects/{project_id}` + * @param {().Release} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/releases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * firebaserules.projects.releases.get - * @desc Get a `Release` by name. - * @alias firebaserules.projects.releases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * firebaserules.projects.releases.delete + * @desc Delete a `Release` by resource name. + * @alias firebaserules.projects.releases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the `Release` to delete. Format: `projects/{project_id}/releases/{release_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firebaserules.projects.releases.getExecutable - * @desc Get the `Release` executable to use when enforcing rules. - * @alias firebaserules.projects.releases.getExecutable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.executableVersion The requested runtime executable version. Defaults to FIREBASE_RULES_EXECUTABLE_V1 - * @param {string} params.name Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getExecutable(params?: any, options?: MethodOptions): - AxiosPromise; - getExecutable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getExecutable( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firebaserules.projects.releases.get + * @desc Get a `Release` by name. + * @alias firebaserules.projects.releases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:getExecutable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firebaserules.projects.releases.list - * @desc List the `Release` values for a project. This list may optionally be - * filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any - * combination thereof. - * @alias firebaserules.projects.releases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter `Release` filter. The list method supports filters with restrictions on the `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. Example 1: A filter of 'name=prod*' might return `Release`s with names within 'projects/foo' prefixed with 'prod': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only `Release` instances for 'projects/foo' with names prefixed with 'prod' referring to the same `Ruleset` name of 'uuid1234': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 In the examples, the filter parameters refer to the search filters are relative to the project. Fully qualified prefixed may also be used. e.g. `test_suite_name=projects/foo/testsuites/uuid1` - * @param {string} params.name Resource name for the project. Format: `projects/{project_id}` - * @param {integer=} params.pageSize Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load fewer than `page_size` results due to the size of the output. To traverse all of the releases, the caller should iterate until the `page_token` on the response is empty. - * @param {string=} params.pageToken Next page token for the next batch of `Release` instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/releases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * firebaserules.projects.releases.getExecutable + * @desc Get the `Release` executable to use when enforcing rules. + * @alias firebaserules.projects.releases.getExecutable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.executableVersion The requested runtime executable version. Defaults to FIREBASE_RULES_EXECUTABLE_V1 + * @param {string} params.name Resource name of the `Release`. Format: `projects/{project_id}/releases/{release_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getExecutable(params?: any, options?: MethodOptions): + AxiosPromise; + getExecutable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getExecutable( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:getExecutable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * firebaserules.projects.releases.patch - * @desc Update a `Release` via PATCH. Only updates to the `ruleset_name` and - * `test_suite_name` fields will be honored. `Release` rename is not - * supported. To create a `Release` use the CreateRelease method. - * @alias firebaserules.projects.releases.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the project which owns this `Release`. Format: `projects/{project_id}` - * @param {().UpdateReleaseRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * firebaserules.projects.releases.list + * @desc List the `Release` values for a project. This list may optionally + * be filtered by `Release` name, `Ruleset` name, `TestSuite` name, or any + * combination thereof. + * @alias firebaserules.projects.releases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter `Release` filter. The list method supports filters with restrictions on the `Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`. Example 1: A filter of 'name=prod*' might return `Release`s with names within 'projects/foo' prefixed with 'prod': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234 projects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888 Example 2: A filter of `name=prod* ruleset_name=uuid1234` would return only `Release` instances for 'projects/foo' with names prefixed with 'prod' referring to the same `Ruleset` name of 'uuid1234': Name | Ruleset Name ------------------------------|------------- projects/foo/releases/prod | projects/foo/rulesets/1234 projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 In the examples, the filter parameters refer to the search filters are relative to the project. Fully qualified prefixed may also be used. e.g. `test_suite_name=projects/foo/testsuites/uuid1` + * @param {string} params.name Resource name for the project. Format: `projects/{project_id}` + * @param {integer=} params.pageSize Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load fewer than `page_size` results due to the size of the output. To traverse all of the releases, the caller should iterate until the `page_token` on the response is empty. + * @param {string=} params.pageToken Next page token for the next batch of `Release` instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/releases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Rulesets { - root: Firebaserules; - constructor(root: Firebaserules) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * firebaserules.projects.releases.patch + * @desc Update a `Release` via PATCH. Only updates to the `ruleset_name` + * and `test_suite_name` fields will be honored. `Release` rename is not + * supported. To create a `Release` use the CreateRelease method. + * @alias firebaserules.projects.releases.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the project which owns this `Release`. Format: `projects/{project_id}` + * @param {().UpdateReleaseRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * firebaserules.projects.rulesets.create - * @desc Create a `Ruleset` from `Source`. The `Ruleset` is given a unique - * generated name which is returned to the caller. `Source` containing - * syntactic or semantics errors will result in an error response indicating - * the first error encountered. For a detailed view of `Source` issues, use - * TestRuleset. - * @alias firebaserules.projects.rulesets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for Project which owns this `Ruleset`. Format: `projects/{project_id}` - * @param {().Ruleset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Rulesets { + root: Firebaserules; + constructor(root: Firebaserules) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/rulesets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * firebaserules.projects.rulesets.delete - * @desc Delete a `Ruleset` by resource name. If the `Ruleset` is referenced - * by a `Release` the operation will fail. - * @alias firebaserules.projects.rulesets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the ruleset to delete. Format: `projects/{project_id}/rulesets/{ruleset_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firebaserules.projects.rulesets.create + * @desc Create a `Ruleset` from `Source`. The `Ruleset` is given a unique + * generated name which is returned to the caller. `Source` containing + * syntactic or semantics errors will result in an error response indicating + * the first error encountered. For a detailed view of `Source` issues, use + * TestRuleset. + * @alias firebaserules.projects.rulesets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for Project which owns this `Ruleset`. Format: `projects/{project_id}` + * @param {().Ruleset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/rulesets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firebaserules.projects.rulesets.get - * @desc Get a `Ruleset` by name including the full `Source` contents. - * @alias firebaserules.projects.rulesets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the ruleset to get. Format: `projects/{project_id}/rulesets/{ruleset_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * firebaserules.projects.rulesets.delete + * @desc Delete a `Ruleset` by resource name. If the `Ruleset` is + * referenced by a `Release` the operation will fail. + * @alias firebaserules.projects.rulesets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the ruleset to delete. Format: `projects/{project_id}/rulesets/{ruleset_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * firebaserules.projects.rulesets.list - * @desc List `Ruleset` metadata only and optionally filter the results by - * `Ruleset` name. The full `Source` contents of a `Ruleset` may be retrieved - * with GetRuleset. - * @alias firebaserules.projects.rulesets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter `Ruleset` filter. The list method supports filters with restrictions on `Ruleset.name`. Filters on `Ruleset.create_time` should use the `date` function which parses strings that conform to the RFC 3339 date/time specifications. Example: `create_time > date("2017-01-01") AND name=UUID-*` - * @param {string} params.name Resource name for the project. Format: `projects/{project_id}` - * @param {integer=} params.pageSize Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load less than `page_size` due to the size of the output. To traverse all of the releases, caller should iterate until the `page_token` is empty. - * @param {string=} params.pageToken Next page token for loading the next batch of `Ruleset` instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * firebaserules.projects.rulesets.get + * @desc Get a `Ruleset` by name including the full `Source` contents. + * @alias firebaserules.projects.rulesets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the ruleset to get. Format: `projects/{project_id}/rulesets/{ruleset_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firebaserules.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/rulesets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * firebaserules.projects.rulesets.list + * @desc List `Ruleset` metadata only and optionally filter the results by + * `Ruleset` name. The full `Source` contents of a `Ruleset` may be + * retrieved with GetRuleset. + * @alias firebaserules.projects.rulesets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter `Ruleset` filter. The list method supports filters with restrictions on `Ruleset.name`. Filters on `Ruleset.create_time` should use the `date` function which parses strings that conform to the RFC 3339 date/time specifications. Example: `create_time > date("2017-01-01") AND name=UUID-*` + * @param {string} params.name Resource name for the project. Format: `projects/{project_id}` + * @param {integer=} params.pageSize Page size to load. Maximum of 100. Defaults to 10. Note: `page_size` is just a hint and the service may choose to load less than `page_size` due to the size of the output. To traverse all of the releases, caller should iterate until the `page_token` is empty. + * @param {string=} params.pageToken Next page token for loading the next batch of `Ruleset` instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://firebaserules.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/rulesets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/firestore/v1beta1.ts b/src/apis/firestore/v1beta1.ts index e19f30918f9..1618d0341f2 100644 --- a/src/apis/firestore/v1beta1.ts +++ b/src/apis/firestore/v1beta1.ts @@ -27,2115 +27,2137 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Firestore API - * - * - * - * @example - * const google = require('googleapis'); - * const firestore = google.firestore('v1beta1'); - * - * @namespace firestore - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Firestore - */ -export class Firestore { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * An array value. - */ -export interface Schema$ArrayValue { - /** - * Values in the array. - */ - values: Schema$Value[]; -} -/** - * The request for Firestore.BatchGetDocuments. - */ -export interface Schema$BatchGetDocumentsRequest { - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - */ - documents: string[]; - /** - * The fields to return. If not set, returns all fields. If a document has a - * field that is not present in this mask, that field will not be returned in - * the response. - */ - mask: Schema$DocumentMask; - /** - * Starts a new transaction and reads the documents. Defaults to a read-only - * transaction. The new transaction ID will be returned as the first response - * in the stream. - */ - newTransaction: Schema$TransactionOptions; - /** - * Reads documents as they were at the given time. This may not be older than - * 60 seconds. - */ - readTime: string; - /** - * Reads documents in a transaction. - */ - transaction: string; -} -/** - * The streamed response for Firestore.BatchGetDocuments. - */ -export interface Schema$BatchGetDocumentsResponse { - /** - * A document that was requested. - */ - found: Schema$Document; - /** - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ - missing: string; - /** - * The time at which the document was read. This may be monotically - * increasing, in this case the previous documents in the result stream are - * guaranteed not to have changed between their read_time and this one. - */ - readTime: string; - /** - * The transaction that was started as part of this request. Will only be set - * in the first response, and only if BatchGetDocumentsRequest.new_transaction - * was set in the request. - */ - transaction: string; -} -/** - * The request for Firestore.BeginTransaction. - */ -export interface Schema$BeginTransactionRequest { - /** - * The options for the transaction. Defaults to a read-write transaction. - */ - options: Schema$TransactionOptions; -} -/** - * The response for Firestore.BeginTransaction. - */ -export interface Schema$BeginTransactionResponse { - /** - * The transaction that was started. - */ - transaction: string; -} -/** - * A selection of a collection, such as `messages as m1`. - */ -export interface Schema$CollectionSelector { - /** - * When false, selects only collections that are immediate children of the - * `parent` specified in the containing `RunQueryRequest`. When true, selects - * all descendant collections. - */ - allDescendants: boolean; - /** - * The collection ID. When set, selects only collections with this ID. - */ - collectionId: string; -} -/** - * The request for Firestore.Commit. - */ -export interface Schema$CommitRequest { - /** - * If set, applies all writes in this transaction, and commits it. - */ - transaction: string; - /** - * The writes to apply. Always executed atomically and in order. - */ - writes: Schema$Write[]; -} -/** - * The response for Firestore.Commit. - */ -export interface Schema$CommitResponse { - /** - * The time at which the commit occurred. - */ - commitTime: string; - /** - * The result of applying the writes. This i-th write result corresponds to - * the i-th write in the request. - */ - writeResults: Schema$WriteResult[]; -} -/** - * A filter that merges multiple other filters using the given operator. - */ -export interface Schema$CompositeFilter { - /** - * The list of filters to combine. Must contain at least one filter. - */ - filters: Schema$Filter[]; - /** - * The operator for combining multiple filters. - */ - op: string; -} -/** - * A position in a query result set. - */ -export interface Schema$Cursor { - /** - * If the position is just before or just after the given values, relative to - * the sort order defined by the query. - */ - before: boolean; - /** - * The values that represent a position, in the order they appear in the order - * by clause of a query. Can contain fewer values than specified in the order - * by clause. - */ - values: Schema$Value[]; -} -/** - * A Firestore document. Must not exceed 1 MiB - 4 bytes. - */ -export interface Schema$Document { - /** - * Output only. The time at which the document was created. This value - * increases monotonically when a document is deleted then recreated. It can - * also be compared to values from other documents and the `read_time` of a - * query. - */ - createTime: string; - /** - * The document's fields. The map keys represent field names. A simple - * field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, or - * `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. Field - * names matching the regular expression `__.*__` are reserved. Reserved field - * names are forbidden except in certain documented contexts. The map keys, - * represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by the simple - * or quoted field names of the containing fields, delimited by `.`. For - * example, the structured field `"foo" : { map_value: { - * "x&y" : { string_value: "hello" }}}` would be - * represented by the field path `foo.x&y`. Within a field path, a quoted - * field name starts and ends with `` ` `` and may contain any character. Some - * characters, including `` ` ``, must be escaped using a `\`. For example, `` - * `x&y` `` represents `x&y` and `` `bak\`tik` `` represents `` - * bak`tik ``. - */ - fields: any; - /** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ - name: string; - /** - * Output only. The time at which the document was last changed. This value - * is initially set to the `create_time` then increases monotonically with - * each change to the document. It can also be compared to values from other - * documents and the `read_time` of a query. - */ - updateTime: string; -} -/** - * A Document has changed. May be the result of multiple writes, including - * deletes, that ultimately resulted in a new value for the Document. Multiple - * DocumentChange messages may be returned for the same logical change, if - * multiple targets are affected. - */ -export interface Schema$DocumentChange { - /** - * The new state of the Document. If `mask` is set, contains only fields that - * were updated or added. - */ - document: Schema$Document; - /** - * A set of target IDs for targets that no longer match this document. - */ - removedTargetIds: number[]; - /** - * A set of target IDs of targets that match this document. - */ - targetIds: number[]; -} -/** - * A Document has been deleted. May be the result of multiple writes, including - * updates, the last of which deleted the Document. Multiple DocumentDelete - * messages may be returned for the same logical delete, if multiple targets are - * affected. - */ -export interface Schema$DocumentDelete { - /** - * The resource name of the Document that was deleted. - */ - document: string; - /** - * The read timestamp at which the delete was observed. Greater or equal to - * the `commit_time` of the delete. - */ - readTime: string; - /** - * A set of target IDs for targets that previously matched this entity. - */ - removedTargetIds: number[]; -} -/** - * A set of field paths on a document. Used to restrict a get or update - * operation on a document to a subset of its fields. This is different from - * standard field masks, as this is always scoped to a Document, and takes in - * account the dynamic nature of Value. - */ -export interface Schema$DocumentMask { - /** - * The list of field paths in the mask. See Document.fields for a field path - * syntax reference. - */ - fieldPaths: string[]; -} -/** - * A Document has been removed from the view of the targets. Sent if the - * document is no longer relevant to a target and is out of view. Can be sent - * instead of a DocumentDelete or a DocumentChange if the server can not send - * the new value of the document. Multiple DocumentRemove messages may be - * returned for the same logical write or delete, if multiple targets are - * affected. - */ -export interface Schema$DocumentRemove { - /** - * The resource name of the Document that has gone out of view. - */ - document: string; - /** - * The read timestamp at which the remove was observed. Greater or equal to - * the `commit_time` of the change/delete/remove. - */ - readTime: string; - /** - * A set of target IDs for targets that previously matched this document. - */ - removedTargetIds: number[]; -} -/** - * A target specified by a set of documents names. - */ -export interface Schema$DocumentsTarget { - /** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - */ - documents: string[]; -} -/** - * A transformation of a document. - */ -export interface Schema$DocumentTransform { - /** - * The name of the document to transform. - */ - document: string; - /** - * The list of transformations to apply to the fields of the document, in - * order. This must not be empty. - */ - fieldTransforms: Schema$FieldTransform[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A digest of all the documents that match a given target. - */ -export interface Schema$ExistenceFilter { - /** - * The total count of documents that match target_id. If different from the - * count of documents in the client that match, the client must manually - * determine which documents no longer match the target. - */ - count: number; - /** - * The target ID to which this filter applies. - */ - targetId: number; -} -/** - * A filter on a specific field. - */ -export interface Schema$FieldFilter { - /** - * The field to filter by. - */ - field: Schema$FieldReference; - /** - * The operator to filter by. - */ - op: string; - /** - * The value to compare to. - */ - value: Schema$Value; -} -/** - * A reference to a field, such as `max(messages.time) as max_time`. - */ -export interface Schema$FieldReference { fieldPath: string; } -/** - * A transformation of a field of the document. - */ -export interface Schema$FieldTransform { - /** - * The path of the field. See Document.fields for the field path syntax - * reference. - */ - fieldPath: string; - /** - * Sets the field to the given server value. - */ - setToServerValue: string; -} -/** - * A filter. - */ -export interface Schema$Filter { - /** - * A composite filter. - */ - compositeFilter: Schema$CompositeFilter; - /** - * A filter on a document field. - */ - fieldFilter: Schema$FieldFilter; - /** - * A filter that takes exactly one argument. - */ - unaryFilter: Schema$UnaryFilter; -} -/** - * An index definition. - */ -export interface Schema$Index { - /** - * The collection ID to which this index applies. Required. - */ - collectionId: string; - /** - * The fields to index. - */ - fields: Schema$IndexField[]; - /** - * The resource name of the index. Output only. - */ - name: string; - /** - * The state of the index. Output only. - */ - state: string; -} -/** - * A field of an index. - */ -export interface Schema$IndexField { - /** - * The path of the field. Must match the field path specification described by - * google.firestore.v1beta1.Document.fields. Special field path `__name__` may - * be used by itself or at the end of a path. `__type__` may be used only at - * the end of path. - */ - fieldPath: string; - /** - * The field's mode. - */ - mode: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * The request for Firestore.ListCollectionIds. - */ -export interface Schema$ListCollectionIdsRequest { - /** - * The maximum number of results to return. - */ - pageSize: number; - /** - * A page token. Must be a value from ListCollectionIdsResponse. - */ - pageToken: string; -} -/** - * The response from Firestore.ListCollectionIds. - */ -export interface Schema$ListCollectionIdsResponse { - /** - * The collection ids. - */ - collectionIds: string[]; - /** - * A page token that may be used to continue the list. - */ - nextPageToken: string; -} -/** - * The response for Firestore.ListDocuments. - */ -export interface Schema$ListDocumentsResponse { - /** - * The Documents found. - */ - documents: Schema$Document[]; - /** - * The next page token. - */ - nextPageToken: string; -} -/** - * A request for Firestore.Listen - */ -export interface Schema$ListenRequest { - /** - * A target to add to this stream. - */ - addTarget: Schema$Target; - /** - * Labels associated with this target change. - */ - labels: any; - /** - * The ID of a target to remove from this stream. - */ - removeTarget: number; -} -/** - * The response for Firestore.Listen. - */ -export interface Schema$ListenResponse { - /** - * A Document has changed. - */ - documentChange: Schema$DocumentChange; - /** - * A Document has been deleted. - */ - documentDelete: Schema$DocumentDelete; - /** - * A Document has been removed from a target (because it is no longer relevant - * to that target). - */ - documentRemove: Schema$DocumentRemove; - /** - * A filter to apply to the set of documents previously returned for the given - * target. Returned when documents may have been removed from the given - * target, but the exact documents are unknown. - */ - filter: Schema$ExistenceFilter; - /** - * Targets have changed. - */ - targetChange: Schema$TargetChange; -} -/** - * The response for FirestoreAdmin.ListIndexes. - */ -export interface Schema$ListIndexesResponse { - /** - * The indexes. - */ - indexes: Schema$Index[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * A map value. - */ -export interface Schema$MapValue { - /** - * The map's fields. The map keys represent field names. Field names - * matching the regular expression `__.*__` are reserved. Reserved field names - * are forbidden except in certain documented contexts. The map keys, - * represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. - */ - fields: any; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * An order on a field. - */ -export interface Schema$Order { - /** - * The direction to order by. Defaults to `ASCENDING`. - */ - direction: string; - /** - * The field to order by. - */ - field: Schema$FieldReference; -} -/** - * A precondition on a document, used for conditional operations. - */ -export interface Schema$Precondition { - /** - * When set to `true`, the target document must exist. When set to `false`, - * the target document must not exist. - */ - exists: boolean; - /** - * When set, the target document must exist and have been last updated at that - * time. - */ - updateTime: string; -} -/** - * The projection of document's fields to return. - */ -export interface Schema$Projection { - /** - * The fields to return. If empty, all fields are returned. To only return - * the name of the document, use `['__name__']`. - */ - fields: Schema$FieldReference[]; -} -/** - * A target specified by a query. - */ -export interface Schema$QueryTarget { - /** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - */ - parent: string; - /** - * A structured query. - */ - structuredQuery: Schema$StructuredQuery; -} -/** - * Options for a transaction that can only be used to read documents. - */ -export interface Schema$ReadOnly { - /** - * Reads documents at the given time. This may not be older than 60 seconds. - */ - readTime: string; -} -/** - * Options for a transaction that can be used to read and write documents. - */ -export interface Schema$ReadWrite { - /** - * An optional transaction to retry. - */ - retryTransaction: string; -} -/** - * The request for Firestore.Rollback. - */ -export interface Schema$RollbackRequest { - /** - * The transaction to roll back. - */ - transaction: string; -} -/** - * The request for Firestore.RunQuery. - */ -export interface Schema$RunQueryRequest { - /** - * Starts a new transaction and reads the documents. Defaults to a read-only - * transaction. The new transaction ID will be returned as the first response - * in the stream. - */ - newTransaction: Schema$TransactionOptions; - /** - * Reads documents as they were at the given time. This may not be older than - * 60 seconds. - */ - readTime: string; - /** - * A structured query. - */ - structuredQuery: Schema$StructuredQuery; - /** - * Reads documents in a transaction. - */ - transaction: string; -} -/** - * The response for Firestore.RunQuery. - */ -export interface Schema$RunQueryResponse { - /** - * A query result. Not set when reporting partial progress. - */ - document: Schema$Document; - /** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. If - * the query returns no results, a response with `read_time` and no `document` - * will be sent, and this represents the time at which the query was run. - */ - readTime: string; - /** - * The number of results that have been skipped due to an offset between the - * last response and the current response. - */ - skippedResults: number; - /** - * The transaction that was started as part of this request. Can only be set - * in the first response, and only if RunQueryRequest.new_transaction was set - * in the request. If set, no other fields will be set in this response. - */ - transaction: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { +export namespace firestore_v1beta1 { /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Cloud Firestore API + * + * + * + * @example + * const google = require('googleapis'); + * const firestore = google.firestore('v1beta1'); + * + * @namespace firestore + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Firestore + */ + export class Firestore { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * An array value. */ - details: any[]; + export interface Schema$ArrayValue { + /** + * Values in the array. + */ + values: Schema$Value[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A Firestore query. - */ -export interface Schema$StructuredQuery { + * The request for Firestore.BatchGetDocuments. + */ + export interface Schema$BatchGetDocumentsRequest { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + */ + documents: string[]; + /** + * The fields to return. If not set, returns all fields. If a document has + * a field that is not present in this mask, that field will not be returned + * in the response. + */ + mask: Schema$DocumentMask; + /** + * Starts a new transaction and reads the documents. Defaults to a read-only + * transaction. The new transaction ID will be returned as the first + * response in the stream. + */ + newTransaction: Schema$TransactionOptions; + /** + * Reads documents as they were at the given time. This may not be older + * than 60 seconds. + */ + readTime: string; + /** + * Reads documents in a transaction. + */ + transaction: string; + } /** - * A end point for the query results. - */ - endAt: Schema$Cursor; + * The streamed response for Firestore.BatchGetDocuments. + */ + export interface Schema$BatchGetDocumentsResponse { + /** + * A document that was requested. + */ + found: Schema$Document; + /** + * A document name that was requested but does not exist. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + missing: string; + /** + * The time at which the document was read. This may be monotically + * increasing, in this case the previous documents in the result stream are + * guaranteed not to have changed between their read_time and this one. + */ + readTime: string; + /** + * The transaction that was started as part of this request. Will only be + * set in the first response, and only if + * BatchGetDocumentsRequest.new_transaction was set in the request. + */ + transaction: string; + } /** - * The collections to query. + * The request for Firestore.BeginTransaction. */ - from: Schema$CollectionSelector[]; + export interface Schema$BeginTransactionRequest { + /** + * The options for the transaction. Defaults to a read-write transaction. + */ + options: Schema$TransactionOptions; + } /** - * The maximum number of results to return. Applies after all other - * constraints. Must be >= 0 if specified. + * The response for Firestore.BeginTransaction. */ - limit: number; + export interface Schema$BeginTransactionResponse { + /** + * The transaction that was started. + */ + transaction: string; + } /** - * The number of results to skip. Applies before limit, but after all other - * constraints. Must be >= 0 if specified. - */ - offset: number; + * A selection of a collection, such as `messages as m1`. + */ + export interface Schema$CollectionSelector { + /** + * When false, selects only collections that are immediate children of the + * `parent` specified in the containing `RunQueryRequest`. When true, + * selects all descendant collections. + */ + allDescendants: boolean; + /** + * The collection ID. When set, selects only collections with this ID. + */ + collectionId: string; + } /** - * The order to apply to the query results. Firestore guarantees a stable - * ordering through the following rules: * Any field required to appear in - * `order_by`, that is not already specified in `order_by`, is appended to - * the order in field name order by default. * If an order on `__name__` - * is not specified, it is appended by default. Fields are appended with the - * same sort direction as the last order specified, or 'ASCENDING' if - * no order was specified. For example: * `SELECT * FROM Foo ORDER BY A` - * becomes `SELECT * FROM Foo ORDER BY A, __name__` * `SELECT * FROM Foo - * ORDER BY A DESC` becomes `SELECT * FROM Foo ORDER BY A DESC, __name__ - * DESC` * `SELECT * FROM Foo WHERE A > 1` becomes `SELECT * FROM Foo - * WHERE A > 1 ORDER BY A, __name__` - */ - orderBy: Schema$Order[]; + * The request for Firestore.Commit. + */ + export interface Schema$CommitRequest { + /** + * If set, applies all writes in this transaction, and commits it. + */ + transaction: string; + /** + * The writes to apply. Always executed atomically and in order. + */ + writes: Schema$Write[]; + } /** - * The projection to return. - */ - select: Schema$Projection; + * The response for Firestore.Commit. + */ + export interface Schema$CommitResponse { + /** + * The time at which the commit occurred. + */ + commitTime: string; + /** + * The result of applying the writes. This i-th write result corresponds to + * the i-th write in the request. + */ + writeResults: Schema$WriteResult[]; + } /** - * A starting point for the query results. - */ - startAt: Schema$Cursor; + * A filter that merges multiple other filters using the given operator. + */ + export interface Schema$CompositeFilter { + /** + * The list of filters to combine. Must contain at least one filter. + */ + filters: Schema$Filter[]; + /** + * The operator for combining multiple filters. + */ + op: string; + } /** - * The filter to apply. - */ - where: Schema$Filter; -} -/** - * A specification of a set of documents to listen to. - */ -export interface Schema$Target { + * A position in a query result set. + */ + export interface Schema$Cursor { + /** + * If the position is just before or just after the given values, relative + * to the sort order defined by the query. + */ + before: boolean; + /** + * The values that represent a position, in the order they appear in the + * order by clause of a query. Can contain fewer values than specified in + * the order by clause. + */ + values: Schema$Value[]; + } /** - * A target specified by a set of document names. - */ - documents: Schema$DocumentsTarget; + * A Firestore document. Must not exceed 1 MiB - 4 bytes. + */ + export interface Schema$Document { + /** + * Output only. The time at which the document was created. This value + * increases monotonically when a document is deleted then recreated. It can + * also be compared to values from other documents and the `read_time` of a + * query. + */ + createTime: string; + /** + * The document's fields. The map keys represent field names. A simple + * field name contains only characters `a` to `z`, `A` to `Z`, `0` to `9`, + * or `_`, and must not start with `0` to `9`. For example, `foo_bar_17`. + * Field names matching the regular expression `__.*__` are reserved. + * Reserved field names are forbidden except in certain documented contexts. + * The map keys, represented as UTF-8, must not exceed 1,500 bytes and + * cannot be empty. Field paths may be used in other contexts to refer to + * structured fields defined here. For `map_value`, the field path is + * represented by the simple or quoted field names of the containing fields, + * delimited by `.`. For example, the structured field `"foo" : { + * map_value: { "x&y" : { string_value: "hello" }}}` + * would be represented by the field path `foo.x&y`. Within a field + * path, a quoted field name starts and ends with `` ` `` and may contain + * any character. Some characters, including `` ` ``, must be escaped using + * a `\`. For example, `` `x&y` `` represents `x&y` and `` + * `bak\`tik` `` represents `` bak`tik ``. + */ + fields: any; + /** + * The resource name of the document, for example + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + name: string; + /** + * Output only. The time at which the document was last changed. This value + * is initially set to the `create_time` then increases monotonically with + * each change to the document. It can also be compared to values from other + * documents and the `read_time` of a query. + */ + updateTime: string; + } /** - * If the target should be removed once it is current and consistent. - */ - once: boolean; + * A Document has changed. May be the result of multiple writes, including + * deletes, that ultimately resulted in a new value for the Document. Multiple + * DocumentChange messages may be returned for the same logical change, if + * multiple targets are affected. + */ + export interface Schema$DocumentChange { + /** + * The new state of the Document. If `mask` is set, contains only fields + * that were updated or added. + */ + document: Schema$Document; + /** + * A set of target IDs for targets that no longer match this document. + */ + removedTargetIds: number[]; + /** + * A set of target IDs of targets that match this document. + */ + targetIds: number[]; + } /** - * A target specified by a query. - */ - query: Schema$QueryTarget; + * A Document has been deleted. May be the result of multiple writes, + * including updates, the last of which deleted the Document. Multiple + * DocumentDelete messages may be returned for the same logical delete, if + * multiple targets are affected. + */ + export interface Schema$DocumentDelete { + /** + * The resource name of the Document that was deleted. + */ + document: string; + /** + * The read timestamp at which the delete was observed. Greater or equal to + * the `commit_time` of the delete. + */ + readTime: string; + /** + * A set of target IDs for targets that previously matched this entity. + */ + removedTargetIds: number[]; + } /** - * Start listening after a specific `read_time`. The client must know the - * state of matching documents at this time. - */ - readTime: string; + * A set of field paths on a document. Used to restrict a get or update + * operation on a document to a subset of its fields. This is different from + * standard field masks, as this is always scoped to a Document, and takes in + * account the dynamic nature of Value. + */ + export interface Schema$DocumentMask { + /** + * The list of field paths in the mask. See Document.fields for a field path + * syntax reference. + */ + fieldPaths: string[]; + } /** - * A resume token from a prior TargetChange for an identical target. Using a - * resume token with a different target is unsupported and may fail. - */ - resumeToken: string; + * A Document has been removed from the view of the targets. Sent if the + * document is no longer relevant to a target and is out of view. Can be sent + * instead of a DocumentDelete or a DocumentChange if the server can not send + * the new value of the document. Multiple DocumentRemove messages may be + * returned for the same logical write or delete, if multiple targets are + * affected. + */ + export interface Schema$DocumentRemove { + /** + * The resource name of the Document that has gone out of view. + */ + document: string; + /** + * The read timestamp at which the remove was observed. Greater or equal to + * the `commit_time` of the change/delete/remove. + */ + readTime: string; + /** + * A set of target IDs for targets that previously matched this document. + */ + removedTargetIds: number[]; + } /** - * A client provided target ID. If not set, the server will assign an ID for - * the target. Used for resuming a target without changing IDs. The IDs can - * either be client-assigned or be server-assigned in a previous stream. All - * targets with client provided IDs must be added before adding a target that - * needs a server-assigned id. + * A target specified by a set of documents names. */ - targetId: number; -} -/** - * Targets being watched have changed. - */ -export interface Schema$TargetChange { + export interface Schema$DocumentsTarget { + /** + * The names of the documents to retrieve. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * The request will fail if any of the document is not a child resource of + * the given `database`. Duplicate names will be elided. + */ + documents: string[]; + } /** - * The error that resulted in this change, if applicable. - */ - cause: Schema$Status; + * A transformation of a document. + */ + export interface Schema$DocumentTransform { + /** + * The name of the document to transform. + */ + document: string; + /** + * The list of transformations to apply to the fields of the document, in + * order. This must not be empty. + */ + fieldTransforms: Schema$FieldTransform[]; + } /** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). The stream is guaranteed to - * send a `read_time` with `target_ids` empty whenever the entire stream - * reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are - * guaranteed to (eventually) result in a new consistent snapshot (while - * NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` is - * guaranteed to be monotonically increasing. - */ - readTime: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A digest of all the documents that match a given target. + */ + export interface Schema$ExistenceFilter { + /** + * The total count of documents that match target_id. If different from the + * count of documents in the client that match, the client must manually + * determine which documents no longer match the target. + */ + count: number; + /** + * The target ID to which this filter applies. + */ + targetId: number; + } /** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. Not set on every target change. - */ - resumeToken: string; + * A filter on a specific field. + */ + export interface Schema$FieldFilter { + /** + * The field to filter by. + */ + field: Schema$FieldReference; + /** + * The operator to filter by. + */ + op: string; + /** + * The value to compare to. + */ + value: Schema$Value; + } /** - * The type of change that occurred. + * A reference to a field, such as `max(messages.time) as max_time`. */ - targetChangeType: string; + export interface Schema$FieldReference { fieldPath: string; } /** - * The target IDs of targets that have changed. If empty, the change applies - * to all targets. For `target_change_type=ADD`, the order of the target IDs - * matches the order of the requests to add the targets. This allows clients - * to unambiguously associate server-assigned target IDs with added targets. - * For other states, the order of the target IDs is not defined. + * A transformation of a field of the document. */ - targetIds: number[]; -} -/** - * Options for creating a new transaction. - */ -export interface Schema$TransactionOptions { + export interface Schema$FieldTransform { + /** + * The path of the field. See Document.fields for the field path syntax + * reference. + */ + fieldPath: string; + /** + * Sets the field to the given server value. + */ + setToServerValue: string; + } /** - * The transaction can only be used for read operations. - */ - readOnly: Schema$ReadOnly; + * A filter. + */ + export interface Schema$Filter { + /** + * A composite filter. + */ + compositeFilter: Schema$CompositeFilter; + /** + * A filter on a document field. + */ + fieldFilter: Schema$FieldFilter; + /** + * A filter that takes exactly one argument. + */ + unaryFilter: Schema$UnaryFilter; + } /** - * The transaction can be used for both read and write operations. - */ - readWrite: Schema$ReadWrite; -} -/** - * A filter with a single operand. - */ -export interface Schema$UnaryFilter { + * An index definition. + */ + export interface Schema$Index { + /** + * The collection ID to which this index applies. Required. + */ + collectionId: string; + /** + * The fields to index. + */ + fields: Schema$IndexField[]; + /** + * The resource name of the index. Output only. + */ + name: string; + /** + * The state of the index. Output only. + */ + state: string; + } /** - * The field to which to apply the operator. - */ - field: Schema$FieldReference; + * A field of an index. + */ + export interface Schema$IndexField { + /** + * The path of the field. Must match the field path specification described + * by google.firestore.v1beta1.Document.fields. Special field path + * `__name__` may be used by itself or at the end of a path. `__type__` may + * be used only at the end of path. + */ + fieldPath: string; + /** + * The field's mode. + */ + mode: string; + } /** - * The unary operator to apply. - */ - op: string; -} -/** - * A message that can hold any of the supported value types. - */ -export interface Schema$Value { + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * An array value. Cannot directly contain another array value, though can - * contain an map which contains another array. - */ - arrayValue: Schema$ArrayValue; + * The request for Firestore.ListCollectionIds. + */ + export interface Schema$ListCollectionIdsRequest { + /** + * The maximum number of results to return. + */ + pageSize: number; + /** + * A page token. Must be a value from ListCollectionIdsResponse. + */ + pageToken: string; + } /** - * A boolean value. - */ - booleanValue: boolean; + * The response from Firestore.ListCollectionIds. + */ + export interface Schema$ListCollectionIdsResponse { + /** + * The collection ids. + */ + collectionIds: string[]; + /** + * A page token that may be used to continue the list. + */ + nextPageToken: string; + } /** - * A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 - * bytes are considered by queries. - */ - bytesValue: string; + * The response for Firestore.ListDocuments. + */ + export interface Schema$ListDocumentsResponse { + /** + * The Documents found. + */ + documents: Schema$Document[]; + /** + * The next page token. + */ + nextPageToken: string; + } /** - * A double value. - */ - doubleValue: number; + * A request for Firestore.Listen + */ + export interface Schema$ListenRequest { + /** + * A target to add to this stream. + */ + addTarget: Schema$Target; + /** + * Labels associated with this target change. + */ + labels: any; + /** + * The ID of a target to remove from this stream. + */ + removeTarget: number; + } /** - * A geo point value representing a point on the surface of Earth. - */ - geoPointValue: Schema$LatLng; + * The response for Firestore.Listen. + */ + export interface Schema$ListenResponse { + /** + * A Document has changed. + */ + documentChange: Schema$DocumentChange; + /** + * A Document has been deleted. + */ + documentDelete: Schema$DocumentDelete; + /** + * A Document has been removed from a target (because it is no longer + * relevant to that target). + */ + documentRemove: Schema$DocumentRemove; + /** + * A filter to apply to the set of documents previously returned for the + * given target. Returned when documents may have been removed from the + * given target, but the exact documents are unknown. + */ + filter: Schema$ExistenceFilter; + /** + * Targets have changed. + */ + targetChange: Schema$TargetChange; + } /** - * An integer value. - */ - integerValue: string; + * The response for FirestoreAdmin.ListIndexes. + */ + export interface Schema$ListIndexesResponse { + /** + * The indexes. + */ + indexes: Schema$Index[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** * A map value. */ - mapValue: Schema$MapValue; + export interface Schema$MapValue { + /** + * The map's fields. The map keys represent field names. Field names + * matching the regular expression `__.*__` are reserved. Reserved field + * names are forbidden except in certain documented contexts. The map keys, + * represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. + */ + fields: any; + } /** - * A null value. - */ - nullValue: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - */ - referenceValue: string; + * An order on a field. + */ + export interface Schema$Order { + /** + * The direction to order by. Defaults to `ASCENDING`. + */ + direction: string; + /** + * The field to order by. + */ + field: Schema$FieldReference; + } /** - * A string value. The string, represented as UTF-8, must not exceed 1 MiB - - * 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are - * considered by queries. - */ - stringValue: string; + * A precondition on a document, used for conditional operations. + */ + export interface Schema$Precondition { + /** + * When set to `true`, the target document must exist. When set to `false`, + * the target document must not exist. + */ + exists: boolean; + /** + * When set, the target document must exist and have been last updated at + * that time. + */ + updateTime: string; + } /** - * A timestamp value. Precise only to microseconds. When stored, any - * additional precision is rounded down. + * The projection of document's fields to return. */ - timestampValue: string; -} -/** - * A write on a document. - */ -export interface Schema$Write { + export interface Schema$Projection { + /** + * The fields to return. If empty, all fields are returned. To only return + * the name of the document, use `['__name__']`. + */ + fields: Schema$FieldReference[]; + } /** - * An optional precondition on the document. The write will fail if this is - * set and not met by the target document. + * A target specified by a query. */ - currentDocument: Schema$Precondition; + export interface Schema$QueryTarget { + /** + * The parent resource name. In the format: + * `projects/{project_id}/databases/{database_id}/documents` or + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * For example: `projects/my-project/databases/my-database/documents` or + * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + */ + parent: string; + /** + * A structured query. + */ + structuredQuery: Schema$StructuredQuery; + } /** - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * Options for a transaction that can only be used to read documents. */ - delete: string; + export interface Schema$ReadOnly { + /** + * Reads documents at the given time. This may not be older than 60 seconds. + */ + readTime: string; + } /** - * Applies a tranformation to a document. At most one `transform` per document - * is allowed in a given request. An `update` cannot follow a `transform` on - * the same document in a given request. + * Options for a transaction that can be used to read and write documents. */ - transform: Schema$DocumentTransform; + export interface Schema$ReadWrite { + /** + * An optional transaction to retry. + */ + retryTransaction: string; + } /** - * A document to write. + * The request for Firestore.Rollback. */ - update: Schema$Document; + export interface Schema$RollbackRequest { + /** + * The transaction to roll back. + */ + transaction: string; + } /** - * The fields to update in this write. This field can be set only when the - * operation is `update`. If the mask is not set for an `update` and the - * document exists, any existing data will be overwritten. If the mask is set - * and the document on the server has fields not covered by the mask, they are - * left unchanged. Fields referenced in the mask, but not present in the input - * document, are deleted from the document on the server. The field paths in - * this mask must not contain a reserved field name. - */ - updateMask: Schema$DocumentMask; -} -/** - * The request for Firestore.Write. The first request creates a stream, or - * resumes an existing one from a token. When creating a new stream, the server - * replies with a response containing only an ID and a token, to use in the next - * request. When resuming a stream, the server first streams any responses - * later than the given token, then a response containing only an up-to-date - * token, to use in the next request. - */ -export interface Schema$WriteRequest { + * The request for Firestore.RunQuery. + */ + export interface Schema$RunQueryRequest { + /** + * Starts a new transaction and reads the documents. Defaults to a read-only + * transaction. The new transaction ID will be returned as the first + * response in the stream. + */ + newTransaction: Schema$TransactionOptions; + /** + * Reads documents as they were at the given time. This may not be older + * than 60 seconds. + */ + readTime: string; + /** + * A structured query. + */ + structuredQuery: Schema$StructuredQuery; + /** + * Reads documents in a transaction. + */ + transaction: string; + } /** - * Labels associated with this write request. - */ - labels: any; + * The response for Firestore.RunQuery. + */ + export interface Schema$RunQueryResponse { + /** + * A query result. Not set when reporting partial progress. + */ + document: Schema$Document; + /** + * The time at which the document was read. This may be monotonically + * increasing; in this case, the previous documents in the result stream are + * guaranteed not to have changed between their `read_time` and this one. If + * the query returns no results, a response with `read_time` and no + * `document` will be sent, and this represents the time at which the query + * was run. + */ + readTime: string; + /** + * The number of results that have been skipped due to an offset between the + * last response and the current response. + */ + skippedResults: number; + /** + * The transaction that was started as part of this request. Can only be set + * in the first response, and only if RunQueryRequest.new_transaction was + * set in the request. If set, no other fields will be set in this response. + */ + transaction: string; + } /** - * The ID of the write stream to resume. This may only be set in the first - * message. When left empty, a new write stream will be created. - */ - streamId: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * A stream token that was previously sent by the server. The client should - * set this field to the token from the most recent WriteResponse it has - * received. This acknowledges that the client has received responses up to - * this token. After sending this token, earlier tokens may not be used - * anymore. The server may close the stream if there are too many - * unacknowledged responses. Leave this field unset when creating a new - * stream. To resume a stream at a specific point, set this field and the - * `stream_id` field. Leave this field unset when creating a new stream. - */ - streamToken: string; + * A Firestore query. + */ + export interface Schema$StructuredQuery { + /** + * A end point for the query results. + */ + endAt: Schema$Cursor; + /** + * The collections to query. + */ + from: Schema$CollectionSelector[]; + /** + * The maximum number of results to return. Applies after all other + * constraints. Must be >= 0 if specified. + */ + limit: number; + /** + * The number of results to skip. Applies before limit, but after all other + * constraints. Must be >= 0 if specified. + */ + offset: number; + /** + * The order to apply to the query results. Firestore guarantees a stable + * ordering through the following rules: * Any field required to appear in + * `order_by`, that is not already specified in `order_by`, is appended + * to the order in field name order by default. * If an order on + * `__name__` is not specified, it is appended by default. Fields are + * appended with the same sort direction as the last order specified, or + * 'ASCENDING' if no order was specified. For example: * `SELECT * + * FROM Foo ORDER BY A` becomes `SELECT * FROM Foo ORDER BY A, __name__` + * * `SELECT * FROM Foo ORDER BY A DESC` becomes `SELECT * FROM Foo ORDER + * BY A DESC, __name__ DESC` * `SELECT * FROM Foo WHERE A > 1` becomes + * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` + */ + orderBy: Schema$Order[]; + /** + * The projection to return. + */ + select: Schema$Projection; + /** + * A starting point for the query results. + */ + startAt: Schema$Cursor; + /** + * The filter to apply. + */ + where: Schema$Filter; + } /** - * The writes to apply. Always executed atomically and in order. This must be - * empty on the first request. This may be empty on the last request. This - * must not be empty on all other requests. - */ - writes: Schema$Write[]; -} -/** - * The response for Firestore.Write. - */ -export interface Schema$WriteResponse { + * A specification of a set of documents to listen to. + */ + export interface Schema$Target { + /** + * A target specified by a set of document names. + */ + documents: Schema$DocumentsTarget; + /** + * If the target should be removed once it is current and consistent. + */ + once: boolean; + /** + * A target specified by a query. + */ + query: Schema$QueryTarget; + /** + * Start listening after a specific `read_time`. The client must know the + * state of matching documents at this time. + */ + readTime: string; + /** + * A resume token from a prior TargetChange for an identical target. Using + * a resume token with a different target is unsupported and may fail. + */ + resumeToken: string; + /** + * A client provided target ID. If not set, the server will assign an ID + * for the target. Used for resuming a target without changing IDs. The IDs + * can either be client-assigned or be server-assigned in a previous stream. + * All targets with client provided IDs must be added before adding a target + * that needs a server-assigned id. + */ + targetId: number; + } /** - * The time at which the commit occurred. - */ - commitTime: string; + * Targets being watched have changed. + */ + export interface Schema$TargetChange { + /** + * The error that resulted in this change, if applicable. + */ + cause: Schema$Status; + /** + * The consistent `read_time` for the given `target_ids` (omitted when the + * target_ids are not at a consistent snapshot). The stream is guaranteed + * to send a `read_time` with `target_ids` empty whenever the entire stream + * reaches a new consistent snapshot. ADD, CURRENT, and RESET messages are + * guaranteed to (eventually) result in a new consistent snapshot (while + * NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` + * is guaranteed to be monotonically increasing. + */ + readTime: string; + /** + * A token that can be used to resume the stream for the given `target_ids`, + * or all targets if `target_ids` is empty. Not set on every target change. + */ + resumeToken: string; + /** + * The type of change that occurred. + */ + targetChangeType: string; + /** + * The target IDs of targets that have changed. If empty, the change + * applies to all targets. For `target_change_type=ADD`, the order of the + * target IDs matches the order of the requests to add the targets. This + * allows clients to unambiguously associate server-assigned target IDs with + * added targets. For other states, the order of the target IDs is not + * defined. + */ + targetIds: number[]; + } /** - * The ID of the stream. Only set on the first message, when a new stream was - * created. - */ - streamId: string; + * Options for creating a new transaction. + */ + export interface Schema$TransactionOptions { + /** + * The transaction can only be used for read operations. + */ + readOnly: Schema$ReadOnly; + /** + * The transaction can be used for both read and write operations. + */ + readWrite: Schema$ReadWrite; + } /** - * A token that represents the position of this response in the stream. This - * can be used by a client to resume the stream at this point. This field is - * always set. - */ - streamToken: string; + * A filter with a single operand. + */ + export interface Schema$UnaryFilter { + /** + * The field to which to apply the operator. + */ + field: Schema$FieldReference; + /** + * The unary operator to apply. + */ + op: string; + } /** - * The result of applying the writes. This i-th write result corresponds to - * the i-th write in the request. - */ - writeResults: Schema$WriteResult[]; -} -/** - * The result of applying a write. - */ -export interface Schema$WriteResult { + * A message that can hold any of the supported value types. + */ + export interface Schema$Value { + /** + * An array value. Cannot directly contain another array value, though can + * contain an map which contains another array. + */ + arrayValue: Schema$ArrayValue; + /** + * A boolean value. + */ + booleanValue: boolean; + /** + * A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 + * bytes are considered by queries. + */ + bytesValue: string; + /** + * A double value. + */ + doubleValue: number; + /** + * A geo point value representing a point on the surface of Earth. + */ + geoPointValue: Schema$LatLng; + /** + * An integer value. + */ + integerValue: string; + /** + * A map value. + */ + mapValue: Schema$MapValue; + /** + * A null value. + */ + nullValue: string; + /** + * A reference to a document. For example: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + referenceValue: string; + /** + * A string value. The string, represented as UTF-8, must not exceed 1 MiB + * - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are + * considered by queries. + */ + stringValue: string; + /** + * A timestamp value. Precise only to microseconds. When stored, any + * additional precision is rounded down. + */ + timestampValue: string; + } /** - * The results of applying each DocumentTransform.FieldTransform, in the same - * order. - */ - transformResults: Schema$Value[]; + * A write on a document. + */ + export interface Schema$Write { + /** + * An optional precondition on the document. The write will fail if this is + * set and not met by the target document. + */ + currentDocument: Schema$Precondition; + /** + * A document name to delete. In the format: + * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + */ + delete: string; + /** + * Applies a tranformation to a document. At most one `transform` per + * document is allowed in a given request. An `update` cannot follow a + * `transform` on the same document in a given request. + */ + transform: Schema$DocumentTransform; + /** + * A document to write. + */ + update: Schema$Document; + /** + * The fields to update in this write. This field can be set only when the + * operation is `update`. If the mask is not set for an `update` and the + * document exists, any existing data will be overwritten. If the mask is + * set and the document on the server has fields not covered by the mask, + * they are left unchanged. Fields referenced in the mask, but not present + * in the input document, are deleted from the document on the server. The + * field paths in this mask must not contain a reserved field name. + */ + updateMask: Schema$DocumentMask; + } /** - * The last update time of the document after applying the write. Not set - * after a `delete`. If the write did not actually change the document, this - * will be the previous update_time. - */ - updateTime: string; -} - -export class Resource$Projects { - root: Firestore; - databases: Resource$Projects$Databases; - constructor(root: Firestore) { - this.root = root; - this.getRoot.bind(this); - this.databases = new Resource$Projects$Databases(root); + * The request for Firestore.Write. The first request creates a stream, or + * resumes an existing one from a token. When creating a new stream, the + * server replies with a response containing only an ID and a token, to use in + * the next request. When resuming a stream, the server first streams any + * responses later than the given token, then a response containing only an + * up-to-date token, to use in the next request. + */ + export interface Schema$WriteRequest { + /** + * Labels associated with this write request. + */ + labels: any; + /** + * The ID of the write stream to resume. This may only be set in the first + * message. When left empty, a new write stream will be created. + */ + streamId: string; + /** + * A stream token that was previously sent by the server. The client should + * set this field to the token from the most recent WriteResponse it has + * received. This acknowledges that the client has received responses up to + * this token. After sending this token, earlier tokens may not be used + * anymore. The server may close the stream if there are too many + * unacknowledged responses. Leave this field unset when creating a new + * stream. To resume a stream at a specific point, set this field and the + * `stream_id` field. Leave this field unset when creating a new stream. + */ + streamToken: string; + /** + * The writes to apply. Always executed atomically and in order. This must + * be empty on the first request. This may be empty on the last request. + * This must not be empty on all other requests. + */ + writes: Schema$Write[]; } - - getRoot() { - return this.root; + /** + * The response for Firestore.Write. + */ + export interface Schema$WriteResponse { + /** + * The time at which the commit occurred. + */ + commitTime: string; + /** + * The ID of the stream. Only set on the first message, when a new stream + * was created. + */ + streamId: string; + /** + * A token that represents the position of this response in the stream. This + * can be used by a client to resume the stream at this point. This field + * is always set. + */ + streamToken: string; + /** + * The result of applying the writes. This i-th write result corresponds to + * the i-th write in the request. + */ + writeResults: Schema$WriteResult[]; } -} -export class Resource$Projects$Databases { - root: Firestore; - documents: Resource$Projects$Databases$Documents; - indexes: Resource$Projects$Databases$Indexes; - constructor(root: Firestore) { - this.root = root; - this.getRoot.bind(this); - this.documents = new Resource$Projects$Databases$Documents(root); - this.indexes = new Resource$Projects$Databases$Indexes(root); + /** + * The result of applying a write. + */ + export interface Schema$WriteResult { + /** + * The results of applying each DocumentTransform.FieldTransform, in the + * same order. + */ + transformResults: Schema$Value[]; + /** + * The last update time of the document after applying the write. Not set + * after a `delete`. If the write did not actually change the document, + * this will be the previous update_time. + */ + updateTime: string; } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Databases$Documents { - root: Firestore; - constructor(root: Firestore) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects { + root: Firestore; + databases: Resource$Projects$Databases; + constructor(root: Firestore) { + this.root = root; + this.getRoot.bind(this); + this.databases = new Resource$Projects$Databases(root); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } + export class Resource$Projects$Databases { + root: Firestore; + documents: Resource$Projects$Databases$Documents; + indexes: Resource$Projects$Databases$Indexes; + constructor(root: Firestore) { + this.root = root; + this.getRoot.bind(this); + this.documents = new Resource$Projects$Databases$Documents(root); + this.indexes = new Resource$Projects$Databases$Indexes(root); + } - - /** - * firestore.projects.databases.documents.batchGet - * @desc Gets multiple documents. Documents returned by this method are not - * guaranteed to be returned in the same order that they were requested. - * @alias firestore.projects.databases.documents.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. - * @param {().BatchGetDocumentsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Databases$Documents { + root: Firestore; + constructor(root: Firestore) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:batchGet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * firestore.projects.databases.documents.beginTransaction - * @desc Starts a new transaction. - * @alias firestore.projects.databases.documents.beginTransaction - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. - * @param {().BeginTransactionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - beginTransaction(params?: any, options?: MethodOptions): - AxiosPromise; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - beginTransaction( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.batchGet + * @desc Gets multiple documents. Documents returned by this method are not + * guaranteed to be returned in the same order that they were requested. + * @alias firestore.projects.databases.documents.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. + * @param {().BatchGetDocumentsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:beginTransaction') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.commit - * @desc Commits a transaction, while optionally updating documents. - * @alias firestore.projects.databases.documents.commit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. - * @param {().CommitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - commit(params?: any, options?: MethodOptions): - AxiosPromise; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.beginTransaction + * @desc Starts a new transaction. + * @alias firestore.projects.databases.documents.beginTransaction + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. + * @param {().BeginTransactionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + beginTransaction(params?: any, options?: MethodOptions): + AxiosPromise; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + beginTransaction( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:beginTransaction') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:commit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.createDocument - * @desc Creates a new document. - * @alias firestore.projects.databases.documents.createDocument - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collectionId The collection ID, relative to `parent`, to list. For example: `chatrooms`. - * @param {string=} params.documentId The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. - * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. - * @param {string} params.parent The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - * @param {().Document} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createDocument(params?: any, options?: MethodOptions): - AxiosPromise; - createDocument( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createDocument( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.commit + * @desc Commits a transaction, while optionally updating documents. + * @alias firestore.projects.databases.documents.commit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. + * @param {().CommitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + commit(params?: any, options?: MethodOptions): + AxiosPromise; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:commit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/{collectionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent', 'collectionId'], - pathParams: ['collectionId', 'parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.delete - * @desc Deletes a document. - * @alias firestore.projects.databases.documents.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.currentDocument.exists When set to `true`, the target document must exist. When set to `false`, the target document must not exist. - * @param {string=} params.currentDocument.updateTime When set, the target document must exist and have been last updated at that time. - * @param {string} params.name The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.createDocument + * @desc Creates a new document. + * @alias firestore.projects.databases.documents.createDocument + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collectionId The collection ID, relative to `parent`, to list. For example: `chatrooms`. + * @param {string=} params.documentId The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. + * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. + * @param {string} params.parent The parent resource. For example: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` + * @param {().Document} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createDocument(params?: any, options?: MethodOptions): + AxiosPromise; + createDocument( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createDocument( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/{collectionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent', 'collectionId'], + pathParams: ['collectionId', 'parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.get - * @desc Gets a single document. - * @alias firestore.projects.databases.documents.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. - * @param {string} params.name The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {string=} params.readTime Reads the version of the document at the given time. This may not be older than 60 seconds. - * @param {string=} params.transaction Reads the document in a transaction. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.delete + * @desc Deletes a document. + * @alias firestore.projects.databases.documents.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.currentDocument.exists When set to `true`, the target document must exist. When set to `false`, the target document must not exist. + * @param {string=} params.currentDocument.updateTime When set, the target document must exist and have been last updated at that time. + * @param {string} params.name The resource name of the Document to delete. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.list - * @desc Lists documents. - * @alias firestore.projects.databases.documents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collectionId The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. - * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. - * @param {string=} params.orderBy The order to sort results by. For example: `priority desc, name`. - * @param {integer=} params.pageSize The maximum number of documents to return. - * @param {string=} params.pageToken The `next_page_token` value returned from a previous List request, if any. - * @param {string} params.parent The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {string=} params.readTime Reads documents as they were at the given time. This may not be older than 60 seconds. - * @param {boolean=} params.showMissing If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have fields, Document.create_time, or Document.update_time set. Requests with `show_missing` may not specify `where` or `order_by`. - * @param {string=} params.transaction Reads documents in a transaction. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.get + * @desc Gets a single document. + * @alias firestore.projects.databases.documents.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. + * @param {string} params.name The resource name of the Document to get. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @param {string=} params.readTime Reads the version of the document at the given time. This may not be older than 60 seconds. + * @param {string=} params.transaction Reads the document in a transaction. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/{collectionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent', 'collectionId'], - pathParams: ['collectionId', 'parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.listCollectionIds - * @desc Lists all the collection IDs underneath a document. - * @alias firestore.projects.databases.documents.listCollectionIds - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {().ListCollectionIdsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listCollectionIds(params?: any, options?: MethodOptions): - AxiosPromise; - listCollectionIds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listCollectionIds( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.list + * @desc Lists documents. + * @alias firestore.projects.databases.documents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collectionId The collection ID, relative to `parent`, to list. For example: `chatrooms` or `messages`. + * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. + * @param {string=} params.orderBy The order to sort results by. For example: `priority desc, name`. + * @param {integer=} params.pageSize The maximum number of documents to return. + * @param {string=} params.pageToken The `next_page_token` value returned from a previous List request, if any. + * @param {string} params.parent The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param {string=} params.readTime Reads documents as they were at the given time. This may not be older than 60 seconds. + * @param {boolean=} params.showMissing If the list should show missing documents. A missing document is a document that does not exist but has sub-documents. These documents will be returned with a key but will not have fields, Document.create_time, or Document.update_time set. Requests with `show_missing` may not specify `where` or `order_by`. + * @param {string=} params.transaction Reads documents in a transaction. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/{collectionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent', 'collectionId'], + pathParams: ['collectionId', 'parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}:listCollectionIds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.listen - * @desc Listens to changes. - * @alias firestore.projects.databases.documents.listen - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. - * @param {().ListenRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listen(params?: any, options?: MethodOptions): - AxiosPromise; - listen( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listen( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.listCollectionIds + * @desc Lists all the collection IDs underneath a document. + * @alias firestore.projects.databases.documents.listCollectionIds + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent document. In the format: `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param {().ListCollectionIdsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listCollectionIds(params?: any, options?: MethodOptions): + AxiosPromise; + listCollectionIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listCollectionIds( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}:listCollectionIds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:listen') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.patch - * @desc Updates or inserts a document. - * @alias firestore.projects.databases.documents.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.currentDocument.exists When set to `true`, the target document must exist. When set to `false`, the target document must not exist. - * @param {string=} params.currentDocument.updateTime When set, the target document must exist and have been last updated at that time. - * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. - * @param {string} params.name The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * @param {string=} params.updateMask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. - * @param {().Document} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.listen + * @desc Listens to changes. + * @alias firestore.projects.databases.documents.listen + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. + * @param {().ListenRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listen(params?: any, options?: MethodOptions): + AxiosPromise; + listen( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listen( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:listen') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.rollback - * @desc Rolls back a transaction. - * @alias firestore.projects.databases.documents.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. - * @param {().RollbackRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): AxiosPromise; - rollback( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.patch + * @desc Updates or inserts a document. + * @alias firestore.projects.databases.documents.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.currentDocument.exists When set to `true`, the target document must exist. When set to `false`, the target document must not exist. + * @param {string=} params.currentDocument.updateTime When set, the target document must exist and have been last updated at that time. + * @param {string=} params.mask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. + * @param {string} params.name The resource name of the document, for example `projects/{project_id}/databases/{database_id}/documents/{document_path}`. + * @param {string=} params.updateMask.fieldPaths The list of field paths in the mask. See Document.fields for a field path syntax reference. + * @param {().Document} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.runQuery - * @desc Runs a query. - * @alias firestore.projects.databases.documents.runQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - * @param {().RunQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runQuery(params?: any, options?: MethodOptions): - AxiosPromise; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.rollback + * @desc Rolls back a transaction. + * @alias firestore.projects.databases.documents.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. + * @param {().RollbackRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}:runQuery') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.documents.write - * @desc Streams batches of document updates and deletes, in order. - * @alias firestore.projects.databases.documents.write - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message. - * @param {().WriteRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - write(params?: any, options?: MethodOptions): - AxiosPromise; - write( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - write( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.documents.runQuery + * @desc Runs a query. + * @alias firestore.projects.databases.documents.runQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The parent resource name. In the format: `projects/{project_id}/databases/{database_id}/documents` or `projects/{project_id}/databases/{database_id}/documents/{document_path}`. For example: `projects/my-project/databases/my-database/documents` or `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` + * @param {().RunQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runQuery(params?: any, options?: MethodOptions): + AxiosPromise; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}:runQuery') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+database}/documents:write') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Databases$Indexes { - root: Firestore; - constructor(root: Firestore) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * firestore.projects.databases.documents.write + * @desc Streams batches of document updates and deletes, in order. + * @alias firestore.projects.databases.documents.write + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database The database name. In the format: `projects/{project_id}/databases/{database_id}`. This is only required in the first message. + * @param {().WriteRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + write(params?: any, options?: MethodOptions): + AxiosPromise; + write( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + write( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+database}/documents:write') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * firestore.projects.databases.indexes.create - * @desc Creates the specified index. A newly created index's initial state is - * `CREATING`. On completion of the returned google.longrunning.Operation, the - * state will be `READY`. If the index already exists, the call will return an - * `ALREADY_EXISTS` status. During creation, the process could result in an - * error, in which case the index will move to the `ERROR` state. The process - * can be recovered by fixing the data that caused the error, removing the - * index with delete, then re-creating the index with create. Indexes with a - * single field cannot be created. - * @alias firestore.projects.databases.indexes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The name of the database this index will apply to. For example: `projects/{project_id}/databases/{database_id}` - * @param {().Index} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Databases$Indexes { + root: Firestore; + constructor(root: Firestore) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/indexes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * firestore.projects.databases.indexes.delete - * @desc Deletes an index. - * @alias firestore.projects.databases.indexes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The index name. For example: `projects/{project_id}/databases/{database_id}/indexes/{index_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.indexes.create + * @desc Creates the specified index. A newly created index's initial state + * is `CREATING`. On completion of the returned + * google.longrunning.Operation, the state will be `READY`. If the index + * already exists, the call will return an `ALREADY_EXISTS` status. During + * creation, the process could result in an error, in which case the index + * will move to the `ERROR` state. The process can be recovered by fixing + * the data that caused the error, removing the index with delete, then + * re-creating the index with create. Indexes with a single field cannot be + * created. + * @alias firestore.projects.databases.indexes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The name of the database this index will apply to. For example: `projects/{project_id}/databases/{database_id}` + * @param {().Index} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/indexes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.indexes.get - * @desc Gets an index. - * @alias firestore.projects.databases.indexes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the index. For example: `projects/{project_id}/databases/{database_id}/indexes/{index_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.indexes.delete + * @desc Deletes an index. + * @alias firestore.projects.databases.indexes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The index name. For example: `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * firestore.projects.databases.indexes.list - * @desc Lists the indexes that match the specified filters. - * @alias firestore.projects.databases.indexes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter - * @param {integer=} params.pageSize The standard List page size. - * @param {string=} params.pageToken The standard List page token. - * @param {string} params.parent The database name. For example: `projects/{project_id}/databases/{database_id}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * firestore.projects.databases.indexes.get + * @desc Gets an index. + * @alias firestore.projects.databases.indexes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the index. For example: `projects/{project_id}/databases/{database_id}/indexes/{index_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/indexes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * firestore.projects.databases.indexes.list + * @desc Lists the indexes that match the specified filters. + * @alias firestore.projects.databases.indexes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter + * @param {integer=} params.pageSize The standard List page size. + * @param {string=} params.pageToken The standard List page token. + * @param {string} params.parent The database name. For example: `projects/{project_id}/databases/{database_id}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://firestore.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/indexes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/fitness/v1.ts b/src/apis/fitness/v1.ts index 2def9f04728..68067152df5 100644 --- a/src/apis/fitness/v1.ts +++ b/src/apis/fitness/v1.ts @@ -27,1485 +27,1498 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Fitness - * - * Stores and accesses user data in the fitness store from apps on any platform. - * - * @example - * const google = require('googleapis'); - * const fitness = google.fitness('v1'); - * - * @namespace fitness - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Fitness - */ -export class Fitness { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace fitness_v1 { + /** + * Fitness + * + * Stores and accesses user data in the fitness store from apps on any + * platform. + * + * @example + * const google = require('googleapis'); + * const fitness = google.fitness('v1'); + * + * @namespace fitness + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Fitness + */ + export class Fitness { + _options: GlobalOptions; + google: GoogleApis; + root = this; - users: Resource$Users; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.users = new Resource$Users(this); - } + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$AggregateBucket { - /** - * Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT - */ - activity: number; - /** - * There will be one dataset per AggregateBy in the request. - */ - dataset: Schema$Dataset[]; - /** - * The end time for the aggregated data, in milliseconds since epoch, - * inclusive. - */ - endTimeMillis: string; - /** - * Available for Bucket.Type.SESSION - */ - session: Schema$Session; - /** - * The start time for the aggregated data, in milliseconds since epoch, - * inclusive. - */ - startTimeMillis: string; - /** - * The type of a bucket signifies how the data aggregation is performed in the - * bucket. - */ - type: string; -} -/** - * The specification of which data to aggregate. - */ -export interface Schema$AggregateBy { - /** - * A data source ID to aggregate. Mutually exclusive of dataTypeName. Only - * data from the specified data source ID will be included in the aggregation. - * The dataset in the response will have the same data source ID. - */ - dataSourceId: string; - /** - * The data type to aggregate. All data sources providing this data type will - * contribute data to the aggregation. The response will contain a single - * dataset for this data type name. The dataset will have a data source ID of - * derived:com.google.:com.google.android.gms:aggregated - */ - dataTypeName: string; -} -/** - * Next id: 10 - */ -export interface Schema$AggregateRequest { - /** - * The specification of data to be aggregated. At least one aggregateBy spec - * must be provided. All data that is specified will be aggregated using the - * same bucketing criteria. There will be one dataset in the response for - * every aggregateBy spec. - */ - aggregateBy: Schema$AggregateBy[]; - /** - * Specifies that data be aggregated each activity segment recored for a user. - * Similar to bucketByActivitySegment, but bucketing is done for each activity - * segment rather than all segments of the same type. Mutually exclusive of - * other bucketing specifications. - */ - bucketByActivitySegment: Schema$BucketByActivity; - /** - * Specifies that data be aggregated by the type of activity being performed - * when the data was recorded. All data that was recorded during a certain - * activity type (for the given time range) will be aggregated into the same - * bucket. Data that was recorded while the user was not active will not be - * included in the response. Mutually exclusive of other bucketing - * specifications. - */ - bucketByActivityType: Schema$BucketByActivity; - /** - * Specifies that data be aggregated by user sessions. Data that does not fall - * within the time range of a session will not be included in the response. - * Mutually exclusive of other bucketing specifications. - */ - bucketBySession: Schema$BucketBySession; - /** - * Specifies that data be aggregated by a single time interval. Mutually - * exclusive of other bucketing specifications. - */ - bucketByTime: Schema$BucketByTime; - /** - * The end of a window of time. Data that intersects with this time window - * will be aggregated. The time is in milliseconds since epoch, inclusive. - */ - endTimeMillis: string; - /** - * A list of acceptable data quality standards. Only data points which conform - * to at least one of the specified data quality standards will be returned. - * If the list is empty, all data points are returned. - */ - filteredDataQualityStandard: string[]; - /** - * The start of a window of time. Data that intersects with this time window - * will be aggregated. The time is in milliseconds since epoch, inclusive. - */ - startTimeMillis: string; -} -export interface Schema$AggregateResponse { - /** - * A list of buckets containing the aggregated data. - */ - bucket: Schema$AggregateBucket[]; -} -export interface Schema$Application { - /** - * An optional URI that can be used to link back to the application. - */ - detailsUrl: string; - /** - * The name of this application. This is required for REST clients, but we do - * not enforce uniqueness of this name. It is provided as a matter of - * convenience for other developers who would like to identify which REST - * created an Application or Data Source. - */ - name: string; - /** - * Package name for this application. This is used as a unique identifier when - * created by Android applications, but cannot be specified by REST clients. - * REST clients will have their developer project number reflected into the - * Data Source data stream IDs, instead of the packageName. - */ - packageName: string; - /** - * Version of the application. You should update this field whenever the - * application changes in a way that affects the computation of the data. - */ - version: string; -} -export interface Schema$BucketByActivity { - /** - * The default activity stream will be used if a specific activityDataSourceId - * is not specified. - */ - activityDataSourceId: string; - /** - * Specifies that only activity segments of duration longer than - * minDurationMillis are considered and used as a container for aggregated - * data. - */ - minDurationMillis: string; -} -export interface Schema$BucketBySession { - /** - * Specifies that only sessions of duration longer than minDurationMillis are - * considered and used as a container for aggregated data. - */ - minDurationMillis: string; -} -export interface Schema$BucketByTime { - /** - * Specifies that result buckets aggregate data by exactly durationMillis time - * frames. Time frames that contain no data will be included in the response - * with an empty dataset. - */ - durationMillis: string; - period: Schema$BucketByTimePeriod; -} -export interface Schema$BucketByTimePeriod { - /** - * org.joda.timezone.DateTimeZone - */ - timeZoneId: string; - type: string; - value: number; -} -/** - * Represents a single data point, generated by a particular data source. A data - * point holds a value for each field, an end timestamp and an optional start - * time. The exact semantics of each of these attributes are specified in the - * documentation for the particular data type. A data point can represent an - * instantaneous measurement, reading or input observation, as well as averages - * or aggregates over a time interval. Check the data type documentation to - * determine which is the case for a particular data type. Data points always - * contain one value for each field of the data type. - */ -export interface Schema$DataPoint { - /** - * Used for version checking during transformation; that is, a datapoint can - * only replace another datapoint that has an older computation time stamp. - */ - computationTimeMillis: string; - /** - * The data type defining the format of the values in this data point. - */ - dataTypeName: string; - /** - * The end time of the interval represented by this data point, in nanoseconds - * since epoch. - */ - endTimeNanos: string; - /** - * Indicates the last time this data point was modified. Useful only in - * contexts where we are listing the data changes, rather than representing - * the current state of the data. - */ - modifiedTimeMillis: string; - /** - * If the data point is contained in a dataset for a derived data source, this - * field will be populated with the data source stream ID that created the - * data point originally. - */ - originDataSourceId: string; - /** - * The raw timestamp from the original SensorEvent. - */ - rawTimestampNanos: string; - /** - * The start time of the interval represented by this data point, in - * nanoseconds since epoch. - */ - startTimeNanos: string; - /** - * Values of each data type field for the data point. It is expected that each - * value corresponding to a data type field will occur in the same order that - * the field is listed with in the data type specified in a data source. Only - * one of integer and floating point fields will be populated, depending on - * the format enum value within data source's type field. - */ - value: Schema$Value[]; -} -/** - * A dataset represents a projection container for data points. They do not - * carry any info of their own. Datasets represent a set of data points from a - * particular data source. A data point can be found in more than one dataset. - */ -export interface Schema$Dataset { - /** - * The data stream ID of the data source that created the points in this - * dataset. - */ - dataSourceId: string; - /** - * The largest end time of all data points in this possibly partial - * representation of the dataset. Time is in nanoseconds from epoch. This - * should also match the first part of the dataset identifier. - */ - maxEndTimeNs: string; - /** - * The smallest start time of all data points in this possibly partial - * representation of the dataset. Time is in nanoseconds from epoch. This - * should also match the first part of the dataset identifier. - */ - minStartTimeNs: string; + export interface Schema$AggregateBucket { + /** + * Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT + */ + activity: number; + /** + * There will be one dataset per AggregateBy in the request. + */ + dataset: Schema$Dataset[]; + /** + * The end time for the aggregated data, in milliseconds since epoch, + * inclusive. + */ + endTimeMillis: string; + /** + * Available for Bucket.Type.SESSION + */ + session: Schema$Session; + /** + * The start time for the aggregated data, in milliseconds since epoch, + * inclusive. + */ + startTimeMillis: string; + /** + * The type of a bucket signifies how the data aggregation is performed in + * the bucket. + */ + type: string; + } /** - * This token will be set when a dataset is received in response to a GET - * request and the dataset is too large to be included in a single response. - * Provide this value in a subsequent GET request to return the next page of - * data points within this dataset. - */ - nextPageToken: string; + * The specification of which data to aggregate. + */ + export interface Schema$AggregateBy { + /** + * A data source ID to aggregate. Mutually exclusive of dataTypeName. Only + * data from the specified data source ID will be included in the + * aggregation. The dataset in the response will have the same data source + * ID. + */ + dataSourceId: string; + /** + * The data type to aggregate. All data sources providing this data type + * will contribute data to the aggregation. The response will contain a + * single dataset for this data type name. The dataset will have a data + * source ID of derived:com.google.:com.google.android.gms:aggregated + */ + dataTypeName: string; + } /** - * A partial list of data points contained in the dataset, ordered by largest - * endTimeNanos first. This list is considered complete when retrieving a - * small dataset and partial when patching a dataset or retrieving a dataset - * that is too large to include in a single response. - */ - point: Schema$DataPoint[]; -} -/** - * Definition of a unique source of sensor data. Data sources can expose raw - * data coming from hardware sensors on local or companion devices. They can - * also expose derived data, created by transforming or merging other data - * sources. Multiple data sources can exist for the same data type. Every data - * point inserted into or read from this service has an associated data source. - * The data source contains enough information to uniquely identify its data, - * including the hardware device and the application that collected and/or - * transformed the data. It also holds useful metadata, such as the hardware and - * application versions, and the device type. Each data source produces a - * unique stream of data, with a unique identifier. Not all changes to data - * source affect the stream identifier, so that data collected by updated - * versions of the same application/device can still be considered to belong to - * the same data stream. - */ -export interface Schema$DataSource { + * Next id: 10 + */ + export interface Schema$AggregateRequest { + /** + * The specification of data to be aggregated. At least one aggregateBy spec + * must be provided. All data that is specified will be aggregated using the + * same bucketing criteria. There will be one dataset in the response for + * every aggregateBy spec. + */ + aggregateBy: Schema$AggregateBy[]; + /** + * Specifies that data be aggregated each activity segment recored for a + * user. Similar to bucketByActivitySegment, but bucketing is done for each + * activity segment rather than all segments of the same type. Mutually + * exclusive of other bucketing specifications. + */ + bucketByActivitySegment: Schema$BucketByActivity; + /** + * Specifies that data be aggregated by the type of activity being performed + * when the data was recorded. All data that was recorded during a certain + * activity type (for the given time range) will be aggregated into the same + * bucket. Data that was recorded while the user was not active will not be + * included in the response. Mutually exclusive of other bucketing + * specifications. + */ + bucketByActivityType: Schema$BucketByActivity; + /** + * Specifies that data be aggregated by user sessions. Data that does not + * fall within the time range of a session will not be included in the + * response. Mutually exclusive of other bucketing specifications. + */ + bucketBySession: Schema$BucketBySession; + /** + * Specifies that data be aggregated by a single time interval. Mutually + * exclusive of other bucketing specifications. + */ + bucketByTime: Schema$BucketByTime; + /** + * The end of a window of time. Data that intersects with this time window + * will be aggregated. The time is in milliseconds since epoch, inclusive. + */ + endTimeMillis: string; + /** + * A list of acceptable data quality standards. Only data points which + * conform to at least one of the specified data quality standards will be + * returned. If the list is empty, all data points are returned. + */ + filteredDataQualityStandard: string[]; + /** + * The start of a window of time. Data that intersects with this time window + * will be aggregated. The time is in milliseconds since epoch, inclusive. + */ + startTimeMillis: string; + } + export interface Schema$AggregateResponse { + /** + * A list of buckets containing the aggregated data. + */ + bucket: Schema$AggregateBucket[]; + } + export interface Schema$Application { + /** + * An optional URI that can be used to link back to the application. + */ + detailsUrl: string; + /** + * The name of this application. This is required for REST clients, but we + * do not enforce uniqueness of this name. It is provided as a matter of + * convenience for other developers who would like to identify which REST + * created an Application or Data Source. + */ + name: string; + /** + * Package name for this application. This is used as a unique identifier + * when created by Android applications, but cannot be specified by REST + * clients. REST clients will have their developer project number reflected + * into the Data Source data stream IDs, instead of the packageName. + */ + packageName: string; + /** + * Version of the application. You should update this field whenever the + * application changes in a way that affects the computation of the data. + */ + version: string; + } + export interface Schema$BucketByActivity { + /** + * The default activity stream will be used if a specific + * activityDataSourceId is not specified. + */ + activityDataSourceId: string; + /** + * Specifies that only activity segments of duration longer than + * minDurationMillis are considered and used as a container for aggregated + * data. + */ + minDurationMillis: string; + } + export interface Schema$BucketBySession { + /** + * Specifies that only sessions of duration longer than minDurationMillis + * are considered and used as a container for aggregated data. + */ + minDurationMillis: string; + } + export interface Schema$BucketByTime { + /** + * Specifies that result buckets aggregate data by exactly durationMillis + * time frames. Time frames that contain no data will be included in the + * response with an empty dataset. + */ + durationMillis: string; + period: Schema$BucketByTimePeriod; + } + export interface Schema$BucketByTimePeriod { + /** + * org.joda.timezone.DateTimeZone + */ + timeZoneId: string; + type: string; + value: number; + } /** - * Information about an application which feeds sensor data into the platform. - */ - application: Schema$Application; - dataQualityStandard: string[]; + * Represents a single data point, generated by a particular data source. A + * data point holds a value for each field, an end timestamp and an optional + * start time. The exact semantics of each of these attributes are specified + * in the documentation for the particular data type. A data point can + * represent an instantaneous measurement, reading or input observation, as + * well as averages or aggregates over a time interval. Check the data type + * documentation to determine which is the case for a particular data type. + * Data points always contain one value for each field of the data type. + */ + export interface Schema$DataPoint { + /** + * Used for version checking during transformation; that is, a datapoint can + * only replace another datapoint that has an older computation time stamp. + */ + computationTimeMillis: string; + /** + * The data type defining the format of the values in this data point. + */ + dataTypeName: string; + /** + * The end time of the interval represented by this data point, in + * nanoseconds since epoch. + */ + endTimeNanos: string; + /** + * Indicates the last time this data point was modified. Useful only in + * contexts where we are listing the data changes, rather than representing + * the current state of the data. + */ + modifiedTimeMillis: string; + /** + * If the data point is contained in a dataset for a derived data source, + * this field will be populated with the data source stream ID that created + * the data point originally. + */ + originDataSourceId: string; + /** + * The raw timestamp from the original SensorEvent. + */ + rawTimestampNanos: string; + /** + * The start time of the interval represented by this data point, in + * nanoseconds since epoch. + */ + startTimeNanos: string; + /** + * Values of each data type field for the data point. It is expected that + * each value corresponding to a data type field will occur in the same + * order that the field is listed with in the data type specified in a data + * source. Only one of integer and floating point fields will be populated, + * depending on the format enum value within data source's type field. + */ + value: Schema$Value[]; + } /** - * A unique identifier for the data stream produced by this data source. The - * identifier includes: - The physical device's manufacturer, model, - * and serial number (UID). - The application's package name or name. - * Package name is used when the data source was created by an Android - * application. The developer project number is used when the data source was - * created by a REST client. - The data source's type. - The data - * source's stream name. Note that not all attributes of the data source - * are used as part of the stream identifier. In particular, the version of - * the hardware/the application isn't used. This allows us to preserve the - * same stream through version updates. This also means that two DataSource - * objects may represent the same data stream even if they're not equal. - * The exact format of the data stream ID created by an Android application - * is: - * type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName - * The exact format of the data stream ID created by a REST client is: - * type:dataType.name:developer project - * number:device.manufacturer:device.model:device.uid:dataStreamName When - * any of the optional fields that comprise of the data stream ID are blank, - * they will be omitted from the data stream ID. The minimum viable data - * stream ID would be: type:dataType.name:developer project number Finally, - * the developer project number is obfuscated when read by any REST or Android - * client that did not create the data source. Only the data source creator - * will see the developer project number in clear and normal form. - */ - dataStreamId: string; + * A dataset represents a projection container for data points. They do not + * carry any info of their own. Datasets represent a set of data points from a + * particular data source. A data point can be found in more than one dataset. + */ + export interface Schema$Dataset { + /** + * The data stream ID of the data source that created the points in this + * dataset. + */ + dataSourceId: string; + /** + * The largest end time of all data points in this possibly partial + * representation of the dataset. Time is in nanoseconds from epoch. This + * should also match the first part of the dataset identifier. + */ + maxEndTimeNs: string; + /** + * The smallest start time of all data points in this possibly partial + * representation of the dataset. Time is in nanoseconds from epoch. This + * should also match the first part of the dataset identifier. + */ + minStartTimeNs: string; + /** + * This token will be set when a dataset is received in response to a GET + * request and the dataset is too large to be included in a single response. + * Provide this value in a subsequent GET request to return the next page of + * data points within this dataset. + */ + nextPageToken: string; + /** + * A partial list of data points contained in the dataset, ordered by + * largest endTimeNanos first. This list is considered complete when + * retrieving a small dataset and partial when patching a dataset or + * retrieving a dataset that is too large to include in a single response. + */ + point: Schema$DataPoint[]; + } /** - * The stream name uniquely identifies this particular data source among other - * data sources of the same type from the same underlying producer. Setting - * the stream name is optional, but should be done whenever an application - * exposes two streams for the same data type, or when a device has two - * equivalent sensors. - */ - dataStreamName: string; + * Definition of a unique source of sensor data. Data sources can expose raw + * data coming from hardware sensors on local or companion devices. They can + * also expose derived data, created by transforming or merging other data + * sources. Multiple data sources can exist for the same data type. Every data + * point inserted into or read from this service has an associated data + * source. The data source contains enough information to uniquely identify + * its data, including the hardware device and the application that collected + * and/or transformed the data. It also holds useful metadata, such as the + * hardware and application versions, and the device type. Each data source + * produces a unique stream of data, with a unique identifier. Not all changes + * to data source affect the stream identifier, so that data collected by + * updated versions of the same application/device can still be considered to + * belong to the same data stream. + */ + export interface Schema$DataSource { + /** + * Information about an application which feeds sensor data into the + * platform. + */ + application: Schema$Application; + dataQualityStandard: string[]; + /** + * A unique identifier for the data stream produced by this data source. The + * identifier includes: - The physical device's manufacturer, model, + * and serial number (UID). - The application's package name or name. + * Package name is used when the data source was created by an Android + * application. The developer project number is used when the data source + * was created by a REST client. - The data source's type. - The data + * source's stream name. Note that not all attributes of the data + * source are used as part of the stream identifier. In particular, the + * version of the hardware/the application isn't used. This allows us to + * preserve the same stream through version updates. This also means that + * two DataSource objects may represent the same data stream even if + * they're not equal. The exact format of the data stream ID created by + * an Android application is: + * type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName + * The exact format of the data stream ID created by a REST client is: + * type:dataType.name:developer project + * number:device.manufacturer:device.model:device.uid:dataStreamName When + * any of the optional fields that comprise of the data stream ID are blank, + * they will be omitted from the data stream ID. The minimum viable data + * stream ID would be: type:dataType.name:developer project number Finally, + * the developer project number is obfuscated when read by any REST or + * Android client that did not create the data source. Only the data source + * creator will see the developer project number in clear and normal form. + */ + dataStreamId: string; + /** + * The stream name uniquely identifies this particular data source among + * other data sources of the same type from the same underlying producer. + * Setting the stream name is optional, but should be done whenever an + * application exposes two streams for the same data type, or when a device + * has two equivalent sensors. + */ + dataStreamName: string; + /** + * The data type defines the schema for a stream of data being collected by, + * inserted into, or queried from the Fitness API. + */ + dataType: Schema$DataType; + /** + * Representation of an integrated device (such as a phone or a wearable) + * that can hold sensors. + */ + device: Schema$Device; + /** + * An end-user visible name for this data source. + */ + name: string; + /** + * A constant describing the type of this data source. Indicates whether + * this data source produces raw or derived data. + */ + type: string; + } + export interface Schema$DataType { + /** + * A field represents one dimension of a data type. + */ + field: Schema$DataTypeField[]; + /** + * Each data type has a unique, namespaced, name. All data types in the + * com.google namespace are shared as part of the platform. + */ + name: string; + } /** - * The data type defines the schema for a stream of data being collected by, - * inserted into, or queried from the Fitness API. - */ - dataType: Schema$DataType; + * In case of multi-dimensional data (such as an accelerometer with x, y, and + * z axes) each field represents one dimension. Each data type field has a + * unique name which identifies it. The field also defines the format of the + * data (int, float, etc.). This message is only instantiated in code and not + * used for wire comms or stored in any way. + */ + export interface Schema$DataTypeField { + /** + * The different supported formats for each field in a data type. + */ + format: string; + /** + * Defines the name and format of data. Unlike data type names, field names + * are not namespaced, and only need to be unique within the data type. + */ + name: string; + optional: boolean; + } /** * Representation of an integrated device (such as a phone or a wearable) that - * can hold sensors. - */ - device: Schema$Device; - /** - * An end-user visible name for this data source. - */ - name: string; - /** - * A constant describing the type of this data source. Indicates whether this - * data source produces raw or derived data. - */ - type: string; -} -export interface Schema$DataType { - /** - * A field represents one dimension of a data type. - */ - field: Schema$DataTypeField[]; - /** - * Each data type has a unique, namespaced, name. All data types in the - * com.google namespace are shared as part of the platform. - */ - name: string; -} -/** - * In case of multi-dimensional data (such as an accelerometer with x, y, and z - * axes) each field represents one dimension. Each data type field has a unique - * name which identifies it. The field also defines the format of the data (int, - * float, etc.). This message is only instantiated in code and not used for - * wire comms or stored in any way. - */ -export interface Schema$DataTypeField { - /** - * The different supported formats for each field in a data type. - */ - format: string; - /** - * Defines the name and format of data. Unlike data type names, field names - * are not namespaced, and only need to be unique within the data type. - */ - name: string; - optional: boolean; -} -/** - * Representation of an integrated device (such as a phone or a wearable) that - * can hold sensors. Each sensor is exposed as a data source. The main purpose - * of the device information contained in this class is to identify the hardware - * of a particular data source. This can be useful in different ways, including: - * - Distinguishing two similar sensors on different devices (the step counter - * on two nexus 5 phones, for instance) - Display the source of data to the user - * (by using the device make / model) - Treat data differently depending on - * sensor type (accelerometers on a watch may give different patterns than those - * on a phone) - Build different analysis models for each device/version. - */ -export interface Schema$Device { - /** - * Manufacturer of the product/hardware. - */ - manufacturer: string; - /** - * End-user visible model name for the device. - */ - model: string; - /** - * A constant representing the type of the device. - */ - type: string; - /** - * The serial number or other unique ID for the hardware. This field is - * obfuscated when read by any REST or Android client that did not create the - * data source. Only the data source creator will see the uid field in clear - * and normal form. - */ - uid: string; - /** - * Version string for the device hardware/software. - */ - version: string; -} -export interface Schema$ListDataPointChangesResponse { - /** - * The data stream ID of the data source with data point changes. - */ - dataSourceId: string; - /** - * Deleted data points for the user. Note, for modifications this should be - * parsed before handling insertions. - */ - deletedDataPoint: Schema$DataPoint[]; - /** - * Inserted data points for the user. - */ - insertedDataPoint: Schema$DataPoint[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; -} -export interface Schema$ListDataSourcesResponse { - /** - * A previously created data source. - */ - dataSource: Schema$DataSource[]; -} -export interface Schema$ListSessionsResponse { - /** - * If includeDeleted is set to true in the request, this list will contain - * sessions deleted with original end times that are within the startTime and - * endTime frame. - */ - deletedSession: Schema$Session[]; - /** - * Flag to indicate server has more data to transfer - */ - hasMoreData: boolean; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Sessions with an end time that is between startTime and endTime of the - * request. - */ - session: Schema$Session[]; -} -/** - * Holder object for the value of an entry in a map field of a data point. A - * map value supports a subset of the formats that the regular Value supports. - */ -export interface Schema$MapValue { - /** - * Floating point value. - */ - fpVal: number; -} -/** - * Sessions contain metadata, such as a user-friendly name and time interval - * information. - */ -export interface Schema$Session { - /** - * Session active time. While start_time_millis and end_time_millis define the - * full session time, the active time can be shorter and specified by - * active_time_millis. If the inactive time during the session is known, it - * should also be inserted via a com.google.activity.segment data point with a - * STILL activity value - */ - activeTimeMillis: string; - /** - * The type of activity this session represents. - */ - activityType: number; - /** - * The application that created the session. - */ - application: Schema$Application; - /** - * A description for this session. - */ - description: string; - /** - * An end time, in milliseconds since epoch, inclusive. - */ - endTimeMillis: string; - /** - * A client-generated identifier that is unique across all sessions owned by - * this particular user. - */ - id: string; - /** - * A timestamp that indicates when the session was last modified. - */ - modifiedTimeMillis: string; - /** - * A human readable name of the session. - */ - name: string; - /** - * A start time, in milliseconds since epoch, inclusive. - */ - startTimeMillis: string; -} -/** - * Holder object for the value of a single field in a data point. A field value - * has a particular format and is only ever set to one of an integer or a - * floating point value. LINT.IfChange - */ -export interface Schema$Value { - /** - * Floating point value. When this is set, other values must not be set. - */ - fpVal: number; - /** - * Integer value. When this is set, other values must not be set. - */ - intVal: number; - /** - * Map value. The valid key space and units for the corresponding value of - * each entry should be documented as part of the data type definition. Keys - * should be kept small whenever possible. Data streams with large keys and - * high data frequency may be down sampled. - */ - mapVal: Schema$ValueMapValEntry[]; - /** - * String value. When this is set, other values must not be set. Strings - * should be kept small whenever possible. Data streams with large string - * values and high data frequency may be down sampled. - */ - stringVal: string; -} -export interface Schema$ValueMapValEntry { - key: string; - value: Schema$MapValue; -} - -export class Resource$Users { - root: Fitness; - dataset: Resource$Users$Dataset; - dataSources: Resource$Users$Datasources; - sessions: Resource$Users$Sessions; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); - this.dataset = new Resource$Users$Dataset(root); - this.dataSources = new Resource$Users$Datasources(root); - this.sessions = new Resource$Users$Sessions(root); + * can hold sensors. Each sensor is exposed as a data source. The main + * purpose of the device information contained in this class is to identify + * the hardware of a particular data source. This can be useful in different + * ways, including: - Distinguishing two similar sensors on different + * devices (the step counter on two nexus 5 phones, for instance) - Display + * the source of data to the user (by using the device make / model) - Treat + * data differently depending on sensor type (accelerometers on a watch may + * give different patterns than those on a phone) - Build different analysis + * models for each device/version. + */ + export interface Schema$Device { + /** + * Manufacturer of the product/hardware. + */ + manufacturer: string; + /** + * End-user visible model name for the device. + */ + model: string; + /** + * A constant representing the type of the device. + */ + type: string; + /** + * The serial number or other unique ID for the hardware. This field is + * obfuscated when read by any REST or Android client that did not create + * the data source. Only the data source creator will see the uid field in + * clear and normal form. + */ + uid: string; + /** + * Version string for the device hardware/software. + */ + version: string; } - - getRoot() { - return this.root; + export interface Schema$ListDataPointChangesResponse { + /** + * The data stream ID of the data source with data point changes. + */ + dataSourceId: string; + /** + * Deleted data points for the user. Note, for modifications this should be + * parsed before handling insertions. + */ + deletedDataPoint: Schema$DataPoint[]; + /** + * Inserted data points for the user. + */ + insertedDataPoint: Schema$DataPoint[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; } -} -export class Resource$Users$Dataset { - root: Fitness; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ListDataSourcesResponse { + /** + * A previously created data source. + */ + dataSource: Schema$DataSource[]; } - - getRoot() { - return this.root; + export interface Schema$ListSessionsResponse { + /** + * If includeDeleted is set to true in the request, this list will contain + * sessions deleted with original end times that are within the startTime + * and endTime frame. + */ + deletedSession: Schema$Session[]; + /** + * Flag to indicate server has more data to transfer + */ + hasMoreData: boolean; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Sessions with an end time that is between startTime and endTime of the + * request. + */ + session: Schema$Session[]; } - - /** - * fitness.users.dataset.aggregate - * @desc Aggregates data of a certain type or stream into buckets divided by a - * given type of boundary. Multiple data sets of multiple types and from - * multiple sources can be aggreated into exactly one bucket type per request. - * @alias fitness.users.dataset.aggregate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().AggregateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Holder object for the value of an entry in a map field of a data point. A + * map value supports a subset of the formats that the regular Value supports. */ - aggregate(params?: any, options?: MethodOptions): - AxiosPromise; - aggregate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - aggregate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/dataset:aggregate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$MapValue { + /** + * Floating point value. + */ + fpVal: number; } -} - -export class Resource$Users$Datasources { - root: Fitness; - dataPointChanges: Resource$Users$Datasources$Datapointchanges; - datasets: Resource$Users$Datasources$Datasets; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); - this.dataPointChanges = - new Resource$Users$Datasources$Datapointchanges(root); - this.datasets = new Resource$Users$Datasources$Datasets(root); + /** + * Sessions contain metadata, such as a user-friendly name and time interval + * information. + */ + export interface Schema$Session { + /** + * Session active time. While start_time_millis and end_time_millis define + * the full session time, the active time can be shorter and specified by + * active_time_millis. If the inactive time during the session is known, it + * should also be inserted via a com.google.activity.segment data point with + * a STILL activity value + */ + activeTimeMillis: string; + /** + * The type of activity this session represents. + */ + activityType: number; + /** + * The application that created the session. + */ + application: Schema$Application; + /** + * A description for this session. + */ + description: string; + /** + * An end time, in milliseconds since epoch, inclusive. + */ + endTimeMillis: string; + /** + * A client-generated identifier that is unique across all sessions owned by + * this particular user. + */ + id: string; + /** + * A timestamp that indicates when the session was last modified. + */ + modifiedTimeMillis: string; + /** + * A human readable name of the session. + */ + name: string; + /** + * A start time, in milliseconds since epoch, inclusive. + */ + startTimeMillis: string; } - - getRoot() { - return this.root; + /** + * Holder object for the value of a single field in a data point. A field + * value has a particular format and is only ever set to one of an integer or + * a floating point value. LINT.IfChange + */ + export interface Schema$Value { + /** + * Floating point value. When this is set, other values must not be set. + */ + fpVal: number; + /** + * Integer value. When this is set, other values must not be set. + */ + intVal: number; + /** + * Map value. The valid key space and units for the corresponding value of + * each entry should be documented as part of the data type definition. Keys + * should be kept small whenever possible. Data streams with large keys and + * high data frequency may be down sampled. + */ + mapVal: Schema$ValueMapValEntry[]; + /** + * String value. When this is set, other values must not be set. Strings + * should be kept small whenever possible. Data streams with large string + * values and high data frequency may be down sampled. + */ + stringVal: string; + } + export interface Schema$ValueMapValEntry { + key: string; + value: Schema$MapValue; } + export class Resource$Users { + root: Fitness; + dataset: Resource$Users$Dataset; + dataSources: Resource$Users$Datasources; + sessions: Resource$Users$Sessions; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); + this.dataset = new Resource$Users$Dataset(root); + this.dataSources = new Resource$Users$Datasources(root); + this.sessions = new Resource$Users$Sessions(root); + } - /** - * fitness.users.dataSources.create - * @desc Creates a new data source that is unique across all data sources - * belonging to this user. The data stream ID field can be omitted and will be - * generated by the server with the correct format. The data stream ID is an - * ordered combination of some fields from the data source. In addition to the - * data source fields reflected into the data source ID, the developer project - * number that is authenticated when creating the data source is included. - * This developer project number is obfuscated when read by any other - * developer reading public data types. - * @alias fitness.users.dataSources.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().DataSource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Dataset { + root: Fitness; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/dataSources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * fitness.users.dataSources.delete - * @desc Deletes the specified data source. The request will fail if the data - * source contains any data points. - * @alias fitness.users.dataSources.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataSourceId The data stream ID of the data source to delete. - * @param {string} params.userId Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId'], - pathParams: ['dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * fitness.users.dataset.aggregate + * @desc Aggregates data of a certain type or stream into buckets divided by + * a given type of boundary. Multiple data sets of multiple types and from + * multiple sources can be aggreated into exactly one bucket type per + * request. + * @alias fitness.users.dataset.aggregate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().AggregateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + aggregate(params?: any, options?: MethodOptions): + AxiosPromise; + aggregate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + aggregate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/dataset:aggregate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fitness.users.dataSources.get - * @desc Returns the specified data source. - * @alias fitness.users.dataSources.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataSourceId The data stream ID of the data source to retrieve. - * @param {string} params.userId Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Users$Datasources { + root: Fitness; + dataPointChanges: Resource$Users$Datasources$Datapointchanges; + datasets: Resource$Users$Datasources$Datasets; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); + this.dataPointChanges = + new Resource$Users$Datasources$Datapointchanges(root); + this.datasets = new Resource$Users$Datasources$Datasets(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId'], - pathParams: ['dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * fitness.users.dataSources.list - * @desc Lists all data sources that are visible to the developer, using the - * OAuth scopes provided. The list is not exhaustive; the user may have - * private data sources that are only visible to other developers, or calls - * using other scopes. - * @alias fitness.users.dataSources.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dataTypeName The names of data types to include in the list. If not specified, all data sources will be returned. - * @param {string} params.userId List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * fitness.users.dataSources.create + * @desc Creates a new data source that is unique across all data sources + * belonging to this user. The data stream ID field can be omitted and will + * be generated by the server with the correct format. The data stream ID is + * an ordered combination of some fields from the data source. In addition + * to the data source fields reflected into the data source ID, the + * developer project number that is authenticated when creating the data + * source is included. This developer project number is obfuscated when read + * by any other developer reading public data types. + * @alias fitness.users.dataSources.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().DataSource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/dataSources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/dataSources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * fitness.users.dataSources.patch - * @desc Updates the specified data source. The dataStreamId, dataType, type, - * dataStreamName, and device properties with the exception of version, cannot - * be modified. Data sources are identified by their dataStreamId. This - * method supports patch semantics. - * @alias fitness.users.dataSources.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataSourceId The data stream ID of the data source to update. - * @param {string} params.userId Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().DataSource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * fitness.users.dataSources.delete + * @desc Deletes the specified data source. The request will fail if the + * data source contains any data points. + * @alias fitness.users.dataSources.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataSourceId The data stream ID of the data source to delete. + * @param {string} params.userId Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId'], + pathParams: ['dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId'], - pathParams: ['dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * fitness.users.dataSources.update - * @desc Updates the specified data source. The dataStreamId, dataType, type, - * dataStreamName, and device properties with the exception of version, cannot - * be modified. Data sources are identified by their dataStreamId. - * @alias fitness.users.dataSources.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataSourceId The data stream ID of the data source to update. - * @param {string} params.userId Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().DataSource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId'], - pathParams: ['dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * fitness.users.dataSources.get + * @desc Returns the specified data source. + * @alias fitness.users.dataSources.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataSourceId The data stream ID of the data source to retrieve. + * @param {string} params.userId Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId'], + pathParams: ['dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Users$Datasources$Datapointchanges { - root: Fitness; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * fitness.users.dataSources.dataPointChanges.list - * @desc Queries for user's data point changes for a particular data source. - * @alias fitness.users.dataSources.dataPointChanges.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. - * @param {integer=} params.limit If specified, no more than this many data point changes will be included in the response. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. - * @param {string} params.userId List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/dataPointChanges') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId'], - pathParams: ['dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * fitness.users.dataSources.list + * @desc Lists all data sources that are visible to the developer, using the + * OAuth scopes provided. The list is not exhaustive; the user may have + * private data sources that are only visible to other developers, or calls + * using other scopes. + * @alias fitness.users.dataSources.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dataTypeName The names of data types to include in the list. If not specified, all data sources will be returned. + * @param {string} params.userId List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/dataSources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Users$Datasources$Datasets { - root: Fitness; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * fitness.users.dataSources.patch + * @desc Updates the specified data source. The dataStreamId, dataType, + * type, dataStreamName, and device properties with the exception of + * version, cannot be modified. Data sources are identified by their + * dataStreamId. This method supports patch semantics. + * @alias fitness.users.dataSources.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataSourceId The data stream ID of the data source to update. + * @param {string} params.userId Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().DataSource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId'], + pathParams: ['dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * fitness.users.dataSources.datasets.delete - * @desc Performs an inclusive delete of all data points whose start and end - * times have any overlap with the time range specified by the dataset ID. For - * most data types, the entire data point will be deleted. For data types - * where the time span represents a consistent value (such as - * com.google.activity.segment), and a data point straddles either end point - * of the dataset, only the overlapping portion of the data point will be - * deleted. - * @alias fitness.users.dataSources.datasets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. - * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. - * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. - * @param {string=} params.modifiedTimeMillis When the operation was performed on the client. - * @param {string} params.userId Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * fitness.users.dataSources.update + * @desc Updates the specified data source. The dataStreamId, dataType, + * type, dataStreamName, and device properties with the exception of + * version, cannot be modified. Data sources are identified by their + * dataStreamId. + * @alias fitness.users.dataSources.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataSourceId The data stream ID of the data source to update. + * @param {string} params.userId Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().DataSource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId'], + pathParams: ['dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Datasources$Datapointchanges { + root: Fitness; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId', 'datasetId'], - pathParams: ['datasetId', 'dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * fitness.users.dataSources.datasets.get - * @desc Returns a dataset containing all data points whose start and end - * times overlap with the specified range of the dataset minimum start time - * and maximum end time. Specifically, any data point whose start time is less - * than or equal to the dataset end time and whose end time is greater than or - * equal to the dataset start time. - * @alias fitness.users.dataSources.datasets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. - * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. - * @param {integer=} params.limit If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be set in the dataset response. - * @param {string=} params.pageToken The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response. - * @param {string} params.userId Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId', 'datasetId'], - pathParams: ['datasetId', 'dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * fitness.users.dataSources.dataPointChanges.list + * @desc Queries for user's data point changes for a particular data source. + * @alias fitness.users.dataSources.dataPointChanges.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. + * @param {integer=} params.limit If specified, no more than this many data point changes will be included in the response. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. + * @param {string} params.userId List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/dataPointChanges') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId'], + pathParams: ['dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * fitness.users.dataSources.datasets.patch - * @desc Adds data points to a dataset. The dataset need not be previously - * created. All points within the given dataset will be returned with - * subsquent calls to retrieve this dataset. Data points can belong to more - * than one dataset. This method does not use patch semantics. - * @alias fitness.users.dataSources.datasets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds. - * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. - * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. - * @param {string} params.userId Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userId', 'dataSourceId', 'datasetId'], - pathParams: ['datasetId', 'dataSourceId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Users$Datasources$Datasets { + root: Fitness; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); } - } -} + getRoot() { + return this.root; + } -export class Resource$Users$Sessions { - root: Fitness; - constructor(root: Fitness) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * fitness.users.dataSources.datasets.delete + * @desc Performs an inclusive delete of all data points whose start and end + * times have any overlap with the time range specified by the dataset ID. + * For most data types, the entire data point will be deleted. For data + * types where the time span represents a consistent value (such as + * com.google.activity.segment), and a data point straddles either end point + * of the dataset, only the overlapping portion of the data point will be + * deleted. + * @alias fitness.users.dataSources.datasets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. + * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. + * @param {string=} params.modifiedTimeMillis When the operation was performed on the client. + * @param {string} params.userId Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId', 'datasetId'], + pathParams: ['datasetId', 'dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * fitness.users.sessions.delete - * @desc Deletes a session specified by the given session ID. - * @alias fitness.users.sessions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. - * @param {string} params.sessionId The ID of the session to be deleted. - * @param {string} params.userId Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * fitness.users.dataSources.datasets.get + * @desc Returns a dataset containing all data points whose start and end + * times overlap with the specified range of the dataset minimum start time + * and maximum end time. Specifically, any data point whose start time is + * less than or equal to the dataset end time and whose end time is greater + * than or equal to the dataset start time. + * @alias fitness.users.dataSources.datasets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. + * @param {integer=} params.limit If specified, no more than this many data points will be included in the dataset. If there are more data points in the dataset, nextPageToken will be set in the dataset response. + * @param {string=} params.pageToken The continuation token, which is used to page through large datasets. To get the next page of a dataset, set this parameter to the value of nextPageToken from the previous response. Each subsequent call will yield a partial dataset with data point end timestamps that are strictly smaller than those in the previous partial response. + * @param {string} params.userId Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId', 'datasetId'], + pathParams: ['datasetId', 'dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/sessions/{sessionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'sessionId'], - pathParams: ['sessionId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * fitness.users.dataSources.datasets.patch + * @desc Adds data points to a dataset. The dataset need not be previously + * created. All points within the given dataset will be returned with + * subsquent calls to retrieve this dataset. Data points can belong to more + * than one dataset. This method does not use patch semantics. + * @alias fitness.users.dataSources.datasets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds. + * @param {string} params.datasetId Dataset identifier that is a composite of the minimum data point start time and maximum data point end time represented as nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" where startTime and endTime are 64 bit integers. + * @param {string} params.dataSourceId The data stream ID of the data source that created the dataset. + * @param {string} params.userId Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userId', 'dataSourceId', 'datasetId'], + pathParams: ['datasetId', 'dataSourceId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * fitness.users.sessions.list - * @desc Lists sessions previously created. - * @alias fitness.users.sessions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.endTime An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. - * @param {boolean=} params.includeDeleted If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. - * @param {string=} params.startTime An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. - * @param {string} params.userId List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Sessions { + root: Fitness; + constructor(root: Fitness) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/sessions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * fitness.users.sessions.update - * @desc Updates or insert a given session. - * @alias fitness.users.sessions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. - * @param {string} params.sessionId The ID of the session to be created. - * @param {string} params.userId Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. - * @param {().Session} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * fitness.users.sessions.delete + * @desc Deletes a session specified by the given session ID. + * @alias fitness.users.sessions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. + * @param {string} params.sessionId The ID of the session to be deleted. + * @param {string} params.userId Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/sessions/{sessionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'sessionId'], + pathParams: ['sessionId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * fitness.users.sessions.list + * @desc Lists sessions previously created. + * @alias fitness.users.sessions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.endTime An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. + * @param {boolean=} params.includeDeleted If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response. + * @param {string=} params.startTime An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. + * @param {string} params.userId List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/sessions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fitness/v1/users/{userId}/sessions/{sessionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId', 'sessionId'], - pathParams: ['sessionId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * fitness.users.sessions.update + * @desc Updates or insert a given session. + * @alias fitness.users.sessions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currentTimeMillis The client's current time in milliseconds since epoch. + * @param {string} params.sessionId The ID of the session to be created. + * @param {string} params.userId Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. + * @param {().Session} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fitness/v1/users/{userId}/sessions/{sessionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId', 'sessionId'], + pathParams: ['sessionId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/fusiontables/v1.ts b/src/apis/fusiontables/v1.ts index a3f42820fe9..2fca0720139 100644 --- a/src/apis/fusiontables/v1.ts +++ b/src/apis/fusiontables/v1.ts @@ -27,2367 +27,2401 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Fusion Tables API - * - * API for working with Fusion Tables data. - * - * @example - * const google = require('googleapis'); - * const fusiontables = google.fusiontables('v1'); - * - * @namespace fusiontables - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Fusiontables - */ -export class Fusiontables { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - column: Resource$Column; - query: Resource$Query; - style: Resource$Style; - table: Resource$Table; - task: Resource$Task; - template: Resource$Template; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.column = new Resource$Column(this); - this.query = new Resource$Query(this); - this.style = new Resource$Style(this); - this.table = new Resource$Table(this); - this.task = new Resource$Task(this); - this.template = new Resource$Template(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Specifies the minimum and maximum values, the color, opacity, icon and weight - * of a bucket within a StyleSetting. - */ -export interface Schema$Bucket { - /** - * Color of line or the interior of a polygon in #RRGGBB format. - */ - color: string; - /** - * Icon name used for a point. - */ - icon: string; - /** - * Maximum value in the selected column for a row to be styled according to - * the bucket color, opacity, icon, or weight. - */ - max: number; - /** - * Minimum value in the selected column for a row to be styled according to - * the bucket color, opacity, icon, or weight. - */ - min: number; - /** - * Opacity of the color: 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - /** - * Width of a line (in pixels). - */ - weight: number; -} -/** - * Specifies the id, name and type of a column in a table. - */ -export interface Schema$Column { - /** - * Optional identifier of the base column. If present, this column is derived - * from the specified base column. - */ - baseColumn: any; - /** - * Identifier for the column. - */ - columnId: number; - /** - * Optional column description. - */ - description: string; - /** - * Optional column predicate. Used to map table to graph data model - * (subject,predicate,object) See - * http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/#data-model - */ - graph_predicate: string; - /** - * Type name: a template for an individual column. - */ - kind: string; - /** - * Required name of the column. - */ - name: string; - /** - * Required type of the column. - */ - type: string; -} -/** - * Represents a list of columns in a table. - */ -export interface Schema$ColumnList { - /** - * List of all requested columns. - */ - items: Schema$Column[]; - /** - * Type name: a list of all columns. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of columns for the table. - */ - totalItems: number; -} -/** - * Represents a Geometry object. - */ -export interface Schema$Geometry { - /** - * The list of geometries in this geometry collection. - */ - geometries: any[]; - geometry: any; - /** - * Type: A collection of geometries. - */ - type: string; -} -/** - * Represents an import request. - */ -export interface Schema$Import { - /** - * Type name: a template for an import request. - */ - kind: string; - /** - * The number of rows received from the import request. - */ - numRowsReceived: string; -} -/** - * Represents a line geometry. - */ -export interface Schema$Line { - /** - * The coordinates that define the line. - */ - coordinates: number[][]; - /** - * Type: A line geometry. - */ - type: string; -} -/** - * Represents a LineStyle within a StyleSetting - */ -export interface Schema$LineStyle { - /** - * Color of the line in #RRGGBB format. - */ - strokeColor: string; - /** - * Column-value, gradient or buckets styler that is used to determine the line - * color and opacity. - */ - strokeColorStyler: Schema$StyleFunction; - /** - * Opacity of the line : 0.0 (transparent) to 1.0 (opaque). - */ - strokeOpacity: number; - /** - * Width of the line in pixels. - */ - strokeWeight: number; - /** - * Column-value or bucket styler that is used to determine the width of the - * line. - */ - strokeWeightStyler: Schema$StyleFunction; -} -/** - * Represents a point object. - */ -export interface Schema$Point { - /** - * The coordinates that define the point. - */ - coordinates: number[]; - /** - * Point: A point geometry. - */ - type: string; -} -/** - * Represents a PointStyle within a StyleSetting - */ -export interface Schema$PointStyle { - /** - * Name of the icon. Use values defined in - * http://www.google.com/fusiontables/DataSource?dsrcid=308519 - */ - iconName: string; - /** - * Column or a bucket value from which the icon name is to be determined. - */ - iconStyler: Schema$StyleFunction; -} -/** - * Represents a polygon object. - */ -export interface Schema$Polygon { - /** - * The coordinates that define the polygon. - */ - coordinates: number[][][]; - /** - * Type: A polygon geometry. - */ - type: string; -} -/** - * Represents a PolygonStyle within a StyleSetting - */ -export interface Schema$PolygonStyle { - /** - * Color of the interior of the polygon in #RRGGBB format. - */ - fillColor: string; - /** - * Column-value, gradient, or bucket styler that is used to determine the - * interior color and opacity of the polygon. - */ - fillColorStyler: Schema$StyleFunction; - /** - * Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque). - */ - fillOpacity: number; - /** - * Color of the polygon border in #RRGGBB format. - */ - strokeColor: string; - /** - * Column-value, gradient or buckets styler that is used to determine the - * border color and opacity. - */ - strokeColorStyler: Schema$StyleFunction; - /** - * Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). - */ - strokeOpacity: number; - /** - * Width of the polyon border in pixels. - */ - strokeWeight: number; - /** - * Column-value or bucket styler that is used to determine the width of the - * polygon border. - */ - strokeWeightStyler: Schema$StyleFunction; -} -/** - * Represents a response to an sql statement. - */ -export interface Schema$Sqlresponse { - /** - * Columns in the table. - */ - columns: string[]; - /** - * Type name: a template for an individual table. - */ - kind: string; - /** - * The rows in the table. For each cell we print out whatever cell value - * (e.g., numeric, string) exists. Thus it is important that each cell - * contains only one value. - */ - rows: any[][]; -} -/** - * Represents a StyleFunction within a StyleSetting - */ -export interface Schema$StyleFunction { - /** - * Bucket function that assigns a style based on the range a column value - * falls into. - */ - buckets: Schema$Bucket[]; - /** - * Name of the column whose value is used in the style. - */ - columnName: string; - /** - * Gradient function that interpolates a range of colors based on column - * value. - */ - gradient: any; - /** - * Stylers can be one of three kinds: "fusiontables#fromColumn" if - * the column value is to be used as is, i.e., the column values can have - * colors in #RRGGBBAA format or integer line widths or icon names; - * "fusiontables#gradient" if the styling of the row is to be based - * on applying the gradient function on the column value; or - * "fusiontables#buckets" if the styling is to based on the bucket - * into which the the column value falls. - */ - kind: string; -} -/** - * Represents a complete StyleSettings object. The primary key is a combination - * of the tableId and a styleId. - */ -export interface Schema$StyleSetting { - /** - * Type name: an individual style setting. A StyleSetting contains the style - * defintions for points, lines, and polygons in a table. Since a table can - * have any one or all of them, a style definition can have point, line and - * polygon style definitions. - */ - kind: string; - /** - * Style definition for points in the table. - */ - markerOptions: Schema$PointStyle; - /** - * Optional name for the style setting. - */ - name: string; - /** - * Style definition for polygons in the table. - */ - polygonOptions: Schema$PolygonStyle; - /** - * Style definition for lines in the table. - */ - polylineOptions: Schema$LineStyle; - /** - * Identifier for the style setting (unique only within tables). - */ - styleId: number; - /** - * Identifier for the table. - */ - tableId: string; -} -/** - * Represents a list of styles for a given table. - */ -export interface Schema$StyleSettingList { - /** - * All requested style settings. - */ - items: Schema$StyleSetting[]; - /** - * Type name: in this case, a list of style settings. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of styles for the table. - */ - totalItems: number; -} -/** - * Represents a table. Specifies the name, whether it is exportable, - * description, attribution, and attribution link. - */ -export interface Schema$Table { - /** - * Optional attribution assigned to the table. - */ - attribution: string; - /** - * Optional link for attribution. - */ - attributionLink: string; - /** - * Optional base table identifier if this table is a view or merged table. - */ - baseTableIds: string[]; - /** - * Columns in the table. - */ - columns: Schema$Column[]; - /** - * Optional description assigned to the table. - */ - description: string; - /** - * Variable for whether table is exportable. - */ - isExportable: boolean; - /** - * Type name: a template for an individual table. - */ - kind: string; - /** - * Name assigned to a table. - */ - name: string; - /** - * Optional sql that encodes the table definition for derived tables. - */ - sql: string; - /** - * Encrypted unique alphanumeric identifier for the table. - */ - tableId: string; -} -/** - * Represents a list of tables. - */ -export interface Schema$TableList { - /** - * List of all requested tables. - */ - items: Schema$Table[]; - /** - * Type name: a list of all tables. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; -} -/** - * Specifies the identifier, name, and type of a task in a table. - */ -export interface Schema$Task { - /** - * Type of the resource. This is always "fusiontables#task". - */ - kind: string; - /** - * An indication of task progress. - */ - progress: string; - /** - * false while the table is busy with some other task. true if this background - * task is currently running. - */ - started: boolean; - /** - * Identifier for the task. - */ - taskId: string; - /** - * Type of background task. One of DELETE_ROWS Deletes one or more rows from - * the table. ADD_ROWS "Adds one or more rows to a table. Includes - * importing data into a new table and importing more rows into an existing - * table. ADD_COLUMN Adds a new column to the table. CHANGE_TYPE Changes the - * type of a column. - */ - type: string; -} -/** - * Represents a list of tasks for a table. - */ -export interface Schema$TaskList { - /** - * List of all requested tasks. - */ - items: Schema$Task[]; - /** - * Type of the resource. This is always "fusiontables#taskList". - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of tasks for the table. - */ - totalItems: number; -} -/** - * Represents the contents of InfoWindow templates. - */ -export interface Schema$Template { - /** - * List of columns from which the template is to be automatically constructed. - * Only one of body or automaticColumns can be specified. - */ - automaticColumnNames: string[]; - /** - * Body of the template. It contains HTML with {column_name} to insert values - * from a particular column. The body is sanitized to remove certain tags, - * e.g., script. Only one of body or automaticColumns can be specified. - */ - body: string; - /** - * Type name: a template for the info window contents. The template can either - * include an HTML body or a list of columns from which the template is - * computed automatically. - */ - kind: string; - /** - * Optional name assigned to a template. - */ - name: string; - /** - * Identifier for the table for which the template is defined. - */ - tableId: string; - /** - * Identifier for the template, unique within the context of a particular - * table. - */ - templateId: number; -} -/** - * Represents a list of templates for a given table. - */ -export interface Schema$TemplateList { - /** - * List of all requested templates. - */ - items: Schema$Template[]; - /** - * Type name: a list of all templates. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; +export namespace fusiontables_v1 { /** - * Total number of templates for the table. - */ - totalItems: number; -} - -export class Resource$Column { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * fusiontables.column.delete - * @desc Deletes the column. - * @alias fusiontables.column.delete - * @memberOf! () + * Fusion Tables API * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column being deleted. - * @param {string} params.tableId Table from which the column is being deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.get - * @desc Retrieves a specific column by its id. - * @alias fusiontables.column.get - * @memberOf! () + * API for working with Fusion Tables data. * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being requested. - * @param {string} params.tableId Table to which the column belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.insert - * @desc Adds a new column to the table. - * @alias fusiontables.column.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const fusiontables = google.fusiontables('v1'); * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new column is being added. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/columns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace fusiontables + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Fusiontables + */ + export class Fusiontables { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + column: Resource$Column; + query: Resource$Query; + style: Resource$Style; + table: Resource$Table; + task: Resource$Task; + template: Resource$Template; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.column = new Resource$Column(this); + this.query = new Resource$Query(this); + this.style = new Resource$Style(this); + this.table = new Resource$Table(this); + this.task = new Resource$Task(this); + this.template = new Resource$Template(this); + } + + getRoot() { + return this.root; } } - /** - * fusiontables.column.list - * @desc Retrieves a list of columns. - * @alias fusiontables.column.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of columns to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. - * @param {string} params.tableId Table whose columns are being listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/columns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the minimum and maximum values, the color, opacity, icon and + * weight of a bucket within a StyleSetting. + */ + export interface Schema$Bucket { + /** + * Color of line or the interior of a polygon in #RRGGBB format. + */ + color: string; + /** + * Icon name used for a point. + */ + icon: string; + /** + * Maximum value in the selected column for a row to be styled according to + * the bucket color, opacity, icon, or weight. + */ + max: number; + /** + * Minimum value in the selected column for a row to be styled according to + * the bucket color, opacity, icon, or weight. + */ + min: number; + /** + * Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + /** + * Width of a line (in pixels). + */ + weight: number; } - - /** - * fusiontables.column.patch - * @desc Updates the name or type of an existing column. This method supports - * patch semantics. - * @alias fusiontables.column.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being updated. - * @param {string} params.tableId Table for which the column is being updated. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the id, name and type of a column in a table. + */ + export interface Schema$Column { + /** + * Optional identifier of the base column. If present, this column is + * derived from the specified base column. + */ + baseColumn: any; + /** + * Identifier for the column. + */ + columnId: number; + /** + * Optional column description. + */ + description: string; + /** + * Optional column predicate. Used to map table to graph data model + * (subject,predicate,object) See + * http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/#data-model + */ + graph_predicate: string; + /** + * Type name: a template for an individual column. + */ + kind: string; + /** + * Required name of the column. + */ + name: string; + /** + * Required type of the column. + */ + type: string; } - - /** - * fusiontables.column.update - * @desc Updates the name or type of an existing column. - * @alias fusiontables.column.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being updated. - * @param {string} params.tableId Table for which the column is being updated. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of columns in a table. + */ + export interface Schema$ColumnList { + /** + * List of all requested columns. + */ + items: Schema$Column[]; + /** + * Type name: a list of all columns. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of columns for the table. + */ + totalItems: number; } -} - -export class Resource$Query { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * fusiontables.query.sql - * @desc Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE - * statement. - * @alias fusiontables.query.sql - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.hdrs Should column names be included (in the first row)?. Default is true. - * @param {string} params.sql An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement. - * @param {boolean=} params.typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sql(params?: any, options?: MethodOptions): AxiosPromise; - sql(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sql(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['sql'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Geometry object. + */ + export interface Schema$Geometry { + /** + * The list of geometries in this geometry collection. + */ + geometries: any[]; + geometry: any; + /** + * Type: A collection of geometries. + */ + type: string; } - - /** - * fusiontables.query.sqlGet - * @desc Executes an SQL SELECT/SHOW/DESCRIBE statement. - * @alias fusiontables.query.sqlGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.hdrs Should column names be included (in the first row)?. Default is true. - * @param {string} params.sql An SQL SELECT/SHOW/DESCRIBE statement. - * @param {boolean=} params.typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sqlGet(params?: any, options?: MethodOptions): - AxiosPromise; - sqlGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sqlGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sql'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Style { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Represents an import request. + */ + export interface Schema$Import { + /** + * Type name: a template for an import request. + */ + kind: string; + /** + * The number of rows received from the import request. + */ + numRowsReceived: string; } - - /** - * fusiontables.style.delete - * @desc Deletes a style. - * @alias fusiontables.style.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being deleted - * @param {string} params.tableId Table from which the style is being deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a line geometry. + */ + export interface Schema$Line { + /** + * The coordinates that define the line. + */ + coordinates: number[][]; + /** + * Type: A line geometry. + */ + type: string; } - - /** - * fusiontables.style.get - * @desc Gets a specific style. - * @alias fusiontables.style.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (integer) for a specific style in a table - * @param {string} params.tableId Table to which the requested style belongs - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a LineStyle within a StyleSetting + */ + export interface Schema$LineStyle { + /** + * Color of the line in #RRGGBB format. + */ + strokeColor: string; + /** + * Column-value, gradient or buckets styler that is used to determine the + * line color and opacity. + */ + strokeColorStyler: Schema$StyleFunction; + /** + * Opacity of the line : 0.0 (transparent) to 1.0 (opaque). + */ + strokeOpacity: number; + /** + * Width of the line in pixels. + */ + strokeWeight: number; + /** + * Column-value or bucket styler that is used to determine the width of the + * line. + */ + strokeWeightStyler: Schema$StyleFunction; } - - /** - * fusiontables.style.insert - * @desc Adds a new style for the table. - * @alias fusiontables.style.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new style is being added - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/styles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a point object. + */ + export interface Schema$Point { + /** + * The coordinates that define the point. + */ + coordinates: number[]; + /** + * Point: A point geometry. + */ + type: string; } - - /** - * fusiontables.style.list - * @desc Retrieves a list of styles. - * @alias fusiontables.style.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. - * @param {string} params.tableId Table whose styles are being listed - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/styles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a PointStyle within a StyleSetting + */ + export interface Schema$PointStyle { + /** + * Name of the icon. Use values defined in + * http://www.google.com/fusiontables/DataSource?dsrcid=308519 + */ + iconName: string; + /** + * Column or a bucket value from which the icon name is to be determined. + */ + iconStyler: Schema$StyleFunction; } - - /** - * fusiontables.style.patch - * @desc Updates an existing style. This method supports patch semantics. - * @alias fusiontables.style.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being updated. - * @param {string} params.tableId Table whose style is being updated. - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a polygon object. + */ + export interface Schema$Polygon { + /** + * The coordinates that define the polygon. + */ + coordinates: number[][][]; + /** + * Type: A polygon geometry. + */ + type: string; } - - /** - * fusiontables.style.update - * @desc Updates an existing style. - * @alias fusiontables.style.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being updated. - * @param {string} params.tableId Table whose style is being updated. - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Table { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Represents a PolygonStyle within a StyleSetting + */ + export interface Schema$PolygonStyle { + /** + * Color of the interior of the polygon in #RRGGBB format. + */ + fillColor: string; + /** + * Column-value, gradient, or bucket styler that is used to determine the + * interior color and opacity of the polygon. + */ + fillColorStyler: Schema$StyleFunction; + /** + * Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 + * (opaque). + */ + fillOpacity: number; + /** + * Color of the polygon border in #RRGGBB format. + */ + strokeColor: string; + /** + * Column-value, gradient or buckets styler that is used to determine the + * border color and opacity. + */ + strokeColorStyler: Schema$StyleFunction; + /** + * Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). + */ + strokeOpacity: number; + /** + * Width of the polyon border in pixels. + */ + strokeWeight: number; + /** + * Column-value or bucket styler that is used to determine the width of the + * polygon border. + */ + strokeWeightStyler: Schema$StyleFunction; } - - /** - * fusiontables.table.copy - * @desc Copies a table. - * @alias fusiontables.table.copy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.copyPresentation Whether to also copy tabs, styles, and templates. Default is false. - * @param {string} params.tableId ID of the table that is being copied. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/copy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a response to an sql statement. + */ + export interface Schema$Sqlresponse { + /** + * Columns in the table. + */ + columns: string[]; + /** + * Type name: a template for an individual table. + */ + kind: string; + /** + * The rows in the table. For each cell we print out whatever cell value + * (e.g., numeric, string) exists. Thus it is important that each cell + * contains only one value. + */ + rows: any[][]; } - - /** - * fusiontables.table.delete - * @desc Deletes a table. - * @alias fusiontables.table.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId ID of the table that is being deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a StyleFunction within a StyleSetting + */ + export interface Schema$StyleFunction { + /** + * Bucket function that assigns a style based on the range a column value + * falls into. + */ + buckets: Schema$Bucket[]; + /** + * Name of the column whose value is used in the style. + */ + columnName: string; + /** + * Gradient function that interpolates a range of colors based on column + * value. + */ + gradient: any; + /** + * Stylers can be one of three kinds: "fusiontables#fromColumn" if + * the column value is to be used as is, i.e., the column values can have + * colors in #RRGGBBAA format or integer line widths or icon names; + * "fusiontables#gradient" if the styling of the row is to be + * based on applying the gradient function on the column value; or + * "fusiontables#buckets" if the styling is to based on the bucket + * into which the the column value falls. + */ + kind: string; } - - /** - * fusiontables.table.get - * @desc Retrieves a specific table by its id. - * @alias fusiontables.table.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Identifier(ID) for the table being requested. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a complete StyleSettings object. The primary key is a + * combination of the tableId and a styleId. + */ + export interface Schema$StyleSetting { + /** + * Type name: an individual style setting. A StyleSetting contains the style + * defintions for points, lines, and polygons in a table. Since a table can + * have any one or all of them, a style definition can have point, line and + * polygon style definitions. + */ + kind: string; + /** + * Style definition for points in the table. + */ + markerOptions: Schema$PointStyle; + /** + * Optional name for the style setting. + */ + name: string; + /** + * Style definition for polygons in the table. + */ + polygonOptions: Schema$PolygonStyle; + /** + * Style definition for lines in the table. + */ + polylineOptions: Schema$LineStyle; + /** + * Identifier for the style setting (unique only within tables). + */ + styleId: number; + /** + * Identifier for the table. + */ + tableId: string; } - - /** - * fusiontables.table.importRows - * @desc Import more rows into a table. - * @alias fusiontables.table.importRows - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ','. - * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. - * @param {integer=} params.endLine The index of the last line from which to start importing, exclusive. Thus, the number of imported lines is endLine - startLine. If this parameter is not provided, the file will be imported until the last line of the file. If endLine is negative, then the imported content will exclude the last endLine lines. That is, if endline is negative, no line will be imported whose index is greater than N + endLine where N is the number of lines in the file, and the number of imported lines will be N + endLine - startLine. - * @param {boolean=} params.isStrict Whether the CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true. - * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. - * @param {string} params.tableId The table into which new rows are being imported. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importRows(params?: any, options?: MethodOptions): - AxiosPromise; - importRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - importRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/import') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/fusiontables/v1/tables/{tableId}/import') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of styles for a given table. + */ + export interface Schema$StyleSettingList { + /** + * All requested style settings. + */ + items: Schema$StyleSetting[]; + /** + * Type name: in this case, a list of style settings. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of styles for the table. + */ + totalItems: number; } - - /** - * fusiontables.table.importTable - * @desc Import a new table. - * @alias fusiontables.table.importTable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ','. - * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. - * @param {string} params.name The name to be assigned to the new table. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importTable(params?: any, options?: MethodOptions): - AxiosPromise; - importTable( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - importTable( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/import') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/fusiontables/v1/tables/import') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['name'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a table. Specifies the name, whether it is exportable, + * description, attribution, and attribution link. + */ + export interface Schema$Table { + /** + * Optional attribution assigned to the table. + */ + attribution: string; + /** + * Optional link for attribution. + */ + attributionLink: string; + /** + * Optional base table identifier if this table is a view or merged table. + */ + baseTableIds: string[]; + /** + * Columns in the table. + */ + columns: Schema$Column[]; + /** + * Optional description assigned to the table. + */ + description: string; + /** + * Variable for whether table is exportable. + */ + isExportable: boolean; + /** + * Type name: a template for an individual table. + */ + kind: string; + /** + * Name assigned to a table. + */ + name: string; + /** + * Optional sql that encodes the table definition for derived tables. + */ + sql: string; + /** + * Encrypted unique alphanumeric identifier for the table. + */ + tableId: string; } - - /** - * fusiontables.table.insert - * @desc Creates a new table. - * @alias fusiontables.table.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.table.list - * @desc Retrieves a list of tables a user owns. - * @alias fusiontables.table.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of tables. + */ + export interface Schema$TableList { + /** + * List of all requested tables. + */ + items: Schema$Table[]; + /** + * Type name: a list of all tables. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; } - - /** - * fusiontables.table.patch - * @desc Updates an existing table. Unless explicitly requested, only the - * name, description, and attribution will be updated. This method supports - * patch semantics. - * @alias fusiontables.table.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition. - * @param {string} params.tableId ID of the table that is being updated. - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.table.update - * @desc Updates an existing table. Unless explicitly requested, only the - * name, description, and attribution will be updated. - * @alias fusiontables.table.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition. - * @param {string} params.tableId ID of the table that is being updated. - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Task { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Specifies the identifier, name, and type of a task in a table. + */ + export interface Schema$Task { + /** + * Type of the resource. This is always "fusiontables#task". + */ + kind: string; + /** + * An indication of task progress. + */ + progress: string; + /** + * false while the table is busy with some other task. true if this + * background task is currently running. + */ + started: boolean; + /** + * Identifier for the task. + */ + taskId: string; + /** + * Type of background task. One of DELETE_ROWS Deletes one or more rows + * from the table. ADD_ROWS "Adds one or more rows to a table. Includes + * importing data into a new table and importing more rows into an existing + * table. ADD_COLUMN Adds a new column to the table. CHANGE_TYPE Changes the + * type of a column. + */ + type: string; } - - /** - * fusiontables.task.delete - * @desc Deletes the task, unless already started. - * @alias fusiontables.task.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table from which the task is being deleted. - * @param {string} params.taskId - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks/{taskId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'taskId'], - pathParams: ['tableId', 'taskId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of tasks for a table. + */ + export interface Schema$TaskList { + /** + * List of all requested tasks. + */ + items: Schema$Task[]; + /** + * Type of the resource. This is always "fusiontables#taskList". + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of tasks for the table. + */ + totalItems: number; } - - /** - * fusiontables.task.get - * @desc Retrieves a specific task by its id. - * @alias fusiontables.task.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the task belongs. - * @param {string} params.taskId - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks/{taskId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'taskId'], - pathParams: ['tableId', 'taskId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the contents of InfoWindow templates. + */ + export interface Schema$Template { + /** + * List of columns from which the template is to be automatically + * constructed. Only one of body or automaticColumns can be specified. + */ + automaticColumnNames: string[]; + /** + * Body of the template. It contains HTML with {column_name} to insert + * values from a particular column. The body is sanitized to remove certain + * tags, e.g., script. Only one of body or automaticColumns can be + * specified. + */ + body: string; + /** + * Type name: a template for the info window contents. The template can + * either include an HTML body or a list of columns from which the template + * is computed automatically. + */ + kind: string; + /** + * Optional name assigned to a template. + */ + name: string; + /** + * Identifier for the table for which the template is defined. + */ + tableId: string; + /** + * Identifier for the template, unique within the context of a particular + * table. + */ + templateId: number; } - - /** - * fusiontables.task.list - * @desc Retrieves a list of tasks. - * @alias fusiontables.task.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of columns to return. Optional. Default is 5. - * @param {string=} params.pageToken - * @param {integer=} params.startIndex - * @param {string} params.tableId Table whose tasks are being listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Template { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Represents a list of templates for a given table. + */ + export interface Schema$TemplateList { + /** + * List of all requested templates. + */ + items: Schema$Template[]; + /** + * Type name: a list of all templates. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of templates for the table. + */ + totalItems: number; } - - /** - * fusiontables.template.delete - * @desc Deletes a template - * @alias fusiontables.template.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table from which the template is being deleted - * @param {integer} params.templateId Identifier for the template which is being deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Column { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.column.delete + * @desc Deletes the column. + * @alias fusiontables.column.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column being deleted. + * @param {string} params.tableId Table from which the column is being deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.get + * @desc Retrieves a specific column by its id. + * @alias fusiontables.column.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being requested. + * @param {string} params.tableId Table to which the column belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.insert + * @desc Adds a new column to the table. + * @alias fusiontables.column.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new column is being added. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/columns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.list + * @desc Retrieves a list of columns. + * @alias fusiontables.column.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of columns to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. + * @param {string} params.tableId Table whose columns are being listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/columns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.patch + * @desc Updates the name or type of an existing column. This method + * supports patch semantics. + * @alias fusiontables.column.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being updated. + * @param {string} params.tableId Table for which the column is being updated. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.update + * @desc Updates the name or type of an existing column. + * @alias fusiontables.column.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being updated. + * @param {string} params.tableId Table for which the column is being updated. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.get - * @desc Retrieves a specific template by its id - * @alias fusiontables.template.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the template belongs - * @param {integer} params.templateId Identifier for the template that is being requested - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Query { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.query.sql + * @desc Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE + * statement. + * @alias fusiontables.query.sql + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.hdrs Should column names be included (in the first row)?. Default is true. + * @param {string} params.sql An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE statement. + * @param {boolean=} params.typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sql(params?: any, + options?: MethodOptions): AxiosPromise; + sql(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sql(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['sql'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.query.sqlGet + * @desc Executes an SQL SELECT/SHOW/DESCRIBE statement. + * @alias fusiontables.query.sqlGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.hdrs Should column names be included (in the first row)?. Default is true. + * @param {string} params.sql An SQL SELECT/SHOW/DESCRIBE statement. + * @param {boolean=} params.typed Should typed values be returned in the (JSON) response -- numbers for numeric values and parsed geometries for KML values? Default is true. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sqlGet(params?: any, options?: MethodOptions): + AxiosPromise; + sqlGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sqlGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sql'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.insert - * @desc Creates a new template for the table. - * @alias fusiontables.template.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new template is being created - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Style { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.style.delete + * @desc Deletes a style. + * @alias fusiontables.style.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being deleted + * @param {string} params.tableId Table from which the style is being deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.get + * @desc Gets a specific style. + * @alias fusiontables.style.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (integer) for a specific style in a table + * @param {string} params.tableId Table to which the requested style belongs + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.insert + * @desc Adds a new style for the table. + * @alias fusiontables.style.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new style is being added + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/styles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.list + * @desc Retrieves a list of styles. + * @alias fusiontables.style.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. + * @param {string} params.tableId Table whose styles are being listed + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/styles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.patch + * @desc Updates an existing style. This method supports patch semantics. + * @alias fusiontables.style.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being updated. + * @param {string} params.tableId Table whose style is being updated. + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.update + * @desc Updates an existing style. + * @alias fusiontables.style.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being updated. + * @param {string} params.tableId Table whose style is being updated. + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.list - * @desc Retrieves a list of templates. - * @alias fusiontables.template.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of templates to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which results page to return. Optional. - * @param {string} params.tableId Identifier for the table whose templates are being requested - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v1/tables/{tableId}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Table { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.table.copy + * @desc Copies a table. + * @alias fusiontables.table.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.copyPresentation Whether to also copy tabs, styles, and templates. Default is false. + * @param {string} params.tableId ID of the table that is being copied. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/copy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.delete + * @desc Deletes a table. + * @alias fusiontables.table.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId ID of the table that is being deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.get + * @desc Retrieves a specific table by its id. + * @alias fusiontables.table.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Identifier(ID) for the table being requested. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.importRows + * @desc Import more rows into a table. + * @alias fusiontables.table.importRows + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ','. + * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. + * @param {integer=} params.endLine The index of the last line from which to start importing, exclusive. Thus, the number of imported lines is endLine - startLine. If this parameter is not provided, the file will be imported until the last line of the file. If endLine is negative, then the imported content will exclude the last endLine lines. That is, if endline is negative, no line will be imported whose index is greater than N + endLine where N is the number of lines in the file, and the number of imported lines will be N + endLine - startLine. + * @param {boolean=} params.isStrict Whether the CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true. + * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. + * @param {string} params.tableId The table into which new rows are being imported. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importRows(params?: any, options?: MethodOptions): + AxiosPromise; + importRows( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + importRows( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/import') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/fusiontables/v1/tables/{tableId}/import') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.importTable + * @desc Import a new table. + * @alias fusiontables.table.importTable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ','. + * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. + * @param {string} params.name The name to be assigned to the new table. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importTable(params?: any, options?: MethodOptions): + AxiosPromise; + importTable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + importTable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/import') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/fusiontables/v1/tables/import') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['name'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.insert + * @desc Creates a new table. + * @alias fusiontables.table.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.list + * @desc Retrieves a list of tables a user owns. + * @alias fusiontables.table.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.patch + * @desc Updates an existing table. Unless explicitly requested, only the + * name, description, and attribution will be updated. This method supports + * patch semantics. + * @alias fusiontables.table.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition. + * @param {string} params.tableId ID of the table that is being updated. + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.update + * @desc Updates an existing table. Unless explicitly requested, only the + * name, description, and attribution will be updated. + * @alias fusiontables.table.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.replaceViewDefinition Should the view definition also be updated? The specified view definition replaces the existing one. Only a view can be updated with a new definition. + * @param {string} params.tableId ID of the table that is being updated. + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.patch - * @desc Updates an existing template. This method supports patch semantics. - * @alias fusiontables.template.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the updated template belongs - * @param {integer} params.templateId Identifier for the template that is being updated - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Task { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.task.delete + * @desc Deletes the task, unless already started. + * @alias fusiontables.task.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table from which the task is being deleted. + * @param {string} params.taskId + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks/{taskId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'taskId'], + pathParams: ['tableId', 'taskId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.task.get + * @desc Retrieves a specific task by its id. + * @alias fusiontables.task.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the task belongs. + * @param {string} params.taskId + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks/{taskId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'taskId'], + pathParams: ['tableId', 'taskId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.task.list + * @desc Retrieves a list of tasks. + * @alias fusiontables.task.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of columns to return. Optional. Default is 5. + * @param {string=} params.pageToken + * @param {integer=} params.startIndex + * @param {string} params.tableId Table whose tasks are being listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.update - * @desc Updates an existing template - * @alias fusiontables.template.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the updated template belongs - * @param {integer} params.templateId Identifier for the template that is being updated - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v1/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Template { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.template.delete + * @desc Deletes a template + * @alias fusiontables.template.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table from which the template is being deleted + * @param {integer} params.templateId Identifier for the template which is being deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.get + * @desc Retrieves a specific template by its id + * @alias fusiontables.template.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the template belongs + * @param {integer} params.templateId Identifier for the template that is being requested + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.insert + * @desc Creates a new template for the table. + * @alias fusiontables.template.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new template is being created + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.list + * @desc Retrieves a list of templates. + * @alias fusiontables.template.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of templates to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which results page to return. Optional. + * @param {string} params.tableId Identifier for the table whose templates are being requested + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v1/tables/{tableId}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.patch + * @desc Updates an existing template. This method supports patch semantics. + * @alias fusiontables.template.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the updated template belongs + * @param {integer} params.templateId Identifier for the template that is being updated + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.update + * @desc Updates an existing template + * @alias fusiontables.template.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the updated template belongs + * @param {integer} params.templateId Identifier for the template that is being updated + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v1/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/fusiontables/v2.ts b/src/apis/fusiontables/v2.ts index ceae6a37c1e..7a278f761d7 100644 --- a/src/apis/fusiontables/v2.ts +++ b/src/apis/fusiontables/v2.ts @@ -27,2540 +27,2578 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Fusion Tables API - * - * API for working with Fusion Tables data. - * - * @example - * const google = require('googleapis'); - * const fusiontables = google.fusiontables('v2'); - * - * @namespace fusiontables - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Fusiontables - */ -export class Fusiontables { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - column: Resource$Column; - query: Resource$Query; - style: Resource$Style; - table: Resource$Table; - task: Resource$Task; - template: Resource$Template; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.column = new Resource$Column(this); - this.query = new Resource$Query(this); - this.style = new Resource$Style(this); - this.table = new Resource$Table(this); - this.task = new Resource$Task(this); - this.template = new Resource$Template(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Specifies the minimum and maximum values, the color, opacity, icon and weight - * of a bucket within a StyleSetting. - */ -export interface Schema$Bucket { - /** - * Color of line or the interior of a polygon in #RRGGBB format. - */ - color: string; - /** - * Icon name used for a point. - */ - icon: string; - /** - * Maximum value in the selected column for a row to be styled according to - * the bucket color, opacity, icon, or weight. - */ - max: number; - /** - * Minimum value in the selected column for a row to be styled according to - * the bucket color, opacity, icon, or weight. - */ - min: number; - /** - * Opacity of the color: 0.0 (transparent) to 1.0 (opaque). - */ - opacity: number; - /** - * Width of a line (in pixels). - */ - weight: number; -} -/** - * Specifies the details of a column in a table. - */ -export interface Schema$Column { - /** - * Identifier of the base column. If present, this column is derived from the - * specified base column. - */ - baseColumn: any; - /** - * Identifier for the column. - */ - columnId: number; - /** - * JSON schema for interpreting JSON in this column. - */ - columnJsonSchema: string; - /** - * JSON object containing custom column properties. - */ - columnPropertiesJson: string; - /** - * Column description. - */ - description: string; - /** - * Format pattern. Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 - * DT_DATE_SHORTfor example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, - * 2008 8:30:45 PM DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM - * DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 - * DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 - * DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM - * DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 - * DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor example 24/12/2008 20:30 - * DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM - * DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 DT_ISO_YEAR_MONTH_DAY_TIMEfor - * example 2008-12-24 20:30:45 DT_MONTH_DAY_4_DIGIT_YEARfor example 12/24/2008 - * DT_TIME_LONGfor example 8:30:45 PM UTC-6 DT_TIME_MEDIUMfor example 8:30:45 - * PM DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor example 2008 - * HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does not match the data - * type NONENo formatting (default) NUMBER_CURRENCYfor example $1234.56 - * NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor example 1235 - * NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor example 123,456% - * NUMBER_SCIENTIFICfor example 1E3 STRING_EIGHT_LINE_IMAGEDisplays thumbnail - * images as tall as eight lines of text STRING_FOUR_LINE_IMAGEDisplays - * thumbnail images as tall as four lines of text STRING_JSON_TEXTAllows - * editing of text as JSON in UI STRING_JSON_LISTAllows editing of text as a - * JSON list in UI STRING_LINKTreats cell as a link (must start with http:// - * or https://) STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as one - * line of text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail - */ - formatPattern: string; - /** - * Column graph predicate. Used to map table to graph data model - * (subject,predicate,object) See W3C Graph-based Data Model. - */ - graphPredicate: string; - /** - * The kind of item this is. For a column, this is always fusiontables#column. - */ - kind: string; - /** - * Name of the column. - */ - name: string; - /** - * Type of the column. - */ - type: string; - /** - * If true, data entered via the web application is validated. - */ - validateData: boolean; - /** - * List of valid values used to validate data and supply a drop-down list of - * values in the web application. - */ - validValues: string[]; -} -/** - * Represents a list of columns in a table. - */ -export interface Schema$ColumnList { - /** - * List of all requested columns. - */ - items: Schema$Column[]; - /** - * The kind of item this is. For a column list, this is always - * fusiontables#columnList. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of columns for the table. - */ - totalItems: number; -} -/** - * Represents a Geometry object. - */ -export interface Schema$Geometry { - /** - * The list of geometries in this geometry collection. - */ - geometries: any[]; - geometry: any; - /** - * Type: A collection of geometries. - */ - type: string; -} -/** - * Represents an import request. - */ -export interface Schema$Import { - /** - * The kind of item this is. For an import, this is always - * fusiontables#import. - */ - kind: string; - /** - * The number of rows received from the import request. - */ - numRowsReceived: string; -} -/** - * Represents a line geometry. - */ -export interface Schema$Line { - /** - * The coordinates that define the line. - */ - coordinates: number[][]; - /** - * Type: A line geometry. - */ - type: string; -} -/** - * Represents a LineStyle within a StyleSetting - */ -export interface Schema$LineStyle { - /** - * Color of the line in #RRGGBB format. - */ - strokeColor: string; - /** - * Column-value, gradient or buckets styler that is used to determine the line - * color and opacity. - */ - strokeColorStyler: Schema$StyleFunction; - /** - * Opacity of the line : 0.0 (transparent) to 1.0 (opaque). - */ - strokeOpacity: number; - /** - * Width of the line in pixels. - */ - strokeWeight: number; - /** - * Column-value or bucket styler that is used to determine the width of the - * line. - */ - strokeWeightStyler: Schema$StyleFunction; -} -/** - * Represents a point object. - */ -export interface Schema$Point { - /** - * The coordinates that define the point. - */ - coordinates: number[]; - /** - * Point: A point geometry. - */ - type: string; -} -/** - * Represents a PointStyle within a StyleSetting - */ -export interface Schema$PointStyle { - /** - * Name of the icon. Use values defined in - * http://www.google.com/fusiontables/DataSource?dsrcid=308519 - */ - iconName: string; - /** - * Column or a bucket value from which the icon name is to be determined. - */ - iconStyler: Schema$StyleFunction; -} -/** - * Represents a polygon object. - */ -export interface Schema$Polygon { - /** - * The coordinates that define the polygon. - */ - coordinates: number[][][]; - /** - * Type: A polygon geometry. - */ - type: string; -} -/** - * Represents a PolygonStyle within a StyleSetting - */ -export interface Schema$PolygonStyle { - /** - * Color of the interior of the polygon in #RRGGBB format. - */ - fillColor: string; - /** - * Column-value, gradient, or bucket styler that is used to determine the - * interior color and opacity of the polygon. - */ - fillColorStyler: Schema$StyleFunction; - /** - * Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque). - */ - fillOpacity: number; - /** - * Color of the polygon border in #RRGGBB format. - */ - strokeColor: string; - /** - * Column-value, gradient or buckets styler that is used to determine the - * border color and opacity. - */ - strokeColorStyler: Schema$StyleFunction; - /** - * Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). - */ - strokeOpacity: number; - /** - * Width of the polyon border in pixels. - */ - strokeWeight: number; - /** - * Column-value or bucket styler that is used to determine the width of the - * polygon border. - */ - strokeWeightStyler: Schema$StyleFunction; -} -/** - * Represents a response to a SQL statement. - */ -export interface Schema$Sqlresponse { - /** - * Columns in the table. - */ - columns: string[]; - /** - * The kind of item this is. For responses to SQL queries, this is always - * fusiontables#sqlresponse. - */ - kind: string; - /** - * The rows in the table. For each cell we print out whatever cell value - * (e.g., numeric, string) exists. Thus it is important that each cell - * contains only one value. - */ - rows: any[][]; -} -/** - * Represents a StyleFunction within a StyleSetting - */ -export interface Schema$StyleFunction { - /** - * Bucket function that assigns a style based on the range a column value - * falls into. - */ - buckets: Schema$Bucket[]; - /** - * Name of the column whose value is used in the style. - */ - columnName: string; - /** - * Gradient function that interpolates a range of colors based on column - * value. - */ - gradient: any; - /** - * Stylers can be one of three kinds: "fusiontables#fromColumn if the - * column value is to be used as is, i.e., the column values can have colors - * in #RRGGBBAA format or integer line widths or icon names; - * fusiontables#gradient if the styling of the row is to be based on applying - * the gradient function on the column value; or fusiontables#buckets if the - * styling is to based on the bucket into which the the column value falls. - */ - kind: string; -} -/** - * Represents a complete StyleSettings object. The primary key is a combination - * of the tableId and a styleId. - */ -export interface Schema$StyleSetting { - /** - * The kind of item this is. A StyleSetting contains the style definitions for - * points, lines, and polygons in a table. Since a table can have any one or - * all of them, a style definition can have point, line and polygon style - * definitions. - */ - kind: string; - /** - * Style definition for points in the table. - */ - markerOptions: Schema$PointStyle; - /** - * Optional name for the style setting. - */ - name: string; - /** - * Style definition for polygons in the table. - */ - polygonOptions: Schema$PolygonStyle; - /** - * Style definition for lines in the table. - */ - polylineOptions: Schema$LineStyle; - /** - * Identifier for the style setting (unique only within tables). - */ - styleId: number; - /** - * Identifier for the table. - */ - tableId: string; -} -/** - * Represents a list of styles for a given table. - */ -export interface Schema$StyleSettingList { - /** - * All requested style settings. - */ - items: Schema$StyleSetting[]; - /** - * The kind of item this is. For a style list, this is always - * fusiontables#styleSettingList . - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more styles left. - */ - nextPageToken: string; - /** - * Total number of styles for the table. - */ - totalItems: number; -} -/** - * Represents a table. - */ -export interface Schema$Table { - /** - * Attribution assigned to the table. - */ - attribution: string; - /** - * Optional link for attribution. - */ - attributionLink: string; - /** - * Base table identifier if this table is a view or merged table. - */ - baseTableIds: string[]; - /** - * Default JSON schema for validating all JSON column properties. - */ - columnPropertiesJsonSchema: string; - /** - * Columns in the table. - */ - columns: Schema$Column[]; - /** - * Description assigned to the table. - */ - description: string; - /** - * Variable for whether table is exportable. - */ - isExportable: boolean; - /** - * The kind of item this is. For a table, this is always fusiontables#table. - */ - kind: string; - /** - * Name assigned to a table. - */ - name: string; - /** - * SQL that encodes the table definition for derived tables. - */ - sql: string; - /** - * Encrypted unique alphanumeric identifier for the table. - */ - tableId: string; - /** - * JSON object containing custom table properties. - */ - tablePropertiesJson: string; - /** - * JSON schema for validating the JSON table properties. - */ - tablePropertiesJsonSchema: string; -} -/** - * Represents a list of tables. - */ -export interface Schema$TableList { - /** - * List of all requested tables. - */ - items: Schema$Table[]; - /** - * The kind of item this is. For table list, this is always - * fusiontables#tableList. - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; -} -/** - * A background task on a table, initiated for time- or resource-consuming - * operations such as changing column types or deleting all rows. - */ -export interface Schema$Task { - /** - * Type of the resource. This is always "fusiontables#task". - */ - kind: string; - /** - * Task percentage completion. - */ - progress: string; - /** - * false while the table is busy with some other task. true if this background - * task is currently running. - */ - started: boolean; - /** - * Identifier for the task. - */ - taskId: string; - /** - * Type of background task. - */ - type: string; -} -/** - * Represents a list of tasks for a table. - */ -export interface Schema$TaskList { - /** - * List of all requested tasks. - */ - items: Schema$Task[]; - /** - * Type of the resource. This is always "fusiontables#taskList". - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of tasks for the table. - */ - totalItems: number; -} -/** - * Represents the contents of InfoWindow templates. - */ -export interface Schema$Template { - /** - * List of columns from which the template is to be automatically constructed. - * Only one of body or automaticColumns can be specified. - */ - automaticColumnNames: string[]; - /** - * Body of the template. It contains HTML with {column_name} to insert values - * from a particular column. The body is sanitized to remove certain tags, - * e.g., script. Only one of body or automaticColumns can be specified. - */ - body: string; - /** - * The kind of item this is. For a template, this is always - * fusiontables#template. - */ - kind: string; - /** - * Optional name assigned to a template. - */ - name: string; - /** - * Identifier for the table for which the template is defined. - */ - tableId: string; - /** - * Identifier for the template, unique within the context of a particular - * table. - */ - templateId: number; -} -/** - * Represents a list of templates for a given table. - */ -export interface Schema$TemplateList { - /** - * List of all requested templates. - */ - items: Schema$Template[]; - /** - * The kind of item this is. For a template list, this is always - * fusiontables#templateList . - */ - kind: string; - /** - * Token used to access the next page of this result. No token is displayed if - * there are no more pages left. - */ - nextPageToken: string; - /** - * Total number of templates for the table. - */ - totalItems: number; -} - -export class Resource$Column { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * fusiontables.column.delete - * @desc Deletes the specified column. - * @alias fusiontables.column.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column being deleted. - * @param {string} params.tableId Table from which the column is being deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.get - * @desc Retrieves a specific column by its ID. - * @alias fusiontables.column.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being requested. - * @param {string} params.tableId Table to which the column belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.insert - * @desc Adds a new column to the table. - * @alias fusiontables.column.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new column is being added. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/columns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.list - * @desc Retrieves a list of columns. - * @alias fusiontables.column.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of columns to return. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. - * @param {string} params.tableId Table whose columns are being listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/columns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace fusiontables_v2 { /** - * fusiontables.column.patch - * @desc Updates the name or type of an existing column. This method supports - * patch semantics. - * @alias fusiontables.column.patch - * @memberOf! () + * Fusion Tables API * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being updated. - * @param {string} params.tableId Table for which the column is being updated. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * fusiontables.column.update - * @desc Updates the name or type of an existing column. - * @alias fusiontables.column.update - * @memberOf! () + * API for working with Fusion Tables data. * - * @param {object} params Parameters for request - * @param {string} params.columnId Name or identifier for the column that is being updated. - * @param {string} params.tableId Table for which the column is being updated. - * @param {().Column} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/columns/{columnId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'columnId'], - pathParams: ['columnId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Query { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * fusiontables.query.sql - * @desc Executes a Fusion Tables SQL statement, which can be any of - SELECT - * - INSERT - UPDATE - DELETE - SHOW - DESCRIBE - CREATE statement. - * @alias fusiontables.query.sql - * @memberOf! () + * @example + * const google = require('googleapis'); + * const fusiontables = google.fusiontables('v2'); * - * @param {object} params Parameters for request - * @param {boolean=} params.hdrs Whether column names are included in the first row. Default is true. - * @param {string} params.sql A Fusion Tables SQL statement, which can be any of - SELECT - INSERT - UPDATE - DELETE - SHOW - DESCRIBE - CREATE - * @param {boolean=} params.typed Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sql(params?: any, options?: MethodOptions): AxiosPromise; - sql(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sql(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['sql'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace fusiontables + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Fusiontables + */ + export class Fusiontables { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + column: Resource$Column; + query: Resource$Query; + style: Resource$Style; + table: Resource$Table; + task: Resource$Task; + template: Resource$Template; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.column = new Resource$Column(this); + this.query = new Resource$Query(this); + this.style = new Resource$Style(this); + this.table = new Resource$Table(this); + this.task = new Resource$Task(this); + this.template = new Resource$Template(this); + } + + getRoot() { + return this.root; } } - /** - * fusiontables.query.sqlGet - * @desc Executes a SQL statement which can be any of - SELECT - SHOW - - * DESCRIBE - * @alias fusiontables.query.sqlGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.hdrs Whether column names are included (in the first row). Default is true. - * @param {string} params.sql A SQL statement which can be any of - SELECT - SHOW - DESCRIBE - * @param {boolean=} params.typed Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sqlGet(params?: any, options?: MethodOptions): - AxiosPromise; - sqlGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sqlGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sql'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Style { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Specifies the minimum and maximum values, the color, opacity, icon and + * weight of a bucket within a StyleSetting. + */ + export interface Schema$Bucket { + /** + * Color of line or the interior of a polygon in #RRGGBB format. + */ + color: string; + /** + * Icon name used for a point. + */ + icon: string; + /** + * Maximum value in the selected column for a row to be styled according to + * the bucket color, opacity, icon, or weight. + */ + max: number; + /** + * Minimum value in the selected column for a row to be styled according to + * the bucket color, opacity, icon, or weight. + */ + min: number; + /** + * Opacity of the color: 0.0 (transparent) to 1.0 (opaque). + */ + opacity: number; + /** + * Width of a line (in pixels). + */ + weight: number; } - - /** - * fusiontables.style.delete - * @desc Deletes a style. - * @alias fusiontables.style.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being deleted - * @param {string} params.tableId Table from which the style is being deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the details of a column in a table. + */ + export interface Schema$Column { + /** + * Identifier of the base column. If present, this column is derived from + * the specified base column. + */ + baseColumn: any; + /** + * Identifier for the column. + */ + columnId: number; + /** + * JSON schema for interpreting JSON in this column. + */ + columnJsonSchema: string; + /** + * JSON object containing custom column properties. + */ + columnPropertiesJson: string; + /** + * Column description. + */ + description: string; + /** + * Format pattern. Acceptable values are DT_DATE_MEDIUMe.g Dec 24, 2008 + * DT_DATE_SHORTfor example 12/24/08 DT_DATE_TIME_MEDIUMfor example Dec 24, + * 2008 8:30:45 PM DT_DATE_TIME_SHORTfor example 12/24/08 8:30 PM + * DT_DAY_MONTH_2_DIGIT_YEARfor example 24/12/08 + * DT_DAY_MONTH_2_DIGIT_YEAR_TIMEfor example 24/12/08 20:30 + * DT_DAY_MONTH_2_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/08 8:30 PM + * DT_DAY_MONTH_4_DIGIT_YEARfor example 24/12/2008 + * DT_DAY_MONTH_4_DIGIT_YEAR_TIMEfor example 24/12/2008 20:30 + * DT_DAY_MONTH_4_DIGIT_YEAR_TIME_MERIDIANfor example 24/12/2008 8:30 PM + * DT_ISO_YEAR_MONTH_DAYfor example 2008-12-24 DT_ISO_YEAR_MONTH_DAY_TIMEfor + * example 2008-12-24 20:30:45 DT_MONTH_DAY_4_DIGIT_YEARfor example + * 12/24/2008 DT_TIME_LONGfor example 8:30:45 PM UTC-6 DT_TIME_MEDIUMfor + * example 8:30:45 PM DT_TIME_SHORTfor example 8:30 PM DT_YEAR_ONLYfor + * example 2008 HIGHLIGHT_UNTYPED_CELLSHighlight cell data that does not + * match the data type NONENo formatting (default) NUMBER_CURRENCYfor + * example $1234.56 NUMBER_DEFAULTfor example 1,234.56 NUMBER_INTEGERfor + * example 1235 NUMBER_NO_SEPARATORfor example 1234.56 NUMBER_PERCENTfor + * example 123,456% NUMBER_SCIENTIFICfor example 1E3 + * STRING_EIGHT_LINE_IMAGEDisplays thumbnail images as tall as eight lines + * of text STRING_FOUR_LINE_IMAGEDisplays thumbnail images as tall as four + * lines of text STRING_JSON_TEXTAllows editing of text as JSON in UI + * STRING_JSON_LISTAllows editing of text as a JSON list in UI + * STRING_LINKTreats cell as a link (must start with http:// or https://) + * STRING_ONE_LINE_IMAGEDisplays thumbnail images as tall as one line of + * text STRING_VIDEO_OR_MAPDisplay a video or map thumbnail + */ + formatPattern: string; + /** + * Column graph predicate. Used to map table to graph data model + * (subject,predicate,object) See W3C Graph-based Data Model. + */ + graphPredicate: string; + /** + * The kind of item this is. For a column, this is always + * fusiontables#column. + */ + kind: string; + /** + * Name of the column. + */ + name: string; + /** + * Type of the column. + */ + type: string; + /** + * If true, data entered via the web application is validated. + */ + validateData: boolean; + /** + * List of valid values used to validate data and supply a drop-down list of + * values in the web application. + */ + validValues: string[]; } - - /** - * fusiontables.style.get - * @desc Gets a specific style. - * @alias fusiontables.style.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (integer) for a specific style in a table - * @param {string} params.tableId Table to which the requested style belongs - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of columns in a table. + */ + export interface Schema$ColumnList { + /** + * List of all requested columns. + */ + items: Schema$Column[]; + /** + * The kind of item this is. For a column list, this is always + * fusiontables#columnList. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of columns for the table. + */ + totalItems: number; } - - /** - * fusiontables.style.insert - * @desc Adds a new style for the table. - * @alias fusiontables.style.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new style is being added - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/styles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Geometry object. + */ + export interface Schema$Geometry { + /** + * The list of geometries in this geometry collection. + */ + geometries: any[]; + geometry: any; + /** + * Type: A collection of geometries. + */ + type: string; } - - /** - * fusiontables.style.list - * @desc Retrieves a list of styles. - * @alias fusiontables.style.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. - * @param {string} params.tableId Table whose styles are being listed - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/styles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an import request. + */ + export interface Schema$Import { + /** + * The kind of item this is. For an import, this is always + * fusiontables#import. + */ + kind: string; + /** + * The number of rows received from the import request. + */ + numRowsReceived: string; } - - /** - * fusiontables.style.patch - * @desc Updates an existing style. This method supports patch semantics. - * @alias fusiontables.style.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being updated. - * @param {string} params.tableId Table whose style is being updated. - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a line geometry. + */ + export interface Schema$Line { + /** + * The coordinates that define the line. + */ + coordinates: number[][]; + /** + * Type: A line geometry. + */ + type: string; } - - /** - * fusiontables.style.update - * @desc Updates an existing style. - * @alias fusiontables.style.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.styleId Identifier (within a table) for the style being updated. - * @param {string} params.tableId Table whose style is being updated. - * @param {().StyleSetting} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'styleId'], - pathParams: ['styleId', 'tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Table { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Represents a LineStyle within a StyleSetting + */ + export interface Schema$LineStyle { + /** + * Color of the line in #RRGGBB format. + */ + strokeColor: string; + /** + * Column-value, gradient or buckets styler that is used to determine the + * line color and opacity. + */ + strokeColorStyler: Schema$StyleFunction; + /** + * Opacity of the line : 0.0 (transparent) to 1.0 (opaque). + */ + strokeOpacity: number; + /** + * Width of the line in pixels. + */ + strokeWeight: number; + /** + * Column-value or bucket styler that is used to determine the width of the + * line. + */ + strokeWeightStyler: Schema$StyleFunction; } - - /** - * fusiontables.table.copy - * @desc Copies a table. - * @alias fusiontables.table.copy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.copyPresentation Whether to also copy tabs, styles, and templates. Default is false. - * @param {string} params.tableId ID of the table that is being copied. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/copy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a point object. + */ + export interface Schema$Point { + /** + * The coordinates that define the point. + */ + coordinates: number[]; + /** + * Point: A point geometry. + */ + type: string; } - - /** - * fusiontables.table.delete - * @desc Deletes a table. - * @alias fusiontables.table.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId ID of the table to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a PointStyle within a StyleSetting + */ + export interface Schema$PointStyle { + /** + * Name of the icon. Use values defined in + * http://www.google.com/fusiontables/DataSource?dsrcid=308519 + */ + iconName: string; + /** + * Column or a bucket value from which the icon name is to be determined. + */ + iconStyler: Schema$StyleFunction; } - - /** - * fusiontables.table.get - * @desc Retrieves a specific table by its ID. - * @alias fusiontables.table.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Identifier for the table being requested. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a polygon object. + */ + export interface Schema$Polygon { + /** + * The coordinates that define the polygon. + */ + coordinates: number[][][]; + /** + * Type: A polygon geometry. + */ + type: string; } - - /** - * fusiontables.table.importRows - * @desc Imports more rows into a table. - * @alias fusiontables.table.importRows - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. - * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. - * @param {integer=} params.endLine The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines. - * @param {boolean=} params.isStrict Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true. - * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. - * @param {string} params.tableId The table into which new rows are being imported. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importRows(params?: any, options?: MethodOptions): - AxiosPromise; - importRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - importRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/import') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/{tableId}/import') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a PolygonStyle within a StyleSetting + */ + export interface Schema$PolygonStyle { + /** + * Color of the interior of the polygon in #RRGGBB format. + */ + fillColor: string; + /** + * Column-value, gradient, or bucket styler that is used to determine the + * interior color and opacity of the polygon. + */ + fillColorStyler: Schema$StyleFunction; + /** + * Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 + * (opaque). + */ + fillOpacity: number; + /** + * Color of the polygon border in #RRGGBB format. + */ + strokeColor: string; + /** + * Column-value, gradient or buckets styler that is used to determine the + * border color and opacity. + */ + strokeColorStyler: Schema$StyleFunction; + /** + * Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). + */ + strokeOpacity: number; + /** + * Width of the polyon border in pixels. + */ + strokeWeight: number; + /** + * Column-value or bucket styler that is used to determine the width of the + * polygon border. + */ + strokeWeightStyler: Schema$StyleFunction; } - - /** - * fusiontables.table.importTable - * @desc Imports a new table. - * @alias fusiontables.table.importTable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. - * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. - * @param {string} params.name The name to be assigned to the new table. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importTable(params?: any, options?: MethodOptions): - AxiosPromise; - importTable( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - importTable( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/import') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/import') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['name'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a response to a SQL statement. + */ + export interface Schema$Sqlresponse { + /** + * Columns in the table. + */ + columns: string[]; + /** + * The kind of item this is. For responses to SQL queries, this is always + * fusiontables#sqlresponse. + */ + kind: string; + /** + * The rows in the table. For each cell we print out whatever cell value + * (e.g., numeric, string) exists. Thus it is important that each cell + * contains only one value. + */ + rows: any[][]; } - - /** - * fusiontables.table.insert - * @desc Creates a new table. - * @alias fusiontables.table.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a StyleFunction within a StyleSetting + */ + export interface Schema$StyleFunction { + /** + * Bucket function that assigns a style based on the range a column value + * falls into. + */ + buckets: Schema$Bucket[]; + /** + * Name of the column whose value is used in the style. + */ + columnName: string; + /** + * Gradient function that interpolates a range of colors based on column + * value. + */ + gradient: any; + /** + * Stylers can be one of three kinds: "fusiontables#fromColumn if the + * column value is to be used as is, i.e., the column values can have colors + * in #RRGGBBAA format or integer line widths or icon names; + * fusiontables#gradient if the styling of the row is to be based on + * applying the gradient function on the column value; or + * fusiontables#buckets if the styling is to based on the bucket into which + * the the column value falls. + */ + kind: string; } - - /** - * fusiontables.table.list - * @desc Retrieves a list of tables a user owns. - * @alias fusiontables.table.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of tables to return. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a complete StyleSettings object. The primary key is a + * combination of the tableId and a styleId. + */ + export interface Schema$StyleSetting { + /** + * The kind of item this is. A StyleSetting contains the style definitions + * for points, lines, and polygons in a table. Since a table can have any + * one or all of them, a style definition can have point, line and polygon + * style definitions. + */ + kind: string; + /** + * Style definition for points in the table. + */ + markerOptions: Schema$PointStyle; + /** + * Optional name for the style setting. + */ + name: string; + /** + * Style definition for polygons in the table. + */ + polygonOptions: Schema$PolygonStyle; + /** + * Style definition for lines in the table. + */ + polylineOptions: Schema$LineStyle; + /** + * Identifier for the style setting (unique only within tables). + */ + styleId: number; + /** + * Identifier for the table. + */ + tableId: string; } - - /** - * fusiontables.table.patch - * @desc Updates an existing table. Unless explicitly requested, only the - * name, description, and attribution will be updated. This method supports - * patch semantics. - * @alias fusiontables.table.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.replaceViewDefinition Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. - * @param {string} params.tableId ID of the table that is being updated. - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of styles for a given table. + */ + export interface Schema$StyleSettingList { + /** + * All requested style settings. + */ + items: Schema$StyleSetting[]; + /** + * The kind of item this is. For a style list, this is always + * fusiontables#styleSettingList . + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more styles left. + */ + nextPageToken: string; + /** + * Total number of styles for the table. + */ + totalItems: number; } - - /** - * fusiontables.table.refetchSheet - * @desc Replaces rows of the table with the rows of the spreadsheet that is - * first imported from. Current rows remain visible until all replacement rows - * are ready. - * @alias fusiontables.table.refetchSheet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table whose rows will be replaced from the spreadsheet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - refetchSheet(params?: any, options?: MethodOptions): - AxiosPromise; - refetchSheet( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - refetchSheet( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/refetch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a table. + */ + export interface Schema$Table { + /** + * Attribution assigned to the table. + */ + attribution: string; + /** + * Optional link for attribution. + */ + attributionLink: string; + /** + * Base table identifier if this table is a view or merged table. + */ + baseTableIds: string[]; + /** + * Default JSON schema for validating all JSON column properties. + */ + columnPropertiesJsonSchema: string; + /** + * Columns in the table. + */ + columns: Schema$Column[]; + /** + * Description assigned to the table. + */ + description: string; + /** + * Variable for whether table is exportable. + */ + isExportable: boolean; + /** + * The kind of item this is. For a table, this is always fusiontables#table. + */ + kind: string; + /** + * Name assigned to a table. + */ + name: string; + /** + * SQL that encodes the table definition for derived tables. + */ + sql: string; + /** + * Encrypted unique alphanumeric identifier for the table. + */ + tableId: string; + /** + * JSON object containing custom table properties. + */ + tablePropertiesJson: string; + /** + * JSON schema for validating the JSON table properties. + */ + tablePropertiesJsonSchema: string; } - - /** - * fusiontables.table.replaceRows - * @desc Replaces rows of an existing table. Current rows remain visible until - * all replacement rows are ready. - * @alias fusiontables.table.replaceRows - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. - * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. - * @param {integer=} params.endLine The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines. - * @param {boolean=} params.isStrict Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number of columns. If false, rows with fewer column values will be padded with empty values. Default is true. - * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. - * @param {string} params.tableId Table whose rows will be replaced. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - replaceRows(params?: any, options?: MethodOptions): AxiosPromise; - replaceRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - replaceRows( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/replace') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/{tableId}/replace') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of tables. + */ + export interface Schema$TableList { + /** + * List of all requested tables. + */ + items: Schema$Table[]; + /** + * The kind of item this is. For table list, this is always + * fusiontables#tableList. + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; } - - /** - * fusiontables.table.update - * @desc Updates an existing table. Unless explicitly requested, only the - * name, description, and attribution will be updated. - * @alias fusiontables.table.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.replaceViewDefinition Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. - * @param {string} params.tableId ID of the table that is being updated. - * @param {().Table} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Task { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); + * A background task on a table, initiated for time- or resource-consuming + * operations such as changing column types or deleting all rows. + */ + export interface Schema$Task { + /** + * Type of the resource. This is always "fusiontables#task". + */ + kind: string; + /** + * Task percentage completion. + */ + progress: string; + /** + * false while the table is busy with some other task. true if this + * background task is currently running. + */ + started: boolean; + /** + * Identifier for the task. + */ + taskId: string; + /** + * Type of background task. + */ + type: string; } - - getRoot() { - return this.root; - } - - /** - * fusiontables.task.delete - * @desc Deletes a specific task by its ID, unless that task has already - * started running. - * @alias fusiontables.task.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table from which the task is being deleted. - * @param {string} params.taskId The identifier of the task to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks/{taskId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'taskId'], - pathParams: ['tableId', 'taskId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a list of tasks for a table. + */ + export interface Schema$TaskList { + /** + * List of all requested tasks. + */ + items: Schema$Task[]; + /** + * Type of the resource. This is always "fusiontables#taskList". + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of tasks for the table. + */ + totalItems: number; } - - /** - * fusiontables.task.get - * @desc Retrieves a specific task by its ID. - * @alias fusiontables.task.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the task belongs. - * @param {string} params.taskId The identifier of the task to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks/{taskId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'taskId'], - pathParams: ['tableId', 'taskId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the contents of InfoWindow templates. + */ + export interface Schema$Template { + /** + * List of columns from which the template is to be automatically + * constructed. Only one of body or automaticColumns can be specified. + */ + automaticColumnNames: string[]; + /** + * Body of the template. It contains HTML with {column_name} to insert + * values from a particular column. The body is sanitized to remove certain + * tags, e.g., script. Only one of body or automaticColumns can be + * specified. + */ + body: string; + /** + * The kind of item this is. For a template, this is always + * fusiontables#template. + */ + kind: string; + /** + * Optional name assigned to a template. + */ + name: string; + /** + * Identifier for the table for which the template is defined. + */ + tableId: string; + /** + * Identifier for the template, unique within the context of a particular + * table. + */ + templateId: number; } - - /** - * fusiontables.task.list - * @desc Retrieves a list of tasks. - * @alias fusiontables.task.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of tasks to return. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which result page to return. - * @param {integer=} params.startIndex Index of the first result returned in the current page. - * @param {string} params.tableId Table whose tasks are being listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Template { - root: Fusiontables; - constructor(root: Fusiontables) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Represents a list of templates for a given table. + */ + export interface Schema$TemplateList { + /** + * List of all requested templates. + */ + items: Schema$Template[]; + /** + * The kind of item this is. For a template list, this is always + * fusiontables#templateList . + */ + kind: string; + /** + * Token used to access the next page of this result. No token is displayed + * if there are no more pages left. + */ + nextPageToken: string; + /** + * Total number of templates for the table. + */ + totalItems: number; } - - /** - * fusiontables.template.delete - * @desc Deletes a template - * @alias fusiontables.template.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table from which the template is being deleted - * @param {integer} params.templateId Identifier for the template which is being deleted - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Column { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.column.delete + * @desc Deletes the specified column. + * @alias fusiontables.column.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column being deleted. + * @param {string} params.tableId Table from which the column is being deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.get + * @desc Retrieves a specific column by its ID. + * @alias fusiontables.column.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being requested. + * @param {string} params.tableId Table to which the column belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.insert + * @desc Adds a new column to the table. + * @alias fusiontables.column.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new column is being added. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/columns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.list + * @desc Retrieves a list of columns. + * @alias fusiontables.column.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of columns to return. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. + * @param {string} params.tableId Table whose columns are being listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/columns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.patch + * @desc Updates the name or type of an existing column. This method + * supports patch semantics. + * @alias fusiontables.column.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being updated. + * @param {string} params.tableId Table for which the column is being updated. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.column.update + * @desc Updates the name or type of an existing column. + * @alias fusiontables.column.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.columnId Name or identifier for the column that is being updated. + * @param {string} params.tableId Table for which the column is being updated. + * @param {().Column} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/columns/{columnId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'columnId'], + pathParams: ['columnId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.get - * @desc Retrieves a specific template by its id - * @alias fusiontables.template.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the template belongs - * @param {integer} params.templateId Identifier for the template that is being requested - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Query { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.query.sql + * @desc Executes a Fusion Tables SQL statement, which can be any of - + * SELECT - INSERT - UPDATE - DELETE - SHOW - DESCRIBE - CREATE statement. + * @alias fusiontables.query.sql + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.hdrs Whether column names are included in the first row. Default is true. + * @param {string} params.sql A Fusion Tables SQL statement, which can be any of - SELECT - INSERT - UPDATE - DELETE - SHOW - DESCRIBE - CREATE + * @param {boolean=} params.typed Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sql(params?: any, + options?: MethodOptions): AxiosPromise; + sql(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sql(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['sql'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.query.sqlGet + * @desc Executes a SQL statement which can be any of - SELECT - SHOW - + * DESCRIBE + * @alias fusiontables.query.sqlGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.hdrs Whether column names are included (in the first row). Default is true. + * @param {string} params.sql A SQL statement which can be any of - SELECT - SHOW - DESCRIBE + * @param {boolean=} params.typed Whether typed values are returned in the (JSON) response: numbers for numeric values and parsed geometries for KML values. Default is true. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sqlGet(params?: any, options?: MethodOptions): + AxiosPromise; + sqlGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sqlGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sql'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.insert - * @desc Creates a new template for the table. - * @alias fusiontables.template.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table for which a new template is being created - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Style { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.style.delete + * @desc Deletes a style. + * @alias fusiontables.style.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being deleted + * @param {string} params.tableId Table from which the style is being deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.get + * @desc Gets a specific style. + * @alias fusiontables.style.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (integer) for a specific style in a table + * @param {string} params.tableId Table to which the requested style belongs + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.insert + * @desc Adds a new style for the table. + * @alias fusiontables.style.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new style is being added + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/styles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.list + * @desc Retrieves a list of styles. + * @alias fusiontables.style.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of styles to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. Optional. + * @param {string} params.tableId Table whose styles are being listed + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/styles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.patch + * @desc Updates an existing style. This method supports patch semantics. + * @alias fusiontables.style.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being updated. + * @param {string} params.tableId Table whose style is being updated. + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.style.update + * @desc Updates an existing style. + * @alias fusiontables.style.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.styleId Identifier (within a table) for the style being updated. + * @param {string} params.tableId Table whose style is being updated. + * @param {().StyleSetting} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/styles/{styleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'styleId'], + pathParams: ['styleId', 'tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.list - * @desc Retrieves a list of templates. - * @alias fusiontables.template.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of templates to return. Optional. Default is 5. - * @param {string=} params.pageToken Continuation token specifying which results page to return. Optional. - * @param {string} params.tableId Identifier for the table whose templates are being requested - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/fusiontables/v2/tables/{tableId}/templates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tableId'], - pathParams: ['tableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Table { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.table.copy + * @desc Copies a table. + * @alias fusiontables.table.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.copyPresentation Whether to also copy tabs, styles, and templates. Default is false. + * @param {string} params.tableId ID of the table that is being copied. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/copy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.delete + * @desc Deletes a table. + * @alias fusiontables.table.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId ID of the table to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.get + * @desc Retrieves a specific table by its ID. + * @alias fusiontables.table.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Identifier for the table being requested. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.importRows + * @desc Imports more rows into a table. + * @alias fusiontables.table.importRows + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. + * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. + * @param {integer=} params.endLine The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines. + * @param {boolean=} params.isStrict Whether the imported CSV must have the same number of values for each row. If false, rows with fewer values will be padded with empty values. Default is true. + * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. + * @param {string} params.tableId The table into which new rows are being imported. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importRows(params?: any, options?: MethodOptions): + AxiosPromise; + importRows( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + importRows( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/import') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/{tableId}/import') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.importTable + * @desc Imports a new table. + * @alias fusiontables.table.importTable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. + * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use auto-detect if you are unsure of the encoding. + * @param {string} params.name The name to be assigned to the new table. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importTable(params?: any, options?: MethodOptions): + AxiosPromise; + importTable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + importTable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/import') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/import') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['name'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.insert + * @desc Creates a new table. + * @alias fusiontables.table.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.list + * @desc Retrieves a list of tables a user owns. + * @alias fusiontables.table.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of tables to return. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.patch + * @desc Updates an existing table. Unless explicitly requested, only the + * name, description, and attribution will be updated. This method supports + * patch semantics. + * @alias fusiontables.table.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.replaceViewDefinition Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. + * @param {string} params.tableId ID of the table that is being updated. + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.refetchSheet + * @desc Replaces rows of the table with the rows of the spreadsheet that is + * first imported from. Current rows remain visible until all replacement + * rows are ready. + * @alias fusiontables.table.refetchSheet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table whose rows will be replaced from the spreadsheet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + refetchSheet(params?: any, options?: MethodOptions): + AxiosPromise; + refetchSheet( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + refetchSheet( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/refetch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.replaceRows + * @desc Replaces rows of an existing table. Current rows remain visible + * until all replacement rows are ready. + * @alias fusiontables.table.replaceRows + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.delimiter The delimiter used to separate cell values. This can only consist of a single character. Default is ,. + * @param {string=} params.encoding The encoding of the content. Default is UTF-8. Use 'auto-detect' if you are unsure of the encoding. + * @param {integer=} params.endLine The index of the line up to which data will be imported. Default is to import the entire file. If endLine is negative, it is an offset from the end of the file; the imported content will exclude the last endLine lines. + * @param {boolean=} params.isStrict Whether the imported CSV must have the same number of column values for each row. If true, throws an exception if the CSV does not have the same number of columns. If false, rows with fewer column values will be padded with empty values. Default is true. + * @param {integer=} params.startLine The index of the first line from which to start importing, inclusive. Default is 0. + * @param {string} params.tableId Table whose rows will be replaced. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + replaceRows(params?: any, options?: MethodOptions): + AxiosPromise; + replaceRows( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + replaceRows( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/replace') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/fusiontables/v2/tables/{tableId}/replace') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.table.update + * @desc Updates an existing table. Unless explicitly requested, only the + * name, description, and attribution will be updated. + * @alias fusiontables.table.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.replaceViewDefinition Whether the view definition is also updated. The specified view definition replaces the existing one. Only a view can be updated with a new definition. + * @param {string} params.tableId ID of the table that is being updated. + * @param {().Table} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.patch - * @desc Updates an existing template. This method supports patch semantics. - * @alias fusiontables.template.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the updated template belongs - * @param {integer} params.templateId Identifier for the template that is being updated - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Task { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.task.delete + * @desc Deletes a specific task by its ID, unless that task has already + * started running. + * @alias fusiontables.task.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table from which the task is being deleted. + * @param {string} params.taskId The identifier of the task to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks/{taskId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'taskId'], + pathParams: ['tableId', 'taskId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.task.get + * @desc Retrieves a specific task by its ID. + * @alias fusiontables.task.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the task belongs. + * @param {string} params.taskId The identifier of the task to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks/{taskId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'taskId'], + pathParams: ['tableId', 'taskId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.task.list + * @desc Retrieves a list of tasks. + * @alias fusiontables.task.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of tasks to return. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which result page to return. + * @param {integer=} params.startIndex Index of the first result returned in the current page. + * @param {string} params.tableId Table whose tasks are being listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * fusiontables.template.update - * @desc Updates an existing template - * @alias fusiontables.template.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tableId Table to which the updated template belongs - * @param {integer} params.templateId Identifier for the template that is being updated - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/fusiontables/v2/tables/{tableId}/templates/{templateId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tableId', 'templateId'], - pathParams: ['tableId', 'templateId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Template { + root: Fusiontables; + constructor(root: Fusiontables) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * fusiontables.template.delete + * @desc Deletes a template + * @alias fusiontables.template.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table from which the template is being deleted + * @param {integer} params.templateId Identifier for the template which is being deleted + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.get + * @desc Retrieves a specific template by its id + * @alias fusiontables.template.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the template belongs + * @param {integer} params.templateId Identifier for the template that is being requested + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.insert + * @desc Creates a new template for the table. + * @alias fusiontables.template.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table for which a new template is being created + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.list + * @desc Retrieves a list of templates. + * @alias fusiontables.template.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of templates to return. Optional. Default is 5. + * @param {string=} params.pageToken Continuation token specifying which results page to return. Optional. + * @param {string} params.tableId Identifier for the table whose templates are being requested + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/fusiontables/v2/tables/{tableId}/templates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tableId'], + pathParams: ['tableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.patch + * @desc Updates an existing template. This method supports patch semantics. + * @alias fusiontables.template.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the updated template belongs + * @param {integer} params.templateId Identifier for the template that is being updated + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * fusiontables.template.update + * @desc Updates an existing template + * @alias fusiontables.template.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tableId Table to which the updated template belongs + * @param {integer} params.templateId Identifier for the template that is being updated + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/fusiontables/v2/tables/{tableId}/templates/{templateId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tableId', 'templateId'], + pathParams: ['tableId', 'templateId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/games/v1.ts b/src/apis/games/v1.ts index 3922bd21033..757d974cb02 100644 --- a/src/apis/games/v1.ts +++ b/src/apis/games/v1.ts @@ -27,6045 +27,6090 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Game Services API - * - * The API for Google Play Game Services. - * - * @example - * const google = require('googleapis'); - * const games = google.games('v1'); - * - * @namespace games - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Games - */ -export class Games { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - achievementDefinitions: Resource$Achievementdefinitions; - achievements: Resource$Achievements; - applications: Resource$Applications; - events: Resource$Events; - leaderboards: Resource$Leaderboards; - metagame: Resource$Metagame; - players: Resource$Players; - pushtokens: Resource$Pushtokens; - questMilestones: Resource$Questmilestones; - quests: Resource$Quests; - revisions: Resource$Revisions; - rooms: Resource$Rooms; - scores: Resource$Scores; - snapshots: Resource$Snapshots; - turnBasedMatches: Resource$Turnbasedmatches; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.achievementDefinitions = new Resource$Achievementdefinitions(this); - this.achievements = new Resource$Achievements(this); - this.applications = new Resource$Applications(this); - this.events = new Resource$Events(this); - this.leaderboards = new Resource$Leaderboards(this); - this.metagame = new Resource$Metagame(this); - this.players = new Resource$Players(this); - this.pushtokens = new Resource$Pushtokens(this); - this.questMilestones = new Resource$Questmilestones(this); - this.quests = new Resource$Quests(this); - this.revisions = new Resource$Revisions(this); - this.rooms = new Resource$Rooms(this); - this.scores = new Resource$Scores(this); - this.snapshots = new Resource$Snapshots(this); - this.turnBasedMatches = new Resource$Turnbasedmatches(this); - } - - getRoot() { - return this.root; +export namespace games_v1 { + /** + * Google Play Game Services API + * + * The API for Google Play Game Services. + * + * @example + * const google = require('googleapis'); + * const games = google.games('v1'); + * + * @namespace games + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Games + */ + export class Games { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + achievementDefinitions: Resource$Achievementdefinitions; + achievements: Resource$Achievements; + applications: Resource$Applications; + events: Resource$Events; + leaderboards: Resource$Leaderboards; + metagame: Resource$Metagame; + players: Resource$Players; + pushtokens: Resource$Pushtokens; + questMilestones: Resource$Questmilestones; + quests: Resource$Quests; + revisions: Resource$Revisions; + rooms: Resource$Rooms; + scores: Resource$Scores; + snapshots: Resource$Snapshots; + turnBasedMatches: Resource$Turnbasedmatches; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.achievementDefinitions = new Resource$Achievementdefinitions(this); + this.achievements = new Resource$Achievements(this); + this.applications = new Resource$Applications(this); + this.events = new Resource$Events(this); + this.leaderboards = new Resource$Leaderboards(this); + this.metagame = new Resource$Metagame(this); + this.players = new Resource$Players(this); + this.pushtokens = new Resource$Pushtokens(this); + this.questMilestones = new Resource$Questmilestones(this); + this.quests = new Resource$Quests(this); + this.revisions = new Resource$Revisions(this); + this.rooms = new Resource$Rooms(this); + this.scores = new Resource$Scores(this); + this.snapshots = new Resource$Snapshots(this); + this.turnBasedMatches = new Resource$Turnbasedmatches(this); + } + + getRoot() { + return this.root; + } } -} -/** - * This is a JSON template for an achievement definition object. - */ -export interface Schema$AchievementDefinition { - /** - * The type of the achievement. Possible values are: - "STANDARD" - * - Achievement is either locked or unlocked. - "INCREMENTAL" - - * Achievement is incremental. - */ - achievementType: string; - /** - * The description of the achievement. - */ - description: string; - /** - * Experience points which will be earned when unlocking this achievement. - */ - experiencePoints: string; - /** - * The total steps for an incremental achievement as a string. - */ - formattedTotalSteps: string; - /** - * The ID of the achievement. - */ - id: string; - /** - * The initial state of the achievement. Possible values are: - - * "HIDDEN" - Achievement is hidden. - "REVEALED" - - * Achievement is revealed. - "UNLOCKED" - Achievement is unlocked. - */ - initialState: string; - /** - * Indicates whether the revealed icon image being returned is a default - * image, or is provided by the game. - */ - isRevealedIconUrlDefault: boolean; - /** - * Indicates whether the unlocked icon image being returned is a default - * image, or is game-provided. - */ - isUnlockedIconUrlDefault: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementDefinition. - */ - kind: string; - /** - * The name of the achievement. - */ - name: string; - /** - * The image URL for the revealed achievement icon. - */ - revealedIconUrl: string; - /** - * The total steps for an incremental achievement. - */ - totalSteps: number; - /** - * The image URL for the unlocked achievement icon. - */ - unlockedIconUrl: string; -} -/** - * This is a JSON template for a list of achievement definition objects. - */ -export interface Schema$AchievementDefinitionsListResponse { - /** - * The achievement definitions. - */ - items: Schema$AchievementDefinition[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementDefinitionsListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for an achievement increment response - */ -export interface Schema$AchievementIncrementResponse { - /** - * The current steps recorded for this incremental achievement. - */ - currentSteps: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementIncrementResponse. - */ - kind: string; - /** - * Whether the current steps for the achievement has reached the number of - * steps required to unlock. - */ - newlyUnlocked: boolean; -} -/** - * This is a JSON template for an achievement reveal response - */ -export interface Schema$AchievementRevealResponse { - /** - * The current state of the achievement for which a reveal was attempted. This - * might be UNLOCKED if the achievement was already unlocked. Possible values - * are: - "REVEALED" - Achievement is revealed. - - * "UNLOCKED" - Achievement is unlocked. - */ - currentState: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementRevealResponse. - */ - kind: string; -} -/** - * This is a JSON template for an achievement set steps at least response. - */ -export interface Schema$AchievementSetStepsAtLeastResponse { - /** - * The current steps recorded for this incremental achievement. - */ - currentSteps: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementSetStepsAtLeastResponse. - */ - kind: string; - /** - * Whether the the current steps for the achievement has reached the number of - * steps required to unlock. - */ - newlyUnlocked: boolean; -} -/** - * This is a JSON template for an achievement unlock response - */ -export interface Schema$AchievementUnlockResponse { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementUnlockResponse. - */ - kind: string; - /** - * Whether this achievement was newly unlocked (that is, whether the unlock - * request for the achievement was the first for the player). - */ - newlyUnlocked: boolean; -} -/** - * This is a JSON template for a list of achievement update requests. - */ -export interface Schema$AchievementUpdateMultipleRequest { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementUpdateMultipleRequest. - */ - kind: string; - /** - * The individual achievement update requests. - */ - updates: Schema$AchievementUpdateRequest[]; -} -/** - * This is a JSON template for an achievement unlock response. - */ -export interface Schema$AchievementUpdateMultipleResponse { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementUpdateListResponse. - */ - kind: string; - /** - * The updated state of the achievements. - */ - updatedAchievements: Schema$AchievementUpdateResponse[]; -} -/** - * This is a JSON template for a request to update an achievement. - */ -export interface Schema$AchievementUpdateRequest { - /** - * The achievement this update is being applied to. - */ - achievementId: string; - /** - * The payload if an update of type INCREMENT was requested for the - * achievement. - */ - incrementPayload: Schema$GamesAchievementIncrement; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementUpdateRequest. - */ - kind: string; - /** - * The payload if an update of type SET_STEPS_AT_LEAST was requested for the - * achievement. - */ - setStepsAtLeastPayload: Schema$GamesAchievementSetStepsAtLeast; - /** - * The type of update being applied. Possible values are: - - * "REVEAL" - Achievement is revealed. - "UNLOCK" - - * Achievement is unlocked. - "INCREMENT" - Achievement is - * incremented. - "SET_STEPS_AT_LEAST" - Achievement progress is - * set to at least the passed value. - */ - updateType: string; -} -/** - * This is a JSON template for an achievement update response. - */ -export interface Schema$AchievementUpdateResponse { - /** - * The achievement this update is was applied to. - */ - achievementId: string; - /** - * The current state of the achievement. Possible values are: - - * "HIDDEN" - Achievement is hidden. - "REVEALED" - - * Achievement is revealed. - "UNLOCKED" - Achievement is unlocked. - */ - currentState: string; - /** - * The current steps recorded for this achievement if it is incremental. - */ - currentSteps: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementUpdateResponse. - */ - kind: string; - /** - * Whether this achievement was newly unlocked (that is, whether the unlock - * request for the achievement was the first for the player). - */ - newlyUnlocked: boolean; - /** - * Whether the requested updates actually affected the achievement. - */ - updateOccurred: boolean; -} -/** - * This is a JSON template for aggregate stats. - */ -export interface Schema$AggregateStats { - /** - * The number of messages sent between a pair of peers. - */ - count: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#aggregateStats. - */ - kind: string; - /** - * The maximum amount. - */ - max: string; - /** - * The minimum amount. - */ - min: string; - /** - * The total number of bytes sent for messages between a pair of peers. - */ - sum: string; -} -/** - * This is a JSON template for an anonymous player - */ -export interface Schema$AnonymousPlayer { - /** - * The base URL for the image to display for the anonymous player. - */ - avatarImageUrl: string; - /** - * The name to display for the anonymous player. - */ - displayName: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#anonymousPlayer. - */ - kind: string; -} -/** - * This is a JSON template for the Application resource. - */ -export interface Schema$Application { - /** - * The number of achievements visible to the currently authenticated player. - */ - achievement_count: number; - /** - * The assets of the application. - */ - assets: Schema$ImageAsset[]; - /** - * The author of the application. - */ - author: string; - /** - * The category of the application. - */ - category: Schema$ApplicationCategory; - /** - * The description of the application. - */ - description: string; - /** - * A list of features that have been enabled for the application. Possible - * values are: - "SNAPSHOTS" - Snapshots has been enabled - */ - enabledFeatures: string[]; - /** - * The ID of the application. - */ - id: string; - /** - * The instances of the application. - */ - instances: Schema$Instance[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#application. - */ - kind: string; - /** - * The last updated timestamp of the application. - */ - lastUpdatedTimestamp: string; - /** - * The number of leaderboards visible to the currently authenticated player. - */ - leaderboard_count: number; - /** - * The name of the application. - */ - name: string; - /** - * A hint to the client UI for what color to use as an app-themed color. The - * color is given as an RGB triplet (e.g. "E0E0E0"). - */ - themeColor: string; -} -/** - * This is a JSON template for an application category object. - */ -export interface Schema$ApplicationCategory { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#applicationCategory. - */ - kind: string; - /** - * The primary category. - */ - primary: string; - /** - * The secondary category. - */ - secondary: string; -} -/** - * This is a JSON template for a third party application verification response - * resource. - */ -export interface Schema$ApplicationVerifyResponse { - /** - * An alternate ID that was once used for the player that was issued the auth - * token used in this request. (This field is not normally populated.) - */ - alternate_player_id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#applicationVerifyResponse. - */ - kind: string; - /** - * The ID of the player that was issued the auth token used in this request. - */ - player_id: string; -} -/** - * This is a JSON template for data related to individual game categories. - */ -export interface Schema$Category { - /** - * The category name. - */ - category: string; - /** - * Experience points earned in this category. - */ - experiencePoints: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#category. - */ - kind: string; -} -/** - * This is a JSON template for a list of category data objects. - */ -export interface Schema$CategoryListResponse { - /** - * The list of categories with usage data. - */ - items: Schema$Category[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#categoryListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a batch update failure resource. - */ -export interface Schema$EventBatchRecordFailure { - /** - * The cause for the update failure. Possible values are: - - * "TOO_LARGE": A batch request was issued with more events than are - * allowed in a single batch. - "TIME_PERIOD_EXPIRED": A batch was - * sent with data too far in the past to record. - - * "TIME_PERIOD_SHORT": A batch was sent with a time range that was - * too short. - "TIME_PERIOD_LONG": A batch was sent with a time - * range that was too long. - "ALREADY_UPDATED": An attempt was - * made to record a batch of data which was already seen. - - * "RECORD_RATE_HIGH": An attempt was made to record data faster - * than the server will apply updates. - */ - failureCause: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventBatchRecordFailure. - */ - kind: string; - /** - * The time range which was rejected; empty for a request-wide failure. - */ - range: Schema$EventPeriodRange; -} -/** - * This is a JSON template for an event child relationship resource. - */ -export interface Schema$EventChild { - /** - * The ID of the child event. - */ - childId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventChild. - */ - kind: string; -} -/** - * This is a JSON template for an event definition resource. - */ -export interface Schema$EventDefinition { - /** - * A list of events that are a child of this event. - */ - childEvents: Schema$EventChild[]; - /** - * Description of what this event represents. - */ - description: string; - /** - * The name to display for the event. - */ - displayName: string; - /** - * The ID of the event. - */ - id: string; - /** - * The base URL for the image that represents the event. - */ - imageUrl: string; - /** - * Indicates whether the icon image being returned is a default image, or is - * game-provided. - */ - isDefaultImageUrl: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventDefinition. - */ - kind: string; - /** - * The visibility of event being tracked in this definition. Possible values - * are: - "REVEALED": This event should be visible to all users. - * - "HIDDEN": This event should only be shown to users that have - * recorded this event at least once. - */ - visibility: string; -} -/** - * This is a JSON template for a ListDefinitions response. - */ -export interface Schema$EventDefinitionListResponse { - /** - * The event definitions. - */ - items: Schema$EventDefinition[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventDefinitionListResponse. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for an event period time range. - */ -export interface Schema$EventPeriodRange { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventPeriodRange. - */ - kind: string; - /** - * The time when this update period ends, in millis, since 1970 UTC (Unix - * Epoch). - */ - periodEndMillis: string; - /** - * The time when this update period begins, in millis, since 1970 UTC (Unix - * Epoch). - */ - periodStartMillis: string; -} -/** - * This is a JSON template for an event period update resource. - */ -export interface Schema$EventPeriodUpdate { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventPeriodUpdate. - */ - kind: string; - /** - * The time period being covered by this update. - */ - timePeriod: Schema$EventPeriodRange; - /** - * The updates being made for this time period. - */ - updates: Schema$EventUpdateRequest[]; -} -/** - * This is a JSON template for an event update failure resource. - */ -export interface Schema$EventRecordFailure { - /** - * The ID of the event that was not updated. - */ - eventId: string; - /** - * The cause for the update failure. Possible values are: - - * "NOT_FOUND" - An attempt was made to set an event that was not - * defined. - "INVALID_UPDATE_VALUE" - An attempt was made to - * increment an event by a non-positive value. - */ - failureCause: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventRecordFailure. - */ - kind: string; -} -/** - * This is a JSON template for an event period update resource. - */ -export interface Schema$EventRecordRequest { - /** - * The current time when this update was sent, in milliseconds, since 1970 UTC - * (Unix Epoch). - */ - currentTimeMillis: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventRecordRequest. - */ - kind: string; - /** - * The request ID used to identify this attempt to record events. - */ - requestId: string; - /** - * A list of the time period updates being made in this request. - */ - timePeriods: Schema$EventPeriodUpdate[]; -} -/** - * This is a JSON template for an event period update resource. - */ -export interface Schema$EventUpdateRequest { - /** - * The ID of the event being modified in this update. - */ - definitionId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventUpdateRequest. - */ - kind: string; - /** - * The number of times this event occurred in this time period. - */ - updateCount: string; -} -/** - * This is a JSON template for an event period update resource. - */ -export interface Schema$EventUpdateResponse { - /** - * Any batch-wide failures which occurred applying updates. - */ - batchFailures: Schema$EventBatchRecordFailure[]; - /** - * Any failures updating a particular event. - */ - eventFailures: Schema$EventRecordFailure[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#eventUpdateResponse. - */ - kind: string; - /** - * The current status of any updated events - */ - playerEvents: Schema$PlayerEvent[]; -} -/** - * This is a JSON template for the payload to request to increment an - * achievement. - */ -export interface Schema$GamesAchievementIncrement { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#GamesAchievementIncrement. - */ - kind: string; - /** - * The requestId associated with an increment to an achievement. - */ - requestId: string; - /** - * The number of steps to be incremented. - */ - steps: number; -} -/** - * This is a JSON template for the payload to request to increment an - * achievement. - */ -export interface Schema$GamesAchievementSetStepsAtLeast { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#GamesAchievementSetStepsAtLeast. - */ - kind: string; - /** - * The minimum number of steps for the achievement to be set to. - */ - steps: number; -} -/** - * This is a JSON template for an image asset object. - */ -export interface Schema$ImageAsset { - /** - * The height of the asset. - */ - height: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#imageAsset. - */ - kind: string; - /** - * The name of the asset. - */ - name: string; - /** - * The URL of the asset. - */ - url: string; - /** - * The width of the asset. - */ - width: number; -} -/** - * This is a JSON template for the Instance resource. - */ -export interface Schema$Instance { - /** - * URI which shows where a user can acquire this instance. - */ - acquisitionUri: string; - /** - * Platform dependent details for Android. - */ - androidInstance: Schema$InstanceAndroidDetails; - /** - * Platform dependent details for iOS. - */ - iosInstance: Schema$InstanceIosDetails; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#instance. - */ - kind: string; - /** - * Localized display name. - */ - name: string; - /** - * The platform type. Possible values are: - "ANDROID" - Instance - * is for Android. - "IOS" - Instance is for iOS - - * "WEB_APP" - Instance is for Web App. - */ - platformType: string; - /** - * Flag to show if this game instance supports realtime play. - */ - realtimePlay: boolean; - /** - * Flag to show if this game instance supports turn based play. - */ - turnBasedPlay: boolean; - /** - * Platform dependent details for Web. - */ - webInstance: Schema$InstanceWebDetails; -} -/** - * This is a JSON template for the Android instance details resource. - */ -export interface Schema$InstanceAndroidDetails { - /** - * Flag indicating whether the anti-piracy check is enabled. - */ - enablePiracyCheck: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#instanceAndroidDetails. - */ - kind: string; - /** - * Android package name which maps to Google Play URL. - */ - packageName: string; - /** - * Indicates that this instance is the default for new installations. - */ - preferred: boolean; -} -/** - * This is a JSON template for the iOS details resource. - */ -export interface Schema$InstanceIosDetails { - /** - * Bundle identifier. - */ - bundleIdentifier: string; - /** - * iTunes App ID. - */ - itunesAppId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#instanceIosDetails. - */ - kind: string; - /** - * Indicates that this instance is the default for new installations on iPad - * devices. - */ - preferredForIpad: boolean; - /** - * Indicates that this instance is the default for new installations on iPhone - * devices. - */ - preferredForIphone: boolean; - /** - * Flag to indicate if this instance supports iPad. - */ - supportIpad: boolean; - /** - * Flag to indicate if this instance supports iPhone. - */ - supportIphone: boolean; -} -/** - * This is a JSON template for the Web details resource. - */ -export interface Schema$InstanceWebDetails { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#instanceWebDetails. - */ - kind: string; - /** - * Launch URL for the game. - */ - launchUrl: string; - /** - * Indicates that this instance is the default for new installations. - */ - preferred: boolean; -} -/** - * This is a JSON template for the Leaderboard resource. - */ -export interface Schema$Leaderboard { - /** - * The icon for the leaderboard. - */ - iconUrl: string; - /** - * The leaderboard ID. - */ - id: string; - /** - * Indicates whether the icon image being returned is a default image, or is - * game-provided. - */ - isIconUrlDefault: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboard. - */ - kind: string; - /** - * The name of the leaderboard. - */ - name: string; - /** - * How scores are ordered. Possible values are: - - * "LARGER_IS_BETTER" - Larger values are better; scores are sorted - * in descending order. - "SMALLER_IS_BETTER" - Smaller values are - * better; scores are sorted in ascending order. - */ - order: string; -} -/** - * This is a JSON template for the Leaderboard Entry resource. - */ -export interface Schema$LeaderboardEntry { - /** - * The localized string for the numerical value of this score. - */ - formattedScore: string; - /** - * The localized string for the rank of this score for this leaderboard. - */ - formattedScoreRank: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboardEntry. - */ - kind: string; - /** - * The player who holds this score. - */ - player: Schema$Player; - /** - * The rank of this score for this leaderboard. - */ - scoreRank: string; - /** - * Additional information about the score. Values must contain no more than 64 - * URI-safe characters as defined by section 2.3 of RFC 3986. - */ - scoreTag: string; - /** - * The numerical value of this score. - */ - scoreValue: string; - /** - * The time span of this high score. Possible values are: - - * "ALL_TIME" - The score is an all-time high score. - - * "WEEKLY" - The score is a weekly high score. - "DAILY" - * - The score is a daily high score. - */ - timeSpan: string; - /** - * The timestamp at which this score was recorded, in milliseconds since the - * epoch in UTC. - */ - writeTimestampMillis: string; -} -/** - * This is a JSON template for a list of leaderboard objects. - */ -export interface Schema$LeaderboardListResponse { - /** - * The leaderboards. - */ - items: Schema$Leaderboard[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboardListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a score rank in a leaderboard. - */ -export interface Schema$LeaderboardScoreRank { - /** - * The number of scores in the leaderboard as a string. - */ - formattedNumScores: string; - /** - * The rank in the leaderboard as a string. - */ - formattedRank: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboardScoreRank. - */ - kind: string; - /** - * The number of scores in the leaderboard. - */ - numScores: string; - /** - * The rank in the leaderboard. - */ - rank: string; -} -/** - * This is a JSON template for a ListScores response. - */ -export interface Schema$LeaderboardScores { - /** - * The scores in the leaderboard. - */ - items: Schema$LeaderboardEntry[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboardScores. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; - /** - * The total number of scores in the leaderboard. - */ - numScores: string; - /** - * The score of the requesting player on the leaderboard. The player's - * score may appear both here and in the list of scores above. If you are - * viewing a public leaderboard and the player is not sharing their gameplay - * information publicly, the scoreRank and formattedScoreRank values will not - * be present. - */ - playerScore: Schema$LeaderboardEntry; - /** - * The pagination token for the previous page of results. - */ - prevPageToken: string; -} -/** - * This is a JSON template for the metagame config resource - */ -export interface Schema$MetagameConfig { - /** - * Current version of the metagame configuration data. When this data is - * updated, the version number will be increased by one. - */ - currentVersion: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#metagameConfig. - */ - kind: string; - /** - * The list of player levels. - */ - playerLevels: Schema$PlayerLevel[]; -} -/** - * This is a JSON template for network diagnostics reported for a client. - */ -export interface Schema$NetworkDiagnostics { - /** - * The Android network subtype. - */ - androidNetworkSubtype: number; - /** - * The Android network type. - */ - androidNetworkType: number; - /** - * iOS network type as defined in Reachability.h. - */ - iosNetworkType: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#networkDiagnostics. - */ - kind: string; - /** - * The MCC+MNC code for the client's network connection. On Android: - * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() - * On iOS, see: - * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html - */ - networkOperatorCode: string; - /** - * The name of the carrier of the client's network connection. On Android: - * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() - * On iOS: - * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName - */ - networkOperatorName: string; - /** - * The amount of time in milliseconds it took for the client to establish a - * connection with the XMPP server. - */ - registrationLatencyMillis: number; -} -/** - * This is a JSON template for a result for a match participant. - */ -export interface Schema$ParticipantResult { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#participantResult. - */ - kind: string; - /** - * The ID of the participant. - */ - participantId: string; - /** - * The placement or ranking of the participant in the match results; a number - * from one to the number of participants in the match. Multiple participants - * may have the same placing value in case of a type. - */ - placing: number; - /** - * The result of the participant for this match. Possible values are: - - * "MATCH_RESULT_WIN" - The participant won the match. - - * "MATCH_RESULT_LOSS" - The participant lost the match. - - * "MATCH_RESULT_TIE" - The participant tied the match. - - * "MATCH_RESULT_NONE" - There was no winner for the match (nobody - * wins or loses this kind of game.) - "MATCH_RESULT_DISCONNECT" - - * The participant disconnected / left during the match. - - * "MATCH_RESULT_DISAGREED" - Different clients reported different - * results for this participant. - */ - result: string; -} -/** - * This is a JSON template for peer channel diagnostics. - */ -export interface Schema$PeerChannelDiagnostics { - /** - * Number of bytes received. - */ - bytesReceived: Schema$AggregateStats; - /** - * Number of bytes sent. - */ - bytesSent: Schema$AggregateStats; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#peerChannelDiagnostics. - */ - kind: string; - /** - * Number of messages lost. - */ - numMessagesLost: number; - /** - * Number of messages received. - */ - numMessagesReceived: number; - /** - * Number of messages sent. - */ - numMessagesSent: number; - /** - * Number of send failures. - */ - numSendFailures: number; - /** - * Roundtrip latency stats in milliseconds. - */ - roundtripLatencyMillis: Schema$AggregateStats; -} -/** - * This is a JSON template for peer session diagnostics. - */ -export interface Schema$PeerSessionDiagnostics { - /** - * Connected time in milliseconds. - */ - connectedTimestampMillis: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#peerSessionDiagnostics. - */ - kind: string; - /** - * The participant ID of the peer. - */ - participantId: string; - /** - * Reliable channel diagnostics. - */ - reliableChannel: Schema$PeerChannelDiagnostics; - /** - * Unreliable channel diagnostics. - */ - unreliableChannel: Schema$PeerChannelDiagnostics; -} -/** - * This is a JSON template for metadata about a player playing a game with the - * currently authenticated user. - */ -export interface Schema$Played { - /** - * True if the player was auto-matched with the currently authenticated user. - */ - autoMatched: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#played. - */ - kind: string; - /** - * The last time the player played the game in milliseconds since the epoch in - * UTC. - */ - timeMillis: string; -} -/** - * This is a JSON template for a Player resource. - */ -export interface Schema$Player { - /** - * The base URL for the image that represents the player. - */ - avatarImageUrl: string; - /** - * The url to the landscape mode player banner image. - */ - bannerUrlLandscape: string; - /** - * The url to the portrait mode player banner image. - */ - bannerUrlPortrait: string; - /** - * The name to display for the player. - */ - displayName: string; - /** - * An object to represent Play Game experience information for the player. - */ - experienceInfo: Schema$PlayerExperienceInfo; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#player. - */ - kind: string; - /** - * Details about the last time this player played a multiplayer game with the - * currently authenticated player. Populated for PLAYED_WITH player collection - * members. - */ - lastPlayedWith: Schema$Played; - /** - * An object representation of the individual components of the player's - * name. For some players, these fields may not be present. - */ - name: any; - /** - * The player ID that was used for this player the first time they signed into - * the game in question. This is only populated for calls to player.get for - * the requesting player, only if the player ID has subsequently changed, and - * only to clients that support remapping player IDs. - */ - originalPlayerId: string; - /** - * The ID of the player. - */ - playerId: string; - /** - * The player's profile settings. Controls whether or not the player's - * profile is visible to other players. - */ - profileSettings: Schema$ProfileSettings; - /** - * The player's title rewarded for their game activities. - */ - title: string; -} -/** - * This is a JSON template for an achievement object. - */ -export interface Schema$PlayerAchievement { - /** - * The state of the achievement. Possible values are: - "HIDDEN" - - * Achievement is hidden. - "REVEALED" - Achievement is revealed. - * - "UNLOCKED" - Achievement is unlocked. - */ - achievementState: string; - /** - * The current steps for an incremental achievement. - */ - currentSteps: number; - /** - * Experience points earned for the achievement. This field is absent for - * achievements that have not yet been unlocked and 0 for achievements that - * have been unlocked by testers but that are unpublished. - */ - experiencePoints: string; - /** - * The current steps for an incremental achievement as a string. - */ - formattedCurrentStepsString: string; - /** - * The ID of the achievement. - */ - id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerAchievement. - */ - kind: string; - /** - * The timestamp of the last modification to this achievement's state. - */ - lastUpdatedTimestamp: string; -} -/** - * This is a JSON template for a list of achievement objects. - */ -export interface Schema$PlayerAchievementListResponse { - /** - * The achievements. - */ - items: Schema$PlayerAchievement[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerAchievementListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for an event status resource. - */ -export interface Schema$PlayerEvent { - /** - * The ID of the event definition. - */ - definitionId: string; - /** - * The current number of times this event has occurred, as a string. The - * formatting of this string depends on the configuration of your event in the - * Play Games Developer Console. - */ - formattedNumEvents: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerEvent. - */ - kind: string; - /** - * The current number of times this event has occurred. - */ - numEvents: string; - /** - * The ID of the player. - */ - playerId: string; -} -/** - * This is a JSON template for a ListByPlayer response. - */ -export interface Schema$PlayerEventListResponse { - /** - * The player events. - */ - items: Schema$PlayerEvent[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerEventListResponse. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for 1P/3P metadata about the player's experience. - */ -export interface Schema$PlayerExperienceInfo { - /** - * The current number of experience points for the player. - */ - currentExperiencePoints: string; - /** - * The current level of the player. - */ - currentLevel: Schema$PlayerLevel; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerExperienceInfo. - */ - kind: string; - /** - * The timestamp when the player was leveled up, in millis since Unix epoch - * UTC. - */ - lastLevelUpTimestampMillis: string; - /** - * The next level of the player. If the current level is the maximum level, - * this should be same as the current level. - */ - nextLevel: Schema$PlayerLevel; -} -/** - * This is a JSON template for a player leaderboard score object. - */ -export interface Schema$PlayerLeaderboardScore { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerLeaderboardScore. - */ - kind: string; - /** - * The ID of the leaderboard this score is in. - */ - leaderboard_id: string; - /** - * The public rank of the score in this leaderboard. This object will not be - * present if the user is not sharing their scores publicly. - */ - publicRank: Schema$LeaderboardScoreRank; - /** - * The formatted value of this score. - */ - scoreString: string; - /** - * Additional information about the score. Values must contain no more than 64 - * URI-safe characters as defined by section 2.3 of RFC 3986. - */ - scoreTag: string; - /** - * The numerical value of this score. - */ - scoreValue: string; - /** - * The social rank of the score in this leaderboard. - */ - socialRank: Schema$LeaderboardScoreRank; - /** - * The time span of this score. Possible values are: - "ALL_TIME" - * - The score is an all-time score. - "WEEKLY" - The score is a - * weekly score. - "DAILY" - The score is a daily score. - */ - timeSpan: string; - /** - * The timestamp at which this score was recorded, in milliseconds since the - * epoch in UTC. - */ - writeTimestamp: string; -} -/** - * This is a JSON template for a list of player leaderboard scores. - */ -export interface Schema$PlayerLeaderboardScoreListResponse { - /** - * The leaderboard scores. - */ - items: Schema$PlayerLeaderboardScore[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerLeaderboardScoreListResponse. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; - /** - * The Player resources for the owner of this score. - */ - player: Schema$Player; -} -/** - * This is a JSON template for 1P/3P metadata about a user's level. - */ -export interface Schema$PlayerLevel { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerLevel. - */ - kind: string; - /** - * The level for the user. - */ - level: number; - /** - * The maximum experience points for this level. - */ - maxExperiencePoints: string; - /** - * The minimum experience points for this level. - */ - minExperiencePoints: string; -} -/** - * This is a JSON template for a third party player list response. - */ -export interface Schema$PlayerListResponse { - /** - * The players. - */ - items: Schema$Player[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a player score. - */ -export interface Schema$PlayerScore { - /** - * The formatted score for this player score. - */ - formattedScore: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerScore. - */ - kind: string; - /** - * The numerical value for this player score. - */ - score: string; - /** - * Additional information about this score. Values will contain no more than - * 64 URI-safe characters as defined by section 2.3 of RFC 3986. - */ - scoreTag: string; - /** - * The time span for this player score. Possible values are: - - * "ALL_TIME" - The score is an all-time score. - - * "WEEKLY" - The score is a weekly score. - "DAILY" - - * The score is a daily score. - */ - timeSpan: string; -} -/** - * This is a JSON template for a list of score submission statuses. - */ -export interface Schema$PlayerScoreListResponse { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerScoreListResponse. - */ - kind: string; - /** - * The score submissions statuses. - */ - submittedScores: Schema$PlayerScoreResponse[]; -} -/** - * This is a JSON template for a list of leaderboard entry resources. - */ -export interface Schema$PlayerScoreResponse { - /** - * The time spans where the submitted score is better than the existing score - * for that time span. Possible values are: - "ALL_TIME" - The - * score is an all-time score. - "WEEKLY" - The score is a weekly - * score. - "DAILY" - The score is a daily score. - */ - beatenScoreTimeSpans: string[]; - /** - * The formatted value of the submitted score. - */ - formattedScore: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerScoreResponse. - */ - kind: string; - /** - * The leaderboard ID that this score was submitted to. - */ - leaderboardId: string; - /** - * Additional information about this score. Values will contain no more than - * 64 URI-safe characters as defined by section 2.3 of RFC 3986. - */ - scoreTag: string; - /** - * The scores in time spans that have not been beaten. As an example, the - * submitted score may be better than the player's DAILY score, but not - * better than the player's scores for the WEEKLY or ALL_TIME time spans. - */ - unbeatenScores: Schema$PlayerScore[]; -} -/** - * This is a JSON template for a list of score submission requests - */ -export interface Schema$PlayerScoreSubmissionList { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#playerScoreSubmissionList. - */ - kind: string; - /** - * The score submissions. - */ - scores: Schema$ScoreSubmission[]; -} -/** - * This is a JSON template for profile settings - */ -export interface Schema$ProfileSettings { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#profileSettings. - */ - kind: string; - /** - * The player's current profile visibility. This field is visible to both - * 1P and 3P APIs. - */ - profileVisible: boolean; -} -/** - * This is a JSON template for a push token resource. - */ -export interface Schema$PushToken { - /** - * The revision of the client SDK used by your application, in the same format - * that's used by revisions.check. Used to send backward compatible - * messages. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of - * PLATFORM_TYPE are: - IOS - Push token is for iOS - */ - clientRevision: string; - /** - * Unique identifier for this push token. - */ - id: Schema$PushTokenId; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#pushToken. - */ - kind: string; - /** - * The preferred language for notifications that are sent using this token. - */ - language: string; -} -/** - * This is a JSON template for a push token ID resource. - */ -export interface Schema$PushTokenId { - /** - * A push token ID for iOS devices. - */ - ios: any; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#pushTokenId. - */ - kind: string; -} -/** - * This is a JSON template for a Quest resource. - */ -export interface Schema$Quest { - /** - * The timestamp at which the user accepted the quest in milliseconds since - * the epoch in UTC. Only present if the player has accepted the quest. - */ - acceptedTimestampMillis: string; - /** - * The ID of the application this quest is part of. - */ - applicationId: string; - /** - * The banner image URL for the quest. - */ - bannerUrl: string; - /** - * The description of the quest. - */ - description: string; - /** - * The timestamp at which the quest ceases to be active in milliseconds since - * the epoch in UTC. - */ - endTimestampMillis: string; - /** - * The icon image URL for the quest. - */ - iconUrl: string; - /** - * The ID of the quest. - */ - id: string; - /** - * Indicates whether the banner image being returned is a default image, or is - * game-provided. - */ - isDefaultBannerUrl: boolean; - /** - * Indicates whether the icon image being returned is a default image, or is - * game-provided. - */ - isDefaultIconUrl: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#quest. - */ - kind: string; - /** - * The timestamp at which the quest was last updated by the user in - * milliseconds since the epoch in UTC. Only present if the player has - * accepted the quest. - */ - lastUpdatedTimestampMillis: string; - /** - * The quest milestones. - */ - milestones: Schema$QuestMilestone[]; - /** - * The name of the quest. - */ - name: string; - /** - * The timestamp at which the user should be notified that the quest will end - * soon in milliseconds since the epoch in UTC. - */ - notifyTimestampMillis: string; - /** - * The timestamp at which the quest becomes active in milliseconds since the - * epoch in UTC. - */ - startTimestampMillis: string; - /** - * The state of the quest. Possible values are: - "UPCOMING": The - * quest is upcoming. The user can see the quest, but cannot accept it until - * it is open. - "OPEN": The quest is currently open and may be - * accepted at this time. - "ACCEPTED": The user is currently - * participating in this quest. - "COMPLETED": The user has - * completed the quest. - "FAILED": The quest was attempted but was - * not completed before the deadline expired. - "EXPIRED": The - * quest has expired and was not accepted. - "DELETED": The quest - * should be deleted from the local database. - */ - state: string; -} -/** - * This is a JSON template for a Quest Criterion Contribution resource. - */ -export interface Schema$QuestContribution { - /** - * The formatted value of the contribution as a string. Format depends on the - * configuration for the associated event definition in the Play Games - * Developer Console. - */ - formattedValue: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#questContribution. - */ - kind: string; - /** - * The value of the contribution. - */ - value: string; -} -/** - * This is a JSON template for a Quest Criterion resource. - */ -export interface Schema$QuestCriterion { - /** - * The total number of times the associated event must be incremented for the - * player to complete this quest. - */ - completionContribution: Schema$QuestContribution; - /** - * The number of increments the player has made toward the completion count - * event increments required to complete the quest. This value will not exceed - * the completion contribution. There will be no currentContribution until the - * player has accepted the quest. - */ - currentContribution: Schema$QuestContribution; - /** - * The ID of the event the criterion corresponds to. - */ - eventId: string; - /** - * The value of the event associated with this quest at the time that the - * quest was accepted. This value may change if event increments that took - * place before the start of quest are uploaded after the quest starts. There - * will be no initialPlayerProgress until the player has accepted the quest. - */ - initialPlayerProgress: Schema$QuestContribution; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#questCriterion. - */ - kind: string; -} -/** - * This is a JSON template for a list of quest objects. - */ -export interface Schema$QuestListResponse { - /** - * The quests. - */ - items: Schema$Quest[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#questListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a Quest Milestone resource. - */ -export interface Schema$QuestMilestone { - /** - * The completion reward data of the milestone, represented as a - * Base64-encoded string. This is a developer-specified binary blob with size - * between 0 and 2 KB before encoding. - */ - completionRewardData: string; - /** - * The criteria of the milestone. - */ - criteria: Schema$QuestCriterion[]; - /** - * The milestone ID. - */ - id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#questMilestone. - */ - kind: string; - /** - * The current state of the milestone. Possible values are: - - * "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not - * yet been claimed. - "CLAIMED" - The milestone is complete and - * has been claimed. - "NOT_COMPLETED" - The milestone has not yet - * been completed. - "NOT_STARTED" - The milestone is for a quest - * that has not yet been accepted. - */ - state: string; -} -/** - * This is a JSON template for the result of checking a revision. - */ -export interface Schema$RevisionCheckResponse { - /** - * The version of the API this client revision should use when calling API - * methods. - */ - apiVersion: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#revisionCheckResponse. - */ - kind: string; - /** - * The result of the revision check. Possible values are: - "OK" - - * The revision being used is current. - "DEPRECATED" - There is - * currently a newer version available, but the revision being used still - * works. - "INVALID" - The revision being used is not supported in - * any released version. - */ - revisionStatus: string; -} -/** - * This is a JSON template for a room resource object. - */ -export interface Schema$Room { - /** - * The ID of the application being played. - */ - applicationId: string; - /** - * Criteria for auto-matching players into this room. - */ - autoMatchingCriteria: Schema$RoomAutoMatchingCriteria; - /** - * Auto-matching status for this room. Not set if the room is not currently in - * the auto-matching queue. - */ - autoMatchingStatus: Schema$RoomAutoMatchStatus; - /** - * Details about the room creation. - */ - creationDetails: Schema$RoomModification; - /** - * This short description is generated by our servers and worded relative to - * the player requesting the room. It is intended to be displayed when the - * room is shown in a list (that is, an invitation to a room.) - */ - description: string; - /** - * The ID of the participant that invited the user to the room. Not set if the - * user was not invited to the room. - */ - inviterId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#room. - */ - kind: string; - /** - * Details about the last update to the room. - */ - lastUpdateDetails: Schema$RoomModification; - /** - * The participants involved in the room, along with their statuses. Includes - * participants who have left or declined invitations. - */ - participants: Schema$RoomParticipant[]; - /** - * Globally unique ID for a room. - */ - roomId: string; - /** - * The version of the room status: an increasing counter, used by the client - * to ignore out-of-order updates to room status. - */ - roomStatusVersion: number; - /** - * The status of the room. Possible values are: - "ROOM_INVITING" - * - One or more players have been invited and not responded. - - * "ROOM_AUTO_MATCHING" - One or more slots need to be filled by - * auto-matching. - "ROOM_CONNECTING" - Players have joined and are - * connecting to each other (either before or after auto-matching). - - * "ROOM_ACTIVE" - All players have joined and connected to each - * other. - "ROOM_DELETED" - The room should no longer be shown on - * the client. Returned in sync calls when a player joins a room (as a - * tombstone), or for rooms where all joined participants have left. - */ - status: string; - /** - * The variant / mode of the application being played; can be any integer - * value, or left blank. - */ - variant: number; -} -/** - * This is a JSON template for a room auto-match criteria object. - */ -export interface Schema$RoomAutoMatchingCriteria { - /** - * A bitmask indicating when auto-matches are valid. When ANDed with other - * exclusive bitmasks, the result must be zero. Can be used to support - * exclusive roles within a game. - */ - exclusiveBitmask: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomAutoMatchingCriteria. - */ - kind: string; - /** - * The maximum number of players that should be added to the room by - * auto-matching. - */ - maxAutoMatchingPlayers: number; - /** - * The minimum number of players that should be added to the room by - * auto-matching. - */ - minAutoMatchingPlayers: number; -} -/** - * This is a JSON template for status of room automatching that is in progress. - */ -export interface Schema$RoomAutoMatchStatus { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomAutoMatchStatus. - */ - kind: string; - /** - * An estimate for the amount of time (in seconds) that auto-matching is - * expected to take to complete. - */ - waitEstimateSeconds: number; -} -/** - * This is a JSON template for the client address when setting up a room. - */ -export interface Schema$RoomClientAddress { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomClientAddress. - */ - kind: string; - /** - * The XMPP address of the client on the Google Games XMPP network. - */ - xmppAddress: string; -} -/** - * This is a JSON template for a room creation request. - */ -export interface Schema$RoomCreateRequest { - /** - * Criteria for auto-matching players into this room. - */ - autoMatchingCriteria: Schema$RoomAutoMatchingCriteria; - /** - * The capabilities that this client supports for realtime communication. - */ - capabilities: string[]; - /** - * Client address for the player creating the room. - */ - clientAddress: Schema$RoomClientAddress; - /** - * The player IDs to invite to the room. - */ - invitedPlayerIds: string[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomCreateRequest. - */ - kind: string; - /** - * Network diagnostics for the client creating the room. - */ - networkDiagnostics: Schema$NetworkDiagnostics; - /** - * A randomly generated numeric ID. This number is used at the server to - * ensure that the request is handled correctly across retries. - */ - requestId: string; - /** - * The variant / mode of the application to be played. This can be any integer - * value, or left blank. You should use a small number of variants to keep the - * auto-matching pool as large as possible. - */ - variant: number; -} -/** - * This is a JSON template for a join room request. - */ -export interface Schema$RoomJoinRequest { - /** - * The capabilities that this client supports for realtime communication. - */ - capabilities: string[]; - /** - * Client address for the player joining the room. - */ - clientAddress: Schema$RoomClientAddress; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomJoinRequest. - */ - kind: string; - /** - * Network diagnostics for the client joining the room. - */ - networkDiagnostics: Schema$NetworkDiagnostics; -} -/** - * This is a JSON template for room leave diagnostics. - */ -export interface Schema$RoomLeaveDiagnostics { - /** - * Android network subtype. - * http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype() - */ - androidNetworkSubtype: number; - /** - * Android network type. - * http://developer.android.com/reference/android/net/NetworkInfo.html#getType() - */ - androidNetworkType: number; - /** - * iOS network type as defined in Reachability.h. - */ - iosNetworkType: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomLeaveDiagnostics. - */ - kind: string; - /** - * The MCC+MNC code for the client's network connection. On Android: - * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() - * On iOS, see: - * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html - */ - networkOperatorCode: string; - /** - * The name of the carrier of the client's network connection. On Android: - * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() - * On iOS: - * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName - */ - networkOperatorName: string; - /** - * Diagnostics about all peer sessions. - */ - peerSession: Schema$PeerSessionDiagnostics[]; - /** - * Whether or not sockets were used. - */ - socketsUsed: boolean; -} -/** - * This is a JSON template for a leave room request. - */ -export interface Schema$RoomLeaveRequest { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomLeaveRequest. - */ - kind: string; - /** - * Diagnostics for a player leaving the room. - */ - leaveDiagnostics: Schema$RoomLeaveDiagnostics; - /** - * Reason for leaving the match. Possible values are: - - * "PLAYER_LEFT" - The player chose to leave the room.. - - * "GAME_LEFT" - The game chose to remove the player from the room. - * - "REALTIME_ABANDONED" - The player switched to another - * application and abandoned the room. - - * "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to - * establish a connection to other peer(s). - - * "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to - * communicate with the server. - "REALTIME_SERVER_ERROR" - The - * client received an error response when it tried to communicate with the - * server. - "REALTIME_TIMEOUT" - The client timed out while - * waiting for a room. - "REALTIME_CLIENT_DISCONNECTING" - The - * client disconnects without first calling Leave. - - * "REALTIME_SIGN_OUT" - The user signed out of G+ while in the - * room. - "REALTIME_GAME_CRASHED" - The game crashed. - - * "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. - - * "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is - * trying to enter a room. - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - * - The same client is trying to enter a new room. - */ - reason: string; -} -/** - * This is a JSON template for a list of rooms. - */ -export interface Schema$RoomList { - /** - * The rooms. - */ - items: Schema$Room[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomList. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for room modification metadata. - */ -export interface Schema$RoomModification { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomModification. - */ - kind: string; - /** - * The timestamp at which they modified the room, in milliseconds since the - * epoch in UTC. - */ - modifiedTimestampMillis: string; - /** - * The ID of the participant that modified the room. - */ - participantId: string; -} -/** - * This is a JSON template for an update on the status of a peer in a room. - */ -export interface Schema$RoomP2PStatus { - /** - * The amount of time in milliseconds it took to establish connections with - * this peer. - */ - connectionSetupLatencyMillis: number; - /** - * The error code in event of a failure. Possible values are: - - * "P2P_FAILED" - The client failed to establish a P2P connection - * with the peer. - "PRESENCE_FAILED" - The client failed to - * register to receive P2P connections. - "RELAY_SERVER_FAILED" - - * The client received an error when trying to use the relay server to - * establish a P2P connection with the peer. - */ - error: string; - /** - * More detailed diagnostic message returned in event of a failure. - */ - error_reason: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomP2PStatus. - */ - kind: string; - /** - * The ID of the participant. - */ - participantId: string; - /** - * The status of the peer in the room. Possible values are: - - * "CONNECTION_ESTABLISHED" - The client established a P2P - * connection with the peer. - "CONNECTION_FAILED" - The client - * failed to establish directed presence with the peer. - */ - status: string; - /** - * The amount of time in milliseconds it took to send packets back and forth - * on the unreliable channel with this peer. - */ - unreliableRoundtripLatencyMillis: number; -} -/** - * This is a JSON template for an update on the status of peers in a room. - */ -export interface Schema$RoomP2PStatuses { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomP2PStatuses. - */ - kind: string; - /** - * The updates for the peers. - */ - updates: Schema$RoomP2PStatus[]; -} -/** - * This is a JSON template for a participant in a room. - */ -export interface Schema$RoomParticipant { - /** - * True if this participant was auto-matched with the requesting player. - */ - autoMatched: boolean; - /** - * Information about a player that has been anonymously auto-matched against - * the requesting player. (Either player or autoMatchedPlayer will be set.) - */ - autoMatchedPlayer: Schema$AnonymousPlayer; - /** - * The capabilities which can be used when communicating with this - * participant. - */ - capabilities: string[]; - /** - * Client address for the participant. - */ - clientAddress: Schema$RoomClientAddress; - /** - * True if this participant is in the fully connected set of peers in the - * room. - */ - connected: boolean; - /** - * An identifier for the participant in the scope of the room. Cannot be used - * to identify a player across rooms or in other contexts. - */ - id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomParticipant. - */ - kind: string; - /** - * The reason the participant left the room; populated if the participant - * status is PARTICIPANT_LEFT. Possible values are: - - * "PLAYER_LEFT" - The player explicitly chose to leave the room. - - * "GAME_LEFT" - The game chose to remove the player from the room. - * - "ABANDONED" - The player switched to another application and - * abandoned the room. - "PEER_CONNECTION_FAILURE" - The client was - * unable to establish or maintain a connection to other peer(s) in the room. - * - "SERVER_ERROR" - The client received an error response when it - * tried to communicate with the server. - "TIMEOUT" - The client - * timed out while waiting for players to join and connect. - - * "PRESENCE_FAILURE" - The client's XMPP connection ended - * abruptly. - */ - leaveReason: string; - /** - * Information about the player. Not populated if this player was anonymously - * auto-matched against the requesting player. (Either player or - * autoMatchedPlayer will be set.) - */ - player: Schema$Player; - /** - * The status of the participant with respect to the room. Possible values - * are: - "PARTICIPANT_INVITED" - The participant has been invited - * to join the room, but has not yet responded. - - * "PARTICIPANT_JOINED" - The participant has joined the room - * (either after creating it or accepting an invitation.) - - * "PARTICIPANT_DECLINED" - The participant declined an invitation - * to join the room. - "PARTICIPANT_LEFT" - The participant joined - * the room and then left it. - */ - status: string; -} -/** - * This is a JSON template for the status of a room that the player has joined. - */ -export interface Schema$RoomStatus { - /** - * Auto-matching status for this room. Not set if the room is not currently in - * the automatching queue. - */ - autoMatchingStatus: Schema$RoomAutoMatchStatus; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#roomStatus. - */ - kind: string; - /** - * The participants involved in the room, along with their statuses. Includes - * participants who have left or declined invitations. - */ - participants: Schema$RoomParticipant[]; - /** - * Globally unique ID for a room. - */ - roomId: string; - /** - * The status of the room. Possible values are: - "ROOM_INVITING" - * - One or more players have been invited and not responded. - - * "ROOM_AUTO_MATCHING" - One or more slots need to be filled by - * auto-matching. - "ROOM_CONNECTING" - Players have joined are - * connecting to each other (either before or after auto-matching). - - * "ROOM_ACTIVE" - All players have joined and connected to each - * other. - "ROOM_DELETED" - All joined players have left. - */ - status: string; - /** - * The version of the status for the room: an increasing counter, used by the - * client to ignore out-of-order updates to room status. - */ - statusVersion: number; -} -/** - * This is a JSON template for a request to submit a score to leaderboards. - */ -export interface Schema$ScoreSubmission { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#scoreSubmission. - */ - kind: string; - /** - * The leaderboard this score is being submitted to. - */ - leaderboardId: string; - /** - * The new score being submitted. - */ - score: string; - /** - * Additional information about this score. Values will contain no more than - * 64 URI-safe characters as defined by section 2.3 of RFC 3986. - */ - scoreTag: string; - /** - * Signature Values will contain URI-safe characters as defined by section 2.3 - * of RFC 3986. - */ - signature: string; -} -/** - * This is a JSON template for an snapshot object. - */ -export interface Schema$Snapshot { - /** - * The cover image of this snapshot. May be absent if there is no image. - */ - coverImage: Schema$SnapshotImage; - /** - * The description of this snapshot. - */ - description: string; - /** - * The ID of the file underlying this snapshot in the Drive API. Only present - * if the snapshot is a view on a Drive file and the file is owned by the - * caller. - */ - driveId: string; - /** - * The duration associated with this snapshot, in millis. - */ - durationMillis: string; - /** - * The ID of the snapshot. - */ - id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#snapshot. - */ - kind: string; - /** - * The timestamp (in millis since Unix epoch) of the last modification to this - * snapshot. - */ - lastModifiedMillis: string; - /** - * The progress value (64-bit integer set by developer) associated with this - * snapshot. - */ - progressValue: string; - /** - * The title of this snapshot. - */ - title: string; - /** - * The type of this snapshot. Possible values are: - "SAVE_GAME" - - * A snapshot representing a save game. - */ - type: string; - /** - * The unique name provided when the snapshot was created. - */ - uniqueName: string; -} -/** - * This is a JSON template for an image of a snapshot. - */ -export interface Schema$SnapshotImage { - /** - * The height of the image. - */ - height: number; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#snapshotImage. - */ - kind: string; - /** - * The MIME type of the image. - */ - mime_type: string; - /** - * The URL of the image. This URL may be invalidated at any time and should - * not be cached. - */ - url: string; - /** - * The width of the image. - */ - width: number; -} -/** - * This is a JSON template for a list of snapshot objects. - */ -export interface Schema$SnapshotListResponse { - /** - * The snapshots. - */ - items: Schema$Snapshot[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#snapshotListResponse. - */ - kind: string; - /** - * Token corresponding to the next page of results. If there are no more - * results, the token is omitted. - */ - nextPageToken: string; -} -/** - * This is a JSON template for an turn-based auto-match criteria object. - */ -export interface Schema$TurnBasedAutoMatchingCriteria { - /** - * A bitmask indicating when auto-matches are valid. When ANDed with other - * exclusive bitmasks, the result must be zero. Can be used to support - * exclusive roles within a game. - */ - exclusiveBitmask: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedAutoMatchingCriteria. - */ - kind: string; - /** - * The maximum number of players that should be added to the match by - * auto-matching. - */ - maxAutoMatchingPlayers: number; - /** - * The minimum number of players that should be added to the match by - * auto-matching. - */ - minAutoMatchingPlayers: number; -} -/** - * This is a JSON template for a turn-based match resource object. - */ -export interface Schema$TurnBasedMatch { - /** - * The ID of the application being played. - */ - applicationId: string; - /** - * Criteria for auto-matching players into this match. - */ - autoMatchingCriteria: Schema$TurnBasedAutoMatchingCriteria; - /** - * Details about the match creation. - */ - creationDetails: Schema$TurnBasedMatchModification; - /** - * The data / game state for this match. - */ - data: Schema$TurnBasedMatchData; - /** - * This short description is generated by our servers based on turn state and - * is localized and worded relative to the player requesting the match. It is - * intended to be displayed when the match is shown in a list. - */ - description: string; - /** - * The ID of the participant that invited the user to the match. Not set if - * the user was not invited to the match. - */ - inviterId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatch. - */ - kind: string; - /** - * Details about the last update to the match. - */ - lastUpdateDetails: Schema$TurnBasedMatchModification; - /** - * Globally unique ID for a turn-based match. - */ - matchId: string; - /** - * The number of the match in a chain of rematches. Will be set to 1 for the - * first match and incremented by 1 for each rematch. - */ - matchNumber: number; - /** - * The version of this match: an increasing counter, used to avoid out-of-date - * updates to the match. - */ - matchVersion: number; - /** - * The participants involved in the match, along with their statuses. Includes - * participants who have left or declined invitations. - */ - participants: Schema$TurnBasedMatchParticipant[]; - /** - * The ID of the participant that is taking a turn. - */ - pendingParticipantId: string; - /** - * The data / game state for the previous match; set for the first turn of - * rematches only. - */ - previousMatchData: Schema$TurnBasedMatchData; - /** - * The ID of a rematch of this match. Only set for completed matches that have - * been rematched. - */ - rematchId: string; - /** - * The results reported for this match. - */ - results: Schema$ParticipantResult[]; - /** - * The status of the match. Possible values are: - - * "MATCH_AUTO_MATCHING" - One or more slots need to be filled by - * auto-matching; the match cannot be established until they are filled. - - * "MATCH_ACTIVE" - The match has started. - - * "MATCH_COMPLETE" - The match has finished. - - * "MATCH_CANCELED" - The match was canceled. - - * "MATCH_EXPIRED" - The match expired due to inactivity. - - * "MATCH_DELETED" - The match should no longer be shown on the - * client. Returned only for tombstones for matches when sync is called. - */ - status: string; - /** - * The status of the current user in the match. Derived from the match type, - * match status, the user's participant status, and the pending - * participant for the match. Possible values are: - - * "USER_INVITED" - The user has been invited to join the match and - * has not responded yet. - "USER_AWAITING_TURN" - The user is - * waiting for their turn. - "USER_TURN" - The user has an action - * to take in the match. - "USER_MATCH_COMPLETED" - The match has - * ended (it is completed, canceled, or expired.) - */ - userMatchStatus: string; - /** - * The variant / mode of the application being played; can be any integer - * value, or left blank. - */ - variant: number; - /** - * The ID of another participant in the match that can be used when describing - * the participants the user is playing with. - */ - withParticipantId: string; -} -/** - * This is a JSON template for a turn-based match creation request. - */ -export interface Schema$TurnBasedMatchCreateRequest { - /** - * Criteria for auto-matching players into this match. - */ - autoMatchingCriteria: Schema$TurnBasedAutoMatchingCriteria; - /** - * The player ids to invite to the match. - */ - invitedPlayerIds: string[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchCreateRequest. - */ - kind: string; - /** - * A randomly generated numeric ID. This number is used at the server to - * ensure that the request is handled correctly across retries. - */ - requestId: string; - /** - * The variant / mode of the application to be played. This can be any integer - * value, or left blank. You should use a small number of variants to keep the - * auto-matching pool as large as possible. - */ - variant: number; -} -/** - * This is a JSON template for a turn-based match data object. - */ -export interface Schema$TurnBasedMatchData { - /** - * The byte representation of the data (limited to 128 kB), as a - * Base64-encoded string with the URL_SAFE encoding option. - */ - data: string; - /** - * True if this match has data available but it wasn't returned in a list - * response; fetching the match individually will retrieve this data. - */ - dataAvailable: boolean; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchData. - */ - kind: string; -} -/** - * This is a JSON template for sending a turn-based match data object. - */ -export interface Schema$TurnBasedMatchDataRequest { /** - * The byte representation of the data (limited to 128 kB), as a - * Base64-encoded string with the URL_SAFE encoding option. - */ - data: string; + * This is a JSON template for an achievement definition object. + */ + export interface Schema$AchievementDefinition { + /** + * The type of the achievement. Possible values are: - + * "STANDARD" - Achievement is either locked or unlocked. - + * "INCREMENTAL" - Achievement is incremental. + */ + achievementType: string; + /** + * The description of the achievement. + */ + description: string; + /** + * Experience points which will be earned when unlocking this achievement. + */ + experiencePoints: string; + /** + * The total steps for an incremental achievement as a string. + */ + formattedTotalSteps: string; + /** + * The ID of the achievement. + */ + id: string; + /** + * The initial state of the achievement. Possible values are: - + * "HIDDEN" - Achievement is hidden. - "REVEALED" - + * Achievement is revealed. - "UNLOCKED" - Achievement is + * unlocked. + */ + initialState: string; + /** + * Indicates whether the revealed icon image being returned is a default + * image, or is provided by the game. + */ + isRevealedIconUrlDefault: boolean; + /** + * Indicates whether the unlocked icon image being returned is a default + * image, or is game-provided. + */ + isUnlockedIconUrlDefault: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementDefinition. + */ + kind: string; + /** + * The name of the achievement. + */ + name: string; + /** + * The image URL for the revealed achievement icon. + */ + revealedIconUrl: string; + /** + * The total steps for an incremental achievement. + */ + totalSteps: number; + /** + * The image URL for the unlocked achievement icon. + */ + unlockedIconUrl: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchDataRequest. - */ - kind: string; -} -/** - * This is a JSON template for a list of turn-based matches. - */ -export interface Schema$TurnBasedMatchList { + * This is a JSON template for a list of achievement definition objects. + */ + export interface Schema$AchievementDefinitionsListResponse { + /** + * The achievement definitions. + */ + items: Schema$AchievementDefinition[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementDefinitionsListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; + } /** - * The matches. - */ - items: Schema$TurnBasedMatch[]; + * This is a JSON template for an achievement increment response + */ + export interface Schema$AchievementIncrementResponse { + /** + * The current steps recorded for this incremental achievement. + */ + currentSteps: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementIncrementResponse. + */ + kind: string; + /** + * Whether the current steps for the achievement has reached the number of + * steps required to unlock. + */ + newlyUnlocked: boolean; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchList. - */ - kind: string; + * This is a JSON template for an achievement reveal response + */ + export interface Schema$AchievementRevealResponse { + /** + * The current state of the achievement for which a reveal was attempted. + * This might be UNLOCKED if the achievement was already unlocked. Possible + * values are: - "REVEALED" - Achievement is revealed. - + * "UNLOCKED" - Achievement is unlocked. + */ + currentState: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementRevealResponse. + */ + kind: string; + } /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for turn-based match modification metadata. - */ -export interface Schema$TurnBasedMatchModification { + * This is a JSON template for an achievement set steps at least response. + */ + export interface Schema$AchievementSetStepsAtLeastResponse { + /** + * The current steps recorded for this incremental achievement. + */ + currentSteps: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementSetStepsAtLeastResponse. + */ + kind: string; + /** + * Whether the the current steps for the achievement has reached the number + * of steps required to unlock. + */ + newlyUnlocked: boolean; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchModification. - */ - kind: string; + * This is a JSON template for an achievement unlock response + */ + export interface Schema$AchievementUnlockResponse { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementUnlockResponse. + */ + kind: string; + /** + * Whether this achievement was newly unlocked (that is, whether the unlock + * request for the achievement was the first for the player). + */ + newlyUnlocked: boolean; + } /** - * The timestamp at which they modified the match, in milliseconds since the - * epoch in UTC. - */ - modifiedTimestampMillis: string; + * This is a JSON template for a list of achievement update requests. + */ + export interface Schema$AchievementUpdateMultipleRequest { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementUpdateMultipleRequest. + */ + kind: string; + /** + * The individual achievement update requests. + */ + updates: Schema$AchievementUpdateRequest[]; + } /** - * The ID of the participant that modified the match. - */ - participantId: string; -} -/** - * This is a JSON template for a participant in a turn-based match. - */ -export interface Schema$TurnBasedMatchParticipant { + * This is a JSON template for an achievement unlock response. + */ + export interface Schema$AchievementUpdateMultipleResponse { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementUpdateListResponse. + */ + kind: string; + /** + * The updated state of the achievements. + */ + updatedAchievements: Schema$AchievementUpdateResponse[]; + } /** - * True if this participant was auto-matched with the requesting player. - */ - autoMatched: boolean; + * This is a JSON template for a request to update an achievement. + */ + export interface Schema$AchievementUpdateRequest { + /** + * The achievement this update is being applied to. + */ + achievementId: string; + /** + * The payload if an update of type INCREMENT was requested for the + * achievement. + */ + incrementPayload: Schema$GamesAchievementIncrement; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementUpdateRequest. + */ + kind: string; + /** + * The payload if an update of type SET_STEPS_AT_LEAST was requested for the + * achievement. + */ + setStepsAtLeastPayload: Schema$GamesAchievementSetStepsAtLeast; + /** + * The type of update being applied. Possible values are: - + * "REVEAL" - Achievement is revealed. - "UNLOCK" - + * Achievement is unlocked. - "INCREMENT" - Achievement is + * incremented. - "SET_STEPS_AT_LEAST" - Achievement progress is + * set to at least the passed value. + */ + updateType: string; + } /** - * Information about a player that has been anonymously auto-matched against - * the requesting player. (Either player or autoMatchedPlayer will be set.) - */ - autoMatchedPlayer: Schema$AnonymousPlayer; + * This is a JSON template for an achievement update response. + */ + export interface Schema$AchievementUpdateResponse { + /** + * The achievement this update is was applied to. + */ + achievementId: string; + /** + * The current state of the achievement. Possible values are: - + * "HIDDEN" - Achievement is hidden. - "REVEALED" - + * Achievement is revealed. - "UNLOCKED" - Achievement is + * unlocked. + */ + currentState: string; + /** + * The current steps recorded for this achievement if it is incremental. + */ + currentSteps: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementUpdateResponse. + */ + kind: string; + /** + * Whether this achievement was newly unlocked (that is, whether the unlock + * request for the achievement was the first for the player). + */ + newlyUnlocked: boolean; + /** + * Whether the requested updates actually affected the achievement. + */ + updateOccurred: boolean; + } /** - * An identifier for the participant in the scope of the match. Cannot be used - * to identify a player across matches or in other contexts. - */ - id: string; + * This is a JSON template for aggregate stats. + */ + export interface Schema$AggregateStats { + /** + * The number of messages sent between a pair of peers. + */ + count: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#aggregateStats. + */ + kind: string; + /** + * The maximum amount. + */ + max: string; + /** + * The minimum amount. + */ + min: string; + /** + * The total number of bytes sent for messages between a pair of peers. + */ + sum: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchParticipant. - */ - kind: string; + * This is a JSON template for an anonymous player + */ + export interface Schema$AnonymousPlayer { + /** + * The base URL for the image to display for the anonymous player. + */ + avatarImageUrl: string; + /** + * The name to display for the anonymous player. + */ + displayName: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#anonymousPlayer. + */ + kind: string; + } /** - * Information about the player. Not populated if this player was anonymously - * auto-matched against the requesting player. (Either player or - * autoMatchedPlayer will be set.) - */ - player: Schema$Player; + * This is a JSON template for the Application resource. + */ + export interface Schema$Application { + /** + * The number of achievements visible to the currently authenticated player. + */ + achievement_count: number; + /** + * The assets of the application. + */ + assets: Schema$ImageAsset[]; + /** + * The author of the application. + */ + author: string; + /** + * The category of the application. + */ + category: Schema$ApplicationCategory; + /** + * The description of the application. + */ + description: string; + /** + * A list of features that have been enabled for the application. Possible + * values are: - "SNAPSHOTS" - Snapshots has been enabled + */ + enabledFeatures: string[]; + /** + * The ID of the application. + */ + id: string; + /** + * The instances of the application. + */ + instances: Schema$Instance[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#application. + */ + kind: string; + /** + * The last updated timestamp of the application. + */ + lastUpdatedTimestamp: string; + /** + * The number of leaderboards visible to the currently authenticated player. + */ + leaderboard_count: number; + /** + * The name of the application. + */ + name: string; + /** + * A hint to the client UI for what color to use as an app-themed color. The + * color is given as an RGB triplet (e.g. "E0E0E0"). + */ + themeColor: string; + } /** - * The status of the participant with respect to the match. Possible values - * are: - "PARTICIPANT_NOT_INVITED_YET" - The participant is - * slated to be invited to the match, but the invitation has not been sent; - * the invite will be sent when it becomes their turn. - - * "PARTICIPANT_INVITED" - The participant has been invited to join - * the match, but has not yet responded. - "PARTICIPANT_JOINED" - - * The participant has joined the match (either after creating it or accepting - * an invitation.) - "PARTICIPANT_DECLINED" - The participant - * declined an invitation to join the match. - "PARTICIPANT_LEFT" - - * The participant joined the match and then left it. - - * "PARTICIPANT_FINISHED" - The participant finished playing in the - * match. - "PARTICIPANT_UNRESPONSIVE" - The participant did not - * take their turn in the allotted time. - */ - status: string; -} -/** - * This is a JSON template for a rematch response. - */ -export interface Schema$TurnBasedMatchRematch { + * This is a JSON template for an application category object. + */ + export interface Schema$ApplicationCategory { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#applicationCategory. + */ + kind: string; + /** + * The primary category. + */ + primary: string; + /** + * The secondary category. + */ + secondary: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchRematch. - */ - kind: string; + * This is a JSON template for a third party application verification response + * resource. + */ + export interface Schema$ApplicationVerifyResponse { + /** + * An alternate ID that was once used for the player that was issued the + * auth token used in this request. (This field is not normally populated.) + */ + alternate_player_id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#applicationVerifyResponse. + */ + kind: string; + /** + * The ID of the player that was issued the auth token used in this request. + */ + player_id: string; + } /** - * The old match that the rematch was created from; will be updated such that - * the rematchId field will point at the new match. - */ - previousMatch: Schema$TurnBasedMatch; + * This is a JSON template for data related to individual game categories. + */ + export interface Schema$Category { + /** + * The category name. + */ + category: string; + /** + * Experience points earned in this category. + */ + experiencePoints: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#category. + */ + kind: string; + } /** - * The newly created match; a rematch of the old match with the same - * participants. - */ - rematch: Schema$TurnBasedMatch; -} -/** - * This is a JSON template for a turn-based match results object. - */ -export interface Schema$TurnBasedMatchResults { + * This is a JSON template for a list of category data objects. + */ + export interface Schema$CategoryListResponse { + /** + * The list of categories with usage data. + */ + items: Schema$Category[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#categoryListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; + } /** - * The final match data. - */ - data: Schema$TurnBasedMatchDataRequest; + * This is a JSON template for a batch update failure resource. + */ + export interface Schema$EventBatchRecordFailure { + /** + * The cause for the update failure. Possible values are: - + * "TOO_LARGE": A batch request was issued with more events than + * are allowed in a single batch. - "TIME_PERIOD_EXPIRED": A + * batch was sent with data too far in the past to record. - + * "TIME_PERIOD_SHORT": A batch was sent with a time range that + * was too short. - "TIME_PERIOD_LONG": A batch was sent with a + * time range that was too long. - "ALREADY_UPDATED": An attempt + * was made to record a batch of data which was already seen. - + * "RECORD_RATE_HIGH": An attempt was made to record data faster + * than the server will apply updates. + */ + failureCause: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventBatchRecordFailure. + */ + kind: string; + /** + * The time range which was rejected; empty for a request-wide failure. + */ + range: Schema$EventPeriodRange; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchResults. - */ - kind: string; + * This is a JSON template for an event child relationship resource. + */ + export interface Schema$EventChild { + /** + * The ID of the child event. + */ + childId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventChild. + */ + kind: string; + } /** - * The version of the match being updated. - */ - matchVersion: number; + * This is a JSON template for an event definition resource. + */ + export interface Schema$EventDefinition { + /** + * A list of events that are a child of this event. + */ + childEvents: Schema$EventChild[]; + /** + * Description of what this event represents. + */ + description: string; + /** + * The name to display for the event. + */ + displayName: string; + /** + * The ID of the event. + */ + id: string; + /** + * The base URL for the image that represents the event. + */ + imageUrl: string; + /** + * Indicates whether the icon image being returned is a default image, or is + * game-provided. + */ + isDefaultImageUrl: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventDefinition. + */ + kind: string; + /** + * The visibility of event being tracked in this definition. Possible values + * are: - "REVEALED": This event should be visible to all users. + * - "HIDDEN": This event should only be shown to users that have + * recorded this event at least once. + */ + visibility: string; + } /** - * The match results for the participants in the match. - */ - results: Schema$ParticipantResult[]; -} -/** - * This is a JSON template for a list of turn-based matches returned from a - * sync. - */ -export interface Schema$TurnBasedMatchSync { + * This is a JSON template for a ListDefinitions response. + */ + export interface Schema$EventDefinitionListResponse { + /** + * The event definitions. + */ + items: Schema$EventDefinition[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventDefinitionListResponse. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; + } /** - * The matches. - */ - items: Schema$TurnBasedMatch[]; + * This is a JSON template for an event period time range. + */ + export interface Schema$EventPeriodRange { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventPeriodRange. + */ + kind: string; + /** + * The time when this update period ends, in millis, since 1970 UTC (Unix + * Epoch). + */ + periodEndMillis: string; + /** + * The time when this update period begins, in millis, since 1970 UTC (Unix + * Epoch). + */ + periodStartMillis: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchSync. - */ - kind: string; + * This is a JSON template for an event period update resource. + */ + export interface Schema$EventPeriodUpdate { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventPeriodUpdate. + */ + kind: string; + /** + * The time period being covered by this update. + */ + timePeriod: Schema$EventPeriodRange; + /** + * The updates being made for this time period. + */ + updates: Schema$EventUpdateRequest[]; + } /** - * True if there were more matches available to fetch at the time the response - * was generated (which were not returned due to page size limits.) - */ - moreAvailable: boolean; + * This is a JSON template for an event update failure resource. + */ + export interface Schema$EventRecordFailure { + /** + * The ID of the event that was not updated. + */ + eventId: string; + /** + * The cause for the update failure. Possible values are: - + * "NOT_FOUND" - An attempt was made to set an event that was not + * defined. - "INVALID_UPDATE_VALUE" - An attempt was made to + * increment an event by a non-positive value. + */ + failureCause: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventRecordFailure. + */ + kind: string; + } /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for the object representing a turn. - */ -export interface Schema$TurnBasedMatchTurn { + * This is a JSON template for an event period update resource. + */ + export interface Schema$EventRecordRequest { + /** + * The current time when this update was sent, in milliseconds, since 1970 + * UTC (Unix Epoch). + */ + currentTimeMillis: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventRecordRequest. + */ + kind: string; + /** + * The request ID used to identify this attempt to record events. + */ + requestId: string; + /** + * A list of the time period updates being made in this request. + */ + timePeriods: Schema$EventPeriodUpdate[]; + } /** - * The shared game state data after the turn is over. - */ - data: Schema$TurnBasedMatchDataRequest; + * This is a JSON template for an event period update resource. + */ + export interface Schema$EventUpdateRequest { + /** + * The ID of the event being modified in this update. + */ + definitionId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventUpdateRequest. + */ + kind: string; + /** + * The number of times this event occurred in this time period. + */ + updateCount: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#turnBasedMatchTurn. - */ - kind: string; + * This is a JSON template for an event period update resource. + */ + export interface Schema$EventUpdateResponse { + /** + * Any batch-wide failures which occurred applying updates. + */ + batchFailures: Schema$EventBatchRecordFailure[]; + /** + * Any failures updating a particular event. + */ + eventFailures: Schema$EventRecordFailure[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#eventUpdateResponse. + */ + kind: string; + /** + * The current status of any updated events + */ + playerEvents: Schema$PlayerEvent[]; + } /** - * The version of this match: an increasing counter, used to avoid out-of-date - * updates to the match. + * This is a JSON template for the payload to request to increment an + * achievement. */ - matchVersion: number; + export interface Schema$GamesAchievementIncrement { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#GamesAchievementIncrement. + */ + kind: string; + /** + * The requestId associated with an increment to an achievement. + */ + requestId: string; + /** + * The number of steps to be incremented. + */ + steps: number; + } /** - * The ID of the participant who should take their turn next. May be set to - * the current player's participant ID to update match state without - * changing the turn. If not set, the match will wait for other player(s) to - * join via automatching; this is only valid if automatch criteria is set on - * the match with remaining slots for automatched players. + * This is a JSON template for the payload to request to increment an + * achievement. */ - pendingParticipantId: string; + export interface Schema$GamesAchievementSetStepsAtLeast { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#GamesAchievementSetStepsAtLeast. + */ + kind: string; + /** + * The minimum number of steps for the achievement to be set to. + */ + steps: number; + } /** - * The match results for the participants in the match. - */ - results: Schema$ParticipantResult[]; -} - -export class Resource$Achievementdefinitions { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + * This is a JSON template for an image asset object. + */ + export interface Schema$ImageAsset { + /** + * The height of the asset. + */ + height: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#imageAsset. + */ + kind: string; + /** + * The name of the asset. + */ + name: string; + /** + * The URL of the asset. + */ + url: string; + /** + * The width of the asset. + */ + width: number; } - - getRoot() { - return this.root; + /** + * This is a JSON template for the Instance resource. + */ + export interface Schema$Instance { + /** + * URI which shows where a user can acquire this instance. + */ + acquisitionUri: string; + /** + * Platform dependent details for Android. + */ + androidInstance: Schema$InstanceAndroidDetails; + /** + * Platform dependent details for iOS. + */ + iosInstance: Schema$InstanceIosDetails; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#instance. + */ + kind: string; + /** + * Localized display name. + */ + name: string; + /** + * The platform type. Possible values are: - "ANDROID" - + * Instance is for Android. - "IOS" - Instance is for iOS - + * "WEB_APP" - Instance is for Web App. + */ + platformType: string; + /** + * Flag to show if this game instance supports realtime play. + */ + realtimePlay: boolean; + /** + * Flag to show if this game instance supports turn based play. + */ + turnBasedPlay: boolean; + /** + * Platform dependent details for Web. + */ + webInstance: Schema$InstanceWebDetails; } - - /** - * games.achievementDefinitions.list - * @desc Lists all the achievement definitions for your application. - * @alias games.achievementDefinitions.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/achievements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * This is a JSON template for the Android instance details resource. + */ + export interface Schema$InstanceAndroidDetails { + /** + * Flag indicating whether the anti-piracy check is enabled. + */ + enablePiracyCheck: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#instanceAndroidDetails. + */ + kind: string; + /** + * Android package name which maps to Google Play URL. + */ + packageName: string; + /** + * Indicates that this instance is the default for new installations. + */ + preferred: boolean; } -} - -export class Resource$Achievements { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for the iOS details resource. + */ + export interface Schema$InstanceIosDetails { + /** + * Bundle identifier. + */ + bundleIdentifier: string; + /** + * iTunes App ID. + */ + itunesAppId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#instanceIosDetails. + */ + kind: string; + /** + * Indicates that this instance is the default for new installations on iPad + * devices. + */ + preferredForIpad: boolean; + /** + * Indicates that this instance is the default for new installations on + * iPhone devices. + */ + preferredForIphone: boolean; + /** + * Flag to indicate if this instance supports iPad. + */ + supportIpad: boolean; + /** + * Flag to indicate if this instance supports iPhone. + */ + supportIphone: boolean; } - - getRoot() { - return this.root; + /** + * This is a JSON template for the Web details resource. + */ + export interface Schema$InstanceWebDetails { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#instanceWebDetails. + */ + kind: string; + /** + * Launch URL for the game. + */ + launchUrl: string; + /** + * Indicates that this instance is the default for new installations. + */ + preferred: boolean; } - - /** - * games.achievements.increment - * @desc Increments the steps of the achievement with the given ID for the - * currently authenticated player. - * @alias games.achievements.increment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {string=} params.requestId A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. - * @param {integer} params.stepsToIncrement The number of steps to increment. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - increment(params?: any, options?: MethodOptions): - AxiosPromise; - increment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - increment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/achievements/{achievementId}/increment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId', 'stepsToIncrement'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for the Leaderboard resource. + */ + export interface Schema$Leaderboard { + /** + * The icon for the leaderboard. + */ + iconUrl: string; + /** + * The leaderboard ID. + */ + id: string; + /** + * Indicates whether the icon image being returned is a default image, or is + * game-provided. + */ + isIconUrlDefault: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboard. + */ + kind: string; + /** + * The name of the leaderboard. + */ + name: string; + /** + * How scores are ordered. Possible values are: - + * "LARGER_IS_BETTER" - Larger values are better; scores are + * sorted in descending order. - "SMALLER_IS_BETTER" - Smaller + * values are better; scores are sorted in ascending order. + */ + order: string; } - - /** - * games.achievements.list - * @desc Lists the progress for all your application's achievements for the - * currently authenticated player. - * @alias games.achievements.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {string=} params.state Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/players/{playerId}/achievements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId'], - pathParams: ['playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for the Leaderboard Entry resource. + */ + export interface Schema$LeaderboardEntry { + /** + * The localized string for the numerical value of this score. + */ + formattedScore: string; + /** + * The localized string for the rank of this score for this leaderboard. + */ + formattedScoreRank: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboardEntry. + */ + kind: string; + /** + * The player who holds this score. + */ + player: Schema$Player; + /** + * The rank of this score for this leaderboard. + */ + scoreRank: string; + /** + * Additional information about the score. Values must contain no more than + * 64 URI-safe characters as defined by section 2.3 of RFC 3986. + */ + scoreTag: string; + /** + * The numerical value of this score. + */ + scoreValue: string; + /** + * The time span of this high score. Possible values are: - + * "ALL_TIME" - The score is an all-time high score. - + * "WEEKLY" - The score is a weekly high score. - + * "DAILY" - The score is a daily high score. + */ + timeSpan: string; + /** + * The timestamp at which this score was recorded, in milliseconds since the + * epoch in UTC. + */ + writeTimestampMillis: string; } - - /** - * games.achievements.reveal - * @desc Sets the state of the achievement with the given ID to REVEALED for - * the currently authenticated player. - * @alias games.achievements.reveal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reveal(params?: any, options?: MethodOptions): - AxiosPromise; - reveal( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - reveal( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/achievements/{achievementId}/reveal') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of leaderboard objects. + */ + export interface Schema$LeaderboardListResponse { + /** + * The leaderboards. + */ + items: Schema$Leaderboard[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboardListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; } - - /** - * games.achievements.setStepsAtLeast - * @desc Sets the steps for the currently authenticated player towards - * unlocking an achievement. If the steps parameter is less than the current - * number of steps that the player already gained for the achievement, the - * achievement is not modified. - * @alias games.achievements.setStepsAtLeast - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {integer} params.steps The minimum value to set the steps to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setStepsAtLeast(params?: any, options?: MethodOptions): - AxiosPromise; - setStepsAtLeast( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - setStepsAtLeast( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1/achievements/{achievementId}/setStepsAtLeast') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId', 'steps'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * This is a JSON template for a score rank in a leaderboard. + */ + export interface Schema$LeaderboardScoreRank { + /** + * The number of scores in the leaderboard as a string. + */ + formattedNumScores: string; + /** + * The rank in the leaderboard as a string. + */ + formattedRank: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboardScoreRank. + */ + kind: string; + /** + * The number of scores in the leaderboard. + */ + numScores: string; + /** + * The rank in the leaderboard. + */ + rank: string; } - - /** - * games.achievements.unlock - * @desc Unlocks this achievement for the currently authenticated player. - * @alias games.achievements.unlock - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unlock(params?: any, options?: MethodOptions): - AxiosPromise; - unlock( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - unlock( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/achievements/{achievementId}/unlock') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a ListScores response. + */ + export interface Schema$LeaderboardScores { + /** + * The scores in the leaderboard. + */ + items: Schema$LeaderboardEntry[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboardScores. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; + /** + * The total number of scores in the leaderboard. + */ + numScores: string; + /** + * The score of the requesting player on the leaderboard. The player's + * score may appear both here and in the list of scores above. If you are + * viewing a public leaderboard and the player is not sharing their gameplay + * information publicly, the scoreRank and formattedScoreRank values will + * not be present. + */ + playerScore: Schema$LeaderboardEntry; + /** + * The pagination token for the previous page of results. + */ + prevPageToken: string; } - - /** - * games.achievements.updateMultiple - * @desc Updates multiple achievements for the currently authenticated player. - * @alias games.achievements.updateMultiple - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AchievementUpdateMultipleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateMultiple(params?: any, options?: MethodOptions): - AxiosPromise; - updateMultiple( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - updateMultiple( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/achievements/updateMultiple') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * This is a JSON template for the metagame config resource + */ + export interface Schema$MetagameConfig { + /** + * Current version of the metagame configuration data. When this data is + * updated, the version number will be increased by one. + */ + currentVersion: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#metagameConfig. + */ + kind: string; + /** + * The list of player levels. + */ + playerLevels: Schema$PlayerLevel[]; } -} - -export class Resource$Applications { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for network diagnostics reported for a client. + */ + export interface Schema$NetworkDiagnostics { + /** + * The Android network subtype. + */ + androidNetworkSubtype: number; + /** + * The Android network type. + */ + androidNetworkType: number; + /** + * iOS network type as defined in Reachability.h. + */ + iosNetworkType: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#networkDiagnostics. + */ + kind: string; + /** + * The MCC+MNC code for the client's network connection. On Android: + * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() + * On iOS, see: + * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html + */ + networkOperatorCode: string; + /** + * The name of the carrier of the client's network connection. On + * Android: + * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() + * On iOS: + * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName + */ + networkOperatorName: string; + /** + * The amount of time in milliseconds it took for the client to establish a + * connection with the XMPP server. + */ + registrationLatencyMillis: number; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a result for a match participant. + */ + export interface Schema$ParticipantResult { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#participantResult. + */ + kind: string; + /** + * The ID of the participant. + */ + participantId: string; + /** + * The placement or ranking of the participant in the match results; a + * number from one to the number of participants in the match. Multiple + * participants may have the same placing value in case of a type. + */ + placing: number; + /** + * The result of the participant for this match. Possible values are: - + * "MATCH_RESULT_WIN" - The participant won the match. - + * "MATCH_RESULT_LOSS" - The participant lost the match. - + * "MATCH_RESULT_TIE" - The participant tied the match. - + * "MATCH_RESULT_NONE" - There was no winner for the match (nobody + * wins or loses this kind of game.) - "MATCH_RESULT_DISCONNECT" + * - The participant disconnected / left during the match. - + * "MATCH_RESULT_DISAGREED" - Different clients reported different + * results for this participant. + */ + result: string; } - - /** - * games.applications.get - * @desc Retrieves the metadata of the application with the given ID. If the - * requested application is not available for the specified platformType, the - * returned response will not include any instance data. - * @alias games.applications.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string=} params.platformType Restrict application details returned to the specific platform. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/applications/{applicationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for peer channel diagnostics. + */ + export interface Schema$PeerChannelDiagnostics { + /** + * Number of bytes received. + */ + bytesReceived: Schema$AggregateStats; + /** + * Number of bytes sent. + */ + bytesSent: Schema$AggregateStats; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#peerChannelDiagnostics. + */ + kind: string; + /** + * Number of messages lost. + */ + numMessagesLost: number; + /** + * Number of messages received. + */ + numMessagesReceived: number; + /** + * Number of messages sent. + */ + numMessagesSent: number; + /** + * Number of send failures. + */ + numSendFailures: number; + /** + * Roundtrip latency stats in milliseconds. + */ + roundtripLatencyMillis: Schema$AggregateStats; } - - /** - * games.applications.played - * @desc Indicate that the the currently authenticated user is playing your - * application. - * @alias games.applications.played - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - played(params?: any, options?: MethodOptions): AxiosPromise; - played( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - played( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/applications/played') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for peer session diagnostics. + */ + export interface Schema$PeerSessionDiagnostics { + /** + * Connected time in milliseconds. + */ + connectedTimestampMillis: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#peerSessionDiagnostics. + */ + kind: string; + /** + * The participant ID of the peer. + */ + participantId: string; + /** + * Reliable channel diagnostics. + */ + reliableChannel: Schema$PeerChannelDiagnostics; + /** + * Unreliable channel diagnostics. + */ + unreliableChannel: Schema$PeerChannelDiagnostics; } - - /** - * games.applications.verify - * @desc Verifies the auth token provided with this request is for the - * application with the specified ID, and returns the ID of the player it was - * granted for. - * @alias games.applications.verify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verify(params?: any, options?: MethodOptions): - AxiosPromise; - verify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - verify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/applications/{applicationId}/verify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for metadata about a player playing a game with the + * currently authenticated user. + */ + export interface Schema$Played { + /** + * True if the player was auto-matched with the currently authenticated + * user. + */ + autoMatched: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#played. + */ + kind: string; + /** + * The last time the player played the game in milliseconds since the epoch + * in UTC. + */ + timeMillis: string; } -} - -export class Resource$Events { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a Player resource. + */ + export interface Schema$Player { + /** + * The base URL for the image that represents the player. + */ + avatarImageUrl: string; + /** + * The url to the landscape mode player banner image. + */ + bannerUrlLandscape: string; + /** + * The url to the portrait mode player banner image. + */ + bannerUrlPortrait: string; + /** + * The name to display for the player. + */ + displayName: string; + /** + * An object to represent Play Game experience information for the player. + */ + experienceInfo: Schema$PlayerExperienceInfo; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#player. + */ + kind: string; + /** + * Details about the last time this player played a multiplayer game with + * the currently authenticated player. Populated for PLAYED_WITH player + * collection members. + */ + lastPlayedWith: Schema$Played; + /** + * An object representation of the individual components of the player's + * name. For some players, these fields may not be present. + */ + name: any; + /** + * The player ID that was used for this player the first time they signed + * into the game in question. This is only populated for calls to player.get + * for the requesting player, only if the player ID has subsequently + * changed, and only to clients that support remapping player IDs. + */ + originalPlayerId: string; + /** + * The ID of the player. + */ + playerId: string; + /** + * The player's profile settings. Controls whether or not the + * player's profile is visible to other players. + */ + profileSettings: Schema$ProfileSettings; + /** + * The player's title rewarded for their game activities. + */ + title: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for an achievement object. + */ + export interface Schema$PlayerAchievement { + /** + * The state of the achievement. Possible values are: - "HIDDEN" + * - Achievement is hidden. - "REVEALED" - Achievement is + * revealed. - "UNLOCKED" - Achievement is unlocked. + */ + achievementState: string; + /** + * The current steps for an incremental achievement. + */ + currentSteps: number; + /** + * Experience points earned for the achievement. This field is absent for + * achievements that have not yet been unlocked and 0 for achievements that + * have been unlocked by testers but that are unpublished. + */ + experiencePoints: string; + /** + * The current steps for an incremental achievement as a string. + */ + formattedCurrentStepsString: string; + /** + * The ID of the achievement. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerAchievement. + */ + kind: string; + /** + * The timestamp of the last modification to this achievement's state. + */ + lastUpdatedTimestamp: string; } - - /** - * games.events.listByPlayer - * @desc Returns a list showing the current progress on events in this - * application for the currently authenticated user. - * @alias games.events.listByPlayer - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByPlayer(params?: any, options?: MethodOptions): - AxiosPromise; - listByPlayer( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByPlayer( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/events').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of achievement objects. + */ + export interface Schema$PlayerAchievementListResponse { + /** + * The achievements. + */ + items: Schema$PlayerAchievement[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerAchievementListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; } - - /** - * games.events.listDefinitions - * @desc Returns a list of the event definitions in this application. - * @alias games.events.listDefinitions - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listDefinitions(params?: any, options?: MethodOptions): - AxiosPromise; - listDefinitions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listDefinitions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/eventDefinitions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for an event status resource. + */ + export interface Schema$PlayerEvent { + /** + * The ID of the event definition. + */ + definitionId: string; + /** + * The current number of times this event has occurred, as a string. The + * formatting of this string depends on the configuration of your event in + * the Play Games Developer Console. + */ + formattedNumEvents: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerEvent. + */ + kind: string; + /** + * The current number of times this event has occurred. + */ + numEvents: string; + /** + * The ID of the player. + */ + playerId: string; } - - /** - * games.events.record - * @desc Records a batch of changes to the number of times events have - * occurred for the currently authenticated user of this application. - * @alias games.events.record - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {().EventRecordRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - record(params?: any, options?: MethodOptions): - AxiosPromise; - record( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - record( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/events').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a ListByPlayer response. + */ + export interface Schema$PlayerEventListResponse { + /** + * The player events. + */ + items: Schema$PlayerEvent[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerEventListResponse. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; } -} - -export class Resource$Leaderboards { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for 1P/3P metadata about the player's + * experience. + */ + export interface Schema$PlayerExperienceInfo { + /** + * The current number of experience points for the player. + */ + currentExperiencePoints: string; + /** + * The current level of the player. + */ + currentLevel: Schema$PlayerLevel; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerExperienceInfo. + */ + kind: string; + /** + * The timestamp when the player was leveled up, in millis since Unix epoch + * UTC. + */ + lastLevelUpTimestampMillis: string; + /** + * The next level of the player. If the current level is the maximum level, + * this should be same as the current level. + */ + nextLevel: Schema$PlayerLevel; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a player leaderboard score object. + */ + export interface Schema$PlayerLeaderboardScore { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerLeaderboardScore. + */ + kind: string; + /** + * The ID of the leaderboard this score is in. + */ + leaderboard_id: string; + /** + * The public rank of the score in this leaderboard. This object will not be + * present if the user is not sharing their scores publicly. + */ + publicRank: Schema$LeaderboardScoreRank; + /** + * The formatted value of this score. + */ + scoreString: string; + /** + * Additional information about the score. Values must contain no more than + * 64 URI-safe characters as defined by section 2.3 of RFC 3986. + */ + scoreTag: string; + /** + * The numerical value of this score. + */ + scoreValue: string; + /** + * The social rank of the score in this leaderboard. + */ + socialRank: Schema$LeaderboardScoreRank; + /** + * The time span of this score. Possible values are: - + * "ALL_TIME" - The score is an all-time score. - + * "WEEKLY" - The score is a weekly score. - "DAILY" - + * The score is a daily score. + */ + timeSpan: string; + /** + * The timestamp at which this score was recorded, in milliseconds since the + * epoch in UTC. + */ + writeTimestamp: string; } - - /** - * games.leaderboards.get - * @desc Retrieves the metadata of the leaderboard with the given ID. - * @alias games.leaderboards.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/leaderboards/{leaderboardId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of player leaderboard scores. + */ + export interface Schema$PlayerLeaderboardScoreListResponse { + /** + * The leaderboard scores. + */ + items: Schema$PlayerLeaderboardScore[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerLeaderboardScoreListResponse. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; + /** + * The Player resources for the owner of this score. + */ + player: Schema$Player; } - - /** - * games.leaderboards.list - * @desc Lists all the leaderboard metadata for your application. - * @alias games.leaderboards.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/leaderboards') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for 1P/3P metadata about a user's level. + */ + export interface Schema$PlayerLevel { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerLevel. + */ + kind: string; + /** + * The level for the user. + */ + level: number; + /** + * The maximum experience points for this level. + */ + maxExperiencePoints: string; + /** + * The minimum experience points for this level. + */ + minExperiencePoints: string; } -} - -export class Resource$Metagame { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a third party player list response. + */ + export interface Schema$PlayerListResponse { + /** + * The players. + */ + items: Schema$Player[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a player score. + */ + export interface Schema$PlayerScore { + /** + * The formatted score for this player score. + */ + formattedScore: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerScore. + */ + kind: string; + /** + * The numerical value for this player score. + */ + score: string; + /** + * Additional information about this score. Values will contain no more than + * 64 URI-safe characters as defined by section 2.3 of RFC 3986. + */ + scoreTag: string; + /** + * The time span for this player score. Possible values are: - + * "ALL_TIME" - The score is an all-time score. - + * "WEEKLY" - The score is a weekly score. - "DAILY" - + * The score is a daily score. + */ + timeSpan: string; } - - /** - * games.metagame.getMetagameConfig - * @desc Return the metagame configuration data for the calling application. - * @alias games.metagame.getMetagameConfig - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getMetagameConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getMetagameConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getMetagameConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/metagameConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of score submission statuses. + */ + export interface Schema$PlayerScoreListResponse { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerScoreListResponse. + */ + kind: string; + /** + * The score submissions statuses. + */ + submittedScores: Schema$PlayerScoreResponse[]; } - - /** - * games.metagame.listCategoriesByPlayer - * @desc List play data aggregated per category for the player corresponding - * to playerId. - * @alias games.metagame.listCategoriesByPlayer - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of categories for which data will be returned. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listCategoriesByPlayer(params?: any, options?: MethodOptions): - AxiosPromise; - listCategoriesByPlayer( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listCategoriesByPlayer( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1/players/{playerId}/categories/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId', 'collection'], - pathParams: ['collection', 'playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of leaderboard entry resources. + */ + export interface Schema$PlayerScoreResponse { + /** + * The time spans where the submitted score is better than the existing + * score for that time span. Possible values are: - "ALL_TIME" - + * The score is an all-time score. - "WEEKLY" - The score is a + * weekly score. - "DAILY" - The score is a daily score. + */ + beatenScoreTimeSpans: string[]; + /** + * The formatted value of the submitted score. + */ + formattedScore: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerScoreResponse. + */ + kind: string; + /** + * The leaderboard ID that this score was submitted to. + */ + leaderboardId: string; + /** + * Additional information about this score. Values will contain no more than + * 64 URI-safe characters as defined by section 2.3 of RFC 3986. + */ + scoreTag: string; + /** + * The scores in time spans that have not been beaten. As an example, the + * submitted score may be better than the player's DAILY score, but not + * better than the player's scores for the WEEKLY or ALL_TIME time + * spans. + */ + unbeatenScores: Schema$PlayerScore[]; } -} - -export class Resource$Players { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a list of score submission requests + */ + export interface Schema$PlayerScoreSubmissionList { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#playerScoreSubmissionList. + */ + kind: string; + /** + * The score submissions. + */ + scores: Schema$ScoreSubmission[]; } - - getRoot() { - return this.root; + /** + * This is a JSON template for profile settings + */ + export interface Schema$ProfileSettings { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#profileSettings. + */ + kind: string; + /** + * The player's current profile visibility. This field is visible to + * both 1P and 3P APIs. + */ + profileVisible: boolean; } - - /** - * games.players.get - * @desc Retrieves the Player resource with the given ID. To retrieve the - * player for the currently authenticated user, set playerId to me. - * @alias games.players.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/players/{playerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId'], - pathParams: ['playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a push token resource. + */ + export interface Schema$PushToken { + /** + * The revision of the client SDK used by your application, in the same + * format that's used by revisions.check. Used to send backward + * compatible messages. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible + * values of PLATFORM_TYPE are: - IOS - Push token is for iOS + */ + clientRevision: string; + /** + * Unique identifier for this push token. + */ + id: Schema$PushTokenId; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#pushToken. + */ + kind: string; + /** + * The preferred language for notifications that are sent using this token. + */ + language: string; } - - /** - * games.players.list - * @desc Get the collection of players for the currently authenticated user. - * @alias games.players.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection Collection of players being retrieved - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/players/me/players/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['collection'], - pathParams: ['collection'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a push token ID resource. + */ + export interface Schema$PushTokenId { + /** + * A push token ID for iOS devices. + */ + ios: any; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#pushTokenId. + */ + kind: string; } -} - -export class Resource$Pushtokens { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a Quest resource. + */ + export interface Schema$Quest { + /** + * The timestamp at which the user accepted the quest in milliseconds since + * the epoch in UTC. Only present if the player has accepted the quest. + */ + acceptedTimestampMillis: string; + /** + * The ID of the application this quest is part of. + */ + applicationId: string; + /** + * The banner image URL for the quest. + */ + bannerUrl: string; + /** + * The description of the quest. + */ + description: string; + /** + * The timestamp at which the quest ceases to be active in milliseconds + * since the epoch in UTC. + */ + endTimestampMillis: string; + /** + * The icon image URL for the quest. + */ + iconUrl: string; + /** + * The ID of the quest. + */ + id: string; + /** + * Indicates whether the banner image being returned is a default image, or + * is game-provided. + */ + isDefaultBannerUrl: boolean; + /** + * Indicates whether the icon image being returned is a default image, or is + * game-provided. + */ + isDefaultIconUrl: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#quest. + */ + kind: string; + /** + * The timestamp at which the quest was last updated by the user in + * milliseconds since the epoch in UTC. Only present if the player has + * accepted the quest. + */ + lastUpdatedTimestampMillis: string; + /** + * The quest milestones. + */ + milestones: Schema$QuestMilestone[]; + /** + * The name of the quest. + */ + name: string; + /** + * The timestamp at which the user should be notified that the quest will + * end soon in milliseconds since the epoch in UTC. + */ + notifyTimestampMillis: string; + /** + * The timestamp at which the quest becomes active in milliseconds since the + * epoch in UTC. + */ + startTimestampMillis: string; + /** + * The state of the quest. Possible values are: - "UPCOMING": + * The quest is upcoming. The user can see the quest, but cannot accept it + * until it is open. - "OPEN": The quest is currently open and + * may be accepted at this time. - "ACCEPTED": The user is + * currently participating in this quest. - "COMPLETED": The user + * has completed the quest. - "FAILED": The quest was attempted + * but was not completed before the deadline expired. - + * "EXPIRED": The quest has expired and was not accepted. - + * "DELETED": The quest should be deleted from the local database. + */ + state: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a Quest Criterion Contribution resource. + */ + export interface Schema$QuestContribution { + /** + * The formatted value of the contribution as a string. Format depends on + * the configuration for the associated event definition in the Play Games + * Developer Console. + */ + formattedValue: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#questContribution. + */ + kind: string; + /** + * The value of the contribution. + */ + value: string; + } + /** + * This is a JSON template for a Quest Criterion resource. + */ + export interface Schema$QuestCriterion { + /** + * The total number of times the associated event must be incremented for + * the player to complete this quest. + */ + completionContribution: Schema$QuestContribution; + /** + * The number of increments the player has made toward the completion count + * event increments required to complete the quest. This value will not + * exceed the completion contribution. There will be no currentContribution + * until the player has accepted the quest. + */ + currentContribution: Schema$QuestContribution; + /** + * The ID of the event the criterion corresponds to. + */ + eventId: string; + /** + * The value of the event associated with this quest at the time that the + * quest was accepted. This value may change if event increments that took + * place before the start of quest are uploaded after the quest starts. + * There will be no initialPlayerProgress until the player has accepted the + * quest. + */ + initialPlayerProgress: Schema$QuestContribution; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#questCriterion. + */ + kind: string; } - - /** - * games.pushtokens.remove - * @desc Removes a push token for the current user and application. Removing a - * non-existent push token will report success. - * @alias games.pushtokens.remove - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PushTokenId} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - remove(params?: any, options?: MethodOptions): AxiosPromise; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/pushtokens/remove') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of quest objects. + */ + export interface Schema$QuestListResponse { + /** + * The quests. + */ + items: Schema$Quest[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#questListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. + */ + nextPageToken: string; } - - /** - * games.pushtokens.update - * @desc Registers a push token for the current user and application. - * @alias games.pushtokens.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PushToken} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/pushtokens') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a Quest Milestone resource. + */ + export interface Schema$QuestMilestone { + /** + * The completion reward data of the milestone, represented as a + * Base64-encoded string. This is a developer-specified binary blob with + * size between 0 and 2 KB before encoding. + */ + completionRewardData: string; + /** + * The criteria of the milestone. + */ + criteria: Schema$QuestCriterion[]; + /** + * The milestone ID. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#questMilestone. + */ + kind: string; + /** + * The current state of the milestone. Possible values are: - + * "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has + * not yet been claimed. - "CLAIMED" - The milestone is complete + * and has been claimed. - "NOT_COMPLETED" - The milestone has + * not yet been completed. - "NOT_STARTED" - The milestone is for + * a quest that has not yet been accepted. + */ + state: string; } -} - -export class Resource$Questmilestones { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for the result of checking a revision. + */ + export interface Schema$RevisionCheckResponse { + /** + * The version of the API this client revision should use when calling API + * methods. + */ + apiVersion: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#revisionCheckResponse. + */ + kind: string; + /** + * The result of the revision check. Possible values are: - "OK" + * - The revision being used is current. - "DEPRECATED" - There + * is currently a newer version available, but the revision being used still + * works. - "INVALID" - The revision being used is not supported + * in any released version. + */ + revisionStatus: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a room resource object. + */ + export interface Schema$Room { + /** + * The ID of the application being played. + */ + applicationId: string; + /** + * Criteria for auto-matching players into this room. + */ + autoMatchingCriteria: Schema$RoomAutoMatchingCriteria; + /** + * Auto-matching status for this room. Not set if the room is not currently + * in the auto-matching queue. + */ + autoMatchingStatus: Schema$RoomAutoMatchStatus; + /** + * Details about the room creation. + */ + creationDetails: Schema$RoomModification; + /** + * This short description is generated by our servers and worded relative to + * the player requesting the room. It is intended to be displayed when the + * room is shown in a list (that is, an invitation to a room.) + */ + description: string; + /** + * The ID of the participant that invited the user to the room. Not set if + * the user was not invited to the room. + */ + inviterId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#room. + */ + kind: string; + /** + * Details about the last update to the room. + */ + lastUpdateDetails: Schema$RoomModification; + /** + * The participants involved in the room, along with their statuses. + * Includes participants who have left or declined invitations. + */ + participants: Schema$RoomParticipant[]; + /** + * Globally unique ID for a room. + */ + roomId: string; + /** + * The version of the room status: an increasing counter, used by the client + * to ignore out-of-order updates to room status. + */ + roomStatusVersion: number; + /** + * The status of the room. Possible values are: - + * "ROOM_INVITING" - One or more players have been invited and not + * responded. - "ROOM_AUTO_MATCHING" - One or more slots need to + * be filled by auto-matching. - "ROOM_CONNECTING" - Players have + * joined and are connecting to each other (either before or after + * auto-matching). - "ROOM_ACTIVE" - All players have joined and + * connected to each other. - "ROOM_DELETED" - The room should no + * longer be shown on the client. Returned in sync calls when a player joins + * a room (as a tombstone), or for rooms where all joined participants have + * left. + */ + status: string; + /** + * The variant / mode of the application being played; can be any integer + * value, or left blank. + */ + variant: number; } - - /** - * games.questMilestones.claim - * @desc Report that a reward for the milestone corresponding to milestoneId - * for the quest corresponding to questId has been claimed by the currently - * authorized user. - * @alias games.questMilestones.claim - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.milestoneId The ID of the milestone. - * @param {string} params.questId The ID of the quest. - * @param {string} params.requestId A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - claim(params?: any, options?: MethodOptions): AxiosPromise; - claim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - claim( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1/quests/{questId}/milestones/{milestoneId}/claim') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['questId', 'milestoneId', 'requestId'], - pathParams: ['milestoneId', 'questId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a room auto-match criteria object. + */ + export interface Schema$RoomAutoMatchingCriteria { + /** + * A bitmask indicating when auto-matches are valid. When ANDed with other + * exclusive bitmasks, the result must be zero. Can be used to support + * exclusive roles within a game. + */ + exclusiveBitmask: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomAutoMatchingCriteria. + */ + kind: string; + /** + * The maximum number of players that should be added to the room by + * auto-matching. + */ + maxAutoMatchingPlayers: number; + /** + * The minimum number of players that should be added to the room by + * auto-matching. + */ + minAutoMatchingPlayers: number; } -} - -export class Resource$Quests { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for status of room automatching that is in + * progress. + */ + export interface Schema$RoomAutoMatchStatus { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomAutoMatchStatus. + */ + kind: string; + /** + * An estimate for the amount of time (in seconds) that auto-matching is + * expected to take to complete. + */ + waitEstimateSeconds: number; } - - getRoot() { - return this.root; + /** + * This is a JSON template for the client address when setting up a room. + */ + export interface Schema$RoomClientAddress { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomClientAddress. + */ + kind: string; + /** + * The XMPP address of the client on the Google Games XMPP network. + */ + xmppAddress: string; } - - /** - * games.quests.accept - * @desc Indicates that the currently authorized user will participate in the - * quest. - * @alias games.quests.accept - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.questId The ID of the quest. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - accept(params?: any, options?: MethodOptions): AxiosPromise; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - accept( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/quests/{questId}/accept') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['questId'], - pathParams: ['questId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a room creation request. + */ + export interface Schema$RoomCreateRequest { + /** + * Criteria for auto-matching players into this room. + */ + autoMatchingCriteria: Schema$RoomAutoMatchingCriteria; + /** + * The capabilities that this client supports for realtime communication. + */ + capabilities: string[]; + /** + * Client address for the player creating the room. + */ + clientAddress: Schema$RoomClientAddress; + /** + * The player IDs to invite to the room. + */ + invitedPlayerIds: string[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomCreateRequest. + */ + kind: string; + /** + * Network diagnostics for the client creating the room. + */ + networkDiagnostics: Schema$NetworkDiagnostics; + /** + * A randomly generated numeric ID. This number is used at the server to + * ensure that the request is handled correctly across retries. + */ + requestId: string; + /** + * The variant / mode of the application to be played. This can be any + * integer value, or left blank. You should use a small number of variants + * to keep the auto-matching pool as large as possible. + */ + variant: number; } - - /** - * games.quests.list - * @desc Get a list of quests for your application and the currently - * authenticated player. - * @alias games.quests.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50). - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/players/{playerId}/quests') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId'], - pathParams: ['playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a join room request. + */ + export interface Schema$RoomJoinRequest { + /** + * The capabilities that this client supports for realtime communication. + */ + capabilities: string[]; + /** + * Client address for the player joining the room. + */ + clientAddress: Schema$RoomClientAddress; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomJoinRequest. + */ + kind: string; + /** + * Network diagnostics for the client joining the room. + */ + networkDiagnostics: Schema$NetworkDiagnostics; } -} - -export class Resource$Revisions { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for room leave diagnostics. + */ + export interface Schema$RoomLeaveDiagnostics { + /** + * Android network subtype. + * http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype() + */ + androidNetworkSubtype: number; + /** + * Android network type. + * http://developer.android.com/reference/android/net/NetworkInfo.html#getType() + */ + androidNetworkType: number; + /** + * iOS network type as defined in Reachability.h. + */ + iosNetworkType: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomLeaveDiagnostics. + */ + kind: string; + /** + * The MCC+MNC code for the client's network connection. On Android: + * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() + * On iOS, see: + * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html + */ + networkOperatorCode: string; + /** + * The name of the carrier of the client's network connection. On + * Android: + * http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() + * On iOS: + * https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName + */ + networkOperatorName: string; + /** + * Diagnostics about all peer sessions. + */ + peerSession: Schema$PeerSessionDiagnostics[]; + /** + * Whether or not sockets were used. + */ + socketsUsed: boolean; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a leave room request. + */ + export interface Schema$RoomLeaveRequest { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomLeaveRequest. + */ + kind: string; + /** + * Diagnostics for a player leaving the room. + */ + leaveDiagnostics: Schema$RoomLeaveDiagnostics; + /** + * Reason for leaving the match. Possible values are: - + * "PLAYER_LEFT" - The player chose to leave the room.. - + * "GAME_LEFT" - The game chose to remove the player from the + * room. - "REALTIME_ABANDONED" - The player switched to another + * application and abandoned the room. - + * "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to + * establish a connection to other peer(s). - + * "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to + * communicate with the server. - "REALTIME_SERVER_ERROR" - The + * client received an error response when it tried to communicate with the + * server. - "REALTIME_TIMEOUT" - The client timed out while + * waiting for a room. - "REALTIME_CLIENT_DISCONNECTING" - The + * client disconnects without first calling Leave. - + * "REALTIME_SIGN_OUT" - The user signed out of G+ while in the + * room. - "REALTIME_GAME_CRASHED" - The game crashed. - + * "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed. + * - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client + * is trying to enter a room. - + * "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is + * trying to enter a new room. + */ + reason: string; } - - /** - * games.revisions.check - * @desc Checks whether the games client is out of date. - * @alias games.revisions.check - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clientRevision The revision of the client SDK used by your application. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: - "ANDROID" - Client is running the Android SDK. - "IOS" - Client is running the iOS SDK. - "WEB_APP" - Client is running as a Web App. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - check(params?: any, options?: MethodOptions): - AxiosPromise; - check( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - check( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/revisions/check') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['clientRevision'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of rooms. + */ + export interface Schema$RoomList { + /** + * The rooms. + */ + items: Schema$Room[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomList. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; } -} - -export class Resource$Rooms { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for room modification metadata. + */ + export interface Schema$RoomModification { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomModification. + */ + kind: string; + /** + * The timestamp at which they modified the room, in milliseconds since the + * epoch in UTC. + */ + modifiedTimestampMillis: string; + /** + * The ID of the participant that modified the room. + */ + participantId: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for an update on the status of a peer in a room. + */ + export interface Schema$RoomP2PStatus { + /** + * The amount of time in milliseconds it took to establish connections with + * this peer. + */ + connectionSetupLatencyMillis: number; + /** + * The error code in event of a failure. Possible values are: - + * "P2P_FAILED" - The client failed to establish a P2P connection + * with the peer. - "PRESENCE_FAILED" - The client failed to + * register to receive P2P connections. - "RELAY_SERVER_FAILED" - + * The client received an error when trying to use the relay server to + * establish a P2P connection with the peer. + */ + error: string; + /** + * More detailed diagnostic message returned in event of a failure. + */ + error_reason: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomP2PStatus. + */ + kind: string; + /** + * The ID of the participant. + */ + participantId: string; + /** + * The status of the peer in the room. Possible values are: - + * "CONNECTION_ESTABLISHED" - The client established a P2P + * connection with the peer. - "CONNECTION_FAILED" - The client + * failed to establish directed presence with the peer. + */ + status: string; + /** + * The amount of time in milliseconds it took to send packets back and forth + * on the unreliable channel with this peer. + */ + unreliableRoundtripLatencyMillis: number; } - - /** - * games.rooms.create - * @desc Create a room. For internal use by the Games SDK only. Calling this - * method directly is unsupported. - * @alias games.rooms.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {().RoomCreateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/create') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for an update on the status of peers in a room. + */ + export interface Schema$RoomP2PStatuses { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomP2PStatuses. + */ + kind: string; + /** + * The updates for the peers. + */ + updates: Schema$RoomP2PStatus[]; } - - /** - * games.rooms.decline - * @desc Decline an invitation to join a room. For internal use by the Games - * SDK only. Calling this method directly is unsupported. - * @alias games.rooms.decline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.roomId The ID of the room. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - decline(params?: any, options?: MethodOptions): AxiosPromise; - decline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - decline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}/decline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a participant in a room. + */ + export interface Schema$RoomParticipant { + /** + * True if this participant was auto-matched with the requesting player. + */ + autoMatched: boolean; + /** + * Information about a player that has been anonymously auto-matched against + * the requesting player. (Either player or autoMatchedPlayer will be set.) + */ + autoMatchedPlayer: Schema$AnonymousPlayer; + /** + * The capabilities which can be used when communicating with this + * participant. + */ + capabilities: string[]; + /** + * Client address for the participant. + */ + clientAddress: Schema$RoomClientAddress; + /** + * True if this participant is in the fully connected set of peers in the + * room. + */ + connected: boolean; + /** + * An identifier for the participant in the scope of the room. Cannot be + * used to identify a player across rooms or in other contexts. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomParticipant. + */ + kind: string; + /** + * The reason the participant left the room; populated if the participant + * status is PARTICIPANT_LEFT. Possible values are: - + * "PLAYER_LEFT" - The player explicitly chose to leave the room. + * - "GAME_LEFT" - The game chose to remove the player from the + * room. - "ABANDONED" - The player switched to another + * application and abandoned the room. - "PEER_CONNECTION_FAILURE" + * - The client was unable to establish or maintain a connection to other + * peer(s) in the room. - "SERVER_ERROR" - The client received an + * error response when it tried to communicate with the server. - + * "TIMEOUT" - The client timed out while waiting for players to + * join and connect. - "PRESENCE_FAILURE" - The client's XMPP + * connection ended abruptly. + */ + leaveReason: string; + /** + * Information about the player. Not populated if this player was + * anonymously auto-matched against the requesting player. (Either player or + * autoMatchedPlayer will be set.) + */ + player: Schema$Player; + /** + * The status of the participant with respect to the room. Possible values + * are: - "PARTICIPANT_INVITED" - The participant has been + * invited to join the room, but has not yet responded. - + * "PARTICIPANT_JOINED" - The participant has joined the room + * (either after creating it or accepting an invitation.) - + * "PARTICIPANT_DECLINED" - The participant declined an invitation + * to join the room. - "PARTICIPANT_LEFT" - The participant + * joined the room and then left it. + */ + status: string; } - - /** - * games.rooms.dismiss - * @desc Dismiss an invitation to join a room. For internal use by the Games - * SDK only. Calling this method directly is unsupported. - * @alias games.rooms.dismiss - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.roomId The ID of the room. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - dismiss(params?: any, options?: MethodOptions): AxiosPromise; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}/dismiss') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for the status of a room that the player has + * joined. + */ + export interface Schema$RoomStatus { + /** + * Auto-matching status for this room. Not set if the room is not currently + * in the automatching queue. + */ + autoMatchingStatus: Schema$RoomAutoMatchStatus; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#roomStatus. + */ + kind: string; + /** + * The participants involved in the room, along with their statuses. + * Includes participants who have left or declined invitations. + */ + participants: Schema$RoomParticipant[]; + /** + * Globally unique ID for a room. + */ + roomId: string; + /** + * The status of the room. Possible values are: - + * "ROOM_INVITING" - One or more players have been invited and not + * responded. - "ROOM_AUTO_MATCHING" - One or more slots need to + * be filled by auto-matching. - "ROOM_CONNECTING" - Players have + * joined are connecting to each other (either before or after + * auto-matching). - "ROOM_ACTIVE" - All players have joined and + * connected to each other. - "ROOM_DELETED" - All joined players + * have left. + */ + status: string; + /** + * The version of the status for the room: an increasing counter, used by + * the client to ignore out-of-order updates to room status. + */ + statusVersion: number; } - - /** - * games.rooms.get - * @desc Get the data for a room. - * @alias games.rooms.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.roomId The ID of the room. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a request to submit a score to leaderboards. + */ + export interface Schema$ScoreSubmission { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#scoreSubmission. + */ + kind: string; + /** + * The leaderboard this score is being submitted to. + */ + leaderboardId: string; + /** + * The new score being submitted. + */ + score: string; + /** + * Additional information about this score. Values will contain no more than + * 64 URI-safe characters as defined by section 2.3 of RFC 3986. + */ + scoreTag: string; + /** + * Signature Values will contain URI-safe characters as defined by + * section 2.3 of RFC 3986. + */ + signature: string; } - - /** - * games.rooms.join - * @desc Join a room. For internal use by the Games SDK only. Calling this - * method directly is unsupported. - * @alias games.rooms.join - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.roomId The ID of the room. - * @param {().RoomJoinRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - join(params?: any, options?: MethodOptions): AxiosPromise; - join( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - join( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}/join') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for an snapshot object. + */ + export interface Schema$Snapshot { + /** + * The cover image of this snapshot. May be absent if there is no image. + */ + coverImage: Schema$SnapshotImage; + /** + * The description of this snapshot. + */ + description: string; + /** + * The ID of the file underlying this snapshot in the Drive API. Only + * present if the snapshot is a view on a Drive file and the file is owned + * by the caller. + */ + driveId: string; + /** + * The duration associated with this snapshot, in millis. + */ + durationMillis: string; + /** + * The ID of the snapshot. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#snapshot. + */ + kind: string; + /** + * The timestamp (in millis since Unix epoch) of the last modification to + * this snapshot. + */ + lastModifiedMillis: string; + /** + * The progress value (64-bit integer set by developer) associated with this + * snapshot. + */ + progressValue: string; + /** + * The title of this snapshot. + */ + title: string; + /** + * The type of this snapshot. Possible values are: - "SAVE_GAME" + * - A snapshot representing a save game. + */ + type: string; + /** + * The unique name provided when the snapshot was created. + */ + uniqueName: string; } - - /** - * games.rooms.leave - * @desc Leave a room. For internal use by the Games SDK only. Calling this - * method directly is unsupported. - * @alias games.rooms.leave - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.roomId The ID of the room. - * @param {().RoomLeaveRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - leave(params?: any, options?: MethodOptions): AxiosPromise; - leave( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - leave( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}/leave') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for an image of a snapshot. + */ + export interface Schema$SnapshotImage { + /** + * The height of the image. + */ + height: number; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#snapshotImage. + */ + kind: string; + /** + * The MIME type of the image. + */ + mime_type: string; + /** + * The URL of the image. This URL may be invalidated at any time and should + * not be cached. + */ + url: string; + /** + * The width of the image. + */ + width: number; } - - /** - * games.rooms.list - * @desc Returns invitations to join rooms. - * @alias games.rooms.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of snapshot objects. + */ + export interface Schema$SnapshotListResponse { + /** + * The snapshots. + */ + items: Schema$Snapshot[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#snapshotListResponse. + */ + kind: string; + /** + * Token corresponding to the next page of results. If there are no more + * results, the token is omitted. + */ + nextPageToken: string; } - - /** - * games.rooms.reportStatus - * @desc Updates sent by a client reporting the status of peers in a room. For - * internal use by the Games SDK only. Calling this method directly is - * unsupported. - * @alias games.rooms.reportStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.roomId The ID of the room. - * @param {().RoomP2PStatuses} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reportStatus(params?: any, options?: MethodOptions): - AxiosPromise; - reportStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reportStatus( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/rooms/{roomId}/reportstatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['roomId'], - pathParams: ['roomId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for an turn-based auto-match criteria object. + */ + export interface Schema$TurnBasedAutoMatchingCriteria { + /** + * A bitmask indicating when auto-matches are valid. When ANDed with other + * exclusive bitmasks, the result must be zero. Can be used to support + * exclusive roles within a game. + */ + exclusiveBitmask: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedAutoMatchingCriteria. + */ + kind: string; + /** + * The maximum number of players that should be added to the match by + * auto-matching. + */ + maxAutoMatchingPlayers: number; + /** + * The minimum number of players that should be added to the match by + * auto-matching. + */ + minAutoMatchingPlayers: number; } -} - -export class Resource$Scores { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a turn-based match resource object. + */ + export interface Schema$TurnBasedMatch { + /** + * The ID of the application being played. + */ + applicationId: string; + /** + * Criteria for auto-matching players into this match. + */ + autoMatchingCriteria: Schema$TurnBasedAutoMatchingCriteria; + /** + * Details about the match creation. + */ + creationDetails: Schema$TurnBasedMatchModification; + /** + * The data / game state for this match. + */ + data: Schema$TurnBasedMatchData; + /** + * This short description is generated by our servers based on turn state + * and is localized and worded relative to the player requesting the match. + * It is intended to be displayed when the match is shown in a list. + */ + description: string; + /** + * The ID of the participant that invited the user to the match. Not set if + * the user was not invited to the match. + */ + inviterId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatch. + */ + kind: string; + /** + * Details about the last update to the match. + */ + lastUpdateDetails: Schema$TurnBasedMatchModification; + /** + * Globally unique ID for a turn-based match. + */ + matchId: string; + /** + * The number of the match in a chain of rematches. Will be set to 1 for the + * first match and incremented by 1 for each rematch. + */ + matchNumber: number; + /** + * The version of this match: an increasing counter, used to avoid + * out-of-date updates to the match. + */ + matchVersion: number; + /** + * The participants involved in the match, along with their statuses. + * Includes participants who have left or declined invitations. + */ + participants: Schema$TurnBasedMatchParticipant[]; + /** + * The ID of the participant that is taking a turn. + */ + pendingParticipantId: string; + /** + * The data / game state for the previous match; set for the first turn of + * rematches only. + */ + previousMatchData: Schema$TurnBasedMatchData; + /** + * The ID of a rematch of this match. Only set for completed matches that + * have been rematched. + */ + rematchId: string; + /** + * The results reported for this match. + */ + results: Schema$ParticipantResult[]; + /** + * The status of the match. Possible values are: - + * "MATCH_AUTO_MATCHING" - One or more slots need to be filled by + * auto-matching; the match cannot be established until they are filled. - + * "MATCH_ACTIVE" - The match has started. - + * "MATCH_COMPLETE" - The match has finished. - + * "MATCH_CANCELED" - The match was canceled. - + * "MATCH_EXPIRED" - The match expired due to inactivity. - + * "MATCH_DELETED" - The match should no longer be shown on the + * client. Returned only for tombstones for matches when sync is called. + */ + status: string; + /** + * The status of the current user in the match. Derived from the match type, + * match status, the user's participant status, and the pending + * participant for the match. Possible values are: - + * "USER_INVITED" - The user has been invited to join the match + * and has not responded yet. - "USER_AWAITING_TURN" - The user + * is waiting for their turn. - "USER_TURN" - The user has an + * action to take in the match. - "USER_MATCH_COMPLETED" - The + * match has ended (it is completed, canceled, or expired.) + */ + userMatchStatus: string; + /** + * The variant / mode of the application being played; can be any integer + * value, or left blank. + */ + variant: number; + /** + * The ID of another participant in the match that can be used when + * describing the participants the user is playing with. + */ + withParticipantId: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a turn-based match creation request. + */ + export interface Schema$TurnBasedMatchCreateRequest { + /** + * Criteria for auto-matching players into this match. + */ + autoMatchingCriteria: Schema$TurnBasedAutoMatchingCriteria; + /** + * The player ids to invite to the match. + */ + invitedPlayerIds: string[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchCreateRequest. + */ + kind: string; + /** + * A randomly generated numeric ID. This number is used at the server to + * ensure that the request is handled correctly across retries. + */ + requestId: string; + /** + * The variant / mode of the application to be played. This can be any + * integer value, or left blank. You should use a small number of variants + * to keep the auto-matching pool as large as possible. + */ + variant: number; } - - /** - * games.scores.get - * @desc Get high scores, and optionally ranks, in leaderboards for the - * currently authenticated player. For a specific time span, leaderboardId can - * be set to ALL to retrieve data for all leaderboards in a given time span. - * NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same - * request; only one parameter may be set to 'ALL'. - * @alias games.scores.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.includeRankType The types of ranks to return. If the parameter is omitted, no ranks will be returned. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.leaderboardId The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. - * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId', 'leaderboardId', 'timeSpan'], - pathParams: ['leaderboardId', 'playerId', 'timeSpan'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * This is a JSON template for a turn-based match data object. + */ + export interface Schema$TurnBasedMatchData { + /** + * The byte representation of the data (limited to 128 kB), as a + * Base64-encoded string with the URL_SAFE encoding option. + */ + data: string; + /** + * True if this match has data available but it wasn't returned in a + * list response; fetching the match individually will retrieve this data. + */ + dataAvailable: boolean; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchData. + */ + kind: string; } - - /** - * games.scores.list - * @desc Lists the scores in a leaderboard, starting from the top. - * @alias games.scores.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of scores you're requesting. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1/leaderboards/{leaderboardId}/scores/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['leaderboardId', 'collection', 'timeSpan'], - pathParams: ['collection', 'leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for sending a turn-based match data object. + */ + export interface Schema$TurnBasedMatchDataRequest { + /** + * The byte representation of the data (limited to 128 kB), as a + * Base64-encoded string with the URL_SAFE encoding option. + */ + data: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchDataRequest. + */ + kind: string; } - - /** - * games.scores.listWindow - * @desc Lists the scores in a leaderboard around (and including) a player's - * score. - * @alias games.scores.listWindow - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of scores you're requesting. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {integer=} params.resultsAbove The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults. - * @param {boolean=} params.returnTopIfAbsent True if the top scores should be returned when the player is not in the leaderboard. Defaults to true. - * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listWindow(params?: any, options?: MethodOptions): - AxiosPromise; - listWindow( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listWindow( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1/leaderboards/{leaderboardId}/window/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['leaderboardId', 'collection', 'timeSpan'], - pathParams: ['collection', 'leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of turn-based matches. + */ + export interface Schema$TurnBasedMatchList { + /** + * The matches. + */ + items: Schema$TurnBasedMatch[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchList. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; } - - /** - * games.scores.submit - * @desc Submits a score to the specified leaderboard. - * @alias games.scores.submit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {string} params.score The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. - * @param {string=} params.scoreTag Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submit(params?: any, options?: MethodOptions): - AxiosPromise; - submit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - submit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/leaderboards/{leaderboardId}/scores') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['leaderboardId', 'score'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for turn-based match modification metadata. + */ + export interface Schema$TurnBasedMatchModification { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchModification. + */ + kind: string; + /** + * The timestamp at which they modified the match, in milliseconds since the + * epoch in UTC. + */ + modifiedTimestampMillis: string; + /** + * The ID of the participant that modified the match. + */ + participantId: string; } - - /** - * games.scores.submitMultiple - * @desc Submits multiple scores to leaderboards. - * @alias games.scores.submitMultiple - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {().PlayerScoreSubmissionList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submitMultiple(params?: any, options?: MethodOptions): - AxiosPromise; - submitMultiple( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - submitMultiple( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/leaderboards/scores') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a participant in a turn-based match. + */ + export interface Schema$TurnBasedMatchParticipant { + /** + * True if this participant was auto-matched with the requesting player. + */ + autoMatched: boolean; + /** + * Information about a player that has been anonymously auto-matched against + * the requesting player. (Either player or autoMatchedPlayer will be set.) + */ + autoMatchedPlayer: Schema$AnonymousPlayer; + /** + * An identifier for the participant in the scope of the match. Cannot be + * used to identify a player across matches or in other contexts. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchParticipant. + */ + kind: string; + /** + * Information about the player. Not populated if this player was + * anonymously auto-matched against the requesting player. (Either player or + * autoMatchedPlayer will be set.) + */ + player: Schema$Player; + /** + * The status of the participant with respect to the match. Possible values + * are: - "PARTICIPANT_NOT_INVITED_YET" - The participant is + * slated to be invited to the match, but the invitation has not been sent; + * the invite will be sent when it becomes their turn. - + * "PARTICIPANT_INVITED" - The participant has been invited to + * join the match, but has not yet responded. - + * "PARTICIPANT_JOINED" - The participant has joined the match + * (either after creating it or accepting an invitation.) - + * "PARTICIPANT_DECLINED" - The participant declined an invitation + * to join the match. - "PARTICIPANT_LEFT" - The participant + * joined the match and then left it. - "PARTICIPANT_FINISHED" - + * The participant finished playing in the match. - + * "PARTICIPANT_UNRESPONSIVE" - The participant did not take their + * turn in the allotted time. + */ + status: string; } -} - -export class Resource$Snapshots { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + /** + * This is a JSON template for a rematch response. + */ + export interface Schema$TurnBasedMatchRematch { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchRematch. + */ + kind: string; + /** + * The old match that the rematch was created from; will be updated such + * that the rematchId field will point at the new match. + */ + previousMatch: Schema$TurnBasedMatch; + /** + * The newly created match; a rematch of the old match with the same + * participants. + */ + rematch: Schema$TurnBasedMatch; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a turn-based match results object. + */ + export interface Schema$TurnBasedMatchResults { + /** + * The final match data. + */ + data: Schema$TurnBasedMatchDataRequest; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchResults. + */ + kind: string; + /** + * The version of the match being updated. + */ + matchVersion: number; + /** + * The match results for the participants in the match. + */ + results: Schema$ParticipantResult[]; } - - /** - * games.snapshots.get - * @desc Retrieves the metadata for a given snapshot ID. - * @alias games.snapshots.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.snapshotId The ID of the snapshot. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/snapshots/{snapshotId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['snapshotId'], - pathParams: ['snapshotId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of turn-based matches returned from a + * sync. + */ + export interface Schema$TurnBasedMatchSync { + /** + * The matches. + */ + items: Schema$TurnBasedMatch[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchSync. + */ + kind: string; + /** + * True if there were more matches available to fetch at the time the + * response was generated (which were not returned due to page size limits.) + */ + moreAvailable: boolean; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; } - - /** - * games.snapshots.list - * @desc Retrieves a list of snapshots created by your application for the - * player corresponding to the player ID. - * @alias games.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxResults The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/players/{playerId}/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['playerId'], - pathParams: ['playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for the object representing a turn. + */ + export interface Schema$TurnBasedMatchTurn { + /** + * The shared game state data after the turn is over. + */ + data: Schema$TurnBasedMatchDataRequest; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#turnBasedMatchTurn. + */ + kind: string; + /** + * The version of this match: an increasing counter, used to avoid + * out-of-date updates to the match. + */ + matchVersion: number; + /** + * The ID of the participant who should take their turn next. May be set to + * the current player's participant ID to update match state without + * changing the turn. If not set, the match will wait for other player(s) to + * join via automatching; this is only valid if automatch criteria is set on + * the match with remaining slots for automatched players. + */ + pendingParticipantId: string; + /** + * The match results for the participants in the match. + */ + results: Schema$ParticipantResult[]; } -} -export class Resource$Turnbasedmatches { - root: Games; - constructor(root: Games) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Achievementdefinitions { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.achievementDefinitions.list + * @desc Lists all the achievement definitions for your application. + * @alias games.achievementDefinitions.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/achievements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Achievements { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.achievements.increment + * @desc Increments the steps of the achievement with the given ID for the + * currently authenticated player. + * @alias games.achievements.increment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {string=} params.requestId A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. + * @param {integer} params.stepsToIncrement The number of steps to increment. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + increment(params?: any, options?: MethodOptions): + AxiosPromise; + increment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + increment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/games/v1/achievements/{achievementId}/increment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId', 'stepsToIncrement'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * games.achievements.list + * @desc Lists the progress for all your application's achievements for the + * currently authenticated player. + * @alias games.achievements.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {string=} params.state Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/players/{playerId}/achievements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId'], + pathParams: ['playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * games.achievements.reveal + * @desc Sets the state of the achievement with the given ID to REVEALED for + * the currently authenticated player. + * @alias games.achievements.reveal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reveal(params?: any, options?: MethodOptions): + AxiosPromise; + reveal( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + reveal( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/achievements/{achievementId}/reveal') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.achievements.setStepsAtLeast + * @desc Sets the steps for the currently authenticated player towards + * unlocking an achievement. If the steps parameter is less than the current + * number of steps that the player already gained for the achievement, the + * achievement is not modified. + * @alias games.achievements.setStepsAtLeast + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {integer} params.steps The minimum value to set the steps to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setStepsAtLeast(params?: any, options?: MethodOptions): + AxiosPromise; + setStepsAtLeast( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + setStepsAtLeast( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1/achievements/{achievementId}/setStepsAtLeast') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId', 'steps'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * games.achievements.unlock + * @desc Unlocks this achievement for the currently authenticated player. + * @alias games.achievements.unlock + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unlock(params?: any, options?: MethodOptions): + AxiosPromise; + unlock( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + unlock( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/achievements/{achievementId}/unlock') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.achievements.updateMultiple + * @desc Updates multiple achievements for the currently authenticated + * player. + * @alias games.achievements.updateMultiple + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AchievementUpdateMultipleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateMultiple(params?: any, options?: MethodOptions): + AxiosPromise; + updateMultiple( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + updateMultiple( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/achievements/updateMultiple') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * games.turnBasedMatches.cancel - * @desc Cancel a turn-based match. - * @alias games.turnBasedMatches.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Applications { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.applications.get + * @desc Retrieves the metadata of the application with the given ID. If the + * requested application is not available for the specified platformType, + * the returned response will not include any instance data. + * @alias games.applications.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string=} params.platformType Restrict application details returned to the specific platform. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/applications/{applicationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.applications.played + * @desc Indicate that the the currently authenticated user is playing your + * application. + * @alias games.applications.played + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + played(params?: any, options?: MethodOptions): AxiosPromise; + played( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + played( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/applications/played') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.applications.verify + * @desc Verifies the auth token provided with this request is for the + * application with the specified ID, and returns the ID of the player it + * was granted for. + * @alias games.applications.verify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verify(params?: any, options?: MethodOptions): + AxiosPromise; + verify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + verify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/applications/{applicationId}/verify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.create - * @desc Create a turn-based match. - * @alias games.turnBasedMatches.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {().TurnBasedMatchCreateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/create') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Events { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.events.listByPlayer + * @desc Returns a list showing the current progress on events in this + * application for the currently authenticated user. + * @alias games.events.listByPlayer + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByPlayer(params?: any, options?: MethodOptions): + AxiosPromise; + listByPlayer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByPlayer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/events').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.events.listDefinitions + * @desc Returns a list of the event definitions in this application. + * @alias games.events.listDefinitions + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listDefinitions(params?: any, options?: MethodOptions): + AxiosPromise; + listDefinitions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listDefinitions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/eventDefinitions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.events.record + * @desc Records a batch of changes to the number of times events have + * occurred for the currently authenticated user of this application. + * @alias games.events.record + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {().EventRecordRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + record(params?: any, options?: MethodOptions): + AxiosPromise; + record( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + record( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/events').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.decline - * @desc Decline an invitation to play a turn-based match. - * @alias games.turnBasedMatches.decline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - decline(params?: any, options?: MethodOptions): - AxiosPromise; - decline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - decline( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/decline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Leaderboards { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.leaderboards.get + * @desc Retrieves the metadata of the leaderboard with the given ID. + * @alias games.leaderboards.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/leaderboards/{leaderboardId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.leaderboards.list + * @desc Lists all the leaderboard metadata for your application. + * @alias games.leaderboards.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/leaderboards') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.dismiss - * @desc Dismiss a turn-based match from the match list. The match will no - * longer show up in the list and will not generate notifications. - * @alias games.turnBasedMatches.dismiss - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - dismiss(params?: any, options?: MethodOptions): AxiosPromise; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - dismiss( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/dismiss') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Metagame { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.metagame.getMetagameConfig + * @desc Return the metagame configuration data for the calling application. + * @alias games.metagame.getMetagameConfig + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getMetagameConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getMetagameConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getMetagameConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/metagameConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.metagame.listCategoriesByPlayer + * @desc List play data aggregated per category for the player corresponding + * to playerId. + * @alias games.metagame.listCategoriesByPlayer + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of categories for which data will be returned. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listCategoriesByPlayer(params?: any, options?: MethodOptions): + AxiosPromise; + listCategoriesByPlayer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listCategoriesByPlayer( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1/players/{playerId}/categories/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId', 'collection'], + pathParams: ['collection', 'playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.finish - * @desc Finish a turn-based match. Each player should make this call once, - * after all results are in. Only the player whose turn it is may make the - * first call to Finish, and can pass in the final match state. - * @alias games.turnBasedMatches.finish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {().TurnBasedMatchResults} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - finish(params?: any, options?: MethodOptions): - AxiosPromise; - finish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - finish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/finish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Players { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.players.get + * @desc Retrieves the Player resource with the given ID. To retrieve the + * player for the currently authenticated user, set playerId to me. + * @alias games.players.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/players/{playerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId'], + pathParams: ['playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.players.list + * @desc Get the collection of players for the currently authenticated user. + * @alias games.players.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection Collection of players being retrieved + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/players/me/players/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['collection'], + pathParams: ['collection'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.get - * @desc Get the data for a turn-based match. - * @alias games.turnBasedMatches.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeMatchData Get match data along with metadata. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Pushtokens { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.pushtokens.remove + * @desc Removes a push token for the current user and application. Removing + * a non-existent push token will report success. + * @alias games.pushtokens.remove + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PushTokenId} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + remove(params?: any, options?: MethodOptions): AxiosPromise; + remove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + remove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/pushtokens/remove') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.pushtokens.update + * @desc Registers a push token for the current user and application. + * @alias games.pushtokens.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PushToken} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/pushtokens') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.join - * @desc Join a turn-based match. - * @alias games.turnBasedMatches.join - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - join(params?: any, options?: MethodOptions): - AxiosPromise; - join( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - join( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/join') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Questmilestones { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.questMilestones.claim + * @desc Report that a reward for the milestone corresponding to milestoneId + * for the quest corresponding to questId has been claimed by the currently + * authorized user. + * @alias games.questMilestones.claim + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.milestoneId The ID of the milestone. + * @param {string} params.questId The ID of the quest. + * @param {string} params.requestId A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + claim(params?: any, options?: MethodOptions): AxiosPromise; + claim( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + claim( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1/quests/{questId}/milestones/{milestoneId}/claim') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['questId', 'milestoneId', 'requestId'], + pathParams: ['milestoneId', 'questId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.leave - * @desc Leave a turn-based match when it is not the current player's turn, - * without canceling the match. - * @alias games.turnBasedMatches.leave - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - leave(params?: any, options?: MethodOptions): - AxiosPromise; - leave( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - leave( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/leave') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Quests { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.quests.accept + * @desc Indicates that the currently authorized user will participate in + * the quest. + * @alias games.quests.accept + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.questId The ID of the quest. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + accept(params?: any, options?: MethodOptions): AxiosPromise; + accept( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + accept( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/quests/{questId}/accept') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['questId'], + pathParams: ['questId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.quests.list + * @desc Get a list of quests for your application and the currently + * authenticated player. + * @alias games.quests.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50). + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/players/{playerId}/quests') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId'], + pathParams: ['playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.leaveTurn - * @desc Leave a turn-based match during the current player's turn, without - * canceling the match. - * @alias games.turnBasedMatches.leaveTurn - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {integer} params.matchVersion The version of the match being updated. - * @param {string=} params.pendingParticipantId The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - leaveTurn(params?: any, options?: MethodOptions): - AxiosPromise; - leaveTurn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - leaveTurn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/leaveTurn') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId', 'matchVersion'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Revisions { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.revisions.check + * @desc Checks whether the games client is out of date. + * @alias games.revisions.check + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clientRevision The revision of the client SDK used by your application. Format: [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are: - "ANDROID" - Client is running the Android SDK. - "IOS" - Client is running the iOS SDK. - "WEB_APP" - Client is running as a Web App. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + check(params?: any, options?: MethodOptions): + AxiosPromise; + check( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + check( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/revisions/check') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['clientRevision'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.list - * @desc Returns turn-based matches the player is or was involved in. - * @alias games.turnBasedMatches.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.includeMatchData True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxCompletedMatches The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. - * @param {integer=} params.maxResults The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Rooms { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.rooms.create + * @desc Create a room. For internal use by the Games SDK only. Calling this + * method directly is unsupported. + * @alias games.rooms.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {().RoomCreateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/create') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.decline + * @desc Decline an invitation to join a room. For internal use by the Games + * SDK only. Calling this method directly is unsupported. + * @alias games.rooms.decline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.roomId The ID of the room. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + decline(params?: any, options?: MethodOptions): AxiosPromise; + decline( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + decline( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}/decline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.dismiss + * @desc Dismiss an invitation to join a room. For internal use by the Games + * SDK only. Calling this method directly is unsupported. + * @alias games.rooms.dismiss + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.roomId The ID of the room. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + dismiss(params?: any, options?: MethodOptions): AxiosPromise; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}/dismiss') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.get + * @desc Get the data for a room. + * @alias games.rooms.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.roomId The ID of the room. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.join + * @desc Join a room. For internal use by the Games SDK only. Calling this + * method directly is unsupported. + * @alias games.rooms.join + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.roomId The ID of the room. + * @param {().RoomJoinRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + join(params?: any, options?: MethodOptions): AxiosPromise; + join( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + join( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}/join') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.leave + * @desc Leave a room. For internal use by the Games SDK only. Calling this + * method directly is unsupported. + * @alias games.rooms.leave + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.roomId The ID of the room. + * @param {().RoomLeaveRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + leave(params?: any, options?: MethodOptions): AxiosPromise; + leave( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + leave( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}/leave') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.list + * @desc Returns invitations to join rooms. + * @alias games.rooms.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.rooms.reportStatus + * @desc Updates sent by a client reporting the status of peers in a room. + * For internal use by the Games SDK only. Calling this method directly is + * unsupported. + * @alias games.rooms.reportStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.roomId The ID of the room. + * @param {().RoomP2PStatuses} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reportStatus(params?: any, options?: MethodOptions): + AxiosPromise; + reportStatus( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reportStatus( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/rooms/{roomId}/reportstatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['roomId'], + pathParams: ['roomId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.rematch - * @desc Create a rematch of a match that was previously completed, with the - * same participants. This can be called by only one player on a match still - * in their list; the player must have called Finish first. Returns the newly - * created match; it will be the caller's turn. - * @alias games.turnBasedMatches.rematch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {string=} params.requestId A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rematch(params?: any, options?: MethodOptions): - AxiosPromise; - rematch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - rematch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/rematch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Scores { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.scores.get + * @desc Get high scores, and optionally ranks, in leaderboards for the + * currently authenticated player. For a specific time span, leaderboardId + * can be set to ALL to retrieve data for all leaderboards in a given time + * span. NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in + * the same request; only one parameter may be set to 'ALL'. + * @alias games.scores.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.includeRankType The types of ranks to return. If the parameter is omitted, no ranks will be returned. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.leaderboardId The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application. + * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId', 'leaderboardId', 'timeSpan'], + pathParams: ['leaderboardId', 'playerId', 'timeSpan'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * games.scores.list + * @desc Lists the scores in a leaderboard, starting from the top. + * @alias games.scores.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of scores you're requesting. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1/leaderboards/{leaderboardId}/scores/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['leaderboardId', 'collection', 'timeSpan'], + pathParams: ['collection', 'leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.scores.listWindow + * @desc Lists the scores in a leaderboard around (and including) a player's + * score. + * @alias games.scores.listWindow + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of scores you're requesting. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {integer=} params.maxResults The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {integer=} params.resultsAbove The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults. + * @param {boolean=} params.returnTopIfAbsent True if the top scores should be returned when the player is not in the leaderboard. Defaults to true. + * @param {string} params.timeSpan The time span for the scores and ranks you're requesting. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listWindow(params?: any, options?: MethodOptions): + AxiosPromise; + listWindow( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listWindow( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1/leaderboards/{leaderboardId}/window/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['leaderboardId', 'collection', 'timeSpan'], + pathParams: ['collection', 'leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.scores.submit + * @desc Submits a score to the specified leaderboard. + * @alias games.scores.submit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {string} params.score The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units. + * @param {string=} params.scoreTag Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submit(params?: any, options?: MethodOptions): + AxiosPromise; + submit( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + submit( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/leaderboards/{leaderboardId}/scores') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['leaderboardId', 'score'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.scores.submitMultiple + * @desc Submits multiple scores to leaderboards. + * @alias games.scores.submitMultiple + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {().PlayerScoreSubmissionList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submitMultiple(params?: any, options?: MethodOptions): + AxiosPromise; + submitMultiple( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + submitMultiple( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/leaderboards/scores') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.sync - * @desc Returns turn-based matches the player is or was involved in that - * changed since the last sync call, with the least recent changes coming - * first. Matches that should be removed from the local cache will have a - * status of MATCH_DELETED. - * @alias games.turnBasedMatches.sync - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {boolean=} params.includeMatchData True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {integer=} params.maxCompletedMatches The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. - * @param {integer=} params.maxResults The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sync(params?: any, options?: MethodOptions): - AxiosPromise; - sync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sync( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/sync') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Snapshots { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.snapshots.get + * @desc Retrieves the metadata for a given snapshot ID. + * @alias games.snapshots.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.snapshotId The ID of the snapshot. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/snapshots/{snapshotId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['snapshotId'], + pathParams: ['snapshotId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.snapshots.list + * @desc Retrieves a list of snapshots created by your application for the + * player corresponding to the player ID. + * @alias games.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxResults The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/players/{playerId}/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['playerId'], + pathParams: ['playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * games.turnBasedMatches.takeTurn - * @desc Commit the results of a player turn. - * @alias games.turnBasedMatches.takeTurn - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language The preferred language to use for strings returned by this method. - * @param {string} params.matchId The ID of the match. - * @param {().TurnBasedMatchTurn} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - takeTurn(params?: any, options?: MethodOptions): - AxiosPromise; - takeTurn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - takeTurn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/turn') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matchId'], - pathParams: ['matchId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Turnbasedmatches { + root: Games; + constructor(root: Games) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * games.turnBasedMatches.cancel + * @desc Cancel a turn-based match. + * @alias games.turnBasedMatches.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.create + * @desc Create a turn-based match. + * @alias games.turnBasedMatches.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {().TurnBasedMatchCreateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/create') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.decline + * @desc Decline an invitation to play a turn-based match. + * @alias games.turnBasedMatches.decline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + decline(params?: any, options?: MethodOptions): + AxiosPromise; + decline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + decline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/decline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.dismiss + * @desc Dismiss a turn-based match from the match list. The match will no + * longer show up in the list and will not generate notifications. + * @alias games.turnBasedMatches.dismiss + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + dismiss(params?: any, options?: MethodOptions): AxiosPromise; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + dismiss( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/dismiss') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.finish + * @desc Finish a turn-based match. Each player should make this call once, + * after all results are in. Only the player whose turn it is may make the + * first call to Finish, and can pass in the final match state. + * @alias games.turnBasedMatches.finish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {().TurnBasedMatchResults} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + finish(params?: any, options?: MethodOptions): + AxiosPromise; + finish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + finish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/finish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.get + * @desc Get the data for a turn-based match. + * @alias games.turnBasedMatches.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeMatchData Get match data along with metadata. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.join + * @desc Join a turn-based match. + * @alias games.turnBasedMatches.join + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + join(params?: any, options?: MethodOptions): + AxiosPromise; + join( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + join( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/join') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.leave + * @desc Leave a turn-based match when it is not the current player's turn, + * without canceling the match. + * @alias games.turnBasedMatches.leave + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + leave(params?: any, options?: MethodOptions): + AxiosPromise; + leave( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + leave( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/leave') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.leaveTurn + * @desc Leave a turn-based match during the current player's turn, without + * canceling the match. + * @alias games.turnBasedMatches.leaveTurn + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {integer} params.matchVersion The version of the match being updated. + * @param {string=} params.pendingParticipantId The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + leaveTurn(params?: any, options?: MethodOptions): + AxiosPromise; + leaveTurn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + leaveTurn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/leaveTurn') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId', 'matchVersion'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.list + * @desc Returns turn-based matches the player is or was involved in. + * @alias games.turnBasedMatches.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.includeMatchData True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxCompletedMatches The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. + * @param {integer=} params.maxResults The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.rematch + * @desc Create a rematch of a match that was previously completed, with the + * same participants. This can be called by only one player on a match still + * in their list; the player must have called Finish first. Returns the + * newly created match; it will be the caller's turn. + * @alias games.turnBasedMatches.rematch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {string=} params.requestId A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rematch(params?: any, options?: MethodOptions): + AxiosPromise; + rematch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + rematch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/rematch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.sync + * @desc Returns turn-based matches the player is or was involved in that + * changed since the last sync call, with the least recent changes coming + * first. Matches that should be removed from the local cache will have a + * status of MATCH_DELETED. + * @alias games.turnBasedMatches.sync + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {boolean=} params.includeMatchData True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request. + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {integer=} params.maxCompletedMatches The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled. + * @param {integer=} params.maxResults The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sync(params?: any, options?: MethodOptions): + AxiosPromise; + sync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sync( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/sync') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * games.turnBasedMatches.takeTurn + * @desc Commit the results of a player turn. + * @alias games.turnBasedMatches.takeTurn + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language The preferred language to use for strings returned by this method. + * @param {string} params.matchId The ID of the match. + * @param {().TurnBasedMatchTurn} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + takeTurn(params?: any, options?: MethodOptions): + AxiosPromise; + takeTurn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + takeTurn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1/turnbasedmatches/{matchId}/turn') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matchId'], + pathParams: ['matchId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/gamesConfiguration/v1configuration.ts b/src/apis/gamesConfiguration/v1configuration.ts index 469ef9ecdbe..feaa30c3fdd 100644 --- a/src/apis/gamesConfiguration/v1configuration.ts +++ b/src/apis/gamesConfiguration/v1configuration.ts @@ -27,1135 +27,1142 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Game Services Publishing API - * - * The Publishing API for Google Play Game Services. - * - * @example - * const google = require('googleapis'); - * const gamesConfiguration = google.gamesConfiguration('v1configuration'); - * - * @namespace gamesConfiguration - * @type {Function} - * @version v1configuration - * @variation v1configuration - * @param {object=} options Options for Gamesconfiguration - */ -export class Gamesconfiguration { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace gamesConfiguration_v1configuration { + /** + * Google Play Game Services Publishing API + * + * The Publishing API for Google Play Game Services. + * + * @example + * const google = require('googleapis'); + * const gamesConfiguration = google.gamesConfiguration('v1configuration'); + * + * @namespace gamesConfiguration + * @type {Function} + * @version v1configuration + * @variation v1configuration + * @param {object=} options Options for Gamesconfiguration + */ + export class Gamesconfiguration { + _options: GlobalOptions; + google: GoogleApis; + root = this; - achievementConfigurations: Resource$Achievementconfigurations; - imageConfigurations: Resource$Imageconfigurations; - leaderboardConfigurations: Resource$Leaderboardconfigurations; + achievementConfigurations: Resource$Achievementconfigurations; + imageConfigurations: Resource$Imageconfigurations; + leaderboardConfigurations: Resource$Leaderboardconfigurations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.achievementConfigurations = - new Resource$Achievementconfigurations(this); - this.imageConfigurations = new Resource$Imageconfigurations(this); - this.leaderboardConfigurations = - new Resource$Leaderboardconfigurations(this); - } + this.achievementConfigurations = + new Resource$Achievementconfigurations(this); + this.imageConfigurations = new Resource$Imageconfigurations(this); + this.leaderboardConfigurations = + new Resource$Leaderboardconfigurations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * This is a JSON template for an achievement configuration resource. - */ -export interface Schema$AchievementConfiguration { - /** - * The type of the achievement. Possible values are: - "STANDARD" - * - Achievement is either locked or unlocked. - "INCREMENTAL" - - * Achievement is incremental. - */ - achievementType: string; - /** - * The draft data of the achievement. - */ - draft: Schema$AchievementConfigurationDetail; - /** - * The ID of the achievement. - */ - id: string; - /** - * The initial state of the achievement. Possible values are: - - * "HIDDEN" - Achievement is hidden. - "REVEALED" - - * Achievement is revealed. - "UNLOCKED" - Achievement is unlocked. - */ - initialState: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#achievementConfiguration. - */ - kind: string; - /** - * The read-only published data of the achievement. - */ - published: Schema$AchievementConfigurationDetail; - /** - * Steps to unlock. Only applicable to incremental achievements. - */ - stepsToUnlock: number; - /** - * The token for this resource. - */ - token: string; -} -/** - * This is a JSON template for an achievement configuration detail. - */ -export interface Schema$AchievementConfigurationDetail { - /** - * Localized strings for the achievement description. - */ - description: Schema$LocalizedStringBundle; - /** - * The icon url of this achievement. Writes to this field are ignored. - */ - iconUrl: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#achievementConfigurationDetail. - */ - kind: string; - /** - * Localized strings for the achievement name. - */ - name: Schema$LocalizedStringBundle; - /** - * Point value for the achievement. - */ - pointValue: number; - /** - * The sort rank of this achievement. Writes to this field are ignored. - */ - sortRank: number; -} -/** - * This is a JSON template for a ListConfigurations response. - */ -export interface Schema$AchievementConfigurationListResponse { - /** - * The achievement configurations. - */ - items: Schema$AchievementConfiguration[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#achievementConfigurationListResponse. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a number affix resource. - */ -export interface Schema$GamesNumberAffixConfiguration { - /** - * When the language requires special treatment of "small" numbers - * (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, 13, - * or 14 in Polish). - */ - few: Schema$LocalizedStringBundle; - /** - * When the language requires special treatment of "large" numbers - * (as with numbers ending 11-99 in Maltese). - */ - many: Schema$LocalizedStringBundle; - /** - * When the language requires special treatment of numbers like one (as with - * the number 1 in English and most other languages; in Russian, any number - * ending in 1 but not ending in 11 is in this class). - */ - one: Schema$LocalizedStringBundle; - /** - * When the language does not require special treatment of the given quantity - * (as with all numbers in Chinese, or 42 in English). - */ - other: Schema$LocalizedStringBundle; - /** - * When the language requires special treatment of numbers like two (as with 2 - * in Welsh, or 102 in Slovenian). - */ - two: Schema$LocalizedStringBundle; - /** - * When the language requires special treatment of the number 0 (as in - * Arabic). - */ - zero: Schema$LocalizedStringBundle; -} -/** - * This is a JSON template for a number format resource. - */ -export interface Schema$GamesNumberFormatConfiguration { - /** - * The curreny code string. Only used for CURRENCY format type. - */ - currencyCode: string; - /** - * The formatting for the number. Possible values are: - "NUMERIC" - * - Numbers are formatted to have no digits or a fixed number of digits after - * the decimal point according to locale. An optional custom unit can be - * added. - "TIME_DURATION" - Numbers are formatted to hours, - * minutes and seconds. - "CURRENCY" - Numbers are formatted to - * currency according to locale. - */ - numberFormatType: string; - /** - * The number of decimal places for number. Only used for NUMERIC format type. - */ - numDecimalPlaces: number; - /** - * An optional suffix for the NUMERIC format type. These strings follow the - * same plural rules as all Android string resources. - */ - suffix: Schema$GamesNumberAffixConfiguration; -} -/** - * This is a JSON template for an image configuration resource. - */ -export interface Schema$ImageConfiguration { - /** - * The image type for the image. - */ - imageType: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#imageConfiguration. - */ - kind: string; - /** - * The resource ID of resource which the image belongs to. - */ - resourceId: string; - /** - * The url for this image. - */ - url: string; -} -/** - * This is a JSON template for an leaderboard configuration resource. - */ -export interface Schema$LeaderboardConfiguration { - /** - * The draft data of the leaderboard. - */ - draft: Schema$LeaderboardConfigurationDetail; - /** - * The ID of the leaderboard. - */ - id: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#leaderboardConfiguration. - */ - kind: string; - /** - * The read-only published data of the leaderboard. - */ - published: Schema$LeaderboardConfigurationDetail; - /** - * Maximum score that can be posted to this leaderboard. - */ - scoreMax: string; - /** - * Minimum score that can be posted to this leaderboard. - */ - scoreMin: string; - /** - * The type of the leaderboard. Possible values are: - - * "LARGER_IS_BETTER" - Larger scores posted are ranked higher. - - * "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher. - */ - scoreOrder: string; - /** - * The token for this resource. - */ - token: string; -} -/** - * This is a JSON template for a leaderboard configuration detail. - */ -export interface Schema$LeaderboardConfigurationDetail { - /** - * The icon url of this leaderboard. Writes to this field are ignored. - */ - iconUrl: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#leaderboardConfigurationDetail. - */ - kind: string; - /** - * Localized strings for the leaderboard name. - */ - name: Schema$LocalizedStringBundle; /** - * The score formatting for the leaderboard. - */ - scoreFormat: Schema$GamesNumberFormatConfiguration; + * This is a JSON template for an achievement configuration resource. + */ + export interface Schema$AchievementConfiguration { + /** + * The type of the achievement. Possible values are: - + * "STANDARD" - Achievement is either locked or unlocked. - + * "INCREMENTAL" - Achievement is incremental. + */ + achievementType: string; + /** + * The draft data of the achievement. + */ + draft: Schema$AchievementConfigurationDetail; + /** + * The ID of the achievement. + */ + id: string; + /** + * The initial state of the achievement. Possible values are: - + * "HIDDEN" - Achievement is hidden. - "REVEALED" - + * Achievement is revealed. - "UNLOCKED" - Achievement is + * unlocked. + */ + initialState: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#achievementConfiguration. + */ + kind: string; + /** + * The read-only published data of the achievement. + */ + published: Schema$AchievementConfigurationDetail; + /** + * Steps to unlock. Only applicable to incremental achievements. + */ + stepsToUnlock: number; + /** + * The token for this resource. + */ + token: string; + } /** - * The sort rank of this leaderboard. Writes to this field are ignored. - */ - sortRank: number; -} -/** - * This is a JSON template for a ListConfigurations response. - */ -export interface Schema$LeaderboardConfigurationListResponse { + * This is a JSON template for an achievement configuration detail. + */ + export interface Schema$AchievementConfigurationDetail { + /** + * Localized strings for the achievement description. + */ + description: Schema$LocalizedStringBundle; + /** + * The icon url of this achievement. Writes to this field are ignored. + */ + iconUrl: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#achievementConfigurationDetail. + */ + kind: string; + /** + * Localized strings for the achievement name. + */ + name: Schema$LocalizedStringBundle; + /** + * Point value for the achievement. + */ + pointValue: number; + /** + * The sort rank of this achievement. Writes to this field are ignored. + */ + sortRank: number; + } /** - * The leaderboard configurations. - */ - items: Schema$LeaderboardConfiguration[]; + * This is a JSON template for a ListConfigurations response. + */ + export interface Schema$AchievementConfigurationListResponse { + /** + * The achievement configurations. + */ + items: Schema$AchievementConfiguration[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#achievementConfigurationListResponse. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string games#leaderboardConfigurationListResponse. - */ - kind: string; + * This is a JSON template for a number affix resource. + */ + export interface Schema$GamesNumberAffixConfiguration { + /** + * When the language requires special treatment of "small" numbers + * (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not 12, + * 13, or 14 in Polish). + */ + few: Schema$LocalizedStringBundle; + /** + * When the language requires special treatment of "large" numbers + * (as with numbers ending 11-99 in Maltese). + */ + many: Schema$LocalizedStringBundle; + /** + * When the language requires special treatment of numbers like one (as with + * the number 1 in English and most other languages; in Russian, any number + * ending in 1 but not ending in 11 is in this class). + */ + one: Schema$LocalizedStringBundle; + /** + * When the language does not require special treatment of the given + * quantity (as with all numbers in Chinese, or 42 in English). + */ + other: Schema$LocalizedStringBundle; + /** + * When the language requires special treatment of numbers like two (as with + * 2 in Welsh, or 102 in Slovenian). + */ + two: Schema$LocalizedStringBundle; + /** + * When the language requires special treatment of the number 0 (as in + * Arabic). + */ + zero: Schema$LocalizedStringBundle; + } /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a localized string resource. - */ -export interface Schema$LocalizedString { + * This is a JSON template for a number format resource. + */ + export interface Schema$GamesNumberFormatConfiguration { + /** + * The curreny code string. Only used for CURRENCY format type. + */ + currencyCode: string; + /** + * The formatting for the number. Possible values are: - + * "NUMERIC" - Numbers are formatted to have no digits or a fixed + * number of digits after the decimal point according to locale. An optional + * custom unit can be added. - "TIME_DURATION" - Numbers are + * formatted to hours, minutes and seconds. - "CURRENCY" - Numbers + * are formatted to currency according to locale. + */ + numberFormatType: string; + /** + * The number of decimal places for number. Only used for NUMERIC format + * type. + */ + numDecimalPlaces: number; + /** + * An optional suffix for the NUMERIC format type. These strings follow the + * same plural rules as all Android string resources. + */ + suffix: Schema$GamesNumberAffixConfiguration; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#localizedString. - */ - kind: string; + * This is a JSON template for an image configuration resource. + */ + export interface Schema$ImageConfiguration { + /** + * The image type for the image. + */ + imageType: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#imageConfiguration. + */ + kind: string; + /** + * The resource ID of resource which the image belongs to. + */ + resourceId: string; + /** + * The url for this image. + */ + url: string; + } /** - * The locale string. - */ - locale: string; + * This is a JSON template for an leaderboard configuration resource. + */ + export interface Schema$LeaderboardConfiguration { + /** + * The draft data of the leaderboard. + */ + draft: Schema$LeaderboardConfigurationDetail; + /** + * The ID of the leaderboard. + */ + id: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#leaderboardConfiguration. + */ + kind: string; + /** + * The read-only published data of the leaderboard. + */ + published: Schema$LeaderboardConfigurationDetail; + /** + * Maximum score that can be posted to this leaderboard. + */ + scoreMax: string; + /** + * Minimum score that can be posted to this leaderboard. + */ + scoreMin: string; + /** + * The type of the leaderboard. Possible values are: - + * "LARGER_IS_BETTER" - Larger scores posted are ranked higher. - + * "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher. + */ + scoreOrder: string; + /** + * The token for this resource. + */ + token: string; + } /** - * The string value. - */ - value: string; -} -/** - * This is a JSON template for a localized string bundle resource. - */ -export interface Schema$LocalizedStringBundle { + * This is a JSON template for a leaderboard configuration detail. + */ + export interface Schema$LeaderboardConfigurationDetail { + /** + * The icon url of this leaderboard. Writes to this field are ignored. + */ + iconUrl: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#leaderboardConfigurationDetail. + */ + kind: string; + /** + * Localized strings for the leaderboard name. + */ + name: Schema$LocalizedStringBundle; + /** + * The score formatting for the leaderboard. + */ + scoreFormat: Schema$GamesNumberFormatConfiguration; + /** + * The sort rank of this leaderboard. Writes to this field are ignored. + */ + sortRank: number; + } /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesConfiguration#localizedStringBundle. - */ - kind: string; + * This is a JSON template for a ListConfigurations response. + */ + export interface Schema$LeaderboardConfigurationListResponse { + /** + * The leaderboard configurations. + */ + items: Schema$LeaderboardConfiguration[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string games#leaderboardConfigurationListResponse. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; + } /** - * The locale strings. - */ - translations: Schema$LocalizedString[]; -} - -export class Resource$Achievementconfigurations { - root: Gamesconfiguration; - constructor(root: Gamesconfiguration) { - this.root = root; - this.getRoot.bind(this); + * This is a JSON template for a localized string resource. + */ + export interface Schema$LocalizedString { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#localizedString. + */ + kind: string; + /** + * The locale string. + */ + locale: string; + /** + * The string value. + */ + value: string; } - - getRoot() { - return this.root; + /** + * This is a JSON template for a localized string bundle resource. + */ + export interface Schema$LocalizedStringBundle { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesConfiguration#localizedStringBundle. + */ + kind: string; + /** + * The locale strings. + */ + translations: Schema$LocalizedString[]; } - - /** - * gamesConfiguration.achievementConfigurations.delete - * @desc Delete the achievement configuration with the given ID. - * @alias gamesConfiguration.achievementConfigurations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Achievementconfigurations { + root: Gamesconfiguration; + constructor(root: Gamesconfiguration) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/achievements/{achievementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * gamesConfiguration.achievementConfigurations.get - * @desc Retrieves the metadata of the achievement configuration with the - * given ID. - * @alias gamesConfiguration.achievementConfigurations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * gamesConfiguration.achievementConfigurations.delete + * @desc Delete the achievement configuration with the given ID. + * @alias gamesConfiguration.achievementConfigurations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/achievements/{achievementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/achievements/{achievementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * gamesConfiguration.achievementConfigurations.insert - * @desc Insert a new achievement configuration in this application. - * @alias gamesConfiguration.achievementConfigurations.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {().AchievementConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * gamesConfiguration.achievementConfigurations.get + * @desc Retrieves the metadata of the achievement configuration with the + * given ID. + * @alias gamesConfiguration.achievementConfigurations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/achievements/{achievementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1configuration/applications/{applicationId}/achievements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * gamesConfiguration.achievementConfigurations.list - * @desc Returns a list of the achievement configurations in this application. - * @alias gamesConfiguration.achievementConfigurations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {integer=} params.maxResults The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * gamesConfiguration.achievementConfigurations.insert + * @desc Insert a new achievement configuration in this application. + * @alias gamesConfiguration.achievementConfigurations.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {().AchievementConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1configuration/applications/{applicationId}/achievements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1configuration/applications/{applicationId}/achievements') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * gamesConfiguration.achievementConfigurations.patch - * @desc Update the metadata of the achievement configuration with the given - * ID. This method supports patch semantics. - * @alias gamesConfiguration.achievementConfigurations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {().AchievementConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * gamesConfiguration.achievementConfigurations.list + * @desc Returns a list of the achievement configurations in this + * application. + * @alias gamesConfiguration.achievementConfigurations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {integer=} params.maxResults The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1configuration/applications/{applicationId}/achievements') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/achievements/{achievementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * gamesConfiguration.achievementConfigurations.update - * @desc Update the metadata of the achievement configuration with the given - * ID. - * @alias gamesConfiguration.achievementConfigurations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {().AchievementConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/achievements/{achievementId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * gamesConfiguration.achievementConfigurations.patch + * @desc Update the metadata of the achievement configuration with the given + * ID. This method supports patch semantics. + * @alias gamesConfiguration.achievementConfigurations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {().AchievementConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/achievements/{achievementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Imageconfigurations { - root: Gamesconfiguration; - constructor(root: Gamesconfiguration) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * gamesConfiguration.achievementConfigurations.update + * @desc Update the metadata of the achievement configuration with the given + * ID. + * @alias gamesConfiguration.achievementConfigurations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {().AchievementConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/achievements/{achievementId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * gamesConfiguration.imageConfigurations.upload - * @desc Uploads an image for a resource with the given ID and image type. - * @alias gamesConfiguration.imageConfigurations.upload - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.imageType Selects which image in a resource for this method. - * @param {string} params.resourceId The ID of the resource used by this method. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - upload(params?: any, options?: MethodOptions): - AxiosPromise; - upload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - upload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Imageconfigurations { + root: Gamesconfiguration; + constructor(root: Gamesconfiguration) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1configuration/images/{resourceId}/imageType/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + - '/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['resourceId', 'imageType'], - pathParams: ['imageType', 'resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Leaderboardconfigurations { - root: Gamesconfiguration; - constructor(root: Gamesconfiguration) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * gamesConfiguration.imageConfigurations.upload + * @desc Uploads an image for a resource with the given ID and image type. + * @alias gamesConfiguration.imageConfigurations.upload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.imageType Selects which image in a resource for this method. + * @param {string} params.resourceId The ID of the resource used by this method. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + upload(params?: any, options?: MethodOptions): + AxiosPromise; + upload( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + upload( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1configuration/images/{resourceId}/imageType/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + + '/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['resourceId', 'imageType'], + pathParams: ['imageType', 'resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * gamesConfiguration.leaderboardConfigurations.delete - * @desc Delete the leaderboard configuration with the given ID. - * @alias gamesConfiguration.leaderboardConfigurations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Leaderboardconfigurations { + root: Gamesconfiguration; + constructor(root: Gamesconfiguration) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/leaderboards/{leaderboardId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * gamesConfiguration.leaderboardConfigurations.get - * @desc Retrieves the metadata of the leaderboard configuration with the - * given ID. - * @alias gamesConfiguration.leaderboardConfigurations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/leaderboards/{leaderboardId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * gamesConfiguration.leaderboardConfigurations.delete + * @desc Delete the leaderboard configuration with the given ID. + * @alias gamesConfiguration.leaderboardConfigurations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/leaderboards/{leaderboardId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * gamesConfiguration.leaderboardConfigurations.insert - * @desc Insert a new leaderboard configuration in this application. - * @alias gamesConfiguration.leaderboardConfigurations.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {().LeaderboardConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * gamesConfiguration.leaderboardConfigurations.get + * @desc Retrieves the metadata of the leaderboard configuration with the + * given ID. + * @alias gamesConfiguration.leaderboardConfigurations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/leaderboards/{leaderboardId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1configuration/applications/{applicationId}/leaderboards') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * gamesConfiguration.leaderboardConfigurations.list - * @desc Returns a list of the leaderboard configurations in this application. - * @alias gamesConfiguration.leaderboardConfigurations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {integer=} params.maxResults The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * gamesConfiguration.leaderboardConfigurations.insert + * @desc Insert a new leaderboard configuration in this application. + * @alias gamesConfiguration.leaderboardConfigurations.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {().LeaderboardConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1configuration/applications/{applicationId}/leaderboards') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1configuration/applications/{applicationId}/leaderboards') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * gamesConfiguration.leaderboardConfigurations.patch - * @desc Update the metadata of the leaderboard configuration with the given - * ID. This method supports patch semantics. - * @alias gamesConfiguration.leaderboardConfigurations.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {().LeaderboardConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/leaderboards/{leaderboardId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * gamesConfiguration.leaderboardConfigurations.list + * @desc Returns a list of the leaderboard configurations in this + * application. + * @alias gamesConfiguration.leaderboardConfigurations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {integer=} params.maxResults The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1configuration/applications/{applicationId}/leaderboards') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * gamesConfiguration.leaderboardConfigurations.update - * @desc Update the metadata of the leaderboard configuration with the given - * ID. - * @alias gamesConfiguration.leaderboardConfigurations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {().LeaderboardConfiguration} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * gamesConfiguration.leaderboardConfigurations.patch + * @desc Update the metadata of the leaderboard configuration with the given + * ID. This method supports patch semantics. + * @alias gamesConfiguration.leaderboardConfigurations.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {().LeaderboardConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/leaderboards/{leaderboardId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1configuration/leaderboards/{leaderboardId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * gamesConfiguration.leaderboardConfigurations.update + * @desc Update the metadata of the leaderboard configuration with the given + * ID. + * @alias gamesConfiguration.leaderboardConfigurations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {().LeaderboardConfiguration} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1configuration/leaderboards/{leaderboardId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/gamesManagement/v1management.ts b/src/apis/gamesManagement/v1management.ts index c0221586029..eab4cc85057 100644 --- a/src/apis/gamesManagement/v1management.ts +++ b/src/apis/gamesManagement/v1management.ts @@ -27,1900 +27,1916 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Game Services Management API - * - * The Management API for Google Play Game Services. - * - * @example - * const google = require('googleapis'); - * const gamesManagement = google.gamesManagement('v1management'); - * - * @namespace gamesManagement - * @type {Function} - * @version v1management - * @variation v1management - * @param {object=} options Options for Gamesmanagement - */ -export class Gamesmanagement { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - achievements: Resource$Achievements; - applications: Resource$Applications; - events: Resource$Events; - players: Resource$Players; - quests: Resource$Quests; - rooms: Resource$Rooms; - scores: Resource$Scores; - turnBasedMatches: Resource$Turnbasedmatches; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.achievements = new Resource$Achievements(this); - this.applications = new Resource$Applications(this); - this.events = new Resource$Events(this); - this.players = new Resource$Players(this); - this.quests = new Resource$Quests(this); - this.rooms = new Resource$Rooms(this); - this.scores = new Resource$Scores(this); - this.turnBasedMatches = new Resource$Turnbasedmatches(this); - } - - getRoot() { - return this.root; - } -} - -/** - * This is a JSON template for achievement reset all response. - */ -export interface Schema$AchievementResetAllResponse { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#achievementResetAllResponse. - */ - kind: string; - /** - * The achievement reset results. - */ - results: Schema$AchievementResetResponse[]; -} -/** - * This is a JSON template for multiple achievements reset all request. - */ -export interface Schema$AchievementResetMultipleForAllRequest { - /** - * The IDs of achievements to reset. - */ - achievement_ids: string[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#achievementResetMultipleForAllRequest. - */ - kind: string; -} -/** - * This is a JSON template for an achievement reset response. - */ -export interface Schema$AchievementResetResponse { - /** - * The current state of the achievement. This is the same as the initial state - * of the achievement. Possible values are: - "HIDDEN"- - * Achievement is hidden. - "REVEALED" - Achievement is revealed. - * - "UNLOCKED" - Achievement is unlocked. - */ - currentState: string; - /** - * The ID of an achievement for which player state has been updated. - */ - definitionId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#achievementResetResponse. - */ - kind: string; - /** - * Flag to indicate if the requested update actually occurred. - */ - updateOccurred: boolean; -} -/** - * This is a JSON template for multiple events reset all request. - */ -export interface Schema$EventsResetMultipleForAllRequest { - /** - * The IDs of events to reset. - */ - event_ids: string[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#eventsResetMultipleForAllRequest. - */ - kind: string; -} -/** - * This is a JSON template for metadata about a player playing a game with the - * currently authenticated user. - */ -export interface Schema$GamesPlayedResource { - /** - * True if the player was auto-matched with the currently authenticated user. - */ - autoMatched: boolean; - /** - * The last time the player played the game in milliseconds since the epoch in - * UTC. - */ - timeMillis: string; -} -/** - * This is a JSON template for 1P/3P metadata about the player's experience. - */ -export interface Schema$GamesPlayerExperienceInfoResource { - /** - * The current number of experience points for the player. - */ - currentExperiencePoints: string; - /** - * The current level of the player. - */ - currentLevel: Schema$GamesPlayerLevelResource; - /** - * The timestamp when the player was leveled up, in millis since Unix epoch - * UTC. - */ - lastLevelUpTimestampMillis: string; - /** - * The next level of the player. If the current level is the maximum level, - * this should be same as the current level. - */ - nextLevel: Schema$GamesPlayerLevelResource; -} -/** - * This is a JSON template for 1P/3P metadata about a user's level. - */ -export interface Schema$GamesPlayerLevelResource { - /** - * The level for the user. - */ - level: number; - /** - * The maximum experience points for this level. - */ - maxExperiencePoints: string; - /** - * The minimum experience points for this level. - */ - minExperiencePoints: string; -} -/** - * This is a JSON template for the HiddenPlayer resource. - */ -export interface Schema$HiddenPlayer { - /** - * The time this player was hidden. - */ - hiddenTimeMillis: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#hiddenPlayer. - */ - kind: string; - /** - * The player information. - */ - player: Schema$Player; -} -/** - * This is a JSON template for a list of hidden players. - */ -export interface Schema$HiddenPlayerList { - /** - * The players. - */ - items: Schema$HiddenPlayer[]; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#hiddenPlayerList. - */ - kind: string; - /** - * The pagination token for the next page of results. - */ - nextPageToken: string; -} -/** - * This is a JSON template for a Player resource. - */ -export interface Schema$Player { - /** - * The base URL for the image that represents the player. - */ - avatarImageUrl: string; - /** - * The url to the landscape mode player banner image. - */ - bannerUrlLandscape: string; +export namespace gamesManagement_v1management { /** - * The url to the portrait mode player banner image. - */ - bannerUrlPortrait: string; - /** - * The name to display for the player. - */ - displayName: string; - /** - * An object to represent Play Game experience information for the player. - */ - experienceInfo: Schema$GamesPlayerExperienceInfoResource; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#player. - */ - kind: string; - /** - * Details about the last time this player played a multiplayer game with the - * currently authenticated player. Populated for PLAYED_WITH player collection - * members. - */ - lastPlayedWith: Schema$GamesPlayedResource; - /** - * An object representation of the individual components of the player's - * name. For some players, these fields may not be present. - */ - name: any; - /** - * The player ID that was used for this player the first time they signed into - * the game in question. This is only populated for calls to player.get for - * the requesting player, only if the player ID has subsequently changed, and - * only to clients that support remapping player IDs. - */ - originalPlayerId: string; - /** - * The ID of the player. - */ - playerId: string; - /** - * The player's profile settings. Controls whether or not the player's - * profile is visible to other players. - */ - profileSettings: Schema$ProfileSettings; - /** - * The player's title rewarded for their game activities. - */ - title: string; -} -/** - * This is a JSON template for a list of leaderboard reset resources. - */ -export interface Schema$PlayerScoreResetAllResponse { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#playerScoreResetResponse. - */ - kind: string; - /** - * The leaderboard reset results. - */ - results: Schema$PlayerScoreResetResponse[]; -} -/** - * This is a JSON template for a list of reset leaderboard entry resources. - */ -export interface Schema$PlayerScoreResetResponse { - /** - * The ID of an leaderboard for which player state has been updated. - */ - definitionId: string; - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#playerScoreResetResponse. - */ - kind: string; - /** - * The time spans of the updated score. Possible values are: - - * "ALL_TIME" - The score is an all-time score. - - * "WEEKLY" - The score is a weekly score. - "DAILY" - - * The score is a daily score. - */ - resetScoreTimeSpans: string[]; -} -/** - * This is a JSON template for profile settings - */ -export interface Schema$ProfileSettings { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#profileSettings. - */ - kind: string; - /** - * The player's current profile visibility. This field is visible to both - * 1P and 3P APIs. - */ - profileVisible: boolean; -} -/** - * This is a JSON template for multiple quests reset all request. - */ -export interface Schema$QuestsResetMultipleForAllRequest { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#questsResetMultipleForAllRequest. - */ - kind: string; - /** - * The IDs of quests to reset. - */ - quest_ids: string[]; -} -/** - * This is a JSON template for multiple scores reset all request. - */ -export interface Schema$ScoresResetMultipleForAllRequest { - /** - * Uniquely identifies the type of this resource. Value is always the fixed - * string gamesManagement#scoresResetMultipleForAllRequest. - */ - kind: string; - /** - * The IDs of leaderboards to reset. - */ - leaderboard_ids: string[]; -} - -export class Resource$Achievements { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * gamesManagement.achievements.reset - * @desc Resets the achievement with the given ID for the currently - * authenticated player. This method is only accessible to whitelisted tester - * accounts for your application. - * @alias gamesManagement.achievements.reset - * @memberOf! () + * Google Play Game Services Management API * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): - AxiosPromise; - reset( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/achievements/{achievementId}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gamesManagement.achievements.resetAll - * @desc Resets all achievements for the currently authenticated player for - * your application. This method is only accessible to whitelisted tester - * accounts for your application. - * @alias gamesManagement.achievements.resetAll - * @memberOf! () + * The Management API for Google Play Game Services. * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAll(params?: any, options?: MethodOptions): - AxiosPromise; - resetAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - resetAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/achievements/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gamesManagement.achievements.resetAllForAllPlayers - * @desc Resets all draft achievements for all players. This method is only - * available to user accounts for your developer console. - * @alias gamesManagement.achievements.resetAllForAllPlayers - * @memberOf! () + * @example + * const google = require('googleapis'); + * const gamesManagement = google.gamesManagement('v1management'); * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAllForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/achievements/resetAllForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace gamesManagement + * @type {Function} + * @version v1management + * @variation v1management + * @param {object=} options Options for Gamesmanagement + */ + export class Gamesmanagement { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + achievements: Resource$Achievements; + applications: Resource$Applications; + events: Resource$Events; + players: Resource$Players; + quests: Resource$Quests; + rooms: Resource$Rooms; + scores: Resource$Scores; + turnBasedMatches: Resource$Turnbasedmatches; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.achievements = new Resource$Achievements(this); + this.applications = new Resource$Applications(this); + this.events = new Resource$Events(this); + this.players = new Resource$Players(this); + this.quests = new Resource$Quests(this); + this.rooms = new Resource$Rooms(this); + this.scores = new Resource$Scores(this); + this.turnBasedMatches = new Resource$Turnbasedmatches(this); + } + + getRoot() { + return this.root; } } - /** - * gamesManagement.achievements.resetForAllPlayers - * @desc Resets the achievement with the given ID for all players. This method - * is only available to user accounts for your developer console. Only draft - * achievements can be reset. - * @alias gamesManagement.achievements.resetForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.achievementId The ID of the achievement used by this method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * This is a JSON template for achievement reset all response. */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/achievements/{achievementId}/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['achievementId'], - pathParams: ['achievementId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AchievementResetAllResponse { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#achievementResetAllResponse. + */ + kind: string; + /** + * The achievement reset results. + */ + results: Schema$AchievementResetResponse[]; } - - /** - * gamesManagement.achievements.resetMultipleForAllPlayers - * @desc Resets achievements with the given IDs for all players. This method - * is only available to user accounts for your developer console. Only draft - * achievements may be reset. - * @alias gamesManagement.achievements.resetMultipleForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AchievementResetMultipleForAllRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetMultipleForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/achievements/resetMultipleForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Applications { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * This is a JSON template for multiple achievements reset all request. + */ + export interface Schema$AchievementResetMultipleForAllRequest { + /** + * The IDs of achievements to reset. + */ + achievement_ids: string[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#achievementResetMultipleForAllRequest. + */ + kind: string; } - - /** - * gamesManagement.applications.listHidden - * @desc Get the list of players hidden from the given application. This - * method is only available to user accounts for your developer console. - * @alias gamesManagement.applications.listHidden - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {integer=} params.maxResults The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listHidden(params?: any, options?: MethodOptions): - AxiosPromise; - listHidden( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listHidden( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/applications/{applicationId}/players/hidden') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['applicationId'], - pathParams: ['applicationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Events { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * This is a JSON template for an achievement reset response. + */ + export interface Schema$AchievementResetResponse { + /** + * The current state of the achievement. This is the same as the initial + * state of the achievement. Possible values are: - "HIDDEN"- + * Achievement is hidden. - "REVEALED" - Achievement is revealed. + * - "UNLOCKED" - Achievement is unlocked. + */ + currentState: string; + /** + * The ID of an achievement for which player state has been updated. + */ + definitionId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#achievementResetResponse. + */ + kind: string; + /** + * Flag to indicate if the requested update actually occurred. + */ + updateOccurred: boolean; } - - /** - * gamesManagement.events.reset - * @desc Resets all player progress on the event with the given ID for the - * currently authenticated player. This method is only accessible to - * whitelisted tester accounts for your application. All quests for this - * player that use the event will also be reset. - * @alias gamesManagement.events.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.eventId The ID of the event. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/events/{eventId}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['eventId'], - pathParams: ['eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for multiple events reset all request. + */ + export interface Schema$EventsResetMultipleForAllRequest { + /** + * The IDs of events to reset. + */ + event_ids: string[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#eventsResetMultipleForAllRequest. + */ + kind: string; } - - /** - * gamesManagement.events.resetAll - * @desc Resets all player progress on all events for the currently - * authenticated player. This method is only accessible to whitelisted tester - * accounts for your application. All quests for this player will also be - * reset. - * @alias gamesManagement.events.resetAll - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAll(params?: any, options?: MethodOptions): AxiosPromise; - resetAll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/events/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for metadata about a player playing a game with the + * currently authenticated user. + */ + export interface Schema$GamesPlayedResource { + /** + * True if the player was auto-matched with the currently authenticated + * user. + */ + autoMatched: boolean; + /** + * The last time the player played the game in milliseconds since the epoch + * in UTC. + */ + timeMillis: string; } - - /** - * gamesManagement.events.resetAllForAllPlayers - * @desc Resets all draft events for all players. This method is only - * available to user accounts for your developer console. All quests that use - * any of these events will also be reset. - * @alias gamesManagement.events.resetAllForAllPlayers - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAllForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/events/resetAllForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for 1P/3P metadata about the player's + * experience. + */ + export interface Schema$GamesPlayerExperienceInfoResource { + /** + * The current number of experience points for the player. + */ + currentExperiencePoints: string; + /** + * The current level of the player. + */ + currentLevel: Schema$GamesPlayerLevelResource; + /** + * The timestamp when the player was leveled up, in millis since Unix epoch + * UTC. + */ + lastLevelUpTimestampMillis: string; + /** + * The next level of the player. If the current level is the maximum level, + * this should be same as the current level. + */ + nextLevel: Schema$GamesPlayerLevelResource; } - - /** - * gamesManagement.events.resetForAllPlayers - * @desc Resets the event with the given ID for all players. This method is - * only available to user accounts for your developer console. Only draft - * events can be reset. All quests that use the event will also be reset. - * @alias gamesManagement.events.resetForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.eventId The ID of the event. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/events/{eventId}/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['eventId'], - pathParams: ['eventId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for 1P/3P metadata about a user's level. + */ + export interface Schema$GamesPlayerLevelResource { + /** + * The level for the user. + */ + level: number; + /** + * The maximum experience points for this level. + */ + maxExperiencePoints: string; + /** + * The minimum experience points for this level. + */ + minExperiencePoints: string; } - - /** - * gamesManagement.events.resetMultipleForAllPlayers - * @desc Resets events with the given IDs for all players. This method is only - * available to user accounts for your developer console. Only draft events - * may be reset. All quests that use any of the events will also be reset. - * @alias gamesManagement.events.resetMultipleForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().EventsResetMultipleForAllRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetMultipleForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/events/resetMultipleForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Players { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * This is a JSON template for the HiddenPlayer resource. + */ + export interface Schema$HiddenPlayer { + /** + * The time this player was hidden. + */ + hiddenTimeMillis: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#hiddenPlayer. + */ + kind: string; + /** + * The player information. + */ + player: Schema$Player; } - - /** - * gamesManagement.players.hide - * @desc Hide the given player's leaderboard scores from the given - * application. This method is only available to user accounts for your - * developer console. - * @alias gamesManagement.players.hide - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - hide(params?: any, options?: MethodOptions): AxiosPromise; - hide( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - hide( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/applications/{applicationId}/players/hidden/{playerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['applicationId', 'playerId'], - pathParams: ['applicationId', 'playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of hidden players. + */ + export interface Schema$HiddenPlayerList { + /** + * The players. + */ + items: Schema$HiddenPlayer[]; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#hiddenPlayerList. + */ + kind: string; + /** + * The pagination token for the next page of results. + */ + nextPageToken: string; } - - /** - * gamesManagement.players.unhide - * @desc Unhide the given player's leaderboard scores from the given - * application. This method is only available to user accounts for your - * developer console. - * @alias gamesManagement.players.unhide - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.applicationId The application ID from the Google Play developer console. - * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unhide(params?: any, options?: MethodOptions): AxiosPromise; - unhide( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unhide( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/applications/{applicationId}/players/hidden/{playerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['applicationId', 'playerId'], - pathParams: ['applicationId', 'playerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Quests { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); + * This is a JSON template for a Player resource. + */ + export interface Schema$Player { + /** + * The base URL for the image that represents the player. + */ + avatarImageUrl: string; + /** + * The url to the landscape mode player banner image. + */ + bannerUrlLandscape: string; + /** + * The url to the portrait mode player banner image. + */ + bannerUrlPortrait: string; + /** + * The name to display for the player. + */ + displayName: string; + /** + * An object to represent Play Game experience information for the player. + */ + experienceInfo: Schema$GamesPlayerExperienceInfoResource; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#player. + */ + kind: string; + /** + * Details about the last time this player played a multiplayer game with + * the currently authenticated player. Populated for PLAYED_WITH player + * collection members. + */ + lastPlayedWith: Schema$GamesPlayedResource; + /** + * An object representation of the individual components of the player's + * name. For some players, these fields may not be present. + */ + name: any; + /** + * The player ID that was used for this player the first time they signed + * into the game in question. This is only populated for calls to player.get + * for the requesting player, only if the player ID has subsequently + * changed, and only to clients that support remapping player IDs. + */ + originalPlayerId: string; + /** + * The ID of the player. + */ + playerId: string; + /** + * The player's profile settings. Controls whether or not the + * player's profile is visible to other players. + */ + profileSettings: Schema$ProfileSettings; + /** + * The player's title rewarded for their game activities. + */ + title: string; } - - getRoot() { - return this.root; - } - - /** - * gamesManagement.quests.reset - * @desc Resets all player progress on the quest with the given ID for the - * currently authenticated player. This method is only accessible to - * whitelisted tester accounts for your application. - * @alias gamesManagement.quests.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.questId The ID of the quest. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/quests/{questId}/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['questId'], - pathParams: ['questId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of leaderboard reset resources. + */ + export interface Schema$PlayerScoreResetAllResponse { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#playerScoreResetResponse. + */ + kind: string; + /** + * The leaderboard reset results. + */ + results: Schema$PlayerScoreResetResponse[]; } - - /** - * gamesManagement.quests.resetAll - * @desc Resets all player progress on all quests for the currently - * authenticated player. This method is only accessible to whitelisted tester - * accounts for your application. - * @alias gamesManagement.quests.resetAll - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAll(params?: any, options?: MethodOptions): AxiosPromise; - resetAll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAll( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/quests/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for a list of reset leaderboard entry resources. + */ + export interface Schema$PlayerScoreResetResponse { + /** + * The ID of an leaderboard for which player state has been updated. + */ + definitionId: string; + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#playerScoreResetResponse. + */ + kind: string; + /** + * The time spans of the updated score. Possible values are: - + * "ALL_TIME" - The score is an all-time score. - + * "WEEKLY" - The score is a weekly score. - "DAILY" - + * The score is a daily score. + */ + resetScoreTimeSpans: string[]; } - - /** - * gamesManagement.quests.resetAllForAllPlayers - * @desc Resets all draft quests for all players. This method is only - * available to user accounts for your developer console. - * @alias gamesManagement.quests.resetAllForAllPlayers - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAllForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/quests/resetAllForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for profile settings + */ + export interface Schema$ProfileSettings { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#profileSettings. + */ + kind: string; + /** + * The player's current profile visibility. This field is visible to + * both 1P and 3P APIs. + */ + profileVisible: boolean; } - - /** - * gamesManagement.quests.resetForAllPlayers - * @desc Resets all player progress on the quest with the given ID for all - * players. This method is only available to user accounts for your developer - * console. Only draft quests can be reset. - * @alias gamesManagement.quests.resetForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.questId The ID of the quest. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/quests/{questId}/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['questId'], - pathParams: ['questId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gamesManagement.quests.resetMultipleForAllPlayers - * @desc Resets quests with the given IDs for all players. This method is only - * available to user accounts for your developer console. Only draft quests - * may be reset. - * @alias gamesManagement.quests.resetMultipleForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().QuestsResetMultipleForAllRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetMultipleForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/quests/resetMultipleForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Rooms { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * This is a JSON template for multiple quests reset all request. + */ + export interface Schema$QuestsResetMultipleForAllRequest { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#questsResetMultipleForAllRequest. + */ + kind: string; + /** + * The IDs of quests to reset. + */ + quest_ids: string[]; } - - /** - * gamesManagement.rooms.reset - * @desc Reset all rooms for the currently authenticated player for your - * application. This method is only accessible to whitelisted tester accounts - * for your application. - * @alias gamesManagement.rooms.reset - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/rooms/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This is a JSON template for multiple scores reset all request. + */ + export interface Schema$ScoresResetMultipleForAllRequest { + /** + * Uniquely identifies the type of this resource. Value is always the fixed + * string gamesManagement#scoresResetMultipleForAllRequest. + */ + kind: string; + /** + * The IDs of leaderboards to reset. + */ + leaderboard_ids: string[]; } - - /** - * gamesManagement.rooms.resetForAllPlayers - * @desc Deletes rooms where the only room participants are from whitelisted - * tester accounts for your application. This method is only available to user - * accounts for your developer console. - * @alias gamesManagement.rooms.resetForAllPlayers - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/rooms/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Achievements { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.achievements.reset + * @desc Resets the achievement with the given ID for the currently + * authenticated player. This method is only accessible to whitelisted + * tester accounts for your application. + * @alias gamesManagement.achievements.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/achievements/{achievementId}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.achievements.resetAll + * @desc Resets all achievements for the currently authenticated player for + * your application. This method is only accessible to whitelisted tester + * accounts for your application. + * @alias gamesManagement.achievements.resetAll + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAll(params?: any, options?: MethodOptions): + AxiosPromise; + resetAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + resetAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/achievements/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.achievements.resetAllForAllPlayers + * @desc Resets all draft achievements for all players. This method is only + * available to user accounts for your developer console. + * @alias gamesManagement.achievements.resetAllForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAllForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/achievements/resetAllForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.achievements.resetForAllPlayers + * @desc Resets the achievement with the given ID for all players. This + * method is only available to user accounts for your developer console. + * Only draft achievements can be reset. + * @alias gamesManagement.achievements.resetForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.achievementId The ID of the achievement used by this method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/achievements/{achievementId}/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['achievementId'], + pathParams: ['achievementId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.achievements.resetMultipleForAllPlayers + * @desc Resets achievements with the given IDs for all players. This method + * is only available to user accounts for your developer console. Only draft + * achievements may be reset. + * @alias gamesManagement.achievements.resetMultipleForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AchievementResetMultipleForAllRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetMultipleForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/achievements/resetMultipleForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Scores { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * gamesManagement.scores.reset - * @desc Resets scores for the leaderboard with the given ID for the currently - * authenticated player. This method is only accessible to whitelisted tester - * accounts for your application. - * @alias gamesManagement.scores.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): - AxiosPromise; - reset( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/leaderboards/{leaderboardId}/scores/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Applications { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.applications.listHidden + * @desc Get the list of players hidden from the given application. This + * method is only available to user accounts for your developer console. + * @alias gamesManagement.applications.listHidden + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {integer=} params.maxResults The maximum number of player resources to return in the response, used for paging. For any response, the actual number of player resources returned may be less than the specified maxResults. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listHidden(params?: any, options?: MethodOptions): + AxiosPromise; + listHidden( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listHidden( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/applications/{applicationId}/players/hidden') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['applicationId'], + pathParams: ['applicationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gamesManagement.scores.resetAll - * @desc Resets all scores for all leaderboards for the currently - * authenticated players. This method is only accessible to whitelisted tester - * accounts for your application. - * @alias gamesManagement.scores.resetAll - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAll(params?: any, options?: MethodOptions): - AxiosPromise; - resetAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - resetAll( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/scores/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Events { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.events.reset + * @desc Resets all player progress on the event with the given ID for the + * currently authenticated player. This method is only accessible to + * whitelisted tester accounts for your application. All quests for this + * player that use the event will also be reset. + * @alias gamesManagement.events.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.eventId The ID of the event. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): AxiosPromise; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/events/{eventId}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['eventId'], + pathParams: ['eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.events.resetAll + * @desc Resets all player progress on all events for the currently + * authenticated player. This method is only accessible to whitelisted + * tester accounts for your application. All quests for this player will + * also be reset. + * @alias gamesManagement.events.resetAll + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAll(params?: any, options?: MethodOptions): AxiosPromise; + resetAll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/events/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.events.resetAllForAllPlayers + * @desc Resets all draft events for all players. This method is only + * available to user accounts for your developer console. All quests that + * use any of these events will also be reset. + * @alias gamesManagement.events.resetAllForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAllForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/games/v1management/events/resetAllForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.events.resetForAllPlayers + * @desc Resets the event with the given ID for all players. This method is + * only available to user accounts for your developer console. Only draft + * events can be reset. All quests that use the event will also be reset. + * @alias gamesManagement.events.resetForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.eventId The ID of the event. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/events/{eventId}/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['eventId'], + pathParams: ['eventId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.events.resetMultipleForAllPlayers + * @desc Resets events with the given IDs for all players. This method is + * only available to user accounts for your developer console. Only draft + * events may be reset. All quests that use any of the events will also be + * reset. + * @alias gamesManagement.events.resetMultipleForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().EventsResetMultipleForAllRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetMultipleForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/events/resetMultipleForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gamesManagement.scores.resetAllForAllPlayers - * @desc Resets scores for all draft leaderboards for all players. This method - * is only available to user accounts for your developer console. - * @alias gamesManagement.scores.resetAllForAllPlayers - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetAllForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetAllForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/scores/resetAllForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Players { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.players.hide + * @desc Hide the given player's leaderboard scores from the given + * application. This method is only available to user accounts for your + * developer console. + * @alias gamesManagement.players.hide + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + hide(params?: any, options?: MethodOptions): AxiosPromise; + hide( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + hide( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/applications/{applicationId}/players/hidden/{playerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['applicationId', 'playerId'], + pathParams: ['applicationId', 'playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.players.unhide + * @desc Unhide the given player's leaderboard scores from the given + * application. This method is only available to user accounts for your + * developer console. + * @alias gamesManagement.players.unhide + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.applicationId The application ID from the Google Play developer console. + * @param {string} params.playerId A player ID. A value of me may be used in place of the authenticated player's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unhide(params?: any, options?: MethodOptions): AxiosPromise; + unhide( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unhide( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/applications/{applicationId}/players/hidden/{playerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['applicationId', 'playerId'], + pathParams: ['applicationId', 'playerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gamesManagement.scores.resetForAllPlayers - * @desc Resets scores for the leaderboard with the given ID for all players. - * This method is only available to user accounts for your developer console. - * Only draft leaderboards can be reset. - * @alias gamesManagement.scores.resetForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.leaderboardId The ID of the leaderboard. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['leaderboardId'], - pathParams: ['leaderboardId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Quests { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.quests.reset + * @desc Resets all player progress on the quest with the given ID for the + * currently authenticated player. This method is only accessible to + * whitelisted tester accounts for your application. + * @alias gamesManagement.quests.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.questId The ID of the quest. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): AxiosPromise; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/quests/{questId}/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['questId'], + pathParams: ['questId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.quests.resetAll + * @desc Resets all player progress on all quests for the currently + * authenticated player. This method is only accessible to whitelisted + * tester accounts for your application. + * @alias gamesManagement.quests.resetAll + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAll(params?: any, options?: MethodOptions): AxiosPromise; + resetAll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAll( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/quests/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.quests.resetAllForAllPlayers + * @desc Resets all draft quests for all players. This method is only + * available to user accounts for your developer console. + * @alias gamesManagement.quests.resetAllForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAllForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/games/v1management/quests/resetAllForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.quests.resetForAllPlayers + * @desc Resets all player progress on the quest with the given ID for all + * players. This method is only available to user accounts for your + * developer console. Only draft quests can be reset. + * @alias gamesManagement.quests.resetForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.questId The ID of the quest. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/quests/{questId}/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['questId'], + pathParams: ['questId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.quests.resetMultipleForAllPlayers + * @desc Resets quests with the given IDs for all players. This method is + * only available to user accounts for your developer console. Only draft + * quests may be reset. + * @alias gamesManagement.quests.resetMultipleForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().QuestsResetMultipleForAllRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetMultipleForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/quests/resetMultipleForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gamesManagement.scores.resetMultipleForAllPlayers - * @desc Resets scores for the leaderboards with the given IDs for all - * players. This method is only available to user accounts for your developer - * console. Only draft leaderboards may be reset. - * @alias gamesManagement.scores.resetMultipleForAllPlayers - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ScoresResetMultipleForAllRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetMultipleForAllPlayers(params?: any, options?: MethodOptions): - AxiosPromise; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetMultipleForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/scores/resetMultipleForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Rooms { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.rooms.reset + * @desc Reset all rooms for the currently authenticated player for your + * application. This method is only accessible to whitelisted tester + * accounts for your application. + * @alias gamesManagement.rooms.reset + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): AxiosPromise; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/rooms/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.rooms.resetForAllPlayers + * @desc Deletes rooms where the only room participants are from whitelisted + * tester accounts for your application. This method is only available to + * user accounts for your developer console. + * @alias gamesManagement.rooms.resetForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/rooms/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Turnbasedmatches { - root: Gamesmanagement; - constructor(root: Gamesmanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * gamesManagement.turnBasedMatches.reset - * @desc Reset all turn-based match data for a user. This method is only - * accessible to whitelisted tester accounts for your application. - * @alias gamesManagement.turnBasedMatches.reset - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/games/v1management/turnbasedmatches/reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Scores { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.scores.reset + * @desc Resets scores for the leaderboard with the given ID for the + * currently authenticated player. This method is only accessible to + * whitelisted tester accounts for your application. + * @alias gamesManagement.scores.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/leaderboards/{leaderboardId}/scores/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.scores.resetAll + * @desc Resets all scores for all leaderboards for the currently + * authenticated players. This method is only accessible to whitelisted + * tester accounts for your application. + * @alias gamesManagement.scores.resetAll + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAll(params?: any, options?: MethodOptions): + AxiosPromise; + resetAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + resetAll( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/scores/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.scores.resetAllForAllPlayers + * @desc Resets scores for all draft leaderboards for all players. This + * method is only available to user accounts for your developer console. + * @alias gamesManagement.scores.resetAllForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetAllForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetAllForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/games/v1management/scores/resetAllForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.scores.resetForAllPlayers + * @desc Resets scores for the leaderboard with the given ID for all + * players. This method is only available to user accounts for your + * developer console. Only draft leaderboards can be reset. + * @alias gamesManagement.scores.resetForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.leaderboardId The ID of the leaderboard. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['leaderboardId'], + pathParams: ['leaderboardId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.scores.resetMultipleForAllPlayers + * @desc Resets scores for the leaderboards with the given IDs for all + * players. This method is only available to user accounts for your + * developer console. Only draft leaderboards may be reset. + * @alias gamesManagement.scores.resetMultipleForAllPlayers + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ScoresResetMultipleForAllRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetMultipleForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetMultipleForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/scores/resetMultipleForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gamesManagement.turnBasedMatches.resetForAllPlayers - * @desc Deletes turn-based matches where the only match participants are from - * whitelisted tester accounts for your application. This method is only - * available to user accounts for your developer console. - * @alias gamesManagement.turnBasedMatches.resetForAllPlayers - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetForAllPlayers(params?: any, options?: MethodOptions): AxiosPromise; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetForAllPlayers( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/games/v1management/turnbasedmatches/resetForAllPlayers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Turnbasedmatches { + root: Gamesmanagement; + constructor(root: Gamesmanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gamesManagement.turnBasedMatches.reset + * @desc Reset all turn-based match data for a user. This method is only + * accessible to whitelisted tester accounts for your application. + * @alias gamesManagement.turnBasedMatches.reset + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): AxiosPromise; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/games/v1management/turnbasedmatches/reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gamesManagement.turnBasedMatches.resetForAllPlayers + * @desc Deletes turn-based matches where the only match participants are + * from whitelisted tester accounts for your application. This method is + * only available to user accounts for your developer console. + * @alias gamesManagement.turnBasedMatches.resetForAllPlayers + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetForAllPlayers(params?: any, options?: MethodOptions): + AxiosPromise; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetForAllPlayers( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/games/v1management/turnbasedmatches/resetForAllPlayers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/genomics/v1.ts b/src/apis/genomics/v1.ts index 79f0e4bfda0..80a9346d02d 100644 --- a/src/apis/genomics/v1.ts +++ b/src/apis/genomics/v1.ts @@ -27,7377 +27,5906 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Genomics API - * - * Upload, process, query, and search Genomics data in the cloud. - * - * @example - * const google = require('googleapis'); - * const genomics = google.genomics('v1'); - * - * @namespace genomics - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Genomics - */ -export class Genomics { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - annotations: Resource$Annotations; - annotationsets: Resource$Annotationsets; - callsets: Resource$Callsets; - datasets: Resource$Datasets; - operations: Resource$Operations; - readgroupsets: Resource$Readgroupsets; - reads: Resource$Reads; - references: Resource$References; - referencesets: Resource$Referencesets; - variants: Resource$Variants; - variantsets: Resource$Variantsets; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.annotations = new Resource$Annotations(this); - this.annotationsets = new Resource$Annotationsets(this); - this.callsets = new Resource$Callsets(this); - this.datasets = new Resource$Datasets(this); - this.operations = new Resource$Operations(this); - this.readgroupsets = new Resource$Readgroupsets(this); - this.reads = new Resource$Reads(this); - this.references = new Resource$References(this); - this.referencesets = new Resource$Referencesets(this); - this.variants = new Resource$Variants(this); - this.variantsets = new Resource$Variantsets(this); - } - - getRoot() { - return this.root; +export namespace genomics_v1 { + /** + * Genomics API + * + * Upload, process, query, and search Genomics data in the cloud. + * + * @example + * const google = require('googleapis'); + * const genomics = google.genomics('v1'); + * + * @namespace genomics + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Genomics + */ + export class Genomics { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + annotations: Resource$Annotations; + annotationsets: Resource$Annotationsets; + callsets: Resource$Callsets; + datasets: Resource$Datasets; + operations: Resource$Operations; + readgroupsets: Resource$Readgroupsets; + reads: Resource$Reads; + references: Resource$References; + referencesets: Resource$Referencesets; + variants: Resource$Variants; + variantsets: Resource$Variantsets; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.annotations = new Resource$Annotations(this); + this.annotationsets = new Resource$Annotationsets(this); + this.callsets = new Resource$Callsets(this); + this.datasets = new Resource$Datasets(this); + this.operations = new Resource$Operations(this); + this.readgroupsets = new Resource$Readgroupsets(this); + this.reads = new Resource$Reads(this); + this.references = new Resource$References(this); + this.referencesets = new Resource$Referencesets(this); + this.variants = new Resource$Variants(this); + this.variantsets = new Resource$Variantsets(this); + } + + getRoot() { + return this.root; + } } -} -/** - * An annotation describes a region of reference genome. The value of an - * annotation may be one of several canonical types, supplemented by arbitrary - * info tags. An annotation is not inherently associated with a specific sample - * or individual (though a client could choose to use annotations in this way). - * Example canonical annotation types are `GENE` and `VARIANT`. - */ -export interface Schema$Annotation { - /** - * The annotation set to which this annotation belongs. - */ - annotationSetId: string; - /** - * The end position of the range on the reference, 0-based exclusive. - */ - end: string; - /** - * The server-generated annotation ID, unique across all annotations. - */ - id: string; - /** - * A map of additional read alignment information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The display name of this annotation. - */ - name: string; - /** - * The ID of the Google Genomics reference associated with this range. - */ - referenceId: string; - /** - * The display name corresponding to the reference specified by `referenceId`, - * for example `chr1`, `1`, or `chrX`. - */ - referenceName: string; - /** - * Whether this range refers to the reverse strand, as opposed to the forward - * strand. Note that regardless of this field, the start/end position of the - * range always refer to the forward strand. - */ - reverseStrand: boolean; - /** - * The start position of the range on the reference, 0-based inclusive. - */ - start: string; - /** - * A transcript value represents the assertion that a particular region of the - * reference genome may be transcribed as RNA. An alternative splicing pattern - * would be represented as a separate transcript object. This field is only - * set for annotations of type `TRANSCRIPT`. - */ - transcript: Schema$Transcript; - /** - * The data type for this annotation. Must match the containing annotation - * set's type. - */ - type: string; - /** - * A variant annotation, which describes the effect of a variant on the - * genome, the coding sequence, and/or higher level consequences at the - * organism level e.g. pathogenicity. This field is only set for annotations - * of type `VARIANT`. - */ - variant: Schema$VariantAnnotation; -} -/** - * An annotation set is a logical grouping of annotations that share consistent - * type information and provenance. Examples of annotation sets include 'all - * genes from refseq', and 'all variant annotations from ClinVar'. - */ -export interface Schema$AnnotationSet { - /** - * The dataset to which this annotation set belongs. - */ - datasetId: string; - /** - * The server-generated annotation set ID, unique across all annotation sets. - */ - id: string; - /** - * A map of additional read alignment information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The display name for this annotation set. - */ - name: string; - /** - * The ID of the reference set that defines the coordinate space for this - * set's annotations. - */ - referenceSetId: string; - /** - * The source URI describing the file from which this annotation set was - * generated, if any. - */ - sourceUri: string; - /** - * The type of annotations contained within this set. - */ - type: string; -} -export interface Schema$BatchCreateAnnotationsRequest { - /** - * The annotations to be created. At most 4096 can be specified in a single - * request. - */ - annotations: Schema$Annotation[]; - /** - * A unique request ID which enables the server to detect duplicated requests. - * If provided, duplicated requests will result in the same response; if not - * provided, duplicated requests may result in duplicated data. For a given - * annotation set, callers should not reuse `request_id`s when writing - * different batches of annotations - behavior in this case is undefined. A - * common approach is to use a UUID. For batch jobs where worker crashes are a - * possibility, consider using some unique variant of a worker or run ID. - */ - requestId: string; -} -export interface Schema$BatchCreateAnnotationsResponse { - /** - * The resulting per-annotation entries, ordered consistently with the - * original request. - */ - entries: Schema$Entry[]; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A call set is a collection of variant calls, typically for one sample. It - * belongs to a variant set. - */ -export interface Schema$CallSet { - /** - * The date this call set was created in milliseconds from the epoch. - */ - created: string; - /** - * The server-generated call set ID, unique across all call sets. - */ - id: string; - /** - * A map of additional call set information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The call set name. - */ - name: string; - /** - * The sample ID this call set corresponds to. - */ - sampleId: string; /** - * The IDs of the variant sets this call set belongs to. This field must have - * exactly length one, as a call set belongs to a single variant set. This - * field is repeated for compatibility with the [GA4GH 0.5.1 - * API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76). - */ - variantSetIds: string[]; -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * A single CIGAR operation. - */ -export interface Schema$CigarUnit { - operation: string; + * An annotation describes a region of reference genome. The value of an + * annotation may be one of several canonical types, supplemented by arbitrary + * info tags. An annotation is not inherently associated with a specific + * sample or individual (though a client could choose to use annotations in + * this way). Example canonical annotation types are `GENE` and `VARIANT`. + */ + export interface Schema$Annotation { + /** + * The annotation set to which this annotation belongs. + */ + annotationSetId: string; + /** + * The end position of the range on the reference, 0-based exclusive. + */ + end: string; + /** + * The server-generated annotation ID, unique across all annotations. + */ + id: string; + /** + * A map of additional read alignment information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The display name of this annotation. + */ + name: string; + /** + * The ID of the Google Genomics reference associated with this range. + */ + referenceId: string; + /** + * The display name corresponding to the reference specified by + * `referenceId`, for example `chr1`, `1`, or `chrX`. + */ + referenceName: string; + /** + * Whether this range refers to the reverse strand, as opposed to the + * forward strand. Note that regardless of this field, the start/end + * position of the range always refer to the forward strand. + */ + reverseStrand: boolean; + /** + * The start position of the range on the reference, 0-based inclusive. + */ + start: string; + /** + * A transcript value represents the assertion that a particular region of + * the reference genome may be transcribed as RNA. An alternative splicing + * pattern would be represented as a separate transcript object. This field + * is only set for annotations of type `TRANSCRIPT`. + */ + transcript: Schema$Transcript; + /** + * The data type for this annotation. Must match the containing annotation + * set's type. + */ + type: string; + /** + * A variant annotation, which describes the effect of a variant on the + * genome, the coding sequence, and/or higher level consequences at the + * organism level e.g. pathogenicity. This field is only set for annotations + * of type `VARIANT`. + */ + variant: Schema$VariantAnnotation; + } /** - * The number of genomic bases that the operation runs for. Required. - */ - operationLength: string; + * An annotation set is a logical grouping of annotations that share + * consistent type information and provenance. Examples of annotation sets + * include 'all genes from refseq', and 'all variant annotations + * from ClinVar'. + */ + export interface Schema$AnnotationSet { + /** + * The dataset to which this annotation set belongs. + */ + datasetId: string; + /** + * The server-generated annotation set ID, unique across all annotation + * sets. + */ + id: string; + /** + * A map of additional read alignment information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The display name for this annotation set. + */ + name: string; + /** + * The ID of the reference set that defines the coordinate space for this + * set's annotations. + */ + referenceSetId: string; + /** + * The source URI describing the file from which this annotation set was + * generated, if any. + */ + sourceUri: string; + /** + * The type of annotations contained within this set. + */ + type: string; + } + export interface Schema$BatchCreateAnnotationsRequest { + /** + * The annotations to be created. At most 4096 can be specified in a single + * request. + */ + annotations: Schema$Annotation[]; + /** + * A unique request ID which enables the server to detect duplicated + * requests. If provided, duplicated requests will result in the same + * response; if not provided, duplicated requests may result in duplicated + * data. For a given annotation set, callers should not reuse `request_id`s + * when writing different batches of annotations - behavior in this case is + * undefined. A common approach is to use a UUID. For batch jobs where + * worker crashes are a possibility, consider using some unique variant of a + * worker or run ID. + */ + requestId: string; + } + export interface Schema$BatchCreateAnnotationsResponse { + /** + * The resulting per-annotation entries, ordered consistently with the + * original request. + */ + entries: Schema$Entry[]; + } /** - * `referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and - * deletions (`DELETE`). Filling this field replaces SAM's MD tag. If the - * relevant information is not available, this field is unset. - */ - referenceSequence: string; -} -export interface Schema$ClinicalCondition { + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * The MedGen concept id associated with this gene. Search for these IDs at - * http://www.ncbi.nlm.nih.gov/medgen/ - */ - conceptId: string; + * A call set is a collection of variant calls, typically for one sample. It + * belongs to a variant set. + */ + export interface Schema$CallSet { + /** + * The date this call set was created in milliseconds from the epoch. + */ + created: string; + /** + * The server-generated call set ID, unique across all call sets. + */ + id: string; + /** + * A map of additional call set information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The call set name. + */ + name: string; + /** + * The sample ID this call set corresponds to. + */ + sampleId: string; + /** + * The IDs of the variant sets this call set belongs to. This field must + * have exactly length one, as a call set belongs to a single variant set. + * This field is repeated for compatibility with the [GA4GH 0.5.1 + * API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76). + */ + variantSetIds: string[]; + } /** - * The set of external IDs for this condition. + * The request message for Operations.CancelOperation. */ - externalIds: Schema$ExternalId[]; + export interface Schema$CancelOperationRequest {} /** - * A set of names for the condition. + * A single CIGAR operation. */ - names: string[]; + export interface Schema$CigarUnit { + operation: string; + /** + * The number of genomic bases that the operation runs for. Required. + */ + operationLength: string; + /** + * `referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and + * deletions (`DELETE`). Filling this field replaces SAM's MD tag. If + * the relevant information is not available, this field is unset. + */ + referenceSequence: string; + } + export interface Schema$ClinicalCondition { + /** + * The MedGen concept id associated with this gene. Search for these IDs at + * http://www.ncbi.nlm.nih.gov/medgen/ + */ + conceptId: string; + /** + * The set of external IDs for this condition. + */ + externalIds: Schema$ExternalId[]; + /** + * A set of names for the condition. + */ + names: string[]; + /** + * The OMIM id for this condition. Search for these IDs at http://omim.org/ + */ + omimId: string; + } + export interface Schema$CodingSequence { + /** + * The end of the coding sequence on this annotation's reference + * sequence, 0-based exclusive. Note that this position is relative to the + * reference start, and *not* the containing annotation start. + */ + end: string; + /** + * The start of the coding sequence on this annotation's reference + * sequence, 0-based inclusive. Note that this position is relative to the + * reference start, and *not* the containing annotation start. + */ + start: string; + } /** - * The OMIM id for this condition. Search for these IDs at http://omim.org/ - */ - omimId: string; -} -export interface Schema$CodingSequence { + * Describes a Compute Engine resource that is being managed by a running + * pipeline. + */ + export interface Schema$ComputeEngine { + /** + * The names of the disks that were created for this pipeline. + */ + diskNames: string[]; + /** + * The instance on which the operation is running. + */ + instanceName: string; + /** + * The machine type of the instance. + */ + machineType: string; + /** + * The availability zone in which the instance resides. + */ + zone: string; + } /** - * The end of the coding sequence on this annotation's reference sequence, - * 0-based exclusive. Note that this position is relative to the reference - * start, and *not* the containing annotation start. - */ - end: string; + * This event is generated when a container starts. + */ + export interface Schema$ContainerStartedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The public IP address that can be used to connect to the container. This + * field is only populated when at least one port mapping is present. If + * the instance was created with a private address this field will be empty + * even if port mappings exist. + */ + ipAddress: string; + /** + * The container to host port mappings installed for this container. This + * set will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag + * as well as any specified in the Action definition. + */ + portMappings: any; + } /** - * The start of the coding sequence on this annotation's reference - * sequence, 0-based inclusive. Note that this position is relative to the - * reference start, and *not* the containing annotation start. - */ - start: string; -} -/** - * Describes a Compute Engine resource that is being managed by a running - * pipeline. - */ -export interface Schema$ComputeEngine { + * This event is generated when a container exits. + */ + export interface Schema$ContainerStoppedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * The names of the disks that were created for this pipeline. - */ - diskNames: string[]; + * A bucket over which read coverage has been precomputed. A bucket + * corresponds to a specific range of the reference sequence. + */ + export interface Schema$CoverageBucket { + /** + * The average number of reads which are aligned to each individual + * reference base in this bucket. + */ + meanCoverage: number; + /** + * The genomic coordinate range spanned by this bucket. + */ + range: Schema$Range; + } /** - * The instance on which the operation is running. - */ - instanceName: string; + * A Dataset is a collection of genomic data. + */ + export interface Schema$Dataset { + /** + * The time this dataset was created, in seconds from the epoch. + */ + createTime: string; + /** + * The server-generated dataset ID, unique across all datasets. + */ + id: string; + /** + * The dataset name. + */ + name: string; + /** + * The Google Cloud project ID that this dataset belongs to. + */ + projectId: string; + } /** - * The machine type of the instance. - */ - machineType: string; + * This event is generated whenever a resource limitation or transient error + * delays execution of a pipeline that was otherwise ready to run. + */ + export interface Schema$DelayedEvent { + /** + * A textual description of the cause of the delay. The string may change + * without notice since it is often generated by another service (such as + * Compute Engine). + */ + cause: string; + /** + * If the delay was caused by a resource shortage, this field lists the + * Compute Engine metrics that are preventing this operation from running + * (for example, CPUS or INSTANCES). If the particular metric is not known, + * a single UNKNOWN metric will be present. + */ + metrics: string[]; + } /** - * The availability zone in which the instance resides. - */ - zone: string; -} -/** - * This event is generated when a container starts. - */ -export interface Schema$ContainerStartedEvent { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + export interface Schema$Entry { + /** + * The created annotation, if creation was successful. + */ + annotation: Schema$Annotation; + /** + * The creation status. + */ + status: Schema$Status; + } /** - * The numeric ID of the action that started this container. - */ - actionId: number; + * Event carries information about events that occur during pipeline + * execution. + */ + export interface Schema$Event { + /** + * A human readable description of the event. Note that these strings may + * change at any time without notice. Any application logic must use the + * information in the details field. + */ + description: string; + /** + * Machine readable details about the event. + */ + details: any; + /** + * The time that the event occurred. + */ + timestamp: string; + } + export interface Schema$Exon { + /** + * The end position of the exon on this annotation's reference sequence, + * 0-based exclusive. Note that this is relative to the reference start, and + * *not* the containing annotation start. + */ + end: string; + /** + * The frame of this exon. Contains a value of 0, 1, or 2, which indicates + * the offset of the first coding base of the exon within the reading frame + * of the coding DNA sequence, if any. This field is dependent on the + * strandedness of this annotation (see Annotation.reverse_strand). For + * forward stranded annotations, this offset is relative to the exon.start. + * For reverse strand annotations, this offset is relative to the exon.end + * `- 1`. Unset if this exon does not intersect the coding sequence. Upon + * creation of a transcript, the frame must be populated for all or none of + * the coding exons. + */ + frame: number; + /** + * The start position of the exon on this annotation's reference + * sequence, 0-based inclusive. Note that this is relative to the reference + * start, and **not** the containing annotation start. + */ + start: string; + } + export interface Schema$Experiment { + /** + * The instrument model used as part of this experiment. This maps to + * sequencing technology in the SAM spec. + */ + instrumentModel: string; + /** + * A client-supplied library identifier; a library is a collection of DNA + * fragments which have been prepared for sequencing from a sample. This + * field is important for quality control as error or bias can be introduced + * during sample preparation. + */ + libraryId: string; + /** + * The platform unit used as part of this experiment, for example + * flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the + * @RG PU field in the SAM spec. + */ + platformUnit: string; + /** + * The sequencing center used as part of this experiment. + */ + sequencingCenter: string; + } /** - * The public IP address that can be used to connect to the container. This - * field is only populated when at least one port mapping is present. If the - * instance was created with a private address this field will be empty even - * if port mappings exist. - */ - ipAddress: string; + * The read group set export request. + */ + export interface Schema$ExportReadGroupSetRequest { + /** + * Required. A Google Cloud Storage URI for the exported BAM file. The + * currently authenticated user must have write access to the new file. An + * error will be returned if the URI already contains data. + */ + exportUri: string; + /** + * Required. The Google Cloud project ID that owns this export. The caller + * must have WRITE access to this project. + */ + projectId: string; + /** + * The reference names to export. If this is not specified, all reference + * sequences, including unmapped reads, are exported. Use `*` to export only + * unmapped reads. + */ + referenceNames: string[]; + } /** - * The container to host port mappings installed for this container. This set - * will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag as well - * as any specified in the Action definition. - */ - portMappings: any; -} -/** - * This event is generated when a container exits. - */ -export interface Schema$ContainerStoppedEvent { + * The variant data export request. + */ + export interface Schema$ExportVariantSetRequest { + /** + * Required. The BigQuery dataset to export data to. This dataset must + * already exist. Note that this is distinct from the Genomics concept of + * "dataset". + */ + bigqueryDataset: string; + /** + * Required. The BigQuery table to export data to. If the table doesn't + * exist, it will be created. If it already exists, it will be overwritten. + */ + bigqueryTable: string; + /** + * If provided, only variant call information from the specified call sets + * will be exported. By default all variant calls are exported. + */ + callSetIds: string[]; + /** + * The format for the exported data. + */ + format: string; + /** + * Required. The Google Cloud project ID that owns the destination BigQuery + * dataset. The caller must have WRITE access to this project. This project + * will also own the resulting export job. + */ + projectId: string; + } + export interface Schema$ExternalId { + /** + * The id used by the source of this data. + */ + id: string; + /** + * The name of the source of this data. + */ + sourceName: string; + } /** - * The numeric ID of the action that started this container. - */ - actionId: number; + * This event is generated when the execution of a pipeline has failed. Note + * that other events may continue to occur after this event. + */ + export interface Schema$FailedEvent { + /** + * The human readable description of the cause of the failure. + */ + cause: string; + /** + * The Google standard error code that best describes this failure. + */ + code: string; + } /** - * The exit status of the container. - */ - exitStatus: number; -} -/** - * A bucket over which read coverage has been precomputed. A bucket corresponds - * to a specific range of the reference sequence. - */ -export interface Schema$CoverageBucket { + * Request message for `GetIamPolicy` method. + */ + export interface Schema$GetIamPolicyRequest {} + /** + * The read group set import request. + */ + export interface Schema$ImportReadGroupSetsRequest { + /** + * Required. The ID of the dataset these read group sets will belong to. The + * caller must have WRITE permissions to this dataset. + */ + datasetId: string; + /** + * The partition strategy describes how read groups are partitioned into + * read group sets. + */ + partitionStrategy: string; + /** + * The reference set to which the imported read group sets are aligned to, + * if any. The reference names of this reference set must be a superset of + * those found in the imported file headers. If no reference set id is + * provided, a best effort is made to associate with a matching reference + * set. + */ + referenceSetId: string; + /** + * A list of URIs pointing at [BAM + * files](https://samtools.github.io/hts-specs/SAMv1.pdf) in Google Cloud + * Storage. Those URIs can include wildcards (*), but do not add or remove + * matching files before import has completed. Note that Google Cloud + * Storage object listing is only eventually consistent: files added may be + * not be immediately visible to everyone. Thus, if using a wildcard it is + * preferable not to start the import immediately after the files are + * created. + */ + sourceUris: string[]; + } /** - * The average number of reads which are aligned to each individual reference - * base in this bucket. + * The read group set import response. */ - meanCoverage: number; + export interface Schema$ImportReadGroupSetsResponse { + /** + * IDs of the read group sets that were created. + */ + readGroupSetIds: string[]; + } /** - * The genomic coordinate range spanned by this bucket. - */ - range: Schema$Range; -} -/** - * A Dataset is a collection of genomic data. - */ -export interface Schema$Dataset { + * The variant data import request. + */ + export interface Schema$ImportVariantsRequest { + /** + * The format of the variant data being imported. If unspecified, defaults + * to to `VCF`. + */ + format: string; + /** + * A mapping between info field keys and the InfoMergeOperations to be + * performed on them. This is plumbed down to the MergeVariantRequests + * generated by the resulting import job. + */ + infoMergeConfig: any; + /** + * Convert reference names to the canonical representation. hg19 haploytypes + * (those reference names containing "_hap") are not modified in + * any way. All other reference names are modified according to the + * following rules: The reference name is capitalized. The "chr" + * prefix is dropped for all autosomes and sex chromsomes. For example + * "chr17" becomes "17" and "chrX" becomes + * "X". All mitochondrial chromosomes ("chrM", + * "chrMT", etc) become "MT". + */ + normalizeReferenceNames: boolean; + /** + * A list of URIs referencing variant files in Google Cloud Storage. URIs + * can include wildcards [as described + * here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). + * Note that recursive wildcards ('**') are not supported. + */ + sourceUris: string[]; + /** + * Required. The variant set to which variant data should be imported. + */ + variantSetId: string; + } /** - * The time this dataset was created, in seconds from the epoch. + * The variant data import response. */ - createTime: string; + export interface Schema$ImportVariantsResponse { + /** + * IDs of the call sets created during the import. + */ + callSetIds: string[]; + } /** - * The server-generated dataset ID, unique across all datasets. - */ - id: string; + * A linear alignment can be represented by one CIGAR string. Describes the + * mapped position and local alignment of the read to the reference. + */ + export interface Schema$LinearAlignment { + /** + * Represents the local alignment of this sequence (alignment matches, + * indels, etc) against the reference. + */ + cigar: Schema$CigarUnit[]; + /** + * The mapping quality of this alignment. Represents how likely the read + * maps to this position as opposed to other locations. Specifically, this + * is -10 log10 Pr(mapping position is wrong), rounded to the nearest + * integer. + */ + mappingQuality: number; + /** + * The position of this alignment. + */ + position: Schema$Position; + } + export interface Schema$ListBasesResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The offset position (0-based) of the given `sequence` from the start of + * this `Reference`. This value will differ for each page in a paginated + * request. + */ + offset: string; + /** + * A substring of the bases that make up this reference. + */ + sequence: string; + } + export interface Schema$ListCoverageBucketsResponse { + /** + * The length of each coverage bucket in base pairs. Note that buckets at + * the end of a reference sequence may be shorter. This value is omitted if + * the bucket width is infinity (the default behaviour, with no range or + * `targetBucketWidth`). + */ + bucketWidth: string; + /** + * The coverage buckets. The list of buckets is sparse; a bucket with 0 + * overlapping reads is not returned. A bucket never crosses more than one + * reference sequence. Each bucket has width `bucketWidth`, unless its end + * is the end of the reference sequence. + */ + coverageBuckets: Schema$CoverageBucket[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } /** - * The dataset name. - */ - name: string; + * The dataset list response. + */ + export interface Schema$ListDatasetsResponse { + /** + * The list of matching Datasets. + */ + datasets: Schema$Dataset[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } /** - * The Google Cloud project ID that this dataset belongs to. - */ - projectId: string; -} -/** - * This event is generated whenever a resource limitation or transient error - * delays execution of a pipeline that was otherwise ready to run. - */ -export interface Schema$DelayedEvent { + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } + export interface Schema$MergeVariantsRequest { + /** + * A mapping between info field keys and the InfoMergeOperations to be + * performed on them. + */ + infoMergeConfig: any; + /** + * The variants to be merged with existing variants. + */ + variants: Schema$Variant[]; + /** + * The destination variant set. + */ + variantSetId: string; + } /** - * A textual description of the cause of the delay. The string may change - * without notice since it is often generated by another service (such as - * Compute Engine). - */ - cause: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * An OperationMetadata or Metadata object. This will always be returned + * with the Operation. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. For example&#58; + * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + */ + name: string; + /** + * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. + * If importing Variants, an ImportVariantsResponse is returned. For + * pipelines and exports, an Empty response is returned. + */ + response: any; + } /** - * If the delay was caused by a resource shortage, this field lists the - * Compute Engine metrics that are preventing this operation from running (for - * example, CPUS or INSTANCES). If the particular metric is not known, a - * single UNKNOWN metric will be present. - */ - metrics: string[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -export interface Schema$Entry { + * An event that occurred during an Operation. + */ + export interface Schema$OperationEvent { + /** + * Required description of event. + */ + description: string; + /** + * Optional time of when event finished. An event can have a start time and + * no finish time. If an event has a finish time, there must be a start + * time. + */ + endTime: string; + /** + * Optional time of when event started. + */ + startTime: string; + } /** - * The created annotation, if creation was successful. - */ - annotation: Schema$Annotation; + * Metadata describing an Operation. + */ + export interface Schema$OperationMetadata { + /** + * This field is deprecated. Use `labels` instead. Optionally provided by + * the caller when submitting the request that creates the operation. + */ + clientId: string; + /** + * The time at which the job was submitted to the Genomics service. + */ + createTime: string; + /** + * The time at which the job stopped running. + */ + endTime: string; + /** + * Optional event messages that were generated during the job's + * execution. This also contains any warnings that were generated during + * import or export. + */ + events: Schema$OperationEvent[]; + /** + * Optionally provided by the caller when submitting the request that + * creates the operation. + */ + labels: any; + /** + * The Google Cloud Project in which the job is scoped. + */ + projectId: string; + /** + * The original request that started the operation. Note that this will be + * in current version of the API. If the operation was started with v1beta2 + * API and a GetOperation is performed on v1 API, a v1 request will be + * returned. + */ + request: any; + /** + * Runtime metadata on this Operation. + */ + runtimeMetadata: any; + /** + * The time at which the job began to run. + */ + startTime: string; + } /** - * The creation status. - */ - status: Schema$Status; -} -/** - * Event carries information about events that occur during pipeline execution. - */ -export interface Schema$Event { + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * A human readable description of the event. Note that these strings may - * change at any time without notice. Any application logic must use the - * information in the details field. - */ - description: string; + * An abstraction for referring to a genomic position, in relation to some + * already known reference. For now, represents a genomic position as a + * reference name, a base number on that reference (0-based), and a + * determination of forward or reverse strand. + */ + export interface Schema$Position { + /** + * The 0-based offset from the start of the forward strand for that + * reference. + */ + position: string; + /** + * The name of the reference in whatever reference set is being used. + */ + referenceName: string; + /** + * Whether this position is on the reverse strand, as opposed to the forward + * strand. + */ + reverseStrand: boolean; + } + export interface Schema$Program { + /** + * The command line used to run this program. + */ + commandLine: string; + /** + * The user specified locally unique ID of the program. Used along with + * `prevProgramId` to define an ordering between programs. + */ + id: string; + /** + * The display name of the program. This is typically the colloquial name of + * the tool used, for example 'bwa' or 'picard'. + */ + name: string; + /** + * The ID of the program run before this one. + */ + prevProgramId: string; + /** + * The version of the program run. + */ + version: string; + } /** - * Machine readable details about the event. + * This event is generated when the worker starts pulling an image. */ - details: any; + export interface Schema$PullStartedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } /** - * The time that the event occurred. + * This event is generated when the worker stops pulling an image. */ - timestamp: string; -} -export interface Schema$Exon { + export interface Schema$PullStoppedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } /** - * The end position of the exon on this annotation's reference sequence, - * 0-based exclusive. Note that this is relative to the reference start, and - * *not* the containing annotation start. - */ - end: string; + * A 0-based half-open genomic coordinate range for search requests. + */ + export interface Schema$Range { + /** + * The end position of the range on the reference, 0-based exclusive. + */ + end: string; + /** + * The reference sequence name, for example `chr1`, `1`, or `chrX`. + */ + referenceName: string; + /** + * The start position of the range on the reference, 0-based inclusive. + */ + start: string; + } /** - * The frame of this exon. Contains a value of 0, 1, or 2, which indicates the - * offset of the first coding base of the exon within the reading frame of the - * coding DNA sequence, if any. This field is dependent on the strandedness of - * this annotation (see Annotation.reverse_strand). For forward stranded - * annotations, this offset is relative to the exon.start. For reverse strand - * annotations, this offset is relative to the exon.end `- 1`. Unset if this - * exon does not intersect the coding sequence. Upon creation of a transcript, - * the frame must be populated for all or none of the coding exons. - */ - frame: number; + * A read alignment describes a linear alignment of a string of DNA to a + * reference sequence, in addition to metadata about the fragment (the + * molecule of DNA sequenced) and the read (the bases which were read by the + * sequencer). A read is equivalent to a line in a SAM file. A read belongs to + * exactly one read group and exactly one read group set. ### + * Reverse-stranded reads Mapped reads (reads having a non-null `alignment`) + * can be aligned to either the forward or the reverse strand of their + * associated reference. Strandedness of a mapped read is encoded by + * `alignment.position.reverseStrand`. If we consider the reference to be a + * forward-stranded coordinate space of `[0, reference.length)` with `0` as + * the left-most position and `reference.length` as the right-most position, + * reads are always aligned left to right. That is, + * `alignment.position.position` always refers to the left-most reference + * coordinate and `alignment.cigar` describes the alignment of this read to + * the reference from left to right. All per-base fields such as + * `alignedSequence` and `alignedQuality` share this same left-to-right + * orientation; this is true of reads which are aligned to either strand. For + * reverse-stranded reads, this means that `alignedSequence` is the reverse + * complement of the bases that were originally reported by the sequencing + * machine. ### Generating a reference-aligned sequence string When + * interacting with mapped reads, it's often useful to produce a string + * representing the local alignment of the read to reference. The following + * pseudocode demonstrates one way of doing this: out = "" + * offset = 0 for c in read.alignment.cigar { switch c.operation { + * case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", + * "SEQUENCE_MISMATCH": out += + * read.alignedSequence[offset:offset+c.operationLength] offset += + * c.operationLength break case "CLIP_SOFT", + * "INSERT": offset += c.operationLength break case + * "PAD": out += repeat("*", c.operationLength) + * break case "DELETE": out += repeat("-", + * c.operationLength) break case "SKIP": out + * += repeat(" ", c.operationLength) break case + * "CLIP_HARD": break } } return out ### + * Converting to SAM's CIGAR string The following pseudocode generates a + * SAM CIGAR string from the `cigar` field. Note that this is a lossy + * conversion (`cigar.referenceSequence` is lost). cigarMap = { + * "ALIGNMENT_MATCH": "M", "INSERT": + * "I", "DELETE": "D", "SKIP": + * "N", "CLIP_SOFT": "S", + * "CLIP_HARD": "H", "PAD": "P", + * "SEQUENCE_MATCH": "=", "SEQUENCE_MISMATCH": + * "X", } cigarStr = "" for c in + * read.alignment.cigar { cigarStr += c.operationLength + + * cigarMap[c.operation] } return cigarStr + */ + export interface Schema$Read { + /** + * The quality of the read sequence contained in this alignment record + * (equivalent to QUAL in SAM). `alignedSequence` and `alignedQuality` may + * be shorter than the full read sequence and quality. This will occur if + * the alignment is part of a chimeric alignment, or if the read was + * trimmed. When this occurs, the CIGAR for this read will begin/end with a + * hard clip operator that will indicate the length of the excised sequence. + */ + alignedQuality: number[]; + /** + * The bases of the read sequence contained in this alignment record, + * **without CIGAR operations applied** (equivalent to SEQ in SAM). + * `alignedSequence` and `alignedQuality` may be shorter than the full read + * sequence and quality. This will occur if the alignment is part of a + * chimeric alignment, or if the read was trimmed. When this occurs, the + * CIGAR for this read will begin/end with a hard clip operator that will + * indicate the length of the excised sequence. + */ + alignedSequence: string; + /** + * The linear alignment for this alignment record. This field is null for + * unmapped reads. + */ + alignment: Schema$LinearAlignment; + /** + * The fragment is a PCR or optical duplicate (SAM flag 0x400). + */ + duplicateFragment: boolean; + /** + * Whether this read did not pass filters, such as platform or vendor + * quality controls (SAM flag 0x200). + */ + failedVendorQualityChecks: boolean; + /** + * The observed length of the fragment, equivalent to TLEN in SAM. + */ + fragmentLength: number; + /** + * The fragment name. Equivalent to QNAME (query template name) in SAM. + */ + fragmentName: string; + /** + * The server-generated read ID, unique across all reads. This is different + * from the `fragmentName`. + */ + id: string; + /** + * A map of additional read alignment information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The mapping of the primary alignment of the `(readNumber+1)%numberReads` + * read in the fragment. It replaces mate position and mate strand in SAM. + */ + nextMatePosition: Schema$Position; + /** + * The number of reads in the fragment (extension to SAM flag 0x1). + */ + numberReads: number; + /** + * The orientation and the distance between reads from the fragment are + * consistent with the sequencing protocol (SAM flag 0x2). + */ + properPlacement: boolean; + /** + * The ID of the read group this read belongs to. A read belongs to exactly + * one read group. This is a server-generated ID which is distinct from + * SAM's RG tag (for that value, see ReadGroup.name). + */ + readGroupId: string; + /** + * The ID of the read group set this read belongs to. A read belongs to + * exactly one read group set. + */ + readGroupSetId: string; + /** + * The read number in sequencing. 0-based and less than numberReads. This + * field replaces SAM flag 0x40 and 0x80. + */ + readNumber: number; + /** + * Whether this alignment is secondary. Equivalent to SAM flag 0x100. A + * secondary alignment represents an alternative to the primary alignment + * for this read. Aligners may return secondary alignments if a read can map + * ambiguously to multiple coordinates in the genome. By convention, each + * read has one and only one alignment where both `secondaryAlignment` and + * `supplementaryAlignment` are false. + */ + secondaryAlignment: boolean; + /** + * Whether this alignment is supplementary. Equivalent to SAM flag 0x800. + * Supplementary alignments are used in the representation of a chimeric + * alignment. In a chimeric alignment, a read is split into multiple linear + * alignments that map to different reference contigs. The first linear + * alignment in the read will be designated as the representative alignment; + * the remaining linear alignments will be designated as supplementary + * alignments. These alignments may have different mapping quality scores. + * In each linear alignment in a chimeric alignment, the read will be hard + * clipped. The `alignedSequence` and `alignedQuality` fields in the + * alignment record will only represent the bases for its respective linear + * alignment. + */ + supplementaryAlignment: boolean; + } /** - * The start position of the exon on this annotation's reference sequence, - * 0-based inclusive. Note that this is relative to the reference start, and - * **not** the containing annotation start. - */ - start: string; -} -export interface Schema$Experiment { + * A read group is all the data that's processed the same way by the + * sequencer. + */ + export interface Schema$ReadGroup { + /** + * The dataset to which this read group belongs. + */ + datasetId: string; + /** + * A free-form text description of this read group. + */ + description: string; + /** + * The experiment used to generate this read group. + */ + experiment: Schema$Experiment; + /** + * The server-generated read group ID, unique for all read groups. Note: + * This is different than the @RG ID field in the SAM spec. For that value, + * see name. + */ + id: string; + /** + * A map of additional read group information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The read group name. This corresponds to the @RG ID field in the SAM + * spec. + */ + name: string; + /** + * The predicted insert size of this read group. The insert size is the + * length the sequenced DNA fragment from end-to-end, not including the + * adapters. + */ + predictedInsertSize: number; + /** + * The programs used to generate this read group. Programs are always + * identical for all read groups within a read group set. For this reason, + * only the first read group in a returned set will have this field + * populated. + */ + programs: Schema$Program[]; + /** + * The reference set the reads in this read group are aligned to. + */ + referenceSetId: string; + /** + * A client-supplied sample identifier for the reads in this read group. + */ + sampleId: string; + } /** - * The instrument model used as part of this experiment. This maps to - * sequencing technology in the SAM spec. - */ - instrumentModel: string; + * A read group set is a logical collection of read groups, which are + * collections of reads produced by a sequencer. A read group set typically + * models reads corresponding to one sample, sequenced one way, and aligned + * one way. * A read group set belongs to one dataset. * A read group belongs + * to one read group set. * A read belongs to one read group. + */ + export interface Schema$ReadGroupSet { + /** + * The dataset to which this read group set belongs. + */ + datasetId: string; + /** + * The filename of the original source file for this read group set, if any. + */ + filename: string; + /** + * The server-generated read group set ID, unique for all read group sets. + */ + id: string; + /** + * A map of additional read group set information. + */ + info: any; + /** + * The read group set name. By default this will be initialized to the + * sample name of the sequenced data contained in this set. + */ + name: string; + /** + * The read groups in this set. There are typically 1-10 read groups in a + * read group set. + */ + readGroups: Schema$ReadGroup[]; + /** + * The reference set to which the reads in this read group set are aligned. + */ + referenceSetId: string; + } /** - * A client-supplied library identifier; a library is a collection of DNA - * fragments which have been prepared for sequencing from a sample. This field - * is important for quality control as error or bias can be introduced during - * sample preparation. - */ - libraryId: string; + * A reference is a canonical assembled DNA sequence, intended to act as a + * reference coordinate space for other genomic annotations. A single + * reference might represent the human chromosome 1 or mitochandrial DNA, for + * instance. A reference belongs to one or more reference sets. + */ + export interface Schema$Reference { + /** + * The server-generated reference ID, unique across all references. + */ + id: string; + /** + * The length of this reference's sequence. + */ + length: string; + /** + * MD5 of the upper-case sequence excluding all whitespace characters (this + * is equivalent to SQ:M5 in SAM). This value is represented in lower case + * hexadecimal format. + */ + md5checksum: string; + /** + * The name of this reference, for example `22`. + */ + name: string; + /** + * ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for + * human. + */ + ncbiTaxonId: number; + /** + * All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + * with a version number, for example `GCF_000001405.26`. + */ + sourceAccessions: string[]; + /** + * The URI from which the sequence was obtained. Typically specifies a FASTA + * format file. + */ + sourceUri: string; + } /** - * The platform unit used as part of this experiment, for example - * flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the - * @RG PU field in the SAM spec. - */ - platformUnit: string; + * ReferenceBound records an upper bound for the starting coordinate of + * variants in a particular reference. + */ + export interface Schema$ReferenceBound { + /** + * The name of the reference associated with this reference bound. + */ + referenceName: string; + /** + * An upper bound (inclusive) on the starting coordinate of any variant in + * the reference sequence. + */ + upperBound: string; + } /** - * The sequencing center used as part of this experiment. - */ - sequencingCenter: string; -} -/** - * The read group set export request. - */ -export interface Schema$ExportReadGroupSetRequest { + * A reference set is a set of references which typically comprise a reference + * assembly for a species, such as `GRCh38` which is representative of the + * human genome. A reference set defines a common coordinate space for + * comparing reference-aligned experimental data. A reference set contains 1 + * or more references. + */ + export interface Schema$ReferenceSet { + /** + * Public id of this reference set, such as `GRCh37`. + */ + assemblyId: string; + /** + * Free text description of this reference set. + */ + description: string; + /** + * The server-generated reference set ID, unique across all reference sets. + */ + id: string; + /** + * Order-independent MD5 checksum which identifies this reference set. The + * checksum is computed by sorting all lower case hexidecimal string + * `reference.md5checksum` (for all reference in this set) in ascending + * lexicographic order, concatenating, and taking the MD5 of that value. The + * resulting value is represented in lower case hexadecimal format. + */ + md5checksum: string; + /** + * ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for + * human) indicating the species which this reference set is intended to + * model. Note that contained references may specify a different + * `ncbiTaxonId`, as assemblies may contain reference sequences which do not + * belong to the modeled species, for example EBV in a human reference + * genome. + */ + ncbiTaxonId: number; + /** + * The IDs of the reference objects that are part of this set. + * `Reference.md5checksum` must be unique within this set. + */ + referenceIds: string[]; + /** + * All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + * with a version number, for example `NC_000001.11`. + */ + sourceAccessions: string[]; + /** + * The URI from which the references were obtained. + */ + sourceUri: string; + } /** - * Required. A Google Cloud Storage URI for the exported BAM file. The - * currently authenticated user must have write access to the new file. An - * error will be returned if the URI already contains data. + * Runtime metadata that will be populated in the runtimeMetadata field of the + * Operation associated with a RunPipeline execution. */ - exportUri: string; + export interface Schema$RuntimeMetadata { + /** + * Execution information specific to Google Compute Engine. + */ + computeEngine: Schema$ComputeEngine; + } + export interface Schema$SearchAnnotationSetsRequest { + /** + * Required. The dataset IDs to search within. Caller must have `READ` + * access to these datasets. + */ + datasetIds: string[]; + /** + * Only return annotations sets for which a substring of the name matches + * this string (case insensitive). + */ + name: string; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 128. The maximum value is 1024. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * If specified, only annotation sets associated with the given reference + * set are returned. + */ + referenceSetId: string; + /** + * If specified, only annotation sets that have any of these types are + * returned. + */ + types: string[]; + } + export interface Schema$SearchAnnotationSetsResponse { + /** + * The matching annotation sets. + */ + annotationSets: Schema$AnnotationSet[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } + export interface Schema$SearchAnnotationsRequest { + /** + * Required. The annotation sets to search within. The caller must have + * `READ` access to these annotation sets. All queried annotation sets must + * have the same type. + */ + annotationSetIds: string[]; + /** + * The end position of the range on the reference, 0-based exclusive. If + * referenceId or referenceName must be specified, Defaults to the length of + * the reference. + */ + end: string; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 256. The maximum value is 2048. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * The ID of the reference to query. + */ + referenceId: string; + /** + * The name of the reference to query, within the reference set associated + * with this query. + */ + referenceName: string; + /** + * The start position of the range on the reference, 0-based inclusive. If + * specified, referenceId or referenceName must be specified. Defaults to 0. + */ + start: string; + } + export interface Schema$SearchAnnotationsResponse { + /** + * The matching annotations. + */ + annotations: Schema$Annotation[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } /** - * Required. The Google Cloud project ID that owns this export. The caller - * must have WRITE access to this project. - */ - projectId: string; + * The call set search request. + */ + export interface Schema$SearchCallSetsRequest { + /** + * Only return call sets for which a substring of the name matches this + * string. + */ + name: string; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 1024. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * Restrict the query to call sets within the given variant sets. At least + * one ID must be provided. + */ + variantSetIds: string[]; + } /** - * The reference names to export. If this is not specified, all reference - * sequences, including unmapped reads, are exported. Use `*` to export only - * unmapped reads. - */ - referenceNames: string[]; -} -/** - * The variant data export request. - */ -export interface Schema$ExportVariantSetRequest { + * The call set search response. + */ + export interface Schema$SearchCallSetsResponse { + /** + * The list of matching call sets. + */ + callSets: Schema$CallSet[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } /** - * Required. The BigQuery dataset to export data to. This dataset must already - * exist. Note that this is distinct from the Genomics concept of - * "dataset". - */ - bigqueryDataset: string; + * The read group set search request. + */ + export interface Schema$SearchReadGroupSetsRequest { + /** + * Restricts this query to read group sets within the given datasets. At + * least one ID must be provided. + */ + datasetIds: string[]; + /** + * Only return read group sets for which a substring of the name matches + * this string. + */ + name: string; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 256. The maximum value is 1024. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + } /** - * Required. The BigQuery table to export data to. If the table doesn't - * exist, it will be created. If it already exists, it will be overwritten. - */ - bigqueryTable: string; + * The read group set search response. + */ + export interface Schema$SearchReadGroupSetsResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The list of matching read group sets. + */ + readGroupSets: Schema$ReadGroupSet[]; + } /** - * If provided, only variant call information from the specified call sets - * will be exported. By default all variant calls are exported. - */ - callSetIds: string[]; + * The read search request. + */ + export interface Schema$SearchReadsRequest { + /** + * The end position of the range on the reference, 0-based exclusive. If + * specified, `referenceName` must also be specified. + */ + end: string; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 256. The maximum value is 2048. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * The IDs of the read groups within which to search for reads. All + * specified read groups must belong to the same read group sets. Must + * specify one of `readGroupSetIds` or `readGroupIds`. + */ + readGroupIds: string[]; + /** + * The IDs of the read groups sets within which to search for reads. All + * specified read group sets must be aligned against a common set of + * reference sequences; this defines the genomic coordinates for the query. + * Must specify one of `readGroupSetIds` or `readGroupIds`. + */ + readGroupSetIds: string[]; + /** + * The reference sequence name, for example `chr1`, `1`, or `chrX`. If set + * to `*`, only unmapped reads are returned. If unspecified, all reads + * (mapped and unmapped) are returned. + */ + referenceName: string; + /** + * The start position of the range on the reference, 0-based inclusive. If + * specified, `referenceName` must also be specified. + */ + start: string; + } /** - * The format for the exported data. - */ - format: string; + * The read search response. + */ + export interface Schema$SearchReadsResponse { + /** + * The list of matching alignments sorted by mapped genomic coordinate, if + * any, ascending in position within the same reference. Unmapped reads, + * which have no position, are returned contiguously and are sorted in + * ascending lexicographic order by fragment name. + */ + alignments: Schema$Read[]; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + } + export interface Schema$SearchReferenceSetsRequest { + /** + * If present, return reference sets for which a prefix of any of + * sourceAccessions match any of these strings. Accession numbers typically + * have a main number and a version, for example `NC_000001.11`. + */ + accessions: string[]; + /** + * If present, return reference sets for which a substring of their + * `assemblyId` matches this string (case insensitive). + */ + assemblyId: string; + /** + * If present, return reference sets for which the md5checksum matches + * exactly. + */ + md5checksums: string[]; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 1024. The maximum value is 4096. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + } + export interface Schema$SearchReferenceSetsResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The matching references sets. + */ + referenceSets: Schema$ReferenceSet[]; + } + export interface Schema$SearchReferencesRequest { + /** + * If present, return references for which a prefix of any of + * sourceAccessions match any of these strings. Accession numbers typically + * have a main number and a version, for example `GCF_000001405.26`. + */ + accessions: string[]; + /** + * If present, return references for which the md5checksum matches exactly. + */ + md5checksums: string[]; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 1024. The maximum value is 4096. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * If present, return only references which belong to this reference set. + */ + referenceSetId: string; + } + export interface Schema$SearchReferencesResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The matching references. + */ + references: Schema$Reference[]; + } /** - * Required. The Google Cloud project ID that owns the destination BigQuery - * dataset. The caller must have WRITE access to this project. This project - * will also own the resulting export job. - */ - projectId: string; -} -export interface Schema$ExternalId { + * The search variant sets request. + */ + export interface Schema$SearchVariantSetsRequest { + /** + * Exactly one dataset ID must be provided here. Only variant sets which + * belong to this dataset will be returned. + */ + datasetIds: string[]; + /** + * The maximum number of results to return in a single page. If unspecified, + * defaults to 1024. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + } /** - * The id used by the source of this data. - */ - id: string; + * The search variant sets response. + */ + export interface Schema$SearchVariantSetsResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The variant sets belonging to the requested dataset. + */ + variantSets: Schema$VariantSet[]; + } /** - * The name of the source of this data. - */ - sourceName: string; -} -/** - * This event is generated when the execution of a pipeline has failed. Note - * that other events may continue to occur after this event. - */ -export interface Schema$FailedEvent { + * The variant search request. + */ + export interface Schema$SearchVariantsRequest { + /** + * Only return variant calls which belong to call sets with these ids. + * Leaving this blank returns all variant calls. If a variant has no calls + * belonging to any of these call sets, it won't be returned at all. + */ + callSetIds: string[]; + /** + * The end of the window, 0-based exclusive. If unspecified or 0, defaults + * to the length of the reference. + */ + end: string; + /** + * The maximum number of calls to return in a single page. Note that this + * limit may be exceeded in the event that a matching variant contains more + * calls than the requested maximum. If unspecified, defaults to 5000. The + * maximum value is 10000. + */ + maxCalls: number; + /** + * The maximum number of variants to return in a single page. If + * unspecified, defaults to 5000. The maximum value is 10000. + */ + pageSize: number; + /** + * The continuation token, which is used to page through large result sets. + * To get the next page of results, set this parameter to the value of + * `nextPageToken` from the previous response. + */ + pageToken: string; + /** + * Required. Only return variants in this reference sequence. + */ + referenceName: string; + /** + * The beginning of the window (0-based, inclusive) for which overlapping + * variants should be returned. If unspecified, defaults to 0. + */ + start: string; + /** + * Only return variants which have exactly this name. + */ + variantName: string; + /** + * At most one variant set ID must be provided. Only variants from this + * variant set will be returned. If omitted, a call set id must be included + * in the request. + */ + variantSetIds: string[]; + } /** - * The human readable description of the cause of the failure. - */ - cause: string; + * The variant search response. + */ + export interface Schema$SearchVariantsResponse { + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. This field will be empty if there aren't any additional + * results. + */ + nextPageToken: string; + /** + * The list of matching Variants. + */ + variants: Schema$Variant[]; + } /** - * The Google standard error code that best describes this failure. + * Request message for `SetIamPolicy` method. */ - code: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * The read group set import request. - */ -export interface Schema$ImportReadGroupSetsRequest { + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + } /** - * Required. The ID of the dataset these read group sets will belong to. The - * caller must have WRITE permissions to this dataset. - */ - datasetId: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The partition strategy describes how read groups are partitioned into read - * group sets. - */ - partitionStrategy: string; + * Request message for `TestIamPermissions` method. + */ + export interface Schema$TestIamPermissionsRequest { + /** + * REQUIRED: The set of permissions to check for the 'resource'. + * Permissions with wildcards (such as '*' or 'storage.*') + * are not allowed. Allowed permissions are&#58; * + * `genomics.datasets.create` * `genomics.datasets.delete` * + * `genomics.datasets.get` * `genomics.datasets.list` * + * `genomics.datasets.update` * `genomics.datasets.getIamPolicy` * + * `genomics.datasets.setIamPolicy` + */ + permissions: string[]; + } /** - * The reference set to which the imported read group sets are aligned to, if - * any. The reference names of this reference set must be a superset of those - * found in the imported file headers. If no reference set id is provided, a - * best effort is made to associate with a matching reference set. + * Response message for `TestIamPermissions` method. */ - referenceSetId: string; + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * A list of URIs pointing at [BAM - * files](https://samtools.github.io/hts-specs/SAMv1.pdf) in Google Cloud - * Storage. Those URIs can include wildcards (*), but do not add or remove - * matching files before import has completed. Note that Google Cloud Storage - * object listing is only eventually consistent: files added may be not be - * immediately visible to everyone. Thus, if using a wildcard it is preferable - * not to start the import immediately after the files are created. - */ - sourceUris: string[]; -} -/** - * The read group set import response. - */ -export interface Schema$ImportReadGroupSetsResponse { + * A transcript represents the assertion that a particular region of the + * reference genome may be transcribed as RNA. + */ + export interface Schema$Transcript { + /** + * The range of the coding sequence for this transcript, if any. To + * determine the exact ranges of coding sequence, intersect this range with + * those of the exons, if any. If there are any exons, the codingSequence + * must start and end within them. Note that in some cases, the reference + * genome will not exactly match the observed mRNA transcript e.g. due to + * variance in the source genome from reference. In these cases, exon.frame + * will not necessarily match the expected reference reading frame and + * coding exon reference bases cannot necessarily be concatenated to produce + * the original transcript mRNA. + */ + codingSequence: Schema$CodingSequence; + /** + * The <a + * href="http://en.wikipedia.org/wiki/Exon">exons</a> + * that compose this transcript. This field should be unset for genomes + * where transcript splicing does not occur, for example prokaryotes. + * Introns are regions of the transcript that are not included in the + * spliced RNA product. Though not explicitly modeled here, intron ranges + * can be deduced; all regions of this transcript that are not exons are + * introns. Exonic sequences do not necessarily code for a translational + * product (amino acids). Only the regions of exons bounded by the + * codingSequence correspond to coding DNA sequence. Exons are ordered by + * start position and may not overlap. + */ + exons: Schema$Exon[]; + /** + * The annotation ID of the gene from which this transcript is transcribed. + */ + geneId: string; + } + export interface Schema$UndeleteDatasetRequest {} + /** + * This event is generated when the execution of a container results in a + * non-zero exit status that was not otherwise ignored. Execution will + * continue, but only actions that are flagged as ALWAYS_RUN will be executed: + * other actions will be skipped. + */ + export interface Schema$UnexpectedExitStatusEvent { + /** + * The numeric ID of the action that started the container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * IDs of the read group sets that were created. - */ - readGroupSetIds: string[]; -} -/** - * The variant data import request. - */ -export interface Schema$ImportVariantsRequest { - /** - * The format of the variant data being imported. If unspecified, defaults to - * to `VCF`. - */ - format: string; - /** - * A mapping between info field keys and the InfoMergeOperations to be - * performed on them. This is plumbed down to the MergeVariantRequests - * generated by the resulting import job. - */ - infoMergeConfig: any; - /** - * Convert reference names to the canonical representation. hg19 haploytypes - * (those reference names containing "_hap") are not modified in any - * way. All other reference names are modified according to the following - * rules: The reference name is capitalized. The "chr" prefix is - * dropped for all autosomes and sex chromsomes. For example "chr17" - * becomes "17" and "chrX" becomes "X". All - * mitochondrial chromosomes ("chrM", "chrMT", etc) become - * "MT". - */ - normalizeReferenceNames: boolean; - /** - * A list of URIs referencing variant files in Google Cloud Storage. URIs can - * include wildcards [as described - * here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). - * Note that recursive wildcards ('**') are not supported. - */ - sourceUris: string[]; - /** - * Required. The variant set to which variant data should be imported. - */ - variantSetId: string; -} -/** - * The variant data import response. - */ -export interface Schema$ImportVariantsResponse { - /** - * IDs of the call sets created during the import. - */ - callSetIds: string[]; -} -/** - * A linear alignment can be represented by one CIGAR string. Describes the - * mapped position and local alignment of the read to the reference. - */ -export interface Schema$LinearAlignment { - /** - * Represents the local alignment of this sequence (alignment matches, indels, - * etc) against the reference. - */ - cigar: Schema$CigarUnit[]; - /** - * The mapping quality of this alignment. Represents how likely the read maps - * to this position as opposed to other locations. Specifically, this is -10 - * log10 Pr(mapping position is wrong), rounded to the nearest integer. - */ - mappingQuality: number; - /** - * The position of this alignment. - */ - position: Schema$Position; -} -export interface Schema$ListBasesResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The offset position (0-based) of the given `sequence` from the start of - * this `Reference`. This value will differ for each page in a paginated - * request. - */ - offset: string; - /** - * A substring of the bases that make up this reference. - */ - sequence: string; -} -export interface Schema$ListCoverageBucketsResponse { - /** - * The length of each coverage bucket in base pairs. Note that buckets at the - * end of a reference sequence may be shorter. This value is omitted if the - * bucket width is infinity (the default behaviour, with no range or - * `targetBucketWidth`). - */ - bucketWidth: string; - /** - * The coverage buckets. The list of buckets is sparse; a bucket with 0 - * overlapping reads is not returned. A bucket never crosses more than one - * reference sequence. Each bucket has width `bucketWidth`, unless its end is - * the end of the reference sequence. - */ - coverageBuckets: Schema$CoverageBucket[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -/** - * The dataset list response. - */ -export interface Schema$ListDatasetsResponse { - /** - * The list of matching Datasets. - */ - datasets: Schema$Dataset[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -export interface Schema$MergeVariantsRequest { - /** - * A mapping between info field keys and the InfoMergeOperations to be - * performed on them. - */ - infoMergeConfig: any; - /** - * The variants to be merged with existing variants. - */ - variants: Schema$Variant[]; - /** - * The destination variant set. - */ - variantSetId: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * An OperationMetadata or Metadata object. This will always be returned with - * the Operation. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. For example&#58; - * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` - */ - name: string; - /** - * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If - * importing Variants, an ImportVariantsResponse is returned. For pipelines - * and exports, an Empty response is returned. - */ - response: any; -} -/** - * An event that occurred during an Operation. - */ -export interface Schema$OperationEvent { - /** - * Required description of event. - */ - description: string; - /** - * Optional time of when event finished. An event can have a start time and no - * finish time. If an event has a finish time, there must be a start time. - */ - endTime: string; - /** - * Optional time of when event started. - */ - startTime: string; -} -/** - * Metadata describing an Operation. - */ -export interface Schema$OperationMetadata { - /** - * This field is deprecated. Use `labels` instead. Optionally provided by the - * caller when submitting the request that creates the operation. - */ - clientId: string; - /** - * The time at which the job was submitted to the Genomics service. - */ - createTime: string; - /** - * The time at which the job stopped running. - */ - endTime: string; - /** - * Optional event messages that were generated during the job's execution. - * This also contains any warnings that were generated during import or - * export. - */ - events: Schema$OperationEvent[]; - /** - * Optionally provided by the caller when submitting the request that creates - * the operation. - */ - labels: any; - /** - * The Google Cloud Project in which the job is scoped. - */ - projectId: string; - /** - * The original request that started the operation. Note that this will be in - * current version of the API. If the operation was started with v1beta2 API - * and a GetOperation is performed on v1 API, a v1 request will be returned. - */ - request: any; - /** - * Runtime metadata on this Operation. - */ - runtimeMetadata: any; - /** - * The time at which the job began to run. - */ - startTime: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * An abstraction for referring to a genomic position, in relation to some - * already known reference. For now, represents a genomic position as a - * reference name, a base number on that reference (0-based), and a - * determination of forward or reverse strand. - */ -export interface Schema$Position { - /** - * The 0-based offset from the start of the forward strand for that reference. - */ - position: string; - /** - * The name of the reference in whatever reference set is being used. - */ - referenceName: string; - /** - * Whether this position is on the reverse strand, as opposed to the forward - * strand. - */ - reverseStrand: boolean; -} -export interface Schema$Program { - /** - * The command line used to run this program. - */ - commandLine: string; - /** - * The user specified locally unique ID of the program. Used along with - * `prevProgramId` to define an ordering between programs. - */ - id: string; - /** - * The display name of the program. This is typically the colloquial name of - * the tool used, for example 'bwa' or 'picard'. - */ - name: string; - /** - * The ID of the program run before this one. - */ - prevProgramId: string; - /** - * The version of the program run. - */ - version: string; -} -/** - * This event is generated when the worker starts pulling an image. - */ -export interface Schema$PullStartedEvent { - /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -/** - * This event is generated when the worker stops pulling an image. - */ -export interface Schema$PullStoppedEvent { - /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -/** - * A 0-based half-open genomic coordinate range for search requests. - */ -export interface Schema$Range { - /** - * The end position of the range on the reference, 0-based exclusive. - */ - end: string; - /** - * The reference sequence name, for example `chr1`, `1`, or `chrX`. - */ - referenceName: string; - /** - * The start position of the range on the reference, 0-based inclusive. - */ - start: string; -} -/** - * A read alignment describes a linear alignment of a string of DNA to a - * reference sequence, in addition to metadata about the fragment (the molecule - * of DNA sequenced) and the read (the bases which were read by the sequencer). - * A read is equivalent to a line in a SAM file. A read belongs to exactly one - * read group and exactly one read group set. ### Reverse-stranded reads Mapped - * reads (reads having a non-null `alignment`) can be aligned to either the - * forward or the reverse strand of their associated reference. Strandedness of - * a mapped read is encoded by `alignment.position.reverseStrand`. If we - * consider the reference to be a forward-stranded coordinate space of `[0, - * reference.length)` with `0` as the left-most position and `reference.length` - * as the right-most position, reads are always aligned left to right. That is, - * `alignment.position.position` always refers to the left-most reference - * coordinate and `alignment.cigar` describes the alignment of this read to the - * reference from left to right. All per-base fields such as `alignedSequence` - * and `alignedQuality` share this same left-to-right orientation; this is true - * of reads which are aligned to either strand. For reverse-stranded reads, this - * means that `alignedSequence` is the reverse complement of the bases that were - * originally reported by the sequencing machine. ### Generating a - * reference-aligned sequence string When interacting with mapped reads, - * it's often useful to produce a string representing the local alignment of - * the read to reference. The following pseudocode demonstrates one way of doing - * this: out = "" offset = 0 for c in - * read.alignment.cigar { switch c.operation { case - * "ALIGNMENT_MATCH", "SEQUENCE_MATCH", - * "SEQUENCE_MISMATCH": out += - * read.alignedSequence[offset:offset+c.operationLength] offset += - * c.operationLength break case "CLIP_SOFT", - * "INSERT": offset += c.operationLength break case - * "PAD": out += repeat("*", c.operationLength) - * break case "DELETE": out += repeat("-", - * c.operationLength) break case "SKIP": out += - * repeat(" ", c.operationLength) break case - * "CLIP_HARD": break } } return out ### - * Converting to SAM's CIGAR string The following pseudocode generates a - * SAM CIGAR string from the `cigar` field. Note that this is a lossy conversion - * (`cigar.referenceSequence` is lost). cigarMap = { - * "ALIGNMENT_MATCH": "M", "INSERT": - * "I", "DELETE": "D", "SKIP": - * "N", "CLIP_SOFT": "S", - * "CLIP_HARD": "H", "PAD": "P", - * "SEQUENCE_MATCH": "=", "SEQUENCE_MISMATCH": - * "X", } cigarStr = "" for c in - * read.alignment.cigar { cigarStr += c.operationLength + - * cigarMap[c.operation] } return cigarStr - */ -export interface Schema$Read { - /** - * The quality of the read sequence contained in this alignment record - * (equivalent to QUAL in SAM). `alignedSequence` and `alignedQuality` may be - * shorter than the full read sequence and quality. This will occur if the - * alignment is part of a chimeric alignment, or if the read was trimmed. When - * this occurs, the CIGAR for this read will begin/end with a hard clip - * operator that will indicate the length of the excised sequence. - */ - alignedQuality: number[]; - /** - * The bases of the read sequence contained in this alignment record, - * **without CIGAR operations applied** (equivalent to SEQ in SAM). - * `alignedSequence` and `alignedQuality` may be shorter than the full read - * sequence and quality. This will occur if the alignment is part of a - * chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR - * for this read will begin/end with a hard clip operator that will indicate - * the length of the excised sequence. - */ - alignedSequence: string; - /** - * The linear alignment for this alignment record. This field is null for - * unmapped reads. - */ - alignment: Schema$LinearAlignment; - /** - * The fragment is a PCR or optical duplicate (SAM flag 0x400). - */ - duplicateFragment: boolean; - /** - * Whether this read did not pass filters, such as platform or vendor quality - * controls (SAM flag 0x200). - */ - failedVendorQualityChecks: boolean; - /** - * The observed length of the fragment, equivalent to TLEN in SAM. - */ - fragmentLength: number; - /** - * The fragment name. Equivalent to QNAME (query template name) in SAM. - */ - fragmentName: string; - /** - * The server-generated read ID, unique across all reads. This is different - * from the `fragmentName`. - */ - id: string; - /** - * A map of additional read alignment information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The mapping of the primary alignment of the `(readNumber+1)%numberReads` - * read in the fragment. It replaces mate position and mate strand in SAM. - */ - nextMatePosition: Schema$Position; - /** - * The number of reads in the fragment (extension to SAM flag 0x1). - */ - numberReads: number; - /** - * The orientation and the distance between reads from the fragment are - * consistent with the sequencing protocol (SAM flag 0x2). - */ - properPlacement: boolean; - /** - * The ID of the read group this read belongs to. A read belongs to exactly - * one read group. This is a server-generated ID which is distinct from - * SAM's RG tag (for that value, see ReadGroup.name). - */ - readGroupId: string; - /** - * The ID of the read group set this read belongs to. A read belongs to - * exactly one read group set. - */ - readGroupSetId: string; - /** - * The read number in sequencing. 0-based and less than numberReads. This - * field replaces SAM flag 0x40 and 0x80. - */ - readNumber: number; - /** - * Whether this alignment is secondary. Equivalent to SAM flag 0x100. A - * secondary alignment represents an alternative to the primary alignment for - * this read. Aligners may return secondary alignments if a read can map - * ambiguously to multiple coordinates in the genome. By convention, each read - * has one and only one alignment where both `secondaryAlignment` and - * `supplementaryAlignment` are false. - */ - secondaryAlignment: boolean; - /** - * Whether this alignment is supplementary. Equivalent to SAM flag 0x800. - * Supplementary alignments are used in the representation of a chimeric - * alignment. In a chimeric alignment, a read is split into multiple linear - * alignments that map to different reference contigs. The first linear - * alignment in the read will be designated as the representative alignment; - * the remaining linear alignments will be designated as supplementary - * alignments. These alignments may have different mapping quality scores. In - * each linear alignment in a chimeric alignment, the read will be hard - * clipped. The `alignedSequence` and `alignedQuality` fields in the alignment - * record will only represent the bases for its respective linear alignment. - */ - supplementaryAlignment: boolean; -} -/** - * A read group is all the data that's processed the same way by the - * sequencer. - */ -export interface Schema$ReadGroup { - /** - * The dataset to which this read group belongs. - */ - datasetId: string; - /** - * A free-form text description of this read group. - */ - description: string; - /** - * The experiment used to generate this read group. - */ - experiment: Schema$Experiment; - /** - * The server-generated read group ID, unique for all read groups. Note: This - * is different than the @RG ID field in the SAM spec. For that value, see - * name. - */ - id: string; - /** - * A map of additional read group information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The read group name. This corresponds to the @RG ID field in the SAM spec. - */ - name: string; - /** - * The predicted insert size of this read group. The insert size is the length - * the sequenced DNA fragment from end-to-end, not including the adapters. - */ - predictedInsertSize: number; - /** - * The programs used to generate this read group. Programs are always - * identical for all read groups within a read group set. For this reason, - * only the first read group in a returned set will have this field populated. - */ - programs: Schema$Program[]; - /** - * The reference set the reads in this read group are aligned to. - */ - referenceSetId: string; - /** - * A client-supplied sample identifier for the reads in this read group. - */ - sampleId: string; -} -/** - * A read group set is a logical collection of read groups, which are - * collections of reads produced by a sequencer. A read group set typically - * models reads corresponding to one sample, sequenced one way, and aligned one - * way. * A read group set belongs to one dataset. * A read group belongs to - * one read group set. * A read belongs to one read group. - */ -export interface Schema$ReadGroupSet { - /** - * The dataset to which this read group set belongs. - */ - datasetId: string; - /** - * The filename of the original source file for this read group set, if any. - */ - filename: string; - /** - * The server-generated read group set ID, unique for all read group sets. - */ - id: string; - /** - * A map of additional read group set information. - */ - info: any; - /** - * The read group set name. By default this will be initialized to the sample - * name of the sequenced data contained in this set. - */ - name: string; - /** - * The read groups in this set. There are typically 1-10 read groups in a read - * group set. - */ - readGroups: Schema$ReadGroup[]; - /** - * The reference set to which the reads in this read group set are aligned. - */ - referenceSetId: string; -} -/** - * A reference is a canonical assembled DNA sequence, intended to act as a - * reference coordinate space for other genomic annotations. A single reference - * might represent the human chromosome 1 or mitochandrial DNA, for instance. A - * reference belongs to one or more reference sets. - */ -export interface Schema$Reference { - /** - * The server-generated reference ID, unique across all references. - */ - id: string; - /** - * The length of this reference's sequence. - */ - length: string; - /** - * MD5 of the upper-case sequence excluding all whitespace characters (this is - * equivalent to SQ:M5 in SAM). This value is represented in lower case - * hexadecimal format. - */ - md5checksum: string; - /** - * The name of this reference, for example `22`. - */ - name: string; - /** - * ID from http://www.ncbi.nlm.nih.gov/taxonomy. For example, 9606 for human. - */ - ncbiTaxonId: number; - /** - * All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally - * with a version number, for example `GCF_000001405.26`. - */ - sourceAccessions: string[]; - /** - * The URI from which the sequence was obtained. Typically specifies a FASTA - * format file. - */ - sourceUri: string; -} -/** - * ReferenceBound records an upper bound for the starting coordinate of variants - * in a particular reference. - */ -export interface Schema$ReferenceBound { - /** - * The name of the reference associated with this reference bound. - */ - referenceName: string; - /** - * An upper bound (inclusive) on the starting coordinate of any variant in the - * reference sequence. - */ - upperBound: string; -} -/** - * A reference set is a set of references which typically comprise a reference - * assembly for a species, such as `GRCh38` which is representative of the human - * genome. A reference set defines a common coordinate space for comparing - * reference-aligned experimental data. A reference set contains 1 or more - * references. - */ -export interface Schema$ReferenceSet { - /** - * Public id of this reference set, such as `GRCh37`. - */ - assemblyId: string; - /** - * Free text description of this reference set. - */ - description: string; - /** - * The server-generated reference set ID, unique across all reference sets. - */ - id: string; - /** - * Order-independent MD5 checksum which identifies this reference set. The - * checksum is computed by sorting all lower case hexidecimal string - * `reference.md5checksum` (for all reference in this set) in ascending - * lexicographic order, concatenating, and taking the MD5 of that value. The - * resulting value is represented in lower case hexadecimal format. - */ - md5checksum: string; - /** - * ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) - * indicating the species which this reference set is intended to model. Note - * that contained references may specify a different `ncbiTaxonId`, as - * assemblies may contain reference sequences which do not belong to the - * modeled species, for example EBV in a human reference genome. - */ - ncbiTaxonId: number; - /** - * The IDs of the reference objects that are part of this set. - * `Reference.md5checksum` must be unique within this set. - */ - referenceIds: string[]; - /** - * All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally - * with a version number, for example `NC_000001.11`. - */ - sourceAccessions: string[]; - /** - * The URI from which the references were obtained. - */ - sourceUri: string; -} -/** - * Runtime metadata that will be populated in the runtimeMetadata field of the - * Operation associated with a RunPipeline execution. - */ -export interface Schema$RuntimeMetadata { - /** - * Execution information specific to Google Compute Engine. - */ - computeEngine: Schema$ComputeEngine; -} -export interface Schema$SearchAnnotationSetsRequest { - /** - * Required. The dataset IDs to search within. Caller must have `READ` access - * to these datasets. - */ - datasetIds: string[]; - /** - * Only return annotations sets for which a substring of the name matches this - * string (case insensitive). - */ - name: string; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 128. The maximum value is 1024. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * If specified, only annotation sets associated with the given reference set - * are returned. - */ - referenceSetId: string; - /** - * If specified, only annotation sets that have any of these types are - * returned. - */ - types: string[]; -} -export interface Schema$SearchAnnotationSetsResponse { - /** - * The matching annotation sets. - */ - annotationSets: Schema$AnnotationSet[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -export interface Schema$SearchAnnotationsRequest { - /** - * Required. The annotation sets to search within. The caller must have `READ` - * access to these annotation sets. All queried annotation sets must have the - * same type. - */ - annotationSetIds: string[]; - /** - * The end position of the range on the reference, 0-based exclusive. If - * referenceId or referenceName must be specified, Defaults to the length of - * the reference. - */ - end: string; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 256. The maximum value is 2048. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * The ID of the reference to query. - */ - referenceId: string; - /** - * The name of the reference to query, within the reference set associated - * with this query. - */ - referenceName: string; - /** - * The start position of the range on the reference, 0-based inclusive. If - * specified, referenceId or referenceName must be specified. Defaults to 0. - */ - start: string; -} -export interface Schema$SearchAnnotationsResponse { - /** - * The matching annotations. - */ - annotations: Schema$Annotation[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -/** - * The call set search request. - */ -export interface Schema$SearchCallSetsRequest { - /** - * Only return call sets for which a substring of the name matches this - * string. - */ - name: string; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 1024. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * Restrict the query to call sets within the given variant sets. At least one - * ID must be provided. - */ - variantSetIds: string[]; -} -/** - * The call set search response. - */ -export interface Schema$SearchCallSetsResponse { - /** - * The list of matching call sets. - */ - callSets: Schema$CallSet[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -/** - * The read group set search request. - */ -export interface Schema$SearchReadGroupSetsRequest { - /** - * Restricts this query to read group sets within the given datasets. At least - * one ID must be provided. - */ - datasetIds: string[]; - /** - * Only return read group sets for which a substring of the name matches this - * string. - */ - name: string; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 256. The maximum value is 1024. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; -} -/** - * The read group set search response. - */ -export interface Schema$SearchReadGroupSetsResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The list of matching read group sets. - */ - readGroupSets: Schema$ReadGroupSet[]; -} -/** - * The read search request. - */ -export interface Schema$SearchReadsRequest { - /** - * The end position of the range on the reference, 0-based exclusive. If - * specified, `referenceName` must also be specified. - */ - end: string; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 256. The maximum value is 2048. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * The IDs of the read groups within which to search for reads. All specified - * read groups must belong to the same read group sets. Must specify one of - * `readGroupSetIds` or `readGroupIds`. - */ - readGroupIds: string[]; - /** - * The IDs of the read groups sets within which to search for reads. All - * specified read group sets must be aligned against a common set of reference - * sequences; this defines the genomic coordinates for the query. Must specify - * one of `readGroupSetIds` or `readGroupIds`. - */ - readGroupSetIds: string[]; - /** - * The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to - * `*`, only unmapped reads are returned. If unspecified, all reads (mapped - * and unmapped) are returned. - */ - referenceName: string; - /** - * The start position of the range on the reference, 0-based inclusive. If - * specified, `referenceName` must also be specified. - */ - start: string; -} -/** - * The read search response. - */ -export interface Schema$SearchReadsResponse { - /** - * The list of matching alignments sorted by mapped genomic coordinate, if - * any, ascending in position within the same reference. Unmapped reads, which - * have no position, are returned contiguously and are sorted in ascending - * lexicographic order by fragment name. - */ - alignments: Schema$Read[]; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; -} -export interface Schema$SearchReferenceSetsRequest { - /** - * If present, return reference sets for which a prefix of any of - * sourceAccessions match any of these strings. Accession numbers typically - * have a main number and a version, for example `NC_000001.11`. - */ - accessions: string[]; - /** - * If present, return reference sets for which a substring of their - * `assemblyId` matches this string (case insensitive). - */ - assemblyId: string; - /** - * If present, return reference sets for which the md5checksum matches - * exactly. - */ - md5checksums: string[]; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 1024. The maximum value is 4096. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; -} -export interface Schema$SearchReferenceSetsResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The matching references sets. - */ - referenceSets: Schema$ReferenceSet[]; -} -export interface Schema$SearchReferencesRequest { - /** - * If present, return references for which a prefix of any of sourceAccessions - * match any of these strings. Accession numbers typically have a main number - * and a version, for example `GCF_000001405.26`. - */ - accessions: string[]; - /** - * If present, return references for which the md5checksum matches exactly. - */ - md5checksums: string[]; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 1024. The maximum value is 4096. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * If present, return only references which belong to this reference set. - */ - referenceSetId: string; -} -export interface Schema$SearchReferencesResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The matching references. - */ - references: Schema$Reference[]; -} -/** - * The search variant sets request. - */ -export interface Schema$SearchVariantSetsRequest { - /** - * Exactly one dataset ID must be provided here. Only variant sets which - * belong to this dataset will be returned. - */ - datasetIds: string[]; - /** - * The maximum number of results to return in a single page. If unspecified, - * defaults to 1024. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; -} -/** - * The search variant sets response. - */ -export interface Schema$SearchVariantSetsResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The variant sets belonging to the requested dataset. - */ - variantSets: Schema$VariantSet[]; -} -/** - * The variant search request. - */ -export interface Schema$SearchVariantsRequest { - /** - * Only return variant calls which belong to call sets with these ids. Leaving - * this blank returns all variant calls. If a variant has no calls belonging - * to any of these call sets, it won't be returned at all. - */ - callSetIds: string[]; - /** - * The end of the window, 0-based exclusive. If unspecified or 0, defaults to - * the length of the reference. - */ - end: string; - /** - * The maximum number of calls to return in a single page. Note that this - * limit may be exceeded in the event that a matching variant contains more - * calls than the requested maximum. If unspecified, defaults to 5000. The - * maximum value is 10000. - */ - maxCalls: number; - /** - * The maximum number of variants to return in a single page. If unspecified, - * defaults to 5000. The maximum value is 10000. - */ - pageSize: number; - /** - * The continuation token, which is used to page through large result sets. To - * get the next page of results, set this parameter to the value of - * `nextPageToken` from the previous response. - */ - pageToken: string; - /** - * Required. Only return variants in this reference sequence. - */ - referenceName: string; - /** - * The beginning of the window (0-based, inclusive) for which overlapping - * variants should be returned. If unspecified, defaults to 0. - */ - start: string; - /** - * Only return variants which have exactly this name. - */ - variantName: string; - /** - * At most one variant set ID must be provided. Only variants from this - * variant set will be returned. If omitted, a call set id must be included in - * the request. - */ - variantSetIds: string[]; -} -/** - * The variant search response. - */ -export interface Schema$SearchVariantsResponse { - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. This field will be empty if there aren't any additional - * results. - */ - nextPageToken: string; - /** - * The list of matching Variants. - */ - variants: Schema$Variant[]; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * REQUIRED: The set of permissions to check for the 'resource'. - * Permissions with wildcards (such as '*' or 'storage.*') are - * not allowed. Allowed permissions are&#58; * `genomics.datasets.create` - * * `genomics.datasets.delete` * `genomics.datasets.get` * - * `genomics.datasets.list` * `genomics.datasets.update` * - * `genomics.datasets.getIamPolicy` * `genomics.datasets.setIamPolicy` - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A transcript represents the assertion that a particular region of the - * reference genome may be transcribed as RNA. - */ -export interface Schema$Transcript { - /** - * The range of the coding sequence for this transcript, if any. To determine - * the exact ranges of coding sequence, intersect this range with those of the - * exons, if any. If there are any exons, the codingSequence must start and - * end within them. Note that in some cases, the reference genome will not - * exactly match the observed mRNA transcript e.g. due to variance in the - * source genome from reference. In these cases, exon.frame will not - * necessarily match the expected reference reading frame and coding exon - * reference bases cannot necessarily be concatenated to produce the original - * transcript mRNA. - */ - codingSequence: Schema$CodingSequence; - /** - * The <a - * href="http://en.wikipedia.org/wiki/Exon">exons</a> that - * compose this transcript. This field should be unset for genomes where - * transcript splicing does not occur, for example prokaryotes. Introns are - * regions of the transcript that are not included in the spliced RNA product. - * Though not explicitly modeled here, intron ranges can be deduced; all - * regions of this transcript that are not exons are introns. Exonic - * sequences do not necessarily code for a translational product (amino - * acids). Only the regions of exons bounded by the codingSequence correspond - * to coding DNA sequence. Exons are ordered by start position and may not - * overlap. - */ - exons: Schema$Exon[]; - /** - * The annotation ID of the gene from which this transcript is transcribed. - */ - geneId: string; -} -export interface Schema$UndeleteDatasetRequest {} -/** - * This event is generated when the execution of a container results in a - * non-zero exit status that was not otherwise ignored. Execution will - * continue, but only actions that are flagged as ALWAYS_RUN will be executed: - * other actions will be skipped. - */ -export interface Schema$UnexpectedExitStatusEvent { - /** - * The numeric ID of the action that started the container. - */ - actionId: number; - /** - * The exit status of the container. - */ - exitStatus: number; -} -/** - * A variant represents a change in DNA sequence relative to a reference - * sequence. For example, a variant could represent a SNP or an insertion. - * Variants belong to a variant set. Each of the calls on a variant represent a - * determination of genotype with respect to that variant. For example, a call - * might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a - * sample named NA12345. A call belongs to a call set, which contains related - * calls typically from one sample. - */ -export interface Schema$Variant { - /** - * The bases that appear instead of the reference bases. - */ - alternateBases: string[]; - /** - * The variant calls for this particular variant. Each one represents the - * determination of genotype with respect to this variant. - */ - calls: Schema$VariantCall[]; - /** - * The date this variant was created, in milliseconds from the epoch. - */ - created: string; - /** - * The end position (0-based) of this variant. This corresponds to the first - * base after the last base in the reference allele. So, the length of the - * reference allele is (end - start). This is useful for variants that - * don't explicitly give alternate bases, for example large deletions. - */ - end: string; - /** - * A list of filters (normally quality filters) this variant has failed. - * `PASS` indicates this variant has passed all filters. - */ - filter: string[]; - /** - * The server-generated variant ID, unique across all variants. - */ - id: string; - /** - * A map of additional variant information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * Names for the variant, for example a RefSNP ID. - */ - names: string[]; - /** - * A measure of how likely this variant is to be real. A higher value is - * better. - */ - quality: number; - /** - * The reference bases for this variant. They start at the given position. - */ - referenceBases: string; - /** - * The reference on which this variant occurs. (such as `chr20` or `X`) - */ - referenceName: string; - /** - * The position at which this variant occurs (0-based). This corresponds to - * the first base of the string of reference bases. - */ - start: string; - /** - * The ID of the variant set this variant belongs to. - */ - variantSetId: string; -} -export interface Schema$VariantAnnotation { - /** - * The alternate allele for this variant. If multiple alternate alleles exist - * at this location, create a separate variant for each one, as they may - * represent distinct conditions. - */ - alternateBases: string; - /** - * Describes the clinical significance of a variant. It is adapted from the - * ClinVar controlled vocabulary for clinical significance described at: - * http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ - */ - clinicalSignificance: string; - /** - * The set of conditions associated with this variant. A condition describes - * the way a variant influences human health. - */ - conditions: Schema$ClinicalCondition[]; - /** - * Effect of the variant on the coding sequence. - */ - effect: string; - /** - * Google annotation ID of the gene affected by this variant. This should be - * provided when the variant is created. - */ - geneId: string; - /** - * Google annotation IDs of the transcripts affected by this variant. These - * should be provided when the variant is created. - */ - transcriptIds: string[]; - /** - * Type has been adapted from ClinVar's list of variant types. - */ - type: string; -} -/** - * A call represents the determination of genotype with respect to a particular - * variant. It may include associated information such as quality and phasing. - * For example, a call might assign a probability of 0.32 to the occurrence of a - * SNP named rs1234 in a call set with the name NA12345. - */ -export interface Schema$VariantCall { - /** - * The ID of the call set this variant call belongs to. - */ - callSetId: string; - /** - * The name of the call set this variant call belongs to. - */ - callSetName: string; - /** - * The genotype of this variant call. Each value represents either the value - * of the `referenceBases` field or a 1-based index into `alternateBases`. If - * a variant had a `referenceBases` value of `T` and an `alternateBases` value - * of `["A", "C"]`, and the `genotype` was `[2, 1]`, that - * would mean the call represented the heterozygous value `CA` for this - * variant. If the `genotype` was instead `[0, 1]`, the represented value - * would be `TA`. Ordering of the genotype values is important if the - * `phaseset` is present. If a genotype is not called (that is, a `.` is - * present in the GT string) -1 is returned. - */ - genotype: number[]; - /** - * The genotype likelihoods for this variant call. Each array entry represents - * how likely a specific genotype is for this call. The value ordering is - * defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood - * scores (PL) are available and log10(P) genotype likelihood scores (GL) are - * not, PL scores are converted to GL scores. If both are available, PL - * scores are stored in `info`. - */ - genotypeLikelihood: number[]; - /** - * A map of additional variant call information. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * If this field is present, this variant call's genotype ordering implies - * the phase of the bases and is consistent with any other variant calls in - * the same reference sequence which have the same phaseset value. When - * importing data from VCF, if the genotype data was phased but no phase set - * was specified this field will be set to `*`. - */ - phaseset: string; -} -/** - * A variant set is a collection of call sets and variants. It contains summary - * statistics of those contents. A variant set belongs to a dataset. - */ -export interface Schema$VariantSet { - /** - * The dataset to which this variant set belongs. - */ - datasetId: string; - /** - * A textual description of this variant set. - */ - description: string; - /** - * The server-generated variant set ID, unique across all variant sets. - */ - id: string; - /** - * The metadata associated with this variant set. - */ - metadata: Schema$VariantSetMetadata[]; - /** - * User-specified, mutable name. - */ - name: string; - /** - * A list of all references used by the variants in a variant set with - * associated coordinate upper bounds for each one. - */ - referenceBounds: Schema$ReferenceBound[]; - /** - * The reference set to which the variant set is mapped. The reference set - * describes the alignment provenance of the variant set, while the - * `referenceBounds` describe the shape of the actual variant data. The - * reference set's reference names are a superset of those found in the - * `referenceBounds`. For example, given a variant set that is mapped to the - * GRCh38 reference set and contains a single variant on reference - * 'X', `referenceBounds` would contain only an entry for 'X', - * while the associated reference set enumerates all possible references: - * '1', '2', 'X', 'Y', 'MT', etc. - */ - referenceSetId: string; -} -/** - * Metadata describes a single piece of variant call metadata. These data - * include a top level key and either a single value string (value) or a list of - * key-value pairs (info.) Value and info are mutually exclusive. - */ -export interface Schema$VariantSetMetadata { - /** - * A textual description of this metadata. - */ - description: string; - /** - * User-provided ID field, not enforced by this API. Two or more pieces of - * structured metadata with identical id and key fields are considered - * equivalent. - */ - id: string; - /** - * Remaining structured metadata key-value pairs. This must be of the form - * map<string, string[]> (string key mapping to a list of string - * values). - */ - info: any; - /** - * The top-level key. - */ - key: string; - /** - * The number of values that can be included in a field described by this - * metadata. - */ - number: string; - /** - * The type of data. Possible types include: Integer, Float, Flag, Character, - * and String. - */ - type: string; - /** - * The value field for simple metadata - */ - value: string; -} -/** - * This event is generated once a worker VM has been assigned to run the - * pipeline. - */ -export interface Schema$WorkerAssignedEvent { - /** - * The worker's instance name. - */ - instance: string; - /** - * The zone the worker is running in. - */ - zone: string; -} -/** - * This event is generated when the worker VM that was assigned to the pipeline - * has been released (i.e., deleted). - */ -export interface Schema$WorkerReleasedEvent { - /** - * The worker's instance name. - */ - instance: string; - /** - * The zone the worker was running in. - */ - zone: string; -} - -export class Resource$Annotations { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.annotations.batchCreate - * @desc Creates one or more new annotations atomically. All annotations must - * belong to the same annotation set. Caller must have WRITE permission for - * this annotation set. For optimal performance, batch positionally adjacent - * annotations together. If the request has a systemic issue, such as an - * attempt to write to an inaccessible annotation set, the entire RPC will - * fail accordingly. For lesser data issues, when possible an error will be - * isolated to the corresponding batch entry in the response; the remaining - * well formed annotations will be created normally. For details on the - * requirements for each individual annotation resource, see CreateAnnotation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.annotations.batchCreate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.batchCreate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BatchCreateAnnotationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchCreate(params?: any, options?: MethodOptions): - AxiosPromise; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations:batchCreate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * genomics.annotations.create - * @desc Creates a new annotation. Caller must have WRITE permission for the - * associated annotation set. The following fields are required: * - * annotationSetId * referenceName or referenceId ### Transcripts For - * annotations of type TRANSCRIPT, the following fields of transcript must be - * provided: * exons.start * exons.end All other fields may be optionally - * specified, unless documented as being server-generated (for example, the - * `id` field). The annotated range must be no longer than 100Mbp (mega base - * pairs). See the Annotation resource for additional restrictions on each - * field. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.annotations.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Annotation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotations.delete - * @desc Deletes an annotation. Caller must have WRITE permission for the - * associated annotation set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation to be deleted. - * annotationId: 'my-annotation-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.annotations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID of the annotation to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['annotationId'], - pathParams: ['annotationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotations.get - * @desc Gets an annotation. Caller must have READ permission for the - * associated annotation set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation to be retrieved. - * annotationId: 'my-annotation-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.annotations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID of the annotation to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['annotationId'], - pathParams: ['annotationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotations.search - * @desc Searches for annotations that match the given criteria. Results are - * ordered by genomic coordinate (by reference sequence, then position). - * Annotations with equivalent genomic coordinates are returned in an - * unspecified order. This order is consistent, such that two queries for the - * same content (regardless of page size) yield annotations in the same order - * across their respective streams of paginated responses. Caller must have - * READ permission for the queried annotation sets. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var annotationsPage = response['annotations']; - * if (!annotationsPage) { - * return; - * } - * for (var i = 0; i < annotationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `annotationsPage`: console.log(JSON.stringify(annotationsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.annotations.search(request, handlePage); - * } - * }; - * - * genomics.annotations.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchAnnotationsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotations.update - * @desc Updates an annotation. Caller must have WRITE permission for the - * associated dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation to be updated. - * annotationId: 'my-annotation-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * genomics.annotations.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotations.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationId The ID of the annotation to be updated. - * @param {string=} params.updateMask An optional mask specifying which fields to update. Mutable fields are name, variant, transcript, and info. If unspecified, all mutable fields will be updated. - * @param {().Annotation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotations/{annotationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['annotationId'], - pathParams: ['annotationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Annotationsets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.annotationsets.create - * @desc Creates a new annotation set. Caller must have WRITE permission for - * the associated dataset. The following fields are required: * datasetId - * * referenceSetId All other fields may be optionally specified, unless - * documented as being server-generated (for example, the `id` field). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.annotationsets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotationsets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnnotationSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotationsets').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotationsets.delete - * @desc Deletes an annotation set. Caller must have WRITE permission for the - * associated annotation set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation set to be deleted. - * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * genomics.annotationsets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotationsets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationSetId The ID of the annotation set to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotationsets/{annotationSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['annotationSetId'], - pathParams: ['annotationSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotationsets.get - * @desc Gets an annotation set. Caller must have READ permission for the - * associated dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation set to be retrieved. - * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * genomics.annotationsets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotationsets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationSetId The ID of the annotation set to be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotationsets/{annotationSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['annotationSetId'], - pathParams: ['annotationSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotationsets.search - * @desc Searches for annotation sets that match the given criteria. - * Annotation sets are returned in an unspecified order. This order is - * consistent, such that two queries for the same content (regardless of page - * size) yield annotation sets in the same order across their respective - * streams of paginated responses. Caller must have READ permission for the - * queried datasets. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var annotationSetsPage = response['annotationSets']; - * if (!annotationSetsPage) { - * return; - * } - * for (var i = 0; i < annotationSetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `annotationSetsPage`: console.log(JSON.stringify(annotationSetsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.annotationsets.search(request, handlePage); - * } - * }; - * - * genomics.annotationsets.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotationsets.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchAnnotationSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotationsets/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.annotationsets.update - * @desc Updates an annotation set. The update must respect all mutability - * restrictions and other invariants described on the annotation set resource. - * Caller must have WRITE permission for the associated dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the annotation set to be updated. - * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * genomics.annotationsets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.annotationsets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.annotationSetId The ID of the annotation set to be updated. - * @param {string=} params.updateMask An optional mask specifying which fields to update. Mutable fields are name, source_uri, and info. If unspecified, all mutable fields will be updated. - * @param {().AnnotationSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/annotationsets/{annotationSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['annotationSetId'], - pathParams: ['annotationSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Callsets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.callsets.create - * @desc Creates a new call set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.callsets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.callsets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CallSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/callsets').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.callsets.delete - * @desc Deletes a call set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the call set to be deleted. - * callSetId: 'my-call-set-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.callsets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.callsets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.callSetId The ID of the call set to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/callsets/{callSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['callSetId'], - pathParams: ['callSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.callsets.get - * @desc Gets a call set by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the call set. - * callSetId: 'my-call-set-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.callsets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.callsets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.callSetId The ID of the call set. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/callsets/{callSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['callSetId'], - pathParams: ['callSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.callsets.patch - * @desc Updates a call set. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the call set to be updated. - * callSetId: 'my-call-set-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * genomics.callsets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.callsets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.callSetId The ID of the call set to be updated. - * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. - * @param {().CallSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/callsets/{callSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['callSetId'], - pathParams: ['callSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.callsets.search - * @desc Gets a list of call sets matching the criteria. Implements - * [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var callSetsPage = response['callSets']; - * if (!callSetsPage) { - * return; - * } - * for (var i = 0; i < callSetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `callSetsPage`: console.log(JSON.stringify(callSetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.callsets.search(request, handlePage); - * } - * }; - * - * genomics.callsets.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.callsets.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchCallSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/callsets/search').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Datasets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.datasets.create - * @desc Creates a new dataset. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.delete - * @desc Deletes a dataset and all of its contents (all read group sets, - * reference sets, variant sets, call sets, annotation sets, etc.) This is - * reversible (up to one week after the deletion) via the datasets.undelete - * operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the dataset to be deleted. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.datasets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId The ID of the dataset to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['datasetId'], - pathParams: ['datasetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.get - * @desc Gets a dataset by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the dataset. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.datasets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId The ID of the dataset. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['datasetId'], - pathParams: ['datasetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.getIamPolicy - * @desc Gets the access control policy for the dataset. This is empty if the - * policy or resource does not exist. See Getting a Policy - * for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which policy is being specified. Format - * is - * // `datasets/`. - * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.list - * @desc Lists datasets within a project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var datasetsPage = response['datasets']; - * if (!datasetsPage) { - * return; - * } - * for (var i = 0; i < datasetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `datasetsPage`: console.log(JSON.stringify(datasetsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.datasets.list(request, handlePage); - * } - * }; - * - * genomics.datasets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of results to return in a single page. If unspecified, defaults to 50. The maximum value is 1024. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - * @param {string=} params.projectId Required. The Google Cloud project ID to list datasets for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.patch - * @desc Updates a dataset. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the dataset to be updated. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId The ID of the dataset to be updated. - * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. - * @param {().Dataset} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets/{datasetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['datasetId'], - pathParams: ['datasetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.setIamPolicy - * @desc Sets the access control policy on the specified dataset. Replaces any - * existing policy. See Setting a Policy - * for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which policy is being specified. Format - * is - * // `datasets/`. - * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. See - * Testing - * Permissions for more information. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which policy is being specified. Format - * is - * // `datasets/`. - * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.datasets.undelete - * @desc Undeletes a dataset by restoring a dataset which was deleted via this - * API. This operation is only possible for a week after the deletion - * occurred. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the dataset to be undeleted. - * datasetId: 'my-dataset-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.datasets.undelete(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.datasets.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.datasetId The ID of the dataset to be undeleted. - * @param {().UndeleteDatasetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/datasets/{datasetId}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['datasetId'], - pathParams: ['datasetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operations { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. Clients may use Operations.GetOperation or - * Operations.ListOperations to check whether the cancellation succeeded or - * the operation completed despite cancellation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.operations.list - * @desc Lists operations that match the specified filter in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.operations.list(request, handlePage); - * } - * }; - * - * genomics.operations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Readgroupsets { - root: Genomics; - coveragebuckets: Resource$Readgroupsets$Coveragebuckets; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - this.coveragebuckets = new Resource$Readgroupsets$Coveragebuckets(root); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.readgroupsets.delete - * @desc Deletes a read group set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the read group set to be deleted. The caller must have - * WRITE - * // permissions to the dataset associated with this read group set. - * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * genomics.readgroupsets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.readGroupSetId The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['readGroupSetId'], - pathParams: ['readGroupSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.readgroupsets.export - * @desc Exports a read group set to a BAM file in Google Cloud Storage. Note - * that currently there may be some differences between exported BAM files and - * the original BAM file at the time of import. See ImportReadGroupSets for - * caveats. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the read group set to export. The caller must - * have - * // READ access to this read group set. - * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.readgroupsets.export(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.readGroupSetId Required. The ID of the read group set to export. The caller must have READ access to this read group set. - * @param {().ExportReadGroupSetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): AxiosPromise; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['readGroupSetId'], - pathParams: ['readGroupSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.readgroupsets.get - * @desc Gets a read group set by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the read group set. - * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * genomics.readgroupsets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.readGroupSetId The ID of the read group set. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['readGroupSetId'], - pathParams: ['readGroupSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.readgroupsets.import - * @desc Creates read group sets by asynchronously importing the provided - * information. The caller must have WRITE permissions to the dataset. ## - * Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - - * Tags will be converted to strings - tag types are not preserved - Comments - * (`@CO`) in the input file header will not be preserved - Original header - * order of references (`@SQ`) will not be preserved - Any reverse stranded - * unmapped reads will be reverse complemented, and their qualities (also the - * "BQ" and "OQ" tags, if any) will be reversed - Unmapped reads will be - * stripped of positional information (reference name and position) - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.readgroupsets.import(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ImportReadGroupSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ -import(params?: any, options?: MethodOptions): AxiosPromise; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { - callback = options; - options = {}; - } if(typeof params === 'function') { - callback = params; - params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/readgroupsets:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: [], pathParams: [], context: this.getRoot()}; if(callback) { - createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} - - - /** - * genomics.readgroupsets.patch - * @desc Updates a read group set. This method supports patch semantics. - * @example - * * // BEFORE RUNNING: -* // --------------- -* // 1. If not already done, enable the Genomics API -* // and check the quota for your project at -* // https://console.developers.google.com/apis/api/genomics -* // 2. This sample uses Application Default Credentials for authentication. -* // If not already done, install the gcloud CLI from -* // https://cloud.google.com/sdk and run -* // `gcloud beta auth application-default login`. -* // For more information, see -* // https://developers.google.com/identity/protocols/application-default-credentials -* // 3. Install the Node.js client library by running -* // `npm install googleapis --save` -* -* var google = require('googleapis'); -* var genomics = google.genomics('v1'); -* -* authorize(function(authClient) { -* var request = { -* // The ID of the read group set to be updated. The caller must have WRITE -* // permissions to the dataset associated with this read group set. -* readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder value. -* -* resource: { -* // TODO: Add desired properties to the request body. Only these properties -* // will be changed. -* }, -* -* auth: authClient, -* }; -* -* genomics.readgroupsets.patch(request, function(err, response) { -* if (err) { -* console.error(err); -* return; -* } -* -* // TODO: Change code below to process the `response` object: -* console.log(JSON.stringify(response, null, 2)); -* }); -* }); -* -* function authorize(callback) { -* google.auth.getApplicationDefault(function(err, authClient) { -* if (err) { -* console.error('authentication failed: ', err); -* return; -* } -* if (authClient.createScopedRequired && authClient.createScopedRequired()) { -* var scopes = ['https://www.googleapis.com/auth/cloud-platform']; -* authClient = authClient.createScoped(scopes); -* } -* callback(authClient); -* }); -* } - * @alias genomics.readgroupsets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.readGroupSetId The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set. - * @param {string=} params.updateMask An optional mask specifying which fields to update. Supported fields: * name. * referenceSetId. Leaving `updateMask` unset is equivalent to specifying all mutable fields. - * @param {().ReadGroupSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['readGroupSetId'], - pathParams: ['readGroupSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.readgroupsets.search - * @desc Searches for read group sets matching the criteria. Implements - * [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var readGroupSetsPage = response['readGroupSets']; - * if (!readGroupSetsPage) { - * return; - * } - * for (var i = 0; i < readGroupSetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `readGroupSetsPage`: console.log(JSON.stringify(readGroupSetsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.readgroupsets.search(request, handlePage); - * } - * }; - * - * genomics.readgroupsets.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchReadGroupSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/readgroupsets/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Readgroupsets$Coveragebuckets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.readgroupsets.coveragebuckets.list - * @desc Lists fixed width coverage buckets for a read group set, each of - * which correspond to a range of a reference sequence. Each bucket summarizes - * coverage information across its corresponding genomic range. Coverage is - * defined as the number of reads which are aligned to a given base in the - * reference sequence. Coverage buckets are available at several precomputed - * bucket widths, enabling retrieval of various coverage 'zoom levels'. The - * caller must have READ permissions for the target read group set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the read group set over which coverage is - * requested. readGroupSetId: 'my-read-group-set-id', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var coverageBucketsPage = response['coverageBuckets']; - * if (!coverageBucketsPage) { - * return; - * } - * for (var i = 0; i < coverageBucketsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `coverageBucketsPage`: console.log(JSON.stringify(coverageBucketsPage[i], - * null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.readgroupsets.coveragebuckets.list(request, handlePage); - * } - * }; - * - * genomics.readgroupsets.coveragebuckets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.readgroupsets.coveragebuckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.end The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference. - * @param {integer=} params.pageSize The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - * @param {string} params.readGroupSetId Required. The ID of the read group set over which coverage is requested. - * @param {string=} params.referenceName The name of the reference to query, within the reference set associated with this query. Optional. - * @param {string=} params.start The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0. - * @param {string=} params.targetBucketWidth The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/readgroupsets/{readGroupSetId}/coveragebuckets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['readGroupSetId'], - pathParams: ['readGroupSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Reads { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.reads.search - * @desc Gets a list of reads for one or more read group sets. Reads search - * operates over a genomic coordinate space of reference sequence & position - * defined over the reference sequences to which the requested read group sets - * are aligned. If a target positional range is specified, search returns all - * reads whose alignment to the reference genome overlap the range. A query - * which specifies only read group set IDs yields all reads in those read - * group sets, including unmapped reads. All reads returned (including reads - * on subsequent pages) are ordered by genomic coordinate (by reference - * sequence, then position). Reads with equivalent genomic coordinates are - * returned in an unspecified order. This order is consistent, such that two - * queries for the same content (regardless of page size) yield reads in the - * same order across their respective streams of paginated responses. - * Implements - * [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var alignmentsPage = response['alignments']; - * if (!alignmentsPage) { - * return; - * } - * for (var i = 0; i < alignmentsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `alignmentsPage`: console.log(JSON.stringify(alignmentsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.reads.search(request, handlePage); - * } - * }; - * - * genomics.reads.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.reads.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchReadsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/reads/search').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$References { - root: Genomics; - bases: Resource$References$Bases; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - this.bases = new Resource$References$Bases(root); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.references.get - * @desc Gets a reference. Implements - * [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the reference. - * referenceId: 'my-reference-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.references.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.references.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.referenceId The ID of the reference. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/references/{referenceId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['referenceId'], - pathParams: ['referenceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.references.search - * @desc Searches for references which match the given criteria. Implements - * [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var referencesPage = response['references']; - * if (!referencesPage) { - * return; - * } - * for (var i = 0; i < referencesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `referencesPage`: console.log(JSON.stringify(referencesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.references.search(request, handlePage); - * } - * }; - * - * genomics.references.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.references.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchReferencesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/references/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$References$Bases { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.references.bases.list - * @desc Lists the bases in a reference, optionally restricted to a range. - * Implements - * [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the reference. - * referenceId: 'my-reference-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var nextPageTokenPage = response['nextPageToken']; - * if (!nextPageTokenPage) { - * return; - * } - * // TODO: Change code below to process each `nextPageTokenPage` - * resource: console.log(nextPageTokenPage); - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.references.bases.list(request, handlePage); - * } - * }; - * - * genomics.references.bases.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.references.bases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.end The end position (0-based, exclusive) of this query. Defaults to the length of this reference. - * @param {integer=} params.pageSize The maximum number of bases to return in a single page. If unspecified, defaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base pairs). - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - * @param {string} params.referenceId The ID of the reference. - * @param {string=} params.start The start position (0-based) of this query. Defaults to 0. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/references/{referenceId}/bases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['referenceId'], - pathParams: ['referenceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Referencesets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * genomics.referencesets.get - * @desc Gets a reference set. Implements - * [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the reference set. - * referenceSetId: 'my-reference-set-id', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * genomics.referencesets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.referencesets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.referenceSetId The ID of the reference set. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/referencesets/{referenceSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['referenceSetId'], - pathParams: ['referenceSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * genomics.referencesets.search - * @desc Searches for reference sets which match the given criteria. - * Implements - * [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var referenceSetsPage = response['referenceSets']; - * if (!referenceSetsPage) { - * return; - * } - * for (var i = 0; i < referenceSetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `referenceSetsPage`: console.log(JSON.stringify(referenceSetsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.referencesets.search(request, handlePage); - * } - * }; - * - * genomics.referencesets.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.referencesets.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchReferenceSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/referencesets/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Variants { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); + * A variant represents a change in DNA sequence relative to a reference + * sequence. For example, a variant could represent a SNP or an insertion. + * Variants belong to a variant set. Each of the calls on a variant represent + * a determination of genotype with respect to that variant. For example, a + * call might assign probability of 0.32 to the occurrence of a SNP named + * rs1234 in a sample named NA12345. A call belongs to a call set, which + * contains related calls typically from one sample. + */ + export interface Schema$Variant { + /** + * The bases that appear instead of the reference bases. + */ + alternateBases: string[]; + /** + * The variant calls for this particular variant. Each one represents the + * determination of genotype with respect to this variant. + */ + calls: Schema$VariantCall[]; + /** + * The date this variant was created, in milliseconds from the epoch. + */ + created: string; + /** + * The end position (0-based) of this variant. This corresponds to the first + * base after the last base in the reference allele. So, the length of the + * reference allele is (end - start). This is useful for variants that + * don't explicitly give alternate bases, for example large deletions. + */ + end: string; + /** + * A list of filters (normally quality filters) this variant has failed. + * `PASS` indicates this variant has passed all filters. + */ + filter: string[]; + /** + * The server-generated variant ID, unique across all variants. + */ + id: string; + /** + * A map of additional variant information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * Names for the variant, for example a RefSNP ID. + */ + names: string[]; + /** + * A measure of how likely this variant is to be real. A higher value is + * better. + */ + quality: number; + /** + * The reference bases for this variant. They start at the given position. + */ + referenceBases: string; + /** + * The reference on which this variant occurs. (such as `chr20` or `X`) + */ + referenceName: string; + /** + * The position at which this variant occurs (0-based). This corresponds to + * the first base of the string of reference bases. + */ + start: string; + /** + * The ID of the variant set this variant belongs to. + */ + variantSetId: string; } - - getRoot() { - return this.root; + export interface Schema$VariantAnnotation { + /** + * The alternate allele for this variant. If multiple alternate alleles + * exist at this location, create a separate variant for each one, as they + * may represent distinct conditions. + */ + alternateBases: string; + /** + * Describes the clinical significance of a variant. It is adapted from the + * ClinVar controlled vocabulary for clinical significance described at: + * http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ + */ + clinicalSignificance: string; + /** + * The set of conditions associated with this variant. A condition describes + * the way a variant influences human health. + */ + conditions: Schema$ClinicalCondition[]; + /** + * Effect of the variant on the coding sequence. + */ + effect: string; + /** + * Google annotation ID of the gene affected by this variant. This should be + * provided when the variant is created. + */ + geneId: string; + /** + * Google annotation IDs of the transcripts affected by this variant. These + * should be provided when the variant is created. + */ + transcriptIds: string[]; + /** + * Type has been adapted from ClinVar's list of variant types. + */ + type: string; } - - - /** - * genomics.variants.create - * @desc Creates a new variant. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.variants.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Variant} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variants').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + /** + * A call represents the determination of genotype with respect to a + * particular variant. It may include associated information such as quality + * and phasing. For example, a call might assign a probability of 0.32 to the + * occurrence of a SNP named rs1234 in a call set with the name NA12345. + */ + export interface Schema$VariantCall { + /** + * The ID of the call set this variant call belongs to. + */ + callSetId: string; + /** + * The name of the call set this variant call belongs to. + */ + callSetName: string; + /** + * The genotype of this variant call. Each value represents either the value + * of the `referenceBases` field or a 1-based index into `alternateBases`. + * If a variant had a `referenceBases` value of `T` and an `alternateBases` + * value of `["A", "C"]`, and the `genotype` was `[2, + * 1]`, that would mean the call represented the heterozygous value `CA` for + * this variant. If the `genotype` was instead `[0, 1]`, the represented + * value would be `TA`. Ordering of the genotype values is important if the + * `phaseset` is present. If a genotype is not called (that is, a `.` is + * present in the GT string) -1 is returned. + */ + genotype: number[]; + /** + * The genotype likelihoods for this variant call. Each array entry + * represents how likely a specific genotype is for this call. The value + * ordering is defined by the GL tag in the VCF spec. If Phred-scaled + * genotype likelihood scores (PL) are available and log10(P) genotype + * likelihood scores (GL) are not, PL scores are converted to GL scores. If + * both are available, PL scores are stored in `info`. + */ + genotypeLikelihood: number[]; + /** + * A map of additional variant call information. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * If this field is present, this variant call's genotype ordering + * implies the phase of the bases and is consistent with any other variant + * calls in the same reference sequence which have the same phaseset value. + * When importing data from VCF, if the genotype data was phased but no + * phase set was specified this field will be set to `*`. + */ + phaseset: string; } - - /** - * genomics.variants.delete - * @desc Deletes a variant. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the variant to be deleted. - * variantId: 'my-variant-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.variants.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.variantId The ID of the variant to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variants/{variantId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['variantId'], - pathParams: ['variantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A variant set is a collection of call sets and variants. It contains + * summary statistics of those contents. A variant set belongs to a dataset. + */ + export interface Schema$VariantSet { + /** + * The dataset to which this variant set belongs. + */ + datasetId: string; + /** + * A textual description of this variant set. + */ + description: string; + /** + * The server-generated variant set ID, unique across all variant sets. + */ + id: string; + /** + * The metadata associated with this variant set. + */ + metadata: Schema$VariantSetMetadata[]; + /** + * User-specified, mutable name. + */ + name: string; + /** + * A list of all references used by the variants in a variant set with + * associated coordinate upper bounds for each one. + */ + referenceBounds: Schema$ReferenceBound[]; + /** + * The reference set to which the variant set is mapped. The reference set + * describes the alignment provenance of the variant set, while the + * `referenceBounds` describe the shape of the actual variant data. The + * reference set's reference names are a superset of those found in the + * `referenceBounds`. For example, given a variant set that is mapped to + * the GRCh38 reference set and contains a single variant on reference + * 'X', `referenceBounds` would contain only an entry for + * 'X', while the associated reference set enumerates all possible + * references: '1', '2', 'X', 'Y', + * 'MT', etc. + */ + referenceSetId: string; + } + /** + * Metadata describes a single piece of variant call metadata. These data + * include a top level key and either a single value string (value) or a list + * of key-value pairs (info.) Value and info are mutually exclusive. + */ + export interface Schema$VariantSetMetadata { + /** + * A textual description of this metadata. + */ + description: string; + /** + * User-provided ID field, not enforced by this API. Two or more pieces of + * structured metadata with identical id and key fields are considered + * equivalent. + */ + id: string; + /** + * Remaining structured metadata key-value pairs. This must be of the form + * map<string, string[]> (string key mapping to a list of string + * values). + */ + info: any; + /** + * The top-level key. + */ + key: string; + /** + * The number of values that can be included in a field described by this + * metadata. + */ + number: string; + /** + * The type of data. Possible types include: Integer, Float, Flag, + * Character, and String. + */ + type: string; + /** + * The value field for simple metadata + */ + value: string; + } + /** + * This event is generated once a worker VM has been assigned to run the + * pipeline. + */ + export interface Schema$WorkerAssignedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker is running in. + */ + zone: string; + } + /** + * This event is generated when the worker VM that was assigned to the + * pipeline has been released (i.e., deleted). + */ + export interface Schema$WorkerReleasedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker was running in. + */ + zone: string; } + export class Resource$Annotations { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.annotations.batchCreate + * @desc Creates one or more new annotations atomically. All annotations + * must belong to the same annotation set. Caller must have WRITE permission + * for this annotation set. For optimal performance, batch positionally + * adjacent annotations together. If the request has a systemic issue, such + * as an attempt to write to an inaccessible annotation set, the entire RPC + * will fail accordingly. For lesser data issues, when possible an error + * will be isolated to the corresponding batch entry in the response; the + * remaining well formed annotations will be created normally. For details + * on the requirements for each individual annotation resource, see + * CreateAnnotation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.annotations.batchCreate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.batchCreate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BatchCreateAnnotationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchCreate(params?: any, options?: MethodOptions): + AxiosPromise; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations:batchCreate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * genomics.annotations.create + * @desc Creates a new annotation. Caller must have WRITE permission for the + * associated annotation set. The following fields are required: * + * annotationSetId * referenceName or referenceId ### Transcripts For + * annotations of type TRANSCRIPT, the following fields of transcript must + * be provided: * exons.start * exons.end All other fields may be + * optionally specified, unless documented as being server-generated (for + * example, the `id` field). The annotated range must be no longer than + * 100Mbp (mega base pairs). See the Annotation resource for additional + * restrictions on each field. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.annotations.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Annotation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotations.delete + * @desc Deletes an annotation. Caller must have WRITE permission for the + * associated annotation set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation to be deleted. + * annotationId: 'my-annotation-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.annotations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID of the annotation to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['annotationId'], + pathParams: ['annotationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotations.get + * @desc Gets an annotation. Caller must have READ permission for the + * associated annotation set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation to be retrieved. + * annotationId: 'my-annotation-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.annotations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID of the annotation to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['annotationId'], + pathParams: ['annotationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotations.search + * @desc Searches for annotations that match the given criteria. Results are + * ordered by genomic coordinate (by reference sequence, then position). + * Annotations with equivalent genomic coordinates are returned in an + * unspecified order. This order is consistent, such that two queries for + * the same content (regardless of page size) yield annotations in the same + * order across their respective streams of paginated responses. Caller must + * have READ permission for the queried annotation sets. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var annotationsPage = response['annotations']; + * if (!annotationsPage) { + * return; + * } + * for (var i = 0; i < annotationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `annotationsPage`: console.log(JSON.stringify(annotationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.annotations.search(request, handlePage); + * } + * }; + * + * genomics.annotations.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchAnnotationsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotations.update + * @desc Updates an annotation. Caller must have WRITE permission for the + * associated dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation to be updated. + * annotationId: 'my-annotation-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * genomics.annotations.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotations.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationId The ID of the annotation to be updated. + * @param {string=} params.updateMask An optional mask specifying which fields to update. Mutable fields are name, variant, transcript, and info. If unspecified, all mutable fields will be updated. + * @param {().Annotation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotations/{annotationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['annotationId'], + pathParams: ['annotationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * genomics.variants.get - * @desc Gets a variant by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the variant. - * variantId: 'my-variant-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.variants.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.variantId The ID of the variant. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Annotationsets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.annotationsets.create + * @desc Creates a new annotation set. Caller must have WRITE permission for + * the associated dataset. The following fields are required: * + * datasetId * referenceSetId All other fields may be optionally + * specified, unless documented as being server-generated (for example, the + * `id` field). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.annotationsets.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotationsets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnnotationSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotationsets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotationsets.delete + * @desc Deletes an annotation set. Caller must have WRITE permission for + * the associated annotation set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation set to be deleted. + * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.annotationsets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotationsets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationSetId The ID of the annotation set to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotationsets/{annotationSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['annotationSetId'], + pathParams: ['annotationSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotationsets.get + * @desc Gets an annotation set. Caller must have READ permission for the + * associated dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation set to be retrieved. + * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.annotationsets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotationsets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationSetId The ID of the annotation set to be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotationsets/{annotationSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['annotationSetId'], + pathParams: ['annotationSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.annotationsets.search + * @desc Searches for annotation sets that match the given criteria. + * Annotation sets are returned in an unspecified order. This order is + * consistent, such that two queries for the same content (regardless of + * page size) yield annotation sets in the same order across their + * respective streams of paginated responses. Caller must have READ + * permission for the queried datasets. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var annotationSetsPage = response['annotationSets']; + * if (!annotationSetsPage) { + * return; + * } + * for (var i = 0; i < annotationSetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `annotationSetsPage`: console.log(JSON.stringify(annotationSetsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.annotationsets.search(request, handlePage); + * } + * }; + * + * genomics.annotationsets.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotationsets.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchAnnotationSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotationsets/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * genomics.annotationsets.update + * @desc Updates an annotation set. The update must respect all mutability + * restrictions and other invariants described on the annotation set + * resource. Caller must have WRITE permission for the associated dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the annotation set to be updated. + * annotationSetId: 'my-annotation-set-id', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * genomics.annotationsets.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.annotationsets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.annotationSetId The ID of the annotation set to be updated. + * @param {string=} params.updateMask An optional mask specifying which fields to update. Mutable fields are name, source_uri, and info. If unspecified, all mutable fields will be updated. + * @param {().AnnotationSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/annotationsets/{annotationSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['annotationSetId'], + pathParams: ['annotationSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Callsets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.callsets.create + * @desc Creates a new call set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.callsets.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.callsets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CallSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/callsets').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.callsets.delete + * @desc Deletes a call set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the call set to be deleted. + * callSetId: 'my-call-set-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.callsets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.callsets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.callSetId The ID of the call set to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/callsets/{callSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['callSetId'], + pathParams: ['callSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.callsets.get + * @desc Gets a call set by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the call set. + * callSetId: 'my-call-set-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.callsets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.callsets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.callSetId The ID of the call set. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/callsets/{callSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['callSetId'], + pathParams: ['callSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.callsets.patch + * @desc Updates a call set. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the call set to be updated. + * callSetId: 'my-call-set-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * genomics.callsets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.callsets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.callSetId The ID of the call set to be updated. + * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + * @param {().CallSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/callsets/{callSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['callSetId'], + pathParams: ['callSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.callsets.search + * @desc Gets a list of call sets matching the criteria. Implements + * [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var callSetsPage = response['callSets']; + * if (!callSetsPage) { + * return; + * } + * for (var i = 0; i < callSetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `callSetsPage`: console.log(JSON.stringify(callSetsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.callsets.search(request, handlePage); + * } + * }; + * + * genomics.callsets.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.callsets.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchCallSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/callsets/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variants/{variantId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['variantId'], - pathParams: ['variantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Datasets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.datasets.create + * @desc Creates a new dataset. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.delete + * @desc Deletes a dataset and all of its contents (all read group sets, + * reference sets, variant sets, call sets, annotation sets, etc.) This is + * reversible (up to one week after the deletion) via the datasets.undelete + * operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the dataset to be deleted. + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.datasets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId The ID of the dataset to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['datasetId'], + pathParams: ['datasetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.get + * @desc Gets a dataset by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the dataset. + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.datasets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId The ID of the dataset. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['datasetId'], + pathParams: ['datasetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.getIamPolicy + * @desc Gets the access control policy for the dataset. This is empty if + * the policy or resource does not exist. See Getting a Policy + * for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which policy is being specified. Format + * is + * // `datasets/`. + * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.getIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.list + * @desc Lists datasets within a project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var datasetsPage = response['datasets']; + * if (!datasetsPage) { + * return; + * } + * for (var i = 0; i < datasetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `datasetsPage`: console.log(JSON.stringify(datasetsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.datasets.list(request, handlePage); + * } + * }; + * + * genomics.datasets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of results to return in a single page. If unspecified, defaults to 50. The maximum value is 1024. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + * @param {string=} params.projectId Required. The Google Cloud project ID to list datasets for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.patch + * @desc Updates a dataset. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the dataset to be updated. + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId The ID of the dataset to be updated. + * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + * @param {().Dataset} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets/{datasetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['datasetId'], + pathParams: ['datasetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.setIamPolicy + * @desc Sets the access control policy on the specified dataset. Replaces + * any existing policy. See Setting a Policy + * for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which policy is being specified. Format + * is + * // `datasets/`. + * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.setIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. + * See Testing + * Permissions for more information. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which policy is being specified. Format + * is + * // `datasets/`. + * resource_: 'datasets/my-dataset', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.datasets.undelete + * @desc Undeletes a dataset by restoring a dataset which was deleted via + * this API. This operation is only possible for a week after the deletion + * occurred. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the dataset to be undeleted. + * datasetId: 'my-dataset-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.datasets.undelete(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.datasets.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.datasetId The ID of the dataset to be undeleted. + * @param {().UndeleteDatasetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/datasets/{datasetId}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['datasetId'], + pathParams: ['datasetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Operations { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. Clients may use Operations.GetOperation or + * Operations.ListOperations to check whether the cancellation succeeded or + * the operation completed despite cancellation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be cancelled. + * name: 'operations/my-operation', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.operations.cancel(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource. + * name: 'operations/my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.operations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.operations.list + * @desc Lists operations that match the specified filter in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation's parent resource. + * name: 'operations', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.operations.list(request, handlePage); + * } + * }; + * + * genomics.operations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * genomics.variants.import - * @desc Creates variant data by asynchronously importing the provided - * information. The variants for import will be merged with any existing - * variant that matches its reference sequence, start, end, reference bases, - * and alternative bases. If no such variant exists, a new one will be - * created. When variants are merged, the call information from the new - * variant is added to the existing variant, and Variant info fields are - * merged as specified in infoMergeConfig. As a special case, for - * single-sample VCF files, QUAL and FILTER fields will be moved to the call - * level; these are sometimes interpreted in a call-specific context. Imported - * VCF headers are appended to the metadata already in a variant set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.variants.import(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ImportVariantsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ + export class Resource$Readgroupsets { + root: Genomics; + coveragebuckets: Resource$Readgroupsets$Coveragebuckets; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + this.coveragebuckets = new Resource$Readgroupsets$Coveragebuckets(root); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.readgroupsets.delete + * @desc Deletes a read group set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the read group set to be deleted. The caller must have + * WRITE + * // permissions to the dataset associated with this read group set. + * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.readgroupsets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.readGroupSetId The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['readGroupSetId'], + pathParams: ['readGroupSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.readgroupsets.export + * @desc Exports a read group set to a BAM file in Google Cloud Storage. + * Note that currently there may be some differences between exported BAM + * files and the original BAM file at the time of import. See + * ImportReadGroupSets for caveats. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the read group set to export. The caller must + * have + * // READ access to this read group set. + * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.readgroupsets.export(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.readGroupSetId Required. The ID of the read group set to export. The caller must have READ access to this read group set. + * @param {().ExportReadGroupSetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['readGroupSetId'], + pathParams: ['readGroupSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.readgroupsets.get + * @desc Gets a read group set by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the read group set. + * readGroupSetId: 'my-read-group-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.readgroupsets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.readGroupSetId The ID of the read group set. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['readGroupSetId'], + pathParams: ['readGroupSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.readgroupsets.import + * @desc Creates read group sets by asynchronously importing the provided + * information. The caller must have WRITE permissions to the dataset. ## + * Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - + * Tags will be converted to strings - tag types are not preserved - + * Comments (`@CO`) in the input file header will not be preserved - + * Original header order of references (`@SQ`) will not be preserved - Any + * reverse stranded unmapped reads will be reverse complemented, and their + * qualities (also the "BQ" and "OQ" tags, if any) will be reversed - + * Unmapped reads will be stripped of positional information (reference name + * and position) + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.readgroupsets.import(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ImportReadGroupSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ import(params?: any, options?: MethodOptions): AxiosPromise; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { callback = options; options = {}; - } if(typeof params === 'function') { + } if(typeof params === 'function') { callback = params; params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/variants:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: [], pathParams: [], context: this.getRoot()}; if(callback) { + } options = options || {}; const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/readgroupsets:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: [], pathParams: [], context: this.getRoot()}; if(callback) { createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} + } else { return createAPIRequest(parameters); + }} - /** - * genomics.variants.merge - * @desc Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 0, 1 ], } ] } // New variant with conflicting call information { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case. + /** + * genomics.readgroupsets.patch + * @desc Updates a read group set. This method supports patch semantics. * @example * * // BEFORE RUNNING: * // --------------- @@ -7418,18 +5947,26 @@ import(params?: any, options?: MethodOptions|BodyResponseCallback; - merge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - merge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variants:merge').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/readgroupsets/{readGroupSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['readGroupSetId'], + pathParams: ['readGroupSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.readgroupsets.search + * @desc Searches for read group sets matching the criteria. Implements + * [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var readGroupSetsPage = response['readGroupSets']; + * if (!readGroupSetsPage) { + * return; + * } + * for (var i = 0; i < readGroupSetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `readGroupSetsPage`: console.log(JSON.stringify(readGroupSetsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.readgroupsets.search(request, handlePage); + * } + * }; + * + * genomics.readgroupsets.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchReadGroupSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/readgroupsets/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * genomics.variants.patch - * @desc Updates a variant. This method supports patch semantics. Returns the - * modified variant without its calls. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the variant to be updated. - * variantId: 'my-variant-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * genomics.variants.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are "names" and "info". If unspecified, all mutable fields will be updated. - * @param {string} params.variantId The ID of the variant to be updated. - * @param {().Variant} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variants/{variantId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['variantId'], - pathParams: ['variantId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Readgroupsets$Coveragebuckets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.readgroupsets.coveragebuckets.list + * @desc Lists fixed width coverage buckets for a read group set, each of + * which correspond to a range of a reference sequence. Each bucket + * summarizes coverage information across its corresponding genomic range. + * Coverage is defined as the number of reads which are aligned to a given + * base in the reference sequence. Coverage buckets are available at several + * precomputed bucket widths, enabling retrieval of various coverage 'zoom + * levels'. The caller must have READ permissions for the target read group + * set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the read group set over which coverage is + * requested. readGroupSetId: 'my-read-group-set-id', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var coverageBucketsPage = response['coverageBuckets']; + * if (!coverageBucketsPage) { + * return; + * } + * for (var i = 0; i < coverageBucketsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `coverageBucketsPage`: console.log(JSON.stringify(coverageBucketsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.readgroupsets.coveragebuckets.list(request, handlePage); + * } + * }; + * + * genomics.readgroupsets.coveragebuckets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.readgroupsets.coveragebuckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.end The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference. + * @param {integer=} params.pageSize The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + * @param {string} params.readGroupSetId Required. The ID of the read group set over which coverage is requested. + * @param {string=} params.referenceName The name of the reference to query, within the reference set associated with this query. Optional. + * @param {string=} params.start The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0. + * @param {string=} params.targetBucketWidth The desired width of each reported coverage bucket in base pairs. This will be rounded down to the nearest precomputed bucket width; the value of which is returned as `bucketWidth` in the response. Defaults to infinity (each bucket spans an entire reference sequence) or the length of the target range, if specified. The smallest precomputed `bucketWidth` is currently 2048 base pairs; this is subject to change. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/readgroupsets/{readGroupSetId}/coveragebuckets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['readGroupSetId'], + pathParams: ['readGroupSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * genomics.variants.search - * @desc Gets a list of variants matching the criteria. Implements - * [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var variantsPage = response['variants']; - * if (!variantsPage) { - * return; - * } - * for (var i = 0; i < variantsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `variantsPage`: console.log(JSON.stringify(variantsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.variants.search(request, handlePage); - * } - * }; - * - * genomics.variants.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variants.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchVariantsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reads { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.reads.search + * @desc Gets a list of reads for one or more read group sets. Reads search + * operates over a genomic coordinate space of reference sequence & position + * defined over the reference sequences to which the requested read group + * sets are aligned. If a target positional range is specified, search + * returns all reads whose alignment to the reference genome overlap the + * range. A query which specifies only read group set IDs yields all reads + * in those read group sets, including unmapped reads. All reads returned + * (including reads on subsequent pages) are ordered by genomic coordinate + * (by reference sequence, then position). Reads with equivalent genomic + * coordinates are returned in an unspecified order. This order is + * consistent, such that two queries for the same content (regardless of + * page size) yield reads in the same order across their respective streams + * of paginated responses. Implements + * [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var alignmentsPage = response['alignments']; + * if (!alignmentsPage) { + * return; + * } + * for (var i = 0; i < alignmentsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `alignmentsPage`: console.log(JSON.stringify(alignmentsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.reads.search(request, handlePage); + * } + * }; + * + * genomics.reads.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.reads.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchReadsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/reads/search').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/variants/search').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Variantsets { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - /** - * genomics.variantsets.create - * @desc Creates a new variant set. The provided variant set must have a - * valid `datasetId` set - all other fields are optional. Note that the `id` - * field will be ignored, as this is assigned by the server. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.variantsets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().VariantSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$References { + root: Genomics; + bases: Resource$References$Bases; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + this.bases = new Resource$References$Bases(root); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.references.get + * @desc Gets a reference. Implements + * [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the reference. + * referenceId: 'my-reference-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.references.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.references.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.referenceId The ID of the reference. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/references/{referenceId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['referenceId'], + pathParams: ['referenceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.references.search + * @desc Searches for references which match the given criteria. Implements + * [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var referencesPage = response['references']; + * if (!referencesPage) { + * return; + * } + * for (var i = 0; i < referencesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `referencesPage`: console.log(JSON.stringify(referencesPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.references.search(request, handlePage); + * } + * }; + * + * genomics.references.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.references.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchReferencesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/references/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * genomics.variantsets.delete - * @desc Deletes a variant set including all variants, call sets, and calls - * within. This is not reversible. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the variant set to be deleted. - * variantSetId: 'my-variant-set-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.variantsets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.variantSetId The ID of the variant set to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets/{variantSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['variantSetId'], - pathParams: ['variantSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$References$Bases { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.references.bases.list + * @desc Lists the bases in a reference, optionally restricted to a range. + * Implements + * [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the reference. + * referenceId: 'my-reference-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var nextPageTokenPage = response['nextPageToken']; + * if (!nextPageTokenPage) { + * return; + * } + * // TODO: Change code below to process each `nextPageTokenPage` + * resource: console.log(nextPageTokenPage); + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.references.bases.list(request, handlePage); + * } + * }; + * + * genomics.references.bases.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.references.bases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.end The end position (0-based, exclusive) of this query. Defaults to the length of this reference. + * @param {integer=} params.pageSize The maximum number of bases to return in a single page. If unspecified, defaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base pairs). + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + * @param {string} params.referenceId The ID of the reference. + * @param {string=} params.start The start position (0-based) of this query. Defaults to 0. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/references/{referenceId}/bases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['referenceId'], + pathParams: ['referenceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * genomics.variantsets.export - * @desc Exports variant set data to an external destination. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the variant set that contains variant data which - * // should be exported. The caller must have READ access to this variant - * set. variantSetId: 'my-variant-set-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.variantsets.export(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.variantSetId Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. - * @param {().ExportVariantSetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): AxiosPromise; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets/{variantSetId}:export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['variantSetId'], - pathParams: ['variantSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Referencesets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.referencesets.get + * @desc Gets a reference set. Implements + * [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the reference set. + * referenceSetId: 'my-reference-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.referencesets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.referencesets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.referenceSetId The ID of the reference set. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/referencesets/{referenceSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['referenceSetId'], + pathParams: ['referenceSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.referencesets.search + * @desc Searches for reference sets which match the given criteria. + * Implements + * [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var referenceSetsPage = response['referenceSets']; + * if (!referenceSetsPage) { + * return; + * } + * for (var i = 0; i < referenceSetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `referenceSetsPage`: console.log(JSON.stringify(referenceSetsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.referencesets.search(request, handlePage); + * } + * }; + * + * genomics.referencesets.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.referencesets.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchReferenceSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/referencesets/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * genomics.variantsets.get - * @desc Gets a variant set by ID. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The ID of the variant set. - * variantSetId: 'my-variant-set-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.variantsets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.variantSetId Required. The ID of the variant set. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets/{variantSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['variantSetId'], - pathParams: ['variantSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + export class Resource$Variants { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.variants.create + * @desc Creates a new variant. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.variants.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Variant} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variants.delete + * @desc Deletes a variant. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the variant to be deleted. + * variantId: 'my-variant-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.variants.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.variantId The ID of the variant to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants/{variantId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['variantId'], + pathParams: ['variantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variants.get + * @desc Gets a variant by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the variant. + * variantId: 'my-variant-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.variants.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.variantId The ID of the variant. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants/{variantId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['variantId'], + pathParams: ['variantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variants.import + * @desc Creates variant data by asynchronously importing the provided + * information. The variants for import will be merged with any existing + * variant that matches its reference sequence, start, end, reference bases, + * and alternative bases. If no such variant exists, a new one will be + * created. When variants are merged, the call information from the new + * variant is added to the existing variant, and Variant info fields are + * merged as specified in infoMergeConfig. As a special case, for + * single-sample VCF files, QUAL and FILTER fields will be moved to the call + * level; these are sometimes interpreted in a call-specific context. + * Imported VCF headers are appended to the metadata already in a variant + * set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.variants.import(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ImportVariantsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ +import(params?: any, options?: MethodOptions): AxiosPromise; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { + callback = options; + options = {}; + } if(typeof params === 'function') { + callback = params; + params = {}; + } options = options || {}; const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/v1/variants:import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: [], pathParams: [], context: this.getRoot()}; if(callback) { + createAPIRequest(parameters, callback); + } else { return createAPIRequest(parameters); + }} - /** - * genomics.variantsets.patch - * @desc Updates a variant set using patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the variant to be updated (must already exist). - * variantSetId: 'my-variant-set-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * genomics.variantsets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.updateMask An optional mask specifying which fields to update. Supported fields: * metadata. * name. * description. Leaving `updateMask` unset is equivalent to specifying all mutable fields. - * @param {string} params.variantSetId The ID of the variant to be updated (must already exist). - * @param {().VariantSet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets/{variantSetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['variantSetId'], - pathParams: ['variantSetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * genomics.variants.merge + * @desc Merges the given variants with existing variants. Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 0, 1 ], } ] } // New variant with conflicting call information { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case. + * @example + * * // BEFORE RUNNING: +* // --------------- +* // 1. If not already done, enable the Genomics API +* // and check the quota for your project at +* // https://console.developers.google.com/apis/api/genomics +* // 2. This sample uses Application Default Credentials for authentication. +* // If not already done, install the gcloud CLI from +* // https://cloud.google.com/sdk and run +* // `gcloud beta auth application-default login`. +* // For more information, see +* // https://developers.google.com/identity/protocols/application-default-credentials +* // 3. Install the Node.js client library by running +* // `npm install googleapis --save` +* +* var google = require('googleapis'); +* var genomics = google.genomics('v1'); +* +* authorize(function(authClient) { +* var request = { +* resource: { +* // TODO: Add desired properties to the request body. +* }, +* +* auth: authClient, +* }; +* +* genomics.variants.merge(request, function(err) { +* if (err) { +* console.error(err); +* return; +* } +* }); +* }); +* +* function authorize(callback) { +* google.auth.getApplicationDefault(function(err, authClient) { +* if (err) { +* console.error('authentication failed: ', err); +* return; +* } +* if (authClient.createScopedRequired && authClient.createScopedRequired()) { +* var scopes = ['https://www.googleapis.com/auth/cloud-platform']; +* authClient = authClient.createScoped(scopes); +* } +* callback(authClient); +* }); +* } + * @alias genomics.variants.merge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().MergeVariantsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + merge(params?: any, options?: MethodOptions): AxiosPromise; + merge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + merge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants:merge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variants.patch + * @desc Updates a variant. This method supports patch semantics. Returns + * the modified variant without its calls. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the variant to be updated. + * variantId: 'my-variant-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * genomics.variants.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.updateMask An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are "names" and "info". If unspecified, all mutable fields will be updated. + * @param {string} params.variantId The ID of the variant to be updated. + * @param {().Variant} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants/{variantId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['variantId'], + pathParams: ['variantId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variants.search + * @desc Gets a list of variants matching the criteria. Implements + * [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var variantsPage = response['variants']; + * if (!variantsPage) { + * return; + * } + * for (var i = 0; i < variantsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `variantsPage`: console.log(JSON.stringify(variantsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.variants.search(request, handlePage); + * } + * }; + * + * genomics.variants.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variants.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchVariantsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variants/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * genomics.variantsets.search - * @desc Returns a list of all variant sets matching search criteria. - * Implements - * [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var variantSetsPage = response['variantSets']; - * if (!variantSetsPage) { - * return; - * } - * for (var i = 0; i < variantSetsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `variantSetsPage`: console.log(JSON.stringify(variantSetsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * genomics.variantsets.search(request, handlePage); - * } - * }; - * - * genomics.variantsets.search(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.variantsets.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SearchVariantSetsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/variantsets/search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Variantsets { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * genomics.variantsets.create + * @desc Creates a new variant set. The provided variant set must have a + * valid `datasetId` set - all other fields are optional. Note that the `id` + * field will be ignored, as this is assigned by the server. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.variantsets.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().VariantSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variantsets.delete + * @desc Deletes a variant set including all variants, call sets, and calls + * within. This is not reversible. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the variant set to be deleted. + * variantSetId: 'my-variant-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.variantsets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.variantSetId The ID of the variant set to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets/{variantSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['variantSetId'], + pathParams: ['variantSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variantsets.export + * @desc Exports variant set data to an external destination. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the variant set that contains variant data + * which + * // should be exported. The caller must have READ access to this + * variant set. variantSetId: 'my-variant-set-id', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.variantsets.export(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.variantSetId Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. + * @param {().ExportVariantSetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets/{variantSetId}:export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['variantSetId'], + pathParams: ['variantSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variantsets.get + * @desc Gets a variant set by ID. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The ID of the variant set. + * variantSetId: 'my-variant-set-id', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * genomics.variantsets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.variantSetId Required. The ID of the variant set. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets/{variantSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['variantSetId'], + pathParams: ['variantSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variantsets.patch + * @desc Updates a variant set using patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the variant to be updated (must already exist). + * variantSetId: 'my-variant-set-id', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * genomics.variantsets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.updateMask An optional mask specifying which fields to update. Supported fields: * metadata. * name. * description. Leaving `updateMask` unset is equivalent to specifying all mutable fields. + * @param {string} params.variantSetId The ID of the variant to be updated (must already exist). + * @param {().VariantSet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets/{variantSetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['variantSetId'], + pathParams: ['variantSetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * genomics.variantsets.search + * @desc Returns a list of all variant sets matching search criteria. + * Implements + * [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var variantSetsPage = response['variantSets']; + * if (!variantSetsPage) { + * return; + * } + * for (var i = 0; i < variantSetsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `variantSetsPage`: console.log(JSON.stringify(variantSetsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * genomics.variantsets.search(request, handlePage); + * } + * }; + * + * genomics.variantsets.search(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.variantsets.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SearchVariantSetsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/variantsets/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/genomics/v1alpha2.ts b/src/apis/genomics/v1alpha2.ts index 582f8f9a202..1a12183f1ee 100644 --- a/src/apis/genomics/v1alpha2.ts +++ b/src/apis/genomics/v1alpha2.ts @@ -27,1976 +27,2005 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Genomics API - * - * Upload, process, query, and search Genomics data in the cloud. - * - * @example - * const google = require('googleapis'); - * const genomics = google.genomics('v1alpha2'); - * - * @namespace genomics - * @type {Function} - * @version v1alpha2 - * @variation v1alpha2 - * @param {object=} options Options for Genomics - */ -export class Genomics { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace genomics_v1alpha2 { + /** + * Genomics API + * + * Upload, process, query, and search Genomics data in the cloud. + * + * @example + * const google = require('googleapis'); + * const genomics = google.genomics('v1alpha2'); + * + * @namespace genomics + * @type {Function} + * @version v1alpha2 + * @variation v1alpha2 + * @param {object=} options Options for Genomics + */ + export class Genomics { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - pipelines: Resource$Pipelines; + operations: Resource$Operations; + pipelines: Resource$Pipelines; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.pipelines = new Resource$Pipelines(this); - } + this.operations = new Resource$Operations(this); + this.pipelines = new Resource$Pipelines(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * Describes a Compute Engine resource that is being managed by a running - * pipeline. - */ -export interface Schema$ComputeEngine { - /** - * The names of the disks that were created for this pipeline. - */ - diskNames: string[]; - /** - * The instance on which the operation is running. - */ - instanceName: string; - /** - * The machine type of the instance. - */ - machineType: string; - /** - * The availability zone in which the instance resides. - */ - zone: string; -} -/** - * This event is generated when a container starts. - */ -export interface Schema$ContainerStartedEvent { - /** - * The numeric ID of the action that started this container. - */ - actionId: number; - /** - * The public IP address that can be used to connect to the container. This - * field is only populated when at least one port mapping is present. If the - * instance was created with a private address this field will be empty even - * if port mappings exist. - */ - ipAddress: string; - /** - * The container to host port mappings installed for this container. This set - * will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag as well - * as any specified in the Action definition. - */ - portMappings: any; -} -/** - * This event is generated when a container exits. - */ -export interface Schema$ContainerStoppedEvent { - /** - * The numeric ID of the action that started this container. - */ - actionId: number; - /** - * The exit status of the container. - */ - exitStatus: number; -} -/** - * Stores the information that the controller will fetch from the server in - * order to run. Should only be used by VMs created by the Pipelines Service and - * not by end users. - */ -export interface Schema$ControllerConfig { - cmd: string; - disks: any; - gcsLogPath: string; - gcsSinks: any; - gcsSources: any; - image: string; - machineType: string; - vars: any; -} -/** - * This event is generated whenever a resource limitation or transient error - * delays execution of a pipeline that was otherwise ready to run. - */ -export interface Schema$DelayedEvent { - /** - * A textual description of the cause of the delay. The string may change - * without notice since it is often generated by another service (such as - * Compute Engine). - */ - cause: string; - /** - * If the delay was caused by a resource shortage, this field lists the - * Compute Engine metrics that are preventing this operation from running (for - * example, CPUS or INSTANCES). If the particular metric is not known, a - * single UNKNOWN metric will be present. - */ - metrics: string[]; -} -/** - * A Google Compute Engine disk resource specification. - */ -export interface Schema$Disk { - /** - * Deprecated. Disks created by the Pipelines API will be deleted at the end - * of the pipeline run, regardless of what this field is set to. - */ - autoDelete: boolean; - /** - * Required at create time and cannot be overridden at run time. Specifies the - * path in the docker container where files on this disk should be located. - * For example, if `mountPoint` is `/mnt/disk`, and the parameter has - * `localPath` `inputs/file.txt`, the docker container can access the data at - * `/mnt/disk/inputs/file.txt`. - */ - mountPoint: string; - /** - * Required. The name of the disk that can be used in the pipeline parameters. - * Must be 1 - 63 characters. The name "boot" is reserved for system - * use. - */ - name: string; - /** - * Specifies how a sourced-base persistent disk will be mounted. See - * https://cloud.google.com/compute/docs/disks/persistent-disks#use_multi_instances - * for more details. Can only be set at create time. - */ - readOnly: boolean; - /** - * The size of the disk. Defaults to 500 (GB). This field is not applicable - * for local SSD. - */ - sizeGb: number; - /** - * The full or partial URL of the persistent disk to attach. See - * https://cloud.google.com/compute/docs/reference/latest/instances#resource - * and https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots - * for more details. - */ - source: string; - /** - * Required. The type of the disk to create. - */ - type: string; -} -/** - * The Docker execuctor specification. - */ -export interface Schema$DockerExecutor { - /** - * Required. The command or newline delimited script to run. The command - * string will be executed within a bash shell. If the command exits with a - * non-zero exit code, output parameter de-localization will be skipped and - * the pipeline operation's `error` field will be populated. Maximum - * command string length is 16384. - */ - cmd: string; - /** - * Required. Image name from either Docker Hub or Google Container Registry. - * Users that run pipelines must have READ access to the image. - */ - imageName: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Event carries information about events that occur during pipeline execution. - */ -export interface Schema$Event { - /** - * A human readable description of the event. Note that these strings may - * change at any time without notice. Any application logic must use the - * information in the details field. - */ - description: string; - /** - * Machine readable details about the event. - */ - details: any; - /** - * The time that the event occurred. - */ - timestamp: string; -} -/** - * This event is generated when the execution of a pipeline has failed. Note - * that other events may continue to occur after this event. - */ -export interface Schema$FailedEvent { - /** - * The human readable description of the cause of the failure. - */ - cause: string; - /** - * The Google standard error code that best describes this failure. - */ - code: string; -} -/** - * The read group set import response. - */ -export interface Schema$ImportReadGroupSetsResponse { - /** - * IDs of the read group sets that were created. - */ - readGroupSetIds: string[]; -} -/** - * The variant data import response. - */ -export interface Schema$ImportVariantsResponse { - /** - * IDs of the call sets created during the import. - */ - callSetIds: string[]; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * The response of ListPipelines. Contains at most `pageSize` pipelines. If it - * contains `pageSize` pipelines, and more pipelines exist, then `nextPageToken` - * will be populated and should be used as the `pageToken` argument to a - * subsequent ListPipelines request. - */ -export interface Schema$ListPipelinesResponse { - /** - * The token to use to get the next page of results. - */ - nextPageToken: string; - /** - * The matched pipelines. - */ - pipelines: Schema$Pipeline[]; -} -/** - * LocalCopy defines how a remote file should be copied to and from the VM. - */ -export interface Schema$LocalCopy { - /** - * Required. The name of the disk where this parameter is located. Can be the - * name of one of the disks specified in the Resources field, or - * "boot", which represents the Docker instance's boot disk and - * has a mount point of `/`. - */ - disk: string; - /** - * Required. The path within the user's docker container where this input - * should be localized to and from, relative to the specified disk's mount - * point. For example: file.txt, - */ - path: string; -} -/** - * The logging options for the pipeline run. - */ -export interface Schema$LoggingOptions { - /** - * The location in Google Cloud Storage to which the pipeline logs will be - * copied. Can be specified as a fully qualified directory path, in which case - * logs will be output with a unique identifier as the filename in that - * directory, or as a fully specified path, which must end in `.log`, in which - * case that path will be used, and the user must ensure that logs are not - * overwritten. Stdout and stderr logs from the run are also generated and - * output as `-stdout.log` and `-stderr.log`. - */ - gcsPath: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * An OperationMetadata or Metadata object. This will always be returned with - * the Operation. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. For example&#58; - * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` - */ - name: string; - /** - * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If - * importing Variants, an ImportVariantsResponse is returned. For pipelines - * and exports, an Empty response is returned. - */ - response: any; -} -/** - * An event that occurred during an Operation. - */ -export interface Schema$OperationEvent { - /** - * Required description of event. - */ - description: string; - /** - * Optional time of when event finished. An event can have a start time and no - * finish time. If an event has a finish time, there must be a start time. - */ - endTime: string; - /** - * Optional time of when event started. - */ - startTime: string; -} -/** - * Metadata describing an Operation. - */ -export interface Schema$OperationMetadata { - /** - * This field is deprecated. Use `labels` instead. Optionally provided by the - * caller when submitting the request that creates the operation. - */ - clientId: string; - /** - * The time at which the job was submitted to the Genomics service. - */ - createTime: string; - /** - * The time at which the job stopped running. - */ - endTime: string; - /** - * Optional event messages that were generated during the job's execution. - * This also contains any warnings that were generated during import or - * export. - */ - events: Schema$OperationEvent[]; - /** - * Optionally provided by the caller when submitting the request that creates - * the operation. - */ - labels: any; - /** - * The Google Cloud Project in which the job is scoped. - */ - projectId: string; - /** - * The original request that started the operation. Note that this will be in - * current version of the API. If the operation was started with v1beta2 API - * and a GetOperation is performed on v1 API, a v1 request will be returned. - */ - request: any; /** - * Runtime metadata on this Operation. - */ - runtimeMetadata: any; - /** - * The time at which the job began to run. - */ - startTime: string; -} -/** - * The pipeline object. Represents a transformation from a set of input - * parameters to a set of output parameters. The transformation is defined as a - * docker image and command to run within that image. Each pipeline is run on a - * Google Compute Engine VM. A pipeline can be created with the `create` method - * and then later run with the `run` method, or a pipeline can be defined and - * run all at once with the `run` method. - */ -export interface Schema$Pipeline { - /** - * User-specified description. - */ - description: string; - /** - * Specifies the docker run information. - */ - docker: Schema$DockerExecutor; - /** - * Input parameters of the pipeline. - */ - inputParameters: Schema$PipelineParameter[]; - /** - * Required. A user specified pipeline name that does not have to be unique. - * This name can be used for filtering Pipelines in ListPipelines. - */ - name: string; - /** - * Output parameters of the pipeline. - */ - outputParameters: Schema$PipelineParameter[]; - /** - * Unique pipeline id that is generated by the service when CreatePipeline is - * called. Cannot be specified in the Pipeline used in the - * CreatePipelineRequest, and will be populated in the response to - * CreatePipeline and all subsequent Get and List calls. Indicates that the - * service has registered this pipeline. - */ - pipelineId: string; - /** - * Required. The project in which to create the pipeline. The caller must have - * WRITE access. - */ - projectId: string; - /** - * Required. Specifies resource requirements for the pipeline run. Required - * fields: * minimumCpuCores * minimumRamGb - */ - resources: Schema$PipelineResources; -} -/** - * Parameters facilitate setting and delivering data into the pipeline's - * execution environment. They are defined at create time, with optional - * defaults, and can be overridden at run time. If `localCopy` is unset, then - * the parameter specifies a string that is passed as-is into the pipeline, as - * the value of the environment variable with the given name. A default value - * can be optionally specified at create time. The default can be overridden at - * run time using the inputs map. If no default is given, a value must be - * supplied at runtime. If `localCopy` is defined, then the parameter specifies - * a data source or sink, both in Google Cloud Storage and on the Docker - * container where the pipeline computation is run. The service account - * associated with the Pipeline (by default the project's Compute Engine - * service account) must have access to the Google Cloud Storage paths. At run - * time, the Google Cloud Storage paths can be overridden if a default was - * provided at create time, or must be set otherwise. The pipeline runner should - * add a key/value pair to either the inputs or outputs map. The indicated data - * copies will be carried out before/after pipeline execution, just as if the - * corresponding arguments were provided to `gsutil cp`. For example: Given the - * following `PipelineParameter`, specified in the `inputParameters` list: ``` - * {name: "input_file", localCopy: {path: "file.txt", disk: - * "pd1"}} ``` where `disk` is defined in the `PipelineResources` - * object as: ``` {name: "pd1", mountPoint: "/mnt/disk/"} - * ``` We create a disk named `pd1`, mount it on the host VM, and map - * `/mnt/pd1` to `/mnt/disk` in the docker container. At runtime, an entry for - * `input_file` would be required in the inputs map, such as: ``` - * inputs["input_file"] = "gs://my-bucket/bar.txt" ``` This - * would generate the following gsutil call: ``` gsutil cp - * gs://my-bucket/bar.txt /mnt/pd1/file.txt ``` The file `/mnt/pd1/file.txt` - * maps to `/mnt/disk/file.txt` in the Docker container. Acceptable paths are: - * <table> <thead> <tr><th>Google Cloud storage - * path</th><th>Local path</th></tr> </thead> - * <tbody> - * <tr><td>file</td><td>file</td></tr> - * <tr><td>glob</td><td>directory</td></tr> - * </tbody> </table> For outputs, the direction of the copy is - * reversed: ``` gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt ``` - * Acceptable paths are: <table> <thead> - * <tr><th>Local path</th><th>Google Cloud Storage - * path</th></tr> </thead> <tbody> - * <tr><td>file</td><td>file</td></tr> - * <tr> <td>file</td> <td>directory - - * directory must already exist</td> </tr> <tr> - * <td>glob</td> <td>directory - directory will be - * created if it doesn't exist</td></tr> </tbody> - * </table> One restriction due to docker limitations, is that for - * outputs that are found on the boot disk, the local path cannot be a glob and - * must be a file. - */ -export interface Schema$PipelineParameter { - /** - * The default value for this parameter. Can be overridden at runtime. If - * `localCopy` is present, then this must be a Google Cloud Storage path - * beginning with `gs://`. - */ - defaultValue: string; - /** - * Human-readable description. - */ - description: string; - /** - * If present, this parameter is marked for copying to and from the VM. - * `LocalCopy` indicates where on the VM the file should be. The value given - * to this parameter (either at runtime or using `defaultValue`) must be the - * remote path where the file should be. - */ - localCopy: Schema$LocalCopy; - /** - * Required. Name of the parameter - the pipeline runner uses this string as - * the key to the input and output maps in RunPipeline. - */ - name: string; -} -/** - * The system resources for the pipeline run. - */ -export interface Schema$PipelineResources { - /** - * Optional. The number of accelerators of the specified type to attach. By - * specifying this parameter, you will download and install the following - * third-party software onto your managed Compute Engine instances: NVIDIA® - * Tesla® drivers and NVIDIA® CUDA toolkit. - */ - acceleratorCount: string; - /** - * Optional. The Compute Engine defined accelerator type. By specifying this - * parameter, you will download and install the following third-party software - * onto your managed Compute Engine instances: NVIDIA® Tesla® drivers and - * NVIDIA® CUDA toolkit. Please see - * https://cloud.google.com/compute/docs/gpus/ for a list of available - * accelerator types. - */ - acceleratorType: string; - /** - * The size of the boot disk. Defaults to 10 (GB). - */ - bootDiskSizeGb: number; - /** - * Disks to attach. - */ - disks: Schema$Disk[]; - /** - * The minimum number of cores to use. Defaults to 1. - */ - minimumCpuCores: number; - /** - * The minimum amount of RAM to use. Defaults to 3.75 (GB) - */ - minimumRamGb: number; - /** - * Whether to assign an external IP to the instance. This is an experimental - * feature that may go away. Defaults to false. Corresponds to `--no_address` - * flag for [gcloud compute instances create] - * (https://cloud.google.com/sdk/gcloud/reference/compute/instances/create). - * In order to use this, must be true for both create time and run time. - * Cannot be true at run time if false at create time. If you need to ssh into - * a private IP VM for debugging, you can ssh to a public VM and then ssh into - * the private VM's Internal IP. If noAddress is set, this pipeline run - * may only load docker images from Google Container Registry and not Docker - * Hub. Before using this, you must [configure access to Google services from - * internal - * IPs](https://cloud.google.com/compute/docs/configure-private-google-access#configuring_access_to_google_services_from_internal_ips). - */ - noAddress: boolean; + * The request message for Operations.CancelOperation. + */ + export interface Schema$CancelOperationRequest {} + /** + * Describes a Compute Engine resource that is being managed by a running + * pipeline. + */ + export interface Schema$ComputeEngine { + /** + * The names of the disks that were created for this pipeline. + */ + diskNames: string[]; + /** + * The instance on which the operation is running. + */ + instanceName: string; + /** + * The machine type of the instance. + */ + machineType: string; + /** + * The availability zone in which the instance resides. + */ + zone: string; + } /** - * Whether to use preemptible VMs. Defaults to `false`. In order to use this, - * must be true for both create time and run time. Cannot be true at run time - * if false at create time. - */ - preemptible: boolean; + * This event is generated when a container starts. + */ + export interface Schema$ContainerStartedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The public IP address that can be used to connect to the container. This + * field is only populated when at least one port mapping is present. If + * the instance was created with a private address this field will be empty + * even if port mappings exist. + */ + ipAddress: string; + /** + * The container to host port mappings installed for this container. This + * set will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag + * as well as any specified in the Action definition. + */ + portMappings: any; + } /** - * List of Google Compute Engine availability zones to which resource creation - * will restricted. If empty, any zone may be chosen. - */ - zones: string[]; -} -/** - * This event is generated when the worker starts pulling an image. - */ -export interface Schema$PullStartedEvent { + * This event is generated when a container exits. + */ + export interface Schema$ContainerStoppedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -/** - * This event is generated when the worker stops pulling an image. - */ -export interface Schema$PullStoppedEvent { + * Stores the information that the controller will fetch from the server in + * order to run. Should only be used by VMs created by the Pipelines Service + * and not by end users. + */ + export interface Schema$ControllerConfig { + cmd: string; + disks: any; + gcsLogPath: string; + gcsSinks: any; + gcsSources: any; + image: string; + machineType: string; + vars: any; + } /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -export interface Schema$RepeatedString { values: string[]; } -/** - * The pipeline run arguments. - */ -export interface Schema$RunPipelineArgs { + * This event is generated whenever a resource limitation or transient error + * delays execution of a pipeline that was otherwise ready to run. + */ + export interface Schema$DelayedEvent { + /** + * A textual description of the cause of the delay. The string may change + * without notice since it is often generated by another service (such as + * Compute Engine). + */ + cause: string; + /** + * If the delay was caused by a resource shortage, this field lists the + * Compute Engine metrics that are preventing this operation from running + * (for example, CPUS or INSTANCES). If the particular metric is not known, + * a single UNKNOWN metric will be present. + */ + metrics: string[]; + } /** - * This field is deprecated. Use `labels` instead. Client-specified pipeline - * operation identifier. - */ - clientId: string; + * A Google Compute Engine disk resource specification. + */ + export interface Schema$Disk { + /** + * Deprecated. Disks created by the Pipelines API will be deleted at the end + * of the pipeline run, regardless of what this field is set to. + */ + autoDelete: boolean; + /** + * Required at create time and cannot be overridden at run time. Specifies + * the path in the docker container where files on this disk should be + * located. For example, if `mountPoint` is `/mnt/disk`, and the parameter + * has `localPath` `inputs/file.txt`, the docker container can access the + * data at `/mnt/disk/inputs/file.txt`. + */ + mountPoint: string; + /** + * Required. The name of the disk that can be used in the pipeline + * parameters. Must be 1 - 63 characters. The name "boot" is + * reserved for system use. + */ + name: string; + /** + * Specifies how a sourced-base persistent disk will be mounted. See + * https://cloud.google.com/compute/docs/disks/persistent-disks#use_multi_instances + * for more details. Can only be set at create time. + */ + readOnly: boolean; + /** + * The size of the disk. Defaults to 500 (GB). This field is not applicable + * for local SSD. + */ + sizeGb: number; + /** + * The full or partial URL of the persistent disk to attach. See + * https://cloud.google.com/compute/docs/reference/latest/instances#resource + * and + * https://cloud.google.com/compute/docs/disks/persistent-disks#snapshots + * for more details. + */ + source: string; + /** + * Required. The type of the disk to create. + */ + type: string; + } /** - * Pipeline input arguments; keys are defined in the pipeline documentation. - * All input parameters that do not have default values must be specified. If - * parameters with defaults are specified here, the defaults will be - * overridden. - */ - inputs: any; + * The Docker execuctor specification. + */ + export interface Schema$DockerExecutor { + /** + * Required. The command or newline delimited script to run. The command + * string will be executed within a bash shell. If the command exits with a + * non-zero exit code, output parameter de-localization will be skipped and + * the pipeline operation's `error` field will be populated. Maximum + * command string length is 16384. + */ + cmd: string; + /** + * Required. Image name from either Docker Hub or Google Container Registry. + * Users that run pipelines must have READ access to the image. + */ + imageName: string; + } /** - * How long to keep the VM up after a failure (for example docker command - * failed, copying input or output files failed, etc). While the VM is up, one - * can ssh into the VM to debug. Default is 0; maximum allowed value is 1 day. - */ - keepVmAliveOnFailureDuration: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Event carries information about events that occur during pipeline + * execution. + */ + export interface Schema$Event { + /** + * A human readable description of the event. Note that these strings may + * change at any time without notice. Any application logic must use the + * information in the details field. + */ + description: string; + /** + * Machine readable details about the event. + */ + details: any; + /** + * The time that the event occurred. + */ + timestamp: string; + } /** - * Labels to apply to this pipeline run. Labels will also be applied to - * compute resources (VM, disks) created by this pipeline run. When listing - * operations, operations can filtered by labels. Label keys may not be empty; - * label values may be empty. Non-empty labels must be 1-63 characters long, - * and comply with [RFC1035] (https://www.ietf.org/rfc/rfc1035.txt). - * Specifically, the name must be 1-63 characters long and match the regular - * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character - * must be a lowercase letter, and all following characters must be a dash, - * lowercase letter, or digit, except the last character, which cannot be a - * dash. - */ - labels: any; + * This event is generated when the execution of a pipeline has failed. Note + * that other events may continue to occur after this event. + */ + export interface Schema$FailedEvent { + /** + * The human readable description of the cause of the failure. + */ + cause: string; + /** + * The Google standard error code that best describes this failure. + */ + code: string; + } /** - * Required. Logging options. Used by the service to communicate results to - * the user. + * The read group set import response. */ - logging: Schema$LoggingOptions; + export interface Schema$ImportReadGroupSetsResponse { + /** + * IDs of the read group sets that were created. + */ + readGroupSetIds: string[]; + } /** - * Pipeline output arguments; keys are defined in the pipeline documentation. - * All output parameters of without default values must be specified. If - * parameters with defaults are specified here, the defaults will be - * overridden. + * The variant data import response. */ - outputs: any; + export interface Schema$ImportVariantsResponse { + /** + * IDs of the call sets created during the import. + */ + callSetIds: string[]; + } /** - * Required. The project in which to run the pipeline. The caller must have - * WRITER access to all Google Cloud services and resources (e.g. Google - * Compute Engine) will be used. - */ - projectId: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Specifies resource requirements/overrides for the pipeline run. - */ - resources: Schema$PipelineResources; + * The response of ListPipelines. Contains at most `pageSize` pipelines. If it + * contains `pageSize` pipelines, and more pipelines exist, then + * `nextPageToken` will be populated and should be used as the `pageToken` + * argument to a subsequent ListPipelines request. + */ + export interface Schema$ListPipelinesResponse { + /** + * The token to use to get the next page of results. + */ + nextPageToken: string; + /** + * The matched pipelines. + */ + pipelines: Schema$Pipeline[]; + } /** - * The Google Cloud Service Account that will be used to access data and - * services. By default, the compute service account associated with - * `projectId` is used. - */ - serviceAccount: Schema$ServiceAccount; -} -/** - * The request to run a pipeline. If `pipelineId` is specified, it refers to a - * saved pipeline created with CreatePipeline and set as the `pipelineId` of the - * returned Pipeline object. If `ephemeralPipeline` is specified, that pipeline - * is run once with the given args and not saved. It is an error to specify both - * `pipelineId` and `ephemeralPipeline`. `pipelineArgs` must be specified. - */ -export interface Schema$RunPipelineRequest { + * LocalCopy defines how a remote file should be copied to and from the VM. + */ + export interface Schema$LocalCopy { + /** + * Required. The name of the disk where this parameter is located. Can be + * the name of one of the disks specified in the Resources field, or + * "boot", which represents the Docker instance's boot disk + * and has a mount point of `/`. + */ + disk: string; + /** + * Required. The path within the user's docker container where this + * input should be localized to and from, relative to the specified + * disk's mount point. For example: file.txt, + */ + path: string; + } /** - * A new pipeline object to run once and then delete. - */ - ephemeralPipeline: Schema$Pipeline; + * The logging options for the pipeline run. + */ + export interface Schema$LoggingOptions { + /** + * The location in Google Cloud Storage to which the pipeline logs will be + * copied. Can be specified as a fully qualified directory path, in which + * case logs will be output with a unique identifier as the filename in that + * directory, or as a fully specified path, which must end in `.log`, in + * which case that path will be used, and the user must ensure that logs are + * not overwritten. Stdout and stderr logs from the run are also generated + * and output as `-stdout.log` and `-stderr.log`. + */ + gcsPath: string; + } /** - * The arguments to use when running this pipeline. - */ - pipelineArgs: Schema$RunPipelineArgs; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * An OperationMetadata or Metadata object. This will always be returned + * with the Operation. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. For example&#58; + * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + */ + name: string; + /** + * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. + * If importing Variants, an ImportVariantsResponse is returned. For + * pipelines and exports, an Empty response is returned. + */ + response: any; + } /** - * The already created pipeline to run. - */ - pipelineId: string; -} -/** - * Runtime metadata that will be populated in the runtimeMetadata field of the - * Operation associated with a RunPipeline execution. - */ -export interface Schema$RuntimeMetadata { + * An event that occurred during an Operation. + */ + export interface Schema$OperationEvent { + /** + * Required description of event. + */ + description: string; + /** + * Optional time of when event finished. An event can have a start time and + * no finish time. If an event has a finish time, there must be a start + * time. + */ + endTime: string; + /** + * Optional time of when event started. + */ + startTime: string; + } /** - * Execution information specific to Google Compute Engine. - */ - computeEngine: Schema$ComputeEngine; -} -/** - * A Google Cloud Service Account. - */ -export interface Schema$ServiceAccount { + * Metadata describing an Operation. + */ + export interface Schema$OperationMetadata { + /** + * This field is deprecated. Use `labels` instead. Optionally provided by + * the caller when submitting the request that creates the operation. + */ + clientId: string; + /** + * The time at which the job was submitted to the Genomics service. + */ + createTime: string; + /** + * The time at which the job stopped running. + */ + endTime: string; + /** + * Optional event messages that were generated during the job's + * execution. This also contains any warnings that were generated during + * import or export. + */ + events: Schema$OperationEvent[]; + /** + * Optionally provided by the caller when submitting the request that + * creates the operation. + */ + labels: any; + /** + * The Google Cloud Project in which the job is scoped. + */ + projectId: string; + /** + * The original request that started the operation. Note that this will be + * in current version of the API. If the operation was started with v1beta2 + * API and a GetOperation is performed on v1 API, a v1 request will be + * returned. + */ + request: any; + /** + * Runtime metadata on this Operation. + */ + runtimeMetadata: any; + /** + * The time at which the job began to run. + */ + startTime: string; + } /** - * Email address of the service account. Defaults to `default`, which uses the - * compute service account associated with the project. - */ - email: string; + * The pipeline object. Represents a transformation from a set of input + * parameters to a set of output parameters. The transformation is defined as + * a docker image and command to run within that image. Each pipeline is run + * on a Google Compute Engine VM. A pipeline can be created with the `create` + * method and then later run with the `run` method, or a pipeline can be + * defined and run all at once with the `run` method. + */ + export interface Schema$Pipeline { + /** + * User-specified description. + */ + description: string; + /** + * Specifies the docker run information. + */ + docker: Schema$DockerExecutor; + /** + * Input parameters of the pipeline. + */ + inputParameters: Schema$PipelineParameter[]; + /** + * Required. A user specified pipeline name that does not have to be unique. + * This name can be used for filtering Pipelines in ListPipelines. + */ + name: string; + /** + * Output parameters of the pipeline. + */ + outputParameters: Schema$PipelineParameter[]; + /** + * Unique pipeline id that is generated by the service when CreatePipeline + * is called. Cannot be specified in the Pipeline used in the + * CreatePipelineRequest, and will be populated in the response to + * CreatePipeline and all subsequent Get and List calls. Indicates that the + * service has registered this pipeline. + */ + pipelineId: string; + /** + * Required. The project in which to create the pipeline. The caller must + * have WRITE access. + */ + projectId: string; + /** + * Required. Specifies resource requirements for the pipeline run. Required + * fields: * minimumCpuCores * minimumRamGb + */ + resources: Schema$PipelineResources; + } /** - * List of scopes to be enabled for this service account on the VM. The - * following scopes are automatically included: * - * https://www.googleapis.com/auth/compute * - * https://www.googleapis.com/auth/devstorage.full_control * - * https://www.googleapis.com/auth/genomics * - * https://www.googleapis.com/auth/logging.write * - * https://www.googleapis.com/auth/monitoring.write - */ - scopes: string[]; -} -/** - * Request to set operation status. Should only be used by VMs created by the - * Pipelines Service and not by end users. - */ -export interface Schema$SetOperationStatusRequest { - errorCode: string; - errorMessage: string; - operationId: string; - timestampEvents: Schema$TimestampEvent[]; - validationToken: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Parameters facilitate setting and delivering data into the pipeline's + * execution environment. They are defined at create time, with optional + * defaults, and can be overridden at run time. If `localCopy` is unset, then + * the parameter specifies a string that is passed as-is into the pipeline, as + * the value of the environment variable with the given name. A default value + * can be optionally specified at create time. The default can be overridden + * at run time using the inputs map. If no default is given, a value must be + * supplied at runtime. If `localCopy` is defined, then the parameter + * specifies a data source or sink, both in Google Cloud Storage and on the + * Docker container where the pipeline computation is run. The service account + * associated with the Pipeline (by default the project's Compute Engine + * service account) must have access to the Google Cloud Storage paths. At + * run time, the Google Cloud Storage paths can be overridden if a default was + * provided at create time, or must be set otherwise. The pipeline runner + * should add a key/value pair to either the inputs or outputs map. The + * indicated data copies will be carried out before/after pipeline execution, + * just as if the corresponding arguments were provided to `gsutil cp`. For + * example: Given the following `PipelineParameter`, specified in the + * `inputParameters` list: ``` {name: "input_file", localCopy: + * {path: "file.txt", disk: "pd1"}} ``` where `disk` is + * defined in the `PipelineResources` object as: ``` {name: "pd1", + * mountPoint: "/mnt/disk/"} ``` We create a disk named `pd1`, + * mount it on the host VM, and map `/mnt/pd1` to `/mnt/disk` in the docker + * container. At runtime, an entry for `input_file` would be required in the + * inputs map, such as: ``` inputs["input_file"] = + * "gs://my-bucket/bar.txt" ``` This would generate the following + * gsutil call: ``` gsutil cp gs://my-bucket/bar.txt /mnt/pd1/file.txt ``` + * The file `/mnt/pd1/file.txt` maps to `/mnt/disk/file.txt` in the Docker + * container. Acceptable paths are: <table> <thead> + * <tr><th>Google Cloud storage path</th><th>Local + * path</th></tr> </thead> <tbody> + * <tr><td>file</td><td>file</td></tr> + * <tr><td>glob</td><td>directory</td></tr> + * </tbody> </table> For outputs, the direction of the copy is + * reversed: ``` gsutil cp /mnt/disk/file.txt gs://my-bucket/bar.txt ``` + * Acceptable paths are: <table> <thead> + * <tr><th>Local path</th><th>Google Cloud Storage + * path</th></tr> </thead> <tbody> + * <tr><td>file</td><td>file</td></tr> + * <tr> <td>file</td> <td>directory - + * directory must already exist</td> </tr> <tr> + * <td>glob</td> <td>directory - directory will be + * created if it doesn't exist</td></tr> </tbody> + * </table> One restriction due to docker limitations, is that for + * outputs that are found on the boot disk, the local path cannot be a glob + * and must be a file. + */ + export interface Schema$PipelineParameter { + /** + * The default value for this parameter. Can be overridden at runtime. If + * `localCopy` is present, then this must be a Google Cloud Storage path + * beginning with `gs://`. + */ + defaultValue: string; + /** + * Human-readable description. + */ + description: string; + /** + * If present, this parameter is marked for copying to and from the VM. + * `LocalCopy` indicates where on the VM the file should be. The value given + * to this parameter (either at runtime or using `defaultValue`) must be the + * remote path where the file should be. + */ + localCopy: Schema$LocalCopy; + /** + * Required. Name of the parameter - the pipeline runner uses this string as + * the key to the input and output maps in RunPipeline. + */ + name: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The system resources for the pipeline run. + */ + export interface Schema$PipelineResources { + /** + * Optional. The number of accelerators of the specified type to attach. By + * specifying this parameter, you will download and install the following + * third-party software onto your managed Compute Engine instances: NVIDIA® + * Tesla® drivers and NVIDIA® CUDA toolkit. + */ + acceleratorCount: string; + /** + * Optional. The Compute Engine defined accelerator type. By specifying this + * parameter, you will download and install the following third-party + * software onto your managed Compute Engine instances: NVIDIA® Tesla® + * drivers and NVIDIA® CUDA toolkit. Please see + * https://cloud.google.com/compute/docs/gpus/ for a list of available + * accelerator types. + */ + acceleratorType: string; + /** + * The size of the boot disk. Defaults to 10 (GB). + */ + bootDiskSizeGb: number; + /** + * Disks to attach. + */ + disks: Schema$Disk[]; + /** + * The minimum number of cores to use. Defaults to 1. + */ + minimumCpuCores: number; + /** + * The minimum amount of RAM to use. Defaults to 3.75 (GB) + */ + minimumRamGb: number; + /** + * Whether to assign an external IP to the instance. This is an experimental + * feature that may go away. Defaults to false. Corresponds to + * `--no_address` flag for [gcloud compute instances create] + * (https://cloud.google.com/sdk/gcloud/reference/compute/instances/create). + * In order to use this, must be true for both create time and run time. + * Cannot be true at run time if false at create time. If you need to ssh + * into a private IP VM for debugging, you can ssh to a public VM and then + * ssh into the private VM's Internal IP. If noAddress is set, this + * pipeline run may only load docker images from Google Container Registry + * and not Docker Hub. Before using this, you must [configure access to + * Google services from internal + * IPs](https://cloud.google.com/compute/docs/configure-private-google-access#configuring_access_to_google_services_from_internal_ips). + */ + noAddress: boolean; + /** + * Whether to use preemptible VMs. Defaults to `false`. In order to use + * this, must be true for both create time and run time. Cannot be true at + * run time if false at create time. + */ + preemptible: boolean; + /** + * List of Google Compute Engine availability zones to which resource + * creation will restricted. If empty, any zone may be chosen. + */ + zones: string[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * This event is generated when the worker starts pulling an image. */ - details: any[]; + export interface Schema$PullStartedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * This event is generated when the worker stops pulling an image. */ - message: string; -} -/** - * Stores the list of events and times they occured for major events in job - * execution. - */ -export interface Schema$TimestampEvent { + export interface Schema$PullStoppedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } + export interface Schema$RepeatedString { values: string[]; } + /** + * The pipeline run arguments. + */ + export interface Schema$RunPipelineArgs { + /** + * This field is deprecated. Use `labels` instead. Client-specified pipeline + * operation identifier. + */ + clientId: string; + /** + * Pipeline input arguments; keys are defined in the pipeline documentation. + * All input parameters that do not have default values must be specified. + * If parameters with defaults are specified here, the defaults will be + * overridden. + */ + inputs: any; + /** + * How long to keep the VM up after a failure (for example docker command + * failed, copying input or output files failed, etc). While the VM is up, + * one can ssh into the VM to debug. Default is 0; maximum allowed value is + * 1 day. + */ + keepVmAliveOnFailureDuration: string; + /** + * Labels to apply to this pipeline run. Labels will also be applied to + * compute resources (VM, disks) created by this pipeline run. When listing + * operations, operations can filtered by labels. Label keys may not be + * empty; label values may be empty. Non-empty labels must be 1-63 + * characters long, and comply with [RFC1035] + * (https://www.ietf.org/rfc/rfc1035.txt). Specifically, the name must be + * 1-63 characters long and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a + * lowercase letter, and all following characters must be a dash, lowercase + * letter, or digit, except the last character, which cannot be a dash. + */ + labels: any; + /** + * Required. Logging options. Used by the service to communicate results to + * the user. + */ + logging: Schema$LoggingOptions; + /** + * Pipeline output arguments; keys are defined in the pipeline + * documentation. All output parameters of without default values must be + * specified. If parameters with defaults are specified here, the defaults + * will be overridden. + */ + outputs: any; + /** + * Required. The project in which to run the pipeline. The caller must have + * WRITER access to all Google Cloud services and resources (e.g. Google + * Compute Engine) will be used. + */ + projectId: string; + /** + * Specifies resource requirements/overrides for the pipeline run. + */ + resources: Schema$PipelineResources; + /** + * The Google Cloud Service Account that will be used to access data and + * services. By default, the compute service account associated with + * `projectId` is used. + */ + serviceAccount: Schema$ServiceAccount; + } /** - * String indicating the type of event - */ - description: string; + * The request to run a pipeline. If `pipelineId` is specified, it refers to a + * saved pipeline created with CreatePipeline and set as the `pipelineId` of + * the returned Pipeline object. If `ephemeralPipeline` is specified, that + * pipeline is run once with the given args and not saved. It is an error to + * specify both `pipelineId` and `ephemeralPipeline`. `pipelineArgs` must be + * specified. + */ + export interface Schema$RunPipelineRequest { + /** + * A new pipeline object to run once and then delete. + */ + ephemeralPipeline: Schema$Pipeline; + /** + * The arguments to use when running this pipeline. + */ + pipelineArgs: Schema$RunPipelineArgs; + /** + * The already created pipeline to run. + */ + pipelineId: string; + } /** - * The time this event occured. + * Runtime metadata that will be populated in the runtimeMetadata field of the + * Operation associated with a RunPipeline execution. */ - timestamp: string; -} -/** - * This event is generated when the execution of a container results in a - * non-zero exit status that was not otherwise ignored. Execution will - * continue, but only actions that are flagged as ALWAYS_RUN will be executed: - * other actions will be skipped. - */ -export interface Schema$UnexpectedExitStatusEvent { + export interface Schema$RuntimeMetadata { + /** + * Execution information specific to Google Compute Engine. + */ + computeEngine: Schema$ComputeEngine; + } /** - * The numeric ID of the action that started the container. - */ - actionId: number; + * A Google Cloud Service Account. + */ + export interface Schema$ServiceAccount { + /** + * Email address of the service account. Defaults to `default`, which uses + * the compute service account associated with the project. + */ + email: string; + /** + * List of scopes to be enabled for this service account on the VM. The + * following scopes are automatically included: * + * https://www.googleapis.com/auth/compute * + * https://www.googleapis.com/auth/devstorage.full_control * + * https://www.googleapis.com/auth/genomics * + * https://www.googleapis.com/auth/logging.write * + * https://www.googleapis.com/auth/monitoring.write + */ + scopes: string[]; + } /** - * The exit status of the container. + * Request to set operation status. Should only be used by VMs created by the + * Pipelines Service and not by end users. */ - exitStatus: number; -} -/** - * This event is generated once a worker VM has been assigned to run the - * pipeline. - */ -export interface Schema$WorkerAssignedEvent { + export interface Schema$SetOperationStatusRequest { + errorCode: string; + errorMessage: string; + operationId: string; + timestampEvents: Schema$TimestampEvent[]; + validationToken: string; + } /** - * The worker's instance name. - */ - instance: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The zone the worker is running in. - */ - zone: string; -} -/** - * This event is generated when the worker VM that was assigned to the pipeline - * has been released (i.e., deleted). - */ -export interface Schema$WorkerReleasedEvent { + * Stores the list of events and times they occured for major events in job + * execution. + */ + export interface Schema$TimestampEvent { + /** + * String indicating the type of event + */ + description: string; + /** + * The time this event occured. + */ + timestamp: string; + } /** - * The worker's instance name. - */ - instance: string; + * This event is generated when the execution of a container results in a + * non-zero exit status that was not otherwise ignored. Execution will + * continue, but only actions that are flagged as ALWAYS_RUN will be executed: + * other actions will be skipped. + */ + export interface Schema$UnexpectedExitStatusEvent { + /** + * The numeric ID of the action that started the container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * The zone the worker was running in. - */ - zone: string; -} - -export class Resource$Operations { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); + * This event is generated once a worker VM has been assigned to run the + * pipeline. + */ + export interface Schema$WorkerAssignedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker is running in. + */ + zone: string; } - - getRoot() { - return this.root; + /** + * This event is generated when the worker VM that was assigned to the + * pipeline has been released (i.e., deleted). + */ + export interface Schema$WorkerReleasedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker was running in. + */ + zone: string; } - - /** - * genomics.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. Clients may use Operations.GetOperation or - * Operations.ListOperations to check whether the cancellation succeeded or - * the operation completed despite cancellation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.operations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * genomics.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'operations/my-operation', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.operations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * genomics.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. Clients may use Operations.GetOperation or + * Operations.ListOperations to check whether the cancellation succeeded or + * the operation completed despite cancellation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be cancelled. + * name: 'operations/my-operation', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.operations.cancel(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.operations.list - * @desc Lists operations that match the specified filter in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation's parent resource. - * name: 'operations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.operations.list(request, handlePage); - * } - * }; - * - * genomics.operations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * genomics.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource. + * name: 'operations/my-operation', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.operations.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Pipelines { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * genomics.operations.list + * @desc Lists operations that match the specified filter in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation's parent resource. + * name: 'operations', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.operations.list(request, handlePage); + * } + * }; + * + * genomics.operations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * genomics.pipelines.create - * @desc Creates a pipeline that can be run later. Create takes a Pipeline - * that has all fields other than `pipelineId` populated, and then returns the - * same pipeline with `pipelineId` populated. This id can be used to run the - * pipeline. Caller must have WRITE permission to the project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.pipelines.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Pipeline} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Pipelines { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1alpha2/pipelines').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * genomics.pipelines.delete - * @desc Deletes a pipeline based on ID. Caller must have WRITE permission to - * the project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // Caller must have WRITE access to the project in which this pipeline - * // is defined. - * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.pipelines.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.pipelineId Caller must have WRITE access to the project in which this pipeline is defined. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * genomics.pipelines.create + * @desc Creates a pipeline that can be run later. Create takes a Pipeline + * that has all fields other than `pipelineId` populated, and then returns + * the same pipeline with `pipelineId` populated. This id can be used to run + * the pipeline. Caller must have WRITE permission to the project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.pipelines.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Pipeline} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/pipelines/{pipelineId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['pipelineId'], - pathParams: ['pipelineId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.pipelines.get - * @desc Retrieves a pipeline based on ID. Caller must have READ permission - * to the project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * // Caller must have READ access to the project in which this pipeline - * // is defined. - * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * genomics.pipelines.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.pipelineId Caller must have READ access to the project in which this pipeline is defined. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/pipelines/{pipelineId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['pipelineId'], - pathParams: ['pipelineId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * genomics.pipelines.delete + * @desc Deletes a pipeline based on ID. Caller must have WRITE permission + * to the project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * // Caller must have WRITE access to the project in which this + * pipeline + * // is defined. + * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.pipelines.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.pipelineId Caller must have WRITE access to the project in which this pipeline is defined. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines/{pipelineId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['pipelineId'], + pathParams: ['pipelineId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * genomics.pipelines.getControllerConfig - * @desc Gets controller configuration information. Should only be called by - * VMs created by the Pipelines Service and not by end users. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * genomics.pipelines.getControllerConfig(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.getControllerConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.operationId The operation to retrieve controller configuration for. - * @param {string=} params.validationToken - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getControllerConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getControllerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getControllerConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * genomics.pipelines.get + * @desc Retrieves a pipeline based on ID. Caller must have READ permission + * to the project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * // Caller must have READ access to the project in which this pipeline + * // is defined. + * pipelineId: 'my-pipeline-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * genomics.pipelines.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.pipelineId Caller must have READ access to the project in which this pipeline is defined. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines/{pipelineId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['pipelineId'], + pathParams: ['pipelineId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/pipelines:getControllerConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.pipelines.list - * @desc Lists pipelines. Caller must have READ permission to the project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var pipelinesPage = response['pipelines']; - * if (!pipelinesPage) { - * return; - * } - * for (var i = 0; i < pipelinesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `pipelinesPage`: console.log(JSON.stringify(pipelinesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * genomics.pipelines.list(request, handlePage); - * } - * }; - * - * genomics.pipelines.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.namePrefix Pipelines with names that match this prefix should be returned. If unspecified, all pipelines in the project, up to `pageSize`, will be returned. - * @param {integer=} params.pageSize Number of pipelines to return at once. Defaults to 256, and max is 2048. - * @param {string=} params.pageToken Token to use to indicate where to start getting results. If unspecified, returns the first page of results. - * @param {string=} params.projectId Required. The name of the project to search for pipelines. Caller must have READ access to this project. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * genomics.pipelines.getControllerConfig + * @desc Gets controller configuration information. Should only be called by + * VMs created by the Pipelines Service and not by end users. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * genomics.pipelines.getControllerConfig(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.getControllerConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.operationId The operation to retrieve controller configuration for. + * @param {string=} params.validationToken + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getControllerConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getControllerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getControllerConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines:getControllerConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1alpha2/pipelines').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.pipelines.run - * @desc Runs a pipeline. If `pipelineId` is specified in the request, then - * run a saved pipeline. If `ephemeralPipeline` is specified, then run that - * pipeline once without saving a copy. The caller must have READ permission - * to the project where the pipeline is stored and WRITE permission to the - * project where the pipeline will be run, as VMs will be created and storage - * will be used. If a pipeline operation is still running after 6 days, it - * will be canceled. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * genomics.pipelines.run(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().RunPipelineRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * genomics.pipelines.list + * @desc Lists pipelines. Caller must have READ permission to the project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var pipelinesPage = response['pipelines']; + * if (!pipelinesPage) { + * return; + * } + * for (var i = 0; i < pipelinesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `pipelinesPage`: console.log(JSON.stringify(pipelinesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * genomics.pipelines.list(request, handlePage); + * } + * }; + * + * genomics.pipelines.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.namePrefix Pipelines with names that match this prefix should be returned. If unspecified, all pipelines in the project, up to `pageSize`, will be returned. + * @param {integer=} params.pageSize Number of pipelines to return at once. Defaults to 256, and max is 2048. + * @param {string=} params.pageToken Token to use to indicate where to start getting results. If unspecified, returns the first page of results. + * @param {string=} params.projectId Required. The name of the project to search for pipelines. Caller must have READ access to this project. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/pipelines:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.pipelines.setOperationStatus - * @desc Sets status of a given operation. Any new timestamps (as determined - * by description) are appended to TimestampEvents. Should only be called by - * VMs created by the Pipelines Service and not by end users. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Genomics API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/genomics - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var genomics = google.genomics('v1alpha2'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * genomics.pipelines.setOperationStatus(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias genomics.pipelines.setOperationStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SetOperationStatusRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setOperationStatus(params?: any, options?: MethodOptions): - AxiosPromise; - setOperationStatus( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setOperationStatus( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * genomics.pipelines.run + * @desc Runs a pipeline. If `pipelineId` is specified in the request, then + * run a saved pipeline. If `ephemeralPipeline` is specified, then run that + * pipeline once without saving a copy. The caller must have READ + * permission to the project where the pipeline is stored and WRITE + * permission to the project where the pipeline will be run, as VMs will be + * created and storage will be used. If a pipeline operation is still + * running after 6 days, it will be canceled. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * genomics.pipelines.run(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().RunPipelineRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha2/pipelines:setOperationStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * genomics.pipelines.setOperationStatus + * @desc Sets status of a given operation. Any new timestamps (as determined + * by description) are appended to TimestampEvents. Should only be called by + * VMs created by the Pipelines Service and not by end users. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Genomics API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/genomics + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var genomics = google.genomics('v1alpha2'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * genomics.pipelines.setOperationStatus(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias genomics.pipelines.setOperationStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SetOperationStatusRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setOperationStatus(params?: any, options?: MethodOptions): + AxiosPromise; + setOperationStatus( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setOperationStatus( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha2/pipelines:setOperationStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/genomics/v2alpha1.ts b/src/apis/genomics/v2alpha1.ts index 70d87be220e..d72fffc66f3 100644 --- a/src/apis/genomics/v2alpha1.ts +++ b/src/apis/genomics/v2alpha1.ts @@ -27,1091 +27,1106 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Genomics API - * - * Upload, process, query, and search Genomics data in the cloud. - * - * @example - * const google = require('googleapis'); - * const genomics = google.genomics('v2alpha1'); - * - * @namespace genomics - * @type {Function} - * @version v2alpha1 - * @variation v2alpha1 - * @param {object=} options Options for Genomics - */ -export class Genomics { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace genomics_v2alpha1 { + /** + * Genomics API + * + * Upload, process, query, and search Genomics data in the cloud. + * + * @example + * const google = require('googleapis'); + * const genomics = google.genomics('v2alpha1'); + * + * @namespace genomics + * @type {Function} + * @version v2alpha1 + * @variation v2alpha1 + * @param {object=} options Options for Genomics + */ + export class Genomics { + _options: GlobalOptions; + google: GoogleApis; + root = this; - pipelines: Resource$Pipelines; - projects: Resource$Projects; - workers: Resource$Workers; + pipelines: Resource$Pipelines; + projects: Resource$Projects; + workers: Resource$Workers; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.pipelines = new Resource$Pipelines(this); - this.projects = new Resource$Projects(this); - this.workers = new Resource$Workers(this); - } + this.pipelines = new Resource$Pipelines(this); + this.projects = new Resource$Projects(this); + this.workers = new Resource$Workers(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Action specifies a single action that runs a docker container. - */ -export interface Schema$Action { - /** - * If specified, overrides the CMD specified in the container. If the - * container also has an ENTRYPOINT the values are used as entrypoint - * arguments. Otherwise, they are used as a command and arguments to run - * inside the container. - */ - commands: string[]; - /** - * If specified, overrides the ENTRYPOINT specified in the container. - */ - entrypoint: string; - /** - * The environment to pass into the container. This environment is merged - * with any values specified in the Pipeline message. These values overwrite - * any in the Pipeline message. In addition to the values passed here, a few - * other values are automatically injected into the environment. These cannot - * be hidden or overwritten. `GOOGLE_PIPELINE_FAILED` will be set to - * "1" if the pipeline has failed because an action has exited with - * a non-zero status (and did not have the IGNORE_EXIT_STATUS flag set). This - * can be used to determine if additional debug or logging actions should - * execute. `GOOGLE_LAST_EXIT_STATUS` will be set to the exit status of the - * last non-background action that executed. This can be used by workflow - * engine authors to determine whether an individual action has succeeded or - * failed. - */ - environment: any; - /** - * The set of flags to apply to this action. - */ - flags: string[]; - /** - * The URI to pull the container image from. Note that all images referenced - * by actions in the pipeline are pulled before the first action runs. If - * multiple actions reference the same image, it is only pulled once, ensuring - * that the same image is used for all actions in a single pipeline. - */ - imageUri: string; - /** - * Labels to associate with the action. This field is provided to assist - * workflow engine authors in identifying actions (for example, to indicate - * what sort of action they perform: eg. localization, debugging, etc). They - * are returned in the operation metadata but are otherwise ignored. - */ - labels: any; - /** - * A list of mounts to make available to the action. In addition to the - * values specified here, every action has a special virtual disk mounted - * under /google that contains log files and other operational components. - * <ul> <li><code>/google/logs</code>: all logs - * written during the pipeline execution are stored here.</li> - * <li><code>/google/logs/output</code>: the combined - * standard output and standard error of all actions run as part of the - * pipeline execution.</li> - * <li><code>/google/logs/action/x/stdout</code>: the - * complete contents of each individual action's standard - * output</li> - * <li><code>/google/logs/action/x/stderr</code>: the - * complete contents of each individual action's standard error - * output</li> </ul> - */ - mounts: Schema$Mount[]; - /** - * An optional name for the container. The container hostname will be set to - * this name, making it useful for inter-container communication. The name - * must contain only upper and lowercase alphanumeric characters and hypens - * and cannot start with a hypen. - */ - name: string; - /** - * The PID namespace to run the action inside. If unspecified, a separate - * isolated namespace is used. - */ - pidNamespace: string; - /** - * A map of container to host port mappings for this container. Note that if - * the container already specifies exposed ports, the PUBLISH_EXPOSED_PORTS - * flag should be used instead. The host port number must be less than 65536. - * If it is zero, an unused random port is assigned. To determine the - * resulting port number, consult the ContainerStartedEvent in the operation - * metadata. - */ - portMappings: any; -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * The parameters to the CheckIn method. - */ -export interface Schema$CheckInRequest { - /** - * The deadline has expired and the worker needs more time. - */ - deadlineExpired: Schema$Empty; - /** - * A workflow specific event occurred. - */ - event: any; - /** - * The operation has finished with the given result. - */ - result: Schema$Status; -} -/** - * The response to the CheckIn method. - */ -export interface Schema$CheckInResponse { - /** - * The deadline by which the worker must request an extension. The backend - * will allow for network transmission time and other delays, but the worker - * must attempt to transmit the extension request no later than the deadline. - */ - deadline: string; - /** - * The metadata that describes the operation assigned to the worker. - */ - metadata: any; -} -/** - * Describes a Compute Engine resource that is being managed by a running - * pipeline. - */ -export interface Schema$ComputeEngine { - /** - * The names of the disks that were created for this pipeline. - */ - diskNames: string[]; - /** - * The instance on which the operation is running. - */ - instanceName: string; - /** - * The machine type of the instance. - */ - machineType: string; - /** - * The availability zone in which the instance resides. - */ - zone: string; -} -/** - * This event is generated when a container starts. - */ -export interface Schema$ContainerStartedEvent { - /** - * The numeric ID of the action that started this container. - */ - actionId: number; - /** - * The public IP address that can be used to connect to the container. This - * field is only populated when at least one port mapping is present. If the - * instance was created with a private address this field will be empty even - * if port mappings exist. - */ - ipAddress: string; - /** - * The container to host port mappings installed for this container. This set - * will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag as well - * as any specified in the Action definition. - */ - portMappings: any; -} -/** - * This event is generated when a container exits. - */ -export interface Schema$ContainerStoppedEvent { - /** - * The numeric ID of the action that started this container. - */ - actionId: number; - /** - * The exit status of the container. - */ - exitStatus: number; -} -/** - * This event is generated whenever a resource limitation or transient error - * delays execution of a pipeline that was otherwise ready to run. - */ -export interface Schema$DelayedEvent { - /** - * A textual description of the cause of the delay. The string may change - * without notice since it is often generated by another service (such as - * Compute Engine). - */ - cause: string; - /** - * If the delay was caused by a resource shortage, this field lists the - * Compute Engine metrics that are preventing this operation from running (for - * example, CPUS or INSTANCES). If the particular metric is not known, a - * single UNKNOWN metric will be present. - */ - metrics: string[]; -} -/** - * Carries information about a disk that can be attached to a VM. - */ -export interface Schema$Disk { - /** - * A user supplied name for the disk, used when mounting it into actions. The - * name must contain only upper and lowercase alphanumeric characters and - * hypens and cannot start with a hypen. - */ - name: string; - /** - * The size, in gigabytes, of the disk to attach. Note that this value is not - * configurable for some disk types such as local-ssd. If the size is not - * specified, a size of at least 500gb is used to ensure reasonable I/O - * performance. - */ - sizeGb: number; - /** - * An optional image to put on the disk before attaching it to the VM. - */ - sourceImage: string; - /** - * The Compute Engine disk type. If unspecified, 'standard-pd' is - * used. - */ - type: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Event carries information about events that occur during pipeline execution. - */ -export interface Schema$Event { - /** - * A human readable description of the event. Note that these strings may - * change at any time without notice. Any application logic must use the - * information in the details field. - */ - description: string; - /** - * Machine readable details about the event. - */ - details: any; - /** - * The time that the event occurred. - */ - timestamp: string; -} -/** - * This event is generated when the execution of a pipeline has failed. Note - * that other events may continue to occur after this event. - */ -export interface Schema$FailedEvent { - /** - * The human readable description of the cause of the failure. - */ - cause: string; - /** - * The Google standard error code that best describes this failure. - */ - code: string; -} -/** - * The read group set import response. - */ -export interface Schema$ImportReadGroupSetsResponse { - /** - * IDs of the read group sets that were created. - */ - readGroupSetIds: string[]; -} -/** - * The variant data import response. - */ -export interface Schema$ImportVariantsResponse { - /** - * IDs of the call sets created during the import. - */ - callSetIds: string[]; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Metadata carries information about the pipeline execution that is returned in - * the long running operation's metadata field. - */ -export interface Schema$Metadata { - /** - * The time that the operation was created by the API. - */ - createTime: string; - /** - * The list of events that have happened so far during the execution of this - * operation. - */ - events: Schema$Event[]; - /** - * The user defined labels associated with this operation. - */ - labels: any; - /** - * The pipeline this operation represents. - */ - pipeline: Schema$Pipeline; -} -/** - * Mount carries information about a particular disk mount inside a container. - */ -export interface Schema$Mount { - /** - * The name of the disk to mount, as specified in the resources section. - */ - disk: string; - /** - * The path to mount the disk at inside the container. - */ - path: string; - /** - * If true, the disk is mounted read only inside the container. - */ - readOnly: boolean; -} -/** - * VM networking options. - */ -export interface Schema$Network { - /** - * The network name to attach the VM's network interface to. If - * unspecified, the global default network is used. - */ - name: string; - /** - * If set to true, do not attach a public IP address to the VM. Note that - * without an public IP address, additional configuration is required to allow - * the VM to access Google services. See - * https://cloud.google.com/vpc/docs/configure-private-google-access for more - * information. - */ - usePrivateAddress: boolean; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * An OperationMetadata or Metadata object. This will always be returned with - * the Operation. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. For example&#58; - * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` - */ - name: string; - /** - * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If - * importing Variants, an ImportVariantsResponse is returned. For pipelines - * and exports, an Empty response is returned. - */ - response: any; -} -/** - * An event that occurred during an Operation. - */ -export interface Schema$OperationEvent { - /** - * Required description of event. - */ - description: string; - /** - * Optional time of when event finished. An event can have a start time and no - * finish time. If an event has a finish time, there must be a start time. - */ - endTime: string; - /** - * Optional time of when event started. - */ - startTime: string; -} -/** - * Metadata describing an Operation. - */ -export interface Schema$OperationMetadata { - /** - * This field is deprecated. Use `labels` instead. Optionally provided by the - * caller when submitting the request that creates the operation. - */ - clientId: string; - /** - * The time at which the job was submitted to the Genomics service. - */ - createTime: string; /** - * The time at which the job stopped running. - */ - endTime: string; - /** - * Optional event messages that were generated during the job's execution. - * This also contains any warnings that were generated during import or - * export. - */ - events: Schema$OperationEvent[]; - /** - * Optionally provided by the caller when submitting the request that creates - * the operation. - */ - labels: any; - /** - * The Google Cloud Project in which the job is scoped. - */ - projectId: string; - /** - * The original request that started the operation. Note that this will be in - * current version of the API. If the operation was started with v1beta2 API - * and a GetOperation is performed on v1 API, a v1 request will be returned. - */ - request: any; - /** - * Runtime metadata on this Operation. - */ - runtimeMetadata: any; - /** - * The time at which the job began to run. - */ - startTime: string; -} -/** - * The Pipeline object describes a series of actions to execute, expressed as - * docker containers. - */ -export interface Schema$Pipeline { - /** - * The list of actions to execute, in the order they are specified. - */ - actions: Schema$Action[]; - /** - * The environment to pass into every action. Each action may also specify - * additional environment variables but cannot delete an entry from this map - * (though they may overwrite it with a different value). - */ - environment: any; - /** - * The resources required for execution. - */ - resources: Schema$Resources; -} -/** - * This event is generated when the worker starts pulling an image. - */ -export interface Schema$PullStartedEvent { + * Action specifies a single action that runs a docker container. + */ + export interface Schema$Action { + /** + * If specified, overrides the CMD specified in the container. If the + * container also has an ENTRYPOINT the values are used as entrypoint + * arguments. Otherwise, they are used as a command and arguments to run + * inside the container. + */ + commands: string[]; + /** + * If specified, overrides the ENTRYPOINT specified in the container. + */ + entrypoint: string; + /** + * The environment to pass into the container. This environment is merged + * with any values specified in the Pipeline message. These values + * overwrite any in the Pipeline message. In addition to the values passed + * here, a few other values are automatically injected into the environment. + * These cannot be hidden or overwritten. `GOOGLE_PIPELINE_FAILED` will be + * set to "1" if the pipeline has failed because an action has + * exited with a non-zero status (and did not have the IGNORE_EXIT_STATUS + * flag set). This can be used to determine if additional debug or logging + * actions should execute. `GOOGLE_LAST_EXIT_STATUS` will be set to the + * exit status of the last non-background action that executed. This can be + * used by workflow engine authors to determine whether an individual action + * has succeeded or failed. + */ + environment: any; + /** + * The set of flags to apply to this action. + */ + flags: string[]; + /** + * The URI to pull the container image from. Note that all images + * referenced by actions in the pipeline are pulled before the first action + * runs. If multiple actions reference the same image, it is only pulled + * once, ensuring that the same image is used for all actions in a single + * pipeline. + */ + imageUri: string; + /** + * Labels to associate with the action. This field is provided to assist + * workflow engine authors in identifying actions (for example, to indicate + * what sort of action they perform: eg. localization, debugging, etc). They + * are returned in the operation metadata but are otherwise ignored. + */ + labels: any; + /** + * A list of mounts to make available to the action. In addition to the + * values specified here, every action has a special virtual disk mounted + * under /google that contains log files and other operational components. + * <ul> <li><code>/google/logs</code>: all logs + * written during the pipeline execution are stored here.</li> + * <li><code>/google/logs/output</code>: the combined + * standard output and standard error of all actions run as part of the + * pipeline execution.</li> + * <li><code>/google/logs/action/x/stdout</code>: the + * complete contents of each individual action's standard + * output</li> + * <li><code>/google/logs/action/x/stderr</code>: the + * complete contents of each individual action's standard error + * output</li> </ul> + */ + mounts: Schema$Mount[]; + /** + * An optional name for the container. The container hostname will be set + * to this name, making it useful for inter-container communication. The + * name must contain only upper and lowercase alphanumeric characters and + * hypens and cannot start with a hypen. + */ + name: string; + /** + * The PID namespace to run the action inside. If unspecified, a separate + * isolated namespace is used. + */ + pidNamespace: string; + /** + * A map of container to host port mappings for this container. Note that + * if the container already specifies exposed ports, the + * PUBLISH_EXPOSED_PORTS flag should be used instead. The host port number + * must be less than 65536. If it is zero, an unused random port is + * assigned. To determine the resulting port number, consult the + * ContainerStartedEvent in the operation metadata. + */ + portMappings: any; + } /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -/** - * This event is generated when the worker stops pulling an image. - */ -export interface Schema$PullStoppedEvent { + * The request message for Operations.CancelOperation. + */ + export interface Schema$CancelOperationRequest {} + /** + * The parameters to the CheckIn method. + */ + export interface Schema$CheckInRequest { + /** + * The deadline has expired and the worker needs more time. + */ + deadlineExpired: Schema$Empty; + /** + * A workflow specific event occurred. + */ + event: any; + /** + * The operation has finished with the given result. + */ + result: Schema$Status; + } /** - * The URI of the image that was pulled. - */ - imageUri: string; -} -/** - * The system resources for the pipeline run. At least one zone or region must - * be specified or the pipeline run will fail. - */ -export interface Schema$Resources { + * The response to the CheckIn method. + */ + export interface Schema$CheckInResponse { + /** + * The deadline by which the worker must request an extension. The backend + * will allow for network transmission time and other delays, but the worker + * must attempt to transmit the extension request no later than the + * deadline. + */ + deadline: string; + /** + * The metadata that describes the operation assigned to the worker. + */ + metadata: any; + } /** - * The customer project ID to allocate resources in. - */ - projectId: string; + * Describes a Compute Engine resource that is being managed by a running + * pipeline. + */ + export interface Schema$ComputeEngine { + /** + * The names of the disks that were created for this pipeline. + */ + diskNames: string[]; + /** + * The instance on which the operation is running. + */ + instanceName: string; + /** + * The machine type of the instance. + */ + machineType: string; + /** + * The availability zone in which the instance resides. + */ + zone: string; + } /** - * The list of regions allowed for VM allocation. If set, the zones field - * must not be set. - */ - regions: string[]; + * This event is generated when a container starts. + */ + export interface Schema$ContainerStartedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The public IP address that can be used to connect to the container. This + * field is only populated when at least one port mapping is present. If + * the instance was created with a private address this field will be empty + * even if port mappings exist. + */ + ipAddress: string; + /** + * The container to host port mappings installed for this container. This + * set will contain any ports exposed using the PUBLISH_EXPOSED_PORTS flag + * as well as any specified in the Action definition. + */ + portMappings: any; + } /** - * The virtual machine specification. - */ - virtualMachine: Schema$VirtualMachine; + * This event is generated when a container exits. + */ + export interface Schema$ContainerStoppedEvent { + /** + * The numeric ID of the action that started this container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * The list of zones allowed for VM allocation. If set, the regions field - * must not be set. - */ - zones: string[]; -} -/** - * The arguments to the RunPipeline method. The requesting user must have the - * iam.serviceAccounts.actAs permission for the Google Genomics Service Account - * or the request will fail. - */ -export interface Schema$RunPipelineRequest { + * This event is generated whenever a resource limitation or transient error + * delays execution of a pipeline that was otherwise ready to run. + */ + export interface Schema$DelayedEvent { + /** + * A textual description of the cause of the delay. The string may change + * without notice since it is often generated by another service (such as + * Compute Engine). + */ + cause: string; + /** + * If the delay was caused by a resource shortage, this field lists the + * Compute Engine metrics that are preventing this operation from running + * (for example, CPUS or INSTANCES). If the particular metric is not known, + * a single UNKNOWN metric will be present. + */ + metrics: string[]; + } /** - * User defined labels to associate with the returned operation. These labels - * are not propagated to any Google Cloud Platform resources used by the - * operation, and may be modified at any time. To associate labels with - * resources created while executing the operation, see the appropriate - * resource message (i.e., VirtualMachine). - */ - labels: any; + * Carries information about a disk that can be attached to a VM. + */ + export interface Schema$Disk { + /** + * A user supplied name for the disk, used when mounting it into actions. + * The name must contain only upper and lowercase alphanumeric characters + * and hypens and cannot start with a hypen. + */ + name: string; + /** + * The size, in gigabytes, of the disk to attach. Note that this value is + * not configurable for some disk types such as local-ssd. If the size is + * not specified, a size of at least 500gb is used to ensure reasonable I/O + * performance. + */ + sizeGb: number; + /** + * An optional image to put on the disk before attaching it to the VM. + */ + sourceImage: string; + /** + * The Compute Engine disk type. If unspecified, 'standard-pd' is + * used. + */ + type: string; + } /** - * The description of the pipeline to run. - */ - pipeline: Schema$Pipeline; -} -/** - * Runtime metadata that will be populated in the runtimeMetadata field of the - * Operation associated with a RunPipeline execution. - */ -export interface Schema$RuntimeMetadata { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Event carries information about events that occur during pipeline + * execution. + */ + export interface Schema$Event { + /** + * A human readable description of the event. Note that these strings may + * change at any time without notice. Any application logic must use the + * information in the details field. + */ + description: string; + /** + * Machine readable details about the event. + */ + details: any; + /** + * The time that the event occurred. + */ + timestamp: string; + } /** - * Execution information specific to Google Compute Engine. - */ - computeEngine: Schema$ComputeEngine; -} -/** - * Carries information about a Google Cloud Service Account. - */ -export interface Schema$ServiceAccount { + * This event is generated when the execution of a pipeline has failed. Note + * that other events may continue to occur after this event. + */ + export interface Schema$FailedEvent { + /** + * The human readable description of the cause of the failure. + */ + cause: string; + /** + * The Google standard error code that best describes this failure. + */ + code: string; + } /** - * Email address of the service account. If not specified, the default - * compute engine service account for the project will be used. + * The read group set import response. */ - email: string; + export interface Schema$ImportReadGroupSetsResponse { + /** + * IDs of the read group sets that were created. + */ + readGroupSetIds: string[]; + } /** - * List of scopes to be enabled for this service account on the VM, in - * addition to the Google Genomics API scope. + * The variant data import response. */ - scopes: string[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$ImportVariantsResponse { + /** + * IDs of the call sets created during the import. + */ + callSetIds: string[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Metadata carries information about the pipeline execution that is returned + * in the long running operation's metadata field. + */ + export interface Schema$Metadata { + /** + * The time that the operation was created by the API. + */ + createTime: string; + /** + * The list of events that have happened so far during the execution of this + * operation. + */ + events: Schema$Event[]; + /** + * The user defined labels associated with this operation. + */ + labels: any; + /** + * The pipeline this operation represents. + */ + pipeline: Schema$Pipeline; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * This event is generated when the execution of a container results in a - * non-zero exit status that was not otherwise ignored. Execution will - * continue, but only actions that are flagged as ALWAYS_RUN will be executed: - * other actions will be skipped. - */ -export interface Schema$UnexpectedExitStatusEvent { + * Mount carries information about a particular disk mount inside a container. + */ + export interface Schema$Mount { + /** + * The name of the disk to mount, as specified in the resources section. + */ + disk: string; + /** + * The path to mount the disk at inside the container. + */ + path: string; + /** + * If true, the disk is mounted read only inside the container. + */ + readOnly: boolean; + } /** - * The numeric ID of the action that started the container. - */ - actionId: number; + * VM networking options. + */ + export interface Schema$Network { + /** + * The network name to attach the VM's network interface to. If + * unspecified, the global default network is used. + */ + name: string; + /** + * If set to true, do not attach a public IP address to the VM. Note that + * without an public IP address, additional configuration is required to + * allow the VM to access Google services. See + * https://cloud.google.com/vpc/docs/configure-private-google-access for + * more information. + */ + usePrivateAddress: boolean; + } /** - * The exit status of the container. - */ - exitStatus: number; -} -/** - * Carries information about a Compute Engine VM resource. - */ -export interface Schema$VirtualMachine { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * An OperationMetadata or Metadata object. This will always be returned + * with the Operation. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. For example&#58; + * `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + */ + name: string; + /** + * If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. + * If importing Variants, an ImportVariantsResponse is returned. For + * pipelines and exports, an Empty response is returned. + */ + response: any; + } /** - * The size of the boot disk, in gigabytes. The boot disk must be large enough - * to accommodate all of the docker images from each action in the pipeline at - * the same time. If not specified, a small but reasonable default value is - * used. - */ - bootDiskSizeGb: number; + * An event that occurred during an Operation. + */ + export interface Schema$OperationEvent { + /** + * Required description of event. + */ + description: string; + /** + * Optional time of when event finished. An event can have a start time and + * no finish time. If an event has a finish time, there must be a start + * time. + */ + endTime: string; + /** + * Optional time of when event started. + */ + startTime: string; + } /** - * The host operating system image to use. At present, only Container - * Optimized OS images may be used. The default value is - * "projects/cos-cloud/global/images/family/cos-stable" which - * selects the latest stable release of Container Optimized OS. This option - * is provided to allow testing against the beta release of the operating - * system to ensure that the new version does not interact negatively with - * production pipelines. To test a pipeline against the beta release of COS, - * use the value "projects/cos-cloud/global/images/family/cos-beta". - */ - bootImage: string; + * Metadata describing an Operation. + */ + export interface Schema$OperationMetadata { + /** + * This field is deprecated. Use `labels` instead. Optionally provided by + * the caller when submitting the request that creates the operation. + */ + clientId: string; + /** + * The time at which the job was submitted to the Genomics service. + */ + createTime: string; + /** + * The time at which the job stopped running. + */ + endTime: string; + /** + * Optional event messages that were generated during the job's + * execution. This also contains any warnings that were generated during + * import or export. + */ + events: Schema$OperationEvent[]; + /** + * Optionally provided by the caller when submitting the request that + * creates the operation. + */ + labels: any; + /** + * The Google Cloud Project in which the job is scoped. + */ + projectId: string; + /** + * The original request that started the operation. Note that this will be + * in current version of the API. If the operation was started with v1beta2 + * API and a GetOperation is performed on v1 API, a v1 request will be + * returned. + */ + request: any; + /** + * Runtime metadata on this Operation. + */ + runtimeMetadata: any; + /** + * The time at which the job began to run. + */ + startTime: string; + } /** - * The CPU platform to request. An instance based on a newer platform may be - * allocated but never one with less capabilities. The value of this - * parameter must be a valid Compute Engine CPU platform name (such as - * "Intel Skylake"). This parameter is only useful for carefully - * optimized work loads where the CPU platform has a significant impact. For - * more information about the effect of this parameter, please visit - * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - */ - cpuPlatform: string; + * The Pipeline object describes a series of actions to execute, expressed as + * docker containers. + */ + export interface Schema$Pipeline { + /** + * The list of actions to execute, in the order they are specified. + */ + actions: Schema$Action[]; + /** + * The environment to pass into every action. Each action may also specify + * additional environment variables but cannot delete an entry from this map + * (though they may overwrite it with a different value). + */ + environment: any; + /** + * The resources required for execution. + */ + resources: Schema$Resources; + } /** - * The list of disks to create and attach to the VM. + * This event is generated when the worker starts pulling an image. */ - disks: Schema$Disk[]; + export interface Schema$PullStartedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } /** - * Optional set of labels to apply to the VM and any attached disk resources. - * These labels must adhere to the name and value restrictions on VM labels - * imposed by Compute Engine. These labels are applied at creation time to - * the VM and are applied on a best-effort basis to attached disk resources - * shortly after VM creation. + * This event is generated when the worker stops pulling an image. */ - labels: any; + export interface Schema$PullStoppedEvent { + /** + * The URI of the image that was pulled. + */ + imageUri: string; + } /** - * The machine type of the virtual machine to create. Must be the short name - * of a standard machine type (such as "n1-standard-1") or a custom - * machine type (such as "custom-1-4096"). - */ - machineType: string; + * The system resources for the pipeline run. At least one zone or region + * must be specified or the pipeline run will fail. + */ + export interface Schema$Resources { + /** + * The customer project ID to allocate resources in. + */ + projectId: string; + /** + * The list of regions allowed for VM allocation. If set, the zones field + * must not be set. + */ + regions: string[]; + /** + * The virtual machine specification. + */ + virtualMachine: Schema$VirtualMachine; + /** + * The list of zones allowed for VM allocation. If set, the regions field + * must not be set. + */ + zones: string[]; + } /** - * The VM network configuration. - */ - network: Schema$Network; + * The arguments to the RunPipeline method. The requesting user must have the + * iam.serviceAccounts.actAs permission for the Google Genomics Service + * Account or the request will fail. + */ + export interface Schema$RunPipelineRequest { + /** + * User defined labels to associate with the returned operation. These + * labels are not propagated to any Google Cloud Platform resources used by + * the operation, and may be modified at any time. To associate labels with + * resources created while executing the operation, see the appropriate + * resource message (i.e., VirtualMachine). + */ + labels: any; + /** + * The description of the pipeline to run. + */ + pipeline: Schema$Pipeline; + } /** - * If true, allocate a preemptible VM. + * Runtime metadata that will be populated in the runtimeMetadata field of the + * Operation associated with a RunPipeline execution. */ - preemptible: boolean; + export interface Schema$RuntimeMetadata { + /** + * Execution information specific to Google Compute Engine. + */ + computeEngine: Schema$ComputeEngine; + } /** - * The service account to install on the VM. This account does not need any - * permissions other than those required by the pipeline. - */ - serviceAccount: Schema$ServiceAccount; -} -/** - * This event is generated once a worker VM has been assigned to run the - * pipeline. - */ -export interface Schema$WorkerAssignedEvent { + * Carries information about a Google Cloud Service Account. + */ + export interface Schema$ServiceAccount { + /** + * Email address of the service account. If not specified, the default + * compute engine service account for the project will be used. + */ + email: string; + /** + * List of scopes to be enabled for this service account on the VM, in + * addition to the Google Genomics API scope. + */ + scopes: string[]; + } /** - * The worker's instance name. - */ - instance: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The zone the worker is running in. - */ - zone: string; -} -/** - * This event is generated when the worker VM that was assigned to the pipeline - * has been released (i.e., deleted). - */ -export interface Schema$WorkerReleasedEvent { + * This event is generated when the execution of a container results in a + * non-zero exit status that was not otherwise ignored. Execution will + * continue, but only actions that are flagged as ALWAYS_RUN will be executed: + * other actions will be skipped. + */ + export interface Schema$UnexpectedExitStatusEvent { + /** + * The numeric ID of the action that started the container. + */ + actionId: number; + /** + * The exit status of the container. + */ + exitStatus: number; + } /** - * The worker's instance name. - */ - instance: string; + * Carries information about a Compute Engine VM resource. + */ + export interface Schema$VirtualMachine { + /** + * The size of the boot disk, in gigabytes. The boot disk must be large + * enough to accommodate all of the docker images from each action in the + * pipeline at the same time. If not specified, a small but reasonable + * default value is used. + */ + bootDiskSizeGb: number; + /** + * The host operating system image to use. At present, only Container + * Optimized OS images may be used. The default value is + * "projects/cos-cloud/global/images/family/cos-stable" which + * selects the latest stable release of Container Optimized OS. This option + * is provided to allow testing against the beta release of the operating + * system to ensure that the new version does not interact negatively with + * production pipelines. To test a pipeline against the beta release of + * COS, use the value + * "projects/cos-cloud/global/images/family/cos-beta". + */ + bootImage: string; + /** + * The CPU platform to request. An instance based on a newer platform may + * be allocated but never one with less capabilities. The value of this + * parameter must be a valid Compute Engine CPU platform name (such as + * "Intel Skylake"). This parameter is only useful for carefully + * optimized work loads where the CPU platform has a significant impact. For + * more information about the effect of this parameter, please visit + * https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + */ + cpuPlatform: string; + /** + * The list of disks to create and attach to the VM. + */ + disks: Schema$Disk[]; + /** + * Optional set of labels to apply to the VM and any attached disk + * resources. These labels must adhere to the name and value restrictions on + * VM labels imposed by Compute Engine. These labels are applied at + * creation time to the VM and are applied on a best-effort basis to + * attached disk resources shortly after VM creation. + */ + labels: any; + /** + * The machine type of the virtual machine to create. Must be the short + * name of a standard machine type (such as "n1-standard-1") or a + * custom machine type (such as "custom-1-4096"). + */ + machineType: string; + /** + * The VM network configuration. + */ + network: Schema$Network; + /** + * If true, allocate a preemptible VM. + */ + preemptible: boolean; + /** + * The service account to install on the VM. This account does not need any + * permissions other than those required by the pipeline. + */ + serviceAccount: Schema$ServiceAccount; + } /** - * The zone the worker was running in. - */ - zone: string; -} - -export class Resource$Pipelines { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); + * This event is generated once a worker VM has been assigned to run the + * pipeline. + */ + export interface Schema$WorkerAssignedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker is running in. + */ + zone: string; } - - getRoot() { - return this.root; + /** + * This event is generated when the worker VM that was assigned to the + * pipeline has been released (i.e., deleted). + */ + export interface Schema$WorkerReleasedEvent { + /** + * The worker's instance name. + */ + instance: string; + /** + * The zone the worker was running in. + */ + zone: string; } - - /** - * genomics.pipelines.run - * @desc Runs a pipeline. **Note:** In order to use this method, the Genomics - * Service Agent must have access to your project. This is done automatically - * when the Genomics API is first enabled, but if you delete this permission, - * or if you have already enabled the Genomics API prior to the launch of the - * v2alpha1 API, you must disable and re-enable the API to grant the Genomics - * Service Agent the required permissions. [1]: /genomics/gsa - * @alias genomics.pipelines.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().RunPipelineRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2alpha1/pipelines:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Pipelines { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); } - } -} -export class Resource$Projects { - root: Genomics; - operations: Resource$Projects$Operations; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Projects$Operations(root); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Operations { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * genomics.pipelines.run + * @desc Runs a pipeline. **Note:** In order to use this method, the + * Genomics Service Agent must have access to your project. This is done + * automatically when the Genomics API is first enabled, but if you delete + * this permission, or if you have already enabled the Genomics API prior to + * the launch of the v2alpha1 API, you must disable and re-enable the API to + * grant the Genomics Service Agent the required permissions. [1]: + * /genomics/gsa + * @alias genomics.pipelines.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().RunPipelineRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2alpha1/pipelines:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Projects { + root: Genomics; + operations: Resource$Projects$Operations; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Projects$Operations(root); + } - /** - * genomics.projects.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. Clients may use Operations.GetOperation or - * Operations.ListOperations to check whether the cancellation succeeded or - * the operation completed despite cancellation. - * @alias genomics.projects.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Operations { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2alpha1/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * genomics.projects.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias genomics.projects.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * genomics.projects.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. Clients may use Operations.GetOperation or + * Operations.ListOperations to check whether the cancellation succeeded or + * the operation completed despite cancellation. + * @alias genomics.projects.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2alpha1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * genomics.projects.operations.list - * @desc Lists operations that match the specified filter in the request. - * @alias genomics.projects.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * genomics.projects.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias genomics.projects.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Workers { - root: Genomics; - constructor(root: Genomics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * genomics.projects.operations.list + * @desc Lists operations that match the specified filter in the request. + * @alias genomics.projects.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A string for filtering Operations. In v2alpha1, the following filter fields are supported: * createTime: The time this job was created * events: The set of event (names) that have occurred while running the pipeline. The : operator can be used to determine if a particular event has occurred. * error: If the pipeline is running, this value is NULL. Once the pipeline finishes, the value is the standard Google error code. * labels.key or labels."key with space" where key is a label key. In v1 and v1alpha2, the following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` operators. * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only one status may be specified. * labels.key where key is a label key. Examples: * `projectId = my-project AND createTime >= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * genomics.workers.checkIn - * @desc The worker uses this method to retrieve the assigned operation and - * provide periodic status updates. - * @alias genomics.workers.checkIn - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The worker id, assigned when it was created. - * @param {().CheckInRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - checkIn(params?: any, options?: MethodOptions): - AxiosPromise; - checkIn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - checkIn( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Workers { + root: Genomics; + constructor(root: Genomics) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2alpha1/workers/{id}:checkIn') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * genomics.workers.checkIn + * @desc The worker uses this method to retrieve the assigned operation and + * provide periodic status updates. + * @alias genomics.workers.checkIn + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The worker id, assigned when it was created. + * @param {().CheckInRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + checkIn(params?: any, options?: MethodOptions): + AxiosPromise; + checkIn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + checkIn( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2alpha1/workers/{id}:checkIn') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/gmail/v1.ts b/src/apis/gmail/v1.ts index 21b03e591c7..945b4be06d6 100644 --- a/src/apis/gmail/v1.ts +++ b/src/apis/gmail/v1.ts @@ -27,4416 +27,4474 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Gmail API - * - * Access Gmail mailboxes including sending user email. - * - * @example - * const google = require('googleapis'); - * const gmail = google.gmail('v1'); - * - * @namespace gmail - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Gmail - */ -export class Gmail { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - users: Resource$Users; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.users = new Resource$Users(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Auto-forwarding settings for an account. - */ -export interface Schema$AutoForwarding { - /** - * The state that a message should be left in after it has been forwarded. - */ - disposition: string; - /** - * Email address to which all incoming messages are forwarded. This email - * address must be a verified member of the forwarding addresses. - */ - emailAddress: string; - /** - * Whether all incoming mail is automatically forwarded to another address. - */ - enabled: boolean; -} -export interface Schema$BatchDeleteMessagesRequest { - /** - * The IDs of the messages to delete. - */ - ids: string[]; -} -export interface Schema$BatchModifyMessagesRequest { - /** - * A list of label IDs to add to messages. - */ - addLabelIds: string[]; - /** - * The IDs of the messages to modify. There is a limit of 1000 ids per - * request. - */ - ids: string[]; - /** - * A list of label IDs to remove from messages. - */ - removeLabelIds: string[]; -} -/** - * A draft email in the user's mailbox. - */ -export interface Schema$Draft { - /** - * The immutable ID of the draft. - */ - id: string; - /** - * The message content of the draft. - */ - message: Schema$Message; -} -/** - * Resource definition for Gmail filters. Filters apply to specific messages - * instead of an entire email thread. - */ -export interface Schema$Filter { - /** - * Action that the filter performs. - */ - action: Schema$FilterAction; - /** - * Matching criteria for the filter. - */ - criteria: Schema$FilterCriteria; - /** - * The server assigned ID of the filter. - */ - id: string; -} -/** - * A set of actions to perform on a message. - */ -export interface Schema$FilterAction { - /** - * List of labels to add to the message. - */ - addLabelIds: string[]; - /** - * Email address that the message should be forwarded to. - */ - forward: string; - /** - * List of labels to remove from the message. - */ - removeLabelIds: string[]; -} -/** - * Message matching criteria. - */ -export interface Schema$FilterCriteria { - /** - * Whether the response should exclude chats. - */ - excludeChats: boolean; - /** - * The sender's display name or email address. - */ - from: string; - /** - * Whether the message has any attachment. - */ - hasAttachment: boolean; - /** - * Only return messages not matching the specified query. Supports the same - * query format as the Gmail search box. For example, - * "from:someuser@example.com rfc822msgid: is:unread". - */ - negatedQuery: string; - /** - * Only return messages matching the specified query. Supports the same query - * format as the Gmail search box. For example, - * "from:someuser@example.com rfc822msgid: is:unread". - */ - query: string; - /** - * The size of the entire RFC822 message in bytes, including all headers and - * attachments. - */ - size: number; - /** - * How the message size in bytes should be in relation to the size field. - */ - sizeComparison: string; - /** - * Case-insensitive phrase found in the message's subject. Trailing and - * leading whitespace are be trimmed and adjacent spaces are collapsed. - */ - subject: string; - /** - * The recipient's display name or email address. Includes recipients in - * the "to", "cc", and "bcc" header fields. You - * can use simply the local part of the email address. For example, - * "example" and "example@" both match - * "example@gmail.com". This field is case-insensitive. - */ - to: string; -} -/** - * Settings for a forwarding address. - */ -export interface Schema$ForwardingAddress { - /** - * An email address to which messages can be forwarded. - */ - forwardingEmail: string; - /** - * Indicates whether this address has been verified and is usable for - * forwarding. Read-only. - */ - verificationStatus: string; -} -/** - * A record of a change to the user's mailbox. Each history change may - * affect multiple messages in multiple ways. - */ -export interface Schema$History { - /** - * The mailbox sequence ID. - */ - id: string; - /** - * Labels added to messages in this history record. - */ - labelsAdded: Schema$HistoryLabelAdded[]; - /** - * Labels removed from messages in this history record. - */ - labelsRemoved: Schema$HistoryLabelRemoved[]; - /** - * List of messages changed in this history record. The fields for specific - * change types, such as messagesAdded may duplicate messages in this field. - * We recommend using the specific change-type fields instead of this. - */ - messages: Schema$Message[]; - /** - * Messages added to the mailbox in this history record. - */ - messagesAdded: Schema$HistoryMessageAdded[]; - /** - * Messages deleted (not Trashed) from the mailbox in this history record. - */ - messagesDeleted: Schema$HistoryMessageDeleted[]; -} -export interface Schema$HistoryLabelAdded { - /** - * Label IDs added to the message. - */ - labelIds: string[]; - message: Schema$Message; -} -export interface Schema$HistoryLabelRemoved { - /** - * Label IDs removed from the message. - */ - labelIds: string[]; - message: Schema$Message; -} -export interface Schema$HistoryMessageAdded { message: Schema$Message; } -export interface Schema$HistoryMessageDeleted { message: Schema$Message; } -/** - * IMAP settings for an account. - */ -export interface Schema$ImapSettings { - /** - * If this value is true, Gmail will immediately expunge a message when it is - * marked as deleted in IMAP. Otherwise, Gmail will wait for an update from - * the client before expunging messages marked as deleted. - */ - autoExpunge: boolean; - /** - * Whether IMAP is enabled for the account. - */ - enabled: boolean; - /** - * The action that will be executed on a message when it is marked as deleted - * and expunged from the last visible IMAP folder. - */ - expungeBehavior: string; - /** - * An optional limit on the number of messages that an IMAP folder may - * contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is - * interpreted to mean that there is no limit. - */ - maxFolderSize: number; -} -/** - * Labels are used to categorize messages and threads within the user's - * mailbox. - */ -export interface Schema$Label { - /** - * The color to assign to the label. Color is only available for labels that - * have their type set to user. - */ - color: Schema$LabelColor; - /** - * The immutable ID of the label. - */ - id: string; - /** - * The visibility of the label in the label list in the Gmail web interface. - */ - labelListVisibility: string; - /** - * The visibility of the label in the message list in the Gmail web interface. - */ - messageListVisibility: string; - /** - * The total number of messages with the label. - */ - messagesTotal: number; - /** - * The number of unread messages with the label. - */ - messagesUnread: number; - /** - * The display name of the label. - */ - name: string; - /** - * The total number of threads with the label. - */ - threadsTotal: number; - /** - * The number of unread threads with the label. - */ - threadsUnread: number; - /** - * The owner type for the label. User labels are created by the user and can - * be modified and deleted by the user and can be applied to any message or - * thread. System labels are internally created and cannot be added, modified, - * or deleted. System labels may be able to be applied to or removed from - * messages and threads under some circumstances but this is not guaranteed. - * For example, users can apply and remove the INBOX and UNREAD labels from - * messages and threads, but cannot apply or remove the DRAFTS or SENT labels - * from messages or threads. - */ - type: string; -} -export interface Schema$LabelColor { - /** - * The background color represented as hex string #RRGGBB (ex #000000). This - * field is required in order to set the color of a label. Only the following - * predefined set of color values are allowed: #000000, #434343, #666666, - * #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, #fad165, - * #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, #fef1d1, - * #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, #fce8b3, - * #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, #fcda83, - * #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, #f2c960, - * #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, #d5ae49, - * #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, #aa8831, - * #076239, #1a764d, #1c4587, #41236d, #83334c - */ - backgroundColor: string; - /** - * The text color of the label, represented as hex string. This field is - * required in order to set the color of a label. Only the following - * predefined set of color values are allowed: #000000, #434343, #666666, - * #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, #fad165, - * #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, #fef1d1, - * #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, #fce8b3, - * #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, #fcda83, - * #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, #f2c960, - * #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, #d5ae49, - * #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, #aa8831, - * #076239, #1a764d, #1c4587, #41236d, #83334c - */ - textColor: string; -} -export interface Schema$ListDraftsResponse { - /** - * List of drafts. - */ - drafts: Schema$Draft[]; - /** - * Token to retrieve the next page of results in the list. - */ - nextPageToken: string; - /** - * Estimated total number of results. - */ - resultSizeEstimate: number; -} -/** - * Response for the ListFilters method. - */ -export interface Schema$ListFiltersResponse { - /** - * List of a user's filters. - */ - filter: Schema$Filter[]; -} -/** - * Response for the ListForwardingAddresses method. - */ -export interface Schema$ListForwardingAddressesResponse { - /** - * List of addresses that may be used for forwarding. - */ - forwardingAddresses: Schema$ForwardingAddress[]; -} -export interface Schema$ListHistoryResponse { - /** - * List of history records. Any messages contained in the response will - * typically only have id and threadId fields populated. - */ - history: Schema$History[]; - /** - * The ID of the mailbox's current history record. - */ - historyId: string; - /** - * Page token to retrieve the next page of results in the list. - */ - nextPageToken: string; -} -export interface Schema$ListLabelsResponse { - /** - * List of labels. - */ - labels: Schema$Label[]; -} -export interface Schema$ListMessagesResponse { - /** - * List of messages. - */ - messages: Schema$Message[]; - /** - * Token to retrieve the next page of results in the list. - */ - nextPageToken: string; - /** - * Estimated total number of results. - */ - resultSizeEstimate: number; -} -/** - * Response for the ListSendAs method. - */ -export interface Schema$ListSendAsResponse { - /** - * List of send-as aliases. - */ - sendAs: Schema$SendAs[]; -} -export interface Schema$ListSmimeInfoResponse { - /** - * List of SmimeInfo. - */ - smimeInfo: Schema$SmimeInfo[]; -} -export interface Schema$ListThreadsResponse { - /** - * Page token to retrieve the next page of results in the list. - */ - nextPageToken: string; - /** - * Estimated total number of results. - */ - resultSizeEstimate: number; - /** - * List of threads. - */ - threads: Schema$Thread[]; -} -/** - * An email message. - */ -export interface Schema$Message { - /** - * The ID of the last history record that modified this message. - */ - historyId: string; - /** - * The immutable ID of the message. - */ - id: string; - /** - * The internal message creation timestamp (epoch ms), which determines - * ordering in the inbox. For normal SMTP-received email, this represents the - * time the message was originally accepted by Google, which is more reliable - * than the Date header. However, for API-migrated mail, it can be configured - * by client to be based on the Date header. - */ - internalDate: string; - /** - * List of IDs of labels applied to this message. - */ - labelIds: string[]; - /** - * The parsed email structure in the message parts. - */ - payload: Schema$MessagePart; - /** - * The entire email message in an RFC 2822 formatted and base64url encoded - * string. Returned in messages.get and drafts.get responses when the - * format=RAW parameter is supplied. - */ - raw: string; - /** - * Estimated size in bytes of the message. - */ - sizeEstimate: number; - /** - * A short part of the message text. - */ - snippet: string; - /** - * The ID of the thread the message belongs to. To add a message or draft to a - * thread, the following criteria must be met: - The requested threadId must - * be specified on the Message or Draft.Message you supply with your request. - * - The References and In-Reply-To headers must be set in compliance with the - * RFC 2822 standard. - The Subject headers must match. - */ - threadId: string; -} -/** - * A single MIME message part. - */ -export interface Schema$MessagePart { - /** - * The message part body for this part, which may be empty for container MIME - * message parts. - */ - body: Schema$MessagePartBody; - /** - * The filename of the attachment. Only present if this message part - * represents an attachment. - */ - filename: string; - /** - * List of headers on this message part. For the top-level message part, - * representing the entire message payload, it will contain the standard RFC - * 2822 email headers such as To, From, and Subject. - */ - headers: Schema$MessagePartHeader[]; - /** - * The MIME type of the message part. - */ - mimeType: string; - /** - * The immutable ID of the message part. - */ - partId: string; - /** - * The child MIME message parts of this part. This only applies to container - * MIME message parts, for example multipart/*. For non- container MIME - * message part types, such as text/plain, this field is empty. For more - * information, see RFC 1521. - */ - parts: Schema$MessagePart[]; -} -/** - * The body of a single MIME message part. - */ -export interface Schema$MessagePartBody { - /** - * When present, contains the ID of an external attachment that can be - * retrieved in a separate messages.attachments.get request. When not present, - * the entire content of the message part body is contained in the data field. - */ - attachmentId: string; - /** - * The body data of a MIME message part as a base64url encoded string. May be - * empty for MIME container types that have no message body or when the body - * data is sent as a separate attachment. An attachment ID is present if the - * body data is contained in a separate attachment. - */ - data: string; - /** - * Number of bytes for the message part data (encoding notwithstanding). - */ - size: number; -} -export interface Schema$MessagePartHeader { - /** - * The name of the header before the : separator. For example, To. - */ - name: string; - /** - * The value of the header after the : separator. For example, - * someuser@example.com. - */ - value: string; -} -export interface Schema$ModifyMessageRequest { - /** - * A list of IDs of labels to add to this message. - */ - addLabelIds: string[]; - /** - * A list IDs of labels to remove from this message. - */ - removeLabelIds: string[]; -} -export interface Schema$ModifyThreadRequest { - /** - * A list of IDs of labels to add to this thread. - */ - addLabelIds: string[]; - /** - * A list of IDs of labels to remove from this thread. - */ - removeLabelIds: string[]; -} -/** - * POP settings for an account. - */ -export interface Schema$PopSettings { - /** - * The range of messages which are accessible via POP. - */ - accessWindow: string; - /** - * The action that will be executed on a message after it has been fetched via - * POP. - */ - disposition: string; -} -/** - * Profile for a Gmail user. - */ -export interface Schema$Profile { - /** - * The user's email address. - */ - emailAddress: string; - /** - * The ID of the mailbox's current history record. - */ - historyId: string; - /** - * The total number of messages in the mailbox. - */ - messagesTotal: number; - /** - * The total number of threads in the mailbox. - */ - threadsTotal: number; -} -/** - * Settings associated with a send-as alias, which can be either the primary - * login address associated with the account or a custom "from" - * address. Send-as aliases correspond to the "Send Mail As" feature - * in the web interface. - */ -export interface Schema$SendAs { - /** - * A name that appears in the "From:" header for mail sent using - * this alias. For custom "from" addresses, when this is empty, - * Gmail will populate the "From:" header with the name that is used - * for the primary address associated with the account. If the admin has - * disabled the ability for users to update their name format, requests to - * update this field for the primary login will silently fail. - */ - displayName: string; - /** - * Whether this address is selected as the default "From:" address - * in situations such as composing a new message or sending a vacation - * auto-reply. Every Gmail account has exactly one default send-as address, so - * the only legal value that clients may write to this field is true. Changing - * this from false to true for an address will result in this field becoming - * false for the other previous default address. - */ - isDefault: boolean; - /** - * Whether this address is the primary address used to login to the account. - * Every Gmail account has exactly one primary address, and it cannot be - * deleted from the collection of send-as aliases. This field is read-only. - */ - isPrimary: boolean; - /** - * An optional email address that is included in a "Reply-To:" - * header for mail sent using this alias. If this is empty, Gmail will not - * generate a "Reply-To:" header. - */ - replyToAddress: string; - /** - * The email address that appears in the "From:" header for mail - * sent using this alias. This is read-only for all operations except create. - */ - sendAsEmail: string; - /** - * An optional HTML signature that is included in messages composed with this - * alias in the Gmail web UI. - */ - signature: string; - /** - * An optional SMTP service that will be used as an outbound relay for mail - * sent using this alias. If this is empty, outbound mail will be sent - * directly from Gmail's servers to the destination SMTP service. This - * setting only applies to custom "from" aliases. - */ - smtpMsa: Schema$SmtpMsa; - /** - * Whether Gmail should treat this address as an alias for the user's - * primary email address. This setting only applies to custom "from" - * aliases. - */ - treatAsAlias: boolean; - /** - * Indicates whether this address has been verified for use as a send-as - * alias. Read-only. This setting only applies to custom "from" - * aliases. - */ - verificationStatus: string; -} -/** - * An S/MIME email config. - */ -export interface Schema$SmimeInfo { - /** - * Encrypted key password, when key is encrypted. - */ - encryptedKeyPassword: string; - /** - * When the certificate expires (in milliseconds since epoch). - */ - expiration: string; - /** - * The immutable ID for the SmimeInfo. - */ - id: string; - /** - * Whether this SmimeInfo is the default one for this user's send-as - * address. - */ - isDefault: boolean; - /** - * The S/MIME certificate issuer's common name. - */ - issuerCn: string; - /** - * PEM formatted X509 concatenated certificate string (standard base64 - * encoding). Format used for returning key, which includes public key as well - * as certificate chain (not private key). - */ - pem: string; - /** - * PKCS#12 format containing a single private/public key pair and certificate - * chain. This format is only accepted from client for creating a new - * SmimeInfo and is never returned, because the private key is not intended to - * be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword - * should be set appropriately. - */ - pkcs12: string; -} -/** - * Configuration for communication with an SMTP service. - */ -export interface Schema$SmtpMsa { - /** - * The hostname of the SMTP service. Required. - */ - host: string; - /** - * The password that will be used for authentication with the SMTP service. - * This is a write-only field that can be specified in requests to create or - * update SendAs settings; it is never populated in responses. - */ - password: string; - /** - * The port of the SMTP service. Required. - */ - port: number; - /** - * The protocol that will be used to secure communication with the SMTP - * service. Required. - */ - securityMode: string; - /** - * The username that will be used for authentication with the SMTP service. - * This is a write-only field that can be specified in requests to create or - * update SendAs settings; it is never populated in responses. - */ - username: string; -} -/** - * A collection of messages representing a conversation. - */ -export interface Schema$Thread { - /** - * The ID of the last history record that modified this thread. - */ - historyId: string; - /** - * The unique ID of the thread. - */ - id: string; - /** - * The list of messages in the thread. - */ - messages: Schema$Message[]; - /** - * A short part of the message text. - */ - snippet: string; -} -/** - * Vacation auto-reply settings for an account. These settings correspond to the - * "Vacation responder" feature in the web interface. - */ -export interface Schema$VacationSettings { - /** - * Flag that controls whether Gmail automatically replies to messages. - */ - enableAutoReply: boolean; - /** - * An optional end time for sending auto-replies (epoch ms). When this is - * specified, Gmail will automatically reply only to messages that it receives - * before the end time. If both startTime and endTime are specified, startTime - * must precede endTime. - */ - endTime: string; - /** - * Response body in HTML format. Gmail will sanitize the HTML before storing - * it. - */ - responseBodyHtml: string; - /** - * Response body in plain text format. - */ - responseBodyPlainText: string; - /** - * Optional text to prepend to the subject line in vacation responses. In - * order to enable auto-replies, either the response subject or the response - * body must be nonempty. - */ - responseSubject: string; - /** - * Flag that determines whether responses are sent to recipients who are not - * in the user's list of contacts. - */ - restrictToContacts: boolean; - /** - * Flag that determines whether responses are sent to recipients who are - * outside of the user's domain. This feature is only available for G - * Suite users. - */ - restrictToDomain: boolean; - /** - * An optional start time for sending auto-replies (epoch ms). When this is - * specified, Gmail will automatically reply only to messages that it receives - * after the start time. If both startTime and endTime are specified, - * startTime must precede endTime. - */ - startTime: string; -} -/** - * Set up or update a new push notification watch on this user's mailbox. - */ -export interface Schema$WatchRequest { - /** - * Filtering behavior of labelIds list specified. - */ - labelFilterAction: string; - /** - * List of label_ids to restrict notifications about. By default, if - * unspecified, all changes are pushed out. If specified then dictates which - * labels are required for a push notification to be generated. - */ - labelIds: string[]; - /** - * A fully qualified Google Cloud Pub/Sub API topic name to publish the events - * to. This topic name **must** already exist in Cloud Pub/Sub and you - * **must** have already granted gmail "publish" permission on it. - * For example, - * "projects/my-project-identifier/topics/my-topic-name" (using the - * Cloud Pub/Sub "v1" topic naming format). Note that the - * "my-project-identifier" portion must exactly match your Google - * developer project id (the one executing this watch request). - */ - topicName: string; -} -/** - * Push notification watch response. - */ -export interface Schema$WatchResponse { - /** - * When Gmail will stop sending notifications for mailbox updates (epoch - * millis). Call watch again before this time to renew the watch. - */ - expiration: string; - /** - * The ID of the mailbox's current history record. - */ - historyId: string; -} - -export class Resource$Users { - root: Gmail; - drafts: Resource$Users$Drafts; - history: Resource$Users$History; - labels: Resource$Users$Labels; - messages: Resource$Users$Messages; - settings: Resource$Users$Settings; - threads: Resource$Users$Threads; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - this.drafts = new Resource$Users$Drafts(root); - this.history = new Resource$Users$History(root); - this.labels = new Resource$Users$Labels(root); - this.messages = new Resource$Users$Messages(root); - this.settings = new Resource$Users$Settings(root); - this.threads = new Resource$Users$Threads(root); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.getProfile - * @desc Gets the current user's Gmail profile. - * @alias gmail.users.getProfile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getProfile(params?: any, options?: MethodOptions): - AxiosPromise; - getProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/profile') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.stop - * @desc Stop receiving push notifications for the given user mailbox. - * @alias gmail.users.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.watch - * @desc Set up or update a push notification watch on the given user mailbox. - * @alias gmail.users.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().WatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): - AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Drafts { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.drafts.create - * @desc Creates a new draft with the DRAFT label. - * @alias gmail.users.drafts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.drafts.delete - * @desc Immediately and permanently deletes the specified draft. Does not - * simply trash it. - * @alias gmail.users.drafts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the draft to delete. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.drafts.get - * @desc Gets the specified draft. - * @alias gmail.users.drafts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format The format to return the draft in. - * @param {string} params.id The ID of the draft to retrieve. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.drafts.list - * @desc Lists the drafts in the user's mailbox. - * @alias gmail.users.drafts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeSpamTrash Include drafts from SPAM and TRASH in the results. - * @param {integer=} params.maxResults Maximum number of drafts to return. - * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. - * @param {string=} params.q Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.drafts.send - * @desc Sends the specified, existing draft to the recipients in the To, Cc, - * and Bcc headers. - * @alias gmail.users.drafts.send - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - send(params?: any, options?: MethodOptions): AxiosPromise; - send( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - send( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts/send') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/send') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.drafts.update - * @desc Replaces a draft's content. - * @alias gmail.users.drafts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the draft to update. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users$History { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.history.list - * @desc Lists the history of all changes to the given mailbox. History - * results are returned in chronological order (increasing historyId). - * @alias gmail.users.history.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.historyTypes History types to be returned by the function - * @param {string=} params.labelId Only return messages with a label matching the ID. - * @param {integer=} params.maxResults The maximum number of history records to return. - * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. - * @param {string=} params.startHistoryId Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/history') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users$Labels { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.labels.create - * @desc Creates a new label. - * @alias gmail.users.labels.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().Label} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.labels.delete - * @desc Immediately and permanently deletes the specified label and removes - * it from any messages and threads that it is applied to. - * @alias gmail.users.labels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the label to delete. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.labels.get - * @desc Gets the specified label. - * @alias gmail.users.labels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the label to retrieve. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.labels.list - * @desc Lists all labels in the user's mailbox. - * @alias gmail.users.labels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.labels.patch - * @desc Updates the specified label. This method supports patch semantics. - * @alias gmail.users.labels.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the label to update. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().Label} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.labels.update - * @desc Updates the specified label. - * @alias gmail.users.labels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the label to update. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().Label} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Users$Messages { - root: Gmail; - attachments: Resource$Users$Messages$Attachments; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - this.attachments = new Resource$Users$Messages$Attachments(root); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.messages.batchDelete - * @desc Deletes many messages by message ID. Provides no guarantees that - * messages were not already deleted or even existed at all. - * @alias gmail.users.messages.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().BatchDeleteMessagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): AxiosPromise; - batchDelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.batchModify - * @desc Modifies the labels on the specified messages. - * @alias gmail.users.messages.batchModify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().BatchModifyMessagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchModify(params?: any, options?: MethodOptions): AxiosPromise; - batchModify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchModify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchModify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.delete - * @desc Immediately and permanently deletes the specified message. This - * operation cannot be undone. Prefer messages.trash instead. - * @alias gmail.users.messages.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the message to delete. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.get - * @desc Gets the specified message. - * @alias gmail.users.messages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format The format to return the message in. - * @param {string} params.id The ID of the message to retrieve. - * @param {string=} params.metadataHeaders When given and format is METADATA, only include headers specified. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.import - * @desc Imports a message into only this user's mailbox, with standard email - * delivery scanning and classification similar to receiving via SMTP. Does - * not send a message. - * @alias gmail.users.messages.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deleted Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. - * @param {string=} params.internalDateSource Source for Gmail's internal date of the message. - * @param {boolean=} params.neverMarkSpam Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. - * @param {boolean=} params.processForCalendar Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ -import(params?: any, options?: MethodOptions): AxiosPromise; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { - callback = options; - options = {}; - } if(typeof params === 'function') { - callback = params; - params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'), requiredParams: ['userId'], pathParams: ['userId'], context: this.getRoot()}; if(callback) { - createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} - - - /** - * gmail.users.messages.insert - * @desc Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. - * @alias gmail.users.messages.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deleted Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. - * @param {string=} params.internalDateSource Source for Gmail's internal date of the message. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.list - * @desc Lists the messages in the user's mailbox. - * @alias gmail.users.messages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeSpamTrash Include messages from SPAM and TRASH in the results. - * @param {string=} params.labelIds Only return messages with labels that match all of the specified label IDs. - * @param {integer=} params.maxResults Maximum number of messages to return. - * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. - * @param {string=} params.q Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.modify - * @desc Modifies the labels on the specified message. - * @alias gmail.users.messages.modify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the message to modify. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().ModifyMessageRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modify(params?: any, options?: MethodOptions): AxiosPromise; - modify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/modify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.send - * @desc Sends the specified message to the recipients in the To, Cc, and Bcc - * headers. - * @alias gmail.users.messages.send - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - send(params?: any, options?: MethodOptions): AxiosPromise; - send( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - send( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/send') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/send') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.trash - * @desc Moves the specified message to the trash. - * @alias gmail.users.messages.trash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the message to Trash. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - trash(params?: any, options?: MethodOptions): AxiosPromise; - trash( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - trash( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/trash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.messages.untrash - * @desc Removes the specified message from the trash. - * @alias gmail.users.messages.untrash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the message to remove from Trash. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - untrash(params?: any, options?: MethodOptions): AxiosPromise; - untrash( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - untrash( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/untrash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Messages$Attachments { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.messages.attachments.get - * @desc Gets the specified message attachment. - * @alias gmail.users.messages.attachments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the attachment. - * @param {string} params.messageId The ID of the message containing the attachment. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'messageId', 'id'], - pathParams: ['id', 'messageId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Users$Settings { - root: Gmail; - filters: Resource$Users$Settings$Filters; - forwardingAddresses: Resource$Users$Settings$Forwardingaddresses; - sendAs: Resource$Users$Settings$Sendas; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - this.filters = new Resource$Users$Settings$Filters(root); - this.forwardingAddresses = - new Resource$Users$Settings$Forwardingaddresses(root); - this.sendAs = new Resource$Users$Settings$Sendas(root); - } - - getRoot() { - return this.root; - } - - - /** - * gmail.users.settings.getAutoForwarding - * @desc Gets the auto-forwarding setting for the specified account. - * @alias gmail.users.settings.getAutoForwarding - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAutoForwarding(params?: any, options?: MethodOptions): - AxiosPromise; - getAutoForwarding( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAutoForwarding( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.settings.getImap - * @desc Gets IMAP settings. - * @alias gmail.users.settings.getImap - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getImap(params?: any, options?: MethodOptions): - AxiosPromise; - getImap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getImap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.settings.getPop - * @desc Gets POP settings. - * @alias gmail.users.settings.getPop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getPop(params?: any, options?: MethodOptions): - AxiosPromise; - getPop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getPop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/pop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.settings.getVacation - * @desc Gets vacation responder settings. - * @alias gmail.users.settings.getVacation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getVacation(params?: any, options?: MethodOptions): - AxiosPromise; - getVacation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getVacation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/vacation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace gmail_v1 { /** - * gmail.users.settings.updateAutoForwarding - * @desc Updates the auto-forwarding setting for the specified account. A - * verified forwarding address must be specified when auto-forwarding is - * enabled. This method is only available to service account clients that - * have been delegated domain-wide authority. - * @alias gmail.users.settings.updateAutoForwarding - * @memberOf! () + * Gmail API * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().AutoForwarding} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateAutoForwarding(params?: any, options?: MethodOptions): - AxiosPromise; - updateAutoForwarding( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateAutoForwarding( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * gmail.users.settings.updateImap - * @desc Updates IMAP settings. - * @alias gmail.users.settings.updateImap - * @memberOf! () + * Access Gmail mailboxes including sending user email. * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().ImapSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @example + * const google = require('googleapis'); + * const gmail = google.gmail('v1'); + * + * @namespace gmail + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Gmail */ - updateImap(params?: any, options?: MethodOptions): - AxiosPromise; - updateImap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateImap( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + export class Gmail { + _options: GlobalOptions; + google: GoogleApis; + root = this; + users: Resource$Users; - /** - * gmail.users.settings.updatePop - * @desc Updates POP settings. - * @alias gmail.users.settings.updatePop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().PopSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatePop(params?: any, options?: MethodOptions): - AxiosPromise; - updatePop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updatePop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.users = new Resource$Users(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/pop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - /** - * gmail.users.settings.updateVacation - * @desc Updates vacation responder settings. - * @alias gmail.users.settings.updateVacation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().VacationSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateVacation(params?: any, options?: MethodOptions): - AxiosPromise; - updateVacation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateVacation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/vacation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Auto-forwarding settings for an account. + */ + export interface Schema$AutoForwarding { + /** + * The state that a message should be left in after it has been forwarded. + */ + disposition: string; + /** + * Email address to which all incoming messages are forwarded. This email + * address must be a verified member of the forwarding addresses. + */ + emailAddress: string; + /** + * Whether all incoming mail is automatically forwarded to another address. + */ + enabled: boolean; } -} -export class Resource$Users$Settings$Filters { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$BatchDeleteMessagesRequest { + /** + * The IDs of the messages to delete. + */ + ids: string[]; } - - getRoot() { - return this.root; + export interface Schema$BatchModifyMessagesRequest { + /** + * A list of label IDs to add to messages. + */ + addLabelIds: string[]; + /** + * The IDs of the messages to modify. There is a limit of 1000 ids per + * request. + */ + ids: string[]; + /** + * A list of label IDs to remove from messages. + */ + removeLabelIds: string[]; } - - /** - * gmail.users.settings.filters.create - * @desc Creates a filter. - * @alias gmail.users.settings.filters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().Filter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A draft email in the user's mailbox. + */ + export interface Schema$Draft { + /** + * The immutable ID of the draft. + */ + id: string; + /** + * The message content of the draft. + */ + message: Schema$Message; } - - /** - * gmail.users.settings.filters.delete - * @desc Deletes a filter. - * @alias gmail.users.settings.filters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the filter to be deleted. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Resource definition for Gmail filters. Filters apply to specific messages + * instead of an entire email thread. + */ + export interface Schema$Filter { + /** + * Action that the filter performs. + */ + action: Schema$FilterAction; + /** + * Matching criteria for the filter. + */ + criteria: Schema$FilterCriteria; + /** + * The server assigned ID of the filter. + */ + id: string; } - - /** - * gmail.users.settings.filters.get - * @desc Gets a filter. - * @alias gmail.users.settings.filters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the filter to be fetched. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A set of actions to perform on a message. + */ + export interface Schema$FilterAction { + /** + * List of labels to add to the message. + */ + addLabelIds: string[]; + /** + * Email address that the message should be forwarded to. + */ + forward: string; + /** + * List of labels to remove from the message. + */ + removeLabelIds: string[]; } - - /** - * gmail.users.settings.filters.list - * @desc Lists the message filters of a Gmail user. - * @alias gmail.users.settings.filters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Message matching criteria. + */ + export interface Schema$FilterCriteria { + /** + * Whether the response should exclude chats. + */ + excludeChats: boolean; + /** + * The sender's display name or email address. + */ + from: string; + /** + * Whether the message has any attachment. + */ + hasAttachment: boolean; + /** + * Only return messages not matching the specified query. Supports the same + * query format as the Gmail search box. For example, + * "from:someuser@example.com rfc822msgid: is:unread". + */ + negatedQuery: string; + /** + * Only return messages matching the specified query. Supports the same + * query format as the Gmail search box. For example, + * "from:someuser@example.com rfc822msgid: is:unread". + */ + query: string; + /** + * The size of the entire RFC822 message in bytes, including all headers and + * attachments. + */ + size: number; + /** + * How the message size in bytes should be in relation to the size field. + */ + sizeComparison: string; + /** + * Case-insensitive phrase found in the message's subject. Trailing and + * leading whitespace are be trimmed and adjacent spaces are collapsed. + */ + subject: string; + /** + * The recipient's display name or email address. Includes recipients in + * the "to", "cc", and "bcc" header fields. + * You can use simply the local part of the email address. For example, + * "example" and "example@" both match + * "example@gmail.com". This field is case-insensitive. + */ + to: string; } -} - -export class Resource$Users$Settings$Forwardingaddresses { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); + /** + * Settings for a forwarding address. + */ + export interface Schema$ForwardingAddress { + /** + * An email address to which messages can be forwarded. + */ + forwardingEmail: string; + /** + * Indicates whether this address has been verified and is usable for + * forwarding. Read-only. + */ + verificationStatus: string; } - - getRoot() { - return this.root; + /** + * A record of a change to the user's mailbox. Each history change may + * affect multiple messages in multiple ways. + */ + export interface Schema$History { + /** + * The mailbox sequence ID. + */ + id: string; + /** + * Labels added to messages in this history record. + */ + labelsAdded: Schema$HistoryLabelAdded[]; + /** + * Labels removed from messages in this history record. + */ + labelsRemoved: Schema$HistoryLabelRemoved[]; + /** + * List of messages changed in this history record. The fields for specific + * change types, such as messagesAdded may duplicate messages in this field. + * We recommend using the specific change-type fields instead of this. + */ + messages: Schema$Message[]; + /** + * Messages added to the mailbox in this history record. + */ + messagesAdded: Schema$HistoryMessageAdded[]; + /** + * Messages deleted (not Trashed) from the mailbox in this history record. + */ + messagesDeleted: Schema$HistoryMessageDeleted[]; + } + export interface Schema$HistoryLabelAdded { + /** + * Label IDs added to the message. + */ + labelIds: string[]; + message: Schema$Message; + } + export interface Schema$HistoryLabelRemoved { + /** + * Label IDs removed from the message. + */ + labelIds: string[]; + message: Schema$Message; + } + export interface Schema$HistoryMessageAdded { message: Schema$Message; } + export interface Schema$HistoryMessageDeleted { message: Schema$Message; } + /** + * IMAP settings for an account. + */ + export interface Schema$ImapSettings { + /** + * If this value is true, Gmail will immediately expunge a message when it + * is marked as deleted in IMAP. Otherwise, Gmail will wait for an update + * from the client before expunging messages marked as deleted. + */ + autoExpunge: boolean; + /** + * Whether IMAP is enabled for the account. + */ + enabled: boolean; + /** + * The action that will be executed on a message when it is marked as + * deleted and expunged from the last visible IMAP folder. + */ + expungeBehavior: string; + /** + * An optional limit on the number of messages that an IMAP folder may + * contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero + * is interpreted to mean that there is no limit. + */ + maxFolderSize: number; } - - /** - * gmail.users.settings.forwardingAddresses.create - * @desc Creates a forwarding address. If ownership verification is required, - * a message will be sent to the recipient and the resource's verification - * status will be set to pending; otherwise, the resource will be created with - * verification status set to accepted. This method is only available to - * service account clients that have been delegated domain-wide authority. - * @alias gmail.users.settings.forwardingAddresses.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().ForwardingAddress} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/forwardingAddresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Labels are used to categorize messages and threads within the user's + * mailbox. + */ + export interface Schema$Label { + /** + * The color to assign to the label. Color is only available for labels that + * have their type set to user. + */ + color: Schema$LabelColor; + /** + * The immutable ID of the label. + */ + id: string; + /** + * The visibility of the label in the label list in the Gmail web interface. + */ + labelListVisibility: string; + /** + * The visibility of the label in the message list in the Gmail web + * interface. + */ + messageListVisibility: string; + /** + * The total number of messages with the label. + */ + messagesTotal: number; + /** + * The number of unread messages with the label. + */ + messagesUnread: number; + /** + * The display name of the label. + */ + name: string; + /** + * The total number of threads with the label. + */ + threadsTotal: number; + /** + * The number of unread threads with the label. + */ + threadsUnread: number; + /** + * The owner type for the label. User labels are created by the user and can + * be modified and deleted by the user and can be applied to any message or + * thread. System labels are internally created and cannot be added, + * modified, or deleted. System labels may be able to be applied to or + * removed from messages and threads under some circumstances but this is + * not guaranteed. For example, users can apply and remove the INBOX and + * UNREAD labels from messages and threads, but cannot apply or remove the + * DRAFTS or SENT labels from messages or threads. + */ + type: string; + } + export interface Schema$LabelColor { + /** + * The background color represented as hex string #RRGGBB (ex #000000). This + * field is required in order to set the color of a label. Only the + * following predefined set of color values are allowed: #000000, #434343, + * #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, + * #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, + * #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, + * #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, + * #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, + * #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, + * #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, + * #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c + */ + backgroundColor: string; + /** + * The text color of the label, represented as hex string. This field is + * required in order to set the color of a label. Only the following + * predefined set of color values are allowed: #000000, #434343, #666666, + * #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, #fad165, + * #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, #fef1d1, + * #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, #fce8b3, + * #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, #fcda83, + * #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, #f2c960, + * #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, #d5ae49, + * #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, #aa8831, + * #076239, #1a764d, #1c4587, #41236d, #83334c + */ + textColor: string; + } + export interface Schema$ListDraftsResponse { + /** + * List of drafts. + */ + drafts: Schema$Draft[]; + /** + * Token to retrieve the next page of results in the list. + */ + nextPageToken: string; + /** + * Estimated total number of results. + */ + resultSizeEstimate: number; } - - /** - * gmail.users.settings.forwardingAddresses.delete - * @desc Deletes the specified forwarding address and revokes any verification - * that may have been required. This method is only available to service - * account clients that have been delegated domain-wide authority. - * @alias gmail.users.settings.forwardingAddresses.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingEmail The forwarding address to be deleted. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response for the ListFilters method. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'forwardingEmail'], - pathParams: ['forwardingEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListFiltersResponse { + /** + * List of a user's filters. + */ + filter: Schema$Filter[]; } - - /** - * gmail.users.settings.forwardingAddresses.get - * @desc Gets the specified forwarding address. - * @alias gmail.users.settings.forwardingAddresses.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.forwardingEmail The forwarding address to be retrieved. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response for the ListForwardingAddresses method. */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'forwardingEmail'], - pathParams: ['forwardingEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListForwardingAddressesResponse { + /** + * List of addresses that may be used for forwarding. + */ + forwardingAddresses: Schema$ForwardingAddress[]; + } + export interface Schema$ListHistoryResponse { + /** + * List of history records. Any messages contained in the response will + * typically only have id and threadId fields populated. + */ + history: Schema$History[]; + /** + * The ID of the mailbox's current history record. + */ + historyId: string; + /** + * Page token to retrieve the next page of results in the list. + */ + nextPageToken: string; + } + export interface Schema$ListLabelsResponse { + /** + * List of labels. + */ + labels: Schema$Label[]; + } + export interface Schema$ListMessagesResponse { + /** + * List of messages. + */ + messages: Schema$Message[]; + /** + * Token to retrieve the next page of results in the list. + */ + nextPageToken: string; + /** + * Estimated total number of results. + */ + resultSizeEstimate: number; } - - /** - * gmail.users.settings.forwardingAddresses.list - * @desc Lists the forwarding addresses for the specified account. - * @alias gmail.users.settings.forwardingAddresses.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response for the ListSendAs method. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/forwardingAddresses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$ListSendAsResponse { + /** + * List of send-as aliases. + */ + sendAs: Schema$SendAs[]; } -} - -export class Resource$Users$Settings$Sendas { - root: Gmail; - smimeInfo: Resource$Users$Settings$Sendas$Smimeinfo; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); - this.smimeInfo = new Resource$Users$Settings$Sendas$Smimeinfo(root); + export interface Schema$ListSmimeInfoResponse { + /** + * List of SmimeInfo. + */ + smimeInfo: Schema$SmimeInfo[]; } - - getRoot() { - return this.root; + export interface Schema$ListThreadsResponse { + /** + * Page token to retrieve the next page of results in the list. + */ + nextPageToken: string; + /** + * Estimated total number of results. + */ + resultSizeEstimate: number; + /** + * List of threads. + */ + threads: Schema$Thread[]; } - - /** - * gmail.users.settings.sendAs.create - * @desc Creates a custom "from" send-as alias. If an SMTP MSA is specified, - * Gmail will attempt to connect to the SMTP service to validate the - * configuration before creating the alias. If ownership verification is - * required for the alias, a message will be sent to the email address and the - * resource's verification status will be set to pending; otherwise, the - * resource will be created with verification status set to accepted. If a - * signature is provided, Gmail will sanitize the HTML before saving it with - * the alias. This method is only available to service account clients that - * have been delegated domain-wide authority. - * @alias gmail.users.settings.sendAs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().SendAs} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/sendAs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An email message. + */ + export interface Schema$Message { + /** + * The ID of the last history record that modified this message. + */ + historyId: string; + /** + * The immutable ID of the message. + */ + id: string; + /** + * The internal message creation timestamp (epoch ms), which determines + * ordering in the inbox. For normal SMTP-received email, this represents + * the time the message was originally accepted by Google, which is more + * reliable than the Date header. However, for API-migrated mail, it can be + * configured by client to be based on the Date header. + */ + internalDate: string; + /** + * List of IDs of labels applied to this message. + */ + labelIds: string[]; + /** + * The parsed email structure in the message parts. + */ + payload: Schema$MessagePart; + /** + * The entire email message in an RFC 2822 formatted and base64url encoded + * string. Returned in messages.get and drafts.get responses when the + * format=RAW parameter is supplied. + */ + raw: string; + /** + * Estimated size in bytes of the message. + */ + sizeEstimate: number; + /** + * A short part of the message text. + */ + snippet: string; + /** + * The ID of the thread the message belongs to. To add a message or draft to + * a thread, the following criteria must be met: - The requested threadId + * must be specified on the Message or Draft.Message you supply with your + * request. - The References and In-Reply-To headers must be set in + * compliance with the RFC 2822 standard. - The Subject headers must match. + */ + threadId: string; } - - /** - * gmail.users.settings.sendAs.delete - * @desc Deletes the specified send-as alias. Revokes any verification that - * may have been required for using it. This method is only available to - * service account clients that have been delegated domain-wide authority. - * @alias gmail.users.settings.sendAs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The send-as alias to be deleted. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A single MIME message part. + */ + export interface Schema$MessagePart { + /** + * The message part body for this part, which may be empty for container + * MIME message parts. + */ + body: Schema$MessagePartBody; + /** + * The filename of the attachment. Only present if this message part + * represents an attachment. + */ + filename: string; + /** + * List of headers on this message part. For the top-level message part, + * representing the entire message payload, it will contain the standard RFC + * 2822 email headers such as To, From, and Subject. + */ + headers: Schema$MessagePartHeader[]; + /** + * The MIME type of the message part. + */ + mimeType: string; + /** + * The immutable ID of the message part. + */ + partId: string; + /** + * The child MIME message parts of this part. This only applies to container + * MIME message parts, for example multipart/*. For non- container MIME + * message part types, such as text/plain, this field is empty. For more + * information, see RFC 1521. + */ + parts: Schema$MessagePart[]; } - - /** - * gmail.users.settings.sendAs.get - * @desc Gets the specified send-as alias. Fails with an HTTP 404 error if the - * specified address is not a member of the collection. - * @alias gmail.users.settings.sendAs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The send-as alias to be retrieved. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The body of a single MIME message part. + */ + export interface Schema$MessagePartBody { + /** + * When present, contains the ID of an external attachment that can be + * retrieved in a separate messages.attachments.get request. When not + * present, the entire content of the message part body is contained in the + * data field. + */ + attachmentId: string; + /** + * The body data of a MIME message part as a base64url encoded string. May + * be empty for MIME container types that have no message body or when the + * body data is sent as a separate attachment. An attachment ID is present + * if the body data is contained in a separate attachment. + */ + data: string; + /** + * Number of bytes for the message part data (encoding notwithstanding). + */ + size: number; + } + export interface Schema$MessagePartHeader { + /** + * The name of the header before the : separator. For example, To. + */ + name: string; + /** + * The value of the header after the : separator. For example, + * someuser@example.com. + */ + value: string; + } + export interface Schema$ModifyMessageRequest { + /** + * A list of IDs of labels to add to this message. + */ + addLabelIds: string[]; + /** + * A list IDs of labels to remove from this message. + */ + removeLabelIds: string[]; + } + export interface Schema$ModifyThreadRequest { + /** + * A list of IDs of labels to add to this thread. + */ + addLabelIds: string[]; + /** + * A list of IDs of labels to remove from this thread. + */ + removeLabelIds: string[]; } - - /** - * gmail.users.settings.sendAs.list - * @desc Lists the send-as aliases for the specified account. The result - * includes the primary send-as address associated with the account as well as - * any custom "from" aliases. - * @alias gmail.users.settings.sendAs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/settings/sendAs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * POP settings for an account. + */ + export interface Schema$PopSettings { + /** + * The range of messages which are accessible via POP. + */ + accessWindow: string; + /** + * The action that will be executed on a message after it has been fetched + * via POP. + */ + disposition: string; } - - /** - * gmail.users.settings.sendAs.patch - * @desc Updates a send-as alias. If a signature is provided, Gmail will - * sanitize the HTML before saving it with the alias. Addresses other than - * the primary address for the account can only be updated by service account - * clients that have been delegated domain-wide authority. This method - * supports patch semantics. - * @alias gmail.users.settings.sendAs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The send-as alias to be updated. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().SendAs} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Profile for a Gmail user. + */ + export interface Schema$Profile { + /** + * The user's email address. + */ + emailAddress: string; + /** + * The ID of the mailbox's current history record. + */ + historyId: string; + /** + * The total number of messages in the mailbox. + */ + messagesTotal: number; + /** + * The total number of threads in the mailbox. + */ + threadsTotal: number; } - - /** - * gmail.users.settings.sendAs.update - * @desc Updates a send-as alias. If a signature is provided, Gmail will - * sanitize the HTML before saving it with the alias. Addresses other than - * the primary address for the account can only be updated by service account - * clients that have been delegated domain-wide authority. - * @alias gmail.users.settings.sendAs.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The send-as alias to be updated. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {().SendAs} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Settings associated with a send-as alias, which can be either the primary + * login address associated with the account or a custom "from" + * address. Send-as aliases correspond to the "Send Mail As" feature + * in the web interface. + */ + export interface Schema$SendAs { + /** + * A name that appears in the "From:" header for mail sent using + * this alias. For custom "from" addresses, when this is empty, + * Gmail will populate the "From:" header with the name that is + * used for the primary address associated with the account. If the admin + * has disabled the ability for users to update their name format, requests + * to update this field for the primary login will silently fail. + */ + displayName: string; + /** + * Whether this address is selected as the default "From:" address + * in situations such as composing a new message or sending a vacation + * auto-reply. Every Gmail account has exactly one default send-as address, + * so the only legal value that clients may write to this field is true. + * Changing this from false to true for an address will result in this field + * becoming false for the other previous default address. + */ + isDefault: boolean; + /** + * Whether this address is the primary address used to login to the account. + * Every Gmail account has exactly one primary address, and it cannot be + * deleted from the collection of send-as aliases. This field is read-only. + */ + isPrimary: boolean; + /** + * An optional email address that is included in a "Reply-To:" + * header for mail sent using this alias. If this is empty, Gmail will not + * generate a "Reply-To:" header. + */ + replyToAddress: string; + /** + * The email address that appears in the "From:" header for mail + * sent using this alias. This is read-only for all operations except + * create. + */ + sendAsEmail: string; + /** + * An optional HTML signature that is included in messages composed with + * this alias in the Gmail web UI. + */ + signature: string; + /** + * An optional SMTP service that will be used as an outbound relay for mail + * sent using this alias. If this is empty, outbound mail will be sent + * directly from Gmail's servers to the destination SMTP service. This + * setting only applies to custom "from" aliases. + */ + smtpMsa: Schema$SmtpMsa; + /** + * Whether Gmail should treat this address as an alias for the user's + * primary email address. This setting only applies to custom + * "from" aliases. + */ + treatAsAlias: boolean; + /** + * Indicates whether this address has been verified for use as a send-as + * alias. Read-only. This setting only applies to custom "from" + * aliases. + */ + verificationStatus: string; } - - /** - * gmail.users.settings.sendAs.verify - * @desc Sends a verification email to the specified send-as alias address. - * The verification status must be pending. This method is only available to - * service account clients that have been delegated domain-wide authority. - * @alias gmail.users.settings.sendAs.verify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The send-as alias to be verified. - * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verify(params?: any, options?: MethodOptions): AxiosPromise; - verify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - verify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An S/MIME email config. + */ + export interface Schema$SmimeInfo { + /** + * Encrypted key password, when key is encrypted. + */ + encryptedKeyPassword: string; + /** + * When the certificate expires (in milliseconds since epoch). + */ + expiration: string; + /** + * The immutable ID for the SmimeInfo. + */ + id: string; + /** + * Whether this SmimeInfo is the default one for this user's send-as + * address. + */ + isDefault: boolean; + /** + * The S/MIME certificate issuer's common name. + */ + issuerCn: string; + /** + * PEM formatted X509 concatenated certificate string (standard base64 + * encoding). Format used for returning key, which includes public key as + * well as certificate chain (not private key). + */ + pem: string; + /** + * PKCS#12 format containing a single private/public key pair and + * certificate chain. This format is only accepted from client for creating + * a new SmimeInfo and is never returned, because the private key is not + * intended to be exported. PKCS#12 may be encrypted, in which case + * encryptedKeyPassword should be set appropriately. + */ + pkcs12: string; } -} -export class Resource$Users$Settings$Sendas$Smimeinfo { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); + /** + * Configuration for communication with an SMTP service. + */ + export interface Schema$SmtpMsa { + /** + * The hostname of the SMTP service. Required. + */ + host: string; + /** + * The password that will be used for authentication with the SMTP service. + * This is a write-only field that can be specified in requests to create or + * update SendAs settings; it is never populated in responses. + */ + password: string; + /** + * The port of the SMTP service. Required. + */ + port: number; + /** + * The protocol that will be used to secure communication with the SMTP + * service. Required. + */ + securityMode: string; + /** + * The username that will be used for authentication with the SMTP service. + * This is a write-only field that can be specified in requests to create or + * update SendAs settings; it is never populated in responses. + */ + username: string; } - - getRoot() { - return this.root; + /** + * A collection of messages representing a conversation. + */ + export interface Schema$Thread { + /** + * The ID of the last history record that modified this thread. + */ + historyId: string; + /** + * The unique ID of the thread. + */ + id: string; + /** + * The list of messages in the thread. + */ + messages: Schema$Message[]; + /** + * A short part of the message text. + */ + snippet: string; } - - /** - * gmail.users.settings.sendAs.smimeInfo.delete - * @desc Deletes the specified S/MIME config for the specified send-as alias. - * @alias gmail.users.settings.sendAs.smimeInfo.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The immutable ID for the SmimeInfo. - * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail', 'id'], - pathParams: ['id', 'sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Vacation auto-reply settings for an account. These settings correspond to + * the "Vacation responder" feature in the web interface. + */ + export interface Schema$VacationSettings { + /** + * Flag that controls whether Gmail automatically replies to messages. + */ + enableAutoReply: boolean; + /** + * An optional end time for sending auto-replies (epoch ms). When this is + * specified, Gmail will automatically reply only to messages that it + * receives before the end time. If both startTime and endTime are + * specified, startTime must precede endTime. + */ + endTime: string; + /** + * Response body in HTML format. Gmail will sanitize the HTML before storing + * it. + */ + responseBodyHtml: string; + /** + * Response body in plain text format. + */ + responseBodyPlainText: string; + /** + * Optional text to prepend to the subject line in vacation responses. In + * order to enable auto-replies, either the response subject or the response + * body must be nonempty. + */ + responseSubject: string; + /** + * Flag that determines whether responses are sent to recipients who are not + * in the user's list of contacts. + */ + restrictToContacts: boolean; + /** + * Flag that determines whether responses are sent to recipients who are + * outside of the user's domain. This feature is only available for G + * Suite users. + */ + restrictToDomain: boolean; + /** + * An optional start time for sending auto-replies (epoch ms). When this is + * specified, Gmail will automatically reply only to messages that it + * receives after the start time. If both startTime and endTime are + * specified, startTime must precede endTime. + */ + startTime: string; } - - /** - * gmail.users.settings.sendAs.smimeInfo.get - * @desc Gets the specified S/MIME config for the specified send-as alias. - * @alias gmail.users.settings.sendAs.smimeInfo.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The immutable ID for the SmimeInfo. - * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail', 'id'], - pathParams: ['id', 'sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Set up or update a new push notification watch on this user's mailbox. + */ + export interface Schema$WatchRequest { + /** + * Filtering behavior of labelIds list specified. + */ + labelFilterAction: string; + /** + * List of label_ids to restrict notifications about. By default, if + * unspecified, all changes are pushed out. If specified then dictates which + * labels are required for a push notification to be generated. + */ + labelIds: string[]; + /** + * A fully qualified Google Cloud Pub/Sub API topic name to publish the + * events to. This topic name **must** already exist in Cloud Pub/Sub and + * you **must** have already granted gmail "publish" permission on + * it. For example, + * "projects/my-project-identifier/topics/my-topic-name" (using + * the Cloud Pub/Sub "v1" topic naming format). Note that the + * "my-project-identifier" portion must exactly match your Google + * developer project id (the one executing this watch request). + */ + topicName: string; } - - /** - * gmail.users.settings.sendAs.smimeInfo.insert - * @desc Insert (upload) the given S/MIME config for the specified send-as - * alias. Note that pkcs12 format is required for the key. - * @alias gmail.users.settings.sendAs.smimeInfo.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().SmimeInfo} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Push notification watch response. + */ + export interface Schema$WatchResponse { + /** + * When Gmail will stop sending notifications for mailbox updates (epoch + * millis). Call watch again before this time to renew the watch. + */ + expiration: string; + /** + * The ID of the mailbox's current history record. + */ + historyId: string; } - - /** - * gmail.users.settings.sendAs.smimeInfo.list - * @desc Lists S/MIME configs for the specified send-as alias. - * @alias gmail.users.settings.sendAs.smimeInfo.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Users { + root: Gmail; + drafts: Resource$Users$Drafts; + history: Resource$Users$History; + labels: Resource$Users$Labels; + messages: Resource$Users$Messages; + settings: Resource$Users$Settings; + threads: Resource$Users$Threads; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + this.drafts = new Resource$Users$Drafts(root); + this.history = new Resource$Users$History(root); + this.labels = new Resource$Users$Labels(root); + this.messages = new Resource$Users$Messages(root); + this.settings = new Resource$Users$Settings(root); + this.threads = new Resource$Users$Threads(root); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.getProfile + * @desc Gets the current user's Gmail profile. + * @alias gmail.users.getProfile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getProfile(params?: any, options?: MethodOptions): + AxiosPromise; + getProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/profile') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.stop + * @desc Stop receiving push notifications for the given user mailbox. + * @alias gmail.users.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.watch + * @desc Set up or update a push notification watch on the given user + * mailbox. + * @alias gmail.users.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().WatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): + AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail'], - pathParams: ['sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Users$Drafts { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.drafts.create + * @desc Creates a new draft with the DRAFT label. + * @alias gmail.users.drafts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.drafts.delete + * @desc Immediately and permanently deletes the specified draft. Does not + * simply trash it. + * @alias gmail.users.drafts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the draft to delete. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.drafts.get + * @desc Gets the specified draft. + * @alias gmail.users.drafts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format The format to return the draft in. + * @param {string} params.id The ID of the draft to retrieve. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.drafts.list + * @desc Lists the drafts in the user's mailbox. + * @alias gmail.users.drafts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeSpamTrash Include drafts from SPAM and TRASH in the results. + * @param {integer=} params.maxResults Maximum number of drafts to return. + * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. + * @param {string=} params.q Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.drafts.send + * @desc Sends the specified, existing draft to the recipients in the To, + * Cc, and Bcc headers. + * @alias gmail.users.drafts.send + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + send(params?: any, options?: MethodOptions): AxiosPromise; + send( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + send( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts/send') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/send') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.drafts.update + * @desc Replaces a draft's content. + * @alias gmail.users.drafts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the draft to update. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/drafts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/drafts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gmail.users.settings.sendAs.smimeInfo.setDefault - * @desc Sets the default S/MIME config for the specified send-as alias. - * @alias gmail.users.settings.sendAs.smimeInfo.setDefault - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The immutable ID for the SmimeInfo. - * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDefault(params?: any, options?: MethodOptions): AxiosPromise; - setDefault( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDefault( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'sendAsEmail', 'id'], - pathParams: ['id', 'sendAsEmail', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Users$History { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.history.list + * @desc Lists the history of all changes to the given mailbox. History + * results are returned in chronological order (increasing historyId). + * @alias gmail.users.history.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.historyTypes History types to be returned by the function + * @param {string=} params.labelId Only return messages with a label matching the ID. + * @param {integer=} params.maxResults The maximum number of history records to return. + * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. + * @param {string=} params.startHistoryId Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/history') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - - -export class Resource$Users$Threads { - root: Gmail; - constructor(root: Gmail) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Users$Labels { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.labels.create + * @desc Creates a new label. + * @alias gmail.users.labels.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().Label} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.labels.delete + * @desc Immediately and permanently deletes the specified label and removes + * it from any messages and threads that it is applied to. + * @alias gmail.users.labels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the label to delete. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.labels.get + * @desc Gets the specified label. + * @alias gmail.users.labels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the label to retrieve. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.labels.list + * @desc Lists all labels in the user's mailbox. + * @alias gmail.users.labels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.labels.patch + * @desc Updates the specified label. This method supports patch semantics. + * @alias gmail.users.labels.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the label to update. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().Label} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.labels.update + * @desc Updates the specified label. + * @alias gmail.users.labels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the label to update. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().Label} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/labels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; - } + export class Resource$Users$Messages { + root: Gmail; + attachments: Resource$Users$Messages$Attachments; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + this.attachments = new Resource$Users$Messages$Attachments(root); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.messages.batchDelete + * @desc Deletes many messages by message ID. Provides no guarantees that + * messages were not already deleted or even existed at all. + * @alias gmail.users.messages.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().BatchDeleteMessagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): AxiosPromise; + batchDelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchDelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.batchModify + * @desc Modifies the labels on the specified messages. + * @alias gmail.users.messages.batchModify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().BatchModifyMessagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchModify(params?: any, options?: MethodOptions): AxiosPromise; + batchModify( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchModify( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/batchModify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.delete + * @desc Immediately and permanently deletes the specified message. This + * operation cannot be undone. Prefer messages.trash instead. + * @alias gmail.users.messages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the message to delete. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.get + * @desc Gets the specified message. + * @alias gmail.users.messages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format The format to return the message in. + * @param {string} params.id The ID of the message to retrieve. + * @param {string=} params.metadataHeaders When given and format is METADATA, only include headers specified. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.import + * @desc Imports a message into only this user's mailbox, with standard + * email delivery scanning and classification similar to receiving via SMTP. + * Does not send a message. + * @alias gmail.users.messages.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deleted Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. + * @param {string=} params.internalDateSource Source for Gmail's internal date of the message. + * @param {boolean=} params.neverMarkSpam Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. + * @param {boolean=} params.processForCalendar Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ +import(params?: any, options?: MethodOptions): AxiosPromise; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { + callback = options; + options = {}; + } if(typeof params === 'function') { + callback = params; + params = {}; + } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/import').replace(/([^:]\/)\/+/g, '$1'), requiredParams: ['userId'], pathParams: ['userId'], context: this.getRoot()}; if(callback) { + createAPIRequest(parameters, callback); + } else { return createAPIRequest(parameters); + }} - /** - * gmail.users.threads.delete - * @desc Immediately and permanently deletes the specified thread. This - * operation cannot be undone. Prefer threads.trash instead. - * @alias gmail.users.threads.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id ID of the Thread to delete. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * gmail.users.messages.insert + * @desc Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. + * @alias gmail.users.messages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deleted Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. + * @param {string=} params.internalDateSource Source for Gmail's internal date of the message. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.list + * @desc Lists the messages in the user's mailbox. + * @alias gmail.users.messages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeSpamTrash Include messages from SPAM and TRASH in the results. + * @param {string=} params.labelIds Only return messages with labels that match all of the specified label IDs. + * @param {integer=} params.maxResults Maximum number of messages to return. + * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. + * @param {string=} params.q Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.modify + * @desc Modifies the labels on the specified message. + * @alias gmail.users.messages.modify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the message to modify. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().ModifyMessageRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modify(params?: any, options?: MethodOptions): AxiosPromise; + modify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/modify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.send + * @desc Sends the specified message to the recipients in the To, Cc, and + * Bcc headers. + * @alias gmail.users.messages.send + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + send(params?: any, options?: MethodOptions): AxiosPromise; + send( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + send( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/send') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/gmail/v1/users/{userId}/messages/send') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.trash + * @desc Moves the specified message to the trash. + * @alias gmail.users.messages.trash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the message to Trash. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + trash(params?: any, options?: MethodOptions): AxiosPromise; + trash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + trash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/trash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.messages.untrash + * @desc Removes the specified message from the trash. + * @alias gmail.users.messages.untrash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the message to remove from Trash. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + untrash(params?: any, options?: MethodOptions): + AxiosPromise; + untrash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + untrash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/messages/{id}/untrash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - - /** - * gmail.users.threads.get - * @desc Gets the specified thread. - * @alias gmail.users.threads.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format The format to return the messages in. - * @param {string} params.id The ID of the thread to retrieve. - * @param {string=} params.metadataHeaders When given and format is METADATA, only include headers specified. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Users$Messages$Attachments { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.messages.attachments.get + * @desc Gets the specified message attachment. + * @alias gmail.users.messages.attachments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the attachment. + * @param {string} params.messageId The ID of the message containing the attachment. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'messageId', 'id'], + pathParams: ['id', 'messageId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * gmail.users.threads.list - * @desc Lists the threads in the user's mailbox. - * @alias gmail.users.threads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeSpamTrash Include threads from SPAM and TRASH in the results. - * @param {string=} params.labelIds Only return threads with labels that match all of the specified label IDs. - * @param {integer=} params.maxResults Maximum number of threads to return. - * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. - * @param {string=} params.q Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Settings { + root: Gmail; + filters: Resource$Users$Settings$Filters; + forwardingAddresses: Resource$Users$Settings$Forwardingaddresses; + sendAs: Resource$Users$Settings$Sendas; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + this.filters = new Resource$Users$Settings$Filters(root); + this.forwardingAddresses = + new Resource$Users$Settings$Forwardingaddresses(root); + this.sendAs = new Resource$Users$Settings$Sendas(root); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.settings.getAutoForwarding + * @desc Gets the auto-forwarding setting for the specified account. + * @alias gmail.users.settings.getAutoForwarding + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAutoForwarding(params?: any, options?: MethodOptions): + AxiosPromise; + getAutoForwarding( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAutoForwarding( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.getImap + * @desc Gets IMAP settings. + * @alias gmail.users.settings.getImap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getImap(params?: any, options?: MethodOptions): + AxiosPromise; + getImap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getImap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.getPop + * @desc Gets POP settings. + * @alias gmail.users.settings.getPop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getPop(params?: any, options?: MethodOptions): + AxiosPromise; + getPop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getPop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/pop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.getVacation + * @desc Gets vacation responder settings. + * @alias gmail.users.settings.getVacation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getVacation(params?: any, options?: MethodOptions): + AxiosPromise; + getVacation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getVacation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/vacation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.updateAutoForwarding + * @desc Updates the auto-forwarding setting for the specified account. A + * verified forwarding address must be specified when auto-forwarding is + * enabled. This method is only available to service account clients that + * have been delegated domain-wide authority. + * @alias gmail.users.settings.updateAutoForwarding + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().AutoForwarding} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateAutoForwarding(params?: any, options?: MethodOptions): + AxiosPromise; + updateAutoForwarding( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateAutoForwarding( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/gmail/v1/users/{userId}/settings/autoForwarding') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.updateImap + * @desc Updates IMAP settings. + * @alias gmail.users.settings.updateImap + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().ImapSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateImap(params?: any, options?: MethodOptions): + AxiosPromise; + updateImap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateImap( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/imap') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.updatePop + * @desc Updates POP settings. + * @alias gmail.users.settings.updatePop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().PopSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatePop(params?: any, options?: MethodOptions): + AxiosPromise; + updatePop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updatePop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/pop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.updateVacation + * @desc Updates vacation responder settings. + * @alias gmail.users.settings.updateVacation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().VacationSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateVacation(params?: any, options?: MethodOptions): + AxiosPromise; + updateVacation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateVacation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/vacation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Users$Settings$Filters { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.settings.filters.create + * @desc Creates a filter. + * @alias gmail.users.settings.filters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().Filter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.filters.delete + * @desc Deletes a filter. + * @alias gmail.users.settings.filters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the filter to be deleted. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.filters.get + * @desc Gets a filter. + * @alias gmail.users.settings.filters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the filter to be fetched. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.filters.list + * @desc Lists the message filters of a Gmail user. + * @alias gmail.users.settings.filters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/filters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * gmail.users.threads.modify - * @desc Modifies the labels applied to the thread. This applies to all - * messages in the thread. - * @alias gmail.users.threads.modify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the thread to modify. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {().ModifyThreadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modify(params?: any, options?: MethodOptions): AxiosPromise; - modify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modify( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/modify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Users$Settings$Forwardingaddresses { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.settings.forwardingAddresses.create + * @desc Creates a forwarding address. If ownership verification is + * required, a message will be sent to the recipient and the resource's + * verification status will be set to pending; otherwise, the resource will + * be created with verification status set to accepted. This method is only + * available to service account clients that have been delegated domain-wide + * authority. + * @alias gmail.users.settings.forwardingAddresses.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().ForwardingAddress} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/forwardingAddresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.forwardingAddresses.delete + * @desc Deletes the specified forwarding address and revokes any + * verification that may have been required. This method is only available + * to service account clients that have been delegated domain-wide + * authority. + * @alias gmail.users.settings.forwardingAddresses.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingEmail The forwarding address to be deleted. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'forwardingEmail'], + pathParams: ['forwardingEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.forwardingAddresses.get + * @desc Gets the specified forwarding address. + * @alias gmail.users.settings.forwardingAddresses.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.forwardingEmail The forwarding address to be retrieved. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'forwardingEmail'], + pathParams: ['forwardingEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.forwardingAddresses.list + * @desc Lists the forwarding addresses for the specified account. + * @alias gmail.users.settings.forwardingAddresses.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/forwardingAddresses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * gmail.users.threads.trash - * @desc Moves the specified thread to the trash. - * @alias gmail.users.threads.trash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the thread to Trash. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - trash(params?: any, options?: MethodOptions): AxiosPromise; - trash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - trash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Settings$Sendas { + root: Gmail; + smimeInfo: Resource$Users$Settings$Sendas$Smimeinfo; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + this.smimeInfo = new Resource$Users$Settings$Sendas$Smimeinfo(root); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.settings.sendAs.create + * @desc Creates a custom "from" send-as alias. If an SMTP MSA is specified, + * Gmail will attempt to connect to the SMTP service to validate the + * configuration before creating the alias. If ownership verification is + * required for the alias, a message will be sent to the email address and + * the resource's verification status will be set to pending; otherwise, the + * resource will be created with verification status set to accepted. If a + * signature is provided, Gmail will sanitize the HTML before saving it with + * the alias. This method is only available to service account clients that + * have been delegated domain-wide authority. + * @alias gmail.users.settings.sendAs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().SendAs} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/sendAs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.delete + * @desc Deletes the specified send-as alias. Revokes any verification that + * may have been required for using it. This method is only available to + * service account clients that have been delegated domain-wide authority. + * @alias gmail.users.settings.sendAs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The send-as alias to be deleted. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.get + * @desc Gets the specified send-as alias. Fails with an HTTP 404 error if + * the specified address is not a member of the collection. + * @alias gmail.users.settings.sendAs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The send-as alias to be retrieved. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.list + * @desc Lists the send-as aliases for the specified account. The result + * includes the primary send-as address associated with the account as well + * as any custom "from" aliases. + * @alias gmail.users.settings.sendAs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/settings/sendAs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.patch + * @desc Updates a send-as alias. If a signature is provided, Gmail will + * sanitize the HTML before saving it with the alias. Addresses other than + * the primary address for the account can only be updated by service + * account clients that have been delegated domain-wide authority. This + * method supports patch semantics. + * @alias gmail.users.settings.sendAs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The send-as alias to be updated. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().SendAs} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.update + * @desc Updates a send-as alias. If a signature is provided, Gmail will + * sanitize the HTML before saving it with the alias. Addresses other than + * the primary address for the account can only be updated by service + * account clients that have been delegated domain-wide authority. + * @alias gmail.users.settings.sendAs.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The send-as alias to be updated. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {().SendAs} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.verify + * @desc Sends a verification email to the specified send-as alias address. + * The verification status must be pending. This method is only available + * to service account clients that have been delegated domain-wide + * authority. + * @alias gmail.users.settings.sendAs.verify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The send-as alias to be verified. + * @param {string} params.userId User's email address. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verify(params?: any, options?: MethodOptions): AxiosPromise; + verify( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + verify( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/trash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Users$Settings$Sendas$Smimeinfo { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.settings.sendAs.smimeInfo.delete + * @desc Deletes the specified S/MIME config for the specified send-as + * alias. + * @alias gmail.users.settings.sendAs.smimeInfo.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The immutable ID for the SmimeInfo. + * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail', 'id'], + pathParams: ['id', 'sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.smimeInfo.get + * @desc Gets the specified S/MIME config for the specified send-as alias. + * @alias gmail.users.settings.sendAs.smimeInfo.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The immutable ID for the SmimeInfo. + * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail', 'id'], + pathParams: ['id', 'sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.smimeInfo.insert + * @desc Insert (upload) the given S/MIME config for the specified send-as + * alias. Note that pkcs12 format is required for the key. + * @alias gmail.users.settings.sendAs.smimeInfo.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().SmimeInfo} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.smimeInfo.list + * @desc Lists S/MIME configs for the specified send-as alias. + * @alias gmail.users.settings.sendAs.smimeInfo.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail'], + pathParams: ['sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.settings.sendAs.smimeInfo.setDefault + * @desc Sets the default S/MIME config for the specified send-as alias. + * @alias gmail.users.settings.sendAs.smimeInfo.setDefault + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The immutable ID for the SmimeInfo. + * @param {string} params.sendAsEmail The email address that appears in the "From:" header for mail sent using this alias. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDefault(params?: any, options?: MethodOptions): AxiosPromise; + setDefault( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDefault( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'sendAsEmail', 'id'], + pathParams: ['id', 'sendAsEmail', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * gmail.users.threads.untrash - * @desc Removes the specified thread from the trash. - * @alias gmail.users.threads.untrash - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the thread to remove from Trash. - * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - untrash(params?: any, options?: MethodOptions): AxiosPromise; - untrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - untrash( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/untrash') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId', 'id'], - pathParams: ['id', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + export class Resource$Users$Threads { + root: Gmail; + constructor(root: Gmail) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * gmail.users.threads.delete + * @desc Immediately and permanently deletes the specified thread. This + * operation cannot be undone. Prefer threads.trash instead. + * @alias gmail.users.threads.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id ID of the Thread to delete. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.threads.get + * @desc Gets the specified thread. + * @alias gmail.users.threads.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format The format to return the messages in. + * @param {string} params.id The ID of the thread to retrieve. + * @param {string=} params.metadataHeaders When given and format is METADATA, only include headers specified. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.threads.list + * @desc Lists the threads in the user's mailbox. + * @alias gmail.users.threads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeSpamTrash Include threads from SPAM and TRASH in the results. + * @param {string=} params.labelIds Only return threads with labels that match all of the specified label IDs. + * @param {integer=} params.maxResults Maximum number of threads to return. + * @param {string=} params.pageToken Page token to retrieve a specific page of results in the list. + * @param {string=} params.q Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.threads.modify + * @desc Modifies the labels applied to the thread. This applies to all + * messages in the thread. + * @alias gmail.users.threads.modify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the thread to modify. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {().ModifyThreadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modify(params?: any, options?: MethodOptions): AxiosPromise; + modify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modify( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/modify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.threads.trash + * @desc Moves the specified thread to the trash. + * @alias gmail.users.threads.trash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the thread to Trash. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + trash(params?: any, options?: MethodOptions): AxiosPromise; + trash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + trash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/trash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * gmail.users.threads.untrash + * @desc Removes the specified thread from the trash. + * @alias gmail.users.threads.untrash + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the thread to remove from Trash. + * @param {string} params.userId The user's email address. The special value me can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + untrash(params?: any, options?: MethodOptions): AxiosPromise; + untrash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + untrash( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/gmail/v1/users/{userId}/threads/{id}/untrash') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId', 'id'], + pathParams: ['id', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/groupsmigration/v1.ts b/src/apis/groupsmigration/v1.ts index a820cc1eda9..791c5f3296a 100644 --- a/src/apis/groupsmigration/v1.ts +++ b/src/apis/groupsmigration/v1.ts @@ -27,120 +27,125 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Groups Migration API - * - * Groups Migration Api. - * - * @example - * const google = require('googleapis'); - * const groupsmigration = google.groupsmigration('v1'); - * - * @namespace groupsmigration - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Groupsmigration - */ -export class Groupsmigration { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace groupsmigration_v1 { + /** + * Groups Migration API + * + * Groups Migration Api. + * + * @example + * const google = require('googleapis'); + * const groupsmigration = google.groupsmigration('v1'); + * + * @namespace groupsmigration + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Groupsmigration + */ + export class Groupsmigration { + _options: GlobalOptions; + google: GoogleApis; + root = this; - archive: Resource$Archive; + archive: Resource$Archive; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.archive = new Resource$Archive(this); - } + this.archive = new Resource$Archive(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * JSON response template for groups migration API. - */ -export interface Schema$Groups { - /** - * The kind of insert resource this is. - */ - kind: string; /** - * The status of the insert request. + * JSON response template for groups migration API. */ - responseCode: string; -} - -export class Resource$Archive { - root: Groupsmigration; - constructor(root: Groupsmigration) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$Groups { + /** + * The kind of insert resource this is. + */ + kind: string; + /** + * The status of the insert request. + */ + responseCode: string; } - - /** - * groupsmigration.archive.insert - * @desc Inserts a new mail into the archive of the Google group. - * @alias groupsmigration.archive.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupId The group ID - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Archive { + root: Groupsmigration; + constructor(root: Groupsmigration) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/groups/v1/groups/{groupId}/archive') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/groups/v1/groups/{groupId}/archive') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['groupId'], - pathParams: ['groupId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * groupsmigration.archive.insert + * @desc Inserts a new mail into the archive of the Google group. + * @alias groupsmigration.archive.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupId The group ID + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/groups/v1/groups/{groupId}/archive') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/groups/v1/groups/{groupId}/archive') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['groupId'], + pathParams: ['groupId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/groupssettings/v1.ts b/src/apis/groupssettings/v1.ts index d57751717e7..b0f94952117 100644 --- a/src/apis/groupssettings/v1.ts +++ b/src/apis/groupssettings/v1.ts @@ -27,349 +27,360 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Groups Settings API - * - * Lets you manage permission levels and related settings of a group. - * - * @example - * const google = require('googleapis'); - * const groupssettings = google.groupssettings('v1'); - * - * @namespace groupssettings - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Groupssettings - */ -export class Groupssettings { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace groupssettings_v1 { + /** + * Groups Settings API + * + * Lets you manage permission levels and related settings of a group. + * + * @example + * const google = require('googleapis'); + * const groupssettings = google.groupssettings('v1'); + * + * @namespace groupssettings + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Groupssettings + */ + export class Groupssettings { + _options: GlobalOptions; + google: GoogleApis; + root = this; - groups: Resource$Groups; + groups: Resource$Groups; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.groups = new Resource$Groups(this); - } + this.groups = new Resource$Groups(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * JSON template for Group resource - */ -export interface Schema$Groups { - /** - * Are external members allowed to join the group. - */ - allowExternalMembers: string; - /** - * Is google allowed to contact admins. - */ - allowGoogleCommunication: string; - /** - * If posting from web is allowed. - */ - allowWebPosting: string; - /** - * If the group is archive only - */ - archiveOnly: string; - /** - * Custom footer text. - */ - customFooterText: string; /** - * Default email to which reply to any message should go. - */ - customReplyTo: string; - /** - * Default message deny notification message - */ - defaultMessageDenyNotificationText: string; - /** - * Description of the group - */ - description: string; - /** - * Email id of the group - */ - email: string; - /** - * Whether to include custom footer. - */ - includeCustomFooter: string; - /** - * If this groups should be included in global address list or not. - */ - includeInGlobalAddressList: string; - /** - * If the contents of the group are archived. - */ - isArchived: string; - /** - * The type of the resource. - */ - kind: string; - /** - * Maximum message size allowed. - */ - maxMessageBytes: number; - /** - * Can members post using the group email address. - */ - membersCanPostAsTheGroup: string; - /** - * Default message display font. Possible values are: DEFAULT_FONT - * FIXED_WIDTH_FONT - */ - messageDisplayFont: string; - /** - * Moderation level for messages. Possible values are: MODERATE_ALL_MESSAGES - * MODERATE_NON_MEMBERS MODERATE_NEW_MEMBERS MODERATE_NONE - */ - messageModerationLevel: string; - /** - * Name of the Group - */ - name: string; - /** - * Primary language for the group. - */ - primaryLanguage: string; - /** - * Whome should the default reply to a message go to. Possible values are: - * REPLY_TO_CUSTOM REPLY_TO_SENDER REPLY_TO_LIST REPLY_TO_OWNER - * REPLY_TO_IGNORE REPLY_TO_MANAGERS - */ - replyTo: string; - /** - * Should the member be notified if his message is denied by owner. - */ - sendMessageDenyNotification: string; - /** - * Is the group listed in groups directory - */ - showInGroupDirectory: string; - /** - * Moderation level for messages detected as spam. Possible values are: ALLOW - * MODERATE SILENTLY_MODERATE REJECT - */ - spamModerationLevel: string; - /** - * Permissions to add members. Possible values are: ALL_MANAGERS_CAN_ADD - * ALL_OWNERS_CAN_ADD ALL_MEMBERS_CAN_ADD NONE_CAN_ADD - */ - whoCanAdd: string; - /** - * Permission to contact owner of the group via web UI. Possible values are: - * ANYONE_CAN_CONTACT ALL_IN_DOMAIN_CAN_CONTACT ALL_MEMBERS_CAN_CONTACT - * ALL_MANAGERS_CAN_CONTACT - */ - whoCanContactOwner: string; - /** - * Permissions to invite members. Possible values are: ALL_MEMBERS_CAN_INVITE - * ALL_MANAGERS_CAN_INVITE ALL_OWNERS_CAN_INVITE NONE_CAN_INVITE - */ - whoCanInvite: string; - /** - * Permissions to join the group. Possible values are: ANYONE_CAN_JOIN - * ALL_IN_DOMAIN_CAN_JOIN INVITED_CAN_JOIN CAN_REQUEST_TO_JOIN - */ - whoCanJoin: string; - /** - * Permission to leave the group. Possible values are: ALL_MANAGERS_CAN_LEAVE - * ALL_OWNERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE NONE_CAN_LEAVE - */ - whoCanLeaveGroup: string; - /** - * Permissions to post messages to the group. Possible values are: - * NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST - * ALL_OWNERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST - */ - whoCanPostMessage: string; - /** - * Permissions to view group. Possible values are: ANYONE_CAN_VIEW - * ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW - * ALL_OWNERS_CAN_VIEW - */ - whoCanViewGroup: string; - /** - * Permissions to view membership. Possible values are: ALL_IN_DOMAIN_CAN_VIEW - * ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW - */ - whoCanViewMembership: string; -} - -export class Resource$Groups { - root: Groupssettings; - constructor(root: Groupssettings) { - this.root = root; - this.getRoot.bind(this); + * JSON template for Group resource + */ + export interface Schema$Groups { + /** + * Are external members allowed to join the group. + */ + allowExternalMembers: string; + /** + * Is google allowed to contact admins. + */ + allowGoogleCommunication: string; + /** + * If posting from web is allowed. + */ + allowWebPosting: string; + /** + * If the group is archive only + */ + archiveOnly: string; + /** + * Custom footer text. + */ + customFooterText: string; + /** + * Default email to which reply to any message should go. + */ + customReplyTo: string; + /** + * Default message deny notification message + */ + defaultMessageDenyNotificationText: string; + /** + * Description of the group + */ + description: string; + /** + * Email id of the group + */ + email: string; + /** + * Whether to include custom footer. + */ + includeCustomFooter: string; + /** + * If this groups should be included in global address list or not. + */ + includeInGlobalAddressList: string; + /** + * If the contents of the group are archived. + */ + isArchived: string; + /** + * The type of the resource. + */ + kind: string; + /** + * Maximum message size allowed. + */ + maxMessageBytes: number; + /** + * Can members post using the group email address. + */ + membersCanPostAsTheGroup: string; + /** + * Default message display font. Possible values are: DEFAULT_FONT + * FIXED_WIDTH_FONT + */ + messageDisplayFont: string; + /** + * Moderation level for messages. Possible values are: MODERATE_ALL_MESSAGES + * MODERATE_NON_MEMBERS MODERATE_NEW_MEMBERS MODERATE_NONE + */ + messageModerationLevel: string; + /** + * Name of the Group + */ + name: string; + /** + * Primary language for the group. + */ + primaryLanguage: string; + /** + * Whome should the default reply to a message go to. Possible values are: + * REPLY_TO_CUSTOM REPLY_TO_SENDER REPLY_TO_LIST REPLY_TO_OWNER + * REPLY_TO_IGNORE REPLY_TO_MANAGERS + */ + replyTo: string; + /** + * Should the member be notified if his message is denied by owner. + */ + sendMessageDenyNotification: string; + /** + * Is the group listed in groups directory + */ + showInGroupDirectory: string; + /** + * Moderation level for messages detected as spam. Possible values are: + * ALLOW MODERATE SILENTLY_MODERATE REJECT + */ + spamModerationLevel: string; + /** + * Permissions to add members. Possible values are: ALL_MANAGERS_CAN_ADD + * ALL_OWNERS_CAN_ADD ALL_MEMBERS_CAN_ADD NONE_CAN_ADD + */ + whoCanAdd: string; + /** + * Permission to contact owner of the group via web UI. Possible values are: + * ANYONE_CAN_CONTACT ALL_IN_DOMAIN_CAN_CONTACT ALL_MEMBERS_CAN_CONTACT + * ALL_MANAGERS_CAN_CONTACT + */ + whoCanContactOwner: string; + /** + * Permissions to invite members. Possible values are: + * ALL_MEMBERS_CAN_INVITE ALL_MANAGERS_CAN_INVITE ALL_OWNERS_CAN_INVITE + * NONE_CAN_INVITE + */ + whoCanInvite: string; + /** + * Permissions to join the group. Possible values are: ANYONE_CAN_JOIN + * ALL_IN_DOMAIN_CAN_JOIN INVITED_CAN_JOIN CAN_REQUEST_TO_JOIN + */ + whoCanJoin: string; + /** + * Permission to leave the group. Possible values are: + * ALL_MANAGERS_CAN_LEAVE ALL_OWNERS_CAN_LEAVE ALL_MEMBERS_CAN_LEAVE + * NONE_CAN_LEAVE + */ + whoCanLeaveGroup: string; + /** + * Permissions to post messages to the group. Possible values are: + * NONE_CAN_POST ALL_MANAGERS_CAN_POST ALL_MEMBERS_CAN_POST + * ALL_OWNERS_CAN_POST ALL_IN_DOMAIN_CAN_POST ANYONE_CAN_POST + */ + whoCanPostMessage: string; + /** + * Permissions to view group. Possible values are: ANYONE_CAN_VIEW + * ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW + * ALL_OWNERS_CAN_VIEW + */ + whoCanViewGroup: string; + /** + * Permissions to view membership. Possible values are: + * ALL_IN_DOMAIN_CAN_VIEW ALL_MEMBERS_CAN_VIEW ALL_MANAGERS_CAN_VIEW + */ + whoCanViewMembership: string; } - getRoot() { - return this.root; - } - - - /** - * groupsSettings.groups.get - * @desc Gets one resource by id. - * @alias groupsSettings.groups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupUniqueId The resource ID - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Groups { + root: Groupssettings; + constructor(root: Groupssettings) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupUniqueId'], - pathParams: ['groupUniqueId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * groupsSettings.groups.patch - * @desc Updates an existing resource. This method supports patch semantics. - * @alias groupsSettings.groups.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupUniqueId The resource ID - * @param {().Groups} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * groupsSettings.groups.get + * @desc Gets one resource by id. + * @alias groupsSettings.groups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupUniqueId The resource ID + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupUniqueId'], + pathParams: ['groupUniqueId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['groupUniqueId'], - pathParams: ['groupUniqueId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * groupsSettings.groups.update - * @desc Updates an existing resource. - * @alias groupsSettings.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupUniqueId The resource ID - * @param {().Groups} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * groupsSettings.groups.patch + * @desc Updates an existing resource. This method supports patch semantics. + * @alias groupsSettings.groups.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupUniqueId The resource ID + * @param {().Groups} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['groupUniqueId'], + pathParams: ['groupUniqueId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['groupUniqueId'], - pathParams: ['groupUniqueId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * groupsSettings.groups.update + * @desc Updates an existing resource. + * @alias groupsSettings.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupUniqueId The resource ID + * @param {().Groups} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/groups/v1/groups/{groupUniqueId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['groupUniqueId'], + pathParams: ['groupUniqueId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/iam/v1.ts b/src/apis/iam/v1.ts index ccc12da9a61..5b4b41d874a 100644 --- a/src/apis/iam/v1.ts +++ b/src/apis/iam/v1.ts @@ -27,2472 +27,2489 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Identity and Access Management (IAM) API - * - * Manages identity and access control for Google Cloud Platform resources, - * including the creation of service accounts, which you can use to authenticate - * to Google and make API calls. - * - * @example - * const google = require('googleapis'); - * const iam = google.iam('v1'); - * - * @namespace iam - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Iam - */ -export class Iam { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - iamPolicies: Resource$Iampolicies; - organizations: Resource$Organizations; - permissions: Resource$Permissions; - projects: Resource$Projects; - roles: Resource$Roles; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.iamPolicies = new Resource$Iampolicies(this); - this.organizations = new Resource$Organizations(this); - this.permissions = new Resource$Permissions(this); - this.projects = new Resource$Projects(this); - this.roles = new Resource$Roles(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Contains information about an auditable service. - */ -export interface Schema$AuditableService { - /** - * Public name of the service. For example, the service name for Cloud IAM is - * 'iam.googleapis.com'. - */ - name: string; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Audit log information specific to Cloud IAM. This message is serialized as an - * `Any` type in the `ServiceData` message of an `AuditLog` message. - */ -export interface Schema$AuditData { - /** - * Policy delta between the original policy and the newly set policy. - */ - policyDelta: Schema$PolicyDelta; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * One delta entry for Binding. Each individual change (only one member in each - * entry) to a binding will be a separate entry. - */ -export interface Schema$BindingDelta { - /** - * The action that was performed on a Binding. Required - */ - action: string; - /** - * A single identity requesting access for a Cloud Platform resource. Follows - * the same format of Binding.members. Required - */ - member: string; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * The request to create a new role. - */ -export interface Schema$CreateRoleRequest { - /** - * The Role resource to create. - */ - role: Schema$Role; - /** - * The role id to use for this role. - */ - roleId: string; -} -/** - * The service account key create request. - */ -export interface Schema$CreateServiceAccountKeyRequest { - /** - * Which type of key and algorithm to use for the key. The default is - * currently a 2K RSA key. However this may change in the future. - */ - keyAlgorithm: string; - /** - * The output format of the private key. The default value is - * `TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google Credentials File - * format. - */ - privateKeyType: string; -} -/** - * The service account create request. - */ -export interface Schema$CreateServiceAccountRequest { - /** - * Required. The account id that is used to generate the service account email - * address and a stable unique id. It is unique within a project, must be 6-30 - * characters long, and match the regular expression - * `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. - */ - accountId: string; - /** - * The ServiceAccount resource to create. Currently, only the following values - * are user assignable: `display_name` . - */ - serviceAccount: Schema$ServiceAccount; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The response containing the roles defined under a resource. - */ -export interface Schema$ListRolesResponse { - /** - * To retrieve the next page of results, set `ListRolesRequest.page_token` to - * this value. - */ - nextPageToken: string; - /** - * The Roles defined on this resource. - */ - roles: Schema$Role[]; -} -/** - * The service account keys list response. - */ -export interface Schema$ListServiceAccountKeysResponse { - /** - * The public keys for the service account. - */ - keys: Schema$ServiceAccountKey[]; -} -/** - * The service account list response. - */ -export interface Schema$ListServiceAccountsResponse { - /** - * The list of matching service accounts. - */ - accounts: Schema$ServiceAccount[]; - /** - * To retrieve the next page of results, set - * ListServiceAccountsRequest.page_token to this value. - */ - nextPageToken: string; -} -/** - * A permission which can be included by a role. - */ -export interface Schema$Permission { - /** - * The service API associated with the permission is not enabled. - */ - apiDisabled: boolean; - /** - * The current custom role support level. - */ - customRolesSupportLevel: string; - /** - * A brief description of what this Permission is used for. - */ - description: string; - /** - * The name of this Permission. - */ - name: string; - /** - * This permission can ONLY be used in predefined roles. - */ - onlyInPredefinedRoles: boolean; - /** - * The current launch stage of the permission. - */ - stage: string; - /** - * The title of this Permission. - */ - title: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * The difference delta between two policies. - */ -export interface Schema$PolicyDelta { - /** - * The delta for Bindings between two policies. - */ - bindingDeltas: Schema$BindingDelta[]; -} -/** - * A request to get the list of auditable services for a resource. - */ -export interface Schema$QueryAuditableServicesRequest { - /** - * Required. The full resource name to query from the list of auditable - * services. The name follows the Google Cloud Platform resource format. For - * example, a Cloud Platform project with id `my-project` will be named - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - */ - fullResourceName: string; -} -/** - * A response containing a list of auditable services for a resource. - */ -export interface Schema$QueryAuditableServicesResponse { - /** - * The auditable services for a resource. - */ - services: Schema$AuditableService[]; -} -/** - * The grantable role query request. - */ -export interface Schema$QueryGrantableRolesRequest { - /** - * Required. The full resource name to query from the list of grantable roles. - * The name follows the Google Cloud Platform resource format. For example, a - * Cloud Platform project with id `my-project` will be named - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - */ - fullResourceName: string; - /** - * Optional limit on the number of roles to include in the response. - */ - pageSize: number; - /** - * Optional pagination token returned in an earlier - * QueryGrantableRolesResponse. - */ - pageToken: string; - view: string; -} -/** - * The grantable role query response. - */ -export interface Schema$QueryGrantableRolesResponse { - /** - * To retrieve the next page of results, set - * `QueryGrantableRolesRequest.page_token` to this value. - */ - nextPageToken: string; - /** - * The list of matching roles. - */ - roles: Schema$Role[]; -} -/** - * A request to get permissions which can be tested on a resource. - */ -export interface Schema$QueryTestablePermissionsRequest { - /** - * Required. The full resource name to query from the list of testable - * permissions. The name follows the Google Cloud Platform resource format. - * For example, a Cloud Platform project with id `my-project` will be named - * `//cloudresourcemanager.googleapis.com/projects/my-project`. - */ - fullResourceName: string; - /** - * Optional limit on the number of permissions to include in the response. - */ - pageSize: number; - /** - * Optional pagination token returned in an earlier - * QueryTestablePermissionsRequest. - */ - pageToken: string; -} -/** - * The response containing permissions which can be tested on a resource. - */ -export interface Schema$QueryTestablePermissionsResponse { - /** - * To retrieve the next page of results, set - * `QueryTestableRolesRequest.page_token` to this value. - */ - nextPageToken: string; - /** - * The Permissions testable on the requested resource. - */ - permissions: Schema$Permission[]; -} -/** - * A role in the Identity and Access Management API. - */ -export interface Schema$Role { - /** - * The current deleted state of the role. This field is read only. It will be - * ignored in calls to CreateRole and UpdateRole. - */ - deleted: boolean; - /** - * Optional. A human-readable description for the role. - */ - description: string; - /** - * Used to perform a consistent read-modify-write. - */ - etag: string; - /** - * The names of the permissions this role grants when bound in an IAM policy. - */ - includedPermissions: string[]; - /** - * The name of the role. When Role is used in CreateRole, the role name must - * not be set. When Role is used in output and other input such as - * UpdateRole, the role name is the complete path, e.g., roles/logging.viewer - * for curated roles and organizations/{ORGANIZATION_ID}/roles/logging.viewer - * for custom roles. - */ - name: string; - /** - * The current launch stage of the role. - */ - stage: string; - /** - * Optional. A human-readable title for the role. Typically this is limited - * to 100 UTF-8 bytes. - */ - title: string; -} -/** - * A service account in the Identity and Access Management API. To create a - * service account, specify the `project_id` and the `account_id` for the - * account. The `account_id` is unique within the project, and is used to - * generate the service account email address and a stable `unique_id`. If the - * account already exists, the account's resource name is returned in the - * format of projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. The caller can use - * the name in other methods to access the account. All other methods can - * identify the service account using the format - * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard - * for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` - * value can be the `email` address or the `unique_id` of the service account. - */ -export interface Schema$ServiceAccount { - /** - * Optional. A user-specified description of the service account. Must be - * fewer than 100 UTF-8 bytes. - */ - displayName: string; - /** - * @OutputOnly The email address of the service account. - */ - email: string; - /** - * Used to perform a consistent read-modify-write. - */ - etag: string; - /** - * The resource name of the service account in the following format: - * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Requests using `-` as a - * wildcard for the `PROJECT_ID` will infer the project from the `account` and - * the `ACCOUNT` value can be the `email` address or the `unique_id` of the - * service account. In responses the resource name will always be in the - * format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - */ - name: string; - /** - * @OutputOnly The OAuth2 client id for the service account. This is used in - * conjunction with the OAuth2 clientconfig API to make three legged OAuth2 - * (3LO) flows to access the data of Google users. - */ - oauth2ClientId: string; - /** - * @OutputOnly The id of the project that owns the service account. - */ - projectId: string; - /** - * @OutputOnly The unique and stable id of the service account. - */ - uniqueId: string; -} -/** - * Represents a service account key. A service account has two sets of - * key-pairs: user-managed, and system-managed. User-managed key-pairs can be - * created and deleted by users. Users are responsible for rotating these keys - * periodically to ensure security of their service accounts. Users retain the - * private key of these key-pairs, and Google retains ONLY the public key. - * System-managed key-pairs are managed automatically by Google, and rotated - * daily without user intervention. The private key never leaves Google's - * servers to maximize security. Public keys for all service accounts are also - * published at the OAuth2 Service Account API. - */ -export interface Schema$ServiceAccountKey { - /** - * Specifies the algorithm (and possibly key size) for the key. - */ - keyAlgorithm: string; - /** - * The resource name of the service account key in the following format - * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. - */ - name: string; - /** - * The private key data. Only provided in `CreateServiceAccountKey` responses. - * Make sure to keep the private key data secure because it allows for the - * assertion of the service account identity. When base64 decoded, the private - * key data can be used to authenticate with Google API client libraries and - * with <a - * href="/sdk/gcloud/reference/auth/activate-service-account">gcloud - * auth activate-service-account</a>. - */ - privateKeyData: string; - /** - * The output format for the private key. Only provided in - * `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or - * `ListServiceAccountKey` responses. Google never exposes system-managed - * private keys, and never retains user-managed private keys. - */ - privateKeyType: string; - /** - * The public key data. Only provided in `GetServiceAccountKey` responses. - */ - publicKeyData: string; - /** - * The key can be used after this timestamp. - */ - validAfterTime: string; - /** - * The key can be used before this timestamp. - */ - validBeforeTime: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * The service account sign blob request. - */ -export interface Schema$SignBlobRequest { - /** - * The bytes to sign. - */ - bytesToSign: string; -} -/** - * The service account sign blob response. - */ -export interface Schema$SignBlobResponse { - /** - * The id of the key used to sign the blob. - */ - keyId: string; - /** - * The signed blob. - */ - signature: string; -} -/** - * The service account sign JWT request. - */ -export interface Schema$SignJwtRequest { - /** - * The JWT payload to sign, a JSON JWT Claim set. - */ - payload: string; -} -/** - * The service account sign JWT response. - */ -export interface Schema$SignJwtResponse { - /** - * The id of the key used to sign the JWT. - */ - keyId: string; - /** - * The signed JWT. - */ - signedJwt: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * The request to undelete an existing role. - */ -export interface Schema$UndeleteRoleRequest { - /** - * Used to perform a consistent read-modify-write. - */ - etag: string; -} - -export class Resource$Iampolicies { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace iam_v1 { /** - * iam.iamPolicies.queryAuditableServices - * @desc Returns a list of services that support service level audit logging - * configuration for the given resource. - * @alias iam.iamPolicies.queryAuditableServices - * @memberOf! () + * Identity and Access Management (IAM) API * - * @param {object} params Parameters for request - * @param {().QueryAuditableServicesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - queryAuditableServices(params?: any, options?: MethodOptions): - AxiosPromise; - queryAuditableServices( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - queryAuditableServices( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/iamPolicies:queryAuditableServices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Organizations { - root: Iam; - roles: Resource$Organizations$Roles; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - this.roles = new Resource$Organizations$Roles(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Organizations$Roles { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * iam.organizations.roles.create - * @desc Creates a new Role. - * @alias iam.organizations.roles.create - * @memberOf! () + * Manages identity and access control for Google Cloud Platform resources, + * including the creation of service accounts, which you can use to + * authenticate to Google and make API calls. * - * @param {object} params Parameters for request - * @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` - * @param {().CreateRoleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+parent}/roles').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @example + * const google = require('googleapis'); + * const iam = google.iam('v1'); + * + * @namespace iam + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Iam + */ + export class Iam { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + iamPolicies: Resource$Iampolicies; + organizations: Resource$Organizations; + permissions: Resource$Permissions; + projects: Resource$Projects; + roles: Resource$Roles; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.iamPolicies = new Resource$Iampolicies(this); + this.organizations = new Resource$Organizations(this); + this.permissions = new Resource$Permissions(this); + this.projects = new Resource$Projects(this); + this.roles = new Resource$Roles(this); + } + + getRoot() { + return this.root; } } - /** - * iam.organizations.roles.delete - * @desc Soft deletes a role. The role is suspended and cannot be used to - * create new IAM Policy Bindings. The Role will not be included in - * `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The - * Role contains the deleted boolean set. Existing Bindings remains, but are - * inactive. The Role can be undeleted within 7 days. After 7 days the Role is - * deleted and all Bindings associated with the role are removed. - * @alias iam.organizations.roles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.etag Used to perform a consistent read-modify-write. - * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Contains information about an auditable service. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AuditableService { + /** + * Public name of the service. For example, the service name for Cloud IAM + * is 'iam.googleapis.com'. + */ + name: string; } - - /** - * iam.organizations.roles.get - * @desc Gets a Role definition. - * @alias iam.organizations.roles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; } - - /** - * iam.organizations.roles.list - * @desc Lists the Roles defined on a resource. - * @alias iam.organizations.roles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. - * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. - * @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` - * @param {boolean=} params.showDeleted Include Roles that have been deleted. - * @param {string=} params.view Optional view for the returned Role objects. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Audit log information specific to Cloud IAM. This message is serialized as + * an `Any` type in the `ServiceData` message of an `AuditLog` message. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+parent}/roles').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AuditData { + /** + * Policy delta between the original policy and the newly set policy. + */ + policyDelta: Schema$PolicyDelta; } - - /** - * iam.organizations.roles.patch - * @desc Updates a Role definition. - * @alias iam.organizations.roles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {string=} params.updateMask A mask describing which fields in the Role have changed. - * @param {().Role} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; } - - /** - * iam.organizations.roles.undelete - * @desc Undelete a Role, bringing it back in its previous state. - * @alias iam.organizations.roles.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {().UndeleteRoleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; } -} - - -export class Resource$Permissions { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); + /** + * One delta entry for Binding. Each individual change (only one member in + * each entry) to a binding will be a separate entry. + */ + export interface Schema$BindingDelta { + /** + * The action that was performed on a Binding. Required + */ + action: string; + /** + * A single identity requesting access for a Cloud Platform resource. + * Follows the same format of Binding.members. Required + */ + member: string; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; } - - getRoot() { - return this.root; + /** + * The request to create a new role. + */ + export interface Schema$CreateRoleRequest { + /** + * The Role resource to create. + */ + role: Schema$Role; + /** + * The role id to use for this role. + */ + roleId: string; } - - /** - * iam.permissions.queryTestablePermissions - * @desc Lists the permissions testable on a resource. A permission is - * testable if it can be tested for an identity on a resource. - * @alias iam.permissions.queryTestablePermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().QueryTestablePermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - queryTestablePermissions(params?: any, options?: MethodOptions): - AxiosPromise; - queryTestablePermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - queryTestablePermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/permissions:queryTestablePermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * The service account key create request. + */ + export interface Schema$CreateServiceAccountKeyRequest { + /** + * Which type of key and algorithm to use for the key. The default is + * currently a 2K RSA key. However this may change in the future. + */ + keyAlgorithm: string; + /** + * The output format of the private key. The default value is + * `TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google Credentials File + * format. + */ + privateKeyType: string; } -} - -export class Resource$Projects { - root: Iam; - roles: Resource$Projects$Roles; - serviceAccounts: Resource$Projects$Serviceaccounts; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - this.roles = new Resource$Projects$Roles(root); - this.serviceAccounts = new Resource$Projects$Serviceaccounts(root); + /** + * The service account create request. + */ + export interface Schema$CreateServiceAccountRequest { + /** + * Required. The account id that is used to generate the service account + * email address and a stable unique id. It is unique within a project, must + * be 6-30 characters long, and match the regular expression + * `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. + */ + accountId: string; + /** + * The ServiceAccount resource to create. Currently, only the following + * values are user assignable: `display_name` . + */ + serviceAccount: Schema$ServiceAccount; } - - getRoot() { - return this.root; + /** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * The response containing the roles defined under a resource. + */ + export interface Schema$ListRolesResponse { + /** + * To retrieve the next page of results, set `ListRolesRequest.page_token` + * to this value. + */ + nextPageToken: string; + /** + * The Roles defined on this resource. + */ + roles: Schema$Role[]; } -} -export class Resource$Projects$Roles { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); + /** + * The service account keys list response. + */ + export interface Schema$ListServiceAccountKeysResponse { + /** + * The public keys for the service account. + */ + keys: Schema$ServiceAccountKey[]; } - - getRoot() { - return this.root; + /** + * The service account list response. + */ + export interface Schema$ListServiceAccountsResponse { + /** + * The list of matching service accounts. + */ + accounts: Schema$ServiceAccount[]; + /** + * To retrieve the next page of results, set + * ListServiceAccountsRequest.page_token to this value. + */ + nextPageToken: string; } - - /** - * iam.projects.roles.create - * @desc Creates a new Role. - * @alias iam.projects.roles.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` - * @param {().CreateRoleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+parent}/roles').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A permission which can be included by a role. + */ + export interface Schema$Permission { + /** + * The service API associated with the permission is not enabled. + */ + apiDisabled: boolean; + /** + * The current custom role support level. + */ + customRolesSupportLevel: string; + /** + * A brief description of what this Permission is used for. + */ + description: string; + /** + * The name of this Permission. + */ + name: string; + /** + * This permission can ONLY be used in predefined roles. + */ + onlyInPredefinedRoles: boolean; + /** + * The current launch stage of the permission. + */ + stage: string; + /** + * The title of this Permission. + */ + title: string; } - - /** - * iam.projects.roles.delete - * @desc Soft deletes a role. The role is suspended and cannot be used to - * create new IAM Policy Bindings. The Role will not be included in - * `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The - * Role contains the deleted boolean set. Existing Bindings remains, but are - * inactive. The Role can be undeleted within 7 days. After 7 days the Role is - * deleted and all Bindings associated with the role are removed. - * @alias iam.projects.roles.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.etag Used to perform a consistent read-modify-write. - * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - /** - * iam.projects.roles.get - * @desc Gets a Role definition. - * @alias iam.projects.roles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The difference delta between two policies. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PolicyDelta { + /** + * The delta for Bindings between two policies. + */ + bindingDeltas: Schema$BindingDelta[]; } - - /** - * iam.projects.roles.list - * @desc Lists the Roles defined on a resource. - * @alias iam.projects.roles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. - * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. - * @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` - * @param {boolean=} params.showDeleted Include Roles that have been deleted. - * @param {string=} params.view Optional view for the returned Role objects. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A request to get the list of auditable services for a resource. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+parent}/roles').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$QueryAuditableServicesRequest { + /** + * Required. The full resource name to query from the list of auditable + * services. The name follows the Google Cloud Platform resource format. + * For example, a Cloud Platform project with id `my-project` will be named + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + */ + fullResourceName: string; } - - /** - * iam.projects.roles.patch - * @desc Updates a Role definition. - * @alias iam.projects.roles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {string=} params.updateMask A mask describing which fields in the Role have changed. - * @param {().Role} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A response containing a list of auditable services for a resource. */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$QueryAuditableServicesResponse { + /** + * The auditable services for a resource. + */ + services: Schema$AuditableService[]; } - - /** - * iam.projects.roles.undelete - * @desc Undelete a Role, bringing it back in its previous state. - * @alias iam.projects.roles.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {().UndeleteRoleRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The grantable role query request. + */ + export interface Schema$QueryGrantableRolesRequest { + /** + * Required. The full resource name to query from the list of grantable + * roles. The name follows the Google Cloud Platform resource format. For + * example, a Cloud Platform project with id `my-project` will be named + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + */ + fullResourceName: string; + /** + * Optional limit on the number of roles to include in the response. + */ + pageSize: number; + /** + * Optional pagination token returned in an earlier + * QueryGrantableRolesResponse. + */ + pageToken: string; + view: string; } -} - -export class Resource$Projects$Serviceaccounts { - root: Iam; - keys: Resource$Projects$Serviceaccounts$Keys; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - this.keys = new Resource$Projects$Serviceaccounts$Keys(root); + /** + * The grantable role query response. + */ + export interface Schema$QueryGrantableRolesResponse { + /** + * To retrieve the next page of results, set + * `QueryGrantableRolesRequest.page_token` to this value. + */ + nextPageToken: string; + /** + * The list of matching roles. + */ + roles: Schema$Role[]; } - - getRoot() { - return this.root; + /** + * A request to get permissions which can be tested on a resource. + */ + export interface Schema$QueryTestablePermissionsRequest { + /** + * Required. The full resource name to query from the list of testable + * permissions. The name follows the Google Cloud Platform resource format. + * For example, a Cloud Platform project with id `my-project` will be named + * `//cloudresourcemanager.googleapis.com/projects/my-project`. + */ + fullResourceName: string; + /** + * Optional limit on the number of permissions to include in the response. + */ + pageSize: number; + /** + * Optional pagination token returned in an earlier + * QueryTestablePermissionsRequest. + */ + pageToken: string; } - - /** - * iam.projects.serviceAccounts.create - * @desc Creates a ServiceAccount and returns it. - * @alias iam.projects.serviceAccounts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. - * @param {().CreateServiceAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/serviceAccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response containing permissions which can be tested on a resource. + */ + export interface Schema$QueryTestablePermissionsResponse { + /** + * To retrieve the next page of results, set + * `QueryTestableRolesRequest.page_token` to this value. + */ + nextPageToken: string; + /** + * The Permissions testable on the requested resource. + */ + permissions: Schema$Permission[]; } - - /** - * iam.projects.serviceAccounts.delete - * @desc Deletes a ServiceAccount. - * @alias iam.projects.serviceAccounts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A role in the Identity and Access Management API. + */ + export interface Schema$Role { + /** + * The current deleted state of the role. This field is read only. It will + * be ignored in calls to CreateRole and UpdateRole. + */ + deleted: boolean; + /** + * Optional. A human-readable description for the role. + */ + description: string; + /** + * Used to perform a consistent read-modify-write. + */ + etag: string; + /** + * The names of the permissions this role grants when bound in an IAM + * policy. + */ + includedPermissions: string[]; + /** + * The name of the role. When Role is used in CreateRole, the role name + * must not be set. When Role is used in output and other input such as + * UpdateRole, the role name is the complete path, e.g., + * roles/logging.viewer for curated roles and + * organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. + */ + name: string; + /** + * The current launch stage of the role. + */ + stage: string; + /** + * Optional. A human-readable title for the role. Typically this is + * limited to 100 UTF-8 bytes. + */ + title: string; } - - /** - * iam.projects.serviceAccounts.get - * @desc Gets a ServiceAccount. - * @alias iam.projects.serviceAccounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A service account in the Identity and Access Management API. To create a + * service account, specify the `project_id` and the `account_id` for the + * account. The `account_id` is unique within the project, and is used to + * generate the service account email address and a stable `unique_id`. If + * the account already exists, the account's resource name is returned in + * the format of projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. The caller + * can use the name in other methods to access the account. All other methods + * can identify the service account using the format + * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard + * for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` + * value can be the `email` address or the `unique_id` of the service account. + */ + export interface Schema$ServiceAccount { + /** + * Optional. A user-specified description of the service account. Must be + * fewer than 100 UTF-8 bytes. + */ + displayName: string; + /** + * @OutputOnly The email address of the service account. + */ + email: string; + /** + * Used to perform a consistent read-modify-write. + */ + etag: string; + /** + * The resource name of the service account in the following format: + * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Requests using `-` as + * a wildcard for the `PROJECT_ID` will infer the project from the `account` + * and the `ACCOUNT` value can be the `email` address or the `unique_id` of + * the service account. In responses the resource name will always be in + * the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + */ + name: string; + /** + * @OutputOnly The OAuth2 client id for the service account. This is used in + * conjunction with the OAuth2 clientconfig API to make three legged OAuth2 + * (3LO) flows to access the data of Google users. + */ + oauth2ClientId: string; + /** + * @OutputOnly The id of the project that owns the service account. + */ + projectId: string; + /** + * @OutputOnly The unique and stable id of the service account. + */ + uniqueId: string; } - - /** - * iam.projects.serviceAccounts.getIamPolicy - * @desc Returns the IAM access control policy for a ServiceAccount. - * @alias iam.projects.serviceAccounts.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a service account key. A service account has two sets of + * key-pairs: user-managed, and system-managed. User-managed key-pairs can be + * created and deleted by users. Users are responsible for rotating these + * keys periodically to ensure security of their service accounts. Users + * retain the private key of these key-pairs, and Google retains ONLY the + * public key. System-managed key-pairs are managed automatically by Google, + * and rotated daily without user intervention. The private key never leaves + * Google's servers to maximize security. Public keys for all service + * accounts are also published at the OAuth2 Service Account API. + */ + export interface Schema$ServiceAccountKey { + /** + * Specifies the algorithm (and possibly key size) for the key. + */ + keyAlgorithm: string; + /** + * The resource name of the service account key in the following format + * `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. + */ + name: string; + /** + * The private key data. Only provided in `CreateServiceAccountKey` + * responses. Make sure to keep the private key data secure because it + * allows for the assertion of the service account identity. When base64 + * decoded, the private key data can be used to authenticate with Google API + * client libraries and with <a + * href="/sdk/gcloud/reference/auth/activate-service-account">gcloud + * auth activate-service-account</a>. + */ + privateKeyData: string; + /** + * The output format for the private key. Only provided in + * `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or + * `ListServiceAccountKey` responses. Google never exposes system-managed + * private keys, and never retains user-managed private keys. + */ + privateKeyType: string; + /** + * The public key data. Only provided in `GetServiceAccountKey` responses. + */ + publicKeyData: string; + /** + * The key can be used after this timestamp. + */ + validAfterTime: string; + /** + * The key can be used before this timestamp. + */ + validBeforeTime: string; } - - /** - * iam.projects.serviceAccounts.list - * @desc Lists ServiceAccounts for a project. - * @alias iam.projects.serviceAccounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. - * @param {integer=} params.pageSize Optional limit on the number of service accounts to include in the response. Further accounts can subsequently be obtained by including the ListServiceAccountsResponse.next_page_token in a subsequent request. - * @param {string=} params.pageToken Optional pagination token returned in an earlier ListServiceAccountsResponse.next_page_token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/serviceAccounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; } - - /** - * iam.projects.serviceAccounts.setIamPolicy - * @desc Sets the IAM access control policy for a ServiceAccount. - * @alias iam.projects.serviceAccounts.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The service account sign blob request. */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SignBlobRequest { + /** + * The bytes to sign. + */ + bytesToSign: string; } - - /** - * iam.projects.serviceAccounts.signBlob - * @desc Signs a blob using a service account's system-managed private key. - * @alias iam.projects.serviceAccounts.signBlob - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {().SignBlobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - signBlob(params?: any, options?: MethodOptions): - AxiosPromise; - signBlob( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - signBlob( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:signBlob') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The service account sign blob response. + */ + export interface Schema$SignBlobResponse { + /** + * The id of the key used to sign the blob. + */ + keyId: string; + /** + * The signed blob. + */ + signature: string; } - - /** - * iam.projects.serviceAccounts.signJwt - * @desc Signs a JWT using a service account's system-managed private key. If - * no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an an - * expiry time of one hour by default. If you request an expiry time of more - * than one hour, the request will fail. - * @alias iam.projects.serviceAccounts.signJwt - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {().SignJwtRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The service account sign JWT request. */ - signJwt(params?: any, options?: MethodOptions): - AxiosPromise; - signJwt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - signJwt( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:signJwt').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SignJwtRequest { + /** + * The JWT payload to sign, a JSON JWT Claim set. + */ + payload: string; } - - /** - * iam.projects.serviceAccounts.testIamPermissions - * @desc Tests the specified permissions against the IAM access control policy - * for a ServiceAccount. - * @alias iam.projects.serviceAccounts.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The service account sign JWT response. + */ + export interface Schema$SignJwtResponse { + /** + * The id of the key used to sign the JWT. + */ + keyId: string; + /** + * The signed JWT. + */ + signedJwt: string; } - - /** - * iam.projects.serviceAccounts.update - * @desc Updates a ServiceAccount. Currently, only the following fields are - * updatable: `display_name` . The `etag` is mandatory. - * @alias iam.projects.serviceAccounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Requests using `-` as a wildcard for the `PROJECT_ID` will infer the project from the `account` and the `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. In responses the resource name will always be in the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. - * @param {().ServiceAccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `TestIamPermissions` method. */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Serviceaccounts$Keys { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * iam.projects.serviceAccounts.keys.create - * @desc Creates a ServiceAccountKey and returns it. - * @alias iam.projects.serviceAccounts.keys.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {().CreateServiceAccountKeyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/keys').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * iam.projects.serviceAccounts.keys.delete - * @desc Deletes a ServiceAccountKey. - * @alias iam.projects.serviceAccounts.keys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The request to undelete an existing role. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$UndeleteRoleRequest { + /** + * Used to perform a consistent read-modify-write. + */ + etag: string; } - - /** - * iam.projects.serviceAccounts.keys.get - * @desc Gets the ServiceAccountKey by key id. - * @alias iam.projects.serviceAccounts.keys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {string=} params.publicKeyType The output format of the public key requested. X509_PEM is the default output format. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Iampolicies { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.iamPolicies.queryAuditableServices + * @desc Returns a list of services that support service level audit logging + * configuration for the given resource. + * @alias iam.iamPolicies.queryAuditableServices + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().QueryAuditableServicesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + queryAuditableServices(params?: any, options?: MethodOptions): + AxiosPromise; + queryAuditableServices( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + queryAuditableServices( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/iamPolicies:queryAuditableServices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * iam.projects.serviceAccounts.keys.list - * @desc Lists ServiceAccountKeys. - * @alias iam.projects.serviceAccounts.keys.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.keyTypes Filters the types of keys the user wants to include in the list response. Duplicate key types are not allowed. If no key type is provided, all keys are returned. - * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Organizations { + root: Iam; + roles: Resource$Organizations$Roles; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + this.roles = new Resource$Organizations$Roles(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/keys').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + export class Resource$Organizations$Roles { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.organizations.roles.create + * @desc Creates a new Role. + * @alias iam.organizations.roles.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` + * @param {().CreateRoleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.organizations.roles.delete + * @desc Soft deletes a role. The role is suspended and cannot be used to + * create new IAM Policy Bindings. The Role will not be included in + * `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The + * Role contains the deleted boolean set. Existing Bindings remains, but are + * inactive. The Role can be undeleted within 7 days. After 7 days the Role + * is deleted and all Bindings associated with the role are removed. + * @alias iam.organizations.roles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.etag Used to perform a consistent read-modify-write. + * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.organizations.roles.get + * @desc Gets a Role definition. + * @alias iam.organizations.roles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.organizations.roles.list + * @desc Lists the Roles defined on a resource. + * @alias iam.organizations.roles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. + * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. + * @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` + * @param {boolean=} params.showDeleted Include Roles that have been deleted. + * @param {string=} params.view Optional view for the returned Role objects. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.organizations.roles.patch + * @desc Updates a Role definition. + * @alias iam.organizations.roles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {string=} params.updateMask A mask describing which fields in the Role have changed. + * @param {().Role} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.organizations.roles.undelete + * @desc Undelete a Role, bringing it back in its previous state. + * @alias iam.organizations.roles.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {().UndeleteRoleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): AxiosPromise; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Roles { - root: Iam; - constructor(root: Iam) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export class Resource$Permissions { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.permissions.queryTestablePermissions + * @desc Lists the permissions testable on a resource. A permission is + * testable if it can be tested for an identity on a resource. + * @alias iam.permissions.queryTestablePermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().QueryTestablePermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + queryTestablePermissions(params?: any, options?: MethodOptions): + AxiosPromise; + queryTestablePermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + queryTestablePermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/permissions:queryTestablePermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * iam.roles.get - * @desc Gets a Role definition. - * @alias iam.roles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Iam; + roles: Resource$Projects$Roles; + serviceAccounts: Resource$Projects$Serviceaccounts; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + this.roles = new Resource$Projects$Roles(root); + this.serviceAccounts = new Resource$Projects$Serviceaccounts(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Roles { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.projects.roles.create + * @desc Creates a new Role. + * @alias iam.projects.roles.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The resource name of the parent resource in one of the following formats: `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` + * @param {().CreateRoleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.roles.delete + * @desc Soft deletes a role. The role is suspended and cannot be used to + * create new IAM Policy Bindings. The Role will not be included in + * `ListRoles()` unless `show_deleted` is set in the `ListRolesRequest`. The + * Role contains the deleted boolean set. Existing Bindings remains, but are + * inactive. The Role can be undeleted within 7 days. After 7 days the Role + * is deleted and all Bindings associated with the role are removed. + * @alias iam.projects.roles.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.etag Used to perform a consistent read-modify-write. + * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.roles.get + * @desc Gets a Role definition. + * @alias iam.projects.roles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.roles.list + * @desc Lists the Roles defined on a resource. + * @alias iam.projects.roles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. + * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. + * @param {string} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` + * @param {boolean=} params.showDeleted Include Roles that have been deleted. + * @param {string=} params.view Optional view for the returned Role objects. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/roles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.roles.patch + * @desc Updates a Role definition. + * @alias iam.projects.roles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {string=} params.updateMask A mask describing which fields in the Role have changed. + * @param {().Role} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.roles.undelete + * @desc Undelete a Role, bringing it back in its previous state. + * @alias iam.projects.roles.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {().UndeleteRoleRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): AxiosPromise; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * iam.roles.list - * @desc Lists the Roles defined on a resource. - * @alias iam.roles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. - * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. - * @param {string=} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` - * @param {boolean=} params.showDeleted Include Roles that have been deleted. - * @param {string=} params.view Optional view for the returned Role objects. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Serviceaccounts { + root: Iam; + keys: Resource$Projects$Serviceaccounts$Keys; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + this.keys = new Resource$Projects$Serviceaccounts$Keys(root); + } + + getRoot() { + return this.root; + } + + + /** + * iam.projects.serviceAccounts.create + * @desc Creates a ServiceAccount and returns it. + * @alias iam.projects.serviceAccounts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. + * @param {().CreateServiceAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/serviceAccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.delete + * @desc Deletes a ServiceAccount. + * @alias iam.projects.serviceAccounts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.get + * @desc Gets a ServiceAccount. + * @alias iam.projects.serviceAccounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.getIamPolicy + * @desc Returns the IAM access control policy for a ServiceAccount. + * @alias iam.projects.serviceAccounts.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.list + * @desc Lists ServiceAccounts for a project. + * @alias iam.projects.serviceAccounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. + * @param {integer=} params.pageSize Optional limit on the number of service accounts to include in the response. Further accounts can subsequently be obtained by including the ListServiceAccountsResponse.next_page_token in a subsequent request. + * @param {string=} params.pageToken Optional pagination token returned in an earlier ListServiceAccountsResponse.next_page_token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/serviceAccounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.setIamPolicy + * @desc Sets the IAM access control policy for a ServiceAccount. + * @alias iam.projects.serviceAccounts.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.signBlob + * @desc Signs a blob using a service account's system-managed private key. + * @alias iam.projects.serviceAccounts.signBlob + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {().SignBlobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + signBlob(params?: any, options?: MethodOptions): + AxiosPromise; + signBlob( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + signBlob( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:signBlob') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.signJwt + * @desc Signs a JWT using a service account's system-managed private key. + * If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets + * an an expiry time of one hour by default. If you request an expiry time + * of more than one hour, the request will fail. + * @alias iam.projects.serviceAccounts.signJwt + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {().SignJwtRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + signJwt(params?: any, options?: MethodOptions): + AxiosPromise; + signJwt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + signJwt( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:signJwt') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.testIamPermissions + * @desc Tests the specified permissions against the IAM access control + * policy for a ServiceAccount. + * @alias iam.projects.serviceAccounts.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.update + * @desc Updates a ServiceAccount. Currently, only the following fields are + * updatable: `display_name` . The `etag` is mandatory. + * @alias iam.projects.serviceAccounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Requests using `-` as a wildcard for the `PROJECT_ID` will infer the project from the `account` and the `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. In responses the resource name will always be in the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. + * @param {().ServiceAccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/roles').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Serviceaccounts$Keys { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.projects.serviceAccounts.keys.create + * @desc Creates a ServiceAccountKey and returns it. + * @alias iam.projects.serviceAccounts.keys.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {().CreateServiceAccountKeyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/keys').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.keys.delete + * @desc Deletes a ServiceAccountKey. + * @alias iam.projects.serviceAccounts.keys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.keys.get + * @desc Gets the ServiceAccountKey by key id. + * @alias iam.projects.serviceAccounts.keys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the service account key in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`. Using `-` as a wildcard for the `PROJECT_ID` will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {string=} params.publicKeyType The output format of the public key requested. X509_PEM is the default output format. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.projects.serviceAccounts.keys.list + * @desc Lists ServiceAccountKeys. + * @alias iam.projects.serviceAccounts.keys.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.keyTypes Filters the types of keys the user wants to include in the list response. Duplicate key types are not allowed. If no key type is provided, all keys are returned. + * @param {string} params.name The resource name of the service account in the following format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from the account. The `ACCOUNT` value can be the `email` address or the `unique_id` of the service account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/keys').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - /** - * iam.roles.queryGrantableRoles - * @desc Queries roles that can be granted on a particular resource. A role is - * grantable if it can be used as the role in a binding for a policy for that - * resource. - * @alias iam.roles.queryGrantableRoles - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().QueryGrantableRolesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - queryGrantableRoles(params?: any, options?: MethodOptions): - AxiosPromise; - queryGrantableRoles( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - queryGrantableRoles( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/roles:queryGrantableRoles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + export class Resource$Roles { + root: Iam; + constructor(root: Iam) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * iam.roles.get + * @desc Gets a Role definition. + * @alias iam.roles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the role in one of the following formats: `roles/{ROLE_NAME}` `organizations/{ORGANIZATION_ID}/roles/{ROLE_NAME}` `projects/{PROJECT_ID}/roles/{ROLE_NAME}` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.roles.list + * @desc Lists the Roles defined on a resource. + * @alias iam.roles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional limit on the number of roles to include in the response. + * @param {string=} params.pageToken Optional pagination token returned in an earlier ListRolesResponse. + * @param {string=} params.parent The resource name of the parent resource in one of the following formats: `` (empty string) -- this refers to curated roles. `organizations/{ORGANIZATION_ID}` `projects/{PROJECT_ID}` + * @param {boolean=} params.showDeleted Include Roles that have been deleted. + * @param {string=} params.view Optional view for the returned Role objects. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/roles').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * iam.roles.queryGrantableRoles + * @desc Queries roles that can be granted on a particular resource. A role + * is grantable if it can be used as the role in a binding for a policy for + * that resource. + * @alias iam.roles.queryGrantableRoles + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().QueryGrantableRolesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + queryGrantableRoles(params?: any, options?: MethodOptions): + AxiosPromise; + queryGrantableRoles( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + queryGrantableRoles( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://iam.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/roles:queryGrantableRoles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/identitytoolkit/v3.ts b/src/apis/identitytoolkit/v3.ts index f9c5481674b..7822ba8e4e7 100644 --- a/src/apis/identitytoolkit/v3.ts +++ b/src/apis/identitytoolkit/v3.ts @@ -27,2656 +27,2674 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Identity Toolkit API - * - * Help the third party sites to implement federated login. - * - * @example - * const google = require('googleapis'); - * const identitytoolkit = google.identitytoolkit('v3'); - * - * @namespace identitytoolkit - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Identitytoolkit - */ -export class Identitytoolkit { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - relyingparty: Resource$Relyingparty; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.relyingparty = new Resource$Relyingparty(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Response of creating the IDP authentication URL. - */ -export interface Schema$CreateAuthUriResponse { - /** - * all providers the user has once used to do federated login - */ - allProviders: string[]; - /** - * The URI used by the IDP to authenticate the user. - */ - authUri: string; - /** - * True if captcha is required. - */ - captchaRequired: boolean; - /** - * True if the authUri is for user's existing provider. - */ - forExistingProvider: boolean; - /** - * The fixed string identitytoolkit#CreateAuthUriResponse". - */ - kind: string; - /** - * The provider ID of the auth URI. - */ - providerId: string; - /** - * Whether the user is registered if the identifier is an email. - */ - registered: boolean; - /** - * Session ID which should be passed in the following verifyAssertion request. - */ - sessionId: string; - /** - * All sign-in methods this user has used. - */ - signinMethods: string[]; -} -/** - * Respone of deleting account. - */ -export interface Schema$DeleteAccountResponse { - /** - * The fixed string "identitytoolkit#DeleteAccountResponse". - */ - kind: string; -} -/** - * Response of downloading accounts in batch. - */ -export interface Schema$DownloadAccountResponse { - /** - * The fixed string "identitytoolkit#DownloadAccountResponse". - */ - kind: string; - /** - * The next page token. To be used in a subsequent request to return the next - * page of results. - */ - nextPageToken: string; - /** - * The user accounts data. - */ - users: Schema$UserInfo[]; -} -/** - * Response of email signIn. - */ -export interface Schema$EmailLinkSigninResponse { - /** - * The user's email. - */ - email: string; - /** - * Expiration time of STS id token in seconds. - */ - expiresIn: string; - /** - * The STS id token to login the newly signed in user. - */ - idToken: string; - /** - * Whether the user is new. - */ - isNewUser: boolean; - /** - * The fixed string "identitytoolkit#EmailLinkSigninResponse". - */ - kind: string; - /** - * The RP local ID of the user. - */ - localId: string; - /** - * The refresh token for the signed in user. - */ - refreshToken: string; -} -/** - * Template for an email template. - */ -export interface Schema$EmailTemplate { - /** - * Email body. - */ - body: string; - /** - * Email body format. - */ - format: string; - /** - * From address of the email. - */ - from: string; - /** - * From display name. - */ - fromDisplayName: string; - /** - * Reply-to address. - */ - replyTo: string; - /** - * Subject of the email. - */ - subject: string; -} -/** - * Response of getting account information. - */ -export interface Schema$GetAccountInfoResponse { - /** - * The fixed string "identitytoolkit#GetAccountInfoResponse". - */ - kind: string; - /** - * The info of the users. - */ - users: Schema$UserInfo[]; -} -/** - * Response of getting a code for user confirmation (reset password, change - * email etc.). - */ -export interface Schema$GetOobConfirmationCodeResponse { - /** - * The email address that the email is sent to. - */ - email: string; - /** - * The fixed string - * "identitytoolkit#GetOobConfirmationCodeResponse". - */ - kind: string; - /** - * The code to be send to the user. - */ - oobCode: string; -} -/** - * Response of getting recaptcha param. - */ -export interface Schema$GetRecaptchaParamResponse { - /** - * The fixed string "identitytoolkit#GetRecaptchaParamResponse". - */ - kind: string; - /** - * Site key registered at recaptcha. - */ - recaptchaSiteKey: string; - /** - * The stoken field for the recaptcha widget, used to request captcha - * challenge. - */ - recaptchaStoken: string; -} -/** - * Request to get the IDP authentication URL. - */ -export interface Schema$IdentitytoolkitRelyingpartyCreateAuthUriRequest { - /** - * The app ID of the mobile app, base64(CERT_SHA1):PACKAGE_NAME for Android, - * BUNDLE_ID for iOS. - */ - appId: string; - /** - * Explicitly specify the auth flow type. Currently only support - * "CODE_FLOW" type. The field is only used for Google provider. - */ - authFlowType: string; - /** - * The relying party OAuth client ID. - */ - clientId: string; - /** - * The opaque value used by the client to maintain context info between the - * authentication request and the IDP callback. - */ - context: string; - /** - * The URI to which the IDP redirects the user after the federated login flow. - */ - continueUri: string; - /** - * The query parameter that client can customize by themselves in auth url. - * The following parameters are reserved for server so that they cannot be - * customized by clients: client_id, response_type, scope, redirect_uri, - * state, oauth_token. - */ - customParameter: any; - /** - * The hosted domain to restrict sign-in to accounts at that domain for Google - * Apps hosted accounts. - */ - hostedDomain: string; - /** - * The email or federated ID of the user. - */ - identifier: string; - /** - * The developer's consumer key for OpenId OAuth Extension - */ - oauthConsumerKey: string; - /** - * Additional oauth scopes, beyond the basid user profile, that the user would - * be prompted to grant - */ - oauthScope: string; - /** - * Optional realm for OpenID protocol. The sub string - * "scheme://domain:port" of the param "continueUri" is - * used if this is not set. - */ - openidRealm: string; - /** - * The native app package for OTA installation. - */ - otaApp: string; - /** - * The IdP ID. For white listed IdPs it's a short domain name e.g. - * google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs it's - * the OP identifier. - */ - providerId: string; - /** - * The session_id passed by client. - */ - sessionId: string; -} -/** - * Request to delete account. - */ -export interface Schema$IdentitytoolkitRelyingpartyDeleteAccountRequest { - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The GITKit token or STS id token of the authenticated user. - */ - idToken: string; - /** - * The local ID of the user. - */ - localId: string; -} -/** - * Request to download user account in batch. - */ -export interface Schema$IdentitytoolkitRelyingpartyDownloadAccountRequest { - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The max number of results to return in the response. - */ - maxResults: number; - /** - * The token for the next page. This should be taken from the previous - * response. - */ - nextPageToken: string; - /** - * Specify which project (field value is actually project id) to operate. Only - * used when provided credential. - */ - targetProjectId: string; -} -/** - * Request to sign in with email. - */ -export interface Schema$IdentitytoolkitRelyingpartyEmailLinkSigninRequest { - /** - * The email address of the user. - */ - email: string; - /** - * Token for linking flow. - */ - idToken: string; - /** - * The confirmation code. - */ - oobCode: string; -} -/** - * Request to get the account information. - */ -export interface Schema$IdentitytoolkitRelyingpartyGetAccountInfoRequest { - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The list of emails of the users to inquiry. - */ - email: string[]; - /** - * The GITKit token of the authenticated user. - */ - idToken: string; - /** - * The list of local ID's of the users to inquiry. - */ - localId: string[]; - /** - * Privileged caller can query users by specified phone number. - */ - phoneNumber: string[]; -} -/** - * Response of getting the project configuration. - */ -export interface Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse { - /** - * Whether to allow password user sign in or sign up. - */ - allowPasswordUser: boolean; - /** - * Browser API key, needed when making http request to Apiary. - */ - apiKey: string; - /** - * Authorized domains. - */ - authorizedDomains: string[]; - /** - * Change email template. - */ - changeEmailTemplate: Schema$EmailTemplate; - dynamicLinksDomain: string; - /** - * Whether anonymous user is enabled. - */ - enableAnonymousUser: boolean; - /** - * OAuth2 provider configuration. - */ - idpConfig: Schema$IdpConfig[]; - /** - * Legacy reset password email template. - */ - legacyResetPasswordTemplate: Schema$EmailTemplate; - /** - * Project ID of the relying party. - */ - projectId: string; - /** - * Reset password email template. - */ - resetPasswordTemplate: Schema$EmailTemplate; - /** - * Whether to use email sending provided by Firebear. - */ - useEmailSending: boolean; - /** - * Verify email template. - */ - verifyEmailTemplate: Schema$EmailTemplate; -} -/** - * Respone of getting public keys. - */ -export interface Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse {} -/** - * Request to reset the password. - */ -export interface Schema$IdentitytoolkitRelyingpartyResetPasswordRequest { - /** - * The email address of the user. - */ - email: string; - /** - * The new password inputted by the user. - */ - newPassword: string; - /** - * The old password inputted by the user. - */ - oldPassword: string; - /** - * The confirmation code. - */ - oobCode: string; -} -/** - * Request for Identitytoolkit-SendVerificationCode - */ -export interface Schema$IdentitytoolkitRelyingpartySendVerificationCodeRequest { - /** - * Receipt of successful app token validation with APNS. - */ - iosReceipt: string; - /** - * Secret delivered to iOS app via APNS. - */ - iosSecret: string; - /** - * The phone number to send the verification code to in E.164 format. - */ - phoneNumber: string; - /** - * Recaptcha solution. - */ - recaptchaToken: string; -} -/** - * Response for Identitytoolkit-SendVerificationCode - */ -export interface Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse { - /** - * Encrypted session information - */ - sessionInfo: string; -} -/** - * Request to set the account information. - */ -export interface Schema$IdentitytoolkitRelyingpartySetAccountInfoRequest { - /** - * The captcha challenge. - */ - captchaChallenge: string; - /** - * Response to the captcha. - */ - captchaResponse: string; - /** - * The timestamp when the account is created. - */ - createdAt: string; - /** - * The custom attributes to be set in the user's id token. - */ - customAttributes: string; - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The attributes users request to delete. - */ - deleteAttribute: string[]; - /** - * The IDPs the user request to delete. - */ - deleteProvider: string[]; - /** - * Whether to disable the user. - */ - disableUser: boolean; - /** - * The name of the user. - */ - displayName: string; - /** - * The email of the user. - */ - email: string; - /** - * Mark the email as verified or not. - */ - emailVerified: boolean; - /** - * The GITKit token of the authenticated user. - */ - idToken: string; - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * Last login timestamp. - */ - lastLoginAt: string; - /** - * The local ID of the user. - */ - localId: string; - /** - * The out-of-band code of the change email request. - */ - oobCode: string; - /** - * The new password of the user. - */ - password: string; - /** - * Privileged caller can update user with specified phone number. - */ - phoneNumber: string; - /** - * The photo url of the user. - */ - photoUrl: string; - /** - * The associated IDPs of the user. - */ - provider: string[]; - /** - * Whether return sts id token and refresh token instead of gitkit token. - */ - returnSecureToken: boolean; - /** - * Mark the user to upgrade to federated login. - */ - upgradeToFederatedLogin: boolean; - /** - * Timestamp in seconds for valid login token. - */ - validSince: string; -} -/** - * Request to set the project configuration. - */ -export interface Schema$IdentitytoolkitRelyingpartySetProjectConfigRequest { - /** - * Whether to allow password user sign in or sign up. - */ - allowPasswordUser: boolean; - /** - * Browser API key, needed when making http request to Apiary. - */ - apiKey: string; - /** - * Authorized domains for widget redirect. - */ - authorizedDomains: string[]; - /** - * Change email template. - */ - changeEmailTemplate: Schema$EmailTemplate; - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * Whether to enable anonymous user. - */ - enableAnonymousUser: boolean; - /** - * Oauth2 provider configuration. - */ - idpConfig: Schema$IdpConfig[]; - /** - * Legacy reset password email template. - */ - legacyResetPasswordTemplate: Schema$EmailTemplate; - /** - * Reset password email template. - */ - resetPasswordTemplate: Schema$EmailTemplate; - /** - * Whether to use email sending provided by Firebear. - */ - useEmailSending: boolean; - /** - * Verify email template. - */ - verifyEmailTemplate: Schema$EmailTemplate; -} -/** - * Response of setting the project configuration. - */ -export interface Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse { - /** - * Project ID of the relying party. - */ - projectId: string; -} -/** - * Request to sign out user. - */ -export interface Schema$IdentitytoolkitRelyingpartySignOutUserRequest { - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * The local ID of the user. - */ - localId: string; -} -/** - * Response of signing out user. - */ -export interface Schema$IdentitytoolkitRelyingpartySignOutUserResponse { - /** - * The local ID of the user. - */ - localId: string; -} -/** - * Request to signup new user, create anonymous user or anonymous user reauth. - */ -export interface Schema$IdentitytoolkitRelyingpartySignupNewUserRequest { - /** - * The captcha challenge. - */ - captchaChallenge: string; - /** - * Response to the captcha. - */ - captchaResponse: string; - /** - * Whether to disable the user. Only can be used by service account. - */ - disabled: boolean; - /** - * The name of the user. - */ - displayName: string; - /** - * The email of the user. - */ - email: string; - /** - * Mark the email as verified or not. Only can be used by service account. - */ - emailVerified: boolean; - /** - * The GITKit token of the authenticated user. - */ - idToken: string; - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * Privileged caller can create user with specified user id. - */ - localId: string; - /** - * The new password of the user. - */ - password: string; - /** - * Privileged caller can create user with specified phone number. - */ - phoneNumber: string; - /** - * The photo url of the user. - */ - photoUrl: string; -} -/** - * Request to upload user account in batch. - */ -export interface Schema$IdentitytoolkitRelyingpartyUploadAccountRequest { - /** - * Whether allow overwrite existing account when user local_id exists. - */ - allowOverwrite: boolean; - blockSize: number; - /** - * The following 4 fields are for standard scrypt algorithm. - */ - cpuMemCost: number; - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - dkLen: number; - /** - * The password hash algorithm. - */ - hashAlgorithm: string; - /** - * Memory cost for hash calculation. Used by scrypt similar algorithms. - */ - memoryCost: number; - parallelization: number; - /** - * Rounds for hash calculation. Used by scrypt and similar algorithms. - */ - rounds: number; - /** - * The salt separator. - */ - saltSeparator: string; - /** - * If true, backend will do sanity check(including duplicate email and - * federated id) when uploading account. - */ - sanityCheck: boolean; - /** - * The key for to hash the password. - */ - signerKey: string; - /** - * Specify which project (field value is actually project id) to operate. Only - * used when provided credential. - */ - targetProjectId: string; - /** - * The account info to be stored. - */ - users: Schema$UserInfo[]; -} -/** - * Request to verify the IDP assertion. - */ -export interface Schema$IdentitytoolkitRelyingpartyVerifyAssertionRequest { - /** - * When it's true, automatically creates a new account if the user - * doesn't exist. When it's false, allows existing user to sign in - * normally and throws exception if the user doesn't exist. - */ - autoCreate: boolean; - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The GITKit token of the authenticated user. - */ - idToken: string; - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * The GITKit token for the non-trusted IDP pending to be confirmed by the - * user. - */ - pendingIdToken: string; - /** - * The post body if the request is a HTTP POST. - */ - postBody: string; - /** - * The URI to which the IDP redirects the user back. It may contain federated - * login result params added by the IDP. - */ - requestUri: string; - /** - * Whether return 200 and IDP credential rather than throw exception when - * federated id is already linked. - */ - returnIdpCredential: boolean; - /** - * Whether to return refresh tokens. - */ - returnRefreshToken: boolean; - /** - * Whether return sts id token and refresh token instead of gitkit token. - */ - returnSecureToken: boolean; - /** - * Session ID, which should match the one in previous createAuthUri request. - */ - sessionId: string; -} -/** - * Request to verify a custom token - */ -export interface Schema$IdentitytoolkitRelyingpartyVerifyCustomTokenRequest { - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * Whether return sts id token and refresh token instead of gitkit token. - */ - returnSecureToken: boolean; - /** - * The custom token to verify - */ - token: string; -} -/** - * Request to verify the password. - */ -export interface Schema$IdentitytoolkitRelyingpartyVerifyPasswordRequest { - /** - * The captcha challenge. - */ - captchaChallenge: string; - /** - * Response to the captcha. - */ - captchaResponse: string; - /** - * GCP project number of the requesting delegated app. Currently only intended - * for Firebase V1 migration. - */ - delegatedProjectNumber: string; - /** - * The email of the user. - */ - email: string; - /** - * The GITKit token of the authenticated user. - */ - idToken: string; - /** - * Instance id token of the app. - */ - instanceId: string; - /** - * The password inputed by the user. - */ - password: string; - /** - * The GITKit token for the non-trusted IDP, which is to be confirmed by the - * user. - */ - pendingIdToken: string; - /** - * Whether return sts id token and refresh token instead of gitkit token. - */ - returnSecureToken: boolean; -} -/** - * Request for Identitytoolkit-VerifyPhoneNumber - */ -export interface Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest { - code: string; - idToken: string; - operation: string; - phoneNumber: string; - /** - * The session info previously returned by - * IdentityToolkit-SendVerificationCode. - */ - sessionInfo: string; - temporaryProof: string; - verificationProof: string; -} -/** - * Response for Identitytoolkit-VerifyPhoneNumber - */ -export interface Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse { - expiresIn: string; - idToken: string; - isNewUser: boolean; - localId: string; - phoneNumber: string; - refreshToken: string; - temporaryProof: string; - temporaryProofExpiresIn: string; - verificationProof: string; - verificationProofExpiresIn: string; -} -/** - * Template for a single idp configuration. - */ -export interface Schema$IdpConfig { - /** - * OAuth2 client ID. - */ - clientId: string; - /** - * Whether this IDP is enabled. - */ - enabled: boolean; - /** - * Percent of users who will be prompted/redirected federated login for this - * IDP. - */ - experimentPercent: number; - /** - * OAuth2 provider. - */ - provider: string; - /** - * OAuth2 client secret. - */ - secret: string; - /** - * Whitelisted client IDs for audience check. - */ - whitelistedAudiences: string[]; -} -/** - * Request of getting a code for user confirmation (reset password, change email - * etc.) - */ -export interface Schema$Relyingparty { - /** - * whether or not to install the android app on the device where the link is - * opened - */ - androidInstallApp: boolean; - /** - * minimum version of the app. if the version on the device is lower than this - * version then the user is taken to the play store to upgrade the app - */ - androidMinimumVersion: string; - /** - * android package name of the android app to handle the action code - */ - androidPackageName: string; - /** - * whether or not the app can handle the oob code without first going to web - */ - canHandleCodeInApp: boolean; - /** - * The recaptcha response from the user. - */ - captchaResp: string; - /** - * The recaptcha challenge presented to the user. - */ - challenge: string; - /** - * The url to continue to the Gitkit app - */ - continueUrl: string; - /** - * The email of the user. - */ - email: string; - /** - * The user's Gitkit login token for email change. - */ - idToken: string; - /** - * iOS app store id to download the app if it's not already installed - */ - iOSAppStoreId: string; - /** - * the iOS bundle id of iOS app to handle the action code - */ - iOSBundleId: string; - /** - * The fixed string "identitytoolkit#relyingparty". - */ - kind: string; - /** - * The new email if the code is for email change. - */ - newEmail: string; - /** - * The request type. - */ - requestType: string; - /** - * The IP address of the user. - */ - userIp: string; -} -/** - * Response of resetting the password. - */ -export interface Schema$ResetPasswordResponse { - /** - * The user's email. If the out-of-band code is for email recovery, the - * user's original email. - */ - email: string; - /** - * The fixed string "identitytoolkit#ResetPasswordResponse". - */ - kind: string; - /** - * If the out-of-band code is for email recovery, the user's new email. - */ - newEmail: string; - /** - * The request type. - */ - requestType: string; -} -/** - * Respone of setting the account information. - */ -export interface Schema$SetAccountInfoResponse { - /** - * The name of the user. - */ - displayName: string; - /** - * The email of the user. - */ - email: string; - /** - * If email has been verified. - */ - emailVerified: boolean; - /** - * If idToken is STS id token, then this field will be expiration time of STS - * id token in seconds. - */ - expiresIn: string; - /** - * The Gitkit id token to login the newly sign up user. - */ - idToken: string; - /** - * The fixed string "identitytoolkit#SetAccountInfoResponse". - */ - kind: string; - /** - * The local ID of the user. - */ - localId: string; - /** - * The new email the user attempts to change to. - */ - newEmail: string; - /** - * The user's hashed password. - */ - passwordHash: string; - /** - * The photo url of the user. - */ - photoUrl: string; - /** - * The user's profiles at the associated IdPs. - */ - providerUserInfo: any[]; - /** - * If idToken is STS id token, then this field will be refresh token. - */ - refreshToken: string; -} -/** - * Response of signing up new user, creating anonymous user or anonymous user - * reauth. - */ -export interface Schema$SignupNewUserResponse { - /** - * The name of the user. - */ - displayName: string; - /** - * The email of the user. - */ - email: string; - /** - * If idToken is STS id token, then this field will be expiration time of STS - * id token in seconds. - */ - expiresIn: string; - /** - * The Gitkit id token to login the newly sign up user. - */ - idToken: string; - /** - * The fixed string "identitytoolkit#SignupNewUserResponse". - */ - kind: string; - /** - * The RP local ID of the user. - */ - localId: string; - /** - * If idToken is STS id token, then this field will be refresh token. - */ - refreshToken: string; -} -/** - * Respone of uploading accounts in batch. - */ -export interface Schema$UploadAccountResponse { - /** - * The error encountered while processing the account info. - */ - error: any[]; - /** - * The fixed string "identitytoolkit#UploadAccountResponse". - */ - kind: string; -} -/** - * Template for an individual account info. - */ -export interface Schema$UserInfo { - /** - * User creation timestamp. - */ - createdAt: string; - /** - * The custom attributes to be set in the user's id token. - */ - customAttributes: string; - /** - * Whether the user is authenticated by the developer. - */ - customAuth: boolean; - /** - * Whether the user is disabled. - */ - disabled: boolean; - /** - * The name of the user. - */ - displayName: string; - /** - * The email of the user. - */ - email: string; - /** - * Whether the email has been verified. - */ - emailVerified: boolean; - /** - * last login timestamp. - */ - lastLoginAt: string; - /** - * The local ID of the user. - */ - localId: string; - /** - * The user's hashed password. - */ - passwordHash: string; - /** - * The timestamp when the password was last updated. - */ - passwordUpdatedAt: number; - /** - * User's phone number. - */ - phoneNumber: string; - /** - * The URL of the user profile photo. - */ - photoUrl: string; - /** - * The IDP of the user. - */ - providerUserInfo: any[]; - /** - * The user's plain text password. - */ - rawPassword: string; - /** - * The user's password salt. - */ - salt: string; - /** - * User's screen name at Twitter or login name at Github. - */ - screenName: string; - /** - * Timestamp in seconds for valid login token. - */ - validSince: string; - /** - * Version of the user's password. - */ - version: number; -} -/** - * Response of verifying the IDP assertion. - */ -export interface Schema$VerifyAssertionResponse { - /** - * The action code. - */ - action: string; - /** - * URL for OTA app installation. - */ - appInstallationUrl: string; - /** - * The custom scheme used by mobile app. - */ - appScheme: string; - /** - * The opaque value used by the client to maintain context info between the - * authentication request and the IDP callback. - */ - context: string; - /** - * The birth date of the IdP account. - */ - dateOfBirth: string; - /** - * The display name of the user. - */ - displayName: string; - /** - * The email returned by the IdP. NOTE: The federated login user may not own - * the email. - */ - email: string; - /** - * It's true if the email is recycled. - */ - emailRecycled: boolean; - /** - * The value is true if the IDP is also the email provider. It means the user - * owns the email. - */ - emailVerified: boolean; - /** - * Client error code. - */ - errorMessage: string; - /** - * If idToken is STS id token, then this field will be expiration time of STS - * id token in seconds. - */ - expiresIn: string; - /** - * The unique ID identifies the IdP account. - */ - federatedId: string; +export namespace identitytoolkit_v3 { /** - * The first name of the user. - */ - firstName: string; - /** - * The full name of the user. - */ - fullName: string; - /** - * The ID token. - */ - idToken: string; - /** - * It's the identifier param in the createAuthUri request if the - * identifier is an email. It can be used to check whether the user input - * email is different from the asserted email. - */ - inputEmail: string; - /** - * True if it's a new user sign-in, false if it's a returning user. - */ - isNewUser: boolean; - /** - * The fixed string "identitytoolkit#VerifyAssertionResponse". - */ - kind: string; + * Google Identity Toolkit API + * + * Help the third party sites to implement federated login. + * + * @example + * const google = require('googleapis'); + * const identitytoolkit = google.identitytoolkit('v3'); + * + * @namespace identitytoolkit + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Identitytoolkit + */ + export class Identitytoolkit { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + relyingparty: Resource$Relyingparty; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.relyingparty = new Resource$Relyingparty(this); + } + + getRoot() { + return this.root; + } + } + /** - * The language preference of the user. - */ - language: string; + * Response of creating the IDP authentication URL. + */ + export interface Schema$CreateAuthUriResponse { + /** + * all providers the user has once used to do federated login + */ + allProviders: string[]; + /** + * The URI used by the IDP to authenticate the user. + */ + authUri: string; + /** + * True if captcha is required. + */ + captchaRequired: boolean; + /** + * True if the authUri is for user's existing provider. + */ + forExistingProvider: boolean; + /** + * The fixed string identitytoolkit#CreateAuthUriResponse". + */ + kind: string; + /** + * The provider ID of the auth URI. + */ + providerId: string; + /** + * Whether the user is registered if the identifier is an email. + */ + registered: boolean; + /** + * Session ID which should be passed in the following verifyAssertion + * request. + */ + sessionId: string; + /** + * All sign-in methods this user has used. + */ + signinMethods: string[]; + } /** - * The last name of the user. + * Respone of deleting account. */ - lastName: string; + export interface Schema$DeleteAccountResponse { + /** + * The fixed string "identitytoolkit#DeleteAccountResponse". + */ + kind: string; + } /** - * The RP local ID if it's already been mapped to the IdP account - * identified by the federated ID. - */ - localId: string; + * Response of downloading accounts in batch. + */ + export interface Schema$DownloadAccountResponse { + /** + * The fixed string "identitytoolkit#DownloadAccountResponse". + */ + kind: string; + /** + * The next page token. To be used in a subsequent request to return the + * next page of results. + */ + nextPageToken: string; + /** + * The user accounts data. + */ + users: Schema$UserInfo[]; + } /** - * Whether the assertion is from a non-trusted IDP and need account linking - * confirmation. - */ - needConfirmation: boolean; + * Response of email signIn. + */ + export interface Schema$EmailLinkSigninResponse { + /** + * The user's email. + */ + email: string; + /** + * Expiration time of STS id token in seconds. + */ + expiresIn: string; + /** + * The STS id token to login the newly signed in user. + */ + idToken: string; + /** + * Whether the user is new. + */ + isNewUser: boolean; + /** + * The fixed string "identitytoolkit#EmailLinkSigninResponse". + */ + kind: string; + /** + * The RP local ID of the user. + */ + localId: string; + /** + * The refresh token for the signed in user. + */ + refreshToken: string; + } /** - * Whether need client to supply email to complete the federated login flow. - */ - needEmail: boolean; + * Template for an email template. + */ + export interface Schema$EmailTemplate { + /** + * Email body. + */ + body: string; + /** + * Email body format. + */ + format: string; + /** + * From address of the email. + */ + from: string; + /** + * From display name. + */ + fromDisplayName: string; + /** + * Reply-to address. + */ + replyTo: string; + /** + * Subject of the email. + */ + subject: string; + } /** - * The nick name of the user. - */ - nickName: string; + * Response of getting account information. + */ + export interface Schema$GetAccountInfoResponse { + /** + * The fixed string "identitytoolkit#GetAccountInfoResponse". + */ + kind: string; + /** + * The info of the users. + */ + users: Schema$UserInfo[]; + } /** - * The OAuth2 access token. - */ - oauthAccessToken: string; + * Response of getting a code for user confirmation (reset password, change + * email etc.). + */ + export interface Schema$GetOobConfirmationCodeResponse { + /** + * The email address that the email is sent to. + */ + email: string; + /** + * The fixed string + * "identitytoolkit#GetOobConfirmationCodeResponse". + */ + kind: string; + /** + * The code to be send to the user. + */ + oobCode: string; + } /** - * The OAuth2 authorization code. - */ - oauthAuthorizationCode: string; + * Response of getting recaptcha param. + */ + export interface Schema$GetRecaptchaParamResponse { + /** + * The fixed string "identitytoolkit#GetRecaptchaParamResponse". + */ + kind: string; + /** + * Site key registered at recaptcha. + */ + recaptchaSiteKey: string; + /** + * The stoken field for the recaptcha widget, used to request captcha + * challenge. + */ + recaptchaStoken: string; + } /** - * The lifetime in seconds of the OAuth2 access token. - */ - oauthExpireIn: number; + * Request to get the IDP authentication URL. + */ + export interface Schema$IdentitytoolkitRelyingpartyCreateAuthUriRequest { + /** + * The app ID of the mobile app, base64(CERT_SHA1):PACKAGE_NAME for Android, + * BUNDLE_ID for iOS. + */ + appId: string; + /** + * Explicitly specify the auth flow type. Currently only support + * "CODE_FLOW" type. The field is only used for Google provider. + */ + authFlowType: string; + /** + * The relying party OAuth client ID. + */ + clientId: string; + /** + * The opaque value used by the client to maintain context info between the + * authentication request and the IDP callback. + */ + context: string; + /** + * The URI to which the IDP redirects the user after the federated login + * flow. + */ + continueUri: string; + /** + * The query parameter that client can customize by themselves in auth url. + * The following parameters are reserved for server so that they cannot be + * customized by clients: client_id, response_type, scope, redirect_uri, + * state, oauth_token. + */ + customParameter: any; + /** + * The hosted domain to restrict sign-in to accounts at that domain for + * Google Apps hosted accounts. + */ + hostedDomain: string; + /** + * The email or federated ID of the user. + */ + identifier: string; + /** + * The developer's consumer key for OpenId OAuth Extension + */ + oauthConsumerKey: string; + /** + * Additional oauth scopes, beyond the basid user profile, that the user + * would be prompted to grant + */ + oauthScope: string; + /** + * Optional realm for OpenID protocol. The sub string + * "scheme://domain:port" of the param "continueUri" is + * used if this is not set. + */ + openidRealm: string; + /** + * The native app package for OTA installation. + */ + otaApp: string; + /** + * The IdP ID. For white listed IdPs it's a short domain name e.g. + * google.com, aol.com, live.net and yahoo.com. For other OpenID IdPs + * it's the OP identifier. + */ + providerId: string; + /** + * The session_id passed by client. + */ + sessionId: string; + } /** - * The OIDC id token. - */ - oauthIdToken: string; + * Request to delete account. + */ + export interface Schema$IdentitytoolkitRelyingpartyDeleteAccountRequest { + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The GITKit token or STS id token of the authenticated user. + */ + idToken: string; + /** + * The local ID of the user. + */ + localId: string; + } /** - * The user approved request token for the OpenID OAuth extension. - */ - oauthRequestToken: string; + * Request to download user account in batch. + */ + export interface Schema$IdentitytoolkitRelyingpartyDownloadAccountRequest { + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The max number of results to return in the response. + */ + maxResults: number; + /** + * The token for the next page. This should be taken from the previous + * response. + */ + nextPageToken: string; + /** + * Specify which project (field value is actually project id) to operate. + * Only used when provided credential. + */ + targetProjectId: string; + } /** - * The scope for the OpenID OAuth extension. - */ - oauthScope: string; + * Request to sign in with email. + */ + export interface Schema$IdentitytoolkitRelyingpartyEmailLinkSigninRequest { + /** + * The email address of the user. + */ + email: string; + /** + * Token for linking flow. + */ + idToken: string; + /** + * The confirmation code. + */ + oobCode: string; + } /** - * The OAuth1 access token secret. - */ - oauthTokenSecret: string; + * Request to get the account information. + */ + export interface Schema$IdentitytoolkitRelyingpartyGetAccountInfoRequest { + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The list of emails of the users to inquiry. + */ + email: string[]; + /** + * The GITKit token of the authenticated user. + */ + idToken: string; + /** + * The list of local ID's of the users to inquiry. + */ + localId: string[]; + /** + * Privileged caller can query users by specified phone number. + */ + phoneNumber: string[]; + } /** - * The original email stored in the mapping storage. It's returned when - * the federated ID is associated to a different email. - */ - originalEmail: string; + * Response of getting the project configuration. + */ + export interface Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse { + /** + * Whether to allow password user sign in or sign up. + */ + allowPasswordUser: boolean; + /** + * Browser API key, needed when making http request to Apiary. + */ + apiKey: string; + /** + * Authorized domains. + */ + authorizedDomains: string[]; + /** + * Change email template. + */ + changeEmailTemplate: Schema$EmailTemplate; + dynamicLinksDomain: string; + /** + * Whether anonymous user is enabled. + */ + enableAnonymousUser: boolean; + /** + * OAuth2 provider configuration. + */ + idpConfig: Schema$IdpConfig[]; + /** + * Legacy reset password email template. + */ + legacyResetPasswordTemplate: Schema$EmailTemplate; + /** + * Project ID of the relying party. + */ + projectId: string; + /** + * Reset password email template. + */ + resetPasswordTemplate: Schema$EmailTemplate; + /** + * Whether to use email sending provided by Firebear. + */ + useEmailSending: boolean; + /** + * Verify email template. + */ + verifyEmailTemplate: Schema$EmailTemplate; + } /** - * The URI of the public accessible profiel picture. - */ - photoUrl: string; + * Respone of getting public keys. + */ + export interface Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse {} + /** + * Request to reset the password. + */ + export interface Schema$IdentitytoolkitRelyingpartyResetPasswordRequest { + /** + * The email address of the user. + */ + email: string; + /** + * The new password inputted by the user. + */ + newPassword: string; + /** + * The old password inputted by the user. + */ + oldPassword: string; + /** + * The confirmation code. + */ + oobCode: string; + } /** - * The IdP ID. For white listed IdPs it's a short domain name e.g. - * google.com, aol.com, live.net and yahoo.com. If the "providerId" - * param is set to OpenID OP identifer other than the whilte listed IdPs the - * OP identifier is returned. If the "identifier" param is federated - * ID in the createAuthUri request. The domain part of the federated ID is - * returned. - */ - providerId: string; + * Request for Identitytoolkit-SendVerificationCode + */ + export interface Schema$IdentitytoolkitRelyingpartySendVerificationCodeRequest { + /** + * Receipt of successful app token validation with APNS. + */ + iosReceipt: string; + /** + * Secret delivered to iOS app via APNS. + */ + iosSecret: string; + /** + * The phone number to send the verification code to in E.164 format. + */ + phoneNumber: string; + /** + * Recaptcha solution. + */ + recaptchaToken: string; + } /** - * Raw IDP-returned user info. + * Response for Identitytoolkit-SendVerificationCode */ - rawUserInfo: string; + export interface Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse { + /** + * Encrypted session information + */ + sessionInfo: string; + } /** - * If idToken is STS id token, then this field will be refresh token. - */ - refreshToken: string; + * Request to set the account information. + */ + export interface Schema$IdentitytoolkitRelyingpartySetAccountInfoRequest { + /** + * The captcha challenge. + */ + captchaChallenge: string; + /** + * Response to the captcha. + */ + captchaResponse: string; + /** + * The timestamp when the account is created. + */ + createdAt: string; + /** + * The custom attributes to be set in the user's id token. + */ + customAttributes: string; + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The attributes users request to delete. + */ + deleteAttribute: string[]; + /** + * The IDPs the user request to delete. + */ + deleteProvider: string[]; + /** + * Whether to disable the user. + */ + disableUser: boolean; + /** + * The name of the user. + */ + displayName: string; + /** + * The email of the user. + */ + email: string; + /** + * Mark the email as verified or not. + */ + emailVerified: boolean; + /** + * The GITKit token of the authenticated user. + */ + idToken: string; + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * Last login timestamp. + */ + lastLoginAt: string; + /** + * The local ID of the user. + */ + localId: string; + /** + * The out-of-band code of the change email request. + */ + oobCode: string; + /** + * The new password of the user. + */ + password: string; + /** + * Privileged caller can update user with specified phone number. + */ + phoneNumber: string; + /** + * The photo url of the user. + */ + photoUrl: string; + /** + * The associated IDPs of the user. + */ + provider: string[]; + /** + * Whether return sts id token and refresh token instead of gitkit token. + */ + returnSecureToken: boolean; + /** + * Mark the user to upgrade to federated login. + */ + upgradeToFederatedLogin: boolean; + /** + * Timestamp in seconds for valid login token. + */ + validSince: string; + } /** - * The screen_name of a Twitter user or the login name at Github. - */ - screenName: string; + * Request to set the project configuration. + */ + export interface Schema$IdentitytoolkitRelyingpartySetProjectConfigRequest { + /** + * Whether to allow password user sign in or sign up. + */ + allowPasswordUser: boolean; + /** + * Browser API key, needed when making http request to Apiary. + */ + apiKey: string; + /** + * Authorized domains for widget redirect. + */ + authorizedDomains: string[]; + /** + * Change email template. + */ + changeEmailTemplate: Schema$EmailTemplate; + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * Whether to enable anonymous user. + */ + enableAnonymousUser: boolean; + /** + * Oauth2 provider configuration. + */ + idpConfig: Schema$IdpConfig[]; + /** + * Legacy reset password email template. + */ + legacyResetPasswordTemplate: Schema$EmailTemplate; + /** + * Reset password email template. + */ + resetPasswordTemplate: Schema$EmailTemplate; + /** + * Whether to use email sending provided by Firebear. + */ + useEmailSending: boolean; + /** + * Verify email template. + */ + verifyEmailTemplate: Schema$EmailTemplate; + } /** - * The timezone of the user. + * Response of setting the project configuration. */ - timeZone: string; + export interface Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse { + /** + * Project ID of the relying party. + */ + projectId: string; + } /** - * When action is 'map', contains the idps which can be used for - * confirmation. - */ - verifiedProvider: string[]; -} -/** - * Response from verifying a custom token - */ -export interface Schema$VerifyCustomTokenResponse { + * Request to sign out user. + */ + export interface Schema$IdentitytoolkitRelyingpartySignOutUserRequest { + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * The local ID of the user. + */ + localId: string; + } /** - * If idToken is STS id token, then this field will be expiration time of STS - * id token in seconds. + * Response of signing out user. */ - expiresIn: string; + export interface Schema$IdentitytoolkitRelyingpartySignOutUserResponse { + /** + * The local ID of the user. + */ + localId: string; + } /** - * The GITKit token for authenticated user. - */ - idToken: string; + * Request to signup new user, create anonymous user or anonymous user reauth. + */ + export interface Schema$IdentitytoolkitRelyingpartySignupNewUserRequest { + /** + * The captcha challenge. + */ + captchaChallenge: string; + /** + * Response to the captcha. + */ + captchaResponse: string; + /** + * Whether to disable the user. Only can be used by service account. + */ + disabled: boolean; + /** + * The name of the user. + */ + displayName: string; + /** + * The email of the user. + */ + email: string; + /** + * Mark the email as verified or not. Only can be used by service account. + */ + emailVerified: boolean; + /** + * The GITKit token of the authenticated user. + */ + idToken: string; + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * Privileged caller can create user with specified user id. + */ + localId: string; + /** + * The new password of the user. + */ + password: string; + /** + * Privileged caller can create user with specified phone number. + */ + phoneNumber: string; + /** + * The photo url of the user. + */ + photoUrl: string; + } /** - * True if it's a new user sign-in, false if it's a returning user. - */ - isNewUser: boolean; + * Request to upload user account in batch. + */ + export interface Schema$IdentitytoolkitRelyingpartyUploadAccountRequest { + /** + * Whether allow overwrite existing account when user local_id exists. + */ + allowOverwrite: boolean; + blockSize: number; + /** + * The following 4 fields are for standard scrypt algorithm. + */ + cpuMemCost: number; + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + dkLen: number; + /** + * The password hash algorithm. + */ + hashAlgorithm: string; + /** + * Memory cost for hash calculation. Used by scrypt similar algorithms. + */ + memoryCost: number; + parallelization: number; + /** + * Rounds for hash calculation. Used by scrypt and similar algorithms. + */ + rounds: number; + /** + * The salt separator. + */ + saltSeparator: string; + /** + * If true, backend will do sanity check(including duplicate email and + * federated id) when uploading account. + */ + sanityCheck: boolean; + /** + * The key for to hash the password. + */ + signerKey: string; + /** + * Specify which project (field value is actually project id) to operate. + * Only used when provided credential. + */ + targetProjectId: string; + /** + * The account info to be stored. + */ + users: Schema$UserInfo[]; + } /** - * The fixed string "identitytoolkit#VerifyCustomTokenResponse". - */ - kind: string; + * Request to verify the IDP assertion. + */ + export interface Schema$IdentitytoolkitRelyingpartyVerifyAssertionRequest { + /** + * When it's true, automatically creates a new account if the user + * doesn't exist. When it's false, allows existing user to sign in + * normally and throws exception if the user doesn't exist. + */ + autoCreate: boolean; + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The GITKit token of the authenticated user. + */ + idToken: string; + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * The GITKit token for the non-trusted IDP pending to be confirmed by the + * user. + */ + pendingIdToken: string; + /** + * The post body if the request is a HTTP POST. + */ + postBody: string; + /** + * The URI to which the IDP redirects the user back. It may contain + * federated login result params added by the IDP. + */ + requestUri: string; + /** + * Whether return 200 and IDP credential rather than throw exception when + * federated id is already linked. + */ + returnIdpCredential: boolean; + /** + * Whether to return refresh tokens. + */ + returnRefreshToken: boolean; + /** + * Whether return sts id token and refresh token instead of gitkit token. + */ + returnSecureToken: boolean; + /** + * Session ID, which should match the one in previous createAuthUri request. + */ + sessionId: string; + } /** - * If idToken is STS id token, then this field will be refresh token. - */ - refreshToken: string; -} -/** - * Request of verifying the password. - */ -export interface Schema$VerifyPasswordResponse { + * Request to verify a custom token + */ + export interface Schema$IdentitytoolkitRelyingpartyVerifyCustomTokenRequest { + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * Whether return sts id token and refresh token instead of gitkit token. + */ + returnSecureToken: boolean; + /** + * The custom token to verify + */ + token: string; + } /** - * The name of the user. - */ - displayName: string; + * Request to verify the password. + */ + export interface Schema$IdentitytoolkitRelyingpartyVerifyPasswordRequest { + /** + * The captcha challenge. + */ + captchaChallenge: string; + /** + * Response to the captcha. + */ + captchaResponse: string; + /** + * GCP project number of the requesting delegated app. Currently only + * intended for Firebase V1 migration. + */ + delegatedProjectNumber: string; + /** + * The email of the user. + */ + email: string; + /** + * The GITKit token of the authenticated user. + */ + idToken: string; + /** + * Instance id token of the app. + */ + instanceId: string; + /** + * The password inputed by the user. + */ + password: string; + /** + * The GITKit token for the non-trusted IDP, which is to be confirmed by the + * user. + */ + pendingIdToken: string; + /** + * Whether return sts id token and refresh token instead of gitkit token. + */ + returnSecureToken: boolean; + } /** - * The email returned by the IdP. NOTE: The federated login user may not own - * the email. - */ - email: string; + * Request for Identitytoolkit-VerifyPhoneNumber + */ + export interface Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest { + code: string; + idToken: string; + operation: string; + phoneNumber: string; + /** + * The session info previously returned by + * IdentityToolkit-SendVerificationCode. + */ + sessionInfo: string; + temporaryProof: string; + verificationProof: string; + } /** - * If idToken is STS id token, then this field will be expiration time of STS - * id token in seconds. - */ - expiresIn: string; + * Response for Identitytoolkit-VerifyPhoneNumber + */ + export interface Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse { + expiresIn: string; + idToken: string; + isNewUser: boolean; + localId: string; + phoneNumber: string; + refreshToken: string; + temporaryProof: string; + temporaryProofExpiresIn: string; + verificationProof: string; + verificationProofExpiresIn: string; + } /** - * The GITKit token for authenticated user. - */ - idToken: string; + * Template for a single idp configuration. + */ + export interface Schema$IdpConfig { + /** + * OAuth2 client ID. + */ + clientId: string; + /** + * Whether this IDP is enabled. + */ + enabled: boolean; + /** + * Percent of users who will be prompted/redirected federated login for this + * IDP. + */ + experimentPercent: number; + /** + * OAuth2 provider. + */ + provider: string; + /** + * OAuth2 client secret. + */ + secret: string; + /** + * Whitelisted client IDs for audience check. + */ + whitelistedAudiences: string[]; + } /** - * The fixed string "identitytoolkit#VerifyPasswordResponse". - */ - kind: string; + * Request of getting a code for user confirmation (reset password, change + * email etc.) + */ + export interface Schema$Relyingparty { + /** + * whether or not to install the android app on the device where the link is + * opened + */ + androidInstallApp: boolean; + /** + * minimum version of the app. if the version on the device is lower than + * this version then the user is taken to the play store to upgrade the app + */ + androidMinimumVersion: string; + /** + * android package name of the android app to handle the action code + */ + androidPackageName: string; + /** + * whether or not the app can handle the oob code without first going to web + */ + canHandleCodeInApp: boolean; + /** + * The recaptcha response from the user. + */ + captchaResp: string; + /** + * The recaptcha challenge presented to the user. + */ + challenge: string; + /** + * The url to continue to the Gitkit app + */ + continueUrl: string; + /** + * The email of the user. + */ + email: string; + /** + * The user's Gitkit login token for email change. + */ + idToken: string; + /** + * iOS app store id to download the app if it's not already installed + */ + iOSAppStoreId: string; + /** + * the iOS bundle id of iOS app to handle the action code + */ + iOSBundleId: string; + /** + * The fixed string "identitytoolkit#relyingparty". + */ + kind: string; + /** + * The new email if the code is for email change. + */ + newEmail: string; + /** + * The request type. + */ + requestType: string; + /** + * The IP address of the user. + */ + userIp: string; + } /** - * The RP local ID if it's already been mapped to the IdP account - * identified by the federated ID. - */ - localId: string; + * Response of resetting the password. + */ + export interface Schema$ResetPasswordResponse { + /** + * The user's email. If the out-of-band code is for email recovery, the + * user's original email. + */ + email: string; + /** + * The fixed string "identitytoolkit#ResetPasswordResponse". + */ + kind: string; + /** + * If the out-of-band code is for email recovery, the user's new email. + */ + newEmail: string; + /** + * The request type. + */ + requestType: string; + } /** - * The OAuth2 access token. - */ - oauthAccessToken: string; + * Respone of setting the account information. + */ + export interface Schema$SetAccountInfoResponse { + /** + * The name of the user. + */ + displayName: string; + /** + * The email of the user. + */ + email: string; + /** + * If email has been verified. + */ + emailVerified: boolean; + /** + * If idToken is STS id token, then this field will be expiration time of + * STS id token in seconds. + */ + expiresIn: string; + /** + * The Gitkit id token to login the newly sign up user. + */ + idToken: string; + /** + * The fixed string "identitytoolkit#SetAccountInfoResponse". + */ + kind: string; + /** + * The local ID of the user. + */ + localId: string; + /** + * The new email the user attempts to change to. + */ + newEmail: string; + /** + * The user's hashed password. + */ + passwordHash: string; + /** + * The photo url of the user. + */ + photoUrl: string; + /** + * The user's profiles at the associated IdPs. + */ + providerUserInfo: any[]; + /** + * If idToken is STS id token, then this field will be refresh token. + */ + refreshToken: string; + } /** - * The OAuth2 authorization code. - */ - oauthAuthorizationCode: string; + * Response of signing up new user, creating anonymous user or anonymous user + * reauth. + */ + export interface Schema$SignupNewUserResponse { + /** + * The name of the user. + */ + displayName: string; + /** + * The email of the user. + */ + email: string; + /** + * If idToken is STS id token, then this field will be expiration time of + * STS id token in seconds. + */ + expiresIn: string; + /** + * The Gitkit id token to login the newly sign up user. + */ + idToken: string; + /** + * The fixed string "identitytoolkit#SignupNewUserResponse". + */ + kind: string; + /** + * The RP local ID of the user. + */ + localId: string; + /** + * If idToken is STS id token, then this field will be refresh token. + */ + refreshToken: string; + } /** - * The lifetime in seconds of the OAuth2 access token. - */ - oauthExpireIn: number; + * Respone of uploading accounts in batch. + */ + export interface Schema$UploadAccountResponse { + /** + * The error encountered while processing the account info. + */ + error: any[]; + /** + * The fixed string "identitytoolkit#UploadAccountResponse". + */ + kind: string; + } /** - * The URI of the user's photo at IdP - */ - photoUrl: string; + * Template for an individual account info. + */ + export interface Schema$UserInfo { + /** + * User creation timestamp. + */ + createdAt: string; + /** + * The custom attributes to be set in the user's id token. + */ + customAttributes: string; + /** + * Whether the user is authenticated by the developer. + */ + customAuth: boolean; + /** + * Whether the user is disabled. + */ + disabled: boolean; + /** + * The name of the user. + */ + displayName: string; + /** + * The email of the user. + */ + email: string; + /** + * Whether the email has been verified. + */ + emailVerified: boolean; + /** + * last login timestamp. + */ + lastLoginAt: string; + /** + * The local ID of the user. + */ + localId: string; + /** + * The user's hashed password. + */ + passwordHash: string; + /** + * The timestamp when the password was last updated. + */ + passwordUpdatedAt: number; + /** + * User's phone number. + */ + phoneNumber: string; + /** + * The URL of the user profile photo. + */ + photoUrl: string; + /** + * The IDP of the user. + */ + providerUserInfo: any[]; + /** + * The user's plain text password. + */ + rawPassword: string; + /** + * The user's password salt. + */ + salt: string; + /** + * User's screen name at Twitter or login name at Github. + */ + screenName: string; + /** + * Timestamp in seconds for valid login token. + */ + validSince: string; + /** + * Version of the user's password. + */ + version: number; + } /** - * If idToken is STS id token, then this field will be refresh token. - */ - refreshToken: string; + * Response of verifying the IDP assertion. + */ + export interface Schema$VerifyAssertionResponse { + /** + * The action code. + */ + action: string; + /** + * URL for OTA app installation. + */ + appInstallationUrl: string; + /** + * The custom scheme used by mobile app. + */ + appScheme: string; + /** + * The opaque value used by the client to maintain context info between the + * authentication request and the IDP callback. + */ + context: string; + /** + * The birth date of the IdP account. + */ + dateOfBirth: string; + /** + * The display name of the user. + */ + displayName: string; + /** + * The email returned by the IdP. NOTE: The federated login user may not own + * the email. + */ + email: string; + /** + * It's true if the email is recycled. + */ + emailRecycled: boolean; + /** + * The value is true if the IDP is also the email provider. It means the + * user owns the email. + */ + emailVerified: boolean; + /** + * Client error code. + */ + errorMessage: string; + /** + * If idToken is STS id token, then this field will be expiration time of + * STS id token in seconds. + */ + expiresIn: string; + /** + * The unique ID identifies the IdP account. + */ + federatedId: string; + /** + * The first name of the user. + */ + firstName: string; + /** + * The full name of the user. + */ + fullName: string; + /** + * The ID token. + */ + idToken: string; + /** + * It's the identifier param in the createAuthUri request if the + * identifier is an email. It can be used to check whether the user input + * email is different from the asserted email. + */ + inputEmail: string; + /** + * True if it's a new user sign-in, false if it's a returning user. + */ + isNewUser: boolean; + /** + * The fixed string "identitytoolkit#VerifyAssertionResponse". + */ + kind: string; + /** + * The language preference of the user. + */ + language: string; + /** + * The last name of the user. + */ + lastName: string; + /** + * The RP local ID if it's already been mapped to the IdP account + * identified by the federated ID. + */ + localId: string; + /** + * Whether the assertion is from a non-trusted IDP and need account linking + * confirmation. + */ + needConfirmation: boolean; + /** + * Whether need client to supply email to complete the federated login flow. + */ + needEmail: boolean; + /** + * The nick name of the user. + */ + nickName: string; + /** + * The OAuth2 access token. + */ + oauthAccessToken: string; + /** + * The OAuth2 authorization code. + */ + oauthAuthorizationCode: string; + /** + * The lifetime in seconds of the OAuth2 access token. + */ + oauthExpireIn: number; + /** + * The OIDC id token. + */ + oauthIdToken: string; + /** + * The user approved request token for the OpenID OAuth extension. + */ + oauthRequestToken: string; + /** + * The scope for the OpenID OAuth extension. + */ + oauthScope: string; + /** + * The OAuth1 access token secret. + */ + oauthTokenSecret: string; + /** + * The original email stored in the mapping storage. It's returned when + * the federated ID is associated to a different email. + */ + originalEmail: string; + /** + * The URI of the public accessible profiel picture. + */ + photoUrl: string; + /** + * The IdP ID. For white listed IdPs it's a short domain name e.g. + * google.com, aol.com, live.net and yahoo.com. If the + * "providerId" param is set to OpenID OP identifer other than the + * whilte listed IdPs the OP identifier is returned. If the + * "identifier" param is federated ID in the createAuthUri + * request. The domain part of the federated ID is returned. + */ + providerId: string; + /** + * Raw IDP-returned user info. + */ + rawUserInfo: string; + /** + * If idToken is STS id token, then this field will be refresh token. + */ + refreshToken: string; + /** + * The screen_name of a Twitter user or the login name at Github. + */ + screenName: string; + /** + * The timezone of the user. + */ + timeZone: string; + /** + * When action is 'map', contains the idps which can be used for + * confirmation. + */ + verifiedProvider: string[]; + } /** - * Whether the email is registered. - */ - registered: boolean; -} - -export class Resource$Relyingparty { - root: Identitytoolkit; - constructor(root: Identitytoolkit) { - this.root = root; - this.getRoot.bind(this); + * Response from verifying a custom token + */ + export interface Schema$VerifyCustomTokenResponse { + /** + * If idToken is STS id token, then this field will be expiration time of + * STS id token in seconds. + */ + expiresIn: string; + /** + * The GITKit token for authenticated user. + */ + idToken: string; + /** + * True if it's a new user sign-in, false if it's a returning user. + */ + isNewUser: boolean; + /** + * The fixed string "identitytoolkit#VerifyCustomTokenResponse". + */ + kind: string; + /** + * If idToken is STS id token, then this field will be refresh token. + */ + refreshToken: string; } - - getRoot() { - return this.root; + /** + * Request of verifying the password. + */ + export interface Schema$VerifyPasswordResponse { + /** + * The name of the user. + */ + displayName: string; + /** + * The email returned by the IdP. NOTE: The federated login user may not own + * the email. + */ + email: string; + /** + * If idToken is STS id token, then this field will be expiration time of + * STS id token in seconds. + */ + expiresIn: string; + /** + * The GITKit token for authenticated user. + */ + idToken: string; + /** + * The fixed string "identitytoolkit#VerifyPasswordResponse". + */ + kind: string; + /** + * The RP local ID if it's already been mapped to the IdP account + * identified by the federated ID. + */ + localId: string; + /** + * The OAuth2 access token. + */ + oauthAccessToken: string; + /** + * The OAuth2 authorization code. + */ + oauthAuthorizationCode: string; + /** + * The lifetime in seconds of the OAuth2 access token. + */ + oauthExpireIn: number; + /** + * The URI of the user's photo at IdP + */ + photoUrl: string; + /** + * If idToken is STS id token, then this field will be refresh token. + */ + refreshToken: string; + /** + * Whether the email is registered. + */ + registered: boolean; } - - /** - * identitytoolkit.relyingparty.createAuthUri - * @desc Creates the URI used by the IdP to authenticate the user. - * @alias identitytoolkit.relyingparty.createAuthUri - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyCreateAuthUriRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createAuthUri(params?: any, options?: MethodOptions): - AxiosPromise; - createAuthUri( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - createAuthUri( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Relyingparty { + root: Identitytoolkit; + constructor(root: Identitytoolkit) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/createAuthUri') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * identitytoolkit.relyingparty.deleteAccount - * @desc Delete user account. - * @alias identitytoolkit.relyingparty.deleteAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyDeleteAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteAccount(params?: any, options?: MethodOptions): - AxiosPromise; - deleteAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.createAuthUri + * @desc Creates the URI used by the IdP to authenticate the user. + * @alias identitytoolkit.relyingparty.createAuthUri + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyCreateAuthUriRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createAuthUri(params?: any, options?: MethodOptions): + AxiosPromise; + createAuthUri( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + createAuthUri( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/createAuthUri') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/deleteAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.downloadAccount - * @desc Batch download user accounts. - * @alias identitytoolkit.relyingparty.downloadAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyDownloadAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - downloadAccount(params?: any, options?: MethodOptions): - AxiosPromise; - downloadAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - downloadAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.deleteAccount + * @desc Delete user account. + * @alias identitytoolkit.relyingparty.deleteAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyDeleteAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteAccount(params?: any, options?: MethodOptions): + AxiosPromise; + deleteAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/deleteAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/downloadAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.emailLinkSignin - * @desc Reset password for a user. - * @alias identitytoolkit.relyingparty.emailLinkSignin - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyEmailLinkSigninRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - emailLinkSignin(params?: any, options?: MethodOptions): - AxiosPromise; - emailLinkSignin( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - emailLinkSignin( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.downloadAccount + * @desc Batch download user accounts. + * @alias identitytoolkit.relyingparty.downloadAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyDownloadAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + downloadAccount(params?: any, options?: MethodOptions): + AxiosPromise; + downloadAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + downloadAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/identitytoolkit/v3/relyingparty/downloadAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/emailLinkSignin') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.getAccountInfo - * @desc Returns the account info. - * @alias identitytoolkit.relyingparty.getAccountInfo - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyGetAccountInfoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getAccountInfo(params?: any, options?: MethodOptions): - AxiosPromise; - getAccountInfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getAccountInfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.emailLinkSignin + * @desc Reset password for a user. + * @alias identitytoolkit.relyingparty.emailLinkSignin + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyEmailLinkSigninRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + emailLinkSignin(params?: any, options?: MethodOptions): + AxiosPromise; + emailLinkSignin( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + emailLinkSignin( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/identitytoolkit/v3/relyingparty/emailLinkSignin') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/getAccountInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.getOobConfirmationCode - * @desc Get a code for user action confirmation. - * @alias identitytoolkit.relyingparty.getOobConfirmationCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Relyingparty} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getOobConfirmationCode(params?: any, options?: MethodOptions): - AxiosPromise; - getOobConfirmationCode( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getOobConfirmationCode( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.getAccountInfo + * @desc Returns the account info. + * @alias identitytoolkit.relyingparty.getAccountInfo + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyGetAccountInfoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getAccountInfo(params?: any, options?: MethodOptions): + AxiosPromise; + getAccountInfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getAccountInfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/getAccountInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/identitytoolkit/v3/relyingparty/getOobConfirmationCode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * identitytoolkit.relyingparty.getProjectConfig - * @desc Get project configuration. - * @alias identitytoolkit.relyingparty.getProjectConfig - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.delegatedProjectNumber Delegated GCP project number of the request. - * @param {string=} params.projectNumber GCP project number of the request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getProjectConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getProjectConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>): void; - getProjectConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.getOobConfirmationCode + * @desc Get a code for user action confirmation. + * @alias identitytoolkit.relyingparty.getOobConfirmationCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Relyingparty} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getOobConfirmationCode(params?: any, options?: MethodOptions): + AxiosPromise; + getOobConfirmationCode( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getOobConfirmationCode( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/getOobConfirmationCode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/getProjectConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>( - parameters); - } - } - /** - * identitytoolkit.relyingparty.getPublicKeys - * @desc Get token signing public key. - * @alias identitytoolkit.relyingparty.getPublicKeys - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getPublicKeys(params?: any, options?: MethodOptions): - AxiosPromise; - getPublicKeys( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>): void; - getPublicKeys( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.getProjectConfig + * @desc Get project configuration. + * @alias identitytoolkit.relyingparty.getProjectConfig + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.delegatedProjectNumber Delegated GCP project number of the request. + * @param {string=} params.projectNumber GCP project number of the request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getProjectConfig(params?: any, options?: MethodOptions): AxiosPromise< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>; + getProjectConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>): void; + getProjectConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>): + void|AxiosPromise< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/getProjectConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartyGetProjectConfigResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/publicKeys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>(parameters); - } - } - /** - * identitytoolkit.relyingparty.getRecaptchaParam - * @desc Get recaptcha secure param. - * @alias identitytoolkit.relyingparty.getRecaptchaParam - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRecaptchaParam(params?: any, options?: MethodOptions): - AxiosPromise; - getRecaptchaParam( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRecaptchaParam( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.getPublicKeys + * @desc Get token signing public key. + * @alias identitytoolkit.relyingparty.getPublicKeys + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getPublicKeys(params?: any, options?: MethodOptions): + AxiosPromise; + getPublicKeys( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>): void; + getPublicKeys( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/publicKeys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartyGetPublicKeysResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/identitytoolkit/v3/relyingparty/getRecaptchaParam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.resetPassword - * @desc Reset password for a user. - * @alias identitytoolkit.relyingparty.resetPassword - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyResetPasswordRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetPassword(params?: any, options?: MethodOptions): - AxiosPromise; - resetPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.getRecaptchaParam + * @desc Get recaptcha secure param. + * @alias identitytoolkit.relyingparty.getRecaptchaParam + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRecaptchaParam(params?: any, options?: MethodOptions): + AxiosPromise; + getRecaptchaParam( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getRecaptchaParam( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/getRecaptchaParam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/resetPassword') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.sendVerificationCode - * @desc Send SMS verification code. - * @alias identitytoolkit.relyingparty.sendVerificationCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartySendVerificationCodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sendVerificationCode(params?: any, options?: MethodOptions): AxiosPromise< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>; - sendVerificationCode( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>): - void; - sendVerificationCode( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>): - void|AxiosPromise< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.resetPassword + * @desc Reset password for a user. + * @alias identitytoolkit.relyingparty.resetPassword + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyResetPasswordRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetPassword(params?: any, options?: MethodOptions): + AxiosPromise; + resetPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/resetPassword') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/identitytoolkit/v3/relyingparty/sendVerificationCode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>( - parameters); - } - } - /** - * identitytoolkit.relyingparty.setAccountInfo - * @desc Set account info for a user. - * @alias identitytoolkit.relyingparty.setAccountInfo - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartySetAccountInfoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setAccountInfo(params?: any, options?: MethodOptions): - AxiosPromise; - setAccountInfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - setAccountInfo( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.sendVerificationCode + * @desc Send SMS verification code. + * @alias identitytoolkit.relyingparty.sendVerificationCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartySendVerificationCodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sendVerificationCode(params?: any, options?: MethodOptions): AxiosPromise< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>; + sendVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>): + void; + sendVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>): + void|AxiosPromise< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/sendVerificationCode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartySendVerificationCodeResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/setAccountInfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.setProjectConfig - * @desc Set project configuration. - * @alias identitytoolkit.relyingparty.setProjectConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartySetProjectConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setProjectConfig(params?: any, options?: MethodOptions): - AxiosPromise; - setProjectConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>): void; - setProjectConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>): void| - AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.setAccountInfo + * @desc Set account info for a user. + * @alias identitytoolkit.relyingparty.setAccountInfo + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartySetAccountInfoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setAccountInfo(params?: any, options?: MethodOptions): + AxiosPromise; + setAccountInfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + setAccountInfo( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/setAccountInfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/setProjectConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>( - parameters); - } - } - /** - * identitytoolkit.relyingparty.signOutUser - * @desc Sign out user. - * @alias identitytoolkit.relyingparty.signOutUser - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartySignOutUserRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - signOutUser(params?: any, options?: MethodOptions): - AxiosPromise; - signOutUser( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySignOutUserResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySignOutUserResponse>): void; - signOutUser( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySignOutUserResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartySignOutUserResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.setProjectConfig + * @desc Set project configuration. + * @alias identitytoolkit.relyingparty.setProjectConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartySetProjectConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setProjectConfig(params?: any, options?: MethodOptions): AxiosPromise< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>; + setProjectConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>): void; + setProjectConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>): + void|AxiosPromise< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/setProjectConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartySetProjectConfigResponse>( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/signOutUser') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartySignOutUserResponse>(parameters); - } - } - /** - * identitytoolkit.relyingparty.signupNewUser - * @desc Signup new user. - * @alias identitytoolkit.relyingparty.signupNewUser - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartySignupNewUserRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - signupNewUser(params?: any, options?: MethodOptions): - AxiosPromise; - signupNewUser( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - signupNewUser( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.signOutUser + * @desc Sign out user. + * @alias identitytoolkit.relyingparty.signOutUser + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartySignOutUserRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + signOutUser(params?: any, options?: MethodOptions): + AxiosPromise; + signOutUser( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySignOutUserResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySignOutUserResponse>): void; + signOutUser( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySignOutUserResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartySignOutUserResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/signOutUser') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartySignOutUserResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/signupNewUser') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.uploadAccount - * @desc Batch upload existing user accounts. - * @alias identitytoolkit.relyingparty.uploadAccount - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyUploadAccountRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - uploadAccount(params?: any, options?: MethodOptions): - AxiosPromise; - uploadAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - uploadAccount( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.signupNewUser + * @desc Signup new user. + * @alias identitytoolkit.relyingparty.signupNewUser + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartySignupNewUserRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + signupNewUser(params?: any, options?: MethodOptions): + AxiosPromise; + signupNewUser( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + signupNewUser( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/signupNewUser') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/uploadAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.verifyAssertion - * @desc Verifies the assertion returned by the IdP. - * @alias identitytoolkit.relyingparty.verifyAssertion - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyVerifyAssertionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verifyAssertion(params?: any, options?: MethodOptions): - AxiosPromise; - verifyAssertion( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - verifyAssertion( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.uploadAccount + * @desc Batch upload existing user accounts. + * @alias identitytoolkit.relyingparty.uploadAccount + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyUploadAccountRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + uploadAccount(params?: any, options?: MethodOptions): + AxiosPromise; + uploadAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + uploadAccount( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/uploadAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/verifyAssertion') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.verifyCustomToken - * @desc Verifies the developer asserted ID token. - * @alias identitytoolkit.relyingparty.verifyCustomToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyVerifyCustomTokenRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verifyCustomToken(params?: any, options?: MethodOptions): - AxiosPromise; - verifyCustomToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - verifyCustomToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.verifyAssertion + * @desc Verifies the assertion returned by the IdP. + * @alias identitytoolkit.relyingparty.verifyAssertion + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyVerifyAssertionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyAssertion(params?: any, options?: MethodOptions): + AxiosPromise; + verifyAssertion( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + verifyAssertion( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/identitytoolkit/v3/relyingparty/verifyAssertion') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/identitytoolkit/v3/relyingparty/verifyCustomToken') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.verifyPassword - * @desc Verifies the user entered password. - * @alias identitytoolkit.relyingparty.verifyPassword - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyVerifyPasswordRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verifyPassword(params?: any, options?: MethodOptions): - AxiosPromise; - verifyPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - verifyPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.verifyCustomToken + * @desc Verifies the developer asserted ID token. + * @alias identitytoolkit.relyingparty.verifyCustomToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyVerifyCustomTokenRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyCustomToken(params?: any, options?: MethodOptions): + AxiosPromise; + verifyCustomToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + verifyCustomToken( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/verifyCustomToken') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/identitytoolkit/v3/relyingparty/verifyPassword') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * identitytoolkit.relyingparty.verifyPhoneNumber - * @desc Verifies ownership of a phone number and creates/updates the user - * account accordingly. - * @alias identitytoolkit.relyingparty.verifyPhoneNumber - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verifyPhoneNumber(params?: any, options?: MethodOptions): - AxiosPromise; - verifyPhoneNumber( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>): void; - verifyPhoneNumber( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>, - callback?: BodyResponseCallback< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>): - void|AxiosPromise< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * identitytoolkit.relyingparty.verifyPassword + * @desc Verifies the user entered password. + * @alias identitytoolkit.relyingparty.verifyPassword + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyVerifyPasswordRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyPassword(params?: any, options?: MethodOptions): + AxiosPromise; + verifyPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + verifyPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/identitytoolkit/v3/relyingparty/verifyPassword') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/identitytoolkit/v3/relyingparty/verifyPhoneNumber') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>( - parameters); + + + /** + * identitytoolkit.relyingparty.verifyPhoneNumber + * @desc Verifies ownership of a phone number and creates/updates the user + * account accordingly. + * @alias identitytoolkit.relyingparty.verifyPhoneNumber + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().IdentitytoolkitRelyingpartyVerifyPhoneNumberRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyPhoneNumber(params?: any, options?: MethodOptions): AxiosPromise< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>; + verifyPhoneNumber( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>): void; + verifyPhoneNumber( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>, + callback?: BodyResponseCallback< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>): + void|AxiosPromise< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/identitytoolkit/v3/relyingparty/verifyPhoneNumber') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$IdentitytoolkitRelyingpartyVerifyPhoneNumberResponse>( + parameters); + } } } } diff --git a/src/apis/index.ts b/src/apis/index.ts index f87e7925b14..a56a014953b 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -18,204 +18,205 @@ import * as util from 'util'; import {ServiceOptions} from '../lib/api'; -import * as abusiveexperiencereport_v1 from './abusiveexperiencereport/v1'; -import * as acceleratedmobilepageurl_v1 from './acceleratedmobilepageurl/v1'; -import * as adexchangebuyer_v1_2 from './adexchangebuyer/v1.2'; -import * as adexchangebuyer_v1_3 from './adexchangebuyer/v1.3'; -import * as adexchangebuyer_v1_4 from './adexchangebuyer/v1.4'; -import * as adexchangebuyer2_v2beta1 from './adexchangebuyer2/v2beta1'; -import * as adexchangeseller_v1 from './adexchangeseller/v1'; -import * as adexchangeseller_v1_1 from './adexchangeseller/v1.1'; -import * as adexchangeseller_v2_0 from './adexchangeseller/v2.0'; -import * as adexperiencereport_v1 from './adexperiencereport/v1'; -import * as admin_datatransfer_v1 from './admin/datatransfer_v1'; -import * as admin_directory_v1 from './admin/directory_v1'; -import * as admin_reports_v1 from './admin/reports_v1'; -import * as adsense_v1_4 from './adsense/v1.4'; -import * as adsensehost_v4_1 from './adsensehost/v4.1'; -import * as analytics_v2_4 from './analytics/v2.4'; -import * as analytics_v3 from './analytics/v3'; -import * as analyticsreporting_v4 from './analyticsreporting/v4'; -import * as androiddeviceprovisioning_v1 from './androiddeviceprovisioning/v1'; -import * as androidenterprise_v1 from './androidenterprise/v1'; -import * as androidmanagement_v1 from './androidmanagement/v1'; -import * as androidpublisher_v1 from './androidpublisher/v1'; -import * as androidpublisher_v1_1 from './androidpublisher/v1.1'; -import * as androidpublisher_v2 from './androidpublisher/v2'; -import * as appengine_v1 from './appengine/v1'; -import * as appengine_v1alpha from './appengine/v1alpha'; -import * as appengine_v1beta from './appengine/v1beta'; -import * as appengine_v1beta4 from './appengine/v1beta4'; -import * as appengine_v1beta5 from './appengine/v1beta5'; -import * as appsactivity_v1 from './appsactivity/v1'; -import * as appstate_v1 from './appstate/v1'; -import * as bigquery_v2 from './bigquery/v2'; -import * as bigquerydatatransfer_v1 from './bigquerydatatransfer/v1'; -import * as blogger_v2 from './blogger/v2'; -import * as blogger_v3 from './blogger/v3'; -import * as books_v1 from './books/v1'; -import * as calendar_v3 from './calendar/v3'; -import * as chat_v1 from './chat/v1'; -import * as civicinfo_v2 from './civicinfo/v2'; -import * as classroom_v1 from './classroom/v1'; -import * as cloudbilling_v1 from './cloudbilling/v1'; -import * as cloudbuild_v1 from './cloudbuild/v1'; -import * as clouddebugger_v2 from './clouddebugger/v2'; -import * as clouderrorreporting_v1beta1 from './clouderrorreporting/v1beta1'; -import * as cloudfunctions_v1 from './cloudfunctions/v1'; -import * as cloudfunctions_v1beta2 from './cloudfunctions/v1beta2'; -import * as cloudiot_v1 from './cloudiot/v1'; -import * as cloudkms_v1 from './cloudkms/v1'; -import * as cloudresourcemanager_v1 from './cloudresourcemanager/v1'; -import * as cloudresourcemanager_v1beta1 from './cloudresourcemanager/v1beta1'; -import * as cloudresourcemanager_v2 from './cloudresourcemanager/v2'; -import * as cloudresourcemanager_v2beta1 from './cloudresourcemanager/v2beta1'; -import * as cloudshell_v1 from './cloudshell/v1'; -import * as cloudshell_v1alpha1 from './cloudshell/v1alpha1'; -import * as cloudtasks_v2beta2 from './cloudtasks/v2beta2'; -import * as cloudtrace_v1 from './cloudtrace/v1'; -import * as cloudtrace_v2 from './cloudtrace/v2'; -import * as compute_alpha from './compute/alpha'; -import * as compute_beta from './compute/beta'; -import * as compute_v1 from './compute/v1'; -import * as container_v1 from './container/v1'; -import * as container_v1beta1 from './container/v1beta1'; -import * as content_v2 from './content/v2'; -import * as content_v2sandbox from './content/v2sandbox'; -import * as customsearch_v1 from './customsearch/v1'; -import * as dataflow_v1b3 from './dataflow/v1b3'; -import * as dataproc_v1 from './dataproc/v1'; -import * as dataproc_v1beta2 from './dataproc/v1beta2'; -import * as datastore_v1 from './datastore/v1'; -import * as datastore_v1beta1 from './datastore/v1beta1'; -import * as datastore_v1beta3 from './datastore/v1beta3'; -import * as deploymentmanager_alpha from './deploymentmanager/alpha'; -import * as deploymentmanager_v2 from './deploymentmanager/v2'; -import * as deploymentmanager_v2beta from './deploymentmanager/v2beta'; -import * as dfareporting_v2_8 from './dfareporting/v2.8'; -import * as dfareporting_v3_0 from './dfareporting/v3.0'; -import * as dialogflow_v2 from './dialogflow/v2'; -import * as dialogflow_v2beta1 from './dialogflow/v2beta1'; -import * as digitalassetlinks_v1 from './digitalassetlinks/v1'; -import * as discovery_v1 from './discovery/v1'; -import * as dlp_v2 from './dlp/v2'; -import * as dlp_v2beta1 from './dlp/v2beta1'; -import * as dlp_v2beta2 from './dlp/v2beta2'; -import * as dns_v1 from './dns/v1'; -import * as dns_v1beta2 from './dns/v1beta2'; -import * as dns_v2beta1 from './dns/v2beta1'; -import * as doubleclickbidmanager_v1 from './doubleclickbidmanager/v1'; -import * as doubleclicksearch_v2 from './doubleclicksearch/v2'; -import * as drive_v2 from './drive/v2'; -import * as drive_v3 from './drive/v3'; -import * as firebasedynamiclinks_v1 from './firebasedynamiclinks/v1'; -import * as firebaserules_v1 from './firebaserules/v1'; -import * as firestore_v1beta1 from './firestore/v1beta1'; -import * as fitness_v1 from './fitness/v1'; -import * as fusiontables_v1 from './fusiontables/v1'; -import * as fusiontables_v2 from './fusiontables/v2'; -import * as games_v1 from './games/v1'; -import * as gamesConfiguration_v1configuration from './gamesConfiguration/v1configuration'; -import * as gamesManagement_v1management from './gamesManagement/v1management'; -import * as genomics_v1 from './genomics/v1'; -import * as genomics_v1alpha2 from './genomics/v1alpha2'; -import * as genomics_v2alpha1 from './genomics/v2alpha1'; -import * as gmail_v1 from './gmail/v1'; -import * as groupsmigration_v1 from './groupsmigration/v1'; -import * as groupssettings_v1 from './groupssettings/v1'; -import * as iam_v1 from './iam/v1'; -import * as identitytoolkit_v3 from './identitytoolkit/v3'; -import * as kgsearch_v1 from './kgsearch/v1'; -import * as language_v1 from './language/v1'; -import * as language_v1beta1 from './language/v1beta1'; -import * as language_v1beta2 from './language/v1beta2'; -import * as licensing_v1 from './licensing/v1'; -import * as logging_v2 from './logging/v2'; -import * as logging_v2beta1 from './logging/v2beta1'; -import * as manufacturers_v1 from './manufacturers/v1'; -import * as mirror_v1 from './mirror/v1'; -import * as ml_v1 from './ml/v1'; -import * as monitoring_v3 from './monitoring/v3'; -import * as oauth2_v1 from './oauth2/v1'; -import * as oauth2_v2 from './oauth2/v2'; -import * as oslogin_v1 from './oslogin/v1'; -import * as oslogin_v1alpha from './oslogin/v1alpha'; -import * as oslogin_v1beta from './oslogin/v1beta'; -import * as pagespeedonline_v1 from './pagespeedonline/v1'; -import * as pagespeedonline_v2 from './pagespeedonline/v2'; -import * as pagespeedonline_v4 from './pagespeedonline/v4'; -import * as partners_v2 from './partners/v2'; -import * as people_v1 from './people/v1'; -import * as playcustomapp_v1 from './playcustomapp/v1'; -import * as plus_v1 from './plus/v1'; -import * as plusDomains_v1 from './plusDomains/v1'; -import * as poly_v1 from './poly/v1'; -import * as prediction_v1_2 from './prediction/v1.2'; -import * as prediction_v1_3 from './prediction/v1.3'; -import * as prediction_v1_4 from './prediction/v1.4'; -import * as prediction_v1_5 from './prediction/v1.5'; -import * as prediction_v1_6 from './prediction/v1.6'; -import * as proximitybeacon_v1beta1 from './proximitybeacon/v1beta1'; -import * as pubsub_v1 from './pubsub/v1'; -import * as pubsub_v1beta1a from './pubsub/v1beta1a'; -import * as pubsub_v1beta2 from './pubsub/v1beta2'; -import * as replicapool_v1beta1 from './replicapool/v1beta1'; -import * as replicapool_v1beta2 from './replicapool/v1beta2'; -import * as replicapoolupdater_v1beta1 from './replicapoolupdater/v1beta1'; -import * as reseller_v1 from './reseller/v1'; -import * as resourceviews_v1beta1 from './resourceviews/v1beta1'; -import * as resourceviews_v1beta2 from './resourceviews/v1beta2'; -import * as runtimeconfig_v1 from './runtimeconfig/v1'; -import * as runtimeconfig_v1beta1 from './runtimeconfig/v1beta1'; -import * as safebrowsing_v4 from './safebrowsing/v4'; -import * as script_v1 from './script/v1'; -import * as searchconsole_v1 from './searchconsole/v1'; -import * as serviceconsumermanagement_v1 from './serviceconsumermanagement/v1'; -import * as servicecontrol_v1 from './servicecontrol/v1'; -import * as servicemanagement_v1 from './servicemanagement/v1'; -import * as serviceusage_v1beta1 from './serviceusage/v1beta1'; -import * as serviceuser_v1 from './serviceuser/v1'; -import * as sheets_v4 from './sheets/v4'; -import * as siteVerification_v1 from './siteVerification/v1'; -import * as slides_v1 from './slides/v1'; -import * as sourcerepo_v1 from './sourcerepo/v1'; -import * as spanner_v1 from './spanner/v1'; -import * as spectrum_v1explorer from './spectrum/v1explorer'; -import * as speech_v1 from './speech/v1'; -import * as speech_v1beta1 from './speech/v1beta1'; -import * as sqladmin_v1beta3 from './sqladmin/v1beta3'; -import * as sqladmin_v1beta4 from './sqladmin/v1beta4'; -import * as storage_v1 from './storage/v1'; -import * as storage_v1beta1 from './storage/v1beta1'; -import * as storage_v1beta2 from './storage/v1beta2'; -import * as storagetransfer_v1 from './storagetransfer/v1'; -import * as streetviewpublish_v1 from './streetviewpublish/v1'; -import * as surveys_v2 from './surveys/v2'; -import * as tagmanager_v1 from './tagmanager/v1'; -import * as tagmanager_v2 from './tagmanager/v2'; -import * as taskqueue_v1beta1 from './taskqueue/v1beta1'; -import * as taskqueue_v1beta2 from './taskqueue/v1beta2'; -import * as tasks_v1 from './tasks/v1'; -import * as testing_v1 from './testing/v1'; -import * as texttospeech_v1beta1 from './texttospeech/v1beta1'; -import * as toolresults_v1beta3 from './toolresults/v1beta3'; -import * as tpu_v1alpha1 from './tpu/v1alpha1'; -import * as translate_v2 from './translate/v2'; -import * as urlshortener_v1 from './urlshortener/v1'; -import * as vault_v1 from './vault/v1'; -import * as videointelligence_v1 from './videointelligence/v1'; -import * as videointelligence_v1beta1 from './videointelligence/v1beta1'; -import * as videointelligence_v1beta2 from './videointelligence/v1beta2'; -import * as vision_v1 from './vision/v1'; -import * as vision_v1p1beta1 from './vision/v1p1beta1'; -import * as vision_v1p2beta1 from './vision/v1p2beta1'; -import * as webfonts_v1 from './webfonts/v1'; -import * as webmasters_v3 from './webmasters/v3'; -import * as youtube_v3 from './youtube/v3'; -import * as youtubeAnalytics_v1 from './youtubeAnalytics/v1'; -import * as youtubeAnalytics_v1beta1 from './youtubeAnalytics/v1beta1'; -import * as youtubeAnalytics_v2 from './youtubeAnalytics/v2'; -import * as youtubereporting_v1 from './youtubereporting/v1'; +import {abusiveexperiencereport_v1} from './abusiveexperiencereport/v1'; +import {acceleratedmobilepageurl_v1} from './acceleratedmobilepageurl/v1'; +import {adexchangebuyer_v1_2} from './adexchangebuyer/v1.2'; +import {adexchangebuyer_v1_3} from './adexchangebuyer/v1.3'; +import {adexchangebuyer_v1_4} from './adexchangebuyer/v1.4'; +import {adexchangebuyer2_v2beta1} from './adexchangebuyer2/v2beta1'; +import {adexchangeseller_v1} from './adexchangeseller/v1'; +import {adexchangeseller_v1_1} from './adexchangeseller/v1.1'; +import {adexchangeseller_v2_0} from './adexchangeseller/v2.0'; +import {adexperiencereport_v1} from './adexperiencereport/v1'; +import {admin_datatransfer_v1} from './admin/datatransfer_v1'; +import {admin_directory_v1} from './admin/directory_v1'; +import {admin_reports_v1} from './admin/reports_v1'; +import {adsense_v1_4} from './adsense/v1.4'; +import {adsensehost_v4_1} from './adsensehost/v4.1'; +import {analytics_v2_4} from './analytics/v2.4'; +import {analytics_v3} from './analytics/v3'; +import {analyticsreporting_v4} from './analyticsreporting/v4'; +import {androiddeviceprovisioning_v1} from './androiddeviceprovisioning/v1'; +import {androidenterprise_v1} from './androidenterprise/v1'; +import {androidmanagement_v1} from './androidmanagement/v1'; +import {androidpublisher_v1} from './androidpublisher/v1'; +import {androidpublisher_v1_1} from './androidpublisher/v1.1'; +import {androidpublisher_v2} from './androidpublisher/v2'; +import {appengine_v1} from './appengine/v1'; +import {appengine_v1alpha} from './appengine/v1alpha'; +import {appengine_v1beta} from './appengine/v1beta'; +import {appengine_v1beta4} from './appengine/v1beta4'; +import {appengine_v1beta5} from './appengine/v1beta5'; +import {appsactivity_v1} from './appsactivity/v1'; +import {appstate_v1} from './appstate/v1'; +import {bigquery_v2} from './bigquery/v2'; +import {bigquerydatatransfer_v1} from './bigquerydatatransfer/v1'; +import {blogger_v2} from './blogger/v2'; +import {blogger_v3} from './blogger/v3'; +import {books_v1} from './books/v1'; +import {calendar_v3} from './calendar/v3'; +import {chat_v1} from './chat/v1'; +import {civicinfo_v2} from './civicinfo/v2'; +import {classroom_v1} from './classroom/v1'; +import {cloudbilling_v1} from './cloudbilling/v1'; +import {cloudbuild_v1} from './cloudbuild/v1'; +import {clouddebugger_v2} from './clouddebugger/v2'; +import {clouderrorreporting_v1beta1} from './clouderrorreporting/v1beta1'; +import {cloudfunctions_v1} from './cloudfunctions/v1'; +import {cloudfunctions_v1beta2} from './cloudfunctions/v1beta2'; +import {cloudiot_v1} from './cloudiot/v1'; +import {cloudkms_v1} from './cloudkms/v1'; +import {cloudresourcemanager_v1} from './cloudresourcemanager/v1'; +import {cloudresourcemanager_v1beta1} from './cloudresourcemanager/v1beta1'; +import {cloudresourcemanager_v2} from './cloudresourcemanager/v2'; +import {cloudresourcemanager_v2beta1} from './cloudresourcemanager/v2beta1'; +import {cloudshell_v1} from './cloudshell/v1'; +import {cloudshell_v1alpha1} from './cloudshell/v1alpha1'; +import {cloudtasks_v2beta2} from './cloudtasks/v2beta2'; +import {cloudtrace_v1} from './cloudtrace/v1'; +import {cloudtrace_v2} from './cloudtrace/v2'; +import {compute_alpha} from './compute/alpha'; +import {compute_beta} from './compute/beta'; +import {compute_v1} from './compute/v1'; +import {container_v1} from './container/v1'; +import {container_v1beta1} from './container/v1beta1'; +import {content_v2} from './content/v2'; +import {content_v2sandbox} from './content/v2sandbox'; +import {customsearch_v1} from './customsearch/v1'; +import {dataflow_v1b3} from './dataflow/v1b3'; +import {dataproc_v1} from './dataproc/v1'; +import {dataproc_v1beta2} from './dataproc/v1beta2'; +import {datastore_v1} from './datastore/v1'; +import {datastore_v1beta1} from './datastore/v1beta1'; +import {datastore_v1beta3} from './datastore/v1beta3'; +import {deploymentmanager_alpha} from './deploymentmanager/alpha'; +import {deploymentmanager_v2} from './deploymentmanager/v2'; +import {deploymentmanager_v2beta} from './deploymentmanager/v2beta'; +import {dfareporting_v2_8} from './dfareporting/v2.8'; +import {dfareporting_v3_0} from './dfareporting/v3.0'; +import {dialogflow_v2} from './dialogflow/v2'; +import {dialogflow_v2beta1} from './dialogflow/v2beta1'; +import {digitalassetlinks_v1} from './digitalassetlinks/v1'; +import {discovery_v1} from './discovery/v1'; +import {dlp_v2} from './dlp/v2'; +import {dlp_v2beta1} from './dlp/v2beta1'; +import {dlp_v2beta2} from './dlp/v2beta2'; +import {dns_v1} from './dns/v1'; +import {dns_v1beta2} from './dns/v1beta2'; +import {dns_v2beta1} from './dns/v2beta1'; +import {doubleclickbidmanager_v1} from './doubleclickbidmanager/v1'; +import {doubleclicksearch_v2} from './doubleclicksearch/v2'; +import {drive_v2} from './drive/v2'; +import {drive_v3} from './drive/v3'; +import {firebasedynamiclinks_v1} from './firebasedynamiclinks/v1'; +import {firebaserules_v1} from './firebaserules/v1'; +import {firestore_v1beta1} from './firestore/v1beta1'; +import {fitness_v1} from './fitness/v1'; +import {fusiontables_v1} from './fusiontables/v1'; +import {fusiontables_v2} from './fusiontables/v2'; +import {games_v1} from './games/v1'; +import {gamesConfiguration_v1configuration} from './gamesConfiguration/v1configuration'; +import {gamesManagement_v1management} from './gamesManagement/v1management'; +import {genomics_v1} from './genomics/v1'; +import {genomics_v1alpha2} from './genomics/v1alpha2'; +import {genomics_v2alpha1} from './genomics/v2alpha1'; +import {gmail_v1} from './gmail/v1'; +import {groupsmigration_v1} from './groupsmigration/v1'; +import {groupssettings_v1} from './groupssettings/v1'; +import {iam_v1} from './iam/v1'; +import {identitytoolkit_v3} from './identitytoolkit/v3'; +import {kgsearch_v1} from './kgsearch/v1'; +import {language_v1} from './language/v1'; +import {language_v1beta1} from './language/v1beta1'; +import {language_v1beta2} from './language/v1beta2'; +import {licensing_v1} from './licensing/v1'; +import {logging_v2} from './logging/v2'; +import {logging_v2beta1} from './logging/v2beta1'; +import {manufacturers_v1} from './manufacturers/v1'; +import {mirror_v1} from './mirror/v1'; +import {ml_v1} from './ml/v1'; +import {monitoring_v3} from './monitoring/v3'; +import {oauth2_v1} from './oauth2/v1'; +import {oauth2_v2} from './oauth2/v2'; +import {oslogin_v1} from './oslogin/v1'; +import {oslogin_v1alpha} from './oslogin/v1alpha'; +import {oslogin_v1beta} from './oslogin/v1beta'; +import {pagespeedonline_v1} from './pagespeedonline/v1'; +import {pagespeedonline_v2} from './pagespeedonline/v2'; +import {pagespeedonline_v4} from './pagespeedonline/v4'; +import {partners_v2} from './partners/v2'; +import {people_v1} from './people/v1'; +import {playcustomapp_v1} from './playcustomapp/v1'; +import {plus_v1} from './plus/v1'; +import {plusDomains_v1} from './plusDomains/v1'; +import {poly_v1} from './poly/v1'; +import {prediction_v1_2} from './prediction/v1.2'; +import {prediction_v1_3} from './prediction/v1.3'; +import {prediction_v1_4} from './prediction/v1.4'; +import {prediction_v1_5} from './prediction/v1.5'; +import {prediction_v1_6} from './prediction/v1.6'; +import {proximitybeacon_v1beta1} from './proximitybeacon/v1beta1'; +import {pubsub_v1} from './pubsub/v1'; +import {pubsub_v1beta1a} from './pubsub/v1beta1a'; +import {pubsub_v1beta2} from './pubsub/v1beta2'; +import {replicapool_v1beta1} from './replicapool/v1beta1'; +import {replicapool_v1beta2} from './replicapool/v1beta2'; +import {replicapoolupdater_v1beta1} from './replicapoolupdater/v1beta1'; +import {reseller_v1} from './reseller/v1'; +import {resourceviews_v1beta1} from './resourceviews/v1beta1'; +import {resourceviews_v1beta2} from './resourceviews/v1beta2'; +import {runtimeconfig_v1} from './runtimeconfig/v1'; +import {runtimeconfig_v1beta1} from './runtimeconfig/v1beta1'; +import {safebrowsing_v4} from './safebrowsing/v4'; +import {script_v1} from './script/v1'; +import {searchconsole_v1} from './searchconsole/v1'; +import {serviceconsumermanagement_v1} from './serviceconsumermanagement/v1'; +import {servicecontrol_v1} from './servicecontrol/v1'; +import {servicemanagement_v1} from './servicemanagement/v1'; +import {serviceusage_v1beta1} from './serviceusage/v1beta1'; +import {serviceuser_v1} from './serviceuser/v1'; +import {sheets_v4} from './sheets/v4'; +import {siteVerification_v1} from './siteVerification/v1'; +import {slides_v1} from './slides/v1'; +import {sourcerepo_v1} from './sourcerepo/v1'; +import {spanner_v1} from './spanner/v1'; +import {spectrum_v1explorer} from './spectrum/v1explorer'; +import {speech_v1} from './speech/v1'; +import {speech_v1beta1} from './speech/v1beta1'; +import {sqladmin_v1beta3} from './sqladmin/v1beta3'; +import {sqladmin_v1beta4} from './sqladmin/v1beta4'; +import {storage_v1} from './storage/v1'; +import {storage_v1beta1} from './storage/v1beta1'; +import {storage_v1beta2} from './storage/v1beta2'; +import {storagetransfer_v1} from './storagetransfer/v1'; +import {streetviewpublish_v1} from './streetviewpublish/v1'; +import {surveys_v2} from './surveys/v2'; +import {tagmanager_v1} from './tagmanager/v1'; +import {tagmanager_v2} from './tagmanager/v2'; +import {taskqueue_v1beta1} from './taskqueue/v1beta1'; +import {taskqueue_v1beta2} from './taskqueue/v1beta2'; +import {tasks_v1} from './tasks/v1'; +import {testing_v1} from './testing/v1'; +import {texttospeech_v1beta1} from './texttospeech/v1beta1'; +import {toolresults_v1beta3} from './toolresults/v1beta3'; +import {tpu_v1alpha1} from './tpu/v1alpha1'; +import {translate_v2} from './translate/v2'; +import {urlshortener_v1} from './urlshortener/v1'; +import {vault_v1} from './vault/v1'; +import {videointelligence_v1} from './videointelligence/v1'; +import {videointelligence_v1beta1} from './videointelligence/v1beta1'; +import {videointelligence_v1beta2} from './videointelligence/v1beta2'; +import {vision_v1} from './vision/v1'; +import {vision_v1p1beta1} from './vision/v1p1beta1'; +import {vision_v1p2beta1} from './vision/v1p2beta1'; +import {webfonts_v1} from './webfonts/v1'; +import {webmasters_v3} from './webmasters/v3'; +import {websecurityscanner_v1alpha} from './websecurityscanner/v1alpha'; +import {youtube_v3} from './youtube/v3'; +import {youtubeAnalytics_v1} from './youtubeAnalytics/v1'; +import {youtubeAnalytics_v1beta1} from './youtubeAnalytics/v1beta1'; +import {youtubeAnalytics_v2} from './youtubeAnalytics/v2'; +import {youtubereporting_v1} from './youtubereporting/v1'; export interface APIList { // tslint:disable-next-line: no-any @@ -670,6 +671,9 @@ export const APIS: APIList = { webmasters: { 'v3': webmasters_v3.Webmasters, }, + websecurityscanner: { + 'v1alpha': websecurityscanner_v1alpha.Websecurityscanner, + }, youtube: { 'v3': youtube_v3.Youtube, }, @@ -1220,6 +1224,10 @@ export class GeneratedAPIs { webmasters(options: ServiceOptions|string) { return this.getAPI('webmasters', options); } + websecurityscanner( + options: ServiceOptions|string) { + return this.getAPI('websecurityscanner', options); + } youtube(options: ServiceOptions|string) { return this.getAPI('youtube', options); } diff --git a/src/apis/kgsearch/v1.ts b/src/apis/kgsearch/v1.ts index cd0edcba1d2..c8aa0c8e1f8 100644 --- a/src/apis/kgsearch/v1.ts +++ b/src/apis/kgsearch/v1.ts @@ -27,132 +27,135 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Knowledge Graph Search API - * - * Searches the Google Knowledge Graph for entities. - * - * @example - * const google = require('googleapis'); - * const kgsearch = google.kgsearch('v1'); - * - * @namespace kgsearch - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Kgsearch - */ -export class Kgsearch { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace kgsearch_v1 { + /** + * Knowledge Graph Search API + * + * Searches the Google Knowledge Graph for entities. + * + * @example + * const google = require('googleapis'); + * const kgsearch = google.kgsearch('v1'); + * + * @namespace kgsearch + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Kgsearch + */ + export class Kgsearch { + _options: GlobalOptions; + google: GoogleApis; + root = this; - entities: Resource$Entities; + entities: Resource$Entities; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.entities = new Resource$Entities(this); - } + this.entities = new Resource$Entities(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Response message includes the context and a list of matching results which - * contain the detail of associated entities. - */ -export interface Schema$SearchResponse { /** - * The local context applicable for the response. See more details at - * http://www.w3.org/TR/json-ld/#context-definitions. + * Response message includes the context and a list of matching results which + * contain the detail of associated entities. */ - context: any; - /** - * The schema type of top-level JSON-LD object, e.g. ItemList. - */ - type: any; - /** - * The item list of search results. - */ - itemListElement: any[]; -} - -export class Resource$Entities { - root: Kgsearch; - constructor(root: Kgsearch) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SearchResponse { + /** + * The local context applicable for the response. See more details at + * http://www.w3.org/TR/json-ld/#context-definitions. + */ + context: any; + /** + * The schema type of top-level JSON-LD object, e.g. ItemList. + */ + type: any; + /** + * The item list of search results. + */ + itemListElement: any[]; } - - /** - * kgsearch.entities.search - * @desc Searches Knowledge Graph for entities that match the constraints. A - * list of matched entities will be returned in response, which will be in - * JSON-LD format and compatible with http://schema.org - * @alias kgsearch.entities.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ids The list of entity id to be used for search instead of query string. To specify multiple ids in the HTTP request, repeat the parameter in the URL as in ...?ids=A&ids=B - * @param {boolean=} params.indent Enables indenting of json results. - * @param {string=} params.languages The list of language codes (defined in ISO 693) to run the query with, e.g. 'en'. - * @param {integer=} params.limit Limits the number of entities to be returned. - * @param {boolean=} params.prefix Enables prefix match against names and aliases of entities - * @param {string=} params.query The literal query string for search. - * @param {string=} params.types Restricts returned entities with these types, e.g. Person (as defined in http://schema.org/Person). If multiple types are specified, returned entities will contain one or more of these types. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Entities { + root: Kgsearch; + constructor(root: Kgsearch) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://kgsearch.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/entities:search').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * kgsearch.entities.search + * @desc Searches Knowledge Graph for entities that match the constraints. A + * list of matched entities will be returned in response, which will be in + * JSON-LD format and compatible with http://schema.org + * @alias kgsearch.entities.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ids The list of entity id to be used for search instead of query string. To specify multiple ids in the HTTP request, repeat the parameter in the URL as in ...?ids=A&ids=B + * @param {boolean=} params.indent Enables indenting of json results. + * @param {string=} params.languages The list of language codes (defined in ISO 693) to run the query with, e.g. 'en'. + * @param {integer=} params.limit Limits the number of entities to be returned. + * @param {boolean=} params.prefix Enables prefix match against names and aliases of entities + * @param {string=} params.query The literal query string for search. + * @param {string=} params.types Restricts returned entities with these types, e.g. Person (as defined in http://schema.org/Person). If multiple types are specified, returned entities will contain one or more of these types. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://kgsearch.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/entities:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/language/v1.ts b/src/apis/language/v1.ts index 45d161c75f6..ef495485e5a 100644 --- a/src/apis/language/v1.ts +++ b/src/apis/language/v1.ts @@ -27,909 +27,922 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Natural Language API - * - * Provides natural language understanding technologies to developers. Examples - * include sentiment analysis, entity recognition, entity sentiment analysis, - * and text annotations. - * - * @example - * const google = require('googleapis'); - * const language = google.language('v1'); - * - * @namespace language - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Language - */ -export class Language { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace language_v1 { + /** + * Cloud Natural Language API + * + * Provides natural language understanding technologies to developers. + * Examples include sentiment analysis, entity recognition, entity sentiment + * analysis, and text annotations. + * + * @example + * const google = require('googleapis'); + * const language = google.language('v1'); + * + * @namespace language + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Language + */ + export class Language { + _options: GlobalOptions; + google: GoogleApis; + root = this; - documents: Resource$Documents; + documents: Resource$Documents; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.documents = new Resource$Documents(this); - } + this.documents = new Resource$Documents(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The entity analysis request message. - */ -export interface Schema$AnalyzeEntitiesRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The entity analysis response message. - */ -export interface Schema$AnalyzeEntitiesResponse { - /** - * The recognized entities in the input document. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; -} -/** - * The entity-level sentiment analysis request message. - */ -export interface Schema$AnalyzeEntitySentimentRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The entity-level sentiment analysis response message. - */ -export interface Schema$AnalyzeEntitySentimentResponse { - /** - * The recognized entities in the input document with associated sentiments. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; -} -/** - * The sentiment analysis request message. - */ -export interface Schema$AnalyzeSentimentRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate sentence offsets. - */ - encodingType: string; -} -/** - * The sentiment analysis response message. - */ -export interface Schema$AnalyzeSentimentResponse { - /** - * The overall sentiment of the input document. - */ - documentSentiment: Schema$Sentiment; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * The sentiment for all the sentences in the document. - */ - sentences: Schema$Sentence[]; -} -/** - * The syntax analysis request message. - */ -export interface Schema$AnalyzeSyntaxRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The syntax analysis response message. - */ -export interface Schema$AnalyzeSyntaxResponse { - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - */ - tokens: Schema$Token[]; -} -/** - * The request message for the text annotation API, which can perform multiple - * analysis types (sentiment, entities, and syntax) in one call. - */ -export interface Schema$AnnotateTextRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; - /** - * The enabled features. - */ - features: Schema$Features; -} -/** - * The text annotations response message. - */ -export interface Schema$AnnotateTextResponse { - /** - * Categories identified in the input document. - */ - categories: Schema$ClassificationCategory[]; - /** - * The overall sentiment for the document. Populated if the user enables - * AnnotateTextRequest.Features.extract_document_sentiment. - */ - documentSentiment: Schema$Sentiment; - /** - * Entities, along with their semantic information, in the input document. - * Populated if the user enables - * AnnotateTextRequest.Features.extract_entities. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. Populated if the user enables - * AnnotateTextRequest.Features.extract_syntax. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - * Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - */ - tokens: Schema$Token[]; -} -/** - * Represents a category returned from the text classifier. - */ -export interface Schema$ClassificationCategory { - /** - * The classifier's confidence of the category. Number represents how - * certain the classifier is that this category represents the given text. - */ - confidence: number; - /** - * The name of the category representing the document, from the [predefined - * taxonomy](/natural-language/docs/categories). - */ - name: string; -} -/** - * The document classification request message. - */ -export interface Schema$ClassifyTextRequest { - /** - * Input document. - */ - document: Schema$Document; -} -/** - * The document classification response message. - */ -export interface Schema$ClassifyTextResponse { - /** - * Categories representing the input document. - */ - categories: Schema$ClassificationCategory[]; -} -/** - * Represents dependency parse tree information for a token. (For more - * information on dependency labels, see - * http://www.aclweb.org/anthology/P13-2017 - */ -export interface Schema$DependencyEdge { - /** - * Represents the head of this token in the dependency tree. This is the index - * of the token which has an arc going to this token. The index is the - * position of the token in the array of tokens returned by the API method. If - * this token is a root token, then the `head_token_index` is its own index. - */ - headTokenIndex: number; - /** - * The parse label for the token. - */ - label: string; -} -/** - * ################################################################ # Represents - * the input to API methods. - */ -export interface Schema$Document { - /** - * The content of the input in string format. - */ - content: string; - /** - * The Google Cloud Storage URI where the file content is located. This URI - * must be of the form: gs://bucket_name/object_name. For more details, see - * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage - * object versioning is not supported. - */ - gcsContentUri: string; - /** - * The language of the document (if not specified, the language is - * automatically detected). Both ISO and BCP-47 language codes are - * accepted.<br> [Language Support](/natural-language/docs/languages) - * lists currently supported languages for each API method. If the language - * (either specified by the caller or automatically detected) is not supported - * by the called API method, an `INVALID_ARGUMENT` error is returned. - */ - language: string; - /** - * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an - * `INVALID_ARGUMENT` error. - */ - type: string; -} -/** - * Represents a phrase in the text that is a known entity, such as a person, an - * organization, or location. The API associates information, such as salience - * and mentions, with entities. - */ -export interface Schema$Entity { - /** - * The mentions of this entity in the input document. The API currently - * supports proper noun mentions. - */ - mentions: Schema$EntityMention[]; - /** - * Metadata associated with the entity. Currently, Wikipedia URLs and - * Knowledge Graph MIDs are provided, if available. The associated keys are - * "wikipedia_url" and "mid", respectively. - */ - metadata: any; - /** - * The representative name for the entity. - */ - name: string; - /** - * The salience score associated with the entity in the [0, 1.0] range. The - * salience score for an entity provides information about the importance or - * centrality of that entity to the entire document text. Scores closer to 0 - * are less salient, while scores closer to 1.0 are highly salient. - */ - salience: number; - /** - * For calls to AnalyzeEntitySentiment or if - * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - * field will contain the aggregate sentiment expressed for this entity in the - * provided document. - */ - sentiment: Schema$Sentiment; - /** - * The entity type. - */ - type: string; -} -/** - * Represents a mention for an entity in the text. Currently, proper noun - * mentions are supported. - */ -export interface Schema$EntityMention { - /** - * For calls to AnalyzeEntitySentiment or if - * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - * field will contain the sentiment expressed for this mention of the entity - * in the provided document. - */ - sentiment: Schema$Sentiment; /** - * The mention text. - */ - text: Schema$TextSpan; - /** - * The type of the entity mention. - */ - type: string; -} -/** - * All available features for sentiment, syntax, and semantic analysis. Setting - * each one to true will enable that specific analysis for the input. - */ -export interface Schema$Features { - /** - * Classify the full document into categories. - */ - classifyText: boolean; - /** - * Extract document-level sentiment. - */ - extractDocumentSentiment: boolean; - /** - * Extract entities. - */ - extractEntities: boolean; - /** - * Extract entities and their associated sentiment. - */ - extractEntitySentiment: boolean; - /** - * Extract syntax information. - */ - extractSyntax: boolean; -} -/** - * Represents part of speech information for a token. Parts of speech are as - * defined in http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf - */ -export interface Schema$PartOfSpeech { - /** - * The grammatical aspect. - */ - aspect: string; - /** - * The grammatical case. - */ - case: string; - /** - * The grammatical form. - */ - form: string; + * The entity analysis request message. + */ + export interface Schema$AnalyzeEntitiesRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The grammatical gender. - */ - gender: string; + * The entity analysis response message. + */ + export interface Schema$AnalyzeEntitiesResponse { + /** + * The recognized entities in the input document. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + } /** - * The grammatical mood. - */ - mood: string; + * The entity-level sentiment analysis request message. + */ + export interface Schema$AnalyzeEntitySentimentRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The grammatical number. - */ - number: string; + * The entity-level sentiment analysis response message. + */ + export interface Schema$AnalyzeEntitySentimentResponse { + /** + * The recognized entities in the input document with associated sentiments. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + } /** - * The grammatical person. - */ - person: string; + * The sentiment analysis request message. + */ + export interface Schema$AnalyzeSentimentRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate sentence offsets. + */ + encodingType: string; + } /** - * The grammatical properness. - */ - proper: string; + * The sentiment analysis response message. + */ + export interface Schema$AnalyzeSentimentResponse { + /** + * The overall sentiment of the input document. + */ + documentSentiment: Schema$Sentiment; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * The sentiment for all the sentences in the document. + */ + sentences: Schema$Sentence[]; + } /** - * The grammatical reciprocity. - */ - reciprocity: string; + * The syntax analysis request message. + */ + export interface Schema$AnalyzeSyntaxRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The part of speech tag. - */ - tag: string; + * The syntax analysis response message. + */ + export interface Schema$AnalyzeSyntaxResponse { + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + */ + tokens: Schema$Token[]; + } /** - * The grammatical tense. - */ - tense: string; + * The request message for the text annotation API, which can perform multiple + * analysis types (sentiment, entities, and syntax) in one call. + */ + export interface Schema$AnnotateTextRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + /** + * The enabled features. + */ + features: Schema$Features; + } /** - * The grammatical voice. - */ - voice: string; -} -/** - * Represents a sentence in the input document. - */ -export interface Schema$Sentence { + * The text annotations response message. + */ + export interface Schema$AnnotateTextResponse { + /** + * Categories identified in the input document. + */ + categories: Schema$ClassificationCategory[]; + /** + * The overall sentiment for the document. Populated if the user enables + * AnnotateTextRequest.Features.extract_document_sentiment. + */ + documentSentiment: Schema$Sentiment; + /** + * Entities, along with their semantic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_entities. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + tokens: Schema$Token[]; + } /** - * For calls to AnalyzeSentiment or if - * AnnotateTextRequest.Features.extract_document_sentiment is set to true, - * this field will contain the sentiment for the sentence. - */ - sentiment: Schema$Sentiment; + * Represents a category returned from the text classifier. + */ + export interface Schema$ClassificationCategory { + /** + * The classifier's confidence of the category. Number represents how + * certain the classifier is that this category represents the given text. + */ + confidence: number; + /** + * The name of the category representing the document, from the [predefined + * taxonomy](/natural-language/docs/categories). + */ + name: string; + } /** - * The sentence text. + * The document classification request message. */ - text: Schema$TextSpan; -} -/** - * Represents the feeling associated with the entire text or entities in the - * text. - */ -export interface Schema$Sentiment { + export interface Schema$ClassifyTextRequest { + /** + * Input document. + */ + document: Schema$Document; + } /** - * A non-negative number in the [0, +inf) range, which represents the absolute - * magnitude of sentiment regardless of score (positive or negative). + * The document classification response message. */ - magnitude: number; + export interface Schema$ClassifyTextResponse { + /** + * Categories representing the input document. + */ + categories: Schema$ClassificationCategory[]; + } /** - * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - * sentiment). - */ - score: number; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Represents dependency parse tree information for a token. (For more + * information on dependency labels, see + * http://www.aclweb.org/anthology/P13-2017 + */ + export interface Schema$DependencyEdge { + /** + * Represents the head of this token in the dependency tree. This is the + * index of the token which has an arc going to this token. The index is the + * position of the token in the array of tokens returned by the API method. + * If this token is a root token, then the `head_token_index` is its own + * index. + */ + headTokenIndex: number; + /** + * The parse label for the token. + */ + label: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * ################################################################ # + * Represents the input to API methods. + */ + export interface Schema$Document { + /** + * The content of the input in string format. + */ + content: string; + /** + * The Google Cloud Storage URI where the file content is located. This URI + * must be of the form: gs://bucket_name/object_name. For more details, see + * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage + * object versioning is not supported. + */ + gcsContentUri: string; + /** + * The language of the document (if not specified, the language is + * automatically detected). Both ISO and BCP-47 language codes are + * accepted.<br> [Language Support](/natural-language/docs/languages) + * lists currently supported languages for each API method. If the language + * (either specified by the caller or automatically detected) is not + * supported by the called API method, an `INVALID_ARGUMENT` error is + * returned. + */ + language: string; + /** + * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an + * `INVALID_ARGUMENT` error. + */ + type: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Represents a phrase in the text that is a known entity, such as a person, + * an organization, or location. The API associates information, such as + * salience and mentions, with entities. + */ + export interface Schema$Entity { + /** + * The mentions of this entity in the input document. The API currently + * supports proper noun mentions. + */ + mentions: Schema$EntityMention[]; + /** + * Metadata associated with the entity. Currently, Wikipedia URLs and + * Knowledge Graph MIDs are provided, if available. The associated keys are + * "wikipedia_url" and "mid", respectively. + */ + metadata: any; + /** + * The representative name for the entity. + */ + name: string; + /** + * The salience score associated with the entity in the [0, 1.0] range. The + * salience score for an entity provides information about the importance or + * centrality of that entity to the entire document text. Scores closer to 0 + * are less salient, while scores closer to 1.0 are highly salient. + */ + salience: number; + /** + * For calls to AnalyzeEntitySentiment or if + * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + * this field will contain the aggregate sentiment expressed for this entity + * in the provided document. + */ + sentiment: Schema$Sentiment; + /** + * The entity type. + */ + type: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents an output piece of text. - */ -export interface Schema$TextSpan { + * Represents a mention for an entity in the text. Currently, proper noun + * mentions are supported. + */ + export interface Schema$EntityMention { + /** + * For calls to AnalyzeEntitySentiment or if + * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + * this field will contain the sentiment expressed for this mention of the + * entity in the provided document. + */ + sentiment: Schema$Sentiment; + /** + * The mention text. + */ + text: Schema$TextSpan; + /** + * The type of the entity mention. + */ + type: string; + } /** - * The API calculates the beginning offset of the content in the original - * document according to the EncodingType specified in the API request. - */ - beginOffset: number; + * All available features for sentiment, syntax, and semantic analysis. + * Setting each one to true will enable that specific analysis for the input. + */ + export interface Schema$Features { + /** + * Classify the full document into categories. + */ + classifyText: boolean; + /** + * Extract document-level sentiment. + */ + extractDocumentSentiment: boolean; + /** + * Extract entities. + */ + extractEntities: boolean; + /** + * Extract entities and their associated sentiment. + */ + extractEntitySentiment: boolean; + /** + * Extract syntax information. + */ + extractSyntax: boolean; + } /** - * The content of the output text. - */ - content: string; -} -/** - * Represents the smallest syntactic building block of the text. - */ -export interface Schema$Token { + * Represents part of speech information for a token. Parts of speech are as + * defined in http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf + */ + export interface Schema$PartOfSpeech { + /** + * The grammatical aspect. + */ + aspect: string; + /** + * The grammatical case. + */ + case: string; + /** + * The grammatical form. + */ + form: string; + /** + * The grammatical gender. + */ + gender: string; + /** + * The grammatical mood. + */ + mood: string; + /** + * The grammatical number. + */ + number: string; + /** + * The grammatical person. + */ + person: string; + /** + * The grammatical properness. + */ + proper: string; + /** + * The grammatical reciprocity. + */ + reciprocity: string; + /** + * The part of speech tag. + */ + tag: string; + /** + * The grammatical tense. + */ + tense: string; + /** + * The grammatical voice. + */ + voice: string; + } /** - * Dependency tree parse for this token. - */ - dependencyEdge: Schema$DependencyEdge; + * Represents a sentence in the input document. + */ + export interface Schema$Sentence { + /** + * For calls to AnalyzeSentiment or if + * AnnotateTextRequest.Features.extract_document_sentiment is set to true, + * this field will contain the sentiment for the sentence. + */ + sentiment: Schema$Sentiment; + /** + * The sentence text. + */ + text: Schema$TextSpan; + } /** - * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. - */ - lemma: string; + * Represents the feeling associated with the entire text or entities in the + * text. + */ + export interface Schema$Sentiment { + /** + * A non-negative number in the [0, +inf) range, which represents the + * absolute magnitude of sentiment regardless of score (positive or + * negative). + */ + magnitude: number; + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + */ + score: number; + } /** - * Parts of speech tag for this token. - */ - partOfSpeech: Schema$PartOfSpeech; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The token text. - */ - text: Schema$TextSpan; -} - -export class Resource$Documents { - root: Language; - constructor(root: Language) { - this.root = root; - this.getRoot.bind(this); + * Represents an output piece of text. + */ + export interface Schema$TextSpan { + /** + * The API calculates the beginning offset of the content in the original + * document according to the EncodingType specified in the API request. + */ + beginOffset: number; + /** + * The content of the output text. + */ + content: string; } - - getRoot() { - return this.root; + /** + * Represents the smallest syntactic building block of the text. + */ + export interface Schema$Token { + /** + * Dependency tree parse for this token. + */ + dependencyEdge: Schema$DependencyEdge; + /** + * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the + * token. + */ + lemma: string; + /** + * Parts of speech tag for this token. + */ + partOfSpeech: Schema$PartOfSpeech; + /** + * The token text. + */ + text: Schema$TextSpan; } - - /** - * language.documents.analyzeEntities - * @desc Finds named entities (currently proper names and common nouns) in the - * text along with entity types, salience, mentions for each entity, and other - * properties. - * @alias language.documents.analyzeEntities - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeEntities(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Documents { + root: Language; + constructor(root: Language) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:analyzeEntities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * language.documents.analyzeEntitySentiment - * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes - * sentiment associated with each entity and its mentions. - * @alias language.documents.analyzeEntitySentiment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeEntitySentimentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeEntitySentiment(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeEntitySentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - analyzeEntitySentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:analyzeEntitySentiment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * language.documents.analyzeEntities + * @desc Finds named entities (currently proper names and common nouns) in + * the text along with entity types, salience, mentions for each entity, and + * other properties. + * @alias language.documents.analyzeEntities + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeEntities(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:analyzeEntities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * language.documents.analyzeSentiment - * @desc Analyzes the sentiment of the provided text. - * @alias language.documents.analyzeSentiment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSentimentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSentiment(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * language.documents.analyzeEntitySentiment + * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes + * sentiment associated with each entity and its mentions. + * @alias language.documents.analyzeEntitySentiment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeEntitySentimentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeEntitySentiment(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeEntitySentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + analyzeEntitySentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:analyzeEntitySentiment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:analyzeSentiment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.analyzeSyntax - * @desc Analyzes the syntax of the text and provides sentence boundaries and - * tokenization along with part of speech tags, dependency trees, and other - * properties. - * @alias language.documents.analyzeSyntax - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSyntaxRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSyntax(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.analyzeSentiment + * @desc Analyzes the sentiment of the provided text. + * @alias language.documents.analyzeSentiment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSentimentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSentiment(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:analyzeSentiment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:analyzeSyntax') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.annotateText - * @desc A convenience method that provides all the features that - * analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. - * @alias language.documents.annotateText - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnnotateTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotateText(params?: any, options?: MethodOptions): - AxiosPromise; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.analyzeSyntax + * @desc Analyzes the syntax of the text and provides sentence boundaries + * and tokenization along with part of speech tags, dependency trees, and + * other properties. + * @alias language.documents.analyzeSyntax + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSyntaxRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSyntax(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:analyzeSyntax') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:annotateText') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.classifyText - * @desc Classifies a document into categories. - * @alias language.documents.classifyText - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ClassifyTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - classifyText(params?: any, options?: MethodOptions): - AxiosPromise; - classifyText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - classifyText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.annotateText + * @desc A convenience method that provides all the features that + * analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. + * @alias language.documents.annotateText + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnnotateTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotateText(params?: any, options?: MethodOptions): + AxiosPromise; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:annotateText') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/documents:classifyText') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * language.documents.classifyText + * @desc Classifies a document into categories. + * @alias language.documents.classifyText + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ClassifyTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + classifyText(params?: any, options?: MethodOptions): + AxiosPromise; + classifyText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + classifyText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/documents:classifyText') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/language/v1beta1.ts b/src/apis/language/v1beta1.ts index d0823757026..798a3f403c1 100644 --- a/src/apis/language/v1beta1.ts +++ b/src/apis/language/v1beta1.ts @@ -27,712 +27,723 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Natural Language API - * - * Provides natural language understanding technologies to developers. Examples - * include sentiment analysis, entity recognition, entity sentiment analysis, - * and text annotations. - * - * @example - * const google = require('googleapis'); - * const language = google.language('v1beta1'); - * - * @namespace language - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Language - */ -export class Language { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace language_v1beta1 { + /** + * Cloud Natural Language API + * + * Provides natural language understanding technologies to developers. + * Examples include sentiment analysis, entity recognition, entity sentiment + * analysis, and text annotations. + * + * @example + * const google = require('googleapis'); + * const language = google.language('v1beta1'); + * + * @namespace language + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Language + */ + export class Language { + _options: GlobalOptions; + google: GoogleApis; + root = this; - documents: Resource$Documents; + documents: Resource$Documents; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.documents = new Resource$Documents(this); - } + this.documents = new Resource$Documents(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The entity analysis request message. - */ -export interface Schema$AnalyzeEntitiesRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The entity analysis response message. - */ -export interface Schema$AnalyzeEntitiesResponse { - /** - * The recognized entities in the input document. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; -} -/** - * The sentiment analysis request message. - */ -export interface Schema$AnalyzeSentimentRequest { /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate sentence offsets for the - * sentence sentiment. - */ - encodingType: string; -} -/** - * The sentiment analysis response message. - */ -export interface Schema$AnalyzeSentimentResponse { - /** - * The overall sentiment of the input document. - */ - documentSentiment: Schema$Sentiment; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * The sentiment for all the sentences in the document. - */ - sentences: Schema$Sentence[]; -} -/** - * The syntax analysis request message. - */ -export interface Schema$AnalyzeSyntaxRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The syntax analysis response message. - */ -export interface Schema$AnalyzeSyntaxResponse { - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - */ - tokens: Schema$Token[]; -} -/** - * The request message for the text annotation API, which can perform multiple - * analysis types (sentiment, entities, and syntax) in one call. - */ -export interface Schema$AnnotateTextRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; - /** - * The enabled features. - */ - features: Schema$Features; -} -/** - * The text annotations response message. - */ -export interface Schema$AnnotateTextResponse { - /** - * The overall sentiment for the document. Populated if the user enables - * AnnotateTextRequest.Features.extract_document_sentiment. - */ - documentSentiment: Schema$Sentiment; - /** - * Entities, along with their semantic information, in the input document. - * Populated if the user enables - * AnnotateTextRequest.Features.extract_entities. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. Populated if the user enables - * AnnotateTextRequest.Features.extract_syntax. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - * Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - */ - tokens: Schema$Token[]; -} -/** - * Represents dependency parse tree information for a token. - */ -export interface Schema$DependencyEdge { - /** - * Represents the head of this token in the dependency tree. This is the index - * of the token which has an arc going to this token. The index is the - * position of the token in the array of tokens returned by the API method. If - * this token is a root token, then the `head_token_index` is its own index. - */ - headTokenIndex: number; - /** - * The parse label for the token. - */ - label: string; -} -/** - * ################################################################ # Represents - * the input to API methods. - */ -export interface Schema$Document { - /** - * The content of the input in string format. - */ - content: string; - /** - * The Google Cloud Storage URI where the file content is located. This URI - * must be of the form: gs://bucket_name/object_name. For more details, see - * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage - * object versioning is not supported. - */ - gcsContentUri: string; - /** - * The language of the document (if not specified, the language is - * automatically detected). Both ISO and BCP-47 language codes are - * accepted.<br> [Language Support](/natural-language/docs/languages) - * lists currently supported languages for each API method. If the language - * (either specified by the caller or automatically detected) is not supported - * by the called API method, an `INVALID_ARGUMENT` error is returned. - */ - language: string; - /** - * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an - * `INVALID_ARGUMENT` error. - */ - type: string; -} -/** - * Represents a phrase in the text that is a known entity, such as a person, an - * organization, or location. The API associates information, such as salience - * and mentions, with entities. - */ -export interface Schema$Entity { - /** - * The mentions of this entity in the input document. The API currently - * supports proper noun mentions. - */ - mentions: Schema$EntityMention[]; - /** - * Metadata associated with the entity. Currently, Wikipedia URLs and - * Knowledge Graph MIDs are provided, if available. The associated keys are - * "wikipedia_url" and "mid", respectively. - */ - metadata: any; - /** - * The representative name for the entity. - */ - name: string; - /** - * The salience score associated with the entity in the [0, 1.0] range. The - * salience score for an entity provides information about the importance or - * centrality of that entity to the entire document text. Scores closer to 0 - * are less salient, while scores closer to 1.0 are highly salient. - */ - salience: number; - /** - * The entity type. - */ - type: string; -} -/** - * Represents a mention for an entity in the text. Currently, proper noun - * mentions are supported. - */ -export interface Schema$EntityMention { - /** - * The mention text. - */ - text: Schema$TextSpan; - /** - * The type of the entity mention. - */ - type: string; -} -/** - * All available features for sentiment, syntax, and semantic analysis. Setting - * each one to true will enable that specific analysis for the input. - */ -export interface Schema$Features { - /** - * Extract document-level sentiment. - */ - extractDocumentSentiment: boolean; - /** - * Extract entities. - */ - extractEntities: boolean; - /** - * Extract syntax information. - */ - extractSyntax: boolean; -} -/** - * Represents part of speech information for a token. - */ -export interface Schema$PartOfSpeech { - /** - * The grammatical aspect. - */ - aspect: string; - /** - * The grammatical case. - */ - case: string; - /** - * The grammatical form. - */ - form: string; - /** - * The grammatical gender. - */ - gender: string; - /** - * The grammatical mood. - */ - mood: string; - /** - * The grammatical number. - */ - number: string; - /** - * The grammatical person. - */ - person: string; - /** - * The grammatical properness. - */ - proper: string; - /** - * The grammatical reciprocity. - */ - reciprocity: string; + * The entity analysis request message. + */ + export interface Schema$AnalyzeEntitiesRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The part of speech tag. - */ - tag: string; + * The entity analysis response message. + */ + export interface Schema$AnalyzeEntitiesResponse { + /** + * The recognized entities in the input document. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + } /** - * The grammatical tense. - */ - tense: string; + * The sentiment analysis request message. + */ + export interface Schema$AnalyzeSentimentRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate sentence offsets for the + * sentence sentiment. + */ + encodingType: string; + } /** - * The grammatical voice. - */ - voice: string; -} -/** - * Represents a sentence in the input document. - */ -export interface Schema$Sentence { + * The sentiment analysis response message. + */ + export interface Schema$AnalyzeSentimentResponse { + /** + * The overall sentiment of the input document. + */ + documentSentiment: Schema$Sentiment; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * The sentiment for all the sentences in the document. + */ + sentences: Schema$Sentence[]; + } /** - * For calls to AnalyzeSentiment or if - * AnnotateTextRequest.Features.extract_document_sentiment is set to true, - * this field will contain the sentiment for the sentence. - */ - sentiment: Schema$Sentiment; + * The syntax analysis request message. + */ + export interface Schema$AnalyzeSyntaxRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The sentence text. - */ - text: Schema$TextSpan; -} -/** - * Represents the feeling associated with the entire text or entities in the - * text. - */ -export interface Schema$Sentiment { + * The syntax analysis response message. + */ + export interface Schema$AnalyzeSyntaxResponse { + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + */ + tokens: Schema$Token[]; + } /** - * A non-negative number in the [0, +inf) range, which represents the absolute - * magnitude of sentiment regardless of score (positive or negative). - */ - magnitude: number; + * The request message for the text annotation API, which can perform multiple + * analysis types (sentiment, entities, and syntax) in one call. + */ + export interface Schema$AnnotateTextRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + /** + * The enabled features. + */ + features: Schema$Features; + } /** - * DEPRECATED FIELD - This field is being deprecated in favor of score. Please - * refer to our documentation at - * https://cloud.google.com/natural-language/docs for more information. - */ - polarity: number; + * The text annotations response message. + */ + export interface Schema$AnnotateTextResponse { + /** + * The overall sentiment for the document. Populated if the user enables + * AnnotateTextRequest.Features.extract_document_sentiment. + */ + documentSentiment: Schema$Sentiment; + /** + * Entities, along with their semantic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_entities. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + tokens: Schema$Token[]; + } /** - * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - * sentiment). - */ - score: number; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Represents dependency parse tree information for a token. + */ + export interface Schema$DependencyEdge { + /** + * Represents the head of this token in the dependency tree. This is the + * index of the token which has an arc going to this token. The index is the + * position of the token in the array of tokens returned by the API method. + * If this token is a root token, then the `head_token_index` is its own + * index. + */ + headTokenIndex: number; + /** + * The parse label for the token. + */ + label: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * ################################################################ # + * Represents the input to API methods. + */ + export interface Schema$Document { + /** + * The content of the input in string format. + */ + content: string; + /** + * The Google Cloud Storage URI where the file content is located. This URI + * must be of the form: gs://bucket_name/object_name. For more details, see + * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage + * object versioning is not supported. + */ + gcsContentUri: string; + /** + * The language of the document (if not specified, the language is + * automatically detected). Both ISO and BCP-47 language codes are + * accepted.<br> [Language Support](/natural-language/docs/languages) + * lists currently supported languages for each API method. If the language + * (either specified by the caller or automatically detected) is not + * supported by the called API method, an `INVALID_ARGUMENT` error is + * returned. + */ + language: string; + /** + * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an + * `INVALID_ARGUMENT` error. + */ + type: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Represents a phrase in the text that is a known entity, such as a person, + * an organization, or location. The API associates information, such as + * salience and mentions, with entities. + */ + export interface Schema$Entity { + /** + * The mentions of this entity in the input document. The API currently + * supports proper noun mentions. + */ + mentions: Schema$EntityMention[]; + /** + * Metadata associated with the entity. Currently, Wikipedia URLs and + * Knowledge Graph MIDs are provided, if available. The associated keys are + * "wikipedia_url" and "mid", respectively. + */ + metadata: any; + /** + * The representative name for the entity. + */ + name: string; + /** + * The salience score associated with the entity in the [0, 1.0] range. The + * salience score for an entity provides information about the importance or + * centrality of that entity to the entire document text. Scores closer to 0 + * are less salient, while scores closer to 1.0 are highly salient. + */ + salience: number; + /** + * The entity type. + */ + type: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents an output piece of text. - */ -export interface Schema$TextSpan { + * Represents a mention for an entity in the text. Currently, proper noun + * mentions are supported. + */ + export interface Schema$EntityMention { + /** + * The mention text. + */ + text: Schema$TextSpan; + /** + * The type of the entity mention. + */ + type: string; + } /** - * The API calculates the beginning offset of the content in the original - * document according to the EncodingType specified in the API request. - */ - beginOffset: number; + * All available features for sentiment, syntax, and semantic analysis. + * Setting each one to true will enable that specific analysis for the input. + */ + export interface Schema$Features { + /** + * Extract document-level sentiment. + */ + extractDocumentSentiment: boolean; + /** + * Extract entities. + */ + extractEntities: boolean; + /** + * Extract syntax information. + */ + extractSyntax: boolean; + } /** - * The content of the output text. - */ - content: string; -} -/** - * Represents the smallest syntactic building block of the text. - */ -export interface Schema$Token { + * Represents part of speech information for a token. + */ + export interface Schema$PartOfSpeech { + /** + * The grammatical aspect. + */ + aspect: string; + /** + * The grammatical case. + */ + case: string; + /** + * The grammatical form. + */ + form: string; + /** + * The grammatical gender. + */ + gender: string; + /** + * The grammatical mood. + */ + mood: string; + /** + * The grammatical number. + */ + number: string; + /** + * The grammatical person. + */ + person: string; + /** + * The grammatical properness. + */ + proper: string; + /** + * The grammatical reciprocity. + */ + reciprocity: string; + /** + * The part of speech tag. + */ + tag: string; + /** + * The grammatical tense. + */ + tense: string; + /** + * The grammatical voice. + */ + voice: string; + } /** - * Dependency tree parse for this token. - */ - dependencyEdge: Schema$DependencyEdge; + * Represents a sentence in the input document. + */ + export interface Schema$Sentence { + /** + * For calls to AnalyzeSentiment or if + * AnnotateTextRequest.Features.extract_document_sentiment is set to true, + * this field will contain the sentiment for the sentence. + */ + sentiment: Schema$Sentiment; + /** + * The sentence text. + */ + text: Schema$TextSpan; + } /** - * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. - */ - lemma: string; + * Represents the feeling associated with the entire text or entities in the + * text. + */ + export interface Schema$Sentiment { + /** + * A non-negative number in the [0, +inf) range, which represents the + * absolute magnitude of sentiment regardless of score (positive or + * negative). + */ + magnitude: number; + /** + * DEPRECATED FIELD - This field is being deprecated in favor of score. + * Please refer to our documentation at + * https://cloud.google.com/natural-language/docs for more information. + */ + polarity: number; + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + */ + score: number; + } /** - * Parts of speech tag for this token. - */ - partOfSpeech: Schema$PartOfSpeech; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The token text. - */ - text: Schema$TextSpan; -} - -export class Resource$Documents { - root: Language; - constructor(root: Language) { - this.root = root; - this.getRoot.bind(this); + * Represents an output piece of text. + */ + export interface Schema$TextSpan { + /** + * The API calculates the beginning offset of the content in the original + * document according to the EncodingType specified in the API request. + */ + beginOffset: number; + /** + * The content of the output text. + */ + content: string; } - - getRoot() { - return this.root; + /** + * Represents the smallest syntactic building block of the text. + */ + export interface Schema$Token { + /** + * Dependency tree parse for this token. + */ + dependencyEdge: Schema$DependencyEdge; + /** + * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the + * token. + */ + lemma: string; + /** + * Parts of speech tag for this token. + */ + partOfSpeech: Schema$PartOfSpeech; + /** + * The token text. + */ + text: Schema$TextSpan; } - - /** - * language.documents.analyzeEntities - * @desc Finds named entities (currently proper names and common nouns) in the - * text along with entity types, salience, mentions for each entity, and other - * properties. - * @alias language.documents.analyzeEntities - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeEntities(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Documents { + root: Language; + constructor(root: Language) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/documents:analyzeEntities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * language.documents.analyzeSentiment - * @desc Analyzes the sentiment of the provided text. - * @alias language.documents.analyzeSentiment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSentimentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSentiment(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.analyzeEntities + * @desc Finds named entities (currently proper names and common nouns) in + * the text along with entity types, salience, mentions for each entity, and + * other properties. + * @alias language.documents.analyzeEntities + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeEntities(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/documents:analyzeEntities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/documents:analyzeSentiment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.analyzeSyntax - * @desc Analyzes the syntax of the text and provides sentence boundaries and - * tokenization along with part of speech tags, dependency trees, and other - * properties. - * @alias language.documents.analyzeSyntax - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSyntaxRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSyntax(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/documents:analyzeSyntax') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * language.documents.analyzeSentiment + * @desc Analyzes the sentiment of the provided text. + * @alias language.documents.analyzeSentiment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSentimentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSentiment(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/documents:analyzeSentiment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * language.documents.annotateText - * @desc A convenience method that provides all the features that - * analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. - * @alias language.documents.annotateText - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnnotateTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotateText(params?: any, options?: MethodOptions): - AxiosPromise; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * language.documents.analyzeSyntax + * @desc Analyzes the syntax of the text and provides sentence boundaries + * and tokenization along with part of speech tags, dependency trees, and + * other properties. + * @alias language.documents.analyzeSyntax + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSyntaxRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSyntax(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/documents:analyzeSyntax') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/documents:annotateText') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * language.documents.annotateText + * @desc A convenience method that provides all the features that + * analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call. + * @alias language.documents.annotateText + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnnotateTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotateText(params?: any, options?: MethodOptions): + AxiosPromise; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/documents:annotateText') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/language/v1beta2.ts b/src/apis/language/v1beta2.ts index c5fe12c4452..614fbb4dcd7 100644 --- a/src/apis/language/v1beta2.ts +++ b/src/apis/language/v1beta2.ts @@ -27,909 +27,922 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Natural Language API - * - * Provides natural language understanding technologies to developers. Examples - * include sentiment analysis, entity recognition, entity sentiment analysis, - * and text annotations. - * - * @example - * const google = require('googleapis'); - * const language = google.language('v1beta2'); - * - * @namespace language - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Language - */ -export class Language { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace language_v1beta2 { + /** + * Cloud Natural Language API + * + * Provides natural language understanding technologies to developers. + * Examples include sentiment analysis, entity recognition, entity sentiment + * analysis, and text annotations. + * + * @example + * const google = require('googleapis'); + * const language = google.language('v1beta2'); + * + * @namespace language + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Language + */ + export class Language { + _options: GlobalOptions; + google: GoogleApis; + root = this; - documents: Resource$Documents; + documents: Resource$Documents; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.documents = new Resource$Documents(this); - } + this.documents = new Resource$Documents(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The entity analysis request message. - */ -export interface Schema$AnalyzeEntitiesRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The entity analysis response message. - */ -export interface Schema$AnalyzeEntitiesResponse { - /** - * The recognized entities in the input document. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; -} -/** - * The entity-level sentiment analysis request message. - */ -export interface Schema$AnalyzeEntitySentimentRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The entity-level sentiment analysis response message. - */ -export interface Schema$AnalyzeEntitySentimentResponse { - /** - * The recognized entities in the input document with associated sentiments. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; -} -/** - * The sentiment analysis request message. - */ -export interface Schema$AnalyzeSentimentRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate sentence offsets for the - * sentence sentiment. - */ - encodingType: string; -} -/** - * The sentiment analysis response message. - */ -export interface Schema$AnalyzeSentimentResponse { - /** - * The overall sentiment of the input document. - */ - documentSentiment: Schema$Sentiment; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * The sentiment for all the sentences in the document. - */ - sentences: Schema$Sentence[]; -} -/** - * The syntax analysis request message. - */ -export interface Schema$AnalyzeSyntaxRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; -} -/** - * The syntax analysis response message. - */ -export interface Schema$AnalyzeSyntaxResponse { - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - */ - tokens: Schema$Token[]; -} -/** - * The request message for the text annotation API, which can perform multiple - * analysis types (sentiment, entities, and syntax) in one call. - */ -export interface Schema$AnnotateTextRequest { - /** - * Input document. - */ - document: Schema$Document; - /** - * The encoding type used by the API to calculate offsets. - */ - encodingType: string; - /** - * The enabled features. - */ - features: Schema$Features; -} -/** - * The text annotations response message. - */ -export interface Schema$AnnotateTextResponse { - /** - * Categories identified in the input document. - */ - categories: Schema$ClassificationCategory[]; - /** - * The overall sentiment for the document. Populated if the user enables - * AnnotateTextRequest.Features.extract_document_sentiment. - */ - documentSentiment: Schema$Sentiment; - /** - * Entities, along with their semantic information, in the input document. - * Populated if the user enables - * AnnotateTextRequest.Features.extract_entities. - */ - entities: Schema$Entity[]; - /** - * The language of the text, which will be the same as the language specified - * in the request or, if not specified, the automatically-detected language. - * See Document.language field for more details. - */ - language: string; - /** - * Sentences in the input document. Populated if the user enables - * AnnotateTextRequest.Features.extract_syntax. - */ - sentences: Schema$Sentence[]; - /** - * Tokens, along with their syntactic information, in the input document. - * Populated if the user enables AnnotateTextRequest.Features.extract_syntax. - */ - tokens: Schema$Token[]; -} -/** - * Represents a category returned from the text classifier. - */ -export interface Schema$ClassificationCategory { - /** - * The classifier's confidence of the category. Number represents how - * certain the classifier is that this category represents the given text. - */ - confidence: number; - /** - * The name of the category representing the document, from the [predefined - * taxonomy](/natural-language/docs/categories). - */ - name: string; -} -/** - * The document classification request message. - */ -export interface Schema$ClassifyTextRequest { - /** - * Input document. - */ - document: Schema$Document; -} -/** - * The document classification response message. - */ -export interface Schema$ClassifyTextResponse { - /** - * Categories representing the input document. - */ - categories: Schema$ClassificationCategory[]; -} -/** - * Represents dependency parse tree information for a token. - */ -export interface Schema$DependencyEdge { - /** - * Represents the head of this token in the dependency tree. This is the index - * of the token which has an arc going to this token. The index is the - * position of the token in the array of tokens returned by the API method. If - * this token is a root token, then the `head_token_index` is its own index. - */ - headTokenIndex: number; - /** - * The parse label for the token. - */ - label: string; -} -/** - * ################################################################ # Represents - * the input to API methods. - */ -export interface Schema$Document { - /** - * The content of the input in string format. - */ - content: string; - /** - * The Google Cloud Storage URI where the file content is located. This URI - * must be of the form: gs://bucket_name/object_name. For more details, see - * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage - * object versioning is not supported. - */ - gcsContentUri: string; - /** - * The language of the document (if not specified, the language is - * automatically detected). Both ISO and BCP-47 language codes are - * accepted.<br> [Language Support](/natural-language/docs/languages) - * lists currently supported languages for each API method. If the language - * (either specified by the caller or automatically detected) is not supported - * by the called API method, an `INVALID_ARGUMENT` error is returned. - */ - language: string; - /** - * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an - * `INVALID_ARGUMENT` error. - */ - type: string; -} -/** - * Represents a phrase in the text that is a known entity, such as a person, an - * organization, or location. The API associates information, such as salience - * and mentions, with entities. - */ -export interface Schema$Entity { - /** - * The mentions of this entity in the input document. The API currently - * supports proper noun mentions. - */ - mentions: Schema$EntityMention[]; - /** - * Metadata associated with the entity. Currently, Wikipedia URLs and - * Knowledge Graph MIDs are provided, if available. The associated keys are - * "wikipedia_url" and "mid", respectively. - */ - metadata: any; - /** - * The representative name for the entity. - */ - name: string; - /** - * The salience score associated with the entity in the [0, 1.0] range. The - * salience score for an entity provides information about the importance or - * centrality of that entity to the entire document text. Scores closer to 0 - * are less salient, while scores closer to 1.0 are highly salient. - */ - salience: number; - /** - * For calls to AnalyzeEntitySentiment or if - * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - * field will contain the aggregate sentiment expressed for this entity in the - * provided document. - */ - sentiment: Schema$Sentiment; - /** - * The entity type. - */ - type: string; -} -/** - * Represents a mention for an entity in the text. Currently, proper noun - * mentions are supported. - */ -export interface Schema$EntityMention { - /** - * For calls to AnalyzeEntitySentiment or if - * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, this - * field will contain the sentiment expressed for this mention of the entity - * in the provided document. - */ - sentiment: Schema$Sentiment; /** - * The mention text. - */ - text: Schema$TextSpan; - /** - * The type of the entity mention. - */ - type: string; -} -/** - * All available features for sentiment, syntax, and semantic analysis. Setting - * each one to true will enable that specific analysis for the input. - */ -export interface Schema$Features { - /** - * Classify the full document into categories. If this is true, the API will - * use the default model which classifies into a [predefined - * taxonomy](/natural-language/docs/categories). - */ - classifyText: boolean; - /** - * Extract document-level sentiment. - */ - extractDocumentSentiment: boolean; - /** - * Extract entities. - */ - extractEntities: boolean; - /** - * Extract entities and their associated sentiment. - */ - extractEntitySentiment: boolean; - /** - * Extract syntax information. - */ - extractSyntax: boolean; -} -/** - * Represents part of speech information for a token. - */ -export interface Schema$PartOfSpeech { - /** - * The grammatical aspect. - */ - aspect: string; - /** - * The grammatical case. - */ - case: string; - /** - * The grammatical form. - */ - form: string; + * The entity analysis request message. + */ + export interface Schema$AnalyzeEntitiesRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The grammatical gender. - */ - gender: string; + * The entity analysis response message. + */ + export interface Schema$AnalyzeEntitiesResponse { + /** + * The recognized entities in the input document. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + } /** - * The grammatical mood. - */ - mood: string; + * The entity-level sentiment analysis request message. + */ + export interface Schema$AnalyzeEntitySentimentRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The grammatical number. - */ - number: string; + * The entity-level sentiment analysis response message. + */ + export interface Schema$AnalyzeEntitySentimentResponse { + /** + * The recognized entities in the input document with associated sentiments. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + } /** - * The grammatical person. - */ - person: string; + * The sentiment analysis request message. + */ + export interface Schema$AnalyzeSentimentRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate sentence offsets for the + * sentence sentiment. + */ + encodingType: string; + } /** - * The grammatical properness. - */ - proper: string; + * The sentiment analysis response message. + */ + export interface Schema$AnalyzeSentimentResponse { + /** + * The overall sentiment of the input document. + */ + documentSentiment: Schema$Sentiment; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * The sentiment for all the sentences in the document. + */ + sentences: Schema$Sentence[]; + } /** - * The grammatical reciprocity. - */ - reciprocity: string; + * The syntax analysis request message. + */ + export interface Schema$AnalyzeSyntaxRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + } /** - * The part of speech tag. - */ - tag: string; + * The syntax analysis response message. + */ + export interface Schema$AnalyzeSyntaxResponse { + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + */ + tokens: Schema$Token[]; + } /** - * The grammatical tense. - */ - tense: string; + * The request message for the text annotation API, which can perform multiple + * analysis types (sentiment, entities, and syntax) in one call. + */ + export interface Schema$AnnotateTextRequest { + /** + * Input document. + */ + document: Schema$Document; + /** + * The encoding type used by the API to calculate offsets. + */ + encodingType: string; + /** + * The enabled features. + */ + features: Schema$Features; + } /** - * The grammatical voice. - */ - voice: string; -} -/** - * Represents a sentence in the input document. - */ -export interface Schema$Sentence { + * The text annotations response message. + */ + export interface Schema$AnnotateTextResponse { + /** + * Categories identified in the input document. + */ + categories: Schema$ClassificationCategory[]; + /** + * The overall sentiment for the document. Populated if the user enables + * AnnotateTextRequest.Features.extract_document_sentiment. + */ + documentSentiment: Schema$Sentiment; + /** + * Entities, along with their semantic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_entities. + */ + entities: Schema$Entity[]; + /** + * The language of the text, which will be the same as the language + * specified in the request or, if not specified, the automatically-detected + * language. See Document.language field for more details. + */ + language: string; + /** + * Sentences in the input document. Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + sentences: Schema$Sentence[]; + /** + * Tokens, along with their syntactic information, in the input document. + * Populated if the user enables + * AnnotateTextRequest.Features.extract_syntax. + */ + tokens: Schema$Token[]; + } /** - * For calls to AnalyzeSentiment or if - * AnnotateTextRequest.Features.extract_document_sentiment is set to true, - * this field will contain the sentiment for the sentence. - */ - sentiment: Schema$Sentiment; + * Represents a category returned from the text classifier. + */ + export interface Schema$ClassificationCategory { + /** + * The classifier's confidence of the category. Number represents how + * certain the classifier is that this category represents the given text. + */ + confidence: number; + /** + * The name of the category representing the document, from the [predefined + * taxonomy](/natural-language/docs/categories). + */ + name: string; + } /** - * The sentence text. + * The document classification request message. */ - text: Schema$TextSpan; -} -/** - * Represents the feeling associated with the entire text or entities in the - * text. - */ -export interface Schema$Sentiment { + export interface Schema$ClassifyTextRequest { + /** + * Input document. + */ + document: Schema$Document; + } /** - * A non-negative number in the [0, +inf) range, which represents the absolute - * magnitude of sentiment regardless of score (positive or negative). + * The document classification response message. */ - magnitude: number; + export interface Schema$ClassifyTextResponse { + /** + * Categories representing the input document. + */ + categories: Schema$ClassificationCategory[]; + } /** - * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive - * sentiment). - */ - score: number; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Represents dependency parse tree information for a token. + */ + export interface Schema$DependencyEdge { + /** + * Represents the head of this token in the dependency tree. This is the + * index of the token which has an arc going to this token. The index is the + * position of the token in the array of tokens returned by the API method. + * If this token is a root token, then the `head_token_index` is its own + * index. + */ + headTokenIndex: number; + /** + * The parse label for the token. + */ + label: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * ################################################################ # + * Represents the input to API methods. + */ + export interface Schema$Document { + /** + * The content of the input in string format. + */ + content: string; + /** + * The Google Cloud Storage URI where the file content is located. This URI + * must be of the form: gs://bucket_name/object_name. For more details, see + * https://cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage + * object versioning is not supported. + */ + gcsContentUri: string; + /** + * The language of the document (if not specified, the language is + * automatically detected). Both ISO and BCP-47 language codes are + * accepted.<br> [Language Support](/natural-language/docs/languages) + * lists currently supported languages for each API method. If the language + * (either specified by the caller or automatically detected) is not + * supported by the called API method, an `INVALID_ARGUMENT` error is + * returned. + */ + language: string; + /** + * Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an + * `INVALID_ARGUMENT` error. + */ + type: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Represents a phrase in the text that is a known entity, such as a person, + * an organization, or location. The API associates information, such as + * salience and mentions, with entities. + */ + export interface Schema$Entity { + /** + * The mentions of this entity in the input document. The API currently + * supports proper noun mentions. + */ + mentions: Schema$EntityMention[]; + /** + * Metadata associated with the entity. Currently, Wikipedia URLs and + * Knowledge Graph MIDs are provided, if available. The associated keys are + * "wikipedia_url" and "mid", respectively. + */ + metadata: any; + /** + * The representative name for the entity. + */ + name: string; + /** + * The salience score associated with the entity in the [0, 1.0] range. The + * salience score for an entity provides information about the importance or + * centrality of that entity to the entire document text. Scores closer to 0 + * are less salient, while scores closer to 1.0 are highly salient. + */ + salience: number; + /** + * For calls to AnalyzeEntitySentiment or if + * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + * this field will contain the aggregate sentiment expressed for this entity + * in the provided document. + */ + sentiment: Schema$Sentiment; + /** + * The entity type. + */ + type: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents an output piece of text. - */ -export interface Schema$TextSpan { + * Represents a mention for an entity in the text. Currently, proper noun + * mentions are supported. + */ + export interface Schema$EntityMention { + /** + * For calls to AnalyzeEntitySentiment or if + * AnnotateTextRequest.Features.extract_entity_sentiment is set to true, + * this field will contain the sentiment expressed for this mention of the + * entity in the provided document. + */ + sentiment: Schema$Sentiment; + /** + * The mention text. + */ + text: Schema$TextSpan; + /** + * The type of the entity mention. + */ + type: string; + } /** - * The API calculates the beginning offset of the content in the original - * document according to the EncodingType specified in the API request. - */ - beginOffset: number; + * All available features for sentiment, syntax, and semantic analysis. + * Setting each one to true will enable that specific analysis for the input. + */ + export interface Schema$Features { + /** + * Classify the full document into categories. If this is true, the API will + * use the default model which classifies into a [predefined + * taxonomy](/natural-language/docs/categories). + */ + classifyText: boolean; + /** + * Extract document-level sentiment. + */ + extractDocumentSentiment: boolean; + /** + * Extract entities. + */ + extractEntities: boolean; + /** + * Extract entities and their associated sentiment. + */ + extractEntitySentiment: boolean; + /** + * Extract syntax information. + */ + extractSyntax: boolean; + } /** - * The content of the output text. - */ - content: string; -} -/** - * Represents the smallest syntactic building block of the text. - */ -export interface Schema$Token { + * Represents part of speech information for a token. + */ + export interface Schema$PartOfSpeech { + /** + * The grammatical aspect. + */ + aspect: string; + /** + * The grammatical case. + */ + case: string; + /** + * The grammatical form. + */ + form: string; + /** + * The grammatical gender. + */ + gender: string; + /** + * The grammatical mood. + */ + mood: string; + /** + * The grammatical number. + */ + number: string; + /** + * The grammatical person. + */ + person: string; + /** + * The grammatical properness. + */ + proper: string; + /** + * The grammatical reciprocity. + */ + reciprocity: string; + /** + * The part of speech tag. + */ + tag: string; + /** + * The grammatical tense. + */ + tense: string; + /** + * The grammatical voice. + */ + voice: string; + } /** - * Dependency tree parse for this token. - */ - dependencyEdge: Schema$DependencyEdge; + * Represents a sentence in the input document. + */ + export interface Schema$Sentence { + /** + * For calls to AnalyzeSentiment or if + * AnnotateTextRequest.Features.extract_document_sentiment is set to true, + * this field will contain the sentiment for the sentence. + */ + sentiment: Schema$Sentiment; + /** + * The sentence text. + */ + text: Schema$TextSpan; + } /** - * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token. - */ - lemma: string; + * Represents the feeling associated with the entire text or entities in the + * text. + */ + export interface Schema$Sentiment { + /** + * A non-negative number in the [0, +inf) range, which represents the + * absolute magnitude of sentiment regardless of score (positive or + * negative). + */ + magnitude: number; + /** + * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive + * sentiment). + */ + score: number; + } /** - * Parts of speech tag for this token. - */ - partOfSpeech: Schema$PartOfSpeech; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The token text. - */ - text: Schema$TextSpan; -} - -export class Resource$Documents { - root: Language; - constructor(root: Language) { - this.root = root; - this.getRoot.bind(this); + * Represents an output piece of text. + */ + export interface Schema$TextSpan { + /** + * The API calculates the beginning offset of the content in the original + * document according to the EncodingType specified in the API request. + */ + beginOffset: number; + /** + * The content of the output text. + */ + content: string; } - - getRoot() { - return this.root; + /** + * Represents the smallest syntactic building block of the text. + */ + export interface Schema$Token { + /** + * Dependency tree parse for this token. + */ + dependencyEdge: Schema$DependencyEdge; + /** + * [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the + * token. + */ + lemma: string; + /** + * Parts of speech tag for this token. + */ + partOfSpeech: Schema$PartOfSpeech; + /** + * The token text. + */ + text: Schema$TextSpan; } - - /** - * language.documents.analyzeEntities - * @desc Finds named entities (currently proper names and common nouns) in the - * text along with entity types, salience, mentions for each entity, and other - * properties. - * @alias language.documents.analyzeEntities - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeEntitiesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeEntities(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeEntities( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Documents { + root: Language; + constructor(root: Language) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:analyzeEntities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * language.documents.analyzeEntitySentiment - * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes - * sentiment associated with each entity and its mentions. - * @alias language.documents.analyzeEntitySentiment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeEntitySentimentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeEntitySentiment(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeEntitySentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - analyzeEntitySentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:analyzeEntitySentiment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * language.documents.analyzeEntities + * @desc Finds named entities (currently proper names and common nouns) in + * the text along with entity types, salience, mentions for each entity, and + * other properties. + * @alias language.documents.analyzeEntities + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeEntitiesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeEntities(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeEntities( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:analyzeEntities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * language.documents.analyzeSentiment - * @desc Analyzes the sentiment of the provided text. - * @alias language.documents.analyzeSentiment - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSentimentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSentiment(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSentiment( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * language.documents.analyzeEntitySentiment + * @desc Finds entities, similar to AnalyzeEntities in the text and analyzes + * sentiment associated with each entity and its mentions. + * @alias language.documents.analyzeEntitySentiment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeEntitySentimentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeEntitySentiment(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeEntitySentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + analyzeEntitySentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:analyzeEntitySentiment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:analyzeSentiment') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.analyzeSyntax - * @desc Analyzes the syntax of the text and provides sentence boundaries and - * tokenization along with part of speech tags, dependency trees, and other - * properties. - * @alias language.documents.analyzeSyntax - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnalyzeSyntaxRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyzeSyntax(params?: any, options?: MethodOptions): - AxiosPromise; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyzeSyntax( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.analyzeSentiment + * @desc Analyzes the sentiment of the provided text. + * @alias language.documents.analyzeSentiment + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSentimentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSentiment(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSentiment( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:analyzeSentiment') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:analyzeSyntax') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.annotateText - * @desc A convenience method that provides all syntax, sentiment, entity, and - * classification features in one call. - * @alias language.documents.annotateText - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AnnotateTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotateText(params?: any, options?: MethodOptions): - AxiosPromise; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - annotateText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.analyzeSyntax + * @desc Analyzes the syntax of the text and provides sentence boundaries + * and tokenization along with part of speech tags, dependency trees, and + * other properties. + * @alias language.documents.analyzeSyntax + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnalyzeSyntaxRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyzeSyntax(params?: any, options?: MethodOptions): + AxiosPromise; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyzeSyntax( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:analyzeSyntax') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:annotateText') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * language.documents.classifyText - * @desc Classifies a document into categories. - * @alias language.documents.classifyText - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ClassifyTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - classifyText(params?: any, options?: MethodOptions): - AxiosPromise; - classifyText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - classifyText( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * language.documents.annotateText + * @desc A convenience method that provides all syntax, sentiment, entity, + * and classification features in one call. + * @alias language.documents.annotateText + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AnnotateTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotateText(params?: any, options?: MethodOptions): + AxiosPromise; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + annotateText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:annotateText') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/documents:classifyText') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * language.documents.classifyText + * @desc Classifies a document into categories. + * @alias language.documents.classifyText + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ClassifyTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + classifyText(params?: any, options?: MethodOptions): + AxiosPromise; + classifyText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + classifyText( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://language.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/documents:classifyText') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/licensing/v1.ts b/src/apis/licensing/v1.ts index e8a50cb0ff5..1a2cc0d288d 100644 --- a/src/apis/licensing/v1.ts +++ b/src/apis/licensing/v1.ts @@ -27,524 +27,527 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Enterprise License Manager API - * - * Views and manages licenses for your domain. - * - * @example - * const google = require('googleapis'); - * const licensing = google.licensing('v1'); - * - * @namespace licensing - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Licensing - */ -export class Licensing { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace licensing_v1 { + /** + * Enterprise License Manager API + * + * Views and manages licenses for your domain. + * + * @example + * const google = require('googleapis'); + * const licensing = google.licensing('v1'); + * + * @namespace licensing + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Licensing + */ + export class Licensing { + _options: GlobalOptions; + google: GoogleApis; + root = this; - licenseAssignments: Resource$Licenseassignments; + licenseAssignments: Resource$Licenseassignments; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.licenseAssignments = new Resource$Licenseassignments(this); - } + this.licenseAssignments = new Resource$Licenseassignments(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Template for LiscenseAssignment Resource - */ -export interface Schema$LicenseAssignment { - /** - * ETag of the resource. - */ - etags: string; - /** - * Identifies the resource as a LicenseAssignment. - */ - kind: string; - /** - * Id of the product. - */ - productId: string; - /** - * Display Name of the product. - */ - productName: string; - /** - * Link to this page. - */ - selfLink: string; - /** - * Id of the sku of the product. - */ - skuId: string; - /** - * Display Name of the sku of the product. - */ - skuName: string; - /** - * Email id of the user. - */ - userId: string; -} -/** - * Template for LicenseAssignment Insert request - */ -export interface Schema$LicenseAssignmentInsert { /** - * Email id of the user + * Template for LiscenseAssignment Resource */ - userId: string; -} -/** - * LicesnseAssignment List for a given product/sku for a customer. - */ -export interface Schema$LicenseAssignmentList { - /** - * ETag of the resource. - */ - etag: string; - /** - * The LicenseAssignments in this page of results. - */ - items: Schema$LicenseAssignment[]; + export interface Schema$LicenseAssignment { + /** + * ETag of the resource. + */ + etags: string; + /** + * Identifies the resource as a LicenseAssignment. + */ + kind: string; + /** + * Id of the product. + */ + productId: string; + /** + * Display Name of the product. + */ + productName: string; + /** + * Link to this page. + */ + selfLink: string; + /** + * Id of the sku of the product. + */ + skuId: string; + /** + * Display Name of the sku of the product. + */ + skuName: string; + /** + * Email id of the user. + */ + userId: string; + } /** - * Identifies the resource as a collection of LicenseAssignments. + * Template for LicenseAssignment Insert request */ - kind: string; + export interface Schema$LicenseAssignmentInsert { + /** + * Email id of the user + */ + userId: string; + } /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. + * LicesnseAssignment List for a given product/sku for a customer. */ - nextPageToken: string; -} - -export class Resource$Licenseassignments { - root: Licensing; - constructor(root: Licensing) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$LicenseAssignmentList { + /** + * ETag of the resource. + */ + etag: string; + /** + * The LicenseAssignments in this page of results. + */ + items: Schema$LicenseAssignment[]; + /** + * Identifies the resource as a collection of LicenseAssignments. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - getRoot() { - return this.root; - } - - - /** - * licensing.licenseAssignments.delete - * @desc Revoke License. - * @alias licensing.licenseAssignments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku - * @param {string} params.userId email id or unique Id of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Licenseassignments { + root: Licensing; + constructor(root: Licensing) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['productId', 'skuId', 'userId'], - pathParams: ['productId', 'skuId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * licensing.licenseAssignments.get - * @desc Get license assignment of a particular product and sku for a user - * @alias licensing.licenseAssignments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku - * @param {string} params.userId email id or unique Id of the user - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * licensing.licenseAssignments.delete + * @desc Revoke License. + * @alias licensing.licenseAssignments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku + * @param {string} params.userId email id or unique Id of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['productId', 'skuId', 'userId'], + pathParams: ['productId', 'skuId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['productId', 'skuId', 'userId'], - pathParams: ['productId', 'skuId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * licensing.licenseAssignments.insert - * @desc Assign License. - * @alias licensing.licenseAssignments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku - * @param {().LicenseAssignmentInsert} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * licensing.licenseAssignments.get + * @desc Get license assignment of a particular product and sku for a user + * @alias licensing.licenseAssignments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku + * @param {string} params.userId email id or unique Id of the user + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['productId', 'skuId', 'userId'], + pathParams: ['productId', 'skuId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/user') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['productId', 'skuId'], - pathParams: ['productId', 'skuId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * licensing.licenseAssignments.listForProduct - * @desc List license assignments for given product of the customer. - * @alias licensing.licenseAssignments.listForProduct - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId CustomerId represents the customer for whom licenseassignments are queried - * @param {integer=} params.maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. - * @param {string=} params.pageToken Token to fetch the next page.Optional. By default server will return first page - * @param {string} params.productId Name for product - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listForProduct(params?: any, options?: MethodOptions): - AxiosPromise; - listForProduct( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listForProduct( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/licensing/v1/product/{productId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['productId', 'customerId'], - pathParams: ['productId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * licensing.licenseAssignments.insert + * @desc Assign License. + * @alias licensing.licenseAssignments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku + * @param {().LicenseAssignmentInsert} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/user') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['productId', 'skuId'], + pathParams: ['productId', 'skuId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * licensing.licenseAssignments.listForProductAndSku - * @desc List license assignments for given product and sku of the customer. - * @alias licensing.licenseAssignments.listForProductAndSku - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId CustomerId represents the customer for whom licenseassignments are queried - * @param {integer=} params.maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. - * @param {string=} params.pageToken Token to fetch the next page.Optional. By default server will return first page - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listForProductAndSku(params?: any, options?: MethodOptions): - AxiosPromise; - listForProductAndSku( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - listForProductAndSku( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['productId', 'skuId', 'customerId'], - pathParams: ['productId', 'skuId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * licensing.licenseAssignments.listForProduct + * @desc List license assignments for given product of the customer. + * @alias licensing.licenseAssignments.listForProduct + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId CustomerId represents the customer for whom licenseassignments are queried + * @param {integer=} params.maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. + * @param {string=} params.pageToken Token to fetch the next page.Optional. By default server will return first page + * @param {string} params.productId Name for product + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listForProduct(params?: any, options?: MethodOptions): + AxiosPromise; + listForProduct( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listForProduct( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/licensing/v1/product/{productId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['productId', 'customerId'], + pathParams: ['productId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * licensing.licenseAssignments.patch - * @desc Assign License. This method supports patch semantics. - * @alias licensing.licenseAssignments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku for which license would be revoked - * @param {string} params.userId email id or unique Id of the user - * @param {().LicenseAssignment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * licensing.licenseAssignments.listForProductAndSku + * @desc List license assignments for given product and sku of the customer. + * @alias licensing.licenseAssignments.listForProductAndSku + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId CustomerId represents the customer for whom licenseassignments are queried + * @param {integer=} params.maxResults Maximum number of campaigns to return at one time. Must be positive. Optional. Default value is 100. + * @param {string=} params.pageToken Token to fetch the next page.Optional. By default server will return first page + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listForProductAndSku(params?: any, options?: MethodOptions): + AxiosPromise; + listForProductAndSku( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + listForProductAndSku( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['productId', 'skuId', 'customerId'], + pathParams: ['productId', 'skuId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['productId', 'skuId', 'userId'], - pathParams: ['productId', 'skuId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * licensing.licenseAssignments.update - * @desc Assign License. - * @alias licensing.licenseAssignments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.productId Name for product - * @param {string} params.skuId Name for sku for which license would be revoked - * @param {string} params.userId email id or unique Id of the user - * @param {().LicenseAssignment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * licensing.licenseAssignments.patch + * @desc Assign License. This method supports patch semantics. + * @alias licensing.licenseAssignments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku for which license would be revoked + * @param {string} params.userId email id or unique Id of the user + * @param {().LicenseAssignment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['productId', 'skuId', 'userId'], + pathParams: ['productId', 'skuId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['productId', 'skuId', 'userId'], - pathParams: ['productId', 'skuId', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * licensing.licenseAssignments.update + * @desc Assign License. + * @alias licensing.licenseAssignments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.productId Name for product + * @param {string} params.skuId Name for sku for which license would be revoked + * @param {string} params.userId email id or unique Id of the user + * @param {().LicenseAssignment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/licensing/v1/product/{productId}/sku/{skuId}/user/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['productId', 'skuId', 'userId'], + pathParams: ['productId', 'skuId', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/logging/v2.ts b/src/apis/logging/v2.ts index fc0d9d711e3..8441e4d153b 100644 --- a/src/apis/logging/v2.ts +++ b/src/apis/logging/v2.ts @@ -27,5411 +27,5476 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Logging API - * - * Writes log entries and manages your Stackdriver Logging configuration. - * - * @example - * const google = require('googleapis'); - * const logging = google.logging('v2'); - * - * @namespace logging - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Logging - */ -export class Logging { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - billingAccounts: Resource$Billingaccounts; - entries: Resource$Entries; - exclusions: Resource$Exclusions; - folders: Resource$Folders; - logs: Resource$Logs; - monitoredResourceDescriptors: Resource$Monitoredresourcedescriptors; - organizations: Resource$Organizations; - projects: Resource$Projects; - sinks: Resource$Sinks; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.billingAccounts = new Resource$Billingaccounts(this); - this.entries = new Resource$Entries(this); - this.exclusions = new Resource$Exclusions(this); - this.folders = new Resource$Folders(this); - this.logs = new Resource$Logs(this); - this.monitoredResourceDescriptors = - new Resource$Monitoredresourcedescriptors(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - this.sinks = new Resource$Sinks(this); - } - - getRoot() { - return this.root; - } -} - -/** - * BucketOptions describes the bucket boundaries used to create a histogram for - * the distribution. The buckets can be in a linear sequence, an exponential - * sequence, or each bucket can be specified explicitly. BucketOptions does not - * include the number of values in each bucket.A bucket has an inclusive lower - * bound and exclusive upper bound for the values that are counted for that - * bucket. The upper bound of a bucket must be strictly greater than the lower - * bound. The sequence of N buckets for a distribution consists of an underflow - * bucket (number 0), zero or more finite buckets (number 1 through N - 2) and - * an overflow bucket (number N - 1). The buckets are contiguous: the lower - * bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. - * The buckets span the whole range of finite values: lower bound of the - * underflow bucket is -infinity and the upper bound of the overflow bucket is - * +infinity. The finite buckets are so-called because both bounds are finite. - */ -export interface Schema$BucketOptions { - /** - * The explicit buckets. - */ - explicitBuckets: Schema$Explicit; - /** - * The exponential buckets. - */ - exponentialBuckets: Schema$Exponential; - /** - * The linear bucket. - */ - linearBuckets: Schema$Linear; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 - * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i - * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds - * field must contain at least one element. If bounds has only one element, then - * there are no finite buckets, and that single element is the common boundary - * of the overflow and underflow buckets. - */ -export interface Schema$Explicit { - /** - * The values must be monotonically increasing. - */ - bounds: number[]; -} -/** - * Specifies an exponential sequence of buckets that have a width that is - * proportional to the value of the lower bound. Each bucket represents a - * constant relative uncertainty on a specific value in the bucket.There are - * num_finite_buckets + 2 (= N) buckets. Bucket i has the following - * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). - */ -export interface Schema$Exponential { - /** - * Must be greater than 1. - */ - growthFactor: number; - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Must be greater than 0. - */ - scale: number; -} -/** - * A common proto for logging HTTP requests. Only contains semantics defined by - * the HTTP specification. Product-specific logging information MUST be defined - * in a separate message. - */ -export interface Schema$HttpRequest { - /** - * The number of HTTP response bytes inserted into cache. Set only when a - * cache fill was attempted. - */ - cacheFillBytes: string; - /** - * Whether or not an entity was served from cache (with or without - * validation). - */ - cacheHit: boolean; - /** - * Whether or not a cache lookup was attempted. - */ - cacheLookup: boolean; - /** - * Whether or not the response was validated with the origin server before - * being served from cache. This field is only meaningful if cache_hit is - * True. - */ - cacheValidatedWithOriginServer: boolean; - /** - * The request processing latency on the server, from the time the request was - * received until the response was sent. - */ - latency: string; - /** - * Protocol used for the request. Examples: "HTTP/1.1", - * "HTTP/2", "websocket" - */ - protocol: string; - /** - * The referer URL of the request, as defined in HTTP/1.1 Header Field - * Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - */ - referer: string; - /** - * The IP address (IPv4 or IPv6) of the client that issued the HTTP request. - * Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". - */ - remoteIp: string; - /** - * The request method. Examples: "GET", "HEAD", - * "PUT", "POST". - */ - requestMethod: string; - /** - * The size of the HTTP request message in bytes, including the request - * headers and the request body. - */ - requestSize: string; - /** - * The scheme (http, https), the host name, the path and the query portion of - * the URL that was requested. Example: - * "http://example.com/some/info?color=red". - */ - requestUrl: string; - /** - * The size of the HTTP response message sent back to the client, in bytes, - * including the response headers and the response body. - */ - responseSize: string; - /** - * The IP address (IPv4 or IPv6) of the origin server that the request was - * sent to. - */ - serverIp: string; - /** - * The response code indicating the status of response. Examples: 200, 404. - */ - status: number; - /** - * The user agent sent by the client. Example: "Mozilla/4.0 (compatible; - * MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". - */ - userAgent: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * Specifies a linear sequence of buckets that all have the same width (except - * overflow and underflow). Each bucket represents a constant absolute - * uncertainty on the specific value in the bucket.There are num_finite_buckets - * + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= - * i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + - * (width * (i - 1)). - */ -export interface Schema$Linear { - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Lower bound of the first bucket. - */ - offset: number; - /** - * Must be greater than 0. - */ - width: number; -} -/** - * Result returned from ListExclusions. - */ -export interface Schema$ListExclusionsResponse { - /** - * A list of exclusions. - */ - exclusions: Schema$LogExclusion[]; - /** - * If there might be more results than appear in this response, then - * nextPageToken is included. To get the next set of results, call the same - * method again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; -} -/** - * The parameters to ListLogEntries. - */ -export interface Schema$ListLogEntriesRequest { - /** - * Optional. A filter that chooses which log entries to return. See Advanced - * Logs Filters. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in resource_names. - * Referencing a parent resource that is not listed in resource_names will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. - */ - filter: string; - /** - * Optional. How the results should be sorted. Presently, the only permitted - * values are "timestamp asc" (default) and "timestamp - * desc". The first option returns entries in order of increasing values - * of LogEntry.timestamp (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their insert_id values. - */ - orderBy: string; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of next_page_token in the - * response indicates that more results might be available. - */ - pageSize: number; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. page_token must be the value of - * next_page_token from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ - pageToken: string; - /** - * Deprecated. Use resource_names instead. One or more project identifiers or - * project numbers from which to retrieve log entries. Example: - * "my-project-1A". If present, these project identifiers are - * converted to resource name format and added to the list of resources in - * resource_names. - */ - projectIds: string[]; - /** - * Required. Names of one or more parent resources from which to retrieve log - * entries: "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" Projects listed in the project_ids field - * are added to this list. - */ - resourceNames: string[]; -} -/** - * Result returned from ListLogEntries. - */ -export interface Schema$ListLogEntriesResponse { - /** - * A list of log entries. If entries is empty, nextPageToken may still be - * returned, indicating that more entries may exist. See nextPageToken for - * more information. - */ - entries: Schema$LogEntry[]; - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken.If a value for - * next_page_token appears and the entries field is empty, it means that the - * search found no log entries so far but it did not have time to search all - * the possible log entries. Retry the method with this value for page_token - * to continue the search. Alternatively, consider speeding up the search by - * changing your filter to specify a single log name or resource type, or to - * narrow the time range of the search. - */ - nextPageToken: string; -} -/** - * Result returned from ListLogMetrics. - */ -export interface Schema$ListLogMetricsResponse { - /** - * A list of logs-based metrics. - */ - metrics: Schema$LogMetric[]; - /** - * If there might be more results than appear in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; -} -/** - * Result returned from ListLogs. - */ -export interface Schema$ListLogsResponse { - /** - * A list of log names. For example, "projects/my-project/syslog" or - * "organizations/123/cloudresourcemanager.googleapis.com%2Factivity". - */ - logNames: string[]; - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; -} -/** - * Result returned from ListMonitoredResourceDescriptors. - */ -export interface Schema$ListMonitoredResourceDescriptorsResponse { - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; - /** - * A list of resource descriptors. - */ - resourceDescriptors: Schema$MonitoredResourceDescriptor[]; -} -/** - * Result returned from ListSinks. - */ -export interface Schema$ListSinksResponse { - /** - * If there might be more results than appear in this response, then - * nextPageToken is included. To get the next set of results, call the same - * method again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; - /** - * A list of sinks. - */ - sinks: Schema$LogSink[]; -} -/** - * An individual entry in a log. - */ -export interface Schema$LogEntry { - /** - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - */ - httpRequest: Schema$HttpRequest; - /** - * Optional. A unique identifier for the log entry. If you provide a value, - * then Stackdriver Logging considers other log entries in the same project, - * with the same timestamp, and with the same insert_id to be duplicates which - * can be removed. If omitted in new log entries, then Stackdriver Logging - * assigns its own unique identifier. The insert_id is also used to order log - * entries that have the same timestamp value. - */ - insertId: string; - /** - * The log entry payload, represented as a structure that is expressed as a - * JSON object. - */ - jsonPayload: any; - /** - * Optional. A set of user-defined (key, value) data that provides additional - * information about the log entry. - */ - labels: any; - /** - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may - * optionally be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the log_name - * field will contain PROJECT_ID in queries and exports.[LOG_ID] must be - * URL-encoded within log_name. Example: - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * [LOG_ID] must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period.For backward compatibility, - * if log_name begins with a forward-slash, such as /projects/..., then the - * log entry is ingested as usual but the forward-slash is removed. Listing - * the log entry will not show the leading slash and filtering for a log name - * with a leading slash will never return any results. - */ - logName: string; - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - */ - operation: Schema$LogEntryOperation; - /** - * The log entry payload, represented as a protocol buffer. Some Google Cloud - * Platform services use this field for their log entry payloads. - */ - protoPayload: any; - /** - * Output only. The time the log entry was received by Stackdriver Logging. - */ - receiveTimestamp: string; - /** - * Required. The primary monitored resource associated with this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - */ - resource: Schema$MonitoredResource; - /** - * Optional. The severity of the log entry. The default value is - * LogSeverity.DEFAULT. - */ - severity: string; - /** - * Optional. Source code location information associated with the log entry, - * if any. - */ - sourceLocation: Schema$LogEntrySourceLocation; - /** - * Optional. The span ID within the trace associated with the log entry. For - * Stackdriver Trace spans, this is the same format that the Stackdriver Trace - * API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such - * as <code>"000000000000004a"</code>. - */ - spanId: string; - /** - * The log entry payload, represented as a Unicode string (UTF-8). - */ - textPayload: string; - /** - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs - * retention period. If this field is omitted in a new log entry, then - * Stackdriver Logging assigns it the current time.Incoming log entries should - * have timestamps that are no more than the logs retention period in the - * past, and no more than 24 hours in the future. Log entries outside those - * time boundaries will not be available when calling entries.list, but those - * log entries can still be exported with LogSinks. - */ - timestamp: string; - /** - * Optional. Resource name of the trace associated with the log entry, if any. - * If it contains a relative resource name, the name is assumed to be relative - * to //tracing.googleapis.com. Example: - * projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 - */ - trace: string; -} -/** - * Additional information about a potentially long-running operation with which - * a log entry is associated. - */ -export interface Schema$LogEntryOperation { - /** - * Optional. Set this to True if this is the first log entry in the operation. - */ - first: boolean; - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - */ - id: string; - /** - * Optional. Set this to True if this is the last log entry in the operation. - */ - last: boolean; - /** - * Optional. An arbitrary producer identifier. The combination of id and - * producer must be globally unique. Examples for producer: - * "MyDivision.MyBigCompany.com", - * "github.com/MyProject/MyApplication". - */ - producer: string; -} -/** - * Additional information about the source code location that produced the log - * entry. - */ -export interface Schema$LogEntrySourceLocation { - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - */ - file: string; - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). - */ - function: string; - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - */ - line: string; -} -/** - * Specifies a set of log entries that are not to be stored in Stackdriver - * Logging. If your project receives a large volume of logs, you might be able - * to use exclusions to reduce your chargeable logs. Exclusions are processed - * after log sinks, so you can export log entries before they are excluded. - * Audit log entries and log entries from Amazon Web Services are never - * excluded. - */ -export interface Schema$LogExclusion { - /** - * Optional. A description of this exclusion. - */ - description: string; - /** - * Optional. If set to True, then this exclusion is disabled and it does not - * exclude any log entries. You can use exclusions.patch to change the value - * of this field. - */ - disabled: boolean; - /** - * Required. An advanced logs filter that matches the log entries to be - * excluded. By using the sample function, you can exclude less than 100% of - * the matching log entries. For example, the following filter matches 99% of - * low-severity log entries from load balancers: - * "resource.type=http_load_balancer severity<ERROR sample(insertId, - * 0.99)" - */ - filter: string; - /** - * Required. A client-assigned identifier, such as - * "load-balancer-exclusion". Identifiers are limited to 100 - * characters and can include only letters, digits, underscores, hyphens, and - * periods. - */ - name: string; -} -/** - * Application log line emitted while processing a request. - */ -export interface Schema$LogLine { - /** - * App-provided log message. - */ - logMessage: string; - /** - * Severity of this log entry. - */ - severity: string; - /** - * Where in the source code this log message was written. - */ - sourceLocation: Schema$SourceLocation; - /** - * Approximate time when this log entry was made. - */ - time: string; -} -/** - * Describes a logs-based metric. The value of the metric is the number of log - * entries that match a logs filter in a given time interval.Logs-based metric - * can also be used to extract values from logs and create a a distribution of - * the values. The distribution records the statistics of the extracted values - * along with an optional histogram of the values as specified by the bucket - * options. - */ -export interface Schema$LogMetric { - /** - * Optional. The bucket_options are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries used - * to create a histogram of the extracted values. - */ - bucketOptions: Schema$BucketOptions; - /** - * Optional. A description of this metric, which is used in documentation. - */ - description: string; - /** - * Required. An advanced logs filter which is used to match log entries. - * Example: "resource.type=gae_app AND severity>=ERROR" The - * maximum length of the filter is 20000 characters. - */ - filter: string; - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression is - * the same as for the value_extractor field.The extracted value is converted - * to the type defined in the label descriptor. If the either the extraction - * or the type conversion fails, the label will have a default value. The - * default value for a string label is an empty string, for an integer label - * its 0, and for a boolean label its false.Note that there are upper bounds - * on the maximum number of labels and the number of active time series that - * are allowed in a project. - */ - labelExtractors: any; - /** - * Optional. The metric descriptor associated with the logs-based metric. If - * unspecified, it uses a default metric descriptor with a DELTA metric kind, - * INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the filter expression.The name, - * type, and description fields in the metric_descriptor are output only, and - * is constructed using the name and description field in the LogMetric.To - * create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with a - * value_extractor expression in the LogMetric.Each label in the metric - * descriptor must have a matching label name as the key and an extractor - * expression as the value in the label_extractors map.The metric_kind and - * value_type fields in the metric_descriptor cannot be updated once initially - * configured. New labels can be added in the metric_descriptor, but existing - * labels cannot be modified except for their description. - */ - metricDescriptor: Schema$MetricDescriptor; - /** - * Required. The client-assigned metric identifier. Examples: - * "error_count", "nginx/requests".Metric identifiers are - * limited to 100 characters and can include only the following characters: - * A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The - * forward-slash character (/) denotes a hierarchy of name pieces, and it - * cannot be the first character of the name.The metric identifier in this - * field must not be URL-encoded - * (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric - * identifier appears as the [METRIC_ID] part of a metric_name API parameter, - * then the metric identifier must be URL-encoded. Example: - * "projects/my-project/metrics/nginx%2Frequests". - */ - name: string; - /** - * Optional. A value_extractor is required when using a distribution - * logs-based metric to extract the values to record from a log entry. Two - * functions are supported for value extraction: EXTRACT(field) or - * REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the - * log entry field from which the value is to be extracted. 2. regex: A - * regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture group to - * extract data from the specified log entry field. The value of the field is - * converted to a string before applying the regex. It is an error to specify - * a regex that does not include exactly one capture group.The result of the - * extraction must be convertible to a double type, as the distribution always - * records double values. If either the extraction or the conversion to double - * fails, then those values are not recorded in the distribution.Example: - * REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*") - */ - valueExtractor: string; - /** - * Deprecated. The API version that created or updated this metric. The v2 - * format is used by default and cannot be changed. - */ - version: string; -} -/** - * Describes a sink used to export log entries to one of the following - * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a - * Cloud Pub/Sub topic. A logs filter controls which log entries are exported. - * The sink must be created within a project, organization, billing account, or - * folder. - */ -export interface Schema$LogSink { - /** - * Required. The export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's writer_identity, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see Exporting Logs With Sinks. - */ - destination: string; - /** - * Deprecated. This field is ignored when creating or updating sinks. - */ - endTime: string; - /** - * Optional. An advanced logs filter. The only exported log entries are those - * that are in the resource owning the sink and that match the filter. For - * example: logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND - * severity>=ERROR - */ - filter: string; - /** - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, - * then logs from all the projects, folders, and billing accounts contained in - * the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the - * sink's filter expression. For example, if this field is true, then the - * filter resource.type=gce_instance would export all Compute Engine VM - * instance log entries from all projects in the sink's parent. To only - * export entries from certain child projects, filter on the project part of - * the log name: logName:("projects/test-project1/" OR - * "projects/test-project2/") AND resource.type=gce_instance - */ - includeChildren: boolean; - /** - * Required. The client-assigned sink identifier, unique within the project. - * Example: "my-syslog-errors-to-pubsub". Sink identifiers are - * limited to 100 characters and can include only the following characters: - * upper and lower-case alphanumeric characters, underscores, hyphens, and - * periods. - */ - name: string; - /** - * Deprecated. The log entry format to use for this sink's exported log - * entries. The v2 format is used by default and cannot be changed. - */ - outputVersionFormat: string; - /** - * Deprecated. This field is ignored when creating or updating sinks. - */ - startTime: string; - /** - * Output only. An IAM identity&mdash;a service account or - * group&mdash;under which Stackdriver Logging writes the exported log - * entries to the sink's destination. This field is set by sinks.create - * and sinks.update, based on the setting of unique_writer_identity in those - * methods.Until you grant this identity write-access to the destination, log - * entry exports from this sink will fail. For more information, see Granting - * access for a resource. Consult the destination service's documentation - * to determine the appropriate IAM roles to assign to the identity. - */ - writerIdentity: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * appengine.googleapis.com/http/server/response_latencies metric type has a - * label for the HTTP response code, response_code, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of metric_kind and value_type might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * custom.googleapis.com. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a - * subset of The Unified Code for Units of Measure - * (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit - * By byte s second min minute h hour d dayPrefixes (PREFIX) k kilo (10**3) M - * mega (10**6) G giga (10**9) T tera (10**12) P peta (10**15) E exa (10**18) - * Z zetta (10**21) Y yotta (10**24) m milli (10**-3) u micro (10**-6) n nano - * (10**-9) p pico (10**-12) f femto (10**-15) a atto (10**-18) z zepto - * (10**-21) y yocto (10**-24) Ki kibi (2**10) Mi mebi (2**20) Gi gibi (2**30) - * Ti tebi (2**40)GrammarThe grammar also includes these connectors: / - * division (as an infix operator, e.g. 1/s). . multiplication (as an infix - * operator, e.g. GBy.d)The grammar for a unit is as follows: Expression = - * Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | - * Annotation | "1" ; Annotation = - * "{" NAME "}" ; Notes: Annotation is just a comment if - * it follows a UNIT and is equivalent to 1 if it is used alone. For - * examples, {requests}/s == 1/s, By{transmitted}/s == By/s. NAME is a - * sequence of non-blank printable ASCII characters not containing - * '{' or '}'. 1 represents dimensionless value 1, such as in - * 1/s. % represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of metric_kind and value_type might not be supported. - */ - valueType: string; -} -/** - * An object representing a resource that can be used for monitoring, logging, - * billing, or other purposes. Examples include virtual machine instances, - * databases, and storage devices such as disks. The type field identifies a - * MonitoredResourceDescriptor object that describes the resource's schema. - * Information in the labels field identifies the actual resource and its - * attributes according to the schema. For example, a particular Compute Engine - * VM instance could be represented by the following object, because the - * MonitoredResourceDescriptor for "gce_instance" has labels - * "instance_id" and "zone": { "type": - * "gce_instance", "labels": { "instance_id": - * "12345678901234", "zone": - * "us-central1-a" }} - */ -export interface Schema$MonitoredResource { - /** - * Required. Values for all of the labels listed in the associated monitored - * resource descriptor. For example, Compute Engine VM instances use the - * labels "project_id", "instance_id", and - * "zone". - */ - labels: any; - /** - * Required. The monitored resource type. This field must match the type field - * of a MonitoredResourceDescriptor object. For example, the type of a Compute - * Engine VM instance is gce_instance. - */ - type: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource descriptor - * for Google Compute Engine VM instances has a type of "gce_instance" - * and specifies the use of the labels "instance_id" and - * "zone" to identify particular VM instances.Different APIs can - * support different monitored resource types. APIs generally provide a list - * method that returns the monitored resource descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, "Google Cloud - * SQL Database". - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels "database_id" and - * "zone". - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * "projects/{project_id}/monitoredResourceDescriptors/{type}" where - * {type} is the value of the type field in this object and {project_id} is a - * project ID that provides API-specific context for accessing the type. APIs - * that do not use project information can use the resource name format - * "monitoredResourceDescriptors/{type}". - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * "cloudsql_database" represents databases in Google Cloud SQL. The - * maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Complete log information about a single HTTP request to an App Engine - * application. - */ -export interface Schema$RequestLog { - /** - * App Engine release version. - */ - appEngineRelease: string; - /** - * Application that handled this request. - */ - appId: string; - /** - * An indication of the relative cost of serving this request. - */ - cost: number; - /** - * Time when the request finished. - */ - endTime: string; - /** - * Whether this request is finished or active. - */ - finished: boolean; - /** - * Whether this is the first RequestLog entry for this request. If an active - * request has several RequestLog entries written to Stackdriver Logging, then - * this field will be set for one of them. - */ - first: boolean; - /** - * Internet host and port number of the resource being requested. - */ - host: string; - /** - * HTTP version of request. Example: "HTTP/1.1". - */ - httpVersion: string; - /** - * An identifier for the instance that handled the request. - */ - instanceId: string; - /** - * If the instance processing this request belongs to a manually scaled - * module, then this is the 0-based index of the instance. Otherwise, this - * value is -1. - */ - instanceIndex: number; - /** - * Origin IP address. - */ - ip: string; - /** - * Latency of the request. - */ - latency: string; - /** - * A list of log lines emitted by the application while serving this request. - */ - line: Schema$LogLine[]; - /** - * Number of CPU megacycles used to process request. - */ - megaCycles: string; - /** - * Request method. Example: "GET", "HEAD", - * "PUT", "POST", "DELETE". - */ - method: string; - /** - * Module of the application that handled this request. - */ - moduleId: string; - /** - * The logged-in user who made the request.Most likely, this is the part of - * the user's email before the @ sign. The field value is the same for - * different requests from the same user, but different users can have similar - * names. This information is also available to the application via the App - * Engine Users API.This field will be populated starting with App - * Engine 1.9.21. - */ - nickname: string; - /** - * Time this request spent in the pending request queue. - */ - pendingTime: string; - /** - * Referrer URL of request. - */ - referrer: string; - /** - * Globally unique identifier for a request, which is based on the request - * start time. Request IDs for requests which started later will compare - * greater as strings than those for requests which started earlier. - */ - requestId: string; - /** - * Contains the path and query portion of the URL that was requested. For - * example, if the URL was "http://example.com/app?name=val", the - * resource would be "/app?name=val". The fragment identifier, which - * is identified by the # character, is not included. - */ - resource: string; - /** - * Size in bytes sent back to client by request. - */ - responseSize: string; - /** - * Source code for the application that handled this request. There can be - * more than one source reference per deployed application if source code is - * distributed among multiple repositories. - */ - sourceReference: Schema$SourceReference[]; - /** - * Time when the request started. - */ - startTime: string; - /** - * HTTP response status code. Example: 200, 404. - */ - status: number; - /** - * Task name of the request, in the case of an offline request. - */ - taskName: string; - /** - * Queue name of the request, in the case of an offline request. - */ - taskQueueName: string; - /** - * Stackdriver Trace identifier for this request. - */ - traceId: string; - /** - * File or class that handled the request. - */ - urlMapEntry: string; - /** - * User agent that made the request. - */ - userAgent: string; - /** - * Version of the application that handled this request. - */ - versionId: string; - /** - * Whether this was a loading request for the instance. - */ - wasLoadingRequest: boolean; -} -/** - * Specifies a location in a source code file. - */ -export interface Schema$SourceLocation { - /** - * Source file name. Depending on the runtime environment, this might be a - * simple name or a fully-qualified name. - */ - file: string; - /** - * Human-readable name of the function or method being invoked, with optional - * context such as the class or package name. This information is used in - * contexts such as the logs viewer, where a file and line number are less - * meaningful. The format can vary by language. For example: - * qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). - */ - functionName: string; - /** - * Line within the source file. - */ - line: string; -} -/** - * A reference to a particular snapshot of the source tree used to build and - * deploy an application. - */ -export interface Schema$SourceReference { - /** - * Optional. A URI string identifying the repository. Example: - * "https://github.com/GoogleCloudPlatform/kubernetes.git" - */ - repository: string; - /** - * The canonical and persistent identifier of the deployed revision. Example - * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" - */ - revisionId: string; -} -/** - * The parameters to WriteLogEntries. - */ -export interface Schema$WriteLogEntriesRequest { - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether - * the logging API endpoints are working properly before sending valuable - * data. - */ - dryRun: boolean; - /** - * Required. The log entries to send to Stackdriver Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * log_name, resource, and labels fields are copied into those log entries in - * this list that do not include values for their corresponding fields. For - * more information, see the LogEntry type.If the timestamp or insert_id - * fields are missing in log entries, then this method supplies the current - * time or a unique identifier, respectively. The supplied values are chosen - * so that, among the log entries that did not supply their own values, the - * entries earlier in the list will sort before the entries later in the list. - * See the entries.list method.Log entries with timestamps that are more than - * the logs retention period in the past or more than 24 hours in the future - * will not be available when calling entries.list. However, those log entries - * can still be exported with LogSinks.To improve throughput and to avoid - * exceeding the quota limit for calls to entries.write, you should try to - * include several log entries in this list, rather than calling this method - * for each individual log entry. - */ - entries: Schema$LogEntry[]; - /** - * Optional. Default labels that are added to the labels field of all log - * entries in entries. If a log entry already has a label with the same key as - * a label in this parameter, then the log entry's label is not changed. - * See LogEntry. - */ - labels: any; - /** - * Optional. A default log resource name that is assigned to all log entries - * in entries that do not specify a value for log_name: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. - * For example, "projects/my-project-id/logs/syslog" or - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * For more information about log names, see LogEntry. - */ - logName: string; - /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated with - * one of the failed entries and the response includes error details keyed by - * the entries' zero-based index in the entries.write method. - */ - partialSuccess: boolean; - /** - * Optional. A default monitored resource object that is assigned to all log - * entries in entries that do not specify a value for resource. Example: { - * "type": "gce_instance", "labels": { - * "zone": "us-central1-a", "instance_id": - * "00000000000000000000" }} See LogEntry. - */ - resource: Schema$MonitoredResource; -} -/** - * Result returned from WriteLogEntries. empty - */ -export interface Schema$WriteLogEntriesResponse {} - -export class Resource$Billingaccounts { - root: Logging; - exclusions: Resource$Billingaccounts$Exclusions; - logs: Resource$Billingaccounts$Logs; - sinks: Resource$Billingaccounts$Sinks; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.exclusions = new Resource$Billingaccounts$Exclusions(root); - this.logs = new Resource$Billingaccounts$Logs(root); - this.sinks = new Resource$Billingaccounts$Sinks(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Billingaccounts$Exclusions { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.billingAccounts.exclusions.create - * @desc Creates a new exclusion in a specified parent resource. Only log - * entries belonging to that resource can be excluded. You can have up to 10 - * exclusions in a resource. - * @alias logging.billingAccounts.exclusions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.exclusions.delete - * @desc Deletes an exclusion. - * @alias logging.billingAccounts.exclusions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.exclusions.get - * @desc Gets the description of an exclusion. - * @alias logging.billingAccounts.exclusions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.exclusions.list - * @desc Lists all the exclusions in a parent resource. - * @alias logging.billingAccounts.exclusions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.exclusions.patch - * @desc Changes one or more properties of an existing exclusion. - * @alias logging.billingAccounts.exclusions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Billingaccounts$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.billingAccounts.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @alias logging.billingAccounts.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @alias logging.billingAccounts.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/logs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Billingaccounts$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.billingAccounts.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @alias logging.billingAccounts.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @alias logging.billingAccounts.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.sinks.get - * @desc Gets a sink. - * @alias logging.billingAccounts.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.sinks.list - * @desc Lists sinks. - * @alias logging.billingAccounts.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.sinks.patch - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.billingAccounts.sinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.billingAccounts.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.billingAccounts.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Entries { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.entries.list - * @desc Lists log entries. Use this method to retrieve log entries from - * Stackdriver Logging. For ways to export log entries, see Exporting Logs. - * @alias logging.entries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ListLogEntriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/entries:list').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.entries.write - * @desc Writes log entries to Stackdriver Logging. This API method is the - * only way to send log entries to Stackdriver Logging. This method is used, - * directly or indirectly, by the Stackdriver Logging agent (fluentd) and all - * logging libraries configured to use Stackdriver Logging. A single request - * may contain log entries for a maximum of 1000 different resources - * (projects, organizations, billing accounts or folders) - * @alias logging.entries.write - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().WriteLogEntriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - write(params?: any, options?: MethodOptions): - AxiosPromise; - write( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - write( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/entries:write').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Exclusions { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.exclusions.create - * @desc Creates a new exclusion in a specified parent resource. Only log - * entries belonging to that resource can be excluded. You can have up to 10 - * exclusions in a resource. - * @alias logging.exclusions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.exclusions.delete - * @desc Deletes an exclusion. - * @alias logging.exclusions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.exclusions.get - * @desc Gets the description of an exclusion. - * @alias logging.exclusions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.exclusions.list - * @desc Lists all the exclusions in a parent resource. - * @alias logging.exclusions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.exclusions.patch - * @desc Changes one or more properties of an existing exclusion. - * @alias logging.exclusions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Folders { - root: Logging; - exclusions: Resource$Folders$Exclusions; - logs: Resource$Folders$Logs; - sinks: Resource$Folders$Sinks; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.exclusions = new Resource$Folders$Exclusions(root); - this.logs = new Resource$Folders$Logs(root); - this.sinks = new Resource$Folders$Sinks(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Folders$Exclusions { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.folders.exclusions.create - * @desc Creates a new exclusion in a specified parent resource. Only log - * entries belonging to that resource can be excluded. You can have up to 10 - * exclusions in a resource. - * @alias logging.folders.exclusions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.exclusions.delete - * @desc Deletes an exclusion. - * @alias logging.folders.exclusions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.exclusions.get - * @desc Gets the description of an exclusion. - * @alias logging.folders.exclusions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.exclusions.list - * @desc Lists all the exclusions in a parent resource. - * @alias logging.folders.exclusions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.exclusions.patch - * @desc Changes one or more properties of an existing exclusion. - * @alias logging.folders.exclusions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Folders$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.folders.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @alias logging.folders.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @alias logging.folders.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/logs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Folders$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.folders.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @alias logging.folders.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @alias logging.folders.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.sinks.get - * @desc Gets a sink. - * @alias logging.folders.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.sinks.list - * @desc Lists sinks. - * @alias logging.folders.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.sinks.patch - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.folders.sinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.folders.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.folders.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @alias logging.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @alias logging.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/logs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Monitoredresourcedescriptors { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.monitoredResourceDescriptors.list - * @desc Lists the descriptors for monitored resource types used by - * Stackdriver Logging. - * @alias logging.monitoredResourceDescriptors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/monitoredResourceDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Organizations { - root: Logging; - exclusions: Resource$Organizations$Exclusions; - logs: Resource$Organizations$Logs; - sinks: Resource$Organizations$Sinks; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.exclusions = new Resource$Organizations$Exclusions(root); - this.logs = new Resource$Organizations$Logs(root); - this.sinks = new Resource$Organizations$Sinks(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Organizations$Exclusions { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * logging.organizations.exclusions.create - * @desc Creates a new exclusion in a specified parent resource. Only log - * entries belonging to that resource can be excluded. You can have up to 10 - * exclusions in a resource. - * @alias logging.organizations.exclusions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.organizations.exclusions.delete - * @desc Deletes an exclusion. - * @alias logging.organizations.exclusions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace logging_v2 { /** - * logging.organizations.exclusions.get - * @desc Gets the description of an exclusion. - * @alias logging.organizations.exclusions.get - * @memberOf! () + * Stackdriver Logging API * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.organizations.exclusions.list - * @desc Lists all the exclusions in a parent resource. - * @alias logging.organizations.exclusions.list - * @memberOf! () + * Writes log entries and manages your Stackdriver Logging configuration. * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * logging.organizations.exclusions.patch - * @desc Changes one or more properties of an existing exclusion. - * @alias logging.organizations.exclusions.patch - * @memberOf! () + * @example + * const google = require('googleapis'); + * const logging = google.logging('v2'); * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + * @namespace logging + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Logging + */ + export class Logging { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + billingAccounts: Resource$Billingaccounts; + entries: Resource$Entries; + exclusions: Resource$Exclusions; + folders: Resource$Folders; + logs: Resource$Logs; + monitoredResourceDescriptors: Resource$Monitoredresourcedescriptors; + organizations: Resource$Organizations; + projects: Resource$Projects; + sinks: Resource$Sinks; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.billingAccounts = new Resource$Billingaccounts(this); + this.entries = new Resource$Entries(this); + this.exclusions = new Resource$Exclusions(this); + this.folders = new Resource$Folders(this); + this.logs = new Resource$Logs(this); + this.monitoredResourceDescriptors = + new Resource$Monitoredresourcedescriptors(this); + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + this.sinks = new Resource$Sinks(this); + } + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Organizations$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; + /** + * BucketOptions describes the bucket boundaries used to create a histogram + * for the distribution. The buckets can be in a linear sequence, an + * exponential sequence, or each bucket can be specified explicitly. + * BucketOptions does not include the number of values in each bucket.A bucket + * has an inclusive lower bound and exclusive upper bound for the values that + * are counted for that bucket. The upper bound of a bucket must be strictly + * greater than the lower bound. The sequence of N buckets for a distribution + * consists of an underflow bucket (number 0), zero or more finite buckets + * (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets + * are contiguous: the lower bound of bucket i (i > 0) is the same as the + * upper bound of bucket i - 1. The buckets span the whole range of finite + * values: lower bound of the underflow bucket is -infinity and the upper + * bound of the overflow bucket is +infinity. The finite buckets are so-called + * because both bounds are finite. + */ + export interface Schema$BucketOptions { + /** + * The explicit buckets. + */ + explicitBuckets: Schema$Explicit; + /** + * The exponential buckets. + */ + exponentialBuckets: Schema$Exponential; + /** + * The linear bucket. + */ + linearBuckets: Schema$Linear; } - - /** - * logging.organizations.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @alias logging.organizations.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 + * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i + * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds + * field must contain at least one element. If bounds has only one element, + * then there are no finite buckets, and that single element is the common + * boundary of the overflow and underflow buckets. + */ + export interface Schema$Explicit { + /** + * The values must be monotonically increasing. + */ + bounds: number[]; } - - /** - * logging.organizations.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @alias logging.organizations.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/logs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies an exponential sequence of buckets that have a width that is + * proportional to the value of the lower bound. Each bucket represents a + * constant relative uncertainty on a specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + */ + export interface Schema$Exponential { + /** + * Must be greater than 1. + */ + growthFactor: number; + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Must be greater than 0. + */ + scale: number; } -} - -export class Resource$Organizations$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * A common proto for logging HTTP requests. Only contains semantics defined + * by the HTTP specification. Product-specific logging information MUST be + * defined in a separate message. + */ + export interface Schema$HttpRequest { + /** + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + */ + cacheFillBytes: string; + /** + * Whether or not an entity was served from cache (with or without + * validation). + */ + cacheHit: boolean; + /** + * Whether or not a cache lookup was attempted. + */ + cacheLookup: boolean; + /** + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if cache_hit is + * True. + */ + cacheValidatedWithOriginServer: boolean; + /** + * The request processing latency on the server, from the time the request + * was received until the response was sent. + */ + latency: string; + /** + * Protocol used for the request. Examples: "HTTP/1.1", + * "HTTP/2", "websocket" + */ + protocol: string; + /** + * The referer URL of the request, as defined in HTTP/1.1 Header Field + * Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + */ + referer: string; + /** + * The IP address (IPv4 or IPv6) of the client that issued the HTTP request. + * Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". + */ + remoteIp: string; + /** + * The request method. Examples: "GET", "HEAD", + * "PUT", "POST". + */ + requestMethod: string; + /** + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + */ + requestSize: string; + /** + * The scheme (http, https), the host name, the path and the query portion + * of the URL that was requested. Example: + * "http://example.com/some/info?color=red". + */ + requestUrl: string; + /** + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + */ + responseSize: string; + /** + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. + */ + serverIp: string; + /** + * The response code indicating the status of response. Examples: 200, 404. + */ + status: number; + /** + * The user agent sent by the client. Example: "Mozilla/4.0 + * (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". + */ + userAgent: string; } - - getRoot() { - return this.root; + /** + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; } - - /** - * logging.organizations.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @alias logging.organizations.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies a linear sequence of buckets that all have the same width (except + * overflow and underflow). Each bucket represents a constant absolute + * uncertainty on the specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower + * bound (1 <= i < N): offset + (width * (i - 1)). + */ + export interface Schema$Linear { + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Lower bound of the first bucket. + */ + offset: number; + /** + * Must be greater than 0. + */ + width: number; } - - /** - * logging.organizations.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @alias logging.organizations.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListExclusions. + */ + export interface Schema$ListExclusionsResponse { + /** + * A list of exclusions. + */ + exclusions: Schema$LogExclusion[]; + /** + * If there might be more results than appear in this response, then + * nextPageToken is included. To get the next set of results, call the same + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; } - - /** - * logging.organizations.sinks.get - * @desc Gets a sink. - * @alias logging.organizations.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The parameters to ListLogEntries. + */ + export interface Schema$ListLogEntriesRequest { + /** + * Optional. A filter that chooses which log entries to return. See Advanced + * Logs Filters. Only log entries that match the filter are returned. An + * empty filter matches all log entries in the resources listed in + * resource_names. Referencing a parent resource that is not listed in + * resource_names will cause the filter to return no results. The maximum + * length of the filter is 20000 characters. + */ + filter: string; + /** + * Optional. How the results should be sorted. Presently, the only permitted + * values are "timestamp asc" (default) and "timestamp + * desc". The first option returns entries in order of increasing + * values of LogEntry.timestamp (oldest first), and the second option + * returns entries in order of decreasing timestamps (newest first). Entries + * with equal timestamps are returned in order of their insert_id values. + */ + orderBy: string; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of next_page_token in the + * response indicates that more results might be available. + */ + pageSize: number; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. page_token must be the value of + * next_page_token from the previous response. The values of other method + * parameters should be identical to those in the previous call. + */ + pageToken: string; + /** + * Deprecated. Use resource_names instead. One or more project identifiers + * or project numbers from which to retrieve log entries. Example: + * "my-project-1A". If present, these project identifiers are + * converted to resource name format and added to the list of resources in + * resource_names. + */ + projectIds: string[]; + /** + * Required. Names of one or more parent resources from which to retrieve + * log entries: "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" Projects listed in the project_ids field + * are added to this list. + */ + resourceNames: string[]; } - - /** - * logging.organizations.sinks.list - * @desc Lists sinks. - * @alias logging.organizations.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListLogEntries. + */ + export interface Schema$ListLogEntriesResponse { + /** + * A list of log entries. If entries is empty, nextPageToken may still be + * returned, indicating that more entries may exist. See nextPageToken for + * more information. + */ + entries: Schema$LogEntry[]; + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken.If a value for + * next_page_token appears and the entries field is empty, it means that the + * search found no log entries so far but it did not have time to search all + * the possible log entries. Retry the method with this value for page_token + * to continue the search. Alternatively, consider speeding up the search by + * changing your filter to specify a single log name or resource type, or to + * narrow the time range of the search. + */ + nextPageToken: string; } - - /** - * logging.organizations.sinks.patch - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.organizations.sinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListLogMetrics. + */ + export interface Schema$ListLogMetricsResponse { + /** + * A list of logs-based metrics. + */ + metrics: Schema$LogMetric[]; + /** + * If there might be more results than appear in this response, then + * nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; } - - /** - * logging.organizations.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.organizations.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListLogs. + */ + export interface Schema$ListLogsResponse { + /** + * A list of log names. For example, "projects/my-project/syslog" + * or + * "organizations/123/cloudresourcemanager.googleapis.com%2Factivity". + */ + logNames: string[]; + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; } -} - - -export class Resource$Projects { - root: Logging; - exclusions: Resource$Projects$Exclusions; - logs: Resource$Projects$Logs; - metrics: Resource$Projects$Metrics; - sinks: Resource$Projects$Sinks; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.exclusions = new Resource$Projects$Exclusions(root); - this.logs = new Resource$Projects$Logs(root); - this.metrics = new Resource$Projects$Metrics(root); - this.sinks = new Resource$Projects$Sinks(root); + /** + * Result returned from ListMonitoredResourceDescriptors. + */ + export interface Schema$ListMonitoredResourceDescriptorsResponse { + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; + /** + * A list of resource descriptors. + */ + resourceDescriptors: Schema$MonitoredResourceDescriptor[]; } - - getRoot() { - return this.root; + /** + * Result returned from ListSinks. + */ + export interface Schema$ListSinksResponse { + /** + * If there might be more results than appear in this response, then + * nextPageToken is included. To get the next set of results, call the same + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; + /** + * A list of sinks. + */ + sinks: Schema$LogSink[]; } -} -export class Resource$Projects$Exclusions { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * An individual entry in a log. + */ + export interface Schema$LogEntry { + /** + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + */ + httpRequest: Schema$HttpRequest; + /** + * Optional. A unique identifier for the log entry. If you provide a value, + * then Stackdriver Logging considers other log entries in the same project, + * with the same timestamp, and with the same insert_id to be duplicates + * which can be removed. If omitted in new log entries, then Stackdriver + * Logging assigns its own unique identifier. The insert_id is also used to + * order log entries that have the same timestamp value. + */ + insertId: string; + /** + * The log entry payload, represented as a structure that is expressed as a + * JSON object. + */ + jsonPayload: any; + /** + * Optional. A set of user-defined (key, value) data that provides + * additional information about the log entry. + */ + labels: any; + /** + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may + * optionally be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the log_name + * field will contain PROJECT_ID in queries and exports.[LOG_ID] must be + * URL-encoded within log_name. Example: + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * [LOG_ID] must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period.For backward compatibility, + * if log_name begins with a forward-slash, such as /projects/..., then the + * log entry is ingested as usual but the forward-slash is removed. Listing + * the log entry will not show the leading slash and filtering for a log + * name with a leading slash will never return any results. + */ + logName: string; + /** + * Optional. Information about an operation associated with the log entry, + * if applicable. + */ + operation: Schema$LogEntryOperation; + /** + * The log entry payload, represented as a protocol buffer. Some Google + * Cloud Platform services use this field for their log entry payloads. + */ + protoPayload: any; + /** + * Output only. The time the log entry was received by Stackdriver Logging. + */ + receiveTimestamp: string; + /** + * Required. The primary monitored resource associated with this log entry. + * Example: a log entry that reports a database error would be associated + * with the monitored resource designating the particular database that + * reported the error. + */ + resource: Schema$MonitoredResource; + /** + * Optional. The severity of the log entry. The default value is + * LogSeverity.DEFAULT. + */ + severity: string; + /** + * Optional. Source code location information associated with the log entry, + * if any. + */ + sourceLocation: Schema$LogEntrySourceLocation; + /** + * Optional. The span ID within the trace associated with the log entry. For + * Stackdriver Trace spans, this is the same format that the Stackdriver + * Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte + * array, such as <code>"000000000000004a"</code>. + */ + spanId: string; + /** + * The log entry payload, represented as a Unicode string (UTF-8). + */ + textPayload: string; + /** + * Optional. The time the event described by the log entry occurred. This + * time is used to compute the log entry's age and to enforce the logs + * retention period. If this field is omitted in a new log entry, then + * Stackdriver Logging assigns it the current time.Incoming log entries + * should have timestamps that are no more than the logs retention period in + * the past, and no more than 24 hours in the future. Log entries outside + * those time boundaries will not be available when calling entries.list, + * but those log entries can still be exported with LogSinks. + */ + timestamp: string; + /** + * Optional. Resource name of the trace associated with the log entry, if + * any. If it contains a relative resource name, the name is assumed to be + * relative to //tracing.googleapis.com. Example: + * projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 + */ + trace: string; } - - getRoot() { - return this.root; + /** + * Additional information about a potentially long-running operation with + * which a log entry is associated. + */ + export interface Schema$LogEntryOperation { + /** + * Optional. Set this to True if this is the first log entry in the + * operation. + */ + first: boolean; + /** + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + */ + id: string; + /** + * Optional. Set this to True if this is the last log entry in the + * operation. + */ + last: boolean; + /** + * Optional. An arbitrary producer identifier. The combination of id and + * producer must be globally unique. Examples for producer: + * "MyDivision.MyBigCompany.com", + * "github.com/MyProject/MyApplication". + */ + producer: string; } - - /** - * logging.projects.exclusions.create - * @desc Creates a new exclusion in a specified parent resource. Only log - * entries belonging to that resource can be excluded. You can have up to 10 - * exclusions in a resource. - * @alias logging.projects.exclusions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Additional information about the source code location that produced the log + * entry. + */ + export interface Schema$LogEntrySourceLocation { + /** + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + */ + file: string; + /** + * Optional. Human-readable name of the function or method being invoked, + * with optional context such as the class or package name. This information + * may be used in contexts such as the logs viewer, where a file and line + * number are less meaningful. The format can vary by language. For example: + * qual.if.ied.Class.method (Java), dir/package.func (Go), function + * (Python). + */ + function: string; + /** + * Optional. Line within the source file. 1-based; 0 indicates no line + * number available. + */ + line: string; } - - /** - * logging.projects.exclusions.delete - * @desc Deletes an exclusion. - * @alias logging.projects.exclusions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies a set of log entries that are not to be stored in Stackdriver + * Logging. If your project receives a large volume of logs, you might be able + * to use exclusions to reduce your chargeable logs. Exclusions are processed + * after log sinks, so you can export log entries before they are excluded. + * Audit log entries and log entries from Amazon Web Services are never + * excluded. + */ + export interface Schema$LogExclusion { + /** + * Optional. A description of this exclusion. + */ + description: string; + /** + * Optional. If set to True, then this exclusion is disabled and it does not + * exclude any log entries. You can use exclusions.patch to change the value + * of this field. + */ + disabled: boolean; + /** + * Required. An advanced logs filter that matches the log entries to be + * excluded. By using the sample function, you can exclude less than 100% of + * the matching log entries. For example, the following filter matches 99% + * of low-severity log entries from load balancers: + * "resource.type=http_load_balancer severity<ERROR sample(insertId, + * 0.99)" + */ + filter: string; + /** + * Required. A client-assigned identifier, such as + * "load-balancer-exclusion". Identifiers are limited to 100 + * characters and can include only letters, digits, underscores, hyphens, + * and periods. + */ + name: string; } - - /** - * logging.projects.exclusions.get - * @desc Gets the description of an exclusion. - * @alias logging.projects.exclusions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Application log line emitted while processing a request. + */ + export interface Schema$LogLine { + /** + * App-provided log message. + */ + logMessage: string; + /** + * Severity of this log entry. + */ + severity: string; + /** + * Where in the source code this log message was written. + */ + sourceLocation: Schema$SourceLocation; + /** + * Approximate time when this log entry was made. + */ + time: string; } - - /** - * logging.projects.exclusions.list - * @desc Lists all the exclusions in a parent resource. - * @alias logging.projects.exclusions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/exclusions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Describes a logs-based metric. The value of the metric is the number of log + * entries that match a logs filter in a given time interval.Logs-based metric + * can also be used to extract values from logs and create a a distribution of + * the values. The distribution records the statistics of the extracted values + * along with an optional histogram of the values as specified by the bucket + * options. + */ + export interface Schema$LogMetric { + /** + * Optional. The bucket_options are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + */ + bucketOptions: Schema$BucketOptions; + /** + * Optional. A description of this metric, which is used in documentation. + */ + description: string; + /** + * Required. An advanced logs filter which is used to match log entries. + * Example: "resource.type=gae_app AND severity>=ERROR" The + * maximum length of the filter is 20000 characters. + */ + filter: string; + /** + * Optional. A map from a label key string to an extractor expression which + * is used to extract data from a log entry field and assign as the label + * value. Each label key specified in the LabelDescriptor must have an + * associated extractor expression in this map. The syntax of the extractor + * expression is the same as for the value_extractor field.The extracted + * value is converted to the type defined in the label descriptor. If the + * either the extraction or the type conversion fails, the label will have a + * default value. The default value for a string label is an empty string, + * for an integer label its 0, and for a boolean label its false.Note that + * there are upper bounds on the maximum number of labels and the number of + * active time series that are allowed in a project. + */ + labelExtractors: any; + /** + * Optional. The metric descriptor associated with the logs-based metric. If + * unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such + * a metric counts the number of log entries matching the filter + * expression.The name, type, and description fields in the + * metric_descriptor are output only, and is constructed using the name and + * description field in the LogMetric.To create a logs-based metric that + * records a distribution of log values, a DELTA metric kind with a + * DISTRIBUTION value type must be used along with a value_extractor + * expression in the LogMetric.Each label in the metric descriptor must have + * a matching label name as the key and an extractor expression as the value + * in the label_extractors map.The metric_kind and value_type fields in the + * metric_descriptor cannot be updated once initially configured. New labels + * can be added in the metric_descriptor, but existing labels cannot be + * modified except for their description. + */ + metricDescriptor: Schema$MetricDescriptor; + /** + * Required. The client-assigned metric identifier. Examples: + * "error_count", "nginx/requests".Metric identifiers + * are limited to 100 characters and can include only the following + * characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. + * The forward-slash character (/) denotes a hierarchy of name pieces, and + * it cannot be the first character of the name.The metric identifier in + * this field must not be URL-encoded + * (https://en.wikipedia.org/wiki/Percent-encoding). However, when the + * metric identifier appears as the [METRIC_ID] part of a metric_name API + * parameter, then the metric identifier must be URL-encoded. Example: + * "projects/my-project/metrics/nginx%2Frequests". + */ + name: string; + /** + * Optional. A value_extractor is required when using a distribution + * logs-based metric to extract the values to record from a log entry. Two + * functions are supported for value extraction: EXTRACT(field) or + * REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of + * the log entry field from which the value is to be extracted. 2. regex: + * A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture group + * to extract data from the specified log entry field. The value of the + * field is converted to a string before applying the regex. It is an error + * to specify a regex that does not include exactly one capture group.The + * result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution.Example: REGEXP_EXTRACT(jsonPayload.request, + * ".*quantity=(\d+).*") + */ + valueExtractor: string; + /** + * Deprecated. The API version that created or updated this metric. The v2 + * format is used by default and cannot be changed. + */ + version: string; } - - /** - * logging.projects.exclusions.patch - * @desc Changes one or more properties of an existing exclusion. - * @alias logging.projects.exclusions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". - * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". - * @param {().LogExclusion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Describes a sink used to export log entries to one of the following + * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or + * a Cloud Pub/Sub topic. A logs filter controls which log entries are + * exported. The sink must be created within a project, organization, billing + * account, or folder. + */ + export interface Schema$LogSink { + /** + * Required. The export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's writer_identity, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see Exporting Logs With Sinks. + */ + destination: string; + /** + * Deprecated. This field is ignored when creating or updating sinks. + */ + endTime: string; + /** + * Optional. An advanced logs filter. The only exported log entries are + * those that are in the resource owning the sink and that match the filter. + * For example: logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND + * severity>=ERROR + */ + filter: string; + /** + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is + * true, then logs from all the projects, folders, and billing accounts + * contained in the sink's parent resource are also available for + * export. Whether a particular log entry from the children is exported + * depends on the sink's filter expression. For example, if this field + * is true, then the filter resource.type=gce_instance would export all + * Compute Engine VM instance log entries from all projects in the + * sink's parent. To only export entries from certain child projects, + * filter on the project part of the log name: + * logName:("projects/test-project1/" OR + * "projects/test-project2/") AND resource.type=gce_instance + */ + includeChildren: boolean; + /** + * Required. The client-assigned sink identifier, unique within the project. + * Example: "my-syslog-errors-to-pubsub". Sink identifiers are + * limited to 100 characters and can include only the following characters: + * upper and lower-case alphanumeric characters, underscores, hyphens, and + * periods. + */ + name: string; + /** + * Deprecated. The log entry format to use for this sink's exported log + * entries. The v2 format is used by default and cannot be changed. + */ + outputVersionFormat: string; + /** + * Deprecated. This field is ignored when creating or updating sinks. + */ + startTime: string; + /** + * Output only. An IAM identity&mdash;a service account or + * group&mdash;under which Stackdriver Logging writes the exported log + * entries to the sink's destination. This field is set by sinks.create + * and sinks.update, based on the setting of unique_writer_identity in those + * methods.Until you grant this identity write-access to the destination, + * log entry exports from this sink will fail. For more information, see + * Granting access for a resource. Consult the destination service's + * documentation to determine the appropriate IAM roles to assign to the + * identity. + */ + writerIdentity: string; } -} - -export class Resource$Projects$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * appengine.googleapis.com/http/server/response_latencies metric type has a + * label for the HTTP response code, response_code, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of metric_kind and value_type might not be supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * custom.googleapis.com. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are + * a subset of The Unified Code for Units of Measure + * (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit + * By byte s second min minute h hour d dayPrefixes (PREFIX) k kilo (10**3) + * M mega (10**6) G giga (10**9) T tera (10**12) P peta (10**15) E exa + * (10**18) Z zetta (10**21) Y yotta (10**24) m milli (10**-3) u micro + * (10**-6) n nano (10**-9) p pico (10**-12) f femto (10**-15) a atto + * (10**-18) z zepto (10**-21) y yocto (10**-24) Ki kibi (2**10) Mi mebi + * (2**20) Gi gibi (2**30) Ti tebi (2**40)GrammarThe grammar also includes + * these connectors: / division (as an infix operator, e.g. 1/s). . + * multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit + * is as follows: Expression = Component { "." Component } { + * "/" Component } ; Component = ( [ PREFIX ] UNIT | + * "%" ) [ Annotation ] | Annotation | + * "1" ; Annotation = "{" NAME "}" + * ; Notes: Annotation is just a comment if it follows a UNIT and is + * equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, + * By{transmitted}/s == By/s. NAME is a sequence of non-blank printable + * ASCII characters not containing '{' or '}'. 1 represents + * dimensionless value 1, such as in 1/s. % represents dimensionless value + * 1/100, and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of metric_kind and value_type might not be supported. + */ + valueType: string; } - - getRoot() { - return this.root; + /** + * An object representing a resource that can be used for monitoring, logging, + * billing, or other purposes. Examples include virtual machine instances, + * databases, and storage devices such as disks. The type field identifies a + * MonitoredResourceDescriptor object that describes the resource's + * schema. Information in the labels field identifies the actual resource and + * its attributes according to the schema. For example, a particular Compute + * Engine VM instance could be represented by the following object, because + * the MonitoredResourceDescriptor for "gce_instance" has labels + * "instance_id" and "zone": { "type": + * "gce_instance", "labels": { "instance_id": + * "12345678901234", "zone": + * "us-central1-a" }} + */ + export interface Schema$MonitoredResource { + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels "project_id", "instance_id", and + * "zone". + */ + labels: any; + /** + * Required. The monitored resource type. This field must match the type + * field of a MonitoredResourceDescriptor object. For example, the type of a + * Compute Engine VM instance is gce_instance. + */ + type: string; } - - /** - * logging.projects.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @alias logging.projects.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * "gce_instance" and specifies the use of the labels + * "instance_id" and "zone" to identify particular VM + * instances.Different APIs can support different monitored resource types. + * APIs generally provide a list method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, "Google Cloud + * SQL Database". + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels "database_id" and + * "zone". + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * "projects/{project_id}/monitoredResourceDescriptors/{type}" + * where {type} is the value of the type field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format "monitoredResourceDescriptors/{type}". + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * "cloudsql_database" represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; } - - /** - * logging.projects.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @alias logging.projects.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/logs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Complete log information about a single HTTP request to an App Engine + * application. + */ + export interface Schema$RequestLog { + /** + * App Engine release version. + */ + appEngineRelease: string; + /** + * Application that handled this request. + */ + appId: string; + /** + * An indication of the relative cost of serving this request. + */ + cost: number; + /** + * Time when the request finished. + */ + endTime: string; + /** + * Whether this request is finished or active. + */ + finished: boolean; + /** + * Whether this is the first RequestLog entry for this request. If an active + * request has several RequestLog entries written to Stackdriver Logging, + * then this field will be set for one of them. + */ + first: boolean; + /** + * Internet host and port number of the resource being requested. + */ + host: string; + /** + * HTTP version of request. Example: "HTTP/1.1". + */ + httpVersion: string; + /** + * An identifier for the instance that handled the request. + */ + instanceId: string; + /** + * If the instance processing this request belongs to a manually scaled + * module, then this is the 0-based index of the instance. Otherwise, this + * value is -1. + */ + instanceIndex: number; + /** + * Origin IP address. + */ + ip: string; + /** + * Latency of the request. + */ + latency: string; + /** + * A list of log lines emitted by the application while serving this + * request. + */ + line: Schema$LogLine[]; + /** + * Number of CPU megacycles used to process request. + */ + megaCycles: string; + /** + * Request method. Example: "GET", "HEAD", + * "PUT", "POST", "DELETE". + */ + method: string; + /** + * Module of the application that handled this request. + */ + moduleId: string; + /** + * The logged-in user who made the request.Most likely, this is the part of + * the user's email before the @ sign. The field value is the same for + * different requests from the same user, but different users can have + * similar names. This information is also available to the application via + * the App Engine Users API.This field will be populated starting with App + * Engine 1.9.21. + */ + nickname: string; + /** + * Time this request spent in the pending request queue. + */ + pendingTime: string; + /** + * Referrer URL of request. + */ + referrer: string; + /** + * Globally unique identifier for a request, which is based on the request + * start time. Request IDs for requests which started later will compare + * greater as strings than those for requests which started earlier. + */ + requestId: string; + /** + * Contains the path and query portion of the URL that was requested. For + * example, if the URL was "http://example.com/app?name=val", the + * resource would be "/app?name=val". The fragment identifier, + * which is identified by the # character, is not included. + */ + resource: string; + /** + * Size in bytes sent back to client by request. + */ + responseSize: string; + /** + * Source code for the application that handled this request. There can be + * more than one source reference per deployed application if source code is + * distributed among multiple repositories. + */ + sourceReference: Schema$SourceReference[]; + /** + * Time when the request started. + */ + startTime: string; + /** + * HTTP response status code. Example: 200, 404. + */ + status: number; + /** + * Task name of the request, in the case of an offline request. + */ + taskName: string; + /** + * Queue name of the request, in the case of an offline request. + */ + taskQueueName: string; + /** + * Stackdriver Trace identifier for this request. + */ + traceId: string; + /** + * File or class that handled the request. + */ + urlMapEntry: string; + /** + * User agent that made the request. + */ + userAgent: string; + /** + * Version of the application that handled this request. + */ + versionId: string; + /** + * Whether this was a loading request for the instance. + */ + wasLoadingRequest: boolean; } -} - -export class Resource$Projects$Metrics { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * Specifies a location in a source code file. + */ + export interface Schema$SourceLocation { + /** + * Source file name. Depending on the runtime environment, this might be a + * simple name or a fully-qualified name. + */ + file: string; + /** + * Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information is + * used in contexts such as the logs viewer, where a file and line number + * are less meaningful. The format can vary by language. For example: + * qual.if.ied.Class.method (Java), dir/package.func (Go), function + * (Python). + */ + functionName: string; + /** + * Line within the source file. + */ + line: string; } - - getRoot() { - return this.root; + /** + * A reference to a particular snapshot of the source tree used to build and + * deploy an application. + */ + export interface Schema$SourceReference { + /** + * Optional. A URI string identifying the repository. Example: + * "https://github.com/GoogleCloudPlatform/kubernetes.git" + */ + repository: string; + /** + * The canonical and persistent identifier of the deployed revision. Example + * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + */ + revisionId: string; } - - /** - * logging.projects.metrics.create - * @desc Creates a logs-based metric. - * @alias logging.projects.metrics.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request. - * @param {().LogMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The parameters to WriteLogEntries. + */ + export interface Schema$WriteLogEntriesRequest { + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether + * the logging API endpoints are working properly before sending valuable + * data. + */ + dryRun: boolean; + /** + * Required. The log entries to send to Stackdriver Logging. The order of + * log entries in this list does not matter. Values supplied in this + * method's log_name, resource, and labels fields are copied into those + * log entries in this list that do not include values for their + * corresponding fields. For more information, see the LogEntry type.If the + * timestamp or insert_id fields are missing in log entries, then this + * method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did + * not supply their own values, the entries earlier in the list will sort + * before the entries later in the list. See the entries.list method.Log + * entries with timestamps that are more than the logs retention period in + * the past or more than 24 hours in the future will not be available when + * calling entries.list. However, those log entries can still be exported + * with LogSinks.To improve throughput and to avoid exceeding the quota + * limit for calls to entries.write, you should try to include several log + * entries in this list, rather than calling this method for each individual + * log entry. + */ + entries: Schema$LogEntry[]; + /** + * Optional. Default labels that are added to the labels field of all log + * entries in entries. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not + * changed. See LogEntry. + */ + labels: any; + /** + * Optional. A default log resource name that is assigned to all log entries + * in entries that do not specify a value for log_name: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be + * URL-encoded. For example, "projects/my-project-id/logs/syslog" + * or + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * For more information about log names, see LogEntry. + */ + logName: string; + /** + * Optional. Whether valid entries should be written even if some other + * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any + * entry is not written, then the response status is the error associated + * with one of the failed entries and the response includes error details + * keyed by the entries' zero-based index in the entries.write method. + */ + partialSuccess: boolean; + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in entries that do not specify a value for resource. Example: { + * "type": "gce_instance", "labels": { + * "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} See LogEntry. + */ + resource: Schema$MonitoredResource; } - - /** - * logging.projects.metrics.delete - * @desc Deletes a logs-based metric. - * @alias logging.projects.metrics.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Result returned from WriteLogEntries. empty */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export interface Schema$WriteLogEntriesResponse {} + + export class Resource$Billingaccounts { + root: Logging; + exclusions: Resource$Billingaccounts$Exclusions; + logs: Resource$Billingaccounts$Logs; + sinks: Resource$Billingaccounts$Sinks; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.exclusions = new Resource$Billingaccounts$Exclusions(root); + this.logs = new Resource$Billingaccounts$Logs(root); + this.sinks = new Resource$Billingaccounts$Sinks(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Billingaccounts$Exclusions { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.billingAccounts.exclusions.create + * @desc Creates a new exclusion in a specified parent resource. Only log + * entries belonging to that resource can be excluded. You can have up to 10 + * exclusions in a resource. + * @alias logging.billingAccounts.exclusions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.exclusions.delete + * @desc Deletes an exclusion. + * @alias logging.billingAccounts.exclusions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.exclusions.get + * @desc Gets the description of an exclusion. + * @alias logging.billingAccounts.exclusions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.exclusions.list + * @desc Lists all the exclusions in a parent resource. + * @alias logging.billingAccounts.exclusions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.exclusions.patch + * @desc Changes one or more properties of an existing exclusion. + * @alias logging.billingAccounts.exclusions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.metrics.get - * @desc Gets a logs-based metric. - * @alias logging.projects.metrics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Billingaccounts$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.billingAccounts.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @alias logging.billingAccounts.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @alias logging.billingAccounts.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.metrics.list - * @desc Lists logs-based metrics. - * @alias logging.projects.metrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The name of the project containing the metrics: "projects/[PROJECT_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+parent}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Billingaccounts$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.billingAccounts.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @alias logging.billingAccounts.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @alias logging.billingAccounts.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.sinks.get + * @desc Gets a sink. + * @alias logging.billingAccounts.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.sinks.list + * @desc Lists sinks. + * @alias logging.billingAccounts.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.sinks.patch + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.billingAccounts.sinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.billingAccounts.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.billingAccounts.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * logging.projects.metrics.update - * @desc Creates or updates a logs-based metric. - * @alias logging.projects.metrics.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. - * @param {().LogMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Entries { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.entries.list + * @desc Lists log entries. Use this method to retrieve log entries from + * Stackdriver Logging. For ways to export log entries, see Exporting Logs. + * @alias logging.entries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ListLogEntriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/entries:list').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.entries.write + * @desc Writes log entries to Stackdriver Logging. This API method is the + * only way to send log entries to Stackdriver Logging. This method is used, + * directly or indirectly, by the Stackdriver Logging agent (fluentd) and + * all logging libraries configured to use Stackdriver Logging. A single + * request may contain log entries for a maximum of 1000 different resources + * (projects, organizations, billing accounts or folders) + * @alias logging.entries.write + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().WriteLogEntriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + write(params?: any, options?: MethodOptions): + AxiosPromise; + write( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + write( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2/entries:write').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); } - getRoot() { - return this.root; + export class Resource$Exclusions { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.exclusions.create + * @desc Creates a new exclusion in a specified parent resource. Only log + * entries belonging to that resource can be excluded. You can have up to 10 + * exclusions in a resource. + * @alias logging.exclusions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.exclusions.delete + * @desc Deletes an exclusion. + * @alias logging.exclusions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.exclusions.get + * @desc Gets the description of an exclusion. + * @alias logging.exclusions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.exclusions.list + * @desc Lists all the exclusions in a parent resource. + * @alias logging.exclusions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.exclusions.patch + * @desc Changes one or more properties of an existing exclusion. + * @alias logging.exclusions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * logging.projects.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @alias logging.projects.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Folders { + root: Logging; + exclusions: Resource$Folders$Exclusions; + logs: Resource$Folders$Logs; + sinks: Resource$Folders$Sinks; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.exclusions = new Resource$Folders$Exclusions(root); + this.logs = new Resource$Folders$Logs(root); + this.sinks = new Resource$Folders$Sinks(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Folders$Exclusions { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.folders.exclusions.create + * @desc Creates a new exclusion in a specified parent resource. Only log + * entries belonging to that resource can be excluded. You can have up to 10 + * exclusions in a resource. + * @alias logging.folders.exclusions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.exclusions.delete + * @desc Deletes an exclusion. + * @alias logging.folders.exclusions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.exclusions.get + * @desc Gets the description of an exclusion. + * @alias logging.folders.exclusions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.exclusions.list + * @desc Lists all the exclusions in a parent resource. + * @alias logging.folders.exclusions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.exclusions.patch + * @desc Changes one or more properties of an existing exclusion. + * @alias logging.folders.exclusions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @alias logging.projects.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Folders$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.folders.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @alias logging.folders.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @alias logging.folders.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.sinks.get - * @desc Gets a sink. - * @alias logging.projects.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Folders$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.folders.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @alias logging.folders.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @alias logging.folders.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.sinks.get + * @desc Gets a sink. + * @alias logging.folders.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.sinks.list + * @desc Lists sinks. + * @alias logging.folders.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.sinks.patch + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.folders.sinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.folders.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.folders.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * logging.projects.sinks.list - * @desc Lists sinks. - * @alias logging.projects.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @alias logging.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @alias logging.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.sinks.patch - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.projects.sinks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Monitoredresourcedescriptors { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.monitoredResourceDescriptors.list + * @desc Lists the descriptors for monitored resource types used by + * Stackdriver Logging. + * @alias logging.monitoredResourceDescriptors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/monitoredResourceDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListMonitoredResourceDescriptorsResponse>(parameters); + } } } - - /** - * logging.projects.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.projects.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Organizations { + root: Logging; + exclusions: Resource$Organizations$Exclusions; + logs: Resource$Organizations$Logs; + sinks: Resource$Organizations$Sinks; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.exclusions = new Resource$Organizations$Exclusions(root); + this.logs = new Resource$Organizations$Logs(root); + this.sinks = new Resource$Organizations$Sinks(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Organizations$Exclusions { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.organizations.exclusions.create + * @desc Creates a new exclusion in a specified parent resource. Only log + * entries belonging to that resource can be excluded. You can have up to 10 + * exclusions in a resource. + * @alias logging.organizations.exclusions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.exclusions.delete + * @desc Deletes an exclusion. + * @alias logging.organizations.exclusions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.exclusions.get + * @desc Gets the description of an exclusion. + * @alias logging.organizations.exclusions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.exclusions.list + * @desc Lists all the exclusions in a parent resource. + * @alias logging.organizations.exclusions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.exclusions.patch + * @desc Changes one or more properties of an existing exclusion. + * @alias logging.organizations.exclusions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Organizations$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.organizations.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @alias logging.organizations.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @alias logging.organizations.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Organizations$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.organizations.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @alias logging.organizations.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @alias logging.organizations.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.sinks.get + * @desc Gets a sink. + * @alias logging.organizations.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.sinks.list + * @desc Lists sinks. + * @alias logging.organizations.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.sinks.patch + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.organizations.sinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.organizations.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.organizations.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * logging.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @alias logging.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Logging; + exclusions: Resource$Projects$Exclusions; + logs: Resource$Projects$Logs; + metrics: Resource$Projects$Metrics; + sinks: Resource$Projects$Sinks; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.exclusions = new Resource$Projects$Exclusions(root); + this.logs = new Resource$Projects$Logs(root); + this.metrics = new Resource$Projects$Metrics(root); + this.sinks = new Resource$Projects$Sinks(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Exclusions { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.projects.exclusions.create + * @desc Creates a new exclusion in a specified parent resource. Only log + * entries belonging to that resource can be excluded. You can have up to 10 + * exclusions in a resource. + * @alias logging.projects.exclusions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource in which to create the exclusion: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.exclusions.delete + * @desc Deletes an exclusion. + * @alias logging.projects.exclusions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion to delete: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.exclusions.get + * @desc Gets the description of an exclusion. + * @alias logging.projects.exclusions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of an existing exclusion: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.exclusions.list + * @desc Lists all the exclusions in a parent resource. + * @alias logging.projects.exclusions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose exclusions are to be listed. "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/exclusions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.exclusions.patch + * @desc Changes one or more properties of an existing exclusion. + * @alias logging.projects.exclusions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the exclusion to update: "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]" "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]" "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example: "projects/my-project-id/exclusions/my-exclusion-id". + * @param {string=} params.updateMask Required. A nonempty list of fields to change in the existing exclusion. New values for the fields are taken from the corresponding fields in the LogExclusion included in this request. Fields not mentioned in update_mask are not changed and are ignored in the request.For example, to change the filter and description of an exclusion, specify an update_mask of "filter,description". + * @param {().LogExclusion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @alias logging.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.projects.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @alias logging.projects.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+logName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @alias logging.projects.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.sinks.get - * @desc Gets a sink. - * @alias logging.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Metrics { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.projects.metrics.create + * @desc Creates a logs-based metric. + * @alias logging.projects.metrics.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request. + * @param {().LogMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.metrics.delete + * @desc Deletes a logs-based metric. + * @alias logging.projects.metrics.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.metrics.get + * @desc Gets a logs-based metric. + * @alias logging.projects.metrics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.metrics.list + * @desc Lists logs-based metrics. + * @alias logging.projects.metrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The name of the project containing the metrics: "projects/[PROJECT_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.metrics.update + * @desc Creates or updates a logs-based metric. + * @alias logging.projects.metrics.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. + * @param {().LogMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2/{+metricName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.sinks.list - * @desc Lists sinks. - * @alias logging.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2/{+parent}/sinks').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.projects.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @alias logging.projects.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @alias logging.projects.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.sinks.get + * @desc Gets a sink. + * @alias logging.projects.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.sinks.list + * @desc Lists sinks. + * @alias logging.projects.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.sinks.patch + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.projects.sinks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.projects.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.projects.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * logging.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @alias logging.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * logging.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @alias logging.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @alias logging.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.sinks.get + * @desc Gets a sink. + * @alias logging.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.sinks.list + * @desc Lists sinks. + * @alias logging.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * logging.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @alias logging.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/{+sinkName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/logging/v2beta1.ts b/src/apis/logging/v2beta1.ts index bc21fe2e9b3..71ccec0fa0b 100644 --- a/src/apis/logging/v2beta1.ts +++ b/src/apis/logging/v2beta1.ts @@ -27,3489 +27,3539 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Logging API - * - * Writes log entries and manages your Stackdriver Logging configuration. - * - * @example - * const google = require('googleapis'); - * const logging = google.logging('v2beta1'); - * - * @namespace logging - * @type {Function} - * @version v2beta1 - * @variation v2beta1 - * @param {object=} options Options for Logging - */ -export class Logging { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - billingAccounts: Resource$Billingaccounts; - entries: Resource$Entries; - monitoredResourceDescriptors: Resource$Monitoredresourcedescriptors; - organizations: Resource$Organizations; - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.billingAccounts = new Resource$Billingaccounts(this); - this.entries = new Resource$Entries(this); - this.monitoredResourceDescriptors = - new Resource$Monitoredresourcedescriptors(this); - this.organizations = new Resource$Organizations(this); - this.projects = new Resource$Projects(this); - } +export namespace logging_v2beta1 { + /** + * Stackdriver Logging API + * + * Writes log entries and manages your Stackdriver Logging configuration. + * + * @example + * const google = require('googleapis'); + * const logging = google.logging('v2beta1'); + * + * @namespace logging + * @type {Function} + * @version v2beta1 + * @variation v2beta1 + * @param {object=} options Options for Logging + */ + export class Logging { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + billingAccounts: Resource$Billingaccounts; + entries: Resource$Entries; + monitoredResourceDescriptors: Resource$Monitoredresourcedescriptors; + organizations: Resource$Organizations; + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.billingAccounts = new Resource$Billingaccounts(this); + this.entries = new Resource$Entries(this); + this.monitoredResourceDescriptors = + new Resource$Monitoredresourcedescriptors(this); + this.organizations = new Resource$Organizations(this); + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * BucketOptions describes the bucket boundaries used to create a histogram for - * the distribution. The buckets can be in a linear sequence, an exponential - * sequence, or each bucket can be specified explicitly. BucketOptions does not - * include the number of values in each bucket.A bucket has an inclusive lower - * bound and exclusive upper bound for the values that are counted for that - * bucket. The upper bound of a bucket must be strictly greater than the lower - * bound. The sequence of N buckets for a distribution consists of an underflow - * bucket (number 0), zero or more finite buckets (number 1 through N - 2) and - * an overflow bucket (number N - 1). The buckets are contiguous: the lower - * bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. - * The buckets span the whole range of finite values: lower bound of the - * underflow bucket is -infinity and the upper bound of the overflow bucket is - * +infinity. The finite buckets are so-called because both bounds are finite. - */ -export interface Schema$BucketOptions { - /** - * The explicit buckets. - */ - explicitBuckets: Schema$Explicit; - /** - * The exponential buckets. - */ - exponentialBuckets: Schema$Exponential; - /** - * The linear bucket. - */ - linearBuckets: Schema$Linear; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 - * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i - * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds - * field must contain at least one element. If bounds has only one element, then - * there are no finite buckets, and that single element is the common boundary - * of the overflow and underflow buckets. - */ -export interface Schema$Explicit { - /** - * The values must be monotonically increasing. - */ - bounds: number[]; -} -/** - * Specifies an exponential sequence of buckets that have a width that is - * proportional to the value of the lower bound. Each bucket represents a - * constant relative uncertainty on a specific value in the bucket.There are - * num_finite_buckets + 2 (= N) buckets. Bucket i has the following - * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). - */ -export interface Schema$Exponential { - /** - * Must be greater than 1. - */ - growthFactor: number; - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Must be greater than 0. - */ - scale: number; -} -/** - * A common proto for logging HTTP requests. Only contains semantics defined by - * the HTTP specification. Product-specific logging information MUST be defined - * in a separate message. - */ -export interface Schema$HttpRequest { - /** - * The number of HTTP response bytes inserted into cache. Set only when a - * cache fill was attempted. - */ - cacheFillBytes: string; - /** - * Whether or not an entity was served from cache (with or without - * validation). - */ - cacheHit: boolean; - /** - * Whether or not a cache lookup was attempted. - */ - cacheLookup: boolean; - /** - * Whether or not the response was validated with the origin server before - * being served from cache. This field is only meaningful if cache_hit is - * True. - */ - cacheValidatedWithOriginServer: boolean; - /** - * The request processing latency on the server, from the time the request was - * received until the response was sent. - */ - latency: string; - /** - * Protocol used for the request. Examples: "HTTP/1.1", - * "HTTP/2", "websocket" - */ - protocol: string; - /** - * The referer URL of the request, as defined in HTTP/1.1 Header Field - * Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). - */ - referer: string; - /** - * The IP address (IPv4 or IPv6) of the client that issued the HTTP request. - * Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". - */ - remoteIp: string; - /** - * The request method. Examples: "GET", "HEAD", - * "PUT", "POST". - */ - requestMethod: string; - /** - * The size of the HTTP request message in bytes, including the request - * headers and the request body. - */ - requestSize: string; - /** - * The scheme (http, https), the host name, the path and the query portion of - * the URL that was requested. Example: - * "http://example.com/some/info?color=red". - */ - requestUrl: string; - /** - * The size of the HTTP response message sent back to the client, in bytes, - * including the response headers and the response body. - */ - responseSize: string; - /** - * The IP address (IPv4 or IPv6) of the origin server that the request was - * sent to. - */ - serverIp: string; - /** - * The response code indicating the status of response. Examples: 200, 404. - */ - status: number; - /** - * The user agent sent by the client. Example: "Mozilla/4.0 (compatible; - * MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". - */ - userAgent: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * Specifies a linear sequence of buckets that all have the same width (except - * overflow and underflow). Each bucket represents a constant absolute - * uncertainty on the specific value in the bucket.There are num_finite_buckets - * + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= - * i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + - * (width * (i - 1)). - */ -export interface Schema$Linear { - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Lower bound of the first bucket. - */ - offset: number; - /** - * Must be greater than 0. - */ - width: number; -} -/** - * The parameters to ListLogEntries. - */ -export interface Schema$ListLogEntriesRequest { - /** - * Optional. A filter that chooses which log entries to return. See Advanced - * Logs Filters. Only log entries that match the filter are returned. An empty - * filter matches all log entries in the resources listed in resource_names. - * Referencing a parent resource that is not listed in resource_names will - * cause the filter to return no results. The maximum length of the filter is - * 20000 characters. - */ - filter: string; - /** - * Optional. How the results should be sorted. Presently, the only permitted - * values are "timestamp asc" (default) and "timestamp - * desc". The first option returns entries in order of increasing values - * of LogEntry.timestamp (oldest first), and the second option returns entries - * in order of decreasing timestamps (newest first). Entries with equal - * timestamps are returned in order of their insert_id values. - */ - orderBy: string; - /** - * Optional. The maximum number of results to return from this request. - * Non-positive values are ignored. The presence of next_page_token in the - * response indicates that more results might be available. - */ - pageSize: number; - /** - * Optional. If present, then retrieve the next batch of results from the - * preceding call to this method. page_token must be the value of - * next_page_token from the previous response. The values of other method - * parameters should be identical to those in the previous call. - */ - pageToken: string; - /** - * Deprecated. Use resource_names instead. One or more project identifiers or - * project numbers from which to retrieve log entries. Example: - * "my-project-1A". If present, these project identifiers are - * converted to resource name format and added to the list of resources in - * resource_names. - */ - projectIds: string[]; - /** - * Required. Names of one or more parent resources from which to retrieve log - * entries: "projects/[PROJECT_ID]" - * "organizations/[ORGANIZATION_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]" - * "folders/[FOLDER_ID]" Projects listed in the project_ids field - * are added to this list. - */ - resourceNames: string[]; -} -/** - * Result returned from ListLogEntries. - */ -export interface Schema$ListLogEntriesResponse { - /** - * A list of log entries. If entries is empty, nextPageToken may still be - * returned, indicating that more entries may exist. See nextPageToken for - * more information. - */ - entries: Schema$LogEntry[]; - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken.If a value for - * next_page_token appears and the entries field is empty, it means that the - * search found no log entries so far but it did not have time to search all - * the possible log entries. Retry the method with this value for page_token - * to continue the search. Alternatively, consider speeding up the search by - * changing your filter to specify a single log name or resource type, or to - * narrow the time range of the search. - */ - nextPageToken: string; -} -/** - * Result returned from ListLogMetrics. - */ -export interface Schema$ListLogMetricsResponse { - /** - * A list of logs-based metrics. - */ - metrics: Schema$LogMetric[]; - /** - * If there might be more results than appear in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; -} -/** - * Result returned from ListLogs. - */ -export interface Schema$ListLogsResponse { - /** - * A list of log names. For example, "projects/my-project/syslog" or - * "organizations/123/cloudresourcemanager.googleapis.com%2Factivity". - */ - logNames: string[]; - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; -} -/** - * Result returned from ListMonitoredResourceDescriptors. - */ -export interface Schema$ListMonitoredResourceDescriptorsResponse { - /** - * If there might be more results than those appearing in this response, then - * nextPageToken is included. To get the next set of results, call this method - * again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; - /** - * A list of resource descriptors. - */ - resourceDescriptors: Schema$MonitoredResourceDescriptor[]; -} -/** - * Result returned from ListSinks. - */ -export interface Schema$ListSinksResponse { - /** - * If there might be more results than appear in this response, then - * nextPageToken is included. To get the next set of results, call the same - * method again using the value of nextPageToken as pageToken. - */ - nextPageToken: string; - /** - * A list of sinks. - */ - sinks: Schema$LogSink[]; -} -/** - * An individual entry in a log. - */ -export interface Schema$LogEntry { - /** - * Optional. Information about the HTTP request associated with this log - * entry, if applicable. - */ - httpRequest: Schema$HttpRequest; - /** - * Optional. A unique identifier for the log entry. If you provide a value, - * then Stackdriver Logging considers other log entries in the same project, - * with the same timestamp, and with the same insert_id to be duplicates which - * can be removed. If omitted in new log entries, then Stackdriver Logging - * assigns its own unique identifier. The insert_id is also used to order log - * entries that have the same timestamp value. - */ - insertId: string; - /** - * The log entry payload, represented as a structure that is expressed as a - * JSON object. - */ - jsonPayload: any; - /** - * Optional. A set of user-defined (key, value) data that provides additional - * information about the log entry. - */ - labels: any; - /** - * Required. The resource name of the log to which this log entry belongs: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may - * optionally be used in place of PROJECT_ID. The project number is - * translated to its corresponding PROJECT_ID internally and the log_name - * field will contain PROJECT_ID in queries and exports.[LOG_ID] must be - * URL-encoded within log_name. Example: - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * [LOG_ID] must be less than 512 characters long and can only include the - * following characters: upper and lower case alphanumeric characters, - * forward-slash, underscore, hyphen, and period.For backward compatibility, - * if log_name begins with a forward-slash, such as /projects/..., then the - * log entry is ingested as usual but the forward-slash is removed. Listing - * the log entry will not show the leading slash and filtering for a log name - * with a leading slash will never return any results. - */ - logName: string; - /** - * Optional. Information about an operation associated with the log entry, if - * applicable. - */ - operation: Schema$LogEntryOperation; - /** - * The log entry payload, represented as a protocol buffer. Some Google Cloud - * Platform services use this field for their log entry payloads. - */ - protoPayload: any; - /** - * Output only. The time the log entry was received by Stackdriver Logging. - */ - receiveTimestamp: string; - /** - * Required. The primary monitored resource associated with this log entry. - * Example: a log entry that reports a database error would be associated with - * the monitored resource designating the particular database that reported - * the error. - */ - resource: Schema$MonitoredResource; - /** - * Optional. The severity of the log entry. The default value is - * LogSeverity.DEFAULT. - */ - severity: string; - /** - * Optional. Source code location information associated with the log entry, - * if any. - */ - sourceLocation: Schema$LogEntrySourceLocation; - /** - * Optional. The span ID within the trace associated with the log entry. For - * Stackdriver Trace spans, this is the same format that the Stackdriver Trace - * API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such - * as <code>"000000000000004a"</code>. - */ - spanId: string; - /** - * The log entry payload, represented as a Unicode string (UTF-8). - */ - textPayload: string; - /** - * Optional. The time the event described by the log entry occurred. This time - * is used to compute the log entry's age and to enforce the logs - * retention period. If this field is omitted in a new log entry, then - * Stackdriver Logging assigns it the current time.Incoming log entries should - * have timestamps that are no more than the logs retention period in the - * past, and no more than 24 hours in the future. Log entries outside those - * time boundaries will not be available when calling entries.list, but those - * log entries can still be exported with LogSinks. - */ - timestamp: string; - /** - * Optional. Resource name of the trace associated with the log entry, if any. - * If it contains a relative resource name, the name is assumed to be relative - * to //tracing.googleapis.com. Example: - * projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 - */ - trace: string; -} -/** - * Additional information about a potentially long-running operation with which - * a log entry is associated. - */ -export interface Schema$LogEntryOperation { - /** - * Optional. Set this to True if this is the first log entry in the operation. - */ - first: boolean; - /** - * Optional. An arbitrary operation identifier. Log entries with the same - * identifier are assumed to be part of the same operation. - */ - id: string; - /** - * Optional. Set this to True if this is the last log entry in the operation. - */ - last: boolean; - /** - * Optional. An arbitrary producer identifier. The combination of id and - * producer must be globally unique. Examples for producer: - * "MyDivision.MyBigCompany.com", - * "github.com/MyProject/MyApplication". - */ - producer: string; -} -/** - * Additional information about the source code location that produced the log - * entry. - */ -export interface Schema$LogEntrySourceLocation { - /** - * Optional. Source file name. Depending on the runtime environment, this - * might be a simple name or a fully-qualified name. - */ - file: string; - /** - * Optional. Human-readable name of the function or method being invoked, with - * optional context such as the class or package name. This information may be - * used in contexts such as the logs viewer, where a file and line number are - * less meaningful. The format can vary by language. For example: - * qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). - */ - function: string; - /** - * Optional. Line within the source file. 1-based; 0 indicates no line number - * available. - */ - line: string; -} -/** - * Application log line emitted while processing a request. - */ -export interface Schema$LogLine { - /** - * App-provided log message. - */ - logMessage: string; - /** - * Severity of this log entry. - */ - severity: string; - /** - * Where in the source code this log message was written. - */ - sourceLocation: Schema$SourceLocation; - /** - * Approximate time when this log entry was made. - */ - time: string; -} -/** - * Describes a logs-based metric. The value of the metric is the number of log - * entries that match a logs filter in a given time interval.Logs-based metric - * can also be used to extract values from logs and create a a distribution of - * the values. The distribution records the statistics of the extracted values - * along with an optional histogram of the values as specified by the bucket - * options. - */ -export interface Schema$LogMetric { - /** - * Optional. The bucket_options are required when the logs-based metric is - * using a DISTRIBUTION value type and it describes the bucket boundaries used - * to create a histogram of the extracted values. - */ - bucketOptions: Schema$BucketOptions; - /** - * Optional. A description of this metric, which is used in documentation. - */ - description: string; - /** - * Required. An advanced logs filter which is used to match log entries. - * Example: "resource.type=gae_app AND severity>=ERROR" The - * maximum length of the filter is 20000 characters. - */ - filter: string; - /** - * Optional. A map from a label key string to an extractor expression which is - * used to extract data from a log entry field and assign as the label value. - * Each label key specified in the LabelDescriptor must have an associated - * extractor expression in this map. The syntax of the extractor expression is - * the same as for the value_extractor field.The extracted value is converted - * to the type defined in the label descriptor. If the either the extraction - * or the type conversion fails, the label will have a default value. The - * default value for a string label is an empty string, for an integer label - * its 0, and for a boolean label its false.Note that there are upper bounds - * on the maximum number of labels and the number of active time series that - * are allowed in a project. - */ - labelExtractors: any; - /** - * Optional. The metric descriptor associated with the logs-based metric. If - * unspecified, it uses a default metric descriptor with a DELTA metric kind, - * INT64 value type, with no labels and a unit of "1". Such a metric - * counts the number of log entries matching the filter expression.The name, - * type, and description fields in the metric_descriptor are output only, and - * is constructed using the name and description field in the LogMetric.To - * create a logs-based metric that records a distribution of log values, a - * DELTA metric kind with a DISTRIBUTION value type must be used along with a - * value_extractor expression in the LogMetric.Each label in the metric - * descriptor must have a matching label name as the key and an extractor - * expression as the value in the label_extractors map.The metric_kind and - * value_type fields in the metric_descriptor cannot be updated once initially - * configured. New labels can be added in the metric_descriptor, but existing - * labels cannot be modified except for their description. - */ - metricDescriptor: Schema$MetricDescriptor; - /** - * Required. The client-assigned metric identifier. Examples: - * "error_count", "nginx/requests".Metric identifiers are - * limited to 100 characters and can include only the following characters: - * A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The - * forward-slash character (/) denotes a hierarchy of name pieces, and it - * cannot be the first character of the name.The metric identifier in this - * field must not be URL-encoded - * (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric - * identifier appears as the [METRIC_ID] part of a metric_name API parameter, - * then the metric identifier must be URL-encoded. Example: - * "projects/my-project/metrics/nginx%2Frequests". - */ - name: string; - /** - * Optional. A value_extractor is required when using a distribution - * logs-based metric to extract the values to record from a log entry. Two - * functions are supported for value extraction: EXTRACT(field) or - * REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of the - * log entry field from which the value is to be extracted. 2. regex: A - * regular expression using the Google RE2 syntax - * (https://github.com/google/re2/wiki/Syntax) with a single capture group to - * extract data from the specified log entry field. The value of the field is - * converted to a string before applying the regex. It is an error to specify - * a regex that does not include exactly one capture group.The result of the - * extraction must be convertible to a double type, as the distribution always - * records double values. If either the extraction or the conversion to double - * fails, then those values are not recorded in the distribution.Example: - * REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*") - */ - valueExtractor: string; - /** - * Deprecated. The API version that created or updated this metric. The v2 - * format is used by default and cannot be changed. - */ - version: string; -} -/** - * Describes a sink used to export log entries to one of the following - * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a - * Cloud Pub/Sub topic. A logs filter controls which log entries are exported. - * The sink must be created within a project, organization, billing account, or - * folder. - */ -export interface Schema$LogSink { - /** - * Required. The export destination: - * "storage.googleapis.com/[GCS_BUCKET]" - * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" - * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" - * The sink's writer_identity, set when the sink is created, must have - * permission to write to the destination or else the log entries are not - * exported. For more information, see Exporting Logs With Sinks. - */ - destination: string; /** - * Deprecated. This field is ignored when creating or updating sinks. - */ - endTime: string; - /** - * Optional. An advanced logs filter. The only exported log entries are those - * that are in the resource owning the sink and that match the filter. For - * example: logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND - * severity>=ERROR - */ - filter: string; - /** - * Optional. This field applies only to sinks owned by organizations and - * folders. If the field is false, the default, only the logs owned by the - * sink's parent resource are available for export. If the field is true, - * then logs from all the projects, folders, and billing accounts contained in - * the sink's parent resource are also available for export. Whether a - * particular log entry from the children is exported depends on the - * sink's filter expression. For example, if this field is true, then the - * filter resource.type=gce_instance would export all Compute Engine VM - * instance log entries from all projects in the sink's parent. To only - * export entries from certain child projects, filter on the project part of - * the log name: logName:("projects/test-project1/" OR - * "projects/test-project2/") AND resource.type=gce_instance - */ - includeChildren: boolean; - /** - * Required. The client-assigned sink identifier, unique within the project. - * Example: "my-syslog-errors-to-pubsub". Sink identifiers are - * limited to 100 characters and can include only the following characters: - * upper and lower-case alphanumeric characters, underscores, hyphens, and - * periods. - */ - name: string; - /** - * Deprecated. The log entry format to use for this sink's exported log - * entries. The v2 format is used by default and cannot be changed. - */ - outputVersionFormat: string; - /** - * Deprecated. This field is ignored when creating or updating sinks. - */ - startTime: string; - /** - * Output only. An IAM identity&mdash;a service account or - * group&mdash;under which Stackdriver Logging writes the exported log - * entries to the sink's destination. This field is set by sinks.create - * and sinks.update, based on the setting of unique_writer_identity in those - * methods.Until you grant this identity write-access to the destination, log - * entry exports from this sink will fail. For more information, see Granting - * access for a resource. Consult the destination service's documentation - * to determine the appropriate IAM roles to assign to the identity. - */ - writerIdentity: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * appengine.googleapis.com/http/server/response_latencies metric type has a - * label for the HTTP response code, response_code, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of metric_kind and value_type might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * custom.googleapis.com. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are a - * subset of The Unified Code for Units of Measure - * (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit - * By byte s second min minute h hour d dayPrefixes (PREFIX) k kilo (10**3) M - * mega (10**6) G giga (10**9) T tera (10**12) P peta (10**15) E exa (10**18) - * Z zetta (10**21) Y yotta (10**24) m milli (10**-3) u micro (10**-6) n nano - * (10**-9) p pico (10**-12) f femto (10**-15) a atto (10**-18) z zepto - * (10**-21) y yocto (10**-24) Ki kibi (2**10) Mi mebi (2**20) Gi gibi (2**30) - * Ti tebi (2**40)GrammarThe grammar also includes these connectors: / - * division (as an infix operator, e.g. 1/s). . multiplication (as an infix - * operator, e.g. GBy.d)The grammar for a unit is as follows: Expression = - * Component { "." Component } { "/" Component } ; - * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | - * Annotation | "1" ; Annotation = - * "{" NAME "}" ; Notes: Annotation is just a comment if - * it follows a UNIT and is equivalent to 1 if it is used alone. For - * examples, {requests}/s == 1/s, By{transmitted}/s == By/s. NAME is a - * sequence of non-blank printable ASCII characters not containing - * '{' or '}'. 1 represents dimensionless value 1, such as in - * 1/s. % represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of metric_kind and value_type might not be supported. - */ - valueType: string; -} -/** - * An object representing a resource that can be used for monitoring, logging, - * billing, or other purposes. Examples include virtual machine instances, - * databases, and storage devices such as disks. The type field identifies a - * MonitoredResourceDescriptor object that describes the resource's schema. - * Information in the labels field identifies the actual resource and its - * attributes according to the schema. For example, a particular Compute Engine - * VM instance could be represented by the following object, because the - * MonitoredResourceDescriptor for "gce_instance" has labels - * "instance_id" and "zone": { "type": - * "gce_instance", "labels": { "instance_id": - * "12345678901234", "zone": - * "us-central1-a" }} - */ -export interface Schema$MonitoredResource { - /** - * Required. Values for all of the labels listed in the associated monitored - * resource descriptor. For example, Compute Engine VM instances use the - * labels "project_id", "instance_id", and - * "zone". - */ - labels: any; - /** - * Required. The monitored resource type. This field must match the type field - * of a MonitoredResourceDescriptor object. For example, the type of a Compute - * Engine VM instance is gce_instance. - */ - type: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource descriptor - * for Google Compute Engine VM instances has a type of "gce_instance" - * and specifies the use of the labels "instance_id" and - * "zone" to identify particular VM instances.Different APIs can - * support different monitored resource types. APIs generally provide a list - * method that returns the monitored resource descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, "Google Cloud - * SQL Database". - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels "database_id" and - * "zone". - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * "projects/{project_id}/monitoredResourceDescriptors/{type}" where - * {type} is the value of the type field in this object and {project_id} is a - * project ID that provides API-specific context for accessing the type. APIs - * that do not use project information can use the resource name format - * "monitoredResourceDescriptors/{type}". - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * "cloudsql_database" represents databases in Google Cloud SQL. The - * maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Complete log information about a single HTTP request to an App Engine - * application. - */ -export interface Schema$RequestLog { - /** - * App Engine release version. - */ - appEngineRelease: string; - /** - * Application that handled this request. - */ - appId: string; - /** - * An indication of the relative cost of serving this request. - */ - cost: number; - /** - * Time when the request finished. - */ - endTime: string; - /** - * Whether this request is finished or active. - */ - finished: boolean; - /** - * Whether this is the first RequestLog entry for this request. If an active - * request has several RequestLog entries written to Stackdriver Logging, then - * this field will be set for one of them. - */ - first: boolean; - /** - * Internet host and port number of the resource being requested. - */ - host: string; - /** - * HTTP version of request. Example: "HTTP/1.1". - */ - httpVersion: string; - /** - * An identifier for the instance that handled the request. - */ - instanceId: string; - /** - * If the instance processing this request belongs to a manually scaled - * module, then this is the 0-based index of the instance. Otherwise, this - * value is -1. - */ - instanceIndex: number; - /** - * Origin IP address. - */ - ip: string; - /** - * Latency of the request. - */ - latency: string; - /** - * A list of log lines emitted by the application while serving this request. - */ - line: Schema$LogLine[]; - /** - * Number of CPU megacycles used to process request. - */ - megaCycles: string; - /** - * Request method. Example: "GET", "HEAD", - * "PUT", "POST", "DELETE". - */ - method: string; - /** - * Module of the application that handled this request. - */ - moduleId: string; - /** - * The logged-in user who made the request.Most likely, this is the part of - * the user's email before the @ sign. The field value is the same for - * different requests from the same user, but different users can have similar - * names. This information is also available to the application via the App - * Engine Users API.This field will be populated starting with App - * Engine 1.9.21. - */ - nickname: string; - /** - * Time this request spent in the pending request queue. - */ - pendingTime: string; - /** - * Referrer URL of request. - */ - referrer: string; - /** - * Globally unique identifier for a request, which is based on the request - * start time. Request IDs for requests which started later will compare - * greater as strings than those for requests which started earlier. - */ - requestId: string; - /** - * Contains the path and query portion of the URL that was requested. For - * example, if the URL was "http://example.com/app?name=val", the - * resource would be "/app?name=val". The fragment identifier, which - * is identified by the # character, is not included. - */ - resource: string; - /** - * Size in bytes sent back to client by request. - */ - responseSize: string; - /** - * Source code for the application that handled this request. There can be - * more than one source reference per deployed application if source code is - * distributed among multiple repositories. - */ - sourceReference: Schema$SourceReference[]; - /** - * Time when the request started. - */ - startTime: string; - /** - * HTTP response status code. Example: 200, 404. - */ - status: number; - /** - * Task name of the request, in the case of an offline request. - */ - taskName: string; - /** - * Queue name of the request, in the case of an offline request. - */ - taskQueueName: string; - /** - * Stackdriver Trace identifier for this request. - */ - traceId: string; - /** - * File or class that handled the request. - */ - urlMapEntry: string; - /** - * User agent that made the request. - */ - userAgent: string; - /** - * Version of the application that handled this request. - */ - versionId: string; - /** - * Whether this was a loading request for the instance. - */ - wasLoadingRequest: boolean; -} -/** - * Specifies a location in a source code file. - */ -export interface Schema$SourceLocation { - /** - * Source file name. Depending on the runtime environment, this might be a - * simple name or a fully-qualified name. - */ - file: string; - /** - * Human-readable name of the function or method being invoked, with optional - * context such as the class or package name. This information is used in - * contexts such as the logs viewer, where a file and line number are less - * meaningful. The format can vary by language. For example: - * qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python). - */ - functionName: string; - /** - * Line within the source file. - */ - line: string; -} -/** - * A reference to a particular snapshot of the source tree used to build and - * deploy an application. - */ -export interface Schema$SourceReference { - /** - * Optional. A URI string identifying the repository. Example: - * "https://github.com/GoogleCloudPlatform/kubernetes.git" - */ - repository: string; - /** - * The canonical and persistent identifier of the deployed revision. Example - * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" - */ - revisionId: string; -} -/** - * The parameters to WriteLogEntries. - */ -export interface Schema$WriteLogEntriesRequest { - /** - * Optional. If true, the request should expect normal response, but the - * entries won't be persisted nor exported. Useful for checking whether - * the logging API endpoints are working properly before sending valuable - * data. - */ - dryRun: boolean; - /** - * Required. The log entries to send to Stackdriver Logging. The order of log - * entries in this list does not matter. Values supplied in this method's - * log_name, resource, and labels fields are copied into those log entries in - * this list that do not include values for their corresponding fields. For - * more information, see the LogEntry type.If the timestamp or insert_id - * fields are missing in log entries, then this method supplies the current - * time or a unique identifier, respectively. The supplied values are chosen - * so that, among the log entries that did not supply their own values, the - * entries earlier in the list will sort before the entries later in the list. - * See the entries.list method.Log entries with timestamps that are more than - * the logs retention period in the past or more than 24 hours in the future - * will not be available when calling entries.list. However, those log entries - * can still be exported with LogSinks.To improve throughput and to avoid - * exceeding the quota limit for calls to entries.write, you should try to - * include several log entries in this list, rather than calling this method - * for each individual log entry. - */ - entries: Schema$LogEntry[]; - /** - * Optional. Default labels that are added to the labels field of all log - * entries in entries. If a log entry already has a label with the same key as - * a label in this parameter, then the log entry's label is not changed. - * See LogEntry. - */ - labels: any; - /** - * Optional. A default log resource name that is assigned to all log entries - * in entries that do not specify a value for log_name: - * "projects/[PROJECT_ID]/logs/[LOG_ID]" - * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. - * For example, "projects/my-project-id/logs/syslog" or - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * For more information about log names, see LogEntry. - */ - logName: string; - /** - * Optional. Whether valid entries should be written even if some other - * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any - * entry is not written, then the response status is the error associated with - * one of the failed entries and the response includes error details keyed by - * the entries' zero-based index in the entries.write method. - */ - partialSuccess: boolean; + * BucketOptions describes the bucket boundaries used to create a histogram + * for the distribution. The buckets can be in a linear sequence, an + * exponential sequence, or each bucket can be specified explicitly. + * BucketOptions does not include the number of values in each bucket.A bucket + * has an inclusive lower bound and exclusive upper bound for the values that + * are counted for that bucket. The upper bound of a bucket must be strictly + * greater than the lower bound. The sequence of N buckets for a distribution + * consists of an underflow bucket (number 0), zero or more finite buckets + * (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets + * are contiguous: the lower bound of bucket i (i > 0) is the same as the + * upper bound of bucket i - 1. The buckets span the whole range of finite + * values: lower bound of the underflow bucket is -infinity and the upper + * bound of the overflow bucket is +infinity. The finite buckets are so-called + * because both bounds are finite. + */ + export interface Schema$BucketOptions { + /** + * The explicit buckets. + */ + explicitBuckets: Schema$Explicit; + /** + * The exponential buckets. + */ + exponentialBuckets: Schema$Exponential; + /** + * The linear bucket. + */ + linearBuckets: Schema$Linear; + } /** - * Optional. A default monitored resource object that is assigned to all log - * entries in entries that do not specify a value for resource. Example: { - * "type": "gce_instance", "labels": { - * "zone": "us-central1-a", "instance_id": - * "00000000000000000000" }} See LogEntry. - */ - resource: Schema$MonitoredResource; -} -/** - * Result returned from WriteLogEntries. empty - */ -export interface Schema$WriteLogEntriesResponse {} - -export class Resource$Billingaccounts { - root: Logging; - logs: Resource$Billingaccounts$Logs; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.logs = new Resource$Billingaccounts$Logs(root); + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 + * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i + * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds + * field must contain at least one element. If bounds has only one element, + * then there are no finite buckets, and that single element is the common + * boundary of the overflow and underflow buckets. + */ + export interface Schema$Explicit { + /** + * The values must be monotonically increasing. + */ + bounds: number[]; } - - getRoot() { - return this.root; + /** + * Specifies an exponential sequence of buckets that have a width that is + * proportional to the value of the lower bound. Each bucket represents a + * constant relative uncertainty on a specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + */ + export interface Schema$Exponential { + /** + * Must be greater than 1. + */ + growthFactor: number; + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Must be greater than 0. + */ + scale: number; } -} -export class Resource$Billingaccounts$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * A common proto for logging HTTP requests. Only contains semantics defined + * by the HTTP specification. Product-specific logging information MUST be + * defined in a separate message. + */ + export interface Schema$HttpRequest { + /** + * The number of HTTP response bytes inserted into cache. Set only when a + * cache fill was attempted. + */ + cacheFillBytes: string; + /** + * Whether or not an entity was served from cache (with or without + * validation). + */ + cacheHit: boolean; + /** + * Whether or not a cache lookup was attempted. + */ + cacheLookup: boolean; + /** + * Whether or not the response was validated with the origin server before + * being served from cache. This field is only meaningful if cache_hit is + * True. + */ + cacheValidatedWithOriginServer: boolean; + /** + * The request processing latency on the server, from the time the request + * was received until the response was sent. + */ + latency: string; + /** + * Protocol used for the request. Examples: "HTTP/1.1", + * "HTTP/2", "websocket" + */ + protocol: string; + /** + * The referer URL of the request, as defined in HTTP/1.1 Header Field + * Definitions (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). + */ + referer: string; + /** + * The IP address (IPv4 or IPv6) of the client that issued the HTTP request. + * Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". + */ + remoteIp: string; + /** + * The request method. Examples: "GET", "HEAD", + * "PUT", "POST". + */ + requestMethod: string; + /** + * The size of the HTTP request message in bytes, including the request + * headers and the request body. + */ + requestSize: string; + /** + * The scheme (http, https), the host name, the path and the query portion + * of the URL that was requested. Example: + * "http://example.com/some/info?color=red". + */ + requestUrl: string; + /** + * The size of the HTTP response message sent back to the client, in bytes, + * including the response headers and the response body. + */ + responseSize: string; + /** + * The IP address (IPv4 or IPv6) of the origin server that the request was + * sent to. + */ + serverIp: string; + /** + * The response code indicating the status of response. Examples: 200, 404. + */ + status: number; + /** + * The user agent sent by the client. Example: "Mozilla/4.0 + * (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". + */ + userAgent: string; } - - getRoot() { - return this.root; + /** + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; } - - /** - * logging.billingAccounts.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name of the log to delete: - * // "projects/[PROJECT_ID]/logs/[LOG_ID]" - * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * // "folders/[FOLDER_ID]/logs/[LOG_ID]" - * // [LOG_ID] must be URL-encoded. For example, - * "projects/my-project-id/logs/syslog", - * // - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * For more - * // information about log names, see LogEntry. - * logName: 'billingAccounts/my-billing-account/logs/my-log', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * logging.billingAccounts.logs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.billingAccounts.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2beta1/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Specifies a linear sequence of buckets that all have the same width (except + * overflow and underflow). Each bucket represents a constant absolute + * uncertainty on the specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower + * bound (1 <= i < N): offset + (width * (i - 1)). + */ + export interface Schema$Linear { + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Lower bound of the first bucket. + */ + offset: number; + /** + * Must be greater than 0. + */ + width: number; } - - /** - * logging.billingAccounts.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name that owns the logs: - * // "projects/[PROJECT_ID]" - * // "organizations/[ORGANIZATION_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]" - * // "folders/[FOLDER_ID]" - * parent: 'billingAccounts/my-billing-account', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var logNamesPage = response['logNames']; - * if (!logNamesPage) { - * return; - * } - * for (var i = 0; i < logNamesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.billingAccounts.logs.list(request, handlePage); - * } - * }; - * - * logging.billingAccounts.logs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.billingAccounts.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/logs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The parameters to ListLogEntries. + */ + export interface Schema$ListLogEntriesRequest { + /** + * Optional. A filter that chooses which log entries to return. See Advanced + * Logs Filters. Only log entries that match the filter are returned. An + * empty filter matches all log entries in the resources listed in + * resource_names. Referencing a parent resource that is not listed in + * resource_names will cause the filter to return no results. The maximum + * length of the filter is 20000 characters. + */ + filter: string; + /** + * Optional. How the results should be sorted. Presently, the only permitted + * values are "timestamp asc" (default) and "timestamp + * desc". The first option returns entries in order of increasing + * values of LogEntry.timestamp (oldest first), and the second option + * returns entries in order of decreasing timestamps (newest first). Entries + * with equal timestamps are returned in order of their insert_id values. + */ + orderBy: string; + /** + * Optional. The maximum number of results to return from this request. + * Non-positive values are ignored. The presence of next_page_token in the + * response indicates that more results might be available. + */ + pageSize: number; + /** + * Optional. If present, then retrieve the next batch of results from the + * preceding call to this method. page_token must be the value of + * next_page_token from the previous response. The values of other method + * parameters should be identical to those in the previous call. + */ + pageToken: string; + /** + * Deprecated. Use resource_names instead. One or more project identifiers + * or project numbers from which to retrieve log entries. Example: + * "my-project-1A". If present, these project identifiers are + * converted to resource name format and added to the list of resources in + * resource_names. + */ + projectIds: string[]; + /** + * Required. Names of one or more parent resources from which to retrieve + * log entries: "projects/[PROJECT_ID]" + * "organizations/[ORGANIZATION_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]" + * "folders/[FOLDER_ID]" Projects listed in the project_ids field + * are added to this list. + */ + resourceNames: string[]; } -} - - -export class Resource$Entries { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * Result returned from ListLogEntries. + */ + export interface Schema$ListLogEntriesResponse { + /** + * A list of log entries. If entries is empty, nextPageToken may still be + * returned, indicating that more entries may exist. See nextPageToken for + * more information. + */ + entries: Schema$LogEntry[]; + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken.If a value for + * next_page_token appears and the entries field is empty, it means that the + * search found no log entries so far but it did not have time to search all + * the possible log entries. Retry the method with this value for page_token + * to continue the search. Alternatively, consider speeding up the search by + * changing your filter to specify a single log name or resource type, or to + * narrow the time range of the search. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Result returned from ListLogMetrics. + */ + export interface Schema$ListLogMetricsResponse { + /** + * A list of logs-based metrics. + */ + metrics: Schema$LogMetric[]; + /** + * If there might be more results than appear in this response, then + * nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; } - - /** - * logging.entries.list - * @desc Lists log entries. Use this method to retrieve log entries from - * Stackdriver Logging. For ways to export log entries, see Exporting Logs. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var entriesPage = response['entries']; - * if (!entriesPage) { - * return; - * } - * for (var i = 0; i < entriesPage.length; i++) { - * // TODO: Change code below to process each resource in `entriesPage`: - * console.log(JSON.stringify(entriesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.resource.pageToken = response.nextPageToken; - * logging.entries.list(request, handlePage); - * } - * }; - * - * logging.entries.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.entries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ListLogEntriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/entries:list') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListLogs. + */ + export interface Schema$ListLogsResponse { + /** + * A list of log names. For example, "projects/my-project/syslog" + * or + * "organizations/123/cloudresourcemanager.googleapis.com%2Factivity". + */ + logNames: string[]; + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; } - - /** - * logging.entries.write - * @desc Writes log entries to Stackdriver Logging. This API method is the - * only way to send log entries to Stackdriver Logging. This method is used, - * directly or indirectly, by the Stackdriver Logging agent (fluentd) and all - * logging libraries configured to use Stackdriver Logging. A single request - * may contain log entries for a maximum of 1000 different resources - * (projects, organizations, billing accounts or folders) - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * logging.entries.write(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.entries.write - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().WriteLogEntriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - write(params?: any, options?: MethodOptions): - AxiosPromise; - write( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - write( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/entries:write') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Result returned from ListMonitoredResourceDescriptors. + */ + export interface Schema$ListMonitoredResourceDescriptorsResponse { + /** + * If there might be more results than those appearing in this response, + * then nextPageToken is included. To get the next set of results, call this + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; + /** + * A list of resource descriptors. + */ + resourceDescriptors: Schema$MonitoredResourceDescriptor[]; + } + /** + * Result returned from ListSinks. + */ + export interface Schema$ListSinksResponse { + /** + * If there might be more results than appear in this response, then + * nextPageToken is included. To get the next set of results, call the same + * method again using the value of nextPageToken as pageToken. + */ + nextPageToken: string; + /** + * A list of sinks. + */ + sinks: Schema$LogSink[]; } -} - -export class Resource$Monitoredresourcedescriptors { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * An individual entry in a log. + */ + export interface Schema$LogEntry { + /** + * Optional. Information about the HTTP request associated with this log + * entry, if applicable. + */ + httpRequest: Schema$HttpRequest; + /** + * Optional. A unique identifier for the log entry. If you provide a value, + * then Stackdriver Logging considers other log entries in the same project, + * with the same timestamp, and with the same insert_id to be duplicates + * which can be removed. If omitted in new log entries, then Stackdriver + * Logging assigns its own unique identifier. The insert_id is also used to + * order log entries that have the same timestamp value. + */ + insertId: string; + /** + * The log entry payload, represented as a structure that is expressed as a + * JSON object. + */ + jsonPayload: any; + /** + * Optional. A set of user-defined (key, value) data that provides + * additional information about the log entry. + */ + labels: any; + /** + * Required. The resource name of the log to which this log entry belongs: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may + * optionally be used in place of PROJECT_ID. The project number is + * translated to its corresponding PROJECT_ID internally and the log_name + * field will contain PROJECT_ID in queries and exports.[LOG_ID] must be + * URL-encoded within log_name. Example: + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * [LOG_ID] must be less than 512 characters long and can only include the + * following characters: upper and lower case alphanumeric characters, + * forward-slash, underscore, hyphen, and period.For backward compatibility, + * if log_name begins with a forward-slash, such as /projects/..., then the + * log entry is ingested as usual but the forward-slash is removed. Listing + * the log entry will not show the leading slash and filtering for a log + * name with a leading slash will never return any results. + */ + logName: string; + /** + * Optional. Information about an operation associated with the log entry, + * if applicable. + */ + operation: Schema$LogEntryOperation; + /** + * The log entry payload, represented as a protocol buffer. Some Google + * Cloud Platform services use this field for their log entry payloads. + */ + protoPayload: any; + /** + * Output only. The time the log entry was received by Stackdriver Logging. + */ + receiveTimestamp: string; + /** + * Required. The primary monitored resource associated with this log entry. + * Example: a log entry that reports a database error would be associated + * with the monitored resource designating the particular database that + * reported the error. + */ + resource: Schema$MonitoredResource; + /** + * Optional. The severity of the log entry. The default value is + * LogSeverity.DEFAULT. + */ + severity: string; + /** + * Optional. Source code location information associated with the log entry, + * if any. + */ + sourceLocation: Schema$LogEntrySourceLocation; + /** + * Optional. The span ID within the trace associated with the log entry. For + * Stackdriver Trace spans, this is the same format that the Stackdriver + * Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte + * array, such as <code>"000000000000004a"</code>. + */ + spanId: string; + /** + * The log entry payload, represented as a Unicode string (UTF-8). + */ + textPayload: string; + /** + * Optional. The time the event described by the log entry occurred. This + * time is used to compute the log entry's age and to enforce the logs + * retention period. If this field is omitted in a new log entry, then + * Stackdriver Logging assigns it the current time.Incoming log entries + * should have timestamps that are no more than the logs retention period in + * the past, and no more than 24 hours in the future. Log entries outside + * those time boundaries will not be available when calling entries.list, + * but those log entries can still be exported with LogSinks. + */ + timestamp: string; + /** + * Optional. Resource name of the trace associated with the log entry, if + * any. If it contains a relative resource name, the name is assumed to be + * relative to //tracing.googleapis.com. Example: + * projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 + */ + trace: string; } - - getRoot() { - return this.root; + /** + * Additional information about a potentially long-running operation with + * which a log entry is associated. + */ + export interface Schema$LogEntryOperation { + /** + * Optional. Set this to True if this is the first log entry in the + * operation. + */ + first: boolean; + /** + * Optional. An arbitrary operation identifier. Log entries with the same + * identifier are assumed to be part of the same operation. + */ + id: string; + /** + * Optional. Set this to True if this is the last log entry in the + * operation. + */ + last: boolean; + /** + * Optional. An arbitrary producer identifier. The combination of id and + * producer must be globally unique. Examples for producer: + * "MyDivision.MyBigCompany.com", + * "github.com/MyProject/MyApplication". + */ + producer: string; } - - /** - * logging.monitoredResourceDescriptors.list - * @desc Lists the descriptors for monitored resource types used by - * Stackdriver Logging. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var resourceDescriptorsPage = response['resourceDescriptors']; - * if (!resourceDescriptorsPage) { - * return; - * } - * for (var i = 0; i < resourceDescriptorsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `resourceDescriptorsPage`: - * console.log(JSON.stringify(resourceDescriptorsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.monitoredResourceDescriptors.list(request, handlePage); - * } - * }; - * - * logging.monitoredResourceDescriptors.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.monitoredResourceDescriptors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/monitoredResourceDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Additional information about the source code location that produced the log + * entry. + */ + export interface Schema$LogEntrySourceLocation { + /** + * Optional. Source file name. Depending on the runtime environment, this + * might be a simple name or a fully-qualified name. + */ + file: string; + /** + * Optional. Human-readable name of the function or method being invoked, + * with optional context such as the class or package name. This information + * may be used in contexts such as the logs viewer, where a file and line + * number are less meaningful. The format can vary by language. For example: + * qual.if.ied.Class.method (Java), dir/package.func (Go), function + * (Python). + */ + function: string; + /** + * Optional. Line within the source file. 1-based; 0 indicates no line + * number available. + */ + line: string; } -} - -export class Resource$Organizations { - root: Logging; - logs: Resource$Organizations$Logs; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.logs = new Resource$Organizations$Logs(root); + /** + * Application log line emitted while processing a request. + */ + export interface Schema$LogLine { + /** + * App-provided log message. + */ + logMessage: string; + /** + * Severity of this log entry. + */ + severity: string; + /** + * Where in the source code this log message was written. + */ + sourceLocation: Schema$SourceLocation; + /** + * Approximate time when this log entry was made. + */ + time: string; } - - getRoot() { - return this.root; + /** + * Describes a logs-based metric. The value of the metric is the number of log + * entries that match a logs filter in a given time interval.Logs-based metric + * can also be used to extract values from logs and create a a distribution of + * the values. The distribution records the statistics of the extracted values + * along with an optional histogram of the values as specified by the bucket + * options. + */ + export interface Schema$LogMetric { + /** + * Optional. The bucket_options are required when the logs-based metric is + * using a DISTRIBUTION value type and it describes the bucket boundaries + * used to create a histogram of the extracted values. + */ + bucketOptions: Schema$BucketOptions; + /** + * Optional. A description of this metric, which is used in documentation. + */ + description: string; + /** + * Required. An advanced logs filter which is used to match log entries. + * Example: "resource.type=gae_app AND severity>=ERROR" The + * maximum length of the filter is 20000 characters. + */ + filter: string; + /** + * Optional. A map from a label key string to an extractor expression which + * is used to extract data from a log entry field and assign as the label + * value. Each label key specified in the LabelDescriptor must have an + * associated extractor expression in this map. The syntax of the extractor + * expression is the same as for the value_extractor field.The extracted + * value is converted to the type defined in the label descriptor. If the + * either the extraction or the type conversion fails, the label will have a + * default value. The default value for a string label is an empty string, + * for an integer label its 0, and for a boolean label its false.Note that + * there are upper bounds on the maximum number of labels and the number of + * active time series that are allowed in a project. + */ + labelExtractors: any; + /** + * Optional. The metric descriptor associated with the logs-based metric. If + * unspecified, it uses a default metric descriptor with a DELTA metric + * kind, INT64 value type, with no labels and a unit of "1". Such + * a metric counts the number of log entries matching the filter + * expression.The name, type, and description fields in the + * metric_descriptor are output only, and is constructed using the name and + * description field in the LogMetric.To create a logs-based metric that + * records a distribution of log values, a DELTA metric kind with a + * DISTRIBUTION value type must be used along with a value_extractor + * expression in the LogMetric.Each label in the metric descriptor must have + * a matching label name as the key and an extractor expression as the value + * in the label_extractors map.The metric_kind and value_type fields in the + * metric_descriptor cannot be updated once initially configured. New labels + * can be added in the metric_descriptor, but existing labels cannot be + * modified except for their description. + */ + metricDescriptor: Schema$MetricDescriptor; + /** + * Required. The client-assigned metric identifier. Examples: + * "error_count", "nginx/requests".Metric identifiers + * are limited to 100 characters and can include only the following + * characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. + * The forward-slash character (/) denotes a hierarchy of name pieces, and + * it cannot be the first character of the name.The metric identifier in + * this field must not be URL-encoded + * (https://en.wikipedia.org/wiki/Percent-encoding). However, when the + * metric identifier appears as the [METRIC_ID] part of a metric_name API + * parameter, then the metric identifier must be URL-encoded. Example: + * "projects/my-project/metrics/nginx%2Frequests". + */ + name: string; + /** + * Optional. A value_extractor is required when using a distribution + * logs-based metric to extract the values to record from a log entry. Two + * functions are supported for value extraction: EXTRACT(field) or + * REGEXP_EXTRACT(field, regex). The argument are: 1. field: The name of + * the log entry field from which the value is to be extracted. 2. regex: + * A regular expression using the Google RE2 syntax + * (https://github.com/google/re2/wiki/Syntax) with a single capture group + * to extract data from the specified log entry field. The value of the + * field is converted to a string before applying the regex. It is an error + * to specify a regex that does not include exactly one capture group.The + * result of the extraction must be convertible to a double type, as the + * distribution always records double values. If either the extraction or + * the conversion to double fails, then those values are not recorded in the + * distribution.Example: REGEXP_EXTRACT(jsonPayload.request, + * ".*quantity=(\d+).*") + */ + valueExtractor: string; + /** + * Deprecated. The API version that created or updated this metric. The v2 + * format is used by default and cannot be changed. + */ + version: string; } -} -export class Resource$Organizations$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * Describes a sink used to export log entries to one of the following + * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or + * a Cloud Pub/Sub topic. A logs filter controls which log entries are + * exported. The sink must be created within a project, organization, billing + * account, or folder. + */ + export interface Schema$LogSink { + /** + * Required. The export destination: + * "storage.googleapis.com/[GCS_BUCKET]" + * "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" + * "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" + * The sink's writer_identity, set when the sink is created, must have + * permission to write to the destination or else the log entries are not + * exported. For more information, see Exporting Logs With Sinks. + */ + destination: string; + /** + * Deprecated. This field is ignored when creating or updating sinks. + */ + endTime: string; + /** + * Optional. An advanced logs filter. The only exported log entries are + * those that are in the resource owning the sink and that match the filter. + * For example: logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND + * severity>=ERROR + */ + filter: string; + /** + * Optional. This field applies only to sinks owned by organizations and + * folders. If the field is false, the default, only the logs owned by the + * sink's parent resource are available for export. If the field is + * true, then logs from all the projects, folders, and billing accounts + * contained in the sink's parent resource are also available for + * export. Whether a particular log entry from the children is exported + * depends on the sink's filter expression. For example, if this field + * is true, then the filter resource.type=gce_instance would export all + * Compute Engine VM instance log entries from all projects in the + * sink's parent. To only export entries from certain child projects, + * filter on the project part of the log name: + * logName:("projects/test-project1/" OR + * "projects/test-project2/") AND resource.type=gce_instance + */ + includeChildren: boolean; + /** + * Required. The client-assigned sink identifier, unique within the project. + * Example: "my-syslog-errors-to-pubsub". Sink identifiers are + * limited to 100 characters and can include only the following characters: + * upper and lower-case alphanumeric characters, underscores, hyphens, and + * periods. + */ + name: string; + /** + * Deprecated. The log entry format to use for this sink's exported log + * entries. The v2 format is used by default and cannot be changed. + */ + outputVersionFormat: string; + /** + * Deprecated. This field is ignored when creating or updating sinks. + */ + startTime: string; + /** + * Output only. An IAM identity&mdash;a service account or + * group&mdash;under which Stackdriver Logging writes the exported log + * entries to the sink's destination. This field is set by sinks.create + * and sinks.update, based on the setting of unique_writer_identity in those + * methods.Until you grant this identity write-access to the destination, + * log entry exports from this sink will fail. For more information, see + * Granting access for a resource. Consult the destination service's + * documentation to determine the appropriate IAM roles to assign to the + * identity. + */ + writerIdentity: string; } - - getRoot() { - return this.root; + /** + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * appengine.googleapis.com/http/server/response_latencies metric type has a + * label for the HTTP response code, response_code, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of metric_kind and value_type might not be supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * custom.googleapis.com. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the value_type is INT64, DOUBLE, or DISTRIBUTION. The supported units are + * a subset of The Unified Code for Units of Measure + * (http://unitsofmeasure.org/ucum.html) standard:Basic units (UNIT) bit bit + * By byte s second min minute h hour d dayPrefixes (PREFIX) k kilo (10**3) + * M mega (10**6) G giga (10**9) T tera (10**12) P peta (10**15) E exa + * (10**18) Z zetta (10**21) Y yotta (10**24) m milli (10**-3) u micro + * (10**-6) n nano (10**-9) p pico (10**-12) f femto (10**-15) a atto + * (10**-18) z zepto (10**-21) y yocto (10**-24) Ki kibi (2**10) Mi mebi + * (2**20) Gi gibi (2**30) Ti tebi (2**40)GrammarThe grammar also includes + * these connectors: / division (as an infix operator, e.g. 1/s). . + * multiplication (as an infix operator, e.g. GBy.d)The grammar for a unit + * is as follows: Expression = Component { "." Component } { + * "/" Component } ; Component = ( [ PREFIX ] UNIT | + * "%" ) [ Annotation ] | Annotation | + * "1" ; Annotation = "{" NAME "}" + * ; Notes: Annotation is just a comment if it follows a UNIT and is + * equivalent to 1 if it is used alone. For examples, {requests}/s == 1/s, + * By{transmitted}/s == By/s. NAME is a sequence of non-blank printable + * ASCII characters not containing '{' or '}'. 1 represents + * dimensionless value 1, such as in 1/s. % represents dimensionless value + * 1/100, and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of metric_kind and value_type might not be supported. + */ + valueType: string; } - - /** - * logging.organizations.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name of the log to delete: - * // "projects/[PROJECT_ID]/logs/[LOG_ID]" - * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * // "folders/[FOLDER_ID]/logs/[LOG_ID]" - * // [LOG_ID] must be URL-encoded. For example, - * "projects/my-project-id/logs/syslog", - * // - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * For more - * // information about log names, see LogEntry. - * logName: 'organizations/my-organization/logs/my-log', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.organizations.logs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.organizations.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2beta1/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object representing a resource that can be used for monitoring, logging, + * billing, or other purposes. Examples include virtual machine instances, + * databases, and storage devices such as disks. The type field identifies a + * MonitoredResourceDescriptor object that describes the resource's + * schema. Information in the labels field identifies the actual resource and + * its attributes according to the schema. For example, a particular Compute + * Engine VM instance could be represented by the following object, because + * the MonitoredResourceDescriptor for "gce_instance" has labels + * "instance_id" and "zone": { "type": + * "gce_instance", "labels": { "instance_id": + * "12345678901234", "zone": + * "us-central1-a" }} + */ + export interface Schema$MonitoredResource { + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels "project_id", "instance_id", and + * "zone". + */ + labels: any; + /** + * Required. The monitored resource type. This field must match the type + * field of a MonitoredResourceDescriptor object. For example, the type of a + * Compute Engine VM instance is gce_instance. + */ + type: string; } - - /** - * logging.organizations.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name that owns the logs: - * // "projects/[PROJECT_ID]" - * // "organizations/[ORGANIZATION_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]" - * // "folders/[FOLDER_ID]" - * parent: 'organizations/my-organization', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var logNamesPage = response['logNames']; - * if (!logNamesPage) { - * return; - * } - * for (var i = 0; i < logNamesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.organizations.logs.list(request, handlePage); - * } - * }; - * - * logging.organizations.logs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.organizations.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/logs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * "gce_instance" and specifies the use of the labels + * "instance_id" and "zone" to identify particular VM + * instances.Different APIs can support different monitored resource types. + * APIs generally provide a list method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, "Google Cloud + * SQL Database". + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels "database_id" and + * "zone". + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * "projects/{project_id}/monitoredResourceDescriptors/{type}" + * where {type} is the value of the type field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format "monitoredResourceDescriptors/{type}". + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * "cloudsql_database" represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; } -} - - -export class Resource$Projects { - root: Logging; - logs: Resource$Projects$Logs; - metrics: Resource$Projects$Metrics; - sinks: Resource$Projects$Sinks; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - this.logs = new Resource$Projects$Logs(root); - this.metrics = new Resource$Projects$Metrics(root); - this.sinks = new Resource$Projects$Sinks(root); + /** + * Complete log information about a single HTTP request to an App Engine + * application. + */ + export interface Schema$RequestLog { + /** + * App Engine release version. + */ + appEngineRelease: string; + /** + * Application that handled this request. + */ + appId: string; + /** + * An indication of the relative cost of serving this request. + */ + cost: number; + /** + * Time when the request finished. + */ + endTime: string; + /** + * Whether this request is finished or active. + */ + finished: boolean; + /** + * Whether this is the first RequestLog entry for this request. If an active + * request has several RequestLog entries written to Stackdriver Logging, + * then this field will be set for one of them. + */ + first: boolean; + /** + * Internet host and port number of the resource being requested. + */ + host: string; + /** + * HTTP version of request. Example: "HTTP/1.1". + */ + httpVersion: string; + /** + * An identifier for the instance that handled the request. + */ + instanceId: string; + /** + * If the instance processing this request belongs to a manually scaled + * module, then this is the 0-based index of the instance. Otherwise, this + * value is -1. + */ + instanceIndex: number; + /** + * Origin IP address. + */ + ip: string; + /** + * Latency of the request. + */ + latency: string; + /** + * A list of log lines emitted by the application while serving this + * request. + */ + line: Schema$LogLine[]; + /** + * Number of CPU megacycles used to process request. + */ + megaCycles: string; + /** + * Request method. Example: "GET", "HEAD", + * "PUT", "POST", "DELETE". + */ + method: string; + /** + * Module of the application that handled this request. + */ + moduleId: string; + /** + * The logged-in user who made the request.Most likely, this is the part of + * the user's email before the @ sign. The field value is the same for + * different requests from the same user, but different users can have + * similar names. This information is also available to the application via + * the App Engine Users API.This field will be populated starting with App + * Engine 1.9.21. + */ + nickname: string; + /** + * Time this request spent in the pending request queue. + */ + pendingTime: string; + /** + * Referrer URL of request. + */ + referrer: string; + /** + * Globally unique identifier for a request, which is based on the request + * start time. Request IDs for requests which started later will compare + * greater as strings than those for requests which started earlier. + */ + requestId: string; + /** + * Contains the path and query portion of the URL that was requested. For + * example, if the URL was "http://example.com/app?name=val", the + * resource would be "/app?name=val". The fragment identifier, + * which is identified by the # character, is not included. + */ + resource: string; + /** + * Size in bytes sent back to client by request. + */ + responseSize: string; + /** + * Source code for the application that handled this request. There can be + * more than one source reference per deployed application if source code is + * distributed among multiple repositories. + */ + sourceReference: Schema$SourceReference[]; + /** + * Time when the request started. + */ + startTime: string; + /** + * HTTP response status code. Example: 200, 404. + */ + status: number; + /** + * Task name of the request, in the case of an offline request. + */ + taskName: string; + /** + * Queue name of the request, in the case of an offline request. + */ + taskQueueName: string; + /** + * Stackdriver Trace identifier for this request. + */ + traceId: string; + /** + * File or class that handled the request. + */ + urlMapEntry: string; + /** + * User agent that made the request. + */ + userAgent: string; + /** + * Version of the application that handled this request. + */ + versionId: string; + /** + * Whether this was a loading request for the instance. + */ + wasLoadingRequest: boolean; } - - getRoot() { - return this.root; + /** + * Specifies a location in a source code file. + */ + export interface Schema$SourceLocation { + /** + * Source file name. Depending on the runtime environment, this might be a + * simple name or a fully-qualified name. + */ + file: string; + /** + * Human-readable name of the function or method being invoked, with + * optional context such as the class or package name. This information is + * used in contexts such as the logs viewer, where a file and line number + * are less meaningful. The format can vary by language. For example: + * qual.if.ied.Class.method (Java), dir/package.func (Go), function + * (Python). + */ + functionName: string; + /** + * Line within the source file. + */ + line: string; } -} -export class Resource$Projects$Logs { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); + /** + * A reference to a particular snapshot of the source tree used to build and + * deploy an application. + */ + export interface Schema$SourceReference { + /** + * Optional. A URI string identifying the repository. Example: + * "https://github.com/GoogleCloudPlatform/kubernetes.git" + */ + repository: string; + /** + * The canonical and persistent identifier of the deployed revision. Example + * (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b" + */ + revisionId: string; } - - getRoot() { - return this.root; + /** + * The parameters to WriteLogEntries. + */ + export interface Schema$WriteLogEntriesRequest { + /** + * Optional. If true, the request should expect normal response, but the + * entries won't be persisted nor exported. Useful for checking whether + * the logging API endpoints are working properly before sending valuable + * data. + */ + dryRun: boolean; + /** + * Required. The log entries to send to Stackdriver Logging. The order of + * log entries in this list does not matter. Values supplied in this + * method's log_name, resource, and labels fields are copied into those + * log entries in this list that do not include values for their + * corresponding fields. For more information, see the LogEntry type.If the + * timestamp or insert_id fields are missing in log entries, then this + * method supplies the current time or a unique identifier, respectively. + * The supplied values are chosen so that, among the log entries that did + * not supply their own values, the entries earlier in the list will sort + * before the entries later in the list. See the entries.list method.Log + * entries with timestamps that are more than the logs retention period in + * the past or more than 24 hours in the future will not be available when + * calling entries.list. However, those log entries can still be exported + * with LogSinks.To improve throughput and to avoid exceeding the quota + * limit for calls to entries.write, you should try to include several log + * entries in this list, rather than calling this method for each individual + * log entry. + */ + entries: Schema$LogEntry[]; + /** + * Optional. Default labels that are added to the labels field of all log + * entries in entries. If a log entry already has a label with the same key + * as a label in this parameter, then the log entry's label is not + * changed. See LogEntry. + */ + labels: any; + /** + * Optional. A default log resource name that is assigned to all log entries + * in entries that do not specify a value for log_name: + * "projects/[PROJECT_ID]/logs/[LOG_ID]" + * "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be + * URL-encoded. For example, "projects/my-project-id/logs/syslog" + * or + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * For more information about log names, see LogEntry. + */ + logName: string; + /** + * Optional. Whether valid entries should be written even if some other + * entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any + * entry is not written, then the response status is the error associated + * with one of the failed entries and the response includes error details + * keyed by the entries' zero-based index in the entries.write method. + */ + partialSuccess: boolean; + /** + * Optional. A default monitored resource object that is assigned to all log + * entries in entries that do not specify a value for resource. Example: { + * "type": "gce_instance", "labels": { + * "zone": "us-central1-a", "instance_id": + * "00000000000000000000" }} See LogEntry. + */ + resource: Schema$MonitoredResource; } - - /** - * logging.projects.logs.delete - * @desc Deletes all the log entries in a log. The log reappears if it - * receives new entries. Log entries written shortly before the delete - * operation might not be deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name of the log to delete: - * // "projects/[PROJECT_ID]/logs/[LOG_ID]" - * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" - * // "folders/[FOLDER_ID]/logs/[LOG_ID]" - * // [LOG_ID] must be URL-encoded. For example, - * "projects/my-project-id/logs/syslog", - * // - * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". - * For more - * // information about log names, see LogEntry. - * logName: 'projects/my-project/logs/my-log', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.projects.logs.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.logs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Result returned from WriteLogEntries. empty */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export interface Schema$WriteLogEntriesResponse {} + + export class Resource$Billingaccounts { + root: Logging; + logs: Resource$Billingaccounts$Logs; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.logs = new Resource$Billingaccounts$Logs(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v2beta1/{+logName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['logName'], - pathParams: ['logName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - - - /** - * logging.projects.logs.list - * @desc Lists the logs in projects, organizations, folders, or billing - * accounts. Only logs that have entries are listed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name that owns the logs: - * // "projects/[PROJECT_ID]" - * // "organizations/[ORGANIZATION_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]" - * // "folders/[FOLDER_ID]" - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var logNamesPage = response['logNames']; - * if (!logNamesPage) { - * return; - * } - * for (var i = 0; i < logNamesPage.length; i++) { - * // TODO: Change code below to process each resource in - * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.projects.logs.list(request, handlePage); - * } - * }; - * - * logging.projects.logs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.logs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Billingaccounts$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/logs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.billingAccounts.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, + * "projects/my-project-id/logs/syslog", + * // + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * For more + * // information about log names, see LogEntry. + * logName: 'billingAccounts/my-billing-account/logs/my-log', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * logging.billingAccounts.logs.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.billingAccounts.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+logName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Metrics { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * logging.billingAccounts.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * parent: 'billingAccounts/my-billing-account', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var logNamesPage = response['logNames']; + * if (!logNamesPage) { + * return; + * } + * for (var i = 0; i < logNamesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.billingAccounts.logs.list(request, handlePage); + * } + * }; + * + * logging.billingAccounts.logs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.billingAccounts.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * logging.projects.metrics.create - * @desc Creates a logs-based metric. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the project in which to create the metric: - * // "projects/[PROJECT_ID]" - * // The new metric must be provided in the request. - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * logging.projects.metrics.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.metrics.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request. - * @param {().LogMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Entries { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * logging.projects.metrics.delete - * @desc Deletes a logs-based metric. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the metric to delete: - * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * metricName: 'projects/my-project/metrics/my-metric', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.projects.metrics.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.metrics.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * logging.entries.list + * @desc Lists log entries. Use this method to retrieve log entries from + * Stackdriver Logging. For ways to export log entries, see Exporting Logs. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var entriesPage = response['entries']; + * if (!entriesPage) { + * return; + * } + * for (var i = 0; i < entriesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `entriesPage`: console.log(JSON.stringify(entriesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.resource.pageToken = response.nextPageToken; + * logging.entries.list(request, handlePage); + * } + * }; + * + * logging.entries.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.entries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ListLogEntriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/entries:list') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+metricName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.entries.write + * @desc Writes log entries to Stackdriver Logging. This API method is the + * only way to send log entries to Stackdriver Logging. This method is used, + * directly or indirectly, by the Stackdriver Logging agent (fluentd) and + * all logging libraries configured to use Stackdriver Logging. A single + * request may contain log entries for a maximum of 1000 different resources + * (projects, organizations, billing accounts or folders) + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * logging.entries.write(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.entries.write + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().WriteLogEntriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + write(params?: any, options?: MethodOptions): + AxiosPromise; + write( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + write( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/entries:write') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * logging.projects.metrics.get - * @desc Gets a logs-based metric. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the desired metric: - * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * metricName: 'projects/my-project/metrics/my-metric', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.projects.metrics.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.metrics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Monitoredresourcedescriptors { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+metricName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.monitoredResourceDescriptors.list + * @desc Lists the descriptors for monitored resource types used by + * Stackdriver Logging. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var resourceDescriptorsPage = response['resourceDescriptors']; + * if (!resourceDescriptorsPage) { + * return; + * } + * for (var i = 0; i < resourceDescriptorsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `resourceDescriptorsPage`: + * console.log(JSON.stringify(resourceDescriptorsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.monitoredResourceDescriptors.list(request, handlePage); + * } + * }; + * + * logging.monitoredResourceDescriptors.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.monitoredResourceDescriptors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/monitoredResourceDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListMonitoredResourceDescriptorsResponse>(parameters); + } } } + export class Resource$Organizations { + root: Logging; + logs: Resource$Organizations$Logs; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.logs = new Resource$Organizations$Logs(root); + } - /** - * logging.projects.metrics.list - * @desc Lists logs-based metrics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The name of the project containing the metrics: - * // "projects/[PROJECT_ID]" - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var metricsPage = response['metrics']; - * if (!metricsPage) { - * return; - * } - * for (var i = 0; i < metricsPage.length; i++) { - * // TODO: Change code below to process each resource in `metricsPage`: - * console.log(JSON.stringify(metricsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.projects.metrics.list(request, handlePage); - * } - * }; - * - * logging.projects.metrics.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.metrics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The name of the project containing the metrics: "projects/[PROJECT_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Organizations$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * logging.projects.metrics.update - * @desc Creates or updates a logs-based metric. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // The resource name of the metric to update: - * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" - * // The updated metric must be provided in the request and it's name - * field must be the same as - * // [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new - * metric is created. metricName: 'projects/my-project/metrics/my-metric', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * logging.projects.metrics.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.metrics.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.metricName The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. - * @param {().LogMetric} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * logging.organizations.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, + * "projects/my-project-id/logs/syslog", + * // + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * For more + * // information about log names, see LogEntry. + * logName: 'organizations/my-organization/logs/my-log', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * logging.organizations.logs.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.organizations.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+logName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+metricName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['metricName'], - pathParams: ['metricName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.organizations.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * parent: 'organizations/my-organization', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var logNamesPage = response['logNames']; + * if (!logNamesPage) { + * return; + * } + * for (var i = 0; i < logNamesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.organizations.logs.list(request, handlePage); + * } + * }; + * + * logging.organizations.logs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.organizations.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Sinks { - root: Logging; - constructor(root: Logging) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + export class Resource$Projects { + root: Logging; + logs: Resource$Projects$Logs; + metrics: Resource$Projects$Metrics; + sinks: Resource$Projects$Sinks; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + this.logs = new Resource$Projects$Logs(root); + this.metrics = new Resource$Projects$Metrics(root); + this.sinks = new Resource$Projects$Sinks(root); + } + getRoot() { + return this.root; + } + } + export class Resource$Projects$Logs { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } - /** - * logging.projects.sinks.create - * @desc Creates a sink that exports specified log entries to a destination. - * The export of newly-ingested log entries begins immediately, unless the - * sink's writer_identity is not permitted to write to the destination. A sink - * can export log entries only from the resource owning the sink. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource in which to create the sink: - * // "projects/[PROJECT_ID]" - * // "organizations/[ORGANIZATION_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]" - * // "folders/[FOLDER_ID]" - * // Examples: "projects/my-logging-project", "organizations/123456789". - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * logging.projects.sinks.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.sinks.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". - * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * logging.projects.logs.delete + * @desc Deletes all the log entries in a log. The log reappears if it + * receives new entries. Log entries written shortly before the delete + * operation might not be deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name of the log to delete: + * // "projects/[PROJECT_ID]/logs/[LOG_ID]" + * // "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" + * // "folders/[FOLDER_ID]/logs/[LOG_ID]" + * // [LOG_ID] must be URL-encoded. For example, + * "projects/my-project-id/logs/syslog", + * // + * "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". + * For more + * // information about log names, see LogEntry. + * logName: 'projects/my-project/logs/my-log', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * logging.projects.logs.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.logs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.logName Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log names, see LogEntry. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+logName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['logName'], + pathParams: ['logName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/sinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.projects.logs.list + * @desc Lists the logs in projects, organizations, folders, or billing + * accounts. Only logs that have entries are listed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name that owns the logs: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * parent: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var logNamesPage = response['logNames']; + * if (!logNamesPage) { + * return; + * } + * for (var i = 0; i < logNamesPage.length; i++) { + * // TODO: Change code below to process each resource in + * `logNamesPage`: console.log(JSON.stringify(logNamesPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.projects.logs.list(request, handlePage); + * } + * }; + * + * logging.projects.logs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.logs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The resource name that owns the logs: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/logs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Projects$Metrics { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } - /** - * logging.projects.sinks.delete - * @desc Deletes a sink. If the sink has a unique writer_identity, then that - * service account is also deleted. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The full resource name of the sink to delete, including - * the parent resource and the sink - * // identifier: - * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * // Example: "projects/my-project-id/sinks/my-sink-id". - * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.projects.sinks.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.sinks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * logging.projects.metrics.create + * @desc Creates a logs-based metric. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the project in which to create the metric: + * // "projects/[PROJECT_ID]" + * // The new metric must be provided in the request. + * parent: 'projects/my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * logging.projects.metrics.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.metrics.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new metric must be provided in the request. + * @param {().LogMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+sinkName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.projects.metrics.delete + * @desc Deletes a logs-based metric. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the metric to delete: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * metricName: 'projects/my-project/metrics/my-metric', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * logging.projects.metrics.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.metrics.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+metricName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * logging.projects.sinks.get - * @desc Gets a sink. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The resource name of the sink: - * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * // Example: "projects/my-project-id/sinks/my-sink-id". - * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * logging.projects.sinks.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.sinks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * logging.projects.metrics.get + * @desc Gets a logs-based metric. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the desired metric: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * metricName: 'projects/my-project/metrics/my-metric', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * logging.projects.metrics.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.metrics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+metricName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * logging.projects.metrics.list + * @desc Lists logs-based metrics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The name of the project containing the metrics: + * // "projects/[PROJECT_ID]" + * parent: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var metricsPage = response['metrics']; + * if (!metricsPage) { + * return; + * } + * for (var i = 0; i < metricsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `metricsPage`: console.log(JSON.stringify(metricsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.projects.metrics.list(request, handlePage); + * } + * }; + * + * logging.projects.metrics.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.metrics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The name of the project containing the metrics: "projects/[PROJECT_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+sinkName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.projects.metrics.update + * @desc Creates or updates a logs-based metric. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // The resource name of the metric to update: + * // "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + * // The updated metric must be provided in the request and it's name + * field must be the same as + * // [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a + * new metric is created. metricName: + * 'projects/my-project/metrics/my-metric', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * logging.projects.metrics.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.metrics.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.metricName The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a new metric is created. + * @param {().LogMetric} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+metricName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['metricName'], + pathParams: ['metricName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Projects$Sinks { + root: Logging; + constructor(root: Logging) { + this.root = root; + this.getRoot.bind(this); + } - /** - * logging.projects.sinks.list - * @desc Lists sinks. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The parent resource whose sinks are to be listed: - * // "projects/[PROJECT_ID]" - * // "organizations/[ORGANIZATION_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]" - * // "folders/[FOLDER_ID]" - * parent: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var sinksPage = response['sinks']; - * if (!sinksPage) { - * return; - * } - * for (var i = 0; i < sinksPage.length; i++) { - * // TODO: Change code below to process each resource in `sinksPage`: - * console.log(JSON.stringify(sinksPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * logging.projects.sinks.list(request, handlePage); - * } - * }; - * - * logging.projects.sinks.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.sinks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * logging.projects.sinks.create + * @desc Creates a sink that exports specified log entries to a destination. + * The export of newly-ingested log entries begins immediately, unless the + * sink's writer_identity is not permitted to write to the destination. A + * sink can export log entries only from the resource owning the sink. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource in which to create the sink: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * // Examples: "projects/my-logging-project", + * "organizations/123456789". parent: 'projects/my-project', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * logging.projects.sinks.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.sinks.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The resource in which to create the sink: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects/my-logging-project", "organizations/123456789". + * @param {boolean=} params.uniqueWriterIdentity Optional. Determines the kind of IAM identity returned as writer_identity in the new sink. If this value is omitted or set to false, and if the sink's parent is a project, then the value returned as writer_identity is the same group or service account used by Stackdriver Logging before the addition of writer identities to this API. The sink's destination must be in the same project as the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such as an organization, then the value of writer_identity will be a unique service account used only for exports from the new sink. For more information, see writer_identity in LogSink. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+parent}/sinks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.projects.sinks.delete + * @desc Deletes a sink. If the sink has a unique writer_identity, then that + * service account is also deleted. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The full resource name of the sink to delete, including + * the parent resource and the sink + * // identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * logging.projects.sinks.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.sinks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to delete, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+sinkName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * logging.projects.sinks.update - * @desc Updates a sink. This method replaces the following fields in the - * existing sink with values from the new sink: destination, and filter. The - * updated sink might also have a new writer_identity; see the - * unique_writer_identity field. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Stackdriver Logging API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/logging - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var logging = google.logging('v2beta1'); - * - * authorize(function(authClient) { - * var request = { - * // Required. The full resource name of the sink to update, including - * the parent resource and the sink - * // identifier: - * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" - * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" - * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" - * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" - * // Example: "projects/my-project-id/sinks/my-sink-id". - * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * logging.projects.sinks.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias logging.projects.sinks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". - * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. - * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. - * @param {().LogSink} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * logging.projects.sinks.get + * @desc Gets a sink. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The resource name of the sink: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * logging.projects.sinks.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.sinks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+sinkName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * logging.projects.sinks.list + * @desc Lists sinks. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The parent resource whose sinks are to be listed: + * // "projects/[PROJECT_ID]" + * // "organizations/[ORGANIZATION_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]" + * // "folders/[FOLDER_ID]" + * parent: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var sinksPage = response['sinks']; + * if (!sinksPage) { + * return; + * } + * for (var i = 0; i < sinksPage.length; i++) { + * // TODO: Change code below to process each resource in `sinksPage`: + * console.log(JSON.stringify(sinksPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * logging.projects.sinks.list(request, handlePage); + * } + * }; + * + * logging.projects.sinks.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.sinks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + * @param {string=} params.pageToken Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + * @param {string} params.parent Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+parent}/sinks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2beta1/{+sinkName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['sinkName'], - pathParams: ['sinkName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * logging.projects.sinks.update + * @desc Updates a sink. This method replaces the following fields in the + * existing sink with values from the new sink: destination, and filter. The + * updated sink might also have a new writer_identity; see the + * unique_writer_identity field. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Stackdriver Logging API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/logging + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var logging = google.logging('v2beta1'); + * + * authorize(function(authClient) { + * var request = { + * // Required. The full resource name of the sink to update, including + * the parent resource and the sink + * // identifier: + * // "projects/[PROJECT_ID]/sinks/[SINK_ID]" + * // "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + * // "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + * // "folders/[FOLDER_ID]/sinks/[SINK_ID]" + * // Example: "projects/my-project-id/sinks/my-sink-id". + * sinkName: 'projects/my-project/sinks/my-sink', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * logging.projects.sinks.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias logging.projects.sinks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.sinkName Required. The full resource name of the sink to update, including the parent resource and the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id". + * @param {boolean=} params.uniqueWriterIdentity Optional. See sinks.create for a description of this field. When updating a sink, the effect of this field on the value of writer_identity in the updated sink depends on both the old and new values of this field: If the old and new values of this field are both false or both true, then there is no change to the sink's writer_identity. If the old value is false and the new value is true, then writer_identity is changed to a unique service account. It is an error if the old value is true and the new value is set to false or defaulted to false. + * @param {string=} params.updateMask Optional. Field mask that specifies the fields in sink that need an update. A sink field will be overwritten if, and only if, it is in the update mask. name and output only fields cannot be updated.An empty updateMask is temporarily treated as using the following mask for backwards compatibility purposes: destination,filter,includeChildren At some point in the future, behavior will be removed and specifying an empty updateMask will be an error.For a detailed FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmaskExample: updateMask=filter. + * @param {().LogSink} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://logging.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2beta1/{+sinkName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['sinkName'], + pathParams: ['sinkName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/manufacturers/v1.ts b/src/apis/manufacturers/v1.ts index b792c6ba4c2..85ed207025b 100644 --- a/src/apis/manufacturers/v1.ts +++ b/src/apis/manufacturers/v1.ts @@ -27,714 +27,727 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Manufacturer Center API - * - * Public API for managing Manufacturer Center related data. - * - * @example - * const google = require('googleapis'); - * const manufacturers = google.manufacturers('v1'); - * - * @namespace manufacturers - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Manufacturers - */ -export class Manufacturers { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace manufacturers_v1 { + /** + * Manufacturer Center API + * + * Public API for managing Manufacturer Center related data. + * + * @example + * const google = require('googleapis'); + * const manufacturers = google.manufacturers('v1'); + * + * @namespace manufacturers + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Manufacturers + */ + export class Manufacturers { + _options: GlobalOptions; + google: GoogleApis; + root = this; - accounts: Resource$Accounts; + accounts: Resource$Accounts; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.accounts = new Resource$Accounts(this); - } + this.accounts = new Resource$Accounts(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Attributes of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116. - */ -export interface Schema$Attributes { - /** - * The additional images of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#addlimage. - */ - additionalImageLink: Schema$Image[]; /** - * The target age group of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#agegroup. - */ - ageGroup: string; - /** - * The brand name of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#brand. + * Attributes of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116. */ - brand: string; + export interface Schema$Attributes { + /** + * The additional images of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#addlimage. + */ + additionalImageLink: Schema$Image[]; + /** + * The target age group of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#agegroup. + */ + ageGroup: string; + /** + * The brand name of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#brand. + */ + brand: string; + /** + * The capacity of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#capacity. + */ + capacity: Schema$Capacity; + /** + * The color of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#color. + */ + color: string; + /** + * The count of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#count. + */ + count: Schema$Count; + /** + * The description of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#description. + */ + description: string; + /** + * The disclosure date of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#disclosure. + */ + disclosureDate: string; + /** + * A list of excluded destinations. + */ + excludedDestination: string[]; + /** + * The rich format description of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#featuredesc. + */ + featureDescription: Schema$FeatureDescription[]; + /** + * The flavor of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#flavor. + */ + flavor: string; + /** + * The format of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#format. + */ + format: string; + /** + * The target gender of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#gender. + */ + gender: string; + /** + * The Global Trade Item Number (GTIN) of the product. For more information, + * see https://support.google.com/manufacturers/answer/6124116#gtin. + */ + gtin: string[]; + /** + * The image of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#image. + */ + imageLink: Schema$Image; + /** + * A list of included destinations. + */ + includedDestination: string[]; + /** + * The item group id of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#itemgroupid. + */ + itemGroupId: string; + /** + * The material of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#material. + */ + material: string; + /** + * The Manufacturer Part Number (MPN) of the product. For more information, + * see https://support.google.com/manufacturers/answer/6124116#mpn. + */ + mpn: string; + /** + * The pattern of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#pattern. + */ + pattern: string; + /** + * The details of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#productdetail. + */ + productDetail: Schema$ProductDetail[]; + /** + * The name of the group of products related to the product. For more + * information, see + * https://support.google.com/manufacturers/answer/6124116#productline. + */ + productLine: string; + /** + * The canonical name of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#productname. + */ + productName: string; + /** + * The URL of the detail page of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#productpage. + */ + productPageUrl: string; + /** + * The type or category of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#producttype. + */ + productType: string[]; + /** + * The release date of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#release. + */ + releaseDate: string; + /** + * The scent of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#scent. + */ + scent: string; + /** + * The size of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#size. + */ + size: string; + /** + * The size system of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#sizesystem. + */ + sizeSystem: string; + /** + * The size type of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#sizetype. + */ + sizeType: string; + /** + * The suggested retail price (MSRP) of the product. For more information, + * see https://support.google.com/manufacturers/answer/6124116#price. + */ + suggestedRetailPrice: Schema$Price; + /** + * The target client id. Should only be used in the accounts of the data + * partners. + */ + targetClientId: string; + /** + * The theme of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#theme. + */ + theme: string; + /** + * The title of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#title. + */ + title: string; + /** + * The videos of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#video. + */ + videoLink: string[]; + } /** - * The capacity of the product. For more information, see + * The capacity of a product. For more information, see * https://support.google.com/manufacturers/answer/6124116#capacity. */ - capacity: Schema$Capacity; - /** - * The color of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#color. - */ - color: string; + export interface Schema$Capacity { + /** + * The unit of the capacity, i.e., MB, GB, or TB. + */ + unit: string; + /** + * The numeric value of the capacity. + */ + value: string; + } /** - * The count of the product. For more information, see + * The number of products in a single package. For more information, see * https://support.google.com/manufacturers/answer/6124116#count. */ - count: Schema$Count; - /** - * The description of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#description. - */ - description: string; + export interface Schema$Count { + /** + * The unit in which these products are counted. + */ + unit: string; + /** + * The numeric value of the number of products in a package. + */ + value: string; + } /** - * The disclosure date of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#disclosure. - */ - disclosureDate: string; + * The destination status. + */ + export interface Schema$DestinationStatus { + /** + * The name of the destination. + */ + destination: string; + /** + * The status of the destination. + */ + status: string; + } /** - * A list of excluded destinations. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - excludedDestination: string[]; + export interface Schema$Empty {} /** - * The rich format description of the product. For more information, see + * A feature description of the product. For more information, see * https://support.google.com/manufacturers/answer/6124116#featuredesc. */ - featureDescription: Schema$FeatureDescription[]; - /** - * The flavor of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#flavor. - */ - flavor: string; - /** - * The format of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#format. - */ - format: string; - /** - * The target gender of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#gender. - */ - gender: string; - /** - * The Global Trade Item Number (GTIN) of the product. For more information, - * see https://support.google.com/manufacturers/answer/6124116#gtin. - */ - gtin: string[]; - /** - * The image of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#image. - */ - imageLink: Schema$Image; - /** - * A list of included destinations. - */ - includedDestination: string[]; + export interface Schema$FeatureDescription { + /** + * A short description of the feature. + */ + headline: string; + /** + * An optional image describing the feature. + */ + image: Schema$Image; + /** + * A detailed description of the feature. + */ + text: string; + } /** - * The item group id of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#itemgroupid. - */ - itemGroupId: string; + * An image. + */ + export interface Schema$Image { + /** + * The URL of the image. For crawled images, this is the provided URL. For + * uploaded images, this is a serving URL from Google if the image has been + * processed successfully. + */ + imageUrl: string; + /** + * The status of the image. @OutputOnly + */ + status: string; + /** + * The type of the image, i.e., crawled or uploaded. @OutputOnly + */ + type: string; + } /** - * The material of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#material. - */ - material: string; + * Product issue. + */ + export interface Schema$Issue { + /** + * If present, the attribute that triggered the issue. For more information + * about attributes, see + * https://support.google.com/manufacturers/answer/6124116. + */ + attribute: string; + /** + * Longer description of the issue focused on how to resolve it. + */ + description: string; + /** + * The destination this issue applies to. + */ + destination: string; + /** + * What needs to happen to resolve the issue. + */ + resolution: string; + /** + * The severity of the issue. + */ + severity: string; + /** + * The timestamp when this issue appeared. + */ + timestamp: string; + /** + * Short title describing the nature of the issue. + */ + title: string; + /** + * The server-generated type of the issue, for example, + * “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc. + */ + type: string; + } + export interface Schema$ListProductsResponse { + /** + * The token for the retrieval of the next page of product statuses. + */ + nextPageToken: string; + /** + * List of the products. + */ + products: Schema$Product[]; + } /** - * The Manufacturer Part Number (MPN) of the product. For more information, - * see https://support.google.com/manufacturers/answer/6124116#mpn. - */ - mpn: string; + * A price. + */ + export interface Schema$Price { + /** + * The numeric value of the price. + */ + amount: string; + /** + * The currency in which the price is denoted. + */ + currency: string; + } /** - * The pattern of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#pattern. - */ - pattern: string; + * Product data. + */ + export interface Schema$Product { + /** + * Attributes of the product uploaded to the Manufacturer Center. + */ + attributes: Schema$Attributes; + /** + * The content language of the product as a two-letter ISO 639-1 language + * code (for example, en). + */ + contentLanguage: string; + /** + * The status of the destinations. + */ + destinationStatuses: Schema$DestinationStatus[]; + /** + * Final attributes of the product. The final attributes are obtained by + * overriding the uploaded attributes with the manually provided and deleted + * attributes. Google systems only process, evaluate, review, and/or use + * final attributes. This field is deprecated and will be removed end of + * July 2018. Please use attributes. + */ + finalAttributes: Schema$Attributes; + /** + * A server-generated list of issues associated with the product. + */ + issues: Schema$Issue[]; + /** + * Names of the attributes of the product deleted manually via the + * Manufacturer Center UI. This field is deprecated and will be removed end + * of July 2018. Please use attributes. + */ + manuallyDeletedAttributes: string[]; + /** + * Attributes of the product provided manually via the Manufacturer Center + * UI. This field is deprecated and will be removed end of July 2018. + * Please use attributes. + */ + manuallyProvidedAttributes: Schema$Attributes; + /** + * Name in the format `{target_country}:{content_language}:{product_id}`. + * `target_country` - The target country of the product as a CLDR + * territory code (for example, US). `content_language` + * - The content language of the product as a two-letter ISO 639-1 language + * code (for example, en). `product_id` - The ID of the product. For + * more information, see + * https://support.google.com/manufacturers/answer/6124116#id. + */ + name: string; + /** + * Parent ID in the format `accounts/{account_id}`. `account_id` - The ID + * of the Manufacturer Center account. + */ + parent: string; + /** + * The ID of the product. For more information, see + * https://support.google.com/manufacturers/answer/6124116#id. + */ + productId: string; + /** + * The target country of the product as a CLDR territory code (for example, + * US). + */ + targetCountry: string; + /** + * Attributes of the product uploaded via the Manufacturer Center API or via + * feeds. This field is deprecated and will be removed end of July 2018. + * Please use attributes. + */ + uploadedAttributes: Schema$Attributes; + } /** - * The details of the product. For more information, see + * A product detail of the product. For more information, see * https://support.google.com/manufacturers/answer/6124116#productdetail. */ - productDetail: Schema$ProductDetail[]; - /** - * The name of the group of products related to the product. For more - * information, see - * https://support.google.com/manufacturers/answer/6124116#productline. - */ - productLine: string; - /** - * The canonical name of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#productname. - */ - productName: string; - /** - * The URL of the detail page of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#productpage. - */ - productPageUrl: string; - /** - * The type or category of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#producttype. - */ - productType: string[]; - /** - * The release date of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#release. - */ - releaseDate: string; - /** - * The scent of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#scent. - */ - scent: string; - /** - * The size of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#size. - */ - size: string; - /** - * The size system of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#sizesystem. - */ - sizeSystem: string; - /** - * The size type of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#sizetype. - */ - sizeType: string; - /** - * The suggested retail price (MSRP) of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#price. - */ - suggestedRetailPrice: Schema$Price; - /** - * The target client id. Should only be used in the accounts of the data - * partners. - */ - targetClientId: string; - /** - * The theme of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#theme. - */ - theme: string; - /** - * The title of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#title. - */ - title: string; - /** - * The videos of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#video. - */ - videoLink: string[]; -} -/** - * The capacity of a product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#capacity. - */ -export interface Schema$Capacity { - /** - * The unit of the capacity, i.e., MB, GB, or TB. - */ - unit: string; - /** - * The numeric value of the capacity. - */ - value: string; -} -/** - * The number of products in a single package. For more information, see - * https://support.google.com/manufacturers/answer/6124116#count. - */ -export interface Schema$Count { - /** - * The unit in which these products are counted. - */ - unit: string; - /** - * The numeric value of the number of products in a package. - */ - value: string; -} -/** - * The destination status. - */ -export interface Schema$DestinationStatus { - /** - * The name of the destination. - */ - destination: string; - /** - * The status of the destination. - */ - status: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A feature description of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#featuredesc. - */ -export interface Schema$FeatureDescription { - /** - * A short description of the feature. - */ - headline: string; - /** - * An optional image describing the feature. - */ - image: Schema$Image; - /** - * A detailed description of the feature. - */ - text: string; -} -/** - * An image. - */ -export interface Schema$Image { - /** - * The URL of the image. For crawled images, this is the provided URL. For - * uploaded images, this is a serving URL from Google if the image has been - * processed successfully. - */ - imageUrl: string; - /** - * The status of the image. @OutputOnly - */ - status: string; - /** - * The type of the image, i.e., crawled or uploaded. @OutputOnly - */ - type: string; -} -/** - * Product issue. - */ -export interface Schema$Issue { - /** - * If present, the attribute that triggered the issue. For more information - * about attributes, see - * https://support.google.com/manufacturers/answer/6124116. - */ - attribute: string; - /** - * Longer description of the issue focused on how to resolve it. - */ - description: string; - /** - * The destination this issue applies to. - */ - destination: string; - /** - * What needs to happen to resolve the issue. - */ - resolution: string; - /** - * The severity of the issue. - */ - severity: string; - /** - * The timestamp when this issue appeared. - */ - timestamp: string; - /** - * Short title describing the nature of the issue. - */ - title: string; - /** - * The server-generated type of the issue, for example, - * “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc. - */ - type: string; -} -export interface Schema$ListProductsResponse { - /** - * The token for the retrieval of the next page of product statuses. - */ - nextPageToken: string; - /** - * List of the products. - */ - products: Schema$Product[]; -} -/** - * A price. - */ -export interface Schema$Price { - /** - * The numeric value of the price. - */ - amount: string; - /** - * The currency in which the price is denoted. - */ - currency: string; -} -/** - * Product data. - */ -export interface Schema$Product { - /** - * Attributes of the product uploaded to the Manufacturer Center. - */ - attributes: Schema$Attributes; - /** - * The content language of the product as a two-letter ISO 639-1 language code - * (for example, en). - */ - contentLanguage: string; - /** - * The status of the destinations. - */ - destinationStatuses: Schema$DestinationStatus[]; - /** - * Final attributes of the product. The final attributes are obtained by - * overriding the uploaded attributes with the manually provided and deleted - * attributes. Google systems only process, evaluate, review, and/or use final - * attributes. This field is deprecated and will be removed end of July 2018. - * Please use attributes. - */ - finalAttributes: Schema$Attributes; - /** - * A server-generated list of issues associated with the product. - */ - issues: Schema$Issue[]; - /** - * Names of the attributes of the product deleted manually via the - * Manufacturer Center UI. This field is deprecated and will be removed end - * of July 2018. Please use attributes. - */ - manuallyDeletedAttributes: string[]; - /** - * Attributes of the product provided manually via the Manufacturer Center UI. - * This field is deprecated and will be removed end of July 2018. Please use - * attributes. - */ - manuallyProvidedAttributes: Schema$Attributes; - /** - * Name in the format `{target_country}:{content_language}:{product_id}`. - * `target_country` - The target country of the product as a CLDR territory - * code (for example, US). `content_language` - The content language of the - * product as a two-letter ISO 639-1 language code (for - * example, en). `product_id` - The ID of the product. For more - * information, see - * https://support.google.com/manufacturers/answer/6124116#id. - */ - name: string; - /** - * Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of - * the Manufacturer Center account. - */ - parent: string; - /** - * The ID of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#id. - */ - productId: string; - /** - * The target country of the product as a CLDR territory code (for example, - * US). - */ - targetCountry: string; - /** - * Attributes of the product uploaded via the Manufacturer Center API or via - * feeds. This field is deprecated and will be removed end of July 2018. - * Please use attributes. - */ - uploadedAttributes: Schema$Attributes; -} -/** - * A product detail of the product. For more information, see - * https://support.google.com/manufacturers/answer/6124116#productdetail. - */ -export interface Schema$ProductDetail { - /** - * The name of the attribute. - */ - attributeName: string; - /** - * The value of the attribute. - */ - attributeValue: string; - /** - * A short section name that can be reused between multiple product details. - */ - sectionName: string; -} - -export class Resource$Accounts { - root: Manufacturers; - products: Resource$Accounts$Products; - constructor(root: Manufacturers) { - this.root = root; - this.getRoot.bind(this); - this.products = new Resource$Accounts$Products(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Accounts$Products { - root: Manufacturers; - constructor(root: Manufacturers) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$ProductDetail { + /** + * The name of the attribute. + */ + attributeName: string; + /** + * The value of the attribute. + */ + attributeValue: string; + /** + * A short section name that can be reused between multiple product details. + */ + sectionName: string; } + export class Resource$Accounts { + root: Manufacturers; + products: Resource$Accounts$Products; + constructor(root: Manufacturers) { + this.root = root; + this.getRoot.bind(this); + this.products = new Resource$Accounts$Products(root); + } - /** - * manufacturers.accounts.products.delete - * @desc Deletes the product from a Manufacturer Center account. - * @alias manufacturers.accounts.products.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. - * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Accounts$Products { + root: Manufacturers; + constructor(root: Manufacturers) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://manufacturers.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/products/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['parent', 'name'], - pathParams: ['name', 'parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * manufacturers.accounts.products.get - * @desc Gets the product from a Manufacturer Center account, including - * product issues. A recently updated product takes around 15 minutes to - * process. Changes are only visible after it has been processed. While some - * issues may be available once the product has been processed, other issues - * may take days to appear. - * @alias manufacturers.accounts.products.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.include The information to be included in the response. Only sections listed here will be returned. If this parameter is not specified, ATTRIBUTES and ISSUES are returned. This behavior is temporary and will be removed once all clients are ready or at the latest end of July 2018. After that no sections will be returned. - * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. - * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://manufacturers.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/products/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent', 'name'], - pathParams: ['name', 'parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * manufacturers.accounts.products.delete + * @desc Deletes the product from a Manufacturer Center account. + * @alias manufacturers.accounts.products.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. + * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://manufacturers.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/products/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['parent', 'name'], + pathParams: ['name', 'parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * manufacturers.accounts.products.list - * @desc Lists all the products in a Manufacturer Center account. - * @alias manufacturers.accounts.products.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.include The information to be included in the response. Only sections listed here will be returned. If this parameter is not specified, ATTRIBUTES and ISSUES are returned. This behavior is temporary and will be removed once all clients are ready or at the latest end of July 2018. After that no sections will be returned. - * @param {integer=} params.pageSize Maximum number of product statuses to return in the response, used for paging. - * @param {string=} params.pageToken The token returned by the previous request. - * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * manufacturers.accounts.products.get + * @desc Gets the product from a Manufacturer Center account, including + * product issues. A recently updated product takes around 15 minutes to + * process. Changes are only visible after it has been processed. While some + * issues may be available once the product has been processed, other issues + * may take days to appear. + * @alias manufacturers.accounts.products.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.include The information to be included in the response. Only sections listed here will be returned. If this parameter is not specified, ATTRIBUTES and ISSUES are returned. This behavior is temporary and will be removed once all clients are ready or at the latest end of July 2018. After that no sections will be returned. + * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. + * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://manufacturers.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/products/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent', 'name'], + pathParams: ['name', 'parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://manufacturers.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/products') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * manufacturers.accounts.products.update - * @desc Inserts or updates the attributes of the product in a Manufacturer - * Center account. Creates a product with the provided attributes. If the - * product already exists, then all attributes are replaced with the new ones. - * The checks at upload time are minimal. All required attributes need to be - * present for a product to be valid. Issues may show up later after the API - * has accepted a new upload for a product and it is possible to overwrite an - * existing valid product with an invalid product. To detect this, you should - * retrieve the product and check it for issues once the new version is - * available. Uploaded attributes first need to be processed before they can - * be retrieved. Until then, new products will be unavailable, and retrieval - * of previously uploaded products will return the original state of the - * product. - * @alias manufacturers.accounts.products.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. - * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. - * @param {().Attributes} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * manufacturers.accounts.products.list + * @desc Lists all the products in a Manufacturer Center account. + * @alias manufacturers.accounts.products.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.include The information to be included in the response. Only sections listed here will be returned. If this parameter is not specified, ATTRIBUTES and ISSUES are returned. This behavior is temporary and will be removed once all clients are ready or at the latest end of July 2018. After that no sections will be returned. + * @param {integer=} params.pageSize Maximum number of product statuses to return in the response, used for paging. + * @param {string=} params.pageToken The token returned by the previous request. + * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://manufacturers.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/products') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://manufacturers.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/products/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['parent', 'name'], - pathParams: ['name', 'parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * manufacturers.accounts.products.update + * @desc Inserts or updates the attributes of the product in a Manufacturer + * Center account. Creates a product with the provided attributes. If the + * product already exists, then all attributes are replaced with the new + * ones. The checks at upload time are minimal. All required attributes need + * to be present for a product to be valid. Issues may show up later after + * the API has accepted a new upload for a product and it is possible to + * overwrite an existing valid product with an invalid product. To detect + * this, you should retrieve the product and check it for issues once the + * new version is available. Uploaded attributes first need to be processed + * before they can be retrieved. Until then, new products will be + * unavailable, and retrieval of previously uploaded products will return + * the original state of the product. + * @alias manufacturers.accounts.products.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name in the format `{target_country}:{content_language}:{product_id}`. `target_country` - The target country of the product as a CLDR territory code (for example, US). `content_language` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `product_id` - The ID of the product. For more information, see https://support.google.com/manufacturers/answer/6124116#id. + * @param {string} params.parent Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. + * @param {().Attributes} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://manufacturers.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/products/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['parent', 'name'], + pathParams: ['name', 'parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/mirror/v1.ts b/src/apis/mirror/v1.ts index ae1f4aa35bc..b3cd4ba47eb 100644 --- a/src/apis/mirror/v1.ts +++ b/src/apis/mirror/v1.ts @@ -27,2069 +27,2087 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Mirror API - * - * Interacts with Glass users via the timeline. - * - * @example - * const google = require('googleapis'); - * const mirror = google.mirror('v1'); - * - * @namespace mirror - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Mirror - */ -export class Mirror { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - contacts: Resource$Contacts; - locations: Resource$Locations; - settings: Resource$Settings; - subscriptions: Resource$Subscriptions; - timeline: Resource$Timeline; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - this.contacts = new Resource$Contacts(this); - this.locations = new Resource$Locations(this); - this.settings = new Resource$Settings(this); - this.subscriptions = new Resource$Subscriptions(this); - this.timeline = new Resource$Timeline(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Represents an account passed into the Account Manager on Glass. - */ -export interface Schema$Account { - authTokens: Schema$AuthToken[]; - features: string[]; - password: string; - userData: Schema$UserData[]; -} -/** - * Represents media content, such as a photo, that can be attached to a timeline - * item. - */ -export interface Schema$Attachment { - /** - * The MIME type of the attachment. - */ - contentType: string; - /** - * The URL for the content. - */ - contentUrl: string; - /** - * The ID of the attachment. - */ - id: string; - /** - * Indicates that the contentUrl is not available because the attachment - * content is still being processed. If the caller wishes to retrieve the - * content, it should try again later. - */ - isProcessingContent: boolean; -} -/** - * A list of Attachments. This is the response from the server to GET requests - * on the attachments collection. - */ -export interface Schema$AttachmentsListResponse { - /** - * The list of attachments. - */ - items: Schema$Attachment[]; - /** - * The type of resource. This is always mirror#attachmentsList. - */ - kind: string; -} -export interface Schema$AuthToken { - authToken: string; - type: string; -} -/** - * A single menu command that is part of a Contact. - */ -export interface Schema$Command { - /** - * The type of operation this command corresponds to. Allowed values are: - - * TAKE_A_NOTE - Shares a timeline item with the transcription of user speech - * from the "Take a note" voice menu command. - POST_AN_UPDATE - - * Shares a timeline item with the transcription of user speech from the - * "Post an update" voice menu command. - */ - type: string; -} -/** - * A person or group that can be used as a creator or a contact. - */ -export interface Schema$Contact { - /** - * A list of voice menu commands that a contact can handle. Glass shows up to - * three contacts for each voice menu command. If there are more than that, - * the three contacts with the highest priority are shown for that particular - * command. - */ - acceptCommands: Schema$Command[]; - /** - * A list of MIME types that a contact supports. The contact will be shown to - * the user if any of its acceptTypes matches any of the types of the - * attachments on the item. If no acceptTypes are given, the contact will be - * shown for all items. - */ - acceptTypes: string[]; - /** - * The name to display for this contact. - */ - displayName: string; - /** - * An ID for this contact. This is generated by the application and is treated - * as an opaque token. - */ - id: string; - /** - * Set of image URLs to display for a contact. Most contacts will have a - * single image, but a "group" contact may include up to 8 image - * URLs and they will be resized and cropped into a mosaic on the client. - */ - imageUrls: string[]; - /** - * The type of resource. This is always mirror#contact. - */ - kind: string; - /** - * Primary phone number for the contact. This can be a fully-qualified number, - * with country calling code and area code, or a local number. - */ - phoneNumber: string; - /** - * Priority for the contact to determine ordering in a list of contacts. - * Contacts with higher priorities will be shown before ones with lower - * priorities. - */ - priority: number; - /** - * A list of sharing features that a contact can handle. Allowed values are: - * - ADD_CAPTION - */ - sharingFeatures: string[]; - /** - * The ID of the application that created this contact. This is populated by - * the API - */ - source: string; - /** - * Name of this contact as it should be pronounced. If this contact's name - * must be spoken as part of a voice disambiguation menu, this name is used as - * the expected pronunciation. This is useful for contact names with - * unpronounceable characters or whose display spelling is otherwise not - * phonetic. - */ - speakableName: string; - /** - * The type for this contact. This is used for sorting in UIs. Allowed values - * are: - INDIVIDUAL - Represents a single person. This is the default. - - * GROUP - Represents more than a single person. - */ - type: string; -} -/** - * A list of Contacts representing contacts. This is the response from the - * server to GET requests on the contacts collection. - */ -export interface Schema$ContactsListResponse { - /** - * Contact list. - */ - items: Schema$Contact[]; - /** - * The type of resource. This is always mirror#contacts. - */ - kind: string; -} -/** - * A geographic location that can be associated with a timeline item. - */ -export interface Schema$Location { - /** - * The accuracy of the location fix in meters. - */ - accuracy: number; - /** - * The full address of the location. - */ - address: string; - /** - * The name to be displayed. This may be a business name or a user-defined - * place, such as "Home". - */ - displayName: string; - /** - * The ID of the location. - */ - id: string; - /** - * The type of resource. This is always mirror#location. - */ - kind: string; - /** - * The latitude, in degrees. - */ - latitude: number; - /** - * The longitude, in degrees. - */ - longitude: number; - /** - * The time at which this location was captured, formatted according to RFC - * 3339. - */ - timestamp: string; -} -/** - * A list of Locations. This is the response from the server to GET requests on - * the locations collection. - */ -export interface Schema$LocationsListResponse { - /** - * The list of locations. - */ - items: Schema$Location[]; - /** - * The type of resource. This is always mirror#locationsList. - */ - kind: string; -} -/** - * A custom menu item that can be presented to the user by a timeline item. - */ -export interface Schema$MenuItem { - /** - * Controls the behavior when the user picks the menu option. Allowed values - * are: - CUSTOM - Custom action set by the service. When the user selects - * this menuItem, the API triggers a notification to your callbackUrl with the - * userActions.type set to CUSTOM and the userActions.payload set to the ID of - * this menu item. This is the default value. - Built-in actions: - REPLY - - * Initiate a reply to the timeline item using the voice recording UI. The - * creator attribute must be set in the timeline item for this menu to be - * available. - REPLY_ALL - Same behavior as REPLY. The original timeline - * item's recipients will be added to the reply item. - DELETE - Delete - * the timeline item. - SHARE - Share the timeline item with the available - * contacts. - READ_ALOUD - Read the timeline item's speakableText aloud; - * if this field is not set, read the text field; if none of those fields are - * set, this menu item is ignored. - GET_MEDIA_INPUT - Allow users to provide - * media payloads to Glassware from a menu item (currently, only transcribed - * text from voice input is supported). Subscribe to notifications when users - * invoke this menu item to receive the timeline item ID. Retrieve the media - * from the timeline item in the payload property. - VOICE_CALL - Initiate a - * phone call using the timeline item's creator.phoneNumber attribute as - * recipient. - NAVIGATE - Navigate to the timeline item's location. - - * TOGGLE_PINNED - Toggle the isPinned state of the timeline item. - OPEN_URI - * - Open the payload of the menu item in the browser. - PLAY_VIDEO - Open - * the payload of the menu item in the Glass video player. - SEND_MESSAGE - - * Initiate sending a message to the timeline item's creator: - If the - * creator.phoneNumber is set and Glass is connected to an Android phone, the - * message is an SMS. - Otherwise, if the creator.email is set, the message - * is an email. - */ - action: string; - /** - * The ContextualMenus.Command associated with this MenuItem (e.g. - * READ_ALOUD). The voice label for this command will be displayed in the - * voice menu and the touch label will be displayed in the touch menu. Note - * that the default menu value's display name will be overriden if you - * specify this property. Values that do not correspond to a - * ContextualMenus.Command name will be ignored. - */ - contextual_command: string; - /** - * The ID for this menu item. This is generated by the application and is - * treated as an opaque token. - */ - id: string; - /** - * A generic payload whose meaning changes depending on this MenuItem's - * action. - When the action is OPEN_URI, the payload is the URL of the - * website to view. - When the action is PLAY_VIDEO, the payload is the - * streaming URL of the video - When the action is GET_MEDIA_INPUT, the - * payload is the text transcription of a user's speech input - */ - payload: string; - /** - * If set to true on a CUSTOM menu item, that item will be removed from the - * menu after it is selected. - */ - removeWhenSelected: boolean; - /** - * For CUSTOM items, a list of values controlling the appearance of the menu - * item in each of its states. A value for the DEFAULT state must be provided. - * If the PENDING or CONFIRMED states are missing, they will not be shown. - */ - values: Schema$MenuValue[]; -} -/** - * A single value that is part of a MenuItem. - */ -export interface Schema$MenuValue { - /** - * The name to display for the menu item. If you specify this property for a - * built-in menu item, the default contextual voice command for that menu item - * is not shown. - */ - displayName: string; - /** - * URL of an icon to display with the menu item. - */ - iconUrl: string; - /** - * The state that this value applies to. Allowed values are: - DEFAULT - - * Default value shown when displayed in the menuItems list. - PENDING - - * Value shown when the menuItem has been selected by the user but can still - * be cancelled. - CONFIRMED - Value shown when the menuItem has been - * selected by the user and can no longer be cancelled. - */ - state: string; -} -/** - * A notification delivered by the API. - */ -export interface Schema$Notification { - /** - * The collection that generated the notification. - */ - collection: string; - /** - * The ID of the item that generated the notification. - */ - itemId: string; - /** - * The type of operation that generated the notification. - */ - operation: string; - /** - * A list of actions taken by the user that triggered the notification. - */ - userActions: Schema$UserAction[]; - /** - * The user token provided by the service when it subscribed for - * notifications. - */ - userToken: string; - /** - * The secret verify token provided by the service when it subscribed for - * notifications. - */ - verifyToken: string; -} -/** - * Controls how notifications for a timeline item are presented to the user. - */ -export interface Schema$NotificationConfig { - /** - * The time at which the notification should be delivered. - */ - deliveryTime: string; - /** - * Describes how important the notification is. Allowed values are: - - * DEFAULT - Notifications of default importance. A chime will be played to - * alert users. - */ - level: string; -} -/** - * A setting for Glass. - */ -export interface Schema$Setting { - /** - * The setting's ID. The following IDs are valid: - locale - The key to - * the user’s language/locale (BCP 47 identifier) that Glassware should use to - * render localized content. - timezone - The key to the user’s current time - * zone region as defined in the tz database. Example: America/Los_Angeles. - */ - id: string; - /** - * The type of resource. This is always mirror#setting. - */ - kind: string; - /** - * The setting value, as a string. - */ - value: string; -} -/** - * A subscription to events on a collection. - */ -export interface Schema$Subscription { - /** - * The URL where notifications should be delivered (must start with https://). - */ - callbackUrl: string; - /** - * The collection to subscribe to. Allowed values are: - timeline - Changes - * in the timeline including insertion, deletion, and updates. - locations - - * Location updates. - settings - Settings updates. - */ - collection: string; - /** - * The ID of the subscription. - */ - id: string; - /** - * The type of resource. This is always mirror#subscription. - */ - kind: string; - /** - * Container object for notifications. This is not populated in the - * Subscription resource. - */ - notification: Schema$Notification; - /** - * A list of operations that should be subscribed to. An empty list indicates - * that all operations on the collection should be subscribed to. Allowed - * values are: - UPDATE - The item has been updated. - INSERT - A new item - * has been inserted. - DELETE - The item has been deleted. - MENU_ACTION - - * A custom menu item has been triggered by the user. - */ - operation: string[]; - /** - * The time at which this subscription was last modified, formatted according - * to RFC 3339. - */ - updated: string; - /** - * An opaque token sent to the subscriber in notifications so that it can - * determine the ID of the user. - */ - userToken: string; - /** - * A secret token sent to the subscriber in notifications so that it can - * verify that the notification was generated by Google. - */ - verifyToken: string; -} -/** - * A list of Subscriptions. This is the response from the server to GET requests - * on the subscription collection. - */ -export interface Schema$SubscriptionsListResponse { - /** - * The list of subscriptions. - */ - items: Schema$Subscription[]; - /** - * The type of resource. This is always mirror#subscriptionsList. - */ - kind: string; -} -/** - * Each item in the user's timeline is represented as a TimelineItem JSON - * structure, described below. - */ -export interface Schema$TimelineItem { - /** - * A list of media attachments associated with this item. As a convenience, - * you can refer to attachments in your HTML payloads with the attachment or - * cid scheme. For example: - attachment: <img - * src="attachment:attachment_index"> where attachment_index is - * the 0-based index of this array. - cid: <img - * src="cid:attachment_id"> where attachment_id is the ID of the - * attachment. - */ - attachments: Schema$Attachment[]; - /** - * The bundle ID for this item. Services can specify a bundleId to group many - * items together. They appear under a single top-level item on the device. - */ - bundleId: string; - /** - * A canonical URL pointing to the canonical/high quality version of the data - * represented by the timeline item. - */ - canonicalUrl: string; - /** - * The time at which this item was created, formatted according to RFC 3339. - */ - created: string; - /** - * The user or group that created this item. - */ - creator: Schema$Contact; - /** - * The time that should be displayed when this item is viewed in the timeline, - * formatted according to RFC 3339. This user's timeline is sorted - * chronologically on display time, so this will also determine where the item - * is displayed in the timeline. If not set by the service, the display time - * defaults to the updated time. - */ - displayTime: string; - /** - * ETag for this item. - */ - etag: string; - /** - * HTML content for this item. If both text and html are provided for an item, - * the html will be rendered in the timeline. Allowed HTML elements - You can - * use these elements in your timeline cards. - Headers: h1, h2, h3, h4, h5, - * h6 - Images: img - Lists: li, ol, ul - HTML5 semantics: article, aside, - * details, figure, figcaption, footer, header, nav, section, summary, time - - * Structural: blockquote, br, div, hr, p, span - Style: b, big, center, em, - * i, u, s, small, strike, strong, style, sub, sup - Tables: table, tbody, - * td, tfoot, th, thead, tr Blocked HTML elements: These elements and their - * contents are removed from HTML payloads. - Document headers: head, title - * - Embeds: audio, embed, object, source, video - Frames: frame, frameset - - * Scripting: applet, script Other elements: Any elements that aren't - * listed are removed, but their contents are preserved. - */ - html: string; - /** - * The ID of the timeline item. This is unique within a user's timeline. - */ - id: string; - /** - * If this item was generated as a reply to another item, this field will be - * set to the ID of the item being replied to. This can be used to attach a - * reply to the appropriate conversation or post. - */ - inReplyTo: string; - /** - * Whether this item is a bundle cover. If an item is marked as a bundle - * cover, it will be the entry point to the bundle of items that have the same - * bundleId as that item. It will be shown only on the main timeline — not - * within the opened bundle. On the main timeline, items that are shown are: - * - Items that have isBundleCover set to true - Items that do not have a - * bundleId In a bundle sub-timeline, items that are shown are: - Items - * that have the bundleId in question AND isBundleCover set to false - */ - isBundleCover: boolean; - /** - * When true, indicates this item is deleted, and only the ID property is set. - */ - isDeleted: boolean; - /** - * When true, indicates this item is pinned, which means it's grouped - * alongside "active" items like navigation and hangouts, on the - * opposite side of the home screen from historical (non-pinned) timeline - * items. You can allow the user to toggle the value of this property with the - * TOGGLE_PINNED built-in menu item. - */ - isPinned: boolean; - /** - * The type of resource. This is always mirror#timelineItem. - */ - kind: string; - /** - * The geographic location associated with this item. - */ - location: Schema$Location; - /** - * A list of menu items that will be presented to the user when this item is - * selected in the timeline. - */ - menuItems: Schema$MenuItem[]; - /** - * Controls how notifications for this item are presented on the device. If - * this is missing, no notification will be generated. - */ - notification: Schema$NotificationConfig; - /** - * For pinned items, this determines the order in which the item is displayed - * in the timeline, with a higher score appearing closer to the clock. Note: - * setting this field is currently not supported. - */ - pinScore: number; - /** - * A list of users or groups that this item has been shared with. - */ - recipients: Schema$Contact[]; - /** - * A URL that can be used to retrieve this item. - */ - selfLink: string; - /** - * Opaque string you can use to map a timeline item to data in your own - * service. - */ - sourceItemId: string; +export namespace mirror_v1 { /** - * The speakable version of the content of this item. Along with the - * READ_ALOUD menu item, use this field to provide text that would be clearer - * when read aloud, or to provide extended information to what is displayed - * visually on Glass. Glassware should also specify the speakableType field, - * which will be spoken before this text in cases where the additional context - * is useful, for example when the user requests that the item be read aloud - * following a notification. - */ - speakableText: string; - /** - * A speakable description of the type of this item. This will be announced to - * the user prior to reading the content of the item in cases where the - * additional context is useful, for example when the user requests that the - * item be read aloud following a notification. This should be a short, - * simple noun phrase such as "Email", "Text message", or - * "Daily Planet News Update". Glassware are encouraged to populate - * this field for every timeline item, even if the item does not contain - * speakableText or text so that the user can learn the type of the item - * without looking at the screen. - */ - speakableType: string; - /** - * Text content of this item. - */ - text: string; - /** - * The title of this item. - */ - title: string; - /** - * The time at which this item was last modified, formatted according to RFC - * 3339. - */ - updated: string; -} -/** - * A list of timeline items. This is the response from the server to GET - * requests on the timeline collection. - */ -export interface Schema$TimelineListResponse { - /** - * Items in the timeline. - */ - items: Schema$TimelineItem[]; - /** - * The type of resource. This is always mirror#timeline. - */ - kind: string; - /** - * The next page token. Provide this as the pageToken parameter in the request - * to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Represents an action taken by the user that triggered a notification. - */ -export interface Schema$UserAction { - /** - * An optional payload for the action. For actions of type CUSTOM, this is - * the ID of the custom menu item that was selected. - */ - payload: string; - /** - * The type of action. The value of this can be: - SHARE - the user shared - * an item. - REPLY - the user replied to an item. - REPLY_ALL - the user - * replied to all recipients of an item. - CUSTOM - the user selected a - * custom menu item on the timeline item. - DELETE - the user deleted the - * item. - PIN - the user pinned the item. - UNPIN - the user unpinned the - * item. - LAUNCH - the user initiated a voice command. In the future, - * additional types may be added. UserActions with unrecognized types should - * be ignored. - */ - type: string; -} -export interface Schema$UserData { - key: string; - value: string; -} - -export class Resource$Accounts { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * mirror.accounts.insert - * @desc Inserts a new account for a user - * @alias mirror.accounts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountName The name of the account to be passed to the Android Account Manager. - * @param {string} params.accountType Account type to be passed to Android Account Manager. - * @param {string} params.userToken The ID for the user. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/mirror/v1/accounts/{userToken}/{accountType}/{accountName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userToken', 'accountType', 'accountName'], - pathParams: ['accountName', 'accountType', 'userToken'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Contacts { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * mirror.contacts.delete - * @desc Deletes a contact. - * @alias mirror.contacts.delete - * @memberOf! () + * Google Mirror API * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the contact. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/contacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * mirror.contacts.get - * @desc Gets a single contact by ID. - * @alias mirror.contacts.get - * @memberOf! () + * Interacts with Glass users via the timeline. * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the contact. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/contacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * mirror.contacts.insert - * @desc Inserts a new contact. - * @alias mirror.contacts.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const mirror = google.mirror('v1'); * - * @param {object} params Parameters for request - * @param {().Contact} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/mirror/v1/contacts').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace mirror + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Mirror + */ + export class Mirror { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + contacts: Resource$Contacts; + locations: Resource$Locations; + settings: Resource$Settings; + subscriptions: Resource$Subscriptions; + timeline: Resource$Timeline; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + this.contacts = new Resource$Contacts(this); + this.locations = new Resource$Locations(this); + this.settings = new Resource$Settings(this); + this.subscriptions = new Resource$Subscriptions(this); + this.timeline = new Resource$Timeline(this); + } + + getRoot() { + return this.root; } } - /** - * mirror.contacts.list - * @desc Retrieves a list of contacts for the authenticated user. - * @alias mirror.contacts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Represents an account passed into the Account Manager on Glass. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/mirror/v1/contacts').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Account { + authTokens: Schema$AuthToken[]; + features: string[]; + password: string; + userData: Schema$UserData[]; } - - /** - * mirror.contacts.patch - * @desc Updates a contact in place. This method supports patch semantics. - * @alias mirror.contacts.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the contact. - * @param {().Contact} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/contacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents media content, such as a photo, that can be attached to a + * timeline item. + */ + export interface Schema$Attachment { + /** + * The MIME type of the attachment. + */ + contentType: string; + /** + * The URL for the content. + */ + contentUrl: string; + /** + * The ID of the attachment. + */ + id: string; + /** + * Indicates that the contentUrl is not available because the attachment + * content is still being processed. If the caller wishes to retrieve the + * content, it should try again later. + */ + isProcessingContent: boolean; } - - /** - * mirror.contacts.update - * @desc Updates a contact in place. - * @alias mirror.contacts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the contact. - * @param {().Contact} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/contacts/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of Attachments. This is the response from the server to GET requests + * on the attachments collection. + */ + export interface Schema$AttachmentsListResponse { + /** + * The list of attachments. + */ + items: Schema$Attachment[]; + /** + * The type of resource. This is always mirror#attachmentsList. + */ + kind: string; } -} - -export class Resource$Locations { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AuthToken { + authToken: string; + type: string; } - - getRoot() { - return this.root; - } - - /** - * mirror.locations.get - * @desc Gets a single location by ID. - * @alias mirror.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the location or latest for the last known location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/locations/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A single menu command that is part of a Contact. + */ + export interface Schema$Command { + /** + * The type of operation this command corresponds to. Allowed values are: - + * TAKE_A_NOTE - Shares a timeline item with the transcription of user + * speech from the "Take a note" voice menu command. - + * POST_AN_UPDATE - Shares a timeline item with the transcription of user + * speech from the "Post an update" voice menu command. + */ + type: string; } - - /** - * mirror.locations.list - * @desc Retrieves a list of locations for the user. - * @alias mirror.locations.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Settings { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * A person or group that can be used as a creator or a contact. + */ + export interface Schema$Contact { + /** + * A list of voice menu commands that a contact can handle. Glass shows up + * to three contacts for each voice menu command. If there are more than + * that, the three contacts with the highest priority are shown for that + * particular command. + */ + acceptCommands: Schema$Command[]; + /** + * A list of MIME types that a contact supports. The contact will be shown + * to the user if any of its acceptTypes matches any of the types of the + * attachments on the item. If no acceptTypes are given, the contact will be + * shown for all items. + */ + acceptTypes: string[]; + /** + * The name to display for this contact. + */ + displayName: string; + /** + * An ID for this contact. This is generated by the application and is + * treated as an opaque token. + */ + id: string; + /** + * Set of image URLs to display for a contact. Most contacts will have a + * single image, but a "group" contact may include up to 8 image + * URLs and they will be resized and cropped into a mosaic on the client. + */ + imageUrls: string[]; + /** + * The type of resource. This is always mirror#contact. + */ + kind: string; + /** + * Primary phone number for the contact. This can be a fully-qualified + * number, with country calling code and area code, or a local number. + */ + phoneNumber: string; + /** + * Priority for the contact to determine ordering in a list of contacts. + * Contacts with higher priorities will be shown before ones with lower + * priorities. + */ + priority: number; + /** + * A list of sharing features that a contact can handle. Allowed values are: + * - ADD_CAPTION + */ + sharingFeatures: string[]; + /** + * The ID of the application that created this contact. This is populated by + * the API + */ + source: string; + /** + * Name of this contact as it should be pronounced. If this contact's + * name must be spoken as part of a voice disambiguation menu, this name is + * used as the expected pronunciation. This is useful for contact names with + * unpronounceable characters or whose display spelling is otherwise not + * phonetic. + */ + speakableName: string; + /** + * The type for this contact. This is used for sorting in UIs. Allowed + * values are: - INDIVIDUAL - Represents a single person. This is the + * default. - GROUP - Represents more than a single person. + */ + type: string; } - - /** - * mirror.settings.get - * @desc Gets a single setting by ID. - * @alias mirror.settings.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the setting. The following IDs are valid: - locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. - timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/settings/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subscriptions { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); + * A list of Contacts representing contacts. This is the response from the + * server to GET requests on the contacts collection. + */ + export interface Schema$ContactsListResponse { + /** + * Contact list. + */ + items: Schema$Contact[]; + /** + * The type of resource. This is always mirror#contacts. + */ + kind: string; } - - getRoot() { - return this.root; - } - - /** - * mirror.subscriptions.delete - * @desc Deletes a subscription. - * @alias mirror.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the subscription. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/subscriptions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A geographic location that can be associated with a timeline item. + */ + export interface Schema$Location { + /** + * The accuracy of the location fix in meters. + */ + accuracy: number; + /** + * The full address of the location. + */ + address: string; + /** + * The name to be displayed. This may be a business name or a user-defined + * place, such as "Home". + */ + displayName: string; + /** + * The ID of the location. + */ + id: string; + /** + * The type of resource. This is always mirror#location. + */ + kind: string; + /** + * The latitude, in degrees. + */ + latitude: number; + /** + * The longitude, in degrees. + */ + longitude: number; + /** + * The time at which this location was captured, formatted according to RFC + * 3339. + */ + timestamp: string; } - - /** - * mirror.subscriptions.insert - * @desc Creates a new subscription. - * @alias mirror.subscriptions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of Locations. This is the response from the server to GET requests + * on the locations collection. + */ + export interface Schema$LocationsListResponse { + /** + * The list of locations. + */ + items: Schema$Location[]; + /** + * The type of resource. This is always mirror#locationsList. + */ + kind: string; } - - /** - * mirror.subscriptions.list - * @desc Retrieves a list of subscriptions for the authenticated user and - * service. - * @alias mirror.subscriptions.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A custom menu item that can be presented to the user by a timeline item. + */ + export interface Schema$MenuItem { + /** + * Controls the behavior when the user picks the menu option. Allowed values + * are: - CUSTOM - Custom action set by the service. When the user selects + * this menuItem, the API triggers a notification to your callbackUrl with + * the userActions.type set to CUSTOM and the userActions.payload set to the + * ID of this menu item. This is the default value. - Built-in actions: - + * REPLY - Initiate a reply to the timeline item using the voice recording + * UI. The creator attribute must be set in the timeline item for this menu + * to be available. - REPLY_ALL - Same behavior as REPLY. The original + * timeline item's recipients will be added to the reply item. - DELETE + * - Delete the timeline item. - SHARE - Share the timeline item with the + * available contacts. - READ_ALOUD - Read the timeline item's + * speakableText aloud; if this field is not set, read the text field; if + * none of those fields are set, this menu item is ignored. - + * GET_MEDIA_INPUT - Allow users to provide media payloads to Glassware from + * a menu item (currently, only transcribed text from voice input is + * supported). Subscribe to notifications when users invoke this menu item + * to receive the timeline item ID. Retrieve the media from the timeline + * item in the payload property. - VOICE_CALL - Initiate a phone call using + * the timeline item's creator.phoneNumber attribute as recipient. - + * NAVIGATE - Navigate to the timeline item's location. - TOGGLE_PINNED + * - Toggle the isPinned state of the timeline item. - OPEN_URI - Open the + * payload of the menu item in the browser. - PLAY_VIDEO - Open the payload + * of the menu item in the Glass video player. - SEND_MESSAGE - Initiate + * sending a message to the timeline item's creator: - If the + * creator.phoneNumber is set and Glass is connected to an Android phone, + * the message is an SMS. - Otherwise, if the creator.email is set, the + * message is an email. + */ + action: string; + /** + * The ContextualMenus.Command associated with this MenuItem (e.g. + * READ_ALOUD). The voice label for this command will be displayed in the + * voice menu and the touch label will be displayed in the touch menu. Note + * that the default menu value's display name will be overriden if you + * specify this property. Values that do not correspond to a + * ContextualMenus.Command name will be ignored. + */ + contextual_command: string; + /** + * The ID for this menu item. This is generated by the application and is + * treated as an opaque token. + */ + id: string; + /** + * A generic payload whose meaning changes depending on this MenuItem's + * action. - When the action is OPEN_URI, the payload is the URL of the + * website to view. - When the action is PLAY_VIDEO, the payload is the + * streaming URL of the video - When the action is GET_MEDIA_INPUT, the + * payload is the text transcription of a user's speech input + */ + payload: string; + /** + * If set to true on a CUSTOM menu item, that item will be removed from the + * menu after it is selected. + */ + removeWhenSelected: boolean; + /** + * For CUSTOM items, a list of values controlling the appearance of the menu + * item in each of its states. A value for the DEFAULT state must be + * provided. If the PENDING or CONFIRMED states are missing, they will not + * be shown. + */ + values: Schema$MenuValue[]; } - - /** - * mirror.subscriptions.update - * @desc Updates an existing subscription in place. - * @alias mirror.subscriptions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the subscription. - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/subscriptions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A single value that is part of a MenuItem. + */ + export interface Schema$MenuValue { + /** + * The name to display for the menu item. If you specify this property for a + * built-in menu item, the default contextual voice command for that menu + * item is not shown. + */ + displayName: string; + /** + * URL of an icon to display with the menu item. + */ + iconUrl: string; + /** + * The state that this value applies to. Allowed values are: - DEFAULT - + * Default value shown when displayed in the menuItems list. - PENDING - + * Value shown when the menuItem has been selected by the user but can still + * be cancelled. - CONFIRMED - Value shown when the menuItem has been + * selected by the user and can no longer be cancelled. + */ + state: string; } -} - -export class Resource$Timeline { - root: Mirror; - attachments: Resource$Timeline$Attachments; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); - this.attachments = new Resource$Timeline$Attachments(root); + /** + * A notification delivered by the API. + */ + export interface Schema$Notification { + /** + * The collection that generated the notification. + */ + collection: string; + /** + * The ID of the item that generated the notification. + */ + itemId: string; + /** + * The type of operation that generated the notification. + */ + operation: string; + /** + * A list of actions taken by the user that triggered the notification. + */ + userActions: Schema$UserAction[]; + /** + * The user token provided by the service when it subscribed for + * notifications. + */ + userToken: string; + /** + * The secret verify token provided by the service when it subscribed for + * notifications. + */ + verifyToken: string; } - - getRoot() { - return this.root; + /** + * Controls how notifications for a timeline item are presented to the user. + */ + export interface Schema$NotificationConfig { + /** + * The time at which the notification should be delivered. + */ + deliveryTime: string; + /** + * Describes how important the notification is. Allowed values are: - + * DEFAULT - Notifications of default importance. A chime will be played to + * alert users. + */ + level: string; } - - /** - * mirror.timeline.delete - * @desc Deletes a timeline item. - * @alias mirror.timeline.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the timeline item. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A setting for Glass. + */ + export interface Schema$Setting { + /** + * The setting's ID. The following IDs are valid: - locale - The key + * to the user’s language/locale (BCP 47 identifier) that Glassware should + * use to render localized content. - timezone - The key to the user’s + * current time zone region as defined in the tz database. Example: + * America/Los_Angeles. + */ + id: string; + /** + * The type of resource. This is always mirror#setting. + */ + kind: string; + /** + * The setting value, as a string. + */ + value: string; } - - /** - * mirror.timeline.get - * @desc Gets a single timeline item by ID. - * @alias mirror.timeline.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the timeline item. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A subscription to events on a collection. + */ + export interface Schema$Subscription { + /** + * The URL where notifications should be delivered (must start with + * https://). + */ + callbackUrl: string; + /** + * The collection to subscribe to. Allowed values are: - timeline - + * Changes in the timeline including insertion, deletion, and updates. - + * locations - Location updates. - settings - Settings updates. + */ + collection: string; + /** + * The ID of the subscription. + */ + id: string; + /** + * The type of resource. This is always mirror#subscription. + */ + kind: string; + /** + * Container object for notifications. This is not populated in the + * Subscription resource. + */ + notification: Schema$Notification; + /** + * A list of operations that should be subscribed to. An empty list + * indicates that all operations on the collection should be subscribed to. + * Allowed values are: - UPDATE - The item has been updated. - INSERT - A + * new item has been inserted. - DELETE - The item has been deleted. - + * MENU_ACTION - A custom menu item has been triggered by the user. + */ + operation: string[]; + /** + * The time at which this subscription was last modified, formatted + * according to RFC 3339. + */ + updated: string; + /** + * An opaque token sent to the subscriber in notifications so that it can + * determine the ID of the user. + */ + userToken: string; + /** + * A secret token sent to the subscriber in notifications so that it can + * verify that the notification was generated by Google. + */ + verifyToken: string; } - - /** - * mirror.timeline.insert - * @desc Inserts a new item into the timeline. - * @alias mirror.timeline.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/mirror/v1/timeline').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/mirror/v1/timeline') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of Subscriptions. This is the response from the server to GET + * requests on the subscription collection. + */ + export interface Schema$SubscriptionsListResponse { + /** + * The list of subscriptions. + */ + items: Schema$Subscription[]; + /** + * The type of resource. This is always mirror#subscriptionsList. + */ + kind: string; } - - /** - * mirror.timeline.list - * @desc Retrieves a list of timeline items for the authenticated user. - * @alias mirror.timeline.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.bundleId If provided, only items with the given bundleId will be returned. - * @param {boolean=} params.includeDeleted If true, tombstone records for deleted items will be returned. - * @param {integer=} params.maxResults The maximum number of items to include in the response, used for paging. - * @param {string=} params.orderBy Controls the order in which timeline items are returned. - * @param {string=} params.pageToken Token for the page of results to return. - * @param {boolean=} params.pinnedOnly If true, only pinned items will be returned. - * @param {string=} params.sourceItemId If provided, only items with the given sourceItemId will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/mirror/v1/timeline').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Each item in the user's timeline is represented as a TimelineItem JSON + * structure, described below. + */ + export interface Schema$TimelineItem { + /** + * A list of media attachments associated with this item. As a convenience, + * you can refer to attachments in your HTML payloads with the attachment or + * cid scheme. For example: - attachment: <img + * src="attachment:attachment_index"> where attachment_index is + * the 0-based index of this array. - cid: <img + * src="cid:attachment_id"> where attachment_id is the ID of + * the attachment. + */ + attachments: Schema$Attachment[]; + /** + * The bundle ID for this item. Services can specify a bundleId to group + * many items together. They appear under a single top-level item on the + * device. + */ + bundleId: string; + /** + * A canonical URL pointing to the canonical/high quality version of the + * data represented by the timeline item. + */ + canonicalUrl: string; + /** + * The time at which this item was created, formatted according to RFC 3339. + */ + created: string; + /** + * The user or group that created this item. + */ + creator: Schema$Contact; + /** + * The time that should be displayed when this item is viewed in the + * timeline, formatted according to RFC 3339. This user's timeline is + * sorted chronologically on display time, so this will also determine where + * the item is displayed in the timeline. If not set by the service, the + * display time defaults to the updated time. + */ + displayTime: string; + /** + * ETag for this item. + */ + etag: string; + /** + * HTML content for this item. If both text and html are provided for an + * item, the html will be rendered in the timeline. Allowed HTML elements - + * You can use these elements in your timeline cards. - Headers: h1, h2, + * h3, h4, h5, h6 - Images: img - Lists: li, ol, ul - HTML5 semantics: + * article, aside, details, figure, figcaption, footer, header, nav, + * section, summary, time - Structural: blockquote, br, div, hr, p, span - + * Style: b, big, center, em, i, u, s, small, strike, strong, style, sub, + * sup - Tables: table, tbody, td, tfoot, th, thead, tr Blocked HTML + * elements: These elements and their contents are removed from HTML + * payloads. - Document headers: head, title - Embeds: audio, embed, + * object, source, video - Frames: frame, frameset - Scripting: applet, + * script Other elements: Any elements that aren't listed are removed, + * but their contents are preserved. + */ + html: string; + /** + * The ID of the timeline item. This is unique within a user's timeline. + */ + id: string; + /** + * If this item was generated as a reply to another item, this field will be + * set to the ID of the item being replied to. This can be used to attach a + * reply to the appropriate conversation or post. + */ + inReplyTo: string; + /** + * Whether this item is a bundle cover. If an item is marked as a bundle + * cover, it will be the entry point to the bundle of items that have the + * same bundleId as that item. It will be shown only on the main timeline — + * not within the opened bundle. On the main timeline, items that are shown + * are: - Items that have isBundleCover set to true - Items that do not + * have a bundleId In a bundle sub-timeline, items that are shown are: - + * Items that have the bundleId in question AND isBundleCover set to false + */ + isBundleCover: boolean; + /** + * When true, indicates this item is deleted, and only the ID property is + * set. + */ + isDeleted: boolean; + /** + * When true, indicates this item is pinned, which means it's grouped + * alongside "active" items like navigation and hangouts, on the + * opposite side of the home screen from historical (non-pinned) timeline + * items. You can allow the user to toggle the value of this property with + * the TOGGLE_PINNED built-in menu item. + */ + isPinned: boolean; + /** + * The type of resource. This is always mirror#timelineItem. + */ + kind: string; + /** + * The geographic location associated with this item. + */ + location: Schema$Location; + /** + * A list of menu items that will be presented to the user when this item is + * selected in the timeline. + */ + menuItems: Schema$MenuItem[]; + /** + * Controls how notifications for this item are presented on the device. If + * this is missing, no notification will be generated. + */ + notification: Schema$NotificationConfig; + /** + * For pinned items, this determines the order in which the item is + * displayed in the timeline, with a higher score appearing closer to the + * clock. Note: setting this field is currently not supported. + */ + pinScore: number; + /** + * A list of users or groups that this item has been shared with. + */ + recipients: Schema$Contact[]; + /** + * A URL that can be used to retrieve this item. + */ + selfLink: string; + /** + * Opaque string you can use to map a timeline item to data in your own + * service. + */ + sourceItemId: string; + /** + * The speakable version of the content of this item. Along with the + * READ_ALOUD menu item, use this field to provide text that would be + * clearer when read aloud, or to provide extended information to what is + * displayed visually on Glass. Glassware should also specify the + * speakableType field, which will be spoken before this text in cases where + * the additional context is useful, for example when the user requests that + * the item be read aloud following a notification. + */ + speakableText: string; + /** + * A speakable description of the type of this item. This will be announced + * to the user prior to reading the content of the item in cases where the + * additional context is useful, for example when the user requests that the + * item be read aloud following a notification. This should be a short, + * simple noun phrase such as "Email", "Text message", + * or "Daily Planet News Update". Glassware are encouraged to + * populate this field for every timeline item, even if the item does not + * contain speakableText or text so that the user can learn the type of the + * item without looking at the screen. + */ + speakableType: string; + /** + * Text content of this item. + */ + text: string; + /** + * The title of this item. + */ + title: string; + /** + * The time at which this item was last modified, formatted according to RFC + * 3339. + */ + updated: string; } - - /** - * mirror.timeline.patch - * @desc Updates a timeline item in place. This method supports patch - * semantics. - * @alias mirror.timeline.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the timeline item. - * @param {().TimelineItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of timeline items. This is the response from the server to GET + * requests on the timeline collection. + */ + export interface Schema$TimelineListResponse { + /** + * Items in the timeline. + */ + items: Schema$TimelineItem[]; + /** + * The type of resource. This is always mirror#timeline. + */ + kind: string; + /** + * The next page token. Provide this as the pageToken parameter in the + * request to retrieve the next page of results. + */ + nextPageToken: string; } - - /** - * mirror.timeline.update - * @desc Updates a timeline item in place. - * @alias mirror.timeline.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the timeline item. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/mirror/v1/timeline/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an action taken by the user that triggered a notification. + */ + export interface Schema$UserAction { + /** + * An optional payload for the action. For actions of type CUSTOM, this is + * the ID of the custom menu item that was selected. + */ + payload: string; + /** + * The type of action. The value of this can be: - SHARE - the user shared + * an item. - REPLY - the user replied to an item. - REPLY_ALL - the user + * replied to all recipients of an item. - CUSTOM - the user selected a + * custom menu item on the timeline item. - DELETE - the user deleted the + * item. - PIN - the user pinned the item. - UNPIN - the user unpinned the + * item. - LAUNCH - the user initiated a voice command. In the future, + * additional types may be added. UserActions with unrecognized types should + * be ignored. + */ + type: string; } -} -export class Resource$Timeline$Attachments { - root: Mirror; - constructor(root: Mirror) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$UserData { + key: string; + value: string; } - getRoot() { - return this.root; + export class Resource$Accounts { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.accounts.insert + * @desc Inserts a new account for a user + * @alias mirror.accounts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountName The name of the account to be passed to the Android Account Manager. + * @param {string} params.accountType Account type to be passed to Android Account Manager. + * @param {string} params.userToken The ID for the user. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/mirror/v1/accounts/{userToken}/{accountType}/{accountName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userToken', 'accountType', 'accountName'], + pathParams: ['accountName', 'accountType', 'userToken'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * mirror.timeline.attachments.delete - * @desc Deletes an attachment from a timeline item. - * @alias mirror.timeline.attachments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.attachmentId The ID of the attachment. - * @param {string} params.itemId The ID of the timeline item the attachment belongs to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/mirror/v1/timeline/{itemId}/attachments/{attachmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['itemId', 'attachmentId'], - pathParams: ['attachmentId', 'itemId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Contacts { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.contacts.delete + * @desc Deletes a contact. + * @alias mirror.contacts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the contact. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.contacts.get + * @desc Gets a single contact by ID. + * @alias mirror.contacts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the contact. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.contacts.insert + * @desc Inserts a new contact. + * @alias mirror.contacts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Contact} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.contacts.list + * @desc Retrieves a list of contacts for the authenticated user. + * @alias mirror.contacts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.contacts.patch + * @desc Updates a contact in place. This method supports patch semantics. + * @alias mirror.contacts.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the contact. + * @param {().Contact} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.contacts.update + * @desc Updates a contact in place. + * @alias mirror.contacts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the contact. + * @param {().Contact} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/contacts/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * mirror.timeline.attachments.get - * @desc Retrieves an attachment on a timeline item by item ID and attachment - * ID. - * @alias mirror.timeline.attachments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.attachmentId The ID of the attachment. - * @param {string} params.itemId The ID of the timeline item the attachment belongs to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/mirror/v1/timeline/{itemId}/attachments/{attachmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['itemId', 'attachmentId'], - pathParams: ['attachmentId', 'itemId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Locations { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.locations.get + * @desc Gets a single location by ID. + * @alias mirror.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the location or latest for the last known location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/locations/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.locations.list + * @desc Retrieves a list of locations for the user. + * @alias mirror.locations.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * mirror.timeline.attachments.insert - * @desc Adds a new attachment to a timeline item. - * @alias mirror.timeline.attachments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.itemId The ID of the timeline item the attachment belongs to. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{itemId}/attachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/mirror/v1/timeline/{itemId}/attachments') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['itemId'], - pathParams: ['itemId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Settings { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.settings.get + * @desc Gets a single setting by ID. + * @alias mirror.settings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the setting. The following IDs are valid: - locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. - timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/settings/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * mirror.timeline.attachments.list - * @desc Returns a list of attachments for a timeline item. - * @alias mirror.timeline.attachments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.itemId The ID of the timeline item whose attachments should be listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Subscriptions { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.subscriptions.delete + * @desc Deletes a subscription. + * @alias mirror.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the subscription. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/subscriptions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.subscriptions.insert + * @desc Creates a new subscription. + * @alias mirror.subscriptions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.subscriptions.list + * @desc Retrieves a list of subscriptions for the authenticated user and + * service. + * @alias mirror.subscriptions.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.subscriptions.update + * @desc Updates an existing subscription in place. + * @alias mirror.subscriptions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the subscription. + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/subscriptions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Timeline { + root: Mirror; + attachments: Resource$Timeline$Attachments; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + this.attachments = new Resource$Timeline$Attachments(root); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.timeline.delete + * @desc Deletes a timeline item. + * @alias mirror.timeline.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the timeline item. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.get + * @desc Gets a single timeline item by ID. + * @alias mirror.timeline.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the timeline item. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.insert + * @desc Inserts a new item into the timeline. + * @alias mirror.timeline.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/mirror/v1/timeline') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.list + * @desc Retrieves a list of timeline items for the authenticated user. + * @alias mirror.timeline.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.bundleId If provided, only items with the given bundleId will be returned. + * @param {boolean=} params.includeDeleted If true, tombstone records for deleted items will be returned. + * @param {integer=} params.maxResults The maximum number of items to include in the response, used for paging. + * @param {string=} params.orderBy Controls the order in which timeline items are returned. + * @param {string=} params.pageToken Token for the page of results to return. + * @param {boolean=} params.pinnedOnly If true, only pinned items will be returned. + * @param {string=} params.sourceItemId If provided, only items with the given sourceItemId will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.patch + * @desc Updates a timeline item in place. This method supports patch + * semantics. + * @alias mirror.timeline.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the timeline item. + * @param {().TimelineItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.update + * @desc Updates a timeline item in place. + * @alias mirror.timeline.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the timeline item. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/mirror/v1/timeline/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/mirror/v1/timeline/{itemId}/attachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['itemId'], - pathParams: ['itemId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Timeline$Attachments { + root: Mirror; + constructor(root: Mirror) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * mirror.timeline.attachments.delete + * @desc Deletes an attachment from a timeline item. + * @alias mirror.timeline.attachments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.attachmentId The ID of the attachment. + * @param {string} params.itemId The ID of the timeline item the attachment belongs to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/mirror/v1/timeline/{itemId}/attachments/{attachmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['itemId', 'attachmentId'], + pathParams: ['attachmentId', 'itemId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.attachments.get + * @desc Retrieves an attachment on a timeline item by item ID and + * attachment ID. + * @alias mirror.timeline.attachments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.attachmentId The ID of the attachment. + * @param {string} params.itemId The ID of the timeline item the attachment belongs to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/mirror/v1/timeline/{itemId}/attachments/{attachmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['itemId', 'attachmentId'], + pathParams: ['attachmentId', 'itemId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.attachments.insert + * @desc Adds a new attachment to a timeline item. + * @alias mirror.timeline.attachments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.itemId The ID of the timeline item the attachment belongs to. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{itemId}/attachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/mirror/v1/timeline/{itemId}/attachments') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['itemId'], + pathParams: ['itemId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * mirror.timeline.attachments.list + * @desc Returns a list of attachments for a timeline item. + * @alias mirror.timeline.attachments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.itemId The ID of the timeline item whose attachments should be listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/mirror/v1/timeline/{itemId}/attachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['itemId'], + pathParams: ['itemId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/ml/v1.ts b/src/apis/ml/v1.ts index 12a0502c9e4..8ab26d137b3 100644 --- a/src/apis/ml/v1.ts +++ b/src/apis/ml/v1.ts @@ -27,2916 +27,2955 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Machine Learning Engine - * - * An API to enable creating and using machine learning models. - * - * @example - * const google = require('googleapis'); - * const ml = google.ml('v1'); - * - * @namespace ml - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Ml - */ -export class Ml { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Message that represents an arbitrary HTTP body. It should only be used for - * payload formats that can't be represented as JSON, such as raw binary or - * an HTML page. This message can be used both in streaming and non-streaming - * API methods in the request as well as the response. It can be used as a - * top-level request field, which is convenient if one wants to extract - * parameters from either the URL or HTTP template into the request fields and - * also want access to the raw HTTP body. Example: message - * GetResourceRequest { // A unique request id. string request_id = - * 1; // The raw HTTP body is bound to this field. google.api.HttpBody - * http_body = 2; } service ResourceService { rpc - * GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc - * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } - * Example with streaming methods: service CaldavService { rpc - * GetCalendar(stream google.api.HttpBody) returns (stream - * google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) - * returns (stream google.api.HttpBody); } Use of this type only changes - * how the request and response bodies are handled, all other features will - * continue to work unchanged. - */ -export interface Schema$GoogleApi__HttpBody { - /** - * The HTTP Content-Type string representing the content type of the body. - */ - contentType: string; - /** - * HTTP body binary data. - */ - data: string; - /** - * Application specific response metadata. Must be set in the first response - * for streaming APIs. - */ - extensions: any[]; -} -/** - * An observed value of a metric. - */ -export interface Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric { - /** - * The objective value at this training step. - */ - objectiveValue: number; - /** - * The global training step for this metric. - */ - trainingStep: string; -} -/** - * Options for automatically scaling a model. - */ -export interface Schema$GoogleCloudMlV1__AutoScaling { - /** - * Optional. The minimum number of nodes to allocate for this model. These - * nodes are always up, starting from the time the model is deployed, so the - * cost of operating this model will be at least `rate` * `min_nodes` * number - * of hours since last billing cycle, where `rate` is the cost per node-hour - * as documented in the [pricing guide](/ml-engine/docs/pricing), even if no - * predictions are performed. There is additional cost for each prediction - * performed. Unlike manual scaling, if the load gets too heavy for the nodes - * that are up, the service will automatically add nodes to handle the - * increased load as well as scale back as traffic drops, always maintaining - * at least `min_nodes`. You will be charged for the time in which additional - * nodes are used. If not specified, `min_nodes` defaults to 0, in which - * case, when traffic to a model stops (and after a cool-down period), nodes - * will be shut down and no charges will be incurred until traffic to the - * model resumes. - */ - minNodes: number; -} -/** - * Request message for the CancelJob method. - */ -export interface Schema$GoogleCloudMlV1__CancelJobRequest {} -export interface Schema$GoogleCloudMlV1__Capability { - /** - * Available accelerators for the capability. - */ - availableAccelerators: string[]; - type: string; -} -export interface Schema$GoogleCloudMlV1__Config { - /** - * The service account Cloud ML uses to run on TPU node. - */ - tpuServiceAccount: string; -} -/** - * Returns service account information associated with a project. - */ -export interface Schema$GoogleCloudMlV1__GetConfigResponse { - config: Schema$GoogleCloudMlV1__Config; - /** - * The service account Cloud ML uses to access resources in the project. - */ - serviceAccount: string; - /** - * The project number for `service_account`. - */ - serviceAccountProject: string; -} -/** - * Represents the result of a single hyperparameter tuning trial from a training - * job. The TrainingOutput object that is returned on successful completion of a - * training job with hyperparameter tuning includes a list of - * HyperparameterOutput objects, one for each successful trial. - */ -export interface Schema$GoogleCloudMlV1__HyperparameterOutput { - /** - * All recorded object metrics for this trial. This field is not currently - * populated. - */ - allMetrics: - Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric[]; - /** - * The final objective metric seen for this trial. - */ - finalMetric: Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric; - /** - * The hyperparameters given to this trial. - */ - hyperparameters: any; - /** - * True if the trial is stopped early. - */ - isTrialStoppedEarly: boolean; - /** - * The trial id for these results. - */ - trialId: string; -} -/** - * Represents a set of hyperparameters to optimize. - */ -export interface Schema$GoogleCloudMlV1__HyperparameterSpec { - /** - * Optional. The search algorithm specified for the hyperparameter tuning job. - * Uses the default CloudML Engine hyperparameter tuning algorithm if - * unspecified. - */ - algorithm: string; - /** - * Optional. Indicates if the hyperparameter tuning job enables auto trial - * early stopping. - */ - enableTrialEarlyStopping: boolean; - /** - * Required. The type of goal to use for tuning. Available types are - * `MAXIMIZE` and `MINIMIZE`. Defaults to `MAXIMIZE`. - */ - goal: string; - /** - * Optional. The Tensorflow summary tag name to use for optimizing trials. For - * current versions of Tensorflow, this tag name should exactly match what is - * shown in Tensorboard, including all scopes. For versions of Tensorflow - * prior to 0.12, this should be only the tag passed to tf.Summary. By - * default, "training/hptuning/metric" will be used. - */ - hyperparameterMetricTag: string; - /** - * Optional. The number of training trials to run concurrently. You can reduce - * the time it takes to perform hyperparameter tuning by adding trials in - * parallel. However, each trail only benefits from the information gained in - * completed trials. That means that a trial does not get access to the - * results of trials running at the same time, which could reduce the quality - * of the overall optimization. Each trial will use the same scale tier and - * machine types. Defaults to one. - */ - maxParallelTrials: number; - /** - * Optional. How many training trials should be attempted to optimize the - * specified hyperparameters. Defaults to one. - */ - maxTrials: number; - /** - * Required. The set of parameters to tune. - */ - params: Schema$GoogleCloudMlV1__ParameterSpec[]; - /** - * Optional. The prior hyperparameter tuning job id that users hope to - * continue with. The job id will be used to find the corresponding vizier - * study guid and resume the study. - */ - resumePreviousJobId: string; -} -/** - * Represents a training or prediction job. - */ -export interface Schema$GoogleCloudMlV1__Job { - /** - * Output only. When the job was created. - */ - createTime: string; - /** - * Output only. When the job processing was completed. - */ - endTime: string; - /** - * Output only. The details of a failure or a cancellation. - */ - errorMessage: string; - /** - * Required. The user-specified id of the job. - */ - jobId: string; - /** - * Input parameters to create a prediction job. - */ - predictionInput: Schema$GoogleCloudMlV1__PredictionInput; - /** - * The current prediction job result. - */ - predictionOutput: Schema$GoogleCloudMlV1__PredictionOutput; - /** - * Output only. When the job processing was started. - */ - startTime: string; - /** - * Output only. The detailed state of a job. - */ - state: string; - /** - * Input parameters to create a training job. - */ - trainingInput: Schema$GoogleCloudMlV1__TrainingInput; - /** - * The current training job result. - */ - trainingOutput: Schema$GoogleCloudMlV1__TrainingOutput; -} -/** - * Response message for the ListJobs method. - */ -export interface Schema$GoogleCloudMlV1__ListJobsResponse { - /** - * The list of jobs. - */ - jobs: Schema$GoogleCloudMlV1__Job[]; - /** - * Optional. Pass this token as the `page_token` field of the request for a - * subsequent call. - */ - nextPageToken: string; -} -export interface Schema$GoogleCloudMlV1__ListLocationsResponse { - /** - * Locations where at least one type of CMLE capability is available. - */ - locations: Schema$GoogleCloudMlV1__Location[]; - /** - * Optional. Pass this token as the `page_token` field of the request for a - * subsequent call. - */ - nextPageToken: string; -} -/** - * Response message for the ListModels method. - */ -export interface Schema$GoogleCloudMlV1__ListModelsResponse { - /** - * The list of models. - */ - models: Schema$GoogleCloudMlV1__Model[]; - /** - * Optional. Pass this token as the `page_token` field of the request for a - * subsequent call. - */ - nextPageToken: string; -} -/** - * Response message for the ListVersions method. - */ -export interface Schema$GoogleCloudMlV1__ListVersionsResponse { - /** - * Optional. Pass this token as the `page_token` field of the request for a - * subsequent call. - */ - nextPageToken: string; - /** - * The list of versions. - */ - versions: Schema$GoogleCloudMlV1__Version[]; -} -export interface Schema$GoogleCloudMlV1__Location { - /** - * Capabilities available in the location. - */ - capabilities: Schema$GoogleCloudMlV1__Capability[]; - name: string; -} -/** - * Options for manually scaling a model. - */ -export interface Schema$GoogleCloudMlV1__ManualScaling { - /** - * The number of nodes to allocate for this model. These nodes are always up, - * starting from the time the model is deployed, so the cost of operating this - * model will be proportional to `nodes` * number of hours since last billing - * cycle plus the cost for each prediction performed. - */ - nodes: number; -} -/** - * Represents a machine learning solution. A model can have multiple versions, - * each of which is a deployed, trained model ready to receive prediction - * requests. The model itself is just a container. - */ -export interface Schema$GoogleCloudMlV1__Model { - /** - * Output only. The default version of the model. This version will be used to - * handle prediction requests that do not specify a version. You can change - * the default version by calling - * [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). - */ - defaultVersion: Schema$GoogleCloudMlV1__Version; - /** - * Optional. The description specified for the model when it was created. - */ - description: string; - /** - * Required. The name specified for the model when it was created. The model - * name must be unique within the project it is created in. - */ - name: string; - /** - * Optional. If true, enables StackDriver Logging for online prediction. - * Default is false. - */ - onlinePredictionLogging: boolean; - /** - * Optional. The list of regions where the model is going to be deployed. - * Currently only one region per model is supported. Defaults to - * 'us-central1' if nothing is set. See the <a - * href="/ml-engine/docs/tensorflow/regions">available - * regions</a> for ML Engine services. Note: * No matter where a model - * is deployed, it can always be accessed by users from anywhere, both for - * online and batch prediction. * The region for a batch prediction job is - * set by the region field when submitting the batch prediction job and - * does not take its value from this field. - */ - regions: string[]; -} -/** - * Represents the metadata of the long-running operation. - */ -export interface Schema$GoogleCloudMlV1__OperationMetadata { - /** - * The time the operation was submitted. - */ - createTime: string; - /** - * The time operation processing completed. - */ - endTime: string; - /** - * Indicates whether a request to cancel this operation has been made. - */ - isCancellationRequested: boolean; - /** - * Contains the name of the model associated with the operation. - */ - modelName: string; - /** - * The operation type. - */ - operationType: string; - /** - * Contains the project number associated with the operation. - */ - projectNumber: string; - /** - * The time operation processing started. - */ - startTime: string; - /** - * Contains the version associated with the operation. - */ - version: Schema$GoogleCloudMlV1__Version; -} -/** - * Represents a single hyperparameter to optimize. - */ -export interface Schema$GoogleCloudMlV1__ParameterSpec { - /** - * Required if type is `CATEGORICAL`. The list of possible categories. - */ - categoricalValues: string[]; - /** - * Required if type is `DISCRETE`. A list of feasible points. The list should - * be in strictly increasing order. For instance, this parameter might have - * possible settings of 1.5, 2.5, and 4.0. This list should not contain more - * than 1,000 values. - */ - discreteValues: number[]; - /** - * Required if type is `DOUBLE` or `INTEGER`. This field should be unset if - * type is `CATEGORICAL`. This value should be integers if type is `INTEGER`. - */ - maxValue: number; - /** - * Required if type is `DOUBLE` or `INTEGER`. This field should be unset if - * type is `CATEGORICAL`. This value should be integers if type is INTEGER. - */ - minValue: number; - /** - * Required. The parameter name must be unique amongst all ParameterConfigs in - * a HyperparameterSpec message. E.g., "learning_rate". - */ - parameterName: string; - /** - * Optional. How the parameter should be scaled to the hypercube. Leave unset - * for categorical parameters. Some kind of scaling is strongly recommended - * for real or integral parameters (e.g., `UNIT_LINEAR_SCALE`). - */ - scaleType: string; - /** - * Required. The type of the parameter. - */ - type: string; -} -/** - * Represents input parameters for a prediction job. - */ -export interface Schema$GoogleCloudMlV1__PredictionInput { - /** - * Optional. Number of records per batch, defaults to 64. The service will - * buffer batch_size number of records in memory before invoking one - * Tensorflow prediction call internally. So take the record size and memory - * available into consideration when setting this parameter. - */ - batchSize: string; - /** - * Required. The format of the input data files. - */ - dataFormat: string; - /** - * Required. The Google Cloud Storage location of the input data files. May - * contain wildcards. - */ - inputPaths: string[]; - /** - * Optional. The maximum number of workers to be used for parallel processing. - * Defaults to 10 if not specified. - */ - maxWorkerCount: string; - /** - * Use this field if you want to use the default version for the specified - * model. The string must use the following format: - * `"projects/YOUR_PROJECT/models/YOUR_MODEL"` - */ - modelName: string; - /** - * Required. The output Google Cloud Storage location. - */ - outputPath: string; - /** - * Required. The Google Compute Engine region to run the prediction job in. - * See the <a - * href="/ml-engine/docs/tensorflow/regions">available - * regions</a> for ML Engine services. - */ - region: string; - /** - * Optional. The Google Cloud ML runtime version to use for this batch - * prediction. If not set, Google Cloud ML will pick the runtime version used - * during the CreateVersion request for this model version, or choose the - * latest stable version when model version information is not available such - * as when the model is specified by uri. - */ - runtimeVersion: string; - /** - * Optional. The name of the signature defined in the SavedModel to use for - * this job. Please refer to - * [SavedModel](https://tensorflow.github.io/serving/serving_basic.html) for - * information about how to use signatures. Defaults to - * [DEFAULT_SERVING_SIGNATURE_DEF_KEY](https://www.tensorflow.org/api_docs/python/tf/saved_model/signature_constants) - * , which is "serving_default". - */ - signatureName: string; - /** - * Use this field if you want to specify a Google Cloud Storage path for the - * model to use. - */ - uri: string; - /** - * Use this field if you want to specify a version of the model to use. The - * string is formatted the same way as `model_version`, with the addition of - * the version information: - * `"projects/YOUR_PROJECT/models/YOUR_MODEL/versions/YOUR_VERSION"` - */ - versionName: string; -} -/** - * Represents results of a prediction job. - */ -export interface Schema$GoogleCloudMlV1__PredictionOutput { - /** - * The number of data instances which resulted in errors. - */ - errorCount: string; - /** - * Node hours used by the batch prediction job. - */ - nodeHours: number; - /** - * The output Google Cloud Storage location provided at the job creation time. - */ - outputPath: string; - /** - * The number of generated predictions. - */ - predictionCount: string; -} -/** - * Request for predictions to be issued against a trained model. - */ -export interface Schema$GoogleCloudMlV1__PredictRequest { - /** - * Required. The prediction request body. - */ - httpBody: Schema$GoogleApi__HttpBody; -} -/** - * Request message for the SetDefaultVersion request. - */ -export interface Schema$GoogleCloudMlV1__SetDefaultVersionRequest {} -/** - * Represents input parameters for a training job. When using the gcloud command - * to submit your training job, you can specify the input parameters as - * command-line arguments and/or in a YAML configuration file referenced from - * the --config command-line argument. For details, see the guide to <a - * href="/ml-engine/docs/tensorflow/training-jobs">submitting a - * training job</a>. - */ -export interface Schema$GoogleCloudMlV1__TrainingInput { - /** - * Optional. Command line arguments to pass to the program. - */ - args: string[]; - /** - * Optional. The set of Hyperparameters to tune. - */ - hyperparameters: Schema$GoogleCloudMlV1__HyperparameterSpec; - /** - * Optional. A Google Cloud Storage path in which to store training outputs - * and other data needed for training. This path is passed to your TensorFlow - * program as the '--job-dir' command-line argument. The benefit of - * specifying this field is that Cloud ML validates the path for use in - * training. - */ - jobDir: string; - /** - * Optional. Specifies the type of virtual machine to use for your training - * job's master worker. The following types are supported: <dl> - * <dt>standard</dt> <dd> A basic machine configuration - * suitable for training simple models with small to moderate datasets. - * </dd> <dt>large_model</dt> <dd> A machine - * with a lot of memory, specially suited for parameter servers when your - * model is large (having many hidden layers or layers with very large - * numbers of nodes). </dd> <dt>complex_model_s</dt> - * <dd> A machine suitable for the master and workers of the cluster - * when your model requires more computation than the standard machine can - * handle satisfactorily. </dd> <dt>complex_model_m</dt> - * <dd> A machine with roughly twice the number of cores and roughly - * double the memory of <code - * suppresswarning="true">complex_model_s</code>. - * </dd> <dt>complex_model_l</dt> <dd> A machine - * with roughly twice the number of cores and roughly double the memory of - * <code suppresswarning="true">complex_model_m</code>. - * </dd> <dt>standard_gpu</dt> <dd> A machine - * equivalent to <code - * suppresswarning="true">standard</code> that also - * includes a single NVIDIA Tesla K80 GPU. See more about <a - * href="/ml-engine/docs/tensorflow/using-gpus">using GPUs to - * train your model</a>. </dd> - * <dt>complex_model_m_gpu</dt> <dd> A machine - * equivalent to <code - * suppresswarning="true">complex_model_m</code> that also - * includes four NVIDIA Tesla K80 GPUs. </dd> - * <dt>complex_model_l_gpu</dt> <dd> A machine - * equivalent to <code - * suppresswarning="true">complex_model_l</code> that also - * includes eight NVIDIA Tesla K80 GPUs. </dd> - * <dt>standard_p100</dt> <dd> A machine equivalent to - * <code suppresswarning="true">standard</code> that - * also includes a single NVIDIA Tesla P100 GPU. The availability of these - * GPUs is in the Beta launch stage. </dd> - * <dt>complex_model_m_p100</dt> <dd> A machine - * equivalent to <code - * suppresswarning="true">complex_model_m</code> that also - * includes four NVIDIA Tesla P100 GPUs. The availability of these GPUs is - * in the Beta launch stage. </dd> <dt>standard_tpu</dt> - * <dd> A TPU VM including one Cloud TPU. The availability of Cloud - * TPU is in <i>Beta</i> launch stage. See more about <a - * href="/ml-engine/docs/tensorflow/using-tpus">using TPUs to - * train your model</a>. </dd> </dl> You must set this - * value when `scaleTier` is set to `CUSTOM`. - */ - masterType: string; - /** - * Required. The Google Cloud Storage location of the packages with the - * training program and any additional dependencies. The maximum number of - * package URIs is 100. - */ - packageUris: string[]; - /** - * Optional. The number of parameter server replicas to use for the training - * job. Each replica in the cluster will be of the type specified in - * `parameter_server_type`. This value can only be used when `scale_tier` is - * set to `CUSTOM`.If you set this value, you must also set - * `parameter_server_type`. - */ - parameterServerCount: string; - /** - * Optional. Specifies the type of virtual machine to use for your training - * job's parameter server. The supported values are the same as those - * described in the entry for `master_type`. This value must be present when - * `scaleTier` is set to `CUSTOM` and `parameter_server_count` is greater than - * zero. - */ - parameterServerType: string; - /** - * Required. The Python module name to run after installing the packages. - */ - pythonModule: string; - /** - * Optional. The version of Python used in training. If not set, the default - * version is '2.7'. Python '3.5' is available when - * `runtime_version` is set to '1.4' and above. Python '2.7' - * works with all supported runtime versions. - */ - pythonVersion: string; - /** - * Required. The Google Compute Engine region to run the training job in. See - * the <a href="/ml-engine/docs/tensorflow/regions">available - * regions</a> for ML Engine services. - */ - region: string; - /** - * Optional. The Google Cloud ML runtime version to use for training. If not - * set, Google Cloud ML will choose the latest stable version. - */ - runtimeVersion: string; - /** - * Required. Specifies the machine types, the number of replicas for workers - * and parameter servers. - */ - scaleTier: string; - /** - * Optional. The number of worker replicas to use for the training job. Each - * replica in the cluster will be of the type specified in `worker_type`. This - * value can only be used when `scale_tier` is set to `CUSTOM`. If you set - * this value, you must also set `worker_type`. - */ - workerCount: string; - /** - * Optional. Specifies the type of virtual machine to use for your training - * job's worker nodes. The supported values are the same as those - * described in the entry for `masterType`. This value must be present when - * `scaleTier` is set to `CUSTOM` and `workerCount` is greater than zero. - */ - workerType: string; -} -/** - * Represents results of a training job. Output only. - */ -export interface Schema$GoogleCloudMlV1__TrainingOutput { - /** - * The number of hyperparameter tuning trials that completed successfully. - * Only set for hyperparameter tuning jobs. - */ - completedTrialCount: string; - /** - * The amount of ML units consumed by the job. - */ - consumedMLUnits: number; - /** - * Whether this job is a hyperparameter tuning job. - */ - isHyperparameterTuningJob: boolean; - /** - * Results for individual Hyperparameter trials. Only set for hyperparameter - * tuning jobs. - */ - trials: Schema$GoogleCloudMlV1__HyperparameterOutput[]; -} -/** - * Represents a version of the model. Each version is a trained model deployed - * in the cloud, ready to handle prediction requests. A model can have multiple - * versions. You can get information about all of the versions of a given model - * by calling - * [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). - */ -export interface Schema$GoogleCloudMlV1__Version { - /** - * Automatically scale the number of nodes used to serve the model in response - * to increases and decreases in traffic. Care should be taken to ramp up - * traffic according to the model's ability to scale or you will start - * seeing increases in latency and 429 response codes. - */ - autoScaling: Schema$GoogleCloudMlV1__AutoScaling; - /** - * Output only. The time the version was created. - */ - createTime: string; - /** - * Required. The Google Cloud Storage location of the trained model used to - * create the version. See the [guide to model - * deployment](/ml-engine/docs/tensorflow/deploying-models) for more - * information. When passing Version to - * [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create) - * the model service uses the specified location as the source of the model. - * Once deployed, the model version is hosted by the prediction service, so - * this location is useful only as a historical record. The total number of - * model files can't exceed 1000. - */ - deploymentUri: string; - /** - * Optional. The description specified for the version when it was created. - */ - description: string; - /** - * Output only. The details of a failure or a cancellation. - */ - errorMessage: string; - /** - * Optional. The machine learning framework Cloud ML Engine uses to train this - * version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, and - * `XGBOOST`. If you do not specify a framework, Cloud ML Engine uses - * TensorFlow. If you choose `SCIKIT_LEARN` or `XGBOOST`, you must also set - * the runtime version of the model to 1.4 or greater. - */ - framework: string; - /** - * Output only. If true, this version will be used to handle prediction - * requests that do not specify a version. You can change the default version - * by calling - * [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). - */ - isDefault: boolean; - /** - * Output only. The time the version was last used for prediction. - */ - lastUseTime: string; - /** - * Manually select the number of nodes to use for serving the model. You - * should generally use `auto_scaling` with an appropriate `min_nodes` - * instead, but this option is available if you want more predictable billing. - * Beware that latency and error rates will increase if the traffic exceeds - * that capability of the system to serve it based on the selected number of - * nodes. - */ - manualScaling: Schema$GoogleCloudMlV1__ManualScaling; - /** - * Required.The name specified for the version when it was created. The - * version name must be unique within the model it is created in. - */ - name: string; - /** - * Optional. The version of Python used in prediction. If not set, the default - * version is '2.7'. Python '3.5' is available when - * `runtime_version` is set to '1.4' and above. Python '2.7' - * works with all supported runtime versions. - */ - pythonVersion: string; - /** - * Optional. The Google Cloud ML runtime version to use for this deployment. - * If not set, Google Cloud ML will choose a version. - */ - runtimeVersion: string; - /** - * Output only. The state of a version. - */ - state: string; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$GoogleIamV1__AuditConfig { - /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$GoogleIamV1__AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$GoogleIamV1__AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$GoogleIamV1__Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$GoogleIamV1__Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$GoogleIamV1__AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$GoogleIamV1__Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$GoogleIamV1__SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$GoogleIamV1__Policy; - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$GoogleIamV1__TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$GoogleIamV1__TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$GoogleLongrunning__ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$GoogleLongrunning__Operation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunning__Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpc__Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobuf__Empty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpc__Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; +export namespace ml_v1 { /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Cloud Machine Learning Engine + * + * An API to enable creating and using machine learning models. + * + * @example + * const google = require('googleapis'); + * const ml = google.ml('v1'); + * + * @namespace ml + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Ml */ - message: string; -} - -export class Resource$Projects { - root: Ml; - jobs: Resource$Projects$Jobs; - locations: Resource$Projects$Locations; - models: Resource$Projects$Models; - operations: Resource$Projects$Operations; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); - this.jobs = new Resource$Projects$Jobs(root); - this.locations = new Resource$Projects$Locations(root); - this.models = new Resource$Projects$Models(root); - this.operations = new Resource$Projects$Operations(root); - } + export class Ml { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + projects: Resource$Projects; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * ml.projects.getConfig - * @desc Get the service account information associated with your project. You - * need this information in order to grant the service account permissions for - * the Google Cloud Storage location where you put your model training code - * for training the model with Google Cloud Machine Learning. - * @alias ml.projects.getConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The project name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - getConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.projects = new Resource$Projects(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:getConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } } - /** - * ml.projects.predict - * @desc Performs prediction on the data in the request. Cloud ML Engine - * implements a custom `predict` verb on top of an HTTP POST method.

For - * details of the request and response format, see the **guide to the [predict - * request format](/ml-engine/docs/v1/predict-request)**. - * @alias ml.projects.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The resource name of a model or a version. Authorization: requires the `predict` permission on the specified resource. - * @param {().GoogleCloudMlV1__PredictRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): - AxiosPromise; - predict( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:predict').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Message that represents an arbitrary HTTP body. It should only be used for + * payload formats that can't be represented as JSON, such as raw binary + * or an HTML page. This message can be used both in streaming and + * non-streaming API methods in the request as well as the response. It can + * be used as a top-level request field, which is convenient if one wants to + * extract parameters from either the URL or HTTP template into the request + * fields and also want access to the raw HTTP body. Example: message + * GetResourceRequest { // A unique request id. string request_id + * = 1; // The raw HTTP body is bound to this field. + * google.api.HttpBody http_body = 2; } service ResourceService { rpc + * GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc + * UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); } + * Example with streaming methods: service CaldavService { rpc + * GetCalendar(stream google.api.HttpBody) returns (stream + * google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); } Use of this type only changes + * how the request and response bodies are handled, all other features will + * continue to work unchanged. + */ + export interface Schema$GoogleApi__HttpBody { + /** + * The HTTP Content-Type string representing the content type of the body. + */ + contentType: string; + /** + * HTTP body binary data. + */ + data: string; + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + */ + extensions: any[]; } -} -export class Resource$Projects$Jobs { - root: Ml; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + /** + * An observed value of a metric. + */ + export interface Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric { + /** + * The objective value at this training step. + */ + objectiveValue: number; + /** + * The global training step for this metric. + */ + trainingStep: string; } - - /** - * ml.projects.jobs.cancel - * @desc Cancels a running job. - * @alias ml.projects.jobs.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the job to cancel. - * @param {().GoogleCloudMlV1__CancelJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Options for automatically scaling a model. + */ + export interface Schema$GoogleCloudMlV1__AutoScaling { + /** + * Optional. The minimum number of nodes to allocate for this model. These + * nodes are always up, starting from the time the model is deployed, so the + * cost of operating this model will be at least `rate` * `min_nodes` * + * number of hours since last billing cycle, where `rate` is the cost per + * node-hour as documented in the [pricing guide](/ml-engine/docs/pricing), + * even if no predictions are performed. There is additional cost for each + * prediction performed. Unlike manual scaling, if the load gets too heavy + * for the nodes that are up, the service will automatically add nodes to + * handle the increased load as well as scale back as traffic drops, always + * maintaining at least `min_nodes`. You will be charged for the time in + * which additional nodes are used. If not specified, `min_nodes` defaults + * to 0, in which case, when traffic to a model stops (and after a cool-down + * period), nodes will be shut down and no charges will be incurred until + * traffic to the model resumes. + */ + minNodes: number; } - - /** - * ml.projects.jobs.create - * @desc Creates a training or a batch prediction job. - * @alias ml.projects.jobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project name. - * @param {().GoogleCloudMlV1__Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for the CancelJob method. */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/jobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$GoogleCloudMlV1__CancelJobRequest {} + export interface Schema$GoogleCloudMlV1__Capability { + /** + * Available accelerators for the capability. + */ + availableAccelerators: string[]; + type: string; + } + export interface Schema$GoogleCloudMlV1__Config { + /** + * The service account Cloud ML uses to run on TPU node. + */ + tpuServiceAccount: string; } - - /** - * ml.projects.jobs.get - * @desc Describes a job. - * @alias ml.projects.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the job to get the description of. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Returns service account information associated with a project. + */ + export interface Schema$GoogleCloudMlV1__GetConfigResponse { + config: Schema$GoogleCloudMlV1__Config; + /** + * The service account Cloud ML uses to access resources in the project. + */ + serviceAccount: string; + /** + * The project number for `service_account`. + */ + serviceAccountProject: string; } - - /** - * ml.projects.jobs.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias ml.projects.jobs.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the result of a single hyperparameter tuning trial from a + * training job. The TrainingOutput object that is returned on successful + * completion of a training job with hyperparameter tuning includes a list of + * HyperparameterOutput objects, one for each successful trial. + */ + export interface Schema$GoogleCloudMlV1__HyperparameterOutput { + /** + * All recorded object metrics for this trial. This field is not currently + * populated. + */ + allMetrics: + Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric[]; + /** + * The final objective metric seen for this trial. + */ + finalMetric: + Schema$GoogleCloudMlV1_HyperparameterOutput_HyperparameterMetric; + /** + * The hyperparameters given to this trial. + */ + hyperparameters: any; + /** + * True if the trial is stopped early. + */ + isTrialStoppedEarly: boolean; + /** + * The trial id for these results. + */ + trialId: string; } - - /** - * ml.projects.jobs.list - * @desc Lists the jobs in the project. If there are no jobs that match the - * request parameters, the list request returns an empty response body: {}. - * @alias ml.projects.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Specifies the subset of jobs to retrieve. You can filter on the value of one or more attributes of the job object. For example, retrieve jobs with a job identifier that starts with 'census':

gcloud ml-engine jobs list --filter='jobId:census*'

List all failed jobs with names that start with 'rnn':

gcloud ml-engine jobs list --filter='jobId:rnn* AND state:FAILED'

For more examples, see the guide to monitoring jobs. - * @param {integer=} params.pageSize Optional. The number of jobs to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. - * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. - * @param {string} params.parent Required. The name of the project for which to list jobs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/jobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Represents a set of hyperparameters to optimize. + */ + export interface Schema$GoogleCloudMlV1__HyperparameterSpec { + /** + * Optional. The search algorithm specified for the hyperparameter tuning + * job. Uses the default CloudML Engine hyperparameter tuning algorithm if + * unspecified. + */ + algorithm: string; + /** + * Optional. Indicates if the hyperparameter tuning job enables auto trial + * early stopping. + */ + enableTrialEarlyStopping: boolean; + /** + * Required. The type of goal to use for tuning. Available types are + * `MAXIMIZE` and `MINIMIZE`. Defaults to `MAXIMIZE`. + */ + goal: string; + /** + * Optional. The Tensorflow summary tag name to use for optimizing trials. + * For current versions of Tensorflow, this tag name should exactly match + * what is shown in Tensorboard, including all scopes. For versions of + * Tensorflow prior to 0.12, this should be only the tag passed to + * tf.Summary. By default, "training/hptuning/metric" will be + * used. + */ + hyperparameterMetricTag: string; + /** + * Optional. The number of training trials to run concurrently. You can + * reduce the time it takes to perform hyperparameter tuning by adding + * trials in parallel. However, each trail only benefits from the + * information gained in completed trials. That means that a trial does not + * get access to the results of trials running at the same time, which could + * reduce the quality of the overall optimization. Each trial will use the + * same scale tier and machine types. Defaults to one. + */ + maxParallelTrials: number; + /** + * Optional. How many training trials should be attempted to optimize the + * specified hyperparameters. Defaults to one. + */ + maxTrials: number; + /** + * Required. The set of parameters to tune. + */ + params: Schema$GoogleCloudMlV1__ParameterSpec[]; + /** + * Optional. The prior hyperparameter tuning job id that users hope to + * continue with. The job id will be used to find the corresponding vizier + * study guid and resume the study. + */ + resumePreviousJobId: string; } - - /** - * ml.projects.jobs.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias ml.projects.jobs.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().GoogleIamV1__SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a training or prediction job. + */ + export interface Schema$GoogleCloudMlV1__Job { + /** + * Output only. When the job was created. + */ + createTime: string; + /** + * Output only. When the job processing was completed. + */ + endTime: string; + /** + * Output only. The details of a failure or a cancellation. + */ + errorMessage: string; + /** + * Required. The user-specified id of the job. + */ + jobId: string; + /** + * Input parameters to create a prediction job. + */ + predictionInput: Schema$GoogleCloudMlV1__PredictionInput; + /** + * The current prediction job result. + */ + predictionOutput: Schema$GoogleCloudMlV1__PredictionOutput; + /** + * Output only. When the job processing was started. + */ + startTime: string; + /** + * Output only. The detailed state of a job. + */ + state: string; + /** + * Input parameters to create a training job. + */ + trainingInput: Schema$GoogleCloudMlV1__TrainingInput; + /** + * The current training job result. + */ + trainingOutput: Schema$GoogleCloudMlV1__TrainingOutput; } - - /** - * ml.projects.jobs.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias ml.projects.jobs.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GoogleIamV1__TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Response message for the ListJobs method. + */ + export interface Schema$GoogleCloudMlV1__ListJobsResponse { + /** + * The list of jobs. + */ + jobs: Schema$GoogleCloudMlV1__Job[]; + /** + * Optional. Pass this token as the `page_token` field of the request for a + * subsequent call. + */ + nextPageToken: string; } -} - -export class Resource$Projects$Locations { - root: Ml; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$GoogleCloudMlV1__ListLocationsResponse { + /** + * Locations where at least one type of CMLE capability is available. + */ + locations: Schema$GoogleCloudMlV1__Location[]; + /** + * Optional. Pass this token as the `page_token` field of the request for a + * subsequent call. + */ + nextPageToken: string; } - - getRoot() { - return this.root; + /** + * Response message for the ListModels method. + */ + export interface Schema$GoogleCloudMlV1__ListModelsResponse { + /** + * The list of models. + */ + models: Schema$GoogleCloudMlV1__Model[]; + /** + * Optional. Pass this token as the `page_token` field of the request for a + * subsequent call. + */ + nextPageToken: string; } - - /** - * ml.projects.locations.get - * @desc Get the complete list of CMLE capabilities in a location, along with - * their location-specific properties. - * @alias ml.projects.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for the ListVersions method. + */ + export interface Schema$GoogleCloudMlV1__ListVersionsResponse { + /** + * Optional. Pass this token as the `page_token` field of the request for a + * subsequent call. + */ + nextPageToken: string; + /** + * The list of versions. + */ + versions: Schema$GoogleCloudMlV1__Version[]; + } + export interface Schema$GoogleCloudMlV1__Location { + /** + * Capabilities available in the location. + */ + capabilities: Schema$GoogleCloudMlV1__Capability[]; + name: string; } - - /** - * ml.projects.locations.list - * @desc List all locations that provides at least one type of CMLE - * capability. - * @alias ml.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Optional. The number of locations to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. - * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. - * @param {string} params.parent Required. The name of the project for which available locations are to be listed (since some locations might be whitelisted for specific projects). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Options for manually scaling a model. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Projects$Models { - root: Ml; - versions: Resource$Projects$Models$Versions; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); - this.versions = new Resource$Projects$Models$Versions(root); + export interface Schema$GoogleCloudMlV1__ManualScaling { + /** + * The number of nodes to allocate for this model. These nodes are always + * up, starting from the time the model is deployed, so the cost of + * operating this model will be proportional to `nodes` * number of hours + * since last billing cycle plus the cost for each prediction performed. + */ + nodes: number; } - - getRoot() { - return this.root; + /** + * Represents a machine learning solution. A model can have multiple + * versions, each of which is a deployed, trained model ready to receive + * prediction requests. The model itself is just a container. + */ + export interface Schema$GoogleCloudMlV1__Model { + /** + * Output only. The default version of the model. This version will be used + * to handle prediction requests that do not specify a version. You can + * change the default version by calling + * [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + */ + defaultVersion: Schema$GoogleCloudMlV1__Version; + /** + * Optional. The description specified for the model when it was created. + */ + description: string; + /** + * Required. The name specified for the model when it was created. The + * model name must be unique within the project it is created in. + */ + name: string; + /** + * Optional. If true, enables StackDriver Logging for online prediction. + * Default is false. + */ + onlinePredictionLogging: boolean; + /** + * Optional. The list of regions where the model is going to be deployed. + * Currently only one region per model is supported. Defaults to + * 'us-central1' if nothing is set. See the <a + * href="/ml-engine/docs/tensorflow/regions">available + * regions</a> for ML Engine services. Note: * No matter where a + * model is deployed, it can always be accessed by users from anywhere, + * both for online and batch prediction. * The region for a batch + * prediction job is set by the region field when submitting the batch + * prediction job and does not take its value from this field. + */ + regions: string[]; } - - /** - * ml.projects.models.create - * @desc Creates a model which will later contain one or more versions. You - * must add at least one version before you can request predictions from the - * model. Add versions by calling - * [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). - * @alias ml.projects.models.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The project name. - * @param {().GoogleCloudMlV1__Model} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/models') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents the metadata of the long-running operation. + */ + export interface Schema$GoogleCloudMlV1__OperationMetadata { + /** + * The time the operation was submitted. + */ + createTime: string; + /** + * The time operation processing completed. + */ + endTime: string; + /** + * Indicates whether a request to cancel this operation has been made. + */ + isCancellationRequested: boolean; + /** + * Contains the name of the model associated with the operation. + */ + modelName: string; + /** + * The operation type. + */ + operationType: string; + /** + * Contains the project number associated with the operation. + */ + projectNumber: string; + /** + * The time operation processing started. + */ + startTime: string; + /** + * Contains the version associated with the operation. + */ + version: Schema$GoogleCloudMlV1__Version; } - - /** - * ml.projects.models.delete - * @desc Deletes a model. You can only delete a model if there are no - * versions in it. You can delete versions by calling - * [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete). - * @alias ml.projects.models.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a single hyperparameter to optimize. + */ + export interface Schema$GoogleCloudMlV1__ParameterSpec { + /** + * Required if type is `CATEGORICAL`. The list of possible categories. + */ + categoricalValues: string[]; + /** + * Required if type is `DISCRETE`. A list of feasible points. The list + * should be in strictly increasing order. For instance, this parameter + * might have possible settings of 1.5, 2.5, and 4.0. This list should not + * contain more than 1,000 values. + */ + discreteValues: number[]; + /** + * Required if type is `DOUBLE` or `INTEGER`. This field should be unset if + * type is `CATEGORICAL`. This value should be integers if type is + * `INTEGER`. + */ + maxValue: number; + /** + * Required if type is `DOUBLE` or `INTEGER`. This field should be unset if + * type is `CATEGORICAL`. This value should be integers if type is INTEGER. + */ + minValue: number; + /** + * Required. The parameter name must be unique amongst all ParameterConfigs + * in a HyperparameterSpec message. E.g., "learning_rate". + */ + parameterName: string; + /** + * Optional. How the parameter should be scaled to the hypercube. Leave + * unset for categorical parameters. Some kind of scaling is strongly + * recommended for real or integral parameters (e.g., `UNIT_LINEAR_SCALE`). + */ + scaleType: string; + /** + * Required. The type of the parameter. + */ + type: string; } - - /** - * ml.projects.models.get - * @desc Gets information about a model, including its name, the description - * (if set), and the default version (if at least one version of the model has - * been deployed). - * @alias ml.projects.models.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents input parameters for a prediction job. + */ + export interface Schema$GoogleCloudMlV1__PredictionInput { + /** + * Optional. Number of records per batch, defaults to 64. The service will + * buffer batch_size number of records in memory before invoking one + * Tensorflow prediction call internally. So take the record size and memory + * available into consideration when setting this parameter. + */ + batchSize: string; + /** + * Required. The format of the input data files. + */ + dataFormat: string; + /** + * Required. The Google Cloud Storage location of the input data files. May + * contain wildcards. + */ + inputPaths: string[]; + /** + * Optional. The maximum number of workers to be used for parallel + * processing. Defaults to 10 if not specified. + */ + maxWorkerCount: string; + /** + * Use this field if you want to use the default version for the specified + * model. The string must use the following format: + * `"projects/YOUR_PROJECT/models/YOUR_MODEL"` + */ + modelName: string; + /** + * Required. The output Google Cloud Storage location. + */ + outputPath: string; + /** + * Required. The Google Compute Engine region to run the prediction job in. + * See the <a + * href="/ml-engine/docs/tensorflow/regions">available + * regions</a> for ML Engine services. + */ + region: string; + /** + * Optional. The Google Cloud ML runtime version to use for this batch + * prediction. If not set, Google Cloud ML will pick the runtime version + * used during the CreateVersion request for this model version, or choose + * the latest stable version when model version information is not available + * such as when the model is specified by uri. + */ + runtimeVersion: string; + /** + * Optional. The name of the signature defined in the SavedModel to use for + * this job. Please refer to + * [SavedModel](https://tensorflow.github.io/serving/serving_basic.html) for + * information about how to use signatures. Defaults to + * [DEFAULT_SERVING_SIGNATURE_DEF_KEY](https://www.tensorflow.org/api_docs/python/tf/saved_model/signature_constants) + * , which is "serving_default". + */ + signatureName: string; + /** + * Use this field if you want to specify a Google Cloud Storage path for the + * model to use. + */ + uri: string; + /** + * Use this field if you want to specify a version of the model to use. The + * string is formatted the same way as `model_version`, with the addition of + * the version information: + * `"projects/YOUR_PROJECT/models/YOUR_MODEL/versions/YOUR_VERSION"` + */ + versionName: string; } - - /** - * ml.projects.models.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias ml.projects.models.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents results of a prediction job. + */ + export interface Schema$GoogleCloudMlV1__PredictionOutput { + /** + * The number of data instances which resulted in errors. + */ + errorCount: string; + /** + * Node hours used by the batch prediction job. + */ + nodeHours: number; + /** + * The output Google Cloud Storage location provided at the job creation + * time. + */ + outputPath: string; + /** + * The number of generated predictions. + */ + predictionCount: string; } - - /** - * ml.projects.models.list - * @desc Lists the models in a project. Each project can contain multiple - * models, and each model can have multiple versions. If there are no models - * that match the request parameters, the list request returns an empty - * response body: {}. - * @alias ml.projects.models.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Specifies the subset of models to retrieve. - * @param {integer=} params.pageSize Optional. The number of models to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. - * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. - * @param {string} params.parent Required. The name of the project whose models are to be listed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request for predictions to be issued against a trained model. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/models') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$GoogleCloudMlV1__PredictRequest { + /** + * Required. The prediction request body. + */ + httpBody: Schema$GoogleApi__HttpBody; } - - /** - * ml.projects.models.patch - * @desc Updates a specific model resource. Currently the only supported - * fields to update are `description` and `default_version.name`. - * @alias ml.projects.models.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The project name. - * @param {string=} params.updateMask Required. Specifies the path, relative to `Model`, of the field to update. For example, to change the description of a model to "foo" and set its default version to "version_1", the `update_mask` parameter would be specified as `description`, `default_version.name`, and the `PATCH` request body would specify the new value, as follows: { "description": "foo", "defaultVersion": { "name":"version_1" } } Currently the supported update masks are `description` and `default_version.name`. - * @param {().GoogleCloudMlV1__Model} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for the SetDefaultVersion request. + */ + export interface Schema$GoogleCloudMlV1__SetDefaultVersionRequest {} + /** + * Represents input parameters for a training job. When using the gcloud + * command to submit your training job, you can specify the input parameters + * as command-line arguments and/or in a YAML configuration file referenced + * from the --config command-line argument. For details, see the guide to + * <a + * href="/ml-engine/docs/tensorflow/training-jobs">submitting a + * training job</a>. + */ + export interface Schema$GoogleCloudMlV1__TrainingInput { + /** + * Optional. Command line arguments to pass to the program. + */ + args: string[]; + /** + * Optional. The set of Hyperparameters to tune. + */ + hyperparameters: Schema$GoogleCloudMlV1__HyperparameterSpec; + /** + * Optional. A Google Cloud Storage path in which to store training outputs + * and other data needed for training. This path is passed to your + * TensorFlow program as the '--job-dir' command-line argument. The + * benefit of specifying this field is that Cloud ML validates the path for + * use in training. + */ + jobDir: string; + /** + * Optional. Specifies the type of virtual machine to use for your training + * job's master worker. The following types are supported: <dl> + * <dt>standard</dt> <dd> A basic machine + * configuration suitable for training simple models with small to + * moderate datasets. </dd> <dt>large_model</dt> + * <dd> A machine with a lot of memory, specially suited for + * parameter servers when your model is large (having many hidden layers + * or layers with very large numbers of nodes). </dd> + * <dt>complex_model_s</dt> <dd> A machine suitable + * for the master and workers of the cluster when your model requires more + * computation than the standard machine can handle satisfactorily. + * </dd> <dt>complex_model_m</dt> <dd> A + * machine with roughly twice the number of cores and roughly double the + * memory of <code + * suppresswarning="true">complex_model_s</code>. + * </dd> <dt>complex_model_l</dt> <dd> A + * machine with roughly twice the number of cores and roughly double the + * memory of <code + * suppresswarning="true">complex_model_m</code>. + * </dd> <dt>standard_gpu</dt> <dd> A machine + * equivalent to <code + * suppresswarning="true">standard</code> that also + * includes a single NVIDIA Tesla K80 GPU. See more about <a + * href="/ml-engine/docs/tensorflow/using-gpus">using GPUs to + * train your model</a>. </dd> + * <dt>complex_model_m_gpu</dt> <dd> A machine + * equivalent to <code + * suppresswarning="true">complex_model_m</code> that + * also includes four NVIDIA Tesla K80 GPUs. </dd> + * <dt>complex_model_l_gpu</dt> <dd> A machine + * equivalent to <code + * suppresswarning="true">complex_model_l</code> that + * also includes eight NVIDIA Tesla K80 GPUs. </dd> + * <dt>standard_p100</dt> <dd> A machine equivalent to + * <code suppresswarning="true">standard</code> that + * also includes a single NVIDIA Tesla P100 GPU. The availability of these + * GPUs is in the Beta launch stage. </dd> + * <dt>complex_model_m_p100</dt> <dd> A machine + * equivalent to <code + * suppresswarning="true">complex_model_m</code> that + * also includes four NVIDIA Tesla P100 GPUs. The availability of these + * GPUs is in the Beta launch stage. </dd> + * <dt>standard_tpu</dt> <dd> A TPU VM including one + * Cloud TPU. The availability of Cloud TPU is in <i>Beta</i> + * launch stage. See more about <a + * href="/ml-engine/docs/tensorflow/using-tpus">using TPUs to + * train your model</a>. </dd> </dl> You must set + * this value when `scaleTier` is set to `CUSTOM`. + */ + masterType: string; + /** + * Required. The Google Cloud Storage location of the packages with the + * training program and any additional dependencies. The maximum number of + * package URIs is 100. + */ + packageUris: string[]; + /** + * Optional. The number of parameter server replicas to use for the training + * job. Each replica in the cluster will be of the type specified in + * `parameter_server_type`. This value can only be used when `scale_tier` + * is set to `CUSTOM`.If you set this value, you must also set + * `parameter_server_type`. + */ + parameterServerCount: string; + /** + * Optional. Specifies the type of virtual machine to use for your training + * job's parameter server. The supported values are the same as those + * described in the entry for `master_type`. This value must be present + * when `scaleTier` is set to `CUSTOM` and `parameter_server_count` is + * greater than zero. + */ + parameterServerType: string; + /** + * Required. The Python module name to run after installing the packages. + */ + pythonModule: string; + /** + * Optional. The version of Python used in training. If not set, the default + * version is '2.7'. Python '3.5' is available when + * `runtime_version` is set to '1.4' and above. Python '2.7' + * works with all supported runtime versions. + */ + pythonVersion: string; + /** + * Required. The Google Compute Engine region to run the training job in. + * See the <a + * href="/ml-engine/docs/tensorflow/regions">available + * regions</a> for ML Engine services. + */ + region: string; + /** + * Optional. The Google Cloud ML runtime version to use for training. If + * not set, Google Cloud ML will choose the latest stable version. + */ + runtimeVersion: string; + /** + * Required. Specifies the machine types, the number of replicas for workers + * and parameter servers. + */ + scaleTier: string; + /** + * Optional. The number of worker replicas to use for the training job. Each + * replica in the cluster will be of the type specified in `worker_type`. + * This value can only be used when `scale_tier` is set to `CUSTOM`. If you + * set this value, you must also set `worker_type`. + */ + workerCount: string; + /** + * Optional. Specifies the type of virtual machine to use for your training + * job's worker nodes. The supported values are the same as those + * described in the entry for `masterType`. This value must be present when + * `scaleTier` is set to `CUSTOM` and `workerCount` is greater than zero. + */ + workerType: string; } - - /** - * ml.projects.models.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias ml.projects.models.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().GoogleIamV1__SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents results of a training job. Output only. + */ + export interface Schema$GoogleCloudMlV1__TrainingOutput { + /** + * The number of hyperparameter tuning trials that completed successfully. + * Only set for hyperparameter tuning jobs. + */ + completedTrialCount: string; + /** + * The amount of ML units consumed by the job. + */ + consumedMLUnits: number; + /** + * Whether this job is a hyperparameter tuning job. + */ + isHyperparameterTuningJob: boolean; + /** + * Results for individual Hyperparameter trials. Only set for hyperparameter + * tuning jobs. + */ + trials: Schema$GoogleCloudMlV1__HyperparameterOutput[]; } - - /** - * ml.projects.models.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias ml.projects.models.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GoogleIamV1__TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Represents a version of the model. Each version is a trained model + * deployed in the cloud, ready to handle prediction requests. A model can + * have multiple versions. You can get information about all of the versions + * of a given model by calling + * [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + */ + export interface Schema$GoogleCloudMlV1__Version { + /** + * Automatically scale the number of nodes used to serve the model in + * response to increases and decreases in traffic. Care should be taken to + * ramp up traffic according to the model's ability to scale or you will + * start seeing increases in latency and 429 response codes. + */ + autoScaling: Schema$GoogleCloudMlV1__AutoScaling; + /** + * Output only. The time the version was created. + */ + createTime: string; + /** + * Required. The Google Cloud Storage location of the trained model used to + * create the version. See the [guide to model + * deployment](/ml-engine/docs/tensorflow/deploying-models) for more + * information. When passing Version to + * [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create) + * the model service uses the specified location as the source of the model. + * Once deployed, the model version is hosted by the prediction service, so + * this location is useful only as a historical record. The total number of + * model files can't exceed 1000. + */ + deploymentUri: string; + /** + * Optional. The description specified for the version when it was created. + */ + description: string; + /** + * Output only. The details of a failure or a cancellation. + */ + errorMessage: string; + /** + * Optional. The machine learning framework Cloud ML Engine uses to train + * this version of the model. Valid values are `TENSORFLOW`, `SCIKIT_LEARN`, + * and `XGBOOST`. If you do not specify a framework, Cloud ML Engine uses + * TensorFlow. If you choose `SCIKIT_LEARN` or `XGBOOST`, you must also set + * the runtime version of the model to 1.4 or greater. + */ + framework: string; + /** + * Output only. If true, this version will be used to handle prediction + * requests that do not specify a version. You can change the default + * version by calling + * [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + */ + isDefault: boolean; + /** + * Output only. The time the version was last used for prediction. + */ + lastUseTime: string; + /** + * Manually select the number of nodes to use for serving the model. You + * should generally use `auto_scaling` with an appropriate `min_nodes` + * instead, but this option is available if you want more predictable + * billing. Beware that latency and error rates will increase if the traffic + * exceeds that capability of the system to serve it based on the selected + * number of nodes. + */ + manualScaling: Schema$GoogleCloudMlV1__ManualScaling; + /** + * Required.The name specified for the version when it was created. The + * version name must be unique within the model it is created in. + */ + name: string; + /** + * Optional. The version of Python used in prediction. If not set, the + * default version is '2.7'. Python '3.5' is available when + * `runtime_version` is set to '1.4' and above. Python '2.7' + * works with all supported runtime versions. + */ + pythonVersion: string; + /** + * Optional. The Google Cloud ML runtime version to use for this deployment. + * If not set, Google Cloud ML will choose a version. + */ + runtimeVersion: string; + /** + * Output only. The state of a version. + */ + state: string; } -} -export class Resource$Projects$Models$Versions { - root: Ml; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); + /** + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$GoogleIamV1__AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$GoogleIamV1__AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; } - - getRoot() { - return this.root; + /** + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$GoogleIamV1__AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; } - - /** - * ml.projects.models.versions.create - * @desc Creates a new version of a model from a trained TensorFlow model. If - * the version created in the cloud by this call is the first deployed version - * of the specified model, it will be made the default version of the model. - * When you add a version to a model that already has one or more versions, - * the default version does not automatically change. If you want a new - * version to be the default, you must call - * [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). - * @alias ml.projects.models.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the model. - * @param {().GoogleCloudMlV1__Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$GoogleIamV1__Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; } - - /** - * ml.projects.models.versions.delete - * @desc Deletes a model version. Each model can have multiple versions - * deployed and in use at any given time. Use this method to remove a single - * version. Note: You cannot delete the version that is set as the default - * version of the model unless it is the only remaining version. - * @alias ml.projects.models.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the version. You can get the names of all the versions of a model by calling [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$GoogleIamV1__Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$GoogleIamV1__AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$GoogleIamV1__Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - /** - * ml.projects.models.versions.get - * @desc Gets information about a model version. Models can have multiple - * versions. You can call - * [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) - * to get the same information that this method returns for all of the - * versions of a model. - * @alias ml.projects.models.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for `SetIamPolicy` method. + */ + export interface Schema$GoogleIamV1__SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$GoogleIamV1__Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; } - - /** - * ml.projects.models.versions.list - * @desc Gets basic information about all the versions of a model. If you - * expect that a model has many versions, or if you need to handle only a - * limited number of results at a time, you can request that the list be - * retrieved in batches (called pages). If there are no versions that match - * the request parameters, the list request returns an empty response body: - * {}. - * @alias ml.projects.models.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Specifies the subset of versions to retrieve. - * @param {integer=} params.pageSize Optional. The number of versions to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. - * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. - * @param {string} params.parent Required. The name of the model for which to list the version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `TestIamPermissions` method. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$GoogleIamV1__TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * ml.projects.models.versions.patch - * @desc Updates the specified Version resource. Currently the only supported - * field to update is `description`. - * @alias ml.projects.models.versions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the model. - * @param {string=} params.updateMask Required. Specifies the path, relative to `Version`, of the field to update. Must be present and non-empty. For example, to change the description of a version to "foo", the `update_mask` parameter would be specified as `description`, and the `PATCH` request body would specify the new value, as follows: { "description": "foo" } Currently the only supported update mask is`description`. - * @param {().GoogleCloudMlV1__Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$GoogleIamV1__TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * ml.projects.models.versions.setDefault - * @desc Designates a version to be the default for the model. The default - * version is used for prediction requests made against the model that don't - * specify a version. The first version to be created for a model is - * automatically set as the default. You must make any subsequent changes to - * the default version setting manually using this method. - * @alias ml.projects.models.versions.setDefault - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the version to make the default for the model. You can get the names of all the versions of a model by calling [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). - * @param {().GoogleCloudMlV1__SetDefaultVersionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setDefault(params?: any, options?: MethodOptions): - AxiosPromise; - setDefault( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - setDefault( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:setDefault') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response message for Operations.ListOperations. + */ + export interface Schema$GoogleLongrunning__ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$GoogleLongrunning__Operation[]; } -} - - -export class Resource$Projects$Operations { - root: Ml; - constructor(root: Ml) { - this.root = root; - this.getRoot.bind(this); + /** + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunning__Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpc__Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobuf__Empty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpc__Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * ml.projects.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias ml.projects.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects { + root: Ml; + jobs: Resource$Projects$Jobs; + locations: Resource$Projects$Locations; + models: Resource$Projects$Models; + operations: Resource$Projects$Operations; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + this.jobs = new Resource$Projects$Jobs(root); + this.locations = new Resource$Projects$Locations(root); + this.models = new Resource$Projects$Models(root); + this.operations = new Resource$Projects$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.getConfig + * @desc Get the service account information associated with your project. + * You need this information in order to grant the service account + * permissions for the Google Cloud Storage location where you put your + * model training code for training the model with Google Cloud Machine + * Learning. + * @alias ml.projects.getConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The project name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:getConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.predict + * @desc Performs prediction on the data in the request. Cloud ML Engine + * implements a custom `predict` verb on top of an HTTP POST method.

For + * details of the request and response format, see the **guide to the + * [predict request format](/ml-engine/docs/v1/predict-request)**. + * @alias ml.projects.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of a model or a version. Authorization: requires the `predict` permission on the specified resource. + * @param {().GoogleCloudMlV1__PredictRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): + AxiosPromise; + predict( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Jobs { + root: Ml; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.jobs.cancel + * @desc Cancels a running job. + * @alias ml.projects.jobs.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the job to cancel. + * @param {().GoogleCloudMlV1__CancelJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.jobs.create + * @desc Creates a training or a batch prediction job. + * @alias ml.projects.jobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project name. + * @param {().GoogleCloudMlV1__Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.jobs.get + * @desc Describes a job. + * @alias ml.projects.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the job to get the description of. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.jobs.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias ml.projects.jobs.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.jobs.list + * @desc Lists the jobs in the project. If there are no jobs that match the + * request parameters, the list request returns an empty response body: {}. + * @alias ml.projects.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Specifies the subset of jobs to retrieve. You can filter on the value of one or more attributes of the job object. For example, retrieve jobs with a job identifier that starts with 'census':

gcloud ml-engine jobs list --filter='jobId:census*'

List all failed jobs with names that start with 'rnn':

gcloud ml-engine jobs list --filter='jobId:rnn* AND state:FAILED'

For more examples, see the guide to monitoring jobs. + * @param {integer=} params.pageSize Optional. The number of jobs to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. + * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. + * @param {string} params.parent Required. The name of the project for which to list jobs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/jobs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.jobs.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias ml.projects.jobs.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().GoogleIamV1__SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.jobs.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias ml.projects.jobs.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GoogleIamV1__TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleIamV1__TestIamPermissionsResponse>): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleIamV1__TestIamPermissionsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * ml.projects.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias ml.projects.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Locations { + root: Ml; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.locations.get + * @desc Get the complete list of CMLE capabilities in a location, along + * with their location-specific properties. + * @alias ml.projects.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.locations.list + * @desc List all locations that provides at least one type of CMLE + * capability. + * @alias ml.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Optional. The number of locations to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. + * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. + * @param {string} params.parent Required. The name of the project for which available locations are to be listed (since some locations might be whitelisted for specific projects). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudMlV1__ListLocationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleCloudMlV1__ListLocationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * ml.projects.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias ml.projects.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Models { + root: Ml; + versions: Resource$Projects$Models$Versions; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + this.versions = new Resource$Projects$Models$Versions(root); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.models.create + * @desc Creates a model which will later contain one or more versions. You + * must add at least one version before you can request predictions from the + * model. Add versions by calling + * [projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create). + * @alias ml.projects.models.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The project name. + * @param {().GoogleCloudMlV1__Model} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/models') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.models.delete + * @desc Deletes a model. You can only delete a model if there are no + * versions in it. You can delete versions by calling + * [projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete). + * @alias ml.projects.models.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.get + * @desc Gets information about a model, including its name, the description + * (if set), and the default version (if at least one version of the model + * has been deployed). + * @alias ml.projects.models.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.models.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias ml.projects.models.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.models.list + * @desc Lists the models in a project. Each project can contain multiple + * models, and each model can have multiple versions. If there are no + * models that match the request parameters, the list request returns an + * empty response body: {}. + * @alias ml.projects.models.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Specifies the subset of models to retrieve. + * @param {integer=} params.pageSize Optional. The number of models to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. + * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. + * @param {string} params.parent Required. The name of the project whose models are to be listed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/models') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.patch + * @desc Updates a specific model resource. Currently the only supported + * fields to update are `description` and `default_version.name`. + * @alias ml.projects.models.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The project name. + * @param {string=} params.updateMask Required. Specifies the path, relative to `Model`, of the field to update. For example, to change the description of a model to "foo" and set its default version to "version_1", the `update_mask` parameter would be specified as `description`, `default_version.name`, and the `PATCH` request body would specify the new value, as follows: { "description": "foo", "defaultVersion": { "name":"version_1" } } Currently the supported update masks are `description` and `default_version.name`. + * @param {().GoogleCloudMlV1__Model} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias ml.projects.models.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().GoogleIamV1__SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.models.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias ml.projects.models.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GoogleIamV1__TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleIamV1__TestIamPermissionsResponse>): void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleIamV1__TestIamPermissionsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Models$Versions { + root: Ml; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.models.versions.create + * @desc Creates a new version of a model from a trained TensorFlow model. + * If the version created in the cloud by this call is the first deployed + * version of the specified model, it will be made the default version of + * the model. When you add a version to a model that already has one or more + * versions, the default version does not automatically change. If you want + * a new version to be the default, you must call + * [projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault). + * @alias ml.projects.models.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the model. + * @param {().GoogleCloudMlV1__Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.versions.delete + * @desc Deletes a model version. Each model can have multiple versions + * deployed and in use at any given time. Use this method to remove a single + * version. Note: You cannot delete the version that is set as the default + * version of the model unless it is the only remaining version. + * @alias ml.projects.models.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the version. You can get the names of all the versions of a model by calling [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.versions.get + * @desc Gets information about a model version. Models can have multiple + * versions. You can call + * [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list) + * to get the same information that this method returns for all of the + * versions of a model. + * @alias ml.projects.models.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.models.versions.list + * @desc Gets basic information about all the versions of a model. If you + * expect that a model has many versions, or if you need to handle only a + * limited number of results at a time, you can request that the list be + * retrieved in batches (called pages). If there are no versions that match + * the request parameters, the list request returns an empty response body: + * {}. + * @alias ml.projects.models.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Specifies the subset of versions to retrieve. + * @param {integer=} params.pageSize Optional. The number of versions to retrieve per "page" of results. If there are more remaining results than this number, the response message will contain a valid value in the `next_page_token` field. The default value is 20, and the maximum page size is 100. + * @param {string=} params.pageToken Optional. A page token to request the next page of results. You get the token from the `next_page_token` field of the response from the previous call. + * @param {string} params.parent Required. The name of the model for which to list the version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.versions.patch + * @desc Updates the specified Version resource. Currently the only + * supported field to update is `description`. + * @alias ml.projects.models.versions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the model. + * @param {string=} params.updateMask Required. Specifies the path, relative to `Version`, of the field to update. Must be present and non-empty. For example, to change the description of a version to "foo", the `update_mask` parameter would be specified as `description`, and the `PATCH` request body would specify the new value, as follows: { "description": "foo" } Currently the only supported update mask is`description`. + * @param {().GoogleCloudMlV1__Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.models.versions.setDefault + * @desc Designates a version to be the default for the model. The default + * version is used for prediction requests made against the model that don't + * specify a version. The first version to be created for a model is + * automatically set as the default. You must make any subsequent changes to + * the default version setting manually using this method. + * @alias ml.projects.models.versions.setDefault + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the version to make the default for the model. You can get the names of all the versions of a model by calling [projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list). + * @param {().GoogleCloudMlV1__SetDefaultVersionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setDefault(params?: any, options?: MethodOptions): + AxiosPromise; + setDefault( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + setDefault( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:setDefault') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * ml.projects.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias ml.projects.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleLongrunning__ListOperationsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleLongrunning__ListOperationsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + export class Resource$Projects$Operations { + root: Ml; + constructor(root: Ml) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * ml.projects.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias ml.projects.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias ml.projects.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * ml.projects.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias ml.projects.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * ml.projects.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias ml.projects.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunning__ListOperationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunning__ListOperationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://ml.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleLongrunning__ListOperationsResponse>(parameters); + } } } } diff --git a/src/apis/monitoring/v3.ts b/src/apis/monitoring/v3.ts index bcca3d44ff5..a8153d6c3d0 100644 --- a/src/apis/monitoring/v3.ts +++ b/src/apis/monitoring/v3.ts @@ -27,4701 +27,4789 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Stackdriver Monitoring API - * - * Manages your Stackdriver Monitoring data and configurations. Most projects - * must be associated with a Stackdriver account, with a few exceptions as noted - * on the individual method pages. - * - * @example - * const google = require('googleapis'); - * const monitoring = google.monitoring('v3'); - * - * @namespace monitoring - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Monitoring - */ -export class Monitoring { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - uptimeCheckIps: Resource$Uptimecheckips; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - this.uptimeCheckIps = new Resource$Uptimecheckips(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Describes how to combine multiple time series to provide different views of - * the data. Aggregation consists of an alignment step on individual time series - * (alignment_period and per_series_aligner) followed by an optional reduction - * step of the data across the aligned time series (cross_series_reducer and - * group_by_fields). For more details, see Aggregation. - */ -export interface Schema$Aggregation { - /** - * The alignment period for per-time series alignment. If present, - * alignmentPeriod must be at least 60 seconds. After per-time series - * alignment, each time series will contain data points only on the period - * boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then - * this field is ignored. If perSeriesAligner is specified and does not equal - * ALIGN_NONE, then this field must be defined; otherwise an error is - * returned. - */ - alignmentPeriod: string; - /** - * The approach to be used to combine time series. Not all reducer functions - * may be applied to all time series, depending on the metric type and the - * value type of the original time series. Reduction may change the metric - * type of value type of the time series.Time series data must be aligned in - * order to perform cross-time series reduction. If crossSeriesReducer is - * specified, then perSeriesAligner must be specified and not equal ALIGN_NONE - * and alignmentPeriod must be specified; otherwise, an error is returned. - */ - crossSeriesReducer: string; - /** - * The set of fields to preserve when crossSeriesReducer is specified. The - * groupByFields determine how the time series are partitioned into subsets - * prior to applying the aggregation function. Each subset contains time - * series that have the same value for each of the grouping fields. Each - * individual time series is a member of exactly one subset. The - * crossSeriesReducer is applied to each subset of time series. It is not - * possible to reduce across different resource types, so this field - * implicitly contains resource.type. Fields not specified in groupByFields - * are aggregated away. If groupByFields is not specified and all the time - * series have the same resource type, then the time series are aggregated - * into a single output time series. If crossSeriesReducer is not defined, - * this field is ignored. - */ - groupByFields: string[]; - /** - * The approach to be used to align individual time series. Not all alignment - * functions may be applied to all time series, depending on the metric type - * and value type of the original time series. Alignment may change the metric - * type or the value type of the time series.Time series data must be aligned - * in order to perform cross-time series reduction. If crossSeriesReducer is - * specified, then perSeriesAligner must be specified and not equal ALIGN_NONE - * and alignmentPeriod must be specified; otherwise, an error is returned. - */ - perSeriesAligner: string; -} -/** - * A description of the conditions under which some aspect of your system is - * considered to be "unhealthy" and the ways to notify people or - * services about this state. For an overview of alert policies, see - * Introduction to Alerting. - */ -export interface Schema$AlertPolicy { - /** - * How to combine the results of multiple conditions to determine if an - * incident should be opened. - */ - combiner: string; - /** - * A list of conditions for the policy. The conditions are combined by AND or - * OR according to the combiner field. If the combined conditions evaluate to - * true, then an incident is created. A policy can have from one to six - * conditions. - */ - conditions: Schema$Condition[]; - /** - * A read-only record of the creation of the alerting policy. If provided in a - * call to create or update, this field will be ignored. - */ - creationRecord: Schema$MutationRecord; - /** - * A short name or phrase used to identify the policy in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple policies in the same project. The name is limited - * to 512 Unicode characters. - */ - displayName: string; - /** - * Documentation that is included with notifications and incidents related to - * this policy. Best practice is for the documentation to include information - * to help responders understand, mitigate, escalate, and correct the - * underlying problems detected by the alerting policy. Notification channels - * that have limited capacity might not show this documentation. - */ - documentation: Schema$Documentation; - /** - * Whether or not the policy is enabled. On write, the default interpretation - * if unset is that the policy is enabled. On read, clients should not make - * any assumption about the state if it has not been populated. The field - * should always be populated on List and Get operations, unless a field - * projection has been specified that strips it out. - */ - enabled: boolean; - /** - * A read-only record of the most recent change to the alerting policy. If - * provided in a call to create or update, this field will be ignored. - */ - mutationRecord: Schema$MutationRecord; - /** - * Required if the policy exists. The resource name for this policy. The - * syntax is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is - * created. When calling the alertPolicies.create method, do not include the - * name field in the alerting policy passed as part of the request. - */ - name: string; - /** - * Identifies the notification channels to which notifications should be sent - * when incidents are opened or closed or when new violations occur on an - * already opened incident. Each element of this array corresponds to the name - * field in each of the NotificationChannel objects that are returned from the - * ListNotificationChannels method. The syntax of the entries in this field - * is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] - */ - notificationChannels: string[]; - /** - * User-supplied key/value data to be used for organizing and identifying the - * AlertPolicy objects.The field can contain up to 64 entries. Each key and - * value is limited to 63 Unicode characters or 128 bytes, whichever is - * smaller. Labels and values can contain only lowercase letters, numerals, - * underscores, and dashes. Keys must begin with a letter. - */ - userLabels: any; -} -/** - * A type of authentication to perform against the specified resource or URL - * that uses username and password. Currently, only Basic authentication is - * supported in Uptime Monitoring. - */ -export interface Schema$BasicAuthentication { - /** - * The password to authenticate. - */ - password: string; - /** - * The username to authenticate. - */ - username: string; -} -/** - * BucketOptions describes the bucket boundaries used to create a histogram for - * the distribution. The buckets can be in a linear sequence, an exponential - * sequence, or each bucket can be specified explicitly. BucketOptions does not - * include the number of values in each bucket.A bucket has an inclusive lower - * bound and exclusive upper bound for the values that are counted for that - * bucket. The upper bound of a bucket must be strictly greater than the lower - * bound. The sequence of N buckets for a distribution consists of an underflow - * bucket (number 0), zero or more finite buckets (number 1 through N - 2) and - * an overflow bucket (number N - 1). The buckets are contiguous: the lower - * bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. - * The buckets span the whole range of finite values: lower bound of the - * underflow bucket is -infinity and the upper bound of the overflow bucket is - * +infinity. The finite buckets are so-called because both bounds are finite. - */ -export interface Schema$BucketOptions { - /** - * The explicit buckets. - */ - explicitBuckets: Schema$Explicit; - /** - * The exponential buckets. - */ - exponentialBuckets: Schema$Exponential; - /** - * The linear bucket. - */ - linearBuckets: Schema$Linear; -} -/** - * A collection of data points sent from a collectd-based plugin. See the - * collectd documentation for more information. - */ -export interface Schema$CollectdPayload { - /** - * The end time of the interval. - */ - endTime: string; - /** - * The measurement metadata. Example: "process_id" -> 12345 - */ - metadata: any; - /** - * The name of the plugin. Example: "disk". - */ - plugin: string; - /** - * The instance name of the plugin Example: "hdcl". - */ - pluginInstance: string; - /** - * The start time of the interval. - */ - startTime: string; - /** - * The measurement type. Example: "memory". - */ - type: string; - /** - * The measurement type instance. Example: "used". - */ - typeInstance: string; - /** - * The measured values during this time interval. Each value must have a - * different dataSourceName. - */ - values: Schema$CollectdValue[]; -} -/** - * Describes the error status for payloads that were not written. - */ -export interface Schema$CollectdPayloadError { - /** - * Records the error status for the payload. If this field is present, the - * partial errors for nested values won't be populated. - */ - error: Schema$Status; - /** - * The zero-based index in CreateCollectdTimeSeriesRequest.collectd_payloads. - */ - index: number; - /** - * Records the error status for values that were not written due to an - * error.Failed payloads for which nothing is written will not include partial - * value errors. - */ - valueErrors: Schema$CollectdValueError[]; -} -/** - * A single data point from a collectd-based plugin. - */ -export interface Schema$CollectdValue { - /** - * The data source for the collectd value. For example there are two data - * sources for network measurements: "rx" and "tx". - */ - dataSourceName: string; - /** - * The type of measurement. - */ - dataSourceType: string; - /** - * The measurement value. - */ - value: Schema$TypedValue; -} -/** - * Describes the error status for values that were not written. - */ -export interface Schema$CollectdValueError { - /** - * Records the error status for the value. - */ - error: Schema$Status; - /** - * The zero-based index in CollectdPayload.values within the parent - * CreateCollectdTimeSeriesRequest.collectd_payloads. - */ - index: number; -} -/** - * A condition is a true/false test that determines when an alerting policy - * should open an incident. If a condition evaluates to true, it signifies that - * something is wrong. - */ -export interface Schema$Condition { - /** - * A condition that checks that a time series continues to receive new data - * points. - */ - conditionAbsent: Schema$MetricAbsence; - /** - * A condition that compares a time series against a threshold. - */ - conditionThreshold: Schema$MetricThreshold; - /** - * A short name or phrase used to identify the condition in dashboards, - * notifications, and incidents. To avoid confusion, don't use the same - * display name for multiple conditions in the same policy. - */ - displayName: string; - /** - * Required if the condition exists. The unique resource name for this - * condition. Its syntax is: - * projects/[PROJECT_ID]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] - * [CONDITION_ID] is assigned by Stackdriver Monitoring when the condition is - * created as part of a new or updated alerting policy.When calling the - * alertPolicies.create method, do not include the name field in the - * conditions of the requested alerting policy. Stackdriver Monitoring creates - * the condition identifiers and includes them in the new policy.When calling - * the alertPolicies.update method to update a policy, including a condition - * name causes the existing condition to be updated. Conditions without names - * are added to the updated policy. Existing conditions are deleted if they - * are not updated.Best practice is to preserve [CONDITION_ID] if you make - * only small changes, such as those to condition thresholds, durations, or - * trigger values. Otherwise, treat the change as a new condition and let the - * existing condition be deleted. - */ - name: string; -} -/** - * Used to perform string matching. Currently, this matches on the exact - * content. In the future, it can be expanded to allow for regular expressions - * and more complex matching. - */ -export interface Schema$ContentMatcher { - /** - * String content to match (max 1024 bytes) - */ - content: string; -} -/** - * The CreateCollectdTimeSeries request. - */ -export interface Schema$CreateCollectdTimeSeriesRequest { - /** - * The collectd payloads representing the time series data. You must not - * include more than a single point for each time series, so no two payloads - * can have the same values for all of the fields plugin, plugin_instance, - * type, and type_instance. - */ - collectdPayloads: Schema$CollectdPayload[]; - /** - * The version of collectd that collected the data. Example: - * "5.3.0-192.el6". - */ - collectdVersion: string; - /** - * The monitored resource associated with the time series. - */ - resource: Schema$MonitoredResource; -} -/** - * The CreateCollectdTimeSeries response. - */ -export interface Schema$CreateCollectdTimeSeriesResponse { - /** - * Records the error status for points that were not written due to an - * error.Failed requests for which nothing is written will return an error - * response instead. - */ - payloadErrors: Schema$CollectdPayloadError[]; -} -/** - * The CreateTimeSeries request. - */ -export interface Schema$CreateTimeSeriesRequest { - /** - * The new data to be added to a list of time series. Adds at most one data - * point to each of several time series. The new data point must be more - * recent than any other point in its time series. Each TimeSeries value must - * fully specify a unique time series by supplying all label values for the - * metric and the monitored resource. - */ - timeSeries: Schema$TimeSeries[]; -} -/** - * Distribution contains summary statistics for a population of values. It - * optionally contains a histogram representing the distribution of those values - * across a set of buckets.The summary statistics are the count, mean, sum of - * the squared deviation from the mean, the minimum, and the maximum of the set - * of population of values. The histogram is based on a sequence of buckets and - * gives a count of values that fall into each bucket. The boundaries of the - * buckets are given either explicitly or by formulas for buckets of fixed or - * exponentially increasing widths.Although it is not forbidden, it is generally - * a bad idea to include non-finite values (infinities or NaNs) in the - * population of values, as this will render the mean and - * sum_of_squared_deviation fields meaningless. - */ -export interface Schema$Distribution { - /** - * Required in the Stackdriver Monitoring API v3. The values for each bucket - * specified in bucket_options. The sum of the values in bucketCounts must - * equal the value in the count field of the Distribution object. The order of - * the bucket counts follows the numbering schemes described for the three - * bucket types. The underflow bucket has number 0; the finite buckets, if - * any, have numbers 1 through N-2; and the overflow bucket has number N-1. - * The size of bucket_counts must not be greater than N. If the size is less - * than N, then the remaining buckets are assigned values of zero. - */ - bucketCounts: string[]; - /** - * Required in the Stackdriver Monitoring API v3. Defines the histogram bucket - * boundaries. - */ - bucketOptions: Schema$BucketOptions; - /** - * The number of values in the population. Must be non-negative. This value - * must equal the sum of the values in bucket_counts if a histogram is - * provided. - */ - count: string; - /** - * The arithmetic mean of the values in the population. If count is zero then - * this field must be zero. - */ - mean: number; - /** - * If specified, contains the range of the population values. The field must - * not be present if the count is zero. This field is presently ignored by the - * Stackdriver Monitoring API v3. - */ - range: Schema$Range; - /** - * The sum of squared deviations from the mean of the values in the - * population. For values x_i this is: Sum[i=1..n]((x_i - mean)^2) Knuth, - * "The Art of Computer Programming", Vol. 2, page 323, 3rd edition - * describes Welford's method for accumulating this sum in one pass.If - * count is zero then this field must be zero. - */ - sumOfSquaredDeviation: number; -} -/** - * A content string and a MIME type that describes the content string's - * format. - */ -export interface Schema$Documentation { - /** - * The text of the documentation, interpreted according to mime_type. The - * content may not exceed 8,192 Unicode characters and may not exceed more - * than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. - */ - content: string; - /** - * The format of the content field. Presently, only the value - * "text/markdown" is supported. See Markdown - * (https://en.wikipedia.org/wiki/Markdown) for more information. - */ - mimeType: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for Empty is empty JSON object {}. - */ -export interface Schema$Empty {} -/** - * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 - * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i - * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds - * field must contain at least one element. If bounds has only one element, then - * there are no finite buckets, and that single element is the common boundary - * of the overflow and underflow buckets. - */ -export interface Schema$Explicit { - /** - * The values must be monotonically increasing. - */ - bounds: number[]; -} -/** - * Specifies an exponential sequence of buckets that have a width that is - * proportional to the value of the lower bound. Each bucket represents a - * constant relative uncertainty on a specific value in the bucket.There are - * num_finite_buckets + 2 (= N) buckets. Bucket i has the following - * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). - * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). - */ -export interface Schema$Exponential { - /** - * Must be greater than 1. - */ - growthFactor: number; - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Must be greater than 0. - */ - scale: number; -} -/** - * A single field of a message type. - */ -export interface Schema$Field { - /** - * The field cardinality. - */ - cardinality: string; - /** - * The string value of the default value of this field. Proto2 syntax only. - */ - defaultValue: string; - /** - * The field JSON name. - */ - jsonName: string; - /** - * The field type. - */ - kind: string; - /** - * The field name. - */ - name: string; - /** - * The field number. - */ - number: number; - /** - * The index of the field type in Type.oneofs, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ - oneofIndex: number; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * Whether to use alternative packed wire representation. - */ - packed: boolean; - /** - * The field type URL, without the scheme, for message or enumeration types. - * Example: "type.googleapis.com/google.protobuf.Timestamp". - */ - typeUrl: string; -} -/** - * The GetNotificationChannelVerificationCode request. - */ -export interface Schema$GetNotificationChannelVerificationCodeRequest { - /** - * The desired expiration time. If specified, the API will guarantee that the - * returned code will not be valid after the specified timestamp; however, the - * API cannot guarantee that the returned code will be valid for at least as - * long as the requested time (the API puts an upper bound on the amount of - * time for which a code may be valid). If omitted, a default expiration will - * be used, which may be less than the max permissible expiration (so - * specifying an expiration may extend the code's lifetime over omitting - * an expiration, even though the API does impose an upper limit on the - * maximum expiration that is permitted). - */ - expireTime: string; -} -/** - * The GetNotificationChannelVerificationCode request. - */ -export interface Schema$GetNotificationChannelVerificationCodeResponse { - /** - * The verification code, which may be used to verify other channels that have - * an equivalent identity (i.e. other channels of the same type with the same - * fingerprint such as other email channels with the same email address or - * other sms channels with the same number). - */ - code: string; - /** - * The expiration time associated with the code that was returned. If an - * expiration was provided in the request, this is the minimum of the - * requested expiration in the request and the max permitted expiration. - */ - expireTime: string; -} -/** - * The description of a dynamic collection of monitored resources. Each group - * has a filter that is matched against monitored resources and their associated - * metadata. If a group's filter matches an available monitored resource, - * then that resource is a member of that group. Groups can contain any number - * of monitored resources, and each monitored resource can be a member of any - * number of groups.Groups can be nested in parent-child hierarchies. The - * parentName field identifies an optional parent for each group. If a group has - * a parent, then the only monitored resources available to be matched by the - * group's filter are the resources contained in the parent group. In other - * words, a group contains the monitored resources that match its filter and the - * filters of all the group's ancestors. A group without a parent can - * contain any monitored resource.For example, consider an infrastructure - * running a set of instances with two user-defined tags: - * "environment" and "role". A parent group has a filter, - * environment="production". A child of that parent group has a - * filter, role="transcoder". The parent group contains all instances - * in the production environment, regardless of their roles. The child group - * contains instances that have the transcoder role and are in the production - * environment.The monitored resources contained in a group can change at any - * moment, depending on what resources exist and what filters are associated - * with the group and its ancestors. - */ -export interface Schema$Group { - /** - * A user-assigned name for this group, used only for display purposes. - */ - displayName: string; - /** - * The filter used to determine which monitored resources belong to this - * group. - */ - filter: string; - /** - * If true, the members of this group are considered to be a cluster. The - * system can perform additional analysis on groups that are clusters. - */ - isCluster: boolean; - /** - * Output only. The name of this group. The format is - * "projects/{project_id_or_number}/groups/{group_id}". When - * creating a group, this field is ignored and a new name is created - * consisting of the project specified in the call to CreateGroup and a unique - * {group_id} that is generated automatically. - */ - name: string; - /** - * The name of the group's parent, if it has one. The format is - * "projects/{project_id_or_number}/groups/{group_id}". For groups - * with no parent, parentName is the empty string, "". - */ - parentName: string; -} -/** - * Information involved in an HTTP/HTTPS uptime check request. - */ -export interface Schema$HttpCheck { - /** - * The authentication information. Optional when creating an HTTP check; - * defaults to empty. - */ - authInfo: Schema$BasicAuthentication; - /** - * The list of headers to send as part of the uptime check request. If two - * headers have the same key and different values, they should be entered as a - * single header, with the value being a comma-separated list of all the - * desired values as described at - * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two - * separate headers with the same key in a Create call will cause the first to - * be overwritten by the second. The maximum number of headers allowed is 100. - */ - headers: any; - /** - * Boolean specifiying whether to encrypt the header information. Encryption - * should be specified for any headers related to authentication that you do - * not wish to be seen when retrieving the configuration. The server will be - * responsible for encrypting the headers. On Get/List calls, if mask_headers - * is set to True then the headers will be obscured with ******. - */ - maskHeaders: boolean; - /** - * The path to the page to run the check against. Will be combined with the - * host (specified within the MonitoredResource) and port to construct the - * full URL. Optional (defaults to "/"). - */ - path: string; - /** - * The port to the page to run the check against. Will be combined with host - * (specified within the MonitoredResource) and path to construct the full - * URL. Optional (defaults to 80 without SSL, or 443 with SSL). - */ - port: number; - /** - * If true, use HTTPS instead of HTTP to run the check. - */ - useSsl: boolean; -} -/** - * Nimbus InternalCheckers. - */ -export interface Schema$InternalChecker { - /** - * The checker ID. - */ - checkerId: string; - /** - * The checker's human-readable name. - */ - displayName: string; - /** - * The GCP zone the uptime check should egress from. Only respected for - * internal uptime checks, where internal_network is specified. - */ - gcpZone: string; - /** - * The internal network to perform this uptime check on. - */ - network: string; - /** - * The GCP project ID. Not necessarily the same as the project_id for the - * config. - */ - projectId: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * Specifies a linear sequence of buckets that all have the same width (except - * overflow and underflow). Each bucket represents a constant absolute - * uncertainty on the specific value in the bucket.There are num_finite_buckets - * + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= - * i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + - * (width * (i - 1)). - */ -export interface Schema$Linear { - /** - * Must be greater than 0. - */ - numFiniteBuckets: number; - /** - * Lower bound of the first bucket. - */ - offset: number; - /** - * Must be greater than 0. - */ - width: number; -} -/** - * The protocol for the ListAlertPolicies response. - */ -export interface Schema$ListAlertPoliciesResponse { - /** - * The returned alert policies. - */ - alertPolicies: Schema$AlertPolicy[]; - /** - * If there might be more results than were returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; -} -/** - * The ListGroupMembers response. - */ -export interface Schema$ListGroupMembersResponse { - /** - * A set of monitored resources in the group. - */ - members: Schema$MonitoredResource[]; - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; - /** - * The total number of elements matching this request. - */ - totalSize: number; -} -/** - * The ListGroups response. - */ -export interface Schema$ListGroupsResponse { - /** - * The groups that match the specified filters. - */ - group: Schema$Group[]; - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; -} -/** - * The ListMetricDescriptors response. - */ -export interface Schema$ListMetricDescriptorsResponse { - /** - * The metric descriptors that are available to the project and that match the - * value of filter, if present. - */ - metricDescriptors: Schema$MetricDescriptor[]; - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; -} -/** - * The ListMonitoredResourceDescriptors response. - */ -export interface Schema$ListMonitoredResourceDescriptorsResponse { - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; - /** - * The monitored resource descriptors that are available to this project and - * that match filter, if present. - */ - resourceDescriptors: Schema$MonitoredResourceDescriptor[]; -} -/** - * The ListNotificationChannelDescriptors response. - */ -export interface Schema$ListNotificationChannelDescriptorsResponse { - /** - * The monitored resource descriptors supported for the specified project, - * optionally filtered. - */ - channelDescriptors: Schema$NotificationChannelDescriptor[]; - /** - * If not empty, indicates that there may be more results that match the - * request. Use the value in the page_token field in a subsequent request to - * fetch the next set of results. If empty, all results have been returned. - */ - nextPageToken: string; -} -/** - * The ListNotificationChannels response. - */ -export interface Schema$ListNotificationChannelsResponse { - /** - * If not empty, indicates that there may be more results that match the - * request. Use the value in the page_token field in a subsequent request to - * fetch the next set of results. If empty, all results have been returned. - */ - nextPageToken: string; - /** - * The notification channels defined for the specified project. - */ - notificationChannels: Schema$NotificationChannel[]; -} -/** - * The ListTimeSeries response. - */ -export interface Schema$ListTimeSeriesResponse { - /** - * If there are more results than have been returned, then this field is set - * to a non-empty value. To see the additional results, use that value as - * pageToken in the next call to this method. - */ - nextPageToken: string; - /** - * One or more time series that match the filter included in the request. - */ - timeSeries: Schema$TimeSeries[]; -} -/** - * The protocol for the ListUptimeCheckConfigs response. - */ -export interface Schema$ListUptimeCheckConfigsResponse { - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). - */ - nextPageToken: string; - /** - * The total number of uptime check configurations for the project, - * irrespective of any pagination. - */ - totalSize: number; - /** - * The returned uptime check configurations. - */ - uptimeCheckConfigs: Schema$UptimeCheckConfig[]; -} -/** - * The protocol for the ListUptimeCheckIps response. - */ -export interface Schema$ListUptimeCheckIpsResponse { - /** - * This field represents the pagination token to retrieve the next page of - * results. If the value is empty, it means no further results for the - * request. To retrieve the next page of results, the value of the - * next_page_token is passed to the subsequent List method call (in the - * request message's page_token field). NOTE: this field is not yet - * implemented - */ - nextPageToken: string; - /** - * The returned list of IP addresses (including region and location) that the - * checkers run from. - */ - uptimeCheckIps: Schema$UptimeCheckIp[]; -} -/** - * A specific metric, identified by specifying values for all of the labels of a - * MetricDescriptor. - */ -export interface Schema$Metric { - /** - * The set of label values that uniquely identify this metric. All labels - * listed in the MetricDescriptor must be assigned values. - */ - labels: any; - /** - * An existing metric type, see google.api.MetricDescriptor. For example, - * custom.googleapis.com/invoice/paid/amount. - */ - type: string; -} -/** - * A condition type that checks that monitored resources are reporting data. The - * configuration defines a metric and a set of monitored resources. The - * predicate is considered in violation when a time series for the specified - * metric of a monitored resource does not include any data in the specified - * duration. - */ -export interface Schema$MetricAbsence { - /** - * Specifies the alignment of data points in individual time series as well as - * how to combine the retrieved time series together (such as when aggregating - * multiple streams on each resource to a single stream for each resource or - * when aggregating streams across all members of a group of resrouces). - * Multiple aggregations are applied in the order specified.This field is - * similar to the one in the MetricService.ListTimeSeries request. It is - * advisable to use the ListTimeSeries method when debugging this field. - */ - aggregations: Schema$Aggregation[]; - /** - * The amount of time that a time series must fail to report new data to be - * considered failing. Currently, only values that are a multiple of a - * minute--e.g. 60, 120, or 300 seconds--are supported. If an invalid value is - * given, an error will be returned. The Duration.nanos field is ignored. - */ - duration: string; - /** - * A filter that identifies which time series should be compared with the - * threshold.The filter is similar to the one that is specified in the - * MetricService.ListTimeSeries request (that call is useful to verify the - * time series that will be retrieved / processed) and must specify the metric - * type and optionally may contain restrictions on resource type, resource - * labels, and metric labels. This field may not exceed 2048 Unicode - * characters in length. - */ - filter: string; - /** - * The number/percent of time series for which the comparison must hold in - * order for the condition to trigger. If unspecified, then the condition will - * trigger if the comparison is true for any of the time series that have been - * identified by filter and aggregations. - */ - trigger: Schema$Trigger; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * appengine.googleapis.com/http/server/response_latencies metric type has a - * label for the HTTP response code, response_code, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of metric_kind and value_type might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * custom.googleapis.com. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * Optional. The unit in which the metric value is reported. For example, - * kBy/s means kilobytes/sec, and 1 is the dimensionless unit. The supported - * units are a subset of The Unified Code for Units of Measure standard - * (http://unitsofmeasure.org/ucum.html).<br><br> This field is - * part of the metric's documentation, but it is ignored by Stackdriver. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of metric_kind and value_type might not be supported. - */ - valueType: string; -} -/** - * A condition type that compares a collection of time series against a - * threshold. - */ -export interface Schema$MetricThreshold { - /** - * Specifies the alignment of data points in individual time series as well as - * how to combine the retrieved time series together (such as when aggregating - * multiple streams on each resource to a single stream for each resource or - * when aggregating streams across all members of a group of resrouces). - * Multiple aggregations are applied in the order specified.This field is - * similar to the one in the MetricService.ListTimeSeries request. It is - * advisable to use the ListTimeSeries method when debugging this field. - */ - aggregations: Schema$Aggregation[]; - /** - * The comparison to apply between the time series (indicated by filter and - * aggregation) and the threshold (indicated by threshold_value). The - * comparison is applied on each time series, with the time series on the - * left-hand side and the threshold on the right-hand side.Only COMPARISON_LT - * and COMPARISON_GT are supported currently. - */ - comparison: string; - /** - * Specifies the alignment of data points in individual time series selected - * by denominatorFilter as well as how to combine the retrieved time series - * together (such as when aggregating multiple streams on each resource to a - * single stream for each resource or when aggregating streams across all - * members of a group of resources).When computing ratios, the aggregations - * and denominator_aggregations fields must use the same alignment period and - * produce time series that have the same periodicity and labels.This field is - * similar to the one in the MetricService.ListTimeSeries request. It is - * advisable to use the ListTimeSeries method when debugging this field. - */ - denominatorAggregations: Schema$Aggregation[]; - /** - * A filter that identifies a time series that should be used as the - * denominator of a ratio that will be compared with the threshold. If a - * denominator_filter is specified, the time series specified by the filter - * field will be used as the numerator.The filter is similar to the one that - * is specified in the MetricService.ListTimeSeries request (that call is - * useful to verify the time series that will be retrieved / processed) and - * must specify the metric type and optionally may contain restrictions on - * resource type, resource labels, and metric labels. This field may not - * exceed 2048 Unicode characters in length. - */ - denominatorFilter: string; - /** - * The amount of time that a time series must violate the threshold to be - * considered failing. Currently, only values that are a multiple of a - * minute--e.g. 60, 120, or 300 seconds--are supported. If an invalid value is - * given, an error will be returned. The Duration.nanos field is ignored. When - * choosing a duration, it is useful to keep in mind the frequency of the - * underlying time series data (which may also be affected by any alignments - * specified in the aggregation field); a good duration is long enough so that - * a single outlier does not generate spurious alerts, but short enough that - * unhealthy states are detected and alerted on quickly. - */ - duration: string; - /** - * A filter that identifies which time series should be compared with the - * threshold.The filter is similar to the one that is specified in the - * MetricService.ListTimeSeries request (that call is useful to verify the - * time series that will be retrieved / processed) and must specify the metric - * type and optionally may contain restrictions on resource type, resource - * labels, and metric labels. This field may not exceed 2048 Unicode - * characters in length. - */ - filter: string; - /** - * A value against which to compare the time series. - */ - thresholdValue: number; - /** - * The number/percent of time series for which the comparison must hold in - * order for the condition to trigger. If unspecified, then the condition will - * trigger if the comparison is true for any of the time series that have been - * identified by filter and aggregations, or by the ratio, if - * denominator_filter and denominator_aggregations are specified. - */ - trigger: Schema$Trigger; -} -/** - * An object representing a resource that can be used for monitoring, logging, - * billing, or other purposes. Examples include virtual machine instances, - * databases, and storage devices such as disks. The type field identifies a - * MonitoredResourceDescriptor object that describes the resource's schema. - * Information in the labels field identifies the actual resource and its - * attributes according to the schema. For example, a particular Compute Engine - * VM instance could be represented by the following object, because the - * MonitoredResourceDescriptor for "gce_instance" has labels - * "instance_id" and "zone": { "type": - * "gce_instance", "labels": { "instance_id": - * "12345678901234", "zone": - * "us-central1-a" }} - */ -export interface Schema$MonitoredResource { - /** - * Required. Values for all of the labels listed in the associated monitored - * resource descriptor. For example, Compute Engine VM instances use the - * labels "project_id", "instance_id", and - * "zone". - */ - labels: any; - /** - * Required. The monitored resource type. This field must match the type field - * of a MonitoredResourceDescriptor object. For example, the type of a Compute - * Engine VM instance is gce_instance. - */ - type: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource descriptor - * for Google Compute Engine VM instances has a type of "gce_instance" - * and specifies the use of the labels "instance_id" and - * "zone" to identify particular VM instances.Different APIs can - * support different monitored resource types. APIs generally provide a list - * method that returns the monitored resource descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, "Google Cloud - * SQL Database". - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels "database_id" and - * "zone". - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * "projects/{project_id}/monitoredResourceDescriptors/{type}" where - * {type} is the value of the type field in this object and {project_id} is a - * project ID that provides API-specific context for accessing the type. APIs - * that do not use project information can use the resource name format - * "monitoredResourceDescriptors/{type}". - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * "cloudsql_database" represents databases in Google Cloud SQL. The - * maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Auxiliary metadata for a MonitoredResource object. MonitoredResource objects - * contain the minimum set of information to uniquely identify a monitored - * resource instance. There is some other useful auxiliary metadata. Google - * Stackdriver Monitoring & Logging uses an ingestion pipeline to extract - * metadata for cloud resources of all types , and stores the metadata in this - * message. - */ -export interface Schema$MonitoredResourceMetadata { - /** - * Output only. Values for predefined system metadata labels. System labels - * are a kind of metadata extracted by Google Stackdriver. Stackdriver - * determines what system labels are useful and how to obtain their values. - * Some examples: "machine_image", "vpc", - * "subnet_id", "security_group", "name", etc. - * System label values can be only strings, Boolean values, or a list of - * strings. For example: { "name": "my-test-instance", - * "security_group": ["a", "b", "c"], - * "spot_instance": false } - */ - systemLabels: any; - /** - * Output only. A map of user-defined metadata labels. - */ - userLabels: any; -} -/** - * Describes a change made to a configuration. - */ -export interface Schema$MutationRecord { - /** - * The email address of the user making the change. - */ - mutatedBy: string; - /** - * When the change occurred. - */ - mutateTime: string; -} -/** - * A NotificationChannel is a medium through which an alert is delivered when a - * policy violation is detected. Examples of channels include email, SMS, and - * third-party messaging applications. Fields containing sensitive information - * like authentication tokens or contact info are only partially populated on - * retrieval. - */ -export interface Schema$NotificationChannel { - /** - * An optional human-readable description of this notification channel. This - * description may provide additional details, beyond the display name, for - * the channel. This may not exceeed 1024 Unicode characters. - */ - description: string; - /** - * An optional human-readable name for this notification channel. It is - * recommended that you specify a non-empty and unique name in order to make - * it easier to identify the channels in your project, though this is not - * enforced. The display name is limited to 512 Unicode characters. - */ - displayName: string; - /** - * Whether notifications are forwarded to the described channel. This makes it - * possible to disable delivery of notifications to a particular channel - * without removing the channel from all alerting policies that reference the - * channel. This is a more convenient approach when the change is temporary - * and you want to receive notifications from the same set of alerting - * policies on the channel at some point in the future. - */ - enabled: boolean; - /** - * Configuration fields that define the channel and its behavior. The - * permissible and required labels are specified in the - * NotificationChannelDescriptor.labels of the NotificationChannelDescriptor - * corresponding to the type field. - */ - labels: any; - /** - * The full REST resource name for this channel. The syntax is: - * projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] is - * automatically assigned by the server on creation. - */ - name: string; - /** - * The type of the notification channel. This field matches the value of the - * NotificationChannelDescriptor.type field. - */ - type: string; - /** - * User-supplied key/value data that does not need to conform to the - * corresponding NotificationChannelDescriptor's schema, unlike the labels - * field. This field is intended to be used for organizing and identifying the - * NotificationChannel objects.The field can contain up to 64 entries. Each - * key and value is limited to 63 Unicode characters or 128 bytes, whichever - * is smaller. Labels and values can contain only lowercase letters, numerals, - * underscores, and dashes. Keys must begin with a letter. - */ - userLabels: any; - /** - * Indicates whether this channel has been verified or not. On a - * ListNotificationChannels or GetNotificationChannel operation, this field is - * expected to be populated.If the value is UNVERIFIED, then it indicates that - * the channel is non-functioning (it both requires verification and lacks - * verification); otherwise, it is assumed that the channel works.If the - * channel is neither VERIFIED nor UNVERIFIED, it implies that the channel is - * of a type that does not require verification or that this specific channel - * has been exempted from verification because it was created prior to - * verification being required for channels of this type.This field cannot be - * modified using a standard UpdateNotificationChannel operation. To change - * the value of this field, you must call VerifyNotificationChannel. - */ - verificationStatus: string; -} -/** - * A description of a notification channel. The descriptor includes the - * properties of the channel and the set of labels or fields that must be - * specified to configure channels of a given type. - */ -export interface Schema$NotificationChannelDescriptor { - /** - * A human-readable description of the notification channel type. The - * description may include a description of the properties of the channel and - * pointers to external documentation. - */ - description: string; - /** - * A human-readable name for the notification channel type. This form of the - * name is suitable for a user interface. - */ - displayName: string; - /** - * The set of labels that must be defined to identify a particular channel of - * the corresponding type. Each label includes a description for how that - * field should be populated. - */ - labels: Schema$LabelDescriptor[]; - /** - * The full REST resource name for this descriptor. The syntax is: - * projects/[PROJECT_ID]/notificationChannelDescriptors/[TYPE] In the above, - * [TYPE] is the value of the type field. - */ - name: string; - /** - * The tiers that support this notification channel; the project service tier - * must be one of the supported_tiers. - */ - supportedTiers: string[]; - /** - * The type of notification channel, such as "email", - * "sms", etc. Notification channel types are globally unique. - */ - type: string; -} -/** - * A protocol buffer option, which can be attached to a message, field, - * enumeration, etc. - */ -export interface Schema$Option { - /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, - * "map_entry". For custom options, it should be the fully-qualified - * name. For example, "google.api.http". - */ - name: string; - /** - * The option's value packed in an Any message. If the value is a - * primitive, the corresponding wrapper type defined in - * google/protobuf/wrappers.proto should be used. If the value is an enum, it - * should be stored as an int32 value using the google.protobuf.Int32Value - * type. - */ - value: any; -} -/** - * A single data point in a time series. - */ -export interface Schema$Point { - /** - * The time interval to which the data point applies. For GAUGE metrics, only - * the end time of the interval is used. For DELTA metrics, the start and end - * time should specify a non-zero interval, with subsequent points specifying - * contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start - * and end time should specify a non-zero interval, with subsequent points - * specifying the same start time and increasing end times, until an event - * resets the cumulative value to zero and sets a new start time for the - * following points. - */ - interval: Schema$TimeInterval; - /** - * The value of the data point. - */ - value: Schema$TypedValue; -} -/** - * The range of the population values. - */ -export interface Schema$Range { - /** - * The maximum of the population values. - */ - max: number; - /** - * The minimum of the population values. - */ - min: number; -} -/** - * The resource submessage for group checks. It can be used instead of a - * monitored resource, when multiple resources are being monitored. - */ -export interface Schema$ResourceGroup { - /** - * The group of resources being monitored. Should be only the group_id, not - * projects/<project_id>/groups/<group_id>. - */ - groupId: string; - /** - * The resource type of the group members. - */ - resourceType: string; -} -/** - * The SendNotificationChannelVerificationCode request. - */ -export interface Schema$SendNotificationChannelVerificationCodeRequest {} -/** - * SourceContext represents information about the source of a protobuf element, - * like the file in which it is defined. - */ -export interface Schema$SourceContext { - /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: - * "google/protobuf/source_context.proto". - */ - fileName: string; -} -/** - * The Status type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * gRPC (https://github.com/grpc). The error model is designed to be: Simple to - * use and understand for most users Flexible enough to meet unexpected - * needsOverviewThe Status message contains three pieces of data: error code, - * error message, and error details. The error code should be an enum value of - * google.rpc.Code, but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers understand and resolve the error. If a localized user-facing error - * message is needed, put the localized message in the error details or localize - * it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package google.rpc that can be used for common error - * conditions.Language mappingThe Status message is the logical representation - * of the error model, but it is not necessarily the actual wire format. When - * the Status message is exposed in different client libraries and different - * wire protocols, it can be mapped differently. For example, it will likely be - * mapped to some exceptions in Java, but more likely mapped to some error codes - * in C.Other usesThe error model and the Status message can be used in a - * variety of environments, either with or without APIs, to provide a consistent - * developer experience across different environments.Example uses of this error - * model include: Partial errors. If a service needs to return partial errors to - * the client, it may embed the Status in the normal response to indicate the - * partial errors. Workflow errors. A typical workflow has multiple steps. Each - * step may have a Status message for error reporting. Batch operations. If a - * client uses batch request and batch response, the Status message should be - * used directly inside batch response, one for each error sub-response. - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the Status message. Logging. If some API errors are stored in - * logs, the message Status could be used directly after any stripping needed - * for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Information required for a TCP uptime check request. - */ -export interface Schema$TcpCheck { - /** - * The port to the page to run the check against. Will be combined with host - * (specified within the MonitoredResource) to construct the full URL. - * Required. - */ - port: number; -} -/** - * A time interval extending just after a start time through an end time. If the - * start time is the same as the end time, then the interval represents a single - * point in time. - */ -export interface Schema$TimeInterval { +export namespace monitoring_v3 { /** - * Required. The end of the time interval. - */ - endTime: string; + * Stackdriver Monitoring API + * + * Manages your Stackdriver Monitoring data and configurations. Most projects + * must be associated with a Stackdriver account, with a few exceptions as + * noted on the individual method pages. + * + * @example + * const google = require('googleapis'); + * const monitoring = google.monitoring('v3'); + * + * @namespace monitoring + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Monitoring + */ + export class Monitoring { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + uptimeCheckIps: Resource$Uptimecheckips; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + this.uptimeCheckIps = new Resource$Uptimecheckips(this); + } + + getRoot() { + return this.root; + } + } + /** - * Optional. The beginning of the time interval. The default value for the - * start time is the end time. The start time must not be later than the end - * time. - */ - startTime: string; -} -/** - * A collection of data points that describes the time-varying values of a - * metric. A time series is identified by a combination of a fully-specified - * monitored resource and a fully-specified metric. This type is used for both - * listing and creating time series. - */ -export interface Schema$TimeSeries { + * Describes how to combine multiple time series to provide different views of + * the data. Aggregation consists of an alignment step on individual time + * series (alignment_period and per_series_aligner) followed by an optional + * reduction step of the data across the aligned time series + * (cross_series_reducer and group_by_fields). For more details, see + * Aggregation. + */ + export interface Schema$Aggregation { + /** + * The alignment period for per-time series alignment. If present, + * alignmentPeriod must be at least 60 seconds. After per-time series + * alignment, each time series will contain data points only on the period + * boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, + * then this field is ignored. If perSeriesAligner is specified and does not + * equal ALIGN_NONE, then this field must be defined; otherwise an error is + * returned. + */ + alignmentPeriod: string; + /** + * The approach to be used to combine time series. Not all reducer functions + * may be applied to all time series, depending on the metric type and the + * value type of the original time series. Reduction may change the metric + * type of value type of the time series.Time series data must be aligned in + * order to perform cross-time series reduction. If crossSeriesReducer is + * specified, then perSeriesAligner must be specified and not equal + * ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is + * returned. + */ + crossSeriesReducer: string; + /** + * The set of fields to preserve when crossSeriesReducer is specified. The + * groupByFields determine how the time series are partitioned into subsets + * prior to applying the aggregation function. Each subset contains time + * series that have the same value for each of the grouping fields. Each + * individual time series is a member of exactly one subset. The + * crossSeriesReducer is applied to each subset of time series. It is not + * possible to reduce across different resource types, so this field + * implicitly contains resource.type. Fields not specified in groupByFields + * are aggregated away. If groupByFields is not specified and all the time + * series have the same resource type, then the time series are aggregated + * into a single output time series. If crossSeriesReducer is not defined, + * this field is ignored. + */ + groupByFields: string[]; + /** + * The approach to be used to align individual time series. Not all + * alignment functions may be applied to all time series, depending on the + * metric type and value type of the original time series. Alignment may + * change the metric type or the value type of the time series.Time series + * data must be aligned in order to perform cross-time series reduction. If + * crossSeriesReducer is specified, then perSeriesAligner must be specified + * and not equal ALIGN_NONE and alignmentPeriod must be specified; + * otherwise, an error is returned. + */ + perSeriesAligner: string; + } /** - * Output only. The associated monitored resource metadata. When reading a a - * timeseries, this field will include metadata labels that are explicitly - * named in the reduction. When creating a timeseries, this field is ignored. - */ - metadata: Schema$MonitoredResourceMetadata; + * A description of the conditions under which some aspect of your system is + * considered to be "unhealthy" and the ways to notify people or + * services about this state. For an overview of alert policies, see + * Introduction to Alerting. + */ + export interface Schema$AlertPolicy { + /** + * How to combine the results of multiple conditions to determine if an + * incident should be opened. + */ + combiner: string; + /** + * A list of conditions for the policy. The conditions are combined by AND + * or OR according to the combiner field. If the combined conditions + * evaluate to true, then an incident is created. A policy can have from one + * to six conditions. + */ + conditions: Schema$Condition[]; + /** + * A read-only record of the creation of the alerting policy. If provided in + * a call to create or update, this field will be ignored. + */ + creationRecord: Schema$MutationRecord; + /** + * A short name or phrase used to identify the policy in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple policies in the same project. The name is + * limited to 512 Unicode characters. + */ + displayName: string; + /** + * Documentation that is included with notifications and incidents related + * to this policy. Best practice is for the documentation to include + * information to help responders understand, mitigate, escalate, and + * correct the underlying problems detected by the alerting policy. + * Notification channels that have limited capacity might not show this + * documentation. + */ + documentation: Schema$Documentation; + /** + * Whether or not the policy is enabled. On write, the default + * interpretation if unset is that the policy is enabled. On read, clients + * should not make any assumption about the state if it has not been + * populated. The field should always be populated on List and Get + * operations, unless a field projection has been specified that strips it + * out. + */ + enabled: boolean; + /** + * A read-only record of the most recent change to the alerting policy. If + * provided in a call to create or update, this field will be ignored. + */ + mutationRecord: Schema$MutationRecord; + /** + * Required if the policy exists. The resource name for this policy. The + * syntax is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + * [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy + * is created. When calling the alertPolicies.create method, do not include + * the name field in the alerting policy passed as part of the request. + */ + name: string; + /** + * Identifies the notification channels to which notifications should be + * sent when incidents are opened or closed or when new violations occur on + * an already opened incident. Each element of this array corresponds to the + * name field in each of the NotificationChannel objects that are returned + * from the ListNotificationChannels method. The syntax of the entries in + * this field is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] + */ + notificationChannels: string[]; + /** + * User-supplied key/value data to be used for organizing and identifying + * the AlertPolicy objects.The field can contain up to 64 entries. Each key + * and value is limited to 63 Unicode characters or 128 bytes, whichever is + * smaller. Labels and values can contain only lowercase letters, numerals, + * underscores, and dashes. Keys must begin with a letter. + */ + userLabels: any; + } /** - * The associated metric. A fully-specified metric used to identify the time - * series. - */ - metric: Schema$Metric; + * A type of authentication to perform against the specified resource or URL + * that uses username and password. Currently, only Basic authentication is + * supported in Uptime Monitoring. + */ + export interface Schema$BasicAuthentication { + /** + * The password to authenticate. + */ + password: string; + /** + * The username to authenticate. + */ + username: string; + } /** - * The metric kind of the time series. When listing time series, this metric - * kind might be different from the metric kind of the associated metric if - * this time series is an alignment or reduction of other time series.When - * creating a time series, this field is optional. If present, it must be the - * same as the metric kind of the associated metric. If the associated - * metric's descriptor must be auto-created, then this field specifies the - * metric kind of the new descriptor and must be either GAUGE (the default) or - * CUMULATIVE. - */ - metricKind: string; + * BucketOptions describes the bucket boundaries used to create a histogram + * for the distribution. The buckets can be in a linear sequence, an + * exponential sequence, or each bucket can be specified explicitly. + * BucketOptions does not include the number of values in each bucket.A bucket + * has an inclusive lower bound and exclusive upper bound for the values that + * are counted for that bucket. The upper bound of a bucket must be strictly + * greater than the lower bound. The sequence of N buckets for a distribution + * consists of an underflow bucket (number 0), zero or more finite buckets + * (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets + * are contiguous: the lower bound of bucket i (i > 0) is the same as the + * upper bound of bucket i - 1. The buckets span the whole range of finite + * values: lower bound of the underflow bucket is -infinity and the upper + * bound of the overflow bucket is +infinity. The finite buckets are so-called + * because both bounds are finite. + */ + export interface Schema$BucketOptions { + /** + * The explicit buckets. + */ + explicitBuckets: Schema$Explicit; + /** + * The exponential buckets. + */ + exponentialBuckets: Schema$Exponential; + /** + * The linear bucket. + */ + linearBuckets: Schema$Linear; + } /** - * The data points of this time series. When listing time series, points are - * returned in reverse time order.When creating a time series, this field must - * contain exactly one point and the point's type must be the same as the - * value type of the associated metric. If the associated metric's - * descriptor must be auto-created, then the value type of the descriptor is - * determined by the point's type, which must be BOOL, INT64, DOUBLE, or - * DISTRIBUTION. - */ - points: Schema$Point[]; + * A collection of data points sent from a collectd-based plugin. See the + * collectd documentation for more information. + */ + export interface Schema$CollectdPayload { + /** + * The end time of the interval. + */ + endTime: string; + /** + * The measurement metadata. Example: "process_id" -> 12345 + */ + metadata: any; + /** + * The name of the plugin. Example: "disk". + */ + plugin: string; + /** + * The instance name of the plugin Example: "hdcl". + */ + pluginInstance: string; + /** + * The start time of the interval. + */ + startTime: string; + /** + * The measurement type. Example: "memory". + */ + type: string; + /** + * The measurement type instance. Example: "used". + */ + typeInstance: string; + /** + * The measured values during this time interval. Each value must have a + * different dataSourceName. + */ + values: Schema$CollectdValue[]; + } /** - * The associated monitored resource. Custom metrics can use only certain - * monitored resource types in their time series data. - */ - resource: Schema$MonitoredResource; + * Describes the error status for payloads that were not written. + */ + export interface Schema$CollectdPayloadError { + /** + * Records the error status for the payload. If this field is present, the + * partial errors for nested values won't be populated. + */ + error: Schema$Status; + /** + * The zero-based index in + * CreateCollectdTimeSeriesRequest.collectd_payloads. + */ + index: number; + /** + * Records the error status for values that were not written due to an + * error.Failed payloads for which nothing is written will not include + * partial value errors. + */ + valueErrors: Schema$CollectdValueError[]; + } /** - * The value type of the time series. When listing time series, this value - * type might be different from the value type of the associated metric if - * this time series is an alignment or reduction of other time series.When - * creating a time series, this field is optional. If present, it must be the - * same as the type of the data in the points field. - */ - valueType: string; -} -/** - * Specifies how many time series must fail a predicate to trigger a condition. - * If not specified, then a {count: 1} trigger is used. - */ -export interface Schema$Trigger { + * A single data point from a collectd-based plugin. + */ + export interface Schema$CollectdValue { + /** + * The data source for the collectd value. For example there are two data + * sources for network measurements: "rx" and "tx". + */ + dataSourceName: string; + /** + * The type of measurement. + */ + dataSourceType: string; + /** + * The measurement value. + */ + value: Schema$TypedValue; + } /** - * The absolute number of time series that must fail the predicate for the - * condition to be triggered. - */ - count: number; + * Describes the error status for values that were not written. + */ + export interface Schema$CollectdValueError { + /** + * Records the error status for the value. + */ + error: Schema$Status; + /** + * The zero-based index in CollectdPayload.values within the parent + * CreateCollectdTimeSeriesRequest.collectd_payloads. + */ + index: number; + } /** - * The percentage of time series that must fail the predicate for the - * condition to be triggered. - */ - percent: number; -} -/** - * A protocol buffer message type. - */ -export interface Schema$Type { + * A condition is a true/false test that determines when an alerting policy + * should open an incident. If a condition evaluates to true, it signifies + * that something is wrong. + */ + export interface Schema$Condition { + /** + * A condition that checks that a time series continues to receive new data + * points. + */ + conditionAbsent: Schema$MetricAbsence; + /** + * A condition that compares a time series against a threshold. + */ + conditionThreshold: Schema$MetricThreshold; + /** + * A short name or phrase used to identify the condition in dashboards, + * notifications, and incidents. To avoid confusion, don't use the same + * display name for multiple conditions in the same policy. + */ + displayName: string; + /** + * Required if the condition exists. The unique resource name for this + * condition. Its syntax is: + * projects/[PROJECT_ID]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] + * [CONDITION_ID] is assigned by Stackdriver Monitoring when the condition + * is created as part of a new or updated alerting policy.When calling the + * alertPolicies.create method, do not include the name field in the + * conditions of the requested alerting policy. Stackdriver Monitoring + * creates the condition identifiers and includes them in the new + * policy.When calling the alertPolicies.update method to update a policy, + * including a condition name causes the existing condition to be updated. + * Conditions without names are added to the updated policy. Existing + * conditions are deleted if they are not updated.Best practice is to + * preserve [CONDITION_ID] if you make only small changes, such as those to + * condition thresholds, durations, or trigger values. Otherwise, treat the + * change as a new condition and let the existing condition be deleted. + */ + name: string; + } /** - * The list of fields. + * Used to perform string matching. Currently, this matches on the exact + * content. In the future, it can be expanded to allow for regular expressions + * and more complex matching. */ - fields: Schema$Field[]; + export interface Schema$ContentMatcher { + /** + * String content to match (max 1024 bytes) + */ + content: string; + } /** - * The fully qualified message name. - */ - name: string; + * The CreateCollectdTimeSeries request. + */ + export interface Schema$CreateCollectdTimeSeriesRequest { + /** + * The collectd payloads representing the time series data. You must not + * include more than a single point for each time series, so no two payloads + * can have the same values for all of the fields plugin, plugin_instance, + * type, and type_instance. + */ + collectdPayloads: Schema$CollectdPayload[]; + /** + * The version of collectd that collected the data. Example: + * "5.3.0-192.el6". + */ + collectdVersion: string; + /** + * The monitored resource associated with the time series. + */ + resource: Schema$MonitoredResource; + } /** - * The list of types appearing in oneof definitions in this type. + * The CreateCollectdTimeSeries response. */ - oneofs: string[]; + export interface Schema$CreateCollectdTimeSeriesResponse { + /** + * Records the error status for points that were not written due to an + * error.Failed requests for which nothing is written will return an error + * response instead. + */ + payloadErrors: Schema$CollectdPayloadError[]; + } /** - * The protocol buffer options. - */ - options: Schema$Option[]; + * The CreateTimeSeries request. + */ + export interface Schema$CreateTimeSeriesRequest { + /** + * The new data to be added to a list of time series. Adds at most one data + * point to each of several time series. The new data point must be more + * recent than any other point in its time series. Each TimeSeries value + * must fully specify a unique time series by supplying all label values for + * the metric and the monitored resource. + */ + timeSeries: Schema$TimeSeries[]; + } /** - * The source context. - */ - sourceContext: Schema$SourceContext; + * Distribution contains summary statistics for a population of values. It + * optionally contains a histogram representing the distribution of those + * values across a set of buckets.The summary statistics are the count, mean, + * sum of the squared deviation from the mean, the minimum, and the maximum of + * the set of population of values. The histogram is based on a sequence of + * buckets and gives a count of values that fall into each bucket. The + * boundaries of the buckets are given either explicitly or by formulas for + * buckets of fixed or exponentially increasing widths.Although it is not + * forbidden, it is generally a bad idea to include non-finite values + * (infinities or NaNs) in the population of values, as this will render the + * mean and sum_of_squared_deviation fields meaningless. + */ + export interface Schema$Distribution { + /** + * Required in the Stackdriver Monitoring API v3. The values for each bucket + * specified in bucket_options. The sum of the values in bucketCounts must + * equal the value in the count field of the Distribution object. The order + * of the bucket counts follows the numbering schemes described for the + * three bucket types. The underflow bucket has number 0; the finite + * buckets, if any, have numbers 1 through N-2; and the overflow bucket has + * number N-1. The size of bucket_counts must not be greater than N. If the + * size is less than N, then the remaining buckets are assigned values of + * zero. + */ + bucketCounts: string[]; + /** + * Required in the Stackdriver Monitoring API v3. Defines the histogram + * bucket boundaries. + */ + bucketOptions: Schema$BucketOptions; + /** + * The number of values in the population. Must be non-negative. This value + * must equal the sum of the values in bucket_counts if a histogram is + * provided. + */ + count: string; + /** + * The arithmetic mean of the values in the population. If count is zero + * then this field must be zero. + */ + mean: number; + /** + * If specified, contains the range of the population values. The field must + * not be present if the count is zero. This field is presently ignored by + * the Stackdriver Monitoring API v3. + */ + range: Schema$Range; + /** + * The sum of squared deviations from the mean of the values in the + * population. For values x_i this is: Sum[i=1..n]((x_i - mean)^2) Knuth, + * "The Art of Computer Programming", Vol. 2, page 323, 3rd + * edition describes Welford's method for accumulating this sum in one + * pass.If count is zero then this field must be zero. + */ + sumOfSquaredDeviation: number; + } /** - * The source syntax. - */ - syntax: string; -} -/** - * A single strongly-typed value. - */ -export interface Schema$TypedValue { + * A content string and a MIME type that describes the content string's + * format. + */ + export interface Schema$Documentation { + /** + * The text of the documentation, interpreted according to mime_type. The + * content may not exceed 8,192 Unicode characters and may not exceed more + * than 10,240 bytes when encoded in UTF-8 format, whichever is smaller. + */ + content: string; + /** + * The format of the content field. Presently, only the value + * "text/markdown" is supported. See Markdown + * (https://en.wikipedia.org/wiki/Markdown) for more information. + */ + mimeType: string; + } /** - * A Boolean value: true or false. - */ - boolValue: boolean; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for Empty is empty JSON object {}. + */ + export interface Schema$Empty {} + /** + * Specifies a set of buckets with arbitrary widths.There are size(bounds) + 1 + * (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i + * < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1The bounds + * field must contain at least one element. If bounds has only one element, + * then there are no finite buckets, and that single element is the common + * boundary of the overflow and underflow buckets. + */ + export interface Schema$Explicit { + /** + * The values must be monotonically increasing. + */ + bounds: number[]; + } /** - * A distribution value. - */ - distributionValue: Schema$Distribution; + * Specifies an exponential sequence of buckets that have a width that is + * proportional to the value of the lower bound. Each bucket represents a + * constant relative uncertainty on a specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). + * Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). + */ + export interface Schema$Exponential { + /** + * Must be greater than 1. + */ + growthFactor: number; + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Must be greater than 0. + */ + scale: number; + } /** - * A 64-bit double-precision floating-point number. Its magnitude is - * approximately &plusmn;10<sup>&plusmn;300</sup> and it - * has 16 significant digits of precision. - */ - doubleValue: number; + * A single field of a message type. + */ + export interface Schema$Field { + /** + * The field cardinality. + */ + cardinality: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + */ + defaultValue: string; + /** + * The field JSON name. + */ + jsonName: string; + /** + * The field type. + */ + kind: string; + /** + * The field name. + */ + name: string; + /** + * The field number. + */ + number: number; + /** + * The index of the field type in Type.oneofs, for message or enumeration + * types. The first type has index 1; zero means the type is not in the + * list. + */ + oneofIndex: number; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * Whether to use alternative packed wire representation. + */ + packed: boolean; + /** + * The field type URL, without the scheme, for message or enumeration types. + * Example: "type.googleapis.com/google.protobuf.Timestamp". + */ + typeUrl: string; + } /** - * A 64-bit integer. Its range is approximately - * &plusmn;9.2x10<sup>18</sup>. - */ - int64Value: string; + * The GetNotificationChannelVerificationCode request. + */ + export interface Schema$GetNotificationChannelVerificationCodeRequest { + /** + * The desired expiration time. If specified, the API will guarantee that + * the returned code will not be valid after the specified timestamp; + * however, the API cannot guarantee that the returned code will be valid + * for at least as long as the requested time (the API puts an upper bound + * on the amount of time for which a code may be valid). If omitted, a + * default expiration will be used, which may be less than the max + * permissible expiration (so specifying an expiration may extend the + * code's lifetime over omitting an expiration, even though the API does + * impose an upper limit on the maximum expiration that is permitted). + */ + expireTime: string; + } /** - * A variable-length string value. - */ - stringValue: string; -} -/** - * This message configures which resources and services to monitor for - * availability. - */ -export interface Schema$UptimeCheckConfig { + * The GetNotificationChannelVerificationCode request. + */ + export interface Schema$GetNotificationChannelVerificationCodeResponse { + /** + * The verification code, which may be used to verify other channels that + * have an equivalent identity (i.e. other channels of the same type with + * the same fingerprint such as other email channels with the same email + * address or other sms channels with the same number). + */ + code: string; + /** + * The expiration time associated with the code that was returned. If an + * expiration was provided in the request, this is the minimum of the + * requested expiration in the request and the max permitted expiration. + */ + expireTime: string; + } /** - * The expected content on the page the check is run against. Currently, only - * the first entry in the list is supported, and other entries will be - * ignored. The server will look for an exact match of the string in the page - * response's content. This field is optional and should only be specified - * if a content match is required. - */ - contentMatchers: Schema$ContentMatcher[]; + * The description of a dynamic collection of monitored resources. Each group + * has a filter that is matched against monitored resources and their + * associated metadata. If a group's filter matches an available monitored + * resource, then that resource is a member of that group. Groups can contain + * any number of monitored resources, and each monitored resource can be a + * member of any number of groups.Groups can be nested in parent-child + * hierarchies. The parentName field identifies an optional parent for each + * group. If a group has a parent, then the only monitored resources available + * to be matched by the group's filter are the resources contained in the + * parent group. In other words, a group contains the monitored resources that + * match its filter and the filters of all the group's ancestors. A group + * without a parent can contain any monitored resource.For example, consider + * an infrastructure running a set of instances with two user-defined tags: + * "environment" and "role". A parent group has a filter, + * environment="production". A child of that parent group has a + * filter, role="transcoder". The parent group contains all + * instances in the production environment, regardless of their roles. The + * child group contains instances that have the transcoder role and are in the + * production environment.The monitored resources contained in a group can + * change at any moment, depending on what resources exist and what filters + * are associated with the group and its ancestors. + */ + export interface Schema$Group { + /** + * A user-assigned name for this group, used only for display purposes. + */ + displayName: string; + /** + * The filter used to determine which monitored resources belong to this + * group. + */ + filter: string; + /** + * If true, the members of this group are considered to be a cluster. The + * system can perform additional analysis on groups that are clusters. + */ + isCluster: boolean; + /** + * Output only. The name of this group. The format is + * "projects/{project_id_or_number}/groups/{group_id}". When + * creating a group, this field is ignored and a new name is created + * consisting of the project specified in the call to CreateGroup and a + * unique {group_id} that is generated automatically. + */ + name: string; + /** + * The name of the group's parent, if it has one. The format is + * "projects/{project_id_or_number}/groups/{group_id}". For groups + * with no parent, parentName is the empty string, "". + */ + parentName: string; + } /** - * A human-friendly name for the uptime check configuration. The display name - * should be unique within a Stackdriver Account in order to make it easier to - * identify; however, uniqueness is not enforced. Required. - */ - displayName: string; + * Information involved in an HTTP/HTTPS uptime check request. + */ + export interface Schema$HttpCheck { + /** + * The authentication information. Optional when creating an HTTP check; + * defaults to empty. + */ + authInfo: Schema$BasicAuthentication; + /** + * The list of headers to send as part of the uptime check request. If two + * headers have the same key and different values, they should be entered as + * a single header, with the value being a comma-separated list of all the + * desired values as described at + * https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two + * separate headers with the same key in a Create call will cause the first + * to be overwritten by the second. The maximum number of headers allowed is + * 100. + */ + headers: any; + /** + * Boolean specifiying whether to encrypt the header information. Encryption + * should be specified for any headers related to authentication that you do + * not wish to be seen when retrieving the configuration. The server will be + * responsible for encrypting the headers. On Get/List calls, if + * mask_headers is set to True then the headers will be obscured with + * ******. + */ + maskHeaders: boolean; + /** + * The path to the page to run the check against. Will be combined with the + * host (specified within the MonitoredResource) and port to construct the + * full URL. Optional (defaults to "/"). + */ + path: string; + /** + * The port to the page to run the check against. Will be combined with host + * (specified within the MonitoredResource) and path to construct the full + * URL. Optional (defaults to 80 without SSL, or 443 with SSL). + */ + port: number; + /** + * If true, use HTTPS instead of HTTP to run the check. + */ + useSsl: boolean; + } /** - * Contains information needed to make an HTTP or HTTPS check. - */ - httpCheck: Schema$HttpCheck; + * Nimbus InternalCheckers. + */ + export interface Schema$InternalChecker { + /** + * The checker ID. + */ + checkerId: string; + /** + * The checker's human-readable name. + */ + displayName: string; + /** + * The GCP zone the uptime check should egress from. Only respected for + * internal uptime checks, where internal_network is specified. + */ + gcpZone: string; + /** + * The internal network to perform this uptime check on. + */ + network: string; + /** + * The GCP project ID. Not necessarily the same as the project_id for the + * config. + */ + projectId: string; + } /** - * The internal checkers that this check will egress from. If is_internal is - * true and this list is empty, the check will egress from all - * InternalCheckers configured for the project that owns this CheckConfig. - */ - internalCheckers: Schema$InternalChecker[]; + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; + } /** - * Denotes whether this is a check that egresses from InternalCheckers. - */ - isInternal: boolean; + * Specifies a linear sequence of buckets that all have the same width (except + * overflow and underflow). Each bucket represents a constant absolute + * uncertainty on the specific value in the bucket.There are + * num_finite_buckets + 2 (= N) buckets. Bucket i has the following + * boundaries:Upper bound (0 <= i < N-1): offset + (width * i). Lower + * bound (1 <= i < N): offset + (width * (i - 1)). + */ + export interface Schema$Linear { + /** + * Must be greater than 0. + */ + numFiniteBuckets: number; + /** + * Lower bound of the first bucket. + */ + offset: number; + /** + * Must be greater than 0. + */ + width: number; + } /** - * The monitored resource (https://cloud.google.com/monitoring/api/resources) - * associated with the configuration. The following monitored resource types - * are supported for uptime checks: uptime_url gce_instance gae_app - * aws_ec2_instance aws_elb_load_balancer - */ - monitoredResource: Schema$MonitoredResource; + * The protocol for the ListAlertPolicies response. + */ + export interface Schema$ListAlertPoliciesResponse { + /** + * The returned alert policies. + */ + alertPolicies: Schema$AlertPolicy[]; + /** + * If there might be more results than were returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + } /** - * A unique resource name for this UptimeCheckConfig. The format - * is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field - * should be omitted when creating the uptime check configuration; on create, - * the resource name is assigned by the server and included in the response. - */ - name: string; + * The ListGroupMembers response. + */ + export interface Schema$ListGroupMembersResponse { + /** + * A set of monitored resources in the group. + */ + members: Schema$MonitoredResource[]; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + /** + * The total number of elements matching this request. + */ + totalSize: number; + } /** - * How often, in seconds, the uptime check is performed. Currently, the only - * supported values are 60s (1 minute), 300s (5 minutes), 600s (10 minutes), - * and 900s (15 minutes). Optional, defaults to 300s. - */ - period: string; + * The ListGroups response. + */ + export interface Schema$ListGroupsResponse { + /** + * The groups that match the specified filters. + */ + group: Schema$Group[]; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + } /** - * The group resource associated with the configuration. - */ - resourceGroup: Schema$ResourceGroup; + * The ListMetricDescriptors response. + */ + export interface Schema$ListMetricDescriptorsResponse { + /** + * The metric descriptors that are available to the project and that match + * the value of filter, if present. + */ + metricDescriptors: Schema$MetricDescriptor[]; + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + } /** - * The list of regions from which the check will be run. If this field is - * specified, enough regions to include a minimum of 3 locations must be - * provided, or an error message is returned. Not specifying this field will - * result in uptime checks running from all regions. - */ - selectedRegions: string[]; + * The ListMonitoredResourceDescriptors response. + */ + export interface Schema$ListMonitoredResourceDescriptorsResponse { + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + /** + * The monitored resource descriptors that are available to this project and + * that match filter, if present. + */ + resourceDescriptors: Schema$MonitoredResourceDescriptor[]; + } /** - * Contains information needed to make a TCP check. - */ - tcpCheck: Schema$TcpCheck; + * The ListNotificationChannelDescriptors response. + */ + export interface Schema$ListNotificationChannelDescriptorsResponse { + /** + * The monitored resource descriptors supported for the specified project, + * optionally filtered. + */ + channelDescriptors: Schema$NotificationChannelDescriptor[]; + /** + * If not empty, indicates that there may be more results that match the + * request. Use the value in the page_token field in a subsequent request to + * fetch the next set of results. If empty, all results have been returned. + */ + nextPageToken: string; + } /** - * The maximum amount of time to wait for the request to complete (must be - * between 1 and 60 seconds). Required. - */ - timeout: string; -} -/** - * Contains the region, location, and list of IP addresses where checkers in the - * location run from. - */ -export interface Schema$UptimeCheckIp { + * The ListNotificationChannels response. + */ + export interface Schema$ListNotificationChannelsResponse { + /** + * If not empty, indicates that there may be more results that match the + * request. Use the value in the page_token field in a subsequent request to + * fetch the next set of results. If empty, all results have been returned. + */ + nextPageToken: string; + /** + * The notification channels defined for the specified project. + */ + notificationChannels: Schema$NotificationChannel[]; + } /** - * The IP address from which the uptime check originates. This is a full IP - * address (not an IP address range). Most IP addresses, as of this - * publication, are in IPv4 format; however, one should not rely on the IP - * addresses being in IPv4 format indefinitely and should support interpreting - * this field in either IPv4 or IPv6 format. - */ - ipAddress: string; + * The ListTimeSeries response. + */ + export interface Schema$ListTimeSeriesResponse { + /** + * If there are more results than have been returned, then this field is set + * to a non-empty value. To see the additional results, use that value as + * pageToken in the next call to this method. + */ + nextPageToken: string; + /** + * One or more time series that match the filter included in the request. + */ + timeSeries: Schema$TimeSeries[]; + } /** - * A more specific location within the region that typically encodes a - * particular city/town/metro (and its containing state/province or country) - * within the broader umbrella region category. - */ - location: string; + * The protocol for the ListUptimeCheckConfigs response. + */ + export interface Schema$ListUptimeCheckConfigsResponse { + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). + */ + nextPageToken: string; + /** + * The total number of uptime check configurations for the project, + * irrespective of any pagination. + */ + totalSize: number; + /** + * The returned uptime check configurations. + */ + uptimeCheckConfigs: Schema$UptimeCheckConfig[]; + } /** - * A broad region category in which the IP address is located. - */ - region: string; -} -/** - * The VerifyNotificationChannel request. - */ -export interface Schema$VerifyNotificationChannelRequest { + * The protocol for the ListUptimeCheckIps response. + */ + export interface Schema$ListUptimeCheckIpsResponse { + /** + * This field represents the pagination token to retrieve the next page of + * results. If the value is empty, it means no further results for the + * request. To retrieve the next page of results, the value of the + * next_page_token is passed to the subsequent List method call (in the + * request message's page_token field). NOTE: this field is not yet + * implemented + */ + nextPageToken: string; + /** + * The returned list of IP addresses (including region and location) that + * the checkers run from. + */ + uptimeCheckIps: Schema$UptimeCheckIp[]; + } /** - * The verification code that was delivered to the channel as a result of - * invoking the SendNotificationChannelVerificationCode API method or that was - * retrieved from a verified channel via - * GetNotificationChannelVerificationCode. For example, one might have - * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, - * one is only guaranteed that the code is valid UTF-8; one should not make - * any assumptions regarding the structure or format of the code). - */ - code: string; -} - -export class Resource$Projects { - root: Monitoring; - alertPolicies: Resource$Projects$Alertpolicies; - collectdTimeSeries: Resource$Projects$Collectdtimeseries; - groups: Resource$Projects$Groups; - metricDescriptors: Resource$Projects$Metricdescriptors; - monitoredResourceDescriptors: Resource$Projects$Monitoredresourcedescriptors; - notificationChannelDescriptors: - Resource$Projects$Notificationchanneldescriptors; - notificationChannels: Resource$Projects$Notificationchannels; - timeSeries: Resource$Projects$Timeseries; - uptimeCheckConfigs: Resource$Projects$Uptimecheckconfigs; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - this.alertPolicies = new Resource$Projects$Alertpolicies(root); - this.collectdTimeSeries = new Resource$Projects$Collectdtimeseries(root); - this.groups = new Resource$Projects$Groups(root); - this.metricDescriptors = new Resource$Projects$Metricdescriptors(root); - this.monitoredResourceDescriptors = - new Resource$Projects$Monitoredresourcedescriptors(root); - this.notificationChannelDescriptors = - new Resource$Projects$Notificationchanneldescriptors(root); - this.notificationChannels = - new Resource$Projects$Notificationchannels(root); - this.timeSeries = new Resource$Projects$Timeseries(root); - this.uptimeCheckConfigs = new Resource$Projects$Uptimecheckconfigs(root); + * A specific metric, identified by specifying values for all of the labels of + * a MetricDescriptor. + */ + export interface Schema$Metric { + /** + * The set of label values that uniquely identify this metric. All labels + * listed in the MetricDescriptor must be assigned values. + */ + labels: any; + /** + * An existing metric type, see google.api.MetricDescriptor. For example, + * custom.googleapis.com/invoice/paid/amount. + */ + type: string; } - - getRoot() { - return this.root; + /** + * A condition type that checks that monitored resources are reporting data. + * The configuration defines a metric and a set of monitored resources. The + * predicate is considered in violation when a time series for the specified + * metric of a monitored resource does not include any data in the specified + * duration. + */ + export interface Schema$MetricAbsence { + /** + * Specifies the alignment of data points in individual time series as well + * as how to combine the retrieved time series together (such as when + * aggregating multiple streams on each resource to a single stream for each + * resource or when aggregating streams across all members of a group of + * resrouces). Multiple aggregations are applied in the order specified.This + * field is similar to the one in the MetricService.ListTimeSeries request. + * It is advisable to use the ListTimeSeries method when debugging this + * field. + */ + aggregations: Schema$Aggregation[]; + /** + * The amount of time that a time series must fail to report new data to be + * considered failing. Currently, only values that are a multiple of a + * minute--e.g. 60, 120, or 300 seconds--are supported. If an invalid value + * is given, an error will be returned. The Duration.nanos field is ignored. + */ + duration: string; + /** + * A filter that identifies which time series should be compared with the + * threshold.The filter is similar to the one that is specified in the + * MetricService.ListTimeSeries request (that call is useful to verify the + * time series that will be retrieved / processed) and must specify the + * metric type and optionally may contain restrictions on resource type, + * resource labels, and metric labels. This field may not exceed 2048 + * Unicode characters in length. + */ + filter: string; + /** + * The number/percent of time series for which the comparison must hold in + * order for the condition to trigger. If unspecified, then the condition + * will trigger if the comparison is true for any of the time series that + * have been identified by filter and aggregations. + */ + trigger: Schema$Trigger; } -} -export class Resource$Projects$Alertpolicies { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); + /** + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * appengine.googleapis.com/http/server/response_latencies metric type has a + * label for the HTTP response code, response_code, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of metric_kind and value_type might not be supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * custom.googleapis.com. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * Optional. The unit in which the metric value is reported. For example, + * kBy/s means kilobytes/sec, and 1 is the dimensionless unit. The supported + * units are a subset of The Unified Code for Units of Measure standard + * (http://unitsofmeasure.org/ucum.html).<br><br> This field is + * part of the metric's documentation, but it is ignored by Stackdriver. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of metric_kind and value_type might not be supported. + */ + valueType: string; } - - getRoot() { - return this.root; + /** + * A condition type that compares a collection of time series against a + * threshold. + */ + export interface Schema$MetricThreshold { + /** + * Specifies the alignment of data points in individual time series as well + * as how to combine the retrieved time series together (such as when + * aggregating multiple streams on each resource to a single stream for each + * resource or when aggregating streams across all members of a group of + * resrouces). Multiple aggregations are applied in the order specified.This + * field is similar to the one in the MetricService.ListTimeSeries request. + * It is advisable to use the ListTimeSeries method when debugging this + * field. + */ + aggregations: Schema$Aggregation[]; + /** + * The comparison to apply between the time series (indicated by filter and + * aggregation) and the threshold (indicated by threshold_value). The + * comparison is applied on each time series, with the time series on the + * left-hand side and the threshold on the right-hand side.Only + * COMPARISON_LT and COMPARISON_GT are supported currently. + */ + comparison: string; + /** + * Specifies the alignment of data points in individual time series selected + * by denominatorFilter as well as how to combine the retrieved time series + * together (such as when aggregating multiple streams on each resource to a + * single stream for each resource or when aggregating streams across all + * members of a group of resources).When computing ratios, the aggregations + * and denominator_aggregations fields must use the same alignment period + * and produce time series that have the same periodicity and labels.This + * field is similar to the one in the MetricService.ListTimeSeries request. + * It is advisable to use the ListTimeSeries method when debugging this + * field. + */ + denominatorAggregations: Schema$Aggregation[]; + /** + * A filter that identifies a time series that should be used as the + * denominator of a ratio that will be compared with the threshold. If a + * denominator_filter is specified, the time series specified by the filter + * field will be used as the numerator.The filter is similar to the one that + * is specified in the MetricService.ListTimeSeries request (that call is + * useful to verify the time series that will be retrieved / processed) and + * must specify the metric type and optionally may contain restrictions on + * resource type, resource labels, and metric labels. This field may not + * exceed 2048 Unicode characters in length. + */ + denominatorFilter: string; + /** + * The amount of time that a time series must violate the threshold to be + * considered failing. Currently, only values that are a multiple of a + * minute--e.g. 60, 120, or 300 seconds--are supported. If an invalid value + * is given, an error will be returned. The Duration.nanos field is ignored. + * When choosing a duration, it is useful to keep in mind the frequency of + * the underlying time series data (which may also be affected by any + * alignments specified in the aggregation field); a good duration is long + * enough so that a single outlier does not generate spurious alerts, but + * short enough that unhealthy states are detected and alerted on quickly. + */ + duration: string; + /** + * A filter that identifies which time series should be compared with the + * threshold.The filter is similar to the one that is specified in the + * MetricService.ListTimeSeries request (that call is useful to verify the + * time series that will be retrieved / processed) and must specify the + * metric type and optionally may contain restrictions on resource type, + * resource labels, and metric labels. This field may not exceed 2048 + * Unicode characters in length. + */ + filter: string; + /** + * A value against which to compare the time series. + */ + thresholdValue: number; + /** + * The number/percent of time series for which the comparison must hold in + * order for the condition to trigger. If unspecified, then the condition + * will trigger if the comparison is true for any of the time series that + * have been identified by filter and aggregations, or by the ratio, if + * denominator_filter and denominator_aggregations are specified. + */ + trigger: Schema$Trigger; } - - /** - * monitoring.projects.alertPolicies.create - * @desc Creates a new alerting policy. - * @alias monitoring.projects.alertPolicies.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project in which to create the alerting policy. The format is projects/[PROJECT_ID].Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[POLICY_ID], identifying the policy in the container. - * @param {().AlertPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/alertPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object representing a resource that can be used for monitoring, logging, + * billing, or other purposes. Examples include virtual machine instances, + * databases, and storage devices such as disks. The type field identifies a + * MonitoredResourceDescriptor object that describes the resource's + * schema. Information in the labels field identifies the actual resource and + * its attributes according to the schema. For example, a particular Compute + * Engine VM instance could be represented by the following object, because + * the MonitoredResourceDescriptor for "gce_instance" has labels + * "instance_id" and "zone": { "type": + * "gce_instance", "labels": { "instance_id": + * "12345678901234", "zone": + * "us-central1-a" }} + */ + export interface Schema$MonitoredResource { + /** + * Required. Values for all of the labels listed in the associated monitored + * resource descriptor. For example, Compute Engine VM instances use the + * labels "project_id", "instance_id", and + * "zone". + */ + labels: any; + /** + * Required. The monitored resource type. This field must match the type + * field of a MonitoredResourceDescriptor object. For example, the type of a + * Compute Engine VM instance is gce_instance. + */ + type: string; } - - /** - * monitoring.projects.alertPolicies.delete - * @desc Deletes an alerting policy. - * @alias monitoring.projects.alertPolicies.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The alerting policy to delete. The format is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] For more information, see AlertPolicy. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * "gce_instance" and specifies the use of the labels + * "instance_id" and "zone" to identify particular VM + * instances.Different APIs can support different monitored resource types. + * APIs generally provide a list method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, "Google Cloud + * SQL Database". + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels "database_id" and + * "zone". + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * "projects/{project_id}/monitoredResourceDescriptors/{type}" + * where {type} is the value of the type field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format "monitoredResourceDescriptors/{type}". + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * "cloudsql_database" represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; } - - /** - * monitoring.projects.alertPolicies.get - * @desc Gets a single alerting policy. - * @alias monitoring.projects.alertPolicies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The alerting policy to retrieve. The format is projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Auxiliary metadata for a MonitoredResource object. MonitoredResource + * objects contain the minimum set of information to uniquely identify a + * monitored resource instance. There is some other useful auxiliary metadata. + * Google Stackdriver Monitoring & Logging uses an ingestion pipeline to + * extract metadata for cloud resources of all types , and stores the metadata + * in this message. + */ + export interface Schema$MonitoredResourceMetadata { + /** + * Output only. Values for predefined system metadata labels. System labels + * are a kind of metadata extracted by Google Stackdriver. Stackdriver + * determines what system labels are useful and how to obtain their values. + * Some examples: "machine_image", "vpc", + * "subnet_id", "security_group", "name", etc. + * System label values can be only strings, Boolean values, or a list of + * strings. For example: { "name": "my-test-instance", + * "security_group": ["a", "b", + * "c"], "spot_instance": false } + */ + systemLabels: any; + /** + * Output only. A map of user-defined metadata labels. + */ + userLabels: any; } - - /** - * monitoring.projects.alertPolicies.list - * @desc Lists the existing alerting policies for the project. - * @alias monitoring.projects.alertPolicies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter If provided, this field specifies the criteria that must be met by alert policies to be included in the response.For more details, see sorting and filtering. - * @param {string} params.name The project whose alert policies are to be listed. The format is projects/[PROJECT_ID] Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the GetAlertPolicy operation, instead. - * @param {string=} params.orderBy A comma-separated list of fields by which to sort the result. Supports the same set of field references as the filter field. Entries can be prefixed with a minus sign to sort by the field in descending order.For more details, see sorting and filtering. - * @param {integer=} params.pageSize The maximum number of results to return in a single response. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/alertPolicies') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Describes a change made to a configuration. + */ + export interface Schema$MutationRecord { + /** + * The email address of the user making the change. + */ + mutatedBy: string; + /** + * When the change occurred. + */ + mutateTime: string; } - - /** - * monitoring.projects.alertPolicies.patch - * @desc Updates an alerting policy. You can either replace the entire policy - * with a new one or replace only certain fields in the current alerting - * policy by specifying the fields to be updated via updateMask. Returns the - * updated alerting policy. - * @alias monitoring.projects.alertPolicies.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required if the policy exists. The resource name for this policy. The syntax is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. - * @param {string=} params.updateMask Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (alert_policy), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.Examples of valid field masks include display_name, documentation, documentation.content, documentation.mime_type, user_labels, user_label.nameofkey, enabled, conditions, combiner, etc.If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: The new policy will have the same [ALERT_POLICY_ID] as the former policy. This gives you continuity with the former policy in your notifications and incidents. Conditions in the new policy will keep their former [CONDITION_ID] if the supplied condition includes the name field with that [CONDITION_ID]. If the supplied condition omits the name field, then a new [CONDITION_ID] is created. - * @param {().AlertPolicy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A NotificationChannel is a medium through which an alert is delivered when + * a policy violation is detected. Examples of channels include email, SMS, + * and third-party messaging applications. Fields containing sensitive + * information like authentication tokens or contact info are only partially + * populated on retrieval. + */ + export interface Schema$NotificationChannel { + /** + * An optional human-readable description of this notification channel. This + * description may provide additional details, beyond the display name, for + * the channel. This may not exceeed 1024 Unicode characters. + */ + description: string; + /** + * An optional human-readable name for this notification channel. It is + * recommended that you specify a non-empty and unique name in order to make + * it easier to identify the channels in your project, though this is not + * enforced. The display name is limited to 512 Unicode characters. + */ + displayName: string; + /** + * Whether notifications are forwarded to the described channel. This makes + * it possible to disable delivery of notifications to a particular channel + * without removing the channel from all alerting policies that reference + * the channel. This is a more convenient approach when the change is + * temporary and you want to receive notifications from the same set of + * alerting policies on the channel at some point in the future. + */ + enabled: boolean; + /** + * Configuration fields that define the channel and its behavior. The + * permissible and required labels are specified in the + * NotificationChannelDescriptor.labels of the NotificationChannelDescriptor + * corresponding to the type field. + */ + labels: any; + /** + * The full REST resource name for this channel. The syntax is: + * projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] + * is automatically assigned by the server on creation. + */ + name: string; + /** + * The type of the notification channel. This field matches the value of the + * NotificationChannelDescriptor.type field. + */ + type: string; + /** + * User-supplied key/value data that does not need to conform to the + * corresponding NotificationChannelDescriptor's schema, unlike the + * labels field. This field is intended to be used for organizing and + * identifying the NotificationChannel objects.The field can contain up to + * 64 entries. Each key and value is limited to 63 Unicode characters or 128 + * bytes, whichever is smaller. Labels and values can contain only lowercase + * letters, numerals, underscores, and dashes. Keys must begin with a + * letter. + */ + userLabels: any; + /** + * Indicates whether this channel has been verified or not. On a + * ListNotificationChannels or GetNotificationChannel operation, this field + * is expected to be populated.If the value is UNVERIFIED, then it indicates + * that the channel is non-functioning (it both requires verification and + * lacks verification); otherwise, it is assumed that the channel works.If + * the channel is neither VERIFIED nor UNVERIFIED, it implies that the + * channel is of a type that does not require verification or that this + * specific channel has been exempted from verification because it was + * created prior to verification being required for channels of this + * type.This field cannot be modified using a standard + * UpdateNotificationChannel operation. To change the value of this field, + * you must call VerifyNotificationChannel. + */ + verificationStatus: string; } -} - -export class Resource$Projects$Collectdtimeseries { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); + /** + * A description of a notification channel. The descriptor includes the + * properties of the channel and the set of labels or fields that must be + * specified to configure channels of a given type. + */ + export interface Schema$NotificationChannelDescriptor { + /** + * A human-readable description of the notification channel type. The + * description may include a description of the properties of the channel + * and pointers to external documentation. + */ + description: string; + /** + * A human-readable name for the notification channel type. This form of the + * name is suitable for a user interface. + */ + displayName: string; + /** + * The set of labels that must be defined to identify a particular channel + * of the corresponding type. Each label includes a description for how that + * field should be populated. + */ + labels: Schema$LabelDescriptor[]; + /** + * The full REST resource name for this descriptor. The syntax is: + * projects/[PROJECT_ID]/notificationChannelDescriptors/[TYPE] In the above, + * [TYPE] is the value of the type field. + */ + name: string; + /** + * The tiers that support this notification channel; the project service + * tier must be one of the supported_tiers. + */ + supportedTiers: string[]; + /** + * The type of notification channel, such as "email", + * "sms", etc. Notification channel types are globally unique. + */ + type: string; } - - getRoot() { - return this.root; + /** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + */ + export interface Schema$Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, + * "map_entry". For custom options, it should be the + * fully-qualified name. For example, "google.api.http". + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a + * primitive, the corresponding wrapper type defined in + * google/protobuf/wrappers.proto should be used. If the value is an enum, + * it should be stored as an int32 value using the + * google.protobuf.Int32Value type. + */ + value: any; } - - /** - * monitoring.projects.collectdTimeSeries.create - * @desc Stackdriver Monitoring Agent only: Creates a new time series.

- * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'create' method: - * - * // The project in which to create the time series. The format is - * `"projects/PROJECT_ID_OR_NUMBER"`. name: "projects/{MY-PROJECT}", resource: - * {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.collectdTimeSeries.create(request, function(err, - * result) { if (err) { console.log(err); } else { console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.collectdTimeSeries.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project in which to create the time series. The format is "projects/PROJECT_ID_OR_NUMBER". - * @param {().CreateCollectdTimeSeriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/collectdTimeSeries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * A single data point in a time series. + */ + export interface Schema$Point { + /** + * The time interval to which the data point applies. For GAUGE metrics, + * only the end time of the interval is used. For DELTA metrics, the start + * and end time should specify a non-zero interval, with subsequent points + * specifying contiguous and non-overlapping intervals. For CUMULATIVE + * metrics, the start and end time should specify a non-zero interval, with + * subsequent points specifying the same start time and increasing end + * times, until an event resets the cumulative value to zero and sets a new + * start time for the following points. + */ + interval: Schema$TimeInterval; + /** + * The value of the data point. + */ + value: Schema$TypedValue; } -} - -export class Resource$Projects$Groups { - root: Monitoring; - members: Resource$Projects$Groups$Members; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - this.members = new Resource$Projects$Groups$Members(root); + /** + * The range of the population values. + */ + export interface Schema$Range { + /** + * The maximum of the population values. + */ + max: number; + /** + * The minimum of the population values. + */ + min: number; } - - getRoot() { - return this.root; + /** + * The resource submessage for group checks. It can be used instead of a + * monitored resource, when multiple resources are being monitored. + */ + export interface Schema$ResourceGroup { + /** + * The group of resources being monitored. Should be only the group_id, not + * projects/<project_id>/groups/<group_id>. + */ + groupId: string; + /** + * The resource type of the group members. + */ + resourceType: string; } - - /** - * monitoring.projects.groups.create - * @desc Creates a new group. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'create' method: - * - * // The project in which to create the group. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.groups.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project in which to create the group. The format is "projects/{project_id_or_number}". - * @param {boolean=} params.validateOnly If true, validate this request but do not create the group. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The SendNotificationChannelVerificationCode request. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - + export interface Schema$SendNotificationChannelVerificationCodeRequest {} /** - * monitoring.projects.groups.delete - * @desc Deletes an existing group. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'delete' method: - * - * // The group to delete. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. name: - * "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.delete(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.groups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * SourceContext represents information about the source of a protobuf + * element, like the file in which it is defined. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: + * "google/protobuf/source_context.proto". + */ + fileName: string; } - - /** - * monitoring.projects.groups.get - * @desc Gets a single group. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'get' method: - * - * // The group to retrieve. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. name: - * "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.get(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.groups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The group to retrieve. The format is "projects/{project_id_or_number}/groups/{group_id}". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The Status type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by gRPC (https://github.com/grpc). The error model is designed to be: + * Simple to use and understand for most users Flexible enough to meet + * unexpected needsOverviewThe Status message contains three pieces of data: + * error code, error message, and error details. The error code should be an + * enum value of google.rpc.Code, but it may accept additional error codes if + * needed. The error message should be a developer-facing English message that + * helps developers understand and resolve the error. If a localized + * user-facing error message is needed, put the localized message in the error + * details or localize it in the client. The optional error details may + * contain arbitrary information about the error. There is a predefined set of + * error detail types in the package google.rpc that can be used for common + * error conditions.Language mappingThe Status message is the logical + * representation of the error model, but it is not necessarily the actual + * wire format. When the Status message is exposed in different client + * libraries and different wire protocols, it can be mapped differently. For + * example, it will likely be mapped to some exceptions in Java, but more + * likely mapped to some error codes in C.Other usesThe error model and the + * Status message can be used in a variety of environments, either with or + * without APIs, to provide a consistent developer experience across different + * environments.Example uses of this error model include: Partial errors. If a + * service needs to return partial errors to the client, it may embed the + * Status in the normal response to indicate the partial errors. Workflow + * errors. A typical workflow has multiple steps. Each step may have a Status + * message for error reporting. Batch operations. If a client uses batch + * request and batch response, the Status message should be used directly + * inside batch response, one for each error sub-response. Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the Status message. Logging. If some API errors are stored in logs, + * the message Status could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * monitoring.projects.groups.list - * @desc Lists the existing groups. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'list' method: - * - * // The project whose groups are to be listed. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.groups.list(request, recur); - * } - * } - * }; - * - * monitoring.projects.groups.list(request, recur); - * }); - * @alias monitoring.projects.groups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.ancestorsOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. - * @param {string=} params.childrenOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty. - * @param {string=} params.descendantsOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth. - * @param {string} params.name The project whose groups are to be listed. The format is "projects/{project_id_or_number}". - * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Information required for a TCP uptime check request. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TcpCheck { + /** + * The port to the page to run the check against. Will be combined with host + * (specified within the MonitoredResource) to construct the full URL. + * Required. + */ + port: number; } - - /** - * monitoring.projects.groups.update - * @desc Updates an existing group. You can change any group attributes except - * name. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'update' method: - * - * // The name of this group. The format is - * `"projects/{project_id_or_number}/groups/{group_id}"`. When - * // creating a group, this field is ignored and a new name is created - * consisting of the project - * // specified in the call to `CreateGroup` and a unique `{group_id}` - * that is generated automatically. - * // @OutputOnly - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.groups.update(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. - * @param {boolean=} params.validateOnly If true, validate this request but do not update the existing group. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A time interval extending just after a start time through an end time. If + * the start time is the same as the end time, then the interval represents a + * single point in time. + */ + export interface Schema$TimeInterval { + /** + * Required. The end of the time interval. + */ + endTime: string; + /** + * Optional. The beginning of the time interval. The default value for the + * start time is the end time. The start time must not be later than the end + * time. + */ + startTime: string; + } + /** + * A collection of data points that describes the time-varying values of a + * metric. A time series is identified by a combination of a fully-specified + * monitored resource and a fully-specified metric. This type is used for both + * listing and creating time series. + */ + export interface Schema$TimeSeries { + /** + * Output only. The associated monitored resource metadata. When reading a a + * timeseries, this field will include metadata labels that are explicitly + * named in the reduction. When creating a timeseries, this field is + * ignored. + */ + metadata: Schema$MonitoredResourceMetadata; + /** + * The associated metric. A fully-specified metric used to identify the time + * series. + */ + metric: Schema$Metric; + /** + * The metric kind of the time series. When listing time series, this metric + * kind might be different from the metric kind of the associated metric if + * this time series is an alignment or reduction of other time series.When + * creating a time series, this field is optional. If present, it must be + * the same as the metric kind of the associated metric. If the associated + * metric's descriptor must be auto-created, then this field specifies + * the metric kind of the new descriptor and must be either GAUGE (the + * default) or CUMULATIVE. + */ + metricKind: string; + /** + * The data points of this time series. When listing time series, points are + * returned in reverse time order.When creating a time series, this field + * must contain exactly one point and the point's type must be the same + * as the value type of the associated metric. If the associated + * metric's descriptor must be auto-created, then the value type of the + * descriptor is determined by the point's type, which must be BOOL, + * INT64, DOUBLE, or DISTRIBUTION. + */ + points: Schema$Point[]; + /** + * The associated monitored resource. Custom metrics can use only certain + * monitored resource types in their time series data. + */ + resource: Schema$MonitoredResource; + /** + * The value type of the time series. When listing time series, this value + * type might be different from the value type of the associated metric if + * this time series is an alignment or reduction of other time series.When + * creating a time series, this field is optional. If present, it must be + * the same as the type of the data in the points field. + */ + valueType: string; } -} -export class Resource$Projects$Groups$Members { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); + /** + * Specifies how many time series must fail a predicate to trigger a + * condition. If not specified, then a {count: 1} trigger is used. + */ + export interface Schema$Trigger { + /** + * The absolute number of time series that must fail the predicate for the + * condition to be triggered. + */ + count: number; + /** + * The percentage of time series that must fail the predicate for the + * condition to be triggered. + */ + percent: number; } - - getRoot() { - return this.root; + /** + * A protocol buffer message type. + */ + export interface Schema$Type { + /** + * The list of fields. + */ + fields: Schema$Field[]; + /** + * The fully qualified message name. + */ + name: string; + /** + * The list of types appearing in oneof definitions in this type. + */ + oneofs: string[]; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; } - - /** - * monitoring.projects.groups.members.list - * @desc Lists the monitored resources that are members of a group. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'list' method: - * - * // The group whose members are listed. The format is - * // `"projects/{project_id_or_number}/groups/{group_id}"`. - * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.groups.members.list(request, recur); - * } - * } - * }; - * - * monitoring.projects.groups.members.list(request, recur); - * }); - * @alias monitoring.projects.groups.members.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An optional list filter describing the members to be returned. The filter may reference the type, labels, and metadata of monitored resources that comprise the group. For example, to return only resources representing Compute Engine VM instances, use this filter: resource.type = "gce_instance" - * @param {string=} params.interval.endTime Required. The end of the time interval. - * @param {string=} params.interval.startTime Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. - * @param {string} params.name The group whose members are listed. The format is "projects/{project_id_or_number}/groups/{group_id}". - * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v3/{+name}/members').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A single strongly-typed value. + */ + export interface Schema$TypedValue { + /** + * A Boolean value: true or false. + */ + boolValue: boolean; + /** + * A distribution value. + */ + distributionValue: Schema$Distribution; + /** + * A 64-bit double-precision floating-point number. Its magnitude is + * approximately &plusmn;10<sup>&plusmn;300</sup> and it + * has 16 significant digits of precision. + */ + doubleValue: number; + /** + * A 64-bit integer. Its range is approximately + * &plusmn;9.2x10<sup>18</sup>. + */ + int64Value: string; + /** + * A variable-length string value. + */ + stringValue: string; } -} - - -export class Resource$Projects$Metricdescriptors { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); + /** + * This message configures which resources and services to monitor for + * availability. + */ + export interface Schema$UptimeCheckConfig { + /** + * The expected content on the page the check is run against. Currently, + * only the first entry in the list is supported, and other entries will be + * ignored. The server will look for an exact match of the string in the + * page response's content. This field is optional and should only be + * specified if a content match is required. + */ + contentMatchers: Schema$ContentMatcher[]; + /** + * A human-friendly name for the uptime check configuration. The display + * name should be unique within a Stackdriver Account in order to make it + * easier to identify; however, uniqueness is not enforced. Required. + */ + displayName: string; + /** + * Contains information needed to make an HTTP or HTTPS check. + */ + httpCheck: Schema$HttpCheck; + /** + * The internal checkers that this check will egress from. If is_internal is + * true and this list is empty, the check will egress from all + * InternalCheckers configured for the project that owns this CheckConfig. + */ + internalCheckers: Schema$InternalChecker[]; + /** + * Denotes whether this is a check that egresses from InternalCheckers. + */ + isInternal: boolean; + /** + * The monitored resource + * (https://cloud.google.com/monitoring/api/resources) associated with the + * configuration. The following monitored resource types are supported for + * uptime checks: uptime_url gce_instance gae_app aws_ec2_instance + * aws_elb_load_balancer + */ + monitoredResource: Schema$MonitoredResource; + /** + * A unique resource name for this UptimeCheckConfig. The format + * is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field + * should be omitted when creating the uptime check configuration; on + * create, the resource name is assigned by the server and included in the + * response. + */ + name: string; + /** + * How often, in seconds, the uptime check is performed. Currently, the only + * supported values are 60s (1 minute), 300s (5 minutes), 600s (10 minutes), + * and 900s (15 minutes). Optional, defaults to 300s. + */ + period: string; + /** + * The group resource associated with the configuration. + */ + resourceGroup: Schema$ResourceGroup; + /** + * The list of regions from which the check will be run. If this field is + * specified, enough regions to include a minimum of 3 locations must be + * provided, or an error message is returned. Not specifying this field will + * result in uptime checks running from all regions. + */ + selectedRegions: string[]; + /** + * Contains information needed to make a TCP check. + */ + tcpCheck: Schema$TcpCheck; + /** + * The maximum amount of time to wait for the request to complete (must be + * between 1 and 60 seconds). Required. + */ + timeout: string; } - - getRoot() { - return this.root; + /** + * Contains the region, location, and list of IP addresses where checkers in + * the location run from. + */ + export interface Schema$UptimeCheckIp { + /** + * The IP address from which the uptime check originates. This is a full IP + * address (not an IP address range). Most IP addresses, as of this + * publication, are in IPv4 format; however, one should not rely on the IP + * addresses being in IPv4 format indefinitely and should support + * interpreting this field in either IPv4 or IPv6 format. + */ + ipAddress: string; + /** + * A more specific location within the region that typically encodes a + * particular city/town/metro (and its containing state/province or country) + * within the broader umbrella region category. + */ + location: string; + /** + * A broad region category in which the IP address is located. + */ + region: string; } - - /** - * monitoring.projects.metricDescriptors.create - * @desc Creates a new metric descriptor. User-created metric descriptors - * define custom metrics. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'create' method: - * - * // The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.create(request, function(err, - * result) { if (err) { console.log(err); } else { console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.metricDescriptors.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". - * @param {().MetricDescriptor} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/metricDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The VerifyNotificationChannel request. + */ + export interface Schema$VerifyNotificationChannelRequest { + /** + * The verification code that was delivered to the channel as a result of + * invoking the SendNotificationChannelVerificationCode API method or that + * was retrieved from a verified channel via + * GetNotificationChannelVerificationCode. For example, one might have + * "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, + * one is only guaranteed that the code is valid UTF-8; one should not make + * any assumptions regarding the structure or format of the code). + */ + code: string; } + export class Resource$Projects { + root: Monitoring; + alertPolicies: Resource$Projects$Alertpolicies; + collectdTimeSeries: Resource$Projects$Collectdtimeseries; + groups: Resource$Projects$Groups; + metricDescriptors: Resource$Projects$Metricdescriptors; + monitoredResourceDescriptors: + Resource$Projects$Monitoredresourcedescriptors; + notificationChannelDescriptors: + Resource$Projects$Notificationchanneldescriptors; + notificationChannels: Resource$Projects$Notificationchannels; + timeSeries: Resource$Projects$Timeseries; + uptimeCheckConfigs: Resource$Projects$Uptimecheckconfigs; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); + this.alertPolicies = new Resource$Projects$Alertpolicies(root); + this.collectdTimeSeries = new Resource$Projects$Collectdtimeseries(root); + this.groups = new Resource$Projects$Groups(root); + this.metricDescriptors = new Resource$Projects$Metricdescriptors(root); + this.monitoredResourceDescriptors = + new Resource$Projects$Monitoredresourcedescriptors(root); + this.notificationChannelDescriptors = + new Resource$Projects$Notificationchanneldescriptors(root); + this.notificationChannels = + new Resource$Projects$Notificationchannels(root); + this.timeSeries = new Resource$Projects$Timeseries(root); + this.uptimeCheckConfigs = new Resource$Projects$Uptimecheckconfigs(root); + } - /** - * monitoring.projects.metricDescriptors.delete - * @desc Deletes a metric descriptor. Only user-created custom metrics can be - * deleted. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'delete' method: - * - * // The metric descriptor on which to execute the request. The format is - * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example of `{metric_id}` is: - * // `"custom.googleapis.com/my_test_metric"`. - * name: "", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.delete(request, function(err, - * result) { if (err) { console.log(err); } else { console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.metricDescriptors.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example of {metric_id} is: "custom.googleapis.com/my_test_metric". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Alertpolicies { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * monitoring.projects.metricDescriptors.get - * @desc Gets a single metric descriptor. This method does not require a - * Stackdriver account. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'get' method: - * - * // The metric descriptor on which to execute the request. The format is - * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. - * An example value of `{metric_id}` - * // is `"compute.googleapis.com/instance/disk/read_bytes_count"`. - * name: "", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.metricDescriptors.get(request, function(err, result) - * { if (err) { console.log(err); } else { console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.metricDescriptors.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example value of {metric_id} is "compute.googleapis.com/instance/disk/read_bytes_count". - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * monitoring.projects.alertPolicies.create + * @desc Creates a new alerting policy. + * @alias monitoring.projects.alertPolicies.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project in which to create the alerting policy. The format is projects/[PROJECT_ID].Note that this field names the parent container in which the alerting policy will be written, not the name of the created policy. The alerting policy that is returned will have a name that contains a normalized representation of this name as a prefix but adds a suffix of the form /alertPolicies/[POLICY_ID], identifying the policy in the container. + * @param {().AlertPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/alertPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * monitoring.projects.metricDescriptors.list - * @desc Lists metric descriptors that match a filter. This method does not - * require a Stackdriver account. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'list' method: - * - * // The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.metricDescriptors.list(request, recur); - * } - * } - * }; - * - * monitoring.projects.metricDescriptors.list(request, recur); - * }); - * @alias monitoring.projects.metricDescriptors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics: metric.type = starts_with("custom.googleapis.com/") - * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". - * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/metricDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * monitoring.projects.alertPolicies.delete + * @desc Deletes an alerting policy. + * @alias monitoring.projects.alertPolicies.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The alerting policy to delete. The format is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] For more information, see AlertPolicy. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Monitoredresourcedescriptors { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * monitoring.projects.alertPolicies.get + * @desc Gets a single alerting policy. + * @alias monitoring.projects.alertPolicies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The alerting policy to retrieve. The format is projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * monitoring.projects.monitoredResourceDescriptors.get - * @desc Gets a single monitored resource descriptor. This method does not - * require a Stackdriver account. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'get' method: - * - * // The monitored resource descriptor to get. The format is - * // - * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. - * The - * // `{resource_type}` is a predefined type, such as `cloudsql_database`. - * name: - * "projects/{MY-PROJECT}/monitoredResourceDescriptors/{MY-MONITOREDRESOURCEDESCRIPTOR}", - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.monitoredResourceDescriptors.get(request, - * function(err, result) { if (err) { console.log(err); } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.monitoredResourceDescriptors.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * monitoring.projects.alertPolicies.list + * @desc Lists the existing alerting policies for the project. + * @alias monitoring.projects.alertPolicies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter If provided, this field specifies the criteria that must be met by alert policies to be included in the response.For more details, see sorting and filtering. + * @param {string} params.name The project whose alert policies are to be listed. The format is projects/[PROJECT_ID] Note that this field names the parent container in which the alerting policies to be listed are stored. To retrieve a single alerting policy by name, use the GetAlertPolicy operation, instead. + * @param {string=} params.orderBy A comma-separated list of fields by which to sort the result. Supports the same set of field references as the filter field. Entries can be prefixed with a minus sign to sort by the field in descending order.For more details, see sorting and filtering. + * @param {integer=} params.pageSize The maximum number of results to return in a single response. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/alertPolicies') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * monitoring.projects.monitoredResourceDescriptors.list - * @desc Lists monitored resource descriptors that match a filter. This method - * does not require a Stackdriver account. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'list' method: - * - * // The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.monitoredResourceDescriptors.list(request, - * recur); - * } - * } - * }; - * - * monitoring.projects.monitoredResourceDescriptors.list(request, recur); - * }); - * @alias monitoring.projects.monitoredResourceDescriptors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: resource.type = starts_with("gce_") AND resource.label:id - * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". - * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListMonitoredResourceDescriptorsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/monitoredResourceDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * monitoring.projects.alertPolicies.patch + * @desc Updates an alerting policy. You can either replace the entire + * policy with a new one or replace only certain fields in the current + * alerting policy by specifying the fields to be updated via updateMask. + * Returns the updated alerting policy. + * @alias monitoring.projects.alertPolicies.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required if the policy exists. The resource name for this policy. The syntax is: projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID] [ALERT_POLICY_ID] is assigned by Stackdriver Monitoring when the policy is created. When calling the alertPolicies.create method, do not include the name field in the alerting policy passed as part of the request. + * @param {string=} params.updateMask Optional. A list of alerting policy field names. If this field is not empty, each listed field in the existing alerting policy is set to the value of the corresponding field in the supplied policy (alert_policy), or to the field's default value if the field is not in the supplied alerting policy. Fields not listed retain their previous value.Examples of valid field masks include display_name, documentation, documentation.content, documentation.mime_type, user_labels, user_label.nameofkey, enabled, conditions, combiner, etc.If this field is empty, then the supplied alerting policy replaces the existing policy. It is the same as deleting the existing policy and adding the supplied policy, except for the following: The new policy will have the same [ALERT_POLICY_ID] as the former policy. This gives you continuity with the former policy in your notifications and incidents. Conditions in the new policy will keep their former [CONDITION_ID] if the supplied condition includes the name field with that [CONDITION_ID]. If the supplied condition omits the name field, then a new [CONDITION_ID] is created. + * @param {().AlertPolicy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Notificationchanneldescriptors { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Collectdtimeseries { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * monitoring.projects.notificationChannelDescriptors.get - * @desc Gets a single channel descriptor. The descriptor indicates which - * fields are expected / permitted for a notification channel of the given - * type. - * @alias monitoring.projects.notificationChannelDescriptors.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The channel type for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * monitoring.projects.collectdTimeSeries.create + * @desc Stackdriver Monitoring Agent only: Creates a new time series. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'create' method: + * + * // The project in which to create the time series. The format is + * `"projects/PROJECT_ID_OR_NUMBER"`. name: "projects/{MY-PROJECT}", + * resource: {}, + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.collectdTimeSeries.create(request, function(err, + * result) { if (err) { console.log(err); } else { console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.collectdTimeSeries.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project in which to create the time series. The format is "projects/PROJECT_ID_OR_NUMBER". + * @param {().CreateCollectdTimeSeriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/collectdTimeSeries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * monitoring.projects.notificationChannelDescriptors.list - * @desc Lists the descriptors for supported channel types. The use of - * descriptors makes it possible for new channel types to be dynamically - * added. - * @alias monitoring.projects.notificationChannelDescriptors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: projects/[PROJECT_ID] Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead. - * @param {integer=} params.pageSize The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. - * @param {string=} params.pageToken If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListNotificationChannelDescriptorsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$ListNotificationChannelDescriptorsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Groups { + root: Monitoring; + members: Resource$Projects$Groups$Members; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); + this.members = new Resource$Projects$Groups$Members(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/notificationChannelDescriptors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$ListNotificationChannelDescriptorsResponse>(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Projects$Notificationchannels { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * monitoring.projects.groups.create + * @desc Creates a new group. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'create' method: + * + * // The project in which to create the group. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * resource: {}, + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.groups.create(request, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.groups.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project in which to create the group. The format is "projects/{project_id_or_number}". + * @param {boolean=} params.validateOnly If true, validate this request but do not create the group. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * monitoring.projects.notificationChannels.create - * @desc Creates a new notification channel, representing a single - * notification endpoint such as an email address, SMS number, or pagerduty - * service. - * @alias monitoring.projects.notificationChannels.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project on which to execute the request. The format is: projects/[PROJECT_ID] Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. - * @param {().NotificationChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.groups.delete + * @desc Deletes an existing group. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'delete' method: + * + * // The group to delete. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. name: + * "projects/{MY-PROJECT}/groups/{MY-GROUP}", + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.groups.delete(request, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.groups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The group to delete. The format is "projects/{project_id_or_number}/groups/{group_id}". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/notificationChannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * monitoring.projects.notificationChannels.delete - * @desc Deletes a notification channel. - * @alias monitoring.projects.notificationChannels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.force If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. - * @param {string} params.name The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * monitoring.projects.groups.get + * @desc Gets a single group. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'get' method: + * + * // The group to retrieve. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. name: + * "projects/{MY-PROJECT}/groups/{MY-GROUP}", + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.groups.get(request, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.groups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The group to retrieve. The format is "projects/{project_id_or_number}/groups/{group_id}". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * monitoring.projects.notificationChannels.get - * @desc Gets a single notification channel. The channel includes the relevant - * configuration details with which the channel was created. However, the - * response may truncate or omit passwords, API keys, or other private key - * matter and thus the response may not be 100% identical to the information - * that was supplied in the call to the create method. - * @alias monitoring.projects.notificationChannels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.groups.list + * @desc Lists the existing groups. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'list' method: + * + * // The project whose groups are to be listed. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * // Auth client + * auth: authClient + * }; + * + * + * var recur = function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * if (result.nextPageToken) { + * request.pageToken = result.nextPageToken; + * monitoring.projects.groups.list(request, recur); + * } + * } + * }; + * + * monitoring.projects.groups.list(request, recur); + * }); + * @alias monitoring.projects.groups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.ancestorsOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups that are ancestors of the specified group. The groups are returned in order, starting with the immediate parent and ending with the most distant ancestor. If the specified group has no immediate parent, the results are empty. + * @param {string=} params.childrenOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns groups whose parentName field contains the group name. If no groups have this parent, the results are empty. + * @param {string=} params.descendantsOfGroup A group name: "projects/{project_id_or_number}/groups/{group_id}". Returns the descendants of the specified group. This is a superset of the results returned by the childrenOfGroup filter, and includes children-of-children, and so forth. + * @param {string} params.name The project whose groups are to be listed. The format is "projects/{project_id_or_number}". + * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * monitoring.projects.notificationChannels.getVerificationCode - * @desc Requests a verification code for an already verified channel that can - * then be used in a call to VerifyNotificationChannel() on a different - * channel with an equivalent identity in the same or in a different project. - * This makes it possible to copy a channel between projects without requiring - * manual reverification of the channel. If the channel is not in the verified - * state, this method will fail (in other words, this may only be used if the - * SendNotificationChannelVerificationCode and VerifyNotificationChannel paths - * have already been used to put the given channel into the verified - * state).There is no guarantee that the verification codes returned by this - * method will be of a similar structure or form as the ones that are - * delivered to the channel via SendNotificationChannelVerificationCode; while - * VerifyNotificationChannel() will recognize both the codes delivered via - * SendNotificationChannelVerificationCode() and returned from - * GetNotificationChannelVerificationCode(), it is typically the case that the - * verification codes delivered via SendNotificationChannelVerificationCode() - * will be shorter and also have a shorter expiration (e.g. codes such as - * "G-123456") whereas GetVerificationCode() will typically return a much - * longer, websafe base 64 encoded string that has a longer expiration time. - * @alias monitoring.projects.notificationChannels.getVerificationCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. - * @param {().GetNotificationChannelVerificationCodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getVerificationCode(params?: any, options?: MethodOptions): - AxiosPromise; - getVerificationCode( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GetNotificationChannelVerificationCodeResponse>, - callback?: BodyResponseCallback< - Schema$GetNotificationChannelVerificationCodeResponse>): void; - getVerificationCode( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GetNotificationChannelVerificationCodeResponse>, - callback?: BodyResponseCallback< - Schema$GetNotificationChannelVerificationCodeResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.groups.update + * @desc Updates an existing group. You can change any group attributes + * except name. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'update' method: + * + * // The name of this group. The format is + * `"projects/{project_id_or_number}/groups/{group_id}"`. When + * // creating a group, this field is ignored and a new name is created + * consisting of the project + * // specified in the call to `CreateGroup` and a unique `{group_id}` + * that is generated automatically. + * // @OutputOnly + * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", + * resource: {}, + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.groups.update(request, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Output only. The name of this group. The format is "projects/{project_id_or_number}/groups/{group_id}". When creating a group, this field is ignored and a new name is created consisting of the project specified in the call to CreateGroup and a unique {group_id} that is generated automatically. + * @param {boolean=} params.validateOnly If true, validate this request but do not update the existing group. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Groups$Members { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}:getVerificationCode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$GetNotificationChannelVerificationCodeResponse>(parameters); + + getRoot() { + return this.root; } - } - /** - * monitoring.projects.notificationChannels.list - * @desc Lists the notification channels that have been created for the - * project. - * @alias monitoring.projects.notificationChannels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter If provided, this field specifies the criteria that must be met by notification channels to be included in the response.For more details, see sorting and filtering. - * @param {string} params.name The project on which to execute the request. The format is projects/[PROJECT_ID]. That is, this names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation. - * @param {string=} params.orderBy A comma-separated list of fields by which to sort the result. Supports the same set of fields as in filter. Entries can be prefixed with a minus sign to sort in descending rather than ascending order.For more details, see sorting and filtering. - * @param {integer=} params.pageSize The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. - * @param {string=} params.pageToken If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/notificationChannels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * monitoring.projects.groups.members.list + * @desc Lists the monitored resources that are members of a group. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'list' method: + * + * // The group whose members are listed. The format is + * // `"projects/{project_id_or_number}/groups/{group_id}"`. + * name: "projects/{MY-PROJECT}/groups/{MY-GROUP}", + * // Auth client + * auth: authClient + * }; + * + * + * var recur = function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * if (result.nextPageToken) { + * request.pageToken = result.nextPageToken; + * monitoring.projects.groups.members.list(request, recur); + * } + * } + * }; + * + * monitoring.projects.groups.members.list(request, recur); + * }); + * @alias monitoring.projects.groups.members.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An optional list filter describing the members to be returned. The filter may reference the type, labels, and metadata of monitored resources that comprise the group. For example, to return only resources representing Compute Engine VM instances, use this filter: resource.type = "gce_instance" + * @param {string=} params.interval.endTime Required. The end of the time interval. + * @param {string=} params.interval.startTime Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. + * @param {string} params.name The group whose members are listed. The format is "projects/{project_id_or_number}/groups/{group_id}". + * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/members') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * monitoring.projects.notificationChannels.patch - * @desc Updates a notification channel. Fields not specified in the field - * mask remain unchanged. - * @alias monitoring.projects.notificationChannels.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The full REST resource name for this channel. The syntax is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] is automatically assigned by the server on creation. - * @param {string=} params.updateMask The fields to update. - * @param {().NotificationChannel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Metricdescriptors { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.metricDescriptors.create + * @desc Creates a new metric descriptor. User-created metric descriptors + * define custom metrics. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'create' method: + * + * // The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * resource: {}, + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.metricDescriptors.create(request, function(err, + * result) { if (err) { console.log(err); } else { console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.metricDescriptors.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". + * @param {().MetricDescriptor} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/metricDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * monitoring.projects.notificationChannels.sendVerificationCode - * @desc Causes a verification code to be delivered to the channel. The code - * can then be supplied in VerifyNotificationChannel to verify the channel. - * @alias monitoring.projects.notificationChannels.sendVerificationCode - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The notification channel to which to send a verification code. - * @param {().SendNotificationChannelVerificationCodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sendVerificationCode(params?: any, options?: MethodOptions): - AxiosPromise; - sendVerificationCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - sendVerificationCode( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.metricDescriptors.delete + * @desc Deletes a metric descriptor. Only user-created custom metrics can + * be deleted. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'delete' method: + * + * // The metric descriptor on which to execute the request. The format + * is + * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + * An example of `{metric_id}` is: + * // `"custom.googleapis.com/my_test_metric"`. + * name: "", + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.metricDescriptors.delete(request, function(err, + * result) { if (err) { console.log(err); } else { console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.metricDescriptors.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example of {metric_id} is: "custom.googleapis.com/my_test_metric". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * monitoring.projects.metricDescriptors.get + * @desc Gets a single metric descriptor. This method does not require a + * Stackdriver account. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'get' method: + * + * // The metric descriptor on which to execute the request. The format + * is + * // `"projects/{project_id_or_number}/metricDescriptors/{metric_id}"`. + * An example value of `{metric_id}` + * // is `"compute.googleapis.com/instance/disk/read_bytes_count"`. + * name: "", + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.metricDescriptors.get(request, function(err, + * result) { if (err) { console.log(err); } else { console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.metricDescriptors.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The metric descriptor on which to execute the request. The format is "projects/{project_id_or_number}/metricDescriptors/{metric_id}". An example value of {metric_id} is "compute.googleapis.com/instance/disk/read_bytes_count". + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}:sendVerificationCode') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.metricDescriptors.list + * @desc Lists metric descriptors that match a filter. This method does not + * require a Stackdriver account. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'list' method: + * + * // The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * // Auth client + * auth: authClient + * }; + * + * + * var recur = function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * if (result.nextPageToken) { + * request.pageToken = result.nextPageToken; + * monitoring.projects.metricDescriptors.list(request, recur); + * } + * } + * }; + * + * monitoring.projects.metricDescriptors.list(request, recur); + * }); + * @alias monitoring.projects.metricDescriptors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter If this field is empty, all custom and system-defined metric descriptors are returned. Otherwise, the filter specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics: metric.type = starts_with("custom.googleapis.com/") + * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". + * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/metricDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * monitoring.projects.notificationChannels.verify - * @desc Verifies a NotificationChannel by proving receipt of the code - * delivered to the channel as a result of calling - * SendNotificationChannelVerificationCode. - * @alias monitoring.projects.notificationChannels.verify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The notification channel to verify. - * @param {().VerifyNotificationChannelRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verify(params?: any, options?: MethodOptions): - AxiosPromise; - verify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - verify( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Monitoredresourcedescriptors { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}:verify').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.monitoredResourceDescriptors.get + * @desc Gets a single monitored resource descriptor. This method does not + * require a Stackdriver account. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'get' method: + * + * // The monitored resource descriptor to get. The format is + * // + * `"projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}"`. + * The + * // `{resource_type}` is a predefined type, such as + * `cloudsql_database`. name: + * "projects/{MY-PROJECT}/monitoredResourceDescriptors/{MY-MONITOREDRESOURCEDESCRIPTOR}", + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.monitoredResourceDescriptors.get(request, + * function(err, result) { if (err) { console.log(err); } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.monitoredResourceDescriptors.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The monitored resource descriptor to get. The format is "projects/{project_id_or_number}/monitoredResourceDescriptors/{resource_type}". The {resource_type} is a predefined type, such as cloudsql_database. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Timeseries { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * monitoring.projects.monitoredResourceDescriptors.list + * @desc Lists monitored resource descriptors that match a filter. This + * method does not require a Stackdriver account. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'list' method: + * + * // The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * // Auth client + * auth: authClient + * }; + * + * + * var recur = function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * if (result.nextPageToken) { + * request.pageToken = result.nextPageToken; + * monitoring.projects.monitoredResourceDescriptors.list(request, + * recur); + * } + * } + * }; + * + * monitoring.projects.monitoredResourceDescriptors.list(request, recur); + * }); + * @alias monitoring.projects.monitoredResourceDescriptors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Google Compute Engine descriptors that have an id label: resource.type = starts_with("gce_") AND resource.label:id + * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". + * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListMonitoredResourceDescriptorsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/monitoredResourceDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListMonitoredResourceDescriptorsResponse>(parameters); + } + } } + export class Resource$Projects$Notificationchanneldescriptors { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); + } - /** - * monitoring.projects.timeSeries.create - * @desc Creates or adds data to one or more time series. The response is - * empty if all time series in the request were written. If any time series - * could not be written, a corresponding failure message is included in the - * error response. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'create' method: - * - * // The project on which to execute the request. The format is - * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", - * resource: {}, - * // Auth client - * auth: authClient - * }; - * - * monitoring.projects.timeSeries.create(request, function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * } - * }); - * }); - * @alias monitoring.projects.timeSeries.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". - * @param {().CreateTimeSeriesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * monitoring.projects.notificationChannelDescriptors.get + * @desc Gets a single channel descriptor. The descriptor indicates which + * fields are expected / permitted for a notification channel of the given + * type. + * @alias monitoring.projects.notificationChannelDescriptors.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The channel type for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannelDescriptors/{channel_type}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/timeSeries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.notificationChannelDescriptors.list + * @desc Lists the descriptors for supported channel types. The use of + * descriptors makes it possible for new channel types to be dynamically + * added. + * @alias monitoring.projects.notificationChannelDescriptors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: projects/[PROJECT_ID] Note that this names the parent container in which to look for the descriptors; to retrieve a single descriptor by name, use the GetNotificationChannelDescriptor operation, instead. + * @param {integer=} params.pageSize The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. + * @param {string=} params.pageToken If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListNotificationChannelDescriptorsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$ListNotificationChannelDescriptorsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/notificationChannelDescriptors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$ListNotificationChannelDescriptorsResponse>(parameters); + } } } - - /** - * monitoring.projects.timeSeries.list - * @desc Lists time series that match a filter. This method does not require a - * Stackdriver account. - * @example - * * // PRE-REQUISITES: - * // --------------- - * // 1. If not already done, enable the Google Monitoring API and check the - * quota for your project at - * // - * https://console.developers.google.com/apis/api/monitoring_component/quotas - * // 2. This sample uses Application Default Credentials for Auth. If not - * already done, install the gcloud CLI from - * // https://cloud.google.com/sdk/ and run 'gcloud beta auth - * application-default login' - * // 3. To install the client library and Application Default Credentials - * library, run: - * // 'npm install googleapis --save' - * var google = require('googleapis'); - * var monitoring = google.monitoring('v3'); - * - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.log('Authentication failed because of ', err); - * return; - * } - * if (authClient.createScopedRequired && authClient.createScopedRequired()) - * { var scopes = ['https://www.googleapis.com/auth/cloud-platform']; - * authClient = authClient.createScoped(scopes); - * } - * - * var request = { - * // TODO: Change placeholders below to appropriate parameter values for - * the 'list' method: - * - * // The project on which to execute the request. The format is - * "projects/{project_id_or_number}". name: "projects/{MY-PROJECT}", - * // Auth client - * auth: authClient - * }; - * - * - * var recur = function(err, result) { - * if (err) { - * console.log(err); - * } else { - * console.log(result); - * if (result.nextPageToken) { - * request.pageToken = result.nextPageToken; - * monitoring.projects.timeSeries.list(request, recur); - * } - * } - * }; - * - * monitoring.projects.timeSeries.list(request, recur); - * }); - * @alias monitoring.projects.timeSeries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.aggregation.alignmentPeriod The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned. - * @param {string=} params.aggregation.crossSeriesReducer The approach to be used to combine time series. Not all reducer functions may be applied to all time series, depending on the metric type and the value type of the original time series. Reduction may change the metric type of value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. - * @param {string=} params.aggregation.groupByFields The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored. - * @param {string=} params.aggregation.perSeriesAligner The approach to be used to align individual time series. Not all alignment functions may be applied to all time series, depending on the metric type and value type of the original time series. Alignment may change the metric type or the value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. - * @param {string=} params.filter A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.label.instance_name = "my-instance-name" - * @param {string=} params.interval.endTime Required. The end of the time interval. - * @param {string=} params.interval.startTime Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. - * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". - * @param {string=} params.orderBy Unsupported: must be left blank. The points in each time series are returned in reverse time order. - * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. When view field sets to FULL, it limits the number of Points server will return; if view field is HEADERS, it limits the number of TimeSeries server will return. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. - * @param {string=} params.view Specifies which information is returned about the time series. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Notificationchannels { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}/timeSeries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.notificationChannels.create + * @desc Creates a new notification channel, representing a single + * notification endpoint such as an email address, SMS number, or pagerduty + * service. + * @alias monitoring.projects.notificationChannels.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project on which to execute the request. The format is: projects/[PROJECT_ID] Note that this names the container into which the channel will be written. This does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel. + * @param {().NotificationChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/notificationChannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Uptimecheckconfigs { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * monitoring.projects.notificationChannels.delete + * @desc Deletes a notification channel. + * @alias monitoring.projects.notificationChannels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.force If true, the notification channel will be deleted regardless of its use in alert policies (the policies will be updated to remove the channel). If false, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. + * @param {string} params.name The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * monitoring.projects.uptimeCheckConfigs.create - * @desc Creates a new uptime check configuration. - * @alias monitoring.projects.uptimeCheckConfigs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The project in which to create the uptime check. The format is projects/[PROJECT_ID]. - * @param {().UptimeCheckConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.notificationChannels.get + * @desc Gets a single notification channel. The channel includes the + * relevant configuration details with which the channel was created. + * However, the response may truncate or omit passwords, API keys, or other + * private key matter and thus the response may not be 100% identical to the + * information that was supplied in the call to the create method. + * @alias monitoring.projects.notificationChannels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The channel for which to execute the request. The format is projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * monitoring.projects.notificationChannels.getVerificationCode + * @desc Requests a verification code for an already verified channel that + * can then be used in a call to VerifyNotificationChannel() on a different + * channel with an equivalent identity in the same or in a different + * project. This makes it possible to copy a channel between projects + * without requiring manual reverification of the channel. If the channel is + * not in the verified state, this method will fail (in other words, this + * may only be used if the SendNotificationChannelVerificationCode and + * VerifyNotificationChannel paths have already been used to put the given + * channel into the verified state).There is no guarantee that the + * verification codes returned by this method will be of a similar structure + * or form as the ones that are delivered to the channel via + * SendNotificationChannelVerificationCode; while + * VerifyNotificationChannel() will recognize both the codes delivered via + * SendNotificationChannelVerificationCode() and returned from + * GetNotificationChannelVerificationCode(), it is typically the case that + * the verification codes delivered via + * SendNotificationChannelVerificationCode() will be shorter and also have a + * shorter expiration (e.g. codes such as "G-123456") whereas + * GetVerificationCode() will typically return a much longer, websafe base + * 64 encoded string that has a longer expiration time. + * @alias monitoring.projects.notificationChannels.getVerificationCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The notification channel for which a verification code is to be generated and retrieved. This must name a channel that is already verified; if the specified channel is not verified, the request will fail. + * @param {().GetNotificationChannelVerificationCodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getVerificationCode(params?: any, options?: MethodOptions): + AxiosPromise; + getVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GetNotificationChannelVerificationCodeResponse>, + callback?: BodyResponseCallback< + Schema$GetNotificationChannelVerificationCodeResponse>): void; + getVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GetNotificationChannelVerificationCodeResponse>, + callback?: BodyResponseCallback< + Schema$GetNotificationChannelVerificationCodeResponse>): void| + AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}:getVerificationCode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GetNotificationChannelVerificationCodeResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+parent}/uptimeCheckConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.notificationChannels.list + * @desc Lists the notification channels that have been created for the + * project. + * @alias monitoring.projects.notificationChannels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter If provided, this field specifies the criteria that must be met by notification channels to be included in the response.For more details, see sorting and filtering. + * @param {string} params.name The project on which to execute the request. The format is projects/[PROJECT_ID]. That is, this names the container in which to look for the notification channels; it does not name a specific channel. To query a specific channel by REST resource name, use the GetNotificationChannel operation. + * @param {string=} params.orderBy A comma-separated list of fields by which to sort the result. Supports the same set of fields as in filter. Entries can be prefixed with a minus sign to sort in descending rather than ascending order.For more details, see sorting and filtering. + * @param {integer=} params.pageSize The maximum number of results to return in a single response. If not set to a positive number, a reasonable value will be chosen by the service. + * @param {string=} params.pageToken If non-empty, page_token must contain a value returned as the next_page_token in a previous response to request the next set of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/notificationChannels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * monitoring.projects.uptimeCheckConfigs.delete - * @desc Deletes an uptime check configuration. Note that this method will - * fail if the uptime check configuration is referenced by an alert policy or - * other dependent configs that would be rendered invalid by the deletion. - * @alias monitoring.projects.uptimeCheckConfigs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The uptime check configuration to delete. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.notificationChannels.patch + * @desc Updates a notification channel. Fields not specified in the field + * mask remain unchanged. + * @alias monitoring.projects.notificationChannels.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The full REST resource name for this channel. The syntax is: projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID] The [CHANNEL_ID] is automatically assigned by the server on creation. + * @param {string=} params.updateMask The fields to update. + * @param {().NotificationChannel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * monitoring.projects.notificationChannels.sendVerificationCode + * @desc Causes a verification code to be delivered to the channel. The code + * can then be supplied in VerifyNotificationChannel to verify the channel. + * @alias monitoring.projects.notificationChannels.sendVerificationCode + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The notification channel to which to send a verification code. + * @param {().SendNotificationChannelVerificationCodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sendVerificationCode(params?: any, options?: MethodOptions): + AxiosPromise; + sendVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + sendVerificationCode( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}:sendVerificationCode') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.notificationChannels.verify + * @desc Verifies a NotificationChannel by proving receipt of the code + * delivered to the channel as a result of calling + * SendNotificationChannelVerificationCode. + * @alias monitoring.projects.notificationChannels.verify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The notification channel to verify. + * @param {().VerifyNotificationChannelRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verify(params?: any, options?: MethodOptions): + AxiosPromise; + verify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + verify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}:verify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * monitoring.projects.uptimeCheckConfigs.get - * @desc Gets a single uptime check configuration. - * @alias monitoring.projects.uptimeCheckConfigs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The uptime check configuration to retrieve. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Timeseries { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.timeSeries.create + * @desc Creates or adds data to one or more time series. The response is + * empty if all time series in the request were written. If any time series + * could not be written, a corresponding failure message is included in the + * error response. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'create' method: + * + * // The project on which to execute the request. The format is + * `"projects/{project_id_or_number}"`. name: "projects/{MY-PROJECT}", + * resource: {}, + * // Auth client + * auth: authClient + * }; + * + * monitoring.projects.timeSeries.create(request, function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * } + * }); + * }); + * @alias monitoring.projects.timeSeries.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". + * @param {().CreateTimeSeriesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/timeSeries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * monitoring.projects.uptimeCheckConfigs.list - * @desc Lists the existing valid uptime check configurations for the project, - * leaving out any invalid configurations. - * @alias monitoring.projects.uptimeCheckConfigs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. - * @param {string} params.parent The project whose uptime check configurations are listed. The format is projects/[PROJECT_ID]. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.timeSeries.list + * @desc Lists time series that match a filter. This method does not require + * a Stackdriver account. + * @example + * * // PRE-REQUISITES: + * // --------------- + * // 1. If not already done, enable the Google Monitoring API and check the + * quota for your project at + * // + * https://console.developers.google.com/apis/api/monitoring_component/quotas + * // 2. This sample uses Application Default Credentials for Auth. If not + * already done, install the gcloud CLI from + * // https://cloud.google.com/sdk/ and run 'gcloud beta auth + * application-default login' + * // 3. To install the client library and Application Default Credentials + * library, run: + * // 'npm install googleapis --save' + * var google = require('googleapis'); + * var monitoring = google.monitoring('v3'); + * + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.log('Authentication failed because of ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * + * var request = { + * // TODO: Change placeholders below to appropriate parameter values + * for the 'list' method: + * + * // The project on which to execute the request. The format is + * "projects/{project_id_or_number}". name: "projects/{MY-PROJECT}", + * // Auth client + * auth: authClient + * }; + * + * + * var recur = function(err, result) { + * if (err) { + * console.log(err); + * } else { + * console.log(result); + * if (result.nextPageToken) { + * request.pageToken = result.nextPageToken; + * monitoring.projects.timeSeries.list(request, recur); + * } + * } + * }; + * + * monitoring.projects.timeSeries.list(request, recur); + * }); + * @alias monitoring.projects.timeSeries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.aggregation.alignmentPeriod The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds. After per-time series alignment, each time series will contain data points only on the period boundaries. If perSeriesAligner is not specified or equals ALIGN_NONE, then this field is ignored. If perSeriesAligner is specified and does not equal ALIGN_NONE, then this field must be defined; otherwise an error is returned. + * @param {string=} params.aggregation.crossSeriesReducer The approach to be used to combine time series. Not all reducer functions may be applied to all time series, depending on the metric type and the value type of the original time series. Reduction may change the metric type of value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. + * @param {string=} params.aggregation.groupByFields The set of fields to preserve when crossSeriesReducer is specified. The groupByFields determine how the time series are partitioned into subsets prior to applying the aggregation function. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The crossSeriesReducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in groupByFields are aggregated away. If groupByFields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If crossSeriesReducer is not defined, this field is ignored. + * @param {string=} params.aggregation.perSeriesAligner The approach to be used to align individual time series. Not all alignment functions may be applied to all time series, depending on the metric type and value type of the original time series. Alignment may change the metric type or the value type of the time series.Time series data must be aligned in order to perform cross-time series reduction. If crossSeriesReducer is specified, then perSeriesAligner must be specified and not equal ALIGN_NONE and alignmentPeriod must be specified; otherwise, an error is returned. + * @param {string=} params.filter A monitoring filter that specifies which time series should be returned. The filter must specify a single metric type, and can additionally specify metric labels and other information. For example: metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND metric.label.instance_name = "my-instance-name" + * @param {string=} params.interval.endTime Required. The end of the time interval. + * @param {string=} params.interval.startTime Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time. + * @param {string} params.name The project on which to execute the request. The format is "projects/{project_id_or_number}". + * @param {string=} params.orderBy Unsupported: must be left blank. The points in each time series are returned in reverse time order. + * @param {integer=} params.pageSize A positive number that is the maximum number of results to return. When view field sets to FULL, it limits the number of Points server will return; if view field is HEADERS, it limits the number of TimeSeries server will return. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call. + * @param {string=} params.view Specifies which information is returned about the time series. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}/timeSeries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Projects$Uptimecheckconfigs { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+parent}/uptimeCheckConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * monitoring.projects.uptimeCheckConfigs.patch - * @desc Updates an uptime check configuration. You can either replace the - * entire configuration with a new one or replace only certain fields in the - * current configuration by specifying the fields to be updated via - * "updateMask". Returns the updated configuration. - * @alias monitoring.projects.uptimeCheckConfigs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. - * @param {string=} params.updateMask Optional. If present, only the listed fields in the current uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration. - * @param {().UptimeCheckConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * monitoring.projects.uptimeCheckConfigs.create + * @desc Creates a new uptime check configuration. + * @alias monitoring.projects.uptimeCheckConfigs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The project in which to create the uptime check. The format is projects/[PROJECT_ID]. + * @param {().UptimeCheckConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+parent}/uptimeCheckConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * monitoring.projects.uptimeCheckConfigs.delete + * @desc Deletes an uptime check configuration. Note that this method will + * fail if the uptime check configuration is referenced by an alert policy + * or other dependent configs that would be rendered invalid by the + * deletion. + * @alias monitoring.projects.uptimeCheckConfigs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The uptime check configuration to delete. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.projects.uptimeCheckConfigs.get + * @desc Gets a single uptime check configuration. + * @alias monitoring.projects.uptimeCheckConfigs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The uptime check configuration to retrieve. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Uptimecheckips { - root: Monitoring; - constructor(root: Monitoring) { - this.root = root; - this.getRoot.bind(this); - } + /** + * monitoring.projects.uptimeCheckConfigs.list + * @desc Lists the existing valid uptime check configurations for the + * project, leaving out any invalid configurations. + * @alias monitoring.projects.uptimeCheckConfigs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. + * @param {string} params.parent The project whose uptime check configurations are listed. The format is projects/[PROJECT_ID]. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+parent}/uptimeCheckConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } - getRoot() { - return this.root; + + /** + * monitoring.projects.uptimeCheckConfigs.patch + * @desc Updates an uptime check configuration. You can either replace the + * entire configuration with a new one or replace only certain fields in the + * current configuration by specifying the fields to be updated via + * "updateMask". Returns the updated configuration. + * @alias monitoring.projects.uptimeCheckConfigs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name A unique resource name for this UptimeCheckConfig. The format is:projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].This field should be omitted when creating the uptime check configuration; on create, the resource name is assigned by the server and included in the response. + * @param {string=} params.updateMask Optional. If present, only the listed fields in the current uptime check configuration are updated with values from the new configuration. If this field is empty, then the current configuration is completely replaced with the new configuration. + * @param {().UptimeCheckConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * monitoring.uptimeCheckIps.list - * @desc Returns the list of IPs that checkers run from - * @alias monitoring.uptimeCheckIps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented - * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. NOTE: this field is not yet implemented - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Uptimecheckips { + root: Monitoring; + constructor(root: Monitoring) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v3/uptimeCheckIps').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * monitoring.uptimeCheckIps.list + * @desc Returns the list of IPs that checkers run from + * @alias monitoring.uptimeCheckIps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of results to return in a single response. The server may further constrain the maximum number of results returned in a single page. If the page_size is <=0, the server will decide the number of results to be returned. NOTE: this field is not yet implemented + * @param {string=} params.pageToken If this field is not empty then it must contain the nextPageToken value returned by a previous call to this method. Using this field causes the method to return more results from the previous method call. NOTE: this field is not yet implemented + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://monitoring.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v3/uptimeCheckIps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/oauth2/v1.ts b/src/apis/oauth2/v1.ts index 0c26d70aef8..934aabb6dec 100644 --- a/src/apis/oauth2/v1.ts +++ b/src/apis/oauth2/v1.ts @@ -27,586 +27,592 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google OAuth2 API - * - * Obtains end-user authorization grants for use with other Google APIs. - * - * @example - * const google = require('googleapis'); - * const oauth2 = google.oauth2('v1'); - * - * @namespace oauth2 - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Oauth2 - */ -export class Oauth2 { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace oauth2_v1 { + /** + * Google OAuth2 API + * + * Obtains end-user authorization grants for use with other Google APIs. + * + * @example + * const google = require('googleapis'); + * const oauth2 = google.oauth2('v1'); + * + * @namespace oauth2 + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Oauth2 + */ + export class Oauth2 { + _options: GlobalOptions; + google: GoogleApis; + root = this; - userinfo: Resource$Userinfo; + userinfo: Resource$Userinfo; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.userinfo = new Resource$Userinfo(this); - } + this.userinfo = new Resource$Userinfo(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * oauth2.getCertForOpenIdConnect - * @alias oauth2.getCertForOpenIdConnect - * @memberOf! oauth2(v1) - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getCertForOpenIdConnect(params?: any, options?: MethodOptions): - AxiosPromise; - getCertForOpenIdConnect( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getCertForOpenIdConnect( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oauth2.getCertForOpenIdConnect + * @alias oauth2.getCertForOpenIdConnect + * @memberOf! oauth2(v1) + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getCertForOpenIdConnect(params?: any, options?: MethodOptions): + AxiosPromise; + getCertForOpenIdConnect( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getCertForOpenIdConnect( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v1/certs').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/oauth2/v1/certs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oauth2.getCertForOpenIdConnectRaw - * @alias oauth2.getCertForOpenIdConnectRaw - * @memberOf! oauth2(v1) - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getCertForOpenIdConnectRaw(params?: any, options?: MethodOptions): - AxiosPromise; - getCertForOpenIdConnectRaw( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getCertForOpenIdConnectRaw( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oauth2.getCertForOpenIdConnectRaw + * @alias oauth2.getCertForOpenIdConnectRaw + * @memberOf! oauth2(v1) + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getCertForOpenIdConnectRaw(params?: any, options?: MethodOptions): + AxiosPromise; + getCertForOpenIdConnectRaw( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getCertForOpenIdConnectRaw( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v1/raw_public_keys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/oauth2/v1/raw_public_keys') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oauth2.getRobotJwk - * @alias oauth2.getRobotJwk - * @memberOf! oauth2(v1) - * - * @param {object} params Parameters for request - * @param {string} params.robotEmail The email of robot account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRobotJwk(params?: any, options?: MethodOptions): AxiosPromise; - getRobotJwk( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRobotJwk( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/service_accounts/v1/jwk/{robotEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['robotEmail'], - pathParams: ['robotEmail'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.getRobotJwk + * @alias oauth2.getRobotJwk + * @memberOf! oauth2(v1) + * + * @param {object} params Parameters for request + * @param {string} params.robotEmail The email of robot account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRobotJwk(params?: any, options?: MethodOptions): + AxiosPromise; + getRobotJwk( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRobotJwk( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/service_accounts/v1/jwk/{robotEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['robotEmail'], + pathParams: ['robotEmail'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * oauth2.getRobotMetadataRaw - * @alias oauth2.getRobotMetadataRaw - * @memberOf! oauth2(v1) - * - * @param {object} params Parameters for request - * @param {string} params.robotEmail The email of robot account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRobotMetadataRaw(params?: any, options?: MethodOptions): - AxiosPromise; - getRobotMetadataRaw( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRobotMetadataRaw( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oauth2.getRobotMetadataRaw + * @alias oauth2.getRobotMetadataRaw + * @memberOf! oauth2(v1) + * + * @param {object} params Parameters for request + * @param {string} params.robotEmail The email of robot account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRobotMetadataRaw(params?: any, options?: MethodOptions): + AxiosPromise; + getRobotMetadataRaw( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRobotMetadataRaw( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/service_accounts/v1/metadata/raw/{robotEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['robotEmail'], + pathParams: ['robotEmail'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/service_accounts/v1/metadata/raw/{robotEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['robotEmail'], - pathParams: ['robotEmail'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oauth2.getRobotMetadataX509 - * @alias oauth2.getRobotMetadataX509 - * @memberOf! oauth2(v1) - * - * @param {object} params Parameters for request - * @param {string} params.robotEmail The email of robot account. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRobotMetadataX509(params?: any, options?: MethodOptions): - AxiosPromise; - getRobotMetadataX509( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRobotMetadataX509( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/service_accounts/v1/metadata/x509/{robotEmail}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['robotEmail'], - pathParams: ['robotEmail'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.getRobotMetadataX509 + * @alias oauth2.getRobotMetadataX509 + * @memberOf! oauth2(v1) + * + * @param {object} params Parameters for request + * @param {string} params.robotEmail The email of robot account. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRobotMetadataX509(params?: any, options?: MethodOptions): + AxiosPromise; + getRobotMetadataX509( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRobotMetadataX509( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/service_accounts/v1/metadata/x509/{robotEmail}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['robotEmail'], + pathParams: ['robotEmail'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * oauth2.tokeninfo - * @desc Get token info - * @alias oauth2.tokeninfo - * @memberOf! oauth2(v1) - * - * @param {object=} params Parameters for request - * @param {string=} params.access_token The oauth2 access token - * @param {string=} params.id_token The ID token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - tokeninfo(params?: any, options?: MethodOptions): - AxiosPromise; - tokeninfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - tokeninfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/oauth2/v1/tokeninfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.tokeninfo + * @desc Get token info + * @alias oauth2.tokeninfo + * @memberOf! oauth2(v1) + * + * @param {object=} params Parameters for request + * @param {string=} params.access_token The oauth2 access token + * @param {string=} params.id_token The ID token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + tokeninfo(params?: any, options?: MethodOptions): + AxiosPromise; + tokeninfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + tokeninfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v1/tokeninfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export interface Schema$Jwk { keys: any[]; } -export interface Schema$Raw { keyvalues: any[]; } -export interface Schema$Tokeninfo { - /** - * The access type granted with this token. It can be offline or online. - */ - access_type: string; - /** - * Who is the intended audience for this token. In general the same as - * issued_to. - */ - audience: string; - /** - * The email address of the user. Present only if the email scope is present - * in the request. - */ - email: string; - /** - * Boolean flag which is true if the email address is verified. Present only - * if the email scope is present in the request. - */ - email_verified: boolean; - /** - * The expiry time of the token, as number of seconds left until expiry. - */ - expires_in: number; - /** - * The issue time of the token, as number of seconds. - */ - issued_at: number; - /** - * To whom was the token issued to. In general the same as audience. - */ - issued_to: string; - /** - * Who issued the token. - */ - issuer: string; - /** - * Nonce of the id token. - */ - nonce: string; - /** - * The space separated list of scopes granted to this token. - */ - scope: string; - /** - * The obfuscated user id. - */ - user_id: string; - /** - * Boolean flag which is true if the email address is verified. Present only - * if the email scope is present in the request. - */ - verified_email: boolean; -} -export interface Schema$Userinfoplus { - /** - * The user's email address. - */ - email: string; - /** - * The user's last name. - */ - family_name: string; - /** - * The user's gender. - */ - gender: string; - /** - * The user's first name. - */ - given_name: string; - /** - * The hosted domain e.g. example.com if the user is Google apps user. - */ - hd: string; - /** - * The obfuscated ID of the user. - */ - id: string; - /** - * URL of the profile page. - */ - link: string; - /** - * The user's preferred locale. - */ - locale: string; - /** - * The user's full name. - */ - name: string; - /** - * URL of the user's picture image. - */ - picture: string; - /** - * Boolean flag which is true if the email address is verified. Always - * verified because we only return the user's primary email address. - */ - verified_email: boolean; -} -export interface Schema$X509 {} - -export class Resource$Userinfo { - root: Oauth2; - v2: Resource$Userinfo$V2; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); - this.v2 = new Resource$Userinfo$V2(root); + export interface Schema$Jwk { keys: any[]; } + export interface Schema$Raw { keyvalues: any[]; } + export interface Schema$Tokeninfo { + /** + * The access type granted with this token. It can be offline or online. + */ + access_type: string; + /** + * Who is the intended audience for this token. In general the same as + * issued_to. + */ + audience: string; + /** + * The email address of the user. Present only if the email scope is present + * in the request. + */ + email: string; + /** + * Boolean flag which is true if the email address is verified. Present only + * if the email scope is present in the request. + */ + email_verified: boolean; + /** + * The expiry time of the token, as number of seconds left until expiry. + */ + expires_in: number; + /** + * The issue time of the token, as number of seconds. + */ + issued_at: number; + /** + * To whom was the token issued to. In general the same as audience. + */ + issued_to: string; + /** + * Who issued the token. + */ + issuer: string; + /** + * Nonce of the id token. + */ + nonce: string; + /** + * The space separated list of scopes granted to this token. + */ + scope: string; + /** + * The obfuscated user id. + */ + user_id: string; + /** + * Boolean flag which is true if the email address is verified. Present only + * if the email scope is present in the request. + */ + verified_email: boolean; } - - getRoot() { - return this.root; + export interface Schema$Userinfoplus { + /** + * The user's email address. + */ + email: string; + /** + * The user's last name. + */ + family_name: string; + /** + * The user's gender. + */ + gender: string; + /** + * The user's first name. + */ + given_name: string; + /** + * The hosted domain e.g. example.com if the user is Google apps user. + */ + hd: string; + /** + * The obfuscated ID of the user. + */ + id: string; + /** + * URL of the profile page. + */ + link: string; + /** + * The user's preferred locale. + */ + locale: string; + /** + * The user's full name. + */ + name: string; + /** + * URL of the user's picture image. + */ + picture: string; + /** + * Boolean flag which is true if the email address is verified. Always + * verified because we only return the user's primary email address. + */ + verified_email: boolean; } + export interface Schema$X509 {} - - /** - * oauth2.userinfo.get - * @desc Get user info - * @alias oauth2.userinfo.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Userinfo { + root: Oauth2; + v2: Resource$Userinfo$V2; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + this.v2 = new Resource$Userinfo$V2(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/oauth2/v1/userinfo').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * oauth2.userinfo.get + * @desc Get user info + * @alias oauth2.userinfo.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v1/userinfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Userinfo$V2 { - root: Oauth2; - me: Resource$Userinfo$V2$Me; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); - this.me = new Resource$Userinfo$V2$Me(root); - } + export class Resource$Userinfo$V2 { + root: Oauth2; + me: Resource$Userinfo$V2$Me; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + this.me = new Resource$Userinfo$V2$Me(root); + } - getRoot() { - return this.root; - } -} -export class Resource$Userinfo$V2$Me { - root: Oauth2; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } + export class Resource$Userinfo$V2$Me { + root: Oauth2; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * oauth2.userinfo.v2.me.get - * @desc Get user info - * @alias oauth2.userinfo.v2.me.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/userinfo/v2/me').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.userinfo.v2.me.get + * @desc Get user info + * @alias oauth2.userinfo.v2.me.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/userinfo/v2/me').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/oauth2/v2.ts b/src/apis/oauth2/v2.ts index ab93b01a3a5..e31c137de32 100644 --- a/src/apis/oauth2/v2.ts +++ b/src/apis/oauth2/v2.ts @@ -27,367 +27,372 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google OAuth2 API - * - * Obtains end-user authorization grants for use with other Google APIs. - * - * @example - * const google = require('googleapis'); - * const oauth2 = google.oauth2('v2'); - * - * @namespace oauth2 - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Oauth2 - */ -export class Oauth2 { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace oauth2_v2 { + /** + * Google OAuth2 API + * + * Obtains end-user authorization grants for use with other Google APIs. + * + * @example + * const google = require('googleapis'); + * const oauth2 = google.oauth2('v2'); + * + * @namespace oauth2 + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Oauth2 + */ + export class Oauth2 { + _options: GlobalOptions; + google: GoogleApis; + root = this; - userinfo: Resource$Userinfo; + userinfo: Resource$Userinfo; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.userinfo = new Resource$Userinfo(this); - } + this.userinfo = new Resource$Userinfo(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * oauth2.getCertForOpenIdConnect - * @alias oauth2.getCertForOpenIdConnect - * @memberOf! oauth2(v2) - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getCertForOpenIdConnect(params?: any, options?: MethodOptions): - AxiosPromise; - getCertForOpenIdConnect( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getCertForOpenIdConnect( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oauth2.getCertForOpenIdConnect + * @alias oauth2.getCertForOpenIdConnect + * @memberOf! oauth2(v2) + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getCertForOpenIdConnect(params?: any, options?: MethodOptions): + AxiosPromise; + getCertForOpenIdConnect( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getCertForOpenIdConnect( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v2/certs').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/oauth2/v2/certs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oauth2.tokeninfo - * @alias oauth2.tokeninfo - * @memberOf! oauth2(v2) - * - * @param {object=} params Parameters for request - * @param {string=} params.access_token - * @param {string=} params.id_token - * @param {string=} params.token_handle - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - tokeninfo(params?: any, options?: MethodOptions): - AxiosPromise; - tokeninfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - tokeninfo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/oauth2/v2/tokeninfo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.tokeninfo + * @alias oauth2.tokeninfo + * @memberOf! oauth2(v2) + * + * @param {object=} params Parameters for request + * @param {string=} params.access_token + * @param {string=} params.id_token + * @param {string=} params.token_handle + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + tokeninfo(params?: any, options?: MethodOptions): + AxiosPromise; + tokeninfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + tokeninfo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v2/tokeninfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export interface Schema$Jwk { keys: any[]; } -export interface Schema$Tokeninfo { - /** - * The access type granted with this token. It can be offline or online. - */ - access_type: string; - /** - * Who is the intended audience for this token. In general the same as - * issued_to. - */ - audience: string; - /** - * The email address of the user. Present only if the email scope is present - * in the request. - */ - email: string; - /** - * The expiry time of the token, as number of seconds left until expiry. - */ - expires_in: number; - /** - * To whom was the token issued to. In general the same as audience. - */ - issued_to: string; - /** - * The space separated list of scopes granted to this token. - */ - scope: string; - /** - * The token handle associated with this token. - */ - token_handle: string; - /** - * The obfuscated user id. - */ - user_id: string; - /** - * Boolean flag which is true if the email address is verified. Present only - * if the email scope is present in the request. - */ - verified_email: boolean; -} -export interface Schema$Userinfoplus { - /** - * The user's email address. - */ - email: string; - /** - * The user's last name. - */ - family_name: string; - /** - * The user's gender. - */ - gender: string; - /** - * The user's first name. - */ - given_name: string; - /** - * The hosted domain e.g. example.com if the user is Google apps user. - */ - hd: string; - /** - * The obfuscated ID of the user. - */ - id: string; - /** - * URL of the profile page. - */ - link: string; - /** - * The user's preferred locale. - */ - locale: string; - /** - * The user's full name. - */ - name: string; - /** - * URL of the user's picture image. - */ - picture: string; - /** - * Boolean flag which is true if the email address is verified. Always - * verified because we only return the user's primary email address. - */ - verified_email: boolean; -} - -export class Resource$Userinfo { - root: Oauth2; - v2: Resource$Userinfo$V2; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); - this.v2 = new Resource$Userinfo$V2(root); + export interface Schema$Jwk { keys: any[]; } + export interface Schema$Tokeninfo { + /** + * The access type granted with this token. It can be offline or online. + */ + access_type: string; + /** + * Who is the intended audience for this token. In general the same as + * issued_to. + */ + audience: string; + /** + * The email address of the user. Present only if the email scope is present + * in the request. + */ + email: string; + /** + * The expiry time of the token, as number of seconds left until expiry. + */ + expires_in: number; + /** + * To whom was the token issued to. In general the same as audience. + */ + issued_to: string; + /** + * The space separated list of scopes granted to this token. + */ + scope: string; + /** + * The token handle associated with this token. + */ + token_handle: string; + /** + * The obfuscated user id. + */ + user_id: string; + /** + * Boolean flag which is true if the email address is verified. Present only + * if the email scope is present in the request. + */ + verified_email: boolean; } - - getRoot() { - return this.root; + export interface Schema$Userinfoplus { + /** + * The user's email address. + */ + email: string; + /** + * The user's last name. + */ + family_name: string; + /** + * The user's gender. + */ + gender: string; + /** + * The user's first name. + */ + given_name: string; + /** + * The hosted domain e.g. example.com if the user is Google apps user. + */ + hd: string; + /** + * The obfuscated ID of the user. + */ + id: string; + /** + * URL of the profile page. + */ + link: string; + /** + * The user's preferred locale. + */ + locale: string; + /** + * The user's full name. + */ + name: string; + /** + * URL of the user's picture image. + */ + picture: string; + /** + * Boolean flag which is true if the email address is verified. Always + * verified because we only return the user's primary email address. + */ + verified_email: boolean; } - - /** - * oauth2.userinfo.get - * @alias oauth2.userinfo.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Userinfo { + root: Oauth2; + v2: Resource$Userinfo$V2; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + this.v2 = new Resource$Userinfo$V2(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/oauth2/v2/userinfo').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * oauth2.userinfo.get + * @alias oauth2.userinfo.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/oauth2/v2/userinfo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Userinfo$V2 { - root: Oauth2; - me: Resource$Userinfo$V2$Me; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); - this.me = new Resource$Userinfo$V2$Me(root); - } + export class Resource$Userinfo$V2 { + root: Oauth2; + me: Resource$Userinfo$V2$Me; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + this.me = new Resource$Userinfo$V2$Me(root); + } - getRoot() { - return this.root; - } -} -export class Resource$Userinfo$V2$Me { - root: Oauth2; - constructor(root: Oauth2) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } + export class Resource$Userinfo$V2$Me { + root: Oauth2; + constructor(root: Oauth2) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * oauth2.userinfo.v2.me.get - * @alias oauth2.userinfo.v2.me.get - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/userinfo/v2/me').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * oauth2.userinfo.v2.me.get + * @alias oauth2.userinfo.v2.me.get + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/userinfo/v2/me').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/oslogin/v1.ts b/src/apis/oslogin/v1.ts index 4460c3d53c4..bb36ee58776 100644 --- a/src/apis/oslogin/v1.ts +++ b/src/apis/oslogin/v1.ts @@ -27,499 +27,509 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud OS Login API - * - * Manages OS login configuration for Google account users. - * - * @example - * const google = require('googleapis'); - * const oslogin = google.oslogin('v1'); - * - * @namespace oslogin - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Oslogin - */ -export class Oslogin { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace oslogin_v1 { + /** + * Cloud OS Login API + * + * Manages OS login configuration for Google account users. + * + * @example + * const google = require('googleapis'); + * const oslogin = google.oslogin('v1'); + * + * @namespace oslogin + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Oslogin + */ + export class Oslogin { + _options: GlobalOptions; + google: GoogleApis; + root = this; - users: Resource$Users; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.users = new Resource$Users(this); - } + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A response message for importing an SSH public key. - */ -export interface Schema$ImportSshPublicKeyResponse { - /** - * The login profile information for the user. - */ - loginProfile: Schema$LoginProfile; -} -/** - * The user profile information used for logging in to a virtual machine on - * Google Compute Engine. - */ -export interface Schema$LoginProfile { - /** - * A unique user ID. - */ - name: string; - /** - * The list of POSIX accounts associated with the user. - */ - posixAccounts: Schema$PosixAccount[]; - /** - * A map from SSH public key fingerprint to the associated key object. - */ - sshPublicKeys: any; -} -/** - * The POSIX account information associated with a Google account. - */ -export interface Schema$PosixAccount { - /** - * Output only. A POSIX account identifier. - */ - accountId: string; - /** - * The GECOS (user information) entry for this account. - */ - gecos: string; - /** - * The default group ID. - */ - gid: string; - /** - * The path to the home directory for this account. - */ - homeDirectory: string; - /** - * The operating system type where this account applies. - */ - operatingSystemType: string; - /** - * Only one POSIX account can be marked as primary. - */ - primary: boolean; - /** - * The path to the logic shell for this account. - */ - shell: string; /** - * System identifier for which account the username or uid applies to. By - * default, the empty value is used. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - systemId: string; + export interface Schema$Empty {} /** - * The user ID. + * A response message for importing an SSH public key. */ - uid: string; - /** - * The username of the POSIX account. - */ - username: string; -} -/** - * The SSH public key information associated with a Google account. - */ -export interface Schema$SshPublicKey { + export interface Schema$ImportSshPublicKeyResponse { + /** + * The login profile information for the user. + */ + loginProfile: Schema$LoginProfile; + } /** - * An expiration time in microseconds since epoch. + * The user profile information used for logging in to a virtual machine on + * Google Compute Engine. */ - expirationTimeUsec: string; + export interface Schema$LoginProfile { + /** + * A unique user ID. + */ + name: string; + /** + * The list of POSIX accounts associated with the user. + */ + posixAccounts: Schema$PosixAccount[]; + /** + * A map from SSH public key fingerprint to the associated key object. + */ + sshPublicKeys: any; + } /** - * Output only. The SHA-256 fingerprint of the SSH public key. + * The POSIX account information associated with a Google account. */ - fingerprint: string; + export interface Schema$PosixAccount { + /** + * Output only. A POSIX account identifier. + */ + accountId: string; + /** + * The GECOS (user information) entry for this account. + */ + gecos: string; + /** + * The default group ID. + */ + gid: string; + /** + * The path to the home directory for this account. + */ + homeDirectory: string; + /** + * The operating system type where this account applies. + */ + operatingSystemType: string; + /** + * Only one POSIX account can be marked as primary. + */ + primary: boolean; + /** + * The path to the logic shell for this account. + */ + shell: string; + /** + * System identifier for which account the username or uid applies to. By + * default, the empty value is used. + */ + systemId: string; + /** + * The user ID. + */ + uid: string; + /** + * The username of the POSIX account. + */ + username: string; + } /** - * Public key text in SSH format, defined by <a - * href="https://www.ietf.org/rfc/rfc4253.txt" - * target="_blank">RFC4253</a> section 6.6. + * The SSH public key information associated with a Google account. */ - key: string; -} - -export class Resource$Users { - root: Oslogin; - projects: Resource$Users$Projects; - sshPublicKeys: Resource$Users$Sshpublickeys; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - this.projects = new Resource$Users$Projects(root); - this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); + export interface Schema$SshPublicKey { + /** + * An expiration time in microseconds since epoch. + */ + expirationTimeUsec: string; + /** + * Output only. The SHA-256 fingerprint of the SSH public key. + */ + fingerprint: string; + /** + * Public key text in SSH format, defined by <a + * href="https://www.ietf.org/rfc/rfc4253.txt" + * target="_blank">RFC4253</a> section 6.6. + */ + key: string; } - getRoot() { - return this.root; - } - - - /** - * oslogin.users.getLoginProfile - * @desc Retrieves the profile information used for logging in to a virtual - * machine on Google Compute Engine. - * @alias oslogin.users.getLoginProfile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The unique ID for the user in format `users/{user}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getLoginProfile(params?: any, options?: MethodOptions): - AxiosPromise; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users { + root: Oslogin; + projects: Resource$Users$Projects; + sshPublicKeys: Resource$Users$Sshpublickeys; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); + this.projects = new Resource$Users$Projects(root); + this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/loginProfile') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.importSshPublicKey - * @desc Adds an SSH public key and returns the profile information. Default - * POSIX account information is set when no username and UID exist as part of - * the login profile. - * @alias oslogin.users.importSshPublicKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The unique ID for the user in format `users/{user}`. - * @param {string=} params.projectId The project ID of the Google Cloud Platform project. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importSshPublicKey(params?: any, options?: MethodOptions): - AxiosPromise; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oslogin.users.getLoginProfile + * @desc Retrieves the profile information used for logging in to a virtual + * machine on Google Compute Engine. + * @alias oslogin.users.getLoginProfile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The unique ID for the user in format `users/{user}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getLoginProfile(params?: any, options?: MethodOptions): + AxiosPromise; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/loginProfile') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}:importSshPublicKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Projects { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * oslogin.users.projects.delete - * @desc Deletes a POSIX account. - * @alias oslogin.users.projects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.importSshPublicKey + * @desc Adds an SSH public key and returns the profile information. Default + * POSIX account information is set when no username and UID exist as part + * of the login profile. + * @alias oslogin.users.importSshPublicKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The unique ID for the user in format `users/{user}`. + * @param {string=} params.projectId The project ID of the Google Cloud Platform project. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importSshPublicKey(params?: any, options?: MethodOptions): + AxiosPromise; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}:importSshPublicKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Projects { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Users$Sshpublickeys { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * oslogin.users.projects.delete + * @desc Deletes a POSIX account. + * @alias oslogin.users.projects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * oslogin.users.sshPublicKeys.delete - * @desc Deletes an SSH public key. - * @alias oslogin.users.sshPublicKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Sshpublickeys { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.sshPublicKeys.get - * @desc Retrieves an SSH public key. - * @alias oslogin.users.sshPublicKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.delete + * @desc Deletes an SSH public key. + * @alias oslogin.users.sshPublicKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oslogin.users.sshPublicKeys.patch - * @desc Updates an SSH public key and returns the profile information. This - * method supports patch semantics. - * @alias oslogin.users.sshPublicKeys.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.get + * @desc Retrieves an SSH public key. + * @alias oslogin.users.sshPublicKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * oslogin.users.sshPublicKeys.patch + * @desc Updates an SSH public key and returns the profile information. This + * method supports patch semantics. + * @alias oslogin.users.sshPublicKeys.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/oslogin/v1alpha.ts b/src/apis/oslogin/v1alpha.ts index 8af26b1a33b..d4e12248f7f 100644 --- a/src/apis/oslogin/v1alpha.ts +++ b/src/apis/oslogin/v1alpha.ts @@ -27,499 +27,509 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud OS Login API - * - * Manages OS login configuration for Google account users. - * - * @example - * const google = require('googleapis'); - * const oslogin = google.oslogin('v1alpha'); - * - * @namespace oslogin - * @type {Function} - * @version v1alpha - * @variation v1alpha - * @param {object=} options Options for Oslogin - */ -export class Oslogin { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace oslogin_v1alpha { + /** + * Cloud OS Login API + * + * Manages OS login configuration for Google account users. + * + * @example + * const google = require('googleapis'); + * const oslogin = google.oslogin('v1alpha'); + * + * @namespace oslogin + * @type {Function} + * @version v1alpha + * @variation v1alpha + * @param {object=} options Options for Oslogin + */ + export class Oslogin { + _options: GlobalOptions; + google: GoogleApis; + root = this; - users: Resource$Users; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.users = new Resource$Users(this); - } + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A response message from importing an SSH public key. - */ -export interface Schema$ImportSshPublicKeyResponse { - /** - * The login profile information for the user. - */ - loginProfile: Schema$LoginProfile; -} -/** - * The user profile information used for logging in to a virtual machine on - * Google Compute Engine. - */ -export interface Schema$LoginProfile { - /** - * A unique user ID. - */ - name: string; - /** - * The list of POSIX accounts associated with the user. - */ - posixAccounts: Schema$PosixAccount[]; - /** - * A map from SSH public key fingerprint to the associated key object. - */ - sshPublicKeys: any; -} -/** - * The POSIX account information associated with a Google account. - */ -export interface Schema$PosixAccount { - /** - * Output only. A POSIX account identifier. - */ - accountId: string; - /** - * The GECOS (user information) entry for this account. - */ - gecos: string; - /** - * The default group ID. - */ - gid: string; - /** - * The path to the home directory for this account. - */ - homeDirectory: string; - /** - * The operating system type where this account applies. - */ - operatingSystemType: string; - /** - * Only one POSIX account can be marked as primary. - */ - primary: boolean; - /** - * The path to the logic shell for this account. - */ - shell: string; /** - * System identifier for which account the username or uid applies to. By - * default, the empty value is used. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - systemId: string; + export interface Schema$Empty {} /** - * The user ID. + * A response message from importing an SSH public key. */ - uid: string; - /** - * The username of the POSIX account. - */ - username: string; -} -/** - * The SSH public key information associated with a Google account. - */ -export interface Schema$SshPublicKey { + export interface Schema$ImportSshPublicKeyResponse { + /** + * The login profile information for the user. + */ + loginProfile: Schema$LoginProfile; + } /** - * An expiration time in microseconds since epoch. + * The user profile information used for logging in to a virtual machine on + * Google Compute Engine. */ - expirationTimeUsec: string; + export interface Schema$LoginProfile { + /** + * A unique user ID. + */ + name: string; + /** + * The list of POSIX accounts associated with the user. + */ + posixAccounts: Schema$PosixAccount[]; + /** + * A map from SSH public key fingerprint to the associated key object. + */ + sshPublicKeys: any; + } /** - * Output only. The SHA-256 fingerprint of the SSH public key. + * The POSIX account information associated with a Google account. */ - fingerprint: string; + export interface Schema$PosixAccount { + /** + * Output only. A POSIX account identifier. + */ + accountId: string; + /** + * The GECOS (user information) entry for this account. + */ + gecos: string; + /** + * The default group ID. + */ + gid: string; + /** + * The path to the home directory for this account. + */ + homeDirectory: string; + /** + * The operating system type where this account applies. + */ + operatingSystemType: string; + /** + * Only one POSIX account can be marked as primary. + */ + primary: boolean; + /** + * The path to the logic shell for this account. + */ + shell: string; + /** + * System identifier for which account the username or uid applies to. By + * default, the empty value is used. + */ + systemId: string; + /** + * The user ID. + */ + uid: string; + /** + * The username of the POSIX account. + */ + username: string; + } /** - * Public key text in SSH format, defined by <a - * href="https://www.ietf.org/rfc/rfc4253.txt" - * target="_blank">RFC4253</a> section 6.6. + * The SSH public key information associated with a Google account. */ - key: string; -} - -export class Resource$Users { - root: Oslogin; - projects: Resource$Users$Projects; - sshPublicKeys: Resource$Users$Sshpublickeys; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - this.projects = new Resource$Users$Projects(root); - this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); + export interface Schema$SshPublicKey { + /** + * An expiration time in microseconds since epoch. + */ + expirationTimeUsec: string; + /** + * Output only. The SHA-256 fingerprint of the SSH public key. + */ + fingerprint: string; + /** + * Public key text in SSH format, defined by <a + * href="https://www.ietf.org/rfc/rfc4253.txt" + * target="_blank">RFC4253</a> section 6.6. + */ + key: string; } - getRoot() { - return this.root; - } - - - /** - * oslogin.users.getLoginProfile - * @desc Retrieves the profile information used for logging in to a virtual - * machine on Google Compute Engine. - * @alias oslogin.users.getLoginProfile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The unique ID for the user in format `users/{user}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getLoginProfile(params?: any, options?: MethodOptions): - AxiosPromise; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users { + root: Oslogin; + projects: Resource$Users$Projects; + sshPublicKeys: Resource$Users$Sshpublickeys; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); + this.projects = new Resource$Users$Projects(root); + this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+name}/loginProfile') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.importSshPublicKey - * @desc Adds an SSH public key and returns the profile information. Default - * POSIX account information is set when no username and UID exist as part of - * the login profile. - * @alias oslogin.users.importSshPublicKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The unique ID for the user in format `users/{user}`. - * @param {string=} params.projectId The project ID of the Google Cloud Platform project. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importSshPublicKey(params?: any, options?: MethodOptions): - AxiosPromise; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oslogin.users.getLoginProfile + * @desc Retrieves the profile information used for logging in to a virtual + * machine on Google Compute Engine. + * @alias oslogin.users.getLoginProfile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The unique ID for the user in format `users/{user}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getLoginProfile(params?: any, options?: MethodOptions): + AxiosPromise; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}/loginProfile') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+parent}:importSshPublicKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Projects { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * oslogin.users.projects.delete - * @desc Deletes a POSIX account. - * @alias oslogin.users.projects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.importSshPublicKey + * @desc Adds an SSH public key and returns the profile information. Default + * POSIX account information is set when no username and UID exist as part + * of the login profile. + * @alias oslogin.users.importSshPublicKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The unique ID for the user in format `users/{user}`. + * @param {string=} params.projectId The project ID of the Google Cloud Platform project. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importSshPublicKey(params?: any, options?: MethodOptions): + AxiosPromise; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}:importSshPublicKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Projects { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Users$Sshpublickeys { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * oslogin.users.projects.delete + * @desc Deletes a POSIX account. + * @alias oslogin.users.projects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * oslogin.users.sshPublicKeys.delete - * @desc Deletes an SSH public key. - * @alias oslogin.users.sshPublicKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Sshpublickeys { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.sshPublicKeys.get - * @desc Retrieves an SSH public key. - * @alias oslogin.users.sshPublicKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.delete + * @desc Deletes an SSH public key. + * @alias oslogin.users.sshPublicKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oslogin.users.sshPublicKeys.patch - * @desc Updates an SSH public key and returns the profile information. This - * method supports patch semantics. - * @alias oslogin.users.sshPublicKeys.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.get + * @desc Retrieves an SSH public key. + * @alias oslogin.users.sshPublicKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * oslogin.users.sshPublicKeys.patch + * @desc Updates an SSH public key and returns the profile information. This + * method supports patch semantics. + * @alias oslogin.users.sshPublicKeys.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/oslogin/v1beta.ts b/src/apis/oslogin/v1beta.ts index b4b6d5b4e71..9c3c831c9a6 100644 --- a/src/apis/oslogin/v1beta.ts +++ b/src/apis/oslogin/v1beta.ts @@ -27,499 +27,509 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud OS Login API - * - * Manages OS login configuration for Google account users. - * - * @example - * const google = require('googleapis'); - * const oslogin = google.oslogin('v1beta'); - * - * @namespace oslogin - * @type {Function} - * @version v1beta - * @variation v1beta - * @param {object=} options Options for Oslogin - */ -export class Oslogin { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace oslogin_v1beta { + /** + * Cloud OS Login API + * + * Manages OS login configuration for Google account users. + * + * @example + * const google = require('googleapis'); + * const oslogin = google.oslogin('v1beta'); + * + * @namespace oslogin + * @type {Function} + * @version v1beta + * @variation v1beta + * @param {object=} options Options for Oslogin + */ + export class Oslogin { + _options: GlobalOptions; + google: GoogleApis; + root = this; - users: Resource$Users; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.users = new Resource$Users(this); - } + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A response message for importing an SSH public key. - */ -export interface Schema$ImportSshPublicKeyResponse { - /** - * The login profile information for the user. - */ - loginProfile: Schema$LoginProfile; -} -/** - * The user profile information used for logging in to a virtual machine on - * Google Compute Engine. - */ -export interface Schema$LoginProfile { - /** - * A unique user ID. - */ - name: string; - /** - * The list of POSIX accounts associated with the user. - */ - posixAccounts: Schema$PosixAccount[]; - /** - * A map from SSH public key fingerprint to the associated key object. - */ - sshPublicKeys: any; -} -/** - * The POSIX account information associated with a Google account. - */ -export interface Schema$PosixAccount { - /** - * Output only. A POSIX account identifier. - */ - accountId: string; - /** - * The GECOS (user information) entry for this account. - */ - gecos: string; - /** - * The default group ID. - */ - gid: string; - /** - * The path to the home directory for this account. - */ - homeDirectory: string; - /** - * The operating system type where this account applies. - */ - operatingSystemType: string; - /** - * Only one POSIX account can be marked as primary. - */ - primary: boolean; - /** - * The path to the logic shell for this account. - */ - shell: string; /** - * System identifier for which account the username or uid applies to. By - * default, the empty value is used. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - systemId: string; + export interface Schema$Empty {} /** - * The user ID. + * A response message for importing an SSH public key. */ - uid: string; - /** - * The username of the POSIX account. - */ - username: string; -} -/** - * The SSH public key information associated with a Google account. - */ -export interface Schema$SshPublicKey { + export interface Schema$ImportSshPublicKeyResponse { + /** + * The login profile information for the user. + */ + loginProfile: Schema$LoginProfile; + } /** - * An expiration time in microseconds since epoch. + * The user profile information used for logging in to a virtual machine on + * Google Compute Engine. */ - expirationTimeUsec: string; + export interface Schema$LoginProfile { + /** + * A unique user ID. + */ + name: string; + /** + * The list of POSIX accounts associated with the user. + */ + posixAccounts: Schema$PosixAccount[]; + /** + * A map from SSH public key fingerprint to the associated key object. + */ + sshPublicKeys: any; + } /** - * Output only. The SHA-256 fingerprint of the SSH public key. + * The POSIX account information associated with a Google account. */ - fingerprint: string; + export interface Schema$PosixAccount { + /** + * Output only. A POSIX account identifier. + */ + accountId: string; + /** + * The GECOS (user information) entry for this account. + */ + gecos: string; + /** + * The default group ID. + */ + gid: string; + /** + * The path to the home directory for this account. + */ + homeDirectory: string; + /** + * The operating system type where this account applies. + */ + operatingSystemType: string; + /** + * Only one POSIX account can be marked as primary. + */ + primary: boolean; + /** + * The path to the logic shell for this account. + */ + shell: string; + /** + * System identifier for which account the username or uid applies to. By + * default, the empty value is used. + */ + systemId: string; + /** + * The user ID. + */ + uid: string; + /** + * The username of the POSIX account. + */ + username: string; + } /** - * Public key text in SSH format, defined by <a - * href="https://www.ietf.org/rfc/rfc4253.txt" - * target="_blank">RFC4253</a> section 6.6. + * The SSH public key information associated with a Google account. */ - key: string; -} - -export class Resource$Users { - root: Oslogin; - projects: Resource$Users$Projects; - sshPublicKeys: Resource$Users$Sshpublickeys; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - this.projects = new Resource$Users$Projects(root); - this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); + export interface Schema$SshPublicKey { + /** + * An expiration time in microseconds since epoch. + */ + expirationTimeUsec: string; + /** + * Output only. The SHA-256 fingerprint of the SSH public key. + */ + fingerprint: string; + /** + * Public key text in SSH format, defined by <a + * href="https://www.ietf.org/rfc/rfc4253.txt" + * target="_blank">RFC4253</a> section 6.6. + */ + key: string; } - getRoot() { - return this.root; - } - - - /** - * oslogin.users.getLoginProfile - * @desc Retrieves the profile information used for logging in to a virtual - * machine on Google Compute Engine. - * @alias oslogin.users.getLoginProfile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The unique ID for the user in format `users/{user}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getLoginProfile(params?: any, options?: MethodOptions): - AxiosPromise; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getLoginProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users { + root: Oslogin; + projects: Resource$Users$Projects; + sshPublicKeys: Resource$Users$Sshpublickeys; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); + this.projects = new Resource$Users$Projects(root); + this.sshPublicKeys = new Resource$Users$Sshpublickeys(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+name}/loginProfile') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.importSshPublicKey - * @desc Adds an SSH public key and returns the profile information. Default - * POSIX account information is set when no username and UID exist as part of - * the login profile. - * @alias oslogin.users.importSshPublicKey - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The unique ID for the user in format `users/{user}`. - * @param {string=} params.projectId The project ID of the Google Cloud Platform project. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - importSshPublicKey(params?: any, options?: MethodOptions): - AxiosPromise; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - importSshPublicKey( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * oslogin.users.getLoginProfile + * @desc Retrieves the profile information used for logging in to a virtual + * machine on Google Compute Engine. + * @alias oslogin.users.getLoginProfile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The unique ID for the user in format `users/{user}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getLoginProfile(params?: any, options?: MethodOptions): + AxiosPromise; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getLoginProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}/loginProfile') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+parent}:importSshPublicKey') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Users$Projects { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * oslogin.users.projects.delete - * @desc Deletes a POSIX account. - * @alias oslogin.users.projects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.importSshPublicKey + * @desc Adds an SSH public key and returns the profile information. Default + * POSIX account information is set when no username and UID exist as part + * of the login profile. + * @alias oslogin.users.importSshPublicKey + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The unique ID for the user in format `users/{user}`. + * @param {string=} params.projectId The project ID of the Google Cloud Platform project. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + importSshPublicKey(params?: any, options?: MethodOptions): + AxiosPromise; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + importSshPublicKey( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+parent}:importSshPublicKey') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Projects { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Users$Sshpublickeys { - root: Oslogin; - constructor(root: Oslogin) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * oslogin.users.projects.delete + * @desc Deletes a POSIX account. + * @alias oslogin.users.projects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name A reference to the POSIX account to update. POSIX accounts are identified by the project ID they are associated with. A reference to the POSIX account is in format `users/{user}/projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * oslogin.users.sshPublicKeys.delete - * @desc Deletes an SSH public key. - * @alias oslogin.users.sshPublicKeys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Sshpublickeys { + root: Oslogin; + constructor(root: Oslogin) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * oslogin.users.sshPublicKeys.get - * @desc Retrieves an SSH public key. - * @alias oslogin.users.sshPublicKeys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.delete + * @desc Deletes an SSH public key. + * @alias oslogin.users.sshPublicKeys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * oslogin.users.sshPublicKeys.patch - * @desc Updates an SSH public key and returns the profile information. This - * method supports patch semantics. - * @alias oslogin.users.sshPublicKeys.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. - * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. - * @param {().SshPublicKey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * oslogin.users.sshPublicKeys.get + * @desc Retrieves an SSH public key. + * @alias oslogin.users.sshPublicKeys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to retrieve. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * oslogin.users.sshPublicKeys.patch + * @desc Updates an SSH public key and returns the profile information. This + * method supports patch semantics. + * @alias oslogin.users.sshPublicKeys.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fingerprint of the public key to update. Public keys are identified by their SHA-256 fingerprint. The fingerprint of the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`. + * @param {string=} params.updateMask Mask to control which fields get updated. Updates all if not present. + * @param {().SshPublicKey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://oslogin.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/pagespeedonline/v1.ts b/src/apis/pagespeedonline/v1.ts index 446f0169260..ab031956901 100644 --- a/src/apis/pagespeedonline/v1.ts +++ b/src/apis/pagespeedonline/v1.ts @@ -27,164 +27,169 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * PageSpeed Insights API - * - * Analyzes the performance of a web page and provides tailored suggestions to - * make that page faster. - * - * @example - * const google = require('googleapis'); - * const pagespeedonline = google.pagespeedonline('v1'); - * - * @namespace pagespeedonline - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Pagespeedonline - */ -export class Pagespeedonline { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - pagespeedapi: Resource$Pagespeedapi; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); +export namespace pagespeedonline_v1 { + /** + * PageSpeed Insights API + * + * Analyzes the performance of a web page and provides tailored suggestions to + * make that page faster. + * + * @example + * const google = require('googleapis'); + * const pagespeedonline = google.pagespeedonline('v1'); + * + * @namespace pagespeedonline + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Pagespeedonline + */ + export class Pagespeedonline { + _options: GlobalOptions; + google: GoogleApis; + root = this; - this.pagespeedapi = new Resource$Pagespeedapi(this); - } + pagespeedapi: Resource$Pagespeedapi; - getRoot() { - return this.root; - } -} + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); -export interface Schema$Result { - /** - * The captcha verify result - */ - captchaResult: string; - /** - * Localized PageSpeed results. Contains a ruleResults entry for each - * PageSpeed rule instantiated and run by the server. - */ - formattedResults: any; - /** - * Canonicalized and final URL for the document, after following page - * redirects (if any). - */ - id: string; - /** - * List of rules that were specified in the request, but which the server did - * not know how to instantiate. - */ - invalidRules: string[]; - /** - * Kind of result. - */ - kind: string; - /** - * Summary statistics for the page, such as number of JavaScript bytes, number - * of HTML bytes, etc. - */ - pageStats: any; - /** - * Response code for the document. 200 indicates a normal page load. 4xx/5xx - * indicates an error. - */ - responseCode: number; - /** - * The PageSpeed Score (0-100), which indicates how much faster a page could - * be. A high score indicates little room for improvement, while a lower score - * indicates more room for improvement. - */ - score: number; - /** - * Base64-encoded screenshot of the page that was analyzed. - */ - screenshot: any; - /** - * Title of the page, as displayed in the browser's title bar. - */ - title: string; - /** - * The version of PageSpeed used to generate these results. - */ - version: any; -} + this.pagespeedapi = new Resource$Pagespeedapi(this); + } -export class Resource$Pagespeedapi { - root: Pagespeedonline; - constructor(root: Pagespeedonline) { - this.root = root; - this.getRoot.bind(this); + getRoot() { + return this.root; + } } - getRoot() { - return this.root; + export interface Schema$Result { + /** + * The captcha verify result + */ + captchaResult: string; + /** + * Localized PageSpeed results. Contains a ruleResults entry for each + * PageSpeed rule instantiated and run by the server. + */ + formattedResults: any; + /** + * Canonicalized and final URL for the document, after following page + * redirects (if any). + */ + id: string; + /** + * List of rules that were specified in the request, but which the server + * did not know how to instantiate. + */ + invalidRules: string[]; + /** + * Kind of result. + */ + kind: string; + /** + * Summary statistics for the page, such as number of JavaScript bytes, + * number of HTML bytes, etc. + */ + pageStats: any; + /** + * Response code for the document. 200 indicates a normal page load. 4xx/5xx + * indicates an error. + */ + responseCode: number; + /** + * The PageSpeed Score (0-100), which indicates how much faster a page could + * be. A high score indicates little room for improvement, while a lower + * score indicates more room for improvement. + */ + score: number; + /** + * Base64-encoded screenshot of the page that was analyzed. + */ + screenshot: any; + /** + * Title of the page, as displayed in the browser's title bar. + */ + title: string; + /** + * The version of PageSpeed used to generate these results. + */ + version: any; } - - /** - * pagespeedonline.pagespeedapi.runpagespeed - * @desc Runs PageSpeed analysis on the page at the specified URL, and returns - * a PageSpeed score, a list of suggestions to make that page faster, and - * other information. - * @alias pagespeedonline.pagespeedapi.runpagespeed - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. - * @param {string=} params.locale The locale used to localize formatted results - * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run - * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included - * @param {string=} params.strategy The analysis strategy to use - * @param {string} params.url The URL to fetch and analyze - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runpagespeed(params?: any, options?: MethodOptions): - AxiosPromise; - runpagespeed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runpagespeed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Pagespeedapi { + root: Pagespeedonline; + constructor(root: Pagespeedonline) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/pagespeedonline/v1/runPagespeed') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['url'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * pagespeedonline.pagespeedapi.runpagespeed + * @desc Runs PageSpeed analysis on the page at the specified URL, and + * returns a PageSpeed score, a list of suggestions to make that page + * faster, and other information. + * @alias pagespeedonline.pagespeedapi.runpagespeed + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. + * @param {string=} params.locale The locale used to localize formatted results + * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run + * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included + * @param {string=} params.strategy The analysis strategy to use + * @param {string} params.url The URL to fetch and analyze + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runpagespeed(params?: any, options?: MethodOptions): + AxiosPromise; + runpagespeed( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runpagespeed( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/pagespeedonline/v1/runPagespeed') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['url'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/pagespeedonline/v2.ts b/src/apis/pagespeedonline/v2.ts index 298876d4817..2ff3da0bec5 100644 --- a/src/apis/pagespeedonline/v2.ts +++ b/src/apis/pagespeedonline/v2.ts @@ -27,202 +27,207 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * PageSpeed Insights API - * - * Analyzes the performance of a web page and provides tailored suggestions to - * make that page faster. - * - * @example - * const google = require('googleapis'); - * const pagespeedonline = google.pagespeedonline('v2'); - * - * @namespace pagespeedonline - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Pagespeedonline - */ -export class Pagespeedonline { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace pagespeedonline_v2 { + /** + * PageSpeed Insights API + * + * Analyzes the performance of a web page and provides tailored suggestions to + * make that page faster. + * + * @example + * const google = require('googleapis'); + * const pagespeedonline = google.pagespeedonline('v2'); + * + * @namespace pagespeedonline + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Pagespeedonline + */ + export class Pagespeedonline { + _options: GlobalOptions; + google: GoogleApis; + root = this; - pagespeedapi: Resource$Pagespeedapi; + pagespeedapi: Resource$Pagespeedapi; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.pagespeedapi = new Resource$Pagespeedapi(this); - } + this.pagespeedapi = new Resource$Pagespeedapi(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$PagespeedApiFormatStringV2 { - /** - * List of arguments for the format string. - */ - args: any[]; - /** - * A localized format string with {{FOO}} placeholders, where 'FOO' is - * the key of the argument whose value should be substituted. For HYPERLINK - * arguments, the format string will instead contain {{BEGIN_FOO}} and - * {{END_FOO}} for the argument with key 'FOO'. - */ - format: string; -} -export interface Schema$PagespeedApiImageV2 { - /** - * Image data base64 encoded. - */ - data: string; - /** - * Height of screenshot in pixels. - */ - height: number; - /** - * Unique string key, if any, identifying this image. - */ - key: string; - /** - * Mime type of image data (e.g. "image/jpeg"). - */ - mime_type: string; - /** - * The region of the page that is captured by this image, with dimensions - * measured in CSS pixels. - */ - page_rect: any; - /** - * Width of screenshot in pixels. - */ - width: number; -} -export interface Schema$Result { - /** - * The captcha verify result - */ - captchaResult: string; - /** - * Localized PageSpeed results. Contains a ruleResults entry for each - * PageSpeed rule instantiated and run by the server. - */ - formattedResults: any; - /** - * Canonicalized and final URL for the document, after following page - * redirects (if any). - */ - id: string; - /** - * List of rules that were specified in the request, but which the server did - * not know how to instantiate. - */ - invalidRules: string[]; - /** - * Kind of result. - */ - kind: string; - /** - * Summary statistics for the page, such as number of JavaScript bytes, number - * of HTML bytes, etc. - */ - pageStats: any; - /** - * Response code for the document. 200 indicates a normal page load. 4xx/5xx - * indicates an error. - */ - responseCode: number; - /** - * A map with one entry for each rule group in these results. - */ - ruleGroups: any; - /** - * Base64-encoded screenshot of the page that was analyzed. - */ - screenshot: Schema$PagespeedApiImageV2; - /** - * Title of the page, as displayed in the browser's title bar. - */ - title: string; - /** - * The version of PageSpeed used to generate these results. - */ - version: any; -} -export class Resource$Pagespeedapi { - root: Pagespeedonline; - constructor(root: Pagespeedonline) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$PagespeedApiFormatStringV2 { + /** + * List of arguments for the format string. + */ + args: any[]; + /** + * A localized format string with {{FOO}} placeholders, where 'FOO' + * is the key of the argument whose value should be substituted. For + * HYPERLINK arguments, the format string will instead contain {{BEGIN_FOO}} + * and {{END_FOO}} for the argument with key 'FOO'. + */ + format: string; } - - getRoot() { - return this.root; + export interface Schema$PagespeedApiImageV2 { + /** + * Image data base64 encoded. + */ + data: string; + /** + * Height of screenshot in pixels. + */ + height: number; + /** + * Unique string key, if any, identifying this image. + */ + key: string; + /** + * Mime type of image data (e.g. "image/jpeg"). + */ + mime_type: string; + /** + * The region of the page that is captured by this image, with dimensions + * measured in CSS pixels. + */ + page_rect: any; + /** + * Width of screenshot in pixels. + */ + width: number; + } + export interface Schema$Result { + /** + * The captcha verify result + */ + captchaResult: string; + /** + * Localized PageSpeed results. Contains a ruleResults entry for each + * PageSpeed rule instantiated and run by the server. + */ + formattedResults: any; + /** + * Canonicalized and final URL for the document, after following page + * redirects (if any). + */ + id: string; + /** + * List of rules that were specified in the request, but which the server + * did not know how to instantiate. + */ + invalidRules: string[]; + /** + * Kind of result. + */ + kind: string; + /** + * Summary statistics for the page, such as number of JavaScript bytes, + * number of HTML bytes, etc. + */ + pageStats: any; + /** + * Response code for the document. 200 indicates a normal page load. 4xx/5xx + * indicates an error. + */ + responseCode: number; + /** + * A map with one entry for each rule group in these results. + */ + ruleGroups: any; + /** + * Base64-encoded screenshot of the page that was analyzed. + */ + screenshot: Schema$PagespeedApiImageV2; + /** + * Title of the page, as displayed in the browser's title bar. + */ + title: string; + /** + * The version of PageSpeed used to generate these results. + */ + version: any; } - - /** - * pagespeedonline.pagespeedapi.runpagespeed - * @desc Runs PageSpeed analysis on the page at the specified URL, and returns - * PageSpeed scores, a list of suggestions to make that page faster, and other - * information. - * @alias pagespeedonline.pagespeedapi.runpagespeed - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. - * @param {string=} params.locale The locale used to localize formatted results - * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run - * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included - * @param {string=} params.strategy The analysis strategy to use - * @param {string} params.url The URL to fetch and analyze - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runpagespeed(params?: any, options?: MethodOptions): - AxiosPromise; - runpagespeed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - runpagespeed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Pagespeedapi { + root: Pagespeedonline; + constructor(root: Pagespeedonline) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/pagespeedonline/v2/runPagespeed') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['url'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * pagespeedonline.pagespeedapi.runpagespeed + * @desc Runs PageSpeed analysis on the page at the specified URL, and + * returns PageSpeed scores, a list of suggestions to make that page faster, + * and other information. + * @alias pagespeedonline.pagespeedapi.runpagespeed + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. + * @param {string=} params.locale The locale used to localize formatted results + * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run + * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included + * @param {string=} params.strategy The analysis strategy to use + * @param {string} params.url The URL to fetch and analyze + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runpagespeed(params?: any, options?: MethodOptions): + AxiosPromise; + runpagespeed( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + runpagespeed( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/pagespeedonline/v2/runPagespeed') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['url'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/pagespeedonline/v4.ts b/src/apis/pagespeedonline/v4.ts index 073f9e265ff..85968726545 100644 --- a/src/apis/pagespeedonline/v4.ts +++ b/src/apis/pagespeedonline/v4.ts @@ -27,217 +27,221 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * PageSpeed Insights API - * - * Analyzes the performance of a web page and provides tailored suggestions to - * make that page faster. - * - * @example - * const google = require('googleapis'); - * const pagespeedonline = google.pagespeedonline('v4'); - * - * @namespace pagespeedonline - * @type {Function} - * @version v4 - * @variation v4 - * @param {object=} options Options for Pagespeedonline - */ -export class Pagespeedonline { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace pagespeedonline_v4 { + /** + * PageSpeed Insights API + * + * Analyzes the performance of a web page and provides tailored suggestions to + * make that page faster. + * + * @example + * const google = require('googleapis'); + * const pagespeedonline = google.pagespeedonline('v4'); + * + * @namespace pagespeedonline + * @type {Function} + * @version v4 + * @variation v4 + * @param {object=} options Options for Pagespeedonline + */ + export class Pagespeedonline { + _options: GlobalOptions; + google: GoogleApis; + root = this; - pagespeedapi: Resource$Pagespeedapi; + pagespeedapi: Resource$Pagespeedapi; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.pagespeedapi = new Resource$Pagespeedapi(this); - } + this.pagespeedapi = new Resource$Pagespeedapi(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$PagespeedApiFormatStringV4 { - /** - * List of arguments for the format string. - */ - args: any[]; - /** - * A localized format string with {{FOO}} placeholders, where 'FOO' is - * the key of the argument whose value should be substituted. For HYPERLINK - * arguments, the format string will instead contain {{BEGIN_FOO}} and - * {{END_FOO}} for the argument with key 'FOO'. - */ - format: string; -} -export interface Schema$PagespeedApiImageV4 { - /** - * Image data base64 encoded. - */ - data: string; - /** - * Height of screenshot in pixels. - */ - height: number; - /** - * Unique string key, if any, identifying this image. - */ - key: string; - /** - * Mime type of image data (e.g. "image/jpeg"). - */ - mime_type: string; - page_rect: any; - /** - * Width of screenshot in pixels. - */ - width: number; -} -export interface Schema$PagespeedApiPagespeedResponseV4 { - /** - * The captcha verify result - */ - captchaResult: string; - /** - * Localized PageSpeed results. Contains a ruleResults entry for each - * PageSpeed rule instantiated and run by the server. - */ - formattedResults: any; - /** - * Canonicalized and final URL for the document, after following page - * redirects (if any). - */ - id: string; - /** - * List of rules that were specified in the request, but which the server did - * not know how to instantiate. - */ - invalidRules: string[]; - /** - * Kind of result. - */ - kind: string; - /** - * Metrics of end users' page loading experience. - */ - loadingExperience: any; - /** - * Summary statistics for the page, such as number of JavaScript bytes, number - * of HTML bytes, etc. - */ - pageStats: any; - /** - * Response code for the document. 200 indicates a normal page load. 4xx/5xx - * indicates an error. - */ - responseCode: number; - /** - * A map with one entry for each rule group in these results. - */ - ruleGroups: any; - /** - * Base64-encoded screenshot of the page that was analyzed. - */ - screenshot: Schema$PagespeedApiImageV4; - /** - * Additional base64-encoded screenshots of the page, in various partial - * render states. - */ - snapshots: Schema$PagespeedApiImageV4[]; - /** - * Title of the page, as displayed in the browser's title bar. - */ - title: string; - /** - * The version of PageSpeed used to generate these results. - */ - version: any; -} -export class Resource$Pagespeedapi { - root: Pagespeedonline; - constructor(root: Pagespeedonline) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$PagespeedApiFormatStringV4 { + /** + * List of arguments for the format string. + */ + args: any[]; + /** + * A localized format string with {{FOO}} placeholders, where 'FOO' + * is the key of the argument whose value should be substituted. For + * HYPERLINK arguments, the format string will instead contain {{BEGIN_FOO}} + * and {{END_FOO}} for the argument with key 'FOO'. + */ + format: string; } - - getRoot() { - return this.root; + export interface Schema$PagespeedApiImageV4 { + /** + * Image data base64 encoded. + */ + data: string; + /** + * Height of screenshot in pixels. + */ + height: number; + /** + * Unique string key, if any, identifying this image. + */ + key: string; + /** + * Mime type of image data (e.g. "image/jpeg"). + */ + mime_type: string; + page_rect: any; + /** + * Width of screenshot in pixels. + */ + width: number; + } + export interface Schema$PagespeedApiPagespeedResponseV4 { + /** + * The captcha verify result + */ + captchaResult: string; + /** + * Localized PageSpeed results. Contains a ruleResults entry for each + * PageSpeed rule instantiated and run by the server. + */ + formattedResults: any; + /** + * Canonicalized and final URL for the document, after following page + * redirects (if any). + */ + id: string; + /** + * List of rules that were specified in the request, but which the server + * did not know how to instantiate. + */ + invalidRules: string[]; + /** + * Kind of result. + */ + kind: string; + /** + * Metrics of end users' page loading experience. + */ + loadingExperience: any; + /** + * Summary statistics for the page, such as number of JavaScript bytes, + * number of HTML bytes, etc. + */ + pageStats: any; + /** + * Response code for the document. 200 indicates a normal page load. 4xx/5xx + * indicates an error. + */ + responseCode: number; + /** + * A map with one entry for each rule group in these results. + */ + ruleGroups: any; + /** + * Base64-encoded screenshot of the page that was analyzed. + */ + screenshot: Schema$PagespeedApiImageV4; + /** + * Additional base64-encoded screenshots of the page, in various partial + * render states. + */ + snapshots: Schema$PagespeedApiImageV4[]; + /** + * Title of the page, as displayed in the browser's title bar. + */ + title: string; + /** + * The version of PageSpeed used to generate these results. + */ + version: any; } - - /** - * pagespeedonline.pagespeedapi.runpagespeed - * @desc Runs PageSpeed analysis on the page at the specified URL, and returns - * PageSpeed scores, a list of suggestions to make that page faster, and other - * information. - * @alias pagespeedonline.pagespeedapi.runpagespeed - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. - * @param {string=} params.locale The locale used to localize formatted results - * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run - * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included - * @param {boolean=} params.snapshots Indicates if binary data containing snapshot images should be included - * @param {string=} params.strategy The analysis strategy (desktop or mobile) to use, and desktop is the default - * @param {string} params.url The URL to fetch and analyze - * @param {string=} params.utm_campaign Campaign name for analytics. - * @param {string=} params.utm_source Campaign source for analytics. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - runpagespeed(params?: any, options?: MethodOptions): - AxiosPromise; - runpagespeed( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - runpagespeed( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Pagespeedapi { + root: Pagespeedonline; + constructor(root: Pagespeedonline) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/pagespeedonline/v4/runPagespeed') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['url'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * pagespeedonline.pagespeedapi.runpagespeed + * @desc Runs PageSpeed analysis on the page at the specified URL, and + * returns PageSpeed scores, a list of suggestions to make that page faster, + * and other information. + * @alias pagespeedonline.pagespeedapi.runpagespeed + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.filter_third_party_resources Indicates if third party resources should be filtered out before PageSpeed analysis. + * @param {string=} params.locale The locale used to localize formatted results + * @param {string=} params.rule A PageSpeed rule to run; if none are given, all rules are run + * @param {boolean=} params.screenshot Indicates if binary data containing a screenshot should be included + * @param {boolean=} params.snapshots Indicates if binary data containing snapshot images should be included + * @param {string=} params.strategy The analysis strategy (desktop or mobile) to use, and desktop is the default + * @param {string} params.url The URL to fetch and analyze + * @param {string=} params.utm_campaign Campaign name for analytics. + * @param {string=} params.utm_source Campaign source for analytics. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + runpagespeed(params?: any, options?: MethodOptions): + AxiosPromise; + runpagespeed( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + runpagespeed( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/pagespeedonline/v4/runPagespeed') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['url'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/partners/v2.ts b/src/apis/partners/v2.ts index 073fb009d6f..894be82ca81 100644 --- a/src/apis/partners/v2.ts +++ b/src/apis/partners/v2.ts @@ -27,2529 +27,2555 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Partners API - * - * Searches certified companies and creates contact leads with them, and also - * audits the usage of clients. - * - * @example - * const google = require('googleapis'); - * const partners = google.partners('v2'); - * - * @namespace partners - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Partners - */ -export class Partners { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - analytics: Resource$Analytics; - clientMessages: Resource$Clientmessages; - companies: Resource$Companies; - leads: Resource$Leads; - offers: Resource$Offers; - userEvents: Resource$Userevents; - users: Resource$Users; - userStates: Resource$Userstates; - v2: Resource$V2; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.analytics = new Resource$Analytics(this); - this.clientMessages = new Resource$Clientmessages(this); - this.companies = new Resource$Companies(this); - this.leads = new Resource$Leads(this); - this.offers = new Resource$Offers(this); - this.userEvents = new Resource$Userevents(this); - this.users = new Resource$Users(this); - this.userStates = new Resource$Userstates(this); - this.v2 = new Resource$V2(this); - } +export namespace partners_v2 { + /** + * Google Partners API + * + * Searches certified companies and creates contact leads with them, and also + * audits the usage of clients. + * + * @example + * const google = require('googleapis'); + * const partners = google.partners('v2'); + * + * @namespace partners + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Partners + */ + export class Partners { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + analytics: Resource$Analytics; + clientMessages: Resource$Clientmessages; + companies: Resource$Companies; + leads: Resource$Leads; + offers: Resource$Offers; + userEvents: Resource$Userevents; + users: Resource$Users; + userStates: Resource$Userstates; + v2: Resource$V2; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.analytics = new Resource$Analytics(this); + this.clientMessages = new Resource$Clientmessages(this); + this.companies = new Resource$Companies(this); + this.leads = new Resource$Leads(this); + this.offers = new Resource$Offers(this); + this.userEvents = new Resource$Userevents(this); + this.users = new Resource$Users(this); + this.userStates = new Resource$Userstates(this); + this.v2 = new Resource$V2(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Information about a particular AdWords Manager Account. Read more at - * https://support.google.com/adwords/answer/6139186 - */ -export interface Schema$AdWordsManagerAccountInfo { - /** - * Name of the customer this account represents. - */ - customerName: string; - /** - * The AdWords Manager Account id. - */ - id: string; -} -/** - * Analytics data for a `Company` within a single day. - */ -export interface Schema$Analytics { - /** - * Instances of users contacting the `Company` on the specified date. - */ - contacts: Schema$AnalyticsDataPoint; - /** - * Date on which these events occurred. - */ - eventDate: Schema$Date; - /** - * Instances of users viewing the `Company` profile on the specified date. - */ - profileViews: Schema$AnalyticsDataPoint; - /** - * Instances of users seeing the `Company` in Google Partners Search results - * on the specified date. - */ - searchViews: Schema$AnalyticsDataPoint; -} -/** - * Details of the analytics events for a `Company` within a single day. - */ -export interface Schema$AnalyticsDataPoint { - /** - * Number of times the type of event occurred. Meaning depends on context - * (e.g. profile views, contacts, etc.). - */ - eventCount: number; - /** - * Location information of where these events occurred. - */ - eventLocations: Schema$LatLng[]; -} -/** - * Analytics aggregated data for a `Company` for a given date range. - */ -export interface Schema$AnalyticsSummary { - /** - * Aggregated number of times users contacted the `Company` for given date - * range. - */ - contactsCount: number; - /** - * Aggregated number of profile views for the `Company` for given date range. - */ - profileViewsCount: number; - /** - * Aggregated number of times users saw the `Company` in Google Partners - * Search results for given date range. - */ - searchViewsCount: number; -} -/** - * Available Offers to be distributed. - */ -export interface Schema$AvailableOffer { - /** - * The number of codes for this offer that are available for distribution. - */ - available: number; - /** - * Offer info by country. - */ - countryOfferInfos: Schema$CountryOfferInfo[]; - /** - * Description of the offer. - */ - description: string; - /** - * ID of this offer. - */ - id: string; - /** - * The maximum age of an account [in days] to be eligible. - */ - maxAccountAge: number; - /** - * Name of the offer. - */ - name: string; - /** - * Level of this offer. - */ - offerLevel: string; - /** - * Type of offer. - */ - offerType: string; - /** - * Customers who qualify for this offer. - */ - qualifiedCustomer: Schema$OfferCustomer[]; - /** - * Whether or not the list of qualified customers is definitely complete. - */ - qualifiedCustomersComplete: boolean; - /** - * Should special text be shown on the offers page. - */ - showSpecialOfferCopy: boolean; - /** - * Terms of the offer. - */ - terms: string; -} -/** - * A user's information on a specific certification. - */ -export interface Schema$Certification { - /** - * Whether this certification has been achieved. - */ - achieved: boolean; - /** - * The type of certification, the area of expertise. - */ - certificationType: string; - /** - * Date this certification is due to expire. - */ - expiration: string; - /** - * The date the user last achieved certification. - */ - lastAchieved: string; - /** - * Whether this certification is in the state of warning. - */ - warning: boolean; -} -/** - * Status for a Google Partners certification exam. - */ -export interface Schema$CertificationExamStatus { - /** - * The number of people who have passed the certification exam. - */ - numberUsersPass: number; - /** - * The type of certification exam. - */ - type: string; -} -/** - * Google Partners certification status. - */ -export interface Schema$CertificationStatus { - /** - * List of certification exam statuses. - */ - examStatuses: Schema$CertificationExamStatus[]; - /** - * Whether certification is passing. - */ - isCertified: boolean; - /** - * The type of the certification. - */ - type: string; - /** - * Number of people who are certified, - */ - userCount: number; -} -/** - * A company resource in the Google Partners API. Once certified, it qualifies - * for being searched by advertisers. - */ -export interface Schema$Company { - /** - * URL of the company's additional websites used to verify the dynamic - * badges. These are stored as full URLs as entered by the user, but only the - * TLD will be used for the actual verification. - */ - additionalWebsites: string[]; - /** - * Email domains that allow users with a matching email address to get - * auto-approved for associating with this company. - */ - autoApprovalEmailDomains: string[]; - /** - * Partner badge tier - */ - badgeTier: string; - /** - * The list of Google Partners certification statuses for the company. - */ - certificationStatuses: Schema$CertificationStatus[]; - /** - * Company type labels listed on the company's profile. - */ - companyTypes: string[]; - /** - * The minimum monthly budget that the company accepts for partner business, - * converted to the requested currency code. - */ - convertedMinMonthlyBudget: Schema$Money; - /** - * The ID of the company. - */ - id: string; - /** - * Industries the company can help with. - */ - industries: string[]; - /** - * The list of localized info for the company. - */ - localizedInfos: Schema$LocalizedCompanyInfo[]; - /** - * The list of all company locations. If set, must include the - * primary_location in the list. - */ - locations: Schema$Location[]; - /** - * The name of the company. - */ - name: string; - /** - * The unconverted minimum monthly budget that the company accepts for partner - * business. - */ - originalMinMonthlyBudget: Schema$Money; - /** - * The Primary AdWords Manager Account id. - */ - primaryAdwordsManagerAccountId: string; - /** - * The primary language code of the company, as defined by <a - * href="https://tools.ietf.org/html/bcp47">BCP 47</a> - * (IETF BCP 47, "Tags for Identifying Languages"). - */ - primaryLanguageCode: string; - /** - * The primary location of the company. - */ - primaryLocation: Schema$Location; - /** - * The public viewability status of the company's profile. - */ - profileStatus: string; - /** - * Basic information from the company's public profile. - */ - publicProfile: Schema$PublicProfile; - /** - * Information related to the ranking of the company within the list of - * companies. - */ - ranks: Schema$Rank[]; - /** - * Services the company can help with. - */ - services: string[]; - /** - * The list of Google Partners specialization statuses for the company. - */ - specializationStatus: Schema$SpecializationStatus[]; - /** - * URL of the company's website. - */ - websiteUrl: string; -} -/** - * A CompanyRelation resource representing information about a user's - * affiliation and standing with a company in Partners. - */ -export interface Schema$CompanyRelation { - /** - * The primary address for this company. - */ - address: string; - /** - * Whether the company is a Partner. - */ - badgeTier: string; - /** - * Indicates if the user is an admin for this company. - */ - companyAdmin: boolean; - /** - * The ID of the company. There may be no id if this is a pending company.5 - */ - companyId: string; - /** - * The timestamp of when affiliation was requested. @OutputOnly - */ - creationTime: string; - /** - * The internal company ID. Only available for a whitelisted set of api - * clients. - */ - internalCompanyId: string; - /** - * The flag that indicates if the company is pending verification. - */ - isPending: boolean; - /** - * A URL to a profile photo, e.g. a G+ profile photo. - */ - logoUrl: string; - /** - * The AdWords manager account # associated this company. - */ - managerAccount: string; - /** - * The name (in the company's primary language) for the company. - */ - name: string; - /** - * The phone number for the company's primary address. - */ - phoneNumber: string; - /** - * The primary location of the company. - */ - primaryAddress: Schema$Location; - /** - * The primary country code of the company. - */ - primaryCountryCode: string; - /** - * The primary language code of the company. - */ - primaryLanguageCode: string; - /** - * The timestamp when the user was approved. @OutputOnly - */ - resolvedTimestamp: string; - /** - * The segment the company is classified as. - */ - segment: string[]; - /** - * The list of Google Partners specialization statuses for the company. - */ - specializationStatus: Schema$SpecializationStatus[]; - /** - * The state of relationship, in terms of approvals. - */ - state: string; - /** - * The website URL for this company. - */ - website: string; -} -/** - * Offer info by country. - */ -export interface Schema$CountryOfferInfo { - /** - * (localized) Get Y amount for that country's offer. - */ - getYAmount: string; - /** - * Country code for which offer codes may be requested. - */ - offerCountryCode: string; - /** - * Type of offer country is eligible for. - */ - offerType: string; - /** - * (localized) Spend X amount for that country's offer. - */ - spendXAmount: string; -} -/** - * Request message for CreateLead. - */ -export interface Schema$CreateLeadRequest { - /** - * The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED` and - * either `email` or `phone_number` must be provided. - */ - lead: Schema$Lead; - /** - * <a - * href="https://www.google.com/recaptcha/">reCaptcha</a> - * challenge info. - */ - recaptchaChallenge: Schema$RecaptchaChallenge; - /** - * Current request metadata. - */ - requestMetadata: Schema$RequestMetadata; -} -/** - * Response message for CreateLead. - */ -export interface Schema$CreateLeadResponse { - /** - * Lead that was created depending on the outcome of <a - * href="https://www.google.com/recaptcha/">reCaptcha</a> - * validation. - */ - lead: Schema$Lead; - /** - * The outcome of <a - * href="https://www.google.com/recaptcha/">reCaptcha</a> - * validation. - */ - recaptchaStatus: string; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * Debug information about this request. - */ -export interface Schema$DebugInfo { - /** - * Info about the server that serviced this request. - */ - serverInfo: string; - /** - * Server-side debug stack trace. - */ - serverTraceInfo: string; - /** - * URL of the service that handled this request. - */ - serviceUrl: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Key value data pair for an event. - */ -export interface Schema$EventData { - /** - * Data type. - */ - key: string; - /** - * Data values. - */ - values: string[]; -} -/** - * A user's information on a specific exam. - */ -export interface Schema$ExamStatus { - /** - * The type of the exam. - */ - examType: string; - /** - * Date this exam is due to expire. - */ - expiration: string; - /** - * The date the user last passed this exam. - */ - lastPassed: string; - /** - * Whether this exam has been passed and not expired. - */ - passed: boolean; - /** - * The date the user last taken this exam. - */ - taken: string; - /** - * Whether this exam is in the state of warning. - */ - warning: boolean; -} -/** - * Response message for GetCompany. - */ -export interface Schema$GetCompanyResponse { - /** - * The company. - */ - company: Schema$Company; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Response message for GetPartnersStatus. - */ -export interface Schema$GetPartnersStatusResponse { - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Historical information about a Google Partners Offer. - */ -export interface Schema$HistoricalOffer { - /** - * Client's AdWords page URL. - */ - adwordsUrl: string; - /** - * Email address for client. - */ - clientEmail: string; - /** - * ID of client. - */ - clientId: string; - /** - * Name of the client. - */ - clientName: string; - /** - * Time offer was first created. - */ - creationTime: string; - /** - * Time this offer expires. - */ - expirationTime: string; - /** - * Time last action was taken. - */ - lastModifiedTime: string; - /** - * Offer code. - */ - offerCode: string; - /** - * Country Code for the offer country. - */ - offerCountryCode: string; - /** - * Type of offer. - */ - offerType: string; - /** - * Name (First + Last) of the partners user to whom the incentive is - * allocated. - */ - senderName: string; - /** - * Status of the offer. - */ - status: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * A lead resource that represents an advertiser contact for a `Company`. These - * are usually generated via Google Partner Search (the advertiser portal). - */ -export interface Schema$Lead { - /** - * The AdWords Customer ID of the lead. - */ - adwordsCustomerId: string; - /** - * Comments lead source gave. - */ - comments: string; - /** - * Timestamp of when this lead was created. - */ - createTime: string; - /** - * Email address of lead source. - */ - email: string; - /** - * Last name of lead source. - */ - familyName: string; - /** - * First name of lead source. - */ - givenName: string; - /** - * List of reasons for using Google Partner Search and creating a lead. - */ - gpsMotivations: string[]; - /** - * ID of the lead. - */ - id: string; - /** - * Language code of the lead's language preference, as defined by <a - * href="https://tools.ietf.org/html/bcp47">BCP 47</a> - * (IETF BCP 47, "Tags for Identifying Languages"). - */ - languageCode: string; - /** - * Whether or not the lead signed up for marketing emails - */ - marketingOptIn: boolean; - /** - * The minimum monthly budget lead source is willing to spend. - */ - minMonthlyBudget: Schema$Money; - /** - * Phone number of lead source. - */ - phoneNumber: string; - /** - * The lead's state in relation to the company. - */ - state: string; - /** - * Type of lead. - */ - type: string; - /** - * Website URL of lead source. - */ - websiteUrl: string; -} -/** - * Response message for ListAnalytics. - */ -export interface Schema$ListAnalyticsResponse { - /** - * The list of analytics. Sorted in ascending order of Analytics.event_date. - */ - analytics: Schema$Analytics[]; - /** - * Aggregated information across the response's analytics. - */ - analyticsSummary: Schema$AnalyticsSummary; - /** - * A token to retrieve next page of results. Pass this value in the - * `ListAnalyticsRequest.page_token` field in the subsequent call to - * ListAnalytics to retrieve the next page of results. - */ - nextPageToken: string; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Response message for ListCompanies. - */ -export interface Schema$ListCompaniesResponse { - /** - * The list of companies. - */ - companies: Schema$Company[]; - /** - * A token to retrieve next page of results. Pass this value in the - * `ListCompaniesRequest.page_token` field in the subsequent call to - * ListCompanies to retrieve the next page of results. - */ - nextPageToken: string; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Response message for ListLeads. - */ -export interface Schema$ListLeadsResponse { - /** - * The list of leads. - */ - leads: Schema$Lead[]; - /** - * A token to retrieve next page of results. Pass this value in the - * `ListLeadsRequest.page_token` field in the subsequent call to ListLeads to - * retrieve the next page of results. - */ - nextPageToken: string; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; - /** - * The total count of leads for the given company. - */ - totalSize: number; -} -/** - * Response for ListOfferHistory. - */ -export interface Schema$ListOffersHistoryResponse { - /** - * True if the user has the option to show entire company history. - */ - canShowEntireCompany: boolean; - /** - * Supply this token in a ListOffersHistoryRequest to retrieve the next page. - */ - nextPageToken: string; - /** - * Historical offers meeting request. - */ - offers: Schema$HistoricalOffer[]; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; - /** - * True if this response is showing entire company history. - */ - showingEntireCompany: boolean; - /** - * Number of results across all pages. - */ - totalResults: number; -} -/** - * Response for ListOffer. - */ -export interface Schema$ListOffersResponse { - /** - * Available Offers to be distributed. - */ - availableOffers: Schema$AvailableOffer[]; - /** - * Reason why no Offers are available. - */ - noOfferReason: string; - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Response message for ListUserStates. - */ -export interface Schema$ListUserStatesResponse { - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; - /** - * User's states. - */ - userStates: string[]; -} -/** - * The localized company information. - */ -export interface Schema$LocalizedCompanyInfo { - /** - * List of country codes for the localized company info. - */ - countryCodes: string[]; - /** - * Localized display name. - */ - displayName: string; - /** - * Language code of the localized company info, as defined by <a - * href="https://tools.ietf.org/html/bcp47">BCP 47</a> - * (IETF BCP 47, "Tags for Identifying Languages"). - */ - languageCode: string; - /** - * Localized brief description that the company uses to advertise themselves. - */ - overview: string; -} -/** - * A location with address and geographic coordinates. May optionally contain a - * detailed (multi-field) version of the address. - */ -export interface Schema$Location { - /** - * The single string version of the address. - */ - address: string; - /** - * The following address lines represent the most specific part of any - * address. - */ - addressLine: string[]; - /** - * Top-level administrative subdivision of this country. - */ - administrativeArea: string; - /** - * Dependent locality or sublocality. Used for UK dependent localities, or - * neighborhoods or boroughs in other locations. - */ - dependentLocality: string; - /** - * Language code of the address. Should be in BCP 47 format. - */ - languageCode: string; - /** - * The latitude and longitude of the location, in degrees. - */ - latLng: Schema$LatLng; - /** - * Generally refers to the city/town portion of an address. - */ - locality: string; - /** - * Values are frequently alphanumeric. - */ - postalCode: string; - /** - * CLDR (Common Locale Data Repository) region code . - */ - regionCode: string; - /** - * Use of this code is very country-specific, but will refer to a secondary - * classification code for sorting mail. - */ - sortingCode: string; -} -/** - * Request message for LogClientMessage. - */ -export interface Schema$LogMessageRequest { - /** - * Map of client info, such as URL, browser navigator, browser platform, etc. - */ - clientInfo: any; - /** - * Details about the client message. - */ - details: string; - /** - * Message level of client message. - */ - level: string; - /** - * Current request metadata. - */ - requestMetadata: Schema$RequestMetadata; -} -/** - * Response message for LogClientMessage. - */ -export interface Schema$LogMessageResponse { - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Request message for LogUserEvent. - */ -export interface Schema$LogUserEventRequest { - /** - * The action that occurred. - */ - eventAction: string; - /** - * The category the action belongs to. - */ - eventCategory: string; - /** - * List of event data for the event. - */ - eventDatas: Schema$EventData[]; - /** - * The scope of the event. - */ - eventScope: string; - /** - * Advertiser lead information. - */ - lead: Schema$Lead; - /** - * Current request metadata. - */ - requestMetadata: Schema$RequestMetadata; - /** - * The URL where the event occurred. - */ - url: string; -} -/** - * Response message for LogUserEvent. - */ -export interface Schema$LogUserEventResponse { - /** - * Current response metadata. - */ - responseMetadata: Schema$ResponseMetadata; -} -/** - * Represents an amount of money with its currency type. - */ -export interface Schema$Money { - /** - * The 3-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: string; -} -/** - * Customers qualified for an offer. - */ -export interface Schema$OfferCustomer { - /** - * URL to the customer's AdWords page. - */ - adwordsUrl: string; - /** - * Country code of the customer. - */ - countryCode: string; - /** - * Time the customer was created. - */ - creationTime: string; - /** - * Days the customer is still eligible. - */ - eligibilityDaysLeft: number; - /** - * External CID for the customer. - */ - externalCid: string; - /** - * Formatted Get Y amount with currency code. - */ - getYAmount: string; - /** - * Name of the customer. - */ - name: string; - /** - * Type of the offer - */ - offerType: string; - /** - * Formatted Spend X amount with currency code. - */ - spendXAmount: string; -} -/** - * A set of opt-ins for a user. - */ -export interface Schema$OptIns { - /** - * An opt-in about receiving email from Partners marketing teams. Includes - * member-only events and special promotional offers for Google products. - */ - marketComm: boolean; - /** - * An opt-in about receiving email with customized AdWords campaign management - * tips. - */ - performanceSuggestions: boolean; - /** - * An opt-in to allow recieivng phone calls about their Partners account. - */ - phoneContact: boolean; - /** - * An opt-in to receive special promotional gifts and material in the mail. - */ - physicalMail: boolean; - /** - * An opt-in about receiving email regarding new features and products. - */ - specialOffers: boolean; -} -/** - * Basic information from a public profile. - */ -export interface Schema$PublicProfile { - /** - * The URL to the main display image of the public profile. Being deprecated. - */ - displayImageUrl: string; - /** - * The display name of the public profile. - */ - displayName: string; - /** - * The ID which can be used to retrieve more details about the public profile. - */ - id: string; - /** - * The URL to the main profile image of the public profile. - */ - profileImage: string; - /** - * The URL of the public profile. - */ - url: string; -} -/** - * Information related to ranking of results. - */ -export interface Schema$Rank { - /** - * The type of rank. - */ - type: string; - /** - * The numerical value of the rank. - */ - value: number; -} -/** - * <a - * href="https://www.google.com/recaptcha/">reCaptcha</a> - * challenge info. - */ -export interface Schema$RecaptchaChallenge { /** - * The ID of the reCaptcha challenge. + * Information about a particular AdWords Manager Account. Read more at + * https://support.google.com/adwords/answer/6139186 */ - id: string; + export interface Schema$AdWordsManagerAccountInfo { + /** + * Name of the customer this account represents. + */ + customerName: string; + /** + * The AdWords Manager Account id. + */ + id: string; + } /** - * The response to the reCaptcha challenge. - */ - response: string; -} -/** - * Common data that is in each API request. - */ -export interface Schema$RequestMetadata { + * Analytics data for a `Company` within a single day. + */ + export interface Schema$Analytics { + /** + * Instances of users contacting the `Company` on the specified date. + */ + contacts: Schema$AnalyticsDataPoint; + /** + * Date on which these events occurred. + */ + eventDate: Schema$Date; + /** + * Instances of users viewing the `Company` profile on the specified date. + */ + profileViews: Schema$AnalyticsDataPoint; + /** + * Instances of users seeing the `Company` in Google Partners Search results + * on the specified date. + */ + searchViews: Schema$AnalyticsDataPoint; + } /** - * Experiment IDs the current request belongs to. - */ - experimentIds: string[]; + * Details of the analytics events for a `Company` within a single day. + */ + export interface Schema$AnalyticsDataPoint { + /** + * Number of times the type of event occurred. Meaning depends on context + * (e.g. profile views, contacts, etc.). + */ + eventCount: number; + /** + * Location information of where these events occurred. + */ + eventLocations: Schema$LatLng[]; + } /** - * Locale to use for the current request. - */ - locale: string; + * Analytics aggregated data for a `Company` for a given date range. + */ + export interface Schema$AnalyticsSummary { + /** + * Aggregated number of times users contacted the `Company` for given date + * range. + */ + contactsCount: number; + /** + * Aggregated number of profile views for the `Company` for given date + * range. + */ + profileViewsCount: number; + /** + * Aggregated number of times users saw the `Company` in Google Partners + * Search results for given date range. + */ + searchViewsCount: number; + } /** - * Google Partners session ID. + * Available Offers to be distributed. */ - partnersSessionId: string; + export interface Schema$AvailableOffer { + /** + * The number of codes for this offer that are available for distribution. + */ + available: number; + /** + * Offer info by country. + */ + countryOfferInfos: Schema$CountryOfferInfo[]; + /** + * Description of the offer. + */ + description: string; + /** + * ID of this offer. + */ + id: string; + /** + * The maximum age of an account [in days] to be eligible. + */ + maxAccountAge: number; + /** + * Name of the offer. + */ + name: string; + /** + * Level of this offer. + */ + offerLevel: string; + /** + * Type of offer. + */ + offerType: string; + /** + * Customers who qualify for this offer. + */ + qualifiedCustomer: Schema$OfferCustomer[]; + /** + * Whether or not the list of qualified customers is definitely complete. + */ + qualifiedCustomersComplete: boolean; + /** + * Should special text be shown on the offers page. + */ + showSpecialOfferCopy: boolean; + /** + * Terms of the offer. + */ + terms: string; + } /** - * Source of traffic for the current request. - */ - trafficSource: Schema$TrafficSource; + * A user's information on a specific certification. + */ + export interface Schema$Certification { + /** + * Whether this certification has been achieved. + */ + achieved: boolean; + /** + * The type of certification, the area of expertise. + */ + certificationType: string; + /** + * Date this certification is due to expire. + */ + expiration: string; + /** + * The date the user last achieved certification. + */ + lastAchieved: string; + /** + * Whether this certification is in the state of warning. + */ + warning: boolean; + } /** - * Values to use instead of the user's respective defaults for the current - * request. These are only honored by whitelisted products. - */ - userOverrides: Schema$UserOverrides; -} -/** - * Common data that is in each API response. - */ -export interface Schema$ResponseMetadata { + * Status for a Google Partners certification exam. + */ + export interface Schema$CertificationExamStatus { + /** + * The number of people who have passed the certification exam. + */ + numberUsersPass: number; + /** + * The type of certification exam. + */ + type: string; + } /** - * Debug information about this request. - */ - debugInfo: Schema$DebugInfo; -} -/** - * Agency specialization status - */ -export interface Schema$SpecializationStatus { + * Google Partners certification status. + */ + export interface Schema$CertificationStatus { + /** + * List of certification exam statuses. + */ + examStatuses: Schema$CertificationExamStatus[]; + /** + * Whether certification is passing. + */ + isCertified: boolean; + /** + * The type of the certification. + */ + type: string; + /** + * Number of people who are certified, + */ + userCount: number; + } /** - * The specialization this status is for. - */ - badgeSpecialization: string; + * A company resource in the Google Partners API. Once certified, it qualifies + * for being searched by advertisers. + */ + export interface Schema$Company { + /** + * URL of the company's additional websites used to verify the dynamic + * badges. These are stored as full URLs as entered by the user, but only + * the TLD will be used for the actual verification. + */ + additionalWebsites: string[]; + /** + * Email domains that allow users with a matching email address to get + * auto-approved for associating with this company. + */ + autoApprovalEmailDomains: string[]; + /** + * Partner badge tier + */ + badgeTier: string; + /** + * The list of Google Partners certification statuses for the company. + */ + certificationStatuses: Schema$CertificationStatus[]; + /** + * Company type labels listed on the company's profile. + */ + companyTypes: string[]; + /** + * The minimum monthly budget that the company accepts for partner business, + * converted to the requested currency code. + */ + convertedMinMonthlyBudget: Schema$Money; + /** + * The ID of the company. + */ + id: string; + /** + * Industries the company can help with. + */ + industries: string[]; + /** + * The list of localized info for the company. + */ + localizedInfos: Schema$LocalizedCompanyInfo[]; + /** + * The list of all company locations. If set, must include the + * primary_location in the list. + */ + locations: Schema$Location[]; + /** + * The name of the company. + */ + name: string; + /** + * The unconverted minimum monthly budget that the company accepts for + * partner business. + */ + originalMinMonthlyBudget: Schema$Money; + /** + * The Primary AdWords Manager Account id. + */ + primaryAdwordsManagerAccountId: string; + /** + * The primary language code of the company, as defined by <a + * href="https://tools.ietf.org/html/bcp47">BCP 47</a> + * (IETF BCP 47, "Tags for Identifying Languages"). + */ + primaryLanguageCode: string; + /** + * The primary location of the company. + */ + primaryLocation: Schema$Location; + /** + * The public viewability status of the company's profile. + */ + profileStatus: string; + /** + * Basic information from the company's public profile. + */ + publicProfile: Schema$PublicProfile; + /** + * Information related to the ranking of the company within the list of + * companies. + */ + ranks: Schema$Rank[]; + /** + * Services the company can help with. + */ + services: string[]; + /** + * The list of Google Partners specialization statuses for the company. + */ + specializationStatus: Schema$SpecializationStatus[]; + /** + * URL of the company's website. + */ + websiteUrl: string; + } /** - * State of agency specialization. - */ - badgeSpecializationState: string; -} -/** - * Source of traffic for the current request. - */ -export interface Schema$TrafficSource { + * A CompanyRelation resource representing information about a user's + * affiliation and standing with a company in Partners. + */ + export interface Schema$CompanyRelation { + /** + * The primary address for this company. + */ + address: string; + /** + * Whether the company is a Partner. + */ + badgeTier: string; + /** + * Indicates if the user is an admin for this company. + */ + companyAdmin: boolean; + /** + * The ID of the company. There may be no id if this is a pending company.5 + */ + companyId: string; + /** + * The timestamp of when affiliation was requested. @OutputOnly + */ + creationTime: string; + /** + * The internal company ID. Only available for a whitelisted set of api + * clients. + */ + internalCompanyId: string; + /** + * The flag that indicates if the company is pending verification. + */ + isPending: boolean; + /** + * A URL to a profile photo, e.g. a G+ profile photo. + */ + logoUrl: string; + /** + * The AdWords manager account # associated this company. + */ + managerAccount: string; + /** + * The name (in the company's primary language) for the company. + */ + name: string; + /** + * The phone number for the company's primary address. + */ + phoneNumber: string; + /** + * The primary location of the company. + */ + primaryAddress: Schema$Location; + /** + * The primary country code of the company. + */ + primaryCountryCode: string; + /** + * The primary language code of the company. + */ + primaryLanguageCode: string; + /** + * The timestamp when the user was approved. @OutputOnly + */ + resolvedTimestamp: string; + /** + * The segment the company is classified as. + */ + segment: string[]; + /** + * The list of Google Partners specialization statuses for the company. + */ + specializationStatus: Schema$SpecializationStatus[]; + /** + * The state of relationship, in terms of approvals. + */ + state: string; + /** + * The website URL for this company. + */ + website: string; + } /** - * Identifier to indicate where the traffic comes from. An identifier has - * multiple letters created by a team which redirected the traffic to us. + * Offer info by country. */ - trafficSourceId: string; + export interface Schema$CountryOfferInfo { + /** + * (localized) Get Y amount for that country's offer. + */ + getYAmount: string; + /** + * Country code for which offer codes may be requested. + */ + offerCountryCode: string; + /** + * Type of offer country is eligible for. + */ + offerType: string; + /** + * (localized) Spend X amount for that country's offer. + */ + spendXAmount: string; + } /** - * Second level identifier to indicate where the traffic comes from. An - * identifier has multiple letters created by a team which redirected the - * traffic to us. - */ - trafficSubId: string; -} -/** - * A resource representing a user of the Partners platform. - */ -export interface Schema$User { + * Request message for CreateLead. + */ + export interface Schema$CreateLeadRequest { + /** + * The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED` and + * either `email` or `phone_number` must be provided. + */ + lead: Schema$Lead; + /** + * <a + * href="https://www.google.com/recaptcha/">reCaptcha</a> + * challenge info. + */ + recaptchaChallenge: Schema$RecaptchaChallenge; + /** + * Current request metadata. + */ + requestMetadata: Schema$RequestMetadata; + } /** - * Whether or not the user has opted to share their Academy for Ads info with - * Google Partners. - */ - afaInfoShared: boolean; + * Response message for CreateLead. + */ + export interface Schema$CreateLeadResponse { + /** + * Lead that was created depending on the outcome of <a + * href="https://www.google.com/recaptcha/">reCaptcha</a> + * validation. + */ + lead: Schema$Lead; + /** + * The outcome of <a + * href="https://www.google.com/recaptcha/">reCaptcha</a> + * validation. + */ + recaptchaStatus: string; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * This is the list of AdWords Manager Accounts the user has edit access to. - * If the user has edit access to multiple accounts, the user can choose the - * preferred account and we use this when a personal account is needed. Can be - * empty meaning the user has access to no accounts. @OutputOnly - */ - availableAdwordsManagerAccounts: Schema$AdWordsManagerAccountInfo[]; + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; + } /** - * The list of achieved certifications. These are calculated based on exam - * results and other requirements. @OutputOnly + * Debug information about this request. */ - certificationStatus: Schema$Certification[]; + export interface Schema$DebugInfo { + /** + * Info about the server that serviced this request. + */ + serverInfo: string; + /** + * Server-side debug stack trace. + */ + serverTraceInfo: string; + /** + * URL of the service that handled this request. + */ + serviceUrl: string; + } /** - * The company that the user is associated with. If not present, the user is - * not associated with any company. - */ - company: Schema$CompanyRelation; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Key value data pair for an event. + */ + export interface Schema$EventData { + /** + * Data type. + */ + key: string; + /** + * Data values. + */ + values: string[]; + } /** - * The email address used by the user used for company verification. - * @OutputOnly - */ - companyVerificationEmail: string; + * A user's information on a specific exam. + */ + export interface Schema$ExamStatus { + /** + * The type of the exam. + */ + examType: string; + /** + * Date this exam is due to expire. + */ + expiration: string; + /** + * The date the user last passed this exam. + */ + lastPassed: string; + /** + * Whether this exam has been passed and not expired. + */ + passed: boolean; + /** + * The date the user last taken this exam. + */ + taken: string; + /** + * Whether this exam is in the state of warning. + */ + warning: boolean; + } /** - * The list of exams the user ever taken. For each type of exam, only one - * entry is listed. - */ - examStatus: Schema$ExamStatus[]; + * Response message for GetCompany. + */ + export interface Schema$GetCompanyResponse { + /** + * The company. + */ + company: Schema$Company; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * The ID of the user. + * Response message for GetPartnersStatus. */ - id: string; + export interface Schema$GetPartnersStatusResponse { + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * The internal user ID. Only available for a whitelisted set of api clients. - */ - internalId: string; + * Historical information about a Google Partners Offer. + */ + export interface Schema$HistoricalOffer { + /** + * Client's AdWords page URL. + */ + adwordsUrl: string; + /** + * Email address for client. + */ + clientEmail: string; + /** + * ID of client. + */ + clientId: string; + /** + * Name of the client. + */ + clientName: string; + /** + * Time offer was first created. + */ + creationTime: string; + /** + * Time this offer expires. + */ + expirationTime: string; + /** + * Time last action was taken. + */ + lastModifiedTime: string; + /** + * Offer code. + */ + offerCode: string; + /** + * Country Code for the offer country. + */ + offerCountryCode: string; + /** + * Type of offer. + */ + offerType: string; + /** + * Name (First + Last) of the partners user to whom the incentive is + * allocated. + */ + senderName: string; + /** + * Status of the offer. + */ + status: string; + } /** - * The most recent time the user interacted with the Partners site. - * @OutputOnly - */ - lastAccessTime: string; + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * The list of emails the user has access to/can select as primary. - * @OutputOnly - */ - primaryEmails: string[]; + * A lead resource that represents an advertiser contact for a `Company`. + * These are usually generated via Google Partner Search (the advertiser + * portal). + */ + export interface Schema$Lead { + /** + * The AdWords Customer ID of the lead. + */ + adwordsCustomerId: string; + /** + * Comments lead source gave. + */ + comments: string; + /** + * Timestamp of when this lead was created. + */ + createTime: string; + /** + * Email address of lead source. + */ + email: string; + /** + * Last name of lead source. + */ + familyName: string; + /** + * First name of lead source. + */ + givenName: string; + /** + * List of reasons for using Google Partner Search and creating a lead. + */ + gpsMotivations: string[]; + /** + * ID of the lead. + */ + id: string; + /** + * Language code of the lead's language preference, as defined by <a + * href="https://tools.ietf.org/html/bcp47">BCP 47</a> + * (IETF BCP 47, "Tags for Identifying Languages"). + */ + languageCode: string; + /** + * Whether or not the lead signed up for marketing emails + */ + marketingOptIn: boolean; + /** + * The minimum monthly budget lead source is willing to spend. + */ + minMonthlyBudget: Schema$Money; + /** + * Phone number of lead source. + */ + phoneNumber: string; + /** + * The lead's state in relation to the company. + */ + state: string; + /** + * Type of lead. + */ + type: string; + /** + * Website URL of lead source. + */ + websiteUrl: string; + } /** - * The profile information of a Partners user, contains all the directly - * editable user information. - */ - profile: Schema$UserProfile; + * Response message for ListAnalytics. + */ + export interface Schema$ListAnalyticsResponse { + /** + * The list of analytics. Sorted in ascending order of Analytics.event_date. + */ + analytics: Schema$Analytics[]; + /** + * Aggregated information across the response's analytics. + */ + analyticsSummary: Schema$AnalyticsSummary; + /** + * A token to retrieve next page of results. Pass this value in the + * `ListAnalyticsRequest.page_token` field in the subsequent call to + * ListAnalytics to retrieve the next page of results. + */ + nextPageToken: string; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * Information about a user's external public profile outside Google - * Partners. - */ - publicProfile: Schema$PublicProfile; -} -/** - * Values to use instead of the user's respective defaults. These are only - * honored by whitelisted products. - */ -export interface Schema$UserOverrides { + * Response message for ListCompanies. + */ + export interface Schema$ListCompaniesResponse { + /** + * The list of companies. + */ + companies: Schema$Company[]; + /** + * A token to retrieve next page of results. Pass this value in the + * `ListCompaniesRequest.page_token` field in the subsequent call to + * ListCompanies to retrieve the next page of results. + */ + nextPageToken: string; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * IP address to use instead of the user's geo-located IP address. - */ - ipAddress: string; + * Response message for ListLeads. + */ + export interface Schema$ListLeadsResponse { + /** + * The list of leads. + */ + leads: Schema$Lead[]; + /** + * A token to retrieve next page of results. Pass this value in the + * `ListLeadsRequest.page_token` field in the subsequent call to ListLeads + * to retrieve the next page of results. + */ + nextPageToken: string; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + /** + * The total count of leads for the given company. + */ + totalSize: number; + } /** - * Logged-in user ID to impersonate instead of the user's ID. - */ - userId: string; -} -/** - * The profile information of a Partners user. - */ -export interface Schema$UserProfile { + * Response for ListOfferHistory. + */ + export interface Schema$ListOffersHistoryResponse { + /** + * True if the user has the option to show entire company history. + */ + canShowEntireCompany: boolean; + /** + * Supply this token in a ListOffersHistoryRequest to retrieve the next + * page. + */ + nextPageToken: string; + /** + * Historical offers meeting request. + */ + offers: Schema$HistoricalOffer[]; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + /** + * True if this response is showing entire company history. + */ + showingEntireCompany: boolean; + /** + * Number of results across all pages. + */ + totalResults: number; + } /** - * The user's mailing address, contains multiple fields. - */ - address: Schema$Location; + * Response for ListOffer. + */ + export interface Schema$ListOffersResponse { + /** + * Available Offers to be distributed. + */ + availableOffers: Schema$AvailableOffer[]; + /** + * Reason why no Offers are available. + */ + noOfferReason: string; + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * If the user has edit access to multiple accounts, the user can choose the - * preferred account and it is used when a personal account is needed. Can be - * empty. - */ - adwordsManagerAccount: string; + * Response message for ListUserStates. + */ + export interface Schema$ListUserStatesResponse { + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + /** + * User's states. + */ + userStates: string[]; + } /** - * A list of ids representing which channels the user selected they were in. - */ - channels: string[]; + * The localized company information. + */ + export interface Schema$LocalizedCompanyInfo { + /** + * List of country codes for the localized company info. + */ + countryCodes: string[]; + /** + * Localized display name. + */ + displayName: string; + /** + * Language code of the localized company info, as defined by <a + * href="https://tools.ietf.org/html/bcp47">BCP 47</a> + * (IETF BCP 47, "Tags for Identifying Languages"). + */ + languageCode: string; + /** + * Localized brief description that the company uses to advertise + * themselves. + */ + overview: string; + } /** - * The email address the user has selected on the Partners site as primary. - */ - emailAddress: string; + * A location with address and geographic coordinates. May optionally contain + * a detailed (multi-field) version of the address. + */ + export interface Schema$Location { + /** + * The single string version of the address. + */ + address: string; + /** + * The following address lines represent the most specific part of any + * address. + */ + addressLine: string[]; + /** + * Top-level administrative subdivision of this country. + */ + administrativeArea: string; + /** + * Dependent locality or sublocality. Used for UK dependent localities, or + * neighborhoods or boroughs in other locations. + */ + dependentLocality: string; + /** + * Language code of the address. Should be in BCP 47 format. + */ + languageCode: string; + /** + * The latitude and longitude of the location, in degrees. + */ + latLng: Schema$LatLng; + /** + * Generally refers to the city/town portion of an address. + */ + locality: string; + /** + * Values are frequently alphanumeric. + */ + postalCode: string; + /** + * CLDR (Common Locale Data Repository) region code . + */ + regionCode: string; + /** + * Use of this code is very country-specific, but will refer to a secondary + * classification code for sorting mail. + */ + sortingCode: string; + } /** - * The list of opt-ins for the user, related to communication preferences. - */ - emailOptIns: Schema$OptIns; + * Request message for LogClientMessage. + */ + export interface Schema$LogMessageRequest { + /** + * Map of client info, such as URL, browser navigator, browser platform, + * etc. + */ + clientInfo: any; + /** + * Details about the client message. + */ + details: string; + /** + * Message level of client message. + */ + level: string; + /** + * Current request metadata. + */ + requestMetadata: Schema$RequestMetadata; + } /** - * The user's family name. + * Response message for LogClientMessage. */ - familyName: string; + export interface Schema$LogMessageResponse { + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * The user's given name. - */ - givenName: string; + * Request message for LogUserEvent. + */ + export interface Schema$LogUserEventRequest { + /** + * The action that occurred. + */ + eventAction: string; + /** + * The category the action belongs to. + */ + eventCategory: string; + /** + * List of event data for the event. + */ + eventDatas: Schema$EventData[]; + /** + * The scope of the event. + */ + eventScope: string; + /** + * Advertiser lead information. + */ + lead: Schema$Lead; + /** + * Current request metadata. + */ + requestMetadata: Schema$RequestMetadata; + /** + * The URL where the event occurred. + */ + url: string; + } /** - * A list of ids representing which industries the user selected. + * Response message for LogUserEvent. */ - industries: string[]; + export interface Schema$LogUserEventResponse { + /** + * Current response metadata. + */ + responseMetadata: Schema$ResponseMetadata; + } /** - * A list of ids represnting which job categories the user selected. - */ - jobFunctions: string[]; + * Represents an amount of money with its currency type. + */ + export interface Schema$Money { + /** + * The 3-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: string; + } /** - * The list of languages this user understands. - */ - languages: string[]; + * Customers qualified for an offer. + */ + export interface Schema$OfferCustomer { + /** + * URL to the customer's AdWords page. + */ + adwordsUrl: string; + /** + * Country code of the customer. + */ + countryCode: string; + /** + * Time the customer was created. + */ + creationTime: string; + /** + * Days the customer is still eligible. + */ + eligibilityDaysLeft: number; + /** + * External CID for the customer. + */ + externalCid: string; + /** + * Formatted Get Y amount with currency code. + */ + getYAmount: string; + /** + * Name of the customer. + */ + name: string; + /** + * Type of the offer + */ + offerType: string; + /** + * Formatted Spend X amount with currency code. + */ + spendXAmount: string; + } /** - * A list of ids representing which markets the user was interested in. - */ - markets: string[]; + * A set of opt-ins for a user. + */ + export interface Schema$OptIns { + /** + * An opt-in about receiving email from Partners marketing teams. Includes + * member-only events and special promotional offers for Google products. + */ + marketComm: boolean; + /** + * An opt-in about receiving email with customized AdWords campaign + * management tips. + */ + performanceSuggestions: boolean; + /** + * An opt-in to allow recieivng phone calls about their Partners account. + */ + phoneContact: boolean; + /** + * An opt-in to receive special promotional gifts and material in the mail. + */ + physicalMail: boolean; + /** + * An opt-in about receiving email regarding new features and products. + */ + specialOffers: boolean; + } /** - * Whether or not to migrate the user's exam data to Academy for Ads. - */ - migrateToAfa: boolean; + * Basic information from a public profile. + */ + export interface Schema$PublicProfile { + /** + * The URL to the main display image of the public profile. Being + * deprecated. + */ + displayImageUrl: string; + /** + * The display name of the public profile. + */ + displayName: string; + /** + * The ID which can be used to retrieve more details about the public + * profile. + */ + id: string; + /** + * The URL to the main profile image of the public profile. + */ + profileImage: string; + /** + * The URL of the public profile. + */ + url: string; + } /** - * The user's phone number. - */ - phoneNumber: string; + * Information related to ranking of results. + */ + export interface Schema$Rank { + /** + * The type of rank. + */ + type: string; + /** + * The numerical value of the rank. + */ + value: number; + } /** - * The user's primary country, an ISO 2-character code. + * <a + * href="https://www.google.com/recaptcha/">reCaptcha</a> + * challenge info. */ - primaryCountryCode: string; + export interface Schema$RecaptchaChallenge { + /** + * The ID of the reCaptcha challenge. + */ + id: string; + /** + * The response to the reCaptcha challenge. + */ + response: string; + } + /** + * Common data that is in each API request. + */ + export interface Schema$RequestMetadata { + /** + * Experiment IDs the current request belongs to. + */ + experimentIds: string[]; + /** + * Locale to use for the current request. + */ + locale: string; + /** + * Google Partners session ID. + */ + partnersSessionId: string; + /** + * Source of traffic for the current request. + */ + trafficSource: Schema$TrafficSource; + /** + * Values to use instead of the user's respective defaults for the + * current request. These are only honored by whitelisted products. + */ + userOverrides: Schema$UserOverrides; + } /** - * Whether the user's public profile is visible to anyone with the URL. + * Common data that is in each API response. */ - profilePublic: boolean; -} - -export class Resource$Analytics { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ResponseMetadata { + /** + * Debug information about this request. + */ + debugInfo: Schema$DebugInfo; } - - getRoot() { - return this.root; + /** + * Agency specialization status + */ + export interface Schema$SpecializationStatus { + /** + * The specialization this status is for. + */ + badgeSpecialization: string; + /** + * State of agency specialization. + */ + badgeSpecializationState: string; } - - /** - * partners.analytics.list - * @desc Lists analytics data for a user's associated company. Should only be - * called within the context of an authorized logged in user. - * @alias partners.analytics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested page size. Server may return fewer analytics than requested. If unspecified or set to 0, default value is 30. Specifies the number of days in the date range when querying analytics. The `page_token` represents the end date of the date range and the start date is calculated using the `page_size` as the number of days BEFORE the end date. Must be a non-negative integer. - * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListAnalyticsResponse.next_page_token` returned from the previous call to ListAnalytics. Will be a date string in `YYYY-MM-DD` format representing the end date of the date range of results to return. If unspecified or set to "", default value is the current date. - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Source of traffic for the current request. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/analytics').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TrafficSource { + /** + * Identifier to indicate where the traffic comes from. An identifier has + * multiple letters created by a team which redirected the traffic to us. + */ + trafficSourceId: string; + /** + * Second level identifier to indicate where the traffic comes from. An + * identifier has multiple letters created by a team which redirected the + * traffic to us. + */ + trafficSubId: string; } -} - -export class Resource$Clientmessages { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); + /** + * A resource representing a user of the Partners platform. + */ + export interface Schema$User { + /** + * Whether or not the user has opted to share their Academy for Ads info + * with Google Partners. + */ + afaInfoShared: boolean; + /** + * This is the list of AdWords Manager Accounts the user has edit access to. + * If the user has edit access to multiple accounts, the user can choose the + * preferred account and we use this when a personal account is needed. Can + * be empty meaning the user has access to no accounts. @OutputOnly + */ + availableAdwordsManagerAccounts: Schema$AdWordsManagerAccountInfo[]; + /** + * The list of achieved certifications. These are calculated based on exam + * results and other requirements. @OutputOnly + */ + certificationStatus: Schema$Certification[]; + /** + * The company that the user is associated with. If not present, the user is + * not associated with any company. + */ + company: Schema$CompanyRelation; + /** + * The email address used by the user used for company verification. + * @OutputOnly + */ + companyVerificationEmail: string; + /** + * The list of exams the user ever taken. For each type of exam, only one + * entry is listed. + */ + examStatus: Schema$ExamStatus[]; + /** + * The ID of the user. + */ + id: string; + /** + * The internal user ID. Only available for a whitelisted set of api + * clients. + */ + internalId: string; + /** + * The most recent time the user interacted with the Partners site. + * @OutputOnly + */ + lastAccessTime: string; + /** + * The list of emails the user has access to/can select as primary. + * @OutputOnly + */ + primaryEmails: string[]; + /** + * The profile information of a Partners user, contains all the directly + * editable user information. + */ + profile: Schema$UserProfile; + /** + * Information about a user's external public profile outside Google + * Partners. + */ + publicProfile: Schema$PublicProfile; } - - getRoot() { - return this.root; + /** + * Values to use instead of the user's respective defaults. These are only + * honored by whitelisted products. + */ + export interface Schema$UserOverrides { + /** + * IP address to use instead of the user's geo-located IP address. + */ + ipAddress: string; + /** + * Logged-in user ID to impersonate instead of the user's ID. + */ + userId: string; } - - /** - * partners.clientMessages.log - * @desc Logs a generic message from the client, such as `Failed to render - * component`, `Profile page is running slow`, `More than 500 users have - * accessed this result.`, etc. - * @alias partners.clientMessages.log - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().LogMessageRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - log(params?: any, - options?: MethodOptions): AxiosPromise; - log(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - log(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/clientMessages:log') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The profile information of a Partners user. + */ + export interface Schema$UserProfile { + /** + * The user's mailing address, contains multiple fields. + */ + address: Schema$Location; + /** + * If the user has edit access to multiple accounts, the user can choose the + * preferred account and it is used when a personal account is needed. Can + * be empty. + */ + adwordsManagerAccount: string; + /** + * A list of ids representing which channels the user selected they were in. + */ + channels: string[]; + /** + * The email address the user has selected on the Partners site as primary. + */ + emailAddress: string; + /** + * The list of opt-ins for the user, related to communication preferences. + */ + emailOptIns: Schema$OptIns; + /** + * The user's family name. + */ + familyName: string; + /** + * The user's given name. + */ + givenName: string; + /** + * A list of ids representing which industries the user selected. + */ + industries: string[]; + /** + * A list of ids represnting which job categories the user selected. + */ + jobFunctions: string[]; + /** + * The list of languages this user understands. + */ + languages: string[]; + /** + * A list of ids representing which markets the user was interested in. + */ + markets: string[]; + /** + * Whether or not to migrate the user's exam data to Academy for Ads. + */ + migrateToAfa: boolean; + /** + * The user's phone number. + */ + phoneNumber: string; + /** + * The user's primary country, an ISO 2-character code. + */ + primaryCountryCode: string; + /** + * Whether the user's public profile is visible to anyone with the URL. + */ + profilePublic: boolean; } -} -export class Resource$Companies { - root: Partners; - leads: Resource$Companies$Leads; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - this.leads = new Resource$Companies$Leads(root); - } + export class Resource$Analytics { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * partners.companies.get - * @desc Gets a company. - * @alias partners.companies.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.address The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set. - * @param {string} params.companyId The ID of the company to retrieve. - * @param {string=} params.currencyCode If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code. - * @param {string=} params.orderBy How to order addresses within the returned company. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string=} params.view The view of `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/companies/{companyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['companyId'], - pathParams: ['companyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * partners.analytics.list + * @desc Lists analytics data for a user's associated company. Should only + * be called within the context of an authorized logged in user. + * @alias partners.analytics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested page size. Server may return fewer analytics than requested. If unspecified or set to 0, default value is 30. Specifies the number of days in the date range when querying analytics. The `page_token` represents the end date of the date range and the start date is calculated using the `page_size` as the number of days BEFORE the end date. Must be a non-negative integer. + * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListAnalyticsResponse.next_page_token` returned from the previous call to ListAnalytics. Will be a date string in `YYYY-MM-DD` format representing the end date of the date range of results to return. If unspecified or set to "", default value is the current date. + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/analytics').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * partners.companies.list - * @desc Lists companies. - * @alias partners.companies.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.address The address to use when searching for companies. If not given, the geo-located address of the request is used. - * @param {string=} params.companyName Company name to search for. - * @param {string=} params.gpsMotivations List of reasons for using Google Partner Search to get companies. - * @param {string=} params.industries List of industries the company can help with. - * @param {string=} params.languageCodes List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, "Tags for Identifying Languages"). - * @param {string=} params.maxMonthlyBudget.currencyCode The 3-letter currency code defined in ISO 4217. - * @param {integer=} params.maxMonthlyBudget.nanos 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. - * @param {string=} params.maxMonthlyBudget.units The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - * @param {string=} params.minMonthlyBudget.currencyCode The 3-letter currency code defined in ISO 4217. - * @param {integer=} params.minMonthlyBudget.nanos 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. - * @param {string=} params.minMonthlyBudget.units The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - * @param {string=} params.orderBy How to order addresses within the returned companies. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. - * @param {integer=} params.pageSize Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListCompaniesResponse.next_page_token` returned from the previous call to ListCompanies. - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string=} params.services List of services that the returned agencies should provide. If this is not empty, any returned agency must have at least one of these services, or one of the specializations in the "specializations" field. - * @param {string=} params.specializations List of specializations that the returned agencies should provide. If this is not empty, any returned agency must have at least one of these specializations, or one of the services in the "services" field. - * @param {string=} params.view The view of the `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. - * @param {string=} params.websiteUrl Website URL that will help to find a better matched company. . - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Clientmessages { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/companies').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Companies$Leads { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * partners.companies.leads.create - * @desc Creates an advertiser lead for the given company ID. - * @alias partners.companies.leads.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.companyId The ID of the company to contact. - * @param {().CreateLeadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/companies/{companyId}/leads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['companyId'], - pathParams: ['companyId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * partners.clientMessages.log + * @desc Logs a generic message from the client, such as `Failed to render + * component`, `Profile page is running slow`, `More than 500 users have + * accessed this result.`, etc. + * @alias partners.clientMessages.log + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().LogMessageRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + log(params?: any, + options?: MethodOptions): AxiosPromise; + log(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + log(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/clientMessages:log') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Companies { + root: Partners; + leads: Resource$Companies$Leads; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); + this.leads = new Resource$Companies$Leads(root); + } -export class Resource$Leads { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; - } + /** + * partners.companies.get + * @desc Gets a company. + * @alias partners.companies.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.address The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set. + * @param {string} params.companyId The ID of the company to retrieve. + * @param {string=} params.currencyCode If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code. + * @param {string=} params.orderBy How to order addresses within the returned company. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string=} params.view The view of `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/companies/{companyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['companyId'], + pathParams: ['companyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * partners.leads.list - * @desc Lists advertiser leads for a user's associated company. Should only - * be called within the context of an authorized logged in user. - * @alias partners.leads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.orderBy How to order Leads. Currently, only `create_time` and `create_time desc` are supported - * @param {integer=} params.pageSize Requested page size. Server may return fewer leads than requested. If unspecified, server picks an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListLeadsResponse.next_page_token` returned from the previous call to ListLeads. - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + + /** + * partners.companies.list + * @desc Lists companies. + * @alias partners.companies.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.address The address to use when searching for companies. If not given, the geo-located address of the request is used. + * @param {string=} params.companyName Company name to search for. + * @param {string=} params.gpsMotivations List of reasons for using Google Partner Search to get companies. + * @param {string=} params.industries List of industries the company can help with. + * @param {string=} params.languageCodes List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, "Tags for Identifying Languages"). + * @param {string=} params.maxMonthlyBudget.currencyCode The 3-letter currency code defined in ISO 4217. + * @param {integer=} params.maxMonthlyBudget.nanos 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. + * @param {string=} params.maxMonthlyBudget.units The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * @param {string=} params.minMonthlyBudget.currencyCode The 3-letter currency code defined in ISO 4217. + * @param {integer=} params.minMonthlyBudget.nanos 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. + * @param {string=} params.minMonthlyBudget.units The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + * @param {string=} params.orderBy How to order addresses within the returned companies. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. + * @param {integer=} params.pageSize Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListCompaniesResponse.next_page_token` returned from the previous call to ListCompanies. + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string=} params.services List of services that the returned agencies should provide. If this is not empty, any returned agency must have at least one of these services, or one of the specializations in the "specializations" field. + * @param {string=} params.specializations List of specializations that the returned agencies should provide. If this is not empty, any returned agency must have at least one of these specializations, or one of the services in the "services" field. + * @param {string=} params.view The view of the `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. + * @param {string=} params.websiteUrl Website URL that will help to find a better matched company. . + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/companies').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Companies$Leads { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/leads').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Offers { - root: Partners; - history: Resource$Offers$History; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - this.history = new Resource$Offers$History(root); - } - getRoot() { - return this.root; + /** + * partners.companies.leads.create + * @desc Creates an advertiser lead for the given company ID. + * @alias partners.companies.leads.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.companyId The ID of the company to contact. + * @param {().CreateLeadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/companies/{companyId}/leads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['companyId'], + pathParams: ['companyId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * partners.offers.list - * @desc Lists the Offers available for the current user - * @alias partners.offers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Leads { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/offers').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Offers$History { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * partners.offers.history.list - * @desc Lists the Historical Offers for the current user (or user's entire - * company) - * @alias partners.offers.history.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.entireCompany if true, show history for the entire company. Requires user to be admin. - * @param {string=} params.orderBy Comma-separated list of fields to order by, e.g.: "foo,bar,baz". Use "foo desc" to sort descending. List of valid field names is: name, offer_code, expiration_time, status, last_modified_time, sender_name, creation_time, country_code, offer_type. - * @param {integer=} params.pageSize Maximum number of rows to return per page. - * @param {string=} params.pageToken Token to retrieve a specific page. - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/offers/history').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * partners.leads.list + * @desc Lists advertiser leads for a user's associated company. Should only + * be called within the context of an authorized logged in user. + * @alias partners.leads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.orderBy How to order Leads. Currently, only `create_time` and `create_time desc` are supported + * @param {integer=} params.pageSize Requested page size. Server may return fewer leads than requested. If unspecified, server picks an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results that the server returns. Typically, this is the value of `ListLeadsResponse.next_page_token` returned from the previous call to ListLeads. + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/leads').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Offers { + root: Partners; + history: Resource$Offers$History; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); + this.history = new Resource$Offers$History(root); + } -export class Resource$Userevents { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * partners.userEvents.log - * @desc Logs a user event. - * @alias partners.userEvents.log - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().LogUserEventRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - log(params?: any, - options?: MethodOptions): AxiosPromise; - log(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - log(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * partners.offers.list + * @desc Lists the Offers available for the current user + * @alias partners.offers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/offers').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Offers$History { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/userEvents:log').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Users { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * partners.offers.history.list + * @desc Lists the Historical Offers for the current user (or user's entire + * company) + * @alias partners.offers.history.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.entireCompany if true, show history for the entire company. Requires user to be admin. + * @param {string=} params.orderBy Comma-separated list of fields to order by, e.g.: "foo,bar,baz". Use "foo desc" to sort descending. List of valid field names is: name, offer_code, expiration_time, status, last_modified_time, sender_name, creation_time, country_code, offer_type. + * @param {integer=} params.pageSize Maximum number of rows to return per page. + * @param {string=} params.pageToken Token to retrieve a specific page. + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/offers/history') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * partners.users.createCompanyRelation - * @desc Creates a user's company relation. Affiliates the user to a company. - * @alias partners.users.createCompanyRelation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string} params.userId The ID of the user. Can be set to me to mean the currently authenticated user. - * @param {().CompanyRelation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createCompanyRelation(params?: any, options?: MethodOptions): - AxiosPromise; - createCompanyRelation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createCompanyRelation( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Userevents { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/users/{userId}/companyRelation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * partners.users.deleteCompanyRelation - * @desc Deletes a user's company relation. Unaffiliaites the user from a - * company. - * @alias partners.users.deleteCompanyRelation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string} params.userId The ID of the user. Can be set to me to mean the currently authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteCompanyRelation(params?: any, options?: MethodOptions): - AxiosPromise; - deleteCompanyRelation( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteCompanyRelation( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/users/{userId}/companyRelation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * partners.userEvents.log + * @desc Logs a user event. + * @alias partners.userEvents.log + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().LogUserEventRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + log(params?: any, + options?: MethodOptions): AxiosPromise; + log(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + log(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/userEvents:log') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * partners.users.get - * @desc Gets a user. - * @alias partners.users.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string} params.userId Identifier of the user. Can be set to me to mean the currently authenticated user. - * @param {string=} params.userView Specifies what parts of the user information to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Users { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/users/{userId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * partners.users.updateProfile - * @desc Updates a user's profile. A user can only update their own profile - * and should only be called within the context of a logged in user. - * @alias partners.users.updateProfile - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {().UserProfile} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateProfile(params?: any, options?: MethodOptions): - AxiosPromise; - updateProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateProfile( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * partners.users.createCompanyRelation + * @desc Creates a user's company relation. Affiliates the user to a + * company. + * @alias partners.users.createCompanyRelation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string} params.userId The ID of the user. Can be set to me to mean the currently authenticated user. + * @param {().CompanyRelation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createCompanyRelation(params?: any, options?: MethodOptions): + AxiosPromise; + createCompanyRelation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createCompanyRelation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/users/{userId}/companyRelation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/users/profile').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Userstates { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * partners.users.deleteCompanyRelation + * @desc Deletes a user's company relation. Unaffiliaites the user from a + * company. + * @alias partners.users.deleteCompanyRelation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string} params.userId The ID of the user. Can be set to me to mean the currently authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteCompanyRelation(params?: any, options?: MethodOptions): + AxiosPromise; + deleteCompanyRelation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteCompanyRelation( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/users/{userId}/companyRelation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * partners.userStates.list - * @desc Lists states for current user. - * @alias partners.userStates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * partners.users.get + * @desc Gets a user. + * @alias partners.users.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string} params.userId Identifier of the user. Can be set to me to mean the currently authenticated user. + * @param {string=} params.userView Specifies what parts of the user information to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/users/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/userStates').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$V2 { - root: Partners; - constructor(root: Partners) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * partners.users.updateProfile + * @desc Updates a user's profile. A user can only update their own profile + * and should only be called within the context of a logged in user. + * @alias partners.users.updateProfile + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {().UserProfile} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateProfile(params?: any, options?: MethodOptions): + AxiosPromise; + updateProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateProfile( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v2/users/profile').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * partners.getPartnersstatus - * @desc Gets Partners Status of the logged in user's agency. Should only be - * called if the logged in user is the admin of the agency. - * @alias partners.getPartnersstatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getPartnersstatus(params?: any, options?: MethodOptions): - AxiosPromise; - getPartnersstatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getPartnersstatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Userstates { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/partnersstatus').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * partners.updateCompanies - * @desc Update company. Should only be called within the context of an - * authorized logged in user. - * @alias partners.updateCompanies - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Required with at least 1 value in FieldMask's paths. - * @param {().Company} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateCompanies(params?: any, options?: MethodOptions): - AxiosPromise; - updateCompanies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateCompanies( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * partners.userStates.list + * @desc Lists states for current user. + * @alias partners.userStates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/userStates').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$V2 { + root: Partners; + constructor(root: Partners) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/companies').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * partners.updateLeads - * @desc Updates the specified lead. - * @alias partners.updateLeads - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. - * @param {string=} params.requestMetadata.locale Locale to use for the current request. - * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. - * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. - * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. - * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. - * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Required with at least 1 value in FieldMask's paths. Only `state` and `adwords_customer_id` are currently supported. - * @param {().Lead} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateLeads(params?: any, options?: MethodOptions): AxiosPromise; - updateLeads( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateLeads( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * partners.getPartnersstatus + * @desc Gets Partners Status of the logged in user's agency. Should only be + * called if the logged in user is the admin of the agency. + * @alias partners.getPartnersstatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getPartnersstatus(params?: any, options?: MethodOptions): + AxiosPromise; + getPartnersstatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getPartnersstatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/partnersstatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * partners.updateCompanies + * @desc Update company. Should only be called within the context of an + * authorized logged in user. + * @alias partners.updateCompanies + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Required with at least 1 value in FieldMask's paths. + * @param {().Company} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateCompanies(params?: any, options?: MethodOptions): + AxiosPromise; + updateCompanies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateCompanies( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/companies').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/leads').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * partners.updateLeads + * @desc Updates the specified lead. + * @alias partners.updateLeads + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.requestMetadata.experimentIds Experiment IDs the current request belongs to. + * @param {string=} params.requestMetadata.locale Locale to use for the current request. + * @param {string=} params.requestMetadata.partnersSessionId Google Partners session ID. + * @param {string=} params.requestMetadata.trafficSource.trafficSourceId Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.trafficSource.trafficSubId Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + * @param {string=} params.requestMetadata.userOverrides.ipAddress IP address to use instead of the user's geo-located IP address. + * @param {string=} params.requestMetadata.userOverrides.userId Logged-in user ID to impersonate instead of the user's ID. + * @param {string=} params.updateMask Standard field mask for the set of fields to be updated. Required with at least 1 value in FieldMask's paths. Only `state` and `adwords_customer_id` are currently supported. + * @param {().Lead} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateLeads(params?: any, options?: MethodOptions): + AxiosPromise; + updateLeads( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateLeads( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://partners.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/leads').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/people/v1.ts b/src/apis/people/v1.ts index 9584f5e6a32..97ea7160cac 100644 --- a/src/apis/people/v1.ts +++ b/src/apis/people/v1.ts @@ -27,2039 +27,2066 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * People API - * - * Provides access to information about profiles and contacts. - * - * @example - * const google = require('googleapis'); - * const people = google.people('v1'); - * - * @namespace people - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for People - */ -export class People { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - contactGroups: Resource$Contactgroups; - people: Resource$People; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.contactGroups = new Resource$Contactgroups(this); - this.people = new Resource$People(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A person's physical address. May be a P.O. box or street address. All - * fields are optional. - */ -export interface Schema$Address { - /** - * The city of the address. - */ - city: string; - /** - * The country of the address. - */ - country: string; - /** - * The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) country - * code of the address. - */ - countryCode: string; - /** - * The extended address of the address; for example, the apartment number. - */ - extendedAddress: string; - /** - * The read-only type of the address translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; - /** - * The unstructured value of the address. If this is not set by the user it - * will be automatically constructed from structured values. - */ - formattedValue: string; - /** - * Metadata about the address. - */ - metadata: Schema$FieldMetadata; - /** - * The P.O. box of the address. - */ - poBox: string; - /** - * The postal code of the address. - */ - postalCode: string; - /** - * The region of the address; for example, the state or province. - */ - region: string; - /** - * The street address. - */ - streetAddress: string; - /** - * The type of the address. The type can be custom or predefined. Possible - * values include, but are not limited to, the following: * `home` * `work` * - * `other` - */ - type: string; -} -/** - * A person's age range. - */ -export interface Schema$AgeRangeType { - /** - * The age range. - */ - ageRange: string; - /** - * Metadata about the age range. - */ - metadata: Schema$FieldMetadata; -} -/** - * The response to a batch get contact groups request. - */ -export interface Schema$BatchGetContactGroupsResponse { - /** - * The list of responses for each requested contact group resource. - */ - responses: Schema$ContactGroupResponse[]; -} -/** - * A person's short biography. - */ -export interface Schema$Biography { - /** - * The content type of the biography. - */ - contentType: string; - /** - * Metadata about the biography. - */ - metadata: Schema$FieldMetadata; - /** - * The short biography. - */ - value: string; -} -/** - * A person's birthday. At least one of the `date` and `text` fields are - * specified. The `date` and `text` fields typically represent the same date, - * but are not guaranteed to. - */ -export interface Schema$Birthday { - /** - * The date of the birthday. - */ - date: Schema$Date; - /** - * Metadata about the birthday. - */ - metadata: Schema$FieldMetadata; - /** - * A free-form string representing the user's birthday. - */ - text: string; -} -/** - * A person's bragging rights. - */ -export interface Schema$BraggingRights { - /** - * Metadata about the bragging rights. - */ - metadata: Schema$FieldMetadata; - /** - * The bragging rights; for example, `climbed mount everest`. - */ - value: string; -} -/** - * A contact group. - */ -export interface Schema$ContactGroup { - /** - * The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the - * resource. Used for web cache validation. - */ - etag: string; - /** - * The read-only name translated and formatted in the viewer's account - * locale or the `Accept-Language` HTTP header locale for system groups names. - * Group names set by the owner are the same as name. - */ - formattedName: string; - /** - * The read-only contact group type. - */ - groupType: string; - /** - * The total number of contacts in the group irrespective of max members in - * specified in the request. - */ - memberCount: number; - /** - * The list of contact person resource names that are members of the contact - * group. The field is not populated for LIST requests and can only be updated - * through the - * [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify). - */ - memberResourceNames: string[]; - /** - * Metadata about the contact group. - */ - metadata: Schema$ContactGroupMetadata; - /** - * The contact group name set by the group owner or a system provided name for - * system groups. - */ - name: string; - /** - * The resource name for the contact group, assigned by the server. An ASCII - * string, in the form of - * `contactGroups/`<var>contact_group_id</var>. - */ - resourceName: string; -} -/** - * A Google contact group membership. - */ -export interface Schema$ContactGroupMembership { - /** - * The contact group ID for the contact group membership. The contact group ID - * can be custom or predefined. Possible values include, but are not limited - * to, the following: * `myContacts` * `starred` * A numerical ID for - * user-created groups. - */ - contactGroupId: string; -} -/** - * The read-only metadata about a contact group. - */ -export interface Schema$ContactGroupMetadata { - /** - * True if the contact group resource has been deleted. Populated only for - * [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests that - * include a sync token. - */ - deleted: boolean; - /** - * The time the group was last updated. - */ - updateTime: string; -} -/** - * The response for a specific contact group. - */ -export interface Schema$ContactGroupResponse { - /** - * The contact group. - */ - contactGroup: Schema$ContactGroup; - /** - * The original requested resource name. - */ - requestedResourceName: string; - /** - * The status of the response. - */ - status: Schema$Status; -} -/** - * A person's read-only cover photo. A large image shown on the person's - * profile page that represents who they are or what they care about. - */ -export interface Schema$CoverPhoto { - /** - * True if the cover photo is the default cover photo; false if the cover - * photo is a user-provided cover photo. - */ - default: boolean; - /** - * Metadata about the cover photo. - */ - metadata: Schema$FieldMetadata; - /** - * The URL of the cover photo. - */ - url: string; -} -/** - * A request to create a new contact group. - */ -export interface Schema$CreateContactGroupRequest { - /** - * The contact group to create. - */ - contactGroup: Schema$ContactGroup; -} -/** - * Represents a whole calendar date, for example a date of birth. The time of - * day and time zone are either specified elsewhere or are not significant. The - * date is relative to the [Proleptic Gregorian - * Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The - * day may be 0 to represent a year and month where the day is not significant. - * The year may be 0 to represent a month and day independent of year; for - * example, anniversary date. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * A Google Apps Domain membership. - */ -export interface Schema$DomainMembership { - /** - * True if the person is in the viewer's Google Apps domain. - */ - inViewerDomain: boolean; -} -/** - * A person's email address. - */ -export interface Schema$EmailAddress { - /** - * The display name of the email. - */ - displayName: string; - /** - * The read-only type of the email address translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; - /** - * Metadata about the email address. - */ - metadata: Schema$FieldMetadata; - /** - * The type of the email address. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: * `home` * - * `work` * `other` - */ - type: string; - /** - * The email address. - */ - value: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * An event related to the person. - */ -export interface Schema$Event { - /** - * The date of the event. - */ - date: Schema$Date; - /** - * The read-only type of the event translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; - /** - * Metadata about the event. - */ - metadata: Schema$FieldMetadata; - /** - * The type of the event. The type can be custom or predefined. Possible - * values include, but are not limited to, the following: * `anniversary` * - * `other` - */ - type: string; -} -/** - * Metadata about a field. - */ -export interface Schema$FieldMetadata { - /** - * True if the field is the primary field; false if the field is a secondary - * field. - */ - primary: boolean; - /** - * The source of the field. - */ - source: Schema$Source; - /** - * True if the field is verified; false if the field is unverified. A verified - * field is typically a name, email address, phone number, or website that has - * been confirmed to be owned by the person. - */ - verified: boolean; -} -/** - * A person's gender. - */ -export interface Schema$Gender { - /** - * The read-only value of the gender translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedValue: string; - /** - * Metadata about the gender. - */ - metadata: Schema$FieldMetadata; - /** - * The gender for the person. The gender can be custom or predefined. Possible - * values include, but are not limited to, the following: * `male` * `female` - * * `other` * `unknown` - */ - value: string; -} -export interface Schema$GetPeopleResponse { - /** - * The response for each requested resource name. - */ - responses: Schema$PersonResponse[]; -} -/** - * A person's instant messaging client. - */ -export interface Schema$ImClient { - /** - * The read-only protocol of the IM client formatted in the viewer's - * account locale or the `Accept-Language` HTTP header locale. - */ - formattedProtocol: string; - /** - * The read-only type of the IM client translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; - /** - * Metadata about the IM client. - */ - metadata: Schema$FieldMetadata; - /** - * The protocol of the IM client. The protocol can be custom or predefined. - * Possible values include, but are not limited to, the following: * `aim` * - * `msn` * `yahoo` * `skype` * `qq` * `googleTalk` * `icq` * `jabber` * - * `netMeeting` - */ - protocol: string; - /** - * The type of the IM client. The type can be custom or predefined. Possible - * values include, but are not limited to, the following: * `home` * `work` * - * `other` - */ - type: string; - /** - * The user name used in the IM client. - */ - username: string; -} -/** - * One of the person's interests. - */ -export interface Schema$Interest { - /** - * Metadata about the interest. - */ - metadata: Schema$FieldMetadata; - /** - * The interest; for example, `stargazing`. - */ - value: string; -} -export interface Schema$ListConnectionsResponse { - /** - * The list of people that the requestor is connected to. - */ - connections: Schema$Person[]; - /** - * The token that can be used to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The token that can be used to retrieve changes since the last request. - */ - nextSyncToken: string; - /** - * The total number of items in the list without pagination. - */ - totalItems: number; - /** - * **DEPRECATED** (Please use totalItems) The total number of people in the - * list without pagination. - */ - totalPeople: number; -} -/** - * The response to a list contact groups request. - */ -export interface Schema$ListContactGroupsResponse { - /** - * The list of contact groups. Members of the contact groups are not - * populated. - */ - contactGroups: Schema$ContactGroup[]; - /** - * The token that can be used to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The token that can be used to retrieve changes since the last request. - */ - nextSyncToken: string; - /** - * The total number of items in the list without pagination. - */ - totalItems: number; -} -/** - * A person's locale preference. - */ -export interface Schema$Locale { - /** - * Metadata about the locale. - */ - metadata: Schema$FieldMetadata; - /** - * The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47) language - * tag representing the locale. - */ - value: string; -} -/** - * A person's read-only membership in a group. - */ -export interface Schema$Membership { - /** - * The contact group membership. - */ - contactGroupMembership: Schema$ContactGroupMembership; - /** - * The domain membership. - */ - domainMembership: Schema$DomainMembership; - /** - * Metadata about the membership. - */ - metadata: Schema$FieldMetadata; -} -/** - * A request to modify an existing contact group's members. Contacts can be - * removed from any group but they can only be added to a user group or - * myContacts or starred system groups. - */ -export interface Schema$ModifyContactGroupMembersRequest { - /** - * The resource names of the contact people to add in the form of in the form - * `people/`<var>person_id</var>. - */ - resourceNamesToAdd: string[]; - /** - * The resource names of the contact people to remove in the form of in the - * form of `people/`<var>person_id</var>. - */ - resourceNamesToRemove: string[]; -} -/** - * The response to a modify contact group members request. - */ -export interface Schema$ModifyContactGroupMembersResponse { - /** - * The contact people resource names that were not found. - */ - notFoundResourceNames: string[]; -} -/** - * A person's name. If the name is a mononym, the family name is empty. - */ -export interface Schema$Name { - /** - * The read-only display name formatted according to the locale specified by - * the viewer's account or the `Accept-Language` HTTP header. - */ - displayName: string; - /** - * The read-only display name with the last name first formatted according to - * the locale specified by the viewer's account or the `Accept-Language` - * HTTP header. - */ - displayNameLastFirst: string; - /** - * The family name. - */ - familyName: string; - /** - * The given name. - */ - givenName: string; - /** - * The honorific prefixes, such as `Mrs.` or `Dr.` - */ - honorificPrefix: string; - /** - * The honorific suffixes, such as `Jr.` - */ - honorificSuffix: string; - /** - * Metadata about the name. - */ - metadata: Schema$FieldMetadata; - /** - * The middle name(s). - */ - middleName: string; - /** - * The family name spelled as it sounds. - */ - phoneticFamilyName: string; - /** - * The full name spelled as it sounds. - */ - phoneticFullName: string; - /** - * The given name spelled as it sounds. - */ - phoneticGivenName: string; - /** - * The honorific prefixes spelled as they sound. - */ - phoneticHonorificPrefix: string; - /** - * The honorific suffixes spelled as they sound. - */ - phoneticHonorificSuffix: string; - /** - * The middle name(s) spelled as they sound. - */ - phoneticMiddleName: string; -} -/** - * A person's nickname. - */ -export interface Schema$Nickname { - /** - * Metadata about the nickname. - */ - metadata: Schema$FieldMetadata; - /** - * The type of the nickname. - */ - type: string; - /** - * The nickname. - */ - value: string; -} -/** - * A person's occupation. - */ -export interface Schema$Occupation { - /** - * Metadata about the occupation. - */ - metadata: Schema$FieldMetadata; - /** - * The occupation; for example, `carpenter`. - */ - value: string; -} -/** - * A person's past or current organization. Overlapping date ranges are - * permitted. - */ -export interface Schema$Organization { - /** - * True if the organization is the person's current organization; false if - * the organization is a past organization. - */ - current: boolean; - /** - * The person's department at the organization. - */ - department: string; - /** - * The domain name associated with the organization; for example, - * `google.com`. - */ - domain: string; - /** - * The end date when the person left the organization. - */ - endDate: Schema$Date; - /** - * The read-only type of the organization translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; - /** - * The person's job description at the organization. - */ - jobDescription: string; - /** - * The location of the organization office the person works at. - */ - location: string; - /** - * Metadata about the organization. - */ - metadata: Schema$FieldMetadata; - /** - * The name of the organization. - */ - name: string; - /** - * The phonetic name of the organization. - */ - phoneticName: string; - /** - * The start date when the person joined the organization. - */ - startDate: Schema$Date; - /** - * The symbol associated with the organization; for example, a stock ticker - * symbol, abbreviation, or acronym. - */ - symbol: string; - /** - * The person's job title at the organization. - */ - title: string; - /** - * The type of the organization. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: * `work` * - * `school` - */ - type: string; -} -/** - * Information about a person merged from various data sources such as the - * authenticated user's contacts and profile data. Most fields can have - * multiple items. The items in a field have no guaranteed order, but each - * non-empty field is guaranteed to have exactly one field with - * `metadata.primary` set to true. - */ -export interface Schema$Person { - /** - * The person's street addresses. - */ - addresses: Schema$Address[]; - /** - * **DEPRECATED** (Please use `person.ageRanges` instead)** The person's - * read-only age range. - */ - ageRange: string; - /** - * The person's read-only age ranges. - */ - ageRanges: Schema$AgeRangeType[]; - /** - * The person's biographies. - */ - biographies: Schema$Biography[]; - /** - * The person's birthdays. - */ - birthdays: Schema$Birthday[]; - /** - * The person's bragging rights. - */ - braggingRights: Schema$BraggingRights[]; - /** - * The person's read-only cover photos. - */ - coverPhotos: Schema$CoverPhoto[]; - /** - * The person's email addresses. - */ - emailAddresses: Schema$EmailAddress[]; - /** - * The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the - * resource. Used for web cache validation. - */ - etag: string; - /** - * The person's events. - */ - events: Schema$Event[]; - /** - * The person's genders. - */ - genders: Schema$Gender[]; - /** - * The person's instant messaging clients. - */ - imClients: Schema$ImClient[]; - /** - * The person's interests. - */ - interests: Schema$Interest[]; - /** - * The person's locale preferences. - */ - locales: Schema$Locale[]; - /** - * The person's read-only group memberships. - */ - memberships: Schema$Membership[]; - /** - * Read-only metadata about the person. - */ - metadata: Schema$PersonMetadata; - /** - * The person's names. - */ - names: Schema$Name[]; - /** - * The person's nicknames. - */ - nicknames: Schema$Nickname[]; - /** - * The person's occupations. - */ - occupations: Schema$Occupation[]; - /** - * The person's past or current organizations. - */ - organizations: Schema$Organization[]; - /** - * The person's phone numbers. - */ - phoneNumbers: Schema$PhoneNumber[]; - /** - * The person's read-only photos. - */ - photos: Schema$Photo[]; - /** - * The person's relations. - */ - relations: Schema$Relation[]; - /** - * The person's read-only relationship interests. - */ - relationshipInterests: Schema$RelationshipInterest[]; - /** - * The person's read-only relationship statuses. - */ - relationshipStatuses: Schema$RelationshipStatus[]; - /** - * The person's residences. - */ - residences: Schema$Residence[]; - /** - * The resource name for the person, assigned by the server. An ASCII string - * with a max length of 27 characters, in the form of - * `people/`<var>person_id</var>. - */ - resourceName: string; - /** - * The person's skills. - */ - skills: Schema$Skill[]; - /** - * The person's read-only taglines. - */ - taglines: Schema$Tagline[]; +export namespace people_v1 { /** - * The person's associated URLs. - */ - urls: Schema$Url[]; - /** - * The person's user defined data. - */ - userDefined: Schema$UserDefined[]; -} -/** - * The read-only metadata about a person. - */ -export interface Schema$PersonMetadata { - /** - * True if the person resource has been deleted. Populated only for - * [`connections.list`](/people/api/rest/v1/people.connections/list) requests - * that include a sync token. - */ - deleted: boolean; - /** - * Resource names of people linked to this resource. - */ - linkedPeopleResourceNames: string[]; - /** - * **DEPRECATED** (Please use - * `person.metadata.sources.profileMetadata.objectType` instead) The type of - * the person object. - */ - objectType: string; - /** - * Any former resource names this person has had. Populated only for - * [`connections.list`](/people/api/rest/v1/people.connections/list) requests - * that include a sync token. The resource name may change when adding or - * removing fields that link a contact and profile such as a verified email, - * verified phone number, or profile URL. - */ - previousResourceNames: string[]; - /** - * The sources of data for the person. - */ - sources: Schema$Source[]; -} -/** - * The response for a single person - */ -export interface Schema$PersonResponse { - /** - * **DEPRECATED** (Please use status instead) [HTTP 1.1 status code] - * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). - */ - httpStatusCode: number; - /** - * The person. - */ - person: Schema$Person; + * People API + * + * Provides access to information about profiles and contacts. + * + * @example + * const google = require('googleapis'); + * const people = google.people('v1'); + * + * @namespace people + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for People + */ + export class People { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + contactGroups: Resource$Contactgroups; + people: Resource$People; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.contactGroups = new Resource$Contactgroups(this); + this.people = new Resource$People(this); + } + + getRoot() { + return this.root; + } + } + /** - * The original requested resource name. May be different than the resource - * name on the returned person. The resource name can change when adding or - * removing fields that link a contact and profile such as a verified email, - * verified phone number, or a profile URL. - */ - requestedResourceName: string; + * A person's physical address. May be a P.O. box or street address. All + * fields are optional. + */ + export interface Schema$Address { + /** + * The city of the address. + */ + city: string; + /** + * The country of the address. + */ + country: string; + /** + * The [ISO 3166-1 alpha-2](http://www.iso.org/iso/country_codes.htm) + * country code of the address. + */ + countryCode: string; + /** + * The extended address of the address; for example, the apartment number. + */ + extendedAddress: string; + /** + * The read-only type of the address translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * The unstructured value of the address. If this is not set by the user it + * will be automatically constructed from structured values. + */ + formattedValue: string; + /** + * Metadata about the address. + */ + metadata: Schema$FieldMetadata; + /** + * The P.O. box of the address. + */ + poBox: string; + /** + * The postal code of the address. + */ + postalCode: string; + /** + * The region of the address; for example, the state or province. + */ + region: string; + /** + * The street address. + */ + streetAddress: string; + /** + * The type of the address. The type can be custom or predefined. Possible + * values include, but are not limited to, the following: * `home` * `work` + * * `other` + */ + type: string; + } /** - * The status of the response. - */ - status: Schema$Status; -} -/** - * A person's phone number. - */ -export interface Schema$PhoneNumber { + * A person's age range. + */ + export interface Schema$AgeRangeType { + /** + * The age range. + */ + ageRange: string; + /** + * Metadata about the age range. + */ + metadata: Schema$FieldMetadata; + } /** - * The read-only canonicalized [ITU-T - * E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) - * form of the phone number. + * The response to a batch get contact groups request. */ - canonicalForm: string; + export interface Schema$BatchGetContactGroupsResponse { + /** + * The list of responses for each requested contact group resource. + */ + responses: Schema$ContactGroupResponse[]; + } /** - * The read-only type of the phone number translated and formatted in the - * viewer's account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; + * A person's short biography. + */ + export interface Schema$Biography { + /** + * The content type of the biography. + */ + contentType: string; + /** + * Metadata about the biography. + */ + metadata: Schema$FieldMetadata; + /** + * The short biography. + */ + value: string; + } /** - * Metadata about the phone number. - */ - metadata: Schema$FieldMetadata; + * A person's birthday. At least one of the `date` and `text` fields are + * specified. The `date` and `text` fields typically represent the same date, + * but are not guaranteed to. + */ + export interface Schema$Birthday { + /** + * The date of the birthday. + */ + date: Schema$Date; + /** + * Metadata about the birthday. + */ + metadata: Schema$FieldMetadata; + /** + * A free-form string representing the user's birthday. + */ + text: string; + } /** - * The type of the phone number. The type can be custom or predefined. - * Possible values include, but are not limited to, the following: * `home` * - * `work` * `mobile` * `homeFax` * `workFax` * `otherFax` * `pager` * - * `workMobile` * `workPager` * `main` * `googleVoice` * `other` - */ - type: string; + * A person's bragging rights. + */ + export interface Schema$BraggingRights { + /** + * Metadata about the bragging rights. + */ + metadata: Schema$FieldMetadata; + /** + * The bragging rights; for example, `climbed mount everest`. + */ + value: string; + } /** - * The phone number. - */ - value: string; -} -/** - * A person's read-only photo. A picture shown next to the person's name - * to help others recognize the person. - */ -export interface Schema$Photo { + * A contact group. + */ + export interface Schema$ContactGroup { + /** + * The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the + * resource. Used for web cache validation. + */ + etag: string; + /** + * The read-only name translated and formatted in the viewer's account + * locale or the `Accept-Language` HTTP header locale for system groups + * names. Group names set by the owner are the same as name. + */ + formattedName: string; + /** + * The read-only contact group type. + */ + groupType: string; + /** + * The total number of contacts in the group irrespective of max members in + * specified in the request. + */ + memberCount: number; + /** + * The list of contact person resource names that are members of the contact + * group. The field is not populated for LIST requests and can only be + * updated through the + * [ModifyContactGroupMembers](/people/api/rest/v1/contactgroups/members/modify). + */ + memberResourceNames: string[]; + /** + * Metadata about the contact group. + */ + metadata: Schema$ContactGroupMetadata; + /** + * The contact group name set by the group owner or a system provided name + * for system groups. + */ + name: string; + /** + * The resource name for the contact group, assigned by the server. An ASCII + * string, in the form of + * `contactGroups/`<var>contact_group_id</var>. + */ + resourceName: string; + } /** - * True if the photo is a default photo; false if the photo is a user-provided - * photo. + * A Google contact group membership. */ - default: boolean; + export interface Schema$ContactGroupMembership { + /** + * The contact group ID for the contact group membership. The contact group + * ID can be custom or predefined. Possible values include, but are not + * limited to, the following: * `myContacts` * `starred` * A numerical + * ID for user-created groups. + */ + contactGroupId: string; + } /** - * Metadata about the photo. - */ - metadata: Schema$FieldMetadata; + * The read-only metadata about a contact group. + */ + export interface Schema$ContactGroupMetadata { + /** + * True if the contact group resource has been deleted. Populated only for + * [`ListContactGroups`](/people/api/rest/v1/contactgroups/list) requests + * that include a sync token. + */ + deleted: boolean; + /** + * The time the group was last updated. + */ + updateTime: string; + } /** - * The URL of the photo. You can change the desired size by appending a query - * parameter `sz=`<var>size</var> at the end of the url. Example: - * `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50` - */ - url: string; -} -/** - * The read-only metadata about a profile. - */ -export interface Schema$ProfileMetadata { + * The response for a specific contact group. + */ + export interface Schema$ContactGroupResponse { + /** + * The contact group. + */ + contactGroup: Schema$ContactGroup; + /** + * The original requested resource name. + */ + requestedResourceName: string; + /** + * The status of the response. + */ + status: Schema$Status; + } /** - * The profile object type. - */ - objectType: string; + * A person's read-only cover photo. A large image shown on the + * person's profile page that represents who they are or what they care + * about. + */ + export interface Schema$CoverPhoto { + /** + * True if the cover photo is the default cover photo; false if the cover + * photo is a user-provided cover photo. + */ + default: boolean; + /** + * Metadata about the cover photo. + */ + metadata: Schema$FieldMetadata; + /** + * The URL of the cover photo. + */ + url: string; + } /** - * The user types. + * A request to create a new contact group. */ - userTypes: string[]; -} -/** - * A person's relation to another person. - */ -export interface Schema$Relation { + export interface Schema$CreateContactGroupRequest { + /** + * The contact group to create. + */ + contactGroup: Schema$ContactGroup; + } /** - * The type of the relation translated and formatted in the viewer's - * account locale or the locale specified in the Accept-Language HTTP header. - */ - formattedType: string; + * Represents a whole calendar date, for example a date of birth. The time of + * day and time zone are either specified elsewhere or are not significant. + * The date is relative to the [Proleptic Gregorian + * Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The + * day may be 0 to represent a year and month where the day is not + * significant. The year may be 0 to represent a month and day independent of + * year; for example, anniversary date. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; + } /** - * Metadata about the relation. + * A Google Apps Domain membership. */ - metadata: Schema$FieldMetadata; + export interface Schema$DomainMembership { + /** + * True if the person is in the viewer's Google Apps domain. + */ + inViewerDomain: boolean; + } /** - * The name of the other person this relation refers to. - */ - person: string; + * A person's email address. + */ + export interface Schema$EmailAddress { + /** + * The display name of the email. + */ + displayName: string; + /** + * The read-only type of the email address translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * Metadata about the email address. + */ + metadata: Schema$FieldMetadata; + /** + * The type of the email address. The type can be custom or predefined. + * Possible values include, but are not limited to, the following: * `home` + * * `work` * `other` + */ + type: string; + /** + * The email address. + */ + value: string; + } /** - * The person's relation to the other person. The type can be custom or - * predefined. Possible values include, but are not limited to, the following - * values: * `spouse` * `child` * `mother` * `father` * `parent` * `brother` - * * `sister` * `friend` * `relative` * `domesticPartner` * `manager` * - * `assistant` * `referredBy` * `partner` - */ - type: string; -} -/** - * A person's read-only relationship interest . - */ -export interface Schema$RelationshipInterest { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * An event related to the person. + */ + export interface Schema$Event { + /** + * The date of the event. + */ + date: Schema$Date; + /** + * The read-only type of the event translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * Metadata about the event. + */ + metadata: Schema$FieldMetadata; + /** + * The type of the event. The type can be custom or predefined. Possible + * values include, but are not limited to, the following: * `anniversary` * + * `other` + */ + type: string; + } /** - * The value of the relationship interest translated and formatted in the - * viewer's account locale or the locale specified in the Accept-Language - * HTTP header. - */ - formattedValue: string; + * Metadata about a field. + */ + export interface Schema$FieldMetadata { + /** + * True if the field is the primary field; false if the field is a secondary + * field. + */ + primary: boolean; + /** + * The source of the field. + */ + source: Schema$Source; + /** + * True if the field is verified; false if the field is unverified. A + * verified field is typically a name, email address, phone number, or + * website that has been confirmed to be owned by the person. + */ + verified: boolean; + } /** - * Metadata about the relationship interest. - */ - metadata: Schema$FieldMetadata; + * A person's gender. + */ + export interface Schema$Gender { + /** + * The read-only value of the gender translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedValue: string; + /** + * Metadata about the gender. + */ + metadata: Schema$FieldMetadata; + /** + * The gender for the person. The gender can be custom or predefined. + * Possible values include, but are not limited to, the following: * `male` + * * `female` * `other` * `unknown` + */ + value: string; + } + export interface Schema$GetPeopleResponse { + /** + * The response for each requested resource name. + */ + responses: Schema$PersonResponse[]; + } /** - * The kind of relationship the person is looking for. The value can be custom - * or predefined. Possible values include, but are not limited to, the - * following values: * `friend` * `date` * `relationship` * `networking` - */ - value: string; -} -/** - * A person's read-only relationship status. - */ -export interface Schema$RelationshipStatus { + * A person's instant messaging client. + */ + export interface Schema$ImClient { + /** + * The read-only protocol of the IM client formatted in the viewer's + * account locale or the `Accept-Language` HTTP header locale. + */ + formattedProtocol: string; + /** + * The read-only type of the IM client translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * Metadata about the IM client. + */ + metadata: Schema$FieldMetadata; + /** + * The protocol of the IM client. The protocol can be custom or predefined. + * Possible values include, but are not limited to, the following: * `aim` + * * `msn` * `yahoo` * `skype` * `qq` * `googleTalk` * `icq` * `jabber` * + * `netMeeting` + */ + protocol: string; + /** + * The type of the IM client. The type can be custom or predefined. Possible + * values include, but are not limited to, the following: * `home` * `work` + * * `other` + */ + type: string; + /** + * The user name used in the IM client. + */ + username: string; + } /** - * The read-only value of the relationship status translated and formatted in - * the viewer's account locale or the `Accept-Language` HTTP header - * locale. - */ - formattedValue: string; + * One of the person's interests. + */ + export interface Schema$Interest { + /** + * Metadata about the interest. + */ + metadata: Schema$FieldMetadata; + /** + * The interest; for example, `stargazing`. + */ + value: string; + } + export interface Schema$ListConnectionsResponse { + /** + * The list of people that the requestor is connected to. + */ + connections: Schema$Person[]; + /** + * The token that can be used to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The token that can be used to retrieve changes since the last request. + */ + nextSyncToken: string; + /** + * The total number of items in the list without pagination. + */ + totalItems: number; + /** + * **DEPRECATED** (Please use totalItems) The total number of people in the + * list without pagination. + */ + totalPeople: number; + } /** - * Metadata about the relationship status. - */ - metadata: Schema$FieldMetadata; + * The response to a list contact groups request. + */ + export interface Schema$ListContactGroupsResponse { + /** + * The list of contact groups. Members of the contact groups are not + * populated. + */ + contactGroups: Schema$ContactGroup[]; + /** + * The token that can be used to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The token that can be used to retrieve changes since the last request. + */ + nextSyncToken: string; + /** + * The total number of items in the list without pagination. + */ + totalItems: number; + } /** - * The relationship status. The value can be custom or predefined. Possible - * values include, but are not limited to, the following: * `single` * - * `inARelationship` * `engaged` * `married` * `itsComplicated` * - * `openRelationship` * `widowed` * `inDomesticPartnership` * `inCivilUnion` - */ - value: string; -} -/** - * A person's past or current residence. - */ -export interface Schema$Residence { + * A person's locale preference. + */ + export interface Schema$Locale { + /** + * Metadata about the locale. + */ + metadata: Schema$FieldMetadata; + /** + * The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47) language + * tag representing the locale. + */ + value: string; + } /** - * True if the residence is the person's current residence; false if the - * residence is a past residence. - */ - current: boolean; + * A person's read-only membership in a group. + */ + export interface Schema$Membership { + /** + * The contact group membership. + */ + contactGroupMembership: Schema$ContactGroupMembership; + /** + * The domain membership. + */ + domainMembership: Schema$DomainMembership; + /** + * Metadata about the membership. + */ + metadata: Schema$FieldMetadata; + } /** - * Metadata about the residence. - */ - metadata: Schema$FieldMetadata; + * A request to modify an existing contact group's members. Contacts can + * be removed from any group but they can only be added to a user group or + * myContacts or starred system groups. + */ + export interface Schema$ModifyContactGroupMembersRequest { + /** + * The resource names of the contact people to add in the form of in the + * form `people/`<var>person_id</var>. + */ + resourceNamesToAdd: string[]; + /** + * The resource names of the contact people to remove in the form of in the + * form of `people/`<var>person_id</var>. + */ + resourceNamesToRemove: string[]; + } /** - * The address of the residence. + * The response to a modify contact group members request. */ - value: string; -} -/** - * A skill that the person has. - */ -export interface Schema$Skill { + export interface Schema$ModifyContactGroupMembersResponse { + /** + * The contact people resource names that were not found. + */ + notFoundResourceNames: string[]; + } /** - * Metadata about the skill. - */ - metadata: Schema$FieldMetadata; + * A person's name. If the name is a mononym, the family name is empty. + */ + export interface Schema$Name { + /** + * The read-only display name formatted according to the locale specified by + * the viewer's account or the `Accept-Language` HTTP header. + */ + displayName: string; + /** + * The read-only display name with the last name first formatted according + * to the locale specified by the viewer's account or the + * `Accept-Language` HTTP header. + */ + displayNameLastFirst: string; + /** + * The family name. + */ + familyName: string; + /** + * The given name. + */ + givenName: string; + /** + * The honorific prefixes, such as `Mrs.` or `Dr.` + */ + honorificPrefix: string; + /** + * The honorific suffixes, such as `Jr.` + */ + honorificSuffix: string; + /** + * Metadata about the name. + */ + metadata: Schema$FieldMetadata; + /** + * The middle name(s). + */ + middleName: string; + /** + * The family name spelled as it sounds. + */ + phoneticFamilyName: string; + /** + * The full name spelled as it sounds. + */ + phoneticFullName: string; + /** + * The given name spelled as it sounds. + */ + phoneticGivenName: string; + /** + * The honorific prefixes spelled as they sound. + */ + phoneticHonorificPrefix: string; + /** + * The honorific suffixes spelled as they sound. + */ + phoneticHonorificSuffix: string; + /** + * The middle name(s) spelled as they sound. + */ + phoneticMiddleName: string; + } /** - * The skill; for example, `underwater basket weaving`. - */ - value: string; -} -/** - * The source of a field. - */ -export interface Schema$Source { + * A person's nickname. + */ + export interface Schema$Nickname { + /** + * Metadata about the nickname. + */ + metadata: Schema$FieldMetadata; + /** + * The type of the nickname. + */ + type: string; + /** + * The nickname. + */ + value: string; + } /** - * **Only populated in `person.metadata.sources`.** The [HTTP entity - * tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the source. Used for web - * cache validation. - */ - etag: string; + * A person's occupation. + */ + export interface Schema$Occupation { + /** + * Metadata about the occupation. + */ + metadata: Schema$FieldMetadata; + /** + * The occupation; for example, `carpenter`. + */ + value: string; + } /** - * The unique identifier within the source type generated by the server. - */ - id: string; + * A person's past or current organization. Overlapping date ranges are + * permitted. + */ + export interface Schema$Organization { + /** + * True if the organization is the person's current organization; false + * if the organization is a past organization. + */ + current: boolean; + /** + * The person's department at the organization. + */ + department: string; + /** + * The domain name associated with the organization; for example, + * `google.com`. + */ + domain: string; + /** + * The end date when the person left the organization. + */ + endDate: Schema$Date; + /** + * The read-only type of the organization translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * The person's job description at the organization. + */ + jobDescription: string; + /** + * The location of the organization office the person works at. + */ + location: string; + /** + * Metadata about the organization. + */ + metadata: Schema$FieldMetadata; + /** + * The name of the organization. + */ + name: string; + /** + * The phonetic name of the organization. + */ + phoneticName: string; + /** + * The start date when the person joined the organization. + */ + startDate: Schema$Date; + /** + * The symbol associated with the organization; for example, a stock ticker + * symbol, abbreviation, or acronym. + */ + symbol: string; + /** + * The person's job title at the organization. + */ + title: string; + /** + * The type of the organization. The type can be custom or predefined. + * Possible values include, but are not limited to, the following: * `work` + * * `school` + */ + type: string; + } /** - * **Only populated in `person.metadata.sources`.** Metadata about a source - * of type PROFILE. - */ - profileMetadata: Schema$ProfileMetadata; + * Information about a person merged from various data sources such as the + * authenticated user's contacts and profile data. Most fields can have + * multiple items. The items in a field have no guaranteed order, but each + * non-empty field is guaranteed to have exactly one field with + * `metadata.primary` set to true. + */ + export interface Schema$Person { + /** + * The person's street addresses. + */ + addresses: Schema$Address[]; + /** + * **DEPRECATED** (Please use `person.ageRanges` instead)** The + * person's read-only age range. + */ + ageRange: string; + /** + * The person's read-only age ranges. + */ + ageRanges: Schema$AgeRangeType[]; + /** + * The person's biographies. + */ + biographies: Schema$Biography[]; + /** + * The person's birthdays. + */ + birthdays: Schema$Birthday[]; + /** + * The person's bragging rights. + */ + braggingRights: Schema$BraggingRights[]; + /** + * The person's read-only cover photos. + */ + coverPhotos: Schema$CoverPhoto[]; + /** + * The person's email addresses. + */ + emailAddresses: Schema$EmailAddress[]; + /** + * The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the + * resource. Used for web cache validation. + */ + etag: string; + /** + * The person's events. + */ + events: Schema$Event[]; + /** + * The person's genders. + */ + genders: Schema$Gender[]; + /** + * The person's instant messaging clients. + */ + imClients: Schema$ImClient[]; + /** + * The person's interests. + */ + interests: Schema$Interest[]; + /** + * The person's locale preferences. + */ + locales: Schema$Locale[]; + /** + * The person's read-only group memberships. + */ + memberships: Schema$Membership[]; + /** + * Read-only metadata about the person. + */ + metadata: Schema$PersonMetadata; + /** + * The person's names. + */ + names: Schema$Name[]; + /** + * The person's nicknames. + */ + nicknames: Schema$Nickname[]; + /** + * The person's occupations. + */ + occupations: Schema$Occupation[]; + /** + * The person's past or current organizations. + */ + organizations: Schema$Organization[]; + /** + * The person's phone numbers. + */ + phoneNumbers: Schema$PhoneNumber[]; + /** + * The person's read-only photos. + */ + photos: Schema$Photo[]; + /** + * The person's relations. + */ + relations: Schema$Relation[]; + /** + * The person's read-only relationship interests. + */ + relationshipInterests: Schema$RelationshipInterest[]; + /** + * The person's read-only relationship statuses. + */ + relationshipStatuses: Schema$RelationshipStatus[]; + /** + * The person's residences. + */ + residences: Schema$Residence[]; + /** + * The resource name for the person, assigned by the server. An ASCII string + * with a max length of 27 characters, in the form of + * `people/`<var>person_id</var>. + */ + resourceName: string; + /** + * The person's skills. + */ + skills: Schema$Skill[]; + /** + * The person's read-only taglines. + */ + taglines: Schema$Tagline[]; + /** + * The person's associated URLs. + */ + urls: Schema$Url[]; + /** + * The person's user defined data. + */ + userDefined: Schema$UserDefined[]; + } /** - * The source type. - */ - type: string; + * The read-only metadata about a person. + */ + export interface Schema$PersonMetadata { + /** + * True if the person resource has been deleted. Populated only for + * [`connections.list`](/people/api/rest/v1/people.connections/list) + * requests that include a sync token. + */ + deleted: boolean; + /** + * Resource names of people linked to this resource. + */ + linkedPeopleResourceNames: string[]; + /** + * **DEPRECATED** (Please use + * `person.metadata.sources.profileMetadata.objectType` instead) The type + * of the person object. + */ + objectType: string; + /** + * Any former resource names this person has had. Populated only for + * [`connections.list`](/people/api/rest/v1/people.connections/list) + * requests that include a sync token. The resource name may change when + * adding or removing fields that link a contact and profile such as a + * verified email, verified phone number, or profile URL. + */ + previousResourceNames: string[]; + /** + * The sources of data for the person. + */ + sources: Schema$Source[]; + } /** - * **Only populated in `person.metadata.sources`.** Last update timestamp of - * this source. - */ - updateTime: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * The response for a single person + */ + export interface Schema$PersonResponse { + /** + * **DEPRECATED** (Please use status instead) [HTTP 1.1 status code] + * (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). + */ + httpStatusCode: number; + /** + * The person. + */ + person: Schema$Person; + /** + * The original requested resource name. May be different than the resource + * name on the returned person. The resource name can change when adding or + * removing fields that link a contact and profile such as a verified email, + * verified phone number, or a profile URL. + */ + requestedResourceName: string; + /** + * The status of the response. + */ + status: Schema$Status; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A person's phone number. + */ + export interface Schema$PhoneNumber { + /** + * The read-only canonicalized [ITU-T + * E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) + * form of the phone number. + */ + canonicalForm: string; + /** + * The read-only type of the phone number translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * Metadata about the phone number. + */ + metadata: Schema$FieldMetadata; + /** + * The type of the phone number. The type can be custom or predefined. + * Possible values include, but are not limited to, the following: * `home` + * * `work` * `mobile` * `homeFax` * `workFax` * `otherFax` * `pager` * + * `workMobile` * `workPager` * `main` * `googleVoice` * `other` + */ + type: string; + /** + * The phone number. + */ + value: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * A person's read-only photo. A picture shown next to the person's + * name to help others recognize the person. + */ + export interface Schema$Photo { + /** + * True if the photo is a default photo; false if the photo is a + * user-provided photo. + */ + default: boolean; + /** + * Metadata about the photo. + */ + metadata: Schema$FieldMetadata; + /** + * The URL of the photo. You can change the desired size by appending a + * query parameter `sz=`<var>size</var> at the end of the url. + * Example: + * `https://lh3.googleusercontent.com/-T_wVWLlmg7w/AAAAAAAAAAI/AAAAAAAABa8/00gzXvDBYqw/s100/photo.jpg?sz=50` + */ + url: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A read-only brief one-line description of the person. - */ -export interface Schema$Tagline { + * The read-only metadata about a profile. + */ + export interface Schema$ProfileMetadata { + /** + * The profile object type. + */ + objectType: string; + /** + * The user types. + */ + userTypes: string[]; + } /** - * Metadata about the tagline. - */ - metadata: Schema$FieldMetadata; + * A person's relation to another person. + */ + export interface Schema$Relation { + /** + * The type of the relation translated and formatted in the viewer's + * account locale or the locale specified in the Accept-Language HTTP + * header. + */ + formattedType: string; + /** + * Metadata about the relation. + */ + metadata: Schema$FieldMetadata; + /** + * The name of the other person this relation refers to. + */ + person: string; + /** + * The person's relation to the other person. The type can be custom or + * predefined. Possible values include, but are not limited to, the + * following values: * `spouse` * `child` * `mother` * `father` * `parent` + * * `brother` * `sister` * `friend` * `relative` * `domesticPartner` * + * `manager` * `assistant` * `referredBy` * `partner` + */ + type: string; + } /** - * The tagline. - */ - value: string; -} -/** - * A request to update an existing user contact group. All updated fields will - * be replaced. - */ -export interface Schema$UpdateContactGroupRequest { + * A person's read-only relationship interest . + */ + export interface Schema$RelationshipInterest { + /** + * The value of the relationship interest translated and formatted in the + * viewer's account locale or the locale specified in the + * Accept-Language HTTP header. + */ + formattedValue: string; + /** + * Metadata about the relationship interest. + */ + metadata: Schema$FieldMetadata; + /** + * The kind of relationship the person is looking for. The value can be + * custom or predefined. Possible values include, but are not limited to, + * the following values: * `friend` * `date` * `relationship` * + * `networking` + */ + value: string; + } /** - * The contact group to update. - */ - contactGroup: Schema$ContactGroup; -} -/** - * A person's associated URLs. - */ -export interface Schema$Url { + * A person's read-only relationship status. + */ + export interface Schema$RelationshipStatus { + /** + * The read-only value of the relationship status translated and formatted + * in the viewer's account locale or the `Accept-Language` HTTP header + * locale. + */ + formattedValue: string; + /** + * Metadata about the relationship status. + */ + metadata: Schema$FieldMetadata; + /** + * The relationship status. The value can be custom or predefined. Possible + * values include, but are not limited to, the following: * `single` * + * `inARelationship` * `engaged` * `married` * `itsComplicated` * + * `openRelationship` * `widowed` * `inDomesticPartnership` * `inCivilUnion` + */ + value: string; + } /** - * The read-only type of the URL translated and formatted in the viewer's - * account locale or the `Accept-Language` HTTP header locale. - */ - formattedType: string; + * A person's past or current residence. + */ + export interface Schema$Residence { + /** + * True if the residence is the person's current residence; false if the + * residence is a past residence. + */ + current: boolean; + /** + * Metadata about the residence. + */ + metadata: Schema$FieldMetadata; + /** + * The address of the residence. + */ + value: string; + } /** - * Metadata about the URL. - */ - metadata: Schema$FieldMetadata; + * A skill that the person has. + */ + export interface Schema$Skill { + /** + * Metadata about the skill. + */ + metadata: Schema$FieldMetadata; + /** + * The skill; for example, `underwater basket weaving`. + */ + value: string; + } /** - * The type of the URL. The type can be custom or predefined. Possible values - * include, but are not limited to, the following: * `home` * `work` * `blog` - * * `profile` * `homePage` * `ftp` * `reservations` * `appInstallPage`: - * website for a Google+ application. * `other` - */ - type: string; + * The source of a field. + */ + export interface Schema$Source { + /** + * **Only populated in `person.metadata.sources`.** The [HTTP entity + * tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the source. Used for web + * cache validation. + */ + etag: string; + /** + * The unique identifier within the source type generated by the server. + */ + id: string; + /** + * **Only populated in `person.metadata.sources`.** Metadata about a source + * of type PROFILE. + */ + profileMetadata: Schema$ProfileMetadata; + /** + * The source type. + */ + type: string; + /** + * **Only populated in `person.metadata.sources`.** Last update timestamp + * of this source. + */ + updateTime: string; + } /** - * The URL. - */ - value: string; -} -/** - * Arbitrary user data that is populated by the end users. - */ -export interface Schema$UserDefined { + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The end user specified key of the user defined data. - */ - key: string; + * A read-only brief one-line description of the person. + */ + export interface Schema$Tagline { + /** + * Metadata about the tagline. + */ + metadata: Schema$FieldMetadata; + /** + * The tagline. + */ + value: string; + } /** - * Metadata about the user defined data. + * A request to update an existing user contact group. All updated fields will + * be replaced. */ - metadata: Schema$FieldMetadata; + export interface Schema$UpdateContactGroupRequest { + /** + * The contact group to update. + */ + contactGroup: Schema$ContactGroup; + } /** - * The end user specified value of the user defined data. - */ - value: string; -} - -export class Resource$Contactgroups { - root: People; - members: Resource$Contactgroups$Members; - constructor(root: People) { - this.root = root; - this.getRoot.bind(this); - this.members = new Resource$Contactgroups$Members(root); + * A person's associated URLs. + */ + export interface Schema$Url { + /** + * The read-only type of the URL translated and formatted in the + * viewer's account locale or the `Accept-Language` HTTP header locale. + */ + formattedType: string; + /** + * Metadata about the URL. + */ + metadata: Schema$FieldMetadata; + /** + * The type of the URL. The type can be custom or predefined. Possible + * values include, but are not limited to, the following: * `home` * `work` + * * `blog` * `profile` * `homePage` * `ftp` * `reservations` * + * `appInstallPage`: website for a Google+ application. * `other` + */ + type: string; + /** + * The URL. + */ + value: string; } - - getRoot() { - return this.root; + /** + * Arbitrary user data that is populated by the end users. + */ + export interface Schema$UserDefined { + /** + * The end user specified key of the user defined data. + */ + key: string; + /** + * Metadata about the user defined data. + */ + metadata: Schema$FieldMetadata; + /** + * The end user specified value of the user defined data. + */ + value: string; } - - /** - * people.contactGroups.batchGet - * @desc Get a list of contact groups owned by the authenticated user by - * specifying a list of contact group resource names. - * @alias people.contactGroups.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxMembers Specifies the maximum number of members to return for each group. - * @param {string=} params.resourceNames The resource names of the contact groups to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Contactgroups { + root: People; + members: Resource$Contactgroups$Members; + constructor(root: People) { + this.root = root; + this.getRoot.bind(this); + this.members = new Resource$Contactgroups$Members(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/contactGroups:batchGet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * people.contactGroups.create - * @desc Create a new contact group owned by the authenticated user. - * @alias people.contactGroups.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CreateContactGroupRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.contactGroups.batchGet + * @desc Get a list of contact groups owned by the authenticated user by + * specifying a list of contact group resource names. + * @alias people.contactGroups.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxMembers Specifies the maximum number of members to return for each group. + * @param {string=} params.resourceNames The resource names of the contact groups to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/contactGroups:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/contactGroups').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.contactGroups.delete - * @desc Delete an existing contact group owned by the authenticated user by - * specifying a contact group resource name. - * @alias people.contactGroups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.deleteContacts Set to true to also delete the contacts in the specified group. - * @param {string} params.resourceName The resource name of the contact group to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.contactGroups.create + * @desc Create a new contact group owned by the authenticated user. + * @alias people.contactGroups.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CreateContactGroupRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/contactGroups').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+resourceName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.contactGroups.get - * @desc Get a specific contact group owned by the authenticated user by - * specifying a contact group resource name. - * @alias people.contactGroups.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxMembers Specifies the maximum number of members to return. - * @param {string} params.resourceName The resource name of the contact group to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.contactGroups.delete + * @desc Delete an existing contact group owned by the authenticated user by + * specifying a contact group resource name. + * @alias people.contactGroups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.deleteContacts Set to true to also delete the contacts in the specified group. + * @param {string} params.resourceName The resource name of the contact group to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+resourceName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.contactGroups.list - * @desc List all contact groups owned by the authenticated user. Members of - * the contact groups are not populated. - * @alias people.contactGroups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of resources to return. - * @param {string=} params.pageToken The next_page_token value returned from a previous call to [ListContactGroups](/people/api/rest/v1/contactgroups/list). Requests the next page of resources. - * @param {string=} params.syncToken A sync token, returned by a previous call to `contactgroups.list`. Only resources changed since the sync token was created will be returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.contactGroups.get + * @desc Get a specific contact group owned by the authenticated user by + * specifying a contact group resource name. + * @alias people.contactGroups.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxMembers Specifies the maximum number of members to return. + * @param {string} params.resourceName The resource name of the contact group to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/contactGroups').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.contactGroups.update - * @desc Update the name of an existing contact group owned by the - * authenticated user. - * @alias people.contactGroups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceName The resource name for the contact group, assigned by the server. An ASCII string, in the form of `contactGroups/`contact_group_id. - * @param {().UpdateContactGroupRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.contactGroups.list + * @desc List all contact groups owned by the authenticated user. Members of + * the contact groups are not populated. + * @alias people.contactGroups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of resources to return. + * @param {string=} params.pageToken The next_page_token value returned from a previous call to [ListContactGroups](/people/api/rest/v1/contactgroups/list). Requests the next page of resources. + * @param {string=} params.syncToken A sync token, returned by a previous call to `contactgroups.list`. Only resources changed since the sync token was created will be returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/contactGroups').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+resourceName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Contactgroups$Members { - root: People; - constructor(root: People) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * people.contactGroups.members.modify - * @desc Modify the members of a contact group owned by the authenticated - * user. - * @alias people.contactGroups.members.modify - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceName The resource name of the contact group to modify. - * @param {().ModifyContactGroupMembersRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modify(params?: any, options?: MethodOptions): - AxiosPromise; - modify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - modify( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resourceName}/members:modify') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * people.contactGroups.update + * @desc Update the name of an existing contact group owned by the + * authenticated user. + * @alias people.contactGroups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceName The resource name for the contact group, assigned by the server. An ASCII string, in the form of `contactGroups/`contact_group_id. + * @param {().UpdateContactGroupRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} + export class Resource$Contactgroups$Members { + root: People; + constructor(root: People) { + this.root = root; + this.getRoot.bind(this); + } + getRoot() { + return this.root; + } -export class Resource$People { - root: People; - connections: Resource$People$Connections; - constructor(root: People) { - this.root = root; - this.getRoot.bind(this); - this.connections = new Resource$People$Connections(root); - } - getRoot() { - return this.root; + /** + * people.contactGroups.members.modify + * @desc Modify the members of a contact group owned by the authenticated + * user. + * @alias people.contactGroups.members.modify + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceName The resource name of the contact group to modify. + * @param {().ModifyContactGroupMembersRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modify(params?: any, options?: MethodOptions): + AxiosPromise; + modify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + modify( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}/members:modify') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - /** - * people.people.createContact - * @desc Create a new contact and return the person resource for that contact. - * @alias people.people.createContact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent The resource name of the owning person resource. - * @param {().Person} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createContact(params?: any, options?: MethodOptions): - AxiosPromise; - createContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$People { + root: People; + connections: Resource$People$Connections; + constructor(root: People) { + this.root = root; + this.getRoot.bind(this); + this.connections = new Resource$People$Connections(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/people:createContact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * people.people.deleteContact - * @desc Delete a contact person. Any non-contact data will not be deleted. - * @alias people.people.deleteContact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceName The resource name of the contact to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteContact(params?: any, options?: MethodOptions): - AxiosPromise; - deleteContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.people.createContact + * @desc Create a new contact and return the person resource for that + * contact. + * @alias people.people.createContact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent The resource name of the owning person resource. + * @param {().Person} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createContact(params?: any, options?: MethodOptions): + AxiosPromise; + createContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/people:createContact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resourceName}:deleteContact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.people.get - * @desc Provides information about a person by specifying a resource name. - * Use `people/me` to indicate the authenticated user.
The request throws - * a 400 error if 'personFields' is not specified. - * @alias people.people.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.personFields **Required.** A field mask to restrict which fields on the person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls - * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. - * @param {string} params.resourceName The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about a google account, specify `people/`account_id. - To get information about a contact, specify the resource name that identifies the contact as returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.people.deleteContact + * @desc Delete a contact person. Any non-contact data will not be deleted. + * @alias people.people.deleteContact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceName The resource name of the contact to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteContact(params?: any, options?: MethodOptions): + AxiosPromise; + deleteContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}:deleteContact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+resourceName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.people.getBatchGet - * @desc Provides information about a list of specific people by specifying a - * list of requested resource names. Use `people/me` to indicate the - * authenticated user.
The request throws a 400 error if 'personFields' - * is not specified. - * @alias people.people.getBatchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.personFields **Required.** A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls - * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. - * @param {string=} params.resourceNames The resource names of the people to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about a google account, specify `people/`account_id. - To get information about a contact, specify the resource name that identifies the contact as returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). You can include up to 50 resource names in one request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getBatchGet(params?: any, options?: MethodOptions): - AxiosPromise; - getBatchGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getBatchGet( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.people.get + * @desc Provides information about a person by specifying a resource name. + * Use `people/me` to indicate the authenticated user.
The request + * throws a 400 error if 'personFields' is not specified. + * @alias people.people.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.personFields **Required.** A field mask to restrict which fields on the person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls + * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. + * @param {string} params.resourceName The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about a google account, specify `people/`account_id. - To get information about a contact, specify the resource name that identifies the contact as returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/people:batchGet').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * people.people.updateContact - * @desc Update contact data for an existing contact person. Any non-contact - * data will not be modified. The request throws a 400 error if - * `updatePersonFields` is not specified.
The request throws a 400 error - * if `person.metadata.sources` is not specified for the contact to be - * updated.
The request throws a 412 error if - * `person.metadata.sources.etag` is different than the contact's etag, which - * indicates the contact has changed since its data was read. Clients should - * get the latest person and re-apply their updates to the latest person. - * @alias people.people.updateContact - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceName The resource name for the person, assigned by the server. An ASCII string with a max length of 27 characters, in the form of `people/`person_id. - * @param {string=} params.updatePersonFields **Required.** A field mask to restrict which fields on the person are updated. Multiple fields can be specified by separating them with commas. All updated fields will be replaced. Valid values are: * addresses * biographies * birthdays * emailAddresses * events * genders * imClients * interests * locales * names * nicknames * occupations * organizations * phoneNumbers * relations * residences * urls - * @param {().Person} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateContact(params?: any, options?: MethodOptions): - AxiosPromise; - updateContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateContact( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * people.people.getBatchGet + * @desc Provides information about a list of specific people by specifying + * a list of requested resource names. Use `people/me` to indicate the + * authenticated user.
The request throws a 400 error if 'personFields' + * is not specified. + * @alias people.people.getBatchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.personFields **Required.** A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls + * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. + * @param {string=} params.resourceNames The resource names of the people to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about a google account, specify `people/`account_id. - To get information about a contact, specify the resource name that identifies the contact as returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). You can include up to 50 resource names in one request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getBatchGet(params?: any, options?: MethodOptions): + AxiosPromise; + getBatchGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getBatchGet( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/people:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resourceName}:updateContact') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * people.people.updateContact + * @desc Update contact data for an existing contact person. Any non-contact + * data will not be modified. The request throws a 400 error if + * `updatePersonFields` is not specified.
The request throws a 400 + * error if `person.metadata.sources` is not specified for the contact to be + * updated.
The request throws a 412 error if + * `person.metadata.sources.etag` is different than the contact's etag, + * which indicates the contact has changed since its data was read. Clients + * should get the latest person and re-apply their updates to the latest + * person. + * @alias people.people.updateContact + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceName The resource name for the person, assigned by the server. An ASCII string with a max length of 27 characters, in the form of `people/`person_id. + * @param {string=} params.updatePersonFields **Required.** A field mask to restrict which fields on the person are updated. Multiple fields can be specified by separating them with commas. All updated fields will be replaced. Valid values are: * addresses * biographies * birthdays * emailAddresses * events * genders * imClients * interests * locales * names * nicknames * occupations * organizations * phoneNumbers * relations * residences * urls + * @param {().Person} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateContact(params?: any, options?: MethodOptions): + AxiosPromise; + updateContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateContact( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}:updateContact') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$People$Connections { - root: People; - constructor(root: People) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$People$Connections { + root: People; + constructor(root: People) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * people.people.connections.list - * @desc Provides a list of the authenticated user's contacts merged with any - * connected profiles.
The request throws a 400 error if 'personFields' - * is not specified. - * @alias people.people.connections.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The number of connections to include in the response. Valid values are between 1 and 2000, inclusive. Defaults to 100. - * @param {string=} params.pageToken The token of the page to be returned. - * @param {string=} params.personFields **Required.** A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls - * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. - * @param {boolean=} params.requestSyncToken Whether the response should include a sync token, which can be used to get all changes since the last request. For subsequent sync requests use the `sync_token` param instead. Initial sync requests that specify `request_sync_token` have an additional rate limit. - * @param {string} params.resourceName The resource name to return connections for. Only `people/me` is valid. - * @param {string=} params.sortOrder The order in which the connections should be sorted. Defaults to `LAST_MODIFIED_ASCENDING`. - * @param {string=} params.syncToken A sync token returned by a previous call to `people.connections.list`. Only resources changed since the sync token was created will be returned. Sync requests that specify `sync_token` have an additional rate limit. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resourceName}/connections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * people.people.connections.list + * @desc Provides a list of the authenticated user's contacts merged with + * any connected profiles.
The request throws a 400 error if + * 'personFields' is not specified. + * @alias people.people.connections.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The number of connections to include in the response. Valid values are between 1 and 2000, inclusive. Defaults to 100. + * @param {string=} params.pageToken The token of the page to be returned. + * @param {string=} params.personFields **Required.** A field mask to restrict which fields on each person are returned. Multiple fields can be specified by separating them with commas. Valid values are: * addresses * ageRanges * biographies * birthdays * braggingRights * coverPhotos * emailAddresses * events * genders * imClients * interests * locales * memberships * metadata * names * nicknames * occupations * organizations * phoneNumbers * photos * relations * relationshipInterests * relationshipStatuses * residences * skills * taglines * urls + * @param {string=} params.requestMask.includeField **Required.** Comma-separated list of person fields to be included in the response. Each path should start with `person.`: for example, `person.names` or `person.photos`. + * @param {boolean=} params.requestSyncToken Whether the response should include a sync token, which can be used to get all changes since the last request. For subsequent sync requests use the `sync_token` param instead. Initial sync requests that specify `request_sync_token` have an additional rate limit. + * @param {string} params.resourceName The resource name to return connections for. Only `people/me` is valid. + * @param {string=} params.sortOrder The order in which the connections should be sorted. Defaults to `LAST_MODIFIED_ASCENDING`. + * @param {string=} params.syncToken A sync token returned by a previous call to `people.connections.list`. Only resources changed since the sync token was created will be returned. Sync requests that specify `sync_token` have an additional rate limit. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://people.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resourceName}/connections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/playcustomapp/v1.ts b/src/apis/playcustomapp/v1.ts index a9d59467986..9d4f9695cb2 100644 --- a/src/apis/playcustomapp/v1.ts +++ b/src/apis/playcustomapp/v1.ts @@ -27,137 +27,141 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Play Custom App Publishing API - * - * An API to publish custom Android apps. - * - * @example - * const google = require('googleapis'); - * const playcustomapp = google.playcustomapp('v1'); - * - * @namespace playcustomapp - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Playcustomapp - */ -export class Playcustomapp { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace playcustomapp_v1 { + /** + * Google Play Custom App Publishing API + * + * An API to publish custom Android apps. + * + * @example + * const google = require('googleapis'); + * const playcustomapp = google.playcustomapp('v1'); + * + * @namespace playcustomapp + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Playcustomapp + */ + export class Playcustomapp { + _options: GlobalOptions; + google: GoogleApis; + root = this; - accounts: Resource$Accounts; + accounts: Resource$Accounts; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.accounts = new Resource$Accounts(this); - } + this.accounts = new Resource$Accounts(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * This resource represents a custom app. - */ -export interface Schema$CustomApp { /** - * Default listing language in BCP 47 format. + * This resource represents a custom app. */ - languageCode: string; - /** - * Title for the Android app. - */ - title: string; -} - -export class Resource$Accounts { - root: Playcustomapp; - customApps: Resource$Accounts$Customapps; - constructor(root: Playcustomapp) { - this.root = root; - this.getRoot.bind(this); - this.customApps = new Resource$Accounts$Customapps(root); + export interface Schema$CustomApp { + /** + * Default listing language in BCP 47 format. + */ + languageCode: string; + /** + * Title for the Android app. + */ + title: string; } - getRoot() { - return this.root; - } -} -export class Resource$Accounts$Customapps { - root: Playcustomapp; - constructor(root: Playcustomapp) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Accounts { + root: Playcustomapp; + customApps: Resource$Accounts$Customapps; + constructor(root: Playcustomapp) { + this.root = root; + this.getRoot.bind(this); + this.customApps = new Resource$Accounts$Customapps(root); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } - - - /** - * playcustomapp.accounts.customApps.create - * @desc Create and publish a new custom app. - * @alias playcustomapp.accounts.customApps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.account Developer account ID. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts$Customapps { + root: Playcustomapp; + constructor(root: Playcustomapp) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/playcustomapp/v1/accounts/{account}/customApps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + '/upload/playcustomapp/v1/accounts/{account}/customApps') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['account'], - pathParams: ['account'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * playcustomapp.accounts.customApps.create + * @desc Create and publish a new custom app. + * @alias playcustomapp.accounts.customApps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.account Developer account ID. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/playcustomapp/v1/accounts/{account}/customApps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: + (rootUrl + '/upload/playcustomapp/v1/accounts/{account}/customApps') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['account'], + pathParams: ['account'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/plus/v1.ts b/src/apis/plus/v1.ts index 9d9b4049708..8b6212c3672 100644 --- a/src/apis/plus/v1.ts +++ b/src/apis/plus/v1.ts @@ -27,1039 +27,1048 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google+ API - * - * Builds on top of the Google+ platform. - * - * @example - * const google = require('googleapis'); - * const plus = google.plus('v1'); - * - * @namespace plus - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Plus - */ -export class Plus { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace plus_v1 { + /** + * Google+ API + * + * Builds on top of the Google+ platform. + * + * @example + * const google = require('googleapis'); + * const plus = google.plus('v1'); + * + * @namespace plus + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Plus + */ + export class Plus { + _options: GlobalOptions; + google: GoogleApis; + root = this; - activities: Resource$Activities; - comments: Resource$Comments; - people: Resource$People; + activities: Resource$Activities; + comments: Resource$Comments; + people: Resource$People; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.activities = new Resource$Activities(this); - this.comments = new Resource$Comments(this); - this.people = new Resource$People(this); - } + this.activities = new Resource$Activities(this); + this.comments = new Resource$Comments(this); + this.people = new Resource$People(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$Acl { - /** - * Description of the access granted, suitable for display. - */ - description: string; - /** - * The list of access entries. - */ - items: Schema$PlusAclentryResource[]; - /** - * Identifies this resource as a collection of access controls. Value: - * "plus#acl". - */ - kind: string; -} -export interface Schema$Activity { - /** - * Identifies who has access to see this activity. - */ - access: Schema$Acl; - /** - * The person who performed this activity. - */ - actor: any; - /** - * Street address where this activity occurred. - */ - address: string; - /** - * Additional content added by the person who shared this activity, applicable - * only when resharing an activity. - */ - annotation: string; - /** - * If this activity is a crosspost from another system, this property - * specifies the ID of the original activity. - */ - crosspostSource: string; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * Latitude and longitude where this activity occurred. Format is latitude - * followed by longitude, space separated. - */ - geocode: string; - /** - * The ID of this activity. - */ - id: string; - /** - * Identifies this resource as an activity. Value: "plus#activity". - */ - kind: string; - /** - * The location where this activity occurred. - */ - location: Schema$Place; - /** - * The object of this activity. - */ - object: any; - /** - * ID of the place where this activity occurred. - */ - placeId: string; - /** - * Name of the place where this activity occurred. - */ - placeName: string; - /** - * The service provider that initially published this activity. - */ - provider: any; - /** - * The time at which this activity was initially published. Formatted as an - * RFC 3339 timestamp. - */ - published: string; - /** - * Radius, in meters, of the region where this activity occurred, centered at - * the latitude and longitude identified in geocode. - */ - radius: string; - /** - * Title of this activity. - */ - title: string; - /** - * The time at which this activity was last updated. Formatted as an RFC 3339 - * timestamp. - */ - updated: string; - /** - * The link to this activity. - */ - url: string; - /** - * This activity's verb, which indicates the action that was performed. - * Possible values include, but are not limited to, the following values: - - * "post" - Publish content to the stream. - "share" - - * Reshare an activity. - */ - verb: string; -} -export interface Schema$ActivityFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this collection of activities. Deprecated. - */ - id: string; - /** - * The activities in this page of results. - */ - items: Schema$Activity[]; - /** - * Identifies this resource as a collection of activities. Value: - * "plus#activityFeed". - */ - kind: string; - /** - * Link to the next page of activities. - */ - nextLink: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Link to this activity resource. - */ - selfLink: string; - /** - * The title of this collection of activities, which is a truncated portion of - * the content. - */ - title: string; - /** - * The time at which this collection of activities was last updated. Formatted - * as an RFC 3339 timestamp. - */ - updated: string; -} -export interface Schema$Comment { - /** - * The person who posted this comment. - */ - actor: any; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this comment. - */ - id: string; - /** - * The activity this comment replied to. - */ - inReplyTo: any[]; - /** - * Identifies this resource as a comment. Value: "plus#comment". - */ - kind: string; - /** - * The object of this comment. - */ - object: any; - /** - * People who +1'd this comment. - */ - plusoners: any; - /** - * The time at which this comment was initially published. Formatted as an RFC - * 3339 timestamp. - */ - published: string; - /** - * Link to this comment resource. - */ - selfLink: string; - /** - * The time at which this comment was last updated. Formatted as an RFC 3339 - * timestamp. - */ - updated: string; - /** - * This comment's verb, indicating what action was performed. Possible - * values are: - "post" - Publish content to the stream. - */ - verb: string; -} -export interface Schema$CommentFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this collection of comments. - */ - id: string; - /** - * The comments in this page of results. - */ - items: Schema$Comment[]; - /** - * Identifies this resource as a collection of comments. Value: - * "plus#commentFeed". - */ - kind: string; - /** - * Link to the next page of activities. - */ - nextLink: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * The title of this collection of comments. - */ - title: string; - /** - * The time at which this collection of comments was last updated. Formatted - * as an RFC 3339 timestamp. - */ - updated: string; -} -export interface Schema$PeopleFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The people in this page of results. Each item includes the id, displayName, - * image, and url for the person. To retrieve additional profile data, see the - * people.get method. - */ - items: Schema$Person[]; - /** - * Identifies this resource as a collection of people. Value: - * "plus#peopleFeed". - */ - kind: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Link to this resource. - */ - selfLink: string; - /** - * The title of this collection of people. - */ - title: string; - /** - * The total number of people available in this list. The number of people in - * a response might be smaller due to paging. This might not be set for all - * collections. - */ - totalItems: number; -} -export interface Schema$Person { - /** - * A short biography for this person. - */ - aboutMe: string; - /** - * The age range of the person. Valid ranges are 17 or younger, 18 to 20, and - * 21 or older. Age is determined from the user's birthday using Western - * age reckoning. - */ - ageRange: any; - /** - * The person's date of birth, represented as YYYY-MM-DD. - */ - birthday: string; - /** - * The "bragging rights" line of this person. - */ - braggingRights: string; - /** - * For followers who are visible, the number of people who have added this - * person or page to a circle. - */ - circledByCount: number; - /** - * The cover photo content. - */ - cover: any; - /** - * (this field is not currently used) - */ - currentLocation: string; - /** - * The name of this person, which is suitable for display. - */ - displayName: string; - /** - * The hosted domain name for the user's Google Apps account. For - * instance, example.com. The plus.profile.emails.read or email scope is - * needed to get this domain name. - */ - domain: string; - /** - * A list of email addresses that this person has, including their Google - * account email address, and the public verified email addresses on their - * Google+ profile. The plus.profile.emails.read scope is needed to retrieve - * these email addresses, or the email scope can be used to retrieve just the - * Google account email address. - */ - emails: any[]; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The person's gender. Possible values include, but are not limited to, - * the following values: - "male" - Male gender. - - * "female" - Female gender. - "other" - Other. - */ - gender: string; - /** - * The ID of this person. - */ - id: string; - /** - * The representation of the person's profile photo. - */ - image: any; - /** - * Whether this user has signed up for Google+. - */ - isPlusUser: boolean; - /** - * Identifies this resource as a person. Value: "plus#person". - */ - kind: string; - /** - * The user's preferred language for rendering. - */ - language: string; - /** - * An object representation of the individual components of a person's - * name. - */ - name: any; - /** - * The nickname of this person. - */ - nickname: string; - /** - * Type of person within Google+. Possible values include, but are not limited - * to, the following values: - "person" - represents an actual - * person. - "page" - represents a page. - */ - objectType: string; - /** - * The occupation of this person. - */ - occupation: string; - /** - * A list of current or past organizations with which this person is - * associated. - */ - organizations: any[]; - /** - * A list of places where this person has lived. - */ - placesLived: any[]; - /** - * If a Google+ Page, the number of people who have +1'd this page. - */ - plusOneCount: number; - /** - * The person's relationship status. Possible values include, but are not - * limited to, the following values: - "single" - Person is - * single. - "in_a_relationship" - Person is in a relationship. - - * "engaged" - Person is engaged. - "married" - Person is - * married. - "its_complicated" - The relationship is complicated. - * - "open_relationship" - Person is in an open relationship. - - * "widowed" - Person is widowed. - - * "in_domestic_partnership" - Person is in a domestic partnership. - * - "in_civil_union" - Person is in a civil union. - */ - relationshipStatus: string; - /** - * The person's skills. - */ - skills: string; - /** - * The brief description (tagline) of this person. - */ - tagline: string; - /** - * The URL of this person's profile. - */ - url: string; - /** - * A list of URLs for this person. - */ - urls: any[]; - /** - * Whether the person or Google+ Page has been verified. - */ - verified: boolean; -} -export interface Schema$Place { - /** - * The physical address of the place. - */ - address: any; - /** - * The display name of the place. - */ - displayName: string; - /** - * The id of the place. - */ - id: string; - /** - * Identifies this resource as a place. Value: "plus#place". - */ - kind: string; - /** - * The position of the place. - */ - position: any; -} -export interface Schema$PlusAclentryResource { - /** - * A descriptive name for this entry. Suitable for display. - */ - displayName: string; - /** - * The ID of the entry. For entries of type "person" or - * "circle", this is the ID of the resource. For other types, this - * property is not set. - */ - id: string; - /** - * The type of entry describing to whom access is granted. Possible values - * are: - "person" - Access to an individual. - - * "circle" - Access to members of a circle. - - * "myCircles" - Access to members of all the person's circles. - * - "extendedCircles" - Access to members of all the person's - * circles, plus all of the people in their circles. - "domain" - - * Access to members of the person's Google Apps domain. - - * "public" - Access to anyone on the web. - */ - type: string; -} -export class Resource$Activities { - root: Plus; - constructor(root: Plus) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Acl { + /** + * Description of the access granted, suitable for display. + */ + description: string; + /** + * The list of access entries. + */ + items: Schema$PlusAclentryResource[]; + /** + * Identifies this resource as a collection of access controls. Value: + * "plus#acl". + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$Activity { + /** + * Identifies who has access to see this activity. + */ + access: Schema$Acl; + /** + * The person who performed this activity. + */ + actor: any; + /** + * Street address where this activity occurred. + */ + address: string; + /** + * Additional content added by the person who shared this activity, + * applicable only when resharing an activity. + */ + annotation: string; + /** + * If this activity is a crosspost from another system, this property + * specifies the ID of the original activity. + */ + crosspostSource: string; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * Latitude and longitude where this activity occurred. Format is latitude + * followed by longitude, space separated. + */ + geocode: string; + /** + * The ID of this activity. + */ + id: string; + /** + * Identifies this resource as an activity. Value: + * "plus#activity". + */ + kind: string; + /** + * The location where this activity occurred. + */ + location: Schema$Place; + /** + * The object of this activity. + */ + object: any; + /** + * ID of the place where this activity occurred. + */ + placeId: string; + /** + * Name of the place where this activity occurred. + */ + placeName: string; + /** + * The service provider that initially published this activity. + */ + provider: any; + /** + * The time at which this activity was initially published. Formatted as an + * RFC 3339 timestamp. + */ + published: string; + /** + * Radius, in meters, of the region where this activity occurred, centered + * at the latitude and longitude identified in geocode. + */ + radius: string; + /** + * Title of this activity. + */ + title: string; + /** + * The time at which this activity was last updated. Formatted as an RFC + * 3339 timestamp. + */ + updated: string; + /** + * The link to this activity. + */ + url: string; + /** + * This activity's verb, which indicates the action that was performed. + * Possible values include, but are not limited to, the following values: - + * "post" - Publish content to the stream. - "share" - + * Reshare an activity. + */ + verb: string; + } + export interface Schema$ActivityFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this collection of activities. Deprecated. + */ + id: string; + /** + * The activities in this page of results. + */ + items: Schema$Activity[]; + /** + * Identifies this resource as a collection of activities. Value: + * "plus#activityFeed". + */ + kind: string; + /** + * Link to the next page of activities. + */ + nextLink: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Link to this activity resource. + */ + selfLink: string; + /** + * The title of this collection of activities, which is a truncated portion + * of the content. + */ + title: string; + /** + * The time at which this collection of activities was last updated. + * Formatted as an RFC 3339 timestamp. + */ + updated: string; + } + export interface Schema$Comment { + /** + * The person who posted this comment. + */ + actor: any; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this comment. + */ + id: string; + /** + * The activity this comment replied to. + */ + inReplyTo: any[]; + /** + * Identifies this resource as a comment. Value: "plus#comment". + */ + kind: string; + /** + * The object of this comment. + */ + object: any; + /** + * People who +1'd this comment. + */ + plusoners: any; + /** + * The time at which this comment was initially published. Formatted as an + * RFC 3339 timestamp. + */ + published: string; + /** + * Link to this comment resource. + */ + selfLink: string; + /** + * The time at which this comment was last updated. Formatted as an RFC 3339 + * timestamp. + */ + updated: string; + /** + * This comment's verb, indicating what action was performed. Possible + * values are: - "post" - Publish content to the stream. + */ + verb: string; + } + export interface Schema$CommentFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this collection of comments. + */ + id: string; + /** + * The comments in this page of results. + */ + items: Schema$Comment[]; + /** + * Identifies this resource as a collection of comments. Value: + * "plus#commentFeed". + */ + kind: string; + /** + * Link to the next page of activities. + */ + nextLink: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * The title of this collection of comments. + */ + title: string; + /** + * The time at which this collection of comments was last updated. Formatted + * as an RFC 3339 timestamp. + */ + updated: string; + } + export interface Schema$PeopleFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The people in this page of results. Each item includes the id, + * displayName, image, and url for the person. To retrieve additional + * profile data, see the people.get method. + */ + items: Schema$Person[]; + /** + * Identifies this resource as a collection of people. Value: + * "plus#peopleFeed". + */ + kind: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Link to this resource. + */ + selfLink: string; + /** + * The title of this collection of people. + */ + title: string; + /** + * The total number of people available in this list. The number of people + * in a response might be smaller due to paging. This might not be set for + * all collections. + */ + totalItems: number; + } + export interface Schema$Person { + /** + * A short biography for this person. + */ + aboutMe: string; + /** + * The age range of the person. Valid ranges are 17 or younger, 18 to 20, + * and 21 or older. Age is determined from the user's birthday using + * Western age reckoning. + */ + ageRange: any; + /** + * The person's date of birth, represented as YYYY-MM-DD. + */ + birthday: string; + /** + * The "bragging rights" line of this person. + */ + braggingRights: string; + /** + * For followers who are visible, the number of people who have added this + * person or page to a circle. + */ + circledByCount: number; + /** + * The cover photo content. + */ + cover: any; + /** + * (this field is not currently used) + */ + currentLocation: string; + /** + * The name of this person, which is suitable for display. + */ + displayName: string; + /** + * The hosted domain name for the user's Google Apps account. For + * instance, example.com. The plus.profile.emails.read or email scope is + * needed to get this domain name. + */ + domain: string; + /** + * A list of email addresses that this person has, including their Google + * account email address, and the public verified email addresses on their + * Google+ profile. The plus.profile.emails.read scope is needed to retrieve + * these email addresses, or the email scope can be used to retrieve just + * the Google account email address. + */ + emails: any[]; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The person's gender. Possible values include, but are not limited to, + * the following values: - "male" - Male gender. - + * "female" - Female gender. - "other" - Other. + */ + gender: string; + /** + * The ID of this person. + */ + id: string; + /** + * The representation of the person's profile photo. + */ + image: any; + /** + * Whether this user has signed up for Google+. + */ + isPlusUser: boolean; + /** + * Identifies this resource as a person. Value: "plus#person". + */ + kind: string; + /** + * The user's preferred language for rendering. + */ + language: string; + /** + * An object representation of the individual components of a person's + * name. + */ + name: any; + /** + * The nickname of this person. + */ + nickname: string; + /** + * Type of person within Google+. Possible values include, but are not + * limited to, the following values: - "person" - represents an + * actual person. - "page" - represents a page. + */ + objectType: string; + /** + * The occupation of this person. + */ + occupation: string; + /** + * A list of current or past organizations with which this person is + * associated. + */ + organizations: any[]; + /** + * A list of places where this person has lived. + */ + placesLived: any[]; + /** + * If a Google+ Page, the number of people who have +1'd this page. + */ + plusOneCount: number; + /** + * The person's relationship status. Possible values include, but are + * not limited to, the following values: - "single" - Person is + * single. - "in_a_relationship" - Person is in a relationship. + * - "engaged" - Person is engaged. - "married" - + * Person is married. - "its_complicated" - The relationship is + * complicated. - "open_relationship" - Person is in an open + * relationship. - "widowed" - Person is widowed. - + * "in_domestic_partnership" - Person is in a domestic + * partnership. - "in_civil_union" - Person is in a civil union. + */ + relationshipStatus: string; + /** + * The person's skills. + */ + skills: string; + /** + * The brief description (tagline) of this person. + */ + tagline: string; + /** + * The URL of this person's profile. + */ + url: string; + /** + * A list of URLs for this person. + */ + urls: any[]; + /** + * Whether the person or Google+ Page has been verified. + */ + verified: boolean; + } + export interface Schema$Place { + /** + * The physical address of the place. + */ + address: any; + /** + * The display name of the place. + */ + displayName: string; + /** + * The id of the place. + */ + id: string; + /** + * Identifies this resource as a place. Value: "plus#place". + */ + kind: string; + /** + * The position of the place. + */ + position: any; + } + export interface Schema$PlusAclentryResource { + /** + * A descriptive name for this entry. Suitable for display. + */ + displayName: string; + /** + * The ID of the entry. For entries of type "person" or + * "circle", this is the ID of the resource. For other types, this + * property is not set. + */ + id: string; + /** + * The type of entry describing to whom access is granted. Possible values + * are: - "person" - Access to an individual. - + * "circle" - Access to members of a circle. - + * "myCircles" - Access to members of all the person's + * circles. - "extendedCircles" - Access to members of all the + * person's circles, plus all of the people in their circles. - + * "domain" - Access to members of the person's Google Apps + * domain. - "public" - Access to anyone on the web. + */ + type: string; } - - /** - * plus.activities.get - * @desc Get an activity. - * @alias plus.activities.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Activities { + root: Plus; + constructor(root: Plus) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/activities/{activityId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId'], - pathParams: ['activityId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plus.activities.list - * @desc List all of the activities in the specified collection for a - * particular user. - * @alias plus.activities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of activities to list. - * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * plus.activities.get + * @desc Get an activity. + * @alias plus.activities.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/activities/{activityId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId'], + pathParams: ['activityId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/people/{userId}/activities/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'collection'], - pathParams: ['collection', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plus.activities.search - * @desc Search public activities. - * @alias plus.activities.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language Specify the preferred language to search with. See search language codes for available values. - * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.orderBy Specifies how to order search results. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. - * @param {string} params.query Full-text search query string. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plus.activities.list + * @desc List all of the activities in the specified collection for a + * particular user. + * @alias plus.activities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of activities to list. + * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/plus/v1/people/{userId}/activities/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'collection'], + pathParams: ['collection', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/plus/v1/activities').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['query'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Comments { - root: Plus; - constructor(root: Plus) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plus.activities.search + * @desc Search public activities. + * @alias plus.activities.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language Specify the preferred language to search with. See search language codes for available values. + * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.orderBy Specifies how to order search results. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. + * @param {string} params.query Full-text search query string. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/activities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['query'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plus.comments.get - * @desc Get a comment. - * @alias plus.comments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Comments { + root: Plus; + constructor(root: Plus) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['commentId'], - pathParams: ['commentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plus.comments.list - * @desc List all of the comments for an activity. - * @alias plus.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get comments for. - * @param {integer=} params.maxResults The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string=} params.sortOrder The order in which to sort the list of comments. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plus.comments.get + * @desc Get a comment. + * @alias plus.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['commentId'], + pathParams: ['commentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/activities/{activityId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId'], - pathParams: ['activityId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$People { - root: Plus; - constructor(root: Plus) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plus.comments.list + * @desc List all of the comments for an activity. + * @alias plus.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get comments for. + * @param {integer=} params.maxResults The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string=} params.sortOrder The order in which to sort the list of comments. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/activities/{activityId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId'], + pathParams: ['activityId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plus.people.get - * @desc Get a person's profile. If your app uses scope - * https://www.googleapis.com/auth/plus.login, this method is guaranteed to - * return ageRange and language. - * @alias plus.people.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$People { + root: Plus; + constructor(root: Plus) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/people/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plus.people.list - * @desc List all of the people in the specified collection. - * @alias plus.people.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of people to list. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.orderBy The order to return people in. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId Get the collection of people for the person identified. Use "me" to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plus.people.get + * @desc Get a person's profile. If your app uses scope + * https://www.googleapis.com/auth/plus.login, this method is guaranteed to + * return ageRange and language. + * @alias plus.people.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/people/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/people/{userId}/people/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'collection'], - pathParams: ['collection', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plus.people.listByActivity - * @desc List all of the people in the specified collection for a particular - * activity. - * @alias plus.people.listByActivity - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get the list of people for. - * @param {string} params.collection The collection of people to list. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByActivity(params?: any, options?: MethodOptions): - AxiosPromise; - listByActivity( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByActivity( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plus.people.list + * @desc List all of the people in the specified collection. + * @alias plus.people.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of people to list. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.orderBy The order to return people in. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId Get the collection of people for the person identified. Use "me" to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/people/{userId}/people/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'collection'], + pathParams: ['collection', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/plus/v1/activities/{activityId}/people/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId', 'collection'], - pathParams: ['activityId', 'collection'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plus.people.search - * @desc Search all public profiles. - * @alias plus.people.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.language Specify the preferred language to search with. See search language codes for available values. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. - * @param {string} params.query Specify a query string for full text search of public text in all profiles. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plus.people.listByActivity + * @desc List all of the people in the specified collection for a particular + * activity. + * @alias plus.people.listByActivity + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get the list of people for. + * @param {string} params.collection The collection of people to list. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByActivity(params?: any, options?: MethodOptions): + AxiosPromise; + listByActivity( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByActivity( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/plus/v1/activities/{activityId}/people/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId', 'collection'], + pathParams: ['activityId', 'collection'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plus/v1/people').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['query'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * plus.people.search + * @desc Search all public profiles. + * @alias plus.people.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.language Specify the preferred language to search with. See search language codes for available values. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. This token can be of any length. + * @param {string} params.query Specify a query string for full text search of public text in all profiles. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plus/v1/people').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['query'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/plusDomains/v1.ts b/src/apis/plusDomains/v1.ts index f6b33bda4a9..f1f2155f02d 100644 --- a/src/apis/plusDomains/v1.ts +++ b/src/apis/plusDomains/v1.ts @@ -27,1884 +27,1912 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google+ Domains API - * - * Builds on top of the Google+ platform for Google Apps Domains. - * - * @example - * const google = require('googleapis'); - * const plusDomains = google.plusDomains('v1'); - * - * @namespace plusDomains - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Plusdomains - */ -export class Plusdomains { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace plusDomains_v1 { + /** + * Google+ Domains API + * + * Builds on top of the Google+ platform for Google Apps Domains. + * + * @example + * const google = require('googleapis'); + * const plusDomains = google.plusDomains('v1'); + * + * @namespace plusDomains + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Plusdomains + */ + export class Plusdomains { + _options: GlobalOptions; + google: GoogleApis; + root = this; - activities: Resource$Activities; - audiences: Resource$Audiences; - circles: Resource$Circles; - comments: Resource$Comments; - media: Resource$Media; - people: Resource$People; + activities: Resource$Activities; + audiences: Resource$Audiences; + circles: Resource$Circles; + comments: Resource$Comments; + media: Resource$Media; + people: Resource$People; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.activities = new Resource$Activities(this); - this.audiences = new Resource$Audiences(this); - this.circles = new Resource$Circles(this); - this.comments = new Resource$Comments(this); - this.media = new Resource$Media(this); - this.people = new Resource$People(this); - } + this.activities = new Resource$Activities(this); + this.audiences = new Resource$Audiences(this); + this.circles = new Resource$Circles(this); + this.comments = new Resource$Comments(this); + this.media = new Resource$Media(this); + this.people = new Resource$People(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$Acl { - /** - * Description of the access granted, suitable for display. - */ - description: string; - /** - * Whether access is restricted to the domain. - */ - domainRestricted: boolean; - /** - * The list of access entries. - */ - items: Schema$PlusDomainsAclentryResource[]; - /** - * Identifies this resource as a collection of access controls. Value: - * "plus#acl". - */ - kind: string; -} -export interface Schema$Activity { - /** - * Identifies who has access to see this activity. - */ - access: Schema$Acl; - /** - * The person who performed this activity. - */ - actor: any; - /** - * Street address where this activity occurred. - */ - address: string; - /** - * Additional content added by the person who shared this activity, applicable - * only when resharing an activity. - */ - annotation: string; - /** - * If this activity is a crosspost from another system, this property - * specifies the ID of the original activity. - */ - crosspostSource: string; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * Latitude and longitude where this activity occurred. Format is latitude - * followed by longitude, space separated. - */ - geocode: string; - /** - * The ID of this activity. - */ - id: string; - /** - * Identifies this resource as an activity. Value: "plus#activity". - */ - kind: string; - /** - * The location where this activity occurred. - */ - location: Schema$Place; - /** - * The object of this activity. - */ - object: any; - /** - * ID of the place where this activity occurred. - */ - placeId: string; - /** - * Name of the place where this activity occurred. - */ - placeName: string; - /** - * The service provider that initially published this activity. - */ - provider: any; - /** - * The time at which this activity was initially published. Formatted as an - * RFC 3339 timestamp. - */ - published: string; - /** - * Radius, in meters, of the region where this activity occurred, centered at - * the latitude and longitude identified in geocode. - */ - radius: string; - /** - * Title of this activity. - */ - title: string; - /** - * The time at which this activity was last updated. Formatted as an RFC 3339 - * timestamp. - */ - updated: string; - /** - * The link to this activity. - */ - url: string; - /** - * This activity's verb, which indicates the action that was performed. - * Possible values include, but are not limited to, the following values: - - * "post" - Publish content to the stream. - "share" - - * Reshare an activity. - */ - verb: string; -} -export interface Schema$ActivityFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this collection of activities. Deprecated. - */ - id: string; - /** - * The activities in this page of results. - */ - items: Schema$Activity[]; - /** - * Identifies this resource as a collection of activities. Value: - * "plus#activityFeed". - */ - kind: string; - /** - * Link to the next page of activities. - */ - nextLink: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Link to this activity resource. - */ - selfLink: string; - /** - * The title of this collection of activities, which is a truncated portion of - * the content. - */ - title: string; - /** - * The time at which this collection of activities was last updated. Formatted - * as an RFC 3339 timestamp. - */ - updated: string; -} -export interface Schema$Audience { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The access control list entry. - */ - item: Schema$PlusDomainsAclentryResource; - /** - * Identifies this resource as an audience. Value: "plus#audience". - */ - kind: string; - /** - * The number of people in this circle. This only applies if entity_type is - * CIRCLE. - */ - memberCount: number; - /** - * The circle members' visibility as chosen by the owner of the circle. - * This only applies for items with "item.type" equals - * "circle". Possible values are: - "public" - Members - * are visible to the public. - "limited" - Members are visible to - * a limited audience. - "private" - Members are visible to the - * owner only. - */ - visibility: string; -} -export interface Schema$AudiencesFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The audiences in this result. - */ - items: Schema$Audience[]; - /** - * Identifies this resource as a collection of audiences. Value: - * "plus#audienceFeed". - */ - kind: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * The total number of ACL entries. The number of entries in this response may - * be smaller due to paging. - */ - totalItems: number; -} -export interface Schema$Circle { - /** - * The description of this circle. - */ - description: string; - /** - * The circle name. - */ - displayName: string; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of the circle. - */ - id: string; - /** - * Identifies this resource as a circle. Value: "plus#circle". - */ - kind: string; - /** - * The people in this circle. - */ - people: any; - /** - * Link to this circle resource - */ - selfLink: string; -} -export interface Schema$CircleFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The circles in this page of results. - */ - items: Schema$Circle[]; - /** - * Identifies this resource as a collection of circles. Value: - * "plus#circleFeed". - */ - kind: string; - /** - * Link to the next page of circles. - */ - nextLink: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Link to this page of circles. - */ - selfLink: string; - /** - * The title of this list of resources. - */ - title: string; - /** - * The total number of circles. The number of circles in this response may be - * smaller due to paging. - */ - totalItems: number; -} -export interface Schema$Comment { - /** - * The person who posted this comment. - */ - actor: any; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this comment. - */ - id: string; - /** - * The activity this comment replied to. - */ - inReplyTo: any[]; - /** - * Identifies this resource as a comment. Value: "plus#comment". - */ - kind: string; - /** - * The object of this comment. - */ - object: any; - /** - * People who +1'd this comment. - */ - plusoners: any; - /** - * The time at which this comment was initially published. Formatted as an RFC - * 3339 timestamp. - */ - published: string; - /** - * Link to this comment resource. - */ - selfLink: string; - /** - * The time at which this comment was last updated. Formatted as an RFC 3339 - * timestamp. - */ - updated: string; - /** - * This comment's verb, indicating what action was performed. Possible - * values are: - "post" - Publish content to the stream. - */ - verb: string; -} -export interface Schema$CommentFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The ID of this collection of comments. - */ - id: string; - /** - * The comments in this page of results. - */ - items: Schema$Comment[]; - /** - * Identifies this resource as a collection of comments. Value: - * "plus#commentFeed". - */ - kind: string; - /** - * Link to the next page of activities. - */ - nextLink: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * The title of this collection of comments. - */ - title: string; - /** - * The time at which this collection of comments was last updated. Formatted - * as an RFC 3339 timestamp. - */ - updated: string; -} -export interface Schema$Media { - /** - * The person who uploaded this media. - */ - author: any; - /** - * The display name for this media. - */ - displayName: string; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * Exif information of the media item. - */ - exif: any; - /** - * The height in pixels of the original image. - */ - height: number; - /** - * ID of this media, which is generated by the API. - */ - id: string; - /** - * The type of resource. - */ - kind: string; - /** - * The time at which this media was originally created in UTC. Formatted as an - * RFC 3339 timestamp that matches this example: 2010-11-25T14:30:27.655Z - */ - mediaCreatedTime: string; - /** - * The URL of this photo or video's still image. - */ - mediaUrl: string; - /** - * The time at which this media was uploaded. Formatted as an RFC 3339 - * timestamp. - */ - published: string; - /** - * The size in bytes of this video. - */ - sizeBytes: string; - /** - * The list of video streams for this video. There might be several different - * streams available for a single video, either Flash or MPEG, of various - * sizes - */ - streams: Schema$Videostream[]; - /** - * A description, or caption, for this media. - */ - summary: string; - /** - * The time at which this media was last updated. This includes changes to - * media metadata. Formatted as an RFC 3339 timestamp. - */ - updated: string; - /** - * The URL for the page that hosts this media. - */ - url: string; - /** - * The duration in milliseconds of this video. - */ - videoDuration: string; - /** - * The encoding status of this video. Possible values are: - - * "UPLOADING" - Not all the video bytes have been received. - - * "PENDING" - Video not yet processed. - "FAILED" - - * Video processing failed. - "READY" - A single video stream is - * playable. - "FINAL" - All video streams are playable. - */ - videoStatus: string; - /** - * The width in pixels of the original image. - */ - width: number; -} -export interface Schema$PeopleFeed { - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The people in this page of results. Each item includes the id, displayName, - * image, and url for the person. To retrieve additional profile data, see the - * people.get method. - */ - items: Schema$Person[]; - /** - * Identifies this resource as a collection of people. Value: - * "plus#peopleFeed". - */ - kind: string; - /** - * The continuation token, which is used to page through large result sets. - * Provide this value in a subsequent request to return the next page of - * results. - */ - nextPageToken: string; - /** - * Link to this resource. - */ - selfLink: string; - /** - * The title of this collection of people. - */ - title: string; - /** - * The total number of people available in this list. The number of people in - * a response might be smaller due to paging. This might not be set for all - * collections. - */ - totalItems: number; -} -export interface Schema$Person { - /** - * A short biography for this person. - */ - aboutMe: string; - /** - * The person's date of birth, represented as YYYY-MM-DD. - */ - birthday: string; - /** - * The "bragging rights" line of this person. - */ - braggingRights: string; - /** - * For followers who are visible, the number of people who have added this - * person or page to a circle. - */ - circledByCount: number; - /** - * The cover photo content. - */ - cover: any; - /** - * (this field is not currently used) - */ - currentLocation: string; - /** - * The name of this person, which is suitable for display. - */ - displayName: string; - /** - * The hosted domain name for the user's Google Apps account. For - * instance, example.com. The plus.profile.emails.read or email scope is - * needed to get this domain name. - */ - domain: string; - /** - * A list of email addresses that this person has, including their Google - * account email address, and the public verified email addresses on their - * Google+ profile. The plus.profile.emails.read scope is needed to retrieve - * these email addresses, or the email scope can be used to retrieve just the - * Google account email address. - */ - emails: any[]; - /** - * ETag of this response for caching purposes. - */ - etag: string; - /** - * The person's gender. Possible values include, but are not limited to, - * the following values: - "male" - Male gender. - - * "female" - Female gender. - "other" - Other. - */ - gender: string; - /** - * The ID of this person. - */ - id: string; - /** - * The representation of the person's profile photo. - */ - image: any; - /** - * Whether this user has signed up for Google+. - */ - isPlusUser: boolean; - /** - * Identifies this resource as a person. Value: "plus#person". - */ - kind: string; - /** - * An object representation of the individual components of a person's - * name. - */ - name: any; - /** - * The nickname of this person. - */ - nickname: string; - /** - * Type of person within Google+. Possible values include, but are not limited - * to, the following values: - "person" - represents an actual - * person. - "page" - represents a page. - */ - objectType: string; - /** - * The occupation of this person. - */ - occupation: string; - /** - * A list of current or past organizations with which this person is - * associated. - */ - organizations: any[]; - /** - * A list of places where this person has lived. - */ - placesLived: any[]; - /** - * If a Google+ Page, the number of people who have +1'd this page. - */ - plusOneCount: number; - /** - * The person's relationship status. Possible values include, but are not - * limited to, the following values: - "single" - Person is - * single. - "in_a_relationship" - Person is in a relationship. - - * "engaged" - Person is engaged. - "married" - Person is - * married. - "its_complicated" - The relationship is complicated. - * - "open_relationship" - Person is in an open relationship. - - * "widowed" - Person is widowed. - - * "in_domestic_partnership" - Person is in a domestic partnership. - * - "in_civil_union" - Person is in a civil union. - */ - relationshipStatus: string; - /** - * The person's skills. - */ - skills: string; - /** - * The brief description (tagline) of this person. - */ - tagline: string; - /** - * The URL of this person's profile. - */ - url: string; - /** - * A list of URLs for this person. - */ - urls: any[]; - /** - * Whether the person or Google+ Page has been verified. - */ - verified: boolean; -} -export interface Schema$Place { - /** - * The physical address of the place. - */ - address: any; - /** - * The display name of the place. - */ - displayName: string; - /** - * The id of the place. - */ - id: string; - /** - * Identifies this resource as a place. Value: "plus#place". - */ - kind: string; - /** - * The position of the place. - */ - position: any; -} -export interface Schema$PlusDomainsAclentryResource { - /** - * A descriptive name for this entry. Suitable for display. - */ - displayName: string; - /** - * The ID of the entry. For entries of type "person" or - * "circle", this is the ID of the resource. For other types, this - * property is not set. - */ - id: string; - /** - * The type of entry describing to whom access is granted. Possible values - * are: - "person" - Access to an individual. - - * "circle" - Access to members of a circle. - - * "myCircles" - Access to members of all the person's circles. - * - "extendedCircles" - Access to members of all the person's - * circles, plus all of the people in their circles. - "domain" - - * Access to members of the person's Google Apps domain. - - * "public" - Access to anyone on the web. - */ - type: string; -} -export interface Schema$Videostream { - /** - * The height, in pixels, of the video resource. - */ - height: number; - /** - * MIME type of the video stream. - */ - type: string; - /** - * URL of the video stream. - */ - url: string; - /** - * The width, in pixels, of the video resource. - */ - width: number; -} -export class Resource$Activities { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Acl { + /** + * Description of the access granted, suitable for display. + */ + description: string; + /** + * Whether access is restricted to the domain. + */ + domainRestricted: boolean; + /** + * The list of access entries. + */ + items: Schema$PlusDomainsAclentryResource[]; + /** + * Identifies this resource as a collection of access controls. Value: + * "plus#acl". + */ + kind: string; } - - getRoot() { - return this.root; + export interface Schema$Activity { + /** + * Identifies who has access to see this activity. + */ + access: Schema$Acl; + /** + * The person who performed this activity. + */ + actor: any; + /** + * Street address where this activity occurred. + */ + address: string; + /** + * Additional content added by the person who shared this activity, + * applicable only when resharing an activity. + */ + annotation: string; + /** + * If this activity is a crosspost from another system, this property + * specifies the ID of the original activity. + */ + crosspostSource: string; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * Latitude and longitude where this activity occurred. Format is latitude + * followed by longitude, space separated. + */ + geocode: string; + /** + * The ID of this activity. + */ + id: string; + /** + * Identifies this resource as an activity. Value: + * "plus#activity". + */ + kind: string; + /** + * The location where this activity occurred. + */ + location: Schema$Place; + /** + * The object of this activity. + */ + object: any; + /** + * ID of the place where this activity occurred. + */ + placeId: string; + /** + * Name of the place where this activity occurred. + */ + placeName: string; + /** + * The service provider that initially published this activity. + */ + provider: any; + /** + * The time at which this activity was initially published. Formatted as an + * RFC 3339 timestamp. + */ + published: string; + /** + * Radius, in meters, of the region where this activity occurred, centered + * at the latitude and longitude identified in geocode. + */ + radius: string; + /** + * Title of this activity. + */ + title: string; + /** + * The time at which this activity was last updated. Formatted as an RFC + * 3339 timestamp. + */ + updated: string; + /** + * The link to this activity. + */ + url: string; + /** + * This activity's verb, which indicates the action that was performed. + * Possible values include, but are not limited to, the following values: - + * "post" - Publish content to the stream. - "share" - + * Reshare an activity. + */ + verb: string; + } + export interface Schema$ActivityFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this collection of activities. Deprecated. + */ + id: string; + /** + * The activities in this page of results. + */ + items: Schema$Activity[]; + /** + * Identifies this resource as a collection of activities. Value: + * "plus#activityFeed". + */ + kind: string; + /** + * Link to the next page of activities. + */ + nextLink: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Link to this activity resource. + */ + selfLink: string; + /** + * The title of this collection of activities, which is a truncated portion + * of the content. + */ + title: string; + /** + * The time at which this collection of activities was last updated. + * Formatted as an RFC 3339 timestamp. + */ + updated: string; + } + export interface Schema$Audience { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The access control list entry. + */ + item: Schema$PlusDomainsAclentryResource; + /** + * Identifies this resource as an audience. Value: + * "plus#audience". + */ + kind: string; + /** + * The number of people in this circle. This only applies if entity_type is + * CIRCLE. + */ + memberCount: number; + /** + * The circle members' visibility as chosen by the owner of the circle. + * This only applies for items with "item.type" equals + * "circle". Possible values are: - "public" - Members + * are visible to the public. - "limited" - Members are visible + * to a limited audience. - "private" - Members are visible to + * the owner only. + */ + visibility: string; + } + export interface Schema$AudiencesFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The audiences in this result. + */ + items: Schema$Audience[]; + /** + * Identifies this resource as a collection of audiences. Value: + * "plus#audienceFeed". + */ + kind: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * The total number of ACL entries. The number of entries in this response + * may be smaller due to paging. + */ + totalItems: number; + } + export interface Schema$Circle { + /** + * The description of this circle. + */ + description: string; + /** + * The circle name. + */ + displayName: string; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of the circle. + */ + id: string; + /** + * Identifies this resource as a circle. Value: "plus#circle". + */ + kind: string; + /** + * The people in this circle. + */ + people: any; + /** + * Link to this circle resource + */ + selfLink: string; + } + export interface Schema$CircleFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The circles in this page of results. + */ + items: Schema$Circle[]; + /** + * Identifies this resource as a collection of circles. Value: + * "plus#circleFeed". + */ + kind: string; + /** + * Link to the next page of circles. + */ + nextLink: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Link to this page of circles. + */ + selfLink: string; + /** + * The title of this list of resources. + */ + title: string; + /** + * The total number of circles. The number of circles in this response may + * be smaller due to paging. + */ + totalItems: number; + } + export interface Schema$Comment { + /** + * The person who posted this comment. + */ + actor: any; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this comment. + */ + id: string; + /** + * The activity this comment replied to. + */ + inReplyTo: any[]; + /** + * Identifies this resource as a comment. Value: "plus#comment". + */ + kind: string; + /** + * The object of this comment. + */ + object: any; + /** + * People who +1'd this comment. + */ + plusoners: any; + /** + * The time at which this comment was initially published. Formatted as an + * RFC 3339 timestamp. + */ + published: string; + /** + * Link to this comment resource. + */ + selfLink: string; + /** + * The time at which this comment was last updated. Formatted as an RFC 3339 + * timestamp. + */ + updated: string; + /** + * This comment's verb, indicating what action was performed. Possible + * values are: - "post" - Publish content to the stream. + */ + verb: string; + } + export interface Schema$CommentFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The ID of this collection of comments. + */ + id: string; + /** + * The comments in this page of results. + */ + items: Schema$Comment[]; + /** + * Identifies this resource as a collection of comments. Value: + * "plus#commentFeed". + */ + kind: string; + /** + * Link to the next page of activities. + */ + nextLink: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * The title of this collection of comments. + */ + title: string; + /** + * The time at which this collection of comments was last updated. Formatted + * as an RFC 3339 timestamp. + */ + updated: string; + } + export interface Schema$Media { + /** + * The person who uploaded this media. + */ + author: any; + /** + * The display name for this media. + */ + displayName: string; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * Exif information of the media item. + */ + exif: any; + /** + * The height in pixels of the original image. + */ + height: number; + /** + * ID of this media, which is generated by the API. + */ + id: string; + /** + * The type of resource. + */ + kind: string; + /** + * The time at which this media was originally created in UTC. Formatted as + * an RFC 3339 timestamp that matches this example: 2010-11-25T14:30:27.655Z + */ + mediaCreatedTime: string; + /** + * The URL of this photo or video's still image. + */ + mediaUrl: string; + /** + * The time at which this media was uploaded. Formatted as an RFC 3339 + * timestamp. + */ + published: string; + /** + * The size in bytes of this video. + */ + sizeBytes: string; + /** + * The list of video streams for this video. There might be several + * different streams available for a single video, either Flash or MPEG, of + * various sizes + */ + streams: Schema$Videostream[]; + /** + * A description, or caption, for this media. + */ + summary: string; + /** + * The time at which this media was last updated. This includes changes to + * media metadata. Formatted as an RFC 3339 timestamp. + */ + updated: string; + /** + * The URL for the page that hosts this media. + */ + url: string; + /** + * The duration in milliseconds of this video. + */ + videoDuration: string; + /** + * The encoding status of this video. Possible values are: - + * "UPLOADING" - Not all the video bytes have been received. - + * "PENDING" - Video not yet processed. - "FAILED" - + * Video processing failed. - "READY" - A single video stream is + * playable. - "FINAL" - All video streams are playable. + */ + videoStatus: string; + /** + * The width in pixels of the original image. + */ + width: number; + } + export interface Schema$PeopleFeed { + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The people in this page of results. Each item includes the id, + * displayName, image, and url for the person. To retrieve additional + * profile data, see the people.get method. + */ + items: Schema$Person[]; + /** + * Identifies this resource as a collection of people. Value: + * "plus#peopleFeed". + */ + kind: string; + /** + * The continuation token, which is used to page through large result sets. + * Provide this value in a subsequent request to return the next page of + * results. + */ + nextPageToken: string; + /** + * Link to this resource. + */ + selfLink: string; + /** + * The title of this collection of people. + */ + title: string; + /** + * The total number of people available in this list. The number of people + * in a response might be smaller due to paging. This might not be set for + * all collections. + */ + totalItems: number; + } + export interface Schema$Person { + /** + * A short biography for this person. + */ + aboutMe: string; + /** + * The person's date of birth, represented as YYYY-MM-DD. + */ + birthday: string; + /** + * The "bragging rights" line of this person. + */ + braggingRights: string; + /** + * For followers who are visible, the number of people who have added this + * person or page to a circle. + */ + circledByCount: number; + /** + * The cover photo content. + */ + cover: any; + /** + * (this field is not currently used) + */ + currentLocation: string; + /** + * The name of this person, which is suitable for display. + */ + displayName: string; + /** + * The hosted domain name for the user's Google Apps account. For + * instance, example.com. The plus.profile.emails.read or email scope is + * needed to get this domain name. + */ + domain: string; + /** + * A list of email addresses that this person has, including their Google + * account email address, and the public verified email addresses on their + * Google+ profile. The plus.profile.emails.read scope is needed to retrieve + * these email addresses, or the email scope can be used to retrieve just + * the Google account email address. + */ + emails: any[]; + /** + * ETag of this response for caching purposes. + */ + etag: string; + /** + * The person's gender. Possible values include, but are not limited to, + * the following values: - "male" - Male gender. - + * "female" - Female gender. - "other" - Other. + */ + gender: string; + /** + * The ID of this person. + */ + id: string; + /** + * The representation of the person's profile photo. + */ + image: any; + /** + * Whether this user has signed up for Google+. + */ + isPlusUser: boolean; + /** + * Identifies this resource as a person. Value: "plus#person". + */ + kind: string; + /** + * An object representation of the individual components of a person's + * name. + */ + name: any; + /** + * The nickname of this person. + */ + nickname: string; + /** + * Type of person within Google+. Possible values include, but are not + * limited to, the following values: - "person" - represents an + * actual person. - "page" - represents a page. + */ + objectType: string; + /** + * The occupation of this person. + */ + occupation: string; + /** + * A list of current or past organizations with which this person is + * associated. + */ + organizations: any[]; + /** + * A list of places where this person has lived. + */ + placesLived: any[]; + /** + * If a Google+ Page, the number of people who have +1'd this page. + */ + plusOneCount: number; + /** + * The person's relationship status. Possible values include, but are + * not limited to, the following values: - "single" - Person is + * single. - "in_a_relationship" - Person is in a relationship. + * - "engaged" - Person is engaged. - "married" - + * Person is married. - "its_complicated" - The relationship is + * complicated. - "open_relationship" - Person is in an open + * relationship. - "widowed" - Person is widowed. - + * "in_domestic_partnership" - Person is in a domestic + * partnership. - "in_civil_union" - Person is in a civil union. + */ + relationshipStatus: string; + /** + * The person's skills. + */ + skills: string; + /** + * The brief description (tagline) of this person. + */ + tagline: string; + /** + * The URL of this person's profile. + */ + url: string; + /** + * A list of URLs for this person. + */ + urls: any[]; + /** + * Whether the person or Google+ Page has been verified. + */ + verified: boolean; + } + export interface Schema$Place { + /** + * The physical address of the place. + */ + address: any; + /** + * The display name of the place. + */ + displayName: string; + /** + * The id of the place. + */ + id: string; + /** + * Identifies this resource as a place. Value: "plus#place". + */ + kind: string; + /** + * The position of the place. + */ + position: any; + } + export interface Schema$PlusDomainsAclentryResource { + /** + * A descriptive name for this entry. Suitable for display. + */ + displayName: string; + /** + * The ID of the entry. For entries of type "person" or + * "circle", this is the ID of the resource. For other types, this + * property is not set. + */ + id: string; + /** + * The type of entry describing to whom access is granted. Possible values + * are: - "person" - Access to an individual. - + * "circle" - Access to members of a circle. - + * "myCircles" - Access to members of all the person's + * circles. - "extendedCircles" - Access to members of all the + * person's circles, plus all of the people in their circles. - + * "domain" - Access to members of the person's Google Apps + * domain. - "public" - Access to anyone on the web. + */ + type: string; + } + export interface Schema$Videostream { + /** + * The height, in pixels, of the video resource. + */ + height: number; + /** + * MIME type of the video stream. + */ + type: string; + /** + * URL of the video stream. + */ + url: string; + /** + * The width, in pixels, of the video resource. + */ + width: number; } - - /** - * plusDomains.activities.get - * @desc Get an activity. - * @alias plusDomains.activities.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Activities { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/activities/{activityId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId'], - pathParams: ['activityId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plusDomains.activities.insert - * @desc Create a new activity for the authenticated user. - * @alias plusDomains.activities.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.preview If "true", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page. - * @param {string} params.userId The ID of the user to create the activity on behalf of. Its value should be "me", to indicate the authenticated user. - * @param {().Activity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * plusDomains.activities.get + * @desc Get an activity. + * @alias plusDomains.activities.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/activities/{activityId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId'], + pathParams: ['activityId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/people/{userId}/activities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.activities.list - * @desc List all of the activities in the specified collection for a - * particular user. - * @alias plusDomains.activities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of activities to list. - * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.activities.insert + * @desc Create a new activity for the authenticated user. + * @alias plusDomains.activities.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.preview If "true", extract the potential media attachments for a URL. The response will include all possible attachments for a URL, including video, photos, and articles based on the content of the page. + * @param {string} params.userId The ID of the user to create the activity on behalf of. Its value should be "me", to indicate the authenticated user. + * @param {().Activity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/people/{userId}/activities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/plusDomains/v1/people/{userId}/activities/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'collection'], - pathParams: ['collection', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Audiences { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plusDomains.activities.list + * @desc List all of the activities in the specified collection for a + * particular user. + * @alias plusDomains.activities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of activities to list. + * @param {integer=} params.maxResults The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/plusDomains/v1/people/{userId}/activities/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'collection'], + pathParams: ['collection', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plusDomains.audiences.list - * @desc List all of the audiences to which a user can share. - * @alias plusDomains.audiences.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId The ID of the user to get audiences for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Audiences { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/people/{userId}/audiences') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Circles { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plusDomains.audiences.list + * @desc List all of the audiences to which a user can share. + * @alias plusDomains.audiences.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId The ID of the user to get audiences for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/people/{userId}/audiences') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plusDomains.circles.addPeople - * @desc Add a person to a circle. Google+ limits certain circle operations, - * including the number of circle adds. Learn More. - * @alias plusDomains.circles.addPeople - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to add the person to. - * @param {string=} params.email Email of the people to add to the circle. Optional, can be repeated. - * @param {string=} params.userId IDs of the people to add to the circle. Optional, can be repeated. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addPeople(params?: any, options?: MethodOptions): AxiosPromise; - addPeople( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addPeople( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Circles { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plusDomains.circles.get - * @desc Get a circle. - * @alias plusDomains.circles.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.circles.addPeople + * @desc Add a person to a circle. Google+ limits certain circle operations, + * including the number of circle adds. Learn More. + * @alias plusDomains.circles.addPeople + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to add the person to. + * @param {string=} params.email Email of the people to add to the circle. Optional, can be repeated. + * @param {string=} params.userId IDs of the people to add to the circle. Optional, can be repeated. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addPeople(params?: any, options?: MethodOptions): + AxiosPromise; + addPeople( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addPeople( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.circles.insert - * @desc Create a new circle for the authenticated user. - * @alias plusDomains.circles.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The ID of the user to create the circle on behalf of. The value "me" can be used to indicate the authenticated user. - * @param {().Circle} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.circles.get + * @desc Get a circle. + * @alias plusDomains.circles.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/people/{userId}/circles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.circles.list - * @desc List all of the circles for a user. - * @alias plusDomains.circles.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId The ID of the user to get circles for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * plusDomains.circles.insert + * @desc Create a new circle for the authenticated user. + * @alias plusDomains.circles.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The ID of the user to create the circle on behalf of. The value "me" can be used to indicate the authenticated user. + * @param {().Circle} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/people/{userId}/circles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/people/{userId}/circles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.circles.patch - * @desc Update a circle's description. This method supports patch semantics. - * @alias plusDomains.circles.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to update. - * @param {().Circle} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * plusDomains.circles.list + * @desc List all of the circles for a user. + * @alias plusDomains.circles.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of circles to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId The ID of the user to get circles for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/people/{userId}/circles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * plusDomains.circles.remove - * @desc Delete a circle. - * @alias plusDomains.circles.remove - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - remove(params?: any, options?: MethodOptions): AxiosPromise; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - remove( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * plusDomains.circles.patch + * @desc Update a circle's description. This method supports patch + * semantics. + * @alias plusDomains.circles.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to update. + * @param {().Circle} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.circles.removePeople - * @desc Remove a person from a circle. - * @alias plusDomains.circles.removePeople - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to remove the person from. - * @param {string=} params.email Email of the people to add to the circle. Optional, can be repeated. - * @param {string=} params.userId IDs of the people to remove from the circle. Optional, can be repeated. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removePeople(params?: any, options?: MethodOptions): AxiosPromise; - removePeople( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removePeople( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.circles.remove + * @desc Delete a circle. + * @alias plusDomains.circles.remove + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + remove(params?: any, options?: MethodOptions): AxiosPromise; + remove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + remove( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.circles.update - * @desc Update a circle's description. - * @alias plusDomains.circles.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to update. - * @param {().Circle} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * plusDomains.circles.removePeople + * @desc Remove a person from a circle. + * @alias plusDomains.circles.removePeople + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to remove the person from. + * @param {string=} params.email Email of the people to add to the circle. Optional, can be repeated. + * @param {string=} params.userId IDs of the people to remove from the circle. Optional, can be repeated. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removePeople(params?: any, options?: MethodOptions): AxiosPromise; + removePeople( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removePeople( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Comments { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plusDomains.circles.update + * @desc Update a circle's description. + * @alias plusDomains.circles.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to update. + * @param {().Circle} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plusDomains.comments.get - * @desc Get a comment. - * @alias plusDomains.comments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.commentId The ID of the comment to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Comments { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/comments/{commentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['commentId'], - pathParams: ['commentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plusDomains.comments.insert - * @desc Create a new comment in reply to an activity. - * @alias plusDomains.comments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to reply to. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.comments.get + * @desc Get a comment. + * @alias plusDomains.comments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.commentId The ID of the comment to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/comments/{commentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['commentId'], + pathParams: ['commentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/activities/{activityId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['activityId'], - pathParams: ['activityId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.comments.list - * @desc List all of the comments for an activity. - * @alias plusDomains.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get comments for. - * @param {integer=} params.maxResults The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string=} params.sortOrder The order in which to sort the list of comments. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/activities/{activityId}/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId'], - pathParams: ['activityId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * plusDomains.comments.insert + * @desc Create a new comment in reply to an activity. + * @alias plusDomains.comments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to reply to. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/plusDomains/v1/activities/{activityId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['activityId'], + pathParams: ['activityId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Media { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plusDomains.comments.list + * @desc List all of the comments for an activity. + * @alias plusDomains.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get comments for. + * @param {integer=} params.maxResults The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string=} params.sortOrder The order in which to sort the list of comments. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/plusDomains/v1/activities/{activityId}/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId'], + pathParams: ['activityId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plusDomains.media.insert - * @desc Add a new media item to an album. The current upload size limitations - * are 36MB for a photo and 1GB for a video. Uploads do not count against - * quota if photos are less than 2048 pixels on their longest side or videos - * are less than 15 minutes in length. - * @alias plusDomains.media.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection - * @param {string} params.userId The ID of the user to create the activity on behalf of. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Media { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/plusDomains/v1/people/{userId}/media/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + - '/upload/plusDomains/v1/people/{userId}/media/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['userId', 'collection'], - pathParams: ['collection', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$People { - root: Plusdomains; - constructor(root: Plusdomains) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * plusDomains.media.insert + * @desc Add a new media item to an album. The current upload size + * limitations are 36MB for a photo and 1GB for a video. Uploads do not + * count against quota if photos are less than 2048 pixels on their longest + * side or videos are less than 15 minutes in length. + * @alias plusDomains.media.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection + * @param {string} params.userId The ID of the user to create the activity on behalf of. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/plusDomains/v1/people/{userId}/media/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + + '/upload/plusDomains/v1/people/{userId}/media/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['userId', 'collection'], + pathParams: ['collection', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * plusDomains.people.get - * @desc Get a person's profile. - * @alias plusDomains.people.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.userId The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$People { + root: Plusdomains; + constructor(root: Plusdomains) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/people/{userId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId'], - pathParams: ['userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * plusDomains.people.list - * @desc List all of the people in the specified collection. - * @alias plusDomains.people.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.collection The collection of people to list. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.orderBy The order to return people in. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {string} params.userId Get the collection of people for the person identified. Use "me" to indicate the authenticated user. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * plusDomains.people.get + * @desc Get a person's profile. + * @alias plusDomains.people.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.userId The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/people/{userId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId'], + pathParams: ['userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/plusDomains/v1/people/{userId}/people/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['userId', 'collection'], - pathParams: ['collection', 'userId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * plusDomains.people.listByActivity - * @desc List all of the people in the specified collection for a particular - * activity. - * @alias plusDomains.people.listByActivity - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.activityId The ID of the activity to get the list of people for. - * @param {string} params.collection The collection of people to list. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByActivity(params?: any, options?: MethodOptions): - AxiosPromise; - listByActivity( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByActivity( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/plusDomains/v1/activities/{activityId}/people/{collection}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['activityId', 'collection'], - pathParams: ['activityId', 'collection'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * plusDomains.people.list + * @desc List all of the people in the specified collection. + * @alias plusDomains.people.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.collection The collection of people to list. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.orderBy The order to return people in. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {string} params.userId Get the collection of people for the person identified. Use "me" to indicate the authenticated user. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/plusDomains/v1/people/{userId}/people/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['userId', 'collection'], + pathParams: ['collection', 'userId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * plusDomains.people.listByCircle - * @desc List all of the people who are members of a circle. - * @alias plusDomains.people.listByCircle - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.circleId The ID of the circle to get the members of. - * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listByCircle(params?: any, options?: MethodOptions): - AxiosPromise; - listByCircle( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listByCircle( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * plusDomains.people.listByActivity + * @desc List all of the people in the specified collection for a particular + * activity. + * @alias plusDomains.people.listByActivity + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.activityId The ID of the activity to get the list of people for. + * @param {string} params.collection The collection of people to list. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByActivity(params?: any, options?: MethodOptions): + AxiosPromise; + listByActivity( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByActivity( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/plusDomains/v1/activities/{activityId}/people/{collection}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['activityId', 'collection'], + pathParams: ['activityId', 'collection'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['circleId'], - pathParams: ['circleId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * plusDomains.people.listByCircle + * @desc List all of the people who are members of a circle. + * @alias plusDomains.people.listByCircle + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.circleId The ID of the circle to get the members of. + * @param {integer=} params.maxResults The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listByCircle(params?: any, options?: MethodOptions): + AxiosPromise; + listByCircle( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listByCircle( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/plusDomains/v1/circles/{circleId}/people') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['circleId'], + pathParams: ['circleId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/poly/v1.ts b/src/apis/poly/v1.ts index 3b0b35476b6..cb8abfbe86b 100644 --- a/src/apis/poly/v1.ts +++ b/src/apis/poly/v1.ts @@ -27,671 +27,682 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Poly API - * - * The Poly API provides read-only access to assets hosted on <a - * href="https://poly.google.com">poly.google.com</a>. - * - * @example - * const google = require('googleapis'); - * const poly = google.poly('v1'); - * - * @namespace poly - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Poly - */ -export class Poly { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace poly_v1 { + /** + * Poly API + * + * The Poly API provides read-only access to assets hosted on <a + * href="https://poly.google.com">poly.google.com</a>. + * + * @example + * const google = require('googleapis'); + * const poly = google.poly('v1'); + * + * @namespace poly + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Poly + */ + export class Poly { + _options: GlobalOptions; + google: GoogleApis; + root = this; - assets: Resource$Assets; - users: Resource$Users; + assets: Resource$Assets; + users: Resource$Users; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.assets = new Resource$Assets(this); - this.users = new Resource$Users(this); - } + this.assets = new Resource$Assets(this); + this.users = new Resource$Users(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Represents and describes an asset in the Poly library. An asset is a 3D model - * or scene created using [Tilt Brush](//www.tiltbrush.com), - * [Blocks](//vr.google.com/blocks/), or any 3D program that produces a file - * that can be upload to Poly. - */ -export interface Schema$Asset { - /** - * The author's publicly visible name. Use this name when giving credit to - * the author. For more information, see - * [Licensing](/poly/discover/licensing). - */ - authorName: string; /** - * For published assets, the time when the asset was published. For - * unpublished assets, the time when the asset was created. - */ - createTime: string; - /** - * The human-readable description, set by the asset's author. - */ - description: string; - /** - * The human-readable name, set by the asset's author. - */ - displayName: string; - /** - * A list of Formats where each format describes one representation of the - * asset. - */ - formats: Schema$Format[]; - /** - * Whether this asset has been curated by the Poly team. - */ - isCurated: boolean; - /** - * The license under which the author has made the asset available for use, if - * any. - */ - license: string; - /** - * Application-defined opaque metadata for this asset. This field is only - * returned when querying for the signed-in user's own assets, not for - * public assets. This string is limited to 1K chars. It is up to the creator - * of the asset to define the format for this string (for example, JSON). - */ - metadata: string; - /** - * The unique identifier for the asset in the form: `assets/{ASSET_ID}`. - */ - name: string; - /** - * Hints for displaying the asset. Note that these parameters are not - * immutable; the author of an asset may change them post-publication. - */ - presentationParams: Schema$PresentationParams; - /** - * The thumbnail image for the asset. - */ - thumbnail: Schema$File; - /** - * The time when the asset was last modified. For published assets, whose - * contents are immutable, the update time changes only when metadata - * properties, such as visibility, are updated. - */ - updateTime: string; - /** - * The visibility of the asset and who can access it. - */ - visibility: string; -} -/** - * A message generated by the asset import process. - */ -export interface Schema$AssetImportMessage { - /** - * The code associated with this message. - */ - code: string; - /** - * An optional file path. Only present for those error codes that specify it. - */ - filePath: string; - /** - * An optional image error. Only present for INVALID_IMAGE_FILE. - */ - imageError: Schema$ImageError; - /** - * An optional OBJ parse error. Only present for OBJ_PARSE_ERROR. - */ - objParseError: Schema$ObjParseError; -} -/** - * Represents a file in Poly, which can be a root, resource, or thumbnail file. - */ -export interface Schema$File { - /** - * The MIME content-type, such as `image/png`. For more information, see [MIME - * types](//developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). - */ - contentType: string; - /** - * The path of the resource file relative to the root file. For root or - * thumbnail files, this is just the filename. - */ - relativePath: string; - /** - * The URL where the file data can be retrieved. - */ - url: string; -} -/** - * The same asset can be represented in different formats, for example, a - * [WaveFront .obj](//en.wikipedia.org/wiki/Wavefront_.obj_file) file with its - * corresponding .mtl file or a [Khronos glTF](//www.khronos.org/gltf) file with - * its corresponding .glb binary data. A format refers to a specific - * representation of an asset and contains all information needed to retrieve - * and describe this representation. - */ -export interface Schema$Format { - /** - * Complexity stats about this representation of the asset. - */ - formatComplexity: Schema$FormatComplexity; - /** - * A short string that identifies the format type of this representation. - * Possible values are: `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. - */ - formatType: string; - /** - * A list of dependencies of the root element. May include, but is not limited - * to, materials, textures, and shader programs. - */ - resources: Schema$File[]; - /** - * The root of the file hierarchy. This will always be populated. For some - * format_types - such as `TILT`, which are self-contained - this is all of - * the data. Other types - such as `OBJ` - often reference other data - * elements. These are contained in the resources field. - */ - root: Schema$File; -} -/** - * Information on the complexity of this Format. - */ -export interface Schema$FormatComplexity { - /** - * A non-negative integer that represents the level of detail (LOD) of this - * format relative to other formats of the same asset with the same - * format_type. This hint allows you to sort formats from the most-detailed - * (0) to least-detailed (integers greater than 0). - */ - lodHint: number; - /** - * The estimated number of triangles. - */ - triangleCount: string; -} -/** - * A message resulting from reading an image file. - */ -export interface Schema$ImageError { - /** - * The type of image error encountered. Optional for older image errors. - */ - code: string; - /** - * The file path in the import of the image that was rejected. - */ - filePath: string; -} -/** - * A response message from a request to list. - */ -export interface Schema$ListAssetsResponse { - /** - * A list of assets that match the criteria specified in the request. - */ - assets: Schema$Asset[]; - /** - * The continuation token for retrieving the next page. If empty, indicates - * that there are no more pages. To get the next page, submit the same request - * specifying this value as the page_token. - */ - nextPageToken: string; - /** - * The total number of assets in the list, without pagination. - */ - totalSize: number; -} -/** - * A response message from a request to list. - */ -export interface Schema$ListLikedAssetsResponse { - /** - * A list of assets that match the criteria specified in the request. - */ - assets: Schema$Asset[]; - /** - * The continuation token for retrieving the next page. If empty, indicates - * that there are no more pages. To get the next page, submit the same request - * specifying this value as the page_token. - */ - nextPageToken: string; - /** - * The total number of assets in the list, without pagination. - */ - totalSize: number; -} -/** - * A response message from a request to list. - */ -export interface Schema$ListUserAssetsResponse { - /** - * The continuation token for retrieving the next page. If empty, indicates - * that there are no more pages. To get the next page, submit the same request - * specifying this value as the page_token. - */ - nextPageToken: string; - /** - * The total number of assets in the list, without pagination. - */ - totalSize: number; - /** - * A list of UserAssets matching the request. - */ - userAssets: Schema$UserAsset[]; -} -/** - * Details of an error resulting from parsing an OBJ file - */ -export interface Schema$ObjParseError { - /** - * The type of problem found (required). - */ - code: string; - /** - * The ending character index at which the problem was found. - */ - endIndex: number; - /** - * The file path in which the problem was found. - */ - filePath: string; - /** - * The text of the line. Note that this may be truncated if the line was very - * long. This may not include the error if it occurs after line truncation. - */ - line: string; + * Represents and describes an asset in the Poly library. An asset is a 3D + * model or scene created using [Tilt Brush](//www.tiltbrush.com), + * [Blocks](//vr.google.com/blocks/), or any 3D program that produces a file + * that can be upload to Poly. + */ + export interface Schema$Asset { + /** + * The author's publicly visible name. Use this name when giving credit + * to the author. For more information, see + * [Licensing](/poly/discover/licensing). + */ + authorName: string; + /** + * For published assets, the time when the asset was published. For + * unpublished assets, the time when the asset was created. + */ + createTime: string; + /** + * The human-readable description, set by the asset's author. + */ + description: string; + /** + * The human-readable name, set by the asset's author. + */ + displayName: string; + /** + * A list of Formats where each format describes one representation of the + * asset. + */ + formats: Schema$Format[]; + /** + * Whether this asset has been curated by the Poly team. + */ + isCurated: boolean; + /** + * The license under which the author has made the asset available for use, + * if any. + */ + license: string; + /** + * Application-defined opaque metadata for this asset. This field is only + * returned when querying for the signed-in user's own assets, not for + * public assets. This string is limited to 1K chars. It is up to the + * creator of the asset to define the format for this string (for example, + * JSON). + */ + metadata: string; + /** + * The unique identifier for the asset in the form: `assets/{ASSET_ID}`. + */ + name: string; + /** + * Hints for displaying the asset. Note that these parameters are not + * immutable; the author of an asset may change them post-publication. + */ + presentationParams: Schema$PresentationParams; + /** + * The thumbnail image for the asset. + */ + thumbnail: Schema$File; + /** + * The time when the asset was last modified. For published assets, whose + * contents are immutable, the update time changes only when metadata + * properties, such as visibility, are updated. + */ + updateTime: string; + /** + * The visibility of the asset and who can access it. + */ + visibility: string; + } /** - * Line number at which the problem was found. - */ - lineNumber: number; + * A message generated by the asset import process. + */ + export interface Schema$AssetImportMessage { + /** + * The code associated with this message. + */ + code: string; + /** + * An optional file path. Only present for those error codes that specify + * it. + */ + filePath: string; + /** + * An optional image error. Only present for INVALID_IMAGE_FILE. + */ + imageError: Schema$ImageError; + /** + * An optional OBJ parse error. Only present for OBJ_PARSE_ERROR. + */ + objParseError: Schema$ObjParseError; + } /** - * The starting character index at which the problem was found. - */ - startIndex: number; -} -/** - * Hints for displaying the asset, based on information available when the asset - * was uploaded. - */ -export interface Schema$PresentationParams { + * Represents a file in Poly, which can be a root, resource, or thumbnail + * file. + */ + export interface Schema$File { + /** + * The MIME content-type, such as `image/png`. For more information, see + * [MIME + * types](//developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types). + */ + contentType: string; + /** + * The path of the resource file relative to the root file. For root or + * thumbnail files, this is just the filename. + */ + relativePath: string; + /** + * The URL where the file data can be retrieved. + */ + url: string; + } /** - * The materials' diffuse/albedo color. This does not apply to vertex - * colors or texture maps. - */ - colorSpace: string; + * The same asset can be represented in different formats, for example, a + * [WaveFront .obj](//en.wikipedia.org/wiki/Wavefront_.obj_file) file with its + * corresponding .mtl file or a [Khronos glTF](//www.khronos.org/gltf) file + * with its corresponding .glb binary data. A format refers to a specific + * representation of an asset and contains all information needed to retrieve + * and describe this representation. + */ + export interface Schema$Format { + /** + * Complexity stats about this representation of the asset. + */ + formatComplexity: Schema$FormatComplexity; + /** + * A short string that identifies the format type of this representation. + * Possible values are: `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. + */ + formatType: string; + /** + * A list of dependencies of the root element. May include, but is not + * limited to, materials, textures, and shader programs. + */ + resources: Schema$File[]; + /** + * The root of the file hierarchy. This will always be populated. For some + * format_types - such as `TILT`, which are self-contained - this is all of + * the data. Other types - such as `OBJ` - often reference other data + * elements. These are contained in the resources field. + */ + root: Schema$File; + } /** - * A rotation that should be applied to the object root to make it upright. - * More precisely, this quaternion transforms from "object space" - * (the space in which the object is defined) to "presentation - * space", a coordinate system where +Y is up, +X is right, -Z is - * forward. For example, if the object is the Eiffel Tower, in its local - * coordinate system the object might be laid out such that the base of the - * tower is on the YZ plane and the tip of the tower is towards positive X. In - * this case this quaternion would specify a rotation (of 90 degrees about the - * Z axis) such that in the presentation space the base of the tower is - * aligned with the XZ plane, and the tip of the tower lies towards +Y. This - * rotation is unrelated to the object's pose in the web preview, which is - * just a camera position setting and is *not* reflected in this rotation. - * Please note: this is applicable only to the gLTF. - */ - orientingRotation: Schema$Quaternion; -} -/** - * A [Quaternion](//en.wikipedia.org/wiki/Quaternion). Please note: if in the - * response you see "w: 1" and nothing else this is the default value - * of [0, 0, 0, 1] where x,y, and z are 0. - */ -export interface Schema$Quaternion { + * Information on the complexity of this Format. + */ + export interface Schema$FormatComplexity { + /** + * A non-negative integer that represents the level of detail (LOD) of this + * format relative to other formats of the same asset with the same + * format_type. This hint allows you to sort formats from the most-detailed + * (0) to least-detailed (integers greater than 0). + */ + lodHint: number; + /** + * The estimated number of triangles. + */ + triangleCount: string; + } /** - * The scalar component. - */ - w: number; + * A message resulting from reading an image file. + */ + export interface Schema$ImageError { + /** + * The type of image error encountered. Optional for older image errors. + */ + code: string; + /** + * The file path in the import of the image that was rejected. + */ + filePath: string; + } /** - * The x component. - */ - x: number; + * A response message from a request to list. + */ + export interface Schema$ListAssetsResponse { + /** + * A list of assets that match the criteria specified in the request. + */ + assets: Schema$Asset[]; + /** + * The continuation token for retrieving the next page. If empty, indicates + * that there are no more pages. To get the next page, submit the same + * request specifying this value as the page_token. + */ + nextPageToken: string; + /** + * The total number of assets in the list, without pagination. + */ + totalSize: number; + } /** - * The y component. - */ - y: number; + * A response message from a request to list. + */ + export interface Schema$ListLikedAssetsResponse { + /** + * A list of assets that match the criteria specified in the request. + */ + assets: Schema$Asset[]; + /** + * The continuation token for retrieving the next page. If empty, indicates + * that there are no more pages. To get the next page, submit the same + * request specifying this value as the page_token. + */ + nextPageToken: string; + /** + * The total number of assets in the list, without pagination. + */ + totalSize: number; + } /** - * The z component. - */ - z: number; -} -/** - * A response message from a request to list. This is returned in the response - * field of the Operation. - */ -export interface Schema$StartAssetImportResponse { + * A response message from a request to list. + */ + export interface Schema$ListUserAssetsResponse { + /** + * The continuation token for retrieving the next page. If empty, indicates + * that there are no more pages. To get the next page, submit the same + * request specifying this value as the page_token. + */ + nextPageToken: string; + /** + * The total number of assets in the list, without pagination. + */ + totalSize: number; + /** + * A list of UserAssets matching the request. + */ + userAssets: Schema$UserAsset[]; + } /** - * The id of newly created asset. If this is empty when the operation is - * complete it means the import failed. Please refer to the - * asset_import_message field to understand what went wrong. - */ - assetId: string; + * Details of an error resulting from parsing an OBJ file + */ + export interface Schema$ObjParseError { + /** + * The type of problem found (required). + */ + code: string; + /** + * The ending character index at which the problem was found. + */ + endIndex: number; + /** + * The file path in which the problem was found. + */ + filePath: string; + /** + * The text of the line. Note that this may be truncated if the line was + * very long. This may not include the error if it occurs after line + * truncation. + */ + line: string; + /** + * Line number at which the problem was found. + */ + lineNumber: number; + /** + * The starting character index at which the problem was found. + */ + startIndex: number; + } /** - * The id of the asset import. - */ - assetImportId: string; + * Hints for displaying the asset, based on information available when the + * asset was uploaded. + */ + export interface Schema$PresentationParams { + /** + * The materials' diffuse/albedo color. This does not apply to vertex + * colors or texture maps. + */ + colorSpace: string; + /** + * A rotation that should be applied to the object root to make it upright. + * More precisely, this quaternion transforms from "object space" + * (the space in which the object is defined) to "presentation + * space", a coordinate system where +Y is up, +X is right, -Z is + * forward. For example, if the object is the Eiffel Tower, in its local + * coordinate system the object might be laid out such that the base of the + * tower is on the YZ plane and the tip of the tower is towards positive X. + * In this case this quaternion would specify a rotation (of 90 degrees + * about the Z axis) such that in the presentation space the base of the + * tower is aligned with the XZ plane, and the tip of the tower lies towards + * +Y. This rotation is unrelated to the object's pose in the web + * preview, which is just a camera position setting and is *not* reflected + * in this rotation. Please note: this is applicable only to the gLTF. + */ + orientingRotation: Schema$Quaternion; + } /** - * The message from the asset import. This will contain any warnings (or - in - * the case of failure - errors) that occurred during import. - */ - assetImportMessages: Schema$AssetImportMessage[]; + * A [Quaternion](//en.wikipedia.org/wiki/Quaternion). Please note: if in the + * response you see "w: 1" and nothing else this is the default + * value of [0, 0, 0, 1] where x,y, and z are 0. + */ + export interface Schema$Quaternion { + /** + * The scalar component. + */ + w: number; + /** + * The x component. + */ + x: number; + /** + * The y component. + */ + y: number; + /** + * The z component. + */ + z: number; + } /** - * The publish URL for the asset. - */ - publishUrl: string; -} -/** - * Data about the user's asset. - */ -export interface Schema$UserAsset { + * A response message from a request to list. This is returned in the response + * field of the Operation. + */ + export interface Schema$StartAssetImportResponse { + /** + * The id of newly created asset. If this is empty when the operation is + * complete it means the import failed. Please refer to the + * asset_import_message field to understand what went wrong. + */ + assetId: string; + /** + * The id of the asset import. + */ + assetImportId: string; + /** + * The message from the asset import. This will contain any warnings (or - + * in the case of failure - errors) that occurred during import. + */ + assetImportMessages: Schema$AssetImportMessage[]; + /** + * The publish URL for the asset. + */ + publishUrl: string; + } /** - * An Asset. + * Data about the user's asset. */ - asset: Schema$Asset; -} - -export class Resource$Assets { - root: Poly; - constructor(root: Poly) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$UserAsset { + /** + * An Asset. + */ + asset: Schema$Asset; } - - /** - * poly.assets.get - * @desc Returns detailed information about an asset given its name. PRIVATE - * assets are returned only if the currently authenticated user (via OAuth - * token) is the author of the asset. - * @alias poly.assets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. An asset's name in the form `assets/{ASSET_ID}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Assets { + root: Poly; + constructor(root: Poly) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * poly.assets.list - * @desc Lists all public, remixable assets. These are assets with an access - * level of PUBLIC and published under the CC-By license. - * @alias poly.assets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.category Filter assets based on the specified category. Supported values are: `animals`, `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`, `technology`, and `transport`. - * @param {boolean=} params.curated Return only assets that have been curated by the Poly team. - * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. - * @param {string=} params.keywords One or more search terms to be matched against all text that Poly has indexed for assets, which includes display_name, description, and tags. Multiple keywords should be separated by spaces. - * @param {string=} params.maxComplexity Returns assets that are of the specified complexity or less. Defaults to COMPLEX. For example, a request for MEDIUM assets also includes SIMPLE assets. - * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets based on a combination of popularity and other features. - * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. - * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/assets').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * poly.assets.get + * @desc Returns detailed information about an asset given its name. PRIVATE + * assets are returned only if the currently authenticated user (via OAuth + * token) is the author of the asset. + * @alias poly.assets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. An asset's name in the form `assets/{ASSET_ID}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} - -export class Resource$Users { - root: Poly; - assets: Resource$Users$Assets; - likedassets: Resource$Users$Likedassets; - constructor(root: Poly) { - this.root = root; - this.getRoot.bind(this); - this.assets = new Resource$Users$Assets(root); - this.likedassets = new Resource$Users$Likedassets(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Users$Assets { - root: Poly; - constructor(root: Poly) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * poly.assets.list + * @desc Lists all public, remixable assets. These are assets with an access + * level of PUBLIC and published under the CC-By license. + * @alias poly.assets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.category Filter assets based on the specified category. Supported values are: `animals`, `architecture`, `art`, `food`, `nature`, `objects`, `people`, `scenes`, `technology`, and `transport`. + * @param {boolean=} params.curated Return only assets that have been curated by the Poly team. + * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + * @param {string=} params.keywords One or more search terms to be matched against all text that Poly has indexed for assets, which includes display_name, description, and tags. Multiple keywords should be separated by spaces. + * @param {string=} params.maxComplexity Returns assets that are of the specified complexity or less. Defaults to COMPLEX. For example, a request for MEDIUM assets also includes SIMPLE assets. + * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets based on a combination of popularity and other features. + * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. + * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/assets').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Users { + root: Poly; + assets: Resource$Users$Assets; + likedassets: Resource$Users$Likedassets; + constructor(root: Poly) { + this.root = root; + this.getRoot.bind(this); + this.assets = new Resource$Users$Assets(root); + this.likedassets = new Resource$Users$Likedassets(root); + } - /** - * poly.users.assets.list - * @desc Lists assets authored by the given user. Only the value 'me', - * representing the currently-authenticated user, is supported. May include - * assets with an access level of PRIVATE or UNLISTED and assets which are All - * Rights Reserved for the currently-authenticated user. - * @alias poly.users.assets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. - * @param {string} params.name A valid user id. Currently, only the special value 'me', representing the currently-authenticated user is supported. To use 'me', you must pass an OAuth token with the request. - * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets based on a combination of popularity and other features. - * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. - * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. - * @param {string=} params.visibility The visibility of the assets to be returned. Defaults to VISIBILITY_UNSPECIFIED which returns all assets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Users$Assets { + root: Poly; + constructor(root: Poly) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/assets').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Users$Likedassets { - root: Poly; - constructor(root: Poly) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * poly.users.assets.list + * @desc Lists assets authored by the given user. Only the value 'me', + * representing the currently-authenticated user, is supported. May include + * assets with an access level of PRIVATE or UNLISTED and assets which are + * All Rights Reserved for the currently-authenticated user. + * @alias poly.users.assets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, and `TILT`. + * @param {string} params.name A valid user id. Currently, only the special value 'me', representing the currently-authenticated user is supported. To use 'me', you must pass an OAuth token with the request. + * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`. Defaults to `BEST`, which ranks assets based on a combination of popularity and other features. + * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. + * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. + * @param {string=} params.visibility The visibility of the assets to be returned. Defaults to VISIBILITY_UNSPECIFIED which returns all assets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/assets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * poly.users.likedassets.list - * @desc Lists assets that the user has liked. Only the value 'me', - * representing the currently-authenticated user, is supported. May include - * assets with an access level of UNLISTED. - * @alias poly.users.likedassets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. - * @param {string} params.name A valid user id. Currently, only the special value 'me', representing the currently-authenticated user is supported. To use 'me', you must pass an OAuth token with the request. - * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'. Defaults to `LIKED_TIME`, which ranks assets based on how recently they were liked. - * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. - * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Users$Likedassets { + root: Poly; + constructor(root: Poly) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/likedassets') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * poly.users.likedassets.list + * @desc Lists assets that the user has liked. Only the value 'me', + * representing the currently-authenticated user, is supported. May include + * assets with an access level of UNLISTED. + * @alias poly.users.likedassets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format Return only assets with the matching format. Acceptable values are: `BLOCKS`, `FBX`, `GLTF`, `GLTF2`, `OBJ`, `TILT`. + * @param {string} params.name A valid user id. Currently, only the special value 'me', representing the currently-authenticated user is supported. To use 'me', you must pass an OAuth token with the request. + * @param {string=} params.orderBy Specifies an ordering for assets. Acceptable values are: `BEST`, `NEWEST`, `OLDEST`, 'LIKED_TIME'. Defaults to `LIKED_TIME`, which ranks assets based on how recently they were liked. + * @param {integer=} params.pageSize The maximum number of assets to be returned. This value must be between `1` and `100`. Defaults to `20`. + * @param {string=} params.pageToken Specifies a continuation token from a previous search whose results were split into multiple pages. To get the next page, submit the same request specifying the value from next_page_token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://poly.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}/likedassets') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/prediction/v1.2.ts b/src/apis/prediction/v1.2.ts index 98a7d1f7f59..b203d15fe2c 100644 --- a/src/apis/prediction/v1.2.ts +++ b/src/apis/prediction/v1.2.ts @@ -27,406 +27,415 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Prediction API - * - * Lets you access a cloud hosted machine learning service that makes it easy to - * build smart apps - * - * @example - * const google = require('googleapis'); - * const prediction = google.prediction('v1.2'); - * - * @namespace prediction - * @type {Function} - * @version v1.2 - * @variation v1.2 - * @param {object=} options Options for Prediction - */ -export class Prediction { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace prediction_v1_2 { + /** + * Prediction API + * + * Lets you access a cloud hosted machine learning service that makes it easy + * to build smart apps + * + * @example + * const google = require('googleapis'); + * const prediction = google.prediction('v1.2'); + * + * @namespace prediction + * @type {Function} + * @version v1.2 + * @variation v1.2 + * @param {object=} options Options for Prediction + */ + export class Prediction { + _options: GlobalOptions; + google: GoogleApis; + root = this; - hostedmodels: Resource$Hostedmodels; - training: Resource$Training; + hostedmodels: Resource$Hostedmodels; + training: Resource$Training; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.hostedmodels = new Resource$Hostedmodels(this); - this.training = new Resource$Training(this); - } + this.hostedmodels = new Resource$Hostedmodels(this); + this.training = new Resource$Training(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * prediction.predict - * @desc Submit data and request a prediction - * @alias prediction.predict - * @memberOf! prediction(v1.2) - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket%2Fmydata resource in Google Storage - * @param {prediction(v1.2).Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.2/training/{data}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.predict + * @desc Submit data and request a prediction + * @alias prediction.predict + * @memberOf! prediction(v1.2) + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket%2Fmydata resource in Google Storage + * @param {prediction(v1.2).Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.2/training/{data}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export interface Schema$Input { input: any; } -export interface Schema$Output { - id: string; - kind: string; - outputLabel: string; - outputMulti: any[]; - outputValue: number; - selfLink: string; -} -export interface Schema$Training { - id: string; - kind: string; - modelInfo: any; - selfLink: string; - trainingStatus: string; -} -export interface Schema$Update { - /** - * The true class label of this instance - */ - classLabel: string; - /** - * The input features for this instance - */ - csvInstance: any[]; -} -export class Resource$Hostedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Input { input: any; } + export interface Schema$Output { + id: string; + kind: string; + outputLabel: string; + outputMulti: any[]; + outputValue: number; + selfLink: string; } - - getRoot() { - return this.root; + export interface Schema$Training { + id: string; + kind: string; + modelInfo: any; + selfLink: string; + trainingStatus: string; + } + export interface Schema$Update { + /** + * The true class label of this instance + */ + classLabel: string; + /** + * The input features for this instance + */ + csvInstance: any[]; } - - /** - * prediction.hostedmodels.predict - * @desc Submit input and request an output against a hosted model - * @alias prediction.hostedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostedModelName The name of a hosted model - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Hostedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.2/hostedmodels/{hostedModelName}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['hostedModelName'], - pathParams: ['hostedModelName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Training { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * prediction.hostedmodels.predict + * @desc Submit input and request an output against a hosted model + * @alias prediction.hostedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostedModelName The name of a hosted model + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.2/hostedmodels/{hostedModelName}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['hostedModelName'], + pathParams: ['hostedModelName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * prediction.training.delete - * @desc Delete a trained model - * @alias prediction.training.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Training { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.2/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.training.get - * @desc Check training status of your model - * @alias prediction.training.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.training.delete + * @desc Delete a trained model + * @alias prediction.training.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.2/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.2/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * prediction.training.insert - * @desc Begin training your model - * @alias prediction.training.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.data mybucket/mydata resource in Google Storage - * @param {().Training} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.training.get + * @desc Check training status of your model + * @alias prediction.training.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.2/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.2/training') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * prediction.training.update - * @desc Add new data to a trained model - * @alias prediction.training.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {().Update} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.training.insert + * @desc Begin training your model + * @alias prediction.training.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.data mybucket/mydata resource in Google Storage + * @param {().Training} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.2/training') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.2/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.training.update + * @desc Add new data to a trained model + * @alias prediction.training.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {().Update} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.2/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/prediction/v1.3.ts b/src/apis/prediction/v1.3.ts index 7f8291c7990..fafa923c9f2 100644 --- a/src/apis/prediction/v1.3.ts +++ b/src/apis/prediction/v1.3.ts @@ -27,450 +27,459 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Prediction API - * - * Lets you access a cloud hosted machine learning service that makes it easy to - * build smart apps - * - * @example - * const google = require('googleapis'); - * const prediction = google.prediction('v1.3'); - * - * @namespace prediction - * @type {Function} - * @version v1.3 - * @variation v1.3 - * @param {object=} options Options for Prediction - */ -export class Prediction { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - hostedmodels: Resource$Hostedmodels; - training: Resource$Training; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.hostedmodels = new Resource$Hostedmodels(this); - this.training = new Resource$Training(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Input { - /** - * Input to the model for a prediction - */ - input: any; -} -export interface Schema$Output { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * The most likely class [Categorical models only]. - */ - outputLabel: string; - /** - * A list of classes with their estimated probabilities [Categorical models - * only]. - */ - outputMulti: any[]; +export namespace prediction_v1_3 { /** - * The estimated regression value [Regression models only]. - */ - outputValue: number; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Training { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Model metadata. - */ - modelInfo: any; - /** - * A URL to re-request this resource. - */ - selfLink: string; - /** - * The current status of the training job. This can be one of following: - * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND - */ - trainingStatus: string; - /** - * A class weighting function, which allows the importance weights for classes - * to be specified [Categorical models only]. - */ - utility: any[]; -} -export interface Schema$Update { - /** - * The true class label of this instance - */ - classLabel: string; - /** - * The input features for this instance + * Prediction API + * + * Lets you access a cloud hosted machine learning service that makes it easy + * to build smart apps + * + * @example + * const google = require('googleapis'); + * const prediction = google.prediction('v1.3'); + * + * @namespace prediction + * @type {Function} + * @version v1.3 + * @variation v1.3 + * @param {object=} options Options for Prediction */ - csvInstance: any[]; -} - -export class Resource$Hostedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); - } + export class Prediction { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + hostedmodels: Resource$Hostedmodels; + training: Resource$Training; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * prediction.hostedmodels.predict - * @desc Submit input and request an output against a hosted model - * @alias prediction.hostedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostedModelName The name of a hosted model - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.hostedmodels = new Resource$Hostedmodels(this); + this.training = new Resource$Training(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.3/hostedmodels/{hostedModelName}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['hostedModelName'], - pathParams: ['hostedModelName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Training { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Input { + /** + * Input to the model for a prediction + */ + input: any; } - - getRoot() { - return this.root; + export interface Schema$Output { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * The most likely class [Categorical models only]. + */ + outputLabel: string; + /** + * A list of classes with their estimated probabilities [Categorical models + * only]. + */ + outputMulti: any[]; + /** + * The estimated regression value [Regression models only]. + */ + outputValue: number; + /** + * A URL to re-request this resource. + */ + selfLink: string; + } + export interface Schema$Training { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Model metadata. + */ + modelInfo: any; + /** + * A URL to re-request this resource. + */ + selfLink: string; + /** + * The current status of the training job. This can be one of following: + * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + */ + trainingStatus: string; + /** + * A class weighting function, which allows the importance weights for + * classes to be specified [Categorical models only]. + */ + utility: any[]; + } + export interface Schema$Update { + /** + * The true class label of this instance + */ + classLabel: string; + /** + * The input features for this instance + */ + csvInstance: any[]; } - - /** - * prediction.training.delete - * @desc Delete a trained model - * @alias prediction.training.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Hostedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.3/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.training.get - * @desc Check training status of your model - * @alias prediction.training.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.3/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.hostedmodels.predict + * @desc Submit input and request an output against a hosted model + * @alias prediction.hostedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostedModelName The name of a hosted model + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.3/hostedmodels/{hostedModelName}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['hostedModelName'], + pathParams: ['hostedModelName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * prediction.training.insert - * @desc Begin training your model - * @alias prediction.training.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Training} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Training { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.3/training') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.training.predict - * @desc Submit data and request a prediction - * @alias prediction.training.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.training.delete + * @desc Delete a trained model + * @alias prediction.training.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.3/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.3/training/{data}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.training.get + * @desc Check training status of your model + * @alias prediction.training.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.3/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * prediction.training.update - * @desc Add new data to a trained model - * @alias prediction.training.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.data mybucket/mydata resource in Google Storage - * @param {().Update} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.training.insert + * @desc Begin training your model + * @alias prediction.training.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Training} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.3/training') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * prediction.training.predict + * @desc Submit data and request a prediction + * @alias prediction.training.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.3/training/{data}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.3/training/{data}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['data'], - pathParams: ['data'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.training.update + * @desc Add new data to a trained model + * @alias prediction.training.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.data mybucket/mydata resource in Google Storage + * @param {().Update} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.3/training/{data}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['data'], + pathParams: ['data'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/prediction/v1.4.ts b/src/apis/prediction/v1.4.ts index 199ab1d6457..f7cc2f0b348 100644 --- a/src/apis/prediction/v1.4.ts +++ b/src/apis/prediction/v1.4.ts @@ -27,470 +27,479 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Prediction API - * - * Lets you access a cloud hosted machine learning service that makes it easy to - * build smart apps - * - * @example - * const google = require('googleapis'); - * const prediction = google.prediction('v1.4'); - * - * @namespace prediction - * @type {Function} - * @version v1.4 - * @variation v1.4 - * @param {object=} options Options for Prediction - */ -export class Prediction { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - hostedmodels: Resource$Hostedmodels; - trainedmodels: Resource$Trainedmodels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.hostedmodels = new Resource$Hostedmodels(this); - this.trainedmodels = new Resource$Trainedmodels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Input { - /** - * Input to the model for a prediction - */ - input: any; -} -export interface Schema$Output { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * The most likely class label [Categorical models only]. - */ - outputLabel: string; - /** - * A list of class labels with their estimated probabilities [Categorical - * models only]. - */ - outputMulti: any[]; - /** - * The estimated regression value [Regression models only]. - */ - outputValue: number; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Training { - /** - * Data Analysis. - */ - dataAnalysis: any; - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Model metadata. - */ - modelInfo: any; - /** - * A URL to re-request this resource. - */ - selfLink: string; - /** - * Google storage location of the training data file. - */ - storageDataLocation: string; - /** - * Google storage location of the preprocessing pmml file. - */ - storagePMMLLocation: string; - /** - * Google storage location of the pmml model file. - */ - storagePMMLModelLocation: string; - /** - * The current status of the training job. This can be one of following: - * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND - */ - trainingStatus: string; - /** - * A class weighting function, which allows the importance weights for class - * labels to be specified [Categorical models only]. - */ - utility: any[]; -} -export interface Schema$Update { - /** - * The input features for this instance - */ - csvInstance: any[]; +export namespace prediction_v1_4 { /** - * The class label of this instance - */ - label: string; - /** - * The generic output value - could be regression value or class label + * Prediction API + * + * Lets you access a cloud hosted machine learning service that makes it easy + * to build smart apps + * + * @example + * const google = require('googleapis'); + * const prediction = google.prediction('v1.4'); + * + * @namespace prediction + * @type {Function} + * @version v1.4 + * @variation v1.4 + * @param {object=} options Options for Prediction */ - output: string; -} + export class Prediction { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Hostedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + hostedmodels: Resource$Hostedmodels; + trainedmodels: Resource$Trainedmodels; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * prediction.hostedmodels.predict - * @desc Submit input and request an output against a hosted model. - * @alias prediction.hostedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostedModelName The name of a hosted model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.hostedmodels = new Resource$Hostedmodels(this); + this.trainedmodels = new Resource$Trainedmodels(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.4/hostedmodels/{hostedModelName}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['hostedModelName'], - pathParams: ['hostedModelName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Trainedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Input { + /** + * Input to the model for a prediction + */ + input: any; } - - getRoot() { - return this.root; + export interface Schema$Output { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * The most likely class label [Categorical models only]. + */ + outputLabel: string; + /** + * A list of class labels with their estimated probabilities [Categorical + * models only]. + */ + outputMulti: any[]; + /** + * The estimated regression value [Regression models only]. + */ + outputValue: number; + /** + * A URL to re-request this resource. + */ + selfLink: string; + } + export interface Schema$Training { + /** + * Data Analysis. + */ + dataAnalysis: any; + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Model metadata. + */ + modelInfo: any; + /** + * A URL to re-request this resource. + */ + selfLink: string; + /** + * Google storage location of the training data file. + */ + storageDataLocation: string; + /** + * Google storage location of the preprocessing pmml file. + */ + storagePMMLLocation: string; + /** + * Google storage location of the pmml model file. + */ + storagePMMLModelLocation: string; + /** + * The current status of the training job. This can be one of following: + * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + */ + trainingStatus: string; + /** + * A class weighting function, which allows the importance weights for class + * labels to be specified [Categorical models only]. + */ + utility: any[]; + } + export interface Schema$Update { + /** + * The input features for this instance + */ + csvInstance: any[]; + /** + * The class label of this instance + */ + label: string; + /** + * The generic output value - could be regression value or class label + */ + output: string; } - - /** - * prediction.trainedmodels.delete - * @desc Delete a trained model. - * @alias prediction.trainedmodels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Hostedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.get - * @desc Check training status of your model. - * @alias prediction.trainedmodels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.hostedmodels.predict + * @desc Submit input and request an output against a hosted model. + * @alias prediction.hostedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostedModelName The name of a hosted model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.4/hostedmodels/{hostedModelName}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['hostedModelName'], + pathParams: ['hostedModelName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * prediction.trainedmodels.insert - * @desc Begin training your model. - * @alias prediction.trainedmodels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Training} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Trainedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.4/trainedmodels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.predict - * @desc Submit model id and request a prediction - * @alias prediction.trainedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.trainedmodels.delete + * @desc Delete a trained model. + * @alias prediction.trainedmodels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.get + * @desc Check training status of your model. + * @alias prediction.trainedmodels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * prediction.trainedmodels.update - * @desc Add new data to a trained model. - * @alias prediction.trainedmodels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {().Update} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.trainedmodels.insert + * @desc Begin training your model. + * @alias prediction.trainedmodels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Training} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.4/trainedmodels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * prediction.trainedmodels.predict + * @desc Submit model id and request a prediction + * @alias prediction.trainedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.update + * @desc Add new data to a trained model. + * @alias prediction.trainedmodels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {().Update} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.4/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/prediction/v1.5.ts b/src/apis/prediction/v1.5.ts index a558b64ce42..20bd34a1efe 100644 --- a/src/apis/prediction/v1.5.ts +++ b/src/apis/prediction/v1.5.ts @@ -27,631 +27,641 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Prediction API - * - * Lets you access a cloud hosted machine learning service that makes it easy to - * build smart apps - * - * @example - * const google = require('googleapis'); - * const prediction = google.prediction('v1.5'); - * - * @namespace prediction - * @type {Function} - * @version v1.5 - * @variation v1.5 - * @param {object=} options Options for Prediction - */ -export class Prediction { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace prediction_v1_5 { + /** + * Prediction API + * + * Lets you access a cloud hosted machine learning service that makes it easy + * to build smart apps + * + * @example + * const google = require('googleapis'); + * const prediction = google.prediction('v1.5'); + * + * @namespace prediction + * @type {Function} + * @version v1.5 + * @variation v1.5 + * @param {object=} options Options for Prediction + */ + export class Prediction { + _options: GlobalOptions; + google: GoogleApis; + root = this; - hostedmodels: Resource$Hostedmodels; - trainedmodels: Resource$Trainedmodels; + hostedmodels: Resource$Hostedmodels; + trainedmodels: Resource$Trainedmodels; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.hostedmodels = new Resource$Hostedmodels(this); - this.trainedmodels = new Resource$Trainedmodels(this); - } + this.hostedmodels = new Resource$Hostedmodels(this); + this.trainedmodels = new Resource$Trainedmodels(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} - -export interface Schema$Analyze { - /** - * Description of the data the model was trained on. - */ - dataDescription: any; - /** - * List of errors with the data. - */ - errors: any[]; - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Description of the model. - */ - modelDescription: any; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Input { - /** - * Input to the model for a prediction - */ - input: any; -} -export interface Schema$List { - /** - * List of models. - */ - items: Schema$Training[]; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Output { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * The most likely class label [Categorical models only]. - */ - outputLabel: string; - /** - * A list of class labels with their estimated probabilities [Categorical - * models only]. - */ - outputMulti: any[]; - /** - * The estimated regression value [Regression models only]. - */ - outputValue: number; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Training { - /** - * Insert time of the model (as a RFC 3339 timestamp). - */ - created: string; - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Model metadata. - */ - modelInfo: any; - /** - * Type of predictive model (classification or regression) - */ - modelType: string; - /** - * A URL to re-request this resource. - */ - selfLink: string; - /** - * Google storage location of the training data file. - */ - storageDataLocation: string; - /** - * Google storage location of the preprocessing pmml file. - */ - storagePMMLLocation: string; - /** - * Google storage location of the pmml model file. - */ - storagePMMLModelLocation: string; - /** - * Training completion time (as a RFC 3339 timestamp). - */ - trainingComplete: string; - /** - * Instances to train model on. - */ - trainingInstances: any[]; - /** - * The current status of the training job. This can be one of following: - * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND - */ - trainingStatus: string; - /** - * A class weighting function, which allows the importance weights for class - * labels to be specified [Categorical models only]. - */ - utility: any[]; -} -export interface Schema$Update { - /** - * The input features for this instance - */ - csvInstance: any[]; - /** - * The class label of this instance - */ - label: string; - /** - * The generic output value - could be regression value or class label - */ - output: string; -} -export class Resource$Hostedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Analyze { + /** + * Description of the data the model was trained on. + */ + dataDescription: any; + /** + * List of errors with the data. + */ + errors: any[]; + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Description of the model. + */ + modelDescription: any; + /** + * A URL to re-request this resource. + */ + selfLink: string; } - - getRoot() { - return this.root; + export interface Schema$Input { + /** + * Input to the model for a prediction + */ + input: any; } - - - /** - * prediction.hostedmodels.predict - * @desc Submit input and request an output against a hosted model. - * @alias prediction.hostedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostedModelName The name of a hosted model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.5/hostedmodels/{hostedModelName}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['hostedModelName'], - pathParams: ['hostedModelName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$List { + /** + * List of models. + */ + items: Schema$Training[]; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; + /** + * A URL to re-request this resource. + */ + selfLink: string; } -} - -export class Resource$Trainedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Output { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * The most likely class label [Categorical models only]. + */ + outputLabel: string; + /** + * A list of class labels with their estimated probabilities [Categorical + * models only]. + */ + outputMulti: any[]; + /** + * The estimated regression value [Regression models only]. + */ + outputValue: number; + /** + * A URL to re-request this resource. + */ + selfLink: string; } - - getRoot() { - return this.root; + export interface Schema$Training { + /** + * Insert time of the model (as a RFC 3339 timestamp). + */ + created: string; + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Model metadata. + */ + modelInfo: any; + /** + * Type of predictive model (classification or regression) + */ + modelType: string; + /** + * A URL to re-request this resource. + */ + selfLink: string; + /** + * Google storage location of the training data file. + */ + storageDataLocation: string; + /** + * Google storage location of the preprocessing pmml file. + */ + storagePMMLLocation: string; + /** + * Google storage location of the pmml model file. + */ + storagePMMLModelLocation: string; + /** + * Training completion time (as a RFC 3339 timestamp). + */ + trainingComplete: string; + /** + * Instances to train model on. + */ + trainingInstances: any[]; + /** + * The current status of the training job. This can be one of following: + * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + */ + trainingStatus: string; + /** + * A class weighting function, which allows the importance weights for class + * labels to be specified [Categorical models only]. + */ + utility: any[]; + } + export interface Schema$Update { + /** + * The input features for this instance + */ + csvInstance: any[]; + /** + * The class label of this instance + */ + label: string; + /** + * The generic output value - could be regression value or class label + */ + output: string; } - - /** - * prediction.trainedmodels.analyze - * @desc Get analysis of the model and the data the model was trained on. - * @alias prediction.trainedmodels.analyze - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyze(params?: any, options?: MethodOptions): AxiosPromise; - analyze( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyze( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Hostedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}/analyze') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.delete - * @desc Delete a trained model. - * @alias prediction.trainedmodels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.hostedmodels.predict + * @desc Submit input and request an output against a hosted model. + * @alias prediction.hostedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostedModelName The name of a hosted model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.5/hostedmodels/{hostedModelName}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['hostedModelName'], + pathParams: ['hostedModelName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * prediction.trainedmodels.get - * @desc Check training status of your model. - * @alias prediction.trainedmodels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Trainedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.insert - * @desc Begin training your model. - * @alias prediction.trainedmodels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Training} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.trainedmodels.analyze + * @desc Get analysis of the model and the data the model was trained on. + * @alias prediction.trainedmodels.analyze + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyze(params?: any, options?: MethodOptions): + AxiosPromise; + analyze( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyze( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}/analyze') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * prediction.trainedmodels.list - * @desc List available models. - * @alias prediction.trainedmodels.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return - * @param {string=} params.pageToken Pagination token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/list') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.trainedmodels.delete + * @desc Delete a trained model. + * @alias prediction.trainedmodels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * prediction.trainedmodels.predict - * @desc Submit model id and request a prediction. - * @alias prediction.trainedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.trainedmodels.get + * @desc Check training status of your model. + * @alias prediction.trainedmodels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.insert + * @desc Begin training your model. + * @alias prediction.trainedmodels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Training} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * prediction.trainedmodels.update - * @desc Add new data to a trained model. - * @alias prediction.trainedmodels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {().Update} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.trainedmodels.list + * @desc List available models. + * @alias prediction.trainedmodels.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return + * @param {string=} params.pageToken Pagination token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/list') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * prediction.trainedmodels.predict + * @desc Submit model id and request a prediction. + * @alias prediction.trainedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.update + * @desc Add new data to a trained model. + * @alias prediction.trainedmodels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {().Update} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/prediction/v1.5/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/prediction/v1.6.ts b/src/apis/prediction/v1.6.ts index 5fc8231ea00..211de26b6c1 100644 --- a/src/apis/prediction/v1.6.ts +++ b/src/apis/prediction/v1.6.ts @@ -27,1133 +27,1150 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Prediction API - * - * Lets you access a cloud hosted machine learning service that makes it easy to - * build smart apps - * - * @example - * const google = require('googleapis'); - * const prediction = google.prediction('v1.6'); - * - * @namespace prediction - * @type {Function} - * @version v1.6 - * @variation v1.6 - * @param {object=} options Options for Prediction - */ -export class Prediction { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - hostedmodels: Resource$Hostedmodels; - trainedmodels: Resource$Trainedmodels; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.hostedmodels = new Resource$Hostedmodels(this); - this.trainedmodels = new Resource$Trainedmodels(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Analyze { - /** - * Description of the data the model was trained on. - */ - dataDescription: any; - /** - * List of errors with the data. - */ - errors: any[]; - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Description of the model. - */ - modelDescription: any; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Input { - /** - * Input to the model for a prediction. - */ - input: any; -} -export interface Schema$Insert { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * Type of predictive model (classification or regression). - */ - modelType: string; - /** - * The Id of the model to be copied over. - */ - sourceModel: string; - /** - * Google storage location of the training data file. - */ - storageDataLocation: string; - /** - * Google storage location of the preprocessing pmml file. - */ - storagePMMLLocation: string; - /** - * Google storage location of the pmml model file. - */ - storagePMMLModelLocation: string; - /** - * Instances to train model on. - */ - trainingInstances: any[]; - /** - * A class weighting function, which allows the importance weights for class - * labels to be specified (Categorical models only). - */ - utility: any[]; -} -export interface Schema$Insert2 { - /** - * Insert time of the model (as a RFC 3339 timestamp). - */ - created: string; - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Model metadata. - */ - modelInfo: any; - /** - * Type of predictive model (CLASSIFICATION or REGRESSION). - */ - modelType: string; +export namespace prediction_v1_6 { /** - * A URL to re-request this resource. - */ - selfLink: string; - /** - * Google storage location of the training data file. - */ - storageDataLocation: string; - /** - * Google storage location of the preprocessing pmml file. - */ - storagePMMLLocation: string; - /** - * Google storage location of the pmml model file. - */ - storagePMMLModelLocation: string; - /** - * Training completion time (as a RFC 3339 timestamp). - */ - trainingComplete: string; - /** - * The current status of the training job. This can be one of following: - * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND - */ - trainingStatus: string; -} -export interface Schema$List { - /** - * List of models. - */ - items: Schema$Insert2[]; - /** - * What kind of resource this is. - */ - kind: string; - /** - * Pagination token to fetch the next page, if one exists. - */ - nextPageToken: string; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Output { - /** - * The unique name for the predictive model. - */ - id: string; - /** - * What kind of resource this is. - */ - kind: string; - /** - * The most likely class label (Categorical models only). - */ - outputLabel: string; - /** - * A list of class labels with their estimated probabilities (Categorical - * models only). - */ - outputMulti: any[]; - /** - * The estimated regression value (Regression models only). - */ - outputValue: string; - /** - * A URL to re-request this resource. - */ - selfLink: string; -} -export interface Schema$Update { - /** - * The input features for this instance. - */ - csvInstance: any[]; - /** - * The generic output value - could be regression or class label. + * Prediction API + * + * Lets you access a cloud hosted machine learning service that makes it easy + * to build smart apps + * + * @example + * const google = require('googleapis'); + * const prediction = google.prediction('v1.6'); + * + * @namespace prediction + * @type {Function} + * @version v1.6 + * @variation v1.6 + * @param {object=} options Options for Prediction */ - output: string; -} - -export class Resource$Hostedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); - } + export class Prediction { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + hostedmodels: Resource$Hostedmodels; + trainedmodels: Resource$Trainedmodels; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * prediction.hostedmodels.predict - * @desc Submit input and request an output against a hosted model. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The name of a hosted model. - * hostedModelName: 'my-hosted-model-name', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * prediction.hostedmodels.predict(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.hostedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.hostedModelName The name of a hosted model. - * @param {string} params.project The project associated with the model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.hostedmodels = new Resource$Hostedmodels(this); + this.trainedmodels = new Resource$Trainedmodels(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/prediction/v1.6/projects/{project}/hostedmodels/{hostedModelName}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'hostedModelName'], - pathParams: ['hostedModelName', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Trainedmodels { - root: Prediction; - constructor(root: Prediction) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Analyze { + /** + * Description of the data the model was trained on. + */ + dataDescription: any; + /** + * List of errors with the data. + */ + errors: any[]; + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Description of the model. + */ + modelDescription: any; + /** + * A URL to re-request this resource. + */ + selfLink: string; } - - getRoot() { - return this.root; + export interface Schema$Input { + /** + * Input to the model for a prediction. + */ + input: any; + } + export interface Schema$Insert { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * Type of predictive model (classification or regression). + */ + modelType: string; + /** + * The Id of the model to be copied over. + */ + sourceModel: string; + /** + * Google storage location of the training data file. + */ + storageDataLocation: string; + /** + * Google storage location of the preprocessing pmml file. + */ + storagePMMLLocation: string; + /** + * Google storage location of the pmml model file. + */ + storagePMMLModelLocation: string; + /** + * Instances to train model on. + */ + trainingInstances: any[]; + /** + * A class weighting function, which allows the importance weights for class + * labels to be specified (Categorical models only). + */ + utility: any[]; + } + export interface Schema$Insert2 { + /** + * Insert time of the model (as a RFC 3339 timestamp). + */ + created: string; + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Model metadata. + */ + modelInfo: any; + /** + * Type of predictive model (CLASSIFICATION or REGRESSION). + */ + modelType: string; + /** + * A URL to re-request this resource. + */ + selfLink: string; + /** + * Google storage location of the training data file. + */ + storageDataLocation: string; + /** + * Google storage location of the preprocessing pmml file. + */ + storagePMMLLocation: string; + /** + * Google storage location of the pmml model file. + */ + storagePMMLModelLocation: string; + /** + * Training completion time (as a RFC 3339 timestamp). + */ + trainingComplete: string; + /** + * The current status of the training job. This can be one of following: + * RUNNING; DONE; ERROR; ERROR: TRAINING JOB NOT FOUND + */ + trainingStatus: string; + } + export interface Schema$List { + /** + * List of models. + */ + items: Schema$Insert2[]; + /** + * What kind of resource this is. + */ + kind: string; + /** + * Pagination token to fetch the next page, if one exists. + */ + nextPageToken: string; + /** + * A URL to re-request this resource. + */ + selfLink: string; + } + export interface Schema$Output { + /** + * The unique name for the predictive model. + */ + id: string; + /** + * What kind of resource this is. + */ + kind: string; + /** + * The most likely class label (Categorical models only). + */ + outputLabel: string; + /** + * A list of class labels with their estimated probabilities (Categorical + * models only). + */ + outputMulti: any[]; + /** + * The estimated regression value (Regression models only). + */ + outputValue: string; + /** + * A URL to re-request this resource. + */ + selfLink: string; + } + export interface Schema$Update { + /** + * The input features for this instance. + */ + csvInstance: any[]; + /** + * The generic output value - could be regression or class label. + */ + output: string; } - - /** - * prediction.trainedmodels.analyze - * @desc Get analysis of the model and the data the model was trained on. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The unique name for the predictive model. - * id: 'my-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.analyze(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.analyze - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {string} params.project The project associated with the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - analyze(params?: any, options?: MethodOptions): AxiosPromise; - analyze( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - analyze( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Hostedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/{id}/analyze') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'id'], - pathParams: ['id', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.delete - * @desc Delete a trained model. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The unique name for the predictive model. - * id: 'my-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {string} params.project The project associated with the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'id'], - pathParams: ['id', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * prediction.hostedmodels.predict + * @desc Submit input and request an output against a hosted model. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The name of a hosted model. + * hostedModelName: 'my-hosted-model-name', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * prediction.hostedmodels.predict(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.hostedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.hostedModelName The name of a hosted model. + * @param {string} params.project The project associated with the model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/prediction/v1.6/projects/{project}/hostedmodels/{hostedModelName}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'hostedModelName'], + pathParams: ['hostedModelName', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * prediction.trainedmodels.get - * @desc Check training status of your model. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The unique name for the predictive model. - * id: 'my-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {string} params.project The project associated with the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Trainedmodels { + root: Prediction; + constructor(root: Prediction) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'id'], - pathParams: ['id', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * prediction.trainedmodels.insert - * @desc Train a Prediction API model. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project associated with the model. - * @param {().Insert} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.trainedmodels.analyze + * @desc Get analysis of the model and the data the model was trained on. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The unique name for the predictive model. + * id: 'my-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.analyze(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.analyze + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {string} params.project The project associated with the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + analyze(params?: any, options?: MethodOptions): + AxiosPromise; + analyze( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + analyze( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/{id}/analyze') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'id'], + pathParams: ['id', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/prediction/v1.6/projects/{project}/trainedmodels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * prediction.trainedmodels.list - * @desc List available models. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * prediction.trainedmodels.list(request, handlePage); - * } - * }; - * - * prediction.trainedmodels.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of results to return. - * @param {string=} params.pageToken Pagination token. - * @param {string} params.project The project associated with the model. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.trainedmodels.delete + * @desc Delete a trained model. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The unique name for the predictive model. + * id: 'my-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {string} params.project The project associated with the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'id'], + pathParams: ['id', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/list') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * prediction.trainedmodels.predict - * @desc Submit model id and request a prediction. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The unique name for the predictive model. - * id: 'my-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.predict(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.predict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {string} params.project The project associated with the model. - * @param {().Input} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - predict(params?: any, options?: MethodOptions): AxiosPromise; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - predict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * prediction.trainedmodels.get + * @desc Check training status of your model. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The unique name for the predictive model. + * id: 'my-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {string} params.project The project associated with the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'id'], + pathParams: ['id', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/{id}/predict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'id'], - pathParams: ['id', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.insert + * @desc Train a Prediction API model. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project associated with the model. + * @param {().Insert} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * prediction.trainedmodels.update - * @desc Add new data to a trained model. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Prediction API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/prediction - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var prediction = google.prediction('v1.6'); - * - * authorize(function(authClient) { - * var request = { - * // The project associated with the model. - * project: 'my-project', // TODO: Update placeholder value. - * - * // The unique name for the predictive model. - * id: 'my-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * prediction.trainedmodels.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias prediction.trainedmodels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The unique name for the predictive model. - * @param {string} params.project The project associated with the model. - * @param {().Update} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * prediction.trainedmodels.list + * @desc List available models. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * prediction.trainedmodels.list(request, handlePage); + * } + * }; + * + * prediction.trainedmodels.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of results to return. + * @param {string=} params.pageToken Pagination token. + * @param {string} params.project The project associated with the model. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/list') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * prediction.trainedmodels.predict + * @desc Submit model id and request a prediction. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The unique name for the predictive model. + * id: 'my-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.predict(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.predict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {string} params.project The project associated with the model. + * @param {().Input} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + predict(params?: any, options?: MethodOptions): AxiosPromise; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + predict( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/{id}/predict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'id'], + pathParams: ['id', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/prediction/v1.6/projects/{project}/trainedmodels/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'id'], - pathParams: ['id', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * prediction.trainedmodels.update + * @desc Add new data to a trained model. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Prediction API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/prediction + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var prediction = google.prediction('v1.6'); + * + * authorize(function(authClient) { + * var request = { + * // The project associated with the model. + * project: 'my-project', // TODO: Update placeholder value. + * + * // The unique name for the predictive model. + * id: 'my-id', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * prediction.trainedmodels.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias prediction.trainedmodels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The unique name for the predictive model. + * @param {string} params.project The project associated with the model. + * @param {().Update} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/prediction/v1.6/projects/{project}/trainedmodels/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'id'], + pathParams: ['id', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/proximitybeacon/v1beta1.ts b/src/apis/proximitybeacon/v1beta1.ts index 16cc64495c8..75cd94f92e3 100644 --- a/src/apis/proximitybeacon/v1beta1.ts +++ b/src/apis/proximitybeacon/v1beta1.ts @@ -27,1666 +27,1704 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Proximity Beacon API - * - * Registers, manages, indexes, and searches beacons. - * - * @example - * const google = require('googleapis'); - * const proximitybeacon = google.proximitybeacon('v1beta1'); - * - * @namespace proximitybeacon - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Proximitybeacon - */ -export class Proximitybeacon { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace proximitybeacon_v1beta1 { + /** + * Proximity Beacon API + * + * Registers, manages, indexes, and searches beacons. + * + * @example + * const google = require('googleapis'); + * const proximitybeacon = google.proximitybeacon('v1beta1'); + * + * @namespace proximitybeacon + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Proximitybeacon + */ + export class Proximitybeacon { + _options: GlobalOptions; + google: GoogleApis; + root = this; - beaconinfo: Resource$Beaconinfo; - beacons: Resource$Beacons; - namespaces: Resource$Namespaces; - v1beta1: Resource$V1beta1; + beaconinfo: Resource$Beaconinfo; + beacons: Resource$Beacons; + namespaces: Resource$Namespaces; + v1beta1: Resource$V1beta1; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.beaconinfo = new Resource$Beaconinfo(this); - this.beacons = new Resource$Beacons(this); - this.namespaces = new Resource$Namespaces(this); - this.v1beta1 = new Resource$V1beta1(this); - } + this.beaconinfo = new Resource$Beaconinfo(this); + this.beacons = new Resource$Beacons(this); + this.namespaces = new Resource$Namespaces(this); + this.v1beta1 = new Resource$V1beta1(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Defines a unique identifier of a beacon as broadcast by the device. - */ -export interface Schema$AdvertisedId { - /** - * The actual beacon identifier, as broadcast by the beacon hardware. Must be - * [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP - * requests, and will be so encoded (with padding) in responses. The base64 - * encoding should be of the binary byte-stream and not any textual (such as - * hex) representation thereof. Required. - */ - id: string; - /** - * Specifies the identifier type. Required. - */ - type: string; -} -/** - * A subset of attachment information served via the `beaconinfo.getforobserved` - * method, used when your users encounter your beacons. - */ -export interface Schema$AttachmentInfo { - /** - * An opaque data container for client-provided data. - */ - data: string; - /** - * The distance away from the beacon at which this attachment should be - * delivered to a mobile app. Setting this to a value greater than zero - * indicates that the app should behave as if the beacon is "seen" - * when the mobile device is less than this distance away from the beacon. - * Different attachments on the same beacon can have different max distances. - * Note that even though this value is expressed with fractional meter - * precision, real-world behavior is likley to be much less precise than one - * meter, due to the nature of current Bluetooth radio technology. Optional. - * When not set or zero, the attachment should be delivered at the - * beacon's outer limit of detection. - */ - maxDistanceMeters: number; - /** - * Specifies what kind of attachment this is. Tells a client how to interpret - * the `data` field. Format is <var>namespace/type</var>, for - * example <code>scrupulous-wombat-12345/welcome-message</code> - */ - namespacedType: string; -} -/** - * Details of a beacon device. - */ -export interface Schema$Beacon { - /** - * The identifier of a beacon as advertised by it. This field must be - * populated when registering. It may be empty when updating a beacon record - * because it is ignored in updates. When registering a beacon that - * broadcasts Eddystone-EID, this field should contain a "stable" - * Eddystone-UID that identifies the beacon and links it to its attachments. - * The stable Eddystone-UID is only used for administering the beacon. - */ - advertisedId: Schema$AdvertisedId; - /** - * Resource name of this beacon. A beacon name has the format - * "beacons/N!beaconId" where the beaconId is the base16 ID - * broadcast by the beacon and N is a code for the beacon's type. Possible - * values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This - * field must be left empty when registering. After reading a beacon, clients - * can use the name for future operations. - */ - beaconName: string; - /** - * Free text used to identify and describe the beacon. Maximum length 140 - * characters. Optional. - */ - description: string; - /** - * Write-only registration parameters for beacons using Eddystone-EID - * (remotely resolved ephemeral ID) format. This information will not be - * populated in API responses. When submitting this data, the `advertised_id` - * field must contain an ID of type Eddystone-UID. Any other ID type will - * result in an error. - */ - ephemeralIdRegistration: Schema$EphemeralIdRegistration; - /** - * Expected location stability. This is set when the beacon is registered or - * updated, not automatically detected in any way. Optional. - */ - expectedStability: string; - /** - * The indoor level information for this beacon, if known. As returned by the - * Google Maps API. Optional. - */ - indoorLevel: Schema$IndoorLevel; - /** - * The location of the beacon, expressed as a latitude and longitude pair. - * This location is given when the beacon is registered or updated. It does - * not necessarily indicate the actual current location of the beacon. - * Optional. - */ - latLng: Schema$LatLng; - /** - * The [Google Places API](/places/place-id) Place ID of the place where the - * beacon is deployed. This is given when the beacon is registered or updated, - * not automatically detected in any way. Optional. - */ - placeId: string; - /** - * Properties of the beacon device, for example battery type or firmware - * version. Optional. - */ - properties: any; - /** - * Some beacons may require a user to provide an authorization key before - * changing any of its configuration (e.g. broadcast frames, transmit power). - * This field provides a place to store and control access to that key. This - * field is populated in responses to `GET /v1beta1/beacons/3!beaconId` from - * users with write access to the given beacon. That is to say: If the user is - * authorized to write the beacon's confidential data in the service, the - * service considers them authorized to configure the beacon. Note that this - * key grants nothing on the service, only on the beacon itself. - */ - provisioningKey: string; - /** - * Current status of the beacon. Required. - */ - status: string; -} -/** - * Project-specific data associated with a beacon. - */ -export interface Schema$BeaconAttachment { - /** - * Resource name of this attachment. Attachment names have the format: - * <code>beacons/<var>beacon_id</var>/attachments/<var>attachment_id</var></code>. - * Leave this empty on creation. - */ - attachmentName: string; - /** - * The UTC time when this attachment was created, in milliseconds since the - * UNIX epoch. - */ - creationTimeMs: string; - /** - * An opaque data container for client-provided data. Must be - * [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP - * requests, and will be so encoded (with padding) in responses. Required. - */ - data: string; - /** - * The distance away from the beacon at which this attachment should be - * delivered to a mobile app. Setting this to a value greater than zero - * indicates that the app should behave as if the beacon is "seen" - * when the mobile device is less than this distance away from the beacon. - * Different attachments on the same beacon can have different max distances. - * Note that even though this value is expressed with fractional meter - * precision, real-world behavior is likley to be much less precise than one - * meter, due to the nature of current Bluetooth radio technology. Optional. - * When not set or zero, the attachment should be delivered at the - * beacon's outer limit of detection. Negative values are invalid and - * return an error. - */ - maxDistanceMeters: number; - /** - * Specifies what kind of attachment this is. Tells a client how to interpret - * the `data` field. Format is <var>namespace/type</var>. - * Namespace provides type separation between clients. Type describes the type - * of `data`, for use by the client when parsing the `data` field. Required. - */ - namespacedType: string; -} -/** - * A subset of beacon information served via the `beaconinfo.getforobserved` - * method, which you call when users of your app encounter your beacons. - */ -export interface Schema$BeaconInfo { - /** - * The ID advertised by the beacon. - */ - advertisedId: Schema$AdvertisedId; - /** - * Attachments matching the type(s) requested. May be empty if no attachment - * types were requested. - */ - attachments: Schema$AttachmentInfo[]; - /** - * The name under which the beacon is registered. - */ - beaconName: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * Response for a request to delete attachments. - */ -export interface Schema$DeleteAttachmentsResponse { - /** - * The number of attachments that were deleted. - */ - numDeleted: number; -} -/** - * Diagnostics for a single beacon. - */ -export interface Schema$Diagnostics { - /** - * An unordered list of Alerts that the beacon has. - */ - alerts: string[]; - /** - * Resource name of the beacon. For Eddystone-EID beacons, this may be the - * beacon's current EID, or the beacon's "stable" - * Eddystone-UID. - */ - beaconName: string; - /** - * The date when the battery is expected to be low. If the value is missing - * then there is no estimate for when the battery will be low. This value is - * only an estimate, not an exact date. - */ - estimatedLowBatteryDate: Schema$Date; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Write-only registration parameters for beacons using Eddystone-EID format. - * Two ways of securely registering an Eddystone-EID beacon with the service are - * supported: 1. Perform an ECDH key exchange via this API, including a - * previous call to `GET /v1beta1/eidparams`. In this case the fields - * `beacon_ecdh_public_key` and `service_ecdh_public_key` should be populated - * and `beacon_identity_key` should not be populated. This method ensures - * that only the two parties in the ECDH key exchange can compute the - * identity key, which becomes a secret between them. 2. Derive or obtain the - * beacon's identity key via other secure means (perhaps an ECDH key - * exchange between the beacon and a mobile device or any other secure - * method), and then submit the resulting identity key to the service. In - * this case `beacon_identity_key` field should be populated, and neither of - * `beacon_ecdh_public_key` nor `service_ecdh_public_key` fields should be. - * The security of this method depends on how securely the parties involved - * (in particular the bluetooth client) handle the identity key, and - * obviously on how securely the identity key was generated. See [the - * Eddystone - * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) - * at GitHub. - */ -export interface Schema$EphemeralIdRegistration { - /** - * The beacon's public key used for the Elliptic curve Diffie-Hellman key - * exchange. When this field is populated, `service_ecdh_public_key` must also - * be populated, and `beacon_identity_key` must not be. - */ - beaconEcdhPublicKey: string; - /** - * The private key of the beacon. If this field is populated, - * `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be - * populated. - */ - beaconIdentityKey: string; - /** - * The initial clock value of the beacon. The beacon's clock must have - * begun counting at this value immediately prior to transmitting this value - * to the resolving service. Significant delay in transmitting this value to - * the service risks registration or resolution failures. If a value is not - * provided, the default is zero. - */ - initialClockValue: string; - /** - * An initial ephemeral ID calculated using the clock value submitted as - * `initial_clock_value`, and the secret key generated by the Diffie-Hellman - * key exchange using `service_ecdh_public_key` and `service_ecdh_public_key`. - * This initial EID value will be used by the service to confirm that the key - * exchange process was successful. - */ - initialEid: string; - /** - * Indicates the nominal period between each rotation of the beacon's - * ephemeral ID. "Nominal" because the beacon should randomize the - * actual interval. See [the spec at - * github](https://github.com/google/eddystone/tree/master/eddystone-eid) for - * details. This value corresponds to a power-of-two scaler on the - * beacon's clock: when the scaler value is K, the beacon will begin - * broadcasting a new ephemeral ID on average every 2^K seconds. - */ - rotationPeriodExponent: number; - /** - * The service's public key used for the Elliptic curve Diffie-Hellman key - * exchange. When this field is populated, `beacon_ecdh_public_key` must also - * be populated, and `beacon_identity_key` must not be. - */ - serviceEcdhPublicKey: string; -} -/** - * Information a client needs to provision and register beacons that broadcast - * Eddystone-EID format beacon IDs, using Elliptic curve Diffie-Hellman key - * exchange. See [the Eddystone - * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) - * at GitHub. - */ -export interface Schema$EphemeralIdRegistrationParams { - /** - * Indicates the maximum rotation period supported by the service. See - * EddystoneEidRegistration.rotation_period_exponent - */ - maxRotationPeriodExponent: number; - /** - * Indicates the minimum rotation period supported by the service. See - * EddystoneEidRegistration.rotation_period_exponent - */ - minRotationPeriodExponent: number; - /** - * The beacon service's public key for use by a beacon to derive its - * Identity Key using Elliptic Curve Diffie-Hellman key exchange. - */ - serviceEcdhPublicKey: string; -} -/** - * Request for beacon and attachment information about beacons that a mobile - * client has encountered "in the wild". - */ -export interface Schema$GetInfoForObservedBeaconsRequest { + * Defines a unique identifier of a beacon as broadcast by the device. + */ + export interface Schema$AdvertisedId { + /** + * The actual beacon identifier, as broadcast by the beacon hardware. Must + * be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP + * requests, and will be so encoded (with padding) in responses. The base64 + * encoding should be of the binary byte-stream and not any textual (such as + * hex) representation thereof. Required. + */ + id: string; + /** + * Specifies the identifier type. Required. + */ + type: string; + } /** - * Specifies what kind of attachments to include in the response. When given, - * the response will include only attachments of the given types. When empty, - * no attachments will be returned. Must be in the format - * <var>namespace/type</var>. Accepts `*` to specify all types in - * all namespaces owned by the client. Optional. + * A subset of attachment information served via the + * `beaconinfo.getforobserved` method, used when your users encounter your + * beacons. */ - namespacedTypes: string[]; + export interface Schema$AttachmentInfo { + /** + * An opaque data container for client-provided data. + */ + data: string; + /** + * The distance away from the beacon at which this attachment should be + * delivered to a mobile app. Setting this to a value greater than zero + * indicates that the app should behave as if the beacon is "seen" + * when the mobile device is less than this distance away from the beacon. + * Different attachments on the same beacon can have different max + * distances. Note that even though this value is expressed with fractional + * meter precision, real-world behavior is likley to be much less precise + * than one meter, due to the nature of current Bluetooth radio technology. + * Optional. When not set or zero, the attachment should be delivered at the + * beacon's outer limit of detection. + */ + maxDistanceMeters: number; + /** + * Specifies what kind of attachment this is. Tells a client how to + * interpret the `data` field. Format is + * <var>namespace/type</var>, for example + * <code>scrupulous-wombat-12345/welcome-message</code> + */ + namespacedType: string; + } /** - * The beacons that the client has encountered. At least one must be given. - */ - observations: Schema$Observation[]; -} -/** - * Information about the requested beacons, optionally including attachment - * data. - */ -export interface Schema$GetInfoForObservedBeaconsResponse { + * Details of a beacon device. + */ + export interface Schema$Beacon { + /** + * The identifier of a beacon as advertised by it. This field must be + * populated when registering. It may be empty when updating a beacon record + * because it is ignored in updates. When registering a beacon that + * broadcasts Eddystone-EID, this field should contain a "stable" + * Eddystone-UID that identifies the beacon and links it to its attachments. + * The stable Eddystone-UID is only used for administering the beacon. + */ + advertisedId: Schema$AdvertisedId; + /** + * Resource name of this beacon. A beacon name has the format + * "beacons/N!beaconId" where the beaconId is the base16 ID + * broadcast by the beacon and N is a code for the beacon's type. + * Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for + * AltBeacon. This field must be left empty when registering. After reading + * a beacon, clients can use the name for future operations. + */ + beaconName: string; + /** + * Free text used to identify and describe the beacon. Maximum length 140 + * characters. Optional. + */ + description: string; + /** + * Write-only registration parameters for beacons using Eddystone-EID + * (remotely resolved ephemeral ID) format. This information will not be + * populated in API responses. When submitting this data, the + * `advertised_id` field must contain an ID of type Eddystone-UID. Any other + * ID type will result in an error. + */ + ephemeralIdRegistration: Schema$EphemeralIdRegistration; + /** + * Expected location stability. This is set when the beacon is registered or + * updated, not automatically detected in any way. Optional. + */ + expectedStability: string; + /** + * The indoor level information for this beacon, if known. As returned by + * the Google Maps API. Optional. + */ + indoorLevel: Schema$IndoorLevel; + /** + * The location of the beacon, expressed as a latitude and longitude pair. + * This location is given when the beacon is registered or updated. It does + * not necessarily indicate the actual current location of the beacon. + * Optional. + */ + latLng: Schema$LatLng; + /** + * The [Google Places API](/places/place-id) Place ID of the place where the + * beacon is deployed. This is given when the beacon is registered or + * updated, not automatically detected in any way. Optional. + */ + placeId: string; + /** + * Properties of the beacon device, for example battery type or firmware + * version. Optional. + */ + properties: any; + /** + * Some beacons may require a user to provide an authorization key before + * changing any of its configuration (e.g. broadcast frames, transmit + * power). This field provides a place to store and control access to that + * key. This field is populated in responses to `GET + * /v1beta1/beacons/3!beaconId` from users with write access to the given + * beacon. That is to say: If the user is authorized to write the + * beacon's confidential data in the service, the service considers them + * authorized to configure the beacon. Note that this key grants nothing on + * the service, only on the beacon itself. + */ + provisioningKey: string; + /** + * Current status of the beacon. Required. + */ + status: string; + } /** - * Public information about beacons. May be empty if the request matched no - * beacons. - */ - beacons: Schema$BeaconInfo[]; -} -/** - * Indoor level, a human-readable string as returned by Google Maps APIs, useful - * to indicate which floor of a building a beacon is located on. - */ -export interface Schema$IndoorLevel { + * Project-specific data associated with a beacon. + */ + export interface Schema$BeaconAttachment { + /** + * Resource name of this attachment. Attachment names have the format: + * <code>beacons/<var>beacon_id</var>/attachments/<var>attachment_id</var></code>. + * Leave this empty on creation. + */ + attachmentName: string; + /** + * The UTC time when this attachment was created, in milliseconds since the + * UNIX epoch. + */ + creationTimeMs: string; + /** + * An opaque data container for client-provided data. Must be + * [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP + * requests, and will be so encoded (with padding) in responses. Required. + */ + data: string; + /** + * The distance away from the beacon at which this attachment should be + * delivered to a mobile app. Setting this to a value greater than zero + * indicates that the app should behave as if the beacon is "seen" + * when the mobile device is less than this distance away from the beacon. + * Different attachments on the same beacon can have different max + * distances. Note that even though this value is expressed with fractional + * meter precision, real-world behavior is likley to be much less precise + * than one meter, due to the nature of current Bluetooth radio technology. + * Optional. When not set or zero, the attachment should be delivered at the + * beacon's outer limit of detection. Negative values are invalid and + * return an error. + */ + maxDistanceMeters: number; + /** + * Specifies what kind of attachment this is. Tells a client how to + * interpret the `data` field. Format is + * <var>namespace/type</var>. Namespace provides type separation + * between clients. Type describes the type of `data`, for use by the client + * when parsing the `data` field. Required. + */ + namespacedType: string; + } /** - * The name of this level. - */ - name: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { + * A subset of beacon information served via the `beaconinfo.getforobserved` + * method, which you call when users of your app encounter your beacons. + */ + export interface Schema$BeaconInfo { + /** + * The ID advertised by the beacon. + */ + advertisedId: Schema$AdvertisedId; + /** + * Attachments matching the type(s) requested. May be empty if no attachment + * types were requested. + */ + attachments: Schema$AttachmentInfo[]; + /** + * The name under which the beacon is registered. + */ + beaconName: string; + } /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; + } /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * Response for a request to delete attachments. */ - longitude: number; -} -/** - * Response to `ListBeaconAttachments` that contains the requested attachments. - */ -export interface Schema$ListBeaconAttachmentsResponse { + export interface Schema$DeleteAttachmentsResponse { + /** + * The number of attachments that were deleted. + */ + numDeleted: number; + } /** - * The attachments that corresponded to the request params. - */ - attachments: Schema$BeaconAttachment[]; -} -/** - * Response that contains list beacon results and pagination help. - */ -export interface Schema$ListBeaconsResponse { + * Diagnostics for a single beacon. + */ + export interface Schema$Diagnostics { + /** + * An unordered list of Alerts that the beacon has. + */ + alerts: string[]; + /** + * Resource name of the beacon. For Eddystone-EID beacons, this may be the + * beacon's current EID, or the beacon's "stable" + * Eddystone-UID. + */ + beaconName: string; + /** + * The date when the battery is expected to be low. If the value is missing + * then there is no estimate for when the battery will be low. This value is + * only an estimate, not an exact date. + */ + estimatedLowBatteryDate: Schema$Date; + } /** - * The beacons that matched the search criteria. - */ - beacons: Schema$Beacon[]; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Write-only registration parameters for beacons using Eddystone-EID format. + * Two ways of securely registering an Eddystone-EID beacon with the service + * are supported: 1. Perform an ECDH key exchange via this API, including a + * previous call to `GET /v1beta1/eidparams`. In this case the fields + * `beacon_ecdh_public_key` and `service_ecdh_public_key` should be populated + * and `beacon_identity_key` should not be populated. This method ensures + * that only the two parties in the ECDH key exchange can compute the + * identity key, which becomes a secret between them. 2. Derive or obtain the + * beacon's identity key via other secure means (perhaps an ECDH key + * exchange between the beacon and a mobile device or any other secure + * method), and then submit the resulting identity key to the service. In + * this case `beacon_identity_key` field should be populated, and neither + * of `beacon_ecdh_public_key` nor `service_ecdh_public_key` fields should + * be. The security of this method depends on how securely the parties + * involved (in particular the bluetooth client) handle the identity key, + * and obviously on how securely the identity key was generated. See [the + * Eddystone + * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) + * at GitHub. + */ + export interface Schema$EphemeralIdRegistration { + /** + * The beacon's public key used for the Elliptic curve Diffie-Hellman + * key exchange. When this field is populated, `service_ecdh_public_key` + * must also be populated, and `beacon_identity_key` must not be. + */ + beaconEcdhPublicKey: string; + /** + * The private key of the beacon. If this field is populated, + * `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be + * populated. + */ + beaconIdentityKey: string; + /** + * The initial clock value of the beacon. The beacon's clock must have + * begun counting at this value immediately prior to transmitting this value + * to the resolving service. Significant delay in transmitting this value to + * the service risks registration or resolution failures. If a value is not + * provided, the default is zero. + */ + initialClockValue: string; + /** + * An initial ephemeral ID calculated using the clock value submitted as + * `initial_clock_value`, and the secret key generated by the Diffie-Hellman + * key exchange using `service_ecdh_public_key` and + * `service_ecdh_public_key`. This initial EID value will be used by the + * service to confirm that the key exchange process was successful. + */ + initialEid: string; + /** + * Indicates the nominal period between each rotation of the beacon's + * ephemeral ID. "Nominal" because the beacon should randomize the + * actual interval. See [the spec at + * github](https://github.com/google/eddystone/tree/master/eddystone-eid) + * for details. This value corresponds to a power-of-two scaler on the + * beacon's clock: when the scaler value is K, the beacon will begin + * broadcasting a new ephemeral ID on average every 2^K seconds. + */ + rotationPeriodExponent: number; + /** + * The service's public key used for the Elliptic curve Diffie-Hellman + * key exchange. When this field is populated, `beacon_ecdh_public_key` must + * also be populated, and `beacon_identity_key` must not be. + */ + serviceEcdhPublicKey: string; + } /** - * An opaque pagination token that the client may provide in their next - * request to retrieve the next page of results. - */ - nextPageToken: string; + * Information a client needs to provision and register beacons that broadcast + * Eddystone-EID format beacon IDs, using Elliptic curve Diffie-Hellman key + * exchange. See [the Eddystone + * specification](https://github.com/google/eddystone/tree/master/eddystone-eid) + * at GitHub. + */ + export interface Schema$EphemeralIdRegistrationParams { + /** + * Indicates the maximum rotation period supported by the service. See + * EddystoneEidRegistration.rotation_period_exponent + */ + maxRotationPeriodExponent: number; + /** + * Indicates the minimum rotation period supported by the service. See + * EddystoneEidRegistration.rotation_period_exponent + */ + minRotationPeriodExponent: number; + /** + * The beacon service's public key for use by a beacon to derive its + * Identity Key using Elliptic Curve Diffie-Hellman key exchange. + */ + serviceEcdhPublicKey: string; + } /** - * Estimate of the total number of beacons matched by the query. Higher values - * may be less accurate. - */ - totalCount: string; -} -/** - * Response that contains the requested diagnostics. - */ -export interface Schema$ListDiagnosticsResponse { + * Request for beacon and attachment information about beacons that a mobile + * client has encountered "in the wild". + */ + export interface Schema$GetInfoForObservedBeaconsRequest { + /** + * Specifies what kind of attachments to include in the response. When + * given, the response will include only attachments of the given types. + * When empty, no attachments will be returned. Must be in the format + * <var>namespace/type</var>. Accepts `*` to specify all types + * in all namespaces owned by the client. Optional. + */ + namespacedTypes: string[]; + /** + * The beacons that the client has encountered. At least one must be given. + */ + observations: Schema$Observation[]; + } /** - * The diagnostics matching the given request. + * Information about the requested beacons, optionally including attachment + * data. */ - diagnostics: Schema$Diagnostics[]; + export interface Schema$GetInfoForObservedBeaconsResponse { + /** + * Public information about beacons. May be empty if the request matched no + * beacons. + */ + beacons: Schema$BeaconInfo[]; + } /** - * Token that can be used for pagination. Returned only if the request matches - * more beacons than can be returned in this response. + * Indoor level, a human-readable string as returned by Google Maps APIs, + * useful to indicate which floor of a building a beacon is located on. */ - nextPageToken: string; -} -/** - * Response to ListNamespacesRequest that contains all the project's - * namespaces. - */ -export interface Schema$ListNamespacesResponse { + export interface Schema$IndoorLevel { + /** + * The name of this level. + */ + name: string; + } /** - * The attachments that corresponded to the request params. - */ - namespaces: Schema$Namespace[]; -} -/** - * An attachment namespace defines read and write access for all the attachments - * created under it. Each namespace is globally unique, and owned by one project - * which is the only project that can create attachments under it. - */ -export interface Schema$Namespace { + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * Resource name of this namespace. Namespaces names have the format: - * <code>namespaces/<var>namespace</var></code>. + * Response to `ListBeaconAttachments` that contains the requested + * attachments. */ - namespaceName: string; + export interface Schema$ListBeaconAttachmentsResponse { + /** + * The attachments that corresponded to the request params. + */ + attachments: Schema$BeaconAttachment[]; + } /** - * Specifies what clients may receive attachments under this namespace via - * `beaconinfo.getforobserved`. - */ - servingVisibility: string; -} -/** - * Represents one beacon observed once. - */ -export interface Schema$Observation { + * Response that contains list beacon results and pagination help. + */ + export interface Schema$ListBeaconsResponse { + /** + * The beacons that matched the search criteria. + */ + beacons: Schema$Beacon[]; + /** + * An opaque pagination token that the client may provide in their next + * request to retrieve the next page of results. + */ + nextPageToken: string; + /** + * Estimate of the total number of beacons matched by the query. Higher + * values may be less accurate. + */ + totalCount: string; + } /** - * The ID advertised by the beacon the client has encountered. If the - * submitted `advertised_id` type is Eddystone-EID, then the client must be - * authorized to resolve the given beacon. Otherwise no data will be returned - * for that beacon. Required. - */ - advertisedId: Schema$AdvertisedId; + * Response that contains the requested diagnostics. + */ + export interface Schema$ListDiagnosticsResponse { + /** + * The diagnostics matching the given request. + */ + diagnostics: Schema$Diagnostics[]; + /** + * Token that can be used for pagination. Returned only if the request + * matches more beacons than can be returned in this response. + */ + nextPageToken: string; + } /** - * The array of telemetry bytes received from the beacon. The server is - * responsible for parsing it. This field may frequently be empty, as with a - * beacon that transmits telemetry only occasionally. + * Response to ListNamespacesRequest that contains all the project's + * namespaces. */ - telemetry: string; + export interface Schema$ListNamespacesResponse { + /** + * The attachments that corresponded to the request params. + */ + namespaces: Schema$Namespace[]; + } /** - * Time when the beacon was observed. - */ - timestampMs: string; -} - -export class Resource$Beaconinfo { - root: Proximitybeacon; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); + * An attachment namespace defines read and write access for all the + * attachments created under it. Each namespace is globally unique, and owned + * by one project which is the only project that can create attachments under + * it. + */ + export interface Schema$Namespace { + /** + * Resource name of this namespace. Namespaces names have the format: + * <code>namespaces/<var>namespace</var></code>. + */ + namespaceName: string; + /** + * Specifies what clients may receive attachments under this namespace via + * `beaconinfo.getforobserved`. + */ + servingVisibility: string; } - - getRoot() { - return this.root; + /** + * Represents one beacon observed once. + */ + export interface Schema$Observation { + /** + * The ID advertised by the beacon the client has encountered. If the + * submitted `advertised_id` type is Eddystone-EID, then the client must be + * authorized to resolve the given beacon. Otherwise no data will be + * returned for that beacon. Required. + */ + advertisedId: Schema$AdvertisedId; + /** + * The array of telemetry bytes received from the beacon. The server is + * responsible for parsing it. This field may frequently be empty, as with a + * beacon that transmits telemetry only occasionally. + */ + telemetry: string; + /** + * Time when the beacon was observed. + */ + timestampMs: string; } - - /** - * proximitybeacon.beaconinfo.getforobserved - * @desc Given one or more beacon observations, returns any beacon information - * and attachments accessible to your application. Authorize by using the [API - * key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) - * for the application. - * @alias proximitybeacon.beaconinfo.getforobserved - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GetInfoForObservedBeaconsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getforobserved(params?: any, options?: MethodOptions): - AxiosPromise; - getforobserved( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - getforobserved( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Beaconinfo { + root: Proximitybeacon; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/beaconinfo:getforobserved') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Beacons { - root: Proximitybeacon; - attachments: Resource$Beacons$Attachments; - diagnostics: Resource$Beacons$Diagnostics; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); - this.attachments = new Resource$Beacons$Attachments(root); - this.diagnostics = new Resource$Beacons$Diagnostics(root); - } - getRoot() { - return this.root; + /** + * proximitybeacon.beaconinfo.getforobserved + * @desc Given one or more beacon observations, returns any beacon + * information and attachments accessible to your application. Authorize by + * using the [API + * key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) + * for the application. + * @alias proximitybeacon.beaconinfo.getforobserved + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GetInfoForObservedBeaconsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getforobserved(params?: any, options?: MethodOptions): + AxiosPromise; + getforobserved( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getforobserved( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/beaconinfo:getforobserved') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * proximitybeacon.beacons.activate - * @desc Activates a beacon. A beacon that is active will return information - * and attachment data when queried via `beaconinfo.getforobserved`. Calling - * this method on an already active beacon will do nothing (but will return a - * successful response code). Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.activate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon that should be activated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the beacon to activate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - activate(params?: any, options?: MethodOptions): AxiosPromise; - activate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - activate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Beacons { + root: Proximitybeacon; + attachments: Resource$Beacons$Attachments; + diagnostics: Resource$Beacons$Diagnostics; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); + this.attachments = new Resource$Beacons$Attachments(root); + this.diagnostics = new Resource$Beacons$Diagnostics(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}:activate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * proximitybeacon.beacons.deactivate - * @desc Deactivates a beacon. Once deactivated, the API will not return - * information nor attachment data for the beacon when queried via - * `beaconinfo.getforobserved`. Calling this method on an already inactive - * beacon will do nothing (but will return a successful response code). - * Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.deactivate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon that should be deactivated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the beacon to deactivate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deactivate(params?: any, options?: MethodOptions): AxiosPromise; - deactivate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deactivate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * proximitybeacon.beacons.activate + * @desc Activates a beacon. A beacon that is active will return information + * and attachment data when queried via `beaconinfo.getforobserved`. Calling + * this method on an already active beacon will do nothing (but will return + * a successful response code). Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.activate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon that should be activated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the beacon to activate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + activate(params?: any, options?: MethodOptions): AxiosPromise; + activate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + activate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}:activate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}:deactivate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.decommission - * @desc Decommissions the specified beacon in the service. This beacon will - * no longer be returned from `beaconinfo.getforobserved`. This operation is - * permanent -- you will not be able to re-register a beacon with this ID - * again. Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.decommission - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon that should be decommissioned. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID of the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the beacon to decommission. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - decommission(params?: any, options?: MethodOptions): - AxiosPromise; - decommission( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - decommission( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * proximitybeacon.beacons.deactivate + * @desc Deactivates a beacon. Once deactivated, the API will not return + * information nor attachment data for the beacon when queried via + * `beaconinfo.getforobserved`. Calling this method on an already inactive + * beacon will do nothing (but will return a successful response code). + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.deactivate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon that should be deactivated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the beacon to deactivate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deactivate(params?: any, options?: MethodOptions): + AxiosPromise; + deactivate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deactivate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}:deactivate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}:decommission') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.delete - * @desc Deletes the specified beacon including all diagnostics data for the - * beacon as well as any attachments on the beacon (including those belonging - * to other projects). This operation cannot be undone. Authenticate using an - * [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon that should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the beacon to delete. If not provided, the project that is making the request is used. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * proximitybeacon.beacons.decommission + * @desc Decommissions the specified beacon in the service. This beacon will + * no longer be returned from `beaconinfo.getforobserved`. This operation is + * permanent -- you will not be able to re-register a beacon with this ID + * again. Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.decommission + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon that should be decommissioned. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID of the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the beacon to decommission. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + decommission(params?: any, options?: MethodOptions): + AxiosPromise; + decommission( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + decommission( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}:decommission') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * proximitybeacon.beacons.get - * @desc Returns detailed information about the specified beacon. Authenticate - * using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **viewer**, **Is owner** or **Can edit** permissions in - * the Google Developers Console project. Requests may supply an - * Eddystone-EID beacon name in the form: `beacons/4!beaconId` where the - * `beaconId` is the base16 ephemeral ID broadcast by the beacon. The returned - * `Beacon` object will contain the beacon's stable Eddystone-UID. Clients not - * authorized to resolve the beacon's ephemeral Eddystone-EID broadcast will - * receive an error. - * @alias proximitybeacon.beacons.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the beacon to request. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * proximitybeacon.beacons.delete + * @desc Deletes the specified beacon including all diagnostics data for the + * beacon as well as any attachments on the beacon (including those + * belonging to other projects). This operation cannot be undone. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon that should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the beacon to delete. If not provided, the project that is making the request is used. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.list - * @desc Searches the beacon registry for beacons that match the given search - * criteria. Only those beacons that the client has permission to list will be - * returned. Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **viewer**, **Is owner** or **Can edit** permissions in - * the Google Developers Console project. - * @alias proximitybeacon.beacons.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of records to return for this request, up to a server-defined upper limit. - * @param {string=} params.pageToken A pagination token obtained from a previous request to list beacons. - * @param {string=} params.projectId The project id to list beacons under. If not present then the project credential that made the request is used as the project. Optional. - * @param {string=} params.q Filter query string that supports the following field filters: * **description:`""`** For example: **description:"Room 3"** Returns beacons whose description matches tokens in the string "Room 3" (not necessarily that exact string). The string must be double-quoted. * **status:``** For example: **status:active** Returns beacons whose status matches the given value. Values must be one of the Beacon.Status enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * **stability:``** For example: **stability:mobile** Returns beacons whose expected stability matches the given value. Values must be one of the Beacon.Stability enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * **place\_id:`""`** For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** Returns beacons explicitly registered at the given place, expressed as a Place ID obtained from [Google Places API](/places/place-id). Does not match places inside the given place. Does not consider the beacon's actual location (which may be different from its registered place). Accepts multiple filters that will be combined with OR logic. The place ID must be double-quoted. * **registration\_time`[<|>|<=|>=]`** For example: **registration\_time>=1433116800** Returns beacons whose registration time matches the given filter. Supports the operators: <, >, <=, and >=. Timestamp must be expressed as an integer number of seconds since midnight January 1, 1970 UTC. Accepts at most two filters that will be combined with AND logic, to support "between" semantics. If more than two are supplied, the latter ones are ignored. * **lat:` lng: radius:`** For example: **lat:51.1232343 lng:-1.093852 radius:1000** Returns beacons whose registered location is within the given circle. When any of these fields are given, all are required. Latitude and longitude must be decimal degrees between -90.0 and 90.0 and between -180.0 and 180.0 respectively. Radius must be an integer number of meters between 10 and 1,000,000 (1000 km). * **property:`"="`** For example: **property:"battery-type=CR2032"** Returns beacons which have a property of the given name and value. Supports multiple filters which will be combined with OR logic. The entire name=value string must be double-quoted as one string. * **attachment\_type:`""`** For example: **attachment_type:"my-namespace/my-type"** Returns beacons having at least one attachment of the given namespaced type. Supports "any within this namespace" via the partial wildcard syntax: "my-namespace/x". Supports multiple filters which will be combined with OR logic. The string must be double-quoted. * **indoor\_level:`""`** For example: **indoor\_level:"1"** Returns beacons which are located on the given indoor level. Accepts multiple filters that will be combined with OR logic. Multiple filters on the same field are combined with OR logic (except registration_time which is combined with AND logic). Multiple filters on different fields are combined with AND logic. Filters should be separated by spaces. As with any HTTP query string parameter, the whole filter expression must be URL-encoded. Example REST request: `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * proximitybeacon.beacons.get + * @desc Returns detailed information about the specified beacon. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **viewer**, **Is owner** or **Can edit** permissions + * in the Google Developers Console project. Requests may supply an + * Eddystone-EID beacon name in the form: `beacons/4!beaconId` where the + * `beaconId` is the base16 ephemeral ID broadcast by the beacon. The + * returned `Beacon` object will contain the beacon's stable Eddystone-UID. + * Clients not authorized to resolve the beacon's ephemeral Eddystone-EID + * broadcast will receive an error. + * @alias proximitybeacon.beacons.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the beacon to request. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/beacons').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.register - * @desc Registers a previously unregistered beacon given its `advertisedId`. - * These IDs are unique within the system. An ID can be registered only once. - * Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.register - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.projectId The project id of the project the beacon will be registered to. If the project id is not specified then the project making the request is used. Optional. - * @param {().Beacon} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - register(params?: any, options?: MethodOptions): AxiosPromise; - register( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - register( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * proximitybeacon.beacons.list + * @desc Searches the beacon registry for beacons that match the given + * search criteria. Only those beacons that the client has permission to + * list will be returned. Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **viewer**, **Is owner** or **Can edit** permissions + * in the Google Developers Console project. + * @alias proximitybeacon.beacons.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of records to return for this request, up to a server-defined upper limit. + * @param {string=} params.pageToken A pagination token obtained from a previous request to list beacons. + * @param {string=} params.projectId The project id to list beacons under. If not present then the project credential that made the request is used as the project. Optional. + * @param {string=} params.q Filter query string that supports the following field filters: * **description:`""`** For example: **description:"Room 3"** Returns beacons whose description matches tokens in the string "Room 3" (not necessarily that exact string). The string must be double-quoted. * **status:``** For example: **status:active** Returns beacons whose status matches the given value. Values must be one of the Beacon.Status enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * **stability:``** For example: **stability:mobile** Returns beacons whose expected stability matches the given value. Values must be one of the Beacon.Stability enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * **place\_id:`""`** For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** Returns beacons explicitly registered at the given place, expressed as a Place ID obtained from [Google Places API](/places/place-id). Does not match places inside the given place. Does not consider the beacon's actual location (which may be different from its registered place). Accepts multiple filters that will be combined with OR logic. The place ID must be double-quoted. * **registration\_time`[<|>|<=|>=]`** For example: **registration\_time>=1433116800** Returns beacons whose registration time matches the given filter. Supports the operators: <, >, <=, and >=. Timestamp must be expressed as an integer number of seconds since midnight January 1, 1970 UTC. Accepts at most two filters that will be combined with AND logic, to support "between" semantics. If more than two are supplied, the latter ones are ignored. * **lat:` lng: radius:`** For example: **lat:51.1232343 lng:-1.093852 radius:1000** Returns beacons whose registered location is within the given circle. When any of these fields are given, all are required. Latitude and longitude must be decimal degrees between -90.0 and 90.0 and between -180.0 and 180.0 respectively. Radius must be an integer number of meters between 10 and 1,000,000 (1000 km). * **property:`"="`** For example: **property:"battery-type=CR2032"** Returns beacons which have a property of the given name and value. Supports multiple filters which will be combined with OR logic. The entire name=value string must be double-quoted as one string. * **attachment\_type:`""`** For example: **attachment_type:"my-namespace/my-type"** Returns beacons having at least one attachment of the given namespaced type. Supports "any within this namespace" via the partial wildcard syntax: "my-namespace/x". Supports multiple filters which will be combined with OR logic. The string must be double-quoted. * **indoor\_level:`""`** For example: **indoor\_level:"1"** Returns beacons which are located on the given indoor level. Accepts multiple filters that will be combined with OR logic. Multiple filters on the same field are combined with OR logic (except registration_time which is combined with AND logic). Multiple filters on different fields are combined with AND logic. Filters should be separated by spaces. As with any HTTP query string parameter, the whole filter expression must be URL-encoded. Example REST request: `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/beacons').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/beacons:register') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.update - * @desc Updates the information about the specified beacon. **Any field that - * you do not populate in the submitted beacon will be permanently erased**, - * so you should follow the "read, modify, write" pattern to avoid - * inadvertently destroying data. Changes to the beacon status via this - * method will be silently ignored. To update beacon status, use the separate - * methods on this API for activation, deactivation, and decommissioning. - * Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations. - * @param {string=} params.projectId The project id of the beacon to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {().Beacon} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * proximitybeacon.beacons.register + * @desc Registers a previously unregistered beacon given its + * `advertisedId`. These IDs are unique within the system. An ID can be + * registered only once. Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.register + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.projectId The project id of the project the beacon will be registered to. If the project id is not specified then the project making the request is used. Optional. + * @param {().Beacon} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + register(params?: any, options?: MethodOptions): + AxiosPromise; + register( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + register( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/beacons:register') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Beacons$Attachments { - root: Proximitybeacon; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * proximitybeacon.beacons.attachments.batchDelete - * @desc Deletes multiple attachments on a given beacon. This operation is - * permanent and cannot be undone. You can optionally specify - * `namespacedType` to choose which attachments should be deleted. If you do - * not specify `namespacedType`, all your attachments on the given beacon - * will be deleted. You also may explicitly specify `x/x` to delete all. - * Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.attachments.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName The beacon whose attachments should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.namespacedType Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `x/x` to specify "all types in all namespaces". Optional. - * @param {string=} params.projectId The project id to delete beacon attachments under. This field can be used when "*" is specified to mean all attachment namespaces. Projects may have multiple attachments with multiple namespaces. If "*" is specified and the projectId string is empty, then the project making the request is used. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * proximitybeacon.beacons.update + * @desc Updates the information about the specified beacon. **Any field + * that you do not populate in the submitted beacon will be permanently + * erased**, so you should follow the "read, modify, write" pattern to avoid + * inadvertently destroying data. Changes to the beacon status via this + * method will be silently ignored. To update beacon status, use the + * separate methods on this API for activation, deactivation, and + * decommissioning. Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations. + * @param {string=} params.projectId The project id of the beacon to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {().Beacon} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Beacons$Attachments { + root: Proximitybeacon; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}/attachments:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * proximitybeacon.beacons.attachments.create - * @desc Associates the given data with the specified beacon. Attachment data - * must contain two parts:
  • A namespaced type.
  • The actual - * attachment data itself.
The namespaced type consists of two - * parts, the namespace and the type. The namespace must be one of the values - * returned by the `namespaces` endpoint, while the type can be a string of - * any characters except for the forward slash (`/`) up to 100 characters in - * length. Attachment data can be up to 1024 bytes long. Authenticate using - * an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.attachments.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon on which the attachment should be created. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.projectId The project id of the project the attachment will belong to. If the project id is not specified then the project making the request is used. Optional. - * @param {().BeaconAttachment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * proximitybeacon.beacons.attachments.batchDelete + * @desc Deletes multiple attachments on a given beacon. This operation is + * permanent and cannot be undone. You can optionally specify + * `namespacedType` to choose which attachments should be deleted. If you do + * not specify `namespacedType`, all your attachments on the given beacon + * will be deleted. You also may explicitly specify `x/x` to delete all. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.attachments.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName The beacon whose attachments should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.namespacedType Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `x/x` to specify "all types in all namespaces". Optional. + * @param {string=} params.projectId The project id to delete beacon attachments under. This field can be used when "*" is specified to mean all attachment namespaces. Projects may have multiple attachments with multiple namespaces. If "*" is specified and the projectId string is empty, then the project making the request is used. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}/attachments:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}/attachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * proximitybeacon.beacons.attachments.delete - * @desc Deletes the specified attachment for the given beacon. Each - * attachment has a unique attachment name (`attachmentName`) which is - * returned when you fetch the attachment data via this API. You specify this - * with the delete request to control which attachment is removed. This - * operation cannot be undone. Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **Is owner** or **Can edit** permissions in the Google - * Developers Console project. - * @alias proximitybeacon.beacons.attachments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.attachmentName The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the beacon's current EID, or its "stable" Eddystone-UID. Required. - * @param {string=} params.projectId The project id of the attachment to delete. If not provided, the project that is making the request is used. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+attachmentName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['attachmentName'], - pathParams: ['attachmentName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * proximitybeacon.beacons.attachments.create + * @desc Associates the given data with the specified beacon. Attachment + * data must contain two parts:
  • A namespaced type.
  • The + * actual attachment data itself.
The namespaced type consists of + * two parts, the namespace and the type. The namespace must be one of the + * values returned by the `namespaces` endpoint, while the type can be a + * string of any characters except for the forward slash (`/`) up to 100 + * characters in length. Attachment data can be up to 1024 bytes long. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.attachments.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon on which the attachment should be created. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.projectId The project id of the project the attachment will belong to. If the project id is not specified then the project making the request is used. Optional. + * @param {().BeaconAttachment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}/attachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * proximitybeacon.beacons.attachments.list - * @desc Returns the attachments for the specified beacon that match the - * specified namespaced-type pattern. To control which namespaced types are - * returned, you add the `namespacedType` query parameter to the request. You - * must either use `x/x`, to return all attachments, or the namespace must be - * one of the ones returned from the `namespaces` endpoint. Authenticate - * using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **viewer**, **Is owner** or **Can edit** permissions in - * the Google Developers Console project. - * @alias proximitybeacon.beacons.attachments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.beaconName Beacon whose attachments should be fetched. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. - * @param {string=} params.namespacedType Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `x/x` to specify "all types in all namespaces". - * @param {string=} params.projectId The project id to list beacon attachments under. This field can be used when "*" is specified to mean all attachment namespaces. Projects may have multiple attachments with multiple namespaces. If "*" is specified and the projectId string is empty, then the project making the request is used. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * proximitybeacon.beacons.attachments.delete + * @desc Deletes the specified attachment for the given beacon. Each + * attachment has a unique attachment name (`attachmentName`) which is + * returned when you fetch the attachment data via this API. You specify + * this with the delete request to control which attachment is removed. This + * operation cannot be undone. Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **Is owner** or **Can edit** permissions in the + * Google Developers Console project. + * @alias proximitybeacon.beacons.attachments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.attachmentName The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the beacon's current EID, or its "stable" Eddystone-UID. Required. + * @param {string=} params.projectId The project id of the attachment to delete. If not provided, the project that is making the request is used. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+attachmentName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['attachmentName'], + pathParams: ['attachmentName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}/attachments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Beacons$Diagnostics { - root: Proximitybeacon; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * proximitybeacon.beacons.attachments.list + * @desc Returns the attachments for the specified beacon that match the + * specified namespaced-type pattern. To control which namespaced types are + * returned, you add the `namespacedType` query parameter to the request. + * You must either use `x/x`, to return all attachments, or the namespace + * must be one of the ones returned from the `namespaces` endpoint. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **viewer**, **Is owner** or **Can edit** permissions + * in the Google Developers Console project. + * @alias proximitybeacon.beacons.attachments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.beaconName Beacon whose attachments should be fetched. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + * @param {string=} params.namespacedType Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `x/x` to specify "all types in all namespaces". + * @param {string=} params.projectId The project id to list beacon attachments under. This field can be used when "*" is specified to mean all attachment namespaces. Projects may have multiple attachments with multiple namespaces. If "*" is specified and the projectId string is empty, then the project making the request is used. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}/attachments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * proximitybeacon.beacons.diagnostics.list - * @desc List the diagnostics for a single beacon. You can also list - * diagnostics for all the beacons owned by your Google Developers Console - * project by using the beacon name `beacons/-`. Authenticate using an [OAuth - * access token](https://developers.google.com/identity/protocols/OAuth2) from - * a signed-in user with **viewer**, **Is owner** or **Can edit** permissions - * in the Google Developers Console project. - * @alias proximitybeacon.beacons.diagnostics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.alertFilter Requests only beacons that have the given alert. For example, to find beacons that have low batteries use `alert_filter=LOW_BATTERY`. - * @param {string} params.beaconName Beacon that the diagnostics are for. - * @param {integer=} params.pageSize Specifies the maximum number of results to return. Defaults to 10. Maximum 1000. Optional. - * @param {string=} params.pageToken Requests results that occur after the `page_token`, obtained from the response to a previous request. Optional. - * @param {string=} params.projectId Requests only diagnostic records for the given project id. If not set, then the project making the request will be used for looking up diagnostic records. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Beacons$Diagnostics { + root: Proximitybeacon; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+beaconName}/diagnostics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['beaconName'], - pathParams: ['beaconName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + getRoot() { + return this.root; + } -export class Resource$Namespaces { - root: Proximitybeacon; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * proximitybeacon.beacons.diagnostics.list + * @desc List the diagnostics for a single beacon. You can also list + * diagnostics for all the beacons owned by your Google Developers Console + * project by using the beacon name `beacons/-`. Authenticate using an + * [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **viewer**, **Is owner** or **Can edit** permissions + * in the Google Developers Console project. + * @alias proximitybeacon.beacons.diagnostics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.alertFilter Requests only beacons that have the given alert. For example, to find beacons that have low batteries use `alert_filter=LOW_BATTERY`. + * @param {string} params.beaconName Beacon that the diagnostics are for. + * @param {integer=} params.pageSize Specifies the maximum number of results to return. Defaults to 10. Maximum 1000. Optional. + * @param {string=} params.pageToken Requests results that occur after the `page_token`, obtained from the response to a previous request. Optional. + * @param {string=} params.projectId Requests only diagnostic records for the given project id. If not set, then the project making the request will be used for looking up diagnostic records. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+beaconName}/diagnostics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['beaconName'], + pathParams: ['beaconName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * proximitybeacon.namespaces.list - * @desc Lists all attachment namespaces owned by your Google Developers - * Console project. Attachment data associated with a beacon must include a - * namespaced type, and the namespace must be owned by your project. - * Authenticate using an [OAuth access - * token](https://developers.google.com/identity/protocols/OAuth2) from a - * signed-in user with **viewer**, **Is owner** or **Can edit** permissions in - * the Google Developers Console project. - * @alias proximitybeacon.namespaces.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.projectId The project id to list namespaces under. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Namespaces { + root: Proximitybeacon; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1beta1/namespaces').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * proximitybeacon.namespaces.update - * @desc Updates the information about the specified namespace. Only the - * namespace visibility can be updated. - * @alias proximitybeacon.namespaces.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.namespaceName Resource name of this namespace. Namespaces names have the format: namespaces/namespace. - * @param {string=} params.projectId The project id of the namespace to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. - * @param {().Namespace} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+namespaceName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['namespaceName'], - pathParams: ['namespaceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * proximitybeacon.namespaces.list + * @desc Lists all attachment namespaces owned by your Google Developers + * Console project. Attachment data associated with a beacon must include a + * namespaced type, and the namespace must be owned by your project. + * Authenticate using an [OAuth access + * token](https://developers.google.com/identity/protocols/OAuth2) from a + * signed-in user with **viewer**, **Is owner** or **Can edit** permissions + * in the Google Developers Console project. + * @alias proximitybeacon.namespaces.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.projectId The project id to list namespaces under. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/namespaces') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$V1beta1 { - root: Proximitybeacon; - constructor(root: Proximitybeacon) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * proximitybeacon.namespaces.update + * @desc Updates the information about the specified namespace. Only the + * namespace visibility can be updated. + * @alias proximitybeacon.namespaces.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.namespaceName Resource name of this namespace. Namespaces names have the format: namespaces/namespace. + * @param {string=} params.projectId The project id of the namespace to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + * @param {().Namespace} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+namespaceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['namespaceName'], + pathParams: ['namespaceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * proximitybeacon.getEidparams - * @desc Gets the Proximity Beacon API's current public key and associated - * parameters used to initiate the Diffie-Hellman key exchange required to - * register a beacon that broadcasts the Eddystone-EID format. This key - * changes periodically; clients may cache it and re-use the same public key - * to provision and register multiple beacons. However, clients should be - * prepared to refresh this key when they encounter an error registering an - * Eddystone-EID beacon. - * @alias proximitybeacon.getEidparams - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getEidparams(params?: any, options?: MethodOptions): - AxiosPromise; - getEidparams( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getEidparams( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$V1beta1 { + root: Proximitybeacon; + constructor(root: Proximitybeacon) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://proximitybeacon.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/eidparams').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * proximitybeacon.getEidparams + * @desc Gets the Proximity Beacon API's current public key and associated + * parameters used to initiate the Diffie-Hellman key exchange required to + * register a beacon that broadcasts the Eddystone-EID format. This key + * changes periodically; clients may cache it and re-use the same public key + * to provision and register multiple beacons. However, clients should be + * prepared to refresh this key when they encounter an error registering an + * Eddystone-EID beacon. + * @alias proximitybeacon.getEidparams + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getEidparams(params?: any, options?: MethodOptions): + AxiosPromise; + getEidparams( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getEidparams( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://proximitybeacon.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/eidparams') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/pubsub/v1.ts b/src/apis/pubsub/v1.ts index 31b76108e28..cdce1ae91dc 100644 --- a/src/apis/pubsub/v1.ts +++ b/src/apis/pubsub/v1.ts @@ -27,3697 +27,3764 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Pub/Sub API - * - * Provides reliable, many-to-many, asynchronous messaging between applications. - * - * @example - * const google = require('googleapis'); - * const pubsub = google.pubsub('v1'); - * - * @namespace pubsub - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Pubsub - */ -export class Pubsub { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Request for the Acknowledge method. - */ -export interface Schema$AcknowledgeRequest { - /** - * The acknowledgment ID for the messages being acknowledged that was returned - * by the Pub/Sub system in the `Pull` response. Must not be empty. - */ - ackIds: string[]; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Request for the `CreateSnapshot` method. - */ -export interface Schema$CreateSnapshotRequest { - /** - * The subscription whose backlog the snapshot retains. Specifically, the - * created snapshot is guaranteed to retain: (a) The existing backlog on the - * subscription. More precisely, this is defined as the messages in the - * subscription's backlog that are unacknowledged upon the successful - * completion of the `CreateSnapshot` request; as well as: (b) Any - * messages published to the subscription's topic following the successful - * completion of the CreateSnapshot request. Format is - * `projects/{project}/subscriptions/{sub}`. - */ - subscription: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Response for the `ListSnapshots` method. - */ -export interface Schema$ListSnapshotsResponse { - /** - * If not empty, indicates that there may be more snapshot that match the - * request; this value should be passed in a new `ListSnapshotsRequest`. - */ - nextPageToken: string; - /** - * The resulting snapshots. - */ - snapshots: Schema$Snapshot[]; -} -/** - * Response for the `ListSubscriptions` method. - */ -export interface Schema$ListSubscriptionsResponse { - /** - * If not empty, indicates that there may be more subscriptions that match the - * request; this value should be passed in a new `ListSubscriptionsRequest` to - * get more subscriptions. - */ - nextPageToken: string; - /** - * The subscriptions that match the request. - */ - subscriptions: Schema$Subscription[]; -} -/** - * Response for the `ListTopicSnapshots` method. [ALPHA] This method is a part - * of a closed Alpha API. - */ -export interface Schema$ListTopicSnapshotsResponse { - /** - * If not empty, indicates that there may be more snapshots that match the - * request; this value should be passed in a new `ListTopicSnapshotsRequest` - * to get more snapshots. - */ - nextPageToken: string; - /** - * The names of the snapshots that match the request. - */ - snapshots: string[]; -} -/** - * Response for the `ListTopics` method. - */ -export interface Schema$ListTopicsResponse { - /** - * If not empty, indicates that there may be more topics that match the - * request; this value should be passed in a new `ListTopicsRequest`. - */ - nextPageToken: string; - /** - * The resulting topics. - */ - topics: Schema$Topic[]; -} -/** - * Response for the `ListTopicSubscriptions` method. - */ -export interface Schema$ListTopicSubscriptionsResponse { - /** - * If not empty, indicates that there may be more subscriptions that match the - * request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - */ - nextPageToken: string; - /** - * The names of the subscriptions that match the request. - */ - subscriptions: string[]; -} -/** - * Request for the ModifyAckDeadline method. - */ -export interface Schema$ModifyAckDeadlineRequest { - /** - * The new ack deadline with respect to the time this request was sent to the - * Pub/Sub system. For example, if the value is 10, the new ack deadline will - * expire 10 seconds after the `ModifyAckDeadline` call was made. Specifying - * zero may immediately make the message available for another pull request. - * The minimum deadline you can specify is 0 seconds. The maximum deadline you - * can specify is 600 seconds (10 minutes). - */ - ackDeadlineSeconds: number; - /** - * List of acknowledgment IDs. - */ - ackIds: string[]; -} -/** - * Request for the ModifyPushConfig method. - */ -export interface Schema$ModifyPushConfigRequest { - /** - * The push configuration for future deliveries. An empty `pushConfig` - * indicates that the Pub/Sub system should stop pushing messages from the - * given subscription and allow messages to be pulled and acknowledged - - * effectively pausing the subscription if `Pull` or `StreamingPull` is not - * called. - */ - pushConfig: Schema$PushConfig; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Request for the Publish method. - */ -export interface Schema$PublishRequest { - /** - * The messages to publish. - */ - messages: Schema$PubsubMessage[]; -} -/** - * Response for the `Publish` method. - */ -export interface Schema$PublishResponse { - /** - * The server-assigned ID of each published message, in the same order as the - * messages in the request. IDs are guaranteed to be unique within the topic. - */ - messageIds: string[]; -} -/** - * A message data and its attributes. The message payload must not be empty; it - * must contain either a non-empty data field, or at least one attribute. - */ -export interface Schema$PubsubMessage { - /** - * Optional attributes for this message. - */ - attributes: any; - /** - * The message payload. - */ - data: string; - /** - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. - */ - messageId: string; - /** - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the publisher - * in a `Publish` call. - */ - publishTime: string; -} -/** - * Request for the `Pull` method. - */ -export interface Schema$PullRequest { - /** - * The maximum number of messages returned for this request. The Pub/Sub - * system may return fewer than the number specified. - */ - maxMessages: number; - /** - * If this field set to true, the system will respond immediately even if it - * there are no messages available to return in the `Pull` response. - * Otherwise, the system may wait (for a bounded amount of time) until at - * least one message is available, rather than returning no messages. The - * client may cancel the request if it does not wish to wait any longer for - * the response. - */ - returnImmediately: boolean; -} -/** - * Response for the `Pull` method. - */ -export interface Schema$PullResponse { - /** - * Received Pub/Sub messages. The Pub/Sub system will return zero messages if - * there are no more available in the backlog. The Pub/Sub system may return - * fewer than the `maxMessages` requested even if there are more messages - * available in the backlog. - */ - receivedMessages: Schema$ReceivedMessage[]; -} -/** - * Configuration for a push delivery endpoint. - */ -export interface Schema$PushConfig { - /** - * Endpoint configuration attributes. Every endpoint has a set of API - * supported attributes that can be used to control different aspects of the - * message delivery. The currently supported attribute is `x-goog-version`, - * which you can use to change the format of the pushed message. This - * attribute indicates the version of the data expected by the endpoint. This - * controls the shape of the pushed message (i.e., its fields and metadata). - * The endpoint version is based on the version of the Pub/Sub API. If not - * present during the `CreateSubscription` call, it will default to the - * version of the API used to make such call. If not present during a - * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - * calls will always return a valid version, even if the subscription was - * created without this attribute. The possible values for this attribute - * are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - * * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - */ - attributes: any; - /** - * A URL locating the endpoint to which messages should be pushed. For - * example, a Webhook endpoint might use "https://example.com/push". - */ - pushEndpoint: string; -} -/** - * A message and its corresponding acknowledgment ID. - */ -export interface Schema$ReceivedMessage { - /** - * This ID can be used to acknowledge the received message. - */ - ackId: string; - /** - * The message. - */ - message: Schema$PubsubMessage; -} -/** - * Request for the `Seek` method. - */ -export interface Schema$SeekRequest { - /** - * The snapshot to seek to. The snapshot's topic must be the same as that - * of the provided subscription. Format is - * `projects/{project}/snapshots/{snap}`. - */ - snapshot: string; - /** - * The time to seek to. Messages retained in the subscription that were - * published before this time are marked as acknowledged, and messages - * retained in the subscription that were published after this time are marked - * as unacknowledged. Note that this operation affects only those messages - * retained in the subscription (configured by the combination of - * `message_retention_duration` and `retain_acked_messages`). For example, if - * `time` corresponds to a point before the message retention window (or to a - * point before the system's notion of the subscription creation time), - * only retained messages will be marked as unacknowledged, and - * already-expunged messages will not be restored. - */ - time: string; -} -export interface Schema$SeekResponse {} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * A snapshot resource. - */ -export interface Schema$Snapshot { - /** - * The snapshot is guaranteed to exist up until this time. A newly-created - * snapshot expires no later than 7 days from the time of its creation. Its - * exact lifetime is determined at creation by the existing backlog in the - * source subscription. Specifically, the lifetime of the snapshot is `7 days - * - (age of oldest unacked message in the subscription)`. For example, - * consider a subscription whose oldest unacked message is 3 days old. If a - * snapshot is created from this subscription, the snapshot -- which will - * always capture this 3-day-old backlog as long as the snapshot exists -- - * will expire in 4 days. The service will refuse to create a snapshot that - * would expire in less than 1 hour after creation. - */ - expireTime: string; - /** - * The name of the snapshot. - */ - name: string; - /** - * The name of the topic from which this snapshot is retaining messages. - */ - topic: string; -} -/** - * A subscription resource. - */ -export interface Schema$Subscription { - /** - * This value is the maximum time after a subscriber receives a message before - * the subscriber should acknowledge the message. After message delivery but - * before the ack deadline expires and before the message is acknowledged, it - * is an outstanding message and will not be delivered again during that time - * (on a best-effort basis). For pull subscriptions, this value is used as - * the initial value for the ack deadline. To override this value for a given - * message, call `ModifyAckDeadline` with the corresponding `ack_id` if using - * non-streaming pull or send the `ack_id` in a - * `StreamingModifyAckDeadlineRequest` if using streaming pull. The minimum - * custom deadline you can specify is 10 seconds. The maximum custom deadline - * you can specify is 600 seconds (10 minutes). If this parameter is 0, a - * default value of 10 seconds is used. For push delivery, this value is also - * used to set the request timeout for the call to the push endpoint. If the - * subscriber never acknowledges the message, the Pub/Sub system will - * eventually redeliver the message. - */ - ackDeadlineSeconds: number; - /** - * How long to retain unacknowledged messages in the subscription's - * backlog, from the moment a message is published. If `retain_acked_messages` - * is true, then this also configures the retention of acknowledged messages, - * and thus configures how far back in time a `Seek` can be done. Defaults to - * 7 days. Cannot be more than 7 days or less than 10 minutes. [ALPHA] This - * field is a part of a closed Alpha API. - */ - messageRetentionDuration: string; - /** - * The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. - * `{subscription}` must start with a letter, and contain only letters - * (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods - * (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between - * 3 and 255 characters in length, and it must not start with - * `"goog"`. - */ - name: string; - /** - * If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull - * and ack messages using API methods. - */ - pushConfig: Schema$PushConfig; - /** - * Indicates whether to retain acknowledged messages. If true, then messages - * are not expunged from the subscription's backlog, even if they are - * acknowledged, until they fall out of the `message_retention_duration` - * window. [ALPHA] This field is a part of a closed Alpha API. - */ - retainAckedMessages: boolean; - /** - * The name of the topic from which this subscription is receiving messages. - * Format is `projects/{project}/topics/{topic}`. The value of this field will - * be `_deleted-topic_` if the topic has been deleted. - */ - topic: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A topic resource. - */ -export interface Schema$Topic { - /** - * The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with - * a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes - * (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or - * percent signs (`%`). It must be between 3 and 255 characters in length, and - * it must not start with `"goog"`. - */ - name: string; -} -/** - * Request for the UpdateSnapshot method. - */ -export interface Schema$UpdateSnapshotRequest { - /** - * The updated snpashot object. - */ - snapshot: Schema$Snapshot; - /** - * Indicates which fields in the provided snapshot to update. Must be - * specified and non-empty. - */ - updateMask: string; -} -/** - * Request for the UpdateSubscription method. - */ -export interface Schema$UpdateSubscriptionRequest { - /** - * The updated subscription object. - */ - subscription: Schema$Subscription; - /** - * Indicates which fields in the provided subscription to update. Must be - * specified and non-empty. - */ - updateMask: string; -} - -export class Resource$Projects { - root: Pubsub; - snapshots: Resource$Projects$Snapshots; - subscriptions: Resource$Projects$Subscriptions; - topics: Resource$Projects$Topics; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - this.snapshots = new Resource$Projects$Snapshots(root); - this.subscriptions = new Resource$Projects$Subscriptions(root); - this.topics = new Resource$Projects$Topics(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Snapshots { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * pubsub.projects.snapshots.create - * @desc [ALPHA] This method is a part of a closed Alpha API. Creates a - * snapshot from the requested subscription. If the snapshot already exists, - * returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, - * returns `NOT_FOUND`. If the backlog in the subscription is too old -- and - * the resulting snapshot would expire in less than 1 hour -- then - * `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` - * field. If the name is not provided in the request, the server will assign - * a random name for this snapshot on the same project as the subscription, - * conforming to the [resource name - * format](https://cloud.google.com/pubsub/docs/overview#names). The generated - * name is populated in the returned Snapshot object. Note that for REST API - * requests, you must specify a name in the request. - * @alias pubsub.projects.snapshots.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Optional user-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. Format is `projects/{project}/snapshots/{snap}`. - * @param {().CreateSnapshotRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.delete - * @desc Removes an existing snapshot. All messages retained in the snapshot - * are immediately dropped. After a snapshot is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * snapshot or its subscription, unless the same subscription is specified. - * [ALPHA] This method is a part of a closed Alpha API. - * @alias pubsub.projects.snapshots.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.snapshot The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+snapshot}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['snapshot'], - pathParams: ['snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.get - * @desc Gets the configuration details of a snapshot. [ALPHA] This method is - * a part of a closed Alpha API. - * @alias pubsub.projects.snapshots.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.snapshot The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+snapshot}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['snapshot'], - pathParams: ['snapshot'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.snapshots.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.list - * @desc Lists the existing snapshots. [ALPHA] This method is a part of a - * closed Alpha API. - * @alias pubsub.projects.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of snapshots to return. - * @param {string=} params.pageToken The value returned by the last `ListSnapshotsResponse`; indicates that this is a continuation of a prior `ListSnapshots` call, and that the system should return the next page of data. - * @param {string} params.project The name of the cloud project that snapshots belong to. Format is `projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+project}/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.patch - * @desc Updates an existing snapshot. Note that certain properties of a - * snapshot are not modifiable. [ALPHA] This method is a part of a closed - * Alpha API. - * @alias pubsub.projects.snapshots.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the snapshot. - * @param {().UpdateSnapshotRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.snapshots.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.snapshots.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.snapshots.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.snapshots.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Projects$Subscriptions { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * pubsub.projects.subscriptions.acknowledge - * @desc Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. Acknowledging a message whose ack deadline has - * expired may succeed, but such a message may be redelivered later. - * Acknowledging a message more than once will not result in an error. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The subscription whose message is being acknowledged. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.acknowledge(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription whose message is being acknowledged. Format is `projects/{project}/subscriptions/{sub}`. - * @param {().AcknowledgeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+subscription}:acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.subscriptions.create - * @desc Creates a subscription to a given topic. If the subscription already - * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, - * returns `NOT_FOUND`. If the name is not provided in the request, the - * server will assign a random name for this subscription on the same project - * as the topic, conforming to the [resource name - * format](https://cloud.google.com/pubsub/docs/overview#names). The generated - * name is populated in the returned Subscription object. Note that for REST - * API requests, you must specify a name in the request. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. It must have the format - * // `"projects/{project}/subscriptions/{subscription}"`. - * `{subscription}` must - * // start with a letter, and contain only letters (`[A-Za-z]`), numbers - * // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes - * (`~`), - * // plus (`+`) or percent signs (`%`). It must be between 3 and 255 - * characters - * // in length, and it must not start with `"goog"`. - * name: 'projects/my-project/subscriptions/my-subscription', // TODO: - * Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.subscriptions.delete - * @desc Deletes an existing subscription. All messages retained in the - * subscription are immediately dropped. Calls to `Pull` after deletion will - * return `NOT_FOUND`. After a subscription is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * subscription or its topic unless the same topic is specified. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The subscription to delete. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+subscription}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.subscriptions.get - * @desc Gets the configuration details of a subscription. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription to get. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+subscription}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.subscriptions.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.getIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * pubsub.projects.subscriptions.list - * @desc Lists matching subscriptions. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the cloud project that subscriptions belong to. - * // Format is `projects/{project}`. - * project: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var subscriptionsPage = response['subscriptions']; - * if (!subscriptionsPage) { - * return; - * } - * for (var i = 0; i < subscriptionsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `subscriptionsPage`: console.log(JSON.stringify(subscriptionsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.subscriptions.list(request, handlePage); - * } - * }; +export namespace pubsub_v1 { + /** + * Cloud Pub/Sub API * - * pubsub.projects.subscriptions.list(request, handlePage); - * }); + * Provides reliable, many-to-many, asynchronous messaging between + * applications. * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.list - * @memberOf! () + * @example + * const google = require('googleapis'); + * const pubsub = google.pubsub('v1'); * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of subscriptions to return. - * @param {string=} params.pageToken The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data. - * @param {string} params.project The name of the cloud project that subscriptions belong to. Format is `projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace pubsub + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Pubsub */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+project}/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + export class Pubsub { + _options: GlobalOptions; + google: GoogleApis; + root = this; + projects: Resource$Projects; - /** - * pubsub.projects.subscriptions.modifyAckDeadline - * @desc Modifies the ack deadline for a specific message. This method is - * useful to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.modifyAckDeadline(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.modifyAckDeadline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`. - * @param {().ModifyAckDeadlineRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyAckDeadline(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+subscription}:modifyAckDeadline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } - /** - * pubsub.projects.subscriptions.modifyPushConfig - * @desc Modifies the `PushConfig` for a specified subscription. This may be - * used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the subscription. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.modifyPushConfig(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.modifyPushConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`. - * @param {().ModifyPushConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request for the Acknowledge method. */ - modifyPushConfig(params?: any, options?: MethodOptions): - AxiosPromise; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+subscription}:modifyPushConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AcknowledgeRequest { + /** + * The acknowledgment ID for the messages being acknowledged that was + * returned by the Pub/Sub system in the `Pull` response. Must not be empty. + */ + ackIds: string[]; } - - /** - * pubsub.projects.subscriptions.patch - * @desc Updates an existing subscription. Note that certain properties of a - * subscription, such as its topic, are not modifiable. - * @alias pubsub.projects.subscriptions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. - * @param {().UpdateSubscriptionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; } - - /** - * pubsub.projects.subscriptions.pull - * @desc Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The subscription from which messages should be pulled. - * // Format is `projects/{project}/subscriptions/{sub}`. - * subscription: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.pull(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.pull - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription from which messages should be pulled. Format is `projects/{project}/subscriptions/{sub}`. - * @param {().PullRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pull(params?: any, options?: MethodOptions): - AxiosPromise; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+subscription}:pull') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request for the `CreateSnapshot` method. + */ + export interface Schema$CreateSnapshotRequest { + /** + * The subscription whose backlog the snapshot retains. Specifically, the + * created snapshot is guaranteed to retain: (a) The existing backlog on + * the subscription. More precisely, this is defined as the messages in + * the subscription's backlog that are unacknowledged upon the + * successful completion of the `CreateSnapshot` request; as well as: + * (b) Any messages published to the subscription's topic following the + * successful completion of the CreateSnapshot request. Format is + * `projects/{project}/subscriptions/{sub}`. + */ + subscription: string; } - - /** - * pubsub.projects.subscriptions.seek - * @desc Seeks an existing subscription to a point in time or to a given - * snapshot, whichever is provided in the request. [ALPHA] This method is a - * part of a closed Alpha API. - * @alias pubsub.projects.subscriptions.seek - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription to affect. - * @param {().SeekRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - seek(params?: any, options?: MethodOptions): - AxiosPromise; - seek( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - seek( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+subscription}:seek') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Response for the `ListSnapshots` method. + */ + export interface Schema$ListSnapshotsResponse { + /** + * If not empty, indicates that there may be more snapshot that match the + * request; this value should be passed in a new `ListSnapshotsRequest`. + */ + nextPageToken: string; + /** + * The resulting snapshots. + */ + snapshots: Schema$Snapshot[]; } - - /** - * pubsub.projects.subscriptions.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.setIamPolicy(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response for the `ListSubscriptions` method. + */ + export interface Schema$ListSubscriptionsResponse { + /** + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + */ + nextPageToken: string; + /** + * The subscriptions that match the request. + */ + subscriptions: Schema$Subscription[]; } - - /** - * pubsub.projects.subscriptions.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/subscriptions/my-subscription', // - * TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.subscriptions.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.subscriptions.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response for the `ListTopicSnapshots` method. [ALPHA] This method is a part + * of a closed Alpha API. + */ + export interface Schema$ListTopicSnapshotsResponse { + /** + * If not empty, indicates that there may be more snapshots that match the + * request; this value should be passed in a new `ListTopicSnapshotsRequest` + * to get more snapshots. + */ + nextPageToken: string; + /** + * The names of the snapshots that match the request. + */ + snapshots: string[]; } -} - -export class Resource$Projects$Topics { - root: Pubsub; - snapshots: Resource$Projects$Topics$Snapshots; - subscriptions: Resource$Projects$Topics$Subscriptions; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - this.snapshots = new Resource$Projects$Topics$Snapshots(root); - this.subscriptions = new Resource$Projects$Topics$Subscriptions(root); + /** + * Response for the `ListTopics` method. + */ + export interface Schema$ListTopicsResponse { + /** + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new `ListTopicsRequest`. + */ + nextPageToken: string; + /** + * The resulting topics. + */ + topics: Schema$Topic[]; } - - getRoot() { - return this.root; + /** + * Response for the `ListTopicSubscriptions` method. + */ + export interface Schema$ListTopicSubscriptionsResponse { + /** + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + */ + nextPageToken: string; + /** + * The names of the subscriptions that match the request. + */ + subscriptions: string[]; } - - /** - * pubsub.projects.topics.create - * @desc Creates the given topic with the given name. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the topic. It must have the format - * // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a - * letter, - * // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes - * (`-`), - * // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or - * percent - * // signs (`%`). It must be between 3 and 255 characters in length, and - * it - * // must not start with `"goog"`. - * name: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. - * @param {().Topic} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request for the ModifyAckDeadline method. + */ + export interface Schema$ModifyAckDeadlineRequest { + /** + * The new ack deadline with respect to the time this request was sent to + * the Pub/Sub system. For example, if the value is 10, the new ack deadline + * will expire 10 seconds after the `ModifyAckDeadline` call was made. + * Specifying zero may immediately make the message available for another + * pull request. The minimum deadline you can specify is 0 seconds. The + * maximum deadline you can specify is 600 seconds (10 minutes). + */ + ackDeadlineSeconds: number; + /** + * List of acknowledgment IDs. + */ + ackIds: string[]; } - - /** - * pubsub.projects.topics.delete - * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the - * topic does not exist. After a topic is deleted, a new topic may be created - * with the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the topic to delete. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic Name of the topic to delete. Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+topic}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request for the ModifyPushConfig method. + */ + export interface Schema$ModifyPushConfigRequest { + /** + * The push configuration for future deliveries. An empty `pushConfig` + * indicates that the Pub/Sub system should stop pushing messages from the + * given subscription and allow messages to be pulled and acknowledged - + * effectively pausing the subscription if `Pull` or `StreamingPull` is not + * called. + */ + pushConfig: Schema$PushConfig; } - - /** - * pubsub.projects.topics.get - * @desc Gets the configuration of a topic. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the topic to get. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic The name of the topic to get. Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+topic}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - /** - * pubsub.projects.topics.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request for the Publish method. */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PublishRequest { + /** + * The messages to publish. + */ + messages: Schema$PubsubMessage[]; } - - /** - * pubsub.projects.topics.list - * @desc Lists matching topics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the cloud project that topics belong to. - * // Format is `projects/{project}`. - * project: 'projects/my-project', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var topicsPage = response['topics']; - * if (!topicsPage) { - * return; - * } - * for (var i = 0; i < topicsPage.length; i++) { - * // TODO: Change code below to process each resource in `topicsPage`: - * console.log(JSON.stringify(topicsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.topics.list(request, handlePage); - * } - * }; - * - * pubsub.projects.topics.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of topics to return. - * @param {string=} params.pageToken The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data. - * @param {string} params.project The name of the cloud project that topics belong to. Format is `projects/{project}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response for the `Publish` method. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+project}/topics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PublishResponse { + /** + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within the + * topic. + */ + messageIds: string[]; } - - /** - * pubsub.projects.topics.publish - * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the - * topic does not exist. The message payload must not be empty; it must - * contain either a non-empty data field, or at least one attribute. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The messages in the request will be published on this topic. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.publish(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic The messages in the request will be published on this topic. Format is `projects/{project}/topics/{topic}`. - * @param {().PublishRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A message data and its attributes. The message payload must not be empty; + * it must contain either a non-empty data field, or at least one attribute. + */ + export interface Schema$PubsubMessage { + /** + * Optional attributes for this message. + */ + attributes: any; + /** + * The message payload. + */ + data: string; + /** + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + */ + messageId: string; + /** + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the publisher + * in a `Publish` call. + */ + publishTime: string; + } + /** + * Request for the `Pull` method. + */ + export interface Schema$PullRequest { + /** + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + */ + maxMessages: number; + /** + * If this field set to true, the system will respond immediately even if it + * there are no messages available to return in the `Pull` response. + * Otherwise, the system may wait (for a bounded amount of time) until at + * least one message is available, rather than returning no messages. The + * client may cancel the request if it does not wish to wait any longer for + * the response. + */ + returnImmediately: boolean; + } + /** + * Response for the `Pull` method. */ - publish(params?: any, options?: MethodOptions): - AxiosPromise; - publish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+topic}:publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$PullResponse { + /** + * Received Pub/Sub messages. The Pub/Sub system will return zero messages + * if there are no more available in the backlog. The Pub/Sub system may + * return fewer than the `maxMessages` requested even if there are more + * messages available in the backlog. + */ + receivedMessages: Schema$ReceivedMessage[]; } - - /** - * pubsub.projects.topics.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy is being specified. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Configuration for a push delivery endpoint. + */ + export interface Schema$PushConfig { + /** + * Endpoint configuration attributes. Every endpoint has a set of API + * supported attributes that can be used to control different aspects of the + * message delivery. The currently supported attribute is `x-goog-version`, + * which you can use to change the format of the pushed message. This + * attribute indicates the version of the data expected by the endpoint. + * This controls the shape of the pushed message (i.e., its fields and + * metadata). The endpoint version is based on the version of the Pub/Sub + * API. If not present during the `CreateSubscription` call, it will + * default to the version of the API used to make such call. If not present + * during a `ModifyPushConfig` call, its value will not be changed. + * `GetSubscription` calls will always return a valid version, even if the + * subscription was created without this attribute. The possible values for + * this attribute are: * `v1beta1`: uses the push format defined in the + * v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the push format defined in + * the v1 Pub/Sub API. + */ + attributes: any; + /** + * A URL locating the endpoint to which messages should be pushed. For + * example, a Webhook endpoint might use + * "https://example.com/push". + */ + pushEndpoint: string; + } + /** + * A message and its corresponding acknowledgment ID. + */ + export interface Schema$ReceivedMessage { + /** + * This ID can be used to acknowledge the received message. + */ + ackId: string; + /** + * The message. + */ + message: Schema$PubsubMessage; + } + /** + * Request for the `Seek` method. + */ + export interface Schema$SeekRequest { + /** + * The snapshot to seek to. The snapshot's topic must be the same as + * that of the provided subscription. Format is + * `projects/{project}/snapshots/{snap}`. + */ + snapshot: string; + /** + * The time to seek to. Messages retained in the subscription that were + * published before this time are marked as acknowledged, and messages + * retained in the subscription that were published after this time are + * marked as unacknowledged. Note that this operation affects only those + * messages retained in the subscription (configured by the combination of + * `message_retention_duration` and `retain_acked_messages`). For example, + * if `time` corresponds to a point before the message retention window (or + * to a point before the system's notion of the subscription creation + * time), only retained messages will be marked as unacknowledged, and + * already-expunged messages will not be restored. + */ + time: string; + } + export interface Schema$SeekResponse {} + /** + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + } + /** + * A snapshot resource. + */ + export interface Schema$Snapshot { + /** + * The snapshot is guaranteed to exist up until this time. A newly-created + * snapshot expires no later than 7 days from the time of its creation. Its + * exact lifetime is determined at creation by the existing backlog in the + * source subscription. Specifically, the lifetime of the snapshot is `7 + * days - (age of oldest unacked message in the subscription)`. For example, + * consider a subscription whose oldest unacked message is 3 days old. If a + * snapshot is created from this subscription, the snapshot -- which will + * always capture this 3-day-old backlog as long as the snapshot exists -- + * will expire in 4 days. The service will refuse to create a snapshot that + * would expire in less than 1 hour after creation. + */ + expireTime: string; + /** + * The name of the snapshot. + */ + name: string; + /** + * The name of the topic from which this snapshot is retaining messages. + */ + topic: string; + } + /** + * A subscription resource. + */ + export interface Schema$Subscription { + /** + * This value is the maximum time after a subscriber receives a message + * before the subscriber should acknowledge the message. After message + * delivery but before the ack deadline expires and before the message is + * acknowledged, it is an outstanding message and will not be delivered + * again during that time (on a best-effort basis). For pull subscriptions, + * this value is used as the initial value for the ack deadline. To override + * this value for a given message, call `ModifyAckDeadline` with the + * corresponding `ack_id` if using non-streaming pull or send the `ack_id` + * in a `StreamingModifyAckDeadlineRequest` if using streaming pull. The + * minimum custom deadline you can specify is 10 seconds. The maximum custom + * deadline you can specify is 600 seconds (10 minutes). If this parameter + * is 0, a default value of 10 seconds is used. For push delivery, this + * value is also used to set the request timeout for the call to the push + * endpoint. If the subscriber never acknowledges the message, the Pub/Sub + * system will eventually redeliver the message. + */ + ackDeadlineSeconds: number; + /** + * How long to retain unacknowledged messages in the subscription's + * backlog, from the moment a message is published. If + * `retain_acked_messages` is true, then this also configures the retention + * of acknowledged messages, and thus configures how far back in time a + * `Seek` can be done. Defaults to 7 days. Cannot be more than 7 days or + * less than 10 minutes. [ALPHA] This field is a part of a closed Alpha API. + */ + messageRetentionDuration: string; + /** + * The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. + * `{subscription}` must start with a letter, and contain only letters + * (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods + * (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be + * between 3 and 255 characters in length, and it must not start with + * `"goog"`. + */ + name: string; + /** + * If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will + * pull and ack messages using API methods. + */ + pushConfig: Schema$PushConfig; + /** + * Indicates whether to retain acknowledged messages. If true, then messages + * are not expunged from the subscription's backlog, even if they are + * acknowledged, until they fall out of the `message_retention_duration` + * window. [ALPHA] This field is a part of a closed Alpha API. + */ + retainAckedMessages: boolean; + /** + * The name of the topic from which this subscription is receiving messages. + * Format is `projects/{project}/topics/{topic}`. The value of this field + * will be `_deleted-topic_` if the topic has been deleted. + */ + topic: string; + } + /** + * Request message for `TestIamPermissions` method. */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * pubsub.projects.topics.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // REQUIRED: The resource for which the policy detail is being - * requested. - * // See the operation documentation for the appropriate value for this - * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * pubsub.projects.topics.testIamPermissions(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } -} -export class Resource$Projects$Topics$Snapshots { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); + /** + * A topic resource. + */ + export interface Schema$Topic { + /** + * The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start + * with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), + * dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) + * or percent signs (`%`). It must be between 3 and 255 characters in + * length, and it must not start with `"goog"`. + */ + name: string; } - - getRoot() { - return this.root; + /** + * Request for the UpdateSnapshot method. + */ + export interface Schema$UpdateSnapshotRequest { + /** + * The updated snpashot object. + */ + snapshot: Schema$Snapshot; + /** + * Indicates which fields in the provided snapshot to update. Must be + * specified and non-empty. + */ + updateMask: string; } - - /** - * pubsub.projects.topics.snapshots.list - * @desc Lists the names of the snapshots on this topic. [ALPHA] This method - * is a part of a closed Alpha API. - * @alias pubsub.projects.topics.snapshots.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of snapshot names to return. - * @param {string=} params.pageToken The value returned by the last `ListTopicSnapshotsResponse`; indicates that this is a continuation of a prior `ListTopicSnapshots` call, and that the system should return the next page of data. - * @param {string} params.topic The name of the topic that snapshots are attached to. Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + * Request for the UpdateSubscription method. + */ + export interface Schema$UpdateSubscriptionRequest { + /** + * The updated subscription object. + */ + subscription: Schema$Subscription; + /** + * Indicates which fields in the provided subscription to update. Must be + * specified and non-empty. + */ + updateMask: string; + } + + export class Resource$Projects { + root: Pubsub; + snapshots: Resource$Projects$Snapshots; + subscriptions: Resource$Projects$Subscriptions; + topics: Resource$Projects$Topics; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + this.snapshots = new Resource$Projects$Snapshots(root); + this.subscriptions = new Resource$Projects$Subscriptions(root); + this.topics = new Resource$Projects$Topics(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+topic}/snapshots') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} - -export class Resource$Projects$Topics$Subscriptions { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Projects$Snapshots { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * pubsub.projects.snapshots.create + * @desc [ALPHA] This method is a part of a closed Alpha API. Creates a + * snapshot from the requested subscription. If the snapshot already exists, + * returns `ALREADY_EXISTS`. If the requested subscription doesn't exist, + * returns `NOT_FOUND`. If the backlog in the subscription is too old -- and + * the resulting snapshot would expire in less than 1 hour -- then + * `FAILED_PRECONDITION` is returned. See also the `Snapshot.expire_time` + * field. If the name is not provided in the request, the server will + * assign a random name for this snapshot on the same project as the + * subscription, conforming to the [resource name + * format](https://cloud.google.com/pubsub/docs/overview#names). The + * generated name is populated in the returned Snapshot object. Note that + * for REST API requests, you must specify a name in the request. + * @alias pubsub.projects.snapshots.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Optional user-provided name for this snapshot. If the name is not provided in the request, the server will assign a random name for this snapshot on the same project as the subscription. Note that for REST API requests, you must specify a name. Format is `projects/{project}/snapshots/{snap}`. + * @param {().CreateSnapshotRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.delete + * @desc Removes an existing snapshot. All messages retained in the snapshot + * are immediately dropped. After a snapshot is deleted, a new one may be + * created with the same name, but the new one has no association with the + * old snapshot or its subscription, unless the same subscription is + * specified. [ALPHA] This method is a part of a closed Alpha API. + * @alias pubsub.projects.snapshots.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.snapshot The name of the snapshot to delete. Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+snapshot}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['snapshot'], + pathParams: ['snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.get + * @desc Gets the configuration details of a snapshot. [ALPHA] This method + * is a part of a closed Alpha API. + * @alias pubsub.projects.snapshots.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.snapshot The name of the snapshot to get. Format is `projects/{project}/snapshots/{snap}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+snapshot}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['snapshot'], + pathParams: ['snapshot'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.snapshots.getIamPolicy(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.snapshots.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.list + * @desc Lists the existing snapshots. [ALPHA] This method is a part of a + * closed Alpha API. + * @alias pubsub.projects.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of snapshots to return. + * @param {string=} params.pageToken The value returned by the last `ListSnapshotsResponse`; indicates that this is a continuation of a prior `ListSnapshots` call, and that the system should return the next page of data. + * @param {string} params.project The name of the cloud project that snapshots belong to. Format is `projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+project}/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.patch + * @desc Updates an existing snapshot. Note that certain properties of a + * snapshot are not modifiable. [ALPHA] This method is a part of a closed + * Alpha API. + * @alias pubsub.projects.snapshots.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the snapshot. + * @param {().UpdateSnapshotRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.snapshots.setIamPolicy(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.snapshots.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.snapshots.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/snapshots/my-snapshot', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.snapshots.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.snapshots.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Projects$Subscriptions { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * pubsub.projects.subscriptions.acknowledge + * @desc Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. Acknowledging a message whose ack deadline has + * expired may succeed, but such a message may be redelivered later. + * Acknowledging a message more than once will not result in an error. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The subscription whose message is being acknowledged. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.acknowledge(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription whose message is being acknowledged. Format is `projects/{project}/subscriptions/{sub}`. + * @param {().AcknowledgeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}:acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.create + * @desc Creates a subscription to a given topic. If the subscription + * already exists, returns `ALREADY_EXISTS`. If the corresponding topic + * doesn't exist, returns `NOT_FOUND`. If the name is not provided in the + * request, the server will assign a random name for this subscription on + * the same project as the topic, conforming to the [resource name + * format](https://cloud.google.com/pubsub/docs/overview#names). The + * generated name is populated in the returned Subscription object. Note + * that for REST API requests, you must specify a name in the request. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the subscription. It must have the format + * // `"projects/{project}/subscriptions/{subscription}"`. + * `{subscription}` must + * // start with a letter, and contain only letters (`[A-Za-z]`), + * numbers + * // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes + * (`~`), + * // plus (`+`) or percent signs (`%`). It must be between 3 and 255 + * characters + * // in length, and it must not start with `"goog"`. + * name: 'projects/my-project/subscriptions/my-subscription', // TODO: + * Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.delete + * @desc Deletes an existing subscription. All messages retained in the + * subscription are immediately dropped. Calls to `Pull` after deletion will + * return `NOT_FOUND`. After a subscription is deleted, a new one may be + * created with the same name, but the new one has no association with the + * old subscription or its topic unless the same topic is specified. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The subscription to delete. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription to delete. Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.get + * @desc Gets the configuration details of a subscription. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the subscription to get. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription to get. Format is `projects/{project}/subscriptions/{sub}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.getIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.list + * @desc Lists matching subscriptions. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the cloud project that subscriptions belong to. + * // Format is `projects/{project}`. + * project: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var subscriptionsPage = response['subscriptions']; + * if (!subscriptionsPage) { + * return; + * } + * for (var i = 0; i < subscriptionsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `subscriptionsPage`: console.log(JSON.stringify(subscriptionsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * pubsub.projects.subscriptions.list(request, handlePage); + * } + * }; + * + * pubsub.projects.subscriptions.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of subscriptions to return. + * @param {string=} params.pageToken The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data. + * @param {string} params.project The name of the cloud project that subscriptions belong to. Format is `projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+project}/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.modifyAckDeadline + * @desc Modifies the ack deadline for a specific message. This method is + * useful to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the subscription. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.modifyAckDeadline(request, function(err) + * { if (err) { console.error(err); return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.modifyAckDeadline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`. + * @param {().ModifyAckDeadlineRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAckDeadline(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}:modifyAckDeadline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.modifyPushConfig + * @desc Modifies the `PushConfig` for a specified subscription. This may + * be used to change a push subscription to a pull one (signified by an + * empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the subscription. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.modifyPushConfig(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.modifyPushConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription. Format is `projects/{project}/subscriptions/{sub}`. + * @param {().ModifyPushConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyPushConfig(params?: any, options?: MethodOptions): + AxiosPromise; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}:modifyPushConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.patch + * @desc Updates an existing subscription. Note that certain properties of a + * subscription, such as its topic, are not modifiable. + * @alias pubsub.projects.subscriptions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. + * @param {().UpdateSubscriptionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.pull + * @desc Pulls messages from the server. Returns an empty list if there are + * no messages available in the backlog. The server may return `UNAVAILABLE` + * if there are too many concurrent pull requests pending for the given + * subscription. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The subscription from which messages should be pulled. + * // Format is `projects/{project}/subscriptions/{sub}`. + * subscription: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.pull(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.pull + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription from which messages should be pulled. Format is `projects/{project}/subscriptions/{sub}`. + * @param {().PullRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pull(params?: any, options?: MethodOptions): + AxiosPromise; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}:pull') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.seek + * @desc Seeks an existing subscription to a point in time or to a given + * snapshot, whichever is provided in the request. [ALPHA] This method is a + * part of a closed Alpha API. + * @alias pubsub.projects.subscriptions.seek + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription to affect. + * @param {().SeekRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + seek(params?: any, options?: MethodOptions): + AxiosPromise; + seek( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + seek( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+subscription}:seek') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.setIamPolicy(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.subscriptions.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/subscriptions/my-subscription', // + * TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.subscriptions.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.subscriptions.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * pubsub.projects.topics.subscriptions.list - * @desc Lists the names of the subscriptions on this topic. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Pub/Sub API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/pubsub - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var pubsub = google.pubsub('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the topic that subscriptions are attached to. - * // Format is `projects/{project}/topics/{topic}`. - * topic: 'projects/my-project/topics/my-topic', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var subscriptionsPage = response['subscriptions']; - * if (!subscriptionsPage) { - * return; - * } - * for (var i = 0; i < subscriptionsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `subscriptionsPage`: console.log(JSON.stringify(subscriptionsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * pubsub.projects.topics.subscriptions.list(request, handlePage); - * } - * }; - * - * pubsub.projects.topics.subscriptions.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias pubsub.projects.topics.subscriptions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of subscription names to return. - * @param {string=} params.pageToken The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data. - * @param {string} params.topic The name of the topic that subscriptions are attached to. Format is `projects/{project}/topics/{topic}`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Topics { + root: Pubsub; + snapshots: Resource$Projects$Topics$Snapshots; + subscriptions: Resource$Projects$Topics$Subscriptions; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + this.snapshots = new Resource$Projects$Topics$Snapshots(root); + this.subscriptions = new Resource$Projects$Topics$Subscriptions(root); + } + + getRoot() { + return this.root; + } + + + /** + * pubsub.projects.topics.create + * @desc Creates the given topic with the given name. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the topic. It must have the format + * // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a + * letter, + * // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes + * (`-`), + * // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or + * percent + * // signs (`%`). It must be between 3 and 255 characters in length, + * and it + * // must not start with `"goog"`. + * name: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. + * @param {().Topic} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.delete + * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the + * topic does not exist. After a topic is deleted, a new topic may be + * created with the same name; this is an entirely new topic with none of + * the old configuration or subscriptions. Existing subscriptions to this + * topic are not deleted, but their `topic` field is set to + * `_deleted-topic_`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the topic to delete. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic Name of the topic to delete. Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+topic}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.get + * @desc Gets the configuration of a topic. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the topic to get. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic The name of the topic to get. Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+topic}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.getIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.list + * @desc Lists matching topics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the cloud project that topics belong to. + * // Format is `projects/{project}`. + * project: 'projects/my-project', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var topicsPage = response['topics']; + * if (!topicsPage) { + * return; + * } + * for (var i = 0; i < topicsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `topicsPage`: console.log(JSON.stringify(topicsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * pubsub.projects.topics.list(request, handlePage); + * } + * }; + * + * pubsub.projects.topics.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of topics to return. + * @param {string=} params.pageToken The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data. + * @param {string} params.project The name of the cloud project that topics belong to. Format is `projects/{project}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+project}/topics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.publish + * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the + * topic does not exist. The message payload must not be empty; it must + * contain either a non-empty data field, or at least one attribute. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The messages in the request will be published on this topic. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.publish(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic The messages in the request will be published on this topic. Format is `projects/{project}/topics/{topic}`. + * @param {().PublishRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): + AxiosPromise; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+topic}:publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy is being specified. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.setIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * pubsub.projects.topics.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // REQUIRED: The resource for which the policy detail is being + * requested. + * // See the operation documentation for the appropriate value for this + * field. resource_: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * pubsub.projects.topics.testIamPermissions(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Topics$Snapshots { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * pubsub.projects.topics.snapshots.list + * @desc Lists the names of the snapshots on this topic. [ALPHA] This method + * is a part of a closed Alpha API. + * @alias pubsub.projects.topics.snapshots.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of snapshot names to return. + * @param {string=} params.pageToken The value returned by the last `ListTopicSnapshotsResponse`; indicates that this is a continuation of a prior `ListTopicSnapshots` call, and that the system should return the next page of data. + * @param {string} params.topic The name of the topic that snapshots are attached to. Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+topic}/snapshots') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+topic}/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + + export class Resource$Projects$Topics$Subscriptions { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * pubsub.projects.topics.subscriptions.list + * @desc Lists the names of the subscriptions on this topic. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Pub/Sub API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/pubsub + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var pubsub = google.pubsub('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the topic that subscriptions are attached to. + * // Format is `projects/{project}/topics/{topic}`. + * topic: 'projects/my-project/topics/my-topic', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var subscriptionsPage = response['subscriptions']; + * if (!subscriptionsPage) { + * return; + * } + * for (var i = 0; i < subscriptionsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `subscriptionsPage`: console.log(JSON.stringify(subscriptionsPage[i], + * null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * pubsub.projects.topics.subscriptions.list(request, handlePage); + * } + * }; + * + * pubsub.projects.topics.subscriptions.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias pubsub.projects.topics.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of subscription names to return. + * @param {string=} params.pageToken The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data. + * @param {string} params.topic The name of the topic that subscriptions are attached to. Format is `projects/{project}/topics/{topic}`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+topic}/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/pubsub/v1beta1a.ts b/src/apis/pubsub/v1beta1a.ts index eee14230324..c665319db84 100644 --- a/src/apis/pubsub/v1beta1a.ts +++ b/src/apis/pubsub/v1beta1a.ts @@ -27,1208 +27,1240 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Pub/Sub API - * - * Provides reliable, many-to-many, asynchronous messaging between applications. - * - * @example - * const google = require('googleapis'); - * const pubsub = google.pubsub('v1beta1a'); - * - * @namespace pubsub - * @type {Function} - * @version v1beta1a - * @variation v1beta1a - * @param {object=} options Options for Pubsub - */ -export class Pubsub { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace pubsub_v1beta1a { + /** + * Cloud Pub/Sub API + * + * Provides reliable, many-to-many, asynchronous messaging between + * applications. + * + * @example + * const google = require('googleapis'); + * const pubsub = google.pubsub('v1beta1a'); + * + * @namespace pubsub + * @type {Function} + * @version v1beta1a + * @variation v1beta1a + * @param {object=} options Options for Pubsub + */ + export class Pubsub { + _options: GlobalOptions; + google: GoogleApis; + root = this; - subscriptions: Resource$Subscriptions; - topics: Resource$Topics; + subscriptions: Resource$Subscriptions; + topics: Resource$Topics; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.subscriptions = new Resource$Subscriptions(this); - this.topics = new Resource$Topics(this); - } + this.subscriptions = new Resource$Subscriptions(this); + this.topics = new Resource$Topics(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request for the Acknowledge method. - */ -export interface Schema$AcknowledgeRequest { - /** - * The acknowledgment ID for the message being acknowledged. This was returned - * by the Pub/Sub system in the Pull response. - */ - ackId: string[]; - /** - * The subscription whose message is being acknowledged. - */ - subscription: string; -} -/** - * An empty message that you can re-use to avoid defining duplicated empty - * messages in your project. A typical example is to use it as argument or the - * return value of a service API. For instance: service Foo { rpc Bar - * (proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL The - * difference between this one and net/rpc/empty-message.proto is that 1) The - * generated message here is in proto2 C++ API. 2) The proto2.Empty has minimum - * dependencies (no message_set or net/rpc dependencies) END GOOGLE-INTERNAL - */ -export interface Schema$Empty {} -/** - * A key-value pair applied to a given object. - */ -export interface Schema$Label { - /** - * The key of a label is a syntactically valid URL (as per RFC 1738) with the - * "scheme" and initial slashes omitted and with the additional - * restrictions noted below. Each key should be globally unique. The - * "host" portion is called the "namespace" and is not - * necessarily resolvable to a network endpoint. Instead, the namespace - * indicates what system or entity defines the semantics of the label. - * Namespaces do not restrict the set of objects to which a label may be - * associated. Keys are defined by the following grammar: key = - * hostname "/" kpath kpath = ksegment *[ "/" - * ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | - * "_" | "." ] where "hostname" and - * "alphadigit" are defined as in RFC 1738. Example key: - * spanner.google.com/universe - */ - key: string; - /** - * An integer value. - */ - numValue: string; - /** - * A string value. - */ - strValue: string; -} -/** - * Response for the ListSubscriptions method. - */ -export interface Schema$ListSubscriptionsResponse { - /** - * If not empty, indicates that there are more subscriptions that match the - * request and this value should be passed to the next - * <code>ListSubscriptionsRequest</code> to continue. - */ - nextPageToken: string; - /** - * The subscriptions that match the request. - */ - subscription: Schema$Subscription[]; -} -/** - * Response for the ListTopics method. - */ -export interface Schema$ListTopicsResponse { - /** - * If not empty, indicates that there are more topics that match the request, - * and this value should be passed to the next - * <code>ListTopicsRequest</code> to continue. - */ - nextPageToken: string; - /** - * The resulting topics. - */ - topic: Schema$Topic[]; -} -/** - * Request for the ModifyAckDeadline method. - */ -export interface Schema$ModifyAckDeadlineRequest { - /** - * The new ack deadline with respect to the time this request was sent to the - * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new - * ack deadline will expire 10 seconds after the ModifyAckDeadline call was - * made. Specifying zero may immediately make the message available for - * another pull request. - */ - ackDeadlineSeconds: number; - /** - * The acknowledgment ID. Either this or ack_ids must be populated, not both. - */ - ackId: string; - /** - * List of acknowledgment IDs. Either this field or ack_id should be - * populated, not both. - */ - ackIds: string[]; - /** - * Next Index: 5 The name of the subscription from which messages are being - * pulled. - */ - subscription: string; -} -/** - * Request for the ModifyPushConfig method. - */ -export interface Schema$ModifyPushConfigRequest { - /** - * An empty <code>push_config</code> indicates that the Pub/Sub - * system should pause pushing messages from the given subscription. - */ - pushConfig: Schema$PushConfig; - /** - * The name of the subscription. - */ - subscription: string; -} -/** - * Request for the PublishBatch method. - */ -export interface Schema$PublishBatchRequest { - /** - * The messages to publish. - */ - messages: Schema$PubsubMessage[]; - /** - * The messages in the request will be published on this topic. - */ - topic: string; -} -/** - * Response for the PublishBatch method. - */ -export interface Schema$PublishBatchResponse { - /** - * The server-assigned ID of each published message, in the same order as the - * messages in the request. IDs are guaranteed to be unique within the topic. - */ - messageIds: string[]; -} -/** - * Request for the Publish method. - */ -export interface Schema$PublishRequest { - /** - * The message to publish. - */ - message: Schema$PubsubMessage; - /** - * The message in the request will be published on this topic. - */ - topic: string; -} -/** - * An event indicating a received message or truncation event. - */ -export interface Schema$PubsubEvent { - /** - * Indicates that this subscription has been deleted. (Note that pull - * subscribers will always receive NOT_FOUND in response in their pull request - * on the subscription, rather than seeing this boolean.) - */ - deleted: boolean; /** - * A received message. + * Request for the Acknowledge method. */ - message: Schema$PubsubMessage; - /** - * The subscription that received the event. - */ - subscription: string; - /** - * Indicates that this subscription has been truncated. - */ - truncated: boolean; -} -/** - * A message data and its labels. - */ -export interface Schema$PubsubMessage { + export interface Schema$AcknowledgeRequest { + /** + * The acknowledgment ID for the message being acknowledged. This was + * returned by the Pub/Sub system in the Pull response. + */ + ackId: string[]; + /** + * The subscription whose message is being acknowledged. + */ + subscription: string; + } /** - * The message payload. + * An empty message that you can re-use to avoid defining duplicated empty + * messages in your project. A typical example is to use it as argument or the + * return value of a service API. For instance: service Foo { rpc Bar + * (proto2.Empty) returns (proto2.Empty) { }; }; BEGIN GOOGLE-INTERNAL The + * difference between this one and net/rpc/empty-message.proto is that 1) The + * generated message here is in proto2 C++ API. 2) The proto2.Empty has + * minimum dependencies (no message_set or net/rpc dependencies) END + * GOOGLE-INTERNAL */ - data: string; + export interface Schema$Empty {} /** - * Optional list of labels for this message. Keys in this collection must be - * unique. + * A key-value pair applied to a given object. */ - label: Schema$Label[]; + export interface Schema$Label { + /** + * The key of a label is a syntactically valid URL (as per RFC 1738) with + * the "scheme" and initial slashes omitted and with the + * additional restrictions noted below. Each key should be globally unique. + * The "host" portion is called the "namespace" and is + * not necessarily resolvable to a network endpoint. Instead, the namespace + * indicates what system or entity defines the semantics of the label. + * Namespaces do not restrict the set of objects to which a label may be + * associated. Keys are defined by the following grammar: key = + * hostname "/" kpath kpath = ksegment *[ "/" + * ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | + * "_" | "." ] where "hostname" and + * "alphadigit" are defined as in RFC 1738. Example key: + * spanner.google.com/universe + */ + key: string; + /** + * An integer value. + */ + numValue: string; + /** + * A string value. + */ + strValue: string; + } /** - * ID of this message assigned by the server at publication time. Guaranteed - * to be unique within the topic. This value may be read by a subscriber that - * receives a PubsubMessage via a Pull call or a push delivery. It must not be - * populated by a publisher in a Publish call. + * Response for the ListSubscriptions method. */ - messageId: string; + export interface Schema$ListSubscriptionsResponse { + /** + * If not empty, indicates that there are more subscriptions that match the + * request and this value should be passed to the next + * <code>ListSubscriptionsRequest</code> to continue. + */ + nextPageToken: string; + /** + * The subscriptions that match the request. + */ + subscription: Schema$Subscription[]; + } /** - * The time at which the message was published. The time is milliseconds since - * the UNIX epoch. + * Response for the ListTopics method. */ - publishTime: string; -} -/** - * Request for the PullBatch method. - */ -export interface Schema$PullBatchRequest { + export interface Schema$ListTopicsResponse { + /** + * If not empty, indicates that there are more topics that match the + * request, and this value should be passed to the next + * <code>ListTopicsRequest</code> to continue. + */ + nextPageToken: string; + /** + * The resulting topics. + */ + topic: Schema$Topic[]; + } /** - * The maximum number of PubsubEvents returned for this request. The Pub/Sub - * system may return fewer than the number of events specified. + * Request for the ModifyAckDeadline method. */ - maxEvents: number; + export interface Schema$ModifyAckDeadlineRequest { + /** + * The new ack deadline with respect to the time this request was sent to + * the Pub/Sub system. Must be >= 0. For example, if the value is 10, the + * new ack deadline will expire 10 seconds after the ModifyAckDeadline call + * was made. Specifying zero may immediately make the message available for + * another pull request. + */ + ackDeadlineSeconds: number; + /** + * The acknowledgment ID. Either this or ack_ids must be populated, not + * both. + */ + ackId: string; + /** + * List of acknowledgment IDs. Either this field or ack_id should be + * populated, not both. + */ + ackIds: string[]; + /** + * Next Index: 5 The name of the subscription from which messages are being + * pulled. + */ + subscription: string; + } /** - * If this is specified as true the system will respond immediately even if it - * is not able to return a message in the Pull response. Otherwise the system - * is allowed to wait until at least one message is available rather than - * returning no messages. The client may cancel the request if it does not - * wish to wait any longer for the response. + * Request for the ModifyPushConfig method. */ - returnImmediately: boolean; + export interface Schema$ModifyPushConfigRequest { + /** + * An empty <code>push_config</code> indicates that the Pub/Sub + * system should pause pushing messages from the given subscription. + */ + pushConfig: Schema$PushConfig; + /** + * The name of the subscription. + */ + subscription: string; + } /** - * The subscription from which messages should be pulled. + * Request for the PublishBatch method. */ - subscription: string; -} -/** - * Response for the PullBatch method. - */ -export interface Schema$PullBatchResponse { + export interface Schema$PublishBatchRequest { + /** + * The messages to publish. + */ + messages: Schema$PubsubMessage[]; + /** + * The messages in the request will be published on this topic. + */ + topic: string; + } /** - * Received Pub/Sub messages or status events. The Pub/Sub system will return - * zero messages if there are no more messages available in the backlog. The - * Pub/Sub system may return fewer than the max_events requested even if there - * are more messages available in the backlog. + * Response for the PublishBatch method. */ - pullResponses: Schema$PullResponse[]; -} -/** - * Request for the Pull method. - */ -export interface Schema$PullRequest { + export interface Schema$PublishBatchResponse { + /** + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within the + * topic. + */ + messageIds: string[]; + } /** - * If this is specified as true the system will respond immediately even if it - * is not able to return a message in the Pull response. Otherwise the system - * is allowed to wait until at least one message is available rather than - * returning FAILED_PRECONDITION. The client may cancel the request if it does - * not wish to wait any longer for the response. + * Request for the Publish method. */ - returnImmediately: boolean; + export interface Schema$PublishRequest { + /** + * The message to publish. + */ + message: Schema$PubsubMessage; + /** + * The message in the request will be published on this topic. + */ + topic: string; + } /** - * The subscription from which a message should be pulled. + * An event indicating a received message or truncation event. */ - subscription: string; -} -/** - * Either a <code>PubsubMessage</code> or a truncation event. One of - * these two must be populated. - */ -export interface Schema$PullResponse { + export interface Schema$PubsubEvent { + /** + * Indicates that this subscription has been deleted. (Note that pull + * subscribers will always receive NOT_FOUND in response in their pull + * request on the subscription, rather than seeing this boolean.) + */ + deleted: boolean; + /** + * A received message. + */ + message: Schema$PubsubMessage; + /** + * The subscription that received the event. + */ + subscription: string; + /** + * Indicates that this subscription has been truncated. + */ + truncated: boolean; + } /** - * This ID must be used to acknowledge the received event or message. + * A message data and its labels. */ - ackId: string; + export interface Schema$PubsubMessage { + /** + * The message payload. + */ + data: string; + /** + * Optional list of labels for this message. Keys in this collection must be + * unique. + */ + label: Schema$Label[]; + /** + * ID of this message assigned by the server at publication time. Guaranteed + * to be unique within the topic. This value may be read by a subscriber + * that receives a PubsubMessage via a Pull call or a push delivery. It must + * not be populated by a publisher in a Publish call. + */ + messageId: string; + /** + * The time at which the message was published. The time is milliseconds + * since the UNIX epoch. + */ + publishTime: string; + } /** - * A pubsub message or truncation event. + * Request for the PullBatch method. */ - pubsubEvent: Schema$PubsubEvent; -} -/** - * Configuration for a push delivery endpoint. - */ -export interface Schema$PushConfig { + export interface Schema$PullBatchRequest { + /** + * The maximum number of PubsubEvents returned for this request. The Pub/Sub + * system may return fewer than the number of events specified. + */ + maxEvents: number; + /** + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + */ + returnImmediately: boolean; + /** + * The subscription from which messages should be pulled. + */ + subscription: string; + } /** - * A URL locating the endpoint to which messages should be pushed. For - * example, a Webhook endpoint might use "https://example.com/push". + * Response for the PullBatch method. */ - pushEndpoint: string; -} -/** - * A subscription resource. - */ -export interface Schema$Subscription { + export interface Schema$PullBatchResponse { + /** + * Received Pub/Sub messages or status events. The Pub/Sub system will + * return zero messages if there are no more messages available in the + * backlog. The Pub/Sub system may return fewer than the max_events + * requested even if there are more messages available in the backlog. + */ + pullResponses: Schema$PullResponse[]; + } /** - * For either push or pull delivery, the value is the maximum time after a - * subscriber receives a message before the subscriber should acknowledge or - * Nack the message. If the Ack deadline for a message passes without an Ack - * or a Nack, the Pub/Sub system will eventually redeliver the message. If a - * subscriber acknowledges after the deadline, the Pub/Sub system may accept - * the Ack, but it is possible that the message has been already delivered - * again. Multiple Acks to the message are allowed and will succeed. For push - * delivery, this value is used to set the request timeout for the call to the - * push endpoint. For pull delivery, this value is used as the initial value - * for the Ack deadline. It may be overridden for each message using its - * corresponding ack_id with <code>ModifyAckDeadline</code>. While - * a message is outstanding (i.e. it has been delivered to a pull subscriber - * and the subscriber has not yet Acked or Nacked), the Pub/Sub system will - * not deliver that message to another pull subscriber (on a best-effort - * basis). + * Request for the Pull method. */ - ackDeadlineSeconds: number; + export interface Schema$PullRequest { + /** + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the Pull response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning FAILED_PRECONDITION. The client may cancel the request if + * it does not wish to wait any longer for the response. + */ + returnImmediately: boolean; + /** + * The subscription from which a message should be pulled. + */ + subscription: string; + } /** - * Name of the subscription. + * Either a <code>PubsubMessage</code> or a truncation event. One + * of these two must be populated. */ - name: string; + export interface Schema$PullResponse { + /** + * This ID must be used to acknowledge the received event or message. + */ + ackId: string; + /** + * A pubsub message or truncation event. + */ + pubsubEvent: Schema$PubsubEvent; + } /** - * If push delivery is used with this subscription, this field is used to - * configure it. + * Configuration for a push delivery endpoint. */ - pushConfig: Schema$PushConfig; + export interface Schema$PushConfig { + /** + * A URL locating the endpoint to which messages should be pushed. For + * example, a Webhook endpoint might use + * "https://example.com/push". + */ + pushEndpoint: string; + } /** - * The name of the topic from which this subscription is receiving messages. + * A subscription resource. */ - topic: string; -} -/** - * A topic resource. - */ -export interface Schema$Topic { + export interface Schema$Subscription { + /** + * For either push or pull delivery, the value is the maximum time after a + * subscriber receives a message before the subscriber should acknowledge or + * Nack the message. If the Ack deadline for a message passes without an Ack + * or a Nack, the Pub/Sub system will eventually redeliver the message. If a + * subscriber acknowledges after the deadline, the Pub/Sub system may accept + * the Ack, but it is possible that the message has been already delivered + * again. Multiple Acks to the message are allowed and will succeed. For + * push delivery, this value is used to set the request timeout for the call + * to the push endpoint. For pull delivery, this value is used as the + * initial value for the Ack deadline. It may be overridden for each message + * using its corresponding ack_id with + * <code>ModifyAckDeadline</code>. While a message is + * outstanding (i.e. it has been delivered to a pull subscriber and the + * subscriber has not yet Acked or Nacked), the Pub/Sub system will not + * deliver that message to another pull subscriber (on a best-effort basis). + */ + ackDeadlineSeconds: number; + /** + * Name of the subscription. + */ + name: string; + /** + * If push delivery is used with this subscription, this field is used to + * configure it. + */ + pushConfig: Schema$PushConfig; + /** + * The name of the topic from which this subscription is receiving messages. + */ + topic: string; + } /** - * Name of the topic. + * A topic resource. */ - name: string; -} - -export class Resource$Subscriptions { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Topic { + /** + * Name of the topic. + */ + name: string; } - getRoot() { - return this.root; - } - - - /** - * pubsub.subscriptions.acknowledge - * @desc Acknowledges a particular received message: the Pub/Sub system can - * remove the given message from the subscription. Acknowledging a message - * whose Ack deadline has expired may succeed, but the message could have been - * already redelivered. Acknowledging a message more than once will not result - * in an error. This is only used for messages received via pull. - * @alias pubsub.subscriptions.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AcknowledgeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Subscriptions { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * pubsub.subscriptions.create - * @desc Creates a subscription on a given topic for a given subscriber. If - * the subscription already exists, returns ALREADY_EXISTS. If the - * corresponding topic doesn't exist, returns NOT_FOUND. If the name is not - * provided in the request, the server will assign a random name for this - * subscription on the same project as the topic. - * @alias pubsub.subscriptions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.subscriptions.acknowledge + * @desc Acknowledges a particular received message: the Pub/Sub system can + * remove the given message from the subscription. Acknowledging a message + * whose Ack deadline has expired may succeed, but the message could have + * been already redelivered. Acknowledging a message more than once will not + * result in an error. This is only used for messages received via pull. + * @alias pubsub.subscriptions.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AcknowledgeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.subscriptions.delete - * @desc Deletes an existing subscription. All pending messages in the - * subscription are immediately dropped. Calls to Pull after deletion will - * return NOT_FOUND. - * @alias pubsub.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.subscriptions.create + * @desc Creates a subscription on a given topic for a given subscriber. If + * the subscription already exists, returns ALREADY_EXISTS. If the + * corresponding topic doesn't exist, returns NOT_FOUND. If the name is not + * provided in the request, the server will assign a random name for this + * subscription on the same project as the topic. + * @alias pubsub.subscriptions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/{+subscription}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.subscriptions.get - * @desc Gets the configuration details of a subscription. - * @alias pubsub.subscriptions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/{+subscription}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.subscriptions.delete + * @desc Deletes an existing subscription. All pending messages in the + * subscription are immediately dropped. Calls to Pull after deletion will + * return NOT_FOUND. + * @alias pubsub.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.subscriptions.list - * @desc Lists matching subscriptions. - * @alias pubsub.subscriptions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of subscriptions to return. - * @param {string=} params.pageToken The value obtained in the last ListSubscriptionsResponse for continuation. - * @param {string=} params.query A valid label query expression. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.subscriptions.get + * @desc Gets the configuration details of a subscription. + * @alias pubsub.subscriptions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.subscriptions.modifyAckDeadline - * @desc Modifies the Ack deadline for a message received from a pull request. - * @alias pubsub.subscriptions.modifyAckDeadline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ModifyAckDeadlineRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyAckDeadline(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.subscriptions.list + * @desc Lists matching subscriptions. + * @alias pubsub.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of subscriptions to return. + * @param {string=} params.pageToken The value obtained in the last ListSubscriptionsResponse for continuation. + * @param {string=} params.query A valid label query expression. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/modifyAckDeadline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.subscriptions.modifyPushConfig - * @desc Modifies the PushConfig for a specified subscription. - * This method can be used to suspend the flow of messages to an endpoint by - * clearing the PushConfig field in the request. Messages will be - * accumulated for delivery even if no push configuration is defined or while - * the configuration is modified. - * @alias pubsub.subscriptions.modifyPushConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ModifyPushConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyPushConfig(params?: any, options?: MethodOptions): - AxiosPromise; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/modifyPushConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.subscriptions.modifyAckDeadline + * @desc Modifies the Ack deadline for a message received from a pull + * request. + * @alias pubsub.subscriptions.modifyAckDeadline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ModifyAckDeadlineRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAckDeadline(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/modifyAckDeadline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.subscriptions.pull - * @desc Pulls a single message from the server. If return_immediately is - * true, and no messages are available in the subscription, this method - * returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE - * error if no messages are available in a reasonable amount of time (to - * reduce system load). - * @alias pubsub.subscriptions.pull - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PullRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pull(params?: any, options?: MethodOptions): - AxiosPromise; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.subscriptions.modifyPushConfig + * @desc Modifies the PushConfig for a specified subscription. + * This method can be used to suspend the flow of messages to an endpoint by + * clearing the PushConfig field in the request. Messages will + * be accumulated for delivery even if no push configuration is defined or + * while the configuration is modified. + * @alias pubsub.subscriptions.modifyPushConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ModifyPushConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyPushConfig(params?: any, options?: MethodOptions): + AxiosPromise; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/modifyPushConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/pull') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.subscriptions.pullBatch - * @desc Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The system is free to return UNAVAILABLE - * if there are too many pull requests outstanding for the given subscription. - * @alias pubsub.subscriptions.pullBatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PullBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pullBatch(params?: any, options?: MethodOptions): - AxiosPromise; - pullBatch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pullBatch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.subscriptions.pull + * @desc Pulls a single message from the server. If return_immediately is + * true, and no messages are available in the subscription, this method + * returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE + * error if no messages are available in a reasonable amount of time (to + * reduce system load). + * @alias pubsub.subscriptions.pull + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PullRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pull(params?: any, options?: MethodOptions): + AxiosPromise; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/pull') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/subscriptions/pullBatch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Topics { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * pubsub.subscriptions.pullBatch + * @desc Pulls messages from the server. Returns an empty list if there are + * no messages available in the backlog. The system is free to return + * UNAVAILABLE if there are too many pull requests outstanding for the given + * subscription. + * @alias pubsub.subscriptions.pullBatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PullBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pullBatch(params?: any, options?: MethodOptions): + AxiosPromise; + pullBatch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pullBatch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/subscriptions/pullBatch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * pubsub.topics.create - * @desc Creates the given topic with the given name. - * @alias pubsub.topics.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Topic} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Topics { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * pubsub.topics.delete - * @desc Deletes the topic with the given name. Returns NOT_FOUND if the topic - * does not exist. After a topic is deleted, a new topic may be created with - * the same name. - * @alias pubsub.topics.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic Name of the topic to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.topics.create + * @desc Creates the given topic with the given name. + * @alias pubsub.topics.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Topic} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics/{+topic}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.topics.get - * @desc Gets the configuration of a topic. Since the topic only has the name - * attribute, this method is only useful to check the existence of a topic. If - * other attributes are added in the future, they will be returned here. - * @alias pubsub.topics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic The name of the topic to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.topics.delete + * @desc Deletes the topic with the given name. Returns NOT_FOUND if the + * topic does not exist. After a topic is deleted, a new topic may be + * created with the same name. + * @alias pubsub.topics.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic Name of the topic to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics/{+topic}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics/{+topic}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.topics.list - * @desc Lists matching topics. - * @alias pubsub.topics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of topics to return. - * @param {string=} params.pageToken The value obtained in the last ListTopicsResponse for continuation. - * @param {string=} params.query A valid label query expression. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.topics.get + * @desc Gets the configuration of a topic. Since the topic only has the + * name attribute, this method is only useful to check the existence of a + * topic. If other attributes are added in the future, they will be returned + * here. + * @alias pubsub.topics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic The name of the topic to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics/{+topic}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.topics.publish - * @desc Adds a message to the topic. Returns NOT_FOUND if the topic does not - * exist. - * @alias pubsub.topics.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PublishRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): AxiosPromise; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publish( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics/publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.topics.list + * @desc Lists matching topics. + * @alias pubsub.topics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of topics to return. + * @param {string=} params.pageToken The value obtained in the last ListTopicsResponse for continuation. + * @param {string=} params.query A valid label query expression. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.topics.publishBatch - * @desc Adds one or more messages to the topic. Returns NOT_FOUND if the - * topic does not exist. - * @alias pubsub.topics.publishBatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PublishBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publishBatch(params?: any, options?: MethodOptions): - AxiosPromise; - publishBatch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publishBatch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.topics.publish + * @desc Adds a message to the topic. Returns NOT_FOUND if the topic does + * not exist. + * @alias pubsub.topics.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PublishRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): AxiosPromise; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics/publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1a/topics/publishBatch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * pubsub.topics.publishBatch + * @desc Adds one or more messages to the topic. Returns NOT_FOUND if the + * topic does not exist. + * @alias pubsub.topics.publishBatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PublishBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publishBatch(params?: any, options?: MethodOptions): + AxiosPromise; + publishBatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + publishBatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1a/topics/publishBatch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/pubsub/v1beta2.ts b/src/apis/pubsub/v1beta2.ts index 50c1268534b..e3ccd339da5 100644 --- a/src/apis/pubsub/v1beta2.ts +++ b/src/apis/pubsub/v1beta2.ts @@ -27,1573 +27,1615 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Pub/Sub API - * - * Provides reliable, many-to-many, asynchronous messaging between applications. - * - * @example - * const google = require('googleapis'); - * const pubsub = google.pubsub('v1beta2'); - * - * @namespace pubsub - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Pubsub - */ -export class Pubsub { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace pubsub_v1beta2 { + /** + * Cloud Pub/Sub API + * + * Provides reliable, many-to-many, asynchronous messaging between + * applications. + * + * @example + * const google = require('googleapis'); + * const pubsub = google.pubsub('v1beta2'); + * + * @namespace pubsub + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Pubsub + */ + export class Pubsub { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request for the Acknowledge method. - */ -export interface Schema$AcknowledgeRequest { - /** - * The acknowledgment ID for the messages being acknowledged that was returned - * by the Pub/Sub system in the `Pull` response. Must not be empty. - */ - ackIds: string[]; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Response for the `ListSubscriptions` method. - */ -export interface Schema$ListSubscriptionsResponse { - /** - * If not empty, indicates that there may be more subscriptions that match the - * request; this value should be passed in a new `ListSubscriptionsRequest` to - * get more subscriptions. - */ - nextPageToken: string; - /** - * The subscriptions that match the request. - */ - subscriptions: Schema$Subscription[]; -} -/** - * Response for the `ListTopics` method. - */ -export interface Schema$ListTopicsResponse { - /** - * If not empty, indicates that there may be more topics that match the - * request; this value should be passed in a new `ListTopicsRequest`. - */ - nextPageToken: string; - /** - * The resulting topics. - */ - topics: Schema$Topic[]; -} -/** - * Response for the `ListTopicSubscriptions` method. - */ -export interface Schema$ListTopicSubscriptionsResponse { - /** - * If not empty, indicates that there may be more subscriptions that match the - * request; this value should be passed in a new - * `ListTopicSubscriptionsRequest` to get more subscriptions. - */ - nextPageToken: string; - /** - * The names of the subscriptions that match the request. - */ - subscriptions: string[]; -} -/** - * Request for the ModifyAckDeadline method. - */ -export interface Schema$ModifyAckDeadlineRequest { - /** - * The new ack deadline with respect to the time this request was sent to the - * Pub/Sub system. Must be >= 0. For example, if the value is 10, the new - * ack deadline will expire 10 seconds after the `ModifyAckDeadline` call was - * made. Specifying zero may immediately make the message available for - * another pull request. - */ - ackDeadlineSeconds: number; - /** - * The acknowledgment ID. Either this or ack_ids must be populated, but not - * both. - */ - ackId: string; - /** - * List of acknowledgment IDs. - */ - ackIds: string[]; -} -/** - * Request for the ModifyPushConfig method. - */ -export interface Schema$ModifyPushConfigRequest { - /** - * The push configuration for future deliveries. An empty `pushConfig` - * indicates that the Pub/Sub system should stop pushing messages from the - * given subscription and allow messages to be pulled and acknowledged - - * effectively pausing the subscription if `Pull` is not called. - */ - pushConfig: Schema$PushConfig; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; /** - * Deprecated. + * Request for the Acknowledge method. */ - version: number; -} -/** - * Request for the Publish method. - */ -export interface Schema$PublishRequest { - /** - * The messages to publish. - */ - messages: Schema$PubsubMessage[]; -} -/** - * Response for the `Publish` method. - */ -export interface Schema$PublishResponse { + export interface Schema$AcknowledgeRequest { + /** + * The acknowledgment ID for the messages being acknowledged that was + * returned by the Pub/Sub system in the `Pull` response. Must not be empty. + */ + ackIds: string[]; + } /** - * The server-assigned ID of each published message, in the same order as the - * messages in the request. IDs are guaranteed to be unique within the topic. + * Associates `members` with a `role`. */ - messageIds: string[]; -} -/** - * A message data and its attributes. The message payload must not be empty; it - * must contain either a non-empty data field, or at least one attribute. - */ -export interface Schema$PubsubMessage { + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * Optional attributes for this message. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - attributes: any; + export interface Schema$Empty {} /** - * The message payload. For JSON requests, the value of this field must be - * [base64-encoded](https://tools.ietf.org/html/rfc4648). + * Response for the `ListSubscriptions` method. */ - data: string; + export interface Schema$ListSubscriptionsResponse { + /** + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * `ListSubscriptionsRequest` to get more subscriptions. + */ + nextPageToken: string; + /** + * The subscriptions that match the request. + */ + subscriptions: Schema$Subscription[]; + } /** - * ID of this message, assigned by the server when the message is published. - * Guaranteed to be unique within the topic. This value may be read by a - * subscriber that receives a `PubsubMessage` via a `Pull` call or a push - * delivery. It must not be populated by the publisher in a `Publish` call. + * Response for the `ListTopics` method. */ - messageId: string; + export interface Schema$ListTopicsResponse { + /** + * If not empty, indicates that there may be more topics that match the + * request; this value should be passed in a new `ListTopicsRequest`. + */ + nextPageToken: string; + /** + * The resulting topics. + */ + topics: Schema$Topic[]; + } /** - * The time at which the message was published, populated by the server when - * it receives the `Publish` call. It must not be populated by the publisher - * in a `Publish` call. + * Response for the `ListTopicSubscriptions` method. */ - publishTime: string; -} -/** - * Request for the `Pull` method. - */ -export interface Schema$PullRequest { + export interface Schema$ListTopicSubscriptionsResponse { + /** + * If not empty, indicates that there may be more subscriptions that match + * the request; this value should be passed in a new + * `ListTopicSubscriptionsRequest` to get more subscriptions. + */ + nextPageToken: string; + /** + * The names of the subscriptions that match the request. + */ + subscriptions: string[]; + } /** - * The maximum number of messages returned for this request. The Pub/Sub - * system may return fewer than the number specified. + * Request for the ModifyAckDeadline method. */ - maxMessages: number; + export interface Schema$ModifyAckDeadlineRequest { + /** + * The new ack deadline with respect to the time this request was sent to + * the Pub/Sub system. Must be >= 0. For example, if the value is 10, the + * new ack deadline will expire 10 seconds after the `ModifyAckDeadline` + * call was made. Specifying zero may immediately make the message available + * for another pull request. + */ + ackDeadlineSeconds: number; + /** + * The acknowledgment ID. Either this or ack_ids must be populated, but not + * both. + */ + ackId: string; + /** + * List of acknowledgment IDs. + */ + ackIds: string[]; + } /** - * If this is specified as true the system will respond immediately even if it - * is not able to return a message in the `Pull` response. Otherwise the - * system is allowed to wait until at least one message is available rather - * than returning no messages. The client may cancel the request if it does - * not wish to wait any longer for the response. + * Request for the ModifyPushConfig method. */ - returnImmediately: boolean; -} -/** - * Response for the `Pull` method. - */ -export interface Schema$PullResponse { + export interface Schema$ModifyPushConfigRequest { + /** + * The push configuration for future deliveries. An empty `pushConfig` + * indicates that the Pub/Sub system should stop pushing messages from the + * given subscription and allow messages to be pulled and acknowledged - + * effectively pausing the subscription if `Pull` is not called. + */ + pushConfig: Schema$PushConfig; + } /** - * Received Pub/Sub messages. The Pub/Sub system will return zero messages if - * there are no more available in the backlog. The Pub/Sub system may return - * fewer than the `maxMessages` requested even if there are more messages - * available in the backlog. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). */ - receivedMessages: Schema$ReceivedMessage[]; -} -/** - * Configuration for a push delivery endpoint. - */ -export interface Schema$PushConfig { + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * Endpoint configuration attributes. Every endpoint has a set of API - * supported attributes that can be used to control different aspects of the - * message delivery. The currently supported attribute is `x-goog-version`, - * which you can use to change the format of the push message. This attribute - * indicates the version of the data expected by the endpoint. This controls - * the shape of the envelope (i.e. its fields and metadata). The endpoint - * version is based on the version of the Pub/Sub API. If not present during - * the `CreateSubscription` call, it will default to the version of the API - * used to make such call. If not present during a `ModifyPushConfig` call, - * its value will not be changed. `GetSubscription` calls will always return a - * valid version, even if the subscription was created without this attribute. - * The possible values for this attribute are: * `v1beta1`: uses the push - * format defined in the v1beta1 Pub/Sub API. * `v1` or `v1beta2`: uses the - * push format defined in the v1 Pub/Sub API. + * Request for the Publish method. */ - attributes: any; + export interface Schema$PublishRequest { + /** + * The messages to publish. + */ + messages: Schema$PubsubMessage[]; + } /** - * A URL locating the endpoint to which messages should be pushed. For - * example, a Webhook endpoint might use "https://example.com/push". + * Response for the `Publish` method. */ - pushEndpoint: string; -} -/** - * A message and its corresponding acknowledgment ID. - */ -export interface Schema$ReceivedMessage { + export interface Schema$PublishResponse { + /** + * The server-assigned ID of each published message, in the same order as + * the messages in the request. IDs are guaranteed to be unique within the + * topic. + */ + messageIds: string[]; + } /** - * This ID can be used to acknowledge the received message. + * A message data and its attributes. The message payload must not be empty; + * it must contain either a non-empty data field, or at least one attribute. */ - ackId: string; + export interface Schema$PubsubMessage { + /** + * Optional attributes for this message. + */ + attributes: any; + /** + * The message payload. For JSON requests, the value of this field must be + * [base64-encoded](https://tools.ietf.org/html/rfc4648). + */ + data: string; + /** + * ID of this message, assigned by the server when the message is published. + * Guaranteed to be unique within the topic. This value may be read by a + * subscriber that receives a `PubsubMessage` via a `Pull` call or a push + * delivery. It must not be populated by the publisher in a `Publish` call. + */ + messageId: string; + /** + * The time at which the message was published, populated by the server when + * it receives the `Publish` call. It must not be populated by the publisher + * in a `Publish` call. + */ + publishTime: string; + } /** - * The message. + * Request for the `Pull` method. */ - message: Schema$PubsubMessage; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + export interface Schema$PullRequest { + /** + * The maximum number of messages returned for this request. The Pub/Sub + * system may return fewer than the number specified. + */ + maxMessages: number; + /** + * If this is specified as true the system will respond immediately even if + * it is not able to return a message in the `Pull` response. Otherwise the + * system is allowed to wait until at least one message is available rather + * than returning no messages. The client may cancel the request if it does + * not wish to wait any longer for the response. + */ + returnImmediately: boolean; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. + * Response for the `Pull` method. */ - policy: Schema$Policy; -} -/** - * A subscription resource. - */ -export interface Schema$Subscription { + export interface Schema$PullResponse { + /** + * Received Pub/Sub messages. The Pub/Sub system will return zero messages + * if there are no more available in the backlog. The Pub/Sub system may + * return fewer than the `maxMessages` requested even if there are more + * messages available in the backlog. + */ + receivedMessages: Schema$ReceivedMessage[]; + } /** - * This value is the maximum time after a subscriber receives a message before - * the subscriber should acknowledge the message. After message delivery but - * before the ack deadline expires and before the message is acknowledged, it - * is an outstanding message and will not be delivered again during that time - * (on a best-effort basis). For pull subscriptions, this value is used as - * the initial value for the ack deadline. To override this value for a given - * message, call `ModifyAckDeadline` with the corresponding `ack_id` if using - * pull. The maximum custom deadline you can specify is 600 seconds (10 - * minutes). For push delivery, this value is also used to set the request - * timeout for the call to the push endpoint. If the subscriber never - * acknowledges the message, the Pub/Sub system will eventually redeliver the - * message. If this parameter is 0, a default value of 10 seconds is used. + * Configuration for a push delivery endpoint. */ - ackDeadlineSeconds: number; + export interface Schema$PushConfig { + /** + * Endpoint configuration attributes. Every endpoint has a set of API + * supported attributes that can be used to control different aspects of the + * message delivery. The currently supported attribute is `x-goog-version`, + * which you can use to change the format of the push message. This + * attribute indicates the version of the data expected by the endpoint. + * This controls the shape of the envelope (i.e. its fields and metadata). + * The endpoint version is based on the version of the Pub/Sub API. If not + * present during the `CreateSubscription` call, it will default to the + * version of the API used to make such call. If not present during a + * `ModifyPushConfig` call, its value will not be changed. `GetSubscription` + * calls will always return a valid version, even if the subscription was + * created without this attribute. The possible values for this attribute + * are: * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub + * API. * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub + * API. + */ + attributes: any; + /** + * A URL locating the endpoint to which messages should be pushed. For + * example, a Webhook endpoint might use + * "https://example.com/push". + */ + pushEndpoint: string; + } /** - * The name of the subscription. It must have the format - * `"projects/{project}/subscriptions/{subscription}"`. - * `{subscription}` must start with a letter, and contain only letters - * (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods - * (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between - * 3 and 255 characters in length, and it must not start with - * `"goog"`. + * A message and its corresponding acknowledgment ID. */ - name: string; + export interface Schema$ReceivedMessage { + /** + * This ID can be used to acknowledge the received message. + */ + ackId: string; + /** + * The message. + */ + message: Schema$PubsubMessage; + } /** - * If push delivery is used with this subscription, this field is used to - * configure it. An empty `pushConfig` signifies that the subscriber will pull - * and ack messages using API methods. + * Request message for `SetIamPolicy` method. */ - pushConfig: Schema$PushConfig; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + } /** - * The name of the topic from which this subscription is receiving messages. - * The value of this field will be `_deleted-topic_` if the topic has been - * deleted. + * A subscription resource. */ - topic: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$Subscription { + /** + * This value is the maximum time after a subscriber receives a message + * before the subscriber should acknowledge the message. After message + * delivery but before the ack deadline expires and before the message is + * acknowledged, it is an outstanding message and will not be delivered + * again during that time (on a best-effort basis). For pull subscriptions, + * this value is used as the initial value for the ack deadline. To override + * this value for a given message, call `ModifyAckDeadline` with the + * corresponding `ack_id` if using pull. The maximum custom deadline you can + * specify is 600 seconds (10 minutes). For push delivery, this value is + * also used to set the request timeout for the call to the push endpoint. + * If the subscriber never acknowledges the message, the Pub/Sub system will + * eventually redeliver the message. If this parameter is 0, a default + * value of 10 seconds is used. + */ + ackDeadlineSeconds: number; + /** + * The name of the subscription. It must have the format + * `"projects/{project}/subscriptions/{subscription}"`. + * `{subscription}` must start with a letter, and contain only letters + * (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods + * (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be + * between 3 and 255 characters in length, and it must not start with + * `"goog"`. + */ + name: string; + /** + * If push delivery is used with this subscription, this field is used to + * configure it. An empty `pushConfig` signifies that the subscriber will + * pull and ack messages using API methods. + */ + pushConfig: Schema$PushConfig; + /** + * The name of the topic from which this subscription is receiving messages. + * The value of this field will be `_deleted-topic_` if the topic has been + * deleted. + */ + topic: string; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * Request message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * Response message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * A topic resource. - */ -export interface Schema$Topic { + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * The name of the topic. It must have the format - * `"projects/{project}/topics/{topic}"`. `{topic}` must start with - * a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes - * (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or - * percent signs (`%`). It must be between 3 and 255 characters in length, and - * it must not start with `"goog"`. + * A topic resource. */ - name: string; -} - -export class Resource$Projects { - root: Pubsub; - subscriptions: Resource$Projects$Subscriptions; - topics: Resource$Projects$Topics; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - this.subscriptions = new Resource$Projects$Subscriptions(root); - this.topics = new Resource$Projects$Topics(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Subscriptions { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$Topic { + /** + * The name of the topic. It must have the format + * `"projects/{project}/topics/{topic}"`. `{topic}` must start + * with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), + * dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) + * or percent signs (`%`). It must be between 3 and 255 characters in + * length, and it must not start with `"goog"`. + */ + name: string; } + export class Resource$Projects { + root: Pubsub; + subscriptions: Resource$Projects$Subscriptions; + topics: Resource$Projects$Topics; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + this.subscriptions = new Resource$Projects$Subscriptions(root); + this.topics = new Resource$Projects$Topics(root); + } - /** - * pubsub.projects.subscriptions.acknowledge - * @desc Acknowledges the messages associated with the `ack_ids` in the - * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - * from the subscription. Acknowledging a message whose ack deadline has - * expired may succeed, but such a message may be redelivered later. - * Acknowledging a message more than once will not result in an error. - * @alias pubsub.projects.subscriptions.acknowledge - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription whose message is being acknowledged. - * @param {().AcknowledgeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - acknowledge(params?: any, options?: MethodOptions): - AxiosPromise; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - acknowledge( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Subscriptions { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}:acknowledge') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * pubsub.projects.subscriptions.create - * @desc Creates a subscription to a given topic. If the subscription already - * exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, - * returns `NOT_FOUND`. If the name is not provided in the request, the - * server will assign a random name for this subscription on the same project - * as the topic. Note that for REST API requests, you must specify a name. - * @alias pubsub.projects.subscriptions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.subscriptions.acknowledge + * @desc Acknowledges the messages associated with the `ack_ids` in the + * `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages + * from the subscription. Acknowledging a message whose ack deadline has + * expired may succeed, but such a message may be redelivered later. + * Acknowledging a message more than once will not result in an error. + * @alias pubsub.projects.subscriptions.acknowledge + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription whose message is being acknowledged. + * @param {().AcknowledgeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + acknowledge(params?: any, options?: MethodOptions): + AxiosPromise; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + acknowledge( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}:acknowledge') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.delete - * @desc Deletes an existing subscription. All pending messages in the - * subscription are immediately dropped. Calls to `Pull` after deletion will - * return `NOT_FOUND`. After a subscription is deleted, a new one may be - * created with the same name, but the new one has no association with the old - * subscription, or its topic unless the same topic is specified. - * @alias pubsub.projects.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.subscriptions.create + * @desc Creates a subscription to a given topic. If the subscription + * already exists, returns `ALREADY_EXISTS`. If the corresponding topic + * doesn't exist, returns `NOT_FOUND`. If the name is not provided in the + * request, the server will assign a random name for this subscription on + * the same project as the topic. Note that for REST API requests, you must + * specify a name. + * @alias pubsub.projects.subscriptions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.get - * @desc Gets the configuration details of a subscription. - * @alias pubsub.projects.subscriptions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.subscriptions.delete + * @desc Deletes an existing subscription. All pending messages in the + * subscription are immediately dropped. Calls to `Pull` after deletion will + * return `NOT_FOUND`. After a subscription is deleted, a new one may be + * created with the same name, but the new one has no association with the + * old subscription, or its topic unless the same topic is specified. + * @alias pubsub.projects.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias pubsub.projects.subscriptions.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.subscriptions.get + * @desc Gets the configuration details of a subscription. + * @alias pubsub.projects.subscriptions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.list - * @desc Lists matching subscriptions. - * @alias pubsub.projects.subscriptions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of subscriptions to return. - * @param {string=} params.pageToken The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data. - * @param {string} params.project The name of the cloud project that subscriptions belong to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+project}/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.projects.subscriptions.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias pubsub.projects.subscriptions.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.projects.subscriptions.modifyAckDeadline - * @desc Modifies the ack deadline for a specific message. This method is - * useful to indicate that more time is needed to process a message by the - * subscriber, or to make the message available for redelivery if the - * processing was interrupted. Note that this does not modify the - * subscription-level `ackDeadlineSeconds` used for subsequent messages. - * @alias pubsub.projects.subscriptions.modifyAckDeadline - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription. - * @param {().ModifyAckDeadlineRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyAckDeadline(params?: any, options?: MethodOptions): - AxiosPromise; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyAckDeadline( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.projects.subscriptions.list + * @desc Lists matching subscriptions. + * @alias pubsub.projects.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of subscriptions to return. + * @param {string=} params.pageToken The value returned by the last `ListSubscriptionsResponse`; indicates that this is a continuation of a prior `ListSubscriptions` call, and that the system should return the next page of data. + * @param {string} params.project The name of the cloud project that subscriptions belong to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+project}/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}:modifyAckDeadline') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.modifyPushConfig - * @desc Modifies the `PushConfig` for a specified subscription. This may be - * used to change a push subscription to a pull one (signified by an empty - * `PushConfig`) or vice versa, or change the endpoint URL and other - * attributes of a push subscription. Messages will accumulate for delivery - * continuously through the call regardless of changes to the `PushConfig`. - * @alias pubsub.projects.subscriptions.modifyPushConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The name of the subscription. - * @param {().ModifyPushConfigRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - modifyPushConfig(params?: any, options?: MethodOptions): - AxiosPromise; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - modifyPushConfig( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}:modifyPushConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.projects.subscriptions.modifyAckDeadline + * @desc Modifies the ack deadline for a specific message. This method is + * useful to indicate that more time is needed to process a message by the + * subscriber, or to make the message available for redelivery if the + * processing was interrupted. Note that this does not modify the + * subscription-level `ackDeadlineSeconds` used for subsequent messages. + * @alias pubsub.projects.subscriptions.modifyAckDeadline + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription. + * @param {().ModifyAckDeadlineRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyAckDeadline(params?: any, options?: MethodOptions): + AxiosPromise; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyAckDeadline( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}:modifyAckDeadline') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.projects.subscriptions.pull - * @desc Pulls messages from the server. Returns an empty list if there are no - * messages available in the backlog. The server may return `UNAVAILABLE` if - * there are too many concurrent pull requests pending for the given - * subscription. - * @alias pubsub.projects.subscriptions.pull - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.subscription The subscription from which messages should be pulled. - * @param {().PullRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pull(params?: any, options?: MethodOptions): - AxiosPromise; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pull( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.projects.subscriptions.modifyPushConfig + * @desc Modifies the `PushConfig` for a specified subscription. This may + * be used to change a push subscription to a pull one (signified by an + * empty `PushConfig`) or vice versa, or change the endpoint URL and other + * attributes of a push subscription. Messages will accumulate for delivery + * continuously through the call regardless of changes to the `PushConfig`. + * @alias pubsub.projects.subscriptions.modifyPushConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The name of the subscription. + * @param {().ModifyPushConfigRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + modifyPushConfig(params?: any, options?: MethodOptions): + AxiosPromise; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + modifyPushConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}:modifyPushConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+subscription}:pull') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['subscription'], - pathParams: ['subscription'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.subscriptions.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias pubsub.projects.subscriptions.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * pubsub.projects.subscriptions.pull + * @desc Pulls messages from the server. Returns an empty list if there are + * no messages available in the backlog. The server may return `UNAVAILABLE` + * if there are too many concurrent pull requests pending for the given + * subscription. + * @alias pubsub.projects.subscriptions.pull + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.subscription The subscription from which messages should be pulled. + * @param {().PullRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pull(params?: any, options?: MethodOptions): + AxiosPromise; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pull( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+subscription}:pull') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['subscription'], + pathParams: ['subscription'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * pubsub.projects.subscriptions.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias pubsub.projects.subscriptions.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * pubsub.projects.subscriptions.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias pubsub.projects.subscriptions.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Topics { - root: Pubsub; - subscriptions: Resource$Projects$Topics$Subscriptions; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - this.subscriptions = new Resource$Projects$Topics$Subscriptions(root); - } - getRoot() { - return this.root; + /** + * pubsub.projects.subscriptions.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias pubsub.projects.subscriptions.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * pubsub.projects.topics.create - * @desc Creates the given topic with the given name. - * @alias pubsub.projects.topics.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. - * @param {().Topic} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Topics { + root: Pubsub; + subscriptions: Resource$Projects$Topics$Subscriptions; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + this.subscriptions = new Resource$Projects$Topics$Subscriptions(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * pubsub.projects.topics.delete - * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the - * topic does not exist. After a topic is deleted, a new topic may be created - * with the same name; this is an entirely new topic with none of the old - * configuration or subscriptions. Existing subscriptions to this topic are - * not deleted, but their `topic` field is set to `_deleted-topic_`. - * @alias pubsub.projects.topics.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic Name of the topic to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.create + * @desc Creates the given topic with the given name. + * @alias pubsub.projects.topics.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`. + * @param {().Topic} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+topic}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.get - * @desc Gets the configuration of a topic. - * @alias pubsub.projects.topics.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic The name of the topic to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.delete + * @desc Deletes the topic with the given name. Returns `NOT_FOUND` if the + * topic does not exist. After a topic is deleted, a new topic may be + * created with the same name; this is an entirely new topic with none of + * the old configuration or subscriptions. Existing subscriptions to this + * topic are not deleted, but their `topic` field is set to + * `_deleted-topic_`. + * @alias pubsub.projects.topics.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic Name of the topic to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta2/{+topic}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+topic}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias pubsub.projects.topics.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.get + * @desc Gets the configuration of a topic. + * @alias pubsub.projects.topics.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic The name of the topic to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1beta2/{+topic}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.list - * @desc Lists matching topics. - * @alias pubsub.projects.topics.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of topics to return. - * @param {string=} params.pageToken The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data. - * @param {string} params.project The name of the cloud project that topics belong to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias pubsub.projects.topics.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+project}/topics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.publish - * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the - * topic does not exist. The message payload must not be empty; it must - * contain either a non-empty data field, or at least one attribute. - * @alias pubsub.projects.topics.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.topic The messages in the request will be published on this topic. - * @param {().PublishRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): - AxiosPromise; - publish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publish( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.list + * @desc Lists matching topics. + * @alias pubsub.projects.topics.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of topics to return. + * @param {string=} params.pageToken The value returned by the last `ListTopicsResponse`; indicates that this is a continuation of a prior `ListTopics` call, and that the system should return the next page of data. + * @param {string} params.project The name of the cloud project that topics belong to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+project}/topics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+topic}:publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias pubsub.projects.topics.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.publish + * @desc Adds one or more messages to the topic. Returns `NOT_FOUND` if the + * topic does not exist. The message payload must not be empty; it must + * contain either a non-empty data field, or at least one attribute. + * @alias pubsub.projects.topics.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.topic The messages in the request will be published on this topic. + * @param {().PublishRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): + AxiosPromise; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publish( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+topic}:publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * pubsub.projects.topics.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias pubsub.projects.topics.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * pubsub.projects.topics.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias pubsub.projects.topics.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * pubsub.projects.topics.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias pubsub.projects.topics.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Projects$Topics$Subscriptions { - root: Pubsub; - constructor(root: Pubsub) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Projects$Topics$Subscriptions { + root: Pubsub; + constructor(root: Pubsub) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * pubsub.projects.topics.subscriptions.list - * @desc Lists the name of the subscriptions for this topic. - * @alias pubsub.projects.topics.subscriptions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Maximum number of subscription names to return. - * @param {string=} params.pageToken The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data. - * @param {string} params.topic The name of the topic that subscriptions are attached to. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/{+topic}/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['topic'], - pathParams: ['topic'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * pubsub.projects.topics.subscriptions.list + * @desc Lists the name of the subscriptions for this topic. + * @alias pubsub.projects.topics.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Maximum number of subscription names to return. + * @param {string=} params.pageToken The value returned by the last `ListTopicSubscriptionsResponse`; indicates that this is a continuation of a prior `ListTopicSubscriptions` call, and that the system should return the next page of data. + * @param {string} params.topic The name of the topic that subscriptions are attached to. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://pubsub.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/{+topic}/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['topic'], + pathParams: ['topic'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/replicapool/v1beta1.ts b/src/apis/replicapool/v1beta1.ts index 32662ecc6e6..ae790094131 100644 --- a/src/apis/replicapool/v1beta1.ts +++ b/src/apis/replicapool/v1beta1.ts @@ -27,1139 +27,1149 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Replica Pool API - * - * The Replica Pool API allows users to declaratively provision and manage - * groups of Google Compute Engine instances based on a common template. - * - * @example - * const google = require('googleapis'); - * const replicapool = google.replicapool('v1beta1'); - * - * @namespace replicapool - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Replicapool - */ -export class Replicapool { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace replicapool_v1beta1 { + /** + * Replica Pool API + * + * The Replica Pool API allows users to declaratively provision and manage + * groups of Google Compute Engine instances based on a common template. + * + * @example + * const google = require('googleapis'); + * const replicapool = google.replicapool('v1beta1'); + * + * @namespace replicapool + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Replicapool + */ + export class Replicapool { + _options: GlobalOptions; + google: GoogleApis; + root = this; - pools: Resource$Pools; - replicas: Resource$Replicas; + pools: Resource$Pools; + replicas: Resource$Replicas; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.pools = new Resource$Pools(this); - this.replicas = new Resource$Replicas(this); - } + this.pools = new Resource$Pools(this); + this.replicas = new Resource$Replicas(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A Compute Engine network accessConfig. Identical to the accessConfig on - * corresponding Compute Engine resource. - */ -export interface Schema$AccessConfig { - /** - * Name of this access configuration. - */ - name: string; - /** - * An external IP address associated with this instance. - */ - natIp: string; - /** - * Type of this access configuration file. Currently only ONE_TO_ONE_NAT is - * supported. - */ - type: string; -} -/** - * An action that gets executed during initialization of the replicas. - */ -export interface Schema$Action { - /** - * A list of commands to run, one per line. If any command fails, the whole - * action is considered a failure and no further actions are run. This also - * marks the virtual machine or replica as a failure. - */ - commands: string[]; - /** - * A list of environment variables to use for the commands in this action. - */ - envVariables: Schema$EnvVariable[]; - /** - * If an action's commands on a particular replica do not finish in the - * specified timeoutMilliSeconds, the replica is considered to be in a FAILING - * state. No efforts are made to stop any processes that were spawned or - * created as the result of running the action's commands. The default is - * the max allowed value, 1 hour (i.e. 3600000 milliseconds). - */ - timeoutMilliSeconds: number; -} -/** - * Specifies how to attach a disk to a Replica. - */ -export interface Schema$DiskAttachment { - /** - * The device name of this disk. - */ - deviceName: string; - /** - * A zero-based index to assign to this disk, where 0 is reserved for the boot - * disk. If not specified, this is assigned by the server. - */ - index: number; -} -/** - * An environment variable to set for an action. - */ -export interface Schema$EnvVariable { - /** - * Deprecated, do not use. - */ - hidden: boolean; - /** - * The name of the environment variable. - */ - name: string; - /** - * The value of the variable. - */ - value: string; -} -/** - * A pre-existing persistent disk that will be attached to every Replica in the - * Pool in READ_ONLY mode. - */ -export interface Schema$ExistingDisk { - /** - * How the disk will be attached to the Replica. - */ - attachment: Schema$DiskAttachment; - /** - * The name of the Persistent Disk resource. The Persistent Disk resource must - * be in the same zone as the Pool. - */ - source: string; -} -export interface Schema$HealthCheck { - /** - * How often (in seconds) to make HTTP requests for this healthcheck. The - * default value is 5 seconds. - */ - checkIntervalSec: number; - /** - * The description for this health check. - */ - description: string; - /** - * The number of consecutive health check requests that need to succeed before - * the replica is considered healthy again. The default value is 2. - */ - healthyThreshold: number; - /** - * The value of the host header in the HTTP health check request. If left - * empty (default value), the localhost IP 127.0.0.1 will be used. - */ - host: string; - /** - * The name of this health check. - */ - name: string; - /** - * The localhost request path to send this health check, in the format - * /path/to/use. For example, /healthcheck. - */ - path: string; - /** - * The TCP port for the health check requests. - */ - port: number; - /** - * How long (in seconds) to wait before a timeout failure for this - * healthcheck. The default value is 5 seconds. - */ - timeoutSec: number; - /** - * The number of consecutive health check requests that need to fail in order - * to consider the replica unhealthy. The default value is 2. - */ - unhealthyThreshold: number; -} -/** - * A label to apply to this replica pool. - */ -export interface Schema$Label { - /** - * The key for this label. - */ - key: string; /** - * The value of this label. - */ - value: string; -} -/** - * A Compute Engine metadata entry. Identical to the metadata on the - * corresponding Compute Engine resource. - */ -export interface Schema$Metadata { - /** - * The fingerprint of the metadata. Required for updating the metadata entries - * for this instance. - */ - fingerPrint: string; - /** - * A list of metadata items. - */ - items: Schema$MetadataItem[]; -} -/** - * A Compute Engine metadata item, defined as a key:value pair. Identical to the - * metadata on the corresponding Compute Engine resource. - */ -export interface Schema$MetadataItem { - /** - * A metadata key. - */ - key: string; - /** - * A metadata value. - */ - value: string; -} -/** - * A Compute Engine NetworkInterface resource. Identical to the NetworkInterface - * on the corresponding Compute Engine resource. - */ -export interface Schema$NetworkInterface { - /** - * An array of configurations for this interface. This specifies how this - * interface is configured to interact with other network services. - */ - accessConfigs: Schema$AccessConfig[]; - /** - * Name the Network resource to which this interface applies. - */ - network: string; - /** - * An optional IPV4 internal network address to assign to the instance for - * this network interface. - */ - networkIp: string; -} -/** - * A Persistent Disk resource that will be created and attached to each Replica - * in the Pool. Each Replica will have a unique persistent disk that is created - * and attached to that Replica in READ_WRITE mode. - */ -export interface Schema$NewDisk { - /** - * How the disk will be attached to the Replica. - */ - attachment: Schema$DiskAttachment; - /** - * If true, then this disk will be deleted when the instance is deleted. The - * default value is true. - */ - autoDelete: boolean; - /** - * If true, indicates that this is the root persistent disk. - */ - boot: boolean; - /** - * Create the new disk using these parameters. The name of the disk will be - * <instance_name>-<four_random_charactersgt;. - */ - initializeParams: Schema$NewDiskInitializeParams; -} -/** - * Initialization parameters for creating a new disk. - */ -export interface Schema$NewDiskInitializeParams { - /** - * The size of the created disk in gigabytes. - */ - diskSizeGb: string; - /** - * Name of the disk type resource describing which disk type to use to create - * the disk. For example 'pd-ssd' or 'pd-standard'. Default is - * 'pd-standard' - */ - diskType: string; - /** - * The name or fully-qualified URL of a source image to use to create this - * disk. If you provide a name of the source image, Replica Pool will look for - * an image with that name in your project. If you are specifying an image - * provided by Compute Engine, you will need to provide the full URL with the - * correct project, such as: - * http://www.googleapis.com/compute/v1/projects/debian-cloud/ - * global/images/debian-wheezy-7-vYYYYMMDD - */ - sourceImage: string; -} -export interface Schema$Pool { - /** - * Whether replicas in this pool should be restarted if they experience a - * failure. The default value is true. - */ - autoRestart: boolean; - /** - * The base instance name to use for the replicas in this pool. This must - * match the regex [a-z]([-a-z0-9]*[a-z0-9])?. If specified, the instances in - * this replica pool will be named in the format - * <base-instance-name>-<ID>. The <ID> postfix will be a - * four character alphanumeric identifier generated by the service. If this - * is not specified by the user, a random base instance name is generated by - * the service. - */ - baseInstanceName: string; - /** - * [Output Only] The current number of replicas in the pool. - */ - currentNumReplicas: number; - /** - * An optional description of the replica pool. - */ - description: string; - /** - * Deprecated. Please use template[].healthChecks instead. - */ - healthChecks: Schema$HealthCheck[]; - /** - * The initial number of replicas this pool should have. You must provide a - * value greater than or equal to 0. - */ - initialNumReplicas: number; - /** - * A list of labels to attach to this replica pool and all created virtual - * machines in this replica pool. - */ - labels: Schema$Label[]; - /** - * The name of the replica pool. Must follow the regex - * [a-z]([-a-z0-9]*[a-z0-9])? and be 1-28 characters long. - */ - name: string; - /** - * Deprecated! Use initial_num_replicas instead. - */ - numReplicas: number; - /** - * The list of resource views that should be updated with all the replicas - * that are managed by this pool. - */ - resourceViews: string[]; - /** - * [Output Only] A self-link to the replica pool. - */ - selfLink: string; - /** - * Deprecated, please use target_pools instead. - */ - targetPool: string; - /** - * A list of target pools to update with the replicas that are managed by this - * pool. If specified, the replicas in this replica pool will be added to the - * specified target pools for load balancing purposes. The replica pool must - * live in the same region as the specified target pools. These values must be - * the target pool resource names, and not fully qualified URLs. - */ - targetPools: string[]; - /** - * The template to use when creating replicas in this pool. This template is - * used during initial instance creation of the pool, when growing the pool in - * size, or when a replica restarts. - */ - template: Schema$Template; - /** - * Deprecated! Do not set. - */ - type: string; -} -export interface Schema$PoolsDeleteRequest { - /** - * If there are instances you would like to keep, you can specify them here. - * These instances won't be deleted, but the associated replica objects - * will be removed. - */ - abandonInstances: string[]; -} -export interface Schema$PoolsListResponse { - nextPageToken: string; - resources: Schema$Pool[]; -} -/** - * An individual Replica within a Pool. Replicas are automatically created by - * the replica pool, using the template provided by the user. You cannot - * directly create replicas. - */ -export interface Schema$Replica { - /** - * [Output Only] The name of the Replica object. - */ - name: string; - /** - * [Output Only] The self-link of the Replica. - */ - selfLink: string; - /** - * [Output Only] Last known status of the Replica. - */ - status: Schema$ReplicaStatus; -} -export interface Schema$ReplicasDeleteRequest { - /** - * Whether the instance resource represented by this replica should be deleted - * or abandoned. If abandoned, the replica will be deleted but the virtual - * machine instance will remain. By default, this is set to false and the - * instance will be deleted along with the replica. - */ - abandonInstance: boolean; -} -export interface Schema$ReplicasListResponse { - nextPageToken: string; - resources: Schema$Replica[]; -} -/** - * The current status of a Replica. - */ -export interface Schema$ReplicaStatus { - /** - * [Output Only] Human-readable details about the current state of the replica - */ - details: string; - /** - * [Output Only] The state of the Replica. - */ - state: string; - /** - * [Output Only] The template used to build the replica. - */ - templateVersion: string; - /** - * [Output Only] Link to the virtual machine that this Replica represents. - */ - vmLink: string; - /** - * [Output Only] The time that this Replica got to the RUNNING state, in RFC - * 3339 format. If the start time is unknown, UNKNOWN is returned. - */ - vmStartTime: string; -} -/** - * A Compute Engine service account, identical to the Compute Engine resource. - */ -export interface Schema$ServiceAccount { - /** - * The service account email address, for example: - * 123845678986@project.gserviceaccount.com - */ - email: string; - /** - * The list of OAuth2 scopes to obtain for the service account, for example: - * https://www.googleapis.com/auth/devstorage.full_control - */ - scopes: string[]; -} -/** - * A Compute Engine Instance tag, identical to the tags on the corresponding - * Compute Engine Instance resource. - */ -export interface Schema$Tag { - /** - * The fingerprint of the tag. Required for updating the list of tags. - */ - fingerPrint: string; + * A Compute Engine network accessConfig. Identical to the accessConfig on + * corresponding Compute Engine resource. + */ + export interface Schema$AccessConfig { + /** + * Name of this access configuration. + */ + name: string; + /** + * An external IP address associated with this instance. + */ + natIp: string; + /** + * Type of this access configuration file. Currently only ONE_TO_ONE_NAT is + * supported. + */ + type: string; + } /** - * Items contained in this tag. - */ - items: string[]; -} -/** - * The template used for creating replicas in the pool. - */ -export interface Schema$Template { + * An action that gets executed during initialization of the replicas. + */ + export interface Schema$Action { + /** + * A list of commands to run, one per line. If any command fails, the whole + * action is considered a failure and no further actions are run. This also + * marks the virtual machine or replica as a failure. + */ + commands: string[]; + /** + * A list of environment variables to use for the commands in this action. + */ + envVariables: Schema$EnvVariable[]; + /** + * If an action's commands on a particular replica do not finish in the + * specified timeoutMilliSeconds, the replica is considered to be in a + * FAILING state. No efforts are made to stop any processes that were + * spawned or created as the result of running the action's commands. + * The default is the max allowed value, 1 hour (i.e. 3600000 milliseconds). + */ + timeoutMilliSeconds: number; + } /** - * An action to run during initialization of your replicas. An action is run - * as shell commands which are executed one after the other in the same bash - * shell, so any state established by one command is inherited by later - * commands. - */ - action: Schema$Action; + * Specifies how to attach a disk to a Replica. + */ + export interface Schema$DiskAttachment { + /** + * The device name of this disk. + */ + deviceName: string; + /** + * A zero-based index to assign to this disk, where 0 is reserved for the + * boot disk. If not specified, this is assigned by the server. + */ + index: number; + } /** - * A list of HTTP Health Checks to configure for this replica pool and all - * virtual machines in this replica pool. - */ - healthChecks: Schema$HealthCheck[]; + * An environment variable to set for an action. + */ + export interface Schema$EnvVariable { + /** + * Deprecated, do not use. + */ + hidden: boolean; + /** + * The name of the environment variable. + */ + name: string; + /** + * The value of the variable. + */ + value: string; + } /** - * A free-form string describing the version of this template. You can provide - * any versioning string you would like. For example, version1 or template-v1. - */ - version: string; + * A pre-existing persistent disk that will be attached to every Replica in + * the Pool in READ_ONLY mode. + */ + export interface Schema$ExistingDisk { + /** + * How the disk will be attached to the Replica. + */ + attachment: Schema$DiskAttachment; + /** + * The name of the Persistent Disk resource. The Persistent Disk resource + * must be in the same zone as the Pool. + */ + source: string; + } + export interface Schema$HealthCheck { + /** + * How often (in seconds) to make HTTP requests for this healthcheck. The + * default value is 5 seconds. + */ + checkIntervalSec: number; + /** + * The description for this health check. + */ + description: string; + /** + * The number of consecutive health check requests that need to succeed + * before the replica is considered healthy again. The default value is 2. + */ + healthyThreshold: number; + /** + * The value of the host header in the HTTP health check request. If left + * empty (default value), the localhost IP 127.0.0.1 will be used. + */ + host: string; + /** + * The name of this health check. + */ + name: string; + /** + * The localhost request path to send this health check, in the format + * /path/to/use. For example, /healthcheck. + */ + path: string; + /** + * The TCP port for the health check requests. + */ + port: number; + /** + * How long (in seconds) to wait before a timeout failure for this + * healthcheck. The default value is 5 seconds. + */ + timeoutSec: number; + /** + * The number of consecutive health check requests that need to fail in + * order to consider the replica unhealthy. The default value is 2. + */ + unhealthyThreshold: number; + } /** - * The virtual machine parameters to use for creating replicas. You can define - * settings such as the machine type and the image of replicas in this pool. - * This is required if replica type is SMART_VM. - */ - vmParams: Schema$VmParams; -} -/** - * Parameters for creating a Compute Engine Instance resource. Most fields are - * identical to the corresponding Compute Engine resource. - */ -export interface Schema$VmParams { + * A label to apply to this replica pool. + */ + export interface Schema$Label { + /** + * The key for this label. + */ + key: string; + /** + * The value of this label. + */ + value: string; + } /** - * Deprecated. Please use baseInstanceName instead. - */ - baseInstanceName: string; + * A Compute Engine metadata entry. Identical to the metadata on the + * corresponding Compute Engine resource. + */ + export interface Schema$Metadata { + /** + * The fingerprint of the metadata. Required for updating the metadata + * entries for this instance. + */ + fingerPrint: string; + /** + * A list of metadata items. + */ + items: Schema$MetadataItem[]; + } /** - * Enables IP Forwarding, which allows this instance to receive packets - * destined for a different IP address, and send packets with a different - * source IP. See IP Forwarding for more information. - */ - canIpForward: boolean; + * A Compute Engine metadata item, defined as a key:value pair. Identical to + * the metadata on the corresponding Compute Engine resource. + */ + export interface Schema$MetadataItem { + /** + * A metadata key. + */ + key: string; + /** + * A metadata value. + */ + value: string; + } /** - * An optional textual description of the instance. - */ - description: string; + * A Compute Engine NetworkInterface resource. Identical to the + * NetworkInterface on the corresponding Compute Engine resource. + */ + export interface Schema$NetworkInterface { + /** + * An array of configurations for this interface. This specifies how this + * interface is configured to interact with other network services. + */ + accessConfigs: Schema$AccessConfig[]; + /** + * Name the Network resource to which this interface applies. + */ + network: string; + /** + * An optional IPV4 internal network address to assign to the instance for + * this network interface. + */ + networkIp: string; + } /** - * A list of existing Persistent Disk resources to attach to each replica in - * the pool. Each disk will be attached in read-only mode to every replica. - */ - disksToAttach: Schema$ExistingDisk[]; + * A Persistent Disk resource that will be created and attached to each + * Replica in the Pool. Each Replica will have a unique persistent disk that + * is created and attached to that Replica in READ_WRITE mode. + */ + export interface Schema$NewDisk { + /** + * How the disk will be attached to the Replica. + */ + attachment: Schema$DiskAttachment; + /** + * If true, then this disk will be deleted when the instance is deleted. The + * default value is true. + */ + autoDelete: boolean; + /** + * If true, indicates that this is the root persistent disk. + */ + boot: boolean; + /** + * Create the new disk using these parameters. The name of the disk will be + * <instance_name>-<four_random_charactersgt;. + */ + initializeParams: Schema$NewDiskInitializeParams; + } /** - * A list of Disk resources to create and attach to each Replica in the Pool. - * Currently, you can only define one disk and it must be a root persistent - * disk. Note that Replica Pool will create a root persistent disk for each - * replica. - */ - disksToCreate: Schema$NewDisk[]; + * Initialization parameters for creating a new disk. + */ + export interface Schema$NewDiskInitializeParams { + /** + * The size of the created disk in gigabytes. + */ + diskSizeGb: string; + /** + * Name of the disk type resource describing which disk type to use to + * create the disk. For example 'pd-ssd' or 'pd-standard'. + * Default is 'pd-standard' + */ + diskType: string; + /** + * The name or fully-qualified URL of a source image to use to create this + * disk. If you provide a name of the source image, Replica Pool will look + * for an image with that name in your project. If you are specifying an + * image provided by Compute Engine, you will need to provide the full URL + * with the correct project, such as: + * http://www.googleapis.com/compute/v1/projects/debian-cloud/ + * global/images/debian-wheezy-7-vYYYYMMDD + */ + sourceImage: string; + } + export interface Schema$Pool { + /** + * Whether replicas in this pool should be restarted if they experience a + * failure. The default value is true. + */ + autoRestart: boolean; + /** + * The base instance name to use for the replicas in this pool. This must + * match the regex [a-z]([-a-z0-9]*[a-z0-9])?. If specified, the instances + * in this replica pool will be named in the format + * <base-instance-name>-<ID>. The <ID> postfix will be a + * four character alphanumeric identifier generated by the service. If this + * is not specified by the user, a random base instance name is generated by + * the service. + */ + baseInstanceName: string; + /** + * [Output Only] The current number of replicas in the pool. + */ + currentNumReplicas: number; + /** + * An optional description of the replica pool. + */ + description: string; + /** + * Deprecated. Please use template[].healthChecks instead. + */ + healthChecks: Schema$HealthCheck[]; + /** + * The initial number of replicas this pool should have. You must provide a + * value greater than or equal to 0. + */ + initialNumReplicas: number; + /** + * A list of labels to attach to this replica pool and all created virtual + * machines in this replica pool. + */ + labels: Schema$Label[]; + /** + * The name of the replica pool. Must follow the regex + * [a-z]([-a-z0-9]*[a-z0-9])? and be 1-28 characters long. + */ + name: string; + /** + * Deprecated! Use initial_num_replicas instead. + */ + numReplicas: number; + /** + * The list of resource views that should be updated with all the replicas + * that are managed by this pool. + */ + resourceViews: string[]; + /** + * [Output Only] A self-link to the replica pool. + */ + selfLink: string; + /** + * Deprecated, please use target_pools instead. + */ + targetPool: string; + /** + * A list of target pools to update with the replicas that are managed by + * this pool. If specified, the replicas in this replica pool will be added + * to the specified target pools for load balancing purposes. The replica + * pool must live in the same region as the specified target pools. These + * values must be the target pool resource names, and not fully qualified + * URLs. + */ + targetPools: string[]; + /** + * The template to use when creating replicas in this pool. This template is + * used during initial instance creation of the pool, when growing the pool + * in size, or when a replica restarts. + */ + template: Schema$Template; + /** + * Deprecated! Do not set. + */ + type: string; + } + export interface Schema$PoolsDeleteRequest { + /** + * If there are instances you would like to keep, you can specify them here. + * These instances won't be deleted, but the associated replica objects + * will be removed. + */ + abandonInstances: string[]; + } + export interface Schema$PoolsListResponse { + nextPageToken: string; + resources: Schema$Pool[]; + } /** - * The machine type for this instance. The resource name (e.g. n1-standard-1). - */ - machineType: string; + * An individual Replica within a Pool. Replicas are automatically created by + * the replica pool, using the template provided by the user. You cannot + * directly create replicas. + */ + export interface Schema$Replica { + /** + * [Output Only] The name of the Replica object. + */ + name: string; + /** + * [Output Only] The self-link of the Replica. + */ + selfLink: string; + /** + * [Output Only] Last known status of the Replica. + */ + status: Schema$ReplicaStatus; + } + export interface Schema$ReplicasDeleteRequest { + /** + * Whether the instance resource represented by this replica should be + * deleted or abandoned. If abandoned, the replica will be deleted but the + * virtual machine instance will remain. By default, this is set to false + * and the instance will be deleted along with the replica. + */ + abandonInstance: boolean; + } + export interface Schema$ReplicasListResponse { + nextPageToken: string; + resources: Schema$Replica[]; + } /** - * The metadata key/value pairs assigned to this instance. - */ - metadata: Schema$Metadata; + * The current status of a Replica. + */ + export interface Schema$ReplicaStatus { + /** + * [Output Only] Human-readable details about the current state of the + * replica + */ + details: string; + /** + * [Output Only] The state of the Replica. + */ + state: string; + /** + * [Output Only] The template used to build the replica. + */ + templateVersion: string; + /** + * [Output Only] Link to the virtual machine that this Replica represents. + */ + vmLink: string; + /** + * [Output Only] The time that this Replica got to the RUNNING state, in RFC + * 3339 format. If the start time is unknown, UNKNOWN is returned. + */ + vmStartTime: string; + } /** - * A list of network interfaces for the instance. Currently only one interface - * is supported by Google Compute Engine, ONE_TO_ONE_NAT. - */ - networkInterfaces: Schema$NetworkInterface[]; - onHostMaintenance: string; + * A Compute Engine service account, identical to the Compute Engine resource. + */ + export interface Schema$ServiceAccount { + /** + * The service account email address, for example: + * 123845678986@project.gserviceaccount.com + */ + email: string; + /** + * The list of OAuth2 scopes to obtain for the service account, for example: + * https://www.googleapis.com/auth/devstorage.full_control + */ + scopes: string[]; + } /** - * A list of Service Accounts to enable for this instance. - */ - serviceAccounts: Schema$ServiceAccount[]; + * A Compute Engine Instance tag, identical to the tags on the corresponding + * Compute Engine Instance resource. + */ + export interface Schema$Tag { + /** + * The fingerprint of the tag. Required for updating the list of tags. + */ + fingerPrint: string; + /** + * Items contained in this tag. + */ + items: string[]; + } /** - * A list of tags to apply to the Google Compute Engine instance to identify - * resources. - */ - tags: Schema$Tag; -} - -export class Resource$Pools { - root: Replicapool; - constructor(root: Replicapool) { - this.root = root; - this.getRoot.bind(this); + * The template used for creating replicas in the pool. + */ + export interface Schema$Template { + /** + * An action to run during initialization of your replicas. An action is run + * as shell commands which are executed one after the other in the same bash + * shell, so any state established by one command is inherited by later + * commands. + */ + action: Schema$Action; + /** + * A list of HTTP Health Checks to configure for this replica pool and all + * virtual machines in this replica pool. + */ + healthChecks: Schema$HealthCheck[]; + /** + * A free-form string describing the version of this template. You can + * provide any versioning string you would like. For example, version1 or + * template-v1. + */ + version: string; + /** + * The virtual machine parameters to use for creating replicas. You can + * define settings such as the machine type and the image of replicas in + * this pool. This is required if replica type is SMART_VM. + */ + vmParams: Schema$VmParams; } - - getRoot() { - return this.root; + /** + * Parameters for creating a Compute Engine Instance resource. Most fields are + * identical to the corresponding Compute Engine resource. + */ + export interface Schema$VmParams { + /** + * Deprecated. Please use baseInstanceName instead. + */ + baseInstanceName: string; + /** + * Enables IP Forwarding, which allows this instance to receive packets + * destined for a different IP address, and send packets with a different + * source IP. See IP Forwarding for more information. + */ + canIpForward: boolean; + /** + * An optional textual description of the instance. + */ + description: string; + /** + * A list of existing Persistent Disk resources to attach to each replica in + * the pool. Each disk will be attached in read-only mode to every replica. + */ + disksToAttach: Schema$ExistingDisk[]; + /** + * A list of Disk resources to create and attach to each Replica in the + * Pool. Currently, you can only define one disk and it must be a root + * persistent disk. Note that Replica Pool will create a root persistent + * disk for each replica. + */ + disksToCreate: Schema$NewDisk[]; + /** + * The machine type for this instance. The resource name (e.g. + * n1-standard-1). + */ + machineType: string; + /** + * The metadata key/value pairs assigned to this instance. + */ + metadata: Schema$Metadata; + /** + * A list of network interfaces for the instance. Currently only one + * interface is supported by Google Compute Engine, ONE_TO_ONE_NAT. + */ + networkInterfaces: Schema$NetworkInterface[]; + onHostMaintenance: string; + /** + * A list of Service Accounts to enable for this instance. + */ + serviceAccounts: Schema$ServiceAccount[]; + /** + * A list of tags to apply to the Google Compute Engine instance to identify + * resources. + */ + tags: Schema$Tag; } - - /** - * replicapool.pools.delete - * @desc Deletes a replica pool. - * @alias replicapool.pools.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The name of the replica pool for this request. - * @param {string} params.projectName The project ID for this replica pool. - * @param {string} params.zone The zone for this replica pool. - * @param {().PoolsDeleteRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Pools { + root: Replicapool; + constructor(root: Replicapool) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName'], - pathParams: ['poolName', 'projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapool.pools.get - * @desc Gets information about a single replica pool. - * @alias replicapool.pools.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The name of the replica pool for this request. - * @param {string} params.projectName The project ID for this replica pool. - * @param {string} params.zone The zone for this replica pool. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.pools.delete + * @desc Deletes a replica pool. + * @alias replicapool.pools.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The name of the replica pool for this request. + * @param {string} params.projectName The project ID for this replica pool. + * @param {string} params.zone The zone for this replica pool. + * @param {().PoolsDeleteRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName'], + pathParams: ['poolName', 'projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName'], - pathParams: ['poolName', 'projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.pools.insert - * @desc Inserts a new replica pool. - * @alias replicapool.pools.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project ID for this replica pool. - * @param {string} params.zone The zone for this replica pool. - * @param {().Pool} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone'], - pathParams: ['projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * replicapool.pools.get + * @desc Gets information about a single replica pool. + * @alias replicapool.pools.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The name of the replica pool for this request. + * @param {string} params.projectName The project ID for this replica pool. + * @param {string} params.zone The zone for this replica pool. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName'], + pathParams: ['poolName', 'projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * replicapool.pools.list - * @desc List all replica pools. - * @alias replicapool.pools.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50) - * @param {string=} params.pageToken Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request. - * @param {string} params.projectName The project ID for this request. - * @param {string} params.zone The zone for this replica pool. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.pools.insert + * @desc Inserts a new replica pool. + * @alias replicapool.pools.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project ID for this replica pool. + * @param {string} params.zone The zone for this replica pool. + * @param {().Pool} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone'], + pathParams: ['projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone'], - pathParams: ['projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.pools.resize - * @desc Resize a pool. This is an asynchronous operation, and multiple - * overlapping resize requests can be made. Replica Pools will use the - * information from the last resize request. - * @alias replicapool.pools.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.numReplicas The desired number of replicas to resize to. If this number is larger than the existing number of replicas, new replicas will be added. If the number is smaller, then existing replicas will be deleted. - * @param {string} params.poolName The name of the replica pool for this request. - * @param {string} params.projectName The project ID for this replica pool. - * @param {string} params.zone The zone for this replica pool. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName'], - pathParams: ['poolName', 'projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * replicapool.pools.list + * @desc List all replica pools. + * @alias replicapool.pools.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50) + * @param {string=} params.pageToken Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request. + * @param {string} params.projectName The project ID for this request. + * @param {string} params.zone The zone for this replica pool. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone'], + pathParams: ['projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * replicapool.pools.updatetemplate - * @desc Update the template used by the pool. - * @alias replicapool.pools.updatetemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The name of the replica pool for this request. - * @param {string} params.projectName The project ID for this replica pool. - * @param {string} params.zone The zone for this replica pool. - * @param {().Template} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updatetemplate(params?: any, options?: MethodOptions): AxiosPromise; - updatetemplate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updatetemplate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.pools.resize + * @desc Resize a pool. This is an asynchronous operation, and multiple + * overlapping resize requests can be made. Replica Pools will use the + * information from the last resize request. + * @alias replicapool.pools.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.numReplicas The desired number of replicas to resize to. If this number is larger than the existing number of replicas, new replicas will be added. If the number is smaller, then existing replicas will be deleted. + * @param {string} params.poolName The name of the replica pool for this request. + * @param {string} params.projectName The project ID for this replica pool. + * @param {string} params.zone The zone for this replica pool. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): AxiosPromise; + resize( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName'], + pathParams: ['poolName', 'projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/updateTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName'], - pathParams: ['poolName', 'projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Replicas { - root: Replicapool; - constructor(root: Replicapool) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * replicapool.pools.updatetemplate + * @desc Update the template used by the pool. + * @alias replicapool.pools.updatetemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The name of the replica pool for this request. + * @param {string} params.projectName The project ID for this replica pool. + * @param {string} params.zone The zone for this replica pool. + * @param {().Template} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updatetemplate(params?: any, options?: MethodOptions): AxiosPromise; + updatetemplate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updatetemplate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/updateTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName'], + pathParams: ['poolName', 'projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * replicapool.replicas.delete - * @desc Deletes a replica from the pool. - * @alias replicapool.replicas.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The replica pool name for this request. - * @param {string} params.projectName The project ID for this request. - * @param {string} params.replicaName The name of the replica for this request. - * @param {string} params.zone The zone where the replica lives. - * @param {().ReplicasDeleteRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Replicas { + root: Replicapool; + constructor(root: Replicapool) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], - pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapool.replicas.get - * @desc Gets information about a specific replica. - * @alias replicapool.replicas.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The replica pool name for this request. - * @param {string} params.projectName The project ID for this request. - * @param {string} params.replicaName The name of the replica for this request. - * @param {string} params.zone The zone where the replica lives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.replicas.delete + * @desc Deletes a replica from the pool. + * @alias replicapool.replicas.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The replica pool name for this request. + * @param {string} params.projectName The project ID for this request. + * @param {string} params.replicaName The name of the replica for this request. + * @param {string} params.zone The zone where the replica lives. + * @param {().ReplicasDeleteRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], + pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], - pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.replicas.list - * @desc Lists all replicas in a pool. - * @alias replicapool.replicas.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50) - * @param {string=} params.pageToken Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request. - * @param {string} params.poolName The replica pool name for this request. - * @param {string} params.projectName The project ID for this request. - * @param {string} params.zone The zone where the replica pool lives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapool.replicas.get + * @desc Gets information about a specific replica. + * @alias replicapool.replicas.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The replica pool name for this request. + * @param {string} params.projectName The project ID for this request. + * @param {string} params.replicaName The name of the replica for this request. + * @param {string} params.zone The zone where the replica lives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], + pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName'], - pathParams: ['poolName', 'projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.replicas.restart - * @desc Restarts a replica in a pool. - * @alias replicapool.replicas.restart - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.poolName The replica pool name for this request. - * @param {string} params.projectName The project ID for this request. - * @param {string} params.replicaName The name of the replica for this request. - * @param {string} params.zone The zone where the replica lives. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restart(params?: any, options?: MethodOptions): AxiosPromise; - restart( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - restart( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.replicas.list + * @desc Lists all replicas in a pool. + * @alias replicapool.replicas.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 100, inclusive. (Default: 50) + * @param {string=} params.pageToken Set this to the nextPageToken value returned by a previous list request to obtain the next page of results from the previous list request. + * @param {string} params.poolName The replica pool name for this request. + * @param {string} params.projectName The project ID for this request. + * @param {string} params.zone The zone where the replica pool lives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName'], + pathParams: ['poolName', 'projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], - pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * replicapool.replicas.restart + * @desc Restarts a replica in a pool. + * @alias replicapool.replicas.restart + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.poolName The replica pool name for this request. + * @param {string} params.projectName The project ID for this request. + * @param {string} params.replicaName The name of the replica for this request. + * @param {string} params.zone The zone where the replica lives. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restart(params?: any, options?: MethodOptions): + AxiosPromise; + restart( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + restart( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta1/projects/{projectName}/zones/{zone}/pools/{poolName}/replicas/{replicaName}/restart') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'poolName', 'replicaName'], + pathParams: ['poolName', 'projectName', 'replicaName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/replicapool/v1beta2.ts b/src/apis/replicapool/v1beta2.ts index de6bf13b55e..dec478b5aa6 100644 --- a/src/apis/replicapool/v1beta2.ts +++ b/src/apis/replicapool/v1beta2.ts @@ -27,1073 +27,1086 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Compute Engine Instance Group Manager API - * - * [Deprecated. Please use Instance Group Manager in Compute API] Provides - * groups of homogenous Compute Engine instances. - * - * @example - * const google = require('googleapis'); - * const replicapool = google.replicapool('v1beta2'); - * - * @namespace replicapool - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Replicapool - */ -export class Replicapool { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace replicapool_v1beta2 { + /** + * Google Compute Engine Instance Group Manager API + * + * [Deprecated. Please use Instance Group Manager in Compute API] Provides + * groups of homogenous Compute Engine instances. + * + * @example + * const google = require('googleapis'); + * const replicapool = google.replicapool('v1beta2'); + * + * @namespace replicapool + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Replicapool + */ + export class Replicapool { + _options: GlobalOptions; + google: GoogleApis; + root = this; - instanceGroupManagers: Resource$Instancegroupmanagers; - zoneOperations: Resource$Zoneoperations; + instanceGroupManagers: Resource$Instancegroupmanagers; + zoneOperations: Resource$Zoneoperations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); - this.zoneOperations = new Resource$Zoneoperations(this); - } + this.instanceGroupManagers = new Resource$Instancegroupmanagers(this); + this.zoneOperations = new Resource$Zoneoperations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * An Instance Group Manager resource. - */ -export interface Schema$InstanceGroupManager { - /** - * The autohealing policy for this managed instance group. You can specify - * only one value. - */ - autoHealingPolicies: Schema$ReplicaPoolAutoHealingPolicy[]; - /** - * The base instance name to use for instances in this group. The value must - * be a valid RFC1035 name. Supported characters are lowercase letters, - * numbers, and hyphens (-). Instances are named by appending a hyphen and a - * random four-character string to the base instance name. - */ - baseInstanceName: string; - /** - * [Output only] The time the instance group manager was created, in RFC3339 - * text format. - */ - creationTimestamp: string; - /** - * [Output only] The number of instances that currently exist and are a part - * of this group. This includes instances that are starting but are not yet - * RUNNING, and instances that are in the process of being deleted or - * abandoned. - */ - currentSize: number; - /** - * An optional textual description of the instance group manager. - */ - description: string; - /** - * [Output only] Fingerprint of the instance group manager. This field is used - * for optimistic locking. An up-to-date fingerprint must be provided in order - * to modify the Instance Group Manager resource. - */ - fingerprint: string; - /** - * [Output only] The full URL of the instance group created by the manager. - * This group contains all of the instances being managed, and cannot contain - * non-managed instances. - */ - group: string; - /** - * [Output only] A server-assigned unique identifier for the resource. - */ - id: string; - /** - * The full URL to an instance template from which all new instances will be - * created. - */ - instanceTemplate: string; - /** - * [Output only] The resource type. Always replicapool#instanceGroupManager. - */ - kind: string; - /** - * The name of the instance group manager. Must be 1-63 characters long and - * comply with RFC1035. Supported characters include lowercase letters, - * numbers, and hyphens. - */ - name: string; - /** - * [Output only] The fully qualified URL for this resource. - */ - selfLink: string; - /** - * The full URL of all target pools to which new instances in the group are - * added. Updating the target pool values does not affect existing instances. - */ - targetPools: string[]; - /** - * [Output only] The number of instances that the manager is attempting to - * maintain. Deleting or abandoning instances affects this number, as does - * resizing the group. - */ - targetSize: number; -} -export interface Schema$InstanceGroupManagerList { - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * A list of instance resources. - */ - items: Schema$InstanceGroupManager[]; - /** - * Type of resource. - */ - kind: string; - /** - * A token used to continue a truncated list request (output only). - */ - nextPageToken: string; - /** - * Server defined URL for this resource (output only). - */ - selfLink: string; -} -export interface Schema$InstanceGroupManagersAbandonInstancesRequest { - /** - * The names of one or more instances to abandon. For example: { - * 'instances': [ 'instance-c3po', 'instance-r2d2' ] } - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersDeleteInstancesRequest { - /** - * Names of instances to delete. Example: 'instance-foo', - * 'instance-bar' - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersRecreateInstancesRequest { - /** - * The names of one or more instances to recreate. For example: { - * 'instances': [ 'instance-c3po', 'instance-r2d2' ] } - */ - instances: string[]; -} -export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { - /** - * The full URL to an Instance Template from which all new instances will be - * created. - */ - instanceTemplate: string; -} -export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { - /** - * The current fingerprint of the Instance Group Manager resource. If this - * does not match the server-side fingerprint of the resource, then the - * request will be rejected. - */ - fingerprint: string; - /** - * A list of fully-qualified URLs to existing Target Pool resources. New - * instances in the Instance Group Manager will be added to the specified - * target pools; existing instances are not affected. - */ - targetPools: string[]; -} -/** - * An operation resource, used to manage asynchronous API requests. - */ -export interface Schema$Operation { - /** - * [Output only] An optional identifier specified by the client when the - * mutation was initiated. Must be unique for all operation resources in the - * project. - */ - clientOperationId: string; - /** - * [Output Only] The time that this operation was requested, in RFC3339 text - * format. - */ - creationTimestamp: string; - /** - * [Output Only] The time that this operation was completed, in RFC3339 text - * format. - */ - endTime: string; - /** - * [Output Only] If errors occurred during processing of this operation, this - * field will be populated. - */ - error: any; - /** - * [Output only] If operation fails, the HTTP error message returned. - */ - httpErrorMessage: string; - /** - * [Output only] If operation fails, the HTTP error status code returned. - */ - httpErrorStatusCode: number; - /** - * [Output Only] Unique identifier for the resource, generated by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested, in RFC3339 text - * format. - */ - insertTime: string; - /** - * [Output only] Type of the resource. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output only] Type of the operation. Operations include insert, update, and - * delete. - */ - operationType: string; - /** - * [Output only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess at when the operation will be - * complete. This number should be monotonically increasing as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] URL of the region where the operation resides. Only available - * when performing regional operations. - */ - region: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server, in - * RFC3339 text format. - */ - startTime: string; - /** - * [Output Only] Status of the operation. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] Unique target ID which identifies a particular incarnation of - * the target. - */ - targetId: string; /** - * [Output only] URL of the resource the operation is mutating. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If there are issues with this operation, a warning is - * returned. - */ - warnings: any[]; - /** - * [Output Only] URL of the zone where the operation resides. Only available - * when performing per-zone operations. - */ - zone: string; -} -export interface Schema$OperationList { - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * The operation resources. - */ - items: Schema$Operation[]; - /** - * Type of resource. - */ - kind: string; - /** - * A token used to continue a truncated list request (output only). - */ - nextPageToken: string; - /** - * Server defined URL for this resource (output only). - */ - selfLink: string; -} -export interface Schema$ReplicaPoolAutoHealingPolicy { - /** - * The action to perform when an instance becomes unhealthy. Possible values - * are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a new - * instance that is based on the instance template for this managed instance - * group. REBOOT performs a soft reboot on an instance. If the instance cannot - * reboot, the instance performs a hard restart. - */ - actionType: string; + * An Instance Group Manager resource. + */ + export interface Schema$InstanceGroupManager { + /** + * The autohealing policy for this managed instance group. You can specify + * only one value. + */ + autoHealingPolicies: Schema$ReplicaPoolAutoHealingPolicy[]; + /** + * The base instance name to use for instances in this group. The value must + * be a valid RFC1035 name. Supported characters are lowercase letters, + * numbers, and hyphens (-). Instances are named by appending a hyphen and a + * random four-character string to the base instance name. + */ + baseInstanceName: string; + /** + * [Output only] The time the instance group manager was created, in RFC3339 + * text format. + */ + creationTimestamp: string; + /** + * [Output only] The number of instances that currently exist and are a part + * of this group. This includes instances that are starting but are not yet + * RUNNING, and instances that are in the process of being deleted or + * abandoned. + */ + currentSize: number; + /** + * An optional textual description of the instance group manager. + */ + description: string; + /** + * [Output only] Fingerprint of the instance group manager. This field is + * used for optimistic locking. An up-to-date fingerprint must be provided + * in order to modify the Instance Group Manager resource. + */ + fingerprint: string; + /** + * [Output only] The full URL of the instance group created by the manager. + * This group contains all of the instances being managed, and cannot + * contain non-managed instances. + */ + group: string; + /** + * [Output only] A server-assigned unique identifier for the resource. + */ + id: string; + /** + * The full URL to an instance template from which all new instances will be + * created. + */ + instanceTemplate: string; + /** + * [Output only] The resource type. Always replicapool#instanceGroupManager. + */ + kind: string; + /** + * The name of the instance group manager. Must be 1-63 characters long and + * comply with RFC1035. Supported characters include lowercase letters, + * numbers, and hyphens. + */ + name: string; + /** + * [Output only] The fully qualified URL for this resource. + */ + selfLink: string; + /** + * The full URL of all target pools to which new instances in the group are + * added. Updating the target pool values does not affect existing + * instances. + */ + targetPools: string[]; + /** + * [Output only] The number of instances that the manager is attempting to + * maintain. Deleting or abandoning instances affects this number, as does + * resizing the group. + */ + targetSize: number; + } + export interface Schema$InstanceGroupManagerList { + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * A list of instance resources. + */ + items: Schema$InstanceGroupManager[]; + /** + * Type of resource. + */ + kind: string; + /** + * A token used to continue a truncated list request (output only). + */ + nextPageToken: string; + /** + * Server defined URL for this resource (output only). + */ + selfLink: string; + } + export interface Schema$InstanceGroupManagersAbandonInstancesRequest { + /** + * The names of one or more instances to abandon. For example: { + * 'instances': [ 'instance-c3po', 'instance-r2d2' ] + * } + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersDeleteInstancesRequest { + /** + * Names of instances to delete. Example: 'instance-foo', + * 'instance-bar' + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersRecreateInstancesRequest { + /** + * The names of one or more instances to recreate. For example: { + * 'instances': [ 'instance-c3po', 'instance-r2d2' ] + * } + */ + instances: string[]; + } + export interface Schema$InstanceGroupManagersSetInstanceTemplateRequest { + /** + * The full URL to an Instance Template from which all new instances will be + * created. + */ + instanceTemplate: string; + } + export interface Schema$InstanceGroupManagersSetTargetPoolsRequest { + /** + * The current fingerprint of the Instance Group Manager resource. If this + * does not match the server-side fingerprint of the resource, then the + * request will be rejected. + */ + fingerprint: string; + /** + * A list of fully-qualified URLs to existing Target Pool resources. New + * instances in the Instance Group Manager will be added to the specified + * target pools; existing instances are not affected. + */ + targetPools: string[]; + } /** - * The URL for the HealthCheck that signals autohealing. - */ - healthCheck: string; -} - -export class Resource$Instancegroupmanagers { - root: Replicapool; - constructor(root: Replicapool) { - this.root = root; - this.getRoot.bind(this); + * An operation resource, used to manage asynchronous API requests. + */ + export interface Schema$Operation { + /** + * [Output only] An optional identifier specified by the client when the + * mutation was initiated. Must be unique for all operation resources in the + * project. + */ + clientOperationId: string; + /** + * [Output Only] The time that this operation was requested, in RFC3339 text + * format. + */ + creationTimestamp: string; + /** + * [Output Only] The time that this operation was completed, in RFC3339 text + * format. + */ + endTime: string; + /** + * [Output Only] If errors occurred during processing of this operation, + * this field will be populated. + */ + error: any; + /** + * [Output only] If operation fails, the HTTP error message returned. + */ + httpErrorMessage: string; + /** + * [Output only] If operation fails, the HTTP error status code returned. + */ + httpErrorStatusCode: number; + /** + * [Output Only] Unique identifier for the resource, generated by the + * server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested, in RFC3339 text + * format. + */ + insertTime: string; + /** + * [Output only] Type of the resource. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output only] Type of the operation. Operations include insert, update, + * and delete. + */ + operationType: string; + /** + * [Output only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess at when the operation will + * be complete. This number should be monotonically increasing as the + * operation progresses. + */ + progress: number; + /** + * [Output Only] URL of the region where the operation resides. Only + * available when performing regional operations. + */ + region: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server, in + * RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] Status of the operation. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] Unique target ID which identifies a particular incarnation + * of the target. + */ + targetId: string; + /** + * [Output only] URL of the resource the operation is mutating. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If there are issues with this operation, a warning is + * returned. + */ + warnings: any[]; + /** + * [Output Only] URL of the zone where the operation resides. Only available + * when performing per-zone operations. + */ + zone: string; } - - getRoot() { - return this.root; + export interface Schema$OperationList { + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * The operation resources. + */ + items: Schema$Operation[]; + /** + * Type of resource. + */ + kind: string; + /** + * A token used to continue a truncated list request (output only). + */ + nextPageToken: string; + /** + * Server defined URL for this resource (output only). + */ + selfLink: string; + } + export interface Schema$ReplicaPoolAutoHealingPolicy { + /** + * The action to perform when an instance becomes unhealthy. Possible values + * are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a + * new instance that is based on the instance template for this managed + * instance group. REBOOT performs a soft reboot on an instance. If the + * instance cannot reboot, the instance performs a hard restart. + */ + actionType: string; + /** + * The URL for the HealthCheck that signals autohealing. + */ + healthCheck: string; } - - /** - * replicapool.instanceGroupManagers.abandonInstances - * @desc Removes the specified instances from the managed instance group, and - * from any target pools of which they were members, without deleting the - * instances. - * @alias replicapool.instanceGroupManagers.abandonInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - abandonInstances(params?: any, options?: MethodOptions): - AxiosPromise; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - abandonInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Instancegroupmanagers { + root: Replicapool; + constructor(root: Replicapool) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapool.instanceGroupManagers.delete - * @desc Deletes the instance group manager and all instances contained - * within. If you'd like to delete the manager without deleting the instances, - * you must first abandon the instances to remove them from the group. - * @alias replicapool.instanceGroupManagers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the Instance Group Manager resource to delete. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.instanceGroupManagers.abandonInstances + * @desc Removes the specified instances from the managed instance group, + * and from any target pools of which they were members, without deleting + * the instances. + * @alias replicapool.instanceGroupManagers.abandonInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManagersAbandonInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + abandonInstances(params?: any, options?: MethodOptions): + AxiosPromise; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + abandonInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.deleteInstances - * @desc Deletes the specified instances. The instances are deleted, then - * removed from the instance group and any target pools of which they were a - * member. The targetSize of the instance group manager is reduced by the - * number of instances deleted. - * @alias replicapool.instanceGroupManagers.deleteInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - deleteInstances(params?: any, options?: MethodOptions): - AxiosPromise; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - deleteInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapool.instanceGroupManagers.delete + * @desc Deletes the instance group manager and all instances contained + * within. If you'd like to delete the manager without deleting the + * instances, you must first abandon the instances to remove them from the + * group. + * @alias replicapool.instanceGroupManagers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the Instance Group Manager resource to delete. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.get - * @desc Returns the specified Instance Group Manager resource. - * @alias replicapool.instanceGroupManagers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager Name of the instance resource to return. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapool.instanceGroupManagers.deleteInstances + * @desc Deletes the specified instances. The instances are deleted, then + * removed from the instance group and any target pools of which they were a + * member. The targetSize of the instance group manager is reduced by the + * number of instances deleted. + * @alias replicapool.instanceGroupManagers.deleteInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManagersDeleteInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + deleteInstances(params?: any, options?: MethodOptions): + AxiosPromise; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + deleteInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.insert - * @desc Creates an instance group manager, as well as the instance group and - * the specified number of instances. - * @alias replicapool.instanceGroupManagers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {integer} params.size Number of instances that should exist. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManager} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.instanceGroupManagers.get + * @desc Returns the specified Instance Group Manager resource. + * @alias replicapool.instanceGroupManagers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager Name of the instance resource to return. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'size'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.list - * @desc Retrieves the list of Instance Group Manager resources contained - * within the specified zone. - * @alias replicapool.instanceGroupManagers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * replicapool.instanceGroupManagers.insert + * @desc Creates an instance group manager, as well as the instance group + * and the specified number of instances. + * @alias replicapool.instanceGroupManagers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {integer} params.size Number of instances that should exist. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManager} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'size'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * replicapool.instanceGroupManagers.recreateInstances - * @desc Recreates the specified instances. The instances are deleted, then - * recreated using the instance group manager's current instance template. - * @alias replicapool.instanceGroupManagers.recreateInstances - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recreateInstances(params?: any, options?: MethodOptions): - AxiosPromise; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recreateInstances( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapool.instanceGroupManagers.list + * @desc Retrieves the list of Instance Group Manager resources contained + * within the specified zone. + * @alias replicapool.instanceGroupManagers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.resize - * @desc Resizes the managed instance group up or down. If resized up, new - * instances are created using the current instance template. If resized down, - * instances are removed in the order outlined in Resizing a managed instance - * group. - * @alias replicapool.instanceGroupManagers.resize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {integer} params.size Number of instances that should exist in this Instance Group Manager. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resize(params?: any, options?: MethodOptions): AxiosPromise; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.instanceGroupManagers.recreateInstances + * @desc Recreates the specified instances. The instances are deleted, then + * recreated using the instance group manager's current instance template. + * @alias replicapool.instanceGroupManagers.recreateInstances + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManagersRecreateInstancesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recreateInstances(params?: any, options?: MethodOptions): + AxiosPromise; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recreateInstances( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapool.instanceGroupManagers.setInstanceTemplate - * @desc Sets the instance template to use when creating new instances in this - * group. Existing instances are not affected. - * @alias replicapool.instanceGroupManagers.setInstanceTemplate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setInstanceTemplate(params?: any, options?: MethodOptions): - AxiosPromise; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setInstanceTemplate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * replicapool.instanceGroupManagers.resize + * @desc Resizes the managed instance group up or down. If resized up, new + * instances are created using the current instance template. If resized + * down, instances are removed in the order outlined in Resizing a managed + * instance group. + * @alias replicapool.instanceGroupManagers.resize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {integer} params.size Number of instances that should exist in this Instance Group Manager. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resize(params?: any, options?: MethodOptions): + AxiosPromise; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/resize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager', 'size'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * replicapool.instanceGroupManagers.setTargetPools - * @desc Modifies the target pools to which all new instances in this group - * are assigned. Existing instances in the group are not affected. - * @alias replicapool.instanceGroupManagers.setTargetPools - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instanceGroupManager The name of the instance group manager. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the instance group manager resides. - * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setTargetPools(params?: any, options?: MethodOptions): - AxiosPromise; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setTargetPools( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapool.instanceGroupManagers.setInstanceTemplate + * @desc Sets the instance template to use when creating new instances in + * this group. Existing instances are not affected. + * @alias replicapool.instanceGroupManagers.setInstanceTemplate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManagersSetInstanceTemplateRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setInstanceTemplate(params?: any, options?: MethodOptions): + AxiosPromise; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setInstanceTemplate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'instanceGroupManager'], - pathParams: ['instanceGroupManager', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Zoneoperations { - root: Replicapool; - constructor(root: Replicapool) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * replicapool.instanceGroupManagers.setTargetPools + * @desc Modifies the target pools to which all new instances in this group + * are assigned. Existing instances in the group are not affected. + * @alias replicapool.instanceGroupManagers.setTargetPools + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instanceGroupManager The name of the instance group manager. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the instance group manager resides. + * @param {().InstanceGroupManagersSetTargetPoolsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setTargetPools(params?: any, options?: MethodOptions): + AxiosPromise; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setTargetPools( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'instanceGroupManager'], + pathParams: ['instanceGroupManager', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * replicapool.zoneOperations.get - * @desc Retrieves the specified zone-specific operation resource. - * @alias replicapool.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the operation resource to return. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Zoneoperations { + root: Replicapool; + constructor(root: Replicapool) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapool.zoneOperations.list - * @desc Retrieves the list of operation resources contained within the - * specified zone. - * @alias replicapool.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapool.zoneOperations.get + * @desc Retrieves the specified zone-specific operation resource. + * @alias replicapool.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the operation resource to return. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapool/v1beta2/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * replicapool.zoneOperations.list + * @desc Retrieves the list of operation resources contained within the + * specified zone. + * @alias replicapool.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapool/v1beta2/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/replicapoolupdater/v1beta1.ts b/src/apis/replicapoolupdater/v1beta1.ts index f9f4dd0db68..6d0c49e066b 100644 --- a/src/apis/replicapoolupdater/v1beta1.ts +++ b/src/apis/replicapoolupdater/v1beta1.ts @@ -27,912 +27,921 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Compute Engine Instance Group Updater API - * - * [Deprecated. Please use compute.instanceGroupManagers.update method. - * replicapoolupdater API will be disabled after December 30th, 2016] Updates - * groups of Compute Engine instances. - * - * @example - * const google = require('googleapis'); - * const replicapoolupdater = google.replicapoolupdater('v1beta1'); - * - * @namespace replicapoolupdater - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Replicapoolupdater - */ -export class Replicapoolupdater { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - rollingUpdates: Resource$Rollingupdates; - zoneOperations: Resource$Zoneoperations; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.rollingUpdates = new Resource$Rollingupdates(this); - this.zoneOperations = new Resource$Zoneoperations(this); - } +export namespace replicapoolupdater_v1beta1 { + /** + * Google Compute Engine Instance Group Updater API + * + * [Deprecated. Please use compute.instanceGroupManagers.update method. + * replicapoolupdater API will be disabled after December 30th, 2016] Updates + * groups of Compute Engine instances. + * + * @example + * const google = require('googleapis'); + * const replicapoolupdater = google.replicapoolupdater('v1beta1'); + * + * @namespace replicapoolupdater + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Replicapoolupdater + */ + export class Replicapoolupdater { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + rollingUpdates: Resource$Rollingupdates; + zoneOperations: Resource$Zoneoperations; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.rollingUpdates = new Resource$Rollingupdates(this); + this.zoneOperations = new Resource$Zoneoperations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Update of a single instance. - */ -export interface Schema$InstanceUpdate { - /** - * Errors that occurred during the instance update. - */ - error: any; - /** - * Fully-qualified URL of the instance being updated. - */ - instance: string; /** - * Status of the instance update. Possible values are: - - * "PENDING": The instance update is pending execution. - - * "ROLLING_FORWARD": The instance update is going forward. - - * "ROLLING_BACK": The instance update is being rolled back. - - * "PAUSED": The instance update is temporarily paused (inactive). - * - "ROLLED_OUT": The instance update is finished, the instance is - * running the new template. - "ROLLED_BACK": The instance update - * is finished, the instance has been reverted to the previous template. - - * "CANCELLED": The instance update is paused and no longer can be - * resumed, undefined in which template the instance is running. - */ - status: string; -} -/** - * Response returned by ListInstanceUpdates method. - */ -export interface Schema$InstanceUpdateList { - /** - * Collection of requested instance updates. - */ - items: Schema$InstanceUpdate[]; - /** - * [Output Only] Type of the resource. - */ - kind: string; - /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; - /** - * [Output Only] The fully qualified URL for the resource. - */ - selfLink: string; -} -/** - * An operation resource, used to manage asynchronous API requests. - */ -export interface Schema$Operation { - clientOperationId: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - endTime: string; - /** - * [Output Only] If errors occurred during processing of this operation, this - * field will be populated. - */ - error: any; - httpErrorMessage: string; - httpErrorStatusCode: number; - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested. This is in RFC - * 3339 format. - */ - insertTime: string; - /** - * [Output Only] Type of the resource. Always replicapoolupdater#operation for - * Operation resources. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - operationType: string; - progress: number; - /** - * [Output Only] URL of the region where the operation resides. - */ - region: string; - /** - * [Output Only] The fully qualified URL for the resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server. This - * is in RFC 3339 format. - */ - startTime: string; - /** - * [Output Only] Status of the operation. Can be one of the following: - * "PENDING", "RUNNING", or "DONE". - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] Unique target id which identifies a particular incarnation of - * the target. - */ - targetId: string; - /** - * [Output Only] URL of the resource the operation is mutating. - */ - targetLink: string; - user: string; - warnings: any[]; - /** - * [Output Only] URL of the zone where the operation resides. - */ - zone: string; -} -/** - * Contains a list of Operation resources. - */ -export interface Schema$OperationList { - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * [Output Only] The Operation resources. - */ - items: Schema$Operation[]; - /** - * [Output Only] Type of resource. Always replicapoolupdater#operationList for - * OperationList resources. - */ - kind: string; - /** - * [Output Only] A token used to continue a truncate. - */ - nextPageToken: string; - /** - * [Output Only] The fully qualified URL for the resource. - */ - selfLink: string; -} -/** - * The following represents a resource describing a single update (rollout) of a - * group of instances to the given template. - */ -export interface Schema$RollingUpdate { - /** - * Specifies the action to take for each instance within the instance group. - * This can be RECREATE which will recreate each instance and is only - * available for managed instance groups. It can also be REBOOT which performs - * a soft reboot for each instance and is only available for regular - * (non-managed) instance groups. - */ - actionType: string; - /** - * [Output Only] Creation timestamp in RFC3339 text format. - */ - creationTimestamp: string; - /** - * An optional textual description of the resource; provided by the client - * when the resource is created. - */ - description: string; - /** - * [Output Only] Errors that occurred during the rolling update. - */ - error: any; - /** - * [Output Only] Unique identifier for the resource; defined by the server. - */ - id: string; - /** - * Fully-qualified URL of an instance group being updated. Exactly one of - * instanceGroupManager and instanceGroup must be set. - */ - instanceGroup: string; - /** - * Fully-qualified URL of an instance group manager being updated. Exactly one - * of instanceGroupManager and instanceGroup must be set. - */ - instanceGroupManager: string; - /** - * Fully-qualified URL of an instance template to apply. - */ - instanceTemplate: string; - /** - * [Output Only] Type of the resource. - */ - kind: string; - /** - * Fully-qualified URL of the instance template encountered while starting the - * update. - */ - oldInstanceTemplate: string; - /** - * Parameters of the update process. - */ - policy: any; - /** - * [Output Only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess at when the update will be - * complete. This number should be monotonically increasing as the update - * progresses. - */ - progress: number; - /** - * [Output Only] The fully qualified URL for the resource. - */ - selfLink: string; - /** - * [Output Only] Status of the update. Possible values are: - - * "ROLLING_FORWARD": The update is going forward. - - * "ROLLING_BACK": The update is being rolled back. - - * "PAUSED": The update is temporarily paused (inactive). - - * "ROLLED_OUT": The update is finished, all instances have been - * updated successfully. - "ROLLED_BACK": The update is finished, - * all instances have been reverted to the previous template. - - * "CANCELLED": The update is paused and no longer can be resumed, - * undefined how many instances are running in which template. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * update. - */ - statusMessage: string; - /** - * [Output Only] User who requested the update, for example: user@example.com. - */ - user: string; -} -/** - * Response returned by List method. - */ -export interface Schema$RollingUpdateList { + * Update of a single instance. + */ + export interface Schema$InstanceUpdate { + /** + * Errors that occurred during the instance update. + */ + error: any; + /** + * Fully-qualified URL of the instance being updated. + */ + instance: string; + /** + * Status of the instance update. Possible values are: - + * "PENDING": The instance update is pending execution. - + * "ROLLING_FORWARD": The instance update is going forward. - + * "ROLLING_BACK": The instance update is being rolled back. - + * "PAUSED": The instance update is temporarily paused (inactive). + * - "ROLLED_OUT": The instance update is finished, the instance + * is running the new template. - "ROLLED_BACK": The instance + * update is finished, the instance has been reverted to the previous + * template. - "CANCELLED": The instance update is paused and no + * longer can be resumed, undefined in which template the instance is + * running. + */ + status: string; + } /** - * Collection of requested updates. - */ - items: Schema$RollingUpdate[]; + * Response returned by ListInstanceUpdates method. + */ + export interface Schema$InstanceUpdateList { + /** + * Collection of requested instance updates. + */ + items: Schema$InstanceUpdate[]; + /** + * [Output Only] Type of the resource. + */ + kind: string; + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * [Output Only] The fully qualified URL for the resource. + */ + selfLink: string; + } /** - * [Output Only] Type of the resource. - */ - kind: string; + * An operation resource, used to manage asynchronous API requests. + */ + export interface Schema$Operation { + clientOperationId: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + endTime: string; + /** + * [Output Only] If errors occurred during processing of this operation, + * this field will be populated. + */ + error: any; + httpErrorMessage: string; + httpErrorStatusCode: number; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested. This is in RFC + * 3339 format. + */ + insertTime: string; + /** + * [Output Only] Type of the resource. Always replicapoolupdater#operation + * for Operation resources. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + operationType: string; + progress: number; + /** + * [Output Only] URL of the region where the operation resides. + */ + region: string; + /** + * [Output Only] The fully qualified URL for the resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server. + * This is in RFC 3339 format. + */ + startTime: string; + /** + * [Output Only] Status of the operation. Can be one of the following: + * "PENDING", "RUNNING", or "DONE". + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] Unique target id which identifies a particular incarnation + * of the target. + */ + targetId: string; + /** + * [Output Only] URL of the resource the operation is mutating. + */ + targetLink: string; + user: string; + warnings: any[]; + /** + * [Output Only] URL of the zone where the operation resides. + */ + zone: string; + } /** - * A token used to continue a truncated list request. - */ - nextPageToken: string; + * Contains a list of Operation resources. + */ + export interface Schema$OperationList { + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * [Output Only] The Operation resources. + */ + items: Schema$Operation[]; + /** + * [Output Only] Type of resource. Always replicapoolupdater#operationList + * for OperationList resources. + */ + kind: string; + /** + * [Output Only] A token used to continue a truncate. + */ + nextPageToken: string; + /** + * [Output Only] The fully qualified URL for the resource. + */ + selfLink: string; + } /** - * [Output Only] The fully qualified URL for the resource. - */ - selfLink: string; -} - -export class Resource$Rollingupdates { - root: Replicapoolupdater; - constructor(root: Replicapoolupdater) { - this.root = root; - this.getRoot.bind(this); + * The following represents a resource describing a single update (rollout) of + * a group of instances to the given template. + */ + export interface Schema$RollingUpdate { + /** + * Specifies the action to take for each instance within the instance group. + * This can be RECREATE which will recreate each instance and is only + * available for managed instance groups. It can also be REBOOT which + * performs a soft reboot for each instance and is only available for + * regular (non-managed) instance groups. + */ + actionType: string; + /** + * [Output Only] Creation timestamp in RFC3339 text format. + */ + creationTimestamp: string; + /** + * An optional textual description of the resource; provided by the client + * when the resource is created. + */ + description: string; + /** + * [Output Only] Errors that occurred during the rolling update. + */ + error: any; + /** + * [Output Only] Unique identifier for the resource; defined by the server. + */ + id: string; + /** + * Fully-qualified URL of an instance group being updated. Exactly one of + * instanceGroupManager and instanceGroup must be set. + */ + instanceGroup: string; + /** + * Fully-qualified URL of an instance group manager being updated. Exactly + * one of instanceGroupManager and instanceGroup must be set. + */ + instanceGroupManager: string; + /** + * Fully-qualified URL of an instance template to apply. + */ + instanceTemplate: string; + /** + * [Output Only] Type of the resource. + */ + kind: string; + /** + * Fully-qualified URL of the instance template encountered while starting + * the update. + */ + oldInstanceTemplate: string; + /** + * Parameters of the update process. + */ + policy: any; + /** + * [Output Only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess at when the update will be + * complete. This number should be monotonically increasing as the update + * progresses. + */ + progress: number; + /** + * [Output Only] The fully qualified URL for the resource. + */ + selfLink: string; + /** + * [Output Only] Status of the update. Possible values are: - + * "ROLLING_FORWARD": The update is going forward. - + * "ROLLING_BACK": The update is being rolled back. - + * "PAUSED": The update is temporarily paused (inactive). - + * "ROLLED_OUT": The update is finished, all instances have been + * updated successfully. - "ROLLED_BACK": The update is finished, + * all instances have been reverted to the previous template. - + * "CANCELLED": The update is paused and no longer can be resumed, + * undefined how many instances are running in which template. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the update. + */ + statusMessage: string; + /** + * [Output Only] User who requested the update, for example: + * user@example.com. + */ + user: string; } - - getRoot() { - return this.root; + /** + * Response returned by List method. + */ + export interface Schema$RollingUpdateList { + /** + * Collection of requested updates. + */ + items: Schema$RollingUpdate[]; + /** + * [Output Only] Type of the resource. + */ + kind: string; + /** + * A token used to continue a truncated list request. + */ + nextPageToken: string; + /** + * [Output Only] The fully qualified URL for the resource. + */ + selfLink: string; } - - /** - * replicapoolupdater.rollingUpdates.cancel - * @desc Cancels an update. The update must be PAUSED before it can be - * cancelled. This has no effect if the update is already CANCELLED. - * @alias replicapoolupdater.rollingUpdates.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Rollingupdates { + root: Replicapoolupdater; + constructor(root: Replicapoolupdater) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapoolupdater.rollingUpdates.get - * @desc Returns information about an update. - * @alias replicapoolupdater.rollingUpdates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.cancel + * @desc Cancels an update. The update must be PAUSED before it can be + * cancelled. This has no effect if the update is already CANCELLED. + * @alias replicapoolupdater.rollingUpdates.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.insert - * @desc Inserts and starts a new update. - * @alias replicapoolupdater.rollingUpdates.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {().RollingUpdate} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.get + * @desc Returns information about an update. + * @alias replicapoolupdater.rollingUpdates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.list - * @desc Lists recent updates for a given managed instance group, in reverse - * chronological order and paginated format. - * @alias replicapoolupdater.rollingUpdates.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.insert + * @desc Inserts and starts a new update. + * @alias replicapoolupdater.rollingUpdates.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {().RollingUpdate} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.listInstanceUpdates - * @desc Lists the current status for each instance within a given update. - * @alias replicapoolupdater.rollingUpdates.listInstanceUpdates - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listInstanceUpdates(params?: any, options?: MethodOptions): - AxiosPromise; - listInstanceUpdates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - listInstanceUpdates( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.list + * @desc Lists recent updates for a given managed instance group, in reverse + * chronological order and paginated format. + * @alias replicapoolupdater.rollingUpdates.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.pause - * @desc Pauses the update in state from ROLLING_FORWARD or ROLLING_BACK. Has - * no effect if invoked when the state of the update is PAUSED. - * @alias replicapoolupdater.rollingUpdates.pause - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pause(params?: any, options?: MethodOptions): AxiosPromise; - pause( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pause( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.listInstanceUpdates + * @desc Lists the current status for each instance within a given update. + * @alias replicapoolupdater.rollingUpdates.listInstanceUpdates + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listInstanceUpdates(params?: any, options?: MethodOptions): + AxiosPromise; + listInstanceUpdates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + listInstanceUpdates( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/pause') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.resume - * @desc Continues an update in PAUSED state. Has no effect if invoked when - * the state of the update is ROLLED_OUT. - * @alias replicapoolupdater.rollingUpdates.resume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resume(params?: any, options?: MethodOptions): AxiosPromise; - resume( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resume( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.pause + * @desc Pauses the update in state from ROLLING_FORWARD or ROLLING_BACK. + * Has no effect if invoked when the state of the update is PAUSED. + * @alias replicapoolupdater.rollingUpdates.pause + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pause(params?: any, options?: MethodOptions): + AxiosPromise; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/pause') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/resume') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * replicapoolupdater.rollingUpdates.rollback - * @desc Rolls back the update in state from ROLLING_FORWARD or PAUSED. Has no - * effect if invoked when the state of the update is ROLLED_BACK. - * @alias replicapoolupdater.rollingUpdates.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The Google Developers Console project name. - * @param {string} params.rollingUpdate The name of the update. - * @param {string} params.zone The name of the zone in which the update's target resides. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): - AxiosPromise; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * replicapoolupdater.rollingUpdates.resume + * @desc Continues an update in PAUSED state. Has no effect if invoked when + * the state of the update is ROLLED_OUT. + * @alias replicapoolupdater.rollingUpdates.resume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resume(params?: any, options?: MethodOptions): + AxiosPromise; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/resume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'rollingUpdate'], - pathParams: ['project', 'rollingUpdate', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Zoneoperations { - root: Replicapoolupdater; - constructor(root: Replicapoolupdater) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * replicapoolupdater.rollingUpdates.rollback + * @desc Rolls back the update in state from ROLLING_FORWARD or PAUSED. Has + * no effect if invoked when the state of the update is ROLLED_BACK. + * @alias replicapoolupdater.rollingUpdates.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The Google Developers Console project name. + * @param {string} params.rollingUpdate The name of the update. + * @param {string} params.zone The name of the zone in which the update's target resides. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): + AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'rollingUpdate'], + pathParams: ['project', 'rollingUpdate', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * replicapoolupdater.zoneOperations.get - * @desc Retrieves the specified zone-specific operation resource. - * @alias replicapoolupdater.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the operation resource to return. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Zoneoperations { + root: Replicapoolupdater; + constructor(root: Replicapoolupdater) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * replicapoolupdater.zoneOperations.list - * @desc Retrieves the list of Operation resources contained within the - * specified zone. - * @alias replicapoolupdater.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * replicapoolupdater.zoneOperations.get + * @desc Retrieves the specified zone-specific operation resource. + * @alias replicapoolupdater.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the operation resource to return. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * replicapoolupdater.zoneOperations.list + * @desc Retrieves the list of Operation resources contained within the + * specified zone. + * @alias replicapoolupdater.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/reseller/v1.ts b/src/apis/reseller/v1.ts index 07e9e6f3155..e79effe37c3 100644 --- a/src/apis/reseller/v1.ts +++ b/src/apis/reseller/v1.ts @@ -27,1402 +27,1415 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Enterprise Apps Reseller API - * - * Creates and manages your customers and their subscriptions. - * - * @example - * const google = require('googleapis'); - * const reseller = google.reseller('v1'); - * - * @namespace reseller - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Reseller - */ -export class Reseller { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace reseller_v1 { + /** + * Enterprise Apps Reseller API + * + * Creates and manages your customers and their subscriptions. + * + * @example + * const google = require('googleapis'); + * const reseller = google.reseller('v1'); + * + * @namespace reseller + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Reseller + */ + export class Reseller { + _options: GlobalOptions; + google: GoogleApis; + root = this; - customers: Resource$Customers; - resellernotify: Resource$Resellernotify; - subscriptions: Resource$Subscriptions; + customers: Resource$Customers; + resellernotify: Resource$Resellernotify; + subscriptions: Resource$Subscriptions; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.customers = new Resource$Customers(this); - this.resellernotify = new Resource$Resellernotify(this); - this.subscriptions = new Resource$Subscriptions(this); - } + this.customers = new Resource$Customers(this); + this.resellernotify = new Resource$Resellernotify(this); + this.subscriptions = new Resource$Subscriptions(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * JSON template for address of a customer. - */ -export interface Schema$Address { - /** - * A customer's physical address. An address can be composed of one to - * three lines. The addressline2 and addressLine3 are optional. - */ - addressLine1: string; - /** - * Line 2 of the address. - */ - addressLine2: string; - /** - * Line 3 of the address. - */ - addressLine3: string; - /** - * The customer contact's name. This is required. - */ - contactName: string; - /** - * For countryCode information, see the ISO 3166 country code elements. Verify - * that country is approved for resale of Google products. This property is - * required when creating a new customer. - */ - countryCode: string; - /** - * Identifies the resource as a customer address. Value: customers#address - */ - kind: string; - /** - * An example of a locality value is the city of San Francisco. - */ - locality: string; - /** - * The company or company division name. This is required. - */ - organizationName: string; - /** - * A postalCode example is a postal zip code such as 94043. This property is - * required when creating a new customer. - */ - postalCode: string; - /** - * An example of a region value is CA for the state of California. - */ - region: string; -} -/** - * JSON template for the ChangePlan rpc request. - */ -export interface Schema$ChangePlanRequest { - /** - * Google-issued code (100 char max) for discounted pricing on subscription - * plans. Deal code must be included in changePlan request in order to receive - * discounted rate. This property is optional. If a deal code has already been - * added to a subscription, this property may be left empty and the existing - * discounted rate will still apply (if not empty, only provide the deal code - * that is already present on the subscription). If a deal code has never been - * added to a subscription and this property is left blank, regular pricing - * will apply. - */ - dealCode: string; - /** - * Identifies the resource as a subscription change plan request. Value: - * subscriptions#changePlanRequest - */ - kind: string; - /** - * The planName property is required. This is the name of the - * subscription's payment plan. For more information about the Google - * payment plans, see API concepts. Possible values are: - - * ANNUAL_MONTHLY_PAY - The annual commitment plan with monthly payments - - * ANNUAL_YEARLY_PAY - The annual commitment plan with yearly payments - - * FLEXIBLE - The flexible plan - TRIAL - The 30-day free trial plan - */ - planName: string; - /** - * This is an optional property. This purchase order (PO) information is for - * resellers to use for their company tracking usage. If a purchaseOrderId - * value is given it appears in the API responses and shows up in the invoice. - * The property accepts up to 80 plain text characters. - */ - purchaseOrderId: string; - /** - * This is a required property. The seats property is the number of user seat - * licenses. - */ - seats: Schema$Seats; -} -/** - * JSON template for a customer. - */ -export interface Schema$Customer { - /** - * Like the "Customer email" in the reseller tools, this email is - * the secondary contact used if something happens to the customer's - * service such as service outage or a security issue. This property is - * required when creating a new customer and should not use the same domain as - * customerDomain. - */ - alternateEmail: string; - /** - * The customer's primary domain name string. customerDomain is required - * when creating a new customer. Do not include the www prefix in the domain - * when adding a customer. - */ - customerDomain: string; - /** - * Whether the customer's primary domain has been verified. - */ - customerDomainVerified: boolean; - /** - * This property will always be returned in a response as the unique - * identifier generated by Google. In a request, this property can be either - * the primary domain or the unique identifier generated by Google. - */ - customerId: string; - /** - * Identifies the resource as a customer. Value: reseller#customer - */ - kind: string; - /** - * Customer contact phone number. This can be continuous numbers, with spaces, - * etc. But it must be a real phone number and not, for example, - * "123". See phone local format conventions. - */ - phoneNumber: string; - /** - * A customer's address information. Each field has a limit of 255 - * charcters. - */ - postalAddress: Schema$Address; /** - * URL to customer's Admin console dashboard. The read-only URL is - * generated by the API service. This is used if your client application - * requires the customer to complete a task in the Admin console. - */ - resourceUiUrl: string; -} -/** - * JSON template for a subscription renewal settings. - */ -export interface Schema$RenewalSettings { - /** - * Identifies the resource as a subscription renewal setting. Value: - * subscriptions#renewalSettings - */ - kind: string; - /** - * Renewal settings for the annual commitment plan. For more detailed - * information, see renewal options in the administrator help center. When - * renewing a subscription, the renewalType is a required property. - */ - renewalType: string; -} -/** - * JSON template for resellernotify getwatchdetails response. - */ -export interface Schema$ResellernotifyGetwatchdetailsResponse { - /** - * List of registered service accounts. - */ - serviceAccountEmailAddresses: string[]; - /** - * Topic name of the PubSub - */ - topicName: string; -} -/** - * JSON template for resellernotify response. - */ -export interface Schema$ResellernotifyResource { - /** - * Topic name of the PubSub - */ - topicName: string; -} -/** - * JSON template for subscription seats. - */ -export interface Schema$Seats { - /** - * Identifies the resource as a subscription change plan request. Value: - * subscriptions#seats - */ - kind: string; - /** - * Read-only field containing the current number of licensed seats for - * FLEXIBLE Google-Apps subscriptions and secondary subscriptions such as - * Google-Vault and Drive-storage. - */ - licensedNumberOfSeats: number; - /** - * The maximumNumberOfSeats property is the maximum number of licenses that - * the customer can purchase. This property applies to plans other than the - * annual commitment plan. How a user's licenses are managed depends on - * the subscription's payment plan: - annual commitment plan (with - * monthly or yearly payments) — For this plan, a reseller is invoiced on the - * number of user licenses in the numberOfSeats property. The - * maximumNumberOfSeats property is a read-only property in the API's - * response. - flexible plan — For this plan, a reseller is invoiced on the - * actual number of users which is capped by the maximumNumberOfSeats. This is - * the maximum number of user licenses a customer has for user license - * provisioning. This quantity can be increased up to the maximum limit - * defined in the reseller's contract. And the minimum quantity is the - * current number of users in the customer account. - 30-day free trial plan - * — A subscription in a 30-day free trial is restricted to maximum 10 seats. - */ - maximumNumberOfSeats: number; - /** - * The numberOfSeats property holds the customer's number of user - * licenses. How a user's licenses are managed depends on the - * subscription's plan: - annual commitment plan (with monthly or yearly - * pay) — For this plan, a reseller is invoiced on the number of user licenses - * in the numberOfSeats property. This is the maximum number of user licenses - * that a reseller's customer can create. The reseller can add more - * licenses, but once set, the numberOfSeats can not be reduced until renewal. - * The reseller is invoiced based on the numberOfSeats value regardless of how - * many of these user licenses are provisioned users. - flexible plan — For - * this plan, a reseller is invoiced on the actual number of users which is - * capped by the maximumNumberOfSeats. The numberOfSeats property is not used - * in the request or response for flexible plan customers. - 30-day free - * trial plan — The numberOfSeats property is not used in the request or - * response for an account in a 30-day trial. - */ - numberOfSeats: number; -} -/** - * JSON template for a subscription. - */ -export interface Schema$Subscription { - /** - * Read-only field that returns the current billing method for a subscription. - */ - billingMethod: string; - /** - * The creationTime property is the date when subscription was created. It is - * in milliseconds using the Epoch format. See an example Epoch converter. - */ - creationTime: string; - /** - * Primary domain name of the customer - */ - customerDomain: string; - /** - * This property will always be returned in a response as the unique - * identifier generated by Google. In a request, this property can be either - * the primary domain or the unique identifier generated by Google. - */ - customerId: string; - /** - * Google-issued code (100 char max) for discounted pricing on subscription - * plans. Deal code must be included in insert requests in order to receive - * discounted rate. This property is optional, regular pricing applies if left - * empty. - */ - dealCode: string; - /** - * Identifies the resource as a Subscription. Value: reseller#subscription - */ - kind: string; - /** - * The plan property is required. In this version of the API, the G Suite - * plans are the flexible plan, annual commitment plan, and the 30-day free - * trial plan. For more information about the API"s payment plans, see - * the API concepts. - */ - plan: any; - /** - * This is an optional property. This purchase order (PO) information is for - * resellers to use for their company tracking usage. If a purchaseOrderId - * value is given it appears in the API responses and shows up in the invoice. - * The property accepts up to 80 plain text characters. - */ - purchaseOrderId: string; - /** - * Renewal settings for the annual commitment plan. For more detailed - * information, see renewal options in the administrator help center. - */ - renewalSettings: Schema$RenewalSettings; - /** - * URL to customer's Subscriptions page in the Admin console. The - * read-only URL is generated by the API service. This is used if your client - * application requires the customer to complete a task using the - * Subscriptions page in the Admin console. - */ - resourceUiUrl: string; - /** - * This is a required property. The number and limit of user seat licenses in - * the plan. - */ - seats: Schema$Seats; - /** - * A required property. The skuId is a unique system identifier for a - * product's SKU assigned to a customer in the subscription. For products - * and SKUs available in this version of the API, see Product and SKU IDs. - */ - skuId: string; - /** - * Read-only external display name for a product's SKU assigned to a - * customer in the subscription. SKU names are subject to change at - * Google's discretion. For products and SKUs available in this version of - * the API, see Product and SKU IDs. - */ - skuName: string; - /** - * This is an optional property. - */ - status: string; + * JSON template for address of a customer. + */ + export interface Schema$Address { + /** + * A customer's physical address. An address can be composed of one to + * three lines. The addressline2 and addressLine3 are optional. + */ + addressLine1: string; + /** + * Line 2 of the address. + */ + addressLine2: string; + /** + * Line 3 of the address. + */ + addressLine3: string; + /** + * The customer contact's name. This is required. + */ + contactName: string; + /** + * For countryCode information, see the ISO 3166 country code elements. + * Verify that country is approved for resale of Google products. This + * property is required when creating a new customer. + */ + countryCode: string; + /** + * Identifies the resource as a customer address. Value: customers#address + */ + kind: string; + /** + * An example of a locality value is the city of San Francisco. + */ + locality: string; + /** + * The company or company division name. This is required. + */ + organizationName: string; + /** + * A postalCode example is a postal zip code such as 94043. This property is + * required when creating a new customer. + */ + postalCode: string; + /** + * An example of a region value is CA for the state of California. + */ + region: string; + } /** - * The subscriptionId is the subscription identifier and is unique for each - * customer. This is a required property. Since a subscriptionId changes when - * a subscription is updated, we recommend not using this ID as a key for - * persistent data. Use the subscriptionId as described in retrieve all - * reseller subscriptions. - */ - subscriptionId: string; + * JSON template for the ChangePlan rpc request. + */ + export interface Schema$ChangePlanRequest { + /** + * Google-issued code (100 char max) for discounted pricing on subscription + * plans. Deal code must be included in changePlan request in order to + * receive discounted rate. This property is optional. If a deal code has + * already been added to a subscription, this property may be left empty and + * the existing discounted rate will still apply (if not empty, only provide + * the deal code that is already present on the subscription). If a deal + * code has never been added to a subscription and this property is left + * blank, regular pricing will apply. + */ + dealCode: string; + /** + * Identifies the resource as a subscription change plan request. Value: + * subscriptions#changePlanRequest + */ + kind: string; + /** + * The planName property is required. This is the name of the + * subscription's payment plan. For more information about the Google + * payment plans, see API concepts. Possible values are: - + * ANNUAL_MONTHLY_PAY - The annual commitment plan with monthly payments - + * ANNUAL_YEARLY_PAY - The annual commitment plan with yearly payments - + * FLEXIBLE - The flexible plan - TRIAL - The 30-day free trial plan + */ + planName: string; + /** + * This is an optional property. This purchase order (PO) information is for + * resellers to use for their company tracking usage. If a purchaseOrderId + * value is given it appears in the API responses and shows up in the + * invoice. The property accepts up to 80 plain text characters. + */ + purchaseOrderId: string; + /** + * This is a required property. The seats property is the number of user + * seat licenses. + */ + seats: Schema$Seats; + } /** - * Read-only field containing an enumerable of all the current suspension - * reasons for a subscription. It is possible for a subscription to have many - * concurrent, overlapping suspension reasons. A subscription's STATUS is - * SUSPENDED until all pending suspensions are removed. Possible options - * include: - PENDING_TOS_ACCEPTANCE - The customer has not logged in and - * accepted the G Suite Resold Terms of Services. - RENEWAL_WITH_TYPE_CANCEL - * - The customer's commitment ended and their service was cancelled at - * the end of their term. - RESELLER_INITIATED - A manual suspension invoked - * by a Reseller. - TRIAL_ENDED - The customer's trial expired without a - * plan selected. - OTHER - The customer is suspended for an internal Google - * reason (e.g. abuse or otherwise). - */ - suspensionReasons: string[]; + * JSON template for a customer. + */ + export interface Schema$Customer { + /** + * Like the "Customer email" in the reseller tools, this email is + * the secondary contact used if something happens to the customer's + * service such as service outage or a security issue. This property is + * required when creating a new customer and should not use the same domain + * as customerDomain. + */ + alternateEmail: string; + /** + * The customer's primary domain name string. customerDomain is required + * when creating a new customer. Do not include the www prefix in the domain + * when adding a customer. + */ + customerDomain: string; + /** + * Whether the customer's primary domain has been verified. + */ + customerDomainVerified: boolean; + /** + * This property will always be returned in a response as the unique + * identifier generated by Google. In a request, this property can be either + * the primary domain or the unique identifier generated by Google. + */ + customerId: string; + /** + * Identifies the resource as a customer. Value: reseller#customer + */ + kind: string; + /** + * Customer contact phone number. This can be continuous numbers, with + * spaces, etc. But it must be a real phone number and not, for example, + * "123". See phone local format conventions. + */ + phoneNumber: string; + /** + * A customer's address information. Each field has a limit of 255 + * charcters. + */ + postalAddress: Schema$Address; + /** + * URL to customer's Admin console dashboard. The read-only URL is + * generated by the API service. This is used if your client application + * requires the customer to complete a task in the Admin console. + */ + resourceUiUrl: string; + } /** - * Read-only transfer related information for the subscription. For more - * information, see retrieve transferable subscriptions for a customer. - */ - transferInfo: any; + * JSON template for a subscription renewal settings. + */ + export interface Schema$RenewalSettings { + /** + * Identifies the resource as a subscription renewal setting. Value: + * subscriptions#renewalSettings + */ + kind: string; + /** + * Renewal settings for the annual commitment plan. For more detailed + * information, see renewal options in the administrator help center. When + * renewing a subscription, the renewalType is a required property. + */ + renewalType: string; + } /** - * The G Suite annual commitment and flexible payment plans can be in a 30-day - * free trial. For more information, see the API concepts. - */ - trialSettings: any; -} -/** - * JSON template for a subscription list. - */ -export interface Schema$Subscriptions { + * JSON template for resellernotify getwatchdetails response. + */ + export interface Schema$ResellernotifyGetwatchdetailsResponse { + /** + * List of registered service accounts. + */ + serviceAccountEmailAddresses: string[]; + /** + * Topic name of the PubSub + */ + topicName: string; + } /** - * Identifies the resource as a collection of subscriptions. Value: - * reseller#subscriptions + * JSON template for resellernotify response. */ - kind: string; + export interface Schema$ResellernotifyResource { + /** + * Topic name of the PubSub + */ + topicName: string; + } /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; + * JSON template for subscription seats. + */ + export interface Schema$Seats { + /** + * Identifies the resource as a subscription change plan request. Value: + * subscriptions#seats + */ + kind: string; + /** + * Read-only field containing the current number of licensed seats for + * FLEXIBLE Google-Apps subscriptions and secondary subscriptions such as + * Google-Vault and Drive-storage. + */ + licensedNumberOfSeats: number; + /** + * The maximumNumberOfSeats property is the maximum number of licenses that + * the customer can purchase. This property applies to plans other than the + * annual commitment plan. How a user's licenses are managed depends on + * the subscription's payment plan: - annual commitment plan (with + * monthly or yearly payments) — For this plan, a reseller is invoiced on + * the number of user licenses in the numberOfSeats property. The + * maximumNumberOfSeats property is a read-only property in the API's + * response. - flexible plan — For this plan, a reseller is invoiced on + * the actual number of users which is capped by the maximumNumberOfSeats. + * This is the maximum number of user licenses a customer has for user + * license provisioning. This quantity can be increased up to the maximum + * limit defined in the reseller's contract. And the minimum quantity is + * the current number of users in the customer account. - 30-day free + * trial plan — A subscription in a 30-day free trial is restricted to + * maximum 10 seats. + */ + maximumNumberOfSeats: number; + /** + * The numberOfSeats property holds the customer's number of user + * licenses. How a user's licenses are managed depends on the + * subscription's plan: - annual commitment plan (with monthly or + * yearly pay) — For this plan, a reseller is invoiced on the number of user + * licenses in the numberOfSeats property. This is the maximum number of + * user licenses that a reseller's customer can create. The reseller can + * add more licenses, but once set, the numberOfSeats can not be reduced + * until renewal. The reseller is invoiced based on the numberOfSeats value + * regardless of how many of these user licenses are provisioned users. - + * flexible plan — For this plan, a reseller is invoiced on the actual + * number of users which is capped by the maximumNumberOfSeats. The + * numberOfSeats property is not used in the request or response for + * flexible plan customers. - 30-day free trial plan — The numberOfSeats + * property is not used in the request or response for an account in a + * 30-day trial. + */ + numberOfSeats: number; + } /** - * The subscriptions in this page of results. - */ - subscriptions: Schema$Subscription[]; -} - -export class Resource$Customers { - root: Reseller; - constructor(root: Reseller) { - this.root = root; - this.getRoot.bind(this); + * JSON template for a subscription. + */ + export interface Schema$Subscription { + /** + * Read-only field that returns the current billing method for a + * subscription. + */ + billingMethod: string; + /** + * The creationTime property is the date when subscription was created. It + * is in milliseconds using the Epoch format. See an example Epoch + * converter. + */ + creationTime: string; + /** + * Primary domain name of the customer + */ + customerDomain: string; + /** + * This property will always be returned in a response as the unique + * identifier generated by Google. In a request, this property can be either + * the primary domain or the unique identifier generated by Google. + */ + customerId: string; + /** + * Google-issued code (100 char max) for discounted pricing on subscription + * plans. Deal code must be included in insert requests in order to receive + * discounted rate. This property is optional, regular pricing applies if + * left empty. + */ + dealCode: string; + /** + * Identifies the resource as a Subscription. Value: reseller#subscription + */ + kind: string; + /** + * The plan property is required. In this version of the API, the G Suite + * plans are the flexible plan, annual commitment plan, and the 30-day free + * trial plan. For more information about the API"s payment plans, see + * the API concepts. + */ + plan: any; + /** + * This is an optional property. This purchase order (PO) information is for + * resellers to use for their company tracking usage. If a purchaseOrderId + * value is given it appears in the API responses and shows up in the + * invoice. The property accepts up to 80 plain text characters. + */ + purchaseOrderId: string; + /** + * Renewal settings for the annual commitment plan. For more detailed + * information, see renewal options in the administrator help center. + */ + renewalSettings: Schema$RenewalSettings; + /** + * URL to customer's Subscriptions page in the Admin console. The + * read-only URL is generated by the API service. This is used if your + * client application requires the customer to complete a task using the + * Subscriptions page in the Admin console. + */ + resourceUiUrl: string; + /** + * This is a required property. The number and limit of user seat licenses + * in the plan. + */ + seats: Schema$Seats; + /** + * A required property. The skuId is a unique system identifier for a + * product's SKU assigned to a customer in the subscription. For + * products and SKUs available in this version of the API, see Product and + * SKU IDs. + */ + skuId: string; + /** + * Read-only external display name for a product's SKU assigned to a + * customer in the subscription. SKU names are subject to change at + * Google's discretion. For products and SKUs available in this version + * of the API, see Product and SKU IDs. + */ + skuName: string; + /** + * This is an optional property. + */ + status: string; + /** + * The subscriptionId is the subscription identifier and is unique for each + * customer. This is a required property. Since a subscriptionId changes + * when a subscription is updated, we recommend not using this ID as a key + * for persistent data. Use the subscriptionId as described in retrieve all + * reseller subscriptions. + */ + subscriptionId: string; + /** + * Read-only field containing an enumerable of all the current suspension + * reasons for a subscription. It is possible for a subscription to have + * many concurrent, overlapping suspension reasons. A subscription's + * STATUS is SUSPENDED until all pending suspensions are removed. Possible + * options include: - PENDING_TOS_ACCEPTANCE - The customer has not logged + * in and accepted the G Suite Resold Terms of Services. - + * RENEWAL_WITH_TYPE_CANCEL - The customer's commitment ended and their + * service was cancelled at the end of their term. - RESELLER_INITIATED - + * A manual suspension invoked by a Reseller. - TRIAL_ENDED - The + * customer's trial expired without a plan selected. - OTHER - The + * customer is suspended for an internal Google reason (e.g. abuse or + * otherwise). + */ + suspensionReasons: string[]; + /** + * Read-only transfer related information for the subscription. For more + * information, see retrieve transferable subscriptions for a customer. + */ + transferInfo: any; + /** + * The G Suite annual commitment and flexible payment plans can be in a + * 30-day free trial. For more information, see the API concepts. + */ + trialSettings: any; } - - getRoot() { - return this.root; + /** + * JSON template for a subscription list. + */ + export interface Schema$Subscriptions { + /** + * Identifies the resource as a collection of subscriptions. Value: + * reseller#subscriptions + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + /** + * The subscriptions in this page of results. + */ + subscriptions: Schema$Subscription[]; } - - /** - * reseller.customers.get - * @desc Get a customer account. - * @alias reseller.customers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Customers { + root: Reseller; + constructor(root: Reseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * reseller.customers.insert - * @desc Order a new customer's account. - * @alias reseller.customers.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. - * @param {().Customer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.customers.get + * @desc Get a customer account. + * @alias reseller.customers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/customers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.customers.patch - * @desc Update a customer account's settings. This method supports patch - * semantics. - * @alias reseller.customers.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {().Customer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.customers.insert + * @desc Order a new customer's account. + * @alias reseller.customers.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * @param {().Customer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/customers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.customers.update - * @desc Update a customer account's settings. - * @alias reseller.customers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {().Customer} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.customers.patch + * @desc Update a customer account's settings. This method supports patch + * semantics. + * @alias reseller.customers.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {().Customer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Resellernotify { - root: Reseller; - constructor(root: Reseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * reseller.customers.update + * @desc Update a customer account's settings. + * @alias reseller.customers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {().Customer} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/customers/{customerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * reseller.resellernotify.getwatchdetails - * @desc Returns all the details of the watch corresponding to the reseller. - * @alias reseller.resellernotify.getwatchdetails - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getwatchdetails(params?: any, options?: MethodOptions): - AxiosPromise; - getwatchdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - getwatchdetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Resellernotify { + root: Reseller; + constructor(root: Reseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/resellernotify/getwatchdetails') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * reseller.resellernotify.register - * @desc Registers a Reseller for receiving notifications. - * @alias reseller.resellernotify.register - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.serviceAccountEmailAddress The service account which will own the created Cloud-PubSub topic. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - register(params?: any, options?: MethodOptions): - AxiosPromise; - register( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - register( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.resellernotify.getwatchdetails + * @desc Returns all the details of the watch corresponding to the reseller. + * @alias reseller.resellernotify.getwatchdetails + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getwatchdetails(params?: any, options?: MethodOptions): + AxiosPromise; + getwatchdetails( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + getwatchdetails( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/apps/reseller/v1/resellernotify/getwatchdetails') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/resellernotify/register') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.resellernotify.unregister - * @desc Unregisters a Reseller for receiving notifications. - * @alias reseller.resellernotify.unregister - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.serviceAccountEmailAddress The service account which owns the Cloud-PubSub topic. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - unregister(params?: any, options?: MethodOptions): - AxiosPromise; - unregister( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - unregister( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.resellernotify.register + * @desc Registers a Reseller for receiving notifications. + * @alias reseller.resellernotify.register + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.serviceAccountEmailAddress The service account which will own the created Cloud-PubSub topic. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + register(params?: any, options?: MethodOptions): + AxiosPromise; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/resellernotify/register') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/resellernotify/unregister') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Subscriptions { - root: Reseller; - constructor(root: Reseller) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * reseller.resellernotify.unregister + * @desc Unregisters a Reseller for receiving notifications. + * @alias reseller.resellernotify.unregister + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.serviceAccountEmailAddress The service account which owns the Cloud-PubSub topic. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unregister(params?: any, options?: MethodOptions): + AxiosPromise; + unregister( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + unregister( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/resellernotify/unregister') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * reseller.subscriptions.activate - * @desc Activates a subscription previously suspended by the reseller - * @alias reseller.subscriptions.activate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - activate(params?: any, options?: MethodOptions): - AxiosPromise; - activate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - activate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Subscriptions { + root: Reseller; + constructor(root: Reseller) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/activate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * reseller.subscriptions.changePlan - * @desc Update a subscription plan. Use this method to update a plan for a - * 30-day trial or a flexible plan subscription to an annual commitment plan - * with monthly or yearly payments. - * @alias reseller.subscriptions.changePlan - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {().ChangePlanRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - changePlan(params?: any, options?: MethodOptions): - AxiosPromise; - changePlan( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - changePlan( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.activate + * @desc Activates a subscription previously suspended by the reseller + * @alias reseller.subscriptions.activate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + activate(params?: any, options?: MethodOptions): + AxiosPromise; + activate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + activate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/activate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.changeRenewalSettings - * @desc Update a user license's renewal settings. This is applicable for - * accounts with annual commitment plans only. - * @alias reseller.subscriptions.changeRenewalSettings - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {().RenewalSettings} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - changeRenewalSettings(params?: any, options?: MethodOptions): - AxiosPromise; - changeRenewalSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - changeRenewalSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.changePlan + * @desc Update a subscription plan. Use this method to update a plan for a + * 30-day trial or a flexible plan subscription to an annual commitment plan + * with monthly or yearly payments. + * @alias reseller.subscriptions.changePlan + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {().ChangePlanRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + changePlan(params?: any, options?: MethodOptions): + AxiosPromise; + changePlan( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + changePlan( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.changeSeats - * @desc Update a subscription's user license settings. - * @alias reseller.subscriptions.changeSeats - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {().Seats} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - changeSeats(params?: any, options?: MethodOptions): - AxiosPromise; - changeSeats( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - changeSeats( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.changeRenewalSettings + * @desc Update a user license's renewal settings. This is applicable for + * accounts with annual commitment plans only. + * @alias reseller.subscriptions.changeRenewalSettings + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {().RenewalSettings} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + changeRenewalSettings(params?: any, options?: MethodOptions): + AxiosPromise; + changeRenewalSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + changeRenewalSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeSeats') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.delete - * @desc Cancel, suspend or transfer a subscription to direct. - * @alias reseller.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.deletionType The deletionType query string enables the cancellation, downgrade, or suspension of a subscription. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.changeSeats + * @desc Update a subscription's user license settings. + * @alias reseller.subscriptions.changeSeats + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {().Seats} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + changeSeats(params?: any, options?: MethodOptions): + AxiosPromise; + changeSeats( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + changeSeats( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeSeats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId', 'deletionType'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.get - * @desc Get a specific subscription. - * @alias reseller.subscriptions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.delete + * @desc Cancel, suspend or transfer a subscription to direct. + * @alias reseller.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.deletionType The deletionType query string enables the cancellation, downgrade, or suspension of a subscription. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId', 'deletionType'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.insert - * @desc Create or transfer a subscription. - * @alias reseller.subscriptions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.get + * @desc Get a specific subscription. + * @alias reseller.subscriptions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId'], - pathParams: ['customerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.list - * @desc List of subscriptions managed by the reseller. The list can be all - * subscriptions, all of a customer's subscriptions, or all of a customer's - * transferable subscriptions. - * @alias reseller.subscriptions.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. - * @param {string=} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string=} params.customerNamePrefix When retrieving all of your subscriptions and filtering for specific customers, you can enter a prefix for a customer name. Using an example customer group that includes exam.com, example20.com and example.com: - exa -- Returns all customer names that start with 'exa' which could include exam.com, example20.com, and example.com. A name prefix is similar to using a regular expression's asterisk, exa*. - example -- Returns example20.com and example.com. - * @param {integer=} params.maxResults When retrieving a large list, the maxResults is the maximum number of results per page. The nextPageToken value takes you to the next page. The default is 20. - * @param {string=} params.pageToken Token to specify next page in the list - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.insert + * @desc Create or transfer a subscription. + * @alias reseller.subscriptions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId'], + pathParams: ['customerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/apps/reseller/v1/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.startPaidService - * @desc Immediately move a 30-day free trial subscription to a paid service - * subscription. - * @alias reseller.subscriptions.startPaidService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startPaidService(params?: any, options?: MethodOptions): - AxiosPromise; - startPaidService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startPaidService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.list + * @desc List of subscriptions managed by the reseller. The list can be all + * subscriptions, all of a customer's subscriptions, or all of a customer's + * transferable subscriptions. + * @alias reseller.subscriptions.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.customerAuthToken The customerAuthToken query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the administrator help center. + * @param {string=} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string=} params.customerNamePrefix When retrieving all of your subscriptions and filtering for specific customers, you can enter a prefix for a customer name. Using an example customer group that includes exam.com, example20.com and example.com: - exa -- Returns all customer names that start with 'exa' which could include exam.com, example20.com, and example.com. A name prefix is similar to using a regular expression's asterisk, exa*. - example -- Returns example20.com and example.com. + * @param {integer=} params.maxResults When retrieving a large list, the maxResults is the maximum number of results per page. The nextPageToken value takes you to the next page. The default is 20. + * @param {string=} params.pageToken Token to specify next page in the list + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/apps/reseller/v1/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/startPaidService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * reseller.subscriptions.suspend - * @desc Suspends an active subscription. - * @alias reseller.subscriptions.suspend - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. - * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - suspend(params?: any, options?: MethodOptions): - AxiosPromise; - suspend( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - suspend( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * reseller.subscriptions.startPaidService + * @desc Immediately move a 30-day free trial subscription to a paid service + * subscription. + * @alias reseller.subscriptions.startPaidService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startPaidService(params?: any, options?: MethodOptions): + AxiosPromise; + startPaidService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startPaidService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/startPaidService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/suspend') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['customerId', 'subscriptionId'], - pathParams: ['customerId', 'subscriptionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * reseller.subscriptions.suspend + * @desc Suspends an active subscription. + * @alias reseller.subscriptions.suspend + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.customerId Either the customer's primary domain name or the customer's unique identifier. If using the domain name, we do not recommend using a customerId as a key for persistent data. If the domain name for a customerId is changed, the Google system automatically updates. + * @param {string} params.subscriptionId This is a required property. The subscriptionId is the subscription identifier and is unique for each customer. Since a subscriptionId changes when a subscription is updated, we recommend to not use this ID as a key for persistent data. And the subscriptionId can be found using the retrieve all reseller subscriptions method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + suspend(params?: any, options?: MethodOptions): + AxiosPromise; + suspend( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + suspend( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/suspend') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['customerId', 'subscriptionId'], + pathParams: ['customerId', 'subscriptionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/resourceviews/v1beta1.ts b/src/apis/resourceviews/v1beta1.ts index ff3bc4fbbf2..dde71f3f923 100644 --- a/src/apis/resourceviews/v1beta1.ts +++ b/src/apis/resourceviews/v1beta1.ts @@ -27,1040 +27,1049 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Resource Views API - * - * The Resource View API allows users to create and manage logical sets of - * Google Compute Engine instances. - * - * @example - * const google = require('googleapis'); - * const resourceviews = google.resourceviews('v1beta1'); - * - * @namespace resourceviews - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Resourceviews - */ -export class Resourceviews { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace resourceviews_v1beta1 { + /** + * Resource Views API + * + * The Resource View API allows users to create and manage logical sets of + * Google Compute Engine instances. + * + * @example + * const google = require('googleapis'); + * const resourceviews = google.resourceviews('v1beta1'); + * + * @namespace resourceviews + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Resourceviews + */ + export class Resourceviews { + _options: GlobalOptions; + google: GoogleApis; + root = this; - regionViews: Resource$Regionviews; - zoneViews: Resource$Zoneviews; + regionViews: Resource$Regionviews; + zoneViews: Resource$Zoneviews; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.regionViews = new Resource$Regionviews(this); - this.zoneViews = new Resource$Zoneviews(this); - } + this.regionViews = new Resource$Regionviews(this); + this.zoneViews = new Resource$Zoneviews(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The Label to be applied to the resource views. - */ -export interface Schema$Label { - /** - * Key of the label. - */ - key: string; - /** - * Value of the label. - */ - value: string; -} -/** - * The request to add resources to the resource view. - */ -export interface Schema$RegionViewsAddResourcesRequest { /** - * The list of resources to be added. + * The Label to be applied to the resource views. */ - resources: string[]; -} -/** - * The response to a resource view insert request. - */ -export interface Schema$RegionViewsInsertResponse { - /** - * The resource view object inserted. - */ - resource: Schema$ResourceView; -} -/** - * The response to the list resource request. - */ -export interface Schema$RegionViewsListResourcesResponse { - /** - * The resources in the view. - */ - members: string[]; - /** - * A token used for pagination. - */ - nextPageToken: string; -} -/** - * The response to the list resource view request. - */ -export interface Schema$RegionViewsListResponse { - /** - * A token used for pagination. - */ - nextPageToken: string; - /** - * The list of resource views that meet the criteria. - */ - resourceViews: Schema$ResourceView[]; -} -/** - * The request to remove resources from the resource view. - */ -export interface Schema$RegionViewsRemoveResourcesRequest { - /** - * The list of resources to be removed. - */ - resources: string[]; -} -/** - * The resource view object. - */ -export interface Schema$ResourceView { - /** - * The creation time of the resource view. - */ - creationTime: string; - /** - * The detailed description of the resource view. - */ - description: string; - /** - * [Output Only] The ID of the resource view. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * The labels for events. - */ - labels: Schema$Label[]; - /** - * The last modified time of the view. Not supported yet. - */ - lastModified: string; + export interface Schema$Label { + /** + * Key of the label. + */ + key: string; + /** + * Value of the label. + */ + value: string; + } /** - * A list of all resources in the resource view. + * The request to add resources to the resource view. */ - members: string[]; + export interface Schema$RegionViewsAddResourcesRequest { + /** + * The list of resources to be added. + */ + resources: string[]; + } /** - * The name of the resource view. + * The response to a resource view insert request. */ - name: string; + export interface Schema$RegionViewsInsertResponse { + /** + * The resource view object inserted. + */ + resource: Schema$ResourceView; + } /** - * The total number of resources in the resource view. + * The response to the list resource request. */ - numMembers: number; + export interface Schema$RegionViewsListResourcesResponse { + /** + * The resources in the view. + */ + members: string[]; + /** + * A token used for pagination. + */ + nextPageToken: string; + } /** - * [Output Only] A self-link to the resource view. + * The response to the list resource view request. */ - selfLink: string; -} -/** - * The request to add resources to the resource view. - */ -export interface Schema$ZoneViewsAddResourcesRequest { + export interface Schema$RegionViewsListResponse { + /** + * A token used for pagination. + */ + nextPageToken: string; + /** + * The list of resource views that meet the criteria. + */ + resourceViews: Schema$ResourceView[]; + } /** - * The list of resources to be added. + * The request to remove resources from the resource view. */ - resources: string[]; -} -/** - * The response to an insert request. - */ -export interface Schema$ZoneViewsInsertResponse { + export interface Schema$RegionViewsRemoveResourcesRequest { + /** + * The list of resources to be removed. + */ + resources: string[]; + } /** - * The resource view object that has been inserted. + * The resource view object. */ - resource: Schema$ResourceView; -} -/** - * The response to a list resource request. - */ -export interface Schema$ZoneViewsListResourcesResponse { + export interface Schema$ResourceView { + /** + * The creation time of the resource view. + */ + creationTime: string; + /** + * The detailed description of the resource view. + */ + description: string; + /** + * [Output Only] The ID of the resource view. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * The labels for events. + */ + labels: Schema$Label[]; + /** + * The last modified time of the view. Not supported yet. + */ + lastModified: string; + /** + * A list of all resources in the resource view. + */ + members: string[]; + /** + * The name of the resource view. + */ + name: string; + /** + * The total number of resources in the resource view. + */ + numMembers: number; + /** + * [Output Only] A self-link to the resource view. + */ + selfLink: string; + } /** - * The full URL of resources in the view. + * The request to add resources to the resource view. */ - members: string[]; + export interface Schema$ZoneViewsAddResourcesRequest { + /** + * The list of resources to be added. + */ + resources: string[]; + } /** - * A token used for pagination. + * The response to an insert request. */ - nextPageToken: string; -} -/** - * The response to a list request. - */ -export interface Schema$ZoneViewsListResponse { + export interface Schema$ZoneViewsInsertResponse { + /** + * The resource view object that has been inserted. + */ + resource: Schema$ResourceView; + } /** - * A token used for pagination. + * The response to a list resource request. */ - nextPageToken: string; + export interface Schema$ZoneViewsListResourcesResponse { + /** + * The full URL of resources in the view. + */ + members: string[]; + /** + * A token used for pagination. + */ + nextPageToken: string; + } /** - * The result that contains all resource views that meet the criteria. + * The response to a list request. */ - resourceViews: Schema$ResourceView[]; -} -/** - * The request to remove resources from the resource view. - */ -export interface Schema$ZoneViewsRemoveResourcesRequest { + export interface Schema$ZoneViewsListResponse { + /** + * A token used for pagination. + */ + nextPageToken: string; + /** + * The result that contains all resource views that meet the criteria. + */ + resourceViews: Schema$ResourceView[]; + } /** - * The list of resources to be removed. + * The request to remove resources from the resource view. */ - resources: string[]; -} - -export class Resource$Regionviews { - root: Resourceviews; - constructor(root: Resourceviews) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ZoneViewsRemoveResourcesRequest { + /** + * The list of resources to be removed. + */ + resources: string[]; } - getRoot() { - return this.root; - } - - - /** - * resourceviews.regionViews.addresources - * @desc Add resources to the view. - * @alias resourceviews.regionViews.addresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {().RegionViewsAddResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addresources(params?: any, options?: MethodOptions): AxiosPromise; - addresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Regionviews { + root: Resourceviews; + constructor(root: Resourceviews) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'region', 'resourceViewName'], - pathParams: ['projectName', 'region', 'resourceViewName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * resourceviews.regionViews.delete - * @desc Delete a resource view. - * @alias resourceviews.regionViews.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.regionViews.addresources + * @desc Add resources to the view. + * @alias resourceviews.regionViews.addresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {().RegionViewsAddResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addresources(params?: any, options?: MethodOptions): AxiosPromise; + addresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'region', 'resourceViewName'], + pathParams: ['projectName', 'region', 'resourceViewName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectName', 'region', 'resourceViewName'], - pathParams: ['projectName', 'region', 'resourceViewName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.regionViews.get - * @desc Get the information of a resource view. - * @alias resourceviews.regionViews.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.regionViews.delete + * @desc Delete a resource view. + * @alias resourceviews.regionViews.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectName', 'region', 'resourceViewName'], + pathParams: ['projectName', 'region', 'resourceViewName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'region', 'resourceViewName'], - pathParams: ['projectName', 'region', 'resourceViewName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.regionViews.insert - * @desc Create a resource view. - * @alias resourceviews.regionViews.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {().ResourceView} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.regionViews.get + * @desc Get the information of a resource view. + * @alias resourceviews.regionViews.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'region', 'resourceViewName'], + pathParams: ['projectName', 'region', 'resourceViewName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'region'], - pathParams: ['projectName', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.regionViews.list - * @desc List resource views. - * @alias resourceviews.regionViews.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.regionViews.insert + * @desc Create a resource view. + * @alias resourceviews.regionViews.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {().ResourceView} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'region'], + pathParams: ['projectName', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'region'], - pathParams: ['projectName', 'region'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.regionViews.listresources - * @desc List the resources in the view. - * @alias resourceviews.regionViews.listresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listresources(params?: any, options?: MethodOptions): - AxiosPromise; - listresources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listresources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'region', 'resourceViewName'], - pathParams: ['projectName', 'region', 'resourceViewName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * resourceviews.regionViews.list + * @desc List resource views. + * @alias resourceviews.regionViews.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'region'], + pathParams: ['projectName', 'region'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * resourceviews.regionViews.removeresources - * @desc Remove resources from the view. - * @alias resourceviews.regionViews.removeresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.region The region name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {().RegionViewsRemoveResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeresources(params?: any, options?: MethodOptions): AxiosPromise; - removeresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'region', 'resourceViewName'], - pathParams: ['projectName', 'region', 'resourceViewName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.regionViews.listresources + * @desc List the resources in the view. + * @alias resourceviews.regionViews.listresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listresources(params?: any, options?: MethodOptions): + AxiosPromise; + listresources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + listresources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'region', 'resourceViewName'], + pathParams: ['projectName', 'region', 'resourceViewName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } -} -export class Resource$Zoneviews { - root: Resourceviews; - constructor(root: Resourceviews) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * resourceviews.regionViews.removeresources + * @desc Remove resources from the view. + * @alias resourceviews.regionViews.removeresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.region The region name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {().RegionViewsRemoveResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeresources(params?: any, options?: MethodOptions): AxiosPromise; + removeresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'region', 'resourceViewName'], + pathParams: ['projectName', 'region', 'resourceViewName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * resourceviews.zoneViews.addresources - * @desc Add resources to the view. - * @alias resourceviews.zoneViews.addresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ZoneViewsAddResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addresources(params?: any, options?: MethodOptions): AxiosPromise; - addresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Zoneviews { + root: Resourceviews; + constructor(root: Resourceviews) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'resourceViewName'], - pathParams: ['projectName', 'resourceViewName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * resourceviews.zoneViews.delete - * @desc Delete a resource view. - * @alias resourceviews.zoneViews.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneViews.addresources + * @desc Add resources to the view. + * @alias resourceviews.zoneViews.addresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ZoneViewsAddResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addresources(params?: any, options?: MethodOptions): AxiosPromise; + addresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'resourceViewName'], + pathParams: ['projectName', 'resourceViewName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'resourceViewName'], - pathParams: ['projectName', 'resourceViewName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.zoneViews.get - * @desc Get the information of a zonal resource view. - * @alias resourceviews.zoneViews.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneViews.delete + * @desc Delete a resource view. + * @alias resourceviews.zoneViews.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'resourceViewName'], + pathParams: ['projectName', 'resourceViewName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'resourceViewName'], - pathParams: ['projectName', 'resourceViewName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.zoneViews.insert - * @desc Create a resource view. - * @alias resourceviews.zoneViews.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ResourceView} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone'], - pathParams: ['projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.zoneViews.get + * @desc Get the information of a zonal resource view. + * @alias resourceviews.zoneViews.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'resourceViewName'], + pathParams: ['projectName', 'resourceViewName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * resourceviews.zoneViews.list - * @desc List resource views. - * @alias resourceviews.zoneViews.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectName', 'zone'], - pathParams: ['projectName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.zoneViews.insert + * @desc Create a resource view. + * @alias resourceviews.zoneViews.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ResourceView} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone'], + pathParams: ['projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * resourceviews.zoneViews.listresources - * @desc List the resources of the resource view. - * @alias resourceviews.zoneViews.listresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listresources(params?: any, options?: MethodOptions): - AxiosPromise; - listresources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listresources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.zoneViews.list + * @desc List resource views. + * @alias resourceviews.zoneViews.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectName', 'zone'], + pathParams: ['projectName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'resourceViewName'], - pathParams: ['projectName', 'resourceViewName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * resourceviews.zoneViews.removeresources - * @desc Remove resources from the view. - * @alias resourceviews.zoneViews.removeresources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectName The project name of the resource view. - * @param {string} params.resourceViewName The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ZoneViewsRemoveResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeresources(params?: any, options?: MethodOptions): AxiosPromise; - removeresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeresources( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.zoneViews.listresources + * @desc List the resources of the resource view. + * @alias resourceviews.zoneViews.listresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listresources(params?: any, options?: MethodOptions): + AxiosPromise; + listresources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listresources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'resourceViewName'], + pathParams: ['projectName', 'resourceViewName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectName', 'zone', 'resourceViewName'], - pathParams: ['projectName', 'resourceViewName', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * resourceviews.zoneViews.removeresources + * @desc Remove resources from the view. + * @alias resourceviews.zoneViews.removeresources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectName The project name of the resource view. + * @param {string} params.resourceViewName The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ZoneViewsRemoveResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeresources(params?: any, options?: MethodOptions): AxiosPromise; + removeresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeresources( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta1/projects/{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectName', 'zone', 'resourceViewName'], + pathParams: ['projectName', 'resourceViewName', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/resourceviews/v1beta2.ts b/src/apis/resourceviews/v1beta2.ts index 4e5f606cb84..2e6033bd99c 100644 --- a/src/apis/resourceviews/v1beta2.ts +++ b/src/apis/resourceviews/v1beta2.ts @@ -27,1027 +27,1035 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Compute Engine Instance Groups API - * - * The Resource View API allows users to create and manage logical sets of - * Google Compute Engine instances. - * - * @example - * const google = require('googleapis'); - * const resourceviews = google.resourceviews('v1beta2'); - * - * @namespace resourceviews - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Resourceviews - */ -export class Resourceviews { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace resourceviews_v1beta2 { + /** + * Google Compute Engine Instance Groups API + * + * The Resource View API allows users to create and manage logical sets of + * Google Compute Engine instances. + * + * @example + * const google = require('googleapis'); + * const resourceviews = google.resourceviews('v1beta2'); + * + * @namespace resourceviews + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Resourceviews + */ + export class Resourceviews { + _options: GlobalOptions; + google: GoogleApis; + root = this; - zoneOperations: Resource$Zoneoperations; - zoneViews: Resource$Zoneviews; + zoneOperations: Resource$Zoneoperations; + zoneViews: Resource$Zoneviews; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.zoneOperations = new Resource$Zoneoperations(this); - this.zoneViews = new Resource$Zoneviews(this); - } + this.zoneOperations = new Resource$Zoneoperations(this); + this.zoneViews = new Resource$Zoneviews(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The Label to be applied to the resource views. - */ -export interface Schema$Label { - /** - * Key of the label. - */ - key: string; - /** - * Value of the label. - */ - value: string; -} -/** - * The list response item that contains the resource and end points information. - */ -export interface Schema$ListResourceResponseItem { - /** - * The list of service end points on the resource. - */ - endpoints: any; - /** - * The full URL of the resource. - */ - resource: string; -} -/** - * An operation resource, used to manage asynchronous API requests. - */ -export interface Schema$Operation { - /** - * [Output only] An optional identifier specified by the client when the - * mutation was initiated. Must be unique for all operation resources in the - * project. - */ - clientOperationId: string; - /** - * [Output Only] The time that this operation was requested, in RFC3339 text - * format. - */ - creationTimestamp: string; - /** - * [Output Only] The time that this operation was completed, in RFC3339 text - * format. - */ - endTime: string; - /** - * [Output Only] If errors occurred during processing of this operation, this - * field will be populated. - */ - error: any; - /** - * [Output only] If operation fails, the HTTP error message returned. - */ - httpErrorMessage: string; - /** - * [Output only] If operation fails, the HTTP error status code returned. - */ - httpErrorStatusCode: number; - /** - * [Output Only] Unique identifier for the resource, generated by the server. - */ - id: string; - /** - * [Output Only] The time that this operation was requested, in RFC3339 text - * format. - */ - insertTime: string; - /** - * [Output only] Type of the resource. - */ - kind: string; - /** - * [Output Only] Name of the resource. - */ - name: string; - /** - * [Output only] Type of the operation. Operations include insert, update, and - * delete. - */ - operationType: string; - /** - * [Output only] An optional progress indicator that ranges from 0 to 100. - * There is no requirement that this be linear or support any granularity of - * operations. This should not be used to guess at when the operation will be - * complete. This number should be monotonically increasing as the operation - * progresses. - */ - progress: number; - /** - * [Output Only] URL of the region where the operation resides. Only available - * when performing regional operations. - */ - region: string; - /** - * [Output Only] Server-defined fully-qualified URL for this resource. - */ - selfLink: string; - /** - * [Output Only] The time that this operation was started by the server, in - * RFC3339 text format. - */ - startTime: string; /** - * [Output Only] Status of the operation. - */ - status: string; - /** - * [Output Only] An optional textual description of the current status of the - * operation. - */ - statusMessage: string; - /** - * [Output Only] Unique target ID which identifies a particular incarnation of - * the target. - */ - targetId: string; - /** - * [Output only] URL of the resource the operation is mutating. - */ - targetLink: string; - /** - * [Output Only] User who requested the operation, for example: - * user@example.com. - */ - user: string; - /** - * [Output Only] If there are issues with this operation, a warning is - * returned. - */ - warnings: any[]; - /** - * [Output Only] URL of the zone where the operation resides. Only available - * when performing per-zone operations. - */ - zone: string; -} -export interface Schema$OperationList { - /** - * Unique identifier for the resource; defined by the server (output only). - */ - id: string; - /** - * The operation resources. - */ - items: Schema$Operation[]; - /** - * Type of resource. - */ - kind: string; - /** - * A token used to continue a truncated list request (output only). - */ - nextPageToken: string; - /** - * Server defined URL for this resource (output only). - */ - selfLink: string; -} -/** - * The resource view object. - */ -export interface Schema$ResourceView { - /** - * The creation time of the resource view. - */ - creationTimestamp: string; - /** - * The detailed description of the resource view. - */ - description: string; - /** - * Services endpoint information. - */ - endpoints: Schema$ServiceEndpoint[]; - /** - * The fingerprint of the service endpoint information. - */ - fingerprint: string; - /** - * [Output Only] The ID of the resource view. - */ - id: string; - /** - * Type of the resource. - */ - kind: string; - /** - * The labels for events. - */ - labels: Schema$Label[]; - /** - * The name of the resource view. - */ - name: string; - /** - * The URL of a Compute Engine network to which the resources in the view - * belong. - */ - network: string; - /** - * A list of all resources in the resource view. - */ - resources: string[]; - /** - * [Output Only] A self-link to the resource view. - */ - selfLink: string; - /** - * The total number of resources in the resource view. - */ - size: number; -} -/** - * The service endpoint that may be started in a VM. - */ -export interface Schema$ServiceEndpoint { - /** - * The name of the service endpoint. - */ - name: string; - /** - * The port of the service endpoint. - */ - port: number; -} -/** - * The request to add resources to the resource view. - */ -export interface Schema$ZoneViewsAddResourcesRequest { - /** - * The list of resources to be added. - */ - resources: string[]; -} -export interface Schema$ZoneViewsGetServiceResponse { - /** - * The service information. - */ - endpoints: Schema$ServiceEndpoint[]; - /** - * The fingerprint of the service information. - */ - fingerprint: string; -} -/** - * The response to a list request. - */ -export interface Schema$ZoneViewsList { - /** - * The result that contains all resource views that meet the criteria. - */ - items: Schema$ResourceView[]; - /** - * Type of resource. - */ - kind: string; - /** - * A token used for pagination. - */ - nextPageToken: string; + * The Label to be applied to the resource views. + */ + export interface Schema$Label { + /** + * Key of the label. + */ + key: string; + /** + * Value of the label. + */ + value: string; + } /** - * Server defined URL for this resource (output only). - */ - selfLink: string; -} -/** - * The response to a list resource request. - */ -export interface Schema$ZoneViewsListResourcesResponse { + * The list response item that contains the resource and end points + * information. + */ + export interface Schema$ListResourceResponseItem { + /** + * The list of service end points on the resource. + */ + endpoints: any; + /** + * The full URL of the resource. + */ + resource: string; + } /** - * The formatted JSON that is requested by the user. - */ - items: Schema$ListResourceResponseItem[]; + * An operation resource, used to manage asynchronous API requests. + */ + export interface Schema$Operation { + /** + * [Output only] An optional identifier specified by the client when the + * mutation was initiated. Must be unique for all operation resources in the + * project. + */ + clientOperationId: string; + /** + * [Output Only] The time that this operation was requested, in RFC3339 text + * format. + */ + creationTimestamp: string; + /** + * [Output Only] The time that this operation was completed, in RFC3339 text + * format. + */ + endTime: string; + /** + * [Output Only] If errors occurred during processing of this operation, + * this field will be populated. + */ + error: any; + /** + * [Output only] If operation fails, the HTTP error message returned. + */ + httpErrorMessage: string; + /** + * [Output only] If operation fails, the HTTP error status code returned. + */ + httpErrorStatusCode: number; + /** + * [Output Only] Unique identifier for the resource, generated by the + * server. + */ + id: string; + /** + * [Output Only] The time that this operation was requested, in RFC3339 text + * format. + */ + insertTime: string; + /** + * [Output only] Type of the resource. + */ + kind: string; + /** + * [Output Only] Name of the resource. + */ + name: string; + /** + * [Output only] Type of the operation. Operations include insert, update, + * and delete. + */ + operationType: string; + /** + * [Output only] An optional progress indicator that ranges from 0 to 100. + * There is no requirement that this be linear or support any granularity of + * operations. This should not be used to guess at when the operation will + * be complete. This number should be monotonically increasing as the + * operation progresses. + */ + progress: number; + /** + * [Output Only] URL of the region where the operation resides. Only + * available when performing regional operations. + */ + region: string; + /** + * [Output Only] Server-defined fully-qualified URL for this resource. + */ + selfLink: string; + /** + * [Output Only] The time that this operation was started by the server, in + * RFC3339 text format. + */ + startTime: string; + /** + * [Output Only] Status of the operation. + */ + status: string; + /** + * [Output Only] An optional textual description of the current status of + * the operation. + */ + statusMessage: string; + /** + * [Output Only] Unique target ID which identifies a particular incarnation + * of the target. + */ + targetId: string; + /** + * [Output only] URL of the resource the operation is mutating. + */ + targetLink: string; + /** + * [Output Only] User who requested the operation, for example: + * user@example.com. + */ + user: string; + /** + * [Output Only] If there are issues with this operation, a warning is + * returned. + */ + warnings: any[]; + /** + * [Output Only] URL of the zone where the operation resides. Only available + * when performing per-zone operations. + */ + zone: string; + } + export interface Schema$OperationList { + /** + * Unique identifier for the resource; defined by the server (output only). + */ + id: string; + /** + * The operation resources. + */ + items: Schema$Operation[]; + /** + * Type of resource. + */ + kind: string; + /** + * A token used to continue a truncated list request (output only). + */ + nextPageToken: string; + /** + * Server defined URL for this resource (output only). + */ + selfLink: string; + } /** - * The URL of a Compute Engine network to which the resources in the view - * belong. - */ - network: string; + * The resource view object. + */ + export interface Schema$ResourceView { + /** + * The creation time of the resource view. + */ + creationTimestamp: string; + /** + * The detailed description of the resource view. + */ + description: string; + /** + * Services endpoint information. + */ + endpoints: Schema$ServiceEndpoint[]; + /** + * The fingerprint of the service endpoint information. + */ + fingerprint: string; + /** + * [Output Only] The ID of the resource view. + */ + id: string; + /** + * Type of the resource. + */ + kind: string; + /** + * The labels for events. + */ + labels: Schema$Label[]; + /** + * The name of the resource view. + */ + name: string; + /** + * The URL of a Compute Engine network to which the resources in the view + * belong. + */ + network: string; + /** + * A list of all resources in the resource view. + */ + resources: string[]; + /** + * [Output Only] A self-link to the resource view. + */ + selfLink: string; + /** + * The total number of resources in the resource view. + */ + size: number; + } /** - * A token used for pagination. - */ - nextPageToken: string; -} -/** - * The request to remove resources from the resource view. - */ -export interface Schema$ZoneViewsRemoveResourcesRequest { + * The service endpoint that may be started in a VM. + */ + export interface Schema$ServiceEndpoint { + /** + * The name of the service endpoint. + */ + name: string; + /** + * The port of the service endpoint. + */ + port: number; + } /** - * The list of resources to be removed. + * The request to add resources to the resource view. */ - resources: string[]; -} -export interface Schema$ZoneViewsSetServiceRequest { + export interface Schema$ZoneViewsAddResourcesRequest { + /** + * The list of resources to be added. + */ + resources: string[]; + } + export interface Schema$ZoneViewsGetServiceResponse { + /** + * The service information. + */ + endpoints: Schema$ServiceEndpoint[]; + /** + * The fingerprint of the service information. + */ + fingerprint: string; + } /** - * The service information to be updated. - */ - endpoints: Schema$ServiceEndpoint[]; + * The response to a list request. + */ + export interface Schema$ZoneViewsList { + /** + * The result that contains all resource views that meet the criteria. + */ + items: Schema$ResourceView[]; + /** + * Type of resource. + */ + kind: string; + /** + * A token used for pagination. + */ + nextPageToken: string; + /** + * Server defined URL for this resource (output only). + */ + selfLink: string; + } /** - * Fingerprint of the service information; a hash of the contents. This field - * is used for optimistic locking when updating the service entries. - */ - fingerprint: string; + * The response to a list resource request. + */ + export interface Schema$ZoneViewsListResourcesResponse { + /** + * The formatted JSON that is requested by the user. + */ + items: Schema$ListResourceResponseItem[]; + /** + * The URL of a Compute Engine network to which the resources in the view + * belong. + */ + network: string; + /** + * A token used for pagination. + */ + nextPageToken: string; + } /** - * The name of the resource if user wants to update the service information of - * the resource. + * The request to remove resources from the resource view. */ - resourceName: string; -} - -export class Resource$Zoneoperations { - root: Resourceviews; - constructor(root: Resourceviews) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$ZoneViewsRemoveResourcesRequest { + /** + * The list of resources to be removed. + */ + resources: string[]; } - - getRoot() { - return this.root; + export interface Schema$ZoneViewsSetServiceRequest { + /** + * The service information to be updated. + */ + endpoints: Schema$ServiceEndpoint[]; + /** + * Fingerprint of the service information; a hash of the contents. This + * field is used for optimistic locking when updating the service entries. + */ + fingerprint: string; + /** + * The name of the resource if user wants to update the service information + * of the resource. + */ + resourceName: string; } - - /** - * resourceviews.zoneOperations.get - * @desc Retrieves the specified zone-specific operation resource. - * @alias resourceviews.zoneOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Name of the operation resource to return. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Zoneoperations { + root: Resourceviews; + constructor(root: Resourceviews) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'operation'], - pathParams: ['operation', 'project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * resourceviews.zoneOperations.list - * @desc Retrieves the list of operation resources contained within the - * specified zone. - * @alias resourceviews.zoneOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Optional. Filter expression for filtering listed resources. - * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. - * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. - * @param {string} params.project Name of the project scoping this request. - * @param {string} params.zone Name of the zone scoping this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneOperations.get + * @desc Retrieves the specified zone-specific operation resource. + * @alias resourceviews.zoneOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Name of the operation resource to return. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'operation'], + pathParams: ['operation', 'project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Zoneviews { - root: Resourceviews; - constructor(root: Resourceviews) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * resourceviews.zoneOperations.list + * @desc Retrieves the list of operation resources contained within the + * specified zone. + * @alias resourceviews.zoneOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Optional. Filter expression for filtering listed resources. + * @param {integer=} params.maxResults Optional. Maximum count of results to be returned. Maximum value is 500 and default value is 500. + * @param {string=} params.pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request. + * @param {string} params.project Name of the project scoping this request. + * @param {string} params.zone Name of the zone scoping this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * resourceviews.zoneViews.addResources - * @desc Add resources to the view. - * @alias resourceviews.zoneViews.addResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ZoneViewsAddResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addResources(params?: any, options?: MethodOptions): - AxiosPromise; - addResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Zoneviews { + root: Resourceviews; + constructor(root: Resourceviews) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/addResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * resourceviews.zoneViews.delete - * @desc Delete a resource view. - * @alias resourceviews.zoneViews.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.zoneViews.addResources + * @desc Add resources to the view. + * @alias resourceviews.zoneViews.addResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ZoneViewsAddResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addResources(params?: any, options?: MethodOptions): + AxiosPromise; + addResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/addResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * resourceviews.zoneViews.get - * @desc Get the information of a zonal resource view. - * @alias resourceviews.zoneViews.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneViews.delete + * @desc Delete a resource view. + * @alias resourceviews.zoneViews.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.zoneViews.getService - * @desc Get the service information of a resource view or a resource. - * @alias resourceviews.zoneViews.getService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string=} params.resourceName The name of the resource if user wants to get the service information of the resource. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getService(params?: any, options?: MethodOptions): - AxiosPromise; - getService( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getService( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.zoneViews.get + * @desc Get the information of a zonal resource view. + * @alias resourceviews.zoneViews.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/getService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.zoneViews.insert - * @desc Create a resource view. - * @alias resourceviews.zoneViews.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ResourceView} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.zoneViews.getService + * @desc Get the service information of a resource view or a resource. + * @alias resourceviews.zoneViews.getService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string=} params.resourceName The name of the resource if user wants to get the service information of the resource. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getService(params?: any, options?: MethodOptions): + AxiosPromise; + getService( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getService( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/getService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * resourceviews.zoneViews.list - * @desc List resource views. - * @alias resourceviews.zoneViews.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.project The project name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneViews.insert + * @desc Create a resource view. + * @alias resourceviews.zoneViews.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ResourceView} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone'], - pathParams: ['project', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * resourceviews.zoneViews.listResources - * @desc List the resources of the resource view. - * @alias resourceviews.zoneViews.listResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.format The requested format of the return value. It can be URL or URL_PORT. A JSON object will be included in the response based on the format. The default format is NONE, which results in no JSON in the response. - * @param {string=} params.listState The state of the instance to list. By default, it lists all instances. - * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) - * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string=} params.serviceName The service name to return in the response. It is optional and if it is not set, all the service end points will be returned. - * @param {string} params.zone The zone name of the resource view. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listResources(params?: any, options?: MethodOptions): - AxiosPromise; - listResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listResources( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * resourceviews.zoneViews.list + * @desc List resource views. + * @alias resourceviews.zoneViews.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.project The project name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone'], + pathParams: ['project', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/resources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * resourceviews.zoneViews.removeResources - * @desc Remove resources from the view. - * @alias resourceviews.zoneViews.removeResources - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ZoneViewsRemoveResourcesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeResources(params?: any, options?: MethodOptions): - AxiosPromise; - removeResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeResources( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/removeResources') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * resourceviews.zoneViews.listResources + * @desc List the resources of the resource view. + * @alias resourceviews.zoneViews.listResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.format The requested format of the return value. It can be URL or URL_PORT. A JSON object will be included in the response based on the format. The default format is NONE, which results in no JSON in the response. + * @param {string=} params.listState The state of the instance to list. By default, it lists all instances. + * @param {integer=} params.maxResults Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000) + * @param {string=} params.pageToken Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request. + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string=} params.serviceName The service name to return in the response. It is optional and if it is not set, all the service end points will be returned. + * @param {string} params.zone The zone name of the resource view. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listResources(params?: any, options?: MethodOptions): + AxiosPromise; + listResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listResources( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/resources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * resourceviews.zoneViews.setService - * @desc Update the service information of a resource view or a resource. - * @alias resourceviews.zoneViews.setService - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project name of the resource view. - * @param {string} params.resourceView The name of the resource view. - * @param {string} params.zone The zone name of the resource view. - * @param {().ZoneViewsSetServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setService(params?: any, options?: MethodOptions): - AxiosPromise; - setService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setService( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * resourceviews.zoneViews.removeResources + * @desc Remove resources from the view. + * @alias resourceviews.zoneViews.removeResources + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ZoneViewsRemoveResourcesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeResources(params?: any, options?: MethodOptions): + AxiosPromise; + removeResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeResources( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/removeResources') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/setService') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'zone', 'resourceView'], - pathParams: ['project', 'resourceView', 'zone'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * resourceviews.zoneViews.setService + * @desc Update the service information of a resource view or a resource. + * @alias resourceviews.zoneViews.setService + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project name of the resource view. + * @param {string} params.resourceView The name of the resource view. + * @param {string} params.zone The zone name of the resource view. + * @param {().ZoneViewsSetServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setService(params?: any, options?: MethodOptions): + AxiosPromise; + setService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setService( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}/setService') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'zone', 'resourceView'], + pathParams: ['project', 'resourceView', 'zone'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/runtimeconfig/v1.ts b/src/apis/runtimeconfig/v1.ts index 4f8bb61ff45..e3251aef8c7 100644 --- a/src/apis/runtimeconfig/v1.ts +++ b/src/apis/runtimeconfig/v1.ts @@ -27,348 +27,360 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Runtime Configuration API - * - * The Runtime Configurator allows you to dynamically configure and expose - * variables through Google Cloud Platform. In addition, you can also set - * Watchers and Waiters that will watch for changes to your data and return - * based on certain conditions. - * - * @example - * const google = require('googleapis'); - * const runtimeconfig = google.runtimeconfig('v1'); - * - * @namespace runtimeconfig - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Runtimeconfig - */ -export class Runtimeconfig { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace runtimeconfig_v1 { + /** + * Cloud Runtime Configuration API + * + * The Runtime Configurator allows you to dynamically configure and expose + * variables through Google Cloud Platform. In addition, you can also set + * Watchers and Waiters that will watch for changes to your data and return + * based on certain conditions. + * + * @example + * const google = require('googleapis'); + * const runtimeconfig = google.runtimeconfig('v1'); + * + * @namespace runtimeconfig + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Runtimeconfig + */ + export class Runtimeconfig { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; + operations: Resource$Operations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - } + this.operations = new Resource$Operations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. + * The request message for Operations.CancelOperation. */ - metadata: any; + export interface Schema$CancelOperationRequest {} /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - name: string; + export interface Schema$Empty {} /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + * The response message for Operations.ListOperations. */ - response: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * This resource represents a long-running operation that is the result of a + * network API call. */ - details: any[]; + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - message: string; -} - -export class Resource$Operations { - root: Runtimeconfig; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * runtimeconfig.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias runtimeconfig.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Runtimeconfig; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * runtimeconfig.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias runtimeconfig.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * runtimeconfig.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias runtimeconfig.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * runtimeconfig.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias runtimeconfig.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias runtimeconfig.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * runtimeconfig.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias runtimeconfig.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/runtimeconfig/v1beta1.ts b/src/apis/runtimeconfig/v1beta1.ts index 3850d8b05da..ba1e381da07 100644 --- a/src/apis/runtimeconfig/v1beta1.ts +++ b/src/apis/runtimeconfig/v1beta1.ts @@ -27,1768 +27,1828 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Runtime Configuration API - * - * The Runtime Configurator allows you to dynamically configure and expose - * variables through Google Cloud Platform. In addition, you can also set - * Watchers and Waiters that will watch for changes to your data and return - * based on certain conditions. - * - * @example - * const google = require('googleapis'); - * const runtimeconfig = google.runtimeconfig('v1beta1'); - * - * @namespace runtimeconfig - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Runtimeconfig - */ -export class Runtimeconfig { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace runtimeconfig_v1beta1 { + /** + * Cloud Runtime Configuration API + * + * The Runtime Configurator allows you to dynamically configure and expose + * variables through Google Cloud Platform. In addition, you can also set + * Watchers and Waiters that will watch for changes to your data and return + * based on certain conditions. + * + * @example + * const google = require('googleapis'); + * const runtimeconfig = google.runtimeconfig('v1beta1'); + * + * @namespace runtimeconfig + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Runtimeconfig + */ + export class Runtimeconfig { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A Cardinality condition for the Waiter resource. A cardinality condition is - * met when the number of variables under a specified path prefix reaches a - * predefined number. For example, if you set a Cardinality condition where the - * `path` is set to `/foo` and the number of paths is set to 2, the following - * variables would meet the condition in a RuntimeConfig resource: + - * `/foo/variable1 = "value1"` + `/foo/variable2 = "value2"` - * + `/bar/variable3 = "value3"` It would not would not satisify the - * same condition with the `number` set to 3, however, because there is only 2 - * paths that start with `/foo`. Cardinality conditions are recursive; all - * subtrees under the specific path prefix are counted. - */ -export interface Schema$Cardinality { - /** - * The number variables under the `path` that must exist to meet this - * condition. Defaults to 1 if not specified. - */ - number: number; - /** - * The root of the variable subtree to monitor. For example, `/foo`. - */ - path: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The condition that a Waiter resource is waiting for. - */ -export interface Schema$EndCondition { - /** - * The cardinality of the `EndCondition`. - */ - cardinality: Schema$Cardinality; -} -/** - * `ListConfigs()` returns the following response. The order of returned objects - * is arbitrary; that is, it is not ordered in any particular way. - */ -export interface Schema$ListConfigsResponse { - /** - * A list of the configurations in the project. The order of returned objects - * is arbitrary; that is, it is not ordered in any particular way. - */ - configs: Schema$RuntimeConfig[]; - /** - * This token allows you to get the next page of results for list requests. If - * the number of results is larger than `pageSize`, use the `nextPageToken` as - * a value for the query parameter `pageToken` in the next list request. - * Subsequent list requests will have their own `nextPageToken` to continue - * paging through the results - */ - nextPageToken: string; -} -/** - * Response for the `ListVariables()` method. - */ -export interface Schema$ListVariablesResponse { - /** - * This token allows you to get the next page of results for list requests. If - * the number of results is larger than `pageSize`, use the `nextPageToken` as - * a value for the query parameter `pageToken` in the next list request. - * Subsequent list requests will have their own `nextPageToken` to continue - * paging through the results - */ - nextPageToken: string; - /** - * A list of variables and their values. The order of returned variable - * objects is arbitrary. - */ - variables: Schema$Variable[]; -} -/** - * Response for the `ListWaiters()` method. Order of returned waiter objects is - * arbitrary. - */ -export interface Schema$ListWaitersResponse { - /** - * This token allows you to get the next page of results for list requests. If - * the number of results is larger than `pageSize`, use the `nextPageToken` as - * a value for the query parameter `pageToken` in the next list request. - * Subsequent list requests will have their own `nextPageToken` to continue - * paging through the results - */ - nextPageToken: string; - /** - * Found waiters in the project. - */ - waiters: Schema$Waiter[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig - * service. A RuntimeConfig resource consists of metadata and a hierarchy of - * variables. - */ -export interface Schema$RuntimeConfig { - /** - * An optional description of the RuntimeConfig object. - */ - description: string; /** - * The resource name of a runtime config. The name must have the format: - * projects/[PROJECT_ID]/configs/[CONFIG_NAME] The `[PROJECT_ID]` must be a - * valid project ID, and `[CONFIG_NAME]` is an arbitrary name that matches the - * `[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])?` regular expression. The - * length of `[CONFIG_NAME]` must be less than 64 characters. You pick the - * RuntimeConfig resource name, but the server will validate that the name - * adheres to this format. After you create the resource, you cannot change - * the resource's name. + * Associates `members` with a `role`. */ - name: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * A Cardinality condition for the Waiter resource. A cardinality condition is + * met when the number of variables under a specified path prefix reaches a + * predefined number. For example, if you set a Cardinality condition where + * the `path` is set to `/foo` and the number of paths is set to 2, the + * following variables would meet the condition in a RuntimeConfig resource: + * + `/foo/variable1 = "value1"` + `/foo/variable2 = + * "value2"` + `/bar/variable3 = "value3"` It would not + * would not satisify the same condition with the `number` set to 3, however, + * because there is only 2 paths that start with `/foo`. Cardinality + * conditions are recursive; all subtrees under the specific path prefix are + * counted. */ - message: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$Cardinality { + /** + * The number variables under the `path` that must exist to meet this + * condition. Defaults to 1 if not specified. + */ + number: number; + /** + * The root of the variable subtree to monitor. For example, `/foo`. + */ + path: string; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$Empty {} /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * The condition that a Waiter resource is waiting for. */ - permissions: string[]; -} -/** - * Describes a single variable within a RuntimeConfig resource. The name denotes - * the hierarchical variable name. For example, `ports/serving_port` is a valid - * variable name. The variable value is an opaque string and only leaf variables - * can have values (that is, variables that do not have any child variables). - */ -export interface Schema$Variable { + export interface Schema$EndCondition { + /** + * The cardinality of the `EndCondition`. + */ + cardinality: Schema$Cardinality; + } /** - * The name of the variable resource, in the format: - * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME] The - * `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a valid - * RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system file - * path naming. The `[VARIABLE_NAME]` can contain ASCII letters, numbers, - * slashes and dashes. Slashes are used as path element separators and are not - * part of the `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at - * least one non-slash character. Multiple slashes are coalesced into single - * slash character. Each path segment should match - * [0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])? regular expression. The - * length of a `[VARIABLE_NAME]` must be less than 256 characters. Once you - * create a variable, you cannot change the variable name. + * `ListConfigs()` returns the following response. The order of returned + * objects is arbitrary; that is, it is not ordered in any particular way. */ - name: string; + export interface Schema$ListConfigsResponse { + /** + * A list of the configurations in the project. The order of returned + * objects is arbitrary; that is, it is not ordered in any particular way. + */ + configs: Schema$RuntimeConfig[]; + /** + * This token allows you to get the next page of results for list requests. + * If the number of results is larger than `pageSize`, use the + * `nextPageToken` as a value for the query parameter `pageToken` in the + * next list request. Subsequent list requests will have their own + * `nextPageToken` to continue paging through the results + */ + nextPageToken: string; + } /** - * [Ouput only] The current state of the variable. The variable state - * indicates the outcome of the `variables().watch` call and is visible - * through the `get` and `list` calls. + * Response for the `ListVariables()` method. */ - state: string; + export interface Schema$ListVariablesResponse { + /** + * This token allows you to get the next page of results for list requests. + * If the number of results is larger than `pageSize`, use the + * `nextPageToken` as a value for the query parameter `pageToken` in the + * next list request. Subsequent list requests will have their own + * `nextPageToken` to continue paging through the results + */ + nextPageToken: string; + /** + * A list of variables and their values. The order of returned variable + * objects is arbitrary. + */ + variables: Schema$Variable[]; + } /** - * The string value of the variable. The length of the value must be less than - * 4096 bytes. Empty values are also accepted. For example, `text: "my - * text value"`. The string must be valid UTF-8. + * Response for the `ListWaiters()` method. Order of returned waiter objects + * is arbitrary. */ - text: string; + export interface Schema$ListWaitersResponse { + /** + * This token allows you to get the next page of results for list requests. + * If the number of results is larger than `pageSize`, use the + * `nextPageToken` as a value for the query parameter `pageToken` in the + * next list request. Subsequent list requests will have their own + * `nextPageToken` to continue paging through the results + */ + nextPageToken: string; + /** + * Found waiters in the project. + */ + waiters: Schema$Waiter[]; + } /** - * Output only. The time of the last variable update. + * This resource represents a long-running operation that is the result of a + * network API call. */ - updateTime: string; + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The binary value of the variable. The length of the value must be less than - * 4096 bytes. Empty values are also accepted. The value must be base64 - * encoded. Only one of `value` or `text` can be set. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). */ - value: string; -} -/** - * A Waiter resource waits for some end condition within a RuntimeConfig - * resource to be met before it returns. For example, assume you have a - * distributed system where each node writes to a Variable resource indidicating - * the node's readiness as part of the startup process. You then configure - * a Waiter resource with the success condition set to wait until some number of - * nodes have checked in. Afterwards, your application runs some arbitrary code - * after the condition has been met and the waiter returns successfully. Once - * created, a Waiter resource is immutable. To learn more about using waiters, - * read the [Creating a - * Waiter](/deployment-manager/runtime-configurator/creating-a-waiter) - * documentation. - */ -export interface Schema$Waiter { + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * Output only. The instant at which this Waiter resource was created. Adding - * the value of `timeout` to this instant yields the timeout deadline for the - * waiter. + * A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig + * service. A RuntimeConfig resource consists of metadata and a hierarchy of + * variables. */ - createTime: string; + export interface Schema$RuntimeConfig { + /** + * An optional description of the RuntimeConfig object. + */ + description: string; + /** + * The resource name of a runtime config. The name must have the format: + * projects/[PROJECT_ID]/configs/[CONFIG_NAME] The `[PROJECT_ID]` must be a + * valid project ID, and `[CONFIG_NAME]` is an arbitrary name that matches + * the `[0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])?` regular + * expression. The length of `[CONFIG_NAME]` must be less than 64 + * characters. You pick the RuntimeConfig resource name, but the server + * will validate that the name adheres to this format. After you create the + * resource, you cannot change the resource's name. + */ + name: string; + } /** - * Output only. If the value is `false`, it means the waiter is still waiting - * for one of its conditions to be met. If true, the waiter has finished. If - * the waiter finished due to a timeout or failure, `error` will be set. + * Request message for `SetIamPolicy` method. */ - done: boolean; + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + } /** - * Output only. If the waiter ended due to a failure or timeout, this value - * will be set. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - error: Schema$Status; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * [Optional] The failure condition of this waiter. If this condition is met, - * `done` will be set to `true` and the `error` code will be set to `ABORTED`. - * The failure condition takes precedence over the success condition. If both - * conditions are met, a failure will be indicated. This value is optional; if - * no failure condition is set, the only failure scenario will be a timeout. + * Request message for `TestIamPermissions` method. */ - failure: Schema$EndCondition; + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * The name of the Waiter resource, in the format: - * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] The - * `[PROJECT_ID]` must be a valid Google Cloud project ID, the `[CONFIG_NAME]` - * must be a valid RuntimeConfig resource, the `[WAITER_NAME]` must match RFC - * 1035 segment specification, and the length of `[WAITER_NAME]` must be less - * than 64 bytes. After you create a Waiter resource, you cannot change the - * resource name. + * Response message for `TestIamPermissions` method. */ - name: string; + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; + } /** - * [Required] The success condition. If this condition is met, `done` will be - * set to `true` and the `error` value will remain unset. The failure - * condition takes precedence over the success condition. If both conditions - * are met, a failure will be indicated. + * Describes a single variable within a RuntimeConfig resource. The name + * denotes the hierarchical variable name. For example, `ports/serving_port` + * is a valid variable name. The variable value is an opaque string and only + * leaf variables can have values (that is, variables that do not have any + * child variables). */ - success: Schema$EndCondition; + export interface Schema$Variable { + /** + * The name of the variable resource, in the format: + * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME] The + * `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a + * valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file + * system file path naming. The `[VARIABLE_NAME]` can contain ASCII + * letters, numbers, slashes and dashes. Slashes are used as path element + * separators and are not part of the `[VARIABLE_NAME]` itself, so + * `[VARIABLE_NAME]` must contain at least one non-slash character. Multiple + * slashes are coalesced into single slash character. Each path segment + * should match [0-9A-Za-z](?:[_.A-Za-z0-9-]{0,62}[_.A-Za-z0-9])? regular + * expression. The length of a `[VARIABLE_NAME]` must be less than 256 + * characters. Once you create a variable, you cannot change the variable + * name. + */ + name: string; + /** + * [Ouput only] The current state of the variable. The variable state + * indicates the outcome of the `variables().watch` call and is visible + * through the `get` and `list` calls. + */ + state: string; + /** + * The string value of the variable. The length of the value must be less + * than 4096 bytes. Empty values are also accepted. For example, `text: + * "my text value"`. The string must be valid UTF-8. + */ + text: string; + /** + * Output only. The time of the last variable update. + */ + updateTime: string; + /** + * The binary value of the variable. The length of the value must be less + * than 4096 bytes. Empty values are also accepted. The value must be base64 + * encoded. Only one of `value` or `text` can be set. + */ + value: string; + } /** - * [Required] Specifies the timeout of the waiter in seconds, beginning from - * the instant that `waiters().create` method is called. If this time elapses - * before the success or failure conditions are met, the waiter fails and sets - * the `error` code to `DEADLINE_EXCEEDED`. + * A Waiter resource waits for some end condition within a RuntimeConfig + * resource to be met before it returns. For example, assume you have a + * distributed system where each node writes to a Variable resource + * indidicating the node's readiness as part of the startup process. You + * then configure a Waiter resource with the success condition set to wait + * until some number of nodes have checked in. Afterwards, your application + * runs some arbitrary code after the condition has been met and the waiter + * returns successfully. Once created, a Waiter resource is immutable. To + * learn more about using waiters, read the [Creating a + * Waiter](/deployment-manager/runtime-configurator/creating-a-waiter) + * documentation. */ - timeout: string; -} -/** - * Request for the `WatchVariable()` method. - */ -export interface Schema$WatchVariableRequest { + export interface Schema$Waiter { + /** + * Output only. The instant at which this Waiter resource was created. + * Adding the value of `timeout` to this instant yields the timeout deadline + * for the waiter. + */ + createTime: string; + /** + * Output only. If the value is `false`, it means the waiter is still + * waiting for one of its conditions to be met. If true, the waiter has + * finished. If the waiter finished due to a timeout or failure, `error` + * will be set. + */ + done: boolean; + /** + * Output only. If the waiter ended due to a failure or timeout, this value + * will be set. + */ + error: Schema$Status; + /** + * [Optional] The failure condition of this waiter. If this condition is + * met, `done` will be set to `true` and the `error` code will be set to + * `ABORTED`. The failure condition takes precedence over the success + * condition. If both conditions are met, a failure will be indicated. This + * value is optional; if no failure condition is set, the only failure + * scenario will be a timeout. + */ + failure: Schema$EndCondition; + /** + * The name of the Waiter resource, in the format: + * projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME] The + * `[PROJECT_ID]` must be a valid Google Cloud project ID, the + * `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the + * `[WAITER_NAME]` must match RFC 1035 segment specification, and the length + * of `[WAITER_NAME]` must be less than 64 bytes. After you create a Waiter + * resource, you cannot change the resource name. + */ + name: string; + /** + * [Required] The success condition. If this condition is met, `done` will + * be set to `true` and the `error` value will remain unset. The failure + * condition takes precedence over the success condition. If both conditions + * are met, a failure will be indicated. + */ + success: Schema$EndCondition; + /** + * [Required] Specifies the timeout of the waiter in seconds, beginning from + * the instant that `waiters().create` method is called. If this time + * elapses before the success or failure conditions are met, the waiter + * fails and sets the `error` code to `DEADLINE_EXCEEDED`. + */ + timeout: string; + } /** - * If specified, checks the current timestamp of the variable and if the - * current timestamp is newer than `newerThan` timestamp, the method returns - * immediately. If not specified or the variable has an older timestamp, the - * watcher waits for a the value to change before returning. + * Request for the `WatchVariable()` method. */ - newerThan: string; -} - -export class Resource$Projects { - root: Runtimeconfig; - configs: Resource$Projects$Configs; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - this.configs = new Resource$Projects$Configs(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Configs { - root: Runtimeconfig; - operations: Resource$Projects$Configs$Operations; - variables: Resource$Projects$Configs$Variables; - waiters: Resource$Projects$Configs$Waiters; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Projects$Configs$Operations(root); - this.variables = new Resource$Projects$Configs$Variables(root); - this.waiters = new Resource$Projects$Configs$Waiters(root); - } - - getRoot() { - return this.root; + export interface Schema$WatchVariableRequest { + /** + * If specified, checks the current timestamp of the variable and if the + * current timestamp is newer than `newerThan` timestamp, the method returns + * immediately. If not specified or the variable has an older timestamp, + * the watcher waits for a the value to change before returning. + */ + newerThan: string; } + export class Resource$Projects { + root: Runtimeconfig; + configs: Resource$Projects$Configs; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); + this.configs = new Resource$Projects$Configs(root); + } - /** - * runtimeconfig.projects.configs.create - * @desc Creates a new RuntimeConfig resource. The configuration name must be - * unique within project. - * @alias runtimeconfig.projects.configs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) for this request, in the format `projects/[PROJECT_ID]`. - * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. - * @param {().RuntimeConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Configs { + root: Runtimeconfig; + operations: Resource$Projects$Configs$Operations; + variables: Resource$Projects$Configs$Variables; + waiters: Resource$Projects$Configs$Waiters; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Projects$Configs$Operations(root); + this.variables = new Resource$Projects$Configs$Variables(root); + this.waiters = new Resource$Projects$Configs$Waiters(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/configs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * runtimeconfig.projects.configs.delete - * @desc Deletes a RuntimeConfig resource. - * @alias runtimeconfig.projects.configs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The RuntimeConfig resource to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * runtimeconfig.projects.configs.create + * @desc Creates a new RuntimeConfig resource. The configuration name must + * be unique within project. + * @alias runtimeconfig.projects.configs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) for this request, in the format `projects/[PROJECT_ID]`. + * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. + * @param {().RuntimeConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/configs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * runtimeconfig.projects.configs.get - * @desc Gets information about a RuntimeConfig resource. - * @alias runtimeconfig.projects.configs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the RuntimeConfig resource to retrieve, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.projects.configs.delete + * @desc Deletes a RuntimeConfig resource. + * @alias runtimeconfig.projects.configs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The RuntimeConfig resource to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias runtimeconfig.projects.configs.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.get + * @desc Gets information about a RuntimeConfig resource. + * @alias runtimeconfig.projects.configs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the RuntimeConfig resource to retrieve, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.list - * @desc Lists all the RuntimeConfig resources within project. - * @alias runtimeconfig.projects.configs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. - * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. - * @param {string} params.parent The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) for this request, in the format `projects/[PROJECT_ID]`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/configs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * runtimeconfig.projects.configs.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias runtimeconfig.projects.configs.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * runtimeconfig.projects.configs.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias runtimeconfig.projects.configs.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.projects.configs.list + * @desc Lists all the RuntimeConfig resources within project. + * @alias runtimeconfig.projects.configs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. + * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} params.parent The [project ID](https://support.google.com/cloud/answer/6158840?hl=en&ref_topic=6158848) for this request, in the format `projects/[PROJECT_ID]`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/configs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias runtimeconfig.projects.configs.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * runtimeconfig.projects.configs.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias runtimeconfig.projects.configs.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * runtimeconfig.projects.configs.update - * @desc Updates a RuntimeConfig resource. The configuration must exist - * beforehand. - * @alias runtimeconfig.projects.configs.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the RuntimeConfig resource to update, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {().RuntimeConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias runtimeconfig.projects.configs.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Configs$Operations { - root: Runtimeconfig; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * runtimeconfig.projects.configs.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias runtimeconfig.projects.configs.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.projects.configs.update + * @desc Updates a RuntimeConfig resource. The configuration must exist + * beforehand. + * @alias runtimeconfig.projects.configs.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the RuntimeConfig resource to update, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {().RuntimeConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Configs$Operations { + root: Runtimeconfig; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * runtimeconfig.projects.configs.operations.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias runtimeconfig.projects.configs.operations.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias runtimeconfig.projects.configs.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Configs$Variables { - root: Runtimeconfig; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * runtimeconfig.projects.configs.operations.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias runtimeconfig.projects.configs.operations.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * runtimeconfig.projects.configs.variables.create - * @desc Creates a variable within the given configuration. You cannot create - * a variable with a name that is a prefix of an existing variable name, or a - * name that has an existing variable name as a prefix. To learn more about - * creating a variable, read the [Setting and Getting - * Data](/deployment-manager/runtime-configurator/set-and-get-variables) - * documentation. - * @alias runtimeconfig.projects.configs.variables.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The path to the RutimeConfig resource that this variable should belong to. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Configs$Variables { + root: Runtimeconfig; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * runtimeconfig.projects.configs.variables.delete - * @desc Deletes a variable or multiple variables. If you specify a variable - * name, then that variable is deleted. If you specify a prefix and - * `recursive` is true, then all variables with that prefix are deleted. You - * must set a `recursive` to true if you delete variables by prefix. - * @alias runtimeconfig.projects.configs.variables.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the variable to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - * @param {boolean=} params.recursive Set to `true` to recursively delete multiple variables with the same prefix. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.variables.create + * @desc Creates a variable within the given configuration. You cannot + * create a variable with a name that is a prefix of an existing variable + * name, or a name that has an existing variable name as a prefix. To learn + * more about creating a variable, read the [Setting and Getting + * Data](/deployment-manager/runtime-configurator/set-and-get-variables) + * documentation. + * @alias runtimeconfig.projects.configs.variables.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The path to the RutimeConfig resource that this variable should belong to. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.variables.get - * @desc Gets information about a single variable. - * @alias runtimeconfig.projects.configs.variables.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the variable to return, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.variables.delete + * @desc Deletes a variable or multiple variables. If you specify a + * variable name, then that variable is deleted. If you specify a prefix and + * `recursive` is true, then all variables with that prefix are deleted. You + * must set a `recursive` to true if you delete variables by prefix. + * @alias runtimeconfig.projects.configs.variables.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the variable to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + * @param {boolean=} params.recursive Set to `true` to recursively delete multiple variables with the same prefix. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.variables.list - * @desc Lists variables within given a configuration, matching any provided - * filters. This only lists variable names, not the values, unless - * `return_values` is true, in which case only variables that user has IAM - * permission to GetVariable will be returned. - * @alias runtimeconfig.projects.configs.variables.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Filters variables by matching the specified filter. For example: `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. - * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. - * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. - * @param {string} params.parent The path to the RuntimeConfig resource for which you want to list variables. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {boolean=} params.returnValues The flag indicates whether the user wants to return values of variables. If true, then only those variables that user has IAM GetVariable permission will be returned along with their values. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.projects.configs.variables.get + * @desc Gets information about a single variable. + * @alias runtimeconfig.projects.configs.variables.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the variable to return, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIBLE_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.variables.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias runtimeconfig.projects.configs.variables.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.variables.list + * @desc Lists variables within given a configuration, matching any provided + * filters. This only lists variable names, not the values, unless + * `return_values` is true, in which case only variables that user has IAM + * permission to GetVariable will be returned. + * @alias runtimeconfig.projects.configs.variables.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Filters variables by matching the specified filter. For example: `projects/example-project/config/[CONFIG_NAME]/variables/example-variable`. + * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. + * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} params.parent The path to the RuntimeConfig resource for which you want to list variables. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {boolean=} params.returnValues The flag indicates whether the user wants to return values of variables. If true, then only those variables that user has IAM GetVariable permission will be returned along with their values. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.variables.update - * @desc Updates an existing variable with a new value. - * @alias runtimeconfig.projects.configs.variables.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the variable to update, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.variables.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias runtimeconfig.projects.configs.variables.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.variables.watch - * @desc Watches a specific variable and waits for a change in the variable's - * value. When there is a change, this method returns the new value or times - * out. If a variable is deleted while being watched, the `variableState` - * state is set to `DELETED` and the method returns the last known variable - * `value`. If you set the deadline for watching to a larger value than - * internal timeout (60 seconds), the current variable value is returned and - * the `variableState` will be `VARIABLE_STATE_UNSPECIFIED`. To learn more - * about creating a watcher, read the [Watching a Variable for - * Changes](/deployment-manager/runtime-configurator/watching-a-variable) - * documentation. - * @alias runtimeconfig.projects.configs.variables.watch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the variable to watch, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {().WatchVariableRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watch(params?: any, options?: MethodOptions): AxiosPromise; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * runtimeconfig.projects.configs.variables.update + * @desc Updates an existing variable with a new value. + * @alias runtimeconfig.projects.configs.variables.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the variable to update, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]` + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Configs$Waiters { - root: Runtimeconfig; - constructor(root: Runtimeconfig) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * runtimeconfig.projects.configs.variables.watch + * @desc Watches a specific variable and waits for a change in the + * variable's value. When there is a change, this method returns the new + * value or times out. If a variable is deleted while being watched, the + * `variableState` state is set to `DELETED` and the method returns the last + * known variable `value`. If you set the deadline for watching to a larger + * value than internal timeout (60 seconds), the current variable value is + * returned and the `variableState` will be `VARIABLE_STATE_UNSPECIFIED`. To + * learn more about creating a watcher, read the [Watching a Variable for + * Changes](/deployment-manager/runtime-configurator/watching-a-variable) + * documentation. + * @alias runtimeconfig.projects.configs.variables.watch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the variable to watch, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {().WatchVariableRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watch(params?: any, options?: MethodOptions): AxiosPromise; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * runtimeconfig.projects.configs.waiters.create - * @desc Creates a Waiter resource. This operation returns a long-running - * Operation resource which can be polled for completion. However, a waiter - * with the given name will exist (and can be retrieved) prior to the - * operation completing. If the operation fails, the failed Waiter resource - * will still exist and must be deleted prior to subsequent creation attempts. - * @alias runtimeconfig.projects.configs.waiters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The path to the configuration that will own the waiter. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. - * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. - * @param {().Waiter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Configs$Waiters { + root: Runtimeconfig; + constructor(root: Runtimeconfig) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/waiters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * runtimeconfig.projects.configs.waiters.delete - * @desc Deletes the waiter with the specified name. - * @alias runtimeconfig.projects.configs.waiters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The Waiter resource to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * runtimeconfig.projects.configs.waiters.create + * @desc Creates a Waiter resource. This operation returns a long-running + * Operation resource which can be polled for completion. However, a waiter + * with the given name will exist (and can be retrieved) prior to the + * operation completing. If the operation fails, the failed Waiter resource + * will still exist and must be deleted prior to subsequent creation + * attempts. + * @alias runtimeconfig.projects.configs.waiters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The path to the configuration that will own the waiter. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]`. + * @param {string=} params.requestId An optional but recommended unique `request_id`. If the server receives two `create()` requests with the same `request_id`, then the second request will be ignored and the first resource created and stored in the backend is returned. Empty `request_id` fields are ignored. It is responsibility of the client to ensure uniqueness of the `request_id` strings. `request_id` strings are limited to 64 characters. + * @param {().Waiter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/waiters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.waiters.get - * @desc Gets information about a single waiter. - * @alias runtimeconfig.projects.configs.waiters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The fully-qualified name of the Waiter resource object to retrieve, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.waiters.delete + * @desc Deletes the waiter with the specified name. + * @alias runtimeconfig.projects.configs.waiters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The Waiter resource to delete, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.waiters.list - * @desc List waiters within the given configuration. - * @alias runtimeconfig.projects.configs.waiters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. - * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. - * @param {string} params.parent The path to the configuration for which you want to get a list of waiters. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.waiters.get + * @desc Gets information about a single waiter. + * @alias runtimeconfig.projects.configs.waiters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The fully-qualified name of the Waiter resource object to retrieve, in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/waiters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * runtimeconfig.projects.configs.waiters.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias runtimeconfig.projects.configs.waiters.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * runtimeconfig.projects.configs.waiters.list + * @desc List waiters within the given configuration. + * @alias runtimeconfig.projects.configs.waiters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Specifies the number of results to return per page. If there are fewer elements than the specified number, returns all elements. + * @param {string=} params.pageToken Specifies a page token to use. Set `pageToken` to a `nextPageToken` returned by a previous list request to get the next page of results. + * @param {string} params.parent The path to the configuration for which you want to get a list of waiters. The configuration must exist beforehand; the path must be in the format: `projects/[PROJECT_ID]/configs/[CONFIG_NAME]` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/waiters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://runtimeconfig.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * runtimeconfig.projects.configs.waiters.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias runtimeconfig.projects.configs.waiters.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://runtimeconfig.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/safebrowsing/v4.ts b/src/apis/safebrowsing/v4.ts index cd26f653fd6..ce26fcbaa46 100644 --- a/src/apis/safebrowsing/v4.ts +++ b/src/apis/safebrowsing/v4.ts @@ -27,1017 +27,1029 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Safe Browsing API - * - * Enables client applications to check web resources (most commonly URLs) - * against Google-generated lists of unsafe web resources. - * - * @example - * const google = require('googleapis'); - * const safebrowsing = google.safebrowsing('v4'); - * - * @namespace safebrowsing - * @type {Function} - * @version v4 - * @variation v4 - * @param {object=} options Options for Safebrowsing - */ -export class Safebrowsing { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace safebrowsing_v4 { + /** + * Safe Browsing API + * + * Enables client applications to check web resources (most commonly URLs) + * against Google-generated lists of unsafe web resources. + * + * @example + * const google = require('googleapis'); + * const safebrowsing = google.safebrowsing('v4'); + * + * @namespace safebrowsing + * @type {Function} + * @version v4 + * @variation v4 + * @param {object=} options Options for Safebrowsing + */ + export class Safebrowsing { + _options: GlobalOptions; + google: GoogleApis; + root = this; - encodedFullHashes: Resource$Encodedfullhashes; - encodedUpdates: Resource$Encodedupdates; - fullHashes: Resource$Fullhashes; - threatHits: Resource$Threathits; - threatLists: Resource$Threatlists; - threatListUpdates: Resource$Threatlistupdates; - threatMatches: Resource$Threatmatches; + encodedFullHashes: Resource$Encodedfullhashes; + encodedUpdates: Resource$Encodedupdates; + fullHashes: Resource$Fullhashes; + threatHits: Resource$Threathits; + threatLists: Resource$Threatlists; + threatListUpdates: Resource$Threatlistupdates; + threatMatches: Resource$Threatmatches; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.encodedFullHashes = new Resource$Encodedfullhashes(this); - this.encodedUpdates = new Resource$Encodedupdates(this); - this.fullHashes = new Resource$Fullhashes(this); - this.threatHits = new Resource$Threathits(this); - this.threatLists = new Resource$Threatlists(this); - this.threatListUpdates = new Resource$Threatlistupdates(this); - this.threatMatches = new Resource$Threatmatches(this); - } + this.encodedFullHashes = new Resource$Encodedfullhashes(this); + this.encodedUpdates = new Resource$Encodedupdates(this); + this.fullHashes = new Resource$Fullhashes(this); + this.threatHits = new Resource$Threathits(this); + this.threatLists = new Resource$Threatlists(this); + this.threatListUpdates = new Resource$Threatlistupdates(this); + this.threatMatches = new Resource$Threatmatches(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The expected state of a client's local database. - */ -export interface Schema$Checksum { - /** - * The SHA256 hash of the client state; that is, of the sorted list of all - * hashes present in the database. - */ - sha256: string; -} -/** - * The client metadata associated with Safe Browsing API requests. - */ -export interface Schema$ClientInfo { - /** - * A client ID that (hopefully) uniquely identifies the client implementation - * of the Safe Browsing API. - */ - clientId: string; - /** - * The version of the client implementation. - */ - clientVersion: string; -} -/** - * The constraints for this update. - */ -export interface Schema$Constraints { - /** - * A client's physical location, expressed as a ISO 31166-1 alpha-2 region - * code. - */ - deviceLocation: string; - /** - * Requests the lists for a specific language. Expects ISO 639 alpha-2 format. - */ - language: string; - /** - * Sets the maximum number of entries that the client is willing to have in - * the local database. This should be a power of 2 between 2**10 and 2**20. If - * zero, no database size limit is set. - */ - maxDatabaseEntries: number; - /** - * The maximum size in number of entries. The update will not contain more - * entries than this value. This should be a power of 2 between 2**10 and - * 2**20. If zero, no update size limit is set. - */ - maxUpdateEntries: number; - /** - * Requests the list for a specific geographic location. If not set the server - * may pick that value based on the user's IP address. Expects ISO 3166-1 - * alpha-2 format. - */ - region: string; - /** - * The compression types supported by the client. - */ - supportedCompressions: string[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Describes a Safe Browsing API update request. Clients can request updates for - * multiple lists in a single request. NOTE: Field index 2 is unused. NEXT: 5 - */ -export interface Schema$FetchThreatListUpdatesRequest { - /** - * The client metadata. - */ - client: Schema$ClientInfo; - /** - * The requested threat list updates. - */ - listUpdateRequests: Schema$ListUpdateRequest[]; -} -export interface Schema$FetchThreatListUpdatesResponse { /** - * The list updates requested by the clients. + * The expected state of a client's local database. */ - listUpdateResponses: Schema$ListUpdateResponse[]; - /** - * The minimum duration the client must wait before issuing any update - * request. If this field is not set clients may update as soon as they want. - */ - minimumWaitDuration: string; -} -/** - * Request to return full hashes matched by the provided hash prefixes. - */ -export interface Schema$FindFullHashesRequest { - /** - * Client metadata associated with callers of higher-level APIs built on top - * of the client's implementation. - */ - apiClient: Schema$ClientInfo; - /** - * The client metadata. - */ - client: Schema$ClientInfo; - /** - * The current client states for each of the client's local threat lists. - */ - clientStates: string[]; - /** - * The lists and hashes to be checked. - */ - threatInfo: Schema$ThreatInfo; -} -export interface Schema$FindFullHashesResponse { - /** - * The full hashes that matched the requested prefixes. - */ - matches: Schema$ThreatMatch[]; - /** - * The minimum duration the client must wait before issuing any find hashes - * request. If this field is not set, clients can issue a request as soon as - * they want. - */ - minimumWaitDuration: string; - /** - * For requested entities that did not match the threat list, how long to - * cache the response. - */ - negativeCacheDuration: string; -} -/** - * Request to check entries against lists. - */ -export interface Schema$FindThreatMatchesRequest { - /** - * The client metadata. - */ - client: Schema$ClientInfo; - /** - * The lists and entries to be checked for matches. - */ - threatInfo: Schema$ThreatInfo; -} -export interface Schema$FindThreatMatchesResponse { - /** - * The threat list matches. - */ - matches: Schema$ThreatMatch[]; -} -export interface Schema$ListThreatListsResponse { - /** - * The lists available for download by the client. - */ - threatLists: Schema$ThreatListDescriptor[]; -} -/** - * A single list update request. - */ -export interface Schema$ListUpdateRequest { - /** - * The constraints associated with this request. - */ - constraints: Schema$Constraints; - /** - * The type of platform at risk by entries present in the list. - */ - platformType: string; - /** - * The current state of the client for the requested list (the encrypted - * client state that was received from the last successful list update). - */ - state: string; - /** - * The types of entries present in the list. - */ - threatEntryType: string; - /** - * The type of threat posed by entries present in the list. - */ - threatType: string; -} -/** - * An update to an individual list. - */ -export interface Schema$ListUpdateResponse { - /** - * A set of entries to add to a local threat type's list. Repeated to - * allow for a combination of compressed and raw data to be sent in a single - * response. - */ - additions: Schema$ThreatEntrySet[]; - /** - * The expected SHA256 hash of the client state; that is, of the sorted list - * of all hashes present in the database after applying the provided update. - * If the client state doesn't match the expected state, the client must - * disregard this update and retry later. - */ - checksum: Schema$Checksum; - /** - * The new client state, in encrypted format. Opaque to clients. - */ - newClientState: string; - /** - * The platform type for which data is returned. - */ - platformType: string; - /** - * A set of entries to remove from a local threat type's list. In - * practice, this field is empty or contains exactly one ThreatEntrySet. - */ - removals: Schema$ThreatEntrySet[]; - /** - * The type of response. This may indicate that an action is required by the - * client when the response is received. - */ - responseType: string; - /** - * The format of the threats. - */ - threatEntryType: string; - /** - * The threat type for which data is returned. - */ - threatType: string; -} -/** - * A single metadata entry. - */ -export interface Schema$MetadataEntry { - /** - * The metadata entry key. For JSON requests, the key is base64-encoded. - */ - key: string; - /** - * The metadata entry value. For JSON requests, the value is base64-encoded. - */ - value: string; -} -/** - * The uncompressed threat entries in hash format of a particular prefix length. - * Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 - * bytes, but some hashes are lengthened if they collide with the hash of a - * popular URL. Used for sending ThreatEntrySet to clients that do not support - * compression, or when sending non-4-byte hashes to clients that do support - * compression. - */ -export interface Schema$RawHashes { - /** - * The number of bytes for each prefix encoded below. This field can be - * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). - */ - prefixSize: number; - /** - * The hashes, in binary format, concatenated into one long string. Hashes are - * sorted in lexicographic order. For JSON API users, hashes are - * base64-encoded. - */ - rawHashes: string; -} -/** - * A set of raw indices to remove from a local list. - */ -export interface Schema$RawIndices { - /** - * The indices to remove from a lexicographically-sorted local list. - */ - indices: number[]; -} -/** - * The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or - * compressed removal indices. - */ -export interface Schema$RiceDeltaEncoding { + export interface Schema$Checksum { + /** + * The SHA256 hash of the client state; that is, of the sorted list of all + * hashes present in the database. + */ + sha256: string; + } /** - * The encoded deltas that are encoded using the Golomb-Rice coder. - */ - encodedData: string; + * The client metadata associated with Safe Browsing API requests. + */ + export interface Schema$ClientInfo { + /** + * A client ID that (hopefully) uniquely identifies the client + * implementation of the Safe Browsing API. + */ + clientId: string; + /** + * The version of the client implementation. + */ + clientVersion: string; + } /** - * The offset of the first entry in the encoded data, or, if only a single - * integer was encoded, that single integer's value. If the field is empty - * or missing, assume zero. - */ - firstValue: string; + * The constraints for this update. + */ + export interface Schema$Constraints { + /** + * A client's physical location, expressed as a ISO 31166-1 alpha-2 + * region code. + */ + deviceLocation: string; + /** + * Requests the lists for a specific language. Expects ISO 639 alpha-2 + * format. + */ + language: string; + /** + * Sets the maximum number of entries that the client is willing to have in + * the local database. This should be a power of 2 between 2**10 and 2**20. + * If zero, no database size limit is set. + */ + maxDatabaseEntries: number; + /** + * The maximum size in number of entries. The update will not contain more + * entries than this value. This should be a power of 2 between 2**10 and + * 2**20. If zero, no update size limit is set. + */ + maxUpdateEntries: number; + /** + * Requests the list for a specific geographic location. If not set the + * server may pick that value based on the user's IP address. Expects + * ISO 3166-1 alpha-2 format. + */ + region: string; + /** + * The compression types supported by the client. + */ + supportedCompressions: string[]; + } /** - * The number of entries that are delta encoded in the encoded data. If only a - * single integer was encoded, this will be zero and the single value will be - * stored in `first_value`. - */ - numEntries: number; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Describes a Safe Browsing API update request. Clients can request updates + * for multiple lists in a single request. NOTE: Field index 2 is unused. + * NEXT: 5 + */ + export interface Schema$FetchThreatListUpdatesRequest { + /** + * The client metadata. + */ + client: Schema$ClientInfo; + /** + * The requested threat list updates. + */ + listUpdateRequests: Schema$ListUpdateRequest[]; + } + export interface Schema$FetchThreatListUpdatesResponse { + /** + * The list updates requested by the clients. + */ + listUpdateResponses: Schema$ListUpdateResponse[]; + /** + * The minimum duration the client must wait before issuing any update + * request. If this field is not set clients may update as soon as they + * want. + */ + minimumWaitDuration: string; + } /** - * The Golomb-Rice parameter, which is a number between 2 and 28. This field - * is missing (that is, zero) if `num_entries` is zero. - */ - riceParameter: number; -} -/** - * An individual threat; for example, a malicious URL or its hash - * representation. Only one of these fields should be set. - */ -export interface Schema$ThreatEntry { + * Request to return full hashes matched by the provided hash prefixes. + */ + export interface Schema$FindFullHashesRequest { + /** + * Client metadata associated with callers of higher-level APIs built on top + * of the client's implementation. + */ + apiClient: Schema$ClientInfo; + /** + * The client metadata. + */ + client: Schema$ClientInfo; + /** + * The current client states for each of the client's local threat + * lists. + */ + clientStates: string[]; + /** + * The lists and hashes to be checked. + */ + threatInfo: Schema$ThreatInfo; + } + export interface Schema$FindFullHashesResponse { + /** + * The full hashes that matched the requested prefixes. + */ + matches: Schema$ThreatMatch[]; + /** + * The minimum duration the client must wait before issuing any find hashes + * request. If this field is not set, clients can issue a request as soon as + * they want. + */ + minimumWaitDuration: string; + /** + * For requested entities that did not match the threat list, how long to + * cache the response. + */ + negativeCacheDuration: string; + } /** - * The digest of an executable in SHA256 format. The API supports both binary - * and hex digests. For JSON requests, digests are base64-encoded. - */ - digest: string; + * Request to check entries against lists. + */ + export interface Schema$FindThreatMatchesRequest { + /** + * The client metadata. + */ + client: Schema$ClientInfo; + /** + * The lists and entries to be checked for matches. + */ + threatInfo: Schema$ThreatInfo; + } + export interface Schema$FindThreatMatchesResponse { + /** + * The threat list matches. + */ + matches: Schema$ThreatMatch[]; + } + export interface Schema$ListThreatListsResponse { + /** + * The lists available for download by the client. + */ + threatLists: Schema$ThreatListDescriptor[]; + } /** - * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - * hash. This field is in binary format. For JSON requests, hashes are - * base64-encoded. - */ - hash: string; + * A single list update request. + */ + export interface Schema$ListUpdateRequest { + /** + * The constraints associated with this request. + */ + constraints: Schema$Constraints; + /** + * The type of platform at risk by entries present in the list. + */ + platformType: string; + /** + * The current state of the client for the requested list (the encrypted + * client state that was received from the last successful list update). + */ + state: string; + /** + * The types of entries present in the list. + */ + threatEntryType: string; + /** + * The type of threat posed by entries present in the list. + */ + threatType: string; + } /** - * A URL. - */ - url: string; -} -/** - * The metadata associated with a specific threat entry. The client is expected - * to know the metadata key/value pairs associated with each threat type. - */ -export interface Schema$ThreatEntryMetadata { + * An update to an individual list. + */ + export interface Schema$ListUpdateResponse { + /** + * A set of entries to add to a local threat type's list. Repeated to + * allow for a combination of compressed and raw data to be sent in a single + * response. + */ + additions: Schema$ThreatEntrySet[]; + /** + * The expected SHA256 hash of the client state; that is, of the sorted list + * of all hashes present in the database after applying the provided update. + * If the client state doesn't match the expected state, the client must + * disregard this update and retry later. + */ + checksum: Schema$Checksum; + /** + * The new client state, in encrypted format. Opaque to clients. + */ + newClientState: string; + /** + * The platform type for which data is returned. + */ + platformType: string; + /** + * A set of entries to remove from a local threat type's list. In + * practice, this field is empty or contains exactly one ThreatEntrySet. + */ + removals: Schema$ThreatEntrySet[]; + /** + * The type of response. This may indicate that an action is required by the + * client when the response is received. + */ + responseType: string; + /** + * The format of the threats. + */ + threatEntryType: string; + /** + * The threat type for which data is returned. + */ + threatType: string; + } /** - * The metadata entries. - */ - entries: Schema$MetadataEntry[]; -} -/** - * A set of threats that should be added or removed from a client's local - * database. - */ -export interface Schema$ThreatEntrySet { + * A single metadata entry. + */ + export interface Schema$MetadataEntry { + /** + * The metadata entry key. For JSON requests, the key is base64-encoded. + */ + key: string; + /** + * The metadata entry value. For JSON requests, the value is base64-encoded. + */ + value: string; + } /** - * The compression type for the entries in this set. - */ - compressionType: string; + * The uncompressed threat entries in hash format of a particular prefix + * length. Hashes can be anywhere from 4 to 32 bytes in size. A large majority + * are 4 bytes, but some hashes are lengthened if they collide with the hash + * of a popular URL. Used for sending ThreatEntrySet to clients that do not + * support compression, or when sending non-4-byte hashes to clients that do + * support compression. + */ + export interface Schema$RawHashes { + /** + * The number of bytes for each prefix encoded below. This field can be + * anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). + */ + prefixSize: number; + /** + * The hashes, in binary format, concatenated into one long string. Hashes + * are sorted in lexicographic order. For JSON API users, hashes are + * base64-encoded. + */ + rawHashes: string; + } /** - * The raw SHA256-formatted entries. + * A set of raw indices to remove from a local list. */ - rawHashes: Schema$RawHashes; + export interface Schema$RawIndices { + /** + * The indices to remove from a lexicographically-sorted local list. + */ + indices: number[]; + } /** - * The raw removal indices for a local list. - */ - rawIndices: Schema$RawIndices; + * The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or + * compressed removal indices. + */ + export interface Schema$RiceDeltaEncoding { + /** + * The encoded deltas that are encoded using the Golomb-Rice coder. + */ + encodedData: string; + /** + * The offset of the first entry in the encoded data, or, if only a single + * integer was encoded, that single integer's value. If the field is + * empty or missing, assume zero. + */ + firstValue: string; + /** + * The number of entries that are delta encoded in the encoded data. If only + * a single integer was encoded, this will be zero and the single value will + * be stored in `first_value`. + */ + numEntries: number; + /** + * The Golomb-Rice parameter, which is a number between 2 and 28. This field + * is missing (that is, zero) if `num_entries` is zero. + */ + riceParameter: number; + } /** - * The encoded 4-byte prefixes of SHA256-formatted entries, using a - * Golomb-Rice encoding. The hashes are converted to uint32, sorted in - * ascending order, then delta encoded and stored as encoded_data. - */ - riceHashes: Schema$RiceDeltaEncoding; + * An individual threat; for example, a malicious URL or its hash + * representation. Only one of these fields should be set. + */ + export interface Schema$ThreatEntry { + /** + * The digest of an executable in SHA256 format. The API supports both + * binary and hex digests. For JSON requests, digests are base64-encoded. + */ + digest: string; + /** + * A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + * hash. This field is in binary format. For JSON requests, hashes are + * base64-encoded. + */ + hash: string; + /** + * A URL. + */ + url: string; + } /** - * The encoded local, lexicographically-sorted list indices, using a - * Golomb-Rice encoding. Used for sending compressed removal indices. The - * removal indices (uint32) are sorted in ascending order, then delta encoded - * and stored as encoded_data. + * The metadata associated with a specific threat entry. The client is + * expected to know the metadata key/value pairs associated with each threat + * type. */ - riceIndices: Schema$RiceDeltaEncoding; -} -export interface Schema$ThreatHit { + export interface Schema$ThreatEntryMetadata { + /** + * The metadata entries. + */ + entries: Schema$MetadataEntry[]; + } /** - * Client-reported identification. - */ - clientInfo: Schema$ClientInfo; + * A set of threats that should be added or removed from a client's local + * database. + */ + export interface Schema$ThreatEntrySet { + /** + * The compression type for the entries in this set. + */ + compressionType: string; + /** + * The raw SHA256-formatted entries. + */ + rawHashes: Schema$RawHashes; + /** + * The raw removal indices for a local list. + */ + rawIndices: Schema$RawIndices; + /** + * The encoded 4-byte prefixes of SHA256-formatted entries, using a + * Golomb-Rice encoding. The hashes are converted to uint32, sorted in + * ascending order, then delta encoded and stored as encoded_data. + */ + riceHashes: Schema$RiceDeltaEncoding; + /** + * The encoded local, lexicographically-sorted list indices, using a + * Golomb-Rice encoding. Used for sending compressed removal indices. The + * removal indices (uint32) are sorted in ascending order, then delta + * encoded and stored as encoded_data. + */ + riceIndices: Schema$RiceDeltaEncoding; + } + export interface Schema$ThreatHit { + /** + * Client-reported identification. + */ + clientInfo: Schema$ClientInfo; + /** + * The threat entry responsible for the hit. Full hash should be reported + * for hash-based hits. + */ + entry: Schema$ThreatEntry; + /** + * The platform type reported. + */ + platformType: string; + /** + * The resources related to the threat hit. + */ + resources: Schema$ThreatSource[]; + /** + * The threat type reported. + */ + threatType: string; + /** + * Details about the user that encountered the threat. + */ + userInfo: Schema$UserInfo; + } /** - * The threat entry responsible for the hit. Full hash should be reported for - * hash-based hits. - */ - entry: Schema$ThreatEntry; + * The information regarding one or more threats that a client submits when + * checking for matches in threat lists. + */ + export interface Schema$ThreatInfo { + /** + * The platform types to be checked. + */ + platformTypes: string[]; + /** + * The threat entries to be checked. + */ + threatEntries: Schema$ThreatEntry[]; + /** + * The entry types to be checked. + */ + threatEntryTypes: string[]; + /** + * The threat types to be checked. + */ + threatTypes: string[]; + } /** - * The platform type reported. - */ - platformType: string; + * Describes an individual threat list. A list is defined by three parameters: + * the type of threat posed, the type of platform targeted by the threat, and + * the type of entries in the list. + */ + export interface Schema$ThreatListDescriptor { + /** + * The platform type targeted by the list's entries. + */ + platformType: string; + /** + * The entry types contained in the list. + */ + threatEntryType: string; + /** + * The threat type posed by the list's entries. + */ + threatType: string; + } /** - * The resources related to the threat hit. - */ - resources: Schema$ThreatSource[]; + * A match when checking a threat entry in the Safe Browsing threat lists. + */ + export interface Schema$ThreatMatch { + /** + * The cache lifetime for the returned match. Clients must not cache this + * response for more than this duration to avoid false positives. + */ + cacheDuration: string; + /** + * The platform type matching this threat. + */ + platformType: string; + /** + * The threat matching this threat. + */ + threat: Schema$ThreatEntry; + /** + * Optional metadata associated with this threat. + */ + threatEntryMetadata: Schema$ThreatEntryMetadata; + /** + * The threat entry type matching this threat. + */ + threatEntryType: string; + /** + * The threat type matching this threat. + */ + threatType: string; + } /** - * The threat type reported. - */ - threatType: string; + * A single resource related to a threat hit. + */ + export interface Schema$ThreatSource { + /** + * Referrer of the resource. Only set if the referrer is available. + */ + referrer: string; + /** + * The remote IP of the resource in ASCII format. Either IPv4 or IPv6. + */ + remoteIp: string; + /** + * The type of source reported. + */ + type: string; + /** + * The URL of the resource. + */ + url: string; + } /** * Details about the user that encountered the threat. */ - userInfo: Schema$UserInfo; -} -/** - * The information regarding one or more threats that a client submits when - * checking for matches in threat lists. - */ -export interface Schema$ThreatInfo { - /** - * The platform types to be checked. - */ - platformTypes: string[]; - /** - * The threat entries to be checked. - */ - threatEntries: Schema$ThreatEntry[]; - /** - * The entry types to be checked. - */ - threatEntryTypes: string[]; - /** - * The threat types to be checked. - */ - threatTypes: string[]; -} -/** - * Describes an individual threat list. A list is defined by three parameters: - * the type of threat posed, the type of platform targeted by the threat, and - * the type of entries in the list. - */ -export interface Schema$ThreatListDescriptor { - /** - * The platform type targeted by the list's entries. - */ - platformType: string; - /** - * The entry types contained in the list. - */ - threatEntryType: string; - /** - * The threat type posed by the list's entries. - */ - threatType: string; -} -/** - * A match when checking a threat entry in the Safe Browsing threat lists. - */ -export interface Schema$ThreatMatch { - /** - * The cache lifetime for the returned match. Clients must not cache this - * response for more than this duration to avoid false positives. - */ - cacheDuration: string; - /** - * The platform type matching this threat. - */ - platformType: string; - /** - * The threat matching this threat. - */ - threat: Schema$ThreatEntry; - /** - * Optional metadata associated with this threat. - */ - threatEntryMetadata: Schema$ThreatEntryMetadata; - /** - * The threat entry type matching this threat. - */ - threatEntryType: string; - /** - * The threat type matching this threat. - */ - threatType: string; -} -/** - * A single resource related to a threat hit. - */ -export interface Schema$ThreatSource { - /** - * Referrer of the resource. Only set if the referrer is available. - */ - referrer: string; - /** - * The remote IP of the resource in ASCII format. Either IPv4 or IPv6. - */ - remoteIp: string; - /** - * The type of source reported. - */ - type: string; - /** - * The URL of the resource. - */ - url: string; -} -/** - * Details about the user that encountered the threat. - */ -export interface Schema$UserInfo { - /** - * The UN M.49 region code associated with the user's location. - */ - regionCode: string; - /** - * Unique user identifier defined by the client. - */ - userId: string; -} - -export class Resource$Encodedfullhashes { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$UserInfo { + /** + * The UN M.49 region code associated with the user's location. + */ + regionCode: string; + /** + * Unique user identifier defined by the client. + */ + userId: string; } - - /** - * safebrowsing.encodedFullHashes.get - * @alias safebrowsing.encodedFullHashes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientId A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API. - * @param {string=} params.clientVersion The version of the client implementation. - * @param {string} params.encodedRequest A serialized FindFullHashesRequest proto. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Encodedfullhashes { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/encodedFullHashes/{encodedRequest}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['encodedRequest'], - pathParams: ['encodedRequest'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Encodedupdates { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.encodedFullHashes.get + * @alias safebrowsing.encodedFullHashes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientId A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API. + * @param {string=} params.clientVersion The version of the client implementation. + * @param {string} params.encodedRequest A serialized FindFullHashesRequest proto. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/encodedFullHashes/{encodedRequest}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['encodedRequest'], + pathParams: ['encodedRequest'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * safebrowsing.encodedUpdates.get - * @alias safebrowsing.encodedUpdates.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.clientId A client ID that uniquely identifies the client implementation of the Safe Browsing API. - * @param {string=} params.clientVersion The version of the client implementation. - * @param {string} params.encodedRequest A serialized FetchThreatListUpdatesRequest proto. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Encodedupdates { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/encodedUpdates/{encodedRequest}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['encodedRequest'], - pathParams: ['encodedRequest'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Fullhashes { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.encodedUpdates.get + * @alias safebrowsing.encodedUpdates.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.clientId A client ID that uniquely identifies the client implementation of the Safe Browsing API. + * @param {string=} params.clientVersion The version of the client implementation. + * @param {string} params.encodedRequest A serialized FetchThreatListUpdatesRequest proto. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/encodedUpdates/{encodedRequest}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['encodedRequest'], + pathParams: ['encodedRequest'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * safebrowsing.fullHashes.find - * @desc Finds the full hashes that match the requested hash prefixes. - * @alias safebrowsing.fullHashes.find - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().FindFullHashesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - find(params?: any, options?: MethodOptions): - AxiosPromise; - find( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - find( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Fullhashes { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v4/fullHashes:find').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Threathits { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.fullHashes.find + * @desc Finds the full hashes that match the requested hash prefixes. + * @alias safebrowsing.fullHashes.find + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().FindFullHashesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + find(params?: any, options?: MethodOptions): + AxiosPromise; + find( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + find( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/fullHashes:find') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * safebrowsing.threatHits.create - * @desc Reports a Safe Browsing threat list hit to Google. Only projects with - * TRUSTED_REPORTER visibility can use this method. - * @alias safebrowsing.threatHits.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ThreatHit} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Threathits { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/threatHits').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Threatlists { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.threatHits.create + * @desc Reports a Safe Browsing threat list hit to Google. Only projects + * with TRUSTED_REPORTER visibility can use this method. + * @alias safebrowsing.threatHits.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ThreatHit} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/threatHits').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * safebrowsing.threatLists.list - * @desc Lists the Safe Browsing threat lists available for download. - * @alias safebrowsing.threatLists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Threatlists { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/threatLists').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Threatlistupdates { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.threatLists.list + * @desc Lists the Safe Browsing threat lists available for download. + * @alias safebrowsing.threatLists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/threatLists').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * safebrowsing.threatListUpdates.fetch - * @desc Fetches the most recent threat list updates. A client can request - * updates for multiple lists at once. - * @alias safebrowsing.threatListUpdates.fetch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().FetchThreatListUpdatesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - fetch(params?: any, options?: MethodOptions): - AxiosPromise; - fetch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - fetch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Threatlistupdates { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/threatListUpdates:fetch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Threatmatches { - root: Safebrowsing; - constructor(root: Safebrowsing) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * safebrowsing.threatListUpdates.fetch + * @desc Fetches the most recent threat list updates. A client can request + * updates for multiple lists at once. + * @alias safebrowsing.threatListUpdates.fetch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().FetchThreatListUpdatesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + fetch(params?: any, options?: MethodOptions): + AxiosPromise; + fetch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + fetch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/threatListUpdates:fetch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * safebrowsing.threatMatches.find - * @desc Finds the threat entries that match the Safe Browsing lists. - * @alias safebrowsing.threatMatches.find - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().FindThreatMatchesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - find(params?: any, options?: MethodOptions): - AxiosPromise; - find( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - find( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Threatmatches { + root: Safebrowsing; + constructor(root: Safebrowsing) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/threatMatches:find') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * safebrowsing.threatMatches.find + * @desc Finds the threat entries that match the Safe Browsing lists. + * @alias safebrowsing.threatMatches.find + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().FindThreatMatchesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + find(params?: any, options?: MethodOptions): + AxiosPromise; + find( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + find( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://safebrowsing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/threatMatches:find') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/script/v1.ts b/src/apis/script/v1.ts index e1204bb3e60..a99b2d9931f 100644 --- a/src/apis/script/v1.ts +++ b/src/apis/script/v1.ts @@ -27,1659 +27,1672 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Apps Script API - * - * An API for managing and executing Google Apps Script projects. - * - * @example - * const google = require('googleapis'); - * const script = google.script('v1'); - * - * @namespace script - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Script - */ -export class Script { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace script_v1 { + /** + * Apps Script API + * + * An API for managing and executing Google Apps Script projects. + * + * @example + * const google = require('googleapis'); + * const script = google.script('v1'); + * + * @namespace script + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Script + */ + export class Script { + _options: GlobalOptions; + google: GoogleApis; + root = this; - processes: Resource$Processes; - projects: Resource$Projects; - scripts: Resource$Scripts; + processes: Resource$Processes; + projects: Resource$Projects; + scripts: Resource$Scripts; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.processes = new Resource$Processes(this); - this.projects = new Resource$Projects(this); - this.scripts = new Resource$Scripts(this); - } + this.processes = new Resource$Processes(this); + this.projects = new Resource$Projects(this); + this.scripts = new Resource$Scripts(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The Content resource. - */ -export interface Schema$Content { - /** - * The list of script project files. One of the files is a script manifest; it - * must be named "appsscript", must have type of JSON, and include - * the manifest configurations for the project. - */ - files: Schema$File[]; - /** - * The script project's Drive ID. - */ - scriptId: string; -} -/** - * Request to create a script project. - */ -export interface Schema$CreateProjectRequest { - /** - * The Drive ID of a parent file that the created script project is bound to. - * This is usually the ID of a Google Doc, Google Sheet, Google Form, or - * Google Slides file. If not set, a standalone script project is created. - */ - parentId: string; - /** - * The title for the project. - */ - title: string; -} -/** - * Representation of a single script deployment. - */ -export interface Schema$Deployment { - /** - * The deployment configuration. - */ - deploymentConfig: Schema$DeploymentConfig; - /** - * The deployment ID for this deployment. - */ - deploymentId: string; - /** - * The deployment's entry points. - */ - entryPoints: Schema$EntryPoint[]; - /** - * Script's defined set of functions. - */ - functionSet: Schema$GoogleAppsScriptTypeFunctionSet; - /** - * Set of scopes required by the deployment. - */ - scopeSet: Schema$GoogleAppsScriptTypeScopeSet; - /** - * Last modified date time stamp. - */ - updateTime: string; -} -/** - * Metadata the defines how a deployment is configured. - */ -export interface Schema$DeploymentConfig { - /** - * The description for this deployment. - */ - description: string; - /** - * The manifest file name for this deployment. - */ - manifestFileName: string; - /** - * The script project's Drive ID. - */ - scriptId: string; - /** - * The version number on which this deployment is based. - */ - versionNumber: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * A configuration that defines how a deployment is accessed externally. - */ -export interface Schema$EntryPoint { - /** - * Add-on properties. - */ - addOn: Schema$GoogleAppsScriptTypeAddOnEntryPoint; - /** - * The type of the entry point. - */ - entryPointType: string; - /** - * An entry point specification for Apps Script API execution calls. - */ - executionApi: Schema$GoogleAppsScriptTypeExecutionApiEntryPoint; - /** - * An entry point specification for web apps. - */ - webApp: Schema$GoogleAppsScriptTypeWebAppEntryPoint; -} -/** - * An object that provides information about the nature of an error resulting - * from an attempted execution of a script function using the Apps Script API. - * If a run call succeeds but the script function (or Apps Script itself) throws - * an exception, the response body's error field contains a Status object. - * The `Status` object's `details` field contains an array with a single one - * of these `ExecutionError` objects. - */ -export interface Schema$ExecutionError { - /** - * The error message thrown by Apps Script, usually localized into the - * user's language. - */ - errorMessage: string; - /** - * The error type, for example `TypeError` or `ReferenceError`. If the error - * type is unavailable, this field is not included. - */ - errorType: string; - /** - * An array of objects that provide a stack trace through the script to show - * where the execution failed, with the deepest call first. - */ - scriptStackTraceElements: Schema$ScriptStackTraceElement[]; -} -/** - * A request to run the function in a script. The script is identified by the - * specified `script_id`. Executing a function on a script returns results based - * on the implementation of the script. - */ -export interface Schema$ExecutionRequest { - /** - * If `true` and the user is an owner of the script, the script runs at the - * most recently saved version rather than the version deployed for use with - * the Apps Script API. Optional; default is `false`. - */ - devMode: boolean; - /** - * The name of the function to execute in the given script. The name does not - * include parentheses or parameters. - */ - function: string; - /** - * The parameters to be passed to the function being executed. The object type - * for each parameter should match the expected type in Apps Script. - * Parameters cannot be Apps Script-specific object types (such as a - * `Document` or a `Calendar`); they can only be primitive types such as - * `string`, `number`, `array`, `object`, or `boolean`. Optional. - */ - parameters: any[]; - /** - * For Android add-ons only. An ID that represents the user's current - * session in the Android app for Google Docs or Sheets, included as extra - * data in the - * [Intent](https://developer.android.com/guide/components/intents-filters.html) - * that launches the add-on. When an Android add-on is run with a session - * state, it gains the privileges of a - * [bound](https://developers.google.com/apps-script/guides/bound) - * script&mdash;that is, it can access information like the user's - * current cursor position (in Docs) or selected cell (in Sheets). To retrieve - * the state, call - * `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`. - * Optional. - */ - sessionState: string; -} -/** - * An object that provides the return value of a function executed using the - * Apps Script API. If the script function returns successfully, the response - * body's response field contains this `ExecutionResponse` object. - */ -export interface Schema$ExecutionResponse { - /** - * The return value of the script function. The type matches the object type - * returned in Apps Script. Functions called using the Apps Script API cannot - * return Apps Script-specific objects (such as a `Document` or a `Calendar`); - * they can only return primitive types such as a `string`, `number`, `array`, - * `object`, or `boolean`. - */ - result: any; -} -/** - * An individual file within a script project. A file is a third-party source - * code created by one or more developers. It can be a server-side JS code, - * HTML, or a configuration file. Each script project can contain multiple - * files. - */ -export interface Schema$File { - /** - * Creation date timestamp. This read-only field is only visible to users who - * have WRITER permission for the script project. - */ - createTime: string; - /** - * The defined set of functions in the script file, if any. - */ - functionSet: Schema$GoogleAppsScriptTypeFunctionSet; - /** - * The user who modified the file most recently. This read-only field is only - * visible to users who have WRITER permission for the script project. - */ - lastModifyUser: Schema$GoogleAppsScriptTypeUser; - /** - * The name of the file. The file extension is not part of the file name, - * which can be identified from the type field. - */ - name: string; - /** - * The file content. - */ - source: string; /** - * The type of the file. - */ - type: string; - /** - * Last modified date timestamp. This read-only field is only visible to users - * who have WRITER permission for the script project. - */ - updateTime: string; -} -/** - * An add-on entry point. - */ -export interface Schema$GoogleAppsScriptTypeAddOnEntryPoint { - /** - * The add-on's required list of supported container types. - */ - addOnType: string; - /** - * The add-on's optional description. - */ - description: string; - /** - * The add-on's optional help URL. - */ - helpUrl: string; - /** - * The add-on's required post install tip URL. - */ - postInstallTipUrl: string; - /** - * The add-on's optional report issue URL. - */ - reportIssueUrl: string; - /** - * The add-on's required title. - */ - title: string; -} -/** - * API executable entry point configuration. - */ -export interface Schema$GoogleAppsScriptTypeExecutionApiConfig { - /** - * Who has permission to run the API executable. - */ - access: string; -} -/** - * An API executable entry point. - */ -export interface Schema$GoogleAppsScriptTypeExecutionApiEntryPoint { - /** - * The entry point's configuration. - */ - entryPointConfig: Schema$GoogleAppsScriptTypeExecutionApiConfig; -} -/** - * Represents a function in a script project. - */ -export interface Schema$GoogleAppsScriptTypeFunction { - /** - * The function name in the script project. - */ - name: string; -} -/** - * A set of functions. No duplicates are permitted. - */ -export interface Schema$GoogleAppsScriptTypeFunctionSet { - /** - * A list of functions composing the set. - */ - values: Schema$GoogleAppsScriptTypeFunction[]; -} -/** - * Representation of a single script process execution that was started from the - * script editor, a trigger, an application, or using the Apps Script API. This - * is distinct from the `Operation` resource, which only represents exeuctions - * started via the Apps Script API. - */ -export interface Schema$GoogleAppsScriptTypeProcess { - /** - * Duration the execution spent executing. - */ - duration: string; - /** - * User-facing name for the user executing the script. - */ - executingUser: string; - /** - * Name of the function the started the execution. - */ - functionName: string; - /** - * The executions status. - */ - processStatus: string; - /** - * The executions type. - */ - processType: string; - /** - * Name of the script being executed. - */ - projectName: string; + * The Content resource. + */ + export interface Schema$Content { + /** + * The list of script project files. One of the files is a script manifest; + * it must be named "appsscript", must have type of JSON, and + * include the manifest configurations for the project. + */ + files: Schema$File[]; + /** + * The script project's Drive ID. + */ + scriptId: string; + } /** - * Time the execution started. - */ - startTime: string; + * Request to create a script project. + */ + export interface Schema$CreateProjectRequest { + /** + * The Drive ID of a parent file that the created script project is bound + * to. This is usually the ID of a Google Doc, Google Sheet, Google Form, or + * Google Slides file. If not set, a standalone script project is created. + */ + parentId: string; + /** + * The title for the project. + */ + title: string; + } /** - * The executing users access level to the script. - */ - userAccessLevel: string; -} -/** - * Represents an authorization scope. - */ -export interface Schema$GoogleAppsScriptTypeScope { + * Representation of a single script deployment. + */ + export interface Schema$Deployment { + /** + * The deployment configuration. + */ + deploymentConfig: Schema$DeploymentConfig; + /** + * The deployment ID for this deployment. + */ + deploymentId: string; + /** + * The deployment's entry points. + */ + entryPoints: Schema$EntryPoint[]; + /** + * Script's defined set of functions. + */ + functionSet: Schema$GoogleAppsScriptTypeFunctionSet; + /** + * Set of scopes required by the deployment. + */ + scopeSet: Schema$GoogleAppsScriptTypeScopeSet; + /** + * Last modified date time stamp. + */ + updateTime: string; + } /** - * Who authorized the scope. - */ - authorizer: string; + * Metadata the defines how a deployment is configured. + */ + export interface Schema$DeploymentConfig { + /** + * The description for this deployment. + */ + description: string; + /** + * The manifest file name for this deployment. + */ + manifestFileName: string; + /** + * The script project's Drive ID. + */ + scriptId: string; + /** + * The version number on which this deployment is based. + */ + versionNumber: number; + } /** - * The scope's identifying string. - */ - name: string; -} -/** - * A set of scopes. No duplicates are permitted. - */ -export interface Schema$GoogleAppsScriptTypeScopeSet { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A configuration that defines how a deployment is accessed externally. + */ + export interface Schema$EntryPoint { + /** + * Add-on properties. + */ + addOn: Schema$GoogleAppsScriptTypeAddOnEntryPoint; + /** + * The type of the entry point. + */ + entryPointType: string; + /** + * An entry point specification for Apps Script API execution calls. + */ + executionApi: Schema$GoogleAppsScriptTypeExecutionApiEntryPoint; + /** + * An entry point specification for web apps. + */ + webApp: Schema$GoogleAppsScriptTypeWebAppEntryPoint; + } /** - * List of scope values in the set. - */ - values: Schema$GoogleAppsScriptTypeScope[]; -} -/** - * A simple user profile resource. - */ -export interface Schema$GoogleAppsScriptTypeUser { + * An object that provides information about the nature of an error resulting + * from an attempted execution of a script function using the Apps Script API. + * If a run call succeeds but the script function (or Apps Script itself) + * throws an exception, the response body's error field contains a Status + * object. The `Status` object's `details` field contains an array with a + * single one of these `ExecutionError` objects. + */ + export interface Schema$ExecutionError { + /** + * The error message thrown by Apps Script, usually localized into the + * user's language. + */ + errorMessage: string; + /** + * The error type, for example `TypeError` or `ReferenceError`. If the error + * type is unavailable, this field is not included. + */ + errorType: string; + /** + * An array of objects that provide a stack trace through the script to show + * where the execution failed, with the deepest call first. + */ + scriptStackTraceElements: Schema$ScriptStackTraceElement[]; + } /** - * The user's domain. - */ - domain: string; + * A request to run the function in a script. The script is identified by the + * specified `script_id`. Executing a function on a script returns results + * based on the implementation of the script. + */ + export interface Schema$ExecutionRequest { + /** + * If `true` and the user is an owner of the script, the script runs at the + * most recently saved version rather than the version deployed for use with + * the Apps Script API. Optional; default is `false`. + */ + devMode: boolean; + /** + * The name of the function to execute in the given script. The name does + * not include parentheses or parameters. + */ + function: string; + /** + * The parameters to be passed to the function being executed. The object + * type for each parameter should match the expected type in Apps Script. + * Parameters cannot be Apps Script-specific object types (such as a + * `Document` or a `Calendar`); they can only be primitive types such as + * `string`, `number`, `array`, `object`, or `boolean`. Optional. + */ + parameters: any[]; + /** + * For Android add-ons only. An ID that represents the user's current + * session in the Android app for Google Docs or Sheets, included as extra + * data in the + * [Intent](https://developer.android.com/guide/components/intents-filters.html) + * that launches the add-on. When an Android add-on is run with a session + * state, it gains the privileges of a + * [bound](https://developers.google.com/apps-script/guides/bound) + * script&mdash;that is, it can access information like the user's + * current cursor position (in Docs) or selected cell (in Sheets). To + * retrieve the state, call + * `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`. + * Optional. + */ + sessionState: string; + } /** - * The user's identifying email address. - */ - email: string; + * An object that provides the return value of a function executed using the + * Apps Script API. If the script function returns successfully, the response + * body's response field contains this `ExecutionResponse` object. + */ + export interface Schema$ExecutionResponse { + /** + * The return value of the script function. The type matches the object type + * returned in Apps Script. Functions called using the Apps Script API + * cannot return Apps Script-specific objects (such as a `Document` or a + * `Calendar`); they can only return primitive types such as a `string`, + * `number`, `array`, `object`, or `boolean`. + */ + result: any; + } /** - * The user's display name. - */ - name: string; + * An individual file within a script project. A file is a third-party source + * code created by one or more developers. It can be a server-side JS code, + * HTML, or a configuration file. Each script project can contain multiple + * files. + */ + export interface Schema$File { + /** + * Creation date timestamp. This read-only field is only visible to users + * who have WRITER permission for the script project. + */ + createTime: string; + /** + * The defined set of functions in the script file, if any. + */ + functionSet: Schema$GoogleAppsScriptTypeFunctionSet; + /** + * The user who modified the file most recently. This read-only field is + * only visible to users who have WRITER permission for the script project. + */ + lastModifyUser: Schema$GoogleAppsScriptTypeUser; + /** + * The name of the file. The file extension is not part of the file name, + * which can be identified from the type field. + */ + name: string; + /** + * The file content. + */ + source: string; + /** + * The type of the file. + */ + type: string; + /** + * Last modified date timestamp. This read-only field is only visible to + * users who have WRITER permission for the script project. + */ + updateTime: string; + } /** - * The user's photo. - */ - photoUrl: string; -} -/** - * Web app entry point configuration. - */ -export interface Schema$GoogleAppsScriptTypeWebAppConfig { + * An add-on entry point. + */ + export interface Schema$GoogleAppsScriptTypeAddOnEntryPoint { + /** + * The add-on's required list of supported container types. + */ + addOnType: string; + /** + * The add-on's optional description. + */ + description: string; + /** + * The add-on's optional help URL. + */ + helpUrl: string; + /** + * The add-on's required post install tip URL. + */ + postInstallTipUrl: string; + /** + * The add-on's optional report issue URL. + */ + reportIssueUrl: string; + /** + * The add-on's required title. + */ + title: string; + } /** - * Who has permission to run the web app. + * API executable entry point configuration. */ - access: string; + export interface Schema$GoogleAppsScriptTypeExecutionApiConfig { + /** + * Who has permission to run the API executable. + */ + access: string; + } /** - * Who to execute the web app as. + * An API executable entry point. */ - executeAs: string; -} -/** - * A web application entry point. - */ -export interface Schema$GoogleAppsScriptTypeWebAppEntryPoint { + export interface Schema$GoogleAppsScriptTypeExecutionApiEntryPoint { + /** + * The entry point's configuration. + */ + entryPointConfig: Schema$GoogleAppsScriptTypeExecutionApiConfig; + } /** - * The entry point's configuration. + * Represents a function in a script project. */ - entryPointConfig: Schema$GoogleAppsScriptTypeWebAppConfig; + export interface Schema$GoogleAppsScriptTypeFunction { + /** + * The function name in the script project. + */ + name: string; + } /** - * The URL for the web application. + * A set of functions. No duplicates are permitted. */ - url: string; -} -/** - * Response with the list of deployments for the specified Apps Script project. - */ -export interface Schema$ListDeploymentsResponse { + export interface Schema$GoogleAppsScriptTypeFunctionSet { + /** + * A list of functions composing the set. + */ + values: Schema$GoogleAppsScriptTypeFunction[]; + } /** - * The list of deployments. - */ - deployments: Schema$Deployment[]; + * Representation of a single script process execution that was started from + * the script editor, a trigger, an application, or using the Apps Script API. + * This is distinct from the `Operation` resource, which only represents + * exeuctions started via the Apps Script API. + */ + export interface Schema$GoogleAppsScriptTypeProcess { + /** + * Duration the execution spent executing. + */ + duration: string; + /** + * User-facing name for the user executing the script. + */ + executingUser: string; + /** + * Name of the function the started the execution. + */ + functionName: string; + /** + * The executions status. + */ + processStatus: string; + /** + * The executions type. + */ + processType: string; + /** + * Name of the script being executed. + */ + projectName: string; + /** + * Time the execution started. + */ + startTime: string; + /** + * The executing users access level to the script. + */ + userAccessLevel: string; + } /** - * The token that can be used in the next call to get the next page of - * results. - */ - nextPageToken: string; -} -/** - * Response with the list of Process resources. - */ -export interface Schema$ListScriptProcessesResponse { + * Represents an authorization scope. + */ + export interface Schema$GoogleAppsScriptTypeScope { + /** + * Who authorized the scope. + */ + authorizer: string; + /** + * The scope's identifying string. + */ + name: string; + } /** - * Token for the next page of results. If empty, there are no more pages - * remaining. + * A set of scopes. No duplicates are permitted. */ - nextPageToken: string; + export interface Schema$GoogleAppsScriptTypeScopeSet { + /** + * List of scope values in the set. + */ + values: Schema$GoogleAppsScriptTypeScope[]; + } /** - * List of processes matching request parameters. - */ - processes: Schema$GoogleAppsScriptTypeProcess[]; -} -/** - * Response with the list of Process resources. - */ -export interface Schema$ListUserProcessesResponse { + * A simple user profile resource. + */ + export interface Schema$GoogleAppsScriptTypeUser { + /** + * The user's domain. + */ + domain: string; + /** + * The user's identifying email address. + */ + email: string; + /** + * The user's display name. + */ + name: string; + /** + * The user's photo. + */ + photoUrl: string; + } /** - * Token for the next page of results. If empty, there are no more pages - * remaining. - */ - nextPageToken: string; + * Web app entry point configuration. + */ + export interface Schema$GoogleAppsScriptTypeWebAppConfig { + /** + * Who has permission to run the web app. + */ + access: string; + /** + * Who to execute the web app as. + */ + executeAs: string; + } /** - * List of processes matching request parameters. - */ - processes: Schema$GoogleAppsScriptTypeProcess[]; -} -/** - * Response with the list of the versions for the specified script project. - */ -export interface Schema$ListVersionsResponse { + * A web application entry point. + */ + export interface Schema$GoogleAppsScriptTypeWebAppEntryPoint { + /** + * The entry point's configuration. + */ + entryPointConfig: Schema$GoogleAppsScriptTypeWebAppConfig; + /** + * The URL for the web application. + */ + url: string; + } /** - * The token use to fetch the next page of records. if not exist in the - * response, that means no more versions to list. - */ - nextPageToken: string; + * Response with the list of deployments for the specified Apps Script + * project. + */ + export interface Schema$ListDeploymentsResponse { + /** + * The list of deployments. + */ + deployments: Schema$Deployment[]; + /** + * The token that can be used in the next call to get the next page of + * results. + */ + nextPageToken: string; + } /** - * The list of versions. - */ - versions: Schema$Version[]; -} -/** - * Resource containing usage stats for a given script, based on the supplied - * filter and mask present in the request. - */ -export interface Schema$Metrics { + * Response with the list of Process resources. + */ + export interface Schema$ListScriptProcessesResponse { + /** + * Token for the next page of results. If empty, there are no more pages + * remaining. + */ + nextPageToken: string; + /** + * List of processes matching request parameters. + */ + processes: Schema$GoogleAppsScriptTypeProcess[]; + } /** - * Number of active users. - */ - activeUsers: Schema$MetricsValue[]; + * Response with the list of Process resources. + */ + export interface Schema$ListUserProcessesResponse { + /** + * Token for the next page of results. If empty, there are no more pages + * remaining. + */ + nextPageToken: string; + /** + * List of processes matching request parameters. + */ + processes: Schema$GoogleAppsScriptTypeProcess[]; + } /** - * Number of failed executions. - */ - failedExecutions: Schema$MetricsValue[]; + * Response with the list of the versions for the specified script project. + */ + export interface Schema$ListVersionsResponse { + /** + * The token use to fetch the next page of records. if not exist in the + * response, that means no more versions to list. + */ + nextPageToken: string; + /** + * The list of versions. + */ + versions: Schema$Version[]; + } /** - * Number of total executions. - */ - totalExecutions: Schema$MetricsValue[]; -} -/** - * Metrics value that holds number of executions counted. - */ -export interface Schema$MetricsValue { + * Resource containing usage stats for a given script, based on the supplied + * filter and mask present in the request. + */ + export interface Schema$Metrics { + /** + * Number of active users. + */ + activeUsers: Schema$MetricsValue[]; + /** + * Number of failed executions. + */ + failedExecutions: Schema$MetricsValue[]; + /** + * Number of total executions. + */ + totalExecutions: Schema$MetricsValue[]; + } /** - * Required field indicating the end time of the interval. - */ - endTime: string; + * Metrics value that holds number of executions counted. + */ + export interface Schema$MetricsValue { + /** + * Required field indicating the end time of the interval. + */ + endTime: string; + /** + * Required field indicating the start time of the interval. + */ + startTime: string; + /** + * Indicates the number of executions counted. + */ + value: string; + } /** - * Required field indicating the start time of the interval. - */ - startTime: string; + * A representation of a execution of an Apps Script function that is started + * using run. The execution response does not arrive until the function + * finishes executing. The maximum execution runtime is listed in the [Apps + * Script quotas + * guide](/apps-script/guides/services/quotas#current_limitations). + * <p>After the execution is started, it can have one of four + * outcomes:</p> <ul> <li> If the script function returns + * successfully, the response field contains an ExecutionResponse object + * with the function's return value in the object's `result` + * field.</li> <li> If the script function (or Apps Script itself) + * throws an exception, the error field contains a Status object. The + * `Status` object's `details` field contains an array with a single + * ExecutionError object that provides information about the nature of the + * error.</li> <li> If the execution has not yet completed, the + * done field is `false` and the neither the `response` nor `error` fields + * are present.</li> <li> If the `run` call itself fails (for + * example, because of a malformed request or an authorization error), the + * method returns an HTTP response code in the 4XX range with a different + * format for the response body. Client libraries automatically convert a + * 4XX response into an exception class.</li> </ul> + */ + export interface Schema$Operation { + /** + * This field indicates whether the script execution has completed. A + * completed execution has a populated `response` field containing the + * ExecutionResponse from function that was executed. + */ + done: boolean; + /** + * If a `run` call succeeds but the script function (or Apps Script itself) + * throws an exception, this field contains a Status object. The `Status` + * object's `details` field contains an array with a single + * ExecutionError object that provides information about the nature of the + * error. + */ + error: Schema$Status; + /** + * If the script function returns successfully, this field contains an + * ExecutionResponse object with the function's return value. + */ + response: any; + } /** - * Indicates the number of executions counted. - */ - value: string; -} -/** - * A representation of a execution of an Apps Script function that is started - * using run. The execution response does not arrive until the function finishes - * executing. The maximum execution runtime is listed in the [Apps Script quotas - * guide](/apps-script/guides/services/quotas#current_limitations). - * <p>After the execution is started, it can have one of four - * outcomes:</p> <ul> <li> If the script function returns - * successfully, the response field contains an ExecutionResponse object - * with the function's return value in the object's `result` - * field.</li> <li> If the script function (or Apps Script itself) - * throws an exception, the error field contains a Status object. The - * `Status` object's `details` field contains an array with a single - * ExecutionError object that provides information about the nature of the - * error.</li> <li> If the execution has not yet completed, the - * done field is `false` and the neither the `response` nor `error` fields are - * present.</li> <li> If the `run` call itself fails (for example, - * because of a malformed request or an authorization error), the method - * returns an HTTP response code in the 4XX range with a different format for - * the response body. Client libraries automatically convert a 4XX response - * into an exception class.</li> </ul> - */ -export interface Schema$Operation { + * The script project resource. + */ + export interface Schema$Project { + /** + * When the script was created. + */ + createTime: string; + /** + * User who originally created the script. + */ + creator: Schema$GoogleAppsScriptTypeUser; + /** + * User who last modified the script. + */ + lastModifyUser: Schema$GoogleAppsScriptTypeUser; + /** + * The parent's Drive ID that the script will be attached to. This is + * usually the ID of a Google Document or Google Sheet. This filed is + * optional, and if not set, a stand-alone script will be created. + */ + parentId: string; + /** + * The script project's Drive ID. + */ + scriptId: string; + /** + * The title for the project. + */ + title: string; + /** + * When the script was last updated. + */ + updateTime: string; + } /** - * This field indicates whether the script execution has completed. A - * completed execution has a populated `response` field containing the - * ExecutionResponse from function that was executed. - */ - done: boolean; + * A stack trace through the script that shows where the execution failed. + */ + export interface Schema$ScriptStackTraceElement { + /** + * The name of the function that failed. + */ + function: string; + /** + * The line number where the script failed. + */ + lineNumber: number; + } /** * If a `run` call succeeds but the script function (or Apps Script itself) - * throws an exception, this field contains a Status object. The `Status` - * object's `details` field contains an array with a single ExecutionError - * object that provides information about the nature of the error. - */ - error: Schema$Status; - /** - * If the script function returns successfully, this field contains an - * ExecutionResponse object with the function's return value. - */ - response: any; -} -/** - * The script project resource. - */ -export interface Schema$Project { - /** - * When the script was created. - */ - createTime: string; - /** - * User who originally created the script. - */ - creator: Schema$GoogleAppsScriptTypeUser; - /** - * User who last modified the script. - */ - lastModifyUser: Schema$GoogleAppsScriptTypeUser; - /** - * The parent's Drive ID that the script will be attached to. This is - * usually the ID of a Google Document or Google Sheet. This filed is - * optional, and if not set, a stand-alone script will be created. - */ - parentId: string; - /** - * The script project's Drive ID. - */ - scriptId: string; - /** - * The title for the project. - */ - title: string; - /** - * When the script was last updated. - */ - updateTime: string; -} -/** - * A stack trace through the script that shows where the execution failed. - */ -export interface Schema$ScriptStackTraceElement { - /** - * The name of the function that failed. - */ - function: string; - /** - * The line number where the script failed. - */ - lineNumber: number; -} -/** - * If a `run` call succeeds but the script function (or Apps Script itself) - * throws an exception, the response body's error field contains this - * `Status` object. - */ -export interface Schema$Status { - /** - * The status code. For this API, this value either: <ul> <li> 10, - * indicating a `SCRIPT_TIMEOUT` error,</li> <li> 3, indicating an - * `INVALID_ARGUMENT` error, or</li> <li> 1, indicating a - * `CANCELLED` execution.</li> </ul> - */ - code: number; - /** - * An array that contains a single ExecutionError object that provides - * information about the nature of the error. - */ - details: any[]; - /** - * A developer-facing error message, which is in English. Any user-facing - * error message is localized and sent in the - * [google.rpc.Status.details](google.rpc.Status.details) field, or localized - * by the client. - */ - message: string; -} -/** - * Request with deployment information to update an existing deployment. - */ -export interface Schema$UpdateDeploymentRequest { - /** - * The deployment configuration. - */ - deploymentConfig: Schema$DeploymentConfig; -} -/** - * A resource representing a script project version. A version is a - * "snapshot" of a script project and is similar to a read-only - * branched release. When creating deployments, the version to use must be - * specified. - */ -export interface Schema$Version { - /** - * When the version was created. - */ - createTime: string; - /** - * The description for this version. - */ - description: string; - /** - * The script project's Drive ID. - */ - scriptId: string; + * throws an exception, the response body's error field contains this + * `Status` object. + */ + export interface Schema$Status { + /** + * The status code. For this API, this value either: <ul> <li> + * 10, indicating a `SCRIPT_TIMEOUT` error,</li> <li> 3, + * indicating an `INVALID_ARGUMENT` error, or</li> <li> 1, + * indicating a `CANCELLED` execution.</li> </ul> + */ + code: number; + /** + * An array that contains a single ExecutionError object that provides + * information about the nature of the error. + */ + details: any[]; + /** + * A developer-facing error message, which is in English. Any user-facing + * error message is localized and sent in the + * [google.rpc.Status.details](google.rpc.Status.details) field, or + * localized by the client. + */ + message: string; + } /** - * The incremental ID that is created by Apps Script when a version is - * created. This is system assigned number and is immutable once created. + * Request with deployment information to update an existing deployment. */ - versionNumber: number; -} - -export class Resource$Processes { - root: Script; - constructor(root: Script) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$UpdateDeploymentRequest { + /** + * The deployment configuration. + */ + deploymentConfig: Schema$DeploymentConfig; } - - getRoot() { - return this.root; + /** + * A resource representing a script project version. A version is a + * "snapshot" of a script project and is similar to a read-only + * branched release. When creating deployments, the version to use must be + * specified. + */ + export interface Schema$Version { + /** + * When the version was created. + */ + createTime: string; + /** + * The description for this version. + */ + description: string; + /** + * The script project's Drive ID. + */ + scriptId: string; + /** + * The incremental ID that is created by Apps Script when a version is + * created. This is system assigned number and is immutable once created. + */ + versionNumber: number; } - - /** - * script.processes.list - * @desc List information about processes made by or on behalf of a user, such - * as process type and current status. - * @alias script.processes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of returned processes per page of results. Defaults to 50. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. - * @param {string=} params.userProcessFilter.deploymentId Optional field used to limit returned processes to those originating from projects with a specific deployment ID. - * @param {string=} params.userProcessFilter.endTime Optional field used to limit returned processes to those that completed on or before the given timestamp. - * @param {string=} params.userProcessFilter.functionName Optional field used to limit returned processes to those originating from a script function with the given function name. - * @param {string=} params.userProcessFilter.projectName Optional field used to limit returned processes to those originating from projects with a specific project name. - * @param {string=} params.userProcessFilter.scriptId Optional field used to limit returned processes to those originating from projects with a specific script ID. - * @param {string=} params.userProcessFilter.startTime Optional field used to limit returned processes to those that were started on or after the given timestamp. - * @param {string=} params.userProcessFilter.statuses Optional field used to limit returned processes to those having one of the specified process statuses. - * @param {string=} params.userProcessFilter.types Optional field used to limit returned processes to those having one of the specified process types. - * @param {string=} params.userProcessFilter.userAccessLevels Optional field used to limit returned processes to those having one of the specified user access levels. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Processes { + root: Script; + constructor(root: Script) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/processes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * script.processes.listScriptProcesses - * @desc List information about a script's executed processes, such as process - * type and current status. - * @alias script.processes.listScriptProcesses - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of returned processes per page of results. Defaults to 50. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. - * @param {string=} params.scriptId The script ID of the project whose processes are listed. - * @param {string=} params.scriptProcessFilter.deploymentId Optional field used to limit returned processes to those originating from projects with a specific deployment ID. - * @param {string=} params.scriptProcessFilter.endTime Optional field used to limit returned processes to those that completed on or before the given timestamp. - * @param {string=} params.scriptProcessFilter.functionName Optional field used to limit returned processes to those originating from a script function with the given function name. - * @param {string=} params.scriptProcessFilter.startTime Optional field used to limit returned processes to those that were started on or after the given timestamp. - * @param {string=} params.scriptProcessFilter.statuses Optional field used to limit returned processes to those having one of the specified process statuses. - * @param {string=} params.scriptProcessFilter.types Optional field used to limit returned processes to those having one of the specified process types. - * @param {string=} params.scriptProcessFilter.userAccessLevels Optional field used to limit returned processes to those having one of the specified user access levels. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - listScriptProcesses(params?: any, options?: MethodOptions): - AxiosPromise; - listScriptProcesses( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - listScriptProcesses( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * script.processes.list + * @desc List information about processes made by or on behalf of a user, + * such as process type and current status. + * @alias script.processes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of returned processes per page of results. Defaults to 50. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. + * @param {string=} params.userProcessFilter.deploymentId Optional field used to limit returned processes to those originating from projects with a specific deployment ID. + * @param {string=} params.userProcessFilter.endTime Optional field used to limit returned processes to those that completed on or before the given timestamp. + * @param {string=} params.userProcessFilter.functionName Optional field used to limit returned processes to those originating from a script function with the given function name. + * @param {string=} params.userProcessFilter.projectName Optional field used to limit returned processes to those originating from projects with a specific project name. + * @param {string=} params.userProcessFilter.scriptId Optional field used to limit returned processes to those originating from projects with a specific script ID. + * @param {string=} params.userProcessFilter.startTime Optional field used to limit returned processes to those that were started on or after the given timestamp. + * @param {string=} params.userProcessFilter.statuses Optional field used to limit returned processes to those having one of the specified process statuses. + * @param {string=} params.userProcessFilter.types Optional field used to limit returned processes to those having one of the specified process types. + * @param {string=} params.userProcessFilter.userAccessLevels Optional field used to limit returned processes to those having one of the specified user access levels. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/processes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/processes:listScriptProcesses') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects { - root: Script; - deployments: Resource$Projects$Deployments; - versions: Resource$Projects$Versions; - constructor(root: Script) { - this.root = root; - this.getRoot.bind(this); - this.deployments = new Resource$Projects$Deployments(root); - this.versions = new Resource$Projects$Versions(root); - } - getRoot() { - return this.root; + /** + * script.processes.listScriptProcesses + * @desc List information about a script's executed processes, such as + * process type and current status. + * @alias script.processes.listScriptProcesses + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of returned processes per page of results. Defaults to 50. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. + * @param {string=} params.scriptId The script ID of the project whose processes are listed. + * @param {string=} params.scriptProcessFilter.deploymentId Optional field used to limit returned processes to those originating from projects with a specific deployment ID. + * @param {string=} params.scriptProcessFilter.endTime Optional field used to limit returned processes to those that completed on or before the given timestamp. + * @param {string=} params.scriptProcessFilter.functionName Optional field used to limit returned processes to those originating from a script function with the given function name. + * @param {string=} params.scriptProcessFilter.startTime Optional field used to limit returned processes to those that were started on or after the given timestamp. + * @param {string=} params.scriptProcessFilter.statuses Optional field used to limit returned processes to those having one of the specified process statuses. + * @param {string=} params.scriptProcessFilter.types Optional field used to limit returned processes to those having one of the specified process types. + * @param {string=} params.scriptProcessFilter.userAccessLevels Optional field used to limit returned processes to those having one of the specified user access levels. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + listScriptProcesses(params?: any, options?: MethodOptions): + AxiosPromise; + listScriptProcesses( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + listScriptProcesses( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/processes:listScriptProcesses') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * script.projects.create - * @desc Creates a new, empty script project with no script files and a base - * manifest file. - * @alias script.projects.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().CreateProjectRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects { + root: Script; + deployments: Resource$Projects$Deployments; + versions: Resource$Projects$Versions; + constructor(root: Script) { + this.root = root; + this.getRoot.bind(this); + this.deployments = new Resource$Projects$Deployments(root); + this.versions = new Resource$Projects$Versions(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * script.projects.get - * @desc Gets a script project's metadata. - * @alias script.projects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * script.projects.create + * @desc Creates a new, empty script project with no script files and a base + * manifest file. + * @alias script.projects.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().CreateProjectRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * script.projects.getContent - * @desc Gets the content of the script project, including the code source and - * metadata for each script file. - * @alias script.projects.getContent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {integer=} params.versionNumber The version number of the project to retrieve. If not provided, the project's HEAD version is returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getContent(params?: any, options?: MethodOptions): - AxiosPromise; - getContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * script.projects.get + * @desc Gets a script project's metadata. + * @alias script.projects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/content') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * script.projects.getMetrics - * @desc Get metrics data for scripts, such as number of executions and active - * users. - * @alias script.projects.getMetrics - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.metricsFilter.deploymentId Optional field indicating a specific deployment to retrieve metrics from. - * @param {string=} params.metricsGranularity Required field indicating what granularity of metrics are returned. - * @param {string} params.scriptId Required field indicating the script to get metrics for. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getMetrics(params?: any, options?: MethodOptions): - AxiosPromise; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getMetrics( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/metrics') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * script.projects.getContent + * @desc Gets the content of the script project, including the code source + * and metadata for each script file. + * @alias script.projects.getContent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {integer=} params.versionNumber The version number of the project to retrieve. If not provided, the project's HEAD version is returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getContent(params?: any, options?: MethodOptions): + AxiosPromise; + getContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/content') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * script.projects.updateContent - * @desc Updates the content of the specified script project. This content is - * stored as the HEAD version, and is used when the script is executed as a - * trigger, in the script editor, in add-on preview mode, or as a web app or - * Apps Script API in development mode. This clears all the existing files in - * the project. - * @alias script.projects.updateContent - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {().Content} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateContent(params?: any, options?: MethodOptions): - AxiosPromise; - updateContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateContent( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/content') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * script.projects.getMetrics + * @desc Get metrics data for scripts, such as number of executions and + * active users. + * @alias script.projects.getMetrics + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.metricsFilter.deploymentId Optional field indicating a specific deployment to retrieve metrics from. + * @param {string=} params.metricsGranularity Required field indicating what granularity of metrics are returned. + * @param {string} params.scriptId Required field indicating the script to get metrics for. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getMetrics(params?: any, options?: MethodOptions): + AxiosPromise; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getMetrics( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/metrics') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Deployments { - root: Script; - constructor(root: Script) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * script.projects.deployments.create - * @desc Creates a deployment of an Apps Script project. - * @alias script.projects.deployments.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {().DeploymentConfig} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * script.projects.updateContent + * @desc Updates the content of the specified script project. This content + * is stored as the HEAD version, and is used when the script is executed as + * a trigger, in the script editor, in add-on preview mode, or as a web app + * or Apps Script API in development mode. This clears all the existing + * files in the project. + * @alias script.projects.updateContent + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {().Content} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateContent(params?: any, options?: MethodOptions): + AxiosPromise; + updateContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateContent( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/content') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Deployments { + root: Script; + constructor(root: Script) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * script.projects.deployments.delete - * @desc Deletes a deployment of an Apps Script project. - * @alias script.projects.deployments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deploymentId The deployment ID to be undeployed. - * @param {string} params.scriptId The script project's Drive ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{scriptId}/deployments/{deploymentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['scriptId', 'deploymentId'], - pathParams: ['deploymentId', 'scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * script.projects.deployments.create + * @desc Creates a deployment of an Apps Script project. + * @alias script.projects.deployments.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {().DeploymentConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * script.projects.deployments.get - * @desc Gets a deployment of an Apps Script project. - * @alias script.projects.deployments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deploymentId The deployment ID. - * @param {string} params.scriptId The script project's Drive ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * script.projects.deployments.delete + * @desc Deletes a deployment of an Apps Script project. + * @alias script.projects.deployments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deploymentId The deployment ID to be undeployed. + * @param {string} params.scriptId The script project's Drive ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{scriptId}/deployments/{deploymentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['scriptId', 'deploymentId'], + pathParams: ['deploymentId', 'scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{scriptId}/deployments/{deploymentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId', 'deploymentId'], - pathParams: ['deploymentId', 'scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * script.projects.deployments.list - * @desc Lists the deployments of an Apps Script project. - * @alias script.projects.deployments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of deployments on each returned page. Defaults to 50. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. - * @param {string} params.scriptId The script project's Drive ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * script.projects.deployments.get + * @desc Gets a deployment of an Apps Script project. + * @alias script.projects.deployments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deploymentId The deployment ID. + * @param {string} params.scriptId The script project's Drive ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{scriptId}/deployments/{deploymentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId', 'deploymentId'], + pathParams: ['deploymentId', 'scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/deployments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * script.projects.deployments.update - * @desc Updates a deployment of an Apps Script project. - * @alias script.projects.deployments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.deploymentId The deployment ID for this deployment. - * @param {string} params.scriptId The script project's Drive ID. - * @param {().UpdateDeploymentRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * script.projects.deployments.list + * @desc Lists the deployments of an Apps Script project. + * @alias script.projects.deployments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of deployments on each returned page. Defaults to 50. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. + * @param {string} params.scriptId The script project's Drive ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/deployments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/projects/{scriptId}/deployments/{deploymentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['scriptId', 'deploymentId'], - pathParams: ['deploymentId', 'scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Versions { - root: Script; - constructor(root: Script) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * script.projects.deployments.update + * @desc Updates a deployment of an Apps Script project. + * @alias script.projects.deployments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.deploymentId The deployment ID for this deployment. + * @param {string} params.scriptId The script project's Drive ID. + * @param {().UpdateDeploymentRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{scriptId}/deployments/{deploymentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['scriptId', 'deploymentId'], + pathParams: ['deploymentId', 'scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * script.projects.versions.create - * @desc Creates a new immutable version using the current code, with a unique - * version number. - * @alias script.projects.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {().Version} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Versions { + root: Script; + constructor(root: Script) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * script.projects.versions.get - * @desc Gets a version of a script project. - * @alias script.projects.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script project's Drive ID. - * @param {integer} params.versionNumber The version number. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * script.projects.versions.create + * @desc Creates a new immutable version using the current code, with a + * unique version number. + * @alias script.projects.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {().Version} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/versions/{versionNumber}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId', 'versionNumber'], - pathParams: ['scriptId', 'versionNumber'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * script.projects.versions.list - * @desc List the versions of a script project. - * @alias script.projects.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of versions on each returned page. Defaults to 50. - * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. - * @param {string} params.scriptId The script project's Drive ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * script.projects.versions.get + * @desc Gets a version of a script project. + * @alias script.projects.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script project's Drive ID. + * @param {integer} params.versionNumber The version number. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/projects/{scriptId}/versions/{versionNumber}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId', 'versionNumber'], + pathParams: ['scriptId', 'versionNumber'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{scriptId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Scripts { - root: Script; - constructor(root: Script) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + /** + * script.projects.versions.list + * @desc List the versions of a script project. + * @alias script.projects.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of versions on each returned page. Defaults to 50. + * @param {string=} params.pageToken The token for continuing a previous list request on the next page. This should be set to the value of `nextPageToken` from a previous response. + * @param {string} params.scriptId The script project's Drive ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{scriptId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * script.scripts.run - * @desc Runs a function in an Apps Script project. The project must be - * deployed for use with the Apps Script API. This method requires - * authorization with an OAuth 2.0 token that includes at least one of the - * scopes listed in the [Authorization](#authorization) section; script - * projects that do not require authorization cannot be executed through this - * API. To find the correct scopes to include in the authentication token, - * open the project in the script editor, then select **File > Project - * properties** and click the **Scopes** tab. - * @alias script.scripts.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.scriptId The script ID of the script to be executed. To find the script ID, open the project in the script editor and select **File > Project properties**. - * @param {().ExecutionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): AxiosPromise; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - run(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Scripts { + root: Script; + constructor(root: Script) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/scripts/{scriptId}:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['scriptId'], - pathParams: ['scriptId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * script.scripts.run + * @desc Runs a function in an Apps Script project. The project must be + * deployed for use with the Apps Script API. This method requires + * authorization with an OAuth 2.0 token that includes at least one of the + * scopes listed in the [Authorization](#authorization) section; script + * projects that do not require authorization cannot be executed through + * this API. To find the correct scopes to include in the authentication + * token, open the project in the script editor, then select **File > + * Project properties** and click the **Scopes** tab. + * @alias script.scripts.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.scriptId The script ID of the script to be executed. To find the script ID, open the project in the script editor and select **File > Project properties**. + * @param {().ExecutionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): AxiosPromise; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + run(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://script.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/scripts/{scriptId}:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['scriptId'], + pathParams: ['scriptId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/searchconsole/v1.ts b/src/apis/searchconsole/v1.ts index 58475282be7..0c74cc10a9a 100644 --- a/src/apis/searchconsole/v1.ts +++ b/src/apis/searchconsole/v1.ts @@ -27,214 +27,220 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Search Console URL Testing Tools API - * - * Provides tools for running validation tests against single URLs - * - * @example - * const google = require('googleapis'); - * const searchconsole = google.searchconsole('v1'); - * - * @namespace searchconsole - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Searchconsole - */ -export class Searchconsole { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace searchconsole_v1 { + /** + * Google Search Console URL Testing Tools API + * + * Provides tools for running validation tests against single URLs + * + * @example + * const google = require('googleapis'); + * const searchconsole = google.searchconsole('v1'); + * + * @namespace searchconsole + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Searchconsole + */ + export class Searchconsole { + _options: GlobalOptions; + google: GoogleApis; + root = this; - urlTestingTools: Resource$Urltestingtools; + urlTestingTools: Resource$Urltestingtools; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.urlTestingTools = new Resource$Urltestingtools(this); - } + this.urlTestingTools = new Resource$Urltestingtools(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Blocked resource. - */ -export interface Schema$BlockedResource { /** - * URL of the blocked resource. + * Blocked resource. */ - url: string; -} -/** - * Describe image data. - */ -export interface Schema$Image { - /** - * Image data in format determined by the mime type. Currently, the format - * will always be "image/png", but this might change in the future. - */ - data: string; - /** - * The mime-type of the image data. - */ - mimeType: string; -} -/** - * Mobile-friendly issue. - */ -export interface Schema$MobileFriendlyIssue { - /** - * Rule violated. - */ - rule: string; -} -/** - * Information about a resource with issue. - */ -export interface Schema$ResourceIssue { - /** - * Describes a blocked resource issue. - */ - blockedResource: Schema$BlockedResource; -} -/** - * Mobile-friendly test request. - */ -export interface Schema$RunMobileFriendlyTestRequest { - /** - * Whether or not screenshot is requested. Default is false. - */ - requestScreenshot: boolean; - /** - * URL for inspection. - */ - url: string; -} -/** - * Mobile-friendly test response, including mobile-friendly issues and resource - * issues. - */ -export interface Schema$RunMobileFriendlyTestResponse { - /** - * Test verdict, whether the page is mobile friendly or not. - */ - mobileFriendliness: string; + export interface Schema$BlockedResource { + /** + * URL of the blocked resource. + */ + url: string; + } /** - * List of mobile-usability issues. + * Describe image data. */ - mobileFriendlyIssues: Schema$MobileFriendlyIssue[]; + export interface Schema$Image { + /** + * Image data in format determined by the mime type. Currently, the format + * will always be "image/png", but this might change in the + * future. + */ + data: string; + /** + * The mime-type of the image data. + */ + mimeType: string; + } /** - * Information about embedded resources issues. + * Mobile-friendly issue. */ - resourceIssues: Schema$ResourceIssue[]; + export interface Schema$MobileFriendlyIssue { + /** + * Rule violated. + */ + rule: string; + } /** - * Screenshot of the requested URL. + * Information about a resource with issue. */ - screenshot: Schema$Image; + export interface Schema$ResourceIssue { + /** + * Describes a blocked resource issue. + */ + blockedResource: Schema$BlockedResource; + } /** - * Final state of the test, can be either complete or an error. + * Mobile-friendly test request. */ - testStatus: Schema$TestStatus; -} -/** - * Final state of the test, including error details if necessary. - */ -export interface Schema$TestStatus { + export interface Schema$RunMobileFriendlyTestRequest { + /** + * Whether or not screenshot is requested. Default is false. + */ + requestScreenshot: boolean; + /** + * URL for inspection. + */ + url: string; + } /** - * Error details if applicable. + * Mobile-friendly test response, including mobile-friendly issues and + * resource issues. */ - details: string; + export interface Schema$RunMobileFriendlyTestResponse { + /** + * Test verdict, whether the page is mobile friendly or not. + */ + mobileFriendliness: string; + /** + * List of mobile-usability issues. + */ + mobileFriendlyIssues: Schema$MobileFriendlyIssue[]; + /** + * Information about embedded resources issues. + */ + resourceIssues: Schema$ResourceIssue[]; + /** + * Screenshot of the requested URL. + */ + screenshot: Schema$Image; + /** + * Final state of the test, can be either complete or an error. + */ + testStatus: Schema$TestStatus; + } /** - * Status of the test. + * Final state of the test, including error details if necessary. */ - status: string; -} - -export class Resource$Urltestingtools { - root: Searchconsole; - mobileFriendlyTest: Resource$Urltestingtools$Mobilefriendlytest; - constructor(root: Searchconsole) { - this.root = root; - this.getRoot.bind(this); - this.mobileFriendlyTest = - new Resource$Urltestingtools$Mobilefriendlytest(root); + export interface Schema$TestStatus { + /** + * Error details if applicable. + */ + details: string; + /** + * Status of the test. + */ + status: string; } - getRoot() { - return this.root; - } -} -export class Resource$Urltestingtools$Mobilefriendlytest { - root: Searchconsole; - constructor(root: Searchconsole) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Urltestingtools { + root: Searchconsole; + mobileFriendlyTest: Resource$Urltestingtools$Mobilefriendlytest; + constructor(root: Searchconsole) { + this.root = root; + this.getRoot.bind(this); + this.mobileFriendlyTest = + new Resource$Urltestingtools$Mobilefriendlytest(root); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } - - - /** - * searchconsole.urlTestingTools.mobileFriendlyTest.run - * @desc Runs Mobile-Friendly Test for a given URL. - * @alias searchconsole.urlTestingTools.mobileFriendlyTest.run - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().RunMobileFriendlyTestRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - run(params?: any, options?: MethodOptions): - AxiosPromise; - run(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - run(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Urltestingtools$Mobilefriendlytest { + root: Searchconsole; + constructor(root: Searchconsole) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://searchconsole.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/urlTestingTools/mobileFriendlyTest:run') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * searchconsole.urlTestingTools.mobileFriendlyTest.run + * @desc Runs Mobile-Friendly Test for a given URL. + * @alias searchconsole.urlTestingTools.mobileFriendlyTest.run + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().RunMobileFriendlyTestRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + run(params?: any, options?: MethodOptions): + AxiosPromise; + run(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + run(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://searchconsole.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/urlTestingTools/mobileFriendlyTest:run') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/serviceconsumermanagement/v1.ts b/src/apis/serviceconsumermanagement/v1.ts index c7ee42c08be..631d45636e5 100644 --- a/src/apis/serviceconsumermanagement/v1.ts +++ b/src/apis/serviceconsumermanagement/v1.ts @@ -27,2832 +27,2870 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Service Consumer Management API - * - * Provides management methods for configuring service producer resources on - * Google Cloud. - * - * @example - * const google = require('googleapis'); - * const serviceconsumermanagement = google.serviceconsumermanagement('v1'); - * - * @namespace serviceconsumermanagement - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Serviceconsumermanagement - */ -export class Serviceconsumermanagement { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - operations: Resource$Operations; - services: Resource$Services; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.operations = new Resource$Operations(this); - this.services = new Resource$Services(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Request to add a newly created and configured tenant project to a tenancy - * unit. - */ -export interface Schema$AddTenantProjectRequest { - /** - * Configuration of the new tenant project that will be added to tenancy unit - * resources. - */ - projectConfig: Schema$TenantProjectConfig; - /** - * Tag of the added project. Must be less than 128 characters. Required. - */ - tag: string; -} -/** - * Api is a light-weight descriptor for an API Interface. Interfaces are also - * described as "protocol buffer services" in some contexts, such as - * by the "service" keyword in a .proto file, but they are different - * from API Services, which represent a concrete implementation of an interface - * as opposed to simply a description of methods and bindings. They are also - * sometimes simply referred to as "APIs" in other contexts, such as - * the name of this message itself. See - * https://cloud.google.com/apis/design/glossary for detailed terminology. - */ -export interface Schema$Api { - /** - * The methods of this interface, in unspecified order. - */ - methods: Schema$Method[]; - /** - * Included interfaces. See Mixin. - */ - mixins: Schema$Mixin[]; - /** - * The fully qualified name of this interface, including package name followed - * by the interface's simple name. - */ - name: string; - /** - * Any metadata attached to the interface. - */ - options: Schema$Option[]; - /** - * Source context for the protocol buffer service represented by this message. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax of the service. - */ - syntax: string; - /** - * A version string for this interface. If specified, must have the form - * `major-version.minor-version`, as in `1.10`. If the minor version is - * omitted, it defaults to zero. If the entire version field is empty, the - * major version is derived from the package name, as outlined below. If the - * field is not empty, the version in the package name will be verified to be - * consistent with what is provided here. The versioning schema uses - * [semantic versioning](http://semver.org) where the major version number - * indicates a breaking change and the minor version an additive, non-breaking - * change. Both version numbers are signals to users what to expect from - * different versions, and should be carefully chosen based on the product - * plan. The major version is also reflected in the package name of the - * interface, which must end in `v<major-version>`, as in - * `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. - * Zero major versions must only be used for experimental, non-GA interfaces. - */ - version: string; -} -/** - * `Authentication` defines the authentication configuration for an API. Example - * for an API targeted for external use: name: calendar.googleapis.com - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Authentication { - /** - * Defines a set of authentication providers that a service supports. - */ - providers: Schema$AuthProvider[]; - /** - * A list of authentication rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$AuthenticationRule[]; -} -/** - * Authentication rules for the service. By default, if a method has any - * authentication requirements, every request must include a valid credential - * matching one of the requirements. It's an error to include more than one - * kind of credential in a single request. If a method doesn't have any - * auth requirements, request credentials will be ignored. - */ -export interface Schema$AuthenticationRule { - /** - * If true, the service accepts API keys without any other credential. - */ - allowWithoutCredential: boolean; - /** - * Configuration for custom authentication. - */ - customAuth: Schema$CustomAuthRequirements; - /** - * The requirements for OAuth credentials. - */ - oauth: Schema$OAuthRequirements; - /** - * Requirements for additional authentication providers. - */ - requirements: Schema$AuthRequirement[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration of authorization. This section determines the authorization - * provider, if unspecified, then no authorization check will be done. Example: - * experimental: authorization: provider: - * firebaserules.googleapis.com - */ -export interface Schema$AuthorizationConfig { - /** - * The name of the authorization provider, such as - * firebaserules.googleapis.com. - */ - provider: string; -} -/** - * Authorization rule for API services. It specifies the permission(s) required - * for an API element for the overall API request to succeed. It is typically - * used to mark request message fields that contain the name of the resource and - * indicates the permissions that will be checked on that resource. For - * example: package google.storage.v1; message CopyObjectRequest { - * string source = 1 [ (google.api.authz).permissions = - * "storage.objects.get"]; string destination = 2 [ - * (google.api.authz).permissions = - * "storage.objects.create,storage.objects.update"]; } - */ -export interface Schema$AuthorizationRule { - /** - * The required permissions. The acceptable values vary depend on the - * authorization system used. For Google APIs, it should be a comma-separated - * Google IAM permission values. When multiple permissions are listed, the - * semantics is not defined by the system. Additional documentation must be - * provided manually. - */ - permissions: string; - /** - * Selects the API elements to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration for an anthentication provider, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthProvider { - /** - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * Redirect URL if JWT token is required but no present or is expired. - * Implement authorizationUrl of securityDefinitions in OpenAPI spec. - */ - authorizationUrl: string; - /** - * The unique identifier of the auth provider. It will be referred to by - * `AuthRequirement.provider_id`. Example: "bookstore_auth". - */ - id: string; - /** - * Identifies the principal that issued the JWT. See - * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - * Usually a URL or an email address. Example: https://securetoken.google.com - * Example: 1234567-compute@developer.gserviceaccount.com - */ - issuer: string; - /** - * URL of the provider's public key set to validate signature of the JWT. - * See [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - * Optional if the key set document: - can be retrieved from [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of - * the issuer. - can be inferred from the email domain of the issuer (e.g. a - * Google service account). Example: - * https://www.googleapis.com/oauth2/v1/certs - */ - jwksUri: string; -} -/** - * User-defined authentication requirements, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthRequirement { - /** - * NOTE: This will be deprecated soon, once AuthProvider.audiences is - * implemented and accepted in all the runtime components. The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * id from authentication provider. Example: provider_id: bookstore_auth - */ - providerId: string; -} -/** - * `Backend` defines the backend configuration for a service. - */ -export interface Schema$Backend { - /** - * A list of API backend rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$BackendRule[]; -} -/** - * A backend rule provides configuration for an individual API element. - */ -export interface Schema$BackendRule { - /** - * The address of the API backend. - */ - address: string; - /** - * The number of seconds to wait for a response from a request. The default - * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds. - */ - deadline: number; - /** - * Minimum deadline in seconds needed for this method. Calls having deadline - * value lower than this will be rejected. - */ - minDeadline: number; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Billing related configuration of the service. The following example shows - * how to configure monitored resources and metrics for billing: - * monitored_resources: - type: library.googleapis.com/branch labels: - * - key: /city description: The city where the library branch is - * located in. - key: /name description: The name of the branch. - * metrics: - name: library.googleapis.com/book/borrowed_count metric_kind: - * DELTA value_type: INT64 billing: consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/borrowed_count - */ -export interface Schema$Billing { - /** - * Billing configurations for sending metrics to the consumer project. There - * can be multiple consumer destinations per service, each one must have a - * different monitored resource type. A metric can be used in at most one - * consumer destination. - */ - consumerDestinations: Schema$BillingDestination[]; -} -/** - * Describes billing configuration for a new tenant project. - */ -export interface Schema$BillingConfig { - /** - * Name of the billing account. For example - * `billingAccounts/012345-567890-ABCDEF`. - */ - billingAccount: string; -} -/** - * Configuration of a specific billing destination (Currently only support bill - * against consumer project). - */ -export interface Schema$BillingDestination { - /** - * Names of the metrics to report to this billing destination. Each name must - * be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * `Context` defines which contexts an API requests. Example: context: - * rules: - selector: "*" requested: - - * google.rpc.context.ProjectContext - google.rpc.context.OriginContext - * The above specifies that all methods in the API request - * `google.rpc.context.ProjectContext` and `google.rpc.context.OriginContext`. - * Available context types are defined in package `google.rpc.context`. This - * also provides mechanism to whitelist any protobuf message extension that can - * be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and - * “x-goog-ext-<extension_id>-jspb” format. For example, list any service - * specific protobuf types that can appear in grpc metadata as follows in your - * yaml file: Example: context: rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allowed_request_extensions: - google.foo.v1.NewExtension - * allowed_response_extensions: - google.foo.v1.NewExtension You can - * also specify extension ID instead of fully qualified extension name here. - */ -export interface Schema$Context { - /** - * A list of RPC context rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$ContextRule[]; -} -/** - * A context rule provides information about the context for an individual API - * element. - */ -export interface Schema$ContextRule { - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from client to backend. - */ - allowedRequestExtensions: string[]; - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from backend to client. - */ - allowedResponseExtensions: string[]; - /** - * A list of full type names of provided contexts. - */ - provided: string[]; - /** - * A list of full type names of requested contexts. - */ - requested: string[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Selects and configures the service controller used by the service. The - * service controller handles features like abuse, quota, billing, logging, - * monitoring, etc. - */ -export interface Schema$Control { - /** - * The service control environment to use. If empty, no control plane feature - * (like quota and billing) will be enabled. - */ - environment: string; -} -/** - * Request to create a tenancy unit for a consumer of a service. - */ -export interface Schema$CreateTenancyUnitRequest { - /** - * Optional producer provided identifier of the tenancy unit. Must be no - * longer than 40 characters and preferably URI friendly. If it is not - * provided, a UID for the tenancy unit will be auto generated. It must be - * unique across a service. If the tenancy unit already exists for the service - * and consumer pair, `CreateTenancyUnit` will return the existing tenancy - * unit if the provided identifier is identical or empty, otherwise the call - * will fail. - */ - tenancyUnitId: string; -} -/** - * Configuration for a custom authentication provider. - */ -export interface Schema$CustomAuthRequirements { - /** - * A configuration string containing connection information for the - * authentication provider, typically formatted as a SmartService string - * (go/smartservice). - */ - provider: string; -} -/** - * Customize service error responses. For example, list any service specific - * protobuf types that can appear in error detail lists of error responses. - * Example: custom_error: types: - google.foo.v1.CustomError - - * google.foo.v1.AnotherError - */ -export interface Schema$CustomError { - /** - * The list of custom error rules that apply to individual API messages. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$CustomErrorRule[]; - /** - * The list of custom error detail types, e.g. - * 'google.foo.v1.CustomError'. - */ - types: string[]; -} -/** - * A custom error rule. - */ -export interface Schema$CustomErrorRule { - /** - * Mark this message as possible payload in error response. Otherwise, - * objects of this type will be filtered when they appear in error payload. - */ - isErrorType: boolean; - /** - * Selects messages to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A custom pattern is used for defining custom HTTP verb. - */ -export interface Schema$CustomHttpPattern { - /** - * The name of this custom HTTP verb. - */ - kind: string; - /** - * The path matched by this custom verb. - */ - path: string; -} -/** - * `Documentation` provides the information for describing a service. Example: - * <pre><code>documentation: summary: > The Google Calendar - * API gives access to most calendar features. pages: - name: Overview - * content: &#40;== include google/foo/overview.md ==&#41; - name: - * Tutorial content: &#40;== include google/foo/tutorial.md ==&#41; - * subpages; - name: Java content: &#40;== include - * google/foo/tutorial_java.md ==&#41; rules: - selector: - * google.calendar.Calendar.Get description: > ... - selector: - * google.calendar.Calendar.Put description: > ... - * </code></pre> Documentation is provided in markdown syntax. In - * addition to standard markdown features, definition lists, tables and fenced - * code blocks are supported. Section headers can be provided and are - * interpreted relative to the section nesting of the context where a - * documentation fragment is embedded. Documentation from the IDL is merged - * with documentation defined via the config at normalization time, where - * documentation provided by config rules overrides IDL provided. A number of - * constructs specific to the API platform are supported in documentation text. - * In order to reference a proto element, the following notation can be used: - * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> - * To override the display text used for the link, this can be used: - * <pre><code>&#91;display - * text]&#91;fully.qualified.proto.name]</code></pre> Text can - * be excluded from doc using the following notation: - * <pre><code>&#40;-- internal comment - * --&#41;</code></pre> A few directives are available in - * documentation. Note that directives must appear on a single line to be - * properly identified. The `include` directive includes a markdown file from an - * external source: <pre><code>&#40;== include path/to/file - * ==&#41;</code></pre> The `resource_for` directive marks a - * message to be the resource of a collection in REST view. If it is not - * specified, tools attempt to infer the resource from the operations in a - * collection: <pre><code>&#40;== resource_for v1.shelves.books - * ==&#41;</code></pre> The directive `suppress_warning` does - * not directly affect documentation and is documented together with service - * config validation. - */ -export interface Schema$Documentation { - /** - * The URL to the root of documentation. - */ - documentationRootUrl: string; - /** - * Declares a single overview page. For example: - * <pre><code>documentation: summary: ... overview: - * &#40;== include overview.md ==&#41; </code></pre> This - * is a shortcut for the following declaration (using pages style): - * <pre><code>documentation: summary: ... pages: - name: - * Overview content: &#40;== include overview.md ==&#41; - * </code></pre> Note: you cannot specify both `overview` field - * and `pages` field. - */ - overview: string; - /** - * The top level pages for the documentation set. - */ - pages: Schema$Page[]; - /** - * A list of documentation rules that apply to individual API elements. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$DocumentationRule[]; - /** - * A short summary of what the service does. Can only be provided by plain - * text. - */ - summary: string; -} -/** - * A documentation rule provides information about individual API elements. - */ -export interface Schema$DocumentationRule { - /** - * Deprecation description of the selected element(s). It can be provided if - * an element is marked as `deprecated`. - */ - deprecationDescription: string; - /** - * Description of the selected API(s). - */ - description: string; - /** - * The selector is a comma-separated list of patterns. Each pattern is a - * qualified name of the element which may end in "*", indicating a - * wildcard. Wildcards are only allowed at the end and for a whole component - * of the qualified name, i.e. "foo.*" is ok, but not - * "foo.b*" or "foo.*.bar". To specify a default for all - * applicable elements, the whole pattern "*" is used. - */ - selector: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * `Endpoint` describes a network endpoint that serves a set of APIs. A service - * may expose any number of endpoints, and all endpoints share the same service - * configuration, such as quota configuration and monitoring configuration. - * Example service configuration: name: library-example.googleapis.com - * endpoints: # Below entry makes - * 'google.example.library.v1.Library' # API be served from - * endpoint address library-example.googleapis.com. # It also allows HTTP - * OPTIONS calls to be passed to the backend, for # it to decide whether - * the subsequent cross-origin request is # allowed to proceed. - - * name: library-example.googleapis.com allow_cors: true - */ -export interface Schema$Endpoint { - /** - * DEPRECATED: This field is no longer supported. Instead of using aliases, - * please specify multiple google.api.Endpoint for each of the intended - * aliases. Additional names that this endpoint will be hosted on. - */ - aliases: string[]; - /** - * Allowing - * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - * cross-domain traffic, would allow the backends served from this endpoint to - * receive and respond to HTTP OPTIONS requests. The response will be used by - * the browser to determine whether the subsequent cross-origin request is - * allowed to proceed. - */ - allowCors: boolean; - /** - * The list of features enabled on this endpoint. - */ - features: string[]; - /** - * The canonical name of this endpoint. - */ - name: string; - /** - * The specification of an Internet routable address of API frontend that will - * handle requests to this [API - * Endpoint](https://cloud.google.com/apis/design/glossary). It should be - * either a valid IPv4 address or a fully-qualified domain name. For example, - * "8.8.8.8" or "myservice.appspot.com". - */ - target: string; -} -/** - * Enum type definition. - */ -export interface Schema$Enum { - /** - * Enum value definitions. - */ - enumvalue: Schema$EnumValue[]; - /** - * Enum type name. - */ - name: string; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; - /** - * The source context. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax. - */ - syntax: string; -} -/** - * Enum value definition. - */ -export interface Schema$EnumValue { - /** - * Enum value name. - */ - name: string; - /** - * Enum value number. - */ - number: number; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; -} -/** - * Experimental service configuration. These configuration options can only be - * used by whitelisted users. - */ -export interface Schema$Experimental { - /** - * Authorization configuration. - */ - authorization: Schema$AuthorizationConfig; -} -/** - * A single field of a message type. - */ -export interface Schema$Field { - /** - * The field cardinality. - */ - cardinality: string; - /** - * The string value of the default value of this field. Proto2 syntax only. - */ - defaultValue: string; - /** - * The field JSON name. - */ - jsonName: string; - /** - * The field type. - */ - kind: string; - /** - * The field name. - */ - name: string; - /** - * The field number. - */ - number: number; - /** - * The index of the field type in `Type.oneofs`, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ - oneofIndex: number; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * Whether to use alternative packed wire representation. - */ - packed: boolean; - /** - * The field type URL, without the scheme, for message or enumeration types. - * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - */ - typeUrl: string; -} -/** - * Defines the HTTP configuration for an API service. It contains a list of - * HttpRule, each specifying the mapping of an RPC method to one or more HTTP - * REST API methods. - */ -export interface Schema$Http { - /** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where - * "%2F" will be left encoded. The default behavior is to not - * decode RFC 6570 reserved characters in multi segment matches. - */ - fullyDecodeReservedExpansion: boolean; - /** - * A list of HTTP configuration rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$HttpRule[]; -} -/** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST API - * methods. The mapping specifies how different portions of the RPC request - * message are mapped to URL path, URL query parameters, and HTTP request body. - * The mapping is typically specified as an `google.api.http` annotation on the - * RPC method, see "google/api/annotations.proto" for details. The - * mapping consists of a field specifying the path template and method kind. The - * path template can refer to fields in the request message, as in the example - * below which describes a REST GET operation on a resource collection of - * messages: service Messaging { rpc GetMessage(GetMessageRequest) - * returns (Message) { option (google.api.http).get = - * "/v1/messages/{message_id}/{sub.subfield}"; } } message - * GetMessageRequest { message SubMessage { string subfield = 1; - * } string message_id = 1; // mapped to the URL SubMessage sub = 2; - * // `sub.subfield` is url-mapped } message Message { string text - * = 1; // content of the resource } The same http annotation can - * alternatively be expressed inside the `GRPC API Configuration` YAML file. - * http: rules: - selector: - * <proto_package_name>.Messaging.GetMessage get: - * /v1/messages/{message_id}/{sub.subfield} This definition enables an - * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC - * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: - * "123456" sub: SubMessage(subfield: "foo"))` In general, - * not only fields but also field paths can be referenced from a path pattern. - * Fields mapped to the path pattern cannot be repeated and must have a - * primitive (non-message) type. Any fields in the request message which are - * not bound by the path pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: service - * Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}"; } - * } message GetMessageRequest { message SubMessage { string - * subfield = 1; } string message_id = 1; // mapped to the URL int64 - * revision = 2; // becomes a parameter SubMessage sub = 3; // - * `sub.subfield` becomes a parameter } This enables a HTTP JSON to RPC - * mapping as below: HTTP | RPC -----|----- `GET - * /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: - * SubMessage(subfield: "foo"))` Note that fields which are mapped to - * HTTP parameters must have a primitive type or a repeated primitive type. - * Message types are not allowed. In the case of a repeated type, the parameter - * can be repeated in the URL, as in `...?param=A&param=B`. For HTTP method - * kinds which allow a request body, the `body` field specifies the mapping. - * Consider a REST update method on the message resource collection: service - * Messaging { rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { put: - * "/v1/messages/{message_id}" body: "message" }; - * } } message UpdateMessageRequest { string message_id = 1; // - * mapped to the URL Message message = 2; // mapped to the body } - * The following HTTP JSON to RPC mapping is enabled, where the representation - * of the JSON in the request body is determined by protos JSON encoding: HTTP - * | RPC -----|----- `PUT /v1/messages/123456 { "text": - * "Hi!" }` | `UpdateMessage(message_id: "123456" message { - * text: "Hi!" })` The special name `*` can be used in the body - * mapping to define that every field not bound by the path template should be - * mapped to the request body. This enables the following alternative - * definition of the update method: service Messaging { rpc - * UpdateMessage(Message) returns (Message) { option (google.api.http) = - * { put: "/v1/messages/{message_id}" body: - * "*" }; } } message Message { string - * message_id = 1; string text = 2; } The following HTTP JSON to RPC - * mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { - * "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` Note that when using `*` in the - * body mapping, it is not possible to have HTTP parameters, as all fields not - * bound by the path end in the body. This makes this option more rarely used in - * practice of defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. It is possible to - * define multiple HTTP methods for one RPC by using the `additional_bindings` - * option. Example: service Messaging { rpc - * GetMessage(GetMessageRequest) returns (Message) { option - * (google.api.http) = { get: "/v1/messages/{message_id}" - * additional_bindings { get: - * "/v1/users/{user_id}/messages/{message_id}" } }; - * } } message GetMessageRequest { string message_id = 1; string - * user_id = 2; } This enables the following two alternative HTTP JSON to - * RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | - * `GetMessage(message_id: "123456")` `GET - * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" - * message_id: "123456")` # Rules for HTTP mapping The rules for - * mapping HTTP path, query parameters, and body fields to the request message - * are as follows: 1. The `body` field specifies either `*` or a field path, or - * is omitted. If omitted, it indicates there is no HTTP request body. 2. - * Leaf fields (recursive expansion of nested messages in the request) can be - * classified into three types: (a) Matched in the URL template. (b) - * Covered by body (if body is `*`, everything except (a) fields; else - * everything under the body field) (c) All other fields. 3. URL query - * parameters found in the HTTP request are mapped to (c) fields. 4. Any body - * sent with an HTTP request can contain only (b) fields. The syntax of the - * path template is as follows: Template = "/" Segments [ Verb ] - * ; Segments = Segment { "/" Segment } ; Segment = - * "*" | "**" | LITERAL | Variable ; Variable = - * "{" FieldPath [ "=" Segments ] "}" ; FieldPath - * = IDENT { "." IDENT } ; Verb = ":" LITERAL ; The - * syntax `*` matches a single path segment. The syntax `**` matches zero or - * more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. The syntax - * `Variable` matches part of the URL path as specified by its template. A - * variable template must not contain other variables. If a variable matches a - * single path segment, its template may be omitted, e.g. `{var}` is equivalent - * to `{var=*}`. If a variable contains exactly one path segment, such as - * `"{var}"` or `"{var=*}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as `{var}`. - * If a variable contains one or more path segments, such as - * `"{var=foo/*}"` or `"{var=**}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~/0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as - * `{+var}`. NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** match RFC 6570 Reserved - * Expansion. The reason is that the Reserved Expansion does not expand special - * characters like `?` and `#`, which would lead to invalid URLs. NOTE: the - * field paths in variables and in the `body` must not refer to repeated fields - * or map fields. - */ -export interface Schema$HttpRule { - /** - * Additional HTTP bindings for the selector. Nested bindings must not contain - * an `additional_bindings` field themselves (that is, the nesting may only be - * one level deep). - */ - additionalBindings: Schema$HttpRule[]; - /** - * Specifies the permission(s) required for an API element for the overall API - * request to succeed. It is typically used to mark request message fields - * that contain the name of the resource and indicates the permissions that - * will be checked on that resource. - */ - authorizations: Schema$AuthorizationRule[]; - /** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. - */ - body: string; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave - * the HTTP method unspecified for this rule. The wild-card rule is useful for - * services that provide content to Web (HTML) clients. - */ - custom: Schema$CustomHttpPattern; - /** - * Used for deleting a resource. - */ - delete: string; - /** - * Used for listing and getting information about resources. - */ - get: string; - /** - * Use this only for Scotty Requests. Do not use this for bytestream methods. - * For media support, add instead [][google.bytestream.RestByteStream] as an - * API to your configuration. - */ - mediaDownload: Schema$MediaDownload; - /** - * Use this only for Scotty Requests. Do not use this for media support using - * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to - * your configuration for Bytestream methods. - */ - mediaUpload: Schema$MediaUpload; - /** - * Used for updating a resource. - */ - patch: string; - /** - * Used for creating a resource. - */ - post: string; - /** - * Used for updating a resource. - */ - put: string; - /** - * DO NOT USE. This is an experimental field. Optional. The REST collection - * name is by default derived from the URL pattern. If specified, this field - * overrides the default collection name. Example: rpc - * AddressesAggregatedList(AddressesAggregatedListRequest) returns - * (AddressesAggregatedListResponse) { option (google.api.http) = { get: - * "/v1/projects/{project_id}/aggregated/addresses" rest_collection: - * "projects.addresses" }; } This method has the - * automatically derived collection name "projects.aggregated". - * Because, semantically, this rpc is actually an operation on the - * "projects.addresses" collection, the `rest_collection` field is - * configured to override the derived collection name. - */ - restCollection: string; - /** - * DO NOT USE. This is an experimental field. Optional. The rest method name - * is by default derived from the URL pattern. If specified, this field - * overrides the default method name. Example: rpc - * CreateResource(CreateResourceRequest) returns - * (CreateResourceResponse) { option (google.api.http) = { post: - * "/v1/resources", body: "resource", - * rest_method_name: "insert" }; } This method has the - * automatically derived rest method name "create", but for - * backwards compatibility with apiary, it is specified as insert. - */ - restMethodName: string; - /** - * Selects methods to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response for the list request. - */ -export interface Schema$ListTenancyUnitsResponse { - /** - * Pagination token for large results. - */ - nextPageToken: string; - /** - * Tenancy units matching the request. - */ - tenancyUnits: Schema$TenancyUnit[]; -} -/** - * A description of a log type. Example in YAML format: - name: - * library.googleapis.com/activity_history description: The history of - * borrowing and returning library items. display_name: Activity labels: - * - key: /customer_id description: Identifier of a library customer - */ -export interface Schema$LogDescriptor { - /** - * A human-readable description of this log. This information appears in the - * documentation and can contain details. - */ - description: string; - /** - * The human-readable name for this log. This information appears on the user - * interface and should be concise. - */ - displayName: string; - /** - * The set of labels that are available to describe a specific log entry. - * Runtime requests that contain labels not specified here are considered - * invalid. - */ - labels: Schema$LabelDescriptor[]; - /** - * The name of the log. It must be less than 512 characters long and can - * include the following characters: upper- and lower-case alphanumeric - * characters [A-Za-z0-9], and punctuation characters including slash, - * underscore, hyphen, period [/_-.]. - */ - name: string; -} -/** - * Logging configuration of the service. The following example shows how to - * configure logs to be sent to the producer and consumer projects. In the - * example, the `activity_history` log is sent to both the producer and consumer - * projects, whereas the `purchase_history` log is only sent to the producer - * project. monitored_resources: - type: library.googleapis.com/branch - * labels: - key: /city description: The city where the library - * branch is located in. - key: /name description: The name of the - * branch. logs: - name: activity_history labels: - key: - * /customer_id - name: purchase_history logging: producer_destinations: - * - monitored_resource: library.googleapis.com/branch logs: - - * activity_history - purchase_history consumer_destinations: - - * monitored_resource: library.googleapis.com/branch logs: - - * activity_history - */ -export interface Schema$Logging { - /** - * Logging configurations for sending logs to the consumer project. There can - * be multiple consumer destinations, each one must have a different monitored - * resource type. A log can be used in at most one consumer destination. - */ - consumerDestinations: Schema$LoggingDestination[]; - /** - * Logging configurations for sending logs to the producer project. There can - * be multiple producer destinations, each one must have a different monitored - * resource type. A log can be used in at most one producer destination. - */ - producerDestinations: Schema$LoggingDestination[]; -} -/** - * Configuration of a specific logging destination (the producer project or the - * consumer project). - */ -export interface Schema$LoggingDestination { - /** - * Names of the logs to be sent to this destination. Each name must be defined - * in the Service.logs section. If the log name is not a domain scoped name, - * it will be automatically prefixed with the service name followed by - * "/". - */ - logs: string[]; - /** - * The monitored resource type. The type must be defined in the - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * Defines the Media configuration for a service in case of a download. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaDownload { - /** - * A boolean that determines whether a notification for the completion of a - * download should be sent to the backend. - */ - completeNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the download service if one is used for download. - */ - downloadService: string; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether download is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for direct download. The size is specified - * in bytes. - */ - maxDirectDownloadSize: string; - /** - * A boolean that determines if direct download from ESF should be used for - * download of this media. - */ - useDirectDownload: boolean; -} -/** - * Defines the Media configuration for a service in case of an upload. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaUpload { - /** - * A boolean that determines whether a notification for the completion of an - * upload should be sent to the backend. These notifications will not be seen - * by the client and will not consume quota. - */ - completeNotification: boolean; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether upload is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for an upload. The size is specified in - * bytes. - */ - maxSize: string; - /** - * An array of mimetype patterns. Esf will only accept uploads that match one - * of the given patterns. - */ - mimeTypes: string[]; - /** - * Whether to receive a notification for progress changes of media upload. - */ - progressNotification: boolean; - /** - * Whether to receive a notification on the start of media upload. - */ - startNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the upload service if one is used for upload. - */ - uploadService: string; -} -/** - * Method represents a method of an API interface. - */ -export interface Schema$Method { - /** - * The simple name of this method. - */ - name: string; - /** - * Any metadata attached to the method. - */ - options: Schema$Option[]; - /** - * If true, the request is streamed. - */ - requestStreaming: boolean; - /** - * A URL of the input message type. - */ - requestTypeUrl: string; - /** - * If true, the response is streamed. - */ - responseStreaming: boolean; - /** - * The URL of the output message type. - */ - responseTypeUrl: string; - /** - * The source syntax of this method. - */ - syntax: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric type has a - * label for the HTTP response code, `response_code`, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * `custom.googleapis.com`. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported - * units are a subset of [The Unified Code for Units of - * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units - * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute * - * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo (10**3) * - * `M` mega (10**6) * `G` giga (10**9) * `T` tera (10**12) * - * `P` peta (10**15) * `E` exa (10**18) * `Z` zetta - * (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * `u` micro - * (10**-6) * `n` nano (10**-9) * `p` pico (10**-12) * `f` femto - * (10**-15) * `a` atto (10**-18) * `z` zepto (10**-21) * `y` - * yocto (10**-24) * `Ki` kibi (2**10) * `Mi` mebi (2**20) * - * `Gi` gibi (2**30) * `Ti` tebi (2**40) **Grammar** The grammar - * also includes these connectors: * `/` division (as an infix operator, - * e.g. `1/s`). * `.` multiplication (as an infix operator, e.g. `GBy.d`) - * The grammar for a unit is as follows: Expression = Component { - * "." Component } { "/" Component } ; Component = ( - * [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation - * | "1" ; Annotation = "{" NAME - * "}" ; Notes: * `Annotation` is just a comment if it follows a - * `UNIT` and is equivalent to `1` if it is used alone. For examples, - * `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. * `NAME` is a sequence - * of non-blank printable ASCII characters not containing '{' or - * '}'. * `1` represents dimensionless value 1, such as in `1/s`. * - * `%` represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of `metric_kind` and `value_type` might not be supported. - */ - valueType: string; -} -/** - * Bind API methods to metrics. Binding a method to a metric causes that - * metric's configured quota behaviors to apply to the method call. - */ -export interface Schema$MetricRule { - /** - * Metrics to update when the selected methods are called, and the associated - * cost applied to each metric. The key of the map is the metric name, and - * the values are the amount increased for the metric against which the quota - * limits are defined. The value must not be negative. - */ - metricCosts: any; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Declares an API Interface to be included in this interface. The including - * interface must redeclare all the methods from the included interface, but - * documentation and options are inherited as follows: - If after comment and - * whitespace stripping, the documentation string of the redeclared method is - * empty, it will be inherited from the original method. - Each annotation - * belonging to the service config (http, visibility) which is not set in the - * redeclared method will be inherited. - If an http annotation is inherited, - * the path pattern will be modified as follows. Any version prefix will be - * replaced by the version of the including interface plus the root path if - * specified. Example of a simple mixin: package google.acl.v1; service - * AccessControl { // Get the underlying ACL object. rpc - * GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = - * "/v1/{resource=**}:getAcl"; } } package - * google.storage.v2; service Storage { // rpc - * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc - * GetData(GetDataRequest) returns (Data) { option (google.api.http).get - * = "/v2/{resource=**}"; } } Example of a mixin - * configuration: apis: - name: google.storage.v2.Storage mixins: - * - name: google.acl.v1.AccessControl The mixin construct implies that all - * methods in `AccessControl` are also declared with same name and - * request/response types in `Storage`. A documentation generator or annotation - * processor will see the effective `Storage.GetAcl` method after inherting - * documentation and annotations as follows: service Storage { // Get - * the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { - * option (google.api.http).get = "/v2/{resource=**}:getAcl"; } - * ... } Note how the version in the path pattern changed from `v1` to - * `v2`. If the `root` field in the mixin is specified, it should be a relative - * path under which inherited HTTP paths are placed. Example: apis: - - * name: google.storage.v2.Storage mixins: - name: - * google.acl.v1.AccessControl root: acls This implies the following - * inherited HTTP annotation: service Storage { // Get the underlying - * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option - * (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; } - * ... } - */ -export interface Schema$Mixin { - /** - * The fully qualified name of the interface which is included. - */ - name: string; - /** - * If non-empty specifies a path under which inherited HTTP paths are rooted. - */ - root: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource - * descriptor for Google Compute Engine VM instances has a type of - * `"gce_instance"` and specifies the use of the labels - * `"instance_id"` and `"zone"` to identify particular VM - * instances. Different APIs can support different monitored resource types. - * APIs generally provide a `list` method that returns the monitored resource - * descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, `"Google Cloud - * SQL Database"`. - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and - * `"zone"`. - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` - * where {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - * The maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Monitoring configuration of the service. The example below shows how to - * configure monitored resources and metrics for monitoring. In the example, a - * monitored resource and two metrics are defined. The - * `library.googleapis.com/book/returned_count` metric is sent to both producer - * and consumer projects, whereas the - * `library.googleapis.com/book/overdue_count` metric is only sent to the - * consumer project. monitored_resources: - type: - * library.googleapis.com/branch labels: - key: /city description: - * The city where the library branch is located in. - key: /name - * description: The name of the branch. metrics: - name: - * library.googleapis.com/book/returned_count metric_kind: DELTA - * value_type: INT64 labels: - key: /customer_id - name: - * library.googleapis.com/book/overdue_count metric_kind: GAUGE - * value_type: INT64 labels: - key: /customer_id monitoring: - * producer_destinations: - monitored_resource: - * library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count - - * library.googleapis.com/book/overdue_count - */ -export interface Schema$Monitoring { - /** - * Monitoring configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one consumer - * destination. - */ - consumerDestinations: Schema$MonitoringDestination[]; - /** - * Monitoring configurations for sending metrics to the producer project. - * There can be multiple producer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one producer - * destination. - */ - producerDestinations: Schema$MonitoringDestination[]; -} -/** - * Configuration of a specific monitoring destination (the producer project or - * the consumer project). - */ -export interface Schema$MonitoringDestination { - /** - * Names of the metrics to report to this monitoring destination. Each name - * must be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * OAuth scopes are a way to define data and permissions on data. For example, - * there are scopes defined for "Read-only access to Google Calendar" - * and "Access to Cloud Platform". Users can consent to a scope for an - * application, giving it permission to access that data on their behalf. OAuth - * scope specifications should be fairly coarse grained; a user will need to see - * and understand the text description of what your scope means. In most cases: - * use one or at most two OAuth scopes for an entire family of products. If your - * product has multiple APIs, you should probably be sharing the OAuth scope - * across all of those APIs. When you need finer grained OAuth consent screens: - * talk with your product management about how developers will use them in - * practice. Please note that even though each of the canonical scopes is - * enough for a request to be accepted and passed to the backend, a request can - * still fail due to the backend requiring additional scopes or permissions. - */ -export interface Schema$OAuthRequirements { - /** - * The list of publicly documented OAuth scopes that are allowed access. An - * OAuth token containing any of these scopes will be accepted. Example: - * canonical_scopes: https://www.googleapis.com/auth/calendar, - * https://www.googleapis.com/auth/calendar.read - */ - canonicalScopes: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A protocol buffer option, which can be attached to a message, field, - * enumeration, etc. - */ -export interface Schema$Option { - /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, - * `"map_entry"`. For custom options, it should be the - * fully-qualified name. For example, `"google.api.http"`. - */ - name: string; - /** - * The option's value packed in an Any message. If the value is a - * primitive, the corresponding wrapper type defined in - * google/protobuf/wrappers.proto should be used. If the value is an enum, it - * should be stored as an int32 value using the google.protobuf.Int32Value - * type. - */ - value: any; -} -/** - * Represents a documentation page. A page can contain subpages to represent - * nested documentation set structure. - */ -export interface Schema$Page { - /** - * The Markdown content of the page. You can use <code>&#40;== - * include {path} ==&#41;</code> to include content from a Markdown - * file. - */ - content: string; - /** - * The name of the page. It will be used as an identity of the page to - * generate URI of the page, text of the link to this page in navigation, etc. - * The full page name (start from the root page name to this page concatenated - * with `.`) can be used as reference to the page in your documentation. For - * example: <pre><code>pages: - name: Tutorial content: - * &#40;== include tutorial.md ==&#41; subpages: - name: Java - * content: &#40;== include tutorial_java.md ==&#41; - * </code></pre> You can reference `Java` page using Markdown - * reference link syntax: `Java`. - */ - name: string; - /** - * Subpages of this page. The order of subpages specified here will be honored - * in the generated docset. - */ - subpages: Schema$Page[]; -} -/** - * Translates to IAM Policy bindings (without auditing at this level) - */ -export interface Schema$PolicyBinding { - /** - * Uses the same format as in IAM policy. `member` must include both prefix - * and ID. For example, `user:{emailId}`, `serviceAccount:{emailId}`, - * `group:{emailId}`. - */ - members: string[]; - /** - * Role. (https://cloud.google.com/iam/docs/understanding-roles) For example, - * `roles/viewer`, `roles/editor`, or `roles/owner`. - */ - role: string; -} -/** - * Quota configuration helps to achieve fairness and budgeting in service usage. - * The quota configuration works this way: - The service configuration defines a - * set of metrics. - For API calls, the quota.metric_rules maps methods to - * metrics with corresponding costs. - The quota.limits defines limits on the - * metrics, which will be used for quota checks at runtime. An example quota - * configuration in yaml format: quota: - name: apiWriteQpsPerProject - * metric: library.googleapis.com/write_calls unit: - * "1/min/{project}" # rate limit for consumer projects values: - * STANDARD: 10000 # The metric rules bind all methods to the read_calls - * metric, # except for the UpdateBook and DeleteBook methods. These two - * methods # are mapped to the write_calls metric, with the UpdateBook - * method # consuming at twice rate as the DeleteBook method. metric_rules: - * - selector: "*" metric_costs: - * library.googleapis.com/read_calls: 1 - selector: - * google.example.library.v1.LibraryService.UpdateBook metric_costs: - * library.googleapis.com/write_calls: 2 - selector: - * google.example.library.v1.LibraryService.DeleteBook metric_costs: - * library.googleapis.com/write_calls: 1 Corresponding Metric definition: - * metrics: - name: library.googleapis.com/read_calls display_name: - * Read requests metric_kind: DELTA value_type: INT64 - - * name: library.googleapis.com/write_calls display_name: Write requests - * metric_kind: DELTA value_type: INT64 - */ -export interface Schema$Quota { - /** - * List of `QuotaLimit` definitions for the service. - */ - limits: Schema$QuotaLimit[]; - /** - * List of `MetricRule` definitions, each one mapping a selected method to one - * or more metrics. - */ - metricRules: Schema$MetricRule[]; -} -/** - * `QuotaLimit` defines a specific limit that applies over a specified duration - * for a limit type. There can be at most one limit for a duration and limit - * type combination defined within a `QuotaGroup`. - */ -export interface Schema$QuotaLimit { - /** - * Default number of tokens that can be consumed during the specified - * duration. This is the number of tokens assigned when a client application - * developer activates the service for his/her project. Specifying a value of - * 0 will block all requests. This can be used if you are provisioning quota - * to selected consumers and blocking others. Similarly, a value of -1 will - * indicate an unlimited quota. No other negative values are allowed. Used by - * group-based quotas only. - */ - defaultLimit: string; - /** - * Optional. User-visible, extended description for this quota limit. Should - * be used only when more context is needed to understand this limit than - * provided by the limit's display name (see: `display_name`). - */ - description: string; - /** - * User-visible display name for this limit. Optional. If not set, the UI will - * provide a default display name based on the quota configuration. This field - * can be used to override the default display name generated from the - * configuration. - */ - displayName: string; - /** - * Duration of this limit in textual notation. Example: "100s", - * "24h", "1d". For duration longer than a day, only - * multiple of days is supported. We support only "100s" and - * "1d" for now. Additional support will be added in the future. - * "0" indicates indefinite duration. Used by group-based quotas - * only. - */ - duration: string; - /** - * Free tier value displayed in the Developers Console for this limit. The - * free tier is the number of tokens that will be subtracted from the billed - * amount when billing is enabled. This field can only be set on a limit with - * duration "1d", in a billable group; it is invalid on any other - * limit. If this field is not set, it defaults to 0, indicating that there is - * no free tier for this service. Used by group-based quotas only. - */ - freeTier: string; - /** - * Maximum number of tokens that can be consumed during the specified - * duration. Client application developers can override the default limit up - * to this maximum. If specified, this value cannot be set to a value less - * than the default limit. If not specified, it is set to the default limit. - * To allow clients to apply overrides with no upper bound, set this to -1, - * indicating unlimited maximum quota. Used by group-based quotas only. - */ - maxLimit: string; - /** - * The name of the metric this quota limit applies to. The quota limits with - * the same metric will be checked together during runtime. The metric must be - * defined within the service config. - */ - metric: string; - /** - * Name of the quota limit. The name must be provided, and it must be unique - * within the service. The name can only include alphanumeric characters as - * well as '-'. The maximum length of the limit name is 64 - * characters. - */ - name: string; - /** - * Specify the unit of the quota limit. It uses the same syntax as - * Metric.unit. The supported unit kinds are determined by the quota backend - * system. Here are some examples: * "1/min/{project}" for quota - * per minute per project. Note: the order of unit components is - * insignificant. The "1" at the beginning is required to follow the - * metric unit syntax. - */ - unit: string; - /** - * Tiered limit values. You must specify this as a key:value pair, with an - * integer value that is the maximum number of requests allowed for the - * specified unit. Currently only STANDARD is supported. - */ - values: any; -} -/** - * Request message to remove tenant project resource from the tenancy unit. - */ -export interface Schema$RemoveTenantProjectRequest { - /** - * Tag of the resource within the tenancy unit. - */ - tag: string; -} -/** - * Response for the search query. - */ -export interface Schema$SearchTenancyUnitsResponse { +export namespace serviceconsumermanagement_v1 { /** - * Pagination token for large results. - */ - nextPageToken: string; + * Service Consumer Management API + * + * Provides management methods for configuring service producer resources on + * Google Cloud. + * + * @example + * const google = require('googleapis'); + * const serviceconsumermanagement = google.serviceconsumermanagement('v1'); + * + * @namespace serviceconsumermanagement + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Serviceconsumermanagement + */ + export class Serviceconsumermanagement { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + operations: Resource$Operations; + services: Resource$Services; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.operations = new Resource$Operations(this); + this.services = new Resource$Services(this); + } + + getRoot() { + return this.root; + } + } + /** - * Tenancy Units matching the request. - */ - tenancyUnits: Schema$TenancyUnit[]; -} -/** - * `Service` is the root object of Google service configuration schema. It - * describes basic information about a service, such as the name and the title, - * and delegates other aspects to sub-sections. Each sub-section is either a - * proto message or a repeated proto message that configures a specific aspect, - * such as auth. See each proto message definition for details. Example: type: - * google.api.Service config_version: 3 name: calendar.googleapis.com - * title: Google Calendar API apis: - name: google.calendar.v3.Calendar - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Service { + * Request to add a newly created and configured tenant project to a tenancy + * unit. + */ + export interface Schema$AddTenantProjectRequest { + /** + * Configuration of the new tenant project that will be added to tenancy + * unit resources. + */ + projectConfig: Schema$TenantProjectConfig; + /** + * Tag of the added project. Must be less than 128 characters. Required. + */ + tag: string; + } /** - * A list of API interfaces exported by this service. Only the `name` field of - * the google.protobuf.Api needs to be provided by the configuration author, - * as the remaining fields will be derived from the IDL during the - * normalization process. It is an error to specify an API interface here - * which cannot be resolved against the associated IDL files. - */ - apis: Schema$Api[]; + * Api is a light-weight descriptor for an API Interface. Interfaces are also + * described as "protocol buffer services" in some contexts, such as + * by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an + * interface as opposed to simply a description of methods and bindings. They + * are also sometimes simply referred to as "APIs" in other + * contexts, such as the name of this message itself. See + * https://cloud.google.com/apis/design/glossary for detailed terminology. + */ + export interface Schema$Api { + /** + * The methods of this interface, in unspecified order. + */ + methods: Schema$Method[]; + /** + * Included interfaces. See Mixin. + */ + mixins: Schema$Mixin[]; + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + */ + name: string; + /** + * Any metadata attached to the interface. + */ + options: Schema$Option[]; + /** + * Source context for the protocol buffer service represented by this + * message. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax of the service. + */ + syntax: string; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to + * be consistent with what is provided here. The versioning schema uses + * [semantic versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users what to + * expect from different versions, and should be carefully chosen based on + * the product plan. The major version is also reflected in the package + * name of the interface, which must end in `v<major-version>`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can be + * omitted. Zero major versions must only be used for experimental, non-GA + * interfaces. + */ + version: string; + } /** - * Auth configuration. - */ - authentication: Schema$Authentication; + * `Authentication` defines the authentication configuration for an API. + * Example for an API targeted for external use: name: + * calendar.googleapis.com authentication: providers: - id: + * google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Authentication { + /** + * Defines a set of authentication providers that a service supports. + */ + providers: Schema$AuthProvider[]; + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$AuthenticationRule[]; + } /** - * API backend configuration. - */ - backend: Schema$Backend; + * Authentication rules for the service. By default, if a method has any + * authentication requirements, every request must include a valid credential + * matching one of the requirements. It's an error to include more than + * one kind of credential in a single request. If a method doesn't have + * any auth requirements, request credentials will be ignored. + */ + export interface Schema$AuthenticationRule { + /** + * If true, the service accepts API keys without any other credential. + */ + allowWithoutCredential: boolean; + /** + * Configuration for custom authentication. + */ + customAuth: Schema$CustomAuthRequirements; + /** + * The requirements for OAuth credentials. + */ + oauth: Schema$OAuthRequirements; + /** + * Requirements for additional authentication providers. + */ + requirements: Schema$AuthRequirement[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Billing configuration. - */ - billing: Schema$Billing; + * Configuration of authorization. This section determines the authorization + * provider, if unspecified, then no authorization check will be done. + * Example: experimental: authorization: provider: + * firebaserules.googleapis.com + */ + export interface Schema$AuthorizationConfig { + /** + * The name of the authorization provider, such as + * firebaserules.googleapis.com. + */ + provider: string; + } /** - * The semantic version of the service configuration. The config version - * affects the interpretation of the service configuration. For example, - * certain features are enabled by default for certain config versions. The - * latest config version is `3`. - */ - configVersion: number; + * Authorization rule for API services. It specifies the permission(s) + * required for an API element for the overall API request to succeed. It is + * typically used to mark request message fields that contain the name of the + * resource and indicates the permissions that will be checked on that + * resource. For example: package google.storage.v1; message + * CopyObjectRequest { string source = 1 [ + * (google.api.authz).permissions = "storage.objects.get"]; string + * destination = 2 [ (google.api.authz).permissions = + * "storage.objects.create,storage.objects.update"]; } + */ + export interface Schema$AuthorizationRule { + /** + * The required permissions. The acceptable values vary depend on the + * authorization system used. For Google APIs, it should be a + * comma-separated Google IAM permission values. When multiple permissions + * are listed, the semantics is not defined by the system. Additional + * documentation must be provided manually. + */ + permissions: string; + /** + * Selects the API elements to which this rule applies. Refer to selector + * for syntax details. + */ + selector: string; + } /** - * Context configuration. - */ - context: Schema$Context; + * Configuration for an anthentication provider, including support for [JSON + * Web Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthProvider { + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * Redirect URL if JWT token is required but no present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + */ + authorizationUrl: string; + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. Example: "bookstore_auth". + */ + id: string; + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. Example: + * https://securetoken.google.com Example: + * 1234567-compute@developer.gserviceaccount.com + */ + issuer: string; + /** + * URL of the provider's public key set to validate signature of the + * JWT. See [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: - can be retrieved from [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of + * the issuer. - can be inferred from the email domain of the issuer (e.g. + * a Google service account). Example: + * https://www.googleapis.com/oauth2/v1/certs + */ + jwksUri: string; + } /** - * Configuration for the service control plane. - */ - control: Schema$Control; + * User-defined authentication requirements, including support for [JSON Web + * Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthRequirement { + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * id from authentication provider. Example: provider_id: + * bookstore_auth + */ + providerId: string; + } /** - * Custom error configuration. + * `Backend` defines the backend configuration for a service. */ - customError: Schema$CustomError; + export interface Schema$Backend { + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$BackendRule[]; + } /** - * Additional API documentation. - */ - documentation: Schema$Documentation; + * A backend rule provides configuration for an individual API element. + */ + export interface Schema$BackendRule { + /** + * The address of the API backend. + */ + address: string; + /** + * The number of seconds to wait for a response from a request. The default + * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 + * seconds. + */ + deadline: number; + /** + * Minimum deadline in seconds needed for this method. Calls having deadline + * value lower than this will be rejected. + */ + minDeadline: number; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Configuration for network endpoints. If this is empty, then an endpoint - * with the same name as the service is automatically generated to service all - * defined APIs. - */ - endpoints: Schema$Endpoint[]; + * Billing related configuration of the service. The following example shows + * how to configure monitored resources and metrics for billing: + * monitored_resources: - type: library.googleapis.com/branch labels: - + * key: /city description: The city where the library branch is + * located in. - key: /name description: The name of the branch. + * metrics: - name: library.googleapis.com/book/borrowed_count + * metric_kind: DELTA value_type: INT64 billing: + * consumer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/borrowed_count + */ + export interface Schema$Billing { + /** + * Billing configurations for sending metrics to the consumer project. There + * can be multiple consumer destinations per service, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$BillingDestination[]; + } /** - * A list of all enum types included in this API service. Enums referenced - * directly or indirectly by the `apis` are automatically included. Enums - * which are not referenced but shall be included should be listed here by - * name. Example: enums: - name: google.someapi.v1.SomeEnum + * Describes billing configuration for a new tenant project. */ - enums: Schema$Enum[]; + export interface Schema$BillingConfig { + /** + * Name of the billing account. For example + * `billingAccounts/012345-567890-ABCDEF`. + */ + billingAccount: string; + } /** - * Experimental configuration. - */ - experimental: Schema$Experimental; + * Configuration of a specific billing destination (Currently only support + * bill against consumer project). + */ + export interface Schema$BillingDestination { + /** + * Names of the metrics to report to this billing destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * HTTP configuration. - */ - http: Schema$Http; + * The request message for Operations.CancelOperation. + */ + export interface Schema$CancelOperationRequest {} + /** + * `Context` defines which contexts an API requests. Example: context: + * rules: - selector: "*" requested: - + * google.rpc.context.ProjectContext - + * google.rpc.context.OriginContext The above specifies that all methods in + * the API request `google.rpc.context.ProjectContext` and + * `google.rpc.context.OriginContext`. Available context types are defined in + * package `google.rpc.context`. This also provides mechanism to whitelist + * any protobuf message extension that can be sent in grpc metadata using + * “x-goog-ext-<extension_id>-bin” and + * “x-goog-ext-<extension_id>-jspb” format. For example, list any + * service specific protobuf types that can appear in grpc metadata as follows + * in your yaml file: Example: context: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allowed_request_extensions: - google.foo.v1.NewExtension + * allowed_response_extensions: - google.foo.v1.NewExtension You can + * also specify extension ID instead of fully qualified extension name here. + */ + export interface Schema$Context { + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$ContextRule[]; + } /** - * A unique ID for a specific instance of this message, typically assigned by - * the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ - id: string; + * A context rule provides information about the context for an individual API + * element. + */ + export interface Schema$ContextRule { + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + */ + allowedRequestExtensions: string[]; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + */ + allowedResponseExtensions: string[]; + /** + * A list of full type names of provided contexts. + */ + provided: string[]; + /** + * A list of full type names of requested contexts. + */ + requested: string[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Logging configuration. + * Selects and configures the service controller used by the service. The + * service controller handles features like abuse, quota, billing, logging, + * monitoring, etc. */ - logging: Schema$Logging; + export interface Schema$Control { + /** + * The service control environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. + */ + environment: string; + } /** - * Defines the logs used by this service. - */ - logs: Schema$LogDescriptor[]; + * Request to create a tenancy unit for a consumer of a service. + */ + export interface Schema$CreateTenancyUnitRequest { + /** + * Optional producer provided identifier of the tenancy unit. Must be no + * longer than 40 characters and preferably URI friendly. If it is not + * provided, a UID for the tenancy unit will be auto generated. It must be + * unique across a service. If the tenancy unit already exists for the + * service and consumer pair, `CreateTenancyUnit` will return the existing + * tenancy unit if the provided identifier is identical or empty, otherwise + * the call will fail. + */ + tenancyUnitId: string; + } /** - * Defines the metrics used by this service. + * Configuration for a custom authentication provider. */ - metrics: Schema$MetricDescriptor[]; + export interface Schema$CustomAuthRequirements { + /** + * A configuration string containing connection information for the + * authentication provider, typically formatted as a SmartService string + * (go/smartservice). + */ + provider: string; + } /** - * Defines the monitored resources used by this service. This is required by - * the Service.monitoring and Service.logging configurations. - */ - monitoredResources: Schema$MonitoredResourceDescriptor[]; + * Customize service error responses. For example, list any service specific + * protobuf types that can appear in error detail lists of error responses. + * Example: custom_error: types: - google.foo.v1.CustomError + * - google.foo.v1.AnotherError + */ + export interface Schema$CustomError { + /** + * The list of custom error rules that apply to individual API messages. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$CustomErrorRule[]; + /** + * The list of custom error detail types, e.g. + * 'google.foo.v1.CustomError'. + */ + types: string[]; + } /** - * Monitoring configuration. - */ - monitoring: Schema$Monitoring; + * A custom error rule. + */ + export interface Schema$CustomErrorRule { + /** + * Mark this message as possible payload in error response. Otherwise, + * objects of this type will be filtered when they appear in error payload. + */ + isErrorType: boolean; + /** + * Selects messages to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The DNS address at which this service is available, e.g. - * `calendar.googleapis.com`. - */ - name: string; + * A custom pattern is used for defining custom HTTP verb. + */ + export interface Schema$CustomHttpPattern { + /** + * The name of this custom HTTP verb. + */ + kind: string; + /** + * The path matched by this custom verb. + */ + path: string; + } /** - * The Google project that owns this service. - */ - producerProjectId: string; + * `Documentation` provides the information for describing a service. Example: + * <pre><code>documentation: summary: > The Google + * Calendar API gives access to most calendar features. pages: - name: + * Overview content: &#40;== include google/foo/overview.md + * ==&#41; - name: Tutorial content: &#40;== include + * google/foo/tutorial.md ==&#41; subpages; - name: Java content: + * &#40;== include google/foo/tutorial_java.md ==&#41; rules: - + * selector: google.calendar.Calendar.Get description: > ... - + * selector: google.calendar.Calendar.Put description: > ... + * </code></pre> Documentation is provided in markdown syntax. In + * addition to standard markdown features, definition lists, tables and fenced + * code blocks are supported. Section headers can be provided and are + * interpreted relative to the section nesting of the context where a + * documentation fragment is embedded. Documentation from the IDL is merged + * with documentation defined via the config at normalization time, where + * documentation provided by config rules overrides IDL provided. A number of + * constructs specific to the API platform are supported in documentation + * text. In order to reference a proto element, the following notation can be + * used: + * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> + * To override the display text used for the link, this can be used: + * <pre><code>&#91;display + * text]&#91;fully.qualified.proto.name]</code></pre> Text can + * be excluded from doc using the following notation: + * <pre><code>&#40;-- internal comment + * --&#41;</code></pre> A few directives are available in + * documentation. Note that directives must appear on a single line to be + * properly identified. The `include` directive includes a markdown file from + * an external source: <pre><code>&#40;== include path/to/file + * ==&#41;</code></pre> The `resource_for` directive marks a + * message to be the resource of a collection in REST view. If it is not + * specified, tools attempt to infer the resource from the operations in a + * collection: <pre><code>&#40;== resource_for + * v1.shelves.books ==&#41;</code></pre> The directive + * `suppress_warning` does not directly affect documentation and is documented + * together with service config validation. + */ + export interface Schema$Documentation { + /** + * The URL to the root of documentation. + */ + documentationRootUrl: string; + /** + * Declares a single overview page. For example: + * <pre><code>documentation: summary: ... overview: + * &#40;== include overview.md ==&#41; </code></pre> + * This is a shortcut for the following declaration (using pages style): + * <pre><code>documentation: summary: ... pages: - name: + * Overview content: &#40;== include overview.md ==&#41; + * </code></pre> Note: you cannot specify both `overview` field + * and `pages` field. + */ + overview: string; + /** + * The top level pages for the documentation set. + */ + pages: Schema$Page[]; + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$DocumentationRule[]; + /** + * A short summary of what the service does. Can only be provided by plain + * text. + */ + summary: string; + } /** - * Quota configuration. - */ - quota: Schema$Quota; + * A documentation rule provides information about individual API elements. + */ + export interface Schema$DocumentationRule { + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + */ + deprecationDescription: string; + /** + * Description of the selected API(s). + */ + description: string; + /** + * The selector is a comma-separated list of patterns. Each pattern is a + * qualified name of the element which may end in "*", indicating + * a wildcard. Wildcards are only allowed at the end and for a whole + * component of the qualified name, i.e. "foo.*" is ok, but not + * "foo.b*" or "foo.*.bar". To specify a default for all + * applicable elements, the whole pattern "*" is used. + */ + selector: string; + } /** - * Output only. The source information for this configuration if available. - */ - sourceInfo: Schema$SourceInfo; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * `Endpoint` describes a network endpoint that serves a set of APIs. A + * service may expose any number of endpoints, and all endpoints share the + * same service configuration, such as quota configuration and monitoring + * configuration. Example service configuration: name: + * library-example.googleapis.com endpoints: # Below entry makes + * 'google.example.library.v1.Library' # API be served from + * endpoint address library-example.googleapis.com. # It also allows + * HTTP OPTIONS calls to be passed to the backend, for # it to decide + * whether the subsequent cross-origin request is # allowed to proceed. + * - name: library-example.googleapis.com allow_cors: true + */ + export interface Schema$Endpoint { + /** + * DEPRECATED: This field is no longer supported. Instead of using aliases, + * please specify multiple google.api.Endpoint for each of the intended + * aliases. Additional names that this endpoint will be hosted on. + */ + aliases: string[]; + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint + * to receive and respond to HTTP OPTIONS requests. The response will be + * used by the browser to determine whether the subsequent cross-origin + * request is allowed to proceed. + */ + allowCors: boolean; + /** + * The list of features enabled on this endpoint. + */ + features: string[]; + /** + * The canonical name of this endpoint. + */ + name: string; + /** + * The specification of an Internet routable address of API frontend that + * will handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For + * example, "8.8.8.8" or "myservice.appspot.com". + */ + target: string; + } /** - * System parameter configuration. - */ - systemParameters: Schema$SystemParameters; + * Enum type definition. + */ + export interface Schema$Enum { + /** + * Enum value definitions. + */ + enumvalue: Schema$EnumValue[]; + /** + * Enum type name. + */ + name: string; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * A list of all proto message types included in this API service. It serves - * similar purpose as [google.api.Service.types], except that these types are - * not needed by user-defined APIs. Therefore, they will not show up in the - * generated discovery doc. This field should only be used to define system - * APIs in ESF. - */ - systemTypes: Schema$Type[]; + * Enum value definition. + */ + export interface Schema$EnumValue { + /** + * Enum value name. + */ + name: string; + /** + * Enum value number. + */ + number: number; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + } /** - * The product title for this service. + * Experimental service configuration. These configuration options can only be + * used by whitelisted users. */ - title: string; + export interface Schema$Experimental { + /** + * Authorization configuration. + */ + authorization: Schema$AuthorizationConfig; + } /** - * A list of all proto message types included in this API service. Types - * referenced directly or indirectly by the `apis` are automatically included. - * Messages which are not referenced but shall be included, such as types used - * by the `google.protobuf.Any` type, should be listed here by name. Example: - * types: - name: google.protobuf.Int32 - */ - types: Schema$Type[]; + * A single field of a message type. + */ + export interface Schema$Field { + /** + * The field cardinality. + */ + cardinality: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + */ + defaultValue: string; + /** + * The field JSON name. + */ + jsonName: string; + /** + * The field type. + */ + kind: string; + /** + * The field name. + */ + name: string; + /** + * The field number. + */ + number: number; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the + * list. + */ + oneofIndex: number; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * Whether to use alternative packed wire representation. + */ + packed: boolean; + /** + * The field type URL, without the scheme, for message or enumeration types. + * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + */ + typeUrl: string; + } /** - * Configuration controlling usage of this service. - */ - usage: Schema$Usage; -} -/** - * Describes service account configuration for the tenant project. - */ -export interface Schema$ServiceAccountConfig { + * Defines the HTTP configuration for an API service. It contains a list of + * HttpRule, each specifying the mapping of an RPC method to one or more HTTP + * REST API methods. + */ + export interface Schema$Http { + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where + * "%2F" will be left encoded. The default behavior is to not + * decode RFC 6570 reserved characters in multi segment matches. + */ + fullyDecodeReservedExpansion: boolean; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$HttpRule[]; + } /** - * ID of the IAM service account to be created in tenant project. The email - * format of the service account will be - * "<account-id>@<tenant-project-id>.iam.gserviceaccount.com". - * This account id has to be unique within tenant project and producers have - * to guarantee it. And it must be 6-30 characters long, and matches the - * regular expression `[a-z]([-a-z0-9]*[a-z0-9])`. - */ - accountId: string; + * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST + * API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and HTTP + * request body. The mapping is typically specified as an `google.api.http` + * annotation on the RPC method, see "google/api/annotations.proto" + * for details. The mapping consists of a field specifying the path template + * and method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET operation on a + * resource collection of messages: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http).get = + * "/v1/messages/{message_id}/{sub.subfield}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL SubMessage sub = + * 2; // `sub.subfield` is url-mapped } message Message { string + * text = 1; // content of the resource } The same http annotation can + * alternatively be expressed inside the `GRPC API Configuration` YAML file. + * http: rules: - selector: + * <proto_package_name>.Messaging.GetMessage get: + * /v1/messages/{message_id}/{sub.subfield} This definition enables an + * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC + * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: + * "123456" sub: SubMessage(subfield: "foo"))` In + * general, not only fields but also field paths can be referenced from a path + * pattern. Fields mapped to the path pattern cannot be repeated and must have + * a primitive (non-message) type. Any fields in the request message which + * are not bound by the path pattern automatically become (optional) HTTP + * query parameters. Assume the following definition of the request message: + * service Messaging { rpc GetMessage(GetMessageRequest) returns + * (Message) { option (google.api.http).get = + * "/v1/messages/{message_id}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL int64 revision = + * 2; // becomes a parameter SubMessage sub = 3; // `sub.subfield` + * becomes a parameter } This enables a HTTP JSON to RPC mapping as + * below: HTTP | RPC -----|----- `GET + * /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` Note that fields which are mapped + * to HTTP parameters must have a primitive type or a repeated primitive type. + * Message types are not allowed. In the case of a repeated type, the + * parameter can be repeated in the URL, as in `...?param=A&param=B`. For + * HTTP method kinds which allow a request body, the `body` field specifies + * the mapping. Consider a REST update method on the message resource + * collection: service Messaging { rpc + * UpdateMessage(UpdateMessageRequest) returns (Message) { option + * (google.api.http) = { put: "/v1/messages/{message_id}" + * body: "message" }; } } message + * UpdateMessageRequest { string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body } The following HTTP + * JSON to RPC mapping is enabled, where the representation of the JSON in the + * request body is determined by protos JSON encoding: HTTP | RPC -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | + * `UpdateMessage(message_id: "123456" message { text: + * "Hi!" })` The special name `*` can be used in the body mapping + * to define that every field not bound by the path template should be mapped + * to the request body. This enables the following alternative definition of + * the update method: service Messaging { rpc + * UpdateMessage(Message) returns (Message) { option (google.api.http) + * = { put: "/v1/messages/{message_id}" body: + * "*" }; } } message Message { string + * message_id = 1; string text = 2; } The following HTTP JSON to + * RPC mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { + * "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` Note that when using `*` in the + * body mapping, it is not possible to have HTTP parameters, as all fields not + * bound by the path end in the body. This makes this option more rarely used + * in practice of defining REST APIs. The common usage of `*` is in custom + * methods which don't use the URL at all for transferring data. It is + * possible to define multiple HTTP methods for one RPC by using the + * `additional_bindings` option. Example: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http) = { get: "/v1/messages/{message_id}" + * additional_bindings { get: + * "/v1/users/{user_id}/messages/{message_id}" } }; } } + * message GetMessageRequest { string message_id = 1; string + * user_id = 2; } This enables the following two alternative HTTP JSON + * to RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | + * `GetMessage(message_id: "123456")` `GET + * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" + * message_id: "123456")` # Rules for HTTP mapping The rules for + * mapping HTTP path, query parameters, and body fields to the request message + * are as follows: 1. The `body` field specifies either `*` or a field path, + * or is omitted. If omitted, it indicates there is no HTTP request + * body. 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: (a) Matched in the URL + * template. (b) Covered by body (if body is `*`, everything except (a) + * fields; else everything under the body field) (c) All other + * fields. 3. URL query parameters found in the HTTP request are mapped to (c) + * fields. 4. Any body sent with an HTTP request can contain only (b) fields. + * The syntax of the path template is as follows: Template = + * "/" Segments [ Verb ] ; Segments = Segment { "/" + * Segment } ; Segment = "*" | "**" | LITERAL | + * Variable ; Variable = "{" FieldPath [ "=" Segments + * ] "}" ; FieldPath = IDENT { "." IDENT } ; Verb + * = ":" LITERAL ; The syntax `*` matches a single path segment. + * The syntax `**` matches zero or more path segments, which must be the last + * part of the path except the `Verb`. The syntax `LITERAL` matches literal + * text in the path. The syntax `Variable` matches part of the URL path as + * specified by its template. A variable template must not contain other + * variables. If a variable matches a single path segment, its template may be + * omitted, e.g. `{var}` is equivalent to `{var=*}`. If a variable contains + * exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{var}`. If a variable contains one + * or more path segments, such as `"{var=foo/*}"` or + * `"{var=**}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such + * variables show up in the Discovery Document as `{+var}`. NOTE: While the + * single segment variable matches the semantics of [RFC + * 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** match RFC 6570 Reserved + * Expansion. The reason is that the Reserved Expansion does not expand + * special characters like `?` and `#`, which would lead to invalid URLs. + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ + export interface Schema$HttpRule { + /** + * Additional HTTP bindings for the selector. Nested bindings must not + * contain an `additional_bindings` field themselves (that is, the nesting + * may only be one level deep). + */ + additionalBindings: Schema$HttpRule[]; + /** + * Specifies the permission(s) required for an API element for the overall + * API request to succeed. It is typically used to mark request message + * fields that contain the name of the resource and indicates the + * permissions that will be checked on that resource. + */ + authorizations: Schema$AuthorizationRule[]; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave + * the HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: Schema$CustomHttpPattern; + /** + * Used for deleting a resource. + */ + delete: string; + /** + * Used for listing and getting information about resources. + */ + get: string; + /** + * Use this only for Scotty Requests. Do not use this for bytestream + * methods. For media support, add instead + * [][google.bytestream.RestByteStream] as an API to your configuration. + */ + mediaDownload: Schema$MediaDownload; + /** + * Use this only for Scotty Requests. Do not use this for media support + * using Bytestream, add instead [][google.bytestream.RestByteStream] as an + * API to your configuration for Bytestream methods. + */ + mediaUpload: Schema$MediaUpload; + /** + * Used for updating a resource. + */ + patch: string; + /** + * Used for creating a resource. + */ + post: string; + /** + * Used for updating a resource. + */ + put: string; + /** + * DO NOT USE. This is an experimental field. Optional. The REST collection + * name is by default derived from the URL pattern. If specified, this field + * overrides the default collection name. Example: rpc + * AddressesAggregatedList(AddressesAggregatedListRequest) returns + * (AddressesAggregatedListResponse) { option (google.api.http) = { + * get: "/v1/projects/{project_id}/aggregated/addresses" + * rest_collection: "projects.addresses" }; } This + * method has the automatically derived collection name + * "projects.aggregated". Because, semantically, this rpc is + * actually an operation on the "projects.addresses" collection, + * the `rest_collection` field is configured to override the derived + * collection name. + */ + restCollection: string; + /** + * DO NOT USE. This is an experimental field. Optional. The rest method + * name is by default derived from the URL pattern. If specified, this field + * overrides the default method name. Example: rpc + * CreateResource(CreateResourceRequest) returns + * (CreateResourceResponse) { option (google.api.http) = { post: + * "/v1/resources", body: "resource", + * rest_method_name: "insert" }; } This method has the + * automatically derived rest method name "create", but for + * backwards compatibility with apiary, it is specified as insert. + */ + restMethodName: string; + /** + * Selects methods to which this rule applies. Refer to selector for syntax + * details. + */ + selector: string; + } /** - * Roles for the associated service account for the tenant project. - */ - tenantProjectRoles: string[]; -} -/** - * `SourceContext` represents information about the source of a protobuf - * element, like the file in which it is defined. - */ -export interface Schema$SourceContext { + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; + } /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: - * `"google/protobuf/source_context.proto"`. - */ - fileName: string; -} -/** - * Source information used to create a Service Config - */ -export interface Schema$SourceInfo { + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * All files used during config generation. - */ - sourceFiles: any[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Response for the list request. + */ + export interface Schema$ListTenancyUnitsResponse { + /** + * Pagination token for large results. + */ + nextPageToken: string; + /** + * Tenancy units matching the request. + */ + tenancyUnits: Schema$TenancyUnit[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A description of a log type. Example in YAML format: - name: + * library.googleapis.com/activity_history description: The history of + * borrowing and returning library items. display_name: Activity labels: + * - key: /customer_id description: Identifier of a library customer + */ + export interface Schema$LogDescriptor { + /** + * A human-readable description of this log. This information appears in the + * documentation and can contain details. + */ + description: string; + /** + * The human-readable name for this log. This information appears on the + * user interface and should be concise. + */ + displayName: string; + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are considered + * invalid. + */ + labels: Schema$LabelDescriptor[]; + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including slash, + * underscore, hyphen, period [/_-.]. + */ + name: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Logging configuration of the service. The following example shows how to + * configure logs to be sent to the producer and consumer projects. In the + * example, the `activity_history` log is sent to both the producer and + * consumer projects, whereas the `purchase_history` log is only sent to the + * producer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. logs: - name: activity_history + * labels: - key: /customer_id - name: purchase_history logging: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history - + * purchase_history consumer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history + */ + export interface Schema$Logging { + /** + * Logging configurations for sending logs to the consumer project. There + * can be multiple consumer destinations, each one must have a different + * monitored resource type. A log can be used in at most one consumer + * destination. + */ + consumerDestinations: Schema$LoggingDestination[]; + /** + * Logging configurations for sending logs to the producer project. There + * can be multiple producer destinations, each one must have a different + * monitored resource type. A log can be used in at most one producer + * destination. + */ + producerDestinations: Schema$LoggingDestination[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Define a parameter's name and location. The parameter may be passed as - * either an HTTP header or a URL query parameter, and if both are passed the - * behavior is implementation-dependent. - */ -export interface Schema$SystemParameter { + * Configuration of a specific logging destination (the producer project or + * the consumer project). + */ + export interface Schema$LoggingDestination { + /** + * Names of the logs to be sent to this destination. Each name must be + * defined in the Service.logs section. If the log name is not a domain + * scoped name, it will be automatically prefixed with the service name + * followed by "/". + */ + logs: string[]; + /** + * The monitored resource type. The type must be defined in the + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Define the HTTP header name to use for the parameter. It is case - * insensitive. + * Defines the Media configuration for a service in case of a download. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - httpHeader: string; + export interface Schema$MediaDownload { + /** + * A boolean that determines whether a notification for the completion of a + * download should be sent to the backend. + */ + completeNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the download service if one is used for download. + */ + downloadService: string; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether download is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for direct download. The size is + * specified in bytes. + */ + maxDirectDownloadSize: string; + /** + * A boolean that determines if direct download from ESF should be used for + * download of this media. + */ + useDirectDownload: boolean; + } /** - * Define the name of the parameter, such as "api_key" . It is case - * sensitive. + * Defines the Media configuration for a service in case of an upload. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - name: string; + export interface Schema$MediaUpload { + /** + * A boolean that determines whether a notification for the completion of an + * upload should be sent to the backend. These notifications will not be + * seen by the client and will not consume quota. + */ + completeNotification: boolean; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether upload is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for an upload. The size is specified in + * bytes. + */ + maxSize: string; + /** + * An array of mimetype patterns. Esf will only accept uploads that match + * one of the given patterns. + */ + mimeTypes: string[]; + /** + * Whether to receive a notification for progress changes of media upload. + */ + progressNotification: boolean; + /** + * Whether to receive a notification on the start of media upload. + */ + startNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the upload service if one is used for upload. + */ + uploadService: string; + } /** - * Define the URL query parameter name to use for the parameter. It is case - * sensitive. - */ - urlQueryParameter: string; -} -/** - * Define a system parameter rule mapping system parameter definitions to - * methods. - */ -export interface Schema$SystemParameterRule { + * Method represents a method of an API interface. + */ + export interface Schema$Method { + /** + * The simple name of this method. + */ + name: string; + /** + * Any metadata attached to the method. + */ + options: Schema$Option[]; + /** + * If true, the request is streamed. + */ + requestStreaming: boolean; + /** + * A URL of the input message type. + */ + requestTypeUrl: string; + /** + * If true, the response is streamed. + */ + responseStreaming: boolean; + /** + * The URL of the output message type. + */ + responseTypeUrl: string; + /** + * The source syntax of this method. + */ + syntax: string; + } /** - * Define parameters. Multiple names may be defined for a parameter. For a - * given method call, only one of them should be used. If multiple names are - * used the behavior is implementation-dependent. If none of the specified - * names are present the behavior is parameter-dependent. - */ - parameters: Schema$SystemParameter[]; + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric type has + * a label for the HTTP response code, `response_code`, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be + * supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * `custom.googleapis.com`. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported + * units are a subset of [The Unified Code for Units of + * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units + * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute + * * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo + * (10**3) * `M` mega (10**6) * `G` giga (10**9) * `T` tera + * (10**12) * `P` peta (10**15) * `E` exa (10**18) * `Z` + * zetta (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * + * `u` micro (10**-6) * `n` nano (10**-9) * `p` pico + * (10**-12) * `f` femto (10**-15) * `a` atto (10**-18) * `z` + * zepto (10**-21) * `y` yocto (10**-24) * `Ki` kibi (2**10) * + * `Mi` mebi (2**20) * `Gi` gibi (2**30) * `Ti` tebi (2**40) + * **Grammar** The grammar also includes these connectors: * `/` division + * (as an infix operator, e.g. `1/s`). * `.` multiplication (as an infix + * operator, e.g. `GBy.d`) The grammar for a unit is as follows: Expression + * = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | + * Annotation | "1" ; Annotation + * = "{" NAME "}" ; Notes: * `Annotation` is just a + * comment if it follows a `UNIT` and is equivalent to `1` if it is used + * alone. For examples, `{requests}/s == 1/s`, `By{transmitted}/s == + * By/s`. * `NAME` is a sequence of non-blank printable ASCII characters not + * containing '{' or '}'. * `1` represents dimensionless + * value 1, such as in `1/s`. * `%` represents dimensionless value 1/100, + * and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of `metric_kind` and `value_type` might not be supported. + */ + valueType: string; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; -} -/** - * ### System parameter configuration A system parameter is a special kind of - * parameter defined by the API system, not by an individual API. It is - * typically mapped to an HTTP header and/or a URL query parameter. This - * configuration specifies which methods change the names of the system - * parameters. - */ -export interface Schema$SystemParameters { - /** - * Define system parameters. The parameters defined here will override the - * default parameters implemented by the system. If this field is missing from - * the service config, default system parameters will be used. Default system - * parameters and names is implementation-dependent. Example: define api key - * for all methods system_parameters rules: - selector: - * "*" parameters: - name: api_key - * url_query_parameter: api_key Example: define 2 api key names for a - * specific method. system_parameters rules: - selector: - * "/ListShelves" parameters: - name: api_key - * http_header: Api-Key1 - name: api_key http_header: Api-Key2 - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$SystemParameterRule[]; -} -/** - * Representation of a tenancy unit. - */ -export interface Schema$TenancyUnit { + * Bind API methods to metrics. Binding a method to a metric causes that + * metric's configured quota behaviors to apply to the method call. + */ + export interface Schema$MetricRule { + /** + * Metrics to update when the selected methods are called, and the + * associated cost applied to each metric. The key of the map is the metric + * name, and the values are the amount increased for the metric against + * which the quota limits are defined. The value must not be negative. + */ + metricCosts: any; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * @OutputOnly Cloud resource name of the consumer of this service. For - * example 'projects/123456'. - */ - consumer: string; + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: - If after comment and + * whitespace stripping, the documentation string of the redeclared method + * is empty, it will be inherited from the original method. - Each + * annotation belonging to the service config (http, visibility) which is + * not set in the redeclared method will be inherited. - If an http + * annotation is inherited, the path pattern will be modified as follows. + * Any version prefix will be replaced by the version of the including + * interface plus the root path if specified. Example of a simple mixin: + * package google.acl.v1; service AccessControl { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; } } + * package google.storage.v2; service Storage { // rpc + * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc + * GetData(GetDataRequest) returns (Data) { option + * (google.api.http).get = "/v2/{resource=**}"; } } + * Example of a mixin configuration: apis: - name: + * google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl The mixin construct implies that all methods + * in `AccessControl` are also declared with same name and request/response + * types in `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting documentation and + * annotations as follows: service Storage { // Get the underlying + * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option + * (google.api.http).get = "/v2/{resource=**}:getAcl"; } ... + * } Note how the version in the path pattern changed from `v1` to `v2`. If + * the `root` field in the mixin is specified, it should be a relative path + * under which inherited HTTP paths are placed. Example: apis: - + * name: google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl root: acls This implies the following + * inherited HTTP annotation: service Storage { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } ... } + */ + export interface Schema$Mixin { + /** + * The fully qualified name of the interface which is included. + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths are + * rooted. + */ + root: string; + } /** - * @OutputOnly The time this tenancy unit was created. - */ - createTime: string; + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * `"gce_instance"` and specifies the use of the labels + * `"instance_id"` and `"zone"` to identify particular VM + * instances. Different APIs can support different monitored resource types. + * APIs generally provide a `list` method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, `"Google + * Cloud SQL Database"`. + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and + * `"zone"`. + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` + * where {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; + } /** - * Globally unique identifier of this tenancy unit - * "services/{service}/{collection id}/{resource - * id}/tenancyUnits/{unit}" - */ - name: string; + * Monitoring configuration of the service. The example below shows how to + * configure monitored resources and metrics for monitoring. In the example, a + * monitored resource and two metrics are defined. The + * `library.googleapis.com/book/returned_count` metric is sent to both + * producer and consumer projects, whereas the + * `library.googleapis.com/book/overdue_count` metric is only sent to the + * consumer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. metrics: - name: + * library.googleapis.com/book/returned_count metric_kind: DELTA + * value_type: INT64 labels: - key: /customer_id - name: + * library.googleapis.com/book/overdue_count metric_kind: GAUGE + * value_type: INT64 labels: - key: /customer_id monitoring: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count consumer_destinations: - + * monitored_resource: library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count - + * library.googleapis.com/book/overdue_count + */ + export interface Schema$Monitoring { + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$MonitoringDestination[]; + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * producer destination. + */ + producerDestinations: Schema$MonitoringDestination[]; + } /** - * @OutputOnly Google Cloud API name of the service owning this tenancy unit. - * For example 'serviceconsumermanagement.googleapis.com'. - */ - service: string; + * Configuration of a specific monitoring destination (the producer project or + * the consumer project). + */ + export interface Schema$MonitoringDestination { + /** + * Names of the metrics to report to this monitoring destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Resources constituting the tenancy unit. There can be at most 512 tenant - * resources in a tenancy unit. - */ - tenantResources: Schema$TenantResource[]; -} -/** - * This structure defines a tenant project to be added to the specified tenancy - * unit and its initial configuration and properties. A project lien will be - * created for the tenant project to prevent the tenant project from being - * deleted accidentally. The lien will be deleted as part of tenant project - * removal. - */ -export interface Schema$TenantProjectConfig { + * OAuth scopes are a way to define data and permissions on data. For example, + * there are scopes defined for "Read-only access to Google + * Calendar" and "Access to Cloud Platform". Users can consent + * to a scope for an application, giving it permission to access that data on + * their behalf. OAuth scope specifications should be fairly coarse grained; + * a user will need to see and understand the text description of what your + * scope means. In most cases: use one or at most two OAuth scopes for an + * entire family of products. If your product has multiple APIs, you should + * probably be sharing the OAuth scope across all of those APIs. When you + * need finer grained OAuth consent screens: talk with your product management + * about how developers will use them in practice. Please note that even + * though each of the canonical scopes is enough for a request to be accepted + * and passed to the backend, a request can still fail due to the backend + * requiring additional scopes or permissions. + */ + export interface Schema$OAuthRequirements { + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + */ + canonicalScopes: string; + } /** - * Billing account properties. It might be specified explicitly, or created - * from the specified group during provisioning - */ - billingConfig: Schema$BillingConfig; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Folder where project in this tenancy unit must be located This folder must - * have been previously created with proper permissions for the caller to - * create and configure a project in it. Valid folder resource names have the - * format `folders/{folder_number}` (for example, `folders/123456`). - */ - folder: string; + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + */ + export interface Schema$Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, + * `"map_entry"`. For custom options, it should be the + * fully-qualified name. For example, `"google.api.http"`. + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a + * primitive, the corresponding wrapper type defined in + * google/protobuf/wrappers.proto should be used. If the value is an enum, + * it should be stored as an int32 value using the + * google.protobuf.Int32Value type. + */ + value: any; + } /** - * Labels that will be applied to this project. - */ - labels: any; + * Represents a documentation page. A page can contain subpages to represent + * nested documentation set structure. + */ + export interface Schema$Page { + /** + * The Markdown content of the page. You can use <code>&#40;== + * include {path} ==&#41;</code> to include content from a + * Markdown file. + */ + content: string; + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: <pre><code>pages: - name: + * Tutorial content: &#40;== include tutorial.md ==&#41; subpages: + * - name: Java content: &#40;== include tutorial_java.md + * ==&#41; </code></pre> You can reference `Java` page using + * Markdown reference link syntax: `Java`. + */ + name: string; + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + */ + subpages: Schema$Page[]; + } /** - * Configuration for IAM service account on tenant project. - */ - serviceAccountConfig: Schema$ServiceAccountConfig; + * Translates to IAM Policy bindings (without auditing at this level) + */ + export interface Schema$PolicyBinding { + /** + * Uses the same format as in IAM policy. `member` must include both prefix + * and ID. For example, `user:{emailId}`, `serviceAccount:{emailId}`, + * `group:{emailId}`. + */ + members: string[]; + /** + * Role. (https://cloud.google.com/iam/docs/understanding-roles) For + * example, `roles/viewer`, `roles/editor`, or `roles/owner`. + */ + role: string; + } /** - * Google Cloud API names of services that will be activated on this project - * during provisioning. If any of these services can not be activated, - * request will fail. For example: - * 'compute.googleapis.com','cloudfunctions.googleapis.com' - */ - services: string[]; + * Quota configuration helps to achieve fairness and budgeting in service + * usage. The quota configuration works this way: - The service configuration + * defines a set of metrics. - For API calls, the quota.metric_rules maps + * methods to metrics with corresponding costs. - The quota.limits defines + * limits on the metrics, which will be used for quota checks at runtime. An + * example quota configuration in yaml format: quota: - name: + * apiWriteQpsPerProject metric: library.googleapis.com/write_calls + * unit: "1/min/{project}" # rate limit for consumer projects + * values: STANDARD: 10000 # The metric rules bind all methods + * to the read_calls metric, # except for the UpdateBook and DeleteBook + * methods. These two methods # are mapped to the write_calls metric, + * with the UpdateBook method # consuming at twice rate as the DeleteBook + * method. metric_rules: - selector: "*" metric_costs: + * library.googleapis.com/read_calls: 1 - selector: + * google.example.library.v1.LibraryService.UpdateBook metric_costs: + * library.googleapis.com/write_calls: 2 - selector: + * google.example.library.v1.LibraryService.DeleteBook metric_costs: + * library.googleapis.com/write_calls: 1 Corresponding Metric definition: + * metrics: - name: library.googleapis.com/read_calls display_name: Read + * requests metric_kind: DELTA value_type: INT64 - name: + * library.googleapis.com/write_calls display_name: Write requests + * metric_kind: DELTA value_type: INT64 + */ + export interface Schema$Quota { + /** + * List of `QuotaLimit` definitions for the service. + */ + limits: Schema$QuotaLimit[]; + /** + * List of `MetricRule` definitions, each one mapping a selected method to + * one or more metrics. + */ + metricRules: Schema$MetricRule[]; + } /** - * Describes ownership and policies for the new tenant project. Required. - */ - tenantProjectPolicy: Schema$TenantProjectPolicy; -} -/** - * Describes policy settings that need to be applied to a newly created tenant - * project. - */ -export interface Schema$TenantProjectPolicy { + * `QuotaLimit` defines a specific limit that applies over a specified + * duration for a limit type. There can be at most one limit for a duration + * and limit type combination defined within a `QuotaGroup`. + */ + export interface Schema$QuotaLimit { + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client application + * developer activates the service for his/her project. Specifying a value + * of 0 will block all requests. This can be used if you are provisioning + * quota to selected consumers and blocking others. Similarly, a value of -1 + * will indicate an unlimited quota. No other negative values are allowed. + * Used by group-based quotas only. + */ + defaultLimit: string; + /** + * Optional. User-visible, extended description for this quota limit. Should + * be used only when more context is needed to understand this limit than + * provided by the limit's display name (see: `display_name`). + */ + description: string; + /** + * User-visible display name for this limit. Optional. If not set, the UI + * will provide a default display name based on the quota configuration. + * This field can be used to override the default display name generated + * from the configuration. + */ + displayName: string; + /** + * Duration of this limit in textual notation. Example: "100s", + * "24h", "1d". For duration longer than a day, only + * multiple of days is supported. We support only "100s" and + * "1d" for now. Additional support will be added in the future. + * "0" indicates indefinite duration. Used by group-based quotas + * only. + */ + duration: string; + /** + * Free tier value displayed in the Developers Console for this limit. The + * free tier is the number of tokens that will be subtracted from the billed + * amount when billing is enabled. This field can only be set on a limit + * with duration "1d", in a billable group; it is invalid on any + * other limit. If this field is not set, it defaults to 0, indicating that + * there is no free tier for this service. Used by group-based quotas only. + */ + freeTier: string; + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. Used by group-based quotas only. + */ + maxLimit: string; + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must + * be defined within the service config. + */ + metric: string; + /** + * Name of the quota limit. The name must be provided, and it must be + * unique within the service. The name can only include alphanumeric + * characters as well as '-'. The maximum length of the limit name + * is 64 characters. + */ + name: string; + /** + * Specify the unit of the quota limit. It uses the same syntax as + * Metric.unit. The supported unit kinds are determined by the quota backend + * system. Here are some examples: * "1/min/{project}" for quota + * per minute per project. Note: the order of unit components is + * insignificant. The "1" at the beginning is required to follow + * the metric unit syntax. + */ + unit: string; + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + */ + values: any; + } /** - * Policy bindings to be applied to the tenant project, in addition to the - * 'roles/owner' role granted to the Service Consumer Management - * service account. At least one binding must have the role `roles/owner`. - * Among the list of members for `roles/owner`, at least one of them must be - * either `user` or `group` type. + * Request message to remove tenant project resource from the tenancy unit. */ - policyBindings: Schema$PolicyBinding[]; -} -/** - * Resource constituting the TenancyUnit. - */ -export interface Schema$TenantResource { + export interface Schema$RemoveTenantProjectRequest { + /** + * Tag of the resource within the tenancy unit. + */ + tag: string; + } /** - * @OutputOnly Identifier of the tenant resource. For cloud projects, it is in - * the form 'projects/{number}'. For example - * 'projects/123456'. - */ - resource: string; + * Response for the search query. + */ + export interface Schema$SearchTenancyUnitsResponse { + /** + * Pagination token for large results. + */ + nextPageToken: string; + /** + * Tenancy Units matching the request. + */ + tenancyUnits: Schema$TenancyUnit[]; + } /** - * Status of tenant resource. - */ - status: string; + * `Service` is the root object of Google service configuration schema. It + * describes basic information about a service, such as the name and the + * title, and delegates other aspects to sub-sections. Each sub-section is + * either a proto message or a repeated proto message that configures a + * specific aspect, such as auth. See each proto message definition for + * details. Example: type: google.api.Service config_version: 3 + * name: calendar.googleapis.com title: Google Calendar API apis: - + * name: google.calendar.v3.Calendar authentication: providers: - + * id: google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Service { + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the google.protobuf.Api needs to be provided by the configuration + * author, as the remaining fields will be derived from the IDL during the + * normalization process. It is an error to specify an API interface here + * which cannot be resolved against the associated IDL files. + */ + apis: Schema$Api[]; + /** + * Auth configuration. + */ + authentication: Schema$Authentication; + /** + * API backend configuration. + */ + backend: Schema$Backend; + /** + * Billing configuration. + */ + billing: Schema$Billing; + /** + * The semantic version of the service configuration. The config version + * affects the interpretation of the service configuration. For example, + * certain features are enabled by default for certain config versions. The + * latest config version is `3`. + */ + configVersion: number; + /** + * Context configuration. + */ + context: Schema$Context; + /** + * Configuration for the service control plane. + */ + control: Schema$Control; + /** + * Custom error configuration. + */ + customError: Schema$CustomError; + /** + * Additional API documentation. + */ + documentation: Schema$Documentation; + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service + * all defined APIs. + */ + endpoints: Schema$Endpoint[]; + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name. Example: enums: - name: google.someapi.v1.SomeEnum + */ + enums: Schema$Enum[]; + /** + * Experimental configuration. + */ + experimental: Schema$Experimental; + /** + * HTTP configuration. + */ + http: Schema$Http; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. If empty, the server may choose to + * generate one instead. + */ + id: string; + /** + * Logging configuration. + */ + logging: Schema$Logging; + /** + * Defines the logs used by this service. + */ + logs: Schema$LogDescriptor[]; + /** + * Defines the metrics used by this service. + */ + metrics: Schema$MetricDescriptor[]; + /** + * Defines the monitored resources used by this service. This is required by + * the Service.monitoring and Service.logging configurations. + */ + monitoredResources: Schema$MonitoredResourceDescriptor[]; + /** + * Monitoring configuration. + */ + monitoring: Schema$Monitoring; + /** + * The DNS address at which this service is available, e.g. + * `calendar.googleapis.com`. + */ + name: string; + /** + * The Google project that owns this service. + */ + producerProjectId: string; + /** + * Quota configuration. + */ + quota: Schema$Quota; + /** + * Output only. The source information for this configuration if available. + */ + sourceInfo: Schema$SourceInfo; + /** + * System parameter configuration. + */ + systemParameters: Schema$SystemParameters; + /** + * A list of all proto message types included in this API service. It serves + * similar purpose as [google.api.Service.types], except that these types + * are not needed by user-defined APIs. Therefore, they will not show up in + * the generated discovery doc. This field should only be used to define + * system APIs in ESF. + */ + systemTypes: Schema$Type[]; + /** + * The product title for this service. + */ + title: string; + /** + * A list of all proto message types included in this API service. Types + * referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such + * as types used by the `google.protobuf.Any` type, should be listed here by + * name. Example: types: - name: google.protobuf.Int32 + */ + types: Schema$Type[]; + /** + * Configuration controlling usage of this service. + */ + usage: Schema$Usage; + } /** - * Unique per single tenancy unit. - */ - tag: string; -} -/** - * A protocol buffer message type. - */ -export interface Schema$Type { + * Describes service account configuration for the tenant project. + */ + export interface Schema$ServiceAccountConfig { + /** + * ID of the IAM service account to be created in tenant project. The email + * format of the service account will be + * "<account-id>@<tenant-project-id>.iam.gserviceaccount.com". + * This account id has to be unique within tenant project and producers have + * to guarantee it. And it must be 6-30 characters long, and matches the + * regular expression `[a-z]([-a-z0-9]*[a-z0-9])`. + */ + accountId: string; + /** + * Roles for the associated service account for the tenant project. + */ + tenantProjectRoles: string[]; + } /** - * The list of fields. + * `SourceContext` represents information about the source of a protobuf + * element, like the file in which it is defined. */ - fields: Schema$Field[]; + export interface Schema$SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: + * `"google/protobuf/source_context.proto"`. + */ + fileName: string; + } /** - * The fully qualified message name. + * Source information used to create a Service Config */ - name: string; + export interface Schema$SourceInfo { + /** + * All files used during config generation. + */ + sourceFiles: any[]; + } /** - * The list of types appearing in `oneof` definitions in this type. - */ - oneofs: string[]; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The protocol buffer options. - */ - options: Schema$Option[]; + * Define a parameter's name and location. The parameter may be passed as + * either an HTTP header or a URL query parameter, and if both are passed the + * behavior is implementation-dependent. + */ + export interface Schema$SystemParameter { + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + */ + httpHeader: string; + /** + * Define the name of the parameter, such as "api_key" . It is + * case sensitive. + */ + name: string; + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + */ + urlQueryParameter: string; + } /** - * The source context. - */ - sourceContext: Schema$SourceContext; + * Define a system parameter rule mapping system parameter definitions to + * methods. + */ + export interface Schema$SystemParameterRule { + /** + * Define parameters. Multiple names may be defined for a parameter. For a + * given method call, only one of them should be used. If multiple names are + * used the behavior is implementation-dependent. If none of the specified + * names are present the behavior is parameter-dependent. + */ + parameters: Schema$SystemParameter[]; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + } /** - * The source syntax. - */ - syntax: string; -} -/** - * Configuration controlling usage of a service. - */ -export interface Schema$Usage { + * ### System parameter configuration A system parameter is a special kind of + * parameter defined by the API system, not by an individual API. It is + * typically mapped to an HTTP header and/or a URL query parameter. This + * configuration specifies which methods change the names of the system + * parameters. + */ + export interface Schema$SystemParameters { + /** + * Define system parameters. The parameters defined here will override the + * default parameters implemented by the system. If this field is missing + * from the service config, default system parameters will be used. Default + * system parameters and names is implementation-dependent. Example: define + * api key for all methods system_parameters rules: - + * selector: "*" parameters: - name: api_key + * url_query_parameter: api_key Example: define 2 api key names for a + * specific method. system_parameters rules: - selector: + * "/ListShelves" parameters: - name: + * api_key http_header: Api-Key1 - name: api_key + * http_header: Api-Key2 **NOTE:** All service configuration rules follow + * "last one wins" order. + */ + rules: Schema$SystemParameterRule[]; + } /** - * The full resource name of a channel used for sending notifications to the - * service producer. Google Service Management currently only supports - * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - * channel. To use Google Cloud Pub/Sub as the channel, this must be the name - * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - * documented in https://cloud.google.com/pubsub/docs/overview. - */ - producerNotificationChannel: string; + * Representation of a tenancy unit. + */ + export interface Schema$TenancyUnit { + /** + * @OutputOnly Cloud resource name of the consumer of this service. For + * example 'projects/123456'. + */ + consumer: string; + /** + * @OutputOnly The time this tenancy unit was created. + */ + createTime: string; + /** + * Globally unique identifier of this tenancy unit + * "services/{service}/{collection id}/{resource + * id}/tenancyUnits/{unit}" + */ + name: string; + /** + * @OutputOnly Google Cloud API name of the service owning this tenancy + * unit. For example 'serviceconsumermanagement.googleapis.com'. + */ + service: string; + /** + * Resources constituting the tenancy unit. There can be at most 512 tenant + * resources in a tenancy unit. + */ + tenantResources: Schema$TenantResource[]; + } /** - * Requirements that must be satisfied before a consumer project can use the - * service. Each requirement is of the form - * <service.name>/<requirement-id>; for example - * 'serviceusage.googleapis.com/billing-enabled'. - */ - requirements: string[]; + * This structure defines a tenant project to be added to the specified + * tenancy unit and its initial configuration and properties. A project lien + * will be created for the tenant project to prevent the tenant project from + * being deleted accidentally. The lien will be deleted as part of tenant + * project removal. + */ + export interface Schema$TenantProjectConfig { + /** + * Billing account properties. It might be specified explicitly, or created + * from the specified group during provisioning + */ + billingConfig: Schema$BillingConfig; + /** + * Folder where project in this tenancy unit must be located This folder + * must have been previously created with proper permissions for the caller + * to create and configure a project in it. Valid folder resource names have + * the format `folders/{folder_number}` (for example, `folders/123456`). + */ + folder: string; + /** + * Labels that will be applied to this project. + */ + labels: any; + /** + * Configuration for IAM service account on tenant project. + */ + serviceAccountConfig: Schema$ServiceAccountConfig; + /** + * Google Cloud API names of services that will be activated on this project + * during provisioning. If any of these services can not be activated, + * request will fail. For example: + * 'compute.googleapis.com','cloudfunctions.googleapis.com' + */ + services: string[]; + /** + * Describes ownership and policies for the new tenant project. Required. + */ + tenantProjectPolicy: Schema$TenantProjectPolicy; + } /** - * A list of usage rules that apply to individual API methods. **NOTE:** All - * service configuration rules follow "last one wins" order. - */ - rules: Schema$UsageRule[]; -} -/** - * Usage configuration rules for the service. NOTE: Under development. Use - * this rule to configure unregistered calls for the service. Unregistered calls - * are calls that do not contain consumer project identity. (Example: calls that - * do not contain an API key). By default, API methods do not allow unregistered - * calls, and each method call must be identified by a consumer project - * identity. Use this rule to allow/disallow unregistered calls. Example of an - * API that wants to allow unregistered calls for entire service. usage: - * rules: - selector: "*" allow_unregistered_calls: true - * Example of a method that wants to allow unregistered calls. usage: - * rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allow_unregistered_calls: true - */ -export interface Schema$UsageRule { + * Describes policy settings that need to be applied to a newly created tenant + * project. + */ + export interface Schema$TenantProjectPolicy { + /** + * Policy bindings to be applied to the tenant project, in addition to the + * 'roles/owner' role granted to the Service Consumer Management + * service account. At least one binding must have the role `roles/owner`. + * Among the list of members for `roles/owner`, at least one of them must be + * either `user` or `group` type. + */ + policyBindings: Schema$PolicyBinding[]; + } /** - * If true, the selected method allows unregistered calls, e.g. calls that - * don't identify any user or application. - */ - allowUnregisteredCalls: boolean; + * Resource constituting the TenancyUnit. + */ + export interface Schema$TenantResource { + /** + * @OutputOnly Identifier of the tenant resource. For cloud projects, it is + * in the form 'projects/{number}'. For example + * 'projects/123456'. + */ + resource: string; + /** + * Status of tenant resource. + */ + status: string; + /** + * Unique per single tenancy unit. + */ + tag: string; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; + * A protocol buffer message type. + */ + export interface Schema$Type { + /** + * The list of fields. + */ + fields: Schema$Field[]; + /** + * The fully qualified message name. + */ + name: string; + /** + * The list of types appearing in `oneof` definitions in this type. + */ + oneofs: string[]; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * If true, the selected method should skip service control and the control - * plane features, such as quota and billing, will not be available. This flag - * is used by Google Cloud Endpoints to bypass checks for internal methods, - * such as service health check methods. - */ - skipServiceControl: boolean; -} - -export class Resource$Operations { - root: Serviceconsumermanagement; - constructor(root: Serviceconsumermanagement) { - this.root = root; - this.getRoot.bind(this); + * Configuration controlling usage of a service. + */ + export interface Schema$Usage { + /** + * The full resource name of a channel used for sending notifications to the + * service producer. Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the + * name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name + * format documented in https://cloud.google.com/pubsub/docs/overview. + */ + producerNotificationChannel: string; + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form + * <service.name>/<requirement-id>; for example + * 'serviceusage.googleapis.com/billing-enabled'. + */ + requirements: string[]; + /** + * A list of usage rules that apply to individual API methods. **NOTE:** + * All service configuration rules follow "last one wins" order. + */ + rules: Schema$UsageRule[]; } - - getRoot() { - return this.root; + /** + * Usage configuration rules for the service. NOTE: Under development. Use + * this rule to configure unregistered calls for the service. Unregistered + * calls are calls that do not contain consumer project identity. (Example: + * calls that do not contain an API key). By default, API methods do not allow + * unregistered calls, and each method call must be identified by a consumer + * project identity. Use this rule to allow/disallow unregistered calls. + * Example of an API that wants to allow unregistered calls for entire + * service. usage: rules: - selector: "*" + * allow_unregistered_calls: true Example of a method that wants to allow + * unregistered calls. usage: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allow_unregistered_calls: true + */ + export interface Schema$UsageRule { + /** + * If true, the selected method allows unregistered calls, e.g. calls that + * don't identify any user or application. + */ + allowUnregisteredCalls: boolean; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. This + * flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + */ + skipServiceControl: boolean; } - - /** - * serviceconsumermanagement.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias serviceconsumermanagement.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Serviceconsumermanagement; + constructor(root: Serviceconsumermanagement) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * serviceconsumermanagement.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias serviceconsumermanagement.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceconsumermanagement.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias serviceconsumermanagement.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceconsumermanagement.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias serviceconsumermanagement.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * serviceconsumermanagement.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias serviceconsumermanagement.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * serviceconsumermanagement.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias serviceconsumermanagement.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceconsumermanagement.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias serviceconsumermanagement.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Services { - root: Serviceconsumermanagement; - tenancyUnits: Resource$Services$Tenancyunits; - constructor(root: Serviceconsumermanagement) { - this.root = root; - this.getRoot.bind(this); - this.tenancyUnits = new Resource$Services$Tenancyunits(root); - } - getRoot() { - return this.root; + /** + * serviceconsumermanagement.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias serviceconsumermanagement.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * serviceconsumermanagement.services.search - * @desc Search tenancy units for a service. - * @alias serviceconsumermanagement.services.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of results returned by this request. Currently, the default maximum is set to 1000. If page_size is not provided or the size provided is a number larger than 1000, it will be automatically set to 1000. Optional. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. Optional. - * @param {string} params.parent Service for which search is performed. services/{service} {service} the name of a service, for example 'service.googleapis.com'. - * @param {string=} params.query Set a query `{expression}` for querying tenancy units. Your `{expression}` must be in the format: `field_name=literal_string`. The `field_name` is the name of the field you want to compare. Supported fields are `tenant_resources.tag` and `tenant_resources.resource`. For example, to search tenancy units that contain at least one tenant resource with given tag 'xyz', use query `tenant_resources.tag=xyz`. To search tenancy units that contain at least one tenant resource with given resource name 'projects/123456', use query `tenant_resources.resource=projects/123456`. Multiple expressions can be joined with `AND`s. Tenancy units must match all expressions to be included in the result set. For example, `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456` Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Services { + root: Serviceconsumermanagement; + tenancyUnits: Resource$Services$Tenancyunits; + constructor(root: Serviceconsumermanagement) { + this.root = root; + this.getRoot.bind(this); + this.tenancyUnits = new Resource$Services$Tenancyunits(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Services$Tenancyunits { - root: Serviceconsumermanagement; - constructor(root: Serviceconsumermanagement) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * serviceconsumermanagement.services.tenancyUnits.addProject - * @desc Add a new tenant project to the tenancy unit. There can be at most - * 512 tenant projects in a tenancy unit. If there are previously failed - * `AddTenantProject` calls, you might need to call `RemoveTenantProject` - * first to clean them before you can make another `AddTenantProject` with the - * same tag. Operation. - * @alias serviceconsumermanagement.services.tenancyUnits.addProject - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Name of the tenancy unit. - * @param {().AddTenantProjectRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addProject(params?: any, options?: MethodOptions): - AxiosPromise; - addProject( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addProject( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * serviceconsumermanagement.services.search + * @desc Search tenancy units for a service. + * @alias serviceconsumermanagement.services.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of results returned by this request. Currently, the default maximum is set to 1000. If page_size is not provided or the size provided is a number larger than 1000, it will be automatically set to 1000. Optional. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. Optional. + * @param {string} params.parent Service for which search is performed. services/{service} {service} the name of a service, for example 'service.googleapis.com'. + * @param {string=} params.query Set a query `{expression}` for querying tenancy units. Your `{expression}` must be in the format: `field_name=literal_string`. The `field_name` is the name of the field you want to compare. Supported fields are `tenant_resources.tag` and `tenant_resources.resource`. For example, to search tenancy units that contain at least one tenant resource with given tag 'xyz', use query `tenant_resources.tag=xyz`. To search tenancy units that contain at least one tenant resource with given resource name 'projects/123456', use query `tenant_resources.resource=projects/123456`. Multiple expressions can be joined with `AND`s. Tenancy units must match all expressions to be included in the result set. For example, `tenant_resources.tag=xyz AND tenant_resources.resource=projects/123456` Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Services$Tenancyunits { + root: Serviceconsumermanagement; + constructor(root: Serviceconsumermanagement) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}:addProject') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * serviceconsumermanagement.services.tenancyUnits.create - * @desc Creates a tenancy unit with no tenant resources. - * @alias serviceconsumermanagement.services.tenancyUnits.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent services/{service}/{collection id}/{resource id} {collection id} is the cloud resource collection type representing the service consumer, for example 'projects', or 'organizations'. {resource id} is the consumer numeric id, such as project number: '123456'. {service} the name of a service, for example 'service.googleapis.com'. Enabled service binding using the new tenancy unit. - * @param {().CreateTenancyUnitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/tenancyUnits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * serviceconsumermanagement.services.tenancyUnits.addProject + * @desc Add a new tenant project to the tenancy unit. There can be at most + * 512 tenant projects in a tenancy unit. If there are previously failed + * `AddTenantProject` calls, you might need to call `RemoveTenantProject` + * first to clean them before you can make another `AddTenantProject` with + * the same tag. Operation. + * @alias serviceconsumermanagement.services.tenancyUnits.addProject + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Name of the tenancy unit. + * @param {().AddTenantProjectRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addProject(params?: any, options?: MethodOptions): + AxiosPromise; + addProject( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addProject( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}:addProject') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * serviceconsumermanagement.services.tenancyUnits.delete - * @desc Delete a tenancy unit. Before the tenancy unit is deleted, there - * should be no tenant resources in it. Operation. - * @alias serviceconsumermanagement.services.tenancyUnits.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the tenancy unit to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceconsumermanagement.services.tenancyUnits.create + * @desc Creates a tenancy unit with no tenant resources. + * @alias serviceconsumermanagement.services.tenancyUnits.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent services/{service}/{collection id}/{resource id} {collection id} is the cloud resource collection type representing the service consumer, for example 'projects', or 'organizations'. {resource id} is the consumer numeric id, such as project number: '123456'. {service} the name of a service, for example 'service.googleapis.com'. Enabled service binding using the new tenancy unit. + * @param {().CreateTenancyUnitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/tenancyUnits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceconsumermanagement.services.tenancyUnits.list - * @desc Find the tenancy unit for a service and consumer. This method should - * not be used in producers' runtime path, for example finding the tenant - * project number when creating VMs. Producers should persist the tenant - * project information after the project is created. - * @alias serviceconsumermanagement.services.tenancyUnits.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Filter expression over tenancy resources field. Optional. - * @param {integer=} params.pageSize The maximum number of results returned by this request. - * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - * @param {string} params.parent Service and consumer. Required. services/{service}/{collection id}/{resource id} {collection id} is the cloud resource collection type representing the service consumer, for example 'projects', or 'organizations'. {resource id} is the consumer numeric id, such as project number: '123456'. {service} the name of a service, for example 'service.googleapis.com'. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * serviceconsumermanagement.services.tenancyUnits.delete + * @desc Delete a tenancy unit. Before the tenancy unit is deleted, there + * should be no tenant resources in it. Operation. + * @alias serviceconsumermanagement.services.tenancyUnits.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the tenancy unit to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/tenancyUnits') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceconsumermanagement.services.tenancyUnits.removeProject - * @desc Removes specified project resource identified by tenant resource tag. - * It will remove project lien with 'TenantManager' origin if that was added. - * It will then attempt to delete the project. If that operation fails, this - * method fails. Operation. - * @alias serviceconsumermanagement.services.tenancyUnits.removeProject - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the tenancy unit. Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. - * @param {().RemoveTenantProjectRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removeProject(params?: any, options?: MethodOptions): - AxiosPromise; - removeProject( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removeProject( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceconsumermanagement.services.tenancyUnits.list + * @desc Find the tenancy unit for a service and consumer. This method + * should not be used in producers' runtime path, for example finding the + * tenant project number when creating VMs. Producers should persist the + * tenant project information after the project is created. + * @alias serviceconsumermanagement.services.tenancyUnits.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Filter expression over tenancy resources field. Optional. + * @param {integer=} params.pageSize The maximum number of results returned by this request. + * @param {string=} params.pageToken The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + * @param {string} params.parent Service and consumer. Required. services/{service}/{collection id}/{resource id} {collection id} is the cloud resource collection type representing the service consumer, for example 'projects', or 'organizations'. {resource id} is the consumer numeric id, such as project number: '123456'. {service} the name of a service, for example 'service.googleapis.com'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/tenancyUnits') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://serviceconsumermanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:removeProject') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * serviceconsumermanagement.services.tenancyUnits.removeProject + * @desc Removes specified project resource identified by tenant resource + * tag. It will remove project lien with 'TenantManager' origin if that was + * added. It will then attempt to delete the project. If that operation + * fails, this method fails. Operation. + * @alias serviceconsumermanagement.services.tenancyUnits.removeProject + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the tenancy unit. Such as 'services/service.googleapis.com/projects/12345/tenancyUnits/abcd'. + * @param {().RemoveTenantProjectRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removeProject(params?: any, options?: MethodOptions): + AxiosPromise; + removeProject( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removeProject( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || + 'https://serviceconsumermanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:removeProject') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/servicecontrol/v1.ts b/src/apis/servicecontrol/v1.ts index a70ef74d322..8f9b7b5ea78 100644 --- a/src/apis/servicecontrol/v1.ts +++ b/src/apis/servicecontrol/v1.ts @@ -27,1493 +27,1516 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Service Control API - * - * Google Service Control provides control plane functionality to managed - * services, such as logging, monitoring, and status checks. - * - * @example - * const google = require('googleapis'); - * const servicecontrol = google.servicecontrol('v1'); - * - * @namespace servicecontrol - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Servicecontrol - */ -export class Servicecontrol { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace servicecontrol_v1 { + /** + * Service Control API + * + * Google Service Control provides control plane functionality to managed + * services, such as logging, monitoring, and status checks. + * + * @example + * const google = require('googleapis'); + * const servicecontrol = google.servicecontrol('v1'); + * + * @namespace servicecontrol + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Servicecontrol + */ + export class Servicecontrol { + _options: GlobalOptions; + google: GoogleApis; + root = this; - services: Resource$Services; + services: Resource$Services; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.services = new Resource$Services(this); - } + this.services = new Resource$Services(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$AllocateInfo { - /** - * A list of label keys that were unused by the server in processing the - * request. Thus, for similar requests repeated in a certain future time - * window, the caller can choose to ignore these labels in the requests to - * achieve better client-side cache hits and quota aggregation. - */ - unusedArguments: string[]; -} -/** - * Request message for the AllocateQuota method. - */ -export interface Schema$AllocateQuotaRequest { - /** - * Operation that describes the quota allocation. - */ - allocateOperation: Schema$QuotaOperation; - /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the latest - * one will be used. - */ - serviceConfigId: string; -} -/** - * Response message for the AllocateQuota method. - */ -export interface Schema$AllocateQuotaResponse { - /** - * Indicates the decision of the allocate. - */ - allocateErrors: Schema$QuotaError[]; - /** - * WARNING: DO NOT use this field until this warning message is removed. - */ - allocateInfo: Schema$AllocateInfo; - /** - * The same operation_id value used in the AllocateQuotaRequest. Used for - * logging and diagnostics purposes. - */ - operationId: string; - /** - * Quota metrics to indicate the result of allocation. Depending on the - * request, one or more of the following metrics will be included: 1. Per - * quota group or per quota metric incremental usage will be specified using - * the following delta metric : - * "serviceruntime.googleapis.com/api/consumer/quota_used_count" 2. - * The quota limit reached condition will be specified using the following - * boolean metric : "serviceruntime.googleapis.com/quota/exceeded" - */ - quotaMetrics: Schema$MetricValueSet[]; - /** - * ID of the actual config used to process the request. - */ - serviceConfigId: string; -} -/** - * Common audit log format for Google Cloud Platform API operations. - */ -export interface Schema$AuditLog { - /** - * Authentication information. - */ - authenticationInfo: Schema$AuthenticationInfo; - /** - * Authorization information. If there are multiple resources or permissions - * involved, then there is one AuthorizationInfo element for each {resource, - * permission} tuple. - */ - authorizationInfo: Schema$AuthorizationInfo[]; - /** - * Other service-specific data about the request, response, and other - * information associated with the current audited event. - */ - metadata: any; - /** - * The name of the service method or operation. For API calls, this should be - * the name of the API method. For example, - * "google.datastore.v1.Datastore.RunQuery" - * "google.logging.v1.LoggingService.DeleteLog" - */ - methodName: string; - /** - * The number of items returned from a List or Query API method, if - * applicable. - */ - numResponseItems: string; - /** - * The operation request. This may not include all request parameters, such as - * those that are too large, privacy-sensitive, or duplicated elsewhere in the - * log record. It should never include user-generated data, such as file - * contents. When the JSON object represented here has a proto equivalent, the - * proto name will be indicated in the `@type` property. - */ - request: any; - /** - * Metadata about the operation. - */ - requestMetadata: Schema$RequestMetadata; - /** - * The resource or collection that is the target of the operation. The name is - * a scheme-less URI, not including the API service name. For example: - * "shelves/SHELF_ID/books" - * "shelves/SHELF_ID/books/BOOK_ID" - */ - resourceName: string; - /** - * The operation response. This may not include all response elements, such as - * those that are too large, privacy-sensitive, or duplicated elsewhere in the - * log record. It should never include user-generated data, such as file - * contents. When the JSON object represented here has a proto equivalent, the - * proto name will be indicated in the `@type` property. - */ - response: any; - /** - * Deprecated, use `metadata` field instead. Other service-specific data about - * the request, response, and other activities. - */ - serviceData: any; - /** - * The name of the API service performing the operation. For example, - * `"datastore.googleapis.com"`. - */ - serviceName: string; - /** - * The status of the overall operation. - */ - status: Schema$Status; -} -/** - * Authentication information for the operation. - */ -export interface Schema$AuthenticationInfo { - /** - * The authority selector specified by the requestor, if any. It is not - * guaranteed that the principal was allowed to use this authority. - */ - authoritySelector: string; - /** - * The email address of the authenticated user (or service account on behalf - * of third party principal) making the request. For privacy reasons, the - * principal email address is redacted for all read-only operations that fail - * with a "permission denied" error. - */ - principalEmail: string; - /** - * The third party identification (if any) of the authenticated user making - * the request. When the JSON object represented here has a proto equivalent, - * the proto name will be indicated in the `@type` property. - */ - thirdPartyPrincipal: any; -} -/** - * Authorization information for the operation. - */ -export interface Schema$AuthorizationInfo { - /** - * Whether or not authorization for `resource` and `permission` was granted. - */ - granted: boolean; - /** - * The required IAM permission. - */ - permission: string; - /** - * The resource being accessed, as a REST-style string. For example: - * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID - */ - resource: string; -} -/** - * Defines the errors to be returned in - * google.api.servicecontrol.v1.CheckResponse.check_errors. - */ -export interface Schema$CheckError { - /** - * The error code. - */ - code: string; - /** - * Free-form text providing details on the error cause of the error. - */ - detail: string; - /** - * Subject to whom this error applies. See the specific code enum for more - * details on this field. For example: - “project:<project-id or - * project-number>” - “folder:<folder-id>” - - * “organization:<organization-id>” - */ - subject: string; -} -/** - * Contains additional information about the check operation. - */ -export interface Schema$CheckInfo { - /** - * Consumer info of this check. - */ - consumerInfo: Schema$ConsumerInfo; - /** - * A list of fields and label keys that are ignored by the server. The client - * doesn't need to send them for following requests to improve performance - * and allow better aggregation. - */ - unusedArguments: string[]; -} -/** - * Request message for the Check method. - */ -export interface Schema$CheckRequest { - /** - * The operation to be checked. - */ - operation: Schema$Operation; - /** - * Requests the project settings to be returned as part of the check response. - */ - requestProjectSettings: boolean; - /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the - * latest one will be used. - */ - serviceConfigId: string; - /** - * Indicates if service activation check should be skipped for this request. - * Default behavior is to perform the check and apply relevant quota. - */ - skipActivationCheck: boolean; -} -/** - * Response message for the Check method. - */ -export interface Schema$CheckResponse { - /** - * Indicate the decision of the check. If no check errors are present, the - * service should process the operation. Otherwise the service should use the - * list of errors to determine the appropriate action. - */ - checkErrors: Schema$CheckError[]; - /** - * Feedback data returned from the server during processing a Check request. - */ - checkInfo: Schema$CheckInfo; - /** - * The same operation_id value used in the CheckRequest. Used for logging and - * diagnostics purposes. - */ - operationId: string; - /** - * Quota information for the check request associated with this response. - */ - quotaInfo: Schema$QuotaInfo; - /** - * The actual config id used to process the request. - */ - serviceConfigId: string; -} -/** - * `ConsumerInfo` provides information about the consumer project. - */ -export interface Schema$ConsumerInfo { - /** - * The Google cloud project number, e.g. 1234567890. A value of 0 indicates no - * project number is found. - */ - projectNumber: string; -} -/** - * Distribution represents a frequency distribution of double-valued sample - * points. It contains the size of the population of sample points plus - * additional optional information: - the arithmetic mean of the samples - - * the minimum and maximum of the samples - the sum-squared-deviation of the - * samples, used to compute variance - a histogram of the values of the sample - * points - */ -export interface Schema$Distribution { - /** - * The number of samples in each histogram bucket. `bucket_counts` are - * optional. If present, they must sum to the `count` value. The buckets are - * defined below in `bucket_option`. There are N buckets. `bucket_counts[0]` - * is the number of samples in the underflow bucket. `bucket_counts[1]` to - * `bucket_counts[N-1]` are the numbers of samples in each of the finite - * buckets. And `bucket_counts[N] is the number of samples in the overflow - * bucket. See the comments of `bucket_option` below for more details. Any - * suffix of trailing zeros may be omitted. - */ - bucketCounts: string[]; - /** - * The total number of samples in the distribution. Must be >= 0. - */ - count: string; - /** - * Buckets with arbitrary user-provided width. - */ - explicitBuckets: Schema$ExplicitBuckets; - /** - * Buckets with exponentially growing width. - */ - exponentialBuckets: Schema$ExponentialBuckets; - /** - * Buckets with constant width. - */ - linearBuckets: Schema$LinearBuckets; - /** - * The maximum of the population of values. Ignored if `count` is zero. - */ - maximum: number; - /** - * The arithmetic mean of the samples in the distribution. If `count` is zero - * then this field must be zero. - */ - mean: number; - /** - * The minimum of the population of values. Ignored if `count` is zero. - */ - minimum: number; - /** - * The sum of squared deviations from the mean: Sum[i=1..count]((x_i - - * mean)^2) where each x_i is a sample values. If `count` is zero then this - * field must be zero, otherwise validation of the request fails. - */ - sumOfSquaredDeviation: number; -} -/** - * Request message for QuotaController.EndReconciliation. - */ -export interface Schema$EndReconciliationRequest { - /** - * Operation that describes the quota reconciliation. - */ - reconciliationOperation: Schema$QuotaOperation; - /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the latest - * one will be used. - */ - serviceConfigId: string; -} -/** - * Response message for QuotaController.EndReconciliation. - */ -export interface Schema$EndReconciliationResponse { - /** - * The same operation_id value used in the EndReconciliationRequest. Used for - * logging and diagnostics purposes. - */ - operationId: string; - /** - * Metric values as tracked by One Platform before the adjustment was made. - * The following metrics will be included: 1. Per quota metric total usage - * will be specified using the following gauge metric: - * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" - * 2. Value for each quota limit associated with the metrics will be specified - * using the following gauge metric: - * "serviceruntime.googleapis.com/quota/limit" 3. Delta value of - * the usage after the reconciliation for limits associated with the metrics - * will be specified using the following metric: - * "serviceruntime.googleapis.com/allocation/reconciliation_delta" - * The delta value is defined as: new_usage_from_client - - * existing_value_in_spanner. This metric is not defined in - * serviceruntime.yaml or in Cloud Monarch. This metric is meant for - * callers' use only. Since this metric is not defined in the monitoring - * backend, reporting on this metric will result in an error. - */ - quotaMetrics: Schema$MetricValueSet[]; - /** - * Indicates the decision of the reconciliation end. - */ - reconciliationErrors: Schema$QuotaError[]; - /** - * ID of the actual config used to process the request. - */ - serviceConfigId: string; -} -/** - * Describing buckets with arbitrary user-provided width. - */ -export interface Schema$ExplicitBuckets { - /** - * 'bound' is a list of strictly increasing boundaries between - * buckets. Note that a list of length N-1 defines N buckets because of - * fenceposting. See comments on `bucket_options` for details. The i'th - * finite bucket covers the interval [bound[i-1], bound[i]) where i ranges - * from 1 to bound_size() - 1. Note that there are no finite buckets at all if - * 'bound' only contains a single element; in that special case the - * single bound defines the boundary between the underflow and overflow - * buckets. bucket number lower bound upper bound i == - * 0 (underflow) -inf bound[i] 0 < i < - * bound_size() bound[i-1] bound[i] i == bound_size() - * (overflow) bound[i-1] +inf - */ - bounds: number[]; -} -/** - * Describing buckets with exponentially growing width. - */ -export interface Schema$ExponentialBuckets { - /** - * The i'th exponential bucket covers the interval [scale * - * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to - * num_finite_buckets inclusive. Must be larger than 1.0. - */ - growthFactor: number; - /** - * The number of finite buckets. With the underflow and overflow buckets, the - * total number of buckets is `num_finite_buckets` + 2. See comments on - * `bucket_options` for details. - */ - numFiniteBuckets: number; - /** - * The i'th exponential bucket covers the interval [scale * - * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to - * num_finite_buckets inclusive. Must be > 0. - */ - scale: number; -} -/** - * Describing buckets with constant width. - */ -export interface Schema$LinearBuckets { - /** - * The number of finite buckets. With the underflow and overflow buckets, the - * total number of buckets is `num_finite_buckets` + 2. See comments on - * `bucket_options` for details. - */ - numFiniteBuckets: number; - /** - * The i'th linear bucket covers the interval [offset + (i-1) * width, - * offset + i * width) where i ranges from 1 to num_finite_buckets, inclusive. - */ - offset: number; - /** - * The i'th linear bucket covers the interval [offset + (i-1) * width, - * offset + i * width) where i ranges from 1 to num_finite_buckets, inclusive. - * Must be strictly positive. - */ - width: number; -} -/** - * An individual log entry. - */ -export interface Schema$LogEntry { - /** - * A unique ID for the log entry used for deduplication. If omitted, the - * implementation will generate one based on operation_id. - */ - insertId: string; - /** - * A set of user-defined (key, value) data that provides additional - * information about the log entry. - */ - labels: any; - /** - * Required. The log to which this log entry belongs. Examples: - * `"syslog"`, `"book_log"`. - */ - name: string; - /** - * The log entry payload, represented as a protocol buffer that is expressed - * as a JSON object. The only accepted type currently is AuditLog. - */ - protoPayload: any; - /** - * The severity of the log entry. The default value is `LogSeverity.DEFAULT`. - */ - severity: string; - /** - * The log entry payload, represented as a structure that is expressed as a - * JSON object. - */ - structPayload: any; - /** - * The log entry payload, represented as a Unicode string (UTF-8). - */ - textPayload: string; - /** - * The time the event described by the log entry occurred. If omitted, - * defaults to operation start time. - */ - timestamp: string; -} -/** - * Represents a single metric value. - */ -export interface Schema$MetricValue { - /** - * A boolean value. - */ - boolValue: boolean; - /** - * A distribution value. - */ - distributionValue: Schema$Distribution; - /** - * A double precision floating point value. - */ - doubleValue: number; - /** - * The end of the time period over which this metric value's measurement - * applies. - */ - endTime: string; - /** - * A signed 64-bit integer value. - */ - int64Value: string; - /** - * The labels describing the metric value. See comments on - * google.api.servicecontrol.v1.Operation.labels for the overriding - * relationship. - */ - labels: any; - /** - * A money value. - */ - moneyValue: Schema$Money; - /** - * The start of the time period over which this metric value's measurement - * applies. The time period has different semantics for different metric types - * (cumulative, delta, and gauge). See the metric definition documentation in - * the service configuration for details. - */ - startTime: string; - /** - * A text string value. - */ - stringValue: string; -} -/** - * Represents a set of metric values in the same metric. Each metric value in - * the set should have a unique combination of start time, end time, and label - * values. - */ -export interface Schema$MetricValueSet { - /** - * The metric name defined in the service configuration. - */ - metricName: string; - /** - * The values in this metric. - */ - metricValues: Schema$MetricValue[]; -} -/** - * Represents an amount of money with its currency type. - */ -export interface Schema$Money { - /** - * The 3-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: string; -} -/** - * Represents information regarding an operation. - */ -export interface Schema$Operation { - /** - * Identity of the consumer who is using the service. This field should be - * filled in for the operations initiated by a consumer, but not for - * service-initiated operations that are not related to a specific consumer. - * This can be in one of the following formats: project:<project_id>, - * project_number:<project_number>, api_key:<api_key>. - */ - consumerId: string; - /** - * End time of the operation. Required when the operation is used in - * ServiceController.Report, but optional when the operation is used in - * ServiceController.Check. - */ - endTime: string; - /** - * DO NOT USE. This is an experimental field. - */ - importance: string; - /** - * Labels describing the operation. Only the following labels are allowed: - - * Labels describing monitored resources as defined in the service - * configuration. - Default labels of metric values. When specified, labels - * defined in the metric value override these default. - The following - * labels defined by Google Cloud Platform: - - * `cloud.googleapis.com/location` describing the location where the operation - * happened, - `servicecontrol.googleapis.com/user_agent` describing the - * user agent of the API request, - - * `servicecontrol.googleapis.com/service_agent` describing the service used - * to handle the API request (e.g. ESP), - - * `servicecontrol.googleapis.com/platform` describing the platform where the - * API is served, such as App Engine, Compute Engine, or Kubernetes - * Engine. - */ - labels: any; - /** - * Represents information to be logged. - */ - logEntries: Schema$LogEntry[]; - /** - * Represents information about this operation. Each MetricValueSet - * corresponds to a metric defined in the service configuration. The data type - * used in the MetricValueSet must agree with the data type specified in the - * metric definition. Within a single operation, it is not allowed to have - * more than one MetricValue instances that have the same metric names and - * identical label value combinations. If a request has such duplicated - * MetricValue instances, the entire request is rejected with an invalid - * argument error. - */ - metricValueSets: Schema$MetricValueSet[]; - /** - * Identity of the operation. This must be unique within the scope of the - * service that generated the operation. If the service calls Check() and - * Report() on the same operation, the two calls should carry the same id. - * UUID version 4 is recommended, though not required. In scenarios where an - * operation is computed from existing information and an idempotent id is - * desirable for deduplication purpose, UUID version 5 is recommended. See RFC - * 4122 for details. - */ - operationId: string; - /** - * Fully qualified name of the operation. Reserved for future use. - */ - operationName: string; - /** - * Represents the properties needed for quota check. Applicable only if this - * operation is for a quota check request. If this is not specified, no quota - * check will be performed. - */ - quotaProperties: Schema$QuotaProperties; - /** - * DO NOT USE. This field is deprecated, use "resources" field - * instead. The resource name of the parent of a resource in the resource - * hierarchy. This can be in one of the following formats: - - * “projects/<project-id or project-number>” - - * “folders/<folder-id>” - “organizations/<organization-id>” - */ - resourceContainer: string; - /** - * The resources that are involved in the operation. The maximum supported - * number of entries in this field is 100. - */ - resources: Schema$ResourceInfo[]; - /** - * Required. Start time of the operation. - */ - startTime: string; - /** - * User defined labels for the resource that this operation is associated - * with. Only a combination of 1000 user labels per consumer project are - * allowed. - */ - userLabels: any; -} -/** - * Represents error information for QuotaOperation. - */ -export interface Schema$QuotaError { - /** - * Error code. - */ - code: string; - /** - * Free-form text that provides details on the cause of the error. - */ - description: string; - /** - * Subject to whom this error applies. See the specific enum for more details - * on this field. For example, "clientip:<ip address of - * client>" or "project:<Google developer project - * id>". - */ - subject: string; -} -/** - * Contains the quota information for a quota check response. - */ -export interface Schema$QuotaInfo { - /** - * Quota Metrics that have exceeded quota limits. For QuotaGroup-based quota, - * this is QuotaGroup.name For QuotaLimit-based quota, this is QuotaLimit.name - * See: google.api.Quota Deprecated: Use quota_metrics to get per quota group - * limit exceeded status. - */ - limitExceeded: string[]; - /** - * Map of quota group name to the actual number of tokens consumed. If the - * quota check was not successful, then this will not be populated due to no - * quota consumption. We are not merging this field with - * 'quota_metrics' field because of the complexity of scaling in - * Chemist client code base. For simplicity, we will keep this field for - * Castor (that scales quota usage) and 'quota_metrics' for SuperQuota - * (that doesn't scale quota usage). - */ - quotaConsumed: any; - /** - * Quota metrics to indicate the usage. Depending on the check request, one or - * more of the following metrics will be included: 1. For rate quota, per - * quota group or per quota metric incremental usage will be specified using - * the following delta metric: - * "serviceruntime.googleapis.com/api/consumer/quota_used_count" 2. - * For allocation quota, per quota metric total usage will be specified using - * the following gauge metric: - * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" - * 3. For both rate quota and allocation quota, the quota limit reached - * condition will be specified using the following boolean metric: - * "serviceruntime.googleapis.com/quota/exceeded" - */ - quotaMetrics: Schema$MetricValueSet[]; -} -/** - * Represents information regarding a quota operation. - */ -export interface Schema$QuotaOperation { - /** - * Identity of the consumer for whom this quota operation is being performed. - * This can be in one of the following formats: project:<project_id>, - * project_number:<project_number>, api_key:<api_key>. - */ - consumerId: string; + export interface Schema$AllocateInfo { + /** + * A list of label keys that were unused by the server in processing the + * request. Thus, for similar requests repeated in a certain future time + * window, the caller can choose to ignore these labels in the requests to + * achieve better client-side cache hits and quota aggregation. + */ + unusedArguments: string[]; + } /** - * Labels describing the operation. - */ - labels: any; + * Request message for the AllocateQuota method. + */ + export interface Schema$AllocateQuotaRequest { + /** + * Operation that describes the quota allocation. + */ + allocateOperation: Schema$QuotaOperation; + /** + * Specifies which version of service configuration should be used to + * process the request. If unspecified or no matching version can be found, + * the latest one will be used. + */ + serviceConfigId: string; + } /** - * Fully qualified name of the API method for which this quota operation is - * requested. This name is used for matching quota rules or metric rules and - * billing status rules defined in service configuration. This field should - * not be set if any of the following is true: (1) the quota operation is - * performed on non-API resources. (2) quota_metrics is set because the caller - * is doing quota override. Example of an RPC method name: - * google.example.library.v1.LibraryService.CreateShelf - */ - methodName: string; + * Response message for the AllocateQuota method. + */ + export interface Schema$AllocateQuotaResponse { + /** + * Indicates the decision of the allocate. + */ + allocateErrors: Schema$QuotaError[]; + /** + * WARNING: DO NOT use this field until this warning message is removed. + */ + allocateInfo: Schema$AllocateInfo; + /** + * The same operation_id value used in the AllocateQuotaRequest. Used for + * logging and diagnostics purposes. + */ + operationId: string; + /** + * Quota metrics to indicate the result of allocation. Depending on the + * request, one or more of the following metrics will be included: 1. Per + * quota group or per quota metric incremental usage will be specified using + * the following delta metric : + * "serviceruntime.googleapis.com/api/consumer/quota_used_count" + * 2. The quota limit reached condition will be specified using the + * following boolean metric : + * "serviceruntime.googleapis.com/quota/exceeded" + */ + quotaMetrics: Schema$MetricValueSet[]; + /** + * ID of the actual config used to process the request. + */ + serviceConfigId: string; + } /** - * Identity of the operation. This is expected to be unique within the scope - * of the service that generated the operation, and guarantees idempotency in - * case of retries. UUID version 4 is recommended, though not required. In - * scenarios where an operation is computed from existing information and an - * idempotent id is desirable for deduplication purpose, UUID version 5 is - * recommended. See RFC 4122 for details. - */ - operationId: string; + * Common audit log format for Google Cloud Platform API operations. + */ + export interface Schema$AuditLog { + /** + * Authentication information. + */ + authenticationInfo: Schema$AuthenticationInfo; + /** + * Authorization information. If there are multiple resources or permissions + * involved, then there is one AuthorizationInfo element for each {resource, + * permission} tuple. + */ + authorizationInfo: Schema$AuthorizationInfo[]; + /** + * Other service-specific data about the request, response, and other + * information associated with the current audited event. + */ + metadata: any; + /** + * The name of the service method or operation. For API calls, this should + * be the name of the API method. For example, + * "google.datastore.v1.Datastore.RunQuery" + * "google.logging.v1.LoggingService.DeleteLog" + */ + methodName: string; + /** + * The number of items returned from a List or Query API method, if + * applicable. + */ + numResponseItems: string; + /** + * The operation request. This may not include all request parameters, such + * as those that are too large, privacy-sensitive, or duplicated elsewhere + * in the log record. It should never include user-generated data, such as + * file contents. When the JSON object represented here has a proto + * equivalent, the proto name will be indicated in the `@type` property. + */ + request: any; + /** + * Metadata about the operation. + */ + requestMetadata: Schema$RequestMetadata; + /** + * The resource or collection that is the target of the operation. The name + * is a scheme-less URI, not including the API service name. For example: + * "shelves/SHELF_ID/books" + * "shelves/SHELF_ID/books/BOOK_ID" + */ + resourceName: string; + /** + * The operation response. This may not include all response elements, such + * as those that are too large, privacy-sensitive, or duplicated elsewhere + * in the log record. It should never include user-generated data, such as + * file contents. When the JSON object represented here has a proto + * equivalent, the proto name will be indicated in the `@type` property. + */ + response: any; + /** + * Deprecated, use `metadata` field instead. Other service-specific data + * about the request, response, and other activities. + */ + serviceData: any; + /** + * The name of the API service performing the operation. For example, + * `"datastore.googleapis.com"`. + */ + serviceName: string; + /** + * The status of the overall operation. + */ + status: Schema$Status; + } /** - * Represents information about this operation. Each MetricValueSet - * corresponds to a metric defined in the service configuration. The data type - * used in the MetricValueSet must agree with the data type specified in the - * metric definition. Within a single operation, it is not allowed to have - * more than one MetricValue instances that have the same metric names and - * identical label value combinations. If a request has such duplicated - * MetricValue instances, the entire request is rejected with an invalid - * argument error. This field is mutually exclusive with method_name. - */ - quotaMetrics: Schema$MetricValueSet[]; + * Authentication information for the operation. + */ + export interface Schema$AuthenticationInfo { + /** + * The authority selector specified by the requestor, if any. It is not + * guaranteed that the principal was allowed to use this authority. + */ + authoritySelector: string; + /** + * The email address of the authenticated user (or service account on behalf + * of third party principal) making the request. For privacy reasons, the + * principal email address is redacted for all read-only operations that + * fail with a "permission denied" error. + */ + principalEmail: string; + /** + * The third party identification (if any) of the authenticated user making + * the request. When the JSON object represented here has a proto + * equivalent, the proto name will be indicated in the `@type` property. + */ + thirdPartyPrincipal: any; + } /** - * Quota mode for this operation. - */ - quotaMode: string; -} -/** - * Represents the properties needed for quota operations. - */ -export interface Schema$QuotaProperties { + * Authorization information for the operation. + */ + export interface Schema$AuthorizationInfo { + /** + * Whether or not authorization for `resource` and `permission` was granted. + */ + granted: boolean; + /** + * The required IAM permission. + */ + permission: string; + /** + * The resource being accessed, as a REST-style string. For example: + * bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID + */ + resource: string; + } /** - * Quota mode for this operation. - */ - quotaMode: string; -} -/** - * Request message for the ReleaseQuota method. - */ -export interface Schema$ReleaseQuotaRequest { + * Defines the errors to be returned in + * google.api.servicecontrol.v1.CheckResponse.check_errors. + */ + export interface Schema$CheckError { + /** + * The error code. + */ + code: string; + /** + * Free-form text providing details on the error cause of the error. + */ + detail: string; + /** + * Subject to whom this error applies. See the specific code enum for more + * details on this field. For example: - “project:<project-id or + * project-number>” - “folder:<folder-id>” - + * “organization:<organization-id>” + */ + subject: string; + } /** - * Operation that describes the quota release. - */ - releaseOperation: Schema$QuotaOperation; + * Contains additional information about the check operation. + */ + export interface Schema$CheckInfo { + /** + * Consumer info of this check. + */ + consumerInfo: Schema$ConsumerInfo; + /** + * A list of fields and label keys that are ignored by the server. The + * client doesn't need to send them for following requests to improve + * performance and allow better aggregation. + */ + unusedArguments: string[]; + } /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the latest - * one will be used. - */ - serviceConfigId: string; -} -/** - * Response message for the ReleaseQuota method. - */ -export interface Schema$ReleaseQuotaResponse { + * Request message for the Check method. + */ + export interface Schema$CheckRequest { + /** + * The operation to be checked. + */ + operation: Schema$Operation; + /** + * Requests the project settings to be returned as part of the check + * response. + */ + requestProjectSettings: boolean; + /** + * Specifies which version of service configuration should be used to + * process the request. If unspecified or no matching version can be found, + * the latest one will be used. + */ + serviceConfigId: string; + /** + * Indicates if service activation check should be skipped for this request. + * Default behavior is to perform the check and apply relevant quota. + */ + skipActivationCheck: boolean; + } /** - * The same operation_id value used in the ReleaseQuotaRequest. Used for - * logging and diagnostics purposes. - */ - operationId: string; + * Response message for the Check method. + */ + export interface Schema$CheckResponse { + /** + * Indicate the decision of the check. If no check errors are present, the + * service should process the operation. Otherwise the service should use + * the list of errors to determine the appropriate action. + */ + checkErrors: Schema$CheckError[]; + /** + * Feedback data returned from the server during processing a Check request. + */ + checkInfo: Schema$CheckInfo; + /** + * The same operation_id value used in the CheckRequest. Used for logging + * and diagnostics purposes. + */ + operationId: string; + /** + * Quota information for the check request associated with this response. + */ + quotaInfo: Schema$QuotaInfo; + /** + * The actual config id used to process the request. + */ + serviceConfigId: string; + } /** - * Quota metrics to indicate the result of release. Depending on the request, - * one or more of the following metrics will be included: 1. For rate quota, - * per quota group or per quota metric released amount will be specified using - * the following delta metric: - * "serviceruntime.googleapis.com/api/consumer/quota_refund_count" - * 2. For allocation quota, per quota metric total usage will be specified - * using the following gauge metric: - * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" - * 3. For allocation quota, value for each quota limit associated with the - * metrics will be specified using the following gauge metric: - * "serviceruntime.googleapis.com/quota/limit" + * `ConsumerInfo` provides information about the consumer project. */ - quotaMetrics: Schema$MetricValueSet[]; + export interface Schema$ConsumerInfo { + /** + * The Google cloud project number, e.g. 1234567890. A value of 0 indicates + * no project number is found. + */ + projectNumber: string; + } /** - * Indicates the decision of the release. - */ - releaseErrors: Schema$QuotaError[]; + * Distribution represents a frequency distribution of double-valued sample + * points. It contains the size of the population of sample points plus + * additional optional information: - the arithmetic mean of the samples - + * the minimum and maximum of the samples - the sum-squared-deviation of the + * samples, used to compute variance - a histogram of the values of the + * sample points + */ + export interface Schema$Distribution { + /** + * The number of samples in each histogram bucket. `bucket_counts` are + * optional. If present, they must sum to the `count` value. The buckets + * are defined below in `bucket_option`. There are N buckets. + * `bucket_counts[0]` is the number of samples in the underflow bucket. + * `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples in + * each of the finite buckets. And `bucket_counts[N] is the number of + * samples in the overflow bucket. See the comments of `bucket_option` below + * for more details. Any suffix of trailing zeros may be omitted. + */ + bucketCounts: string[]; + /** + * The total number of samples in the distribution. Must be >= 0. + */ + count: string; + /** + * Buckets with arbitrary user-provided width. + */ + explicitBuckets: Schema$ExplicitBuckets; + /** + * Buckets with exponentially growing width. + */ + exponentialBuckets: Schema$ExponentialBuckets; + /** + * Buckets with constant width. + */ + linearBuckets: Schema$LinearBuckets; + /** + * The maximum of the population of values. Ignored if `count` is zero. + */ + maximum: number; + /** + * The arithmetic mean of the samples in the distribution. If `count` is + * zero then this field must be zero. + */ + mean: number; + /** + * The minimum of the population of values. Ignored if `count` is zero. + */ + minimum: number; + /** + * The sum of squared deviations from the mean: Sum[i=1..count]((x_i - + * mean)^2) where each x_i is a sample values. If `count` is zero then this + * field must be zero, otherwise validation of the request fails. + */ + sumOfSquaredDeviation: number; + } /** - * ID of the actual config used to process the request. - */ - serviceConfigId: string; -} -/** - * Represents the processing error of one Operation in the request. - */ -export interface Schema$ReportError { + * Request message for QuotaController.EndReconciliation. + */ + export interface Schema$EndReconciliationRequest { + /** + * Operation that describes the quota reconciliation. + */ + reconciliationOperation: Schema$QuotaOperation; + /** + * Specifies which version of service configuration should be used to + * process the request. If unspecified or no matching version can be found, + * the latest one will be used. + */ + serviceConfigId: string; + } /** - * The Operation.operation_id value from the request. - */ - operationId: string; + * Response message for QuotaController.EndReconciliation. + */ + export interface Schema$EndReconciliationResponse { + /** + * The same operation_id value used in the EndReconciliationRequest. Used + * for logging and diagnostics purposes. + */ + operationId: string; + /** + * Metric values as tracked by One Platform before the adjustment was made. + * The following metrics will be included: 1. Per quota metric total usage + * will be specified using the following gauge metric: + * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" + * 2. Value for each quota limit associated with the metrics will be + * specified using the following gauge metric: + * "serviceruntime.googleapis.com/quota/limit" 3. Delta value of + * the usage after the reconciliation for limits associated with the metrics + * will be specified using the following metric: + * "serviceruntime.googleapis.com/allocation/reconciliation_delta" + * The delta value is defined as: new_usage_from_client - + * existing_value_in_spanner. This metric is not defined in + * serviceruntime.yaml or in Cloud Monarch. This metric is meant for + * callers' use only. Since this metric is not defined in the monitoring + * backend, reporting on this metric will result in an error. + */ + quotaMetrics: Schema$MetricValueSet[]; + /** + * Indicates the decision of the reconciliation end. + */ + reconciliationErrors: Schema$QuotaError[]; + /** + * ID of the actual config used to process the request. + */ + serviceConfigId: string; + } /** - * Details of the error when processing the Operation. - */ - status: Schema$Status; -} -/** - * Contains additional info about the report operation. - */ -export interface Schema$ReportInfo { + * Describing buckets with arbitrary user-provided width. + */ + export interface Schema$ExplicitBuckets { + /** + * 'bound' is a list of strictly increasing boundaries between + * buckets. Note that a list of length N-1 defines N buckets because of + * fenceposting. See comments on `bucket_options` for details. The i'th + * finite bucket covers the interval [bound[i-1], bound[i]) where i ranges + * from 1 to bound_size() - 1. Note that there are no finite buckets at all + * if 'bound' only contains a single element; in that special case + * the single bound defines the boundary between the underflow and overflow + * buckets. bucket number lower bound upper bound i + * == 0 (underflow) -inf bound[i] 0 < i < + * bound_size() bound[i-1] bound[i] i == bound_size() + * (overflow) bound[i-1] +inf + */ + bounds: number[]; + } /** - * The Operation.operation_id value from the request. - */ - operationId: string; + * Describing buckets with exponentially growing width. + */ + export interface Schema$ExponentialBuckets { + /** + * The i'th exponential bucket covers the interval [scale * + * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + * num_finite_buckets inclusive. Must be larger than 1.0. + */ + growthFactor: number; + /** + * The number of finite buckets. With the underflow and overflow buckets, + * the total number of buckets is `num_finite_buckets` + 2. See comments on + * `bucket_options` for details. + */ + numFiniteBuckets: number; + /** + * The i'th exponential bucket covers the interval [scale * + * growth_factor^(i-1), scale * growth_factor^i) where i ranges from 1 to + * num_finite_buckets inclusive. Must be > 0. + */ + scale: number; + } /** - * Quota usage info when processing the `Operation`. - */ - quotaInfo: Schema$QuotaInfo; -} -/** - * Request message for the Report method. - */ -export interface Schema$ReportRequest { + * Describing buckets with constant width. + */ + export interface Schema$LinearBuckets { + /** + * The number of finite buckets. With the underflow and overflow buckets, + * the total number of buckets is `num_finite_buckets` + 2. See comments on + * `bucket_options` for details. + */ + numFiniteBuckets: number; + /** + * The i'th linear bucket covers the interval [offset + (i-1) * width, + * offset + i * width) where i ranges from 1 to num_finite_buckets, + * inclusive. + */ + offset: number; + /** + * The i'th linear bucket covers the interval [offset + (i-1) * width, + * offset + i * width) where i ranges from 1 to num_finite_buckets, + * inclusive. Must be strictly positive. + */ + width: number; + } /** - * Operations to be reported. Typically the service should report one - * operation per request. Putting multiple operations into a single request is - * allowed, but should be used only when multiple operations are natually - * available at the time of the report. If multiple operations are in a - * single request, the total request size should be no larger than 1MB. See - * ReportResponse.report_errors for partial failure behavior. - */ - operations: Schema$Operation[]; + * An individual log entry. + */ + export interface Schema$LogEntry { + /** + * A unique ID for the log entry used for deduplication. If omitted, the + * implementation will generate one based on operation_id. + */ + insertId: string; + /** + * A set of user-defined (key, value) data that provides additional + * information about the log entry. + */ + labels: any; + /** + * Required. The log to which this log entry belongs. Examples: + * `"syslog"`, `"book_log"`. + */ + name: string; + /** + * The log entry payload, represented as a protocol buffer that is expressed + * as a JSON object. The only accepted type currently is AuditLog. + */ + protoPayload: any; + /** + * The severity of the log entry. The default value is + * `LogSeverity.DEFAULT`. + */ + severity: string; + /** + * The log entry payload, represented as a structure that is expressed as a + * JSON object. + */ + structPayload: any; + /** + * The log entry payload, represented as a Unicode string (UTF-8). + */ + textPayload: string; + /** + * The time the event described by the log entry occurred. If omitted, + * defaults to operation start time. + */ + timestamp: string; + } /** - * Specifies which version of service config should be used to process the - * request. If unspecified or no matching version can be found, the latest - * one will be used. - */ - serviceConfigId: string; -} -/** - * Response message for the Report method. - */ -export interface Schema$ReportResponse { + * Represents a single metric value. + */ + export interface Schema$MetricValue { + /** + * A boolean value. + */ + boolValue: boolean; + /** + * A distribution value. + */ + distributionValue: Schema$Distribution; + /** + * A double precision floating point value. + */ + doubleValue: number; + /** + * The end of the time period over which this metric value's measurement + * applies. + */ + endTime: string; + /** + * A signed 64-bit integer value. + */ + int64Value: string; + /** + * The labels describing the metric value. See comments on + * google.api.servicecontrol.v1.Operation.labels for the overriding + * relationship. + */ + labels: any; + /** + * A money value. + */ + moneyValue: Schema$Money; + /** + * The start of the time period over which this metric value's + * measurement applies. The time period has different semantics for + * different metric types (cumulative, delta, and gauge). See the metric + * definition documentation in the service configuration for details. + */ + startTime: string; + /** + * A text string value. + */ + stringValue: string; + } /** - * Partial failures, one for each `Operation` in the request that failed - * processing. There are three possible combinations of the RPC status: 1. - * The combination of a successful RPC status and an empty `report_errors` - * list indicates a complete success where all `Operations` in the request - * are processed successfully. 2. The combination of a successful RPC status - * and a non-empty `report_errors` list indicates a partial success where - * some `Operations` in the request succeeded. Each `Operation` that - * failed processing has a corresponding item in this list. 3. A failed RPC - * status indicates a general non-deterministic failure. When this happens, - * it's impossible to know which of the 'Operations' in the - * request succeeded or failed. - */ - reportErrors: Schema$ReportError[]; + * Represents a set of metric values in the same metric. Each metric value in + * the set should have a unique combination of start time, end time, and label + * values. + */ + export interface Schema$MetricValueSet { + /** + * The metric name defined in the service configuration. + */ + metricName: string; + /** + * The values in this metric. + */ + metricValues: Schema$MetricValue[]; + } /** - * Quota usage for each quota release `Operation` request. Fully or partially - * failed quota release request may or may not be present in - * `report_quota_info`. For example, a failed quota release request will have - * the current quota usage info when precise quota library returns the info. A - * deadline exceeded quota request will not have quota usage info. If there - * is no quota release request, report_quota_info will be empty. - */ - reportInfos: Schema$ReportInfo[]; + * Represents an amount of money with its currency type. + */ + export interface Schema$Money { + /** + * The 3-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: string; + } /** - * The actual config id used to process the request. - */ - serviceConfigId: string; -} -/** - * Metadata about the request. - */ -export interface Schema$RequestMetadata { + * Represents information regarding an operation. + */ + export interface Schema$Operation { + /** + * Identity of the consumer who is using the service. This field should be + * filled in for the operations initiated by a consumer, but not for + * service-initiated operations that are not related to a specific consumer. + * This can be in one of the following formats: project:<project_id>, + * project_number:<project_number>, api_key:<api_key>. + */ + consumerId: string; + /** + * End time of the operation. Required when the operation is used in + * ServiceController.Report, but optional when the operation is used in + * ServiceController.Check. + */ + endTime: string; + /** + * DO NOT USE. This is an experimental field. + */ + importance: string; + /** + * Labels describing the operation. Only the following labels are allowed: + * - Labels describing monitored resources as defined in the service + * configuration. - Default labels of metric values. When specified, labels + * defined in the metric value override these default. - The following + * labels defined by Google Cloud Platform: - + * `cloud.googleapis.com/location` describing the location where the + * operation happened, - `servicecontrol.googleapis.com/user_agent` + * describing the user agent of the API request, - + * `servicecontrol.googleapis.com/service_agent` describing the service used + * to handle the API request (e.g. ESP), - + * `servicecontrol.googleapis.com/platform` describing the platform where + * the API is served, such as App Engine, Compute Engine, or Kubernetes + * Engine. + */ + labels: any; + /** + * Represents information to be logged. + */ + logEntries: Schema$LogEntry[]; + /** + * Represents information about this operation. Each MetricValueSet + * corresponds to a metric defined in the service configuration. The data + * type used in the MetricValueSet must agree with the data type specified + * in the metric definition. Within a single operation, it is not allowed + * to have more than one MetricValue instances that have the same metric + * names and identical label value combinations. If a request has such + * duplicated MetricValue instances, the entire request is rejected with an + * invalid argument error. + */ + metricValueSets: Schema$MetricValueSet[]; + /** + * Identity of the operation. This must be unique within the scope of the + * service that generated the operation. If the service calls Check() and + * Report() on the same operation, the two calls should carry the same id. + * UUID version 4 is recommended, though not required. In scenarios where an + * operation is computed from existing information and an idempotent id is + * desirable for deduplication purpose, UUID version 5 is recommended. See + * RFC 4122 for details. + */ + operationId: string; + /** + * Fully qualified name of the operation. Reserved for future use. + */ + operationName: string; + /** + * Represents the properties needed for quota check. Applicable only if this + * operation is for a quota check request. If this is not specified, no + * quota check will be performed. + */ + quotaProperties: Schema$QuotaProperties; + /** + * DO NOT USE. This field is deprecated, use "resources" field + * instead. The resource name of the parent of a resource in the resource + * hierarchy. This can be in one of the following formats: - + * “projects/<project-id or project-number>” - + * “folders/<folder-id>” - “organizations/<organization-id>” + */ + resourceContainer: string; + /** + * The resources that are involved in the operation. The maximum supported + * number of entries in this field is 100. + */ + resources: Schema$ResourceInfo[]; + /** + * Required. Start time of the operation. + */ + startTime: string; + /** + * User defined labels for the resource that this operation is associated + * with. Only a combination of 1000 user labels per consumer project are + * allowed. + */ + userLabels: any; + } /** - * The IP address of the caller. For caller from internet, this will be public - * IPv4 or IPv6 address. For caller from a Compute Engine VM with external IP - * address, this will be the VM's external IP address. For caller from a - * Compute Engine VM without external IP address, if the VM is in the same - * organization (or project) as the accessed resource, `caller_ip` will be the - * VM's internal IPv4 address, otherwise the `caller_ip` will be redacted - * to "gce-internal-ip". See - * https://cloud.google.com/compute/docs/vpc/ for more information. - */ - callerIp: string; + * Represents error information for QuotaOperation. + */ + export interface Schema$QuotaError { + /** + * Error code. + */ + code: string; + /** + * Free-form text that provides details on the cause of the error. + */ + description: string; + /** + * Subject to whom this error applies. See the specific enum for more + * details on this field. For example, "clientip:<ip address of + * client>" or "project:<Google developer project + * id>". + */ + subject: string; + } /** - * The network of the caller. Set only if the network host project is part of - * the same GCP organization (or project) as the accessed resource. See - * https://cloud.google.com/compute/docs/vpc/ for more information. This is a - * scheme-less URI full resource name. For example: - * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" - */ - callerNetwork: string; + * Contains the quota information for a quota check response. + */ + export interface Schema$QuotaInfo { + /** + * Quota Metrics that have exceeded quota limits. For QuotaGroup-based + * quota, this is QuotaGroup.name For QuotaLimit-based quota, this is + * QuotaLimit.name See: google.api.Quota Deprecated: Use quota_metrics to + * get per quota group limit exceeded status. + */ + limitExceeded: string[]; + /** + * Map of quota group name to the actual number of tokens consumed. If the + * quota check was not successful, then this will not be populated due to no + * quota consumption. We are not merging this field with + * 'quota_metrics' field because of the complexity of scaling in + * Chemist client code base. For simplicity, we will keep this field for + * Castor (that scales quota usage) and 'quota_metrics' for + * SuperQuota (that doesn't scale quota usage). + */ + quotaConsumed: any; + /** + * Quota metrics to indicate the usage. Depending on the check request, one + * or more of the following metrics will be included: 1. For rate quota, + * per quota group or per quota metric incremental usage will be specified + * using the following delta metric: + * "serviceruntime.googleapis.com/api/consumer/quota_used_count" + * 2. For allocation quota, per quota metric total usage will be specified + * using the following gauge metric: + * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" + * 3. For both rate quota and allocation quota, the quota limit reached + * condition will be specified using the following boolean metric: + * "serviceruntime.googleapis.com/quota/exceeded" + */ + quotaMetrics: Schema$MetricValueSet[]; + } /** - * The user agent of the caller. This information is not authenticated and - * should be treated accordingly. For example: + - * `google-api-python-client/1.4.0`: The request was made by the Google - * API client for Python. + `Cloud SDK Command Line Tool apitools-client/1.0 - * gcloud/0.9.62`: The request was made by the Google Cloud SDK CLI - * (gcloud). + `AppEngine-Google; (+http://code.google.com/appengine; appid: - * s~my-project`: The request was made from the `my-project` App Engine - * app. NOLINT - */ - callerSuppliedUserAgent: string; -} -/** - * Describes a resource associated with this operation. - */ -export interface Schema$ResourceInfo { + * Represents information regarding a quota operation. + */ + export interface Schema$QuotaOperation { + /** + * Identity of the consumer for whom this quota operation is being + * performed. This can be in one of the following formats: + * project:<project_id>, project_number:<project_number>, + * api_key:<api_key>. + */ + consumerId: string; + /** + * Labels describing the operation. + */ + labels: any; + /** + * Fully qualified name of the API method for which this quota operation is + * requested. This name is used for matching quota rules or metric rules and + * billing status rules defined in service configuration. This field should + * not be set if any of the following is true: (1) the quota operation is + * performed on non-API resources. (2) quota_metrics is set because the + * caller is doing quota override. Example of an RPC method name: + * google.example.library.v1.LibraryService.CreateShelf + */ + methodName: string; + /** + * Identity of the operation. This is expected to be unique within the scope + * of the service that generated the operation, and guarantees idempotency + * in case of retries. UUID version 4 is recommended, though not required. + * In scenarios where an operation is computed from existing information and + * an idempotent id is desirable for deduplication purpose, UUID version 5 + * is recommended. See RFC 4122 for details. + */ + operationId: string; + /** + * Represents information about this operation. Each MetricValueSet + * corresponds to a metric defined in the service configuration. The data + * type used in the MetricValueSet must agree with the data type specified + * in the metric definition. Within a single operation, it is not allowed + * to have more than one MetricValue instances that have the same metric + * names and identical label value combinations. If a request has such + * duplicated MetricValue instances, the entire request is rejected with an + * invalid argument error. This field is mutually exclusive with + * method_name. + */ + quotaMetrics: Schema$MetricValueSet[]; + /** + * Quota mode for this operation. + */ + quotaMode: string; + } /** - * The identifier of the parent of this resource instance. Must be in one of - * the following formats: - “projects/<project-id or - * project-number>” - “folders/<folder-id>” - - * “organizations/<organization-id>” + * Represents the properties needed for quota operations. */ - resourceContainer: string; + export interface Schema$QuotaProperties { + /** + * Quota mode for this operation. + */ + quotaMode: string; + } /** - * Name of the resource. This is used for auditing purposes. - */ - resourceName: string; -} -/** - * Request message for QuotaController.StartReconciliation. - */ -export interface Schema$StartReconciliationRequest { + * Request message for the ReleaseQuota method. + */ + export interface Schema$ReleaseQuotaRequest { + /** + * Operation that describes the quota release. + */ + releaseOperation: Schema$QuotaOperation; + /** + * Specifies which version of service configuration should be used to + * process the request. If unspecified or no matching version can be found, + * the latest one will be used. + */ + serviceConfigId: string; + } /** - * Operation that describes the quota reconciliation. - */ - reconciliationOperation: Schema$QuotaOperation; + * Response message for the ReleaseQuota method. + */ + export interface Schema$ReleaseQuotaResponse { + /** + * The same operation_id value used in the ReleaseQuotaRequest. Used for + * logging and diagnostics purposes. + */ + operationId: string; + /** + * Quota metrics to indicate the result of release. Depending on the + * request, one or more of the following metrics will be included: 1. For + * rate quota, per quota group or per quota metric released amount will be + * specified using the following delta metric: + * "serviceruntime.googleapis.com/api/consumer/quota_refund_count" + * 2. For allocation quota, per quota metric total usage will be specified + * using the following gauge metric: + * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" + * 3. For allocation quota, value for each quota limit associated with the + * metrics will be specified using the following gauge metric: + * "serviceruntime.googleapis.com/quota/limit" + */ + quotaMetrics: Schema$MetricValueSet[]; + /** + * Indicates the decision of the release. + */ + releaseErrors: Schema$QuotaError[]; + /** + * ID of the actual config used to process the request. + */ + serviceConfigId: string; + } /** - * Specifies which version of service configuration should be used to process - * the request. If unspecified or no matching version can be found, the latest - * one will be used. - */ - serviceConfigId: string; -} -/** - * Response message for QuotaController.StartReconciliation. - */ -export interface Schema$StartReconciliationResponse { + * Represents the processing error of one Operation in the request. + */ + export interface Schema$ReportError { + /** + * The Operation.operation_id value from the request. + */ + operationId: string; + /** + * Details of the error when processing the Operation. + */ + status: Schema$Status; + } /** - * The same operation_id value used in the StartReconciliationRequest. Used - * for logging and diagnostics purposes. - */ - operationId: string; + * Contains additional info about the report operation. + */ + export interface Schema$ReportInfo { + /** + * The Operation.operation_id value from the request. + */ + operationId: string; + /** + * Quota usage info when processing the `Operation`. + */ + quotaInfo: Schema$QuotaInfo; + } /** - * Metric values as tracked by One Platform before the start of - * reconciliation. The following metrics will be included: 1. Per quota - * metric total usage will be specified using the following gauge metric: - * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" - * 2. Value for each quota limit associated with the metrics will be specified - * using the following gauge metric: - * "serviceruntime.googleapis.com/quota/limit" - */ - quotaMetrics: Schema$MetricValueSet[]; + * Request message for the Report method. + */ + export interface Schema$ReportRequest { + /** + * Operations to be reported. Typically the service should report one + * operation per request. Putting multiple operations into a single request + * is allowed, but should be used only when multiple operations are natually + * available at the time of the report. If multiple operations are in a + * single request, the total request size should be no larger than 1MB. See + * ReportResponse.report_errors for partial failure behavior. + */ + operations: Schema$Operation[]; + /** + * Specifies which version of service config should be used to process the + * request. If unspecified or no matching version can be found, the latest + * one will be used. + */ + serviceConfigId: string; + } /** - * Indicates the decision of the reconciliation start. - */ - reconciliationErrors: Schema$QuotaError[]; + * Response message for the Report method. + */ + export interface Schema$ReportResponse { + /** + * Partial failures, one for each `Operation` in the request that failed + * processing. There are three possible combinations of the RPC status: 1. + * The combination of a successful RPC status and an empty `report_errors` + * list indicates a complete success where all `Operations` in the request + * are processed successfully. 2. The combination of a successful RPC status + * and a non-empty `report_errors` list indicates a partial success where + * some `Operations` in the request succeeded. Each `Operation` that + * failed processing has a corresponding item in this list. 3. A failed + * RPC status indicates a general non-deterministic failure. When this + * happens, it's impossible to know which of the 'Operations' + * in the request succeeded or failed. + */ + reportErrors: Schema$ReportError[]; + /** + * Quota usage for each quota release `Operation` request. Fully or + * partially failed quota release request may or may not be present in + * `report_quota_info`. For example, a failed quota release request will + * have the current quota usage info when precise quota library returns the + * info. A deadline exceeded quota request will not have quota usage info. + * If there is no quota release request, report_quota_info will be empty. + */ + reportInfos: Schema$ReportInfo[]; + /** + * The actual config id used to process the request. + */ + serviceConfigId: string; + } /** - * ID of the actual config used to process the request. - */ - serviceConfigId: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Metadata about the request. + */ + export interface Schema$RequestMetadata { + /** + * The IP address of the caller. For caller from internet, this will be + * public IPv4 or IPv6 address. For caller from a Compute Engine VM with + * external IP address, this will be the VM's external IP address. For + * caller from a Compute Engine VM without external IP address, if the VM is + * in the same organization (or project) as the accessed resource, + * `caller_ip` will be the VM's internal IPv4 address, otherwise the + * `caller_ip` will be redacted to "gce-internal-ip". See + * https://cloud.google.com/compute/docs/vpc/ for more information. + */ + callerIp: string; + /** + * The network of the caller. Set only if the network host project is part + * of the same GCP organization (or project) as the accessed resource. See + * https://cloud.google.com/compute/docs/vpc/ for more information. This is + * a scheme-less URI full resource name. For example: + * "//compute.googleapis.com/projects/PROJECT_ID/global/networks/NETWORK_ID" + */ + callerNetwork: string; + /** + * The user agent of the caller. This information is not authenticated and + * should be treated accordingly. For example: + + * `google-api-python-client/1.4.0`: The request was made by the Google + * API client for Python. + `Cloud SDK Command Line Tool + * apitools-client/1.0 gcloud/0.9.62`: The request was made by the + * Google Cloud SDK CLI (gcloud). + `AppEngine-Google; + * (+http://code.google.com/appengine; appid: s~my-project`: The request + * was made from the `my-project` App Engine app. NOLINT + */ + callerSuppliedUserAgent: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Describes a resource associated with this operation. + */ + export interface Schema$ResourceInfo { + /** + * The identifier of the parent of this resource instance. Must be in one of + * the following formats: - “projects/<project-id or + * project-number>” - “folders/<folder-id>” - + * “organizations/<organization-id>” + */ + resourceContainer: string; + /** + * Name of the resource. This is used for auditing purposes. + */ + resourceName: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Request message for QuotaController.StartReconciliation. + */ + export interface Schema$StartReconciliationRequest { + /** + * Operation that describes the quota reconciliation. + */ + reconciliationOperation: Schema$QuotaOperation; + /** + * Specifies which version of service configuration should be used to + * process the request. If unspecified or no matching version can be found, + * the latest one will be used. + */ + serviceConfigId: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Services { - root: Servicecontrol; - constructor(root: Servicecontrol) { - this.root = root; - this.getRoot.bind(this); + * Response message for QuotaController.StartReconciliation. + */ + export interface Schema$StartReconciliationResponse { + /** + * The same operation_id value used in the StartReconciliationRequest. Used + * for logging and diagnostics purposes. + */ + operationId: string; + /** + * Metric values as tracked by One Platform before the start of + * reconciliation. The following metrics will be included: 1. Per quota + * metric total usage will be specified using the following gauge metric: + * "serviceruntime.googleapis.com/allocation/consumer/quota_used_count" + * 2. Value for each quota limit associated with the metrics will be + * specified using the following gauge metric: + * "serviceruntime.googleapis.com/quota/limit" + */ + quotaMetrics: Schema$MetricValueSet[]; + /** + * Indicates the decision of the reconciliation start. + */ + reconciliationErrors: Schema$QuotaError[]; + /** + * ID of the actual config used to process the request. + */ + serviceConfigId: string; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * servicecontrol.services.allocateQuota - * @desc Attempts to allocate quota for the specified consumer. It should be - * called before the operation is executed. This method requires the - * `servicemanagement.services.quota` permission on the specified service. For - * more information, see [Cloud IAM](https://cloud.google.com/iam). **NOTE:** - * The client **must** fail-open on server errors `INTERNAL`, `UNKNOWN`, - * `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system reliability, the - * server may inject these errors to prohibit any hard dependency on the quota - * functionality. - * @alias servicecontrol.services.allocateQuota - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. - * @param {().AllocateQuotaRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - allocateQuota(params?: any, options?: MethodOptions): - AxiosPromise; - allocateQuota( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - allocateQuota( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Services { + root: Servicecontrol; + constructor(root: Servicecontrol) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:allocateQuota') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * servicecontrol.services.check - * @desc Checks whether an operation on a service should be allowed to proceed - * based on the configuration of the service and related policies. It must be - * called before the operation is executed. If feasible, the client should - * cache the check results and reuse them for 60 seconds. In case of any - * server errors, the client should rely on the cached results for much longer - * time to avoid outage. WARNING: There is general 60s delay for the - * configuration and policy propagation, therefore callers MUST NOT depend on - * the `Check` method having the latest policy information. NOTE: the - * CheckRequest has the size limit of 64KB. This method requires the - * `servicemanagement.services.check` permission on the specified service. For - * more information, see [Cloud IAM](https://cloud.google.com/iam). - * @alias servicecontrol.services.check - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The service name as specified in its service configuration. For example, `"pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name. - * @param {().CheckRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - check(params?: any, options?: MethodOptions): - AxiosPromise; - check( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - check( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * servicecontrol.services.allocateQuota + * @desc Attempts to allocate quota for the specified consumer. It should be + * called before the operation is executed. This method requires the + * `servicemanagement.services.quota` permission on the specified service. + * For more information, see [Cloud IAM](https://cloud.google.com/iam). + * **NOTE:** The client **must** fail-open on server errors `INTERNAL`, + * `UNKNOWN`, `DEADLINE_EXCEEDED`, and `UNAVAILABLE`. To ensure system + * reliability, the server may inject these errors to prohibit any hard + * dependency on the quota functionality. + * @alias servicecontrol.services.allocateQuota + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. + * @param {().AllocateQuotaRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + allocateQuota(params?: any, options?: MethodOptions): + AxiosPromise; + allocateQuota( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + allocateQuota( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:allocateQuota') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:check') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * servicecontrol.services.endReconciliation - * @desc Signals the quota controller that service ends the ongoing usage - * reconciliation. This method requires the - * `servicemanagement.services.quota` permission on the specified service. For - * more information, see [Google Cloud IAM](https://cloud.google.com/iam). - * @alias servicecontrol.services.endReconciliation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. - * @param {().EndReconciliationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - endReconciliation(params?: any, options?: MethodOptions): - AxiosPromise; - endReconciliation( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - endReconciliation( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * servicecontrol.services.check + * @desc Checks whether an operation on a service should be allowed to + * proceed based on the configuration of the service and related policies. + * It must be called before the operation is executed. If feasible, the + * client should cache the check results and reuse them for 60 seconds. In + * case of any server errors, the client should rely on the cached results + * for much longer time to avoid outage. WARNING: There is general 60s delay + * for the configuration and policy propagation, therefore callers MUST NOT + * depend on the `Check` method having the latest policy information. NOTE: + * the CheckRequest has the size limit of 64KB. This method requires the + * `servicemanagement.services.check` permission on the specified service. + * For more information, see [Cloud IAM](https://cloud.google.com/iam). + * @alias servicecontrol.services.check + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The service name as specified in its service configuration. For example, `"pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name. + * @param {().CheckRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + check(params?: any, options?: MethodOptions): + AxiosPromise; + check( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + check( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:check') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:endReconciliation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * servicecontrol.services.releaseQuota - * @desc Releases previously allocated quota done through AllocateQuota - * method. This method requires the `servicemanagement.services.quota` - * permission on the specified service. For more information, see [Cloud - * IAM](https://cloud.google.com/iam). **NOTE:** The client **must** - * fail-open on server errors `INTERNAL`, `UNKNOWN`, `DEADLINE_EXCEEDED`, and - * `UNAVAILABLE`. To ensure system reliability, the server may inject these - * errors to prohibit any hard dependency on the quota functionality. - * @alias servicecontrol.services.releaseQuota - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. - * @param {().ReleaseQuotaRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - releaseQuota(params?: any, options?: MethodOptions): - AxiosPromise; - releaseQuota( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - releaseQuota( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:releaseQuota') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * servicecontrol.services.endReconciliation + * @desc Signals the quota controller that service ends the ongoing usage + * reconciliation. This method requires the + * `servicemanagement.services.quota` permission on the specified service. + * For more information, see [Google Cloud + * IAM](https://cloud.google.com/iam). + * @alias servicecontrol.services.endReconciliation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. + * @param {().EndReconciliationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + endReconciliation(params?: any, options?: MethodOptions): + AxiosPromise; + endReconciliation( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + endReconciliation( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:endReconciliation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * servicecontrol.services.report - * @desc Reports operation results to Google Service Control, such as logs and - * metrics. It should be called after an operation is completed. If feasible, - * the client should aggregate reporting data for up to 5 seconds to reduce - * API traffic. Limiting aggregation to 5 seconds is to reduce data loss - * during client crashes. Clients should carefully choose the aggregation time - * window to avoid data loss risk more than 0.01% for business and compliance - * reasons. NOTE: the ReportRequest has the size limit of 1MB. This method - * requires the `servicemanagement.services.report` permission on the - * specified service. For more information, see [Google Cloud - * IAM](https://cloud.google.com/iam). - * @alias servicecontrol.services.report - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The service name as specified in its service configuration. For example, `"pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name. - * @param {().ReportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - report(params?: any, options?: MethodOptions): - AxiosPromise; - report( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - report( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * servicecontrol.services.releaseQuota + * @desc Releases previously allocated quota done through AllocateQuota + * method. This method requires the `servicemanagement.services.quota` + * permission on the specified service. For more information, see [Cloud + * IAM](https://cloud.google.com/iam). **NOTE:** The client **must** + * fail-open on server errors `INTERNAL`, `UNKNOWN`, `DEADLINE_EXCEEDED`, + * and `UNAVAILABLE`. To ensure system reliability, the server may inject + * these errors to prohibit any hard dependency on the quota functionality. + * @alias servicecontrol.services.releaseQuota + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. + * @param {().ReleaseQuotaRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + releaseQuota(params?: any, options?: MethodOptions): + AxiosPromise; + releaseQuota( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + releaseQuota( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:releaseQuota') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:report') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * servicecontrol.services.startReconciliation - * @desc Unlike rate quota, allocation quota does not get refilled - * periodically. So, it is possible that the quota usage as seen by the - * service differs from what the One Platform considers the usage is. This is - * expected to happen only rarely, but over time this can accumulate. Services - * can invoke StartReconciliation and EndReconciliation to correct this usage - * drift, as described below: 1. Service sends StartReconciliation with a - * timestamp in future for each metric that needs to be reconciled. The - * timestamp being in future allows to account for in-flight AllocateQuota - * and ReleaseQuota requests for the same metric. 2. One Platform records - * this timestamp and starts tracking subsequent AllocateQuota and - * ReleaseQuota requests until EndReconciliation is called. 3. At or after - * the time specified in the StartReconciliation, service sends - * EndReconciliation with the usage that needs to be reconciled to. 4. One - * Platform adjusts its own record of usage for that metric to the value - * specified in EndReconciliation by taking in to account any allocation or - * release between StartReconciliation and EndReconciliation. Signals the - * quota controller that the service wants to perform a usage reconciliation - * as specified in the request. This method requires the - * `servicemanagement.services.quota` permission on the specified service. For - * more information, see [Google Cloud IAM](https://cloud.google.com/iam). - * @alias servicecontrol.services.startReconciliation - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. - * @param {().StartReconciliationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startReconciliation(params?: any, options?: MethodOptions): - AxiosPromise; - startReconciliation( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - startReconciliation( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * servicecontrol.services.report + * @desc Reports operation results to Google Service Control, such as logs + * and metrics. It should be called after an operation is completed. If + * feasible, the client should aggregate reporting data for up to 5 seconds + * to reduce API traffic. Limiting aggregation to 5 seconds is to reduce + * data loss during client crashes. Clients should carefully choose the + * aggregation time window to avoid data loss risk more than 0.01% for + * business and compliance reasons. NOTE: the ReportRequest has the size + * limit of 1MB. This method requires the + * `servicemanagement.services.report` permission on the specified service. + * For more information, see [Google Cloud + * IAM](https://cloud.google.com/iam). + * @alias servicecontrol.services.report + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The service name as specified in its service configuration. For example, `"pubsub.googleapis.com"`. See [google.api.Service](https://cloud.google.com/service-management/reference/rpc/google.api#google.api.Service) for the definition of a service name. + * @param {().ReportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + report(params?: any, options?: MethodOptions): + AxiosPromise; + report( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + report( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:report') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://servicecontrol.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:startReconciliation') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * servicecontrol.services.startReconciliation + * @desc Unlike rate quota, allocation quota does not get refilled + * periodically. So, it is possible that the quota usage as seen by the + * service differs from what the One Platform considers the usage is. This + * is expected to happen only rarely, but over time this can accumulate. + * Services can invoke StartReconciliation and EndReconciliation to correct + * this usage drift, as described below: 1. Service sends + * StartReconciliation with a timestamp in future for each metric that + * needs to be reconciled. The timestamp being in future allows to + * account for in-flight AllocateQuota and ReleaseQuota requests for the + * same metric. 2. One Platform records this timestamp and starts tracking + * subsequent AllocateQuota and ReleaseQuota requests until + * EndReconciliation is called. 3. At or after the time specified in the + * StartReconciliation, service sends EndReconciliation with the usage + * that needs to be reconciled to. 4. One Platform adjusts its own record of + * usage for that metric to the value specified in EndReconciliation by + * taking in to account any allocation or release between + * StartReconciliation and EndReconciliation. Signals the quota controller + * that the service wants to perform a usage reconciliation as specified in + * the request. This method requires the `servicemanagement.services.quota` + * permission on the specified service. For more information, see [Google + * Cloud IAM](https://cloud.google.com/iam). + * @alias servicecontrol.services.startReconciliation + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service as specified in the service configuration. For example, `"pubsub.googleapis.com"`. See google.api.Service for the definition of a service name. + * @param {().StartReconciliationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startReconciliation(params?: any, options?: MethodOptions): + AxiosPromise; + startReconciliation( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + startReconciliation( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicecontrol.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:startReconciliation') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/servicemanagement/v1.ts b/src/apis/servicemanagement/v1.ts index dae9ff7978b..c617ab7e2df 100644 --- a/src/apis/servicemanagement/v1.ts +++ b/src/apis/servicemanagement/v1.ts @@ -27,3946 +27,4003 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Service Management API - * - * Google Service Management allows service producers to publish their services - * on Google Cloud Platform so that they can be discovered and used by service - * consumers. - * - * @example - * const google = require('googleapis'); - * const servicemanagement = google.servicemanagement('v1'); - * - * @namespace servicemanagement - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Servicemanagement - */ -export class Servicemanagement { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace servicemanagement_v1 { + /** + * Service Management API + * + * Google Service Management allows service producers to publish their + * services on Google Cloud Platform so that they can be discovered and used + * by service consumers. + * + * @example + * const google = require('googleapis'); + * const servicemanagement = google.servicemanagement('v1'); + * + * @namespace servicemanagement + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Servicemanagement + */ + export class Servicemanagement { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - services: Resource$Services; + operations: Resource$Operations; + services: Resource$Services; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.services = new Resource$Services(this); - } + this.operations = new Resource$Operations(this); + this.services = new Resource$Services(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Generated advice about this change, used for providing more information about - * how a change will affect the existing service. - */ -export interface Schema$Advice { /** - * Useful description for why this advice was applied and what actions should - * be taken to mitigate any implied risks. + * Generated advice about this change, used for providing more information + * about how a change will affect the existing service. */ - description: string; -} -/** - * Api is a light-weight descriptor for an API Interface. Interfaces are also - * described as "protocol buffer services" in some contexts, such as - * by the "service" keyword in a .proto file, but they are different - * from API Services, which represent a concrete implementation of an interface - * as opposed to simply a description of methods and bindings. They are also - * sometimes simply referred to as "APIs" in other contexts, such as - * the name of this message itself. See - * https://cloud.google.com/apis/design/glossary for detailed terminology. - */ -export interface Schema$Api { + export interface Schema$Advice { + /** + * Useful description for why this advice was applied and what actions + * should be taken to mitigate any implied risks. + */ + description: string; + } /** - * The methods of this interface, in unspecified order. - */ - methods: Schema$Method[]; + * Api is a light-weight descriptor for an API Interface. Interfaces are also + * described as "protocol buffer services" in some contexts, such as + * by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an + * interface as opposed to simply a description of methods and bindings. They + * are also sometimes simply referred to as "APIs" in other + * contexts, such as the name of this message itself. See + * https://cloud.google.com/apis/design/glossary for detailed terminology. + */ + export interface Schema$Api { + /** + * The methods of this interface, in unspecified order. + */ + methods: Schema$Method[]; + /** + * Included interfaces. See Mixin. + */ + mixins: Schema$Mixin[]; + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + */ + name: string; + /** + * Any metadata attached to the interface. + */ + options: Schema$Option[]; + /** + * Source context for the protocol buffer service represented by this + * message. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax of the service. + */ + syntax: string; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to + * be consistent with what is provided here. The versioning schema uses + * [semantic versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users what to + * expect from different versions, and should be carefully chosen based on + * the product plan. The major version is also reflected in the package + * name of the interface, which must end in `v<major-version>`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can be + * omitted. Zero major versions must only be used for experimental, non-GA + * interfaces. + */ + version: string; + } /** - * Included interfaces. See Mixin. - */ - mixins: Schema$Mixin[]; + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. + */ + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * The fully qualified name of this interface, including package name followed - * by the interface's simple name. - */ - name: string; + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. + */ + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Any metadata attached to the interface. - */ - options: Schema$Option[]; + * `Authentication` defines the authentication configuration for an API. + * Example for an API targeted for external use: name: + * calendar.googleapis.com authentication: providers: - id: + * google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Authentication { + /** + * Defines a set of authentication providers that a service supports. + */ + providers: Schema$AuthProvider[]; + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$AuthenticationRule[]; + } /** - * Source context for the protocol buffer service represented by this message. - */ - sourceContext: Schema$SourceContext; + * Authentication rules for the service. By default, if a method has any + * authentication requirements, every request must include a valid credential + * matching one of the requirements. It's an error to include more than + * one kind of credential in a single request. If a method doesn't have + * any auth requirements, request credentials will be ignored. + */ + export interface Schema$AuthenticationRule { + /** + * If true, the service accepts API keys without any other credential. + */ + allowWithoutCredential: boolean; + /** + * Configuration for custom authentication. + */ + customAuth: Schema$CustomAuthRequirements; + /** + * The requirements for OAuth credentials. + */ + oauth: Schema$OAuthRequirements; + /** + * Requirements for additional authentication providers. + */ + requirements: Schema$AuthRequirement[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The source syntax of the service. - */ - syntax: string; + * Configuration of authorization. This section determines the authorization + * provider, if unspecified, then no authorization check will be done. + * Example: experimental: authorization: provider: + * firebaserules.googleapis.com + */ + export interface Schema$AuthorizationConfig { + /** + * The name of the authorization provider, such as + * firebaserules.googleapis.com. + */ + provider: string; + } /** - * A version string for this interface. If specified, must have the form - * `major-version.minor-version`, as in `1.10`. If the minor version is - * omitted, it defaults to zero. If the entire version field is empty, the - * major version is derived from the package name, as outlined below. If the - * field is not empty, the version in the package name will be verified to be - * consistent with what is provided here. The versioning schema uses - * [semantic versioning](http://semver.org) where the major version number - * indicates a breaking change and the minor version an additive, non-breaking - * change. Both version numbers are signals to users what to expect from - * different versions, and should be carefully chosen based on the product - * plan. The major version is also reflected in the package name of the - * interface, which must end in `v<major-version>`, as in - * `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. - * Zero major versions must only be used for experimental, non-GA interfaces. - */ - version: string; -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { + * Configuration for an anthentication provider, including support for [JSON + * Web Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthProvider { + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * Redirect URL if JWT token is required but no present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + */ + authorizationUrl: string; + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. Example: "bookstore_auth". + */ + id: string; + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. Example: + * https://securetoken.google.com Example: + * 1234567-compute@developer.gserviceaccount.com + */ + issuer: string; + /** + * URL of the provider's public key set to validate signature of the + * JWT. See [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: - can be retrieved from [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of + * the issuer. - can be inferred from the email domain of the issuer (e.g. + * a Google service account). Example: + * https://www.googleapis.com/oauth2/v1/certs + */ + jwksUri: string; + } /** - * The configuration for logging of each type of permission. - */ - auditLogConfigs: Schema$AuditLogConfig[]; + * User-defined authentication requirements, including support for [JSON Web + * Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthRequirement { + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * id from authentication provider. Example: provider_id: + * bookstore_auth + */ + providerId: string; + } /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. + * `Backend` defines the backend configuration for a service. */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { + export interface Schema$Backend { + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$BackendRule[]; + } /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; + * A backend rule provides configuration for an individual API element. + */ + export interface Schema$BackendRule { + /** + * The address of the API backend. + */ + address: string; + /** + * The number of seconds to wait for a response from a request. The default + * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 + * seconds. + */ + deadline: number; + /** + * Minimum deadline in seconds needed for this method. Calls having deadline + * value lower than this will be rejected. + */ + minDeadline: number; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The log type that this config enables. - */ - logType: string; -} -/** - * `Authentication` defines the authentication configuration for an API. Example - * for an API targeted for external use: name: calendar.googleapis.com - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Authentication { + * Billing related configuration of the service. The following example shows + * how to configure monitored resources and metrics for billing: + * monitored_resources: - type: library.googleapis.com/branch labels: - + * key: /city description: The city where the library branch is + * located in. - key: /name description: The name of the branch. + * metrics: - name: library.googleapis.com/book/borrowed_count + * metric_kind: DELTA value_type: INT64 billing: + * consumer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/borrowed_count + */ + export interface Schema$Billing { + /** + * Billing configurations for sending metrics to the consumer project. There + * can be multiple consumer destinations per service, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$BillingDestination[]; + } /** - * Defines a set of authentication providers that a service supports. - */ - providers: Schema$AuthProvider[]; + * Configuration of a specific billing destination (Currently only support + * bill against consumer project). + */ + export interface Schema$BillingDestination { + /** + * Names of the metrics to report to this billing destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * A list of authentication rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$AuthenticationRule[]; -} -/** - * Authentication rules for the service. By default, if a method has any - * authentication requirements, every request must include a valid credential - * matching one of the requirements. It's an error to include more than one - * kind of credential in a single request. If a method doesn't have any - * auth requirements, request credentials will be ignored. - */ -export interface Schema$AuthenticationRule { + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` . + * * `serviceAccount:{emailid}`: An email address that represents a service + * account. For example, `my-other-app@appspot.gserviceaccount.com`. * + * `group:{emailid}`: An email address that represents a Google group. For + * example, `admins@example.com`. * `domain:{domain}`: A Google Apps + * domain name that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * If true, the service accepts API keys without any other credential. - */ - allowWithoutCredential: boolean; + * Change report associated with a particular service configuration. It + * contains a list of ConfigChanges based on the comparison between two + * service configurations. + */ + export interface Schema$ChangeReport { + /** + * List of changes between two service configurations. The changes will be + * alphabetically sorted based on the identifier of each change. A + * ConfigChange identifier is a dot separated path to the configuration. + * Example: + * visibility.rules[selector='LibraryService.CreateBook'].restriction + */ + configChanges: Schema$ConfigChange[]; + } /** - * Configuration for custom authentication. - */ - customAuth: Schema$CustomAuthRequirements; + * Output generated from semantically comparing two versions of a service + * configuration. Includes detailed information about a field that have + * changed with applicable advice about potential consequences for the change, + * such as backwards-incompatibility. + */ + export interface Schema$ConfigChange { + /** + * Collection of advice provided for this change, useful for determining the + * possible impact of this change. + */ + advices: Schema$Advice[]; + /** + * The type for this change, either ADDED, REMOVED, or MODIFIED. + */ + changeType: string; + /** + * Object hierarchy path to the change, with levels separated by a + * '.' character. For repeated fields, an applicable unique + * identifier field is used for the index (usually selector, name, or id). + * For maps, the term 'key' is used. If the field has no unique + * identifier, the numeric index is used. Examples: - + * visibility.rules[selector=="google.LibraryService.CreateBook"].restriction + * - + * quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value + * - logging.producer_destinations[0] + */ + element: string; + /** + * Value of the changed object in the new Service configuration, in JSON + * format. This field will not be populated if ChangeType == REMOVED. + */ + newValue: string; + /** + * Value of the changed object in the old Service configuration, in JSON + * format. This field will not be populated if ChangeType == ADDED. + */ + oldValue: string; + } /** - * The requirements for OAuth credentials. - */ - oauth: Schema$OAuthRequirements; + * Generic specification of a source configuration file + */ + export interface Schema$ConfigFile { + /** + * The bytes that constitute the file. + */ + fileContents: string; + /** + * The file name of the configuration file (full or relative path). + */ + filePath: string; + /** + * The type of configuration file this represents. + */ + fileType: string; + } /** - * Requirements for additional authentication providers. + * Represents a service configuration with its name and id. */ - requirements: Schema$AuthRequirement[]; + export interface Schema$ConfigRef { + /** + * Resource name of a service config. It must have the following format: + * "services/{service name}/configs/{config id}". + */ + name: string; + } /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration of authorization. This section determines the authorization - * provider, if unspecified, then no authorization check will be done. Example: - * experimental: authorization: provider: - * firebaserules.googleapis.com - */ -export interface Schema$AuthorizationConfig { + * Represents a source file which is used to generate the service + * configuration defined by `google.api.Service`. + */ + export interface Schema$ConfigSource { + /** + * Set of source configuration files that are used to generate a service + * configuration (`google.api.Service`). + */ + files: Schema$ConfigFile[]; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. If empty, the server may choose to + * generate one instead. + */ + id: string; + } /** - * The name of the authorization provider, such as - * firebaserules.googleapis.com. - */ - provider: string; -} -/** - * Configuration for an anthentication provider, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthProvider { + * `Context` defines which contexts an API requests. Example: context: + * rules: - selector: "*" requested: - + * google.rpc.context.ProjectContext - + * google.rpc.context.OriginContext The above specifies that all methods in + * the API request `google.rpc.context.ProjectContext` and + * `google.rpc.context.OriginContext`. Available context types are defined in + * package `google.rpc.context`. This also provides mechanism to whitelist + * any protobuf message extension that can be sent in grpc metadata using + * “x-goog-ext-<extension_id>-bin” and + * “x-goog-ext-<extension_id>-jspb” format. For example, list any + * service specific protobuf types that can appear in grpc metadata as follows + * in your yaml file: Example: context: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allowed_request_extensions: - google.foo.v1.NewExtension + * allowed_response_extensions: - google.foo.v1.NewExtension You can + * also specify extension ID instead of fully qualified extension name here. + */ + export interface Schema$Context { + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$ContextRule[]; + } /** - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; + * A context rule provides information about the context for an individual API + * element. + */ + export interface Schema$ContextRule { + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + */ + allowedRequestExtensions: string[]; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + */ + allowedResponseExtensions: string[]; + /** + * A list of full type names of provided contexts. + */ + provided: string[]; + /** + * A list of full type names of requested contexts. + */ + requested: string[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Redirect URL if JWT token is required but no present or is expired. - * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + * Selects and configures the service controller used by the service. The + * service controller handles features like abuse, quota, billing, logging, + * monitoring, etc. */ - authorizationUrl: string; + export interface Schema$Control { + /** + * The service control environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. + */ + environment: string; + } /** - * The unique identifier of the auth provider. It will be referred to by - * `AuthRequirement.provider_id`. Example: "bookstore_auth". + * Configuration for a custom authentication provider. */ - id: string; + export interface Schema$CustomAuthRequirements { + /** + * A configuration string containing connection information for the + * authentication provider, typically formatted as a SmartService string + * (go/smartservice). + */ + provider: string; + } /** - * Identifies the principal that issued the JWT. See - * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - * Usually a URL or an email address. Example: https://securetoken.google.com - * Example: 1234567-compute@developer.gserviceaccount.com - */ - issuer: string; + * Customize service error responses. For example, list any service specific + * protobuf types that can appear in error detail lists of error responses. + * Example: custom_error: types: - google.foo.v1.CustomError + * - google.foo.v1.AnotherError + */ + export interface Schema$CustomError { + /** + * The list of custom error rules that apply to individual API messages. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$CustomErrorRule[]; + /** + * The list of custom error detail types, e.g. + * 'google.foo.v1.CustomError'. + */ + types: string[]; + } /** - * URL of the provider's public key set to validate signature of the JWT. - * See [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - * Optional if the key set document: - can be retrieved from [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of - * the issuer. - can be inferred from the email domain of the issuer (e.g. a - * Google service account). Example: - * https://www.googleapis.com/oauth2/v1/certs - */ - jwksUri: string; -} -/** - * User-defined authentication requirements, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthRequirement { + * A custom error rule. + */ + export interface Schema$CustomErrorRule { + /** + * Mark this message as possible payload in error response. Otherwise, + * objects of this type will be filtered when they appear in error payload. + */ + isErrorType: boolean; + /** + * Selects messages to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * NOTE: This will be deprecated soon, once AuthProvider.audiences is - * implemented and accepted in all the runtime components. The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; + * A custom pattern is used for defining custom HTTP verb. + */ + export interface Schema$CustomHttpPattern { + /** + * The name of this custom HTTP verb. + */ + kind: string; + /** + * The path matched by this custom verb. + */ + path: string; + } /** - * id from authentication provider. Example: provider_id: bookstore_auth - */ - providerId: string; -} -/** - * `Backend` defines the backend configuration for a service. - */ -export interface Schema$Backend { + * Strategy used to delete a service. This strategy is a placeholder only used + * by the system generated rollout to delete a service. + */ + export interface Schema$DeleteServiceStrategy {} + /** + * Represents a diagnostic message (error or warning) + */ + export interface Schema$Diagnostic { + /** + * The kind of diagnostic information provided. + */ + kind: string; + /** + * File name and line number of the error or warning. + */ + location: string; + /** + * Message describing the error or warning. + */ + message: string; + } /** - * A list of API backend rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. + * Request message for DisableService method. */ - rules: Schema$BackendRule[]; -} -/** - * A backend rule provides configuration for an individual API element. - */ -export interface Schema$BackendRule { + export interface Schema$DisableServiceRequest { + /** + * The identity of consumer resource which service disablement will be + * applied to. The Google Service Management implementation accepts the + * following forms: - "project:<project_id>" Note: this is + * made compatible with google.api.servicecontrol.v1.Operation.consumer_id. + */ + consumerId: string; + } /** - * The address of the API backend. - */ - address: string; + * `Documentation` provides the information for describing a service. Example: + * <pre><code>documentation: summary: > The Google + * Calendar API gives access to most calendar features. pages: - name: + * Overview content: &#40;== include google/foo/overview.md + * ==&#41; - name: Tutorial content: &#40;== include + * google/foo/tutorial.md ==&#41; subpages; - name: Java content: + * &#40;== include google/foo/tutorial_java.md ==&#41; rules: - + * selector: google.calendar.Calendar.Get description: > ... - + * selector: google.calendar.Calendar.Put description: > ... + * </code></pre> Documentation is provided in markdown syntax. In + * addition to standard markdown features, definition lists, tables and fenced + * code blocks are supported. Section headers can be provided and are + * interpreted relative to the section nesting of the context where a + * documentation fragment is embedded. Documentation from the IDL is merged + * with documentation defined via the config at normalization time, where + * documentation provided by config rules overrides IDL provided. A number of + * constructs specific to the API platform are supported in documentation + * text. In order to reference a proto element, the following notation can be + * used: + * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> + * To override the display text used for the link, this can be used: + * <pre><code>&#91;display + * text]&#91;fully.qualified.proto.name]</code></pre> Text can + * be excluded from doc using the following notation: + * <pre><code>&#40;-- internal comment + * --&#41;</code></pre> A few directives are available in + * documentation. Note that directives must appear on a single line to be + * properly identified. The `include` directive includes a markdown file from + * an external source: <pre><code>&#40;== include path/to/file + * ==&#41;</code></pre> The `resource_for` directive marks a + * message to be the resource of a collection in REST view. If it is not + * specified, tools attempt to infer the resource from the operations in a + * collection: <pre><code>&#40;== resource_for + * v1.shelves.books ==&#41;</code></pre> The directive + * `suppress_warning` does not directly affect documentation and is documented + * together with service config validation. + */ + export interface Schema$Documentation { + /** + * The URL to the root of documentation. + */ + documentationRootUrl: string; + /** + * Declares a single overview page. For example: + * <pre><code>documentation: summary: ... overview: + * &#40;== include overview.md ==&#41; </code></pre> + * This is a shortcut for the following declaration (using pages style): + * <pre><code>documentation: summary: ... pages: - name: + * Overview content: &#40;== include overview.md ==&#41; + * </code></pre> Note: you cannot specify both `overview` field + * and `pages` field. + */ + overview: string; + /** + * The top level pages for the documentation set. + */ + pages: Schema$Page[]; + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$DocumentationRule[]; + /** + * A short summary of what the service does. Can only be provided by plain + * text. + */ + summary: string; + } /** - * The number of seconds to wait for a response from a request. The default - * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds. - */ - deadline: number; + * A documentation rule provides information about individual API elements. + */ + export interface Schema$DocumentationRule { + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + */ + deprecationDescription: string; + /** + * Description of the selected API(s). + */ + description: string; + /** + * The selector is a comma-separated list of patterns. Each pattern is a + * qualified name of the element which may end in "*", indicating + * a wildcard. Wildcards are only allowed at the end and for a whole + * component of the qualified name, i.e. "foo.*" is ok, but not + * "foo.b*" or "foo.*.bar". To specify a default for all + * applicable elements, the whole pattern "*" is used. + */ + selector: string; + } /** - * Minimum deadline in seconds needed for this method. Calls having deadline - * value lower than this will be rejected. + * Request message for EnableService method. */ - minDeadline: number; + export interface Schema$EnableServiceRequest { + /** + * The identity of consumer resource which service enablement will be + * applied to. The Google Service Management implementation accepts the + * following forms: - "project:<project_id>" Note: this is + * made compatible with google.api.servicecontrol.v1.Operation.consumer_id. + */ + consumerId: string; + } /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Billing related configuration of the service. The following example shows - * how to configure monitored resources and metrics for billing: - * monitored_resources: - type: library.googleapis.com/branch labels: - * - key: /city description: The city where the library branch is - * located in. - key: /name description: The name of the branch. - * metrics: - name: library.googleapis.com/book/borrowed_count metric_kind: - * DELTA value_type: INT64 billing: consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/borrowed_count - */ -export interface Schema$Billing { + * `Endpoint` describes a network endpoint that serves a set of APIs. A + * service may expose any number of endpoints, and all endpoints share the + * same service configuration, such as quota configuration and monitoring + * configuration. Example service configuration: name: + * library-example.googleapis.com endpoints: # Below entry makes + * 'google.example.library.v1.Library' # API be served from + * endpoint address library-example.googleapis.com. # It also allows + * HTTP OPTIONS calls to be passed to the backend, for # it to decide + * whether the subsequent cross-origin request is # allowed to proceed. + * - name: library-example.googleapis.com allow_cors: true + */ + export interface Schema$Endpoint { + /** + * DEPRECATED: This field is no longer supported. Instead of using aliases, + * please specify multiple google.api.Endpoint for each of the intended + * aliases. Additional names that this endpoint will be hosted on. + */ + aliases: string[]; + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint + * to receive and respond to HTTP OPTIONS requests. The response will be + * used by the browser to determine whether the subsequent cross-origin + * request is allowed to proceed. + */ + allowCors: boolean; + /** + * The list of features enabled on this endpoint. + */ + features: string[]; + /** + * The canonical name of this endpoint. + */ + name: string; + /** + * The specification of an Internet routable address of API frontend that + * will handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For + * example, "8.8.8.8" or "myservice.appspot.com". + */ + target: string; + } /** - * Billing configurations for sending metrics to the consumer project. There - * can be multiple consumer destinations per service, each one must have a - * different monitored resource type. A metric can be used in at most one - * consumer destination. - */ - consumerDestinations: Schema$BillingDestination[]; -} -/** - * Configuration of a specific billing destination (Currently only support bill - * against consumer project). - */ -export interface Schema$BillingDestination { + * Enum type definition. + */ + export interface Schema$Enum { + /** + * Enum value definitions. + */ + enumvalue: Schema$EnumValue[]; + /** + * Enum type name. + */ + name: string; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * Names of the metrics to report to this billing destination. Each name must - * be defined in Service.metrics section. - */ - metrics: string[]; + * Enum value definition. + */ + export interface Schema$EnumValue { + /** + * Enum value name. + */ + name: string; + /** + * Enum value number. + */ + number: number; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + } /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. + * Experimental service configuration. These configuration options can only be + * used by whitelisted users. */ - monitoredResource: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Change report associated with a particular service configuration. It - * contains a list of ConfigChanges based on the comparison between two service - * configurations. - */ -export interface Schema$ChangeReport { + export interface Schema$Experimental { + /** + * Authorization configuration. + */ + authorization: Schema$AuthorizationConfig; + } /** - * List of changes between two service configurations. The changes will be - * alphabetically sorted based on the identifier of each change. A - * ConfigChange identifier is a dot separated path to the configuration. - * Example: - * visibility.rules[selector='LibraryService.CreateBook'].restriction - */ - configChanges: Schema$ConfigChange[]; -} -/** - * Output generated from semantically comparing two versions of a service - * configuration. Includes detailed information about a field that have changed - * with applicable advice about potential consequences for the change, such as - * backwards-incompatibility. - */ -export interface Schema$ConfigChange { + * A single field of a message type. + */ + export interface Schema$Field { + /** + * The field cardinality. + */ + cardinality: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + */ + defaultValue: string; + /** + * The field JSON name. + */ + jsonName: string; + /** + * The field type. + */ + kind: string; + /** + * The field name. + */ + name: string; + /** + * The field number. + */ + number: number; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the + * list. + */ + oneofIndex: number; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * Whether to use alternative packed wire representation. + */ + packed: boolean; + /** + * The field type URL, without the scheme, for message or enumeration types. + * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + */ + typeUrl: string; + } /** - * Collection of advice provided for this change, useful for determining the - * possible impact of this change. - */ - advices: Schema$Advice[]; + * Request message for GenerateConfigReport method. + */ + export interface Schema$GenerateConfigReportRequest { + /** + * Service configuration for which we want to generate the report. For this + * version of API, the supported types are + * google.api.servicemanagement.v1.ConfigRef, + * google.api.servicemanagement.v1.ConfigSource, and google.api.Service + */ + newConfig: any; + /** + * Service configuration against which the comparison will be done. For this + * version of API, the supported types are + * google.api.servicemanagement.v1.ConfigRef, + * google.api.servicemanagement.v1.ConfigSource, and google.api.Service + */ + oldConfig: any; + } /** - * The type for this change, either ADDED, REMOVED, or MODIFIED. - */ - changeType: string; + * Response message for GenerateConfigReport method. + */ + export interface Schema$GenerateConfigReportResponse { + /** + * list of ChangeReport, each corresponding to comparison between two + * service configurations. + */ + changeReports: Schema$ChangeReport[]; + /** + * Errors / Linter warnings associated with the service definition this + * report belongs to. + */ + diagnostics: Schema$Diagnostic[]; + /** + * ID of the service configuration this report belongs to. + */ + id: string; + /** + * Name of the service this report belongs to. + */ + serviceName: string; + } /** - * Object hierarchy path to the change, with levels separated by a '.' - * character. For repeated fields, an applicable unique identifier field is - * used for the index (usually selector, name, or id). For maps, the term - * 'key' is used. If the field has no unique identifier, the numeric - * index is used. Examples: - - * visibility.rules[selector=="google.LibraryService.CreateBook"].restriction - * - - * quota.metric_rules[selector=="google"].metric_costs[key=="reads"].value - * - logging.producer_destinations[0] - */ - element: string; + * Request message for `GetIamPolicy` method. + */ + export interface Schema$GetIamPolicyRequest {} + /** + * Defines the HTTP configuration for an API service. It contains a list of + * HttpRule, each specifying the mapping of an RPC method to one or more HTTP + * REST API methods. + */ + export interface Schema$Http { + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where + * "%2F" will be left encoded. The default behavior is to not + * decode RFC 6570 reserved characters in multi segment matches. + */ + fullyDecodeReservedExpansion: boolean; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$HttpRule[]; + } /** - * Value of the changed object in the new Service configuration, in JSON - * format. This field will not be populated if ChangeType == REMOVED. - */ - newValue: string; + * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST + * API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and HTTP + * request body. The mapping is typically specified as an `google.api.http` + * annotation on the RPC method, see "google/api/annotations.proto" + * for details. The mapping consists of a field specifying the path template + * and method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET operation on a + * resource collection of messages: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http).get = + * "/v1/messages/{message_id}/{sub.subfield}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL SubMessage sub = + * 2; // `sub.subfield` is url-mapped } message Message { string + * text = 1; // content of the resource } The same http annotation can + * alternatively be expressed inside the `GRPC API Configuration` YAML file. + * http: rules: - selector: + * <proto_package_name>.Messaging.GetMessage get: + * /v1/messages/{message_id}/{sub.subfield} This definition enables an + * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC + * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: + * "123456" sub: SubMessage(subfield: "foo"))` In + * general, not only fields but also field paths can be referenced from a path + * pattern. Fields mapped to the path pattern cannot be repeated and must have + * a primitive (non-message) type. Any fields in the request message which + * are not bound by the path pattern automatically become (optional) HTTP + * query parameters. Assume the following definition of the request message: + * service Messaging { rpc GetMessage(GetMessageRequest) returns + * (Message) { option (google.api.http).get = + * "/v1/messages/{message_id}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL int64 revision = + * 2; // becomes a parameter SubMessage sub = 3; // `sub.subfield` + * becomes a parameter } This enables a HTTP JSON to RPC mapping as + * below: HTTP | RPC -----|----- `GET + * /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` Note that fields which are mapped + * to HTTP parameters must have a primitive type or a repeated primitive type. + * Message types are not allowed. In the case of a repeated type, the + * parameter can be repeated in the URL, as in `...?param=A&param=B`. For + * HTTP method kinds which allow a request body, the `body` field specifies + * the mapping. Consider a REST update method on the message resource + * collection: service Messaging { rpc + * UpdateMessage(UpdateMessageRequest) returns (Message) { option + * (google.api.http) = { put: "/v1/messages/{message_id}" + * body: "message" }; } } message + * UpdateMessageRequest { string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body } The following HTTP + * JSON to RPC mapping is enabled, where the representation of the JSON in the + * request body is determined by protos JSON encoding: HTTP | RPC -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | + * `UpdateMessage(message_id: "123456" message { text: + * "Hi!" })` The special name `*` can be used in the body mapping + * to define that every field not bound by the path template should be mapped + * to the request body. This enables the following alternative definition of + * the update method: service Messaging { rpc + * UpdateMessage(Message) returns (Message) { option (google.api.http) + * = { put: "/v1/messages/{message_id}" body: + * "*" }; } } message Message { string + * message_id = 1; string text = 2; } The following HTTP JSON to + * RPC mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { + * "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` Note that when using `*` in the + * body mapping, it is not possible to have HTTP parameters, as all fields not + * bound by the path end in the body. This makes this option more rarely used + * in practice of defining REST APIs. The common usage of `*` is in custom + * methods which don't use the URL at all for transferring data. It is + * possible to define multiple HTTP methods for one RPC by using the + * `additional_bindings` option. Example: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http) = { get: "/v1/messages/{message_id}" + * additional_bindings { get: + * "/v1/users/{user_id}/messages/{message_id}" } }; } } + * message GetMessageRequest { string message_id = 1; string + * user_id = 2; } This enables the following two alternative HTTP JSON + * to RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | + * `GetMessage(message_id: "123456")` `GET + * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" + * message_id: "123456")` # Rules for HTTP mapping The rules for + * mapping HTTP path, query parameters, and body fields to the request message + * are as follows: 1. The `body` field specifies either `*` or a field path, + * or is omitted. If omitted, it indicates there is no HTTP request + * body. 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: (a) Matched in the URL + * template. (b) Covered by body (if body is `*`, everything except (a) + * fields; else everything under the body field) (c) All other + * fields. 3. URL query parameters found in the HTTP request are mapped to (c) + * fields. 4. Any body sent with an HTTP request can contain only (b) fields. + * The syntax of the path template is as follows: Template = + * "/" Segments [ Verb ] ; Segments = Segment { "/" + * Segment } ; Segment = "*" | "**" | LITERAL | + * Variable ; Variable = "{" FieldPath [ "=" Segments + * ] "}" ; FieldPath = IDENT { "." IDENT } ; Verb + * = ":" LITERAL ; The syntax `*` matches a single path segment. + * The syntax `**` matches zero or more path segments, which must be the last + * part of the path except the `Verb`. The syntax `LITERAL` matches literal + * text in the path. The syntax `Variable` matches part of the URL path as + * specified by its template. A variable template must not contain other + * variables. If a variable matches a single path segment, its template may be + * omitted, e.g. `{var}` is equivalent to `{var=*}`. If a variable contains + * exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{var}`. If a variable contains one + * or more path segments, such as `"{var=foo/*}"` or + * `"{var=**}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such + * variables show up in the Discovery Document as `{+var}`. NOTE: While the + * single segment variable matches the semantics of [RFC + * 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** match RFC 6570 Reserved + * Expansion. The reason is that the Reserved Expansion does not expand + * special characters like `?` and `#`, which would lead to invalid URLs. + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ + export interface Schema$HttpRule { + /** + * Additional HTTP bindings for the selector. Nested bindings must not + * contain an `additional_bindings` field themselves (that is, the nesting + * may only be one level deep). + */ + additionalBindings: Schema$HttpRule[]; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave + * the HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: Schema$CustomHttpPattern; + /** + * Used for deleting a resource. + */ + delete: string; + /** + * Used for listing and getting information about resources. + */ + get: string; + /** + * Use this only for Scotty Requests. Do not use this for bytestream + * methods. For media support, add instead + * [][google.bytestream.RestByteStream] as an API to your configuration. + */ + mediaDownload: Schema$MediaDownload; + /** + * Use this only for Scotty Requests. Do not use this for media support + * using Bytestream, add instead [][google.bytestream.RestByteStream] as an + * API to your configuration for Bytestream methods. + */ + mediaUpload: Schema$MediaUpload; + /** + * Used for updating a resource. + */ + patch: string; + /** + * Used for creating a resource. + */ + post: string; + /** + * Used for updating a resource. + */ + put: string; + /** + * Selects methods to which this rule applies. Refer to selector for syntax + * details. + */ + selector: string; + } /** - * Value of the changed object in the old Service configuration, in JSON - * format. This field will not be populated if ChangeType == ADDED. - */ - oldValue: string; -} -/** - * Generic specification of a source configuration file - */ -export interface Schema$ConfigFile { + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; + } /** - * The bytes that constitute the file. - */ - fileContents: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * The file name of the configuration file (full or relative path). - */ - filePath: string; + * Response message for ListServiceConfigs method. + */ + export interface Schema$ListServiceConfigsResponse { + /** + * The token of the next page of results. + */ + nextPageToken: string; + /** + * The list of service configuration resources. + */ + serviceConfigs: Schema$Service[]; + } /** - * The type of configuration file this represents. - */ - fileType: string; -} -/** - * Represents a service configuration with its name and id. - */ -export interface Schema$ConfigRef { + * Response message for ListServiceRollouts method. + */ + export interface Schema$ListServiceRolloutsResponse { + /** + * The token of the next page of results. + */ + nextPageToken: string; + /** + * The list of rollout resources. + */ + rollouts: Schema$Rollout[]; + } /** - * Resource name of a service config. It must have the following format: - * "services/{service name}/configs/{config id}". - */ - name: string; -} -/** - * Represents a source file which is used to generate the service configuration - * defined by `google.api.Service`. - */ -export interface Schema$ConfigSource { + * Response message for `ListServices` method. + */ + export interface Schema$ListServicesResponse { + /** + * Token that can be passed to `ListServices` to resume a paginated query. + */ + nextPageToken: string; + /** + * The returned services will only have the name field set. + */ + services: Schema$ManagedService[]; + } /** - * Set of source configuration files that are used to generate a service - * configuration (`google.api.Service`). - */ - files: Schema$ConfigFile[]; + * A description of a log type. Example in YAML format: - name: + * library.googleapis.com/activity_history description: The history of + * borrowing and returning library items. display_name: Activity labels: + * - key: /customer_id description: Identifier of a library customer + */ + export interface Schema$LogDescriptor { + /** + * A human-readable description of this log. This information appears in the + * documentation and can contain details. + */ + description: string; + /** + * The human-readable name for this log. This information appears on the + * user interface and should be concise. + */ + displayName: string; + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are considered + * invalid. + */ + labels: Schema$LabelDescriptor[]; + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including slash, + * underscore, hyphen, period [/_-.]. + */ + name: string; + } /** - * A unique ID for a specific instance of this message, typically assigned by - * the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ - id: string; -} -/** - * `Context` defines which contexts an API requests. Example: context: - * rules: - selector: "*" requested: - - * google.rpc.context.ProjectContext - google.rpc.context.OriginContext - * The above specifies that all methods in the API request - * `google.rpc.context.ProjectContext` and `google.rpc.context.OriginContext`. - * Available context types are defined in package `google.rpc.context`. This - * also provides mechanism to whitelist any protobuf message extension that can - * be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and - * “x-goog-ext-<extension_id>-jspb” format. For example, list any service - * specific protobuf types that can appear in grpc metadata as follows in your - * yaml file: Example: context: rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allowed_request_extensions: - google.foo.v1.NewExtension - * allowed_response_extensions: - google.foo.v1.NewExtension You can - * also specify extension ID instead of fully qualified extension name here. - */ -export interface Schema$Context { + * Logging configuration of the service. The following example shows how to + * configure logs to be sent to the producer and consumer projects. In the + * example, the `activity_history` log is sent to both the producer and + * consumer projects, whereas the `purchase_history` log is only sent to the + * producer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. logs: - name: activity_history + * labels: - key: /customer_id - name: purchase_history logging: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history - + * purchase_history consumer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history + */ + export interface Schema$Logging { + /** + * Logging configurations for sending logs to the consumer project. There + * can be multiple consumer destinations, each one must have a different + * monitored resource type. A log can be used in at most one consumer + * destination. + */ + consumerDestinations: Schema$LoggingDestination[]; + /** + * Logging configurations for sending logs to the producer project. There + * can be multiple producer destinations, each one must have a different + * monitored resource type. A log can be used in at most one producer + * destination. + */ + producerDestinations: Schema$LoggingDestination[]; + } /** - * A list of RPC context rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$ContextRule[]; -} -/** - * A context rule provides information about the context for an individual API - * element. - */ -export interface Schema$ContextRule { + * Configuration of a specific logging destination (the producer project or + * the consumer project). + */ + export interface Schema$LoggingDestination { + /** + * Names of the logs to be sent to this destination. Each name must be + * defined in the Service.logs section. If the log name is not a domain + * scoped name, it will be automatically prefixed with the service name + * followed by "/". + */ + logs: string[]; + /** + * The monitored resource type. The type must be defined in the + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from client to backend. - */ - allowedRequestExtensions: string[]; + * The full representation of a Service that is managed by Google Service + * Management. + */ + export interface Schema$ManagedService { + /** + * ID of the project that produces and owns this service. + */ + producerProjectId: string; + /** + * The name of the service. See the [overview](/service-management/overview) + * for naming requirements. + */ + serviceName: string; + } /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from backend to client. + * Defines the Media configuration for a service in case of a download. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - allowedResponseExtensions: string[]; + export interface Schema$MediaDownload { + /** + * A boolean that determines whether a notification for the completion of a + * download should be sent to the backend. + */ + completeNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the download service if one is used for download. + */ + downloadService: string; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether download is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for direct download. The size is + * specified in bytes. + */ + maxDirectDownloadSize: string; + /** + * A boolean that determines if direct download from ESF should be used for + * download of this media. + */ + useDirectDownload: boolean; + } /** - * A list of full type names of provided contexts. + * Defines the Media configuration for a service in case of an upload. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - provided: string[]; + export interface Schema$MediaUpload { + /** + * A boolean that determines whether a notification for the completion of an + * upload should be sent to the backend. These notifications will not be + * seen by the client and will not consume quota. + */ + completeNotification: boolean; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether upload is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for an upload. The size is specified in + * bytes. + */ + maxSize: string; + /** + * An array of mimetype patterns. Esf will only accept uploads that match + * one of the given patterns. + */ + mimeTypes: string[]; + /** + * Whether to receive a notification for progress changes of media upload. + */ + progressNotification: boolean; + /** + * Whether to receive a notification on the start of media upload. + */ + startNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the upload service if one is used for upload. + */ + uploadService: string; + } /** - * A list of full type names of requested contexts. - */ - requested: string[]; + * Method represents a method of an API interface. + */ + export interface Schema$Method { + /** + * The simple name of this method. + */ + name: string; + /** + * Any metadata attached to the method. + */ + options: Schema$Option[]; + /** + * If true, the request is streamed. + */ + requestStreaming: boolean; + /** + * A URL of the input message type. + */ + requestTypeUrl: string; + /** + * If true, the response is streamed. + */ + responseStreaming: boolean; + /** + * The URL of the output message type. + */ + responseTypeUrl: string; + /** + * The source syntax of this method. + */ + syntax: string; + } /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Selects and configures the service controller used by the service. The - * service controller handles features like abuse, quota, billing, logging, - * monitoring, etc. - */ -export interface Schema$Control { + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric type has + * a label for the HTTP response code, `response_code`, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be + * supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * `custom.googleapis.com`. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported + * units are a subset of [The Unified Code for Units of + * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units + * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute + * * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo + * (10**3) * `M` mega (10**6) * `G` giga (10**9) * `T` tera + * (10**12) * `P` peta (10**15) * `E` exa (10**18) * `Z` + * zetta (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * + * `u` micro (10**-6) * `n` nano (10**-9) * `p` pico + * (10**-12) * `f` femto (10**-15) * `a` atto (10**-18) * `z` + * zepto (10**-21) * `y` yocto (10**-24) * `Ki` kibi (2**10) * + * `Mi` mebi (2**20) * `Gi` gibi (2**30) * `Ti` tebi (2**40) + * **Grammar** The grammar also includes these connectors: * `/` division + * (as an infix operator, e.g. `1/s`). * `.` multiplication (as an infix + * operator, e.g. `GBy.d`) The grammar for a unit is as follows: Expression + * = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | + * Annotation | "1" ; Annotation + * = "{" NAME "}" ; Notes: * `Annotation` is just a + * comment if it follows a `UNIT` and is equivalent to `1` if it is used + * alone. For examples, `{requests}/s == 1/s`, `By{transmitted}/s == + * By/s`. * `NAME` is a sequence of non-blank printable ASCII characters not + * containing '{' or '}'. * `1` represents dimensionless + * value 1, such as in `1/s`. * `%` represents dimensionless value 1/100, + * and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of `metric_kind` and `value_type` might not be supported. + */ + valueType: string; + } /** - * The service control environment to use. If empty, no control plane feature - * (like quota and billing) will be enabled. - */ - environment: string; -} -/** - * Configuration for a custom authentication provider. - */ -export interface Schema$CustomAuthRequirements { + * Bind API methods to metrics. Binding a method to a metric causes that + * metric's configured quota behaviors to apply to the method call. + */ + export interface Schema$MetricRule { + /** + * Metrics to update when the selected methods are called, and the + * associated cost applied to each metric. The key of the map is the metric + * name, and the values are the amount increased for the metric against + * which the quota limits are defined. The value must not be negative. + */ + metricCosts: any; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * A configuration string containing connection information for the - * authentication provider, typically formatted as a SmartService string - * (go/smartservice). - */ - provider: string; -} -/** - * Customize service error responses. For example, list any service specific - * protobuf types that can appear in error detail lists of error responses. - * Example: custom_error: types: - google.foo.v1.CustomError - - * google.foo.v1.AnotherError - */ -export interface Schema$CustomError { + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: - If after comment and + * whitespace stripping, the documentation string of the redeclared method + * is empty, it will be inherited from the original method. - Each + * annotation belonging to the service config (http, visibility) which is + * not set in the redeclared method will be inherited. - If an http + * annotation is inherited, the path pattern will be modified as follows. + * Any version prefix will be replaced by the version of the including + * interface plus the root path if specified. Example of a simple mixin: + * package google.acl.v1; service AccessControl { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; } } + * package google.storage.v2; service Storage { // rpc + * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc + * GetData(GetDataRequest) returns (Data) { option + * (google.api.http).get = "/v2/{resource=**}"; } } + * Example of a mixin configuration: apis: - name: + * google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl The mixin construct implies that all methods + * in `AccessControl` are also declared with same name and request/response + * types in `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting documentation and + * annotations as follows: service Storage { // Get the underlying + * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option + * (google.api.http).get = "/v2/{resource=**}:getAcl"; } ... + * } Note how the version in the path pattern changed from `v1` to `v2`. If + * the `root` field in the mixin is specified, it should be a relative path + * under which inherited HTTP paths are placed. Example: apis: - + * name: google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl root: acls This implies the following + * inherited HTTP annotation: service Storage { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } ... } + */ + export interface Schema$Mixin { + /** + * The fully qualified name of the interface which is included. + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths are + * rooted. + */ + root: string; + } /** - * The list of custom error rules that apply to individual API messages. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$CustomErrorRule[]; + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * `"gce_instance"` and specifies the use of the labels + * `"instance_id"` and `"zone"` to identify particular VM + * instances. Different APIs can support different monitored resource types. + * APIs generally provide a `list` method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, `"Google + * Cloud SQL Database"`. + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and + * `"zone"`. + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` + * where {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; + } /** - * The list of custom error detail types, e.g. - * 'google.foo.v1.CustomError'. - */ - types: string[]; -} -/** - * A custom error rule. - */ -export interface Schema$CustomErrorRule { + * Monitoring configuration of the service. The example below shows how to + * configure monitored resources and metrics for monitoring. In the example, a + * monitored resource and two metrics are defined. The + * `library.googleapis.com/book/returned_count` metric is sent to both + * producer and consumer projects, whereas the + * `library.googleapis.com/book/overdue_count` metric is only sent to the + * consumer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. metrics: - name: + * library.googleapis.com/book/returned_count metric_kind: DELTA + * value_type: INT64 labels: - key: /customer_id - name: + * library.googleapis.com/book/overdue_count metric_kind: GAUGE + * value_type: INT64 labels: - key: /customer_id monitoring: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count consumer_destinations: - + * monitored_resource: library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count - + * library.googleapis.com/book/overdue_count + */ + export interface Schema$Monitoring { + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$MonitoringDestination[]; + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * producer destination. + */ + producerDestinations: Schema$MonitoringDestination[]; + } /** - * Mark this message as possible payload in error response. Otherwise, - * objects of this type will be filtered when they appear in error payload. - */ - isErrorType: boolean; + * Configuration of a specific monitoring destination (the producer project or + * the consumer project). + */ + export interface Schema$MonitoringDestination { + /** + * Names of the metrics to report to this monitoring destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Selects messages to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A custom pattern is used for defining custom HTTP verb. - */ -export interface Schema$CustomHttpPattern { + * OAuth scopes are a way to define data and permissions on data. For example, + * there are scopes defined for "Read-only access to Google + * Calendar" and "Access to Cloud Platform". Users can consent + * to a scope for an application, giving it permission to access that data on + * their behalf. OAuth scope specifications should be fairly coarse grained; + * a user will need to see and understand the text description of what your + * scope means. In most cases: use one or at most two OAuth scopes for an + * entire family of products. If your product has multiple APIs, you should + * probably be sharing the OAuth scope across all of those APIs. When you + * need finer grained OAuth consent screens: talk with your product management + * about how developers will use them in practice. Please note that even + * though each of the canonical scopes is enough for a request to be accepted + * and passed to the backend, a request can still fail due to the backend + * requiring additional scopes or permissions. + */ + export interface Schema$OAuthRequirements { + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + */ + canonicalScopes: string; + } /** - * The name of this custom HTTP verb. - */ - kind: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The path matched by this custom verb. - */ - path: string; -} -/** - * Strategy used to delete a service. This strategy is a placeholder only used - * by the system generated rollout to delete a service. - */ -export interface Schema$DeleteServiceStrategy {} -/** - * Represents a diagnostic message (error or warning) - */ -export interface Schema$Diagnostic { + * The metadata associated with a long running operation resource. + */ + export interface Schema$OperationMetadata { + /** + * Percentage of completion of this operation, ranging from 0 to 100. + */ + progressPercentage: number; + /** + * The full name of the resources that this operation is directly associated + * with. + */ + resourceNames: string[]; + /** + * The start time of the operation. + */ + startTime: string; + /** + * Detailed status information for each step. The order is undetermined. + */ + steps: Schema$Step[]; + } /** - * The kind of diagnostic information provided. - */ - kind: string; + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + */ + export interface Schema$Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, + * `"map_entry"`. For custom options, it should be the + * fully-qualified name. For example, `"google.api.http"`. + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a + * primitive, the corresponding wrapper type defined in + * google/protobuf/wrappers.proto should be used. If the value is an enum, + * it should be stored as an int32 value using the + * google.protobuf.Int32Value type. + */ + value: any; + } /** - * File name and line number of the error or warning. - */ - location: string; + * Represents a documentation page. A page can contain subpages to represent + * nested documentation set structure. + */ + export interface Schema$Page { + /** + * The Markdown content of the page. You can use <code>&#40;== + * include {path} ==&#41;</code> to include content from a + * Markdown file. + */ + content: string; + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: <pre><code>pages: - name: + * Tutorial content: &#40;== include tutorial.md ==&#41; subpages: + * - name: Java content: &#40;== include tutorial_java.md + * ==&#41; </code></pre> You can reference `Java` page using + * Markdown reference link syntax: `Java`. + */ + name: string; + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + */ + subpages: Schema$Page[]; + } /** - * Message describing the error or warning. - */ - message: string; -} -/** - * Request message for DisableService method. - */ -export interface Schema$DisableServiceRequest { + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **JSON Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { + * "role": "roles/viewer", "members": + * ["user:sean@example.com"] } ] } **YAML + * Example** bindings: - members: - user:mike@example.com - + * group:admins@example.com - domain:google.com - + * serviceAccount:my-other-app@appspot.gserviceaccount.com role: + * roles/owner - members: - user:sean@example.com role: + * roles/viewer For a description of IAM and its features, see the [IAM + * developer's guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * The identity of consumer resource which service disablement will be applied - * to. The Google Service Management implementation accepts the following - * forms: - "project:<project_id>" Note: this is made - * compatible with google.api.servicecontrol.v1.Operation.consumer_id. - */ - consumerId: string; -} -/** - * `Documentation` provides the information for describing a service. Example: - * <pre><code>documentation: summary: > The Google Calendar - * API gives access to most calendar features. pages: - name: Overview - * content: &#40;== include google/foo/overview.md ==&#41; - name: - * Tutorial content: &#40;== include google/foo/tutorial.md ==&#41; - * subpages; - name: Java content: &#40;== include - * google/foo/tutorial_java.md ==&#41; rules: - selector: - * google.calendar.Calendar.Get description: > ... - selector: - * google.calendar.Calendar.Put description: > ... - * </code></pre> Documentation is provided in markdown syntax. In - * addition to standard markdown features, definition lists, tables and fenced - * code blocks are supported. Section headers can be provided and are - * interpreted relative to the section nesting of the context where a - * documentation fragment is embedded. Documentation from the IDL is merged - * with documentation defined via the config at normalization time, where - * documentation provided by config rules overrides IDL provided. A number of - * constructs specific to the API platform are supported in documentation text. - * In order to reference a proto element, the following notation can be used: - * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> - * To override the display text used for the link, this can be used: - * <pre><code>&#91;display - * text]&#91;fully.qualified.proto.name]</code></pre> Text can - * be excluded from doc using the following notation: - * <pre><code>&#40;-- internal comment - * --&#41;</code></pre> A few directives are available in - * documentation. Note that directives must appear on a single line to be - * properly identified. The `include` directive includes a markdown file from an - * external source: <pre><code>&#40;== include path/to/file - * ==&#41;</code></pre> The `resource_for` directive marks a - * message to be the resource of a collection in REST view. If it is not - * specified, tools attempt to infer the resource from the operations in a - * collection: <pre><code>&#40;== resource_for v1.shelves.books - * ==&#41;</code></pre> The directive `suppress_warning` does - * not directly affect documentation and is documented together with service - * config validation. - */ -export interface Schema$Documentation { + * Quota configuration helps to achieve fairness and budgeting in service + * usage. The quota configuration works this way: - The service configuration + * defines a set of metrics. - For API calls, the quota.metric_rules maps + * methods to metrics with corresponding costs. - The quota.limits defines + * limits on the metrics, which will be used for quota checks at runtime. An + * example quota configuration in yaml format: quota: - name: + * apiWriteQpsPerProject metric: library.googleapis.com/write_calls + * unit: "1/min/{project}" # rate limit for consumer projects + * values: STANDARD: 10000 # The metric rules bind all methods + * to the read_calls metric, # except for the UpdateBook and DeleteBook + * methods. These two methods # are mapped to the write_calls metric, + * with the UpdateBook method # consuming at twice rate as the DeleteBook + * method. metric_rules: - selector: "*" metric_costs: + * library.googleapis.com/read_calls: 1 - selector: + * google.example.library.v1.LibraryService.UpdateBook metric_costs: + * library.googleapis.com/write_calls: 2 - selector: + * google.example.library.v1.LibraryService.DeleteBook metric_costs: + * library.googleapis.com/write_calls: 1 Corresponding Metric definition: + * metrics: - name: library.googleapis.com/read_calls display_name: Read + * requests metric_kind: DELTA value_type: INT64 - name: + * library.googleapis.com/write_calls display_name: Write requests + * metric_kind: DELTA value_type: INT64 + */ + export interface Schema$Quota { + /** + * List of `QuotaLimit` definitions for the service. + */ + limits: Schema$QuotaLimit[]; + /** + * List of `MetricRule` definitions, each one mapping a selected method to + * one or more metrics. + */ + metricRules: Schema$MetricRule[]; + } /** - * The URL to the root of documentation. - */ - documentationRootUrl: string; + * `QuotaLimit` defines a specific limit that applies over a specified + * duration for a limit type. There can be at most one limit for a duration + * and limit type combination defined within a `QuotaGroup`. + */ + export interface Schema$QuotaLimit { + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client application + * developer activates the service for his/her project. Specifying a value + * of 0 will block all requests. This can be used if you are provisioning + * quota to selected consumers and blocking others. Similarly, a value of -1 + * will indicate an unlimited quota. No other negative values are allowed. + * Used by group-based quotas only. + */ + defaultLimit: string; + /** + * Optional. User-visible, extended description for this quota limit. Should + * be used only when more context is needed to understand this limit than + * provided by the limit's display name (see: `display_name`). + */ + description: string; + /** + * User-visible display name for this limit. Optional. If not set, the UI + * will provide a default display name based on the quota configuration. + * This field can be used to override the default display name generated + * from the configuration. + */ + displayName: string; + /** + * Duration of this limit in textual notation. Example: "100s", + * "24h", "1d". For duration longer than a day, only + * multiple of days is supported. We support only "100s" and + * "1d" for now. Additional support will be added in the future. + * "0" indicates indefinite duration. Used by group-based quotas + * only. + */ + duration: string; + /** + * Free tier value displayed in the Developers Console for this limit. The + * free tier is the number of tokens that will be subtracted from the billed + * amount when billing is enabled. This field can only be set on a limit + * with duration "1d", in a billable group; it is invalid on any + * other limit. If this field is not set, it defaults to 0, indicating that + * there is no free tier for this service. Used by group-based quotas only. + */ + freeTier: string; + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. Used by group-based quotas only. + */ + maxLimit: string; + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must + * be defined within the service config. + */ + metric: string; + /** + * Name of the quota limit. The name must be provided, and it must be + * unique within the service. The name can only include alphanumeric + * characters as well as '-'. The maximum length of the limit name + * is 64 characters. + */ + name: string; + /** + * Specify the unit of the quota limit. It uses the same syntax as + * Metric.unit. The supported unit kinds are determined by the quota backend + * system. Here are some examples: * "1/min/{project}" for quota + * per minute per project. Note: the order of unit components is + * insignificant. The "1" at the beginning is required to follow + * the metric unit syntax. + */ + unit: string; + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + */ + values: any; + } /** - * Declares a single overview page. For example: - * <pre><code>documentation: summary: ... overview: - * &#40;== include overview.md ==&#41; </code></pre> This - * is a shortcut for the following declaration (using pages style): - * <pre><code>documentation: summary: ... pages: - name: - * Overview content: &#40;== include overview.md ==&#41; - * </code></pre> Note: you cannot specify both `overview` field - * and `pages` field. - */ - overview: string; + * A rollout resource that defines how service configuration versions are + * pushed to control plane systems. Typically, you create a new version of the + * service config, and then create a Rollout to push the service config. + */ + export interface Schema$Rollout { + /** + * The user who created the Rollout. Readonly. + */ + createdBy: string; + /** + * Creation time of the rollout. Readonly. + */ + createTime: string; + /** + * The strategy associated with a rollout to delete a `ManagedService`. + * Readonly. + */ + deleteServiceStrategy: Schema$DeleteServiceStrategy; + /** + * Optional unique identifier of this Rollout. Only lower case letters, + * digits and '-' are allowed. If not specified by client, the + * server will generate one. The generated id will have the form of + * <date><revision number>, where "date" is the create + * date in ISO 8601 format. "revision number" is a monotonically + * increasing positive number that is reset every day for each service. An + * example of the generated rollout_id is '2016-02-16r1' + */ + rolloutId: string; + /** + * The name of the service associated with this Rollout. + */ + serviceName: string; + /** + * The status of this rollout. Readonly. In case of a failed rollout, the + * system will automatically rollback to the current Rollout version. + * Readonly. + */ + status: string; + /** + * Google Service Control selects service configurations based on traffic + * percentage. + */ + trafficPercentStrategy: Schema$TrafficPercentStrategy; + } /** - * The top level pages for the documentation set. - */ - pages: Schema$Page[]; + * `Service` is the root object of Google service configuration schema. It + * describes basic information about a service, such as the name and the + * title, and delegates other aspects to sub-sections. Each sub-section is + * either a proto message or a repeated proto message that configures a + * specific aspect, such as auth. See each proto message definition for + * details. Example: type: google.api.Service config_version: 3 + * name: calendar.googleapis.com title: Google Calendar API apis: - + * name: google.calendar.v3.Calendar authentication: providers: - + * id: google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Service { + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the google.protobuf.Api needs to be provided by the configuration + * author, as the remaining fields will be derived from the IDL during the + * normalization process. It is an error to specify an API interface here + * which cannot be resolved against the associated IDL files. + */ + apis: Schema$Api[]; + /** + * Auth configuration. + */ + authentication: Schema$Authentication; + /** + * API backend configuration. + */ + backend: Schema$Backend; + /** + * Billing configuration. + */ + billing: Schema$Billing; + /** + * The semantic version of the service configuration. The config version + * affects the interpretation of the service configuration. For example, + * certain features are enabled by default for certain config versions. The + * latest config version is `3`. + */ + configVersion: number; + /** + * Context configuration. + */ + context: Schema$Context; + /** + * Configuration for the service control plane. + */ + control: Schema$Control; + /** + * Custom error configuration. + */ + customError: Schema$CustomError; + /** + * Additional API documentation. + */ + documentation: Schema$Documentation; + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service + * all defined APIs. + */ + endpoints: Schema$Endpoint[]; + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name. Example: enums: - name: google.someapi.v1.SomeEnum + */ + enums: Schema$Enum[]; + /** + * Experimental configuration. + */ + experimental: Schema$Experimental; + /** + * HTTP configuration. + */ + http: Schema$Http; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. If empty, the server may choose to + * generate one instead. + */ + id: string; + /** + * Logging configuration. + */ + logging: Schema$Logging; + /** + * Defines the logs used by this service. + */ + logs: Schema$LogDescriptor[]; + /** + * Defines the metrics used by this service. + */ + metrics: Schema$MetricDescriptor[]; + /** + * Defines the monitored resources used by this service. This is required by + * the Service.monitoring and Service.logging configurations. + */ + monitoredResources: Schema$MonitoredResourceDescriptor[]; + /** + * Monitoring configuration. + */ + monitoring: Schema$Monitoring; + /** + * The DNS address at which this service is available, e.g. + * `calendar.googleapis.com`. + */ + name: string; + /** + * The Google project that owns this service. + */ + producerProjectId: string; + /** + * Quota configuration. + */ + quota: Schema$Quota; + /** + * Output only. The source information for this configuration if available. + */ + sourceInfo: Schema$SourceInfo; + /** + * System parameter configuration. + */ + systemParameters: Schema$SystemParameters; + /** + * A list of all proto message types included in this API service. It serves + * similar purpose as [google.api.Service.types], except that these types + * are not needed by user-defined APIs. Therefore, they will not show up in + * the generated discovery doc. This field should only be used to define + * system APIs in ESF. + */ + systemTypes: Schema$Type[]; + /** + * The product title for this service. + */ + title: string; + /** + * A list of all proto message types included in this API service. Types + * referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such + * as types used by the `google.protobuf.Any` type, should be listed here by + * name. Example: types: - name: google.protobuf.Int32 + */ + types: Schema$Type[]; + /** + * Configuration controlling usage of this service. + */ + usage: Schema$Usage; + } /** - * A list of documentation rules that apply to individual API elements. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$DocumentationRule[]; + * Request message for `SetIamPolicy` method. + */ + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * A short summary of what the service does. Can only be provided by plain - * text. + * `SourceContext` represents information about the source of a protobuf + * element, like the file in which it is defined. */ - summary: string; -} -/** - * A documentation rule provides information about individual API elements. - */ -export interface Schema$DocumentationRule { + export interface Schema$SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: + * `"google/protobuf/source_context.proto"`. + */ + fileName: string; + } /** - * Deprecation description of the selected element(s). It can be provided if - * an element is marked as `deprecated`. + * Source information used to create a Service Config */ - deprecationDescription: string; + export interface Schema$SourceInfo { + /** + * All files used during config generation. + */ + sourceFiles: any[]; + } /** - * Description of the selected API(s). - */ - description: string; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The selector is a comma-separated list of patterns. Each pattern is a - * qualified name of the element which may end in "*", indicating a - * wildcard. Wildcards are only allowed at the end and for a whole component - * of the qualified name, i.e. "foo.*" is ok, but not - * "foo.b*" or "foo.*.bar". To specify a default for all - * applicable elements, the whole pattern "*" is used. - */ - selector: string; -} -/** - * Request message for EnableService method. - */ -export interface Schema$EnableServiceRequest { + * Represents the status of one operation step. + */ + export interface Schema$Step { + /** + * The short description of the step. + */ + description: string; + /** + * The status code. + */ + status: string; + } /** - * The identity of consumer resource which service enablement will be applied - * to. The Google Service Management implementation accepts the following - * forms: - "project:<project_id>" Note: this is made - * compatible with google.api.servicecontrol.v1.Operation.consumer_id. - */ - consumerId: string; -} -/** - * `Endpoint` describes a network endpoint that serves a set of APIs. A service - * may expose any number of endpoints, and all endpoints share the same service - * configuration, such as quota configuration and monitoring configuration. - * Example service configuration: name: library-example.googleapis.com - * endpoints: # Below entry makes - * 'google.example.library.v1.Library' # API be served from - * endpoint address library-example.googleapis.com. # It also allows HTTP - * OPTIONS calls to be passed to the backend, for # it to decide whether - * the subsequent cross-origin request is # allowed to proceed. - - * name: library-example.googleapis.com allow_cors: true - */ -export interface Schema$Endpoint { + * Request message for SubmitConfigSource method. + */ + export interface Schema$SubmitConfigSourceRequest { + /** + * The source configuration for the service. + */ + configSource: Schema$ConfigSource; + /** + * Optional. If set, this will result in the generation of a + * `google.api.Service` configuration based on the `ConfigSource` provided, + * but the generated config and the sources will NOT be persisted. + */ + validateOnly: boolean; + } /** - * DEPRECATED: This field is no longer supported. Instead of using aliases, - * please specify multiple google.api.Endpoint for each of the intended - * aliases. Additional names that this endpoint will be hosted on. + * Response message for SubmitConfigSource method. */ - aliases: string[]; + export interface Schema$SubmitConfigSourceResponse { + /** + * The generated service configuration. + */ + serviceConfig: Schema$Service; + } /** - * Allowing - * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - * cross-domain traffic, would allow the backends served from this endpoint to - * receive and respond to HTTP OPTIONS requests. The response will be used by - * the browser to determine whether the subsequent cross-origin request is - * allowed to proceed. - */ - allowCors: boolean; + * Define a parameter's name and location. The parameter may be passed as + * either an HTTP header or a URL query parameter, and if both are passed the + * behavior is implementation-dependent. + */ + export interface Schema$SystemParameter { + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + */ + httpHeader: string; + /** + * Define the name of the parameter, such as "api_key" . It is + * case sensitive. + */ + name: string; + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + */ + urlQueryParameter: string; + } /** - * The list of features enabled on this endpoint. - */ - features: string[]; + * Define a system parameter rule mapping system parameter definitions to + * methods. + */ + export interface Schema$SystemParameterRule { + /** + * Define parameters. Multiple names may be defined for a parameter. For a + * given method call, only one of them should be used. If multiple names are + * used the behavior is implementation-dependent. If none of the specified + * names are present the behavior is parameter-dependent. + */ + parameters: Schema$SystemParameter[]; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + } /** - * The canonical name of this endpoint. - */ - name: string; - /** - * The specification of an Internet routable address of API frontend that will - * handle requests to this [API - * Endpoint](https://cloud.google.com/apis/design/glossary). It should be - * either a valid IPv4 address or a fully-qualified domain name. For example, - * "8.8.8.8" or "myservice.appspot.com". - */ - target: string; -} -/** - * Enum type definition. - */ -export interface Schema$Enum { - /** - * Enum value definitions. - */ - enumvalue: Schema$EnumValue[]; - /** - * Enum type name. - */ - name: string; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; - /** - * The source context. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax. - */ - syntax: string; -} -/** - * Enum value definition. - */ -export interface Schema$EnumValue { - /** - * Enum value name. - */ - name: string; - /** - * Enum value number. - */ - number: number; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; -} -/** - * Experimental service configuration. These configuration options can only be - * used by whitelisted users. - */ -export interface Schema$Experimental { - /** - * Authorization configuration. - */ - authorization: Schema$AuthorizationConfig; -} -/** - * A single field of a message type. - */ -export interface Schema$Field { - /** - * The field cardinality. - */ - cardinality: string; - /** - * The string value of the default value of this field. Proto2 syntax only. - */ - defaultValue: string; - /** - * The field JSON name. - */ - jsonName: string; - /** - * The field type. - */ - kind: string; - /** - * The field name. - */ - name: string; - /** - * The field number. - */ - number: number; - /** - * The index of the field type in `Type.oneofs`, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ - oneofIndex: number; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * Whether to use alternative packed wire representation. - */ - packed: boolean; - /** - * The field type URL, without the scheme, for message or enumeration types. - * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - */ - typeUrl: string; -} -/** - * Request message for GenerateConfigReport method. - */ -export interface Schema$GenerateConfigReportRequest { - /** - * Service configuration for which we want to generate the report. For this - * version of API, the supported types are - * google.api.servicemanagement.v1.ConfigRef, - * google.api.servicemanagement.v1.ConfigSource, and google.api.Service - */ - newConfig: any; - /** - * Service configuration against which the comparison will be done. For this - * version of API, the supported types are - * google.api.servicemanagement.v1.ConfigRef, - * google.api.servicemanagement.v1.ConfigSource, and google.api.Service - */ - oldConfig: any; -} -/** - * Response message for GenerateConfigReport method. - */ -export interface Schema$GenerateConfigReportResponse { - /** - * list of ChangeReport, each corresponding to comparison between two service - * configurations. - */ - changeReports: Schema$ChangeReport[]; - /** - * Errors / Linter warnings associated with the service definition this report - * belongs to. - */ - diagnostics: Schema$Diagnostic[]; - /** - * ID of the service configuration this report belongs to. - */ - id: string; - /** - * Name of the service this report belongs to. - */ - serviceName: string; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * Defines the HTTP configuration for an API service. It contains a list of - * HttpRule, each specifying the mapping of an RPC method to one or more HTTP - * REST API methods. - */ -export interface Schema$Http { - /** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where - * "%2F" will be left encoded. The default behavior is to not - * decode RFC 6570 reserved characters in multi segment matches. - */ - fullyDecodeReservedExpansion: boolean; - /** - * A list of HTTP configuration rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$HttpRule[]; -} -/** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST API - * methods. The mapping specifies how different portions of the RPC request - * message are mapped to URL path, URL query parameters, and HTTP request body. - * The mapping is typically specified as an `google.api.http` annotation on the - * RPC method, see "google/api/annotations.proto" for details. The - * mapping consists of a field specifying the path template and method kind. The - * path template can refer to fields in the request message, as in the example - * below which describes a REST GET operation on a resource collection of - * messages: service Messaging { rpc GetMessage(GetMessageRequest) - * returns (Message) { option (google.api.http).get = - * "/v1/messages/{message_id}/{sub.subfield}"; } } message - * GetMessageRequest { message SubMessage { string subfield = 1; - * } string message_id = 1; // mapped to the URL SubMessage sub = 2; - * // `sub.subfield` is url-mapped } message Message { string text - * = 1; // content of the resource } The same http annotation can - * alternatively be expressed inside the `GRPC API Configuration` YAML file. - * http: rules: - selector: - * <proto_package_name>.Messaging.GetMessage get: - * /v1/messages/{message_id}/{sub.subfield} This definition enables an - * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC - * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: - * "123456" sub: SubMessage(subfield: "foo"))` In general, - * not only fields but also field paths can be referenced from a path pattern. - * Fields mapped to the path pattern cannot be repeated and must have a - * primitive (non-message) type. Any fields in the request message which are - * not bound by the path pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: service - * Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}"; } - * } message GetMessageRequest { message SubMessage { string - * subfield = 1; } string message_id = 1; // mapped to the URL int64 - * revision = 2; // becomes a parameter SubMessage sub = 3; // - * `sub.subfield` becomes a parameter } This enables a HTTP JSON to RPC - * mapping as below: HTTP | RPC -----|----- `GET - * /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: - * SubMessage(subfield: "foo"))` Note that fields which are mapped to - * HTTP parameters must have a primitive type or a repeated primitive type. - * Message types are not allowed. In the case of a repeated type, the parameter - * can be repeated in the URL, as in `...?param=A&param=B`. For HTTP method - * kinds which allow a request body, the `body` field specifies the mapping. - * Consider a REST update method on the message resource collection: service - * Messaging { rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { put: - * "/v1/messages/{message_id}" body: "message" }; - * } } message UpdateMessageRequest { string message_id = 1; // - * mapped to the URL Message message = 2; // mapped to the body } - * The following HTTP JSON to RPC mapping is enabled, where the representation - * of the JSON in the request body is determined by protos JSON encoding: HTTP - * | RPC -----|----- `PUT /v1/messages/123456 { "text": - * "Hi!" }` | `UpdateMessage(message_id: "123456" message { - * text: "Hi!" })` The special name `*` can be used in the body - * mapping to define that every field not bound by the path template should be - * mapped to the request body. This enables the following alternative - * definition of the update method: service Messaging { rpc - * UpdateMessage(Message) returns (Message) { option (google.api.http) = - * { put: "/v1/messages/{message_id}" body: - * "*" }; } } message Message { string - * message_id = 1; string text = 2; } The following HTTP JSON to RPC - * mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { - * "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` Note that when using `*` in the - * body mapping, it is not possible to have HTTP parameters, as all fields not - * bound by the path end in the body. This makes this option more rarely used in - * practice of defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. It is possible to - * define multiple HTTP methods for one RPC by using the `additional_bindings` - * option. Example: service Messaging { rpc - * GetMessage(GetMessageRequest) returns (Message) { option - * (google.api.http) = { get: "/v1/messages/{message_id}" - * additional_bindings { get: - * "/v1/users/{user_id}/messages/{message_id}" } }; - * } } message GetMessageRequest { string message_id = 1; string - * user_id = 2; } This enables the following two alternative HTTP JSON to - * RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | - * `GetMessage(message_id: "123456")` `GET - * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" - * message_id: "123456")` # Rules for HTTP mapping The rules for - * mapping HTTP path, query parameters, and body fields to the request message - * are as follows: 1. The `body` field specifies either `*` or a field path, or - * is omitted. If omitted, it indicates there is no HTTP request body. 2. - * Leaf fields (recursive expansion of nested messages in the request) can be - * classified into three types: (a) Matched in the URL template. (b) - * Covered by body (if body is `*`, everything except (a) fields; else - * everything under the body field) (c) All other fields. 3. URL query - * parameters found in the HTTP request are mapped to (c) fields. 4. Any body - * sent with an HTTP request can contain only (b) fields. The syntax of the - * path template is as follows: Template = "/" Segments [ Verb ] - * ; Segments = Segment { "/" Segment } ; Segment = - * "*" | "**" | LITERAL | Variable ; Variable = - * "{" FieldPath [ "=" Segments ] "}" ; FieldPath - * = IDENT { "." IDENT } ; Verb = ":" LITERAL ; The - * syntax `*` matches a single path segment. The syntax `**` matches zero or - * more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. The syntax - * `Variable` matches part of the URL path as specified by its template. A - * variable template must not contain other variables. If a variable matches a - * single path segment, its template may be omitted, e.g. `{var}` is equivalent - * to `{var=*}`. If a variable contains exactly one path segment, such as - * `"{var}"` or `"{var=*}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as `{var}`. - * If a variable contains one or more path segments, such as - * `"{var=foo/*}"` or `"{var=**}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~/0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as - * `{+var}`. NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** match RFC 6570 Reserved - * Expansion. The reason is that the Reserved Expansion does not expand special - * characters like `?` and `#`, which would lead to invalid URLs. NOTE: the - * field paths in variables and in the `body` must not refer to repeated fields - * or map fields. - */ -export interface Schema$HttpRule { - /** - * Additional HTTP bindings for the selector. Nested bindings must not contain - * an `additional_bindings` field themselves (that is, the nesting may only be - * one level deep). - */ - additionalBindings: Schema$HttpRule[]; - /** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. - */ - body: string; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave - * the HTTP method unspecified for this rule. The wild-card rule is useful for - * services that provide content to Web (HTML) clients. - */ - custom: Schema$CustomHttpPattern; - /** - * Used for deleting a resource. - */ - delete: string; - /** - * Used for listing and getting information about resources. - */ - get: string; - /** - * Use this only for Scotty Requests. Do not use this for bytestream methods. - * For media support, add instead [][google.bytestream.RestByteStream] as an - * API to your configuration. - */ - mediaDownload: Schema$MediaDownload; - /** - * Use this only for Scotty Requests. Do not use this for media support using - * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to - * your configuration for Bytestream methods. - */ - mediaUpload: Schema$MediaUpload; - /** - * Used for updating a resource. - */ - patch: string; - /** - * Used for creating a resource. - */ - post: string; - /** - * Used for updating a resource. - */ - put: string; - /** - * Selects methods to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for ListServiceConfigs method. - */ -export interface Schema$ListServiceConfigsResponse { - /** - * The token of the next page of results. - */ - nextPageToken: string; - /** - * The list of service configuration resources. - */ - serviceConfigs: Schema$Service[]; -} -/** - * Response message for ListServiceRollouts method. - */ -export interface Schema$ListServiceRolloutsResponse { - /** - * The token of the next page of results. - */ - nextPageToken: string; - /** - * The list of rollout resources. - */ - rollouts: Schema$Rollout[]; -} -/** - * Response message for `ListServices` method. - */ -export interface Schema$ListServicesResponse { - /** - * Token that can be passed to `ListServices` to resume a paginated query. - */ - nextPageToken: string; - /** - * The returned services will only have the name field set. - */ - services: Schema$ManagedService[]; -} -/** - * A description of a log type. Example in YAML format: - name: - * library.googleapis.com/activity_history description: The history of - * borrowing and returning library items. display_name: Activity labels: - * - key: /customer_id description: Identifier of a library customer - */ -export interface Schema$LogDescriptor { - /** - * A human-readable description of this log. This information appears in the - * documentation and can contain details. - */ - description: string; - /** - * The human-readable name for this log. This information appears on the user - * interface and should be concise. - */ - displayName: string; - /** - * The set of labels that are available to describe a specific log entry. - * Runtime requests that contain labels not specified here are considered - * invalid. - */ - labels: Schema$LabelDescriptor[]; - /** - * The name of the log. It must be less than 512 characters long and can - * include the following characters: upper- and lower-case alphanumeric - * characters [A-Za-z0-9], and punctuation characters including slash, - * underscore, hyphen, period [/_-.]. - */ - name: string; -} -/** - * Logging configuration of the service. The following example shows how to - * configure logs to be sent to the producer and consumer projects. In the - * example, the `activity_history` log is sent to both the producer and consumer - * projects, whereas the `purchase_history` log is only sent to the producer - * project. monitored_resources: - type: library.googleapis.com/branch - * labels: - key: /city description: The city where the library - * branch is located in. - key: /name description: The name of the - * branch. logs: - name: activity_history labels: - key: - * /customer_id - name: purchase_history logging: producer_destinations: - * - monitored_resource: library.googleapis.com/branch logs: - - * activity_history - purchase_history consumer_destinations: - - * monitored_resource: library.googleapis.com/branch logs: - - * activity_history - */ -export interface Schema$Logging { - /** - * Logging configurations for sending logs to the consumer project. There can - * be multiple consumer destinations, each one must have a different monitored - * resource type. A log can be used in at most one consumer destination. - */ - consumerDestinations: Schema$LoggingDestination[]; - /** - * Logging configurations for sending logs to the producer project. There can - * be multiple producer destinations, each one must have a different monitored - * resource type. A log can be used in at most one producer destination. - */ - producerDestinations: Schema$LoggingDestination[]; -} -/** - * Configuration of a specific logging destination (the producer project or the - * consumer project). - */ -export interface Schema$LoggingDestination { - /** - * Names of the logs to be sent to this destination. Each name must be defined - * in the Service.logs section. If the log name is not a domain scoped name, - * it will be automatically prefixed with the service name followed by - * "/". - */ - logs: string[]; - /** - * The monitored resource type. The type must be defined in the - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * The full representation of a Service that is managed by Google Service - * Management. - */ -export interface Schema$ManagedService { - /** - * ID of the project that produces and owns this service. - */ - producerProjectId: string; - /** - * The name of the service. See the [overview](/service-management/overview) - * for naming requirements. - */ - serviceName: string; -} -/** - * Defines the Media configuration for a service in case of a download. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaDownload { - /** - * A boolean that determines whether a notification for the completion of a - * download should be sent to the backend. - */ - completeNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the download service if one is used for download. - */ - downloadService: string; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether download is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for direct download. The size is specified - * in bytes. - */ - maxDirectDownloadSize: string; - /** - * A boolean that determines if direct download from ESF should be used for - * download of this media. - */ - useDirectDownload: boolean; -} -/** - * Defines the Media configuration for a service in case of an upload. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaUpload { - /** - * A boolean that determines whether a notification for the completion of an - * upload should be sent to the backend. These notifications will not be seen - * by the client and will not consume quota. - */ - completeNotification: boolean; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether upload is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for an upload. The size is specified in - * bytes. - */ - maxSize: string; - /** - * An array of mimetype patterns. Esf will only accept uploads that match one - * of the given patterns. - */ - mimeTypes: string[]; - /** - * Whether to receive a notification for progress changes of media upload. - */ - progressNotification: boolean; - /** - * Whether to receive a notification on the start of media upload. - */ - startNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the upload service if one is used for upload. - */ - uploadService: string; -} -/** - * Method represents a method of an API interface. - */ -export interface Schema$Method { - /** - * The simple name of this method. - */ - name: string; - /** - * Any metadata attached to the method. - */ - options: Schema$Option[]; - /** - * If true, the request is streamed. - */ - requestStreaming: boolean; - /** - * A URL of the input message type. - */ - requestTypeUrl: string; - /** - * If true, the response is streamed. - */ - responseStreaming: boolean; - /** - * The URL of the output message type. - */ - responseTypeUrl: string; - /** - * The source syntax of this method. - */ - syntax: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric type has a - * label for the HTTP response code, `response_code`, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * `custom.googleapis.com`. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported - * units are a subset of [The Unified Code for Units of - * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units - * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute * - * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo (10**3) * - * `M` mega (10**6) * `G` giga (10**9) * `T` tera (10**12) * - * `P` peta (10**15) * `E` exa (10**18) * `Z` zetta - * (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * `u` micro - * (10**-6) * `n` nano (10**-9) * `p` pico (10**-12) * `f` femto - * (10**-15) * `a` atto (10**-18) * `z` zepto (10**-21) * `y` - * yocto (10**-24) * `Ki` kibi (2**10) * `Mi` mebi (2**20) * - * `Gi` gibi (2**30) * `Ti` tebi (2**40) **Grammar** The grammar - * also includes these connectors: * `/` division (as an infix operator, - * e.g. `1/s`). * `.` multiplication (as an infix operator, e.g. `GBy.d`) - * The grammar for a unit is as follows: Expression = Component { - * "." Component } { "/" Component } ; Component = ( - * [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation - * | "1" ; Annotation = "{" NAME - * "}" ; Notes: * `Annotation` is just a comment if it follows a - * `UNIT` and is equivalent to `1` if it is used alone. For examples, - * `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. * `NAME` is a sequence - * of non-blank printable ASCII characters not containing '{' or - * '}'. * `1` represents dimensionless value 1, such as in `1/s`. * - * `%` represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of `metric_kind` and `value_type` might not be supported. - */ - valueType: string; -} -/** - * Bind API methods to metrics. Binding a method to a metric causes that - * metric's configured quota behaviors to apply to the method call. - */ -export interface Schema$MetricRule { - /** - * Metrics to update when the selected methods are called, and the associated - * cost applied to each metric. The key of the map is the metric name, and - * the values are the amount increased for the metric against which the quota - * limits are defined. The value must not be negative. - */ - metricCosts: any; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Declares an API Interface to be included in this interface. The including - * interface must redeclare all the methods from the included interface, but - * documentation and options are inherited as follows: - If after comment and - * whitespace stripping, the documentation string of the redeclared method is - * empty, it will be inherited from the original method. - Each annotation - * belonging to the service config (http, visibility) which is not set in the - * redeclared method will be inherited. - If an http annotation is inherited, - * the path pattern will be modified as follows. Any version prefix will be - * replaced by the version of the including interface plus the root path if - * specified. Example of a simple mixin: package google.acl.v1; service - * AccessControl { // Get the underlying ACL object. rpc - * GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = - * "/v1/{resource=**}:getAcl"; } } package - * google.storage.v2; service Storage { // rpc - * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc - * GetData(GetDataRequest) returns (Data) { option (google.api.http).get - * = "/v2/{resource=**}"; } } Example of a mixin - * configuration: apis: - name: google.storage.v2.Storage mixins: - * - name: google.acl.v1.AccessControl The mixin construct implies that all - * methods in `AccessControl` are also declared with same name and - * request/response types in `Storage`. A documentation generator or annotation - * processor will see the effective `Storage.GetAcl` method after inherting - * documentation and annotations as follows: service Storage { // Get - * the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { - * option (google.api.http).get = "/v2/{resource=**}:getAcl"; } - * ... } Note how the version in the path pattern changed from `v1` to - * `v2`. If the `root` field in the mixin is specified, it should be a relative - * path under which inherited HTTP paths are placed. Example: apis: - - * name: google.storage.v2.Storage mixins: - name: - * google.acl.v1.AccessControl root: acls This implies the following - * inherited HTTP annotation: service Storage { // Get the underlying - * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option - * (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; } - * ... } - */ -export interface Schema$Mixin { - /** - * The fully qualified name of the interface which is included. - */ - name: string; - /** - * If non-empty specifies a path under which inherited HTTP paths are rooted. - */ - root: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource - * descriptor for Google Compute Engine VM instances has a type of - * `"gce_instance"` and specifies the use of the labels - * `"instance_id"` and `"zone"` to identify particular VM - * instances. Different APIs can support different monitored resource types. - * APIs generally provide a `list` method that returns the monitored resource - * descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, `"Google Cloud - * SQL Database"`. - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and - * `"zone"`. - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` - * where {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - * The maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Monitoring configuration of the service. The example below shows how to - * configure monitored resources and metrics for monitoring. In the example, a - * monitored resource and two metrics are defined. The - * `library.googleapis.com/book/returned_count` metric is sent to both producer - * and consumer projects, whereas the - * `library.googleapis.com/book/overdue_count` metric is only sent to the - * consumer project. monitored_resources: - type: - * library.googleapis.com/branch labels: - key: /city description: - * The city where the library branch is located in. - key: /name - * description: The name of the branch. metrics: - name: - * library.googleapis.com/book/returned_count metric_kind: DELTA - * value_type: INT64 labels: - key: /customer_id - name: - * library.googleapis.com/book/overdue_count metric_kind: GAUGE - * value_type: INT64 labels: - key: /customer_id monitoring: - * producer_destinations: - monitored_resource: - * library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count - - * library.googleapis.com/book/overdue_count - */ -export interface Schema$Monitoring { - /** - * Monitoring configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one consumer - * destination. - */ - consumerDestinations: Schema$MonitoringDestination[]; - /** - * Monitoring configurations for sending metrics to the producer project. - * There can be multiple producer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one producer - * destination. - */ - producerDestinations: Schema$MonitoringDestination[]; -} -/** - * Configuration of a specific monitoring destination (the producer project or - * the consumer project). - */ -export interface Schema$MonitoringDestination { - /** - * Names of the metrics to report to this monitoring destination. Each name - * must be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * OAuth scopes are a way to define data and permissions on data. For example, - * there are scopes defined for "Read-only access to Google Calendar" - * and "Access to Cloud Platform". Users can consent to a scope for an - * application, giving it permission to access that data on their behalf. OAuth - * scope specifications should be fairly coarse grained; a user will need to see - * and understand the text description of what your scope means. In most cases: - * use one or at most two OAuth scopes for an entire family of products. If your - * product has multiple APIs, you should probably be sharing the OAuth scope - * across all of those APIs. When you need finer grained OAuth consent screens: - * talk with your product management about how developers will use them in - * practice. Please note that even though each of the canonical scopes is - * enough for a request to be accepted and passed to the backend, a request can - * still fail due to the backend requiring additional scopes or permissions. - */ -export interface Schema$OAuthRequirements { - /** - * The list of publicly documented OAuth scopes that are allowed access. An - * OAuth token containing any of these scopes will be accepted. Example: - * canonical_scopes: https://www.googleapis.com/auth/calendar, - * https://www.googleapis.com/auth/calendar.read - */ - canonicalScopes: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The metadata associated with a long running operation resource. - */ -export interface Schema$OperationMetadata { - /** - * Percentage of completion of this operation, ranging from 0 to 100. - */ - progressPercentage: number; - /** - * The full name of the resources that this operation is directly associated - * with. - */ - resourceNames: string[]; - /** - * The start time of the operation. - */ - startTime: string; - /** - * Detailed status information for each step. The order is undetermined. - */ - steps: Schema$Step[]; -} -/** - * A protocol buffer option, which can be attached to a message, field, - * enumeration, etc. - */ -export interface Schema$Option { - /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, - * `"map_entry"`. For custom options, it should be the - * fully-qualified name. For example, `"google.api.http"`. - */ - name: string; - /** - * The option's value packed in an Any message. If the value is a - * primitive, the corresponding wrapper type defined in - * google/protobuf/wrappers.proto should be used. If the value is an enum, it - * should be stored as an int32 value using the google.protobuf.Int32Value - * type. - */ - value: any; -} -/** - * Represents a documentation page. A page can contain subpages to represent - * nested documentation set structure. - */ -export interface Schema$Page { - /** - * The Markdown content of the page. You can use <code>&#40;== - * include {path} ==&#41;</code> to include content from a Markdown - * file. - */ - content: string; - /** - * The name of the page. It will be used as an identity of the page to - * generate URI of the page, text of the link to this page in navigation, etc. - * The full page name (start from the root page name to this page concatenated - * with `.`) can be used as reference to the page in your documentation. For - * example: <pre><code>pages: - name: Tutorial content: - * &#40;== include tutorial.md ==&#41; subpages: - name: Java - * content: &#40;== include tutorial_java.md ==&#41; - * </code></pre> You can reference `Java` page using Markdown - * reference link syntax: `Java`. - */ - name: string; - /** - * Subpages of this page. The order of subpages specified here will be honored - * in the generated docset. - */ - subpages: Schema$Page[]; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **JSON Example** { "bindings": [ { - * "role": "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } **YAML Example** - * bindings: - members: - user:mike@example.com - - * group:admins@example.com - domain:google.com - - * serviceAccount:my-other-app@appspot.gserviceaccount.com role: - * roles/owner - members: - user:sean@example.com role: - * roles/viewer For a description of IAM and its features, see the [IAM - * developer's guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Quota configuration helps to achieve fairness and budgeting in service usage. - * The quota configuration works this way: - The service configuration defines a - * set of metrics. - For API calls, the quota.metric_rules maps methods to - * metrics with corresponding costs. - The quota.limits defines limits on the - * metrics, which will be used for quota checks at runtime. An example quota - * configuration in yaml format: quota: - name: apiWriteQpsPerProject - * metric: library.googleapis.com/write_calls unit: - * "1/min/{project}" # rate limit for consumer projects values: - * STANDARD: 10000 # The metric rules bind all methods to the read_calls - * metric, # except for the UpdateBook and DeleteBook methods. These two - * methods # are mapped to the write_calls metric, with the UpdateBook - * method # consuming at twice rate as the DeleteBook method. metric_rules: - * - selector: "*" metric_costs: - * library.googleapis.com/read_calls: 1 - selector: - * google.example.library.v1.LibraryService.UpdateBook metric_costs: - * library.googleapis.com/write_calls: 2 - selector: - * google.example.library.v1.LibraryService.DeleteBook metric_costs: - * library.googleapis.com/write_calls: 1 Corresponding Metric definition: - * metrics: - name: library.googleapis.com/read_calls display_name: - * Read requests metric_kind: DELTA value_type: INT64 - - * name: library.googleapis.com/write_calls display_name: Write requests - * metric_kind: DELTA value_type: INT64 - */ -export interface Schema$Quota { - /** - * List of `QuotaLimit` definitions for the service. - */ - limits: Schema$QuotaLimit[]; - /** - * List of `MetricRule` definitions, each one mapping a selected method to one - * or more metrics. - */ - metricRules: Schema$MetricRule[]; -} -/** - * `QuotaLimit` defines a specific limit that applies over a specified duration - * for a limit type. There can be at most one limit for a duration and limit - * type combination defined within a `QuotaGroup`. - */ -export interface Schema$QuotaLimit { - /** - * Default number of tokens that can be consumed during the specified - * duration. This is the number of tokens assigned when a client application - * developer activates the service for his/her project. Specifying a value of - * 0 will block all requests. This can be used if you are provisioning quota - * to selected consumers and blocking others. Similarly, a value of -1 will - * indicate an unlimited quota. No other negative values are allowed. Used by - * group-based quotas only. - */ - defaultLimit: string; - /** - * Optional. User-visible, extended description for this quota limit. Should - * be used only when more context is needed to understand this limit than - * provided by the limit's display name (see: `display_name`). - */ - description: string; - /** - * User-visible display name for this limit. Optional. If not set, the UI will - * provide a default display name based on the quota configuration. This field - * can be used to override the default display name generated from the - * configuration. - */ - displayName: string; - /** - * Duration of this limit in textual notation. Example: "100s", - * "24h", "1d". For duration longer than a day, only - * multiple of days is supported. We support only "100s" and - * "1d" for now. Additional support will be added in the future. - * "0" indicates indefinite duration. Used by group-based quotas - * only. - */ - duration: string; - /** - * Free tier value displayed in the Developers Console for this limit. The - * free tier is the number of tokens that will be subtracted from the billed - * amount when billing is enabled. This field can only be set on a limit with - * duration "1d", in a billable group; it is invalid on any other - * limit. If this field is not set, it defaults to 0, indicating that there is - * no free tier for this service. Used by group-based quotas only. - */ - freeTier: string; - /** - * Maximum number of tokens that can be consumed during the specified - * duration. Client application developers can override the default limit up - * to this maximum. If specified, this value cannot be set to a value less - * than the default limit. If not specified, it is set to the default limit. - * To allow clients to apply overrides with no upper bound, set this to -1, - * indicating unlimited maximum quota. Used by group-based quotas only. - */ - maxLimit: string; - /** - * The name of the metric this quota limit applies to. The quota limits with - * the same metric will be checked together during runtime. The metric must be - * defined within the service config. - */ - metric: string; - /** - * Name of the quota limit. The name must be provided, and it must be unique - * within the service. The name can only include alphanumeric characters as - * well as '-'. The maximum length of the limit name is 64 - * characters. - */ - name: string; - /** - * Specify the unit of the quota limit. It uses the same syntax as - * Metric.unit. The supported unit kinds are determined by the quota backend - * system. Here are some examples: * "1/min/{project}" for quota - * per minute per project. Note: the order of unit components is - * insignificant. The "1" at the beginning is required to follow the - * metric unit syntax. - */ - unit: string; - /** - * Tiered limit values. You must specify this as a key:value pair, with an - * integer value that is the maximum number of requests allowed for the - * specified unit. Currently only STANDARD is supported. - */ - values: any; -} -/** - * A rollout resource that defines how service configuration versions are pushed - * to control plane systems. Typically, you create a new version of the service - * config, and then create a Rollout to push the service config. - */ -export interface Schema$Rollout { - /** - * The user who created the Rollout. Readonly. - */ - createdBy: string; - /** - * Creation time of the rollout. Readonly. - */ - createTime: string; - /** - * The strategy associated with a rollout to delete a `ManagedService`. - * Readonly. - */ - deleteServiceStrategy: Schema$DeleteServiceStrategy; - /** - * Optional unique identifier of this Rollout. Only lower case letters, digits - * and '-' are allowed. If not specified by client, the server will - * generate one. The generated id will have the form of - * <date><revision number>, where "date" is the create - * date in ISO 8601 format. "revision number" is a monotonically - * increasing positive number that is reset every day for each service. An - * example of the generated rollout_id is '2016-02-16r1' - */ - rolloutId: string; - /** - * The name of the service associated with this Rollout. - */ - serviceName: string; - /** - * The status of this rollout. Readonly. In case of a failed rollout, the - * system will automatically rollback to the current Rollout version. - * Readonly. - */ - status: string; - /** - * Google Service Control selects service configurations based on traffic - * percentage. - */ - trafficPercentStrategy: Schema$TrafficPercentStrategy; -} -/** - * `Service` is the root object of Google service configuration schema. It - * describes basic information about a service, such as the name and the title, - * and delegates other aspects to sub-sections. Each sub-section is either a - * proto message or a repeated proto message that configures a specific aspect, - * such as auth. See each proto message definition for details. Example: type: - * google.api.Service config_version: 3 name: calendar.googleapis.com - * title: Google Calendar API apis: - name: google.calendar.v3.Calendar - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Service { - /** - * A list of API interfaces exported by this service. Only the `name` field of - * the google.protobuf.Api needs to be provided by the configuration author, - * as the remaining fields will be derived from the IDL during the - * normalization process. It is an error to specify an API interface here - * which cannot be resolved against the associated IDL files. - */ - apis: Schema$Api[]; - /** - * Auth configuration. - */ - authentication: Schema$Authentication; - /** - * API backend configuration. - */ - backend: Schema$Backend; - /** - * Billing configuration. - */ - billing: Schema$Billing; - /** - * The semantic version of the service configuration. The config version - * affects the interpretation of the service configuration. For example, - * certain features are enabled by default for certain config versions. The - * latest config version is `3`. - */ - configVersion: number; - /** - * Context configuration. - */ - context: Schema$Context; - /** - * Configuration for the service control plane. - */ - control: Schema$Control; - /** - * Custom error configuration. - */ - customError: Schema$CustomError; - /** - * Additional API documentation. - */ - documentation: Schema$Documentation; - /** - * Configuration for network endpoints. If this is empty, then an endpoint - * with the same name as the service is automatically generated to service all - * defined APIs. - */ - endpoints: Schema$Endpoint[]; - /** - * A list of all enum types included in this API service. Enums referenced - * directly or indirectly by the `apis` are automatically included. Enums - * which are not referenced but shall be included should be listed here by - * name. Example: enums: - name: google.someapi.v1.SomeEnum - */ - enums: Schema$Enum[]; - /** - * Experimental configuration. - */ - experimental: Schema$Experimental; - /** - * HTTP configuration. - */ - http: Schema$Http; - /** - * A unique ID for a specific instance of this message, typically assigned by - * the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ - id: string; - /** - * Logging configuration. - */ - logging: Schema$Logging; - /** - * Defines the logs used by this service. - */ - logs: Schema$LogDescriptor[]; - /** - * Defines the metrics used by this service. - */ - metrics: Schema$MetricDescriptor[]; - /** - * Defines the monitored resources used by this service. This is required by - * the Service.monitoring and Service.logging configurations. - */ - monitoredResources: Schema$MonitoredResourceDescriptor[]; - /** - * Monitoring configuration. - */ - monitoring: Schema$Monitoring; - /** - * The DNS address at which this service is available, e.g. - * `calendar.googleapis.com`. - */ - name: string; - /** - * The Google project that owns this service. - */ - producerProjectId: string; - /** - * Quota configuration. - */ - quota: Schema$Quota; - /** - * Output only. The source information for this configuration if available. - */ - sourceInfo: Schema$SourceInfo; - /** - * System parameter configuration. - */ - systemParameters: Schema$SystemParameters; - /** - * A list of all proto message types included in this API service. It serves - * similar purpose as [google.api.Service.types], except that these types are - * not needed by user-defined APIs. Therefore, they will not show up in the - * generated discovery doc. This field should only be used to define system - * APIs in ESF. - */ - systemTypes: Schema$Type[]; - /** - * The product title for this service. - */ - title: string; - /** - * A list of all proto message types included in this API service. Types - * referenced directly or indirectly by the `apis` are automatically included. - * Messages which are not referenced but shall be included, such as types used - * by the `google.protobuf.Any` type, should be listed here by name. Example: - * types: - name: google.protobuf.Int32 - */ - types: Schema$Type[]; - /** - * Configuration controlling usage of this service. - */ - usage: Schema$Usage; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; - /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. - */ - updateMask: string; -} -/** - * `SourceContext` represents information about the source of a protobuf - * element, like the file in which it is defined. - */ -export interface Schema$SourceContext { - /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: - * `"google/protobuf/source_context.proto"`. - */ - fileName: string; -} -/** - * Source information used to create a Service Config - */ -export interface Schema$SourceInfo { - /** - * All files used during config generation. - */ - sourceFiles: any[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents the status of one operation step. - */ -export interface Schema$Step { - /** - * The short description of the step. - */ - description: string; - /** - * The status code. - */ - status: string; -} -/** - * Request message for SubmitConfigSource method. - */ -export interface Schema$SubmitConfigSourceRequest { - /** - * The source configuration for the service. - */ - configSource: Schema$ConfigSource; - /** - * Optional. If set, this will result in the generation of a - * `google.api.Service` configuration based on the `ConfigSource` provided, - * but the generated config and the sources will NOT be persisted. - */ - validateOnly: boolean; -} -/** - * Response message for SubmitConfigSource method. - */ -export interface Schema$SubmitConfigSourceResponse { - /** - * The generated service configuration. - */ - serviceConfig: Schema$Service; -} -/** - * Define a parameter's name and location. The parameter may be passed as - * either an HTTP header or a URL query parameter, and if both are passed the - * behavior is implementation-dependent. - */ -export interface Schema$SystemParameter { - /** - * Define the HTTP header name to use for the parameter. It is case - * insensitive. - */ - httpHeader: string; - /** - * Define the name of the parameter, such as "api_key" . It is case - * sensitive. - */ - name: string; - /** - * Define the URL query parameter name to use for the parameter. It is case - * sensitive. - */ - urlQueryParameter: string; -} -/** - * Define a system parameter rule mapping system parameter definitions to - * methods. - */ -export interface Schema$SystemParameterRule { - /** - * Define parameters. Multiple names may be defined for a parameter. For a - * given method call, only one of them should be used. If multiple names are - * used the behavior is implementation-dependent. If none of the specified - * names are present the behavior is parameter-dependent. - */ - parameters: Schema$SystemParameter[]; - /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; -} -/** - * ### System parameter configuration A system parameter is a special kind of - * parameter defined by the API system, not by an individual API. It is - * typically mapped to an HTTP header and/or a URL query parameter. This - * configuration specifies which methods change the names of the system - * parameters. - */ -export interface Schema$SystemParameters { - /** - * Define system parameters. The parameters defined here will override the - * default parameters implemented by the system. If this field is missing from - * the service config, default system parameters will be used. Default system - * parameters and names is implementation-dependent. Example: define api key - * for all methods system_parameters rules: - selector: - * "*" parameters: - name: api_key - * url_query_parameter: api_key Example: define 2 api key names for a - * specific method. system_parameters rules: - selector: - * "/ListShelves" parameters: - name: api_key - * http_header: Api-Key1 - name: api_key http_header: Api-Key2 - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$SystemParameterRule[]; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * Strategy that specifies how clients of Google Service Controller want to send - * traffic to use different config versions. This is generally used by API proxy - * to split traffic based on your configured precentage for each config version. - * One example of how to gradually rollout a new service configuration using - * this strategy: Day 1 Rollout { id: - * "example.googleapis.com/rollout_20160206" traffic_percent_strategy - * { percentages: { "example.googleapis.com/20160201": 70.00 - * "example.googleapis.com/20160206": 30.00 } } } - * Day 2 Rollout { id: - * "example.googleapis.com/rollout_20160207" traffic_percent_strategy: - * { percentages: { "example.googleapis.com/20160206": 100.00 - * } } } - */ -export interface Schema$TrafficPercentStrategy { - /** - * Maps service configuration IDs to their corresponding traffic percentage. - * Key is the service configuration ID, Value is the traffic percentage which - * must be greater than 0.0 and the sum must equal to 100.0. - */ - percentages: any; -} -/** - * A protocol buffer message type. - */ -export interface Schema$Type { - /** - * The list of fields. - */ - fields: Schema$Field[]; - /** - * The fully qualified message name. - */ - name: string; - /** - * The list of types appearing in `oneof` definitions in this type. - */ - oneofs: string[]; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * The source context. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax. - */ - syntax: string; -} -/** - * Response message for UndeleteService method. - */ -export interface Schema$UndeleteServiceResponse { - /** - * Revived service resource. - */ - service: Schema$ManagedService; -} -/** - * Configuration controlling usage of a service. - */ -export interface Schema$Usage { - /** - * The full resource name of a channel used for sending notifications to the - * service producer. Google Service Management currently only supports - * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - * channel. To use Google Cloud Pub/Sub as the channel, this must be the name - * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - * documented in https://cloud.google.com/pubsub/docs/overview. - */ - producerNotificationChannel: string; - /** - * Requirements that must be satisfied before a consumer project can use the - * service. Each requirement is of the form - * <service.name>/<requirement-id>; for example - * 'serviceusage.googleapis.com/billing-enabled'. - */ - requirements: string[]; - /** - * A list of usage rules that apply to individual API methods. **NOTE:** All - * service configuration rules follow "last one wins" order. - */ - rules: Schema$UsageRule[]; -} -/** - * Usage configuration rules for the service. NOTE: Under development. Use - * this rule to configure unregistered calls for the service. Unregistered calls - * are calls that do not contain consumer project identity. (Example: calls that - * do not contain an API key). By default, API methods do not allow unregistered - * calls, and each method call must be identified by a consumer project - * identity. Use this rule to allow/disallow unregistered calls. Example of an - * API that wants to allow unregistered calls for entire service. usage: - * rules: - selector: "*" allow_unregistered_calls: true - * Example of a method that wants to allow unregistered calls. usage: - * rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allow_unregistered_calls: true - */ -export interface Schema$UsageRule { - /** - * If true, the selected method allows unregistered calls, e.g. calls that - * don't identify any user or application. - */ - allowUnregisteredCalls: boolean; - /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; - /** - * If true, the selected method should skip service control and the control - * plane features, such as quota and billing, will not be available. This flag - * is used by Google Cloud Endpoints to bypass checks for internal methods, - * such as service health check methods. - */ - skipServiceControl: boolean; -} - -export class Resource$Operations { - root: Servicemanagement; - constructor(root: Servicemanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * servicemanagement.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias servicemanagement.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.operations.list - * @desc Lists service operations that match the specified filter in the - * request. - * @alias servicemanagement.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A string for filtering Operations. The following filter fields are supported: * serviceName: Required. Only `=` operator is allowed. * startTime: The time this job was started, in ISO 8601 format. Allowed operators are `>=`, `>`, `<=`, and `<`. * status: Can be `done`, `in_progress`, or `failed`. Allowed operators are `=`, and `!=`. Filter expression supports conjunction (AND) and disjunction (OR) logical operators. However, the serviceName restriction must be at the top-level and can only be combined with other restrictions via the AND logical operator. Examples: * `serviceName={some-service}.googleapis.com` * `serviceName={some-service}.googleapis.com AND startTime>="2017-02-01"` * `serviceName={some-service}.googleapis.com AND status=done` * `serviceName={some-service}.googleapis.com AND (status=done OR startTime>="2017-02-01")` - * @param {string=} params.name Not used. - * @param {integer=} params.pageSize The maximum number of operations to return. If unspecified, defaults to 50. The maximum value is 100. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Services { - root: Servicemanagement; - configs: Resource$Services$Configs; - consumers: Resource$Services$Consumers; - rollouts: Resource$Services$Rollouts; - constructor(root: Servicemanagement) { - this.root = root; - this.getRoot.bind(this); - this.configs = new Resource$Services$Configs(root); - this.consumers = new Resource$Services$Consumers(root); - this.rollouts = new Resource$Services$Rollouts(root); - } - - getRoot() { - return this.root; - } - - - /** - * servicemanagement.services.create - * @desc Creates a new managed service. Please note one producer project can - * own no more than 20 services. Operation - * @alias servicemanagement.services.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().ManagedService} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.delete - * @desc Deletes a managed service. This method will change the service to the - * `Soft-Delete` state for 30 days. Within this period, service producers may - * call UndeleteService to restore the service. After 30 days, the service - * will be permanently deleted. Operation - * @alias servicemanagement.services.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.disable - * @desc Disables a service for a project, so it can no longer be be used for - * the project. It prevents accidental usage that may cause unexpected billing - * charges or security leaks. Operation - * @alias servicemanagement.services.disable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service to disable. Specifying an unknown service name will cause the request to fail. - * @param {().DisableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disable(params?: any, options?: MethodOptions): - AxiosPromise; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:disable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.enable - * @desc Enables a service for a project, so it can be used for the project. - * See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for - * more information. Operation - * @alias servicemanagement.services.enable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName Name of the service to enable. Specifying an unknown service name will cause the request to fail. - * @param {().EnableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enable(params?: any, options?: MethodOptions): AxiosPromise; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:enable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.generateConfigReport - * @desc Generates and returns a report (errors, warnings and changes from - * existing configurations) associated with - * GenerateConfigReportRequest.new_value If - * GenerateConfigReportRequest.old_value is specified, - * GenerateConfigReportRequest will contain a single ChangeReport based on the - * comparison between GenerateConfigReportRequest.new_value and - * GenerateConfigReportRequest.old_value. If - * GenerateConfigReportRequest.old_value is not specified, this method will - * compare GenerateConfigReportRequest.new_value with the last pushed service - * configuration. - * @alias servicemanagement.services.generateConfigReport - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GenerateConfigReportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - generateConfigReport(params?: any, options?: MethodOptions): - AxiosPromise; - generateConfigReport( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - generateConfigReport( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services:generateConfigReport') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.get - * @desc Gets a managed service. Authentication is required unless the service - * is public. - * @alias servicemanagement.services.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the `ServiceManager` overview for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.getConfig - * @desc Gets a service configuration (version) for a managed service. - * @alias servicemanagement.services.getConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.configId The id of the service configuration resource. - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {string=} params.view Specifies which parts of the Service Config should be returned in the response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getConfig(params?: any, options?: MethodOptions): - AxiosPromise; - getConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/config') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias servicemanagement.services.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.list - * @desc Lists managed services. Returns all public services. For - * authenticated users, also returns all services the calling user has - * "servicemanagement.services.get" permission for. **BETA:** If the caller - * specifies the `consumer_id`, it returns only the services enabled on the - * consumer. The `consumer_id` must have the format of "project:{PROJECT-ID}". - * @alias servicemanagement.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.consumerId Include services consumed by the specified consumer. The Google Service Management implementation accepts the following forms: - project: - * @param {integer=} params.pageSize Requested size of the next page of data. - * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. - * @param {string=} params.producerProjectId Include services produced by the specified project. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * servicemanagement.services.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias servicemanagement.services.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * ### System parameter configuration A system parameter is a special kind of + * parameter defined by the API system, not by an individual API. It is + * typically mapped to an HTTP header and/or a URL query parameter. This + * configuration specifies which methods change the names of the system + * parameters. + */ + export interface Schema$SystemParameters { + /** + * Define system parameters. The parameters defined here will override the + * default parameters implemented by the system. If this field is missing + * from the service config, default system parameters will be used. Default + * system parameters and names is implementation-dependent. Example: define + * api key for all methods system_parameters rules: - + * selector: "*" parameters: - name: api_key + * url_query_parameter: api_key Example: define 2 api key names for a + * specific method. system_parameters rules: - selector: + * "/ListShelves" parameters: - name: + * api_key http_header: Api-Key1 - name: api_key + * http_header: Api-Key2 **NOTE:** All service configuration rules follow + * "last one wins" order. + */ + rules: Schema$SystemParameterRule[]; } - - /** - * servicemanagement.services.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias servicemanagement.services.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for `TestIamPermissions` method. + */ + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; } - - /** - * servicemanagement.services.undelete - * @desc Revives a previously deleted managed service. The method restores the - * service using the configuration at the time the service was deleted. The - * target service must exist and must have been deleted within the last 30 - * days. Operation - * @alias servicemanagement.services.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): - AxiosPromise; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Services$Configs { - root: Servicemanagement; - constructor(root: Servicemanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Response message for `TestIamPermissions` method. + */ + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * servicemanagement.services.configs.create - * @desc Creates a new service configuration (version) for a managed service. - * This method only stores the service configuration. To roll out the service - * configuration to backend systems please call CreateServiceRollout. Only - * the 100 most recent service configurations and ones referenced by existing - * rollouts are kept for each service. The rest will be deleted eventually. - * @alias servicemanagement.services.configs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {().Service} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/configs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Strategy that specifies how clients of Google Service Controller want to + * send traffic to use different config versions. This is generally used by + * API proxy to split traffic based on your configured precentage for each + * config version. One example of how to gradually rollout a new service + * configuration using this strategy: Day 1 Rollout { id: + * "example.googleapis.com/rollout_20160206" + * traffic_percent_strategy { percentages: { + * "example.googleapis.com/20160201": 70.00 + * "example.googleapis.com/20160206": 30.00 } } } + * Day 2 Rollout { id: + * "example.googleapis.com/rollout_20160207" + * traffic_percent_strategy: { percentages: { + * "example.googleapis.com/20160206": 100.00 } } } + */ + export interface Schema$TrafficPercentStrategy { + /** + * Maps service configuration IDs to their corresponding traffic percentage. + * Key is the service configuration ID, Value is the traffic percentage + * which must be greater than 0.0 and the sum must equal to 100.0. + */ + percentages: any; } - - /** - * servicemanagement.services.configs.get - * @desc Gets a service configuration (version) for a managed service. - * @alias servicemanagement.services.configs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.configId The id of the service configuration resource. - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {string=} params.view Specifies which parts of the Service Config should be returned in the response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/configs/{configId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName', 'configId'], - pathParams: ['configId', 'serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A protocol buffer message type. + */ + export interface Schema$Type { + /** + * The list of fields. + */ + fields: Schema$Field[]; + /** + * The fully qualified message name. + */ + name: string; + /** + * The list of types appearing in `oneof` definitions in this type. + */ + oneofs: string[]; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; } - - /** - * servicemanagement.services.configs.list - * @desc Lists the history of the service configuration for a managed service, - * from the newest to the oldest. - * @alias servicemanagement.services.configs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The max number of items to include in the response list. - * @param {string=} params.pageToken The token of the page to retrieve. - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/configs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for UndeleteService method. + */ + export interface Schema$UndeleteServiceResponse { + /** + * Revived service resource. + */ + service: Schema$ManagedService; } - - /** - * servicemanagement.services.configs.submit - * @desc Creates a new service configuration (version) for a managed service - * based on user-supplied configuration source files (for example: OpenAPI - * Specification). This method stores the source configurations as well as the - * generated service configuration. To rollout the service configuration to - * other services, please call CreateServiceRollout. Only the 100 most recent - * configuration sources and ones referenced by existing service configurtions - * are kept for each service. The rest will be deleted eventually. - * Operation - * @alias servicemanagement.services.configs.submit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {().SubmitConfigSourceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submit(params?: any, options?: MethodOptions): AxiosPromise; - submit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - submit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/configs:submit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Services$Consumers { - root: Servicemanagement; - constructor(root: Servicemanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * Configuration controlling usage of a service. + */ + export interface Schema$Usage { + /** + * The full resource name of a channel used for sending notifications to the + * service producer. Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the + * name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name + * format documented in https://cloud.google.com/pubsub/docs/overview. + */ + producerNotificationChannel: string; + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form + * <service.name>/<requirement-id>; for example + * 'serviceusage.googleapis.com/billing-enabled'. + */ + requirements: string[]; + /** + * A list of usage rules that apply to individual API methods. **NOTE:** + * All service configuration rules follow "last one wins" order. + */ + rules: Schema$UsageRule[]; } - - /** - * servicemanagement.services.consumers.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias servicemanagement.services.consumers.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Usage configuration rules for the service. NOTE: Under development. Use + * this rule to configure unregistered calls for the service. Unregistered + * calls are calls that do not contain consumer project identity. (Example: + * calls that do not contain an API key). By default, API methods do not allow + * unregistered calls, and each method call must be identified by a consumer + * project identity. Use this rule to allow/disallow unregistered calls. + * Example of an API that wants to allow unregistered calls for entire + * service. usage: rules: - selector: "*" + * allow_unregistered_calls: true Example of a method that wants to allow + * unregistered calls. usage: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allow_unregistered_calls: true + */ + export interface Schema$UsageRule { + /** + * If true, the selected method allows unregistered calls, e.g. calls that + * don't identify any user or application. + */ + allowUnregisteredCalls: boolean; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. This + * flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + */ + skipServiceControl: boolean; } - - /** - * servicemanagement.services.consumers.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias servicemanagement.services.consumers.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Operations { + root: Servicemanagement; + constructor(root: Servicemanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * servicemanagement.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias servicemanagement.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.operations.list + * @desc Lists service operations that match the specified filter in the + * request. + * @alias servicemanagement.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A string for filtering Operations. The following filter fields are supported: * serviceName: Required. Only `=` operator is allowed. * startTime: The time this job was started, in ISO 8601 format. Allowed operators are `>=`, `>`, `<=`, and `<`. * status: Can be `done`, `in_progress`, or `failed`. Allowed operators are `=`, and `!=`. Filter expression supports conjunction (AND) and disjunction (OR) logical operators. However, the serviceName restriction must be at the top-level and can only be combined with other restrictions via the AND logical operator. Examples: * `serviceName={some-service}.googleapis.com` * `serviceName={some-service}.googleapis.com AND startTime>="2017-02-01"` * `serviceName={some-service}.googleapis.com AND status=done` * `serviceName={some-service}.googleapis.com AND (status=done OR startTime>="2017-02-01")` + * @param {string=} params.name Not used. + * @param {integer=} params.pageSize The maximum number of operations to return. If unspecified, defaults to 50. The maximum value is 100. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * servicemanagement.services.consumers.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. Note: This operation is designed to be used for - * building permission-aware UIs and command-line tools, not for authorization - * checking. This operation may "fail open" without warning. - * @alias servicemanagement.services.consumers.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Services { + root: Servicemanagement; + configs: Resource$Services$Configs; + consumers: Resource$Services$Consumers; + rollouts: Resource$Services$Rollouts; + constructor(root: Servicemanagement) { + this.root = root; + this.getRoot.bind(this); + this.configs = new Resource$Services$Configs(root); + this.consumers = new Resource$Services$Consumers(root); + this.rollouts = new Resource$Services$Rollouts(root); + } + + getRoot() { + return this.root; + } + + + /** + * servicemanagement.services.create + * @desc Creates a new managed service. Please note one producer project can + * own no more than 20 services. Operation + * @alias servicemanagement.services.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().ManagedService} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.delete + * @desc Deletes a managed service. This method will change the service to + * the `Soft-Delete` state for 30 days. Within this period, service + * producers may call UndeleteService to restore the service. After 30 days, + * the service will be permanently deleted. Operation + * @alias servicemanagement.services.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.disable + * @desc Disables a service for a project, so it can no longer be be used + * for the project. It prevents accidental usage that may cause unexpected + * billing charges or security leaks. Operation + * @alias servicemanagement.services.disable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service to disable. Specifying an unknown service name will cause the request to fail. + * @param {().DisableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disable(params?: any, options?: MethodOptions): + AxiosPromise; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:disable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.enable + * @desc Enables a service for a project, so it can be used for the project. + * See [Cloud Auth Guide](https://cloud.google.com/docs/authentication) for + * more information. Operation + * @alias servicemanagement.services.enable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName Name of the service to enable. Specifying an unknown service name will cause the request to fail. + * @param {().EnableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enable(params?: any, options?: MethodOptions): + AxiosPromise; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:enable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.generateConfigReport + * @desc Generates and returns a report (errors, warnings and changes from + * existing configurations) associated with + * GenerateConfigReportRequest.new_value If + * GenerateConfigReportRequest.old_value is specified, + * GenerateConfigReportRequest will contain a single ChangeReport based on + * the comparison between GenerateConfigReportRequest.new_value and + * GenerateConfigReportRequest.old_value. If + * GenerateConfigReportRequest.old_value is not specified, this method will + * compare GenerateConfigReportRequest.new_value with the last pushed + * service configuration. + * @alias servicemanagement.services.generateConfigReport + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GenerateConfigReportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + generateConfigReport(params?: any, options?: MethodOptions): + AxiosPromise; + generateConfigReport( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + generateConfigReport( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services:generateConfigReport') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * servicemanagement.services.get + * @desc Gets a managed service. Authentication is required unless the + * service is public. + * @alias servicemanagement.services.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the `ServiceManager` overview for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.getConfig + * @desc Gets a service configuration (version) for a managed service. + * @alias servicemanagement.services.getConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.configId The id of the service configuration resource. + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {string=} params.view Specifies which parts of the Service Config should be returned in the response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getConfig(params?: any, options?: MethodOptions): + AxiosPromise; + getConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/config') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias servicemanagement.services.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.list + * @desc Lists managed services. Returns all public services. For + * authenticated users, also returns all services the calling user has + * "servicemanagement.services.get" permission for. **BETA:** If the caller + * specifies the `consumer_id`, it returns only the services enabled on the + * consumer. The `consumer_id` must have the format of + * "project:{PROJECT-ID}". + * @alias servicemanagement.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.consumerId Include services consumed by the specified consumer. The Google Service Management implementation accepts the following forms: - project: + * @param {integer=} params.pageSize Requested size of the next page of data. + * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. + * @param {string=} params.producerProjectId Include services produced by the specified project. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias servicemanagement.services.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias servicemanagement.services.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.undelete + * @desc Revives a previously deleted managed service. The method restores + * the service using the configuration at the time the service was deleted. + * The target service must exist and must have been deleted within the last + * 30 days. Operation + * @alias servicemanagement.services.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Services$Rollouts { - root: Servicemanagement; - constructor(root: Servicemanagement) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; } - - - /** - * servicemanagement.services.rollouts.create - * @desc Creates a new service configuration rollout. Based on rollout, the - * Google Service Management will roll out the service configurations to - * different backend services. For example, the logging configuration will be - * pushed to Google Cloud Logging. Please note that any previous pending and - * running Rollouts and associated Operations will be automatically cancelled - * so that the latest Rollout will not be blocked by previous Rollouts. Only - * the 100 most recent (in any state) and the last 10 successful (if not - * already part of the set of 100 most recent) rollouts are kept for each - * service. The rest will be deleted eventually. Operation - * @alias servicemanagement.services.rollouts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {().Rollout} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/rollouts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Services$Configs { + root: Servicemanagement; + constructor(root: Servicemanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * servicemanagement.services.configs.create + * @desc Creates a new service configuration (version) for a managed + * service. This method only stores the service configuration. To roll out + * the service configuration to backend systems please call + * CreateServiceRollout. Only the 100 most recent service configurations + * and ones referenced by existing rollouts are kept for each service. The + * rest will be deleted eventually. + * @alias servicemanagement.services.configs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {().Service} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/configs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.configs.get + * @desc Gets a service configuration (version) for a managed service. + * @alias servicemanagement.services.configs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.configId The id of the service configuration resource. + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {string=} params.view Specifies which parts of the Service Config should be returned in the response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/configs/{configId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName', 'configId'], + pathParams: ['configId', 'serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.configs.list + * @desc Lists the history of the service configuration for a managed + * service, from the newest to the oldest. + * @alias servicemanagement.services.configs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The max number of items to include in the response list. + * @param {string=} params.pageToken The token of the page to retrieve. + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/configs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.configs.submit + * @desc Creates a new service configuration (version) for a managed service + * based on user-supplied configuration source files (for example: OpenAPI + * Specification). This method stores the source configurations as well as + * the generated service configuration. To rollout the service configuration + * to other services, please call CreateServiceRollout. Only the 100 most + * recent configuration sources and ones referenced by existing service + * configurtions are kept for each service. The rest will be deleted + * eventually. Operation + * @alias servicemanagement.services.configs.submit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {().SubmitConfigSourceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submit(params?: any, options?: MethodOptions): + AxiosPromise; + submit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + submit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/configs:submit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * servicemanagement.services.rollouts.get - * @desc Gets a service configuration rollout. - * @alias servicemanagement.services.rollouts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.rolloutId The id of the rollout resource. - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/rollouts/{rolloutId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName', 'rolloutId'], - pathParams: ['rolloutId', 'serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Services$Consumers { + root: Servicemanagement; + constructor(root: Servicemanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * servicemanagement.services.consumers.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias servicemanagement.services.consumers.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.consumers.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias servicemanagement.services.consumers.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.consumers.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. Note: This operation is designed to + * be used for building permission-aware UIs and command-line tools, not for + * authorization checking. This operation may "fail open" without warning. + * @alias servicemanagement.services.consumers.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * servicemanagement.services.rollouts.list - * @desc Lists the history of the service configuration rollouts for a managed - * service, from the newest to the oldest. - * @alias servicemanagement.services.rollouts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Use `filter` to return subset of rollouts. The following filters are supported: -- To limit the results to only those in [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', use filter='status=SUCCESS' -- To limit the results to those in [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' or 'FAILED', use filter='status=CANCELLED OR status=FAILED' - * @param {integer=} params.pageSize The max number of items to include in the response list. - * @param {string=} params.pageToken The token of the page to retrieve. - * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://servicemanagement.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/services/{serviceName}/rollouts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['serviceName'], - pathParams: ['serviceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Services$Rollouts { + root: Servicemanagement; + constructor(root: Servicemanagement) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * servicemanagement.services.rollouts.create + * @desc Creates a new service configuration rollout. Based on rollout, the + * Google Service Management will roll out the service configurations to + * different backend services. For example, the logging configuration will + * be pushed to Google Cloud Logging. Please note that any previous pending + * and running Rollouts and associated Operations will be automatically + * cancelled so that the latest Rollout will not be blocked by previous + * Rollouts. Only the 100 most recent (in any state) and the last 10 + * successful (if not already part of the set of 100 most recent) rollouts + * are kept for each service. The rest will be deleted eventually. + * Operation + * @alias servicemanagement.services.rollouts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {().Rollout} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/rollouts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.rollouts.get + * @desc Gets a service configuration rollout. + * @alias servicemanagement.services.rollouts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.rolloutId The id of the rollout resource. + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/rollouts/{rolloutId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName', 'rolloutId'], + pathParams: ['rolloutId', 'serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * servicemanagement.services.rollouts.list + * @desc Lists the history of the service configuration rollouts for a + * managed service, from the newest to the oldest. + * @alias servicemanagement.services.rollouts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Use `filter` to return subset of rollouts. The following filters are supported: -- To limit the results to only those in [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', use filter='status=SUCCESS' -- To limit the results to those in [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' or 'FAILED', use filter='status=CANCELLED OR status=FAILED' + * @param {integer=} params.pageSize The max number of items to include in the response list. + * @param {string=} params.pageToken The token of the page to retrieve. + * @param {string} params.serviceName The name of the service. See the [overview](/service-management/overview) for naming requirements. For example: `example.googleapis.com`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://servicemanagement.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services/{serviceName}/rollouts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['serviceName'], + pathParams: ['serviceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/serviceusage/v1beta1.ts b/src/apis/serviceusage/v1beta1.ts index 2788ab1d6ee..6b40ebf3553 100644 --- a/src/apis/serviceusage/v1beta1.ts +++ b/src/apis/serviceusage/v1beta1.ts @@ -27,2552 +27,2585 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Service Usage API - * - * Enables services that service consumers want to use on Google Cloud Platform, - * lists the available or enabled services, or disables services that service - * consumers no longer use. - * - * @example - * const google = require('googleapis'); - * const serviceusage = google.serviceusage('v1beta1'); - * - * @namespace serviceusage - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Serviceusage - */ -export class Serviceusage { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - operations: Resource$Operations; - services: Resource$Services; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.operations = new Resource$Operations(this); - this.services = new Resource$Services(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Api is a light-weight descriptor for an API Interface. Interfaces are also - * described as "protocol buffer services" in some contexts, such as - * by the "service" keyword in a .proto file, but they are different - * from API Services, which represent a concrete implementation of an interface - * as opposed to simply a description of methods and bindings. They are also - * sometimes simply referred to as "APIs" in other contexts, such as - * the name of this message itself. See - * https://cloud.google.com/apis/design/glossary for detailed terminology. - */ -export interface Schema$Api { - /** - * The methods of this interface, in unspecified order. - */ - methods: Schema$Method[]; - /** - * Included interfaces. See Mixin. - */ - mixins: Schema$Mixin[]; - /** - * The fully qualified name of this interface, including package name followed - * by the interface's simple name. - */ - name: string; - /** - * Any metadata attached to the interface. - */ - options: Schema$Option[]; - /** - * Source context for the protocol buffer service represented by this message. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax of the service. - */ - syntax: string; - /** - * A version string for this interface. If specified, must have the form - * `major-version.minor-version`, as in `1.10`. If the minor version is - * omitted, it defaults to zero. If the entire version field is empty, the - * major version is derived from the package name, as outlined below. If the - * field is not empty, the version in the package name will be verified to be - * consistent with what is provided here. The versioning schema uses - * [semantic versioning](http://semver.org) where the major version number - * indicates a breaking change and the minor version an additive, non-breaking - * change. Both version numbers are signals to users what to expect from - * different versions, and should be carefully chosen based on the product - * plan. The major version is also reflected in the package name of the - * interface, which must end in `v<major-version>`, as in - * `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. - * Zero major versions must only be used for experimental, non-GA interfaces. - */ - version: string; -} -/** - * `Authentication` defines the authentication configuration for an API. Example - * for an API targeted for external use: name: calendar.googleapis.com - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Authentication { - /** - * Defines a set of authentication providers that a service supports. - */ - providers: Schema$AuthProvider[]; - /** - * A list of authentication rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$AuthenticationRule[]; -} -/** - * Authentication rules for the service. By default, if a method has any - * authentication requirements, every request must include a valid credential - * matching one of the requirements. It's an error to include more than one - * kind of credential in a single request. If a method doesn't have any - * auth requirements, request credentials will be ignored. - */ -export interface Schema$AuthenticationRule { - /** - * If true, the service accepts API keys without any other credential. - */ - allowWithoutCredential: boolean; - /** - * Configuration for custom authentication. - */ - customAuth: Schema$CustomAuthRequirements; - /** - * The requirements for OAuth credentials. - */ - oauth: Schema$OAuthRequirements; - /** - * Requirements for additional authentication providers. - */ - requirements: Schema$AuthRequirement[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration of authorization. This section determines the authorization - * provider, if unspecified, then no authorization check will be done. Example: - * experimental: authorization: provider: - * firebaserules.googleapis.com - */ -export interface Schema$AuthorizationConfig { - /** - * The name of the authorization provider, such as - * firebaserules.googleapis.com. - */ - provider: string; -} -/** - * Authorization rule for API services. It specifies the permission(s) required - * for an API element for the overall API request to succeed. It is typically - * used to mark request message fields that contain the name of the resource and - * indicates the permissions that will be checked on that resource. For - * example: package google.storage.v1; message CopyObjectRequest { - * string source = 1 [ (google.api.authz).permissions = - * "storage.objects.get"]; string destination = 2 [ - * (google.api.authz).permissions = - * "storage.objects.create,storage.objects.update"]; } - */ -export interface Schema$AuthorizationRule { - /** - * The required permissions. The acceptable values vary depend on the - * authorization system used. For Google APIs, it should be a comma-separated - * Google IAM permission values. When multiple permissions are listed, the - * semantics is not defined by the system. Additional documentation must be - * provided manually. - */ - permissions: string; - /** - * Selects the API elements to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration for an anthentication provider, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthProvider { - /** - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * Redirect URL if JWT token is required but no present or is expired. - * Implement authorizationUrl of securityDefinitions in OpenAPI spec. - */ - authorizationUrl: string; - /** - * The unique identifier of the auth provider. It will be referred to by - * `AuthRequirement.provider_id`. Example: "bookstore_auth". - */ - id: string; - /** - * Identifies the principal that issued the JWT. See - * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - * Usually a URL or an email address. Example: https://securetoken.google.com - * Example: 1234567-compute@developer.gserviceaccount.com - */ - issuer: string; - /** - * URL of the provider's public key set to validate signature of the JWT. - * See [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - * Optional if the key set document: - can be retrieved from [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of - * the issuer. - can be inferred from the email domain of the issuer (e.g. a - * Google service account). Example: - * https://www.googleapis.com/oauth2/v1/certs - */ - jwksUri: string; -} -/** - * User-defined authentication requirements, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthRequirement { - /** - * NOTE: This will be deprecated soon, once AuthProvider.audiences is - * implemented and accepted in all the runtime components. The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * id from authentication provider. Example: provider_id: bookstore_auth - */ - providerId: string; -} -/** - * `Backend` defines the backend configuration for a service. - */ -export interface Schema$Backend { - /** - * A list of API backend rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$BackendRule[]; -} -/** - * A backend rule provides configuration for an individual API element. - */ -export interface Schema$BackendRule { - /** - * The address of the API backend. - */ - address: string; - /** - * The number of seconds to wait for a response from a request. The default - * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds. - */ - deadline: number; - /** - * Minimum deadline in seconds needed for this method. Calls having deadline - * value lower than this will be rejected. - */ - minDeadline: number; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Request message for the `BatchEnableServices` method. - */ -export interface Schema$BatchEnableServicesRequest { - /** - * The identifiers of the services to enable on the project. A valid - * identifier would be: serviceusage.googleapis.com Enabling services - * requires that each service is public or is shared with the user enabling - * the service. Two or more services must be specified. To enable a single - * service, use the `EnableService` method instead. A single request can - * enable a maximum of 20 services at a time. If more than 20 services are - * specified, the request will fail, and no state changes will occur. - */ - serviceIds: string[]; -} -/** - * Billing related configuration of the service. The following example shows - * how to configure monitored resources and metrics for billing: - * monitored_resources: - type: library.googleapis.com/branch labels: - * - key: /city description: The city where the library branch is - * located in. - key: /name description: The name of the branch. - * metrics: - name: library.googleapis.com/book/borrowed_count metric_kind: - * DELTA value_type: INT64 billing: consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/borrowed_count - */ -export interface Schema$Billing { - /** - * Billing configurations for sending metrics to the consumer project. There - * can be multiple consumer destinations per service, each one must have a - * different monitored resource type. A metric can be used in at most one - * consumer destination. - */ - consumerDestinations: Schema$BillingDestination[]; -} -/** - * Configuration of a specific billing destination (Currently only support bill - * against consumer project). - */ -export interface Schema$BillingDestination { - /** - * Names of the metrics to report to this billing destination. Each name must - * be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * `Context` defines which contexts an API requests. Example: context: - * rules: - selector: "*" requested: - - * google.rpc.context.ProjectContext - google.rpc.context.OriginContext - * The above specifies that all methods in the API request - * `google.rpc.context.ProjectContext` and `google.rpc.context.OriginContext`. - * Available context types are defined in package `google.rpc.context`. This - * also provides mechanism to whitelist any protobuf message extension that can - * be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and - * “x-goog-ext-<extension_id>-jspb” format. For example, list any service - * specific protobuf types that can appear in grpc metadata as follows in your - * yaml file: Example: context: rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allowed_request_extensions: - google.foo.v1.NewExtension - * allowed_response_extensions: - google.foo.v1.NewExtension You can - * also specify extension ID instead of fully qualified extension name here. - */ -export interface Schema$Context { - /** - * A list of RPC context rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$ContextRule[]; -} -/** - * A context rule provides information about the context for an individual API - * element. - */ -export interface Schema$ContextRule { - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from client to backend. - */ - allowedRequestExtensions: string[]; - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from backend to client. - */ - allowedResponseExtensions: string[]; - /** - * A list of full type names of provided contexts. - */ - provided: string[]; - /** - * A list of full type names of requested contexts. - */ - requested: string[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Selects and configures the service controller used by the service. The - * service controller handles features like abuse, quota, billing, logging, - * monitoring, etc. - */ -export interface Schema$Control { - /** - * The service control environment to use. If empty, no control plane feature - * (like quota and billing) will be enabled. - */ - environment: string; -} -/** - * Configuration for a custom authentication provider. - */ -export interface Schema$CustomAuthRequirements { - /** - * A configuration string containing connection information for the - * authentication provider, typically formatted as a SmartService string - * (go/smartservice). - */ - provider: string; -} -/** - * Customize service error responses. For example, list any service specific - * protobuf types that can appear in error detail lists of error responses. - * Example: custom_error: types: - google.foo.v1.CustomError - - * google.foo.v1.AnotherError - */ -export interface Schema$CustomError { - /** - * The list of custom error rules that apply to individual API messages. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$CustomErrorRule[]; - /** - * The list of custom error detail types, e.g. - * 'google.foo.v1.CustomError'. - */ - types: string[]; -} -/** - * A custom error rule. - */ -export interface Schema$CustomErrorRule { - /** - * Mark this message as possible payload in error response. Otherwise, - * objects of this type will be filtered when they appear in error payload. - */ - isErrorType: boolean; - /** - * Selects messages to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A custom pattern is used for defining custom HTTP verb. - */ -export interface Schema$CustomHttpPattern { - /** - * The name of this custom HTTP verb. - */ - kind: string; - /** - * The path matched by this custom verb. - */ - path: string; -} -/** - * Request message for the `DisableService` method. - */ -export interface Schema$DisableServiceRequest {} -/** - * `Documentation` provides the information for describing a service. Example: - * <pre><code>documentation: summary: > The Google Calendar - * API gives access to most calendar features. pages: - name: Overview - * content: &#40;== include google/foo/overview.md ==&#41; - name: - * Tutorial content: &#40;== include google/foo/tutorial.md ==&#41; - * subpages; - name: Java content: &#40;== include - * google/foo/tutorial_java.md ==&#41; rules: - selector: - * google.calendar.Calendar.Get description: > ... - selector: - * google.calendar.Calendar.Put description: > ... - * </code></pre> Documentation is provided in markdown syntax. In - * addition to standard markdown features, definition lists, tables and fenced - * code blocks are supported. Section headers can be provided and are - * interpreted relative to the section nesting of the context where a - * documentation fragment is embedded. Documentation from the IDL is merged - * with documentation defined via the config at normalization time, where - * documentation provided by config rules overrides IDL provided. A number of - * constructs specific to the API platform are supported in documentation text. - * In order to reference a proto element, the following notation can be used: - * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> - * To override the display text used for the link, this can be used: - * <pre><code>&#91;display - * text]&#91;fully.qualified.proto.name]</code></pre> Text can - * be excluded from doc using the following notation: - * <pre><code>&#40;-- internal comment - * --&#41;</code></pre> A few directives are available in - * documentation. Note that directives must appear on a single line to be - * properly identified. The `include` directive includes a markdown file from an - * external source: <pre><code>&#40;== include path/to/file - * ==&#41;</code></pre> The `resource_for` directive marks a - * message to be the resource of a collection in REST view. If it is not - * specified, tools attempt to infer the resource from the operations in a - * collection: <pre><code>&#40;== resource_for v1.shelves.books - * ==&#41;</code></pre> The directive `suppress_warning` does - * not directly affect documentation and is documented together with service - * config validation. - */ -export interface Schema$Documentation { - /** - * The URL to the root of documentation. - */ - documentationRootUrl: string; - /** - * Declares a single overview page. For example: - * <pre><code>documentation: summary: ... overview: - * &#40;== include overview.md ==&#41; </code></pre> This - * is a shortcut for the following declaration (using pages style): - * <pre><code>documentation: summary: ... pages: - name: - * Overview content: &#40;== include overview.md ==&#41; - * </code></pre> Note: you cannot specify both `overview` field - * and `pages` field. - */ - overview: string; - /** - * The top level pages for the documentation set. - */ - pages: Schema$Page[]; - /** - * A list of documentation rules that apply to individual API elements. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$DocumentationRule[]; - /** - * A short summary of what the service does. Can only be provided by plain - * text. - */ - summary: string; -} -/** - * A documentation rule provides information about individual API elements. - */ -export interface Schema$DocumentationRule { - /** - * Deprecation description of the selected element(s). It can be provided if - * an element is marked as `deprecated`. - */ - deprecationDescription: string; - /** - * Description of the selected API(s). - */ - description: string; - /** - * The selector is a comma-separated list of patterns. Each pattern is a - * qualified name of the element which may end in "*", indicating a - * wildcard. Wildcards are only allowed at the end and for a whole component - * of the qualified name, i.e. "foo.*" is ok, but not - * "foo.b*" or "foo.*.bar". To specify a default for all - * applicable elements, the whole pattern "*" is used. - */ - selector: string; -} -/** - * Request message for the `EnableService` method. - */ -export interface Schema$EnableServiceRequest {} -/** - * `Endpoint` describes a network endpoint that serves a set of APIs. A service - * may expose any number of endpoints, and all endpoints share the same service - * configuration, such as quota configuration and monitoring configuration. - * Example service configuration: name: library-example.googleapis.com - * endpoints: # Below entry makes - * 'google.example.library.v1.Library' # API be served from - * endpoint address library-example.googleapis.com. # It also allows HTTP - * OPTIONS calls to be passed to the backend, for # it to decide whether - * the subsequent cross-origin request is # allowed to proceed. - - * name: library-example.googleapis.com allow_cors: true - */ -export interface Schema$Endpoint { - /** - * DEPRECATED: This field is no longer supported. Instead of using aliases, - * please specify multiple google.api.Endpoint for each of the intended - * aliases. Additional names that this endpoint will be hosted on. - */ - aliases: string[]; - /** - * Allowing - * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - * cross-domain traffic, would allow the backends served from this endpoint to - * receive and respond to HTTP OPTIONS requests. The response will be used by - * the browser to determine whether the subsequent cross-origin request is - * allowed to proceed. - */ - allowCors: boolean; - /** - * The list of features enabled on this endpoint. - */ - features: string[]; - /** - * The canonical name of this endpoint. - */ - name: string; - /** - * The specification of an Internet routable address of API frontend that will - * handle requests to this [API - * Endpoint](https://cloud.google.com/apis/design/glossary). It should be - * either a valid IPv4 address or a fully-qualified domain name. For example, - * "8.8.8.8" or "myservice.appspot.com". - */ - target: string; -} -/** - * Enum type definition. - */ -export interface Schema$Enum { - /** - * Enum value definitions. - */ - enumvalue: Schema$EnumValue[]; - /** - * Enum type name. - */ - name: string; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; - /** - * The source context. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax. - */ - syntax: string; -} -/** - * Enum value definition. - */ -export interface Schema$EnumValue { - /** - * Enum value name. - */ - name: string; - /** - * Enum value number. - */ - number: number; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; -} -/** - * Experimental service configuration. These configuration options can only be - * used by whitelisted users. - */ -export interface Schema$Experimental { - /** - * Authorization configuration. - */ - authorization: Schema$AuthorizationConfig; -} -/** - * A single field of a message type. - */ -export interface Schema$Field { - /** - * The field cardinality. - */ - cardinality: string; - /** - * The string value of the default value of this field. Proto2 syntax only. - */ - defaultValue: string; - /** - * The field JSON name. - */ - jsonName: string; - /** - * The field type. - */ - kind: string; - /** - * The field name. - */ - name: string; - /** - * The field number. - */ - number: number; - /** - * The index of the field type in `Type.oneofs`, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ - oneofIndex: number; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * Whether to use alternative packed wire representation. - */ - packed: boolean; - /** - * The field type URL, without the scheme, for message or enumeration types. - * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - */ - typeUrl: string; -} -/** - * `Service` is the root object of Google service configuration schema. It - * describes basic information about a service, such as the name and the title, - * and delegates other aspects to sub-sections. Each sub-section is either a - * proto message or a repeated proto message that configures a specific aspect, - * such as auth. See each proto message definition for details. Example: type: - * google.api.Service config_version: 3 name: calendar.googleapis.com - * title: Google Calendar API apis: - name: google.calendar.v3.Calendar - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$GoogleApiService { - /** - * A list of API interfaces exported by this service. Only the `name` field of - * the google.protobuf.Api needs to be provided by the configuration author, - * as the remaining fields will be derived from the IDL during the - * normalization process. It is an error to specify an API interface here - * which cannot be resolved against the associated IDL files. - */ - apis: Schema$Api[]; - /** - * Auth configuration. - */ - authentication: Schema$Authentication; - /** - * API backend configuration. - */ - backend: Schema$Backend; - /** - * Billing configuration. - */ - billing: Schema$Billing; - /** - * The semantic version of the service configuration. The config version - * affects the interpretation of the service configuration. For example, - * certain features are enabled by default for certain config versions. The - * latest config version is `3`. - */ - configVersion: number; - /** - * Context configuration. - */ - context: Schema$Context; - /** - * Configuration for the service control plane. - */ - control: Schema$Control; - /** - * Custom error configuration. - */ - customError: Schema$CustomError; - /** - * Additional API documentation. - */ - documentation: Schema$Documentation; - /** - * Configuration for network endpoints. If this is empty, then an endpoint - * with the same name as the service is automatically generated to service all - * defined APIs. - */ - endpoints: Schema$Endpoint[]; - /** - * A list of all enum types included in this API service. Enums referenced - * directly or indirectly by the `apis` are automatically included. Enums - * which are not referenced but shall be included should be listed here by - * name. Example: enums: - name: google.someapi.v1.SomeEnum - */ - enums: Schema$Enum[]; - /** - * Experimental configuration. - */ - experimental: Schema$Experimental; - /** - * HTTP configuration. - */ - http: Schema$Http; - /** - * A unique ID for a specific instance of this message, typically assigned by - * the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ - id: string; - /** - * Logging configuration. - */ - logging: Schema$Logging; - /** - * Defines the logs used by this service. - */ - logs: Schema$LogDescriptor[]; - /** - * Defines the metrics used by this service. - */ - metrics: Schema$MetricDescriptor[]; - /** - * Defines the monitored resources used by this service. This is required by - * the Service.monitoring and Service.logging configurations. - */ - monitoredResources: Schema$MonitoredResourceDescriptor[]; - /** - * Monitoring configuration. - */ - monitoring: Schema$Monitoring; - /** - * The DNS address at which this service is available, e.g. - * `calendar.googleapis.com`. - */ - name: string; - /** - * The Google project that owns this service. - */ - producerProjectId: string; - /** - * Quota configuration. - */ - quota: Schema$Quota; - /** - * Output only. The source information for this configuration if available. - */ - sourceInfo: Schema$SourceInfo; - /** - * System parameter configuration. - */ - systemParameters: Schema$SystemParameters; - /** - * A list of all proto message types included in this API service. It serves - * similar purpose as [google.api.Service.types], except that these types are - * not needed by user-defined APIs. Therefore, they will not show up in the - * generated discovery doc. This field should only be used to define system - * APIs in ESF. - */ - systemTypes: Schema$Type[]; - /** - * The product title for this service. - */ - title: string; - /** - * A list of all proto message types included in this API service. Types - * referenced directly or indirectly by the `apis` are automatically included. - * Messages which are not referenced but shall be included, such as types used - * by the `google.protobuf.Any` type, should be listed here by name. Example: - * types: - name: google.protobuf.Int32 - */ - types: Schema$Type[]; - /** - * Configuration controlling usage of this service. - */ - usage: Schema$Usage; -} -/** - * Defines the HTTP configuration for an API service. It contains a list of - * HttpRule, each specifying the mapping of an RPC method to one or more HTTP - * REST API methods. - */ -export interface Schema$Http { - /** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where - * "%2F" will be left encoded. The default behavior is to not - * decode RFC 6570 reserved characters in multi segment matches. - */ - fullyDecodeReservedExpansion: boolean; - /** - * A list of HTTP configuration rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$HttpRule[]; -} -/** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST API - * methods. The mapping specifies how different portions of the RPC request - * message are mapped to URL path, URL query parameters, and HTTP request body. - * The mapping is typically specified as an `google.api.http` annotation on the - * RPC method, see "google/api/annotations.proto" for details. The - * mapping consists of a field specifying the path template and method kind. The - * path template can refer to fields in the request message, as in the example - * below which describes a REST GET operation on a resource collection of - * messages: service Messaging { rpc GetMessage(GetMessageRequest) - * returns (Message) { option (google.api.http).get = - * "/v1/messages/{message_id}/{sub.subfield}"; } } message - * GetMessageRequest { message SubMessage { string subfield = 1; - * } string message_id = 1; // mapped to the URL SubMessage sub = 2; - * // `sub.subfield` is url-mapped } message Message { string text - * = 1; // content of the resource } The same http annotation can - * alternatively be expressed inside the `GRPC API Configuration` YAML file. - * http: rules: - selector: - * <proto_package_name>.Messaging.GetMessage get: - * /v1/messages/{message_id}/{sub.subfield} This definition enables an - * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC - * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: - * "123456" sub: SubMessage(subfield: "foo"))` In general, - * not only fields but also field paths can be referenced from a path pattern. - * Fields mapped to the path pattern cannot be repeated and must have a - * primitive (non-message) type. Any fields in the request message which are - * not bound by the path pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: service - * Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}"; } - * } message GetMessageRequest { message SubMessage { string - * subfield = 1; } string message_id = 1; // mapped to the URL int64 - * revision = 2; // becomes a parameter SubMessage sub = 3; // - * `sub.subfield` becomes a parameter } This enables a HTTP JSON to RPC - * mapping as below: HTTP | RPC -----|----- `GET - * /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: - * SubMessage(subfield: "foo"))` Note that fields which are mapped to - * HTTP parameters must have a primitive type or a repeated primitive type. - * Message types are not allowed. In the case of a repeated type, the parameter - * can be repeated in the URL, as in `...?param=A&param=B`. For HTTP method - * kinds which allow a request body, the `body` field specifies the mapping. - * Consider a REST update method on the message resource collection: service - * Messaging { rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { put: - * "/v1/messages/{message_id}" body: "message" }; - * } } message UpdateMessageRequest { string message_id = 1; // - * mapped to the URL Message message = 2; // mapped to the body } - * The following HTTP JSON to RPC mapping is enabled, where the representation - * of the JSON in the request body is determined by protos JSON encoding: HTTP - * | RPC -----|----- `PUT /v1/messages/123456 { "text": - * "Hi!" }` | `UpdateMessage(message_id: "123456" message { - * text: "Hi!" })` The special name `*` can be used in the body - * mapping to define that every field not bound by the path template should be - * mapped to the request body. This enables the following alternative - * definition of the update method: service Messaging { rpc - * UpdateMessage(Message) returns (Message) { option (google.api.http) = - * { put: "/v1/messages/{message_id}" body: - * "*" }; } } message Message { string - * message_id = 1; string text = 2; } The following HTTP JSON to RPC - * mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { - * "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` Note that when using `*` in the - * body mapping, it is not possible to have HTTP parameters, as all fields not - * bound by the path end in the body. This makes this option more rarely used in - * practice of defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. It is possible to - * define multiple HTTP methods for one RPC by using the `additional_bindings` - * option. Example: service Messaging { rpc - * GetMessage(GetMessageRequest) returns (Message) { option - * (google.api.http) = { get: "/v1/messages/{message_id}" - * additional_bindings { get: - * "/v1/users/{user_id}/messages/{message_id}" } }; - * } } message GetMessageRequest { string message_id = 1; string - * user_id = 2; } This enables the following two alternative HTTP JSON to - * RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | - * `GetMessage(message_id: "123456")` `GET - * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" - * message_id: "123456")` # Rules for HTTP mapping The rules for - * mapping HTTP path, query parameters, and body fields to the request message - * are as follows: 1. The `body` field specifies either `*` or a field path, or - * is omitted. If omitted, it indicates there is no HTTP request body. 2. - * Leaf fields (recursive expansion of nested messages in the request) can be - * classified into three types: (a) Matched in the URL template. (b) - * Covered by body (if body is `*`, everything except (a) fields; else - * everything under the body field) (c) All other fields. 3. URL query - * parameters found in the HTTP request are mapped to (c) fields. 4. Any body - * sent with an HTTP request can contain only (b) fields. The syntax of the - * path template is as follows: Template = "/" Segments [ Verb ] - * ; Segments = Segment { "/" Segment } ; Segment = - * "*" | "**" | LITERAL | Variable ; Variable = - * "{" FieldPath [ "=" Segments ] "}" ; FieldPath - * = IDENT { "." IDENT } ; Verb = ":" LITERAL ; The - * syntax `*` matches a single path segment. The syntax `**` matches zero or - * more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. The syntax - * `Variable` matches part of the URL path as specified by its template. A - * variable template must not contain other variables. If a variable matches a - * single path segment, its template may be omitted, e.g. `{var}` is equivalent - * to `{var=*}`. If a variable contains exactly one path segment, such as - * `"{var}"` or `"{var=*}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as `{var}`. - * If a variable contains one or more path segments, such as - * `"{var=foo/*}"` or `"{var=**}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~/0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as - * `{+var}`. NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** match RFC 6570 Reserved - * Expansion. The reason is that the Reserved Expansion does not expand special - * characters like `?` and `#`, which would lead to invalid URLs. NOTE: the - * field paths in variables and in the `body` must not refer to repeated fields - * or map fields. - */ -export interface Schema$HttpRule { - /** - * Additional HTTP bindings for the selector. Nested bindings must not contain - * an `additional_bindings` field themselves (that is, the nesting may only be - * one level deep). - */ - additionalBindings: Schema$HttpRule[]; - /** - * Specifies the permission(s) required for an API element for the overall API - * request to succeed. It is typically used to mark request message fields - * that contain the name of the resource and indicates the permissions that - * will be checked on that resource. - */ - authorizations: Schema$AuthorizationRule[]; - /** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. - */ - body: string; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave - * the HTTP method unspecified for this rule. The wild-card rule is useful for - * services that provide content to Web (HTML) clients. - */ - custom: Schema$CustomHttpPattern; - /** - * Used for deleting a resource. - */ - delete: string; - /** - * Used for listing and getting information about resources. - */ - get: string; - /** - * Use this only for Scotty Requests. Do not use this for bytestream methods. - * For media support, add instead [][google.bytestream.RestByteStream] as an - * API to your configuration. - */ - mediaDownload: Schema$MediaDownload; - /** - * Use this only for Scotty Requests. Do not use this for media support using - * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to - * your configuration for Bytestream methods. - */ - mediaUpload: Schema$MediaUpload; - /** - * Used for updating a resource. - */ - patch: string; - /** - * Used for creating a resource. - */ - post: string; - /** - * Used for updating a resource. - */ - put: string; - /** - * DO NOT USE. This is an experimental field. Optional. The REST collection - * name is by default derived from the URL pattern. If specified, this field - * overrides the default collection name. Example: rpc - * AddressesAggregatedList(AddressesAggregatedListRequest) returns - * (AddressesAggregatedListResponse) { option (google.api.http) = { get: - * "/v1/projects/{project_id}/aggregated/addresses" rest_collection: - * "projects.addresses" }; } This method has the - * automatically derived collection name "projects.aggregated". - * Because, semantically, this rpc is actually an operation on the - * "projects.addresses" collection, the `rest_collection` field is - * configured to override the derived collection name. - */ - restCollection: string; - /** - * DO NOT USE. This is an experimental field. Optional. The rest method name - * is by default derived from the URL pattern. If specified, this field - * overrides the default method name. Example: rpc - * CreateResource(CreateResourceRequest) returns - * (CreateResourceResponse) { option (google.api.http) = { post: - * "/v1/resources", body: "resource", - * rest_method_name: "insert" }; } This method has the - * automatically derived rest method name "create", but for - * backwards compatibility with apiary, it is specified as insert. - */ - restMethodName: string; - /** - * Selects methods to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response message for the `ListServices` method. - */ -export interface Schema$ListServicesResponse { - /** - * Token that can be passed to `ListServices` to resume a paginated query. - */ - nextPageToken: string; - /** - * The available services for the requested project. - */ - services: Schema$Service[]; -} -/** - * A description of a log type. Example in YAML format: - name: - * library.googleapis.com/activity_history description: The history of - * borrowing and returning library items. display_name: Activity labels: - * - key: /customer_id description: Identifier of a library customer - */ -export interface Schema$LogDescriptor { - /** - * A human-readable description of this log. This information appears in the - * documentation and can contain details. - */ - description: string; - /** - * The human-readable name for this log. This information appears on the user - * interface and should be concise. - */ - displayName: string; - /** - * The set of labels that are available to describe a specific log entry. - * Runtime requests that contain labels not specified here are considered - * invalid. - */ - labels: Schema$LabelDescriptor[]; - /** - * The name of the log. It must be less than 512 characters long and can - * include the following characters: upper- and lower-case alphanumeric - * characters [A-Za-z0-9], and punctuation characters including slash, - * underscore, hyphen, period [/_-.]. - */ - name: string; -} -/** - * Logging configuration of the service. The following example shows how to - * configure logs to be sent to the producer and consumer projects. In the - * example, the `activity_history` log is sent to both the producer and consumer - * projects, whereas the `purchase_history` log is only sent to the producer - * project. monitored_resources: - type: library.googleapis.com/branch - * labels: - key: /city description: The city where the library - * branch is located in. - key: /name description: The name of the - * branch. logs: - name: activity_history labels: - key: - * /customer_id - name: purchase_history logging: producer_destinations: - * - monitored_resource: library.googleapis.com/branch logs: - - * activity_history - purchase_history consumer_destinations: - - * monitored_resource: library.googleapis.com/branch logs: - - * activity_history - */ -export interface Schema$Logging { - /** - * Logging configurations for sending logs to the consumer project. There can - * be multiple consumer destinations, each one must have a different monitored - * resource type. A log can be used in at most one consumer destination. - */ - consumerDestinations: Schema$LoggingDestination[]; - /** - * Logging configurations for sending logs to the producer project. There can - * be multiple producer destinations, each one must have a different monitored - * resource type. A log can be used in at most one producer destination. - */ - producerDestinations: Schema$LoggingDestination[]; -} -/** - * Configuration of a specific logging destination (the producer project or the - * consumer project). - */ -export interface Schema$LoggingDestination { - /** - * Names of the logs to be sent to this destination. Each name must be defined - * in the Service.logs section. If the log name is not a domain scoped name, - * it will be automatically prefixed with the service name followed by - * "/". - */ - logs: string[]; - /** - * The monitored resource type. The type must be defined in the - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * Defines the Media configuration for a service in case of a download. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaDownload { - /** - * A boolean that determines whether a notification for the completion of a - * download should be sent to the backend. - */ - completeNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the download service if one is used for download. - */ - downloadService: string; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether download is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for direct download. The size is specified - * in bytes. - */ - maxDirectDownloadSize: string; - /** - * A boolean that determines if direct download from ESF should be used for - * download of this media. - */ - useDirectDownload: boolean; -} -/** - * Defines the Media configuration for a service in case of an upload. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaUpload { - /** - * A boolean that determines whether a notification for the completion of an - * upload should be sent to the backend. These notifications will not be seen - * by the client and will not consume quota. - */ - completeNotification: boolean; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether upload is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for an upload. The size is specified in - * bytes. - */ - maxSize: string; - /** - * An array of mimetype patterns. Esf will only accept uploads that match one - * of the given patterns. - */ - mimeTypes: string[]; - /** - * Whether to receive a notification for progress changes of media upload. - */ - progressNotification: boolean; - /** - * Whether to receive a notification on the start of media upload. - */ - startNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the upload service if one is used for upload. - */ - uploadService: string; -} -/** - * Method represents a method of an API interface. - */ -export interface Schema$Method { - /** - * The simple name of this method. - */ - name: string; - /** - * Any metadata attached to the method. - */ - options: Schema$Option[]; - /** - * If true, the request is streamed. - */ - requestStreaming: boolean; - /** - * A URL of the input message type. - */ - requestTypeUrl: string; - /** - * If true, the response is streamed. - */ - responseStreaming: boolean; - /** - * The URL of the output message type. - */ - responseTypeUrl: string; - /** - * The source syntax of this method. - */ - syntax: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric type has a - * label for the HTTP response code, `response_code`, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * `custom.googleapis.com`. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported - * units are a subset of [The Unified Code for Units of - * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units - * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute * - * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo (10**3) * - * `M` mega (10**6) * `G` giga (10**9) * `T` tera (10**12) * - * `P` peta (10**15) * `E` exa (10**18) * `Z` zetta - * (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * `u` micro - * (10**-6) * `n` nano (10**-9) * `p` pico (10**-12) * `f` femto - * (10**-15) * `a` atto (10**-18) * `z` zepto (10**-21) * `y` - * yocto (10**-24) * `Ki` kibi (2**10) * `Mi` mebi (2**20) * - * `Gi` gibi (2**30) * `Ti` tebi (2**40) **Grammar** The grammar - * also includes these connectors: * `/` division (as an infix operator, - * e.g. `1/s`). * `.` multiplication (as an infix operator, e.g. `GBy.d`) - * The grammar for a unit is as follows: Expression = Component { - * "." Component } { "/" Component } ; Component = ( - * [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation - * | "1" ; Annotation = "{" NAME - * "}" ; Notes: * `Annotation` is just a comment if it follows a - * `UNIT` and is equivalent to `1` if it is used alone. For examples, - * `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. * `NAME` is a sequence - * of non-blank printable ASCII characters not containing '{' or - * '}'. * `1` represents dimensionless value 1, such as in `1/s`. * - * `%` represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of `metric_kind` and `value_type` might not be supported. - */ - valueType: string; -} -/** - * Bind API methods to metrics. Binding a method to a metric causes that - * metric's configured quota behaviors to apply to the method call. - */ -export interface Schema$MetricRule { - /** - * Metrics to update when the selected methods are called, and the associated - * cost applied to each metric. The key of the map is the metric name, and - * the values are the amount increased for the metric against which the quota - * limits are defined. The value must not be negative. - */ - metricCosts: any; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Declares an API Interface to be included in this interface. The including - * interface must redeclare all the methods from the included interface, but - * documentation and options are inherited as follows: - If after comment and - * whitespace stripping, the documentation string of the redeclared method is - * empty, it will be inherited from the original method. - Each annotation - * belonging to the service config (http, visibility) which is not set in the - * redeclared method will be inherited. - If an http annotation is inherited, - * the path pattern will be modified as follows. Any version prefix will be - * replaced by the version of the including interface plus the root path if - * specified. Example of a simple mixin: package google.acl.v1; service - * AccessControl { // Get the underlying ACL object. rpc - * GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = - * "/v1/{resource=**}:getAcl"; } } package - * google.storage.v2; service Storage { // rpc - * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc - * GetData(GetDataRequest) returns (Data) { option (google.api.http).get - * = "/v2/{resource=**}"; } } Example of a mixin - * configuration: apis: - name: google.storage.v2.Storage mixins: - * - name: google.acl.v1.AccessControl The mixin construct implies that all - * methods in `AccessControl` are also declared with same name and - * request/response types in `Storage`. A documentation generator or annotation - * processor will see the effective `Storage.GetAcl` method after inherting - * documentation and annotations as follows: service Storage { // Get - * the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { - * option (google.api.http).get = "/v2/{resource=**}:getAcl"; } - * ... } Note how the version in the path pattern changed from `v1` to - * `v2`. If the `root` field in the mixin is specified, it should be a relative - * path under which inherited HTTP paths are placed. Example: apis: - - * name: google.storage.v2.Storage mixins: - name: - * google.acl.v1.AccessControl root: acls This implies the following - * inherited HTTP annotation: service Storage { // Get the underlying - * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option - * (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; } - * ... } - */ -export interface Schema$Mixin { - /** - * The fully qualified name of the interface which is included. - */ - name: string; - /** - * If non-empty specifies a path under which inherited HTTP paths are rooted. - */ - root: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource - * descriptor for Google Compute Engine VM instances has a type of - * `"gce_instance"` and specifies the use of the labels - * `"instance_id"` and `"zone"` to identify particular VM - * instances. Different APIs can support different monitored resource types. - * APIs generally provide a `list` method that returns the monitored resource - * descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { +export namespace serviceusage_v1beta1 { /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, `"Google Cloud - * SQL Database"`. - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and - * `"zone"`. - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` - * where {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - * The maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Monitoring configuration of the service. The example below shows how to - * configure monitored resources and metrics for monitoring. In the example, a - * monitored resource and two metrics are defined. The - * `library.googleapis.com/book/returned_count` metric is sent to both producer - * and consumer projects, whereas the - * `library.googleapis.com/book/overdue_count` metric is only sent to the - * consumer project. monitored_resources: - type: - * library.googleapis.com/branch labels: - key: /city description: - * The city where the library branch is located in. - key: /name - * description: The name of the branch. metrics: - name: - * library.googleapis.com/book/returned_count metric_kind: DELTA - * value_type: INT64 labels: - key: /customer_id - name: - * library.googleapis.com/book/overdue_count metric_kind: GAUGE - * value_type: INT64 labels: - key: /customer_id monitoring: - * producer_destinations: - monitored_resource: - * library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count - - * library.googleapis.com/book/overdue_count - */ -export interface Schema$Monitoring { - /** - * Monitoring configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one consumer - * destination. - */ - consumerDestinations: Schema$MonitoringDestination[]; - /** - * Monitoring configurations for sending metrics to the producer project. - * There can be multiple producer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one producer - * destination. - */ - producerDestinations: Schema$MonitoringDestination[]; -} -/** - * Configuration of a specific monitoring destination (the producer project or - * the consumer project). - */ -export interface Schema$MonitoringDestination { - /** - * Names of the metrics to report to this monitoring destination. Each name - * must be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * OAuth scopes are a way to define data and permissions on data. For example, - * there are scopes defined for "Read-only access to Google Calendar" - * and "Access to Cloud Platform". Users can consent to a scope for an - * application, giving it permission to access that data on their behalf. OAuth - * scope specifications should be fairly coarse grained; a user will need to see - * and understand the text description of what your scope means. In most cases: - * use one or at most two OAuth scopes for an entire family of products. If your - * product has multiple APIs, you should probably be sharing the OAuth scope - * across all of those APIs. When you need finer grained OAuth consent screens: - * talk with your product management about how developers will use them in - * practice. Please note that even though each of the canonical scopes is - * enough for a request to be accepted and passed to the backend, a request can - * still fail due to the backend requiring additional scopes or permissions. - */ -export interface Schema$OAuthRequirements { - /** - * The list of publicly documented OAuth scopes that are allowed access. An - * OAuth token containing any of these scopes will be accepted. Example: - * canonical_scopes: https://www.googleapis.com/auth/calendar, - * https://www.googleapis.com/auth/calendar.read - */ - canonicalScopes: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { + * Service Usage API + * + * Enables services that service consumers want to use on Google Cloud + * Platform, lists the available or enabled services, or disables services + * that service consumers no longer use. + * + * @example + * const google = require('googleapis'); + * const serviceusage = google.serviceusage('v1beta1'); + * + * @namespace serviceusage + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Serviceusage + */ + export class Serviceusage { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + operations: Resource$Operations; + services: Resource$Services; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.operations = new Resource$Operations(this); + this.services = new Resource$Services(this); + } + + getRoot() { + return this.root; + } + } + /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; + * Api is a light-weight descriptor for an API Interface. Interfaces are also + * described as "protocol buffer services" in some contexts, such as + * by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an + * interface as opposed to simply a description of methods and bindings. They + * are also sometimes simply referred to as "APIs" in other + * contexts, such as the name of this message itself. See + * https://cloud.google.com/apis/design/glossary for detailed terminology. + */ + export interface Schema$Api { + /** + * The methods of this interface, in unspecified order. + */ + methods: Schema$Method[]; + /** + * Included interfaces. See Mixin. + */ + mixins: Schema$Mixin[]; + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + */ + name: string; + /** + * Any metadata attached to the interface. + */ + options: Schema$Option[]; + /** + * Source context for the protocol buffer service represented by this + * message. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax of the service. + */ + syntax: string; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to + * be consistent with what is provided here. The versioning schema uses + * [semantic versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users what to + * expect from different versions, and should be carefully chosen based on + * the product plan. The major version is also reflected in the package + * name of the interface, which must end in `v<major-version>`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can be + * omitted. Zero major versions must only be used for experimental, non-GA + * interfaces. + */ + version: string; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; + * `Authentication` defines the authentication configuration for an API. + * Example for an API targeted for external use: name: + * calendar.googleapis.com authentication: providers: - id: + * google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Authentication { + /** + * Defines a set of authentication providers that a service supports. + */ + providers: Schema$AuthProvider[]; + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$AuthenticationRule[]; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Authentication rules for the service. By default, if a method has any + * authentication requirements, every request must include a valid credential + * matching one of the requirements. It's an error to include more than + * one kind of credential in a single request. If a method doesn't have + * any auth requirements, request credentials will be ignored. + */ + export interface Schema$AuthenticationRule { + /** + * If true, the service accepts API keys without any other credential. + */ + allowWithoutCredential: boolean; + /** + * Configuration for custom authentication. + */ + customAuth: Schema$CustomAuthRequirements; + /** + * The requirements for OAuth credentials. + */ + oauth: Schema$OAuthRequirements; + /** + * Requirements for additional authentication providers. + */ + requirements: Schema$AuthRequirement[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Configuration of authorization. This section determines the authorization + * provider, if unspecified, then no authorization check will be done. + * Example: experimental: authorization: provider: + * firebaserules.googleapis.com + */ + export interface Schema$AuthorizationConfig { + /** + * The name of the authorization provider, such as + * firebaserules.googleapis.com. + */ + provider: string; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The metadata associated with a long running operation resource. - */ -export interface Schema$OperationMetadata { + * Authorization rule for API services. It specifies the permission(s) + * required for an API element for the overall API request to succeed. It is + * typically used to mark request message fields that contain the name of the + * resource and indicates the permissions that will be checked on that + * resource. For example: package google.storage.v1; message + * CopyObjectRequest { string source = 1 [ + * (google.api.authz).permissions = "storage.objects.get"]; string + * destination = 2 [ (google.api.authz).permissions = + * "storage.objects.create,storage.objects.update"]; } + */ + export interface Schema$AuthorizationRule { + /** + * The required permissions. The acceptable values vary depend on the + * authorization system used. For Google APIs, it should be a + * comma-separated Google IAM permission values. When multiple permissions + * are listed, the semantics is not defined by the system. Additional + * documentation must be provided manually. + */ + permissions: string; + /** + * Selects the API elements to which this rule applies. Refer to selector + * for syntax details. + */ + selector: string; + } /** - * Percentage of completion of this operation, ranging from 0 to 100. - */ - progressPercentage: number; + * Configuration for an anthentication provider, including support for [JSON + * Web Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthProvider { + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * Redirect URL if JWT token is required but no present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + */ + authorizationUrl: string; + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. Example: "bookstore_auth". + */ + id: string; + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. Example: + * https://securetoken.google.com Example: + * 1234567-compute@developer.gserviceaccount.com + */ + issuer: string; + /** + * URL of the provider's public key set to validate signature of the + * JWT. See [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: - can be retrieved from [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of + * the issuer. - can be inferred from the email domain of the issuer (e.g. + * a Google service account). Example: + * https://www.googleapis.com/oauth2/v1/certs + */ + jwksUri: string; + } /** - * The full name of the resources that this operation is directly associated - * with. - */ - resourceNames: string[]; + * User-defined authentication requirements, including support for [JSON Web + * Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthRequirement { + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * id from authentication provider. Example: provider_id: + * bookstore_auth + */ + providerId: string; + } /** - * The start time of the operation. + * `Backend` defines the backend configuration for a service. */ - startTime: string; + export interface Schema$Backend { + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$BackendRule[]; + } /** - * Detailed status information for each step. The order is undetermined. - */ - steps: Schema$Step[]; -} -/** - * A protocol buffer option, which can be attached to a message, field, - * enumeration, etc. - */ -export interface Schema$Option { + * A backend rule provides configuration for an individual API element. + */ + export interface Schema$BackendRule { + /** + * The address of the API backend. + */ + address: string; + /** + * The number of seconds to wait for a response from a request. The default + * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 + * seconds. + */ + deadline: number; + /** + * Minimum deadline in seconds needed for this method. Calls having deadline + * value lower than this will be rejected. + */ + minDeadline: number; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, - * `"map_entry"`. For custom options, it should be the - * fully-qualified name. For example, `"google.api.http"`. - */ - name: string; + * Request message for the `BatchEnableServices` method. + */ + export interface Schema$BatchEnableServicesRequest { + /** + * The identifiers of the services to enable on the project. A valid + * identifier would be: serviceusage.googleapis.com Enabling services + * requires that each service is public or is shared with the user enabling + * the service. Two or more services must be specified. To enable a single + * service, use the `EnableService` method instead. A single request can + * enable a maximum of 20 services at a time. If more than 20 services are + * specified, the request will fail, and no state changes will occur. + */ + serviceIds: string[]; + } /** - * The option's value packed in an Any message. If the value is a - * primitive, the corresponding wrapper type defined in - * google/protobuf/wrappers.proto should be used. If the value is an enum, it - * should be stored as an int32 value using the google.protobuf.Int32Value - * type. - */ - value: any; -} -/** - * Represents a documentation page. A page can contain subpages to represent - * nested documentation set structure. - */ -export interface Schema$Page { + * Billing related configuration of the service. The following example shows + * how to configure monitored resources and metrics for billing: + * monitored_resources: - type: library.googleapis.com/branch labels: - + * key: /city description: The city where the library branch is + * located in. - key: /name description: The name of the branch. + * metrics: - name: library.googleapis.com/book/borrowed_count + * metric_kind: DELTA value_type: INT64 billing: + * consumer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/borrowed_count + */ + export interface Schema$Billing { + /** + * Billing configurations for sending metrics to the consumer project. There + * can be multiple consumer destinations per service, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$BillingDestination[]; + } /** - * The Markdown content of the page. You can use <code>&#40;== - * include {path} ==&#41;</code> to include content from a Markdown - * file. - */ - content: string; + * Configuration of a specific billing destination (Currently only support + * bill against consumer project). + */ + export interface Schema$BillingDestination { + /** + * Names of the metrics to report to this billing destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * The name of the page. It will be used as an identity of the page to - * generate URI of the page, text of the link to this page in navigation, etc. - * The full page name (start from the root page name to this page concatenated - * with `.`) can be used as reference to the page in your documentation. For - * example: <pre><code>pages: - name: Tutorial content: - * &#40;== include tutorial.md ==&#41; subpages: - name: Java - * content: &#40;== include tutorial_java.md ==&#41; - * </code></pre> You can reference `Java` page using Markdown - * reference link syntax: `Java`. - */ - name: string; + * `Context` defines which contexts an API requests. Example: context: + * rules: - selector: "*" requested: - + * google.rpc.context.ProjectContext - + * google.rpc.context.OriginContext The above specifies that all methods in + * the API request `google.rpc.context.ProjectContext` and + * `google.rpc.context.OriginContext`. Available context types are defined in + * package `google.rpc.context`. This also provides mechanism to whitelist + * any protobuf message extension that can be sent in grpc metadata using + * “x-goog-ext-<extension_id>-bin” and + * “x-goog-ext-<extension_id>-jspb” format. For example, list any + * service specific protobuf types that can appear in grpc metadata as follows + * in your yaml file: Example: context: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allowed_request_extensions: - google.foo.v1.NewExtension + * allowed_response_extensions: - google.foo.v1.NewExtension You can + * also specify extension ID instead of fully qualified extension name here. + */ + export interface Schema$Context { + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$ContextRule[]; + } /** - * Subpages of this page. The order of subpages specified here will be honored - * in the generated docset. - */ - subpages: Schema$Page[]; -} -/** - * Quota configuration helps to achieve fairness and budgeting in service usage. - * The quota configuration works this way: - The service configuration defines a - * set of metrics. - For API calls, the quota.metric_rules maps methods to - * metrics with corresponding costs. - The quota.limits defines limits on the - * metrics, which will be used for quota checks at runtime. An example quota - * configuration in yaml format: quota: - name: apiWriteQpsPerProject - * metric: library.googleapis.com/write_calls unit: - * "1/min/{project}" # rate limit for consumer projects values: - * STANDARD: 10000 # The metric rules bind all methods to the read_calls - * metric, # except for the UpdateBook and DeleteBook methods. These two - * methods # are mapped to the write_calls metric, with the UpdateBook - * method # consuming at twice rate as the DeleteBook method. metric_rules: - * - selector: "*" metric_costs: - * library.googleapis.com/read_calls: 1 - selector: - * google.example.library.v1.LibraryService.UpdateBook metric_costs: - * library.googleapis.com/write_calls: 2 - selector: - * google.example.library.v1.LibraryService.DeleteBook metric_costs: - * library.googleapis.com/write_calls: 1 Corresponding Metric definition: - * metrics: - name: library.googleapis.com/read_calls display_name: - * Read requests metric_kind: DELTA value_type: INT64 - - * name: library.googleapis.com/write_calls display_name: Write requests - * metric_kind: DELTA value_type: INT64 - */ -export interface Schema$Quota { + * A context rule provides information about the context for an individual API + * element. + */ + export interface Schema$ContextRule { + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + */ + allowedRequestExtensions: string[]; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + */ + allowedResponseExtensions: string[]; + /** + * A list of full type names of provided contexts. + */ + provided: string[]; + /** + * A list of full type names of requested contexts. + */ + requested: string[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * List of `QuotaLimit` definitions for the service. + * Selects and configures the service controller used by the service. The + * service controller handles features like abuse, quota, billing, logging, + * monitoring, etc. */ - limits: Schema$QuotaLimit[]; + export interface Schema$Control { + /** + * The service control environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. + */ + environment: string; + } /** - * List of `MetricRule` definitions, each one mapping a selected method to one - * or more metrics. + * Configuration for a custom authentication provider. */ - metricRules: Schema$MetricRule[]; -} -/** - * `QuotaLimit` defines a specific limit that applies over a specified duration - * for a limit type. There can be at most one limit for a duration and limit - * type combination defined within a `QuotaGroup`. - */ -export interface Schema$QuotaLimit { + export interface Schema$CustomAuthRequirements { + /** + * A configuration string containing connection information for the + * authentication provider, typically formatted as a SmartService string + * (go/smartservice). + */ + provider: string; + } /** - * Default number of tokens that can be consumed during the specified - * duration. This is the number of tokens assigned when a client application - * developer activates the service for his/her project. Specifying a value of - * 0 will block all requests. This can be used if you are provisioning quota - * to selected consumers and blocking others. Similarly, a value of -1 will - * indicate an unlimited quota. No other negative values are allowed. Used by - * group-based quotas only. - */ - defaultLimit: string; + * Customize service error responses. For example, list any service specific + * protobuf types that can appear in error detail lists of error responses. + * Example: custom_error: types: - google.foo.v1.CustomError + * - google.foo.v1.AnotherError + */ + export interface Schema$CustomError { + /** + * The list of custom error rules that apply to individual API messages. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$CustomErrorRule[]; + /** + * The list of custom error detail types, e.g. + * 'google.foo.v1.CustomError'. + */ + types: string[]; + } /** - * Optional. User-visible, extended description for this quota limit. Should - * be used only when more context is needed to understand this limit than - * provided by the limit's display name (see: `display_name`). - */ - description: string; + * A custom error rule. + */ + export interface Schema$CustomErrorRule { + /** + * Mark this message as possible payload in error response. Otherwise, + * objects of this type will be filtered when they appear in error payload. + */ + isErrorType: boolean; + /** + * Selects messages to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * User-visible display name for this limit. Optional. If not set, the UI will - * provide a default display name based on the quota configuration. This field - * can be used to override the default display name generated from the - * configuration. - */ - displayName: string; + * A custom pattern is used for defining custom HTTP verb. + */ + export interface Schema$CustomHttpPattern { + /** + * The name of this custom HTTP verb. + */ + kind: string; + /** + * The path matched by this custom verb. + */ + path: string; + } /** - * Duration of this limit in textual notation. Example: "100s", - * "24h", "1d". For duration longer than a day, only - * multiple of days is supported. We support only "100s" and - * "1d" for now. Additional support will be added in the future. - * "0" indicates indefinite duration. Used by group-based quotas - * only. - */ - duration: string; + * Request message for the `DisableService` method. + */ + export interface Schema$DisableServiceRequest {} + /** + * `Documentation` provides the information for describing a service. Example: + * <pre><code>documentation: summary: > The Google + * Calendar API gives access to most calendar features. pages: - name: + * Overview content: &#40;== include google/foo/overview.md + * ==&#41; - name: Tutorial content: &#40;== include + * google/foo/tutorial.md ==&#41; subpages; - name: Java content: + * &#40;== include google/foo/tutorial_java.md ==&#41; rules: - + * selector: google.calendar.Calendar.Get description: > ... - + * selector: google.calendar.Calendar.Put description: > ... + * </code></pre> Documentation is provided in markdown syntax. In + * addition to standard markdown features, definition lists, tables and fenced + * code blocks are supported. Section headers can be provided and are + * interpreted relative to the section nesting of the context where a + * documentation fragment is embedded. Documentation from the IDL is merged + * with documentation defined via the config at normalization time, where + * documentation provided by config rules overrides IDL provided. A number of + * constructs specific to the API platform are supported in documentation + * text. In order to reference a proto element, the following notation can be + * used: + * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> + * To override the display text used for the link, this can be used: + * <pre><code>&#91;display + * text]&#91;fully.qualified.proto.name]</code></pre> Text can + * be excluded from doc using the following notation: + * <pre><code>&#40;-- internal comment + * --&#41;</code></pre> A few directives are available in + * documentation. Note that directives must appear on a single line to be + * properly identified. The `include` directive includes a markdown file from + * an external source: <pre><code>&#40;== include path/to/file + * ==&#41;</code></pre> The `resource_for` directive marks a + * message to be the resource of a collection in REST view. If it is not + * specified, tools attempt to infer the resource from the operations in a + * collection: <pre><code>&#40;== resource_for + * v1.shelves.books ==&#41;</code></pre> The directive + * `suppress_warning` does not directly affect documentation and is documented + * together with service config validation. + */ + export interface Schema$Documentation { + /** + * The URL to the root of documentation. + */ + documentationRootUrl: string; + /** + * Declares a single overview page. For example: + * <pre><code>documentation: summary: ... overview: + * &#40;== include overview.md ==&#41; </code></pre> + * This is a shortcut for the following declaration (using pages style): + * <pre><code>documentation: summary: ... pages: - name: + * Overview content: &#40;== include overview.md ==&#41; + * </code></pre> Note: you cannot specify both `overview` field + * and `pages` field. + */ + overview: string; + /** + * The top level pages for the documentation set. + */ + pages: Schema$Page[]; + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$DocumentationRule[]; + /** + * A short summary of what the service does. Can only be provided by plain + * text. + */ + summary: string; + } /** - * Free tier value displayed in the Developers Console for this limit. The - * free tier is the number of tokens that will be subtracted from the billed - * amount when billing is enabled. This field can only be set on a limit with - * duration "1d", in a billable group; it is invalid on any other - * limit. If this field is not set, it defaults to 0, indicating that there is - * no free tier for this service. Used by group-based quotas only. - */ - freeTier: string; + * A documentation rule provides information about individual API elements. + */ + export interface Schema$DocumentationRule { + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + */ + deprecationDescription: string; + /** + * Description of the selected API(s). + */ + description: string; + /** + * The selector is a comma-separated list of patterns. Each pattern is a + * qualified name of the element which may end in "*", indicating + * a wildcard. Wildcards are only allowed at the end and for a whole + * component of the qualified name, i.e. "foo.*" is ok, but not + * "foo.b*" or "foo.*.bar". To specify a default for all + * applicable elements, the whole pattern "*" is used. + */ + selector: string; + } /** - * Maximum number of tokens that can be consumed during the specified - * duration. Client application developers can override the default limit up - * to this maximum. If specified, this value cannot be set to a value less - * than the default limit. If not specified, it is set to the default limit. - * To allow clients to apply overrides with no upper bound, set this to -1, - * indicating unlimited maximum quota. Used by group-based quotas only. - */ - maxLimit: string; + * Request message for the `EnableService` method. + */ + export interface Schema$EnableServiceRequest {} + /** + * `Endpoint` describes a network endpoint that serves a set of APIs. A + * service may expose any number of endpoints, and all endpoints share the + * same service configuration, such as quota configuration and monitoring + * configuration. Example service configuration: name: + * library-example.googleapis.com endpoints: # Below entry makes + * 'google.example.library.v1.Library' # API be served from + * endpoint address library-example.googleapis.com. # It also allows + * HTTP OPTIONS calls to be passed to the backend, for # it to decide + * whether the subsequent cross-origin request is # allowed to proceed. + * - name: library-example.googleapis.com allow_cors: true + */ + export interface Schema$Endpoint { + /** + * DEPRECATED: This field is no longer supported. Instead of using aliases, + * please specify multiple google.api.Endpoint for each of the intended + * aliases. Additional names that this endpoint will be hosted on. + */ + aliases: string[]; + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint + * to receive and respond to HTTP OPTIONS requests. The response will be + * used by the browser to determine whether the subsequent cross-origin + * request is allowed to proceed. + */ + allowCors: boolean; + /** + * The list of features enabled on this endpoint. + */ + features: string[]; + /** + * The canonical name of this endpoint. + */ + name: string; + /** + * The specification of an Internet routable address of API frontend that + * will handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For + * example, "8.8.8.8" or "myservice.appspot.com". + */ + target: string; + } /** - * The name of the metric this quota limit applies to. The quota limits with - * the same metric will be checked together during runtime. The metric must be - * defined within the service config. - */ - metric: string; + * Enum type definition. + */ + export interface Schema$Enum { + /** + * Enum value definitions. + */ + enumvalue: Schema$EnumValue[]; + /** + * Enum type name. + */ + name: string; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * Name of the quota limit. The name must be provided, and it must be unique - * within the service. The name can only include alphanumeric characters as - * well as '-'. The maximum length of the limit name is 64 - * characters. - */ - name: string; + * Enum value definition. + */ + export interface Schema$EnumValue { + /** + * Enum value name. + */ + name: string; + /** + * Enum value number. + */ + number: number; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + } /** - * Specify the unit of the quota limit. It uses the same syntax as - * Metric.unit. The supported unit kinds are determined by the quota backend - * system. Here are some examples: * "1/min/{project}" for quota - * per minute per project. Note: the order of unit components is - * insignificant. The "1" at the beginning is required to follow the - * metric unit syntax. + * Experimental service configuration. These configuration options can only be + * used by whitelisted users. */ - unit: string; + export interface Schema$Experimental { + /** + * Authorization configuration. + */ + authorization: Schema$AuthorizationConfig; + } /** - * Tiered limit values. You must specify this as a key:value pair, with an - * integer value that is the maximum number of requests allowed for the - * specified unit. Currently only STANDARD is supported. - */ - values: any; -} -/** - * A service that is available for use by the consumer. - */ -export interface Schema$Service { + * A single field of a message type. + */ + export interface Schema$Field { + /** + * The field cardinality. + */ + cardinality: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + */ + defaultValue: string; + /** + * The field JSON name. + */ + jsonName: string; + /** + * The field type. + */ + kind: string; + /** + * The field name. + */ + name: string; + /** + * The field number. + */ + number: number; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the + * list. + */ + oneofIndex: number; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * Whether to use alternative packed wire representation. + */ + packed: boolean; + /** + * The field type URL, without the scheme, for message or enumeration types. + * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + */ + typeUrl: string; + } /** - * The service configuration of the available service. Some fields may be - * filtered out of the configuration in responses to the `ListServices` - * method. These fields are present only in responses to the `GetService` - * method. - */ - config: Schema$ServiceConfig; + * `Service` is the root object of Google service configuration schema. It + * describes basic information about a service, such as the name and the + * title, and delegates other aspects to sub-sections. Each sub-section is + * either a proto message or a repeated proto message that configures a + * specific aspect, such as auth. See each proto message definition for + * details. Example: type: google.api.Service config_version: 3 + * name: calendar.googleapis.com title: Google Calendar API apis: - + * name: google.calendar.v3.Calendar authentication: providers: - + * id: google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$GoogleApiService { + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the google.protobuf.Api needs to be provided by the configuration + * author, as the remaining fields will be derived from the IDL during the + * normalization process. It is an error to specify an API interface here + * which cannot be resolved against the associated IDL files. + */ + apis: Schema$Api[]; + /** + * Auth configuration. + */ + authentication: Schema$Authentication; + /** + * API backend configuration. + */ + backend: Schema$Backend; + /** + * Billing configuration. + */ + billing: Schema$Billing; + /** + * The semantic version of the service configuration. The config version + * affects the interpretation of the service configuration. For example, + * certain features are enabled by default for certain config versions. The + * latest config version is `3`. + */ + configVersion: number; + /** + * Context configuration. + */ + context: Schema$Context; + /** + * Configuration for the service control plane. + */ + control: Schema$Control; + /** + * Custom error configuration. + */ + customError: Schema$CustomError; + /** + * Additional API documentation. + */ + documentation: Schema$Documentation; + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service + * all defined APIs. + */ + endpoints: Schema$Endpoint[]; + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name. Example: enums: - name: google.someapi.v1.SomeEnum + */ + enums: Schema$Enum[]; + /** + * Experimental configuration. + */ + experimental: Schema$Experimental; + /** + * HTTP configuration. + */ + http: Schema$Http; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. If empty, the server may choose to + * generate one instead. + */ + id: string; + /** + * Logging configuration. + */ + logging: Schema$Logging; + /** + * Defines the logs used by this service. + */ + logs: Schema$LogDescriptor[]; + /** + * Defines the metrics used by this service. + */ + metrics: Schema$MetricDescriptor[]; + /** + * Defines the monitored resources used by this service. This is required by + * the Service.monitoring and Service.logging configurations. + */ + monitoredResources: Schema$MonitoredResourceDescriptor[]; + /** + * Monitoring configuration. + */ + monitoring: Schema$Monitoring; + /** + * The DNS address at which this service is available, e.g. + * `calendar.googleapis.com`. + */ + name: string; + /** + * The Google project that owns this service. + */ + producerProjectId: string; + /** + * Quota configuration. + */ + quota: Schema$Quota; + /** + * Output only. The source information for this configuration if available. + */ + sourceInfo: Schema$SourceInfo; + /** + * System parameter configuration. + */ + systemParameters: Schema$SystemParameters; + /** + * A list of all proto message types included in this API service. It serves + * similar purpose as [google.api.Service.types], except that these types + * are not needed by user-defined APIs. Therefore, they will not show up in + * the generated discovery doc. This field should only be used to define + * system APIs in ESF. + */ + systemTypes: Schema$Type[]; + /** + * The product title for this service. + */ + title: string; + /** + * A list of all proto message types included in this API service. Types + * referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such + * as types used by the `google.protobuf.Any` type, should be listed here by + * name. Example: types: - name: google.protobuf.Int32 + */ + types: Schema$Type[]; + /** + * Configuration controlling usage of this service. + */ + usage: Schema$Usage; + } /** - * The resource name of the consumer and service. A valid name would be: - - * projects/123/services/serviceusage.googleapis.com - */ - name: string; + * Defines the HTTP configuration for an API service. It contains a list of + * HttpRule, each specifying the mapping of an RPC method to one or more HTTP + * REST API methods. + */ + export interface Schema$Http { + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where + * "%2F" will be left encoded. The default behavior is to not + * decode RFC 6570 reserved characters in multi segment matches. + */ + fullyDecodeReservedExpansion: boolean; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$HttpRule[]; + } /** - * The resource name of the consumer. A valid name would be: - projects/123 - */ - parent: string; + * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST + * API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and HTTP + * request body. The mapping is typically specified as an `google.api.http` + * annotation on the RPC method, see "google/api/annotations.proto" + * for details. The mapping consists of a field specifying the path template + * and method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET operation on a + * resource collection of messages: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http).get = + * "/v1/messages/{message_id}/{sub.subfield}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL SubMessage sub = + * 2; // `sub.subfield` is url-mapped } message Message { string + * text = 1; // content of the resource } The same http annotation can + * alternatively be expressed inside the `GRPC API Configuration` YAML file. + * http: rules: - selector: + * <proto_package_name>.Messaging.GetMessage get: + * /v1/messages/{message_id}/{sub.subfield} This definition enables an + * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC + * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: + * "123456" sub: SubMessage(subfield: "foo"))` In + * general, not only fields but also field paths can be referenced from a path + * pattern. Fields mapped to the path pattern cannot be repeated and must have + * a primitive (non-message) type. Any fields in the request message which + * are not bound by the path pattern automatically become (optional) HTTP + * query parameters. Assume the following definition of the request message: + * service Messaging { rpc GetMessage(GetMessageRequest) returns + * (Message) { option (google.api.http).get = + * "/v1/messages/{message_id}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL int64 revision = + * 2; // becomes a parameter SubMessage sub = 3; // `sub.subfield` + * becomes a parameter } This enables a HTTP JSON to RPC mapping as + * below: HTTP | RPC -----|----- `GET + * /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` Note that fields which are mapped + * to HTTP parameters must have a primitive type or a repeated primitive type. + * Message types are not allowed. In the case of a repeated type, the + * parameter can be repeated in the URL, as in `...?param=A&param=B`. For + * HTTP method kinds which allow a request body, the `body` field specifies + * the mapping. Consider a REST update method on the message resource + * collection: service Messaging { rpc + * UpdateMessage(UpdateMessageRequest) returns (Message) { option + * (google.api.http) = { put: "/v1/messages/{message_id}" + * body: "message" }; } } message + * UpdateMessageRequest { string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body } The following HTTP + * JSON to RPC mapping is enabled, where the representation of the JSON in the + * request body is determined by protos JSON encoding: HTTP | RPC -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | + * `UpdateMessage(message_id: "123456" message { text: + * "Hi!" })` The special name `*` can be used in the body mapping + * to define that every field not bound by the path template should be mapped + * to the request body. This enables the following alternative definition of + * the update method: service Messaging { rpc + * UpdateMessage(Message) returns (Message) { option (google.api.http) + * = { put: "/v1/messages/{message_id}" body: + * "*" }; } } message Message { string + * message_id = 1; string text = 2; } The following HTTP JSON to + * RPC mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { + * "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` Note that when using `*` in the + * body mapping, it is not possible to have HTTP parameters, as all fields not + * bound by the path end in the body. This makes this option more rarely used + * in practice of defining REST APIs. The common usage of `*` is in custom + * methods which don't use the URL at all for transferring data. It is + * possible to define multiple HTTP methods for one RPC by using the + * `additional_bindings` option. Example: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http) = { get: "/v1/messages/{message_id}" + * additional_bindings { get: + * "/v1/users/{user_id}/messages/{message_id}" } }; } } + * message GetMessageRequest { string message_id = 1; string + * user_id = 2; } This enables the following two alternative HTTP JSON + * to RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | + * `GetMessage(message_id: "123456")` `GET + * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" + * message_id: "123456")` # Rules for HTTP mapping The rules for + * mapping HTTP path, query parameters, and body fields to the request message + * are as follows: 1. The `body` field specifies either `*` or a field path, + * or is omitted. If omitted, it indicates there is no HTTP request + * body. 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: (a) Matched in the URL + * template. (b) Covered by body (if body is `*`, everything except (a) + * fields; else everything under the body field) (c) All other + * fields. 3. URL query parameters found in the HTTP request are mapped to (c) + * fields. 4. Any body sent with an HTTP request can contain only (b) fields. + * The syntax of the path template is as follows: Template = + * "/" Segments [ Verb ] ; Segments = Segment { "/" + * Segment } ; Segment = "*" | "**" | LITERAL | + * Variable ; Variable = "{" FieldPath [ "=" Segments + * ] "}" ; FieldPath = IDENT { "." IDENT } ; Verb + * = ":" LITERAL ; The syntax `*` matches a single path segment. + * The syntax `**` matches zero or more path segments, which must be the last + * part of the path except the `Verb`. The syntax `LITERAL` matches literal + * text in the path. The syntax `Variable` matches part of the URL path as + * specified by its template. A variable template must not contain other + * variables. If a variable matches a single path segment, its template may be + * omitted, e.g. `{var}` is equivalent to `{var=*}`. If a variable contains + * exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{var}`. If a variable contains one + * or more path segments, such as `"{var=foo/*}"` or + * `"{var=**}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such + * variables show up in the Discovery Document as `{+var}`. NOTE: While the + * single segment variable matches the semantics of [RFC + * 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** match RFC 6570 Reserved + * Expansion. The reason is that the Reserved Expansion does not expand + * special characters like `?` and `#`, which would lead to invalid URLs. + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ + export interface Schema$HttpRule { + /** + * Additional HTTP bindings for the selector. Nested bindings must not + * contain an `additional_bindings` field themselves (that is, the nesting + * may only be one level deep). + */ + additionalBindings: Schema$HttpRule[]; + /** + * Specifies the permission(s) required for an API element for the overall + * API request to succeed. It is typically used to mark request message + * fields that contain the name of the resource and indicates the + * permissions that will be checked on that resource. + */ + authorizations: Schema$AuthorizationRule[]; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave + * the HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: Schema$CustomHttpPattern; + /** + * Used for deleting a resource. + */ + delete: string; + /** + * Used for listing and getting information about resources. + */ + get: string; + /** + * Use this only for Scotty Requests. Do not use this for bytestream + * methods. For media support, add instead + * [][google.bytestream.RestByteStream] as an API to your configuration. + */ + mediaDownload: Schema$MediaDownload; + /** + * Use this only for Scotty Requests. Do not use this for media support + * using Bytestream, add instead [][google.bytestream.RestByteStream] as an + * API to your configuration for Bytestream methods. + */ + mediaUpload: Schema$MediaUpload; + /** + * Used for updating a resource. + */ + patch: string; + /** + * Used for creating a resource. + */ + post: string; + /** + * Used for updating a resource. + */ + put: string; + /** + * DO NOT USE. This is an experimental field. Optional. The REST collection + * name is by default derived from the URL pattern. If specified, this field + * overrides the default collection name. Example: rpc + * AddressesAggregatedList(AddressesAggregatedListRequest) returns + * (AddressesAggregatedListResponse) { option (google.api.http) = { + * get: "/v1/projects/{project_id}/aggregated/addresses" + * rest_collection: "projects.addresses" }; } This + * method has the automatically derived collection name + * "projects.aggregated". Because, semantically, this rpc is + * actually an operation on the "projects.addresses" collection, + * the `rest_collection` field is configured to override the derived + * collection name. + */ + restCollection: string; + /** + * DO NOT USE. This is an experimental field. Optional. The rest method + * name is by default derived from the URL pattern. If specified, this field + * overrides the default method name. Example: rpc + * CreateResource(CreateResourceRequest) returns + * (CreateResourceResponse) { option (google.api.http) = { post: + * "/v1/resources", body: "resource", + * rest_method_name: "insert" }; } This method has the + * automatically derived rest method name "create", but for + * backwards compatibility with apiary, it is specified as insert. + */ + restMethodName: string; + /** + * Selects methods to which this rule applies. Refer to selector for syntax + * details. + */ + selector: string; + } /** - * Whether or not the service has been enabled for use by the consumer. - */ - state: string; -} -/** - * The configuration of the service. - */ -export interface Schema$ServiceConfig { + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; + } /** - * A list of API interfaces exported by this service. Contains only the names, - * versions, and method names of the interfaces. - */ - apis: Schema$Api[]; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Auth configuration. Contains only the OAuth rules. - */ - authentication: Schema$Authentication; + * Response message for the `ListServices` method. + */ + export interface Schema$ListServicesResponse { + /** + * Token that can be passed to `ListServices` to resume a paginated query. + */ + nextPageToken: string; + /** + * The available services for the requested project. + */ + services: Schema$Service[]; + } /** - * Additional API documentation. Contains only the summary and the - * documentation URL. - */ - documentation: Schema$Documentation; + * A description of a log type. Example in YAML format: - name: + * library.googleapis.com/activity_history description: The history of + * borrowing and returning library items. display_name: Activity labels: + * - key: /customer_id description: Identifier of a library customer + */ + export interface Schema$LogDescriptor { + /** + * A human-readable description of this log. This information appears in the + * documentation and can contain details. + */ + description: string; + /** + * The human-readable name for this log. This information appears on the + * user interface and should be concise. + */ + displayName: string; + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are considered + * invalid. + */ + labels: Schema$LabelDescriptor[]; + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including slash, + * underscore, hyphen, period [/_-.]. + */ + name: string; + } /** - * Configuration for network endpoints. Contains only the names and aliases of - * the endpoints. - */ - endpoints: Schema$Endpoint[]; + * Logging configuration of the service. The following example shows how to + * configure logs to be sent to the producer and consumer projects. In the + * example, the `activity_history` log is sent to both the producer and + * consumer projects, whereas the `purchase_history` log is only sent to the + * producer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. logs: - name: activity_history + * labels: - key: /customer_id - name: purchase_history logging: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history - + * purchase_history consumer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history + */ + export interface Schema$Logging { + /** + * Logging configurations for sending logs to the consumer project. There + * can be multiple consumer destinations, each one must have a different + * monitored resource type. A log can be used in at most one consumer + * destination. + */ + consumerDestinations: Schema$LoggingDestination[]; + /** + * Logging configurations for sending logs to the producer project. There + * can be multiple producer destinations, each one must have a different + * monitored resource type. A log can be used in at most one producer + * destination. + */ + producerDestinations: Schema$LoggingDestination[]; + } /** - * The DNS address at which this service is available. An example DNS address - * would be: `calendar.googleapis.com`. - */ - name: string; + * Configuration of a specific logging destination (the producer project or + * the consumer project). + */ + export interface Schema$LoggingDestination { + /** + * Names of the logs to be sent to this destination. Each name must be + * defined in the Service.logs section. If the log name is not a domain + * scoped name, it will be automatically prefixed with the service name + * followed by "/". + */ + logs: string[]; + /** + * The monitored resource type. The type must be defined in the + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Quota configuration. + * Defines the Media configuration for a service in case of a download. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - quota: Schema$Quota; + export interface Schema$MediaDownload { + /** + * A boolean that determines whether a notification for the completion of a + * download should be sent to the backend. + */ + completeNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the download service if one is used for download. + */ + downloadService: string; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether download is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for direct download. The size is + * specified in bytes. + */ + maxDirectDownloadSize: string; + /** + * A boolean that determines if direct download from ESF should be used for + * download of this media. + */ + useDirectDownload: boolean; + } /** - * The product title for this service. + * Defines the Media configuration for a service in case of an upload. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - title: string; + export interface Schema$MediaUpload { + /** + * A boolean that determines whether a notification for the completion of an + * upload should be sent to the backend. These notifications will not be + * seen by the client and will not consume quota. + */ + completeNotification: boolean; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether upload is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for an upload. The size is specified in + * bytes. + */ + maxSize: string; + /** + * An array of mimetype patterns. Esf will only accept uploads that match + * one of the given patterns. + */ + mimeTypes: string[]; + /** + * Whether to receive a notification for progress changes of media upload. + */ + progressNotification: boolean; + /** + * Whether to receive a notification on the start of media upload. + */ + startNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the upload service if one is used for upload. + */ + uploadService: string; + } /** - * Configuration controlling usage of this service. - */ - usage: Schema$Usage; -} -/** - * `SourceContext` represents information about the source of a protobuf - * element, like the file in which it is defined. - */ -export interface Schema$SourceContext { + * Method represents a method of an API interface. + */ + export interface Schema$Method { + /** + * The simple name of this method. + */ + name: string; + /** + * Any metadata attached to the method. + */ + options: Schema$Option[]; + /** + * If true, the request is streamed. + */ + requestStreaming: boolean; + /** + * A URL of the input message type. + */ + requestTypeUrl: string; + /** + * If true, the response is streamed. + */ + responseStreaming: boolean; + /** + * The URL of the output message type. + */ + responseTypeUrl: string; + /** + * The source syntax of this method. + */ + syntax: string; + } /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: - * `"google/protobuf/source_context.proto"`. - */ - fileName: string; -} -/** - * Source information used to create a Service Config - */ -export interface Schema$SourceInfo { + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric type has + * a label for the HTTP response code, `response_code`, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be + * supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * `custom.googleapis.com`. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported + * units are a subset of [The Unified Code for Units of + * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units + * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute + * * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo + * (10**3) * `M` mega (10**6) * `G` giga (10**9) * `T` tera + * (10**12) * `P` peta (10**15) * `E` exa (10**18) * `Z` + * zetta (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * + * `u` micro (10**-6) * `n` nano (10**-9) * `p` pico + * (10**-12) * `f` femto (10**-15) * `a` atto (10**-18) * `z` + * zepto (10**-21) * `y` yocto (10**-24) * `Ki` kibi (2**10) * + * `Mi` mebi (2**20) * `Gi` gibi (2**30) * `Ti` tebi (2**40) + * **Grammar** The grammar also includes these connectors: * `/` division + * (as an infix operator, e.g. `1/s`). * `.` multiplication (as an infix + * operator, e.g. `GBy.d`) The grammar for a unit is as follows: Expression + * = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | + * Annotation | "1" ; Annotation + * = "{" NAME "}" ; Notes: * `Annotation` is just a + * comment if it follows a `UNIT` and is equivalent to `1` if it is used + * alone. For examples, `{requests}/s == 1/s`, `By{transmitted}/s == + * By/s`. * `NAME` is a sequence of non-blank printable ASCII characters not + * containing '{' or '}'. * `1` represents dimensionless + * value 1, such as in `1/s`. * `%` represents dimensionless value 1/100, + * and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of `metric_kind` and `value_type` might not be supported. + */ + valueType: string; + } /** - * All files used during config generation. - */ - sourceFiles: any[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Bind API methods to metrics. Binding a method to a metric causes that + * metric's configured quota behaviors to apply to the method call. + */ + export interface Schema$MetricRule { + /** + * Metrics to update when the selected methods are called, and the + * associated cost applied to each metric. The key of the map is the metric + * name, and the values are the amount increased for the metric against + * which the quota limits are defined. The value must not be negative. + */ + metricCosts: any; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: - If after comment and + * whitespace stripping, the documentation string of the redeclared method + * is empty, it will be inherited from the original method. - Each + * annotation belonging to the service config (http, visibility) which is + * not set in the redeclared method will be inherited. - If an http + * annotation is inherited, the path pattern will be modified as follows. + * Any version prefix will be replaced by the version of the including + * interface plus the root path if specified. Example of a simple mixin: + * package google.acl.v1; service AccessControl { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; } } + * package google.storage.v2; service Storage { // rpc + * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc + * GetData(GetDataRequest) returns (Data) { option + * (google.api.http).get = "/v2/{resource=**}"; } } + * Example of a mixin configuration: apis: - name: + * google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl The mixin construct implies that all methods + * in `AccessControl` are also declared with same name and request/response + * types in `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting documentation and + * annotations as follows: service Storage { // Get the underlying + * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option + * (google.api.http).get = "/v2/{resource=**}:getAcl"; } ... + * } Note how the version in the path pattern changed from `v1` to `v2`. If + * the `root` field in the mixin is specified, it should be a relative path + * under which inherited HTTP paths are placed. Example: apis: - + * name: google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl root: acls This implies the following + * inherited HTTP annotation: service Storage { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } ... } + */ + export interface Schema$Mixin { + /** + * The fully qualified name of the interface which is included. + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths are + * rooted. + */ + root: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * `"gce_instance"` and specifies the use of the labels + * `"instance_id"` and `"zone"` to identify particular VM + * instances. Different APIs can support different monitored resource types. + * APIs generally provide a `list` method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, `"Google + * Cloud SQL Database"`. + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and + * `"zone"`. + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` + * where {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents the status of one operation step. - */ -export interface Schema$Step { + * Monitoring configuration of the service. The example below shows how to + * configure monitored resources and metrics for monitoring. In the example, a + * monitored resource and two metrics are defined. The + * `library.googleapis.com/book/returned_count` metric is sent to both + * producer and consumer projects, whereas the + * `library.googleapis.com/book/overdue_count` metric is only sent to the + * consumer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. metrics: - name: + * library.googleapis.com/book/returned_count metric_kind: DELTA + * value_type: INT64 labels: - key: /customer_id - name: + * library.googleapis.com/book/overdue_count metric_kind: GAUGE + * value_type: INT64 labels: - key: /customer_id monitoring: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count consumer_destinations: - + * monitored_resource: library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count - + * library.googleapis.com/book/overdue_count + */ + export interface Schema$Monitoring { + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$MonitoringDestination[]; + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * producer destination. + */ + producerDestinations: Schema$MonitoringDestination[]; + } /** - * The short description of the step. - */ - description: string; + * Configuration of a specific monitoring destination (the producer project or + * the consumer project). + */ + export interface Schema$MonitoringDestination { + /** + * Names of the metrics to report to this monitoring destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * The status code. - */ - status: string; -} -/** - * Define a parameter's name and location. The parameter may be passed as - * either an HTTP header or a URL query parameter, and if both are passed the - * behavior is implementation-dependent. - */ -export interface Schema$SystemParameter { + * OAuth scopes are a way to define data and permissions on data. For example, + * there are scopes defined for "Read-only access to Google + * Calendar" and "Access to Cloud Platform". Users can consent + * to a scope for an application, giving it permission to access that data on + * their behalf. OAuth scope specifications should be fairly coarse grained; + * a user will need to see and understand the text description of what your + * scope means. In most cases: use one or at most two OAuth scopes for an + * entire family of products. If your product has multiple APIs, you should + * probably be sharing the OAuth scope across all of those APIs. When you + * need finer grained OAuth consent screens: talk with your product management + * about how developers will use them in practice. Please note that even + * though each of the canonical scopes is enough for a request to be accepted + * and passed to the backend, a request can still fail due to the backend + * requiring additional scopes or permissions. + */ + export interface Schema$OAuthRequirements { + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + */ + canonicalScopes: string; + } /** - * Define the HTTP header name to use for the parameter. It is case - * insensitive. - */ - httpHeader: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Define the name of the parameter, such as "api_key" . It is case - * sensitive. - */ - name: string; + * The metadata associated with a long running operation resource. + */ + export interface Schema$OperationMetadata { + /** + * Percentage of completion of this operation, ranging from 0 to 100. + */ + progressPercentage: number; + /** + * The full name of the resources that this operation is directly associated + * with. + */ + resourceNames: string[]; + /** + * The start time of the operation. + */ + startTime: string; + /** + * Detailed status information for each step. The order is undetermined. + */ + steps: Schema$Step[]; + } /** - * Define the URL query parameter name to use for the parameter. It is case - * sensitive. - */ - urlQueryParameter: string; -} -/** - * Define a system parameter rule mapping system parameter definitions to - * methods. - */ -export interface Schema$SystemParameterRule { + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + */ + export interface Schema$Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, + * `"map_entry"`. For custom options, it should be the + * fully-qualified name. For example, `"google.api.http"`. + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a + * primitive, the corresponding wrapper type defined in + * google/protobuf/wrappers.proto should be used. If the value is an enum, + * it should be stored as an int32 value using the + * google.protobuf.Int32Value type. + */ + value: any; + } /** - * Define parameters. Multiple names may be defined for a parameter. For a - * given method call, only one of them should be used. If multiple names are - * used the behavior is implementation-dependent. If none of the specified - * names are present the behavior is parameter-dependent. - */ - parameters: Schema$SystemParameter[]; + * Represents a documentation page. A page can contain subpages to represent + * nested documentation set structure. + */ + export interface Schema$Page { + /** + * The Markdown content of the page. You can use <code>&#40;== + * include {path} ==&#41;</code> to include content from a + * Markdown file. + */ + content: string; + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: <pre><code>pages: - name: + * Tutorial content: &#40;== include tutorial.md ==&#41; subpages: + * - name: Java content: &#40;== include tutorial_java.md + * ==&#41; </code></pre> You can reference `Java` page using + * Markdown reference link syntax: `Java`. + */ + name: string; + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + */ + subpages: Schema$Page[]; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; -} -/** - * ### System parameter configuration A system parameter is a special kind of - * parameter defined by the API system, not by an individual API. It is - * typically mapped to an HTTP header and/or a URL query parameter. This - * configuration specifies which methods change the names of the system - * parameters. - */ -export interface Schema$SystemParameters { - /** - * Define system parameters. The parameters defined here will override the - * default parameters implemented by the system. If this field is missing from - * the service config, default system parameters will be used. Default system - * parameters and names is implementation-dependent. Example: define api key - * for all methods system_parameters rules: - selector: - * "*" parameters: - name: api_key - * url_query_parameter: api_key Example: define 2 api key names for a - * specific method. system_parameters rules: - selector: - * "/ListShelves" parameters: - name: api_key - * http_header: Api-Key1 - name: api_key http_header: Api-Key2 - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$SystemParameterRule[]; -} -/** - * A protocol buffer message type. - */ -export interface Schema$Type { + * Quota configuration helps to achieve fairness and budgeting in service + * usage. The quota configuration works this way: - The service configuration + * defines a set of metrics. - For API calls, the quota.metric_rules maps + * methods to metrics with corresponding costs. - The quota.limits defines + * limits on the metrics, which will be used for quota checks at runtime. An + * example quota configuration in yaml format: quota: - name: + * apiWriteQpsPerProject metric: library.googleapis.com/write_calls + * unit: "1/min/{project}" # rate limit for consumer projects + * values: STANDARD: 10000 # The metric rules bind all methods + * to the read_calls metric, # except for the UpdateBook and DeleteBook + * methods. These two methods # are mapped to the write_calls metric, + * with the UpdateBook method # consuming at twice rate as the DeleteBook + * method. metric_rules: - selector: "*" metric_costs: + * library.googleapis.com/read_calls: 1 - selector: + * google.example.library.v1.LibraryService.UpdateBook metric_costs: + * library.googleapis.com/write_calls: 2 - selector: + * google.example.library.v1.LibraryService.DeleteBook metric_costs: + * library.googleapis.com/write_calls: 1 Corresponding Metric definition: + * metrics: - name: library.googleapis.com/read_calls display_name: Read + * requests metric_kind: DELTA value_type: INT64 - name: + * library.googleapis.com/write_calls display_name: Write requests + * metric_kind: DELTA value_type: INT64 + */ + export interface Schema$Quota { + /** + * List of `QuotaLimit` definitions for the service. + */ + limits: Schema$QuotaLimit[]; + /** + * List of `MetricRule` definitions, each one mapping a selected method to + * one or more metrics. + */ + metricRules: Schema$MetricRule[]; + } /** - * The list of fields. - */ - fields: Schema$Field[]; + * `QuotaLimit` defines a specific limit that applies over a specified + * duration for a limit type. There can be at most one limit for a duration + * and limit type combination defined within a `QuotaGroup`. + */ + export interface Schema$QuotaLimit { + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client application + * developer activates the service for his/her project. Specifying a value + * of 0 will block all requests. This can be used if you are provisioning + * quota to selected consumers and blocking others. Similarly, a value of -1 + * will indicate an unlimited quota. No other negative values are allowed. + * Used by group-based quotas only. + */ + defaultLimit: string; + /** + * Optional. User-visible, extended description for this quota limit. Should + * be used only when more context is needed to understand this limit than + * provided by the limit's display name (see: `display_name`). + */ + description: string; + /** + * User-visible display name for this limit. Optional. If not set, the UI + * will provide a default display name based on the quota configuration. + * This field can be used to override the default display name generated + * from the configuration. + */ + displayName: string; + /** + * Duration of this limit in textual notation. Example: "100s", + * "24h", "1d". For duration longer than a day, only + * multiple of days is supported. We support only "100s" and + * "1d" for now. Additional support will be added in the future. + * "0" indicates indefinite duration. Used by group-based quotas + * only. + */ + duration: string; + /** + * Free tier value displayed in the Developers Console for this limit. The + * free tier is the number of tokens that will be subtracted from the billed + * amount when billing is enabled. This field can only be set on a limit + * with duration "1d", in a billable group; it is invalid on any + * other limit. If this field is not set, it defaults to 0, indicating that + * there is no free tier for this service. Used by group-based quotas only. + */ + freeTier: string; + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. Used by group-based quotas only. + */ + maxLimit: string; + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must + * be defined within the service config. + */ + metric: string; + /** + * Name of the quota limit. The name must be provided, and it must be + * unique within the service. The name can only include alphanumeric + * characters as well as '-'. The maximum length of the limit name + * is 64 characters. + */ + name: string; + /** + * Specify the unit of the quota limit. It uses the same syntax as + * Metric.unit. The supported unit kinds are determined by the quota backend + * system. Here are some examples: * "1/min/{project}" for quota + * per minute per project. Note: the order of unit components is + * insignificant. The "1" at the beginning is required to follow + * the metric unit syntax. + */ + unit: string; + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + */ + values: any; + } /** - * The fully qualified message name. - */ - name: string; + * A service that is available for use by the consumer. + */ + export interface Schema$Service { + /** + * The service configuration of the available service. Some fields may be + * filtered out of the configuration in responses to the `ListServices` + * method. These fields are present only in responses to the `GetService` + * method. + */ + config: Schema$ServiceConfig; + /** + * The resource name of the consumer and service. A valid name would be: - + * projects/123/services/serviceusage.googleapis.com + */ + name: string; + /** + * The resource name of the consumer. A valid name would be: - projects/123 + */ + parent: string; + /** + * Whether or not the service has been enabled for use by the consumer. + */ + state: string; + } /** - * The list of types appearing in `oneof` definitions in this type. - */ - oneofs: string[]; + * The configuration of the service. + */ + export interface Schema$ServiceConfig { + /** + * A list of API interfaces exported by this service. Contains only the + * names, versions, and method names of the interfaces. + */ + apis: Schema$Api[]; + /** + * Auth configuration. Contains only the OAuth rules. + */ + authentication: Schema$Authentication; + /** + * Additional API documentation. Contains only the summary and the + * documentation URL. + */ + documentation: Schema$Documentation; + /** + * Configuration for network endpoints. Contains only the names and aliases + * of the endpoints. + */ + endpoints: Schema$Endpoint[]; + /** + * The DNS address at which this service is available. An example DNS + * address would be: `calendar.googleapis.com`. + */ + name: string; + /** + * Quota configuration. + */ + quota: Schema$Quota; + /** + * The product title for this service. + */ + title: string; + /** + * Configuration controlling usage of this service. + */ + usage: Schema$Usage; + } /** - * The protocol buffer options. + * `SourceContext` represents information about the source of a protobuf + * element, like the file in which it is defined. */ - options: Schema$Option[]; + export interface Schema$SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: + * `"google/protobuf/source_context.proto"`. + */ + fileName: string; + } /** - * The source context. + * Source information used to create a Service Config */ - sourceContext: Schema$SourceContext; + export interface Schema$SourceInfo { + /** + * All files used during config generation. + */ + sourceFiles: any[]; + } /** - * The source syntax. - */ - syntax: string; -} -/** - * Configuration controlling usage of a service. - */ -export interface Schema$Usage { + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The full resource name of a channel used for sending notifications to the - * service producer. Google Service Management currently only supports - * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - * channel. To use Google Cloud Pub/Sub as the channel, this must be the name - * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - * documented in https://cloud.google.com/pubsub/docs/overview. - */ - producerNotificationChannel: string; + * Represents the status of one operation step. + */ + export interface Schema$Step { + /** + * The short description of the step. + */ + description: string; + /** + * The status code. + */ + status: string; + } /** - * Requirements that must be satisfied before a consumer project can use the - * service. Each requirement is of the form - * <service.name>/<requirement-id>; for example - * 'serviceusage.googleapis.com/billing-enabled'. - */ - requirements: string[]; + * Define a parameter's name and location. The parameter may be passed as + * either an HTTP header or a URL query parameter, and if both are passed the + * behavior is implementation-dependent. + */ + export interface Schema$SystemParameter { + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + */ + httpHeader: string; + /** + * Define the name of the parameter, such as "api_key" . It is + * case sensitive. + */ + name: string; + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + */ + urlQueryParameter: string; + } /** - * A list of usage rules that apply to individual API methods. **NOTE:** All - * service configuration rules follow "last one wins" order. - */ - rules: Schema$UsageRule[]; -} -/** - * Usage configuration rules for the service. NOTE: Under development. Use - * this rule to configure unregistered calls for the service. Unregistered calls - * are calls that do not contain consumer project identity. (Example: calls that - * do not contain an API key). By default, API methods do not allow unregistered - * calls, and each method call must be identified by a consumer project - * identity. Use this rule to allow/disallow unregistered calls. Example of an - * API that wants to allow unregistered calls for entire service. usage: - * rules: - selector: "*" allow_unregistered_calls: true - * Example of a method that wants to allow unregistered calls. usage: - * rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allow_unregistered_calls: true - */ -export interface Schema$UsageRule { + * Define a system parameter rule mapping system parameter definitions to + * methods. + */ + export interface Schema$SystemParameterRule { + /** + * Define parameters. Multiple names may be defined for a parameter. For a + * given method call, only one of them should be used. If multiple names are + * used the behavior is implementation-dependent. If none of the specified + * names are present the behavior is parameter-dependent. + */ + parameters: Schema$SystemParameter[]; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + } /** - * If true, the selected method allows unregistered calls, e.g. calls that - * don't identify any user or application. - */ - allowUnregisteredCalls: boolean; + * ### System parameter configuration A system parameter is a special kind of + * parameter defined by the API system, not by an individual API. It is + * typically mapped to an HTTP header and/or a URL query parameter. This + * configuration specifies which methods change the names of the system + * parameters. + */ + export interface Schema$SystemParameters { + /** + * Define system parameters. The parameters defined here will override the + * default parameters implemented by the system. If this field is missing + * from the service config, default system parameters will be used. Default + * system parameters and names is implementation-dependent. Example: define + * api key for all methods system_parameters rules: - + * selector: "*" parameters: - name: api_key + * url_query_parameter: api_key Example: define 2 api key names for a + * specific method. system_parameters rules: - selector: + * "/ListShelves" parameters: - name: + * api_key http_header: Api-Key1 - name: api_key + * http_header: Api-Key2 **NOTE:** All service configuration rules follow + * "last one wins" order. + */ + rules: Schema$SystemParameterRule[]; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; + * A protocol buffer message type. + */ + export interface Schema$Type { + /** + * The list of fields. + */ + fields: Schema$Field[]; + /** + * The fully qualified message name. + */ + name: string; + /** + * The list of types appearing in `oneof` definitions in this type. + */ + oneofs: string[]; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * If true, the selected method should skip service control and the control - * plane features, such as quota and billing, will not be available. This flag - * is used by Google Cloud Endpoints to bypass checks for internal methods, - * such as service health check methods. - */ - skipServiceControl: boolean; -} - -export class Resource$Operations { - root: Serviceusage; - constructor(root: Serviceusage) { - this.root = root; - this.getRoot.bind(this); + * Configuration controlling usage of a service. + */ + export interface Schema$Usage { + /** + * The full resource name of a channel used for sending notifications to the + * service producer. Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the + * name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name + * format documented in https://cloud.google.com/pubsub/docs/overview. + */ + producerNotificationChannel: string; + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form + * <service.name>/<requirement-id>; for example + * 'serviceusage.googleapis.com/billing-enabled'. + */ + requirements: string[]; + /** + * A list of usage rules that apply to individual API methods. **NOTE:** + * All service configuration rules follow "last one wins" order. + */ + rules: Schema$UsageRule[]; } - - getRoot() { - return this.root; + /** + * Usage configuration rules for the service. NOTE: Under development. Use + * this rule to configure unregistered calls for the service. Unregistered + * calls are calls that do not contain consumer project identity. (Example: + * calls that do not contain an API key). By default, API methods do not allow + * unregistered calls, and each method call must be identified by a consumer + * project identity. Use this rule to allow/disallow unregistered calls. + * Example of an API that wants to allow unregistered calls for entire + * service. usage: rules: - selector: "*" + * allow_unregistered_calls: true Example of a method that wants to allow + * unregistered calls. usage: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allow_unregistered_calls: true + */ + export interface Schema$UsageRule { + /** + * If true, the selected method allows unregistered calls, e.g. calls that + * don't identify any user or application. + */ + allowUnregisteredCalls: boolean; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. This + * flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + */ + skipServiceControl: boolean; } - - /** - * serviceusage.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias serviceusage.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Serviceusage; + constructor(root: Serviceusage) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * serviceusage.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias serviceusage.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string=} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * serviceusage.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias serviceusage.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1beta1/operations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Services { - root: Serviceusage; - constructor(root: Serviceusage) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * serviceusage.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias serviceusage.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string=} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * serviceusage.services.batchEnable - * @desc Enable multiple services on a project. The operation is atomic: if - * enabling any service fails, then the entire batch fails, and no state - * changes occur. Operation - * @alias serviceusage.services.batchEnable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Parent to enable services on. An example name would be: `projects/123` where `123` is the project number (not project ID). The `BatchEnableServices` method currently only supports projects. - * @param {().BatchEnableServicesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchEnable(params?: any, options?: MethodOptions): - AxiosPromise; - batchEnable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchEnable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Services { + root: Serviceusage; + constructor(root: Serviceusage) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/services:batchEnable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * serviceusage.services.disable - * @desc Disable a service so that it can no longer be used with a project. - * This prevents unintended usage that may cause unexpected billing charges or - * security leaks. It is not valid to call the disable method on a service - * that is not currently enabled. Callers will receive a `FAILED_PRECONDITION` - * status if the target service is not currently enabled. Operation - * @alias serviceusage.services.disable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the consumer and service to disable the service on. The enable and disable methods currently only support projects. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). - * @param {().DisableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disable(params?: any, options?: MethodOptions): - AxiosPromise; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:disable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * serviceusage.services.batchEnable + * @desc Enable multiple services on a project. The operation is atomic: if + * enabling any service fails, then the entire batch fails, and no state + * changes occur. Operation + * @alias serviceusage.services.batchEnable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Parent to enable services on. An example name would be: `projects/123` where `123` is the project number (not project ID). The `BatchEnableServices` method currently only supports projects. + * @param {().BatchEnableServicesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchEnable(params?: any, options?: MethodOptions): + AxiosPromise; + batchEnable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchEnable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/services:batchEnable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * serviceusage.services.enable - * @desc Enable a service so that it can be used with a project. - * Operation - * @alias serviceusage.services.enable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the consumer and service to enable the service on. The `EnableService` and `DisableService` methods currently only support projects. Enabling a service requires that the service is public or is shared with the user enabling the service. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). - * @param {().EnableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enable(params?: any, options?: MethodOptions): AxiosPromise; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceusage.services.disable + * @desc Disable a service so that it can no longer be used with a project. + * This prevents unintended usage that may cause unexpected billing charges + * or security leaks. It is not valid to call the disable method on a + * service that is not currently enabled. Callers will receive a + * `FAILED_PRECONDITION` status if the target service is not currently + * enabled. Operation + * @alias serviceusage.services.disable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the consumer and service to disable the service on. The enable and disable methods currently only support projects. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). + * @param {().DisableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disable(params?: any, options?: MethodOptions): + AxiosPromise; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:disable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}:enable') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceusage.services.get - * @desc Returns the service configuration and enabled state for a given - * service. - * @alias serviceusage.services.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the consumer and service to get the `ConsumerState` for. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * serviceusage.services.enable + * @desc Enable a service so that it can be used with a project. + * Operation + * @alias serviceusage.services.enable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the consumer and service to enable the service on. The `EnableService` and `DisableService` methods currently only support projects. Enabling a service requires that the service is public or is shared with the user enabling the service. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). + * @param {().EnableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enable(params?: any, options?: MethodOptions): + AxiosPromise; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}:enable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceusage.services.list - * @desc List all services available to the specified project, and the current - * state of those services with respect to the project. The list includes all - * public services, all services for which the calling user has the - * `servicemanagement.services.bind` permission, and all services that have - * already been enabled on the project. The list can be filtered to only - * include services in a specific state, for example to only include services - * enabled on the project. - * @alias serviceusage.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`. - * @param {integer=} params.pageSize Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50. - * @param {string=} params.pageToken Token identifying which result to start with, which is returned by a previous list call. - * @param {string} params.parent Parent to search for services on. An example name would be: `projects/123` where `123` is the project number (not project ID). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceusage.services.get + * @desc Returns the service configuration and enabled state for a given + * service. + * @alias serviceusage.services.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the consumer and service to get the `ConsumerState` for. An example name would be: `projects/123/services/serviceusage.googleapis.com` where `123` is the project number (not project ID). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/{+parent}/services') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * serviceusage.services.list + * @desc List all services available to the specified project, and the + * current state of those services with respect to the project. The list + * includes all public services, all services for which the calling user has + * the `servicemanagement.services.bind` permission, and all services that + * have already been enabled on the project. The list can be filtered to + * only include services in a specific state, for example to only include + * services enabled on the project. + * @alias serviceusage.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter Only list services that conform to the given filter. The allowed filter strings are `state:ENABLED` and `state:DISABLED`. + * @param {integer=} params.pageSize Requested size of the next page of data. Requested page size cannot exceed 200. If not set, the default page size is 50. + * @param {string=} params.pageToken Token identifying which result to start with, which is returned by a previous list call. + * @param {string} params.parent Parent to search for services on. An example name would be: `projects/123` where `123` is the project number (not project ID). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceusage.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/{+parent}/services') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/serviceuser/v1.ts b/src/apis/serviceuser/v1.ts index 5a88e8eb3aa..c39c1fd8d6f 100644 --- a/src/apis/serviceuser/v1.ts +++ b/src/apis/serviceuser/v1.ts @@ -27,2269 +27,2301 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Service User API - * - * Enables services that service consumers want to use on Google Cloud Platform, - * lists the available or enabled services, or disables services that service - * consumers no longer use. - * - * @example - * const google = require('googleapis'); - * const serviceuser = google.serviceuser('v1'); - * - * @namespace serviceuser - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Serviceuser - */ -export class Serviceuser { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - services: Resource$Services; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - this.services = new Resource$Services(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Api is a light-weight descriptor for an API Interface. Interfaces are also - * described as "protocol buffer services" in some contexts, such as - * by the "service" keyword in a .proto file, but they are different - * from API Services, which represent a concrete implementation of an interface - * as opposed to simply a description of methods and bindings. They are also - * sometimes simply referred to as "APIs" in other contexts, such as - * the name of this message itself. See - * https://cloud.google.com/apis/design/glossary for detailed terminology. - */ -export interface Schema$Api { - /** - * The methods of this interface, in unspecified order. - */ - methods: Schema$Method[]; - /** - * Included interfaces. See Mixin. - */ - mixins: Schema$Mixin[]; - /** - * The fully qualified name of this interface, including package name followed - * by the interface's simple name. - */ - name: string; - /** - * Any metadata attached to the interface. - */ - options: Schema$Option[]; - /** - * Source context for the protocol buffer service represented by this message. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax of the service. - */ - syntax: string; - /** - * A version string for this interface. If specified, must have the form - * `major-version.minor-version`, as in `1.10`. If the minor version is - * omitted, it defaults to zero. If the entire version field is empty, the - * major version is derived from the package name, as outlined below. If the - * field is not empty, the version in the package name will be verified to be - * consistent with what is provided here. The versioning schema uses - * [semantic versioning](http://semver.org) where the major version number - * indicates a breaking change and the minor version an additive, non-breaking - * change. Both version numbers are signals to users what to expect from - * different versions, and should be carefully chosen based on the product - * plan. The major version is also reflected in the package name of the - * interface, which must end in `v<major-version>`, as in - * `google.feature.v1`. For major versions 0 and 1, the suffix can be omitted. - * Zero major versions must only be used for experimental, non-GA interfaces. - */ - version: string; -} -/** - * `Authentication` defines the authentication configuration for an API. Example - * for an API targeted for external use: name: calendar.googleapis.com - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Authentication { - /** - * Defines a set of authentication providers that a service supports. - */ - providers: Schema$AuthProvider[]; - /** - * A list of authentication rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$AuthenticationRule[]; -} -/** - * Authentication rules for the service. By default, if a method has any - * authentication requirements, every request must include a valid credential - * matching one of the requirements. It's an error to include more than one - * kind of credential in a single request. If a method doesn't have any - * auth requirements, request credentials will be ignored. - */ -export interface Schema$AuthenticationRule { - /** - * If true, the service accepts API keys without any other credential. - */ - allowWithoutCredential: boolean; - /** - * Configuration for custom authentication. - */ - customAuth: Schema$CustomAuthRequirements; - /** - * The requirements for OAuth credentials. - */ - oauth: Schema$OAuthRequirements; - /** - * Requirements for additional authentication providers. - */ - requirements: Schema$AuthRequirement[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Configuration of authorization. This section determines the authorization - * provider, if unspecified, then no authorization check will be done. Example: - * experimental: authorization: provider: - * firebaserules.googleapis.com - */ -export interface Schema$AuthorizationConfig { - /** - * The name of the authorization provider, such as - * firebaserules.googleapis.com. - */ - provider: string; -} -/** - * Configuration for an anthentication provider, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthProvider { - /** - * The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * Redirect URL if JWT token is required but no present or is expired. - * Implement authorizationUrl of securityDefinitions in OpenAPI spec. - */ - authorizationUrl: string; - /** - * The unique identifier of the auth provider. It will be referred to by - * `AuthRequirement.provider_id`. Example: "bookstore_auth". - */ - id: string; - /** - * Identifies the principal that issued the JWT. See - * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 - * Usually a URL or an email address. Example: https://securetoken.google.com - * Example: 1234567-compute@developer.gserviceaccount.com - */ - issuer: string; - /** - * URL of the provider's public key set to validate signature of the JWT. - * See [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). - * Optional if the key set document: - can be retrieved from [OpenID - * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of - * the issuer. - can be inferred from the email domain of the issuer (e.g. a - * Google service account). Example: - * https://www.googleapis.com/oauth2/v1/certs - */ - jwksUri: string; -} -/** - * User-defined authentication requirements, including support for [JSON Web - * Token (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). - */ -export interface Schema$AuthRequirement { - /** - * NOTE: This will be deprecated soon, once AuthProvider.audiences is - * implemented and accepted in all the runtime components. The list of JWT - * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). - * that are allowed to access. A JWT containing any of these audiences will be - * accepted. When this setting is absent, only JWTs with audience - * "https://Service_name/API_name" will be accepted. For example, if - * no audiences are in the setting, LibraryService API will only accept JWTs - * with the following audience - * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". - * Example: audiences: bookstore_android.apps.googleusercontent.com, - * bookstore_web.apps.googleusercontent.com - */ - audiences: string; - /** - * id from authentication provider. Example: provider_id: bookstore_auth - */ - providerId: string; -} -/** - * `Backend` defines the backend configuration for a service. - */ -export interface Schema$Backend { - /** - * A list of API backend rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$BackendRule[]; -} -/** - * A backend rule provides configuration for an individual API element. - */ -export interface Schema$BackendRule { - /** - * The address of the API backend. - */ - address: string; - /** - * The number of seconds to wait for a response from a request. The default - * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 seconds. - */ - deadline: number; - /** - * Minimum deadline in seconds needed for this method. Calls having deadline - * value lower than this will be rejected. - */ - minDeadline: number; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Billing related configuration of the service. The following example shows - * how to configure monitored resources and metrics for billing: - * monitored_resources: - type: library.googleapis.com/branch labels: - * - key: /city description: The city where the library branch is - * located in. - key: /name description: The name of the branch. - * metrics: - name: library.googleapis.com/book/borrowed_count metric_kind: - * DELTA value_type: INT64 billing: consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/borrowed_count - */ -export interface Schema$Billing { - /** - * Billing configurations for sending metrics to the consumer project. There - * can be multiple consumer destinations per service, each one must have a - * different monitored resource type. A metric can be used in at most one - * consumer destination. - */ - consumerDestinations: Schema$BillingDestination[]; -} -/** - * Configuration of a specific billing destination (Currently only support bill - * against consumer project). - */ -export interface Schema$BillingDestination { - /** - * Names of the metrics to report to this billing destination. Each name must - * be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * `Context` defines which contexts an API requests. Example: context: - * rules: - selector: "*" requested: - - * google.rpc.context.ProjectContext - google.rpc.context.OriginContext - * The above specifies that all methods in the API request - * `google.rpc.context.ProjectContext` and `google.rpc.context.OriginContext`. - * Available context types are defined in package `google.rpc.context`. This - * also provides mechanism to whitelist any protobuf message extension that can - * be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and - * “x-goog-ext-<extension_id>-jspb” format. For example, list any service - * specific protobuf types that can appear in grpc metadata as follows in your - * yaml file: Example: context: rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allowed_request_extensions: - google.foo.v1.NewExtension - * allowed_response_extensions: - google.foo.v1.NewExtension You can - * also specify extension ID instead of fully qualified extension name here. - */ -export interface Schema$Context { - /** - * A list of RPC context rules that apply to individual API methods. **NOTE:** - * All service configuration rules follow "last one wins" order. - */ - rules: Schema$ContextRule[]; -} -/** - * A context rule provides information about the context for an individual API - * element. - */ -export interface Schema$ContextRule { - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from client to backend. - */ - allowedRequestExtensions: string[]; - /** - * A list of full type names or extension IDs of extensions allowed in grpc - * side channel from backend to client. - */ - allowedResponseExtensions: string[]; - /** - * A list of full type names of provided contexts. - */ - provided: string[]; - /** - * A list of full type names of requested contexts. - */ - requested: string[]; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Selects and configures the service controller used by the service. The - * service controller handles features like abuse, quota, billing, logging, - * monitoring, etc. - */ -export interface Schema$Control { - /** - * The service control environment to use. If empty, no control plane feature - * (like quota and billing) will be enabled. - */ - environment: string; -} -/** - * Configuration for a custom authentication provider. - */ -export interface Schema$CustomAuthRequirements { - /** - * A configuration string containing connection information for the - * authentication provider, typically formatted as a SmartService string - * (go/smartservice). - */ - provider: string; -} -/** - * Customize service error responses. For example, list any service specific - * protobuf types that can appear in error detail lists of error responses. - * Example: custom_error: types: - google.foo.v1.CustomError - - * google.foo.v1.AnotherError - */ -export interface Schema$CustomError { - /** - * The list of custom error rules that apply to individual API messages. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$CustomErrorRule[]; - /** - * The list of custom error detail types, e.g. - * 'google.foo.v1.CustomError'. - */ - types: string[]; -} -/** - * A custom error rule. - */ -export interface Schema$CustomErrorRule { - /** - * Mark this message as possible payload in error response. Otherwise, - * objects of this type will be filtered when they appear in error payload. - */ - isErrorType: boolean; - /** - * Selects messages to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A custom pattern is used for defining custom HTTP verb. - */ -export interface Schema$CustomHttpPattern { - /** - * The name of this custom HTTP verb. - */ - kind: string; - /** - * The path matched by this custom verb. - */ - path: string; -} -/** - * Request message for DisableService method. - */ -export interface Schema$DisableServiceRequest {} -/** - * `Documentation` provides the information for describing a service. Example: - * <pre><code>documentation: summary: > The Google Calendar - * API gives access to most calendar features. pages: - name: Overview - * content: &#40;== include google/foo/overview.md ==&#41; - name: - * Tutorial content: &#40;== include google/foo/tutorial.md ==&#41; - * subpages; - name: Java content: &#40;== include - * google/foo/tutorial_java.md ==&#41; rules: - selector: - * google.calendar.Calendar.Get description: > ... - selector: - * google.calendar.Calendar.Put description: > ... - * </code></pre> Documentation is provided in markdown syntax. In - * addition to standard markdown features, definition lists, tables and fenced - * code blocks are supported. Section headers can be provided and are - * interpreted relative to the section nesting of the context where a - * documentation fragment is embedded. Documentation from the IDL is merged - * with documentation defined via the config at normalization time, where - * documentation provided by config rules overrides IDL provided. A number of - * constructs specific to the API platform are supported in documentation text. - * In order to reference a proto element, the following notation can be used: - * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> - * To override the display text used for the link, this can be used: - * <pre><code>&#91;display - * text]&#91;fully.qualified.proto.name]</code></pre> Text can - * be excluded from doc using the following notation: - * <pre><code>&#40;-- internal comment - * --&#41;</code></pre> A few directives are available in - * documentation. Note that directives must appear on a single line to be - * properly identified. The `include` directive includes a markdown file from an - * external source: <pre><code>&#40;== include path/to/file - * ==&#41;</code></pre> The `resource_for` directive marks a - * message to be the resource of a collection in REST view. If it is not - * specified, tools attempt to infer the resource from the operations in a - * collection: <pre><code>&#40;== resource_for v1.shelves.books - * ==&#41;</code></pre> The directive `suppress_warning` does - * not directly affect documentation and is documented together with service - * config validation. - */ -export interface Schema$Documentation { - /** - * The URL to the root of documentation. - */ - documentationRootUrl: string; - /** - * Declares a single overview page. For example: - * <pre><code>documentation: summary: ... overview: - * &#40;== include overview.md ==&#41; </code></pre> This - * is a shortcut for the following declaration (using pages style): - * <pre><code>documentation: summary: ... pages: - name: - * Overview content: &#40;== include overview.md ==&#41; - * </code></pre> Note: you cannot specify both `overview` field - * and `pages` field. - */ - overview: string; - /** - * The top level pages for the documentation set. - */ - pages: Schema$Page[]; - /** - * A list of documentation rules that apply to individual API elements. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$DocumentationRule[]; - /** - * A short summary of what the service does. Can only be provided by plain - * text. - */ - summary: string; -} -/** - * A documentation rule provides information about individual API elements. - */ -export interface Schema$DocumentationRule { - /** - * Deprecation description of the selected element(s). It can be provided if - * an element is marked as `deprecated`. - */ - deprecationDescription: string; - /** - * Description of the selected API(s). - */ - description: string; - /** - * The selector is a comma-separated list of patterns. Each pattern is a - * qualified name of the element which may end in "*", indicating a - * wildcard. Wildcards are only allowed at the end and for a whole component - * of the qualified name, i.e. "foo.*" is ok, but not - * "foo.b*" or "foo.*.bar". To specify a default for all - * applicable elements, the whole pattern "*" is used. - */ - selector: string; -} -/** - * Request message for EnableService method. - */ -export interface Schema$EnableServiceRequest {} -/** - * `Endpoint` describes a network endpoint that serves a set of APIs. A service - * may expose any number of endpoints, and all endpoints share the same service - * configuration, such as quota configuration and monitoring configuration. - * Example service configuration: name: library-example.googleapis.com - * endpoints: # Below entry makes - * 'google.example.library.v1.Library' # API be served from - * endpoint address library-example.googleapis.com. # It also allows HTTP - * OPTIONS calls to be passed to the backend, for # it to decide whether - * the subsequent cross-origin request is # allowed to proceed. - - * name: library-example.googleapis.com allow_cors: true - */ -export interface Schema$Endpoint { - /** - * DEPRECATED: This field is no longer supported. Instead of using aliases, - * please specify multiple google.api.Endpoint for each of the intended - * aliases. Additional names that this endpoint will be hosted on. - */ - aliases: string[]; - /** - * Allowing - * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka - * cross-domain traffic, would allow the backends served from this endpoint to - * receive and respond to HTTP OPTIONS requests. The response will be used by - * the browser to determine whether the subsequent cross-origin request is - * allowed to proceed. - */ - allowCors: boolean; - /** - * The list of features enabled on this endpoint. - */ - features: string[]; - /** - * The canonical name of this endpoint. - */ - name: string; - /** - * The specification of an Internet routable address of API frontend that will - * handle requests to this [API - * Endpoint](https://cloud.google.com/apis/design/glossary). It should be - * either a valid IPv4 address or a fully-qualified domain name. For example, - * "8.8.8.8" or "myservice.appspot.com". - */ - target: string; -} -/** - * Enum type definition. - */ -export interface Schema$Enum { - /** - * Enum value definitions. - */ - enumvalue: Schema$EnumValue[]; - /** - * Enum type name. - */ - name: string; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; - /** - * The source context. - */ - sourceContext: Schema$SourceContext; - /** - * The source syntax. - */ - syntax: string; -} -/** - * Enum value definition. - */ -export interface Schema$EnumValue { - /** - * Enum value name. - */ - name: string; - /** - * Enum value number. - */ - number: number; - /** - * Protocol buffer options. - */ - options: Schema$Option[]; -} -/** - * Experimental service configuration. These configuration options can only be - * used by whitelisted users. - */ -export interface Schema$Experimental { - /** - * Authorization configuration. - */ - authorization: Schema$AuthorizationConfig; -} -/** - * A single field of a message type. - */ -export interface Schema$Field { - /** - * The field cardinality. - */ - cardinality: string; - /** - * The string value of the default value of this field. Proto2 syntax only. - */ - defaultValue: string; - /** - * The field JSON name. - */ - jsonName: string; - /** - * The field type. - */ - kind: string; - /** - * The field name. - */ - name: string; - /** - * The field number. - */ - number: number; - /** - * The index of the field type in `Type.oneofs`, for message or enumeration - * types. The first type has index 1; zero means the type is not in the list. - */ - oneofIndex: number; - /** - * The protocol buffer options. - */ - options: Schema$Option[]; - /** - * Whether to use alternative packed wire representation. - */ - packed: boolean; - /** - * The field type URL, without the scheme, for message or enumeration types. - * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - */ - typeUrl: string; -} -/** - * Defines the HTTP configuration for an API service. It contains a list of - * HttpRule, each specifying the mapping of an RPC method to one or more HTTP - * REST API methods. - */ -export interface Schema$Http { - /** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where - * "%2F" will be left encoded. The default behavior is to not - * decode RFC 6570 reserved characters in multi segment matches. - */ - fullyDecodeReservedExpansion: boolean; - /** - * A list of HTTP configuration rules that apply to individual API methods. - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$HttpRule[]; -} -/** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST API - * methods. The mapping specifies how different portions of the RPC request - * message are mapped to URL path, URL query parameters, and HTTP request body. - * The mapping is typically specified as an `google.api.http` annotation on the - * RPC method, see "google/api/annotations.proto" for details. The - * mapping consists of a field specifying the path template and method kind. The - * path template can refer to fields in the request message, as in the example - * below which describes a REST GET operation on a resource collection of - * messages: service Messaging { rpc GetMessage(GetMessageRequest) - * returns (Message) { option (google.api.http).get = - * "/v1/messages/{message_id}/{sub.subfield}"; } } message - * GetMessageRequest { message SubMessage { string subfield = 1; - * } string message_id = 1; // mapped to the URL SubMessage sub = 2; - * // `sub.subfield` is url-mapped } message Message { string text - * = 1; // content of the resource } The same http annotation can - * alternatively be expressed inside the `GRPC API Configuration` YAML file. - * http: rules: - selector: - * <proto_package_name>.Messaging.GetMessage get: - * /v1/messages/{message_id}/{sub.subfield} This definition enables an - * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC - * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: - * "123456" sub: SubMessage(subfield: "foo"))` In general, - * not only fields but also field paths can be referenced from a path pattern. - * Fields mapped to the path pattern cannot be repeated and must have a - * primitive (non-message) type. Any fields in the request message which are - * not bound by the path pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: service - * Messaging { rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}"; } - * } message GetMessageRequest { message SubMessage { string - * subfield = 1; } string message_id = 1; // mapped to the URL int64 - * revision = 2; // becomes a parameter SubMessage sub = 3; // - * `sub.subfield` becomes a parameter } This enables a HTTP JSON to RPC - * mapping as below: HTTP | RPC -----|----- `GET - * /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: - * SubMessage(subfield: "foo"))` Note that fields which are mapped to - * HTTP parameters must have a primitive type or a repeated primitive type. - * Message types are not allowed. In the case of a repeated type, the parameter - * can be repeated in the URL, as in `...?param=A&param=B`. For HTTP method - * kinds which allow a request body, the `body` field specifies the mapping. - * Consider a REST update method on the message resource collection: service - * Messaging { rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { put: - * "/v1/messages/{message_id}" body: "message" }; - * } } message UpdateMessageRequest { string message_id = 1; // - * mapped to the URL Message message = 2; // mapped to the body } - * The following HTTP JSON to RPC mapping is enabled, where the representation - * of the JSON in the request body is determined by protos JSON encoding: HTTP - * | RPC -----|----- `PUT /v1/messages/123456 { "text": - * "Hi!" }` | `UpdateMessage(message_id: "123456" message { - * text: "Hi!" })` The special name `*` can be used in the body - * mapping to define that every field not bound by the path template should be - * mapped to the request body. This enables the following alternative - * definition of the update method: service Messaging { rpc - * UpdateMessage(Message) returns (Message) { option (google.api.http) = - * { put: "/v1/messages/{message_id}" body: - * "*" }; } } message Message { string - * message_id = 1; string text = 2; } The following HTTP JSON to RPC - * mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { - * "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` Note that when using `*` in the - * body mapping, it is not possible to have HTTP parameters, as all fields not - * bound by the path end in the body. This makes this option more rarely used in - * practice of defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. It is possible to - * define multiple HTTP methods for one RPC by using the `additional_bindings` - * option. Example: service Messaging { rpc - * GetMessage(GetMessageRequest) returns (Message) { option - * (google.api.http) = { get: "/v1/messages/{message_id}" - * additional_bindings { get: - * "/v1/users/{user_id}/messages/{message_id}" } }; - * } } message GetMessageRequest { string message_id = 1; string - * user_id = 2; } This enables the following two alternative HTTP JSON to - * RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | - * `GetMessage(message_id: "123456")` `GET - * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" - * message_id: "123456")` # Rules for HTTP mapping The rules for - * mapping HTTP path, query parameters, and body fields to the request message - * are as follows: 1. The `body` field specifies either `*` or a field path, or - * is omitted. If omitted, it indicates there is no HTTP request body. 2. - * Leaf fields (recursive expansion of nested messages in the request) can be - * classified into three types: (a) Matched in the URL template. (b) - * Covered by body (if body is `*`, everything except (a) fields; else - * everything under the body field) (c) All other fields. 3. URL query - * parameters found in the HTTP request are mapped to (c) fields. 4. Any body - * sent with an HTTP request can contain only (b) fields. The syntax of the - * path template is as follows: Template = "/" Segments [ Verb ] - * ; Segments = Segment { "/" Segment } ; Segment = - * "*" | "**" | LITERAL | Variable ; Variable = - * "{" FieldPath [ "=" Segments ] "}" ; FieldPath - * = IDENT { "." IDENT } ; Verb = ":" LITERAL ; The - * syntax `*` matches a single path segment. The syntax `**` matches zero or - * more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. The syntax - * `Variable` matches part of the URL path as specified by its template. A - * variable template must not contain other variables. If a variable matches a - * single path segment, its template may be omitted, e.g. `{var}` is equivalent - * to `{var=*}`. If a variable contains exactly one path segment, such as - * `"{var}"` or `"{var=*}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as `{var}`. - * If a variable contains one or more path segments, such as - * `"{var=foo/*}"` or `"{var=**}"`, when such a variable is - * expanded into a URL path, all characters except `[-_.~/0-9a-zA-Z]` are - * percent-encoded. Such variables show up in the Discovery Document as - * `{+var}`. NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** match RFC 6570 Reserved - * Expansion. The reason is that the Reserved Expansion does not expand special - * characters like `?` and `#`, which would lead to invalid URLs. NOTE: the - * field paths in variables and in the `body` must not refer to repeated fields - * or map fields. - */ -export interface Schema$HttpRule { - /** - * Additional HTTP bindings for the selector. Nested bindings must not contain - * an `additional_bindings` field themselves (that is, the nesting may only be - * one level deep). - */ - additionalBindings: Schema$HttpRule[]; - /** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. - */ - body: string; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave - * the HTTP method unspecified for this rule. The wild-card rule is useful for - * services that provide content to Web (HTML) clients. - */ - custom: Schema$CustomHttpPattern; - /** - * Used for deleting a resource. - */ - delete: string; - /** - * Used for listing and getting information about resources. - */ - get: string; - /** - * Use this only for Scotty Requests. Do not use this for bytestream methods. - * For media support, add instead [][google.bytestream.RestByteStream] as an - * API to your configuration. - */ - mediaDownload: Schema$MediaDownload; - /** - * Use this only for Scotty Requests. Do not use this for media support using - * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to - * your configuration for Bytestream methods. - */ - mediaUpload: Schema$MediaUpload; - /** - * Used for updating a resource. - */ - patch: string; - /** - * Used for creating a resource. - */ - post: string; - /** - * Used for updating a resource. - */ - put: string; - /** - * Selects methods to which this rule applies. Refer to selector for syntax - * details. - */ - selector: string; -} -/** - * A description of a label. - */ -export interface Schema$LabelDescriptor { - /** - * A human-readable description for the label. - */ - description: string; - /** - * The label key. - */ - key: string; - /** - * The type of data that can be assigned to the label. - */ - valueType: string; -} -/** - * Response message for `ListEnabledServices` method. - */ -export interface Schema$ListEnabledServicesResponse { - /** - * Token that can be passed to `ListEnabledServices` to resume a paginated - * query. - */ - nextPageToken: string; - /** - * Services enabled for the specified parent. - */ - services: Schema$PublishedService[]; -} -/** - * A description of a log type. Example in YAML format: - name: - * library.googleapis.com/activity_history description: The history of - * borrowing and returning library items. display_name: Activity labels: - * - key: /customer_id description: Identifier of a library customer - */ -export interface Schema$LogDescriptor { - /** - * A human-readable description of this log. This information appears in the - * documentation and can contain details. - */ - description: string; - /** - * The human-readable name for this log. This information appears on the user - * interface and should be concise. - */ - displayName: string; - /** - * The set of labels that are available to describe a specific log entry. - * Runtime requests that contain labels not specified here are considered - * invalid. - */ - labels: Schema$LabelDescriptor[]; - /** - * The name of the log. It must be less than 512 characters long and can - * include the following characters: upper- and lower-case alphanumeric - * characters [A-Za-z0-9], and punctuation characters including slash, - * underscore, hyphen, period [/_-.]. - */ - name: string; -} -/** - * Logging configuration of the service. The following example shows how to - * configure logs to be sent to the producer and consumer projects. In the - * example, the `activity_history` log is sent to both the producer and consumer - * projects, whereas the `purchase_history` log is only sent to the producer - * project. monitored_resources: - type: library.googleapis.com/branch - * labels: - key: /city description: The city where the library - * branch is located in. - key: /name description: The name of the - * branch. logs: - name: activity_history labels: - key: - * /customer_id - name: purchase_history logging: producer_destinations: - * - monitored_resource: library.googleapis.com/branch logs: - - * activity_history - purchase_history consumer_destinations: - - * monitored_resource: library.googleapis.com/branch logs: - - * activity_history - */ -export interface Schema$Logging { - /** - * Logging configurations for sending logs to the consumer project. There can - * be multiple consumer destinations, each one must have a different monitored - * resource type. A log can be used in at most one consumer destination. - */ - consumerDestinations: Schema$LoggingDestination[]; - /** - * Logging configurations for sending logs to the producer project. There can - * be multiple producer destinations, each one must have a different monitored - * resource type. A log can be used in at most one producer destination. - */ - producerDestinations: Schema$LoggingDestination[]; -} -/** - * Configuration of a specific logging destination (the producer project or the - * consumer project). - */ -export interface Schema$LoggingDestination { - /** - * Names of the logs to be sent to this destination. Each name must be defined - * in the Service.logs section. If the log name is not a domain scoped name, - * it will be automatically prefixed with the service name followed by - * "/". - */ - logs: string[]; - /** - * The monitored resource type. The type must be defined in the - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * Defines the Media configuration for a service in case of a download. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaDownload { - /** - * A boolean that determines whether a notification for the completion of a - * download should be sent to the backend. - */ - completeNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the download service if one is used for download. - */ - downloadService: string; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether download is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for direct download. The size is specified - * in bytes. - */ - maxDirectDownloadSize: string; - /** - * A boolean that determines if direct download from ESF should be used for - * download of this media. - */ - useDirectDownload: boolean; -} -/** - * Defines the Media configuration for a service in case of an upload. Use this - * only for Scotty Requests. Do not use this for media support using Bytestream, - * add instead [][google.bytestream.RestByteStream] as an API to your - * configuration for Bytestream methods. - */ -export interface Schema$MediaUpload { - /** - * A boolean that determines whether a notification for the completion of an - * upload should be sent to the backend. These notifications will not be seen - * by the client and will not consume quota. - */ - completeNotification: boolean; - /** - * Name of the Scotty dropzone to use for the current API. - */ - dropzone: string; - /** - * Whether upload is enabled. - */ - enabled: boolean; - /** - * Optional maximum acceptable size for an upload. The size is specified in - * bytes. - */ - maxSize: string; - /** - * An array of mimetype patterns. Esf will only accept uploads that match one - * of the given patterns. - */ - mimeTypes: string[]; - /** - * Whether to receive a notification for progress changes of media upload. - */ - progressNotification: boolean; - /** - * Whether to receive a notification on the start of media upload. - */ - startNotification: boolean; - /** - * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify - * name of the upload service if one is used for upload. - */ - uploadService: string; -} -/** - * Method represents a method of an API interface. - */ -export interface Schema$Method { - /** - * The simple name of this method. - */ - name: string; - /** - * Any metadata attached to the method. - */ - options: Schema$Option[]; - /** - * If true, the request is streamed. - */ - requestStreaming: boolean; - /** - * A URL of the input message type. - */ - requestTypeUrl: string; - /** - * If true, the response is streamed. - */ - responseStreaming: boolean; - /** - * The URL of the output message type. - */ - responseTypeUrl: string; - /** - * The source syntax of this method. - */ - syntax: string; -} -/** - * Defines a metric type and its schema. Once a metric descriptor is created, - * deleting or altering it stops data collection and makes the metric type's - * existing data unusable. - */ -export interface Schema$MetricDescriptor { - /** - * A detailed description of the metric, which can be used in documentation. - */ - description: string; - /** - * A concise name for the metric, which can be displayed in user interfaces. - * Use sentence case without an ending period, for example "Request - * count". This field is optional but it is recommended to be set for any - * metrics associated with user-visible concepts, such as Quota. - */ - displayName: string; - /** - * The set of labels that can be used to describe a specific instance of this - * metric type. For example, the - * `appengine.googleapis.com/http/server/response_latencies` metric type has a - * label for the HTTP response code, `response_code`, so you can look at - * latencies for successful responses or just for responses that failed. - */ - labels: Schema$LabelDescriptor[]; - /** - * Whether the metric records instantaneous values, changes to a value, etc. - * Some combinations of `metric_kind` and `value_type` might not be supported. - */ - metricKind: string; - /** - * The resource name of the metric descriptor. - */ - name: string; - /** - * The metric type, including its DNS name prefix. The type is not - * URL-encoded. All user-defined custom metric types have the DNS name - * `custom.googleapis.com`. Metric types should use a natural hierarchical - * grouping. For example: - * "custom.googleapis.com/invoice/paid/amount" - * "appengine.googleapis.com/http/server/response_latencies" - */ - type: string; - /** - * The unit in which the metric value is reported. It is only applicable if - * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported - * units are a subset of [The Unified Code for Units of - * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units - * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute * - * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo (10**3) * - * `M` mega (10**6) * `G` giga (10**9) * `T` tera (10**12) * - * `P` peta (10**15) * `E` exa (10**18) * `Z` zetta - * (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * `u` micro - * (10**-6) * `n` nano (10**-9) * `p` pico (10**-12) * `f` femto - * (10**-15) * `a` atto (10**-18) * `z` zepto (10**-21) * `y` - * yocto (10**-24) * `Ki` kibi (2**10) * `Mi` mebi (2**20) * - * `Gi` gibi (2**30) * `Ti` tebi (2**40) **Grammar** The grammar - * also includes these connectors: * `/` division (as an infix operator, - * e.g. `1/s`). * `.` multiplication (as an infix operator, e.g. `GBy.d`) - * The grammar for a unit is as follows: Expression = Component { - * "." Component } { "/" Component } ; Component = ( - * [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation - * | "1" ; Annotation = "{" NAME - * "}" ; Notes: * `Annotation` is just a comment if it follows a - * `UNIT` and is equivalent to `1` if it is used alone. For examples, - * `{requests}/s == 1/s`, `By{transmitted}/s == By/s`. * `NAME` is a sequence - * of non-blank printable ASCII characters not containing '{' or - * '}'. * `1` represents dimensionless value 1, such as in `1/s`. * - * `%` represents dimensionless value 1/100, and annotates values giving a - * percentage. - */ - unit: string; - /** - * Whether the measurement is an integer, a floating-point number, etc. Some - * combinations of `metric_kind` and `value_type` might not be supported. - */ - valueType: string; -} -/** - * Bind API methods to metrics. Binding a method to a metric causes that - * metric's configured quota behaviors to apply to the method call. - */ -export interface Schema$MetricRule { - /** - * Metrics to update when the selected methods are called, and the associated - * cost applied to each metric. The key of the map is the metric name, and - * the values are the amount increased for the metric against which the quota - * limits are defined. The value must not be negative. - */ - metricCosts: any; - /** - * Selects the methods to which this rule applies. Refer to selector for - * syntax details. - */ - selector: string; -} -/** - * Declares an API Interface to be included in this interface. The including - * interface must redeclare all the methods from the included interface, but - * documentation and options are inherited as follows: - If after comment and - * whitespace stripping, the documentation string of the redeclared method is - * empty, it will be inherited from the original method. - Each annotation - * belonging to the service config (http, visibility) which is not set in the - * redeclared method will be inherited. - If an http annotation is inherited, - * the path pattern will be modified as follows. Any version prefix will be - * replaced by the version of the including interface plus the root path if - * specified. Example of a simple mixin: package google.acl.v1; service - * AccessControl { // Get the underlying ACL object. rpc - * GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get = - * "/v1/{resource=**}:getAcl"; } } package - * google.storage.v2; service Storage { // rpc - * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc - * GetData(GetDataRequest) returns (Data) { option (google.api.http).get - * = "/v2/{resource=**}"; } } Example of a mixin - * configuration: apis: - name: google.storage.v2.Storage mixins: - * - name: google.acl.v1.AccessControl The mixin construct implies that all - * methods in `AccessControl` are also declared with same name and - * request/response types in `Storage`. A documentation generator or annotation - * processor will see the effective `Storage.GetAcl` method after inherting - * documentation and annotations as follows: service Storage { // Get - * the underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { - * option (google.api.http).get = "/v2/{resource=**}:getAcl"; } - * ... } Note how the version in the path pattern changed from `v1` to - * `v2`. If the `root` field in the mixin is specified, it should be a relative - * path under which inherited HTTP paths are placed. Example: apis: - - * name: google.storage.v2.Storage mixins: - name: - * google.acl.v1.AccessControl root: acls This implies the following - * inherited HTTP annotation: service Storage { // Get the underlying - * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option - * (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; } - * ... } - */ -export interface Schema$Mixin { - /** - * The fully qualified name of the interface which is included. - */ - name: string; - /** - * If non-empty specifies a path under which inherited HTTP paths are rooted. - */ - root: string; -} -/** - * An object that describes the schema of a MonitoredResource object using a - * type name and a set of labels. For example, the monitored resource - * descriptor for Google Compute Engine VM instances has a type of - * `"gce_instance"` and specifies the use of the labels - * `"instance_id"` and `"zone"` to identify particular VM - * instances. Different APIs can support different monitored resource types. - * APIs generally provide a `list` method that returns the monitored resource - * descriptors used by the API. - */ -export interface Schema$MonitoredResourceDescriptor { - /** - * Optional. A detailed description of the monitored resource type that might - * be used in documentation. - */ - description: string; - /** - * Optional. A concise name for the monitored resource type that might be - * displayed in user interfaces. It should be a Title Cased Noun Phrase, - * without any article or other determiners. For example, `"Google Cloud - * SQL Database"`. - */ - displayName: string; - /** - * Required. A set of labels used to describe instances of this monitored - * resource type. For example, an individual Google Cloud SQL database is - * identified by values for the labels `"database_id"` and - * `"zone"`. - */ - labels: Schema$LabelDescriptor[]; - /** - * Optional. The resource name of the monitored resource descriptor: - * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` - * where {type} is the value of the `type` field in this object and - * {project_id} is a project ID that provides API-specific context for - * accessing the type. APIs that do not use project information can use the - * resource name format `"monitoredResourceDescriptors/{type}"`. - */ - name: string; - /** - * Required. The monitored resource type. For example, the type - * `"cloudsql_database"` represents databases in Google Cloud SQL. - * The maximum length of this value is 256 characters. - */ - type: string; -} -/** - * Monitoring configuration of the service. The example below shows how to - * configure monitored resources and metrics for monitoring. In the example, a - * monitored resource and two metrics are defined. The - * `library.googleapis.com/book/returned_count` metric is sent to both producer - * and consumer projects, whereas the - * `library.googleapis.com/book/overdue_count` metric is only sent to the - * consumer project. monitored_resources: - type: - * library.googleapis.com/branch labels: - key: /city description: - * The city where the library branch is located in. - key: /name - * description: The name of the branch. metrics: - name: - * library.googleapis.com/book/returned_count metric_kind: DELTA - * value_type: INT64 labels: - key: /customer_id - name: - * library.googleapis.com/book/overdue_count metric_kind: GAUGE - * value_type: INT64 labels: - key: /customer_id monitoring: - * producer_destinations: - monitored_resource: - * library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count consumer_destinations: - - * monitored_resource: library.googleapis.com/branch metrics: - - * library.googleapis.com/book/returned_count - - * library.googleapis.com/book/overdue_count - */ -export interface Schema$Monitoring { - /** - * Monitoring configurations for sending metrics to the consumer project. - * There can be multiple consumer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one consumer - * destination. - */ - consumerDestinations: Schema$MonitoringDestination[]; - /** - * Monitoring configurations for sending metrics to the producer project. - * There can be multiple producer destinations, each one must have a different - * monitored resource type. A metric can be used in at most one producer - * destination. - */ - producerDestinations: Schema$MonitoringDestination[]; -} -/** - * Configuration of a specific monitoring destination (the producer project or - * the consumer project). - */ -export interface Schema$MonitoringDestination { - /** - * Names of the metrics to report to this monitoring destination. Each name - * must be defined in Service.metrics section. - */ - metrics: string[]; - /** - * The monitored resource type. The type must be defined in - * Service.monitored_resources section. - */ - monitoredResource: string; -} -/** - * OAuth scopes are a way to define data and permissions on data. For example, - * there are scopes defined for "Read-only access to Google Calendar" - * and "Access to Cloud Platform". Users can consent to a scope for an - * application, giving it permission to access that data on their behalf. OAuth - * scope specifications should be fairly coarse grained; a user will need to see - * and understand the text description of what your scope means. In most cases: - * use one or at most two OAuth scopes for an entire family of products. If your - * product has multiple APIs, you should probably be sharing the OAuth scope - * across all of those APIs. When you need finer grained OAuth consent screens: - * talk with your product management about how developers will use them in - * practice. Please note that even though each of the canonical scopes is - * enough for a request to be accepted and passed to the backend, a request can - * still fail due to the backend requiring additional scopes or permissions. - */ -export interface Schema$OAuthRequirements { - /** - * The list of publicly documented OAuth scopes that are allowed access. An - * OAuth token containing any of these scopes will be accepted. Example: - * canonical_scopes: https://www.googleapis.com/auth/calendar, - * https://www.googleapis.com/auth/calendar.read - */ - canonicalScopes: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; +export namespace serviceuser_v1 { /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The metadata associated with a long running operation resource. - */ -export interface Schema$OperationMetadata { - /** - * Percentage of completion of this operation, ranging from 0 to 100. - */ - progressPercentage: number; - /** - * The full name of the resources that this operation is directly associated - * with. - */ - resourceNames: string[]; - /** - * The start time of the operation. - */ - startTime: string; - /** - * Detailed status information for each step. The order is undetermined. - */ - steps: Schema$Step[]; -} -/** - * A protocol buffer option, which can be attached to a message, field, - * enumeration, etc. - */ -export interface Schema$Option { - /** - * The option's name. For protobuf built-in options (options defined in - * descriptor.proto), this is the short name. For example, - * `"map_entry"`. For custom options, it should be the - * fully-qualified name. For example, `"google.api.http"`. - */ - name: string; - /** - * The option's value packed in an Any message. If the value is a - * primitive, the corresponding wrapper type defined in - * google/protobuf/wrappers.proto should be used. If the value is an enum, it - * should be stored as an int32 value using the google.protobuf.Int32Value - * type. - */ - value: any; -} -/** - * Represents a documentation page. A page can contain subpages to represent - * nested documentation set structure. - */ -export interface Schema$Page { - /** - * The Markdown content of the page. You can use <code>&#40;== - * include {path} ==&#41;</code> to include content from a Markdown - * file. - */ - content: string; - /** - * The name of the page. It will be used as an identity of the page to - * generate URI of the page, text of the link to this page in navigation, etc. - * The full page name (start from the root page name to this page concatenated - * with `.`) can be used as reference to the page in your documentation. For - * example: <pre><code>pages: - name: Tutorial content: - * &#40;== include tutorial.md ==&#41; subpages: - name: Java - * content: &#40;== include tutorial_java.md ==&#41; - * </code></pre> You can reference `Java` page using Markdown - * reference link syntax: `Java`. - */ - name: string; - /** - * Subpages of this page. The order of subpages specified here will be honored - * in the generated docset. - */ - subpages: Schema$Page[]; -} -/** - * The published version of a Service that is managed by Google Service - * Management. - */ -export interface Schema$PublishedService { - /** - * The resource name of the service. A valid name would be: - - * services/serviceuser.googleapis.com - */ - name: string; - /** - * The service's published configuration. - */ - service: Schema$Service; -} -/** - * Quota configuration helps to achieve fairness and budgeting in service usage. - * The quota configuration works this way: - The service configuration defines a - * set of metrics. - For API calls, the quota.metric_rules maps methods to - * metrics with corresponding costs. - The quota.limits defines limits on the - * metrics, which will be used for quota checks at runtime. An example quota - * configuration in yaml format: quota: - name: apiWriteQpsPerProject - * metric: library.googleapis.com/write_calls unit: - * "1/min/{project}" # rate limit for consumer projects values: - * STANDARD: 10000 # The metric rules bind all methods to the read_calls - * metric, # except for the UpdateBook and DeleteBook methods. These two - * methods # are mapped to the write_calls metric, with the UpdateBook - * method # consuming at twice rate as the DeleteBook method. metric_rules: - * - selector: "*" metric_costs: - * library.googleapis.com/read_calls: 1 - selector: - * google.example.library.v1.LibraryService.UpdateBook metric_costs: - * library.googleapis.com/write_calls: 2 - selector: - * google.example.library.v1.LibraryService.DeleteBook metric_costs: - * library.googleapis.com/write_calls: 1 Corresponding Metric definition: - * metrics: - name: library.googleapis.com/read_calls display_name: - * Read requests metric_kind: DELTA value_type: INT64 - - * name: library.googleapis.com/write_calls display_name: Write requests - * metric_kind: DELTA value_type: INT64 - */ -export interface Schema$Quota { - /** - * List of `QuotaLimit` definitions for the service. - */ - limits: Schema$QuotaLimit[]; - /** - * List of `MetricRule` definitions, each one mapping a selected method to one - * or more metrics. - */ - metricRules: Schema$MetricRule[]; -} -/** - * `QuotaLimit` defines a specific limit that applies over a specified duration - * for a limit type. There can be at most one limit for a duration and limit - * type combination defined within a `QuotaGroup`. - */ -export interface Schema$QuotaLimit { - /** - * Default number of tokens that can be consumed during the specified - * duration. This is the number of tokens assigned when a client application - * developer activates the service for his/her project. Specifying a value of - * 0 will block all requests. This can be used if you are provisioning quota - * to selected consumers and blocking others. Similarly, a value of -1 will - * indicate an unlimited quota. No other negative values are allowed. Used by - * group-based quotas only. - */ - defaultLimit: string; - /** - * Optional. User-visible, extended description for this quota limit. Should - * be used only when more context is needed to understand this limit than - * provided by the limit's display name (see: `display_name`). - */ - description: string; - /** - * User-visible display name for this limit. Optional. If not set, the UI will - * provide a default display name based on the quota configuration. This field - * can be used to override the default display name generated from the - * configuration. - */ - displayName: string; - /** - * Duration of this limit in textual notation. Example: "100s", - * "24h", "1d". For duration longer than a day, only - * multiple of days is supported. We support only "100s" and - * "1d" for now. Additional support will be added in the future. - * "0" indicates indefinite duration. Used by group-based quotas - * only. - */ - duration: string; - /** - * Free tier value displayed in the Developers Console for this limit. The - * free tier is the number of tokens that will be subtracted from the billed - * amount when billing is enabled. This field can only be set on a limit with - * duration "1d", in a billable group; it is invalid on any other - * limit. If this field is not set, it defaults to 0, indicating that there is - * no free tier for this service. Used by group-based quotas only. - */ - freeTier: string; - /** - * Maximum number of tokens that can be consumed during the specified - * duration. Client application developers can override the default limit up - * to this maximum. If specified, this value cannot be set to a value less - * than the default limit. If not specified, it is set to the default limit. - * To allow clients to apply overrides with no upper bound, set this to -1, - * indicating unlimited maximum quota. Used by group-based quotas only. - */ - maxLimit: string; - /** - * The name of the metric this quota limit applies to. The quota limits with - * the same metric will be checked together during runtime. The metric must be - * defined within the service config. - */ - metric: string; - /** - * Name of the quota limit. The name must be provided, and it must be unique - * within the service. The name can only include alphanumeric characters as - * well as '-'. The maximum length of the limit name is 64 - * characters. - */ - name: string; + * Service User API + * + * Enables services that service consumers want to use on Google Cloud + * Platform, lists the available or enabled services, or disables services + * that service consumers no longer use. + * + * @example + * const google = require('googleapis'); + * const serviceuser = google.serviceuser('v1'); + * + * @namespace serviceuser + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Serviceuser + */ + export class Serviceuser { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + services: Resource$Services; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + this.services = new Resource$Services(this); + } + + getRoot() { + return this.root; + } + } + /** - * Specify the unit of the quota limit. It uses the same syntax as - * Metric.unit. The supported unit kinds are determined by the quota backend - * system. Here are some examples: * "1/min/{project}" for quota - * per minute per project. Note: the order of unit components is - * insignificant. The "1" at the beginning is required to follow the - * metric unit syntax. - */ - unit: string; + * Api is a light-weight descriptor for an API Interface. Interfaces are also + * described as "protocol buffer services" in some contexts, such as + * by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an + * interface as opposed to simply a description of methods and bindings. They + * are also sometimes simply referred to as "APIs" in other + * contexts, such as the name of this message itself. See + * https://cloud.google.com/apis/design/glossary for detailed terminology. + */ + export interface Schema$Api { + /** + * The methods of this interface, in unspecified order. + */ + methods: Schema$Method[]; + /** + * Included interfaces. See Mixin. + */ + mixins: Schema$Mixin[]; + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + */ + name: string; + /** + * Any metadata attached to the interface. + */ + options: Schema$Option[]; + /** + * Source context for the protocol buffer service represented by this + * message. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax of the service. + */ + syntax: string; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to + * be consistent with what is provided here. The versioning schema uses + * [semantic versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users what to + * expect from different versions, and should be carefully chosen based on + * the product plan. The major version is also reflected in the package + * name of the interface, which must end in `v<major-version>`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can be + * omitted. Zero major versions must only be used for experimental, non-GA + * interfaces. + */ + version: string; + } /** - * Tiered limit values. You must specify this as a key:value pair, with an - * integer value that is the maximum number of requests allowed for the - * specified unit. Currently only STANDARD is supported. - */ - values: any; -} -/** - * Response message for SearchServices method. - */ -export interface Schema$SearchServicesResponse { + * `Authentication` defines the authentication configuration for an API. + * Example for an API targeted for external use: name: + * calendar.googleapis.com authentication: providers: - id: + * google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Authentication { + /** + * Defines a set of authentication providers that a service supports. + */ + providers: Schema$AuthProvider[]; + /** + * A list of authentication rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$AuthenticationRule[]; + } /** - * Token that can be passed to `ListAvailableServices` to resume a paginated - * query. - */ - nextPageToken: string; + * Authentication rules for the service. By default, if a method has any + * authentication requirements, every request must include a valid credential + * matching one of the requirements. It's an error to include more than + * one kind of credential in a single request. If a method doesn't have + * any auth requirements, request credentials will be ignored. + */ + export interface Schema$AuthenticationRule { + /** + * If true, the service accepts API keys without any other credential. + */ + allowWithoutCredential: boolean; + /** + * Configuration for custom authentication. + */ + customAuth: Schema$CustomAuthRequirements; + /** + * The requirements for OAuth credentials. + */ + oauth: Schema$OAuthRequirements; + /** + * Requirements for additional authentication providers. + */ + requirements: Schema$AuthRequirement[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Services available publicly or available to the authenticated caller. - */ - services: Schema$PublishedService[]; -} -/** - * `Service` is the root object of Google service configuration schema. It - * describes basic information about a service, such as the name and the title, - * and delegates other aspects to sub-sections. Each sub-section is either a - * proto message or a repeated proto message that configures a specific aspect, - * such as auth. See each proto message definition for details. Example: type: - * google.api.Service config_version: 3 name: calendar.googleapis.com - * title: Google Calendar API apis: - name: google.calendar.v3.Calendar - * authentication: providers: - id: google_calendar_auth jwks_uri: - * https://www.googleapis.com/oauth2/v1/certs issuer: - * https://securetoken.google.com rules: - selector: "*" - * requirements: provider_id: google_calendar_auth - */ -export interface Schema$Service { + * Configuration of authorization. This section determines the authorization + * provider, if unspecified, then no authorization check will be done. + * Example: experimental: authorization: provider: + * firebaserules.googleapis.com + */ + export interface Schema$AuthorizationConfig { + /** + * The name of the authorization provider, such as + * firebaserules.googleapis.com. + */ + provider: string; + } /** - * A list of API interfaces exported by this service. Only the `name` field of - * the google.protobuf.Api needs to be provided by the configuration author, - * as the remaining fields will be derived from the IDL during the - * normalization process. It is an error to specify an API interface here - * which cannot be resolved against the associated IDL files. - */ - apis: Schema$Api[]; + * Configuration for an anthentication provider, including support for [JSON + * Web Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthProvider { + /** + * The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * Redirect URL if JWT token is required but no present or is expired. + * Implement authorizationUrl of securityDefinitions in OpenAPI spec. + */ + authorizationUrl: string; + /** + * The unique identifier of the auth provider. It will be referred to by + * `AuthRequirement.provider_id`. Example: "bookstore_auth". + */ + id: string; + /** + * Identifies the principal that issued the JWT. See + * https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.1 + * Usually a URL or an email address. Example: + * https://securetoken.google.com Example: + * 1234567-compute@developer.gserviceaccount.com + */ + issuer: string; + /** + * URL of the provider's public key set to validate signature of the + * JWT. See [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). + * Optional if the key set document: - can be retrieved from [OpenID + * Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html of + * the issuer. - can be inferred from the email domain of the issuer (e.g. + * a Google service account). Example: + * https://www.googleapis.com/oauth2/v1/certs + */ + jwksUri: string; + } /** - * Auth configuration. - */ - authentication: Schema$Authentication; + * User-defined authentication requirements, including support for [JSON Web + * Token + * (JWT)](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32). + */ + export interface Schema$AuthRequirement { + /** + * NOTE: This will be deprecated soon, once AuthProvider.audiences is + * implemented and accepted in all the runtime components. The list of JWT + * [audiences](https://tools.ietf.org/html/draft-ietf-oauth-json-web-token-32#section-4.1.3). + * that are allowed to access. A JWT containing any of these audiences will + * be accepted. When this setting is absent, only JWTs with audience + * "https://Service_name/API_name" will be accepted. For example, + * if no audiences are in the setting, LibraryService API will only accept + * JWTs with the following audience + * "https://library-example.googleapis.com/google.example.library.v1.LibraryService". + * Example: audiences: bookstore_android.apps.googleusercontent.com, + * bookstore_web.apps.googleusercontent.com + */ + audiences: string; + /** + * id from authentication provider. Example: provider_id: + * bookstore_auth + */ + providerId: string; + } /** - * API backend configuration. + * `Backend` defines the backend configuration for a service. */ - backend: Schema$Backend; + export interface Schema$Backend { + /** + * A list of API backend rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$BackendRule[]; + } /** - * Billing configuration. - */ - billing: Schema$Billing; + * A backend rule provides configuration for an individual API element. + */ + export interface Schema$BackendRule { + /** + * The address of the API backend. + */ + address: string; + /** + * The number of seconds to wait for a response from a request. The default + * deadline for gRPC is infinite (no deadline) and HTTP requests is 5 + * seconds. + */ + deadline: number; + /** + * Minimum deadline in seconds needed for this method. Calls having deadline + * value lower than this will be rejected. + */ + minDeadline: number; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * The semantic version of the service configuration. The config version - * affects the interpretation of the service configuration. For example, - * certain features are enabled by default for certain config versions. The - * latest config version is `3`. - */ - configVersion: number; + * Billing related configuration of the service. The following example shows + * how to configure monitored resources and metrics for billing: + * monitored_resources: - type: library.googleapis.com/branch labels: - + * key: /city description: The city where the library branch is + * located in. - key: /name description: The name of the branch. + * metrics: - name: library.googleapis.com/book/borrowed_count + * metric_kind: DELTA value_type: INT64 billing: + * consumer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/borrowed_count + */ + export interface Schema$Billing { + /** + * Billing configurations for sending metrics to the consumer project. There + * can be multiple consumer destinations per service, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$BillingDestination[]; + } /** - * Context configuration. - */ - context: Schema$Context; + * Configuration of a specific billing destination (Currently only support + * bill against consumer project). + */ + export interface Schema$BillingDestination { + /** + * Names of the metrics to report to this billing destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Configuration for the service control plane. - */ - control: Schema$Control; + * `Context` defines which contexts an API requests. Example: context: + * rules: - selector: "*" requested: - + * google.rpc.context.ProjectContext - + * google.rpc.context.OriginContext The above specifies that all methods in + * the API request `google.rpc.context.ProjectContext` and + * `google.rpc.context.OriginContext`. Available context types are defined in + * package `google.rpc.context`. This also provides mechanism to whitelist + * any protobuf message extension that can be sent in grpc metadata using + * “x-goog-ext-<extension_id>-bin” and + * “x-goog-ext-<extension_id>-jspb” format. For example, list any + * service specific protobuf types that can appear in grpc metadata as follows + * in your yaml file: Example: context: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allowed_request_extensions: - google.foo.v1.NewExtension + * allowed_response_extensions: - google.foo.v1.NewExtension You can + * also specify extension ID instead of fully qualified extension name here. + */ + export interface Schema$Context { + /** + * A list of RPC context rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$ContextRule[]; + } /** - * Custom error configuration. - */ - customError: Schema$CustomError; + * A context rule provides information about the context for an individual API + * element. + */ + export interface Schema$ContextRule { + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from client to backend. + */ + allowedRequestExtensions: string[]; + /** + * A list of full type names or extension IDs of extensions allowed in grpc + * side channel from backend to client. + */ + allowedResponseExtensions: string[]; + /** + * A list of full type names of provided contexts. + */ + provided: string[]; + /** + * A list of full type names of requested contexts. + */ + requested: string[]; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * Additional API documentation. + * Selects and configures the service controller used by the service. The + * service controller handles features like abuse, quota, billing, logging, + * monitoring, etc. */ - documentation: Schema$Documentation; + export interface Schema$Control { + /** + * The service control environment to use. If empty, no control plane + * feature (like quota and billing) will be enabled. + */ + environment: string; + } /** - * Configuration for network endpoints. If this is empty, then an endpoint - * with the same name as the service is automatically generated to service all - * defined APIs. + * Configuration for a custom authentication provider. */ - endpoints: Schema$Endpoint[]; + export interface Schema$CustomAuthRequirements { + /** + * A configuration string containing connection information for the + * authentication provider, typically formatted as a SmartService string + * (go/smartservice). + */ + provider: string; + } /** - * A list of all enum types included in this API service. Enums referenced - * directly or indirectly by the `apis` are automatically included. Enums - * which are not referenced but shall be included should be listed here by - * name. Example: enums: - name: google.someapi.v1.SomeEnum - */ - enums: Schema$Enum[]; + * Customize service error responses. For example, list any service specific + * protobuf types that can appear in error detail lists of error responses. + * Example: custom_error: types: - google.foo.v1.CustomError + * - google.foo.v1.AnotherError + */ + export interface Schema$CustomError { + /** + * The list of custom error rules that apply to individual API messages. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$CustomErrorRule[]; + /** + * The list of custom error detail types, e.g. + * 'google.foo.v1.CustomError'. + */ + types: string[]; + } /** - * Experimental configuration. - */ - experimental: Schema$Experimental; + * A custom error rule. + */ + export interface Schema$CustomErrorRule { + /** + * Mark this message as possible payload in error response. Otherwise, + * objects of this type will be filtered when they appear in error payload. + */ + isErrorType: boolean; + /** + * Selects messages to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * HTTP configuration. - */ - http: Schema$Http; + * A custom pattern is used for defining custom HTTP verb. + */ + export interface Schema$CustomHttpPattern { + /** + * The name of this custom HTTP verb. + */ + kind: string; + /** + * The path matched by this custom verb. + */ + path: string; + } /** - * A unique ID for a specific instance of this message, typically assigned by - * the client for tracking purpose. If empty, the server may choose to - * generate one instead. - */ - id: string; + * Request message for DisableService method. + */ + export interface Schema$DisableServiceRequest {} + /** + * `Documentation` provides the information for describing a service. Example: + * <pre><code>documentation: summary: > The Google + * Calendar API gives access to most calendar features. pages: - name: + * Overview content: &#40;== include google/foo/overview.md + * ==&#41; - name: Tutorial content: &#40;== include + * google/foo/tutorial.md ==&#41; subpages; - name: Java content: + * &#40;== include google/foo/tutorial_java.md ==&#41; rules: - + * selector: google.calendar.Calendar.Get description: > ... - + * selector: google.calendar.Calendar.Put description: > ... + * </code></pre> Documentation is provided in markdown syntax. In + * addition to standard markdown features, definition lists, tables and fenced + * code blocks are supported. Section headers can be provided and are + * interpreted relative to the section nesting of the context where a + * documentation fragment is embedded. Documentation from the IDL is merged + * with documentation defined via the config at normalization time, where + * documentation provided by config rules overrides IDL provided. A number of + * constructs specific to the API platform are supported in documentation + * text. In order to reference a proto element, the following notation can be + * used: + * <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> + * To override the display text used for the link, this can be used: + * <pre><code>&#91;display + * text]&#91;fully.qualified.proto.name]</code></pre> Text can + * be excluded from doc using the following notation: + * <pre><code>&#40;-- internal comment + * --&#41;</code></pre> A few directives are available in + * documentation. Note that directives must appear on a single line to be + * properly identified. The `include` directive includes a markdown file from + * an external source: <pre><code>&#40;== include path/to/file + * ==&#41;</code></pre> The `resource_for` directive marks a + * message to be the resource of a collection in REST view. If it is not + * specified, tools attempt to infer the resource from the operations in a + * collection: <pre><code>&#40;== resource_for + * v1.shelves.books ==&#41;</code></pre> The directive + * `suppress_warning` does not directly affect documentation and is documented + * together with service config validation. + */ + export interface Schema$Documentation { + /** + * The URL to the root of documentation. + */ + documentationRootUrl: string; + /** + * Declares a single overview page. For example: + * <pre><code>documentation: summary: ... overview: + * &#40;== include overview.md ==&#41; </code></pre> + * This is a shortcut for the following declaration (using pages style): + * <pre><code>documentation: summary: ... pages: - name: + * Overview content: &#40;== include overview.md ==&#41; + * </code></pre> Note: you cannot specify both `overview` field + * and `pages` field. + */ + overview: string; + /** + * The top level pages for the documentation set. + */ + pages: Schema$Page[]; + /** + * A list of documentation rules that apply to individual API elements. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$DocumentationRule[]; + /** + * A short summary of what the service does. Can only be provided by plain + * text. + */ + summary: string; + } /** - * Logging configuration. - */ - logging: Schema$Logging; + * A documentation rule provides information about individual API elements. + */ + export interface Schema$DocumentationRule { + /** + * Deprecation description of the selected element(s). It can be provided if + * an element is marked as `deprecated`. + */ + deprecationDescription: string; + /** + * Description of the selected API(s). + */ + description: string; + /** + * The selector is a comma-separated list of patterns. Each pattern is a + * qualified name of the element which may end in "*", indicating + * a wildcard. Wildcards are only allowed at the end and for a whole + * component of the qualified name, i.e. "foo.*" is ok, but not + * "foo.b*" or "foo.*.bar". To specify a default for all + * applicable elements, the whole pattern "*" is used. + */ + selector: string; + } /** - * Defines the logs used by this service. - */ - logs: Schema$LogDescriptor[]; + * Request message for EnableService method. + */ + export interface Schema$EnableServiceRequest {} + /** + * `Endpoint` describes a network endpoint that serves a set of APIs. A + * service may expose any number of endpoints, and all endpoints share the + * same service configuration, such as quota configuration and monitoring + * configuration. Example service configuration: name: + * library-example.googleapis.com endpoints: # Below entry makes + * 'google.example.library.v1.Library' # API be served from + * endpoint address library-example.googleapis.com. # It also allows + * HTTP OPTIONS calls to be passed to the backend, for # it to decide + * whether the subsequent cross-origin request is # allowed to proceed. + * - name: library-example.googleapis.com allow_cors: true + */ + export interface Schema$Endpoint { + /** + * DEPRECATED: This field is no longer supported. Instead of using aliases, + * please specify multiple google.api.Endpoint for each of the intended + * aliases. Additional names that this endpoint will be hosted on. + */ + aliases: string[]; + /** + * Allowing + * [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), aka + * cross-domain traffic, would allow the backends served from this endpoint + * to receive and respond to HTTP OPTIONS requests. The response will be + * used by the browser to determine whether the subsequent cross-origin + * request is allowed to proceed. + */ + allowCors: boolean; + /** + * The list of features enabled on this endpoint. + */ + features: string[]; + /** + * The canonical name of this endpoint. + */ + name: string; + /** + * The specification of an Internet routable address of API frontend that + * will handle requests to this [API + * Endpoint](https://cloud.google.com/apis/design/glossary). It should be + * either a valid IPv4 address or a fully-qualified domain name. For + * example, "8.8.8.8" or "myservice.appspot.com". + */ + target: string; + } /** - * Defines the metrics used by this service. - */ - metrics: Schema$MetricDescriptor[]; + * Enum type definition. + */ + export interface Schema$Enum { + /** + * Enum value definitions. + */ + enumvalue: Schema$EnumValue[]; + /** + * Enum type name. + */ + name: string; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; + } /** - * Defines the monitored resources used by this service. This is required by - * the Service.monitoring and Service.logging configurations. - */ - monitoredResources: Schema$MonitoredResourceDescriptor[]; + * Enum value definition. + */ + export interface Schema$EnumValue { + /** + * Enum value name. + */ + name: string; + /** + * Enum value number. + */ + number: number; + /** + * Protocol buffer options. + */ + options: Schema$Option[]; + } /** - * Monitoring configuration. + * Experimental service configuration. These configuration options can only be + * used by whitelisted users. */ - monitoring: Schema$Monitoring; + export interface Schema$Experimental { + /** + * Authorization configuration. + */ + authorization: Schema$AuthorizationConfig; + } /** - * The DNS address at which this service is available, e.g. - * `calendar.googleapis.com`. - */ - name: string; + * A single field of a message type. + */ + export interface Schema$Field { + /** + * The field cardinality. + */ + cardinality: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + */ + defaultValue: string; + /** + * The field JSON name. + */ + jsonName: string; + /** + * The field type. + */ + kind: string; + /** + * The field name. + */ + name: string; + /** + * The field number. + */ + number: number; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the + * list. + */ + oneofIndex: number; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * Whether to use alternative packed wire representation. + */ + packed: boolean; + /** + * The field type URL, without the scheme, for message or enumeration types. + * Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + */ + typeUrl: string; + } /** - * The Google project that owns this service. - */ - producerProjectId: string; + * Defines the HTTP configuration for an API service. It contains a list of + * HttpRule, each specifying the mapping of an RPC method to one or more HTTP + * REST API methods. + */ + export interface Schema$Http { + /** + * When set to true, URL path parmeters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where + * "%2F" will be left encoded. The default behavior is to not + * decode RFC 6570 reserved characters in multi segment matches. + */ + fullyDecodeReservedExpansion: boolean; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * **NOTE:** All service configuration rules follow "last one + * wins" order. + */ + rules: Schema$HttpRule[]; + } /** - * Quota configuration. - */ - quota: Schema$Quota; + * `HttpRule` defines the mapping of an RPC method to one or more HTTP REST + * API methods. The mapping specifies how different portions of the RPC + * request message are mapped to URL path, URL query parameters, and HTTP + * request body. The mapping is typically specified as an `google.api.http` + * annotation on the RPC method, see "google/api/annotations.proto" + * for details. The mapping consists of a field specifying the path template + * and method kind. The path template can refer to fields in the request + * message, as in the example below which describes a REST GET operation on a + * resource collection of messages: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http).get = + * "/v1/messages/{message_id}/{sub.subfield}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL SubMessage sub = + * 2; // `sub.subfield` is url-mapped } message Message { string + * text = 1; // content of the resource } The same http annotation can + * alternatively be expressed inside the `GRPC API Configuration` YAML file. + * http: rules: - selector: + * <proto_package_name>.Messaging.GetMessage get: + * /v1/messages/{message_id}/{sub.subfield} This definition enables an + * automatic, bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC + * -----|----- `GET /v1/messages/123456/foo` | `GetMessage(message_id: + * "123456" sub: SubMessage(subfield: "foo"))` In + * general, not only fields but also field paths can be referenced from a path + * pattern. Fields mapped to the path pattern cannot be repeated and must have + * a primitive (non-message) type. Any fields in the request message which + * are not bound by the path pattern automatically become (optional) HTTP + * query parameters. Assume the following definition of the request message: + * service Messaging { rpc GetMessage(GetMessageRequest) returns + * (Message) { option (google.api.http).get = + * "/v1/messages/{message_id}"; } } message + * GetMessageRequest { message SubMessage { string subfield = 1; + * } string message_id = 1; // mapped to the URL int64 revision = + * 2; // becomes a parameter SubMessage sub = 3; // `sub.subfield` + * becomes a parameter } This enables a HTTP JSON to RPC mapping as + * below: HTTP | RPC -----|----- `GET + * /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` Note that fields which are mapped + * to HTTP parameters must have a primitive type or a repeated primitive type. + * Message types are not allowed. In the case of a repeated type, the + * parameter can be repeated in the URL, as in `...?param=A&param=B`. For + * HTTP method kinds which allow a request body, the `body` field specifies + * the mapping. Consider a REST update method on the message resource + * collection: service Messaging { rpc + * UpdateMessage(UpdateMessageRequest) returns (Message) { option + * (google.api.http) = { put: "/v1/messages/{message_id}" + * body: "message" }; } } message + * UpdateMessageRequest { string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body } The following HTTP + * JSON to RPC mapping is enabled, where the representation of the JSON in the + * request body is determined by protos JSON encoding: HTTP | RPC -----|----- + * `PUT /v1/messages/123456 { "text": "Hi!" }` | + * `UpdateMessage(message_id: "123456" message { text: + * "Hi!" })` The special name `*` can be used in the body mapping + * to define that every field not bound by the path template should be mapped + * to the request body. This enables the following alternative definition of + * the update method: service Messaging { rpc + * UpdateMessage(Message) returns (Message) { option (google.api.http) + * = { put: "/v1/messages/{message_id}" body: + * "*" }; } } message Message { string + * message_id = 1; string text = 2; } The following HTTP JSON to + * RPC mapping is enabled: HTTP | RPC -----|----- `PUT /v1/messages/123456 { + * "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` Note that when using `*` in the + * body mapping, it is not possible to have HTTP parameters, as all fields not + * bound by the path end in the body. This makes this option more rarely used + * in practice of defining REST APIs. The common usage of `*` is in custom + * methods which don't use the URL at all for transferring data. It is + * possible to define multiple HTTP methods for one RPC by using the + * `additional_bindings` option. Example: service Messaging { rpc + * GetMessage(GetMessageRequest) returns (Message) { option + * (google.api.http) = { get: "/v1/messages/{message_id}" + * additional_bindings { get: + * "/v1/users/{user_id}/messages/{message_id}" } }; } } + * message GetMessageRequest { string message_id = 1; string + * user_id = 2; } This enables the following two alternative HTTP JSON + * to RPC mappings: HTTP | RPC -----|----- `GET /v1/messages/123456` | + * `GetMessage(message_id: "123456")` `GET + * /v1/users/me/messages/123456` | `GetMessage(user_id: "me" + * message_id: "123456")` # Rules for HTTP mapping The rules for + * mapping HTTP path, query parameters, and body fields to the request message + * are as follows: 1. The `body` field specifies either `*` or a field path, + * or is omitted. If omitted, it indicates there is no HTTP request + * body. 2. Leaf fields (recursive expansion of nested messages in the + * request) can be classified into three types: (a) Matched in the URL + * template. (b) Covered by body (if body is `*`, everything except (a) + * fields; else everything under the body field) (c) All other + * fields. 3. URL query parameters found in the HTTP request are mapped to (c) + * fields. 4. Any body sent with an HTTP request can contain only (b) fields. + * The syntax of the path template is as follows: Template = + * "/" Segments [ Verb ] ; Segments = Segment { "/" + * Segment } ; Segment = "*" | "**" | LITERAL | + * Variable ; Variable = "{" FieldPath [ "=" Segments + * ] "}" ; FieldPath = IDENT { "." IDENT } ; Verb + * = ":" LITERAL ; The syntax `*` matches a single path segment. + * The syntax `**` matches zero or more path segments, which must be the last + * part of the path except the `Verb`. The syntax `LITERAL` matches literal + * text in the path. The syntax `Variable` matches part of the URL path as + * specified by its template. A variable template must not contain other + * variables. If a variable matches a single path segment, its template may be + * omitted, e.g. `{var}` is equivalent to `{var=*}`. If a variable contains + * exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables + * show up in the Discovery Document as `{var}`. If a variable contains one + * or more path segments, such as `"{var=foo/*}"` or + * `"{var=**}"`, when such a variable is expanded into a URL path, + * all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such + * variables show up in the Discovery Document as `{+var}`. NOTE: While the + * single segment variable matches the semantics of [RFC + * 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** match RFC 6570 Reserved + * Expansion. The reason is that the Reserved Expansion does not expand + * special characters like `?` and `#`, which would lead to invalid URLs. + * NOTE: the field paths in variables and in the `body` must not refer to + * repeated fields or map fields. + */ + export interface Schema$HttpRule { + /** + * Additional HTTP bindings for the selector. Nested bindings must not + * contain an `additional_bindings` field themselves (that is, the nesting + * may only be one level deep). + */ + additionalBindings: Schema$HttpRule[]; + /** + * The name of the request field whose value is mapped to the HTTP body, or + * `*` for mapping all fields not captured by the path pattern to the HTTP + * body. NOTE: the referred field must not be a repeated field and must be + * present at the top-level of request message type. + */ + body: string; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave + * the HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom: Schema$CustomHttpPattern; + /** + * Used for deleting a resource. + */ + delete: string; + /** + * Used for listing and getting information about resources. + */ + get: string; + /** + * Use this only for Scotty Requests. Do not use this for bytestream + * methods. For media support, add instead + * [][google.bytestream.RestByteStream] as an API to your configuration. + */ + mediaDownload: Schema$MediaDownload; + /** + * Use this only for Scotty Requests. Do not use this for media support + * using Bytestream, add instead [][google.bytestream.RestByteStream] as an + * API to your configuration for Bytestream methods. + */ + mediaUpload: Schema$MediaUpload; + /** + * Used for updating a resource. + */ + patch: string; + /** + * Used for creating a resource. + */ + post: string; + /** + * Used for updating a resource. + */ + put: string; + /** + * Selects methods to which this rule applies. Refer to selector for syntax + * details. + */ + selector: string; + } /** - * Output only. The source information for this configuration if available. - */ - sourceInfo: Schema$SourceInfo; + * A description of a label. + */ + export interface Schema$LabelDescriptor { + /** + * A human-readable description for the label. + */ + description: string; + /** + * The label key. + */ + key: string; + /** + * The type of data that can be assigned to the label. + */ + valueType: string; + } /** - * System parameter configuration. - */ - systemParameters: Schema$SystemParameters; + * Response message for `ListEnabledServices` method. + */ + export interface Schema$ListEnabledServicesResponse { + /** + * Token that can be passed to `ListEnabledServices` to resume a paginated + * query. + */ + nextPageToken: string; + /** + * Services enabled for the specified parent. + */ + services: Schema$PublishedService[]; + } /** - * A list of all proto message types included in this API service. It serves - * similar purpose as [google.api.Service.types], except that these types are - * not needed by user-defined APIs. Therefore, they will not show up in the - * generated discovery doc. This field should only be used to define system - * APIs in ESF. - */ - systemTypes: Schema$Type[]; + * A description of a log type. Example in YAML format: - name: + * library.googleapis.com/activity_history description: The history of + * borrowing and returning library items. display_name: Activity labels: + * - key: /customer_id description: Identifier of a library customer + */ + export interface Schema$LogDescriptor { + /** + * A human-readable description of this log. This information appears in the + * documentation and can contain details. + */ + description: string; + /** + * The human-readable name for this log. This information appears on the + * user interface and should be concise. + */ + displayName: string; + /** + * The set of labels that are available to describe a specific log entry. + * Runtime requests that contain labels not specified here are considered + * invalid. + */ + labels: Schema$LabelDescriptor[]; + /** + * The name of the log. It must be less than 512 characters long and can + * include the following characters: upper- and lower-case alphanumeric + * characters [A-Za-z0-9], and punctuation characters including slash, + * underscore, hyphen, period [/_-.]. + */ + name: string; + } /** - * The product title for this service. - */ - title: string; + * Logging configuration of the service. The following example shows how to + * configure logs to be sent to the producer and consumer projects. In the + * example, the `activity_history` log is sent to both the producer and + * consumer projects, whereas the `purchase_history` log is only sent to the + * producer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. logs: - name: activity_history + * labels: - key: /customer_id - name: purchase_history logging: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history - + * purchase_history consumer_destinations: - monitored_resource: + * library.googleapis.com/branch logs: - activity_history + */ + export interface Schema$Logging { + /** + * Logging configurations for sending logs to the consumer project. There + * can be multiple consumer destinations, each one must have a different + * monitored resource type. A log can be used in at most one consumer + * destination. + */ + consumerDestinations: Schema$LoggingDestination[]; + /** + * Logging configurations for sending logs to the producer project. There + * can be multiple producer destinations, each one must have a different + * monitored resource type. A log can be used in at most one producer + * destination. + */ + producerDestinations: Schema$LoggingDestination[]; + } /** - * A list of all proto message types included in this API service. Types - * referenced directly or indirectly by the `apis` are automatically included. - * Messages which are not referenced but shall be included, such as types used - * by the `google.protobuf.Any` type, should be listed here by name. Example: - * types: - name: google.protobuf.Int32 - */ - types: Schema$Type[]; + * Configuration of a specific logging destination (the producer project or + * the consumer project). + */ + export interface Schema$LoggingDestination { + /** + * Names of the logs to be sent to this destination. Each name must be + * defined in the Service.logs section. If the log name is not a domain + * scoped name, it will be automatically prefixed with the service name + * followed by "/". + */ + logs: string[]; + /** + * The monitored resource type. The type must be defined in the + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Configuration controlling usage of this service. + * Defines the Media configuration for a service in case of a download. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - usage: Schema$Usage; -} -/** - * `SourceContext` represents information about the source of a protobuf - * element, like the file in which it is defined. - */ -export interface Schema$SourceContext { + export interface Schema$MediaDownload { + /** + * A boolean that determines whether a notification for the completion of a + * download should be sent to the backend. + */ + completeNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the download service if one is used for download. + */ + downloadService: string; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether download is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for direct download. The size is + * specified in bytes. + */ + maxDirectDownloadSize: string; + /** + * A boolean that determines if direct download from ESF should be used for + * download of this media. + */ + useDirectDownload: boolean; + } /** - * The path-qualified name of the .proto file that contained the associated - * protobuf element. For example: - * `"google/protobuf/source_context.proto"`. + * Defines the Media configuration for a service in case of an upload. Use + * this only for Scotty Requests. Do not use this for media support using + * Bytestream, add instead [][google.bytestream.RestByteStream] as an API to + * your configuration for Bytestream methods. */ - fileName: string; -} -/** - * Source information used to create a Service Config - */ -export interface Schema$SourceInfo { + export interface Schema$MediaUpload { + /** + * A boolean that determines whether a notification for the completion of an + * upload should be sent to the backend. These notifications will not be + * seen by the client and will not consume quota. + */ + completeNotification: boolean; + /** + * Name of the Scotty dropzone to use for the current API. + */ + dropzone: string; + /** + * Whether upload is enabled. + */ + enabled: boolean; + /** + * Optional maximum acceptable size for an upload. The size is specified in + * bytes. + */ + maxSize: string; + /** + * An array of mimetype patterns. Esf will only accept uploads that match + * one of the given patterns. + */ + mimeTypes: string[]; + /** + * Whether to receive a notification for progress changes of media upload. + */ + progressNotification: boolean; + /** + * Whether to receive a notification on the start of media upload. + */ + startNotification: boolean; + /** + * DO NOT USE FIELDS BELOW THIS LINE UNTIL THIS WARNING IS REMOVED. Specify + * name of the upload service if one is used for upload. + */ + uploadService: string; + } /** - * All files used during config generation. - */ - sourceFiles: any[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Method represents a method of an API interface. + */ + export interface Schema$Method { + /** + * The simple name of this method. + */ + name: string; + /** + * Any metadata attached to the method. + */ + options: Schema$Option[]; + /** + * If true, the request is streamed. + */ + requestStreaming: boolean; + /** + * A URL of the input message type. + */ + requestTypeUrl: string; + /** + * If true, the response is streamed. + */ + responseStreaming: boolean; + /** + * The URL of the output message type. + */ + responseTypeUrl: string; + /** + * The source syntax of this method. + */ + syntax: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Defines a metric type and its schema. Once a metric descriptor is created, + * deleting or altering it stops data collection and makes the metric + * type's existing data unusable. + */ + export interface Schema$MetricDescriptor { + /** + * A detailed description of the metric, which can be used in documentation. + */ + description: string; + /** + * A concise name for the metric, which can be displayed in user interfaces. + * Use sentence case without an ending period, for example "Request + * count". This field is optional but it is recommended to be set for + * any metrics associated with user-visible concepts, such as Quota. + */ + displayName: string; + /** + * The set of labels that can be used to describe a specific instance of + * this metric type. For example, the + * `appengine.googleapis.com/http/server/response_latencies` metric type has + * a label for the HTTP response code, `response_code`, so you can look at + * latencies for successful responses or just for responses that failed. + */ + labels: Schema$LabelDescriptor[]; + /** + * Whether the metric records instantaneous values, changes to a value, etc. + * Some combinations of `metric_kind` and `value_type` might not be + * supported. + */ + metricKind: string; + /** + * The resource name of the metric descriptor. + */ + name: string; + /** + * The metric type, including its DNS name prefix. The type is not + * URL-encoded. All user-defined custom metric types have the DNS name + * `custom.googleapis.com`. Metric types should use a natural hierarchical + * grouping. For example: + * "custom.googleapis.com/invoice/paid/amount" + * "appengine.googleapis.com/http/server/response_latencies" + */ + type: string; + /** + * The unit in which the metric value is reported. It is only applicable if + * the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The supported + * units are a subset of [The Unified Code for Units of + * Measure](http://unitsofmeasure.org/ucum.html) standard: **Basic units + * (UNIT)** * `bit` bit * `By` byte * `s` second * `min` minute + * * `h` hour * `d` day **Prefixes (PREFIX)** * `k` kilo + * (10**3) * `M` mega (10**6) * `G` giga (10**9) * `T` tera + * (10**12) * `P` peta (10**15) * `E` exa (10**18) * `Z` + * zetta (10**21) * `Y` yotta (10**24) * `m` milli (10**-3) * + * `u` micro (10**-6) * `n` nano (10**-9) * `p` pico + * (10**-12) * `f` femto (10**-15) * `a` atto (10**-18) * `z` + * zepto (10**-21) * `y` yocto (10**-24) * `Ki` kibi (2**10) * + * `Mi` mebi (2**20) * `Gi` gibi (2**30) * `Ti` tebi (2**40) + * **Grammar** The grammar also includes these connectors: * `/` division + * (as an infix operator, e.g. `1/s`). * `.` multiplication (as an infix + * operator, e.g. `GBy.d`) The grammar for a unit is as follows: Expression + * = Component { "." Component } { "/" Component } ; + * Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | + * Annotation | "1" ; Annotation + * = "{" NAME "}" ; Notes: * `Annotation` is just a + * comment if it follows a `UNIT` and is equivalent to `1` if it is used + * alone. For examples, `{requests}/s == 1/s`, `By{transmitted}/s == + * By/s`. * `NAME` is a sequence of non-blank printable ASCII characters not + * containing '{' or '}'. * `1` represents dimensionless + * value 1, such as in `1/s`. * `%` represents dimensionless value 1/100, + * and annotates values giving a percentage. + */ + unit: string; + /** + * Whether the measurement is an integer, a floating-point number, etc. Some + * combinations of `metric_kind` and `value_type` might not be supported. + */ + valueType: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Bind API methods to metrics. Binding a method to a metric causes that + * metric's configured quota behaviors to apply to the method call. + */ + export interface Schema$MetricRule { + /** + * Metrics to update when the selected methods are called, and the + * associated cost applied to each metric. The key of the map is the metric + * name, and the values are the amount increased for the metric against + * which the quota limits are defined. The value must not be negative. + */ + metricCosts: any; + /** + * Selects the methods to which this rule applies. Refer to selector for + * syntax details. + */ + selector: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents the status of one operation step. - */ -export interface Schema$Step { + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: - If after comment and + * whitespace stripping, the documentation string of the redeclared method + * is empty, it will be inherited from the original method. - Each + * annotation belonging to the service config (http, visibility) which is + * not set in the redeclared method will be inherited. - If an http + * annotation is inherited, the path pattern will be modified as follows. + * Any version prefix will be replaced by the version of the including + * interface plus the root path if specified. Example of a simple mixin: + * package google.acl.v1; service AccessControl { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; } } + * package google.storage.v2; service Storage { // rpc + * GetAcl(GetAclRequest) returns (Acl); // Get a data record. rpc + * GetData(GetDataRequest) returns (Data) { option + * (google.api.http).get = "/v2/{resource=**}"; } } + * Example of a mixin configuration: apis: - name: + * google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl The mixin construct implies that all methods + * in `AccessControl` are also declared with same name and request/response + * types in `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting documentation and + * annotations as follows: service Storage { // Get the underlying + * ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option + * (google.api.http).get = "/v2/{resource=**}:getAcl"; } ... + * } Note how the version in the path pattern changed from `v1` to `v2`. If + * the `root` field in the mixin is specified, it should be a relative path + * under which inherited HTTP paths are placed. Example: apis: - + * name: google.storage.v2.Storage mixins: - name: + * google.acl.v1.AccessControl root: acls This implies the following + * inherited HTTP annotation: service Storage { // Get the + * underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } ... } + */ + export interface Schema$Mixin { + /** + * The fully qualified name of the interface which is included. + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths are + * rooted. + */ + root: string; + } /** - * The short description of the step. - */ - description: string; + * An object that describes the schema of a MonitoredResource object using a + * type name and a set of labels. For example, the monitored resource + * descriptor for Google Compute Engine VM instances has a type of + * `"gce_instance"` and specifies the use of the labels + * `"instance_id"` and `"zone"` to identify particular VM + * instances. Different APIs can support different monitored resource types. + * APIs generally provide a `list` method that returns the monitored resource + * descriptors used by the API. + */ + export interface Schema$MonitoredResourceDescriptor { + /** + * Optional. A detailed description of the monitored resource type that + * might be used in documentation. + */ + description: string; + /** + * Optional. A concise name for the monitored resource type that might be + * displayed in user interfaces. It should be a Title Cased Noun Phrase, + * without any article or other determiners. For example, `"Google + * Cloud SQL Database"`. + */ + displayName: string; + /** + * Required. A set of labels used to describe instances of this monitored + * resource type. For example, an individual Google Cloud SQL database is + * identified by values for the labels `"database_id"` and + * `"zone"`. + */ + labels: Schema$LabelDescriptor[]; + /** + * Optional. The resource name of the monitored resource descriptor: + * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` + * where {type} is the value of the `type` field in this object and + * {project_id} is a project ID that provides API-specific context for + * accessing the type. APIs that do not use project information can use the + * resource name format `"monitoredResourceDescriptors/{type}"`. + */ + name: string; + /** + * Required. The monitored resource type. For example, the type + * `"cloudsql_database"` represents databases in Google Cloud SQL. + * The maximum length of this value is 256 characters. + */ + type: string; + } /** - * The status code. - */ - status: string; -} -/** - * Define a parameter's name and location. The parameter may be passed as - * either an HTTP header or a URL query parameter, and if both are passed the - * behavior is implementation-dependent. - */ -export interface Schema$SystemParameter { + * Monitoring configuration of the service. The example below shows how to + * configure monitored resources and metrics for monitoring. In the example, a + * monitored resource and two metrics are defined. The + * `library.googleapis.com/book/returned_count` metric is sent to both + * producer and consumer projects, whereas the + * `library.googleapis.com/book/overdue_count` metric is only sent to the + * consumer project. monitored_resources: - type: + * library.googleapis.com/branch labels: - key: /city description: + * The city where the library branch is located in. - key: /name + * description: The name of the branch. metrics: - name: + * library.googleapis.com/book/returned_count metric_kind: DELTA + * value_type: INT64 labels: - key: /customer_id - name: + * library.googleapis.com/book/overdue_count metric_kind: GAUGE + * value_type: INT64 labels: - key: /customer_id monitoring: + * producer_destinations: - monitored_resource: + * library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count consumer_destinations: - + * monitored_resource: library.googleapis.com/branch metrics: - + * library.googleapis.com/book/returned_count - + * library.googleapis.com/book/overdue_count + */ + export interface Schema$Monitoring { + /** + * Monitoring configurations for sending metrics to the consumer project. + * There can be multiple consumer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * consumer destination. + */ + consumerDestinations: Schema$MonitoringDestination[]; + /** + * Monitoring configurations for sending metrics to the producer project. + * There can be multiple producer destinations, each one must have a + * different monitored resource type. A metric can be used in at most one + * producer destination. + */ + producerDestinations: Schema$MonitoringDestination[]; + } /** - * Define the HTTP header name to use for the parameter. It is case - * insensitive. - */ - httpHeader: string; + * Configuration of a specific monitoring destination (the producer project or + * the consumer project). + */ + export interface Schema$MonitoringDestination { + /** + * Names of the metrics to report to this monitoring destination. Each name + * must be defined in Service.metrics section. + */ + metrics: string[]; + /** + * The monitored resource type. The type must be defined in + * Service.monitored_resources section. + */ + monitoredResource: string; + } /** - * Define the name of the parameter, such as "api_key" . It is case - * sensitive. - */ - name: string; + * OAuth scopes are a way to define data and permissions on data. For example, + * there are scopes defined for "Read-only access to Google + * Calendar" and "Access to Cloud Platform". Users can consent + * to a scope for an application, giving it permission to access that data on + * their behalf. OAuth scope specifications should be fairly coarse grained; + * a user will need to see and understand the text description of what your + * scope means. In most cases: use one or at most two OAuth scopes for an + * entire family of products. If your product has multiple APIs, you should + * probably be sharing the OAuth scope across all of those APIs. When you + * need finer grained OAuth consent screens: talk with your product management + * about how developers will use them in practice. Please note that even + * though each of the canonical scopes is enough for a request to be accepted + * and passed to the backend, a request can still fail due to the backend + * requiring additional scopes or permissions. + */ + export interface Schema$OAuthRequirements { + /** + * The list of publicly documented OAuth scopes that are allowed access. An + * OAuth token containing any of these scopes will be accepted. Example: + * canonical_scopes: https://www.googleapis.com/auth/calendar, + * https://www.googleapis.com/auth/calendar.read + */ + canonicalScopes: string; + } /** - * Define the URL query parameter name to use for the parameter. It is case - * sensitive. - */ - urlQueryParameter: string; -} -/** - * Define a system parameter rule mapping system parameter definitions to - * methods. - */ -export interface Schema$SystemParameterRule { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Define parameters. Multiple names may be defined for a parameter. For a - * given method call, only one of them should be used. If multiple names are - * used the behavior is implementation-dependent. If none of the specified - * names are present the behavior is parameter-dependent. - */ - parameters: Schema$SystemParameter[]; + * The metadata associated with a long running operation resource. + */ + export interface Schema$OperationMetadata { + /** + * Percentage of completion of this operation, ranging from 0 to 100. + */ + progressPercentage: number; + /** + * The full name of the resources that this operation is directly associated + * with. + */ + resourceNames: string[]; + /** + * The start time of the operation. + */ + startTime: string; + /** + * Detailed status information for each step. The order is undetermined. + */ + steps: Schema$Step[]; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; -} -/** - * ### System parameter configuration A system parameter is a special kind of - * parameter defined by the API system, not by an individual API. It is - * typically mapped to an HTTP header and/or a URL query parameter. This - * configuration specifies which methods change the names of the system - * parameters. - */ -export interface Schema$SystemParameters { + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + */ + export interface Schema$Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, + * `"map_entry"`. For custom options, it should be the + * fully-qualified name. For example, `"google.api.http"`. + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a + * primitive, the corresponding wrapper type defined in + * google/protobuf/wrappers.proto should be used. If the value is an enum, + * it should be stored as an int32 value using the + * google.protobuf.Int32Value type. + */ + value: any; + } /** - * Define system parameters. The parameters defined here will override the - * default parameters implemented by the system. If this field is missing from - * the service config, default system parameters will be used. Default system - * parameters and names is implementation-dependent. Example: define api key - * for all methods system_parameters rules: - selector: - * "*" parameters: - name: api_key - * url_query_parameter: api_key Example: define 2 api key names for a - * specific method. system_parameters rules: - selector: - * "/ListShelves" parameters: - name: api_key - * http_header: Api-Key1 - name: api_key http_header: Api-Key2 - * **NOTE:** All service configuration rules follow "last one wins" - * order. - */ - rules: Schema$SystemParameterRule[]; -} -/** - * A protocol buffer message type. - */ -export interface Schema$Type { + * Represents a documentation page. A page can contain subpages to represent + * nested documentation set structure. + */ + export interface Schema$Page { + /** + * The Markdown content of the page. You can use <code>&#40;== + * include {path} ==&#41;</code> to include content from a + * Markdown file. + */ + content: string; + /** + * The name of the page. It will be used as an identity of the page to + * generate URI of the page, text of the link to this page in navigation, + * etc. The full page name (start from the root page name to this page + * concatenated with `.`) can be used as reference to the page in your + * documentation. For example: <pre><code>pages: - name: + * Tutorial content: &#40;== include tutorial.md ==&#41; subpages: + * - name: Java content: &#40;== include tutorial_java.md + * ==&#41; </code></pre> You can reference `Java` page using + * Markdown reference link syntax: `Java`. + */ + name: string; + /** + * Subpages of this page. The order of subpages specified here will be + * honored in the generated docset. + */ + subpages: Schema$Page[]; + } /** - * The list of fields. - */ - fields: Schema$Field[]; + * The published version of a Service that is managed by Google Service + * Management. + */ + export interface Schema$PublishedService { + /** + * The resource name of the service. A valid name would be: - + * services/serviceuser.googleapis.com + */ + name: string; + /** + * The service's published configuration. + */ + service: Schema$Service; + } /** - * The fully qualified message name. - */ - name: string; + * Quota configuration helps to achieve fairness and budgeting in service + * usage. The quota configuration works this way: - The service configuration + * defines a set of metrics. - For API calls, the quota.metric_rules maps + * methods to metrics with corresponding costs. - The quota.limits defines + * limits on the metrics, which will be used for quota checks at runtime. An + * example quota configuration in yaml format: quota: - name: + * apiWriteQpsPerProject metric: library.googleapis.com/write_calls + * unit: "1/min/{project}" # rate limit for consumer projects + * values: STANDARD: 10000 # The metric rules bind all methods + * to the read_calls metric, # except for the UpdateBook and DeleteBook + * methods. These two methods # are mapped to the write_calls metric, + * with the UpdateBook method # consuming at twice rate as the DeleteBook + * method. metric_rules: - selector: "*" metric_costs: + * library.googleapis.com/read_calls: 1 - selector: + * google.example.library.v1.LibraryService.UpdateBook metric_costs: + * library.googleapis.com/write_calls: 2 - selector: + * google.example.library.v1.LibraryService.DeleteBook metric_costs: + * library.googleapis.com/write_calls: 1 Corresponding Metric definition: + * metrics: - name: library.googleapis.com/read_calls display_name: Read + * requests metric_kind: DELTA value_type: INT64 - name: + * library.googleapis.com/write_calls display_name: Write requests + * metric_kind: DELTA value_type: INT64 + */ + export interface Schema$Quota { + /** + * List of `QuotaLimit` definitions for the service. + */ + limits: Schema$QuotaLimit[]; + /** + * List of `MetricRule` definitions, each one mapping a selected method to + * one or more metrics. + */ + metricRules: Schema$MetricRule[]; + } /** - * The list of types appearing in `oneof` definitions in this type. - */ - oneofs: string[]; + * `QuotaLimit` defines a specific limit that applies over a specified + * duration for a limit type. There can be at most one limit for a duration + * and limit type combination defined within a `QuotaGroup`. + */ + export interface Schema$QuotaLimit { + /** + * Default number of tokens that can be consumed during the specified + * duration. This is the number of tokens assigned when a client application + * developer activates the service for his/her project. Specifying a value + * of 0 will block all requests. This can be used if you are provisioning + * quota to selected consumers and blocking others. Similarly, a value of -1 + * will indicate an unlimited quota. No other negative values are allowed. + * Used by group-based quotas only. + */ + defaultLimit: string; + /** + * Optional. User-visible, extended description for this quota limit. Should + * be used only when more context is needed to understand this limit than + * provided by the limit's display name (see: `display_name`). + */ + description: string; + /** + * User-visible display name for this limit. Optional. If not set, the UI + * will provide a default display name based on the quota configuration. + * This field can be used to override the default display name generated + * from the configuration. + */ + displayName: string; + /** + * Duration of this limit in textual notation. Example: "100s", + * "24h", "1d". For duration longer than a day, only + * multiple of days is supported. We support only "100s" and + * "1d" for now. Additional support will be added in the future. + * "0" indicates indefinite duration. Used by group-based quotas + * only. + */ + duration: string; + /** + * Free tier value displayed in the Developers Console for this limit. The + * free tier is the number of tokens that will be subtracted from the billed + * amount when billing is enabled. This field can only be set on a limit + * with duration "1d", in a billable group; it is invalid on any + * other limit. If this field is not set, it defaults to 0, indicating that + * there is no free tier for this service. Used by group-based quotas only. + */ + freeTier: string; + /** + * Maximum number of tokens that can be consumed during the specified + * duration. Client application developers can override the default limit up + * to this maximum. If specified, this value cannot be set to a value less + * than the default limit. If not specified, it is set to the default limit. + * To allow clients to apply overrides with no upper bound, set this to -1, + * indicating unlimited maximum quota. Used by group-based quotas only. + */ + maxLimit: string; + /** + * The name of the metric this quota limit applies to. The quota limits with + * the same metric will be checked together during runtime. The metric must + * be defined within the service config. + */ + metric: string; + /** + * Name of the quota limit. The name must be provided, and it must be + * unique within the service. The name can only include alphanumeric + * characters as well as '-'. The maximum length of the limit name + * is 64 characters. + */ + name: string; + /** + * Specify the unit of the quota limit. It uses the same syntax as + * Metric.unit. The supported unit kinds are determined by the quota backend + * system. Here are some examples: * "1/min/{project}" for quota + * per minute per project. Note: the order of unit components is + * insignificant. The "1" at the beginning is required to follow + * the metric unit syntax. + */ + unit: string; + /** + * Tiered limit values. You must specify this as a key:value pair, with an + * integer value that is the maximum number of requests allowed for the + * specified unit. Currently only STANDARD is supported. + */ + values: any; + } /** - * The protocol buffer options. - */ - options: Schema$Option[]; + * Response message for SearchServices method. + */ + export interface Schema$SearchServicesResponse { + /** + * Token that can be passed to `ListAvailableServices` to resume a paginated + * query. + */ + nextPageToken: string; + /** + * Services available publicly or available to the authenticated caller. + */ + services: Schema$PublishedService[]; + } /** - * The source context. - */ - sourceContext: Schema$SourceContext; + * `Service` is the root object of Google service configuration schema. It + * describes basic information about a service, such as the name and the + * title, and delegates other aspects to sub-sections. Each sub-section is + * either a proto message or a repeated proto message that configures a + * specific aspect, such as auth. See each proto message definition for + * details. Example: type: google.api.Service config_version: 3 + * name: calendar.googleapis.com title: Google Calendar API apis: - + * name: google.calendar.v3.Calendar authentication: providers: - + * id: google_calendar_auth jwks_uri: + * https://www.googleapis.com/oauth2/v1/certs issuer: + * https://securetoken.google.com rules: - selector: "*" + * requirements: provider_id: google_calendar_auth + */ + export interface Schema$Service { + /** + * A list of API interfaces exported by this service. Only the `name` field + * of the google.protobuf.Api needs to be provided by the configuration + * author, as the remaining fields will be derived from the IDL during the + * normalization process. It is an error to specify an API interface here + * which cannot be resolved against the associated IDL files. + */ + apis: Schema$Api[]; + /** + * Auth configuration. + */ + authentication: Schema$Authentication; + /** + * API backend configuration. + */ + backend: Schema$Backend; + /** + * Billing configuration. + */ + billing: Schema$Billing; + /** + * The semantic version of the service configuration. The config version + * affects the interpretation of the service configuration. For example, + * certain features are enabled by default for certain config versions. The + * latest config version is `3`. + */ + configVersion: number; + /** + * Context configuration. + */ + context: Schema$Context; + /** + * Configuration for the service control plane. + */ + control: Schema$Control; + /** + * Custom error configuration. + */ + customError: Schema$CustomError; + /** + * Additional API documentation. + */ + documentation: Schema$Documentation; + /** + * Configuration for network endpoints. If this is empty, then an endpoint + * with the same name as the service is automatically generated to service + * all defined APIs. + */ + endpoints: Schema$Endpoint[]; + /** + * A list of all enum types included in this API service. Enums referenced + * directly or indirectly by the `apis` are automatically included. Enums + * which are not referenced but shall be included should be listed here by + * name. Example: enums: - name: google.someapi.v1.SomeEnum + */ + enums: Schema$Enum[]; + /** + * Experimental configuration. + */ + experimental: Schema$Experimental; + /** + * HTTP configuration. + */ + http: Schema$Http; + /** + * A unique ID for a specific instance of this message, typically assigned + * by the client for tracking purpose. If empty, the server may choose to + * generate one instead. + */ + id: string; + /** + * Logging configuration. + */ + logging: Schema$Logging; + /** + * Defines the logs used by this service. + */ + logs: Schema$LogDescriptor[]; + /** + * Defines the metrics used by this service. + */ + metrics: Schema$MetricDescriptor[]; + /** + * Defines the monitored resources used by this service. This is required by + * the Service.monitoring and Service.logging configurations. + */ + monitoredResources: Schema$MonitoredResourceDescriptor[]; + /** + * Monitoring configuration. + */ + monitoring: Schema$Monitoring; + /** + * The DNS address at which this service is available, e.g. + * `calendar.googleapis.com`. + */ + name: string; + /** + * The Google project that owns this service. + */ + producerProjectId: string; + /** + * Quota configuration. + */ + quota: Schema$Quota; + /** + * Output only. The source information for this configuration if available. + */ + sourceInfo: Schema$SourceInfo; + /** + * System parameter configuration. + */ + systemParameters: Schema$SystemParameters; + /** + * A list of all proto message types included in this API service. It serves + * similar purpose as [google.api.Service.types], except that these types + * are not needed by user-defined APIs. Therefore, they will not show up in + * the generated discovery doc. This field should only be used to define + * system APIs in ESF. + */ + systemTypes: Schema$Type[]; + /** + * The product title for this service. + */ + title: string; + /** + * A list of all proto message types included in this API service. Types + * referenced directly or indirectly by the `apis` are automatically + * included. Messages which are not referenced but shall be included, such + * as types used by the `google.protobuf.Any` type, should be listed here by + * name. Example: types: - name: google.protobuf.Int32 + */ + types: Schema$Type[]; + /** + * Configuration controlling usage of this service. + */ + usage: Schema$Usage; + } /** - * The source syntax. + * `SourceContext` represents information about the source of a protobuf + * element, like the file in which it is defined. */ - syntax: string; -} -/** - * Configuration controlling usage of a service. - */ -export interface Schema$Usage { + export interface Schema$SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: + * `"google/protobuf/source_context.proto"`. + */ + fileName: string; + } /** - * The full resource name of a channel used for sending notifications to the - * service producer. Google Service Management currently only supports - * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification - * channel. To use Google Cloud Pub/Sub as the channel, this must be the name - * of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format - * documented in https://cloud.google.com/pubsub/docs/overview. + * Source information used to create a Service Config */ - producerNotificationChannel: string; + export interface Schema$SourceInfo { + /** + * All files used during config generation. + */ + sourceFiles: any[]; + } /** - * Requirements that must be satisfied before a consumer project can use the - * service. Each requirement is of the form - * <service.name>/<requirement-id>; for example - * 'serviceusage.googleapis.com/billing-enabled'. - */ - requirements: string[]; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * A list of usage rules that apply to individual API methods. **NOTE:** All - * service configuration rules follow "last one wins" order. - */ - rules: Schema$UsageRule[]; -} -/** - * Usage configuration rules for the service. NOTE: Under development. Use - * this rule to configure unregistered calls for the service. Unregistered calls - * are calls that do not contain consumer project identity. (Example: calls that - * do not contain an API key). By default, API methods do not allow unregistered - * calls, and each method call must be identified by a consumer project - * identity. Use this rule to allow/disallow unregistered calls. Example of an - * API that wants to allow unregistered calls for entire service. usage: - * rules: - selector: "*" allow_unregistered_calls: true - * Example of a method that wants to allow unregistered calls. usage: - * rules: - selector: - * "google.example.library.v1.LibraryService.CreateBook" - * allow_unregistered_calls: true - */ -export interface Schema$UsageRule { + * Represents the status of one operation step. + */ + export interface Schema$Step { + /** + * The short description of the step. + */ + description: string; + /** + * The status code. + */ + status: string; + } /** - * If true, the selected method allows unregistered calls, e.g. calls that - * don't identify any user or application. - */ - allowUnregisteredCalls: boolean; + * Define a parameter's name and location. The parameter may be passed as + * either an HTTP header or a URL query parameter, and if both are passed the + * behavior is implementation-dependent. + */ + export interface Schema$SystemParameter { + /** + * Define the HTTP header name to use for the parameter. It is case + * insensitive. + */ + httpHeader: string; + /** + * Define the name of the parameter, such as "api_key" . It is + * case sensitive. + */ + name: string; + /** + * Define the URL query parameter name to use for the parameter. It is case + * sensitive. + */ + urlQueryParameter: string; + } /** - * Selects the methods to which this rule applies. Use '*' to indicate - * all methods in all APIs. Refer to selector for syntax details. - */ - selector: string; + * Define a system parameter rule mapping system parameter definitions to + * methods. + */ + export interface Schema$SystemParameterRule { + /** + * Define parameters. Multiple names may be defined for a parameter. For a + * given method call, only one of them should be used. If multiple names are + * used the behavior is implementation-dependent. If none of the specified + * names are present the behavior is parameter-dependent. + */ + parameters: Schema$SystemParameter[]; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + } /** - * If true, the selected method should skip service control and the control - * plane features, such as quota and billing, will not be available. This flag - * is used by Google Cloud Endpoints to bypass checks for internal methods, - * such as service health check methods. - */ - skipServiceControl: boolean; -} - -export class Resource$Projects { - root: Serviceuser; - services: Resource$Projects$Services; - constructor(root: Serviceuser) { - this.root = root; - this.getRoot.bind(this); - this.services = new Resource$Projects$Services(root); + * ### System parameter configuration A system parameter is a special kind of + * parameter defined by the API system, not by an individual API. It is + * typically mapped to an HTTP header and/or a URL query parameter. This + * configuration specifies which methods change the names of the system + * parameters. + */ + export interface Schema$SystemParameters { + /** + * Define system parameters. The parameters defined here will override the + * default parameters implemented by the system. If this field is missing + * from the service config, default system parameters will be used. Default + * system parameters and names is implementation-dependent. Example: define + * api key for all methods system_parameters rules: - + * selector: "*" parameters: - name: api_key + * url_query_parameter: api_key Example: define 2 api key names for a + * specific method. system_parameters rules: - selector: + * "/ListShelves" parameters: - name: + * api_key http_header: Api-Key1 - name: api_key + * http_header: Api-Key2 **NOTE:** All service configuration rules follow + * "last one wins" order. + */ + rules: Schema$SystemParameterRule[]; } - - getRoot() { - return this.root; + /** + * A protocol buffer message type. + */ + export interface Schema$Type { + /** + * The list of fields. + */ + fields: Schema$Field[]; + /** + * The fully qualified message name. + */ + name: string; + /** + * The list of types appearing in `oneof` definitions in this type. + */ + oneofs: string[]; + /** + * The protocol buffer options. + */ + options: Schema$Option[]; + /** + * The source context. + */ + sourceContext: Schema$SourceContext; + /** + * The source syntax. + */ + syntax: string; } -} -export class Resource$Projects$Services { - root: Serviceuser; - constructor(root: Serviceuser) { - this.root = root; - this.getRoot.bind(this); + /** + * Configuration controlling usage of a service. + */ + export interface Schema$Usage { + /** + * The full resource name of a channel used for sending notifications to the + * service producer. Google Service Management currently only supports + * [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification + * channel. To use Google Cloud Pub/Sub as the channel, this must be the + * name of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name + * format documented in https://cloud.google.com/pubsub/docs/overview. + */ + producerNotificationChannel: string; + /** + * Requirements that must be satisfied before a consumer project can use the + * service. Each requirement is of the form + * <service.name>/<requirement-id>; for example + * 'serviceusage.googleapis.com/billing-enabled'. + */ + requirements: string[]; + /** + * A list of usage rules that apply to individual API methods. **NOTE:** + * All service configuration rules follow "last one wins" order. + */ + rules: Schema$UsageRule[]; } - - getRoot() { - return this.root; + /** + * Usage configuration rules for the service. NOTE: Under development. Use + * this rule to configure unregistered calls for the service. Unregistered + * calls are calls that do not contain consumer project identity. (Example: + * calls that do not contain an API key). By default, API methods do not allow + * unregistered calls, and each method call must be identified by a consumer + * project identity. Use this rule to allow/disallow unregistered calls. + * Example of an API that wants to allow unregistered calls for entire + * service. usage: rules: - selector: "*" + * allow_unregistered_calls: true Example of a method that wants to allow + * unregistered calls. usage: rules: - selector: + * "google.example.library.v1.LibraryService.CreateBook" + * allow_unregistered_calls: true + */ + export interface Schema$UsageRule { + /** + * If true, the selected method allows unregistered calls, e.g. calls that + * don't identify any user or application. + */ + allowUnregisteredCalls: boolean; + /** + * Selects the methods to which this rule applies. Use '*' to + * indicate all methods in all APIs. Refer to selector for syntax details. + */ + selector: string; + /** + * If true, the selected method should skip service control and the control + * plane features, such as quota and billing, will not be available. This + * flag is used by Google Cloud Endpoints to bypass checks for internal + * methods, such as service health check methods. + */ + skipServiceControl: boolean; } + export class Resource$Projects { + root: Serviceuser; + services: Resource$Projects$Services; + constructor(root: Serviceuser) { + this.root = root; + this.getRoot.bind(this); + this.services = new Resource$Projects$Services(root); + } - /** - * serviceuser.projects.services.disable - * @desc Disable a service so it can no longer be used with a project. This - * prevents unintended usage that may cause unexpected billing charges or - * security leaks. Operation - * @alias serviceuser.projects.services.disable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the consumer and the service to disable for that consumer. The Service User implementation accepts the following forms for consumer: - "project:" A valid path would be: - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable - * @param {().DisableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - disable(params?: any, options?: MethodOptions): - AxiosPromise; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - disable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Services { + root: Serviceuser; + constructor(root: Serviceuser) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+name}:disable').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * serviceuser.projects.services.enable - * @desc Enable a service so it can be used with a project. See [Cloud Auth - * Guide](https://cloud.google.com/docs/authentication) for more information. - * Operation - * @alias serviceuser.projects.services.enable - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Name of the consumer and the service to enable for that consumer. A valid path would be: - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable - * @param {().EnableServiceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - enable(params?: any, options?: MethodOptions): AxiosPromise; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - enable( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceuser.projects.services.disable + * @desc Disable a service so it can no longer be used with a project. This + * prevents unintended usage that may cause unexpected billing charges or + * security leaks. Operation + * @alias serviceuser.projects.services.disable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the consumer and the service to disable for that consumer. The Service User implementation accepts the following forms for consumer: - "project:" A valid path would be: - /v1/projects/my-project/services/servicemanagement.googleapis.com:disable + * @param {().DisableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + disable(params?: any, options?: MethodOptions): + AxiosPromise; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + disable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:disable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:enable').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * serviceuser.projects.services.list - * @desc List enabled services for the specified consumer. - * @alias serviceuser.projects.services.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested size of the next page of data. - * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. - * @param {string} params.parent List enabled services for the specified parent. An example valid parent would be: - projects/my-project - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * serviceuser.projects.services.enable + * @desc Enable a service so it can be used with a project. See [Cloud Auth + * Guide](https://cloud.google.com/docs/authentication) for more + * information. Operation + * @alias serviceuser.projects.services.enable + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Name of the consumer and the service to enable for that consumer. A valid path would be: - /v1/projects/my-project/services/servicemanagement.googleapis.com:enable + * @param {().EnableServiceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + enable(params?: any, options?: MethodOptions): + AxiosPromise; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + enable( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:enable') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/services') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Services { - root: Serviceuser; - constructor(root: Serviceuser) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * serviceuser.projects.services.list + * @desc List enabled services for the specified consumer. + * @alias serviceuser.projects.services.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested size of the next page of data. + * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. + * @param {string} params.parent List enabled services for the specified parent. An example valid parent would be: - projects/my-project + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/services') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * serviceuser.services.search - * @desc Search available services. When no filter is specified, returns all - * accessible services. For authenticated users, also returns all services the - * calling user has "servicemanagement.services.bind" permission for. - * @alias serviceuser.services.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Requested size of the next page of data. - * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Services { + root: Serviceuser; + constructor(root: Serviceuser) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/services:search').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * serviceuser.services.search + * @desc Search available services. When no filter is specified, returns + * all accessible services. For authenticated users, also returns all + * services the calling user has "servicemanagement.services.bind" + * permission for. + * @alias serviceuser.services.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Requested size of the next page of data. + * @param {string=} params.pageToken Token identifying which result to start with; returned by a previous list call. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://serviceuser.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/services:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/sheets/v4.ts b/src/apis/sheets/v4.ts index 9eb06540c45..c8f32db0b40 100644 --- a/src/apis/sheets/v4.ts +++ b/src/apis/sheets/v4.ts @@ -27,6288 +27,6341 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Sheets API - * - * Reads and writes Google Sheets. - * - * @example - * const google = require('googleapis'); - * const sheets = google.sheets('v4'); - * - * @namespace sheets - * @type {Function} - * @version v4 - * @variation v4 - * @param {object=} options Options for Sheets - */ -export class Sheets { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace sheets_v4 { + /** + * Google Sheets API + * + * Reads and writes Google Sheets. + * + * @example + * const google = require('googleapis'); + * const sheets = google.sheets('v4'); + * + * @namespace sheets + * @type {Function} + * @version v4 + * @variation v4 + * @param {object=} options Options for Sheets + */ + export class Sheets { + _options: GlobalOptions; + google: GoogleApis; + root = this; - spreadsheets: Resource$Spreadsheets; + spreadsheets: Resource$Spreadsheets; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.spreadsheets = new Resource$Spreadsheets(this); - } + this.spreadsheets = new Resource$Spreadsheets(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Adds a new banded range to the spreadsheet. - */ -export interface Schema$AddBandingRequest { /** - * The banded range to add. The bandedRangeId field is optional; if one is not - * set, an id will be randomly generated. (It is an error to specify the ID of - * a range that already exists.) + * Adds a new banded range to the spreadsheet. */ - bandedRange: Schema$BandedRange; -} -/** - * The result of adding a banded range. - */ -export interface Schema$AddBandingResponse { + export interface Schema$AddBandingRequest { + /** + * The banded range to add. The bandedRangeId field is optional; if one is + * not set, an id will be randomly generated. (It is an error to specify the + * ID of a range that already exists.) + */ + bandedRange: Schema$BandedRange; + } /** - * The banded range that was added. + * The result of adding a banded range. */ - bandedRange: Schema$BandedRange; -} -/** - * Adds a chart to a sheet in the spreadsheet. - */ -export interface Schema$AddChartRequest { + export interface Schema$AddBandingResponse { + /** + * The banded range that was added. + */ + bandedRange: Schema$BandedRange; + } /** - * The chart that should be added to the spreadsheet, including the position - * where it should be placed. The chartId field is optional; if one is not - * set, an id will be randomly generated. (It is an error to specify the ID of - * a chart that already exists.) + * Adds a chart to a sheet in the spreadsheet. */ - chart: Schema$EmbeddedChart; -} -/** - * The result of adding a chart to a spreadsheet. - */ -export interface Schema$AddChartResponse { + export interface Schema$AddChartRequest { + /** + * The chart that should be added to the spreadsheet, including the position + * where it should be placed. The chartId field is optional; if one is not + * set, an id will be randomly generated. (It is an error to specify the ID + * of a chart that already exists.) + */ + chart: Schema$EmbeddedChart; + } /** - * The newly added chart. + * The result of adding a chart to a spreadsheet. */ - chart: Schema$EmbeddedChart; -} -/** - * Adds a new conditional format rule at the given index. All subsequent - * rules' indexes are incremented. - */ -export interface Schema$AddConditionalFormatRuleRequest { + export interface Schema$AddChartResponse { + /** + * The newly added chart. + */ + chart: Schema$EmbeddedChart; + } /** - * The zero-based index where the rule should be inserted. - */ - index: number; + * Adds a new conditional format rule at the given index. All subsequent + * rules' indexes are incremented. + */ + export interface Schema$AddConditionalFormatRuleRequest { + /** + * The zero-based index where the rule should be inserted. + */ + index: number; + /** + * The rule to add. + */ + rule: Schema$ConditionalFormatRule; + } /** - * The rule to add. + * Adds a filter view. */ - rule: Schema$ConditionalFormatRule; -} -/** - * Adds a filter view. - */ -export interface Schema$AddFilterViewRequest { + export interface Schema$AddFilterViewRequest { + /** + * The filter to add. The filterViewId field is optional; if one is not set, + * an id will be randomly generated. (It is an error to specify the ID of a + * filter that already exists.) + */ + filter: Schema$FilterView; + } /** - * The filter to add. The filterViewId field is optional; if one is not set, - * an id will be randomly generated. (It is an error to specify the ID of a - * filter that already exists.) + * The result of adding a filter view. */ - filter: Schema$FilterView; -} -/** - * The result of adding a filter view. - */ -export interface Schema$AddFilterViewResponse { + export interface Schema$AddFilterViewResponse { + /** + * The newly added filter view. + */ + filter: Schema$FilterView; + } /** - * The newly added filter view. + * Adds a named range to the spreadsheet. */ - filter: Schema$FilterView; -} -/** - * Adds a named range to the spreadsheet. - */ -export interface Schema$AddNamedRangeRequest { + export interface Schema$AddNamedRangeRequest { + /** + * The named range to add. The namedRangeId field is optional; if one is not + * set, an id will be randomly generated. (It is an error to specify the ID + * of a range that already exists.) + */ + namedRange: Schema$NamedRange; + } /** - * The named range to add. The namedRangeId field is optional; if one is not - * set, an id will be randomly generated. (It is an error to specify the ID of - * a range that already exists.) + * The result of adding a named range. */ - namedRange: Schema$NamedRange; -} -/** - * The result of adding a named range. - */ -export interface Schema$AddNamedRangeResponse { + export interface Schema$AddNamedRangeResponse { + /** + * The named range to add. + */ + namedRange: Schema$NamedRange; + } /** - * The named range to add. + * Adds a new protected range. */ - namedRange: Schema$NamedRange; -} -/** - * Adds a new protected range. - */ -export interface Schema$AddProtectedRangeRequest { + export interface Schema$AddProtectedRangeRequest { + /** + * The protected range to be added. The protectedRangeId field is optional; + * if one is not set, an id will be randomly generated. (It is an error to + * specify the ID of a range that already exists.) + */ + protectedRange: Schema$ProtectedRange; + } /** - * The protected range to be added. The protectedRangeId field is optional; if - * one is not set, an id will be randomly generated. (It is an error to - * specify the ID of a range that already exists.) + * The result of adding a new protected range. */ - protectedRange: Schema$ProtectedRange; -} -/** - * The result of adding a new protected range. - */ -export interface Schema$AddProtectedRangeResponse { + export interface Schema$AddProtectedRangeResponse { + /** + * The newly added protected range. + */ + protectedRange: Schema$ProtectedRange; + } /** - * The newly added protected range. - */ - protectedRange: Schema$ProtectedRange; -} -/** - * Adds a new sheet. When a sheet is added at a given index, all subsequent - * sheets' indexes are incremented. To add an object sheet, use - * AddChartRequest instead and specify EmbeddedObjectPosition.sheetId or - * EmbeddedObjectPosition.newSheet. - */ -export interface Schema$AddSheetRequest { + * Adds a new sheet. When a sheet is added at a given index, all subsequent + * sheets' indexes are incremented. To add an object sheet, use + * AddChartRequest instead and specify EmbeddedObjectPosition.sheetId or + * EmbeddedObjectPosition.newSheet. + */ + export interface Schema$AddSheetRequest { + /** + * The properties the new sheet should have. All properties are optional. + * The sheetId field is optional; if one is not set, an id will be randomly + * generated. (It is an error to specify the ID of a sheet that already + * exists.) + */ + properties: Schema$SheetProperties; + } /** - * The properties the new sheet should have. All properties are optional. The - * sheetId field is optional; if one is not set, an id will be randomly - * generated. (It is an error to specify the ID of a sheet that already - * exists.) + * The result of adding a sheet. */ - properties: Schema$SheetProperties; -} -/** - * The result of adding a sheet. - */ -export interface Schema$AddSheetResponse { + export interface Schema$AddSheetResponse { + /** + * The properties of the newly added sheet. + */ + properties: Schema$SheetProperties; + } /** - * The properties of the newly added sheet. - */ - properties: Schema$SheetProperties; -} -/** - * Adds new cells after the last row with data in a sheet, inserting new rows - * into the sheet if necessary. - */ -export interface Schema$AppendCellsRequest { + * Adds new cells after the last row with data in a sheet, inserting new rows + * into the sheet if necessary. + */ + export interface Schema$AppendCellsRequest { + /** + * The fields of CellData that should be updated. At least one field must be + * specified. The root is the CellData; 'row.values.' should not be + * specified. A single `"*"` can be used as short-hand for listing + * every field. + */ + fields: string; + /** + * The data to append. + */ + rows: Schema$RowData[]; + /** + * The sheet ID to append the data to. + */ + sheetId: number; + } /** - * The fields of CellData that should be updated. At least one field must be - * specified. The root is the CellData; 'row.values.' should not be - * specified. A single `"*"` can be used as short-hand for listing - * every field. - */ - fields: string; + * Appends rows or columns to the end of a sheet. + */ + export interface Schema$AppendDimensionRequest { + /** + * Whether rows or columns should be appended. + */ + dimension: string; + /** + * The number of rows or columns to append. + */ + length: number; + /** + * The sheet to append rows or columns to. + */ + sheetId: number; + } /** - * The data to append. - */ - rows: Schema$RowData[]; + * The response when updating a range of values in a spreadsheet. + */ + export interface Schema$AppendValuesResponse { + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + /** + * The range (in A1 notation) of the table that values are being appended to + * (before the values were appended). Empty if no table was found. + */ + tableRange: string; + /** + * Information about the updates that were applied. + */ + updates: Schema$UpdateValuesResponse; + } /** - * The sheet ID to append the data to. - */ - sheetId: number; -} -/** - * Appends rows or columns to the end of a sheet. - */ -export interface Schema$AppendDimensionRequest { + * Fills in more data based on existing data. + */ + export interface Schema$AutoFillRequest { + /** + * The range to autofill. This will examine the range and detect the + * location that has data and automatically fill that data in to the rest of + * the range. + */ + range: Schema$GridRange; + /** + * The source and destination areas to autofill. This explicitly lists the + * source of the autofill and where to extend that data. + */ + sourceAndDestination: Schema$SourceAndDestination; + /** + * True if we should generate data with the "alternate" series. + * This differs based on the type and amount of source data. + */ + useAlternateSeries: boolean; + } /** - * Whether rows or columns should be appended. + * Automatically resizes one or more dimensions based on the contents of the + * cells in that dimension. */ - dimension: string; + export interface Schema$AutoResizeDimensionsRequest { + /** + * The dimensions to automatically resize. + */ + dimensions: Schema$DimensionRange; + } /** - * The number of rows or columns to append. - */ - length: number; + * A banded (alternating colors) range in a sheet. + */ + export interface Schema$BandedRange { + /** + * The id of the banded range. + */ + bandedRangeId: number; + /** + * Properties for column bands. These properties will be applied on a + * column- by-column basis throughout all the columns in the range. At least + * one of row_properties or column_properties must be specified. + */ + columnProperties: Schema$BandingProperties; + /** + * The range over which these properties are applied. + */ + range: Schema$GridRange; + /** + * Properties for row bands. These properties will be applied on a + * row-by-row basis throughout all the rows in the range. At least one of + * row_properties or column_properties must be specified. + */ + rowProperties: Schema$BandingProperties; + } /** - * The sheet to append rows or columns to. - */ - sheetId: number; -} -/** - * The response when updating a range of values in a spreadsheet. - */ -export interface Schema$AppendValuesResponse { + * Properties referring a single dimension (either row or column). If both + * BandedRange.row_properties and BandedRange.column_properties are set, the + * fill colors are applied to cells according to the following rules: * + * header_color and footer_color take priority over band colors. * + * first_band_color takes priority over second_band_color. * row_properties + * takes priority over column_properties. For example, the first row color + * takes priority over the first column color, but the first column color + * takes priority over the second row color. Similarly, the row header takes + * priority over the column header in the top left cell, but the column header + * takes priority over the first row color if the row header is not set. + */ + export interface Schema$BandingProperties { + /** + * The first color that is alternating. (Required) + */ + firstBandColor: Schema$Color; + /** + * The color of the last row or column. If this field is not set, the last + * row or column will be filled with either first_band_color or + * second_band_color, depending on the color of the previous row or column. + */ + footerColor: Schema$Color; + /** + * The color of the first row or column. If this field is set, the first row + * or column will be filled with this color and the colors will alternate + * between first_band_color and second_band_color starting from the second + * row or column. Otherwise, the first row or column will be filled with + * first_band_color and the colors will proceed to alternate as they + * normally would. + */ + headerColor: Schema$Color; + /** + * The second color that is alternating. (Required) + */ + secondBandColor: Schema$Color; + } /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; + * An axis of the chart. A chart may not have more than one axis per axis + * position. + */ + export interface Schema$BasicChartAxis { + /** + * The format of the title. Only valid if the axis is not associated with + * the domain. + */ + format: Schema$TextFormat; + /** + * The position of this axis. + */ + position: string; + /** + * The title of this axis. If set, this overrides any title inferred from + * headers of the data. + */ + title: string; + /** + * The axis title text position. + */ + titleTextPosition: Schema$TextPosition; + } /** - * The range (in A1 notation) of the table that values are being appended to - * (before the values were appended). Empty if no table was found. - */ - tableRange: string; + * The domain of a chart. For example, if charting stock prices over time, + * this would be the date. + */ + export interface Schema$BasicChartDomain { + /** + * The data of the domain. For example, if charting stock prices over time, + * this is the data representing the dates. + */ + domain: Schema$ChartData; + /** + * True to reverse the order of the domain values (horizontal axis). + */ + reversed: boolean; + } /** - * Information about the updates that were applied. - */ - updates: Schema$UpdateValuesResponse; -} -/** - * Fills in more data based on existing data. - */ -export interface Schema$AutoFillRequest { + * A single series of data in a chart. For example, if charting stock prices + * over time, multiple series may exist, one for the "Open Price", + * "High Price", "Low Price" and "Close Price". + */ + export interface Schema$BasicChartSeries { + /** + * The color for elements (i.e. bars, lines, points) associated with this + * series. If empty, a default color will be used. + */ + color: Schema$Color; + /** + * The line style of this series. Valid only if the chartType is AREA, LINE, + * or SCATTER. COMBO charts are also supported if the series chart type is + * AREA or LINE. + */ + lineStyle: Schema$LineStyle; + /** + * The data being visualized in this chart series. + */ + series: Schema$ChartData; + /** + * The minor axis that will specify the range of values for this series. For + * example, if charting stocks over time, the "Volume" series may + * want to be pinned to the right with the prices pinned to the left, + * because the scale of trading volume is different than the scale of + * prices. It is an error to specify an axis that isn't a valid minor + * axis for the chart's type. + */ + targetAxis: string; + /** + * The type of this series. Valid only if the chartType is COMBO. Different + * types will change the way the series is visualized. Only LINE, AREA, and + * COLUMN are supported. + */ + type: string; + } /** - * The range to autofill. This will examine the range and detect the location - * that has data and automatically fill that data in to the rest of the range. - */ - range: Schema$GridRange; + * The specification for a basic chart. See BasicChartType for the list of + * charts this supports. + */ + export interface Schema$BasicChartSpec { + /** + * The axis on the chart. + */ + axis: Schema$BasicChartAxis[]; + /** + * The type of the chart. + */ + chartType: string; + /** + * The behavior of tooltips and data highlighting when hovering on data and + * chart area. + */ + compareMode: string; + /** + * The domain of data this is charting. Only a single domain is supported. + */ + domains: Schema$BasicChartDomain[]; + /** + * The number of rows or columns in the data that are "headers". + * If not set, Google Sheets will guess how many rows are headers based on + * the data. (Note that BasicChartAxis.title may override the axis title + * inferred from the header values.) + */ + headerCount: number; + /** + * If some values in a series are missing, gaps may appear in the chart + * (e.g, segments of lines in a line chart will be missing). To eliminate + * these gaps set this to true. Applies to Line, Area, and Combo charts. + */ + interpolateNulls: boolean; + /** + * The position of the chart legend. + */ + legendPosition: string; + /** + * Gets whether all lines should be rendered smooth or straight by default. + * Applies to Line charts. + */ + lineSmoothing: boolean; + /** + * The data this chart is visualizing. + */ + series: Schema$BasicChartSeries[]; + /** + * The stacked type for charts that support vertical stacking. Applies to + * Area, Bar, Column, Combo, and Stepped Area charts. + */ + stackedType: string; + /** + * True to make the chart 3D. Applies to Bar and Column charts. + */ + threeDimensional: boolean; + } /** - * The source and destination areas to autofill. This explicitly lists the - * source of the autofill and where to extend that data. - */ - sourceAndDestination: Schema$SourceAndDestination; + * The default filter associated with a sheet. + */ + export interface Schema$BasicFilter { + /** + * The criteria for showing/hiding values per column. The map's key is + * the column index, and the value is the criteria for that column. + */ + criteria: any; + /** + * The range the filter covers. + */ + range: Schema$GridRange; + /** + * The sort order per column. Later specifications are used when values are + * equal in the earlier specifications. + */ + sortSpecs: Schema$SortSpec[]; + } /** - * True if we should generate data with the "alternate" series. This - * differs based on the type and amount of source data. + * The request for clearing more than one range selected by a DataFilter in a + * spreadsheet. */ - useAlternateSeries: boolean; -} -/** - * Automatically resizes one or more dimensions based on the contents of the - * cells in that dimension. - */ -export interface Schema$AutoResizeDimensionsRequest { + export interface Schema$BatchClearValuesByDataFilterRequest { + /** + * The DataFilters used to determine which ranges to clear. + */ + dataFilters: Schema$DataFilter[]; + } /** - * The dimensions to automatically resize. + * The response when clearing a range of values selected with DataFilters in a + * spreadsheet. */ - dimensions: Schema$DimensionRange; -} -/** - * A banded (alternating colors) range in a sheet. - */ -export interface Schema$BandedRange { + export interface Schema$BatchClearValuesByDataFilterResponse { + /** + * The ranges that were cleared, in A1 notation. (If the requests were for + * an unbounded range or a ranger larger than the bounds of the sheet, this + * will be the actual ranges that were cleared, bounded to the sheet's + * limits.) + */ + clearedRanges: string[]; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + } /** - * The id of the banded range. + * The request for clearing more than one range of values in a spreadsheet. */ - bandedRangeId: number; + export interface Schema$BatchClearValuesRequest { + /** + * The ranges to clear, in A1 notation. + */ + ranges: string[]; + } /** - * Properties for column bands. These properties will be applied on a column- - * by-column basis throughout all the columns in the range. At least one of - * row_properties or column_properties must be specified. - */ - columnProperties: Schema$BandingProperties; + * The response when clearing a range of values in a spreadsheet. + */ + export interface Schema$BatchClearValuesResponse { + /** + * The ranges that were cleared, in A1 notation. (If the requests were for + * an unbounded range or a ranger larger than the bounds of the sheet, this + * will be the actual ranges that were cleared, bounded to the sheet's + * limits.) + */ + clearedRanges: string[]; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + } /** - * The range over which these properties are applied. - */ - range: Schema$GridRange; + * The request for retrieving a range of values in a spreadsheet selected by a + * set of DataFilters. + */ + export interface Schema$BatchGetValuesByDataFilterRequest { + /** + * The data filters used to match the ranges of values to retrieve. Ranges + * that match any of the specified data filters will be included in the + * response. + */ + dataFilters: Schema$DataFilter[]; + /** + * How dates, times, and durations should be represented in the output. This + * is ignored if value_render_option is FORMATTED_VALUE. The default + * dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + */ + dateTimeRenderOption: string; + /** + * The major dimension that results should use. For example, if the + * spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then a request that selects + * that range and sets `majorDimension=ROWS` will return `[[1,2],[3,4]]`, + * whereas a request that sets `majorDimension=COLUMNS` will return + * `[[1,3],[2,4]]`. + */ + majorDimension: string; + /** + * How values should be represented in the output. The default render option + * is ValueRenderOption.FORMATTED_VALUE. + */ + valueRenderOption: string; + } /** - * Properties for row bands. These properties will be applied on a row-by-row - * basis throughout all the rows in the range. At least one of row_properties - * or column_properties must be specified. - */ - rowProperties: Schema$BandingProperties; -} -/** - * Properties referring a single dimension (either row or column). If both - * BandedRange.row_properties and BandedRange.column_properties are set, the - * fill colors are applied to cells according to the following rules: * - * header_color and footer_color take priority over band colors. * - * first_band_color takes priority over second_band_color. * row_properties - * takes priority over column_properties. For example, the first row color - * takes priority over the first column color, but the first column color takes - * priority over the second row color. Similarly, the row header takes priority - * over the column header in the top left cell, but the column header takes - * priority over the first row color if the row header is not set. - */ -export interface Schema$BandingProperties { + * The response when retrieving more than one range of values in a spreadsheet + * selected by DataFilters. + */ + export interface Schema$BatchGetValuesByDataFilterResponse { + /** + * The ID of the spreadsheet the data was retrieved from. + */ + spreadsheetId: string; + /** + * The requested values with the list of data filters that matched them. + */ + valueRanges: Schema$MatchedValueRange[]; + } /** - * The first color that is alternating. (Required) + * The response when retrieving more than one range of values in a + * spreadsheet. */ - firstBandColor: Schema$Color; + export interface Schema$BatchGetValuesResponse { + /** + * The ID of the spreadsheet the data was retrieved from. + */ + spreadsheetId: string; + /** + * The requested values. The order of the ValueRanges is the same as the + * order of the requested ranges. + */ + valueRanges: Schema$ValueRange[]; + } /** - * The color of the last row or column. If this field is not set, the last row - * or column will be filled with either first_band_color or second_band_color, - * depending on the color of the previous row or column. - */ - footerColor: Schema$Color; + * The request for updating any aspect of a spreadsheet. + */ + export interface Schema$BatchUpdateSpreadsheetRequest { + /** + * Determines if the update response should include the spreadsheet + * resource. + */ + includeSpreadsheetInResponse: boolean; + /** + * A list of updates to apply to the spreadsheet. Requests will be applied + * in the order they are specified. If any request is not valid, no requests + * will be applied. + */ + requests: Schema$Request[]; + /** + * True if grid data should be returned. Meaningful only if if + * include_spreadsheet_in_response is 'true'. This parameter is + * ignored if a field mask was set in the request. + */ + responseIncludeGridData: boolean; + /** + * Limits the ranges included in the response spreadsheet. Meaningful only + * if include_spreadsheet_response is 'true'. + */ + responseRanges: string[]; + } /** - * The color of the first row or column. If this field is set, the first row - * or column will be filled with this color and the colors will alternate - * between first_band_color and second_band_color starting from the second row - * or column. Otherwise, the first row or column will be filled with - * first_band_color and the colors will proceed to alternate as they normally - * would. - */ - headerColor: Schema$Color; + * The reply for batch updating a spreadsheet. + */ + export interface Schema$BatchUpdateSpreadsheetResponse { + /** + * The reply of the updates. This maps 1:1 with the updates, although + * replies to some requests may be empty. + */ + replies: Schema$Response[]; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + /** + * The spreadsheet after updates were applied. This is only set if + * [BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response] is + * `true`. + */ + updatedSpreadsheet: Schema$Spreadsheet; + } /** - * The second color that is alternating. (Required) - */ - secondBandColor: Schema$Color; -} -/** - * An axis of the chart. A chart may not have more than one axis per axis - * position. - */ -export interface Schema$BasicChartAxis { + * The request for updating more than one range of values in a spreadsheet. + */ + export interface Schema$BatchUpdateValuesByDataFilterRequest { + /** + * The new values to apply to the spreadsheet. If more than one range is + * matched by the specified DataFilter the specified values will be applied + * to all of those ranges. + */ + data: Schema$DataFilterValueRange[]; + /** + * Determines if the update response should include the values of the cells + * that were updated. By default, responses do not include the updated + * values. The `updatedData` field within each of the + * BatchUpdateValuesResponse.responses will contain the updated values. If + * the range to write was larger than than the range actually written, the + * response will include all values in the requested range (excluding + * trailing empty rows and columns). + */ + includeValuesInResponse: boolean; + /** + * Determines how dates, times, and durations in the response should be + * rendered. This is ignored if response_value_render_option is + * FORMATTED_VALUE. The default dateTime render option is + * DateTimeRenderOption.SERIAL_NUMBER. + */ + responseDateTimeRenderOption: string; + /** + * Determines how values in the response should be rendered. The default + * render option is ValueRenderOption.FORMATTED_VALUE. + */ + responseValueRenderOption: string; + /** + * How the input data should be interpreted. + */ + valueInputOption: string; + } /** - * The format of the title. Only valid if the axis is not associated with the - * domain. - */ - format: Schema$TextFormat; + * The response when updating a range of values in a spreadsheet. + */ + export interface Schema$BatchUpdateValuesByDataFilterResponse { + /** + * The response for each range updated. + */ + responses: Schema$UpdateValuesByDataFilterResponse[]; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + /** + * The total number of cells updated. + */ + totalUpdatedCells: number; + /** + * The total number of columns where at least one cell in the column was + * updated. + */ + totalUpdatedColumns: number; + /** + * The total number of rows where at least one cell in the row was updated. + */ + totalUpdatedRows: number; + /** + * The total number of sheets where at least one cell in the sheet was + * updated. + */ + totalUpdatedSheets: number; + } /** - * The position of this axis. - */ - position: string; + * The request for updating more than one range of values in a spreadsheet. + */ + export interface Schema$BatchUpdateValuesRequest { + /** + * The new values to apply to the spreadsheet. + */ + data: Schema$ValueRange[]; + /** + * Determines if the update response should include the values of the cells + * that were updated. By default, responses do not include the updated + * values. The `updatedData` field within each of the + * BatchUpdateValuesResponse.responses will contain the updated values. If + * the range to write was larger than than the range actually written, the + * response will include all values in the requested range (excluding + * trailing empty rows and columns). + */ + includeValuesInResponse: boolean; + /** + * Determines how dates, times, and durations in the response should be + * rendered. This is ignored if response_value_render_option is + * FORMATTED_VALUE. The default dateTime render option is + * DateTimeRenderOption.SERIAL_NUMBER. + */ + responseDateTimeRenderOption: string; + /** + * Determines how values in the response should be rendered. The default + * render option is ValueRenderOption.FORMATTED_VALUE. + */ + responseValueRenderOption: string; + /** + * How the input data should be interpreted. + */ + valueInputOption: string; + } /** - * The title of this axis. If set, this overrides any title inferred from - * headers of the data. - */ - title: string; + * The response when updating a range of values in a spreadsheet. + */ + export interface Schema$BatchUpdateValuesResponse { + /** + * One UpdateValuesResponse per requested range, in the same order as the + * requests appeared. + */ + responses: Schema$UpdateValuesResponse[]; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + /** + * The total number of cells updated. + */ + totalUpdatedCells: number; + /** + * The total number of columns where at least one cell in the column was + * updated. + */ + totalUpdatedColumns: number; + /** + * The total number of rows where at least one cell in the row was updated. + */ + totalUpdatedRows: number; + /** + * The total number of sheets where at least one cell in the sheet was + * updated. + */ + totalUpdatedSheets: number; + } /** - * The axis title text position. - */ - titleTextPosition: Schema$TextPosition; -} -/** - * The domain of a chart. For example, if charting stock prices over time, this - * would be the date. - */ -export interface Schema$BasicChartDomain { + * A condition that can evaluate to true or false. BooleanConditions are used + * by conditional formatting, data validation, and the criteria in filters. + */ + export interface Schema$BooleanCondition { + /** + * The type of condition. + */ + type: string; + /** + * The values of the condition. The number of supported values depends on + * the condition type. Some support zero values, others one or two values, + * and ConditionType.ONE_OF_LIST supports an arbitrary number of values. + */ + values: Schema$ConditionValue[]; + } /** - * The data of the domain. For example, if charting stock prices over time, - * this is the data representing the dates. - */ - domain: Schema$ChartData; + * A rule that may or may not match, depending on the condition. + */ + export interface Schema$BooleanRule { + /** + * The condition of the rule. If the condition evaluates to true, the format + * will be applied. + */ + condition: Schema$BooleanCondition; + /** + * The format to apply. Conditional formatting can only apply a subset of + * formatting: bold, italic, strikethrough, foreground color & + * background color. + */ + format: Schema$CellFormat; + } /** - * True to reverse the order of the domain values (horizontal axis). - */ - reversed: boolean; -} -/** - * A single series of data in a chart. For example, if charting stock prices - * over time, multiple series may exist, one for the "Open Price", - * "High Price", "Low Price" and "Close Price". - */ -export interface Schema$BasicChartSeries { + * A border along a cell. + */ + export interface Schema$Border { + /** + * The color of the border. + */ + color: Schema$Color; + /** + * The style of the border. + */ + style: string; + /** + * The width of the border, in pixels. Deprecated; the width is determined + * by the "style" field. + */ + width: number; + } /** - * The color for elements (i.e. bars, lines, points) associated with this - * series. If empty, a default color will be used. + * The borders of the cell. */ - color: Schema$Color; + export interface Schema$Borders { + /** + * The bottom border of the cell. + */ + bottom: Schema$Border; + /** + * The left border of the cell. + */ + left: Schema$Border; + /** + * The right border of the cell. + */ + right: Schema$Border; + /** + * The top border of the cell. + */ + top: Schema$Border; + } /** - * The line style of this series. Valid only if the chartType is AREA, LINE, - * or SCATTER. COMBO charts are also supported if the series chart type is - * AREA or LINE. - */ - lineStyle: Schema$LineStyle; + * A <a + * href="/chart/interactive/docs/gallery/bubblechart">bubble + * chart</a>. + */ + export interface Schema$BubbleChartSpec { + /** + * The bubble border color. + */ + bubbleBorderColor: Schema$Color; + /** + * The data containing the bubble labels. These do not need to be unique. + */ + bubbleLabels: Schema$ChartData; + /** + * The max radius size of the bubbles, in pixels. If specified, the field + * must be a positive value. + */ + bubbleMaxRadiusSize: number; + /** + * The minimum radius size of the bubbles, in pixels. If specific, the field + * must be a positive value. + */ + bubbleMinRadiusSize: number; + /** + * The opacity of the bubbles between 0 and 1.0. 0 is fully transparent and + * 1 is fully opaque. + */ + bubbleOpacity: number; + /** + * The data contianing the bubble sizes. Bubble sizes are used to draw the + * bubbles at different sizes relative to each other. If specified, + * group_ids must also be specified. This field is optional. + */ + bubbleSizes: Schema$ChartData; + /** + * The format of the text inside the bubbles. Underline and Strikethrough + * are not supported. + */ + bubbleTextStyle: Schema$TextFormat; + /** + * The data containing the bubble x-values. These values locate the bubbles + * in the chart horizontally. + */ + domain: Schema$ChartData; + /** + * The data containing the bubble group IDs. All bubbles with the same group + * ID will be drawn in the same color. If bubble_sizes is specified then + * this field must also be specified but may contain blank values. This + * field is optional. + */ + groupIds: Schema$ChartData; + /** + * Where the legend of the chart should be drawn. + */ + legendPosition: string; + /** + * The data contianing the bubble y-values. These values locate the bubbles + * in the chart vertically. + */ + series: Schema$ChartData; + } /** - * The data being visualized in this chart series. - */ - series: Schema$ChartData; + * A <a + * href="/chart/interactive/docs/gallery/candlestickchart">candlestick + * chart</a>. + */ + export interface Schema$CandlestickChartSpec { + /** + * The Candlestick chart data. Only one CandlestickData is supported. + */ + data: Schema$CandlestickData[]; + /** + * The domain data (horizontal axis) for the candlestick chart. String data + * will be treated as discrete labels, other data will be treated as + * continuous values. + */ + domain: Schema$CandlestickDomain; + } /** - * The minor axis that will specify the range of values for this series. For - * example, if charting stocks over time, the "Volume" series may - * want to be pinned to the right with the prices pinned to the left, because - * the scale of trading volume is different than the scale of prices. It is an - * error to specify an axis that isn't a valid minor axis for the - * chart's type. - */ - targetAxis: string; + * The Candlestick chart data, each containing the low, open, close, and high + * values for a series. + */ + export interface Schema$CandlestickData { + /** + * The range data (vertical axis) for the close/final value for each candle. + * This is the top of the candle body. If greater than the open value the + * candle will be filled. Otherwise the candle will be hollow. + */ + closeSeries: Schema$CandlestickSeries; + /** + * The range data (vertical axis) for the high/maximum value for each + * candle. This is the top of the candle's center line. + */ + highSeries: Schema$CandlestickSeries; + /** + * The range data (vertical axis) for the low/minimum value for each candle. + * This is the bottom of the candle's center line. + */ + lowSeries: Schema$CandlestickSeries; + /** + * The range data (vertical axis) for the open/initial value for each + * candle. This is the bottom of the candle body. If less than the close + * value the candle will be filled. Otherwise the candle will be hollow. + */ + openSeries: Schema$CandlestickSeries; + } /** - * The type of this series. Valid only if the chartType is COMBO. Different - * types will change the way the series is visualized. Only LINE, AREA, and - * COLUMN are supported. - */ - type: string; -} -/** - * The specification for a basic chart. See BasicChartType for the list of - * charts this supports. - */ -export interface Schema$BasicChartSpec { + * The domain of a CandlestickChart. + */ + export interface Schema$CandlestickDomain { + /** + * The data of the CandlestickDomain. + */ + data: Schema$ChartData; + /** + * True to reverse the order of the domain values (horizontal axis). + */ + reversed: boolean; + } /** - * The axis on the chart. + * The series of a CandlestickData. */ - axis: Schema$BasicChartAxis[]; + export interface Schema$CandlestickSeries { + /** + * The data of the CandlestickSeries. + */ + data: Schema$ChartData; + } /** - * The type of the chart. - */ - chartType: string; + * Data about a specific cell. + */ + export interface Schema$CellData { + /** + * A data validation rule on the cell, if any. When writing, the new data + * validation rule will overwrite any prior rule. + */ + dataValidation: Schema$DataValidationRule; + /** + * The effective format being used by the cell. This includes the results of + * applying any conditional formatting and, if the cell contains a formula, + * the computed number format. If the effective format is the default + * format, effective format will not be written. This field is read-only. + */ + effectiveFormat: Schema$CellFormat; + /** + * The effective value of the cell. For cells with formulas, this will be + * the calculated value. For cells with literals, this will be the same as + * the user_entered_value. This field is read-only. + */ + effectiveValue: Schema$ExtendedValue; + /** + * The formatted value of the cell. This is the value as it's shown to + * the user. This field is read-only. + */ + formattedValue: string; + /** + * A hyperlink this cell points to, if any. This field is read-only. (To + * set it, use a `=HYPERLINK` formula in the userEnteredValue.formulaValue + * field.) + */ + hyperlink: string; + /** + * Any note on the cell. + */ + note: string; + /** + * A pivot table anchored at this cell. The size of pivot table itself is + * computed dynamically based on its data, grouping, filters, values, etc. + * Only the top-left cell of the pivot table contains the pivot table + * definition. The other cells will contain the calculated values of the + * results of the pivot in their effective_value fields. + */ + pivotTable: Schema$PivotTable; + /** + * Runs of rich text applied to subsections of the cell. Runs are only + * valid on user entered strings, not formulas, bools, or numbers. Runs + * start at specific indexes in the text and continue until the next run. + * Properties of a run will continue unless explicitly changed in a + * subsequent run (and properties of the first run will continue the + * properties of the cell unless explicitly changed). When writing, the new + * runs will overwrite any prior runs. When writing a new + * user_entered_value, previous runs will be erased. + */ + textFormatRuns: Schema$TextFormatRun[]; + /** + * The format the user entered for the cell. When writing, the new format + * will be merged with the existing format. + */ + userEnteredFormat: Schema$CellFormat; + /** + * The value the user entered in the cell. e.g, `1234`, `'Hello'`, + * or `=NOW()` Note: Dates, Times and DateTimes are represented as doubles + * in serial number format. + */ + userEnteredValue: Schema$ExtendedValue; + } /** - * The behavior of tooltips and data highlighting when hovering on data and - * chart area. - */ - compareMode: string; + * The format of a cell. + */ + export interface Schema$CellFormat { + /** + * The background color of the cell. + */ + backgroundColor: Schema$Color; + /** + * The borders of the cell. + */ + borders: Schema$Borders; + /** + * The horizontal alignment of the value in the cell. + */ + horizontalAlignment: string; + /** + * How a hyperlink, if it exists, should be displayed in the cell. + */ + hyperlinkDisplayType: string; + /** + * A format describing how number values should be represented to the user. + */ + numberFormat: Schema$NumberFormat; + /** + * The padding of the cell. + */ + padding: Schema$Padding; + /** + * The direction of the text in the cell. + */ + textDirection: string; + /** + * The format of the text in the cell (unless overridden by a format run). + */ + textFormat: Schema$TextFormat; + /** + * The rotation applied to text in a cell + */ + textRotation: Schema$TextRotation; + /** + * The vertical alignment of the value in the cell. + */ + verticalAlignment: string; + /** + * The wrap strategy for the value in the cell. + */ + wrapStrategy: string; + } /** - * The domain of data this is charting. Only a single domain is supported. + * The data included in a domain or series. */ - domains: Schema$BasicChartDomain[]; + export interface Schema$ChartData { + /** + * The source ranges of the data. + */ + sourceRange: Schema$ChartSourceRange; + } /** - * The number of rows or columns in the data that are "headers". If - * not set, Google Sheets will guess how many rows are headers based on the - * data. (Note that BasicChartAxis.title may override the axis title inferred - * from the header values.) - */ - headerCount: number; + * Source ranges for a chart. + */ + export interface Schema$ChartSourceRange { + /** + * The ranges of data for a series or domain. Exactly one dimension must + * have a length of 1, and all sources in the list must have the same + * dimension with length 1. The domain (if it exists) & all series must + * have the same number of source ranges. If using more than one source + * range, then the source range at a given offset must be in order and + * contiguous across the domain and series. For example, these are valid + * configurations: domain sources: A1:A5 series1 sources: B1:B5 + * series2 sources: D6:D10 domain sources: A1:A5, C10:C12 series1 + * sources: B1:B5, D10:D12 series2 sources: C1:C5, E10:E12 + */ + sources: Schema$GridRange[]; + } /** - * If some values in a series are missing, gaps may appear in the chart (e.g, - * segments of lines in a line chart will be missing). To eliminate these - * gaps set this to true. Applies to Line, Area, and Combo charts. - */ - interpolateNulls: boolean; + * The specifications of a chart. + */ + export interface Schema$ChartSpec { + /** + * The alternative text that describes the chart. This is often used for + * accessibility. + */ + altText: string; + /** + * The background color of the entire chart. Not applicable to Org charts. + */ + backgroundColor: Schema$Color; + /** + * A basic chart specification, can be one of many kinds of charts. See + * BasicChartType for the list of all charts this supports. + */ + basicChart: Schema$BasicChartSpec; + /** + * A bubble chart specification. + */ + bubbleChart: Schema$BubbleChartSpec; + /** + * A candlestick chart specification. + */ + candlestickChart: Schema$CandlestickChartSpec; + /** + * The name of the font to use by default for all chart text (e.g. title, + * axis labels, legend). If a font is specified for a specific part of the + * chart it will override this font name. + */ + fontName: string; + /** + * Determines how the charts will use hidden rows or columns. + */ + hiddenDimensionStrategy: string; + /** + * A histogram chart specification. + */ + histogramChart: Schema$HistogramChartSpec; + /** + * True to make a chart fill the entire space in which it's rendered + * with minimum padding. False to use the default padding. (Not applicable + * to Geo and Org charts.) + */ + maximized: boolean; + /** + * An org chart specification. + */ + orgChart: Schema$OrgChartSpec; + /** + * A pie chart specification. + */ + pieChart: Schema$PieChartSpec; + /** + * The subtitle of the chart. + */ + subtitle: string; + /** + * The subtitle text format. Strikethrough and underline are not supported. + */ + subtitleTextFormat: Schema$TextFormat; + /** + * The subtitle text position. This field is optional. + */ + subtitleTextPosition: Schema$TextPosition; + /** + * The title of the chart. + */ + title: string; + /** + * The title text format. Strikethrough and underline are not supported. + */ + titleTextFormat: Schema$TextFormat; + /** + * The title text position. This field is optional. + */ + titleTextPosition: Schema$TextPosition; + /** + * A treemap chart specification. + */ + treemapChart: Schema$TreemapChartSpec; + /** + * A waterfall chart specification. + */ + waterfallChart: Schema$WaterfallChartSpec; + } /** - * The position of the chart legend. + * Clears the basic filter, if any exists on the sheet. */ - legendPosition: string; + export interface Schema$ClearBasicFilterRequest { + /** + * The sheet ID on which the basic filter should be cleared. + */ + sheetId: number; + } /** - * Gets whether all lines should be rendered smooth or straight by default. - * Applies to Line charts. + * The request for clearing a range of values in a spreadsheet. */ - lineSmoothing: boolean; + export interface Schema$ClearValuesRequest {} /** - * The data this chart is visualizing. + * The response when clearing a range of values in a spreadsheet. */ - series: Schema$BasicChartSeries[]; + export interface Schema$ClearValuesResponse { + /** + * The range (in A1 notation) that was cleared. (If the request was for an + * unbounded range or a ranger larger than the bounds of the sheet, this + * will be the actual range that was cleared, bounded to the sheet's + * limits.) + */ + clearedRange: string; + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + } /** - * The stacked type for charts that support vertical stacking. Applies to - * Area, Bar, Column, Combo, and Stepped Area charts. - */ - stackedType: string; + * Represents a color in the RGBA color space. This representation is designed + * for simplicity of conversion to/from color representations in various + * languages over compactness; for example, the fields of this representation + * can be trivially provided to the constructor of "java.awt.Color" + * in Java; it can also be trivially provided to UIColor's + * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a + * little work, it can be easily formatted into a CSS "rgba()" + * string in JavaScript, as well. Here are some examples: Example (Java): + * import com.google.type.Color; // ... public static + * java.awt.Color fromProto(Color protocolor) { float alpha = + * protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; + * return new java.awt.Color( protocolor.getRed(), + * protocolor.getGreen(), protocolor.getBlue(), alpha); + * } public static Color toProto(java.awt.Color color) { float + * red = (float) color.getRed(); float green = (float) + * color.getGreen(); float blue = (float) color.getBlue(); float + * denominator = 255.0; Color.Builder resultBuilder = Color + * .newBuilder() .setRed(red / denominator) .setGreen(green / + * denominator) .setBlue(blue / denominator); int alpha + * = color.getAlpha(); if (alpha != 255) { result.setAlpha( + * FloatValue .newBuilder() .setValue(((float) alpha) / + * denominator) .build()); } return + * resultBuilder.build(); } // ... Example (iOS / Obj-C): // + * ... static UIColor* fromProto(Color* protocolor) { float red = + * [protocolor red]; float green = [protocolor green]; float + * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor + * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { + * alpha = [alpha_wrapper value]; } return [UIColor + * colorWithRed:red green:green blue:blue alpha:alpha]; } static + * Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; + * if (![color getRed:&red green:&green blue:&blue + * alpha:&alpha]) { return nil; } Color* + * result = [Color alloc] init]; [result setRed:red]; [result + * setGreen:green]; [result setBlue:blue]; if (alpha <= + * 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } + * [result autorelease]; return result; } // ... Example + * (JavaScript): // ... var protoToCssColor = function(rgb_color) { + * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green + * || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = + * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); + * var blue = Math.floor(blueFrac * 255); if (!('alpha' in + * rgb_color)) { return rgbToCssColor_(red, green, blue); } + * var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, + * green, blue].join(','); return ['rgba(', rgbParams, + * ',', alphaFrac, ')'].join(''); }; var + * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new + * Number((red << 16) | (green << 8) | blue); var hexString + * = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; + * var resultBuilder = ['#']; for (var i = 0; i < + * missingZeros; i++) { resultBuilder.push('0'); } + * resultBuilder.push(hexString); return resultBuilder.join(''); + * }; // ... + */ + export interface Schema$Color { + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: pixel color = alpha + * * (this color) + (1.0 - alpha) * (background color) This means that a + * value of 1.0 corresponds to a solid color, whereas a value of 0.0 + * corresponds to a completely transparent color. This uses a wrapper + * message rather than a simple float scalar so that it is possible to + * distinguish between a default value and the value being unset. If + * omitted, this color object is to be rendered as a solid color (as if the + * alpha value had been explicitly given with a value of 1.0). + */ + alpha: number; + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * True to make the chart 3D. Applies to Bar and Column charts. - */ - threeDimensional: boolean; -} -/** - * The default filter associated with a sheet. - */ -export interface Schema$BasicFilter { + * A rule describing a conditional format. + */ + export interface Schema$ConditionalFormatRule { + /** + * The formatting is either "on" or "off" according to + * the rule. + */ + booleanRule: Schema$BooleanRule; + /** + * The formatting will vary based on the gradients in the rule. + */ + gradientRule: Schema$GradientRule; + /** + * The ranges that will be formatted if the condition is true. All the + * ranges must be on the same grid. + */ + ranges: Schema$GridRange[]; + } /** - * The criteria for showing/hiding values per column. The map's key is the - * column index, and the value is the criteria for that column. - */ - criteria: any; + * The value of the condition. + */ + export interface Schema$ConditionValue { + /** + * A relative date (based on the current date). Valid only if the type is + * DATE_BEFORE, DATE_AFTER, DATE_ON_OR_BEFORE or DATE_ON_OR_AFTER. Relative + * dates are not supported in data validation. They are supported only in + * conditional formatting and conditional filters. + */ + relativeDate: string; + /** + * A value the condition is based on. The value will be parsed as if the + * user typed into a cell. Formulas are supported (and must begin with an + * `=` or a '+'). + */ + userEnteredValue: string; + } /** - * The range the filter covers. - */ - range: Schema$GridRange; + * Copies data from the source to the destination. + */ + export interface Schema$CopyPasteRequest { + /** + * The location to paste to. If the range covers a span that's a + * multiple of the source's height or width, then the data will be + * repeated to fill in the destination range. If the range is smaller than + * the source range, the entire source data will still be copied (beyond the + * end of the destination range). + */ + destination: Schema$GridRange; + /** + * How that data should be oriented when pasting. + */ + pasteOrientation: string; + /** + * What kind of data to paste. + */ + pasteType: string; + /** + * The source range to copy. + */ + source: Schema$GridRange; + } /** - * The sort order per column. Later specifications are used when values are - * equal in the earlier specifications. + * The request to copy a sheet across spreadsheets. */ - sortSpecs: Schema$SortSpec[]; -} -/** - * The request for clearing more than one range selected by a DataFilter in a - * spreadsheet. - */ -export interface Schema$BatchClearValuesByDataFilterRequest { + export interface Schema$CopySheetToAnotherSpreadsheetRequest { + /** + * The ID of the spreadsheet to copy the sheet to. + */ + destinationSpreadsheetId: string; + } /** - * The DataFilters used to determine which ranges to clear. + * A request to create developer metadata. */ - dataFilters: Schema$DataFilter[]; -} -/** - * The response when clearing a range of values selected with DataFilters in a - * spreadsheet. - */ -export interface Schema$BatchClearValuesByDataFilterResponse { + export interface Schema$CreateDeveloperMetadataRequest { + /** + * The developer metadata to create. + */ + developerMetadata: Schema$DeveloperMetadata; + } /** - * The ranges that were cleared, in A1 notation. (If the requests were for an - * unbounded range or a ranger larger than the bounds of the sheet, this will - * be the actual ranges that were cleared, bounded to the sheet's - * limits.) + * The response from creating developer metadata. */ - clearedRanges: string[]; + export interface Schema$CreateDeveloperMetadataResponse { + /** + * The developer metadata that was created. + */ + developerMetadata: Schema$DeveloperMetadata; + } /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; -} -/** - * The request for clearing more than one range of values in a spreadsheet. - */ -export interface Schema$BatchClearValuesRequest { + * Moves data from the source to the destination. + */ + export interface Schema$CutPasteRequest { + /** + * The top-left coordinate where the data should be pasted. + */ + destination: Schema$GridCoordinate; + /** + * What kind of data to paste. All the source data will be cut, regardless + * of what is pasted. + */ + pasteType: string; + /** + * The source data to cut. + */ + source: Schema$GridRange; + } /** - * The ranges to clear, in A1 notation. - */ - ranges: string[]; -} -/** - * The response when clearing a range of values in a spreadsheet. - */ -export interface Schema$BatchClearValuesResponse { + * Filter that describes what data should be selected or returned from a + * request. + */ + export interface Schema$DataFilter { + /** + * Selects data that matches the specified A1 range. + */ + a1Range: string; + /** + * Selects data associated with the developer metadata matching the criteria + * described by this DeveloperMetadataLookup. + */ + developerMetadataLookup: Schema$DeveloperMetadataLookup; + /** + * Selects data that matches the range described by the GridRange. + */ + gridRange: Schema$GridRange; + } /** - * The ranges that were cleared, in A1 notation. (If the requests were for an - * unbounded range or a ranger larger than the bounds of the sheet, this will - * be the actual ranges that were cleared, bounded to the sheet's - * limits.) - */ - clearedRanges: string[]; + * A range of values whose location is specified by a DataFilter. + */ + export interface Schema$DataFilterValueRange { + /** + * The data filter describing the location of the values in the spreadsheet. + */ + dataFilter: Schema$DataFilter; + /** + * The major dimension of the values. + */ + majorDimension: string; + /** + * The data to be written. If the provided values exceed any of the ranges + * matched by the data filter then the request will fail. If the provided + * values are less than the matched ranges only the specified values will be + * written, existing values in the matched ranges will remain unaffected. + */ + values: any[][]; + } /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; -} -/** - * The request for retrieving a range of values in a spreadsheet selected by a - * set of DataFilters. - */ -export interface Schema$BatchGetValuesByDataFilterRequest { + * A data validation rule. + */ + export interface Schema$DataValidationRule { + /** + * The condition that data in the cell must match. + */ + condition: Schema$BooleanCondition; + /** + * A message to show the user when adding data to the cell. + */ + inputMessage: string; + /** + * True if the UI should be customized based on the kind of condition. If + * true, "List" conditions will show a dropdown. + */ + showCustomUi: boolean; + /** + * True if invalid data should be rejected. + */ + strict: boolean; + } /** - * The data filters used to match the ranges of values to retrieve. Ranges - * that match any of the specified data filters will be included in the - * response. + * Removes the banded range with the given ID from the spreadsheet. */ - dataFilters: Schema$DataFilter[]; + export interface Schema$DeleteBandingRequest { + /** + * The ID of the banded range to delete. + */ + bandedRangeId: number; + } /** - * How dates, times, and durations should be represented in the output. This - * is ignored if value_render_option is FORMATTED_VALUE. The default dateTime - * render option is [DateTimeRenderOption.SERIAL_NUMBER]. - */ - dateTimeRenderOption: string; + * Deletes a conditional format rule at the given index. All subsequent + * rules' indexes are decremented. + */ + export interface Schema$DeleteConditionalFormatRuleRequest { + /** + * The zero-based index of the rule to be deleted. + */ + index: number; + /** + * The sheet the rule is being deleted from. + */ + sheetId: number; + } /** - * The major dimension that results should use. For example, if the - * spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then a request that selects - * that range and sets `majorDimension=ROWS` will return `[[1,2],[3,4]]`, - * whereas a request that sets `majorDimension=COLUMNS` will return - * `[[1,3],[2,4]]`. + * The result of deleting a conditional format rule. */ - majorDimension: string; + export interface Schema$DeleteConditionalFormatRuleResponse { + /** + * The rule that was deleted. + */ + rule: Schema$ConditionalFormatRule; + } /** - * How values should be represented in the output. The default render option - * is ValueRenderOption.FORMATTED_VALUE. + * A request to delete developer metadata. */ - valueRenderOption: string; -} -/** - * The response when retrieving more than one range of values in a spreadsheet - * selected by DataFilters. - */ -export interface Schema$BatchGetValuesByDataFilterResponse { + export interface Schema$DeleteDeveloperMetadataRequest { + /** + * The data filter describing the criteria used to select which developer + * metadata entry to delete. + */ + dataFilter: Schema$DataFilter; + } /** - * The ID of the spreadsheet the data was retrieved from. + * The response from deleting developer metadata. */ - spreadsheetId: string; + export interface Schema$DeleteDeveloperMetadataResponse { + /** + * The metadata that was deleted. + */ + deletedDeveloperMetadata: Schema$DeveloperMetadata[]; + } /** - * The requested values with the list of data filters that matched them. + * Deletes the dimensions from the sheet. */ - valueRanges: Schema$MatchedValueRange[]; -} -/** - * The response when retrieving more than one range of values in a spreadsheet. - */ -export interface Schema$BatchGetValuesResponse { + export interface Schema$DeleteDimensionRequest { + /** + * The dimensions to delete from the sheet. + */ + range: Schema$DimensionRange; + } /** - * The ID of the spreadsheet the data was retrieved from. + * Deletes the embedded object with the given ID. */ - spreadsheetId: string; + export interface Schema$DeleteEmbeddedObjectRequest { + /** + * The ID of the embedded object to delete. + */ + objectId: number; + } /** - * The requested values. The order of the ValueRanges is the same as the order - * of the requested ranges. + * Deletes a particular filter view. */ - valueRanges: Schema$ValueRange[]; -} -/** - * The request for updating any aspect of a spreadsheet. - */ -export interface Schema$BatchUpdateSpreadsheetRequest { + export interface Schema$DeleteFilterViewRequest { + /** + * The ID of the filter to delete. + */ + filterId: number; + } /** - * Determines if the update response should include the spreadsheet resource. + * Removes the named range with the given ID from the spreadsheet. */ - includeSpreadsheetInResponse: boolean; + export interface Schema$DeleteNamedRangeRequest { + /** + * The ID of the named range to delete. + */ + namedRangeId: string; + } /** - * A list of updates to apply to the spreadsheet. Requests will be applied in - * the order they are specified. If any request is not valid, no requests will - * be applied. + * Deletes the protected range with the given ID. */ - requests: Schema$Request[]; + export interface Schema$DeleteProtectedRangeRequest { + /** + * The ID of the protected range to delete. + */ + protectedRangeId: number; + } /** - * True if grid data should be returned. Meaningful only if if - * include_spreadsheet_in_response is 'true'. This parameter is - * ignored if a field mask was set in the request. - */ - responseIncludeGridData: boolean; + * Deletes a range of cells, shifting other cells into the deleted area. + */ + export interface Schema$DeleteRangeRequest { + /** + * The range of cells to delete. + */ + range: Schema$GridRange; + /** + * The dimension from which deleted cells will be replaced with. If ROWS, + * existing cells will be shifted upward to replace the deleted cells. If + * COLUMNS, existing cells will be shifted left to replace the deleted + * cells. + */ + shiftDimension: string; + } /** - * Limits the ranges included in the response spreadsheet. Meaningful only if - * include_spreadsheet_response is 'true'. + * Deletes the requested sheet. */ - responseRanges: string[]; -} -/** - * The reply for batch updating a spreadsheet. - */ -export interface Schema$BatchUpdateSpreadsheetResponse { + export interface Schema$DeleteSheetRequest { + /** + * The ID of the sheet to delete. + */ + sheetId: number; + } /** - * The reply of the updates. This maps 1:1 with the updates, although replies - * to some requests may be empty. - */ - replies: Schema$Response[]; + * Developer metadata associated with a location or object in a spreadsheet. + * Developer metadata may be used to associate arbitrary data with various + * parts of a spreadsheet and will remain associated at those locations as + * they move around and the spreadsheet is edited. For example, if developer + * metadata is associated with row 5 and another row is then subsequently + * inserted above row 5, that original metadata will still be associated with + * the row it was first associated with (what is now row 6). If the associated + * object is deleted its metadata will be deleted too. + */ + export interface Schema$DeveloperMetadata { + /** + * The location where the metadata is associated. + */ + location: Schema$DeveloperMetadataLocation; + /** + * The spreadsheet-scoped unique ID that identifies the metadata. IDs may be + * specified when metadata is created, otherwise one will be randomly + * generated and assigned. Must be positive. + */ + metadataId: number; + /** + * The metadata key. There may be multiple metadata in a spreadsheet with + * the same key. Developer metadata must always have a key specified. + */ + metadataKey: string; + /** + * Data associated with the metadata's key. + */ + metadataValue: string; + /** + * The metadata visibility. Developer metadata must always have a + * visibility specified. + */ + visibility: string; + } /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; + * A location where metadata may be associated in a spreadsheet. + */ + export interface Schema$DeveloperMetadataLocation { + /** + * Represents the row or column when metadata is associated with a + * dimension. The specified DimensionRange must represent a single row or + * column; it cannot be unbounded or span multiple rows or columns. + */ + dimensionRange: Schema$DimensionRange; + /** + * The type of location this object represents. This field is read-only. + */ + locationType: string; + /** + * The ID of the sheet when metadata is associated with an entire sheet. + */ + sheetId: number; + /** + * True when metadata is associated with an entire spreadsheet. + */ + spreadsheet: boolean; + } /** - * The spreadsheet after updates were applied. This is only set if - * [BatchUpdateSpreadsheetRequest.include_spreadsheet_in_response] is `true`. - */ - updatedSpreadsheet: Schema$Spreadsheet; -} -/** - * The request for updating more than one range of values in a spreadsheet. - */ -export interface Schema$BatchUpdateValuesByDataFilterRequest { + * Selects DeveloperMetadata that matches all of the specified fields. For + * example, if only a metadata ID is specified this considers the + * DeveloperMetadata with that particular unique ID. If a metadata key is + * specified, this considers all developer metadata with that key. If a key, + * visibility, and location type are all specified, this considers all + * developer metadata with that key and visibility that are associated with a + * location of that type. In general, this selects all DeveloperMetadata that + * matches the intersection of all the specified fields; any field or + * combination of fields may be specified. + */ + export interface Schema$DeveloperMetadataLookup { + /** + * Determines how this lookup matches the location. If this field is + * specified as EXACT, only developer metadata associated on the exact + * location specified is matched. If this field is specified to + * INTERSECTING, developer metadata associated on intersecting locations is + * also matched. If left unspecified, this field assumes a default value of + * INTERSECTING. If this field is specified, a metadataLocation must also be + * specified. + */ + locationMatchingStrategy: string; + /** + * Limits the selected developer metadata to those entries which are + * associated with locations of the specified type. For example, when this + * field is specified as ROW this lookup only considers developer metadata + * associated on rows. If the field is left unspecified, all location types + * are considered. This field cannot be specified as SPREADSHEET when the + * locationMatchingStrategy is specified as INTERSECTING or when the + * metadataLocation is specified as a non-spreadsheet location: spreadsheet + * metadata cannot intersect any other developer metadata location. This + * field also must be left unspecified when the locationMatchingStrategy is + * specified as EXACT. + */ + locationType: string; + /** + * Limits the selected developer metadata to that which has a matching + * DeveloperMetadata.metadata_id. + */ + metadataId: number; + /** + * Limits the selected developer metadata to that which has a matching + * DeveloperMetadata.metadata_key. + */ + metadataKey: string; + /** + * Limits the selected developer metadata to those entries associated with + * the specified location. This field either matches exact locations or all + * intersecting locations according the specified locationMatchingStrategy. + */ + metadataLocation: Schema$DeveloperMetadataLocation; + /** + * Limits the selected developer metadata to that which has a matching + * DeveloperMetadata.metadata_value. + */ + metadataValue: string; + /** + * Limits the selected developer metadata to that which has a matching + * DeveloperMetadata.visibility. If left unspecified, all developer + * metadata visibile to the requesting project is considered. + */ + visibility: string; + } /** - * The new values to apply to the spreadsheet. If more than one range is - * matched by the specified DataFilter the specified values will be applied to - * all of those ranges. - */ - data: Schema$DataFilterValueRange[]; + * Properties about a dimension. + */ + export interface Schema$DimensionProperties { + /** + * The developer metadata associated with a single row or column. + */ + developerMetadata: Schema$DeveloperMetadata[]; + /** + * True if this dimension is being filtered. This field is read-only. + */ + hiddenByFilter: boolean; + /** + * True if this dimension is explicitly hidden. + */ + hiddenByUser: boolean; + /** + * The height (if a row) or width (if a column) of the dimension in pixels. + */ + pixelSize: number; + } /** - * Determines if the update response should include the values of the cells - * that were updated. By default, responses do not include the updated values. - * The `updatedData` field within each of the - * BatchUpdateValuesResponse.responses will contain the updated values. If the - * range to write was larger than than the range actually written, the - * response will include all values in the requested range (excluding trailing - * empty rows and columns). - */ - includeValuesInResponse: boolean; + * A range along a single dimension on a sheet. All indexes are zero-based. + * Indexes are half open: the start index is inclusive and the end index is + * exclusive. Missing indexes indicate the range is unbounded on that side. + */ + export interface Schema$DimensionRange { + /** + * The dimension of the span. + */ + dimension: string; + /** + * The end (exclusive) of the span, or not set if unbounded. + */ + endIndex: number; + /** + * The sheet this span is on. + */ + sheetId: number; + /** + * The start (inclusive) of the span, or not set if unbounded. + */ + startIndex: number; + } /** - * Determines how dates, times, and durations in the response should be - * rendered. This is ignored if response_value_render_option is - * FORMATTED_VALUE. The default dateTime render option is - * DateTimeRenderOption.SERIAL_NUMBER. + * Duplicates a particular filter view. */ - responseDateTimeRenderOption: string; + export interface Schema$DuplicateFilterViewRequest { + /** + * The ID of the filter being duplicated. + */ + filterId: number; + } /** - * Determines how values in the response should be rendered. The default - * render option is ValueRenderOption.FORMATTED_VALUE. + * The result of a filter view being duplicated. */ - responseValueRenderOption: string; + export interface Schema$DuplicateFilterViewResponse { + /** + * The newly created filter. + */ + filter: Schema$FilterView; + } /** - * How the input data should be interpreted. - */ - valueInputOption: string; -} -/** - * The response when updating a range of values in a spreadsheet. - */ -export interface Schema$BatchUpdateValuesByDataFilterResponse { - /** - * The response for each range updated. - */ - responses: Schema$UpdateValuesByDataFilterResponse[]; - /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; - /** - * The total number of cells updated. - */ - totalUpdatedCells: number; - /** - * The total number of columns where at least one cell in the column was - * updated. - */ - totalUpdatedColumns: number; - /** - * The total number of rows where at least one cell in the row was updated. - */ - totalUpdatedRows: number; - /** - * The total number of sheets where at least one cell in the sheet was - * updated. - */ - totalUpdatedSheets: number; -} -/** - * The request for updating more than one range of values in a spreadsheet. - */ -export interface Schema$BatchUpdateValuesRequest { + * Duplicates the contents of a sheet. + */ + export interface Schema$DuplicateSheetRequest { + /** + * The zero-based index where the new sheet should be inserted. The index of + * all sheets after this are incremented. + */ + insertSheetIndex: number; + /** + * If set, the ID of the new sheet. If not set, an ID is chosen. If set, the + * ID must not conflict with any existing sheet ID. If set, it must be + * non-negative. + */ + newSheetId: number; + /** + * The name of the new sheet. If empty, a new name is chosen for you. + */ + newSheetName: string; + /** + * The sheet to duplicate. + */ + sourceSheetId: number; + } /** - * The new values to apply to the spreadsheet. + * The result of duplicating a sheet. */ - data: Schema$ValueRange[]; + export interface Schema$DuplicateSheetResponse { + /** + * The properties of the duplicate sheet. + */ + properties: Schema$SheetProperties; + } /** - * Determines if the update response should include the values of the cells - * that were updated. By default, responses do not include the updated values. - * The `updatedData` field within each of the - * BatchUpdateValuesResponse.responses will contain the updated values. If the - * range to write was larger than than the range actually written, the - * response will include all values in the requested range (excluding trailing - * empty rows and columns). - */ - includeValuesInResponse: boolean; + * The editors of a protected range. + */ + export interface Schema$Editors { + /** + * True if anyone in the document's domain has edit access to the + * protected range. Domain protection is only supported on documents within + * a domain. + */ + domainUsersCanEdit: boolean; + /** + * The email addresses of groups with edit access to the protected range. + */ + groups: string[]; + /** + * The email addresses of users with edit access to the protected range. + */ + users: string[]; + } /** - * Determines how dates, times, and durations in the response should be - * rendered. This is ignored if response_value_render_option is - * FORMATTED_VALUE. The default dateTime render option is - * DateTimeRenderOption.SERIAL_NUMBER. - */ - responseDateTimeRenderOption: string; + * A chart embedded in a sheet. + */ + export interface Schema$EmbeddedChart { + /** + * The ID of the chart. + */ + chartId: number; + /** + * The position of the chart. + */ + position: Schema$EmbeddedObjectPosition; + /** + * The specification of the chart. + */ + spec: Schema$ChartSpec; + } /** - * Determines how values in the response should be rendered. The default - * render option is ValueRenderOption.FORMATTED_VALUE. - */ - responseValueRenderOption: string; + * The position of an embedded object such as a chart. + */ + export interface Schema$EmbeddedObjectPosition { + /** + * If true, the embedded object will be put on a new sheet whose ID is + * chosen for you. Used only when writing. + */ + newSheet: boolean; + /** + * The position at which the object is overlaid on top of a grid. + */ + overlayPosition: Schema$OverlayPosition; + /** + * The sheet this is on. Set only if the embedded object is on its own + * sheet. Must be non-negative. + */ + sheetId: number; + } /** - * How the input data should be interpreted. - */ - valueInputOption: string; -} -/** - * The response when updating a range of values in a spreadsheet. - */ -export interface Schema$BatchUpdateValuesResponse { + * An error in a cell. + */ + export interface Schema$ErrorValue { + /** + * A message with more information about the error (in the spreadsheet's + * locale). + */ + message: string; + /** + * The type of error. + */ + type: string; + } /** - * One UpdateValuesResponse per requested range, in the same order as the - * requests appeared. - */ - responses: Schema$UpdateValuesResponse[]; + * The kinds of value that a cell in a spreadsheet can have. + */ + export interface Schema$ExtendedValue { + /** + * Represents a boolean value. + */ + boolValue: boolean; + /** + * Represents an error. This field is read-only. + */ + errorValue: Schema$ErrorValue; + /** + * Represents a formula. + */ + formulaValue: string; + /** + * Represents a double value. Note: Dates, Times and DateTimes are + * represented as doubles in "serial number" format. + */ + numberValue: number; + /** + * Represents a string value. Leading single quotes are not included. For + * example, if the user typed `'123` into the UI, this would be + * represented as a `stringValue` of `"123"`. + */ + stringValue: string; + } /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; + * Criteria for showing/hiding rows in a filter or filter view. + */ + export interface Schema$FilterCriteria { + /** + * A condition that must be true for values to be shown. (This does not + * override hiddenValues -- if a value is listed there, it will still be + * hidden.) + */ + condition: Schema$BooleanCondition; + /** + * Values that should be hidden. + */ + hiddenValues: string[]; + } /** - * The total number of cells updated. - */ - totalUpdatedCells: number; + * A filter view. + */ + export interface Schema$FilterView { + /** + * The criteria for showing/hiding values per column. The map's key is + * the column index, and the value is the criteria for that column. + */ + criteria: any; + /** + * The ID of the filter view. + */ + filterViewId: number; + /** + * The named range this filter view is backed by, if any. When writing, + * only one of range or named_range_id may be set. + */ + namedRangeId: string; + /** + * The range this filter view covers. When writing, only one of range or + * named_range_id may be set. + */ + range: Schema$GridRange; + /** + * The sort order per column. Later specifications are used when values are + * equal in the earlier specifications. + */ + sortSpecs: Schema$SortSpec[]; + /** + * The name of the filter view. + */ + title: string; + } /** - * The total number of columns where at least one cell in the column was - * updated. - */ - totalUpdatedColumns: number; + * Finds and replaces data in cells over a range, sheet, or all sheets. + */ + export interface Schema$FindReplaceRequest { + /** + * True to find/replace over all sheets. + */ + allSheets: boolean; + /** + * The value to search. + */ + find: string; + /** + * True if the search should include cells with formulas. False to skip + * cells with formulas. + */ + includeFormulas: boolean; + /** + * True if the search is case sensitive. + */ + matchCase: boolean; + /** + * True if the find value should match the entire cell. + */ + matchEntireCell: boolean; + /** + * The range to find/replace over. + */ + range: Schema$GridRange; + /** + * The value to use as the replacement. + */ + replacement: string; + /** + * True if the find value is a regex. The regular expression and replacement + * should follow Java regex rules at + * https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html. + * The replacement string is allowed to refer to capturing groups. For + * example, if one cell has the contents `"Google Sheets"` and + * another has `"Google Docs"`, then searching for `"o.* + * (.*)"` with a replacement of `"$1 Rocks"` would change the + * contents of the cells to `"GSheets Rocks"` and `"GDocs + * Rocks"` respectively. + */ + searchByRegex: boolean; + /** + * The sheet to find/replace over. + */ + sheetId: number; + } /** - * The total number of rows where at least one cell in the row was updated. - */ - totalUpdatedRows: number; + * The result of the find/replace. + */ + export interface Schema$FindReplaceResponse { + /** + * The number of formula cells changed. + */ + formulasChanged: number; + /** + * The number of occurrences (possibly multiple within a cell) changed. For + * example, if replacing `"e"` with `"o"` in + * `"Google Sheets"`, this would be `"3"` because + * `"Google Sheets"` -> `"Googlo Shoots"`. + */ + occurrencesChanged: number; + /** + * The number of rows changed. + */ + rowsChanged: number; + /** + * The number of sheets changed. + */ + sheetsChanged: number; + /** + * The number of non-formula cells changed. + */ + valuesChanged: number; + } /** - * The total number of sheets where at least one cell in the sheet was - * updated. - */ - totalUpdatedSheets: number; -} -/** - * A condition that can evaluate to true or false. BooleanConditions are used by - * conditional formatting, data validation, and the criteria in filters. - */ -export interface Schema$BooleanCondition { + * The request for retrieving a Spreadsheet. + */ + export interface Schema$GetSpreadsheetByDataFilterRequest { + /** + * The DataFilters used to select which ranges to retrieve from the + * spreadsheet. + */ + dataFilters: Schema$DataFilter[]; + /** + * True if grid data should be returned. This parameter is ignored if a + * field mask was set in the request. + */ + includeGridData: boolean; + } /** - * The type of condition. - */ - type: string; + * A rule that applies a gradient color scale format, based on the + * interpolation points listed. The format of a cell will vary based on its + * contents as compared to the values of the interpolation points. + */ + export interface Schema$GradientRule { + /** + * The final interpolation point. + */ + maxpoint: Schema$InterpolationPoint; + /** + * An optional midway interpolation point. + */ + midpoint: Schema$InterpolationPoint; + /** + * The starting interpolation point. + */ + minpoint: Schema$InterpolationPoint; + } /** - * The values of the condition. The number of supported values depends on the - * condition type. Some support zero values, others one or two values, and - * ConditionType.ONE_OF_LIST supports an arbitrary number of values. - */ - values: Schema$ConditionValue[]; -} -/** - * A rule that may or may not match, depending on the condition. - */ -export interface Schema$BooleanRule { + * A coordinate in a sheet. All indexes are zero-based. + */ + export interface Schema$GridCoordinate { + /** + * The column index of the coordinate. + */ + columnIndex: number; + /** + * The row index of the coordinate. + */ + rowIndex: number; + /** + * The sheet this coordinate is on. + */ + sheetId: number; + } /** - * The condition of the rule. If the condition evaluates to true, the format - * will be applied. - */ - condition: Schema$BooleanCondition; + * Data in the grid, as well as metadata about the dimensions. + */ + export interface Schema$GridData { + /** + * Metadata about the requested columns in the grid, starting with the + * column in start_column. + */ + columnMetadata: Schema$DimensionProperties[]; + /** + * The data in the grid, one entry per row, starting with the row in + * startRow. The values in RowData will correspond to columns starting at + * start_column. + */ + rowData: Schema$RowData[]; + /** + * Metadata about the requested rows in the grid, starting with the row in + * start_row. + */ + rowMetadata: Schema$DimensionProperties[]; + /** + * The first column this GridData refers to, zero-based. + */ + startColumn: number; + /** + * The first row this GridData refers to, zero-based. + */ + startRow: number; + } /** - * The format to apply. Conditional formatting can only apply a subset of - * formatting: bold, italic, strikethrough, foreground color & background - * color. - */ - format: Schema$CellFormat; -} -/** - * A border along a cell. - */ -export interface Schema$Border { + * Properties of a grid. + */ + export interface Schema$GridProperties { + /** + * The number of columns in the grid. + */ + columnCount: number; + /** + * The number of columns that are frozen in the grid. + */ + frozenColumnCount: number; + /** + * The number of rows that are frozen in the grid. + */ + frozenRowCount: number; + /** + * True if the grid isn't showing gridlines in the UI. + */ + hideGridlines: boolean; + /** + * The number of rows in the grid. + */ + rowCount: number; + } /** - * The color of the border. - */ - color: Schema$Color; + * A range on a sheet. All indexes are zero-based. Indexes are half open, e.g + * the start index is inclusive and the end index is exclusive -- + * [start_index, end_index). Missing indexes indicate the range is unbounded + * on that side. For example, if `"Sheet1"` is sheet ID 0, then: + * `Sheet1!A1:A1 == sheet_id: 0, start_row_index: 0, + * end_row_index: 1, start_column_index: 0, + * end_column_index: 1` `Sheet1!A3:B4 == sheet_id: 0, start_row_index: 2, + * end_row_index: 4, start_column_index: 0, + * end_column_index: 2` `Sheet1!A:B == sheet_id: 0, start_column_index: 0, + * end_column_index: 2` `Sheet1!A5:B == sheet_id: 0, start_row_index: 4, + * start_column_index: 0, end_column_index: 2` `Sheet1 == sheet_id:0` The + * start index must always be less than or equal to the end index. If the + * start index equals the end index, then the range is empty. Empty ranges are + * typically not meaningful and are usually rendered in the UI as `#REF!`. + */ + export interface Schema$GridRange { + /** + * The end column (exclusive) of the range, or not set if unbounded. + */ + endColumnIndex: number; + /** + * The end row (exclusive) of the range, or not set if unbounded. + */ + endRowIndex: number; + /** + * The sheet this range is on. + */ + sheetId: number; + /** + * The start column (inclusive) of the range, or not set if unbounded. + */ + startColumnIndex: number; + /** + * The start row (inclusive) of the range, or not set if unbounded. + */ + startRowIndex: number; + } /** - * The style of the border. - */ - style: string; + * A <a + * href="/chart/interactive/docs/gallery/histogram">histogram + * chart</a>. A histogram chart groups data items into bins, displaying + * each bin as a column of stacked items. Histograms are used to display the + * distribution of a dataset. Each column of items represents a range into + * which those items fall. The number of bins can be chosen automatically or + * specified explicitly. + */ + export interface Schema$HistogramChartSpec { + /** + * By default the bucket size (the range of values stacked in a single + * column) is chosen automatically, but it may be overridden here. E.g., A + * bucket size of 1.5 results in buckets from 0 - 1.5, 1.5 - 3.0, etc. + * Cannot be negative. This field is optional. + */ + bucketSize: number; + /** + * The position of the chart legend. + */ + legendPosition: string; + /** + * The outlier percentile is used to ensure that outliers do not adversely + * affect the calculation of bucket sizes. For example, setting an outlier + * percentile of 0.05 indicates that the top and bottom 5% of values when + * calculating buckets. The values are still included in the chart, they + * will be added to the first or last buckets instead of their own buckets. + * Must be between 0.0 and 0.5. + */ + outlierPercentile: number; + /** + * The series for a histogram may be either a single series of values to be + * bucketed or multiple series, each of the same length, containing the name + * of the series followed by the values to be bucketed for that series. + */ + series: Schema$HistogramSeries[]; + /** + * Whether horizontal divider lines should be displayed between items in + * each column. + */ + showItemDividers: boolean; + } /** - * The width of the border, in pixels. Deprecated; the width is determined by - * the "style" field. - */ - width: number; -} -/** - * The borders of the cell. - */ -export interface Schema$Borders { + * Allows you to organize the numeric values in a source data column into + * buckets of a constant size. All values from HistogramRule.start to + * HistogramRule.end will be placed into groups of size + * HistogramRule.interval. In addition, all values below HistogramRule.start + * will be placed in one group, and all values above HistogramRule.end will be + * placed in another. Only HistogramRule.interval is required, though if + * HistogramRule.start and HistogramRule.end are both provided, + * HistogramRule.start must be less than HistogramRule.end. For example, a + * pivot table showing average purchase amount by age that has 50+ rows: + * +-----+-------------------+ | Age | AVERAGE of Amount | + * +-----+-------------------+ | 16 | $27.13 | | 17 | + * $5.24 | | 18 | $20.15 | ... +-----+-------------------+ + * could be turned into a pivot table that looks like the one below by + * applying a histogram group rule with a HistogramRule.start of 25, an + * HistogramRule.interval of 20, and an HistogramRule.end of 65. + * +-------------+-------------------+ | Grouped Age | AVERAGE of Amount | + * +-------------+-------------------+ | < 25 | $19.34 | | + * 25-45 | $31.43 | | 45-65 | $35.87 | + * | > 65 | $27.55 | +-------------+-------------------+ + * | Grand Total | $29.12 | +-------------+-------------------+ + */ + export interface Schema$HistogramRule { + /** + * The maximum value at which items will be placed into buckets of constant + * size. Values above end will be lumped into a single bucket. This field is + * optional. + */ + end: number; + /** + * The size of the buckets that will be created. Must be positive. + */ + interval: number; + /** + * The minimum value at which items will be placed into buckets of constant + * size. Values below start will be lumped into a single bucket. This field + * is optional. + */ + start: number; + } /** - * The bottom border of the cell. - */ - bottom: Schema$Border; + * A histogram series containing the series color and data. + */ + export interface Schema$HistogramSeries { + /** + * The color of the column representing this series in each bucket. This + * field is optional. + */ + barColor: Schema$Color; + /** + * The data for this histogram series. + */ + data: Schema$ChartData; + } /** - * The left border of the cell. - */ - left: Schema$Border; + * Inserts rows or columns in a sheet at a particular index. + */ + export interface Schema$InsertDimensionRequest { + /** + * Whether dimension properties should be extended from the dimensions + * before or after the newly inserted dimensions. True to inherit from the + * dimensions before (in which case the start index must be greater than 0), + * and false to inherit from the dimensions after. For example, if row + * index 0 has red background and row index 1 has a green background, then + * inserting 2 rows at index 1 can inherit either the green or red + * background. If `inheritFromBefore` is true, the two new rows will be red + * (because the row before the insertion point was red), whereas if + * `inheritFromBefore` is false, the two new rows will be green (because the + * row after the insertion point was green). + */ + inheritFromBefore: boolean; + /** + * The dimensions to insert. Both the start and end indexes must be + * bounded. + */ + range: Schema$DimensionRange; + } /** - * The right border of the cell. - */ - right: Schema$Border; + * Inserts cells into a range, shifting the existing cells over or down. + */ + export interface Schema$InsertRangeRequest { + /** + * The range to insert new cells into. + */ + range: Schema$GridRange; + /** + * The dimension which will be shifted when inserting cells. If ROWS, + * existing cells will be shifted down. If COLUMNS, existing cells will be + * shifted right. + */ + shiftDimension: string; + } /** - * The top border of the cell. - */ - top: Schema$Border; -} -/** - * A <a - * href="/chart/interactive/docs/gallery/bubblechart">bubble - * chart</a>. - */ -export interface Schema$BubbleChartSpec { + * A single interpolation point on a gradient conditional format. These pin + * the gradient color scale according to the color, type and value chosen. + */ + export interface Schema$InterpolationPoint { + /** + * The color this interpolation point should use. + */ + color: Schema$Color; + /** + * How the value should be interpreted. + */ + type: string; + /** + * The value this interpolation point uses. May be a formula. Unused if + * type is MIN or MAX. + */ + value: string; + } /** - * The bubble border color. - */ - bubbleBorderColor: Schema$Color; + * Settings to control how circular dependencies are resolved with iterative + * calculation. + */ + export interface Schema$IterativeCalculationSettings { + /** + * When iterative calculation is enabled and successive results differ by + * less than this threshold value, the calculation rounds stop. + */ + convergenceThreshold: number; + /** + * When iterative calculation is enabled, the maximum number of calculation + * rounds to perform. + */ + maxIterations: number; + } /** - * The data containing the bubble labels. These do not need to be unique. - */ - bubbleLabels: Schema$ChartData; + * Properties that describe the style of a line. + */ + export interface Schema$LineStyle { + /** + * The dash type of the line. + */ + type: string; + /** + * The thickness of the line, in px. + */ + width: number; + } /** - * The max radius size of the bubbles, in pixels. If specified, the field must - * be a positive value. - */ - bubbleMaxRadiusSize: number; + * Allows you to manually organize the values in a source data column into + * buckets with names of your choosing. For example, a pivot table that + * aggregates population by state: +-------+-------------------+ | + * State | SUM of Population | +-------+-------------------+ | AK | + * 0.7 | | AL | 4.8 | | AR | 2.9 | + * ... +-------+-------------------+ could be turned into a pivot table + * that aggregates population by time zone by providing a list of groups (e.g. + * groupName = 'Central', items = ['AL', 'AR', + * 'IA', ...]) to a manual group rule. Note that a similar effect + * could be achieved by adding a time zone column to the source data and + * adjusting the pivot table. +-----------+-------------------+ | + * Time Zone | SUM of Population | +-----------+-------------------+ | + * Central | 106.3 | | Eastern | 151.9 | | + * Mountain | 17.4 | ... +-----------+-------------------+ + */ + export interface Schema$ManualRule { + /** + * The list of group names and the corresponding items from the source data + * that map to each group name. + */ + groups: Schema$ManualRuleGroup[]; + } /** - * The minimum radius size of the bubbles, in pixels. If specific, the field - * must be a positive value. - */ - bubbleMinRadiusSize: number; + * A group name and a list of items from the source data that should be placed + * in the group with this name. + */ + export interface Schema$ManualRuleGroup { + /** + * The group name, which must be a string. Each group in a given ManualRule + * must have a unique group name. + */ + groupName: Schema$ExtendedValue; + /** + * The items in the source data that should be placed into this group. Each + * item may be a string, number, or boolean. Items may appear in at most one + * group within a given ManualRule. Items that do not appear in any group + * will appear on their own. + */ + items: Schema$ExtendedValue[]; + } /** - * The opacity of the bubbles between 0 and 1.0. 0 is fully transparent and 1 - * is fully opaque. - */ - bubbleOpacity: number; + * A developer metadata entry and the data filters specified in the original + * request that matched it. + */ + export interface Schema$MatchedDeveloperMetadata { + /** + * All filters matching the returned developer metadata. + */ + dataFilters: Schema$DataFilter[]; + /** + * The developer metadata matching the specified filters. + */ + developerMetadata: Schema$DeveloperMetadata; + } /** - * The data contianing the bubble sizes. Bubble sizes are used to draw the - * bubbles at different sizes relative to each other. If specified, group_ids - * must also be specified. This field is optional. - */ - bubbleSizes: Schema$ChartData; + * A value range that was matched by one or more data filers. + */ + export interface Schema$MatchedValueRange { + /** + * The DataFilters from the request that matched the range of values. + */ + dataFilters: Schema$DataFilter[]; + /** + * The values matched by the DataFilter. + */ + valueRange: Schema$ValueRange; + } /** - * The format of the text inside the bubbles. Underline and Strikethrough are - * not supported. - */ - bubbleTextStyle: Schema$TextFormat; + * Merges all cells in the range. + */ + export interface Schema$MergeCellsRequest { + /** + * How the cells should be merged. + */ + mergeType: string; + /** + * The range of cells to merge. + */ + range: Schema$GridRange; + } /** - * The data containing the bubble x-values. These values locate the bubbles - * in the chart horizontally. - */ - domain: Schema$ChartData; + * Moves one or more rows or columns. + */ + export interface Schema$MoveDimensionRequest { + /** + * The zero-based start index of where to move the source data to, based on + * the coordinates *before* the source data is removed from the grid. + * Existing data will be shifted down or right (depending on the dimension) + * to make room for the moved dimensions. The source dimensions are removed + * from the grid, so the the data may end up in a different index than + * specified. For example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to + * move `"1"` and `"2"` to between `"3"` and + * `"4"`, the source would be `ROWS [1..3)`,and the destination + * index would be `"4"` (the zero-based index of row 5). The end + * result would be `A1..A5` of `0, 3, 1, 2, 4`. + */ + destinationIndex: number; + /** + * The source dimensions to move. + */ + source: Schema$DimensionRange; + } /** - * The data containing the bubble group IDs. All bubbles with the same group - * ID will be drawn in the same color. If bubble_sizes is specified then this - * field must also be specified but may contain blank values. This field is - * optional. - */ - groupIds: Schema$ChartData; + * A named range. + */ + export interface Schema$NamedRange { + /** + * The name of the named range. + */ + name: string; + /** + * The ID of the named range. + */ + namedRangeId: string; + /** + * The range this represents. + */ + range: Schema$GridRange; + } /** - * Where the legend of the chart should be drawn. - */ - legendPosition: string; + * The number format of a cell. + */ + export interface Schema$NumberFormat { + /** + * Pattern string used for formatting. If not set, a default pattern based + * on the user's locale will be used if necessary for the given type. + * See the [Date and Number Formats guide](/sheets/api/guides/formats) for + * more information about the supported patterns. + */ + pattern: string; + /** + * The type of the number format. When writing, this field must be set. + */ + type: string; + } /** - * The data contianing the bubble y-values. These values locate the bubbles - * in the chart vertically. - */ - series: Schema$ChartData; -} -/** - * A <a - * href="/chart/interactive/docs/gallery/candlestickchart">candlestick - * chart</a>. - */ -export interface Schema$CandlestickChartSpec { + * An <a href="/chart/interactive/docs/gallery/orgchart">org + * chart</a>. Org charts require a unique set of labels in labels and + * may optionally include parent_labels and tooltips. parent_labels contain, + * for each node, the label identifying the parent node. tooltips contain, + * for each node, an optional tooltip. For example, to describe an OrgChart + * with Alice as the CEO, Bob as the President (reporting to Alice) and Cathy + * as VP of Sales (also reporting to Alice), have labels contain + * "Alice", "Bob", "Cathy", parent_labels + * contain "", "Alice", "Alice" and tooltips + * contain "CEO", "President", "VP Sales". + */ + export interface Schema$OrgChartSpec { + /** + * The data containing the labels for all the nodes in the chart. Labels + * must be unique. + */ + labels: Schema$ChartData; + /** + * The color of the org chart nodes. + */ + nodeColor: Schema$Color; + /** + * The size of the org chart nodes. + */ + nodeSize: string; + /** + * The data containing the label of the parent for the corresponding node. A + * blank value indicates that the node has no parent and is a top-level + * node. This field is optional. + */ + parentLabels: Schema$ChartData; + /** + * The color of the selected org chart nodes. + */ + selectedNodeColor: Schema$Color; + /** + * The data containing the tooltip for the corresponding node. A blank + * value results in no tooltip being displayed for the node. This field is + * optional. + */ + tooltips: Schema$ChartData; + } /** - * The Candlestick chart data. Only one CandlestickData is supported. - */ - data: Schema$CandlestickData[]; + * The location an object is overlaid on top of a grid. + */ + export interface Schema$OverlayPosition { + /** + * The cell the object is anchored to. + */ + anchorCell: Schema$GridCoordinate; + /** + * The height of the object, in pixels. Defaults to 371. + */ + heightPixels: number; + /** + * The horizontal offset, in pixels, that the object is offset from the + * anchor cell. + */ + offsetXPixels: number; + /** + * The vertical offset, in pixels, that the object is offset from the anchor + * cell. + */ + offsetYPixels: number; + /** + * The width of the object, in pixels. Defaults to 600. + */ + widthPixels: number; + } /** - * The domain data (horizontal axis) for the candlestick chart. String data - * will be treated as discrete labels, other data will be treated as - * continuous values. - */ - domain: Schema$CandlestickDomain; -} -/** - * The Candlestick chart data, each containing the low, open, close, and high - * values for a series. - */ -export interface Schema$CandlestickData { + * The amount of padding around the cell, in pixels. When updating padding, + * every field must be specified. + */ + export interface Schema$Padding { + /** + * The bottom padding of the cell. + */ + bottom: number; + /** + * The left padding of the cell. + */ + left: number; + /** + * The right padding of the cell. + */ + right: number; + /** + * The top padding of the cell. + */ + top: number; + } /** - * The range data (vertical axis) for the close/final value for each candle. - * This is the top of the candle body. If greater than the open value the - * candle will be filled. Otherwise the candle will be hollow. - */ - closeSeries: Schema$CandlestickSeries; + * Inserts data into the spreadsheet starting at the specified coordinate. + */ + export interface Schema$PasteDataRequest { + /** + * The coordinate at which the data should start being inserted. + */ + coordinate: Schema$GridCoordinate; + /** + * The data to insert. + */ + data: string; + /** + * The delimiter in the data. + */ + delimiter: string; + /** + * True if the data is HTML. + */ + html: boolean; + /** + * How the data should be pasted. + */ + type: string; + } /** - * The range data (vertical axis) for the high/maximum value for each candle. - * This is the top of the candle's center line. - */ - highSeries: Schema$CandlestickSeries; + * A <a href="/chart/interactive/docs/gallery/piechart">pie + * chart</a>. + */ + export interface Schema$PieChartSpec { + /** + * The data that covers the domain of the pie chart. + */ + domain: Schema$ChartData; + /** + * Where the legend of the pie chart should be drawn. + */ + legendPosition: string; + /** + * The size of the hole in the pie chart. + */ + pieHole: number; + /** + * The data that covers the one and only series of the pie chart. + */ + series: Schema$ChartData; + /** + * True if the pie is three dimensional. + */ + threeDimensional: boolean; + } /** - * The range data (vertical axis) for the low/minimum value for each candle. - * This is the bottom of the candle's center line. + * Criteria for showing/hiding rows in a pivot table. */ - lowSeries: Schema$CandlestickSeries; + export interface Schema$PivotFilterCriteria { + /** + * Values that should be included. Values not listed here are excluded. + */ + visibleValues: string[]; + } /** - * The range data (vertical axis) for the open/initial value for each candle. - * This is the bottom of the candle body. If less than the close value the - * candle will be filled. Otherwise the candle will be hollow. - */ - openSeries: Schema$CandlestickSeries; -} -/** - * The domain of a CandlestickChart. - */ -export interface Schema$CandlestickDomain { + * A single grouping (either row or column) in a pivot table. + */ + export interface Schema$PivotGroup { + /** + * The group rule to apply to this row/column group. + */ + groupRule: Schema$PivotGroupRule; + /** + * The labels to use for the row/column groups which can be customized. For + * example, in the following pivot table, the row label is `Region` (which + * could be renamed to `State`) and the column label is `Product` (which + * could be renamed `Item`). Pivot tables created before December 2017 do + * not have header labels. If you'd like to add header labels to an + * existing pivot table, please delete the existing pivot table and then + * create a new pivot table with same parameters. + * +--------------+---------+-------+ | SUM of Units | Product | | + * | Region | Pen | Paper | +--------------+---------+-------+ + * | New York | 345 | 98 | | Oregon | 234 | 123 | + * | Tennessee | 531 | 415 | +--------------+---------+-------+ + * | Grand Total | 1110 | 636 | +--------------+---------+-------+ + */ + label: string; + /** + * True if the headings in this pivot group should be repeated. This is only + * valid for row groupings and will be ignored by columns. By default, we + * minimize repitition of headings by not showing higher level headings + * where they are the same. For example, even though the third row below + * corresponds to "Q1 Mar", "Q1" is not shown because it + * is redundant with previous rows. Setting repeat_headings to true would + * cause "Q1" to be repeated for "Feb" and + * "Mar". +--------------+ | Q1 | Jan | | | Feb | + * | | Mar | +--------+-----+ | Q1 Total | + * +--------------+ + */ + repeatHeadings: boolean; + /** + * True if the pivot table should include the totals for this grouping. + */ + showTotals: boolean; + /** + * The order the values in this group should be sorted. + */ + sortOrder: string; + /** + * The column offset of the source range that this grouping is based on. For + * example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means + * this group refers to column `C`, whereas the offset `1` would refer to + * column `D`. + */ + sourceColumnOffset: number; + /** + * The bucket of the opposite pivot group to sort by. If not specified, + * sorting is alphabetical by this group's values. + */ + valueBucket: Schema$PivotGroupSortValueBucket; + /** + * Metadata about values in the grouping. + */ + valueMetadata: Schema$PivotGroupValueMetadata[]; + } /** - * The data of the CandlestickDomain. - */ - data: Schema$ChartData; + * An optional setting on a PivotGroup that defines buckets for the values in + * the source data column rather than breaking out each individual value. Only + * one PivotGroup with a group rule may be added for each column in the source + * data, though on any given column you may add both a PivotGroup that has a + * rule and a PivotGroup that does not. + */ + export interface Schema$PivotGroupRule { + /** + * A HistogramRule. + */ + histogramRule: Schema$HistogramRule; + /** + * A ManualRule. + */ + manualRule: Schema$ManualRule; + } /** - * True to reverse the order of the domain values (horizontal axis). - */ - reversed: boolean; -} -/** - * The series of a CandlestickData. - */ -export interface Schema$CandlestickSeries { + * Information about which values in a pivot group should be used for sorting. + */ + export interface Schema$PivotGroupSortValueBucket { + /** + * Determines the bucket from which values are chosen to sort. For example, + * in a pivot table with one row group & two column groups, the row + * group can list up to two values. The first value corresponds to a value + * within the first column group, and the second value corresponds to a + * value in the second column group. If no values are listed, this would + * indicate that the row should be sorted according to the "Grand + * Total" over the column groups. If a single value is listed, this + * would correspond to using the "Total" of that bucket. + */ + buckets: Schema$ExtendedValue[]; + /** + * The offset in the PivotTable.values list which the values in this + * grouping should be sorted by. + */ + valuesIndex: number; + } /** - * The data of the CandlestickSeries. - */ - data: Schema$ChartData; -} -/** - * Data about a specific cell. - */ -export interface Schema$CellData { + * Metadata about a value in a pivot grouping. + */ + export interface Schema$PivotGroupValueMetadata { + /** + * True if the data corresponding to the value is collapsed. + */ + collapsed: boolean; + /** + * The calculated value the metadata corresponds to. (Note that formulaValue + * is not valid, because the values will be calculated.) + */ + value: Schema$ExtendedValue; + } /** - * A data validation rule on the cell, if any. When writing, the new data - * validation rule will overwrite any prior rule. - */ - dataValidation: Schema$DataValidationRule; + * A pivot table. + */ + export interface Schema$PivotTable { + /** + * Each column grouping in the pivot table. + */ + columns: Schema$PivotGroup[]; + /** + * An optional mapping of filters per source column offset. The filters + * will be applied before aggregating data into the pivot table. The + * map's key is the column offset of the source range that you want to + * filter, and the value is the criteria for that column. For example, if + * the source was `C10:E15`, a key of `0` will have the filter for column + * `C`, whereas the key `1` is for column `D`. + */ + criteria: any; + /** + * Each row grouping in the pivot table. + */ + rows: Schema$PivotGroup[]; + /** + * The range the pivot table is reading data from. + */ + source: Schema$GridRange; + /** + * Whether values should be listed horizontally (as columns) or vertically + * (as rows). + */ + valueLayout: string; + /** + * A list of values to include in the pivot table. + */ + values: Schema$PivotValue[]; + } /** - * The effective format being used by the cell. This includes the results of - * applying any conditional formatting and, if the cell contains a formula, - * the computed number format. If the effective format is the default format, - * effective format will not be written. This field is read-only. - */ - effectiveFormat: Schema$CellFormat; + * The definition of how a value in a pivot table should be calculated. + */ + export interface Schema$PivotValue { + /** + * If specified, indicates that pivot values should be displayed as the + * result of a calculation with another pivot value. For example, if + * calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the + * pivot values will be displayed as the percentage of the grand total. In + * the Sheets UI, this is referred to as "Show As" in the value + * section of a pivot table. + */ + calculatedDisplayType: string; + /** + * A custom formula to calculate the value. The formula must start with an + * `=` character. + */ + formula: string; + /** + * A name to use for the value. + */ + name: string; + /** + * The column offset of the source range that this value reads from. For + * example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means + * this value refers to column `C`, whereas the offset `1` would refer to + * column `D`. + */ + sourceColumnOffset: number; + /** + * A function to summarize the value. If formula is set, the only supported + * values are SUM and CUSTOM. If sourceColumnOffset is set, then `CUSTOM` is + * not supported. + */ + summarizeFunction: string; + } /** - * The effective value of the cell. For cells with formulas, this will be the - * calculated value. For cells with literals, this will be the same as the - * user_entered_value. This field is read-only. - */ - effectiveValue: Schema$ExtendedValue; + * A protected range. + */ + export interface Schema$ProtectedRange { + /** + * The description of this protected range. + */ + description: string; + /** + * The users and groups with edit access to the protected range. This field + * is only visible to users with edit access to the protected range and the + * document. Editors are not supported with warning_only protection. + */ + editors: Schema$Editors; + /** + * The named range this protected range is backed by, if any. When writing, + * only one of range or named_range_id may be set. + */ + namedRangeId: string; + /** + * The ID of the protected range. This field is read-only. + */ + protectedRangeId: number; + /** + * The range that is being protected. The range may be fully unbounded, in + * which case this is considered a protected sheet. When writing, only one + * of range or named_range_id may be set. + */ + range: Schema$GridRange; + /** + * True if the user who requested this protected range can edit the + * protected area. This field is read-only. + */ + requestingUserCanEdit: boolean; + /** + * The list of unprotected ranges within a protected sheet. Unprotected + * ranges are only supported on protected sheets. + */ + unprotectedRanges: Schema$GridRange[]; + /** + * True if this protected range will show a warning when editing. + * Warning-based protection means that every user can edit data in the + * protected range, except editing will prompt a warning asking the user to + * confirm the edit. When writing: if this field is true, then editors is + * ignored. Additionally, if this field is changed from true to false and + * the `editors` field is not set (nor included in the field mask), then the + * editors will be set to all the editors in the document. + */ + warningOnly: boolean; + } /** - * The formatted value of the cell. This is the value as it's shown to the - * user. This field is read-only. + * Randomizes the order of the rows in a range. */ - formattedValue: string; + export interface Schema$RandomizeRangeRequest { + /** + * The range to randomize. + */ + range: Schema$GridRange; + } /** - * A hyperlink this cell points to, if any. This field is read-only. (To set - * it, use a `=HYPERLINK` formula in the userEnteredValue.formulaValue field.) - */ - hyperlink: string; + * Updates all cells in the range to the values in the given Cell object. Only + * the fields listed in the fields field are updated; others are unchanged. If + * writing a cell with a formula, the formula's ranges will automatically + * increment for each field in the range. For example, if writing a cell with + * formula `=A1` into range B2:C4, B2 would be `=A1`, B3 would be `=A2`, B4 + * would be `=A3`, C2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`. To + * keep the formula's ranges static, use the `$` indicator. For example, + * use the formula `=$A$1` to prevent both the row and the column from + * incrementing. + */ + export interface Schema$RepeatCellRequest { + /** + * The data to write. + */ + cell: Schema$CellData; + /** + * The fields that should be updated. At least one field must be specified. + * The root `cell` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The range to repeat the cell in. + */ + range: Schema$GridRange; + } /** - * Any note on the cell. - */ - note: string; + * A single kind of update to apply to a spreadsheet. + */ + export interface Schema$Request { + /** + * Adds a new banded range + */ + addBanding: Schema$AddBandingRequest; + /** + * Adds a chart. + */ + addChart: Schema$AddChartRequest; + /** + * Adds a new conditional format rule. + */ + addConditionalFormatRule: Schema$AddConditionalFormatRuleRequest; + /** + * Adds a filter view. + */ + addFilterView: Schema$AddFilterViewRequest; + /** + * Adds a named range. + */ + addNamedRange: Schema$AddNamedRangeRequest; + /** + * Adds a protected range. + */ + addProtectedRange: Schema$AddProtectedRangeRequest; + /** + * Adds a sheet. + */ + addSheet: Schema$AddSheetRequest; + /** + * Appends cells after the last row with data in a sheet. + */ + appendCells: Schema$AppendCellsRequest; + /** + * Appends dimensions to the end of a sheet. + */ + appendDimension: Schema$AppendDimensionRequest; + /** + * Automatically fills in more data based on existing data. + */ + autoFill: Schema$AutoFillRequest; + /** + * Automatically resizes one or more dimensions based on the contents of the + * cells in that dimension. + */ + autoResizeDimensions: Schema$AutoResizeDimensionsRequest; + /** + * Clears the basic filter on a sheet. + */ + clearBasicFilter: Schema$ClearBasicFilterRequest; + /** + * Copies data from one area and pastes it to another. + */ + copyPaste: Schema$CopyPasteRequest; + /** + * Creates new developer metadata + */ + createDeveloperMetadata: Schema$CreateDeveloperMetadataRequest; + /** + * Cuts data from one area and pastes it to another. + */ + cutPaste: Schema$CutPasteRequest; + /** + * Removes a banded range + */ + deleteBanding: Schema$DeleteBandingRequest; + /** + * Deletes an existing conditional format rule. + */ + deleteConditionalFormatRule: Schema$DeleteConditionalFormatRuleRequest; + /** + * Deletes developer metadata + */ + deleteDeveloperMetadata: Schema$DeleteDeveloperMetadataRequest; + /** + * Deletes rows or columns in a sheet. + */ + deleteDimension: Schema$DeleteDimensionRequest; + /** + * Deletes an embedded object (e.g, chart, image) in a sheet. + */ + deleteEmbeddedObject: Schema$DeleteEmbeddedObjectRequest; + /** + * Deletes a filter view from a sheet. + */ + deleteFilterView: Schema$DeleteFilterViewRequest; + /** + * Deletes a named range. + */ + deleteNamedRange: Schema$DeleteNamedRangeRequest; + /** + * Deletes a protected range. + */ + deleteProtectedRange: Schema$DeleteProtectedRangeRequest; + /** + * Deletes a range of cells from a sheet, shifting the remaining cells. + */ + deleteRange: Schema$DeleteRangeRequest; + /** + * Deletes a sheet. + */ + deleteSheet: Schema$DeleteSheetRequest; + /** + * Duplicates a filter view. + */ + duplicateFilterView: Schema$DuplicateFilterViewRequest; + /** + * Duplicates a sheet. + */ + duplicateSheet: Schema$DuplicateSheetRequest; + /** + * Finds and replaces occurrences of some text with other text. + */ + findReplace: Schema$FindReplaceRequest; + /** + * Inserts new rows or columns in a sheet. + */ + insertDimension: Schema$InsertDimensionRequest; + /** + * Inserts new cells in a sheet, shifting the existing cells. + */ + insertRange: Schema$InsertRangeRequest; + /** + * Merges cells together. + */ + mergeCells: Schema$MergeCellsRequest; + /** + * Moves rows or columns to another location in a sheet. + */ + moveDimension: Schema$MoveDimensionRequest; + /** + * Pastes data (HTML or delimited) into a sheet. + */ + pasteData: Schema$PasteDataRequest; + /** + * Randomizes the order of the rows in a range. + */ + randomizeRange: Schema$RandomizeRangeRequest; + /** + * Repeats a single cell across a range. + */ + repeatCell: Schema$RepeatCellRequest; + /** + * Sets the basic filter on a sheet. + */ + setBasicFilter: Schema$SetBasicFilterRequest; + /** + * Sets data validation for one or more cells. + */ + setDataValidation: Schema$SetDataValidationRequest; + /** + * Sorts data in a range. + */ + sortRange: Schema$SortRangeRequest; + /** + * Converts a column of text into many columns of text. + */ + textToColumns: Schema$TextToColumnsRequest; + /** + * Unmerges merged cells. + */ + unmergeCells: Schema$UnmergeCellsRequest; + /** + * Updates a banded range + */ + updateBanding: Schema$UpdateBandingRequest; + /** + * Updates the borders in a range of cells. + */ + updateBorders: Schema$UpdateBordersRequest; + /** + * Updates many cells at once. + */ + updateCells: Schema$UpdateCellsRequest; + /** + * Updates a chart's specifications. + */ + updateChartSpec: Schema$UpdateChartSpecRequest; + /** + * Updates an existing conditional format rule. + */ + updateConditionalFormatRule: Schema$UpdateConditionalFormatRuleRequest; + /** + * Updates an existing developer metadata entry + */ + updateDeveloperMetadata: Schema$UpdateDeveloperMetadataRequest; + /** + * Updates dimensions' properties. + */ + updateDimensionProperties: Schema$UpdateDimensionPropertiesRequest; + /** + * Updates an embedded object's (e.g. chart, image) position. + */ + updateEmbeddedObjectPosition: Schema$UpdateEmbeddedObjectPositionRequest; + /** + * Updates the properties of a filter view. + */ + updateFilterView: Schema$UpdateFilterViewRequest; + /** + * Updates a named range. + */ + updateNamedRange: Schema$UpdateNamedRangeRequest; + /** + * Updates a protected range. + */ + updateProtectedRange: Schema$UpdateProtectedRangeRequest; + /** + * Updates a sheet's properties. + */ + updateSheetProperties: Schema$UpdateSheetPropertiesRequest; + /** + * Updates the spreadsheet's properties. + */ + updateSpreadsheetProperties: Schema$UpdateSpreadsheetPropertiesRequest; + } /** - * A pivot table anchored at this cell. The size of pivot table itself is - * computed dynamically based on its data, grouping, filters, values, etc. - * Only the top-left cell of the pivot table contains the pivot table - * definition. The other cells will contain the calculated values of the - * results of the pivot in their effective_value fields. - */ - pivotTable: Schema$PivotTable; + * A single response from an update. + */ + export interface Schema$Response { + /** + * A reply from adding a banded range. + */ + addBanding: Schema$AddBandingResponse; + /** + * A reply from adding a chart. + */ + addChart: Schema$AddChartResponse; + /** + * A reply from adding a filter view. + */ + addFilterView: Schema$AddFilterViewResponse; + /** + * A reply from adding a named range. + */ + addNamedRange: Schema$AddNamedRangeResponse; + /** + * A reply from adding a protected range. + */ + addProtectedRange: Schema$AddProtectedRangeResponse; + /** + * A reply from adding a sheet. + */ + addSheet: Schema$AddSheetResponse; + /** + * A reply from creating a developer metadata entry. + */ + createDeveloperMetadata: Schema$CreateDeveloperMetadataResponse; + /** + * A reply from deleting a conditional format rule. + */ + deleteConditionalFormatRule: Schema$DeleteConditionalFormatRuleResponse; + /** + * A reply from deleting a developer metadata entry. + */ + deleteDeveloperMetadata: Schema$DeleteDeveloperMetadataResponse; + /** + * A reply from duplicating a filter view. + */ + duplicateFilterView: Schema$DuplicateFilterViewResponse; + /** + * A reply from duplicating a sheet. + */ + duplicateSheet: Schema$DuplicateSheetResponse; + /** + * A reply from doing a find/replace. + */ + findReplace: Schema$FindReplaceResponse; + /** + * A reply from updating a conditional format rule. + */ + updateConditionalFormatRule: Schema$UpdateConditionalFormatRuleResponse; + /** + * A reply from updating a developer metadata entry. + */ + updateDeveloperMetadata: Schema$UpdateDeveloperMetadataResponse; + /** + * A reply from updating an embedded object's position. + */ + updateEmbeddedObjectPosition: Schema$UpdateEmbeddedObjectPositionResponse; + } /** - * Runs of rich text applied to subsections of the cell. Runs are only valid - * on user entered strings, not formulas, bools, or numbers. Runs start at - * specific indexes in the text and continue until the next run. Properties of - * a run will continue unless explicitly changed in a subsequent run (and - * properties of the first run will continue the properties of the cell unless - * explicitly changed). When writing, the new runs will overwrite any prior - * runs. When writing a new user_entered_value, previous runs will be erased. + * Data about each cell in a row. */ - textFormatRuns: Schema$TextFormatRun[]; + export interface Schema$RowData { + /** + * The values in the row, one per column. + */ + values: Schema$CellData[]; + } /** - * The format the user entered for the cell. When writing, the new format - * will be merged with the existing format. + * A request to retrieve all developer metadata matching the set of specified + * criteria. */ - userEnteredFormat: Schema$CellFormat; + export interface Schema$SearchDeveloperMetadataRequest { + /** + * The data filters describing the criteria used to determine which + * DeveloperMetadata entries to return. DeveloperMetadata matching any of + * the specified filters will be included in the response. + */ + dataFilters: Schema$DataFilter[]; + } /** - * The value the user entered in the cell. e.g, `1234`, `'Hello'`, or - * `=NOW()` Note: Dates, Times and DateTimes are represented as doubles in - * serial number format. + * A reply to a developer metadata search request. */ - userEnteredValue: Schema$ExtendedValue; -} -/** - * The format of a cell. - */ -export interface Schema$CellFormat { + export interface Schema$SearchDeveloperMetadataResponse { + /** + * The metadata matching the criteria of the search request. + */ + matchedDeveloperMetadata: Schema$MatchedDeveloperMetadata[]; + } /** - * The background color of the cell. + * Sets the basic filter associated with a sheet. */ - backgroundColor: Schema$Color; + export interface Schema$SetBasicFilterRequest { + /** + * The filter to set. + */ + filter: Schema$BasicFilter; + } /** - * The borders of the cell. - */ - borders: Schema$Borders; + * Sets a data validation rule to every cell in the range. To clear validation + * in a range, call this with no rule specified. + */ + export interface Schema$SetDataValidationRequest { + /** + * The range the data validation rule should apply to. + */ + range: Schema$GridRange; + /** + * The data validation rule to set on each cell in the range, or empty to + * clear the data validation in the range. + */ + rule: Schema$DataValidationRule; + } /** - * The horizontal alignment of the value in the cell. - */ - horizontalAlignment: string; + * A sheet in a spreadsheet. + */ + export interface Schema$Sheet { + /** + * The banded (i.e. alternating colors) ranges on this sheet. + */ + bandedRanges: Schema$BandedRange[]; + /** + * The filter on this sheet, if any. + */ + basicFilter: Schema$BasicFilter; + /** + * The specifications of every chart on this sheet. + */ + charts: Schema$EmbeddedChart[]; + /** + * The conditional format rules in this sheet. + */ + conditionalFormats: Schema$ConditionalFormatRule[]; + /** + * Data in the grid, if this is a grid sheet. The number of GridData objects + * returned is dependent on the number of ranges requested on this sheet. + * For example, if this is representing `Sheet1`, and the spreadsheet was + * requested with ranges `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the + * first GridData will have a startRow/startColumn of `0`, while the second + * one will have `startRow 14` (zero-based row 15), and `startColumn 3` + * (zero-based column D). + */ + data: Schema$GridData[]; + /** + * The developer metadata associated with a sheet. + */ + developerMetadata: Schema$DeveloperMetadata[]; + /** + * The filter views in this sheet. + */ + filterViews: Schema$FilterView[]; + /** + * The ranges that are merged together. + */ + merges: Schema$GridRange[]; + /** + * The properties of the sheet. + */ + properties: Schema$SheetProperties; + /** + * The protected ranges in this sheet. + */ + protectedRanges: Schema$ProtectedRange[]; + } /** - * How a hyperlink, if it exists, should be displayed in the cell. - */ - hyperlinkDisplayType: string; + * Properties of a sheet. + */ + export interface Schema$SheetProperties { + /** + * Additional properties of the sheet if this sheet is a grid. (If the sheet + * is an object sheet, containing a chart or image, then this field will be + * absent.) When writing it is an error to set any grid properties on + * non-grid sheets. + */ + gridProperties: Schema$GridProperties; + /** + * True if the sheet is hidden in the UI, false if it's visible. + */ + hidden: boolean; + /** + * The index of the sheet within the spreadsheet. When adding or updating + * sheet properties, if this field is excluded then the sheet will be added + * or moved to the end of the sheet list. When updating sheet indices or + * inserting sheets, movement is considered in "before the move" + * indexes. For example, if there were 3 sheets (S1, S2, S3) in order to + * move S1 ahead of S2 the index would have to be set to 2. A sheet index + * update request will be ignored if the requested index is identical to the + * sheets current index or if the requested new index is equal to the + * current sheet index + 1. + */ + index: number; + /** + * True if the sheet is an RTL sheet instead of an LTR sheet. + */ + rightToLeft: boolean; + /** + * The ID of the sheet. Must be non-negative. This field cannot be changed + * once set. + */ + sheetId: number; + /** + * The type of sheet. Defaults to GRID. This field cannot be changed once + * set. + */ + sheetType: string; + /** + * The color of the tab in the UI. + */ + tabColor: Schema$Color; + /** + * The name of the sheet. + */ + title: string; + } /** - * A format describing how number values should be represented to the user. - */ - numberFormat: Schema$NumberFormat; + * Sorts data in rows based on a sort order per column. + */ + export interface Schema$SortRangeRequest { + /** + * The range to sort. + */ + range: Schema$GridRange; + /** + * The sort order per column. Later specifications are used when values are + * equal in the earlier specifications. + */ + sortSpecs: Schema$SortSpec[]; + } /** - * The padding of the cell. - */ - padding: Schema$Padding; + * A sort order associated with a specific column or row. + */ + export interface Schema$SortSpec { + /** + * The dimension the sort should be applied to. + */ + dimensionIndex: number; + /** + * The order data should be sorted. + */ + sortOrder: string; + } /** - * The direction of the text in the cell. - */ - textDirection: string; + * A combination of a source range and how to extend that source. + */ + export interface Schema$SourceAndDestination { + /** + * The dimension that data should be filled into. + */ + dimension: string; + /** + * The number of rows or columns that data should be filled into. Positive + * numbers expand beyond the last row or last column of the source. Negative + * numbers expand before the first row or first column of the source. + */ + fillLength: number; + /** + * The location of the data to use as the source of the autofill. + */ + source: Schema$GridRange; + } /** - * The format of the text in the cell (unless overridden by a format run). - */ - textFormat: Schema$TextFormat; + * Resource that represents a spreadsheet. + */ + export interface Schema$Spreadsheet { + /** + * The developer metadata associated with a spreadsheet. + */ + developerMetadata: Schema$DeveloperMetadata[]; + /** + * The named ranges defined in a spreadsheet. + */ + namedRanges: Schema$NamedRange[]; + /** + * Overall properties of a spreadsheet. + */ + properties: Schema$SpreadsheetProperties; + /** + * The sheets that are part of a spreadsheet. + */ + sheets: Schema$Sheet[]; + /** + * The ID of the spreadsheet. This field is read-only. + */ + spreadsheetId: string; + /** + * The url of the spreadsheet. This field is read-only. + */ + spreadsheetUrl: string; + } /** - * The rotation applied to text in a cell - */ - textRotation: Schema$TextRotation; + * Properties of a spreadsheet. + */ + export interface Schema$SpreadsheetProperties { + /** + * The amount of time to wait before volatile functions are recalculated. + */ + autoRecalc: string; + /** + * The default format of all cells in the spreadsheet. + * CellData.effectiveFormat will not be set if the cell's format is + * equal to this default format. This field is read-only. + */ + defaultFormat: Schema$CellFormat; + /** + * Determines whether and how circular references are resolved with + * iterative calculation. Absence of this field means that circular + * references will result in calculation errors. + */ + iterativeCalculationSettings: Schema$IterativeCalculationSettings; + /** + * The locale of the spreadsheet in one of the following formats: * an ISO + * 639-1 language code such as `en` * an ISO 639-2 language code such as + * `fil`, if no 639-1 code exists * a combination of the ISO language code + * and country code, such as `en_US` Note: when updating this field, not + * all locales/languages are supported. + */ + locale: string; + /** + * The time zone of the spreadsheet, in CLDR format such as + * `America/New_York`. If the time zone isn't recognized, this may be a + * custom time zone such as `GMT-07:00`. + */ + timeZone: string; + /** + * The title of the spreadsheet. + */ + title: string; + } /** - * The vertical alignment of the value in the cell. - */ - verticalAlignment: string; + * The format of a run of text in a cell. Absent values indicate that the + * field isn't specified. + */ + export interface Schema$TextFormat { + /** + * True if the text is bold. + */ + bold: boolean; + /** + * The font family. + */ + fontFamily: string; + /** + * The size of the font. + */ + fontSize: number; + /** + * The foreground color of the text. + */ + foregroundColor: Schema$Color; + /** + * True if the text is italicized. + */ + italic: boolean; + /** + * True if the text has a strikethrough. + */ + strikethrough: boolean; + /** + * True if the text is underlined. + */ + underline: boolean; + } /** - * The wrap strategy for the value in the cell. - */ - wrapStrategy: string; -} -/** - * The data included in a domain or series. - */ -export interface Schema$ChartData { + * A run of a text format. The format of this run continues until the start + * index of the next run. When updating, all fields must be set. + */ + export interface Schema$TextFormatRun { + /** + * The format of this run. Absent values inherit the cell's format. + */ + format: Schema$TextFormat; + /** + * The character index where this run starts. + */ + startIndex: number; + } /** - * The source ranges of the data. + * Position settings for text. */ - sourceRange: Schema$ChartSourceRange; -} -/** - * Source ranges for a chart. - */ -export interface Schema$ChartSourceRange { - /** - * The ranges of data for a series or domain. Exactly one dimension must have - * a length of 1, and all sources in the list must have the same dimension - * with length 1. The domain (if it exists) & all series must have the - * same number of source ranges. If using more than one source range, then the - * source range at a given offset must be in order and contiguous across the - * domain and series. For example, these are valid configurations: domain - * sources: A1:A5 series1 sources: B1:B5 series2 sources: D6:D10 - * domain sources: A1:A5, C10:C12 series1 sources: B1:B5, D10:D12 series2 - * sources: C1:C5, E10:E12 - */ - sources: Schema$GridRange[]; -} -/** - * The specifications of a chart. - */ -export interface Schema$ChartSpec { + export interface Schema$TextPosition { + /** + * Horizontal alignment setting for the piece of text. + */ + horizontalAlignment: string; + } /** - * The alternative text that describes the chart. This is often used for - * accessibility. - */ - altText: string; + * The rotation applied to text in a cell. + */ + export interface Schema$TextRotation { + /** + * The angle between the standard orientation and the desired orientation. + * Measured in degrees. Valid values are between -90 and 90. Positive angles + * are angled upwards, negative are angled downwards. Note: For LTR text + * direction positive angles are in the counterclockwise direction, whereas + * for RTL they are in the clockwise direction + */ + angle: number; + /** + * If true, text reads top to bottom, but the orientation of individual + * characters is unchanged. For example: | V | | e | | r | | t + * | | i | | c | | a | | l | + */ + vertical: boolean; + } /** - * The background color of the entire chart. Not applicable to Org charts. + * Splits a column of text into multiple columns, based on a delimiter in each + * cell. */ - backgroundColor: Schema$Color; + export interface Schema$TextToColumnsRequest { + /** + * The delimiter to use. Used only if delimiterType is CUSTOM. + */ + delimiter: string; + /** + * The delimiter type to use. + */ + delimiterType: string; + /** + * The source data range. This must span exactly one column. + */ + source: Schema$GridRange; + } /** - * A basic chart specification, can be one of many kinds of charts. See - * BasicChartType for the list of all charts this supports. - */ - basicChart: Schema$BasicChartSpec; + * A color scale for a treemap chart. + */ + export interface Schema$TreemapChartColorScale { + /** + * The background color for cells with a color value greater than or equal + * to maxValue. Defaults to #109618 if not specified. + */ + maxValueColor: Schema$Color; + /** + * The background color for cells with a color value at the midpoint between + * minValue and maxValue. Defaults to #efe6dc if not specified. + */ + midValueColor: Schema$Color; + /** + * The background color for cells with a color value less than or equal to + * minValue. Defaults to #dc3912 if not specified. + */ + minValueColor: Schema$Color; + /** + * The background color for cells that have no color data associated with + * them. Defaults to #000000 if not specified. + */ + noDataColor: Schema$Color; + } /** - * A bubble chart specification. - */ - bubbleChart: Schema$BubbleChartSpec; + * A <a href="/chart/interactive/docs/gallery/treemap">Treemap + * chart</a>. + */ + export interface Schema$TreemapChartSpec { + /** + * The data that determines the background color of each treemap data cell. + * This field is optional. If not specified, size_data will be used to + * determine background colors. If specified, the data is expected to be + * numeric. color_scale will determine how the values in this data map to + * data cell background colors. + */ + colorData: Schema$ChartData; + /** + * The color scale for data cells in the treemap chart. Data cells are + * assigned colors based on their color values. These color values come from + * color_data, or from size_data if color_data is not specified. Cells with + * color values less than or equal to min_value will have minValueColor as + * their background color. Cells with color values greater than or equal to + * max_value will have maxValueColor as their background color. Cells with + * color values between min_value and max_value will have background colors + * on a gradient between minValueColor and maxValueColor, the midpoint of + * the gradient being midValueColor. Cells with missing or non-numeric color + * values will have noDataColor as their background color. + */ + colorScale: Schema$TreemapChartColorScale; + /** + * The background color for header cells. + */ + headerColor: Schema$Color; + /** + * True to hide tooltips. + */ + hideTooltips: boolean; + /** + * The number of additional data levels beyond the labeled levels to be + * shown on the treemap chart. These levels are not interactive and are + * shown without their labels. Defaults to 0 if not specified. + */ + hintedLevels: number; + /** + * The data that contains the treemap cell labels. + */ + labels: Schema$ChartData; + /** + * The number of data levels to show on the treemap chart. These levels are + * interactive and are shown with their labels. Defaults to 2 if not + * specified. + */ + levels: number; + /** + * The maximum possible data value. Cells with values greater than this will + * have the same color as cells with this value. If not specified, defaults + * to the actual maximum value from color_data, or the maximum value from + * size_data if color_data is not specified. + */ + maxValue: number; + /** + * The minimum possible data value. Cells with values less than this will + * have the same color as cells with this value. If not specified, defaults + * to the actual minimum value from color_data, or the minimum value from + * size_data if color_data is not specified. + */ + minValue: number; + /** + * The data the contains the treemap cells' parent labels. + */ + parentLabels: Schema$ChartData; + /** + * The data that determines the size of each treemap data cell. This data is + * expected to be numeric. The cells corresponding to non-numeric or missing + * data will not be rendered. If color_data is not specified, this data will + * be used to determine data cell background colors as well. + */ + sizeData: Schema$ChartData; + /** + * The text format for all labels on the chart. + */ + textFormat: Schema$TextFormat; + } /** - * A candlestick chart specification. + * Unmerges cells in the given range. */ - candlestickChart: Schema$CandlestickChartSpec; + export interface Schema$UnmergeCellsRequest { + /** + * The range within which all cells should be unmerged. If the range spans + * multiple merges, all will be unmerged. The range must not partially span + * any merge. + */ + range: Schema$GridRange; + } /** - * The name of the font to use by default for all chart text (e.g. title, axis - * labels, legend). If a font is specified for a specific part of the chart - * it will override this font name. - */ - fontName: string; + * Updates properties of the supplied banded range. + */ + export interface Schema$UpdateBandingRequest { + /** + * The banded range to update with the new properties. + */ + bandedRange: Schema$BandedRange; + /** + * The fields that should be updated. At least one field must be specified. + * The root `bandedRange` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + } /** - * Determines how the charts will use hidden rows or columns. - */ - hiddenDimensionStrategy: string; + * Updates the borders of a range. If a field is not set in the request, that + * means the border remains as-is. For example, with two subsequent + * UpdateBordersRequest: 1. range: A1:A5 `{ top: RED, bottom: WHITE }` 2. + * range: A1:A5 `{ left: BLUE }` That would result in A1:A5 having a borders + * of `{ top: RED, bottom: WHITE, left: BLUE }`. If you want to clear a + * border, explicitly set the style to NONE. + */ + export interface Schema$UpdateBordersRequest { + /** + * The border to put at the bottom of the range. + */ + bottom: Schema$Border; + /** + * The horizontal border to put within the range. + */ + innerHorizontal: Schema$Border; + /** + * The vertical border to put within the range. + */ + innerVertical: Schema$Border; + /** + * The border to put at the left of the range. + */ + left: Schema$Border; + /** + * The range whose borders should be updated. + */ + range: Schema$GridRange; + /** + * The border to put at the right of the range. + */ + right: Schema$Border; + /** + * The border to put at the top of the range. + */ + top: Schema$Border; + } /** - * A histogram chart specification. - */ - histogramChart: Schema$HistogramChartSpec; + * Updates all cells in a range with new data. + */ + export interface Schema$UpdateCellsRequest { + /** + * The fields of CellData that should be updated. At least one field must be + * specified. The root is the CellData; 'row.values.' should not be + * specified. A single `"*"` can be used as short-hand for listing + * every field. + */ + fields: string; + /** + * The range to write data to. If the data in rows does not cover the + * entire requested range, the fields matching those set in fields will be + * cleared. + */ + range: Schema$GridRange; + /** + * The data to write. + */ + rows: Schema$RowData[]; + /** + * The coordinate to start writing data at. Any number of rows and columns + * (including a different number of columns per row) may be written. + */ + start: Schema$GridCoordinate; + } /** - * True to make a chart fill the entire space in which it's rendered with - * minimum padding. False to use the default padding. (Not applicable to Geo - * and Org charts.) - */ - maximized: boolean; + * Updates a chart's specifications. (This does not move or resize a + * chart. To move or resize a chart, use UpdateEmbeddedObjectPositionRequest.) + */ + export interface Schema$UpdateChartSpecRequest { + /** + * The ID of the chart to update. + */ + chartId: number; + /** + * The specification to apply to the chart. + */ + spec: Schema$ChartSpec; + } /** - * An org chart specification. - */ - orgChart: Schema$OrgChartSpec; + * Updates a conditional format rule at the given index, or moves a + * conditional format rule to another index. + */ + export interface Schema$UpdateConditionalFormatRuleRequest { + /** + * The zero-based index of the rule that should be replaced or moved. + */ + index: number; + /** + * The zero-based new index the rule should end up at. + */ + newIndex: number; + /** + * The rule that should replace the rule at the given index. + */ + rule: Schema$ConditionalFormatRule; + /** + * The sheet of the rule to move. Required if new_index is set, unused + * otherwise. + */ + sheetId: number; + } /** - * A pie chart specification. - */ - pieChart: Schema$PieChartSpec; + * The result of updating a conditional format rule. + */ + export interface Schema$UpdateConditionalFormatRuleResponse { + /** + * The index of the new rule. + */ + newIndex: number; + /** + * The new rule that replaced the old rule (if replacing), or the rule that + * was moved (if moved) + */ + newRule: Schema$ConditionalFormatRule; + /** + * The old index of the rule. Not set if a rule was replaced (because it is + * the same as new_index). + */ + oldIndex: number; + /** + * The old (deleted) rule. Not set if a rule was moved (because it is the + * same as new_rule). + */ + oldRule: Schema$ConditionalFormatRule; + } /** - * The subtitle of the chart. - */ - subtitle: string; + * A request to update properties of developer metadata. Updates the + * properties of the developer metadata selected by the filters to the values + * provided in the DeveloperMetadata resource. Callers must specify the + * properties they wish to update in the fields parameter, as well as specify + * at least one DataFilter matching the metadata they wish to update. + */ + export interface Schema$UpdateDeveloperMetadataRequest { + /** + * The filters matching the developer metadata entries to update. + */ + dataFilters: Schema$DataFilter[]; + /** + * The value that all metadata matched by the data filters will be updated + * to. + */ + developerMetadata: Schema$DeveloperMetadata; + /** + * The fields that should be updated. At least one field must be specified. + * The root `developerMetadata` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + */ + fields: string; + } /** - * The subtitle text format. Strikethrough and underline are not supported. + * The response from updating developer metadata. */ - subtitleTextFormat: Schema$TextFormat; + export interface Schema$UpdateDeveloperMetadataResponse { + /** + * The updated developer metadata. + */ + developerMetadata: Schema$DeveloperMetadata[]; + } /** - * The subtitle text position. This field is optional. - */ - subtitleTextPosition: Schema$TextPosition; + * Updates properties of dimensions within the specified range. + */ + export interface Schema$UpdateDimensionPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `properties` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * Properties to update. + */ + properties: Schema$DimensionProperties; + /** + * The rows or columns to update. + */ + range: Schema$DimensionRange; + } /** - * The title of the chart. - */ - title: string; + * Update an embedded object's position (such as a moving or resizing a + * chart or image). + */ + export interface Schema$UpdateEmbeddedObjectPositionRequest { + /** + * The fields of OverlayPosition that should be updated when setting a new + * position. Used only if newPosition.overlayPosition is set, in which case + * at least one field must be specified. The root + * `newPosition.overlayPosition` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * An explicit position to move the embedded object to. If + * newPosition.sheetId is set, a new sheet with that ID will be created. If + * newPosition.newSheet is set to true, a new sheet will be created with an + * ID that will be chosen for you. + */ + newPosition: Schema$EmbeddedObjectPosition; + /** + * The ID of the object to moved. + */ + objectId: number; + } /** - * The title text format. Strikethrough and underline are not supported. + * The result of updating an embedded object's position. */ - titleTextFormat: Schema$TextFormat; + export interface Schema$UpdateEmbeddedObjectPositionResponse { + /** + * The new position of the embedded object. + */ + position: Schema$EmbeddedObjectPosition; + } /** - * The title text position. This field is optional. - */ - titleTextPosition: Schema$TextPosition; + * Updates properties of the filter view. + */ + export interface Schema$UpdateFilterViewRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `filter` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The new properties of the filter view. + */ + filter: Schema$FilterView; + } /** - * A treemap chart specification. - */ - treemapChart: Schema$TreemapChartSpec; + * Updates properties of the named range with the specified namedRangeId. + */ + export interface Schema$UpdateNamedRangeRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `namedRange` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The named range to update with the new properties. + */ + namedRange: Schema$NamedRange; + } /** - * A waterfall chart specification. - */ - waterfallChart: Schema$WaterfallChartSpec; -} -/** - * Clears the basic filter, if any exists on the sheet. - */ -export interface Schema$ClearBasicFilterRequest { + * Updates an existing protected range with the specified protectedRangeId. + */ + export interface Schema$UpdateProtectedRangeRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `protectedRange` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The protected range to update with the new properties. + */ + protectedRange: Schema$ProtectedRange; + } /** - * The sheet ID on which the basic filter should be cleared. - */ - sheetId: number; -} -/** - * The request for clearing a range of values in a spreadsheet. - */ -export interface Schema$ClearValuesRequest {} -/** - * The response when clearing a range of values in a spreadsheet. - */ -export interface Schema$ClearValuesResponse { + * Updates properties of the sheet with the specified sheetId. + */ + export interface Schema$UpdateSheetPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `properties` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The properties to update. + */ + properties: Schema$SheetProperties; + } /** - * The range (in A1 notation) that was cleared. (If the request was for an - * unbounded range or a ranger larger than the bounds of the sheet, this will - * be the actual range that was cleared, bounded to the sheet's limits.) - */ - clearedRange: string; + * Updates properties of a spreadsheet. + */ + export interface Schema$UpdateSpreadsheetPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root 'properties' is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + */ + fields: string; + /** + * The properties to update. + */ + properties: Schema$SpreadsheetProperties; + } /** - * The spreadsheet the updates were applied to. + * The response when updating a range of values by a data filter in a + * spreadsheet. */ - spreadsheetId: string; -} -/** - * Represents a color in the RGBA color space. This representation is designed - * for simplicity of conversion to/from color representations in various - * languages over compactness; for example, the fields of this representation - * can be trivially provided to the constructor of "java.awt.Color" in - * Java; it can also be trivially provided to UIColor's - * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a - * little work, it can be easily formatted into a CSS "rgba()" string - * in JavaScript, as well. Here are some examples: Example (Java): import - * com.google.type.Color; // ... public static java.awt.Color - * fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? - * protocolor.getAlpha().getValue() : 1.0; return new - * java.awt.Color( protocolor.getRed(), protocolor.getGreen(), - * protocolor.getBlue(), alpha); } public static Color - * toProto(java.awt.Color color) { float red = (float) color.getRed(); - * float green = (float) color.getGreen(); float blue = (float) - * color.getBlue(); float denominator = 255.0; Color.Builder - * resultBuilder = Color .newBuilder() .setRed(red / - * denominator) .setGreen(green / denominator) .setBlue(blue / - * denominator); int alpha = color.getAlpha(); if (alpha != 255) { - * result.setAlpha( FloatValue .newBuilder() - * .setValue(((float) alpha) / denominator) .build()); } - * return resultBuilder.build(); } // ... Example (iOS / Obj-C): // - * ... static UIColor* fromProto(Color* protocolor) { float red = - * [protocolor red]; float green = [protocolor green]; float - * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor - * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha - * = [alpha_wrapper value]; } return [UIColor colorWithRed:red - * green:green blue:blue alpha:alpha]; } static Color* - * toProto(UIColor* color) { CGFloat red, green, blue, alpha; if - * (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - * return nil; } Color* result = [Color alloc] init]; [result - * setRed:red]; [result setGreen:green]; [result - * setBlue:blue]; if (alpha <= 0.9999) { [result - * setAlpha:floatWrapperWithValue(alpha)]; } [result - * autorelease]; return result; } // ... Example - * (JavaScript): // ... var protoToCssColor = function(rgb_color) { - * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || - * 0.0; var blueFrac = rgb_color.blue || 0.0; var red = - * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); - * var blue = Math.floor(blueFrac * 255); if (!('alpha' in - * rgb_color)) { return rgbToCssColor_(red, green, blue); } var - * alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, - * blue].join(','); return ['rgba(', rgbParams, - * ',', alphaFrac, ')'].join(''); }; var - * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new - * Number((red << 16) | (green << 8) | blue); var hexString = - * rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var - * resultBuilder = ['#']; for (var i = 0; i < missingZeros; - * i++) { resultBuilder.push('0'); } - * resultBuilder.push(hexString); return resultBuilder.join(''); - * }; // ... - */ -export interface Schema$Color { + export interface Schema$UpdateValuesByDataFilterResponse { + /** + * The data filter that selected the range that was updated. + */ + dataFilter: Schema$DataFilter; + /** + * The number of cells updated. + */ + updatedCells: number; + /** + * The number of columns where at least one cell in the column was updated. + */ + updatedColumns: number; + /** + * The values of the cells in the range matched by the dataFilter after all + * updates were applied. This is only included if the request's + * `includeValuesInResponse` field was `true`. + */ + updatedData: Schema$ValueRange; + /** + * The range (in A1 notation) that updates were applied to. + */ + updatedRange: string; + /** + * The number of rows where at least one cell in the row was updated. + */ + updatedRows: number; + } /** - * The fraction of this color that should be applied to the pixel. That is, - * the final pixel color is defined by the equation: pixel color = alpha * - * (this color) + (1.0 - alpha) * (background color) This means that a value - * of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to - * a completely transparent color. This uses a wrapper message rather than a - * simple float scalar so that it is possible to distinguish between a default - * value and the value being unset. If omitted, this color object is to be - * rendered as a solid color (as if the alpha value had been explicitly given - * with a value of 1.0). - */ - alpha: number; + * The response when updating a range of values in a spreadsheet. + */ + export interface Schema$UpdateValuesResponse { + /** + * The spreadsheet the updates were applied to. + */ + spreadsheetId: string; + /** + * The number of cells updated. + */ + updatedCells: number; + /** + * The number of columns where at least one cell in the column was updated. + */ + updatedColumns: number; + /** + * The values of the cells after updates were applied. This is only included + * if the request's `includeValuesInResponse` field was `true`. + */ + updatedData: Schema$ValueRange; + /** + * The range (in A1 notation) that updates were applied to. + */ + updatedRange: string; + /** + * The number of rows where at least one cell in the row was updated. + */ + updatedRows: number; + } /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; + * Data within a range of the spreadsheet. + */ + export interface Schema$ValueRange { + /** + * The major dimension of the values. For output, if the spreadsheet data + * is: `A1=1,B1=2,A2=3,B2=4`, then requesting + * `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas + * requesting `range=A1:B2,majorDimension=COLUMNS` will return + * `[[1,3],[2,4]]`. For input, with `range=A1:B2,majorDimension=ROWS` then + * `[[1,2],[3,4]]` will set `A1=1,B1=2,A2=3,B2=4`. With + * `range=A1:B2,majorDimension=COLUMNS` then `[[1,2],[3,4]]` will set + * `A1=1,B1=3,A2=2,B2=4`. When writing, if this field is not set, it + * defaults to ROWS. + */ + majorDimension: string; + /** + * The range the values cover, in A1 notation. For output, this range + * indicates the entire requested range, even though the values will exclude + * trailing rows and columns. When appending values, this field represents + * the range to search for a table, after which values will be appended. + */ + range: string; + /** + * The data that was read or to be written. This is an array of arrays, the + * outer array representing all the data and each inner array representing a + * major dimension. Each item in the inner array corresponds with one cell. + * For output, empty trailing rows and columns will not be included. For + * input, supported value types are: bool, string, and double. Null values + * will be skipped. To set a cell to an empty value, set the string value to + * an empty string. + */ + values: any[][]; + } /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; + * Styles for a waterfall chart column. + */ + export interface Schema$WaterfallChartColumnStyle { + /** + * The color of the column. + */ + color: Schema$Color; + /** + * The label of the column's legend. + */ + label: string; + } /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * A rule describing a conditional format. - */ -export interface Schema$ConditionalFormatRule { + * A custom subtotal column for a waterfall chart series. + */ + export interface Schema$WaterfallChartCustomSubtotal { + /** + * True if the data point at subtotal_index is the subtotal. If false, the + * subtotal will be computed and appear after the data point. + */ + dataIsSubtotal: boolean; + /** + * A label for the subtotal column. + */ + label: string; + /** + * The 0-based index of a data point within the series. If data_is_subtotal + * is true, the data point at this index is the subtotal. Otherwise, the + * subtotal appears after the data point with this index. A series can have + * multiple subtotals at arbitrary indices, but subtotals do not affect the + * indices of the data points. For example, if a series has three data + * points, their indices will always be 0, 1, and 2, regardless of how many + * subtotals exist on the series or what data points they are associated + * with. + */ + subtotalIndex: number; + } /** - * The formatting is either "on" or "off" according to the - * rule. - */ - booleanRule: Schema$BooleanRule; + * The domain of a waterfall chart. + */ + export interface Schema$WaterfallChartDomain { + /** + * The data of the WaterfallChartDomain. + */ + data: Schema$ChartData; + /** + * True to reverse the order of the domain values (horizontal axis). + */ + reversed: boolean; + } /** - * The formatting will vary based on the gradients in the rule. - */ - gradientRule: Schema$GradientRule; + * A single series of data for a waterfall chart. + */ + export interface Schema$WaterfallChartSeries { + /** + * Custom subtotal columns appearing in this series. The order in which + * subtotals are defined is not significant. Only one subtotal may be + * defined for each data point. + */ + customSubtotals: Schema$WaterfallChartCustomSubtotal[]; + /** + * The data being visualized in this series. + */ + data: Schema$ChartData; + /** + * True to hide the subtotal column from the end of the series. By default, + * a subtotal column will appear at the end of each series. Setting this + * field to true will hide that subtotal column for this series. + */ + hideTrailingSubtotal: boolean; + /** + * Styles for all columns in this series with negative values. + */ + negativeColumnsStyle: Schema$WaterfallChartColumnStyle; + /** + * Styles for all columns in this series with positive values. + */ + positiveColumnsStyle: Schema$WaterfallChartColumnStyle; + /** + * Styles for all subtotal columns in this series. + */ + subtotalColumnsStyle: Schema$WaterfallChartColumnStyle; + } /** - * The ranges that will be formatted if the condition is true. All the ranges - * must be on the same grid. - */ - ranges: Schema$GridRange[]; -} -/** - * The value of the condition. - */ -export interface Schema$ConditionValue { - /** - * A relative date (based on the current date). Valid only if the type is - * DATE_BEFORE, DATE_AFTER, DATE_ON_OR_BEFORE or DATE_ON_OR_AFTER. Relative - * dates are not supported in data validation. They are supported only in - * conditional formatting and conditional filters. - */ - relativeDate: string; - /** - * A value the condition is based on. The value will be parsed as if the user - * typed into a cell. Formulas are supported (and must begin with an `=` or a - * '+'). - */ - userEnteredValue: string; -} -/** - * Copies data from the source to the destination. - */ -export interface Schema$CopyPasteRequest { - /** - * The location to paste to. If the range covers a span that's a multiple - * of the source's height or width, then the data will be repeated to fill - * in the destination range. If the range is smaller than the source range, - * the entire source data will still be copied (beyond the end of the - * destination range). - */ - destination: Schema$GridRange; - /** - * How that data should be oriented when pasting. - */ - pasteOrientation: string; - /** - * What kind of data to paste. - */ - pasteType: string; - /** - * The source range to copy. - */ - source: Schema$GridRange; -} -/** - * The request to copy a sheet across spreadsheets. - */ -export interface Schema$CopySheetToAnotherSpreadsheetRequest { - /** - * The ID of the spreadsheet to copy the sheet to. - */ - destinationSpreadsheetId: string; -} -/** - * A request to create developer metadata. - */ -export interface Schema$CreateDeveloperMetadataRequest { - /** - * The developer metadata to create. - */ - developerMetadata: Schema$DeveloperMetadata; -} -/** - * The response from creating developer metadata. - */ -export interface Schema$CreateDeveloperMetadataResponse { - /** - * The developer metadata that was created. - */ - developerMetadata: Schema$DeveloperMetadata; -} -/** - * Moves data from the source to the destination. - */ -export interface Schema$CutPasteRequest { - /** - * The top-left coordinate where the data should be pasted. - */ - destination: Schema$GridCoordinate; - /** - * What kind of data to paste. All the source data will be cut, regardless of - * what is pasted. - */ - pasteType: string; - /** - * The source data to cut. - */ - source: Schema$GridRange; -} -/** - * Filter that describes what data should be selected or returned from a - * request. - */ -export interface Schema$DataFilter { - /** - * Selects data that matches the specified A1 range. - */ - a1Range: string; - /** - * Selects data associated with the developer metadata matching the criteria - * described by this DeveloperMetadataLookup. - */ - developerMetadataLookup: Schema$DeveloperMetadataLookup; - /** - * Selects data that matches the range described by the GridRange. - */ - gridRange: Schema$GridRange; -} -/** - * A range of values whose location is specified by a DataFilter. - */ -export interface Schema$DataFilterValueRange { - /** - * The data filter describing the location of the values in the spreadsheet. - */ - dataFilter: Schema$DataFilter; - /** - * The major dimension of the values. - */ - majorDimension: string; - /** - * The data to be written. If the provided values exceed any of the ranges - * matched by the data filter then the request will fail. If the provided - * values are less than the matched ranges only the specified values will be - * written, existing values in the matched ranges will remain unaffected. - */ - values: any[][]; -} -/** - * A data validation rule. - */ -export interface Schema$DataValidationRule { - /** - * The condition that data in the cell must match. - */ - condition: Schema$BooleanCondition; - /** - * A message to show the user when adding data to the cell. - */ - inputMessage: string; - /** - * True if the UI should be customized based on the kind of condition. If - * true, "List" conditions will show a dropdown. - */ - showCustomUi: boolean; - /** - * True if invalid data should be rejected. - */ - strict: boolean; -} -/** - * Removes the banded range with the given ID from the spreadsheet. - */ -export interface Schema$DeleteBandingRequest { - /** - * The ID of the banded range to delete. - */ - bandedRangeId: number; -} -/** - * Deletes a conditional format rule at the given index. All subsequent - * rules' indexes are decremented. - */ -export interface Schema$DeleteConditionalFormatRuleRequest { - /** - * The zero-based index of the rule to be deleted. - */ - index: number; - /** - * The sheet the rule is being deleted from. - */ - sheetId: number; -} -/** - * The result of deleting a conditional format rule. - */ -export interface Schema$DeleteConditionalFormatRuleResponse { - /** - * The rule that was deleted. - */ - rule: Schema$ConditionalFormatRule; -} -/** - * A request to delete developer metadata. - */ -export interface Schema$DeleteDeveloperMetadataRequest { - /** - * The data filter describing the criteria used to select which developer - * metadata entry to delete. - */ - dataFilter: Schema$DataFilter; -} -/** - * The response from deleting developer metadata. - */ -export interface Schema$DeleteDeveloperMetadataResponse { - /** - * The metadata that was deleted. - */ - deletedDeveloperMetadata: Schema$DeveloperMetadata[]; -} -/** - * Deletes the dimensions from the sheet. - */ -export interface Schema$DeleteDimensionRequest { - /** - * The dimensions to delete from the sheet. - */ - range: Schema$DimensionRange; -} -/** - * Deletes the embedded object with the given ID. - */ -export interface Schema$DeleteEmbeddedObjectRequest { - /** - * The ID of the embedded object to delete. - */ - objectId: number; -} -/** - * Deletes a particular filter view. - */ -export interface Schema$DeleteFilterViewRequest { - /** - * The ID of the filter to delete. - */ - filterId: number; -} -/** - * Removes the named range with the given ID from the spreadsheet. - */ -export interface Schema$DeleteNamedRangeRequest { - /** - * The ID of the named range to delete. - */ - namedRangeId: string; -} -/** - * Deletes the protected range with the given ID. - */ -export interface Schema$DeleteProtectedRangeRequest { - /** - * The ID of the protected range to delete. - */ - protectedRangeId: number; -} -/** - * Deletes a range of cells, shifting other cells into the deleted area. - */ -export interface Schema$DeleteRangeRequest { - /** - * The range of cells to delete. - */ - range: Schema$GridRange; - /** - * The dimension from which deleted cells will be replaced with. If ROWS, - * existing cells will be shifted upward to replace the deleted cells. If - * COLUMNS, existing cells will be shifted left to replace the deleted cells. - */ - shiftDimension: string; -} -/** - * Deletes the requested sheet. - */ -export interface Schema$DeleteSheetRequest { - /** - * The ID of the sheet to delete. - */ - sheetId: number; -} -/** - * Developer metadata associated with a location or object in a spreadsheet. - * Developer metadata may be used to associate arbitrary data with various parts - * of a spreadsheet and will remain associated at those locations as they move - * around and the spreadsheet is edited. For example, if developer metadata is - * associated with row 5 and another row is then subsequently inserted above row - * 5, that original metadata will still be associated with the row it was first - * associated with (what is now row 6). If the associated object is deleted its - * metadata will be deleted too. - */ -export interface Schema$DeveloperMetadata { - /** - * The location where the metadata is associated. - */ - location: Schema$DeveloperMetadataLocation; - /** - * The spreadsheet-scoped unique ID that identifies the metadata. IDs may be - * specified when metadata is created, otherwise one will be randomly - * generated and assigned. Must be positive. - */ - metadataId: number; - /** - * The metadata key. There may be multiple metadata in a spreadsheet with the - * same key. Developer metadata must always have a key specified. - */ - metadataKey: string; - /** - * Data associated with the metadata's key. - */ - metadataValue: string; - /** - * The metadata visibility. Developer metadata must always have a visibility - * specified. - */ - visibility: string; -} -/** - * A location where metadata may be associated in a spreadsheet. - */ -export interface Schema$DeveloperMetadataLocation { - /** - * Represents the row or column when metadata is associated with a dimension. - * The specified DimensionRange must represent a single row or column; it - * cannot be unbounded or span multiple rows or columns. - */ - dimensionRange: Schema$DimensionRange; - /** - * The type of location this object represents. This field is read-only. - */ - locationType: string; - /** - * The ID of the sheet when metadata is associated with an entire sheet. - */ - sheetId: number; - /** - * True when metadata is associated with an entire spreadsheet. - */ - spreadsheet: boolean; -} -/** - * Selects DeveloperMetadata that matches all of the specified fields. For - * example, if only a metadata ID is specified this considers the - * DeveloperMetadata with that particular unique ID. If a metadata key is - * specified, this considers all developer metadata with that key. If a key, - * visibility, and location type are all specified, this considers all developer - * metadata with that key and visibility that are associated with a location of - * that type. In general, this selects all DeveloperMetadata that matches the - * intersection of all the specified fields; any field or combination of fields - * may be specified. - */ -export interface Schema$DeveloperMetadataLookup { - /** - * Determines how this lookup matches the location. If this field is - * specified as EXACT, only developer metadata associated on the exact - * location specified is matched. If this field is specified to INTERSECTING, - * developer metadata associated on intersecting locations is also matched. If - * left unspecified, this field assumes a default value of INTERSECTING. If - * this field is specified, a metadataLocation must also be specified. - */ - locationMatchingStrategy: string; - /** - * Limits the selected developer metadata to those entries which are - * associated with locations of the specified type. For example, when this - * field is specified as ROW this lookup only considers developer metadata - * associated on rows. If the field is left unspecified, all location types - * are considered. This field cannot be specified as SPREADSHEET when the - * locationMatchingStrategy is specified as INTERSECTING or when the - * metadataLocation is specified as a non-spreadsheet location: spreadsheet - * metadata cannot intersect any other developer metadata location. This - * field also must be left unspecified when the locationMatchingStrategy is - * specified as EXACT. - */ - locationType: string; - /** - * Limits the selected developer metadata to that which has a matching - * DeveloperMetadata.metadata_id. - */ - metadataId: number; - /** - * Limits the selected developer metadata to that which has a matching - * DeveloperMetadata.metadata_key. - */ - metadataKey: string; - /** - * Limits the selected developer metadata to those entries associated with the - * specified location. This field either matches exact locations or all - * intersecting locations according the specified locationMatchingStrategy. - */ - metadataLocation: Schema$DeveloperMetadataLocation; - /** - * Limits the selected developer metadata to that which has a matching - * DeveloperMetadata.metadata_value. - */ - metadataValue: string; - /** - * Limits the selected developer metadata to that which has a matching - * DeveloperMetadata.visibility. If left unspecified, all developer metadata - * visibile to the requesting project is considered. - */ - visibility: string; -} -/** - * Properties about a dimension. - */ -export interface Schema$DimensionProperties { - /** - * The developer metadata associated with a single row or column. - */ - developerMetadata: Schema$DeveloperMetadata[]; - /** - * True if this dimension is being filtered. This field is read-only. - */ - hiddenByFilter: boolean; - /** - * True if this dimension is explicitly hidden. - */ - hiddenByUser: boolean; - /** - * The height (if a row) or width (if a column) of the dimension in pixels. - */ - pixelSize: number; -} -/** - * A range along a single dimension on a sheet. All indexes are zero-based. - * Indexes are half open: the start index is inclusive and the end index is - * exclusive. Missing indexes indicate the range is unbounded on that side. - */ -export interface Schema$DimensionRange { - /** - * The dimension of the span. - */ - dimension: string; - /** - * The end (exclusive) of the span, or not set if unbounded. - */ - endIndex: number; - /** - * The sheet this span is on. - */ - sheetId: number; - /** - * The start (inclusive) of the span, or not set if unbounded. - */ - startIndex: number; -} -/** - * Duplicates a particular filter view. - */ -export interface Schema$DuplicateFilterViewRequest { - /** - * The ID of the filter being duplicated. - */ - filterId: number; -} -/** - * The result of a filter view being duplicated. - */ -export interface Schema$DuplicateFilterViewResponse { - /** - * The newly created filter. - */ - filter: Schema$FilterView; -} -/** - * Duplicates the contents of a sheet. - */ -export interface Schema$DuplicateSheetRequest { - /** - * The zero-based index where the new sheet should be inserted. The index of - * all sheets after this are incremented. - */ - insertSheetIndex: number; - /** - * If set, the ID of the new sheet. If not set, an ID is chosen. If set, the - * ID must not conflict with any existing sheet ID. If set, it must be - * non-negative. - */ - newSheetId: number; - /** - * The name of the new sheet. If empty, a new name is chosen for you. - */ - newSheetName: string; - /** - * The sheet to duplicate. - */ - sourceSheetId: number; -} -/** - * The result of duplicating a sheet. - */ -export interface Schema$DuplicateSheetResponse { - /** - * The properties of the duplicate sheet. - */ - properties: Schema$SheetProperties; -} -/** - * The editors of a protected range. - */ -export interface Schema$Editors { - /** - * True if anyone in the document's domain has edit access to the - * protected range. Domain protection is only supported on documents within a - * domain. - */ - domainUsersCanEdit: boolean; - /** - * The email addresses of groups with edit access to the protected range. - */ - groups: string[]; - /** - * The email addresses of users with edit access to the protected range. - */ - users: string[]; -} -/** - * A chart embedded in a sheet. - */ -export interface Schema$EmbeddedChart { - /** - * The ID of the chart. - */ - chartId: number; - /** - * The position of the chart. - */ - position: Schema$EmbeddedObjectPosition; - /** - * The specification of the chart. - */ - spec: Schema$ChartSpec; -} -/** - * The position of an embedded object such as a chart. - */ -export interface Schema$EmbeddedObjectPosition { - /** - * If true, the embedded object will be put on a new sheet whose ID is chosen - * for you. Used only when writing. - */ - newSheet: boolean; - /** - * The position at which the object is overlaid on top of a grid. - */ - overlayPosition: Schema$OverlayPosition; - /** - * The sheet this is on. Set only if the embedded object is on its own sheet. - * Must be non-negative. - */ - sheetId: number; -} -/** - * An error in a cell. - */ -export interface Schema$ErrorValue { - /** - * A message with more information about the error (in the spreadsheet's - * locale). - */ - message: string; - /** - * The type of error. - */ - type: string; -} -/** - * The kinds of value that a cell in a spreadsheet can have. - */ -export interface Schema$ExtendedValue { - /** - * Represents a boolean value. - */ - boolValue: boolean; - /** - * Represents an error. This field is read-only. - */ - errorValue: Schema$ErrorValue; - /** - * Represents a formula. - */ - formulaValue: string; - /** - * Represents a double value. Note: Dates, Times and DateTimes are represented - * as doubles in "serial number" format. - */ - numberValue: number; - /** - * Represents a string value. Leading single quotes are not included. For - * example, if the user typed `'123` into the UI, this would be - * represented as a `stringValue` of `"123"`. - */ - stringValue: string; -} -/** - * Criteria for showing/hiding rows in a filter or filter view. - */ -export interface Schema$FilterCriteria { - /** - * A condition that must be true for values to be shown. (This does not - * override hiddenValues -- if a value is listed there, it will still be - * hidden.) - */ - condition: Schema$BooleanCondition; - /** - * Values that should be hidden. - */ - hiddenValues: string[]; -} -/** - * A filter view. - */ -export interface Schema$FilterView { - /** - * The criteria for showing/hiding values per column. The map's key is the - * column index, and the value is the criteria for that column. - */ - criteria: any; - /** - * The ID of the filter view. - */ - filterViewId: number; - /** - * The named range this filter view is backed by, if any. When writing, only - * one of range or named_range_id may be set. - */ - namedRangeId: string; - /** - * The range this filter view covers. When writing, only one of range or - * named_range_id may be set. - */ - range: Schema$GridRange; - /** - * The sort order per column. Later specifications are used when values are - * equal in the earlier specifications. - */ - sortSpecs: Schema$SortSpec[]; - /** - * The name of the filter view. - */ - title: string; -} -/** - * Finds and replaces data in cells over a range, sheet, or all sheets. - */ -export interface Schema$FindReplaceRequest { - /** - * True to find/replace over all sheets. - */ - allSheets: boolean; - /** - * The value to search. - */ - find: string; - /** - * True if the search should include cells with formulas. False to skip cells - * with formulas. - */ - includeFormulas: boolean; - /** - * True if the search is case sensitive. - */ - matchCase: boolean; - /** - * True if the find value should match the entire cell. - */ - matchEntireCell: boolean; - /** - * The range to find/replace over. - */ - range: Schema$GridRange; - /** - * The value to use as the replacement. - */ - replacement: string; - /** - * True if the find value is a regex. The regular expression and replacement - * should follow Java regex rules at - * https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html. The - * replacement string is allowed to refer to capturing groups. For example, if - * one cell has the contents `"Google Sheets"` and another has - * `"Google Docs"`, then searching for `"o.* (.*)"` with a - * replacement of `"$1 Rocks"` would change the contents of the - * cells to `"GSheets Rocks"` and `"GDocs Rocks"` - * respectively. - */ - searchByRegex: boolean; - /** - * The sheet to find/replace over. - */ - sheetId: number; -} -/** - * The result of the find/replace. - */ -export interface Schema$FindReplaceResponse { - /** - * The number of formula cells changed. - */ - formulasChanged: number; - /** - * The number of occurrences (possibly multiple within a cell) changed. For - * example, if replacing `"e"` with `"o"` in `"Google - * Sheets"`, this would be `"3"` because `"Google - * Sheets"` -> `"Googlo Shoots"`. - */ - occurrencesChanged: number; - /** - * The number of rows changed. - */ - rowsChanged: number; - /** - * The number of sheets changed. - */ - sheetsChanged: number; - /** - * The number of non-formula cells changed. - */ - valuesChanged: number; -} -/** - * The request for retrieving a Spreadsheet. - */ -export interface Schema$GetSpreadsheetByDataFilterRequest { - /** - * The DataFilters used to select which ranges to retrieve from the - * spreadsheet. - */ - dataFilters: Schema$DataFilter[]; - /** - * True if grid data should be returned. This parameter is ignored if a field - * mask was set in the request. - */ - includeGridData: boolean; -} -/** - * A rule that applies a gradient color scale format, based on the interpolation - * points listed. The format of a cell will vary based on its contents as - * compared to the values of the interpolation points. - */ -export interface Schema$GradientRule { - /** - * The final interpolation point. - */ - maxpoint: Schema$InterpolationPoint; - /** - * An optional midway interpolation point. - */ - midpoint: Schema$InterpolationPoint; - /** - * The starting interpolation point. - */ - minpoint: Schema$InterpolationPoint; -} -/** - * A coordinate in a sheet. All indexes are zero-based. - */ -export interface Schema$GridCoordinate { - /** - * The column index of the coordinate. - */ - columnIndex: number; - /** - * The row index of the coordinate. - */ - rowIndex: number; - /** - * The sheet this coordinate is on. - */ - sheetId: number; -} -/** - * Data in the grid, as well as metadata about the dimensions. - */ -export interface Schema$GridData { - /** - * Metadata about the requested columns in the grid, starting with the column - * in start_column. - */ - columnMetadata: Schema$DimensionProperties[]; - /** - * The data in the grid, one entry per row, starting with the row in startRow. - * The values in RowData will correspond to columns starting at start_column. - */ - rowData: Schema$RowData[]; - /** - * Metadata about the requested rows in the grid, starting with the row in - * start_row. - */ - rowMetadata: Schema$DimensionProperties[]; - /** - * The first column this GridData refers to, zero-based. - */ - startColumn: number; - /** - * The first row this GridData refers to, zero-based. - */ - startRow: number; -} -/** - * Properties of a grid. - */ -export interface Schema$GridProperties { - /** - * The number of columns in the grid. - */ - columnCount: number; - /** - * The number of columns that are frozen in the grid. - */ - frozenColumnCount: number; - /** - * The number of rows that are frozen in the grid. - */ - frozenRowCount: number; - /** - * True if the grid isn't showing gridlines in the UI. - */ - hideGridlines: boolean; - /** - * The number of rows in the grid. - */ - rowCount: number; -} -/** - * A range on a sheet. All indexes are zero-based. Indexes are half open, e.g - * the start index is inclusive and the end index is exclusive -- [start_index, - * end_index). Missing indexes indicate the range is unbounded on that side. For - * example, if `"Sheet1"` is sheet ID 0, then: `Sheet1!A1:A1 == - * sheet_id: 0, start_row_index: 0, end_row_index: 1, - * start_column_index: 0, end_column_index: 1` `Sheet1!A3:B4 == sheet_id: 0, - * start_row_index: 2, end_row_index: 4, start_column_index: - * 0, end_column_index: 2` `Sheet1!A:B == sheet_id: 0, start_column_index: 0, - * end_column_index: 2` `Sheet1!A5:B == sheet_id: 0, start_row_index: 4, - * start_column_index: 0, end_column_index: 2` `Sheet1 == sheet_id:0` The - * start index must always be less than or equal to the end index. If the start - * index equals the end index, then the range is empty. Empty ranges are - * typically not meaningful and are usually rendered in the UI as `#REF!`. - */ -export interface Schema$GridRange { - /** - * The end column (exclusive) of the range, or not set if unbounded. - */ - endColumnIndex: number; - /** - * The end row (exclusive) of the range, or not set if unbounded. - */ - endRowIndex: number; - /** - * The sheet this range is on. - */ - sheetId: number; - /** - * The start column (inclusive) of the range, or not set if unbounded. - */ - startColumnIndex: number; - /** - * The start row (inclusive) of the range, or not set if unbounded. - */ - startRowIndex: number; -} -/** - * A <a - * href="/chart/interactive/docs/gallery/histogram">histogram - * chart</a>. A histogram chart groups data items into bins, displaying - * each bin as a column of stacked items. Histograms are used to display the - * distribution of a dataset. Each column of items represents a range into - * which those items fall. The number of bins can be chosen automatically or - * specified explicitly. - */ -export interface Schema$HistogramChartSpec { - /** - * By default the bucket size (the range of values stacked in a single column) - * is chosen automatically, but it may be overridden here. E.g., A bucket size - * of 1.5 results in buckets from 0 - 1.5, 1.5 - 3.0, etc. Cannot be negative. - * This field is optional. - */ - bucketSize: number; - /** - * The position of the chart legend. - */ - legendPosition: string; - /** - * The outlier percentile is used to ensure that outliers do not adversely - * affect the calculation of bucket sizes. For example, setting an outlier - * percentile of 0.05 indicates that the top and bottom 5% of values when - * calculating buckets. The values are still included in the chart, they will - * be added to the first or last buckets instead of their own buckets. Must be - * between 0.0 and 0.5. - */ - outlierPercentile: number; - /** - * The series for a histogram may be either a single series of values to be - * bucketed or multiple series, each of the same length, containing the name - * of the series followed by the values to be bucketed for that series. - */ - series: Schema$HistogramSeries[]; - /** - * Whether horizontal divider lines should be displayed between items in each - * column. - */ - showItemDividers: boolean; -} -/** - * Allows you to organize the numeric values in a source data column into - * buckets of a constant size. All values from HistogramRule.start to - * HistogramRule.end will be placed into groups of size HistogramRule.interval. - * In addition, all values below HistogramRule.start will be placed in one - * group, and all values above HistogramRule.end will be placed in another. Only - * HistogramRule.interval is required, though if HistogramRule.start and - * HistogramRule.end are both provided, HistogramRule.start must be less than - * HistogramRule.end. For example, a pivot table showing average purchase amount - * by age that has 50+ rows: +-----+-------------------+ | Age | - * AVERAGE of Amount | +-----+-------------------+ | 16 | $27.13 | | 17 - * | $5.24 | | 18 | $20.15 | ... - * +-----+-------------------+ could be turned into a pivot table that looks - * like the one below by applying a histogram group rule with a - * HistogramRule.start of 25, an HistogramRule.interval of 20, and an - * HistogramRule.end of 65. +-------------+-------------------+ | - * Grouped Age | AVERAGE of Amount | +-------------+-------------------+ | - * < 25 | $19.34 | | 25-45 | $31.43 | - * | 45-65 | $35.87 | | > 65 | $27.55 - * | +-------------+-------------------+ | Grand Total | $29.12 | - * +-------------+-------------------+ - */ -export interface Schema$HistogramRule { - /** - * The maximum value at which items will be placed into buckets of constant - * size. Values above end will be lumped into a single bucket. This field is - * optional. - */ - end: number; - /** - * The size of the buckets that will be created. Must be positive. - */ - interval: number; - /** - * The minimum value at which items will be placed into buckets of constant - * size. Values below start will be lumped into a single bucket. This field is - * optional. - */ - start: number; -} -/** - * A histogram series containing the series color and data. - */ -export interface Schema$HistogramSeries { - /** - * The color of the column representing this series in each bucket. This field - * is optional. - */ - barColor: Schema$Color; - /** - * The data for this histogram series. - */ - data: Schema$ChartData; -} -/** - * Inserts rows or columns in a sheet at a particular index. - */ -export interface Schema$InsertDimensionRequest { - /** - * Whether dimension properties should be extended from the dimensions before - * or after the newly inserted dimensions. True to inherit from the dimensions - * before (in which case the start index must be greater than 0), and false to - * inherit from the dimensions after. For example, if row index 0 has red - * background and row index 1 has a green background, then inserting 2 rows at - * index 1 can inherit either the green or red background. If - * `inheritFromBefore` is true, the two new rows will be red (because the row - * before the insertion point was red), whereas if `inheritFromBefore` is - * false, the two new rows will be green (because the row after the insertion - * point was green). - */ - inheritFromBefore: boolean; - /** - * The dimensions to insert. Both the start and end indexes must be bounded. - */ - range: Schema$DimensionRange; -} -/** - * Inserts cells into a range, shifting the existing cells over or down. - */ -export interface Schema$InsertRangeRequest { - /** - * The range to insert new cells into. - */ - range: Schema$GridRange; - /** - * The dimension which will be shifted when inserting cells. If ROWS, existing - * cells will be shifted down. If COLUMNS, existing cells will be shifted - * right. - */ - shiftDimension: string; -} -/** - * A single interpolation point on a gradient conditional format. These pin the - * gradient color scale according to the color, type and value chosen. - */ -export interface Schema$InterpolationPoint { - /** - * The color this interpolation point should use. - */ - color: Schema$Color; - /** - * How the value should be interpreted. - */ - type: string; - /** - * The value this interpolation point uses. May be a formula. Unused if type - * is MIN or MAX. - */ - value: string; -} -/** - * Settings to control how circular dependencies are resolved with iterative - * calculation. - */ -export interface Schema$IterativeCalculationSettings { - /** - * When iterative calculation is enabled and successive results differ by less - * than this threshold value, the calculation rounds stop. - */ - convergenceThreshold: number; - /** - * When iterative calculation is enabled, the maximum number of calculation - * rounds to perform. - */ - maxIterations: number; -} -/** - * Properties that describe the style of a line. - */ -export interface Schema$LineStyle { - /** - * The dash type of the line. - */ - type: string; - /** - * The thickness of the line, in px. - */ - width: number; -} -/** - * Allows you to manually organize the values in a source data column into - * buckets with names of your choosing. For example, a pivot table that - * aggregates population by state: +-------+-------------------+ | - * State | SUM of Population | +-------+-------------------+ | AK | - * 0.7 | | AL | 4.8 | | AR | 2.9 | ... - * +-------+-------------------+ could be turned into a pivot table that - * aggregates population by time zone by providing a list of groups (e.g. - * groupName = 'Central', items = ['AL', 'AR', - * 'IA', ...]) to a manual group rule. Note that a similar effect could - * be achieved by adding a time zone column to the source data and adjusting the - * pivot table. +-----------+-------------------+ | Time Zone | SUM of - * Population | +-----------+-------------------+ | Central | 106.3 | - * | Eastern | 151.9 | | Mountain | 17.4 | ... - * +-----------+-------------------+ - */ -export interface Schema$ManualRule { - /** - * The list of group names and the corresponding items from the source data - * that map to each group name. - */ - groups: Schema$ManualRuleGroup[]; -} -/** - * A group name and a list of items from the source data that should be placed - * in the group with this name. - */ -export interface Schema$ManualRuleGroup { - /** - * The group name, which must be a string. Each group in a given ManualRule - * must have a unique group name. - */ - groupName: Schema$ExtendedValue; - /** - * The items in the source data that should be placed into this group. Each - * item may be a string, number, or boolean. Items may appear in at most one - * group within a given ManualRule. Items that do not appear in any group will - * appear on their own. - */ - items: Schema$ExtendedValue[]; -} -/** - * A developer metadata entry and the data filters specified in the original - * request that matched it. - */ -export interface Schema$MatchedDeveloperMetadata { - /** - * All filters matching the returned developer metadata. - */ - dataFilters: Schema$DataFilter[]; - /** - * The developer metadata matching the specified filters. - */ - developerMetadata: Schema$DeveloperMetadata; -} -/** - * A value range that was matched by one or more data filers. - */ -export interface Schema$MatchedValueRange { - /** - * The DataFilters from the request that matched the range of values. - */ - dataFilters: Schema$DataFilter[]; - /** - * The values matched by the DataFilter. - */ - valueRange: Schema$ValueRange; -} -/** - * Merges all cells in the range. - */ -export interface Schema$MergeCellsRequest { - /** - * How the cells should be merged. - */ - mergeType: string; - /** - * The range of cells to merge. - */ - range: Schema$GridRange; -} -/** - * Moves one or more rows or columns. - */ -export interface Schema$MoveDimensionRequest { - /** - * The zero-based start index of where to move the source data to, based on - * the coordinates *before* the source data is removed from the grid. Existing - * data will be shifted down or right (depending on the dimension) to make - * room for the moved dimensions. The source dimensions are removed from the - * grid, so the the data may end up in a different index than specified. For - * example, given `A1..A5` of `0, 1, 2, 3, 4` and wanting to move - * `"1"` and `"2"` to between `"3"` and - * `"4"`, the source would be `ROWS [1..3)`,and the destination - * index would be `"4"` (the zero-based index of row 5). The end - * result would be `A1..A5` of `0, 3, 1, 2, 4`. - */ - destinationIndex: number; - /** - * The source dimensions to move. - */ - source: Schema$DimensionRange; -} -/** - * A named range. - */ -export interface Schema$NamedRange { - /** - * The name of the named range. - */ - name: string; - /** - * The ID of the named range. - */ - namedRangeId: string; - /** - * The range this represents. - */ - range: Schema$GridRange; -} -/** - * The number format of a cell. - */ -export interface Schema$NumberFormat { - /** - * Pattern string used for formatting. If not set, a default pattern based on - * the user's locale will be used if necessary for the given type. See the - * [Date and Number Formats guide](/sheets/api/guides/formats) for more - * information about the supported patterns. - */ - pattern: string; - /** - * The type of the number format. When writing, this field must be set. - */ - type: string; -} -/** - * An <a href="/chart/interactive/docs/gallery/orgchart">org - * chart</a>. Org charts require a unique set of labels in labels and may - * optionally include parent_labels and tooltips. parent_labels contain, for - * each node, the label identifying the parent node. tooltips contain, for each - * node, an optional tooltip. For example, to describe an OrgChart with Alice - * as the CEO, Bob as the President (reporting to Alice) and Cathy as VP of - * Sales (also reporting to Alice), have labels contain "Alice", - * "Bob", "Cathy", parent_labels contain "", - * "Alice", "Alice" and tooltips contain "CEO", - * "President", "VP Sales". - */ -export interface Schema$OrgChartSpec { - /** - * The data containing the labels for all the nodes in the chart. Labels must - * be unique. - */ - labels: Schema$ChartData; - /** - * The color of the org chart nodes. - */ - nodeColor: Schema$Color; - /** - * The size of the org chart nodes. - */ - nodeSize: string; - /** - * The data containing the label of the parent for the corresponding node. A - * blank value indicates that the node has no parent and is a top-level node. - * This field is optional. - */ - parentLabels: Schema$ChartData; - /** - * The color of the selected org chart nodes. - */ - selectedNodeColor: Schema$Color; - /** - * The data containing the tooltip for the corresponding node. A blank value - * results in no tooltip being displayed for the node. This field is optional. - */ - tooltips: Schema$ChartData; -} -/** - * The location an object is overlaid on top of a grid. - */ -export interface Schema$OverlayPosition { - /** - * The cell the object is anchored to. - */ - anchorCell: Schema$GridCoordinate; - /** - * The height of the object, in pixels. Defaults to 371. - */ - heightPixels: number; - /** - * The horizontal offset, in pixels, that the object is offset from the anchor - * cell. - */ - offsetXPixels: number; - /** - * The vertical offset, in pixels, that the object is offset from the anchor - * cell. - */ - offsetYPixels: number; - /** - * The width of the object, in pixels. Defaults to 600. - */ - widthPixels: number; -} -/** - * The amount of padding around the cell, in pixels. When updating padding, - * every field must be specified. - */ -export interface Schema$Padding { - /** - * The bottom padding of the cell. - */ - bottom: number; - /** - * The left padding of the cell. - */ - left: number; - /** - * The right padding of the cell. - */ - right: number; - /** - * The top padding of the cell. - */ - top: number; -} -/** - * Inserts data into the spreadsheet starting at the specified coordinate. - */ -export interface Schema$PasteDataRequest { - /** - * The coordinate at which the data should start being inserted. - */ - coordinate: Schema$GridCoordinate; - /** - * The data to insert. - */ - data: string; - /** - * The delimiter in the data. - */ - delimiter: string; - /** - * True if the data is HTML. - */ - html: boolean; - /** - * How the data should be pasted. - */ - type: string; -} -/** - * A <a href="/chart/interactive/docs/gallery/piechart">pie - * chart</a>. - */ -export interface Schema$PieChartSpec { - /** - * The data that covers the domain of the pie chart. - */ - domain: Schema$ChartData; - /** - * Where the legend of the pie chart should be drawn. - */ - legendPosition: string; - /** - * The size of the hole in the pie chart. - */ - pieHole: number; - /** - * The data that covers the one and only series of the pie chart. - */ - series: Schema$ChartData; - /** - * True if the pie is three dimensional. - */ - threeDimensional: boolean; -} -/** - * Criteria for showing/hiding rows in a pivot table. - */ -export interface Schema$PivotFilterCriteria { - /** - * Values that should be included. Values not listed here are excluded. - */ - visibleValues: string[]; -} -/** - * A single grouping (either row or column) in a pivot table. - */ -export interface Schema$PivotGroup { - /** - * The group rule to apply to this row/column group. - */ - groupRule: Schema$PivotGroupRule; - /** - * The labels to use for the row/column groups which can be customized. For - * example, in the following pivot table, the row label is `Region` (which - * could be renamed to `State`) and the column label is `Product` (which could - * be renamed `Item`). Pivot tables created before December 2017 do not have - * header labels. If you'd like to add header labels to an existing pivot - * table, please delete the existing pivot table and then create a new pivot - * table with same parameters. +--------------+---------+-------+ | - * SUM of Units | Product | | | Region | Pen | Paper | - * +--------------+---------+-------+ | New York | 345 | 98 | - * | Oregon | 234 | 123 | | Tennessee | 531 | 415 | - * +--------------+---------+-------+ | Grand Total | 1110 | 636 | - * +--------------+---------+-------+ - */ - label: string; - /** - * True if the headings in this pivot group should be repeated. This is only - * valid for row groupings and will be ignored by columns. By default, we - * minimize repitition of headings by not showing higher level headings where - * they are the same. For example, even though the third row below corresponds - * to "Q1 Mar", "Q1" is not shown because it is redundant - * with previous rows. Setting repeat_headings to true would cause - * "Q1" to be repeated for "Feb" and "Mar". - * +--------------+ | Q1 | Jan | | | Feb | | | - * Mar | +--------+-----+ | Q1 Total | +--------------+ - */ - repeatHeadings: boolean; - /** - * True if the pivot table should include the totals for this grouping. - */ - showTotals: boolean; - /** - * The order the values in this group should be sorted. - */ - sortOrder: string; - /** - * The column offset of the source range that this grouping is based on. For - * example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means - * this group refers to column `C`, whereas the offset `1` would refer to - * column `D`. - */ - sourceColumnOffset: number; - /** - * The bucket of the opposite pivot group to sort by. If not specified, - * sorting is alphabetical by this group's values. - */ - valueBucket: Schema$PivotGroupSortValueBucket; - /** - * Metadata about values in the grouping. - */ - valueMetadata: Schema$PivotGroupValueMetadata[]; -} -/** - * An optional setting on a PivotGroup that defines buckets for the values in - * the source data column rather than breaking out each individual value. Only - * one PivotGroup with a group rule may be added for each column in the source - * data, though on any given column you may add both a PivotGroup that has a - * rule and a PivotGroup that does not. - */ -export interface Schema$PivotGroupRule { - /** - * A HistogramRule. - */ - histogramRule: Schema$HistogramRule; - /** - * A ManualRule. - */ - manualRule: Schema$ManualRule; -} -/** - * Information about which values in a pivot group should be used for sorting. - */ -export interface Schema$PivotGroupSortValueBucket { - /** - * Determines the bucket from which values are chosen to sort. For example, - * in a pivot table with one row group & two column groups, the row group - * can list up to two values. The first value corresponds to a value within - * the first column group, and the second value corresponds to a value in the - * second column group. If no values are listed, this would indicate that the - * row should be sorted according to the "Grand Total" over the - * column groups. If a single value is listed, this would correspond to using - * the "Total" of that bucket. - */ - buckets: Schema$ExtendedValue[]; - /** - * The offset in the PivotTable.values list which the values in this grouping - * should be sorted by. - */ - valuesIndex: number; -} -/** - * Metadata about a value in a pivot grouping. - */ -export interface Schema$PivotGroupValueMetadata { - /** - * True if the data corresponding to the value is collapsed. - */ - collapsed: boolean; - /** - * The calculated value the metadata corresponds to. (Note that formulaValue - * is not valid, because the values will be calculated.) - */ - value: Schema$ExtendedValue; -} -/** - * A pivot table. - */ -export interface Schema$PivotTable { - /** - * Each column grouping in the pivot table. - */ - columns: Schema$PivotGroup[]; - /** - * An optional mapping of filters per source column offset. The filters will - * be applied before aggregating data into the pivot table. The map's key - * is the column offset of the source range that you want to filter, and the - * value is the criteria for that column. For example, if the source was - * `C10:E15`, a key of `0` will have the filter for column `C`, whereas the - * key `1` is for column `D`. - */ - criteria: any; - /** - * Each row grouping in the pivot table. - */ - rows: Schema$PivotGroup[]; - /** - * The range the pivot table is reading data from. - */ - source: Schema$GridRange; - /** - * Whether values should be listed horizontally (as columns) or vertically (as - * rows). - */ - valueLayout: string; - /** - * A list of values to include in the pivot table. - */ - values: Schema$PivotValue[]; -} -/** - * The definition of how a value in a pivot table should be calculated. - */ -export interface Schema$PivotValue { - /** - * If specified, indicates that pivot values should be displayed as the result - * of a calculation with another pivot value. For example, if - * calculated_display_type is specified as PERCENT_OF_GRAND_TOTAL, all the - * pivot values will be displayed as the percentage of the grand total. In the - * Sheets UI, this is referred to as "Show As" in the value section - * of a pivot table. - */ - calculatedDisplayType: string; - /** - * A custom formula to calculate the value. The formula must start with an - * `=` character. - */ - formula: string; - /** - * A name to use for the value. - */ - name: string; - /** - * The column offset of the source range that this value reads from. For - * example, if the source was `C10:E15`, a `sourceColumnOffset` of `0` means - * this value refers to column `C`, whereas the offset `1` would refer to - * column `D`. - */ - sourceColumnOffset: number; - /** - * A function to summarize the value. If formula is set, the only supported - * values are SUM and CUSTOM. If sourceColumnOffset is set, then `CUSTOM` is - * not supported. - */ - summarizeFunction: string; -} -/** - * A protected range. - */ -export interface Schema$ProtectedRange { - /** - * The description of this protected range. - */ - description: string; - /** - * The users and groups with edit access to the protected range. This field is - * only visible to users with edit access to the protected range and the - * document. Editors are not supported with warning_only protection. - */ - editors: Schema$Editors; - /** - * The named range this protected range is backed by, if any. When writing, - * only one of range or named_range_id may be set. - */ - namedRangeId: string; - /** - * The ID of the protected range. This field is read-only. - */ - protectedRangeId: number; - /** - * The range that is being protected. The range may be fully unbounded, in - * which case this is considered a protected sheet. When writing, only one of - * range or named_range_id may be set. - */ - range: Schema$GridRange; - /** - * True if the user who requested this protected range can edit the protected - * area. This field is read-only. - */ - requestingUserCanEdit: boolean; - /** - * The list of unprotected ranges within a protected sheet. Unprotected ranges - * are only supported on protected sheets. - */ - unprotectedRanges: Schema$GridRange[]; - /** - * True if this protected range will show a warning when editing. - * Warning-based protection means that every user can edit data in the - * protected range, except editing will prompt a warning asking the user to - * confirm the edit. When writing: if this field is true, then editors is - * ignored. Additionally, if this field is changed from true to false and the - * `editors` field is not set (nor included in the field mask), then the - * editors will be set to all the editors in the document. - */ - warningOnly: boolean; -} -/** - * Randomizes the order of the rows in a range. - */ -export interface Schema$RandomizeRangeRequest { - /** - * The range to randomize. - */ - range: Schema$GridRange; -} -/** - * Updates all cells in the range to the values in the given Cell object. Only - * the fields listed in the fields field are updated; others are unchanged. If - * writing a cell with a formula, the formula's ranges will automatically - * increment for each field in the range. For example, if writing a cell with - * formula `=A1` into range B2:C4, B2 would be `=A1`, B3 would be `=A2`, B4 - * would be `=A3`, C2 would be `=B1`, C3 would be `=B2`, C4 would be `=B3`. To - * keep the formula's ranges static, use the `$` indicator. For example, use - * the formula `=$A$1` to prevent both the row and the column from incrementing. - */ -export interface Schema$RepeatCellRequest { - /** - * The data to write. - */ - cell: Schema$CellData; - /** - * The fields that should be updated. At least one field must be specified. - * The root `cell` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The range to repeat the cell in. - */ - range: Schema$GridRange; -} -/** - * A single kind of update to apply to a spreadsheet. - */ -export interface Schema$Request { - /** - * Adds a new banded range - */ - addBanding: Schema$AddBandingRequest; - /** - * Adds a chart. - */ - addChart: Schema$AddChartRequest; - /** - * Adds a new conditional format rule. - */ - addConditionalFormatRule: Schema$AddConditionalFormatRuleRequest; - /** - * Adds a filter view. - */ - addFilterView: Schema$AddFilterViewRequest; - /** - * Adds a named range. - */ - addNamedRange: Schema$AddNamedRangeRequest; - /** - * Adds a protected range. - */ - addProtectedRange: Schema$AddProtectedRangeRequest; - /** - * Adds a sheet. - */ - addSheet: Schema$AddSheetRequest; - /** - * Appends cells after the last row with data in a sheet. - */ - appendCells: Schema$AppendCellsRequest; - /** - * Appends dimensions to the end of a sheet. - */ - appendDimension: Schema$AppendDimensionRequest; - /** - * Automatically fills in more data based on existing data. - */ - autoFill: Schema$AutoFillRequest; - /** - * Automatically resizes one or more dimensions based on the contents of the - * cells in that dimension. - */ - autoResizeDimensions: Schema$AutoResizeDimensionsRequest; - /** - * Clears the basic filter on a sheet. - */ - clearBasicFilter: Schema$ClearBasicFilterRequest; - /** - * Copies data from one area and pastes it to another. - */ - copyPaste: Schema$CopyPasteRequest; - /** - * Creates new developer metadata - */ - createDeveloperMetadata: Schema$CreateDeveloperMetadataRequest; - /** - * Cuts data from one area and pastes it to another. - */ - cutPaste: Schema$CutPasteRequest; - /** - * Removes a banded range - */ - deleteBanding: Schema$DeleteBandingRequest; - /** - * Deletes an existing conditional format rule. - */ - deleteConditionalFormatRule: Schema$DeleteConditionalFormatRuleRequest; - /** - * Deletes developer metadata - */ - deleteDeveloperMetadata: Schema$DeleteDeveloperMetadataRequest; - /** - * Deletes rows or columns in a sheet. - */ - deleteDimension: Schema$DeleteDimensionRequest; - /** - * Deletes an embedded object (e.g, chart, image) in a sheet. - */ - deleteEmbeddedObject: Schema$DeleteEmbeddedObjectRequest; - /** - * Deletes a filter view from a sheet. - */ - deleteFilterView: Schema$DeleteFilterViewRequest; - /** - * Deletes a named range. - */ - deleteNamedRange: Schema$DeleteNamedRangeRequest; - /** - * Deletes a protected range. - */ - deleteProtectedRange: Schema$DeleteProtectedRangeRequest; - /** - * Deletes a range of cells from a sheet, shifting the remaining cells. - */ - deleteRange: Schema$DeleteRangeRequest; - /** - * Deletes a sheet. - */ - deleteSheet: Schema$DeleteSheetRequest; - /** - * Duplicates a filter view. - */ - duplicateFilterView: Schema$DuplicateFilterViewRequest; - /** - * Duplicates a sheet. - */ - duplicateSheet: Schema$DuplicateSheetRequest; - /** - * Finds and replaces occurrences of some text with other text. - */ - findReplace: Schema$FindReplaceRequest; - /** - * Inserts new rows or columns in a sheet. - */ - insertDimension: Schema$InsertDimensionRequest; - /** - * Inserts new cells in a sheet, shifting the existing cells. - */ - insertRange: Schema$InsertRangeRequest; - /** - * Merges cells together. - */ - mergeCells: Schema$MergeCellsRequest; - /** - * Moves rows or columns to another location in a sheet. - */ - moveDimension: Schema$MoveDimensionRequest; - /** - * Pastes data (HTML or delimited) into a sheet. - */ - pasteData: Schema$PasteDataRequest; - /** - * Randomizes the order of the rows in a range. - */ - randomizeRange: Schema$RandomizeRangeRequest; - /** - * Repeats a single cell across a range. - */ - repeatCell: Schema$RepeatCellRequest; - /** - * Sets the basic filter on a sheet. - */ - setBasicFilter: Schema$SetBasicFilterRequest; - /** - * Sets data validation for one or more cells. - */ - setDataValidation: Schema$SetDataValidationRequest; - /** - * Sorts data in a range. - */ - sortRange: Schema$SortRangeRequest; - /** - * Converts a column of text into many columns of text. - */ - textToColumns: Schema$TextToColumnsRequest; - /** - * Unmerges merged cells. - */ - unmergeCells: Schema$UnmergeCellsRequest; - /** - * Updates a banded range - */ - updateBanding: Schema$UpdateBandingRequest; - /** - * Updates the borders in a range of cells. - */ - updateBorders: Schema$UpdateBordersRequest; - /** - * Updates many cells at once. - */ - updateCells: Schema$UpdateCellsRequest; - /** - * Updates a chart's specifications. - */ - updateChartSpec: Schema$UpdateChartSpecRequest; - /** - * Updates an existing conditional format rule. - */ - updateConditionalFormatRule: Schema$UpdateConditionalFormatRuleRequest; - /** - * Updates an existing developer metadata entry - */ - updateDeveloperMetadata: Schema$UpdateDeveloperMetadataRequest; - /** - * Updates dimensions' properties. - */ - updateDimensionProperties: Schema$UpdateDimensionPropertiesRequest; - /** - * Updates an embedded object's (e.g. chart, image) position. - */ - updateEmbeddedObjectPosition: Schema$UpdateEmbeddedObjectPositionRequest; - /** - * Updates the properties of a filter view. - */ - updateFilterView: Schema$UpdateFilterViewRequest; - /** - * Updates a named range. - */ - updateNamedRange: Schema$UpdateNamedRangeRequest; - /** - * Updates a protected range. - */ - updateProtectedRange: Schema$UpdateProtectedRangeRequest; - /** - * Updates a sheet's properties. - */ - updateSheetProperties: Schema$UpdateSheetPropertiesRequest; - /** - * Updates the spreadsheet's properties. - */ - updateSpreadsheetProperties: Schema$UpdateSpreadsheetPropertiesRequest; -} -/** - * A single response from an update. - */ -export interface Schema$Response { - /** - * A reply from adding a banded range. - */ - addBanding: Schema$AddBandingResponse; - /** - * A reply from adding a chart. - */ - addChart: Schema$AddChartResponse; - /** - * A reply from adding a filter view. - */ - addFilterView: Schema$AddFilterViewResponse; - /** - * A reply from adding a named range. - */ - addNamedRange: Schema$AddNamedRangeResponse; - /** - * A reply from adding a protected range. - */ - addProtectedRange: Schema$AddProtectedRangeResponse; - /** - * A reply from adding a sheet. - */ - addSheet: Schema$AddSheetResponse; - /** - * A reply from creating a developer metadata entry. - */ - createDeveloperMetadata: Schema$CreateDeveloperMetadataResponse; - /** - * A reply from deleting a conditional format rule. - */ - deleteConditionalFormatRule: Schema$DeleteConditionalFormatRuleResponse; - /** - * A reply from deleting a developer metadata entry. - */ - deleteDeveloperMetadata: Schema$DeleteDeveloperMetadataResponse; - /** - * A reply from duplicating a filter view. - */ - duplicateFilterView: Schema$DuplicateFilterViewResponse; - /** - * A reply from duplicating a sheet. - */ - duplicateSheet: Schema$DuplicateSheetResponse; - /** - * A reply from doing a find/replace. - */ - findReplace: Schema$FindReplaceResponse; - /** - * A reply from updating a conditional format rule. - */ - updateConditionalFormatRule: Schema$UpdateConditionalFormatRuleResponse; - /** - * A reply from updating a developer metadata entry. - */ - updateDeveloperMetadata: Schema$UpdateDeveloperMetadataResponse; - /** - * A reply from updating an embedded object's position. - */ - updateEmbeddedObjectPosition: Schema$UpdateEmbeddedObjectPositionResponse; -} -/** - * Data about each cell in a row. - */ -export interface Schema$RowData { - /** - * The values in the row, one per column. - */ - values: Schema$CellData[]; -} -/** - * A request to retrieve all developer metadata matching the set of specified - * criteria. - */ -export interface Schema$SearchDeveloperMetadataRequest { - /** - * The data filters describing the criteria used to determine which - * DeveloperMetadata entries to return. DeveloperMetadata matching any of the - * specified filters will be included in the response. - */ - dataFilters: Schema$DataFilter[]; -} -/** - * A reply to a developer metadata search request. - */ -export interface Schema$SearchDeveloperMetadataResponse { - /** - * The metadata matching the criteria of the search request. - */ - matchedDeveloperMetadata: Schema$MatchedDeveloperMetadata[]; -} -/** - * Sets the basic filter associated with a sheet. - */ -export interface Schema$SetBasicFilterRequest { - /** - * The filter to set. - */ - filter: Schema$BasicFilter; -} -/** - * Sets a data validation rule to every cell in the range. To clear validation - * in a range, call this with no rule specified. - */ -export interface Schema$SetDataValidationRequest { - /** - * The range the data validation rule should apply to. - */ - range: Schema$GridRange; - /** - * The data validation rule to set on each cell in the range, or empty to - * clear the data validation in the range. - */ - rule: Schema$DataValidationRule; -} -/** - * A sheet in a spreadsheet. - */ -export interface Schema$Sheet { - /** - * The banded (i.e. alternating colors) ranges on this sheet. - */ - bandedRanges: Schema$BandedRange[]; - /** - * The filter on this sheet, if any. - */ - basicFilter: Schema$BasicFilter; - /** - * The specifications of every chart on this sheet. - */ - charts: Schema$EmbeddedChart[]; - /** - * The conditional format rules in this sheet. - */ - conditionalFormats: Schema$ConditionalFormatRule[]; - /** - * Data in the grid, if this is a grid sheet. The number of GridData objects - * returned is dependent on the number of ranges requested on this sheet. For - * example, if this is representing `Sheet1`, and the spreadsheet was - * requested with ranges `Sheet1!A1:C10` and `Sheet1!D15:E20`, then the first - * GridData will have a startRow/startColumn of `0`, while the second one will - * have `startRow 14` (zero-based row 15), and `startColumn 3` (zero-based - * column D). - */ - data: Schema$GridData[]; - /** - * The developer metadata associated with a sheet. - */ - developerMetadata: Schema$DeveloperMetadata[]; - /** - * The filter views in this sheet. - */ - filterViews: Schema$FilterView[]; - /** - * The ranges that are merged together. - */ - merges: Schema$GridRange[]; - /** - * The properties of the sheet. - */ - properties: Schema$SheetProperties; - /** - * The protected ranges in this sheet. - */ - protectedRanges: Schema$ProtectedRange[]; -} -/** - * Properties of a sheet. - */ -export interface Schema$SheetProperties { - /** - * Additional properties of the sheet if this sheet is a grid. (If the sheet - * is an object sheet, containing a chart or image, then this field will be - * absent.) When writing it is an error to set any grid properties on non-grid - * sheets. - */ - gridProperties: Schema$GridProperties; - /** - * True if the sheet is hidden in the UI, false if it's visible. - */ - hidden: boolean; - /** - * The index of the sheet within the spreadsheet. When adding or updating - * sheet properties, if this field is excluded then the sheet will be added or - * moved to the end of the sheet list. When updating sheet indices or - * inserting sheets, movement is considered in "before the move" - * indexes. For example, if there were 3 sheets (S1, S2, S3) in order to move - * S1 ahead of S2 the index would have to be set to 2. A sheet index update - * request will be ignored if the requested index is identical to the sheets - * current index or if the requested new index is equal to the current sheet - * index + 1. - */ - index: number; - /** - * True if the sheet is an RTL sheet instead of an LTR sheet. - */ - rightToLeft: boolean; - /** - * The ID of the sheet. Must be non-negative. This field cannot be changed - * once set. - */ - sheetId: number; - /** - * The type of sheet. Defaults to GRID. This field cannot be changed once set. - */ - sheetType: string; - /** - * The color of the tab in the UI. - */ - tabColor: Schema$Color; - /** - * The name of the sheet. - */ - title: string; -} -/** - * Sorts data in rows based on a sort order per column. - */ -export interface Schema$SortRangeRequest { - /** - * The range to sort. - */ - range: Schema$GridRange; - /** - * The sort order per column. Later specifications are used when values are - * equal in the earlier specifications. - */ - sortSpecs: Schema$SortSpec[]; -} -/** - * A sort order associated with a specific column or row. - */ -export interface Schema$SortSpec { - /** - * The dimension the sort should be applied to. - */ - dimensionIndex: number; - /** - * The order data should be sorted. - */ - sortOrder: string; -} -/** - * A combination of a source range and how to extend that source. - */ -export interface Schema$SourceAndDestination { - /** - * The dimension that data should be filled into. - */ - dimension: string; - /** - * The number of rows or columns that data should be filled into. Positive - * numbers expand beyond the last row or last column of the source. Negative - * numbers expand before the first row or first column of the source. - */ - fillLength: number; - /** - * The location of the data to use as the source of the autofill. - */ - source: Schema$GridRange; -} -/** - * Resource that represents a spreadsheet. - */ -export interface Schema$Spreadsheet { - /** - * The developer metadata associated with a spreadsheet. - */ - developerMetadata: Schema$DeveloperMetadata[]; - /** - * The named ranges defined in a spreadsheet. - */ - namedRanges: Schema$NamedRange[]; - /** - * Overall properties of a spreadsheet. - */ - properties: Schema$SpreadsheetProperties; - /** - * The sheets that are part of a spreadsheet. - */ - sheets: Schema$Sheet[]; - /** - * The ID of the spreadsheet. This field is read-only. - */ - spreadsheetId: string; - /** - * The url of the spreadsheet. This field is read-only. - */ - spreadsheetUrl: string; -} -/** - * Properties of a spreadsheet. - */ -export interface Schema$SpreadsheetProperties { - /** - * The amount of time to wait before volatile functions are recalculated. - */ - autoRecalc: string; - /** - * The default format of all cells in the spreadsheet. - * CellData.effectiveFormat will not be set if the cell's format is equal - * to this default format. This field is read-only. - */ - defaultFormat: Schema$CellFormat; - /** - * Determines whether and how circular references are resolved with iterative - * calculation. Absence of this field means that circular references will - * result in calculation errors. - */ - iterativeCalculationSettings: Schema$IterativeCalculationSettings; - /** - * The locale of the spreadsheet in one of the following formats: * an ISO - * 639-1 language code such as `en` * an ISO 639-2 language code such as - * `fil`, if no 639-1 code exists * a combination of the ISO language code - * and country code, such as `en_US` Note: when updating this field, not all - * locales/languages are supported. - */ - locale: string; - /** - * The time zone of the spreadsheet, in CLDR format such as - * `America/New_York`. If the time zone isn't recognized, this may be a - * custom time zone such as `GMT-07:00`. - */ - timeZone: string; - /** - * The title of the spreadsheet. - */ - title: string; -} -/** - * The format of a run of text in a cell. Absent values indicate that the field - * isn't specified. - */ -export interface Schema$TextFormat { - /** - * True if the text is bold. - */ - bold: boolean; - /** - * The font family. - */ - fontFamily: string; - /** - * The size of the font. - */ - fontSize: number; - /** - * The foreground color of the text. - */ - foregroundColor: Schema$Color; - /** - * True if the text is italicized. - */ - italic: boolean; - /** - * True if the text has a strikethrough. - */ - strikethrough: boolean; - /** - * True if the text is underlined. - */ - underline: boolean; -} -/** - * A run of a text format. The format of this run continues until the start - * index of the next run. When updating, all fields must be set. - */ -export interface Schema$TextFormatRun { - /** - * The format of this run. Absent values inherit the cell's format. - */ - format: Schema$TextFormat; - /** - * The character index where this run starts. - */ - startIndex: number; -} -/** - * Position settings for text. - */ -export interface Schema$TextPosition { - /** - * Horizontal alignment setting for the piece of text. - */ - horizontalAlignment: string; -} -/** - * The rotation applied to text in a cell. - */ -export interface Schema$TextRotation { - /** - * The angle between the standard orientation and the desired orientation. - * Measured in degrees. Valid values are between -90 and 90. Positive angles - * are angled upwards, negative are angled downwards. Note: For LTR text - * direction positive angles are in the counterclockwise direction, whereas - * for RTL they are in the clockwise direction - */ - angle: number; - /** - * If true, text reads top to bottom, but the orientation of individual - * characters is unchanged. For example: | V | | e | | r | | - * t | | i | | c | | a | | l | - */ - vertical: boolean; -} -/** - * Splits a column of text into multiple columns, based on a delimiter in each - * cell. - */ -export interface Schema$TextToColumnsRequest { - /** - * The delimiter to use. Used only if delimiterType is CUSTOM. - */ - delimiter: string; - /** - * The delimiter type to use. - */ - delimiterType: string; - /** - * The source data range. This must span exactly one column. - */ - source: Schema$GridRange; -} -/** - * A color scale for a treemap chart. - */ -export interface Schema$TreemapChartColorScale { - /** - * The background color for cells with a color value greater than or equal to - * maxValue. Defaults to #109618 if not specified. - */ - maxValueColor: Schema$Color; - /** - * The background color for cells with a color value at the midpoint between - * minValue and maxValue. Defaults to #efe6dc if not specified. - */ - midValueColor: Schema$Color; - /** - * The background color for cells with a color value less than or equal to - * minValue. Defaults to #dc3912 if not specified. - */ - minValueColor: Schema$Color; - /** - * The background color for cells that have no color data associated with - * them. Defaults to #000000 if not specified. - */ - noDataColor: Schema$Color; -} -/** - * A <a href="/chart/interactive/docs/gallery/treemap">Treemap - * chart</a>. - */ -export interface Schema$TreemapChartSpec { - /** - * The data that determines the background color of each treemap data cell. - * This field is optional. If not specified, size_data will be used to - * determine background colors. If specified, the data is expected to be - * numeric. color_scale will determine how the values in this data map to data - * cell background colors. - */ - colorData: Schema$ChartData; - /** - * The color scale for data cells in the treemap chart. Data cells are - * assigned colors based on their color values. These color values come from - * color_data, or from size_data if color_data is not specified. Cells with - * color values less than or equal to min_value will have minValueColor as - * their background color. Cells with color values greater than or equal to - * max_value will have maxValueColor as their background color. Cells with - * color values between min_value and max_value will have background colors on - * a gradient between minValueColor and maxValueColor, the midpoint of the - * gradient being midValueColor. Cells with missing or non-numeric color - * values will have noDataColor as their background color. - */ - colorScale: Schema$TreemapChartColorScale; - /** - * The background color for header cells. - */ - headerColor: Schema$Color; - /** - * True to hide tooltips. - */ - hideTooltips: boolean; - /** - * The number of additional data levels beyond the labeled levels to be shown - * on the treemap chart. These levels are not interactive and are shown - * without their labels. Defaults to 0 if not specified. - */ - hintedLevels: number; - /** - * The data that contains the treemap cell labels. - */ - labels: Schema$ChartData; - /** - * The number of data levels to show on the treemap chart. These levels are - * interactive and are shown with their labels. Defaults to 2 if not - * specified. - */ - levels: number; - /** - * The maximum possible data value. Cells with values greater than this will - * have the same color as cells with this value. If not specified, defaults to - * the actual maximum value from color_data, or the maximum value from - * size_data if color_data is not specified. - */ - maxValue: number; - /** - * The minimum possible data value. Cells with values less than this will have - * the same color as cells with this value. If not specified, defaults to the - * actual minimum value from color_data, or the minimum value from size_data - * if color_data is not specified. - */ - minValue: number; - /** - * The data the contains the treemap cells' parent labels. - */ - parentLabels: Schema$ChartData; - /** - * The data that determines the size of each treemap data cell. This data is - * expected to be numeric. The cells corresponding to non-numeric or missing - * data will not be rendered. If color_data is not specified, this data will - * be used to determine data cell background colors as well. - */ - sizeData: Schema$ChartData; - /** - * The text format for all labels on the chart. - */ - textFormat: Schema$TextFormat; -} -/** - * Unmerges cells in the given range. - */ -export interface Schema$UnmergeCellsRequest { - /** - * The range within which all cells should be unmerged. If the range spans - * multiple merges, all will be unmerged. The range must not partially span - * any merge. - */ - range: Schema$GridRange; -} -/** - * Updates properties of the supplied banded range. - */ -export interface Schema$UpdateBandingRequest { - /** - * The banded range to update with the new properties. - */ - bandedRange: Schema$BandedRange; - /** - * The fields that should be updated. At least one field must be specified. - * The root `bandedRange` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; -} -/** - * Updates the borders of a range. If a field is not set in the request, that - * means the border remains as-is. For example, with two subsequent - * UpdateBordersRequest: 1. range: A1:A5 `{ top: RED, bottom: WHITE }` 2. - * range: A1:A5 `{ left: BLUE }` That would result in A1:A5 having a borders of - * `{ top: RED, bottom: WHITE, left: BLUE }`. If you want to clear a border, - * explicitly set the style to NONE. - */ -export interface Schema$UpdateBordersRequest { - /** - * The border to put at the bottom of the range. - */ - bottom: Schema$Border; - /** - * The horizontal border to put within the range. - */ - innerHorizontal: Schema$Border; - /** - * The vertical border to put within the range. - */ - innerVertical: Schema$Border; - /** - * The border to put at the left of the range. - */ - left: Schema$Border; - /** - * The range whose borders should be updated. - */ - range: Schema$GridRange; - /** - * The border to put at the right of the range. - */ - right: Schema$Border; - /** - * The border to put at the top of the range. - */ - top: Schema$Border; -} -/** - * Updates all cells in a range with new data. - */ -export interface Schema$UpdateCellsRequest { - /** - * The fields of CellData that should be updated. At least one field must be - * specified. The root is the CellData; 'row.values.' should not be - * specified. A single `"*"` can be used as short-hand for listing - * every field. - */ - fields: string; - /** - * The range to write data to. If the data in rows does not cover the entire - * requested range, the fields matching those set in fields will be cleared. - */ - range: Schema$GridRange; - /** - * The data to write. - */ - rows: Schema$RowData[]; - /** - * The coordinate to start writing data at. Any number of rows and columns - * (including a different number of columns per row) may be written. - */ - start: Schema$GridCoordinate; -} -/** - * Updates a chart's specifications. (This does not move or resize a chart. - * To move or resize a chart, use UpdateEmbeddedObjectPositionRequest.) - */ -export interface Schema$UpdateChartSpecRequest { - /** - * The ID of the chart to update. - */ - chartId: number; - /** - * The specification to apply to the chart. - */ - spec: Schema$ChartSpec; -} -/** - * Updates a conditional format rule at the given index, or moves a conditional - * format rule to another index. - */ -export interface Schema$UpdateConditionalFormatRuleRequest { - /** - * The zero-based index of the rule that should be replaced or moved. - */ - index: number; - /** - * The zero-based new index the rule should end up at. - */ - newIndex: number; - /** - * The rule that should replace the rule at the given index. - */ - rule: Schema$ConditionalFormatRule; - /** - * The sheet of the rule to move. Required if new_index is set, unused - * otherwise. - */ - sheetId: number; -} -/** - * The result of updating a conditional format rule. - */ -export interface Schema$UpdateConditionalFormatRuleResponse { - /** - * The index of the new rule. - */ - newIndex: number; - /** - * The new rule that replaced the old rule (if replacing), or the rule that - * was moved (if moved) - */ - newRule: Schema$ConditionalFormatRule; - /** - * The old index of the rule. Not set if a rule was replaced (because it is - * the same as new_index). - */ - oldIndex: number; - /** - * The old (deleted) rule. Not set if a rule was moved (because it is the same - * as new_rule). - */ - oldRule: Schema$ConditionalFormatRule; -} -/** - * A request to update properties of developer metadata. Updates the properties - * of the developer metadata selected by the filters to the values provided in - * the DeveloperMetadata resource. Callers must specify the properties they - * wish to update in the fields parameter, as well as specify at least one - * DataFilter matching the metadata they wish to update. - */ -export interface Schema$UpdateDeveloperMetadataRequest { - /** - * The filters matching the developer metadata entries to update. - */ - dataFilters: Schema$DataFilter[]; - /** - * The value that all metadata matched by the data filters will be updated to. - */ - developerMetadata: Schema$DeveloperMetadata; - /** - * The fields that should be updated. At least one field must be specified. - * The root `developerMetadata` is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - */ - fields: string; -} -/** - * The response from updating developer metadata. - */ -export interface Schema$UpdateDeveloperMetadataResponse { - /** - * The updated developer metadata. - */ - developerMetadata: Schema$DeveloperMetadata[]; -} -/** - * Updates properties of dimensions within the specified range. - */ -export interface Schema$UpdateDimensionPropertiesRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root `properties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * Properties to update. - */ - properties: Schema$DimensionProperties; - /** - * The rows or columns to update. - */ - range: Schema$DimensionRange; -} -/** - * Update an embedded object's position (such as a moving or resizing a - * chart or image). - */ -export interface Schema$UpdateEmbeddedObjectPositionRequest { - /** - * The fields of OverlayPosition that should be updated when setting a new - * position. Used only if newPosition.overlayPosition is set, in which case at - * least one field must be specified. The root `newPosition.overlayPosition` - * is implied and should not be specified. A single `"*"` can be - * used as short-hand for listing every field. - */ - fields: string; - /** - * An explicit position to move the embedded object to. If newPosition.sheetId - * is set, a new sheet with that ID will be created. If newPosition.newSheet - * is set to true, a new sheet will be created with an ID that will be chosen - * for you. - */ - newPosition: Schema$EmbeddedObjectPosition; - /** - * The ID of the object to moved. - */ - objectId: number; -} -/** - * The result of updating an embedded object's position. - */ -export interface Schema$UpdateEmbeddedObjectPositionResponse { - /** - * The new position of the embedded object. - */ - position: Schema$EmbeddedObjectPosition; -} -/** - * Updates properties of the filter view. - */ -export interface Schema$UpdateFilterViewRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root `filter` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The new properties of the filter view. - */ - filter: Schema$FilterView; -} -/** - * Updates properties of the named range with the specified namedRangeId. - */ -export interface Schema$UpdateNamedRangeRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root `namedRange` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The named range to update with the new properties. - */ - namedRange: Schema$NamedRange; -} -/** - * Updates an existing protected range with the specified protectedRangeId. - */ -export interface Schema$UpdateProtectedRangeRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root `protectedRange` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The protected range to update with the new properties. - */ - protectedRange: Schema$ProtectedRange; -} -/** - * Updates properties of the sheet with the specified sheetId. - */ -export interface Schema$UpdateSheetPropertiesRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root `properties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The properties to update. - */ - properties: Schema$SheetProperties; -} -/** - * Updates properties of a spreadsheet. - */ -export interface Schema$UpdateSpreadsheetPropertiesRequest { - /** - * The fields that should be updated. At least one field must be specified. - * The root 'properties' is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - */ - fields: string; - /** - * The properties to update. - */ - properties: Schema$SpreadsheetProperties; -} -/** - * The response when updating a range of values by a data filter in a - * spreadsheet. - */ -export interface Schema$UpdateValuesByDataFilterResponse { - /** - * The data filter that selected the range that was updated. - */ - dataFilter: Schema$DataFilter; - /** - * The number of cells updated. - */ - updatedCells: number; - /** - * The number of columns where at least one cell in the column was updated. - */ - updatedColumns: number; - /** - * The values of the cells in the range matched by the dataFilter after all - * updates were applied. This is only included if the request's - * `includeValuesInResponse` field was `true`. - */ - updatedData: Schema$ValueRange; - /** - * The range (in A1 notation) that updates were applied to. - */ - updatedRange: string; - /** - * The number of rows where at least one cell in the row was updated. - */ - updatedRows: number; -} -/** - * The response when updating a range of values in a spreadsheet. - */ -export interface Schema$UpdateValuesResponse { - /** - * The spreadsheet the updates were applied to. - */ - spreadsheetId: string; - /** - * The number of cells updated. - */ - updatedCells: number; - /** - * The number of columns where at least one cell in the column was updated. - */ - updatedColumns: number; - /** - * The values of the cells after updates were applied. This is only included - * if the request's `includeValuesInResponse` field was `true`. - */ - updatedData: Schema$ValueRange; - /** - * The range (in A1 notation) that updates were applied to. - */ - updatedRange: string; - /** - * The number of rows where at least one cell in the row was updated. - */ - updatedRows: number; -} -/** - * Data within a range of the spreadsheet. - */ -export interface Schema$ValueRange { - /** - * The major dimension of the values. For output, if the spreadsheet data is: - * `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` - * will return `[[1,2],[3,4]]`, whereas requesting - * `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. For - * input, with `range=A1:B2,majorDimension=ROWS` then `[[1,2],[3,4]]` will set - * `A1=1,B1=2,A2=3,B2=4`. With `range=A1:B2,majorDimension=COLUMNS` then - * `[[1,2],[3,4]]` will set `A1=1,B1=3,A2=2,B2=4`. When writing, if this - * field is not set, it defaults to ROWS. - */ - majorDimension: string; - /** - * The range the values cover, in A1 notation. For output, this range - * indicates the entire requested range, even though the values will exclude - * trailing rows and columns. When appending values, this field represents the - * range to search for a table, after which values will be appended. - */ - range: string; - /** - * The data that was read or to be written. This is an array of arrays, the - * outer array representing all the data and each inner array representing a - * major dimension. Each item in the inner array corresponds with one cell. - * For output, empty trailing rows and columns will not be included. For - * input, supported value types are: bool, string, and double. Null values - * will be skipped. To set a cell to an empty value, set the string value to - * an empty string. - */ - values: any[][]; -} -/** - * Styles for a waterfall chart column. - */ -export interface Schema$WaterfallChartColumnStyle { - /** - * The color of the column. - */ - color: Schema$Color; - /** - * The label of the column's legend. - */ - label: string; -} -/** - * A custom subtotal column for a waterfall chart series. - */ -export interface Schema$WaterfallChartCustomSubtotal { - /** - * True if the data point at subtotal_index is the subtotal. If false, the - * subtotal will be computed and appear after the data point. - */ - dataIsSubtotal: boolean; - /** - * A label for the subtotal column. - */ - label: string; - /** - * The 0-based index of a data point within the series. If data_is_subtotal is - * true, the data point at this index is the subtotal. Otherwise, the subtotal - * appears after the data point with this index. A series can have multiple - * subtotals at arbitrary indices, but subtotals do not affect the indices of - * the data points. For example, if a series has three data points, their - * indices will always be 0, 1, and 2, regardless of how many subtotals exist - * on the series or what data points they are associated with. - */ - subtotalIndex: number; -} -/** - * The domain of a waterfall chart. - */ -export interface Schema$WaterfallChartDomain { - /** - * The data of the WaterfallChartDomain. - */ - data: Schema$ChartData; - /** - * True to reverse the order of the domain values (horizontal axis). - */ - reversed: boolean; -} -/** - * A single series of data for a waterfall chart. - */ -export interface Schema$WaterfallChartSeries { - /** - * Custom subtotal columns appearing in this series. The order in which - * subtotals are defined is not significant. Only one subtotal may be defined - * for each data point. - */ - customSubtotals: Schema$WaterfallChartCustomSubtotal[]; - /** - * The data being visualized in this series. - */ - data: Schema$ChartData; - /** - * True to hide the subtotal column from the end of the series. By default, a - * subtotal column will appear at the end of each series. Setting this field - * to true will hide that subtotal column for this series. - */ - hideTrailingSubtotal: boolean; - /** - * Styles for all columns in this series with negative values. - */ - negativeColumnsStyle: Schema$WaterfallChartColumnStyle; - /** - * Styles for all columns in this series with positive values. - */ - positiveColumnsStyle: Schema$WaterfallChartColumnStyle; - /** - * Styles for all subtotal columns in this series. - */ - subtotalColumnsStyle: Schema$WaterfallChartColumnStyle; -} -/** - * A waterfall chart. - */ -export interface Schema$WaterfallChartSpec { - /** - * The line style for the connector lines. - */ - connectorLineStyle: Schema$LineStyle; - /** - * The domain data (horizontal axis) for the waterfall chart. - */ - domain: Schema$WaterfallChartDomain; - /** - * True to interpret the first value as a total. - */ - firstValueIsTotal: boolean; - /** - * True to hide connector lines between columns. - */ - hideConnectorLines: boolean; - /** - * The data this waterfall chart is visualizing. - */ - series: Schema$WaterfallChartSeries[]; - /** - * The stacked type. - */ - stackedType: string; -} - -export class Resource$Spreadsheets { - root: Sheets; - developerMetadata: Resource$Spreadsheets$Developermetadata; - sheets: Resource$Spreadsheets$Sheets; - values: Resource$Spreadsheets$Values; - constructor(root: Sheets) { - this.root = root; - this.getRoot.bind(this); - this.developerMetadata = new Resource$Spreadsheets$Developermetadata(root); - this.sheets = new Resource$Spreadsheets$Sheets(root); - this.values = new Resource$Spreadsheets$Values(root); - } - - getRoot() { - return this.root; - } - - - /** - * sheets.spreadsheets.batchUpdate - * @desc Applies one or more updates to the spreadsheet. Each request is - * validated before being applied. If any request is not valid then the entire - * request will fail and nothing will be applied. Some requests have replies - * to give you some information about how they are applied. The replies will - * mirror the requests. For example, if you applied 4 updates and the 3rd one - * had a reply, then the response will have 2 empty replies, the actual reply, - * and another empty reply, in that order. Due to the collaborative nature of - * spreadsheets, it is not guaranteed that the spreadsheet will reflect - * exactly your changes after this completes, however it is guaranteed that - * the updates in the request will be applied together atomically. Your - * changes may be altered with respect to collaborator changes. If there are - * no collaborators, the spreadsheet should reflect your changes. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to apply the updates to. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // A list of updates to apply to the spreadsheet. - * // Requests will be applied in the order they are specified. - * // If any request is not valid, no requests will be applied. - * requests: [], // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.batchUpdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The spreadsheet to apply the updates to. - * @param {().BatchUpdateSpreadsheetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * sheets.spreadsheets.create - * @desc Creates a spreadsheet, returning the newly created spreadsheet. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Spreadsheet} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A waterfall chart. + */ + export interface Schema$WaterfallChartSpec { + /** + * The line style for the connector lines. + */ + connectorLineStyle: Schema$LineStyle; + /** + * The domain data (horizontal axis) for the waterfall chart. + */ + domain: Schema$WaterfallChartDomain; + /** + * True to interpret the first value as a total. + */ + firstValueIsTotal: boolean; + /** + * True to hide connector lines between columns. + */ + hideConnectorLines: boolean; + /** + * The data this waterfall chart is visualizing. + */ + series: Schema$WaterfallChartSeries[]; + /** + * The stacked type. + */ + stackedType: string; } - - /** - * sheets.spreadsheets.get - * @desc Returns the spreadsheet at the given ID. The caller must specify the - * spreadsheet ID. By default, data within grids will not be returned. You - * can include grid data one of two ways: * Specify a field mask listing your - * desired fields using the `fields` URL parameter in HTTP * Set the - * includeGridData URL parameter to true. If a field mask is set, the - * `includeGridData` parameter is ignored For large spreadsheets, it is - * recommended to retrieve only the specific fields of the spreadsheet that - * you want. To retrieve only subsets of the spreadsheet, use the ranges URL - * parameter. Multiple ranges can be specified. Limiting the range will - * return only the portions of the spreadsheet that intersect the requested - * ranges. Ranges are specified using A1 notation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to request. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The ranges to retrieve from the spreadsheet. - * ranges: [], // TODO: Update placeholder value. - * - * // True if grid data should be returned. - * // This parameter is ignored if a field mask was set in the request. - * includeGridData: false, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeGridData True if grid data should be returned. This parameter is ignored if a field mask was set in the request. - * @param {string=} params.ranges The ranges to retrieve from the spreadsheet. - * @param {string} params.spreadsheetId The spreadsheet to request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Spreadsheets { + root: Sheets; + developerMetadata: Resource$Spreadsheets$Developermetadata; + sheets: Resource$Spreadsheets$Sheets; + values: Resource$Spreadsheets$Values; + constructor(root: Sheets) { + this.root = root; + this.getRoot.bind(this); + this.developerMetadata = + new Resource$Spreadsheets$Developermetadata(root); + this.sheets = new Resource$Spreadsheets$Sheets(root); + this.values = new Resource$Spreadsheets$Values(root); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * sheets.spreadsheets.getByDataFilter - * @desc Returns the spreadsheet at the given ID. The caller must specify the - * spreadsheet ID. This method differs from GetSpreadsheet in that it allows - * selecting which subsets of spreadsheet data to return by specifying a - * dataFilters parameter. Multiple DataFilters can be specified. Specifying - * one or more data filters will return the portions of the spreadsheet that - * intersect ranges matched by any of the filters. By default, data within - * grids will not be returned. You can include grid data one of two ways: * - * Specify a field mask listing your desired fields using the `fields` URL - * parameter in HTTP * Set the includeGridData parameter to true. If a field - * mask is set, the `includeGridData` parameter is ignored For large - * spreadsheets, it is recommended to retrieve only the specific fields of the - * spreadsheet that you want. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The spreadsheet to request. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // The DataFilters used to select which ranges to retrieve from - * // the spreadsheet. - * dataFilters: [], // TODO: Update placeholder value. - * - * // True if grid data should be returned. - * // This parameter is ignored if a field mask was set in the request. - * includeGridData: false, // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.getByDataFilter(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.getByDataFilter - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The spreadsheet to request. - * @param {().GetSpreadsheetByDataFilterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getByDataFilter(params?: any, options?: MethodOptions): - AxiosPromise; - getByDataFilter( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getByDataFilter( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.batchUpdate + * @desc Applies one or more updates to the spreadsheet. Each request is + * validated before being applied. If any request is not valid then the + * entire request will fail and nothing will be applied. Some requests have + * replies to give you some information about how they are applied. The + * replies will mirror the requests. For example, if you applied 4 updates + * and the 3rd one had a reply, then the response will have 2 empty replies, + * the actual reply, and another empty reply, in that order. Due to the + * collaborative nature of spreadsheets, it is not guaranteed that the + * spreadsheet will reflect exactly your changes after this completes, + * however it is guaranteed that the updates in the request will be applied + * together atomically. Your changes may be altered with respect to + * collaborator changes. If there are no collaborators, the spreadsheet + * should reflect your changes. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The spreadsheet to apply the updates to. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // A list of updates to apply to the spreadsheet. + * // Requests will be applied in the order they are specified. + * // If any request is not valid, no requests will be applied. + * requests: [], // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.batchUpdate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The spreadsheet to apply the updates to. + * @param {().BatchUpdateSpreadsheetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}:getByDataFilter') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Spreadsheets$Developermetadata { - root: Sheets; - constructor(root: Sheets) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * sheets.spreadsheets.developerMetadata.get - * @desc Returns the developer metadata with the specified ID. The caller must - * specify the spreadsheet ID and the developer metadata's unique metadataId. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve metadata from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The ID of the developer metadata to retrieve. - * metadataId: 0, // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.developerMetadata.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.developerMetadata.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.metadataId The ID of the developer metadata to retrieve. - * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve metadata from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.create + * @desc Creates a spreadsheet, returning the newly created spreadsheet. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Spreadsheet} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/spreadsheets').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['spreadsheetId', 'metadataId'], - pathParams: ['metadataId', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * sheets.spreadsheets.get + * @desc Returns the spreadsheet at the given ID. The caller must specify + * the spreadsheet ID. By default, data within grids will not be returned. + * You can include grid data one of two ways: * Specify a field mask + * listing your desired fields using the `fields` URL parameter in HTTP * + * Set the includeGridData URL parameter to true. If a field mask is set, + * the `includeGridData` parameter is ignored For large spreadsheets, it is + * recommended to retrieve only the specific fields of the spreadsheet that + * you want. To retrieve only subsets of the spreadsheet, use the ranges + * URL parameter. Multiple ranges can be specified. Limiting the range will + * return only the portions of the spreadsheet that intersect the requested + * ranges. Ranges are specified using A1 notation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The spreadsheet to request. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The ranges to retrieve from the spreadsheet. + * ranges: [], // TODO: Update placeholder value. + * + * // True if grid data should be returned. + * // This parameter is ignored if a field mask was set in the request. + * includeGridData: false, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/drive.readonly' + * // 'https://www.googleapis.com/auth/spreadsheets' + * // 'https://www.googleapis.com/auth/spreadsheets.readonly' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeGridData True if grid data should be returned. This parameter is ignored if a field mask was set in the request. + * @param {string=} params.ranges The ranges to retrieve from the spreadsheet. + * @param {string} params.spreadsheetId The spreadsheet to request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * sheets.spreadsheets.developerMetadata.search - * @desc Returns all developer metadata matching the specified DataFilter. If - * the provided DataFilter represents a DeveloperMetadataLookup object, this - * will return all DeveloperMetadata entries selected by it. If the DataFilter - * represents a location in a spreadsheet, this will return all developer - * metadata associated with locations intersecting that region. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve metadata from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.developerMetadata.search(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.developerMetadata.search - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve metadata from. - * @param {().SearchDeveloperMetadataRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - search(params?: any, options?: MethodOptions): - AxiosPromise; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - search( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.getByDataFilter + * @desc Returns the spreadsheet at the given ID. The caller must specify + * the spreadsheet ID. This method differs from GetSpreadsheet in that it + * allows selecting which subsets of spreadsheet data to return by + * specifying a dataFilters parameter. Multiple DataFilters can be + * specified. Specifying one or more data filters will return the portions + * of the spreadsheet that intersect ranges matched by any of the filters. + * By default, data within grids will not be returned. You can include grid + * data one of two ways: * Specify a field mask listing your desired fields + * using the `fields` URL parameter in HTTP * Set the includeGridData + * parameter to true. If a field mask is set, the `includeGridData` + * parameter is ignored For large spreadsheets, it is recommended to + * retrieve only the specific fields of the spreadsheet that you want. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The spreadsheet to request. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // The DataFilters used to select which ranges to retrieve from + * // the spreadsheet. + * dataFilters: [], // TODO: Update placeholder value. + * + * // True if grid data should be returned. + * // This parameter is ignored if a field mask was set in the + * request. includeGridData: false, // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.getByDataFilter(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.getByDataFilter + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The spreadsheet to request. + * @param {().GetSpreadsheetByDataFilterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getByDataFilter(params?: any, options?: MethodOptions): + AxiosPromise; + getByDataFilter( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getByDataFilter( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v4/spreadsheets/{spreadsheetId}:getByDataFilter') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Spreadsheets$Developermetadata { + root: Sheets; + constructor(root: Sheets) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/developerMetadata:search') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Spreadsheets$Sheets { - root: Sheets; - constructor(root: Sheets) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * sheets.spreadsheets.developerMetadata.get + * @desc Returns the developer metadata with the specified ID. The caller + * must specify the spreadsheet ID and the developer metadata's unique + * metadataId. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to retrieve metadata from. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The ID of the developer metadata to retrieve. + * metadataId: 0, // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.developerMetadata.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.developerMetadata.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.metadataId The ID of the developer metadata to retrieve. + * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve metadata from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/developerMetadata/{metadataId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['spreadsheetId', 'metadataId'], + pathParams: ['metadataId', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * sheets.spreadsheets.sheets.copyTo - * @desc Copies a single sheet from a spreadsheet to another spreadsheet. - * Returns the properties of the newly created sheet. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet containing the sheet to copy. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The ID of the sheet to copy. - * sheetId: 0, // TODO: Update placeholder value. - * - * resource: { - * // The ID of the spreadsheet to copy the sheet to. - * destinationSpreadsheetId: '', // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.sheets.copyTo(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.sheets.copyTo - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.sheetId The ID of the sheet to copy. - * @param {string} params.spreadsheetId The ID of the spreadsheet containing the sheet to copy. - * @param {().CopySheetToAnotherSpreadsheetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copyTo(params?: any, options?: MethodOptions): - AxiosPromise; - copyTo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copyTo( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId', 'sheetId'], - pathParams: ['sheetId', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * sheets.spreadsheets.developerMetadata.search + * @desc Returns all developer metadata matching the specified DataFilter. + * If the provided DataFilter represents a DeveloperMetadataLookup object, + * this will return all DeveloperMetadata entries selected by it. If the + * DataFilter represents a location in a spreadsheet, this will return all + * developer metadata associated with locations intersecting that region. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to retrieve metadata from. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.developerMetadata.search(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.developerMetadata.search + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve metadata from. + * @param {().SearchDeveloperMetadataRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + search(params?: any, options?: MethodOptions): + AxiosPromise; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + search( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/developerMetadata:search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } -} -export class Resource$Spreadsheets$Values { - root: Sheets; - constructor(root: Sheets) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Spreadsheets$Sheets { + root: Sheets; + constructor(root: Sheets) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * sheets.spreadsheets.values.append - * @desc Appends values to a spreadsheet. The input range is used to search - * for existing data and find a "table" within that range. Values will be - * appended to the next row of the table, starting with the first column of - * the table. See the [guide](/sheets/api/guides/values#appending_values) and - * [sample code](/sheets/api/samples/writing#append_values) for specific - * details of how tables are detected and data is appended. The caller must - * specify the spreadsheet ID, range, and a valueInputOption. The - * `valueInputOption` only controls how the input data will be added to the - * sheet (column-wise or row-wise), it does not influence what cell the data - * starts being written to. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of a range to search for a logical table of data. - * // Values will be appended after the last row of the table. - * range: 'my-range', // TODO: Update placeholder value. - * - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * // How the input data should be inserted. - * insertDataOption: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.append(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.append - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeValuesInResponse Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values. - * @param {string=} params.insertDataOption How the input data should be inserted. - * @param {string} params.range The A1 notation of a range to search for a logical table of data. Values will be appended after the last row of the table. - * @param {string=} params.responseDateTimeRenderOption Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * @param {string=} params.responseValueRenderOption Determines how values in the response should be rendered. The default render option is ValueRenderOption.FORMATTED_VALUE. - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {string=} params.valueInputOption How the input data should be interpreted. - * @param {().ValueRange} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - append(params?: any, options?: MethodOptions): - AxiosPromise; - append( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - append( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values/{range}:append') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId', 'range'], - pathParams: ['range', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * sheets.spreadsheets.sheets.copyTo + * @desc Copies a single sheet from a spreadsheet to another spreadsheet. + * Returns the properties of the newly created sheet. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet containing the sheet to copy. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The ID of the sheet to copy. + * sheetId: 0, // TODO: Update placeholder value. + * + * resource: { + * // The ID of the spreadsheet to copy the sheet to. + * destinationSpreadsheetId: '', // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.sheets.copyTo(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.sheets.copyTo + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.sheetId The ID of the sheet to copy. + * @param {string} params.spreadsheetId The ID of the spreadsheet containing the sheet to copy. + * @param {().CopySheetToAnotherSpreadsheetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copyTo(params?: any, options?: MethodOptions): + AxiosPromise; + copyTo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copyTo( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/sheets/{sheetId}:copyTo') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId', 'sheetId'], + pathParams: ['sheetId', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * sheets.spreadsheets.values.batchClear - * @desc Clears one or more ranges of values from a spreadsheet. The caller - * must specify the spreadsheet ID and one or more ranges. Only values are - * cleared -- all other properties of the cell (such as formatting, data - * validation, etc..) are kept. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // The ranges to clear, in A1 notation. - * ranges: [], // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchClear(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchClear - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {().BatchClearValuesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchClear(params?: any, options?: MethodOptions): - AxiosPromise; - batchClear( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchClear( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Spreadsheets$Values { + root: Sheets; + constructor(root: Sheets) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values:batchClear') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * sheets.spreadsheets.values.batchClearByDataFilter - * @desc Clears one or more ranges of values from a spreadsheet. The caller - * must specify the spreadsheet ID and one or more DataFilters. Ranges - * matching any of the specified data filters will be cleared. Only values - * are cleared -- all other properties of the cell (such as formatting, data - * validation, etc..) are kept. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // The DataFilters used to determine which ranges to clear. - * dataFilters: [], // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchClearByDataFilter(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchClearByDataFilter - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {().BatchClearValuesByDataFilterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchClearByDataFilter(params?: any, options?: MethodOptions): - AxiosPromise; - batchClearByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - batchClearByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.values.append + * @desc Appends values to a spreadsheet. The input range is used to search + * for existing data and find a "table" within that range. Values will be + * appended to the next row of the table, starting with the first column of + * the table. See the [guide](/sheets/api/guides/values#appending_values) + * and [sample code](/sheets/api/samples/writing#append_values) for specific + * details of how tables are detected and data is appended. The caller must + * specify the spreadsheet ID, range, and a valueInputOption. The + * `valueInputOption` only controls how the input data will be added to the + * sheet (column-wise or row-wise), it does not influence what cell the data + * starts being written to. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The A1 notation of a range to search for a logical table of data. + * // Values will be appended after the last row of the table. + * range: 'my-range', // TODO: Update placeholder value. + * + * // How the input data should be interpreted. + * valueInputOption: '', // TODO: Update placeholder value. + * + * // How the input data should be inserted. + * insertDataOption: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.append(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.append + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeValuesInResponse Determines if the update response should include the values of the cells that were appended. By default, responses do not include the updated values. + * @param {string=} params.insertDataOption How the input data should be inserted. + * @param {string} params.range The A1 notation of a range to search for a logical table of data. Values will be appended after the last row of the table. + * @param {string=} params.responseDateTimeRenderOption Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + * @param {string=} params.responseValueRenderOption Determines how values in the response should be rendered. The default render option is ValueRenderOption.FORMATTED_VALUE. + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {string=} params.valueInputOption How the input data should be interpreted. + * @param {().ValueRange} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + append(params?: any, options?: MethodOptions): + AxiosPromise; + append( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + append( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values/{range}:append') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId', 'range'], + pathParams: ['range', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * sheets.spreadsheets.values.batchGet - * @desc Returns one or more ranges of values from a spreadsheet. The caller - * must specify the spreadsheet ID and one or more ranges. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to retrieve. - * ranges: [], // TODO: Update placeholder value. - * - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. - * - * // How dates, times, and durations should be represented in the output. - * // This is ignored if value_render_option is - * // FORMATTED_VALUE. - * // The default dateTime render option is - * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchGet(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dateTimeRenderOption How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * @param {string=} params.majorDimension The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. - * @param {string=} params.ranges The A1 notation of the values to retrieve. - * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. - * @param {string=} params.valueRenderOption How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.values.batchClear + * @desc Clears one or more ranges of values from a spreadsheet. The caller + * must specify the spreadsheet ID and one or more ranges. Only values are + * cleared -- all other properties of the cell (such as formatting, data + * validation, etc..) are kept. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // The ranges to clear, in A1 notation. + * ranges: [], // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchClear(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchClear + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {().BatchClearValuesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchClear(params?: any, options?: MethodOptions): + AxiosPromise; + batchClear( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchClear( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values:batchClear') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values:batchGet') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sheets.spreadsheets.values.batchGetByDataFilter - * @desc Returns one or more ranges of values that match the specified data - * filters. The caller must specify the spreadsheet ID and one or more - * DataFilters. Ranges that match any of the data filters in the request will - * be returned. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. - * - * // The data filters used to match the ranges of values to retrieve. - * Ranges - * // that match any of the specified data filters will be included in - * the - * // response. - * dataFilters: [], // TODO: Update placeholder value. - * - * // How dates, times, and durations should be represented in the - * output. - * // This is ignored if value_render_option is - * // FORMATTED_VALUE. - * // The default dateTime render option is - * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: - * Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchGetByDataFilter(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchGetByDataFilter - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. - * @param {().BatchGetValuesByDataFilterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGetByDataFilter(params?: any, options?: MethodOptions): - AxiosPromise; - batchGetByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - batchGetByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sheets.spreadsheets.values.batchClearByDataFilter + * @desc Clears one or more ranges of values from a spreadsheet. The caller + * must specify the spreadsheet ID and one or more DataFilters. Ranges + * matching any of the specified data filters will be cleared. Only values + * are cleared -- all other properties of the cell (such as formatting, data + * validation, etc..) are kept. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // The DataFilters used to determine which ranges to clear. + * dataFilters: [], // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchClearByDataFilter(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchClearByDataFilter + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {().BatchClearValuesByDataFilterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchClearByDataFilter(params?: any, options?: MethodOptions): + AxiosPromise; + batchClearByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + batchClearByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values:batchClearByDataFilter') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * sheets.spreadsheets.values.batchUpdate - * @desc Sets values in one or more ranges of a spreadsheet. The caller must - * specify the spreadsheet ID, a valueInputOption, and one or more - * ValueRanges. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * // The new values to apply to the spreadsheet. - * data: [], // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchUpdate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {().BatchUpdateValuesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sheets.spreadsheets.values.batchGet + * @desc Returns one or more ranges of values from a spreadsheet. The caller + * must specify the spreadsheet ID and one or more ranges. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The A1 notation of the values to retrieve. + * ranges: [], // TODO: Update placeholder value. + * + * // How values should be represented in the output. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * valueRenderOption: '', // TODO: Update placeholder value. + * + * // How dates, times, and durations should be represented in the + * output. + * // This is ignored if value_render_option is + * // FORMATTED_VALUE. + * // The default dateTime render option is + * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchGet(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/drive.readonly' + * // 'https://www.googleapis.com/auth/spreadsheets' + * // 'https://www.googleapis.com/auth/spreadsheets.readonly' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dateTimeRenderOption How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + * @param {string=} params.majorDimension The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. + * @param {string=} params.ranges The A1 notation of the values to retrieve. + * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. + * @param {string=} params.valueRenderOption How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sheets.spreadsheets.values.batchUpdateByDataFilter - * @desc Sets values in one or more ranges of a spreadsheet. The caller must - * specify the spreadsheet ID, a valueInputOption, and one or more - * DataFilterValueRanges. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * resource: { - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * // The new values to apply to the spreadsheet. If more than one - * range is - * // matched by the specified DataFilter the specified values will be - * // applied to all of those ranges. - * data: [], // TODO: Update placeholder value. - * - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.batchUpdateByDataFilter(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.batchUpdateByDataFilter - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {().BatchUpdateValuesByDataFilterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdateByDataFilter(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdateByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - batchUpdateByDataFilter( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sheets.spreadsheets.values.batchGetByDataFilter + * @desc Returns one or more ranges of values that match the specified data + * filters. The caller must specify the spreadsheet ID and one or more + * DataFilters. Ranges that match any of the data filters in the request + * will be returned. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // How values should be represented in the output. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * valueRenderOption: '', // TODO: Update placeholder value. + * + * // The data filters used to match the ranges of values to retrieve. + * Ranges + * // that match any of the specified data filters will be included in + * the + * // response. + * dataFilters: [], // TODO: Update placeholder value. + * + * // How dates, times, and durations should be represented in the + * output. + * // This is ignored if value_render_option is + * // FORMATTED_VALUE. + * // The default dateTime render option is + * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: + * Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchGetByDataFilter(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchGetByDataFilter + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. + * @param {().BatchGetValuesByDataFilterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGetByDataFilter(params?: any, options?: MethodOptions): + AxiosPromise; + batchGetByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + batchGetByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values:batchGetByDataFilter') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId'], - pathParams: ['spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * sheets.spreadsheets.values.clear - * @desc Clears values from a spreadsheet. The caller must specify the - * spreadsheet ID and range. Only values are cleared -- all other properties - * of the cell (such as formatting, data validation, etc..) are kept. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to clear. - * range: 'my-range', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.clear(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.clear - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.range The A1 notation of the values to clear. - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {().ClearValuesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clear(params?: any, options?: MethodOptions): - AxiosPromise; - clear( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clear( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.values.batchUpdate + * @desc Sets values in one or more ranges of a spreadsheet. The caller must + * specify the spreadsheet ID, a valueInputOption, and one or more + * ValueRanges. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // How the input data should be interpreted. + * valueInputOption: '', // TODO: Update placeholder value. + * + * // The new values to apply to the spreadsheet. + * data: [], // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchUpdate(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {().BatchUpdateValuesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v4/spreadsheets/{spreadsheetId}/values/{range}:clear') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['spreadsheetId', 'range'], - pathParams: ['range', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sheets.spreadsheets.values.get - * @desc Returns a range of values from a spreadsheet. The caller must specify - * the spreadsheet ID and a range. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to retrieve data from. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to retrieve. - * range: 'my-range', // TODO: Update placeholder value. - * - * // How values should be represented in the output. - * // The default render option is ValueRenderOption.FORMATTED_VALUE. - * valueRenderOption: '', // TODO: Update placeholder value. - * - * // How dates, times, and durations should be represented in the output. - * // This is ignored if value_render_option is - * // FORMATTED_VALUE. - * // The default dateTime render option is - * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: - * Update placeholder value. - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/drive.readonly' - * // 'https://www.googleapis.com/auth/spreadsheets' - * // 'https://www.googleapis.com/auth/spreadsheets.readonly' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.dateTimeRenderOption How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * @param {string=} params.majorDimension The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. - * @param {string} params.range The A1 notation of the values to retrieve. - * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. - * @param {string=} params.valueRenderOption How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.values.batchUpdateByDataFilter + * @desc Sets values in one or more ranges of a spreadsheet. The caller must + * specify the spreadsheet ID, a valueInputOption, and one or more + * DataFilterValueRanges. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * resource: { + * // How the input data should be interpreted. + * valueInputOption: '', // TODO: Update placeholder value. + * + * // The new values to apply to the spreadsheet. If more than one + * range is + * // matched by the specified DataFilter the specified values will be + * // applied to all of those ranges. + * data: [], // TODO: Update placeholder value. + * + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.batchUpdateByDataFilter(request, + * function(err, response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.batchUpdateByDataFilter + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {().BatchUpdateValuesByDataFilterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdateByDataFilter(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdateByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + batchUpdateByDataFilter( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values:batchUpdateByDataFilter') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId'], + pathParams: ['spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values/{range}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['spreadsheetId', 'range'], - pathParams: ['range', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sheets.spreadsheets.values.update - * @desc Sets values in a range of a spreadsheet. The caller must specify the - * spreadsheet ID, range, and a valueInputOption. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Sheets API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/sheets - * // 2. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var sheets = google.sheets('v4'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the spreadsheet to update. - * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder value. - * - * // The A1 notation of the values to update. - * range: 'my-range', // TODO: Update placeholder value. - * - * // How the input data should be interpreted. - * valueInputOption: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * sheets.spreadsheets.values.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * // TODO: Change placeholder below to generate authentication credentials. - * See - * // - * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample - * // - * // Authorize using one of the following scopes: - * // 'https://www.googleapis.com/auth/drive' - * // 'https://www.googleapis.com/auth/drive.file' - * // 'https://www.googleapis.com/auth/spreadsheets' - * var authClient = null; - * - * if (authClient == null) { - * console.log('authentication failed'); - * return; - * } - * callback(authClient); - * } - * @alias sheets.spreadsheets.values.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeValuesInResponse Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the range to write was larger than than the range actually written, the response will include all values in the requested range (excluding trailing empty rows and columns). - * @param {string} params.range The A1 notation of the values to update. - * @param {string=} params.responseDateTimeRenderOption Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. - * @param {string=} params.responseValueRenderOption Determines how values in the response should be rendered. The default render option is ValueRenderOption.FORMATTED_VALUE. - * @param {string} params.spreadsheetId The ID of the spreadsheet to update. - * @param {string=} params.valueInputOption How the input data should be interpreted. - * @param {().ValueRange} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * sheets.spreadsheets.values.clear + * @desc Clears values from a spreadsheet. The caller must specify the + * spreadsheet ID and range. Only values are cleared -- all other properties + * of the cell (such as formatting, data validation, etc..) are kept. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The A1 notation of the values to clear. + * range: 'my-range', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.clear(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.clear + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.range The A1 notation of the values to clear. + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {().ClearValuesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clear(params?: any, options?: MethodOptions): + AxiosPromise; + clear( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + clear( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v4/spreadsheets/{spreadsheetId}/values/{range}:clear') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['spreadsheetId', 'range'], + pathParams: ['range', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * sheets.spreadsheets.values.get + * @desc Returns a range of values from a spreadsheet. The caller must + * specify the spreadsheet ID and a range. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to retrieve data from. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The A1 notation of the values to retrieve. + * range: 'my-range', // TODO: Update placeholder value. + * + * // How values should be represented in the output. + * // The default render option is ValueRenderOption.FORMATTED_VALUE. + * valueRenderOption: '', // TODO: Update placeholder value. + * + * // How dates, times, and durations should be represented in the + * output. + * // This is ignored if value_render_option is + * // FORMATTED_VALUE. + * // The default dateTime render option is + * [DateTimeRenderOption.SERIAL_NUMBER]. dateTimeRenderOption: '', // TODO: + * Update placeholder value. + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/drive.readonly' + * // 'https://www.googleapis.com/auth/spreadsheets' + * // 'https://www.googleapis.com/auth/spreadsheets.readonly' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.dateTimeRenderOption How dates, times, and durations should be represented in the output. This is ignored if value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + * @param {string=} params.majorDimension The major dimension that results should use. For example, if the spreadsheet data is: `A1=1,B1=2,A2=3,B2=4`, then requesting `range=A1:B2,majorDimension=ROWS` will return `[[1,2],[3,4]]`, whereas requesting `range=A1:B2,majorDimension=COLUMNS` will return `[[1,3],[2,4]]`. + * @param {string} params.range The A1 notation of the values to retrieve. + * @param {string} params.spreadsheetId The ID of the spreadsheet to retrieve data from. + * @param {string=} params.valueRenderOption How values should be represented in the output. The default render option is ValueRenderOption.FORMATTED_VALUE. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values/{range}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['spreadsheetId', 'range'], + pathParams: ['range', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values/{range}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['spreadsheetId', 'range'], - pathParams: ['range', 'spreadsheetId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * sheets.spreadsheets.values.update + * @desc Sets values in a range of a spreadsheet. The caller must specify + * the spreadsheet ID, range, and a valueInputOption. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Sheets API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/sheets + * // 2. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var sheets = google.sheets('v4'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the spreadsheet to update. + * spreadsheetId: 'my-spreadsheet-id', // TODO: Update placeholder + * value. + * + * // The A1 notation of the values to update. + * range: 'my-range', // TODO: Update placeholder value. + * + * // How the input data should be interpreted. + * valueInputOption: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * sheets.spreadsheets.values.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * // TODO: Change placeholder below to generate authentication + * credentials. See + * // + * https://developers.google.com/sheets/quickstart/nodejs#step_3_set_up_the_sample + * // + * // Authorize using one of the following scopes: + * // 'https://www.googleapis.com/auth/drive' + * // 'https://www.googleapis.com/auth/drive.file' + * // 'https://www.googleapis.com/auth/spreadsheets' + * var authClient = null; + * + * if (authClient == null) { + * console.log('authentication failed'); + * return; + * } + * callback(authClient); + * } + * @alias sheets.spreadsheets.values.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeValuesInResponse Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. If the range to write was larger than than the range actually written, the response will include all values in the requested range (excluding trailing empty rows and columns). + * @param {string} params.range The A1 notation of the values to update. + * @param {string=} params.responseDateTimeRenderOption Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is [DateTimeRenderOption.SERIAL_NUMBER]. + * @param {string=} params.responseValueRenderOption Determines how values in the response should be rendered. The default render option is ValueRenderOption.FORMATTED_VALUE. + * @param {string} params.spreadsheetId The ID of the spreadsheet to update. + * @param {string=} params.valueInputOption How the input data should be interpreted. + * @param {().ValueRange} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sheets.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v4/spreadsheets/{spreadsheetId}/values/{range}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['spreadsheetId', 'range'], + pathParams: ['range', 'spreadsheetId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/siteVerification/v1.ts b/src/apis/siteVerification/v1.ts index c5d33559a75..7a90b0cc88a 100644 --- a/src/apis/siteVerification/v1.ts +++ b/src/apis/siteVerification/v1.ts @@ -27,516 +27,518 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Site Verification API - * - * Verifies ownership of websites or domains with Google. - * - * @example - * const google = require('googleapis'); - * const siteVerification = google.siteVerification('v1'); - * - * @namespace siteVerification - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Siteverification - */ -export class Siteverification { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace siteVerification_v1 { + /** + * Google Site Verification API + * + * Verifies ownership of websites or domains with Google. + * + * @example + * const google = require('googleapis'); + * const siteVerification = google.siteVerification('v1'); + * + * @namespace siteVerification + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Siteverification + */ + export class Siteverification { + _options: GlobalOptions; + google: GoogleApis; + root = this; - webResource: Resource$Webresource; + webResource: Resource$Webresource; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.webResource = new Resource$Webresource(this); - } + this.webResource = new Resource$Webresource(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$SiteVerificationWebResourceGettokenRequest { - /** - * The site for which a verification token will be generated. - */ - site: any; - /** - * The verification method that will be used to verify this site. For sites, - * 'FILE' or 'META' methods may be used. For domains, only - * 'DNS' may be used. - */ - verificationMethod: string; -} -export interface Schema$SiteVerificationWebResourceGettokenResponse { - /** - * The verification method to use in conjunction with this token. For FILE, - * the token should be placed in the top-level directory of the site, stored - * inside a file of the same name. For META, the token should be placed in the - * HEAD tag of the default page that is loaded for the site. For DNS, the - * token should be placed in a TXT record of the domain. - */ - method: string; - /** - * The verification token. The token must be placed appropriately in order for - * verification to succeed. - */ - token: string; -} -export interface Schema$SiteVerificationWebResourceListResponse { - /** - * The list of sites that are owned by the authenticated user. - */ - items: Schema$SiteVerificationWebResourceResource[]; -} -export interface Schema$SiteVerificationWebResourceResource { - /** - * The string used to identify this site. This value should be used in the - * "id" portion of the REST URL for the Get, Update, and Delete - * operations. - */ - id: string; - /** - * The email addresses of all verified owners. - */ - owners: string[]; - /** - * The address and type of a site that is verified or will be verified. - */ - site: any; -} - -export class Resource$Webresource { - root: Siteverification; - constructor(root: Siteverification) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$SiteVerificationWebResourceGettokenRequest { + /** + * The site for which a verification token will be generated. + */ + site: any; + /** + * The verification method that will be used to verify this site. For sites, + * 'FILE' or 'META' methods may be used. For domains, only + * 'DNS' may be used. + */ + verificationMethod: string; } - - getRoot() { - return this.root; + export interface Schema$SiteVerificationWebResourceGettokenResponse { + /** + * The verification method to use in conjunction with this token. For FILE, + * the token should be placed in the top-level directory of the site, stored + * inside a file of the same name. For META, the token should be placed in + * the HEAD tag of the default page that is loaded for the site. For DNS, + * the token should be placed in a TXT record of the domain. + */ + method: string; + /** + * The verification token. The token must be placed appropriately in order + * for verification to succeed. + */ + token: string; + } + export interface Schema$SiteVerificationWebResourceListResponse { + /** + * The list of sites that are owned by the authenticated user. + */ + items: Schema$SiteVerificationWebResourceResource[]; + } + export interface Schema$SiteVerificationWebResourceResource { + /** + * The string used to identify this site. This value should be used in the + * "id" portion of the REST URL for the Get, Update, and Delete + * operations. + */ + id: string; + /** + * The email addresses of all verified owners. + */ + owners: string[]; + /** + * The address and type of a site that is verified or will be verified. + */ + site: any; } - - /** - * siteVerification.webResource.delete - * @desc Relinquish ownership of a website or domain. - * @alias siteVerification.webResource.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id of a verified site or domain. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Webresource { + root: Siteverification; + constructor(root: Siteverification) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * siteVerification.webResource.get - * @desc Get the most current data for a website or domain. - * @alias siteVerification.webResource.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id of a verified site or domain. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * siteVerification.webResource.delete + * @desc Relinquish ownership of a website or domain. + * @alias siteVerification.webResource.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id of a verified site or domain. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * siteVerification.webResource.getToken - * @desc Get a verification token for placing on a website or domain. - * @alias siteVerification.webResource.getToken - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SiteVerificationWebResourceGettokenRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getToken(params?: any, options?: MethodOptions): - AxiosPromise; - getToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SiteVerificationWebResourceGettokenResponse>): void; - getToken( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$SiteVerificationWebResourceGettokenResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/token') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest< - Schema$SiteVerificationWebResourceGettokenResponse>(parameters); + /** + * siteVerification.webResource.get + * @desc Get the most current data for a website or domain. + * @alias siteVerification.webResource.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id of a verified site or domain. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * siteVerification.webResource.insert - * @desc Attempt verification of a website or domain. - * @alias siteVerification.webResource.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.verificationMethod The method to use for verifying a site or domain. - * @param {().SiteVerificationWebResourceResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * siteVerification.webResource.getToken + * @desc Get a verification token for placing on a website or domain. + * @alias siteVerification.webResource.getToken + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SiteVerificationWebResourceGettokenRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getToken(params?: any, options?: MethodOptions): + AxiosPromise; + getToken( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$SiteVerificationWebResourceGettokenResponse>, + callback?: BodyResponseCallback< + Schema$SiteVerificationWebResourceGettokenResponse>): void; + getToken( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$SiteVerificationWebResourceGettokenResponse>, + callback?: BodyResponseCallback< + Schema$SiteVerificationWebResourceGettokenResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/token') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$SiteVerificationWebResourceGettokenResponse>(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['verificationMethod'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * siteVerification.webResource.list - * @desc Get the list of your verified websites and domains. - * @alias siteVerification.webResource.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * siteVerification.webResource.insert + * @desc Attempt verification of a website or domain. + * @alias siteVerification.webResource.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.verificationMethod The method to use for verifying a site or domain. + * @param {().SiteVerificationWebResourceResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['verificationMethod'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - /** - * siteVerification.webResource.patch - * @desc Modify the list of owners for your website or domain. This method - * supports patch semantics. - * @alias siteVerification.webResource.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id of a verified site or domain. - * @param {().SiteVerificationWebResourceResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * siteVerification.webResource.list + * @desc Get the list of your verified websites and domains. + * @alias siteVerification.webResource.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SiteVerificationWebResourceListResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$SiteVerificationWebResourceListResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * siteVerification.webResource.update - * @desc Modify the list of owners for your website or domain. - * @alias siteVerification.webResource.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id of a verified site or domain. - * @param {().SiteVerificationWebResourceResource} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * siteVerification.webResource.patch + * @desc Modify the list of owners for your website or domain. This method + * supports patch semantics. + * @alias siteVerification.webResource.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id of a verified site or domain. + * @param {().SiteVerificationWebResourceResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/siteVerification/v1/webResource/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * siteVerification.webResource.update + * @desc Modify the list of owners for your website or domain. + * @alias siteVerification.webResource.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id of a verified site or domain. + * @param {().SiteVerificationWebResourceResource} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/siteVerification/v1/webResource/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/slides/v1.ts b/src/apis/slides/v1.ts index dc51b6f9278..cd7b358fd4e 100644 --- a/src/apis/slides/v1.ts +++ b/src/apis/slides/v1.ts @@ -27,3399 +27,3431 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Slides API - * - * An API for creating and editing Google Slides presentations. - * - * @example - * const google = require('googleapis'); - * const slides = google.slides('v1'); - * - * @namespace slides - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Slides - */ -export class Slides { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace slides_v1 { + /** + * Google Slides API + * + * An API for creating and editing Google Slides presentations. + * + * @example + * const google = require('googleapis'); + * const slides = google.slides('v1'); + * + * @namespace slides + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Slides + */ + export class Slides { + _options: GlobalOptions; + google: GoogleApis; + root = this; - presentations: Resource$Presentations; + presentations: Resource$Presentations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.presentations = new Resource$Presentations(this); - } + this.presentations = new Resource$Presentations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * AffineTransform uses a 3x3 matrix with an implied last row of [ 0 0 1 ] to - * transform source coordinates (x,y) into destination coordinates (x', - * y') according to: x' x = shear_y scale_y translate_y 1 - * [ 1 ] After transformation, x' = scale_x * x + shear_x * y + - * translate_x; y' = scale_y * y + shear_y * x + translate_y; This - * message is therefore composed of these six matrix elements. - */ -export interface Schema$AffineTransform { - /** - * The X coordinate scaling element. - */ - scaleX: number; - /** - * The Y coordinate scaling element. - */ - scaleY: number; - /** - * The X coordinate shearing element. - */ - shearX: number; - /** - * The Y coordinate shearing element. - */ - shearY: number; - /** - * The X coordinate translation element. - */ - translateX: number; - /** - * The Y coordinate translation element. - */ - translateY: number; - /** - * The units for translate elements. - */ - unit: string; -} -/** - * A TextElement kind that represents auto text. - */ -export interface Schema$AutoText { - /** - * The rendered content of this auto text, if available. - */ - content: string; - /** - * The styling applied to this auto text. - */ - style: Schema$TextStyle; - /** - * The type of this auto text. - */ - type: string; -} -/** - * Request message for PresentationsService.BatchUpdatePresentation. - */ -export interface Schema$BatchUpdatePresentationRequest { - /** - * A list of updates to apply to the presentation. - */ - requests: Schema$Request[]; - /** - * Provides control over how write requests are executed. - */ - writeControl: Schema$WriteControl; -} -/** - * Response message from a batch update. - */ -export interface Schema$BatchUpdatePresentationResponse { - /** - * The presentation the updates were applied to. - */ - presentationId: string; - /** - * The reply of the updates. This maps 1:1 with the updates, although replies - * to some requests may be empty. - */ - replies: Schema$Response[]; - /** - * The updated write control after applying the request. - */ - writeControl: Schema$WriteControl; -} -/** - * Describes the bullet of a paragraph. - */ -export interface Schema$Bullet { - /** - * The paragraph specific text style applied to this bullet. - */ - bulletStyle: Schema$TextStyle; - /** - * The rendered bullet glyph for this paragraph. - */ - glyph: string; - /** - * The ID of the list this paragraph belongs to. - */ - listId: string; /** - * The nesting level of this paragraph in the list. - */ - nestingLevel: number; -} -/** - * The palette of predefined colors for a page. - */ -export interface Schema$ColorScheme { - /** - * The ThemeColorType and corresponding concrete color pairs. - */ - colors: Schema$ThemeColorPair[]; -} -/** - * A color and position in a gradient band. - */ -export interface Schema$ColorStop { - /** - * The alpha value of this color in the gradient band. Defaults to 1.0, fully - * opaque. - */ - alpha: number; - /** - * The color of the gradient stop. - */ - color: Schema$OpaqueColor; - /** - * The relative position of the color stop in the gradient band measured in - * percentage. The value should be in the interval [0.0, 1.0]. - */ - position: number; -} -/** - * Creates an image. - */ -export interface Schema$CreateImageRequest { - /** - * The element properties for the image. When the aspect ratio of the - * provided size does not match the image aspect ratio, the image is scaled - * and centered with respect to the size in order to maintain aspect ratio. - * The provided transform is applied after this operation. The - * PageElementProperties.size property is optional. If you don't specify - * the size, the default size of the image is used. The - * PageElementProperties.transform property is optional. If you don't - * specify a transform, the image will be placed at the top left corner of the - * page. - */ - elementProperties: Schema$PageElementProperties; - /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. - */ - objectId: string; - /** - * The image URL. The image is fetched once at insertion time and a copy is - * stored for display inside the presentation. Images must be less than 50MB - * in size, cannot exceed 25 megapixels, and must be in one of PNG, JPEG, or - * GIF format. The provided URL can be at most 2 kB in length. The URL itself - * is saved with the image, and exposed via the Image.source_url field. - */ - url: string; -} -/** - * The result of creating an image. - */ -export interface Schema$CreateImageResponse { - /** - * The object ID of the created image. - */ - objectId: string; -} -/** - * Creates a line. - */ -export interface Schema$CreateLineRequest { - /** - * The element properties for the line. - */ - elementProperties: Schema$PageElementProperties; - /** - * The category of line to be created. - */ - lineCategory: string; - /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. - */ - objectId: string; -} -/** - * The result of creating a line. - */ -export interface Schema$CreateLineResponse { - /** - * The object ID of the created line. - */ - objectId: string; -} -/** - * Creates bullets for all of the paragraphs that overlap with the given text - * index range. The nesting level of each paragraph will be determined by - * counting leading tabs in front of each paragraph. To avoid excess space - * between the bullet and the corresponding paragraph, these leading tabs are - * removed by this request. This may change the indices of parts of the text. If - * the paragraph immediately before paragraphs being updated is in a list with a - * matching preset, the paragraphs being updated are added to that preceding - * list. - */ -export interface Schema$CreateParagraphBulletsRequest { - /** - * The kinds of bullet glyphs to be used. Defaults to the - * `BULLET_DISC_CIRCLE_SQUARE` preset. - */ - bulletPreset: string; - /** - * The optional table cell location if the text to be modified is in a table - * cell. If present, the object_id must refer to a table. - */ - cellLocation: Schema$TableCellLocation; - /** - * The object ID of the shape or table containing the text to add bullets to. - */ - objectId: string; - /** - * The range of text to apply the bullet presets to, based on TextElement - * indexes. - */ - textRange: Schema$Range; -} -/** - * Creates a new shape. - */ -export interface Schema$CreateShapeRequest { - /** - * The element properties for the shape. - */ - elementProperties: Schema$PageElementProperties; + * AffineTransform uses a 3x3 matrix with an implied last row of [ 0 0 1 ] to + * transform source coordinates (x,y) into destination coordinates (x', + * y') according to: x' x = shear_y scale_y translate_y + * 1 [ 1 ] After transformation, x' = scale_x * x + shear_x * y + + * translate_x; y' = scale_y * y + shear_y * x + translate_y; This + * message is therefore composed of these six matrix elements. + */ + export interface Schema$AffineTransform { + /** + * The X coordinate scaling element. + */ + scaleX: number; + /** + * The Y coordinate scaling element. + */ + scaleY: number; + /** + * The X coordinate shearing element. + */ + shearX: number; + /** + * The Y coordinate shearing element. + */ + shearY: number; + /** + * The X coordinate translation element. + */ + translateX: number; + /** + * The Y coordinate translation element. + */ + translateY: number; + /** + * The units for translate elements. + */ + unit: string; + } /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If empty, a unique identifier will be generated. - */ - objectId: string; + * A TextElement kind that represents auto text. + */ + export interface Schema$AutoText { + /** + * The rendered content of this auto text, if available. + */ + content: string; + /** + * The styling applied to this auto text. + */ + style: Schema$TextStyle; + /** + * The type of this auto text. + */ + type: string; + } /** - * The shape type. - */ - shapeType: string; -} -/** - * The result of creating a shape. - */ -export interface Schema$CreateShapeResponse { + * Request message for PresentationsService.BatchUpdatePresentation. + */ + export interface Schema$BatchUpdatePresentationRequest { + /** + * A list of updates to apply to the presentation. + */ + requests: Schema$Request[]; + /** + * Provides control over how write requests are executed. + */ + writeControl: Schema$WriteControl; + } /** - * The object ID of the created shape. - */ - objectId: string; -} -/** - * Creates an embedded Google Sheets chart. NOTE: Chart creation requires at - * least one of the spreadsheets.readonly, spreadsheets, drive.readonly, - * drive.file, or drive OAuth scopes. - */ -export interface Schema$CreateSheetsChartRequest { + * Response message from a batch update. + */ + export interface Schema$BatchUpdatePresentationResponse { + /** + * The presentation the updates were applied to. + */ + presentationId: string; + /** + * The reply of the updates. This maps 1:1 with the updates, although + * replies to some requests may be empty. + */ + replies: Schema$Response[]; + /** + * The updated write control after applying the request. + */ + writeControl: Schema$WriteControl; + } /** - * The ID of the specific chart in the Google Sheets spreadsheet. - */ - chartId: number; + * Describes the bullet of a paragraph. + */ + export interface Schema$Bullet { + /** + * The paragraph specific text style applied to this bullet. + */ + bulletStyle: Schema$TextStyle; + /** + * The rendered bullet glyph for this paragraph. + */ + glyph: string; + /** + * The ID of the list this paragraph belongs to. + */ + listId: string; + /** + * The nesting level of this paragraph in the list. + */ + nestingLevel: number; + } /** - * The element properties for the chart. When the aspect ratio of the - * provided size does not match the chart aspect ratio, the chart is scaled - * and centered with respect to the size in order to maintain aspect ratio. - * The provided transform is applied after this operation. + * The palette of predefined colors for a page. */ - elementProperties: Schema$PageElementProperties; + export interface Schema$ColorScheme { + /** + * The ThemeColorType and corresponding concrete color pairs. + */ + colors: Schema$ThemeColorPair[]; + } /** - * The mode with which the chart is linked to the source spreadsheet. When not - * specified, the chart will be an image that is not linked. - */ - linkingMode: string; + * A color and position in a gradient band. + */ + export interface Schema$ColorStop { + /** + * The alpha value of this color in the gradient band. Defaults to 1.0, + * fully opaque. + */ + alpha: number; + /** + * The color of the gradient stop. + */ + color: Schema$OpaqueColor; + /** + * The relative position of the color stop in the gradient band measured in + * percentage. The value should be in the interval [0.0, 1.0]. + */ + position: number; + } /** - * A user-supplied object ID. If specified, the ID must be unique among all - * pages and page elements in the presentation. The ID should start with a - * word character [a-zA-Z0-9_] and then followed by any number of the - * following characters [a-zA-Z0-9_-:]. The length of the ID should not be - * less than 5 or greater than 50. If empty, a unique identifier will be - * generated. + * Creates an image. */ - objectId: string; + export interface Schema$CreateImageRequest { + /** + * The element properties for the image. When the aspect ratio of the + * provided size does not match the image aspect ratio, the image is scaled + * and centered with respect to the size in order to maintain aspect ratio. + * The provided transform is applied after this operation. The + * PageElementProperties.size property is optional. If you don't specify + * the size, the default size of the image is used. The + * PageElementProperties.transform property is optional. If you don't + * specify a transform, the image will be placed at the top left corner of + * the page. + */ + elementProperties: Schema$PageElementProperties; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If you don't specify an + * ID, a unique one is generated. + */ + objectId: string; + /** + * The image URL. The image is fetched once at insertion time and a copy is + * stored for display inside the presentation. Images must be less than 50MB + * in size, cannot exceed 25 megapixels, and must be in one of PNG, JPEG, or + * GIF format. The provided URL can be at most 2 kB in length. The URL + * itself is saved with the image, and exposed via the Image.source_url + * field. + */ + url: string; + } /** - * The ID of the Google Sheets spreadsheet that contains the chart. + * The result of creating an image. */ - spreadsheetId: string; -} -/** - * The result of creating an embedded Google Sheets chart. - */ -export interface Schema$CreateSheetsChartResponse { + export interface Schema$CreateImageResponse { + /** + * The object ID of the created image. + */ + objectId: string; + } /** - * The object ID of the created chart. + * Creates a line. */ - objectId: string; -} -/** - * Creates a new slide. - */ -export interface Schema$CreateSlideRequest { + export interface Schema$CreateLineRequest { + /** + * The element properties for the line. + */ + elementProperties: Schema$PageElementProperties; + /** + * The category of line to be created. + */ + lineCategory: string; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If you don't specify an + * ID, a unique one is generated. + */ + objectId: string; + } /** - * The optional zero-based index indicating where to insert the slides. If - * you don't specify an index, the new slide is created at the end. + * The result of creating a line. */ - insertionIndex: number; + export interface Schema$CreateLineResponse { + /** + * The object ID of the created line. + */ + objectId: string; + } /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. - */ - objectId: string; + * Creates bullets for all of the paragraphs that overlap with the given text + * index range. The nesting level of each paragraph will be determined by + * counting leading tabs in front of each paragraph. To avoid excess space + * between the bullet and the corresponding paragraph, these leading tabs are + * removed by this request. This may change the indices of parts of the text. + * If the paragraph immediately before paragraphs being updated is in a list + * with a matching preset, the paragraphs being updated are added to that + * preceding list. + */ + export interface Schema$CreateParagraphBulletsRequest { + /** + * The kinds of bullet glyphs to be used. Defaults to the + * `BULLET_DISC_CIRCLE_SQUARE` preset. + */ + bulletPreset: string; + /** + * The optional table cell location if the text to be modified is in a table + * cell. If present, the object_id must refer to a table. + */ + cellLocation: Schema$TableCellLocation; + /** + * The object ID of the shape or table containing the text to add bullets + * to. + */ + objectId: string; + /** + * The range of text to apply the bullet presets to, based on TextElement + * indexes. + */ + textRange: Schema$Range; + } /** - * An optional list of object ID mappings from the placeholder(s) on the - * layout to the placeholder(s) that will be created on the new slide from - * that specified layout. Can only be used when `slide_layout_reference` is - * specified. + * Creates a new shape. */ - placeholderIdMappings: Schema$LayoutPlaceholderIdMapping[]; + export interface Schema$CreateShapeRequest { + /** + * The element properties for the shape. + */ + elementProperties: Schema$PageElementProperties; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If empty, a unique identifier + * will be generated. + */ + objectId: string; + /** + * The shape type. + */ + shapeType: string; + } /** - * Layout reference of the slide to be inserted, based on the *current - * master*, which is one of the following: - The master of the previous slide - * index. - The master of the first slide, if the insertion_index is zero. - - * The first master in the presentation, if there are no slides. If the - * LayoutReference is not found in the current master, a 400 bad request error - * is returned. If you don't specify a layout reference, then the new - * slide will use the predefined layout `BLANK`. + * The result of creating a shape. */ - slideLayoutReference: Schema$LayoutReference; -} -/** - * The result of creating a slide. - */ -export interface Schema$CreateSlideResponse { + export interface Schema$CreateShapeResponse { + /** + * The object ID of the created shape. + */ + objectId: string; + } /** - * The object ID of the created slide. - */ - objectId: string; -} -/** - * Creates a new table. - */ -export interface Schema$CreateTableRequest { + * Creates an embedded Google Sheets chart. NOTE: Chart creation requires at + * least one of the spreadsheets.readonly, spreadsheets, drive.readonly, + * drive.file, or drive OAuth scopes. + */ + export interface Schema$CreateSheetsChartRequest { + /** + * The ID of the specific chart in the Google Sheets spreadsheet. + */ + chartId: number; + /** + * The element properties for the chart. When the aspect ratio of the + * provided size does not match the chart aspect ratio, the chart is scaled + * and centered with respect to the size in order to maintain aspect ratio. + * The provided transform is applied after this operation. + */ + elementProperties: Schema$PageElementProperties; + /** + * The mode with which the chart is linked to the source spreadsheet. When + * not specified, the chart will be an image that is not linked. + */ + linkingMode: string; + /** + * A user-supplied object ID. If specified, the ID must be unique among all + * pages and page elements in the presentation. The ID should start with a + * word character [a-zA-Z0-9_] and then followed by any number of the + * following characters [a-zA-Z0-9_-:]. The length of the ID should not be + * less than 5 or greater than 50. If empty, a unique identifier will be + * generated. + */ + objectId: string; + /** + * The ID of the Google Sheets spreadsheet that contains the chart. + */ + spreadsheetId: string; + } /** - * Number of columns in the table. + * The result of creating an embedded Google Sheets chart. */ - columns: number; + export interface Schema$CreateSheetsChartResponse { + /** + * The object ID of the created chart. + */ + objectId: string; + } /** - * The element properties for the table. The table will be created at the - * provided size, subject to a minimum size. If no size is provided, the table - * will be automatically sized. Table transforms must have a scale of 1 and - * no shear components. If no transform is provided, the table will be - * centered on the page. + * Creates a new slide. */ - elementProperties: Schema$PageElementProperties; + export interface Schema$CreateSlideRequest { + /** + * The optional zero-based index indicating where to insert the slides. If + * you don't specify an index, the new slide is created at the end. + */ + insertionIndex: number; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If you don't specify an + * ID, a unique one is generated. + */ + objectId: string; + /** + * An optional list of object ID mappings from the placeholder(s) on the + * layout to the placeholder(s) that will be created on the new slide from + * that specified layout. Can only be used when `slide_layout_reference` is + * specified. + */ + placeholderIdMappings: Schema$LayoutPlaceholderIdMapping[]; + /** + * Layout reference of the slide to be inserted, based on the *current + * master*, which is one of the following: - The master of the previous + * slide index. - The master of the first slide, if the insertion_index is + * zero. - The first master in the presentation, if there are no slides. If + * the LayoutReference is not found in the current master, a 400 bad request + * error is returned. If you don't specify a layout reference, then the + * new slide will use the predefined layout `BLANK`. + */ + slideLayoutReference: Schema$LayoutReference; + } /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. + * The result of creating a slide. */ - objectId: string; + export interface Schema$CreateSlideResponse { + /** + * The object ID of the created slide. + */ + objectId: string; + } /** - * Number of rows in the table. + * Creates a new table. */ - rows: number; -} -/** - * The result of creating a table. - */ -export interface Schema$CreateTableResponse { + export interface Schema$CreateTableRequest { + /** + * Number of columns in the table. + */ + columns: number; + /** + * The element properties for the table. The table will be created at the + * provided size, subject to a minimum size. If no size is provided, the + * table will be automatically sized. Table transforms must have a scale of + * 1 and no shear components. If no transform is provided, the table will be + * centered on the page. + */ + elementProperties: Schema$PageElementProperties; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If you don't specify an + * ID, a unique one is generated. + */ + objectId: string; + /** + * Number of rows in the table. + */ + rows: number; + } /** - * The object ID of the created table. + * The result of creating a table. */ - objectId: string; -} -/** - * Creates a video. - */ -export interface Schema$CreateVideoRequest { + export interface Schema$CreateTableResponse { + /** + * The object ID of the created table. + */ + objectId: string; + } /** - * The element properties for the video. The PageElementProperties.size - * property is optional. If you don't specify a size, a default size is - * chosen by the server. The PageElementProperties.transform property is - * optional. The transform must not have shear components. If you don't - * specify a transform, the video will be placed at the top left corner of the - * page. + * Creates a video. */ - elementProperties: Schema$PageElementProperties; + export interface Schema$CreateVideoRequest { + /** + * The element properties for the video. The PageElementProperties.size + * property is optional. If you don't specify a size, a default size is + * chosen by the server. The PageElementProperties.transform property is + * optional. The transform must not have shear components. If you don't + * specify a transform, the video will be placed at the top left corner of + * the page. + */ + elementProperties: Schema$PageElementProperties; + /** + * The video source's unique identifier for this video. e.g. For + * YouTube video https://www.youtube.com/watch?v=7U3axjORYZ0, the ID is + * 7U3axjORYZ0. + */ + id: string; + /** + * A user-supplied object ID. If you specify an ID, it must be unique among + * all pages and page elements in the presentation. The ID must start with + * an alphanumeric character or an underscore (matches regex + * `[a-zA-Z0-9_]`); remaining characters may include those as well as a + * hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The length of the ID + * must not be less than 5 or greater than 50. If you don't specify an + * ID, a unique one is generated. + */ + objectId: string; + /** + * The video source. + */ + source: string; + } /** - * The video source's unique identifier for this video. e.g. For YouTube - * video https://www.youtube.com/watch?v=7U3axjORYZ0, the ID is 7U3axjORYZ0. + * The result of creating a video. */ - id: string; + export interface Schema$CreateVideoResponse { + /** + * The object ID of the created video. + */ + objectId: string; + } /** - * A user-supplied object ID. If you specify an ID, it must be unique among - * all pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. - */ - objectId: string; + * The crop properties of an object enclosed in a container. For example, an + * Image. The crop properties is represented by the offsets of four edges + * which define a crop rectangle. The offsets are measured in percentage from + * the corresponding edges of the object's original bounding rectangle + * towards inside, relative to the object's original dimensions. - If the + * offset is in the interval (0, 1), the corresponding edge of crop rectangle + * is positioned inside of the object's original bounding rectangle. - If + * the offset is negative or greater than 1, the corresponding edge of crop + * rectangle is positioned outside of the object's original bounding + * rectangle. - If the left edge of the crop rectangle is on the right side of + * its right edge, the object will be flipped horizontally. - If the top edge + * of the crop rectangle is below its bottom edge, the object will be flipped + * vertically. - If all offsets and rotation angle is 0, the object is not + * cropped. After cropping, the content in the crop rectangle will be + * stretched to fit its container. + */ + export interface Schema$CropProperties { + /** + * The rotation angle of the crop window around its center, in radians. + * Rotation angle is applied after the offset. + */ + angle: number; + /** + * The offset specifies the bottom edge of the crop rectangle that is + * located above the original bounding rectangle bottom edge, relative to + * the object's original height. + */ + bottomOffset: number; + /** + * The offset specifies the left edge of the crop rectangle that is located + * to the right of the original bounding rectangle left edge, relative to + * the object's original width. + */ + leftOffset: number; + /** + * The offset specifies the right edge of the crop rectangle that is located + * to the left of the original bounding rectangle right edge, relative to + * the object's original width. + */ + rightOffset: number; + /** + * The offset specifies the top edge of the crop rectangle that is located + * below the original bounding rectangle top edge, relative to the + * object's original height. + */ + topOffset: number; + } /** - * The video source. + * Deletes an object, either pages or page elements, from the presentation. */ - source: string; -} -/** - * The result of creating a video. - */ -export interface Schema$CreateVideoResponse { + export interface Schema$DeleteObjectRequest { + /** + * The object ID of the page or page element to delete. If after a delete + * operation a group contains only 1 or no page elements, the group is also + * deleted. If a placeholder is deleted on a layout, any empty inheriting + * shapes are also deleted. + */ + objectId: string; + } /** - * The object ID of the created video. - */ - objectId: string; -} -/** - * The crop properties of an object enclosed in a container. For example, an - * Image. The crop properties is represented by the offsets of four edges which - * define a crop rectangle. The offsets are measured in percentage from the - * corresponding edges of the object's original bounding rectangle towards - * inside, relative to the object's original dimensions. - If the offset is - * in the interval (0, 1), the corresponding edge of crop rectangle is - * positioned inside of the object's original bounding rectangle. - If the - * offset is negative or greater than 1, the corresponding edge of crop - * rectangle is positioned outside of the object's original bounding - * rectangle. - If the left edge of the crop rectangle is on the right side of - * its right edge, the object will be flipped horizontally. - If the top edge of - * the crop rectangle is below its bottom edge, the object will be flipped - * vertically. - If all offsets and rotation angle is 0, the object is not - * cropped. After cropping, the content in the crop rectangle will be stretched - * to fit its container. - */ -export interface Schema$CropProperties { + * Deletes bullets from all of the paragraphs that overlap with the given text + * index range. The nesting level of each paragraph will be visually + * preserved by adding indent to the start of the corresponding paragraph. + */ + export interface Schema$DeleteParagraphBulletsRequest { + /** + * The optional table cell location if the text to be modified is in a table + * cell. If present, the object_id must refer to a table. + */ + cellLocation: Schema$TableCellLocation; + /** + * The object ID of the shape or table containing the text to delete bullets + * from. + */ + objectId: string; + /** + * The range of text to delete bullets from, based on TextElement indexes. + */ + textRange: Schema$Range; + } /** - * The rotation angle of the crop window around its center, in radians. - * Rotation angle is applied after the offset. + * Deletes a column from a table. */ - angle: number; + export interface Schema$DeleteTableColumnRequest { + /** + * The reference table cell location from which a column will be deleted. + * The column this cell spans will be deleted. If this is a merged cell, + * multiple columns will be deleted. If no columns remain in the table after + * this deletion, the whole table is deleted. + */ + cellLocation: Schema$TableCellLocation; + /** + * The table to delete columns from. + */ + tableObjectId: string; + } /** - * The offset specifies the bottom edge of the crop rectangle that is located - * above the original bounding rectangle bottom edge, relative to the - * object's original height. + * Deletes a row from a table. */ - bottomOffset: number; + export interface Schema$DeleteTableRowRequest { + /** + * The reference table cell location from which a row will be deleted. The + * row this cell spans will be deleted. If this is a merged cell, multiple + * rows will be deleted. If no rows remain in the table after this deletion, + * the whole table is deleted. + */ + cellLocation: Schema$TableCellLocation; + /** + * The table to delete rows from. + */ + tableObjectId: string; + } /** - * The offset specifies the left edge of the crop rectangle that is located to - * the right of the original bounding rectangle left edge, relative to the - * object's original width. + * Deletes text from a shape or a table cell. */ - leftOffset: number; + export interface Schema$DeleteTextRequest { + /** + * The optional table cell location if the text is to be deleted from a + * table cell. If present, the object_id must refer to a table. + */ + cellLocation: Schema$TableCellLocation; + /** + * The object ID of the shape or table from which the text will be deleted. + */ + objectId: string; + /** + * The range of text to delete, based on TextElement indexes. There is + * always an implicit newline character at the end of a shape's or table + * cell's text that cannot be deleted. `Range.Type.ALL` will use the + * correct bounds, but care must be taken when specifying explicit bounds + * for range types `FROM_START_INDEX` and `FIXED_RANGE`. For example, if the + * text is "ABC", followed by an implicit newline, then the + * maximum value is 2 for `text_range.start_index` and 3 for + * `text_range.end_index`. Deleting text that crosses a paragraph boundary + * may result in changes to paragraph styles and lists as the two paragraphs + * are merged. Ranges that include only one code unit of a surrogate pair + * are expanded to include both code units. + */ + textRange: Schema$Range; + } /** - * The offset specifies the right edge of the crop rectangle that is located - * to the left of the original bounding rectangle right edge, relative to the - * object's original width. - */ - rightOffset: number; + * A magnitude in a single direction in the specified units. + */ + export interface Schema$Dimension { + /** + * The magnitude. + */ + magnitude: number; + /** + * The units for magnitude. + */ + unit: string; + } /** - * The offset specifies the top edge of the crop rectangle that is located - * below the original bounding rectangle top edge, relative to the - * object's original height. - */ - topOffset: number; -} -/** - * Deletes an object, either pages or page elements, from the presentation. - */ -export interface Schema$DeleteObjectRequest { + * Duplicates a slide or page element. When duplicating a slide, the + * duplicate slide will be created immediately following the specified slide. + * When duplicating a page element, the duplicate will be placed on the same + * page at the same position as the original. + */ + export interface Schema$DuplicateObjectRequest { + /** + * The ID of the object to duplicate. + */ + objectId: string; + /** + * The object being duplicated may contain other objects, for example when + * duplicating a slide or a group page element. This map defines how the IDs + * of duplicated objects are generated: the keys are the IDs of the original + * objects and its values are the IDs that will be assigned to the + * corresponding duplicate object. The ID of the source object's + * duplicate may be specified in this map as well, using the same value of + * the `object_id` field as a key and the newly desired ID as the value. All + * keys must correspond to existing IDs in the presentation. All values must + * be unique in the presentation and must start with an alphanumeric + * character or an underscore (matches regex `[a-zA-Z0-9_]`); remaining + * characters may include those as well as a hyphen or colon (matches regex + * `[a-zA-Z0-9_-:]`). The length of the new ID must not be less than 5 or + * greater than 50. If any IDs of source objects are omitted from the map, + * a new random ID will be assigned. If the map is empty or unset, all + * duplicate objects will receive a new random ID. + */ + objectIds: any; + } /** - * The object ID of the page or page element to delete. If after a delete - * operation a group contains only 1 or no page elements, the group is also - * deleted. If a placeholder is deleted on a layout, any empty inheriting - * shapes are also deleted. + * The response of duplicating an object. */ - objectId: string; -} -/** - * Deletes bullets from all of the paragraphs that overlap with the given text - * index range. The nesting level of each paragraph will be visually preserved - * by adding indent to the start of the corresponding paragraph. - */ -export interface Schema$DeleteParagraphBulletsRequest { + export interface Schema$DuplicateObjectResponse { + /** + * The ID of the new duplicate object. + */ + objectId: string; + } /** - * The optional table cell location if the text to be modified is in a table - * cell. If present, the object_id must refer to a table. + * A PageElement kind representing a joined collection of PageElements. */ - cellLocation: Schema$TableCellLocation; + export interface Schema$Group { + /** + * The collection of elements in the group. The minimum size of a group + * is 2. + */ + children: Schema$PageElement[]; + } /** - * The object ID of the shape or table containing the text to delete bullets - * from. - */ - objectId: string; + * Groups objects to create an object group. For example, groups PageElements + * to create a Group on the same page as all the children. + */ + export interface Schema$GroupObjectsRequest { + /** + * The object IDs of the objects to group. Only page elements can be + * grouped. There should be at least two page elements on the same page that + * are not already in another group. Some page elements, such as videos, + * tables and placeholder shapes cannot be grouped. + */ + childrenObjectIds: string[]; + /** + * A user-supplied object ID for the group to be created. If you specify an + * ID, it must be unique among all pages and page elements in the + * presentation. The ID must start with an alphanumeric character or an + * underscore (matches regex `[a-zA-Z0-9_]`); remaining characters may + * include those as well as a hyphen or colon (matches regex + * `[a-zA-Z0-9_-:]`). The length of the ID must not be less than 5 or + * greater than 50. If you don't specify an ID, a unique one is + * generated. + */ + groupObjectId: string; + } /** - * The range of text to delete bullets from, based on TextElement indexes. + * The result of grouping objects. */ - textRange: Schema$Range; -} -/** - * Deletes a column from a table. - */ -export interface Schema$DeleteTableColumnRequest { + export interface Schema$GroupObjectsResponse { + /** + * The object ID of the created group. + */ + objectId: string; + } /** - * The reference table cell location from which a column will be deleted. The - * column this cell spans will be deleted. If this is a merged cell, multiple - * columns will be deleted. If no columns remain in the table after this - * deletion, the whole table is deleted. - */ - cellLocation: Schema$TableCellLocation; + * A PageElement kind representing an image. + */ + export interface Schema$Image { + /** + * An URL to an image with a default lifetime of 30 minutes. This URL is + * tagged with the account of the requester. Anyone with the URL effectively + * accesses the image as the original requester. Access to the image may be + * lost if the presentation's sharing settings change. + */ + contentUrl: string; + /** + * The properties of the image. + */ + imageProperties: Schema$ImageProperties; + /** + * The source URL is the URL used to insert the image. The source URL can be + * empty. + */ + sourceUrl: string; + } /** - * The table to delete columns from. - */ - tableObjectId: string; -} -/** - * Deletes a row from a table. - */ -export interface Schema$DeleteTableRowRequest { + * The properties of the Image. + */ + export interface Schema$ImageProperties { + /** + * The brightness effect of the image. The value should be in the interval + * [-1.0, 1.0], where 0 means no effect. This property is read-only. + */ + brightness: number; + /** + * The contrast effect of the image. The value should be in the interval + * [-1.0, 1.0], where 0 means no effect. This property is read-only. + */ + contrast: number; + /** + * The crop properties of the image. If not set, the image is not cropped. + * This property is read-only. + */ + cropProperties: Schema$CropProperties; + /** + * The hyperlink destination of the image. If unset, there is no link. + */ + link: Schema$Link; + /** + * The outline of the image. If not set, the image has no outline. + */ + outline: Schema$Outline; + /** + * The recolor effect of the image. If not set, the image is not recolored. + * This property is read-only. + */ + recolor: Schema$Recolor; + /** + * The shadow of the image. If not set, the image has no shadow. This + * property is read-only. + */ + shadow: Schema$Shadow; + /** + * The transparency effect of the image. The value should be in the interval + * [0.0, 1.0], where 0 means no effect and 1 means completely transparent. + * This property is read-only. + */ + transparency: number; + } /** - * The reference table cell location from which a row will be deleted. The - * row this cell spans will be deleted. If this is a merged cell, multiple - * rows will be deleted. If no rows remain in the table after this deletion, - * the whole table is deleted. - */ - cellLocation: Schema$TableCellLocation; + * Inserts columns into a table. Other columns in the table will be resized + * to fit the new column. + */ + export interface Schema$InsertTableColumnsRequest { + /** + * The reference table cell location from which columns will be inserted. A + * new column will be inserted to the left (or right) of the column where + * the reference cell is. If the reference cell is a merged cell, a new + * column will be inserted to the left (or right) of the merged cell. + */ + cellLocation: Schema$TableCellLocation; + /** + * Whether to insert new columns to the right of the reference cell + * location. - `True`: insert to the right. - `False`: insert to the left. + */ + insertRight: boolean; + /** + * The number of columns to be inserted. Maximum 20 per request. + */ + number: number; + /** + * The table to insert columns into. + */ + tableObjectId: string; + } /** - * The table to delete rows from. + * Inserts rows into a table. */ - tableObjectId: string; -} -/** - * Deletes text from a shape or a table cell. - */ -export interface Schema$DeleteTextRequest { + export interface Schema$InsertTableRowsRequest { + /** + * The reference table cell location from which rows will be inserted. A + * new row will be inserted above (or below) the row where the reference + * cell is. If the reference cell is a merged cell, a new row will be + * inserted above (or below) the merged cell. + */ + cellLocation: Schema$TableCellLocation; + /** + * Whether to insert new rows below the reference cell location. - `True`: + * insert below the cell. - `False`: insert above the cell. + */ + insertBelow: boolean; + /** + * The number of rows to be inserted. Maximum 20 per request. + */ + number: number; + /** + * The table to insert rows into. + */ + tableObjectId: string; + } /** - * The optional table cell location if the text is to be deleted from a table - * cell. If present, the object_id must refer to a table. - */ - cellLocation: Schema$TableCellLocation; + * Inserts text into a shape or a table cell. + */ + export interface Schema$InsertTextRequest { + /** + * The optional table cell location if the text is to be inserted into a + * table cell. If present, the object_id must refer to a table. + */ + cellLocation: Schema$TableCellLocation; + /** + * The index where the text will be inserted, in Unicode code units, based + * on TextElement indexes. The index is zero-based and is computed from the + * start of the string. The index may be adjusted to prevent insertions + * inside Unicode grapheme clusters. In these cases, the text will be + * inserted immediately after the grapheme cluster. + */ + insertionIndex: number; + /** + * The object ID of the shape or table where the text will be inserted. + */ + objectId: string; + /** + * The text to be inserted. Inserting a newline character will implicitly + * create a new ParagraphMarker at that index. The paragraph style of the + * new paragraph will be copied from the paragraph at the current insertion + * index, including lists and bullets. Text styles for inserted text will + * be determined automatically, generally preserving the styling of + * neighboring text. In most cases, the text will be added to the TextRun + * that exists at the insertion index. Some control characters + * (U+0000-U+0008, U+000C-U+001F) and characters from the Unicode Basic + * Multilingual Plane Private Use Area (U+E000-U+F8FF) will be stripped out + * of the inserted text. + */ + text: string; + } /** - * The object ID of the shape or table from which the text will be deleted. - */ - objectId: string; + * The user-specified ID mapping for a placeholder that will be created on a + * slide from a specified layout. + */ + export interface Schema$LayoutPlaceholderIdMapping { + /** + * The placeholder on a layout that will be applied to a slide. Only type + * and index are needed. For example, a predefined `TITLE_AND_BODY` layout + * may usually have a TITLE placeholder with index 0 and a BODY placeholder + * with index 0. + */ + layoutPlaceholder: Schema$Placeholder; + /** + * The object ID of the placeholder on a layout that will be applied to a + * slide. + */ + layoutPlaceholderObjectId: string; + /** + * A user-supplied object ID for the placeholder identified above that to be + * created onto a slide. If you specify an ID, it must be unique among all + * pages and page elements in the presentation. The ID must start with an + * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); + * remaining characters may include those as well as a hyphen or colon + * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less + * than 5 or greater than 50. If you don't specify an ID, a unique one + * is generated. + */ + objectId: string; + } /** - * The range of text to delete, based on TextElement indexes. There is always - * an implicit newline character at the end of a shape's or table - * cell's text that cannot be deleted. `Range.Type.ALL` will use the - * correct bounds, but care must be taken when specifying explicit bounds for - * range types `FROM_START_INDEX` and `FIXED_RANGE`. For example, if the text - * is "ABC", followed by an implicit newline, then the maximum value - * is 2 for `text_range.start_index` and 3 for `text_range.end_index`. - * Deleting text that crosses a paragraph boundary may result in changes to - * paragraph styles and lists as the two paragraphs are merged. Ranges that - * include only one code unit of a surrogate pair are expanded to include both - * code units. - */ - textRange: Schema$Range; -} -/** - * A magnitude in a single direction in the specified units. - */ -export interface Schema$Dimension { + * The properties of Page are only relevant for pages with page_type LAYOUT. + */ + export interface Schema$LayoutProperties { + /** + * The human-readable name of the layout. + */ + displayName: string; + /** + * The object ID of the master that this layout is based on. + */ + masterObjectId: string; + /** + * The name of the layout. + */ + name: string; + } /** - * The magnitude. - */ - magnitude: number; + * Slide layout reference. This may reference either: - A predefined layout - + * One of the layouts in the presentation. + */ + export interface Schema$LayoutReference { + /** + * Layout ID: the object ID of one of the layouts in the presentation. + */ + layoutId: string; + /** + * Predefined layout. + */ + predefinedLayout: string; + } /** - * The units for magnitude. - */ - unit: string; -} -/** - * Duplicates a slide or page element. When duplicating a slide, the duplicate - * slide will be created immediately following the specified slide. When - * duplicating a page element, the duplicate will be placed on the same page at - * the same position as the original. - */ -export interface Schema$DuplicateObjectRequest { - /** - * The ID of the object to duplicate. - */ - objectId: string; - /** - * The object being duplicated may contain other objects, for example when - * duplicating a slide or a group page element. This map defines how the IDs - * of duplicated objects are generated: the keys are the IDs of the original - * objects and its values are the IDs that will be assigned to the - * corresponding duplicate object. The ID of the source object's duplicate - * may be specified in this map as well, using the same value of the - * `object_id` field as a key and the newly desired ID as the value. All keys - * must correspond to existing IDs in the presentation. All values must be - * unique in the presentation and must start with an alphanumeric character or - * an underscore (matches regex `[a-zA-Z0-9_]`); remaining characters may - * include those as well as a hyphen or colon (matches regex - * `[a-zA-Z0-9_-:]`). The length of the new ID must not be less than 5 or - * greater than 50. If any IDs of source objects are omitted from the map, a - * new random ID will be assigned. If the map is empty or unset, all duplicate - * objects will receive a new random ID. - */ - objectIds: any; -} -/** - * The response of duplicating an object. - */ -export interface Schema$DuplicateObjectResponse { + * A PageElement kind representing a non-connector line, straight connector, + * curved connector, or bent connector. + */ + export interface Schema$Line { + /** + * The properties of the line. + */ + lineProperties: Schema$LineProperties; + /** + * The type of the line. + */ + lineType: string; + } /** - * The ID of the new duplicate object. + * The fill of the line. */ - objectId: string; -} -/** - * A PageElement kind representing a joined collection of PageElements. - */ -export interface Schema$Group { + export interface Schema$LineFill { + /** + * Solid color fill. + */ + solidFill: Schema$SolidFill; + } /** - * The collection of elements in the group. The minimum size of a group is 2. - */ - children: Schema$PageElement[]; -} -/** - * Groups objects to create an object group. For example, groups PageElements to - * create a Group on the same page as all the children. - */ -export interface Schema$GroupObjectsRequest { - /** - * The object IDs of the objects to group. Only page elements can be grouped. - * There should be at least two page elements on the same page that are not - * already in another group. Some page elements, such as videos, tables and - * placeholder shapes cannot be grouped. - */ - childrenObjectIds: string[]; - /** - * A user-supplied object ID for the group to be created. If you specify an - * ID, it must be unique among all pages and page elements in the - * presentation. The ID must start with an alphanumeric character or an - * underscore (matches regex `[a-zA-Z0-9_]`); remaining characters may include - * those as well as a hyphen or colon (matches regex `[a-zA-Z0-9_-:]`). The - * length of the ID must not be less than 5 or greater than 50. If you - * don't specify an ID, a unique one is generated. - */ - groupObjectId: string; -} -/** - * The result of grouping objects. - */ -export interface Schema$GroupObjectsResponse { - /** - * The object ID of the created group. - */ - objectId: string; -} -/** - * A PageElement kind representing an image. - */ -export interface Schema$Image { - /** - * An URL to an image with a default lifetime of 30 minutes. This URL is - * tagged with the account of the requester. Anyone with the URL effectively - * accesses the image as the original requester. Access to the image may be - * lost if the presentation's sharing settings change. - */ - contentUrl: string; - /** - * The properties of the image. - */ - imageProperties: Schema$ImageProperties; - /** - * The source URL is the URL used to insert the image. The source URL can be - * empty. - */ - sourceUrl: string; -} -/** - * The properties of the Image. - */ -export interface Schema$ImageProperties { - /** - * The brightness effect of the image. The value should be in the interval - * [-1.0, 1.0], where 0 means no effect. This property is read-only. - */ - brightness: number; - /** - * The contrast effect of the image. The value should be in the interval - * [-1.0, 1.0], where 0 means no effect. This property is read-only. - */ - contrast: number; - /** - * The crop properties of the image. If not set, the image is not cropped. - * This property is read-only. - */ - cropProperties: Schema$CropProperties; - /** - * The hyperlink destination of the image. If unset, there is no link. - */ - link: Schema$Link; - /** - * The outline of the image. If not set, the image has no outline. - */ - outline: Schema$Outline; - /** - * The recolor effect of the image. If not set, the image is not recolored. - * This property is read-only. - */ - recolor: Schema$Recolor; - /** - * The shadow of the image. If not set, the image has no shadow. This property - * is read-only. - */ - shadow: Schema$Shadow; - /** - * The transparency effect of the image. The value should be in the interval - * [0.0, 1.0], where 0 means no effect and 1 means completely transparent. - * This property is read-only. - */ - transparency: number; -} -/** - * Inserts columns into a table. Other columns in the table will be resized to - * fit the new column. - */ -export interface Schema$InsertTableColumnsRequest { - /** - * The reference table cell location from which columns will be inserted. A - * new column will be inserted to the left (or right) of the column where the - * reference cell is. If the reference cell is a merged cell, a new column - * will be inserted to the left (or right) of the merged cell. - */ - cellLocation: Schema$TableCellLocation; - /** - * Whether to insert new columns to the right of the reference cell location. - * - `True`: insert to the right. - `False`: insert to the left. - */ - insertRight: boolean; - /** - * The number of columns to be inserted. Maximum 20 per request. - */ - number: number; - /** - * The table to insert columns into. - */ - tableObjectId: string; -} -/** - * Inserts rows into a table. - */ -export interface Schema$InsertTableRowsRequest { - /** - * The reference table cell location from which rows will be inserted. A new - * row will be inserted above (or below) the row where the reference cell is. - * If the reference cell is a merged cell, a new row will be inserted above - * (or below) the merged cell. - */ - cellLocation: Schema$TableCellLocation; - /** - * Whether to insert new rows below the reference cell location. - `True`: - * insert below the cell. - `False`: insert above the cell. - */ - insertBelow: boolean; - /** - * The number of rows to be inserted. Maximum 20 per request. - */ - number: number; - /** - * The table to insert rows into. - */ - tableObjectId: string; -} -/** - * Inserts text into a shape or a table cell. - */ -export interface Schema$InsertTextRequest { - /** - * The optional table cell location if the text is to be inserted into a table - * cell. If present, the object_id must refer to a table. - */ - cellLocation: Schema$TableCellLocation; - /** - * The index where the text will be inserted, in Unicode code units, based on - * TextElement indexes. The index is zero-based and is computed from the - * start of the string. The index may be adjusted to prevent insertions inside - * Unicode grapheme clusters. In these cases, the text will be inserted - * immediately after the grapheme cluster. - */ - insertionIndex: number; - /** - * The object ID of the shape or table where the text will be inserted. - */ - objectId: string; - /** - * The text to be inserted. Inserting a newline character will implicitly - * create a new ParagraphMarker at that index. The paragraph style of the new - * paragraph will be copied from the paragraph at the current insertion index, - * including lists and bullets. Text styles for inserted text will be - * determined automatically, generally preserving the styling of neighboring - * text. In most cases, the text will be added to the TextRun that exists at - * the insertion index. Some control characters (U+0000-U+0008, - * U+000C-U+001F) and characters from the Unicode Basic Multilingual Plane - * Private Use Area (U+E000-U+F8FF) will be stripped out of the inserted text. - */ - text: string; -} -/** - * The user-specified ID mapping for a placeholder that will be created on a - * slide from a specified layout. - */ -export interface Schema$LayoutPlaceholderIdMapping { - /** - * The placeholder on a layout that will be applied to a slide. Only type and - * index are needed. For example, a predefined `TITLE_AND_BODY` layout may - * usually have a TITLE placeholder with index 0 and a BODY placeholder with - * index 0. - */ - layoutPlaceholder: Schema$Placeholder; - /** - * The object ID of the placeholder on a layout that will be applied to a - * slide. - */ - layoutPlaceholderObjectId: string; - /** - * A user-supplied object ID for the placeholder identified above that to be - * created onto a slide. If you specify an ID, it must be unique among all - * pages and page elements in the presentation. The ID must start with an - * alphanumeric character or an underscore (matches regex `[a-zA-Z0-9_]`); - * remaining characters may include those as well as a hyphen or colon - * (matches regex `[a-zA-Z0-9_-:]`). The length of the ID must not be less - * than 5 or greater than 50. If you don't specify an ID, a unique one is - * generated. - */ - objectId: string; -} -/** - * The properties of Page are only relevant for pages with page_type LAYOUT. - */ -export interface Schema$LayoutProperties { - /** - * The human-readable name of the layout. - */ - displayName: string; - /** - * The object ID of the master that this layout is based on. - */ - masterObjectId: string; - /** - * The name of the layout. - */ - name: string; -} -/** - * Slide layout reference. This may reference either: - A predefined layout - - * One of the layouts in the presentation. - */ -export interface Schema$LayoutReference { - /** - * Layout ID: the object ID of one of the layouts in the presentation. - */ - layoutId: string; - /** - * Predefined layout. - */ - predefinedLayout: string; -} -/** - * A PageElement kind representing a non-connector line, straight connector, - * curved connector, or bent connector. - */ -export interface Schema$Line { - /** - * The properties of the line. - */ - lineProperties: Schema$LineProperties; - /** - * The type of the line. - */ - lineType: string; -} -/** - * The fill of the line. - */ -export interface Schema$LineFill { - /** - * Solid color fill. - */ - solidFill: Schema$SolidFill; -} -/** - * The properties of the Line. When unset, these fields default to values that - * match the appearance of new lines created in the Slides editor. - */ -export interface Schema$LineProperties { - /** - * The dash style of the line. - */ - dashStyle: string; - /** - * The style of the arrow at the end of the line. - */ - endArrow: string; - /** - * The fill of the line. The default line fill matches the defaults for new - * lines created in the Slides editor. - */ - lineFill: Schema$LineFill; - /** - * The hyperlink destination of the line. If unset, there is no link. - */ - link: Schema$Link; - /** - * The style of the arrow at the beginning of the line. - */ - startArrow: string; - /** - * The thickness of the line. - */ - weight: Schema$Dimension; -} -/** - * A hypertext link. - */ -export interface Schema$Link { - /** - * If set, indicates this is a link to the specific page in this presentation - * with this ID. A page with this ID may not exist. - */ - pageObjectId: string; - /** - * If set, indicates this is a link to a slide in this presentation, addressed - * by its position. - */ - relativeLink: string; - /** - * If set, indicates this is a link to the slide at this zero-based index in - * the presentation. There may not be a slide at this index. - */ - slideIndex: number; - /** - * If set, indicates this is a link to the external web page at this URL. - */ - url: string; -} -/** - * A List describes the look and feel of bullets belonging to paragraphs - * associated with a list. A paragraph that is part of a list has an implicit - * reference to that list's ID. - */ -export interface Schema$List { - /** - * The ID of the list. - */ - listId: string; - /** - * A map of nesting levels to the properties of bullets at the associated - * level. A list has at most nine levels of nesting, so the possible values - * for the keys of this map are 0 through 8, inclusive. - */ - nestingLevel: any; -} -/** - * The properties of Page that are only relevant for pages with page_type - * MASTER. - */ -export interface Schema$MasterProperties { - /** - * The human-readable name of the master. - */ - displayName: string; -} -/** - * Merges cells in a Table. - */ -export interface Schema$MergeTableCellsRequest { - /** - * The object ID of the table. - */ - objectId: string; - /** - * The table range specifying which cells of the table to merge. Any text in - * the cells being merged will be concatenated and stored in the upper-left - * ("head") cell of the range. If the range is non-rectangular - * (which can occur in some cases where the range covers cells that are - * already merged), a 400 bad request error is returned. - */ - tableRange: Schema$TableRange; -} -/** - * Contains properties describing the look and feel of a list bullet at a given - * level of nesting. - */ -export interface Schema$NestingLevel { - /** - * The style of a bullet at this level of nesting. - */ - bulletStyle: Schema$TextStyle; -} -/** - * The properties of Page that are only relevant for pages with page_type NOTES. - */ -export interface Schema$NotesProperties { - /** - * The object ID of the shape on this notes page that contains the speaker - * notes for the corresponding slide. The actual shape may not always exist on - * the notes page. Inserting text using this object ID will automatically - * create the shape. In this case, the actual shape may have different object - * ID. The `GetPresentation` or `GetPage` action will always return the latest - * object ID. - */ - speakerNotesObjectId: string; -} -/** - * A themeable solid color value. - */ -export interface Schema$OpaqueColor { - /** - * An opaque RGB color. - */ - rgbColor: Schema$RgbColor; - /** - * An opaque theme color. - */ - themeColor: string; -} -/** - * A color that can either be fully opaque or fully transparent. - */ -export interface Schema$OptionalColor { - /** - * If set, this will be used as an opaque color. If unset, this represents a - * transparent color. - */ - opaqueColor: Schema$OpaqueColor; -} -/** - * The outline of a PageElement. If these fields are unset, they may be - * inherited from a parent placeholder if it exists. If there is no parent, the - * fields will default to the value used for new page elements created in the - * Slides editor, which may depend on the page element kind. - */ -export interface Schema$Outline { - /** - * The dash style of the outline. - */ - dashStyle: string; - /** - * The fill of the outline. - */ - outlineFill: Schema$OutlineFill; - /** - * The outline property state. Updating the outline on a page element will - * implicitly update this field to `RENDERED`, unless another value is - * specified in the same request. To have no outline on a page element, set - * this field to `NOT_RENDERED`. In this case, any other outline fields set in - * the same request will be ignored. - */ - propertyState: string; - /** - * The thickness of the outline. - */ - weight: Schema$Dimension; -} -/** - * The fill of the outline. - */ -export interface Schema$OutlineFill { - /** - * Solid color fill. - */ - solidFill: Schema$SolidFill; -} -/** - * A page in a presentation. - */ -export interface Schema$Page { - /** - * Layout specific properties. Only set if page_type = LAYOUT. - */ - layoutProperties: Schema$LayoutProperties; - /** - * Master specific properties. Only set if page_type = MASTER. - */ - masterProperties: Schema$MasterProperties; - /** - * Notes specific properties. Only set if page_type = NOTES. - */ - notesProperties: Schema$NotesProperties; - /** - * The object ID for this page. Object IDs used by Page and PageElement share - * the same namespace. - */ - objectId: string; - /** - * The page elements rendered on the page. - */ - pageElements: Schema$PageElement[]; - /** - * The properties of the page. - */ - pageProperties: Schema$PageProperties; - /** - * The type of the page. - */ - pageType: string; - /** - * The revision ID of the presentation containing this page. Can be used in - * update requests to assert that the presentation revision hasn't changed - * since the last read operation. Only populated if the user has edit access - * to the presentation. The format of the revision ID may change over time, - * so it should be treated opaquely. A returned revision ID is only guaranteed - * to be valid for 24 hours after it has been returned and cannot be shared - * across users. If the revision ID is unchanged between calls, then the - * presentation has not changed. Conversely, a changed ID (for the same - * presentation and user) usually means the presentation has been updated; - * however, a changed ID can also be due to internal factors such as ID format - * changes. - */ - revisionId: string; - /** - * Slide specific properties. Only set if page_type = SLIDE. - */ - slideProperties: Schema$SlideProperties; -} -/** - * The page background fill. - */ -export interface Schema$PageBackgroundFill { - /** - * The background fill property state. Updating the fill on a page will - * implicitly update this field to `RENDERED`, unless another value is - * specified in the same request. To have no fill on a page, set this field to - * `NOT_RENDERED`. In this case, any other fill fields set in the same request - * will be ignored. - */ - propertyState: string; - /** - * Solid color fill. - */ - solidFill: Schema$SolidFill; - /** - * Stretched picture fill. - */ - stretchedPictureFill: Schema$StretchedPictureFill; -} -/** - * A visual element rendered on a page. - */ -export interface Schema$PageElement { - /** - * The description of the page element. Combined with title to display alt - * text. - */ - description: string; - /** - * A collection of page elements joined as a single unit. - */ - elementGroup: Schema$Group; - /** - * An image page element. - */ - image: Schema$Image; - /** - * A line page element. - */ - line: Schema$Line; - /** - * The object ID for this page element. Object IDs used by - * google.apps.slides.v1.Page and google.apps.slides.v1.PageElement share the - * same namespace. - */ - objectId: string; - /** - * A generic shape. - */ - shape: Schema$Shape; - /** - * A linked chart embedded from Google Sheets. Unlinked charts are represented - * as images. - */ - sheetsChart: Schema$SheetsChart; - /** - * The size of the page element. - */ - size: Schema$Size; - /** - * A table page element. - */ - table: Schema$Table; - /** - * The title of the page element. Combined with description to display alt - * text. - */ - title: string; - /** - * The transform of the page element. The visual appearance of the page - * element is determined by its absolute transform. To compute the absolute - * transform, preconcatenate a page element's transform with the - * transforms of all of its parent groups. If the page element is not in a - * group, its absolute transform is the same as the value in this field. The - * initial transform for the newly created Group is always the identity - * transform. - */ - transform: Schema$AffineTransform; - /** - * A video page element. - */ - video: Schema$Video; - /** - * A word art page element. - */ - wordArt: Schema$WordArt; -} -/** - * Common properties for a page element. Note: When you initially create a - * PageElement, the API may modify the values of both `size` and `transform`, - * but the visual size will be unchanged. - */ -export interface Schema$PageElementProperties { - /** - * The object ID of the page where the element is located. - */ - pageObjectId: string; - /** - * The size of the element. - */ - size: Schema$Size; - /** - * The transform for the element. - */ - transform: Schema$AffineTransform; -} -/** - * The properties of the Page. The page will inherit properties from the parent - * page. Depending on the page type the hierarchy is defined in either - * SlideProperties or LayoutProperties. - */ -export interface Schema$PageProperties { - /** - * The color scheme of the page. If unset, the color scheme is inherited from - * a parent page. If the page has no parent, the color scheme uses a default - * Slides color scheme. This field is read-only. - */ - colorScheme: Schema$ColorScheme; - /** - * The background fill of the page. If unset, the background fill is inherited - * from a parent page if it exists. If the page has no parent, then the - * background fill defaults to the corresponding fill in the Slides editor. - */ - pageBackgroundFill: Schema$PageBackgroundFill; -} -/** - * A TextElement kind that represents the beginning of a new paragraph. - */ -export interface Schema$ParagraphMarker { - /** - * The bullet for this paragraph. If not present, the paragraph does not - * belong to a list. - */ - bullet: Schema$Bullet; - /** - * The paragraph's style - */ - style: Schema$ParagraphStyle; -} -/** - * Styles that apply to a whole paragraph. If this text is contained in a shape - * with a parent placeholder, then these paragraph styles may be inherited from - * the parent. Which paragraph styles are inherited depend on the nesting level - * of lists: * A paragraph not in a list will inherit its paragraph style from - * the paragraph at the 0 nesting level of the list inside the parent - * placeholder. * A paragraph in a list will inherit its paragraph style from - * the paragraph at its corresponding nesting level of the list inside the - * parent placeholder. Inherited paragraph styles are represented as unset - * fields in this message. - */ -export interface Schema$ParagraphStyle { - /** - * The text alignment for this paragraph. - */ - alignment: string; - /** - * The text direction of this paragraph. If unset, the value defaults to - * LEFT_TO_RIGHT since text direction is not inherited. - */ - direction: string; - /** - * The amount indentation for the paragraph on the side that corresponds to - * the end of the text, based on the current text direction. If unset, the - * value is inherited from the parent. - */ - indentEnd: Schema$Dimension; - /** - * The amount of indentation for the start of the first line of the paragraph. - * If unset, the value is inherited from the parent. - */ - indentFirstLine: Schema$Dimension; - /** - * The amount indentation for the paragraph on the side that corresponds to - * the start of the text, based on the current text direction. If unset, the - * value is inherited from the parent. - */ - indentStart: Schema$Dimension; - /** - * The amount of space between lines, as a percentage of normal, where normal - * is represented as 100.0. If unset, the value is inherited from the parent. - */ - lineSpacing: number; - /** - * The amount of extra space above the paragraph. If unset, the value is - * inherited from the parent. - */ - spaceAbove: Schema$Dimension; - /** - * The amount of extra space above the paragraph. If unset, the value is - * inherited from the parent. - */ - spaceBelow: Schema$Dimension; - /** - * The spacing mode for the paragraph. - */ - spacingMode: string; -} -/** - * The placeholder information that uniquely identifies a placeholder shape. - */ -export interface Schema$Placeholder { - /** - * The index of the placeholder. If the same placeholder types are present in - * the same page, they would have different index values. - */ - index: number; - /** - * The object ID of this shape's parent placeholder. If unset, the parent - * placeholder shape does not exist, so the shape does not inherit properties - * from any other shape. - */ - parentObjectId: string; - /** - * The type of the placeholder. - */ - type: string; -} -/** - * A Google Slides presentation. - */ -export interface Schema$Presentation { - /** - * The layouts in the presentation. A layout is a template that determines how - * content is arranged and styled on the slides that inherit from that layout. - */ - layouts: Schema$Page[]; - /** - * The locale of the presentation, as an IETF BCP 47 language tag. - */ - locale: string; - /** - * The slide masters in the presentation. A slide master contains all common - * page elements and the common properties for a set of layouts. They serve - * three purposes: - Placeholder shapes on a master contain the default text - * styles and shape properties of all placeholder shapes on pages that use - * that master. - The master page properties define the common page properties - * inherited by its layouts. - Any other shapes on the master slide will - * appear on all slides using that master, regardless of their layout. - */ - masters: Schema$Page[]; - /** - * The notes master in the presentation. It serves three purposes: - - * Placeholder shapes on a notes master contain the default text styles and - * shape properties of all placeholder shapes on notes pages. Specifically, a - * `SLIDE_IMAGE` placeholder shape contains the slide thumbnail, and a `BODY` - * placeholder shape contains the speaker notes. - The notes master page - * properties define the common page properties inherited by all notes - * pages. - Any other shapes on the notes master will appear on all notes - * pages. The notes master is read-only. - */ - notesMaster: Schema$Page; - /** - * The size of pages in the presentation. - */ - pageSize: Schema$Size; - /** - * The ID of the presentation. - */ - presentationId: string; - /** - * The revision ID of the presentation. Can be used in update requests to - * assert that the presentation revision hasn't changed since the last - * read operation. Only populated if the user has edit access to the - * presentation. The format of the revision ID may change over time, so it - * should be treated opaquely. A returned revision ID is only guaranteed to be - * valid for 24 hours after it has been returned and cannot be shared across - * users. If the revision ID is unchanged between calls, then the presentation - * has not changed. Conversely, a changed ID (for the same presentation and - * user) usually means the presentation has been updated; however, a changed - * ID can also be due to internal factors such as ID format changes. - */ - revisionId: string; - /** - * The slides in the presentation. A slide inherits properties from a slide - * layout. - */ - slides: Schema$Page[]; - /** - * The title of the presentation. - */ - title: string; -} -/** - * Specifies a contiguous range of an indexed collection, such as characters in - * text. - */ -export interface Schema$Range { - /** - * The optional zero-based index of the end of the collection. Required for - * `FIXED_RANGE` ranges. - */ - endIndex: number; - /** - * The optional zero-based index of the beginning of the collection. Required - * for `FIXED_RANGE` and `FROM_START_INDEX` ranges. - */ - startIndex: number; - /** - * The type of range. - */ - type: string; -} -/** - * A recolor effect applied on an image. - */ -export interface Schema$Recolor { - /** - * The name of the recolor effect. The name is determined from the - * `recolor_stops` by matching the gradient against the colors in the - * page's current color scheme. This property is read-only. - */ - name: string; - /** - * The recolor effect is represented by a gradient, which is a list of color - * stops. The colors in the gradient will replace the corresponding colors at - * the same position in the color palette and apply to the image. This - * property is read-only. - */ - recolorStops: Schema$ColorStop[]; -} -/** - * Refreshes an embedded Google Sheets chart by replacing it with the latest - * version of the chart from Google Sheets. NOTE: Refreshing charts requires at - * least one of the spreadsheets.readonly, spreadsheets, drive.readonly, or - * drive OAuth scopes. - */ -export interface Schema$RefreshSheetsChartRequest { - /** - * The object ID of the chart to refresh. - */ - objectId: string; -} -/** - * Replaces all shapes that match the given criteria with the provided image. - * The images replacing the shapes are rectangular after being inserted into the - * presentation and do not take on the forms of the shapes. - */ -export interface Schema$ReplaceAllShapesWithImageRequest { - /** - * If set, this request will replace all of the shapes that contain the given - * text. - */ - containsText: Schema$SubstringMatchCriteria; - /** - * The image replace method. If you specify both a `replace_method` and an - * `image_replace_method`, the `image_replace_method` takes precedence. If - * you do not specify a value for `image_replace_method`, but specify a value - * for `replace_method`, then the specified `replace_method` value is used. If - * you do not specify either, then CENTER_INSIDE is used. - */ - imageReplaceMethod: string; - /** - * The image URL. The image is fetched once at insertion time and a copy is - * stored for display inside the presentation. Images must be less than 50MB - * in size, cannot exceed 25 megapixels, and must be in one of PNG, JPEG, or - * GIF format. The provided URL can be at most 2 kB in length. The URL itself - * is saved with the image, and exposed via the Image.source_url field. - */ - imageUrl: string; - /** - * If non-empty, limits the matches to page elements only on the given pages. - * Returns a 400 bad request error if given the page object ID of a notes page - * or a notes master, or if a page with that object ID doesn't exist in - * the presentation. - */ - pageObjectIds: string[]; - /** - * The replace method. Deprecated: use `image_replace_method` instead. If you - * specify both a `replace_method` and an `image_replace_method`, the - * `image_replace_method` takes precedence. - */ - replaceMethod: string; -} -/** - * The result of replacing shapes with an image. - */ -export interface Schema$ReplaceAllShapesWithImageResponse { - /** - * The number of shapes replaced with images. - */ - occurrencesChanged: number; -} -/** - * Replaces all shapes that match the given criteria with the provided Google - * Sheets chart. The chart will be scaled and centered to fit within the bounds - * of the original shape. NOTE: Replacing shapes with a chart requires at least - * one of the spreadsheets.readonly, spreadsheets, drive.readonly, or drive - * OAuth scopes. - */ -export interface Schema$ReplaceAllShapesWithSheetsChartRequest { - /** - * The ID of the specific chart in the Google Sheets spreadsheet. - */ - chartId: number; - /** - * The criteria that the shapes must match in order to be replaced. The - * request will replace all of the shapes that contain the given text. - */ - containsText: Schema$SubstringMatchCriteria; - /** - * The mode with which the chart is linked to the source spreadsheet. When not - * specified, the chart will be an image that is not linked. - */ - linkingMode: string; - /** - * If non-empty, limits the matches to page elements only on the given pages. - * Returns a 400 bad request error if given the page object ID of a notes page - * or a notes master, or if a page with that object ID doesn't exist in - * the presentation. - */ - pageObjectIds: string[]; - /** - * The ID of the Google Sheets spreadsheet that contains the chart. - */ - spreadsheetId: string; -} -/** - * The result of replacing shapes with a Google Sheets chart. - */ -export interface Schema$ReplaceAllShapesWithSheetsChartResponse { - /** - * The number of shapes replaced with charts. - */ - occurrencesChanged: number; -} -/** - * Replaces all instances of text matching a criteria with replace text. - */ -export interface Schema$ReplaceAllTextRequest { - /** - * Finds text in a shape matching this substring. - */ - containsText: Schema$SubstringMatchCriteria; - /** - * If non-empty, limits the matches to page elements only on the given pages. - * Returns a 400 bad request error if given the page object ID of a notes - * master, or if a page with that object ID doesn't exist in the - * presentation. - */ - pageObjectIds: string[]; - /** - * The text that will replace the matched text. - */ - replaceText: string; -} -/** - * The result of replacing text. - */ -export interface Schema$ReplaceAllTextResponse { - /** - * The number of occurrences changed by replacing all text. - */ - occurrencesChanged: number; -} -/** - * Replaces an existing image with a new image. Replacing an image removes some - * image effects from the existing image. - */ -export interface Schema$ReplaceImageRequest { - /** - * The ID of the existing image that will be replaced. - */ - imageObjectId: string; - /** - * The replacement method. - */ - imageReplaceMethod: string; - /** - * The URL of the new image. The image is fetched once at insertion time and - * a copy is stored for display inside the presentation. Images must be less - * than 50MB in size, cannot exceed 25 megapixels, and must be in one of PNG, - * JPEG, or GIF format. The provided URL can be at most 2 kB in length. The - * URL itself is saved with the image, and exposed via the Image.source_url - * field. - */ - url: string; -} -/** - * A single kind of update to apply to a presentation. - */ -export interface Schema$Request { - /** - * Creates an image. - */ - createImage: Schema$CreateImageRequest; - /** - * Creates a line. - */ - createLine: Schema$CreateLineRequest; - /** - * Creates bullets for paragraphs. - */ - createParagraphBullets: Schema$CreateParagraphBulletsRequest; - /** - * Creates a new shape. - */ - createShape: Schema$CreateShapeRequest; - /** - * Creates an embedded Google Sheets chart. - */ - createSheetsChart: Schema$CreateSheetsChartRequest; - /** - * Creates a new slide. - */ - createSlide: Schema$CreateSlideRequest; - /** - * Creates a new table. - */ - createTable: Schema$CreateTableRequest; - /** - * Creates a video. - */ - createVideo: Schema$CreateVideoRequest; - /** - * Deletes a page or page element from the presentation. - */ - deleteObject: Schema$DeleteObjectRequest; - /** - * Deletes bullets from paragraphs. - */ - deleteParagraphBullets: Schema$DeleteParagraphBulletsRequest; - /** - * Deletes a column from a table. - */ - deleteTableColumn: Schema$DeleteTableColumnRequest; - /** - * Deletes a row from a table. - */ - deleteTableRow: Schema$DeleteTableRowRequest; - /** - * Deletes text from a shape or a table cell. - */ - deleteText: Schema$DeleteTextRequest; - /** - * Duplicates a slide or page element. - */ - duplicateObject: Schema$DuplicateObjectRequest; - /** - * Groups objects, such as page elements. - */ - groupObjects: Schema$GroupObjectsRequest; - /** - * Inserts columns into a table. - */ - insertTableColumns: Schema$InsertTableColumnsRequest; - /** - * Inserts rows into a table. - */ - insertTableRows: Schema$InsertTableRowsRequest; - /** - * Inserts text into a shape or table cell. - */ - insertText: Schema$InsertTextRequest; - /** - * Merges cells in a Table. - */ - mergeTableCells: Schema$MergeTableCellsRequest; - /** - * Refreshes a Google Sheets chart. - */ - refreshSheetsChart: Schema$RefreshSheetsChartRequest; - /** - * Replaces all shapes matching some criteria with an image. - */ - replaceAllShapesWithImage: Schema$ReplaceAllShapesWithImageRequest; - /** - * Replaces all shapes matching some criteria with a Google Sheets chart. - */ - replaceAllShapesWithSheetsChart: - Schema$ReplaceAllShapesWithSheetsChartRequest; - /** - * Replaces all instances of specified text. - */ - replaceAllText: Schema$ReplaceAllTextRequest; - /** - * Replaces an existing image with a new image. - */ - replaceImage: Schema$ReplaceImageRequest; - /** - * Ungroups objects, such as groups. - */ - ungroupObjects: Schema$UngroupObjectsRequest; - /** - * Unmerges cells in a Table. - */ - unmergeTableCells: Schema$UnmergeTableCellsRequest; - /** - * Updates the properties of an Image. - */ - updateImageProperties: Schema$UpdateImagePropertiesRequest; - /** - * Updates the properties of a Line. - */ - updateLineProperties: Schema$UpdateLinePropertiesRequest; - /** - * Updates the alt text title and/or description of a page element. - */ - updatePageElementAltText: Schema$UpdatePageElementAltTextRequest; - /** - * Updates the transform of a page element. - */ - updatePageElementTransform: Schema$UpdatePageElementTransformRequest; - /** - * Updates the properties of a Page. - */ - updatePageProperties: Schema$UpdatePagePropertiesRequest; - /** - * Updates the styling of paragraphs within a Shape or Table. - */ - updateParagraphStyle: Schema$UpdateParagraphStyleRequest; - /** - * Updates the properties of a Shape. - */ - updateShapeProperties: Schema$UpdateShapePropertiesRequest; - /** - * Updates the position of a set of slides in the presentation. - */ - updateSlidesPosition: Schema$UpdateSlidesPositionRequest; - /** - * Updates the properties of the table borders in a Table. - */ - updateTableBorderProperties: Schema$UpdateTableBorderPropertiesRequest; - /** - * Updates the properties of a TableCell. - */ - updateTableCellProperties: Schema$UpdateTableCellPropertiesRequest; - /** - * Updates the properties of a Table column. - */ - updateTableColumnProperties: Schema$UpdateTableColumnPropertiesRequest; - /** - * Updates the properties of a Table row. - */ - updateTableRowProperties: Schema$UpdateTableRowPropertiesRequest; - /** - * Updates the styling of text within a Shape or Table. - */ - updateTextStyle: Schema$UpdateTextStyleRequest; - /** - * Updates the properties of a Video. - */ - updateVideoProperties: Schema$UpdateVideoPropertiesRequest; -} -/** - * A single response from an update. - */ -export interface Schema$Response { - /** - * The result of creating an image. - */ - createImage: Schema$CreateImageResponse; - /** - * The result of creating a line. - */ - createLine: Schema$CreateLineResponse; - /** - * The result of creating a shape. - */ - createShape: Schema$CreateShapeResponse; - /** - * The result of creating a Google Sheets chart. - */ - createSheetsChart: Schema$CreateSheetsChartResponse; - /** - * The result of creating a slide. - */ - createSlide: Schema$CreateSlideResponse; - /** - * The result of creating a table. - */ - createTable: Schema$CreateTableResponse; - /** - * The result of creating a video. - */ - createVideo: Schema$CreateVideoResponse; - /** - * The result of duplicating an object. - */ - duplicateObject: Schema$DuplicateObjectResponse; - /** - * The result of grouping objects. - */ - groupObjects: Schema$GroupObjectsResponse; - /** - * The result of replacing all shapes matching some criteria with an image. - */ - replaceAllShapesWithImage: Schema$ReplaceAllShapesWithImageResponse; - /** - * The result of replacing all shapes matching some criteria with a Google - * Sheets chart. - */ - replaceAllShapesWithSheetsChart: - Schema$ReplaceAllShapesWithSheetsChartResponse; - /** - * The result of replacing text. - */ - replaceAllText: Schema$ReplaceAllTextResponse; -} -/** - * An RGB color. - */ -export interface Schema$RgbColor { - /** - * The blue component of the color, from 0.0 to 1.0. - */ - blue: number; - /** - * The green component of the color, from 0.0 to 1.0. - */ - green: number; - /** - * The red component of the color, from 0.0 to 1.0. - */ - red: number; -} -/** - * The shadow properties of a page element. If these fields are unset, they may - * be inherited from a parent placeholder if it exists. If there is no parent, - * the fields will default to the value used for new page elements created in - * the Slides editor, which may depend on the page element kind. - */ -export interface Schema$Shadow { - /** - * The alignment point of the shadow, that sets the origin for translate, - * scale and skew of the shadow. - */ - alignment: string; - /** - * The alpha of the shadow's color, from 0.0 to 1.0. - */ - alpha: number; - /** - * The radius of the shadow blur. The larger the radius, the more diffuse the - * shadow becomes. - */ - blurRadius: Schema$Dimension; - /** - * The shadow color value. - */ - color: Schema$OpaqueColor; - /** - * The shadow property state. Updating the shadow on a page element will - * implicitly update this field to `RENDERED`, unless another value is - * specified in the same request. To have no shadow on a page element, set - * this field to `NOT_RENDERED`. In this case, any other shadow fields set in - * the same request will be ignored. - */ - propertyState: string; - /** - * Whether the shadow should rotate with the shape. - */ - rotateWithShape: boolean; - /** - * Transform that encodes the translate, scale, and skew of the shadow, - * relative to the alignment position. - */ - transform: Schema$AffineTransform; - /** - * The type of the shadow. - */ - type: string; -} -/** - * A PageElement kind representing a generic shape that does not have a more - * specific classification. - */ -export interface Schema$Shape { - /** - * Placeholders are shapes that are inherit from corresponding placeholders on - * layouts and masters. If set, the shape is a placeholder shape and any - * inherited properties can be resolved by looking at the parent placeholder - * identified by the Placeholder.parent_object_id field. - */ - placeholder: Schema$Placeholder; - /** - * The properties of the shape. - */ - shapeProperties: Schema$ShapeProperties; - /** - * The type of the shape. - */ - shapeType: string; - /** - * The text content of the shape. - */ - text: Schema$TextContent; -} -/** - * The shape background fill. - */ -export interface Schema$ShapeBackgroundFill { - /** - * The background fill property state. Updating the fill on a shape will - * implicitly update this field to `RENDERED`, unless another value is - * specified in the same request. To have no fill on a shape, set this field - * to `NOT_RENDERED`. In this case, any other fill fields set in the same - * request will be ignored. - */ - propertyState: string; - /** - * Solid color fill. - */ - solidFill: Schema$SolidFill; -} -/** - * The properties of a Shape. If the shape is a placeholder shape as determined - * by the placeholder field, then these properties may be inherited from a - * parent placeholder shape. Determining the rendered value of the property - * depends on the corresponding property_state field value. - */ -export interface Schema$ShapeProperties { - /** - * The alignment of the content in the shape. If unspecified, the alignment is - * inherited from a parent placeholder if it exists. If the shape has no - * parent, the default alignment matches the alignment for new shapes created - * in the Slides editor. - */ - contentAlignment: string; - /** - * The hyperlink destination of the shape. If unset, there is no link. Links - * are not inherited from parent placeholders. - */ - link: Schema$Link; - /** - * The outline of the shape. If unset, the outline is inherited from a parent - * placeholder if it exists. If the shape has no parent, then the default - * outline depends on the shape type, matching the defaults for new shapes - * created in the Slides editor. - */ - outline: Schema$Outline; - /** - * The shadow properties of the shape. If unset, the shadow is inherited from - * a parent placeholder if it exists. If the shape has no parent, then the - * default shadow matches the defaults for new shapes created in the Slides - * editor. This property is read-only. - */ - shadow: Schema$Shadow; - /** - * The background fill of the shape. If unset, the background fill is - * inherited from a parent placeholder if it exists. If the shape has no - * parent, then the default background fill depends on the shape type, - * matching the defaults for new shapes created in the Slides editor. - */ - shapeBackgroundFill: Schema$ShapeBackgroundFill; -} -/** - * A PageElement kind representing a linked chart embedded from Google Sheets. - */ -export interface Schema$SheetsChart { - /** - * The ID of the specific chart in the Google Sheets spreadsheet that is - * embedded. - */ - chartId: number; - /** - * The URL of an image of the embedded chart, with a default lifetime of 30 - * minutes. This URL is tagged with the account of the requester. Anyone with - * the URL effectively accesses the image as the original requester. Access to - * the image may be lost if the presentation's sharing settings change. - */ - contentUrl: string; - /** - * The properties of the Sheets chart. - */ - sheetsChartProperties: Schema$SheetsChartProperties; - /** - * The ID of the Google Sheets spreadsheet that contains the source chart. - */ - spreadsheetId: string; -} -/** - * The properties of the SheetsChart. - */ -export interface Schema$SheetsChartProperties { - /** - * The properties of the embedded chart image. - */ - chartImageProperties: Schema$ImageProperties; -} -/** - * A width and height. - */ -export interface Schema$Size { - /** - * The height of the object. - */ - height: Schema$Dimension; - /** - * The width of the object. - */ - width: Schema$Dimension; -} -/** - * The properties of Page that are only relevant for pages with page_type SLIDE. - */ -export interface Schema$SlideProperties { - /** - * The object ID of the layout that this slide is based on. - */ - layoutObjectId: string; - /** - * The object ID of the master that this slide is based on. - */ - masterObjectId: string; - /** - * The notes page that this slide is associated with. It defines the visual - * appearance of a notes page when printing or exporting slides with speaker - * notes. A notes page inherits properties from the notes master. The - * placeholder shape with type BODY on the notes page contains the speaker - * notes for this slide. The ID of this shape is identified by the - * speakerNotesObjectId field. The notes page is read-only except for the text - * content and styles of the speaker notes shape. - */ - notesPage: Schema$Page; -} -/** - * A solid color fill. The page or page element is filled entirely with the - * specified color value. If any field is unset, its value may be inherited - * from a parent placeholder if it exists. - */ -export interface Schema$SolidFill { - /** - * The fraction of this `color` that should be applied to the pixel. That is, - * the final pixel color is defined by the equation: pixel color = alpha * - * (color) + (1.0 - alpha) * (background color) This means that a value - * of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to - * a completely transparent color. - */ - alpha: number; - /** - * The color value of the solid fill. - */ - color: Schema$OpaqueColor; -} -/** - * The stretched picture fill. The page or page element is filled entirely with - * the specified picture. The picture is stretched to fit its container. - */ -export interface Schema$StretchedPictureFill { - /** - * Reading the content_url: An URL to a picture with a default lifetime of 30 - * minutes. This URL is tagged with the account of the requester. Anyone with - * the URL effectively accesses the picture as the original requester. Access - * to the picture may be lost if the presentation's sharing settings - * change. Writing the content_url: The picture is fetched once at insertion - * time and a copy is stored for display inside the presentation. Pictures - * must be less than 50MB in size, cannot exceed 25 megapixels, and must be in - * one of PNG, JPEG, or GIF format. The provided URL can be at most 2 kB in - * length. - */ - contentUrl: string; - /** - * The original size of the picture fill. This field is read-only. - */ - size: Schema$Size; -} -/** - * A criteria that matches a specific string of text in a shape or table. - */ -export interface Schema$SubstringMatchCriteria { - /** - * Indicates whether the search should respect case: - `True`: the search is - * case sensitive. - `False`: the search is case insensitive. - */ - matchCase: boolean; - /** - * The text to search for in the shape or table. - */ - text: string; -} -/** - * A PageElement kind representing a table. - */ -export interface Schema$Table { - /** - * Number of columns in the table. - */ - columns: number; - /** - * Properties of horizontal cell borders. A table's horizontal cell - * borders are represented as a grid. The grid has one more row than the - * number of rows in the table and the same number of columns as the table. - * For example, if the table is 3 x 3, its horizontal borders will be - * represented as a grid with 4 rows and 3 columns. - */ - horizontalBorderRows: Schema$TableBorderRow[]; - /** - * Number of rows in the table. - */ - rows: number; - /** - * Properties of each column. - */ - tableColumns: Schema$TableColumnProperties[]; - /** - * Properties and contents of each row. Cells that span multiple rows are - * contained in only one of these rows and have a row_span greater than 1. - */ - tableRows: Schema$TableRow[]; - /** - * Properties of vertical cell borders. A table's vertical cell borders - * are represented as a grid. The grid has the same number of rows as the - * table and one more column than the number of columns in the table. For - * example, if the table is 3 x 3, its vertical borders will be represented as - * a grid with 3 rows and 4 columns. - */ - verticalBorderRows: Schema$TableBorderRow[]; -} -/** - * The properties of each border cell. - */ -export interface Schema$TableBorderCell { - /** - * The location of the border within the border table. - */ - location: Schema$TableCellLocation; - /** - * The border properties. - */ - tableBorderProperties: Schema$TableBorderProperties; -} -/** - * The fill of the border. - */ -export interface Schema$TableBorderFill { - /** - * Solid fill. - */ - solidFill: Schema$SolidFill; -} -/** - * The border styling properties of the TableBorderCell. - */ -export interface Schema$TableBorderProperties { - /** - * The dash style of the border. - */ - dashStyle: string; - /** - * The fill of the table border. - */ - tableBorderFill: Schema$TableBorderFill; - /** - * The thickness of the border. - */ - weight: Schema$Dimension; -} -/** - * Contents of each border row in a table. - */ -export interface Schema$TableBorderRow { - /** - * Properties of each border cell. When a border's adjacent table cells - * are merged, it is not included in the response. - */ - tableBorderCells: Schema$TableBorderCell[]; -} -/** - * Properties and contents of each table cell. - */ -export interface Schema$TableCell { - /** - * Column span of the cell. - */ - columnSpan: number; - /** - * The location of the cell within the table. - */ - location: Schema$TableCellLocation; - /** - * Row span of the cell. - */ - rowSpan: number; - /** - * The properties of the table cell. - */ - tableCellProperties: Schema$TableCellProperties; - /** - * The text content of the cell. - */ - text: Schema$TextContent; -} -/** - * The table cell background fill. - */ -export interface Schema$TableCellBackgroundFill { - /** - * The background fill property state. Updating the fill on a table cell will - * implicitly update this field to `RENDERED`, unless another value is - * specified in the same request. To have no fill on a table cell, set this - * field to `NOT_RENDERED`. In this case, any other fill fields set in the - * same request will be ignored. - */ - propertyState: string; - /** - * Solid color fill. - */ - solidFill: Schema$SolidFill; -} -/** - * A location of a single table cell within a table. - */ -export interface Schema$TableCellLocation { - /** - * The 0-based column index. - */ - columnIndex: number; - /** - * The 0-based row index. - */ - rowIndex: number; -} -/** - * The properties of the TableCell. - */ -export interface Schema$TableCellProperties { - /** - * The alignment of the content in the table cell. The default alignment - * matches the alignment for newly created table cells in the Slides editor. - */ - contentAlignment: string; - /** - * The background fill of the table cell. The default fill matches the fill - * for newly created table cells in the Slides editor. - */ - tableCellBackgroundFill: Schema$TableCellBackgroundFill; -} -/** - * Properties of each column in a table. - */ -export interface Schema$TableColumnProperties { - /** - * Width of a column. - */ - columnWidth: Schema$Dimension; -} -/** - * A table range represents a reference to a subset of a table. It's - * important to note that the cells specified by a table range do not - * necessarily form a rectangle. For example, let's say we have a 3 x 3 - * table where all the cells of the last row are merged together. The table - * looks like this: [ ] A table range with location - * = (0, 0), row span = 3 and column span = 2 specifies the following cells: x - * x [ x ] - */ -export interface Schema$TableRange { - /** - * The column span of the table range. - */ - columnSpan: number; - /** - * The starting location of the table range. - */ - location: Schema$TableCellLocation; - /** - * The row span of the table range. - */ - rowSpan: number; -} -/** - * Properties and contents of each row in a table. - */ -export interface Schema$TableRow { - /** - * Height of a row. - */ - rowHeight: Schema$Dimension; - /** - * Properties and contents of each cell. Cells that span multiple columns are - * represented only once with a column_span greater than 1. As a result, the - * length of this collection does not always match the number of columns of - * the entire table. - */ - tableCells: Schema$TableCell[]; - /** - * Properties of the row. - */ - tableRowProperties: Schema$TableRowProperties; -} -/** - * Properties of each row in a table. - */ -export interface Schema$TableRowProperties { - /** - * Minimum height of the row. The row will be rendered in the Slides editor at - * a height equal to or greater than this value in order to show all the text - * in the row's cell(s). - */ - minRowHeight: Schema$Dimension; -} -/** - * The general text content. The text must reside in a compatible shape (e.g. - * text box or rectangle) or a table cell in a page. - */ -export interface Schema$TextContent { - /** - * The bulleted lists contained in this text, keyed by list ID. - */ - lists: any; - /** - * The text contents broken down into its component parts, including styling - * information. This property is read-only. - */ - textElements: Schema$TextElement[]; -} -/** - * A TextElement describes the content of a range of indices in the text content - * of a Shape or TableCell. - */ -export interface Schema$TextElement { - /** - * A TextElement representing a spot in the text that is dynamically replaced - * with content that can change over time. - */ - autoText: Schema$AutoText; - /** - * The zero-based end index of this text element, exclusive, in Unicode code - * units. - */ - endIndex: number; - /** - * A marker representing the beginning of a new paragraph. The `start_index` - * and `end_index` of this TextElement represent the range of the paragraph. - * Other TextElements with an index range contained inside this - * paragraph's range are considered to be part of this paragraph. The - * range of indices of two separate paragraphs will never overlap. - */ - paragraphMarker: Schema$ParagraphMarker; - /** - * The zero-based start index of this text element, in Unicode code units. - */ - startIndex: number; - /** - * A TextElement representing a run of text where all of the characters in the - * run have the same TextStyle. The `start_index` and `end_index` of TextRuns - * will always be fully contained in the index range of a single - * `paragraph_marker` TextElement. In other words, a TextRun will never span - * multiple paragraphs. - */ - textRun: Schema$TextRun; -} -/** - * A TextElement kind that represents a run of text that all has the same - * styling. - */ -export interface Schema$TextRun { - /** - * The text of this run. - */ - content: string; - /** - * The styling applied to this run. - */ - style: Schema$TextStyle; -} -/** - * Represents the styling that can be applied to a TextRun. If this text is - * contained in a shape with a parent placeholder, then these text styles may be - * inherited from the parent. Which text styles are inherited depend on the - * nesting level of lists: * A text run in a paragraph that is not in a list - * will inherit its text style from the the newline character in the paragraph - * at the 0 nesting level of the list inside the parent placeholder. * A text - * run in a paragraph that is in a list will inherit its text style from the - * newline character in the paragraph at its corresponding nesting level of - * the list inside the parent placeholder. Inherited text styles are - * represented as unset fields in this message. If text is contained in a shape - * without a parent placeholder, unsetting these fields will revert the style to - * a value matching the defaults in the Slides editor. - */ -export interface Schema$TextStyle { + * The properties of the Line. When unset, these fields default to values + * that match the appearance of new lines created in the Slides editor. + */ + export interface Schema$LineProperties { + /** + * The dash style of the line. + */ + dashStyle: string; + /** + * The style of the arrow at the end of the line. + */ + endArrow: string; + /** + * The fill of the line. The default line fill matches the defaults for new + * lines created in the Slides editor. + */ + lineFill: Schema$LineFill; + /** + * The hyperlink destination of the line. If unset, there is no link. + */ + link: Schema$Link; + /** + * The style of the arrow at the beginning of the line. + */ + startArrow: string; + /** + * The thickness of the line. + */ + weight: Schema$Dimension; + } /** - * The background color of the text. If set, the color is either opaque or - * transparent, depending on if the `opaque_color` field in it is set. - */ - backgroundColor: Schema$OptionalColor; + * A hypertext link. + */ + export interface Schema$Link { + /** + * If set, indicates this is a link to the specific page in this + * presentation with this ID. A page with this ID may not exist. + */ + pageObjectId: string; + /** + * If set, indicates this is a link to a slide in this presentation, + * addressed by its position. + */ + relativeLink: string; + /** + * If set, indicates this is a link to the slide at this zero-based index in + * the presentation. There may not be a slide at this index. + */ + slideIndex: number; + /** + * If set, indicates this is a link to the external web page at this URL. + */ + url: string; + } /** - * The text's vertical offset from its normal position. Text with - * `SUPERSCRIPT` or `SUBSCRIPT` baseline offsets is automatically rendered in - * a smaller font size, computed based on the `font_size` field. The - * `font_size` itself is not affected by changes in this field. - */ - baselineOffset: string; + * A List describes the look and feel of bullets belonging to paragraphs + * associated with a list. A paragraph that is part of a list has an implicit + * reference to that list's ID. + */ + export interface Schema$List { + /** + * The ID of the list. + */ + listId: string; + /** + * A map of nesting levels to the properties of bullets at the associated + * level. A list has at most nine levels of nesting, so the possible values + * for the keys of this map are 0 through 8, inclusive. + */ + nestingLevel: any; + } /** - * Whether or not the text is rendered as bold. + * The properties of Page that are only relevant for pages with page_type + * MASTER. */ - bold: boolean; + export interface Schema$MasterProperties { + /** + * The human-readable name of the master. + */ + displayName: string; + } /** - * The font family of the text. The font family can be any font from the Font - * menu in Slides or from [Google Fonts] (https://fonts.google.com/). If the - * font name is unrecognized, the text is rendered in `Arial`. Some fonts can - * affect the weight of the text. If an update request specifies values for - * both `font_family` and `bold`, the explicitly-set `bold` value is used. + * Merges cells in a Table. */ - fontFamily: string; + export interface Schema$MergeTableCellsRequest { + /** + * The object ID of the table. + */ + objectId: string; + /** + * The table range specifying which cells of the table to merge. Any text + * in the cells being merged will be concatenated and stored in the + * upper-left ("head") cell of the range. If the range is + * non-rectangular (which can occur in some cases where the range covers + * cells that are already merged), a 400 bad request error is returned. + */ + tableRange: Schema$TableRange; + } /** - * The size of the text's font. When read, the `font_size` will specified - * in points. + * Contains properties describing the look and feel of a list bullet at a + * given level of nesting. */ - fontSize: Schema$Dimension; + export interface Schema$NestingLevel { + /** + * The style of a bullet at this level of nesting. + */ + bulletStyle: Schema$TextStyle; + } /** - * The color of the text itself. If set, the color is either opaque or - * transparent, depending on if the `opaque_color` field in it is set. - */ - foregroundColor: Schema$OptionalColor; + * The properties of Page that are only relevant for pages with page_type + * NOTES. + */ + export interface Schema$NotesProperties { + /** + * The object ID of the shape on this notes page that contains the speaker + * notes for the corresponding slide. The actual shape may not always exist + * on the notes page. Inserting text using this object ID will automatically + * create the shape. In this case, the actual shape may have different + * object ID. The `GetPresentation` or `GetPage` action will always return + * the latest object ID. + */ + speakerNotesObjectId: string; + } /** - * Whether or not the text is italicized. - */ - italic: boolean; + * A themeable solid color value. + */ + export interface Schema$OpaqueColor { + /** + * An opaque RGB color. + */ + rgbColor: Schema$RgbColor; + /** + * An opaque theme color. + */ + themeColor: string; + } /** - * The hyperlink destination of the text. If unset, there is no link. Links - * are not inherited from parent text. Changing the link in an update request - * causes some other changes to the text style of the range: * When setting a - * link, the text foreground color will be set to ThemeColorType.HYPERLINK - * and the text will be underlined. If these fields are modified in the same - * request, those values will be used instead of the link defaults. * Setting - * a link on a text range that overlaps with an existing link will also - * update the existing link to point to the new URL. * Links are not settable - * on newline characters. As a result, setting a link on a text range that - * crosses a paragraph boundary, such as `"ABCx/123"`, will - * separate the newline character(s) into their own text runs. The link will - * be applied separately to the runs before and after the newline. * Removing - * a link will update the text style of the range to match the style of the - * preceding text (or the default text styles if the preceding text is - * another link) unless different styles are being set in the same request. + * A color that can either be fully opaque or fully transparent. */ - link: Schema$Link; + export interface Schema$OptionalColor { + /** + * If set, this will be used as an opaque color. If unset, this represents a + * transparent color. + */ + opaqueColor: Schema$OpaqueColor; + } /** - * Whether or not the text is in small capital letters. - */ - smallCaps: boolean; + * The outline of a PageElement. If these fields are unset, they may be + * inherited from a parent placeholder if it exists. If there is no parent, + * the fields will default to the value used for new page elements created in + * the Slides editor, which may depend on the page element kind. + */ + export interface Schema$Outline { + /** + * The dash style of the outline. + */ + dashStyle: string; + /** + * The fill of the outline. + */ + outlineFill: Schema$OutlineFill; + /** + * The outline property state. Updating the outline on a page element will + * implicitly update this field to `RENDERED`, unless another value is + * specified in the same request. To have no outline on a page element, set + * this field to `NOT_RENDERED`. In this case, any other outline fields set + * in the same request will be ignored. + */ + propertyState: string; + /** + * The thickness of the outline. + */ + weight: Schema$Dimension; + } /** - * Whether or not the text is struck through. + * The fill of the outline. */ - strikethrough: boolean; + export interface Schema$OutlineFill { + /** + * Solid color fill. + */ + solidFill: Schema$SolidFill; + } /** - * Whether or not the text is underlined. - */ - underline: boolean; + * A page in a presentation. + */ + export interface Schema$Page { + /** + * Layout specific properties. Only set if page_type = LAYOUT. + */ + layoutProperties: Schema$LayoutProperties; + /** + * Master specific properties. Only set if page_type = MASTER. + */ + masterProperties: Schema$MasterProperties; + /** + * Notes specific properties. Only set if page_type = NOTES. + */ + notesProperties: Schema$NotesProperties; + /** + * The object ID for this page. Object IDs used by Page and PageElement + * share the same namespace. + */ + objectId: string; + /** + * The page elements rendered on the page. + */ + pageElements: Schema$PageElement[]; + /** + * The properties of the page. + */ + pageProperties: Schema$PageProperties; + /** + * The type of the page. + */ + pageType: string; + /** + * The revision ID of the presentation containing this page. Can be used in + * update requests to assert that the presentation revision hasn't + * changed since the last read operation. Only populated if the user has + * edit access to the presentation. The format of the revision ID may + * change over time, so it should be treated opaquely. A returned revision + * ID is only guaranteed to be valid for 24 hours after it has been returned + * and cannot be shared across users. If the revision ID is unchanged + * between calls, then the presentation has not changed. Conversely, a + * changed ID (for the same presentation and user) usually means the + * presentation has been updated; however, a changed ID can also be due to + * internal factors such as ID format changes. + */ + revisionId: string; + /** + * Slide specific properties. Only set if page_type = SLIDE. + */ + slideProperties: Schema$SlideProperties; + } /** - * The font family and rendered weight of the text. This field is an - * extension of `font_family` meant to support explicit font weights without - * breaking backwards compatibility. As such, when reading the style of a - * range of text, the value of `weighted_font_family#font_family` will always - * be equal to that of `font_family`. However, when writing, if both fields - * are included in the field mask (either explicitly or through the wildcard - * `"*"`), their values are reconciled as follows: * If - * `font_family` is set and `weighted_font_family` is not, the value of - * `font_family` is applied with weight `400` ("normal"). * If both - * fields are set, the value of `font_family` must match that of - * `weighted_font_family#font_family`. If so, the font family and weight of - * `weighted_font_family` is applied. Otherwise, a 400 bad request error is - * returned. * If `weighted_font_family` is set and `font_family` is not, the - * font family and weight of `weighted_font_family` is applied. * If neither - * field is set, the font family and weight of the text inherit from the - * parent. Note that these properties cannot inherit separately from each - * other. If an update request specifies values for both - * `weighted_font_family` and `bold`, the `weighted_font_family` is applied - * first, then `bold`. If `weighted_font_family#weight` is not set, it - * defaults to `400`. If `weighted_font_family` is set, then - * `weighted_font_family#font_family` must also be set with a non-empty value. - * Otherwise, a 400 bad request error is returned. - */ - weightedFontFamily: Schema$WeightedFontFamily; -} -/** - * A pair mapping a theme color type to the concrete color it represents. - */ -export interface Schema$ThemeColorPair { + * The page background fill. + */ + export interface Schema$PageBackgroundFill { + /** + * The background fill property state. Updating the fill on a page will + * implicitly update this field to `RENDERED`, unless another value is + * specified in the same request. To have no fill on a page, set this field + * to `NOT_RENDERED`. In this case, any other fill fields set in the same + * request will be ignored. + */ + propertyState: string; + /** + * Solid color fill. + */ + solidFill: Schema$SolidFill; + /** + * Stretched picture fill. + */ + stretchedPictureFill: Schema$StretchedPictureFill; + } /** - * The concrete color corresponding to the theme color type above. - */ - color: Schema$RgbColor; + * A visual element rendered on a page. + */ + export interface Schema$PageElement { + /** + * The description of the page element. Combined with title to display alt + * text. + */ + description: string; + /** + * A collection of page elements joined as a single unit. + */ + elementGroup: Schema$Group; + /** + * An image page element. + */ + image: Schema$Image; + /** + * A line page element. + */ + line: Schema$Line; + /** + * The object ID for this page element. Object IDs used by + * google.apps.slides.v1.Page and google.apps.slides.v1.PageElement share + * the same namespace. + */ + objectId: string; + /** + * A generic shape. + */ + shape: Schema$Shape; + /** + * A linked chart embedded from Google Sheets. Unlinked charts are + * represented as images. + */ + sheetsChart: Schema$SheetsChart; + /** + * The size of the page element. + */ + size: Schema$Size; + /** + * A table page element. + */ + table: Schema$Table; + /** + * The title of the page element. Combined with description to display alt + * text. + */ + title: string; + /** + * The transform of the page element. The visual appearance of the page + * element is determined by its absolute transform. To compute the absolute + * transform, preconcatenate a page element's transform with the + * transforms of all of its parent groups. If the page element is not in a + * group, its absolute transform is the same as the value in this field. The + * initial transform for the newly created Group is always the identity + * transform. + */ + transform: Schema$AffineTransform; + /** + * A video page element. + */ + video: Schema$Video; + /** + * A word art page element. + */ + wordArt: Schema$WordArt; + } /** - * The type of the theme color. - */ - type: string; -} -/** - * The thumbnail of a page. - */ -export interface Schema$Thumbnail { + * Common properties for a page element. Note: When you initially create a + * PageElement, the API may modify the values of both `size` and `transform`, + * but the visual size will be unchanged. + */ + export interface Schema$PageElementProperties { + /** + * The object ID of the page where the element is located. + */ + pageObjectId: string; + /** + * The size of the element. + */ + size: Schema$Size; + /** + * The transform for the element. + */ + transform: Schema$AffineTransform; + } /** - * The content URL of the thumbnail image. The URL to the image has a default - * lifetime of 30 minutes. This URL is tagged with the account of the - * requester. Anyone with the URL effectively accesses the image as the - * original requester. Access to the image may be lost if the - * presentation's sharing settings change. The mime type of the thumbnail - * image is the same as specified in the `GetPageThumbnailRequest`. - */ - contentUrl: string; + * The properties of the Page. The page will inherit properties from the + * parent page. Depending on the page type the hierarchy is defined in either + * SlideProperties or LayoutProperties. + */ + export interface Schema$PageProperties { + /** + * The color scheme of the page. If unset, the color scheme is inherited + * from a parent page. If the page has no parent, the color scheme uses a + * default Slides color scheme. This field is read-only. + */ + colorScheme: Schema$ColorScheme; + /** + * The background fill of the page. If unset, the background fill is + * inherited from a parent page if it exists. If the page has no parent, + * then the background fill defaults to the corresponding fill in the Slides + * editor. + */ + pageBackgroundFill: Schema$PageBackgroundFill; + } /** - * The positive height in pixels of the thumbnail image. - */ - height: number; + * A TextElement kind that represents the beginning of a new paragraph. + */ + export interface Schema$ParagraphMarker { + /** + * The bullet for this paragraph. If not present, the paragraph does not + * belong to a list. + */ + bullet: Schema$Bullet; + /** + * The paragraph's style + */ + style: Schema$ParagraphStyle; + } /** - * The positive width in pixels of the thumbnail image. - */ - width: number; -} -/** - * Ungroups objects, such as groups. - */ -export interface Schema$UngroupObjectsRequest { + * Styles that apply to a whole paragraph. If this text is contained in a + * shape with a parent placeholder, then these paragraph styles may be + * inherited from the parent. Which paragraph styles are inherited depend on + * the nesting level of lists: * A paragraph not in a list will inherit its + * paragraph style from the paragraph at the 0 nesting level of the list + * inside the parent placeholder. * A paragraph in a list will inherit its + * paragraph style from the paragraph at its corresponding nesting level of + * the list inside the parent placeholder. Inherited paragraph styles are + * represented as unset fields in this message. + */ + export interface Schema$ParagraphStyle { + /** + * The text alignment for this paragraph. + */ + alignment: string; + /** + * The text direction of this paragraph. If unset, the value defaults to + * LEFT_TO_RIGHT since text direction is not inherited. + */ + direction: string; + /** + * The amount indentation for the paragraph on the side that corresponds to + * the end of the text, based on the current text direction. If unset, the + * value is inherited from the parent. + */ + indentEnd: Schema$Dimension; + /** + * The amount of indentation for the start of the first line of the + * paragraph. If unset, the value is inherited from the parent. + */ + indentFirstLine: Schema$Dimension; + /** + * The amount indentation for the paragraph on the side that corresponds to + * the start of the text, based on the current text direction. If unset, the + * value is inherited from the parent. + */ + indentStart: Schema$Dimension; + /** + * The amount of space between lines, as a percentage of normal, where + * normal is represented as 100.0. If unset, the value is inherited from the + * parent. + */ + lineSpacing: number; + /** + * The amount of extra space above the paragraph. If unset, the value is + * inherited from the parent. + */ + spaceAbove: Schema$Dimension; + /** + * The amount of extra space above the paragraph. If unset, the value is + * inherited from the parent. + */ + spaceBelow: Schema$Dimension; + /** + * The spacing mode for the paragraph. + */ + spacingMode: string; + } /** - * The object IDs of the objects to ungroup. Only groups that are not inside - * other groups can be ungrouped. All the groups should be on the same page. - * The group itself is deleted. The visual sizes and positions of all the - * children are preserved. - */ - objectIds: string[]; -} -/** - * Unmerges cells in a Table. - */ -export interface Schema$UnmergeTableCellsRequest { + * The placeholder information that uniquely identifies a placeholder shape. + */ + export interface Schema$Placeholder { + /** + * The index of the placeholder. If the same placeholder types are present + * in the same page, they would have different index values. + */ + index: number; + /** + * The object ID of this shape's parent placeholder. If unset, the + * parent placeholder shape does not exist, so the shape does not inherit + * properties from any other shape. + */ + parentObjectId: string; + /** + * The type of the placeholder. + */ + type: string; + } /** - * The object ID of the table. - */ - objectId: string; + * A Google Slides presentation. + */ + export interface Schema$Presentation { + /** + * The layouts in the presentation. A layout is a template that determines + * how content is arranged and styled on the slides that inherit from that + * layout. + */ + layouts: Schema$Page[]; + /** + * The locale of the presentation, as an IETF BCP 47 language tag. + */ + locale: string; + /** + * The slide masters in the presentation. A slide master contains all common + * page elements and the common properties for a set of layouts. They serve + * three purposes: - Placeholder shapes on a master contain the default + * text styles and shape properties of all placeholder shapes on pages + * that use that master. - The master page properties define the common page + * properties inherited by its layouts. - Any other shapes on the master + * slide will appear on all slides using that master, regardless of their + * layout. + */ + masters: Schema$Page[]; + /** + * The notes master in the presentation. It serves three purposes: - + * Placeholder shapes on a notes master contain the default text styles and + * shape properties of all placeholder shapes on notes pages. Specifically, + * a `SLIDE_IMAGE` placeholder shape contains the slide thumbnail, and a + * `BODY` placeholder shape contains the speaker notes. - The notes master + * page properties define the common page properties inherited by all + * notes pages. - Any other shapes on the notes master will appear on all + * notes pages. The notes master is read-only. + */ + notesMaster: Schema$Page; + /** + * The size of pages in the presentation. + */ + pageSize: Schema$Size; + /** + * The ID of the presentation. + */ + presentationId: string; + /** + * The revision ID of the presentation. Can be used in update requests to + * assert that the presentation revision hasn't changed since the last + * read operation. Only populated if the user has edit access to the + * presentation. The format of the revision ID may change over time, so it + * should be treated opaquely. A returned revision ID is only guaranteed to + * be valid for 24 hours after it has been returned and cannot be shared + * across users. If the revision ID is unchanged between calls, then the + * presentation has not changed. Conversely, a changed ID (for the same + * presentation and user) usually means the presentation has been updated; + * however, a changed ID can also be due to internal factors such as ID + * format changes. + */ + revisionId: string; + /** + * The slides in the presentation. A slide inherits properties from a slide + * layout. + */ + slides: Schema$Page[]; + /** + * The title of the presentation. + */ + title: string; + } /** - * The table range specifying which cells of the table to unmerge. All merged - * cells in this range will be unmerged, and cells that are already unmerged - * will not be affected. If the range has no merged cells, the request will do - * nothing. If there is text in any of the merged cells, the text will remain - * in the upper-left ("head") cell of the resulting block of - * unmerged cells. - */ - tableRange: Schema$TableRange; -} -/** - * Update the properties of an Image. - */ -export interface Schema$UpdateImagePropertiesRequest { + * Specifies a contiguous range of an indexed collection, such as characters + * in text. + */ + export interface Schema$Range { + /** + * The optional zero-based index of the end of the collection. Required for + * `FIXED_RANGE` ranges. + */ + endIndex: number; + /** + * The optional zero-based index of the beginning of the collection. + * Required for `FIXED_RANGE` and `FROM_START_INDEX` ranges. + */ + startIndex: number; + /** + * The type of range. + */ + type: string; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `imageProperties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example to update the image outline color, set `fields` to - * `"outline.outlineFill.solidFill.color"`. To reset a property to - * its default value, include its field name in the field mask but leave the - * field itself unset. - */ - fields: string; + * A recolor effect applied on an image. + */ + export interface Schema$Recolor { + /** + * The name of the recolor effect. The name is determined from the + * `recolor_stops` by matching the gradient against the colors in the + * page's current color scheme. This property is read-only. + */ + name: string; + /** + * The recolor effect is represented by a gradient, which is a list of color + * stops. The colors in the gradient will replace the corresponding colors + * at the same position in the color palette and apply to the image. This + * property is read-only. + */ + recolorStops: Schema$ColorStop[]; + } /** - * The image properties to update. + * Refreshes an embedded Google Sheets chart by replacing it with the latest + * version of the chart from Google Sheets. NOTE: Refreshing charts requires + * at least one of the spreadsheets.readonly, spreadsheets, drive.readonly, or + * drive OAuth scopes. */ - imageProperties: Schema$ImageProperties; + export interface Schema$RefreshSheetsChartRequest { + /** + * The object ID of the chart to refresh. + */ + objectId: string; + } /** - * The object ID of the image the updates are applied to. - */ - objectId: string; -} -/** - * Updates the properties of a Line. - */ -export interface Schema$UpdateLinePropertiesRequest { + * Replaces all shapes that match the given criteria with the provided image. + * The images replacing the shapes are rectangular after being inserted into + * the presentation and do not take on the forms of the shapes. + */ + export interface Schema$ReplaceAllShapesWithImageRequest { + /** + * If set, this request will replace all of the shapes that contain the + * given text. + */ + containsText: Schema$SubstringMatchCriteria; + /** + * The image replace method. If you specify both a `replace_method` and an + * `image_replace_method`, the `image_replace_method` takes precedence. If + * you do not specify a value for `image_replace_method`, but specify a + * value for `replace_method`, then the specified `replace_method` value is + * used. If you do not specify either, then CENTER_INSIDE is used. + */ + imageReplaceMethod: string; + /** + * The image URL. The image is fetched once at insertion time and a copy is + * stored for display inside the presentation. Images must be less than 50MB + * in size, cannot exceed 25 megapixels, and must be in one of PNG, JPEG, or + * GIF format. The provided URL can be at most 2 kB in length. The URL + * itself is saved with the image, and exposed via the Image.source_url + * field. + */ + imageUrl: string; + /** + * If non-empty, limits the matches to page elements only on the given + * pages. Returns a 400 bad request error if given the page object ID of a + * notes page or a notes master, or if a page with that object ID + * doesn't exist in the presentation. + */ + pageObjectIds: string[]; + /** + * The replace method. Deprecated: use `image_replace_method` instead. If + * you specify both a `replace_method` and an `image_replace_method`, the + * `image_replace_method` takes precedence. + */ + replaceMethod: string; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `lineProperties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example to update the line solid fill color, set `fields` to - * `"lineFill.solidFill.color"`. To reset a property to its default - * value, include its field name in the field mask but leave the field itself - * unset. + * The result of replacing shapes with an image. */ - fields: string; + export interface Schema$ReplaceAllShapesWithImageResponse { + /** + * The number of shapes replaced with images. + */ + occurrencesChanged: number; + } /** - * The line properties to update. - */ - lineProperties: Schema$LineProperties; + * Replaces all shapes that match the given criteria with the provided Google + * Sheets chart. The chart will be scaled and centered to fit within the + * bounds of the original shape. NOTE: Replacing shapes with a chart requires + * at least one of the spreadsheets.readonly, spreadsheets, drive.readonly, or + * drive OAuth scopes. + */ + export interface Schema$ReplaceAllShapesWithSheetsChartRequest { + /** + * The ID of the specific chart in the Google Sheets spreadsheet. + */ + chartId: number; + /** + * The criteria that the shapes must match in order to be replaced. The + * request will replace all of the shapes that contain the given text. + */ + containsText: Schema$SubstringMatchCriteria; + /** + * The mode with which the chart is linked to the source spreadsheet. When + * not specified, the chart will be an image that is not linked. + */ + linkingMode: string; + /** + * If non-empty, limits the matches to page elements only on the given + * pages. Returns a 400 bad request error if given the page object ID of a + * notes page or a notes master, or if a page with that object ID + * doesn't exist in the presentation. + */ + pageObjectIds: string[]; + /** + * The ID of the Google Sheets spreadsheet that contains the chart. + */ + spreadsheetId: string; + } /** - * The object ID of the line the update is applied to. + * The result of replacing shapes with a Google Sheets chart. */ - objectId: string; -} -/** - * Updates the alt text title and/or description of a page element. - */ -export interface Schema$UpdatePageElementAltTextRequest { + export interface Schema$ReplaceAllShapesWithSheetsChartResponse { + /** + * The number of shapes replaced with charts. + */ + occurrencesChanged: number; + } /** - * The updated alt text description of the page element. If unset the existing - * value will be maintained. The description is exposed to screen readers and - * other accessibility interfaces. Only use human readable values related to - * the content of the page element. - */ - description: string; + * Replaces all instances of text matching a criteria with replace text. + */ + export interface Schema$ReplaceAllTextRequest { + /** + * Finds text in a shape matching this substring. + */ + containsText: Schema$SubstringMatchCriteria; + /** + * If non-empty, limits the matches to page elements only on the given + * pages. Returns a 400 bad request error if given the page object ID of a + * notes master, or if a page with that object ID doesn't exist in the + * presentation. + */ + pageObjectIds: string[]; + /** + * The text that will replace the matched text. + */ + replaceText: string; + } /** - * The object ID of the page element the updates are applied to. + * The result of replacing text. */ - objectId: string; + export interface Schema$ReplaceAllTextResponse { + /** + * The number of occurrences changed by replacing all text. + */ + occurrencesChanged: number; + } /** - * The updated alt text title of the page element. If unset the existing value - * will be maintained. The title is exposed to screen readers and other - * accessibility interfaces. Only use human readable values related to the - * content of the page element. - */ - title: string; -} -/** - * Updates the transform of a page element. Updating the transform of a group - * will change the absolute transform of the page elements in that group, which - * can change their visual appearance. See the documentation for - * PageElement.transform for more details. - */ -export interface Schema$UpdatePageElementTransformRequest { + * Replaces an existing image with a new image. Replacing an image removes + * some image effects from the existing image. + */ + export interface Schema$ReplaceImageRequest { + /** + * The ID of the existing image that will be replaced. + */ + imageObjectId: string; + /** + * The replacement method. + */ + imageReplaceMethod: string; + /** + * The URL of the new image. The image is fetched once at insertion time + * and a copy is stored for display inside the presentation. Images must be + * less than 50MB in size, cannot exceed 25 megapixels, and must be in one + * of PNG, JPEG, or GIF format. The provided URL can be at most 2 kB in + * length. The URL itself is saved with the image, and exposed via the + * Image.source_url field. + */ + url: string; + } /** - * The apply mode of the transform update. - */ - applyMode: string; + * A single kind of update to apply to a presentation. + */ + export interface Schema$Request { + /** + * Creates an image. + */ + createImage: Schema$CreateImageRequest; + /** + * Creates a line. + */ + createLine: Schema$CreateLineRequest; + /** + * Creates bullets for paragraphs. + */ + createParagraphBullets: Schema$CreateParagraphBulletsRequest; + /** + * Creates a new shape. + */ + createShape: Schema$CreateShapeRequest; + /** + * Creates an embedded Google Sheets chart. + */ + createSheetsChart: Schema$CreateSheetsChartRequest; + /** + * Creates a new slide. + */ + createSlide: Schema$CreateSlideRequest; + /** + * Creates a new table. + */ + createTable: Schema$CreateTableRequest; + /** + * Creates a video. + */ + createVideo: Schema$CreateVideoRequest; + /** + * Deletes a page or page element from the presentation. + */ + deleteObject: Schema$DeleteObjectRequest; + /** + * Deletes bullets from paragraphs. + */ + deleteParagraphBullets: Schema$DeleteParagraphBulletsRequest; + /** + * Deletes a column from a table. + */ + deleteTableColumn: Schema$DeleteTableColumnRequest; + /** + * Deletes a row from a table. + */ + deleteTableRow: Schema$DeleteTableRowRequest; + /** + * Deletes text from a shape or a table cell. + */ + deleteText: Schema$DeleteTextRequest; + /** + * Duplicates a slide or page element. + */ + duplicateObject: Schema$DuplicateObjectRequest; + /** + * Groups objects, such as page elements. + */ + groupObjects: Schema$GroupObjectsRequest; + /** + * Inserts columns into a table. + */ + insertTableColumns: Schema$InsertTableColumnsRequest; + /** + * Inserts rows into a table. + */ + insertTableRows: Schema$InsertTableRowsRequest; + /** + * Inserts text into a shape or table cell. + */ + insertText: Schema$InsertTextRequest; + /** + * Merges cells in a Table. + */ + mergeTableCells: Schema$MergeTableCellsRequest; + /** + * Refreshes a Google Sheets chart. + */ + refreshSheetsChart: Schema$RefreshSheetsChartRequest; + /** + * Replaces all shapes matching some criteria with an image. + */ + replaceAllShapesWithImage: Schema$ReplaceAllShapesWithImageRequest; + /** + * Replaces all shapes matching some criteria with a Google Sheets chart. + */ + replaceAllShapesWithSheetsChart: + Schema$ReplaceAllShapesWithSheetsChartRequest; + /** + * Replaces all instances of specified text. + */ + replaceAllText: Schema$ReplaceAllTextRequest; + /** + * Replaces an existing image with a new image. + */ + replaceImage: Schema$ReplaceImageRequest; + /** + * Ungroups objects, such as groups. + */ + ungroupObjects: Schema$UngroupObjectsRequest; + /** + * Unmerges cells in a Table. + */ + unmergeTableCells: Schema$UnmergeTableCellsRequest; + /** + * Updates the properties of an Image. + */ + updateImageProperties: Schema$UpdateImagePropertiesRequest; + /** + * Updates the properties of a Line. + */ + updateLineProperties: Schema$UpdateLinePropertiesRequest; + /** + * Updates the alt text title and/or description of a page element. + */ + updatePageElementAltText: Schema$UpdatePageElementAltTextRequest; + /** + * Updates the transform of a page element. + */ + updatePageElementTransform: Schema$UpdatePageElementTransformRequest; + /** + * Updates the properties of a Page. + */ + updatePageProperties: Schema$UpdatePagePropertiesRequest; + /** + * Updates the styling of paragraphs within a Shape or Table. + */ + updateParagraphStyle: Schema$UpdateParagraphStyleRequest; + /** + * Updates the properties of a Shape. + */ + updateShapeProperties: Schema$UpdateShapePropertiesRequest; + /** + * Updates the position of a set of slides in the presentation. + */ + updateSlidesPosition: Schema$UpdateSlidesPositionRequest; + /** + * Updates the properties of the table borders in a Table. + */ + updateTableBorderProperties: Schema$UpdateTableBorderPropertiesRequest; + /** + * Updates the properties of a TableCell. + */ + updateTableCellProperties: Schema$UpdateTableCellPropertiesRequest; + /** + * Updates the properties of a Table column. + */ + updateTableColumnProperties: Schema$UpdateTableColumnPropertiesRequest; + /** + * Updates the properties of a Table row. + */ + updateTableRowProperties: Schema$UpdateTableRowPropertiesRequest; + /** + * Updates the styling of text within a Shape or Table. + */ + updateTextStyle: Schema$UpdateTextStyleRequest; + /** + * Updates the properties of a Video. + */ + updateVideoProperties: Schema$UpdateVideoPropertiesRequest; + } /** - * The object ID of the page element to update. - */ - objectId: string; + * A single response from an update. + */ + export interface Schema$Response { + /** + * The result of creating an image. + */ + createImage: Schema$CreateImageResponse; + /** + * The result of creating a line. + */ + createLine: Schema$CreateLineResponse; + /** + * The result of creating a shape. + */ + createShape: Schema$CreateShapeResponse; + /** + * The result of creating a Google Sheets chart. + */ + createSheetsChart: Schema$CreateSheetsChartResponse; + /** + * The result of creating a slide. + */ + createSlide: Schema$CreateSlideResponse; + /** + * The result of creating a table. + */ + createTable: Schema$CreateTableResponse; + /** + * The result of creating a video. + */ + createVideo: Schema$CreateVideoResponse; + /** + * The result of duplicating an object. + */ + duplicateObject: Schema$DuplicateObjectResponse; + /** + * The result of grouping objects. + */ + groupObjects: Schema$GroupObjectsResponse; + /** + * The result of replacing all shapes matching some criteria with an image. + */ + replaceAllShapesWithImage: Schema$ReplaceAllShapesWithImageResponse; + /** + * The result of replacing all shapes matching some criteria with a Google + * Sheets chart. + */ + replaceAllShapesWithSheetsChart: + Schema$ReplaceAllShapesWithSheetsChartResponse; + /** + * The result of replacing text. + */ + replaceAllText: Schema$ReplaceAllTextResponse; + } /** - * The input transform matrix used to update the page element. - */ - transform: Schema$AffineTransform; -} -/** - * Updates the properties of a Page. - */ -export interface Schema$UpdatePagePropertiesRequest { + * An RGB color. + */ + export interface Schema$RgbColor { + /** + * The blue component of the color, from 0.0 to 1.0. + */ + blue: number; + /** + * The green component of the color, from 0.0 to 1.0. + */ + green: number; + /** + * The red component of the color, from 0.0 to 1.0. + */ + red: number; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `pageProperties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example to update the page background solid fill color, set `fields` to - * `"pageBackgroundFill.solidFill.color"`. To reset a property to - * its default value, include its field name in the field mask but leave the - * field itself unset. - */ - fields: string; + * The shadow properties of a page element. If these fields are unset, they + * may be inherited from a parent placeholder if it exists. If there is no + * parent, the fields will default to the value used for new page elements + * created in the Slides editor, which may depend on the page element kind. + */ + export interface Schema$Shadow { + /** + * The alignment point of the shadow, that sets the origin for translate, + * scale and skew of the shadow. + */ + alignment: string; + /** + * The alpha of the shadow's color, from 0.0 to 1.0. + */ + alpha: number; + /** + * The radius of the shadow blur. The larger the radius, the more diffuse + * the shadow becomes. + */ + blurRadius: Schema$Dimension; + /** + * The shadow color value. + */ + color: Schema$OpaqueColor; + /** + * The shadow property state. Updating the shadow on a page element will + * implicitly update this field to `RENDERED`, unless another value is + * specified in the same request. To have no shadow on a page element, set + * this field to `NOT_RENDERED`. In this case, any other shadow fields set + * in the same request will be ignored. + */ + propertyState: string; + /** + * Whether the shadow should rotate with the shape. + */ + rotateWithShape: boolean; + /** + * Transform that encodes the translate, scale, and skew of the shadow, + * relative to the alignment position. + */ + transform: Schema$AffineTransform; + /** + * The type of the shadow. + */ + type: string; + } /** - * The object ID of the page the update is applied to. - */ - objectId: string; + * A PageElement kind representing a generic shape that does not have a more + * specific classification. + */ + export interface Schema$Shape { + /** + * Placeholders are shapes that are inherit from corresponding placeholders + * on layouts and masters. If set, the shape is a placeholder shape and any + * inherited properties can be resolved by looking at the parent placeholder + * identified by the Placeholder.parent_object_id field. + */ + placeholder: Schema$Placeholder; + /** + * The properties of the shape. + */ + shapeProperties: Schema$ShapeProperties; + /** + * The type of the shape. + */ + shapeType: string; + /** + * The text content of the shape. + */ + text: Schema$TextContent; + } /** - * The page properties to update. - */ - pageProperties: Schema$PageProperties; -} -/** - * Updates the styling for all of the paragraphs within a Shape or Table that - * overlap with the given text index range. - */ -export interface Schema$UpdateParagraphStyleRequest { + * The shape background fill. + */ + export interface Schema$ShapeBackgroundFill { + /** + * The background fill property state. Updating the fill on a shape will + * implicitly update this field to `RENDERED`, unless another value is + * specified in the same request. To have no fill on a shape, set this field + * to `NOT_RENDERED`. In this case, any other fill fields set in the same + * request will be ignored. + */ + propertyState: string; + /** + * Solid color fill. + */ + solidFill: Schema$SolidFill; + } /** - * The location of the cell in the table containing the paragraph(s) to style. - * If `object_id` refers to a table, `cell_location` must have a value. - * Otherwise, it must not. - */ - cellLocation: Schema$TableCellLocation; + * The properties of a Shape. If the shape is a placeholder shape as + * determined by the placeholder field, then these properties may be inherited + * from a parent placeholder shape. Determining the rendered value of the + * property depends on the corresponding property_state field value. + */ + export interface Schema$ShapeProperties { + /** + * The alignment of the content in the shape. If unspecified, the alignment + * is inherited from a parent placeholder if it exists. If the shape has no + * parent, the default alignment matches the alignment for new shapes + * created in the Slides editor. + */ + contentAlignment: string; + /** + * The hyperlink destination of the shape. If unset, there is no link. Links + * are not inherited from parent placeholders. + */ + link: Schema$Link; + /** + * The outline of the shape. If unset, the outline is inherited from a + * parent placeholder if it exists. If the shape has no parent, then the + * default outline depends on the shape type, matching the defaults for new + * shapes created in the Slides editor. + */ + outline: Schema$Outline; + /** + * The shadow properties of the shape. If unset, the shadow is inherited + * from a parent placeholder if it exists. If the shape has no parent, then + * the default shadow matches the defaults for new shapes created in the + * Slides editor. This property is read-only. + */ + shadow: Schema$Shadow; + /** + * The background fill of the shape. If unset, the background fill is + * inherited from a parent placeholder if it exists. If the shape has no + * parent, then the default background fill depends on the shape type, + * matching the defaults for new shapes created in the Slides editor. + */ + shapeBackgroundFill: Schema$ShapeBackgroundFill; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `style` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example, to update the paragraph alignment, set `fields` to - * `"alignment"`. To reset a property to its default value, include - * its field name in the field mask but leave the field itself unset. - */ - fields: string; + * A PageElement kind representing a linked chart embedded from Google Sheets. + */ + export interface Schema$SheetsChart { + /** + * The ID of the specific chart in the Google Sheets spreadsheet that is + * embedded. + */ + chartId: number; + /** + * The URL of an image of the embedded chart, with a default lifetime of 30 + * minutes. This URL is tagged with the account of the requester. Anyone + * with the URL effectively accesses the image as the original requester. + * Access to the image may be lost if the presentation's sharing + * settings change. + */ + contentUrl: string; + /** + * The properties of the Sheets chart. + */ + sheetsChartProperties: Schema$SheetsChartProperties; + /** + * The ID of the Google Sheets spreadsheet that contains the source chart. + */ + spreadsheetId: string; + } /** - * The object ID of the shape or table with the text to be styled. + * The properties of the SheetsChart. */ - objectId: string; + export interface Schema$SheetsChartProperties { + /** + * The properties of the embedded chart image. + */ + chartImageProperties: Schema$ImageProperties; + } /** - * The paragraph's style. - */ - style: Schema$ParagraphStyle; + * A width and height. + */ + export interface Schema$Size { + /** + * The height of the object. + */ + height: Schema$Dimension; + /** + * The width of the object. + */ + width: Schema$Dimension; + } /** - * The range of text containing the paragraph(s) to style. - */ - textRange: Schema$Range; -} -/** - * Update the properties of a Shape. - */ -export interface Schema$UpdateShapePropertiesRequest { + * The properties of Page that are only relevant for pages with page_type + * SLIDE. + */ + export interface Schema$SlideProperties { + /** + * The object ID of the layout that this slide is based on. + */ + layoutObjectId: string; + /** + * The object ID of the master that this slide is based on. + */ + masterObjectId: string; + /** + * The notes page that this slide is associated with. It defines the visual + * appearance of a notes page when printing or exporting slides with speaker + * notes. A notes page inherits properties from the notes master. The + * placeholder shape with type BODY on the notes page contains the speaker + * notes for this slide. The ID of this shape is identified by the + * speakerNotesObjectId field. The notes page is read-only except for the + * text content and styles of the speaker notes shape. + */ + notesPage: Schema$Page; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `shapeProperties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example to update the shape background solid fill color, set `fields` to - * `"shapeBackgroundFill.solidFill.color"`. To reset a property to - * its default value, include its field name in the field mask but leave the - * field itself unset. - */ - fields: string; + * A solid color fill. The page or page element is filled entirely with the + * specified color value. If any field is unset, its value may be inherited + * from a parent placeholder if it exists. + */ + export interface Schema$SolidFill { + /** + * The fraction of this `color` that should be applied to the pixel. That + * is, the final pixel color is defined by the equation: pixel color = + * alpha * (color) + (1.0 - alpha) * (background color) This means that a + * value of 1.0 corresponds to a solid color, whereas a value of 0.0 + * corresponds to a completely transparent color. + */ + alpha: number; + /** + * The color value of the solid fill. + */ + color: Schema$OpaqueColor; + } /** - * The object ID of the shape the updates are applied to. - */ - objectId: string; + * The stretched picture fill. The page or page element is filled entirely + * with the specified picture. The picture is stretched to fit its container. + */ + export interface Schema$StretchedPictureFill { + /** + * Reading the content_url: An URL to a picture with a default lifetime of + * 30 minutes. This URL is tagged with the account of the requester. Anyone + * with the URL effectively accesses the picture as the original requester. + * Access to the picture may be lost if the presentation's sharing + * settings change. Writing the content_url: The picture is fetched once + * at insertion time and a copy is stored for display inside the + * presentation. Pictures must be less than 50MB in size, cannot exceed 25 + * megapixels, and must be in one of PNG, JPEG, or GIF format. The provided + * URL can be at most 2 kB in length. + */ + contentUrl: string; + /** + * The original size of the picture fill. This field is read-only. + */ + size: Schema$Size; + } /** - * The shape properties to update. - */ - shapeProperties: Schema$ShapeProperties; -} -/** - * Updates the position of slides in the presentation. - */ -export interface Schema$UpdateSlidesPositionRequest { + * A criteria that matches a specific string of text in a shape or table. + */ + export interface Schema$SubstringMatchCriteria { + /** + * Indicates whether the search should respect case: - `True`: the search + * is case sensitive. - `False`: the search is case insensitive. + */ + matchCase: boolean; + /** + * The text to search for in the shape or table. + */ + text: string; + } /** - * The index where the slides should be inserted, based on the slide - * arrangement before the move takes place. Must be between zero and the - * number of slides in the presentation, inclusive. - */ - insertionIndex: number; + * A PageElement kind representing a table. + */ + export interface Schema$Table { + /** + * Number of columns in the table. + */ + columns: number; + /** + * Properties of horizontal cell borders. A table's horizontal cell + * borders are represented as a grid. The grid has one more row than the + * number of rows in the table and the same number of columns as the table. + * For example, if the table is 3 x 3, its horizontal borders will be + * represented as a grid with 4 rows and 3 columns. + */ + horizontalBorderRows: Schema$TableBorderRow[]; + /** + * Number of rows in the table. + */ + rows: number; + /** + * Properties of each column. + */ + tableColumns: Schema$TableColumnProperties[]; + /** + * Properties and contents of each row. Cells that span multiple rows are + * contained in only one of these rows and have a row_span greater than 1. + */ + tableRows: Schema$TableRow[]; + /** + * Properties of vertical cell borders. A table's vertical cell borders + * are represented as a grid. The grid has the same number of rows as the + * table and one more column than the number of columns in the table. For + * example, if the table is 3 x 3, its vertical borders will be represented + * as a grid with 3 rows and 4 columns. + */ + verticalBorderRows: Schema$TableBorderRow[]; + } /** - * The IDs of the slides in the presentation that should be moved. The slides - * in this list must be in existing presentation order, without duplicates. - */ - slideObjectIds: string[]; -} -/** - * Updates the properties of the table borders in a Table. - */ -export interface Schema$UpdateTableBorderPropertiesRequest { + * The properties of each border cell. + */ + export interface Schema$TableBorderCell { + /** + * The location of the border within the border table. + */ + location: Schema$TableCellLocation; + /** + * The border properties. + */ + tableBorderProperties: Schema$TableBorderProperties; + } /** - * The border position in the table range the updates should apply to. If a - * border position is not specified, the updates will apply to all borders in - * the table range. + * The fill of the border. */ - borderPosition: string; + export interface Schema$TableBorderFill { + /** + * Solid fill. + */ + solidFill: Schema$SolidFill; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `tableBorderProperties` is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - * For example to update the table border solid fill color, set `fields` to - * `"tableBorderFill.solidFill.color"`. To reset a property to its - * default value, include its field name in the field mask but leave the field - * itself unset. - */ - fields: string; + * The border styling properties of the TableBorderCell. + */ + export interface Schema$TableBorderProperties { + /** + * The dash style of the border. + */ + dashStyle: string; + /** + * The fill of the table border. + */ + tableBorderFill: Schema$TableBorderFill; + /** + * The thickness of the border. + */ + weight: Schema$Dimension; + } /** - * The object ID of the table. + * Contents of each border row in a table. */ - objectId: string; + export interface Schema$TableBorderRow { + /** + * Properties of each border cell. When a border's adjacent table cells + * are merged, it is not included in the response. + */ + tableBorderCells: Schema$TableBorderCell[]; + } /** - * The table border properties to update. - */ - tableBorderProperties: Schema$TableBorderProperties; + * Properties and contents of each table cell. + */ + export interface Schema$TableCell { + /** + * Column span of the cell. + */ + columnSpan: number; + /** + * The location of the cell within the table. + */ + location: Schema$TableCellLocation; + /** + * Row span of the cell. + */ + rowSpan: number; + /** + * The properties of the table cell. + */ + tableCellProperties: Schema$TableCellProperties; + /** + * The text content of the cell. + */ + text: Schema$TextContent; + } /** - * The table range representing the subset of the table to which the updates - * are applied. If a table range is not specified, the updates will apply to - * the entire table. - */ - tableRange: Schema$TableRange; -} -/** - * Update the properties of a TableCell. - */ -export interface Schema$UpdateTableCellPropertiesRequest { + * The table cell background fill. + */ + export interface Schema$TableCellBackgroundFill { + /** + * The background fill property state. Updating the fill on a table cell + * will implicitly update this field to `RENDERED`, unless another value is + * specified in the same request. To have no fill on a table cell, set this + * field to `NOT_RENDERED`. In this case, any other fill fields set in the + * same request will be ignored. + */ + propertyState: string; + /** + * Solid color fill. + */ + solidFill: Schema$SolidFill; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `tableCellProperties` is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - * For example to update the table cell background solid fill color, set - * `fields` to `"tableCellBackgroundFill.solidFill.color"`. To - * reset a property to its default value, include its field name in the field - * mask but leave the field itself unset. - */ - fields: string; + * A location of a single table cell within a table. + */ + export interface Schema$TableCellLocation { + /** + * The 0-based column index. + */ + columnIndex: number; + /** + * The 0-based row index. + */ + rowIndex: number; + } /** - * The object ID of the table. - */ - objectId: string; + * The properties of the TableCell. + */ + export interface Schema$TableCellProperties { + /** + * The alignment of the content in the table cell. The default alignment + * matches the alignment for newly created table cells in the Slides editor. + */ + contentAlignment: string; + /** + * The background fill of the table cell. The default fill matches the fill + * for newly created table cells in the Slides editor. + */ + tableCellBackgroundFill: Schema$TableCellBackgroundFill; + } /** - * The table cell properties to update. + * Properties of each column in a table. */ - tableCellProperties: Schema$TableCellProperties; + export interface Schema$TableColumnProperties { + /** + * Width of a column. + */ + columnWidth: Schema$Dimension; + } /** - * The table range representing the subset of the table to which the updates - * are applied. If a table range is not specified, the updates will apply to - * the entire table. - */ - tableRange: Schema$TableRange; -} -/** - * Updates the properties of a Table column. - */ -export interface Schema$UpdateTableColumnPropertiesRequest { + * A table range represents a reference to a subset of a table. It's + * important to note that the cells specified by a table range do not + * necessarily form a rectangle. For example, let's say we have a 3 x 3 + * table where all the cells of the last row are merged together. The table + * looks like this: [ ] A table range with + * location = (0, 0), row span = 3 and column span = 2 specifies the following + * cells: x x [ x ] + */ + export interface Schema$TableRange { + /** + * The column span of the table range. + */ + columnSpan: number; + /** + * The starting location of the table range. + */ + location: Schema$TableCellLocation; + /** + * The row span of the table range. + */ + rowSpan: number; + } /** - * The list of zero-based indices specifying which columns to update. If no - * indices are provided, all columns in the table will be updated. - */ - columnIndices: number[]; + * Properties and contents of each row in a table. + */ + export interface Schema$TableRow { + /** + * Height of a row. + */ + rowHeight: Schema$Dimension; + /** + * Properties and contents of each cell. Cells that span multiple columns + * are represented only once with a column_span greater than 1. As a result, + * the length of this collection does not always match the number of columns + * of the entire table. + */ + tableCells: Schema$TableCell[]; + /** + * Properties of the row. + */ + tableRowProperties: Schema$TableRowProperties; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `tableColumnProperties` is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - * For example to update the column width, set `fields` to - * `"column_width"`. If '"column_width"' is - * included in the field mask but the property is left unset, the column width - * will default to 406,400 EMU (32 points). + * Properties of each row in a table. */ - fields: string; + export interface Schema$TableRowProperties { + /** + * Minimum height of the row. The row will be rendered in the Slides editor + * at a height equal to or greater than this value in order to show all the + * text in the row's cell(s). + */ + minRowHeight: Schema$Dimension; + } /** - * The object ID of the table. - */ - objectId: string; + * The general text content. The text must reside in a compatible shape (e.g. + * text box or rectangle) or a table cell in a page. + */ + export interface Schema$TextContent { + /** + * The bulleted lists contained in this text, keyed by list ID. + */ + lists: any; + /** + * The text contents broken down into its component parts, including styling + * information. This property is read-only. + */ + textElements: Schema$TextElement[]; + } /** - * The table column properties to update. If the value of - * `table_column_properties#column_width` in the request is less than 406,400 - * EMU (32 points), a 400 bad request error is returned. - */ - tableColumnProperties: Schema$TableColumnProperties; -} -/** - * Updates the properties of a Table row. - */ -export interface Schema$UpdateTableRowPropertiesRequest { + * A TextElement describes the content of a range of indices in the text + * content of a Shape or TableCell. + */ + export interface Schema$TextElement { + /** + * A TextElement representing a spot in the text that is dynamically + * replaced with content that can change over time. + */ + autoText: Schema$AutoText; + /** + * The zero-based end index of this text element, exclusive, in Unicode code + * units. + */ + endIndex: number; + /** + * A marker representing the beginning of a new paragraph. The + * `start_index` and `end_index` of this TextElement represent the range of + * the paragraph. Other TextElements with an index range contained inside + * this paragraph's range are considered to be part of this paragraph. + * The range of indices of two separate paragraphs will never overlap. + */ + paragraphMarker: Schema$ParagraphMarker; + /** + * The zero-based start index of this text element, in Unicode code units. + */ + startIndex: number; + /** + * A TextElement representing a run of text where all of the characters in + * the run have the same TextStyle. The `start_index` and `end_index` of + * TextRuns will always be fully contained in the index range of a single + * `paragraph_marker` TextElement. In other words, a TextRun will never span + * multiple paragraphs. + */ + textRun: Schema$TextRun; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `tableRowProperties` is implied and should not be specified. A - * single `"*"` can be used as short-hand for listing every field. - * For example to update the minimum row height, set `fields` to - * `"min_row_height"`. If '"min_row_height"' is - * included in the field mask but the property is left unset, the minimum row - * height will default to 0. - */ - fields: string; + * A TextElement kind that represents a run of text that all has the same + * styling. + */ + export interface Schema$TextRun { + /** + * The text of this run. + */ + content: string; + /** + * The styling applied to this run. + */ + style: Schema$TextStyle; + } /** - * The object ID of the table. - */ - objectId: string; + * Represents the styling that can be applied to a TextRun. If this text is + * contained in a shape with a parent placeholder, then these text styles may + * be inherited from the parent. Which text styles are inherited depend on the + * nesting level of lists: * A text run in a paragraph that is not in a list + * will inherit its text style from the the newline character in the + * paragraph at the 0 nesting level of the list inside the parent + * placeholder. * A text run in a paragraph that is in a list will inherit its + * text style from the newline character in the paragraph at its + * corresponding nesting level of the list inside the parent placeholder. + * Inherited text styles are represented as unset fields in this message. If + * text is contained in a shape without a parent placeholder, unsetting these + * fields will revert the style to a value matching the defaults in the Slides + * editor. + */ + export interface Schema$TextStyle { + /** + * The background color of the text. If set, the color is either opaque or + * transparent, depending on if the `opaque_color` field in it is set. + */ + backgroundColor: Schema$OptionalColor; + /** + * The text's vertical offset from its normal position. Text with + * `SUPERSCRIPT` or `SUBSCRIPT` baseline offsets is automatically rendered + * in a smaller font size, computed based on the `font_size` field. The + * `font_size` itself is not affected by changes in this field. + */ + baselineOffset: string; + /** + * Whether or not the text is rendered as bold. + */ + bold: boolean; + /** + * The font family of the text. The font family can be any font from the + * Font menu in Slides or from [Google Fonts] (https://fonts.google.com/). + * If the font name is unrecognized, the text is rendered in `Arial`. Some + * fonts can affect the weight of the text. If an update request specifies + * values for both `font_family` and `bold`, the explicitly-set `bold` value + * is used. + */ + fontFamily: string; + /** + * The size of the text's font. When read, the `font_size` will + * specified in points. + */ + fontSize: Schema$Dimension; + /** + * The color of the text itself. If set, the color is either opaque or + * transparent, depending on if the `opaque_color` field in it is set. + */ + foregroundColor: Schema$OptionalColor; + /** + * Whether or not the text is italicized. + */ + italic: boolean; + /** + * The hyperlink destination of the text. If unset, there is no link. Links + * are not inherited from parent text. Changing the link in an update + * request causes some other changes to the text style of the range: * When + * setting a link, the text foreground color will be set to + * ThemeColorType.HYPERLINK and the text will be underlined. If these + * fields are modified in the same request, those values will be used + * instead of the link defaults. * Setting a link on a text range that + * overlaps with an existing link will also update the existing link to + * point to the new URL. * Links are not settable on newline characters. As + * a result, setting a link on a text range that crosses a paragraph + * boundary, such as `"ABCx/123"`, will separate the newline + * character(s) into their own text runs. The link will be applied + * separately to the runs before and after the newline. * Removing a link + * will update the text style of the range to match the style of the + * preceding text (or the default text styles if the preceding text is + * another link) unless different styles are being set in the same request. + */ + link: Schema$Link; + /** + * Whether or not the text is in small capital letters. + */ + smallCaps: boolean; + /** + * Whether or not the text is struck through. + */ + strikethrough: boolean; + /** + * Whether or not the text is underlined. + */ + underline: boolean; + /** + * The font family and rendered weight of the text. This field is an + * extension of `font_family` meant to support explicit font weights without + * breaking backwards compatibility. As such, when reading the style of a + * range of text, the value of `weighted_font_family#font_family` will + * always be equal to that of `font_family`. However, when writing, if both + * fields are included in the field mask (either explicitly or through the + * wildcard `"*"`), their values are reconciled as follows: * If + * `font_family` is set and `weighted_font_family` is not, the value of + * `font_family` is applied with weight `400` ("normal"). * If + * both fields are set, the value of `font_family` must match that of + * `weighted_font_family#font_family`. If so, the font family and weight of + * `weighted_font_family` is applied. Otherwise, a 400 bad request error is + * returned. * If `weighted_font_family` is set and `font_family` is not, + * the font family and weight of `weighted_font_family` is applied. * If + * neither field is set, the font family and weight of the text inherit from + * the parent. Note that these properties cannot inherit separately from + * each other. If an update request specifies values for both + * `weighted_font_family` and `bold`, the `weighted_font_family` is applied + * first, then `bold`. If `weighted_font_family#weight` is not set, it + * defaults to `400`. If `weighted_font_family` is set, then + * `weighted_font_family#font_family` must also be set with a non-empty + * value. Otherwise, a 400 bad request error is returned. + */ + weightedFontFamily: Schema$WeightedFontFamily; + } /** - * The list of zero-based indices specifying which rows to update. If no - * indices are provided, all rows in the table will be updated. - */ - rowIndices: number[]; + * A pair mapping a theme color type to the concrete color it represents. + */ + export interface Schema$ThemeColorPair { + /** + * The concrete color corresponding to the theme color type above. + */ + color: Schema$RgbColor; + /** + * The type of the theme color. + */ + type: string; + } /** - * The table row properties to update. - */ - tableRowProperties: Schema$TableRowProperties; -} -/** - * Update the styling of text in a Shape or Table. - */ -export interface Schema$UpdateTextStyleRequest { + * The thumbnail of a page. + */ + export interface Schema$Thumbnail { + /** + * The content URL of the thumbnail image. The URL to the image has a + * default lifetime of 30 minutes. This URL is tagged with the account of + * the requester. Anyone with the URL effectively accesses the image as the + * original requester. Access to the image may be lost if the + * presentation's sharing settings change. The mime type of the + * thumbnail image is the same as specified in the + * `GetPageThumbnailRequest`. + */ + contentUrl: string; + /** + * The positive height in pixels of the thumbnail image. + */ + height: number; + /** + * The positive width in pixels of the thumbnail image. + */ + width: number; + } /** - * The location of the cell in the table containing the text to style. If - * `object_id` refers to a table, `cell_location` must have a value. - * Otherwise, it must not. + * Ungroups objects, such as groups. */ - cellLocation: Schema$TableCellLocation; + export interface Schema$UngroupObjectsRequest { + /** + * The object IDs of the objects to ungroup. Only groups that are not + * inside other groups can be ungrouped. All the groups should be on the + * same page. The group itself is deleted. The visual sizes and positions of + * all the children are preserved. + */ + objectIds: string[]; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `style` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example, to update the text style to bold, set `fields` to - * `"bold"`. To reset a property to its default value, include its - * field name in the field mask but leave the field itself unset. + * Unmerges cells in a Table. */ - fields: string; + export interface Schema$UnmergeTableCellsRequest { + /** + * The object ID of the table. + */ + objectId: string; + /** + * The table range specifying which cells of the table to unmerge. All + * merged cells in this range will be unmerged, and cells that are already + * unmerged will not be affected. If the range has no merged cells, the + * request will do nothing. If there is text in any of the merged cells, the + * text will remain in the upper-left ("head") cell of the + * resulting block of unmerged cells. + */ + tableRange: Schema$TableRange; + } /** - * The object ID of the shape or table with the text to be styled. - */ - objectId: string; + * Update the properties of an Image. + */ + export interface Schema$UpdateImagePropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `imageProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the image outline color, set `fields` to + * `"outline.outlineFill.solidFill.color"`. To reset a property + * to its default value, include its field name in the field mask but leave + * the field itself unset. + */ + fields: string; + /** + * The image properties to update. + */ + imageProperties: Schema$ImageProperties; + /** + * The object ID of the image the updates are applied to. + */ + objectId: string; + } /** - * The style(s) to set on the text. If the value for a particular style - * matches that of the parent, that style will be set to inherit. Certain - * text style changes may cause other changes meant to mirror the behavior of - * the Slides editor. See the documentation of TextStyle for more information. + * Updates the properties of a Line. */ - style: Schema$TextStyle; + export interface Schema$UpdateLinePropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `lineProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the line solid fill color, set `fields` to + * `"lineFill.solidFill.color"`. To reset a property to its + * default value, include its field name in the field mask but leave the + * field itself unset. + */ + fields: string; + /** + * The line properties to update. + */ + lineProperties: Schema$LineProperties; + /** + * The object ID of the line the update is applied to. + */ + objectId: string; + } /** - * The range of text to style. The range may be extended to include adjacent - * newlines. If the range fully contains a paragraph belonging to a list, the - * paragraph's bullet is also updated with the matching text style. + * Updates the alt text title and/or description of a page element. */ - textRange: Schema$Range; -} -/** - * Update the properties of a Video. - */ -export interface Schema$UpdateVideoPropertiesRequest { + export interface Schema$UpdatePageElementAltTextRequest { + /** + * The updated alt text description of the page element. If unset the + * existing value will be maintained. The description is exposed to screen + * readers and other accessibility interfaces. Only use human readable + * values related to the content of the page element. + */ + description: string; + /** + * The object ID of the page element the updates are applied to. + */ + objectId: string; + /** + * The updated alt text title of the page element. If unset the existing + * value will be maintained. The title is exposed to screen readers and + * other accessibility interfaces. Only use human readable values related to + * the content of the page element. + */ + title: string; + } /** - * The fields that should be updated. At least one field must be specified. - * The root `videoProperties` is implied and should not be specified. A single - * `"*"` can be used as short-hand for listing every field. For - * example to update the video outline color, set `fields` to - * `"outline.outlineFill.solidFill.color"`. To reset a property to - * its default value, include its field name in the field mask but leave the - * field itself unset. - */ - fields: string; + * Updates the transform of a page element. Updating the transform of a group + * will change the absolute transform of the page elements in that group, + * which can change their visual appearance. See the documentation for + * PageElement.transform for more details. + */ + export interface Schema$UpdatePageElementTransformRequest { + /** + * The apply mode of the transform update. + */ + applyMode: string; + /** + * The object ID of the page element to update. + */ + objectId: string; + /** + * The input transform matrix used to update the page element. + */ + transform: Schema$AffineTransform; + } /** - * The object ID of the video the updates are applied to. + * Updates the properties of a Page. */ - objectId: string; + export interface Schema$UpdatePagePropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `pageProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the page background solid fill color, set `fields` + * to `"pageBackgroundFill.solidFill.color"`. To reset a property + * to its default value, include its field name in the field mask but leave + * the field itself unset. + */ + fields: string; + /** + * The object ID of the page the update is applied to. + */ + objectId: string; + /** + * The page properties to update. + */ + pageProperties: Schema$PageProperties; + } /** - * The video properties to update. - */ - videoProperties: Schema$VideoProperties; -} -/** - * A PageElement kind representing a video. - */ -export interface Schema$Video { + * Updates the styling for all of the paragraphs within a Shape or Table that + * overlap with the given text index range. + */ + export interface Schema$UpdateParagraphStyleRequest { + /** + * The location of the cell in the table containing the paragraph(s) to + * style. If `object_id` refers to a table, `cell_location` must have a + * value. Otherwise, it must not. + */ + cellLocation: Schema$TableCellLocation; + /** + * The fields that should be updated. At least one field must be specified. + * The root `style` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. For + * example, to update the paragraph alignment, set `fields` to + * `"alignment"`. To reset a property to its default value, + * include its field name in the field mask but leave the field itself + * unset. + */ + fields: string; + /** + * The object ID of the shape or table with the text to be styled. + */ + objectId: string; + /** + * The paragraph's style. + */ + style: Schema$ParagraphStyle; + /** + * The range of text containing the paragraph(s) to style. + */ + textRange: Schema$Range; + } /** - * The video source's unique identifier for this video. - */ - id: string; + * Update the properties of a Shape. + */ + export interface Schema$UpdateShapePropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `shapeProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the shape background solid fill color, set `fields` + * to `"shapeBackgroundFill.solidFill.color"`. To reset a + * property to its default value, include its field name in the field mask + * but leave the field itself unset. + */ + fields: string; + /** + * The object ID of the shape the updates are applied to. + */ + objectId: string; + /** + * The shape properties to update. + */ + shapeProperties: Schema$ShapeProperties; + } /** - * The video source. - */ - source: string; + * Updates the position of slides in the presentation. + */ + export interface Schema$UpdateSlidesPositionRequest { + /** + * The index where the slides should be inserted, based on the slide + * arrangement before the move takes place. Must be between zero and the + * number of slides in the presentation, inclusive. + */ + insertionIndex: number; + /** + * The IDs of the slides in the presentation that should be moved. The + * slides in this list must be in existing presentation order, without + * duplicates. + */ + slideObjectIds: string[]; + } /** - * An URL to a video. The URL is valid as long as the source video exists and - * sharing settings do not change. + * Updates the properties of the table borders in a Table. */ - url: string; + export interface Schema$UpdateTableBorderPropertiesRequest { + /** + * The border position in the table range the updates should apply to. If a + * border position is not specified, the updates will apply to all borders + * in the table range. + */ + borderPosition: string; + /** + * The fields that should be updated. At least one field must be specified. + * The root `tableBorderProperties` is implied and should not be specified. + * A single `"*"` can be used as short-hand for listing every + * field. For example to update the table border solid fill color, set + * `fields` to `"tableBorderFill.solidFill.color"`. To reset a + * property to its default value, include its field name in the field mask + * but leave the field itself unset. + */ + fields: string; + /** + * The object ID of the table. + */ + objectId: string; + /** + * The table border properties to update. + */ + tableBorderProperties: Schema$TableBorderProperties; + /** + * The table range representing the subset of the table to which the updates + * are applied. If a table range is not specified, the updates will apply to + * the entire table. + */ + tableRange: Schema$TableRange; + } /** - * The properties of the video. - */ - videoProperties: Schema$VideoProperties; -} -/** - * The properties of the Video. - */ -export interface Schema$VideoProperties { + * Update the properties of a TableCell. + */ + export interface Schema$UpdateTableCellPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `tableCellProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the table cell background solid fill color, set + * `fields` to `"tableCellBackgroundFill.solidFill.color"`. To + * reset a property to its default value, include its field name in the + * field mask but leave the field itself unset. + */ + fields: string; + /** + * The object ID of the table. + */ + objectId: string; + /** + * The table cell properties to update. + */ + tableCellProperties: Schema$TableCellProperties; + /** + * The table range representing the subset of the table to which the updates + * are applied. If a table range is not specified, the updates will apply to + * the entire table. + */ + tableRange: Schema$TableRange; + } /** - * Whether to enable video autoplay when the page is displayed in present - * mode. Defaults to false. + * Updates the properties of a Table column. */ - autoPlay: boolean; + export interface Schema$UpdateTableColumnPropertiesRequest { + /** + * The list of zero-based indices specifying which columns to update. If no + * indices are provided, all columns in the table will be updated. + */ + columnIndices: number[]; + /** + * The fields that should be updated. At least one field must be specified. + * The root `tableColumnProperties` is implied and should not be specified. + * A single `"*"` can be used as short-hand for listing every + * field. For example to update the column width, set `fields` to + * `"column_width"`. If '"column_width"' is + * included in the field mask but the property is left unset, the column + * width will default to 406,400 EMU (32 points). + */ + fields: string; + /** + * The object ID of the table. + */ + objectId: string; + /** + * The table column properties to update. If the value of + * `table_column_properties#column_width` in the request is less than + * 406,400 EMU (32 points), a 400 bad request error is returned. + */ + tableColumnProperties: Schema$TableColumnProperties; + } /** - * The time at which to end playback, measured in seconds from the beginning - * of the video. If set, the end time should be after the start time. If not - * set or if you set this to a value that exceeds the video's length, the - * video will be played until its end. + * Updates the properties of a Table row. */ - end: number; + export interface Schema$UpdateTableRowPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `tableRowProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the minimum row height, set `fields` to + * `"min_row_height"`. If '"min_row_height"' is + * included in the field mask but the property is left unset, the minimum + * row height will default to 0. + */ + fields: string; + /** + * The object ID of the table. + */ + objectId: string; + /** + * The list of zero-based indices specifying which rows to update. If no + * indices are provided, all rows in the table will be updated. + */ + rowIndices: number[]; + /** + * The table row properties to update. + */ + tableRowProperties: Schema$TableRowProperties; + } /** - * Whether to mute the audio during video playback. Defaults to false. - */ - mute: boolean; + * Update the styling of text in a Shape or Table. + */ + export interface Schema$UpdateTextStyleRequest { + /** + * The location of the cell in the table containing the text to style. If + * `object_id` refers to a table, `cell_location` must have a value. + * Otherwise, it must not. + */ + cellLocation: Schema$TableCellLocation; + /** + * The fields that should be updated. At least one field must be specified. + * The root `style` is implied and should not be specified. A single + * `"*"` can be used as short-hand for listing every field. For + * example, to update the text style to bold, set `fields` to + * `"bold"`. To reset a property to its default value, include + * its field name in the field mask but leave the field itself unset. + */ + fields: string; + /** + * The object ID of the shape or table with the text to be styled. + */ + objectId: string; + /** + * The style(s) to set on the text. If the value for a particular style + * matches that of the parent, that style will be set to inherit. Certain + * text style changes may cause other changes meant to mirror the behavior + * of the Slides editor. See the documentation of TextStyle for more + * information. + */ + style: Schema$TextStyle; + /** + * The range of text to style. The range may be extended to include + * adjacent newlines. If the range fully contains a paragraph belonging to + * a list, the paragraph's bullet is also updated with the matching text + * style. + */ + textRange: Schema$Range; + } /** - * The outline of the video. The default outline matches the defaults for new - * videos created in the Slides editor. - */ - outline: Schema$Outline; + * Update the properties of a Video. + */ + export interface Schema$UpdateVideoPropertiesRequest { + /** + * The fields that should be updated. At least one field must be specified. + * The root `videoProperties` is implied and should not be specified. A + * single `"*"` can be used as short-hand for listing every field. + * For example to update the video outline color, set `fields` to + * `"outline.outlineFill.solidFill.color"`. To reset a property + * to its default value, include its field name in the field mask but leave + * the field itself unset. + */ + fields: string; + /** + * The object ID of the video the updates are applied to. + */ + objectId: string; + /** + * The video properties to update. + */ + videoProperties: Schema$VideoProperties; + } /** - * The time at which to start playback, measured in seconds from the beginning - * of the video. If set, the start time should be before the end time. If you - * set this to a value that exceeds the video's length in seconds, the - * video will be played from the last second. If not set, the video will be - * played from the beginning. - */ - start: number; -} -/** - * Represents a font family and weight used to style a TextRun. - */ -export interface Schema$WeightedFontFamily { + * A PageElement kind representing a video. + */ + export interface Schema$Video { + /** + * The video source's unique identifier for this video. + */ + id: string; + /** + * The video source. + */ + source: string; + /** + * An URL to a video. The URL is valid as long as the source video exists + * and sharing settings do not change. + */ + url: string; + /** + * The properties of the video. + */ + videoProperties: Schema$VideoProperties; + } /** - * The font family of the text. The font family can be any font from the Font - * menu in Slides or from [Google Fonts] (https://fonts.google.com/). If the - * font name is unrecognized, the text is rendered in `Arial`. - */ - fontFamily: string; + * The properties of the Video. + */ + export interface Schema$VideoProperties { + /** + * Whether to enable video autoplay when the page is displayed in present + * mode. Defaults to false. + */ + autoPlay: boolean; + /** + * The time at which to end playback, measured in seconds from the beginning + * of the video. If set, the end time should be after the start time. If not + * set or if you set this to a value that exceeds the video's length, + * the video will be played until its end. + */ + end: number; + /** + * Whether to mute the audio during video playback. Defaults to false. + */ + mute: boolean; + /** + * The outline of the video. The default outline matches the defaults for + * new videos created in the Slides editor. + */ + outline: Schema$Outline; + /** + * The time at which to start playback, measured in seconds from the + * beginning of the video. If set, the start time should be before the end + * time. If you set this to a value that exceeds the video's length in + * seconds, the video will be played from the last second. If not set, the + * video will be played from the beginning. + */ + start: number; + } /** - * The rendered weight of the text. This field can have any value that is a - * multiple of `100` between `100` and `900`, inclusive. This range - * corresponds to the numerical values described in the CSS 2.1 Specification, - * [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness), with - * non-numerical values disallowed. Weights greater than or equal to `700` are - * considered bold, and weights less than `700`are not bold. The default value - * is `400` ("normal"). - */ - weight: number; -} -/** - * A PageElement kind representing word art. - */ -export interface Schema$WordArt { + * Represents a font family and weight used to style a TextRun. + */ + export interface Schema$WeightedFontFamily { + /** + * The font family of the text. The font family can be any font from the + * Font menu in Slides or from [Google Fonts] (https://fonts.google.com/). + * If the font name is unrecognized, the text is rendered in `Arial`. + */ + fontFamily: string; + /** + * The rendered weight of the text. This field can have any value that is a + * multiple of `100` between `100` and `900`, inclusive. This range + * corresponds to the numerical values described in the CSS 2.1 + * Specification, + * [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness), + * with non-numerical values disallowed. Weights greater than or equal to + * `700` are considered bold, and weights less than `700`are not bold. The + * default value is `400` ("normal"). + */ + weight: number; + } /** - * The text rendered as word art. + * A PageElement kind representing word art. */ - renderedText: string; -} -/** - * Provides control over how write requests are executed. - */ -export interface Schema$WriteControl { + export interface Schema$WordArt { + /** + * The text rendered as word art. + */ + renderedText: string; + } /** - * The revision ID of the presentation required for the write request. If - * specified and the `required_revision_id` doesn't exactly match the - * presentation's current `revision_id`, the request will not be processed - * and will return a 400 bad request error. + * Provides control over how write requests are executed. */ - requiredRevisionId: string; -} - -export class Resource$Presentations { - root: Slides; - pages: Resource$Presentations$Pages; - constructor(root: Slides) { - this.root = root; - this.getRoot.bind(this); - this.pages = new Resource$Presentations$Pages(root); + export interface Schema$WriteControl { + /** + * The revision ID of the presentation required for the write request. If + * specified and the `required_revision_id` doesn't exactly match the + * presentation's current `revision_id`, the request will not be + * processed and will return a 400 bad request error. + */ + requiredRevisionId: string; } - getRoot() { - return this.root; - } - - - /** - * slides.presentations.batchUpdate - * @desc Applies one or more updates to the presentation. Each request is - * validated before being applied. If any request is not valid, then the - * entire request will fail and nothing will be applied. Some requests have - * replies to give you some information about how they are applied. Other - * requests do not need to return information; these each return an empty - * reply. The order of replies matches that of the requests. For example, - * suppose you call batchUpdate with four updates, and only the third one - * returns information. The response would have two empty replies: the reply - * to the third request, and another empty reply, in that order. Because - * other users may be editing the presentation, the presentation might not - * exactly reflect your changes: your changes may be altered with respect to - * collaborator changes. If there are no collaborators, the presentation - * should reflect your changes. In any case, the updates in your request are - * guaranteed to be applied together atomically. - * @alias slides.presentations.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.presentationId The presentation to apply the updates to. - * @param {().BatchUpdatePresentationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Presentations { + root: Slides; + pages: Resource$Presentations$Pages; + constructor(root: Slides) { + this.root = root; + this.getRoot.bind(this); + this.pages = new Resource$Presentations$Pages(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/presentations/{presentationId}:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['presentationId'], - pathParams: ['presentationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } - /** - * slides.presentations.create - * @desc Creates a new presentation using the title given in the request. If a - * presentationId is provided, uses it as the ID of the new presentation. - * Otherwise, a new presentationId is generated. Returns the created - * presentation. - * @alias slides.presentations.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Presentation} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/presentations').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * slides.presentations.batchUpdate + * @desc Applies one or more updates to the presentation. Each request is + * validated before being applied. If any request is not valid, then the + * entire request will fail and nothing will be applied. Some requests have + * replies to give you some information about how they are applied. Other + * requests do not need to return information; these each return an empty + * reply. The order of replies matches that of the requests. For example, + * suppose you call batchUpdate with four updates, and only the third one + * returns information. The response would have two empty replies: the reply + * to the third request, and another empty reply, in that order. Because + * other users may be editing the presentation, the presentation might not + * exactly reflect your changes: your changes may be altered with respect to + * collaborator changes. If there are no collaborators, the presentation + * should reflect your changes. In any case, the updates in your request are + * guaranteed to be applied together atomically. + * @alias slides.presentations.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.presentationId The presentation to apply the updates to. + * @param {().BatchUpdatePresentationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/presentations/{presentationId}:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['presentationId'], + pathParams: ['presentationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * slides.presentations.get - * @desc Gets the latest version of the specified presentation. - * @alias slides.presentations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.presentationId The ID of the presentation to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * slides.presentations.create + * @desc Creates a new presentation using the title given in the request. If + * a presentationId is provided, uses it as the ID of the new presentation. + * Otherwise, a new presentationId is generated. Returns the created + * presentation. + * @alias slides.presentations.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Presentation} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/presentations').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/presentations/{+presentationId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['presentationId'], - pathParams: ['presentationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Presentations$Pages { - root: Slides; - constructor(root: Slides) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * slides.presentations.pages.get - * @desc Gets the latest version of the specified page in the presentation. - * @alias slides.presentations.pages.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.pageObjectId The object ID of the page to retrieve. - * @param {string} params.presentationId The ID of the presentation to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * slides.presentations.get + * @desc Gets the latest version of the specified presentation. + * @alias slides.presentations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.presentationId The ID of the presentation to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/presentations/{+presentationId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['presentationId'], + pathParams: ['presentationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Presentations$Pages { + root: Slides; + constructor(root: Slides) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/presentations/{presentationId}/pages/{pageObjectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['presentationId', 'pageObjectId'], - pathParams: ['pageObjectId', 'presentationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * slides.presentations.pages.getThumbnail - * @desc Generates a thumbnail of the latest version of the specified page in - * the presentation and returns a URL to the thumbnail image. This request - * counts as an [expensive read request](/slides/limits) for quota purposes. - * @alias slides.presentations.pages.getThumbnail - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.pageObjectId The object ID of the page whose thumbnail to retrieve. - * @param {string} params.presentationId The ID of the presentation to retrieve. - * @param {string=} params.thumbnailProperties.mimeType The optional mime type of the thumbnail image. If you don't specify the mime type, the default mime type will be PNG. - * @param {string=} params.thumbnailProperties.thumbnailSize The optional thumbnail image size. If you don't specify the size, the server chooses a default size of the image. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getThumbnail(params?: any, options?: MethodOptions): - AxiosPromise; - getThumbnail( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getThumbnail( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * slides.presentations.pages.get + * @desc Gets the latest version of the specified page in the presentation. + * @alias slides.presentations.pages.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.pageObjectId The object ID of the page to retrieve. + * @param {string} params.presentationId The ID of the presentation to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/presentations/{presentationId}/pages/{pageObjectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['presentationId', 'pageObjectId'], + pathParams: ['pageObjectId', 'presentationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['presentationId', 'pageObjectId'], - pathParams: ['pageObjectId', 'presentationId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * slides.presentations.pages.getThumbnail + * @desc Generates a thumbnail of the latest version of the specified page + * in the presentation and returns a URL to the thumbnail image. This + * request counts as an [expensive read request](/slides/limits) for quota + * purposes. + * @alias slides.presentations.pages.getThumbnail + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.pageObjectId The object ID of the page whose thumbnail to retrieve. + * @param {string} params.presentationId The ID of the presentation to retrieve. + * @param {string=} params.thumbnailProperties.mimeType The optional mime type of the thumbnail image. If you don't specify the mime type, the default mime type will be PNG. + * @param {string=} params.thumbnailProperties.thumbnailSize The optional thumbnail image size. If you don't specify the size, the server chooses a default size of the image. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getThumbnail(params?: any, options?: MethodOptions): + AxiosPromise; + getThumbnail( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getThumbnail( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://slides.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['presentationId', 'pageObjectId'], + pathParams: ['pageObjectId', 'presentationId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/sourcerepo/v1.ts b/src/apis/sourcerepo/v1.ts index 3ba74113f19..f2155ea8b1f 100644 --- a/src/apis/sourcerepo/v1.ts +++ b/src/apis/sourcerepo/v1.ts @@ -27,673 +27,688 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Source Repositories API - * - * Access source code repositories hosted by Google. - * - * @example - * const google = require('googleapis'); - * const sourcerepo = google.sourcerepo('v1'); - * - * @namespace sourcerepo - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Sourcerepo - */ -export class Sourcerepo { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace sourcerepo_v1 { + /** + * Cloud Source Repositories API + * + * Access source code repositories hosted by Google. + * + * @example + * const google = require('googleapis'); + * const sourcerepo = google.sourcerepo('v1'); + * + * @namespace sourcerepo + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Sourcerepo + */ + export class Sourcerepo { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Specifies the audit configuration for a service. The configuration determines - * which permission types are logged, and what identities, if any, are exempted - * from logging. An AuditConfig must have one or more AuditLogConfigs. If there - * are AuditConfigs for both `allServices` and a specific service, the union of - * the two AuditConfigs is used for that service: the log_types specified in - * each AuditConfig are enabled, and the exempted_members in each AuditLogConfig - * are exempted. Example Policy with multiple AuditConfigs: { - * "audit_configs": [ { "service": - * "allServices" "audit_log_configs": [ { - * "log_type": "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", }, { - * "log_type": "ADMIN_READ", } ] }, { - * "service": "fooservice.googleapis.com" - * "audit_log_configs": [ { "log_type": - * "DATA_READ", }, { "log_type": - * "DATA_WRITE", "exempted_members": [ - * "user:bar@gmail.com" ] } ] } ] - * } For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - * logging. It also exempts foo@gmail.com from DATA_READ logging, and - * bar@gmail.com from DATA_WRITE logging. - */ -export interface Schema$AuditConfig { /** - * The configuration for logging of each type of permission. Next ID: 4 + * Specifies the audit configuration for a service. The configuration + * determines which permission types are logged, and what identities, if any, + * are exempted from logging. An AuditConfig must have one or more + * AuditLogConfigs. If there are AuditConfigs for both `allServices` and a + * specific service, the union of the two AuditConfigs is used for that + * service: the log_types specified in each AuditConfig are enabled, and the + * exempted_members in each AuditLogConfig are exempted. Example Policy with + * multiple AuditConfigs: { "audit_configs": [ { + * "service": "allServices" "audit_log_configs": + * [ { "log_type": "DATA_READ", + * "exempted_members": [ "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", }, { + * "log_type": "ADMIN_READ", } ] }, + * { "service": "fooservice.googleapis.com" + * "audit_log_configs": [ { "log_type": + * "DATA_READ", }, { "log_type": + * "DATA_WRITE", "exempted_members": [ + * "user:bar@gmail.com" ] } ] } + * ] } For fooservice, this policy enables DATA_READ, DATA_WRITE and + * ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ logging, + * and bar@gmail.com from DATA_WRITE logging. */ - auditLogConfigs: Schema$AuditLogConfig[]; - /** - * Specifies a service that will be enabled for audit logging. For example, - * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a - * special value that covers all services. - */ - service: string; -} -/** - * Provides the configuration for logging a type of permissions. Example: { - * "audit_log_configs": [ { "log_type": - * "DATA_READ", "exempted_members": [ - * "user:foo@gmail.com" ] }, { - * "log_type": "DATA_WRITE", } ] } This - * enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - * foo@gmail.com from DATA_READ logging. - */ -export interface Schema$AuditLogConfig { - /** - * Specifies the identities that do not cause logging for this type of - * permission. Follows the same format of Binding.members. - */ - exemptedMembers: string[]; - /** - * The log type that this config enables. - */ - logType: string; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Response for ListRepos. The size is not set in the returned repositories. - */ -export interface Schema$ListReposResponse { - /** - * If non-empty, additional repositories exist within the project. These can - * be retrieved by including this value in the next ListReposRequest's - * page_token field. - */ - nextPageToken: string; - /** - * The listed repos. - */ - repos: Schema$Repo[]; -} -/** - * Configuration to automatically mirror a repository from another hosting - * service, for example GitHub or Bitbucket. - */ -export interface Schema$MirrorConfig { - /** - * ID of the SSH deploy key at the other hosting service. Removing this key - * from the other service would deauthorize Google Cloud Source Repositories - * from mirroring. - */ - deployKeyId: string; - /** - * URL of the main repository at the other hosting service. - */ - url: string; - /** - * ID of the webhook listening to updates to trigger mirroring. Removing this - * webhook from the other hosting service will stop Google Cloud Source - * Repositories from receiving notifications, and thereby disabling mirroring. - */ - webhookId: string; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Specifies cloud audit logging configuration for this policy. - */ - auditConfigs: Schema$AuditConfig[]; - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; + export interface Schema$AuditConfig { + /** + * The configuration for logging of each type of permission. Next ID: 4 + */ + auditLogConfigs: Schema$AuditLogConfig[]; + /** + * Specifies a service that will be enabled for audit logging. For example, + * `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a + * special value that covers all services. + */ + service: string; + } /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. + * Provides the configuration for logging a type of permissions. Example: { + * "audit_log_configs": [ { "log_type": + * "DATA_READ", "exempted_members": [ + * "user:foo@gmail.com" ] }, { + * "log_type": "DATA_WRITE", } ] } This + * enables 'DATA_READ' and 'DATA_WRITE' logging, while + * exempting foo@gmail.com from DATA_READ logging. */ - etag: string; + export interface Schema$AuditLogConfig { + /** + * Specifies the identities that do not cause logging for this type of + * permission. Follows the same format of Binding.members. + */ + exemptedMembers: string[]; + /** + * The log type that this config enables. + */ + logType: string; + } /** - * Deprecated. + * Associates `members` with a `role`. */ - version: number; -} -/** - * A repository (or repo) is a Git repository storing versioned source content. - */ -export interface Schema$Repo { + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * How this repository mirrors a repository managed by another service. - * Read-only field. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - mirrorConfig: Schema$MirrorConfig; + export interface Schema$Empty {} /** - * Resource name of the repository, of the form - * `projects/<project>/repos/<repo>`. The repo name may contain - * slashes. eg, `projects/myproject/repos/name/with/slash` + * Response for ListRepos. The size is not set in the returned repositories. */ - name: string; + export interface Schema$ListReposResponse { + /** + * If non-empty, additional repositories exist within the project. These can + * be retrieved by including this value in the next ListReposRequest's + * page_token field. + */ + nextPageToken: string; + /** + * The listed repos. + */ + repos: Schema$Repo[]; + } /** - * The disk usage of the repo, in bytes. Read-only field. Size is only - * returned by GetRepo. + * Configuration to automatically mirror a repository from another hosting + * service, for example GitHub or Bitbucket. */ - size: string; + export interface Schema$MirrorConfig { + /** + * ID of the SSH deploy key at the other hosting service. Removing this key + * from the other service would deauthorize Google Cloud Source Repositories + * from mirroring. + */ + deployKeyId: string; + /** + * URL of the main repository at the other hosting service. + */ + url: string; + /** + * ID of the webhook listening to updates to trigger mirroring. Removing + * this webhook from the other hosting service will stop Google Cloud Source + * Repositories from receiving notifications, and thereby disabling + * mirroring. + */ + webhookId: string; + } /** - * URL to clone the repository from Google Cloud Source Repositories. - * Read-only field. + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). */ - url: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { + export interface Schema$Policy { + /** + * Specifies cloud audit logging configuration for this policy. + */ + auditConfigs: Schema$AuditConfig[]; + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; + } /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. + * A repository (or repo) is a Git repository storing versioned source + * content. */ - policy: Schema$Policy; + export interface Schema$Repo { + /** + * How this repository mirrors a repository managed by another service. + * Read-only field. + */ + mirrorConfig: Schema$MirrorConfig; + /** + * Resource name of the repository, of the form + * `projects/<project>/repos/<repo>`. The repo name may contain + * slashes. eg, `projects/myproject/repos/name/with/slash` + */ + name: string; + /** + * The disk usage of the repo, in bytes. Read-only field. Size is only + * returned by GetRepo. + */ + size: string; + /** + * URL to clone the repository from Google Cloud Source Repositories. + * Read-only field. + */ + url: string; + } /** - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: paths: "bindings, etag" This - * field is only used by Cloud IAM. + * Request message for `SetIamPolicy` method. */ - updateMask: string; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; + /** + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. + * Only the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: paths: "bindings, etag" This + * field is only used by Cloud IAM. + */ + updateMask: string; + } /** - * The set of permissions to check for the `resource`. Permissions with - * wildcards (such as '*' or 'storage.*') are not allowed. For - * more information see [IAM - * Overview](https://cloud.google.com/iam/docs/overview#permissions). + * Request message for `TestIamPermissions` method. */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { + export interface Schema$TestIamPermissionsRequest { + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. + * For more information see [IAM + * Overview](https://cloud.google.com/iam/docs/overview#permissions). + */ + permissions: string[]; + } /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. + * Response message for `TestIamPermissions` method. */ - permissions: string[]; -} - -export class Resource$Projects { - root: Sourcerepo; - repos: Resource$Projects$Repos; - constructor(root: Sourcerepo) { - this.root = root; - this.getRoot.bind(this); - this.repos = new Resource$Projects$Repos(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Repos { - root: Sourcerepo; - constructor(root: Sourcerepo) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } + export class Resource$Projects { + root: Sourcerepo; + repos: Resource$Projects$Repos; + constructor(root: Sourcerepo) { + this.root = root; + this.getRoot.bind(this); + this.repos = new Resource$Projects$Repos(root); + } - /** - * sourcerepo.projects.repos.create - * @desc Creates a repo in the given project with the given name. If the - * named repository already exists, `CreateRepo` returns `ALREADY_EXISTS`. - * @alias sourcerepo.projects.repos.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent The project in which to create the repo. Values are of the form `projects/`. - * @param {().Repo} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Repos { + root: Sourcerepo; + constructor(root: Sourcerepo) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+parent}/repos').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * sourcerepo.projects.repos.delete - * @desc Deletes a repo. - * @alias sourcerepo.projects.repos.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the repo to delete. Values are of the form `projects//repos/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.create + * @desc Creates a repo in the given project with the given name. If the + * named repository already exists, `CreateRepo` returns `ALREADY_EXISTS`. + * @alias sourcerepo.projects.repos.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent The project in which to create the repo. Values are of the form `projects/`. + * @param {().Repo} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/repos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sourcerepo.projects.repos.get - * @desc Returns information about a repo. - * @alias sourcerepo.projects.repos.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the requested repository. Values are of the form `projects//repos/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.delete + * @desc Deletes a repo. + * @alias sourcerepo.projects.repos.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the repo to delete. Values are of the form `projects//repos/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sourcerepo.projects.repos.getIamPolicy - * @desc Gets the access control policy for a resource. Returns an empty - * policy if the resource exists and does not have a policy set. - * @alias sourcerepo.projects.repos.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.get + * @desc Returns information about a repo. + * @alias sourcerepo.projects.repos.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the requested repository. Values are of the form `projects//repos/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sourcerepo.projects.repos.list - * @desc Returns all repos belonging to a project. The sizes of the repos are - * not set by ListRepos. To get the size of a repo, use GetRepo. - * @alias sourcerepo.projects.repos.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The project ID whose repos should be listed. Values are of the form `projects/`. - * @param {integer=} params.pageSize Maximum number of repositories to return; between 1 and 500. If not set or zero, defaults to 100 at the server. - * @param {string=} params.pageToken Resume listing repositories where a prior ListReposResponse left off. This is an opaque token that must be obtained from a recent, prior ListReposResponse's next_page_token field. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.getIamPolicy + * @desc Gets the access control policy for a resource. Returns an empty + * policy if the resource exists and does not have a policy set. + * @alias sourcerepo.projects.repos.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}/repos').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sourcerepo.projects.repos.setIamPolicy - * @desc Sets the access control policy on the specified resource. Replaces - * any existing policy. - * @alias sourcerepo.projects.repos.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.list + * @desc Returns all repos belonging to a project. The sizes of the repos + * are not set by ListRepos. To get the size of a repo, use GetRepo. + * @alias sourcerepo.projects.repos.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The project ID whose repos should be listed. Values are of the form `projects/`. + * @param {integer=} params.pageSize Maximum number of repositories to return; between 1 and 500. If not set or zero, defaults to 100 at the server. + * @param {string=} params.pageToken Resume listing repositories where a prior ListReposResponse left off. This is an opaque token that must be obtained from a recent, prior ListReposResponse's next_page_token field. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/{+name}/repos').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * sourcerepo.projects.repos.testIamPermissions - * @desc Returns permissions that a caller has on the specified resource. If - * the resource does not exist, this will return an empty set of permissions, - * not a NOT_FOUND error. - * @alias sourcerepo.projects.repos.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * sourcerepo.projects.repos.setIamPolicy + * @desc Sets the access control policy on the specified resource. Replaces + * any existing policy. + * @alias sourcerepo.projects.repos.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * sourcerepo.projects.repos.testIamPermissions + * @desc Returns permissions that a caller has on the specified resource. If + * the resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * @alias sourcerepo.projects.repos.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://sourcerepo.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/spanner/v1.ts b/src/apis/spanner/v1.ts index dc749588edc..962cda41610 100644 --- a/src/apis/spanner/v1.ts +++ b/src/apis/spanner/v1.ts @@ -27,3999 +27,4062 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Spanner API - * - * Cloud Spanner is a managed, mission-critical, globally consistent and - * scalable relational database service. - * - * @example - * const google = require('googleapis'); - * const spanner = google.spanner('v1'); - * - * @namespace spanner - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Spanner - */ -export class Spanner { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * The request for BeginTransaction. - */ -export interface Schema$BeginTransactionRequest { - /** - * Required. Options for the new transaction. - */ - options: Schema$TransactionOptions; -} -/** - * Associates `members` with a `role`. - */ -export interface Schema$Binding { - /** - * Specifies the identities requesting access for a Cloud Platform resource. - * `members` can have the following values: * `allUsers`: A special - * identifier that represents anyone who is on the internet; with or - * without a Google account. * `allAuthenticatedUsers`: A special identifier - * that represents anyone who is authenticated with a Google account or a - * service account. * `user:{emailid}`: An email address that represents a - * specific Google account. For example, `alice@gmail.com` or - * `joe@example.com`. * `serviceAccount:{emailid}`: An email address that - * represents a service account. For example, - * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email - * address that represents a Google group. For example, - * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that - * represents all the users of that domain. For example, `google.com` or - * `example.com`. - */ - members: string[]; - /** - * Role that is assigned to `members`. For example, `roles/viewer`, - * `roles/editor`, or `roles/owner`. Required - */ - role: string; -} -/** - * Metadata associated with a parent-child relationship appearing in a PlanNode. - */ -export interface Schema$ChildLink { - /** - * The node to which the link points. - */ - childIndex: number; - /** - * The type of the link. For example, in Hash Joins this could be used to - * distinguish between the build child and the probe child, or in the case of - * the child being an output variable, to represent the tag associated with - * the output variable. - */ - type: string; - /** - * Only present if the child node is SCALAR and corresponds to an output - * variable of the parent node. The field carries the name of the output - * variable. For example, a `TableScan` operator that reads rows from a table - * will have child links to the `SCALAR` nodes representing the output - * variables created for each column that is read by the operator. The - * corresponding `variable` fields will be set to the variable names assigned - * to the columns. - */ - variable: string; -} -/** - * The request for Commit. - */ -export interface Schema$CommitRequest { - /** - * The mutations to be executed when this transaction commits. All mutations - * are applied atomically, in the order they appear in this list. - */ - mutations: Schema$Mutation[]; - /** - * Execute mutations in a temporary transaction. Note that unlike commit of a - * previously-started transaction, commit with a temporary transaction is - * non-idempotent. That is, if the `CommitRequest` is sent to Cloud Spanner - * more than once (for instance, due to retries in the application, or in the - * transport library), it is possible that the mutations are executed more - * than once. If this is undesirable, use BeginTransaction and Commit instead. - */ - singleUseTransaction: Schema$TransactionOptions; - /** - * Commit a previously-started transaction. - */ - transactionId: string; -} -/** - * The response for Commit. - */ -export interface Schema$CommitResponse { - /** - * The Cloud Spanner timestamp at which the transaction committed. - */ - commitTimestamp: string; -} -/** - * Metadata type for the operation returned by CreateDatabase. - */ -export interface Schema$CreateDatabaseMetadata { - /** - * The database being created. - */ - database: string; -} -/** - * The request for CreateDatabase. - */ -export interface Schema$CreateDatabaseRequest { - /** - * Required. A `CREATE DATABASE` statement, which specifies the ID of the new - * database. The database ID must conform to the regular expression - * `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the - * database ID is a reserved word or if it contains a hyphen, the database ID - * must be enclosed in backticks (`` ` ``). - */ - createStatement: string; - /** - * An optional list of DDL statements to run inside the newly created - * database. Statements can create tables, indexes, etc. These statements - * execute atomically with the creation of the database: if there is an error - * in any statement, the database is not created. - */ - extraStatements: string[]; -} -/** - * Metadata type for the operation returned by CreateInstance. - */ -export interface Schema$CreateInstanceMetadata { - /** - * The time at which this operation was cancelled. If set, this operation is - * in the process of undoing itself (which is guaranteed to succeed) and - * cannot be cancelled again. - */ - cancelTime: string; - /** - * The time at which this operation failed or was completed successfully. - */ - endTime: string; - /** - * The instance being created. - */ - instance: Schema$Instance; - /** - * The time at which the CreateInstance request was received. - */ - startTime: string; -} -/** - * The request for CreateInstance. - */ -export interface Schema$CreateInstanceRequest { - /** - * Required. The instance to create. The name may be omitted, but if - * specified must be `<parent>/instances/<instance_id>`. - */ - instance: Schema$Instance; - /** - * Required. The ID of the instance to create. Valid identifiers are of the - * form `a-z*[a-z0-9]` and must be between 6 and 30 characters in length. - */ - instanceId: string; -} -/** - * The request for CreateSession. - */ -export interface Schema$CreateSessionRequest { - /** - * The session to create. - */ - session: Schema$Session; -} -/** - * A Cloud Spanner database. - */ -export interface Schema$Database { - /** - * Required. The name of the database. Values are of the form - * `projects/<project>/instances/<instance>/databases/<database>`, - * where `<database>` is as specified in the `CREATE DATABASE` - * statement. This name can be passed to other API methods to identify the - * database. - */ - name: string; - /** - * Output only. The current database state. - */ - state: string; -} -/** - * Arguments to delete operations. - */ -export interface Schema$Delete { - /** - * Required. The primary keys of the rows within table to delete. Delete is - * idempotent. The transaction will succeed even if some or all rows do not - * exist. - */ - keySet: Schema$KeySet; - /** - * Required. The table whose rows will be deleted. - */ - table: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * The request for ExecuteSql and ExecuteStreamingSql. - */ -export interface Schema$ExecuteSqlRequest { - /** - * The SQL string can contain parameter placeholders. A parameter placeholder - * consists of `'@'` followed by the parameter name. Parameter names - * consist of any combination of letters, numbers, and underscores. Parameters - * can appear anywhere that a literal value is expected. The same parameter - * name can be used more than once, for example: `"WHERE id > - * @msg_id AND id < @msg_id + 100"` It is an error to execute an SQL - * statement with unbound parameters. Parameter values are specified using - * `params`, which is a JSON object whose keys are parameter names, and whose - * values are the corresponding parameter values. - */ - params: any; - /** - * It is not always possible for Cloud Spanner to infer the right SQL type - * from a JSON value. For example, values of type `BYTES` and values of type - * `STRING` both appear in params as JSON strings. In these cases, - * `param_types` can be used to specify the exact SQL type for some or all of - * the SQL statement parameters. See the definition of Type for more - * information about SQL types. - */ - paramTypes: any; - /** - * If present, results will be restricted to the specified partition - * previously created using PartitionQuery(). There must be an exact match - * for the values of fields common to this message and the - * PartitionQueryRequest message used to create this partition_token. - */ - partitionToken: string; - /** - * Used to control the amount of debugging information returned in - * ResultSetStats. If partition_token is set, query_mode can only be set to - * QueryMode.NORMAL. - */ - queryMode: string; - /** - * If this request is resuming a previously interrupted SQL statement - * execution, `resume_token` should be copied from the last PartialResultSet - * yielded before the interruption. Doing this enables the new SQL statement - * execution to resume where the last one left off. The rest of the request - * parameters must exactly match the request that yielded this token. - */ - resumeToken: string; - /** - * Required. The SQL string. - */ - sql: string; - /** - * The transaction to use. If none is provided, the default is a temporary - * read-only transaction with strong concurrency. - */ - transaction: Schema$TransactionSelector; -} -/** - * Message representing a single field of a struct. - */ -export interface Schema$Field { - /** - * The name of the field. For reads, this is the column name. For SQL queries, - * it is the column alias (e.g., `"Word"` in the query `"SELECT - * 'hello' AS Word"`), or the column name (e.g., - * `"ColName"` in the query `"SELECT ColName FROM - * Table"`). Some columns might have an empty name (e.g., !"SELECT - * UPPER(ColName)"`). Note that a query result can contain multiple - * fields with the same name. - */ - name: string; - /** - * The type of the field. - */ - type: Schema$Type; -} -/** - * The response for GetDatabaseDdl. - */ -export interface Schema$GetDatabaseDdlResponse { - /** - * A list of formatted DDL statements defining the schema of the database - * specified in the request. - */ - statements: string[]; -} -/** - * Request message for `GetIamPolicy` method. - */ -export interface Schema$GetIamPolicyRequest {} -/** - * An isolated set of Cloud Spanner resources on which databases can be hosted. - */ -export interface Schema$Instance { - /** - * Required. The name of the instance's configuration. Values are of the - * form `projects/<project>/instanceConfigs/<configuration>`. See - * also InstanceConfig and ListInstanceConfigs. - */ - config: string; - /** - * Required. The descriptive name for this instance as it appears in UIs. Must - * be unique per project and between 4 and 30 characters in length. - */ - displayName: string; - /** - * Cloud Labels are a flexible and lightweight mechanism for organizing cloud - * resources into groups that reflect a customer's organizational needs - * and deployment strategies. Cloud Labels can be used to filter collections - * of resources. They can be used to control how resource metrics are - * aggregated. And they can be used as arguments to policy management rules - * (e.g. route, firewall, load balancing, etc.). * Label keys must be - * between 1 and 63 characters long and must conform to the following - * regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. * Label values must be - * between 0 and 63 characters long and must conform to the regular - * expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. * No more than 64 labels can - * be associated with a given resource. See https://goo.gl/xmQnxf for more - * information on and examples of labels. If you plan to use labels in your - * own code, please note that additional characters may be allowed in the - * future. And so you are advised to use an internal label representation, - * such as JSON, which doesn't rely upon specific characters being - * disallowed. For example, representing labels as the string: name + - * "_" + value would prove problematic if we were to allow - * "_" in a future release. - */ - labels: any; - /** - * Required. A unique identifier for the instance, which cannot be changed - * after the instance is created. Values are of the form - * `projects/<project>/instances/a-z*[a-z0-9]`. The final segment of the - * name must be between 6 and 30 characters in length. - */ - name: string; - /** - * Required. The number of nodes allocated to this instance. This may be zero - * in API responses for instances that are not yet in state `READY`. See [the - * documentation](https://cloud.google.com/spanner/docs/instances#node_count) - * for more information about nodes. - */ - nodeCount: number; - /** - * Output only. The current instance state. For CreateInstance, the state must - * be either omitted or set to `CREATING`. For UpdateInstance, the state must - * be either omitted or set to `READY`. - */ - state: string; -} -/** - * A possible configuration for a Cloud Spanner instance. Configurations define - * the geographic placement of nodes and their replication. - */ -export interface Schema$InstanceConfig { - /** - * The name of this instance configuration as it appears in UIs. - */ - displayName: string; - /** - * A unique identifier for the instance configuration. Values are of the form - * `projects/<project>/instanceConfigs/a-z*` - */ - name: string; -} -/** - * KeyRange represents a range of rows in a table or index. A range has a start - * key and an end key. These keys can be open or closed, indicating if the range - * includes rows with that key. Keys are represented by lists, where the ith - * value in the list corresponds to the ith component of the table or index - * primary key. Individual values are encoded as described here. For example, - * consider the following table definition: CREATE TABLE UserEvents ( - * UserName STRING(MAX), EventDate STRING(10) ) PRIMARY KEY(UserName, - * EventDate); The following keys name rows in this table: "Bob", - * "2014-09-23" Since the `UserEvents` table's `PRIMARY KEY` - * clause names two columns, each `UserEvents` key has two elements; the first - * is the `UserName`, and the second is the `EventDate`. Key ranges with - * multiple components are interpreted lexicographically by component using the - * table or index key's declared sort order. For example, the following - * range returns all events for user `"Bob"` that occurred in the year - * 2015: "start_closed": ["Bob", - * "2015-01-01"] "end_closed": ["Bob", - * "2015-12-31"] Start and end keys can omit trailing key components. - * This affects the inclusion and exclusion of rows that exactly match the - * provided key components: if the key is closed, then rows that exactly match - * the provided components are included; if the key is open, then rows that - * exactly match are not included. For example, the following range includes - * all events for `"Bob"` that occurred during and after the year - * 2000: "start_closed": ["Bob", - * "2000-01-01"] "end_closed": ["Bob"] The - * next example retrieves all events for `"Bob"`: - * "start_closed": ["Bob"] "end_closed": - * ["Bob"] To retrieve events before the year 2000: - * "start_closed": ["Bob"] "end_open": - * ["Bob", "2000-01-01"] The following range includes all - * rows in the table: "start_closed": [] "end_closed": - * [] This range returns all users whose `UserName` begins with any character - * from A to C: "start_closed": ["A"] - * "end_open": ["D"] This range returns all users whose - * `UserName` begins with B: "start_closed": ["B"] - * "end_open": ["C"] Key ranges honor column sort order. - * For example, suppose a table is defined as follows: CREATE TABLE - * DescendingSortedTable { Key INT64, ... ) PRIMARY KEY(Key - * DESC); The following range retrieves all rows with key values between 1 and - * 100 inclusive: "start_closed": ["100"] - * "end_closed": ["1"] Note that 100 is passed as the - * start, and 1 is passed as the end, because `Key` is a descending column in - * the schema. - */ -export interface Schema$KeyRange { - /** - * If the end is closed, then the range includes all rows whose first - * `len(end_closed)` key columns exactly match `end_closed`. - */ - endClosed: any[]; - /** - * If the end is open, then the range excludes rows whose first - * `len(end_open)` key columns exactly match `end_open`. - */ - endOpen: any[]; - /** - * If the start is closed, then the range includes all rows whose first - * `len(start_closed)` key columns exactly match `start_closed`. - */ - startClosed: any[]; - /** - * If the start is open, then the range excludes rows whose first - * `len(start_open)` key columns exactly match `start_open`. - */ - startOpen: any[]; -} -/** - * `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All - * the keys are expected to be in the same table or index. The keys need not be - * sorted in any particular way. If the same key is specified multiple times in - * the set (for example if two ranges, two keys, or a key and a range overlap), - * Cloud Spanner behaves as if the key were only specified once. - */ -export interface Schema$KeySet { - /** - * For convenience `all` can be set to `true` to indicate that this `KeySet` - * matches all keys in the table or index. Note that any keys specified in - * `keys` or `ranges` are only yielded once. - */ - all: boolean; - /** - * A list of specific keys. Entries in `keys` should have exactly as many - * elements as there are columns in the primary or index key with which this - * `KeySet` is used. Individual key values are encoded as described here. - */ - keys: any[][]; - /** - * A list of key ranges. See KeyRange for more information about key range - * specifications. - */ - ranges: Schema$KeyRange[]; -} -/** - * The response for ListDatabases. - */ -export interface Schema$ListDatabasesResponse { - /** - * Databases that matched the request. - */ - databases: Schema$Database[]; - /** - * `next_page_token` can be sent in a subsequent ListDatabases call to fetch - * more of the matching databases. - */ - nextPageToken: string; -} -/** - * The response for ListInstanceConfigs. - */ -export interface Schema$ListInstanceConfigsResponse { - /** - * The list of requested instance configurations. - */ - instanceConfigs: Schema$InstanceConfig[]; - /** - * `next_page_token` can be sent in a subsequent ListInstanceConfigs call to - * fetch more of the matching instance configurations. - */ - nextPageToken: string; -} -/** - * The response for ListInstances. - */ -export interface Schema$ListInstancesResponse { - /** - * The list of requested instances. - */ - instances: Schema$Instance[]; - /** - * `next_page_token` can be sent in a subsequent ListInstances call to fetch - * more of the matching instances. - */ - nextPageToken: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * The response for ListSessions. - */ -export interface Schema$ListSessionsResponse { - /** - * `next_page_token` can be sent in a subsequent ListSessions call to fetch - * more of the matching sessions. - */ - nextPageToken: string; - /** - * The list of requested sessions. - */ - sessions: Schema$Session[]; -} -/** - * A modification to one or more Cloud Spanner rows. Mutations can be applied - * to a Cloud Spanner database by sending them in a Commit call. - */ -export interface Schema$Mutation { - /** - * Delete rows from a table. Succeeds whether or not the named rows were - * present. - */ - delete: Schema$Delete; - /** - * Insert new rows in a table. If any of the rows already exist, the write or - * transaction fails with error `ALREADY_EXISTS`. - */ - insert: Schema$Write; - /** - * Like insert, except that if the row already exists, then its column values - * are overwritten with the ones provided. Any column values not explicitly - * written are preserved. - */ - insertOrUpdate: Schema$Write; - /** - * Like insert, except that if the row already exists, it is deleted, and the - * column values provided are inserted instead. Unlike insert_or_update, this - * means any values not explicitly written become `NULL`. - */ - replace: Schema$Write; - /** - * Update existing rows in a table. If any of the rows does not already exist, - * the transaction fails with error `NOT_FOUND`. - */ - update: Schema$Write; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Partial results from a streaming read or SQL query. Streaming reads and SQL - * queries better tolerate large result sets, large rows, and large values, but - * are a little trickier to consume. - */ -export interface Schema$PartialResultSet { - /** - * If true, then the final value in values is chunked, and must be combined - * with more values from subsequent `PartialResultSet`s to obtain a complete - * field value. - */ - chunkedValue: boolean; - /** - * Metadata about the result set, such as row type information. Only present - * in the first response. - */ - metadata: Schema$ResultSetMetadata; - /** - * Streaming calls might be interrupted for a variety of reasons, such as TCP - * connection loss. If this occurs, the stream of results can be resumed by - * re-sending the original request and including `resume_token`. Note that - * executing any other transaction in the same session invalidates the token. - */ - resumeToken: string; - /** - * Query plan and execution statistics for the statement that produced this - * streaming result set. These can be requested by setting - * ExecuteSqlRequest.query_mode and are sent only once with the last response - * in the stream. - */ - stats: Schema$ResultSetStats; - /** - * A streamed result set consists of a stream of values, which might be split - * into many `PartialResultSet` messages to accommodate large rows and/or - * large values. Every N complete values defines a row, where N is equal to - * the number of entries in metadata.row_type.fields. Most values are encoded - * based on type as described here. It is possible that the last value in - * values is "chunked", meaning that the rest of the value is sent - * in subsequent `PartialResultSet`(s). This is denoted by the chunked_value - * field. Two or more chunked values can be merged to form a complete value as - * follows: * `bool/number/null`: cannot be chunked * `string`: - * concatenate the strings * `list`: concatenate the lists. If the last - * element in a list is a `string`, `list`, or `object`, merge it with the - * first element in the next list by applying these rules recursively. * - * `object`: concatenate the (field name, field value) pairs. If a field - * name is duplicated, then apply these rules recursively to merge the - * field values. Some examples of merging: # Strings are concatenated. - * "foo", "bar" => "foobar" # Lists of - * non-strings are concatenated. [2, 3], [4] => [2, 3, 4] # Lists - * are concatenated, but the last and first elements are merged # because - * they are strings. ["a", "b"], ["c", - * "d"] => ["a", "bc", "d"] # - * Lists are concatenated, but the last and first elements are merged # - * because they are lists. Recursively, the last and first elements # of - * the inner lists are merged because they are strings. ["a", - * ["b", "c"]], [["d"], "e"] => - * ["a", ["b", "cd"], "e"] # - * Non-overlapping object fields are combined. {"a": - * "1"}, {"b": "2"} => {"a": - * "1", "b": 2"} # Overlapping object fields are - * merged. {"a": "1"}, {"a": "2"} - * => {"a": "12"} # Examples of merging objects - * containing lists of strings. {"a": ["1"]}, - * {"a": ["2"]} => {"a": ["12"]} - * For a more complete example, suppose a streaming SQL query is yielding a - * result set whose rows contain a single string field. The following - * `PartialResultSet`s might be yielded: { "metadata": { - * ... } "values": ["Hello", "W"] - * "chunked_value": true "resume_token": - * "Af65..." } { "values": ["orl"] - * "chunked_value": true "resume_token": - * "Bqp2..." } { "values": ["d"] - * "resume_token": "Zx1B..." } This sequence of - * `PartialResultSet`s encodes two rows, one containing the field value - * `"Hello"`, and a second containing the field value - * `"World" = "W" + "orl" + "d"`. - */ - values: any[]; -} -/** - * Information returned for each partition returned in a PartitionResponse. - */ -export interface Schema$Partition { - /** - * This token can be passed to Read, StreamingRead, ExecuteSql, or - * ExecuteStreamingSql requests to restrict the results to those identified by - * this partition token. - */ - partitionToken: string; -} -/** - * Options for a PartitionQueryRequest and PartitionReadRequest. - */ -export interface Schema$PartitionOptions { - /** - * **Note:** This hint is currently ignored by PartitionQuery and - * PartitionRead requests. The desired maximum number of partitions to - * return. For example, this may be set to the number of workers available. - * The default for this option is currently 10,000. The maximum value is - * currently 200,000. This is only a hint. The actual number of partitions - * returned may be smaller or larger than this maximum count request. - */ - maxPartitions: string; - /** - * **Note:** This hint is currently ignored by PartitionQuery and - * PartitionRead requests. The desired data size for each partition - * generated. The default for this option is currently 1 GiB. This is only a - * hint. The actual size of each partition may be smaller or larger than this - * size request. - */ - partitionSizeBytes: string; -} -/** - * The request for PartitionQuery - */ -export interface Schema$PartitionQueryRequest { - /** - * The SQL query string can contain parameter placeholders. A parameter - * placeholder consists of `'@'` followed by the parameter name. - * Parameter names consist of any combination of letters, numbers, and - * underscores. Parameters can appear anywhere that a literal value is - * expected. The same parameter name can be used more than once, for example: - * `"WHERE id > @msg_id AND id < @msg_id + 100"` It is an - * error to execute an SQL query with unbound parameters. Parameter values - * are specified using `params`, which is a JSON object whose keys are - * parameter names, and whose values are the corresponding parameter values. - */ - params: any; - /** - * It is not always possible for Cloud Spanner to infer the right SQL type - * from a JSON value. For example, values of type `BYTES` and values of type - * `STRING` both appear in params as JSON strings. In these cases, - * `param_types` can be used to specify the exact SQL type for some or all of - * the SQL query parameters. See the definition of Type for more information - * about SQL types. - */ - paramTypes: any; - /** - * Additional options that affect how many partitions are created. - */ - partitionOptions: Schema$PartitionOptions; - /** - * The query request to generate partitions for. The request will fail if the - * query is not root partitionable. The query plan of a root partitionable - * query has a single distributed union operator. A distributed union operator - * conceptually divides one or more tables into multiple splits, remotely - * evaluates a subquery independently on each split, and then unions all - * results. - */ - sql: string; - /** - * Read only snapshot transactions are supported, read/write and single use - * transactions are not. - */ - transaction: Schema$TransactionSelector; -} -/** - * The request for PartitionRead - */ -export interface Schema$PartitionReadRequest { - /** - * The columns of table to be returned for each row matching this request. - */ - columns: string[]; - /** - * If non-empty, the name of an index on table. This index is used instead of - * the table primary key when interpreting key_set and sorting result rows. - * See key_set for further information. - */ - index: string; - /** - * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in table to be yielded, unless index is present. - * If index is present, then key_set instead names index keys in index. It is - * not an error for the `key_set` to name rows that do not exist in the - * database. Read yields nothing for nonexistent rows. - */ - keySet: Schema$KeySet; - /** - * Additional options that affect how many partitions are created. - */ - partitionOptions: Schema$PartitionOptions; - /** - * Required. The name of the table in the database to be read. - */ - table: string; - /** - * Read only snapshot transactions are supported, read/write and single use - * transactions are not. - */ - transaction: Schema$TransactionSelector; -} -/** - * The response for PartitionQuery or PartitionRead - */ -export interface Schema$PartitionResponse { - /** - * Partitions created by this request. - */ - partitions: Schema$Partition[]; - /** - * Transaction created by this request. - */ - transaction: Schema$Transaction; -} -/** - * Node information for nodes appearing in a QueryPlan.plan_nodes. - */ -export interface Schema$PlanNode { - /** - * List of child node `index`es and their relationship to this parent. - */ - childLinks: Schema$ChildLink[]; - /** - * The display name for the node. - */ - displayName: string; - /** - * The execution statistics associated with the node, contained in a group of - * key-value pairs. Only present if the plan was returned as a result of a - * profile query. For example, number of executions, number of rows/time per - * execution etc. - */ - executionStats: any; - /** - * The `PlanNode`'s index in node list. - */ - index: number; - /** - * Used to determine the type of node. May be needed for visualizing different - * kinds of nodes differently. For example, If the node is a SCALAR node, it - * will have a condensed representation which can be used to directly embed a - * description of the node in its parent. - */ - kind: string; - /** - * Attributes relevant to the node contained in a group of key-value pairs. - * For example, a Parameter Reference node could have the following - * information in its metadata: { "parameter_reference": - * "param1", "parameter_type": "array" } - */ - metadata: any; - /** - * Condensed representation for SCALAR nodes. - */ - shortRepresentation: Schema$ShortRepresentation; -} -/** - * Defines an Identity and Access Management (IAM) policy. It is used to specify - * access control policies for Cloud Platform resources. A `Policy` consists - * of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, - * where the members can be user accounts, Google groups, Google domains, and - * service accounts. A `role` is a named list of permissions defined by IAM. - * **Example** { "bindings": [ { "role": - * "roles/owner", "members": [ - * "user:mike@example.com", "group:admins@example.com", - * "domain:google.com", - * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, { - * "role": "roles/viewer", "members": - * ["user:sean@example.com"] } ] } For a - * description of IAM and its features, see the [IAM developer's - * guide](https://cloud.google.com/iam/docs). - */ -export interface Schema$Policy { - /** - * Associates a list of `members` to a `role`. `bindings` with no members will - * result in an error. - */ - bindings: Schema$Binding[]; - /** - * `etag` is used for optimistic concurrency control as a way to help prevent - * simultaneous updates of a policy from overwriting each other. It is - * strongly suggested that systems make use of the `etag` in the - * read-modify-write cycle to perform policy updates in order to avoid race - * conditions: An `etag` is returned in the response to `getIamPolicy`, and - * systems are expected to put that etag in the request to `setIamPolicy` to - * ensure that their change will be applied to the same version of the policy. - * If no `etag` is provided in the call to `setIamPolicy`, then the existing - * policy is overwritten blindly. - */ - etag: string; - /** - * Deprecated. - */ - version: number; -} -/** - * Contains an ordered list of nodes appearing in the query plan. - */ -export interface Schema$QueryPlan { - /** - * The nodes in the query plan. Plan nodes are returned in pre-order starting - * with the plan root. Each PlanNode's `id` corresponds to its index in - * `plan_nodes`. - */ - planNodes: Schema$PlanNode[]; -} -/** - * Message type to initiate a read-only transaction. - */ -export interface Schema$ReadOnly { - /** - * Executes all reads at a timestamp that is `exact_staleness` old. The - * timestamp is chosen soon after the read is started. Guarantees that all - * writes that have committed more than the specified number of seconds ago - * are visible. Because Cloud Spanner chooses the exact timestamp, this mode - * works even if the client's local clock is substantially skewed from - * Cloud Spanner commit timestamps. Useful for reading at nearby replicas - * without the distributed timestamp negotiation overhead of `max_staleness`. - */ - exactStaleness: string; - /** - * Read data at a timestamp >= `NOW - max_staleness` seconds. Guarantees - * that all writes that have committed more than the specified number of - * seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, - * this mode works even if the client's local clock is substantially - * skewed from Cloud Spanner commit timestamps. Useful for reading the - * freshest data available at a nearby replica, while bounding the possible - * staleness if the local replica has fallen behind. Note that this option - * can only be used in single-use transactions. - */ - maxStaleness: string; - /** - * Executes all reads at a timestamp >= `min_read_timestamp`. This is - * useful for requesting fresher data than some previous read, or data that is - * fresh enough to observe the effects of some previously committed - * transaction whose timestamp is known. Note that this option can only be - * used in single-use transactions. A timestamp in RFC3339 UTC - * \"Zulu\" format, accurate to nanoseconds. Example: - * `"2014-10-02T15:01:23.045123456Z"`. - */ - minReadTimestamp: string; - /** - * Executes all reads at the given timestamp. Unlike other modes, reads at a - * specific timestamp are repeatable; the same read at the same timestamp - * always returns the same data. If the timestamp is in the future, the read - * will block until the specified timestamp, modulo the read's deadline. - * Useful for large scale consistent reads such as mapreduces, or for - * coordinating many reads against a consistent snapshot of the data. A - * timestamp in RFC3339 UTC \"Zulu\" format, accurate to - * nanoseconds. Example: `"2014-10-02T15:01:23.045123456Z"`. - */ - readTimestamp: string; - /** - * If true, the Cloud Spanner-selected read timestamp is included in the - * Transaction message that describes the transaction. - */ - returnReadTimestamp: boolean; - /** - * Read at a timestamp where all previously committed transactions are - * visible. - */ - strong: boolean; -} -/** - * The request for Read and StreamingRead. - */ -export interface Schema$ReadRequest { - /** - * The columns of table to be returned for each row matching this request. - */ - columns: string[]; - /** - * If non-empty, the name of an index on table. This index is used instead of - * the table primary key when interpreting key_set and sorting result rows. - * See key_set for further information. - */ - index: string; - /** - * Required. `key_set` identifies the rows to be yielded. `key_set` names the - * primary keys of the rows in table to be yielded, unless index is present. - * If index is present, then key_set instead names index keys in index. If - * the partition_token field is empty, rows are yielded in table primary key - * order (if index is empty) or index key order (if index is non-empty). If - * the partition_token field is not empty, rows will be yielded in an - * unspecified order. It is not an error for the `key_set` to name rows that - * do not exist in the database. Read yields nothing for nonexistent rows. - */ - keySet: Schema$KeySet; - /** - * If greater than zero, only the first `limit` rows are yielded. If `limit` - * is zero, the default is no limit. A limit cannot be specified if - * `partition_token` is set. - */ - limit: string; - /** - * If present, results will be restricted to the specified partition - * previously created using PartitionRead(). There must be an exact match - * for the values of fields common to this message and the - * PartitionReadRequest message used to create this partition_token. - */ - partitionToken: string; - /** - * If this request is resuming a previously interrupted read, `resume_token` - * should be copied from the last PartialResultSet yielded before the - * interruption. Doing this enables the new read to resume where the last read - * left off. The rest of the request parameters must exactly match the request - * that yielded this token. - */ - resumeToken: string; - /** - * Required. The name of the table in the database to be read. - */ - table: string; - /** - * The transaction to use. If none is provided, the default is a temporary - * read-only transaction with strong concurrency. - */ - transaction: Schema$TransactionSelector; -} -/** - * Message type to initiate a read-write transaction. Currently this transaction - * type has no options. - */ -export interface Schema$ReadWrite {} -/** - * Results from Read or ExecuteSql. - */ -export interface Schema$ResultSet { - /** - * Metadata about the result set, such as row type information. - */ - metadata: Schema$ResultSetMetadata; - /** - * Each element in `rows` is a row whose format is defined by - * metadata.row_type. The ith element in each row matches the ith field in - * metadata.row_type. Elements are encoded based on type as described here. - */ - rows: any[][]; - /** - * Query plan and execution statistics for the SQL statement that produced - * this result set. These can be requested by setting - * ExecuteSqlRequest.query_mode. - */ - stats: Schema$ResultSetStats; -} -/** - * Metadata about a ResultSet or PartialResultSet. - */ -export interface Schema$ResultSetMetadata { - /** - * Indicates the field names and types for the rows in the result set. For - * example, a SQL query like `"SELECT UserId, UserName FROM Users"` - * could return a `row_type` value like: "fields": [ { - * "name": "UserId", "type": { "code": - * "INT64" } }, { "name": "UserName", - * "type": { "code": "STRING" } }, ] - */ - rowType: Schema$StructType; - /** - * If the read or SQL query began a transaction as a side-effect, the - * information about the new transaction is yielded here. - */ - transaction: Schema$Transaction; -} -/** - * Additional statistics about a ResultSet or PartialResultSet. - */ -export interface Schema$ResultSetStats { - /** - * QueryPlan for the query associated with this result. - */ - queryPlan: Schema$QueryPlan; - /** - * Aggregated statistics from the execution of the query. Only present when - * the query is profiled. For example, a query could return the statistics as - * follows: { "rows_returned": "3", - * "elapsed_time": "1.22 secs", "cpu_time": - * "1.19 secs" } - */ - queryStats: any; -} -/** - * The request for Rollback. - */ -export interface Schema$RollbackRequest { - /** - * Required. The transaction to roll back. - */ - transactionId: string; -} -/** - * A session in the Cloud Spanner API. - */ -export interface Schema$Session { - /** - * Output only. The approximate timestamp when the session is last used. It is - * typically earlier than the actual last use time. - */ - approximateLastUseTime: string; - /** - * Output only. The timestamp when the session is created. - */ - createTime: string; - /** - * The labels for the session. * Label keys must be between 1 and 63 - * characters long and must conform to the following regular expression: - * `[a-z]([-a-z0-9]*[a-z0-9])?`. * Label values must be between 0 and 63 - * characters long and must conform to the regular expression - * `([a-z]([-a-z0-9]*[a-z0-9])?)?`. * No more than 64 labels can be - * associated with a given session. See https://goo.gl/xmQnxf for more - * information on and examples of labels. - */ - labels: any; - /** - * The name of the session. This is always system-assigned; values provided - * when creating a session are ignored. - */ - name: string; -} -/** - * Request message for `SetIamPolicy` method. - */ -export interface Schema$SetIamPolicyRequest { - /** - * REQUIRED: The complete policy to be applied to the `resource`. The size of - * the policy is limited to a few 10s of KB. An empty policy is a valid policy - * but certain Cloud Platform services (such as Projects) might reject them. - */ - policy: Schema$Policy; -} -/** - * Condensed representation of a node and its subtree. Only present for `SCALAR` - * PlanNode(s). - */ -export interface Schema$ShortRepresentation { - /** - * A string representation of the expression subtree rooted at this node. - */ - description: string; - /** - * A mapping of (subquery variable name) -> (subquery node id) for cases - * where the `description` string of this node references a `SCALAR` subquery - * contained in the expression subtree rooted at this node. The referenced - * `SCALAR` subquery may not necessarily be a direct child of this node. - */ - subqueries: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * `StructType` defines the fields of a STRUCT type. - */ -export interface Schema$StructType { - /** - * The list of fields that make up this struct. Order is significant, because - * values of this struct type are represented as lists, where the order of - * field values matches the order of fields in the StructType. In turn, the - * order of fields matches the order of columns in a read request, or the - * order of fields in the `SELECT` clause of a query. - */ - fields: Schema$Field[]; -} -/** - * Request message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsRequest { - /** - * REQUIRED: The set of permissions to check for 'resource'. - * Permissions with wildcards (such as '*', 'spanner.*', - * 'spanner.instances.*') are not allowed. - */ - permissions: string[]; -} -/** - * Response message for `TestIamPermissions` method. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * A subset of `TestPermissionsRequest.permissions` that the caller is - * allowed. - */ - permissions: string[]; -} -/** - * A transaction. - */ -export interface Schema$Transaction { - /** - * `id` may be used to identify the transaction in subsequent Read, - * ExecuteSql, Commit, or Rollback calls. Single-use read-only transactions - * do not have IDs, because single-use transactions do not support multiple - * requests. - */ - id: string; - /** - * For snapshot read-only transactions, the read timestamp chosen for the - * transaction. Not returned by default: see - * TransactionOptions.ReadOnly.return_read_timestamp. A timestamp in RFC3339 - * UTC \"Zulu\" format, accurate to nanoseconds. Example: - * `"2014-10-02T15:01:23.045123456Z"`. - */ - readTimestamp: string; -} -/** - * # Transactions Each session can have at most one active transaction at a - * time. After the active transaction is completed, the session can immediately - * be re-used for the next transaction. It is not necessary to create a new - * session for each transaction. # Transaction Modes Cloud Spanner supports - * two transaction modes: 1. Locking read-write. This type of transaction is - * the only way to write data into Cloud Spanner. These transactions rely - * on pessimistic locking and, if necessary, two-phase commit. Locking - * read-write transactions may abort, requiring the application to retry. - * 2. Snapshot read-only. This transaction type provides guaranteed consistency - * across several reads, but does not allow writes. Snapshot read-only - * transactions can be configured to read at timestamps in the past. - * Snapshot read-only transactions do not need to be committed. For - * transactions that only read, snapshot read-only transactions provide simpler - * semantics and are almost always faster. In particular, read-only transactions - * do not take locks, so they do not conflict with read-write transactions. As a - * consequence of not taking locks, they also do not abort, so retry loops are - * not needed. Transactions may only read/write data in a single database. They - * may, however, read/write data in different tables within that database. ## - * Locking Read-Write Transactions Locking transactions may be used to - * atomically read-modify-write data anywhere in a database. This type of - * transaction is externally consistent. Clients should attempt to minimize the - * amount of time a transaction is active. Faster transactions commit with - * higher probability and cause less contention. Cloud Spanner attempts to keep - * read locks active as long as the transaction continues to do reads, and the - * transaction has not been terminated by Commit or Rollback. Long periods of - * inactivity at the client may cause Cloud Spanner to release a - * transaction's locks and abort it. Reads performed within a transaction - * acquire locks on the data being read. Writes can only be done at commit time, - * after all reads have been completed. Conceptually, a read-write transaction - * consists of zero or more reads or SQL queries followed by Commit. At any time - * before Commit, the client can send a Rollback request to abort the - * transaction. ### Semantics Cloud Spanner can commit the transaction if all - * read locks it acquired are still valid at commit time, and it is able to - * acquire write locks for all writes. Cloud Spanner can abort the transaction - * for any reason. If a commit attempt returns `ABORTED`, Cloud Spanner - * guarantees that the transaction has not modified any user data in Cloud - * Spanner. Unless the transaction commits, Cloud Spanner makes no guarantees - * about how long the transaction's locks were held for. It is an error to - * use Cloud Spanner locks for any sort of mutual exclusion other than between - * Cloud Spanner transactions themselves. ### Retrying Aborted Transactions - * When a transaction aborts, the application can choose to retry the whole - * transaction again. To maximize the chances of successfully committing the - * retry, the client should execute the retry in the same session as the - * original attempt. The original session's lock priority increases with - * each consecutive abort, meaning that each attempt has a slightly better - * chance of success than the previous. Under some circumstances (e.g., many - * transactions attempting to modify the same row(s)), a transaction can abort - * many times in a short period before successfully committing. Thus, it is not - * a good idea to cap the number of retries a transaction can attempt; instead, - * it is better to limit the total amount of wall time spent retrying. ### Idle - * Transactions A transaction is considered idle if it has no outstanding reads - * or SQL queries and has not started a read or SQL query within the last 10 - * seconds. Idle transactions can be aborted by Cloud Spanner so that they - * don't hold on to locks indefinitely. In that case, the commit will fail - * with error `ABORTED`. If this behavior is undesirable, periodically - * executing a simple SQL query in the transaction (e.g., `SELECT 1`) prevents - * the transaction from becoming idle. ## Snapshot Read-Only Transactions - * Snapshot read-only transactions provides a simpler method than locking - * read-write transactions for doing several consistent reads. However, this - * type of transaction does not support writes. Snapshot transactions do not - * take locks. Instead, they work by choosing a Cloud Spanner timestamp, then - * executing all reads at that timestamp. Since they do not acquire locks, they - * do not block concurrent read-write transactions. Unlike locking read-write - * transactions, snapshot read-only transactions never abort. They can fail if - * the chosen read timestamp is garbage collected; however, the default garbage - * collection policy is generous enough that most applications do not need to - * worry about this in practice. Snapshot read-only transactions do not need to - * call Commit or Rollback (and in fact are not permitted to do so). To execute - * a snapshot transaction, the client specifies a timestamp bound, which tells - * Cloud Spanner how to choose a read timestamp. The types of timestamp bound - * are: - Strong (the default). - Bounded staleness. - Exact staleness. - * If the Cloud Spanner database to be read is geographically distributed, stale - * read-only transactions can execute more quickly than strong or read-write - * transaction, because they are able to execute far from the leader replica. - * Each type of timestamp bound is discussed in detail below. ### Strong Strong - * reads are guaranteed to see the effects of all transactions that have - * committed before the start of the read. Furthermore, all rows yielded by a - * single read are consistent with each other -- if any part of the read - * observes a transaction, all parts of the read see the transaction. Strong - * reads are not repeatable: two consecutive strong read-only transactions might - * return inconsistent results if there are concurrent writes. If consistency - * across reads is required, the reads should be executed within a transaction - * or at an exact read timestamp. See TransactionOptions.ReadOnly.strong. ### - * Exact Staleness These timestamp bounds execute reads at a user-specified - * timestamp. Reads at a timestamp are guaranteed to see a consistent prefix of - * the global transaction history: they observe modifications done by all - * transactions with a commit timestamp <= the read timestamp, and observe - * none of the modifications done by transactions with a larger commit - * timestamp. They will block until all conflicting transactions that may be - * assigned commit timestamps <= the read timestamp have finished. The - * timestamp can either be expressed as an absolute Cloud Spanner commit - * timestamp or a staleness relative to the current time. These modes do not - * require a "negotiation phase" to pick a timestamp. As a result, - * they execute slightly faster than the equivalent boundedly stale concurrency - * modes. On the other hand, boundedly stale reads usually return fresher - * results. See TransactionOptions.ReadOnly.read_timestamp and - * TransactionOptions.ReadOnly.exact_staleness. ### Bounded Staleness Bounded - * staleness modes allow Cloud Spanner to pick the read timestamp, subject to a - * user-provided staleness bound. Cloud Spanner chooses the newest timestamp - * within the staleness bound that allows execution of the reads at the closest - * available replica without blocking. All rows yielded are consistent with - * each other -- if any part of the read observes a transaction, all parts of - * the read see the transaction. Boundedly stale reads are not repeatable: two - * stale reads, even if they use the same staleness bound, can execute at - * different timestamps and thus return inconsistent results. Boundedly stale - * reads execute in two phases: the first phase negotiates a timestamp among all - * replicas needed to serve the read. In the second phase, reads are executed at - * the negotiated timestamp. As a result of the two phase execution, bounded - * staleness reads are usually a little slower than comparable exact staleness - * reads. However, they are typically able to return fresher results, and are - * more likely to execute at the closest replica. Because the timestamp - * negotiation requires up-front knowledge of which rows will be read, it can - * only be used with single-use read-only transactions. See - * TransactionOptions.ReadOnly.max_staleness and - * TransactionOptions.ReadOnly.min_read_timestamp. ### Old Read Timestamps and - * Garbage Collection Cloud Spanner continuously garbage collects deleted and - * overwritten data in the background to reclaim storage space. This process is - * known as "version GC". By default, version GC reclaims versions - * after they are one hour old. Because of this, Cloud Spanner cannot perform - * reads at read timestamps more than one hour in the past. This restriction - * also applies to in-progress reads and/or SQL queries whose timestamp become - * too old while executing. Reads and SQL queries with too-old read timestamps - * fail with the error `FAILED_PRECONDITION`. ## - */ -export interface Schema$TransactionOptions { - /** - * Transaction will not write. Authorization to begin a read-only transaction - * requires `spanner.databases.beginReadOnlyTransaction` permission on the - * `session` resource. - */ - readOnly: Schema$ReadOnly; - /** - * Transaction may write. Authorization to begin a read-write transaction - * requires `spanner.databases.beginOrRollbackReadWriteTransaction` permission - * on the `session` resource. - */ - readWrite: Schema$ReadWrite; -} -/** - * This message is used to select the transaction in which a Read or ExecuteSql - * call runs. See TransactionOptions for more information about transactions. - */ -export interface Schema$TransactionSelector { - /** - * Begin a new transaction and execute this read or SQL query in it. The - * transaction ID of the new transaction is returned in - * ResultSetMetadata.transaction, which is a Transaction. - */ - begin: Schema$TransactionOptions; - /** - * Execute the read or SQL query in a previously-started transaction. - */ - id: string; - /** - * Execute the read or SQL query in a temporary transaction. This is the most - * efficient way to execute a transaction that consists of a single SQL query. - */ - singleUse: Schema$TransactionOptions; -} -/** - * `Type` indicates the type of a Cloud Spanner value, as might be stored in a - * table cell or returned from an SQL query. - */ -export interface Schema$Type { - /** - * If code == ARRAY, then `array_element_type` is the type of the array - * elements. - */ - arrayElementType: Schema$Type; - /** - * Required. The TypeCode for this type. - */ - code: string; - /** - * If code == STRUCT, then `struct_type` provides type information for the - * struct's fields. - */ - structType: Schema$StructType; -} -/** - * Metadata type for the operation returned by UpdateDatabaseDdl. - */ -export interface Schema$UpdateDatabaseDdlMetadata { - /** - * Reports the commit timestamps of all statements that have succeeded so far, - * where `commit_timestamps[i]` is the commit timestamp for the statement - * `statements[i]`. - */ - commitTimestamps: string[]; - /** - * The database being modified. - */ - database: string; +export namespace spanner_v1 { /** - * For an update this list contains all the statements. For an individual - * statement, this list contains only that statement. - */ - statements: string[]; -} -/** - * Enqueues the given DDL statements to be applied, in order but not necessarily - * all at once, to the database schema at some point (or points) in the future. - * The server checks that the statements are executable (syntactically valid, - * name tables that exist, etc.) before enqueueing them, but they may still fail - * upon later execution (e.g., if a statement from another batch of statements - * is applied first and it conflicts in some way, or if there is some - * data-related problem like a `NULL` value in a column to which `NOT NULL` - * would be added). If a statement fails, all subsequent statements in the batch - * are automatically cancelled. Each batch of statements is assigned a name - * which can be used with the Operations API to monitor progress. See the - * operation_id field for more details. - */ -export interface Schema$UpdateDatabaseDdlRequest { - /** - * If empty, the new update request is assigned an automatically-generated - * operation ID. Otherwise, `operation_id` is used to construct the name of - * the resulting Operation. Specifying an explicit operation ID simplifies - * determining whether the statements were executed in the event that the - * UpdateDatabaseDdl call is replayed, or the return value is otherwise lost: - * the database and `operation_id` fields can be combined to form the name of - * the resulting longrunning.Operation: - * `<database>/operations/<operation_id>`. `operation_id` should - * be unique within the database, and must be a valid identifier: `a-z*`. Note - * that automatically-generated operation IDs always begin with an underscore. - * If the named operation already exists, UpdateDatabaseDdl returns - * `ALREADY_EXISTS`. - */ - operationId: string; - /** - * DDL statements to be applied to the database. - */ - statements: string[]; -} -/** - * Metadata type for the operation returned by UpdateInstance. - */ -export interface Schema$UpdateInstanceMetadata { - /** - * The time at which this operation was cancelled. If set, this operation is - * in the process of undoing itself (which is guaranteed to succeed) and - * cannot be cancelled again. - */ - cancelTime: string; - /** - * The time at which this operation failed or was completed successfully. - */ - endTime: string; - /** - * The desired end state of the update. - */ - instance: Schema$Instance; - /** - * The time at which UpdateInstance request was received. + * Cloud Spanner API + * + * Cloud Spanner is a managed, mission-critical, globally consistent and + * scalable relational database service. + * + * @example + * const google = require('googleapis'); + * const spanner = google.spanner('v1'); + * + * @namespace spanner + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Spanner */ - startTime: string; -} -/** - * The request for UpdateInstance. - */ -export interface Schema$UpdateInstanceRequest { + export class Spanner { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + /** - * Required. A mask specifying which fields in - * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] should - * be updated. The field mask must always be specified; this prevents any - * future fields in [][google.spanner.admin.instance.v1.Instance] from being - * erased accidentally by clients that do not know about them. + * The request for BeginTransaction. */ - fieldMask: string; + export interface Schema$BeginTransactionRequest { + /** + * Required. Options for the new transaction. + */ + options: Schema$TransactionOptions; + } /** - * Required. The instance to update, which must always include the instance - * name. Otherwise, only fields mentioned in - * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] need - * be included. - */ - instance: Schema$Instance; -} -/** - * Arguments to insert, update, insert_or_update, and replace operations. - */ -export interface Schema$Write { + * Associates `members` with a `role`. + */ + export interface Schema$Binding { + /** + * Specifies the identities requesting access for a Cloud Platform resource. + * `members` can have the following values: * `allUsers`: A special + * identifier that represents anyone who is on the internet; with or + * without a Google account. * `allAuthenticatedUsers`: A special + * identifier that represents anyone who is authenticated with a Google + * account or a service account. * `user:{emailid}`: An email address that + * represents a specific Google account. For example, `alice@gmail.com` + * or `joe@example.com`. * `serviceAccount:{emailid}`: An email address + * that represents a service account. For example, + * `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An + * email address that represents a Google group. For example, + * `admins@example.com`. * `domain:{domain}`: A Google Apps domain name + * that represents all the users of that domain. For example, + * `google.com` or `example.com`. + */ + members: string[]; + /** + * Role that is assigned to `members`. For example, `roles/viewer`, + * `roles/editor`, or `roles/owner`. Required + */ + role: string; + } /** - * The names of the columns in table to be written. The list of columns must - * contain enough columns to allow Cloud Spanner to derive values for all - * primary key columns in the row(s) to be modified. - */ - columns: string[]; + * Metadata associated with a parent-child relationship appearing in a + * PlanNode. + */ + export interface Schema$ChildLink { + /** + * The node to which the link points. + */ + childIndex: number; + /** + * The type of the link. For example, in Hash Joins this could be used to + * distinguish between the build child and the probe child, or in the case + * of the child being an output variable, to represent the tag associated + * with the output variable. + */ + type: string; + /** + * Only present if the child node is SCALAR and corresponds to an output + * variable of the parent node. The field carries the name of the output + * variable. For example, a `TableScan` operator that reads rows from a + * table will have child links to the `SCALAR` nodes representing the output + * variables created for each column that is read by the operator. The + * corresponding `variable` fields will be set to the variable names + * assigned to the columns. + */ + variable: string; + } /** - * Required. The table whose rows will be written. - */ - table: string; + * The request for Commit. + */ + export interface Schema$CommitRequest { + /** + * The mutations to be executed when this transaction commits. All mutations + * are applied atomically, in the order they appear in this list. + */ + mutations: Schema$Mutation[]; + /** + * Execute mutations in a temporary transaction. Note that unlike commit of + * a previously-started transaction, commit with a temporary transaction is + * non-idempotent. That is, if the `CommitRequest` is sent to Cloud Spanner + * more than once (for instance, due to retries in the application, or in + * the transport library), it is possible that the mutations are executed + * more than once. If this is undesirable, use BeginTransaction and Commit + * instead. + */ + singleUseTransaction: Schema$TransactionOptions; + /** + * Commit a previously-started transaction. + */ + transactionId: string; + } /** - * The values to be written. `values` can contain more than one list of - * values. If it does, then multiple rows are written, one for each entry in - * `values`. Each list in `values` must have exactly as many entries as there - * are entries in columns above. Sending multiple lists is equivalent to - * sending multiple `Mutation`s, each containing one `values` entry and - * repeating table and columns. Individual values in each list are encoded as - * described here. + * The response for Commit. */ - values: any[][]; -} - -export class Resource$Projects { - root: Spanner; - instanceConfigs: Resource$Projects$Instanceconfigs; - instances: Resource$Projects$Instances; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); - this.instanceConfigs = new Resource$Projects$Instanceconfigs(root); - this.instances = new Resource$Projects$Instances(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Instanceconfigs { - root: Spanner; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$CommitResponse { + /** + * The Cloud Spanner timestamp at which the transaction committed. + */ + commitTimestamp: string; } - - getRoot() { - return this.root; - } - - /** - * spanner.projects.instanceConfigs.get - * @desc Gets information about a particular instance configuration. - * @alias spanner.projects.instanceConfigs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the requested instance configuration. Values are of the form `projects//instanceConfigs/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Metadata type for the operation returned by CreateDatabase. */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CreateDatabaseMetadata { + /** + * The database being created. + */ + database: string; } - - /** - * spanner.projects.instanceConfigs.list - * @desc Lists the supported instance configurations for a given project. - * @alias spanner.projects.instanceConfigs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Number of instance configurations to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. - * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListInstanceConfigsResponse. - * @param {string} params.parent Required. The name of the project for which a list of supported instance configurations is requested. Values are of the form `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/instanceConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The request for CreateDatabase. + */ + export interface Schema$CreateDatabaseRequest { + /** + * Required. A `CREATE DATABASE` statement, which specifies the ID of the + * new database. The database ID must conform to the regular expression + * `a-z*[a-z0-9]` and be between 2 and 30 characters in length. If the + * database ID is a reserved word or if it contains a hyphen, the database + * ID must be enclosed in backticks (`` ` ``). + */ + createStatement: string; + /** + * An optional list of DDL statements to run inside the newly created + * database. Statements can create tables, indexes, etc. These statements + * execute atomically with the creation of the database: if there is an + * error in any statement, the database is not created. + */ + extraStatements: string[]; } -} - -export class Resource$Projects$Instances { - root: Spanner; - databases: Resource$Projects$Instances$Databases; - operations: Resource$Projects$Instances$Operations; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); - this.databases = new Resource$Projects$Instances$Databases(root); - this.operations = new Resource$Projects$Instances$Operations(root); + /** + * Metadata type for the operation returned by CreateInstance. + */ + export interface Schema$CreateInstanceMetadata { + /** + * The time at which this operation was cancelled. If set, this operation is + * in the process of undoing itself (which is guaranteed to succeed) and + * cannot be cancelled again. + */ + cancelTime: string; + /** + * The time at which this operation failed or was completed successfully. + */ + endTime: string; + /** + * The instance being created. + */ + instance: Schema$Instance; + /** + * The time at which the CreateInstance request was received. + */ + startTime: string; } - - getRoot() { - return this.root; + /** + * The request for CreateInstance. + */ + export interface Schema$CreateInstanceRequest { + /** + * Required. The instance to create. The name may be omitted, but if + * specified must be `<parent>/instances/<instance_id>`. + */ + instance: Schema$Instance; + /** + * Required. The ID of the instance to create. Valid identifiers are of the + * form `a-z*[a-z0-9]` and must be between 6 and 30 characters in length. + */ + instanceId: string; } - - /** - * spanner.projects.instances.create - * @desc Creates an instance and begins preparing it to begin serving. The - * returned long-running operation can be used to track the progress of - * preparing the new instance. The instance name is assigned by the caller. If - * the named instance already exists, `CreateInstance` returns - * `ALREADY_EXISTS`. Immediately upon completion of this request: * The - * instance is readable via the API, with all requested attributes but no - * allocated resources. Its state is `CREATING`. Until completion of the - * returned operation: * Cancelling the operation renders the instance - * immediately unreadable via the API. * The instance can be deleted. * - * All other attempts to modify the instance are rejected. Upon completion of - * the returned operation: * Billing for all successfully-allocated - * resources begins (some types may have lower than the requested levels). - * * Databases can be created in the instance. * The instance's allocated - * resource levels are readable via the API. * The instance's state becomes - * `READY`. The returned long-running operation will have a name of the - * format `/operations/` and can be used to track - * creation of the instance. The metadata field type is - * CreateInstanceMetadata. The response field type is Instance, if successful. - * @alias spanner.projects.instances.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the project in which to create the instance. Values are of the form `projects/`. - * @param {().CreateInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The request for CreateSession. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CreateSessionRequest { + /** + * The session to create. + */ + session: Schema$Session; } - - /** - * spanner.projects.instances.delete - * @desc Deletes an instance. Immediately upon completion of the request: * - * Billing ceases for all of the instance's reserved resources. Soon - * afterward: * The instance and *all of its databases* immediately and - * irrevocably disappear from the API. All data in the databases is - * permanently deleted. - * @alias spanner.projects.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the instance to be deleted. Values are of the form `projects//instances/` - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Cloud Spanner database. + */ + export interface Schema$Database { + /** + * Required. The name of the database. Values are of the form + * `projects/<project>/instances/<instance>/databases/<database>`, + * where `<database>` is as specified in the `CREATE DATABASE` + * statement. This name can be passed to other API methods to identify the + * database. + */ + name: string; + /** + * Output only. The current database state. + */ + state: string; } - - /** - * spanner.projects.instances.get - * @desc Gets information about a particular instance. - * @alias spanner.projects.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the requested instance. Values are of the form `projects//instances/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Arguments to delete operations. + */ + export interface Schema$Delete { + /** + * Required. The primary keys of the rows within table to delete. Delete is + * idempotent. The transaction will succeed even if some or all rows do not + * exist. + */ + keySet: Schema$KeySet; + /** + * Required. The table whose rows will be deleted. + */ + table: string; } - - /** - * spanner.projects.instances.getIamPolicy - * @desc Gets the access control policy for an instance resource. Returns an - * empty policy if an instance exists but does not have a policy set. - * Authorization requires `spanner.instances.getIamPolicy` on resource. - * @alias spanner.projects.instances.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * The request for ExecuteSql and ExecuteStreamingSql. + */ + export interface Schema$ExecuteSqlRequest { + /** + * The SQL string can contain parameter placeholders. A parameter + * placeholder consists of `'@'` followed by the parameter name. + * Parameter names consist of any combination of letters, numbers, and + * underscores. Parameters can appear anywhere that a literal value is + * expected. The same parameter name can be used more than once, for + * example: `"WHERE id > @msg_id AND id < @msg_id + 100"` + * It is an error to execute an SQL statement with unbound parameters. + * Parameter values are specified using `params`, which is a JSON object + * whose keys are parameter names, and whose values are the corresponding + * parameter values. + */ + params: any; + /** + * It is not always possible for Cloud Spanner to infer the right SQL type + * from a JSON value. For example, values of type `BYTES` and values of + * type `STRING` both appear in params as JSON strings. In these cases, + * `param_types` can be used to specify the exact SQL type for some or all + * of the SQL statement parameters. See the definition of Type for more + * information about SQL types. + */ + paramTypes: any; + /** + * If present, results will be restricted to the specified partition + * previously created using PartitionQuery(). There must be an exact match + * for the values of fields common to this message and the + * PartitionQueryRequest message used to create this partition_token. + */ + partitionToken: string; + /** + * Used to control the amount of debugging information returned in + * ResultSetStats. If partition_token is set, query_mode can only be set to + * QueryMode.NORMAL. + */ + queryMode: string; + /** + * If this request is resuming a previously interrupted SQL statement + * execution, `resume_token` should be copied from the last PartialResultSet + * yielded before the interruption. Doing this enables the new SQL statement + * execution to resume where the last one left off. The rest of the request + * parameters must exactly match the request that yielded this token. + */ + resumeToken: string; + /** + * Required. The SQL string. + */ + sql: string; + /** + * The transaction to use. If none is provided, the default is a temporary + * read-only transaction with strong concurrency. + */ + transaction: Schema$TransactionSelector; + } + /** + * Message representing a single field of a struct. + */ + export interface Schema$Field { + /** + * The name of the field. For reads, this is the column name. For SQL + * queries, it is the column alias (e.g., `"Word"` in the query + * `"SELECT 'hello' AS Word"`), or the column name (e.g., + * `"ColName"` in the query `"SELECT ColName FROM + * Table"`). Some columns might have an empty name (e.g., !"SELECT + * UPPER(ColName)"`). Note that a query result can contain multiple + * fields with the same name. + */ + name: string; + /** + * The type of the field. + */ + type: Schema$Type; } - - /** - * spanner.projects.instances.list - * @desc Lists all instances in the given project. - * @alias spanner.projects.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: * `name` * `display_name` * `labels.key` where key is the name of a label Some examples of using filters are: * `name:*` --> The instance has a name. * `name:Howl` --> The instance's name contains the string "howl". * `name:HOWL` --> Equivalent to above. * `NAME:howl` --> Equivalent to above. * `labels.env:*` --> The instance has the label "env". * `labels.env:dev` --> The instance has the label "env" and the value of the label contains the string "dev". * `name:howl labels.env:dev` --> The instance's name contains "howl" and it has the label "env" with its value containing "dev". - * @param {integer=} params.pageSize Number of instances to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. - * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListInstancesResponse. - * @param {string} params.parent Required. The name of the project for which a list of instances is requested. Values are of the form `projects/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The response for GetDatabaseDdl. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$GetDatabaseDdlResponse { + /** + * A list of formatted DDL statements defining the schema of the database + * specified in the request. + */ + statements: string[]; } - - /** - * spanner.projects.instances.patch - * @desc Updates an instance, and begins allocating or releasing resources as - * requested. The returned long-running operation can be used to track the - * progress of updating the instance. If the named instance does not exist, - * returns `NOT_FOUND`. Immediately upon completion of this request: * For - * resource types for which a decrease in the instance's allocation has - * been requested, billing is based on the newly-requested level. Until - * completion of the returned operation: * Cancelling the operation sets - * its metadata's cancel_time, and begins restoring resources to their - * pre-request values. The operation is guaranteed to succeed at undoing - * all resource changes, after which point it terminates with a - * `CANCELLED` status. * All other attempts to modify the instance are - * rejected. * Reading the instance via the API continues to give the - * pre-request resource levels. Upon completion of the returned - * operation: * Billing begins for all successfully-allocated resources - * (some types may have lower than the requested levels). * All - * newly-reserved resources are available for serving the instance's tables. - * * The instance's new resource levels are readable via the API. The - * returned long-running operation will have a name of the format - * `/operations/` and can be used to track the - * instance modification. The metadata field type is UpdateInstanceMetadata. - * The response field type is Instance, if successful. Authorization requires - * `spanner.instances.update` permission on resource name. - * @alias spanner.projects.instances.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form `projects//instances/a-z*[a-z0-9]`. The final segment of the name must be between 6 and 30 characters in length. - * @param {().UpdateInstanceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Request message for `GetIamPolicy` method. + */ + export interface Schema$GetIamPolicyRequest {} + /** + * An isolated set of Cloud Spanner resources on which databases can be + * hosted. + */ + export interface Schema$Instance { + /** + * Required. The name of the instance's configuration. Values are of the + * form `projects/<project>/instanceConfigs/<configuration>`. + * See also InstanceConfig and ListInstanceConfigs. + */ + config: string; + /** + * Required. The descriptive name for this instance as it appears in UIs. + * Must be unique per project and between 4 and 30 characters in length. + */ + displayName: string; + /** + * Cloud Labels are a flexible and lightweight mechanism for organizing + * cloud resources into groups that reflect a customer's organizational + * needs and deployment strategies. Cloud Labels can be used to filter + * collections of resources. They can be used to control how resource + * metrics are aggregated. And they can be used as arguments to policy + * management rules (e.g. route, firewall, load balancing, etc.). * Label + * keys must be between 1 and 63 characters long and must conform to the + * following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. * Label + * values must be between 0 and 63 characters long and must conform to + * the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. * No more than + * 64 labels can be associated with a given resource. See + * https://goo.gl/xmQnxf for more information on and examples of labels. If + * you plan to use labels in your own code, please note that additional + * characters may be allowed in the future. And so you are advised to use an + * internal label representation, such as JSON, which doesn't rely upon + * specific characters being disallowed. For example, representing labels + * as the string: name + "_" + value would prove problematic if + * we were to allow "_" in a future release. + */ + labels: any; + /** + * Required. A unique identifier for the instance, which cannot be changed + * after the instance is created. Values are of the form + * `projects/<project>/instances/a-z*[a-z0-9]`. The final segment of + * the name must be between 6 and 30 characters in length. + */ + name: string; + /** + * Required. The number of nodes allocated to this instance. This may be + * zero in API responses for instances that are not yet in state `READY`. + * See [the + * documentation](https://cloud.google.com/spanner/docs/instances#node_count) + * for more information about nodes. + */ + nodeCount: number; + /** + * Output only. The current instance state. For CreateInstance, the state + * must be either omitted or set to `CREATING`. For UpdateInstance, the + * state must be either omitted or set to `READY`. + */ + state: string; } - - /** - * spanner.projects.instances.setIamPolicy - * @desc Sets the access control policy on an instance resource. Replaces any - * existing policy. Authorization requires `spanner.instances.setIamPolicy` - * on resource. - * @alias spanner.projects.instances.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A possible configuration for a Cloud Spanner instance. Configurations + * define the geographic placement of nodes and their replication. + */ + export interface Schema$InstanceConfig { + /** + * The name of this instance configuration as it appears in UIs. + */ + displayName: string; + /** + * A unique identifier for the instance configuration. Values are of the + * form `projects/<project>/instanceConfigs/a-z*` + */ + name: string; } - - /** - * spanner.projects.instances.testIamPermissions - * @desc Returns permissions that the caller has on the specified instance - * resource. Attempting this RPC on a non-existent Cloud Spanner instance - * resource will result in a NOT_FOUND error if the user has - * `spanner.instances.list` permission on the containing Google Cloud Project. - * Otherwise returns an empty set of permissions. - * @alias spanner.projects.instances.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * KeyRange represents a range of rows in a table or index. A range has a + * start key and an end key. These keys can be open or closed, indicating if + * the range includes rows with that key. Keys are represented by lists, + * where the ith value in the list corresponds to the ith component of the + * table or index primary key. Individual values are encoded as described + * here. For example, consider the following table definition: CREATE + * TABLE UserEvents ( UserName STRING(MAX), EventDate STRING(10) + * ) PRIMARY KEY(UserName, EventDate); The following keys name rows in this + * table: "Bob", "2014-09-23" Since the `UserEvents` + * table's `PRIMARY KEY` clause names two columns, each `UserEvents` key + * has two elements; the first is the `UserName`, and the second is the + * `EventDate`. Key ranges with multiple components are interpreted + * lexicographically by component using the table or index key's declared + * sort order. For example, the following range returns all events for user + * `"Bob"` that occurred in the year 2015: "start_closed": + * ["Bob", "2015-01-01"] "end_closed": + * ["Bob", "2015-12-31"] Start and end keys can omit + * trailing key components. This affects the inclusion and exclusion of rows + * that exactly match the provided key components: if the key is closed, then + * rows that exactly match the provided components are included; if the key is + * open, then rows that exactly match are not included. For example, the + * following range includes all events for `"Bob"` that occurred + * during and after the year 2000: "start_closed": + * ["Bob", "2000-01-01"] "end_closed": + * ["Bob"] The next example retrieves all events for + * `"Bob"`: "start_closed": ["Bob"] + * "end_closed": ["Bob"] To retrieve events before the + * year 2000: "start_closed": ["Bob"] + * "end_open": ["Bob", "2000-01-01"] The + * following range includes all rows in the table: "start_closed": + * [] "end_closed": [] This range returns all users whose + * `UserName` begins with any character from A to C: "start_closed": + * ["A"] "end_open": ["D"] This range + * returns all users whose `UserName` begins with B: "start_closed": + * ["B"] "end_open": ["C"] Key ranges honor + * column sort order. For example, suppose a table is defined as follows: + * CREATE TABLE DescendingSortedTable { Key INT64, ... ) + * PRIMARY KEY(Key DESC); The following range retrieves all rows with key + * values between 1 and 100 inclusive: "start_closed": + * ["100"] "end_closed": ["1"] Note that + * 100 is passed as the start, and 1 is passed as the end, because `Key` is a + * descending column in the schema. + */ + export interface Schema$KeyRange { + /** + * If the end is closed, then the range includes all rows whose first + * `len(end_closed)` key columns exactly match `end_closed`. + */ + endClosed: any[]; + /** + * If the end is open, then the range excludes rows whose first + * `len(end_open)` key columns exactly match `end_open`. + */ + endOpen: any[]; + /** + * If the start is closed, then the range includes all rows whose first + * `len(start_closed)` key columns exactly match `start_closed`. + */ + startClosed: any[]; + /** + * If the start is open, then the range excludes rows whose first + * `len(start_open)` key columns exactly match `start_open`. + */ + startOpen: any[]; } -} -export class Resource$Projects$Instances$Databases { - root: Spanner; - operations: Resource$Projects$Instances$Databases$Operations; - sessions: Resource$Projects$Instances$Databases$Sessions; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); - this.operations = - new Resource$Projects$Instances$Databases$Operations(root); - this.sessions = new Resource$Projects$Instances$Databases$Sessions(root); + /** + * `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All + * the keys are expected to be in the same table or index. The keys need not + * be sorted in any particular way. If the same key is specified multiple + * times in the set (for example if two ranges, two keys, or a key and a range + * overlap), Cloud Spanner behaves as if the key were only specified once. + */ + export interface Schema$KeySet { + /** + * For convenience `all` can be set to `true` to indicate that this `KeySet` + * matches all keys in the table or index. Note that any keys specified in + * `keys` or `ranges` are only yielded once. + */ + all: boolean; + /** + * A list of specific keys. Entries in `keys` should have exactly as many + * elements as there are columns in the primary or index key with which this + * `KeySet` is used. Individual key values are encoded as described here. + */ + keys: any[][]; + /** + * A list of key ranges. See KeyRange for more information about key range + * specifications. + */ + ranges: Schema$KeyRange[]; } - - getRoot() { - return this.root; + /** + * The response for ListDatabases. + */ + export interface Schema$ListDatabasesResponse { + /** + * Databases that matched the request. + */ + databases: Schema$Database[]; + /** + * `next_page_token` can be sent in a subsequent ListDatabases call to fetch + * more of the matching databases. + */ + nextPageToken: string; } - - /** - * spanner.projects.instances.databases.create - * @desc Creates a new Cloud Spanner database and starts to prepare it for - * serving. The returned long-running operation will have a name of the format - * `/operations/` and can be used to track - * preparation of the database. The metadata field type is - * CreateDatabaseMetadata. The response field type is Database, if successful. - * @alias spanner.projects.instances.databases.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent Required. The name of the instance that will serve the new database. Values are of the form `projects//instances/`. - * @param {().CreateDatabaseRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/databases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response for ListInstanceConfigs. + */ + export interface Schema$ListInstanceConfigsResponse { + /** + * The list of requested instance configurations. + */ + instanceConfigs: Schema$InstanceConfig[]; + /** + * `next_page_token` can be sent in a subsequent ListInstanceConfigs call to + * fetch more of the matching instance configurations. + */ + nextPageToken: string; } - - /** - * spanner.projects.instances.databases.dropDatabase - * @desc Drops (aka deletes) a Cloud Spanner database. - * @alias spanner.projects.instances.databases.dropDatabase - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Required. The database to be dropped. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - dropDatabase(params?: any, options?: MethodOptions): - AxiosPromise; - dropDatabase( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - dropDatabase( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+database}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response for ListInstances. + */ + export interface Schema$ListInstancesResponse { + /** + * The list of requested instances. + */ + instances: Schema$Instance[]; + /** + * `next_page_token` can be sent in a subsequent ListInstances call to fetch + * more of the matching instances. + */ + nextPageToken: string; } - - /** - * spanner.projects.instances.databases.get - * @desc Gets the state of a Cloud Spanner database. - * @alias spanner.projects.instances.databases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the requested database. Values are of the form `projects//instances//databases/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; } - - /** - * spanner.projects.instances.databases.getDdl - * @desc Returns the schema of a Cloud Spanner database as a list of formatted - * DDL statements. This method does not show pending schema updates, those may - * be queried using the Operations API. - * @alias spanner.projects.instances.databases.getDdl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Required. The database whose schema we wish to get. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getDdl(params?: any, options?: MethodOptions): - AxiosPromise; - getDdl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getDdl( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+database}/ddl').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response for ListSessions. + */ + export interface Schema$ListSessionsResponse { + /** + * `next_page_token` can be sent in a subsequent ListSessions call to fetch + * more of the matching sessions. + */ + nextPageToken: string; + /** + * The list of requested sessions. + */ + sessions: Schema$Session[]; } - - /** - * spanner.projects.instances.databases.getIamPolicy - * @desc Gets the access control policy for a database resource. Returns an - * empty policy if a database exists but does not have a policy set. - * Authorization requires `spanner.databases.getIamPolicy` permission on - * resource. - * @alias spanner.projects.instances.databases.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - * @param {().GetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:getIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A modification to one or more Cloud Spanner rows. Mutations can be applied + * to a Cloud Spanner database by sending them in a Commit call. + */ + export interface Schema$Mutation { + /** + * Delete rows from a table. Succeeds whether or not the named rows were + * present. + */ + delete: Schema$Delete; + /** + * Insert new rows in a table. If any of the rows already exist, the write + * or transaction fails with error `ALREADY_EXISTS`. + */ + insert: Schema$Write; + /** + * Like insert, except that if the row already exists, then its column + * values are overwritten with the ones provided. Any column values not + * explicitly written are preserved. + */ + insertOrUpdate: Schema$Write; + /** + * Like insert, except that if the row already exists, it is deleted, and + * the column values provided are inserted instead. Unlike insert_or_update, + * this means any values not explicitly written become `NULL`. + */ + replace: Schema$Write; + /** + * Update existing rows in a table. If any of the rows does not already + * exist, the transaction fails with error `NOT_FOUND`. + */ + update: Schema$Write; } - - /** - * spanner.projects.instances.databases.list - * @desc Lists Cloud Spanner databases. - * @alias spanner.projects.instances.databases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize Number of databases to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. - * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListDatabasesResponse. - * @param {string} params.parent Required. The instance whose databases should be listed. Values are of the form `projects//instances/`. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+parent}/databases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - /** - * spanner.projects.instances.databases.setIamPolicy - * @desc Sets the access control policy on a database resource. Replaces any - * existing policy. Authorization requires `spanner.databases.setIamPolicy` - * permission on resource. - * @alias spanner.projects.instances.databases.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. - * @param {().SetIamPolicyRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:setIamPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Partial results from a streaming read or SQL query. Streaming reads and SQL + * queries better tolerate large result sets, large rows, and large values, + * but are a little trickier to consume. + */ + export interface Schema$PartialResultSet { + /** + * If true, then the final value in values is chunked, and must be combined + * with more values from subsequent `PartialResultSet`s to obtain a complete + * field value. + */ + chunkedValue: boolean; + /** + * Metadata about the result set, such as row type information. Only present + * in the first response. + */ + metadata: Schema$ResultSetMetadata; + /** + * Streaming calls might be interrupted for a variety of reasons, such as + * TCP connection loss. If this occurs, the stream of results can be resumed + * by re-sending the original request and including `resume_token`. Note + * that executing any other transaction in the same session invalidates the + * token. + */ + resumeToken: string; + /** + * Query plan and execution statistics for the statement that produced this + * streaming result set. These can be requested by setting + * ExecuteSqlRequest.query_mode and are sent only once with the last + * response in the stream. + */ + stats: Schema$ResultSetStats; + /** + * A streamed result set consists of a stream of values, which might be + * split into many `PartialResultSet` messages to accommodate large rows + * and/or large values. Every N complete values defines a row, where N is + * equal to the number of entries in metadata.row_type.fields. Most values + * are encoded based on type as described here. It is possible that the + * last value in values is "chunked", meaning that the rest of the + * value is sent in subsequent `PartialResultSet`(s). This is denoted by the + * chunked_value field. Two or more chunked values can be merged to form a + * complete value as follows: * `bool/number/null`: cannot be chunked * + * `string`: concatenate the strings * `list`: concatenate the lists. If + * the last element in a list is a `string`, `list`, or `object`, merge + * it with the first element in the next list by applying these rules + * recursively. * `object`: concatenate the (field name, field value) + * pairs. If a field name is duplicated, then apply these rules + * recursively to merge the field values. Some examples of merging: # + * Strings are concatenated. "foo", "bar" => + * "foobar" # Lists of non-strings are concatenated. [2, + * 3], [4] => [2, 3, 4] # Lists are concatenated, but the last and + * first elements are merged # because they are strings. ["a", + * "b"], ["c", "d"] => ["a", + * "bc", "d"] # Lists are concatenated, but the + * last and first elements are merged # because they are lists. + * Recursively, the last and first elements # of the inner lists are + * merged because they are strings. ["a", ["b", + * "c"]], [["d"], "e"] => ["a", + * ["b", "cd"], "e"] # Non-overlapping + * object fields are combined. {"a": "1"}, + * {"b": "2"} => {"a": "1", + * "b": 2"} # Overlapping object fields are merged. + * {"a": "1"}, {"a": "2"} => + * {"a": "12"} # Examples of merging objects + * containing lists of strings. {"a": ["1"]}, + * {"a": ["2"]} => {"a": ["12"]} + * For a more complete example, suppose a streaming SQL query is yielding a + * result set whose rows contain a single string field. The following + * `PartialResultSet`s might be yielded: { "metadata": + * { ... } "values": ["Hello", "W"] + * "chunked_value": true "resume_token": + * "Af65..." } { "values": + * ["orl"] "chunked_value": true + * "resume_token": "Bqp2..." } { + * "values": ["d"] "resume_token": + * "Zx1B..." } This sequence of `PartialResultSet`s encodes + * two rows, one containing the field value `"Hello"`, and a + * second containing the field value `"World" = "W" + + * "orl" + "d"`. + */ + values: any[]; } - - /** - * spanner.projects.instances.databases.testIamPermissions - * @desc Returns permissions that the caller has on the specified database - * resource. Attempting this RPC on a non-existent Cloud Spanner database - * will result in a NOT_FOUND error if the user has `spanner.databases.list` - * permission on the containing Cloud Spanner instance. Otherwise returns an - * empty set of permissions. - * @alias spanner.projects.instances.databases.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. - * @param {().TestIamPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Information returned for each partition returned in a PartitionResponse. */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+resource}:testIamPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resource'], - pathParams: ['resource'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Partition { + /** + * This token can be passed to Read, StreamingRead, ExecuteSql, or + * ExecuteStreamingSql requests to restrict the results to those identified + * by this partition token. + */ + partitionToken: string; } - - /** - * spanner.projects.instances.databases.updateDdl - * @desc Updates the schema of a Cloud Spanner database by - * creating/altering/dropping tables, columns, indexes, etc. The returned - * long-running operation will have a name of the format - * `/operations/` and can be used to track - * execution of the schema change(s). The metadata field type is - * UpdateDatabaseDdlMetadata. The operation has no response. - * @alias spanner.projects.instances.databases.updateDdl - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Required. The database to update. - * @param {().UpdateDatabaseDdlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateDdl(params?: any, options?: MethodOptions): - AxiosPromise; - updateDdl( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateDdl( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+database}/ddl').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Options for a PartitionQueryRequest and PartitionReadRequest. + */ + export interface Schema$PartitionOptions { + /** + * **Note:** This hint is currently ignored by PartitionQuery and + * PartitionRead requests. The desired maximum number of partitions to + * return. For example, this may be set to the number of workers available. + * The default for this option is currently 10,000. The maximum value is + * currently 200,000. This is only a hint. The actual number of partitions + * returned may be smaller or larger than this maximum count request. + */ + maxPartitions: string; + /** + * **Note:** This hint is currently ignored by PartitionQuery and + * PartitionRead requests. The desired data size for each partition + * generated. The default for this option is currently 1 GiB. This is only + * a hint. The actual size of each partition may be smaller or larger than + * this size request. + */ + partitionSizeBytes: string; } -} -export class Resource$Projects$Instances$Databases$Operations { - root: Spanner; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); + /** + * The request for PartitionQuery + */ + export interface Schema$PartitionQueryRequest { + /** + * The SQL query string can contain parameter placeholders. A parameter + * placeholder consists of `'@'` followed by the parameter name. + * Parameter names consist of any combination of letters, numbers, and + * underscores. Parameters can appear anywhere that a literal value is + * expected. The same parameter name can be used more than once, for + * example: `"WHERE id > @msg_id AND id < @msg_id + 100"` + * It is an error to execute an SQL query with unbound parameters. Parameter + * values are specified using `params`, which is a JSON object whose keys + * are parameter names, and whose values are the corresponding parameter + * values. + */ + params: any; + /** + * It is not always possible for Cloud Spanner to infer the right SQL type + * from a JSON value. For example, values of type `BYTES` and values of + * type `STRING` both appear in params as JSON strings. In these cases, + * `param_types` can be used to specify the exact SQL type for some or all + * of the SQL query parameters. See the definition of Type for more + * information about SQL types. + */ + paramTypes: any; + /** + * Additional options that affect how many partitions are created. + */ + partitionOptions: Schema$PartitionOptions; + /** + * The query request to generate partitions for. The request will fail if + * the query is not root partitionable. The query plan of a root + * partitionable query has a single distributed union operator. A + * distributed union operator conceptually divides one or more tables into + * multiple splits, remotely evaluates a subquery independently on each + * split, and then unions all results. + */ + sql: string; + /** + * Read only snapshot transactions are supported, read/write and single use + * transactions are not. + */ + transaction: Schema$TransactionSelector; } - - getRoot() { - return this.root; + /** + * The request for PartitionRead + */ + export interface Schema$PartitionReadRequest { + /** + * The columns of table to be returned for each row matching this request. + */ + columns: string[]; + /** + * If non-empty, the name of an index on table. This index is used instead + * of the table primary key when interpreting key_set and sorting result + * rows. See key_set for further information. + */ + index: string; + /** + * Required. `key_set` identifies the rows to be yielded. `key_set` names + * the primary keys of the rows in table to be yielded, unless index is + * present. If index is present, then key_set instead names index keys in + * index. It is not an error for the `key_set` to name rows that do not + * exist in the database. Read yields nothing for nonexistent rows. + */ + keySet: Schema$KeySet; + /** + * Additional options that affect how many partitions are created. + */ + partitionOptions: Schema$PartitionOptions; + /** + * Required. The name of the table in the database to be read. + */ + table: string; + /** + * Read only snapshot transactions are supported, read/write and single use + * transactions are not. + */ + transaction: Schema$TransactionSelector; } - - /** - * spanner.projects.instances.databases.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias spanner.projects.instances.databases.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The response for PartitionQuery or PartitionRead + */ + export interface Schema$PartitionResponse { + /** + * Partitions created by this request. + */ + partitions: Schema$Partition[]; + /** + * Transaction created by this request. + */ + transaction: Schema$Transaction; } - - /** - * spanner.projects.instances.databases.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias spanner.projects.instances.databases.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Node information for nodes appearing in a QueryPlan.plan_nodes. + */ + export interface Schema$PlanNode { + /** + * List of child node `index`es and their relationship to this parent. + */ + childLinks: Schema$ChildLink[]; + /** + * The display name for the node. + */ + displayName: string; + /** + * The execution statistics associated with the node, contained in a group + * of key-value pairs. Only present if the plan was returned as a result of + * a profile query. For example, number of executions, number of rows/time + * per execution etc. + */ + executionStats: any; + /** + * The `PlanNode`'s index in node list. + */ + index: number; + /** + * Used to determine the type of node. May be needed for visualizing + * different kinds of nodes differently. For example, If the node is a + * SCALAR node, it will have a condensed representation which can be used to + * directly embed a description of the node in its parent. + */ + kind: string; + /** + * Attributes relevant to the node contained in a group of key-value pairs. + * For example, a Parameter Reference node could have the following + * information in its metadata: { "parameter_reference": + * "param1", "parameter_type": "array" } + */ + metadata: any; + /** + * Condensed representation for SCALAR nodes. + */ + shortRepresentation: Schema$ShortRepresentation; } - - /** - * spanner.projects.instances.databases.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias spanner.projects.instances.databases.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines an Identity and Access Management (IAM) policy. It is used to + * specify access control policies for Cloud Platform resources. A `Policy` + * consists of a list of `bindings`. A `Binding` binds a list of `members` to + * a `role`, where the members can be user accounts, Google groups, Google + * domains, and service accounts. A `role` is a named list of permissions + * defined by IAM. **Example** { "bindings": [ { + * "role": "roles/owner", "members": [ + * "user:mike@example.com", "group:admins@example.com", + * "domain:google.com", + * "serviceAccount:my-other-app@appspot.gserviceaccount.com", ] }, + * { "role": "roles/viewer", + * "members": ["user:sean@example.com"] } ] + * } For a description of IAM and its features, see the [IAM developer's + * guide](https://cloud.google.com/iam/docs). + */ + export interface Schema$Policy { + /** + * Associates a list of `members` to a `role`. `bindings` with no members + * will result in an error. + */ + bindings: Schema$Binding[]; + /** + * `etag` is used for optimistic concurrency control as a way to help + * prevent simultaneous updates of a policy from overwriting each other. It + * is strongly suggested that systems make use of the `etag` in the + * read-modify-write cycle to perform policy updates in order to avoid race + * conditions: An `etag` is returned in the response to `getIamPolicy`, and + * systems are expected to put that etag in the request to `setIamPolicy` to + * ensure that their change will be applied to the same version of the + * policy. If no `etag` is provided in the call to `setIamPolicy`, then the + * existing policy is overwritten blindly. + */ + etag: string; + /** + * Deprecated. + */ + version: number; } - - /** - * spanner.projects.instances.databases.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias spanner.projects.instances.databases.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Contains an ordered list of nodes appearing in the query plan. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$QueryPlan { + /** + * The nodes in the query plan. Plan nodes are returned in pre-order + * starting with the plan root. Each PlanNode's `id` corresponds to its + * index in `plan_nodes`. + */ + planNodes: Schema$PlanNode[]; } -} - -export class Resource$Projects$Instances$Databases$Sessions { - root: Spanner; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); + /** + * Message type to initiate a read-only transaction. + */ + export interface Schema$ReadOnly { + /** + * Executes all reads at a timestamp that is `exact_staleness` old. The + * timestamp is chosen soon after the read is started. Guarantees that all + * writes that have committed more than the specified number of seconds ago + * are visible. Because Cloud Spanner chooses the exact timestamp, this mode + * works even if the client's local clock is substantially skewed from + * Cloud Spanner commit timestamps. Useful for reading at nearby replicas + * without the distributed timestamp negotiation overhead of + * `max_staleness`. + */ + exactStaleness: string; + /** + * Read data at a timestamp >= `NOW - max_staleness` seconds. Guarantees + * that all writes that have committed more than the specified number of + * seconds ago are visible. Because Cloud Spanner chooses the exact + * timestamp, this mode works even if the client's local clock is + * substantially skewed from Cloud Spanner commit timestamps. Useful for + * reading the freshest data available at a nearby replica, while bounding + * the possible staleness if the local replica has fallen behind. Note that + * this option can only be used in single-use transactions. + */ + maxStaleness: string; + /** + * Executes all reads at a timestamp >= `min_read_timestamp`. This is + * useful for requesting fresher data than some previous read, or data that + * is fresh enough to observe the effects of some previously committed + * transaction whose timestamp is known. Note that this option can only be + * used in single-use transactions. A timestamp in RFC3339 UTC + * \"Zulu\" format, accurate to nanoseconds. Example: + * `"2014-10-02T15:01:23.045123456Z"`. + */ + minReadTimestamp: string; + /** + * Executes all reads at the given timestamp. Unlike other modes, reads at a + * specific timestamp are repeatable; the same read at the same timestamp + * always returns the same data. If the timestamp is in the future, the read + * will block until the specified timestamp, modulo the read's deadline. + * Useful for large scale consistent reads such as mapreduces, or for + * coordinating many reads against a consistent snapshot of the data. A + * timestamp in RFC3339 UTC \"Zulu\" format, accurate to + * nanoseconds. Example: `"2014-10-02T15:01:23.045123456Z"`. + */ + readTimestamp: string; + /** + * If true, the Cloud Spanner-selected read timestamp is included in the + * Transaction message that describes the transaction. + */ + returnReadTimestamp: boolean; + /** + * Read at a timestamp where all previously committed transactions are + * visible. + */ + strong: boolean; } - - getRoot() { - return this.root; + /** + * The request for Read and StreamingRead. + */ + export interface Schema$ReadRequest { + /** + * The columns of table to be returned for each row matching this request. + */ + columns: string[]; + /** + * If non-empty, the name of an index on table. This index is used instead + * of the table primary key when interpreting key_set and sorting result + * rows. See key_set for further information. + */ + index: string; + /** + * Required. `key_set` identifies the rows to be yielded. `key_set` names + * the primary keys of the rows in table to be yielded, unless index is + * present. If index is present, then key_set instead names index keys in + * index. If the partition_token field is empty, rows are yielded in table + * primary key order (if index is empty) or index key order (if index is + * non-empty). If the partition_token field is not empty, rows will be + * yielded in an unspecified order. It is not an error for the `key_set` to + * name rows that do not exist in the database. Read yields nothing for + * nonexistent rows. + */ + keySet: Schema$KeySet; + /** + * If greater than zero, only the first `limit` rows are yielded. If `limit` + * is zero, the default is no limit. A limit cannot be specified if + * `partition_token` is set. + */ + limit: string; + /** + * If present, results will be restricted to the specified partition + * previously created using PartitionRead(). There must be an exact match + * for the values of fields common to this message and the + * PartitionReadRequest message used to create this partition_token. + */ + partitionToken: string; + /** + * If this request is resuming a previously interrupted read, `resume_token` + * should be copied from the last PartialResultSet yielded before the + * interruption. Doing this enables the new read to resume where the last + * read left off. The rest of the request parameters must exactly match the + * request that yielded this token. + */ + resumeToken: string; + /** + * Required. The name of the table in the database to be read. + */ + table: string; + /** + * The transaction to use. If none is provided, the default is a temporary + * read-only transaction with strong concurrency. + */ + transaction: Schema$TransactionSelector; } - - /** - * spanner.projects.instances.databases.sessions.beginTransaction - * @desc Begins a new transaction. This step can often be skipped: Read, - * ExecuteSql and Commit can begin a new transaction as a side-effect. - * @alias spanner.projects.instances.databases.sessions.beginTransaction - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the transaction runs. - * @param {().BeginTransactionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - beginTransaction(params?: any, options?: MethodOptions): - AxiosPromise; - beginTransaction( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - beginTransaction( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:beginTransaction') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Message type to initiate a read-write transaction. Currently this + * transaction type has no options. + */ + export interface Schema$ReadWrite {} + /** + * Results from Read or ExecuteSql. + */ + export interface Schema$ResultSet { + /** + * Metadata about the result set, such as row type information. + */ + metadata: Schema$ResultSetMetadata; + /** + * Each element in `rows` is a row whose format is defined by + * metadata.row_type. The ith element in each row matches the ith field in + * metadata.row_type. Elements are encoded based on type as described here. + */ + rows: any[][]; + /** + * Query plan and execution statistics for the SQL statement that produced + * this result set. These can be requested by setting + * ExecuteSqlRequest.query_mode. + */ + stats: Schema$ResultSetStats; } - - /** - * spanner.projects.instances.databases.sessions.commit - * @desc Commits a transaction. The request includes the mutations to be - * applied to rows in the database. `Commit` might return an `ABORTED` error. - * This can occur at any time; commonly, the cause is conflicts with - * concurrent transactions. However, it can also happen for a variety of other - * reasons. If `Commit` returns `ABORTED`, the caller should re-attempt the - * transaction from the beginning, re-using the same session. - * @alias spanner.projects.instances.databases.sessions.commit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the transaction to be committed is running. - * @param {().CommitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - commit(params?: any, options?: MethodOptions): - AxiosPromise; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - commit( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:commit') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Metadata about a ResultSet or PartialResultSet. + */ + export interface Schema$ResultSetMetadata { + /** + * Indicates the field names and types for the rows in the result set. For + * example, a SQL query like `"SELECT UserId, UserName FROM + * Users"` could return a `row_type` value like: "fields": [ + * { "name": "UserId", "type": { + * "code": "INT64" } }, { "name": + * "UserName", "type": { "code": + * "STRING" } }, ] + */ + rowType: Schema$StructType; + /** + * If the read or SQL query began a transaction as a side-effect, the + * information about the new transaction is yielded here. + */ + transaction: Schema$Transaction; } - - /** - * spanner.projects.instances.databases.sessions.create - * @desc Creates a new session. A session can be used to perform transactions - * that read and/or modify data in a Cloud Spanner database. Sessions are - * meant to be reused for many consecutive transactions. Sessions can only - * execute one transaction at a time. To execute multiple concurrent - * read-write/write-only transactions, create multiple sessions. Note that - * standalone reads and queries use a transaction internally, and count toward - * the one transaction limit. Cloud Spanner limits the number of sessions - * that can exist at any given time; thus, it is a good idea to delete idle - * and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can - * delete sessions for which no operations are sent for more than an hour. If - * a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can - * be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT - * 1"`. - * @alias spanner.projects.instances.databases.sessions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Required. The database in which the new session is created. - * @param {().CreateSessionRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+database}/sessions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Additional statistics about a ResultSet or PartialResultSet. + */ + export interface Schema$ResultSetStats { + /** + * QueryPlan for the query associated with this result. + */ + queryPlan: Schema$QueryPlan; + /** + * Aggregated statistics from the execution of the query. Only present when + * the query is profiled. For example, a query could return the statistics + * as follows: { "rows_returned": "3", + * "elapsed_time": "1.22 secs", "cpu_time": + * "1.19 secs" } + */ + queryStats: any; } - - /** - * spanner.projects.instances.databases.sessions.delete - * @desc Ends a session, releasing server resources associated with it. - * @alias spanner.projects.instances.databases.sessions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the session to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The request for Rollback. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RollbackRequest { + /** + * Required. The transaction to roll back. + */ + transactionId: string; } - - /** - * spanner.projects.instances.databases.sessions.executeSql - * @desc Executes an SQL statement, returning all results in a single reply. - * This method cannot be used to return a result set larger than 10 MiB; if - * the query yields more data than that, the query fails with a - * `FAILED_PRECONDITION` error. Operations inside read-write transactions - * might return `ABORTED`. If this occurs, the application should restart the - * transaction from the beginning. See Transaction for more details. Larger - * result sets can be fetched in streaming fashion by calling - * ExecuteStreamingSql instead. - * @alias spanner.projects.instances.databases.sessions.executeSql - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the SQL query should be performed. - * @param {().ExecuteSqlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - executeSql(params?: any, options?: MethodOptions): - AxiosPromise; - executeSql( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - executeSql( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:executeSql') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A session in the Cloud Spanner API. + */ + export interface Schema$Session { + /** + * Output only. The approximate timestamp when the session is last used. It + * is typically earlier than the actual last use time. + */ + approximateLastUseTime: string; + /** + * Output only. The timestamp when the session is created. + */ + createTime: string; + /** + * The labels for the session. * Label keys must be between 1 and 63 + * characters long and must conform to the following regular expression: + * `[a-z]([-a-z0-9]*[a-z0-9])?`. * Label values must be between 0 and 63 + * characters long and must conform to the regular expression + * `([a-z]([-a-z0-9]*[a-z0-9])?)?`. * No more than 64 labels can be + * associated with a given session. See https://goo.gl/xmQnxf for more + * information on and examples of labels. + */ + labels: any; + /** + * The name of the session. This is always system-assigned; values provided + * when creating a session are ignored. + */ + name: string; } - - /** - * spanner.projects.instances.databases.sessions.executeStreamingSql - * @desc Like ExecuteSql, except returns the result set as a stream. Unlike - * ExecuteSql, there is no limit on the size of the returned result set. - * However, no individual row in the result set can exceed 100 MiB, and no - * column value can exceed 10 MiB. - * @alias spanner.projects.instances.databases.sessions.executeStreamingSql - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the SQL query should be performed. - * @param {().ExecuteSqlRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `SetIamPolicy` method. */ - executeStreamingSql(params?: any, options?: MethodOptions): - AxiosPromise; - executeStreamingSql( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - executeStreamingSql( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:executeStreamingSql') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SetIamPolicyRequest { + /** + * REQUIRED: The complete policy to be applied to the `resource`. The size + * of the policy is limited to a few 10s of KB. An empty policy is a valid + * policy but certain Cloud Platform services (such as Projects) might + * reject them. + */ + policy: Schema$Policy; } - - /** - * spanner.projects.instances.databases.sessions.get - * @desc Gets a session. Returns `NOT_FOUND` if the session does not exist. - * This is mainly useful for determining whether a session is still alive. - * @alias spanner.projects.instances.databases.sessions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Required. The name of the session to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Condensed representation of a node and its subtree. Only present for + * `SCALAR` PlanNode(s). + */ + export interface Schema$ShortRepresentation { + /** + * A string representation of the expression subtree rooted at this node. + */ + description: string; + /** + * A mapping of (subquery variable name) -> (subquery node id) for cases + * where the `description` string of this node references a `SCALAR` + * subquery contained in the expression subtree rooted at this node. The + * referenced `SCALAR` subquery may not necessarily be a direct child of + * this node. + */ + subqueries: any; } - - /** - * spanner.projects.instances.databases.sessions.list - * @desc Lists all sessions in a given database. - * @alias spanner.projects.instances.databases.sessions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Required. The database in which to list sessions. - * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: * `labels.key` where key is the name of a label Some examples of using filters are: * `labels.env:*` --> The session has the label "env". * `labels.env:dev` --> The session has the label "env" and the value of the label contains the string "dev". - * @param {integer=} params.pageSize Number of sessions to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. - * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListSessionsResponse. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+database}/sessions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['database'], - pathParams: ['database'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * spanner.projects.instances.databases.sessions.partitionQuery - * @desc Creates a set of partition tokens that can be used to execute a query - * operation in parallel. Each of the returned partition tokens can be used - * by ExecuteStreamingSql to specify a subset of the query result to read. The - * same session and read-only transaction must be used by the - * PartitionQueryRequest used to create the partition tokens and the - * ExecuteSqlRequests that use the partition tokens. Partition tokens become - * invalid when the session used to create them is deleted or begins a new - * transaction. - * @alias spanner.projects.instances.databases.sessions.partitionQuery - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session used to create the partitions. - * @param {().PartitionQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - partitionQuery(params?: any, options?: MethodOptions): - AxiosPromise; - partitionQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - partitionQuery( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:partitionQuery') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * `StructType` defines the fields of a STRUCT type. + */ + export interface Schema$StructType { + /** + * The list of fields that make up this struct. Order is significant, + * because values of this struct type are represented as lists, where the + * order of field values matches the order of fields in the StructType. In + * turn, the order of fields matches the order of columns in a read request, + * or the order of fields in the `SELECT` clause of a query. + */ + fields: Schema$Field[]; } - - /** - * spanner.projects.instances.databases.sessions.partitionRead - * @desc Creates a set of partition tokens that can be used to execute a read - * operation in parallel. Each of the returned partition tokens can be used - * by StreamingRead to specify a subset of the read result to read. The same - * session and read-only transaction must be used by the PartitionReadRequest - * used to create the partition tokens and the ReadRequests that use the - * partition tokens. Partition tokens become invalid when the session used to - * create them is deleted or begins a new transaction. - * @alias spanner.projects.instances.databases.sessions.partitionRead - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session used to create the partitions. - * @param {().PartitionReadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for `TestIamPermissions` method. */ - partitionRead(params?: any, options?: MethodOptions): - AxiosPromise; - partitionRead( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - partitionRead( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:partitionRead') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsRequest { + /** + * REQUIRED: The set of permissions to check for 'resource'. + * Permissions with wildcards (such as '*', 'spanner.*', + * 'spanner.instances.*') are not allowed. + */ + permissions: string[]; } - - /** - * spanner.projects.instances.databases.sessions.read - * @desc Reads rows from the database using key lookups and scans, as a simple - * key/value style alternative to ExecuteSql. This method cannot be used to - * return a result set larger than 10 MiB; if the read matches more data than - * that, the read fails with a `FAILED_PRECONDITION` error. Reads inside - * read-write transactions might return `ABORTED`. If this occurs, the - * application should restart the transaction from the beginning. See - * Transaction for more details. Larger result sets can be yielded in - * streaming fashion by calling StreamingRead instead. - * @alias spanner.projects.instances.databases.sessions.read - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the read should be performed. - * @param {().ReadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Response message for `TestIamPermissions` method. */ - read(params?: any, options?: MethodOptions): AxiosPromise; - read( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - read( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/{+session}:read').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestIamPermissionsResponse { + /** + * A subset of `TestPermissionsRequest.permissions` that the caller is + * allowed. + */ + permissions: string[]; } - - /** - * spanner.projects.instances.databases.sessions.rollback - * @desc Rolls back a transaction, releasing any locks it holds. It is a good - * idea to call this for any transaction that includes one or more Read or - * ExecuteSql requests and ultimately decides not to commit. `Rollback` - * returns `OK` if it successfully aborts the transaction, the transaction was - * already aborted, or the transaction is not found. `Rollback` never returns - * `ABORTED`. - * @alias spanner.projects.instances.databases.sessions.rollback - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the transaction to roll back is running. - * @param {().RollbackRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rollback(params?: any, options?: MethodOptions): AxiosPromise; - rollback( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rollback( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:rollback') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A transaction. + */ + export interface Schema$Transaction { + /** + * `id` may be used to identify the transaction in subsequent Read, + * ExecuteSql, Commit, or Rollback calls. Single-use read-only transactions + * do not have IDs, because single-use transactions do not support multiple + * requests. + */ + id: string; + /** + * For snapshot read-only transactions, the read timestamp chosen for the + * transaction. Not returned by default: see + * TransactionOptions.ReadOnly.return_read_timestamp. A timestamp in + * RFC3339 UTC \"Zulu\" format, accurate to nanoseconds. Example: + * `"2014-10-02T15:01:23.045123456Z"`. + */ + readTimestamp: string; } - - /** - * spanner.projects.instances.databases.sessions.streamingRead - * @desc Like Read, except returns the result set as a stream. Unlike Read, - * there is no limit on the size of the returned result set. However, no - * individual row in the result set can exceed 100 MiB, and no column value - * can exceed 10 MiB. - * @alias spanner.projects.instances.databases.sessions.streamingRead - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.session Required. The session in which the read should be performed. - * @param {().ReadRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - streamingRead(params?: any, options?: MethodOptions): - AxiosPromise; - streamingRead( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - streamingRead( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+session}:streamingRead') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['session'], - pathParams: ['session'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * # Transactions Each session can have at most one active transaction at a + * time. After the active transaction is completed, the session can + * immediately be re-used for the next transaction. It is not necessary to + * create a new session for each transaction. # Transaction Modes Cloud + * Spanner supports two transaction modes: 1. Locking read-write. This type + * of transaction is the only way to write data into Cloud Spanner. These + * transactions rely on pessimistic locking and, if necessary, two-phase + * commit. Locking read-write transactions may abort, requiring the + * application to retry. 2. Snapshot read-only. This transaction type + * provides guaranteed consistency across several reads, but does not + * allow writes. Snapshot read-only transactions can be configured to + * read at timestamps in the past. Snapshot read-only transactions do not + * need to be committed. For transactions that only read, snapshot read-only + * transactions provide simpler semantics and are almost always faster. In + * particular, read-only transactions do not take locks, so they do not + * conflict with read-write transactions. As a consequence of not taking + * locks, they also do not abort, so retry loops are not needed. Transactions + * may only read/write data in a single database. They may, however, + * read/write data in different tables within that database. ## Locking + * Read-Write Transactions Locking transactions may be used to atomically + * read-modify-write data anywhere in a database. This type of transaction is + * externally consistent. Clients should attempt to minimize the amount of + * time a transaction is active. Faster transactions commit with higher + * probability and cause less contention. Cloud Spanner attempts to keep read + * locks active as long as the transaction continues to do reads, and the + * transaction has not been terminated by Commit or Rollback. Long periods of + * inactivity at the client may cause Cloud Spanner to release a + * transaction's locks and abort it. Reads performed within a transaction + * acquire locks on the data being read. Writes can only be done at commit + * time, after all reads have been completed. Conceptually, a read-write + * transaction consists of zero or more reads or SQL queries followed by + * Commit. At any time before Commit, the client can send a Rollback request + * to abort the transaction. ### Semantics Cloud Spanner can commit the + * transaction if all read locks it acquired are still valid at commit time, + * and it is able to acquire write locks for all writes. Cloud Spanner can + * abort the transaction for any reason. If a commit attempt returns + * `ABORTED`, Cloud Spanner guarantees that the transaction has not modified + * any user data in Cloud Spanner. Unless the transaction commits, Cloud + * Spanner makes no guarantees about how long the transaction's locks were + * held for. It is an error to use Cloud Spanner locks for any sort of mutual + * exclusion other than between Cloud Spanner transactions themselves. ### + * Retrying Aborted Transactions When a transaction aborts, the application + * can choose to retry the whole transaction again. To maximize the chances of + * successfully committing the retry, the client should execute the retry in + * the same session as the original attempt. The original session's lock + * priority increases with each consecutive abort, meaning that each attempt + * has a slightly better chance of success than the previous. Under some + * circumstances (e.g., many transactions attempting to modify the same + * row(s)), a transaction can abort many times in a short period before + * successfully committing. Thus, it is not a good idea to cap the number of + * retries a transaction can attempt; instead, it is better to limit the total + * amount of wall time spent retrying. ### Idle Transactions A transaction + * is considered idle if it has no outstanding reads or SQL queries and has + * not started a read or SQL query within the last 10 seconds. Idle + * transactions can be aborted by Cloud Spanner so that they don't hold on + * to locks indefinitely. In that case, the commit will fail with error + * `ABORTED`. If this behavior is undesirable, periodically executing a + * simple SQL query in the transaction (e.g., `SELECT 1`) prevents the + * transaction from becoming idle. ## Snapshot Read-Only Transactions + * Snapshot read-only transactions provides a simpler method than locking + * read-write transactions for doing several consistent reads. However, this + * type of transaction does not support writes. Snapshot transactions do not + * take locks. Instead, they work by choosing a Cloud Spanner timestamp, then + * executing all reads at that timestamp. Since they do not acquire locks, + * they do not block concurrent read-write transactions. Unlike locking + * read-write transactions, snapshot read-only transactions never abort. They + * can fail if the chosen read timestamp is garbage collected; however, the + * default garbage collection policy is generous enough that most applications + * do not need to worry about this in practice. Snapshot read-only + * transactions do not need to call Commit or Rollback (and in fact are not + * permitted to do so). To execute a snapshot transaction, the client + * specifies a timestamp bound, which tells Cloud Spanner how to choose a read + * timestamp. The types of timestamp bound are: - Strong (the default). - + * Bounded staleness. - Exact staleness. If the Cloud Spanner database to + * be read is geographically distributed, stale read-only transactions can + * execute more quickly than strong or read-write transaction, because they + * are able to execute far from the leader replica. Each type of timestamp + * bound is discussed in detail below. ### Strong Strong reads are + * guaranteed to see the effects of all transactions that have committed + * before the start of the read. Furthermore, all rows yielded by a single + * read are consistent with each other -- if any part of the read observes a + * transaction, all parts of the read see the transaction. Strong reads are + * not repeatable: two consecutive strong read-only transactions might return + * inconsistent results if there are concurrent writes. If consistency across + * reads is required, the reads should be executed within a transaction or at + * an exact read timestamp. See TransactionOptions.ReadOnly.strong. ### + * Exact Staleness These timestamp bounds execute reads at a user-specified + * timestamp. Reads at a timestamp are guaranteed to see a consistent prefix + * of the global transaction history: they observe modifications done by all + * transactions with a commit timestamp <= the read timestamp, and observe + * none of the modifications done by transactions with a larger commit + * timestamp. They will block until all conflicting transactions that may be + * assigned commit timestamps <= the read timestamp have finished. The + * timestamp can either be expressed as an absolute Cloud Spanner commit + * timestamp or a staleness relative to the current time. These modes do not + * require a "negotiation phase" to pick a timestamp. As a result, + * they execute slightly faster than the equivalent boundedly stale + * concurrency modes. On the other hand, boundedly stale reads usually return + * fresher results. See TransactionOptions.ReadOnly.read_timestamp and + * TransactionOptions.ReadOnly.exact_staleness. ### Bounded Staleness Bounded + * staleness modes allow Cloud Spanner to pick the read timestamp, subject to + * a user-provided staleness bound. Cloud Spanner chooses the newest timestamp + * within the staleness bound that allows execution of the reads at the + * closest available replica without blocking. All rows yielded are + * consistent with each other -- if any part of the read observes a + * transaction, all parts of the read see the transaction. Boundedly stale + * reads are not repeatable: two stale reads, even if they use the same + * staleness bound, can execute at different timestamps and thus return + * inconsistent results. Boundedly stale reads execute in two phases: the + * first phase negotiates a timestamp among all replicas needed to serve the + * read. In the second phase, reads are executed at the negotiated timestamp. + * As a result of the two phase execution, bounded staleness reads are usually + * a little slower than comparable exact staleness reads. However, they are + * typically able to return fresher results, and are more likely to execute at + * the closest replica. Because the timestamp negotiation requires up-front + * knowledge of which rows will be read, it can only be used with single-use + * read-only transactions. See TransactionOptions.ReadOnly.max_staleness and + * TransactionOptions.ReadOnly.min_read_timestamp. ### Old Read Timestamps + * and Garbage Collection Cloud Spanner continuously garbage collects deleted + * and overwritten data in the background to reclaim storage space. This + * process is known as "version GC". By default, version GC reclaims + * versions after they are one hour old. Because of this, Cloud Spanner cannot + * perform reads at read timestamps more than one hour in the past. This + * restriction also applies to in-progress reads and/or SQL queries whose + * timestamp become too old while executing. Reads and SQL queries with + * too-old read timestamps fail with the error `FAILED_PRECONDITION`. ## + */ + export interface Schema$TransactionOptions { + /** + * Transaction will not write. Authorization to begin a read-only + * transaction requires `spanner.databases.beginReadOnlyTransaction` + * permission on the `session` resource. + */ + readOnly: Schema$ReadOnly; + /** + * Transaction may write. Authorization to begin a read-write transaction + * requires `spanner.databases.beginOrRollbackReadWriteTransaction` + * permission on the `session` resource. + */ + readWrite: Schema$ReadWrite; } -} - - -export class Resource$Projects$Instances$Operations { - root: Spanner; - constructor(root: Spanner) { - this.root = root; - this.getRoot.bind(this); + /** + * This message is used to select the transaction in which a Read or + * ExecuteSql call runs. See TransactionOptions for more information about + * transactions. + */ + export interface Schema$TransactionSelector { + /** + * Begin a new transaction and execute this read or SQL query in it. The + * transaction ID of the new transaction is returned in + * ResultSetMetadata.transaction, which is a Transaction. + */ + begin: Schema$TransactionOptions; + /** + * Execute the read or SQL query in a previously-started transaction. + */ + id: string; + /** + * Execute the read or SQL query in a temporary transaction. This is the + * most efficient way to execute a transaction that consists of a single SQL + * query. + */ + singleUse: Schema$TransactionOptions; } - - getRoot() { - return this.root; + /** + * `Type` indicates the type of a Cloud Spanner value, as might be stored in a + * table cell or returned from an SQL query. + */ + export interface Schema$Type { + /** + * If code == ARRAY, then `array_element_type` is the type of the array + * elements. + */ + arrayElementType: Schema$Type; + /** + * Required. The TypeCode for this type. + */ + code: string; + /** + * If code == STRUCT, then `struct_type` provides type information for the + * struct's fields. + */ + structType: Schema$StructType; } - - /** - * spanner.projects.instances.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias spanner.projects.instances.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + * Metadata type for the operation returned by UpdateDatabaseDdl. + */ + export interface Schema$UpdateDatabaseDdlMetadata { + /** + * Reports the commit timestamps of all statements that have succeeded so + * far, where `commit_timestamps[i]` is the commit timestamp for the + * statement `statements[i]`. + */ + commitTimestamps: string[]; + /** + * The database being modified. + */ + database: string; + /** + * For an update this list contains all the statements. For an individual + * statement, this list contains only that statement. + */ + statements: string[]; + } + /** + * Enqueues the given DDL statements to be applied, in order but not + * necessarily all at once, to the database schema at some point (or points) + * in the future. The server checks that the statements are executable + * (syntactically valid, name tables that exist, etc.) before enqueueing them, + * but they may still fail upon later execution (e.g., if a statement from + * another batch of statements is applied first and it conflicts in some way, + * or if there is some data-related problem like a `NULL` value in a column to + * which `NOT NULL` would be added). If a statement fails, all subsequent + * statements in the batch are automatically cancelled. Each batch of + * statements is assigned a name which can be used with the Operations API to + * monitor progress. See the operation_id field for more details. + */ + export interface Schema$UpdateDatabaseDdlRequest { + /** + * If empty, the new update request is assigned an automatically-generated + * operation ID. Otherwise, `operation_id` is used to construct the name of + * the resulting Operation. Specifying an explicit operation ID simplifies + * determining whether the statements were executed in the event that the + * UpdateDatabaseDdl call is replayed, or the return value is otherwise + * lost: the database and `operation_id` fields can be combined to form the + * name of the resulting longrunning.Operation: + * `<database>/operations/<operation_id>`. `operation_id` + * should be unique within the database, and must be a valid identifier: + * `a-z*`. Note that automatically-generated operation IDs always begin with + * an underscore. If the named operation already exists, UpdateDatabaseDdl + * returns `ALREADY_EXISTS`. + */ + operationId: string; + /** + * DDL statements to be applied to the database. + */ + statements: string[]; + } + /** + * Metadata type for the operation returned by UpdateInstance. + */ + export interface Schema$UpdateInstanceMetadata { + /** + * The time at which this operation was cancelled. If set, this operation is + * in the process of undoing itself (which is guaranteed to succeed) and + * cannot be cancelled again. + */ + cancelTime: string; + /** + * The time at which this operation failed or was completed successfully. + */ + endTime: string; + /** + * The desired end state of the update. + */ + instance: Schema$Instance; + /** + * The time at which UpdateInstance request was received. + */ + startTime: string; + } + /** + * The request for UpdateInstance. + */ + export interface Schema$UpdateInstanceRequest { + /** + * Required. A mask specifying which fields in + * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.instance] + * should be updated. The field mask must always be specified; this prevents + * any future fields in [][google.spanner.admin.instance.v1.Instance] from + * being erased accidentally by clients that do not know about them. + */ + fieldMask: string; + /** + * Required. The instance to update, which must always include the instance + * name. Otherwise, only fields mentioned in + * [][google.spanner.admin.instance.v1.UpdateInstanceRequest.field_mask] + * need be included. + */ + instance: Schema$Instance; + } + /** + * Arguments to insert, update, insert_or_update, and replace operations. + */ + export interface Schema$Write { + /** + * The names of the columns in table to be written. The list of columns + * must contain enough columns to allow Cloud Spanner to derive values for + * all primary key columns in the row(s) to be modified. + */ + columns: string[]; + /** + * Required. The table whose rows will be written. + */ + table: string; + /** + * The values to be written. `values` can contain more than one list of + * values. If it does, then multiple rows are written, one for each entry in + * `values`. Each list in `values` must have exactly as many entries as + * there are entries in columns above. Sending multiple lists is equivalent + * to sending multiple `Mutation`s, each containing one `values` entry and + * repeating table and columns. Individual values in each list are encoded + * as described here. + */ + values: any[][]; + } + + export class Resource$Projects { + root: Spanner; + instanceConfigs: Resource$Projects$Instanceconfigs; + instances: Resource$Projects$Instances; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + this.instanceConfigs = new Resource$Projects$Instanceconfigs(root); + this.instances = new Resource$Projects$Instances(root); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Instanceconfigs { + root: Spanner; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instanceConfigs.get + * @desc Gets information about a particular instance configuration. + * @alias spanner.projects.instanceConfigs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the requested instance configuration. Values are of the form `projects//instanceConfigs/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instanceConfigs.list + * @desc Lists the supported instance configurations for a given project. + * @alias spanner.projects.instanceConfigs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Number of instance configurations to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. + * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListInstanceConfigsResponse. + * @param {string} params.parent Required. The name of the project for which a list of supported instance configurations is requested. Values are of the form `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/instanceConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * spanner.projects.instances.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias spanner.projects.instances.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Instances { + root: Spanner; + databases: Resource$Projects$Instances$Databases; + operations: Resource$Projects$Instances$Operations; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + this.databases = new Resource$Projects$Instances$Databases(root); + this.operations = new Resource$Projects$Instances$Operations(root); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instances.create + * @desc Creates an instance and begins preparing it to begin serving. The + * returned long-running operation can be used to track the progress of + * preparing the new instance. The instance name is assigned by the caller. + * If the named instance already exists, `CreateInstance` returns + * `ALREADY_EXISTS`. Immediately upon completion of this request: * The + * instance is readable via the API, with all requested attributes but + * no allocated resources. Its state is `CREATING`. Until completion of the + * returned operation: * Cancelling the operation renders the instance + * immediately unreadable via the API. * The instance can be deleted. + * * All other attempts to modify the instance are rejected. Upon + * completion of the returned operation: * Billing for all + * successfully-allocated resources begins (some types may have lower + * than the requested levels). * Databases can be created in the instance. + * * The instance's allocated resource levels are readable via the API. * + * The instance's state becomes `READY`. The returned long-running + * operation will have a name of the format + * `/operations/` and can be used to track + * creation of the instance. The metadata field type is + * CreateInstanceMetadata. The response field type is Instance, if + * successful. + * @alias spanner.projects.instances.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the project in which to create the instance. Values are of the form `projects/`. + * @param {().CreateInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.delete + * @desc Deletes an instance. Immediately upon completion of the request: + * * Billing ceases for all of the instance's reserved resources. Soon + * afterward: * The instance and *all of its databases* immediately and + * irrevocably disappear from the API. All data in the databases is + * permanently deleted. + * @alias spanner.projects.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the instance to be deleted. Values are of the form `projects//instances/` + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.get + * @desc Gets information about a particular instance. + * @alias spanner.projects.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the requested instance. Values are of the form `projects//instances/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.getIamPolicy + * @desc Gets the access control policy for an instance resource. Returns an + * empty policy if an instance exists but does not have a policy set. + * Authorization requires `spanner.instances.getIamPolicy` on resource. + * @alias spanner.projects.instances.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.list + * @desc Lists all instances in the given project. + * @alias spanner.projects.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: * `name` * `display_name` * `labels.key` where key is the name of a label Some examples of using filters are: * `name:*` --> The instance has a name. * `name:Howl` --> The instance's name contains the string "howl". * `name:HOWL` --> Equivalent to above. * `NAME:howl` --> Equivalent to above. * `labels.env:*` --> The instance has the label "env". * `labels.env:dev` --> The instance has the label "env" and the value of the label contains the string "dev". * `name:howl labels.env:dev` --> The instance's name contains "howl" and it has the label "env" with its value containing "dev". + * @param {integer=} params.pageSize Number of instances to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. + * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListInstancesResponse. + * @param {string} params.parent Required. The name of the project for which a list of instances is requested. Values are of the form `projects/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.patch + * @desc Updates an instance, and begins allocating or releasing resources + * as requested. The returned long-running operation can be used to track + * the progress of updating the instance. If the named instance does not + * exist, returns `NOT_FOUND`. Immediately upon completion of this request: + * * For resource types for which a decrease in the instance's allocation + * has been requested, billing is based on the newly-requested level. Until + * completion of the returned operation: * Cancelling the operation sets + * its metadata's cancel_time, and begins restoring resources to + * their pre-request values. The operation is guaranteed to succeed at + * undoing all resource changes, after which point it terminates with a + * `CANCELLED` status. * All other attempts to modify the instance are + * rejected. * Reading the instance via the API continues to give the + * pre-request resource levels. Upon completion of the returned + * operation: * Billing begins for all successfully-allocated resources + * (some types may have lower than the requested levels). * All + * newly-reserved resources are available for serving the instance's tables. + * * The instance's new resource levels are readable via the API. The + * returned long-running operation will have a name of the format + * `/operations/` and can be used to track the + * instance modification. The metadata field type is + * UpdateInstanceMetadata. The response field type is Instance, if + * successful. Authorization requires `spanner.instances.update` permission + * on resource name. + * @alias spanner.projects.instances.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. A unique identifier for the instance, which cannot be changed after the instance is created. Values are of the form `projects//instances/a-z*[a-z0-9]`. The final segment of the name must be between 6 and 30 characters in length. + * @param {().UpdateInstanceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.setIamPolicy + * @desc Sets the access control policy on an instance resource. Replaces + * any existing policy. Authorization requires + * `spanner.instances.setIamPolicy` on resource. + * @alias spanner.projects.instances.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.testIamPermissions + * @desc Returns permissions that the caller has on the specified instance + * resource. Attempting this RPC on a non-existent Cloud Spanner instance + * resource will result in a NOT_FOUND error if the user has + * `spanner.instances.list` permission on the containing Google Cloud + * Project. Otherwise returns an empty set of permissions. + * @alias spanner.projects.instances.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Instances$Databases { + root: Spanner; + operations: Resource$Projects$Instances$Databases$Operations; + sessions: Resource$Projects$Instances$Databases$Sessions; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + this.operations = + new Resource$Projects$Instances$Databases$Operations(root); + this.sessions = new Resource$Projects$Instances$Databases$Sessions(root); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instances.databases.create + * @desc Creates a new Cloud Spanner database and starts to prepare it for + * serving. The returned long-running operation will have a name of the + * format `/operations/` and can be used to + * track preparation of the database. The metadata field type is + * CreateDatabaseMetadata. The response field type is Database, if + * successful. + * @alias spanner.projects.instances.databases.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The name of the instance that will serve the new database. Values are of the form `projects//instances/`. + * @param {().CreateDatabaseRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/databases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.dropDatabase + * @desc Drops (aka deletes) a Cloud Spanner database. + * @alias spanner.projects.instances.databases.dropDatabase + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Required. The database to be dropped. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + dropDatabase(params?: any, options?: MethodOptions): + AxiosPromise; + dropDatabase( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + dropDatabase( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+database}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.get + * @desc Gets the state of a Cloud Spanner database. + * @alias spanner.projects.instances.databases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the requested database. Values are of the form `projects//instances//databases/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.getDdl + * @desc Returns the schema of a Cloud Spanner database as a list of + * formatted DDL statements. This method does not show pending schema + * updates, those may be queried using the Operations API. + * @alias spanner.projects.instances.databases.getDdl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Required. The database whose schema we wish to get. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getDdl(params?: any, options?: MethodOptions): + AxiosPromise; + getDdl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getDdl( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+database}/ddl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.getIamPolicy + * @desc Gets the access control policy for a database resource. Returns an + * empty policy if a database exists but does not have a policy set. + * Authorization requires `spanner.databases.getIamPolicy` permission on + * resource. + * @alias spanner.projects.instances.databases.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * @param {().GetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:getIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.list + * @desc Lists Cloud Spanner databases. + * @alias spanner.projects.instances.databases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize Number of databases to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. + * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListDatabasesResponse. + * @param {string} params.parent Required. The instance whose databases should be listed. Values are of the form `projects//instances/`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/databases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.setIamPolicy + * @desc Sets the access control policy on a database resource. Replaces any + * existing policy. Authorization requires `spanner.databases.setIamPolicy` + * permission on resource. + * @alias spanner.projects.instances.databases.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for databases resources. + * @param {().SetIamPolicyRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:setIamPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.testIamPermissions + * @desc Returns permissions that the caller has on the specified database + * resource. Attempting this RPC on a non-existent Cloud Spanner database + * will result in a NOT_FOUND error if the user has `spanner.databases.list` + * permission on the containing Cloud Spanner instance. Otherwise returns an + * empty set of permissions. + * @alias spanner.projects.instances.databases.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resource_ REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is `projects//instances/` for instance resources and `projects//instances//databases/` for database resources. + * @param {().TestIamPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+resource}:testIamPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resource'], + pathParams: ['resource'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.updateDdl + * @desc Updates the schema of a Cloud Spanner database by + * creating/altering/dropping tables, columns, indexes, etc. The returned + * long-running operation will have a name of the format + * `/operations/` and can be used to track + * execution of the schema change(s). The metadata field type is + * UpdateDatabaseDdlMetadata. The operation has no response. + * @alias spanner.projects.instances.databases.updateDdl + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Required. The database to update. + * @param {().UpdateDatabaseDdlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateDdl(params?: any, options?: MethodOptions): + AxiosPromise; + updateDdl( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateDdl( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+database}/ddl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Instances$Databases$Operations { + root: Spanner; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instances.databases.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias spanner.projects.instances.databases.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias spanner.projects.instances.databases.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias spanner.projects.instances.databases.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias spanner.projects.instances.databases.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * spanner.projects.instances.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias spanner.projects.instances.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Instances$Databases$Sessions { + root: Spanner; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instances.databases.sessions.beginTransaction + * @desc Begins a new transaction. This step can often be skipped: Read, + * ExecuteSql and Commit can begin a new transaction as a side-effect. + * @alias spanner.projects.instances.databases.sessions.beginTransaction + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the transaction runs. + * @param {().BeginTransactionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + beginTransaction(params?: any, options?: MethodOptions): + AxiosPromise; + beginTransaction( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + beginTransaction( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:beginTransaction') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.commit + * @desc Commits a transaction. The request includes the mutations to be + * applied to rows in the database. `Commit` might return an `ABORTED` + * error. This can occur at any time; commonly, the cause is conflicts with + * concurrent transactions. However, it can also happen for a variety of + * other reasons. If `Commit` returns `ABORTED`, the caller should + * re-attempt the transaction from the beginning, re-using the same session. + * @alias spanner.projects.instances.databases.sessions.commit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the transaction to be committed is running. + * @param {().CommitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + commit(params?: any, options?: MethodOptions): + AxiosPromise; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + commit( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:commit') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.create + * @desc Creates a new session. A session can be used to perform + * transactions that read and/or modify data in a Cloud Spanner database. + * Sessions are meant to be reused for many consecutive transactions. + * Sessions can only execute one transaction at a time. To execute multiple + * concurrent read-write/write-only transactions, create multiple sessions. + * Note that standalone reads and queries use a transaction internally, and + * count toward the one transaction limit. Cloud Spanner limits the number + * of sessions that can exist at any given time; thus, it is a good idea to + * delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud + * Spanner can delete sessions for which no operations are sent for more + * than an hour. If a session is deleted, requests to it return `NOT_FOUND`. + * Idle sessions can be kept alive by sending a trivial SQL query + * periodically, e.g., `"SELECT 1"`. + * @alias spanner.projects.instances.databases.sessions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Required. The database in which the new session is created. + * @param {().CreateSessionRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+database}/sessions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.delete + * @desc Ends a session, releasing server resources associated with it. + * @alias spanner.projects.instances.databases.sessions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the session to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.executeSql + * @desc Executes an SQL statement, returning all results in a single reply. + * This method cannot be used to return a result set larger than 10 MiB; if + * the query yields more data than that, the query fails with a + * `FAILED_PRECONDITION` error. Operations inside read-write transactions + * might return `ABORTED`. If this occurs, the application should restart + * the transaction from the beginning. See Transaction for more details. + * Larger result sets can be fetched in streaming fashion by calling + * ExecuteStreamingSql instead. + * @alias spanner.projects.instances.databases.sessions.executeSql + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the SQL query should be performed. + * @param {().ExecuteSqlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + executeSql(params?: any, options?: MethodOptions): + AxiosPromise; + executeSql( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + executeSql( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:executeSql') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.executeStreamingSql + * @desc Like ExecuteSql, except returns the result set as a stream. Unlike + * ExecuteSql, there is no limit on the size of the returned result set. + * However, no individual row in the result set can exceed 100 MiB, and no + * column value can exceed 10 MiB. + * @alias spanner.projects.instances.databases.sessions.executeStreamingSql + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the SQL query should be performed. + * @param {().ExecuteSqlRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + executeStreamingSql(params?: any, options?: MethodOptions): + AxiosPromise; + executeStreamingSql( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + executeStreamingSql( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:executeStreamingSql') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.get + * @desc Gets a session. Returns `NOT_FOUND` if the session does not exist. + * This is mainly useful for determining whether a session is still alive. + * @alias spanner.projects.instances.databases.sessions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The name of the session to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.list + * @desc Lists all sessions in a given database. + * @alias spanner.projects.instances.databases.sessions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Required. The database in which to list sessions. + * @param {string=} params.filter An expression for filtering the results of the request. Filter rules are case insensitive. The fields eligible for filtering are: * `labels.key` where key is the name of a label Some examples of using filters are: * `labels.env:*` --> The session has the label "env". * `labels.env:dev` --> The session has the label "env" and the value of the label contains the string "dev". + * @param {integer=} params.pageSize Number of sessions to be returned in the response. If 0 or less, defaults to the server's maximum allowed page size. + * @param {string=} params.pageToken If non-empty, `page_token` should contain a next_page_token from a previous ListSessionsResponse. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+database}/sessions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['database'], + pathParams: ['database'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.partitionQuery + * @desc Creates a set of partition tokens that can be used to execute a + * query operation in parallel. Each of the returned partition tokens can + * be used by ExecuteStreamingSql to specify a subset of the query result to + * read. The same session and read-only transaction must be used by the + * PartitionQueryRequest used to create the partition tokens and the + * ExecuteSqlRequests that use the partition tokens. Partition tokens become + * invalid when the session used to create them is deleted or begins a new + * transaction. + * @alias spanner.projects.instances.databases.sessions.partitionQuery + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session used to create the partitions. + * @param {().PartitionQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + partitionQuery(params?: any, options?: MethodOptions): + AxiosPromise; + partitionQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + partitionQuery( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:partitionQuery') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.partitionRead + * @desc Creates a set of partition tokens that can be used to execute a + * read operation in parallel. Each of the returned partition tokens can be + * used by StreamingRead to specify a subset of the read result to read. The + * same session and read-only transaction must be used by the + * PartitionReadRequest used to create the partition tokens and the + * ReadRequests that use the partition tokens. Partition tokens become + * invalid when the session used to create them is deleted or begins a new + * transaction. + * @alias spanner.projects.instances.databases.sessions.partitionRead + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session used to create the partitions. + * @param {().PartitionReadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + partitionRead(params?: any, options?: MethodOptions): + AxiosPromise; + partitionRead( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + partitionRead( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:partitionRead') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.read + * @desc Reads rows from the database using key lookups and scans, as a + * simple key/value style alternative to ExecuteSql. This method cannot be + * used to return a result set larger than 10 MiB; if the read matches more + * data than that, the read fails with a `FAILED_PRECONDITION` error. Reads + * inside read-write transactions might return `ABORTED`. If this occurs, + * the application should restart the transaction from the beginning. See + * Transaction for more details. Larger result sets can be yielded in + * streaming fashion by calling StreamingRead instead. + * @alias spanner.projects.instances.databases.sessions.read + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the read should be performed. + * @param {().ReadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + read(params?: any, options?: MethodOptions): AxiosPromise; + read( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + read( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:read') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.rollback + * @desc Rolls back a transaction, releasing any locks it holds. It is a + * good idea to call this for any transaction that includes one or more Read + * or ExecuteSql requests and ultimately decides not to commit. `Rollback` + * returns `OK` if it successfully aborts the transaction, the transaction + * was already aborted, or the transaction is not found. `Rollback` never + * returns `ABORTED`. + * @alias spanner.projects.instances.databases.sessions.rollback + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the transaction to roll back is running. + * @param {().RollbackRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rollback(params?: any, options?: MethodOptions): AxiosPromise; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rollback( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:rollback') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.databases.sessions.streamingRead + * @desc Like Read, except returns the result set as a stream. Unlike Read, + * there is no limit on the size of the returned result set. However, no + * individual row in the result set can exceed 100 MiB, and no column value + * can exceed 10 MiB. + * @alias spanner.projects.instances.databases.sessions.streamingRead + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.session Required. The session in which the read should be performed. + * @param {().ReadRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + streamingRead(params?: any, options?: MethodOptions): + AxiosPromise; + streamingRead( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + streamingRead( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+session}:streamingRead') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['session'], + pathParams: ['session'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * spanner.projects.instances.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias spanner.projects.instances.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Instances$Operations { + root: Spanner; + constructor(root: Spanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * spanner.projects.instances.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias spanner.projects.instances.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias spanner.projects.instances.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias spanner.projects.instances.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * spanner.projects.instances.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias spanner.projects.instances.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://spanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/spectrum/v1explorer.ts b/src/apis/spectrum/v1explorer.ts index 147ceedc5b8..b531550443c 100644 --- a/src/apis/spectrum/v1explorer.ts +++ b/src/apis/spectrum/v1explorer.ts @@ -27,1448 +27,1467 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Spectrum Database API - * - * API for spectrum-management functions. - * - * @example - * const google = require('googleapis'); - * const spectrum = google.spectrum('v1explorer'); - * - * @namespace spectrum - * @type {Function} - * @version v1explorer - * @variation v1explorer - * @param {object=} options Options for Spectrum - */ -export class Spectrum { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace spectrum_v1explorer { + /** + * Google Spectrum Database API + * + * API for spectrum-management functions. + * + * @example + * const google = require('googleapis'); + * const spectrum = google.spectrum('v1explorer'); + * + * @namespace spectrum + * @type {Function} + * @version v1explorer + * @variation v1explorer + * @param {object=} options Options for Spectrum + */ + export class Spectrum { + _options: GlobalOptions; + google: GoogleApis; + root = this; - paws: Resource$Paws; + paws: Resource$Paws; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.paws = new Resource$Paws(this); - } + this.paws = new Resource$Paws(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Antenna characteristics provide additional information, such as the antenna - * height, antenna type, etc. Whether antenna characteristics must be provided - * in a request depends on the device type and regulatory domain. - */ -export interface Schema$AntennaCharacteristics { - /** - * The antenna height in meters. Whether the antenna height is required - * depends on the device type and the regulatory domain. Note that the height - * may be negative. - */ - height: number; - /** - * If the height is required, then the height type (AGL for above ground level - * or AMSL for above mean sea level) is also required. The default is AGL. - */ - heightType: string; - /** - * The height uncertainty in meters. Whether this is required depends on the - * regulatory domain. - */ - heightUncertainty: number; -} -/** - * This message contains the name and URI of a database. - */ -export interface Schema$DatabaseSpec { - /** - * The display name for a database. - */ - name: string; - /** - * The corresponding URI of the database. - */ - uri: string; -} -/** - * This message is provided by the database to notify devices of an upcoming - * change to the database URI. - */ -export interface Schema$DbUpdateSpec { - /** - * A required list of one or more databases. A device should update its - * preconfigured list of databases to replace (only) the database that - * provided the response with the specified entries. - */ - databases: Schema$DatabaseSpec[]; -} -/** - * Device capabilities provide additional information that may be used by a - * device to provide additional information to the database that may help it to - * determine available spectrum. If the database does not support device - * capabilities it will ignore the parameter altogether. - */ -export interface Schema$DeviceCapabilities { - /** - * An optional list of frequency ranges supported by the device. Each element - * must contain start and stop frequencies in which the device can operate. - * Channel identifiers are optional. When specified, the database should not - * return available spectrum that falls outside these ranges or channel IDs. - */ - frequencyRanges: Schema$FrequencyRange[]; -} -/** - * The device descriptor contains parameters that identify the specific device, - * such as its manufacturer serial number, regulatory-specific identifier (e.g., - * FCC ID), and any other device characteristics required by regulatory domains. - */ -export interface Schema$DeviceDescriptor { - /** - * Specifies the ETSI white space device category. Valid values are the - * strings master and slave. This field is case-insensitive. Consult the ETSI - * documentation for details about the device types. - */ - etsiEnDeviceCategory: string; - /** - * Specifies the ETSI white space device emissions class. The values are - * represented by numeric strings, such as 1, 2, etc. Consult the ETSI - * documentation for details about the device types. - */ - etsiEnDeviceEmissionsClass: string; - /** - * Specifies the ETSI white space device type. Valid values are single-letter - * strings, such as A, B, etc. Consult the ETSI documentation for details - * about the device types. - */ - etsiEnDeviceType: string; - /** - * Specifies the ETSI white space device technology identifier. The string - * value must not exceed 64 characters in length. Consult the ETSI - * documentation for details about the device types. - */ - etsiEnTechnologyId: string; - /** - * Specifies the device's FCC certification identifier. The value is an - * identifier string whose length should not exceed 32 characters. Note that, - * in practice, a valid FCC ID may be limited to 19 characters. - */ - fccId: string; - /** - * Specifies the TV Band White Space device type, as defined by the FCC. Valid - * values are FIXED, MODE_1, MODE_2. - */ - fccTvbdDeviceType: string; - /** - * The manufacturer's ID may be required by the regulatory domain. This - * should represent the name of the device manufacturer, should be consistent - * across all devices from the same manufacturer, and should be distinct from - * that of other manufacturers. The string value must not exceed 64 characters - * in length. - */ - manufacturerId: string; - /** - * The device's model ID may be required by the regulatory domain. The - * string value must not exceed 64 characters in length. - */ - modelId: string; - /** - * The list of identifiers for rulesets supported by the device. A database - * may require that the device provide this list before servicing the device - * requests. If the database does not support any of the rulesets specified in - * the list, the database may refuse to service the device requests. If - * present, the list must contain at least one entry. For information about - * the valid requests, see section 9.2 of the PAWS specification. Currently, - * FccTvBandWhiteSpace-2010 is the only supported ruleset. - */ - rulesetIds: string[]; - /** - * The manufacturer's device serial number; required by the applicable - * regulatory domain. The length of the value must not exceed 64 characters. - */ - serialNumber: string; -} -/** - * This parameter contains device-owner information required as part of device - * registration. The regulatory domains may require additional parameters. All - * contact information must be expressed using the structure defined by the - * vCard format specification. Only the contact fields of vCard are supported: - * - fn: Full name of an individual - org: Name of the organization - adr: - * Address fields - tel: Telephone numbers - email: Email addresses Note - * that the vCard specification defines maximum lengths for each field. - */ -export interface Schema$DeviceOwner { - /** - * The vCard contact information for the device operator is optional, but may - * be required by specific regulatory domains. - */ - operator: Schema$Vcard; - /** - * The vCard contact information for the individual or business that owns the - * device is required. - */ - owner: Schema$Vcard; -} -/** - * The device validity element describes whether a particular device is valid to - * operate in the regulatory domain. - */ -export interface Schema$DeviceValidity { - /** - * The descriptor of the device for which the validity check was requested. It - * will always be present. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * The validity status: true if the device is valid for operation, false - * otherwise. It will always be present. - */ - isValid: boolean; - /** - * If the device identifier is not valid, the database may include a reason. - * The reason may be in any language. The length of the value should not - * exceed 128 characters. - */ - reason: string; -} -/** - * The start and stop times of an event. This is used to indicate the time - * period for which a spectrum profile is valid. Both times are expressed using - * the format, YYYY-MM-DDThh:mm:ssZ, as defined in RFC3339. The times must be - * expressed using UTC. - */ -export interface Schema$EventTime { - /** - * The inclusive start of the event. It will be present. - */ - startTime: string; - /** - * The exclusive end of the event. It will be present. - */ - stopTime: string; -} -/** - * A specific range of frequencies together with the associated maximum power - * level and channel identifier. - */ -export interface Schema$FrequencyRange { - /** - * The database may include a channel identifier, when applicable. When it is - * included, the device should treat it as informative. The length of the - * identifier should not exceed 16 characters. - */ - channelId: string; - /** - * The maximum total power level (EIRP)—computed over the corresponding - * operating bandwidth—that is permitted within the frequency range. Depending - * on the context in which the frequency-range element appears, this value may - * be required. For example, it is required in the available-spectrum - * response, available-spectrum-batch response, and spectrum-use notification - * message, but it should not be present (it is not applicable) when the - * frequency range appears inside a device-capabilities message. - */ - maxPowerDBm: number; - /** - * The required inclusive start of the frequency range (in Hertz). - */ - startHz: number; - /** - * The required exclusive end of the frequency range (in Hertz). - */ - stopHz: number; -} -/** - * This parameter is used to specify the geolocation of the device. - */ -export interface Schema$GeoLocation { - /** - * The location confidence level, as an integer percentage, may be required, - * depending on the regulatory domain. When the parameter is optional and not - * provided, its value is assumed to be 95. Valid values range from 0 to 99, - * since, in practice, 100-percent confidence is not achievable. The - * confidence value is meaningful only when geolocation refers to a point with - * uncertainty. - */ - confidence: number; - /** - * If present, indicates that the geolocation represents a point. - * Paradoxically, a point is parameterized using an ellipse, where the center - * represents the location of the point and the distances along the major and - * minor axes represent the uncertainty. The uncertainty values may be - * required, depending on the regulatory domain. - */ - point: Schema$GeoLocationEllipse; - /** - * If present, indicates that the geolocation represents a region. Database - * support for regions is optional. - */ - region: Schema$GeoLocationPolygon; -} -/** - * A "point" with uncertainty is represented using the Ellipse shape. - */ -export interface Schema$GeoLocationEllipse { - /** - * A required geo-spatial point representing the center of the ellipse. - */ - center: Schema$GeoLocationPoint; - /** - * A floating-point number that expresses the orientation of the ellipse, - * representing the rotation, in degrees, of the semi-major axis from North - * towards the East. For example, when the uncertainty is greatest along the - * North-South direction, orientation is 0 degrees; conversely, if the - * uncertainty is greatest along the East-West direction, orientation is 90 - * degrees. When orientation is not present, the orientation is assumed to be - * 0. - */ - orientation: number; - /** - * A floating-point number that expresses the location uncertainty along the - * major axis of the ellipse. May be required by the regulatory domain. When - * the uncertainty is optional, the default value is 0. - */ - semiMajorAxis: number; - /** - * A floating-point number that expresses the location uncertainty along the - * minor axis of the ellipse. May be required by the regulatory domain. When - * the uncertainty is optional, the default value is 0. - */ - semiMinorAxis: number; -} -/** - * A single geolocation on the globe. - */ -export interface Schema$GeoLocationPoint { - /** - * A required floating-point number that expresses the latitude in degrees - * using the WGS84 datum. For details on this encoding, see the National - * Imagery and Mapping Agency's Technical Report TR8350.2. - */ - latitude: number; - /** - * A required floating-point number that expresses the longitude in degrees - * using the WGS84 datum. For details on this encoding, see the National - * Imagery and Mapping Agency's Technical Report TR8350.2. - */ - longitude: number; -} -/** - * A region is represented using the polygonal shape. - */ -export interface Schema$GeoLocationPolygon { - /** - * When the geolocation describes a region, the exterior field refers to a - * list of latitude/longitude points that represent the vertices of a polygon. - * The first and last points must be the same. Thus, a minimum of four points - * is required. The following polygon restrictions from RFC5491 apply: - A - * connecting line shall not cross another connecting line of the same - * polygon. - The vertices must be defined in a counterclockwise order. - - * The edges of a polygon are defined by the shortest path between two points - * in space (not a geodesic curve). Consequently, the length between two - * adjacent vertices should be restricted to a maximum of 130 km. - All - * vertices are assumed to be at the same altitude. - Polygon shapes should - * be restricted to a maximum of 15 vertices (16 points that include the - * repeated vertex). - */ - exterior: Schema$GeoLocationPoint[]; -} -/** - * The schedule of spectrum profiles available at a particular geolocation. - */ -export interface Schema$GeoSpectrumSchedule { - /** - * The geolocation identifies the location at which the spectrum schedule - * applies. It will always be present. - */ - location: Schema$GeoLocation; - /** - * A list of available spectrum profiles and associated times. It will always - * be present, and at least one schedule must be included (though it may be - * empty if there is no available spectrum). More than one schedule may be - * included to represent future changes to the available spectrum. - */ - spectrumSchedules: Schema$SpectrumSchedule[]; -} -/** - * The request message for a batch available spectrum query protocol. - */ -export interface Schema$PawsGetSpectrumBatchRequest { - /** - * Depending on device type and regulatory domain, antenna characteristics may - * be required. - */ - antenna: Schema$AntennaCharacteristics; - /** - * The master device may include its device capabilities to limit the - * available-spectrum batch response to the spectrum that is compatible with - * its capabilities. The database should not return spectrum that is - * incompatible with the specified capabilities. - */ - capabilities: Schema$DeviceCapabilities; - /** - * When the available spectrum request is made on behalf of a specific device - * (a master or slave device), device descriptor information for the device on - * whose behalf the request is made is required (in such cases, the - * requestType parameter must be empty). When a requestType value is - * specified, device descriptor information may be optional or required - * according to the rules of the applicable regulatory domain. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * A geolocation list is required. This allows a device to specify its current - * location plus additional anticipated locations when allowed by the - * regulatory domain. At least one location must be included. Geolocation must - * be given as the location of the radiation center of the device's - * antenna. If a location specifies a region, rather than a point, the - * database may return an UNIMPLEMENTED error if it does not support query by - * region. There is no upper limit on the number of locations included in a - * available spectrum batch request, but the database may restrict the number - * of locations it supports by returning a response with fewer locations than - * specified in the batch request. Note that geolocations must be those of the - * master device (a device with geolocation capability that makes an available - * spectrum batch request), whether the master device is making the request on - * its own behalf or on behalf of a slave device (one without geolocation - * capability). - */ - locations: Schema$GeoLocation[]; - /** - * When an available spectrum batch request is made by the master device (a - * device with geolocation capability) on behalf of a slave device (a device - * without geolocation capability), the rules of the applicable regulatory - * domain may require the master device to provide its own device descriptor - * information (in addition to device descriptor information for the slave - * device in a separate parameter). - */ - masterDeviceDesc: Schema$DeviceDescriptor; - /** - * Depending on device type and regulatory domain, device owner information - * may be included in an available spectrum batch request. This allows the - * device to register and get spectrum-availability information in a single - * request. - */ - owner: Schema$DeviceOwner; - /** - * The request type parameter is an optional parameter that can be used to - * modify an available spectrum batch request, but its use depends on - * applicable regulatory rules. For example, It may be used to request generic - * slave device parameters without having to specify the device descriptor for - * a specific device. When the requestType parameter is missing, the request - * is for a specific device (master or slave), and the device descriptor - * parameter for the device on whose behalf the batch request is made is - * required. - */ - requestType: string; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The response message for the batch available spectrum query contains a - * schedule of available spectrum for the device at multiple locations. - */ -export interface Schema$PawsGetSpectrumBatchResponse { - /** - * A database may include the databaseChange parameter to notify a device of a - * change to its database URI, providing one or more alternate database URIs. - * The device should use this information to update its list of pre-configured - * databases by (only) replacing its entry for the responding database with - * the list of alternate URIs. - */ - databaseChange: Schema$DbUpdateSpec; - /** - * The database must return in its available spectrum response the device - * descriptor information it received in the master device's available - * spectrum batch request. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * The available spectrum batch response must contain a geo-spectrum schedule - * list, The list may be empty if spectrum is not available. The database may - * return more than one geo-spectrum schedule to represent future changes to - * the available spectrum. How far in advance a schedule may be provided - * depends upon the applicable regulatory domain. The database may return - * available spectrum for fewer geolocations than requested. The device must - * not make assumptions about the order of the entries in the list, and must - * use the geolocation value in each geo-spectrum schedule entry to match - * available spectrum to a location. - */ - geoSpectrumSchedules: Schema$GeoSpectrumSchedule[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsGetSpectrumBatchResponse". - */ - kind: string; - /** - * The database may return a constraint on the allowed maximum contiguous - * bandwidth (in Hertz). A regulatory domain may require the database to - * return this parameter. When this parameter is present in the response, the - * device must apply this constraint to its spectrum-selection logic to ensure - * that no single block of spectrum has bandwidth that exceeds this value. - */ - maxContiguousBwHz: number; - /** - * The database may return a constraint on the allowed maximum total bandwidth - * (in Hertz), which does not need to be contiguous. A regulatory domain may - * require the database to return this parameter. When this parameter is - * present in the available spectrum batch response, the device must apply - * this constraint to its spectrum-selection logic to ensure that total - * bandwidth does not exceed this value. - */ - maxTotalBwHz: number; - /** - * For regulatory domains that require a spectrum-usage report from devices, - * the database must return true for this parameter if the geo-spectrum - * schedules list is not empty; otherwise, the database should either return - * false or omit this parameter. If this parameter is present and its value is - * true, the device must send a spectrum use notify message to the database; - * otherwise, the device should not send the notification. - */ - needsSpectrumReport: boolean; - /** - * The database should return ruleset information, which identifies the - * applicable regulatory authority and ruleset for the available spectrum - * batch response. If included, the device must use the corresponding ruleset - * to interpret the response. Values provided in the returned ruleset - * information, such as maxLocationChange, take precedence over any - * conflicting values provided in the ruleset information returned in a prior - * initialization response sent by the database to the device. - */ - rulesetInfo: Schema$RulesetInfo; - /** - * The database includes a timestamp of the form, YYYY-MM-DDThh:mm:ssZ - * (Internet timestamp format per RFC3339), in its available spectrum batch - * response. The timestamp should be used by the device as a reference for the - * start and stop times specified in the response spectrum schedules. - */ - timestamp: string; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The request message for the available spectrum query protocol which must - * include the device's geolocation. - */ -export interface Schema$PawsGetSpectrumRequest { - /** - * Depending on device type and regulatory domain, the characteristics of the - * antenna may be required. - */ - antenna: Schema$AntennaCharacteristics; - /** - * The master device may include its device capabilities to limit the - * available-spectrum response to the spectrum that is compatible with its - * capabilities. The database should not return spectrum that is incompatible - * with the specified capabilities. - */ - capabilities: Schema$DeviceCapabilities; - /** - * When the available spectrum request is made on behalf of a specific device - * (a master or slave device), device descriptor information for that device - * is required (in such cases, the requestType parameter must be empty). When - * a requestType value is specified, device descriptor information may be - * optional or required according to the rules of the applicable regulatory - * domain. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * The geolocation of the master device (a device with geolocation capability - * that makes an available spectrum request) is required whether the master - * device is making the request on its own behalf or on behalf of a slave - * device (one without geolocation capability). The location must be the - * location of the radiation center of the master device's antenna. To - * support mobile devices, a regulatory domain may allow the anticipated - * position of the master device to be given instead. If the location - * specifies a region, rather than a point, the database may return an - * UNIMPLEMENTED error code if it does not support query by region. - */ - location: Schema$GeoLocation; - /** - * When an available spectrum request is made by the master device (a device - * with geolocation capability) on behalf of a slave device (a device without - * geolocation capability), the rules of the applicable regulatory domain may - * require the master device to provide its own device descriptor information - * (in addition to device descriptor information for the slave device, which - * is provided in a separate parameter). - */ - masterDeviceDesc: Schema$DeviceDescriptor; - /** - * Depending on device type and regulatory domain, device owner information - * may be included in an available spectrum request. This allows the device to - * register and get spectrum-availability information in a single request. - */ - owner: Schema$DeviceOwner; - /** - * The request type parameter is an optional parameter that can be used to - * modify an available spectrum request, but its use depends on applicable - * regulatory rules. It may be used, for example, to request generic slave - * device parameters without having to specify the device descriptor for a - * specific device. When the requestType parameter is missing, the request is - * for a specific device (master or slave), and the deviceDesc parameter for - * the device on whose behalf the request is made is required. - */ - requestType: string; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The response message for the available spectrum query which contains a - * schedule of available spectrum for the device. - */ -export interface Schema$PawsGetSpectrumResponse { - /** - * A database may include the databaseChange parameter to notify a device of a - * change to its database URI, providing one or more alternate database URIs. - * The device should use this information to update its list of pre-configured - * databases by (only) replacing its entry for the responding database with - * the list of alternate URIs. - */ - databaseChange: Schema$DbUpdateSpec; - /** - * The database must return, in its available spectrum response, the device - * descriptor information it received in the master device's available - * spectrum request. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsGetSpectrumResponse". - */ - kind: string; /** - * The database may return a constraint on the allowed maximum contiguous - * bandwidth (in Hertz). A regulatory domain may require the database to - * return this parameter. When this parameter is present in the response, the - * device must apply this constraint to its spectrum-selection logic to ensure - * that no single block of spectrum has bandwidth that exceeds this value. - */ - maxContiguousBwHz: number; - /** - * The database may return a constraint on the allowed maximum total bandwidth - * (in Hertz), which need not be contiguous. A regulatory domain may require - * the database to return this parameter. When this parameter is present in - * the available spectrum response, the device must apply this constraint to - * its spectrum-selection logic to ensure that total bandwidth does not exceed - * this value. - */ - maxTotalBwHz: number; - /** - * For regulatory domains that require a spectrum-usage report from devices, - * the database must return true for this parameter if the spectrum schedule - * list is not empty; otherwise, the database will either return false or omit - * this parameter. If this parameter is present and its value is true, the - * device must send a spectrum use notify message to the database; otherwise, - * the device must not send the notification. - */ - needsSpectrumReport: boolean; - /** - * The database should return ruleset information, which identifies the - * applicable regulatory authority and ruleset for the available spectrum - * response. If included, the device must use the corresponding ruleset to - * interpret the response. Values provided in the returned ruleset - * information, such as maxLocationChange, take precedence over any - * conflicting values provided in the ruleset information returned in a prior - * initialization response sent by the database to the device. - */ - rulesetInfo: Schema$RulesetInfo; - /** - * The available spectrum response must contain a spectrum schedule list. The - * list may be empty if spectrum is not available. The database may return - * more than one spectrum schedule to represent future changes to the - * available spectrum. How far in advance a schedule may be provided depends - * on the applicable regulatory domain. - */ - spectrumSchedules: Schema$SpectrumSchedule[]; - /** - * The database includes a timestamp of the form YYYY-MM-DDThh:mm:ssZ - * (Internet timestamp format per RFC3339) in its available spectrum response. - * The timestamp should be used by the device as a reference for the start and - * stop times specified in the response spectrum schedules. - */ - timestamp: string; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The initialization request message allows the master device to initiate - * exchange of capabilities with the database. - */ -export interface Schema$PawsInitRequest { - /** - * The DeviceDescriptor parameter is required. If the database does not - * support the device or any of the rulesets specified in the device - * descriptor, it must return an UNSUPPORTED error code in the error response. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * A device's geolocation is required. - */ - location: Schema$GeoLocation; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The initialization response message communicates database parameters to the - * requesting device. - */ -export interface Schema$PawsInitResponse { - /** - * A database may include the databaseChange parameter to notify a device of a - * change to its database URI, providing one or more alternate database URIs. - * The device should use this information to update its list of pre-configured - * databases by (only) replacing its entry for the responding database with - * the list of alternate URIs. - */ - databaseChange: Schema$DbUpdateSpec; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsInitResponse". - */ - kind: string; - /** - * The rulesetInfo parameter must be included in the response. This parameter - * specifies the regulatory domain and parameters applicable to that domain. - * The database must include the authority field, which defines the regulatory - * domain for the location specified in the INIT_REQ message. - */ - rulesetInfo: Schema$RulesetInfo; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The spectrum-use notification message which must contain the geolocation of - * the Device and parameters required by the regulatory domain. - */ -export interface Schema$PawsNotifySpectrumUseRequest { - /** - * Device descriptor information is required in the spectrum-use notification - * message. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * The geolocation of the master device (the device that is sending the - * spectrum-use notification) to the database is required in the spectrum-use - * notification message. - */ - location: Schema$GeoLocation; - /** - * A spectrum list is required in the spectrum-use notification. The list - * specifies the spectrum that the device expects to use, which includes - * frequency ranges and maximum power levels. The list may be empty if the - * device decides not to use any of spectrum. For consistency, the - * psdBandwidthHz value should match that from one of the spectrum elements in - * the corresponding available spectrum response previously sent to the device - * by the database. Note that maximum power levels in the spectrum element - * must be expressed as power spectral density over the specified - * psdBandwidthHz value. The actual bandwidth to be used (as computed from the - * start and stop frequencies) may be different from the psdBandwidthHz value. - * As an example, when regulatory rules express maximum power spectral density - * in terms of maximum power over any 100 kHz band, then the psdBandwidthHz - * value should be set to 100 kHz, even though the actual bandwidth used can - * be 20 kHz. - */ - spectra: Schema$SpectrumMessage[]; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * An empty response to the notification. - */ -export interface Schema$PawsNotifySpectrumUseResponse { - /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsNotifySpectrumUseResponse". - */ - kind: string; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The registration request message contains the required registration - * parameters. - */ -export interface Schema$PawsRegisterRequest { - /** - * Antenna characteristics, including its height and height type. - */ - antenna: Schema$AntennaCharacteristics; - /** - * A DeviceDescriptor is required. - */ - deviceDesc: Schema$DeviceDescriptor; - /** - * Device owner information is required. - */ - deviceOwner: Schema$DeviceOwner; - /** - * A device's geolocation is required. - */ - location: Schema$GeoLocation; - /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; - /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The registration response message simply acknowledges receipt of the request - * and is otherwise empty. - */ -export interface Schema$PawsRegisterResponse { - /** - * A database may include the databaseChange parameter to notify a device of a - * change to its database URI, providing one or more alternate database URIs. - * The device should use this information to update its list of pre-configured - * databases by (only) replacing its entry for the responding database with - * the list of alternate URIs. - */ - databaseChange: Schema$DbUpdateSpec; + * Antenna characteristics provide additional information, such as the antenna + * height, antenna type, etc. Whether antenna characteristics must be provided + * in a request depends on the device type and regulatory domain. + */ + export interface Schema$AntennaCharacteristics { + /** + * The antenna height in meters. Whether the antenna height is required + * depends on the device type and the regulatory domain. Note that the + * height may be negative. + */ + height: number; + /** + * If the height is required, then the height type (AGL for above ground + * level or AMSL for above mean sea level) is also required. The default is + * AGL. + */ + heightType: string; + /** + * The height uncertainty in meters. Whether this is required depends on the + * regulatory domain. + */ + heightUncertainty: number; + } /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsRegisterResponse". - */ - kind: string; + * This message contains the name and URI of a database. + */ + export interface Schema$DatabaseSpec { + /** + * The display name for a database. + */ + name: string; + /** + * The corresponding URI of the database. + */ + uri: string; + } /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. + * This message is provided by the database to notify devices of an upcoming + * change to the database URI. */ - type: string; + export interface Schema$DbUpdateSpec { + /** + * A required list of one or more databases. A device should update its + * preconfigured list of databases to replace (only) the database that + * provided the response with the specified entries. + */ + databases: Schema$DatabaseSpec[]; + } /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The device validation request message. - */ -export interface Schema$PawsVerifyDeviceRequest { + * Device capabilities provide additional information that may be used by a + * device to provide additional information to the database that may help it + * to determine available spectrum. If the database does not support device + * capabilities it will ignore the parameter altogether. + */ + export interface Schema$DeviceCapabilities { + /** + * An optional list of frequency ranges supported by the device. Each + * element must contain start and stop frequencies in which the device can + * operate. Channel identifiers are optional. When specified, the database + * should not return available spectrum that falls outside these ranges or + * channel IDs. + */ + frequencyRanges: Schema$FrequencyRange[]; + } /** - * A list of device descriptors, which specifies the slave devices to be - * validated, is required. - */ - deviceDescs: Schema$DeviceDescriptor[]; + * The device descriptor contains parameters that identify the specific + * device, such as its manufacturer serial number, regulatory-specific + * identifier (e.g., FCC ID), and any other device characteristics required by + * regulatory domains. + */ + export interface Schema$DeviceDescriptor { + /** + * Specifies the ETSI white space device category. Valid values are the + * strings master and slave. This field is case-insensitive. Consult the + * ETSI documentation for details about the device types. + */ + etsiEnDeviceCategory: string; + /** + * Specifies the ETSI white space device emissions class. The values are + * represented by numeric strings, such as 1, 2, etc. Consult the ETSI + * documentation for details about the device types. + */ + etsiEnDeviceEmissionsClass: string; + /** + * Specifies the ETSI white space device type. Valid values are + * single-letter strings, such as A, B, etc. Consult the ETSI documentation + * for details about the device types. + */ + etsiEnDeviceType: string; + /** + * Specifies the ETSI white space device technology identifier. The string + * value must not exceed 64 characters in length. Consult the ETSI + * documentation for details about the device types. + */ + etsiEnTechnologyId: string; + /** + * Specifies the device's FCC certification identifier. The value is an + * identifier string whose length should not exceed 32 characters. Note + * that, in practice, a valid FCC ID may be limited to 19 characters. + */ + fccId: string; + /** + * Specifies the TV Band White Space device type, as defined by the FCC. + * Valid values are FIXED, MODE_1, MODE_2. + */ + fccTvbdDeviceType: string; + /** + * The manufacturer's ID may be required by the regulatory domain. This + * should represent the name of the device manufacturer, should be + * consistent across all devices from the same manufacturer, and should be + * distinct from that of other manufacturers. The string value must not + * exceed 64 characters in length. + */ + manufacturerId: string; + /** + * The device's model ID may be required by the regulatory domain. The + * string value must not exceed 64 characters in length. + */ + modelId: string; + /** + * The list of identifiers for rulesets supported by the device. A database + * may require that the device provide this list before servicing the device + * requests. If the database does not support any of the rulesets specified + * in the list, the database may refuse to service the device requests. If + * present, the list must contain at least one entry. For information about + * the valid requests, see section 9.2 of the PAWS specification. Currently, + * FccTvBandWhiteSpace-2010 is the only supported ruleset. + */ + rulesetIds: string[]; + /** + * The manufacturer's device serial number; required by the applicable + * regulatory domain. The length of the value must not exceed 64 characters. + */ + serialNumber: string; + } /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; + * This parameter contains device-owner information required as part of device + * registration. The regulatory domains may require additional parameters. All + * contact information must be expressed using the structure defined by the + * vCard format specification. Only the contact fields of vCard are supported: + * - fn: Full name of an individual - org: Name of the organization - adr: + * Address fields - tel: Telephone numbers - email: Email addresses Note + * that the vCard specification defines maximum lengths for each field. + */ + export interface Schema$DeviceOwner { + /** + * The vCard contact information for the device operator is optional, but + * may be required by specific regulatory domains. + */ + operator: Schema$Vcard; + /** + * The vCard contact information for the individual or business that owns + * the device is required. + */ + owner: Schema$Vcard; + } /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * The device validation response message. - */ -export interface Schema$PawsVerifyDeviceResponse { + * The device validity element describes whether a particular device is valid + * to operate in the regulatory domain. + */ + export interface Schema$DeviceValidity { + /** + * The descriptor of the device for which the validity check was requested. + * It will always be present. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * The validity status: true if the device is valid for operation, false + * otherwise. It will always be present. + */ + isValid: boolean; + /** + * If the device identifier is not valid, the database may include a reason. + * The reason may be in any language. The length of the value should not + * exceed 128 characters. + */ + reason: string; + } /** - * A database may include the databaseChange parameter to notify a device of a - * change to its database URI, providing one or more alternate database URIs. - * The device should use this information to update its list of pre-configured - * databases by (only) replacing its entry for the responding database with - * the list of alternate URIs. - */ - databaseChange: Schema$DbUpdateSpec; + * The start and stop times of an event. This is used to indicate the time + * period for which a spectrum profile is valid. Both times are expressed + * using the format, YYYY-MM-DDThh:mm:ssZ, as defined in RFC3339. The times + * must be expressed using UTC. + */ + export interface Schema$EventTime { + /** + * The inclusive start of the event. It will be present. + */ + startTime: string; + /** + * The exclusive end of the event. It will be present. + */ + stopTime: string; + } /** - * A device validities list is required in the device validation response to - * report whether each slave device listed in a previous device validation - * request is valid. The number of entries must match the number of device - * descriptors listed in the previous device validation request. - */ - deviceValidities: Schema$DeviceValidity[]; + * A specific range of frequencies together with the associated maximum power + * level and channel identifier. + */ + export interface Schema$FrequencyRange { + /** + * The database may include a channel identifier, when applicable. When it + * is included, the device should treat it as informative. The length of the + * identifier should not exceed 16 characters. + */ + channelId: string; + /** + * The maximum total power level (EIRP)—computed over the corresponding + * operating bandwidth—that is permitted within the frequency range. + * Depending on the context in which the frequency-range element appears, + * this value may be required. For example, it is required in the + * available-spectrum response, available-spectrum-batch response, and + * spectrum-use notification message, but it should not be present (it is + * not applicable) when the frequency range appears inside a + * device-capabilities message. + */ + maxPowerDBm: number; + /** + * The required inclusive start of the frequency range (in Hertz). + */ + startHz: number; + /** + * The required exclusive end of the frequency range (in Hertz). + */ + stopHz: number; + } /** - * Identifies what kind of resource this is. Value: the fixed string - * "spectrum#pawsVerifyDeviceResponse". - */ - kind: string; + * This parameter is used to specify the geolocation of the device. + */ + export interface Schema$GeoLocation { + /** + * The location confidence level, as an integer percentage, may be required, + * depending on the regulatory domain. When the parameter is optional and + * not provided, its value is assumed to be 95. Valid values range from 0 to + * 99, since, in practice, 100-percent confidence is not achievable. The + * confidence value is meaningful only when geolocation refers to a point + * with uncertainty. + */ + confidence: number; + /** + * If present, indicates that the geolocation represents a point. + * Paradoxically, a point is parameterized using an ellipse, where the + * center represents the location of the point and the distances along the + * major and minor axes represent the uncertainty. The uncertainty values + * may be required, depending on the regulatory domain. + */ + point: Schema$GeoLocationEllipse; + /** + * If present, indicates that the geolocation represents a region. Database + * support for regions is optional. + */ + region: Schema$GeoLocationPolygon; + } /** - * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required - * field. - */ - type: string; + * A "point" with uncertainty is represented using the Ellipse + * shape. + */ + export interface Schema$GeoLocationEllipse { + /** + * A required geo-spatial point representing the center of the ellipse. + */ + center: Schema$GeoLocationPoint; + /** + * A floating-point number that expresses the orientation of the ellipse, + * representing the rotation, in degrees, of the semi-major axis from North + * towards the East. For example, when the uncertainty is greatest along the + * North-South direction, orientation is 0 degrees; conversely, if the + * uncertainty is greatest along the East-West direction, orientation is 90 + * degrees. When orientation is not present, the orientation is assumed to + * be 0. + */ + orientation: number; + /** + * A floating-point number that expresses the location uncertainty along the + * major axis of the ellipse. May be required by the regulatory domain. When + * the uncertainty is optional, the default value is 0. + */ + semiMajorAxis: number; + /** + * A floating-point number that expresses the location uncertainty along the + * minor axis of the ellipse. May be required by the regulatory domain. When + * the uncertainty is optional, the default value is 0. + */ + semiMinorAxis: number; + } /** - * The PAWS version. Must be exactly 1.0. Required field. - */ - version: string; -} -/** - * This contains parameters for the ruleset of a regulatory domain that is - * communicated using the initialization and available-spectrum processes. - */ -export interface Schema$RulesetInfo { + * A single geolocation on the globe. + */ + export interface Schema$GeoLocationPoint { + /** + * A required floating-point number that expresses the latitude in degrees + * using the WGS84 datum. For details on this encoding, see the National + * Imagery and Mapping Agency's Technical Report TR8350.2. + */ + latitude: number; + /** + * A required floating-point number that expresses the longitude in degrees + * using the WGS84 datum. For details on this encoding, see the National + * Imagery and Mapping Agency's Technical Report TR8350.2. + */ + longitude: number; + } /** - * The regulatory domain to which the ruleset belongs is required. It must be - * a 2-letter country code. The device should use this to determine additional - * device behavior required by the associated regulatory domain. - */ - authority: string; + * A region is represented using the polygonal shape. + */ + export interface Schema$GeoLocationPolygon { + /** + * When the geolocation describes a region, the exterior field refers to a + * list of latitude/longitude points that represent the vertices of a + * polygon. The first and last points must be the same. Thus, a minimum of + * four points is required. The following polygon restrictions from RFC5491 + * apply: - A connecting line shall not cross another connecting line of + * the same polygon. - The vertices must be defined in a counterclockwise + * order. - The edges of a polygon are defined by the shortest path between + * two points in space (not a geodesic curve). Consequently, the length + * between two adjacent vertices should be restricted to a maximum of 130 + * km. - All vertices are assumed to be at the same altitude. - Polygon + * shapes should be restricted to a maximum of 15 vertices (16 points that + * include the repeated vertex). + */ + exterior: Schema$GeoLocationPoint[]; + } /** - * The maximum location change in meters is required in the initialization - * response, but optional otherwise. When the device changes location by more - * than this specified distance, it must contact the database to get the - * available spectrum for the new location. If the device is using spectrum - * that is no longer available, it must immediately cease use of the spectrum - * under rules for database-managed spectrum. If this value is provided within - * the context of an available-spectrum response, it takes precedence over the - * value within the initialization response. - */ - maxLocationChange: number; + * The schedule of spectrum profiles available at a particular geolocation. + */ + export interface Schema$GeoSpectrumSchedule { + /** + * The geolocation identifies the location at which the spectrum schedule + * applies. It will always be present. + */ + location: Schema$GeoLocation; + /** + * A list of available spectrum profiles and associated times. It will + * always be present, and at least one schedule must be included (though it + * may be empty if there is no available spectrum). More than one schedule + * may be included to represent future changes to the available spectrum. + */ + spectrumSchedules: Schema$SpectrumSchedule[]; + } /** - * The maximum duration, in seconds, between requests for available spectrum. - * It is required in the initialization response, but optional otherwise. The - * device must contact the database to get available spectrum no less - * frequently than this duration. If the new spectrum information indicates - * that the device is using spectrum that is no longer available, it must - * immediately cease use of those frequencies under rules for database-managed - * spectrum. If this value is provided within the context of an - * available-spectrum response, it takes precedence over the value within the - * initialization response. - */ - maxPollingSecs: number; + * The request message for a batch available spectrum query protocol. + */ + export interface Schema$PawsGetSpectrumBatchRequest { + /** + * Depending on device type and regulatory domain, antenna characteristics + * may be required. + */ + antenna: Schema$AntennaCharacteristics; + /** + * The master device may include its device capabilities to limit the + * available-spectrum batch response to the spectrum that is compatible with + * its capabilities. The database should not return spectrum that is + * incompatible with the specified capabilities. + */ + capabilities: Schema$DeviceCapabilities; + /** + * When the available spectrum request is made on behalf of a specific + * device (a master or slave device), device descriptor information for the + * device on whose behalf the request is made is required (in such cases, + * the requestType parameter must be empty). When a requestType value is + * specified, device descriptor information may be optional or required + * according to the rules of the applicable regulatory domain. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * A geolocation list is required. This allows a device to specify its + * current location plus additional anticipated locations when allowed by + * the regulatory domain. At least one location must be included. + * Geolocation must be given as the location of the radiation center of the + * device's antenna. If a location specifies a region, rather than a + * point, the database may return an UNIMPLEMENTED error if it does not + * support query by region. There is no upper limit on the number of + * locations included in a available spectrum batch request, but the + * database may restrict the number of locations it supports by returning a + * response with fewer locations than specified in the batch request. Note + * that geolocations must be those of the master device (a device with + * geolocation capability that makes an available spectrum batch request), + * whether the master device is making the request on its own behalf or on + * behalf of a slave device (one without geolocation capability). + */ + locations: Schema$GeoLocation[]; + /** + * When an available spectrum batch request is made by the master device (a + * device with geolocation capability) on behalf of a slave device (a device + * without geolocation capability), the rules of the applicable regulatory + * domain may require the master device to provide its own device descriptor + * information (in addition to device descriptor information for the slave + * device in a separate parameter). + */ + masterDeviceDesc: Schema$DeviceDescriptor; + /** + * Depending on device type and regulatory domain, device owner information + * may be included in an available spectrum batch request. This allows the + * device to register and get spectrum-availability information in a single + * request. + */ + owner: Schema$DeviceOwner; + /** + * The request type parameter is an optional parameter that can be used to + * modify an available spectrum batch request, but its use depends on + * applicable regulatory rules. For example, It may be used to request + * generic slave device parameters without having to specify the device + * descriptor for a specific device. When the requestType parameter is + * missing, the request is for a specific device (master or slave), and the + * device descriptor parameter for the device on whose behalf the batch + * request is made is required. + */ + requestType: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The identifiers of the rulesets supported for the device's location. - * The database should include at least one applicable ruleset in the - * initialization response. The device may use the ruleset identifiers to - * determine parameters to include in subsequent requests. Within the context - * of the available-spectrum responses, the database should include the - * identifier of the ruleset that it used to determine the available-spectrum - * response. If included, the device must use the specified ruleset to - * interpret the response. If the device does not support the indicated - * ruleset, it must not operate in the spectrum governed by the ruleset. - */ - rulesetIds: string[]; -} -/** - * Available spectrum can be logically characterized by a list of frequency - * ranges and permissible power levels for each range. - */ -export interface Schema$SpectrumMessage { + * The response message for the batch available spectrum query contains a + * schedule of available spectrum for the device at multiple locations. + */ + export interface Schema$PawsGetSpectrumBatchResponse { + /** + * A database may include the databaseChange parameter to notify a device of + * a change to its database URI, providing one or more alternate database + * URIs. The device should use this information to update its list of + * pre-configured databases by (only) replacing its entry for the responding + * database with the list of alternate URIs. + */ + databaseChange: Schema$DbUpdateSpec; + /** + * The database must return in its available spectrum response the device + * descriptor information it received in the master device's available + * spectrum batch request. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * The available spectrum batch response must contain a geo-spectrum + * schedule list, The list may be empty if spectrum is not available. The + * database may return more than one geo-spectrum schedule to represent + * future changes to the available spectrum. How far in advance a schedule + * may be provided depends upon the applicable regulatory domain. The + * database may return available spectrum for fewer geolocations than + * requested. The device must not make assumptions about the order of the + * entries in the list, and must use the geolocation value in each + * geo-spectrum schedule entry to match available spectrum to a location. + */ + geoSpectrumSchedules: Schema$GeoSpectrumSchedule[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsGetSpectrumBatchResponse". + */ + kind: string; + /** + * The database may return a constraint on the allowed maximum contiguous + * bandwidth (in Hertz). A regulatory domain may require the database to + * return this parameter. When this parameter is present in the response, + * the device must apply this constraint to its spectrum-selection logic to + * ensure that no single block of spectrum has bandwidth that exceeds this + * value. + */ + maxContiguousBwHz: number; + /** + * The database may return a constraint on the allowed maximum total + * bandwidth (in Hertz), which does not need to be contiguous. A regulatory + * domain may require the database to return this parameter. When this + * parameter is present in the available spectrum batch response, the device + * must apply this constraint to its spectrum-selection logic to ensure that + * total bandwidth does not exceed this value. + */ + maxTotalBwHz: number; + /** + * For regulatory domains that require a spectrum-usage report from devices, + * the database must return true for this parameter if the geo-spectrum + * schedules list is not empty; otherwise, the database should either return + * false or omit this parameter. If this parameter is present and its value + * is true, the device must send a spectrum use notify message to the + * database; otherwise, the device should not send the notification. + */ + needsSpectrumReport: boolean; + /** + * The database should return ruleset information, which identifies the + * applicable regulatory authority and ruleset for the available spectrum + * batch response. If included, the device must use the corresponding + * ruleset to interpret the response. Values provided in the returned + * ruleset information, such as maxLocationChange, take precedence over any + * conflicting values provided in the ruleset information returned in a + * prior initialization response sent by the database to the device. + */ + rulesetInfo: Schema$RulesetInfo; + /** + * The database includes a timestamp of the form, YYYY-MM-DDThh:mm:ssZ + * (Internet timestamp format per RFC3339), in its available spectrum batch + * response. The timestamp should be used by the device as a reference for + * the start and stop times specified in the response spectrum schedules. + */ + timestamp: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The bandwidth (in Hertz) for which permissible power levels are specified. - * For example, FCC regulation would require only one spectrum specification - * at 6MHz bandwidth, but Ofcom regulation would require two specifications, - * at 0.1MHz and 8MHz. This parameter may be empty if there is no available - * spectrum. It will be present otherwise. - */ - bandwidth: number; + * The request message for the available spectrum query protocol which must + * include the device's geolocation. + */ + export interface Schema$PawsGetSpectrumRequest { + /** + * Depending on device type and regulatory domain, the characteristics of + * the antenna may be required. + */ + antenna: Schema$AntennaCharacteristics; + /** + * The master device may include its device capabilities to limit the + * available-spectrum response to the spectrum that is compatible with its + * capabilities. The database should not return spectrum that is + * incompatible with the specified capabilities. + */ + capabilities: Schema$DeviceCapabilities; + /** + * When the available spectrum request is made on behalf of a specific + * device (a master or slave device), device descriptor information for that + * device is required (in such cases, the requestType parameter must be + * empty). When a requestType value is specified, device descriptor + * information may be optional or required according to the rules of the + * applicable regulatory domain. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * The geolocation of the master device (a device with geolocation + * capability that makes an available spectrum request) is required whether + * the master device is making the request on its own behalf or on behalf of + * a slave device (one without geolocation capability). The location must be + * the location of the radiation center of the master device's antenna. + * To support mobile devices, a regulatory domain may allow the anticipated + * position of the master device to be given instead. If the location + * specifies a region, rather than a point, the database may return an + * UNIMPLEMENTED error code if it does not support query by region. + */ + location: Schema$GeoLocation; + /** + * When an available spectrum request is made by the master device (a device + * with geolocation capability) on behalf of a slave device (a device + * without geolocation capability), the rules of the applicable regulatory + * domain may require the master device to provide its own device descriptor + * information (in addition to device descriptor information for the slave + * device, which is provided in a separate parameter). + */ + masterDeviceDesc: Schema$DeviceDescriptor; + /** + * Depending on device type and regulatory domain, device owner information + * may be included in an available spectrum request. This allows the device + * to register and get spectrum-availability information in a single + * request. + */ + owner: Schema$DeviceOwner; + /** + * The request type parameter is an optional parameter that can be used to + * modify an available spectrum request, but its use depends on applicable + * regulatory rules. It may be used, for example, to request generic slave + * device parameters without having to specify the device descriptor for a + * specific device. When the requestType parameter is missing, the request + * is for a specific device (master or slave), and the deviceDesc parameter + * for the device on whose behalf the request is made is required. + */ + requestType: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The list of frequency ranges and permissible power levels. The list may be - * empty if there is no available spectrum, otherwise it will be present. - */ - frequencyRanges: Schema$FrequencyRange[]; -} -/** - * The spectrum schedule element combines an event time with spectrum profile to - * define a time period in which the profile is valid. - */ -export interface Schema$SpectrumSchedule { + * The response message for the available spectrum query which contains a + * schedule of available spectrum for the device. + */ + export interface Schema$PawsGetSpectrumResponse { + /** + * A database may include the databaseChange parameter to notify a device of + * a change to its database URI, providing one or more alternate database + * URIs. The device should use this information to update its list of + * pre-configured databases by (only) replacing its entry for the responding + * database with the list of alternate URIs. + */ + databaseChange: Schema$DbUpdateSpec; + /** + * The database must return, in its available spectrum response, the device + * descriptor information it received in the master device's available + * spectrum request. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsGetSpectrumResponse". + */ + kind: string; + /** + * The database may return a constraint on the allowed maximum contiguous + * bandwidth (in Hertz). A regulatory domain may require the database to + * return this parameter. When this parameter is present in the response, + * the device must apply this constraint to its spectrum-selection logic to + * ensure that no single block of spectrum has bandwidth that exceeds this + * value. + */ + maxContiguousBwHz: number; + /** + * The database may return a constraint on the allowed maximum total + * bandwidth (in Hertz), which need not be contiguous. A regulatory domain + * may require the database to return this parameter. When this parameter is + * present in the available spectrum response, the device must apply this + * constraint to its spectrum-selection logic to ensure that total bandwidth + * does not exceed this value. + */ + maxTotalBwHz: number; + /** + * For regulatory domains that require a spectrum-usage report from devices, + * the database must return true for this parameter if the spectrum schedule + * list is not empty; otherwise, the database will either return false or + * omit this parameter. If this parameter is present and its value is true, + * the device must send a spectrum use notify message to the database; + * otherwise, the device must not send the notification. + */ + needsSpectrumReport: boolean; + /** + * The database should return ruleset information, which identifies the + * applicable regulatory authority and ruleset for the available spectrum + * response. If included, the device must use the corresponding ruleset to + * interpret the response. Values provided in the returned ruleset + * information, such as maxLocationChange, take precedence over any + * conflicting values provided in the ruleset information returned in a + * prior initialization response sent by the database to the device. + */ + rulesetInfo: Schema$RulesetInfo; + /** + * The available spectrum response must contain a spectrum schedule list. + * The list may be empty if spectrum is not available. The database may + * return more than one spectrum schedule to represent future changes to the + * available spectrum. How far in advance a schedule may be provided depends + * on the applicable regulatory domain. + */ + spectrumSchedules: Schema$SpectrumSchedule[]; + /** + * The database includes a timestamp of the form YYYY-MM-DDThh:mm:ssZ + * (Internet timestamp format per RFC3339) in its available spectrum + * response. The timestamp should be used by the device as a reference for + * the start and stop times specified in the response spectrum schedules. + */ + timestamp: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The event time expresses when the spectrum profile is valid. It will always - * be present. - */ - eventTime: Schema$EventTime; + * The initialization request message allows the master device to initiate + * exchange of capabilities with the database. + */ + export interface Schema$PawsInitRequest { + /** + * The DeviceDescriptor parameter is required. If the database does not + * support the device or any of the rulesets specified in the device + * descriptor, it must return an UNSUPPORTED error code in the error + * response. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * A device's geolocation is required. + */ + location: Schema$GeoLocation; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * A list of spectrum messages representing the usable profile. It will always - * be present, but may be empty when there is no available spectrum. - */ - spectra: Schema$SpectrumMessage[]; -} -/** - * A vCard-in-JSON message that contains only the fields needed for PAWS: - - * fn: Full name of an individual - org: Name of the organization - adr: - * Address fields - tel: Telephone numbers - email: Email addresses - */ -export interface Schema$Vcard { + * The initialization response message communicates database parameters to the + * requesting device. + */ + export interface Schema$PawsInitResponse { + /** + * A database may include the databaseChange parameter to notify a device of + * a change to its database URI, providing one or more alternate database + * URIs. The device should use this information to update its list of + * pre-configured databases by (only) replacing its entry for the responding + * database with the list of alternate URIs. + */ + databaseChange: Schema$DbUpdateSpec; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsInitResponse". + */ + kind: string; + /** + * The rulesetInfo parameter must be included in the response. This + * parameter specifies the regulatory domain and parameters applicable to + * that domain. The database must include the authority field, which defines + * the regulatory domain for the location specified in the INIT_REQ message. + */ + rulesetInfo: Schema$RulesetInfo; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The street address of the entity. - */ - adr: Schema$VcardAddress; + * The spectrum-use notification message which must contain the geolocation of + * the Device and parameters required by the regulatory domain. + */ + export interface Schema$PawsNotifySpectrumUseRequest { + /** + * Device descriptor information is required in the spectrum-use + * notification message. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * The geolocation of the master device (the device that is sending the + * spectrum-use notification) to the database is required in the + * spectrum-use notification message. + */ + location: Schema$GeoLocation; + /** + * A spectrum list is required in the spectrum-use notification. The list + * specifies the spectrum that the device expects to use, which includes + * frequency ranges and maximum power levels. The list may be empty if the + * device decides not to use any of spectrum. For consistency, the + * psdBandwidthHz value should match that from one of the spectrum elements + * in the corresponding available spectrum response previously sent to the + * device by the database. Note that maximum power levels in the spectrum + * element must be expressed as power spectral density over the specified + * psdBandwidthHz value. The actual bandwidth to be used (as computed from + * the start and stop frequencies) may be different from the psdBandwidthHz + * value. As an example, when regulatory rules express maximum power + * spectral density in terms of maximum power over any 100 kHz band, then + * the psdBandwidthHz value should be set to 100 kHz, even though the actual + * bandwidth used can be 20 kHz. + */ + spectra: Schema$SpectrumMessage[]; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * An email address that can be used to reach the contact. - */ - email: Schema$VcardTypedText; + * An empty response to the notification. + */ + export interface Schema$PawsNotifySpectrumUseResponse { + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsNotifySpectrumUseResponse". + */ + kind: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The full name of the contact person. For example: John A. Smith. - */ - fn: string; + * The registration request message contains the required registration + * parameters. + */ + export interface Schema$PawsRegisterRequest { + /** + * Antenna characteristics, including its height and height type. + */ + antenna: Schema$AntennaCharacteristics; + /** + * A DeviceDescriptor is required. + */ + deviceDesc: Schema$DeviceDescriptor; + /** + * Device owner information is required. + */ + deviceOwner: Schema$DeviceOwner; + /** + * A device's geolocation is required. + */ + location: Schema$GeoLocation; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The organization associated with the registering entity. - */ - org: Schema$VcardTypedText; + * The registration response message simply acknowledges receipt of the + * request and is otherwise empty. + */ + export interface Schema$PawsRegisterResponse { + /** + * A database may include the databaseChange parameter to notify a device of + * a change to its database URI, providing one or more alternate database + * URIs. The device should use this information to update its list of + * pre-configured databases by (only) replacing its entry for the responding + * database with the list of alternate URIs. + */ + databaseChange: Schema$DbUpdateSpec; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsRegisterResponse". + */ + kind: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * A telephone number that can be used to call the contact. - */ - tel: Schema$VcardTelephone; -} -/** - * The structure used to represent a street address. - */ -export interface Schema$VcardAddress { + * The device validation request message. + */ + export interface Schema$PawsVerifyDeviceRequest { + /** + * A list of device descriptors, which specifies the slave devices to be + * validated, is required. + */ + deviceDescs: Schema$DeviceDescriptor[]; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The postal code associated with the address. For example: 94423. - */ - code: string; + * The device validation response message. + */ + export interface Schema$PawsVerifyDeviceResponse { + /** + * A database may include the databaseChange parameter to notify a device of + * a change to its database URI, providing one or more alternate database + * URIs. The device should use this information to update its list of + * pre-configured databases by (only) replacing its entry for the responding + * database with the list of alternate URIs. + */ + databaseChange: Schema$DbUpdateSpec; + /** + * A device validities list is required in the device validation response to + * report whether each slave device listed in a previous device validation + * request is valid. The number of entries must match the number of device + * descriptors listed in the previous device validation request. + */ + deviceValidities: Schema$DeviceValidity[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "spectrum#pawsVerifyDeviceResponse". + */ + kind: string; + /** + * The message type (e.g., INIT_REQ, AVAIL_SPECTRUM_REQ, ...). Required + * field. + */ + type: string; + /** + * The PAWS version. Must be exactly 1.0. Required field. + */ + version: string; + } /** - * The country name. For example: US. - */ - country: string; + * This contains parameters for the ruleset of a regulatory domain that is + * communicated using the initialization and available-spectrum processes. + */ + export interface Schema$RulesetInfo { + /** + * The regulatory domain to which the ruleset belongs is required. It must + * be a 2-letter country code. The device should use this to determine + * additional device behavior required by the associated regulatory domain. + */ + authority: string; + /** + * The maximum location change in meters is required in the initialization + * response, but optional otherwise. When the device changes location by + * more than this specified distance, it must contact the database to get + * the available spectrum for the new location. If the device is using + * spectrum that is no longer available, it must immediately cease use of + * the spectrum under rules for database-managed spectrum. If this value is + * provided within the context of an available-spectrum response, it takes + * precedence over the value within the initialization response. + */ + maxLocationChange: number; + /** + * The maximum duration, in seconds, between requests for available + * spectrum. It is required in the initialization response, but optional + * otherwise. The device must contact the database to get available spectrum + * no less frequently than this duration. If the new spectrum information + * indicates that the device is using spectrum that is no longer available, + * it must immediately cease use of those frequencies under rules for + * database-managed spectrum. If this value is provided within the context + * of an available-spectrum response, it takes precedence over the value + * within the initialization response. + */ + maxPollingSecs: number; + /** + * The identifiers of the rulesets supported for the device's location. + * The database should include at least one applicable ruleset in the + * initialization response. The device may use the ruleset identifiers to + * determine parameters to include in subsequent requests. Within the + * context of the available-spectrum responses, the database should include + * the identifier of the ruleset that it used to determine the + * available-spectrum response. If included, the device must use the + * specified ruleset to interpret the response. If the device does not + * support the indicated ruleset, it must not operate in the spectrum + * governed by the ruleset. + */ + rulesetIds: string[]; + } /** - * The city or local equivalent portion of the address. For example: San Jose. - */ - locality: string; + * Available spectrum can be logically characterized by a list of frequency + * ranges and permissible power levels for each range. + */ + export interface Schema$SpectrumMessage { + /** + * The bandwidth (in Hertz) for which permissible power levels are + * specified. For example, FCC regulation would require only one spectrum + * specification at 6MHz bandwidth, but Ofcom regulation would require two + * specifications, at 0.1MHz and 8MHz. This parameter may be empty if there + * is no available spectrum. It will be present otherwise. + */ + bandwidth: number; + /** + * The list of frequency ranges and permissible power levels. The list may + * be empty if there is no available spectrum, otherwise it will be present. + */ + frequencyRanges: Schema$FrequencyRange[]; + } /** - * An optional post office box number. - */ - pobox: string; + * The spectrum schedule element combines an event time with spectrum profile + * to define a time period in which the profile is valid. + */ + export interface Schema$SpectrumSchedule { + /** + * The event time expresses when the spectrum profile is valid. It will + * always be present. + */ + eventTime: Schema$EventTime; + /** + * A list of spectrum messages representing the usable profile. It will + * always be present, but may be empty when there is no available spectrum. + */ + spectra: Schema$SpectrumMessage[]; + } /** - * The state or local equivalent portion of the address. For example: CA. - */ - region: string; + * A vCard-in-JSON message that contains only the fields needed for PAWS: - + * fn: Full name of an individual - org: Name of the organization - adr: + * Address fields - tel: Telephone numbers - email: Email addresses + */ + export interface Schema$Vcard { + /** + * The street address of the entity. + */ + adr: Schema$VcardAddress; + /** + * An email address that can be used to reach the contact. + */ + email: Schema$VcardTypedText; + /** + * The full name of the contact person. For example: John A. Smith. + */ + fn: string; + /** + * The organization associated with the registering entity. + */ + org: Schema$VcardTypedText; + /** + * A telephone number that can be used to call the contact. + */ + tel: Schema$VcardTelephone; + } /** - * The street number and name. For example: 123 Any St. - */ - street: string; -} -/** - * The structure used to represent a telephone number. - */ -export interface Schema$VcardTelephone { + * The structure used to represent a street address. + */ + export interface Schema$VcardAddress { + /** + * The postal code associated with the address. For example: 94423. + */ + code: string; + /** + * The country name. For example: US. + */ + country: string; + /** + * The city or local equivalent portion of the address. For example: San + * Jose. + */ + locality: string; + /** + * An optional post office box number. + */ + pobox: string; + /** + * The state or local equivalent portion of the address. For example: CA. + */ + region: string; + /** + * The street number and name. For example: 123 Any St. + */ + street: string; + } /** - * A nested telephone URI of the form: tel:+1-123-456-7890. + * The structure used to represent a telephone number. */ - uri: string; -} -/** - * The structure used to represent an organization and an email address. - */ -export interface Schema$VcardTypedText { + export interface Schema$VcardTelephone { + /** + * A nested telephone URI of the form: tel:+1-123-456-7890. + */ + uri: string; + } /** - * The text string associated with this item. For example, for an org field: - * ACME, inc. For an email field: smith@example.com. + * The structure used to represent an organization and an email address. */ - text: string; -} - -export class Resource$Paws { - root: Spectrum; - constructor(root: Spectrum) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$VcardTypedText { + /** + * The text string associated with this item. For example, for an org field: + * ACME, inc. For an email field: smith@example.com. + */ + text: string; } - getRoot() { - return this.root; - } - - - /** - * spectrum.paws.getSpectrum - * @desc Requests information about the available spectrum for a device at a - * location. Requests from a fixed-mode device must include owner information - * so the device can be registered with the database. - * @alias spectrum.paws.getSpectrum - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsGetSpectrumRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSpectrum(params?: any, options?: MethodOptions): - AxiosPromise; - getSpectrum( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getSpectrum( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Paws { + root: Spectrum; + constructor(root: Spectrum) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/getSpectrum') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * spectrum.paws.getSpectrumBatch - * @desc The Google Spectrum Database does not support batch requests, so this - * method always yields an UNIMPLEMENTED error. - * @alias spectrum.paws.getSpectrumBatch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsGetSpectrumBatchRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSpectrumBatch(params?: any, options?: MethodOptions): - AxiosPromise; - getSpectrumBatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - getSpectrumBatch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * spectrum.paws.getSpectrum + * @desc Requests information about the available spectrum for a device at a + * location. Requests from a fixed-mode device must include owner + * information so the device can be registered with the database. + * @alias spectrum.paws.getSpectrum + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsGetSpectrumRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSpectrum(params?: any, options?: MethodOptions): + AxiosPromise; + getSpectrum( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getSpectrum( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/getSpectrum') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/getSpectrumBatch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * spectrum.paws.init - * @desc Initializes the connection between a white space device and the - * database. - * @alias spectrum.paws.init - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsInitRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - init(params?: any, options?: MethodOptions): - AxiosPromise; - init( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - init( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/init') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * spectrum.paws.getSpectrumBatch + * @desc The Google Spectrum Database does not support batch requests, so + * this method always yields an UNIMPLEMENTED error. + * @alias spectrum.paws.getSpectrumBatch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsGetSpectrumBatchRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSpectrumBatch(params?: any, options?: MethodOptions): + AxiosPromise; + getSpectrumBatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getSpectrumBatch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/getSpectrumBatch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - } - /** - * spectrum.paws.notifySpectrumUse - * @desc Notifies the database that the device has selected certain frequency - * ranges for transmission. Only to be invoked when required by the regulator. - * The Google Spectrum Database does not operate in domains that require - * notification, so this always yields an UNIMPLEMENTED error. - * @alias spectrum.paws.notifySpectrumUse - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsNotifySpectrumUseRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - notifySpectrumUse(params?: any, options?: MethodOptions): - AxiosPromise; - notifySpectrumUse( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - notifySpectrumUse( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/notifySpectrumUse') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * spectrum.paws.init + * @desc Initializes the connection between a white space device and the + * database. + * @alias spectrum.paws.init + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsInitRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + init(params?: any, options?: MethodOptions): + AxiosPromise; + init( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + init( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/init') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * spectrum.paws.register - * @desc The Google Spectrum Database implements registration in the - * getSpectrum method. As such this always returns an UNIMPLEMENTED error. - * @alias spectrum.paws.register - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsRegisterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - register(params?: any, options?: MethodOptions): - AxiosPromise; - register( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - register( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * spectrum.paws.notifySpectrumUse + * @desc Notifies the database that the device has selected certain + * frequency ranges for transmission. Only to be invoked when required by + * the regulator. The Google Spectrum Database does not operate in domains + * that require notification, so this always yields an UNIMPLEMENTED error. + * @alias spectrum.paws.notifySpectrumUse + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsNotifySpectrumUseRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + notifySpectrumUse(params?: any, options?: MethodOptions): + AxiosPromise; + notifySpectrumUse( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + notifySpectrumUse( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/notifySpectrumUse') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/register') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * spectrum.paws.verifyDevice - * @desc Validates a device for white space use in accordance with regulatory - * rules. The Google Spectrum Database does not support master/slave - * configurations, so this always yields an UNIMPLEMENTED error. - * @alias spectrum.paws.verifyDevice - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().PawsVerifyDeviceRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - verifyDevice(params?: any, options?: MethodOptions): - AxiosPromise; - verifyDevice( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - verifyDevice( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * spectrum.paws.register + * @desc The Google Spectrum Database implements registration in the + * getSpectrum method. As such this always returns an UNIMPLEMENTED error. + * @alias spectrum.paws.register + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsRegisterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + register(params?: any, options?: MethodOptions): + AxiosPromise; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + register( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/register') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/spectrum/v1explorer/paws/verifyDevice') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * spectrum.paws.verifyDevice + * @desc Validates a device for white space use in accordance with + * regulatory rules. The Google Spectrum Database does not support + * master/slave configurations, so this always yields an UNIMPLEMENTED + * error. + * @alias spectrum.paws.verifyDevice + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().PawsVerifyDeviceRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + verifyDevice(params?: any, options?: MethodOptions): + AxiosPromise; + verifyDevice( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + verifyDevice( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/spectrum/v1explorer/paws/verifyDevice') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/speech/v1.ts b/src/apis/speech/v1.ts index d4fc084ff30..e2f38c6b5c8 100644 --- a/src/apis/speech/v1.ts +++ b/src/apis/speech/v1.ts @@ -27,512 +27,520 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Speech API - * - * Converts audio to text by applying powerful neural network models. - * - * @example - * const google = require('googleapis'); - * const speech = google.speech('v1'); - * - * @namespace speech - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Speech - */ -export class Speech { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace speech_v1 { + /** + * Cloud Speech API + * + * Converts audio to text by applying powerful neural network models. + * + * @example + * const google = require('googleapis'); + * const speech = google.speech('v1'); + * + * @namespace speech + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Speech + */ + export class Speech { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - speech: Resource$Speech; + operations: Resource$Operations; + speech: Resource$Speech; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.speech = new Resource$Speech(this); - } + this.operations = new Resource$Operations(this); + this.speech = new Resource$Speech(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The top-level message sent by the client for the `LongRunningRecognize` - * method. - */ -export interface Schema$LongRunningRecognizeRequest { - /** - * *Required* The audio data to be recognized. - */ - audio: Schema$RecognitionAudio; /** - * *Required* Provides information to the recognizer that specifies how to - * process the request. - */ - config: Schema$RecognitionConfig; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Contains audio data in the encoding specified in the `RecognitionConfig`. - * Either `content` or `uri` must be supplied. Supplying both or neither returns - * google.rpc.Code.INVALID_ARGUMENT. See [audio - * limits](https://cloud.google.com/speech/limits#content). - */ -export interface Schema$RecognitionAudio { - /** - * The audio data bytes encoded as specified in `RecognitionConfig`. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - */ - content: string; - /** - * URI that points to a file that contains audio data bytes as specified in - * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are - * supported, which must be specified in the following format: - * `gs://bucket_name/object_name` (other URI formats return - * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request - * URIs](https://cloud.google.com/storage/docs/reference-uris). - */ - uri: string; -} -/** - * Provides information to the recognizer that specifies how to process the - * request. - */ -export interface Schema$RecognitionConfig { - /** - * *Optional* If `true`, the top result includes a list of words and the start - * and end time offsets (timestamps) for those words. If `false`, no - * word-level time offset information is returned. The default is `false`. - */ - enableWordTimeOffsets: boolean; - /** - * Encoding of audio data sent in all `RecognitionAudio` messages. This field - * is optional for `FLAC` and `WAV` audio files and required for all other - * audio formats. For details, see AudioEncoding. - */ - encoding: string; - /** - * *Required* The language of the supplied audio as a - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - * Example: "en-US". See [Language - * Support](https://cloud.google.com/speech/docs/languages) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * *Optional* Maximum number of recognition hypotheses to be returned. - * Specifically, the maximum number of `SpeechRecognitionAlternative` messages - * within each `SpeechRecognitionResult`. The server may return fewer than - * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will - * return a maximum of one. If omitted, will return a maximum of one. - */ - maxAlternatives: number; - /** - * *Optional* If set to `true`, the server will attempt to filter out - * profanities, replacing all but the initial character in each filtered word - * with asterisks, e.g. "f***". If set to `false` or omitted, - * profanities won't be filtered out. - */ - profanityFilter: boolean; - /** - * Sample rate in Hertz of the audio data sent in all `RecognitionAudio` - * messages. Valid values are: 8000-48000. 16000 is optimal. For best results, - * set the sampling rate of the audio source to 16000 Hz. If that's not - * possible, use the native sample rate of the audio source (instead of - * re-sampling). This field is optional for `FLAC` and `WAV` audio files and - * required for all other audio formats. For details, see AudioEncoding. - */ - sampleRateHertz: number; - /** - * *Optional* A means to provide context to assist the speech recognition. - */ - speechContexts: Schema$SpeechContext[]; -} -/** - * The top-level message sent by the client for the `Recognize` method. - */ -export interface Schema$RecognizeRequest { - /** - * *Required* The audio data to be recognized. - */ - audio: Schema$RecognitionAudio; - /** - * *Required* Provides information to the recognizer that specifies how to - * process the request. - */ - config: Schema$RecognitionConfig; -} -/** - * The only message returned to the client by the `Recognize` method. It - * contains the result as zero or more sequential `SpeechRecognitionResult` - * messages. - */ -export interface Schema$RecognizeResponse { - /** - * Output only. Sequential list of transcription results corresponding to - * sequential portions of audio. - */ - results: Schema$SpeechRecognitionResult[]; -} -/** - * Provides "hints" to the speech recognizer to favor specific words - * and phrases in the results. - */ -export interface Schema$SpeechContext { - /** - * *Optional* A list of strings containing words and phrases "hints" - * so that the speech recognition is more likely to recognize them. This can - * be used to improve the accuracy for specific words and phrases, for - * example, if specific commands are typically spoken by the user. This can - * also be used to add additional words to the vocabulary of the recognizer. - * See [usage limits](https://cloud.google.com/speech/limits#content). - */ - phrases: string[]; -} -/** - * Alternative hypotheses (a.k.a. n-best list). - */ -export interface Schema$SpeechRecognitionAlternative { - /** - * Output only. The confidence estimate between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. This field is set only for the top alternative of a non-streaming - * result or, of a streaming result where `is_final=true`. This field is not - * guaranteed to be accurate and users should not rely on it to be always - * provided. The default of 0.0 is a sentinel value indicating `confidence` - * was not set. - */ - confidence: number; + * The top-level message sent by the client for the `LongRunningRecognize` + * method. + */ + export interface Schema$LongRunningRecognizeRequest { + /** + * *Required* The audio data to be recognized. + */ + audio: Schema$RecognitionAudio; + /** + * *Required* Provides information to the recognizer that specifies how to + * process the request. + */ + config: Schema$RecognitionConfig; + } /** - * Output only. Transcript text representing the words that the user spoke. - */ - transcript: string; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Output only. A list of word-specific information for each recognized word. - */ - words: Schema$WordInfo[]; -} -/** - * A speech recognition result corresponding to a portion of the audio. - */ -export interface Schema$SpeechRecognitionResult { + * Contains audio data in the encoding specified in the `RecognitionConfig`. + * Either `content` or `uri` must be supplied. Supplying both or neither + * returns google.rpc.Code.INVALID_ARGUMENT. See [audio + * limits](https://cloud.google.com/speech/limits#content). + */ + export interface Schema$RecognitionAudio { + /** + * The audio data bytes encoded as specified in `RecognitionConfig`. Note: + * as with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + */ + content: string; + /** + * URI that points to a file that contains audio data bytes as specified in + * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are + * supported, which must be specified in the following format: + * `gs://bucket_name/object_name` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + */ + uri: string; + } /** - * Output only. May contain one or more recognition hypotheses (up to the - * maximum specified in `max_alternatives`). These alternatives are ordered in - * terms of accuracy, with the top (first) alternative being the most - * probable, as ranked by the recognizer. - */ - alternatives: Schema$SpeechRecognitionAlternative[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Provides information to the recognizer that specifies how to process the + * request. + */ + export interface Schema$RecognitionConfig { + /** + * *Optional* If `true`, the top result includes a list of words and the + * start and end time offsets (timestamps) for those words. If `false`, no + * word-level time offset information is returned. The default is `false`. + */ + enableWordTimeOffsets: boolean; + /** + * Encoding of audio data sent in all `RecognitionAudio` messages. This + * field is optional for `FLAC` and `WAV` audio files and required for all + * other audio formats. For details, see AudioEncoding. + */ + encoding: string; + /** + * *Required* The language of the supplied audio as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. + * Example: "en-US". See [Language + * Support](https://cloud.google.com/speech/docs/languages) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * *Optional* Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` + * messages within each `SpeechRecognitionResult`. The server may return + * fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` + * or `1` will return a maximum of one. If omitted, will return a maximum of + * one. + */ + maxAlternatives: number; + /** + * *Optional* If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered + * word with asterisks, e.g. "f***". If set to `false` or omitted, + * profanities won't be filtered out. + */ + profanityFilter: boolean; + /** + * Sample rate in Hertz of the audio data sent in all `RecognitionAudio` + * messages. Valid values are: 8000-48000. 16000 is optimal. For best + * results, set the sampling rate of the audio source to 16000 Hz. If + * that's not possible, use the native sample rate of the audio source + * (instead of re-sampling). This field is optional for `FLAC` and `WAV` + * audio files and required for all other audio formats. For details, see + * AudioEncoding. + */ + sampleRateHertz: number; + /** + * *Optional* A means to provide context to assist the speech recognition. + */ + speechContexts: Schema$SpeechContext[]; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * The top-level message sent by the client for the `Recognize` method. + */ + export interface Schema$RecognizeRequest { + /** + * *Required* The audio data to be recognized. + */ + audio: Schema$RecognitionAudio; + /** + * *Required* Provides information to the recognizer that specifies how to + * process the request. + */ + config: Schema$RecognitionConfig; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * The only message returned to the client by the `Recognize` method. It + * contains the result as zero or more sequential `SpeechRecognitionResult` + * messages. */ - details: any[]; + export interface Schema$RecognizeResponse { + /** + * Output only. Sequential list of transcription results corresponding to + * sequential portions of audio. + */ + results: Schema$SpeechRecognitionResult[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Word-specific information for recognized words. - */ -export interface Schema$WordInfo { + * Provides "hints" to the speech recognizer to favor specific words + * and phrases in the results. + */ + export interface Schema$SpeechContext { + /** + * *Optional* A list of strings containing words and phrases + * "hints" so that the speech recognition is more likely to + * recognize them. This can be used to improve the accuracy for specific + * words and phrases, for example, if specific commands are typically spoken + * by the user. This can also be used to add additional words to the + * vocabulary of the recognizer. See [usage + * limits](https://cloud.google.com/speech/limits#content). + */ + phrases: string[]; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the end of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. - */ - endTime: string; + * Alternative hypotheses (a.k.a. n-best list). + */ + export interface Schema$SpeechRecognitionAlternative { + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is set only for the top alternative of a + * non-streaming result or, of a streaming result where `is_final=true`. + * This field is not guaranteed to be accurate and users should not rely on + * it to be always provided. The default of 0.0 is a sentinel value + * indicating `confidence` was not set. + */ + confidence: number; + /** + * Output only. Transcript text representing the words that the user spoke. + */ + transcript: string; + /** + * Output only. A list of word-specific information for each recognized + * word. + */ + words: Schema$WordInfo[]; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the start of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. + * A speech recognition result corresponding to a portion of the audio. */ - startTime: string; + export interface Schema$SpeechRecognitionResult { + /** + * Output only. May contain one or more recognition hypotheses (up to the + * maximum specified in `max_alternatives`). These alternatives are ordered + * in terms of accuracy, with the top (first) alternative being the most + * probable, as ranked by the recognizer. + */ + alternatives: Schema$SpeechRecognitionAlternative[]; + } /** - * Output only. The word corresponding to this set of information. - */ - word: string; -} - -export class Resource$Operations { - root: Speech; - constructor(root: Speech) { - this.root = root; - this.getRoot.bind(this); + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - getRoot() { - return this.root; + /** + * Word-specific information for recognized words. + */ + export interface Schema$WordInfo { + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + endTime: string; + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + startTime: string; + /** + * Output only. The word corresponding to this set of information. + */ + word: string; } - - /** - * speech.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias speech.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Speech; + constructor(root: Speech) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Speech { - root: Speech; - constructor(root: Speech) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * speech.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias speech.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * speech.speech.longrunningrecognize - * @desc Performs asynchronous speech recognition: receive results via the - * google.longrunning.Operations interface. Returns either an - * `Operation.error` or an `Operation.response` which contains a - * `LongRunningRecognizeResponse` message. - * @alias speech.speech.longrunningrecognize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().LongRunningRecognizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - longrunningrecognize(params?: any, options?: MethodOptions): - AxiosPromise; - longrunningrecognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - longrunningrecognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Speech { + root: Speech; + constructor(root: Speech) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/speech:longrunningrecognize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * speech.speech.recognize - * @desc Performs synchronous speech recognition: receive results after all - * audio has been sent and processed. - * @alias speech.speech.recognize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().RecognizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - recognize(params?: any, options?: MethodOptions): - AxiosPromise; - recognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - recognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * speech.speech.longrunningrecognize + * @desc Performs asynchronous speech recognition: receive results via the + * google.longrunning.Operations interface. Returns either an + * `Operation.error` or an `Operation.response` which contains a + * `LongRunningRecognizeResponse` message. + * @alias speech.speech.longrunningrecognize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().LongRunningRecognizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + longrunningrecognize(params?: any, options?: MethodOptions): + AxiosPromise; + longrunningrecognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + longrunningrecognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/speech:longrunningrecognize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/speech:recognize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * speech.speech.recognize + * @desc Performs synchronous speech recognition: receive results after all + * audio has been sent and processed. + * @alias speech.speech.recognize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().RecognizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + recognize(params?: any, options?: MethodOptions): + AxiosPromise; + recognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + recognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/speech:recognize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/speech/v1beta1.ts b/src/apis/speech/v1beta1.ts index 779ad4068fd..33a2b4cac1a 100644 --- a/src/apis/speech/v1beta1.ts +++ b/src/apis/speech/v1beta1.ts @@ -27,476 +27,483 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Speech API - * - * Converts audio to text by applying powerful neural network models. - * - * @example - * const google = require('googleapis'); - * const speech = google.speech('v1beta1'); - * - * @namespace speech - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Speech - */ -export class Speech { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace speech_v1beta1 { + /** + * Cloud Speech API + * + * Converts audio to text by applying powerful neural network models. + * + * @example + * const google = require('googleapis'); + * const speech = google.speech('v1beta1'); + * + * @namespace speech + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Speech + */ + export class Speech { + _options: GlobalOptions; + google: GoogleApis; + root = this; - operations: Resource$Operations; - speech: Resource$Speech; + operations: Resource$Operations; + speech: Resource$Speech; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.operations = new Resource$Operations(this); - this.speech = new Resource$Speech(this); - } + this.operations = new Resource$Operations(this); + this.speech = new Resource$Speech(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * The top-level message sent by the client for the `AsyncRecognize` method. - */ -export interface Schema$AsyncRecognizeRequest { - /** - * *Required* The audio data to be recognized. - */ - audio: Schema$RecognitionAudio; - /** - * *Required* Provides information to the recognizer that specifies how to - * process the request. - */ - config: Schema$RecognitionConfig; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; /** - * The error result of the operation in case of failure or cancellation. + * The top-level message sent by the client for the `AsyncRecognize` method. */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Contains audio data in the encoding specified in the `RecognitionConfig`. - * Either `content` or `uri` must be supplied. Supplying both or neither returns - * google.rpc.Code.INVALID_ARGUMENT. See [audio - * limits](https://cloud.google.com/speech/limits#content). - */ -export interface Schema$RecognitionAudio { - /** - * The audio data bytes encoded as specified in `RecognitionConfig`. Note: as - * with all bytes fields, protobuffers use a pure binary representation, - * whereas JSON representations use base64. - */ - content: string; - /** - * URI that points to a file that contains audio data bytes as specified in - * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are - * supported, which must be specified in the following format: - * `gs://bucket_name/object_name` (other URI formats return - * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request - * URIs](https://cloud.google.com/storage/docs/reference-uris). - */ - uri: string; -} -/** - * Provides information to the recognizer that specifies how to process the - * request. - */ -export interface Schema$RecognitionConfig { - /** - * *Required* Encoding of audio data sent in all `RecognitionAudio` messages. - */ - encoding: string; - /** - * *Optional* The language of the supplied audio as a BCP-47 language tag. - * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt If - * omitted, defaults to "en-US". See [Language - * Support](https://cloud.google.com/speech/docs/languages) for a list of the - * currently supported language codes. - */ - languageCode: string; - /** - * *Optional* Maximum number of recognition hypotheses to be returned. - * Specifically, the maximum number of `SpeechRecognitionAlternative` messages - * within each `SpeechRecognitionResult`. The server may return fewer than - * `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will - * return a maximum of one. If omitted, will return a maximum of one. - */ - maxAlternatives: number; - /** - * *Optional* If set to `true`, the server will attempt to filter out - * profanities, replacing all but the initial character in each filtered word - * with asterisks, e.g. "f***". If set to `false` or omitted, - * profanities won't be filtered out. - */ - profanityFilter: boolean; - /** - * *Required* Sample rate in Hertz of the audio data sent in all - * `RecognitionAudio` messages. Valid values are: 8000-48000. 16000 is - * optimal. For best results, set the sampling rate of the audio source to - * 16000 Hz. If that's not possible, use the native sample rate of the - * audio source (instead of re-sampling). - */ - sampleRate: number; - /** - * *Optional* A means to provide context to assist the speech recognition. - */ - speechContext: Schema$SpeechContext; -} -/** - * Provides "hints" to the speech recognizer to favor specific words - * and phrases in the results. - */ -export interface Schema$SpeechContext { - /** - * *Optional* A list of strings containing words and phrases "hints" - * so that the speech recognition is more likely to recognize them. This can - * be used to improve the accuracy for specific words and phrases, for - * example, if specific commands are typically spoken by the user. This can - * also be used to add additional words to the vocabulary of the recognizer. - * See [usage limits](https://cloud.google.com/speech/limits#content). - */ - phrases: string[]; -} -/** - * Alternative hypotheses (a.k.a. n-best list). - */ -export interface Schema$SpeechRecognitionAlternative { + export interface Schema$AsyncRecognizeRequest { + /** + * *Required* The audio data to be recognized. + */ + audio: Schema$RecognitionAudio; + /** + * *Required* Provides information to the recognizer that specifies how to + * process the request. + */ + config: Schema$RecognitionConfig; + } /** - * *Output-only* The confidence estimate between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. This field is typically provided only for the top hypothesis, and - * only for `is_final=true` results. Clients should not rely on the - * `confidence` field as it is not guaranteed to be accurate, or even set, in - * any of the results. The default of 0.0 is a sentinel value indicating - * `confidence` was not set. + * This resource represents a long-running operation that is the result of a + * network API call. */ - confidence: number; + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * *Output-only* Transcript text representing the words that the user spoke. + * Contains audio data in the encoding specified in the `RecognitionConfig`. + * Either `content` or `uri` must be supplied. Supplying both or neither + * returns google.rpc.Code.INVALID_ARGUMENT. See [audio + * limits](https://cloud.google.com/speech/limits#content). */ - transcript: string; -} -/** - * A speech recognition result corresponding to a portion of the audio. - */ -export interface Schema$SpeechRecognitionResult { + export interface Schema$RecognitionAudio { + /** + * The audio data bytes encoded as specified in `RecognitionConfig`. Note: + * as with all bytes fields, protobuffers use a pure binary representation, + * whereas JSON representations use base64. + */ + content: string; + /** + * URI that points to a file that contains audio data bytes as specified in + * `RecognitionConfig`. Currently, only Google Cloud Storage URIs are + * supported, which must be specified in the following format: + * `gs://bucket_name/object_name` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request + * URIs](https://cloud.google.com/storage/docs/reference-uris). + */ + uri: string; + } /** - * *Output-only* May contain one or more recognition hypotheses (up to the - * maximum specified in `max_alternatives`). + * Provides information to the recognizer that specifies how to process the + * request. */ - alternatives: Schema$SpeechRecognitionAlternative[]; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$RecognitionConfig { + /** + * *Required* Encoding of audio data sent in all `RecognitionAudio` + * messages. + */ + encoding: string; + /** + * *Optional* The language of the supplied audio as a BCP-47 language tag. + * Example: "en-GB" https://www.rfc-editor.org/rfc/bcp/bcp47.txt + * If omitted, defaults to "en-US". See [Language + * Support](https://cloud.google.com/speech/docs/languages) for a list of + * the currently supported language codes. + */ + languageCode: string; + /** + * *Optional* Maximum number of recognition hypotheses to be returned. + * Specifically, the maximum number of `SpeechRecognitionAlternative` + * messages within each `SpeechRecognitionResult`. The server may return + * fewer than `max_alternatives`. Valid values are `0`-`30`. A value of `0` + * or `1` will return a maximum of one. If omitted, will return a maximum of + * one. + */ + maxAlternatives: number; + /** + * *Optional* If set to `true`, the server will attempt to filter out + * profanities, replacing all but the initial character in each filtered + * word with asterisks, e.g. "f***". If set to `false` or omitted, + * profanities won't be filtered out. + */ + profanityFilter: boolean; + /** + * *Required* Sample rate in Hertz of the audio data sent in all + * `RecognitionAudio` messages. Valid values are: 8000-48000. 16000 is + * optimal. For best results, set the sampling rate of the audio source to + * 16000 Hz. If that's not possible, use the native sample rate of the + * audio source (instead of re-sampling). + */ + sampleRate: number; + /** + * *Optional* A means to provide context to assist the speech recognition. + */ + speechContext: Schema$SpeechContext; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Provides "hints" to the speech recognizer to favor specific words + * and phrases in the results. */ - code: number; + export interface Schema$SpeechContext { + /** + * *Optional* A list of strings containing words and phrases + * "hints" so that the speech recognition is more likely to + * recognize them. This can be used to improve the accuracy for specific + * words and phrases, for example, if specific commands are typically spoken + * by the user. This can also be used to add additional words to the + * vocabulary of the recognizer. See [usage + * limits](https://cloud.google.com/speech/limits#content). + */ + phrases: string[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Alternative hypotheses (a.k.a. n-best list). */ - details: any[]; + export interface Schema$SpeechRecognitionAlternative { + /** + * *Output-only* The confidence estimate between 0.0 and 1.0. A higher + * number indicates an estimated greater likelihood that the recognized + * words are correct. This field is typically provided only for the top + * hypothesis, and only for `is_final=true` results. Clients should not rely + * on the `confidence` field as it is not guaranteed to be accurate, or even + * set, in any of the results. The default of 0.0 is a sentinel value + * indicating `confidence` was not set. + */ + confidence: number; + /** + * *Output-only* Transcript text representing the words that the user spoke. + */ + transcript: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * A speech recognition result corresponding to a portion of the audio. */ - message: string; -} -/** - * The top-level message sent by the client for the `SyncRecognize` method. - */ -export interface Schema$SyncRecognizeRequest { + export interface Schema$SpeechRecognitionResult { + /** + * *Output-only* May contain one or more recognition hypotheses (up to the + * maximum specified in `max_alternatives`). + */ + alternatives: Schema$SpeechRecognitionAlternative[]; + } /** - * *Required* The audio data to be recognized. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - audio: Schema$RecognitionAudio; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * *Required* Provides information to the recognizer that specifies how to - * process the request. + * The top-level message sent by the client for the `SyncRecognize` method. */ - config: Schema$RecognitionConfig; -} -/** - * The only message returned to the client by `SyncRecognize`. method. It - * contains the result as zero or more sequential `SpeechRecognitionResult` - * messages. - */ -export interface Schema$SyncRecognizeResponse { + export interface Schema$SyncRecognizeRequest { + /** + * *Required* The audio data to be recognized. + */ + audio: Schema$RecognitionAudio; + /** + * *Required* Provides information to the recognizer that specifies how to + * process the request. + */ + config: Schema$RecognitionConfig; + } /** - * *Output-only* Sequential list of transcription results corresponding to - * sequential portions of audio. + * The only message returned to the client by `SyncRecognize`. method. It + * contains the result as zero or more sequential `SpeechRecognitionResult` + * messages. */ - results: Schema$SpeechRecognitionResult[]; -} - -export class Resource$Operations { - root: Speech; - constructor(root: Speech) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SyncRecognizeResponse { + /** + * *Output-only* Sequential list of transcription results corresponding to + * sequential portions of audio. + */ + results: Schema$SpeechRecognitionResult[]; } - - /** - * speech.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias speech.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Speech; + constructor(root: Speech) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/operations/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Speech { - root: Speech; - constructor(root: Speech) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * speech.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias speech.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/operations/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * speech.speech.asyncrecognize - * @desc Performs asynchronous speech recognition: receive results via the - * [google.longrunning.Operations] - * (/speech/reference/rest/v1beta1/operations#Operation) interface. Returns - * either an `Operation.error` or an `Operation.response` which contains an - * `AsyncRecognizeResponse` message. - * @alias speech.speech.asyncrecognize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().AsyncRecognizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - asyncrecognize(params?: any, options?: MethodOptions): - AxiosPromise; - asyncrecognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - asyncrecognize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Speech { + root: Speech; + constructor(root: Speech) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/speech:asyncrecognize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * speech.speech.syncrecognize - * @desc Performs synchronous speech recognition: receive results after all - * audio has been sent and processed. - * @alias speech.speech.syncrecognize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SyncRecognizeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - syncrecognize(params?: any, options?: MethodOptions): - AxiosPromise; - syncrecognize( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - syncrecognize( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * speech.speech.asyncrecognize + * @desc Performs asynchronous speech recognition: receive results via the + * [google.longrunning.Operations] + * (/speech/reference/rest/v1beta1/operations#Operation) interface. Returns + * either an `Operation.error` or an `Operation.response` which contains an + * `AsyncRecognizeResponse` message. + * @alias speech.speech.asyncrecognize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().AsyncRecognizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + asyncrecognize(params?: any, options?: MethodOptions): + AxiosPromise; + asyncrecognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + asyncrecognize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/speech:asyncrecognize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/speech:syncrecognize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * speech.speech.syncrecognize + * @desc Performs synchronous speech recognition: receive results after all + * audio has been sent and processed. + * @alias speech.speech.syncrecognize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SyncRecognizeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + syncrecognize(params?: any, options?: MethodOptions): + AxiosPromise; + syncrecognize( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + syncrecognize( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://speech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/speech:syncrecognize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/sqladmin/v1beta3.ts b/src/apis/sqladmin/v1beta3.ts index 950849e7f56..7f469769ab9 100644 --- a/src/apis/sqladmin/v1beta3.ts +++ b/src/apis/sqladmin/v1beta3.ts @@ -27,2458 +27,2478 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud SQL Administration API - * - * Creates and configures Cloud SQL instances, which provide fully-managed MySQL - * databases. - * - * @example - * const google = require('googleapis'); - * const sqladmin = google.sqladmin('v1beta3'); - * - * @namespace sqladmin - * @type {Function} - * @version v1beta3 - * @variation v1beta3 - * @param {object=} options Options for Sqladmin - */ -export class Sqladmin { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - backupRuns: Resource$Backupruns; - flags: Resource$Flags; - instances: Resource$Instances; - operations: Resource$Operations; - sslCerts: Resource$Sslcerts; - tiers: Resource$Tiers; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.backupRuns = new Resource$Backupruns(this); - this.flags = new Resource$Flags(this); - this.instances = new Resource$Instances(this); - this.operations = new Resource$Operations(this); - this.sslCerts = new Resource$Sslcerts(this); - this.tiers = new Resource$Tiers(this); - } - - getRoot() { - return this.root; +export namespace sqladmin_v1beta3 { + /** + * Cloud SQL Administration API + * + * Creates and configures Cloud SQL instances, which provide fully-managed + * MySQL databases. + * + * @example + * const google = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta3'); + * + * @namespace sqladmin + * @type {Function} + * @version v1beta3 + * @variation v1beta3 + * @param {object=} options Options for Sqladmin + */ + export class Sqladmin { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + backupRuns: Resource$Backupruns; + flags: Resource$Flags; + instances: Resource$Instances; + operations: Resource$Operations; + sslCerts: Resource$Sslcerts; + tiers: Resource$Tiers; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.backupRuns = new Resource$Backupruns(this); + this.flags = new Resource$Flags(this); + this.instances = new Resource$Instances(this); + this.operations = new Resource$Operations(this); + this.sslCerts = new Resource$Sslcerts(this); + this.tiers = new Resource$Tiers(this); + } + + getRoot() { + return this.root; + } } -} -/** - * Database instance backup configuration. - */ -export interface Schema$BackupConfiguration { - /** - * Whether binary log is enabled. If backup configuration is disabled, binary - * log must be disabled as well. - */ - binaryLogEnabled: boolean; - /** - * Whether this configuration is enabled. - */ - enabled: boolean; - /** - * Identifier for this configuration. This gets generated automatically when a - * backup configuration is created. - */ - id: string; - /** - * This is always sql#backupConfiguration. - */ - kind: string; - /** - * Whether replication log archiving is enabled. Replication log archiving is - * required for the point-in-time recovery (PITR) feature. PostgreSQL - * instances only. - */ - replicationLogArchivingEnabled: boolean; - /** - * Start time for the daily backup configuration in UTC timezone in the 24 - * hour format - HH:MM. - */ - startTime: string; -} -/** - * A database instance backup run resource. - */ -export interface Schema$BackupRun { - /** - * Backup Configuration identifier. - */ - backupConfiguration: string; - /** - * The due time of this run in UTC timezone in RFC 3339 format, for example - * 2012-11-15T16:19:00.094Z. - */ - dueTime: string; - /** - * The time the backup operation completed in UTC timezone in RFC 3339 format, - * for example 2012-11-15T16:19:00.094Z. - */ - endTime: string; - /** - * The time the run was enqueued in UTC timezone in RFC 3339 format, for - * example 2012-11-15T16:19:00.094Z. - */ - enqueuedTime: string; - /** - * Information about why the backup operation failed. This is only present if - * the run has the FAILED status. - */ - error: Schema$OperationError; - /** - * Name of the database instance. - */ - instance: string; - /** - * This is always sql#backupRun. - */ - kind: string; - /** - * The time the backup operation actually started in UTC timezone in RFC 3339 - * format, for example 2012-11-15T16:19:00.094Z. - */ - startTime: string; - /** - * The status of this run. - */ - status: string; -} -/** - * Backup run list results. - */ -export interface Schema$BackupRunsListResponse { - /** - * A list of backup runs in reverse chronological order of the enqueued time. - */ - items: Schema$BackupRun[]; - /** - * This is always sql#backupRunsList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Binary log coordinates. - */ -export interface Schema$BinLogCoordinates { - /** - * Name of the binary log file for a Cloud SQL instance. - */ - binLogFileName: string; - /** - * Position (offset) within the binary log file. - */ - binLogPosition: string; - /** - * This is always sql#binLogCoordinates. - */ - kind: string; -} -/** - * Database instance clone context. - */ -export interface Schema$CloneContext { - /** - * Binary log coordinates, if specified, indentify the position up to which - * the source instance should be cloned. If not specified, the source instance - * is cloned up to the most recent binary log coordinates. - */ - binLogCoordinates: Schema$BinLogCoordinates; - /** - * Name of the Cloud SQL instance to be created as a clone. - */ - destinationInstanceName: string; - /** - * This is always sql#cloneContext. - */ - kind: string; - /** - * The epoch timestamp, in milliseconds, of the time to which a point-in-time - * recovery (PITR) is performed. PostgreSQL instances only. For MySQL - * instances, use the binLogCoordinates property. - */ - pitrTimestampMs: string; - /** - * Name of the Cloud SQL instance to be cloned. - */ - sourceInstanceName: string; -} -/** - * MySQL flags for Cloud SQL instances. - */ -export interface Schema$DatabaseFlags { - /** - * The name of the flag. These flags are passed at instance startup, so - * include both MySQL server options and MySQL system variables. Flags should - * be specified with underscores, not hyphens. For more information, see - * Configuring MySQL Flags in the Google Cloud SQL documentation, as well as - * the official MySQL documentation for server options and system variables. - */ - name: string; - /** - * The value of the flag. Booleans should be set to on for true and off for - * false. This field must be omitted if the flag doesn't take a value. - */ - value: string; -} -/** - * A Cloud SQL instance resource. - */ -export interface Schema$DatabaseInstance { - /** - * Connection name of the Cloud SQL instance used in connection strings. - */ - connectionName: string; - /** - * The current disk usage of the instance in bytes. - */ - currentDiskSize: string; - /** - * The database engine type and version. Can be MYSQL_5_5 or MYSQL_5_6. - * Defaults to MYSQL_5_5. The databaseVersion cannot be changed after instance - * creation. - */ - databaseVersion: string; - /** - * HTTP 1.1 Entity tag for the resource. - */ - etag: string; - /** - * Name of the Cloud SQL instance. This does not include the project ID. - */ - instance: string; - /** - * The instance type. This can be one of the following. CLOUD_SQL_INSTANCE: - * Regular Cloud SQL instance. READ_REPLICA_INSTANCE: Cloud SQL instance - * acting as a read-replica. - */ - instanceType: string; - /** - * The assigned IP addresses for the instance. - */ - ipAddresses: Schema$IpMapping[]; - /** - * The IPv6 address assigned to the instance. - */ - ipv6Address: string; - /** - * This is always sql#instance. - */ - kind: string; - /** - * The name of the instance which will act as master in the replication setup. - */ - masterInstanceName: string; - /** - * The maximum disk size of the instance in bytes. - */ - maxDiskSize: string; - /** - * The project ID of the project containing the Cloud SQL instance. The Google - * apps domain is prefixed if applicable. - */ - project: string; - /** - * The geographical region. Can be us-central, asia-east1 or europe-west1. - * Defaults to us-central. The region can not be changed after instance - * creation. - */ - region: string; - /** - * The replicas of the instance. - */ - replicaNames: string[]; - /** - * SSL configuration. - */ - serverCaCert: Schema$SslCert; - /** - * The service account email address assigned to the instance. - */ - serviceAccountEmailAddress: string; - /** - * The user settings. - */ - settings: Schema$Settings; - /** - * The current serving state of the Cloud SQL instance. This can be one of the - * following. RUNNABLE: The instance is running, or is ready to run when - * accessed. SUSPENDED: The instance is not available, for example due to - * problems with billing. PENDING_CREATE: The instance is being created. - * MAINTENANCE: The instance is down for maintenance. UNKNOWN_STATE: The state - * of the instance is unknown. - */ - state: string; -} -/** - * Database instance export context. - */ -export interface Schema$ExportContext { - /** - * Databases (for example, guestbook) from which the export is made. If - * unspecified, all databases are exported. - */ - database: string[]; - /** - * This is always sql#exportContext. - */ - kind: string; - /** - * Tables to export, or that were exported, from the specified database. If - * you specify tables, specify one and only one database. - */ - table: string[]; - /** - * The path to the file in Google Cloud Storage where the export will be - * stored, or where it was already stored. The URI is in the form - * gs://bucketName/fileName. If the file already exists, the operation fails. - * If the filename ends with .gz, the contents are compressed. - */ - uri: string; -} -/** - * A Google Cloud SQL service flag resource. - */ -export interface Schema$Flag { - /** - * For STRING flags, a list of strings that the value can be set to. - */ - allowedStringValues: string[]; - /** - * The database version this flag applies to. Currently this can only be - * [MYSQL_5_5]. - */ - appliesTo: string[]; - /** - * This is always sql#flag. - */ - kind: string; - /** - * For INTEGER flags, the maximum allowed value. - */ - maxValue: string; - /** - * For INTEGER flags, the minimum allowed value. - */ - minValue: string; - /** - * This is the name of the flag. Flag names always use underscores, not - * hyphens, e.g. max_allowed_packet - */ - name: string; - /** - * The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER or - * NONE. NONE is used for flags which do not take a value, such as - * skip_grant_tables. - */ - type: string; -} -/** - * Flags list response. - */ -export interface Schema$FlagsListResponse { - /** - * List of flags. - */ - items: Schema$Flag[]; - /** - * This is always sql#flagsList. - */ - kind: string; -} -/** - * Database instance import context. - */ -export interface Schema$ImportContext { - /** - * The database (for example, guestbook) to which the import is made. If not - * set, it is assumed that the database is specified in the file to be - * imported. - */ - database: string; - /** - * This is always sql#importContext. - */ - kind: string; - /** - * A path to the MySQL dump file in Google Cloud Storage from which the import - * is made. The URI is in the form gs://bucketName/fileName. Compressed gzip - * files (.gz) are also supported. - */ - uri: string[]; -} -/** - * An Operations resource contains information about database instance - * operations such as create, delete, and restart. Operations resources are - * created in response to operations that were initiated; you never create them - * directly. - */ -export interface Schema$InstanceOperation { - /** - * The time this operation finished in UTC timezone in RFC 3339 format, for - * example 2012-11-15T16:19:00.094Z. - */ - endTime: string; - /** - * The time this operation was enqueued in UTC timezone in RFC 3339 format, - * for example 2012-11-15T16:19:00.094Z. - */ - enqueuedTime: string; - /** - * The error(s) encountered by this operation. Only set if the operation - * results in an error. - */ - error: Schema$OperationError[]; - /** - * The context for export operation, if applicable. - */ - exportContext: Schema$ExportContext; - /** - * The context for import operation, if applicable. - */ - importContext: Schema$ImportContext; - /** - * Name of the database instance. - */ - instance: string; - /** - * This is always sql#instanceOperation. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; - /** - * The type of the operation. Valid values are CREATE, DELETE, UPDATE, - * RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME. - */ - operationType: string; - /** - * The time this operation actually started in UTC timezone in RFC 3339 - * format, for example 2012-11-15T16:19:00.094Z. - */ - startTime: string; - /** - * The state of an operation. Valid values are PENDING, RUNNING, DONE, - * UNKNOWN. - */ - state: string; - /** - * The email address of the user who initiated this operation. - */ - userEmailAddress: string; -} -/** - * Database instance clone request. - */ -export interface Schema$InstancesCloneRequest { - /** - * Contains details about the clone operation. - */ - cloneContext: Schema$CloneContext; -} -/** - * Database instance clone response. - */ -export interface Schema$InstancesCloneResponse { - /** - * This is always sql#instancesClone. - */ - kind: string; - /** - * An unique identifier for the operation associated with the cloned instance. - * You can use this identifier to retrieve the Operations resource, which has - * information about the operation. - */ - operation: string; -} -/** - * Database instance delete response. - */ -export interface Schema$InstancesDeleteResponse { - /** - * This is always sql#instancesDelete. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance set root password request. - */ -export interface Schema$InstanceSetRootPasswordRequest { - /** - * Set Root Password Context. - */ - setRootPasswordContext: Schema$SetRootPasswordContext; -} -/** - * Database instance export request. - */ -export interface Schema$InstancesExportRequest { - /** - * Contains details about the export operation. - */ - exportContext: Schema$ExportContext; -} -/** - * Database instance export response. - */ -export interface Schema$InstancesExportResponse { - /** - * This is always sql#instancesExport. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance import request. - */ -export interface Schema$InstancesImportRequest { - /** - * Contains details about the import operation. - */ - importContext: Schema$ImportContext; -} -/** - * Database instance import response. - */ -export interface Schema$InstancesImportResponse { - /** - * This is always sql#instancesImport. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance insert response. - */ -export interface Schema$InstancesInsertResponse { - /** - * This is always sql#instancesInsert. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instances list response. - */ -export interface Schema$InstancesListResponse { - /** - * List of database instance resources. - */ - items: Schema$DatabaseInstance[]; - /** - * This is always sql#instancesList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Database promote read replica response. - */ -export interface Schema$InstancesPromoteReplicaResponse { - /** - * This is always sql#instancesPromoteReplica. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance resetSslConfig response. - */ -export interface Schema$InstancesResetSslConfigResponse { - /** - * This is always sql#instancesResetSslConfig. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. All ssl client certificates will be deleted and a new server - * certificate will be created. Does not take effect until the next instance - * restart. - */ - operation: string; -} -/** - * Database instance restart response. - */ -export interface Schema$InstancesRestartResponse { - /** - * This is always sql#instancesRestart. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance restore backup response. - */ -export interface Schema$InstancesRestoreBackupResponse { - /** - * This is always sql#instancesRestoreBackup. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance set root password response. - */ -export interface Schema$InstancesSetRootPasswordResponse { - /** - * This is always sql#instancesSetRootPassword. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * Database instance update response. - */ -export interface Schema$InstancesUpdateResponse { - /** - * This is always sql#instancesUpdate. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve information about the operation. - */ - operation: string; -} -/** - * IP Management configuration. - */ -export interface Schema$IpConfiguration { - /** - * The list of external networks that are allowed to connect to the instance - * using the IP. In CIDR notation, also known as 'slash' notation - * (e.g. 192.168.100.0/24). - */ - authorizedNetworks: string[]; - /** - * Whether the instance should be assigned an IP address or not. - */ - enabled: boolean; - /** - * This is always sql#ipConfiguration. - */ - kind: string; - /** - * Whether SSL connections over IP should be enforced or not. - */ - requireSsl: boolean; -} -/** - * Database instance IP Mapping. - */ -export interface Schema$IpMapping { - /** - * The IP address assigned. - */ - ipAddress: string; - /** - * The due time for this IP to be retired in RFC 3339 format, for example - * 2012-11-15T16:19:00.094Z. This field is only available when the IP is - * scheduled to be retired. - */ - timeToRetire: string; -} -/** - * Preferred location. This specifies where a Cloud SQL instance should - * preferably be located, either in a specific Compute Engine zone, or - * co-located with an App Engine application. Note that if the preferred - * location is not available, the instance will be located as close as possible - * within the region. Only one location may be specified. - */ -export interface Schema$LocationPreference { - /** - * The App Engine application to follow, it must be in the same region as the - * Cloud SQL instance. - */ - followGaeApplication: string; - /** - * This is always sql#locationPreference. - */ - kind: string; - /** - * The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, etc.). - */ - zone: string; -} -/** - * Database instance operation error. - */ -export interface Schema$OperationError { - /** - * Identifies the specific error that occurred. - */ - code: string; - /** - * This is always sql#operationError. - */ - kind: string; -} -/** - * Database instance list operations response. - */ -export interface Schema$OperationsListResponse { - /** - * List of operation resources. - */ - items: Schema$InstanceOperation[]; - /** - * This is always sql#operationsList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Database instance set root password context. - */ -export interface Schema$SetRootPasswordContext { - /** - * This is always sql#setRootUserContext. - */ - kind: string; - /** - * The password for the root user. - */ - password: string; -} -/** - * Database instance settings. - */ -export interface Schema$Settings { - /** - * The activation policy for this instance. This specifies when the instance - * should be activated and is applicable only when the instance state is - * RUNNABLE. This can be one of the following. ALWAYS: The instance should - * always be active. NEVER: The instance should never be activated. ON_DEMAND: - * The instance is activated upon receiving requests. - */ - activationPolicy: string; - /** - * The App Engine app IDs that can access this instance. - */ - authorizedGaeApplications: string[]; - /** - * The daily backup configuration for the instance. - */ - backupConfiguration: Schema$BackupConfiguration[]; - /** - * The database flags passed to the instance at startup. - */ - databaseFlags: Schema$DatabaseFlags[]; - /** - * Configuration specific to read replica instance. Indicates whether - * replication is enabled or not. - */ - databaseReplicationEnabled: boolean; - /** - * The settings for IP Management. This allows to enable or disable the - * instance IP and manage which external networks can connect to the instance. - */ - ipConfiguration: Schema$IpConfiguration; - /** - * This is always sql#settings. - */ - kind: string; - /** - * The location preference settings. This allows the instance to be located as - * near as possible to either an App Engine app or GCE zone for better - * performance. - */ - locationPreference: Schema$LocationPreference; - /** - * The pricing plan for this instance. This can be either PER_USE or PACKAGE. - */ - pricingPlan: string; - /** - * The type of replication this instance uses. This can be either ASYNCHRONOUS - * or SYNCHRONOUS. - */ - replicationType: string; - /** - * The version of instance settings. This is a required field for update - * method to make sure concurrent updates are handled properly. During update, - * use the most recent settingsVersion value for this instance and do not try - * to update this value. - */ - settingsVersion: string; - /** - * The tier of service for this instance, for example D1, D2. For more - * information, see pricing. - */ - tier: string; -} -/** - * SslCerts Resource - */ -export interface Schema$SslCert { - /** - * PEM representation. - */ - cert: string; - /** - * Serial number, as extracted from the certificate. - */ - certSerialNumber: string; - /** - * User supplied name. Constrained to [a-zA-Z.-_ ]+. - */ - commonName: string; - /** - * Time when the certificate was created. - */ - createTime: string; - /** - * Time when the certificate expires. - */ - expirationTime: string; - /** - * Name of the database instance. - */ - instance: string; - /** - * This is always sql#sslCert. - */ - kind: string; - /** - * Sha1 Fingerprint. - */ - sha1Fingerprint: string; -} -/** - * SslCertDetail. - */ -export interface Schema$SslCertDetail { /** - * The public information about the cert. - */ - certInfo: Schema$SslCert; + * Database instance backup configuration. + */ + export interface Schema$BackupConfiguration { + /** + * Whether binary log is enabled. If backup configuration is disabled, + * binary log must be disabled as well. + */ + binaryLogEnabled: boolean; + /** + * Whether this configuration is enabled. + */ + enabled: boolean; + /** + * Identifier for this configuration. This gets generated automatically when + * a backup configuration is created. + */ + id: string; + /** + * This is always sql#backupConfiguration. + */ + kind: string; + /** + * Whether replication log archiving is enabled. Replication log archiving + * is required for the point-in-time recovery (PITR) feature. PostgreSQL + * instances only. + */ + replicationLogArchivingEnabled: boolean; + /** + * Start time for the daily backup configuration in UTC timezone in the 24 + * hour format - HH:MM. + */ + startTime: string; + } /** - * The private key for the client cert, in pem format. Keep private in order - * to protect your security. - */ - certPrivateKey: string; -} -/** - * SslCert delete response. - */ -export interface Schema$SslCertsDeleteResponse { + * A database instance backup run resource. + */ + export interface Schema$BackupRun { + /** + * Backup Configuration identifier. + */ + backupConfiguration: string; + /** + * The due time of this run in UTC timezone in RFC 3339 format, for example + * 2012-11-15T16:19:00.094Z. + */ + dueTime: string; + /** + * The time the backup operation completed in UTC timezone in RFC 3339 + * format, for example 2012-11-15T16:19:00.094Z. + */ + endTime: string; + /** + * The time the run was enqueued in UTC timezone in RFC 3339 format, for + * example 2012-11-15T16:19:00.094Z. + */ + enqueuedTime: string; + /** + * Information about why the backup operation failed. This is only present + * if the run has the FAILED status. + */ + error: Schema$OperationError; + /** + * Name of the database instance. + */ + instance: string; + /** + * This is always sql#backupRun. + */ + kind: string; + /** + * The time the backup operation actually started in UTC timezone in RFC + * 3339 format, for example 2012-11-15T16:19:00.094Z. + */ + startTime: string; + /** + * The status of this run. + */ + status: string; + } /** - * This is always sql#sslCertsDelete. - */ - kind: string; + * Backup run list results. + */ + export interface Schema$BackupRunsListResponse { + /** + * A list of backup runs in reverse chronological order of the enqueued + * time. + */ + items: Schema$BackupRun[]; + /** + * This is always sql#backupRunsList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + } /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - operation: string; -} -/** - * SslCerts insert request. - */ -export interface Schema$SslCertsInsertRequest { + * Binary log coordinates. + */ + export interface Schema$BinLogCoordinates { + /** + * Name of the binary log file for a Cloud SQL instance. + */ + binLogFileName: string; + /** + * Position (offset) within the binary log file. + */ + binLogPosition: string; + /** + * This is always sql#binLogCoordinates. + */ + kind: string; + } /** - * User supplied name. Must be a distinct name from the other certificates for - * this instance. New certificates will not be usable until the instance is - * restarted. - */ - commonName: string; -} -/** - * SslCert insert response. - */ -export interface Schema$SslCertsInsertResponse { + * Database instance clone context. + */ + export interface Schema$CloneContext { + /** + * Binary log coordinates, if specified, indentify the position up to which + * the source instance should be cloned. If not specified, the source + * instance is cloned up to the most recent binary log coordinates. + */ + binLogCoordinates: Schema$BinLogCoordinates; + /** + * Name of the Cloud SQL instance to be created as a clone. + */ + destinationInstanceName: string; + /** + * This is always sql#cloneContext. + */ + kind: string; + /** + * The epoch timestamp, in milliseconds, of the time to which a + * point-in-time recovery (PITR) is performed. PostgreSQL instances only. + * For MySQL instances, use the binLogCoordinates property. + */ + pitrTimestampMs: string; + /** + * Name of the Cloud SQL instance to be cloned. + */ + sourceInstanceName: string; + } /** - * The new client certificate and private key. The new certificate will not - * work until the instance is restarted. - */ - clientCert: Schema$SslCertDetail; + * MySQL flags for Cloud SQL instances. + */ + export interface Schema$DatabaseFlags { + /** + * The name of the flag. These flags are passed at instance startup, so + * include both MySQL server options and MySQL system variables. Flags + * should be specified with underscores, not hyphens. For more information, + * see Configuring MySQL Flags in the Google Cloud SQL documentation, as + * well as the official MySQL documentation for server options and system + * variables. + */ + name: string; + /** + * The value of the flag. Booleans should be set to on for true and off for + * false. This field must be omitted if the flag doesn't take a value. + */ + value: string; + } /** - * This is always sql#sslCertsInsert. - */ - kind: string; + * A Cloud SQL instance resource. + */ + export interface Schema$DatabaseInstance { + /** + * Connection name of the Cloud SQL instance used in connection strings. + */ + connectionName: string; + /** + * The current disk usage of the instance in bytes. + */ + currentDiskSize: string; + /** + * The database engine type and version. Can be MYSQL_5_5 or MYSQL_5_6. + * Defaults to MYSQL_5_5. The databaseVersion cannot be changed after + * instance creation. + */ + databaseVersion: string; + /** + * HTTP 1.1 Entity tag for the resource. + */ + etag: string; + /** + * Name of the Cloud SQL instance. This does not include the project ID. + */ + instance: string; + /** + * The instance type. This can be one of the following. CLOUD_SQL_INSTANCE: + * Regular Cloud SQL instance. READ_REPLICA_INSTANCE: Cloud SQL instance + * acting as a read-replica. + */ + instanceType: string; + /** + * The assigned IP addresses for the instance. + */ + ipAddresses: Schema$IpMapping[]; + /** + * The IPv6 address assigned to the instance. + */ + ipv6Address: string; + /** + * This is always sql#instance. + */ + kind: string; + /** + * The name of the instance which will act as master in the replication + * setup. + */ + masterInstanceName: string; + /** + * The maximum disk size of the instance in bytes. + */ + maxDiskSize: string; + /** + * The project ID of the project containing the Cloud SQL instance. The + * Google apps domain is prefixed if applicable. + */ + project: string; + /** + * The geographical region. Can be us-central, asia-east1 or europe-west1. + * Defaults to us-central. The region can not be changed after instance + * creation. + */ + region: string; + /** + * The replicas of the instance. + */ + replicaNames: string[]; + /** + * SSL configuration. + */ + serverCaCert: Schema$SslCert; + /** + * The service account email address assigned to the instance. + */ + serviceAccountEmailAddress: string; + /** + * The user settings. + */ + settings: Schema$Settings; + /** + * The current serving state of the Cloud SQL instance. This can be one of + * the following. RUNNABLE: The instance is running, or is ready to run when + * accessed. SUSPENDED: The instance is not available, for example due to + * problems with billing. PENDING_CREATE: The instance is being created. + * MAINTENANCE: The instance is down for maintenance. UNKNOWN_STATE: The + * state of the instance is unknown. + */ + state: string; + } /** - * The server Certificate Authority's certificate. If this is missing you - * can force a new one to be generated by calling resetSslConfig method on - * instances resource.. - */ - serverCaCert: Schema$SslCert; -} -/** - * SslCerts list response. - */ -export interface Schema$SslCertsListResponse { + * Database instance export context. + */ + export interface Schema$ExportContext { + /** + * Databases (for example, guestbook) from which the export is made. If + * unspecified, all databases are exported. + */ + database: string[]; + /** + * This is always sql#exportContext. + */ + kind: string; + /** + * Tables to export, or that were exported, from the specified database. If + * you specify tables, specify one and only one database. + */ + table: string[]; + /** + * The path to the file in Google Cloud Storage where the export will be + * stored, or where it was already stored. The URI is in the form + * gs://bucketName/fileName. If the file already exists, the operation + * fails. If the filename ends with .gz, the contents are compressed. + */ + uri: string; + } /** - * List of client certificates for the instance. - */ - items: Schema$SslCert[]; + * A Google Cloud SQL service flag resource. + */ + export interface Schema$Flag { + /** + * For STRING flags, a list of strings that the value can be set to. + */ + allowedStringValues: string[]; + /** + * The database version this flag applies to. Currently this can only be + * [MYSQL_5_5]. + */ + appliesTo: string[]; + /** + * This is always sql#flag. + */ + kind: string; + /** + * For INTEGER flags, the maximum allowed value. + */ + maxValue: string; + /** + * For INTEGER flags, the minimum allowed value. + */ + minValue: string; + /** + * This is the name of the flag. Flag names always use underscores, not + * hyphens, e.g. max_allowed_packet + */ + name: string; + /** + * The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER + * or NONE. NONE is used for flags which do not take a value, such as + * skip_grant_tables. + */ + type: string; + } /** - * This is always sql#sslCertsList. - */ - kind: string; -} -/** - * A Google Cloud SQL service tier resource. - */ -export interface Schema$Tier { + * Flags list response. + */ + export interface Schema$FlagsListResponse { + /** + * List of flags. + */ + items: Schema$Flag[]; + /** + * This is always sql#flagsList. + */ + kind: string; + } /** - * The maximum disk size of this tier in bytes. - */ - DiskQuota: string; + * Database instance import context. + */ + export interface Schema$ImportContext { + /** + * The database (for example, guestbook) to which the import is made. If not + * set, it is assumed that the database is specified in the file to be + * imported. + */ + database: string; + /** + * This is always sql#importContext. + */ + kind: string; + /** + * A path to the MySQL dump file in Google Cloud Storage from which the + * import is made. The URI is in the form gs://bucketName/fileName. + * Compressed gzip files (.gz) are also supported. + */ + uri: string[]; + } /** - * This is always sql#tier. - */ - kind: string; + * An Operations resource contains information about database instance + * operations such as create, delete, and restart. Operations resources are + * created in response to operations that were initiated; you never create + * them directly. + */ + export interface Schema$InstanceOperation { + /** + * The time this operation finished in UTC timezone in RFC 3339 format, for + * example 2012-11-15T16:19:00.094Z. + */ + endTime: string; + /** + * The time this operation was enqueued in UTC timezone in RFC 3339 format, + * for example 2012-11-15T16:19:00.094Z. + */ + enqueuedTime: string; + /** + * The error(s) encountered by this operation. Only set if the operation + * results in an error. + */ + error: Schema$OperationError[]; + /** + * The context for export operation, if applicable. + */ + exportContext: Schema$ExportContext; + /** + * The context for import operation, if applicable. + */ + importContext: Schema$ImportContext; + /** + * Name of the database instance. + */ + instance: string; + /** + * This is always sql#instanceOperation. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; + /** + * The type of the operation. Valid values are CREATE, DELETE, UPDATE, + * RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME. + */ + operationType: string; + /** + * The time this operation actually started in UTC timezone in RFC 3339 + * format, for example 2012-11-15T16:19:00.094Z. + */ + startTime: string; + /** + * The state of an operation. Valid values are PENDING, RUNNING, DONE, + * UNKNOWN. + */ + state: string; + /** + * The email address of the user who initiated this operation. + */ + userEmailAddress: string; + } /** - * The maximum RAM usage of this tier in bytes. + * Database instance clone request. */ - RAM: string; + export interface Schema$InstancesCloneRequest { + /** + * Contains details about the clone operation. + */ + cloneContext: Schema$CloneContext; + } /** - * The applicable regions for this tier. - */ - region: string[]; + * Database instance clone response. + */ + export interface Schema$InstancesCloneResponse { + /** + * This is always sql#instancesClone. + */ + kind: string; + /** + * An unique identifier for the operation associated with the cloned + * instance. You can use this identifier to retrieve the Operations + * resource, which has information about the operation. + */ + operation: string; + } /** - * An identifier for the service tier, for example D1, D2 etc. For related - * information, see Pricing. - */ - tier: string; -} -/** - * Tiers list response. - */ -export interface Schema$TiersListResponse { + * Database instance delete response. + */ + export interface Schema$InstancesDeleteResponse { + /** + * This is always sql#instancesDelete. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; + } /** - * List of tiers. + * Database instance set root password request. */ - items: Schema$Tier[]; + export interface Schema$InstanceSetRootPasswordRequest { + /** + * Set Root Password Context. + */ + setRootPasswordContext: Schema$SetRootPasswordContext; + } /** - * This is always sql#tiersList. + * Database instance export request. */ - kind: string; -} - -export class Resource$Backupruns { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$InstancesExportRequest { + /** + * Contains details about the export operation. + */ + exportContext: Schema$ExportContext; } - - getRoot() { - return this.root; + /** + * Database instance export response. + */ + export interface Schema$InstancesExportResponse { + /** + * This is always sql#instancesExport. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - /** - * sql.backupRuns.get - * @desc Retrieves information about a specified backup run for a Cloud SQL - * instance. - * @alias sql.backupRuns.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backupConfiguration Identifier for the backup configuration. This gets generated automatically when a backup configuration is created. - * @param {string} params.dueTime The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database instance import request. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'backupConfiguration', 'dueTime'], - pathParams: ['backupConfiguration', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesImportRequest { + /** + * Contains details about the import operation. + */ + importContext: Schema$ImportContext; } - - /** - * sql.backupRuns.list - * @desc Lists all backup runs associated with a Cloud SQL instance. - * @alias sql.backupRuns.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backupConfiguration Identifier for the backup configuration. This gets generated automatically when a backup configuration is created. - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {integer=} params.maxResults Maximum number of backup runs per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/backupRuns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'backupConfiguration'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance import response. + */ + export interface Schema$InstancesImportResponse { + /** + * This is always sql#instancesImport. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } -} - -export class Resource$Flags { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Database instance insert response. + */ + export interface Schema$InstancesInsertResponse { + /** + * This is always sql#instancesInsert. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - getRoot() { - return this.root; + /** + * Database instances list response. + */ + export interface Schema$InstancesListResponse { + /** + * List of database instance resources. + */ + items: Schema$DatabaseInstance[]; + /** + * This is always sql#instancesList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * sql.flags.list - * @desc Lists all database flags that can be set for Google Cloud SQL - * instances. - * @alias sql.flags.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta3/flags').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database promote read replica response. + */ + export interface Schema$InstancesPromoteReplicaResponse { + /** + * This is always sql#instancesPromoteReplica. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } -} - -export class Resource$Instances { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Database instance resetSslConfig response. + */ + export interface Schema$InstancesResetSslConfigResponse { + /** + * This is always sql#instancesResetSslConfig. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. All ssl client certificates will be deleted and a new + * server certificate will be created. Does not take effect until the next + * instance restart. + */ + operation: string; } - - getRoot() { - return this.root; + /** + * Database instance restart response. + */ + export interface Schema$InstancesRestartResponse { + /** + * This is always sql#instancesRestart. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - /** - * sql.instances.clone - * @desc Creates a Cloud SQL instance as a clone of a source instance. - * @alias sql.instances.clone - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID of the source as well as the clone Cloud SQL instance. - * @param {().InstancesCloneRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clone(params?: any, options?: MethodOptions): - AxiosPromise; - clone( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - clone( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta3/projects/{project}/instances/clone') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance restore backup response. + */ + export interface Schema$InstancesRestoreBackupResponse { + /** + * This is always sql#instancesRestoreBackup. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - /** - * sql.instances.delete - * @desc Deletes a Cloud SQL instance. - * @alias sql.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance set root password response. + */ + export interface Schema$InstancesSetRootPasswordResponse { + /** + * This is always sql#instancesSetRootPassword. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - /** - * sql.instances.export - * @desc Exports data from a Cloud SQL instance to a Google Cloud Storage - * bucket as a MySQL dump file. - * @alias sql.instances.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be exported. - * @param {().InstancesExportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - export(params?: any, options?: MethodOptions): - AxiosPromise; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance update response. + */ + export interface Schema$InstancesUpdateResponse { + /** + * This is always sql#instancesUpdate. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve information about the operation. + */ + operation: string; } - - /** - * sql.instances.get - * @desc Retrieves information about a Cloud SQL instance. - * @alias sql.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * IP Management configuration. + */ + export interface Schema$IpConfiguration { + /** + * The list of external networks that are allowed to connect to the instance + * using the IP. In CIDR notation, also known as 'slash' notation + * (e.g. 192.168.100.0/24). + */ + authorizedNetworks: string[]; + /** + * Whether the instance should be assigned an IP address or not. + */ + enabled: boolean; + /** + * This is always sql#ipConfiguration. + */ + kind: string; + /** + * Whether SSL connections over IP should be enforced or not. + */ + requireSsl: boolean; } - - /** - * sql.instances.import - * @desc Imports data into a Cloud SQL instance from a MySQL dump file stored - * in a Google Cloud Storage bucket. - * @alias sql.instances.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().InstancesImportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ -import(params?: any, options?: MethodOptions): AxiosPromise; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { - callback = options; - options = {}; - } if(typeof params === 'function') { - callback = params; - params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/sql/v1beta3/projects/{project}/instances/{instance}/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['project', 'instance'], pathParams: ['instance', 'project'], context: this.getRoot()}; if(callback) { - createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} - - + * Database instance IP Mapping. + */ + export interface Schema$IpMapping { + /** + * The IP address assigned. + */ + ipAddress: string; + /** + * The due time for this IP to be retired in RFC 3339 format, for example + * 2012-11-15T16:19:00.094Z. This field is only available when the IP is + * scheduled to be retired. + */ + timeToRetire: string; + } /** - * sql.instances.insert - * @desc Creates a new Cloud SQL instance. - * @alias sql.instances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta3/projects/{project}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Preferred location. This specifies where a Cloud SQL instance should + * preferably be located, either in a specific Compute Engine zone, or + * co-located with an App Engine application. Note that if the preferred + * location is not available, the instance will be located as close as + * possible within the region. Only one location may be specified. + */ + export interface Schema$LocationPreference { + /** + * The App Engine application to follow, it must be in the same region as + * the Cloud SQL instance. + */ + followGaeApplication: string; + /** + * This is always sql#locationPreference. + */ + kind: string; + /** + * The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, + * etc.). + */ + zone: string; } - - /** - * sql.instances.list - * @desc Lists instances for a given project, in alphabetical order by - * instance name. - * @alias sql.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults The maximum number of results to return per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta3/projects/{project}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance operation error. + */ + export interface Schema$OperationError { + /** + * Identifies the specific error that occurred. + */ + code: string; + /** + * This is always sql#operationError. + */ + kind: string; } - - /** - * sql.instances.patch - * @desc Updates the settings of a Cloud SQL instance. This method supports - * patch semantics. - * @alias sql.instances.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance list operations response. + */ + export interface Schema$OperationsListResponse { + /** + * List of operation resources. + */ + items: Schema$InstanceOperation[]; + /** + * This is always sql#operationsList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * sql.instances.promoteReplica - * @desc Promotes the read replica instance to be a stand-alone Cloud SQL - * instance. - * @alias sql.instances.promoteReplica - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL read replica instance name. - * @param {string} params.project ID of the project that contains the read replica. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - promoteReplica(params?: any, options?: MethodOptions): - AxiosPromise; - promoteReplica( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - promoteReplica( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/promoteReplica') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Database instance set root password context. + */ + export interface Schema$SetRootPasswordContext { + /** + * This is always sql#setRootUserContext. + */ + kind: string; + /** + * The password for the root user. + */ + password: string; } - - /** - * sql.instances.resetSslConfig - * @desc Deletes all client certificates and generates a new server SSL - * certificate for a Cloud SQL instance. - * @alias sql.instances.resetSslConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetSslConfig(params?: any, options?: MethodOptions): - AxiosPromise; - resetSslConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - resetSslConfig( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/resetSslConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Database instance settings. + */ + export interface Schema$Settings { + /** + * The activation policy for this instance. This specifies when the instance + * should be activated and is applicable only when the instance state is + * RUNNABLE. This can be one of the following. ALWAYS: The instance should + * always be active. NEVER: The instance should never be activated. + * ON_DEMAND: The instance is activated upon receiving requests. + */ + activationPolicy: string; + /** + * The App Engine app IDs that can access this instance. + */ + authorizedGaeApplications: string[]; + /** + * The daily backup configuration for the instance. + */ + backupConfiguration: Schema$BackupConfiguration[]; + /** + * The database flags passed to the instance at startup. + */ + databaseFlags: Schema$DatabaseFlags[]; + /** + * Configuration specific to read replica instance. Indicates whether + * replication is enabled or not. + */ + databaseReplicationEnabled: boolean; + /** + * The settings for IP Management. This allows to enable or disable the + * instance IP and manage which external networks can connect to the + * instance. + */ + ipConfiguration: Schema$IpConfiguration; + /** + * This is always sql#settings. + */ + kind: string; + /** + * The location preference settings. This allows the instance to be located + * as near as possible to either an App Engine app or GCE zone for better + * performance. + */ + locationPreference: Schema$LocationPreference; + /** + * The pricing plan for this instance. This can be either PER_USE or + * PACKAGE. + */ + pricingPlan: string; + /** + * The type of replication this instance uses. This can be either + * ASYNCHRONOUS or SYNCHRONOUS. + */ + replicationType: string; + /** + * The version of instance settings. This is a required field for update + * method to make sure concurrent updates are handled properly. During + * update, use the most recent settingsVersion value for this instance and + * do not try to update this value. + */ + settingsVersion: string; + /** + * The tier of service for this instance, for example D1, D2. For more + * information, see pricing. + */ + tier: string; } - - /** - * sql.instances.restart - * @desc Restarts a Cloud SQL instance. - * @alias sql.instances.restart - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be restarted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restart(params?: any, options?: MethodOptions): - AxiosPromise; - restart( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - restart( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/restart') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCerts Resource + */ + export interface Schema$SslCert { + /** + * PEM representation. + */ + cert: string; + /** + * Serial number, as extracted from the certificate. + */ + certSerialNumber: string; + /** + * User supplied name. Constrained to [a-zA-Z.-_ ]+. + */ + commonName: string; + /** + * Time when the certificate was created. + */ + createTime: string; + /** + * Time when the certificate expires. + */ + expirationTime: string; + /** + * Name of the database instance. + */ + instance: string; + /** + * This is always sql#sslCert. + */ + kind: string; + /** + * Sha1 Fingerprint. + */ + sha1Fingerprint: string; } - - /** - * sql.instances.restoreBackup - * @desc Restores a backup of a Cloud SQL instance. - * @alias sql.instances.restoreBackup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.backupConfiguration The identifier of the backup configuration. This gets generated automatically when a backup configuration is created. - * @param {string} params.dueTime The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restoreBackup(params?: any, options?: MethodOptions): - AxiosPromise; - restoreBackup( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - restoreBackup( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/restoreBackup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance', 'backupConfiguration', 'dueTime'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * SslCertDetail. + */ + export interface Schema$SslCertDetail { + /** + * The public information about the cert. + */ + certInfo: Schema$SslCert; + /** + * The private key for the client cert, in pem format. Keep private in order + * to protect your security. + */ + certPrivateKey: string; } - - /** - * sql.instances.setRootPassword - * @desc Sets the password for the root user of the specified Cloud SQL - * instance. - * @alias sql.instances.setRootPassword - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().InstanceSetRootPasswordRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setRootPassword(params?: any, options?: MethodOptions): - AxiosPromise; - setRootPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - setRootPassword( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/setRootPassword') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * SslCert delete response. + */ + export interface Schema$SslCertsDeleteResponse { + /** + * This is always sql#sslCertsDelete. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + operation: string; } - - /** - * sql.instances.update - * @desc Updates the settings of a Cloud SQL instance. - * @alias sql.instances.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * SslCerts insert request. */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Operations { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$SslCertsInsertRequest { + /** + * User supplied name. Must be a distinct name from the other certificates + * for this instance. New certificates will not be usable until the instance + * is restarted. + */ + commonName: string; } - - /** - * sql.operations.get - * @desc Retrieves information about a specific operation that was performed - * on a Cloud SQL instance. - * @alias sql.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.operation Instance operation ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'operation'], - pathParams: ['instance', 'operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCert insert response. + */ + export interface Schema$SslCertsInsertResponse { + /** + * The new client certificate and private key. The new certificate will not + * work until the instance is restarted. + */ + clientCert: Schema$SslCertDetail; + /** + * This is always sql#sslCertsInsert. + */ + kind: string; + /** + * The server Certificate Authority's certificate. If this is missing + * you can force a new one to be generated by calling resetSslConfig method + * on instances resource.. + */ + serverCaCert: Schema$SslCert; } - - /** - * sql.operations.list - * @desc Lists all operations that have been performed on a Cloud SQL - * instance. - * @alias sql.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {integer=} params.maxResults Maximum number of operations per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCerts list response. + */ + export interface Schema$SslCertsListResponse { + /** + * List of client certificates for the instance. + */ + items: Schema$SslCert[]; + /** + * This is always sql#sslCertsList. + */ + kind: string; } -} - -export class Resource$Sslcerts { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * A Google Cloud SQL service tier resource. + */ + export interface Schema$Tier { + /** + * The maximum disk size of this tier in bytes. + */ + DiskQuota: string; + /** + * This is always sql#tier. + */ + kind: string; + /** + * The maximum RAM usage of this tier in bytes. + */ + RAM: string; + /** + * The applicable regions for this tier. + */ + region: string[]; + /** + * An identifier for the service tier, for example D1, D2 etc. For related + * information, see Pricing. + */ + tier: string; } - - getRoot() { - return this.root; + /** + * Tiers list response. + */ + export interface Schema$TiersListResponse { + /** + * List of tiers. + */ + items: Schema$Tier[]; + /** + * This is always sql#tiersList. + */ + kind: string; } - - /** - * sql.sslCerts.delete - * @desc Deletes an SSL certificate from a Cloud SQL instance. - * @alias sql.sslCerts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be deleted. - * @param {string} params.sha1Fingerprint Sha1 FingerPrint. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance', 'sha1Fingerprint'], - pathParams: ['instance', 'project', 'sha1Fingerprint'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Backupruns { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.backupRuns.get + * @desc Retrieves information about a specified backup run for a Cloud SQL + * instance. + * @alias sql.backupRuns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backupConfiguration Identifier for the backup configuration. This gets generated automatically when a backup configuration is created. + * @param {string} params.dueTime The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/backupRuns/{backupConfiguration}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: + ['project', 'instance', 'backupConfiguration', 'dueTime'], + pathParams: ['backupConfiguration', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.backupRuns.list + * @desc Lists all backup runs associated with a Cloud SQL instance. + * @alias sql.backupRuns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backupConfiguration Identifier for the backup configuration. This gets generated automatically when a backup configuration is created. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of backup runs per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/backupRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'backupConfiguration'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * sql.sslCerts.get - * @desc Retrieves an SSL certificate as specified by its SHA-1 fingerprint. - * @alias sql.sslCerts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {string} params.sha1Fingerprint Sha1 FingerPrint. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'sha1Fingerprint'], - pathParams: ['instance', 'project', 'sha1Fingerprint'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Flags { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.flags.list + * @desc Lists all database flags that can be set for Google Cloud SQL + * instances. + * @alias sql.flags.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta3/flags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * sql.sslCerts.insert - * @desc Creates an SSL certificate and returns the certificate, the - * associated private key, and the server certificate authority. - * @alias sql.sslCerts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. - * @param {().SslCertsInsertRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); + export class Resource$Instances { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.instances.clone + * @desc Creates a Cloud SQL instance as a clone of a source instance. + * @alias sql.instances.clone + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the source as well as the clone Cloud SQL instance. + * @param {().InstancesCloneRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clone(params?: any, options?: MethodOptions): + AxiosPromise; + clone( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + clone( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta3/projects/{project}/instances/clone') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.delete + * @desc Deletes a Cloud SQL instance. + * @alias sql.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.export + * @desc Exports data from a Cloud SQL instance to a Google Cloud Storage + * bucket as a MySQL dump file. + * @alias sql.instances.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be exported. + * @param {().InstancesExportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.get + * @desc Retrieves information about a Cloud SQL instance. + * @alias sql.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.import + * @desc Imports data into a Cloud SQL instance from a MySQL dump file + * stored in a Google Cloud Storage bucket. + * @alias sql.instances.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesImportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ +import(params?: any, options?: MethodOptions): AxiosPromise; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { + callback = options; + options = {}; + } if(typeof params === 'function') { + callback = params; + params = {}; + } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/sql/v1beta3/projects/{project}/instances/{instance}/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['project', 'instance'], pathParams: ['instance', 'project'], context: this.getRoot()}; if(callback) { + createAPIRequest(parameters, callback); } else { - return createAPIRequest(parameters); - } - } + return createAPIRequest(parameters); + }} - /** - * sql.sslCerts.list - * @desc Lists all of the current SSL certificates defined for a Cloud SQL - * instance. - * @alias sql.sslCerts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * sql.instances.insert + * @desc Creates a new Cloud SQL instance. + * @alias sql.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta3/projects/{project}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.list + * @desc Lists instances for a given project, in alphabetical order by + * instance name. + * @alias sql.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults The maximum number of results to return per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta3/projects/{project}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.patch + * @desc Updates the settings of a Cloud SQL instance. This method supports + * patch semantics. + * @alias sql.instances.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.promoteReplica + * @desc Promotes the read replica instance to be a stand-alone Cloud SQL + * instance. + * @alias sql.instances.promoteReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + promoteReplica(params?: any, options?: MethodOptions): + AxiosPromise; + promoteReplica( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + promoteReplica( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/promoteReplica') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * sql.instances.resetSslConfig + * @desc Deletes all client certificates and generates a new server SSL + * certificate for a Cloud SQL instance. + * @alias sql.instances.resetSslConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetSslConfig(params?: any, options?: MethodOptions): + AxiosPromise; + resetSslConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + resetSslConfig( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/resetSslConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * sql.instances.restart + * @desc Restarts a Cloud SQL instance. + * @alias sql.instances.restart + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be restarted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restart(params?: any, options?: MethodOptions): + AxiosPromise; + restart( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + restart( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/restart') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.restoreBackup + * @desc Restores a backup of a Cloud SQL instance. + * @alias sql.instances.restoreBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.backupConfiguration The identifier of the backup configuration. This gets generated automatically when a backup configuration is created. + * @param {string} params.dueTime The start time of the four-hour backup window. The backup can occur any time in the window. The time is in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restoreBackup(params?: any, options?: MethodOptions): + AxiosPromise; + restoreBackup( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + restoreBackup( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/restoreBackup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: + ['project', 'instance', 'backupConfiguration', 'dueTime'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * sql.instances.setRootPassword + * @desc Sets the password for the root user of the specified Cloud SQL + * instance. + * @alias sql.instances.setRootPassword + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstanceSetRootPasswordRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setRootPassword(params?: any, options?: MethodOptions): + AxiosPromise; + setRootPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + setRootPassword( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/setRootPassword') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * sql.instances.update + * @desc Updates the settings of a Cloud SQL instance. + * @alias sql.instances.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Tiers { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Operations { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.operations.get + * @desc Retrieves information about a specific operation that was performed + * on a Cloud SQL instance. + * @alias sql.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.operation Instance operation ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'operation'], + pathParams: ['instance', 'operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.operations.list + * @desc Lists all operations that have been performed on a Cloud SQL + * instance. + * @alias sql.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of operations per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - getRoot() { - return this.root; + export class Resource$Sslcerts { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.sslCerts.delete + * @desc Deletes an SSL certificate from a Cloud SQL instance. + * @alias sql.sslCerts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be deleted. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.get + * @desc Retrieves an SSL certificate as specified by its SHA-1 fingerprint. + * @alias sql.sslCerts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.insert + * @desc Creates an SSL certificate and returns the certificate, the + * associated private key, and the server certificate authority. + * @alias sql.sslCerts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. + * @param {().SslCertsInsertRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.list + * @desc Lists all of the current SSL certificates defined for a Cloud SQL + * instance. + * @alias sql.sslCerts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta3/projects/{project}/instances/{instance}/sslCerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * sql.tiers.list - * @desc Lists service tiers that can be used to create Google Cloud SQL - * instances. - * @alias sql.tiers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID of the project for which to list tiers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta3/projects/{project}/tiers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Tiers { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.tiers.list + * @desc Lists service tiers that can be used to create Google Cloud SQL + * instances. + * @alias sql.tiers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project for which to list tiers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta3/projects/{project}/tiers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/sqladmin/v1beta4.ts b/src/apis/sqladmin/v1beta4.ts index 927e07c5f77..830bae418fb 100644 --- a/src/apis/sqladmin/v1beta4.ts +++ b/src/apis/sqladmin/v1beta4.ts @@ -27,3815 +27,3854 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud SQL Administration API - * - * Creates and configures Cloud SQL instances, which provide fully-managed MySQL - * databases. - * - * @example - * const google = require('googleapis'); - * const sqladmin = google.sqladmin('v1beta4'); - * - * @namespace sqladmin - * @type {Function} - * @version v1beta4 - * @variation v1beta4 - * @param {object=} options Options for Sqladmin - */ -export class Sqladmin { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - backupRuns: Resource$Backupruns; - databases: Resource$Databases; - flags: Resource$Flags; - instances: Resource$Instances; - operations: Resource$Operations; - sslCerts: Resource$Sslcerts; - tiers: Resource$Tiers; - users: Resource$Users; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.backupRuns = new Resource$Backupruns(this); - this.databases = new Resource$Databases(this); - this.flags = new Resource$Flags(this); - this.instances = new Resource$Instances(this); - this.operations = new Resource$Operations(this); - this.sslCerts = new Resource$Sslcerts(this); - this.tiers = new Resource$Tiers(this); - this.users = new Resource$Users(this); - } - - getRoot() { - return this.root; - } -} - -/** - * An entry for an Access Control list. - */ -export interface Schema$AclEntry { - /** - * The time when this access control entry expires in RFC 3339 format, for - * example 2012-11-15T16:19:00.094Z. - */ - expirationTime: string; - /** - * This is always sql#aclEntry. - */ - kind: string; - /** - * An optional label to identify this entry. - */ - name: string; - /** - * The whitelisted value for the access control list. - */ - value: string; -} -/** - * Database instance backup configuration. - */ -export interface Schema$BackupConfiguration { - /** - * Whether binary log is enabled. If backup configuration is disabled, binary - * log must be disabled as well. - */ - binaryLogEnabled: boolean; - /** - * Whether this configuration is enabled. - */ - enabled: boolean; - /** - * This is always sql#backupConfiguration. - */ - kind: string; - /** - * Reserved for future use. - */ - replicationLogArchivingEnabled: boolean; - /** - * Start time for the daily backup configuration in UTC timezone in the 24 - * hour format - HH:MM. - */ - startTime: string; -} -/** - * A database instance backup run resource. - */ -export interface Schema$BackupRun { - /** - * The description of this run, only applicable to on-demand backups. - */ - description: string; - /** - * The time the backup operation completed in UTC timezone in RFC 3339 format, - * for example 2012-11-15T16:19:00.094Z. - */ - endTime: string; - /** - * The time the run was enqueued in UTC timezone in RFC 3339 format, for - * example 2012-11-15T16:19:00.094Z. - */ - enqueuedTime: string; - /** - * Information about why the backup operation failed. This is only present if - * the run has the FAILED status. - */ - error: Schema$OperationError; - /** - * A unique identifier for this backup run. Note that this is unique only - * within the scope of a particular Cloud SQL instance. - */ - id: string; - /** - * Name of the database instance. - */ - instance: string; - /** - * This is always sql#backupRun. - */ - kind: string; - /** - * The URI of this resource. - */ - selfLink: string; - /** - * The time the backup operation actually started in UTC timezone in RFC 3339 - * format, for example 2012-11-15T16:19:00.094Z. - */ - startTime: string; - /** - * The status of this run. - */ - status: string; - /** - * The type of this run; can be either "AUTOMATED" or - * "ON_DEMAND". - */ - type: string; - /** - * The start time of the backup window during which this the backup was - * attempted in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. - */ - windowStartTime: string; -} -/** - * Backup run list results. - */ -export interface Schema$BackupRunsListResponse { - /** - * A list of backup runs in reverse chronological order of the enqueued time. - */ - items: Schema$BackupRun[]; - /** - * This is always sql#backupRunsList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Binary log coordinates. - */ -export interface Schema$BinLogCoordinates { - /** - * Name of the binary log file for a Cloud SQL instance. - */ - binLogFileName: string; - /** - * Position (offset) within the binary log file. - */ - binLogPosition: string; - /** - * This is always sql#binLogCoordinates. - */ - kind: string; -} -/** - * Database instance clone context. - */ -export interface Schema$CloneContext { - /** - * Binary log coordinates, if specified, indentify the the position up to - * which the source instance should be cloned. If not specified, the source - * instance is cloned up to the most recent binary log coordintes. - */ - binLogCoordinates: Schema$BinLogCoordinates; - /** - * Name of the Cloud SQL instance to be created as a clone. - */ - destinationInstanceName: string; - /** - * This is always sql#cloneContext. - */ - kind: string; - /** - * Reserved for future use. - */ - pitrTimestampMs: string; -} -/** - * A database resource inside a Cloud SQL instance. - */ -export interface Schema$Database { - /** - * The MySQL charset value. - */ - charset: string; - /** - * The MySQL collation value. - */ - collation: string; - /** - * HTTP 1.1 Entity tag for the resource. - */ - etag: string; - /** - * The name of the Cloud SQL instance. This does not include the project ID. - */ - instance: string; - /** - * This is always sql#database. - */ - kind: string; - /** - * The name of the database in the Cloud SQL instance. This does not include - * the project ID or instance name. - */ - name: string; - /** - * The project ID of the project containing the Cloud SQL database. The Google - * apps domain is prefixed if applicable. - */ - project: string; - /** - * The URI of this resource. - */ - selfLink: string; -} -/** - * MySQL flags for Cloud SQL instances. - */ -export interface Schema$DatabaseFlags { - /** - * The name of the flag. These flags are passed at instance startup, so - * include both MySQL server options and MySQL system variables. Flags should - * be specified with underscores, not hyphens. For more information, see - * Configuring MySQL Flags in the Google Cloud SQL documentation, as well as - * the official MySQL documentation for server options and system variables. - */ - name: string; - /** - * The value of the flag. Booleans should be set to on for true and off for - * false. This field must be omitted if the flag doesn't take a value. - */ - value: string; -} -/** - * A Cloud SQL instance resource. - */ -export interface Schema$DatabaseInstance { - /** - * FIRST_GEN: Basic Cloud SQL instance that runs in a Google-managed - * container. SECOND_GEN: A newer Cloud SQL backend that runs in a Compute - * Engine VM. EXTERNAL: A MySQL server that is not managed by Google. - */ - backendType: string; - /** - * Connection name of the Cloud SQL instance used in connection strings. - */ - connectionName: string; - /** - * The current disk usage of the instance in bytes. This property has been - * deprecated. Users should use the - * "cloudsql.googleapis.com/database/disk/bytes_used" metric in - * Cloud Monitoring API instead. Please see - * https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ - * for details. - */ - currentDiskSize: string; - /** - * The database engine type and version. The databaseVersion field can not be - * changed after instance creation. MySQL Second Generation instances: - * MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 MySQL - * First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 - */ - databaseVersion: string; - /** - * HTTP 1.1 Entity tag for the resource. - */ - etag: string; - /** - * The name and status of the failover replica. This property is applicable - * only to Second Generation instances. - */ - failoverReplica: any; - /** - * The Compute Engine zone that the instance is currently serving from. This - * value could be different from the zone that was specified when the instance - * was created if the instance has failed over to its secondary zone. - */ - gceZone: string; - /** - * The instance type. This can be one of the following. CLOUD_SQL_INSTANCE: A - * Cloud SQL instance that is not replicating from a master. - * ON_PREMISES_INSTANCE: An instance running on the customer's premises. - * READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. - */ - instanceType: string; - /** - * The assigned IP addresses for the instance. - */ - ipAddresses: Schema$IpMapping[]; - /** - * The IPv6 address assigned to the instance. This property is applicable only - * to First Generation instances. - */ - ipv6Address: string; - /** - * This is always sql#instance. - */ - kind: string; - /** - * The name of the instance which will act as master in the replication setup. - */ - masterInstanceName: string; - /** - * The maximum disk size of the instance in bytes. - */ - maxDiskSize: string; - /** - * Name of the Cloud SQL instance. This does not include the project ID. - */ - name: string; - /** - * Configuration specific to on-premises instances. - */ - onPremisesConfiguration: Schema$OnPremisesConfiguration; - /** - * The project ID of the project containing the Cloud SQL instance. The Google - * apps domain is prefixed if applicable. - */ - project: string; - /** - * The geographical region. Can be us-central (FIRST_GEN instances only), - * us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. - * Defaults to us-central or us-central1 depending on the instance type (First - * Generation or Second Generation). The region can not be changed after - * instance creation. - */ - region: string; - /** - * Configuration specific to read-replicas replicating from on-premises - * masters. - */ - replicaConfiguration: Schema$ReplicaConfiguration; - /** - * The replicas of the instance. - */ - replicaNames: string[]; - /** - * The URI of this resource. - */ - selfLink: string; - /** - * SSL configuration. - */ - serverCaCert: Schema$SslCert; - /** - * The service account email address assigned to the instance. This property - * is applicable only to Second Generation instances. - */ - serviceAccountEmailAddress: string; - /** - * The user settings. - */ - settings: Schema$Settings; - /** - * The current serving state of the Cloud SQL instance. This can be one of the - * following. RUNNABLE: The instance is running, or is ready to run when - * accessed. SUSPENDED: The instance is not available, for example due to - * problems with billing. PENDING_CREATE: The instance is being created. - * MAINTENANCE: The instance is down for maintenance. FAILED: The instance - * creation failed. UNKNOWN_STATE: The state of the instance is unknown. - */ - state: string; - /** - * If the instance state is SUSPENDED, the reason for the suspension. - */ - suspensionReason: string[]; -} -/** - * Database list response. - */ -export interface Schema$DatabasesListResponse { - /** - * List of database resources in the instance. - */ - items: Schema$Database[]; - /** - * This is always sql#databasesList. - */ - kind: string; -} -/** - * Read-replica configuration for connecting to the on-premises master. - */ -export interface Schema$DemoteMasterConfiguration { - /** - * This is always sql#demoteMasterConfiguration. - */ - kind: string; - /** - * MySQL specific configuration when replicating from a MySQL on-premises - * master. Replication configuration information such as the username, - * password, certificates, and keys are not stored in the instance metadata. - * The configuration information is used only to set up the replication - * connection and is stored by MySQL in a file named master.info in the data - * directory. - */ - mysqlReplicaConfiguration: Schema$DemoteMasterMySqlReplicaConfiguration; -} -/** - * Database instance demote master context. - */ -export interface Schema$DemoteMasterContext { - /** - * This is always sql#demoteMasterContext. - */ - kind: string; - /** - * The name of the instance which will act as on-premises master in the - * replication setup. - */ - masterInstanceName: string; - /** - * Configuration specific to read-replicas replicating from the on-premises - * master. - */ - replicaConfiguration: Schema$DemoteMasterConfiguration; - /** - * Verify GTID consistency for demote operation. Default value: True. Second - * Generation instances only. Setting this flag to false enables you to bypass - * GTID consistency check between on-premises master and Cloud SQL instance - * during the demotion operation but also exposes you to the risk of future - * replication failures. Change the value only if you know the reason for the - * GTID divergence and are confident that doing so will not cause any - * replication issues. - */ - verifyGtidConsistency: boolean; -} -/** - * Read-replica configuration specific to MySQL databases. - */ -export interface Schema$DemoteMasterMySqlReplicaConfiguration { - /** - * PEM representation of the trusted CA's x509 certificate. - */ - caCertificate: string; - /** - * PEM representation of the slave's x509 certificate. - */ - clientCertificate: string; - /** - * PEM representation of the slave's private key. The corresponsing public - * key is encoded in the client's certificate. The format of the - * slave's private key can be either PKCS #1 or PKCS #8. - */ - clientKey: string; - /** - * This is always sql#demoteMasterMysqlReplicaConfiguration. - */ - kind: string; - /** - * The password for the replication connection. - */ - password: string; - /** - * The username for the replication connection. - */ - username: string; -} -/** - * Database instance export context. - */ -export interface Schema$ExportContext { - /** - * Options for exporting data as CSV. - */ - csvExportOptions: any; - /** - * Databases (for example, guestbook) from which the export is made. If - * fileType is SQL and no database is specified, all databases are exported. - * If fileType is CSV, you can optionally specify at most one database to - * export. If csvExportOptions.selectQuery also specifies the database, this - * field will be ignored. - */ - databases: string[]; - /** - * The file type for the specified uri. SQL: The file contains SQL statements. - * CSV: The file contains CSV data. - */ - fileType: string; - /** - * This is always sql#exportContext. - */ - kind: string; - /** - * Options for exporting data as SQL statements. - */ - sqlExportOptions: any; - /** - * The path to the file in Google Cloud Storage where the export will be - * stored. The URI is in the form gs://bucketName/fileName. If the file - * already exists, the requests succeeds, but the operation fails. If fileType - * is SQL and the filename ends with .gz, the contents are compressed. - */ - uri: string; -} -/** - * Database instance failover context. - */ -export interface Schema$FailoverContext { - /** - * This is always sql#failoverContext. - */ - kind: string; - /** - * The current settings version of this instance. Request will be rejected if - * this version doesn't match the current settings version. - */ - settingsVersion: string; -} -/** - * A Google Cloud SQL service flag resource. - */ -export interface Schema$Flag { - /** - * For STRING flags, a list of strings that the value can be set to. - */ - allowedStringValues: string[]; - /** - * The database version this flag applies to. Can be MYSQL_5_5, MYSQL_5_6, or - * MYSQL_5_7. MYSQL_5_7 is applicable only to Second Generation instances. - */ - appliesTo: string[]; - /** - * This is always sql#flag. - */ - kind: string; - /** - * For INTEGER flags, the maximum allowed value. - */ - maxValue: string; - /** - * For INTEGER flags, the minimum allowed value. - */ - minValue: string; - /** - * This is the name of the flag. Flag names always use underscores, not - * hyphens, e.g. max_allowed_packet - */ - name: string; - /** - * Indicates whether changing this flag will trigger a database restart. Only - * applicable to Second Generation instances. - */ - requiresRestart: boolean; - /** - * The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER or - * NONE. NONE is used for flags which do not take a value, such as - * skip_grant_tables. - */ - type: string; -} -/** - * Flags list response. - */ -export interface Schema$FlagsListResponse { - /** - * List of flags. - */ - items: Schema$Flag[]; - /** - * This is always sql#flagsList. - */ - kind: string; -} -/** - * Database instance import context. - */ -export interface Schema$ImportContext { - /** - * Options for importing data as CSV. - */ - csvImportOptions: any; - /** - * The database (for example, guestbook) to which the import is made. If - * fileType is SQL and no database is specified, it is assumed that the - * database is specified in the file to be imported. If fileType is CSV, it - * must be specified. - */ - database: string; - /** - * The file type for the specified uri. SQL: The file contains SQL statements. - * CSV: The file contains CSV data. - */ - fileType: string; - /** - * The PostgreSQL user for this import operation. Defaults to - * cloudsqlsuperuser. Used only for PostgreSQL instances. - */ - importUser: string; - /** - * This is always sql#importContext. - */ - kind: string; - /** - * A path to the file in Google Cloud Storage from which the import is made. - * The URI is in the form gs://bucketName/fileName. Compressed gzip files - * (.gz) are supported when fileType is SQL. - */ - uri: string; -} -/** - * Database instance clone request. - */ -export interface Schema$InstancesCloneRequest { - /** - * Contains details about the clone operation. - */ - cloneContext: Schema$CloneContext; -} -/** - * Database demote master request. - */ -export interface Schema$InstancesDemoteMasterRequest { - /** - * Contains details about the demoteMaster operation. - */ - demoteMasterContext: Schema$DemoteMasterContext; -} -/** - * Database instance export request. - */ -export interface Schema$InstancesExportRequest { - /** - * Contains details about the export operation. - */ - exportContext: Schema$ExportContext; -} -/** - * Instance failover request. - */ -export interface Schema$InstancesFailoverRequest { - /** - * Failover Context. - */ - failoverContext: Schema$FailoverContext; -} -/** - * Database instance import request. - */ -export interface Schema$InstancesImportRequest { - /** - * Contains details about the import operation. - */ - importContext: Schema$ImportContext; -} -/** - * Database instances list response. - */ -export interface Schema$InstancesListResponse { - /** - * List of database instance resources. - */ - items: Schema$DatabaseInstance[]; - /** - * This is always sql#instancesList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Database instance restore backup request. - */ -export interface Schema$InstancesRestoreBackupRequest { - /** - * Parameters required to perform the restore backup operation. - */ - restoreBackupContext: Schema$RestoreBackupContext; -} -/** - * Instance truncate log request. - */ -export interface Schema$InstancesTruncateLogRequest { - /** - * Contains details about the truncate log operation. - */ - truncateLogContext: Schema$TruncateLogContext; -} -/** - * IP Management configuration. - */ -export interface Schema$IpConfiguration { - /** - * The list of external networks that are allowed to connect to the instance - * using the IP. In CIDR notation, also known as 'slash' notation - * (e.g. 192.168.100.0/24). - */ - authorizedNetworks: Schema$AclEntry[]; - /** - * Whether the instance should be assigned an IP address or not. - */ - ipv4Enabled: boolean; - /** - * Whether SSL connections over IP should be enforced or not. - */ - requireSsl: boolean; -} -/** - * Database instance IP Mapping. - */ -export interface Schema$IpMapping { - /** - * The IP address assigned. - */ - ipAddress: string; - /** - * The due time for this IP to be retired in RFC 3339 format, for example - * 2012-11-15T16:19:00.094Z. This field is only available when the IP is - * scheduled to be retired. - */ - timeToRetire: string; - /** - * The type of this IP address. A PRIMARY address is an address that can - * accept incoming connections. An OUTGOING address is the source address of - * connections originating from the instance, if supported. - */ - type: string; -} -/** - * Preferred location. This specifies where a Cloud SQL instance should - * preferably be located, either in a specific Compute Engine zone, or - * co-located with an App Engine application. Note that if the preferred - * location is not available, the instance will be located as close as possible - * within the region. Only one location may be specified. - */ -export interface Schema$LocationPreference { - /** - * The AppEngine application to follow, it must be in the same region as the - * Cloud SQL instance. - */ - followGaeApplication: string; - /** - * This is always sql#locationPreference. - */ - kind: string; - /** - * The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, etc.). - */ - zone: string; -} -/** - * Maintenance window. This specifies when a v2 Cloud SQL instance should - * preferably be restarted for system maintenance puruposes. - */ -export interface Schema$MaintenanceWindow { - /** - * day of week (1-7), starting on Monday. - */ - day: number; - /** - * hour of day - 0 to 23. - */ - hour: number; - /** - * This is always sql#maintenanceWindow. - */ - kind: string; - /** - * Maintenance timing setting: canary (Earlier) or stable (Later). Learn - * more. - */ - updateTrack: string; -} -/** - * Read-replica configuration specific to MySQL databases. - */ -export interface Schema$MySqlReplicaConfiguration { - /** - * PEM representation of the trusted CA's x509 certificate. - */ - caCertificate: string; - /** - * PEM representation of the slave's x509 certificate. - */ - clientCertificate: string; - /** - * PEM representation of the slave's private key. The corresponsing public - * key is encoded in the client's certificate. - */ - clientKey: string; - /** - * Seconds to wait between connect retries. MySQL's default is 60 seconds. - */ - connectRetryInterval: number; - /** - * Path to a SQL dump file in Google Cloud Storage from which the slave - * instance is to be created. The URI is in the form gs://bucketName/fileName. - * Compressed gzip files (.gz) are also supported. Dumps should have the - * binlog co-ordinates from which replication should begin. This can be - * accomplished by setting --master-data to 1 when using mysqldump. - */ - dumpFilePath: string; - /** - * This is always sql#mysqlReplicaConfiguration. - */ - kind: string; - /** - * Interval in milliseconds between replication heartbeats. - */ - masterHeartbeatPeriod: string; - /** - * The password for the replication connection. - */ - password: string; - /** - * A list of permissible ciphers to use for SSL encryption. - */ - sslCipher: string; - /** - * The username for the replication connection. - */ - username: string; - /** - * Whether or not to check the master's Common Name value in the - * certificate that it sends during the SSL handshake. - */ - verifyServerCertificate: boolean; -} -/** - * On-premises instance configuration. - */ -export interface Schema$OnPremisesConfiguration { - /** - * The host and port of the on-premises instance in host:port format - */ - hostPort: string; - /** - * This is always sql#onPremisesConfiguration. - */ - kind: string; -} -/** - * An Operations resource contains information about database instance - * operations such as create, delete, and restart. Operations resources are - * created in response to operations that were initiated; you never create them - * directly. - */ -export interface Schema$Operation { - /** - * The time this operation finished in UTC timezone in RFC 3339 format, for - * example 2012-11-15T16:19:00.094Z. - */ - endTime: string; - /** - * If errors occurred during processing of this operation, this field will be - * populated. - */ - error: Schema$OperationErrors; - /** - * The context for export operation, if applicable. - */ - exportContext: Schema$ExportContext; - /** - * The context for import operation, if applicable. - */ - importContext: Schema$ImportContext; - /** - * The time this operation was enqueued in UTC timezone in RFC 3339 format, - * for example 2012-11-15T16:19:00.094Z. - */ - insertTime: string; - /** - * This is always sql#operation. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - name: string; - /** - * The type of the operation. Valid values are CREATE, DELETE, UPDATE, - * RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, - * DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . - */ - operationType: string; - /** - * The URI of this resource. - */ - selfLink: string; - /** - * The time this operation actually started in UTC timezone in RFC 3339 - * format, for example 2012-11-15T16:19:00.094Z. - */ - startTime: string; - /** - * The status of an operation. Valid values are PENDING, RUNNING, DONE, - * UNKNOWN. - */ - status: string; - /** - * Name of the database instance related to this operation. - */ - targetId: string; - targetLink: string; - /** - * The project ID of the target instance related to this operation. - */ - targetProject: string; - /** - * The email address of the user who initiated this operation. - */ - user: string; -} -/** - * Database instance operation error. - */ -export interface Schema$OperationError { - /** - * Identifies the specific error that occurred. - */ - code: string; - /** - * This is always sql#operationError. - */ - kind: string; - /** - * Additional information about the error encountered. - */ - message: string; -} -/** - * Database instance operation errors list wrapper. - */ -export interface Schema$OperationErrors { - /** - * The list of errors encountered while processing this operation. - */ - errors: Schema$OperationError[]; - /** - * This is always sql#operationErrors. - */ - kind: string; -} -/** - * Database instance list operations response. - */ -export interface Schema$OperationsListResponse { - /** - * List of operation resources. - */ - items: Schema$Operation[]; - /** - * This is always sql#operationsList. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * Read-replica configuration for connecting to the master. - */ -export interface Schema$ReplicaConfiguration { - /** - * Specifies if the replica is the failover target. If the field is set to - * true the replica will be designated as a failover replica. In case the - * master instance fails, the replica instance will be promoted as the new - * master instance. Only one replica can be specified as failover target, and - * the replica has to be in different zone with the master instance. - */ - failoverTarget: boolean; - /** - * This is always sql#replicaConfiguration. - */ - kind: string; - /** - * MySQL specific configuration when replicating from a MySQL on-premises - * master. Replication configuration information such as the username, - * password, certificates, and keys are not stored in the instance metadata. - * The configuration information is used only to set up the replication - * connection and is stored by MySQL in a file named master.info in the data - * directory. - */ - mysqlReplicaConfiguration: Schema$MySqlReplicaConfiguration; -} -/** - * Database instance restore from backup context. - */ -export interface Schema$RestoreBackupContext { - /** - * The ID of the backup run to restore from. - */ - backupRunId: string; - /** - * The ID of the instance that the backup was taken from. - */ - instanceId: string; - /** - * This is always sql#restoreBackupContext. - */ - kind: string; -} -/** - * Database instance settings. - */ -export interface Schema$Settings { - /** - * The activation policy specifies when the instance is activated; it is - * applicable only when the instance state is RUNNABLE. Valid values: ALWAYS: - * The instance is on, and remains so even in the absence of connection - * requests. NEVER: The instance is off; it is not activated, even if a - * connection request arrives. ON_DEMAND: First Generation instances only. The - * instance responds to incoming requests, and turns itself off when not in - * use. Instances with PER_USE pricing turn off after 15 minutes of - * inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of - * inactivity. - */ - activationPolicy: string; - /** - * The App Engine app IDs that can access this instance. This property is only - * applicable to First Generation instances. - */ - authorizedGaeApplications: string[]; - /** - * Availability type (PostgreSQL instances only). Potential values: ZONAL: The - * instance serves data from only one zone. Outages in that zone affect data - * accessibility. REGIONAL: The instance can serve data from more than one - * zone in a region (it is highly available). For more information, see - * Overview of the High Availability Configuration. - */ - availabilityType: string; - /** - * The daily backup configuration for the instance. - */ - backupConfiguration: Schema$BackupConfiguration; - /** - * Configuration specific to read replica instances. Indicates whether - * database flags for crash-safe replication are enabled. This property is - * only applicable to First Generation instances. - */ - crashSafeReplicationEnabled: boolean; - /** - * The database flags passed to the instance at startup. - */ - databaseFlags: Schema$DatabaseFlags[]; - /** - * Configuration specific to read replica instances. Indicates whether - * replication is enabled or not. - */ - databaseReplicationEnabled: boolean; - /** - * The size of data disk, in GB. The data disk size minimum is 10GB. Applies - * only to Second Generation instances. - */ - dataDiskSizeGb: string; - /** - * The type of data disk. Only supported for Second Generation instances. The - * default type is PD_SSD. Applies only to Second Generation instances. - */ - dataDiskType: string; - /** - * The settings for IP Management. This allows to enable or disable the - * instance IP and manage which external networks can connect to the instance. - * The IPv4 address cannot be disabled for Second Generation instances. - */ - ipConfiguration: Schema$IpConfiguration; - /** - * This is always sql#settings. - */ - kind: string; - /** - * The location preference settings. This allows the instance to be located as - * near as possible to either an App Engine app or Compute Engine zone for - * better performance. App Engine co-location is only applicable to First - * Generation instances. - */ - locationPreference: Schema$LocationPreference; - /** - * The maintenance window for this instance. This specifies when the instance - * may be restarted for maintenance purposes. Applies only to Second - * Generation instances. - */ - maintenanceWindow: Schema$MaintenanceWindow; - /** - * The pricing plan for this instance. This can be either PER_USE or PACKAGE. - * Only PER_USE is supported for Second Generation instances. - */ - pricingPlan: string; - /** - * The type of replication this instance uses. This can be either ASYNCHRONOUS - * or SYNCHRONOUS. This property is only applicable to First Generation - * instances. - */ - replicationType: string; - /** - * The version of instance settings. This is a required field for update - * method to make sure concurrent updates are handled properly. During update, - * use the most recent settingsVersion value for this instance and do not try - * to update this value. - */ - settingsVersion: string; - /** - * Configuration to increase storage size automatically. The default value is - * true. Applies only to Second Generation instances. - */ - storageAutoResize: boolean; - /** - * The maximum size to which storage capacity can be automatically increased. - * The default value is 0, which specifies that there is no limit. Applies - * only to Second Generation instances. - */ - storageAutoResizeLimit: string; - /** - * The tier of service for this instance, for example D1, D2. For more - * information, see pricing. - */ - tier: string; - /** - * User-provided labels, represented as a dictionary where each label is a - * single key value pair. - */ - userLabels: any; -} -/** - * SslCerts Resource - */ -export interface Schema$SslCert { - /** - * PEM representation. - */ - cert: string; - /** - * Serial number, as extracted from the certificate. - */ - certSerialNumber: string; - /** - * User supplied name. Constrained to [a-zA-Z.-_ ]+. - */ - commonName: string; - /** - * The time when the certificate was created in RFC 3339 format, for example - * 2012-11-15T16:19:00.094Z - */ - createTime: string; - /** - * The time when the certificate expires in RFC 3339 format, for example - * 2012-11-15T16:19:00.094Z. - */ - expirationTime: string; - /** - * Name of the database instance. - */ - instance: string; - /** - * This is always sql#sslCert. - */ - kind: string; - /** - * The URI of this resource. - */ - selfLink: string; - /** - * Sha1 Fingerprint. - */ - sha1Fingerprint: string; -} -/** - * SslCertDetail. - */ -export interface Schema$SslCertDetail { - /** - * The public information about the cert. - */ - certInfo: Schema$SslCert; - /** - * The private key for the client cert, in pem format. Keep private in order - * to protect your security. - */ - certPrivateKey: string; -} -/** - * SslCerts create ephemeral certificate request. - */ -export interface Schema$SslCertsCreateEphemeralRequest { - /** - * PEM encoded public key to include in the signed certificate. - */ - public_key: string; -} -/** - * SslCerts insert request. - */ -export interface Schema$SslCertsInsertRequest { - /** - * User supplied name. Must be a distinct name from the other certificates for - * this instance. New certificates will not be usable until the instance is - * restarted. - */ - commonName: string; -} -/** - * SslCert insert response. - */ -export interface Schema$SslCertsInsertResponse { - /** - * The new client certificate and private key. For First Generation instances, - * the new certificate does not take effect until the instance is restarted. - */ - clientCert: Schema$SslCertDetail; - /** - * This is always sql#sslCertsInsert. - */ - kind: string; - /** - * The operation to track the ssl certs insert request. - */ - operation: Schema$Operation; - /** - * The server Certificate Authority's certificate. If this is missing you - * can force a new one to be generated by calling resetSslConfig method on - * instances resource. - */ - serverCaCert: Schema$SslCert; -} -/** - * SslCerts list response. - */ -export interface Schema$SslCertsListResponse { - /** - * List of client certificates for the instance. - */ - items: Schema$SslCert[]; - /** - * This is always sql#sslCertsList. - */ - kind: string; -} -/** - * A Google Cloud SQL service tier resource. - */ -export interface Schema$Tier { - /** - * The maximum disk size of this tier in bytes. - */ - DiskQuota: string; - /** - * This is always sql#tier. - */ - kind: string; - /** - * The maximum RAM usage of this tier in bytes. - */ - RAM: string; - /** - * The applicable regions for this tier. - */ - region: string[]; - /** - * An identifier for the service tier, for example D1, D2 etc. For related - * information, see Pricing. - */ - tier: string; -} -/** - * Tiers list response. - */ -export interface Schema$TiersListResponse { - /** - * List of tiers. - */ - items: Schema$Tier[]; - /** - * This is always sql#tiersList. - */ - kind: string; -} -/** - * Database Instance truncate log context. - */ -export interface Schema$TruncateLogContext { - /** - * This is always sql#truncateLogContext. - */ - kind: string; - /** - * The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and - * MYSQL_SLOW_TABLE. - */ - logType: string; -} -/** - * A Cloud SQL user resource. - */ -export interface Schema$User { - /** - * HTTP 1.1 Entity tag for the resource. - */ - etag: string; - /** - * The host name from which the user can connect. For insert operations, host - * defaults to an empty string. For update operations, host is specified as - * part of the request URL. The host name cannot be updated after insertion. - */ - host: string; - /** - * The name of the Cloud SQL instance. This does not include the project ID. - * Can be omitted for update since it is already specified on the URL. - */ - instance: string; - /** - * This is always sql#user. - */ - kind: string; - /** - * The name of the user in the Cloud SQL instance. Can be omitted for update - * since it is already specified on the URL. - */ - name: string; - /** - * The password for the user. - */ - password: string; - /** - * The project ID of the project containing the Cloud SQL database. The Google - * apps domain is prefixed if applicable. Can be omitted for update since it - * is already specified on the URL. - */ - project: string; -} -/** - * User list response. - */ -export interface Schema$UsersListResponse { - /** - * List of user resources in the instance. - */ - items: Schema$User[]; - /** - * This is always sql#usersList. - */ - kind: string; - /** - * An identifier that uniquely identifies the operation. You can use this - * identifier to retrieve the Operations resource that has information about - * the operation. - */ - nextPageToken: string; -} - -export class Resource$Backupruns { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace sqladmin_v1beta4 { /** - * sql.backupRuns.delete - * @desc Deletes the backup taken by a backup run. - * @alias sql.backupRuns.delete - * @memberOf! () + * Cloud SQL Administration API * - * @param {object} params Parameters for request - * @param {string} params.id The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance', 'id'], - pathParams: ['id', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * sql.backupRuns.get - * @desc Retrieves a resource containing information about a backup run. - * @alias sql.backupRuns.get - * @memberOf! () + * Creates and configures Cloud SQL instances, which provide fully-managed + * MySQL databases. * - * @param {object} params Parameters for request - * @param {string} params.id The ID of this Backup Run. - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'id'], - pathParams: ['id', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @example + * const google = require('googleapis'); + * const sqladmin = google.sqladmin('v1beta4'); + * + * @namespace sqladmin + * @type {Function} + * @version v1beta4 + * @variation v1beta4 + * @param {object=} options Options for Sqladmin + */ + export class Sqladmin { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + backupRuns: Resource$Backupruns; + databases: Resource$Databases; + flags: Resource$Flags; + instances: Resource$Instances; + operations: Resource$Operations; + sslCerts: Resource$Sslcerts; + tiers: Resource$Tiers; + users: Resource$Users; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.backupRuns = new Resource$Backupruns(this); + this.databases = new Resource$Databases(this); + this.flags = new Resource$Flags(this); + this.instances = new Resource$Instances(this); + this.operations = new Resource$Operations(this); + this.sslCerts = new Resource$Sslcerts(this); + this.tiers = new Resource$Tiers(this); + this.users = new Resource$Users(this); + } + + getRoot() { + return this.root; } } - /** - * sql.backupRuns.insert - * @desc Creates a new backup run on demand. This method is applicable only to - * Second Generation instances. - * @alias sql.backupRuns.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().BackupRun} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An entry for an Access Control list. + */ + export interface Schema$AclEntry { + /** + * The time when this access control entry expires in RFC 3339 format, for + * example 2012-11-15T16:19:00.094Z. + */ + expirationTime: string; + /** + * This is always sql#aclEntry. + */ + kind: string; + /** + * An optional label to identify this entry. + */ + name: string; + /** + * The whitelisted value for the access control list. + */ + value: string; } - - /** - * sql.backupRuns.list - * @desc Lists all backup runs associated with a given instance and - * configuration in the reverse chronological order of the enqueued time. - * @alias sql.backupRuns.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {integer=} params.maxResults Maximum number of backup runs per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance backup configuration. + */ + export interface Schema$BackupConfiguration { + /** + * Whether binary log is enabled. If backup configuration is disabled, + * binary log must be disabled as well. + */ + binaryLogEnabled: boolean; + /** + * Whether this configuration is enabled. + */ + enabled: boolean; + /** + * This is always sql#backupConfiguration. + */ + kind: string; + /** + * Reserved for future use. + */ + replicationLogArchivingEnabled: boolean; + /** + * Start time for the daily backup configuration in UTC timezone in the 24 + * hour format - HH:MM. + */ + startTime: string; } -} - -export class Resource$Databases { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * A database instance backup run resource. + */ + export interface Schema$BackupRun { + /** + * The description of this run, only applicable to on-demand backups. + */ + description: string; + /** + * The time the backup operation completed in UTC timezone in RFC 3339 + * format, for example 2012-11-15T16:19:00.094Z. + */ + endTime: string; + /** + * The time the run was enqueued in UTC timezone in RFC 3339 format, for + * example 2012-11-15T16:19:00.094Z. + */ + enqueuedTime: string; + /** + * Information about why the backup operation failed. This is only present + * if the run has the FAILED status. + */ + error: Schema$OperationError; + /** + * A unique identifier for this backup run. Note that this is unique only + * within the scope of a particular Cloud SQL instance. + */ + id: string; + /** + * Name of the database instance. + */ + instance: string; + /** + * This is always sql#backupRun. + */ + kind: string; + /** + * The URI of this resource. + */ + selfLink: string; + /** + * The time the backup operation actually started in UTC timezone in RFC + * 3339 format, for example 2012-11-15T16:19:00.094Z. + */ + startTime: string; + /** + * The status of this run. + */ + status: string; + /** + * The type of this run; can be either "AUTOMATED" or + * "ON_DEMAND". + */ + type: string; + /** + * The start time of the backup window during which this the backup was + * attempted in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. + */ + windowStartTime: string; } - - getRoot() { - return this.root; + /** + * Backup run list results. + */ + export interface Schema$BackupRunsListResponse { + /** + * A list of backup runs in reverse chronological order of the enqueued + * time. + */ + items: Schema$BackupRun[]; + /** + * This is always sql#backupRunsList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * sql.databases.delete - * @desc Deletes a database from a Cloud SQL instance. - * @alias sql.databases.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Name of the database to be deleted in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance', 'database'], - pathParams: ['database', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Binary log coordinates. + */ + export interface Schema$BinLogCoordinates { + /** + * Name of the binary log file for a Cloud SQL instance. + */ + binLogFileName: string; + /** + * Position (offset) within the binary log file. + */ + binLogPosition: string; + /** + * This is always sql#binLogCoordinates. + */ + kind: string; } - - /** - * sql.databases.get - * @desc Retrieves a resource containing information about a database inside a - * Cloud SQL instance. - * @alias sql.databases.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Name of the database in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'database'], - pathParams: ['database', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance clone context. + */ + export interface Schema$CloneContext { + /** + * Binary log coordinates, if specified, indentify the the position up to + * which the source instance should be cloned. If not specified, the source + * instance is cloned up to the most recent binary log coordintes. + */ + binLogCoordinates: Schema$BinLogCoordinates; + /** + * Name of the Cloud SQL instance to be created as a clone. + */ + destinationInstanceName: string; + /** + * This is always sql#cloneContext. + */ + kind: string; + /** + * Reserved for future use. + */ + pitrTimestampMs: string; } - - /** - * sql.databases.insert - * @desc Inserts a resource containing information about a database inside a - * Cloud SQL instance. - * @alias sql.databases.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().Database} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A database resource inside a Cloud SQL instance. + */ + export interface Schema$Database { + /** + * The MySQL charset value. + */ + charset: string; + /** + * The MySQL collation value. + */ + collation: string; + /** + * HTTP 1.1 Entity tag for the resource. + */ + etag: string; + /** + * The name of the Cloud SQL instance. This does not include the project ID. + */ + instance: string; + /** + * This is always sql#database. + */ + kind: string; + /** + * The name of the database in the Cloud SQL instance. This does not include + * the project ID or instance name. + */ + name: string; + /** + * The project ID of the project containing the Cloud SQL database. The + * Google apps domain is prefixed if applicable. + */ + project: string; + /** + * The URI of this resource. + */ + selfLink: string; } - - /** - * sql.databases.list - * @desc Lists databases in the specified Cloud SQL instance. - * @alias sql.databases.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * MySQL flags for Cloud SQL instances. + */ + export interface Schema$DatabaseFlags { + /** + * The name of the flag. These flags are passed at instance startup, so + * include both MySQL server options and MySQL system variables. Flags + * should be specified with underscores, not hyphens. For more information, + * see Configuring MySQL Flags in the Google Cloud SQL documentation, as + * well as the official MySQL documentation for server options and system + * variables. + */ + name: string; + /** + * The value of the flag. Booleans should be set to on for true and off for + * false. This field must be omitted if the flag doesn't take a value. + */ + value: string; } - - /** - * sql.databases.patch - * @desc Updates a resource containing information about a database inside a - * Cloud SQL instance. This method supports patch semantics. - * @alias sql.databases.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Name of the database to be updated in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().Database} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'instance', 'database'], - pathParams: ['database', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Cloud SQL instance resource. + */ + export interface Schema$DatabaseInstance { + /** + * FIRST_GEN: Basic Cloud SQL instance that runs in a Google-managed + * container. SECOND_GEN: A newer Cloud SQL backend that runs in a Compute + * Engine VM. EXTERNAL: A MySQL server that is not managed by Google. + */ + backendType: string; + /** + * Connection name of the Cloud SQL instance used in connection strings. + */ + connectionName: string; + /** + * The current disk usage of the instance in bytes. This property has been + * deprecated. Users should use the + * "cloudsql.googleapis.com/database/disk/bytes_used" metric in + * Cloud Monitoring API instead. Please see + * https://groups.google.com/d/msg/google-cloud-sql-announce/I_7-F9EBhT0/BtvFtdFeAgAJ + * for details. + */ + currentDiskSize: string; + /** + * The database engine type and version. The databaseVersion field can not + * be changed after instance creation. MySQL Second Generation instances: + * MYSQL_5_7 (default) or MYSQL_5_6. PostgreSQL instances: POSTGRES_9_6 + * MySQL First Generation instances: MYSQL_5_6 (default) or MYSQL_5_5 + */ + databaseVersion: string; + /** + * HTTP 1.1 Entity tag for the resource. + */ + etag: string; + /** + * The name and status of the failover replica. This property is applicable + * only to Second Generation instances. + */ + failoverReplica: any; + /** + * The Compute Engine zone that the instance is currently serving from. This + * value could be different from the zone that was specified when the + * instance was created if the instance has failed over to its secondary + * zone. + */ + gceZone: string; + /** + * The instance type. This can be one of the following. CLOUD_SQL_INSTANCE: + * A Cloud SQL instance that is not replicating from a master. + * ON_PREMISES_INSTANCE: An instance running on the customer's premises. + * READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica. + */ + instanceType: string; + /** + * The assigned IP addresses for the instance. + */ + ipAddresses: Schema$IpMapping[]; + /** + * The IPv6 address assigned to the instance. This property is applicable + * only to First Generation instances. + */ + ipv6Address: string; + /** + * This is always sql#instance. + */ + kind: string; + /** + * The name of the instance which will act as master in the replication + * setup. + */ + masterInstanceName: string; + /** + * The maximum disk size of the instance in bytes. + */ + maxDiskSize: string; + /** + * Name of the Cloud SQL instance. This does not include the project ID. + */ + name: string; + /** + * Configuration specific to on-premises instances. + */ + onPremisesConfiguration: Schema$OnPremisesConfiguration; + /** + * The project ID of the project containing the Cloud SQL instance. The + * Google apps domain is prefixed if applicable. + */ + project: string; + /** + * The geographical region. Can be us-central (FIRST_GEN instances only), + * us-central1 (SECOND_GEN instances only), asia-east1 or europe-west1. + * Defaults to us-central or us-central1 depending on the instance type + * (First Generation or Second Generation). The region can not be changed + * after instance creation. + */ + region: string; + /** + * Configuration specific to read-replicas replicating from on-premises + * masters. + */ + replicaConfiguration: Schema$ReplicaConfiguration; + /** + * The replicas of the instance. + */ + replicaNames: string[]; + /** + * The URI of this resource. + */ + selfLink: string; + /** + * SSL configuration. + */ + serverCaCert: Schema$SslCert; + /** + * The service account email address assigned to the instance. This property + * is applicable only to Second Generation instances. + */ + serviceAccountEmailAddress: string; + /** + * The user settings. + */ + settings: Schema$Settings; + /** + * The current serving state of the Cloud SQL instance. This can be one of + * the following. RUNNABLE: The instance is running, or is ready to run when + * accessed. SUSPENDED: The instance is not available, for example due to + * problems with billing. PENDING_CREATE: The instance is being created. + * MAINTENANCE: The instance is down for maintenance. FAILED: The instance + * creation failed. UNKNOWN_STATE: The state of the instance is unknown. + */ + state: string; + /** + * If the instance state is SUSPENDED, the reason for the suspension. + */ + suspensionReason: string[]; } - - /** - * sql.databases.update - * @desc Updates a resource containing information about a database inside a - * Cloud SQL instance. - * @alias sql.databases.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.database Name of the database to be updated in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().Database} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'instance', 'database'], - pathParams: ['database', 'instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database list response. + */ + export interface Schema$DatabasesListResponse { + /** + * List of database resources in the instance. + */ + items: Schema$Database[]; + /** + * This is always sql#databasesList. + */ + kind: string; } -} - -export class Resource$Flags { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Read-replica configuration for connecting to the on-premises master. + */ + export interface Schema$DemoteMasterConfiguration { + /** + * This is always sql#demoteMasterConfiguration. + */ + kind: string; + /** + * MySQL specific configuration when replicating from a MySQL on-premises + * master. Replication configuration information such as the username, + * password, certificates, and keys are not stored in the instance metadata. + * The configuration information is used only to set up the replication + * connection and is stored by MySQL in a file named master.info in the data + * directory. + */ + mysqlReplicaConfiguration: Schema$DemoteMasterMySqlReplicaConfiguration; } - - getRoot() { - return this.root; + /** + * Database instance demote master context. + */ + export interface Schema$DemoteMasterContext { + /** + * This is always sql#demoteMasterContext. + */ + kind: string; + /** + * The name of the instance which will act as on-premises master in the + * replication setup. + */ + masterInstanceName: string; + /** + * Configuration specific to read-replicas replicating from the on-premises + * master. + */ + replicaConfiguration: Schema$DemoteMasterConfiguration; + /** + * Verify GTID consistency for demote operation. Default value: True. Second + * Generation instances only. Setting this flag to false enables you to + * bypass GTID consistency check between on-premises master and Cloud SQL + * instance during the demotion operation but also exposes you to the risk + * of future replication failures. Change the value only if you know the + * reason for the GTID divergence and are confident that doing so will not + * cause any replication issues. + */ + verifyGtidConsistency: boolean; } - - /** - * sql.flags.list - * @desc List all available database flags for Google Cloud SQL instances. - * @alias sql.flags.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.databaseVersion Database version for flag retrieval. Flags are specific to the database version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta4/flags').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Read-replica configuration specific to MySQL databases. + */ + export interface Schema$DemoteMasterMySqlReplicaConfiguration { + /** + * PEM representation of the trusted CA's x509 certificate. + */ + caCertificate: string; + /** + * PEM representation of the slave's x509 certificate. + */ + clientCertificate: string; + /** + * PEM representation of the slave's private key. The corresponsing + * public key is encoded in the client's certificate. The format of the + * slave's private key can be either PKCS #1 or PKCS #8. + */ + clientKey: string; + /** + * This is always sql#demoteMasterMysqlReplicaConfiguration. + */ + kind: string; + /** + * The password for the replication connection. + */ + password: string; + /** + * The username for the replication connection. + */ + username: string; } -} - -export class Resource$Instances { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Database instance export context. + */ + export interface Schema$ExportContext { + /** + * Options for exporting data as CSV. + */ + csvExportOptions: any; + /** + * Databases (for example, guestbook) from which the export is made. If + * fileType is SQL and no database is specified, all databases are exported. + * If fileType is CSV, you can optionally specify at most one database to + * export. If csvExportOptions.selectQuery also specifies the database, this + * field will be ignored. + */ + databases: string[]; + /** + * The file type for the specified uri. SQL: The file contains SQL + * statements. CSV: The file contains CSV data. + */ + fileType: string; + /** + * This is always sql#exportContext. + */ + kind: string; + /** + * Options for exporting data as SQL statements. + */ + sqlExportOptions: any; + /** + * The path to the file in Google Cloud Storage where the export will be + * stored. The URI is in the form gs://bucketName/fileName. If the file + * already exists, the requests succeeds, but the operation fails. If + * fileType is SQL and the filename ends with .gz, the contents are + * compressed. + */ + uri: string; } - - getRoot() { - return this.root; + /** + * Database instance failover context. + */ + export interface Schema$FailoverContext { + /** + * This is always sql#failoverContext. + */ + kind: string; + /** + * The current settings version of this instance. Request will be rejected + * if this version doesn't match the current settings version. + */ + settingsVersion: string; + } + /** + * A Google Cloud SQL service flag resource. + */ + export interface Schema$Flag { + /** + * For STRING flags, a list of strings that the value can be set to. + */ + allowedStringValues: string[]; + /** + * The database version this flag applies to. Can be MYSQL_5_5, MYSQL_5_6, + * or MYSQL_5_7. MYSQL_5_7 is applicable only to Second Generation + * instances. + */ + appliesTo: string[]; + /** + * This is always sql#flag. + */ + kind: string; + /** + * For INTEGER flags, the maximum allowed value. + */ + maxValue: string; + /** + * For INTEGER flags, the minimum allowed value. + */ + minValue: string; + /** + * This is the name of the flag. Flag names always use underscores, not + * hyphens, e.g. max_allowed_packet + */ + name: string; + /** + * Indicates whether changing this flag will trigger a database restart. + * Only applicable to Second Generation instances. + */ + requiresRestart: boolean; + /** + * The type of the flag. Flags are typed to being BOOLEAN, STRING, INTEGER + * or NONE. NONE is used for flags which do not take a value, such as + * skip_grant_tables. + */ + type: string; } - - /** - * sql.instances.clone - * @desc Creates a Cloud SQL instance as a clone of the source instance. The - * API is not ready for Second Generation instances yet. - * @alias sql.instances.clone - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. - * @param {string} params.project Project ID of the source as well as the clone Cloud SQL instance. - * @param {().InstancesCloneRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clone(params?: any, options?: MethodOptions): AxiosPromise; - clone( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clone( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/clone') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Flags list response. + */ + export interface Schema$FlagsListResponse { + /** + * List of flags. + */ + items: Schema$Flag[]; + /** + * This is always sql#flagsList. + */ + kind: string; } - - /** - * sql.instances.delete - * @desc Deletes a Cloud SQL instance. - * @alias sql.instances.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance import context. + */ + export interface Schema$ImportContext { + /** + * Options for importing data as CSV. + */ + csvImportOptions: any; + /** + * The database (for example, guestbook) to which the import is made. If + * fileType is SQL and no database is specified, it is assumed that the + * database is specified in the file to be imported. If fileType is CSV, it + * must be specified. + */ + database: string; + /** + * The file type for the specified uri. SQL: The file contains SQL + * statements. CSV: The file contains CSV data. + */ + fileType: string; + /** + * The PostgreSQL user for this import operation. Defaults to + * cloudsqlsuperuser. Used only for PostgreSQL instances. + */ + importUser: string; + /** + * This is always sql#importContext. + */ + kind: string; + /** + * A path to the file in Google Cloud Storage from which the import is made. + * The URI is in the form gs://bucketName/fileName. Compressed gzip files + * (.gz) are supported when fileType is SQL. + */ + uri: string; } - - /** - * sql.instances.demoteMaster - * @desc Reserved for future use. - * @alias sql.instances.demoteMaster - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance name. - * @param {string} params.project ID of the project that contains the instance. - * @param {().InstancesDemoteMasterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database instance clone request. */ - demoteMaster(params?: any, options?: MethodOptions): - AxiosPromise; - demoteMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - demoteMaster( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesCloneRequest { + /** + * Contains details about the clone operation. + */ + cloneContext: Schema$CloneContext; } - - /** - * sql.instances.export - * @desc Exports data from a Cloud SQL instance to a Google Cloud Storage - * bucket as a MySQL dump file. - * @alias sql.instances.export - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be exported. - * @param {().InstancesExportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database demote master request. */ - export(params?: any, options?: MethodOptions): AxiosPromise; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - export( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/export') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesDemoteMasterRequest { + /** + * Contains details about the demoteMaster operation. + */ + demoteMasterContext: Schema$DemoteMasterContext; } - - /** - * sql.instances.failover - * @desc Failover the instance to its failover replica instance. - * @alias sql.instances.failover - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project ID of the project that contains the read replica. - * @param {().InstancesFailoverRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database instance export request. */ - failover(params?: any, options?: MethodOptions): - AxiosPromise; - failover( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - failover( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/failover') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesExportRequest { + /** + * Contains details about the export operation. + */ + exportContext: Schema$ExportContext; } - - /** - * sql.instances.get - * @desc Retrieves a resource containing information about a Cloud SQL - * instance. - * @alias sql.instances.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Instance failover request. */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesFailoverRequest { + /** + * Failover Context. + */ + failoverContext: Schema$FailoverContext; } - - /** - * sql.instances.import - * @desc Imports data into a Cloud SQL instance from a MySQL dump file in - * Google Cloud Storage. - * @alias sql.instances.import - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().InstancesImportRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database instance import request. */ -import(params?: any, options?: MethodOptions): AxiosPromise; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; -import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { - callback = options; - options = {}; - } if(typeof params === 'function') { - callback = params; - params = {}; - } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['project', 'instance'], pathParams: ['instance', 'project'], context: this.getRoot()}; if(callback) { - createAPIRequest(parameters, callback); - } else { return createAPIRequest(parameters); - }} - - + export interface Schema$InstancesImportRequest { + /** + * Contains details about the import operation. + */ + importContext: Schema$ImportContext; + } /** - * sql.instances.insert - * @desc Creates a new Cloud SQL instance. - * @alias sql.instances.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta4/projects/{project}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instances list response. + */ + export interface Schema$InstancesListResponse { + /** + * List of database instance resources. + */ + items: Schema$DatabaseInstance[]; + /** + * This is always sql#instancesList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * sql.instances.list - * @desc Lists instances under a given project in the alphabetical order of - * the instance name. - * @alias sql.instances.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter An expression for filtering the results of the request, such as by name or label. - * @param {integer=} params.maxResults The maximum number of results to return per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Database instance restore backup request. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta4/projects/{project}/instances') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesRestoreBackupRequest { + /** + * Parameters required to perform the restore backup operation. + */ + restoreBackupContext: Schema$RestoreBackupContext; } - - /** - * sql.instances.patch - * @desc Updates settings of a Cloud SQL instance. Caution: This is not a - * partial update, so you must include values for all the settings that you - * want to retain. For partial updates, use patch.. This method supports patch - * semantics. - * @alias sql.instances.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Instance truncate log request. */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$InstancesTruncateLogRequest { + /** + * Contains details about the truncate log operation. + */ + truncateLogContext: Schema$TruncateLogContext; } - - /** - * sql.instances.promoteReplica - * @desc Promotes the read replica instance to be a stand-alone Cloud SQL - * instance. - * @alias sql.instances.promoteReplica - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL read replica instance name. - * @param {string} params.project ID of the project that contains the read replica. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - promoteReplica(params?: any, options?: MethodOptions): - AxiosPromise; - promoteReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - promoteReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * IP Management configuration. + */ + export interface Schema$IpConfiguration { + /** + * The list of external networks that are allowed to connect to the instance + * using the IP. In CIDR notation, also known as 'slash' notation + * (e.g. 192.168.100.0/24). + */ + authorizedNetworks: Schema$AclEntry[]; + /** + * Whether the instance should be assigned an IP address or not. + */ + ipv4Enabled: boolean; + /** + * Whether SSL connections over IP should be enforced or not. + */ + requireSsl: boolean; } - - /** - * sql.instances.resetSslConfig - * @desc Deletes all client certificates and generates a new server SSL - * certificate for the instance. The changes will not take effect until the - * instance is restarted. Existing instances without a server certificate will - * need to call this once to set a server certificate. - * @alias sql.instances.resetSslConfig - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resetSslConfig(params?: any, options?: MethodOptions): - AxiosPromise; - resetSslConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resetSslConfig( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance IP Mapping. + */ + export interface Schema$IpMapping { + /** + * The IP address assigned. + */ + ipAddress: string; + /** + * The due time for this IP to be retired in RFC 3339 format, for example + * 2012-11-15T16:19:00.094Z. This field is only available when the IP is + * scheduled to be retired. + */ + timeToRetire: string; + /** + * The type of this IP address. A PRIMARY address is an address that can + * accept incoming connections. An OUTGOING address is the source address of + * connections originating from the instance, if supported. + */ + type: string; } - - /** - * sql.instances.restart - * @desc Restarts a Cloud SQL instance. - * @alias sql.instances.restart - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be restarted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restart(params?: any, options?: MethodOptions): - AxiosPromise; - restart( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - restart( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/restart') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Preferred location. This specifies where a Cloud SQL instance should + * preferably be located, either in a specific Compute Engine zone, or + * co-located with an App Engine application. Note that if the preferred + * location is not available, the instance will be located as close as + * possible within the region. Only one location may be specified. + */ + export interface Schema$LocationPreference { + /** + * The AppEngine application to follow, it must be in the same region as the + * Cloud SQL instance. + */ + followGaeApplication: string; + /** + * This is always sql#locationPreference. + */ + kind: string; + /** + * The preferred Compute Engine zone (e.g. us-centra1-a, us-central1-b, + * etc.). + */ + zone: string; } - - /** - * sql.instances.restoreBackup - * @desc Restores a backup of a Cloud SQL instance. - * @alias sql.instances.restoreBackup - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().InstancesRestoreBackupRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restoreBackup(params?: any, options?: MethodOptions): - AxiosPromise; - restoreBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - restoreBackup( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Maintenance window. This specifies when a v2 Cloud SQL instance should + * preferably be restarted for system maintenance puruposes. + */ + export interface Schema$MaintenanceWindow { + /** + * day of week (1-7), starting on Monday. + */ + day: number; + /** + * hour of day - 0 to 23. + */ + hour: number; + /** + * This is always sql#maintenanceWindow. + */ + kind: string; + /** + * Maintenance timing setting: canary (Earlier) or stable (Later). Learn + * more. + */ + updateTrack: string; } - - /** - * sql.instances.startReplica - * @desc Starts the replication in the read replica instance. - * @alias sql.instances.startReplica - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL read replica instance name. - * @param {string} params.project ID of the project that contains the read replica. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startReplica(params?: any, options?: MethodOptions): - AxiosPromise; - startReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/startReplica') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Read-replica configuration specific to MySQL databases. + */ + export interface Schema$MySqlReplicaConfiguration { + /** + * PEM representation of the trusted CA's x509 certificate. + */ + caCertificate: string; + /** + * PEM representation of the slave's x509 certificate. + */ + clientCertificate: string; + /** + * PEM representation of the slave's private key. The corresponsing + * public key is encoded in the client's certificate. + */ + clientKey: string; + /** + * Seconds to wait between connect retries. MySQL's default is 60 + * seconds. + */ + connectRetryInterval: number; + /** + * Path to a SQL dump file in Google Cloud Storage from which the slave + * instance is to be created. The URI is in the form + * gs://bucketName/fileName. Compressed gzip files (.gz) are also supported. + * Dumps should have the binlog co-ordinates from which replication should + * begin. This can be accomplished by setting --master-data to 1 when using + * mysqldump. + */ + dumpFilePath: string; + /** + * This is always sql#mysqlReplicaConfiguration. + */ + kind: string; + /** + * Interval in milliseconds between replication heartbeats. + */ + masterHeartbeatPeriod: string; + /** + * The password for the replication connection. + */ + password: string; + /** + * A list of permissible ciphers to use for SSL encryption. + */ + sslCipher: string; + /** + * The username for the replication connection. + */ + username: string; + /** + * Whether or not to check the master's Common Name value in the + * certificate that it sends during the SSL handshake. + */ + verifyServerCertificate: boolean; } - - /** - * sql.instances.stopReplica - * @desc Stops the replication in the read replica instance. - * @alias sql.instances.stopReplica - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL read replica instance name. - * @param {string} params.project ID of the project that contains the read replica. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stopReplica(params?: any, options?: MethodOptions): - AxiosPromise; - stopReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stopReplica( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * On-premises instance configuration. + */ + export interface Schema$OnPremisesConfiguration { + /** + * The host and port of the on-premises instance in host:port format + */ + hostPort: string; + /** + * This is always sql#onPremisesConfiguration. + */ + kind: string; } - - /** - * sql.instances.truncateLog - * @desc Truncate MySQL general and slow query log tables - * @alias sql.instances.truncateLog - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the Cloud SQL project. - * @param {().InstancesTruncateLogRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - truncateLog(params?: any, options?: MethodOptions): - AxiosPromise; - truncateLog( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - truncateLog( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An Operations resource contains information about database instance + * operations such as create, delete, and restart. Operations resources are + * created in response to operations that were initiated; you never create + * them directly. + */ + export interface Schema$Operation { + /** + * The time this operation finished in UTC timezone in RFC 3339 format, for + * example 2012-11-15T16:19:00.094Z. + */ + endTime: string; + /** + * If errors occurred during processing of this operation, this field will + * be populated. + */ + error: Schema$OperationErrors; + /** + * The context for export operation, if applicable. + */ + exportContext: Schema$ExportContext; + /** + * The context for import operation, if applicable. + */ + importContext: Schema$ImportContext; + /** + * The time this operation was enqueued in UTC timezone in RFC 3339 format, + * for example 2012-11-15T16:19:00.094Z. + */ + insertTime: string; + /** + * This is always sql#operation. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + name: string; + /** + * The type of the operation. Valid values are CREATE, DELETE, UPDATE, + * RESTART, IMPORT, EXPORT, BACKUP_VOLUME, RESTORE_VOLUME, CREATE_USER, + * DELETE_USER, CREATE_DATABASE, DELETE_DATABASE . + */ + operationType: string; + /** + * The URI of this resource. + */ + selfLink: string; + /** + * The time this operation actually started in UTC timezone in RFC 3339 + * format, for example 2012-11-15T16:19:00.094Z. + */ + startTime: string; + /** + * The status of an operation. Valid values are PENDING, RUNNING, DONE, + * UNKNOWN. + */ + status: string; + /** + * Name of the database instance related to this operation. + */ + targetId: string; + targetLink: string; + /** + * The project ID of the target instance related to this operation. + */ + targetProject: string; + /** + * The email address of the user who initiated this operation. + */ + user: string; } - - /** - * sql.instances.update - * @desc Updates settings of a Cloud SQL instance. Caution: This is not a - * partial update, so you must include values for all the settings that you - * want to retain. For partial updates, use patch. - * @alias sql.instances.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().DatabaseInstance} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance operation error. + */ + export interface Schema$OperationError { + /** + * Identifies the specific error that occurred. + */ + code: string; + /** + * This is always sql#operationError. + */ + kind: string; + /** + * Additional information about the error encountered. + */ + message: string; } -} - -export class Resource$Operations { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Database instance operation errors list wrapper. + */ + export interface Schema$OperationErrors { + /** + * The list of errors encountered while processing this operation. + */ + errors: Schema$OperationError[]; + /** + * This is always sql#operationErrors. + */ + kind: string; } - - getRoot() { - return this.root; + /** + * Database instance list operations response. + */ + export interface Schema$OperationsListResponse { + /** + * List of operation resources. + */ + items: Schema$Operation[]; + /** + * This is always sql#operationsList. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * sql.operations.get - * @desc Retrieves an instance operation that has been performed on an - * instance. - * @alias sql.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.operation Instance operation ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/operations/{operation}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'operation'], - pathParams: ['operation', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Read-replica configuration for connecting to the master. + */ + export interface Schema$ReplicaConfiguration { + /** + * Specifies if the replica is the failover target. If the field is set to + * true the replica will be designated as a failover replica. In case the + * master instance fails, the replica instance will be promoted as the new + * master instance. Only one replica can be specified as failover target, + * and the replica has to be in different zone with the master instance. + */ + failoverTarget: boolean; + /** + * This is always sql#replicaConfiguration. + */ + kind: string; + /** + * MySQL specific configuration when replicating from a MySQL on-premises + * master. Replication configuration information such as the username, + * password, certificates, and keys are not stored in the instance metadata. + * The configuration information is used only to set up the replication + * connection and is stored by MySQL in a file named master.info in the data + * directory. + */ + mysqlReplicaConfiguration: Schema$MySqlReplicaConfiguration; } - - /** - * sql.operations.list - * @desc Lists all instance operations that have been performed on the given - * Cloud SQL instance in the reverse chronological order of the start time. - * @alias sql.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {integer=} params.maxResults Maximum number of operations per response. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta4/projects/{project}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database instance restore from backup context. + */ + export interface Schema$RestoreBackupContext { + /** + * The ID of the backup run to restore from. + */ + backupRunId: string; + /** + * The ID of the instance that the backup was taken from. + */ + instanceId: string; + /** + * This is always sql#restoreBackupContext. + */ + kind: string; } -} - -export class Resource$Sslcerts { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * Database instance settings. + */ + export interface Schema$Settings { + /** + * The activation policy specifies when the instance is activated; it is + * applicable only when the instance state is RUNNABLE. Valid values: + * ALWAYS: The instance is on, and remains so even in the absence of + * connection requests. NEVER: The instance is off; it is not activated, + * even if a connection request arrives. ON_DEMAND: First Generation + * instances only. The instance responds to incoming requests, and turns + * itself off when not in use. Instances with PER_USE pricing turn off after + * 15 minutes of inactivity. Instances with PER_PACKAGE pricing turn off + * after 12 hours of inactivity. + */ + activationPolicy: string; + /** + * The App Engine app IDs that can access this instance. This property is + * only applicable to First Generation instances. + */ + authorizedGaeApplications: string[]; + /** + * Availability type (PostgreSQL instances only). Potential values: ZONAL: + * The instance serves data from only one zone. Outages in that zone affect + * data accessibility. REGIONAL: The instance can serve data from more than + * one zone in a region (it is highly available). For more information, see + * Overview of the High Availability Configuration. + */ + availabilityType: string; + /** + * The daily backup configuration for the instance. + */ + backupConfiguration: Schema$BackupConfiguration; + /** + * Configuration specific to read replica instances. Indicates whether + * database flags for crash-safe replication are enabled. This property is + * only applicable to First Generation instances. + */ + crashSafeReplicationEnabled: boolean; + /** + * The database flags passed to the instance at startup. + */ + databaseFlags: Schema$DatabaseFlags[]; + /** + * Configuration specific to read replica instances. Indicates whether + * replication is enabled or not. + */ + databaseReplicationEnabled: boolean; + /** + * The size of data disk, in GB. The data disk size minimum is 10GB. Applies + * only to Second Generation instances. + */ + dataDiskSizeGb: string; + /** + * The type of data disk. Only supported for Second Generation instances. + * The default type is PD_SSD. Applies only to Second Generation instances. + */ + dataDiskType: string; + /** + * The settings for IP Management. This allows to enable or disable the + * instance IP and manage which external networks can connect to the + * instance. The IPv4 address cannot be disabled for Second Generation + * instances. + */ + ipConfiguration: Schema$IpConfiguration; + /** + * This is always sql#settings. + */ + kind: string; + /** + * The location preference settings. This allows the instance to be located + * as near as possible to either an App Engine app or Compute Engine zone + * for better performance. App Engine co-location is only applicable to + * First Generation instances. + */ + locationPreference: Schema$LocationPreference; + /** + * The maintenance window for this instance. This specifies when the + * instance may be restarted for maintenance purposes. Applies only to + * Second Generation instances. + */ + maintenanceWindow: Schema$MaintenanceWindow; + /** + * The pricing plan for this instance. This can be either PER_USE or + * PACKAGE. Only PER_USE is supported for Second Generation instances. + */ + pricingPlan: string; + /** + * The type of replication this instance uses. This can be either + * ASYNCHRONOUS or SYNCHRONOUS. This property is only applicable to First + * Generation instances. + */ + replicationType: string; + /** + * The version of instance settings. This is a required field for update + * method to make sure concurrent updates are handled properly. During + * update, use the most recent settingsVersion value for this instance and + * do not try to update this value. + */ + settingsVersion: string; + /** + * Configuration to increase storage size automatically. The default value + * is true. Applies only to Second Generation instances. + */ + storageAutoResize: boolean; + /** + * The maximum size to which storage capacity can be automatically + * increased. The default value is 0, which specifies that there is no + * limit. Applies only to Second Generation instances. + */ + storageAutoResizeLimit: string; + /** + * The tier of service for this instance, for example D1, D2. For more + * information, see pricing. + */ + tier: string; + /** + * User-provided labels, represented as a dictionary where each label is a + * single key value pair. + */ + userLabels: any; } - - getRoot() { - return this.root; + /** + * SslCerts Resource + */ + export interface Schema$SslCert { + /** + * PEM representation. + */ + cert: string; + /** + * Serial number, as extracted from the certificate. + */ + certSerialNumber: string; + /** + * User supplied name. Constrained to [a-zA-Z.-_ ]+. + */ + commonName: string; + /** + * The time when the certificate was created in RFC 3339 format, for example + * 2012-11-15T16:19:00.094Z + */ + createTime: string; + /** + * The time when the certificate expires in RFC 3339 format, for example + * 2012-11-15T16:19:00.094Z. + */ + expirationTime: string; + /** + * Name of the database instance. + */ + instance: string; + /** + * This is always sql#sslCert. + */ + kind: string; + /** + * The URI of this resource. + */ + selfLink: string; + /** + * Sha1 Fingerprint. + */ + sha1Fingerprint: string; } - - /** - * sql.sslCerts.createEphemeral - * @desc Generates a short-lived X509 certificate containing the provided - * public key and signed by a private key specific to the target instance. - * Users may use the certificate to authenticate as themselves when connecting - * to the database. - * @alias sql.sslCerts.createEphemeral - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the Cloud SQL project. - * @param {().SslCertsCreateEphemeralRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - createEphemeral(params?: any, options?: MethodOptions): - AxiosPromise; - createEphemeral( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - createEphemeral( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCertDetail. + */ + export interface Schema$SslCertDetail { + /** + * The public information about the cert. + */ + certInfo: Schema$SslCert; + /** + * The private key for the client cert, in pem format. Keep private in order + * to protect your security. + */ + certPrivateKey: string; } - - /** - * sql.sslCerts.delete - * @desc Deletes the SSL certificate. The change will not take effect until - * the instance is restarted. - * @alias sql.sslCerts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance to be deleted. - * @param {string} params.sha1Fingerprint Sha1 FingerPrint. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * SslCerts create ephemeral certificate request. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance', 'sha1Fingerprint'], - pathParams: ['instance', 'project', 'sha1Fingerprint'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SslCertsCreateEphemeralRequest { + /** + * PEM encoded public key to include in the signed certificate. + */ + public_key: string; } - - /** - * sql.sslCerts.get - * @desc Retrieves a particular SSL certificate. Does not include the private - * key (required for usage). The private key must be saved from the response - * to initial creation. - * @alias sql.sslCerts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {string} params.sha1Fingerprint Sha1 FingerPrint. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * SslCerts insert request. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance', 'sha1Fingerprint'], - pathParams: ['instance', 'project', 'sha1Fingerprint'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$SslCertsInsertRequest { + /** + * User supplied name. Must be a distinct name from the other certificates + * for this instance. New certificates will not be usable until the instance + * is restarted. + */ + commonName: string; } - - /** - * sql.sslCerts.insert - * @desc Creates an SSL certificate and returns it along with the private key - * and server certificate authority. The new certificate will not be usable - * until the instance is restarted. - * @alias sql.sslCerts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. - * @param {().SslCertsInsertRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCert insert response. + */ + export interface Schema$SslCertsInsertResponse { + /** + * The new client certificate and private key. For First Generation + * instances, the new certificate does not take effect until the instance is + * restarted. + */ + clientCert: Schema$SslCertDetail; + /** + * This is always sql#sslCertsInsert. + */ + kind: string; + /** + * The operation to track the ssl certs insert request. + */ + operation: Schema$Operation; + /** + * The server Certificate Authority's certificate. If this is missing + * you can force a new one to be generated by calling resetSslConfig method + * on instances resource. + */ + serverCaCert: Schema$SslCert; } - - /** - * sql.sslCerts.list - * @desc Lists all of the current SSL certificates for the instance. - * @alias sql.sslCerts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * SslCerts list response. + */ + export interface Schema$SslCertsListResponse { + /** + * List of client certificates for the instance. + */ + items: Schema$SslCert[]; + /** + * This is always sql#sslCertsList. + */ + kind: string; } -} - -export class Resource$Tiers { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * A Google Cloud SQL service tier resource. + */ + export interface Schema$Tier { + /** + * The maximum disk size of this tier in bytes. + */ + DiskQuota: string; + /** + * This is always sql#tier. + */ + kind: string; + /** + * The maximum RAM usage of this tier in bytes. + */ + RAM: string; + /** + * The applicable regions for this tier. + */ + region: string[]; + /** + * An identifier for the service tier, for example D1, D2 etc. For related + * information, see Pricing. + */ + tier: string; } - - getRoot() { - return this.root; + /** + * Tiers list response. + */ + export interface Schema$TiersListResponse { + /** + * List of tiers. + */ + items: Schema$Tier[]; + /** + * This is always sql#tiersList. + */ + kind: string; } - - /** - * sql.tiers.list - * @desc Lists all available service tiers for Google Cloud SQL, for example - * D1, D2. For related information, see Pricing. - * @alias sql.tiers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project Project ID of the project for which to list tiers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/sql/v1beta4/projects/{project}/tiers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: ['project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Database Instance truncate log context. + */ + export interface Schema$TruncateLogContext { + /** + * This is always sql#truncateLogContext. + */ + kind: string; + /** + * The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and + * MYSQL_SLOW_TABLE. + */ + logType: string; } -} - -export class Resource$Users { - root: Sqladmin; - constructor(root: Sqladmin) { - this.root = root; - this.getRoot.bind(this); + /** + * A Cloud SQL user resource. + */ + export interface Schema$User { + /** + * HTTP 1.1 Entity tag for the resource. + */ + etag: string; + /** + * The host name from which the user can connect. For insert operations, + * host defaults to an empty string. For update operations, host is + * specified as part of the request URL. The host name cannot be updated + * after insertion. + */ + host: string; + /** + * The name of the Cloud SQL instance. This does not include the project ID. + * Can be omitted for update since it is already specified on the URL. + */ + instance: string; + /** + * This is always sql#user. + */ + kind: string; + /** + * The name of the user in the Cloud SQL instance. Can be omitted for update + * since it is already specified on the URL. + */ + name: string; + /** + * The password for the user. + */ + password: string; + /** + * The project ID of the project containing the Cloud SQL database. The + * Google apps domain is prefixed if applicable. Can be omitted for update + * since it is already specified on the URL. + */ + project: string; } - - getRoot() { - return this.root; + /** + * User list response. + */ + export interface Schema$UsersListResponse { + /** + * List of user resources in the instance. + */ + items: Schema$User[]; + /** + * This is always sql#usersList. + */ + kind: string; + /** + * An identifier that uniquely identifies the operation. You can use this + * identifier to retrieve the Operations resource that has information about + * the operation. + */ + nextPageToken: string; } - - /** - * sql.users.delete - * @desc Deletes a user from a Cloud SQL instance. - * @alias sql.users.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.host Host of the user in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.name Name of the user in the instance. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'instance', 'host', 'name'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Backupruns { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.backupRuns.delete + * @desc Deletes the backup taken by a backup run. + * @alias sql.backupRuns.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of the Backup Run to delete. To find a Backup Run ID, use the list method. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance', 'id'], + pathParams: ['id', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.backupRuns.get + * @desc Retrieves a resource containing information about a backup run. + * @alias sql.backupRuns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The ID of this Backup Run. + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'id'], + pathParams: ['id', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.backupRuns.insert + * @desc Creates a new backup run on demand. This method is applicable only + * to Second Generation instances. + * @alias sql.backupRuns.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().BackupRun} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.backupRuns.list + * @desc Lists all backup runs associated with a given instance and + * configuration in the reverse chronological order of the enqueued time. + * @alias sql.backupRuns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of backup runs per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * sql.users.insert - * @desc Creates a new user in a Cloud SQL instance. - * @alias sql.users.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Databases { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.databases.delete + * @desc Deletes a database from a Cloud SQL instance. + * @alias sql.databases.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be deleted in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.databases.get + * @desc Retrieves a resource containing information about a database inside + * a Cloud SQL instance. + * @alias sql.databases.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.databases.insert + * @desc Inserts a resource containing information about a database inside a + * Cloud SQL instance. + * @alias sql.databases.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.databases.list + * @desc Lists databases in the specified Cloud SQL instance. + * @alias sql.databases.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.databases.patch + * @desc Updates a resource containing information about a database inside a + * Cloud SQL instance. This method supports patch semantics. + * @alias sql.databases.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be updated in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.databases.update + * @desc Updates a resource containing information about a database inside a + * Cloud SQL instance. + * @alias sql.databases.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.database Name of the database to be updated in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().Database} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'instance', 'database'], + pathParams: ['database', 'instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Flags { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.flags.list + * @desc List all available database flags for Google Cloud SQL instances. + * @alias sql.flags.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.databaseVersion Database version for flag retrieval. Flags are specific to the database version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/flags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Instances { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.instances.clone + * @desc Creates a Cloud SQL instance as a clone of the source instance. The + * API is not ready for Second Generation instances yet. + * @alias sql.instances.clone + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID. + * @param {string} params.project Project ID of the source as well as the clone Cloud SQL instance. + * @param {().InstancesCloneRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clone(params?: any, options?: MethodOptions): + AxiosPromise; + clone( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clone( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/clone') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.delete + * @desc Deletes a Cloud SQL instance. + * @alias sql.instances.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.demoteMaster + * @desc Reserved for future use. + * @alias sql.instances.demoteMaster + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance name. + * @param {string} params.project ID of the project that contains the instance. + * @param {().InstancesDemoteMasterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + demoteMaster(params?: any, options?: MethodOptions): + AxiosPromise; + demoteMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + demoteMaster( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/demoteMaster') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.export + * @desc Exports data from a Cloud SQL instance to a Google Cloud Storage + * bucket as a MySQL dump file. + * @alias sql.instances.export + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be exported. + * @param {().InstancesExportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + export(params?: any, options?: MethodOptions): + AxiosPromise; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + export( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/export') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.failover + * @desc Failover the instance to its failover replica instance. + * @alias sql.instances.failover + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project ID of the project that contains the read replica. + * @param {().InstancesFailoverRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + failover(params?: any, options?: MethodOptions): + AxiosPromise; + failover( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + failover( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/failover') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.get + * @desc Retrieves a resource containing information about a Cloud SQL + * instance. + * @alias sql.instances.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.import + * @desc Imports data into a Cloud SQL instance from a MySQL dump file in + * Google Cloud Storage. + * @alias sql.instances.import + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesImportRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ +import(params?: any, options?: MethodOptions): AxiosPromise; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void; +import(params?: any, options?: MethodOptions|BodyResponseCallback, callback?: BodyResponseCallback): void|AxiosPromise {if(typeof options === 'function') { + callback = options; + options = {}; + } if(typeof params === 'function') { + callback = params; + params = {}; + } options = options || {}; const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; const parameters = {options: Object.assign({url: (rootUrl + '/sql/v1beta4/projects/{project}/instances/{instance}/import').replace(/([^:]\/)\/+/g, '$1'), method: 'POST'}, options), params, requiredParams: ['project', 'instance'], pathParams: ['instance', 'project'], context: this.getRoot()}; if(callback) { + createAPIRequest(parameters, callback); + } else { return createAPIRequest(parameters); + }} + - /** - * sql.users.list - * @desc Lists users in the specified Cloud SQL instance. - * @alias sql.users.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'instance'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * sql.instances.insert + * @desc Creates a new Cloud SQL instance. + * @alias sql.instances.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/projects/{project}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.list + * @desc Lists instances under a given project in the alphabetical order of + * the instance name. + * @alias sql.instances.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter An expression for filtering the results of the request, such as by name or label. + * @param {integer=} params.maxResults The maximum number of results to return per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/projects/{project}/instances') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.patch + * @desc Updates settings of a Cloud SQL instance. Caution: This is not a + * partial update, so you must include values for all the settings that you + * want to retain. For partial updates, use patch.. This method supports + * patch semantics. + * @alias sql.instances.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.promoteReplica + * @desc Promotes the read replica instance to be a stand-alone Cloud SQL + * instance. + * @alias sql.instances.promoteReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + promoteReplica(params?: any, options?: MethodOptions): + AxiosPromise; + promoteReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + promoteReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplica') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.resetSslConfig + * @desc Deletes all client certificates and generates a new server SSL + * certificate for the instance. The changes will not take effect until the + * instance is restarted. Existing instances without a server certificate + * will need to call this once to set a server certificate. + * @alias sql.instances.resetSslConfig + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resetSslConfig(params?: any, options?: MethodOptions): + AxiosPromise; + resetSslConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resetSslConfig( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfig') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.restart + * @desc Restarts a Cloud SQL instance. + * @alias sql.instances.restart + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be restarted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restart(params?: any, options?: MethodOptions): + AxiosPromise; + restart( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + restart( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/restart') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.restoreBackup + * @desc Restores a backup of a Cloud SQL instance. + * @alias sql.instances.restoreBackup + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().InstancesRestoreBackupRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restoreBackup(params?: any, options?: MethodOptions): + AxiosPromise; + restoreBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + restoreBackup( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackup') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.startReplica + * @desc Starts the replication in the read replica instance. + * @alias sql.instances.startReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startReplica(params?: any, options?: MethodOptions): + AxiosPromise; + startReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/startReplica') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.stopReplica + * @desc Stops the replication in the read replica instance. + * @alias sql.instances.stopReplica + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL read replica instance name. + * @param {string} params.project ID of the project that contains the read replica. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stopReplica(params?: any, options?: MethodOptions): + AxiosPromise; + stopReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stopReplica( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/stopReplica') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.truncateLog + * @desc Truncate MySQL general and slow query log tables + * @alias sql.instances.truncateLog + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the Cloud SQL project. + * @param {().InstancesTruncateLogRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + truncateLog(params?: any, options?: MethodOptions): + AxiosPromise; + truncateLog( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + truncateLog( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/truncateLog') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.instances.update + * @desc Updates settings of a Cloud SQL instance. Caution: This is not a + * partial update, so you must include values for all the settings that you + * want to retain. For partial updates, use patch. + * @alias sql.instances.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().DatabaseInstance} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Operations { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.operations.get + * @desc Retrieves an instance operation that has been performed on an + * instance. + * @alias sql.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.operation Instance operation ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/sql/v1beta4/projects/{project}/operations/{operation}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'operation'], + pathParams: ['operation', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.operations.list + * @desc Lists all instance operations that have been performed on the given + * Cloud SQL instance in the reverse chronological order of the start time. + * @alias sql.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {integer=} params.maxResults Maximum number of operations per response. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/projects/{project}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * sql.users.update - * @desc Updates an existing user in a Cloud SQL instance. - * @alias sql.users.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.host Host of the user in the instance. - * @param {string} params.instance Database instance ID. This does not include the project ID. - * @param {string} params.name Name of the user in the instance. - * @param {string} params.project Project ID of the project that contains the instance. - * @param {().User} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Sslcerts { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.sslCerts.createEphemeral + * @desc Generates a short-lived X509 certificate containing the provided + * public key and signed by a private key specific to the target instance. + * Users may use the certificate to authenticate as themselves when + * connecting to the database. + * @alias sql.sslCerts.createEphemeral + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the Cloud SQL project. + * @param {().SslCertsCreateEphemeralRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + createEphemeral(params?: any, options?: MethodOptions): + AxiosPromise; + createEphemeral( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + createEphemeral( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeral') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.delete + * @desc Deletes the SSL certificate. The change will not take effect until + * the instance is restarted. + * @alias sql.sslCerts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance to be deleted. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.get + * @desc Retrieves a particular SSL certificate. Does not include the + * private key (required for usage). The private key must be saved from the + * response to initial creation. + * @alias sql.sslCerts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {string} params.sha1Fingerprint Sha1 FingerPrint. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance', 'sha1Fingerprint'], + pathParams: ['instance', 'project', 'sha1Fingerprint'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.insert + * @desc Creates an SSL certificate and returns it along with the private + * key and server certificate authority. The new certificate will not be + * usable until the instance is restarted. + * @alias sql.sslCerts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project to which the newly created Cloud SQL instances should belong. + * @param {().SslCertsInsertRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.sslCerts.list + * @desc Lists all of the current SSL certificates for the instance. + * @alias sql.sslCerts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Cloud SQL instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project for which to list Cloud SQL instances. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Tiers { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.tiers.list + * @desc Lists all available service tiers for Google Cloud SQL, for example + * D1, D2. For related information, see Pricing. + * @alias sql.tiers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project Project ID of the project for which to list tiers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/sql/v1beta4/projects/{project}/tiers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: ['project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/sql/v1beta4/projects/{project}/instances/{instance}/users') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['project', 'instance', 'host', 'name'], - pathParams: ['instance', 'project'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Users { + root: Sqladmin; + constructor(root: Sqladmin) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * sql.users.delete + * @desc Deletes a user from a Cloud SQL instance. + * @alias sql.users.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.host Host of the user in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.name Name of the user in the instance. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'instance', 'host', 'name'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.users.insert + * @desc Creates a new user in a Cloud SQL instance. + * @alias sql.users.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.users.list + * @desc Lists users in the specified Cloud SQL instance. + * @alias sql.users.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'instance'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * sql.users.update + * @desc Updates an existing user in a Cloud SQL instance. + * @alias sql.users.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.host Host of the user in the instance. + * @param {string} params.instance Database instance ID. This does not include the project ID. + * @param {string} params.name Name of the user in the instance. + * @param {string} params.project Project ID of the project that contains the instance. + * @param {().User} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/sql/v1beta4/projects/{project}/instances/{instance}/users') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['project', 'instance', 'host', 'name'], + pathParams: ['instance', 'project'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/storage/v1.ts b/src/apis/storage/v1.ts index bbe5fb17088..67a6a6f1a66 100644 --- a/src/apis/storage/v1.ts +++ b/src/apis/storage/v1.ts @@ -27,6275 +27,6409 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Storage JSON API - * - * Stores and retrieves potentially large, immutable data objects. - * - * @example - * const google = require('googleapis'); - * const storage = google.storage('v1'); - * - * @namespace storage - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Storage - */ -export class Storage { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - bucketAccessControls: Resource$Bucketaccesscontrols; - buckets: Resource$Buckets; - channels: Resource$Channels; - defaultObjectAccessControls: Resource$Defaultobjectaccesscontrols; - notifications: Resource$Notifications; - objectAccessControls: Resource$Objectaccesscontrols; - objects: Resource$Objects; - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); - this.buckets = new Resource$Buckets(this); - this.channels = new Resource$Channels(this); - this.defaultObjectAccessControls = - new Resource$Defaultobjectaccesscontrols(this); - this.notifications = new Resource$Notifications(this); - this.objectAccessControls = new Resource$Objectaccesscontrols(this); - this.objects = new Resource$Objects(this); - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A bucket. - */ -export interface Schema$Bucket { - /** - * Access controls on the bucket. - */ - acl: Schema$BucketAccessControl[]; - /** - * The bucket's billing configuration. - */ - billing: any; - /** - * The bucket's Cross-Origin Resource Sharing (CORS) configuration. - */ - cors: any[]; - /** - * Defines the default value for Event-Based hold on newly created objects in - * this bucket. Event-Based hold is a way to retain objects indefinitely until - * an event occurs, signified by the hold's release. After being released, - * such objects will be subject to bucket-level retention (if any). One sample - * use case of this flag is for banks to hold loan documents for at least 3 - * years after loan is paid in full. Here bucket-level retention is 3 years - * and the event is loan being paid in full. In this example these objects - * will be held intact for any number of years until the event has occurred - * (hold is released) and then 3 more years after that. Objects under - * Event-Based hold cannot be deleted, overwritten or archived until the hold - * is removed. - */ - defaultEventBasedHold: boolean; - /** - * Default access controls to apply to new objects when no ACL is provided. - */ - defaultObjectAcl: Schema$ObjectAccessControl[]; - /** - * Encryption configuration used by default for newly inserted objects, when - * no encryption config is specified. - */ - encryption: any; - /** - * HTTP 1.1 Entity tag for the bucket. - */ - etag: string; - /** - * The ID of the bucket. For buckets, the id and name properties are the same. - */ - id: string; - /** - * The kind of item this is. For buckets, this is always storage#bucket. - */ - kind: string; - /** - * User-provided labels, in key/value pairs. - */ - labels: any; - /** - * The bucket's lifecycle configuration. See lifecycle management for more - * information. - */ - lifecycle: any; - /** - * The location of the bucket. Object data for objects in the bucket resides - * in physical storage within this region. Defaults to US. See the - * developer's guide for the authoritative list. - */ - location: string; - /** - * The bucket's logging configuration, which defines the destination - * bucket and optional name prefix for the current bucket's logs. - */ - logging: any; - /** - * The metadata generation of this bucket. - */ - metageneration: string; - /** - * The name of the bucket. - */ - name: string; - /** - * The owner of the bucket. This is always the project team's owner group. - */ - owner: any; - /** - * The project number of the project the bucket belongs to. - */ - projectNumber: string; - /** - * Defines the retention policy for a bucket. The Retention policy enforces a - * minimum retention time for all objects contained in the bucket, based on - * their creation time. Any attempt to overwrite or delete objects younger - * than the retention period will result in a PERMISSION_DENIED error. An - * unlocked retention policy can be modified or removed from the bucket via - * the UpdateBucketMetadata RPC. A locked retention policy cannot be removed - * or shortened in duration for the lifetime of the bucket. Attempting to - * remove or decrease period of a locked retention policy will result in a - * PERMISSION_DENIED error. - */ - retentionPolicy: any; - /** - * The URI of this bucket. - */ - selfLink: string; - /** - * The bucket's default storage class, used whenever no storageClass is - * specified for a newly-created object. This defines how objects in the - * bucket are stored and determines the SLA and the cost of storage. Values - * include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and - * DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the - * bucket is created, it will default to STANDARD. For more information, see - * storage classes. - */ - storageClass: string; - /** - * The creation time of the bucket in RFC 3339 format. - */ - timeCreated: string; - /** - * The modification time of the bucket in RFC 3339 format. - */ - updated: string; - /** - * The bucket's versioning configuration. - */ - versioning: any; - /** - * The bucket's website configuration, controlling how the service behaves - * when accessing bucket contents as a web site. See the Static Website - * Examples for more information. - */ - website: any; -} -/** - * An access-control entry. - */ -export interface Schema$BucketAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - project-team-projectId - allUsers - allAuthenticatedUsers Examples: - - * The user liz@example.com would be user-liz@example.com. - The group - * example@googlegroups.com would be group-example@googlegroups.com. - To - * refer to all members of the Google Apps for Business domain example.com, - * the entity would be domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * HTTP 1.1 Entity tag for the access-control entry. - */ - etag: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For bucket access control entries, this is always - * storage#bucketAccessControl. - */ - kind: string; - /** - * The project team associated with the entity, if any. - */ - projectTeam: any; - /** - * The access permission for the entity. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$BucketAccessControls { - /** - * The list of items. - */ - items: Schema$BucketAccessControl[]; - /** - * The kind of item this is. For lists of bucket access control entries, this - * is always storage#bucketAccessControls. - */ - kind: string; -} -/** - * A list of buckets. - */ -export interface Schema$Buckets { - /** - * The list of items. - */ - items: Schema$Bucket[]; - /** - * The kind of item this is. For lists of buckets, this is always - * storage#buckets. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * A Compose request. - */ -export interface Schema$ComposeRequest { - /** - * Properties of the resulting object. - */ - destination: Schema$Object; - /** - * The kind of item this is. - */ - kind: string; - /** - * The list of source objects that will be concatenated into a single object. - */ - sourceObjects: any[]; -} -/** - * A subscription to receive Google PubSub notifications. - */ -export interface Schema$Notification { - /** - * An optional list of additional attributes to attach to each Cloud PubSub - * message published for this notification subscription. - */ - custom_attributes: any; - /** - * HTTP 1.1 Entity tag for this subscription notification. - */ - etag: string; - /** - * If present, only send notifications about listed event types. If empty, - * sent notifications for all event types. - */ - event_types: string[]; - /** - * The ID of the notification. - */ - id: string; - /** - * The kind of item this is. For notifications, this is always - * storage#notification. - */ - kind: string; - /** - * If present, only apply this notification configuration to object names that - * begin with this prefix. - */ - object_name_prefix: string; - /** - * The desired content of the Payload. - */ - payload_format: string; - /** - * The canonical URL of this notification. - */ - selfLink: string; - /** - * The Cloud PubSub topic to which this subscription publishes. Formatted as: - * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' - */ - topic: string; -} -/** - * A list of notification subscriptions. - */ -export interface Schema$Notifications { - /** - * The list of items. - */ - items: Schema$Notification[]; - /** - * The kind of item this is. For lists of notifications, this is always - * storage#notifications. - */ - kind: string; -} -/** - * An object. - */ -export interface Schema$Object { - /** - * Access controls on the object. - */ - acl: Schema$ObjectAccessControl[]; - /** - * The name of the bucket containing this object. - */ - bucket: string; - /** - * Cache-Control directive for the object data. If omitted, and the object is - * accessible to all anonymous users, the default will be public, - * max-age=3600. - */ - cacheControl: string; - /** - * Number of underlying components that make up this object. Components are - * accumulated by compose operations. - */ - componentCount: number; - /** - * Content-Disposition of the object data. - */ - contentDisposition: string; - /** - * Content-Encoding of the object data. - */ - contentEncoding: string; - /** - * Content-Language of the object data. - */ - contentLanguage: string; - /** - * Content-Type of the object data. If an object is stored without a - * Content-Type, it is served as application/octet-stream. - */ - contentType: string; - /** - * CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 - * in big-endian byte order. For more information about using the CRC32c - * checksum, see Hashes and ETags: Best Practices. - */ - crc32c: string; - /** - * Metadata of customer-supplied encryption key, if the object is encrypted by - * such a key. - */ - customerEncryption: any; - /** - * HTTP 1.1 Entity tag for the object. - */ - etag: string; - /** - * Defines the Event-Based hold for an object. Event-Based hold is a way to - * retain objects indefinitely until an event occurs, signified by the - * hold's release. After being released, such objects will be subject to - * bucket-level retention (if any). One sample use case of this flag is for - * banks to hold loan documents for at least 3 years after loan is paid in - * full. Here bucket-level retention is 3 years and the event is loan being - * paid in full. In this example these objects will be held intact for any - * number of years until the event has occurred (hold is released) and then 3 - * more years after that. - */ - eventBasedHold: boolean; - /** - * The content generation of this object. Used for object versioning. - */ - generation: string; - /** - * The ID of the object, including the bucket name, object name, and - * generation number. - */ - id: string; - /** - * The kind of item this is. For objects, this is always storage#object. - */ - kind: string; - /** - * Cloud KMS Key used to encrypt this object, if the object is encrypted by - * such a key. Limited availability; usable only by enabled projects. - */ - kmsKeyName: string; - /** - * MD5 hash of the data; encoded using base64. For more information about - * using the MD5 hash, see Hashes and ETags: Best Practices. - */ - md5Hash: string; - /** - * Media download link. - */ - mediaLink: string; - /** - * User-provided metadata, in key/value pairs. - */ - metadata: any; - /** - * The version of the metadata for this object at this generation. Used for - * preconditions and for detecting changes in metadata. A metageneration - * number is only meaningful in the context of a particular generation of a - * particular object. - */ - metageneration: string; - /** - * The name of the object. Required if not specified by URL parameter. - */ - name: string; - /** - * The owner of the object. This will always be the uploader of the object. - */ - owner: any; - /** - * Specifies the earliest time that the object's retention period expires. - * This value is server-determined and is in RFC 3339 format. Note 1: This - * field is not provided for objects with an active Event-Based hold, since - * retention expiration is unknown until the hold is removed. Note 2: This - * value can be provided even when TemporaryHold is set (so that the user can - * reason about policy without having to first unset the TemporaryHold). - */ - retentionExpirationTime: string; - /** - * The link to this object. - */ - selfLink: string; - /** - * Content-Length of the data in bytes. - */ - size: string; - /** - * Storage class of the object. - */ - storageClass: string; - /** - * Defines the temporary hold for an object. This flag is used to enforce a - * temporary hold on an object. While it is set to true, the object is - * protected against deletion and overwrites. A common use case of this flag - * is regulatory investigations where objects need to be retained while the - * investigation is ongoing. - */ - temporaryHold: boolean; - /** - * The creation time of the object in RFC 3339 format. - */ - timeCreated: string; - /** - * The deletion time of the object in RFC 3339 format. Will be returned if and - * only if this version of the object has been deleted. - */ - timeDeleted: string; - /** - * The time at which the object's storage class was last changed. When the - * object is initially created, it will be set to timeCreated. - */ - timeStorageClassUpdated: string; - /** - * The modification time of the object metadata in RFC 3339 format. - */ - updated: string; -} -/** - * An access-control entry. - */ -export interface Schema$ObjectAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - project-team-projectId - allUsers - allAuthenticatedUsers Examples: - - * The user liz@example.com would be user-liz@example.com. - The group - * example@googlegroups.com would be group-example@googlegroups.com. - To - * refer to all members of the Google Apps for Business domain example.com, - * the entity would be domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * HTTP 1.1 Entity tag for the access-control entry. - */ - etag: string; - /** - * The content generation of the object, if applied to an object. - */ - generation: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For object access control entries, this is always - * storage#objectAccessControl. - */ - kind: string; - /** - * The name of the object, if applied to an object. - */ - object: string; - /** - * The project team associated with the entity, if any. - */ - projectTeam: any; - /** - * The access permission for the entity. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$ObjectAccessControls { - /** - * The list of items. - */ - items: Schema$ObjectAccessControl[]; - /** - * The kind of item this is. For lists of object access control entries, this - * is always storage#objectAccessControls. - */ - kind: string; -} -/** - * A list of objects. - */ -export interface Schema$Objects { - /** - * The list of items. - */ - items: Schema$Object[]; - /** - * The kind of item this is. For lists of objects, this is always - * storage#objects. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; - /** - * The list of prefixes of objects matching-but-not-listed up to and including - * the requested delimiter. - */ - prefixes: string[]; -} -/** - * A bucket/object IAM policy. - */ -export interface Schema$Policy { - /** - * An association between a role, which comes with a set of permissions, and - * members who may assume that role. - */ - bindings: any[]; - /** - * HTTP 1.1 Entity tag for the policy. - */ - etag: string; - /** - * The kind of item this is. For policies, this is always storage#policy. This - * field is ignored on input. - */ - kind: string; - /** - * The ID of the resource to which this policy belongs. Will be of the form - * projects/_/buckets/bucket for buckets, and - * projects/_/buckets/bucket/objects/object for objects. A specific generation - * may be specified by appending #generationNumber to the end of the object - * name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current - * generation can be denoted with #0. This field is ignored on input. - */ - resourceId: string; -} -/** - * A rewrite response. - */ -export interface Schema$RewriteResponse { - /** - * true if the copy is finished; otherwise, false if the copy is in progress. - * This property is always present in the response. - */ - done: boolean; - /** - * The kind of item this is. - */ - kind: string; - /** - * The total size of the object being copied in bytes. This property is always - * present in the response. - */ - objectSize: string; - /** - * A resource containing the metadata for the copied-to object. This property - * is present in the response only when copying completes. - */ - resource: Schema$Object; - /** - * A token to use in subsequent requests to continue copying data. This token - * is present in the response only when there is more data to copy. - */ - rewriteToken: string; - /** - * The total bytes written so far, which can be used to provide a waiting user - * with a progress indicator. This property is always present in the response. - */ - totalBytesRewritten: string; -} -/** - * A subscription to receive Google PubSub notifications. - */ -export interface Schema$ServiceAccount { - /** - * The ID of the notification. - */ - email_address: string; - /** - * The kind of item this is. For notifications, this is always - * storage#notification. - */ - kind: string; -} -/** - * A storage.(buckets|objects).testIamPermissions response. - */ -export interface Schema$TestIamPermissionsResponse { - /** - * The kind of item this is. - */ - kind: string; - /** - * The permissions held by the caller. Permissions are always of the format - * storage.resource.capability, where resource is one of buckets or objects. - * The supported permissions are as follows: - storage.buckets.delete — - * Delete bucket. - storage.buckets.get — Read bucket metadata. - - * storage.buckets.getIamPolicy — Read bucket IAM policy. - - * storage.buckets.create — Create bucket. - storage.buckets.list — List - * buckets. - storage.buckets.setIamPolicy — Update bucket IAM policy. - - * storage.buckets.update — Update bucket metadata. - storage.objects.delete - * — Delete object. - storage.objects.get — Read object data and metadata. - * - storage.objects.getIamPolicy — Read object IAM policy. - - * storage.objects.create — Create object. - storage.objects.list — List - * objects. - storage.objects.setIamPolicy — Update object IAM policy. - - * storage.objects.update — Update object metadata. - */ - permissions: string[]; -} - -export class Resource$Bucketaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.bucketAccessControls.delete - * @desc Permanently deletes the ACL entry for the specified entity on the - * specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.insert - * @desc Creates a new ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.list - * @desc Retrieves ACL entries on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.patch - * @desc Patches an ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.update - * @desc Updates an ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.bucketAccessControls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.bucketAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Buckets { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.buckets.delete - * @desc Permanently deletes an empty bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.buckets.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch If set, only deletes the bucket if its metageneration matches this value. - * @param {string=} params.ifMetagenerationNotMatch If set, only deletes the bucket if its metageneration does not match this value. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.get - * @desc Returns metadata for the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.buckets.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.getIamPolicy - * @desc Returns an IAM policy for the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.buckets.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/iam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.insert - * @desc Creates a new bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // A valid API project identifier. - * project: '', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.buckets.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. - * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. - * @param {string} params.project A valid API project identifier. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. - * @param {string=} params.userProject The project to be billed for this request. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.list - * @desc Retrieves a list of buckets for a given project. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // A valid API project identifier. - * project: '', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storage.buckets.list(request, handlePage); - * } - * }; - * - * storage.buckets.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to buckets whose names begin with this prefix. - * @param {string} params.project A valid API project identifier. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {string=} params.userProject The project to be billed for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.lockRetentionPolicy - * @desc Locks retention policy on a bucket. - * @alias storage.buckets.lockRetentionPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.ifMetagenerationMatch Makes the operation conditional on whether bucket's current metageneration matches the given value. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lockRetentionPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - lockRetentionPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lockRetentionPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/lockRetentionPolicy') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket', 'ifMetagenerationMatch'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.patch - * @desc Updates a bucket. Changes to the bucket will be readable immediately - * after writing, but configuration changes may take time to propagate. This - * method supports patch semantics. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storage.buckets.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. - * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.setIamPolicy - * @desc Updates an IAM policy for the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.buckets.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/iam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace storage_v1 { /** - * storage.buckets.testIamPermissions - * @desc Tests a set of permissions on the given bucket to see which, if any, - * are held by the caller. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); + * Cloud Storage JSON API * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. + * Stores and retrieves potentially large, immutable data objects. * - * // Permissions to test. - * permissions: [], // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.buckets.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.permissions Permissions to test. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/iam/testPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'permissions'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.update - * @desc Updates a bucket. Changes to the bucket will be readable immediately - * after writing, but configuration changes may take time to propagate. * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.buckets.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.buckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. - * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } + * const google = require('googleapis'); + * const storage = google.storage('v1'); + * + * @namespace storage + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Storage + */ + export class Storage { + _options: GlobalOptions; + google: GoogleApis; + root = this; - getRoot() { - return this.root; - } + bucketAccessControls: Resource$Bucketaccesscontrols; + buckets: Resource$Buckets; + channels: Resource$Channels; + defaultObjectAccessControls: Resource$Defaultobjectaccesscontrols; + notifications: Resource$Notifications; + objectAccessControls: Resource$Objectaccesscontrols; + objects: Resource$Objects; + projects: Resource$Projects; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * storage.channels.stop - * @desc Stop watching resources through this channel - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.channels.stop(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); + this.buckets = new Resource$Buckets(this); + this.channels = new Resource$Channels(this); + this.defaultObjectAccessControls = + new Resource$Defaultobjectaccesscontrols(this); + this.notifications = new Resource$Notifications(this); + this.objectAccessControls = new Resource$Objectaccesscontrols(this); + this.objects = new Resource$Objects(this); + this.projects = new Resource$Projects(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Defaultobjectaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); + /** + * A bucket. + */ + export interface Schema$Bucket { + /** + * Access controls on the bucket. + */ + acl: Schema$BucketAccessControl[]; + /** + * The bucket's billing configuration. + */ + billing: any; + /** + * The bucket's Cross-Origin Resource Sharing (CORS) configuration. + */ + cors: any[]; + /** + * Defines the default value for Event-Based hold on newly created objects + * in this bucket. Event-Based hold is a way to retain objects indefinitely + * until an event occurs, signified by the hold's release. After being + * released, such objects will be subject to bucket-level retention (if + * any). One sample use case of this flag is for banks to hold loan + * documents for at least 3 years after loan is paid in full. Here + * bucket-level retention is 3 years and the event is loan being paid in + * full. In this example these objects will be held intact for any number of + * years until the event has occurred (hold is released) and then 3 more + * years after that. Objects under Event-Based hold cannot be deleted, + * overwritten or archived until the hold is removed. + */ + defaultEventBasedHold: boolean; + /** + * Default access controls to apply to new objects when no ACL is provided. + */ + defaultObjectAcl: Schema$ObjectAccessControl[]; + /** + * Encryption configuration used by default for newly inserted objects, when + * no encryption config is specified. + */ + encryption: any; + /** + * HTTP 1.1 Entity tag for the bucket. + */ + etag: string; + /** + * The ID of the bucket. For buckets, the id and name properties are the + * same. + */ + id: string; + /** + * The kind of item this is. For buckets, this is always storage#bucket. + */ + kind: string; + /** + * User-provided labels, in key/value pairs. + */ + labels: any; + /** + * The bucket's lifecycle configuration. See lifecycle management for + * more information. + */ + lifecycle: any; + /** + * The location of the bucket. Object data for objects in the bucket resides + * in physical storage within this region. Defaults to US. See the + * developer's guide for the authoritative list. + */ + location: string; + /** + * The bucket's logging configuration, which defines the destination + * bucket and optional name prefix for the current bucket's logs. + */ + logging: any; + /** + * The metadata generation of this bucket. + */ + metageneration: string; + /** + * The name of the bucket. + */ + name: string; + /** + * The owner of the bucket. This is always the project team's owner + * group. + */ + owner: any; + /** + * The project number of the project the bucket belongs to. + */ + projectNumber: string; + /** + * Defines the retention policy for a bucket. The Retention policy enforces + * a minimum retention time for all objects contained in the bucket, based + * on their creation time. Any attempt to overwrite or delete objects + * younger than the retention period will result in a PERMISSION_DENIED + * error. An unlocked retention policy can be modified or removed from the + * bucket via the UpdateBucketMetadata RPC. A locked retention policy cannot + * be removed or shortened in duration for the lifetime of the bucket. + * Attempting to remove or decrease period of a locked retention policy will + * result in a PERMISSION_DENIED error. + */ + retentionPolicy: any; + /** + * The URI of this bucket. + */ + selfLink: string; + /** + * The bucket's default storage class, used whenever no storageClass is + * specified for a newly-created object. This defines how objects in the + * bucket are stored and determines the SLA and the cost of storage. Values + * include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and + * DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the + * bucket is created, it will default to STANDARD. For more information, see + * storage classes. + */ + storageClass: string; + /** + * The creation time of the bucket in RFC 3339 format. + */ + timeCreated: string; + /** + * The modification time of the bucket in RFC 3339 format. + */ + updated: string; + /** + * The bucket's versioning configuration. + */ + versioning: any; + /** + * The bucket's website configuration, controlling how the service + * behaves when accessing bucket contents as a web site. See the Static + * Website Examples for more information. + */ + website: any; } - - getRoot() { - return this.root; + /** + * An access-control entry. + */ + export interface Schema$BucketAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - project-team-projectId - allUsers - + * allAuthenticatedUsers Examples: - The user liz@example.com would be + * user-liz@example.com. - The group example@googlegroups.com would be + * group-example@googlegroups.com. - To refer to all members of the Google + * Apps for Business domain example.com, the entity would be + * domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * HTTP 1.1 Entity tag for the access-control entry. + */ + etag: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For bucket access control entries, this is + * always storage#bucketAccessControl. + */ + kind: string; + /** + * The project team associated with the entity, if any. + */ + projectTeam: any; + /** + * The access permission for the entity. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.defaultObjectAccessControls.delete - * @desc Permanently deletes the default object ACL entry for the specified - * entity on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$BucketAccessControls { + /** + * The list of items. + */ + items: Schema$BucketAccessControl[]; + /** + * The kind of item this is. For lists of bucket access control entries, + * this is always storage#bucketAccessControls. + */ + kind: string; } - - /** - * storage.defaultObjectAccessControls.get - * @desc Returns the default object ACL entry for the specified entity on the - * specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.get(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of buckets. + */ + export interface Schema$Buckets { + /** + * The list of items. + */ + items: Schema$Bucket[]; + /** + * The kind of item this is. For lists of buckets, this is always + * storage#buckets. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * storage.defaultObjectAccessControls.insert - * @desc Creates a new default object ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.insert(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; } - - /** - * storage.defaultObjectAccessControls.list - * @desc Retrieves default object ACL entries on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.list(request, function(err, response) - * { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch If present, only return default ACL listing if the bucket's current metageneration matches this value. - * @param {string=} params.ifMetagenerationNotMatch If present, only return default ACL listing if the bucket's current metageneration does not match the given value. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Compose request. + */ + export interface Schema$ComposeRequest { + /** + * Properties of the resulting object. + */ + destination: Schema$Object; + /** + * The kind of item this is. + */ + kind: string; + /** + * The list of source objects that will be concatenated into a single + * object. + */ + sourceObjects: any[]; } - - /** - * storage.defaultObjectAccessControls.patch - * @desc Patches a default object ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.patch(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A subscription to receive Google PubSub notifications. + */ + export interface Schema$Notification { + /** + * An optional list of additional attributes to attach to each Cloud PubSub + * message published for this notification subscription. + */ + custom_attributes: any; + /** + * HTTP 1.1 Entity tag for this subscription notification. + */ + etag: string; + /** + * If present, only send notifications about listed event types. If empty, + * sent notifications for all event types. + */ + event_types: string[]; + /** + * The ID of the notification. + */ + id: string; + /** + * The kind of item this is. For notifications, this is always + * storage#notification. + */ + kind: string; + /** + * If present, only apply this notification configuration to object names + * that begin with this prefix. + */ + object_name_prefix: string; + /** + * The desired content of the Payload. + */ + payload_format: string; + /** + * The canonical URL of this notification. + */ + selfLink: string; + /** + * The Cloud PubSub topic to which this subscription publishes. Formatted + * as: + * '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' + */ + topic: string; } - - /** - * storage.defaultObjectAccessControls.update - * @desc Updates a default object ACL entry on the specified bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.defaultObjectAccessControls.update(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.defaultObjectAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of notification subscriptions. + */ + export interface Schema$Notifications { + /** + * The list of items. + */ + items: Schema$Notification[]; + /** + * The kind of item this is. For lists of notifications, this is always + * storage#notifications. + */ + kind: string; } -} - -export class Resource$Notifications { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); + /** + * An object. + */ + export interface Schema$Object { + /** + * Access controls on the object. + */ + acl: Schema$ObjectAccessControl[]; + /** + * The name of the bucket containing this object. + */ + bucket: string; + /** + * Cache-Control directive for the object data. If omitted, and the object + * is accessible to all anonymous users, the default will be public, + * max-age=3600. + */ + cacheControl: string; + /** + * Number of underlying components that make up this object. Components are + * accumulated by compose operations. + */ + componentCount: number; + /** + * Content-Disposition of the object data. + */ + contentDisposition: string; + /** + * Content-Encoding of the object data. + */ + contentEncoding: string; + /** + * Content-Language of the object data. + */ + contentLanguage: string; + /** + * Content-Type of the object data. If an object is stored without a + * Content-Type, it is served as application/octet-stream. + */ + contentType: string; + /** + * CRC32c checksum, as described in RFC 4960, Appendix B; encoded using + * base64 in big-endian byte order. For more information about using the + * CRC32c checksum, see Hashes and ETags: Best Practices. + */ + crc32c: string; + /** + * Metadata of customer-supplied encryption key, if the object is encrypted + * by such a key. + */ + customerEncryption: any; + /** + * HTTP 1.1 Entity tag for the object. + */ + etag: string; + /** + * Defines the Event-Based hold for an object. Event-Based hold is a way to + * retain objects indefinitely until an event occurs, signified by the + * hold's release. After being released, such objects will be subject to + * bucket-level retention (if any). One sample use case of this flag is for + * banks to hold loan documents for at least 3 years after loan is paid in + * full. Here bucket-level retention is 3 years and the event is loan being + * paid in full. In this example these objects will be held intact for any + * number of years until the event has occurred (hold is released) and then + * 3 more years after that. + */ + eventBasedHold: boolean; + /** + * The content generation of this object. Used for object versioning. + */ + generation: string; + /** + * The ID of the object, including the bucket name, object name, and + * generation number. + */ + id: string; + /** + * The kind of item this is. For objects, this is always storage#object. + */ + kind: string; + /** + * Cloud KMS Key used to encrypt this object, if the object is encrypted by + * such a key. Limited availability; usable only by enabled projects. + */ + kmsKeyName: string; + /** + * MD5 hash of the data; encoded using base64. For more information about + * using the MD5 hash, see Hashes and ETags: Best Practices. + */ + md5Hash: string; + /** + * Media download link. + */ + mediaLink: string; + /** + * User-provided metadata, in key/value pairs. + */ + metadata: any; + /** + * The version of the metadata for this object at this generation. Used for + * preconditions and for detecting changes in metadata. A metageneration + * number is only meaningful in the context of a particular generation of a + * particular object. + */ + metageneration: string; + /** + * The name of the object. Required if not specified by URL parameter. + */ + name: string; + /** + * The owner of the object. This will always be the uploader of the object. + */ + owner: any; + /** + * Specifies the earliest time that the object's retention period + * expires. This value is server-determined and is in RFC 3339 format. Note + * 1: This field is not provided for objects with an active Event-Based + * hold, since retention expiration is unknown until the hold is removed. + * Note 2: This value can be provided even when TemporaryHold is set (so + * that the user can reason about policy without having to first unset the + * TemporaryHold). + */ + retentionExpirationTime: string; + /** + * The link to this object. + */ + selfLink: string; + /** + * Content-Length of the data in bytes. + */ + size: string; + /** + * Storage class of the object. + */ + storageClass: string; + /** + * Defines the temporary hold for an object. This flag is used to enforce a + * temporary hold on an object. While it is set to true, the object is + * protected against deletion and overwrites. A common use case of this flag + * is regulatory investigations where objects need to be retained while the + * investigation is ongoing. + */ + temporaryHold: boolean; + /** + * The creation time of the object in RFC 3339 format. + */ + timeCreated: string; + /** + * The deletion time of the object in RFC 3339 format. Will be returned if + * and only if this version of the object has been deleted. + */ + timeDeleted: string; + /** + * The time at which the object's storage class was last changed. When + * the object is initially created, it will be set to timeCreated. + */ + timeStorageClassUpdated: string; + /** + * The modification time of the object metadata in RFC 3339 format. + */ + updated: string; } - - getRoot() { - return this.root; + /** + * An access-control entry. + */ + export interface Schema$ObjectAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - project-team-projectId - allUsers - + * allAuthenticatedUsers Examples: - The user liz@example.com would be + * user-liz@example.com. - The group example@googlegroups.com would be + * group-example@googlegroups.com. - To refer to all members of the Google + * Apps for Business domain example.com, the entity would be + * domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * HTTP 1.1 Entity tag for the access-control entry. + */ + etag: string; + /** + * The content generation of the object, if applied to an object. + */ + generation: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For object access control entries, this is + * always storage#objectAccessControl. + */ + kind: string; + /** + * The name of the object, if applied to an object. + */ + object: string; + /** + * The project team associated with the entity, if any. + */ + projectTeam: any; + /** + * The access permission for the entity. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.notifications.delete - * @desc Permanently deletes a notification subscription. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // ID of the notification to delete. - * notification: 'my-notification', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.notifications.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.notifications.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket The parent bucket of the notification. - * @param {string} params.notification ID of the notification to delete. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1/b/{bucket}/notificationConfigs/{notification}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'notification'], - pathParams: ['bucket', 'notification'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$ObjectAccessControls { + /** + * The list of items. + */ + items: Schema$ObjectAccessControl[]; + /** + * The kind of item this is. For lists of object access control entries, + * this is always storage#objectAccessControls. + */ + kind: string; } - - /** - * storage.notifications.get - * @desc View a notification configuration. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Notification ID - * notification: 'my-notification', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.notifications.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.notifications.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket The parent bucket of the notification. - * @param {string} params.notification Notification ID - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1/b/{bucket}/notificationConfigs/{notification}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'notification'], - pathParams: ['bucket', 'notification'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of objects. + */ + export interface Schema$Objects { + /** + * The list of items. + */ + items: Schema$Object[]; + /** + * The kind of item this is. For lists of objects, this is always + * storage#objects. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + /** + * The list of prefixes of objects matching-but-not-listed up to and + * including the requested delimiter. + */ + prefixes: string[]; } - - /** - * storage.notifications.insert - * @desc Creates a notification subscription for a given bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The parent bucket of the notification. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.notifications.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.notifications.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket The parent bucket of the notification. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Notification} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/notificationConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A bucket/object IAM policy. + */ + export interface Schema$Policy { + /** + * An association between a role, which comes with a set of permissions, and + * members who may assume that role. + */ + bindings: any[]; + /** + * HTTP 1.1 Entity tag for the policy. + */ + etag: string; + /** + * The kind of item this is. For policies, this is always storage#policy. + * This field is ignored on input. + */ + kind: string; + /** + * The ID of the resource to which this policy belongs. Will be of the form + * projects/_/buckets/bucket for buckets, and + * projects/_/buckets/bucket/objects/object for objects. A specific + * generation may be specified by appending #generationNumber to the end of + * the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. + * The current generation can be denoted with #0. This field is ignored on + * input. + */ + resourceId: string; } - - /** - * storage.notifications.list - * @desc Retrieves a list of notification subscriptions for a given bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a Google Cloud Storage bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.notifications.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.notifications.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a Google Cloud Storage bucket. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/notificationConfigs') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A rewrite response. + */ + export interface Schema$RewriteResponse { + /** + * true if the copy is finished; otherwise, false if the copy is in + * progress. This property is always present in the response. + */ + done: boolean; + /** + * The kind of item this is. + */ + kind: string; + /** + * The total size of the object being copied in bytes. This property is + * always present in the response. + */ + objectSize: string; + /** + * A resource containing the metadata for the copied-to object. This + * property is present in the response only when copying completes. + */ + resource: Schema$Object; + /** + * A token to use in subsequent requests to continue copying data. This + * token is present in the response only when there is more data to copy. + */ + rewriteToken: string; + /** + * The total bytes written so far, which can be used to provide a waiting + * user with a progress indicator. This property is always present in the + * response. + */ + totalBytesRewritten: string; } -} - -export class Resource$Objectaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); + /** + * A subscription to receive Google PubSub notifications. + */ + export interface Schema$ServiceAccount { + /** + * The ID of the notification. + */ + email_address: string; + /** + * The kind of item this is. For notifications, this is always + * storage#notification. + */ + kind: string; } - - getRoot() { - return this.root; + /** + * A storage.(buckets|objects).testIamPermissions response. + */ + export interface Schema$TestIamPermissionsResponse { + /** + * The kind of item this is. + */ + kind: string; + /** + * The permissions held by the caller. Permissions are always of the format + * storage.resource.capability, where resource is one of buckets or objects. + * The supported permissions are as follows: - storage.buckets.delete — + * Delete bucket. - storage.buckets.get — Read bucket metadata. - + * storage.buckets.getIamPolicy — Read bucket IAM policy. - + * storage.buckets.create — Create bucket. - storage.buckets.list — List + * buckets. - storage.buckets.setIamPolicy — Update bucket IAM policy. - + * storage.buckets.update — Update bucket metadata. - + * storage.objects.delete — Delete object. - storage.objects.get — Read + * object data and metadata. - storage.objects.getIamPolicy — Read object + * IAM policy. - storage.objects.create — Create object. - + * storage.objects.list — List objects. - storage.objects.setIamPolicy — + * Update object IAM policy. - storage.objects.update — Update object + * metadata. + */ + permissions: string[]; } - - /** - * storage.objectAccessControls.delete - * @desc Permanently deletes the ACL entry for the specified entity on the - * specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Bucketaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * storage.objectAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * storage.bucketAccessControls.delete + * @desc Permanently deletes the ACL entry for the specified entity on the + * specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objectAccessControls.insert - * @desc Creates a new ACL entry on the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storage.bucketAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storage.objectAccessControls.list - * @desc Retrieves ACL entries on the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.list(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.bucketAccessControls.insert + * @desc Creates a new ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.bucketAccessControls.list + * @desc Retrieves ACL entries on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.bucketAccessControls.patch + * @desc Patches an ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objectAccessControls.patch - * @desc Patches an ACL entry on the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.bucketAccessControls.update + * @desc Updates an ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.bucketAccessControls.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.bucketAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Buckets { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * storage.objectAccessControls.update - * @desc Updates an ACL entry on the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of a bucket. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // The entity holding the permission. Can be user-userId, - * user-emailAddress, group-groupId, - * // group-emailAddress, allUsers, or allAuthenticatedUsers. - * entity: 'my-entity', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.objectAccessControls.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objectAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.buckets.delete + * @desc Permanently deletes an empty bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.buckets.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch If set, only deletes the bucket if its metageneration matches this value. + * @param {string=} params.ifMetagenerationNotMatch If set, only deletes the bucket if its metageneration does not match this value. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.buckets.get + * @desc Returns metadata for the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.buckets.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.buckets.getIamPolicy + * @desc Returns an IAM policy for the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.buckets.getIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/iam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Objects { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } + /** + * storage.buckets.insert + * @desc Creates a new bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // A valid API project identifier. + * project: '', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.buckets.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. + * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. + * @param {string} params.project A valid API project identifier. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. + * @param {string=} params.userProject The project to be billed for this request. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - /** - * storage.objects.compose - * @desc Concatenates a list of existing objects into a new object in the same - * bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to store the new object. - * destinationBucket: 'my-destination-bucket', // TODO: Update - * placeholder value. - * - * // Name of the new object. For information about how to URL encode - * object names to be path safe, see - * // Encoding URI Path Parts. - * destinationObject: 'my-destination-object', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.compose(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.compose - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.destinationBucket Name of the bucket in which to store the new object. - * @param {string} params.destinationObject Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.kmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().ComposeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - compose(params?: any, options?: MethodOptions): AxiosPromise; - compose( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - compose( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.buckets.list + * @desc Retrieves a list of buckets for a given project. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // A valid API project identifier. + * project: '', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * storage.buckets.list(request, handlePage); + * } + * }; + * + * storage.buckets.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to buckets whose names begin with this prefix. + * @param {string} params.project A valid API project identifier. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {string=} params.userProject The project to be billed for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.buckets.lockRetentionPolicy + * @desc Locks retention policy on a bucket. + * @alias storage.buckets.lockRetentionPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.ifMetagenerationMatch Makes the operation conditional on whether bucket's current metageneration matches the given value. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lockRetentionPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + lockRetentionPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lockRetentionPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/lockRetentionPolicy') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket', 'ifMetagenerationMatch'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/storage/v1/b/{destinationBucket}/o/{destinationObject}/compose') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['destinationBucket', 'destinationObject'], - pathParams: ['destinationBucket', 'destinationObject'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.buckets.patch + * @desc Updates a bucket. Changes to the bucket will be readable + * immediately after writing, but configuration changes may take time to + * propagate. This method supports patch semantics. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storage.buckets.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. + * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.copy - * @desc Copies a source object to a destination object. Optionally overrides - * metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to find the source object. - * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. - * - * // Name of the source object. For information about how to URL encode - * object names to be path safe, - * // see Encoding URI Path Parts. - * sourceObject: 'my-source-object', // TODO: Update placeholder value. - * - * // Name of the bucket in which to store the new object. Overrides the - * provided object metadata's - * // bucket value, if any.For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * destinationBucket: 'my-destination-bucket', // TODO: Update - * placeholder value. - * - * // Name of the new object. Required when the object metadata is not - * otherwise provided. Overrides the - * // object metadata's name value, if any. - * destinationObject: 'my-destination-object', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.copy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.copy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. - * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. - * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. - * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. - * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. - * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. - * @param {string} params.sourceBucket Name of the bucket in which to find the source object. - * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). - * @param {string} params.sourceObject Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.buckets.setIamPolicy + * @desc Updates an IAM policy for the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.buckets.setIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/iam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.buckets.testIamPermissions + * @desc Tests a set of permissions on the given bucket to see which, if + * any, are held by the caller. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Permissions to test. + * permissions: [], // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.buckets.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.permissions Permissions to test. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/iam/testPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'permissions'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [ - 'sourceBucket', 'sourceObject', 'destinationBucket', 'destinationObject' - ], - pathParams: [ - 'destinationBucket', 'destinationObject', 'sourceBucket', 'sourceObject' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.buckets.update + * @desc Updates a bucket. Changes to the bucket will be readable + * immediately after writing, but configuration changes may take time to + * propagate. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.buckets.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.buckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this bucket. + * @param {string=} params.predefinedDefaultObjectAcl Apply a predefined set of default object access controls to this bucket. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.delete - * @desc Deletes an object and its metadata. Deletions are permanent if - * versioning is not enabled for the bucket, or if the generation parameter is - * used. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objects.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Channels { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.channels.stop + * @desc Stop watching resources through this channel + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.channels.stop(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Defaultobjectaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } - /** - * storage.objects.get - * @desc Retrieves an object or its metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // TODO: To download media content, use: - * // - * // alt: 'media', - * - * auth: authClient, - * }; - * - * storage.objects.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.defaultObjectAccessControls.delete + * @desc Permanently deletes the default object ACL entry for the specified + * entity on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.defaultObjectAccessControls.get + * @desc Returns the default object ACL entry for the specified entity on + * the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.getIamPolicy - * @desc Returns an IAM policy for the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objects.getIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.getIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.defaultObjectAccessControls.insert + * @desc Creates a new default object ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.insert(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.defaultObjectAccessControls.list + * @desc Retrieves default object ACL entries on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.list(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch If present, only return default ACL listing if the bucket's current metageneration matches this value. + * @param {string=} params.ifMetagenerationNotMatch If present, only return default ACL listing if the bucket's current metageneration does not match the given value. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/iam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.defaultObjectAccessControls.patch + * @desc Patches a default object ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.patch(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.insert - * @desc Stores a new object and metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to store the new object. Overrides the - * provided object metadata's - * // bucket value, if any. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * media: { - * // TODO: Add desired media content for upload. See - * // https://github.com/google/google-api-nodejs-client#media-uploads - * mimeType: '', // See - * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', - * }, - * - * auth: authClient, - * }; - * - * storage.objects.insert(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * @param {string=} params.contentEncoding If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string=} params.kmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. Limited availability; usable only by enabled projects. - * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.defaultObjectAccessControls.update + * @desc Updates a default object ACL entry on the specified bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.defaultObjectAccessControls.update(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.defaultObjectAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/storage/v1/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Notifications { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/storage/v1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * storage.objects.list - * @desc Retrieves a list of objects matching the criteria. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to look for objects. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var itemsPage = response['items']; - * if (!itemsPage) { - * return; - * } - * for (var i = 0; i < itemsPage.length; i++) { - * // TODO: Change code below to process each resource in `itemsPage`: - * console.log(JSON.stringify(itemsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storage.objects.list(request, handlePage); - * } - * }; - * - * storage.objects.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to look for objects. - * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - * @param {integer=} params.maxResults Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {boolean=} params.versions If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.notifications.delete + * @desc Permanently deletes a notification subscription. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The parent bucket of the notification. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // ID of the notification to delete. + * notification: 'my-notification', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.notifications.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.notifications.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket The parent bucket of the notification. + * @param {string} params.notification ID of the notification to delete. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1/b/{bucket}/notificationConfigs/{notification}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'notification'], + pathParams: ['bucket', 'notification'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.notifications.get + * @desc View a notification configuration. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The parent bucket of the notification. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Notification ID + * notification: 'my-notification', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.notifications.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.notifications.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket The parent bucket of the notification. + * @param {string} params.notification Notification ID + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1/b/{bucket}/notificationConfigs/{notification}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'notification'], + pathParams: ['bucket', 'notification'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.notifications.insert + * @desc Creates a notification subscription for a given bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The parent bucket of the notification. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.notifications.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.notifications.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket The parent bucket of the notification. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Notification} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/notificationConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.notifications.list + * @desc Retrieves a list of notification subscriptions for a given bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a Google Cloud Storage bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.notifications.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.notifications.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a Google Cloud Storage bucket. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/notificationConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Objectaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } - /** - * storage.objects.patch - * @desc Patches an object's metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {string=} params.userProject The project to be billed for this request, for Requester Pays buckets. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objectAccessControls.delete + * @desc Permanently deletes the ACL entry for the specified entity on the + * specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objectAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.rewrite - * @desc Rewrites a source object to a destination object. Optionally - * overrides metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to find the source object. - * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. - * - * // Name of the source object. For information about how to URL encode - * object names to be path safe, - * // see Encoding URI Path Parts. - * sourceObject: 'my-source-object', // TODO: Update placeholder value. - * - * // Name of the bucket in which to store the new object. Overrides the - * provided object metadata's - * // bucket value, if any. - * destinationBucket: 'my-destination-bucket', // TODO: Update - * placeholder value. - * - * // Name of the new object. Required when the object metadata is not - * otherwise provided. Overrides the - * // object metadata's name value, if any. For information about how to - * URL encode object names to be - * // path safe, see Encoding URI Path Parts. - * destinationObject: 'my-destination-object', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.rewrite(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.rewrite - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * @param {string=} params.destinationKmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. - * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. - * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. - * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. - * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. - * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. - * @param {string=} params.maxBytesRewrittenPerCall The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. - * @param {string=} params.rewriteToken Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request. - * @param {string} params.sourceBucket Name of the bucket in which to find the source object. - * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). - * @param {string} params.sourceObject Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - rewrite(params?: any, options?: MethodOptions): - AxiosPromise; - rewrite( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rewrite( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.objectAccessControls.insert + * @desc Creates a new ACL entry on the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.list + * @desc Retrieves ACL entries on the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.list(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objectAccessControls.patch + * @desc Patches an ACL entry on the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [ - 'sourceBucket', 'sourceObject', 'destinationBucket', 'destinationObject' - ], - pathParams: [ - 'destinationBucket', 'destinationObject', 'sourceBucket', 'sourceObject' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objectAccessControls.update + * @desc Updates an ACL entry on the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of a bucket. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // The entity holding the permission. Can be user-userId, + * user-emailAddress, group-groupId, + * // group-emailAddress, allUsers, or allAuthenticatedUsers. + * entity: 'my-entity', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.objectAccessControls.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objectAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Objects { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } - /** - * storage.objects.setIamPolicy - * @desc Updates an IAM policy for the specified object. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.setIamPolicy(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.setIamPolicy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Policy} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setIamPolicy(params?: any, options?: MethodOptions): - AxiosPromise; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setIamPolicy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objects.compose + * @desc Concatenates a list of existing objects into a new object in the + * same bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to store the new object. + * destinationBucket: 'my-destination-bucket', // TODO: Update + * placeholder value. + * + * // Name of the new object. For information about how to URL encode + * object names to be path safe, see + * // Encoding URI Path Parts. + * destinationObject: 'my-destination-object', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.compose(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.compose + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.destinationBucket Name of the bucket in which to store the new object. + * @param {string} params.destinationObject Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.kmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().ComposeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + compose(params?: any, options?: MethodOptions): AxiosPromise; + compose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + compose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/storage/v1/b/{destinationBucket}/o/{destinationObject}/compose') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['destinationBucket', 'destinationObject'], + pathParams: ['destinationBucket', 'destinationObject'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/iam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objects.copy + * @desc Copies a source object to a destination object. Optionally + * overrides metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to find the source object. + * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. + * + * // Name of the source object. For information about how to URL encode + * object names to be path safe, + * // see Encoding URI Path Parts. + * sourceObject: 'my-source-object', // TODO: Update placeholder value. + * + * // Name of the bucket in which to store the new object. Overrides the + * provided object metadata's + * // bucket value, if any.For information about how to URL encode + * object names to be path safe, see + * // Encoding URI Path Parts. + * destinationBucket: 'my-destination-bucket', // TODO: Update + * placeholder value. + * + * // Name of the new object. Required when the object metadata is not + * otherwise provided. Overrides the + * // object metadata's name value, if any. + * destinationObject: 'my-destination-object', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.copy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. + * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. + * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. + * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * @param {string} params.sourceBucket Name of the bucket in which to find the source object. + * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * @param {string} params.sourceObject Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [ + 'sourceBucket', 'sourceObject', 'destinationBucket', + 'destinationObject' + ], + pathParams: [ + 'destinationBucket', 'destinationObject', 'sourceBucket', + 'sourceObject' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.testIamPermissions - * @desc Tests a set of permissions on the given object to see which, if any, - * are held by the caller. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * // Permissions to test. - * permissions: [], // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.objects.testIamPermissions(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.testIamPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string} params.permissions Permissions to test. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - testIamPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - testIamPermissions( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.objects.delete + * @desc Deletes an object and its metadata. Deletions are permanent if + * versioning is not enabled for the bucket, or if the generation parameter + * is used. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objects.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objects.get + * @desc Retrieves an object or its metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // TODO: To download media content, use: + * // + * // alt: 'media', + * + * auth: authClient, + * }; + * + * storage.objects.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1/b/{bucket}/o/{object}/iam/testPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object', 'permissions'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objects.getIamPolicy + * @desc Returns an IAM policy for the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objects.getIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.getIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/iam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.update - * @desc Updates an object's metadata. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which the object resides. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * // Name of the object. For information about how to URL encode object - * names to be path safe, see - * // Encoding URI Path Parts. - * object: 'my-object', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. All existing - * properties - * // will be replaced. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.update(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.objects.insert + * @desc Stores a new object and metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to store the new object. Overrides the + * provided object metadata's + * // bucket value, if any. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * media: { + * // TODO: Add desired media content for upload. See + * // https://github.com/google/google-api-nodejs-client#media-uploads + * mimeType: '', // See + * https://www.w3.org/Protocols/rfc1341/4_Content-Type.html body: '', + * }, + * + * auth: authClient, + * }; + * + * storage.objects.insert(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * @param {string=} params.contentEncoding If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string=} params.kmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. Limited availability; usable only by enabled projects. + * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/storage/v1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objects.list + * @desc Retrieves a list of objects matching the criteria. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to look for objects. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var itemsPage = response['items']; + * if (!itemsPage) { + * return; + * } + * for (var i = 0; i < itemsPage.length; i++) { + * // TODO: Change code below to process each resource in `itemsPage`: + * console.log(JSON.stringify(itemsPage[i], null, 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * storage.objects.list(request, handlePage); + * } + * }; + * + * storage.objects.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to look for objects. + * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * @param {integer=} params.maxResults Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {boolean=} params.versions If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objects.patch + * @desc Patches an object's metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {string=} params.userProject The project to be billed for this request, for Requester Pays buckets. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storage.objects.watchAll - * @desc Watch for changes on all objects in a bucket. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Name of the bucket in which to look for objects. - * bucket: 'my-bucket', // TODO: Update placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storage.objects.watchAll(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.objects.watchAll - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to look for objects. - * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - * @param {integer=} params.maxResults Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. - * @param {boolean=} params.versions If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watchAll(params?: any, options?: MethodOptions): AxiosPromise; - watchAll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watchAll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storage.objects.rewrite + * @desc Rewrites a source object to a destination object. Optionally + * overrides metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to find the source object. + * sourceBucket: 'my-source-bucket', // TODO: Update placeholder value. + * + * // Name of the source object. For information about how to URL encode + * object names to be path safe, + * // see Encoding URI Path Parts. + * sourceObject: 'my-source-object', // TODO: Update placeholder value. + * + * // Name of the bucket in which to store the new object. Overrides the + * provided object metadata's + * // bucket value, if any. + * destinationBucket: 'my-destination-bucket', // TODO: Update + * placeholder value. + * + * // Name of the new object. Required when the object metadata is not + * otherwise provided. Overrides the + * // object metadata's name value, if any. For information about how to + * URL encode object names to be + * // path safe, see Encoding URI Path Parts. + * destinationObject: 'my-destination-object', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.rewrite(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.rewrite + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * @param {string=} params.destinationKmsKeyName Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any. + * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.destinationPredefinedAcl Apply a predefined set of access controls to the destination object. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's current generation matches the given value. + * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's current generation does not match the given value. + * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. + * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * @param {string=} params.maxBytesRewrittenPerCall The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * @param {string=} params.rewriteToken Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request. + * @param {string} params.sourceBucket Name of the bucket in which to find the source object. + * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * @param {string} params.sourceObject Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rewrite(params?: any, options?: MethodOptions): + AxiosPromise; + rewrite( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rewrite( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [ + 'sourceBucket', 'sourceObject', 'destinationBucket', + 'destinationObject' + ], + pathParams: [ + 'destinationBucket', 'destinationObject', 'sourceBucket', + 'sourceObject' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * storage.objects.setIamPolicy + * @desc Updates an IAM policy for the specified object. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.setIamPolicy(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.setIamPolicy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Policy} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setIamPolicy(params?: any, options?: MethodOptions): + AxiosPromise; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setIamPolicy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}/iam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/b/{bucket}/o/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.objects.testIamPermissions + * @desc Tests a set of permissions on the given object to see which, if + * any, are held by the caller. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * // Permissions to test. + * permissions: [], // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.objects.testIamPermissions(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.testIamPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string} params.permissions Permissions to test. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + testIamPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + testIamPermissions( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1/b/{bucket}/o/{object}/iam/testPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object', 'permissions'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects { - root: Storage; - serviceAccount: Resource$Projects$Serviceaccount; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - this.serviceAccount = new Resource$Projects$Serviceaccount(root); - } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Serviceaccount { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } + /** + * storage.objects.update + * @desc Updates an object's metadata. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which the object resides. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * // Name of the object. For information about how to URL encode object + * names to be path safe, see + * // Encoding URI Path Parts. + * object: 'my-object', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. All existing + * properties + * // will be replaced. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.update(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + * @param {string=} params.predefinedAcl Apply a predefined set of access controls to this object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } - getRoot() { - return this.root; + + /** + * storage.objects.watchAll + * @desc Watch for changes on all objects in a bucket. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Name of the bucket in which to look for objects. + * bucket: 'my-bucket', // TODO: Update placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storage.objects.watchAll(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.objects.watchAll + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to look for objects. + * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * @param {integer=} params.maxResults Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {string=} params.userProject The project to be billed for this request. Required for Requester Pays buckets. + * @param {boolean=} params.versions If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watchAll(params?: any, options?: MethodOptions): + AxiosPromise; + watchAll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watchAll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/b/{bucket}/o/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Projects { + root: Storage; + serviceAccount: Resource$Projects$Serviceaccount; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + this.serviceAccount = new Resource$Projects$Serviceaccount(root); + } - /** - * storage.projects.serviceAccount.get - * @desc Get the email address of this project's Google Cloud Storage service - * account. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Cloud Storage JSON API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storage - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storage = google.storage('v1'); - * - * authorize(function(authClient) { - * var request = { - * // Project ID - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storage.projects.serviceAccount.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storage.projects.serviceAccount.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Project ID - * @param {string=} params.userProject The project to be billed for this request. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; + } + } + export class Resource$Projects$Serviceaccount { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1/projects/{projectId}/serviceAccount') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storage.projects.serviceAccount.get + * @desc Get the email address of this project's Google Cloud Storage + * service account. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Cloud Storage JSON API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storage + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storage = google.storage('v1'); + * + * authorize(function(authClient) { + * var request = { + * // Project ID + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storage.projects.serviceAccount.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storage.projects.serviceAccount.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Project ID + * @param {string=} params.userProject The project to be billed for this request. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1/projects/{projectId}/serviceAccount') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/storage/v1beta1.ts b/src/apis/storage/v1beta1.ts index ca770260316..12cf4f29b42 100644 --- a/src/apis/storage/v1beta1.ts +++ b/src/apis/storage/v1beta1.ts @@ -27,1675 +27,1716 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Storage JSON API - * - * Lets you store and retrieve potentially-large, immutable data objects. - * - * @example - * const google = require('googleapis'); - * const storage = google.storage('v1beta1'); - * - * @namespace storage - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Storage - */ -export class Storage { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - bucketAccessControls: Resource$Bucketaccesscontrols; - buckets: Resource$Buckets; - objectAccessControls: Resource$Objectaccesscontrols; - objects: Resource$Objects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); - this.buckets = new Resource$Buckets(this); - this.objectAccessControls = new Resource$Objectaccesscontrols(this); - this.objects = new Resource$Objects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A bucket. - */ -export interface Schema$Bucket { - /** - * Access controls on the bucket. - */ - acl: Schema$BucketAccessControl[]; - /** - * Default access controls to apply to new objects when no ACL is provided. - */ - defaultObjectAcl: Schema$ObjectAccessControl[]; - /** - * The name of the bucket. - */ - id: string; - /** - * The kind of item this is. For buckets, this is always storage#bucket. - */ - kind: string; - /** - * The location of the bucket. Object data for objects in the bucket resides - * in physical storage in this location. Can be US or EU. Defaults to US. - */ - location: string; - /** - * The owner of the bucket. This will always be the project team's owner - * group. - */ - owner: any; - /** - * The project the bucket belongs to. - */ - projectId: string; - /** - * The URI of this bucket. - */ - selfLink: string; - /** - * Creation time of the bucket in RFC 3339 format. - */ - timeCreated: string; - /** - * The bucket's website configuration. - */ - website: any; -} -/** - * An access-control entry. - */ -export interface Schema$BucketAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - allUsers - allAuthenticatedUsers Examples: - The user liz@example.com - * would be user-liz@example.com. - The group example@googlegroups.com would - * be group-example@googlegroups.com. - To refer to all members of the Google - * Apps for Business domain example.com, the entity would be - * domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For bucket access control entries, this is always - * storage#bucketAccessControl. - */ - kind: string; - /** - * The access permission for the entity. Can be READER, WRITER, or OWNER. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$BucketAccessControls { - /** - * The list of items. - */ - items: Schema$BucketAccessControl[]; - /** - * The kind of item this is. For lists of bucket access control entries, this - * is always storage#bucketAccessControls. - */ - kind: string; -} -/** - * A list of buckets. - */ -export interface Schema$Buckets { - /** - * The list of items. - */ - items: Schema$Bucket[]; - /** - * The kind of item this is. For lists of buckets, this is always - * storage#buckets. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * An object. - */ -export interface Schema$Object { - /** - * Access controls on the object. - */ - acl: Schema$ObjectAccessControl[]; - /** - * The bucket containing this object. - */ - bucket: string; - /** - * Cache-Control directive for the object data. - */ - cacheControl: string; - /** - * Content-Disposition of the object data. - */ - contentDisposition: string; - /** - * Content-Encoding of the object data. - */ - contentEncoding: string; - /** - * Content-Language of the object data. - */ - contentLanguage: string; - /** - * The ID of the object. - */ - id: string; - /** - * The kind of item this is. For objects, this is always storage#object. - */ - kind: string; - /** - * Object media data. Provided on your behalf when uploading raw media or - * multipart/related with an auxiliary media part. - */ - media: any; - /** - * User-provided metadata, in key/value pairs. - */ - metadata: any; - /** - * The name of this object. Required if not specified by URL parameter. - */ - name: string; - /** - * The owner of the object. This will always be the uploader of the object. - */ - owner: any; - /** - * The link to this object. - */ - selfLink: string; -} -/** - * An access-control entry. - */ -export interface Schema$ObjectAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - allUsers - allAuthenticatedUsers Examples: - The user liz@example.com - * would be user-liz@example.com. - The group example@googlegroups.com would - * be group-example@googlegroups.com. - To refer to all members of the Google - * Apps for Business domain example.com, the entity would be - * domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For object access control entries, this is always - * storage#objectAccessControl. - */ - kind: string; - /** - * The name of the object. - */ - object: string; - /** - * The access permission for the entity. Can be READER or OWNER. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$ObjectAccessControls { - /** - * The list of items. - */ - items: Schema$ObjectAccessControl[]; - /** - * The kind of item this is. For lists of object access control entries, this - * is always storage#objectAccessControls. - */ - kind: string; -} -/** - * A list of objects. - */ -export interface Schema$Objects { - /** - * The list of items. - */ - items: Schema$Object[]; - /** - * The kind of item this is. For lists of objects, this is always - * storage#objects. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; - /** - * The list of prefixes of objects matching-but-not-listed up to and including - * the requested delimiter. - */ - prefixes: string[]; -} - -export class Resource$Bucketaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.bucketAccessControls.delete - * @desc Deletes the ACL entry for the specified entity on the specified - * bucket. - * @alias storage.bucketAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * bucket. - * @alias storage.bucketAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.insert - * @desc Creates a new ACL entry on the specified bucket. - * @alias storage.bucketAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace storage_v1beta1 { /** - * storage.bucketAccessControls.list - * @desc Retrieves ACL entries on the specified bucket. - * @alias storage.bucketAccessControls.list - * @memberOf! () + * Cloud Storage JSON API * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.patch - * @desc Updates an ACL entry on the specified bucket. This method supports - * patch semantics. - * @alias storage.bucketAccessControls.patch - * @memberOf! () + * Lets you store and retrieve potentially-large, immutable data objects. * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.update - * @desc Updates an ACL entry on the specified bucket. - * @alias storage.bucketAccessControls.update - * @memberOf! () + * @example + * const google = require('googleapis'); + * const storage = google.storage('v1beta1'); * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace storage + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Storage */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} + export class Storage { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Buckets { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + bucketAccessControls: Resource$Bucketaccesscontrols; + buckets: Resource$Buckets; + objectAccessControls: Resource$Objectaccesscontrols; + objects: Resource$Objects; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * storage.buckets.delete - * @desc Deletes an empty bucket. - * @alias storage.buckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); + this.buckets = new Resource$Buckets(this); + this.objectAccessControls = new Resource$Objectaccesscontrols(this); + this.objects = new Resource$Objects(this); } - } - - /** - * storage.buckets.get - * @desc Returns metadata for the specified bucket. - * @alias storage.buckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.projection Set of properties to return. Defaults to no_acl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * storage.buckets.insert - * @desc Creates a new bucket. - * @alias storage.buckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.projection Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A bucket. + */ + export interface Schema$Bucket { + /** + * Access controls on the bucket. + */ + acl: Schema$BucketAccessControl[]; + /** + * Default access controls to apply to new objects when no ACL is provided. + */ + defaultObjectAcl: Schema$ObjectAccessControl[]; + /** + * The name of the bucket. + */ + id: string; + /** + * The kind of item this is. For buckets, this is always storage#bucket. + */ + kind: string; + /** + * The location of the bucket. Object data for objects in the bucket resides + * in physical storage in this location. Can be US or EU. Defaults to US. + */ + location: string; + /** + * The owner of the bucket. This will always be the project team's owner + * group. + */ + owner: any; + /** + * The project the bucket belongs to. + */ + projectId: string; + /** + * The URI of this bucket. + */ + selfLink: string; + /** + * Creation time of the bucket in RFC 3339 format. + */ + timeCreated: string; + /** + * The bucket's website configuration. + */ + website: any; } - - /** - * storage.buckets.list - * @desc Retrieves a list of buckets for a given project. - * @alias storage.buckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.max-results Maximum number of buckets to return. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.projectId A valid API project identifier. - * @param {string=} params.projection Set of properties to return. Defaults to no_acl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control entry. + */ + export interface Schema$BucketAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - allUsers - allAuthenticatedUsers Examples: - The user + * liz@example.com would be user-liz@example.com. - The group + * example@googlegroups.com would be group-example@googlegroups.com. - To + * refer to all members of the Google Apps for Business domain example.com, + * the entity would be domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For bucket access control entries, this is + * always storage#bucketAccessControl. + */ + kind: string; + /** + * The access permission for the entity. Can be READER, WRITER, or OWNER. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.buckets.patch - * @desc Updates a bucket. This method supports patch semantics. - * @alias storage.buckets.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$BucketAccessControls { + /** + * The list of items. + */ + items: Schema$BucketAccessControl[]; + /** + * The kind of item this is. For lists of bucket access control entries, + * this is always storage#bucketAccessControls. + */ + kind: string; } - - /** - * storage.buckets.update - * @desc Updates a bucket. - * @alias storage.buckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Objectaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * A list of buckets. + */ + export interface Schema$Buckets { + /** + * The list of items. + */ + items: Schema$Bucket[]; + /** + * The kind of item this is. For lists of buckets, this is always + * storage#buckets. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * storage.objectAccessControls.delete - * @desc Deletes the ACL entry for the specified entity on the specified - * object. - * @alias storage.objectAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An object. + */ + export interface Schema$Object { + /** + * Access controls on the object. + */ + acl: Schema$ObjectAccessControl[]; + /** + * The bucket containing this object. + */ + bucket: string; + /** + * Cache-Control directive for the object data. + */ + cacheControl: string; + /** + * Content-Disposition of the object data. + */ + contentDisposition: string; + /** + * Content-Encoding of the object data. + */ + contentEncoding: string; + /** + * Content-Language of the object data. + */ + contentLanguage: string; + /** + * The ID of the object. + */ + id: string; + /** + * The kind of item this is. For objects, this is always storage#object. + */ + kind: string; + /** + * Object media data. Provided on your behalf when uploading raw media or + * multipart/related with an auxiliary media part. + */ + media: any; + /** + * User-provided metadata, in key/value pairs. + */ + metadata: any; + /** + * The name of this object. Required if not specified by URL parameter. + */ + name: string; + /** + * The owner of the object. This will always be the uploader of the object. + */ + owner: any; + /** + * The link to this object. + */ + selfLink: string; } - - /** - * storage.objectAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * object. - * @alias storage.objectAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control entry. + */ + export interface Schema$ObjectAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - allUsers - allAuthenticatedUsers Examples: - The user + * liz@example.com would be user-liz@example.com. - The group + * example@googlegroups.com would be group-example@googlegroups.com. - To + * refer to all members of the Google Apps for Business domain example.com, + * the entity would be domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For object access control entries, this is + * always storage#objectAccessControl. + */ + kind: string; + /** + * The name of the object. + */ + object: string; + /** + * The access permission for the entity. Can be READER or OWNER. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.objectAccessControls.insert - * @desc Creates a new ACL entry on the specified object. - * @alias storage.objectAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$ObjectAccessControls { + /** + * The list of items. + */ + items: Schema$ObjectAccessControl[]; + /** + * The kind of item this is. For lists of object access control entries, + * this is always storage#objectAccessControls. + */ + kind: string; } - - /** - * storage.objectAccessControls.list - * @desc Retrieves ACL entries on the specified object. - * @alias storage.objectAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of objects. + */ + export interface Schema$Objects { + /** + * The list of items. + */ + items: Schema$Object[]; + /** + * The kind of item this is. For lists of objects, this is always + * storage#objects. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + /** + * The list of prefixes of objects matching-but-not-listed up to and + * including the requested delimiter. + */ + prefixes: string[]; } - - /** - * storage.objectAccessControls.patch - * @desc Updates an ACL entry on the specified object. This method supports - * patch semantics. - * @alias storage.objectAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bucketaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.bucketAccessControls.delete + * @desc Deletes the ACL entry for the specified entity on the specified + * bucket. + * @alias storage.bucketAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * bucket. + * @alias storage.bucketAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.insert + * @desc Creates a new ACL entry on the specified bucket. + * @alias storage.bucketAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.list + * @desc Retrieves ACL entries on the specified bucket. + * @alias storage.bucketAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.patch + * @desc Updates an ACL entry on the specified bucket. This method supports + * patch semantics. + * @alias storage.bucketAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.update + * @desc Updates an ACL entry on the specified bucket. + * @alias storage.bucketAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objectAccessControls.update - * @desc Updates an ACL entry on the specified object. - * @alias storage.objectAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Buckets { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.buckets.delete + * @desc Deletes an empty bucket. + * @alias storage.buckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.get + * @desc Returns metadata for the specified bucket. + * @alias storage.buckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.projection Set of properties to return. Defaults to no_acl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.insert + * @desc Creates a new bucket. + * @alias storage.buckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.projection Set of properties to return. Defaults to no_acl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.list + * @desc Retrieves a list of buckets for a given project. + * @alias storage.buckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.max-results Maximum number of buckets to return. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.projectId A valid API project identifier. + * @param {string=} params.projection Set of properties to return. Defaults to no_acl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.patch + * @desc Updates a bucket. This method supports patch semantics. + * @alias storage.buckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.update + * @desc Updates a bucket. + * @alias storage.buckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} -export class Resource$Objects { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.objects.delete - * @desc Deletes data blobs and associated metadata. - * @alias storage.objects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Objectaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.objectAccessControls.delete + * @desc Deletes the ACL entry for the specified entity on the specified + * object. + * @alias storage.objectAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * object. + * @alias storage.objectAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.insert + * @desc Creates a new ACL entry on the specified object. + * @alias storage.objectAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.list + * @desc Retrieves ACL entries on the specified object. + * @alias storage.objectAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.patch + * @desc Updates an ACL entry on the specified object. This method supports + * patch semantics. + * @alias storage.objectAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.update + * @desc Updates an ACL entry on the specified object. + * @alias storage.objectAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta1/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.get - * @desc Retrieves objects or their associated metadata. - * @alias storage.objects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to no_acl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.objects.insert - * @desc Stores new data blobs and associated metadata. - * @alias storage.objects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. - * @param {string=} params.projection Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/storage/v1beta1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.objects.list - * @desc Retrieves a list of objects matching the criteria. - * @alias storage.objects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to look for objects. - * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - * @param {integer=} params.max-results Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. - * @param {string=} params.projection Set of properties to return. Defaults to no_acl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.objects.patch - * @desc Updates a data blob's associated metadata. This method supports patch - * semantics. - * @alias storage.objects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.objects.update - * @desc Updates a data blob's associated metadata. - * @alias storage.objects.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Objects { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.objects.delete + * @desc Deletes data blobs and associated metadata. + * @alias storage.objects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.get + * @desc Retrieves objects or their associated metadata. + * @alias storage.objects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to no_acl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.insert + * @desc Stores new data blobs and associated metadata. + * @alias storage.objects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * @param {string=} params.projection Set of properties to return. Defaults to no_acl, unless the object resource specifies the acl property, when it defaults to full. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/storage/v1beta1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.list + * @desc Retrieves a list of objects matching the criteria. + * @alias storage.objects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to look for objects. + * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * @param {integer=} params.max-results Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. + * @param {string=} params.projection Set of properties to return. Defaults to no_acl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.patch + * @desc Updates a data blob's associated metadata. This method supports + * patch semantics. + * @alias storage.objects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.update + * @desc Updates a data blob's associated metadata. + * @alias storage.objects.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta1/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/storage/v1beta2.ts b/src/apis/storage/v1beta2.ts index d345063e7d8..aac543eed94 100644 --- a/src/apis/storage/v1beta2.ts +++ b/src/apis/storage/v1beta2.ts @@ -27,2479 +27,2539 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Storage JSON API - * - * Lets you store and retrieve potentially-large, immutable data objects. - * - * @example - * const google = require('googleapis'); - * const storage = google.storage('v1beta2'); - * - * @namespace storage - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Storage - */ -export class Storage { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - bucketAccessControls: Resource$Bucketaccesscontrols; - buckets: Resource$Buckets; - channels: Resource$Channels; - defaultObjectAccessControls: Resource$Defaultobjectaccesscontrols; - objectAccessControls: Resource$Objectaccesscontrols; - objects: Resource$Objects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); - this.buckets = new Resource$Buckets(this); - this.channels = new Resource$Channels(this); - this.defaultObjectAccessControls = - new Resource$Defaultobjectaccesscontrols(this); - this.objectAccessControls = new Resource$Objectaccesscontrols(this); - this.objects = new Resource$Objects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * A bucket. - */ -export interface Schema$Bucket { - /** - * Access controls on the bucket. - */ - acl: Schema$BucketAccessControl[]; - /** - * The bucket's Cross-Origin Resource Sharing (CORS) configuration. - */ - cors: any[]; - /** - * Default access controls to apply to new objects when no ACL is provided. - */ - defaultObjectAcl: Schema$ObjectAccessControl[]; - /** - * HTTP 1.1 Entity tag for the bucket. - */ - etag: string; - /** - * The ID of the bucket. - */ - id: string; - /** - * The kind of item this is. For buckets, this is always storage#bucket. - */ - kind: string; - /** - * The bucket's lifecycle configuration. See object lifecycle management - * for more information. - */ - lifecycle: any; - /** - * The location of the bucket. Object data for objects in the bucket resides - * in physical storage within this region. Typical values are US and EU. - * Defaults to US. See the developer's guide for the authoritative list. - */ - location: string; - /** - * The bucket's logging configuration, which defines the destination - * bucket and optional name prefix for the current bucket's logs. - */ - logging: any; - /** - * The metadata generation of this bucket. - */ - metageneration: string; - /** - * The name of the bucket. - */ - name: string; - /** - * The owner of the bucket. This is always the project team's owner group. - */ - owner: any; - /** - * The URI of this bucket. - */ - selfLink: string; - /** - * The bucket's storage class. This defines how objects in the bucket are - * stored and determines the SLA and the cost of storage. Typical values are - * STANDARD and DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. See the - * developer's guide for the authoritative list. - */ - storageClass: string; - /** - * Creation time of the bucket in RFC 3339 format. - */ - timeCreated: string; - /** - * The bucket's versioning configuration. - */ - versioning: any; - /** - * The bucket's website configuration. - */ - website: any; -} -/** - * An access-control entry. - */ -export interface Schema$BucketAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - allUsers - allAuthenticatedUsers Examples: - The user liz@example.com - * would be user-liz@example.com. - The group example@googlegroups.com would - * be group-example@googlegroups.com. - To refer to all members of the Google - * Apps for Business domain example.com, the entity would be - * domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * HTTP 1.1 Entity tag for the access-control entry. - */ - etag: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For bucket access control entries, this is always - * storage#bucketAccessControl. - */ - kind: string; - /** - * The access permission for the entity. Can be READER, WRITER, or OWNER. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$BucketAccessControls { - /** - * The list of items. - */ - items: Schema$BucketAccessControl[]; - /** - * The kind of item this is. For lists of bucket access control entries, this - * is always storage#bucketAccessControls. - */ - kind: string; -} -/** - * A list of buckets. - */ -export interface Schema$Buckets { - /** - * The list of items. - */ - items: Schema$Bucket[]; - /** - * The kind of item this is. For lists of buckets, this is always - * storage#buckets. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; -} -/** - * An notification channel used to watch for resource changes. - */ -export interface Schema$Channel { - /** - * The address where notifications are delivered for this channel. - */ - address: string; - /** - * Date and time of notification channel expiration, expressed as a Unix - * timestamp, in milliseconds. Optional. - */ - expiration: string; - /** - * A UUID or similar unique string that identifies this channel. - */ - id: string; - /** - * Identifies this as a notification channel used to watch for changes to a - * resource. Value: the fixed string "api#channel". - */ - kind: string; - /** - * Additional parameters controlling delivery channel behavior. Optional. - */ - params: any; - /** - * A Boolean value to indicate whether payload is wanted. Optional. - */ - payload: boolean; - /** - * An opaque ID that identifies the resource being watched on this channel. - * Stable across different API versions. - */ - resourceId: string; - /** - * A version-specific identifier for the watched resource. - */ - resourceUri: string; - /** - * An arbitrary string delivered to the target address with each notification - * delivered over this channel. Optional. - */ - token: string; - /** - * The type of delivery mechanism used for this channel. - */ - type: string; -} -/** - * A Compose request. - */ -export interface Schema$ComposeRequest { - /** - * Properties of the resulting object - */ - destination: Schema$Object; - /** - * The kind of item this is. - */ - kind: string; - /** - * The list of source objects that will be concatenated into a single object. - */ - sourceObjects: any[]; -} -/** - * An object. - */ -export interface Schema$Object { - /** - * Access controls on the object. - */ - acl: Schema$ObjectAccessControl[]; - /** - * The bucket containing this object. - */ - bucket: string; - /** - * Cache-Control directive for the object data. - */ - cacheControl: string; - /** - * Number of underlying components that make up this object. Components are - * accumulated by compose operations and are limited to a count of 32. - */ - componentCount: number; - /** - * Content-Disposition of the object data. - */ - contentDisposition: string; - /** - * Content-Encoding of the object data. - */ - contentEncoding: string; - /** - * Content-Language of the object data. - */ - contentLanguage: string; - /** - * Content-Type of the object data. - */ - contentType: string; - /** - * CRC32c checksum, as described in RFC 4960, Appendix B; encoded using - * base64. - */ - crc32c: string; - /** - * HTTP 1.1 Entity tag for the object. - */ - etag: string; - /** - * The content generation of this object. Used for object versioning. - */ - generation: string; - /** - * The ID of the object. - */ - id: string; - /** - * The kind of item this is. For objects, this is always storage#object. - */ - kind: string; - /** - * MD5 hash of the data; encoded using base64. - */ - md5Hash: string; - /** - * Media download link. - */ - mediaLink: string; - /** - * User-provided metadata, in key/value pairs. - */ - metadata: any; - /** - * The generation of the metadata for this object at this generation. Used for - * metadata versioning. Has no meaning outside of the context of this - * generation. - */ - metageneration: string; - /** - * The name of this object. Required if not specified by URL parameter. - */ - name: string; - /** - * The owner of the object. This will always be the uploader of the object. - */ - owner: any; - /** - * The link to this object. - */ - selfLink: string; - /** - * Content-Length of the data in bytes. - */ - size: string; - /** - * Storage class of the object. - */ - storageClass: string; - /** - * Deletion time of the object in RFC 3339 format. Will be returned if and - * only if this version of the object has been deleted. - */ - timeDeleted: string; - /** - * Modification time of the object metadata in RFC 3339 format. - */ - updated: string; -} -/** - * An access-control entry. - */ -export interface Schema$ObjectAccessControl { - /** - * The name of the bucket. - */ - bucket: string; - /** - * The domain associated with the entity, if any. - */ - domain: string; - /** - * The email address associated with the entity, if any. - */ - email: string; - /** - * The entity holding the permission, in one of the following forms: - - * user-userId - user-email - group-groupId - group-email - domain-domain - * - allUsers - allAuthenticatedUsers Examples: - The user liz@example.com - * would be user-liz@example.com. - The group example@googlegroups.com would - * be group-example@googlegroups.com. - To refer to all members of the Google - * Apps for Business domain example.com, the entity would be - * domain-example.com. - */ - entity: string; - /** - * The ID for the entity, if any. - */ - entityId: string; - /** - * HTTP 1.1 Entity tag for the access-control entry. - */ - etag: string; - /** - * The content generation of the object. - */ - generation: string; - /** - * The ID of the access-control entry. - */ - id: string; - /** - * The kind of item this is. For object access control entries, this is always - * storage#objectAccessControl. - */ - kind: string; - /** - * The name of the object. - */ - object: string; - /** - * The access permission for the entity. Can be READER or OWNER. - */ - role: string; - /** - * The link to this access-control entry. - */ - selfLink: string; -} -/** - * An access-control list. - */ -export interface Schema$ObjectAccessControls { - /** - * The list of items. - */ - items: any[]; - /** - * The kind of item this is. For lists of object access control entries, this - * is always storage#objectAccessControls. - */ - kind: string; -} -/** - * A list of objects. - */ -export interface Schema$Objects { - /** - * The list of items. - */ - items: Schema$Object[]; - /** - * The kind of item this is. For lists of objects, this is always - * storage#objects. - */ - kind: string; - /** - * The continuation token, used to page through large result sets. Provide - * this value in a subsequent request to return the next page of results. - */ - nextPageToken: string; - /** - * The list of prefixes of objects matching-but-not-listed up to and including - * the requested delimiter. - */ - prefixes: string[]; -} - -export class Resource$Bucketaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.bucketAccessControls.delete - * @desc Permanently deletes the ACL entry for the specified entity on the - * specified bucket. - * @alias storage.bucketAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * bucket. - * @alias storage.bucketAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.insert - * @desc Creates a new ACL entry on the specified bucket. - * @alias storage.bucketAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.list - * @desc Retrieves ACL entries on the specified bucket. - * @alias storage.bucketAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.patch - * @desc Updates an ACL entry on the specified bucket. This method supports - * patch semantics. - * @alias storage.bucketAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.bucketAccessControls.update - * @desc Updates an ACL entry on the specified bucket. - * @alias storage.bucketAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().BucketAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Buckets { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.buckets.delete - * @desc Permanently deletes an empty bucket. - * @alias storage.buckets.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.get - * @desc Returns metadata for the specified bucket. - * @alias storage.buckets.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.insert - * @desc Creates a new bucket. - * @alias storage.buckets.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project A valid API project identifier. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.list - * @desc Retrieves a list of buckets for a given project. - * @alias storage.buckets.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.maxResults Maximum number of buckets to return. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string} params.project A valid API project identifier. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace storage_v1beta2 { /** - * storage.buckets.patch - * @desc Updates a bucket. This method supports patch semantics. - * @alias storage.buckets.patch - * @memberOf! () + * Cloud Storage JSON API * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.buckets.update - * @desc Updates a bucket. - * @alias storage.buckets.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Bucket} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.channels.stop - * @desc Stop watching resources through this channel - * @alias storage.channels.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/channels/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Defaultobjectaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * storage.defaultObjectAccessControls.delete - * @desc Permanently deletes the default object ACL entry for the specified - * entity on the specified bucket. - * @alias storage.defaultObjectAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.defaultObjectAccessControls.get - * @desc Returns the default object ACL entry for the specified entity on the - * specified bucket. - * @alias storage.defaultObjectAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.defaultObjectAccessControls.insert - * @desc Creates a new default object ACL entry on the specified bucket. - * @alias storage.defaultObjectAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/defaultObjectAcl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.defaultObjectAccessControls.list - * @desc Retrieves default object ACL entries on the specified bucket. - * @alias storage.defaultObjectAccessControls.list - * @memberOf! () + * Lets you store and retrieve potentially-large, immutable data objects. * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.ifMetagenerationMatch If present, only return default ACL listing if the bucket's current metageneration matches this value. - * @param {string=} params.ifMetagenerationNotMatch If present, only return default ACL listing if the bucket's current metageneration does not match the given value. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/defaultObjectAcl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * storage.defaultObjectAccessControls.patch - * @desc Updates a default object ACL entry on the specified bucket. This - * method supports patch semantics. - * @alias storage.defaultObjectAccessControls.patch - * @memberOf! () + * @example + * const google = require('googleapis'); + * const storage = google.storage('v1beta2'); * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace storage + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Storage + */ + export class Storage { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + bucketAccessControls: Resource$Bucketaccesscontrols; + buckets: Resource$Buckets; + channels: Resource$Channels; + defaultObjectAccessControls: Resource$Defaultobjectaccesscontrols; + objectAccessControls: Resource$Objectaccesscontrols; + objects: Resource$Objects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.bucketAccessControls = new Resource$Bucketaccesscontrols(this); + this.buckets = new Resource$Buckets(this); + this.channels = new Resource$Channels(this); + this.defaultObjectAccessControls = + new Resource$Defaultobjectaccesscontrols(this); + this.objectAccessControls = new Resource$Objectaccesscontrols(this); + this.objects = new Resource$Objects(this); + } + + getRoot() { + return this.root; } } - /** - * storage.defaultObjectAccessControls.update - * @desc Updates a default object ACL entry on the specified bucket. - * @alias storage.defaultObjectAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'entity'], - pathParams: ['bucket', 'entity'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Objectaccesscontrols { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); + * A bucket. + */ + export interface Schema$Bucket { + /** + * Access controls on the bucket. + */ + acl: Schema$BucketAccessControl[]; + /** + * The bucket's Cross-Origin Resource Sharing (CORS) configuration. + */ + cors: any[]; + /** + * Default access controls to apply to new objects when no ACL is provided. + */ + defaultObjectAcl: Schema$ObjectAccessControl[]; + /** + * HTTP 1.1 Entity tag for the bucket. + */ + etag: string; + /** + * The ID of the bucket. + */ + id: string; + /** + * The kind of item this is. For buckets, this is always storage#bucket. + */ + kind: string; + /** + * The bucket's lifecycle configuration. See object lifecycle management + * for more information. + */ + lifecycle: any; + /** + * The location of the bucket. Object data for objects in the bucket resides + * in physical storage within this region. Typical values are US and EU. + * Defaults to US. See the developer's guide for the authoritative list. + */ + location: string; + /** + * The bucket's logging configuration, which defines the destination + * bucket and optional name prefix for the current bucket's logs. + */ + logging: any; + /** + * The metadata generation of this bucket. + */ + metageneration: string; + /** + * The name of the bucket. + */ + name: string; + /** + * The owner of the bucket. This is always the project team's owner + * group. + */ + owner: any; + /** + * The URI of this bucket. + */ + selfLink: string; + /** + * The bucket's storage class. This defines how objects in the bucket + * are stored and determines the SLA and the cost of storage. Typical values + * are STANDARD and DURABLE_REDUCED_AVAILABILITY. Defaults to STANDARD. See + * the developer's guide for the authoritative list. + */ + storageClass: string; + /** + * Creation time of the bucket in RFC 3339 format. + */ + timeCreated: string; + /** + * The bucket's versioning configuration. + */ + versioning: any; + /** + * The bucket's website configuration. + */ + website: any; } - - getRoot() { - return this.root; - } - - /** - * storage.objectAccessControls.delete - * @desc Permanently deletes the ACL entry for the specified entity on the - * specified object. - * @alias storage.objectAccessControls.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control entry. + */ + export interface Schema$BucketAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - allUsers - allAuthenticatedUsers Examples: - The user + * liz@example.com would be user-liz@example.com. - The group + * example@googlegroups.com would be group-example@googlegroups.com. - To + * refer to all members of the Google Apps for Business domain example.com, + * the entity would be domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * HTTP 1.1 Entity tag for the access-control entry. + */ + etag: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For bucket access control entries, this is + * always storage#bucketAccessControl. + */ + kind: string; + /** + * The access permission for the entity. Can be READER, WRITER, or OWNER. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.objectAccessControls.get - * @desc Returns the ACL entry for the specified entity on the specified - * object. - * @alias storage.objectAccessControls.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$BucketAccessControls { + /** + * The list of items. + */ + items: Schema$BucketAccessControl[]; + /** + * The kind of item this is. For lists of bucket access control entries, + * this is always storage#bucketAccessControls. + */ + kind: string; } - - /** - * storage.objectAccessControls.insert - * @desc Creates a new ACL entry on the specified object. - * @alias storage.objectAccessControls.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of buckets. + */ + export interface Schema$Buckets { + /** + * The list of items. + */ + items: Schema$Bucket[]; + /** + * The kind of item this is. For lists of buckets, this is always + * storage#buckets. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; } - - /** - * storage.objectAccessControls.list - * @desc Retrieves ACL entries on the specified object. - * @alias storage.objectAccessControls.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}/acl') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An notification channel used to watch for resource changes. + */ + export interface Schema$Channel { + /** + * The address where notifications are delivered for this channel. + */ + address: string; + /** + * Date and time of notification channel expiration, expressed as a Unix + * timestamp, in milliseconds. Optional. + */ + expiration: string; + /** + * A UUID or similar unique string that identifies this channel. + */ + id: string; + /** + * Identifies this as a notification channel used to watch for changes to a + * resource. Value: the fixed string "api#channel". + */ + kind: string; + /** + * Additional parameters controlling delivery channel behavior. Optional. + */ + params: any; + /** + * A Boolean value to indicate whether payload is wanted. Optional. + */ + payload: boolean; + /** + * An opaque ID that identifies the resource being watched on this channel. + * Stable across different API versions. + */ + resourceId: string; + /** + * A version-specific identifier for the watched resource. + */ + resourceUri: string; + /** + * An arbitrary string delivered to the target address with each + * notification delivered over this channel. Optional. + */ + token: string; + /** + * The type of delivery mechanism used for this channel. + */ + type: string; } - - /** - * storage.objectAccessControls.patch - * @desc Updates an ACL entry on the specified object. This method supports - * patch semantics. - * @alias storage.objectAccessControls.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Compose request. + */ + export interface Schema$ComposeRequest { + /** + * Properties of the resulting object + */ + destination: Schema$Object; + /** + * The kind of item this is. + */ + kind: string; + /** + * The list of source objects that will be concatenated into a single + * object. + */ + sourceObjects: any[]; } - - /** - * storage.objectAccessControls.update - * @desc Updates an ACL entry on the specified object. - * @alias storage.objectAccessControls.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of a bucket. - * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string} params.object Name of the object. - * @param {().ObjectAccessControl} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object', 'entity'], - pathParams: ['bucket', 'entity', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Objects { - root: Storage; - constructor(root: Storage) { - this.root = root; - this.getRoot.bind(this); + * An object. + */ + export interface Schema$Object { + /** + * Access controls on the object. + */ + acl: Schema$ObjectAccessControl[]; + /** + * The bucket containing this object. + */ + bucket: string; + /** + * Cache-Control directive for the object data. + */ + cacheControl: string; + /** + * Number of underlying components that make up this object. Components are + * accumulated by compose operations and are limited to a count of 32. + */ + componentCount: number; + /** + * Content-Disposition of the object data. + */ + contentDisposition: string; + /** + * Content-Encoding of the object data. + */ + contentEncoding: string; + /** + * Content-Language of the object data. + */ + contentLanguage: string; + /** + * Content-Type of the object data. + */ + contentType: string; + /** + * CRC32c checksum, as described in RFC 4960, Appendix B; encoded using + * base64. + */ + crc32c: string; + /** + * HTTP 1.1 Entity tag for the object. + */ + etag: string; + /** + * The content generation of this object. Used for object versioning. + */ + generation: string; + /** + * The ID of the object. + */ + id: string; + /** + * The kind of item this is. For objects, this is always storage#object. + */ + kind: string; + /** + * MD5 hash of the data; encoded using base64. + */ + md5Hash: string; + /** + * Media download link. + */ + mediaLink: string; + /** + * User-provided metadata, in key/value pairs. + */ + metadata: any; + /** + * The generation of the metadata for this object at this generation. Used + * for metadata versioning. Has no meaning outside of the context of this + * generation. + */ + metageneration: string; + /** + * The name of this object. Required if not specified by URL parameter. + */ + name: string; + /** + * The owner of the object. This will always be the uploader of the object. + */ + owner: any; + /** + * The link to this object. + */ + selfLink: string; + /** + * Content-Length of the data in bytes. + */ + size: string; + /** + * Storage class of the object. + */ + storageClass: string; + /** + * Deletion time of the object in RFC 3339 format. Will be returned if and + * only if this version of the object has been deleted. + */ + timeDeleted: string; + /** + * Modification time of the object metadata in RFC 3339 format. + */ + updated: string; } - - getRoot() { - return this.root; - } - - /** - * storage.objects.compose - * @desc Concatenates a list of existing objects into a new object in the same - * bucket. - * @alias storage.objects.compose - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.destinationBucket Name of the bucket in which to store the new object. - * @param {string} params.destinationObject Name of the new object. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {().ComposeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - compose(params?: any, options?: MethodOptions): AxiosPromise; - compose( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - compose( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/storage/v1beta2/b/{destinationBucket}/o/{destinationObject}/compose') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['destinationBucket', 'destinationObject'], - pathParams: ['destinationBucket', 'destinationObject'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control entry. + */ + export interface Schema$ObjectAccessControl { + /** + * The name of the bucket. + */ + bucket: string; + /** + * The domain associated with the entity, if any. + */ + domain: string; + /** + * The email address associated with the entity, if any. + */ + email: string; + /** + * The entity holding the permission, in one of the following forms: - + * user-userId - user-email - group-groupId - group-email - + * domain-domain - allUsers - allAuthenticatedUsers Examples: - The user + * liz@example.com would be user-liz@example.com. - The group + * example@googlegroups.com would be group-example@googlegroups.com. - To + * refer to all members of the Google Apps for Business domain example.com, + * the entity would be domain-example.com. + */ + entity: string; + /** + * The ID for the entity, if any. + */ + entityId: string; + /** + * HTTP 1.1 Entity tag for the access-control entry. + */ + etag: string; + /** + * The content generation of the object. + */ + generation: string; + /** + * The ID of the access-control entry. + */ + id: string; + /** + * The kind of item this is. For object access control entries, this is + * always storage#objectAccessControl. + */ + kind: string; + /** + * The name of the object. + */ + object: string; + /** + * The access permission for the entity. Can be READER or OWNER. + */ + role: string; + /** + * The link to this access-control entry. + */ + selfLink: string; } - - /** - * storage.objects.copy - * @desc Copies an object to a destination in the same location. Optionally - * overrides metadata. - * @alias storage.objects.copy - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. - * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's generation matches the given value. - * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's generation does not match the given value. - * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. - * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. - * @param {string} params.sourceBucket Name of the bucket in which to find the source object. - * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). - * @param {string} params.sourceObject Name of the source object. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - copy(params?: any, options?: MethodOptions): AxiosPromise; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - copy( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/storage/v1beta2/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [ - 'sourceBucket', 'sourceObject', 'destinationBucket', 'destinationObject' - ], - pathParams: [ - 'destinationBucket', 'destinationObject', 'sourceBucket', 'sourceObject' - ], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An access-control list. + */ + export interface Schema$ObjectAccessControls { + /** + * The list of items. + */ + items: any[]; + /** + * The kind of item this is. For lists of object access control entries, + * this is always storage#objectAccessControls. + */ + kind: string; } - - /** - * storage.objects.delete - * @desc Deletes data blobs and associated metadata. Deletions are permanent - * if versioning is not enabled for the bucket, or if the generation parameter - * is used. - * @alias storage.objects.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of objects. + */ + export interface Schema$Objects { + /** + * The list of items. + */ + items: Schema$Object[]; + /** + * The kind of item this is. For lists of objects, this is always + * storage#objects. + */ + kind: string; + /** + * The continuation token, used to page through large result sets. Provide + * this value in a subsequent request to return the next page of results. + */ + nextPageToken: string; + /** + * The list of prefixes of objects matching-but-not-listed up to and + * including the requested delimiter. + */ + prefixes: string[]; } - - /** - * storage.objects.get - * @desc Retrieves objects or their associated metadata. - * @alias storage.objects.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Bucketaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.bucketAccessControls.delete + * @desc Permanently deletes the ACL entry for the specified entity on the + * specified bucket. + * @alias storage.bucketAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * bucket. + * @alias storage.bucketAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.insert + * @desc Creates a new ACL entry on the specified bucket. + * @alias storage.bucketAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.list + * @desc Retrieves ACL entries on the specified bucket. + * @alias storage.bucketAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.patch + * @desc Updates an ACL entry on the specified bucket. This method supports + * patch semantics. + * @alias storage.bucketAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.bucketAccessControls.update + * @desc Updates an ACL entry on the specified bucket. + * @alias storage.bucketAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().BucketAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.insert - * @desc Stores new data blobs and associated metadata. - * @alias storage.objects.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/storage/v1beta2/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Buckets { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.buckets.delete + * @desc Permanently deletes an empty bucket. + * @alias storage.buckets.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.get + * @desc Returns metadata for the specified bucket. + * @alias storage.buckets.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.insert + * @desc Creates a new bucket. + * @alias storage.buckets.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project A valid API project identifier. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.list + * @desc Retrieves a list of buckets for a given project. + * @alias storage.buckets.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.maxResults Maximum number of buckets to return. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string} params.project A valid API project identifier. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.patch + * @desc Updates a bucket. This method supports patch semantics. + * @alias storage.buckets.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.buckets.update + * @desc Updates a bucket. + * @alias storage.buckets.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Bucket} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.list - * @desc Retrieves a list of objects matching the criteria. - * @alias storage.objects.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to look for objects. - * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - * @param {integer=} params.maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {boolean=} params.versions If true, lists all versions of a file as distinct results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Channels { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.channels.stop + * @desc Stop watching resources through this channel + * @alias storage.channels.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/channels/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.patch - * @desc Updates a data blob's associated metadata. This method supports patch - * semantics. - * @alias storage.objects.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Defaultobjectaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.defaultObjectAccessControls.delete + * @desc Permanently deletes the default object ACL entry for the specified + * entity on the specified bucket. + * @alias storage.defaultObjectAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.defaultObjectAccessControls.get + * @desc Returns the default object ACL entry for the specified entity on + * the specified bucket. + * @alias storage.defaultObjectAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.defaultObjectAccessControls.insert + * @desc Creates a new default object ACL entry on the specified bucket. + * @alias storage.defaultObjectAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/defaultObjectAcl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.defaultObjectAccessControls.list + * @desc Retrieves default object ACL entries on the specified bucket. + * @alias storage.defaultObjectAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.ifMetagenerationMatch If present, only return default ACL listing if the bucket's current metageneration matches this value. + * @param {string=} params.ifMetagenerationNotMatch If present, only return default ACL listing if the bucket's current metageneration does not match the given value. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/defaultObjectAcl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.defaultObjectAccessControls.patch + * @desc Updates a default object ACL entry on the specified bucket. This + * method supports patch semantics. + * @alias storage.defaultObjectAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.defaultObjectAccessControls.update + * @desc Updates a default object ACL entry on the specified bucket. + * @alias storage.defaultObjectAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/defaultObjectAcl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'entity'], + pathParams: ['bucket', 'entity'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.update - * @desc Updates a data blob's associated metadata. - * @alias storage.objects.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which the object resides. - * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). - * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. - * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. - * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. - * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. - * @param {string} params.object Name of the object. - * @param {string=} params.projection Set of properties to return. Defaults to full. - * @param {().Object} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['bucket', 'object'], - pathParams: ['bucket', 'object'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Objectaccesscontrols { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.objectAccessControls.delete + * @desc Permanently deletes the ACL entry for the specified entity on the + * specified object. + * @alias storage.objectAccessControls.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.get + * @desc Returns the ACL entry for the specified entity on the specified + * object. + * @alias storage.objectAccessControls.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.insert + * @desc Creates a new ACL entry on the specified object. + * @alias storage.objectAccessControls.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.list + * @desc Retrieves ACL entries on the specified object. + * @alias storage.objectAccessControls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}/acl') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.patch + * @desc Updates an ACL entry on the specified object. This method supports + * patch semantics. + * @alias storage.objectAccessControls.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objectAccessControls.update + * @desc Updates an ACL entry on the specified object. + * @alias storage.objectAccessControls.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of a bucket. + * @param {string} params.entity The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string} params.object Name of the object. + * @param {().ObjectAccessControl} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/storage/v1beta2/b/{bucket}/o/{object}/acl/{entity}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object', 'entity'], + pathParams: ['bucket', 'entity', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * storage.objects.watchAll - * @desc Watch for changes on all objects in a bucket. - * @alias storage.objects.watchAll - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.bucket Name of the bucket in which to look for objects. - * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - * @param {integer=} params.maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. - * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. - * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. - * @param {string=} params.projection Set of properties to return. Defaults to noAcl. - * @param {boolean=} params.versions If true, lists all versions of a file as distinct results. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - watchAll(params?: any, options?: MethodOptions): AxiosPromise; - watchAll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - watchAll( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/watch') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['bucket'], - pathParams: ['bucket'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Objects { + root: Storage; + constructor(root: Storage) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * storage.objects.compose + * @desc Concatenates a list of existing objects into a new object in the + * same bucket. + * @alias storage.objects.compose + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.destinationBucket Name of the bucket in which to store the new object. + * @param {string} params.destinationObject Name of the new object. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {().ComposeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + compose(params?: any, options?: MethodOptions): AxiosPromise; + compose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + compose( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/storage/v1beta2/b/{destinationBucket}/o/{destinationObject}/compose') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['destinationBucket', 'destinationObject'], + pathParams: ['destinationBucket', 'destinationObject'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.copy + * @desc Copies an object to a destination in the same location. Optionally + * overrides metadata. + * @alias storage.objects.copy + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.destinationBucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * @param {string} params.destinationObject Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the destination object's current generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the destination object's current generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the destination object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the destination object's current metageneration does not match the given value. + * @param {string=} params.ifSourceGenerationMatch Makes the operation conditional on whether the source object's generation matches the given value. + * @param {string=} params.ifSourceGenerationNotMatch Makes the operation conditional on whether the source object's generation does not match the given value. + * @param {string=} params.ifSourceMetagenerationMatch Makes the operation conditional on whether the source object's current metageneration matches the given value. + * @param {string=} params.ifSourceMetagenerationNotMatch Makes the operation conditional on whether the source object's current metageneration does not match the given value. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * @param {string} params.sourceBucket Name of the bucket in which to find the source object. + * @param {string=} params.sourceGeneration If present, selects a specific revision of the source object (as opposed to the latest version, the default). + * @param {string} params.sourceObject Name of the source object. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + copy(params?: any, options?: MethodOptions): AxiosPromise; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + copy( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/storage/v1beta2/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [ + 'sourceBucket', 'sourceObject', 'destinationBucket', + 'destinationObject' + ], + pathParams: [ + 'destinationBucket', 'destinationObject', 'sourceBucket', + 'sourceObject' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.delete + * @desc Deletes data blobs and associated metadata. Deletions are permanent + * if versioning is not enabled for the bucket, or if the generation + * parameter is used. + * @alias storage.objects.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.get + * @desc Retrieves objects or their associated metadata. + * @alias storage.objects.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.insert + * @desc Stores new data blobs and associated metadata. + * @alias storage.objects.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any. + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string=} params.name Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/storage/v1beta2/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.list + * @desc Retrieves a list of objects matching the criteria. + * @alias storage.objects.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to look for objects. + * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * @param {integer=} params.maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {boolean=} params.versions If true, lists all versions of a file as distinct results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.patch + * @desc Updates a data blob's associated metadata. This method supports + * patch semantics. + * @alias storage.objects.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.update + * @desc Updates a data blob's associated metadata. + * @alias storage.objects.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which the object resides. + * @param {string=} params.generation If present, selects a specific revision of this object (as opposed to the latest version, the default). + * @param {string=} params.ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. + * @param {string=} params.ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. + * @param {string=} params.ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. + * @param {string=} params.ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. + * @param {string} params.object Name of the object. + * @param {string=} params.projection Set of properties to return. Defaults to full. + * @param {().Object} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/{object}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['bucket', 'object'], + pathParams: ['bucket', 'object'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * storage.objects.watchAll + * @desc Watch for changes on all objects in a bucket. + * @alias storage.objects.watchAll + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.bucket Name of the bucket in which to look for objects. + * @param {string=} params.delimiter Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + * @param {integer=} params.maxResults Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. + * @param {string=} params.pageToken A previously-returned page token representing part of the larger set of results to view. + * @param {string=} params.prefix Filter results to objects whose names begin with this prefix. + * @param {string=} params.projection Set of properties to return. Defaults to noAcl. + * @param {boolean=} params.versions If true, lists all versions of a file as distinct results. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + watchAll(params?: any, options?: MethodOptions): + AxiosPromise; + watchAll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + watchAll( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/storage/v1beta2/b/{bucket}/o/watch') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['bucket'], + pathParams: ['bucket'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/storagetransfer/v1.ts b/src/apis/storagetransfer/v1.ts index c7936435e56..9f3b0ced93e 100644 --- a/src/apis/storagetransfer/v1.ts +++ b/src/apis/storagetransfer/v1.ts @@ -27,1930 +27,1963 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Storage Transfer API - * - * Transfers data from external data sources to a Google Cloud Storage bucket or - * between Google Cloud Storage buckets. - * - * @example - * const google = require('googleapis'); - * const storagetransfer = google.storagetransfer('v1'); - * - * @namespace storagetransfer - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Storagetransfer - */ -export class Storagetransfer { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace storagetransfer_v1 { + /** + * Storage Transfer API + * + * Transfers data from external data sources to a Google Cloud Storage bucket + * or between Google Cloud Storage buckets. + * + * @example + * const google = require('googleapis'); + * const storagetransfer = google.storagetransfer('v1'); + * + * @namespace storagetransfer + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Storagetransfer + */ + export class Storagetransfer { + _options: GlobalOptions; + google: GoogleApis; + root = this; - googleServiceAccounts: Resource$Googleserviceaccounts; - transferJobs: Resource$Transferjobs; - transferOperations: Resource$Transferoperations; + googleServiceAccounts: Resource$Googleserviceaccounts; + transferJobs: Resource$Transferjobs; + transferOperations: Resource$Transferoperations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.googleServiceAccounts = new Resource$Googleserviceaccounts(this); - this.transferJobs = new Resource$Transferjobs(this); - this.transferOperations = new Resource$Transferoperations(this); - } + this.googleServiceAccounts = new Resource$Googleserviceaccounts(this); + this.transferJobs = new Resource$Transferjobs(this); + this.transferOperations = new Resource$Transferoperations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * AWS access key (see [AWS Security - * Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). - */ -export interface Schema$AwsAccessKey { - /** - * AWS access key ID. Required. - */ - accessKeyId: string; - /** - * AWS secret access key. This field is not returned in RPC responses. - * Required. - */ - secretAccessKey: string; -} -/** - * An AwsS3Data resource can be a data source, but not a data sink. In an - * AwsS3Data resource, an object's name is the S3 object's key name. - */ -export interface Schema$AwsS3Data { - /** - * AWS access key used to sign the API requests to the AWS S3 bucket. - * Permissions on the bucket must be granted to the access ID of the AWS - * access key. Required. - */ - awsAccessKey: Schema$AwsAccessKey; - /** - * S3 Bucket name (see [Creating a - * bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). - * Required. - */ - bucketName: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * An entry describing an error that has occurred. - */ -export interface Schema$ErrorLogEntry { - /** - * A list of messages that carry the error details. - */ - errorDetails: string[]; - /** - * A URL that refers to the target (a data source, a data sink, or an object) - * with which the error is associated. Required. - */ - url: string; -} -/** - * A summary of errors by error code, plus a count and sample error log entries. - */ -export interface Schema$ErrorSummary { - /** - * Required. - */ - errorCode: string; - /** - * Count of this type of error. Required. - */ - errorCount: string; - /** - * Error samples. - */ - errorLogEntries: Schema$ErrorLogEntry[]; -} -/** - * In a GcsData resource, an object's name is the Google Cloud Storage - * object's name and its `lastModificationTime` refers to the object's - * updated time, which changes when the content or the metadata of the object is - * updated. - */ -export interface Schema$GcsData { - /** - * Google Cloud Storage bucket name (see [Bucket Name - * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). - * Required. - */ - bucketName: string; -} -/** - * Google service account - */ -export interface Schema$GoogleServiceAccount { - /** - * Required. - */ - accountEmail: string; -} -/** - * An HttpData resource specifies a list of objects on the web to be transferred - * over HTTP. The information of the objects to be transferred is contained in - * a file referenced by a URL. The first line in the file must be - * "TsvHttpData-1.0", which specifies the format of the file. - * Subsequent lines specify the information of the list of objects, one object - * per list entry. Each entry has the following tab-delimited fields: * HTTP - * URL - The location of the object. * Length - The size of the object in - * bytes. * MD5 - The base64-encoded MD5 hash of the object. For an example of - * a valid TSV file, see [Transferring data from - * URLs](https://cloud.google.com/storage/transfer/create-url-list). When - * transferring data based on a URL list, keep the following in mind: * When an - * object located at `http(s)://hostname:port/<URL-path>` is transferred - * to a data sink, the name of the object at the data sink is - * `<hostname>/<URL-path>`. * If the specified size of an object - * does not match the actual size of the object fetched, the object will not be - * transferred. * If the specified MD5 does not match the MD5 computed from the - * transferred bytes, the object transfer will fail. For more information, see - * [Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5) * - * Ensure that each URL you specify is publicly accessible. For example, in - * Google Cloud Storage you can [share an object publicly] - * (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get a - * link to it. * Storage Transfer Service obeys `robots.txt` rules and requires - * the source HTTP server to support `Range` requests and to return a - * `Content-Length` header in each response. * - * [ObjectConditions](#ObjectConditions) have no effect when filtering objects - * to transfer. - */ -export interface Schema$HttpData { - /** - * The URL that points to the file that stores the object list entries. This - * file must allow public access. Currently, only URLs with HTTP and HTTPS - * schemes are supported. Required. - */ - listUrl: string; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response from ListTransferJobs. - */ -export interface Schema$ListTransferJobsResponse { - /** - * The list next page token. - */ - nextPageToken: string; - /** - * A list of transfer jobs. - */ - transferJobs: Schema$TransferJob[]; -} -/** - * Conditions that determine which objects will be transferred. - */ -export interface Schema$ObjectConditions { - /** - * `excludePrefixes` must follow the requirements described for - * `includePrefixes`. The max size of `excludePrefixes` is 1000. - */ - excludePrefixes: string[]; - /** - * If `includePrefixes` is specified, objects that satisfy the object - * conditions must have names that start with one of the `includePrefixes` and - * that do not start with any of the `excludePrefixes`. If `includePrefixes` - * is not specified, all objects except those that have names starting with - * one of the `excludePrefixes` must satisfy the object conditions. - * Requirements: * Each include-prefix and exclude-prefix can contain any - * sequence of Unicode characters, of max length 1024 bytes when - * UTF8-encoded, and must not contain Carriage Return or Line Feed - * characters. Wildcard matching and regular expression matching are not - * supported. * Each include-prefix and exclude-prefix must omit the - * leading slash. For example, to include the `requests.gz` object in a - * transfer from `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the - * include prefix as `logs/y=2015/requests.gz`. * None of the - * include-prefix or the exclude-prefix values can be empty, if specified. - * * Each include-prefix must include a distinct portion of the object - * namespace, i.e., no include-prefix may be a prefix of another - * include-prefix. * Each exclude-prefix must exclude a distinct portion of - * the object namespace, i.e., no exclude-prefix may be a prefix of - * another exclude-prefix. * If `includePrefixes` is specified, then - * each exclude-prefix must start with the value of a path explicitly - * included by `includePrefixes`. The max size of `includePrefixes` is 1000. - */ - includePrefixes: string[]; - /** - * `maxTimeElapsedSinceLastModification` is the complement to - * `minTimeElapsedSinceLastModification`. - */ - maxTimeElapsedSinceLastModification: string; - /** - * If unspecified, `minTimeElapsedSinceLastModification` takes a zero value - * and `maxTimeElapsedSinceLastModification` takes the maximum possible value - * of Duration. Objects that satisfy the object conditions must either have a - * `lastModificationTime` greater or equal to `NOW` - - * `maxTimeElapsedSinceLastModification` and less than `NOW` - - * `minTimeElapsedSinceLastModification`, or not have a - * `lastModificationTime`. - */ - minTimeElapsedSinceLastModification: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Represents the transfer operation object. - */ - metadata: any; /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `transferOperations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Request passed to PauseTransferOperation. - */ -export interface Schema$PauseTransferOperationRequest {} -/** - * Request passed to ResumeTransferOperation. - */ -export interface Schema$ResumeTransferOperationRequest {} -/** - * Transfers can be scheduled to recur or to run just once. - */ -export interface Schema$Schedule { - /** - * The last day the recurring transfer will be run. If `scheduleEndDate` is - * the same as `scheduleStartDate`, the transfer will be executed only once. - */ - scheduleEndDate: Schema$Date; - /** - * The first day the recurring transfer is scheduled to run. If - * `scheduleStartDate` is in the past, the transfer will run for the first - * time on the following day. Required. - */ - scheduleStartDate: Schema$Date; - /** - * The time in UTC at which the transfer will be scheduled to start in a day. - * Transfers may start later than this time. If not specified, recurring and - * one-time transfers that are scheduled to run today will run immediately; - * recurring transfers that are scheduled to run on a future date will start - * at approximately midnight UTC on that date. Note that when configuring a - * transfer with the Cloud Platform Console, the transfer's start time in - * a day is specified in your local timezone. - */ - startTimeOfDay: Schema$TimeOfDay; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Represents a time of day. The date and time zone are either not significant - * or are specified elsewhere. An API may choose to allow leap seconds. Related - * types are google.type.Date and `google.protobuf.Timestamp`. - */ -export interface Schema$TimeOfDay { - /** - * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose - * to allow the value "24:00:00" for scenarios like business closing - * time. - */ - hours: number; - /** - * Minutes of hour of day. Must be from 0 to 59. - */ - minutes: number; - /** - * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - */ - nanos: number; - /** - * Seconds of minutes of the time. Must normally be from 0 to 59. An API may - * allow the value 60 if it allows leap-seconds. - */ - seconds: number; -} -/** - * A collection of counters that report the progress of a transfer operation. - */ -export interface Schema$TransferCounters { - /** - * Bytes that are copied to the data sink. - */ - bytesCopiedToSink: string; - /** - * Bytes that are deleted from the data sink. - */ - bytesDeletedFromSink: string; - /** - * Bytes that are deleted from the data source. - */ - bytesDeletedFromSource: string; - /** - * Bytes that failed to be deleted from the data sink. - */ - bytesFailedToDeleteFromSink: string; - /** - * Bytes found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - */ - bytesFoundFromSource: string; - /** - * Bytes found only in the data sink that are scheduled to be deleted. - */ - bytesFoundOnlyFromSink: string; - /** - * Bytes in the data source that failed to be transferred or that failed to be - * deleted after being transferred. - */ - bytesFromSourceFailed: string; - /** - * Bytes in the data source that are not transferred because they already - * exist in the data sink. - */ - bytesFromSourceSkippedBySync: string; - /** - * Objects that are copied to the data sink. - */ - objectsCopiedToSink: string; - /** - * Objects that are deleted from the data sink. - */ - objectsDeletedFromSink: string; - /** - * Objects that are deleted from the data source. - */ - objectsDeletedFromSource: string; - /** - * Objects that failed to be deleted from the data sink. - */ - objectsFailedToDeleteFromSink: string; - /** - * Objects found in the data source that are scheduled to be transferred, - * excluding any that are filtered based on object conditions or skipped due - * to sync. - */ - objectsFoundFromSource: string; - /** - * Objects found only in the data sink that are scheduled to be deleted. - */ - objectsFoundOnlyFromSink: string; - /** - * Objects in the data source that failed to be transferred or that failed to - * be deleted after being transferred. - */ - objectsFromSourceFailed: string; - /** - * Objects in the data source that are not transferred because they already - * exist in the data sink. - */ - objectsFromSourceSkippedBySync: string; -} -/** - * This resource represents the configuration of a transfer job that runs - * periodically. - */ -export interface Schema$TransferJob { - /** - * This field cannot be changed by user requests. - */ - creationTime: string; - /** - * This field cannot be changed by user requests. - */ - deletionTime: string; - /** - * A description provided by the user for the job. Its max length is 1024 - * bytes when Unicode-encoded. - */ - description: string; - /** - * This field cannot be changed by user requests. - */ - lastModificationTime: string; - /** - * A globally unique name assigned by Storage Transfer Service when the job is - * created. This field should be left empty in requests to create a new - * transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` - * error. - */ - name: string; - /** - * The ID of the Google Cloud Platform Console project that owns the job. - */ - projectId: string; - /** - * Schedule specification. - */ - schedule: Schema$Schedule; - /** - * Status of the job. This value MUST be specified for - * `CreateTransferJobRequests`. NOTE: The effect of the new job status takes - * place during a subsequent job run. For example, if you change the job - * status from `ENABLED` to `DISABLED`, and an operation spawned by the - * transfer is running, the status change would not affect the current - * operation. - */ - status: string; - /** - * Transfer specification. - */ - transferSpec: Schema$TransferSpec; -} -/** - * A description of the execution of a transfer. - */ -export interface Schema$TransferOperation { - /** - * Information about the progress of the transfer operation. - */ - counters: Schema$TransferCounters; - /** - * End time of this transfer execution. - */ - endTime: string; + * AWS access key (see [AWS Security + * Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). + */ + export interface Schema$AwsAccessKey { + /** + * AWS access key ID. Required. + */ + accessKeyId: string; + /** + * AWS secret access key. This field is not returned in RPC responses. + * Required. + */ + secretAccessKey: string; + } /** - * Summarizes errors encountered with sample error log entries. - */ - errorBreakdowns: Schema$ErrorSummary[]; + * An AwsS3Data resource can be a data source, but not a data sink. In an + * AwsS3Data resource, an object's name is the S3 object's key name. + */ + export interface Schema$AwsS3Data { + /** + * AWS access key used to sign the API requests to the AWS S3 bucket. + * Permissions on the bucket must be granted to the access ID of the AWS + * access key. Required. + */ + awsAccessKey: Schema$AwsAccessKey; + /** + * S3 Bucket name (see [Creating a + * bucket](http://docs.aws.amazon.com/AmazonS3/latest/dev/create-bucket-get-location-example.html)). + * Required. + */ + bucketName: string; + } /** - * A globally unique ID assigned by the system. - */ - name: string; + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; + } /** - * The ID of the Google Cloud Platform Console project that owns the - * operation. Required. - */ - projectId: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * An entry describing an error that has occurred. + */ + export interface Schema$ErrorLogEntry { + /** + * A list of messages that carry the error details. + */ + errorDetails: string[]; + /** + * A URL that refers to the target (a data source, a data sink, or an + * object) with which the error is associated. Required. + */ + url: string; + } /** - * Start time of this transfer execution. - */ - startTime: string; + * A summary of errors by error code, plus a count and sample error log + * entries. + */ + export interface Schema$ErrorSummary { + /** + * Required. + */ + errorCode: string; + /** + * Count of this type of error. Required. + */ + errorCount: string; + /** + * Error samples. + */ + errorLogEntries: Schema$ErrorLogEntry[]; + } /** - * Status of the transfer operation. - */ - status: string; + * In a GcsData resource, an object's name is the Google Cloud Storage + * object's name and its `lastModificationTime` refers to the object's + * updated time, which changes when the content or the metadata of the object + * is updated. + */ + export interface Schema$GcsData { + /** + * Google Cloud Storage bucket name (see [Bucket Name + * Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + * Required. + */ + bucketName: string; + } /** - * The name of the transfer job that triggers this transfer operation. + * Google service account */ - transferJobName: string; + export interface Schema$GoogleServiceAccount { + /** + * Required. + */ + accountEmail: string; + } /** - * Transfer specification. Required. - */ - transferSpec: Schema$TransferSpec; -} -/** - * TransferOptions uses three boolean parameters to define the actions to be - * performed on objects in a transfer. - */ -export interface Schema$TransferOptions { + * An HttpData resource specifies a list of objects on the web to be + * transferred over HTTP. The information of the objects to be transferred is + * contained in a file referenced by a URL. The first line in the file must be + * "TsvHttpData-1.0", which specifies the format of the file. + * Subsequent lines specify the information of the list of objects, one object + * per list entry. Each entry has the following tab-delimited fields: * HTTP + * URL - The location of the object. * Length - The size of the object in + * bytes. * MD5 - The base64-encoded MD5 hash of the object. For an example + * of a valid TSV file, see [Transferring data from + * URLs](https://cloud.google.com/storage/transfer/create-url-list). When + * transferring data based on a URL list, keep the following in mind: * When + * an object located at `http(s)://hostname:port/<URL-path>` is + * transferred to a data sink, the name of the object at the data sink is + * `<hostname>/<URL-path>`. * If the specified size of an object + * does not match the actual size of the object fetched, the object will not + * be transferred. * If the specified MD5 does not match the MD5 computed + * from the transferred bytes, the object transfer will fail. For more + * information, see [Generating MD5 + * hashes](https://cloud.google.com/storage/transfer/#md5) * Ensure that each + * URL you specify is publicly accessible. For example, in Google Cloud + * Storage you can [share an object publicly] + * (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get + * a link to it. * Storage Transfer Service obeys `robots.txt` rules and + * requires the source HTTP server to support `Range` requests and to return a + * `Content-Length` header in each response. * + * [ObjectConditions](#ObjectConditions) have no effect when filtering objects + * to transfer. + */ + export interface Schema$HttpData { + /** + * The URL that points to the file that stores the object list entries. This + * file must allow public access. Currently, only URLs with HTTP and HTTPS + * schemes are supported. Required. + */ + listUrl: string; + } /** - * Whether objects should be deleted from the source after they are - * transferred to the sink. Note that this option and - * `deleteObjectsUniqueInSink` are mutually exclusive. - */ - deleteObjectsFromSourceAfterTransfer: boolean; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Whether objects that exist only in the sink should be deleted. Note that - * this option and `deleteObjectsFromSourceAfterTransfer` are mutually - * exclusive. - */ - deleteObjectsUniqueInSink: boolean; + * Response from ListTransferJobs. + */ + export interface Schema$ListTransferJobsResponse { + /** + * The list next page token. + */ + nextPageToken: string; + /** + * A list of transfer jobs. + */ + transferJobs: Schema$TransferJob[]; + } /** - * Whether overwriting objects that already exist in the sink is allowed. - */ - overwriteObjectsAlreadyExistingInSink: boolean; -} -/** - * Configuration for running a transfer. - */ -export interface Schema$TransferSpec { + * Conditions that determine which objects will be transferred. + */ + export interface Schema$ObjectConditions { + /** + * `excludePrefixes` must follow the requirements described for + * `includePrefixes`. The max size of `excludePrefixes` is 1000. + */ + excludePrefixes: string[]; + /** + * If `includePrefixes` is specified, objects that satisfy the object + * conditions must have names that start with one of the `includePrefixes` + * and that do not start with any of the `excludePrefixes`. If + * `includePrefixes` is not specified, all objects except those that have + * names starting with one of the `excludePrefixes` must satisfy the object + * conditions. Requirements: * Each include-prefix and exclude-prefix + * can contain any sequence of Unicode characters, of max length 1024 + * bytes when UTF8-encoded, and must not contain Carriage Return or Line + * Feed characters. Wildcard matching and regular expression matching + * are not supported. * Each include-prefix and exclude-prefix must omit + * the leading slash. For example, to include the `requests.gz` object + * in a transfer from `s3://my-aws-bucket/logs/y=2015/requests.gz`, + * specify the include prefix as `logs/y=2015/requests.gz`. * None of + * the include-prefix or the exclude-prefix values can be empty, if + * specified. * Each include-prefix must include a distinct portion of + * the object namespace, i.e., no include-prefix may be a prefix of + * another include-prefix. * Each exclude-prefix must exclude a + * distinct portion of the object namespace, i.e., no exclude-prefix may + * be a prefix of another exclude-prefix. * If `includePrefixes` is + * specified, then each exclude-prefix must start with the value of a + * path explicitly included by `includePrefixes`. The max size of + * `includePrefixes` is 1000. + */ + includePrefixes: string[]; + /** + * `maxTimeElapsedSinceLastModification` is the complement to + * `minTimeElapsedSinceLastModification`. + */ + maxTimeElapsedSinceLastModification: string; + /** + * If unspecified, `minTimeElapsedSinceLastModification` takes a zero value + * and `maxTimeElapsedSinceLastModification` takes the maximum possible + * value of Duration. Objects that satisfy the object conditions must either + * have a `lastModificationTime` greater or equal to `NOW` - + * `maxTimeElapsedSinceLastModification` and less than `NOW` - + * `minTimeElapsedSinceLastModification`, or not have a + * `lastModificationTime`. + */ + minTimeElapsedSinceLastModification: string; + } /** - * An AWS S3 data source. - */ - awsS3DataSource: Schema$AwsS3Data; + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Represents the transfer operation object. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `transferOperations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * A Google Cloud Storage data sink. - */ - gcsDataSink: Schema$GcsData; + * Request passed to PauseTransferOperation. + */ + export interface Schema$PauseTransferOperationRequest {} + /** + * Request passed to ResumeTransferOperation. + */ + export interface Schema$ResumeTransferOperationRequest {} + /** + * Transfers can be scheduled to recur or to run just once. + */ + export interface Schema$Schedule { + /** + * The last day the recurring transfer will be run. If `scheduleEndDate` is + * the same as `scheduleStartDate`, the transfer will be executed only once. + */ + scheduleEndDate: Schema$Date; + /** + * The first day the recurring transfer is scheduled to run. If + * `scheduleStartDate` is in the past, the transfer will run for the first + * time on the following day. Required. + */ + scheduleStartDate: Schema$Date; + /** + * The time in UTC at which the transfer will be scheduled to start in a + * day. Transfers may start later than this time. If not specified, + * recurring and one-time transfers that are scheduled to run today will run + * immediately; recurring transfers that are scheduled to run on a future + * date will start at approximately midnight UTC on that date. Note that + * when configuring a transfer with the Cloud Platform Console, the + * transfer's start time in a day is specified in your local timezone. + */ + startTimeOfDay: Schema$TimeOfDay; + } /** - * A Google Cloud Storage data source. - */ - gcsDataSource: Schema$GcsData; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * An HTTP URL data source. - */ - httpDataSource: Schema$HttpData; + * Represents a time of day. The date and time zone are either not significant + * or are specified elsewhere. An API may choose to allow leap seconds. + * Related types are google.type.Date and `google.protobuf.Timestamp`. + */ + export interface Schema$TimeOfDay { + /** + * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + * to allow the value "24:00:00" for scenarios like business + * closing time. + */ + hours: number; + /** + * Minutes of hour of day. Must be from 0 to 59. + */ + minutes: number; + /** + * Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + */ + nanos: number; + /** + * Seconds of minutes of the time. Must normally be from 0 to 59. An API may + * allow the value 60 if it allows leap-seconds. + */ + seconds: number; + } /** - * Only objects that satisfy these object conditions are included in the set - * of data source and data sink objects. Object conditions based on - * objects' `lastModificationTime` do not exclude objects in a data sink. - */ - objectConditions: Schema$ObjectConditions; + * A collection of counters that report the progress of a transfer operation. + */ + export interface Schema$TransferCounters { + /** + * Bytes that are copied to the data sink. + */ + bytesCopiedToSink: string; + /** + * Bytes that are deleted from the data sink. + */ + bytesDeletedFromSink: string; + /** + * Bytes that are deleted from the data source. + */ + bytesDeletedFromSource: string; + /** + * Bytes that failed to be deleted from the data sink. + */ + bytesFailedToDeleteFromSink: string; + /** + * Bytes found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + */ + bytesFoundFromSource: string; + /** + * Bytes found only in the data sink that are scheduled to be deleted. + */ + bytesFoundOnlyFromSink: string; + /** + * Bytes in the data source that failed to be transferred or that failed to + * be deleted after being transferred. + */ + bytesFromSourceFailed: string; + /** + * Bytes in the data source that are not transferred because they already + * exist in the data sink. + */ + bytesFromSourceSkippedBySync: string; + /** + * Objects that are copied to the data sink. + */ + objectsCopiedToSink: string; + /** + * Objects that are deleted from the data sink. + */ + objectsDeletedFromSink: string; + /** + * Objects that are deleted from the data source. + */ + objectsDeletedFromSource: string; + /** + * Objects that failed to be deleted from the data sink. + */ + objectsFailedToDeleteFromSink: string; + /** + * Objects found in the data source that are scheduled to be transferred, + * excluding any that are filtered based on object conditions or skipped due + * to sync. + */ + objectsFoundFromSource: string; + /** + * Objects found only in the data sink that are scheduled to be deleted. + */ + objectsFoundOnlyFromSink: string; + /** + * Objects in the data source that failed to be transferred or that failed + * to be deleted after being transferred. + */ + objectsFromSourceFailed: string; + /** + * Objects in the data source that are not transferred because they already + * exist in the data sink. + */ + objectsFromSourceSkippedBySync: string; + } /** - * If the option `deleteObjectsUniqueInSink` is `true`, object conditions - * based on objects' `lastModificationTime` are ignored and do not exclude - * objects in a data source or a data sink. - */ - transferOptions: Schema$TransferOptions; -} -/** - * Request passed to UpdateTransferJob. - */ -export interface Schema$UpdateTransferJobRequest { + * This resource represents the configuration of a transfer job that runs + * periodically. + */ + export interface Schema$TransferJob { + /** + * This field cannot be changed by user requests. + */ + creationTime: string; + /** + * This field cannot be changed by user requests. + */ + deletionTime: string; + /** + * A description provided by the user for the job. Its max length is 1024 + * bytes when Unicode-encoded. + */ + description: string; + /** + * This field cannot be changed by user requests. + */ + lastModificationTime: string; + /** + * A globally unique name assigned by Storage Transfer Service when the job + * is created. This field should be left empty in requests to create a new + * transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` + * error. + */ + name: string; + /** + * The ID of the Google Cloud Platform Console project that owns the job. + */ + projectId: string; + /** + * Schedule specification. + */ + schedule: Schema$Schedule; + /** + * Status of the job. This value MUST be specified for + * `CreateTransferJobRequests`. NOTE: The effect of the new job status + * takes place during a subsequent job run. For example, if you change the + * job status from `ENABLED` to `DISABLED`, and an operation spawned by the + * transfer is running, the status change would not affect the current + * operation. + */ + status: string; + /** + * Transfer specification. + */ + transferSpec: Schema$TransferSpec; + } /** - * The ID of the Google Cloud Platform Console project that owns the job. - * Required. - */ - projectId: string; + * A description of the execution of a transfer. + */ + export interface Schema$TransferOperation { + /** + * Information about the progress of the transfer operation. + */ + counters: Schema$TransferCounters; + /** + * End time of this transfer execution. + */ + endTime: string; + /** + * Summarizes errors encountered with sample error log entries. + */ + errorBreakdowns: Schema$ErrorSummary[]; + /** + * A globally unique ID assigned by the system. + */ + name: string; + /** + * The ID of the Google Cloud Platform Console project that owns the + * operation. Required. + */ + projectId: string; + /** + * Start time of this transfer execution. + */ + startTime: string; + /** + * Status of the transfer operation. + */ + status: string; + /** + * The name of the transfer job that triggers this transfer operation. + */ + transferJobName: string; + /** + * Transfer specification. Required. + */ + transferSpec: Schema$TransferSpec; + } /** - * The job to update. `transferJob` is expected to specify only three fields: - * `description`, `transferSpec`, and `status`. An UpdateTransferJobRequest - * that specifies other fields will be rejected with an error - * `INVALID_ARGUMENT`. Required. - */ - transferJob: Schema$TransferJob; + * TransferOptions uses three boolean parameters to define the actions to be + * performed on objects in a transfer. + */ + export interface Schema$TransferOptions { + /** + * Whether objects should be deleted from the source after they are + * transferred to the sink. Note that this option and + * `deleteObjectsUniqueInSink` are mutually exclusive. + */ + deleteObjectsFromSourceAfterTransfer: boolean; + /** + * Whether objects that exist only in the sink should be deleted. Note that + * this option and `deleteObjectsFromSourceAfterTransfer` are mutually + * exclusive. + */ + deleteObjectsUniqueInSink: boolean; + /** + * Whether overwriting objects that already exist in the sink is allowed. + */ + overwriteObjectsAlreadyExistingInSink: boolean; + } /** - * The field mask of the fields in `transferJob` that are to be updated in - * this request. Fields in `transferJob` that can be updated are: - * `description`, `transferSpec`, and `status`. To update the `transferSpec` - * of the job, a complete transfer specification has to be provided. An - * incomplete specification which misses any required fields will be rejected - * with the error `INVALID_ARGUMENT`. - */ - updateTransferJobFieldMask: string; -} - -export class Resource$Googleserviceaccounts { - root: Storagetransfer; - constructor(root: Storagetransfer) { - this.root = root; - this.getRoot.bind(this); + * Configuration for running a transfer. + */ + export interface Schema$TransferSpec { + /** + * An AWS S3 data source. + */ + awsS3DataSource: Schema$AwsS3Data; + /** + * A Google Cloud Storage data sink. + */ + gcsDataSink: Schema$GcsData; + /** + * A Google Cloud Storage data source. + */ + gcsDataSource: Schema$GcsData; + /** + * An HTTP URL data source. + */ + httpDataSource: Schema$HttpData; + /** + * Only objects that satisfy these object conditions are included in the set + * of data source and data sink objects. Object conditions based on + * objects' `lastModificationTime` do not exclude objects in a data + * sink. + */ + objectConditions: Schema$ObjectConditions; + /** + * If the option `deleteObjectsUniqueInSink` is `true`, object conditions + * based on objects' `lastModificationTime` are ignored and do not + * exclude objects in a data source or a data sink. + */ + transferOptions: Schema$TransferOptions; } - - getRoot() { - return this.root; + /** + * Request passed to UpdateTransferJob. + */ + export interface Schema$UpdateTransferJobRequest { + /** + * The ID of the Google Cloud Platform Console project that owns the job. + * Required. + */ + projectId: string; + /** + * The job to update. `transferJob` is expected to specify only three + * fields: `description`, `transferSpec`, and `status`. An + * UpdateTransferJobRequest that specifies other fields will be rejected + * with an error `INVALID_ARGUMENT`. Required. + */ + transferJob: Schema$TransferJob; + /** + * The field mask of the fields in `transferJob` that are to be updated in + * this request. Fields in `transferJob` that can be updated are: + * `description`, `transferSpec`, and `status`. To update the + * `transferSpec` of the job, a complete transfer specification has to be + * provided. An incomplete specification which misses any required fields + * will be rejected with the error `INVALID_ARGUMENT`. + */ + updateTransferJobFieldMask: string; } - - /** - * storagetransfer.googleServiceAccounts.get - * @desc Returns the Google service account that is used by Storage Transfer - * Service to access buckets in the project where transfers run or in other - * projects. Each Google service account is associated with one Google Cloud - * Platform Console project. Users should add this service account to the - * Google Cloud Storage bucket ACLs to grant access to Storage Transfer - * Service. This service account is created and owned by Storage Transfer - * Service and can only be used by Storage Transfer Service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The ID of the Google Cloud Platform Console project that the Google - * service - * // account is associated with. - * // Required. - * projectId: 'my-project-id', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * storagetransfer.googleServiceAccounts.get(request, function(err, - * response) { if (err) { console.error(err); return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.googleServiceAccounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The ID of the Google Cloud Platform Console project that the Google service account is associated with. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Googleserviceaccounts { + root: Storagetransfer; + constructor(root: Storagetransfer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/googleServiceAccounts/{projectId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Transferjobs { - root: Storagetransfer; - constructor(root: Storagetransfer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * storagetransfer.googleServiceAccounts.get + * @desc Returns the Google service account that is used by Storage Transfer + * Service to access buckets in the project where transfers run or in other + * projects. Each Google service account is associated with one Google Cloud + * Platform Console project. Users should add this service account to the + * Google Cloud Storage bucket ACLs to grant access to Storage Transfer + * Service. This service account is created and owned by Storage Transfer + * Service and can only be used by Storage Transfer Service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The ID of the Google Cloud Platform Console project that the + * Google service + * // account is associated with. + * // Required. + * projectId: 'my-project-id', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * storagetransfer.googleServiceAccounts.get(request, function(err, + * response) { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.googleServiceAccounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The ID of the Google Cloud Platform Console project that the Google service account is associated with. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/googleServiceAccounts/{projectId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * storagetransfer.transferJobs.create - * @desc Creates a transfer job that runs periodically. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storagetransfer.transferJobs.create(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferJobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().TransferJob} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Transferjobs { + root: Storagetransfer; + constructor(root: Storagetransfer) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * storagetransfer.transferJobs.get - * @desc Gets a transfer job. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The job to get. - * // Required. - * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder - * value. - * - * auth: authClient, - * }; - * - * storagetransfer.transferJobs.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferJobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobName The job to get. Required. - * @param {string=} params.projectId The ID of the Google Cloud Platform Console project that owns the job. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storagetransfer.transferJobs.create + * @desc Creates a transfer job that runs periodically. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storagetransfer.transferJobs.create(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferJobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().TransferJob} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+jobName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['jobName'], - pathParams: ['jobName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storagetransfer.transferJobs.list - * @desc Lists transfer jobs. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var transferJobsPage = response['transferJobs']; - * if (!transferJobsPage) { - * return; - * } - * for (var i = 0; i < transferJobsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `transferJobsPage`: console.log(JSON.stringify(transferJobsPage[i], null, - * 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storagetransfer.transferJobs.list(request, handlePage); - * } - * }; - * - * storagetransfer.transferJobs.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferJobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A list of query parameters specified as JSON text in the form of {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...], "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. - * @param {integer=} params.pageSize The list page size. The max allowed value is 256. - * @param {string=} params.pageToken The list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * storagetransfer.transferJobs.get + * @desc Gets a transfer job. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The job to get. + * // Required. + * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder + * value. + * + * auth: authClient, + * }; + * + * storagetransfer.transferJobs.get(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferJobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobName The job to get. Required. + * @param {string=} params.projectId The ID of the Google Cloud Platform Console project that owns the job. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+jobName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['jobName'], + pathParams: ['jobName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * storagetransfer.transferJobs.patch - * @desc Updates a transfer job. Updating a job's transfer spec does not - * affect transfer operations that are running already. Updating the - * scheduling of a job is not allowed. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of job to update. - * // Required. - * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder - * value. - * - * resource: { - * // TODO: Add desired properties to the request body. Only these - * properties - * // will be changed. - * }, - * - * auth: authClient, - * }; - * - * storagetransfer.transferJobs.patch(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferJobs.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobName The name of job to update. Required. - * @param {().UpdateTransferJobRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storagetransfer.transferJobs.list + * @desc Lists transfer jobs. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var transferJobsPage = response['transferJobs']; + * if (!transferJobsPage) { + * return; + * } + * for (var i = 0; i < transferJobsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `transferJobsPage`: console.log(JSON.stringify(transferJobsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * storagetransfer.transferJobs.list(request, handlePage); + * } + * }; + * + * storagetransfer.transferJobs.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferJobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A list of query parameters specified as JSON text in the form of {"project_id":"my_project_id", "job_names":["jobid1","jobid2",...], "job_statuses":["status1","status2",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. + * @param {integer=} params.pageSize The list page size. The max allowed value is 256. + * @param {string=} params.pageToken The list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/transferJobs').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+jobName}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['jobName'], - pathParams: ['jobName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Transferoperations { - root: Storagetransfer; - constructor(root: Storagetransfer) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * storagetransfer.transferJobs.patch + * @desc Updates a transfer job. Updating a job's transfer spec does not + * affect transfer operations that are running already. Updating the + * scheduling of a job is not allowed. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of job to update. + * // Required. + * jobName: 'transferJobs/my-transfer-job', // TODO: Update placeholder + * value. + * + * resource: { + * // TODO: Add desired properties to the request body. Only these + * properties + * // will be changed. + * }, + * + * auth: authClient, + * }; + * + * storagetransfer.transferJobs.patch(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferJobs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobName The name of job to update. Required. + * @param {().UpdateTransferJobRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+jobName}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['jobName'], + pathParams: ['jobName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * storagetransfer.transferOperations.cancel - * @desc Cancels a transfer. Use the get method to check whether the - * cancellation succeeded or whether the operation completed despite - * cancellation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be cancelled. - * name: 'transferOperations/my-transfer-operation', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * storagetransfer.transferOperations.cancel(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Transferoperations { + root: Storagetransfer; + constructor(root: Storagetransfer) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * storagetransfer.transferOperations.delete - * @desc This method is not supported and the server returns `UNIMPLEMENTED`. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource to be deleted. - * name: 'transferOperations/my-transfer-operation', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * storagetransfer.transferOperations.delete(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storagetransfer.transferOperations.cancel + * @desc Cancels a transfer. Use the get method to check whether the + * cancellation succeeded or whether the operation completed despite + * cancellation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be cancelled. + * name: 'transferOperations/my-transfer-operation', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * storagetransfer.transferOperations.cancel(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storagetransfer.transferOperations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the operation resource. - * name: 'transferOperations/my-transfer-operation', // TODO: Update - * placeholder value. - * - * auth: authClient, - * }; - * - * storagetransfer.transferOperations.get(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storagetransfer.transferOperations.delete + * @desc This method is not supported and the server returns + * `UNIMPLEMENTED`. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource to be deleted. + * name: 'transferOperations/my-transfer-operation', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * storagetransfer.transferOperations.delete(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storagetransfer.transferOperations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The value `transferOperations`. - * name: 'transferOperations', // TODO: Update placeholder value. - * - * auth: authClient, - * }; - * - * var handlePage = function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * var operationsPage = response['operations']; - * if (!operationsPage) { - * return; - * } - * for (var i = 0; i < operationsPage.length; i++) { - * // TODO: Change code below to process each resource in - * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, 2)); - * } - * - * if (response.nextPageToken) { - * request.pageToken = response.nextPageToken; - * storagetransfer.transferOperations.list(request, handlePage); - * } - * }; - * - * storagetransfer.transferOperations.list(request, handlePage); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter A list of query parameters specified as JSON text in the form of {\"project_id\" : \"my_project_id\", \"job_names\" : [\"jobid1\", \"jobid2\",...], \"operation_names\" : [\"opid1\", \"opid2\",...], \"transfer_statuses\":[\"status1\", \"status2\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `job_names`, `operation_names`, and `transfer_statuses` are optional. - * @param {string} params.name The value `transferOperations`. - * @param {integer=} params.pageSize The list page size. The max allowed value is 256. - * @param {string=} params.pageToken The list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storagetransfer.transferOperations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the operation resource. + * name: 'transferOperations/my-transfer-operation', // TODO: Update + * placeholder value. + * + * auth: authClient, + * }; + * + * storagetransfer.transferOperations.get(request, function(err, response) + * { if (err) { console.error(err); return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storagetransfer.transferOperations.pause - * @desc Pauses a transfer operation. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the transfer operation. - * // Required. - * name: 'transferOperations/my-transfer-operation', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storagetransfer.transferOperations.pause(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.pause - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the transfer operation. Required. - * @param {().PauseTransferOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - pause(params?: any, options?: MethodOptions): AxiosPromise; - pause( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - pause( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * storagetransfer.transferOperations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The value `transferOperations`. + * name: 'transferOperations', // TODO: Update placeholder value. + * + * auth: authClient, + * }; + * + * var handlePage = function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * var operationsPage = response['operations']; + * if (!operationsPage) { + * return; + * } + * for (var i = 0; i < operationsPage.length; i++) { + * // TODO: Change code below to process each resource in + * `operationsPage`: console.log(JSON.stringify(operationsPage[i], null, + * 2)); + * } + * + * if (response.nextPageToken) { + * request.pageToken = response.nextPageToken; + * storagetransfer.transferOperations.list(request, handlePage); + * } + * }; + * + * storagetransfer.transferOperations.list(request, handlePage); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter A list of query parameters specified as JSON text in the form of {\"project_id\" : \"my_project_id\", \"job_names\" : [\"jobid1\", \"jobid2\",...], \"operation_names\" : [\"opid1\", \"opid2\",...], \"transfer_statuses\":[\"status1\", \"status2\",...]}. Since `job_names`, `operation_names`, and `transfer_statuses` support multiple values, they must be specified with array notation. `job_names`, `operation_names`, and `transfer_statuses` are optional. + * @param {string} params.name The value `transferOperations`. + * @param {integer=} params.pageSize The list page size. The max allowed value is 256. + * @param {string=} params.pageToken The list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:pause').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * storagetransfer.transferOperations.resume - * @desc Resumes a transfer operation that is paused. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Storage Transfer API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/storagetransfer - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var storagetransfer = google.storagetransfer('v1'); - * - * authorize(function(authClient) { - * var request = { - * // The name of the transfer operation. - * // Required. - * name: 'transferOperations/my-transfer-operation', // TODO: Update - * placeholder value. - * - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * storagetransfer.transferOperations.resume(request, function(err) { - * if (err) { - * console.error(err); - * return; - * } - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias storagetransfer.transferOperations.resume - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the transfer operation. Required. - * @param {().ResumeTransferOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resume(params?: any, options?: MethodOptions): AxiosPromise; - resume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resume( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * storagetransfer.transferOperations.pause + * @desc Pauses a transfer operation. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the transfer operation. + * // Required. + * name: 'transferOperations/my-transfer-operation', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storagetransfer.transferOperations.pause(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.pause + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the transfer operation. Required. + * @param {().PauseTransferOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + pause(params?: any, options?: MethodOptions): AxiosPromise; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + pause( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1/{+name}:pause').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://storagetransfer.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:resume').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * storagetransfer.transferOperations.resume + * @desc Resumes a transfer operation that is paused. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Storage Transfer API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/storagetransfer + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var storagetransfer = google.storagetransfer('v1'); + * + * authorize(function(authClient) { + * var request = { + * // The name of the transfer operation. + * // Required. + * name: 'transferOperations/my-transfer-operation', // TODO: Update + * placeholder value. + * + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * storagetransfer.transferOperations.resume(request, function(err) { + * if (err) { + * console.error(err); + * return; + * } + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias storagetransfer.transferOperations.resume + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the transfer operation. Required. + * @param {().ResumeTransferOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resume(params?: any, options?: MethodOptions): AxiosPromise; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resume( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://storagetransfer.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:resume') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/streetviewpublish/v1.ts b/src/apis/streetviewpublish/v1.ts index 2f112f338b7..56f6f9ece79 100644 --- a/src/apis/streetviewpublish/v1.ts +++ b/src/apis/streetviewpublish/v1.ts @@ -27,987 +27,1010 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Street View Publish API - * - * Publishes 360 photos to Google Maps, along with position, orientation, and - * connectivity metadata. Apps can offer an interface for positioning, - * connecting, and uploading user-generated Street View images. - * - * @example - * const google = require('googleapis'); - * const streetviewpublish = google.streetviewpublish('v1'); - * - * @namespace streetviewpublish - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Streetviewpublish - */ -export class Streetviewpublish { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace streetviewpublish_v1 { + /** + * Street View Publish API + * + * Publishes 360 photos to Google Maps, along with position, orientation, and + * connectivity metadata. Apps can offer an interface for positioning, + * connecting, and uploading user-generated Street View images. + * + * @example + * const google = require('googleapis'); + * const streetviewpublish = google.streetviewpublish('v1'); + * + * @namespace streetviewpublish + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Streetviewpublish + */ + export class Streetviewpublish { + _options: GlobalOptions; + google: GoogleApis; + root = this; - photo: Resource$Photo; - photos: Resource$Photos; + photo: Resource$Photo; + photos: Resource$Photos; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.photo = new Resource$Photo(this); - this.photos = new Resource$Photos(this); - } + this.photo = new Resource$Photo(this); + this.photos = new Resource$Photos(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request to delete multiple Photos. - */ -export interface Schema$BatchDeletePhotosRequest { - /** - * Required. IDs of the Photos. For HTTP GET requests, the URL query parameter - * should be `photoIds=<id1>&photoIds=<id2>&...`. - */ - photoIds: string[]; -} -/** - * Response to batch delete of one or more Photos. - */ -export interface Schema$BatchDeletePhotosResponse { - /** - * The status for the operation to delete a single Photo in the batch request. - */ - status: Schema$Status[]; -} -/** - * Response to batch get of Photos. - */ -export interface Schema$BatchGetPhotosResponse { - /** - * List of results for each individual Photo requested, in the same order as - * the requests in BatchGetPhotos. - */ - results: Schema$PhotoResponse[]; -} -/** - * Request to update the metadata of photos. Updating the pixels of photos is - * not supported. - */ -export interface Schema$BatchUpdatePhotosRequest { - /** - * Required. List of UpdatePhotoRequests. - */ - updatePhotoRequests: Schema$UpdatePhotoRequest[]; -} -/** - * Response to batch update of metadata of one or more Photos. - */ -export interface Schema$BatchUpdatePhotosResponse { - /** - * List of results for each individual Photo updated, in the same order as the - * request. - */ - results: Schema$PhotoResponse[]; -} -/** - * A connection is the link from a source photo to a destination photo. - */ -export interface Schema$Connection { - /** - * Required. The destination of the connection from the containing photo to - * another photo. - */ - target: Schema$PhotoId; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. + * Request to delete multiple Photos. */ - longitude: number; -} -/** - * Level information containing level number and its corresponding name. - */ -export interface Schema$Level { - /** - * Required. A name assigned to this Level, restricted to 3 characters. - * Consider how the elevator buttons would be labeled for this level if there - * was an elevator. - */ - name: string; - /** - * Floor number, used for ordering. 0 indicates the ground level, 1 indicates - * the first level above ground level, -1 indicates the first level under - * ground level. Non-integer values are OK. - */ - number: number; -} -/** - * Response to list all photos that belong to a user. - */ -export interface Schema$ListPhotosResponse { - /** - * Token to retrieve the next page of results, or empty if there are no more - * results in the list. - */ - nextPageToken: string; - /** - * List of photos. The maximum number of items returned is based on the - * pageSize field in the request. - */ - photos: Schema$Photo[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; - /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Photo is used to store 360 photos along with photo metadata. - */ -export interface Schema$Photo { - /** - * Absolute time when the photo was captured. When the photo has no exif - * timestamp, this is used to set a timestamp in the photo metadata. - */ - captureTime: string; - /** - * Connections to other photos. A connection represents the link from this - * photo to another photo. - */ - connections: Schema$Connection[]; - /** - * Output only. The download URL for the photo bytes. This field is set only - * when GetPhotoRequest.view is set to PhotoView.INCLUDE_DOWNLOAD_URL. - */ - downloadUrl: string; - /** - * Required when updating a photo. Output only when creating a photo. - * Identifier for the photo, which is unique among all photos in Google. - */ - photoId: Schema$PhotoId; - /** - * Places where this photo belongs. - */ - places: Schema$Place[]; - /** - * Pose of the photo. - */ - pose: Schema$Pose; - /** - * Output only. The share link for the photo. - */ - shareLink: string; - /** - * Output only. The thumbnail URL for showing a preview of the given photo. - */ - thumbnailUrl: string; + export interface Schema$BatchDeletePhotosRequest { + /** + * Required. IDs of the Photos. For HTTP GET requests, the URL query + * parameter should be + * `photoIds=<id1>&photoIds=<id2>&...`. + */ + photoIds: string[]; + } /** - * Required when creating a photo. Input only. The resource URL where the - * photo bytes are uploaded to. + * Response to batch delete of one or more Photos. */ - uploadReference: Schema$UploadRef; + export interface Schema$BatchDeletePhotosResponse { + /** + * The status for the operation to delete a single Photo in the batch + * request. + */ + status: Schema$Status[]; + } /** - * Output only. View count of the photo. + * Response to batch get of Photos. */ - viewCount: string; -} -/** - * Identifier for a Photo. - */ -export interface Schema$PhotoId { + export interface Schema$BatchGetPhotosResponse { + /** + * List of results for each individual Photo requested, in the same order as + * the requests in BatchGetPhotos. + */ + results: Schema$PhotoResponse[]; + } /** - * Required. A unique identifier for a photo. + * Request to update the metadata of photos. Updating the pixels of photos is + * not supported. */ - id: string; -} -/** - * Response payload for a single Photo in batch operations including - * BatchGetPhotos and BatchUpdatePhotos. - */ -export interface Schema$PhotoResponse { + export interface Schema$BatchUpdatePhotosRequest { + /** + * Required. List of UpdatePhotoRequests. + */ + updatePhotoRequests: Schema$UpdatePhotoRequest[]; + } /** - * The Photo resource, if the request was successful. + * Response to batch update of metadata of one or more Photos. */ - photo: Schema$Photo; + export interface Schema$BatchUpdatePhotosResponse { + /** + * List of results for each individual Photo updated, in the same order as + * the request. + */ + results: Schema$PhotoResponse[]; + } /** - * The status for the operation to get or update a single photo in the batch - * request. + * A connection is the link from a source photo to a destination photo. */ - status: Schema$Status; -} -/** - * Place metadata for an entity. - */ -export interface Schema$Place { + export interface Schema$Connection { + /** + * Required. The destination of the connection from the containing photo to + * another photo. + */ + target: Schema$PhotoId; + } /** - * Place identifier, as described in - * https://developers.google.com/places/place-id. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - placeId: string; -} -/** - * Raw pose measurement for an entity. - */ -export interface Schema$Pose { + export interface Schema$Empty {} /** - * Altitude of the pose in meters above WGS84 ellipsoid. NaN indicates an - * unmeasured quantity. + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. */ - altitude: number; + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * Compass heading, measured at the center of the photo in degrees clockwise - * from North. Value must be >=0 and <360. NaN indicates an unmeasured - * quantity. + * Level information containing level number and its corresponding name. */ - heading: number; + export interface Schema$Level { + /** + * Required. A name assigned to this Level, restricted to 3 characters. + * Consider how the elevator buttons would be labeled for this level if + * there was an elevator. + */ + name: string; + /** + * Floor number, used for ordering. 0 indicates the ground level, 1 + * indicates the first level above ground level, -1 indicates the first + * level under ground level. Non-integer values are OK. + */ + number: number; + } /** - * Latitude and longitude pair of the pose, as explained here: - * https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng - * When creating a Photo, if the latitude and longitude pair are not provided - * here, the geolocation from the exif header will be used. If the latitude - * and longitude pair is not provided and cannot be found in the exif header, - * the create photo process will fail. + * Response to list all photos that belong to a user. */ - latLngPair: Schema$LatLng; + export interface Schema$ListPhotosResponse { + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + /** + * List of photos. The maximum number of items returned is based on the + * pageSize field in the request. + */ + photos: Schema$Photo[]; + } /** - * Level (the floor in a building) used to configure vertical navigation. + * This resource represents a long-running operation that is the result of a + * network API call. */ - level: Schema$Level; + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Pitch, measured at the center of the photo in degrees. Value must be - * >=-90 and <= 90. A value of -90 means looking directly down, and a - * value of 90 means looking directly up. NaN indicates an unmeasured - * quantity. + * Photo is used to store 360 photos along with photo metadata. */ - pitch: number; + export interface Schema$Photo { + /** + * Absolute time when the photo was captured. When the photo has no exif + * timestamp, this is used to set a timestamp in the photo metadata. + */ + captureTime: string; + /** + * Connections to other photos. A connection represents the link from this + * photo to another photo. + */ + connections: Schema$Connection[]; + /** + * Output only. The download URL for the photo bytes. This field is set only + * when GetPhotoRequest.view is set to PhotoView.INCLUDE_DOWNLOAD_URL. + */ + downloadUrl: string; + /** + * Required when updating a photo. Output only when creating a photo. + * Identifier for the photo, which is unique among all photos in Google. + */ + photoId: Schema$PhotoId; + /** + * Places where this photo belongs. + */ + places: Schema$Place[]; + /** + * Pose of the photo. + */ + pose: Schema$Pose; + /** + * Output only. The share link for the photo. + */ + shareLink: string; + /** + * Output only. The thumbnail URL for showing a preview of the given photo. + */ + thumbnailUrl: string; + /** + * Required when creating a photo. Input only. The resource URL where the + * photo bytes are uploaded to. + */ + uploadReference: Schema$UploadRef; + /** + * Output only. View count of the photo. + */ + viewCount: string; + } /** - * Roll, measured in degrees. Value must be >= 0 and <360. A value of 0 - * means level with the horizon. NaN indicates an unmeasured quantity. + * Identifier for a Photo. */ - roll: number; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + export interface Schema$PhotoId { + /** + * Required. A unique identifier for a photo. + */ + id: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * Response payload for a single Photo in batch operations including + * BatchGetPhotos and BatchUpdatePhotos. */ - code: number; + export interface Schema$PhotoResponse { + /** + * The Photo resource, if the request was successful. + */ + photo: Schema$Photo; + /** + * The status for the operation to get or update a single photo in the batch + * request. + */ + status: Schema$Status; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Place metadata for an entity. */ - details: any[]; + export interface Schema$Place { + /** + * Place identifier, as described in + * https://developers.google.com/places/place-id. + */ + placeId: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. + * Raw pose measurement for an entity. */ - message: string; -} -/** - * Request to update the metadata of a Photo. Updating the pixels of a photo is - * not supported. - */ -export interface Schema$UpdatePhotoRequest { + export interface Schema$Pose { + /** + * Altitude of the pose in meters above WGS84 ellipsoid. NaN indicates an + * unmeasured quantity. + */ + altitude: number; + /** + * Compass heading, measured at the center of the photo in degrees clockwise + * from North. Value must be >=0 and <360. NaN indicates an unmeasured + * quantity. + */ + heading: number; + /** + * Latitude and longitude pair of the pose, as explained here: + * https://cloud.google.com/datastore/docs/reference/rest/Shared.Types/LatLng + * When creating a Photo, if the latitude and longitude pair are not + * provided here, the geolocation from the exif header will be used. If the + * latitude and longitude pair is not provided and cannot be found in the + * exif header, the create photo process will fail. + */ + latLngPair: Schema$LatLng; + /** + * Level (the floor in a building) used to configure vertical navigation. + */ + level: Schema$Level; + /** + * Pitch, measured at the center of the photo in degrees. Value must be + * >=-90 and <= 90. A value of -90 means looking directly down, and a + * value of 90 means looking directly up. NaN indicates an unmeasured + * quantity. + */ + pitch: number; + /** + * Roll, measured in degrees. Value must be >= 0 and <360. A value of + * 0 means level with the horizon. NaN indicates an unmeasured quantity. + */ + roll: number; + } /** - * Required. Photo object containing the new metadata. + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. */ - photo: Schema$Photo; + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * Mask that identifies fields on the photo metadata to update. If not - * present, the old Photo metadata will be entirely replaced with the new - * Photo metadata in this request. The update fails if invalid fields are - * specified. Multiple fields can be specified in a comma-delimited list. The - * following fields are valid: * `pose.heading` * `pose.latLngPair` * - * `pose.pitch` * `pose.roll` * `pose.level` * `pose.altitude` * `connections` - * * `places` <aside class="note"><b>Note:</b> - * Repeated fields in updateMask mean the entire set of repeated values will - * be replaced with the new contents. For example, if updateMask contains - * `connections` and `UpdatePhotoRequest.photo.connections` is empty, all - * connections will be removed.</aside> + * Request to update the metadata of a Photo. Updating the pixels of a photo + * is not supported. */ - updateMask: string; -} -/** - * Upload reference for media files. - */ -export interface Schema$UploadRef { + export interface Schema$UpdatePhotoRequest { + /** + * Required. Photo object containing the new metadata. + */ + photo: Schema$Photo; + /** + * Mask that identifies fields on the photo metadata to update. If not + * present, the old Photo metadata will be entirely replaced with the new + * Photo metadata in this request. The update fails if invalid fields are + * specified. Multiple fields can be specified in a comma-delimited list. + * The following fields are valid: * `pose.heading` * `pose.latLngPair` * + * `pose.pitch` * `pose.roll` * `pose.level` * `pose.altitude` * + * `connections` * `places` <aside + * class="note"><b>Note:</b> Repeated fields in + * updateMask mean the entire set of repeated values will be replaced with + * the new contents. For example, if updateMask contains `connections` and + * `UpdatePhotoRequest.photo.connections` is empty, all connections will be + * removed.</aside> + */ + updateMask: string; + } /** - * Required. An upload reference should be unique for each user. It follows - * the form: - * "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{upload_reference}" + * Upload reference for media files. */ - uploadUrl: string; -} - -export class Resource$Photo { - root: Streetviewpublish; - constructor(root: Streetviewpublish) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$UploadRef { + /** + * Required. An upload reference should be unique for each user. It follows + * the form: + * "https://streetviewpublish.googleapis.com/media/user/{account_id}/photo/{upload_reference}" + */ + uploadUrl: string; } - getRoot() { - return this.root; - } - - - /** - * streetviewpublish.photo.create - * @desc After the client finishes uploading the photo with the returned - * UploadRef, CreatePhoto publishes the uploaded Photo to Street View on - * Google Maps. Currently, the only way to set heading, pitch, and roll in - * CreatePhoto is through the [Photo Sphere XMP - * metadata](https://developers.google.com/streetview/spherical-metadata) in - * the photo bytes. The `pose.heading`, `pose.pitch`, `pose.roll`, - * `pose.altitude`, and `pose.level` fields in Pose are ignored for - * CreatePhoto. This method returns the following error codes: * - * google.rpc.Code.INVALID_ARGUMENT if the request is malformed or if the - * uploaded photo is not a 360 photo. * google.rpc.Code.NOT_FOUND if the - * upload reference does not exist. * google.rpc.Code.RESOURCE_EXHAUSTED if - * the account has reached the storage limit. - * @alias streetviewpublish.photo.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Photo} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Photo { + root: Streetviewpublish; + constructor(root: Streetviewpublish) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photo').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * streetviewpublish.photo.delete - * @desc Deletes a Photo and its metadata. This method returns the following - * error codes: * google.rpc.Code.PERMISSION_DENIED if the requesting user - * did not create the requested photo. * google.rpc.Code.NOT_FOUND if the - * photo ID does not exist. - * @alias streetviewpublish.photo.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.photoId Required. ID of the Photo. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * streetviewpublish.photo.create + * @desc After the client finishes uploading the photo with the returned + * UploadRef, CreatePhoto publishes the uploaded Photo to Street View on + * Google Maps. Currently, the only way to set heading, pitch, and roll in + * CreatePhoto is through the [Photo Sphere XMP + * metadata](https://developers.google.com/streetview/spherical-metadata) in + * the photo bytes. The `pose.heading`, `pose.pitch`, `pose.roll`, + * `pose.altitude`, and `pose.level` fields in Pose are ignored for + * CreatePhoto. This method returns the following error codes: * + * google.rpc.Code.INVALID_ARGUMENT if the request is malformed or if the + * uploaded photo is not a 360 photo. * google.rpc.Code.NOT_FOUND if the + * upload reference does not exist. * google.rpc.Code.RESOURCE_EXHAUSTED if + * the account has reached the storage limit. + * @alias streetviewpublish.photo.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Photo} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photo').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/photo/{photoId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['photoId'], - pathParams: ['photoId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * streetviewpublish.photo.get - * @desc Gets the metadata of the specified Photo. This method returns the - * following error codes: * google.rpc.Code.PERMISSION_DENIED if the - * requesting user did not create the requested Photo. * - * google.rpc.Code.NOT_FOUND if the requested Photo does not exist. * - * google.rpc.Code.UNAVAILABLE if the requested Photo is still being indexed. - * @alias streetviewpublish.photo.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.photoId Required. ID of the Photo. - * @param {string=} params.view Specifies if a download URL for the photo bytes should be returned in the Photo response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * streetviewpublish.photo.delete + * @desc Deletes a Photo and its metadata. This method returns the + * following error codes: * google.rpc.Code.PERMISSION_DENIED if the + * requesting user did not create the requested photo. * + * google.rpc.Code.NOT_FOUND if the photo ID does not exist. + * @alias streetviewpublish.photo.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.photoId Required. ID of the Photo. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photo/{photoId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['photoId'], + pathParams: ['photoId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/photo/{photoId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['photoId'], - pathParams: ['photoId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * streetviewpublish.photo.startUpload - * @desc Creates an upload session to start uploading photo bytes. The upload - * URL of the returned UploadRef is used to upload the bytes for the Photo. In - * addition to the photo requirements shown in - * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, the - * photo must also meet the following requirements: * Photo Sphere XMP - * metadata must be included in the photo medadata. See - * https://developers.google.com/streetview/spherical-metadata for the - * required fields. * The pixel size of the photo must meet the size - * requirements listed in - * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, and - * the photo must be a full 360 horizontally. After the upload is complete, - * the UploadRef is used with CreatePhoto to create the Photo object entry. - * @alias streetviewpublish.photo.startUpload - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Empty} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - startUpload(params?: any, options?: MethodOptions): - AxiosPromise; - startUpload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - startUpload( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * streetviewpublish.photo.get + * @desc Gets the metadata of the specified Photo. This method returns the + * following error codes: * google.rpc.Code.PERMISSION_DENIED if the + * requesting user did not create the requested Photo. * + * google.rpc.Code.NOT_FOUND if the requested Photo does not exist. * + * google.rpc.Code.UNAVAILABLE if the requested Photo is still being + * indexed. + * @alias streetviewpublish.photo.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.photoId Required. ID of the Photo. + * @param {string=} params.view Specifies if a download URL for the photo bytes should be returned in the Photo response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photo/{photoId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['photoId'], + pathParams: ['photoId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photo:startUpload') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * streetviewpublish.photo.update - * @desc Updates the metadata of a Photo, such as pose, place association, - * connections, etc. Changing the pixels of a photo is not supported. Only - * the fields specified in the updateMask field are used. If `updateMask` is - * not present, the update applies to all fields. This method - * returns the following error codes: * google.rpc.Code.PERMISSION_DENIED if - * the requesting user did not create the requested photo. * - * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. * - * google.rpc.Code.NOT_FOUND if the requested photo does not exist. * - * google.rpc.Code.UNAVAILABLE if the requested Photo is still being indexed. - * @alias streetviewpublish.photo.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id Required. A unique identifier for a photo. - * @param {string=} params.updateMask Mask that identifies fields on the photo metadata to update. If not present, the old Photo metadata will be entirely replaced with the new Photo metadata in this request. The update fails if invalid fields are specified. Multiple fields can be specified in a comma-delimited list. The following fields are valid: * `pose.heading` * `pose.latLngPair` * `pose.pitch` * `pose.roll` * `pose.level` * `pose.altitude` * `connections` * `places` - * @param {().Photo} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * streetviewpublish.photo.startUpload + * @desc Creates an upload session to start uploading photo bytes. The + * upload URL of the returned UploadRef is used to upload the bytes for the + * Photo. In addition to the photo requirements shown in + * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, + * the photo must also meet the following requirements: * Photo Sphere XMP + * metadata must be included in the photo medadata. See + * https://developers.google.com/streetview/spherical-metadata for the + * required fields. * The pixel size of the photo must meet the size + * requirements listed in + * https://support.google.com/maps/answer/7012050?hl=en&ref_topic=6275604, + * and the photo must be a full 360 horizontally. After the upload is + * complete, the UploadRef is used with CreatePhoto to create the Photo + * object entry. + * @alias streetviewpublish.photo.startUpload + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Empty} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + startUpload(params?: any, options?: MethodOptions): + AxiosPromise; + startUpload( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + startUpload( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photo:startUpload') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photo/{id}').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Photos { - root: Streetviewpublish; - constructor(root: Streetviewpublish) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * streetviewpublish.photo.update + * @desc Updates the metadata of a Photo, such as pose, place association, + * connections, etc. Changing the pixels of a photo is not supported. Only + * the fields specified in the updateMask field are used. If `updateMask` is + * not present, the update applies to all fields. This method + * returns the following error codes: * google.rpc.Code.PERMISSION_DENIED + * if the requesting user did not create the requested photo. * + * google.rpc.Code.INVALID_ARGUMENT if the request is malformed. * + * google.rpc.Code.NOT_FOUND if the requested photo does not exist. * + * google.rpc.Code.UNAVAILABLE if the requested Photo is still being + * indexed. + * @alias streetviewpublish.photo.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id Required. A unique identifier for a photo. + * @param {string=} params.updateMask Mask that identifies fields on the photo metadata to update. If not present, the old Photo metadata will be entirely replaced with the new Photo metadata in this request. The update fails if invalid fields are specified. Multiple fields can be specified in a comma-delimited list. The following fields are valid: * `pose.heading` * `pose.latLngPair` * `pose.pitch` * `pose.roll` * `pose.level` * `pose.altitude` * `connections` * `places` + * @param {().Photo} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photo/{id}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * streetviewpublish.photos.batchDelete - * @desc Deletes a list of Photos and their metadata. Note that if - * BatchDeletePhotos fails, either critical fields are missing or there was an - * authentication error. Even if BatchDeletePhotos succeeds, there may have - * been failures for single photos in the batch. These failures will be - * specified in each PhotoResponse.status in - * BatchDeletePhotosResponse.results. See DeletePhoto for specific failures - * that can occur per photo. - * @alias streetviewpublish.photos.batchDelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BatchDeletePhotosRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchDelete(params?: any, options?: MethodOptions): - AxiosPromise; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchDelete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Photos { + root: Streetviewpublish; + constructor(root: Streetviewpublish) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photos:batchDelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * streetviewpublish.photos.batchGet - * @desc Gets the metadata of the specified Photo batch. Note that if - * BatchGetPhotos fails, either critical fields are missing or there was an - * authentication error. Even if BatchGetPhotos succeeds, there may have been - * failures for single photos in the batch. These failures will be specified - * in each PhotoResponse.status in BatchGetPhotosResponse.results. See - * GetPhoto for specific failures that can occur per photo. - * @alias streetviewpublish.photos.batchGet - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.photoIds Required. IDs of the Photos. For HTTP GET requests, the URL query parameter should be `photoIds=&photoIds=&...`. - * @param {string=} params.view Specifies if a download URL for the photo bytes should be returned in the Photo response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchGet(params?: any, options?: MethodOptions): - AxiosPromise; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchGet( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * streetviewpublish.photos.batchDelete + * @desc Deletes a list of Photos and their metadata. Note that if + * BatchDeletePhotos fails, either critical fields are missing or there was + * an authentication error. Even if BatchDeletePhotos succeeds, there may + * have been failures for single photos in the batch. These failures will be + * specified in each PhotoResponse.status in + * BatchDeletePhotosResponse.results. See DeletePhoto for specific failures + * that can occur per photo. + * @alias streetviewpublish.photos.batchDelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BatchDeletePhotosRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchDelete(params?: any, options?: MethodOptions): + AxiosPromise; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchDelete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photos:batchDelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/photos:batchGet').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * streetviewpublish.photos.batchUpdate - * @desc Updates the metadata of Photos, such as pose, place association, - * connections, etc. Changing the pixels of photos is not supported. Note - * that if BatchUpdatePhotos fails, either critical fields are missing or - * there was an authentication error. Even if BatchUpdatePhotos succeeds, - * there may have been failures for single photos in the batch. These failures - * will be specified in each PhotoResponse.status in - * BatchUpdatePhotosResponse.results. See UpdatePhoto for specific failures - * that can occur per photo. Only the fields specified in updateMask field - * are used. If `updateMask` is not present, the update applies to all fields. - * - * @alias streetviewpublish.photos.batchUpdate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BatchUpdatePhotosRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchUpdate(params?: any, options?: MethodOptions): - AxiosPromise; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - batchUpdate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * streetviewpublish.photos.batchGet + * @desc Gets the metadata of the specified Photo batch. Note that if + * BatchGetPhotos fails, either critical fields are missing or there was an + * authentication error. Even if BatchGetPhotos succeeds, there may have + * been failures for single photos in the batch. These failures will be + * specified in each PhotoResponse.status in BatchGetPhotosResponse.results. + * See GetPhoto for specific failures that can occur per photo. + * @alias streetviewpublish.photos.batchGet + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.photoIds Required. IDs of the Photos. For HTTP GET requests, the URL query parameter should be `photoIds=&photoIds=&...`. + * @param {string=} params.view Specifies if a download URL for the photo bytes should be returned in the Photo response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchGet(params?: any, options?: MethodOptions): + AxiosPromise; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + batchGet( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photos:batchGet') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photos:batchUpdate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * streetviewpublish.photos.list - * @desc Lists all the Photos that belong to the user. - * @alias streetviewpublish.photos.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. The only filter supported at the moment is `placeId`. - * @param {integer=} params.pageSize The maximum number of photos to return. `pageSize` must be non-negative. If `pageSize` is zero or is not provided, the default page size of 100 will be used. The number of photos returned in the response may be less than `pageSize` if the number of photos that belong to the user is less than `pageSize`. - * @param {string=} params.pageToken The nextPageToken value returned from a previous ListPhotos request, if any. - * @param {string=} params.view Specifies if a download URL for the photos bytes should be returned in the Photos response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * streetviewpublish.photos.batchUpdate + * @desc Updates the metadata of Photos, such as pose, place association, + * connections, etc. Changing the pixels of photos is not supported. Note + * that if BatchUpdatePhotos fails, either critical fields are missing or + * there was an authentication error. Even if BatchUpdatePhotos succeeds, + * there may have been failures for single photos in the batch. These + * failures will be specified in each PhotoResponse.status in + * BatchUpdatePhotosResponse.results. See UpdatePhoto for specific failures + * that can occur per photo. Only the fields specified in updateMask field + * are used. If `updateMask` is not present, the update applies to all + * fields. + * @alias streetviewpublish.photos.batchUpdate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BatchUpdatePhotosRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchUpdate(params?: any, options?: MethodOptions): + AxiosPromise; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchUpdate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photos:batchUpdate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://streetviewpublish.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/photos').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * streetviewpublish.photos.list + * @desc Lists all the Photos that belong to the user. + * @alias streetviewpublish.photos.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The filter expression. For example: `placeId=ChIJj61dQgK6j4AR4GeTYWZsKWw`. The only filter supported at the moment is `placeId`. + * @param {integer=} params.pageSize The maximum number of photos to return. `pageSize` must be non-negative. If `pageSize` is zero or is not provided, the default page size of 100 will be used. The number of photos returned in the response may be less than `pageSize` if the number of photos that belong to the user is less than `pageSize`. + * @param {string=} params.pageToken The nextPageToken value returned from a previous ListPhotos request, if any. + * @param {string=} params.view Specifies if a download URL for the photos bytes should be returned in the Photos response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://streetviewpublish.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/photos').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/surveys/v2.ts b/src/apis/surveys/v2.ts index 1a38862593c..259bdd32fe0 100644 --- a/src/apis/surveys/v2.ts +++ b/src/apis/surveys/v2.ts @@ -27,1063 +27,1080 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Surveys API - * - * Creates and conducts surveys, lists the surveys that an authenticated user - * owns, and retrieves survey results and information about specified surveys. - * - * @example - * const google = require('googleapis'); - * const surveys = google.surveys('v2'); - * - * @namespace surveys - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Surveys - */ -export class Surveys { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace surveys_v2 { + /** + * Surveys API + * + * Creates and conducts surveys, lists the surveys that an authenticated user + * owns, and retrieves survey results and information about specified surveys. + * + * @example + * const google = require('googleapis'); + * const surveys = google.surveys('v2'); + * + * @namespace surveys + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Surveys + */ + export class Surveys { + _options: GlobalOptions; + google: GoogleApis; + root = this; - mobileapppanels: Resource$Mobileapppanels; - results: Resource$Results; - surveys: Resource$Surveys; + mobileapppanels: Resource$Mobileapppanels; + results: Resource$Results; + surveys: Resource$Surveys; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.mobileapppanels = new Resource$Mobileapppanels(this); - this.results = new Resource$Results(this); - this.surveys = new Resource$Surveys(this); - } + this.mobileapppanels = new Resource$Mobileapppanels(this); + this.results = new Resource$Results(this); + this.surveys = new Resource$Surveys(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$FieldMask { - fields: Schema$FieldMask[]; - id: number; -} -/** - * Representation of an individual pre-defined panel object defining a targeted - * audience of opinion rewards mobile app users. - */ -export interface Schema$MobileAppPanel { - /** - * Country code for the country of the users that the panel contains. Uses - * standard ISO 3166-1 2-character language codes. For instance, 'US' - * for the United States, and 'GB' for the United Kingdom. Any survey - * created targeting this panel must also target the corresponding country. - */ - country: string; - /** - * Whether or not the panel is accessible to all API users. - */ - isPublicPanel: boolean; - /** - * Language code that the panel can target. For instance, 'en-US'. - * Uses standard BCP47 language codes. See specification. Any survey created - * targeting this panel must also target the corresponding language. - */ - language: string; - /** - * Unique panel ID string. This corresponds to the mobile_app_panel_id used in - * Survey Insert requests. - */ - mobileAppPanelId: string; - /** - * Human readable name of the audience panel. - */ - name: string; - /** - * List of email addresses for users who can target members of this panel. - * Must contain at least the address of the user making the API call for - * panels that are not public. This field will be empty for public panels. - */ - owners: string[]; -} -export interface Schema$MobileAppPanelsListResponse { - pageInfo: Schema$PageInfo; - /** - * Unique request ID used for logging and debugging. Please include in any - * error reporting or troubleshooting requests. - */ - requestId: string; - /** - * An individual predefined panel of Opinion Rewards mobile users. - */ - resources: Schema$MobileAppPanel[]; - tokenPagination: Schema$TokenPagination; -} -export interface Schema$PageInfo { - resultPerPage: number; - startIndex: number; - totalResults: number; -} -export interface Schema$ResultsGetRequest { resultMask: Schema$ResultsMask; } -export interface Schema$ResultsMask { - fields: Schema$FieldMask[]; - projection: string; -} -/** - * Representation of an individual survey object. - */ -export interface Schema$Survey { - /** - * Targeting-criteria message containing demographic information - */ - audience: Schema$SurveyAudience; - /** - * Cost to run the survey and collect the necessary number of responses. - */ - cost: Schema$SurveyCost; - /** - * Additional information to store on behalf of the API consumer and associate - * with this question. This binary blob is treated as opaque. This field is - * limited to 64K bytes. - */ - customerData: string; - /** - * Text description of the survey. - */ - description: string; - /** - * List of email addresses for survey owners. Must contain at least the - * address of the user making the API call. - */ - owners: string[]; - /** - * List of questions defining the survey. - */ - questions: Schema$SurveyQuestion[]; - /** - * Reason for the survey being rejected. Only present if the survey state is - * rejected. - */ - rejectionReason: Schema$SurveyRejection; - /** - * State that the survey is in. - */ - state: string; - /** - * Unique survey ID, that is viewable in the URL of the Survey Creator UI - */ - surveyUrlId: string; - /** - * Optional name that will be given to the survey. - */ - title: string; - /** - * Number of responses desired for the survey. - */ - wantedResponseCount: number; -} -/** - * Specifications for the target audience of a survey run through the API. - */ -export interface Schema$SurveyAudience { - /** - * Optional list of age buckets to target. Supported age buckets are: - * ['18-24', '25-34', '35-44', '45-54', - * '55-64', '65+'] - */ - ages: string[]; - /** - * Required country code that surveys should be targeted to. Accepts standard - * ISO 3166-1 2 character language codes. For instance, 'US' for the - * United States, and 'GB' for the United Kingdom. - */ - country: string; - /** - * Country subdivision (states/provinces/etc) that surveys should be targeted - * to. For all countries except GB, ISO-3166-2 subdivision code is required - * (eg. 'US-OH' for Ohio, United States). For GB, NUTS 1 statistical - * region codes for the United Kingdom is required (eg. 'UK-UKC' for - * North East England). - */ - countrySubdivision: string; - /** - * Optional gender to target. - */ - gender: string; - /** - * Language code that surveys should be targeted to. For instance, - * 'en-US'. Surveys may target bilingual users by specifying a list of - * language codes (for example, 'de' and 'en-US'). In that - * case, all languages will be used for targeting users but the survey content - * (which is displayed) must match the first language listed. Accepts standard - * BCP47 language codes. See specification. - */ - languages: string[]; - /** - * Key for predefined panel that causes survey to be sent to a predefined set - * of Opinion Rewards App users. You must set PopulationSource to - * ANDROID_APP_PANEL to use this field. - */ - mobileAppPanelId: string; - /** - * Online population source where the respondents are sampled from. - */ - populationSource: string; -} -/** - * Message defining the cost to run a given survey through API. - */ -export interface Schema$SurveyCost { - /** - * Cost per survey response in nano units of the given currency. To get the - * total cost for a survey, multiply this value by wanted_response_count. - */ - costPerResponseNanos: string; - /** - * Currency code that the cost is given in. - */ - currencyCode: string; - /** - * Threshold to start a survey automatically if the quoted price is at most - * this value. When a survey has a Screener (threshold) question, it must go - * through an incidence pricing test to determine the final cost per response. - * Typically you will have to make a followup call to start the survey giving - * the final computed cost per response. If the survey has no - * threshold_answers, setting this property will return an error. By - * specifying this property, you indicate the max price per response you are - * willing to pay in advance of the incidence test. If the price turns out to - * be lower than the specified value, the survey will begin immediately and - * you will be charged at the rate determined by the incidence pricing test. - * If the price turns out to be greater than the specified value the survey - * will not be started and you will instead be notified what price was - * determined by the incidence test. At that point, you must raise the value - * of this property to be greater than or equal to that cost before attempting - * to start the survey again. This will immediately start the survey as long - * the incidence test was run within the last 21 days. - */ - maxCostPerResponseNanos: string; - /** - * Cost of survey in nano units of the given currency. DEPRECATED in favor of - * cost_per_response_nanos - */ - nanos: string; -} -/** - * Message defining the question specifications. - */ -export interface Schema$SurveyQuestion { - /** - * The randomization option for multiple choice and multi-select questions. If - * not specified, this option defaults to randomize. - */ - answerOrder: string; - /** - * Required list of answer options for a question. - */ - answers: string[]; - /** - * Option to allow open-ended text box for Single Answer and Multiple Answer - * question types. This can be used with SINGLE_ANSWER, - * SINGLE_ANSWER_WITH_IMAGE, MULTIPLE_ANSWERS, and MULTIPLE_ANSWERS_WITH_IMAGE - * question types. - */ - hasOther: boolean; - /** - * For rating questions, the text for the higher end of the scale, such as - * 'Best'. For numeric questions, a string representing a - * floating-point that is the maximum allowed number for a response. - */ - highValueLabel: string; - images: Schema$SurveyQuestionImage[]; - /** - * Currently only support pinning an answer option to the last position. - */ - lastAnswerPositionPinned: boolean; - /** - * For rating questions, the text for the lower end of the scale, such as - * 'Worst'. For numeric questions, a string representing a - * floating-point that is the minimum allowed number for a response. - */ - lowValueLabel: string; - /** - * Option to force the user to pick one of the open text suggestions. This - * requires that suggestions are provided for this question. - */ - mustPickSuggestion: boolean; - /** - * Number of stars to use for ratings questions. - */ - numStars: string; - /** - * Placeholder text for an open text question. - */ - openTextPlaceholder: string; - /** - * A list of suggested answers for open text question auto-complete. This is - * only valid if single_line_response is true. - */ - openTextSuggestions: string[]; - /** - * Required question text shown to the respondent. - */ - question: string; - /** - * Used by the Rating Scale with Text question type. This text goes along with - * the question field that is presented to the respondent, and is the actual - * text that the respondent is asked to rate. - */ - sentimentText: string; - /** - * Option to allow multiple line open text responses instead of a single line - * response. Note that we don't show auto-complete suggestions with - * multiple line responses. - */ - singleLineResponse: boolean; - /** - * The threshold/screener answer options, which will screen a user into the - * rest of the survey. These will be a subset of the answer option strings. - */ - thresholdAnswers: string[]; - /** - * Required field defining the question type. For details about configuring - * different type of questions, consult the question configuration guide. - */ - type: string; - /** - * Optional unit of measurement for display (for example: hours, people, - * miles). - */ - unitOfMeasurementLabel: string; - /** - * The YouTube video ID to be show in video questions. - */ - videoId: string; -} -/** - * Container object for image data and alt_text. - */ -export interface Schema$SurveyQuestionImage { - /** - * The alt text property used in image tags is required for all images. - */ - altText: string; - /** - * Inline jpeg, gif, tiff, bmp, or png image raw bytes for an image question - * types. - */ - data: string; - /** - * The read-only URL for the hosted images. - */ - url: string; -} -/** - * Message representing why the survey was rejected from review, if it was. - */ -export interface Schema$SurveyRejection { - /** - * A human-readable explanation of what was wrong with the survey. - */ - explanation: string; - /** - * Which category of rejection this was. See the Google Surveys Help Center - * for additional details on each category. - */ - type: string; -} -/** - * Reference to the current results for a given survey. - */ -export interface Schema$SurveyResults { + export interface Schema$FieldMask { + fields: Schema$FieldMask[]; + id: number; + } /** - * Human readable string describing the status of the request. - */ - status: string; + * Representation of an individual pre-defined panel object defining a + * targeted audience of opinion rewards mobile app users. + */ + export interface Schema$MobileAppPanel { + /** + * Country code for the country of the users that the panel contains. Uses + * standard ISO 3166-1 2-character language codes. For instance, + * 'US' for the United States, and 'GB' for the United + * Kingdom. Any survey created targeting this panel must also target the + * corresponding country. + */ + country: string; + /** + * Whether or not the panel is accessible to all API users. + */ + isPublicPanel: boolean; + /** + * Language code that the panel can target. For instance, 'en-US'. + * Uses standard BCP47 language codes. See specification. Any survey created + * targeting this panel must also target the corresponding language. + */ + language: string; + /** + * Unique panel ID string. This corresponds to the mobile_app_panel_id used + * in Survey Insert requests. + */ + mobileAppPanelId: string; + /** + * Human readable name of the audience panel. + */ + name: string; + /** + * List of email addresses for users who can target members of this panel. + * Must contain at least the address of the user making the API call for + * panels that are not public. This field will be empty for public panels. + */ + owners: string[]; + } + export interface Schema$MobileAppPanelsListResponse { + pageInfo: Schema$PageInfo; + /** + * Unique request ID used for logging and debugging. Please include in any + * error reporting or troubleshooting requests. + */ + requestId: string; + /** + * An individual predefined panel of Opinion Rewards mobile users. + */ + resources: Schema$MobileAppPanel[]; + tokenPagination: Schema$TokenPagination; + } + export interface Schema$PageInfo { + resultPerPage: number; + startIndex: number; + totalResults: number; + } + export interface Schema$ResultsGetRequest { resultMask: Schema$ResultsMask; } + export interface Schema$ResultsMask { + fields: Schema$FieldMask[]; + projection: string; + } /** - * External survey ID as viewable by survey owners in the editor view. - */ - surveyUrlId: string; -} -export interface Schema$SurveysDeleteResponse { + * Representation of an individual survey object. + */ + export interface Schema$Survey { + /** + * Targeting-criteria message containing demographic information + */ + audience: Schema$SurveyAudience; + /** + * Cost to run the survey and collect the necessary number of responses. + */ + cost: Schema$SurveyCost; + /** + * Additional information to store on behalf of the API consumer and + * associate with this question. This binary blob is treated as opaque. This + * field is limited to 64K bytes. + */ + customerData: string; + /** + * Text description of the survey. + */ + description: string; + /** + * List of email addresses for survey owners. Must contain at least the + * address of the user making the API call. + */ + owners: string[]; + /** + * List of questions defining the survey. + */ + questions: Schema$SurveyQuestion[]; + /** + * Reason for the survey being rejected. Only present if the survey state is + * rejected. + */ + rejectionReason: Schema$SurveyRejection; + /** + * State that the survey is in. + */ + state: string; + /** + * Unique survey ID, that is viewable in the URL of the Survey Creator UI + */ + surveyUrlId: string; + /** + * Optional name that will be given to the survey. + */ + title: string; + /** + * Number of responses desired for the survey. + */ + wantedResponseCount: number; + } /** - * Unique request ID used for logging and debugging. Please include in any - * error reporting or troubleshooting requests. - */ - requestId: string; -} -export interface Schema$SurveysListResponse { - pageInfo: Schema$PageInfo; + * Specifications for the target audience of a survey run through the API. + */ + export interface Schema$SurveyAudience { + /** + * Optional list of age buckets to target. Supported age buckets are: + * ['18-24', '25-34', '35-44', '45-54', + * '55-64', '65+'] + */ + ages: string[]; + /** + * Required country code that surveys should be targeted to. Accepts + * standard ISO 3166-1 2 character language codes. For instance, + * 'US' for the United States, and 'GB' for the United + * Kingdom. + */ + country: string; + /** + * Country subdivision (states/provinces/etc) that surveys should be + * targeted to. For all countries except GB, ISO-3166-2 subdivision code is + * required (eg. 'US-OH' for Ohio, United States). For GB, NUTS 1 + * statistical region codes for the United Kingdom is required (eg. + * 'UK-UKC' for North East England). + */ + countrySubdivision: string; + /** + * Optional gender to target. + */ + gender: string; + /** + * Language code that surveys should be targeted to. For instance, + * 'en-US'. Surveys may target bilingual users by specifying a list + * of language codes (for example, 'de' and 'en-US'). In + * that case, all languages will be used for targeting users but the survey + * content (which is displayed) must match the first language listed. + * Accepts standard BCP47 language codes. See specification. + */ + languages: string[]; + /** + * Key for predefined panel that causes survey to be sent to a predefined + * set of Opinion Rewards App users. You must set PopulationSource to + * ANDROID_APP_PANEL to use this field. + */ + mobileAppPanelId: string; + /** + * Online population source where the respondents are sampled from. + */ + populationSource: string; + } /** - * Unique request ID used for logging and debugging. Please include in any - * error reporting or troubleshooting requests. - */ - requestId: string; + * Message defining the cost to run a given survey through API. + */ + export interface Schema$SurveyCost { + /** + * Cost per survey response in nano units of the given currency. To get the + * total cost for a survey, multiply this value by wanted_response_count. + */ + costPerResponseNanos: string; + /** + * Currency code that the cost is given in. + */ + currencyCode: string; + /** + * Threshold to start a survey automatically if the quoted price is at most + * this value. When a survey has a Screener (threshold) question, it must go + * through an incidence pricing test to determine the final cost per + * response. Typically you will have to make a followup call to start the + * survey giving the final computed cost per response. If the survey has no + * threshold_answers, setting this property will return an error. By + * specifying this property, you indicate the max price per response you are + * willing to pay in advance of the incidence test. If the price turns out + * to be lower than the specified value, the survey will begin immediately + * and you will be charged at the rate determined by the incidence pricing + * test. If the price turns out to be greater than the specified value the + * survey will not be started and you will instead be notified what price + * was determined by the incidence test. At that point, you must raise the + * value of this property to be greater than or equal to that cost before + * attempting to start the survey again. This will immediately start the + * survey as long the incidence test was run within the last 21 days. + */ + maxCostPerResponseNanos: string; + /** + * Cost of survey in nano units of the given currency. DEPRECATED in favor + * of cost_per_response_nanos + */ + nanos: string; + } /** - * An individual survey resource. - */ - resources: Schema$Survey[]; - tokenPagination: Schema$TokenPagination; -} -export interface Schema$SurveysStartRequest { + * Message defining the question specifications. + */ + export interface Schema$SurveyQuestion { + /** + * The randomization option for multiple choice and multi-select questions. + * If not specified, this option defaults to randomize. + */ + answerOrder: string; + /** + * Required list of answer options for a question. + */ + answers: string[]; + /** + * Option to allow open-ended text box for Single Answer and Multiple Answer + * question types. This can be used with SINGLE_ANSWER, + * SINGLE_ANSWER_WITH_IMAGE, MULTIPLE_ANSWERS, and + * MULTIPLE_ANSWERS_WITH_IMAGE question types. + */ + hasOther: boolean; + /** + * For rating questions, the text for the higher end of the scale, such as + * 'Best'. For numeric questions, a string representing a + * floating-point that is the maximum allowed number for a response. + */ + highValueLabel: string; + images: Schema$SurveyQuestionImage[]; + /** + * Currently only support pinning an answer option to the last position. + */ + lastAnswerPositionPinned: boolean; + /** + * For rating questions, the text for the lower end of the scale, such as + * 'Worst'. For numeric questions, a string representing a + * floating-point that is the minimum allowed number for a response. + */ + lowValueLabel: string; + /** + * Option to force the user to pick one of the open text suggestions. This + * requires that suggestions are provided for this question. + */ + mustPickSuggestion: boolean; + /** + * Number of stars to use for ratings questions. + */ + numStars: string; + /** + * Placeholder text for an open text question. + */ + openTextPlaceholder: string; + /** + * A list of suggested answers for open text question auto-complete. This is + * only valid if single_line_response is true. + */ + openTextSuggestions: string[]; + /** + * Required question text shown to the respondent. + */ + question: string; + /** + * Used by the Rating Scale with Text question type. This text goes along + * with the question field that is presented to the respondent, and is the + * actual text that the respondent is asked to rate. + */ + sentimentText: string; + /** + * Option to allow multiple line open text responses instead of a single + * line response. Note that we don't show auto-complete suggestions with + * multiple line responses. + */ + singleLineResponse: boolean; + /** + * The threshold/screener answer options, which will screen a user into the + * rest of the survey. These will be a subset of the answer option strings. + */ + thresholdAnswers: string[]; + /** + * Required field defining the question type. For details about configuring + * different type of questions, consult the question configuration guide. + */ + type: string; + /** + * Optional unit of measurement for display (for example: hours, people, + * miles). + */ + unitOfMeasurementLabel: string; + /** + * The YouTube video ID to be show in video questions. + */ + videoId: string; + } /** - * Threshold to start a survey automically if the quoted prices is less than - * or equal to this value. See Survey.Cost for more details. - */ - maxCostPerResponseNanos: string; -} -export interface Schema$SurveysStartResponse { + * Container object for image data and alt_text. + */ + export interface Schema$SurveyQuestionImage { + /** + * The alt text property used in image tags is required for all images. + */ + altText: string; + /** + * Inline jpeg, gif, tiff, bmp, or png image raw bytes for an image question + * types. + */ + data: string; + /** + * The read-only URL for the hosted images. + */ + url: string; + } /** - * Unique request ID used for logging and debugging. Please include in any - * error reporting or troubleshooting requests. - */ - requestId: string; -} -export interface Schema$SurveysStopResponse { + * Message representing why the survey was rejected from review, if it was. + */ + export interface Schema$SurveyRejection { + /** + * A human-readable explanation of what was wrong with the survey. + */ + explanation: string; + /** + * Which category of rejection this was. See the Google Surveys Help Center + * for additional details on each category. + */ + type: string; + } /** - * Unique request ID used for logging and debugging. Please include in any - * error reporting or troubleshooting requests. - */ - requestId: string; -} -export interface Schema$TokenPagination { - nextPageToken: string; - previousPageToken: string; -} - -export class Resource$Mobileapppanels { - root: Surveys; - constructor(root: Surveys) { - this.root = root; - this.getRoot.bind(this); + * Reference to the current results for a given survey. + */ + export interface Schema$SurveyResults { + /** + * Human readable string describing the status of the request. + */ + status: string; + /** + * External survey ID as viewable by survey owners in the editor view. + */ + surveyUrlId: string; } - - getRoot() { - return this.root; + export interface Schema$SurveysDeleteResponse { + /** + * Unique request ID used for logging and debugging. Please include in any + * error reporting or troubleshooting requests. + */ + requestId: string; + } + export interface Schema$SurveysListResponse { + pageInfo: Schema$PageInfo; + /** + * Unique request ID used for logging and debugging. Please include in any + * error reporting or troubleshooting requests. + */ + requestId: string; + /** + * An individual survey resource. + */ + resources: Schema$Survey[]; + tokenPagination: Schema$TokenPagination; + } + export interface Schema$SurveysStartRequest { + /** + * Threshold to start a survey automically if the quoted prices is less than + * or equal to this value. See Survey.Cost for more details. + */ + maxCostPerResponseNanos: string; + } + export interface Schema$SurveysStartResponse { + /** + * Unique request ID used for logging and debugging. Please include in any + * error reporting or troubleshooting requests. + */ + requestId: string; + } + export interface Schema$SurveysStopResponse { + /** + * Unique request ID used for logging and debugging. Please include in any + * error reporting or troubleshooting requests. + */ + requestId: string; + } + export interface Schema$TokenPagination { + nextPageToken: string; + previousPageToken: string; } - - /** - * surveys.mobileapppanels.get - * @desc Retrieves a MobileAppPanel that is available to the authenticated - * user. - * @alias surveys.mobileapppanels.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.panelId External URL ID for the panel. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Mobileapppanels { + root: Surveys; + constructor(root: Surveys) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/mobileAppPanels/{panelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['panelId'], - pathParams: ['panelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * surveys.mobileapppanels.list - * @desc Lists the MobileAppPanels available to the authenticated user. - * @alias surveys.mobileapppanels.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults - * @param {integer=} params.startIndex - * @param {string=} params.token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/mobileAppPanels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * surveys.mobileapppanels.get + * @desc Retrieves a MobileAppPanel that is available to the authenticated + * user. + * @alias surveys.mobileapppanels.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.panelId External URL ID for the panel. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/mobileAppPanels/{panelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['panelId'], + pathParams: ['panelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * surveys.mobileapppanels.update - * @desc Updates a MobileAppPanel. Currently the only property that can be - * updated is the owners property. - * @alias surveys.mobileapppanels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.panelId External URL ID for the panel. - * @param {().MobileAppPanel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * surveys.mobileapppanels.list + * @desc Lists the MobileAppPanels available to the authenticated user. + * @alias surveys.mobileapppanels.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults + * @param {integer=} params.startIndex + * @param {string=} params.token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/mobileAppPanels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/mobileAppPanels/{panelId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['panelId'], - pathParams: ['panelId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Results { - root: Surveys; - constructor(root: Surveys) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * surveys.mobileapppanels.update + * @desc Updates a MobileAppPanel. Currently the only property that can be + * updated is the owners property. + * @alias surveys.mobileapppanels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.panelId External URL ID for the panel. + * @param {().MobileAppPanel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/mobileAppPanels/{panelId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['panelId'], + pathParams: ['panelId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * surveys.results.get - * @desc Retrieves any survey results that have been produced so far. Results - * are formatted as an Excel file. You must add "?alt=media" to the URL as an - * argument to get results. - * @alias surveys.results.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.surveyUrlId External URL ID for the survey. - * @param {().ResultsGetRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Results { + root: Surveys; + constructor(root: Surveys) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}/results') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['surveyUrlId'], - pathParams: ['surveyUrlId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Surveys { - root: Surveys; - constructor(root: Surveys) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * surveys.results.get + * @desc Retrieves any survey results that have been produced so far. + * Results are formatted as an Excel file. You must add "?alt=media" to the + * URL as an argument to get results. + * @alias surveys.results.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.surveyUrlId External URL ID for the survey. + * @param {().ResultsGetRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}/results') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['surveyUrlId'], + pathParams: ['surveyUrlId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * surveys.surveys.delete - * @desc Removes a survey from view in all user GET requests. - * @alias surveys.surveys.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.surveyUrlId External URL ID for the survey. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Surveys { + root: Surveys; + constructor(root: Surveys) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['surveyUrlId'], - pathParams: ['surveyUrlId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * surveys.surveys.get - * @desc Retrieves information about the specified survey. - * @alias surveys.surveys.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.surveyUrlId External URL ID for the survey. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['surveyUrlId'], - pathParams: ['surveyUrlId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * surveys.surveys.delete + * @desc Removes a survey from view in all user GET requests. + * @alias surveys.surveys.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.surveyUrlId External URL ID for the survey. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['surveyUrlId'], + pathParams: ['surveyUrlId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * surveys.surveys.insert - * @desc Creates a survey. - * @alias surveys.surveys.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Survey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * surveys.surveys.get + * @desc Retrieves information about the specified survey. + * @alias surveys.surveys.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.surveyUrlId External URL ID for the survey. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['surveyUrlId'], + pathParams: ['surveyUrlId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/surveys/v2/surveys').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * surveys.surveys.list - * @desc Lists the surveys owned by the authenticated user. - * @alias surveys.surveys.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {integer=} params.maxResults - * @param {integer=} params.startIndex - * @param {string=} params.token - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/surveys/v2/surveys').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * surveys.surveys.insert + * @desc Creates a survey. + * @alias surveys.surveys.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Survey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * surveys.surveys.start - * @desc Begins running a survey. - * @alias surveys.surveys.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceId - * @param {().SurveysStartRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): - AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * surveys.surveys.list + * @desc Lists the surveys owned by the authenticated user. + * @alias surveys.surveys.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {integer=} params.maxResults + * @param {integer=} params.startIndex + * @param {string=} params.token + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{resourceId}/start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resourceId'], - pathParams: ['resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * surveys.surveys.stop - * @desc Stops a running survey. - * @alias surveys.surveys.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceId - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): - AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{resourceId}/stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['resourceId'], - pathParams: ['resourceId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * surveys.surveys.start + * @desc Begins running a survey. + * @alias surveys.surveys.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceId + * @param {().SurveysStartRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{resourceId}/start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resourceId'], + pathParams: ['resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * surveys.surveys.update - * @desc Updates a survey. Currently the only property that can be updated is - * the owners property. - * @alias surveys.surveys.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.surveyUrlId External URL ID for the survey. - * @param {().Survey} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * surveys.surveys.stop + * @desc Stops a running survey. + * @alias surveys.surveys.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceId + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): + AxiosPromise; + stop( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{resourceId}/stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['resourceId'], + pathParams: ['resourceId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['surveyUrlId'], - pathParams: ['surveyUrlId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * surveys.surveys.update + * @desc Updates a survey. Currently the only property that can be updated + * is the owners property. + * @alias surveys.surveys.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.surveyUrlId External URL ID for the survey. + * @param {().Survey} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/surveys/v2/surveys/{surveyUrlId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['surveyUrlId'], + pathParams: ['surveyUrlId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/tagmanager/v1.ts b/src/apis/tagmanager/v1.ts index c7cb5463069..8051de4bbc1 100644 --- a/src/apis/tagmanager/v1.ts +++ b/src/apis/tagmanager/v1.ts @@ -27,3974 +27,4003 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Tag Manager API - * - * Accesses Tag Manager accounts and containers. - * - * @example - * const google = require('googleapis'); - * const tagmanager = google.tagmanager('v1'); - * - * @namespace tagmanager - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Tagmanager - */ -export class Tagmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Represents a Google Tag Manager Account. - */ -export interface Schema$Account { - /** - * The Account ID uniquely identifies the GTM Account. - */ - accountId: string; - /** - * The fingerprint of the GTM Account as computed at storage time. This value - * is recomputed whenever the account is modified. - */ - fingerprint: string; - /** - * Account display name. - */ - name: string; - /** - * Whether the account shares data anonymously with Google and others. - */ - shareData: boolean; -} -/** - * Defines the Google Tag Manager Account access permissions. - */ -export interface Schema$AccountAccess { - /** - * List of Account permissions. Valid account permissions are read and manage. - */ - permission: string[]; -} -/** - * Represents a predicate. - */ -export interface Schema$Condition { - /** - * A list of named parameters (key/value), depending on the condition's - * type. Notes: - For binary operators, include parameters named arg0 and - * arg1 for specifying the left and right operands, respectively. - At this - * time, the left operand (arg0) must be a reference to a variable. - For - * case-insensitive Regex matching, include a boolean parameter named - * ignore_case that is set to true. If not specified or set to any other - * value, the matching will be case sensitive. - To negate an operator, - * include a boolean parameter named negate boolean parameter that is set to - * true. - */ - parameter: Schema$Parameter[]; - /** - * The type of operator for this condition. - */ - type: string; -} -/** - * Represents a Google Tag Manager Container. - */ -export interface Schema$Container { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The Container ID uniquely identifies the GTM Container. - */ - containerId: string; - /** - * Optional list of domain names associated with the Container. - */ - domainName: string[]; - /** - * List of enabled built-in variables. Valid values include: pageUrl, - * pageHostname, pagePath, referrer, event, clickElement, clickClasses, - * clickId, clickTarget, clickUrl, clickText, formElement, formClasses, - * formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, - * newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, - * historySource, containerVersion, debugMode, randomNumber, containerId. - */ - enabledBuiltInVariable: string[]; - /** - * The fingerprint of the GTM Container as computed at storage time. This - * value is recomputed whenever the account is modified. - */ - fingerprint: string; - /** - * Container display name. - */ - name: string; - /** - * Container Notes. - */ - notes: string; - /** - * Container Public ID. - */ - publicId: string; - /** - * Container Country ID. - */ - timeZoneCountryId: string; - /** - * Container Time Zone ID. - */ - timeZoneId: string; - /** - * List of Usage Contexts for the Container. Valid values include: web, - * android, ios. - */ - usageContext: string[]; -} -/** - * Defines the Google Tag Manager Container access permissions. - */ -export interface Schema$ContainerAccess { - /** - * GTM Container ID. - */ - containerId: string; - /** - * List of Container permissions. Valid container permissions are: read, edit, - * delete, publish. - */ - permission: string[]; -} -/** - * Represents a Google Tag Manager Container Version. - */ -export interface Schema$ContainerVersion { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The container that this version was taken from. - */ - container: Schema$Container; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The Container Version ID uniquely identifies the GTM Container Version. - */ - containerVersionId: string; - /** - * A value of true indicates this container version has been deleted. - */ - deleted: boolean; - /** - * The fingerprint of the GTM Container Version as computed at storage time. - * This value is recomputed whenever the container version is modified. - */ - fingerprint: string; - /** - * The folders in the container that this version was taken from. - */ - folder: Schema$Folder[]; - /** - * The macros in the container that this version was taken from. - */ - macro: Schema$Macro[]; - /** - * Container version display name. - */ - name: string; - /** - * User notes on how to apply this container version in the container. - */ - notes: string; - /** - * The rules in the container that this version was taken from. - */ - rule: Schema$Rule[]; - /** - * The tags in the container that this version was taken from. - */ - tag: Schema$Tag[]; - /** - * The triggers in the container that this version was taken from. - */ - trigger: Schema$Trigger[]; - /** - * The variables in the container that this version was taken from. - */ - variable: Schema$Variable[]; -} -/** - * Represents a Google Tag Manager Container Version Header. - */ -export interface Schema$ContainerVersionHeader { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The Container Version ID uniquely identifies the GTM Container Version. - */ - containerVersionId: string; - /** - * A value of true indicates this container version has been deleted. - */ - deleted: boolean; - /** - * Container version display name. - */ - name: string; - /** - * Number of macros in the container version. - */ - numMacros: string; - /** - * Number of rules in the container version. - */ - numRules: string; - /** - * Number of tags in the container version. - */ - numTags: string; - /** - * Number of triggers in the container version. - */ - numTriggers: string; - /** - * Number of variables in the container version. - */ - numVariables: string; -} -/** - * Options for new container versions. - */ -export interface Schema$CreateContainerVersionRequestVersionOptions { - /** - * The name of the container version to be created. - */ - name: string; - /** - * The notes of the container version to be created. - */ - notes: string; - /** - * The creation of this version may be for quick preview and shouldn't be - * saved. - */ - quickPreview: boolean; -} -/** - * Create container versions response. - */ -export interface Schema$CreateContainerVersionResponse { - /** - * Compiler errors or not. - */ - compilerError: boolean; - /** - * The container version created. - */ - containerVersion: Schema$ContainerVersion; -} -/** - * Represents a Google Tag Manager Environment. Note that a user can create, - * delete and update environments of type USER, but can only update the - * enable_debug and url fields of environments of other types. - */ -export interface Schema$Environment { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The environment authorization code. - */ - authorizationCode: string; - /** - * The last update time-stamp for the authorization code. - */ - authorizationTimestampMs: string; - /** - * GTM Container ID. - */ - containerId: string; - containerVersionId: string; - /** - * The environment description. Can be set or changed only on USER type - * environments. - */ - description: string; - /** - * Whether or not to enable debug by default on for the environment. - */ - enableDebug: boolean; - /** - * GTM Environment ID uniquely identifies the GTM Environment. - */ - environmentId: string; - /** - * The fingerprint of the GTM environment as computed at storage time. This - * value is recomputed whenever the environment is modified. - */ - fingerprint: string; - /** - * The environment display name. Can be set or changed only on USER type - * environments. - */ - name: string; - /** - * The type of this environment. - */ - type: string; - /** - * Default preview page url for the environment. - */ - url: string; -} -/** - * Represents a Google Tag Manager Folder. - */ -export interface Schema$Folder { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Folder as computed at storage time. This value - * is recomputed whenever the folder is modified. - */ - fingerprint: string; - /** - * The Folder ID uniquely identifies the GTM Folder. - */ - folderId: string; - /** - * Folder display name. - */ - name: string; -} -/** - * Represents a Google Tag Manager Folder's contents. - */ -export interface Schema$FolderEntities { - /** - * The list of tags inside the folder. - */ - tag: Schema$Tag[]; - /** - * The list of triggers inside the folder. - */ - trigger: Schema$Trigger[]; - /** - * The list of variables inside the folder. - */ - variable: Schema$Variable[]; -} -/** - * List Accounts Response. - */ -export interface Schema$ListAccountsResponse { - /** - * List of GTM Accounts that a user has access to. - */ - accounts: Schema$Account[]; -} -/** - * List AccountUsers Response. - */ -export interface Schema$ListAccountUsersResponse { - /** - * All GTM AccountUsers of a GTM Account. - */ - userAccess: Schema$UserAccess[]; -} -/** - * List Containers Response. - */ -export interface Schema$ListContainersResponse { - /** - * All Containers of a GTM Account. - */ - containers: Schema$Container[]; -} -/** - * List container versions response. - */ -export interface Schema$ListContainerVersionsResponse { - /** - * All versions of a GTM Container. - */ - containerVersion: Schema$ContainerVersion[]; - /** - * All container version headers of a GTM Container. - */ - containerVersionHeader: Schema$ContainerVersionHeader[]; -} -/** - * List Environments Response. - */ -export interface Schema$ListEnvironmentsResponse { - /** - * All Environments of a GTM Container. - */ - environments: Schema$Environment[]; -} -/** - * List Folders Response. - */ -export interface Schema$ListFoldersResponse { - /** - * All GTM Folders of a GTM Container. - */ - folders: Schema$Folder[]; -} -/** - * List Tags Response. - */ -export interface Schema$ListTagsResponse { - /** - * All GTM Tags of a GTM Container. - */ - tags: Schema$Tag[]; -} -/** - * List triggers response. - */ -export interface Schema$ListTriggersResponse { - /** - * All GTM Triggers of a GTM Container. - */ - triggers: Schema$Trigger[]; -} -/** - * List Variables Response. - */ -export interface Schema$ListVariablesResponse { - /** - * All GTM Variables of a GTM Container. - */ - variables: Schema$Variable[]; -} -/** - * Represents a Google Tag Manager Macro. - */ -export interface Schema$Macro { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * For mobile containers only: A list of rule IDs for disabling conditional - * macros; the macro is enabled if one of the enabling rules is true while all - * the disabling rules are false. Treated as an unordered set. - */ - disablingRuleId: string[]; - /** - * For mobile containers only: A list of rule IDs for enabling conditional - * macros; the macro is enabled if one of the enabling rules is true while all - * the disabling rules are false. Treated as an unordered set. - */ - enablingRuleId: string[]; - /** - * The fingerprint of the GTM Macro as computed at storage time. This value is - * recomputed whenever the macro is modified. - */ - fingerprint: string; - /** - * The Macro ID uniquely identifies the GTM Macro. - */ - macroId: string; - /** - * Macro display name. - */ - name: string; - /** - * User notes on how to apply this macro in the container. - */ - notes: string; - /** - * The macro's parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * The end timestamp in milliseconds to schedule a macro. - */ - scheduleEndMs: string; - /** - * The start timestamp in milliseconds to schedule a macro. - */ - scheduleStartMs: string; - /** - * GTM Macro Type. - */ - type: string; -} -/** - * Represents a Google Tag Manager Parameter. - */ -export interface Schema$Parameter { - /** - * The named key that uniquely identifies a parameter. Required for top-level - * parameters, as well as map values. Ignored for list values. - */ - key: string; - /** - * This list parameter's parameters (keys will be ignored). - */ - list: Schema$Parameter[]; - /** - * This map parameter's parameters (must have keys; keys must be unique). - */ - map: Schema$Parameter[]; - /** - * The parameter type. Valid values are: - boolean: The value represents a - * boolean, represented as 'true' or 'false' - integer: The - * value represents a 64-bit signed integer value, in base 10 - list: A list - * of parameters should be specified - map: A map of parameters should be - * specified - template: The value represents any text; this can include - * variable references (even variable references that might return non-string - * types) - */ - type: string; - /** - * A parameter's value (may contain variable references such as - * "{{myVariable}}") as appropriate to the specified type. - */ - value: string; -} -/** - * Publish container version response. - */ -export interface Schema$PublishContainerVersionResponse { - /** - * Compiler errors or not. - */ - compilerError: boolean; - /** - * The container version created. - */ - containerVersion: Schema$ContainerVersion; -} -/** - * Represents a Google Tag Manager Rule. - */ -export interface Schema$Rule { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The list of conditions that make up this rule (implicit AND between them). - */ - condition: Schema$Condition[]; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Rule as computed at storage time. This value is - * recomputed whenever the rule is modified. - */ - fingerprint: string; - /** - * Rule display name. - */ - name: string; - /** - * User notes on how to apply this rule in the container. - */ - notes: string; - /** - * The Rule ID uniquely identifies the GTM Rule. - */ - ruleId: string; -} -export interface Schema$SetupTag { - /** - * If true, fire the main tag if and only if the setup tag fires successfully. - * If false, fire the main tag regardless of setup tag firing status. - */ - stopOnSetupFailure: boolean; - /** - * The name of the setup tag. - */ - tagName: string; -} -/** - * Represents a Google Tag Manager Tag. - */ -export interface Schema$Tag { - /** - * GTM Account ID. - */ - accountId: string; - /** - * Blocking rule IDs. If any of the listed rules evaluate to true, the tag - * will not fire. - */ - blockingRuleId: string[]; - /** - * Blocking trigger IDs. If any of the listed triggers evaluate to true, the - * tag will not fire. - */ - blockingTriggerId: string[]; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Tag as computed at storage time. This value is - * recomputed whenever the tag is modified. - */ - fingerprint: string; - /** - * Firing rule IDs. A tag will fire when any of the listed rules are true and - * all of its blockingRuleIds (if any specified) are false. - */ - firingRuleId: string[]; - /** - * Firing trigger IDs. A tag will fire when any of the listed triggers are - * true and all of its blockingTriggerIds (if any specified) are false. - */ - firingTriggerId: string[]; - /** - * If set to true, this tag will only fire in the live environment (e.g. not - * in preview or debug mode). - */ - liveOnly: boolean; - /** - * Tag display name. - */ - name: string; - /** - * User notes on how to apply this tag in the container. - */ - notes: string; - /** - * The tag's parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * True if the tag is paused. - */ - paused: boolean; - /** - * User defined numeric priority of the tag. Tags are fired asynchronously in - * order of priority. Tags with higher numeric value fire first. A tag's - * priority can be a positive or negative value. The default value is 0. - */ - priority: Schema$Parameter; - /** - * The end timestamp in milliseconds to schedule a tag. - */ - scheduleEndMs: string; - /** - * The start timestamp in milliseconds to schedule a tag. - */ - scheduleStartMs: string; - /** - * The list of setup tags. Currently we only allow one. - */ - setupTag: Schema$SetupTag[]; - /** - * Option to fire this tag. - */ - tagFiringOption: string; - /** - * The Tag ID uniquely identifies the GTM Tag. - */ - tagId: string; - /** - * The list of teardown tags. Currently we only allow one. - */ - teardownTag: Schema$TeardownTag[]; - /** - * GTM Tag Type. - */ - type: string; -} -export interface Schema$TeardownTag { - /** - * If true, fire the teardown tag if and only if the main tag fires - * successfully. If false, fire the teardown tag regardless of main tag firing - * status. - */ - stopTeardownOnFailure: boolean; - /** - * The name of the teardown tag. - */ - tagName: string; -} -/** - * Represents a Google Tag Manager Trigger - */ -export interface Schema$Trigger { - /** - * GTM Account ID. - */ - accountId: string; - /** - * Used in the case of auto event tracking. - */ - autoEventFilter: Schema$Condition[]; - /** - * Whether or not we should only fire tags if the form submit or link click - * event is not cancelled by some other event handler (e.g. because of - * validation). Only valid for Form Submission and Link Click triggers. - */ - checkValidation: Schema$Parameter; - /** - * GTM Container ID. - */ - containerId: string; - /** - * A visibility trigger minimum continuous visible time (in milliseconds). - * Only valid for AMP Visibility trigger. - */ - continuousTimeMinMilliseconds: Schema$Parameter; - /** - * Used in the case of custom event, which is fired iff all Conditions are - * true. - */ - customEventFilter: Schema$Condition[]; - /** - * Name of the GTM event that is fired. Only valid for Timer triggers. - */ - eventName: Schema$Parameter; - /** - * The trigger will only fire iff all Conditions are true. - */ - filter: Schema$Condition[]; - /** - * The fingerprint of the GTM Trigger as computed at storage time. This value - * is recomputed whenever the trigger is modified. - */ - fingerprint: string; - /** - * List of integer percentage values for scroll triggers. The trigger will - * fire when each percentage is reached when the view is scrolled - * horizontally. Only valid for AMP scroll triggers. - */ - horizontalScrollPercentageList: Schema$Parameter; - /** - * Time between triggering recurring Timer Events (in milliseconds). Only - * valid for Timer triggers. - */ - interval: Schema$Parameter; - /** - * Time between Timer Events to fire (in seconds). Only valid for AMP Timer - * trigger. - */ - intervalSeconds: Schema$Parameter; - /** - * Limit of the number of GTM events this Timer Trigger will fire. If no limit - * is set, we will continue to fire GTM events until the user leaves the page. - * Only valid for Timer triggers. - */ - limit: Schema$Parameter; - /** - * Max time to fire Timer Events (in seconds). Only valid for AMP Timer - * trigger. - */ - maxTimerLengthSeconds: Schema$Parameter; - /** - * Trigger display name. - */ - name: string; - /** - * Additional parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * A click trigger CSS selector (i.e. "a", "button" etc.). - * Only valid for AMP Click trigger. - */ - selector: Schema$Parameter; - /** - * A visibility trigger minimum total visible time (in milliseconds). Only - * valid for AMP Visibility trigger. - */ - totalTimeMinMilliseconds: Schema$Parameter; - /** - * The Trigger ID uniquely identifies the GTM Trigger. - */ - triggerId: string; - /** - * Defines the data layer event that causes this trigger. - */ - type: string; - /** - * Globally unique id of the trigger that auto-generates this (a Form Submit, - * Link Click or Timer listener) if any. Used to make incompatible auto-events - * work together with trigger filtering based on trigger ids. This value is - * populated during output generation since the tags implied by triggers - * don't exist until then. Only valid for Form Submit, Link Click and - * Timer triggers. - */ - uniqueTriggerId: Schema$Parameter; - /** - * List of integer percentage values for scroll triggers. The trigger will - * fire when each percentage is reached when the view is scrolled vertically. - * Only valid for AMP scroll triggers. - */ - verticalScrollPercentageList: Schema$Parameter; - /** - * A visibility trigger CSS selector (i.e. "#id"). Only valid for - * AMP Visibility trigger. - */ - visibilitySelector: Schema$Parameter; - /** - * A visibility trigger maximum percent visibility. Only valid for AMP - * Visibility trigger. - */ - visiblePercentageMax: Schema$Parameter; - /** - * A visibility trigger minimum percent visibility. Only valid for AMP - * Visibility trigger. - */ - visiblePercentageMin: Schema$Parameter; - /** - * Whether or not we should delay the form submissions or link opening until - * all of the tags have fired (by preventing the default action and later - * simulating the default action). Only valid for Form Submission and Link - * Click triggers. - */ - waitForTags: Schema$Parameter; - /** - * How long to wait (in milliseconds) for tags to fire when - * 'waits_for_tags' above evaluates to true. Only valid for Form - * Submission and Link Click triggers. - */ - waitForTagsTimeout: Schema$Parameter; -} -/** - * Represents a user's permissions to an account and its container. - */ -export interface Schema$UserAccess { - /** - * GTM Account access permissions. - */ - accountAccess: Schema$AccountAccess; - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container access permissions. - */ - containerAccess: Schema$ContainerAccess[]; - /** - * User's email address. - */ - emailAddress: string; - /** - * Account Permission ID. - */ - permissionId: string; -} -/** - * Represents a Google Tag Manager Variable. - */ -export interface Schema$Variable { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * For mobile containers only: A list of trigger IDs for disabling conditional - * variables; the variable is enabled if one of the enabling trigger is true - * while all the disabling trigger are false. Treated as an unordered set. - */ - disablingTriggerId: string[]; - /** - * For mobile containers only: A list of trigger IDs for enabling conditional - * variables; the variable is enabled if one of the enabling triggers is true - * while all the disabling triggers are false. Treated as an unordered set. - */ - enablingTriggerId: string[]; - /** - * The fingerprint of the GTM Variable as computed at storage time. This value - * is recomputed whenever the variable is modified. - */ - fingerprint: string; - /** - * Variable display name. - */ - name: string; - /** - * User notes on how to apply this variable in the container. - */ - notes: string; - /** - * The variable's parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * The end timestamp in milliseconds to schedule a variable. - */ - scheduleEndMs: string; - /** - * The start timestamp in milliseconds to schedule a variable. - */ - scheduleStartMs: string; - /** - * GTM Variable Type. - */ - type: string; - /** - * The Variable ID uniquely identifies the GTM Variable. - */ - variableId: string; -} - -export class Resource$Accounts { - root: Tagmanager; - containers: Resource$Accounts$Containers; - permissions: Resource$Accounts$Permissions; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.containers = new Resource$Accounts$Containers(root); - this.permissions = new Resource$Accounts$Permissions(root); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.get - * @desc Gets a GTM Account. - * @alias tagmanager.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.list - * @desc Lists all GTM Accounts that a user has access to. - * @alias tagmanager.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.update - * @desc Updates a GTM Account. - * @alias tagmanager.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the account in storage. - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers { - root: Tagmanager; - environments: Resource$Accounts$Containers$Environments; - folders: Resource$Accounts$Containers$Folders; - move_folders: Resource$Accounts$Containers$Move_folders; - reauthorize_environments: - Resource$Accounts$Containers$Reauthorize_environments; - tags: Resource$Accounts$Containers$Tags; - triggers: Resource$Accounts$Containers$Triggers; - variables: Resource$Accounts$Containers$Variables; - versions: Resource$Accounts$Containers$Versions; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.environments = new Resource$Accounts$Containers$Environments(root); - this.folders = new Resource$Accounts$Containers$Folders(root); - this.move_folders = new Resource$Accounts$Containers$Move_folders(root); - this.reauthorize_environments = - new Resource$Accounts$Containers$Reauthorize_environments(root); - this.tags = new Resource$Accounts$Containers$Tags(root); - this.triggers = new Resource$Accounts$Containers$Triggers(root); - this.variables = new Resource$Accounts$Containers$Variables(root); - this.versions = new Resource$Accounts$Containers$Versions(root); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.create - * @desc Creates a Container. - * @alias tagmanager.accounts.containers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {().Container} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/containers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.delete - * @desc Deletes a Container. - * @alias tagmanager.accounts.containers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.get - * @desc Gets a Container. - * @alias tagmanager.accounts.containers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.list - * @desc Lists all Containers that belongs to a GTM Account. - * @alias tagmanager.accounts.containers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/containers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.update - * @desc Updates a Container. - * @alias tagmanager.accounts.containers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container in storage. - * @param {().Container} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers$Environments { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.environments.create - * @desc Creates a GTM Environment. - * @alias tagmanager.accounts.containers.environments.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.delete - * @desc Deletes a GTM Environment. - * @alias tagmanager.accounts.containers.environments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.environmentId The GTM Environment ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'environmentId'], - pathParams: ['accountId', 'containerId', 'environmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.get - * @desc Gets a GTM Environment. - * @alias tagmanager.accounts.containers.environments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.environmentId The GTM Environment ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'environmentId'], - pathParams: ['accountId', 'containerId', 'environmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.list - * @desc Lists all GTM Environments of a GTM Container. - * @alias tagmanager.accounts.containers.environments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.patch - * @desc Updates a GTM Environment. This method supports patch semantics. - * @alias tagmanager.accounts.containers.environments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.environmentId The GTM Environment ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'environmentId'], - pathParams: ['accountId', 'containerId', 'environmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.update - * @desc Updates a GTM Environment. - * @alias tagmanager.accounts.containers.environments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.environmentId The GTM Environment ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'environmentId'], - pathParams: ['accountId', 'containerId', 'environmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Folders { - root: Tagmanager; - entities: Resource$Accounts$Containers$Folders$Entities; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.entities = new Resource$Accounts$Containers$Folders$Entities(root); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.folders.create - * @desc Creates a GTM Folder. - * @alias tagmanager.accounts.containers.folders.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.folders.delete - * @desc Deletes a GTM Folder. - * @alias tagmanager.accounts.containers.folders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.folderId The GTM Folder ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'folderId'], - pathParams: ['accountId', 'containerId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.folders.get - * @desc Gets a GTM Folder. - * @alias tagmanager.accounts.containers.folders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.folderId The GTM Folder ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'folderId'], - pathParams: ['accountId', 'containerId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.folders.list - * @desc Lists all GTM Folders of a Container. - * @alias tagmanager.accounts.containers.folders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.folders.update - * @desc Updates a GTM Folder. - * @alias tagmanager.accounts.containers.folders.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the folder in storage. - * @param {string} params.folderId The GTM Folder ID. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'folderId'], - pathParams: ['accountId', 'containerId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers$Folders$Entities { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.folders.entities.list - * @desc List all entities in a GTM Folder. - * @alias tagmanager.accounts.containers.folders.entities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.folderId The GTM Folder ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'folderId'], - pathParams: ['accountId', 'containerId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Containers$Move_folders { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.move_folders.update - * @desc Moves entities to a GTM Folder. - * @alias tagmanager.accounts.containers.move_folders.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.folderId The GTM Folder ID. - * @param {string=} params.tagId The tags to be moved to the folder. - * @param {string=} params.triggerId The triggers to be moved to the folder. - * @param {string=} params.variableId The variables to be moved to the folder. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'folderId'], - pathParams: ['accountId', 'containerId', 'folderId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Reauthorize_environments { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.reauthorize_environments.update - * @desc Re-generates the authorization code for a GTM Environment. - * @alias tagmanager.accounts.containers.reauthorize_environments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.environmentId The GTM Environment ID. - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'environmentId'], - pathParams: ['accountId', 'containerId', 'environmentId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Tags { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.tags.create - * @desc Creates a GTM Tag. - * @alias tagmanager.accounts.containers.tags.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().Tag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.tags.delete - * @desc Deletes a GTM Tag. - * @alias tagmanager.accounts.containers.tags.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.tagId The GTM Tag ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'tagId'], - pathParams: ['accountId', 'containerId', 'tagId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.tags.get - * @desc Gets a GTM Tag. - * @alias tagmanager.accounts.containers.tags.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.tagId The GTM Tag ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'tagId'], - pathParams: ['accountId', 'containerId', 'tagId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.tags.list - * @desc Lists all GTM Tags of a Container. - * @alias tagmanager.accounts.containers.tags.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.tags.update - * @desc Updates a GTM Tag. - * @alias tagmanager.accounts.containers.tags.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. - * @param {string} params.tagId The GTM Tag ID. - * @param {().Tag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'tagId'], - pathParams: ['accountId', 'containerId', 'tagId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Triggers { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.triggers.create - * @desc Creates a GTM Trigger. - * @alias tagmanager.accounts.containers.triggers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().Trigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.triggers.delete - * @desc Deletes a GTM Trigger. - * @alias tagmanager.accounts.containers.triggers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.triggerId The GTM Trigger ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'triggerId'], - pathParams: ['accountId', 'containerId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.triggers.get - * @desc Gets a GTM Trigger. - * @alias tagmanager.accounts.containers.triggers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.triggerId The GTM Trigger ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'triggerId'], - pathParams: ['accountId', 'containerId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.triggers.list - * @desc Lists all GTM Triggers of a Container. - * @alias tagmanager.accounts.containers.triggers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.triggers.update - * @desc Updates a GTM Trigger. - * @alias tagmanager.accounts.containers.triggers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. - * @param {string} params.triggerId The GTM Trigger ID. - * @param {().Trigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'triggerId'], - pathParams: ['accountId', 'containerId', 'triggerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Variables { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.variables.create - * @desc Creates a GTM Variable. - * @alias tagmanager.accounts.containers.variables.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.variables.delete - * @desc Deletes a GTM Variable. - * @alias tagmanager.accounts.containers.variables.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.variableId The GTM Variable ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'variableId'], - pathParams: ['accountId', 'containerId', 'variableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.variables.get - * @desc Gets a GTM Variable. - * @alias tagmanager.accounts.containers.variables.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.variableId The GTM Variable ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'variableId'], - pathParams: ['accountId', 'containerId', 'variableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.variables.list - * @desc Lists all GTM Variables of a Container. - * @alias tagmanager.accounts.containers.variables.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.variables.update - * @desc Updates a GTM Variable. - * @alias tagmanager.accounts.containers.variables.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. - * @param {string} params.variableId The GTM Variable ID. - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'variableId'], - pathParams: ['accountId', 'containerId', 'variableId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Versions { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.versions.create - * @desc Creates a Container Version. - * @alias tagmanager.accounts.containers.versions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {().CreateContainerVersionRequestVersionOptions} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.delete - * @desc Deletes a Container Version. - * @alias tagmanager.accounts.containers.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.get - * @desc Gets a Container Version. - * @alias tagmanager.accounts.containers.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. Specify published to retrieve the currently published version. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.list - * @desc Lists all Container Versions of a GTM Container. - * @alias tagmanager.accounts.containers.versions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {boolean=} params.headers Retrieve headers only when true. - * @param {boolean=} params.includeDeleted Also retrieve deleted (archived) versions when true. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'containerId'], - pathParams: ['accountId', 'containerId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.publish - * @desc Publishes a Container Version. - * @alias tagmanager.accounts.containers.versions.publish - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): - AxiosPromise; - publish( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - publish( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.restore - * @desc Restores a Container Version. This will overwrite the container's - * current configuration (including its variables, triggers and tags). The - * operation will not have any effect on the version that is being served - * (i.e. the published version). - * @alias tagmanager.accounts.containers.versions.restore - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - restore(params?: any, options?: MethodOptions): - AxiosPromise; - restore( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - restore( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.undelete - * @desc Undeletes a Container Version. - * @alias tagmanager.accounts.containers.versions.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): - AxiosPromise; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.update - * @desc Updates a Container Version. - * @alias tagmanager.accounts.containers.versions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.containerId The GTM Container ID. - * @param {string} params.containerVersionId The GTM Container Version ID. - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. - * @param {().ContainerVersion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'containerId', 'containerVersionId'], - pathParams: ['accountId', 'containerId', 'containerVersionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - - -export class Resource$Accounts$Permissions { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.permissions.create - * @desc Creates a user's Account & Container Permissions. - * @alias tagmanager.accounts.permissions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {().UserAccess} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.permissions.delete - * @desc Removes a user from the account, revoking access to it and all of its - * containers. - * @alias tagmanager.accounts.permissions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.permissionId The GTM User ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['accountId', 'permissionId'], - pathParams: ['accountId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace tagmanager_v1 { /** - * tagmanager.accounts.permissions.get - * @desc Gets a user's Account & Container Permissions. - * @alias tagmanager.accounts.permissions.get - * @memberOf! () + * Tag Manager API * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.permissionId The GTM User ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId', 'permissionId'], - pathParams: ['accountId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.permissions.list - * @desc List all users that have access to the account along with Account and - * Container Permissions granted to each of them. - * @alias tagmanager.accounts.permissions.list - * @memberOf! () + * Accesses Tag Manager accounts and containers. * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. @required tagmanager.accounts.permissions.list - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['accountId'], - pathParams: ['accountId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.permissions.update - * @desc Updates a user's Account & Container Permissions. - * @alias tagmanager.accounts.permissions.update - * @memberOf! () + * @example + * const google = require('googleapis'); + * const tagmanager = google.tagmanager('v1'); * - * @param {object} params Parameters for request - * @param {string} params.accountId The GTM Account ID. - * @param {string} params.permissionId The GTM User ID. - * @param {().UserAccess} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['accountId', 'permissionId'], - pathParams: ['accountId', 'permissionId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + * @namespace tagmanager + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Tagmanager + */ + export class Tagmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + accounts: Resource$Accounts; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.accounts = new Resource$Accounts(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Represents a Google Tag Manager Account. + */ + export interface Schema$Account { + /** + * The Account ID uniquely identifies the GTM Account. + */ + accountId: string; + /** + * The fingerprint of the GTM Account as computed at storage time. This + * value is recomputed whenever the account is modified. + */ + fingerprint: string; + /** + * Account display name. + */ + name: string; + /** + * Whether the account shares data anonymously with Google and others. + */ + shareData: boolean; + } + /** + * Defines the Google Tag Manager Account access permissions. + */ + export interface Schema$AccountAccess { + /** + * List of Account permissions. Valid account permissions are read and + * manage. + */ + permission: string[]; + } + /** + * Represents a predicate. + */ + export interface Schema$Condition { + /** + * A list of named parameters (key/value), depending on the condition's + * type. Notes: - For binary operators, include parameters named arg0 and + * arg1 for specifying the left and right operands, respectively. - At this + * time, the left operand (arg0) must be a reference to a variable. - For + * case-insensitive Regex matching, include a boolean parameter named + * ignore_case that is set to true. If not specified or set to any other + * value, the matching will be case sensitive. - To negate an operator, + * include a boolean parameter named negate boolean parameter that is set to + * true. + */ + parameter: Schema$Parameter[]; + /** + * The type of operator for this condition. + */ + type: string; + } + /** + * Represents a Google Tag Manager Container. + */ + export interface Schema$Container { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The Container ID uniquely identifies the GTM Container. + */ + containerId: string; + /** + * Optional list of domain names associated with the Container. + */ + domainName: string[]; + /** + * List of enabled built-in variables. Valid values include: pageUrl, + * pageHostname, pagePath, referrer, event, clickElement, clickClasses, + * clickId, clickTarget, clickUrl, clickText, formElement, formClasses, + * formId, formTarget, formUrl, formText, errorMessage, errorUrl, errorLine, + * newHistoryFragment, oldHistoryFragment, newHistoryState, oldHistoryState, + * historySource, containerVersion, debugMode, randomNumber, containerId. + */ + enabledBuiltInVariable: string[]; + /** + * The fingerprint of the GTM Container as computed at storage time. This + * value is recomputed whenever the account is modified. + */ + fingerprint: string; + /** + * Container display name. + */ + name: string; + /** + * Container Notes. + */ + notes: string; + /** + * Container Public ID. + */ + publicId: string; + /** + * Container Country ID. + */ + timeZoneCountryId: string; + /** + * Container Time Zone ID. + */ + timeZoneId: string; + /** + * List of Usage Contexts for the Container. Valid values include: web, + * android, ios. + */ + usageContext: string[]; + } + /** + * Defines the Google Tag Manager Container access permissions. + */ + export interface Schema$ContainerAccess { + /** + * GTM Container ID. + */ + containerId: string; + /** + * List of Container permissions. Valid container permissions are: read, + * edit, delete, publish. + */ + permission: string[]; + } + /** + * Represents a Google Tag Manager Container Version. + */ + export interface Schema$ContainerVersion { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The container that this version was taken from. + */ + container: Schema$Container; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The Container Version ID uniquely identifies the GTM Container Version. + */ + containerVersionId: string; + /** + * A value of true indicates this container version has been deleted. + */ + deleted: boolean; + /** + * The fingerprint of the GTM Container Version as computed at storage time. + * This value is recomputed whenever the container version is modified. + */ + fingerprint: string; + /** + * The folders in the container that this version was taken from. + */ + folder: Schema$Folder[]; + /** + * The macros in the container that this version was taken from. + */ + macro: Schema$Macro[]; + /** + * Container version display name. + */ + name: string; + /** + * User notes on how to apply this container version in the container. + */ + notes: string; + /** + * The rules in the container that this version was taken from. + */ + rule: Schema$Rule[]; + /** + * The tags in the container that this version was taken from. + */ + tag: Schema$Tag[]; + /** + * The triggers in the container that this version was taken from. + */ + trigger: Schema$Trigger[]; + /** + * The variables in the container that this version was taken from. + */ + variable: Schema$Variable[]; + } + /** + * Represents a Google Tag Manager Container Version Header. + */ + export interface Schema$ContainerVersionHeader { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The Container Version ID uniquely identifies the GTM Container Version. + */ + containerVersionId: string; + /** + * A value of true indicates this container version has been deleted. + */ + deleted: boolean; + /** + * Container version display name. + */ + name: string; + /** + * Number of macros in the container version. + */ + numMacros: string; + /** + * Number of rules in the container version. + */ + numRules: string; + /** + * Number of tags in the container version. + */ + numTags: string; + /** + * Number of triggers in the container version. + */ + numTriggers: string; + /** + * Number of variables in the container version. + */ + numVariables: string; + } + /** + * Options for new container versions. + */ + export interface Schema$CreateContainerVersionRequestVersionOptions { + /** + * The name of the container version to be created. + */ + name: string; + /** + * The notes of the container version to be created. + */ + notes: string; + /** + * The creation of this version may be for quick preview and shouldn't + * be saved. + */ + quickPreview: boolean; + } + /** + * Create container versions response. + */ + export interface Schema$CreateContainerVersionResponse { + /** + * Compiler errors or not. + */ + compilerError: boolean; + /** + * The container version created. + */ + containerVersion: Schema$ContainerVersion; + } + /** + * Represents a Google Tag Manager Environment. Note that a user can create, + * delete and update environments of type USER, but can only update the + * enable_debug and url fields of environments of other types. + */ + export interface Schema$Environment { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The environment authorization code. + */ + authorizationCode: string; + /** + * The last update time-stamp for the authorization code. + */ + authorizationTimestampMs: string; + /** + * GTM Container ID. + */ + containerId: string; + containerVersionId: string; + /** + * The environment description. Can be set or changed only on USER type + * environments. + */ + description: string; + /** + * Whether or not to enable debug by default on for the environment. + */ + enableDebug: boolean; + /** + * GTM Environment ID uniquely identifies the GTM Environment. + */ + environmentId: string; + /** + * The fingerprint of the GTM environment as computed at storage time. This + * value is recomputed whenever the environment is modified. + */ + fingerprint: string; + /** + * The environment display name. Can be set or changed only on USER type + * environments. + */ + name: string; + /** + * The type of this environment. + */ + type: string; + /** + * Default preview page url for the environment. + */ + url: string; + } + /** + * Represents a Google Tag Manager Folder. + */ + export interface Schema$Folder { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Folder as computed at storage time. This value + * is recomputed whenever the folder is modified. + */ + fingerprint: string; + /** + * The Folder ID uniquely identifies the GTM Folder. + */ + folderId: string; + /** + * Folder display name. + */ + name: string; + } + /** + * Represents a Google Tag Manager Folder's contents. + */ + export interface Schema$FolderEntities { + /** + * The list of tags inside the folder. + */ + tag: Schema$Tag[]; + /** + * The list of triggers inside the folder. + */ + trigger: Schema$Trigger[]; + /** + * The list of variables inside the folder. + */ + variable: Schema$Variable[]; + } + /** + * List Accounts Response. + */ + export interface Schema$ListAccountsResponse { + /** + * List of GTM Accounts that a user has access to. + */ + accounts: Schema$Account[]; + } + /** + * List AccountUsers Response. + */ + export interface Schema$ListAccountUsersResponse { + /** + * All GTM AccountUsers of a GTM Account. + */ + userAccess: Schema$UserAccess[]; + } + /** + * List Containers Response. + */ + export interface Schema$ListContainersResponse { + /** + * All Containers of a GTM Account. + */ + containers: Schema$Container[]; + } + /** + * List container versions response. + */ + export interface Schema$ListContainerVersionsResponse { + /** + * All versions of a GTM Container. + */ + containerVersion: Schema$ContainerVersion[]; + /** + * All container version headers of a GTM Container. + */ + containerVersionHeader: Schema$ContainerVersionHeader[]; + } + /** + * List Environments Response. + */ + export interface Schema$ListEnvironmentsResponse { + /** + * All Environments of a GTM Container. + */ + environments: Schema$Environment[]; + } + /** + * List Folders Response. + */ + export interface Schema$ListFoldersResponse { + /** + * All GTM Folders of a GTM Container. + */ + folders: Schema$Folder[]; + } + /** + * List Tags Response. + */ + export interface Schema$ListTagsResponse { + /** + * All GTM Tags of a GTM Container. + */ + tags: Schema$Tag[]; + } + /** + * List triggers response. + */ + export interface Schema$ListTriggersResponse { + /** + * All GTM Triggers of a GTM Container. + */ + triggers: Schema$Trigger[]; + } + /** + * List Variables Response. + */ + export interface Schema$ListVariablesResponse { + /** + * All GTM Variables of a GTM Container. + */ + variables: Schema$Variable[]; + } + /** + * Represents a Google Tag Manager Macro. + */ + export interface Schema$Macro { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * For mobile containers only: A list of rule IDs for disabling conditional + * macros; the macro is enabled if one of the enabling rules is true while + * all the disabling rules are false. Treated as an unordered set. + */ + disablingRuleId: string[]; + /** + * For mobile containers only: A list of rule IDs for enabling conditional + * macros; the macro is enabled if one of the enabling rules is true while + * all the disabling rules are false. Treated as an unordered set. + */ + enablingRuleId: string[]; + /** + * The fingerprint of the GTM Macro as computed at storage time. This value + * is recomputed whenever the macro is modified. + */ + fingerprint: string; + /** + * The Macro ID uniquely identifies the GTM Macro. + */ + macroId: string; + /** + * Macro display name. + */ + name: string; + /** + * User notes on how to apply this macro in the container. + */ + notes: string; + /** + * The macro's parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * The end timestamp in milliseconds to schedule a macro. + */ + scheduleEndMs: string; + /** + * The start timestamp in milliseconds to schedule a macro. + */ + scheduleStartMs: string; + /** + * GTM Macro Type. + */ + type: string; + } + /** + * Represents a Google Tag Manager Parameter. + */ + export interface Schema$Parameter { + /** + * The named key that uniquely identifies a parameter. Required for + * top-level parameters, as well as map values. Ignored for list values. + */ + key: string; + /** + * This list parameter's parameters (keys will be ignored). + */ + list: Schema$Parameter[]; + /** + * This map parameter's parameters (must have keys; keys must be + * unique). + */ + map: Schema$Parameter[]; + /** + * The parameter type. Valid values are: - boolean: The value represents a + * boolean, represented as 'true' or 'false' - integer: The + * value represents a 64-bit signed integer value, in base 10 - list: A + * list of parameters should be specified - map: A map of parameters should + * be specified - template: The value represents any text; this can include + * variable references (even variable references that might return + * non-string types) + */ + type: string; + /** + * A parameter's value (may contain variable references such as + * "{{myVariable}}") as appropriate to the specified type. + */ + value: string; + } + /** + * Publish container version response. + */ + export interface Schema$PublishContainerVersionResponse { + /** + * Compiler errors or not. + */ + compilerError: boolean; + /** + * The container version created. + */ + containerVersion: Schema$ContainerVersion; + } + /** + * Represents a Google Tag Manager Rule. + */ + export interface Schema$Rule { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The list of conditions that make up this rule (implicit AND between + * them). + */ + condition: Schema$Condition[]; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Rule as computed at storage time. This value + * is recomputed whenever the rule is modified. + */ + fingerprint: string; + /** + * Rule display name. + */ + name: string; + /** + * User notes on how to apply this rule in the container. + */ + notes: string; + /** + * The Rule ID uniquely identifies the GTM Rule. + */ + ruleId: string; + } + export interface Schema$SetupTag { + /** + * If true, fire the main tag if and only if the setup tag fires + * successfully. If false, fire the main tag regardless of setup tag firing + * status. + */ + stopOnSetupFailure: boolean; + /** + * The name of the setup tag. + */ + tagName: string; + } + /** + * Represents a Google Tag Manager Tag. + */ + export interface Schema$Tag { + /** + * GTM Account ID. + */ + accountId: string; + /** + * Blocking rule IDs. If any of the listed rules evaluate to true, the tag + * will not fire. + */ + blockingRuleId: string[]; + /** + * Blocking trigger IDs. If any of the listed triggers evaluate to true, the + * tag will not fire. + */ + blockingTriggerId: string[]; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Tag as computed at storage time. This value is + * recomputed whenever the tag is modified. + */ + fingerprint: string; + /** + * Firing rule IDs. A tag will fire when any of the listed rules are true + * and all of its blockingRuleIds (if any specified) are false. + */ + firingRuleId: string[]; + /** + * Firing trigger IDs. A tag will fire when any of the listed triggers are + * true and all of its blockingTriggerIds (if any specified) are false. + */ + firingTriggerId: string[]; + /** + * If set to true, this tag will only fire in the live environment (e.g. not + * in preview or debug mode). + */ + liveOnly: boolean; + /** + * Tag display name. + */ + name: string; + /** + * User notes on how to apply this tag in the container. + */ + notes: string; + /** + * The tag's parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * True if the tag is paused. + */ + paused: boolean; + /** + * User defined numeric priority of the tag. Tags are fired asynchronously + * in order of priority. Tags with higher numeric value fire first. A + * tag's priority can be a positive or negative value. The default value + * is 0. + */ + priority: Schema$Parameter; + /** + * The end timestamp in milliseconds to schedule a tag. + */ + scheduleEndMs: string; + /** + * The start timestamp in milliseconds to schedule a tag. + */ + scheduleStartMs: string; + /** + * The list of setup tags. Currently we only allow one. + */ + setupTag: Schema$SetupTag[]; + /** + * Option to fire this tag. + */ + tagFiringOption: string; + /** + * The Tag ID uniquely identifies the GTM Tag. + */ + tagId: string; + /** + * The list of teardown tags. Currently we only allow one. + */ + teardownTag: Schema$TeardownTag[]; + /** + * GTM Tag Type. + */ + type: string; + } + export interface Schema$TeardownTag { + /** + * If true, fire the teardown tag if and only if the main tag fires + * successfully. If false, fire the teardown tag regardless of main tag + * firing status. + */ + stopTeardownOnFailure: boolean; + /** + * The name of the teardown tag. + */ + tagName: string; + } + /** + * Represents a Google Tag Manager Trigger + */ + export interface Schema$Trigger { + /** + * GTM Account ID. + */ + accountId: string; + /** + * Used in the case of auto event tracking. + */ + autoEventFilter: Schema$Condition[]; + /** + * Whether or not we should only fire tags if the form submit or link click + * event is not cancelled by some other event handler (e.g. because of + * validation). Only valid for Form Submission and Link Click triggers. + */ + checkValidation: Schema$Parameter; + /** + * GTM Container ID. + */ + containerId: string; + /** + * A visibility trigger minimum continuous visible time (in milliseconds). + * Only valid for AMP Visibility trigger. + */ + continuousTimeMinMilliseconds: Schema$Parameter; + /** + * Used in the case of custom event, which is fired iff all Conditions are + * true. + */ + customEventFilter: Schema$Condition[]; + /** + * Name of the GTM event that is fired. Only valid for Timer triggers. + */ + eventName: Schema$Parameter; + /** + * The trigger will only fire iff all Conditions are true. + */ + filter: Schema$Condition[]; + /** + * The fingerprint of the GTM Trigger as computed at storage time. This + * value is recomputed whenever the trigger is modified. + */ + fingerprint: string; + /** + * List of integer percentage values for scroll triggers. The trigger will + * fire when each percentage is reached when the view is scrolled + * horizontally. Only valid for AMP scroll triggers. + */ + horizontalScrollPercentageList: Schema$Parameter; + /** + * Time between triggering recurring Timer Events (in milliseconds). Only + * valid for Timer triggers. + */ + interval: Schema$Parameter; + /** + * Time between Timer Events to fire (in seconds). Only valid for AMP Timer + * trigger. + */ + intervalSeconds: Schema$Parameter; + /** + * Limit of the number of GTM events this Timer Trigger will fire. If no + * limit is set, we will continue to fire GTM events until the user leaves + * the page. Only valid for Timer triggers. + */ + limit: Schema$Parameter; + /** + * Max time to fire Timer Events (in seconds). Only valid for AMP Timer + * trigger. + */ + maxTimerLengthSeconds: Schema$Parameter; + /** + * Trigger display name. + */ + name: string; + /** + * Additional parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * A click trigger CSS selector (i.e. "a", "button" + * etc.). Only valid for AMP Click trigger. + */ + selector: Schema$Parameter; + /** + * A visibility trigger minimum total visible time (in milliseconds). Only + * valid for AMP Visibility trigger. + */ + totalTimeMinMilliseconds: Schema$Parameter; + /** + * The Trigger ID uniquely identifies the GTM Trigger. + */ + triggerId: string; + /** + * Defines the data layer event that causes this trigger. + */ + type: string; + /** + * Globally unique id of the trigger that auto-generates this (a Form + * Submit, Link Click or Timer listener) if any. Used to make incompatible + * auto-events work together with trigger filtering based on trigger ids. + * This value is populated during output generation since the tags implied + * by triggers don't exist until then. Only valid for Form Submit, Link + * Click and Timer triggers. + */ + uniqueTriggerId: Schema$Parameter; + /** + * List of integer percentage values for scroll triggers. The trigger will + * fire when each percentage is reached when the view is scrolled + * vertically. Only valid for AMP scroll triggers. + */ + verticalScrollPercentageList: Schema$Parameter; + /** + * A visibility trigger CSS selector (i.e. "#id"). Only valid for + * AMP Visibility trigger. + */ + visibilitySelector: Schema$Parameter; + /** + * A visibility trigger maximum percent visibility. Only valid for AMP + * Visibility trigger. + */ + visiblePercentageMax: Schema$Parameter; + /** + * A visibility trigger minimum percent visibility. Only valid for AMP + * Visibility trigger. + */ + visiblePercentageMin: Schema$Parameter; + /** + * Whether or not we should delay the form submissions or link opening until + * all of the tags have fired (by preventing the default action and later + * simulating the default action). Only valid for Form Submission and Link + * Click triggers. + */ + waitForTags: Schema$Parameter; + /** + * How long to wait (in milliseconds) for tags to fire when + * 'waits_for_tags' above evaluates to true. Only valid for Form + * Submission and Link Click triggers. + */ + waitForTagsTimeout: Schema$Parameter; + } + /** + * Represents a user's permissions to an account and its container. + */ + export interface Schema$UserAccess { + /** + * GTM Account access permissions. + */ + accountAccess: Schema$AccountAccess; + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container access permissions. + */ + containerAccess: Schema$ContainerAccess[]; + /** + * User's email address. + */ + emailAddress: string; + /** + * Account Permission ID. + */ + permissionId: string; + } + /** + * Represents a Google Tag Manager Variable. + */ + export interface Schema$Variable { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * For mobile containers only: A list of trigger IDs for disabling + * conditional variables; the variable is enabled if one of the enabling + * trigger is true while all the disabling trigger are false. Treated as an + * unordered set. + */ + disablingTriggerId: string[]; + /** + * For mobile containers only: A list of trigger IDs for enabling + * conditional variables; the variable is enabled if one of the enabling + * triggers is true while all the disabling triggers are false. Treated as + * an unordered set. + */ + enablingTriggerId: string[]; + /** + * The fingerprint of the GTM Variable as computed at storage time. This + * value is recomputed whenever the variable is modified. + */ + fingerprint: string; + /** + * Variable display name. + */ + name: string; + /** + * User notes on how to apply this variable in the container. + */ + notes: string; + /** + * The variable's parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * The end timestamp in milliseconds to schedule a variable. + */ + scheduleEndMs: string; + /** + * The start timestamp in milliseconds to schedule a variable. + */ + scheduleStartMs: string; + /** + * GTM Variable Type. + */ + type: string; + /** + * The Variable ID uniquely identifies the GTM Variable. + */ + variableId: string; + } + + export class Resource$Accounts { + root: Tagmanager; + containers: Resource$Accounts$Containers; + permissions: Resource$Accounts$Permissions; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.containers = new Resource$Accounts$Containers(root); + this.permissions = new Resource$Accounts$Permissions(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.get + * @desc Gets a GTM Account. + * @alias tagmanager.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.list + * @desc Lists all GTM Accounts that a user has access to. + * @alias tagmanager.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.update + * @desc Updates a GTM Account. + * @alias tagmanager.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the account in storage. + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Containers { + root: Tagmanager; + environments: Resource$Accounts$Containers$Environments; + folders: Resource$Accounts$Containers$Folders; + move_folders: Resource$Accounts$Containers$Move_folders; + reauthorize_environments: + Resource$Accounts$Containers$Reauthorize_environments; + tags: Resource$Accounts$Containers$Tags; + triggers: Resource$Accounts$Containers$Triggers; + variables: Resource$Accounts$Containers$Variables; + versions: Resource$Accounts$Containers$Versions; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.environments = new Resource$Accounts$Containers$Environments(root); + this.folders = new Resource$Accounts$Containers$Folders(root); + this.move_folders = new Resource$Accounts$Containers$Move_folders(root); + this.reauthorize_environments = + new Resource$Accounts$Containers$Reauthorize_environments(root); + this.tags = new Resource$Accounts$Containers$Tags(root); + this.triggers = new Resource$Accounts$Containers$Triggers(root); + this.variables = new Resource$Accounts$Containers$Variables(root); + this.versions = new Resource$Accounts$Containers$Versions(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.create + * @desc Creates a Container. + * @alias tagmanager.accounts.containers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {().Container} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/containers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.delete + * @desc Deletes a Container. + * @alias tagmanager.accounts.containers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.get + * @desc Gets a Container. + * @alias tagmanager.accounts.containers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.list + * @desc Lists all Containers that belongs to a GTM Account. + * @alias tagmanager.accounts.containers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/containers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.update + * @desc Updates a Container. + * @alias tagmanager.accounts.containers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container in storage. + * @param {().Container} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Containers$Environments { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.environments.create + * @desc Creates a GTM Environment. + * @alias tagmanager.accounts.containers.environments.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.delete + * @desc Deletes a GTM Environment. + * @alias tagmanager.accounts.containers.environments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.environmentId The GTM Environment ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'environmentId'], + pathParams: ['accountId', 'containerId', 'environmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.get + * @desc Gets a GTM Environment. + * @alias tagmanager.accounts.containers.environments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.environmentId The GTM Environment ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'environmentId'], + pathParams: ['accountId', 'containerId', 'environmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.list + * @desc Lists all GTM Environments of a GTM Container. + * @alias tagmanager.accounts.containers.environments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.patch + * @desc Updates a GTM Environment. This method supports patch semantics. + * @alias tagmanager.accounts.containers.environments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.environmentId The GTM Environment ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'environmentId'], + pathParams: ['accountId', 'containerId', 'environmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.update + * @desc Updates a GTM Environment. + * @alias tagmanager.accounts.containers.environments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.environmentId The GTM Environment ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'environmentId'], + pathParams: ['accountId', 'containerId', 'environmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Folders { + root: Tagmanager; + entities: Resource$Accounts$Containers$Folders$Entities; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.entities = new Resource$Accounts$Containers$Folders$Entities(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.folders.create + * @desc Creates a GTM Folder. + * @alias tagmanager.accounts.containers.folders.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.folders.delete + * @desc Deletes a GTM Folder. + * @alias tagmanager.accounts.containers.folders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.folderId The GTM Folder ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'folderId'], + pathParams: ['accountId', 'containerId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.folders.get + * @desc Gets a GTM Folder. + * @alias tagmanager.accounts.containers.folders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.folderId The GTM Folder ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'folderId'], + pathParams: ['accountId', 'containerId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.folders.list + * @desc Lists all GTM Folders of a Container. + * @alias tagmanager.accounts.containers.folders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.folders.update + * @desc Updates a GTM Folder. + * @alias tagmanager.accounts.containers.folders.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the folder in storage. + * @param {string} params.folderId The GTM Folder ID. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'folderId'], + pathParams: ['accountId', 'containerId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Accounts$Containers$Folders$Entities { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.folders.entities.list + * @desc List all entities in a GTM Folder. + * @alias tagmanager.accounts.containers.folders.entities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.folderId The GTM Folder ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'folderId'], + pathParams: ['accountId', 'containerId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Accounts$Containers$Move_folders { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.move_folders.update + * @desc Moves entities to a GTM Folder. + * @alias tagmanager.accounts.containers.move_folders.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.folderId The GTM Folder ID. + * @param {string=} params.tagId The tags to be moved to the folder. + * @param {string=} params.triggerId The triggers to be moved to the folder. + * @param {string=} params.variableId The variables to be moved to the folder. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'folderId'], + pathParams: ['accountId', 'containerId', 'folderId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Reauthorize_environments { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.reauthorize_environments.update + * @desc Re-generates the authorization code for a GTM Environment. + * @alias tagmanager.accounts.containers.reauthorize_environments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.environmentId The GTM Environment ID. + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'environmentId'], + pathParams: ['accountId', 'containerId', 'environmentId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Tags { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.tags.create + * @desc Creates a GTM Tag. + * @alias tagmanager.accounts.containers.tags.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().Tag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.tags.delete + * @desc Deletes a GTM Tag. + * @alias tagmanager.accounts.containers.tags.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.tagId The GTM Tag ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'tagId'], + pathParams: ['accountId', 'containerId', 'tagId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.tags.get + * @desc Gets a GTM Tag. + * @alias tagmanager.accounts.containers.tags.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.tagId The GTM Tag ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'tagId'], + pathParams: ['accountId', 'containerId', 'tagId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.tags.list + * @desc Lists all GTM Tags of a Container. + * @alias tagmanager.accounts.containers.tags.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.tags.update + * @desc Updates a GTM Tag. + * @alias tagmanager.accounts.containers.tags.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. + * @param {string} params.tagId The GTM Tag ID. + * @param {().Tag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'tagId'], + pathParams: ['accountId', 'containerId', 'tagId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Triggers { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.triggers.create + * @desc Creates a GTM Trigger. + * @alias tagmanager.accounts.containers.triggers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().Trigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.triggers.delete + * @desc Deletes a GTM Trigger. + * @alias tagmanager.accounts.containers.triggers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.triggerId The GTM Trigger ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'triggerId'], + pathParams: ['accountId', 'containerId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.triggers.get + * @desc Gets a GTM Trigger. + * @alias tagmanager.accounts.containers.triggers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.triggerId The GTM Trigger ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'triggerId'], + pathParams: ['accountId', 'containerId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.triggers.list + * @desc Lists all GTM Triggers of a Container. + * @alias tagmanager.accounts.containers.triggers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.triggers.update + * @desc Updates a GTM Trigger. + * @alias tagmanager.accounts.containers.triggers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. + * @param {string} params.triggerId The GTM Trigger ID. + * @param {().Trigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'triggerId'], + pathParams: ['accountId', 'containerId', 'triggerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Variables { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.variables.create + * @desc Creates a GTM Variable. + * @alias tagmanager.accounts.containers.variables.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.variables.delete + * @desc Deletes a GTM Variable. + * @alias tagmanager.accounts.containers.variables.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.variableId The GTM Variable ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'variableId'], + pathParams: ['accountId', 'containerId', 'variableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.variables.get + * @desc Gets a GTM Variable. + * @alias tagmanager.accounts.containers.variables.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.variableId The GTM Variable ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'variableId'], + pathParams: ['accountId', 'containerId', 'variableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.variables.list + * @desc Lists all GTM Variables of a Container. + * @alias tagmanager.accounts.containers.variables.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.variables.update + * @desc Updates a GTM Variable. + * @alias tagmanager.accounts.containers.variables.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. + * @param {string} params.variableId The GTM Variable ID. + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'variableId'], + pathParams: ['accountId', 'containerId', 'variableId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Accounts$Containers$Versions { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.versions.create + * @desc Creates a Container Version. + * @alias tagmanager.accounts.containers.versions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {().CreateContainerVersionRequestVersionOptions} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.delete + * @desc Deletes a Container Version. + * @alias tagmanager.accounts.containers.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.get + * @desc Gets a Container Version. + * @alias tagmanager.accounts.containers.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. Specify published to retrieve the currently published version. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.list + * @desc Lists all Container Versions of a GTM Container. + * @alias tagmanager.accounts.containers.versions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {boolean=} params.headers Retrieve headers only when true. + * @param {boolean=} params.includeDeleted Also retrieve deleted (archived) versions when true. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'containerId'], + pathParams: ['accountId', 'containerId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.publish + * @desc Publishes a Container Version. + * @alias tagmanager.accounts.containers.versions.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): + AxiosPromise; + publish( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + publish( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.restore + * @desc Restores a Container Version. This will overwrite the container's + * current configuration (including its variables, triggers and tags). The + * operation will not have any effect on the version that is being served + * (i.e. the published version). + * @alias tagmanager.accounts.containers.versions.restore + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + restore(params?: any, options?: MethodOptions): + AxiosPromise; + restore( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + restore( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.undelete + * @desc Undeletes a Container Version. + * @alias tagmanager.accounts.containers.versions.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.update + * @desc Updates a Container Version. + * @alias tagmanager.accounts.containers.versions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.containerId The GTM Container ID. + * @param {string} params.containerVersionId The GTM Container Version ID. + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. + * @param {().ContainerVersion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'containerId', 'containerVersionId'], + pathParams: ['accountId', 'containerId', 'containerVersionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + + export class Resource$Accounts$Permissions { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.permissions.create + * @desc Creates a user's Account & Container Permissions. + * @alias tagmanager.accounts.permissions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {().UserAccess} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.permissions.delete + * @desc Removes a user from the account, revoking access to it and all of + * its containers. + * @alias tagmanager.accounts.permissions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.permissionId The GTM User ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['accountId', 'permissionId'], + pathParams: ['accountId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.permissions.get + * @desc Gets a user's Account & Container Permissions. + * @alias tagmanager.accounts.permissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.permissionId The GTM User ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId', 'permissionId'], + pathParams: ['accountId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.permissions.list + * @desc List all users that have access to the account along with Account + * and Container Permissions granted to each of them. + * @alias tagmanager.accounts.permissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. @required tagmanager.accounts.permissions.list + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v1/accounts/{accountId}/permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['accountId'], + pathParams: ['accountId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.permissions.update + * @desc Updates a user's Account & Container Permissions. + * @alias tagmanager.accounts.permissions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The GTM Account ID. + * @param {string} params.permissionId The GTM User ID. + * @param {().UserAccess} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/tagmanager/v1/accounts/{accountId}/permissions/{permissionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['accountId', 'permissionId'], + pathParams: ['accountId', 'permissionId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/tagmanager/v2.ts b/src/apis/tagmanager/v2.ts index 67f617405a0..04b7a4180e8 100644 --- a/src/apis/tagmanager/v2.ts +++ b/src/apis/tagmanager/v2.ts @@ -27,5702 +27,5749 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Tag Manager API - * - * Accesses Tag Manager accounts and containers. - * - * @example - * const google = require('googleapis'); - * const tagmanager = google.tagmanager('v2'); - * - * @namespace tagmanager - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Tagmanager - */ -export class Tagmanager { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - accounts: Resource$Accounts; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.accounts = new Resource$Accounts(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Represents a Google Tag Manager Account. - */ -export interface Schema$Account { - /** - * The Account ID uniquely identifies the GTM Account. - */ - accountId: string; - /** - * The fingerprint of the GTM Account as computed at storage time. This value - * is recomputed whenever the account is modified. - */ - fingerprint: string; - /** - * Account display name. - */ - name: string; - /** - * GTM Account's API relative path. - */ - path: string; - /** - * Whether the account shares data anonymously with Google and others. This - * flag enables benchmarking by sharing your data in an anonymous form. Google - * will remove all identifiable information about your website, combine the - * data with hundreds of other anonymous sites and report aggregate trends in - * the benchmarking service. - */ - shareData: boolean; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; -} -/** - * Defines the Google Tag Manager Account access permissions. - */ -export interface Schema$AccountAccess { - /** - * Whether the user has no access, user access, or admin access to an account. - */ - permission: string; -} -/** - * Built-in variables are a special category of variables that are pre-created - * and non-customizable. They provide common functionality like accessing - * propeties of the gtm data layer, monitoring clicks, or accessing elements of - * a page URL. - */ -export interface Schema$BuiltInVariable { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * Name of the built-in variable to be used to refer to the built-in variable. - */ - name: string; - /** - * GTM BuiltInVariable's API relative path. - */ - path: string; - /** - * Type of built-in variable. - */ - type: string; - /** - * GTM Workspace ID. - */ - workspaceId: string; -} -/** - * Represents a predicate. - */ -export interface Schema$Condition { - /** - * A list of named parameters (key/value), depending on the condition's - * type. Notes: - For binary operators, include parameters named arg0 and - * arg1 for specifying the left and right operands, respectively. - At this - * time, the left operand (arg0) must be a reference to a variable. - For - * case-insensitive Regex matching, include a boolean parameter named - * ignore_case that is set to true. If not specified or set to any other - * value, the matching will be case sensitive. - To negate an operator, - * include a boolean parameter named negate boolean parameter that is set to - * true. - */ - parameter: Schema$Parameter[]; - /** - * The type of operator for this condition. - */ - type: string; -} -/** - * Represents a Google Tag Manager Container, which specifies the platform tags - * will run on, manages workspaces, and retains container versions. - */ -export interface Schema$Container { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The Container ID uniquely identifies the GTM Container. - */ - containerId: string; - /** - * List of domain names associated with the Container. - */ - domainName: string[]; - /** - * The fingerprint of the GTM Container as computed at storage time. This - * value is recomputed whenever the account is modified. - */ - fingerprint: string; - /** - * Container display name. - */ - name: string; - /** - * Container Notes. - */ - notes: string; - /** - * GTM Container's API relative path. - */ - path: string; - /** - * Container Public ID. - */ - publicId: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * List of Usage Contexts for the Container. Valid values include: web, - * android, or ios. - */ - usageContext: string[]; -} -/** - * Defines the Google Tag Manager Container access permissions. - */ -export interface Schema$ContainerAccess { - /** - * GTM Container ID. - */ - containerId: string; - /** - * List of Container permissions. - */ - permission: string; -} -/** - * Represents a Google Tag Manager Container Version. - */ -export interface Schema$ContainerVersion { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The built-in variables in the container that this version was taken from. - */ - builtInVariable: Schema$BuiltInVariable[]; - /** - * The container that this version was taken from. - */ - container: Schema$Container; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The Container Version ID uniquely identifies the GTM Container Version. - */ - containerVersionId: string; - /** - * A value of true indicates this container version has been deleted. - */ - deleted: boolean; - /** - * Container version description. - */ - description: string; - /** - * The fingerprint of the GTM Container Version as computed at storage time. - * This value is recomputed whenever the container version is modified. - */ - fingerprint: string; - /** - * The folders in the container that this version was taken from. - */ - folder: Schema$Folder[]; - /** - * Container version display name. - */ - name: string; - /** - * GTM ContainerVersions's API relative path. - */ - path: string; - /** - * The tags in the container that this version was taken from. - */ - tag: Schema$Tag[]; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * The triggers in the container that this version was taken from. - */ - trigger: Schema$Trigger[]; - /** - * The variables in the container that this version was taken from. - */ - variable: Schema$Variable[]; - /** - * The zones in the container that this version was taken from. - */ - zone: Schema$Zone[]; -} -/** - * Represents a Google Tag Manager Container Version Header. - */ -export interface Schema$ContainerVersionHeader { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The Container Version ID uniquely identifies the GTM Container Version. - */ - containerVersionId: string; - /** - * A value of true indicates this container version has been deleted. - */ - deleted: boolean; - /** - * Container version display name. - */ - name: string; - /** - * Number of macros in the container version. - */ - numMacros: string; - /** - * Number of rules in the container version. - */ - numRules: string; - /** - * Number of tags in the container version. - */ - numTags: string; - /** - * Number of triggers in the container version. - */ - numTriggers: string; - /** - * Number of variables in the container version. - */ - numVariables: string; - /** - * Number of zones in the container version. - */ - numZones: string; - /** - * GTM Container Versions's API relative path. - */ - path: string; -} -export interface Schema$CreateBuiltInVariableResponse { - /** - * List of created built-in variables. - */ - builtInVariable: Schema$BuiltInVariable[]; -} -/** - * Options for new container versions. - */ -export interface Schema$CreateContainerVersionRequestVersionOptions { - /** - * The name of the container version to be created. - */ - name: string; - /** - * The notes of the container version to be created. - */ - notes: string; -} -/** - * Create container versions response. - */ -export interface Schema$CreateContainerVersionResponse { - /** - * Compiler errors or not. - */ - compilerError: boolean; - /** - * The container version created. - */ - containerVersion: Schema$ContainerVersion; - /** - * Auto generated workspace path created as a result of version creation. This - * field should only be populated if the created version was not a quick - * preview. - */ - newWorkspacePath: string; - /** - * Whether version creation failed when syncing the workspace to the latest - * container version. - */ - syncStatus: Schema$SyncStatus; -} -/** - * Creates a workspace proposal to start a review of a workspace. - */ -export interface Schema$CreateWorkspaceProposalRequest { - /** - * If present, an initial comment to associate with the workspace proposal. - */ - initialComment: Schema$WorkspaceProposalHistoryComment; - /** - * List of users to review the workspace proposal. - */ - reviewers: Schema$WorkspaceProposalUser[]; -} -/** - * A workspace entity that may represent a tag, trigger, variable, or folder in - * addition to its status in the workspace. - */ -export interface Schema$Entity { - /** - * Represents how the entity has been changed in the workspace. - */ - changeStatus: string; - /** - * The Folder being represented by the entity. - */ - folder: Schema$Folder; - /** - * The tag being represented by the entity. - */ - tag: Schema$Tag; - /** - * The trigger being represented by the entity. - */ - trigger: Schema$Trigger; - /** - * The variable being represented by the entity. - */ - variable: Schema$Variable; -} -/** - * Represents a Google Tag Manager Environment. Note that a user can create, - * delete and update environments of type USER, but can only update the - * enable_debug and url fields of environments of other types. - */ -export interface Schema$Environment { - /** - * GTM Account ID. - */ - accountId: string; - /** - * The environment authorization code. - */ - authorizationCode: string; - /** - * The last update time-stamp for the authorization code. - */ - authorizationTimestamp: Schema$Timestamp; - /** - * GTM Container ID. - */ - containerId: string; - /** - * Represents a link to a container version. - */ - containerVersionId: string; - /** - * The environment description. Can be set or changed only on USER type - * environments. - */ - description: string; - /** - * Whether or not to enable debug by default for the environment. - */ - enableDebug: boolean; - /** - * GTM Environment ID uniquely identifies the GTM Environment. - */ - environmentId: string; - /** - * The fingerprint of the GTM environment as computed at storage time. This - * value is recomputed whenever the environment is modified. - */ - fingerprint: string; - /** - * The environment display name. Can be set or changed only on USER type - * environments. - */ - name: string; - /** - * GTM Environment's API relative path. - */ - path: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * The type of this environment. - */ - type: string; - /** - * Default preview page url for the environment. - */ - url: string; - /** - * Represents a link to a quick preview of a workspace. - */ - workspaceId: string; -} -/** - * Represents a Google Tag Manager Folder. - */ -export interface Schema$Folder { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Folder as computed at storage time. This value - * is recomputed whenever the folder is modified. - */ - fingerprint: string; - /** - * The Folder ID uniquely identifies the GTM Folder. - */ - folderId: string; - /** - * Folder display name. - */ - name: string; - /** - * User notes on how to apply this folder in the container. - */ - notes: string; - /** - * GTM Folder's API relative path. - */ - path: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * GTM Workspace ID. - */ - workspaceId: string; -} -/** - * Represents a Google Tag Manager Folder's contents. - */ -export interface Schema$FolderEntities { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * The list of tags inside the folder. - */ - tag: Schema$Tag[]; - /** - * The list of triggers inside the folder. - */ - trigger: Schema$Trigger[]; - /** - * The list of variables inside the folder. - */ - variable: Schema$Variable[]; -} -/** - * The changes that have occurred in the workspace since the base container - * version. - */ -export interface Schema$GetWorkspaceStatusResponse { - /** - * The merge conflict after sync. - */ - mergeConflict: Schema$MergeConflict[]; - /** - * Entities that have been changed in the workspace. - */ - workspaceChange: Schema$Entity[]; -} -/** - * List Accounts Response. - */ -export interface Schema$ListAccountsResponse { - /** - * List of GTM Accounts that a user has access to. - */ - account: Schema$Account[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * List Containers Response. - */ -export interface Schema$ListContainersResponse { - /** - * All Containers of a GTM Account. - */ - container: Schema$Container[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * List container versions response. - */ -export interface Schema$ListContainerVersionsResponse { - /** - * All container version headers of a GTM Container. - */ - containerVersionHeader: Schema$ContainerVersionHeader[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * A list of enabled built-in variables. - */ -export interface Schema$ListEnabledBuiltInVariablesResponse { - /** - * All GTM BuiltInVariables of a GTM container. - */ - builtInVariable: Schema$BuiltInVariable[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * List Environments Response. - */ -export interface Schema$ListEnvironmentsResponse { - /** - * All Environments of a GTM Container. - */ - environment: Schema$Environment[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * List Folders Response. - */ -export interface Schema$ListFoldersResponse { - /** - * All GTM Folders of a GTM Container. - */ - folder: Schema$Folder[]; - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; -} -/** - * List Tags Response. - */ -export interface Schema$ListTagsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * All GTM Tags of a GTM Container. - */ - tag: Schema$Tag[]; -} -/** - * List triggers response. - */ -export interface Schema$ListTriggersResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * All GTM Triggers of a GTM Container. - */ - trigger: Schema$Trigger[]; -} -/** - * List user permissions response. - */ -export interface Schema$ListUserPermissionsResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * All GTM UserPermissions of a GTM Account. - */ - userPermission: Schema$UserPermission[]; -} -/** - * List Variables Response. - */ -export interface Schema$ListVariablesResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * All GTM Variables of a GTM Container. - */ - variable: Schema$Variable[]; -} -/** - * A list of workspaces in a container. - */ -export interface Schema$ListWorkspacesResponse { - /** - * Continuation token for fetching the next page of results. - */ - nextPageToken: string; - /** - * All Workspaces of a GTM Container. - */ - workspace: Schema$Workspace[]; -} -/** - * Represents a merge conflict. - */ -export interface Schema$MergeConflict { - /** - * The base version entity (since the latest sync operation) that has - * conflicting changes compared to the workspace. If this field is missing, it - * means the workspace entity is deleted from the base version. - */ - entityInBaseVersion: Schema$Entity; - /** - * The workspace entity that has conflicting changes compared to the base - * version. If an entity is deleted in a workspace, it will still appear with - * a deleted change status. - */ - entityInWorkspace: Schema$Entity; -} -/** - * Represents a Google Tag Manager Parameter. - */ -export interface Schema$Parameter { - /** - * The named key that uniquely identifies a parameter. Required for top-level - * parameters, as well as map values. Ignored for list values. - */ - key: string; - /** - * This list parameter's parameters (keys will be ignored). - */ - list: Schema$Parameter[]; - /** - * This map parameter's parameters (must have keys; keys must be unique). - */ - map: Schema$Parameter[]; - /** - * The parameter type. Valid values are: - boolean: The value represents a - * boolean, represented as 'true' or 'false' - integer: The - * value represents a 64-bit signed integer value, in base 10 - list: A list - * of parameters should be specified - map: A map of parameters should be - * specified - template: The value represents any text; this can include - * variable references (even variable references that might return non-string - * types) - */ - type: string; - /** - * A parameter's value (may contain variable references such as - * "{{myVariable}}") as appropriate to the specified type. - */ - value: string; -} -/** - * Publish container version response. - */ -export interface Schema$PublishContainerVersionResponse { - /** - * Compiler errors or not. - */ - compilerError: boolean; - /** - * The container version created. - */ - containerVersion: Schema$ContainerVersion; -} -/** - * Response to quick previewing a workspace. - */ -export interface Schema$QuickPreviewResponse { - /** - * Were there compiler errors or not. - */ - compilerError: boolean; - /** - * The quick previewed container version. - */ - containerVersion: Schema$ContainerVersion; - /** - * Whether quick previewing failed when syncing the workspace to the latest - * container version. - */ - syncStatus: Schema$SyncStatus; -} -/** - * The result of reverting a built-in variable in a workspace. - */ -export interface Schema$RevertBuiltInVariableResponse { - /** - * Whether the built-in variable is enabled after reversion. - */ - enabled: boolean; -} -/** - * The result of reverting folder changes in a workspace. - */ -export interface Schema$RevertFolderResponse { - /** - * Folder as it appears in the latest container version since the last - * workspace synchronization operation. If no folder is present, that means - * the folder was deleted in the latest container version. - */ - folder: Schema$Folder; -} -/** - * The result of reverting a tag in a workspace. - */ -export interface Schema$RevertTagResponse { - /** - * Tag as it appears in the latest container version since the last workspace - * synchronization operation. If no tag is present, that means the tag was - * deleted in the latest container version. - */ - tag: Schema$Tag; -} -/** - * The result of reverting a trigger in a workspace. - */ -export interface Schema$RevertTriggerResponse { - /** - * Trigger as it appears in the latest container version since the last - * workspace synchronization operation. If no trigger is present, that means - * the trigger was deleted in the latest container version. - */ - trigger: Schema$Trigger; -} -/** - * The result of reverting a variable in a workspace. - */ -export interface Schema$RevertVariableResponse { - /** - * Variable as it appears in the latest container version since the last - * workspace synchronization operation. If no variable is present, that means - * the variable was deleted in the latest container version. - */ - variable: Schema$Variable; -} -/** - * Represents a reference to atag that fires before another tag in order to set - * up dependencies. - */ -export interface Schema$SetupTag { - /** - * If true, fire the main tag if and only if the setup tag fires successfully. - * If false, fire the main tag regardless of setup tag firing status. - */ - stopOnSetupFailure: boolean; - /** - * The name of the setup tag. - */ - tagName: string; -} -/** - * The status of a workspace after synchronization. - */ -export interface Schema$SyncStatus { - /** - * Synchornization operation detected a merge conflict. - */ - mergeConflict: boolean; - /** - * An error occurred during the synchronization operation. - */ - syncError: boolean; -} -/** - * A response after synchronizing the workspace to the latest container version. - */ -export interface Schema$SyncWorkspaceResponse { - /** - * The merge conflict after sync. If this field is not empty, the sync is - * still treated as successful. But a version cannot be created until all - * conflicts are resolved. - */ - mergeConflict: Schema$MergeConflict[]; - /** - * Indicates whether synchronization caused a merge conflict or sync error. - */ - syncStatus: Schema$SyncStatus; -} -/** - * Represents a Google Tag Manager Tag. - */ -export interface Schema$Tag { - /** - * GTM Account ID. - */ - accountId: string; - /** - * Blocking rule IDs. If any of the listed rules evaluate to true, the tag - * will not fire. - */ - blockingRuleId: string[]; - /** - * Blocking trigger IDs. If any of the listed triggers evaluate to true, the - * tag will not fire. - */ - blockingTriggerId: string[]; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Tag as computed at storage time. This value is - * recomputed whenever the tag is modified. - */ - fingerprint: string; - /** - * Firing rule IDs. A tag will fire when any of the listed rules are true and - * all of its blockingRuleIds (if any specified) are false. - */ - firingRuleId: string[]; - /** - * Firing trigger IDs. A tag will fire when any of the listed triggers are - * true and all of its blockingTriggerIds (if any specified) are false. - */ - firingTriggerId: string[]; - /** - * If set to true, this tag will only fire in the live environment (e.g. not - * in preview or debug mode). - */ - liveOnly: boolean; - /** - * Tag display name. - */ - name: string; - /** - * User notes on how to apply this tag in the container. - */ - notes: string; - /** - * The tag's parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * GTM Tag's API relative path. - */ - path: string; - /** - * Indicates whether the tag is paused, which prevents the tag from firing. - */ - paused: boolean; - /** - * User defined numeric priority of the tag. Tags are fired asynchronously in - * order of priority. Tags with higher numeric value fire first. A tag's - * priority can be a positive or negative value. The default value is 0. - */ - priority: Schema$Parameter; - /** - * The end timestamp in milliseconds to schedule a tag. - */ - scheduleEndMs: string; - /** - * The start timestamp in milliseconds to schedule a tag. - */ - scheduleStartMs: string; - /** - * The list of setup tags. Currently we only allow one. - */ - setupTag: Schema$SetupTag[]; - /** - * Option to fire this tag. - */ - tagFiringOption: string; - /** - * The Tag ID uniquely identifies the GTM Tag. - */ - tagId: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * The list of teardown tags. Currently we only allow one. - */ - teardownTag: Schema$TeardownTag[]; - /** - * GTM Tag Type. - */ - type: string; - /** - * GTM Workspace ID. - */ - workspaceId: string; -} -/** - * Represents a tag that fires after another tag in order to tear down - * dependencies. - */ -export interface Schema$TeardownTag { - /** - * If true, fire the teardown tag if and only if the main tag fires - * successfully. If false, fire the teardown tag regardless of main tag firing - * status. - */ - stopTeardownOnFailure: boolean; - /** - * The name of the teardown tag. - */ - tagName: string; -} -/** - * A Timestamp represents a point in time independent of any time zone or - * calendar, represented as seconds and fractions of seconds at nanosecond - * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian - * Calendar which extends the Gregorian calendar backwards to year one. It is - * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are - * "smeared" so that no leap second table is needed for - * interpretation. Range is from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that - * we can convert to and from RFC 3339 date strings. See - * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). - * # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp - * timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example - * 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; - * gettimeofday(&tv, NULL); Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME - * ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = - * (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows - * tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 - * seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute - * Timestamp from Java `System.currentTimeMillis()`. long millis = - * System.currentTimeMillis(); Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % - * 1000) * 1000000)).build(); Example 5: Compute Timestamp from current time - * in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON - * Mapping In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format - * is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where - * {year} is always expressed using four digits while {month}, {day}, {hour}, - * {min}, and {sec} are zero-padded to two digits each. The fractional seconds, - * which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are - * optional. The "Z" suffix indicates the timezone ("UTC"); - * the timezone is required, though only UTC (as indicated by "Z") is - * presently supported. For example, "2017-01-15T01:30:15.01Z" - * encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one - * can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) - * to obtain a formatter capable of generating timestamps in this format. - */ -export interface Schema$Timestamp { - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values that - * count forward in time. Must be from 0 to 999,999,999 inclusive. - */ - nanos: number; - /** - * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - * be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - */ - seconds: string; -} -/** - * Represents a Google Tag Manager Trigger - */ -export interface Schema$Trigger { - /** - * GTM Account ID. - */ - accountId: string; - /** - * Used in the case of auto event tracking. - */ - autoEventFilter: Schema$Condition[]; - /** - * Whether or not we should only fire tags if the form submit or link click - * event is not cancelled by some other event handler (e.g. because of - * validation). Only valid for Form Submission and Link Click triggers. - */ - checkValidation: Schema$Parameter; - /** - * GTM Container ID. - */ - containerId: string; - /** - * A visibility trigger minimum continuous visible time (in milliseconds). - * Only valid for AMP Visibility trigger. - */ - continuousTimeMinMilliseconds: Schema$Parameter; - /** - * Used in the case of custom event, which is fired iff all Conditions are - * true. - */ - customEventFilter: Schema$Condition[]; - /** - * Name of the GTM event that is fired. Only valid for Timer triggers. - */ - eventName: Schema$Parameter; - /** - * The trigger will only fire iff all Conditions are true. - */ - filter: Schema$Condition[]; - /** - * The fingerprint of the GTM Trigger as computed at storage time. This value - * is recomputed whenever the trigger is modified. - */ - fingerprint: string; - /** - * List of integer percentage values for scroll triggers. The trigger will - * fire when each percentage is reached when the view is scrolled - * horizontally. Only valid for AMP scroll triggers. - */ - horizontalScrollPercentageList: Schema$Parameter; - /** - * Time between triggering recurring Timer Events (in milliseconds). Only - * valid for Timer triggers. - */ - interval: Schema$Parameter; - /** - * Time between Timer Events to fire (in seconds). Only valid for AMP Timer - * trigger. - */ - intervalSeconds: Schema$Parameter; - /** - * Limit of the number of GTM events this Timer Trigger will fire. If no limit - * is set, we will continue to fire GTM events until the user leaves the page. - * Only valid for Timer triggers. - */ - limit: Schema$Parameter; - /** - * Max time to fire Timer Events (in seconds). Only valid for AMP Timer - * trigger. - */ - maxTimerLengthSeconds: Schema$Parameter; - /** - * Trigger display name. - */ - name: string; - /** - * User notes on how to apply this trigger in the container. - */ - notes: string; - /** - * Additional parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * GTM Trigger's API relative path. - */ - path: string; - /** - * A click trigger CSS selector (i.e. "a", "button" etc.). - * Only valid for AMP Click trigger. - */ - selector: Schema$Parameter; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * A visibility trigger minimum total visible time (in milliseconds). Only - * valid for AMP Visibility trigger. - */ - totalTimeMinMilliseconds: Schema$Parameter; - /** - * The Trigger ID uniquely identifies the GTM Trigger. - */ - triggerId: string; - /** - * Defines the data layer event that causes this trigger. - */ - type: string; - /** - * Globally unique id of the trigger that auto-generates this (a Form Submit, - * Link Click or Timer listener) if any. Used to make incompatible auto-events - * work together with trigger filtering based on trigger ids. This value is - * populated during output generation since the tags implied by triggers - * don't exist until then. Only valid for Form Submit, Link Click and - * Timer triggers. - */ - uniqueTriggerId: Schema$Parameter; - /** - * List of integer percentage values for scroll triggers. The trigger will - * fire when each percentage is reached when the view is scrolled vertically. - * Only valid for AMP scroll triggers. - */ - verticalScrollPercentageList: Schema$Parameter; - /** - * A visibility trigger CSS selector (i.e. "#id"). Only valid for - * AMP Visibility trigger. - */ - visibilitySelector: Schema$Parameter; - /** - * A visibility trigger maximum percent visibility. Only valid for AMP - * Visibility trigger. - */ - visiblePercentageMax: Schema$Parameter; - /** - * A visibility trigger minimum percent visibility. Only valid for AMP - * Visibility trigger. - */ - visiblePercentageMin: Schema$Parameter; - /** - * Whether or not we should delay the form submissions or link opening until - * all of the tags have fired (by preventing the default action and later - * simulating the default action). Only valid for Form Submission and Link - * Click triggers. - */ - waitForTags: Schema$Parameter; - /** - * How long to wait (in milliseconds) for tags to fire when - * 'waits_for_tags' above evaluates to true. Only valid for Form - * Submission and Link Click triggers. - */ - waitForTagsTimeout: Schema$Parameter; - /** - * GTM Workspace ID. - */ - workspaceId: string; -} -/** - * Updates a workspace proposal with patch-like semantics. - */ -export interface Schema$UpdateWorkspaceProposalRequest { - /** - * When provided, this fingerprint must match the fingerprint of the proposal - * in storage. - */ - fingerprint: string; - /** - * If present, a new comment is added to the workspace proposal history. - */ - newComment: Schema$WorkspaceProposalHistoryComment; - /** - * If present, the list of reviewers of the workspace proposal is updated. - */ - reviewers: Schema$WorkspaceProposalUser[]; - /** - * If present, the status of the workspace proposal is updated. - */ - status: string; -} -/** - * Represents a user's permissions to an account and its container. - */ -export interface Schema$UserPermission { - /** - * GTM Account access permissions. - */ - accountAccess: Schema$AccountAccess; - /** - * The Account ID uniquely identifies the GTM Account. - */ - accountId: string; - /** - * GTM Container access permissions. - */ - containerAccess: Schema$ContainerAccess[]; - /** - * User's email address. - */ - emailAddress: string; - /** - * GTM UserPermission's API relative path. - */ - path: string; -} -/** - * Represents a Google Tag Manager Variable. - */ -export interface Schema$Variable { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * For mobile containers only: A list of trigger IDs for disabling conditional - * variables; the variable is enabled if one of the enabling trigger is true - * while all the disabling trigger are false. Treated as an unordered set. - */ - disablingTriggerId: string[]; - /** - * For mobile containers only: A list of trigger IDs for enabling conditional - * variables; the variable is enabled if one of the enabling triggers is true - * while all the disabling triggers are false. Treated as an unordered set. - */ - enablingTriggerId: string[]; - /** - * The fingerprint of the GTM Variable as computed at storage time. This value - * is recomputed whenever the variable is modified. - */ - fingerprint: string; - /** - * Variable display name. - */ - name: string; - /** - * User notes on how to apply this variable in the container. - */ - notes: string; - /** - * The variable's parameters. - */ - parameter: Schema$Parameter[]; - /** - * Parent folder id. - */ - parentFolderId: string; - /** - * GTM Variable's API relative path. - */ - path: string; - /** - * The end timestamp in milliseconds to schedule a variable. - */ - scheduleEndMs: string; - /** - * The start timestamp in milliseconds to schedule a variable. - */ - scheduleStartMs: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * GTM Variable Type. - */ - type: string; - /** - * The Variable ID uniquely identifies the GTM Variable. - */ - variableId: string; - /** - * GTM Workspace ID. - */ - workspaceId: string; -} -/** - * Represents a Google Tag Manager Container Workspace. - */ -export interface Schema$Workspace { - /** - * GTM Account ID. - */ - accountId: string; - /** - * GTM Container ID. - */ - containerId: string; - /** - * Workspace description. - */ - description: string; - /** - * The fingerprint of the GTM Workspace as computed at storage time. This - * value is recomputed whenever the workspace is modified. - */ - fingerprint: string; - /** - * Workspace display name. - */ - name: string; - /** - * GTM Workspace's API relative path. - */ - path: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * The Workspace ID uniquely identifies the GTM Workspace. - */ - workspaceId: string; -} -/** - * A workspace proposal represents an ongoing review of workspace changes in an - * effort to gain approval for container version creation. - */ -export interface Schema$WorkspaceProposal { - /** - * List of authors for the workspace proposal. - */ - authors: Schema$WorkspaceProposalUser[]; - /** - * The fingerprint of the GTM workspace proposal as computed at storage time. - * This value is recomputed whenever the proposal is modified. - */ - fingerprint: string; - /** - * Records the history of comments and status changes. - */ - history: Schema$WorkspaceProposalHistory[]; - /** - * GTM workspace proposal's relative path. - */ - path: string; - /** - * Lists of reviewers for the workspace proposal. - */ - reviewers: Schema$WorkspaceProposalUser[]; - /** - * The status of the workspace proposal as it goes through review. - */ - status: string; -} -/** - * A history event that represents a comment or status change in the proposal. - */ -export interface Schema$WorkspaceProposalHistory { - /** - * A user or reviewer comment. - */ - comment: Schema$WorkspaceProposalHistoryComment; - /** - * The party responsible for the change in history. - */ - createdBy: Schema$WorkspaceProposalUser; - /** - * When this history event was added to the workspace proposal. - */ - createdTimestamp: Schema$Timestamp; - /** - * A change in the proposal's status. - */ - statusChange: Schema$WorkspaceProposalHistoryStatusChange; - /** - * The history type distinguishing between comments and status changes. - */ - type: string; -} -/** - * A comment from the reviewer or author. - */ -export interface Schema$WorkspaceProposalHistoryComment { - /** - * The contents of the reviewer or author comment. - */ - content: string; -} -/** - * A change in the proposal's status. - */ -export interface Schema$WorkspaceProposalHistoryStatusChange { - /** - * The new proposal status after that status change. - */ - newStatus: string; - /** - * The old proposal status before the status change. - */ - oldStatus: string; -} -/** - * Represents an external user or internal Google Tag Manager system. - */ -export interface Schema$WorkspaceProposalUser { - /** - * Gaia id associated with a user, absent for the Google Tag Manager system. - */ - gaiaId: string; - /** - * User type distinguishes between a user and the Google Tag Manager system. - */ - type: string; -} -/** - * Represents a Google Tag Manager Zone's contents. - */ -export interface Schema$Zone { - /** - * GTM Account ID. - */ - accountId: string; - /** - * This Zone's boundary. - */ - boundary: Schema$ZoneBoundary; - /** - * Containers that are children of this Zone. - */ - childContainer: Schema$ZoneChildContainer[]; - /** - * GTM Container ID. - */ - containerId: string; - /** - * The fingerprint of the GTM Zone as computed at storage time. This value is - * recomputed whenever the zone is modified. - */ - fingerprint: string; - /** - * Zone display name. - */ - name: string; - /** - * User notes on how to apply this zone in the container. - */ - notes: string; - /** - * GTM Zone's API relative path. - */ - path: string; - /** - * Auto generated link to the tag manager UI - */ - tagManagerUrl: string; - /** - * This Zone's type restrictions. - */ - typeRestriction: Schema$ZoneTypeRestriction; - /** - * GTM Workspace ID. - */ - workspaceId: string; - /** - * The Zone ID uniquely identifies the GTM Zone. - */ - zoneId: string; -} -/** - * Represents a Zone's boundaries. - */ -export interface Schema$ZoneBoundary { - /** - * The conditions that, when conjoined, make up the boundary. - */ - condition: Schema$Condition[]; - /** - * Custom evaluation trigger IDs. A zone will evaluate its boundary conditions - * when any of the listed triggers are true. - */ - customEvaluationTriggerId: string[]; -} -/** - * Represents a child container of a Zone. - */ -export interface Schema$ZoneChildContainer { - /** - * The zone's nickname for the child container. - */ - nickname: string; - /** - * The child container's public id. - */ - publicId: string; -} -/** - * Represents a Zone's type restrictions. - */ -export interface Schema$ZoneTypeRestriction { - /** - * True if type restrictions have been enabled for this Zone. - */ - enable: boolean; - /** - * List of type public ids that have been whitelisted for use in this Zone. - */ - whitelistedTypeId: string[]; -} - -export class Resource$Accounts { - root: Tagmanager; - containers: Resource$Accounts$Containers; - user_permissions: Resource$Accounts$User_permissions; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.containers = new Resource$Accounts$Containers(root); - this.user_permissions = new Resource$Accounts$User_permissions(root); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.get - * @desc Gets a GTM Account. - * @alias tagmanager.accounts.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Accounts's API relative path. Example: accounts/{account_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.list - * @desc Lists all GTM Accounts that a user has access to. - * @alias tagmanager.accounts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.update - * @desc Updates a GTM Account. - * @alias tagmanager.accounts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the account in storage. - * @param {string} params.path GTM Accounts's API relative path. Example: accounts/{account_id} - * @param {().Account} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers { - root: Tagmanager; - environments: Resource$Accounts$Containers$Environments; - versions: Resource$Accounts$Containers$Versions; - version_headers: Resource$Accounts$Containers$Version_headers; - workspaces: Resource$Accounts$Containers$Workspaces; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.environments = new Resource$Accounts$Containers$Environments(root); - this.versions = new Resource$Accounts$Containers$Versions(root); - this.version_headers = - new Resource$Accounts$Containers$Version_headers(root); - this.workspaces = new Resource$Accounts$Containers$Workspaces(root); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.create - * @desc Creates a Container. - * @alias tagmanager.accounts.containers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Account's API relative path. Example: accounts/{account_id}. - * @param {().Container} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/containers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.delete - * @desc Deletes a Container. - * @alias tagmanager.accounts.containers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.get - * @desc Gets a Container. - * @alias tagmanager.accounts.containers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.list - * @desc Lists all Containers that belongs to a GTM Account. - * @alias tagmanager.accounts.containers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Accounts's API relative path. Example: accounts/{account_id}. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/containers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.update - * @desc Updates a Container. - * @alias tagmanager.accounts.containers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container in storage. - * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {().Container} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers$Environments { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.environments.create - * @desc Creates a GTM Environment. - * @alias tagmanager.accounts.containers.environments.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/environments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.delete - * @desc Deletes a GTM Environment. - * @alias tagmanager.accounts.containers.environments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.get - * @desc Gets a GTM Environment. - * @alias tagmanager.accounts.containers.environments.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.list - * @desc Lists all GTM Environments of a GTM Container. - * @alias tagmanager.accounts.containers.environments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/environments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.patch - * @desc Updates a GTM Environment. This method supports patch semantics. - * @alias tagmanager.accounts.containers.environments.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. - * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): - AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.reauthorize - * @desc Re-generates the authorization code for a GTM Environment. - * @alias tagmanager.accounts.containers.environments.reauthorize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reauthorize(params?: any, options?: MethodOptions): - AxiosPromise; - reauthorize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reauthorize( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:reauthorize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.environments.update - * @desc Updates a GTM Environment. - * @alias tagmanager.accounts.containers.environments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. - * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} - * @param {().Environment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Versions { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tagmanager.accounts.containers.versions.delete - * @desc Deletes a Container Version. - * @alias tagmanager.accounts.containers.versions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.get - * @desc Gets a Container Version. - * @alias tagmanager.accounts.containers.versions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.containerVersionId The GTM ContainerVersion ID. Specify published to retrieve the currently published version. - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - +export namespace tagmanager_v2 { /** - * tagmanager.accounts.containers.versions.live - * @desc Gets the live (i.e. published) container version - * @alias tagmanager.accounts.containers.versions.live - * @memberOf! () + * Tag Manager API * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - live(params?: any, options?: MethodOptions): - AxiosPromise; - live( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - live( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/versions:live') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.publish - * @desc Publishes a Container Version. - * @alias tagmanager.accounts.containers.versions.publish - * @memberOf! () + * Accesses Tag Manager accounts and containers. * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publish(params?: any, options?: MethodOptions): - AxiosPromise; - publish( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - publish( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:publish') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } - - - /** - * tagmanager.accounts.containers.versions.set_latest - * @desc Sets the latest version used for synchronization of workspaces when - * detecting conflicts and errors. - * @alias tagmanager.accounts.containers.versions.set_latest - * @memberOf! () + * @example + * const google = require('googleapis'); + * const tagmanager = google.tagmanager('v2'); * - * @param {object} params Parameters for request - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace tagmanager + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Tagmanager */ - set_latest(params?: any, options?: MethodOptions): - AxiosPromise; - set_latest( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - set_latest( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:set_latest') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - + export class Tagmanager { + _options: GlobalOptions; + google: GoogleApis; + root = this; - /** - * tagmanager.accounts.containers.versions.undelete - * @desc Undeletes a Container Version. - * @alias tagmanager.accounts.containers.versions.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): - AxiosPromise; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + accounts: Resource$Accounts; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * tagmanager.accounts.containers.versions.update - * @desc Updates a Container Version. - * @alias tagmanager.accounts.containers.versions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. - * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} - * @param {().ContainerVersion} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.accounts = new Resource$Accounts(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Version_headers { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - /** - * tagmanager.accounts.containers.version_headers.latest - * @desc Gets the latest container version header - * @alias tagmanager.accounts.containers.version_headers.latest - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - latest(params?: any, options?: MethodOptions): - AxiosPromise; - latest( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - latest( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/version_headers:latest') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } - /** - * tagmanager.accounts.containers.version_headers.list - * @desc Lists all Container Versions of a GTM Container. - * @alias tagmanager.accounts.containers.version_headers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeDeleted Also retrieve deleted (archived) versions when true. - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/version_headers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Workspaces { - root: Tagmanager; - built_in_variables: - Resource$Accounts$Containers$Workspaces$Built_in_variables; - folders: Resource$Accounts$Containers$Workspaces$Folders; - proposal: Resource$Accounts$Containers$Workspaces$Proposal; - tags: Resource$Accounts$Containers$Workspaces$Tags; - triggers: Resource$Accounts$Containers$Workspaces$Triggers; - variables: Resource$Accounts$Containers$Workspaces$Variables; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - this.built_in_variables = - new Resource$Accounts$Containers$Workspaces$Built_in_variables(root); - this.folders = new Resource$Accounts$Containers$Workspaces$Folders(root); - this.proposal = new Resource$Accounts$Containers$Workspaces$Proposal(root); - this.tags = new Resource$Accounts$Containers$Workspaces$Tags(root); - this.triggers = new Resource$Accounts$Containers$Workspaces$Triggers(root); - this.variables = - new Resource$Accounts$Containers$Workspaces$Variables(root); - } - - getRoot() { - return this.root; + * Represents a Google Tag Manager Account. + */ + export interface Schema$Account { + /** + * The Account ID uniquely identifies the GTM Account. + */ + accountId: string; + /** + * The fingerprint of the GTM Account as computed at storage time. This + * value is recomputed whenever the account is modified. + */ + fingerprint: string; + /** + * Account display name. + */ + name: string; + /** + * GTM Account's API relative path. + */ + path: string; + /** + * Whether the account shares data anonymously with Google and others. This + * flag enables benchmarking by sharing your data in an anonymous form. + * Google will remove all identifiable information about your website, + * combine the data with hundreds of other anonymous sites and report + * aggregate trends in the benchmarking service. + */ + shareData: boolean; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; } - - /** - * tagmanager.accounts.containers.workspaces.create - * @desc Creates a Workspace. - * @alias tagmanager.accounts.containers.workspaces.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {().Workspace} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Defines the Google Tag Manager Account access permissions. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/workspaces') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$AccountAccess { + /** + * Whether the user has no access, user access, or admin access to an + * account. + */ + permission: string; } - - /** - * tagmanager.accounts.containers.workspaces.create_version - * @desc Creates a Container Version from the entities present in the - * workspace, deletes the workspace, and sets the base container version to - * the newly created version. - * @alias tagmanager.accounts.containers.workspaces.create_version - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().CreateContainerVersionRequestVersionOptions} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create_version(params?: any, options?: MethodOptions): - AxiosPromise; - create_version( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create_version( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:create_version') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Built-in variables are a special category of variables that are pre-created + * and non-customizable. They provide common functionality like accessing + * propeties of the gtm data layer, monitoring clicks, or accessing elements + * of a page URL. + */ + export interface Schema$BuiltInVariable { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * Name of the built-in variable to be used to refer to the built-in + * variable. + */ + name: string; + /** + * GTM BuiltInVariable's API relative path. + */ + path: string; + /** + * Type of built-in variable. + */ + type: string; + /** + * GTM Workspace ID. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.delete - * @desc Deletes a Workspace. - * @alias tagmanager.accounts.containers.workspaces.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a predicate. + */ + export interface Schema$Condition { + /** + * A list of named parameters (key/value), depending on the condition's + * type. Notes: - For binary operators, include parameters named arg0 and + * arg1 for specifying the left and right operands, respectively. - At this + * time, the left operand (arg0) must be a reference to a variable. - For + * case-insensitive Regex matching, include a boolean parameter named + * ignore_case that is set to true. If not specified or set to any other + * value, the matching will be case sensitive. - To negate an operator, + * include a boolean parameter named negate boolean parameter that is set to + * true. + */ + parameter: Schema$Parameter[]; + /** + * The type of operator for this condition. + */ + type: string; } - - /** - * tagmanager.accounts.containers.workspaces.get - * @desc Gets a Workspace. - * @alias tagmanager.accounts.containers.workspaces.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Container, which specifies the platform + * tags will run on, manages workspaces, and retains container versions. + */ + export interface Schema$Container { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The Container ID uniquely identifies the GTM Container. + */ + containerId: string; + /** + * List of domain names associated with the Container. + */ + domainName: string[]; + /** + * The fingerprint of the GTM Container as computed at storage time. This + * value is recomputed whenever the account is modified. + */ + fingerprint: string; + /** + * Container display name. + */ + name: string; + /** + * Container Notes. + */ + notes: string; + /** + * GTM Container's API relative path. + */ + path: string; + /** + * Container Public ID. + */ + publicId: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * List of Usage Contexts for the Container. Valid values include: web, + * android, or ios. + */ + usageContext: string[]; } - - /** - * tagmanager.accounts.containers.workspaces.getProposal - * @desc Gets a GTM Workspace Proposal. - * @alias tagmanager.accounts.containers.workspaces.getProposal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getProposal(params?: any, options?: MethodOptions): - AxiosPromise; - getProposal( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getProposal( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Defines the Google Tag Manager Container access permissions. + */ + export interface Schema$ContainerAccess { + /** + * GTM Container ID. + */ + containerId: string; + /** + * List of Container permissions. + */ + permission: string; } - - /** - * tagmanager.accounts.containers.workspaces.getStatus - * @desc Finds conflicting and modified entities in the workspace. - * @alias tagmanager.accounts.containers.workspaces.getStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getStatus(params?: any, options?: MethodOptions): - AxiosPromise; - getStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getStatus( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}/status') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Container Version. + */ + export interface Schema$ContainerVersion { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The built-in variables in the container that this version was taken from. + */ + builtInVariable: Schema$BuiltInVariable[]; + /** + * The container that this version was taken from. + */ + container: Schema$Container; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The Container Version ID uniquely identifies the GTM Container Version. + */ + containerVersionId: string; + /** + * A value of true indicates this container version has been deleted. + */ + deleted: boolean; + /** + * Container version description. + */ + description: string; + /** + * The fingerprint of the GTM Container Version as computed at storage time. + * This value is recomputed whenever the container version is modified. + */ + fingerprint: string; + /** + * The folders in the container that this version was taken from. + */ + folder: Schema$Folder[]; + /** + * Container version display name. + */ + name: string; + /** + * GTM ContainerVersions's API relative path. + */ + path: string; + /** + * The tags in the container that this version was taken from. + */ + tag: Schema$Tag[]; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * The triggers in the container that this version was taken from. + */ + trigger: Schema$Trigger[]; + /** + * The variables in the container that this version was taken from. + */ + variable: Schema$Variable[]; + /** + * The zones in the container that this version was taken from. + */ + zone: Schema$Zone[]; } - - /** - * tagmanager.accounts.containers.workspaces.list - * @desc Lists all Workspaces that belong to a GTM Container. - * @alias tagmanager.accounts.containers.workspaces.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/workspaces') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Container Version Header. + */ + export interface Schema$ContainerVersionHeader { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The Container Version ID uniquely identifies the GTM Container Version. + */ + containerVersionId: string; + /** + * A value of true indicates this container version has been deleted. + */ + deleted: boolean; + /** + * Container version display name. + */ + name: string; + /** + * Number of macros in the container version. + */ + numMacros: string; + /** + * Number of rules in the container version. + */ + numRules: string; + /** + * Number of tags in the container version. + */ + numTags: string; + /** + * Number of triggers in the container version. + */ + numTriggers: string; + /** + * Number of variables in the container version. + */ + numVariables: string; + /** + * Number of zones in the container version. + */ + numZones: string; + /** + * GTM Container Versions's API relative path. + */ + path: string; } - - - /** - * tagmanager.accounts.containers.workspaces.quick_preview - * @desc Quick previews a workspace by creating a fake container version from - * all entities in the provided workspace. - * @alias tagmanager.accounts.containers.workspaces.quick_preview - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - quick_preview(params?: any, options?: MethodOptions): - AxiosPromise; - quick_preview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - quick_preview( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:quick_preview') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$CreateBuiltInVariableResponse { + /** + * List of created built-in variables. + */ + builtInVariable: Schema$BuiltInVariable[]; } - - /** - * tagmanager.accounts.containers.workspaces.resolve_conflict - * @desc Resolves a merge conflict for a workspace entity by updating it to - * the resolved entity passed in the request. - * @alias tagmanager.accounts.containers.workspaces.resolve_conflict - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict. - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Entity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - resolve_conflict(params?: any, options?: MethodOptions): AxiosPromise; - resolve_conflict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - resolve_conflict( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:resolve_conflict') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Options for new container versions. + */ + export interface Schema$CreateContainerVersionRequestVersionOptions { + /** + * The name of the container version to be created. + */ + name: string; + /** + * The notes of the container version to be created. + */ + notes: string; } - - /** - * tagmanager.accounts.containers.workspaces.sync - * @desc Syncs a workspace to the latest container version by updating all - * unmodified workspace entities and displaying conflicts for modified - * entities. - * @alias tagmanager.accounts.containers.workspaces.sync - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - sync(params?: any, options?: MethodOptions): - AxiosPromise; - sync( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - sync( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:sync') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Create container versions response. + */ + export interface Schema$CreateContainerVersionResponse { + /** + * Compiler errors or not. + */ + compilerError: boolean; + /** + * The container version created. + */ + containerVersion: Schema$ContainerVersion; + /** + * Auto generated workspace path created as a result of version creation. + * This field should only be populated if the created version was not a + * quick preview. + */ + newWorkspacePath: string; + /** + * Whether version creation failed when syncing the workspace to the latest + * container version. + */ + syncStatus: Schema$SyncStatus; } - - /** - * tagmanager.accounts.containers.workspaces.update - * @desc Updates a Workspace. - * @alias tagmanager.accounts.containers.workspaces.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the workspace in storage. - * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Workspace} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Creates a workspace proposal to start a review of a workspace. + */ + export interface Schema$CreateWorkspaceProposalRequest { + /** + * If present, an initial comment to associate with the workspace proposal. + */ + initialComment: Schema$WorkspaceProposalHistoryComment; + /** + * List of users to review the workspace proposal. + */ + reviewers: Schema$WorkspaceProposalUser[]; } - - /** - * tagmanager.accounts.containers.workspaces.updateProposal - * @desc Updates a GTM Workspace Proposal. - * @alias tagmanager.accounts.containers.workspaces.updateProposal - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal - * @param {().UpdateWorkspaceProposalRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - updateProposal(params?: any, options?: MethodOptions): - AxiosPromise; - updateProposal( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - updateProposal( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Accounts$Containers$Workspaces$Built_in_variables { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + * A workspace entity that may represent a tag, trigger, variable, or folder + * in addition to its status in the workspace. + */ + export interface Schema$Entity { + /** + * Represents how the entity has been changed in the workspace. + */ + changeStatus: string; + /** + * The Folder being represented by the entity. + */ + folder: Schema$Folder; + /** + * The tag being represented by the entity. + */ + tag: Schema$Tag; + /** + * The trigger being represented by the entity. + */ + trigger: Schema$Trigger; + /** + * The variable being represented by the entity. + */ + variable: Schema$Variable; } - - /** - * tagmanager.accounts.containers.workspaces.built_in_variables.create - * @desc Creates one or more GTM Built-In Variables. - * @alias tagmanager.accounts.containers.workspaces.built_in_variables.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {string=} params.type The types of built-in variables to enable. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - create( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/built_in_variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Environment. Note that a user can create, + * delete and update environments of type USER, but can only update the + * enable_debug and url fields of environments of other types. + */ + export interface Schema$Environment { + /** + * GTM Account ID. + */ + accountId: string; + /** + * The environment authorization code. + */ + authorizationCode: string; + /** + * The last update time-stamp for the authorization code. + */ + authorizationTimestamp: Schema$Timestamp; + /** + * GTM Container ID. + */ + containerId: string; + /** + * Represents a link to a container version. + */ + containerVersionId: string; + /** + * The environment description. Can be set or changed only on USER type + * environments. + */ + description: string; + /** + * Whether or not to enable debug by default for the environment. + */ + enableDebug: boolean; + /** + * GTM Environment ID uniquely identifies the GTM Environment. + */ + environmentId: string; + /** + * The fingerprint of the GTM environment as computed at storage time. This + * value is recomputed whenever the environment is modified. + */ + fingerprint: string; + /** + * The environment display name. Can be set or changed only on USER type + * environments. + */ + name: string; + /** + * GTM Environment's API relative path. + */ + path: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * The type of this environment. + */ + type: string; + /** + * Default preview page url for the environment. + */ + url: string; + /** + * Represents a link to a quick preview of a workspace. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.built_in_variables.delete - * @desc Deletes one or more GTM Built-In Variables. - * @alias tagmanager.accounts.containers.workspaces.built_in_variables.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables - * @param {string=} params.type The types of built-in variables to delete. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Folder. + */ + export interface Schema$Folder { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Folder as computed at storage time. This value + * is recomputed whenever the folder is modified. + */ + fingerprint: string; + /** + * The Folder ID uniquely identifies the GTM Folder. + */ + folderId: string; + /** + * Folder display name. + */ + name: string; + /** + * User notes on how to apply this folder in the container. + */ + notes: string; + /** + * GTM Folder's API relative path. + */ + path: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * GTM Workspace ID. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.built_in_variables.list - * @desc Lists all the enabled Built-In Variables of a GTM Container. - * @alias tagmanager.accounts.containers.workspaces.built_in_variables.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/built_in_variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + * Represents a Google Tag Manager Folder's contents. + */ + export interface Schema$FolderEntities { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * The list of tags inside the folder. + */ + tag: Schema$Tag[]; + /** + * The list of triggers inside the folder. + */ + trigger: Schema$Trigger[]; + /** + * The list of variables inside the folder. + */ + variable: Schema$Variable[]; } - - /** - * tagmanager.accounts.containers.workspaces.built_in_variables.revert - * @desc Reverts changes to a GTM Built-In Variables in a GTM Workspace. - * @alias tagmanager.accounts.containers.workspaces.built_in_variables.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables - * @param {string=} params.type The type of built-in variable to revert. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): - AxiosPromise; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}/built_in_variables:revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Accounts$Containers$Workspaces$Folders { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + * The changes that have occurred in the workspace since the base container + * version. + */ + export interface Schema$GetWorkspaceStatusResponse { + /** + * The merge conflict after sync. + */ + mergeConflict: Schema$MergeConflict[]; + /** + * Entities that have been changed in the workspace. + */ + workspaceChange: Schema$Entity[]; } - - getRoot() { - return this.root; + /** + * List Accounts Response. + */ + export interface Schema$ListAccountsResponse { + /** + * List of GTM Accounts that a user has access to. + */ + account: Schema$Account[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.create - * @desc Creates a GTM Folder. - * @alias tagmanager.accounts.containers.workspaces.folders.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/folders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List Containers Response. + */ + export interface Schema$ListContainersResponse { + /** + * All Containers of a GTM Account. + */ + container: Schema$Container[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.delete - * @desc Deletes a GTM Folder. - * @alias tagmanager.accounts.containers.workspaces.folders.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List container versions response. + */ + export interface Schema$ListContainerVersionsResponse { + /** + * All container version headers of a GTM Container. + */ + containerVersionHeader: Schema$ContainerVersionHeader[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.entities - * @desc List all entities in a GTM Folder. - * @alias tagmanager.accounts.containers.workspaces.folders.entities - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - entities(params?: any, options?: MethodOptions): - AxiosPromise; - entities( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - entities( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:entities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A list of enabled built-in variables. + */ + export interface Schema$ListEnabledBuiltInVariablesResponse { + /** + * All GTM BuiltInVariables of a GTM container. + */ + builtInVariable: Schema$BuiltInVariable[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.get - * @desc Gets a GTM Folder. - * @alias tagmanager.accounts.containers.workspaces.folders.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List Environments Response. + */ + export interface Schema$ListEnvironmentsResponse { + /** + * All Environments of a GTM Container. + */ + environment: Schema$Environment[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.list - * @desc Lists all GTM Folders of a Container. - * @alias tagmanager.accounts.containers.workspaces.folders.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/folders') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List Folders Response. + */ + export interface Schema$ListFoldersResponse { + /** + * All GTM Folders of a GTM Container. + */ + folder: Schema$Folder[]; + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; } - - /** - * tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder - * @desc Moves entities to a GTM Folder. - * @alias - * tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {string=} params.tagId The tags to be moved to the folder. - * @param {string=} params.triggerId The triggers to be moved to the folder. - * @param {string=} params.variableId The variables to be moved to the folder. - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - move_entities_to_folder(params?: any, options?: MethodOptions): - AxiosPromise; - move_entities_to_folder( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - move_entities_to_folder( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:move_entities_to_folder') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List Tags Response. + */ + export interface Schema$ListTagsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * All GTM Tags of a GTM Container. + */ + tag: Schema$Tag[]; } - - /** - * tagmanager.accounts.containers.workspaces.folders.revert - * @desc Reverts changes to a GTM Folder in a GTM Workspace. - * @alias tagmanager.accounts.containers.workspaces.folders.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): - AxiosPromise; - revert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List triggers response. + */ + export interface Schema$ListTriggersResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * All GTM Triggers of a GTM Container. + */ + trigger: Schema$Trigger[]; } - - /** - * tagmanager.accounts.containers.workspaces.folders.update - * @desc Updates a GTM Folder. - * @alias tagmanager.accounts.containers.workspaces.folders.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the folder in storage. - * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} - * @param {().Folder} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * List user permissions response. + */ + export interface Schema$ListUserPermissionsResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * All GTM UserPermissions of a GTM Account. + */ + userPermission: Schema$UserPermission[]; } -} - -export class Resource$Accounts$Containers$Workspaces$Proposal { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * List Variables Response. + */ + export interface Schema$ListVariablesResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * All GTM Variables of a GTM Container. + */ + variable: Schema$Variable[]; } - - getRoot() { - return this.root; + /** + * A list of workspaces in a container. + */ + export interface Schema$ListWorkspacesResponse { + /** + * Continuation token for fetching the next page of results. + */ + nextPageToken: string; + /** + * All Workspaces of a GTM Container. + */ + workspace: Schema$Workspace[]; } - - /** - * tagmanager.accounts.containers.workspaces.proposal.create - * @desc Creates a GTM Workspace Proposal. - * @alias tagmanager.accounts.containers.workspaces.proposal.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid} - * @param {().CreateWorkspaceProposalRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/proposal') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a merge conflict. + */ + export interface Schema$MergeConflict { + /** + * The base version entity (since the latest sync operation) that has + * conflicting changes compared to the workspace. If this field is missing, + * it means the workspace entity is deleted from the base version. + */ + entityInBaseVersion: Schema$Entity; + /** + * The workspace entity that has conflicting changes compared to the base + * version. If an entity is deleted in a workspace, it will still appear + * with a deleted change status. + */ + entityInWorkspace: Schema$Entity; } - - /** - * tagmanager.accounts.containers.workspaces.proposal.delete - * @desc Deletes a GTM Workspace Proposal. - * @alias tagmanager.accounts.containers.workspaces.proposal.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Parameter. + */ + export interface Schema$Parameter { + /** + * The named key that uniquely identifies a parameter. Required for + * top-level parameters, as well as map values. Ignored for list values. + */ + key: string; + /** + * This list parameter's parameters (keys will be ignored). + */ + list: Schema$Parameter[]; + /** + * This map parameter's parameters (must have keys; keys must be + * unique). + */ + map: Schema$Parameter[]; + /** + * The parameter type. Valid values are: - boolean: The value represents a + * boolean, represented as 'true' or 'false' - integer: The + * value represents a 64-bit signed integer value, in base 10 - list: A + * list of parameters should be specified - map: A map of parameters should + * be specified - template: The value represents any text; this can include + * variable references (even variable references that might return + * non-string types) + */ + type: string; + /** + * A parameter's value (may contain variable references such as + * "{{myVariable}}") as appropriate to the specified type. + */ + value: string; } -} - -export class Resource$Accounts$Containers$Workspaces$Tags { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Publish container version response. + */ + export interface Schema$PublishContainerVersionResponse { + /** + * Compiler errors or not. + */ + compilerError: boolean; + /** + * The container version created. + */ + containerVersion: Schema$ContainerVersion; } - - getRoot() { - return this.root; + /** + * Response to quick previewing a workspace. + */ + export interface Schema$QuickPreviewResponse { + /** + * Were there compiler errors or not. + */ + compilerError: boolean; + /** + * The quick previewed container version. + */ + containerVersion: Schema$ContainerVersion; + /** + * Whether quick previewing failed when syncing the workspace to the latest + * container version. + */ + syncStatus: Schema$SyncStatus; } - - /** - * tagmanager.accounts.containers.workspaces.tags.create - * @desc Creates a GTM Tag. - * @alias tagmanager.accounts.containers.workspaces.tags.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Tag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The result of reverting a built-in variable in a workspace. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/tags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RevertBuiltInVariableResponse { + /** + * Whether the built-in variable is enabled after reversion. + */ + enabled: boolean; } - - /** - * tagmanager.accounts.containers.workspaces.tags.delete - * @desc Deletes a GTM Tag. - * @alias tagmanager.accounts.containers.workspaces.tags.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The result of reverting folder changes in a workspace. */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RevertFolderResponse { + /** + * Folder as it appears in the latest container version since the last + * workspace synchronization operation. If no folder is present, that means + * the folder was deleted in the latest container version. + */ + folder: Schema$Folder; } - - /** - * tagmanager.accounts.containers.workspaces.tags.get - * @desc Gets a GTM Tag. - * @alias tagmanager.accounts.containers.workspaces.tags.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The result of reverting a tag in a workspace. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RevertTagResponse { + /** + * Tag as it appears in the latest container version since the last + * workspace synchronization operation. If no tag is present, that means the + * tag was deleted in the latest container version. + */ + tag: Schema$Tag; } - - /** - * tagmanager.accounts.containers.workspaces.tags.list - * @desc Lists all GTM Tags of a Container. - * @alias tagmanager.accounts.containers.workspaces.tags.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The result of reverting a trigger in a workspace. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/tags') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RevertTriggerResponse { + /** + * Trigger as it appears in the latest container version since the last + * workspace synchronization operation. If no trigger is present, that means + * the trigger was deleted in the latest container version. + */ + trigger: Schema$Trigger; } - - /** - * tagmanager.accounts.containers.workspaces.tags.revert - * @desc Reverts changes to a GTM Tag in a GTM Workspace. - * @alias tagmanager.accounts.containers.workspaces.tags.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of thetag in storage. - * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The result of reverting a variable in a workspace. */ - revert(params?: any, options?: MethodOptions): - AxiosPromise; - revert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$RevertVariableResponse { + /** + * Variable as it appears in the latest container version since the last + * workspace synchronization operation. If no variable is present, that + * means the variable was deleted in the latest container version. + */ + variable: Schema$Variable; } - - /** - * tagmanager.accounts.containers.workspaces.tags.update - * @desc Updates a GTM Tag. - * @alias tagmanager.accounts.containers.workspaces.tags.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. - * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} - * @param {().Tag} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a reference to atag that fires before another tag in order to + * set up dependencies. + */ + export interface Schema$SetupTag { + /** + * If true, fire the main tag if and only if the setup tag fires + * successfully. If false, fire the main tag regardless of setup tag firing + * status. + */ + stopOnSetupFailure: boolean; + /** + * The name of the setup tag. + */ + tagName: string; } -} - -export class Resource$Accounts$Containers$Workspaces$Triggers { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * The status of a workspace after synchronization. + */ + export interface Schema$SyncStatus { + /** + * Synchornization operation detected a merge conflict. + */ + mergeConflict: boolean; + /** + * An error occurred during the synchronization operation. + */ + syncError: boolean; } - - getRoot() { - return this.root; + /** + * A response after synchronizing the workspace to the latest container + * version. + */ + export interface Schema$SyncWorkspaceResponse { + /** + * The merge conflict after sync. If this field is not empty, the sync is + * still treated as successful. But a version cannot be created until all + * conflicts are resolved. + */ + mergeConflict: Schema$MergeConflict[]; + /** + * Indicates whether synchronization caused a merge conflict or sync error. + */ + syncStatus: Schema$SyncStatus; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.create - * @desc Creates a GTM Trigger. - * @alias tagmanager.accounts.containers.workspaces.triggers.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Trigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Tag. + */ + export interface Schema$Tag { + /** + * GTM Account ID. + */ + accountId: string; + /** + * Blocking rule IDs. If any of the listed rules evaluate to true, the tag + * will not fire. + */ + blockingRuleId: string[]; + /** + * Blocking trigger IDs. If any of the listed triggers evaluate to true, the + * tag will not fire. + */ + blockingTriggerId: string[]; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Tag as computed at storage time. This value is + * recomputed whenever the tag is modified. + */ + fingerprint: string; + /** + * Firing rule IDs. A tag will fire when any of the listed rules are true + * and all of its blockingRuleIds (if any specified) are false. + */ + firingRuleId: string[]; + /** + * Firing trigger IDs. A tag will fire when any of the listed triggers are + * true and all of its blockingTriggerIds (if any specified) are false. + */ + firingTriggerId: string[]; + /** + * If set to true, this tag will only fire in the live environment (e.g. not + * in preview or debug mode). + */ + liveOnly: boolean; + /** + * Tag display name. + */ + name: string; + /** + * User notes on how to apply this tag in the container. + */ + notes: string; + /** + * The tag's parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * GTM Tag's API relative path. + */ + path: string; + /** + * Indicates whether the tag is paused, which prevents the tag from firing. + */ + paused: boolean; + /** + * User defined numeric priority of the tag. Tags are fired asynchronously + * in order of priority. Tags with higher numeric value fire first. A + * tag's priority can be a positive or negative value. The default value + * is 0. + */ + priority: Schema$Parameter; + /** + * The end timestamp in milliseconds to schedule a tag. + */ + scheduleEndMs: string; + /** + * The start timestamp in milliseconds to schedule a tag. + */ + scheduleStartMs: string; + /** + * The list of setup tags. Currently we only allow one. + */ + setupTag: Schema$SetupTag[]; + /** + * Option to fire this tag. + */ + tagFiringOption: string; + /** + * The Tag ID uniquely identifies the GTM Tag. + */ + tagId: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * The list of teardown tags. Currently we only allow one. + */ + teardownTag: Schema$TeardownTag[]; + /** + * GTM Tag Type. + */ + type: string; + /** + * GTM Workspace ID. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.delete - * @desc Deletes a GTM Trigger. - * @alias tagmanager.accounts.containers.workspaces.triggers.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a tag that fires after another tag in order to tear down + * dependencies. + */ + export interface Schema$TeardownTag { + /** + * If true, fire the teardown tag if and only if the main tag fires + * successfully. If false, fire the teardown tag regardless of main tag + * firing status. + */ + stopTeardownOnFailure: boolean; + /** + * The name of the teardown tag. + */ + tagName: string; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.get - * @desc Gets a GTM Trigger. - * @alias tagmanager.accounts.containers.workspaces.triggers.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Timestamp represents a point in time independent of any time zone or + * calendar, represented as seconds and fractions of seconds at nanosecond + * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian + * Calendar which extends the Gregorian calendar backwards to year one. It is + * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are + * "smeared" so that no leap second table is needed for + * interpretation. Range is from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure + * that we can convert to and from RFC 3339 date strings. See + * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp + * timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval + * tv; gettimeofday(&tv, NULL); Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = + * (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows + * tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is + * 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp + * timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - + * 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long + * millis = System.currentTimeMillis(); Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % + * 1000) * 1000000)).build(); Example 5: Compute Timestamp from current + * time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON + * Mapping In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone + * ("UTC"); the timezone is required, though only UTC (as indicated + * by "Z") is presently supported. For example, + * "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. In JavaScript, one can convert a Date object to this + * format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in + * Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) + * to obtain a formatter capable of generating timestamps in this format. + */ + export interface Schema$Timestamp { + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 inclusive. + */ + nanos: number; + /** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + * Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. + */ + seconds: string; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.list - * @desc Lists all GTM Triggers of a Container. - * @alias tagmanager.accounts.containers.workspaces.triggers.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/triggers') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Trigger + */ + export interface Schema$Trigger { + /** + * GTM Account ID. + */ + accountId: string; + /** + * Used in the case of auto event tracking. + */ + autoEventFilter: Schema$Condition[]; + /** + * Whether or not we should only fire tags if the form submit or link click + * event is not cancelled by some other event handler (e.g. because of + * validation). Only valid for Form Submission and Link Click triggers. + */ + checkValidation: Schema$Parameter; + /** + * GTM Container ID. + */ + containerId: string; + /** + * A visibility trigger minimum continuous visible time (in milliseconds). + * Only valid for AMP Visibility trigger. + */ + continuousTimeMinMilliseconds: Schema$Parameter; + /** + * Used in the case of custom event, which is fired iff all Conditions are + * true. + */ + customEventFilter: Schema$Condition[]; + /** + * Name of the GTM event that is fired. Only valid for Timer triggers. + */ + eventName: Schema$Parameter; + /** + * The trigger will only fire iff all Conditions are true. + */ + filter: Schema$Condition[]; + /** + * The fingerprint of the GTM Trigger as computed at storage time. This + * value is recomputed whenever the trigger is modified. + */ + fingerprint: string; + /** + * List of integer percentage values for scroll triggers. The trigger will + * fire when each percentage is reached when the view is scrolled + * horizontally. Only valid for AMP scroll triggers. + */ + horizontalScrollPercentageList: Schema$Parameter; + /** + * Time between triggering recurring Timer Events (in milliseconds). Only + * valid for Timer triggers. + */ + interval: Schema$Parameter; + /** + * Time between Timer Events to fire (in seconds). Only valid for AMP Timer + * trigger. + */ + intervalSeconds: Schema$Parameter; + /** + * Limit of the number of GTM events this Timer Trigger will fire. If no + * limit is set, we will continue to fire GTM events until the user leaves + * the page. Only valid for Timer triggers. + */ + limit: Schema$Parameter; + /** + * Max time to fire Timer Events (in seconds). Only valid for AMP Timer + * trigger. + */ + maxTimerLengthSeconds: Schema$Parameter; + /** + * Trigger display name. + */ + name: string; + /** + * User notes on how to apply this trigger in the container. + */ + notes: string; + /** + * Additional parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * GTM Trigger's API relative path. + */ + path: string; + /** + * A click trigger CSS selector (i.e. "a", "button" + * etc.). Only valid for AMP Click trigger. + */ + selector: Schema$Parameter; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * A visibility trigger minimum total visible time (in milliseconds). Only + * valid for AMP Visibility trigger. + */ + totalTimeMinMilliseconds: Schema$Parameter; + /** + * The Trigger ID uniquely identifies the GTM Trigger. + */ + triggerId: string; + /** + * Defines the data layer event that causes this trigger. + */ + type: string; + /** + * Globally unique id of the trigger that auto-generates this (a Form + * Submit, Link Click or Timer listener) if any. Used to make incompatible + * auto-events work together with trigger filtering based on trigger ids. + * This value is populated during output generation since the tags implied + * by triggers don't exist until then. Only valid for Form Submit, Link + * Click and Timer triggers. + */ + uniqueTriggerId: Schema$Parameter; + /** + * List of integer percentage values for scroll triggers. The trigger will + * fire when each percentage is reached when the view is scrolled + * vertically. Only valid for AMP scroll triggers. + */ + verticalScrollPercentageList: Schema$Parameter; + /** + * A visibility trigger CSS selector (i.e. "#id"). Only valid for + * AMP Visibility trigger. + */ + visibilitySelector: Schema$Parameter; + /** + * A visibility trigger maximum percent visibility. Only valid for AMP + * Visibility trigger. + */ + visiblePercentageMax: Schema$Parameter; + /** + * A visibility trigger minimum percent visibility. Only valid for AMP + * Visibility trigger. + */ + visiblePercentageMin: Schema$Parameter; + /** + * Whether or not we should delay the form submissions or link opening until + * all of the tags have fired (by preventing the default action and later + * simulating the default action). Only valid for Form Submission and Link + * Click triggers. + */ + waitForTags: Schema$Parameter; + /** + * How long to wait (in milliseconds) for tags to fire when + * 'waits_for_tags' above evaluates to true. Only valid for Form + * Submission and Link Click triggers. + */ + waitForTagsTimeout: Schema$Parameter; + /** + * GTM Workspace ID. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.revert - * @desc Reverts changes to a GTM Trigger in a GTM Workspace. - * @alias tagmanager.accounts.containers.workspaces.triggers.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. - * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): - AxiosPromise; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Updates a workspace proposal with patch-like semantics. + */ + export interface Schema$UpdateWorkspaceProposalRequest { + /** + * When provided, this fingerprint must match the fingerprint of the + * proposal in storage. + */ + fingerprint: string; + /** + * If present, a new comment is added to the workspace proposal history. + */ + newComment: Schema$WorkspaceProposalHistoryComment; + /** + * If present, the list of reviewers of the workspace proposal is updated. + */ + reviewers: Schema$WorkspaceProposalUser[]; + /** + * If present, the status of the workspace proposal is updated. + */ + status: string; } - - /** - * tagmanager.accounts.containers.workspaces.triggers.update - * @desc Updates a GTM Trigger. - * @alias tagmanager.accounts.containers.workspaces.triggers.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. - * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} - * @param {().Trigger} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a user's permissions to an account and its container. + */ + export interface Schema$UserPermission { + /** + * GTM Account access permissions. + */ + accountAccess: Schema$AccountAccess; + /** + * The Account ID uniquely identifies the GTM Account. + */ + accountId: string; + /** + * GTM Container access permissions. + */ + containerAccess: Schema$ContainerAccess[]; + /** + * User's email address. + */ + emailAddress: string; + /** + * GTM UserPermission's API relative path. + */ + path: string; } -} - -export class Resource$Accounts$Containers$Workspaces$Variables { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Represents a Google Tag Manager Variable. + */ + export interface Schema$Variable { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * For mobile containers only: A list of trigger IDs for disabling + * conditional variables; the variable is enabled if one of the enabling + * trigger is true while all the disabling trigger are false. Treated as an + * unordered set. + */ + disablingTriggerId: string[]; + /** + * For mobile containers only: A list of trigger IDs for enabling + * conditional variables; the variable is enabled if one of the enabling + * triggers is true while all the disabling triggers are false. Treated as + * an unordered set. + */ + enablingTriggerId: string[]; + /** + * The fingerprint of the GTM Variable as computed at storage time. This + * value is recomputed whenever the variable is modified. + */ + fingerprint: string; + /** + * Variable display name. + */ + name: string; + /** + * User notes on how to apply this variable in the container. + */ + notes: string; + /** + * The variable's parameters. + */ + parameter: Schema$Parameter[]; + /** + * Parent folder id. + */ + parentFolderId: string; + /** + * GTM Variable's API relative path. + */ + path: string; + /** + * The end timestamp in milliseconds to schedule a variable. + */ + scheduleEndMs: string; + /** + * The start timestamp in milliseconds to schedule a variable. + */ + scheduleStartMs: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * GTM Variable Type. + */ + type: string; + /** + * The Variable ID uniquely identifies the GTM Variable. + */ + variableId: string; + /** + * GTM Workspace ID. + */ + workspaceId: string; } - - getRoot() { - return this.root; + /** + * Represents a Google Tag Manager Container Workspace. + */ + export interface Schema$Workspace { + /** + * GTM Account ID. + */ + accountId: string; + /** + * GTM Container ID. + */ + containerId: string; + /** + * Workspace description. + */ + description: string; + /** + * The fingerprint of the GTM Workspace as computed at storage time. This + * value is recomputed whenever the workspace is modified. + */ + fingerprint: string; + /** + * Workspace display name. + */ + name: string; + /** + * GTM Workspace's API relative path. + */ + path: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * The Workspace ID uniquely identifies the GTM Workspace. + */ + workspaceId: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.create - * @desc Creates a GTM Variable. - * @alias tagmanager.accounts.containers.workspaces.variables.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A workspace proposal represents an ongoing review of workspace changes in + * an effort to gain approval for container version creation. + */ + export interface Schema$WorkspaceProposal { + /** + * List of authors for the workspace proposal. + */ + authors: Schema$WorkspaceProposalUser[]; + /** + * The fingerprint of the GTM workspace proposal as computed at storage + * time. This value is recomputed whenever the proposal is modified. + */ + fingerprint: string; + /** + * Records the history of comments and status changes. + */ + history: Schema$WorkspaceProposalHistory[]; + /** + * GTM workspace proposal's relative path. + */ + path: string; + /** + * Lists of reviewers for the workspace proposal. + */ + reviewers: Schema$WorkspaceProposalUser[]; + /** + * The status of the workspace proposal as it goes through review. + */ + status: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.delete - * @desc Deletes a GTM Variable. - * @alias tagmanager.accounts.containers.workspaces.variables.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A history event that represents a comment or status change in the proposal. + */ + export interface Schema$WorkspaceProposalHistory { + /** + * A user or reviewer comment. + */ + comment: Schema$WorkspaceProposalHistoryComment; + /** + * The party responsible for the change in history. + */ + createdBy: Schema$WorkspaceProposalUser; + /** + * When this history event was added to the workspace proposal. + */ + createdTimestamp: Schema$Timestamp; + /** + * A change in the proposal's status. + */ + statusChange: Schema$WorkspaceProposalHistoryStatusChange; + /** + * The history type distinguishing between comments and status changes. + */ + type: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.get - * @desc Gets a GTM Variable. - * @alias tagmanager.accounts.containers.workspaces.variables.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A comment from the reviewer or author. */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$WorkspaceProposalHistoryComment { + /** + * The contents of the reviewer or author comment. + */ + content: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.list - * @desc Lists all GTM Variables of a Container. - * @alias tagmanager.accounts.containers.workspaces.variables.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * A change in the proposal's status. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/variables') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$WorkspaceProposalHistoryStatusChange { + /** + * The new proposal status after that status change. + */ + newStatus: string; + /** + * The old proposal status before the status change. + */ + oldStatus: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.revert - * @desc Reverts changes to a GTM Variable in a GTM Workspace. - * @alias tagmanager.accounts.containers.workspaces.variables.revert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. - * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - revert(params?: any, options?: MethodOptions): - AxiosPromise; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - revert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}:revert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents an external user or internal Google Tag Manager system. + */ + export interface Schema$WorkspaceProposalUser { + /** + * Gaia id associated with a user, absent for the Google Tag Manager system. + */ + gaiaId: string; + /** + * User type distinguishes between a user and the Google Tag Manager system. + */ + type: string; } - - /** - * tagmanager.accounts.containers.workspaces.variables.update - * @desc Updates a GTM Variable. - * @alias tagmanager.accounts.containers.workspaces.variables.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. - * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} - * @param {().Variable} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a Google Tag Manager Zone's contents. + */ + export interface Schema$Zone { + /** + * GTM Account ID. + */ + accountId: string; + /** + * This Zone's boundary. + */ + boundary: Schema$ZoneBoundary; + /** + * Containers that are children of this Zone. + */ + childContainer: Schema$ZoneChildContainer[]; + /** + * GTM Container ID. + */ + containerId: string; + /** + * The fingerprint of the GTM Zone as computed at storage time. This value + * is recomputed whenever the zone is modified. + */ + fingerprint: string; + /** + * Zone display name. + */ + name: string; + /** + * User notes on how to apply this zone in the container. + */ + notes: string; + /** + * GTM Zone's API relative path. + */ + path: string; + /** + * Auto generated link to the tag manager UI + */ + tagManagerUrl: string; + /** + * This Zone's type restrictions. + */ + typeRestriction: Schema$ZoneTypeRestriction; + /** + * GTM Workspace ID. + */ + workspaceId: string; + /** + * The Zone ID uniquely identifies the GTM Zone. + */ + zoneId: string; } -} - - - -export class Resource$Accounts$User_permissions { - root: Tagmanager; - constructor(root: Tagmanager) { - this.root = root; - this.getRoot.bind(this); + /** + * Represents a Zone's boundaries. + */ + export interface Schema$ZoneBoundary { + /** + * The conditions that, when conjoined, make up the boundary. + */ + condition: Schema$Condition[]; + /** + * Custom evaluation trigger IDs. A zone will evaluate its boundary + * conditions when any of the listed triggers are true. + */ + customEvaluationTriggerId: string[]; } - - getRoot() { - return this.root; + /** + * Represents a child container of a Zone. + */ + export interface Schema$ZoneChildContainer { + /** + * The zone's nickname for the child container. + */ + nickname: string; + /** + * The child container's public id. + */ + publicId: string; } - - /** - * tagmanager.accounts.user_permissions.create - * @desc Creates a user's Account & Container access. - * @alias tagmanager.accounts.user_permissions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.parent GTM Account's API relative path. Example: accounts/{account_id} - * @param {().UserPermission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + * Represents a Zone's type restrictions. + */ + export interface Schema$ZoneTypeRestriction { + /** + * True if type restrictions have been enabled for this Zone. + */ + enable: boolean; + /** + * List of type public ids that have been whitelisted for use in this Zone. + */ + whitelistedTypeId: string[]; + } + + export class Resource$Accounts { + root: Tagmanager; + containers: Resource$Accounts$Containers; + user_permissions: Resource$Accounts$User_permissions; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.containers = new Resource$Accounts$Containers(root); + this.user_permissions = new Resource$Accounts$User_permissions(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.get + * @desc Gets a GTM Account. + * @alias tagmanager.accounts.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Accounts's API relative path. Example: accounts/{account_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.list + * @desc Lists all GTM Accounts that a user has access to. + * @alias tagmanager.accounts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.update + * @desc Updates a GTM Account. + * @alias tagmanager.accounts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the account in storage. + * @param {string} params.path GTM Accounts's API relative path. Example: accounts/{account_id} + * @param {().Account} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Accounts$Containers { + root: Tagmanager; + environments: Resource$Accounts$Containers$Environments; + versions: Resource$Accounts$Containers$Versions; + version_headers: Resource$Accounts$Containers$Version_headers; + workspaces: Resource$Accounts$Containers$Workspaces; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.environments = new Resource$Accounts$Containers$Environments(root); + this.versions = new Resource$Accounts$Containers$Versions(root); + this.version_headers = + new Resource$Accounts$Containers$Version_headers(root); + this.workspaces = new Resource$Accounts$Containers$Workspaces(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.create + * @desc Creates a Container. + * @alias tagmanager.accounts.containers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Account's API relative path. Example: accounts/{account_id}. + * @param {().Container} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/containers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.delete + * @desc Deletes a Container. + * @alias tagmanager.accounts.containers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.get + * @desc Gets a Container. + * @alias tagmanager.accounts.containers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.list + * @desc Lists all Containers that belongs to a GTM Account. + * @alias tagmanager.accounts.containers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Accounts's API relative path. Example: accounts/{account_id}. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/containers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.update + * @desc Updates a Container. + * @alias tagmanager.accounts.containers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container in storage. + * @param {string} params.path GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {().Container} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/user_permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Accounts$Containers$Environments { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.environments.create + * @desc Creates a GTM Environment. + * @alias tagmanager.accounts.containers.environments.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/environments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.delete + * @desc Deletes a GTM Environment. + * @alias tagmanager.accounts.containers.environments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.get + * @desc Gets a GTM Environment. + * @alias tagmanager.accounts.containers.environments.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.list + * @desc Lists all GTM Environments of a GTM Container. + * @alias tagmanager.accounts.containers.environments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/environments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.patch + * @desc Updates a GTM Environment. This method supports patch semantics. + * @alias tagmanager.accounts.containers.environments.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. + * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.reauthorize + * @desc Re-generates the authorization code for a GTM Environment. + * @alias tagmanager.accounts.containers.environments.reauthorize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reauthorize(params?: any, options?: MethodOptions): + AxiosPromise; + reauthorize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reauthorize( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:reauthorize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.environments.update + * @desc Updates a GTM Environment. + * @alias tagmanager.accounts.containers.environments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the environment in storage. + * @param {string} params.path GTM Environment's API relative path. Example: accounts/{account_id}/containers/{container_id}/environments/{environment_id} + * @param {().Environment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * tagmanager.accounts.user_permissions.delete - * @desc Removes a user from the account, revoking access to it and all of its - * containers. - * @alias tagmanager.accounts.user_permissions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Accounts$Containers$Versions { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.versions.delete + * @desc Deletes a Container Version. + * @alias tagmanager.accounts.containers.versions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.get + * @desc Gets a Container Version. + * @alias tagmanager.accounts.containers.versions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.containerVersionId The GTM ContainerVersion ID. Specify published to retrieve the currently published version. + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.live + * @desc Gets the live (i.e. published) container version + * @alias tagmanager.accounts.containers.versions.live + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + live(params?: any, options?: MethodOptions): + AxiosPromise; + live( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + live( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/versions:live') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.publish + * @desc Publishes a Container Version. + * @alias tagmanager.accounts.containers.versions.publish + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publish(params?: any, options?: MethodOptions): + AxiosPromise; + publish( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): void; + publish( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:publish') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.set_latest + * @desc Sets the latest version used for synchronization of workspaces when + * detecting conflicts and errors. + * @alias tagmanager.accounts.containers.versions.set_latest + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + set_latest(params?: any, options?: MethodOptions): + AxiosPromise; + set_latest( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + set_latest( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:set_latest') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.undelete + * @desc Undeletes a Container Version. + * @alias tagmanager.accounts.containers.versions.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.versions.update + * @desc Updates a Container Version. + * @alias tagmanager.accounts.containers.versions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the container version in storage. + * @param {string} params.path GTM ContainerVersion's API relative path. Example: accounts/{account_id}/containers/{container_id}/versions/{version_id} + * @param {().ContainerVersion} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Accounts$Containers$Version_headers { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.version_headers.latest + * @desc Gets the latest container version header + * @alias tagmanager.accounts.containers.version_headers.latest + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + latest(params?: any, options?: MethodOptions): + AxiosPromise; + latest( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + latest( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/version_headers:latest') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.version_headers.list + * @desc Lists all Container Versions of a GTM Container. + * @alias tagmanager.accounts.containers.version_headers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeDeleted Also retrieve deleted (archived) versions when true. + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/version_headers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } - /** - * tagmanager.accounts.user_permissions.get - * @desc Gets a user's Account & Container access. - * @alias tagmanager.accounts.user_permissions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts$Containers$Workspaces { + root: Tagmanager; + built_in_variables: + Resource$Accounts$Containers$Workspaces$Built_in_variables; + folders: Resource$Accounts$Containers$Workspaces$Folders; + proposal: Resource$Accounts$Containers$Workspaces$Proposal; + tags: Resource$Accounts$Containers$Workspaces$Tags; + triggers: Resource$Accounts$Containers$Workspaces$Triggers; + variables: Resource$Accounts$Containers$Workspaces$Variables; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + this.built_in_variables = + new Resource$Accounts$Containers$Workspaces$Built_in_variables(root); + this.folders = new Resource$Accounts$Containers$Workspaces$Folders(root); + this.proposal = + new Resource$Accounts$Containers$Workspaces$Proposal(root); + this.tags = new Resource$Accounts$Containers$Workspaces$Tags(root); + this.triggers = + new Resource$Accounts$Containers$Workspaces$Triggers(root); + this.variables = + new Resource$Accounts$Containers$Workspaces$Variables(root); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.create + * @desc Creates a Workspace. + * @alias tagmanager.accounts.containers.workspaces.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {().Workspace} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/workspaces') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.create_version + * @desc Creates a Container Version from the entities present in the + * workspace, deletes the workspace, and sets the base container version to + * the newly created version. + * @alias tagmanager.accounts.containers.workspaces.create_version + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().CreateContainerVersionRequestVersionOptions} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create_version(params?: any, options?: MethodOptions): + AxiosPromise; + create_version( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create_version( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:create_version') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.delete + * @desc Deletes a Workspace. + * @alias tagmanager.accounts.containers.workspaces.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.get + * @desc Gets a Workspace. + * @alias tagmanager.accounts.containers.workspaces.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.getProposal + * @desc Gets a GTM Workspace Proposal. + * @alias tagmanager.accounts.containers.workspaces.getProposal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getProposal(params?: any, options?: MethodOptions): + AxiosPromise; + getProposal( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getProposal( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.getStatus + * @desc Finds conflicting and modified entities in the workspace. + * @alias tagmanager.accounts.containers.workspaces.getStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getStatus(params?: any, options?: MethodOptions): + AxiosPromise; + getStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + getStatus( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}/status') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.list + * @desc Lists all Workspaces that belong to a GTM Container. + * @alias tagmanager.accounts.containers.workspaces.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM parent Container's API relative path. Example: accounts/{account_id}/containers/{container_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/workspaces') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.quick_preview + * @desc Quick previews a workspace by creating a fake container version + * from all entities in the provided workspace. + * @alias tagmanager.accounts.containers.workspaces.quick_preview + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + quick_preview(params?: any, options?: MethodOptions): + AxiosPromise; + quick_preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + quick_preview( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:quick_preview') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.resolve_conflict + * @desc Resolves a merge conflict for a workspace entity by updating it to + * the resolved entity passed in the request. + * @alias tagmanager.accounts.containers.workspaces.resolve_conflict + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the entity_in_workspace in the merge conflict. + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Entity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + resolve_conflict(params?: any, options?: MethodOptions): AxiosPromise; + resolve_conflict( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + resolve_conflict( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:resolve_conflict') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.sync + * @desc Syncs a workspace to the latest container version by updating all + * unmodified workspace entities and displaying conflicts for modified + * entities. + * @alias tagmanager.accounts.containers.workspaces.sync + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + sync(params?: any, options?: MethodOptions): + AxiosPromise; + sync( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + sync( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:sync') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.update + * @desc Updates a Workspace. + * @alias tagmanager.accounts.containers.workspaces.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the workspace in storage. + * @param {string} params.path GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Workspace} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.updateProposal + * @desc Updates a GTM Workspace Proposal. + * @alias tagmanager.accounts.containers.workspaces.updateProposal + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + * @param {().UpdateWorkspaceProposalRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + updateProposal(params?: any, options?: MethodOptions): + AxiosPromise; + updateProposal( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + updateProposal( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Accounts$Containers$Workspaces$Built_in_variables { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.built_in_variables.create + * @desc Creates one or more GTM Built-In Variables. + * @alias + * tagmanager.accounts.containers.workspaces.built_in_variables.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {string=} params.type The types of built-in variables to enable. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + create( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/built_in_variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.built_in_variables.delete + * @desc Deletes one or more GTM Built-In Variables. + * @alias + * tagmanager.accounts.containers.workspaces.built_in_variables.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + * @param {string=} params.type The types of built-in variables to delete. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.built_in_variables.list + * @desc Lists all the enabled Built-In Variables of a GTM Container. + * @alias tagmanager.accounts.containers.workspaces.built_in_variables.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/built_in_variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.built_in_variables.revert + * @desc Reverts changes to a GTM Built-In Variables in a GTM Workspace. + * @alias + * tagmanager.accounts.containers.workspaces.built_in_variables.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM BuiltInVariable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/built_in_variables + * @param {string=} params.type The type of built-in variable to revert. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): + AxiosPromise; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/tagmanager/v2/{+path}/built_in_variables:revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Accounts$Containers$Workspaces$Folders { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.create + * @desc Creates a GTM Folder. + * @alias tagmanager.accounts.containers.workspaces.folders.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/folders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.delete + * @desc Deletes a GTM Folder. + * @alias tagmanager.accounts.containers.workspaces.folders.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.entities + * @desc List all entities in a GTM Folder. + * @alias tagmanager.accounts.containers.workspaces.folders.entities + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + entities(params?: any, options?: MethodOptions): + AxiosPromise; + entities( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + entities( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:entities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.get + * @desc Gets a GTM Folder. + * @alias tagmanager.accounts.containers.workspaces.folders.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.list + * @desc Lists all GTM Folders of a Container. + * @alias tagmanager.accounts.containers.workspaces.folders.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/folders') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder + * @desc Moves entities to a GTM Folder. + * @alias + * tagmanager.accounts.containers.workspaces.folders.move_entities_to_folder + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {string=} params.tagId The tags to be moved to the folder. + * @param {string=} params.triggerId The triggers to be moved to the folder. + * @param {string=} params.variableId The variables to be moved to the folder. + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + move_entities_to_folder(params?: any, options?: MethodOptions): + AxiosPromise; + move_entities_to_folder( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + move_entities_to_folder( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:move_entities_to_folder') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.revert + * @desc Reverts changes to a GTM Folder in a GTM Workspace. + * @alias tagmanager.accounts.containers.workspaces.folders.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): + AxiosPromise; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.folders.update + * @desc Updates a GTM Folder. + * @alias tagmanager.accounts.containers.workspaces.folders.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the folder in storage. + * @param {string} params.path GTM Folder's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/folders/{folder_id} + * @param {().Folder} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Accounts$Containers$Workspaces$Proposal { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.proposal.create + * @desc Creates a GTM Workspace Proposal. + * @alias tagmanager.accounts.containers.workspaces.proposal.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{aid}/containers/{cid}/workspace/{wid} + * @param {().CreateWorkspaceProposalRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/proposal') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.proposal.delete + * @desc Deletes a GTM Workspace Proposal. + * @alias tagmanager.accounts.containers.workspaces.proposal.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM workspace proposal's relative path: Example: accounts/{aid}/containers/{cid}/workspace/{wid}/workspace_proposal + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } - /** - * tagmanager.accounts.user_permissions.list - * @desc List all users that have access to the account along with Account and - * Container user access granted to each of them. - * @alias tagmanager.accounts.user_permissions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.pageToken Continuation token for fetching the next page of results. - * @param {string} params.parent GTM Accounts's API relative path. Example: accounts/{account_id} - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Accounts$Containers$Workspaces$Tags { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.create + * @desc Creates a GTM Tag. + * @alias tagmanager.accounts.containers.workspaces.tags.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Tag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/tags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.delete + * @desc Deletes a GTM Tag. + * @alias tagmanager.accounts.containers.workspaces.tags.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.get + * @desc Gets a GTM Tag. + * @alias tagmanager.accounts.containers.workspaces.tags.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.list + * @desc Lists all GTM Tags of a Container. + * @alias tagmanager.accounts.containers.workspaces.tags.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/tags') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.revert + * @desc Reverts changes to a GTM Tag in a GTM Workspace. + * @alias tagmanager.accounts.containers.workspaces.tags.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of thetag in storage. + * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): + AxiosPromise; + revert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.tags.update + * @desc Updates a GTM Tag. + * @alias tagmanager.accounts.containers.workspaces.tags.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the tag in storage. + * @param {string} params.path GTM Tag's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags/{tag_id} + * @param {().Tag} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + + export class Resource$Accounts$Containers$Workspaces$Triggers { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.create + * @desc Creates a GTM Trigger. + * @alias tagmanager.accounts.containers.workspaces.triggers.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Trigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.delete + * @desc Deletes a GTM Trigger. + * @alias tagmanager.accounts.containers.workspaces.triggers.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.get + * @desc Gets a GTM Trigger. + * @alias tagmanager.accounts.containers.workspaces.triggers.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.list + * @desc Lists all GTM Triggers of a Container. + * @alias tagmanager.accounts.containers.workspaces.triggers.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Workspaces's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/triggers') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.revert + * @desc Reverts changes to a GTM Trigger in a GTM Workspace. + * @alias tagmanager.accounts.containers.workspaces.triggers.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. + * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): + AxiosPromise; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.triggers.update + * @desc Updates a GTM Trigger. + * @alias tagmanager.accounts.containers.workspaces.triggers.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the trigger in storage. + * @param {string} params.path GTM Trigger's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers/{trigger_id} + * @param {().Trigger} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+parent}/user_permissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + } + + export class Resource$Accounts$Containers$Workspaces$Variables { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.create + * @desc Creates a GTM Variable. + * @alias tagmanager.accounts.containers.workspaces.variables.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.delete + * @desc Deletes a GTM Variable. + * @alias tagmanager.accounts.containers.workspaces.variables.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.get + * @desc Gets a GTM Variable. + * @alias tagmanager.accounts.containers.workspaces.variables.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.list + * @desc Lists all GTM Variables of a Container. + * @alias tagmanager.accounts.containers.workspaces.variables.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Workspace's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/variables') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.revert + * @desc Reverts changes to a GTM Variable in a GTM Workspace. + * @alias tagmanager.accounts.containers.workspaces.variables.revert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. + * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + revert(params?: any, options?: MethodOptions): + AxiosPromise; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + revert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}:revert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.containers.workspaces.variables.update + * @desc Updates a GTM Variable. + * @alias tagmanager.accounts.containers.workspaces.variables.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.fingerprint When provided, this fingerprint must match the fingerprint of the variable in storage. + * @param {string} params.path GTM Variable's API relative path. Example: accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables/{variable_id} + * @param {().Variable} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * tagmanager.accounts.user_permissions.update - * @desc Updates a user's Account & Container access. - * @alias tagmanager.accounts.user_permissions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} - * @param {().UserPermission} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tagmanager/v2/{+path}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['path'], - pathParams: ['path'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + export class Resource$Accounts$User_permissions { + root: Tagmanager; + constructor(root: Tagmanager) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tagmanager.accounts.user_permissions.create + * @desc Creates a user's Account & Container access. + * @alias tagmanager.accounts.user_permissions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent GTM Account's API relative path. Example: accounts/{account_id} + * @param {().UserPermission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/user_permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.user_permissions.delete + * @desc Removes a user from the account, revoking access to it and all of + * its containers. + * @alias tagmanager.accounts.user_permissions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.user_permissions.get + * @desc Gets a user's Account & Container access. + * @alias tagmanager.accounts.user_permissions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.user_permissions.list + * @desc List all users that have access to the account along with Account + * and Container user access granted to each of them. + * @alias tagmanager.accounts.user_permissions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.pageToken Continuation token for fetching the next page of results. + * @param {string} params.parent GTM Accounts's API relative path. Example: accounts/{account_id} + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+parent}/user_permissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tagmanager.accounts.user_permissions.update + * @desc Updates a user's Account & Container access. + * @alias tagmanager.accounts.user_permissions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.path GTM UserPermission's API relative path. Example: accounts/{account_id}/user_permissions/{user_permission_id} + * @param {().UserPermission} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tagmanager/v2/{+path}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['path'], + pathParams: ['path'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/taskqueue/v1beta1.ts b/src/apis/taskqueue/v1beta1.ts index aecbfd17908..94d63147e4b 100644 --- a/src/apis/taskqueue/v1beta1.ts +++ b/src/apis/taskqueue/v1beta1.ts @@ -27,408 +27,415 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * TaskQueue API - * - * Accesses a Google App Engine Pull Task Queue over REST. - * - * @example - * const google = require('googleapis'); - * const taskqueue = google.taskqueue('v1beta1'); - * - * @namespace taskqueue - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Taskqueue - */ -export class Taskqueue { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - taskqueues: Resource$Taskqueues; - tasks: Resource$Tasks; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.taskqueues = new Resource$Taskqueues(this); - this.tasks = new Resource$Tasks(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Task { - /** - * Time (in seconds since the epoch) at which the task was enqueued. - */ - enqueueTimestamp: string; - /** - * Name of the task. - */ - id: string; - /** - * The kind of object returned, in this case set to task. - */ - kind: string; - /** - * Time (in seconds since the epoch) at which the task lease will expire. This - * value is 0 if the task isnt currently leased out to a worker. - */ - leaseTimestamp: string; - /** - * A bag of bytes which is the task payload. The payload on the JSON side is - * always Base64 encoded. - */ - payloadBase64: string; - /** - * Name of the queue that the task is in. - */ - queueName: string; -} -export interface Schema$TaskQueue { - /** - * ACLs that are applicable to this TaskQueue object. - */ - acl: any; - /** - * Name of the taskqueue. - */ - id: string; - /** - * The kind of REST object returned, in this case taskqueue. - */ - kind: string; - /** - * The number of times we should lease out tasks before giving up on them. If - * unset we lease them out forever until a worker deletes the task. - */ - maxLeases: number; - /** - * Statistics for the TaskQueue object in question. - */ - stats: any; -} -export interface Schema$Tasks { - /** - * The actual list of tasks returned as a result of the lease operation. - */ - items: Schema$Task[]; - /** - * The kind of object returned, a list of tasks. - */ - kind: string; -} -export interface Schema$Tasks2 { - /** - * The actual list of tasks currently active in the TaskQueue. - */ - items: Schema$Task[]; +export namespace taskqueue_v1beta1 { /** - * The kind of object returned, a list of tasks. + * TaskQueue API + * + * Accesses a Google App Engine Pull Task Queue over REST. + * + * @example + * const google = require('googleapis'); + * const taskqueue = google.taskqueue('v1beta1'); + * + * @namespace taskqueue + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Taskqueue */ - kind: string; -} + export class Taskqueue { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Taskqueues { - root: Taskqueue; - constructor(root: Taskqueue) { - this.root = root; - this.getRoot.bind(this); - } + taskqueues: Resource$Taskqueues; + tasks: Resource$Tasks; - getRoot() { - return this.root; - } + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - - /** - * taskqueue.taskqueues.get - * @desc Get detailed information about a TaskQueue. - * @alias taskqueue.taskqueues.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.getStats Whether to get stats. Optional. - * @param {string} params.project The project under which the queue lies. - * @param {string} params.taskqueue The id of the taskqueue to get the properties of. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.taskqueues = new Resource$Taskqueues(this); + this.tasks = new Resource$Tasks(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Tasks { - root: Taskqueue; - constructor(root: Taskqueue) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Task { + /** + * Time (in seconds since the epoch) at which the task was enqueued. + */ + enqueueTimestamp: string; + /** + * Name of the task. + */ + id: string; + /** + * The kind of object returned, in this case set to task. + */ + kind: string; + /** + * Time (in seconds since the epoch) at which the task lease will expire. + * This value is 0 if the task isnt currently leased out to a worker. + */ + leaseTimestamp: string; + /** + * A bag of bytes which is the task payload. The payload on the JSON side is + * always Base64 encoded. + */ + payloadBase64: string; + /** + * Name of the queue that the task is in. + */ + queueName: string; } - - getRoot() { - return this.root; + export interface Schema$TaskQueue { + /** + * ACLs that are applicable to this TaskQueue object. + */ + acl: any; + /** + * Name of the taskqueue. + */ + id: string; + /** + * The kind of REST object returned, in this case taskqueue. + */ + kind: string; + /** + * The number of times we should lease out tasks before giving up on them. + * If unset we lease them out forever until a worker deletes the task. + */ + maxLeases: number; + /** + * Statistics for the TaskQueue object in question. + */ + stats: any; + } + export interface Schema$Tasks { + /** + * The actual list of tasks returned as a result of the lease operation. + */ + items: Schema$Task[]; + /** + * The kind of object returned, a list of tasks. + */ + kind: string; + } + export interface Schema$Tasks2 { + /** + * The actual list of tasks currently active in the TaskQueue. + */ + items: Schema$Task[]; + /** + * The kind of object returned, a list of tasks. + */ + kind: string; } - - /** - * taskqueue.tasks.delete - * @desc Delete a task from a TaskQueue. - * @alias taskqueue.tasks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task The id of the task to delete. - * @param {string} params.taskqueue The taskqueue to delete a task from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Taskqueues { + root: Taskqueue; + constructor(root: Taskqueue) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * taskqueue.tasks.get - * @desc Get a particular task from a TaskQueue. - * @alias taskqueue.tasks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task The task to get properties of. - * @param {string} params.taskqueue The taskqueue in which the task belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * taskqueue.taskqueues.get + * @desc Get detailed information about a TaskQueue. + * @alias taskqueue.taskqueues.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.getStats Whether to get stats. Optional. + * @param {string} params.project The project under which the queue lies. + * @param {string} params.taskqueue The id of the taskqueue to get the properties of. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * taskqueue.tasks.lease - * @desc Lease 1 or more tasks from a TaskQueue. - * @alias taskqueue.tasks.lease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.leaseSecs The lease in seconds. - * @param {integer} params.numTasks The number of tasks to lease. - * @param {string} params.project The project under which the queue lies. - * @param {string} params.taskqueue The taskqueue to lease a task from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lease(params?: any, options?: MethodOptions): AxiosPromise; - lease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Tasks { + root: Taskqueue; + constructor(root: Taskqueue) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/lease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'numTasks', 'leaseSecs'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * taskqueue.tasks.delete + * @desc Delete a task from a TaskQueue. + * @alias taskqueue.tasks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task The id of the task to delete. + * @param {string} params.taskqueue The taskqueue to delete a task from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * taskqueue.tasks.list - * @desc List Tasks in a TaskQueue - * @alias taskqueue.tasks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.taskqueue The id of the taskqueue to list tasks from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * taskqueue.tasks.get + * @desc Get a particular task from a TaskQueue. + * @alias taskqueue.tasks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task The task to get properties of. + * @param {string} params.taskqueue The taskqueue in which the task belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * taskqueue.tasks.lease + * @desc Lease 1 or more tasks from a TaskQueue. + * @alias taskqueue.tasks.lease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.leaseSecs The lease in seconds. + * @param {integer} params.numTasks The number of tasks to lease. + * @param {string} params.project The project under which the queue lies. + * @param {string} params.taskqueue The taskqueue to lease a task from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lease(params?: any, options?: MethodOptions): AxiosPromise; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks/lease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'numTasks', 'leaseSecs'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * taskqueue.tasks.list + * @desc List Tasks in a TaskQueue + * @alias taskqueue.tasks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.taskqueue The id of the taskqueue to list tasks from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta1/projects/{project}/taskqueues/{taskqueue}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/taskqueue/v1beta2.ts b/src/apis/taskqueue/v1beta2.ts index 388ef3150f2..7ef68ea5658 100644 --- a/src/apis/taskqueue/v1beta2.ts +++ b/src/apis/taskqueue/v1beta2.ts @@ -27,589 +27,596 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * TaskQueue API - * - * Accesses a Google App Engine Pull Task Queue over REST. - * - * @example - * const google = require('googleapis'); - * const taskqueue = google.taskqueue('v1beta2'); - * - * @namespace taskqueue - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Taskqueue - */ -export class Taskqueue { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - taskqueues: Resource$Taskqueues; - tasks: Resource$Tasks; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.taskqueues = new Resource$Taskqueues(this); - this.tasks = new Resource$Tasks(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Task { - /** - * Time (in seconds since the epoch) at which the task was enqueued. - */ - enqueueTimestamp: string; - /** - * Name of the task. - */ - id: string; - /** - * The kind of object returned, in this case set to task. - */ - kind: string; - /** - * Time (in seconds since the epoch) at which the task lease will expire. This - * value is 0 if the task isnt currently leased out to a worker. - */ - leaseTimestamp: string; +export namespace taskqueue_v1beta2 { /** - * A bag of bytes which is the task payload. The payload on the JSON side is - * always Base64 encoded. - */ - payloadBase64: string; - /** - * Name of the queue that the task is in. - */ - queueName: string; - /** - * The number of leases applied to this task. - */ - retry_count: number; - /** - * Tag for the task, could be used later to lease tasks grouped by a specific - * tag. - */ - tag: string; -} -export interface Schema$TaskQueue { - /** - * ACLs that are applicable to this TaskQueue object. - */ - acl: any; - /** - * Name of the taskqueue. - */ - id: string; - /** - * The kind of REST object returned, in this case taskqueue. - */ - kind: string; - /** - * The number of times we should lease out tasks before giving up on them. If - * unset we lease them out forever until a worker deletes the task. - */ - maxLeases: number; - /** - * Statistics for the TaskQueue object in question. - */ - stats: any; -} -export interface Schema$Tasks { - /** - * The actual list of tasks returned as a result of the lease operation. - */ - items: Schema$Task[]; - /** - * The kind of object returned, a list of tasks. - */ - kind: string; -} -export interface Schema$Tasks2 { - /** - * The actual list of tasks currently active in the TaskQueue. - */ - items: Schema$Task[]; - /** - * The kind of object returned, a list of tasks. + * TaskQueue API + * + * Accesses a Google App Engine Pull Task Queue over REST. + * + * @example + * const google = require('googleapis'); + * const taskqueue = google.taskqueue('v1beta2'); + * + * @namespace taskqueue + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Taskqueue */ - kind: string; -} + export class Taskqueue { + _options: GlobalOptions; + google: GoogleApis; + root = this; -export class Resource$Taskqueues { - root: Taskqueue; - constructor(root: Taskqueue) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } + taskqueues: Resource$Taskqueues; + tasks: Resource$Tasks; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * taskqueue.taskqueues.get - * @desc Get detailed information about a TaskQueue. - * @alias taskqueue.taskqueues.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.getStats Whether to get stats. Optional. - * @param {string} params.project The project under which the queue lies. - * @param {string} params.taskqueue The id of the taskqueue to get the properties of. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + this.taskqueues = new Resource$Taskqueues(this); + this.tasks = new Resource$Tasks(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } } -} -export class Resource$Tasks { - root: Taskqueue; - constructor(root: Taskqueue) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Task { + /** + * Time (in seconds since the epoch) at which the task was enqueued. + */ + enqueueTimestamp: string; + /** + * Name of the task. + */ + id: string; + /** + * The kind of object returned, in this case set to task. + */ + kind: string; + /** + * Time (in seconds since the epoch) at which the task lease will expire. + * This value is 0 if the task isnt currently leased out to a worker. + */ + leaseTimestamp: string; + /** + * A bag of bytes which is the task payload. The payload on the JSON side is + * always Base64 encoded. + */ + payloadBase64: string; + /** + * Name of the queue that the task is in. + */ + queueName: string; + /** + * The number of leases applied to this task. + */ + retry_count: number; + /** + * Tag for the task, could be used later to lease tasks grouped by a + * specific tag. + */ + tag: string; } - - getRoot() { - return this.root; + export interface Schema$TaskQueue { + /** + * ACLs that are applicable to this TaskQueue object. + */ + acl: any; + /** + * Name of the taskqueue. + */ + id: string; + /** + * The kind of REST object returned, in this case taskqueue. + */ + kind: string; + /** + * The number of times we should lease out tasks before giving up on them. + * If unset we lease them out forever until a worker deletes the task. + */ + maxLeases: number; + /** + * Statistics for the TaskQueue object in question. + */ + stats: any; + } + export interface Schema$Tasks { + /** + * The actual list of tasks returned as a result of the lease operation. + */ + items: Schema$Task[]; + /** + * The kind of object returned, a list of tasks. + */ + kind: string; + } + export interface Schema$Tasks2 { + /** + * The actual list of tasks currently active in the TaskQueue. + */ + items: Schema$Task[]; + /** + * The kind of object returned, a list of tasks. + */ + kind: string; } - - /** - * taskqueue.tasks.delete - * @desc Delete a task from a TaskQueue. - * @alias taskqueue.tasks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task The id of the task to delete. - * @param {string} params.taskqueue The taskqueue to delete a task from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Taskqueues { + root: Taskqueue; + constructor(root: Taskqueue) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * taskqueue.tasks.get - * @desc Get a particular task from a TaskQueue. - * @alias taskqueue.tasks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task The task to get properties of. - * @param {string} params.taskqueue The taskqueue in which the task belongs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * taskqueue.taskqueues.get + * @desc Get detailed information about a TaskQueue. + * @alias taskqueue.taskqueues.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.getStats Whether to get stats. Optional. + * @param {string} params.project The project under which the queue lies. + * @param {string} params.taskqueue The id of the taskqueue to get the properties of. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * taskqueue.tasks.insert - * @desc Insert a new task in a TaskQueue - * @alias taskqueue.tasks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies - * @param {string} params.taskqueue The taskqueue to insert the task into - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Tasks { + root: Taskqueue; + constructor(root: Taskqueue) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'taskqueue'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * taskqueue.tasks.lease - * @desc Lease 1 or more tasks from a TaskQueue. - * @alias taskqueue.tasks.lease - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.groupByTag When true, all returned tasks will have the same tag - * @param {integer} params.leaseSecs The lease in seconds. - * @param {integer} params.numTasks The number of tasks to lease. - * @param {string} params.project The project under which the queue lies. - * @param {string=} params.tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag - * @param {string} params.taskqueue The taskqueue to lease a task from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - lease(params?: any, options?: MethodOptions): AxiosPromise; - lease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - lease( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * taskqueue.tasks.delete + * @desc Delete a task from a TaskQueue. + * @alias taskqueue.tasks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task The id of the task to delete. + * @param {string} params.taskqueue The taskqueue to delete a task from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/lease') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'numTasks', 'leaseSecs'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * taskqueue.tasks.list - * @desc List Tasks in a TaskQueue - * @alias taskqueue.tasks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.project The project under which the queue lies. - * @param {string} params.taskqueue The id of the taskqueue to list tasks from. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * taskqueue.tasks.get + * @desc Get a particular task from a TaskQueue. + * @alias taskqueue.tasks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task The task to get properties of. + * @param {string} params.taskqueue The taskqueue in which the task belongs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['project', 'taskqueue'], - pathParams: ['project', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * taskqueue.tasks.patch - * @desc Update tasks that are leased out of a TaskQueue. This method supports - * patch semantics. - * @alias taskqueue.tasks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.newLeaseSeconds The new lease in seconds. - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task - * @param {string} params.taskqueue - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * taskqueue.tasks.insert + * @desc Insert a new task in a TaskQueue + * @alias taskqueue.tasks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies + * @param {string} params.taskqueue The taskqueue to insert the task into + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'taskqueue'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task', 'newLeaseSeconds'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * taskqueue.tasks.lease + * @desc Lease 1 or more tasks from a TaskQueue. + * @alias taskqueue.tasks.lease + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.groupByTag When true, all returned tasks will have the same tag + * @param {integer} params.leaseSecs The lease in seconds. + * @param {integer} params.numTasks The number of tasks to lease. + * @param {string} params.project The project under which the queue lies. + * @param {string=} params.tag The tag allowed for tasks in the response. Must only be specified if group_by_tag is true. If group_by_tag is true and tag is not specified the tag will be that of the oldest task by eta, i.e. the first available tag + * @param {string} params.taskqueue The taskqueue to lease a task from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + lease(params?: any, options?: MethodOptions): AxiosPromise; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + lease( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/lease') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'numTasks', 'leaseSecs'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * taskqueue.tasks.update - * @desc Update tasks that are leased out of a TaskQueue. - * @alias taskqueue.tasks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer} params.newLeaseSeconds The new lease in seconds. - * @param {string} params.project The project under which the queue lies. - * @param {string} params.task - * @param {string} params.taskqueue - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * taskqueue.tasks.list + * @desc List Tasks in a TaskQueue + * @alias taskqueue.tasks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.project The project under which the queue lies. + * @param {string} params.taskqueue The id of the taskqueue to list tasks from. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['project', 'taskqueue'], + pathParams: ['project', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * taskqueue.tasks.patch + * @desc Update tasks that are leased out of a TaskQueue. This method + * supports patch semantics. + * @alias taskqueue.tasks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.newLeaseSeconds The new lease in seconds. + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task + * @param {string} params.taskqueue + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task', 'newLeaseSeconds'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['project', 'taskqueue', 'task', 'newLeaseSeconds'], - pathParams: ['project', 'task', 'taskqueue'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * taskqueue.tasks.update + * @desc Update tasks that are leased out of a TaskQueue. + * @alias taskqueue.tasks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer} params.newLeaseSeconds The new lease in seconds. + * @param {string} params.project The project under which the queue lies. + * @param {string} params.task + * @param {string} params.taskqueue + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['project', 'taskqueue', 'task', 'newLeaseSeconds'], + pathParams: ['project', 'task', 'taskqueue'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/tasks/v1.ts b/src/apis/tasks/v1.ts index 8cfc2bb74d2..cc0408c4908 100644 --- a/src/apis/tasks/v1.ts +++ b/src/apis/tasks/v1.ts @@ -27,949 +27,957 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Tasks API - * - * Lets you manage your tasks and task lists. - * - * @example - * const google = require('googleapis'); - * const tasks = google.tasks('v1'); - * - * @namespace tasks - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Tasks - */ -export class Tasks { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - tasklists: Resource$Tasklists; - tasks: Resource$Tasks; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.tasklists = new Resource$Tasklists(this); - this.tasks = new Resource$Tasks(this); - } - - getRoot() { - return this.root; - } -} - -export interface Schema$Task { - /** - * Completion date of the task (as a RFC 3339 timestamp). This field is - * omitted if the task has not been completed. - */ - completed: string; - /** - * Flag indicating whether the task has been deleted. The default if False. - */ - deleted: boolean; - /** - * Due date of the task (as a RFC 3339 timestamp). Optional. - */ - due: string; - /** - * ETag of the resource. - */ - etag: string; - /** - * Flag indicating whether the task is hidden. This is the case if the task - * had been marked completed when the task list was last cleared. The default - * is False. This field is read-only. - */ - hidden: boolean; - /** - * Task identifier. - */ - id: string; - /** - * Type of the resource. This is always "tasks#task". - */ - kind: string; - /** - * Collection of links. This collection is read-only. - */ - links: any[]; - /** - * Notes describing the task. Optional. - */ - notes: string; - /** - * Parent task identifier. This field is omitted if it is a top-level task. - * This field is read-only. Use the "move" method to move the task - * under a different parent or to the top level. - */ - parent: string; - /** - * String indicating the position of the task among its sibling tasks under - * the same parent task or at the top level. If this string is greater than - * another task's corresponding position string according to - * lexicographical ordering, the task is positioned after the other task under - * the same parent task (or at the top level). This field is read-only. Use - * the "move" method to move the task to another position. - */ - position: string; - /** - * URL pointing to this task. Used to retrieve, update, or delete this task. - */ - selfLink: string; - /** - * Status of the task. This is either "needsAction" or - * "completed". - */ - status: string; - /** - * Title of the task. - */ - title: string; - /** - * Last modification time of the task (as a RFC 3339 timestamp). - */ - updated: string; -} -export interface Schema$TaskList { - /** - * ETag of the resource. - */ - etag: string; - /** - * Task list identifier. - */ - id: string; - /** - * Type of the resource. This is always "tasks#taskList". - */ - kind: string; - /** - * URL pointing to this task list. Used to retrieve, update, or delete this - * task list. - */ - selfLink: string; - /** - * Title of the task list. - */ - title: string; - /** - * Last modification time of the task list (as a RFC 3339 timestamp). - */ - updated: string; -} -export interface Schema$TaskLists { - /** - * ETag of the resource. - */ - etag: string; +export namespace tasks_v1 { /** - * Collection of task lists. - */ - items: Schema$TaskList[]; - /** - * Type of the resource. This is always "tasks#taskLists". - */ - kind: string; - /** - * Token that can be used to request the next page of this result. - */ - nextPageToken: string; -} -export interface Schema$Tasks { - /** - * ETag of the resource. - */ - etag: string; - /** - * Collection of tasks. - */ - items: Schema$Task[]; - /** - * Type of the resource. This is always "tasks#tasks". - */ - kind: string; - /** - * Token used to access the next page of this result. - */ - nextPageToken: string; -} - -export class Resource$Tasklists { - root: Tasks; - constructor(root: Tasks) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * tasks.tasklists.delete - * @desc Deletes the authenticated user's specified task list. - * @alias tasks.tasklists.delete - * @memberOf! () + * Tasks API * - * @param {object} params Parameters for request - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasklists.get - * @desc Returns the authenticated user's specified task list. - * @alias tasks.tasklists.get - * @memberOf! () + * Lets you manage your tasks and task lists. * - * @param {object} params Parameters for request - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasklists.insert - * @desc Creates a new task list and adds it to the authenticated user's task - * lists. - * @alias tasks.tasklists.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const tasks = google.tasks('v1'); * - * @param {object} params Parameters for request - * @param {().TaskList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * @namespace tasks + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Tasks */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - + export class Tasks { + _options: GlobalOptions; + google: GoogleApis; + root = this; - /** - * tasks.tasklists.list - * @desc Returns all the authenticated user's task lists. - * @alias tasks.tasklists.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.maxResults Maximum number of task lists returned on one page. Optional. The default is 100. - * @param {string=} params.pageToken Token specifying the result page to return. Optional. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } + tasklists: Resource$Tasklists; + tasks: Resource$Tasks; + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - /** - * tasks.tasklists.patch - * @desc Updates the authenticated user's specified task list. This method - * supports patch semantics. - * @alias tasks.tasklists.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tasklist Task list identifier. - * @param {().TaskList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + this.tasklists = new Resource$Tasklists(this); + this.tasks = new Resource$Tasks(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - /** - * tasks.tasklists.update - * @desc Updates the authenticated user's specified task list. - * @alias tasks.tasklists.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tasklist Task list identifier. - * @param {().TaskList} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + getRoot() { + return this.root; } } -} -export class Resource$Tasks { - root: Tasks; - constructor(root: Tasks) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Task { + /** + * Completion date of the task (as a RFC 3339 timestamp). This field is + * omitted if the task has not been completed. + */ + completed: string; + /** + * Flag indicating whether the task has been deleted. The default if False. + */ + deleted: boolean; + /** + * Due date of the task (as a RFC 3339 timestamp). Optional. + */ + due: string; + /** + * ETag of the resource. + */ + etag: string; + /** + * Flag indicating whether the task is hidden. This is the case if the task + * had been marked completed when the task list was last cleared. The + * default is False. This field is read-only. + */ + hidden: boolean; + /** + * Task identifier. + */ + id: string; + /** + * Type of the resource. This is always "tasks#task". + */ + kind: string; + /** + * Collection of links. This collection is read-only. + */ + links: any[]; + /** + * Notes describing the task. Optional. + */ + notes: string; + /** + * Parent task identifier. This field is omitted if it is a top-level task. + * This field is read-only. Use the "move" method to move the task + * under a different parent or to the top level. + */ + parent: string; + /** + * String indicating the position of the task among its sibling tasks under + * the same parent task or at the top level. If this string is greater than + * another task's corresponding position string according to + * lexicographical ordering, the task is positioned after the other task + * under the same parent task (or at the top level). This field is + * read-only. Use the "move" method to move the task to another + * position. + */ + position: string; + /** + * URL pointing to this task. Used to retrieve, update, or delete this task. + */ + selfLink: string; + /** + * Status of the task. This is either "needsAction" or + * "completed". + */ + status: string; + /** + * Title of the task. + */ + title: string; + /** + * Last modification time of the task (as a RFC 3339 timestamp). + */ + updated: string; } - - getRoot() { - return this.root; + export interface Schema$TaskList { + /** + * ETag of the resource. + */ + etag: string; + /** + * Task list identifier. + */ + id: string; + /** + * Type of the resource. This is always "tasks#taskList". + */ + kind: string; + /** + * URL pointing to this task list. Used to retrieve, update, or delete this + * task list. + */ + selfLink: string; + /** + * Title of the task list. + */ + title: string; + /** + * Last modification time of the task list (as a RFC 3339 timestamp). + */ + updated: string; } - - - /** - * tasks.tasks.clear - * @desc Clears all completed tasks from the specified task list. The affected - * tasks will be marked as 'hidden' and no longer be returned by default when - * retrieving all tasks for a task list. - * @alias tasks.tasks.clear - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - clear(params?: any, options?: MethodOptions): AxiosPromise; - clear( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - clear( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/clear') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TaskLists { + /** + * ETag of the resource. + */ + etag: string; + /** + * Collection of task lists. + */ + items: Schema$TaskList[]; + /** + * Type of the resource. This is always "tasks#taskLists". + */ + kind: string; + /** + * Token that can be used to request the next page of this result. + */ + nextPageToken: string; } - - - /** - * tasks.tasks.delete - * @desc Deletes the specified task from the task list. - * @alias tasks.tasks.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.task Task identifier. - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['tasklist', 'task'], - pathParams: ['task', 'tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Tasks { + /** + * ETag of the resource. + */ + etag: string; + /** + * Collection of tasks. + */ + items: Schema$Task[]; + /** + * Type of the resource. This is always "tasks#tasks". + */ + kind: string; + /** + * Token used to access the next page of this result. + */ + nextPageToken: string; } - - /** - * tasks.tasks.get - * @desc Returns the specified task. - * @alias tasks.tasks.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.task Task identifier. - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tasklist', 'task'], - pathParams: ['task', 'tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasks.insert - * @desc Creates a new task on the specified task list. - * @alias tasks.tasks.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. - * @param {string=} params.previous Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. - * @param {string} params.tasklist Task list identifier. - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasks.list - * @desc Returns all tasks in the specified task list. - * @alias tasks.tasks.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. - * @param {string=} params.completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. - * @param {string=} params.dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. - * @param {string=} params.dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. - * @param {string=} params.maxResults Maximum number of task lists returned on one page. Optional. The default is 100. - * @param {string=} params.pageToken Token specifying the result page to return. Optional. - * @param {boolean=} params.showCompleted Flag indicating whether completed tasks are returned in the result. Optional. The default is True. - * @param {boolean=} params.showDeleted Flag indicating whether deleted tasks are returned in the result. Optional. The default is False. - * @param {boolean=} params.showHidden Flag indicating whether hidden tasks are returned in the result. Optional. The default is False. - * @param {string} params.tasklist Task list identifier. - * @param {string=} params.updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['tasklist'], - pathParams: ['tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasks.move - * @desc Moves the specified task to another position in the task list. This - * can include putting it as a child task under a new parent and/or move it to - * a different position among its sibling tasks. - * @alias tasks.tasks.move - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.parent New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional. - * @param {string=} params.previous New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional. - * @param {string} params.task Task identifier. - * @param {string} params.tasklist Task list identifier. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - move(params?: any, options?: MethodOptions): AxiosPromise; - move( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - move( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}/move') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['tasklist', 'task'], - pathParams: ['task', 'tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Tasklists { + root: Tasks; + constructor(root: Tasks) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tasks.tasklists.delete + * @desc Deletes the authenticated user's specified task list. + * @alias tasks.tasklists.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasklists.get + * @desc Returns the authenticated user's specified task list. + * @alias tasks.tasklists.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasklists.insert + * @desc Creates a new task list and adds it to the authenticated user's + * task lists. + * @alias tasks.tasklists.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().TaskList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasklists.list + * @desc Returns all the authenticated user's task lists. + * @alias tasks.tasklists.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.maxResults Maximum number of task lists returned on one page. Optional. The default is 100. + * @param {string=} params.pageToken Token specifying the result page to return. Optional. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasklists.patch + * @desc Updates the authenticated user's specified task list. This method + * supports patch semantics. + * @alias tasks.tasklists.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tasklist Task list identifier. + * @param {().TaskList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasklists.update + * @desc Updates the authenticated user's specified task list. + * @alias tasks.tasklists.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tasklist Task list identifier. + * @param {().TaskList} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/users/@me/lists/{tasklist}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - - /** - * tasks.tasks.patch - * @desc Updates the specified task. This method supports patch semantics. - * @alias tasks.tasks.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.task Task identifier. - * @param {string} params.tasklist Task list identifier. - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['tasklist', 'task'], - pathParams: ['task', 'tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * tasks.tasks.update - * @desc Updates the specified task. - * @alias tasks.tasks.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.task Task identifier. - * @param {string} params.tasklist Task list identifier. - * @param {().Task} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['tasklist', 'task'], - pathParams: ['task', 'tasklist'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Tasks { + root: Tasks; + constructor(root: Tasks) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * tasks.tasks.clear + * @desc Clears all completed tasks from the specified task list. The + * affected tasks will be marked as 'hidden' and no longer be returned by + * default when retrieving all tasks for a task list. + * @alias tasks.tasks.clear + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + clear(params?: any, options?: MethodOptions): AxiosPromise; + clear( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + clear( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/clear') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.delete + * @desc Deletes the specified task from the task list. + * @alias tasks.tasks.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.task Task identifier. + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['tasklist', 'task'], + pathParams: ['task', 'tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.get + * @desc Returns the specified task. + * @alias tasks.tasks.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.task Task identifier. + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tasklist', 'task'], + pathParams: ['task', 'tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.insert + * @desc Creates a new task on the specified task list. + * @alias tasks.tasks.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent Parent task identifier. If the task is created at the top level, this parameter is omitted. Optional. + * @param {string=} params.previous Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted. Optional. + * @param {string} params.tasklist Task list identifier. + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.list + * @desc Returns all tasks in the specified task list. + * @alias tasks.tasks.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.completedMax Upper bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. + * @param {string=} params.completedMin Lower bound for a task's completion date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by completion date. + * @param {string=} params.dueMax Upper bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. + * @param {string=} params.dueMin Lower bound for a task's due date (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by due date. + * @param {string=} params.maxResults Maximum number of task lists returned on one page. Optional. The default is 100. + * @param {string=} params.pageToken Token specifying the result page to return. Optional. + * @param {boolean=} params.showCompleted Flag indicating whether completed tasks are returned in the result. Optional. The default is True. + * @param {boolean=} params.showDeleted Flag indicating whether deleted tasks are returned in the result. Optional. The default is False. + * @param {boolean=} params.showHidden Flag indicating whether hidden tasks are returned in the result. Optional. The default is False. + * @param {string} params.tasklist Task list identifier. + * @param {string=} params.updatedMin Lower bound for a task's last modification time (as a RFC 3339 timestamp) to filter by. Optional. The default is not to filter by last modification time. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['tasklist'], + pathParams: ['tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.move + * @desc Moves the specified task to another position in the task list. This + * can include putting it as a child task under a new parent and/or move it + * to a different position among its sibling tasks. + * @alias tasks.tasks.move + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.parent New parent task identifier. If the task is moved to the top level, this parameter is omitted. Optional. + * @param {string=} params.previous New previous sibling task identifier. If the task is moved to the first position among its siblings, this parameter is omitted. Optional. + * @param {string} params.task Task identifier. + * @param {string} params.tasklist Task list identifier. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + move(params?: any, options?: MethodOptions): AxiosPromise; + move( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + move( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}/move') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['tasklist', 'task'], + pathParams: ['task', 'tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.patch + * @desc Updates the specified task. This method supports patch semantics. + * @alias tasks.tasks.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.task Task identifier. + * @param {string} params.tasklist Task list identifier. + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['tasklist', 'task'], + pathParams: ['task', 'tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * tasks.tasks.update + * @desc Updates the specified task. + * @alias tasks.tasks.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.task Task identifier. + * @param {string} params.tasklist Task list identifier. + * @param {().Task} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/tasks/v1/lists/{tasklist}/tasks/{task}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['tasklist', 'task'], + pathParams: ['task', 'tasklist'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/testing/v1.ts b/src/apis/testing/v1.ts index d751eea5da5..7b986bebe88 100644 --- a/src/apis/testing/v1.ts +++ b/src/apis/testing/v1.ts @@ -27,1415 +27,1424 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Testing API - * - * Allows developers to run automated tests for their mobile applications on - * Google infrastructure. - * - * @example - * const google = require('googleapis'); - * const testing = google.testing('v1'); - * - * @namespace testing - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Testing - */ -export class Testing { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace testing_v1 { + /** + * Cloud Testing API + * + * Allows developers to run automated tests for their mobile applications on + * Google infrastructure. + * + * @example + * const google = require('googleapis'); + * const testing = google.testing('v1'); + * + * @namespace testing + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Testing + */ + export class Testing { + _options: GlobalOptions; + google: GoogleApis; + root = this; - applicationDetailService: Resource$Applicationdetailservice; - projects: Resource$Projects; - testEnvironmentCatalog: Resource$Testenvironmentcatalog; + applicationDetailService: Resource$Applicationdetailservice; + projects: Resource$Projects; + testEnvironmentCatalog: Resource$Testenvironmentcatalog; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.applicationDetailService = new Resource$Applicationdetailservice(this); - this.projects = new Resource$Projects(this); - this.testEnvironmentCatalog = new Resource$Testenvironmentcatalog(this); - } + this.applicationDetailService = + new Resource$Applicationdetailservice(this); + this.projects = new Resource$Projects(this); + this.testEnvironmentCatalog = new Resource$Testenvironmentcatalog(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Identifies an account and how to log into it - */ -export interface Schema$Account { - /** - * An automatic google login account - */ - googleAuto: Schema$GoogleAuto; -} -/** - * A single Android device. - */ -export interface Schema$AndroidDevice { - /** - * The id of the Android device to be used. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - androidModelId: string; - /** - * The id of the Android OS version to be used. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - androidVersionId: string; - /** - * The locale the test device used for testing. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - locale: string; - /** - * How the device is oriented during the test. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - orientation: string; -} -/** - * The currently supported Android devices. - */ -export interface Schema$AndroidDeviceCatalog { - /** - * The set of supported Android device models. @OutputOnly - */ - models: Schema$AndroidModel[]; - /** - * The set of supported runtime configurations. @OutputOnly - */ - runtimeConfiguration: Schema$AndroidRuntimeConfiguration; - /** - * The set of supported Android OS versions. @OutputOnly - */ - versions: Schema$AndroidVersion[]; -} -/** - * A list of Android device configurations in which the test is to be executed. - */ -export interface Schema$AndroidDeviceList { - /** - * A list of Android devices Required - */ - androidDevices: Schema$AndroidDevice[]; -} -/** - * A test of an Android application that can control an Android component - * independently of its normal lifecycle. Android instrumentation tests run an - * application APK and test APK inside the same process on a virtual or physical - * AndroidDevice. They also specify a test runner class, such as - * com.google.GoogleTestRunner, which can vary on the specific instrumentation - * framework chosen. See - * <http://developer.android.com/tools/testing/testing_android.html> for - * more information on types of Android tests. - */ -export interface Schema$AndroidInstrumentationTest { - /** - * The APK for the application under test. Required - */ - appApk: Schema$FileReference; - /** - * The java package for the application under test. Optional, default is - * determined by examining the application's manifest. - */ - appPackageId: string; - /** - * The option of whether running each test within its own invocation of - * instrumentation with Android Test Orchestrator or not. ** Orchestrator is - * only compatible with AndroidJUnitRunner version 1.0 or higher! ** - * Orchestrator offers the following benefits: - No shared state - Crashes - * are isolated - Logs are scoped per test See - * <https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator> - * for more information about Android Test Orchestrator. Optional, if empty, - * test will be run without orchestrator. - */ - orchestratorOption: string; - /** - * The APK containing the test code to be executed. Required - */ - testApk: Schema$FileReference; - /** - * The java package for the test to be executed. Optional, default is - * determined by examining the application's manifest. - */ - testPackageId: string; - /** - * The InstrumentationTestRunner class. Optional, default is determined by - * examining the application's manifest. - */ - testRunnerClass: string; - /** - * Each target must be fully qualified with the package name or class name, in - * one of these formats: - "package package_name" - "class - * package_name.class_name" - "class - * package_name.class_name#method_name" Optional, if empty, all targets - * in the module will be run. - */ - testTargets: string[]; -} -/** - * A set of Android device configuration permutations is defined by the the - * cross-product of the given axes. Internally, the given AndroidMatrix will be - * expanded into a set of AndroidDevices. Only supported permutations will be - * instantiated. Invalid permutations (e.g., incompatible models/versions) are - * ignored. - */ -export interface Schema$AndroidMatrix { - /** - * The ids of the set of Android device to be used. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - androidModelIds: string[]; - /** - * The ids of the set of Android OS version to be used. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - androidVersionIds: string[]; - /** - * The set of locales the test device will enable for testing. Use the - * EnvironmentDiscoveryService to get supported options. Required - */ - locales: string[]; - /** - * The set of orientations to test with. Use the EnvironmentDiscoveryService - * to get supported options. Required - */ - orientations: string[]; -} -/** - * A description of an Android device tests may be run on. - */ -export interface Schema$AndroidModel { - /** - * The company that this device is branded with. Example: "Google", - * "Samsung" @OutputOnly - */ - brand: string; - /** - * The name of the industrial design. This corresponds to - * android.os.Build.DEVICE @OutputOnly - */ - codename: string; - /** - * Whether this device is virtual or physical. @OutputOnly - */ - form: string; - /** - * The unique opaque id for this model. Use this for invoking the - * TestExecutionService. @OutputOnly - */ - id: string; - /** - * The manufacturer of this device. @OutputOnly - */ - manufacturer: string; - /** - * The human-readable marketing name for this device model. Examples: - * "Nexus 5", "Galaxy S5" @OutputOnly - */ - name: string; - /** - * Screen density in DPI. This corresponds to ro.sf.lcd_density @OutputOnly - */ - screenDensity: number; - /** - * Screen size in the horizontal (X) dimension measured in pixels. @OutputOnly - */ - screenX: number; - /** - * Screen size in the vertical (Y) dimension measured in pixels. @OutputOnly - */ - screenY: number; - /** - * The list of supported ABIs for this device. This corresponds to either - * android.os.Build.SUPPORTED_ABIS (for API level 21 and above) or - * android.os.Build.CPU_ABI/CPU_ABI2. The most preferred ABI is the first - * element in the list. Elements are optionally prefixed by - * "version_id:" (where version_id is the id of an AndroidVersion), - * denoting an ABI that is supported only on a particular version. @OutputOnly - */ - supportedAbis: string[]; - /** - * The set of Android versions this device supports. @OutputOnly - */ - supportedVersionIds: string[]; - /** - * Tags for this dimension. Examples: "default", - * "preview", "deprecated" - */ - tags: string[]; - /** - * True if and only if tests with this model DO NOT have video output. See - * also TestSpecification.disable_video_recording @OutputOnly - */ - videoRecordingNotSupported: boolean; -} -/** - * A test of an android application that explores the application on a virtual - * or physical Android Device, finding culprits and crashes as it goes. - */ -export interface Schema$AndroidRoboTest { - /** - * The APK for the application under test. Required - */ - appApk: Schema$FileReference; - /** - * The initial activity that should be used to start the app. Optional - */ - appInitialActivity: string; - /** - * The java package for the application under test. Optional, default is - * determined by examining the application's manifest. - */ - appPackageId: string; - /** - * The max depth of the traversal stack Robo can explore. Needs to be at least - * 2 to make Robo explore the app beyond the first activity. Default is 50. - * Optional - */ - maxDepth: number; - /** - * The max number of steps Robo can execute. Default is no limit. Optional - */ - maxSteps: number; - /** - * A set of directives Robo should apply during the crawl. This allows users - * to customize the crawl. For example, the username and password for a test - * account can be provided. Optional - */ - roboDirectives: Schema$RoboDirective[]; - /** - * A JSON file with a sequence of actions Robo should perform as a prologue - * for the crawl. Optional - */ - roboScript: Schema$FileReference; - /** - * The intents used to launch the app for the crawl. If none are provided, - * then the main launcher activity is launched. If some are provided, then - * only those provided are launched (the main launcher activity must be - * provided explicitly). - */ - startingIntents: Schema$RoboStartingIntent[]; -} -/** - * Configuration that can be selected at the time a test is run. - */ -export interface Schema$AndroidRuntimeConfiguration { - /** - * The set of available locales. @OutputOnly - */ - locales: Schema$Locale[]; - /** - * The set of available orientations. @OutputOnly - */ - orientations: Schema$Orientation[]; -} -/** - * A test of an Android Application with a Test Loop. The intent - * <intent-name> will be implicitly added, since Games is the only user of - * this api, for the time being. - */ -export interface Schema$AndroidTestLoop { - /** - * The APK for the application under test. Required - */ - appApk: Schema$FileReference; - /** - * The java package for the application under test. Optional, default is - * determined by examining the application's manifest. - */ - appPackageId: string; - /** - * The list of scenario labels that should be run during the test. The - * scenario labels should map to labels defined in the application's - * manifest. For example, player_experience and - * com.google.test.loops.player_experience add all of the loops labeled in the - * manifest with the com.google.test.loops.player_experience name to the - * execution. Optional. Scenarios can also be specified in the scenarios - * field. - */ - scenarioLabels: string[]; - /** - * The list of scenarios that should be run during the test. Optional, default - * is all test loops, derived from the application's manifest. - */ - scenarios: number[]; -} -/** - * A version of the Android OS - */ -export interface Schema$AndroidVersion { - /** - * The API level for this Android version. Examples: 18, 19 @OutputOnly - */ - apiLevel: number; - /** - * The code name for this Android version. Examples: "JellyBean", - * "KitKat" @OutputOnly - */ - codeName: string; - /** - * Market share for this version. @OutputOnly - */ - distribution: Schema$Distribution; - /** - * An opaque id for this Android version. Use this id to invoke the - * TestExecutionService. @OutputOnly - */ - id: string; - /** - * The date this Android version became available in the market. @OutputOnly - */ - releaseDate: Schema$Date; - /** - * Tags for this dimension. Examples: "default", - * "preview", "deprecated" - */ - tags: string[]; - /** - * A string representing this version of the Android OS. Examples: - * "4.3", "4.4" @OutputOnly - */ - versionString: string; -} -/** - * An Android package file to install. - */ -export interface Schema$Apk { - /** - * The path to an APK to be installed on the device before the test begins. - * Optional - */ - location: Schema$FileReference; - /** - * The java package for the APK to be installed. Optional, value is determined - * by examining the application's manifest. - */ - packageName: string; -} -/** - * Android application details based on application manifest and apk archive - * contents - */ -export interface Schema$ApkDetail { apkManifest: Schema$ApkManifest; } -/** - * An Android app manifest. See - * http://developer.android.com/guide/topics/manifest/manifest-intro.html - */ -export interface Schema$ApkManifest { - /** - * User-readable name for the application. - */ - applicationLabel: string; - intentFilters: Schema$IntentFilter[]; - /** - * Maximum API level on which the application is designed to run. - */ - maxSdkVersion: number; - /** - * Minimum API level required for the application to run. - */ - minSdkVersion: number; - /** - * Full Java-style package name for this application, e.g. - * "com.example.foo". - */ - packageName: string; -} -/** - * Response containing the current state of the specified test matrix. - */ -export interface Schema$CancelTestMatrixResponse { - /** - * The current rolled-up state of the test matrix. If this state is already - * final, then the cancelation request will have no effect. - */ - testState: string; -} -/** - * Information about the client which invoked the test. - */ -export interface Schema$ClientInfo { - /** - * The list of detailed information about client. - */ - clientInfoDetails: Schema$ClientInfoDetail[]; - /** - * Client name, such as gcloud. Required - */ - name: string; -} -/** - * Key-value pair of detailed information about the client which invoked the - * test. For example {'Version', '1.0'}, {'Release - * Track', 'BETA'} - */ -export interface Schema$ClientInfoDetail { - /** - * The key of detailed client information. Required - */ - key: string; - /** - * The value of detailed client information. Required - */ - value: string; -} -/** - * Represents a whole calendar date, e.g. date of birth. The time of day and - * time zone are either specified elsewhere or are not significant. The date is - * relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a - * year and month where the day is not significant, e.g. credit card expiration - * date. The year may be 0 to represent a month and day independent of year, - * e.g. anniversary date. Related types are google.type.TimeOfDay and - * `google.protobuf.Timestamp`. - */ -export interface Schema$Date { - /** - * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 - * if specifying a year/month where the day is not significant. - */ - day: number; - /** - * Month of year. Must be from 1 to 12, or 0 if specifying a date without a - * month. - */ - month: number; - /** - * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a - * year. - */ - year: number; -} -/** - * A single device file description. - */ -export interface Schema$DeviceFile { - /** - * A reference to an opaque binary blob file - */ - obbFile: Schema$ObbFile; - /** - * A reference to a regular file - */ - regularFile: Schema$RegularFile; -} -/** - * Data about the relative number of devices running a given configuration of - * the Android platform. - */ -export interface Schema$Distribution { - /** - * The estimated fraction (0-1) of the total market with this configuration. - * @OutputOnly - */ - marketShare: number; - /** - * The time this distribution was measured. @OutputOnly - */ - measurementTime: string; -} -/** - * The environment in which the test is run. - */ -export interface Schema$Environment { - /** - * An Android device which must be used with an Android test. - */ - androidDevice: Schema$AndroidDevice; -} -/** - * The matrix of environments in which the test is to be executed. - */ -export interface Schema$EnvironmentMatrix { - /** - * A list of Android devices; the test will be run only on the specified - * devices. - */ - androidDeviceList: Schema$AndroidDeviceList; - /** - * A matrix of Android devices. - */ - androidMatrix: Schema$AndroidMatrix; -} -/** - * A key-value pair passed as an environment variable to the test - */ -export interface Schema$EnvironmentVariable { - /** - * Key for the environment variable - */ - key: string; - /** - * Value for the environment variable - */ - value: string; -} -/** - * A reference to a file, used for user inputs. - */ -export interface Schema$FileReference { - /** - * A path to a file in Google Cloud Storage. Example: - * gs://build-app-1414623860166/app-debug-unaligned.apk - */ - gcsPath: string; -} -/** - * Response containing the details of the specified Android application APK. - */ -export interface Schema$GetApkDetailsResponse { - /** - * Details of the Android APK. - */ - apkDetail: Schema$ApkDetail; -} -/** - * Enables automatic Google account login. If set, the service will - * automatically generate a Google test account and add it to the device, before - * executing the test. Note that test accounts might be reused. Many - * applications show their full set of functionalities when an account is - * present on the device. Logging into the device with these generated accounts - * allows testing more functionalities. - */ -export interface Schema$GoogleAuto {} -/** - * A storage location within Google cloud storage (GCS). - */ -export interface Schema$GoogleCloudStorage { - /** - * The path to a directory in GCS that will eventually contain the results for - * this test. The requesting user must have write access on the bucket in the - * supplied path. Required - */ - gcsPath: string; -} -/** - * The <intent-filter> section of an <activity> tag. - * https://developer.android.com/guide/topics/manifest/intent-filter-element.html - */ -export interface Schema$IntentFilter { /** - * The android:name value of the <action> tag + * Identifies an account and how to log into it */ - actionNames: string[]; - /** - * The android:name value of the <category> tag - */ - categoryNames: string[]; - /** - * The android:mimeType value of the <data> tag - */ - mimeType: string; -} -/** - * Specifies an intent that starts the main launcher activity. - */ -export interface Schema$LauncherActivityIntent {} -/** - * A location/region designation for language. - */ -export interface Schema$Locale { - /** - * The id for this locale. Example: "en_US" @OutputOnly - */ - id: string; - /** - * A human-friendly name for this language/locale. Example: - * "English" @OutputOnly - */ - name: string; - /** - * A human-friendly string representing the region for this locale. Example: - * "United States" Not present for every locale. @OutputOnly - */ - region: string; - /** - * Tags for this dimension. Examples: "default" - */ - tags: string[]; -} -export interface Schema$NetworkConfiguration { - /** - * The emulation rule applying to the download traffic - */ - downRule: Schema$TrafficRule; - /** - * The unique opaque id for this network traffic configuration @OutputOnly - */ - id: string; - /** - * The emulation rule applying to the upload traffic - */ - upRule: Schema$TrafficRule; -} -export interface Schema$NetworkConfigurationCatalog { - configurations: Schema$NetworkConfiguration[]; -} -/** - * An opaque binary blob file to install on the device before the test starts - */ -export interface Schema$ObbFile { - /** - * Opaque Binary Blob (OBB) file(s) to install on the device Required - */ - obb: Schema$FileReference; - /** - * OBB file name which must conform to the format as specified by Android e.g. - * [main|patch].0300110.com.example.android.obb which will be installed into - * <shared-storage>/Android/obb/<package-name>/ on the device - * Required - */ - obbFileName: string; -} -/** - * Screen orientation of the device. - */ -export interface Schema$Orientation { - /** - * The id for this orientation. Example: "portrait" @OutputOnly - */ - id: string; - /** - * A human-friendly name for this orientation. Example: "portrait" - * @OutputOnly - */ - name: string; - /** - * Tags for this dimension. Examples: "default" - */ - tags: string[]; -} -/** - * A file or directory to install on the device before the test starts - */ -export interface Schema$RegularFile { - /** - * Required - */ - content: Schema$FileReference; - /** - * Where to put the content on the device. Must be an absolute, whitelisted - * path. If the file exists, it will be replaced. The following device-side - * directories and any of their subdirectories are whitelisted: - * <p>${EXTERNAL_STORAGE}, or /sdcard</p> - * <p>${ANDROID_DATA}/local/tmp, or /data/local/tmp</p> - * <p>Specifying a path outside of these directory trees is invalid. - * <p> The paths /sdcard and /data will be made available and treated as - * implicit path substitutions. E.g. if /sdcard on a particular device does - * not map to external storage, the system will replace it with the external - * storage path prefix for that device and copy the file there. <p> It - * is strongly advised to use the <a href= - * "http://developer.android.com/reference/android/os/Environment.html"> - * Environment API</a> in app and test code to access files on the - * device in a portable way. Required - */ - devicePath: string; -} -/** - * Locations where the results of running the test are stored. - */ -export interface Schema$ResultStorage { - /** - * Required. - */ - googleCloudStorage: Schema$GoogleCloudStorage; - /** - * The tool results execution that results are written to. @OutputOnly - */ - toolResultsExecution: Schema$ToolResultsExecution; - /** - * The tool results history that contains the tool results execution that - * results are written to. Optional, if not provided the service will choose - * an appropriate value. - */ - toolResultsHistory: Schema$ToolResultsHistory; -} -/** - * Directs Robo to interact with a specific UI element if it is encountered - * during the crawl. Currently, Robo can perform text entry or element click. - */ -export interface Schema$RoboDirective { - /** - * The type of action that Robo should perform on the specified element. - * Required. - */ - actionType: string; - /** - * The text that Robo is directed to set. If left empty, the directive will be - * treated as a CLICK on the element matching the resource_name. Optional - */ - inputText: string; - /** - * The android resource name of the target UI element For example, in Java: - * R.string.foo in xml: @string/foo Only the “foo” part is needed. - * Reference doc: - * https://developer.android.com/guide/topics/resources/accessing-resources.html - * Required - */ - resourceName: string; -} -/** - * Message for specifying the start activities to crawl - */ -export interface Schema$RoboStartingIntent { - launcherActivity: Schema$LauncherActivityIntent; - startActivity: Schema$StartActivityIntent; -} -/** - * A starting intent specified by an action, uri, and categories. - */ -export interface Schema$StartActivityIntent { - /** - * Action name. Required for START_ACTIVITY. - */ - action: string; - /** - * Intent categories to set on the intent. Optional. - */ - categories: string[]; - /** - * URI for the action. Optional. - */ - uri: string; -} -/** - * Additional details about the progress of the running test. - */ -export interface Schema$TestDetails { - /** - * If the TestState is ERROR, then this string will contain human-readable - * details about the error. @OutputOnly - */ - errorMessage: string; - /** - * Human-readable, detailed descriptions of the test's progress. For - * example: "Provisioning a device", "Starting Test". - * During the course of execution new data may be appended to the end of - * progress_messages. @OutputOnly - */ - progressMessages: string[]; - /** - * Indicates that video will not be recorded for this execution either because - * the user chose to disable it or the device does not support it. See - * AndroidModel.video_recording_not_supported @OutputOnly - */ - videoRecordingDisabled: boolean; -} -/** - * A description of a test environment. - */ -export interface Schema$TestEnvironmentCatalog { - /** - * Android devices suitable for running Android Instrumentation Tests. - */ - androidDeviceCatalog: Schema$AndroidDeviceCatalog; - /** - * Supported network configurations - */ - networkConfigurationCatalog: Schema$NetworkConfigurationCatalog; -} -/** - * Specifies a single test to be executed in a single environment. - */ -export interface Schema$TestExecution { - /** - * How the host machine(s) are configured. @OutputOnly - */ - environment: Schema$Environment; - /** - * Unique id set by the backend. @OutputOnly - */ - id: string; - /** - * Id of the containing TestMatrix. @OutputOnly - */ - matrixId: string; - /** - * The cloud project that owns the test execution. @OutputOnly - */ - projectId: string; - /** - * Indicates the current progress of the test execution (e.g., FINISHED). - * @OutputOnly - */ - state: string; + export interface Schema$Account { + /** + * An automatic google login account + */ + googleAuto: Schema$GoogleAuto; + } /** - * Additional details about the running test. @OutputOnly - */ - testDetails: Schema$TestDetails; + * A single Android device. + */ + export interface Schema$AndroidDevice { + /** + * The id of the Android device to be used. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + androidModelId: string; + /** + * The id of the Android OS version to be used. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + androidVersionId: string; + /** + * The locale the test device used for testing. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + locale: string; + /** + * How the device is oriented during the test. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + orientation: string; + } /** - * How to run the test. @OutputOnly - */ - testSpecification: Schema$TestSpecification; + * The currently supported Android devices. + */ + export interface Schema$AndroidDeviceCatalog { + /** + * The set of supported Android device models. @OutputOnly + */ + models: Schema$AndroidModel[]; + /** + * The set of supported runtime configurations. @OutputOnly + */ + runtimeConfiguration: Schema$AndroidRuntimeConfiguration; + /** + * The set of supported Android OS versions. @OutputOnly + */ + versions: Schema$AndroidVersion[]; + } /** - * The time this test execution was initially created. @OutputOnly + * A list of Android device configurations in which the test is to be + * executed. */ - timestamp: string; + export interface Schema$AndroidDeviceList { + /** + * A list of Android devices Required + */ + androidDevices: Schema$AndroidDevice[]; + } /** - * Where the results for this execution are written. @OutputOnly - */ - toolResultsStep: Schema$ToolResultsStep; -} -/** - * A group of one or more TestExecutions, built by taking a product of values - * over a pre-defined set of axes. - */ -export interface Schema$TestMatrix { + * A test of an Android application that can control an Android component + * independently of its normal lifecycle. Android instrumentation tests run an + * application APK and test APK inside the same process on a virtual or + * physical AndroidDevice. They also specify a test runner class, such as + * com.google.GoogleTestRunner, which can vary on the specific instrumentation + * framework chosen. See + * <http://developer.android.com/tools/testing/testing_android.html> for + * more information on types of Android tests. + */ + export interface Schema$AndroidInstrumentationTest { + /** + * The APK for the application under test. Required + */ + appApk: Schema$FileReference; + /** + * The java package for the application under test. Optional, default is + * determined by examining the application's manifest. + */ + appPackageId: string; + /** + * The option of whether running each test within its own invocation of + * instrumentation with Android Test Orchestrator or not. ** Orchestrator is + * only compatible with AndroidJUnitRunner version 1.0 or higher! ** + * Orchestrator offers the following benefits: - No shared state - Crashes + * are isolated - Logs are scoped per test See + * <https://developer.android.com/training/testing/junit-runner.html#using-android-test-orchestrator> + * for more information about Android Test Orchestrator. Optional, if + * empty, test will be run without orchestrator. + */ + orchestratorOption: string; + /** + * The APK containing the test code to be executed. Required + */ + testApk: Schema$FileReference; + /** + * The java package for the test to be executed. Optional, default is + * determined by examining the application's manifest. + */ + testPackageId: string; + /** + * The InstrumentationTestRunner class. Optional, default is determined by + * examining the application's manifest. + */ + testRunnerClass: string; + /** + * Each target must be fully qualified with the package name or class name, + * in one of these formats: - "package package_name" - + * "class package_name.class_name" - "class + * package_name.class_name#method_name" Optional, if empty, all + * targets in the module will be run. + */ + testTargets: string[]; + } /** - * Information about the client which invoked the test. Optional - */ - clientInfo: Schema$ClientInfo; + * A set of Android device configuration permutations is defined by the the + * cross-product of the given axes. Internally, the given AndroidMatrix will + * be expanded into a set of AndroidDevices. Only supported permutations will + * be instantiated. Invalid permutations (e.g., incompatible models/versions) + * are ignored. + */ + export interface Schema$AndroidMatrix { + /** + * The ids of the set of Android device to be used. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + androidModelIds: string[]; + /** + * The ids of the set of Android OS version to be used. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + androidVersionIds: string[]; + /** + * The set of locales the test device will enable for testing. Use the + * EnvironmentDiscoveryService to get supported options. Required + */ + locales: string[]; + /** + * The set of orientations to test with. Use the EnvironmentDiscoveryService + * to get supported options. Required + */ + orientations: string[]; + } /** - * How the host machine(s) are configured. Required - */ - environmentMatrix: Schema$EnvironmentMatrix; + * A description of an Android device tests may be run on. + */ + export interface Schema$AndroidModel { + /** + * The company that this device is branded with. Example: + * "Google", "Samsung" @OutputOnly + */ + brand: string; + /** + * The name of the industrial design. This corresponds to + * android.os.Build.DEVICE @OutputOnly + */ + codename: string; + /** + * Whether this device is virtual or physical. @OutputOnly + */ + form: string; + /** + * The unique opaque id for this model. Use this for invoking the + * TestExecutionService. @OutputOnly + */ + id: string; + /** + * The manufacturer of this device. @OutputOnly + */ + manufacturer: string; + /** + * The human-readable marketing name for this device model. Examples: + * "Nexus 5", "Galaxy S5" @OutputOnly + */ + name: string; + /** + * Screen density in DPI. This corresponds to ro.sf.lcd_density @OutputOnly + */ + screenDensity: number; + /** + * Screen size in the horizontal (X) dimension measured in pixels. + * @OutputOnly + */ + screenX: number; + /** + * Screen size in the vertical (Y) dimension measured in pixels. @OutputOnly + */ + screenY: number; + /** + * The list of supported ABIs for this device. This corresponds to either + * android.os.Build.SUPPORTED_ABIS (for API level 21 and above) or + * android.os.Build.CPU_ABI/CPU_ABI2. The most preferred ABI is the first + * element in the list. Elements are optionally prefixed by + * "version_id:" (where version_id is the id of an + * AndroidVersion), denoting an ABI that is supported only on a particular + * version. @OutputOnly + */ + supportedAbis: string[]; + /** + * The set of Android versions this device supports. @OutputOnly + */ + supportedVersionIds: string[]; + /** + * Tags for this dimension. Examples: "default", + * "preview", "deprecated" + */ + tags: string[]; + /** + * True if and only if tests with this model DO NOT have video output. See + * also TestSpecification.disable_video_recording @OutputOnly + */ + videoRecordingNotSupported: boolean; + } /** - * Describes why the matrix is considered invalid. Only useful for matrices in - * the INVALID state. @OutputOnly - */ - invalidMatrixDetails: string; + * A test of an android application that explores the application on a virtual + * or physical Android Device, finding culprits and crashes as it goes. + */ + export interface Schema$AndroidRoboTest { + /** + * The APK for the application under test. Required + */ + appApk: Schema$FileReference; + /** + * The initial activity that should be used to start the app. Optional + */ + appInitialActivity: string; + /** + * The java package for the application under test. Optional, default is + * determined by examining the application's manifest. + */ + appPackageId: string; + /** + * The max depth of the traversal stack Robo can explore. Needs to be at + * least 2 to make Robo explore the app beyond the first activity. Default + * is 50. Optional + */ + maxDepth: number; + /** + * The max number of steps Robo can execute. Default is no limit. Optional + */ + maxSteps: number; + /** + * A set of directives Robo should apply during the crawl. This allows users + * to customize the crawl. For example, the username and password for a test + * account can be provided. Optional + */ + roboDirectives: Schema$RoboDirective[]; + /** + * A JSON file with a sequence of actions Robo should perform as a prologue + * for the crawl. Optional + */ + roboScript: Schema$FileReference; + /** + * The intents used to launch the app for the crawl. If none are provided, + * then the main launcher activity is launched. If some are provided, then + * only those provided are launched (the main launcher activity must be + * provided explicitly). + */ + startingIntents: Schema$RoboStartingIntent[]; + } /** - * The cloud project that owns the test matrix. @OutputOnly - */ - projectId: string; + * Configuration that can be selected at the time a test is run. + */ + export interface Schema$AndroidRuntimeConfiguration { + /** + * The set of available locales. @OutputOnly + */ + locales: Schema$Locale[]; + /** + * The set of available orientations. @OutputOnly + */ + orientations: Schema$Orientation[]; + } /** - * Where the results for the matrix are written. Required - */ - resultStorage: Schema$ResultStorage; + * A test of an Android Application with a Test Loop. The intent + * <intent-name> will be implicitly added, since Games is the only user + * of this api, for the time being. + */ + export interface Schema$AndroidTestLoop { + /** + * The APK for the application under test. Required + */ + appApk: Schema$FileReference; + /** + * The java package for the application under test. Optional, default is + * determined by examining the application's manifest. + */ + appPackageId: string; + /** + * The list of scenario labels that should be run during the test. The + * scenario labels should map to labels defined in the application's + * manifest. For example, player_experience and + * com.google.test.loops.player_experience add all of the loops labeled in + * the manifest with the com.google.test.loops.player_experience name to the + * execution. Optional. Scenarios can also be specified in the scenarios + * field. + */ + scenarioLabels: string[]; + /** + * The list of scenarios that should be run during the test. Optional, + * default is all test loops, derived from the application's manifest. + */ + scenarios: number[]; + } /** - * Indicates the current progress of the test matrix (e.g., FINISHED) - * @OutputOnly - */ - state: string; + * A version of the Android OS + */ + export interface Schema$AndroidVersion { + /** + * The API level for this Android version. Examples: 18, 19 @OutputOnly + */ + apiLevel: number; + /** + * The code name for this Android version. Examples: "JellyBean", + * "KitKat" @OutputOnly + */ + codeName: string; + /** + * Market share for this version. @OutputOnly + */ + distribution: Schema$Distribution; + /** + * An opaque id for this Android version. Use this id to invoke the + * TestExecutionService. @OutputOnly + */ + id: string; + /** + * The date this Android version became available in the market. @OutputOnly + */ + releaseDate: Schema$Date; + /** + * Tags for this dimension. Examples: "default", + * "preview", "deprecated" + */ + tags: string[]; + /** + * A string representing this version of the Android OS. Examples: + * "4.3", "4.4" @OutputOnly + */ + versionString: string; + } /** - * The list of test executions that the service creates for this matrix. - * @OutputOnly - */ - testExecutions: Schema$TestExecution[]; + * An Android package file to install. + */ + export interface Schema$Apk { + /** + * The path to an APK to be installed on the device before the test begins. + * Optional + */ + location: Schema$FileReference; + /** + * The java package for the APK to be installed. Optional, value is + * determined by examining the application's manifest. + */ + packageName: string; + } /** - * Unique id set by the service. @OutputOnly - */ - testMatrixId: string; + * Android application details based on application manifest and apk archive + * contents + */ + export interface Schema$ApkDetail { apkManifest: Schema$ApkManifest; } + /** + * An Android app manifest. See + * http://developer.android.com/guide/topics/manifest/manifest-intro.html + */ + export interface Schema$ApkManifest { + /** + * User-readable name for the application. + */ + applicationLabel: string; + intentFilters: Schema$IntentFilter[]; + /** + * Maximum API level on which the application is designed to run. + */ + maxSdkVersion: number; + /** + * Minimum API level required for the application to run. + */ + minSdkVersion: number; + /** + * Full Java-style package name for this application, e.g. + * "com.example.foo". + */ + packageName: string; + } /** - * How to run the test. Required + * Response containing the current state of the specified test matrix. */ - testSpecification: Schema$TestSpecification; + export interface Schema$CancelTestMatrixResponse { + /** + * The current rolled-up state of the test matrix. If this state is already + * final, then the cancelation request will have no effect. + */ + testState: string; + } /** - * The time this test matrix was initially created. @OutputOnly - */ - timestamp: string; -} -/** - * A description of how to set up the Android device prior to running the test. - */ -export interface Schema$TestSetup { + * Information about the client which invoked the test. + */ + export interface Schema$ClientInfo { + /** + * The list of detailed information about client. + */ + clientInfoDetails: Schema$ClientInfoDetail[]; + /** + * Client name, such as gcloud. Required + */ + name: string; + } /** - * The device will be logged in on this account for the duration of the test. - * Optional - */ - account: Schema$Account; + * Key-value pair of detailed information about the client which invoked the + * test. For example {'Version', '1.0'}, {'Release + * Track', 'BETA'} + */ + export interface Schema$ClientInfoDetail { + /** + * The key of detailed client information. Required + */ + key: string; + /** + * The value of detailed client information. Required + */ + value: string; + } /** - * APKs to install in addition to those being directly tested. Currently - * capped at 100. Optional - */ - additionalApks: Schema$Apk[]; + * Represents a whole calendar date, e.g. date of birth. The time of day and + * time zone are either specified elsewhere or are not significant. The date + * is relative to the Proleptic Gregorian Calendar. The day may be 0 to + * represent a year and month where the day is not significant, e.g. credit + * card expiration date. The year may be 0 to represent a month and day + * independent of year, e.g. anniversary date. Related types are + * google.type.TimeOfDay and `google.protobuf.Timestamp`. + */ + export interface Schema$Date { + /** + * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + * if specifying a year/month where the day is not significant. + */ + day: number; + /** + * Month of year. Must be from 1 to 12, or 0 if specifying a date without a + * month. + */ + month: number; + /** + * Year of date. Must be from 1 to 9999, or 0 if specifying a date without a + * year. + */ + year: number; + } /** - * List of directories on the device to upload to GCS at the end of the test; - * they must be absolute paths under /sdcard or /data/local/tmp. Path names - * are restricted to characters a-z A-Z 0-9 _ - . + and / Note: The paths - * /sdcard and /data will be made available and treated as implicit path - * substitutions. E.g. if /sdcard on a particular device does not map to - * external storage, the system will replace it with the external storage path - * prefix for that device. Optional - */ - directoriesToPull: string[]; + * A single device file description. + */ + export interface Schema$DeviceFile { + /** + * A reference to an opaque binary blob file + */ + obbFile: Schema$ObbFile; + /** + * A reference to a regular file + */ + regularFile: Schema$RegularFile; + } /** - * Environment variables to set for the test (only applicable for - * instrumentation tests). - */ - environmentVariables: Schema$EnvironmentVariable[]; + * Data about the relative number of devices running a given configuration of + * the Android platform. + */ + export interface Schema$Distribution { + /** + * The estimated fraction (0-1) of the total market with this configuration. + * @OutputOnly + */ + marketShare: number; + /** + * The time this distribution was measured. @OutputOnly + */ + measurementTime: string; + } /** - * List of files to push to the device before starting the test. Optional + * The environment in which the test is run. */ - filesToPush: Schema$DeviceFile[]; + export interface Schema$Environment { + /** + * An Android device which must be used with an Android test. + */ + androidDevice: Schema$AndroidDevice; + } /** - * The network traffic profile used for running the test. Optional - */ - networkProfile: string; -} -/** - * A description of how to run the test. - */ -export interface Schema$TestSpecification { + * The matrix of environments in which the test is to be executed. + */ + export interface Schema$EnvironmentMatrix { + /** + * A list of Android devices; the test will be run only on the specified + * devices. + */ + androidDeviceList: Schema$AndroidDeviceList; + /** + * A matrix of Android devices. + */ + androidMatrix: Schema$AndroidMatrix; + } /** - * An Android instrumentation test. - */ - androidInstrumentationTest: Schema$AndroidInstrumentationTest; + * A key-value pair passed as an environment variable to the test + */ + export interface Schema$EnvironmentVariable { + /** + * Key for the environment variable + */ + key: string; + /** + * Value for the environment variable + */ + value: string; + } /** - * An Android robo test. + * A reference to a file, used for user inputs. */ - androidRoboTest: Schema$AndroidRoboTest; + export interface Schema$FileReference { + /** + * A path to a file in Google Cloud Storage. Example: + * gs://build-app-1414623860166/app-debug-unaligned.apk + */ + gcsPath: string; + } /** - * An Android Application with a Test Loop + * Response containing the details of the specified Android application APK. */ - androidTestLoop: Schema$AndroidTestLoop; + export interface Schema$GetApkDetailsResponse { + /** + * Details of the Android APK. + */ + apkDetail: Schema$ApkDetail; + } /** * Enables automatic Google account login. If set, the service will * automatically generate a Google test account and add it to the device, * before executing the test. Note that test accounts might be reused. Many * applications show their full set of functionalities when an account is * present on the device. Logging into the device with these generated - * accounts allows testing more functionalities. Default is false. Optional - */ - autoGoogleLogin: boolean; - /** - * Disables performance metrics recording; may reduce test latency. + * accounts allows testing more functionalities. */ - disablePerformanceMetrics: boolean; + export interface Schema$GoogleAuto {} /** - * Disables video recording; may reduce test latency. + * A storage location within Google cloud storage (GCS). */ - disableVideoRecording: boolean; + export interface Schema$GoogleCloudStorage { + /** + * The path to a directory in GCS that will eventually contain the results + * for this test. The requesting user must have write access on the bucket + * in the supplied path. Required + */ + gcsPath: string; + } /** - * Test setup requirements for Android e.g. files to install, bootstrap - * scripts. Optional - */ - testSetup: Schema$TestSetup; + * The <intent-filter> section of an <activity> tag. + * https://developer.android.com/guide/topics/manifest/intent-filter-element.html + */ + export interface Schema$IntentFilter { + /** + * The android:name value of the <action> tag + */ + actionNames: string[]; + /** + * The android:name value of the <category> tag + */ + categoryNames: string[]; + /** + * The android:mimeType value of the <data> tag + */ + mimeType: string; + } /** - * Max time a test execution is allowed to run before it is automatically - * cancelled. Optional, default is 5 min. - */ - testTimeout: string; -} -/** - * Represents a tool results execution resource. This has the results of a - * TestMatrix. - */ -export interface Schema$ToolResultsExecution { + * Specifies an intent that starts the main launcher activity. + */ + export interface Schema$LauncherActivityIntent {} + /** + * A location/region designation for language. + */ + export interface Schema$Locale { + /** + * The id for this locale. Example: "en_US" @OutputOnly + */ + id: string; + /** + * A human-friendly name for this language/locale. Example: + * "English" @OutputOnly + */ + name: string; + /** + * A human-friendly string representing the region for this locale. Example: + * "United States" Not present for every locale. @OutputOnly + */ + region: string; + /** + * Tags for this dimension. Examples: "default" + */ + tags: string[]; + } + export interface Schema$NetworkConfiguration { + /** + * The emulation rule applying to the download traffic + */ + downRule: Schema$TrafficRule; + /** + * The unique opaque id for this network traffic configuration @OutputOnly + */ + id: string; + /** + * The emulation rule applying to the upload traffic + */ + upRule: Schema$TrafficRule; + } + export interface Schema$NetworkConfigurationCatalog { + configurations: Schema$NetworkConfiguration[]; + } /** - * A tool results execution ID. @OutputOnly - */ - executionId: string; + * An opaque binary blob file to install on the device before the test starts + */ + export interface Schema$ObbFile { + /** + * Opaque Binary Blob (OBB) file(s) to install on the device Required + */ + obb: Schema$FileReference; + /** + * OBB file name which must conform to the format as specified by Android + * e.g. [main|patch].0300110.com.example.android.obb which will be installed + * into <shared-storage>/Android/obb/<package-name>/ on the + * device Required + */ + obbFileName: string; + } /** - * A tool results history ID. @OutputOnly - */ - historyId: string; + * Screen orientation of the device. + */ + export interface Schema$Orientation { + /** + * The id for this orientation. Example: "portrait" @OutputOnly + */ + id: string; + /** + * A human-friendly name for this orientation. Example: "portrait" + * @OutputOnly + */ + name: string; + /** + * Tags for this dimension. Examples: "default" + */ + tags: string[]; + } /** - * The cloud project that owns the tool results execution. @OutputOnly - */ - projectId: string; -} -/** - * Represents a tool results history resource. - */ -export interface Schema$ToolResultsHistory { + * A file or directory to install on the device before the test starts + */ + export interface Schema$RegularFile { + /** + * Required + */ + content: Schema$FileReference; + /** + * Where to put the content on the device. Must be an absolute, whitelisted + * path. If the file exists, it will be replaced. The following device-side + * directories and any of their subdirectories are whitelisted: + * <p>${EXTERNAL_STORAGE}, or /sdcard</p> + * <p>${ANDROID_DATA}/local/tmp, or /data/local/tmp</p> + * <p>Specifying a path outside of these directory trees is invalid. + * <p> The paths /sdcard and /data will be made available and treated + * as implicit path substitutions. E.g. if /sdcard on a particular device + * does not map to external storage, the system will replace it with the + * external storage path prefix for that device and copy the file there. + * <p> It is strongly advised to use the <a href= + * "http://developer.android.com/reference/android/os/Environment.html"> + * Environment API</a> in app and test code to access files on the + * device in a portable way. Required + */ + devicePath: string; + } /** - * A tool results history ID. Required - */ - historyId: string; + * Locations where the results of running the test are stored. + */ + export interface Schema$ResultStorage { + /** + * Required. + */ + googleCloudStorage: Schema$GoogleCloudStorage; + /** + * The tool results execution that results are written to. @OutputOnly + */ + toolResultsExecution: Schema$ToolResultsExecution; + /** + * The tool results history that contains the tool results execution that + * results are written to. Optional, if not provided the service will + * choose an appropriate value. + */ + toolResultsHistory: Schema$ToolResultsHistory; + } /** - * The cloud project that owns the tool results history. Required - */ - projectId: string; -} -/** - * Represents a tool results step resource. This has the results of a - * TestExecution. - */ -export interface Schema$ToolResultsStep { + * Directs Robo to interact with a specific UI element if it is encountered + * during the crawl. Currently, Robo can perform text entry or element click. + */ + export interface Schema$RoboDirective { + /** + * The type of action that Robo should perform on the specified element. + * Required. + */ + actionType: string; + /** + * The text that Robo is directed to set. If left empty, the directive will + * be treated as a CLICK on the element matching the resource_name. Optional + */ + inputText: string; + /** + * The android resource name of the target UI element For example, in + * Java: R.string.foo in xml: @string/foo Only the “foo” part is needed. + * Reference doc: + * https://developer.android.com/guide/topics/resources/accessing-resources.html + * Required + */ + resourceName: string; + } /** - * A tool results execution ID. @OutputOnly + * Message for specifying the start activities to crawl */ - executionId: string; + export interface Schema$RoboStartingIntent { + launcherActivity: Schema$LauncherActivityIntent; + startActivity: Schema$StartActivityIntent; + } /** - * A tool results history ID. @OutputOnly - */ - historyId: string; + * A starting intent specified by an action, uri, and categories. + */ + export interface Schema$StartActivityIntent { + /** + * Action name. Required for START_ACTIVITY. + */ + action: string; + /** + * Intent categories to set on the intent. Optional. + */ + categories: string[]; + /** + * URI for the action. Optional. + */ + uri: string; + } /** - * The cloud project that owns the tool results step. @OutputOnly - */ - projectId: string; + * Additional details about the progress of the running test. + */ + export interface Schema$TestDetails { + /** + * If the TestState is ERROR, then this string will contain human-readable + * details about the error. @OutputOnly + */ + errorMessage: string; + /** + * Human-readable, detailed descriptions of the test's progress. For + * example: "Provisioning a device", "Starting Test". + * During the course of execution new data may be appended to the end of + * progress_messages. @OutputOnly + */ + progressMessages: string[]; + /** + * Indicates that video will not be recorded for this execution either + * because the user chose to disable it or the device does not support it. + * See AndroidModel.video_recording_not_supported @OutputOnly + */ + videoRecordingDisabled: boolean; + } /** - * A tool results step ID. @OutputOnly - */ - stepId: string; -} -/** - * Network emulation parameters - */ -export interface Schema$TrafficRule { + * A description of a test environment. + */ + export interface Schema$TestEnvironmentCatalog { + /** + * Android devices suitable for running Android Instrumentation Tests. + */ + androidDeviceCatalog: Schema$AndroidDeviceCatalog; + /** + * Supported network configurations + */ + networkConfigurationCatalog: Schema$NetworkConfigurationCatalog; + } /** - * Bandwidth in kbits/second - */ - bandwidth: number; + * Specifies a single test to be executed in a single environment. + */ + export interface Schema$TestExecution { + /** + * How the host machine(s) are configured. @OutputOnly + */ + environment: Schema$Environment; + /** + * Unique id set by the backend. @OutputOnly + */ + id: string; + /** + * Id of the containing TestMatrix. @OutputOnly + */ + matrixId: string; + /** + * The cloud project that owns the test execution. @OutputOnly + */ + projectId: string; + /** + * Indicates the current progress of the test execution (e.g., FINISHED). + * @OutputOnly + */ + state: string; + /** + * Additional details about the running test. @OutputOnly + */ + testDetails: Schema$TestDetails; + /** + * How to run the test. @OutputOnly + */ + testSpecification: Schema$TestSpecification; + /** + * The time this test execution was initially created. @OutputOnly + */ + timestamp: string; + /** + * Where the results for this execution are written. @OutputOnly + */ + toolResultsStep: Schema$ToolResultsStep; + } /** - * Burst size in kbits - */ - burst: number; + * A group of one or more TestExecutions, built by taking a product of values + * over a pre-defined set of axes. + */ + export interface Schema$TestMatrix { + /** + * Information about the client which invoked the test. Optional + */ + clientInfo: Schema$ClientInfo; + /** + * How the host machine(s) are configured. Required + */ + environmentMatrix: Schema$EnvironmentMatrix; + /** + * Describes why the matrix is considered invalid. Only useful for matrices + * in the INVALID state. @OutputOnly + */ + invalidMatrixDetails: string; + /** + * The cloud project that owns the test matrix. @OutputOnly + */ + projectId: string; + /** + * Where the results for the matrix are written. Required + */ + resultStorage: Schema$ResultStorage; + /** + * Indicates the current progress of the test matrix (e.g., FINISHED) + * @OutputOnly + */ + state: string; + /** + * The list of test executions that the service creates for this matrix. + * @OutputOnly + */ + testExecutions: Schema$TestExecution[]; + /** + * Unique id set by the service. @OutputOnly + */ + testMatrixId: string; + /** + * How to run the test. Required + */ + testSpecification: Schema$TestSpecification; + /** + * The time this test matrix was initially created. @OutputOnly + */ + timestamp: string; + } /** - * Packet delay, must be >= 0 - */ - delay: string; + * A description of how to set up the Android device prior to running the + * test. + */ + export interface Schema$TestSetup { + /** + * The device will be logged in on this account for the duration of the + * test. Optional + */ + account: Schema$Account; + /** + * APKs to install in addition to those being directly tested. Currently + * capped at 100. Optional + */ + additionalApks: Schema$Apk[]; + /** + * List of directories on the device to upload to GCS at the end of the + * test; they must be absolute paths under /sdcard or /data/local/tmp. Path + * names are restricted to characters a-z A-Z 0-9 _ - . + and / Note: The + * paths /sdcard and /data will be made available and treated as implicit + * path substitutions. E.g. if /sdcard on a particular device does not map + * to external storage, the system will replace it with the external storage + * path prefix for that device. Optional + */ + directoriesToPull: string[]; + /** + * Environment variables to set for the test (only applicable for + * instrumentation tests). + */ + environmentVariables: Schema$EnvironmentVariable[]; + /** + * List of files to push to the device before starting the test. Optional + */ + filesToPush: Schema$DeviceFile[]; + /** + * The network traffic profile used for running the test. Optional + */ + networkProfile: string; + } /** - * Packet duplication ratio (0.0 - 1.0) - */ - packetDuplicationRatio: number; + * A description of how to run the test. + */ + export interface Schema$TestSpecification { + /** + * An Android instrumentation test. + */ + androidInstrumentationTest: Schema$AndroidInstrumentationTest; + /** + * An Android robo test. + */ + androidRoboTest: Schema$AndroidRoboTest; + /** + * An Android Application with a Test Loop + */ + androidTestLoop: Schema$AndroidTestLoop; + /** + * Enables automatic Google account login. If set, the service will + * automatically generate a Google test account and add it to the device, + * before executing the test. Note that test accounts might be reused. Many + * applications show their full set of functionalities when an account is + * present on the device. Logging into the device with these generated + * accounts allows testing more functionalities. Default is false. Optional + */ + autoGoogleLogin: boolean; + /** + * Disables performance metrics recording; may reduce test latency. + */ + disablePerformanceMetrics: boolean; + /** + * Disables video recording; may reduce test latency. + */ + disableVideoRecording: boolean; + /** + * Test setup requirements for Android e.g. files to install, bootstrap + * scripts. Optional + */ + testSetup: Schema$TestSetup; + /** + * Max time a test execution is allowed to run before it is automatically + * cancelled. Optional, default is 5 min. + */ + testTimeout: string; + } /** - * Packet loss ratio (0.0 - 1.0) - */ - packetLossRatio: number; -} - -export class Resource$Applicationdetailservice { - root: Testing; - constructor(root: Testing) { - this.root = root; - this.getRoot.bind(this); + * Represents a tool results execution resource. This has the results of a + * TestMatrix. + */ + export interface Schema$ToolResultsExecution { + /** + * A tool results execution ID. @OutputOnly + */ + executionId: string; + /** + * A tool results history ID. @OutputOnly + */ + historyId: string; + /** + * The cloud project that owns the tool results execution. @OutputOnly + */ + projectId: string; } - - getRoot() { - return this.root; + /** + * Represents a tool results history resource. + */ + export interface Schema$ToolResultsHistory { + /** + * A tool results history ID. Required + */ + historyId: string; + /** + * The cloud project that owns the tool results history. Required + */ + projectId: string; } - - /** - * testing.applicationDetailService.getApkDetails - * @desc Request the details of an Android application APK. - * @alias testing.applicationDetailService.getApkDetails - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().FileReference} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getApkDetails(params?: any, options?: MethodOptions): - AxiosPromise; - getApkDetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getApkDetails( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/applicationDetailService/getApkDetails') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Represents a tool results step resource. This has the results of a + * TestExecution. + */ + export interface Schema$ToolResultsStep { + /** + * A tool results execution ID. @OutputOnly + */ + executionId: string; + /** + * A tool results history ID. @OutputOnly + */ + historyId: string; + /** + * The cloud project that owns the tool results step. @OutputOnly + */ + projectId: string; + /** + * A tool results step ID. @OutputOnly + */ + stepId: string; } -} - -export class Resource$Projects { - root: Testing; - testMatrices: Resource$Projects$Testmatrices; - constructor(root: Testing) { - this.root = root; - this.getRoot.bind(this); - this.testMatrices = new Resource$Projects$Testmatrices(root); + /** + * Network emulation parameters + */ + export interface Schema$TrafficRule { + /** + * Bandwidth in kbits/second + */ + bandwidth: number; + /** + * Burst size in kbits + */ + burst: number; + /** + * Packet delay, must be >= 0 + */ + delay: string; + /** + * Packet duplication ratio (0.0 - 1.0) + */ + packetDuplicationRatio: number; + /** + * Packet loss ratio (0.0 - 1.0) + */ + packetLossRatio: number; } - getRoot() { - return this.root; - } -} -export class Resource$Projects$Testmatrices { - root: Testing; - constructor(root: Testing) { - this.root = root; - this.getRoot.bind(this); - } + export class Resource$Applicationdetailservice { + root: Testing; + constructor(root: Testing) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * testing.projects.testMatrices.cancel - * @desc Cancels unfinished test executions in a test matrix. This call - * returns immediately and cancellation proceeds asychronously. If the matrix - * is already final, this operation will have no effect. May return any of - * the following canonical error codes: - PERMISSION_DENIED - if the user is - * not authorized to read project - INVALID_ARGUMENT - if the request is - * malformed - NOT_FOUND - if the Test Matrix does not exist - * @alias testing.projects.testMatrices.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Cloud project that owns the test. - * @param {string} params.testMatrixId Test matrix that will be canceled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'testMatrixId'], - pathParams: ['projectId', 'testMatrixId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * testing.applicationDetailService.getApkDetails + * @desc Request the details of an Android application APK. + * @alias testing.applicationDetailService.getApkDetails + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().FileReference} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getApkDetails(params?: any, options?: MethodOptions): + AxiosPromise; + getApkDetails( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getApkDetails( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/applicationDetailService/getApkDetails') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } + export class Resource$Projects { + root: Testing; + testMatrices: Resource$Projects$Testmatrices; + constructor(root: Testing) { + this.root = root; + this.getRoot.bind(this); + this.testMatrices = new Resource$Projects$Testmatrices(root); + } - /** - * testing.projects.testMatrices.create - * @desc Request to run a matrix of tests according to the given - * specifications. Unsupported environments will be returned in the state - * UNSUPPORTED. Matrices are limited to at most 200 supported executions. May - * return any of the following canonical error codes: - PERMISSION_DENIED - - * if the user is not authorized to write to project - INVALID_ARGUMENT - if - * the request is malformed or if the matrix expands to - * more than 200 supported executions - * @alias testing.projects.testMatrices.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId The GCE project under which this job will run. - * @param {string=} params.requestId A string id used to detect duplicated requests. Ids are automatically scoped to a project, so users should ensure the ID is unique per-project. A UUID is recommended. Optional, but strongly recommended. - * @param {().TestMatrix} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Testmatrices { + root: Testing; + constructor(root: Testing) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/projects/{projectId}/testMatrices') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * testing.projects.testMatrices.get - * @desc Check the status of a test matrix. May return any of the following - * canonical error codes: - PERMISSION_DENIED - if the user is not authorized - * to read project - INVALID_ARGUMENT - if the request is malformed - - * NOT_FOUND - if the Test Matrix does not exist - * @alias testing.projects.testMatrices.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId Cloud project that owns the test matrix. - * @param {string} params.testMatrixId Unique test matrix id which was assigned by the service. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * testing.projects.testMatrices.cancel + * @desc Cancels unfinished test executions in a test matrix. This call + * returns immediately and cancellation proceeds asychronously. If the + * matrix is already final, this operation will have no effect. May return + * any of the following canonical error codes: - PERMISSION_DENIED - if the + * user is not authorized to read project - INVALID_ARGUMENT - if the + * request is malformed - NOT_FOUND - if the Test Matrix does not exist + * @alias testing.projects.testMatrices.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Cloud project that owns the test. + * @param {string} params.testMatrixId Test matrix that will be canceled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/projects/{projectId}/testMatrices/{testMatrixId}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'testMatrixId'], + pathParams: ['projectId', 'testMatrixId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/projects/{projectId}/testMatrices/{testMatrixId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'testMatrixId'], - pathParams: ['projectId', 'testMatrixId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Testenvironmentcatalog { - root: Testing; - constructor(root: Testing) { - this.root = root; - this.getRoot.bind(this); - } + /** + * testing.projects.testMatrices.create + * @desc Request to run a matrix of tests according to the given + * specifications. Unsupported environments will be returned in the state + * UNSUPPORTED. Matrices are limited to at most 200 supported executions. + * May return any of the following canonical error codes: - + * PERMISSION_DENIED - if the user is not authorized to write to project - + * INVALID_ARGUMENT - if the request is malformed or if the matrix expands + * to more than 200 supported executions + * @alias testing.projects.testMatrices.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId The GCE project under which this job will run. + * @param {string=} params.requestId A string id used to detect duplicated requests. Ids are automatically scoped to a project, so users should ensure the ID is unique per-project. A UUID is recommended. Optional, but strongly recommended. + * @param {().TestMatrix} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/projects/{projectId}/testMatrices') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + - getRoot() { - return this.root; + /** + * testing.projects.testMatrices.get + * @desc Check the status of a test matrix. May return any of the following + * canonical error codes: - PERMISSION_DENIED - if the user is not + * authorized to read project - INVALID_ARGUMENT - if the request is + * malformed - NOT_FOUND - if the Test Matrix does not exist + * @alias testing.projects.testMatrices.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId Cloud project that owns the test matrix. + * @param {string} params.testMatrixId Unique test matrix id which was assigned by the service. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/v1/projects/{projectId}/testMatrices/{testMatrixId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'testMatrixId'], + pathParams: ['projectId', 'testMatrixId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * testing.testEnvironmentCatalog.get - * @desc Get the catalog of supported test environments. May return any of - * the following canonical error codes: - INVALID_ARGUMENT - if the request - * is malformed - NOT_FOUND - if the environment type does not exist - - * INTERNAL - if an internal error occurred - * @alias testing.testEnvironmentCatalog.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.environmentType The type of environment that should be listed. Required - * @param {string=} params.projectId For authorization, the cloud project requesting the TestEnvironmentCatalog. Optional - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Testenvironmentcatalog { + root: Testing; + constructor(root: Testing) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/testEnvironmentCatalog/{environmentType}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['environmentType'], - pathParams: ['environmentType'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * testing.testEnvironmentCatalog.get + * @desc Get the catalog of supported test environments. May return any of + * the following canonical error codes: - INVALID_ARGUMENT - if the request + * is malformed - NOT_FOUND - if the environment type does not exist - + * INTERNAL - if an internal error occurred + * @alias testing.testEnvironmentCatalog.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.environmentType The type of environment that should be listed. Required + * @param {string=} params.projectId For authorization, the cloud project requesting the TestEnvironmentCatalog. Optional + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://testing.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/testEnvironmentCatalog/{environmentType}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['environmentType'], + pathParams: ['environmentType'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/texttospeech/v1beta1.ts b/src/apis/texttospeech/v1beta1.ts index fec6d04a6d0..43fa2df0db3 100644 --- a/src/apis/texttospeech/v1beta1.ts +++ b/src/apis/texttospeech/v1beta1.ts @@ -27,329 +27,335 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Text-to-Speech API - * - * Synthesizes natural-sounding speech by applying powerful neural network - * models. - * - * @example - * const google = require('googleapis'); - * const texttospeech = google.texttospeech('v1beta1'); - * - * @namespace texttospeech - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Texttospeech - */ -export class Texttospeech { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace texttospeech_v1beta1 { + /** + * Cloud Text-to-Speech API + * + * Synthesizes natural-sounding speech by applying powerful neural network + * models. + * + * @example + * const google = require('googleapis'); + * const texttospeech = google.texttospeech('v1beta1'); + * + * @namespace texttospeech + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Texttospeech + */ + export class Texttospeech { + _options: GlobalOptions; + google: GoogleApis; + root = this; - text: Resource$Text; - voices: Resource$Voices; + text: Resource$Text; + voices: Resource$Voices; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.text = new Resource$Text(this); - this.voices = new Resource$Voices(this); - } + this.text = new Resource$Text(this); + this.voices = new Resource$Voices(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Description of audio data to be synthesized. - */ -export interface Schema$AudioConfig { - /** - * Required. The format of the requested audio byte stream. - */ - audioEncoding: string; - /** - * Optional speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 - * semitones from the original pitch. -20 means decrease 20 semitones from the - * original pitch. - */ - pitch: number; - /** - * The synthesis sample rate (in hertz) for this audio. Optional. If this is - * different from the voice's natural sample rate, then the synthesizer - * will honor this request by converting to the desired sample rate (which - * might result in worse audio quality), unless the specified sample rate is - * not supported for the encoding chosen, in which case it will fail the - * request and return google.rpc.Code.INVALID_ARGUMENT. - */ - sampleRateHertz: number; - /** - * Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal - * native speed supported by the specific voice. 2.0 is twice as fast, and 0.5 - * is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any other - * values < 0.25 or > 4.0 will return an error. - */ - speakingRate: number; - /** - * Optional volume gain (in dB) of the normal native volume supported by the - * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value of - * 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 (dB) - * will play at approximately half the amplitude of the normal native signal - * amplitude. A value of +6.0 (dB) will play at approximately twice the - * amplitude of the normal native signal amplitude. Strongly recommend not to - * exceed +10 (dB) as there's usually no effective increase in loudness - * for any value greater than that. - */ - volumeGainDb: number; -} -/** - * The message returned to the client by the `ListVoices` method. - */ -export interface Schema$ListVoicesResponse { - /** - * The list of voices. - */ - voices: Schema$Voice[]; -} -/** - * Contains text input to be synthesized. Either `text` or `ssml` must be - * supplied. Supplying both or neither returns google.rpc.Code.INVALID_ARGUMENT. - * The input size is limited to 5000 characters. - */ -export interface Schema$SynthesisInput { - /** - * The SSML document to be synthesized. The SSML document must be valid and - * well-formed. Otherwise the RPC will fail and return - * google.rpc.Code.INVALID_ARGUMENT. For more information, see - * [SSML](/speech/text-to-speech/docs/ssml). - */ - ssml: string; - /** - * The raw text to be synthesized. - */ - text: string; -} -/** - * The top-level message sent by the client for the `SynthesizeSpeech` method. - */ -export interface Schema$SynthesizeSpeechRequest { - /** - * Required. The configuration of the synthesized audio. - */ - audioConfig: Schema$AudioConfig; /** - * Required. The Synthesizer requires either plain text or SSML as input. + * Description of audio data to be synthesized. */ - input: Schema$SynthesisInput; - /** - * Required. The desired voice of the synthesized audio. - */ - voice: Schema$VoiceSelectionParams; -} -/** - * The message returned to the client by the `SynthesizeSpeech` method. - */ -export interface Schema$SynthesizeSpeechResponse { - /** - * The audio data bytes encoded as specified in the request, including the - * header (For LINEAR16 audio, we include the WAV header). Note: as with all - * bytes fields, protobuffers use a pure binary representation, whereas JSON - * representations use base64. - */ - audioContent: string; -} -/** - * Description of a voice supported by the TTS service. - */ -export interface Schema$Voice { - /** - * The languages that this voice supports, expressed as - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - * "en-US", "es-419", "cmn-tw"). - */ - languageCodes: string[]; + export interface Schema$AudioConfig { + /** + * Required. The format of the requested audio byte stream. + */ + audioEncoding: string; + /** + * Optional speaking pitch, in the range [-20.0, 20.0]. 20 means increase 20 + * semitones from the original pitch. -20 means decrease 20 semitones from + * the original pitch. + */ + pitch: number; + /** + * The synthesis sample rate (in hertz) for this audio. Optional. If this + * is different from the voice's natural sample rate, then the + * synthesizer will honor this request by converting to the desired sample + * rate (which might result in worse audio quality), unless the specified + * sample rate is not supported for the encoding chosen, in which case it + * will fail the request and return google.rpc.Code.INVALID_ARGUMENT. + */ + sampleRateHertz: number; + /** + * Optional speaking rate/speed, in the range [0.25, 4.0]. 1.0 is the normal + * native speed supported by the specific voice. 2.0 is twice as fast, and + * 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 speed. Any + * other values < 0.25 or > 4.0 will return an error. + */ + speakingRate: number; + /** + * Optional volume gain (in dB) of the normal native volume supported by the + * specific voice, in the range [-96.0, 16.0]. If unset, or set to a value + * of 0.0 (dB), will play at normal native signal amplitude. A value of -6.0 + * (dB) will play at approximately half the amplitude of the normal native + * signal amplitude. A value of +6.0 (dB) will play at approximately twice + * the amplitude of the normal native signal amplitude. Strongly recommend + * not to exceed +10 (dB) as there's usually no effective increase in + * loudness for any value greater than that. + */ + volumeGainDb: number; + } /** - * The name of this voice. Each distinct voice has a unique name. + * The message returned to the client by the `ListVoices` method. */ - name: string; + export interface Schema$ListVoicesResponse { + /** + * The list of voices. + */ + voices: Schema$Voice[]; + } /** - * The natural sample rate (in hertz) for this voice. + * Contains text input to be synthesized. Either `text` or `ssml` must be + * supplied. Supplying both or neither returns + * google.rpc.Code.INVALID_ARGUMENT. The input size is limited to 5000 + * characters. */ - naturalSampleRateHertz: number; + export interface Schema$SynthesisInput { + /** + * The SSML document to be synthesized. The SSML document must be valid and + * well-formed. Otherwise the RPC will fail and return + * google.rpc.Code.INVALID_ARGUMENT. For more information, see + * [SSML](/speech/text-to-speech/docs/ssml). + */ + ssml: string; + /** + * The raw text to be synthesized. + */ + text: string; + } /** - * The gender of this voice. + * The top-level message sent by the client for the `SynthesizeSpeech` method. */ - ssmlGender: string; -} -/** - * Description of which voice to use for a synthesis request. - */ -export interface Schema$VoiceSelectionParams { + export interface Schema$SynthesizeSpeechRequest { + /** + * Required. The configuration of the synthesized audio. + */ + audioConfig: Schema$AudioConfig; + /** + * Required. The Synthesizer requires either plain text or SSML as input. + */ + input: Schema$SynthesisInput; + /** + * Required. The desired voice of the synthesized audio. + */ + voice: Schema$VoiceSelectionParams; + } /** - * The language (and optionally also the region) of the voice expressed as a - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - * "en-US". Required. This should not include a script tag (e.g. use - * "cmn-cn" rather than "cmn-Hant-cn"), because the script - * will be inferred from the input provided in the SynthesisInput. The TTS - * service will use this parameter to help choose an appropriate voice. Note - * that the TTS service may choose a voice with a slightly different language - * code than the one selected; it may substitute a different region (e.g. - * using en-US rather than en-CA if there isn't a Canadian voice - * available), or even a different language, e.g. using "nb" - * (Norwegian Bokmal) instead of "no" (Norwegian)". + * The message returned to the client by the `SynthesizeSpeech` method. */ - languageCode: string; + export interface Schema$SynthesizeSpeechResponse { + /** + * The audio data bytes encoded as specified in the request, including the + * header (For LINEAR16 audio, we include the WAV header). Note: as with all + * bytes fields, protobuffers use a pure binary representation, whereas JSON + * representations use base64. + */ + audioContent: string; + } /** - * The name of the voice. Optional; if not set, the service will choose a - * voice based on the other parameters such as language_code and gender. + * Description of a voice supported by the TTS service. */ - name: string; + export interface Schema$Voice { + /** + * The languages that this voice supports, expressed as + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags + * (e.g. "en-US", "es-419", "cmn-tw"). + */ + languageCodes: string[]; + /** + * The name of this voice. Each distinct voice has a unique name. + */ + name: string; + /** + * The natural sample rate (in hertz) for this voice. + */ + naturalSampleRateHertz: number; + /** + * The gender of this voice. + */ + ssmlGender: string; + } /** - * The preferred gender of the voice. Optional; if not set, the service will - * choose a voice based on the other parameters such as language_code and - * name. Note that this is only a preference, not requirement; if a voice of - * the appropriate gender is not available, the synthesizer should substitute - * a voice with a different gender rather than failing the request. + * Description of which voice to use for a synthesis request. */ - ssmlGender: string; -} - -export class Resource$Text { - root: Texttospeech; - constructor(root: Texttospeech) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$VoiceSelectionParams { + /** + * The language (and optionally also the region) of the voice expressed as a + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. + * "en-US". Required. This should not include a script tag (e.g. + * use "cmn-cn" rather than "cmn-Hant-cn"), because the + * script will be inferred from the input provided in the SynthesisInput. + * The TTS service will use this parameter to help choose an appropriate + * voice. Note that the TTS service may choose a voice with a slightly + * different language code than the one selected; it may substitute a + * different region (e.g. using en-US rather than en-CA if there isn't a + * Canadian voice available), or even a different language, e.g. using + * "nb" (Norwegian Bokmal) instead of "no" + * (Norwegian)". + */ + languageCode: string; + /** + * The name of the voice. Optional; if not set, the service will choose a + * voice based on the other parameters such as language_code and gender. + */ + name: string; + /** + * The preferred gender of the voice. Optional; if not set, the service will + * choose a voice based on the other parameters such as language_code and + * name. Note that this is only a preference, not requirement; if a voice of + * the appropriate gender is not available, the synthesizer should + * substitute a voice with a different gender rather than failing the + * request. + */ + ssmlGender: string; } - - /** - * texttospeech.text.synthesize - * @desc Synthesizes speech synchronously: receive results after all text - * input has been processed. - * @alias texttospeech.text.synthesize - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().SynthesizeSpeechRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - synthesize(params?: any, options?: MethodOptions): - AxiosPromise; - synthesize( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - synthesize( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Text { + root: Texttospeech; + constructor(root: Texttospeech) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://texttospeech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/text:synthesize') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Voices { - root: Texttospeech; - constructor(root: Texttospeech) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * texttospeech.text.synthesize + * @desc Synthesizes speech synchronously: receive results after all text + * input has been processed. + * @alias texttospeech.text.synthesize + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().SynthesizeSpeechRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + synthesize(params?: any, options?: MethodOptions): + AxiosPromise; + synthesize( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + synthesize( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://texttospeech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/text:synthesize') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * texttospeech.voices.list - * @desc Returns a list of Voice supported for synthesis. - * @alias texttospeech.voices.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.languageCode Optional (but recommended) [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. E.g. when specifying "en-NZ", you will get supported "en-*" voices; when specifying "no", you will get supported "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" will also get supported "cmn-*" voices; specifying "zh-hk" will also get supported "yue-*" voices. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Voices { + root: Texttospeech; + constructor(root: Texttospeech) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://texttospeech.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/voices').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * texttospeech.voices.list + * @desc Returns a list of Voice supported for synthesis. + * @alias texttospeech.voices.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.languageCode Optional (but recommended) [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. E.g. when specifying "en-NZ", you will get supported "en-*" voices; when specifying "no", you will get supported "no-*" (Norwegian) and "nb-*" (Norwegian Bokmal) voices; specifying "zh" will also get supported "cmn-*" voices; specifying "zh-hk" will also get supported "yue-*" voices. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://texttospeech.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/voices').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/toolresults/v1beta3.ts b/src/apis/toolresults/v1beta3.ts index b9d630d69ee..a6e1ff64747 100644 --- a/src/apis/toolresults/v1beta3.ts +++ b/src/apis/toolresults/v1beta3.ts @@ -27,2995 +27,3032 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Tool Results API - * - * Reads and publishes results from Firebase Test Lab. - * - * @example - * const google = require('googleapis'); - * const toolresults = google.toolresults('v1beta3'); - * - * @namespace toolresults - * @type {Function} - * @version v1beta3 - * @variation v1beta3 - * @param {object=} options Options for Toolresults - */ -export class Toolresults { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - projects: Resource$Projects; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.projects = new Resource$Projects(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Android app information. - */ -export interface Schema$AndroidAppInfo { - /** - * The name of the app. Optional - */ - name: string; - /** - * The package name of the app. Required. - */ - packageName: string; - /** - * The internal version code of the app. Optional. - */ - versionCode: string; - /** - * The version name of the app. Optional. - */ - versionName: string; -} -/** - * A test of an Android application that can control an Android component - * independently of its normal lifecycle. See for more information on types of - * Android tests. - */ -export interface Schema$AndroidInstrumentationTest { - /** - * The java package for the test to be executed. Required - */ - testPackageId: string; - /** - * The InstrumentationTestRunner class. Required - */ - testRunnerClass: string; - /** - * Each target must be fully qualified with the package name or class name, in - * one of these formats: - "package package_name" - "class - * package_name.class_name" - "class - * package_name.class_name#method_name" If empty, all targets in the - * module will be run. - */ - testTargets: string[]; - /** - * The flag indicates whether Android Test Orchestrator will be used to run - * test or not. - */ - useOrchestrator: boolean; -} -/** - * A test of an android application that explores the application on a virtual - * or physical Android device, finding culprits and crashes as it goes. - */ -export interface Schema$AndroidRoboTest { - /** - * The initial activity that should be used to start the app. Optional - */ - appInitialActivity: string; - /** - * The java package for the bootstrap. Optional - */ - bootstrapPackageId: string; - /** - * The runner class for the bootstrap. Optional - */ - bootstrapRunnerClass: string; - /** - * The max depth of the traversal stack Robo can explore. Optional - */ - maxDepth: number; - /** - * The max number of steps/actions Robo can execute. Default is no limit (0). - * Optional - */ - maxSteps: number; -} -/** - * An Android mobile test specification. - */ -export interface Schema$AndroidTest { - /** - * Information about the application under test. - */ - androidAppInfo: Schema$AndroidAppInfo; - /** - * An Android instrumentation test. - */ - androidInstrumentationTest: Schema$AndroidInstrumentationTest; - /** - * An Android robo test. - */ - androidRoboTest: Schema$AndroidRoboTest; - /** - * Max time a test is allowed to run before it is automatically cancelled. - */ - testTimeout: Schema$Duration; -} -/** - * `Any` contains an arbitrary serialized protocol buffer message along with a - * URL that describes the type of the serialized message. Protobuf library - * provides support to pack/unpack Any values in the form of utility functions - * or additional generated methods of the Any type. Example 1: Pack and unpack - * a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if - * (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in - * Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { - * foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in - * Python. foo = Foo(...) any = Any() any.Pack(foo) ... if - * any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a - * message in Go foo := &pb.Foo{...} any, err := ptypes.MarshalAny(foo) ... - * foo := &pb.Foo{} if err := ptypes.UnmarshalAny(any, foo); err != nil { - * ... } The pack methods provided by protobuf library will by default use - * 'type.googleapis.com/full.type.name' as the type URL and the unpack - * methods only use the fully qualified type name after the last '/' in - * the type URL, for example "foo.bar.com/x/y.z" will yield type name - * "y.z". JSON ==== The JSON representation of an `Any` value uses - * the regular representation of the deserialized, embedded message, with an - * additional field `@type` which contains the type URL. Example: package - * google.profile; message Person { string first_name = 1; string last_name = 2; - * } { "@type": - * "type.googleapis.com/google.profile.Person", "firstName": - * , "lastName": } If the embedded message type is well-known and - * has a custom JSON representation, that representation will be embedded adding - * a field `value` which holds the custom JSON in addition to the `@type` field. - * Example (for message [google.protobuf.Duration][]): { "@type": - * "type.googleapis.com/google.protobuf.Duration", "value": - * "1.212s" } - */ -export interface Schema$Any { - /** - * A URL/resource name that uniquely identifies the type of the serialized - * protocol buffer message. The last segment of the URL's path must - * represent the fully qualified name of the type (as in - * `path/google.protobuf.Duration`). The name should be in a canonical form - * (e.g., leading "." is not accepted). In practice, teams usually - * precompile into the binary all types that they expect it to use in the - * context of Any. However, for URLs which use the scheme `http`, `https`, or - * no scheme, one can optionally set up a type server that maps type URLs to - * message definitions as follows: * If no scheme is provided, `https` is - * assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] - * value in binary format, or produce an error. * Applications are allowed to - * cache lookup results based on the URL, or have them precompiled into a - * binary to avoid any lookup. Therefore, binary compatibility needs to be - * preserved on changes to types. (Use versioned type names to manage breaking - * changes.) Note: this functionality is not currently available in the - * official protobuf release, and it is not used for type URLs beginning with - * type.googleapis.com. Schemes other than `http`, `https` (or the empty - * scheme) might be used with implementation specific semantics. - */ - typeUrl: string; - /** - * Must be a valid serialized protocol buffer of the above specified type. - */ - value: string; -} -export interface Schema$AppStartTime { - /** - * Optional. The time from app start to reaching the developer-reported - * "fully drawn" time. This is only stored if the app includes a - * call to Activity.reportFullyDrawn(). See - * https://developer.android.com/topic/performance/launch-time.html#time-full - */ - fullyDrawnTime: Schema$Duration; - /** - * The time from app start to the first displayed activity being drawn, as - * reported in Logcat. See - * https://developer.android.com/topic/performance/launch-time.html#time-initial - */ - initialDisplayTime: Schema$Duration; -} -/** - * Encapsulates the metadata for basic sample series represented by a line chart - */ -export interface Schema$BasicPerfSampleSeries { - perfMetricType: string; - perfUnit: string; - sampleSeriesLabel: string; -} -/** - * The request must provide up to a maximum of 5000 samples to be created; a - * larger sample size will cause an INVALID_ARGUMENT error - */ -export interface Schema$BatchCreatePerfSamplesRequest { - /** - * The set of PerfSamples to create should not include existing timestamps - */ - perfSamples: Schema$PerfSample[]; -} -export interface Schema$BatchCreatePerfSamplesResponse { - perfSamples: Schema$PerfSample[]; -} -export interface Schema$CPUInfo { - /** - * description of the device processor ie '1.8 GHz hexa core 64-bit - * ARMv8-A' - */ - cpuProcessor: string; - /** - * the CPU clock speed in GHz - */ - cpuSpeedInGhz: number; - /** - * the number of CPU cores - */ - numberOfCores: number; -} -/** - * A Duration represents a signed, fixed-length span of time represented as a - * count of seconds and fractions of seconds at nanosecond resolution. It is - * independent of any calendar and concepts like "day" or - * "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted from a - * Timestamp. Range is approximately +-10,000 years. # Examples Example 1: - * Compute Duration from two Timestamps in pseudo code. Timestamp start = ...; - * Timestamp end = ...; Duration duration = ...; duration.seconds = end.seconds - * - start.seconds; duration.nanos = end.nanos - start.nanos; if - * (duration.seconds 0) { duration.seconds += 1; duration.nanos -= 1000000000; - * } else if (durations.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; duration.nanos += 1000000000; } Example 2: Compute - * Timestamp from Timestamp + Duration in pseudo code. Timestamp start = ...; - * Duration duration = ...; Timestamp end = ...; end.seconds = start.seconds + - * duration.seconds; end.nanos = start.nanos + duration.nanos; if (end.nanos = - * 1000000000) { end.seconds += 1; end.nanos -= 1000000000; } Example 3: - * Compute Duration from datetime.timedelta in Python. td = - * datetime.timedelta(days=3, minutes=10) duration = Duration() - * duration.FromTimedelta(td) # JSON Mapping In JSON format, the Duration type - * is encoded as a string rather than an object, where the string ends in the - * suffix "s" (indicating seconds) and is preceded by the number of - * seconds, with nanoseconds expressed as fractional seconds. For example, 3 - * seconds with 0 nanoseconds should be encoded in JSON format as - * "3s", while 3 seconds and 1 nanosecond should be expressed in JSON - * format as "3.000000001s", and 3 seconds and 1 microsecond should be - * expressed in JSON format as "3.000001s". - */ -export interface Schema$Duration { - /** - * Signed fractions of a second at nanosecond resolution of the span of time. - * Durations less than one second are represented with a 0 `seconds` field and - * a positive or negative `nanos` field. For durations of one second or more, - * a non-zero value for the `nanos` field must be of the same sign as the - * `seconds` field. Must be from -999,999,999 to +999,999,999 inclusive. - */ - nanos: number; - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 to - * +315,576,000,000 inclusive. Note: these bounds are computed from: 60 - * sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: string; -} -/** - * An Execution represents a collection of Steps. For instance, it could - * represent: - a mobile test executed across a range of device configurations - - * a jenkins job with a build step followed by a test step The maximum size of - * an execution message is 1 MiB. An Execution can be updated until its state - * is set to COMPLETE at which point it becomes immutable. - */ -export interface Schema$Execution { - /** - * The time when the Execution status transitioned to COMPLETE. This value - * will be set automatically when state transitions to COMPLETE. - In - * response: set if the execution state is COMPLETE. - In create/update - * request: never set - */ - completionTime: Schema$Timestamp; - /** - * The time when the Execution was created. This value will be set - * automatically when CreateExecution is called. - In response: always set - - * In create/update request: never set - */ - creationTime: Schema$Timestamp; - /** - * A unique identifier within a History for this Execution. Returns - * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In - * response always set - In create/update request: never set - */ - executionId: string; - /** - * Classify the result, for example into SUCCESS or FAILURE - In response: - * present if set by create/update request - In create/update request: - * optional - */ - outcome: Schema$Outcome; - /** - * Lightweight information about execution request. - In response: present if - * set by create - In create: optional - In update: optional - */ - specification: Schema$Specification; - /** - * The initial state is IN_PROGRESS. The only legal state transitions is from - * IN_PROGRESS to COMPLETE. A PRECONDITION_FAILED will be returned if an - * invalid transition is requested. The state can only be set to COMPLETE - * once. A FAILED_PRECONDITION will be returned if the state is set to - * COMPLETE multiple times. If the state is set to COMPLETE, all the - * in-progress steps within the execution will be set as COMPLETE. If the - * outcome of the step is not set, the outcome will be set to INCONCLUSIVE. - - * In response always set - In create/update request: optional - */ - state: string; - /** - * TestExecution Matrix ID that the TestExecutionService uses. - In response: - * present if set by create - In create: optional - In update: never set - */ - testExecutionMatrixId: string; -} -export interface Schema$FailureDetail { - /** - * If the failure was severe because the system (app) under test crashed. - */ - crashed: boolean; - /** - * If an app is not installed and thus no test can be run with the app. This - * might be caused by trying to run a test on an unsupported platform. - */ - notInstalled: boolean; - /** - * If a native process (including any other than the app) crashed. - */ - otherNativeCrash: boolean; - /** - * If the test overran some time limit, and that is why it failed. - */ - timedOut: boolean; - /** - * If the robo was unable to crawl the app; perhaps because the app did not - * start. - */ - unableToCrawl: boolean; -} -/** - * A reference to a file. - */ -export interface Schema$FileReference { - /** - * The URI of a file stored in Google Cloud Storage. For example: - * http://storage.googleapis.com/mybucket/path/to/test.xml or in gsutil - * format: gs://mybucket/path/to/test.xml with version-specific info, - * gs://mybucket/path/to/test.xml#1360383693690000 An INVALID_ARGUMENT error - * will be returned if the URI format is not supported. - In response: always - * set - In create/update request: always set - */ - fileUri: string; -} -/** - * Graphics statistics for the App. The information is collected from 'adb - * shell dumpsys graphicsstats'. For more info see: - * https://developer.android.com/training/testing/performance.html Statistics - * will only be present for API 23+. - */ -export interface Schema$GraphicsStats { - /** - * Histogram of frame render times. There should be 154 buckets ranging from - * [5ms, 6ms) to [4950ms, infinity) - */ - buckets: Schema$GraphicsStatsBucket[]; - /** - * Total "high input latency" events. - */ - highInputLatencyCount: string; - /** - * Total frames with slow render time. Should be <= total_frames. - */ - jankyFrames: string; - /** - * Total "missed vsync" events. - */ - missedVsyncCount: string; - /** - * 50th percentile frame render time in milliseconds. - */ - p50Millis: string; - /** - * 90th percentile frame render time in milliseconds. - */ - p90Millis: string; - /** - * 95th percentile frame render time in milliseconds. - */ - p95Millis: string; - /** - * 99th percentile frame render time in milliseconds. - */ - p99Millis: string; - /** - * Total "slow bitmap upload" events. - */ - slowBitmapUploadCount: string; - /** - * Total "slow draw" events. - */ - slowDrawCount: string; - /** - * Total "slow UI thread" events. - */ - slowUiThreadCount: string; - /** - * Total frames rendered by package. - */ - totalFrames: string; -} -export interface Schema$GraphicsStatsBucket { - /** - * Number of frames in the bucket. - */ - frameCount: string; - /** - * Lower bound of render time in milliseconds. - */ - renderMillis: string; -} -/** - * A History represents a sorted list of Executions ordered by the - * start_timestamp_millis field (descending). It can be used to group all the - * Executions of a continuous build. Note that the ordering only operates on - * one-dimension. If a repository has multiple branches, it means that multiple - * histories will need to be used in order to order Executions per branch. - */ -export interface Schema$History { - /** - * A short human-readable (plain text) name to display in the UI. Maximum of - * 100 characters. - In response: present if set during create. - In create - * request: optional - */ - displayName: string; - /** - * A unique identifier within a project for this History. Returns - * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In - * response always set - In create request: never set - */ - historyId: string; - /** - * A name to uniquely identify a history within a project. Maximum of 200 - * characters. - In response always set - In create request: always set - */ - name: string; -} -/** - * An image, with a link to the main image and a thumbnail. - */ -export interface Schema$Image { - /** - * An error explaining why the thumbnail could not be rendered. - */ - error: Schema$Status; - /** - * A reference to the full-size, original image. This is the same as the - * tool_outputs entry for the image under its Step. Always set. - */ - sourceImage: Schema$ToolOutputReference; - /** - * The step to which the image is attached. Always set. - */ - stepId: string; - /** - * The thumbnail. - */ - thumbnail: Schema$Thumbnail; -} -export interface Schema$InconclusiveDetail { - /** - * If the end user aborted the test execution before a pass or fail could be - * determined. For example, the user pressed ctrl-c which sent a kill signal - * to the test runner while the test was running. - */ - abortedByUser: boolean; - /** - * If the test runner could not determine success or failure because the test - * depends on a component other than the system under test which failed. For - * example, a mobile test requires provisioning a device where the test - * executes, and that provisioning can fail. - */ - infrastructureFailure: boolean; -} -export interface Schema$ListExecutionsResponse { - /** - * Executions. Always set. - */ - executions: Schema$Execution[]; - /** - * A continuation token to resume the query at the next item. Will only be - * set if there are more Executions to fetch. - */ - nextPageToken: string; -} -/** - * Response message for HistoryService.List - */ -export interface Schema$ListHistoriesResponse { - /** - * Histories. - */ - histories: Schema$History[]; - /** - * A continuation token to resume the query at the next item. Will only be - * set if there are more histories to fetch. Tokens are valid for up to one - * hour from the time of the first list request. For instance, if you make a - * list request at 1PM and use the token from this first request 10 minutes - * later, the token from this second response will only be valid for 50 - * minutes. - */ - nextPageToken: string; -} -export interface Schema$ListPerfSampleSeriesResponse { - /** - * The resulting PerfSampleSeries sorted by id - */ - perfSampleSeries: Schema$PerfSampleSeries[]; -} -export interface Schema$ListPerfSamplesResponse { - /** - * Optional, returned if result size exceeds the page size specified in the - * request (or the default page size, 500, if unspecified). It indicates the - * last sample timestamp to be used as page_token in subsequent request - */ - nextPageToken: string; - perfSamples: Schema$PerfSample[]; -} -export interface Schema$ListScreenshotClustersResponse { - /** - * The set of clusters associated with an execution Always set - */ - clusters: Schema$ScreenshotCluster[]; -} -/** - * Response message for StepService.List. - */ -export interface Schema$ListStepsResponse { - /** - * A continuation token to resume the query at the next item. If set, - * indicates that there are more steps to read, by calling list again with - * this value in the page_token field. - */ - nextPageToken: string; - /** - * Steps. - */ - steps: Schema$Step[]; -} -/** - * A response containing the thumbnails in a step. - */ -export interface Schema$ListStepThumbnailsResponse { - /** - * A continuation token to resume the query at the next item. If set, - * indicates that there are more thumbnails to read, by calling list again - * with this value in the page_token field. - */ - nextPageToken: string; - /** - * A list of image data. Images are returned in a deterministic order; they - * are ordered by these factors, in order of importance: * First, by their - * associated test case. Images without a test case are considered greater - * than images with one. * Second, by their creation time. Images without a - * creation time are greater than images with one. * Third, by the order in - * which they were added to the step (by calls to CreateStep or UpdateStep). - */ - thumbnails: Schema$Image[]; -} -export interface Schema$MemoryInfo { - /** - * Maximum memory that can be allocated to the process in KiB - */ - memoryCapInKibibyte: string; - /** - * Total memory available on the device in KiB - */ - memoryTotalInKibibyte: string; -} -/** - * Interprets a result so that humans and machines can act on it. - */ -export interface Schema$Outcome { - /** - * More information about a FAILURE outcome. Returns INVALID_ARGUMENT if this - * field is set but the summary is not FAILURE. Optional - */ - failureDetail: Schema$FailureDetail; - /** - * More information about an INCONCLUSIVE outcome. Returns INVALID_ARGUMENT - * if this field is set but the summary is not INCONCLUSIVE. Optional - */ - inconclusiveDetail: Schema$InconclusiveDetail; - /** - * More information about a SKIPPED outcome. Returns INVALID_ARGUMENT if this - * field is set but the summary is not SKIPPED. Optional - */ - skippedDetail: Schema$SkippedDetail; - /** - * More information about a SUCCESS outcome. Returns INVALID_ARGUMENT if this - * field is set but the summary is not SUCCESS. Optional - */ - successDetail: Schema$SuccessDetail; - /** - * The simplest way to interpret a result. Required - */ - summary: string; -} -/** - * Encapsulates performance environment info - */ -export interface Schema$PerfEnvironment { - /** - * CPU related environment info - */ - cpuInfo: Schema$CPUInfo; - /** - * Memory related environment info - */ - memoryInfo: Schema$MemoryInfo; -} -/** - * A summary of perf metrics collected and performance environment info - */ -export interface Schema$PerfMetricsSummary { - appStartTime: Schema$AppStartTime; - /** - * A tool results execution ID. - */ - executionId: string; - /** - * Graphics statistics for the entire run. Statistics are reset at the - * beginning of the run and collected at the end of the run. - */ - graphicsStats: Schema$GraphicsStats; - /** - * A tool results history ID. - */ - historyId: string; - /** - * Describes the environment in which the performance metrics were collected - */ - perfEnvironment: Schema$PerfEnvironment; - /** - * Set of resource collected - */ - perfMetrics: string[]; - /** - * The cloud project - */ - projectId: string; - /** - * A tool results step ID. - */ - stepId: string; -} -/** - * Resource representing a single performance measure or data point - */ -export interface Schema$PerfSample { - /** - * Timestamp of collection - */ - sampleTime: Schema$Timestamp; - /** - * Value observed - */ - value: number; -} -/** - * Resource representing a collection of performance samples (or data points) - */ -export interface Schema$PerfSampleSeries { - /** - * Basic series represented by a line chart - */ - basicPerfSampleSeries: Schema$BasicPerfSampleSeries; - /** - * A tool results execution ID. - */ - executionId: string; - /** - * A tool results history ID. - */ - historyId: string; - /** - * The cloud project - */ - projectId: string; - /** - * A sample series id - */ - sampleSeriesId: string; - /** - * A tool results step ID. - */ - stepId: string; -} -/** - * Per-project settings for the Tool Results service. - */ -export interface Schema$ProjectSettings { - /** - * The name of the Google Cloud Storage bucket to which results are written. - * By default, this is unset. In update request: optional In response: - * optional - */ - defaultBucket: string; - /** - * The name of the project's settings. Always of the form: - * projects/{project-id}/settings In update request: never set In response: - * always set - */ - name: string; -} -/** - * Request message for StepService.PublishXunitXmlFiles. - */ -export interface Schema$PublishXunitXmlFilesRequest { - /** - * URI of the Xunit XML files to publish. The maximum size of the file this - * reference is pointing to is 50MB. Required. - */ - xunitXmlFiles: Schema$FileReference[]; -} -export interface Schema$Screen { - /** - * File reference of the png file. Required. - */ - fileReference: string; - /** - * Locale of the device that the screenshot was taken on. Required. - */ - locale: string; - /** - * Model of the device that the screenshot was taken on. Required. - */ - model: string; - /** - * OS version of the device that the screenshot was taken on. Required. - */ - version: string; -} -export interface Schema$ScreenshotCluster { - /** - * A string that describes the activity of every screen in the cluster. - */ - activity: string; - /** - * A unique identifier for the cluster. - */ - clusterId: string; - /** - * A singular screen that represents the cluster as a whole. This screen will - * act as the "cover" of the entire cluster. When users look at the - * clusters, only the key screen from each cluster will be shown. Which screen - * is the key screen is determined by the ClusteringAlgorithm - */ - keyScreen: Schema$Screen; - /** - * Full list of screens. - */ - screens: Schema$Screen[]; -} -export interface Schema$SkippedDetail { - /** - * If the App doesn't support the specific API level. - */ - incompatibleAppVersion: boolean; - /** - * If the App doesn't run on the specific architecture, for example, x86. - */ - incompatibleArchitecture: boolean; - /** - * If the requested OS version doesn't run on the specific device model. - */ - incompatibleDevice: boolean; -} -/** - * The details about how to run the execution. - */ -export interface Schema$Specification { - /** - * An Android mobile test execution specification. - */ - androidTest: Schema$AndroidTest; -} -/** - * A stacktrace. - */ -export interface Schema$StackTrace { - /** - * Exception cluster ID - */ - clusterId: string; - /** - * The stack trace message. Required - */ - exception: string; - /** - * Exception report ID - */ - reportId: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of [google.rpc.Code][], but it may accept additional error - * codes if needed. The error message should be a developer-facing English - * message that helps developers *understand* and *resolve* the error. If a - * localized user-facing error message is needed, put the localized message in - * the error details or localize it in the client. The optional error details - * may contain arbitrary information about the error. There is a predefined set - * of error detail types in the package `google.rpc` that can be used for common - * error conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed the - * `Status` in the normal response to indicate the partial errors. - Workflow - * errors. A typical workflow has multiple steps. Each step may have a `Status` - * message for error reporting. - Batch operations. If a client uses batch - * request and batch response, the `Status` message should be used directly - * inside batch response, one for each error sub-response. - Asynchronous - * operations. If an API call embeds asynchronous operation results in its - * response, the status of those operations should be represented directly using - * the `Status` message. - Logging. If some API errors are stored in logs, the - * message `Status` could be used directly after any stripping needed for - * security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of [google.rpc.Code][]. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: Schema$Any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * [google.rpc.Status.details][] field, or localized by the client. - */ - message: string; -} -/** - * A Step represents a single operation performed as part of Execution. A step - * can be used to represent the execution of a tool ( for example a test runner - * execution or an execution of a compiler). Steps can overlap (for instance - * two steps might have the same start time if some operations are done in - * parallel). Here is an example, let's consider that we have a continuous - * build is executing a test runner for each iteration. The workflow would look - * like: - user creates a Execution with id 1 - user creates an - * TestExecutionStep with id 100 for Execution 1 - user update TestExecutionStep - * with id 100 to add a raw xml log + the service parses the xml logs and - * returns a TestExecutionStep with updated TestResult(s). - user update the - * status of TestExecutionStep with id 100 to COMPLETE A Step can be updated - * until its state is set to COMPLETE at which points it becomes immutable. - */ -export interface Schema$Step { - /** - * The time when the step status was set to complete. This value will be set - * automatically when state transitions to COMPLETE. - In response: set if - * the execution state is COMPLETE. - In create/update request: never set - */ - completionTime: Schema$Timestamp; - /** - * The time when the step was created. - In response: always set - In - * create/update request: never set - */ - creationTime: Schema$Timestamp; - /** - * A description of this tool For example: mvn clean package -D skipTests=true - * - In response: present if set by create/update request - In create/update - * request: optional - */ - description: string; - /** - * How much the device resource is used to perform the test. This is the - * device usage used for billing purpose, which is different from the - * run_duration, for example, infrastructure failure won't be charged for - * device usage. PRECONDITION_FAILED will be returned if one attempts to set - * a device_usage on a step which already has this field set. - In response: - * present if previously set. - In create request: optional - In update - * request: optional - */ - deviceUsageDuration: Schema$Duration; - /** - * If the execution containing this step has any dimension_definition set, - * then this field allows the child to specify the values of the dimensions. - * The keys must exactly match the dimension_definition of the execution. For - * example, if the execution has `dimension_definition = ['attempt', - * 'device']` then a step must define values for those dimensions, eg. - * `dimension_value = ['attempt': '1', 'device': - * 'Nexus 6']` If a step does not participate in one dimension of the - * matrix, the value for that dimension should be empty string. For example, - * if one of the tests is executed by a runner which does not support retries, - * the step could have `dimension_value = ['attempt': '', - * 'device': 'Nexus 6']` If the step does not participate in - * any dimensions of the matrix, it may leave dimension_value unset. A - * PRECONDITION_FAILED will be returned if any of the keys do not exist in the - * dimension_definition of the execution. A PRECONDITION_FAILED will be - * returned if another step in this execution already has the same name and - * dimension_value, but differs on other data fields, for example, step field - * is different. A PRECONDITION_FAILED will be returned if dimension_value is - * set, and there is a dimension_definition in the execution which is not - * specified as one of the keys. - In response: present if set by create - In - * create request: optional - In update request: never set - */ - dimensionValue: Schema$StepDimensionValueEntry[]; - /** - * Whether any of the outputs of this step are images whose thumbnails can be - * fetched with ListThumbnails. - In response: always set - In create/update - * request: never set - */ - hasImages: boolean; - /** - * Arbitrary user-supplied key/value pairs that are associated with the step. - * Users are responsible for managing the key namespace such that keys - * don't accidentally collide. An INVALID_ARGUMENT will be returned if - * the number of labels exceeds 100 or if the length of any of the keys or - * values exceeds 100 characters. - In response: always set - In create - * request: optional - In update request: optional; any new key/value pair - * will be added to the map, and any new value for an existing key will update - * that key's value - */ - labels: Schema$StepLabelsEntry[]; - /** - * A short human-readable name to display in the UI. Maximum of 100 - * characters. For example: Clean build A PRECONDITION_FAILED will be - * returned upon creating a new step if it shares its name and dimension_value - * with an existing step. If two steps represent a similar action, but have - * different dimension values, they should share the same name. For instance, - * if the same set of tests is run on two different platforms, the two steps - * should have the same name. - In response: always set - In create request: - * always set - In update request: never set - */ - name: string; - /** - * Classification of the result, for example into SUCCESS or FAILURE - In - * response: present if set by create/update request - In create/update - * request: optional - */ - outcome: Schema$Outcome; - /** - * How long it took for this step to run. If unset, this is set to the - * difference between creation_time and completion_time when the step is set - * to the COMPLETE state. In some cases, it is appropriate to set this value - * separately: For instance, if a step is created, but the operation it - * represents is queued for a few minutes before it executes, it would be - * appropriate not to include the time spent queued in its run_duration. - * PRECONDITION_FAILED will be returned if one attempts to set a run_duration - * on a step which already has this field set. - In response: present if - * previously set; always present on COMPLETE step - In create request: - * optional - In update request: optional - */ - runDuration: Schema$Duration; - /** - * The initial state is IN_PROGRESS. The only legal state transitions are * - * IN_PROGRESS -> COMPLETE A PRECONDITION_FAILED will be returned if an - * invalid transition is requested. It is valid to create Step with a state - * set to COMPLETE. The state can only be set to COMPLETE once. A - * PRECONDITION_FAILED will be returned if the state is set to COMPLETE - * multiple times. - In response: always set - In create/update request: - * optional - */ - state: string; - /** - * A unique identifier within a Execution for this Step. Returns - * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In - * response: always set - In create/update request: never set - */ - stepId: string; - /** - * An execution of a test runner. - */ - testExecutionStep: Schema$TestExecutionStep; - /** - * An execution of a tool (used for steps we don't explicitly support). - */ - toolExecutionStep: Schema$ToolExecutionStep; -} -export interface Schema$StepDimensionValueEntry { - key: string; - value: string; -} -export interface Schema$StepLabelsEntry { - key: string; - value: string; -} -export interface Schema$SuccessDetail { - /** - * If a native process other than the app crashed. - */ - otherNativeCrash: boolean; -} -/** - * A reference to a test case. Test case references are canonically ordered - * lexicographically by these three factors: * First, by test_suite_name. * - * Second, by class_name. * Third, by name. - */ -export interface Schema$TestCaseReference { - /** - * The name of the class. - */ - className: string; - /** - * The name of the test case. Required. - */ - name: string; - /** - * The name of the test suite to which this test case belongs. - */ - testSuiteName: string; -} -/** - * A step that represents running tests. It accepts ant-junit xml files which - * will be parsed into structured test results by the service. Xml file paths - * are updated in order to append more files, however they can't be deleted. - * Users can also add test results manually by using the test_result field. - */ -export interface Schema$TestExecutionStep { - /** - * Issues observed during the test execution. For example, if the mobile app - * under test crashed during the test, the error message and the stack trace - * content can be recorded here to assist debugging. - In response: present - * if set by create or update - In create/update request: optional - */ - testIssues: Schema$TestIssue[]; - /** - * List of test suite overview contents. This could be parsed from xUnit XML - * log by server, or uploaded directly by user. This references should only be - * called when test suites are fully parsed or uploaded. The maximum allowed - * number of test suite overviews per step is 1000. - In response: always set - * - In create request: optional - In update request: never (use - * publishXunitXmlFiles custom method instead) - */ - testSuiteOverviews: Schema$TestSuiteOverview[]; - /** - * The timing break down of the test execution. - In response: present if set - * by create or update - In create/update request: optional - */ - testTiming: Schema$TestTiming; - /** - * Represents the execution of the test runner. The exit code of this tool - * will be used to determine if the test passed. - In response: always set - - * In create/update request: optional - */ - toolExecution: Schema$ToolExecution; -} -/** - * An issue detected occurring during a test execution. - */ -export interface Schema$TestIssue { - /** - * A brief human-readable message describing the issue. Required. - */ - errorMessage: string; - /** - * Severity of issue. Required. - */ - severity: string; - /** - * Deprecated in favor of stack trace fields inside specific warnings. - */ - stackTrace: Schema$StackTrace; - /** - * Type of issue. Required. - */ - type: string; - /** - * Warning message with additional details of the issue. Should always be a - * message from com.google.devtools.toolresults.v1.warnings - */ - warning: Schema$Any; -} -/** - * A summary of a test suite result either parsed from XML or uploaded directly - * by a user. Note: the API related comments are for StepService only. This - * message is also being used in ExecutionService in a read only mode for the - * corresponding step. - */ -export interface Schema$TestSuiteOverview { - /** - * Number of test cases in error, typically set by the service by parsing the - * xml_source. - In create/response: always set - In update request: never - */ - errorCount: number; - /** - * Number of failed test cases, typically set by the service by parsing the - * xml_source. May also be set by the user. - In create/response: always set - * - In update request: never - */ - failureCount: number; - /** - * The name of the test suite. - In create/response: always set - In update - * request: never - */ - name: string; - /** - * Number of test cases not run, typically set by the service by parsing the - * xml_source. - In create/response: always set - In update request: never - */ - skippedCount: number; - /** - * Number of test cases, typically set by the service by parsing the - * xml_source. - In create/response: always set - In update request: never - */ - totalCount: number; - /** - * If this test suite was parsed from XML, this is the URI where the original - * XML file is stored. Note: Multiple test suites can share the same - * xml_source Returns INVALID_ARGUMENT if the uri format is not supported. - - * In create/response: optional - In update request: never - */ - xmlSource: Schema$FileReference; -} -/** - * Testing timing break down to know phases. - */ -export interface Schema$TestTiming { - /** - * How long it took to run the test process. - In response: present if - * previously set. - In create/update request: optional - */ - testProcessDuration: Schema$Duration; -} -/** - * A single thumbnail, with its size and format. - */ -export interface Schema$Thumbnail { - /** - * The thumbnail's content type, i.e. "image/png". Always set. - */ - contentType: string; - /** - * The thumbnail file itself. That is, the bytes here are precisely the bytes - * that make up the thumbnail file; they can be served as an image as-is (with - * the appropriate content type.) Always set. - */ - data: string; - /** - * The height of the thumbnail, in pixels. Always set. - */ - heightPx: number; +export namespace toolresults_v1beta3 { /** - * The width of the thumbnail, in pixels. Always set. + * Cloud Tool Results API + * + * Reads and publishes results from Firebase Test Lab. + * + * @example + * const google = require('googleapis'); + * const toolresults = google.toolresults('v1beta3'); + * + * @namespace toolresults + * @type {Function} + * @version v1beta3 + * @variation v1beta3 + * @param {object=} options Options for Toolresults */ - widthPx: number; -} -/** - * A Timestamp represents a point in time independent of any time zone or - * calendar, represented as seconds and fractions of seconds at nanosecond - * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian - * Calendar which extends the Gregorian calendar backwards to year one. It is - * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are - * "smeared" so that no leap second table is needed for - * interpretation. Range is from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure that - * we can convert to and from RFC 3339 date strings. See - * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). - * # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp - * timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); Example - * 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval tv; - * gettimeofday(&tv, NULL); Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. FILETIME - * ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = - * (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows - * tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is 11644473600 - * seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); Example 4: Compute - * Timestamp from Java `System.currentTimeMillis()`. long millis = - * System.currentTimeMillis(); Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % - * 1000) * 1000000)).build(); Example 5: Compute Timestamp from current time - * in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON - * Mapping In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format - * is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where - * {year} is always expressed using four digits while {month}, {day}, {hour}, - * {min}, and {sec} are zero-padded to two digits each. The fractional seconds, - * which can go up to 9 digits (i.e. up to 1 nanosecond resolution), are - * optional. The "Z" suffix indicates the timezone ("UTC"); - * the timezone is required. A proto3 JSON serializer should always use UTC (as - * indicated by "Z") when printing the Timestamp type and a proto3 - * JSON parser should be able to accept both UTC and other timezones (as - * indicated by an offset). For example, "2017-01-15T01:30:15.01Z" - * encodes 15.01 seconds past 01:30 UTC on January 15, 2017. In JavaScript, one - * can convert a Date object to this format using the standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] - * method. In Python, a standard `datetime.datetime` object can be converted to - * this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one - * can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Schema$Timestamp { + export class Toolresults { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values that - * count forward in time. Must be from 0 to 999,999,999 inclusive. - */ - nanos: number; + * Android app information. + */ + export interface Schema$AndroidAppInfo { + /** + * The name of the app. Optional + */ + name: string; + /** + * The package name of the app. Required. + */ + packageName: string; + /** + * The internal version code of the app. Optional. + */ + versionCode: string; + /** + * The version name of the app. Optional. + */ + versionName: string; + } /** - * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must - * be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. - */ - seconds: string; -} -/** - * An execution of an arbitrary tool. It could be a test runner or a tool - * copying artifacts or deploying code. - */ -export interface Schema$ToolExecution { + * A test of an Android application that can control an Android component + * independently of its normal lifecycle. See for more information on types + * of Android tests. + */ + export interface Schema$AndroidInstrumentationTest { + /** + * The java package for the test to be executed. Required + */ + testPackageId: string; + /** + * The InstrumentationTestRunner class. Required + */ + testRunnerClass: string; + /** + * Each target must be fully qualified with the package name or class name, + * in one of these formats: - "package package_name" - "class + * package_name.class_name" - "class + * package_name.class_name#method_name" If empty, all targets in the + * module will be run. + */ + testTargets: string[]; + /** + * The flag indicates whether Android Test Orchestrator will be used to run + * test or not. + */ + useOrchestrator: boolean; + } /** - * The full tokenized command line including the program name (equivalent to - * argv in a C program). - In response: present if set by create request - In - * create request: optional - In update request: never set - */ - commandLineArguments: string[]; + * A test of an android application that explores the application on a virtual + * or physical Android device, finding culprits and crashes as it goes. + */ + export interface Schema$AndroidRoboTest { + /** + * The initial activity that should be used to start the app. Optional + */ + appInitialActivity: string; + /** + * The java package for the bootstrap. Optional + */ + bootstrapPackageId: string; + /** + * The runner class for the bootstrap. Optional + */ + bootstrapRunnerClass: string; + /** + * The max depth of the traversal stack Robo can explore. Optional + */ + maxDepth: number; + /** + * The max number of steps/actions Robo can execute. Default is no limit + * (0). Optional + */ + maxSteps: number; + } /** - * Tool execution exit code. This field will be set once the tool has exited. - * - In response: present if set by create/update request - In create request: - * optional - In update request: optional, a FAILED_PRECONDITION error will be - * returned if an exit_code is already set. - */ - exitCode: Schema$ToolExitCode; + * An Android mobile test specification. + */ + export interface Schema$AndroidTest { + /** + * Information about the application under test. + */ + androidAppInfo: Schema$AndroidAppInfo; + /** + * An Android instrumentation test. + */ + androidInstrumentationTest: Schema$AndroidInstrumentationTest; + /** + * An Android robo test. + */ + androidRoboTest: Schema$AndroidRoboTest; + /** + * Max time a test is allowed to run before it is automatically cancelled. + */ + testTimeout: Schema$Duration; + } /** - * References to any plain text logs output the tool execution. This field - * can be set before the tool has exited in order to be able to have access to - * a live view of the logs while the tool is running. The maximum allowed - * number of tool logs per step is 1000. - In response: present if set by - * create/update request - In create request: optional - In update request: - * optional, any value provided will be appended to the existing list - */ - toolLogs: Schema$FileReference[]; + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. Protobuf library + * provides support to pack/unpack Any values in the form of utility functions + * or additional generated methods of the Any type. Example 1: Pack and + * unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if + * (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in + * Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in + * Python. foo = Foo(...) any = Any() any.Pack(foo) ... if + * any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a + * message in Go foo := &pb.Foo{...} any, err := ptypes.MarshalAny(foo) + * ... foo := &pb.Foo{} if err := ptypes.UnmarshalAny(any, foo); err != + * nil { ... } The pack methods provided by protobuf library will by default + * use 'type.googleapis.com/full.type.name' as the type URL and the + * unpack methods only use the fully qualified type name after the last + * '/' in the type URL, for example "foo.bar.com/x/y.z" will + * yield type name "y.z". JSON ==== The JSON representation of an + * `Any` value uses the regular representation of the deserialized, embedded + * message, with an additional field `@type` which contains the type URL. + * Example: package google.profile; message Person { string first_name = 1; + * string last_name = 2; } { "@type": + * "type.googleapis.com/google.profile.Person", + * "firstName": , "lastName": } If the embedded message + * type is well-known and has a custom JSON representation, that + * representation will be embedded adding a field `value` which holds the + * custom JSON in addition to the `@type` field. Example (for message + * [google.protobuf.Duration][]): { "@type": + * "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" } + */ + export interface Schema$Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. The last segment of the URL's path must + * represent the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). In practice, teams + * usually precompile into the binary all types that they expect it to use + * in the context of Any. However, for URLs which use the scheme `http`, + * `https`, or no scheme, one can optionally set up a type server that maps + * type URLs to message definitions as follows: * If no scheme is provided, + * `https` is assumed. * An HTTP GET on the URL must yield a + * [google.protobuf.Type][] value in binary format, or produce an error. * + * Applications are allowed to cache lookup results based on the URL, or + * have them precompiled into a binary to avoid any lookup. Therefore, + * binary compatibility needs to be preserved on changes to types. (Use + * versioned type names to manage breaking changes.) Note: this + * functionality is not currently available in the official protobuf + * release, and it is not used for type URLs beginning with + * type.googleapis.com. Schemes other than `http`, `https` (or the empty + * scheme) might be used with implementation specific semantics. + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + */ + value: string; + } + export interface Schema$AppStartTime { + /** + * Optional. The time from app start to reaching the developer-reported + * "fully drawn" time. This is only stored if the app includes a + * call to Activity.reportFullyDrawn(). See + * https://developer.android.com/topic/performance/launch-time.html#time-full + */ + fullyDrawnTime: Schema$Duration; + /** + * The time from app start to the first displayed activity being drawn, as + * reported in Logcat. See + * https://developer.android.com/topic/performance/launch-time.html#time-initial + */ + initialDisplayTime: Schema$Duration; + } /** - * References to opaque files of any format output by the tool execution. The - * maximum allowed number of tool outputs per step is 1000. - In response: - * present if set by create/update request - In create request: optional - In - * update request: optional, any value provided will be appended to the - * existing list + * Encapsulates the metadata for basic sample series represented by a line + * chart */ - toolOutputs: Schema$ToolOutputReference[]; -} -/** - * Generic tool step to be used for binaries we do not explicitly support. For - * example: running cp to copy artifacts from one location to another. - */ -export interface Schema$ToolExecutionStep { + export interface Schema$BasicPerfSampleSeries { + perfMetricType: string; + perfUnit: string; + sampleSeriesLabel: string; + } /** - * A Tool execution. - In response: present if set by create/update request - - * In create/update request: optional + * The request must provide up to a maximum of 5000 samples to be created; a + * larger sample size will cause an INVALID_ARGUMENT error */ - toolExecution: Schema$ToolExecution; -} -/** - * Exit code from a tool execution. - */ -export interface Schema$ToolExitCode { + export interface Schema$BatchCreatePerfSamplesRequest { + /** + * The set of PerfSamples to create should not include existing timestamps + */ + perfSamples: Schema$PerfSample[]; + } + export interface Schema$BatchCreatePerfSamplesResponse { + perfSamples: Schema$PerfSample[]; + } + export interface Schema$CPUInfo { + /** + * description of the device processor ie '1.8 GHz hexa core 64-bit + * ARMv8-A' + */ + cpuProcessor: string; + /** + * the CPU clock speed in GHz + */ + cpuSpeedInGhz: number; + /** + * the number of CPU cores + */ + numberOfCores: number; + } /** - * Tool execution exit code. A value of 0 means that the execution was - * successful. - In response: always set - In create/update request: always - * set - */ - number: number; -} -/** - * A reference to a ToolExecution output file. - */ -export interface Schema$ToolOutputReference { + * A Duration represents a signed, fixed-length span of time represented as a + * count of seconds and fractions of seconds at nanosecond resolution. It is + * independent of any calendar and concepts like "day" or + * "month". It is related to Timestamp in that the difference + * between two Timestamp values is a Duration and it can be added or + * subtracted from a Timestamp. Range is approximately +-10,000 years. # + * Examples Example 1: Compute Duration from two Timestamps in pseudo code. + * Timestamp start = ...; Timestamp end = ...; Duration duration = ...; + * duration.seconds = end.seconds - start.seconds; duration.nanos = end.nanos + * - start.nanos; if (duration.seconds 0) { duration.seconds += 1; + * duration.nanos -= 1000000000; } else if (durations.seconds > 0 + * && duration.nanos < 0) { duration.seconds -= 1; duration.nanos + * += 1000000000; } Example 2: Compute Timestamp from Timestamp + Duration in + * pseudo code. Timestamp start = ...; Duration duration = ...; Timestamp end + * = ...; end.seconds = start.seconds + duration.seconds; end.nanos = + * start.nanos + duration.nanos; if (end.nanos = 1000000000) { end.seconds += + * 1; end.nanos -= 1000000000; } Example 3: Compute Duration from + * datetime.timedelta in Python. td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() duration.FromTimedelta(td) # JSON Mapping In JSON + * format, the Duration type is encoded as a string rather than an object, + * where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond + * should be expressed in JSON format as "3.000000001s", and 3 + * seconds and 1 microsecond should be expressed in JSON format as + * "3.000001s". + */ + export interface Schema$Duration { + /** + * Signed fractions of a second at nanosecond resolution of the span of + * time. Durations less than one second are represented with a 0 `seconds` + * field and a positive or negative `nanos` field. For durations of one + * second or more, a non-zero value for the `nanos` field must be of the + * same sign as the `seconds` field. Must be from -999,999,999 to + * +999,999,999 inclusive. + */ + nanos: number; + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 to + * +315,576,000,000 inclusive. Note: these bounds are computed from: 60 + * sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: string; + } /** - * The creation time of the file. - In response: present if set by - * create/update request - In create/update request: optional - */ - creationTime: Schema$Timestamp; + * An Execution represents a collection of Steps. For instance, it could + * represent: - a mobile test executed across a range of device configurations + * - a jenkins job with a build step followed by a test step The maximum size + * of an execution message is 1 MiB. An Execution can be updated until its + * state is set to COMPLETE at which point it becomes immutable. + */ + export interface Schema$Execution { + /** + * The time when the Execution status transitioned to COMPLETE. This value + * will be set automatically when state transitions to COMPLETE. - In + * response: set if the execution state is COMPLETE. - In create/update + * request: never set + */ + completionTime: Schema$Timestamp; + /** + * The time when the Execution was created. This value will be set + * automatically when CreateExecution is called. - In response: always set + * - In create/update request: never set + */ + creationTime: Schema$Timestamp; + /** + * A unique identifier within a History for this Execution. Returns + * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In + * response always set - In create/update request: never set + */ + executionId: string; + /** + * Classify the result, for example into SUCCESS or FAILURE - In response: + * present if set by create/update request - In create/update request: + * optional + */ + outcome: Schema$Outcome; + /** + * Lightweight information about execution request. - In response: present + * if set by create - In create: optional - In update: optional + */ + specification: Schema$Specification; + /** + * The initial state is IN_PROGRESS. The only legal state transitions is + * from IN_PROGRESS to COMPLETE. A PRECONDITION_FAILED will be returned if + * an invalid transition is requested. The state can only be set to + * COMPLETE once. A FAILED_PRECONDITION will be returned if the state is set + * to COMPLETE multiple times. If the state is set to COMPLETE, all the + * in-progress steps within the execution will be set as COMPLETE. If the + * outcome of the step is not set, the outcome will be set to INCONCLUSIVE. + * - In response always set - In create/update request: optional + */ + state: string; + /** + * TestExecution Matrix ID that the TestExecutionService uses. - In + * response: present if set by create - In create: optional - In update: + * never set + */ + testExecutionMatrixId: string; + } + export interface Schema$FailureDetail { + /** + * If the failure was severe because the system (app) under test crashed. + */ + crashed: boolean; + /** + * If an app is not installed and thus no test can be run with the app. This + * might be caused by trying to run a test on an unsupported platform. + */ + notInstalled: boolean; + /** + * If a native process (including any other than the app) crashed. + */ + otherNativeCrash: boolean; + /** + * If the test overran some time limit, and that is why it failed. + */ + timedOut: boolean; + /** + * If the robo was unable to crawl the app; perhaps because the app did not + * start. + */ + unableToCrawl: boolean; + } /** - * A FileReference to an output file. - In response: always set - In - * create/update request: always set - */ - output: Schema$FileReference; + * A reference to a file. + */ + export interface Schema$FileReference { + /** + * The URI of a file stored in Google Cloud Storage. For example: + * http://storage.googleapis.com/mybucket/path/to/test.xml or in gsutil + * format: gs://mybucket/path/to/test.xml with version-specific info, + * gs://mybucket/path/to/test.xml#1360383693690000 An INVALID_ARGUMENT + * error will be returned if the URI format is not supported. - In + * response: always set - In create/update request: always set + */ + fileUri: string; + } /** - * The test case to which this output file belongs. - In response: present if - * set by create/update request - In create/update request: optional - */ - testCase: Schema$TestCaseReference; -} - -export class Resource$Projects { - root: Toolresults; - histories: Resource$Projects$Histories; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); - this.histories = new Resource$Projects$Histories(root); + * Graphics statistics for the App. The information is collected from 'adb + * shell dumpsys graphicsstats'. For more info see: + * https://developer.android.com/training/testing/performance.html Statistics + * will only be present for API 23+. + */ + export interface Schema$GraphicsStats { + /** + * Histogram of frame render times. There should be 154 buckets ranging from + * [5ms, 6ms) to [4950ms, infinity) + */ + buckets: Schema$GraphicsStatsBucket[]; + /** + * Total "high input latency" events. + */ + highInputLatencyCount: string; + /** + * Total frames with slow render time. Should be <= total_frames. + */ + jankyFrames: string; + /** + * Total "missed vsync" events. + */ + missedVsyncCount: string; + /** + * 50th percentile frame render time in milliseconds. + */ + p50Millis: string; + /** + * 90th percentile frame render time in milliseconds. + */ + p90Millis: string; + /** + * 95th percentile frame render time in milliseconds. + */ + p95Millis: string; + /** + * 99th percentile frame render time in milliseconds. + */ + p99Millis: string; + /** + * Total "slow bitmap upload" events. + */ + slowBitmapUploadCount: string; + /** + * Total "slow draw" events. + */ + slowDrawCount: string; + /** + * Total "slow UI thread" events. + */ + slowUiThreadCount: string; + /** + * Total frames rendered by package. + */ + totalFrames: string; } - - getRoot() { - return this.root; + export interface Schema$GraphicsStatsBucket { + /** + * Number of frames in the bucket. + */ + frameCount: string; + /** + * Lower bound of render time in milliseconds. + */ + renderMillis: string; } - - /** - * toolresults.projects.getSettings - * @desc Gets the Tool Results settings for a project. May return any of the - * following canonical error codes: - PERMISSION_DENIED - if the user is not - * authorized to read from project - * @alias toolresults.projects.getSettings - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getSettings(params?: any, options?: MethodOptions): - AxiosPromise; - getSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/toolresults/v1beta3/projects/{projectId}/settings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A History represents a sorted list of Executions ordered by the + * start_timestamp_millis field (descending). It can be used to group all the + * Executions of a continuous build. Note that the ordering only operates on + * one-dimension. If a repository has multiple branches, it means that + * multiple histories will need to be used in order to order Executions per + * branch. + */ + export interface Schema$History { + /** + * A short human-readable (plain text) name to display in the UI. Maximum of + * 100 characters. - In response: present if set during create. - In create + * request: optional + */ + displayName: string; + /** + * A unique identifier within a project for this History. Returns + * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In + * response always set - In create request: never set + */ + historyId: string; + /** + * A name to uniquely identify a history within a project. Maximum of 200 + * characters. - In response always set - In create request: always set + */ + name: string; } - - /** - * toolresults.projects.initializeSettings - * @desc Creates resources for settings which have not yet been set. - * Currently, this creates a single resource: a Google Cloud Storage bucket, - * to be used as the default bucket for this project. The bucket is created in - * an FTL-own storage project. Except for in rare cases, calling this method - * in parallel from multiple clients will only create a single bucket. In - * order to avoid unnecessary storage charges, the bucket is configured to - * automatically delete objects older than 90 days. The bucket is created - * with the following permissions: - Owner access for owners of central - * storage project (FTL-owned) - Writer access for owners/editors of customer - * project - Reader access for viewers of customer project The default ACL on - * objects created in the bucket is: - Owner access for owners of central - * storage project - Reader access for owners/editors/viewers of customer - * project See Google Cloud Storage documentation for more details. If there - * is already a default bucket set and the project can access the bucket, this - * call does nothing. However, if the project doesn't have the permission to - * access the bucket or the bucket is deleted, a new bucket will be created. - * May return any canonical error codes, including the following: - - * PERMISSION_DENIED - if the user is not authorized to write to project - Any - * error code raised by Google Cloud Storage - * @alias toolresults.projects.initializeSettings - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - initializeSettings(params?: any, options?: MethodOptions): - AxiosPromise; - initializeSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - initializeSettings( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}:initializeSettings') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An image, with a link to the main image and a thumbnail. + */ + export interface Schema$Image { + /** + * An error explaining why the thumbnail could not be rendered. + */ + error: Schema$Status; + /** + * A reference to the full-size, original image. This is the same as the + * tool_outputs entry for the image under its Step. Always set. + */ + sourceImage: Schema$ToolOutputReference; + /** + * The step to which the image is attached. Always set. + */ + stepId: string; + /** + * The thumbnail. + */ + thumbnail: Schema$Thumbnail; } -} -export class Resource$Projects$Histories { - root: Toolresults; - executions: Resource$Projects$Histories$Executions; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); - this.executions = new Resource$Projects$Histories$Executions(root); + export interface Schema$InconclusiveDetail { + /** + * If the end user aborted the test execution before a pass or fail could be + * determined. For example, the user pressed ctrl-c which sent a kill signal + * to the test runner while the test was running. + */ + abortedByUser: boolean; + /** + * If the test runner could not determine success or failure because the + * test depends on a component other than the system under test which + * failed. For example, a mobile test requires provisioning a device where + * the test executes, and that provisioning can fail. + */ + infrastructureFailure: boolean; } - - getRoot() { - return this.root; + export interface Schema$ListExecutionsResponse { + /** + * Executions. Always set. + */ + executions: Schema$Execution[]; + /** + * A continuation token to resume the query at the next item. Will only be + * set if there are more Executions to fetch. + */ + nextPageToken: string; } - - /** - * toolresults.projects.histories.create - * @desc Creates a History. The returned History will have the id set. May - * return any of the following canonical error codes: - PERMISSION_DENIED - - * if the user is not authorized to write to project - INVALID_ARGUMENT - if - * the request is malformed - NOT_FOUND - if the containing project does not - * exist - * @alias toolresults.projects.histories.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.projectId A Project id. Required. - * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. - * @param {().History} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Response message for HistoryService.List + */ + export interface Schema$ListHistoriesResponse { + /** + * Histories. + */ + histories: Schema$History[]; + /** + * A continuation token to resume the query at the next item. Will only be + * set if there are more histories to fetch. Tokens are valid for up to one + * hour from the time of the first list request. For instance, if you make a + * list request at 1PM and use the token from this first request 10 minutes + * later, the token from this second response will only be valid for 50 + * minutes. + */ + nextPageToken: string; } - - - /** - * toolresults.projects.histories.get - * @desc Gets a History. May return any of the following canonical error - * codes: - PERMISSION_DENIED - if the user is not authorized to read project - * - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the - * History does not exist - * @alias toolresults.projects.histories.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId'], - pathParams: ['historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListPerfSampleSeriesResponse { + /** + * The resulting PerfSampleSeries sorted by id + */ + perfSampleSeries: Schema$PerfSampleSeries[]; } - - - /** - * toolresults.projects.histories.list - * @desc Lists Histories for a given Project. The histories are sorted by - * modification time in descending order. The history_id key will be used to - * order the history with the same modification time. May return any of the - * following canonical error codes: - PERMISSION_DENIED - if the user is not - * authorized to read project - INVALID_ARGUMENT - if the request is malformed - * - NOT_FOUND - if the History does not exist - * @alias toolresults.projects.histories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filterByName If set, only return histories with the given name. Optional. - * @param {integer=} params.pageSize The maximum number of Histories to fetch. Default value: 20. The server will use this default if the field is not set or has a value of 0. Any value greater than 100 will be treated as 100. Optional. - * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId'], - pathParams: ['projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ListPerfSamplesResponse { + /** + * Optional, returned if result size exceeds the page size specified in the + * request (or the default page size, 500, if unspecified). It indicates the + * last sample timestamp to be used as page_token in subsequent request + */ + nextPageToken: string; + perfSamples: Schema$PerfSample[]; } -} -export class Resource$Projects$Histories$Executions { - root: Toolresults; - clusters: Resource$Projects$Histories$Executions$Clusters; - steps: Resource$Projects$Histories$Executions$Steps; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); - this.clusters = new Resource$Projects$Histories$Executions$Clusters(root); - this.steps = new Resource$Projects$Histories$Executions$Steps(root); + export interface Schema$ListScreenshotClustersResponse { + /** + * The set of clusters associated with an execution Always set + */ + clusters: Schema$ScreenshotCluster[]; } - - getRoot() { - return this.root; + /** + * Response message for StepService.List. + */ + export interface Schema$ListStepsResponse { + /** + * A continuation token to resume the query at the next item. If set, + * indicates that there are more steps to read, by calling list again with + * this value in the page_token field. + */ + nextPageToken: string; + /** + * Steps. + */ + steps: Schema$Step[]; } - - /** - * toolresults.projects.histories.executions.create - * @desc Creates an Execution. The returned Execution will have the id set. - * May return any of the following canonical error codes: - PERMISSION_DENIED - * - if the user is not authorized to write to project - INVALID_ARGUMENT - if - * the request is malformed - NOT_FOUND - if the containing History does not - * exist - * @alias toolresults.projects.histories.executions.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. - * @param {().Execution} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'historyId'], - pathParams: ['historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A response containing the thumbnails in a step. + */ + export interface Schema$ListStepThumbnailsResponse { + /** + * A continuation token to resume the query at the next item. If set, + * indicates that there are more thumbnails to read, by calling list again + * with this value in the page_token field. + */ + nextPageToken: string; + /** + * A list of image data. Images are returned in a deterministic order; they + * are ordered by these factors, in order of importance: * First, by their + * associated test case. Images without a test case are considered greater + * than images with one. * Second, by their creation time. Images without a + * creation time are greater than images with one. * Third, by the order in + * which they were added to the step (by calls to CreateStep or UpdateStep). + */ + thumbnails: Schema$Image[]; + } + export interface Schema$MemoryInfo { + /** + * Maximum memory that can be allocated to the process in KiB + */ + memoryCapInKibibyte: string; + /** + * Total memory available on the device in KiB + */ + memoryTotalInKibibyte: string; } - - /** - * toolresults.projects.histories.executions.get - * @desc Gets an Execution. May return any of the following canonical error - * codes: - PERMISSION_DENIED - if the user is not authorized to write to - * project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if - * the Execution does not exist - * @alias toolresults.projects.histories.executions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId An Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId'], - pathParams: ['executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Interprets a result so that humans and machines can act on it. + */ + export interface Schema$Outcome { + /** + * More information about a FAILURE outcome. Returns INVALID_ARGUMENT if + * this field is set but the summary is not FAILURE. Optional + */ + failureDetail: Schema$FailureDetail; + /** + * More information about an INCONCLUSIVE outcome. Returns INVALID_ARGUMENT + * if this field is set but the summary is not INCONCLUSIVE. Optional + */ + inconclusiveDetail: Schema$InconclusiveDetail; + /** + * More information about a SKIPPED outcome. Returns INVALID_ARGUMENT if + * this field is set but the summary is not SKIPPED. Optional + */ + skippedDetail: Schema$SkippedDetail; + /** + * More information about a SUCCESS outcome. Returns INVALID_ARGUMENT if + * this field is set but the summary is not SUCCESS. Optional + */ + successDetail: Schema$SuccessDetail; + /** + * The simplest way to interpret a result. Required + */ + summary: string; } - - /** - * toolresults.projects.histories.executions.list - * @desc Lists Histories for a given Project. The executions are sorted by - * creation_time in descending order. The execution_id key will be used to - * order the executions with the same creation_time. May return any of the - * following canonical error codes: - PERMISSION_DENIED - if the user is not - * authorized to read project - INVALID_ARGUMENT - if the request is malformed - * - NOT_FOUND - if the containing History does not exist - * @alias toolresults.projects.histories.executions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.historyId A History id. Required. - * @param {integer=} params.pageSize The maximum number of Executions to fetch. Default value: 25. The server will use this default if the field is not set or has a value of 0. Optional. - * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId'], - pathParams: ['historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Encapsulates performance environment info + */ + export interface Schema$PerfEnvironment { + /** + * CPU related environment info + */ + cpuInfo: Schema$CPUInfo; + /** + * Memory related environment info + */ + memoryInfo: Schema$MemoryInfo; } - - /** - * toolresults.projects.histories.executions.patch - * @desc Updates an existing Execution with the supplied partial entity. May - * return any of the following canonical error codes: - PERMISSION_DENIED - - * if the user is not authorized to write to project - INVALID_ARGUMENT - if - * the request is malformed - FAILED_PRECONDITION - if the requested state - * transition is illegal - NOT_FOUND - if the containing History does not - * exist - * @alias toolresults.projects.histories.executions.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId Required. - * @param {string} params.historyId Required. - * @param {string} params.projectId A Project id. Required. - * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. - * @param {().Execution} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId'], - pathParams: ['executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A summary of perf metrics collected and performance environment info + */ + export interface Schema$PerfMetricsSummary { + appStartTime: Schema$AppStartTime; + /** + * A tool results execution ID. + */ + executionId: string; + /** + * Graphics statistics for the entire run. Statistics are reset at the + * beginning of the run and collected at the end of the run. + */ + graphicsStats: Schema$GraphicsStats; + /** + * A tool results history ID. + */ + historyId: string; + /** + * Describes the environment in which the performance metrics were collected + */ + perfEnvironment: Schema$PerfEnvironment; + /** + * Set of resource collected + */ + perfMetrics: string[]; + /** + * The cloud project + */ + projectId: string; + /** + * A tool results step ID. + */ + stepId: string; } -} -export class Resource$Projects$Histories$Executions$Clusters { - root: Toolresults; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); + /** + * Resource representing a single performance measure or data point + */ + export interface Schema$PerfSample { + /** + * Timestamp of collection + */ + sampleTime: Schema$Timestamp; + /** + * Value observed + */ + value: number; } - - getRoot() { - return this.root; + /** + * Resource representing a collection of performance samples (or data points) + */ + export interface Schema$PerfSampleSeries { + /** + * Basic series represented by a line chart + */ + basicPerfSampleSeries: Schema$BasicPerfSampleSeries; + /** + * A tool results execution ID. + */ + executionId: string; + /** + * A tool results history ID. + */ + historyId: string; + /** + * The cloud project + */ + projectId: string; + /** + * A sample series id + */ + sampleSeriesId: string; + /** + * A tool results step ID. + */ + stepId: string; } - - /** - * toolresults.projects.histories.executions.clusters.get - * @desc Retrieves a single screenshot cluster by its ID - * @alias toolresults.projects.histories.executions.clusters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.clusterId A Cluster id Required. - * @param {string} params.executionId An Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'clusterId'], - pathParams: ['clusterId', 'executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Per-project settings for the Tool Results service. + */ + export interface Schema$ProjectSettings { + /** + * The name of the Google Cloud Storage bucket to which results are written. + * By default, this is unset. In update request: optional In response: + * optional + */ + defaultBucket: string; + /** + * The name of the project's settings. Always of the form: + * projects/{project-id}/settings In update request: never set In response: + * always set + */ + name: string; } - - /** - * toolresults.projects.histories.executions.clusters.list - * @desc Lists Screenshot Clusters Returns the list of screenshot clusters - * corresponding to an execution. Screenshot clusters are created after the - * execution is finished. Clusters are created from a set of screenshots. - * Between any two screenshots, a matching score is calculated based off their - * metadata that determines how similar they are. Screenshots are placed in - * the cluster that has screens which have the highest matching scores. - * @alias toolresults.projects.histories.executions.clusters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId An Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Request message for StepService.PublishXunitXmlFiles. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId'], - pathParams: ['executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } + export interface Schema$PublishXunitXmlFilesRequest { + /** + * URI of the Xunit XML files to publish. The maximum size of the file this + * reference is pointing to is 50MB. Required. + */ + xunitXmlFiles: Schema$FileReference[]; } -} - -export class Resource$Projects$Histories$Executions$Steps { - root: Toolresults; - perfMetricsSummary: - Resource$Projects$Histories$Executions$Steps$Perfmetricssummary; - perfSampleSeries: - Resource$Projects$Histories$Executions$Steps$Perfsampleseries; - thumbnails: Resource$Projects$Histories$Executions$Steps$Thumbnails; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); - this.perfMetricsSummary = - new Resource$Projects$Histories$Executions$Steps$Perfmetricssummary( - root); - this.perfSampleSeries = - new Resource$Projects$Histories$Executions$Steps$Perfsampleseries(root); - this.thumbnails = - new Resource$Projects$Histories$Executions$Steps$Thumbnails(root); + export interface Schema$Screen { + /** + * File reference of the png file. Required. + */ + fileReference: string; + /** + * Locale of the device that the screenshot was taken on. Required. + */ + locale: string; + /** + * Model of the device that the screenshot was taken on. Required. + */ + model: string; + /** + * OS version of the device that the screenshot was taken on. Required. + */ + version: string; } - - getRoot() { - return this.root; + export interface Schema$ScreenshotCluster { + /** + * A string that describes the activity of every screen in the cluster. + */ + activity: string; + /** + * A unique identifier for the cluster. + */ + clusterId: string; + /** + * A singular screen that represents the cluster as a whole. This screen + * will act as the "cover" of the entire cluster. When users look + * at the clusters, only the key screen from each cluster will be shown. + * Which screen is the key screen is determined by the ClusteringAlgorithm + */ + keyScreen: Schema$Screen; + /** + * Full list of screens. + */ + screens: Schema$Screen[]; + } + export interface Schema$SkippedDetail { + /** + * If the App doesn't support the specific API level. + */ + incompatibleAppVersion: boolean; + /** + * If the App doesn't run on the specific architecture, for example, + * x86. + */ + incompatibleArchitecture: boolean; + /** + * If the requested OS version doesn't run on the specific device model. + */ + incompatibleDevice: boolean; } - - /** - * toolresults.projects.histories.executions.steps.create - * @desc Creates a Step. The returned Step will have the id set. May return - * any of the following canonical error codes: - PERMISSION_DENIED - if the - * user is not authorized to write to project - INVALID_ARGUMENT - if the - * request is malformed - FAILED_PRECONDITION - if the step is too large (more - * than 10Mib) - NOT_FOUND - if the containing Execution does not exist - * @alias toolresults.projects.histories.executions.steps.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. - * @param {().Step} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The details about how to run the execution. */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId'], - pathParams: ['executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$Specification { + /** + * An Android mobile test execution specification. + */ + androidTest: Schema$AndroidTest; } - - /** - * toolresults.projects.histories.executions.steps.get - * @desc Gets a Step. May return any of the following canonical error codes: - * - PERMISSION_DENIED - if the user is not authorized to read project - - * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Step - * does not exist - * @alias toolresults.projects.histories.executions.steps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {string} params.stepId A Step id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A stacktrace. + */ + export interface Schema$StackTrace { + /** + * Exception cluster ID + */ + clusterId: string; + /** + * The stack trace message. Required + */ + exception: string; + /** + * Exception report ID + */ + reportId: string; } - - /** - * toolresults.projects.histories.executions.steps.getPerfMetricsSummary - * @desc Retrieves a PerfMetricsSummary. May return any of the following - * error code(s): - NOT_FOUND - The specified PerfMetricsSummary does not - * exist - * @alias - * toolresults.projects.histories.executions.steps.getPerfMetricsSummary - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.stepId A tool results step ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getPerfMetricsSummary(params?: any, options?: MethodOptions): - AxiosPromise; - getPerfMetricsSummary( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - getPerfMetricsSummary( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of [google.rpc.Code][], but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside batch + * response, one for each error sub-response. - Asynchronous operations. If + * an API call embeds asynchronous operation results in its response, the + * status of those operations should be represented directly using the + * `Status` message. - Logging. If some API errors are stored in logs, the + * message `Status` could be used directly after any stripping needed for + * security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of [google.rpc.Code][]. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set of + * message types for APIs to use. + */ + details: Schema$Any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * [google.rpc.Status.details][] field, or localized by the client. + */ + message: string; } - - /** - * toolresults.projects.histories.executions.steps.list - * @desc Lists Steps for a given Execution. The steps are sorted by - * creation_time in descending order. The step_id key will be used to order - * the steps with the same creation_time. May return any of the following - * canonical error codes: - PERMISSION_DENIED - if the user is not authorized - * to read project - INVALID_ARGUMENT - if the request is malformed - - * FAILED_PRECONDITION - if an argument in the request happens to be invalid; - * e.g. if an attempt is made to list the children of a nonexistent Step - - * NOT_FOUND - if the containing Execution does not exist - * @alias toolresults.projects.histories.executions.steps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {integer=} params.pageSize The maximum number of Steps to fetch. Default value: 25. The server will use this default if the field is not set or has a value of 0. Optional. - * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. - * @param {string} params.projectId A Project id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId'], - pathParams: ['executionId', 'historyId', 'projectId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A Step represents a single operation performed as part of Execution. A step + * can be used to represent the execution of a tool ( for example a test + * runner execution or an execution of a compiler). Steps can overlap (for + * instance two steps might have the same start time if some operations are + * done in parallel). Here is an example, let's consider that we have a + * continuous build is executing a test runner for each iteration. The + * workflow would look like: - user creates a Execution with id 1 - user + * creates an TestExecutionStep with id 100 for Execution 1 - user update + * TestExecutionStep with id 100 to add a raw xml log + the service parses the + * xml logs and returns a TestExecutionStep with updated TestResult(s). - user + * update the status of TestExecutionStep with id 100 to COMPLETE A Step can + * be updated until its state is set to COMPLETE at which points it becomes + * immutable. + */ + export interface Schema$Step { + /** + * The time when the step status was set to complete. This value will be + * set automatically when state transitions to COMPLETE. - In response: set + * if the execution state is COMPLETE. - In create/update request: never set + */ + completionTime: Schema$Timestamp; + /** + * The time when the step was created. - In response: always set - In + * create/update request: never set + */ + creationTime: Schema$Timestamp; + /** + * A description of this tool For example: mvn clean package -D + * skipTests=true - In response: present if set by create/update request - + * In create/update request: optional + */ + description: string; + /** + * How much the device resource is used to perform the test. This is the + * device usage used for billing purpose, which is different from the + * run_duration, for example, infrastructure failure won't be charged + * for device usage. PRECONDITION_FAILED will be returned if one attempts + * to set a device_usage on a step which already has this field set. - In + * response: present if previously set. - In create request: optional - In + * update request: optional + */ + deviceUsageDuration: Schema$Duration; + /** + * If the execution containing this step has any dimension_definition set, + * then this field allows the child to specify the values of the dimensions. + * The keys must exactly match the dimension_definition of the execution. + * For example, if the execution has `dimension_definition = + * ['attempt', 'device']` then a step must define values for + * those dimensions, eg. `dimension_value = ['attempt': '1', + * 'device': 'Nexus 6']` If a step does not participate in + * one dimension of the matrix, the value for that dimension should be empty + * string. For example, if one of the tests is executed by a runner which + * does not support retries, the step could have `dimension_value = + * ['attempt': '', 'device': 'Nexus 6']` If + * the step does not participate in any dimensions of the matrix, it may + * leave dimension_value unset. A PRECONDITION_FAILED will be returned if + * any of the keys do not exist in the dimension_definition of the + * execution. A PRECONDITION_FAILED will be returned if another step in + * this execution already has the same name and dimension_value, but differs + * on other data fields, for example, step field is different. A + * PRECONDITION_FAILED will be returned if dimension_value is set, and there + * is a dimension_definition in the execution which is not specified as one + * of the keys. - In response: present if set by create - In create + * request: optional - In update request: never set + */ + dimensionValue: Schema$StepDimensionValueEntry[]; + /** + * Whether any of the outputs of this step are images whose thumbnails can + * be fetched with ListThumbnails. - In response: always set - In + * create/update request: never set + */ + hasImages: boolean; + /** + * Arbitrary user-supplied key/value pairs that are associated with the + * step. Users are responsible for managing the key namespace such that + * keys don't accidentally collide. An INVALID_ARGUMENT will be + * returned if the number of labels exceeds 100 or if the length of any of + * the keys or values exceeds 100 characters. - In response: always set - + * In create request: optional - In update request: optional; any new + * key/value pair will be added to the map, and any new value for an + * existing key will update that key's value + */ + labels: Schema$StepLabelsEntry[]; + /** + * A short human-readable name to display in the UI. Maximum of 100 + * characters. For example: Clean build A PRECONDITION_FAILED will be + * returned upon creating a new step if it shares its name and + * dimension_value with an existing step. If two steps represent a similar + * action, but have different dimension values, they should share the same + * name. For instance, if the same set of tests is run on two different + * platforms, the two steps should have the same name. - In response: + * always set - In create request: always set - In update request: never set + */ + name: string; + /** + * Classification of the result, for example into SUCCESS or FAILURE - In + * response: present if set by create/update request - In create/update + * request: optional + */ + outcome: Schema$Outcome; + /** + * How long it took for this step to run. If unset, this is set to the + * difference between creation_time and completion_time when the step is set + * to the COMPLETE state. In some cases, it is appropriate to set this value + * separately: For instance, if a step is created, but the operation it + * represents is queued for a few minutes before it executes, it would be + * appropriate not to include the time spent queued in its run_duration. + * PRECONDITION_FAILED will be returned if one attempts to set a + * run_duration on a step which already has this field set. - In response: + * present if previously set; always present on COMPLETE step - In create + * request: optional - In update request: optional + */ + runDuration: Schema$Duration; + /** + * The initial state is IN_PROGRESS. The only legal state transitions are * + * IN_PROGRESS -> COMPLETE A PRECONDITION_FAILED will be returned if an + * invalid transition is requested. It is valid to create Step with a state + * set to COMPLETE. The state can only be set to COMPLETE once. A + * PRECONDITION_FAILED will be returned if the state is set to COMPLETE + * multiple times. - In response: always set - In create/update request: + * optional + */ + state: string; + /** + * A unique identifier within a Execution for this Step. Returns + * INVALID_ARGUMENT if this field is set or overwritten by the caller. - In + * response: always set - In create/update request: never set + */ + stepId: string; + /** + * An execution of a test runner. + */ + testExecutionStep: Schema$TestExecutionStep; + /** + * An execution of a tool (used for steps we don't explicitly support). + */ + toolExecutionStep: Schema$ToolExecutionStep; + } + export interface Schema$StepDimensionValueEntry { + key: string; + value: string; + } + export interface Schema$StepLabelsEntry { + key: string; + value: string; + } + export interface Schema$SuccessDetail { + /** + * If a native process other than the app crashed. + */ + otherNativeCrash: boolean; } - - /** - * toolresults.projects.histories.executions.steps.patch - * @desc Updates an existing Step with the supplied partial entity. May - * return any of the following canonical error codes: - PERMISSION_DENIED - - * if the user is not authorized to write project - INVALID_ARGUMENT - if the - * request is malformed - FAILED_PRECONDITION - if the requested state - * transition is illegal (e.g try to upload a duplicate xml file), if the - * updated step is too large (more than 10Mib) - NOT_FOUND - if the containing - * Execution does not exist - * @alias toolresults.projects.histories.executions.steps.patch - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. - * @param {string} params.stepId A Step id. Required. - * @param {().Step} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - patch(params?: any, options?: MethodOptions): AxiosPromise; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - patch( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PATCH' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A reference to a test case. Test case references are canonically ordered + * lexicographically by these three factors: * First, by test_suite_name. * + * Second, by class_name. * Third, by name. + */ + export interface Schema$TestCaseReference { + /** + * The name of the class. + */ + className: string; + /** + * The name of the test case. Required. + */ + name: string; + /** + * The name of the test suite to which this test case belongs. + */ + testSuiteName: string; } - - /** - * toolresults.projects.histories.executions.steps.publishXunitXmlFiles - * @desc Publish xml files to an existing Step. May return any of the - * following canonical error codes: - PERMISSION_DENIED - if the user is not - * authorized to write project - INVALID_ARGUMENT - if the request is - * malformed - FAILED_PRECONDITION - if the requested state transition is - * illegal, e.g try to upload a duplicate xml file or a file too large. - - * NOT_FOUND - if the containing Execution does not exist - * @alias toolresults.projects.histories.executions.steps.publishXunitXmlFiles - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {string} params.projectId A Project id. Required. - * @param {string} params.stepId A Step id. Note: This step must include a TestExecutionStep. Required. - * @param {().PublishXunitXmlFilesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - publishXunitXmlFiles(params?: any, options?: MethodOptions): - AxiosPromise; - publishXunitXmlFiles( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - publishXunitXmlFiles( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}:publishXunitXmlFiles') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * A step that represents running tests. It accepts ant-junit xml files which + * will be parsed into structured test results by the service. Xml file paths + * are updated in order to append more files, however they can't be + * deleted. Users can also add test results manually by using the test_result + * field. + */ + export interface Schema$TestExecutionStep { + /** + * Issues observed during the test execution. For example, if the mobile + * app under test crashed during the test, the error message and the stack + * trace content can be recorded here to assist debugging. - In response: + * present if set by create or update - In create/update request: optional + */ + testIssues: Schema$TestIssue[]; + /** + * List of test suite overview contents. This could be parsed from xUnit XML + * log by server, or uploaded directly by user. This references should only + * be called when test suites are fully parsed or uploaded. The maximum + * allowed number of test suite overviews per step is 1000. - In response: + * always set - In create request: optional - In update request: never (use + * publishXunitXmlFiles custom method instead) + */ + testSuiteOverviews: Schema$TestSuiteOverview[]; + /** + * The timing break down of the test execution. - In response: present if + * set by create or update - In create/update request: optional + */ + testTiming: Schema$TestTiming; + /** + * Represents the execution of the test runner. The exit code of this tool + * will be used to determine if the test passed. - In response: always set + * - In create/update request: optional + */ + toolExecution: Schema$ToolExecution; } -} -export class Resource$Projects$Histories$Executions$Steps$Perfmetricssummary { - root: Toolresults; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); + /** + * An issue detected occurring during a test execution. + */ + export interface Schema$TestIssue { + /** + * A brief human-readable message describing the issue. Required. + */ + errorMessage: string; + /** + * Severity of issue. Required. + */ + severity: string; + /** + * Deprecated in favor of stack trace fields inside specific warnings. + */ + stackTrace: Schema$StackTrace; + /** + * Type of issue. Required. + */ + type: string; + /** + * Warning message with additional details of the issue. Should always be a + * message from com.google.devtools.toolresults.v1.warnings + */ + warning: Schema$Any; } - - getRoot() { - return this.root; + /** + * A summary of a test suite result either parsed from XML or uploaded + * directly by a user. Note: the API related comments are for StepService + * only. This message is also being used in ExecutionService in a read only + * mode for the corresponding step. + */ + export interface Schema$TestSuiteOverview { + /** + * Number of test cases in error, typically set by the service by parsing + * the xml_source. - In create/response: always set - In update request: + * never + */ + errorCount: number; + /** + * Number of failed test cases, typically set by the service by parsing the + * xml_source. May also be set by the user. - In create/response: always + * set - In update request: never + */ + failureCount: number; + /** + * The name of the test suite. - In create/response: always set - In update + * request: never + */ + name: string; + /** + * Number of test cases not run, typically set by the service by parsing the + * xml_source. - In create/response: always set - In update request: never + */ + skippedCount: number; + /** + * Number of test cases, typically set by the service by parsing the + * xml_source. - In create/response: always set - In update request: never + */ + totalCount: number; + /** + * If this test suite was parsed from XML, this is the URI where the + * original XML file is stored. Note: Multiple test suites can share the + * same xml_source Returns INVALID_ARGUMENT if the uri format is not + * supported. - In create/response: optional - In update request: never + */ + xmlSource: Schema$FileReference; } - - /** - * toolresults.projects.histories.executions.steps.perfMetricsSummary.create - * @desc Creates a PerfMetricsSummary resource. Returns the existing one if it - * has already been created. May return any of the following error code(s): - - * NOT_FOUND - The containing Step does not exist - * @alias - * toolresults.projects.histories.executions.steps.perfMetricsSummary.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.stepId A tool results step ID. - * @param {().PerfMetricsSummary} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Testing timing break down to know phases. */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$TestTiming { + /** + * How long it took to run the test process. - In response: present if + * previously set. - In create/update request: optional + */ + testProcessDuration: Schema$Duration; } -} - -export class Resource$Projects$Histories$Executions$Steps$Perfsampleseries { - root: Toolresults; - samples: - Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); - this.samples = - new Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples( - root); + /** + * A single thumbnail, with its size and format. + */ + export interface Schema$Thumbnail { + /** + * The thumbnail's content type, i.e. "image/png". Always + * set. + */ + contentType: string; + /** + * The thumbnail file itself. That is, the bytes here are precisely the + * bytes that make up the thumbnail file; they can be served as an image + * as-is (with the appropriate content type.) Always set. + */ + data: string; + /** + * The height of the thumbnail, in pixels. Always set. + */ + heightPx: number; + /** + * The width of the thumbnail, in pixels. Always set. + */ + widthPx: number; } - - getRoot() { - return this.root; + /** + * A Timestamp represents a point in time independent of any time zone or + * calendar, represented as seconds and fractions of seconds at nanosecond + * resolution in UTC Epoch time. It is encoded using the Proleptic Gregorian + * Calendar which extends the Gregorian calendar backwards to year one. It is + * encoded assuming all minutes are 60 seconds long, i.e. leap seconds are + * "smeared" so that no leap second table is needed for + * interpretation. Range is from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59.999999999Z. By restricting to that range, we ensure + * that we can convert to and from RFC 3339 date strings. See + * [https://www.ietf.org/rfc/rfc3339.txt](https://www.ietf.org/rfc/rfc3339.txt). + * # Examples Example 1: Compute Timestamp from POSIX `time()`. Timestamp + * timestamp; timestamp.set_seconds(time(NULL)); timestamp.set_nanos(0); + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. struct timeval + * tv; gettimeofday(&tv, NULL); Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); timestamp.set_nanos(tv.tv_usec * 1000); + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * FILETIME ft; GetSystemTimeAsFileTime(&ft); UINT64 ticks = + * (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; // A Windows + * tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z // is + * 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. Timestamp + * timestamp; timestamp.set_seconds((INT64) ((ticks / 10000000) - + * 11644473600LL)); timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. long + * millis = System.currentTimeMillis(); Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(millis / 1000) .setNanos((int) ((millis % + * 1000) * 1000000)).build(); Example 5: Compute Timestamp from current + * time in Python. timestamp = Timestamp() timestamp.GetCurrentTime() # JSON + * Mapping In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone + * ("UTC"); the timezone is required. A proto3 JSON serializer + * should always use UTC (as indicated by "Z") when printing the + * Timestamp type and a proto3 JSON parser should be able to accept both UTC + * and other timezones (as indicated by an offset). For example, + * "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on + * January 15, 2017. In JavaScript, one can convert a Date object to this + * format using the standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString] + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) + * with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in + * Java, one can use the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime-- + * ) to obtain a formatter capable of generating timestamps in this format. + */ + export interface Schema$Timestamp { + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 inclusive. + */ + nanos: number; + /** + * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. + * Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. + */ + seconds: string; } - - /** - * toolresults.projects.histories.executions.steps.perfSampleSeries.create - * @desc Creates a PerfSampleSeries. May return any of the following error - * code(s): - ALREADY_EXISTS - PerfMetricSummary already exists for the given - * Step - NOT_FOUND - The containing Step does not exist - * @alias - * toolresults.projects.histories.executions.steps.perfSampleSeries.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.stepId A tool results step ID. - * @param {().PerfSampleSeries} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * An execution of an arbitrary tool. It could be a test runner or a tool + * copying artifacts or deploying code. + */ + export interface Schema$ToolExecution { + /** + * The full tokenized command line including the program name (equivalent to + * argv in a C program). - In response: present if set by create request - + * In create request: optional - In update request: never set + */ + commandLineArguments: string[]; + /** + * Tool execution exit code. This field will be set once the tool has + * exited. - In response: present if set by create/update request - In + * create request: optional - In update request: optional, a + * FAILED_PRECONDITION error will be returned if an exit_code is already + * set. + */ + exitCode: Schema$ToolExitCode; + /** + * References to any plain text logs output the tool execution. This field + * can be set before the tool has exited in order to be able to have access + * to a live view of the logs while the tool is running. The maximum + * allowed number of tool logs per step is 1000. - In response: present if + * set by create/update request - In create request: optional - In update + * request: optional, any value provided will be appended to the existing + * list + */ + toolLogs: Schema$FileReference[]; + /** + * References to opaque files of any format output by the tool execution. + * The maximum allowed number of tool outputs per step is 1000. - In + * response: present if set by create/update request - In create request: + * optional - In update request: optional, any value provided will be + * appended to the existing list + */ + toolOutputs: Schema$ToolOutputReference[]; } - - /** - * toolresults.projects.histories.executions.steps.perfSampleSeries.get - * @desc Gets a PerfSampleSeries. May return any of the following error - * code(s): - NOT_FOUND - The specified PerfSampleSeries does not exist - * @alias toolresults.projects.histories.executions.steps.perfSampleSeries.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.sampleSeriesId A sample series id - * @param {string} params.stepId A tool results step ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Generic tool step to be used for binaries we do not explicitly support. For + * example: running cp to copy artifacts from one location to another. */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId'], - pathParams: - ['executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ToolExecutionStep { + /** + * A Tool execution. - In response: present if set by create/update request + * - In create/update request: optional + */ + toolExecution: Schema$ToolExecution; } - - /** - * toolresults.projects.histories.executions.steps.perfSampleSeries.list - * @desc Lists PerfSampleSeries for a given Step. The request provides an - * optional filter which specifies one or more PerfMetricsType to include in - * the result; if none returns all. The resulting PerfSampleSeries are sorted - * by ids. May return any of the following canonical error codes: - NOT_FOUND - * - The containing Step does not exist - * @alias - * toolresults.projects.histories.executions.steps.perfSampleSeries.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string=} params.filter Specify one or more PerfMetricType values such as CPU to filter the result - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.stepId A tool results step ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Exit code from a tool execution. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ToolExitCode { + /** + * Tool execution exit code. A value of 0 means that the execution was + * successful. - In response: always set - In create/update request: always + * set + */ + number: number; } -} -export class - Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples { - root: Toolresults; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); + /** + * A reference to a ToolExecution output file. + */ + export interface Schema$ToolOutputReference { + /** + * The creation time of the file. - In response: present if set by + * create/update request - In create/update request: optional + */ + creationTime: Schema$Timestamp; + /** + * A FileReference to an output file. - In response: always set - In + * create/update request: always set + */ + output: Schema$FileReference; + /** + * The test case to which this output file belongs. - In response: present + * if set by create/update request - In create/update request: optional + */ + testCase: Schema$TestCaseReference; } - getRoot() { - return this.root; + export class Resource$Projects { + root: Toolresults; + histories: Resource$Projects$Histories; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + this.histories = new Resource$Projects$Histories(root); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.getSettings + * @desc Gets the Tool Results settings for a project. May return any of + * the following canonical error codes: - PERMISSION_DENIED - if the user + * is not authorized to read from project + * @alias toolresults.projects.getSettings + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getSettings(params?: any, options?: MethodOptions): + AxiosPromise; + getSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/settings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.initializeSettings + * @desc Creates resources for settings which have not yet been set. + * Currently, this creates a single resource: a Google Cloud Storage bucket, + * to be used as the default bucket for this project. The bucket is created + * in an FTL-own storage project. Except for in rare cases, calling this + * method in parallel from multiple clients will only create a single + * bucket. In order to avoid unnecessary storage charges, the bucket is + * configured to automatically delete objects older than 90 days. The + * bucket is created with the following permissions: - Owner access for + * owners of central storage project (FTL-owned) - Writer access for + * owners/editors of customer project - Reader access for viewers of + * customer project The default ACL on objects created in the bucket is: - + * Owner access for owners of central storage project - Reader access for + * owners/editors/viewers of customer project See Google Cloud Storage + * documentation for more details. If there is already a default bucket set + * and the project can access the bucket, this call does nothing. However, + * if the project doesn't have the permission to access the bucket or the + * bucket is deleted, a new bucket will be created. May return any + * canonical error codes, including the following: - PERMISSION_DENIED - if + * the user is not authorized to write to project - Any error code raised by + * Google Cloud Storage + * @alias toolresults.projects.initializeSettings + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + initializeSettings(params?: any, options?: MethodOptions): + AxiosPromise; + initializeSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + initializeSettings( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}:initializeSettings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - - /** - * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate - * @desc Creates a batch of PerfSamples - a client can submit multiple batches - * of Perf Samples through repeated calls to this method in order to split up - * a large request payload - duplicates and existing timestamp entries will be - * ignored. - the batch operation may partially succeed - the set of elements - * successfully inserted is returned in the response (omits items which - * already existed in the database). May return any of the following - * canonical error codes: - NOT_FOUND - The containing PerfSampleSeries does - * not exist - * @alias - * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {string} params.projectId The cloud project - * @param {string} params.sampleSeriesId A sample series id - * @param {string} params.stepId A tool results step ID. - * @param {().BatchCreatePerfSamplesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - batchCreate(params?: any, options?: MethodOptions): - AxiosPromise; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - batchCreate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Histories { + root: Toolresults; + executions: Resource$Projects$Histories$Executions; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + this.executions = new Resource$Projects$Histories$Executions(root); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.create + * @desc Creates a History. The returned History will have the id set. May + * return any of the following canonical error codes: - PERMISSION_DENIED - + * if the user is not authorized to write to project - INVALID_ARGUMENT - if + * the request is malformed - NOT_FOUND - if the containing project does not + * exist + * @alias toolresults.projects.histories.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.projectId A Project id. Required. + * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. + * @param {().History} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.get + * @desc Gets a History. May return any of the following canonical error + * codes: - PERMISSION_DENIED - if the user is not authorized to read + * project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if + * the History does not exist + * @alias toolresults.projects.histories.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId'], + pathParams: ['historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.list + * @desc Lists Histories for a given Project. The histories are sorted by + * modification time in descending order. The history_id key will be used to + * order the history with the same modification time. May return any of the + * following canonical error codes: - PERMISSION_DENIED - if the user is + * not authorized to read project - INVALID_ARGUMENT - if the request is + * malformed - NOT_FOUND - if the History does not exist + * @alias toolresults.projects.histories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filterByName If set, only return histories with the given name. Optional. + * @param {integer=} params.pageSize The maximum number of Histories to fetch. Default value: 20. The server will use this default if the field is not set or has a value of 0. Any value greater than 100 will be treated as 100. Optional. + * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId'], + pathParams: ['projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Histories$Executions { + root: Toolresults; + clusters: Resource$Projects$Histories$Executions$Clusters; + steps: Resource$Projects$Histories$Executions$Steps; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + this.clusters = new Resource$Projects$Histories$Executions$Clusters(root); + this.steps = new Resource$Projects$Histories$Executions$Steps(root); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.create + * @desc Creates an Execution. The returned Execution will have the id set. + * May return any of the following canonical error codes: - + * PERMISSION_DENIED - if the user is not authorized to write to project - + * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the + * containing History does not exist + * @alias toolresults.projects.histories.executions.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. + * @param {().Execution} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'historyId'], + pathParams: ['historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.get + * @desc Gets an Execution. May return any of the following canonical error + * codes: - PERMISSION_DENIED - if the user is not authorized to write to + * project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if + * the Execution does not exist + * @alias toolresults.projects.histories.executions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId An Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId'], + pathParams: ['executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.list + * @desc Lists Histories for a given Project. The executions are sorted by + * creation_time in descending order. The execution_id key will be used to + * order the executions with the same creation_time. May return any of the + * following canonical error codes: - PERMISSION_DENIED - if the user is + * not authorized to read project - INVALID_ARGUMENT - if the request is + * malformed - NOT_FOUND - if the containing History does not exist + * @alias toolresults.projects.histories.executions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.historyId A History id. Required. + * @param {integer=} params.pageSize The maximum number of Executions to fetch. Default value: 25. The server will use this default if the field is not set or has a value of 0. Optional. + * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId'], + pathParams: ['historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.patch + * @desc Updates an existing Execution with the supplied partial entity. May + * return any of the following canonical error codes: - PERMISSION_DENIED - + * if the user is not authorized to write to project - INVALID_ARGUMENT - if + * the request is malformed - FAILED_PRECONDITION - if the requested state + * transition is illegal - NOT_FOUND - if the containing History does not + * exist + * @alias toolresults.projects.histories.executions.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId Required. + * @param {string} params.historyId Required. + * @param {string} params.projectId A Project id. Required. + * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. + * @param {().Execution} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId'], + pathParams: ['executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples:batchCreate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: - ['projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId'], - pathParams: - ['executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + } + export class Resource$Projects$Histories$Executions$Clusters { + root: Toolresults; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.clusters.get + * @desc Retrieves a single screenshot cluster by its ID + * @alias toolresults.projects.histories.executions.clusters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.clusterId A Cluster id Required. + * @param {string} params.executionId An Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters/{clusterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'clusterId'], + pathParams: ['clusterId', 'executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.clusters.list + * @desc Lists Screenshot Clusters Returns the list of screenshot clusters + * corresponding to an execution. Screenshot clusters are created after the + * execution is finished. Clusters are created from a set of screenshots. + * Between any two screenshots, a matching score is calculated based off + * their metadata that determines how similar they are. Screenshots are + * placed in the cluster that has screens which have the highest matching + * scores. + * @alias toolresults.projects.histories.executions.clusters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId An Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/clusters') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId'], + pathParams: ['executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } - - /** - * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.list - * @desc Lists the Performance Samples of a given Sample Series - The list - * results are sorted by timestamps ascending - The default page size is 500 - * samples; and maximum size allowed 5000 - The response token indicates the - * last returned PerfSample timestamp - When the results size exceeds the page - * size, submit a subsequent request including the page token to return the - * rest of the samples up to the page limit May return any of the following - * canonical error codes: - OUT_OF_RANGE - The specified request page_token is - * out of valid range - NOT_FOUND - The containing PerfSampleSeries does not - * exist - * @alias - * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId A tool results execution ID. - * @param {string} params.historyId A tool results history ID. - * @param {integer=} params.pageSize The default page size is 500 samples, and the maximum size is 5000. If the page_size is greater than 5000, the effective page size will be 5000 - * @param {string=} params.pageToken Optional, the next_page_token returned in the previous response - * @param {string} params.projectId The cloud project - * @param {string} params.sampleSeriesId A sample series id - * @param {string} params.stepId A tool results step ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Histories$Executions$Steps { + root: Toolresults; + perfMetricsSummary: + Resource$Projects$Histories$Executions$Steps$Perfmetricssummary; + perfSampleSeries: + Resource$Projects$Histories$Executions$Steps$Perfsampleseries; + thumbnails: Resource$Projects$Histories$Executions$Steps$Thumbnails; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + this.perfMetricsSummary = + new Resource$Projects$Histories$Executions$Steps$Perfmetricssummary( + root); + this.perfSampleSeries = + new Resource$Projects$Histories$Executions$Steps$Perfsampleseries( + root); + this.thumbnails = + new Resource$Projects$Histories$Executions$Steps$Thumbnails(root); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.steps.create + * @desc Creates a Step. The returned Step will have the id set. May + * return any of the following canonical error codes: - PERMISSION_DENIED - + * if the user is not authorized to write to project - INVALID_ARGUMENT - if + * the request is malformed - FAILED_PRECONDITION - if the step is too large + * (more than 10Mib) - NOT_FOUND - if the containing Execution does not + * exist + * @alias toolresults.projects.histories.executions.steps.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. + * @param {().Step} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId'], + pathParams: ['executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.get + * @desc Gets a Step. May return any of the following canonical error + * codes: - PERMISSION_DENIED - if the user is not authorized to read + * project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if + * the Step does not exist + * @alias toolresults.projects.histories.executions.steps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {string} params.stepId A Step id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.getPerfMetricsSummary + * @desc Retrieves a PerfMetricsSummary. May return any of the following + * error code(s): - NOT_FOUND - The specified PerfMetricsSummary does not + * exist + * @alias + * toolresults.projects.histories.executions.steps.getPerfMetricsSummary + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.stepId A tool results step ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getPerfMetricsSummary(params?: any, options?: MethodOptions): + AxiosPromise; + getPerfMetricsSummary( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + getPerfMetricsSummary( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.list + * @desc Lists Steps for a given Execution. The steps are sorted by + * creation_time in descending order. The step_id key will be used to order + * the steps with the same creation_time. May return any of the following + * canonical error codes: - PERMISSION_DENIED - if the user is not + * authorized to read project - INVALID_ARGUMENT - if the request is + * malformed - FAILED_PRECONDITION - if an argument in the request happens + * to be invalid; e.g. if an attempt is made to list the children of a + * nonexistent Step - NOT_FOUND - if the containing Execution does not exist + * @alias toolresults.projects.histories.executions.steps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {integer=} params.pageSize The maximum number of Steps to fetch. Default value: 25. The server will use this default if the field is not set or has a value of 0. Optional. + * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. + * @param {string} params.projectId A Project id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId'], + pathParams: ['executionId', 'historyId', 'projectId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.patch + * @desc Updates an existing Step with the supplied partial entity. May + * return any of the following canonical error codes: - PERMISSION_DENIED - + * if the user is not authorized to write project - INVALID_ARGUMENT - if + * the request is malformed - FAILED_PRECONDITION - if the requested state + * transition is illegal (e.g try to upload a duplicate xml file), if the + * updated step is too large (more than 10Mib) - NOT_FOUND - if the + * containing Execution does not exist + * @alias toolresults.projects.histories.executions.steps.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {string=} params.requestId A unique request ID for server to detect duplicated requests. For example, a UUID. Optional, but strongly recommended. + * @param {string} params.stepId A Step id. Required. + * @param {().Step} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): AxiosPromise; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.publishXunitXmlFiles + * @desc Publish xml files to an existing Step. May return any of the + * following canonical error codes: - PERMISSION_DENIED - if the user is + * not authorized to write project - INVALID_ARGUMENT - if the request is + * malformed - FAILED_PRECONDITION - if the requested state transition is + * illegal, e.g try to upload a duplicate xml file or a file too large. - + * NOT_FOUND - if the containing Execution does not exist + * @alias + * toolresults.projects.histories.executions.steps.publishXunitXmlFiles + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {string} params.projectId A Project id. Required. + * @param {string} params.stepId A Step id. Note: This step must include a TestExecutionStep. Required. + * @param {().PublishXunitXmlFilesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + publishXunitXmlFiles(params?: any, options?: MethodOptions): + AxiosPromise; + publishXunitXmlFiles( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + publishXunitXmlFiles( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}:publishXunitXmlFiles') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: - ['projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId'], - pathParams: - ['executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + } + export class Resource$Projects$Histories$Executions$Steps$Perfmetricssummary { + root: Toolresults; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.steps.perfMetricsSummary.create + * @desc Creates a PerfMetricsSummary resource. Returns the existing one if + * it has already been created. May return any of the following error + * code(s): - NOT_FOUND - The containing Step does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfMetricsSummary.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.stepId A tool results step ID. + * @param {().PerfMetricsSummary} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfMetricsSummary') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } -} - -export class Resource$Projects$Histories$Executions$Steps$Thumbnails { - root: Toolresults; - constructor(root: Toolresults) { - this.root = root; - this.getRoot.bind(this); + export class Resource$Projects$Histories$Executions$Steps$Perfsampleseries { + root: Toolresults; + samples: + Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + this.samples = + new Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples( + root); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.steps.perfSampleSeries.create + * @desc Creates a PerfSampleSeries. May return any of the following error + * code(s): - ALREADY_EXISTS - PerfMetricSummary already exists for the + * given Step - NOT_FOUND - The containing Step does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfSampleSeries.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.stepId A tool results step ID. + * @param {().PerfSampleSeries} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.perfSampleSeries.get + * @desc Gets a PerfSampleSeries. May return any of the following error + * code(s): - NOT_FOUND - The specified PerfSampleSeries does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfSampleSeries.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.sampleSeriesId A sample series id + * @param {string} params.stepId A tool results step ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [ + 'projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId' + ], + pathParams: [ + 'executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.perfSampleSeries.list + * @desc Lists PerfSampleSeries for a given Step. The request provides an + * optional filter which specifies one or more PerfMetricsType to include in + * the result; if none returns all. The resulting PerfSampleSeries are + * sorted by ids. May return any of the following canonical error codes: - + * NOT_FOUND - The containing Step does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfSampleSeries.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string=} params.filter Specify one or more PerfMetricType values such as CPU to filter the result + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.stepId A tool results step ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - getRoot() { - return this.root; + export class + Resource$Projects$Histories$Executions$Steps$Perfsampleseries$Samples { + root: Toolresults; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate + * @desc Creates a batch of PerfSamples - a client can submit multiple + * batches of Perf Samples through repeated calls to this method in order to + * split up a large request payload - duplicates and existing timestamp + * entries will be ignored. - the batch operation may partially succeed - + * the set of elements successfully inserted is returned in the response + * (omits items which already existed in the database). May return any of + * the following canonical error codes: - NOT_FOUND - The containing + * PerfSampleSeries does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.batchCreate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {string} params.projectId The cloud project + * @param {string} params.sampleSeriesId A sample series id + * @param {string} params.stepId A tool results step ID. + * @param {().BatchCreatePerfSamplesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + batchCreate(params?: any, options?: MethodOptions): + AxiosPromise; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + batchCreate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples:batchCreate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [ + 'projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId' + ], + pathParams: [ + 'executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + + + /** + * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.list + * @desc Lists the Performance Samples of a given Sample Series - The list + * results are sorted by timestamps ascending - The default page size is 500 + * samples; and maximum size allowed 5000 - The response token indicates the + * last returned PerfSample timestamp - When the results size exceeds the + * page size, submit a subsequent request including the page token to return + * the rest of the samples up to the page limit May return any of the + * following canonical error codes: - OUT_OF_RANGE - The specified request + * page_token is out of valid range - NOT_FOUND - The containing + * PerfSampleSeries does not exist + * @alias + * toolresults.projects.histories.executions.steps.perfSampleSeries.samples.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId A tool results execution ID. + * @param {string} params.historyId A tool results history ID. + * @param {integer=} params.pageSize The default page size is 500 samples, and the maximum size is 5000. If the page_size is greater than 5000, the effective page size will be 5000 + * @param {string=} params.pageToken Optional, the next_page_token returned in the previous response + * @param {string} params.projectId The cloud project + * @param {string} params.sampleSeriesId A sample series id + * @param {string} params.stepId A tool results step ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/perfSampleSeries/{sampleSeriesId}/samples') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [ + 'projectId', 'historyId', 'executionId', 'stepId', 'sampleSeriesId' + ], + pathParams: [ + 'executionId', 'historyId', 'projectId', 'sampleSeriesId', 'stepId' + ], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * toolresults.projects.histories.executions.steps.thumbnails.list - * @desc Lists thumbnails of images attached to a step. May return any of the - * following canonical error codes: - PERMISSION_DENIED - if the user is not - * authorized to read from the project, or from any of the images - - * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the step - * does not exist, or if any of the images do not exist - * @alias toolresults.projects.histories.executions.steps.thumbnails.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.executionId An Execution id. Required. - * @param {string} params.historyId A History id. Required. - * @param {integer=} params.pageSize The maximum number of thumbnails to fetch. Default value: 50. The server will use this default if the field is not set or has a value of 0. Optional. - * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. - * @param {string} params.projectId A Project id. Required. - * @param {string} params.stepId A Step id. Required. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + - '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], - pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export class Resource$Projects$Histories$Executions$Steps$Thumbnails { + root: Toolresults; + constructor(root: Toolresults) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * toolresults.projects.histories.executions.steps.thumbnails.list + * @desc Lists thumbnails of images attached to a step. May return any of + * the following canonical error codes: - PERMISSION_DENIED - if the user is + * not authorized to read from the project, or from any of the images - + * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the step + * does not exist, or if any of the images do not exist + * @alias toolresults.projects.histories.executions.steps.thumbnails.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.executionId An Execution id. Required. + * @param {string} params.historyId A History id. Required. + * @param {integer=} params.pageSize The maximum number of thumbnails to fetch. Default value: 50. The server will use this default if the field is not set or has a value of 0. Optional. + * @param {string=} params.pageToken A continuation token to resume the query at the next item. Optional. + * @param {string} params.projectId A Project id. Required. + * @param {string} params.stepId A Step id. Required. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/toolresults/v1beta3/projects/{projectId}/histories/{historyId}/executions/{executionId}/steps/{stepId}/thumbnails') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['projectId', 'historyId', 'executionId', 'stepId'], + pathParams: ['executionId', 'historyId', 'projectId', 'stepId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/tpu/v1alpha1.ts b/src/apis/tpu/v1alpha1.ts index 021ab09c406..440d9e57235 100644 --- a/src/apis/tpu/v1alpha1.ts +++ b/src/apis/tpu/v1alpha1.ts @@ -27,1487 +27,1509 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud TPU API - * - * TPU API provides customers with access to Google TPU technology. - * - * @example - * const google = require('googleapis'); - * const tpu = google.tpu('v1alpha1'); - * - * @namespace tpu - * @type {Function} - * @version v1alpha1 - * @variation v1alpha1 - * @param {object=} options Options for Tpu - */ -export class Tpu { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace tpu_v1alpha1 { + /** + * Cloud TPU API + * + * TPU API provides customers with access to Google TPU technology. + * + * @example + * const google = require('googleapis'); + * const tpu = google.tpu('v1alpha1'); + * + * @namespace tpu + * @type {Function} + * @version v1alpha1 + * @variation v1alpha1 + * @param {object=} options Options for Tpu + */ + export class Tpu { + _options: GlobalOptions; + google: GoogleApis; + root = this; - projects: Resource$Projects; + projects: Resource$Projects; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.projects = new Resource$Projects(this); - } + this.projects = new Resource$Projects(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A accelerator type that a Node can be configured with. - */ -export interface Schema$AcceleratorType { - /** - * The resource name. - */ - name: string; - /** - * the accelerator type. - */ - type: string; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Response for ListAcceleratorTypes. - */ -export interface Schema$ListAcceleratorTypesResponse { - /** - * The listed nodes. - */ - acceleratorTypes: Schema$AcceleratorType[]; - /** - * The next page token or empty if none. - */ - nextPageToken: string; -} -/** - * The response message for Locations.ListLocations. - */ -export interface Schema$ListLocationsResponse { - /** - * A list of locations that matches the specified filter in the request. - */ - locations: Schema$Location[]; - /** - * The standard List next-page token. - */ - nextPageToken: string; -} -/** - * Response for ListNodes. - */ -export interface Schema$ListNodesResponse { - /** - * The next page token or empty if none. - */ - nextPageToken: string; - /** - * The listed nodes. - */ - nodes: Schema$Node[]; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { - /** - * The standard List next-page token. - */ - nextPageToken: string; - /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Response for ListTensorFlowVersions. - */ -export interface Schema$ListTensorFlowVersionsResponse { - /** - * The next page token or empty if none. - */ - nextPageToken: string; - /** - * The listed nodes. - */ - tensorflowVersions: Schema$TensorFlowVersion[]; -} -/** - * A resource that represents Google Cloud Platform location. - */ -export interface Schema$Location { - /** - * The friendly name for this location, typically a nearby city name. For - * example, "Tokyo". - */ - displayName: string; - /** - * Cross-service attributes for the location. For example - * {"cloud.googleapis.com/region": "us-east1"} - */ - labels: any; - /** - * The canonical id for this location. For example: `"us-east1"`. - */ - locationId: string; - /** - * Service-specific metadata. For example the available capacity at the given - * location. - */ - metadata: any; - /** - * Resource name for the location, which may vary between implementations. For - * example: `"projects/example-project/locations/us-east1"` - */ - name: string; -} -/** - * A network endpoint over which a TPU worker can be reached. - */ -export interface Schema$NetworkEndpoint { - /** - * The IP address of this network endpoint. - */ - ipAddress: string; /** - * The port of this network endpoint. - */ - port: number; -} -/** - * A TPU instance. - */ -export interface Schema$Node { - /** - * The type of hardware accelerators associated with this node. Required. - */ - acceleratorType: string; - /** - * The CIDR block that the TPU node will use when selecting an IP address. - * This CIDR block must be a /29 block; the Compute Engine networks API - * forbids a smaller block, and using a larger block would be wasteful (a node - * can only consume one IP address). Errors will occur if the CIDR block has - * already been used for a currently existing TPU node, the CIDR block - * conflicts with any subnetworks in the user's provided network, or the - * provided network is peered with another network that is using that CIDR - * block. Required. - */ - cidrBlock: string; - /** - * Output only. The time when the node was created. - */ - createTime: string; - /** - * The user-supplied description of the TPU. Maximum of 512 characters. - */ - description: string; - /** - * The health status of the TPU node. - */ - health: string; - /** - * Output only. If this field is populated, it contains a description of why - * the TPU Node is unhealthy. - */ - healthDescription: string; - /** - * Output only. DEPRECATED! Use network_endpoints instead. The network address - * for the TPU Node as visible to Compute Engine instances. - */ - ipAddress: string; - /** - * Resource labels to represent user-provided metadata. - */ - labels: any; - /** - * Output only. The immutable name of the TPU - */ - name: string; - /** - * The name of a network they wish to peer the TPU node to. It must be a - * preexisting Compute Engine network inside of the project on which this API - * has been activated. If none is provided, "default" will be used. - */ - network: string; - /** - * Output only. The network endpoints where TPU workers can be accessed and - * sent work. It is recommended that Tensorflow clients of the node reach out - * to the 0th entry in this map first. - */ - networkEndpoints: Schema$NetworkEndpoint[]; - /** - * Output only. DEPRECATED! Use network_endpoints instead. The network port - * for the TPU Node as visible to Compute Engine instances. - */ - port: string; - /** - * Output only. The service account used to run the tensor flow services - * within the node. To share resources, including Google Cloud Storage data, - * with the Tensorflow job running in the Node, this account must have - * permissions to that data. - */ - serviceAccount: string; - /** - * Output only. The current state for the TPU Node. - */ - state: string; - /** - * The version of Tensorflow running in the Node. Required. - */ - tensorflowVersion: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { - /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; - /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; - /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; - /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * A accelerator type that a Node can be configured with. + */ + export interface Schema$AcceleratorType { + /** + * The resource name. + */ + name: string; + /** + * the accelerator type. + */ + type: string; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Represents the metadata of the long-running operation. - */ -export interface Schema$OperationMetadata { + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Response for ListAcceleratorTypes. + */ + export interface Schema$ListAcceleratorTypesResponse { + /** + * The listed nodes. + */ + acceleratorTypes: Schema$AcceleratorType[]; + /** + * The next page token or empty if none. + */ + nextPageToken: string; + } /** - * [Output only] API version used to start the operation. - */ - apiVersion: string; + * The response message for Locations.ListLocations. + */ + export interface Schema$ListLocationsResponse { + /** + * A list of locations that matches the specified filter in the request. + */ + locations: Schema$Location[]; + /** + * The standard List next-page token. + */ + nextPageToken: string; + } /** - * [Output only] Identifies whether the user has requested cancellation of the - * operation. Operations that have successfully been cancelled have - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - */ - cancelRequested: boolean; + * Response for ListNodes. + */ + export interface Schema$ListNodesResponse { + /** + * The next page token or empty if none. + */ + nextPageToken: string; + /** + * The listed nodes. + */ + nodes: Schema$Node[]; + } /** - * [Output only] The time the operation was created. - */ - createTime: string; + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * [Output only] The time the operation finished running. - */ - endTime: string; + * Response for ListTensorFlowVersions. + */ + export interface Schema$ListTensorFlowVersionsResponse { + /** + * The next page token or empty if none. + */ + nextPageToken: string; + /** + * The listed nodes. + */ + tensorflowVersions: Schema$TensorFlowVersion[]; + } /** - * [Output only] Human-readable status of the operation, if any. - */ - statusDetail: string; + * A resource that represents Google Cloud Platform location. + */ + export interface Schema$Location { + /** + * The friendly name for this location, typically a nearby city name. For + * example, "Tokyo". + */ + displayName: string; + /** + * Cross-service attributes for the location. For example + * {"cloud.googleapis.com/region": "us-east1"} + */ + labels: any; + /** + * The canonical id for this location. For example: `"us-east1"`. + */ + locationId: string; + /** + * Service-specific metadata. For example the available capacity at the + * given location. + */ + metadata: any; + /** + * Resource name for the location, which may vary between implementations. + * For example: `"projects/example-project/locations/us-east1"` + */ + name: string; + } /** - * [Output only] Server-defined resource path for the target of the operation. - */ - target: string; + * A network endpoint over which a TPU worker can be reached. + */ + export interface Schema$NetworkEndpoint { + /** + * The IP address of this network endpoint. + */ + ipAddress: string; + /** + * The port of this network endpoint. + */ + port: number; + } /** - * [Output only] Name of the verb executed by the operation. - */ - verb: string; -} -/** - * Request for ReimageNode. - */ -export interface Schema$ReimageNodeRequest { + * A TPU instance. + */ + export interface Schema$Node { + /** + * The type of hardware accelerators associated with this node. Required. + */ + acceleratorType: string; + /** + * The CIDR block that the TPU node will use when selecting an IP address. + * This CIDR block must be a /29 block; the Compute Engine networks API + * forbids a smaller block, and using a larger block would be wasteful (a + * node can only consume one IP address). Errors will occur if the CIDR + * block has already been used for a currently existing TPU node, the CIDR + * block conflicts with any subnetworks in the user's provided network, + * or the provided network is peered with another network that is using that + * CIDR block. Required. + */ + cidrBlock: string; + /** + * Output only. The time when the node was created. + */ + createTime: string; + /** + * The user-supplied description of the TPU. Maximum of 512 characters. + */ + description: string; + /** + * The health status of the TPU node. + */ + health: string; + /** + * Output only. If this field is populated, it contains a description of why + * the TPU Node is unhealthy. + */ + healthDescription: string; + /** + * Output only. DEPRECATED! Use network_endpoints instead. The network + * address for the TPU Node as visible to Compute Engine instances. + */ + ipAddress: string; + /** + * Resource labels to represent user-provided metadata. + */ + labels: any; + /** + * Output only. The immutable name of the TPU + */ + name: string; + /** + * The name of a network they wish to peer the TPU node to. It must be a + * preexisting Compute Engine network inside of the project on which this + * API has been activated. If none is provided, "default" will be + * used. + */ + network: string; + /** + * Output only. The network endpoints where TPU workers can be accessed and + * sent work. It is recommended that Tensorflow clients of the node reach + * out to the 0th entry in this map first. + */ + networkEndpoints: Schema$NetworkEndpoint[]; + /** + * Output only. DEPRECATED! Use network_endpoints instead. The network port + * for the TPU Node as visible to Compute Engine instances. + */ + port: string; + /** + * Output only. The service account used to run the tensor flow services + * within the node. To share resources, including Google Cloud Storage data, + * with the Tensorflow job running in the Node, this account must have + * permissions to that data. + */ + serviceAccount: string; + /** + * Output only. The current state for the TPU Node. + */ + state: string; + /** + * The version of Tensorflow running in the Node. Required. + */ + tensorflowVersion: string; + } /** - * The version for reimage to create. - */ - tensorflowVersion: string; -} -/** - * Request for ResetNode. - */ -export interface Schema$ResetNodeRequest {} -/** - * Request for StartNode. - */ -export interface Schema$StartNodeRequest {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Represents the metadata of the long-running operation. + */ + export interface Schema$OperationMetadata { + /** + * [Output only] API version used to start the operation. + */ + apiVersion: string; + /** + * [Output only] Identifies whether the user has requested cancellation of + * the operation. Operations that have successfully been cancelled have + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + */ + cancelRequested: boolean; + /** + * [Output only] The time the operation was created. + */ + createTime: string; + /** + * [Output only] The time the operation finished running. + */ + endTime: string; + /** + * [Output only] Human-readable status of the operation, if any. + */ + statusDetail: string; + /** + * [Output only] Server-defined resource path for the target of the + * operation. + */ + target: string; + /** + * [Output only] Name of the verb executed by the operation. + */ + verb: string; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * Request for ReimageNode. */ - details: any[]; + export interface Schema$ReimageNodeRequest { + /** + * The version for reimage to create. + */ + tensorflowVersion: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * Request for StopNode. - */ -export interface Schema$StopNodeRequest {} -/** - * A tensorflow version that a Node can be configured with. - */ -export interface Schema$TensorFlowVersion { + * Request for ResetNode. + */ + export interface Schema$ResetNodeRequest {} + /** + * Request for StartNode. + */ + export interface Schema$StartNodeRequest {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * The resource name. + * Request for StopNode. */ - name: string; + export interface Schema$StopNodeRequest {} /** - * the tensorflow version. + * A tensorflow version that a Node can be configured with. */ - version: string; -} - -export class Resource$Projects { - root: Tpu; - locations: Resource$Projects$Locations; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - this.locations = new Resource$Projects$Locations(root); - } - - getRoot() { - return this.root; - } -} -export class Resource$Projects$Locations { - root: Tpu; - acceleratorTypes: Resource$Projects$Locations$Acceleratortypes; - nodes: Resource$Projects$Locations$Nodes; - operations: Resource$Projects$Locations$Operations; - tensorflowVersions: Resource$Projects$Locations$Tensorflowversions; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - this.acceleratorTypes = - new Resource$Projects$Locations$Acceleratortypes(root); - this.nodes = new Resource$Projects$Locations$Nodes(root); - this.operations = new Resource$Projects$Locations$Operations(root); - this.tensorflowVersions = - new Resource$Projects$Locations$Tensorflowversions(root); - } - - getRoot() { - return this.root; + export interface Schema$TensorFlowVersion { + /** + * The resource name. + */ + name: string; + /** + * the tensorflow version. + */ + version: string; } + export class Resource$Projects { + root: Tpu; + locations: Resource$Projects$Locations; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); + this.locations = new Resource$Projects$Locations(root); + } - /** - * tpu.projects.locations.get - * @desc Gets information about a location. - * @alias tpu.projects.locations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name Resource name for the location. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations { + root: Tpu; + acceleratorTypes: Resource$Projects$Locations$Acceleratortypes; + nodes: Resource$Projects$Locations$Nodes; + operations: Resource$Projects$Locations$Operations; + tensorflowVersions: Resource$Projects$Locations$Tensorflowversions; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); + this.acceleratorTypes = + new Resource$Projects$Locations$Acceleratortypes(root); + this.nodes = new Resource$Projects$Locations$Nodes(root); + this.operations = new Resource$Projects$Locations$Operations(root); + this.tensorflowVersions = + new Resource$Projects$Locations$Tensorflowversions(root); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * tpu.projects.locations.list - * @desc Lists information about the supported locations for this service. - * @alias tpu.projects.locations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The resource that owns the locations collection, if applicable. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.get + * @desc Gets information about a location. + * @alias tpu.projects.locations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Resource name for the location. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}/locations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Acceleratortypes { - root: Tpu; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - /** - * tpu.projects.locations.acceleratorTypes.get - * @desc Gets AcceleratorType. - * @alias tpu.projects.locations.acceleratorTypes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * tpu.projects.locations.list + * @desc Lists information about the supported locations for this service. + * @alias tpu.projects.locations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The resource that owns the locations collection, if applicable. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}/locations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Projects$Locations$Acceleratortypes { + root: Tpu; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * tpu.projects.locations.acceleratorTypes.list - * @desc Lists accelerator types supported by this API. - * @alias tpu.projects.locations.acceleratorTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter List filter. - * @param {string=} params.orderBy Sort results. - * @param {integer=} params.pageSize The maximum number of items to return. - * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. - * @param {string} params.parent The parent resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+parent}/acceleratorTypes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * tpu.projects.locations.acceleratorTypes.get + * @desc Gets AcceleratorType. + * @alias tpu.projects.locations.acceleratorTypes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Locations$Nodes { - root: Tpu; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * tpu.projects.locations.acceleratorTypes.list + * @desc Lists accelerator types supported by this API. + * @alias tpu.projects.locations.acceleratorTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter List filter. + * @param {string=} params.orderBy Sort results. + * @param {integer=} params.pageSize The maximum number of items to return. + * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. + * @param {string} params.parent The parent resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+parent}/acceleratorTypes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * tpu.projects.locations.nodes.create - * @desc Creates a node. - * @alias tpu.projects.locations.nodes.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.nodeId The unqualified resource name. - * @param {string} params.parent The parent resource name. - * @param {().Node} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Locations$Nodes { + root: Tpu; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+parent}/nodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * tpu.projects.locations.nodes.delete - * @desc Deletes a node. - * @alias tpu.projects.locations.nodes.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.nodes.create + * @desc Creates a node. + * @alias tpu.projects.locations.nodes.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.nodeId The unqualified resource name. + * @param {string} params.parent The parent resource name. + * @param {().Node} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+parent}/nodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.nodes.get - * @desc Gets the details of a node. - * @alias tpu.projects.locations.nodes.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * tpu.projects.locations.nodes.delete + * @desc Deletes a node. + * @alias tpu.projects.locations.nodes.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.nodes.list - * @desc Lists nodes. - * @alias tpu.projects.locations.nodes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The maximum number of items to return. - * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. - * @param {string} params.parent The parent resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.nodes.get + * @desc Gets the details of a node. + * @alias tpu.projects.locations.nodes.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+parent}/nodes') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.nodes.reimage - * @desc Reimages a node's OS. - * @alias tpu.projects.locations.nodes.reimage - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {().ReimageNodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reimage(params?: any, options?: MethodOptions): - AxiosPromise; - reimage( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reimage( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:reimage') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * tpu.projects.locations.nodes.list + * @desc Lists nodes. + * @alias tpu.projects.locations.nodes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of items to return. + * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. + * @param {string} params.parent The parent resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+parent}/nodes') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * tpu.projects.locations.nodes.reset - * @desc Resets a node, which stops and starts the VM. - * @alias tpu.projects.locations.nodes.reset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {().ResetNodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reset(params?: any, options?: MethodOptions): AxiosPromise; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reset( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.nodes.reimage + * @desc Reimages a node's OS. + * @alias tpu.projects.locations.nodes.reimage + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {().ReimageNodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reimage(params?: any, options?: MethodOptions): + AxiosPromise; + reimage( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reimage( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:reimage') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:reset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.nodes.start - * @desc Starts a node. - * @alias tpu.projects.locations.nodes.start - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {().StartNodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - start(params?: any, options?: MethodOptions): AxiosPromise; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - start( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:start') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * tpu.projects.locations.nodes.reset + * @desc Resets a node, which stops and starts the VM. + * @alias tpu.projects.locations.nodes.reset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {().ResetNodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reset(params?: any, options?: MethodOptions): + AxiosPromise; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reset( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:reset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * tpu.projects.locations.nodes.stop - * @desc Stops a node. - * @alias tpu.projects.locations.nodes.stop - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {().StopNodeRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - stop(params?: any, options?: MethodOptions): AxiosPromise; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - stop( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:stop') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * tpu.projects.locations.nodes.start + * @desc Starts a node. + * @alias tpu.projects.locations.nodes.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {().StartNodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): + AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Projects$Locations$Operations { - root: Tpu; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * tpu.projects.locations.nodes.stop + * @desc Stops a node. + * @alias tpu.projects.locations.nodes.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {().StopNodeRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * tpu.projects.locations.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias tpu.projects.locations.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Projects$Locations$Operations { + root: Tpu; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * tpu.projects.locations.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias tpu.projects.locations.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * tpu.projects.locations.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias tpu.projects.locations.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias tpu.projects.locations.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias tpu.projects.locations.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * tpu.projects.locations.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias tpu.projects.locations.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias tpu.projects.locations.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}/operations') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Projects$Locations$Tensorflowversions { - root: Tpu; - constructor(root: Tpu) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * tpu.projects.locations.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias tpu.projects.locations.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+name}/operations') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * tpu.projects.locations.tensorflowVersions.get - * @desc Gets TensorFlow Version. - * @alias tpu.projects.locations.tensorflowVersions.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Projects$Locations$Tensorflowversions { + root: Tpu; + constructor(root: Tpu) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * tpu.projects.locations.tensorflowVersions.list - * @desc Lists TensorFlow versions supported by this API. - * @alias tpu.projects.locations.tensorflowVersions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter List filter. - * @param {string=} params.orderBy Sort results. - * @param {integer=} params.pageSize The maximum number of items to return. - * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. - * @param {string} params.parent The parent resource name. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * tpu.projects.locations.tensorflowVersions.get + * @desc Gets TensorFlow Version. + * @alias tpu.projects.locations.tensorflowVersions.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + '/v1alpha1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1alpha1/{+parent}/tensorflowVersions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['parent'], - pathParams: ['parent'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + + /** + * tpu.projects.locations.tensorflowVersions.list + * @desc Lists TensorFlow versions supported by this API. + * @alias tpu.projects.locations.tensorflowVersions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter List filter. + * @param {string=} params.orderBy Sort results. + * @param {integer=} params.pageSize The maximum number of items to return. + * @param {string=} params.pageToken The next_page_token value returned from a previous List request, if any. + * @param {string} params.parent The parent resource name. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://tpu.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha1/{+parent}/tensorflowVersions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } } } diff --git a/src/apis/translate/v2.ts b/src/apis/translate/v2.ts index ffc3255695b..9422f346dcd 100644 --- a/src/apis/translate/v2.ts +++ b/src/apis/translate/v2.ts @@ -27,480 +27,484 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Cloud Translation API - * - * The Google Cloud Translation API lets websites and programs integrate with - * Google Translate programmatically. - * - * @example - * const google = require('googleapis'); - * const translate = google.translate('v2'); - * - * @namespace translate - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Translate - */ -export class Translate { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace translate_v2 { + /** + * Google Cloud Translation API + * + * The Google Cloud Translation API lets websites and programs integrate with + * Google Translate programmatically. + * + * @example + * const google = require('googleapis'); + * const translate = google.translate('v2'); + * + * @namespace translate + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Translate + */ + export class Translate { + _options: GlobalOptions; + google: GoogleApis; + root = this; - detections: Resource$Detections; - languages: Resource$Languages; - translations: Resource$Translations; + detections: Resource$Detections; + languages: Resource$Languages; + translations: Resource$Translations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.detections = new Resource$Detections(this); - this.languages = new Resource$Languages(this); - this.translations = new Resource$Translations(this); - } + this.detections = new Resource$Detections(this); + this.languages = new Resource$Languages(this); + this.translations = new Resource$Translations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$DetectionsListResponse { - /** - * A detections contains detection results of several text - */ - detections: Schema$DetectionsResource[]; -} -/** - * An array of languages which we detect for the given text The most likely - * language list first. - */ -export interface Schema$DetectionsResource {} -/** - * The request message for language detection. - */ -export interface Schema$DetectLanguageRequest { - /** - * The input text upon which to perform language detection. Repeat this - * parameter to perform language detection on multiple text inputs. - */ - q: string[]; -} -/** - * The request message for discovering supported languages. - */ -export interface Schema$GetSupportedLanguagesRequest { - /** - * The language to use to return localized, human readable names of supported - * languages. - */ - target: string; -} -export interface Schema$LanguagesListResponse { - /** - * List of source/target languages supported by the translation API. If target - * parameter is unspecified, the list is sorted by the ASCII code point order - * of the language code. If target parameter is specified, the list is sorted - * by the collation order of the language name in the target language. - */ - languages: Schema$LanguagesResource[]; -} -export interface Schema$LanguagesResource { - /** - * Supported language code, generally consisting of its ISO 639-1 identifier. - * (E.g. 'en', 'ja'). In certain cases, BCP-47 codes including - * language + region identifiers are returned (e.g. 'zh-TW' and - * 'zh-CH') - */ - language: string; - /** - * Human readable name of the language localized to the target language. - */ - name: string; -} -/** - * The main translation request message for the Cloud Translation API. - */ -export interface Schema$TranslateTextRequest { - /** - * The format of the source text, in either HTML (default) or plain-text. A - * value of "html" indicates HTML and a value of "text" - * indicates plain-text. - */ - format: string; - /** - * The `model` type requested for this translation. Valid values are listed in - * public documentation. - */ - model: string; - /** - * The input text to translate. Repeat this parameter to perform translation - * operations on multiple text inputs. - */ - q: string[]; + export interface Schema$DetectionsListResponse { + /** + * A detections contains detection results of several text + */ + detections: Schema$DetectionsResource[]; + } /** - * The language of the source text, set to one of the language codes listed in - * Language Support. If the source language is not specified, the API will - * attempt to identify the source language automatically and return it within - * the response. + * An array of languages which we detect for the given text The most likely + * language list first. */ - source: string; + export interface Schema$DetectionsResource {} /** - * The language to use for translation of the input text, set to one of the - * language codes listed in Language Support. + * The request message for language detection. */ - target: string; -} -/** - * The main language translation response message. - */ -export interface Schema$TranslationsListResponse { - /** - * Translations contains list of translation results of given text - */ - translations: Schema$TranslationsResource[]; -} -export interface Schema$TranslationsResource { + export interface Schema$DetectLanguageRequest { + /** + * The input text upon which to perform language detection. Repeat this + * parameter to perform language detection on multiple text inputs. + */ + q: string[]; + } /** - * The source language of the initial request, detected automatically, if no - * source language was passed within the initial request. If the source - * language was passed, auto-detection of the language will not occur and this - * field will be empty. + * The request message for discovering supported languages. */ - detectedSourceLanguage: string; + export interface Schema$GetSupportedLanguagesRequest { + /** + * The language to use to return localized, human readable names of + * supported languages. + */ + target: string; + } + export interface Schema$LanguagesListResponse { + /** + * List of source/target languages supported by the translation API. If + * target parameter is unspecified, the list is sorted by the ASCII code + * point order of the language code. If target parameter is specified, the + * list is sorted by the collation order of the language name in the target + * language. + */ + languages: Schema$LanguagesResource[]; + } + export interface Schema$LanguagesResource { + /** + * Supported language code, generally consisting of its ISO 639-1 + * identifier. (E.g. 'en', 'ja'). In certain cases, BCP-47 + * codes including language + region identifiers are returned (e.g. + * 'zh-TW' and 'zh-CH') + */ + language: string; + /** + * Human readable name of the language localized to the target language. + */ + name: string; + } /** - * The `model` type used for this translation. Valid values are listed in - * public documentation. Can be different from requested `model`. Present only - * if specific model type was explicitly requested. + * The main translation request message for the Cloud Translation API. */ - model: string; + export interface Schema$TranslateTextRequest { + /** + * The format of the source text, in either HTML (default) or plain-text. A + * value of "html" indicates HTML and a value of "text" + * indicates plain-text. + */ + format: string; + /** + * The `model` type requested for this translation. Valid values are listed + * in public documentation. + */ + model: string; + /** + * The input text to translate. Repeat this parameter to perform translation + * operations on multiple text inputs. + */ + q: string[]; + /** + * The language of the source text, set to one of the language codes listed + * in Language Support. If the source language is not specified, the API + * will attempt to identify the source language automatically and return it + * within the response. + */ + source: string; + /** + * The language to use for translation of the input text, set to one of the + * language codes listed in Language Support. + */ + target: string; + } /** - * Text translated into the target language. + * The main language translation response message. */ - translatedText: string; -} - -export class Resource$Detections { - root: Translate; - constructor(root: Translate) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$TranslationsListResponse { + /** + * Translations contains list of translation results of given text + */ + translations: Schema$TranslationsResource[]; } - - getRoot() { - return this.root; + export interface Schema$TranslationsResource { + /** + * The source language of the initial request, detected automatically, if no + * source language was passed within the initial request. If the source + * language was passed, auto-detection of the language will not occur and + * this field will be empty. + */ + detectedSourceLanguage: string; + /** + * The `model` type used for this translation. Valid values are listed in + * public documentation. Can be different from requested `model`. Present + * only if specific model type was explicitly requested. + */ + model: string; + /** + * Text translated into the target language. + */ + translatedText: string; } - - /** - * language.detections.detect - * @desc Detects the language of text within a request. - * @alias language.detections.detect - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().DetectLanguageRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - detect(params?: any, options?: MethodOptions): - AxiosPromise; - detect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - detect( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Detections { + root: Translate; + constructor(root: Translate) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/language/translate/v2/detect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * language.detections.list - * @desc Detects the language of text within a request. - * @alias language.detections.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.q The input text upon which to perform language detection. Repeat this parameter to perform language detection on multiple text inputs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/language/translate/v2/detect') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['q'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * language.detections.detect + * @desc Detects the language of text within a request. + * @alias language.detections.detect + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().DetectLanguageRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + detect(params?: any, options?: MethodOptions): + AxiosPromise; + detect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + detect( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/language/translate/v2/detect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Languages { - root: Translate; - constructor(root: Translate) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * language.detections.list + * @desc Detects the language of text within a request. + * @alias language.detections.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.q The input text upon which to perform language detection. Repeat this parameter to perform language detection on multiple text inputs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/language/translate/v2/detect') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['q'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * language.languages.list - * @desc Returns a list of supported languages for translation. - * @alias language.languages.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.model The model type for which supported languages should be returned. - * @param {string=} params.target The language to use to return localized, human readable names of supported languages. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Languages { + root: Translate; + constructor(root: Translate) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/language/translate/v2/languages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Translations { - root: Translate; - constructor(root: Translate) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * language.languages.list + * @desc Returns a list of supported languages for translation. + * @alias language.languages.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.model The model type for which supported languages should be returned. + * @param {string=} params.target The language to use to return localized, human readable names of supported languages. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/language/translate/v2/languages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * language.translations.list - * @desc Translates input text, returning translated text. - * @alias language.translations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.cid The customization id for translate - * @param {string=} params.format The format of the source text, in either HTML (default) or plain-text. A value of "html" indicates HTML and a value of "text" indicates plain-text. - * @param {string=} params.model The `model` type requested for this translation. Valid values are listed in public documentation. - * @param {string} params.q The input text to translate. Repeat this parameter to perform translation operations on multiple text inputs. - * @param {string=} params.source The language of the source text, set to one of the language codes listed in Language Support. If the source language is not specified, the API will attempt to identify the source language automatically and return it within the response. - * @param {string} params.target The language to use for translation of the input text, set to one of the language codes listed in Language Support. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Translations { + root: Translate; + constructor(root: Translate) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/language/translate/v2') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['q', 'target'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * language.translations.translate - * @desc Translates input text, returning translated text. - * @alias language.translations.translate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().TranslateTextRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - translate(params?: any, options?: MethodOptions): - AxiosPromise; - translate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - translate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * language.translations.list + * @desc Translates input text, returning translated text. + * @alias language.translations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.cid The customization id for translate + * @param {string=} params.format The format of the source text, in either HTML (default) or plain-text. A value of "html" indicates HTML and a value of "text" indicates plain-text. + * @param {string=} params.model The `model` type requested for this translation. Valid values are listed in public documentation. + * @param {string} params.q The input text to translate. Repeat this parameter to perform translation operations on multiple text inputs. + * @param {string=} params.source The language of the source text, set to one of the language codes listed in Language Support. If the source language is not specified, the API will attempt to identify the source language automatically and return it within the response. + * @param {string} params.target The language to use for translation of the input text, set to one of the language codes listed in Language Support. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/language/translate/v2') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['q', 'target'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/language/translate/v2') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * language.translations.translate + * @desc Translates input text, returning translated text. + * @alias language.translations.translate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().TranslateTextRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + translate(params?: any, options?: MethodOptions): + AxiosPromise; + translate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + translate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://translation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/language/translate/v2') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/urlshortener/v1.ts b/src/apis/urlshortener/v1.ts index b1bbc74ded4..67c0f01b308 100644 --- a/src/apis/urlshortener/v1.ts +++ b/src/apis/urlshortener/v1.ts @@ -27,327 +27,333 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * URL Shortener API - * - * Lets you create, inspect, and manage goo.gl short URLs - * - * @example - * const google = require('googleapis'); - * const urlshortener = google.urlshortener('v1'); - * - * @namespace urlshortener - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Urlshortener - */ -export class Urlshortener { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace urlshortener_v1 { + /** + * URL Shortener API + * + * Lets you create, inspect, and manage goo.gl short URLs + * + * @example + * const google = require('googleapis'); + * const urlshortener = google.urlshortener('v1'); + * + * @namespace urlshortener + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Urlshortener + */ + export class Urlshortener { + _options: GlobalOptions; + google: GoogleApis; + root = this; - url: Resource$Url; + url: Resource$Url; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.url = new Resource$Url(this); - } + this.url = new Resource$Url(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$AnalyticsSnapshot { - /** - * Top browsers, e.g. "Chrome"; sorted by (descending) click counts. - * Only present if this data is available. - */ - browsers: Schema$StringCount[]; - /** - * Top countries (expressed as country codes), e.g. "US" or - * "DE"; sorted by (descending) click counts. Only present if this - * data is available. - */ - countries: Schema$StringCount[]; - /** - * Number of clicks on all goo.gl short URLs pointing to this long URL. - */ - longUrlClicks: string; - /** - * Top platforms or OSes, e.g. "Windows"; sorted by (descending) - * click counts. Only present if this data is available. - */ - platforms: Schema$StringCount[]; - /** - * Top referring hosts, e.g. "www.google.com"; sorted by - * (descending) click counts. Only present if this data is available. - */ - referrers: Schema$StringCount[]; - /** - * Number of clicks on this short URL. - */ - shortUrlClicks: string; -} -export interface Schema$AnalyticsSummary { - /** - * Click analytics over all time. - */ - allTime: Schema$AnalyticsSnapshot; - /** - * Click analytics over the last day. - */ - day: Schema$AnalyticsSnapshot; - /** - * Click analytics over the last month. - */ - month: Schema$AnalyticsSnapshot; - /** - * Click analytics over the last two hours. - */ - twoHours: Schema$AnalyticsSnapshot; - /** - * Click analytics over the last week. - */ - week: Schema$AnalyticsSnapshot; -} -export interface Schema$StringCount { - /** - * Number of clicks for this top entry, e.g. for this particular country or - * browser. - */ - count: string; - /** - * Label assigned to this top entry, e.g. "US" or - * "Chrome". - */ - id: string; -} -export interface Schema$Url { - /** - * A summary of the click analytics for the short and long URL. Might not be - * present if not requested or currently unavailable. - */ - analytics: Schema$AnalyticsSummary; - /** - * Time the short URL was created; ISO 8601 representation using the - * yyyy-MM-dd'T'HH:mm:ss.SSSZZ format, e.g. - * "2010-10-14T19:01:24.944+00:00". - */ - created: string; - /** - * Short URL, e.g. "http://goo.gl/l6MS". - */ - id: string; - /** - * The fixed string "urlshortener#url". - */ - kind: string; - /** - * Long URL, e.g. "http://www.google.com/". Might not be present if - * the status is "REMOVED". - */ - longUrl: string; - /** - * Status of the target URL. Possible values: "OK", - * "MALWARE", "PHISHING", or "REMOVED". A URL - * might be marked "REMOVED" if it was flagged as spam, for example. - */ - status: string; -} -export interface Schema$UrlHistory { - /** - * A list of URL resources. - */ - items: Schema$Url[]; - /** - * Number of items returned with each full "page" of results. Note - * that the last page could have fewer items than the "itemsPerPage" - * value. - */ - itemsPerPage: number; - /** - * The fixed string "urlshortener#urlHistory". - */ - kind: string; - /** - * A token to provide to get the next page of results. - */ - nextPageToken: string; - /** - * Total number of short URLs associated with this user (may be approximate). - */ - totalItems: number; -} - -export class Resource$Url { - root: Urlshortener; - constructor(root: Urlshortener) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$AnalyticsSnapshot { + /** + * Top browsers, e.g. "Chrome"; sorted by (descending) click + * counts. Only present if this data is available. + */ + browsers: Schema$StringCount[]; + /** + * Top countries (expressed as country codes), e.g. "US" or + * "DE"; sorted by (descending) click counts. Only present if this + * data is available. + */ + countries: Schema$StringCount[]; + /** + * Number of clicks on all goo.gl short URLs pointing to this long URL. + */ + longUrlClicks: string; + /** + * Top platforms or OSes, e.g. "Windows"; sorted by (descending) + * click counts. Only present if this data is available. + */ + platforms: Schema$StringCount[]; + /** + * Top referring hosts, e.g. "www.google.com"; sorted by + * (descending) click counts. Only present if this data is available. + */ + referrers: Schema$StringCount[]; + /** + * Number of clicks on this short URL. + */ + shortUrlClicks: string; } - - getRoot() { - return this.root; + export interface Schema$AnalyticsSummary { + /** + * Click analytics over all time. + */ + allTime: Schema$AnalyticsSnapshot; + /** + * Click analytics over the last day. + */ + day: Schema$AnalyticsSnapshot; + /** + * Click analytics over the last month. + */ + month: Schema$AnalyticsSnapshot; + /** + * Click analytics over the last two hours. + */ + twoHours: Schema$AnalyticsSnapshot; + /** + * Click analytics over the last week. + */ + week: Schema$AnalyticsSnapshot; + } + export interface Schema$StringCount { + /** + * Number of clicks for this top entry, e.g. for this particular country or + * browser. + */ + count: string; + /** + * Label assigned to this top entry, e.g. "US" or + * "Chrome". + */ + id: string; + } + export interface Schema$Url { + /** + * A summary of the click analytics for the short and long URL. Might not be + * present if not requested or currently unavailable. + */ + analytics: Schema$AnalyticsSummary; + /** + * Time the short URL was created; ISO 8601 representation using the + * yyyy-MM-dd'T'HH:mm:ss.SSSZZ format, e.g. + * "2010-10-14T19:01:24.944+00:00". + */ + created: string; + /** + * Short URL, e.g. "http://goo.gl/l6MS". + */ + id: string; + /** + * The fixed string "urlshortener#url". + */ + kind: string; + /** + * Long URL, e.g. "http://www.google.com/". Might not be present + * if the status is "REMOVED". + */ + longUrl: string; + /** + * Status of the target URL. Possible values: "OK", + * "MALWARE", "PHISHING", or "REMOVED". A URL + * might be marked "REMOVED" if it was flagged as spam, for + * example. + */ + status: string; + } + export interface Schema$UrlHistory { + /** + * A list of URL resources. + */ + items: Schema$Url[]; + /** + * Number of items returned with each full "page" of results. Note + * that the last page could have fewer items than the + * "itemsPerPage" value. + */ + itemsPerPage: number; + /** + * The fixed string "urlshortener#urlHistory". + */ + kind: string; + /** + * A token to provide to get the next page of results. + */ + nextPageToken: string; + /** + * Total number of short URLs associated with this user (may be + * approximate). + */ + totalItems: number; } - - /** - * urlshortener.url.get - * @desc Expands a short URL or gets creation time and analytics. - * @alias urlshortener.url.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.projection Additional information to return. - * @param {string} params.shortUrl The short URL, including the protocol. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Url { + root: Urlshortener; + constructor(root: Urlshortener) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/urlshortener/v1/url') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['shortUrl'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * urlshortener.url.insert - * @desc Creates a new short URL. - * @alias urlshortener.url.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Url} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * urlshortener.url.get + * @desc Expands a short URL or gets creation time and analytics. + * @alias urlshortener.url.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.projection Additional information to return. + * @param {string} params.shortUrl The short URL, including the protocol. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/urlshortener/v1/url') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['shortUrl'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/urlshortener/v1/url') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * urlshortener.url.list - * @desc Retrieves a list of URLs shortened by a user. - * @alias urlshortener.url.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.projection Additional information to return. - * @param {string=} params.start-token Token for requesting successive pages of results. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * urlshortener.url.insert + * @desc Creates a new short URL. + * @alias urlshortener.url.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Url} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/urlshortener/v1/url') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/urlshortener/v1/url/history') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * urlshortener.url.list + * @desc Retrieves a list of URLs shortened by a user. + * @alias urlshortener.url.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.projection Additional information to return. + * @param {string=} params.start-token Token for requesting successive pages of results. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/urlshortener/v1/url/history') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/vault/v1.ts b/src/apis/vault/v1.ts index b534898af4b..2b211c2fda6 100644 --- a/src/apis/vault/v1.ts +++ b/src/apis/vault/v1.ts @@ -27,1346 +27,1375 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Vault API - * - * Archiving and eDiscovery for G Suite. - * - * @example - * const google = require('googleapis'); - * const vault = google.vault('v1'); - * - * @namespace vault - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Vault - */ -export class Vault { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace vault_v1 { + /** + * Google Vault API + * + * Archiving and eDiscovery for G Suite. + * + * @example + * const google = require('googleapis'); + * const vault = google.vault('v1'); + * + * @namespace vault + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Vault + */ + export class Vault { + _options: GlobalOptions; + google: GoogleApis; + root = this; - matters: Resource$Matters; + matters: Resource$Matters; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.matters = new Resource$Matters(this); - } + this.matters = new Resource$Matters(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Add an account with the permission specified. The role cannot be owner. If an - * account already has a role in the matter, it will be overwritten. - */ -export interface Schema$AddMatterPermissionsRequest { - /** - * Only relevant if send_emails is true. True to CC requestor in the email - * message. False to not CC requestor. - */ - ccMe: boolean; - /** - * The MatterPermission to add. - */ - matterPermission: Schema$MatterPermission; - /** - * True to send notification email to the added account. False to not send - * notification email. - */ - sendEmails: boolean; -} -/** - * Close a matter by ID. - */ -export interface Schema$CloseMatterRequest {} -/** - * Response to a CloseMatterRequest. - */ -export interface Schema$CloseMatterResponse { - /** - * The updated matter, with state CLOSED. - */ - matter: Schema$Matter; -} -/** - * Corpus specific queries. - */ -export interface Schema$CorpusQuery { /** - * Details pertaining to Drive holds. If set, corpus must be Drive. + * Add an account with the permission specified. The role cannot be owner. If + * an account already has a role in the matter, it will be overwritten. */ - driveQuery: Schema$HeldDriveQuery; - /** - * Details pertaining to Groups holds. If set, corpus must be Groups. - */ - groupsQuery: Schema$HeldGroupsQuery; - /** - * Details pertaining to Hangouts Chat holds. If set, corpus must be Hangouts - * Chat. - */ - hangoutsChatQuery: Schema$HeldHangoutsChatQuery; - /** - * Details pertaining to mail holds. If set, corpus must be mail. - */ - mailQuery: Schema$HeldMailQuery; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * An account being held in a particular hold. This structure is immutable. This - * can be either a single user or a google group, depending on the corpus. - */ -export interface Schema$HeldAccount { - /** - * The account's ID as provided by the <a - * href="https://developers.google.com/admin-sdk/">Admin - * SDK</a>. - */ - accountId: string; - /** - * When the account was put on hold. - */ - holdTime: string; -} -/** - * Query options for Drive holds. - */ -export interface Schema$HeldDriveQuery { - /** - * If true, include files in Team Drives in the hold. - */ - includeTeamDriveFiles: boolean; -} -/** - * Query options for group holds. - */ -export interface Schema$HeldGroupsQuery { - /** - * The end time range for the search query. These timestamps are in GMT and - * rounded down to the start of the given date. - */ - endTime: string; - /** - * The start time range for the search query. These timestamps are in GMT and - * rounded down to the start of the given date. - */ - startTime: string; - /** - * The search terms for the hold. - */ - terms: string; -} -/** - * Query options for hangouts chat holds. - */ -export interface Schema$HeldHangoutsChatQuery { - /** - * If true, include rooms the user has participated in. - */ - includeRooms: boolean; -} -/** - * Query options for mail holds. - */ -export interface Schema$HeldMailQuery { - /** - * The end time range for the search query. These timestamps are in GMT and - * rounded down to the start of the given date. - */ - endTime: string; - /** - * The start time range for the search query. These timestamps are in GMT and - * rounded down to the start of the given date. - */ - startTime: string; - /** - * The search terms for the hold. - */ - terms: string; -} -/** - * A organizational unit being held in a particular hold. This structure is - * immutable. - */ -export interface Schema$HeldOrgUnit { - /** - * When the org unit was put on hold. This property is immutable. - */ - holdTime: string; - /** - * The org unit's immutable ID as provided by the Admin SDK. - */ - orgUnitId: string; -} -/** - * Represents a hold within Vault. A hold restricts purging of artifacts based - * on the combination of the query and accounts restrictions. A hold can be - * configured to either apply to an explicitly configured set of accounts, or - * can be applied to all members of an organizational unit. - */ -export interface Schema$Hold { - /** - * If set, the hold applies to the enumerated accounts and org_unit must be - * empty. - */ - accounts: Schema$HeldAccount[]; + export interface Schema$AddMatterPermissionsRequest { + /** + * Only relevant if send_emails is true. True to CC requestor in the email + * message. False to not CC requestor. + */ + ccMe: boolean; + /** + * The MatterPermission to add. + */ + matterPermission: Schema$MatterPermission; + /** + * True to send notification email to the added account. False to not send + * notification email. + */ + sendEmails: boolean; + } /** - * The corpus to be searched. + * Close a matter by ID. */ - corpus: string; + export interface Schema$CloseMatterRequest {} /** - * The unique immutable ID of the hold. Assigned during creation. + * Response to a CloseMatterRequest. */ - holdId: string; + export interface Schema$CloseMatterResponse { + /** + * The updated matter, with state CLOSED. + */ + matter: Schema$Matter; + } /** - * The name of the hold. + * Corpus specific queries. */ - name: string; + export interface Schema$CorpusQuery { + /** + * Details pertaining to Drive holds. If set, corpus must be Drive. + */ + driveQuery: Schema$HeldDriveQuery; + /** + * Details pertaining to Groups holds. If set, corpus must be Groups. + */ + groupsQuery: Schema$HeldGroupsQuery; + /** + * Details pertaining to Hangouts Chat holds. If set, corpus must be + * Hangouts Chat. + */ + hangoutsChatQuery: Schema$HeldHangoutsChatQuery; + /** + * Details pertaining to mail holds. If set, corpus must be mail. + */ + mailQuery: Schema$HeldMailQuery; + } /** - * If set, the hold applies to all members of the organizational unit and - * accounts must be empty. This property is mutable. For groups holds, set the - * accounts field. + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. */ - orgUnit: Schema$HeldOrgUnit; + export interface Schema$Empty {} /** - * The corpus-specific query. If set, the corpusQuery must match corpus type. + * An account being held in a particular hold. This structure is immutable. + * This can be either a single user or a google group, depending on the + * corpus. */ - query: Schema$CorpusQuery; + export interface Schema$HeldAccount { + /** + * The account's ID as provided by the <a + * href="https://developers.google.com/admin-sdk/">Admin + * SDK</a>. + */ + accountId: string; + /** + * When the account was put on hold. + */ + holdTime: string; + } /** - * The last time this hold was modified. + * Query options for Drive holds. */ - updateTime: string; -} -/** - * Returns a list of held accounts for a hold. - */ -export interface Schema$ListHeldAccountsResponse { + export interface Schema$HeldDriveQuery { + /** + * If true, include files in Team Drives in the hold. + */ + includeTeamDriveFiles: boolean; + } /** - * The held accounts on a hold. + * Query options for group holds. */ - accounts: Schema$HeldAccount[]; -} -/** - * The holds for a matter. - */ -export interface Schema$ListHoldsResponse { + export interface Schema$HeldGroupsQuery { + /** + * The end time range for the search query. These timestamps are in GMT and + * rounded down to the start of the given date. + */ + endTime: string; + /** + * The start time range for the search query. These timestamps are in GMT + * and rounded down to the start of the given date. + */ + startTime: string; + /** + * The search terms for the hold. + */ + terms: string; + } /** - * The list of holds. + * Query options for hangouts chat holds. */ - holds: Schema$Hold[]; + export interface Schema$HeldHangoutsChatQuery { + /** + * If true, include rooms the user has participated in. + */ + includeRooms: boolean; + } /** - * Page token to retrieve the next page of results in the list. If this is - * empty, then there are no more holds to list. + * Query options for mail holds. */ - nextPageToken: string; -} -/** - * Provides the list of matters. - */ -export interface Schema$ListMattersResponse { + export interface Schema$HeldMailQuery { + /** + * The end time range for the search query. These timestamps are in GMT and + * rounded down to the start of the given date. + */ + endTime: string; + /** + * The start time range for the search query. These timestamps are in GMT + * and rounded down to the start of the given date. + */ + startTime: string; + /** + * The search terms for the hold. + */ + terms: string; + } /** - * List of matters. + * A organizational unit being held in a particular hold. This structure is + * immutable. */ - matters: Schema$Matter[]; + export interface Schema$HeldOrgUnit { + /** + * When the org unit was put on hold. This property is immutable. + */ + holdTime: string; + /** + * The org unit's immutable ID as provided by the Admin SDK. + */ + orgUnitId: string; + } /** - * Page token to retrieve the next page of results in the list. + * Represents a hold within Vault. A hold restricts purging of artifacts based + * on the combination of the query and accounts restrictions. A hold can be + * configured to either apply to an explicitly configured set of accounts, or + * can be applied to all members of an organizational unit. */ - nextPageToken: string; -} -/** - * Represents a matter. - */ -export interface Schema$Matter { + export interface Schema$Hold { + /** + * If set, the hold applies to the enumerated accounts and org_unit must be + * empty. + */ + accounts: Schema$HeldAccount[]; + /** + * The corpus to be searched. + */ + corpus: string; + /** + * The unique immutable ID of the hold. Assigned during creation. + */ + holdId: string; + /** + * The name of the hold. + */ + name: string; + /** + * If set, the hold applies to all members of the organizational unit and + * accounts must be empty. This property is mutable. For groups holds, set + * the accounts field. + */ + orgUnit: Schema$HeldOrgUnit; + /** + * The corpus-specific query. If set, the corpusQuery must match corpus + * type. + */ + query: Schema$CorpusQuery; + /** + * The last time this hold was modified. + */ + updateTime: string; + } /** - * The description of the matter. + * Returns a list of held accounts for a hold. */ - description: string; + export interface Schema$ListHeldAccountsResponse { + /** + * The held accounts on a hold. + */ + accounts: Schema$HeldAccount[]; + } /** - * The matter ID which is generated by the server. Should be blank when - * creating a new matter. + * The holds for a matter. */ - matterId: string; + export interface Schema$ListHoldsResponse { + /** + * The list of holds. + */ + holds: Schema$Hold[]; + /** + * Page token to retrieve the next page of results in the list. If this is + * empty, then there are no more holds to list. + */ + nextPageToken: string; + } /** - * List of users and access to the matter. Currently there is no programmer - * defined limit on the number of permissions a matter can have. + * Provides the list of matters. */ - matterPermissions: Schema$MatterPermission[]; + export interface Schema$ListMattersResponse { + /** + * List of matters. + */ + matters: Schema$Matter[]; + /** + * Page token to retrieve the next page of results in the list. + */ + nextPageToken: string; + } /** - * The name of the matter. + * Represents a matter. */ - name: string; + export interface Schema$Matter { + /** + * The description of the matter. + */ + description: string; + /** + * The matter ID which is generated by the server. Should be blank when + * creating a new matter. + */ + matterId: string; + /** + * List of users and access to the matter. Currently there is no programmer + * defined limit on the number of permissions a matter can have. + */ + matterPermissions: Schema$MatterPermission[]; + /** + * The name of the matter. + */ + name: string; + /** + * The state of the matter. + */ + state: string; + } /** - * The state of the matter. + * Currently each matter only has one owner, and all others are collaborators. + * When an account is purged, its corresponding MatterPermission resources + * cease to exist. */ - state: string; -} -/** - * Currently each matter only has one owner, and all others are collaborators. - * When an account is purged, its corresponding MatterPermission resources cease - * to exist. - */ -export interface Schema$MatterPermission { + export interface Schema$MatterPermission { + /** + * The account id, as provided by <a + * href="https://developers.google.com/admin-sdk/">Admin + * SDK</a>. + */ + accountId: string; + /** + * The user's role in this matter. + */ + role: string; + } /** - * The account id, as provided by <a - * href="https://developers.google.com/admin-sdk/">Admin - * SDK</a>. + * Remove an account as a matter collaborator. */ - accountId: string; + export interface Schema$RemoveMatterPermissionsRequest { + /** + * The account ID. + */ + accountId: string; + } /** - * The user's role in this matter. + * Reopen a matter by ID. */ - role: string; -} -/** - * Remove an account as a matter collaborator. - */ -export interface Schema$RemoveMatterPermissionsRequest { + export interface Schema$ReopenMatterRequest {} /** - * The account ID. + * Response to a ReopenMatterRequest. */ - accountId: string; -} -/** - * Reopen a matter by ID. - */ -export interface Schema$ReopenMatterRequest {} -/** - * Response to a ReopenMatterRequest. - */ -export interface Schema$ReopenMatterResponse { + export interface Schema$ReopenMatterResponse { + /** + * The updated matter, with state OPEN. + */ + matter: Schema$Matter; + } /** - * The updated matter, with state OPEN. + * Undelete a matter by ID. */ - matter: Schema$Matter; -} -/** - * Undelete a matter by ID. - */ -export interface Schema$UndeleteMatterRequest {} + export interface Schema$UndeleteMatterRequest {} -export class Resource$Matters { - root: Vault; - holds: Resource$Matters$Holds; - constructor(root: Vault) { - this.root = root; - this.getRoot.bind(this); - this.holds = new Resource$Matters$Holds(root); - } + export class Resource$Matters { + root: Vault; + holds: Resource$Matters$Holds; + constructor(root: Vault) { + this.root = root; + this.getRoot.bind(this); + this.holds = new Resource$Matters$Holds(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * vault.matters.addPermissions - * @desc Adds an account as a matter collaborator. - * @alias vault.matters.addPermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().AddMatterPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - addPermissions(params?: any, options?: MethodOptions): - AxiosPromise; - addPermissions( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - addPermissions( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * vault.matters.addPermissions + * @desc Adds an account as a matter collaborator. + * @alias vault.matters.addPermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().AddMatterPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + addPermissions(params?: any, options?: MethodOptions): + AxiosPromise; + addPermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + addPermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}:addPermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}:addPermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.close - * @desc Closes the specified matter. Returns matter with updated state. - * @alias vault.matters.close - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().CloseMatterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - close(params?: any, options?: MethodOptions): - AxiosPromise; - close( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - close( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}:close') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vault.matters.close + * @desc Closes the specified matter. Returns matter with updated state. + * @alias vault.matters.close + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().CloseMatterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + close(params?: any, options?: MethodOptions): + AxiosPromise; + close( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + close( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}:close') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * vault.matters.create - * @desc Creates a new matter with the given name and description. The initial - * state is open, and the owner is the method caller. Returns the created - * matter with default view. - * @alias vault.matters.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().Matter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * vault.matters.create + * @desc Creates a new matter with the given name and description. The + * initial state is open, and the owner is the method caller. Returns the + * created matter with default view. + * @alias vault.matters.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().Matter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.delete - * @desc Deletes the specified matter. Returns matter with updated state. - * @alias vault.matters.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.delete + * @desc Deletes the specified matter. Returns matter with updated state. + * @alias vault.matters.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.get - * @desc Gets the specified matter. - * @alias vault.matters.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {string=} params.view Specifies which parts of the Matter to return in the response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.get + * @desc Gets the specified matter. + * @alias vault.matters.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {string=} params.view Specifies which parts of the Matter to return in the response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.list - * @desc Lists matters the user has access to. - * @alias vault.matters.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {integer=} params.pageSize The number of matters to return in the response. Default and maximum are 100. - * @param {string=} params.pageToken The pagination token as returned in the response. - * @param {string=} params.state If set, list only matters with that specific state. The default is listing matters of all states. - * @param {string=} params.view Specifies which parts of the matter to return in response. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.list + * @desc Lists matters the user has access to. + * @alias vault.matters.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The number of matters to return in the response. Default and maximum are 100. + * @param {string=} params.pageToken The pagination token as returned in the response. + * @param {string=} params.state If set, list only matters with that specific state. The default is listing matters of all states. + * @param {string=} params.view Specifies which parts of the matter to return in response. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.removePermissions - * @desc Removes an account as a matter collaborator. - * @alias vault.matters.removePermissions - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().RemoveMatterPermissionsRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - removePermissions(params?: any, options?: MethodOptions): - AxiosPromise; - removePermissions( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - removePermissions( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.removePermissions + * @desc Removes an account as a matter collaborator. + * @alias vault.matters.removePermissions + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().RemoveMatterPermissionsRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + removePermissions(params?: any, options?: MethodOptions): + AxiosPromise; + removePermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + removePermissions( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}:removePermissions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}:removePermissions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.reopen - * @desc Reopens the specified matter. Returns matter with updated state. - * @alias vault.matters.reopen - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().ReopenMatterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - reopen(params?: any, options?: MethodOptions): - AxiosPromise; - reopen( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reopen( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.reopen + * @desc Reopens the specified matter. Returns matter with updated state. + * @alias vault.matters.reopen + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().ReopenMatterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reopen(params?: any, options?: MethodOptions): + AxiosPromise; + reopen( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + reopen( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}:reopen') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}:reopen') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.undelete - * @desc Undeletes the specified matter. Returns matter with updated state. - * @alias vault.matters.undelete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().UndeleteMatterRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - undelete(params?: any, options?: MethodOptions): AxiosPromise; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - undelete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}:undelete') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vault.matters.undelete + * @desc Undeletes the specified matter. Returns matter with updated state. + * @alias vault.matters.undelete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().UndeleteMatterRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + undelete(params?: any, options?: MethodOptions): + AxiosPromise; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + undelete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}:undelete') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * vault.matters.update - * @desc Updates the specified matter. This updates only the name and - * description of the matter, identified by matter id. Changes to any other - * fields are ignored. Returns the default view of the matter. - * @alias vault.matters.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().Matter} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * vault.matters.update + * @desc Updates the specified matter. This updates only the name and + * description of the matter, identified by matter id. Changes to any other + * fields are ignored. Returns the default view of the matter. + * @alias vault.matters.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().Matter} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Matters$Holds { - root: Vault; - accounts: Resource$Matters$Holds$Accounts; - constructor(root: Vault) { - this.root = root; - this.getRoot.bind(this); - this.accounts = new Resource$Matters$Holds$Accounts(root); } + export class Resource$Matters$Holds { + root: Vault; + accounts: Resource$Matters$Holds$Accounts; + constructor(root: Vault) { + this.root = root; + this.getRoot.bind(this); + this.accounts = new Resource$Matters$Holds$Accounts(root); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * vault.matters.holds.create - * @desc Creates a hold in the given matter. - * @alias vault.matters.holds.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {().Hold} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vault.matters.holds.create + * @desc Creates a hold in the given matter. + * @alias vault.matters.holds.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {().Hold} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * vault.matters.holds.delete - * @desc Removes a hold by ID. This will release any HeldAccounts on this - * Hold. - * @alias vault.matters.holds.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.holdId The hold ID. - * @param {string} params.matterId The matter ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * vault.matters.holds.delete + * @desc Removes a hold by ID. This will release any HeldAccounts on this + * Hold. + * @alias vault.matters.holds.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.holdId The hold ID. + * @param {string} params.matterId The matter ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['matterId', 'holdId'], + pathParams: ['holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['matterId', 'holdId'], - pathParams: ['holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.holds.get - * @desc Gets a hold by ID. - * @alias vault.matters.holds.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.holdId The hold ID. - * @param {string} params.matterId The matter ID. - * @param {string=} params.view Specifies which parts of the Hold to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['matterId', 'holdId'], - pathParams: ['holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vault.matters.holds.get + * @desc Gets a hold by ID. + * @alias vault.matters.holds.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.holdId The hold ID. + * @param {string} params.matterId The matter ID. + * @param {string=} params.view Specifies which parts of the Hold to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['matterId', 'holdId'], + pathParams: ['holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * vault.matters.holds.list - * @desc Lists holds within a matter. An empty page token in ListHoldsResponse - * denotes no more holds to list. - * @alias vault.matters.holds.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.matterId The matter ID. - * @param {integer=} params.pageSize The number of holds to return in the response, between 0 and 100 inclusive. Leaving this empty, or as 0, is the same as page_size = 100. - * @param {string=} params.pageToken The pagination token as returned in the response. An empty token means start from the beginning. - * @param {string=} params.view Specifies which parts of the Hold to return. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.holds.list + * @desc Lists holds within a matter. An empty page token in + * ListHoldsResponse denotes no more holds to list. + * @alias vault.matters.holds.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.matterId The matter ID. + * @param {integer=} params.pageSize The number of holds to return in the response, between 0 and 100 inclusive. Leaving this empty, or as 0, is the same as page_size = 100. + * @param {string=} params.pageToken The pagination token as returned in the response. An empty token means start from the beginning. + * @param {string=} params.view Specifies which parts of the Hold to return. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['matterId'], + pathParams: ['matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['matterId'], - pathParams: ['matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.holds.update - * @desc Updates the OU and/or query parameters of a hold. You cannot add - * accounts to a hold that covers an OU, nor can you add OUs to a hold that - * covers individual accounts. Accounts listed in the hold will be ignored. - * @alias vault.matters.holds.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.holdId The ID of the hold. - * @param {string} params.matterId The matter ID. - * @param {().Hold} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.holds.update + * @desc Updates the OU and/or query parameters of a hold. You cannot add + * accounts to a hold that covers an OU, nor can you add OUs to a hold that + * covers individual accounts. Accounts listed in the hold will be ignored. + * @alias vault.matters.holds.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.holdId The ID of the hold. + * @param {string} params.matterId The matter ID. + * @param {().Hold} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['matterId', 'holdId'], + pathParams: ['holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['matterId', 'holdId'], - pathParams: ['holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Matters$Holds$Accounts { - root: Vault; - constructor(root: Vault) { - this.root = root; - this.getRoot.bind(this); } + export class Resource$Matters$Holds$Accounts { + root: Vault; + constructor(root: Vault) { + this.root = root; + this.getRoot.bind(this); + } - getRoot() { - return this.root; - } + getRoot() { + return this.root; + } - /** - * vault.matters.holds.accounts.create - * @desc Adds a HeldAccount to a hold. Accounts can only be added to a hold - * that has no held_org_unit set. Attempting to add an account to an OU-based - * hold will result in an error. - * @alias vault.matters.holds.accounts.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.holdId The hold ID. - * @param {string} params.matterId The matter ID. - * @param {().HeldAccount} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): - AxiosPromise; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.holds.accounts.create + * @desc Adds a HeldAccount to a hold. Accounts can only be added to a hold + * that has no held_org_unit set. Attempting to add an account to an + * OU-based hold will result in an error. + * @alias vault.matters.holds.accounts.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.holdId The hold ID. + * @param {string} params.matterId The matter ID. + * @param {().HeldAccount} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['matterId', 'holdId'], + pathParams: ['holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['matterId', 'holdId'], - pathParams: ['holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.holds.accounts.delete - * @desc Removes a HeldAccount from a hold. If this request leaves the hold - * with no held accounts, the hold will not apply to any accounts. - * @alias vault.matters.holds.accounts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.accountId The ID of the account to remove from the hold. - * @param {string} params.holdId The hold ID. - * @param {string} params.matterId The matter ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * vault.matters.holds.accounts.delete + * @desc Removes a HeldAccount from a hold. If this request leaves the hold + * with no held accounts, the hold will not apply to any accounts. + * @alias vault.matters.holds.accounts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.accountId The ID of the account to remove from the hold. + * @param {string} params.holdId The hold ID. + * @param {string} params.matterId The matter ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['matterId', 'holdId', 'accountId'], + pathParams: ['accountId', 'holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['matterId', 'holdId', 'accountId'], - pathParams: ['accountId', 'holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * vault.matters.holds.accounts.list - * @desc Lists HeldAccounts for a hold. This will only list individually - * specified held accounts. If the hold is on an OU, then use Admin SDK to enumerate - * its members. - * @alias vault.matters.holds.accounts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.holdId The hold ID. - * @param {string} params.matterId The matter ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}/accounts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['matterId', 'holdId'], - pathParams: ['holdId', 'matterId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vault.matters.holds.accounts.list + * @desc Lists HeldAccounts for a hold. This will only list individually + * specified held accounts. If the hold is on an OU, then use Admin SDK to + * enumerate its members. + * @alias vault.matters.holds.accounts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.holdId The hold ID. + * @param {string} params.matterId The matter ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vault.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/matters/{matterId}/holds/{holdId}/accounts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['matterId', 'holdId'], + pathParams: ['holdId', 'matterId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/videointelligence/v1.ts b/src/apis/videointelligence/v1.ts index 3a4a356d847..0c2f5c36640 100644 --- a/src/apis/videointelligence/v1.ts +++ b/src/apis/videointelligence/v1.ts @@ -27,1518 +27,1533 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Video Intelligence API - * - * Cloud Video Intelligence API. - * - * @example - * const google = require('googleapis'); - * const videointelligence = google.videointelligence('v1'); - * - * @namespace videointelligence - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Videointelligence - */ -export class Videointelligence { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - operations: Resource$Operations; - videos: Resource$Videos; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.operations = new Resource$Operations(this); - this.videos = new Resource$Videos(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; - /** - * Where the label was detected and with what confidence. - */ - locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; -} -/** - * Label location. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Label level. - */ - level: string; - /** - * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, - * timestamp] for frame-level labels. Otherwise, corresponds to one of - * `AnnotateSpec.segments` (if specified) or to shot boundaries (if - * requested). - */ - segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; -} -/** - * Safe search annotation (based on per-frame visual signals only). If no unsafe - * content has been detected in a frame, no annotations are present for that - * frame. If only some types of unsafe content have been detected in a frame, - * the likelihood is set to `UNKNOWN` for all other types of unsafe content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { - /** - * Likelihood of adult content. - */ - adult: string; - /** - * Likelihood of medical content. - */ - medical: string; - /** - * Likelihood of racy content. - */ - racy: string; - /** - * Likelihood that an obvious modification was made to the original version to - * make it appear funny or offensive. - */ - spoof: string; - /** - * Video time offset in microseconds. - */ - timeOffset: string; - /** - * Likelihood of violent content. - */ - violent: string; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations. There is exactly one element for each unique label. - */ - labelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; - /** - * Safe search annotations. - */ - safeSearchAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { - /** - * End offset in microseconds (inclusive). Unset means 0. - */ - endTimeOffset: string; - /** - * Start offset in microseconds (inclusive). Unset means 0. - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; - /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; - /** - * Label annotations on shot level. There is exactly one element for each - * unique label. - */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; -} -/** - * Emotion attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { - /** - * Emotion entry. - */ - emotion: string; - /** - * Confidence score. - */ - score: number; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Face detection annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { - /** - * All video frames where a face was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; - /** - * All video segments where a face was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; -} -/** - * Face detection attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { - /** - * Emotion attributes. - */ - emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; - /** - * Normalized Bounding box. - */ - normalizedBoundingBox: - Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; -} -/** - * Video frame level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { - /** - * Face attributes in a frame. There can be more than one attributes if the - * same face is detected in multiple locations within the current frame. - */ - attributes: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { - /** - * Video segment where a face was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Normalized bounding box. The normalized vertex coordinates are relative to - * the original image. Range: [0, 1]. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { - /** - * Bottom Y coordinate. - */ - bottom: number; - /** - * Left X coordinate. - */ - left: number; - /** - * Right X coordinate. - */ - right: number; - /** - * Top Y coordinate. - */ - top: number; -} -/** - * Alternative hypotheses (a.k.a. n-best list). - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { - /** - * Output only. The confidence estimate between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. This field is typically provided only for the top hypothesis, and - * only for `is_final=true` results. Clients should not rely on the - * `confidence` field as it is not guaranteed to be accurate or consistent. - * The default of 0.0 is a sentinel value indicating `confidence` was not set. - */ - confidence: number; - /** - * Output only. Transcript text representing the words that the user spoke. - */ - transcript: string; - /** - * Output only. A list of word-specific information for each recognized word. - */ - words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; -} -/** - * A speech recognition result corresponding to a portion of the audio. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { - /** - * Output only. May contain one or more recognition hypotheses (up to the - * maximum specified in `max_alternatives`). These alternatives are ordered in - * terms of accuracy, with the top (first) alternative being the most - * probable, as ranked by the recognizer. - */ - // clang-format off - alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; - // clang-format on -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; - /** - * Face detection annotations. - */ - faceDetectionAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; - /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; +export namespace videointelligence_v1 { /** - * Label annotations on shot level. There is exactly one element for each - * unique label. - */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + * Cloud Video Intelligence API + * + * Cloud Video Intelligence API. + * + * @example + * const google = require('googleapis'); + * const videointelligence = google.videointelligence('v1'); + * + * @namespace videointelligence + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Videointelligence + */ + export class Videointelligence { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + operations: Resource$Operations; + videos: Resource$Videos; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.operations = new Resource$Operations(this); + this.videos = new Resource$Videos(this); + } + + getRoot() { + return this.root; + } + } + /** - * Speech transcription. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - speechTranscriptions: - Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - endTimeOffset: string; + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Word-specific information for recognized words. Word information is only - * included in the response when certain request parameters are set, such as - * `enable_word_time_offsets`. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + /** + * Where the label was detected and with what confidence. + */ + locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the end of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. - */ - endTime: string; + * Label location. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Label level. + */ + level: string; + /** + * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, + * timestamp] for frame-level labels. Otherwise, corresponds to one of + * `AnnotateSpec.segments` (if specified) or to shot boundaries (if + * requested). + */ + segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the start of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. - */ - startTime: string; + * Safe search annotation (based on per-frame visual signals only). If no + * unsafe content has been detected in a frame, no annotations are present for + * that frame. If only some types of unsafe content have been detected in a + * frame, the likelihood is set to `UNKNOWN` for all other types of unsafe + * content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { + /** + * Likelihood of adult content. + */ + adult: string; + /** + * Likelihood of medical content. + */ + medical: string; + /** + * Likelihood of racy content. + */ + racy: string; + /** + * Likelihood that an obvious modification was made to the original version + * to make it appear funny or offensive. + */ + spoof: string; + /** + * Video time offset in microseconds. + */ + timeOffset: string; + /** + * Likelihood of violent content. + */ + violent: string; + } /** - * Output only. The word corresponding to this set of information. - */ - word: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; -} -/** - * Video annotation request. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoRequest { + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations. There is exactly one element for each unique label. + */ + labelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; + /** + * Safe search annotations. + */ + safeSearchAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; + } /** - * Requested video annotation features. - */ - features: string[]; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { + /** + * End offset in microseconds (inclusive). Unset means 0. + */ + endTimeOffset: string; + /** + * Start offset in microseconds (inclusive). Unset means 0. + */ + startTimeOffset: string; + } /** - * The video data bytes. If unset, the input video(s) should be specified via - * `input_uri`. If set, `input_uri` should be unset. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - inputContent: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; + } /** - * Input video location. Currently, only [Google Cloud - * Storage](https://cloud.google.com/storage/) URIs are supported, which must - * be specified in the following format: `gs://bucket-id/object-id` (other URI - * formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see - * [Request URIs](/storage/docs/reference-uris). A video URI may include - * wildcards in `object-id`, and thus identify multiple videos. Supported - * wildcards: '*' to match 0 or more characters; '?' to match - * 1 character. If unset, the input video should be embedded in the request as - * `input_content`. If set, `input_content` should be unset. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - inputUri: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; + } /** - * Optional cloud region where annotation should take place. Supported cloud - * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - * is specified, a region will be determined based on video file location. - */ - locationId: string; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Optional location where the output (in JSON format) should be stored. - * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - * URIs are supported, which must be specified in the following format: - * `gs://bucket-id/object-id` (other URI formats return - * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request - * URIs](/storage/docs/reference-uris). + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - outputUri: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; + } /** - * Additional video context and/or feature-specific parameters. - */ - videoContext: Schema$GoogleCloudVideointelligenceV1_VideoContext; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1_Entity { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; + } /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; + } /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; -} -/** - * Config for EXPLICIT_CONTENT_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentDetectionConfig { + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + } /** - * Model to use for explicit content detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". - */ - model: string; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * Likelihood of the pornography content.. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - pornographyLikelihood: string; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; + } /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + * Emotion attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { + /** + * Emotion entry. + */ + emotion: string; + /** + * Confidence score. + */ + score: number; + } /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1_Entity; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * All video frames where a label was detected. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; + } /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; -} -/** - * Config for LABEL_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelDetectionConfig { + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * What labels should be detected with LABEL_DETECTION, in addition to - * video-level labels or segment-level labels. If unspecified, defaults to - * `SHOT_MODE`. - */ - labelDetectionMode: string; + * Face detection annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { + /** + * All video frames where a face was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; + /** + * All video segments where a face was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; + } /** - * Model to use for label detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". - */ - model: string; + * Face detection attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { + /** + * Emotion attributes. + */ + emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; + /** + * Normalized Bounding box. + */ + normalizedBoundingBox: + Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; + } /** - * Whether the video has been shot from a stationary (i.e. non-moving) camera. - * When set to true, might improve detection accuracy for moving objects. - * Should be used with `SHOT_AND_FRAME_MODE` enabled. - */ - stationaryCamera: boolean; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + * Video frame level annotation results for face detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { + /** + * Face attributes in a frame. There can be more than one attributes if the + * same face is detected in multiple locations within the current frame. + */ + attributes: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Confidence that the label is accurate. Range: [0, 1]. + * Video segment level annotation results for face detection. */ - confidence: number; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { + /** + * Video segment where a face was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; + } /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; -} -/** - * Config for SHOT_CHANGE_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ShotChangeDetectionConfig { + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Model to use for shot change detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". - */ - model: string; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + * Normalized bounding box. The normalized vertex coordinates are relative to + * the original image. Range: [0, 1]. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { + /** + * Bottom Y coordinate. + */ + bottom: number; + /** + * Left X coordinate. + */ + left: number; + /** + * Right X coordinate. + */ + right: number; + /** + * Top Y coordinate. + */ + top: number; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Alternative hypotheses (a.k.a. n-best list). + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is typically provided only for the top hypothesis, + * and only for `is_final=true` results. Clients should not rely on the + * `confidence` field as it is not guaranteed to be accurate or consistent. + * The default of 0.0 is a sentinel value indicating `confidence` was not + * set. + */ + confidence: number; + /** + * Output only. Transcript text representing the words that the user spoke. + */ + transcript: string; + /** + * Output only. A list of word-specific information for each recognized + * word. + */ + words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; + } /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; + * A speech recognition result corresponding to a portion of the audio. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { + /** + * Output only. May contain one or more recognition hypotheses (up to the + * maximum specified in `max_alternatives`). These alternatives are ordered + * in terms of accuracy, with the top (first) alternative being the most + * probable, as ranked by the recognizer. + */ + // clang-format off + alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; + // clang-format on + } /** - * Time when the request was received. - */ - startTime: string; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; + /** + * Face detection annotations. + */ + faceDetectionAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Speech transcription. + */ + speechTranscriptions: + Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; + } /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + * Word-specific information for recognized words. Word information is only + * included in the response when certain request parameters are set, such as + * `enable_word_time_offsets`. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + endTime: string; + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + startTime: string; + /** + * Output only. The word corresponding to this set of information. + */ + word: string; + } /** - * Label annotations on frame level. There is exactly one element for each - * unique label. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video annotation request. + */ + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoRequest { + /** + * Requested video annotation features. + */ + features: string[]; + /** + * The video data bytes. If unset, the input video(s) should be specified + * via `input_uri`. If set, `input_uri` should be unset. + */ + inputContent: string; + /** + * Input video location. Currently, only [Google Cloud + * Storage](https://cloud.google.com/storage/) URIs are supported, which + * must be specified in the following format: `gs://bucket-id/object-id` + * (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more + * information, see [Request URIs](/storage/docs/reference-uris). A video + * URI may include wildcards in `object-id`, and thus identify multiple + * videos. Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be + * embedded in the request as `input_content`. If set, `input_content` + * should be unset. + */ + inputUri: string; + /** + * Optional cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, a region will be determined based on video file + * location. + */ + locationId: string; + /** + * Optional location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request + * URIs](/storage/docs/reference-uris). + */ + outputUri: string; + /** + * Additional video context and/or feature-specific parameters. + */ + videoContext: Schema$GoogleCloudVideointelligenceV1_VideoContext; + } /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; + } /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Label annotations on shot level. There is exactly one element for each - * unique label. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - shotLabelAnnotations: Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; -} -/** - * Video context and/or feature-specific parameters. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoContext { + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; + } /** * Config for EXPLICIT_CONTENT_DETECTION. */ - explicitContentDetectionConfig: - Schema$GoogleCloudVideointelligenceV1_ExplicitContentDetectionConfig; - /** - * Config for LABEL_DETECTION. - */ - labelDetectionConfig: - Schema$GoogleCloudVideointelligenceV1_LabelDetectionConfig; - /** - * Video segments to annotate. The segments may overlap and are not required - * to be contiguous or span the whole video. If unspecified, each video is - * treated as a single segment. - */ - segments: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentDetectionConfig { + /** + * Model to use for explicit content detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + } /** - * Config for SHOT_CHANGE_DETECTION. - */ - shotChangeDetectionConfig: - Schema$GoogleCloudVideointelligenceV1_ShotChangeDetectionConfig; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). + * Config for LABEL_DETECTION. */ - startTimeOffset: string; -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$GoogleLongrunning_CancelOperationRequest {} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$GoogleLongrunning_ListOperationsResponse { + export interface Schema$GoogleCloudVideointelligenceV1_LabelDetectionConfig { + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. If unspecified, defaults to + * `SHOT_MODE`. + */ + labelDetectionMode: string; + /** + * Model to use for label detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + /** + * Whether the video has been shot from a stationary (i.e. non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + */ + stationaryCamera: boolean; + } /** - * The standard List next-page token. - */ - nextPageToken: string; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$GoogleLongrunning_Operation[]; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunning_Operation { + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. + * Config for SHOT_CHANGE_DETECTION. */ - done: boolean; + export interface Schema$GoogleCloudVideointelligenceV1_ShotChangeDetectionConfig { + /** + * Model to use for shot change detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpc_Status; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Video context and/or feature-specific parameters. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoContext { + /** + * Config for EXPLICIT_CONTENT_DETECTION. + */ + explicitContentDetectionConfig: + Schema$GoogleCloudVideointelligenceV1_ExplicitContentDetectionConfig; + /** + * Config for LABEL_DETECTION. + */ + labelDetectionConfig: + Schema$GoogleCloudVideointelligenceV1_LabelDetectionConfig; + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + */ + segments: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + /** + * Config for SHOT_CHANGE_DETECTION. + */ + shotChangeDetectionConfig: + Schema$GoogleCloudVideointelligenceV1_ShotChangeDetectionConfig; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$GoogleProtobuf_Empty {} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpc_Status { + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. + * The request message for Operations.CancelOperation. */ - code: number; + export interface Schema$GoogleLongrunning_CancelOperationRequest {} /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. + * The response message for Operations.ListOperations. */ - details: any[]; + export interface Schema$GoogleLongrunning_ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$GoogleLongrunning_Operation[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Operations { - root: Videointelligence; - constructor(root: Videointelligence) { - this.root = root; - this.getRoot.bind(this); + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunning_Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpc_Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$GoogleProtobuf_Empty {} + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpc_Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * videointelligence.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias videointelligence.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().GoogleLongrunning_CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): - AxiosPromise; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Operations { + root: Videointelligence; + constructor(root: Videointelligence) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations/{+name}:cancel') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * videointelligence.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias videointelligence.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * videointelligence.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias videointelligence.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().GoogleLongrunning_CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): + AxiosPromise; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * videointelligence.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias videointelligence.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): - AxiosPromise; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - get(params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * videointelligence.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias videointelligence.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations/{+name}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * videointelligence.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias videointelligence.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string=} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleLongrunning_ListOperationsResponse>): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback< - Schema$GoogleLongrunning_ListOperationsResponse>): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * videointelligence.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias videointelligence.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): + AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations/{+name}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} -export class Resource$Videos { - root: Videointelligence; - constructor(root: Videointelligence) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * videointelligence.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias videointelligence.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string=} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunning_ListOperationsResponse>): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback< + Schema$GoogleLongrunning_ListOperationsResponse>): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/operations').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleLongrunning_ListOperationsResponse>(parameters); + } + } } - - /** - * videointelligence.videos.annotate - * @desc Performs asynchronous video annotation. Progress and results can be - * retrieved through the `google.longrunning.Operations` interface. - * `Operation.metadata` contains `AnnotateVideoProgress` (progress). - * `Operation.response` contains `AnnotateVideoResponse` (results). - * @alias videointelligence.videos.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVideointelligenceV1_AnnotateVideoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): - AxiosPromise; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Videos { + root: Videointelligence; + constructor(root: Videointelligence) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/videos:annotate').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * videointelligence.videos.annotate + * @desc Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * @alias videointelligence.videos.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVideointelligenceV1_AnnotateVideoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): + AxiosPromise; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/videos:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/videointelligence/v1beta1.ts b/src/apis/videointelligence/v1beta1.ts index 91b489d0075..bf5cbd648c3 100644 --- a/src/apis/videointelligence/v1beta1.ts +++ b/src/apis/videointelligence/v1beta1.ts @@ -27,1193 +27,1205 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Video Intelligence API - * - * Cloud Video Intelligence API. - * - * @example - * const google = require('googleapis'); - * const videointelligence = google.videointelligence('v1beta1'); - * - * @namespace videointelligence - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Videointelligence - */ -export class Videointelligence { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace videointelligence_v1beta1 { + /** + * Cloud Video Intelligence API + * + * Cloud Video Intelligence API. + * + * @example + * const google = require('googleapis'); + * const videointelligence = google.videointelligence('v1beta1'); + * + * @namespace videointelligence + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Videointelligence + */ + export class Videointelligence { + _options: GlobalOptions; + google: GoogleApis; + root = this; - videos: Resource$Videos; + videos: Resource$Videos; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.videos = new Resource$Videos(this); - } + this.videos = new Resource$Videos(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation request. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest { - /** - * Requested video annotation features. - */ - features: string[]; - /** - * The video data bytes. Encoding: base64. If unset, the input video(s) should - * be specified via `input_uri`. If set, `input_uri` should be unset. - */ - inputContent: string; - /** - * Input video location. Currently, only [Google Cloud - * Storage](https://cloud.google.com/storage/) URIs are supported, which must - * be specified in the following format: `gs://bucket-id/object-id` (other URI - * formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see - * [Request URIs](/storage/docs/reference-uris). A video URI may include - * wildcards in `object-id`, and thus identify multiple videos. Supported - * wildcards: '*' to match 0 or more characters; '?' to match - * 1 character. If unset, the input video should be embedded in the request as - * `input_content`. If set, `input_content` should be unset. - */ - inputUri: string; - /** - * Optional cloud region where annotation should take place. Supported cloud - * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - * is specified, a region will be determined based on video file location. - */ - locationId: string; - /** - * Optional location where the output (in JSON format) should be stored. - * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - * URIs are supported, which must be specified in the following format: - * `gs://bucket-id/object-id` (other URI formats return - * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request - * URIs](/storage/docs/reference-uris). - */ - outputUri: string; - /** - * Additional video context and/or feature-specific parameters. - */ - videoContext: Schema$GoogleCloudVideointelligenceV1beta1_VideoContext; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; - /** - * Where the label was detected and with what confidence. - */ - locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; -} -/** - * Label location. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Label level. - */ - level: string; - /** - * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, - * timestamp] for frame-level labels. Otherwise, corresponds to one of - * `AnnotateSpec.segments` (if specified) or to shot boundaries (if - * requested). - */ - segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; -} -/** - * Safe search annotation (based on per-frame visual signals only). If no unsafe - * content has been detected in a frame, no annotations are present for that - * frame. If only some types of unsafe content have been detected in a frame, - * the likelihood is set to `UNKNOWN` for all other types of unsafe content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { - /** - * Likelihood of adult content. - */ - adult: string; - /** - * Likelihood of medical content. - */ - medical: string; - /** - * Likelihood of racy content. - */ - racy: string; - /** - * Likelihood that an obvious modification was made to the original version to - * make it appear funny or offensive. - */ - spoof: string; - /** - * Video time offset in microseconds. - */ - timeOffset: string; - /** - * Likelihood of violent content. - */ - violent: string; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations. There is exactly one element for each unique label. - */ - labelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; - /** - * Safe search annotations. - */ - safeSearchAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; -} -/** - * Video context and/or feature-specific parameters. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoContext { - /** - * If label detection has been requested, what labels should be detected in - * addition to video-level labels or segment-level labels. If unspecified, - * defaults to `SHOT_MODE`. - */ - labelDetectionMode: string; - /** - * Model to use for label detection. Supported values: "latest" and - * "stable" (the default). - */ - labelDetectionModel: string; - /** - * Model to use for safe search detection. Supported values: - * "latest" and "stable" (the default). - */ - safeSearchDetectionModel: string; - /** - * Video segments to annotate. The segments may overlap and are not required - * to be contiguous or span the whole video. If unspecified, each video is - * treated as a single segment. - */ - segments: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; - /** - * Model to use for shot change detection. Supported values: - * "latest" and "stable" (the default). - */ - shotChangeDetectionModel: string; - /** - * Whether the video has been shot from a stationary (i.e. non-moving) camera. - * When set to true, might improve detection accuracy for moving objects. - */ - stationaryCamera: boolean; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { - /** - * End offset in microseconds (inclusive). Unset means 0. - */ - endTimeOffset: string; - /** - * Start offset in microseconds (inclusive). Unset means 0. - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; - /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; - /** - * Label annotations on shot level. There is exactly one element for each - * unique label. - */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; -} -/** - * Emotion attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { - /** - * Emotion entry. - */ - emotion: string; - /** - * Confidence score. - */ - score: number; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Face detection annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { - /** - * All video frames where a face was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; - /** - * All video segments where a face was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; -} -/** - * Face detection attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { - /** - * Emotion attributes. - */ - emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; - /** - * Normalized Bounding box. - */ - normalizedBoundingBox: - Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; -} -/** - * Video frame level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { - /** - * Face attributes in a frame. There can be more than one attributes if the - * same face is detected in multiple locations within the current frame. - */ - attributes: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { - /** - * Video segment where a face was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Normalized bounding box. The normalized vertex coordinates are relative to - * the original image. Range: [0, 1]. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { - /** - * Bottom Y coordinate. - */ - bottom: number; - /** - * Left X coordinate. - */ - left: number; - /** - * Right X coordinate. - */ - right: number; - /** - * Top Y coordinate. - */ - top: number; -} -/** - * Alternative hypotheses (a.k.a. n-best list). - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { - /** - * Output only. The confidence estimate between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. This field is typically provided only for the top hypothesis, and - * only for `is_final=true` results. Clients should not rely on the - * `confidence` field as it is not guaranteed to be accurate or consistent. - * The default of 0.0 is a sentinel value indicating `confidence` was not set. - */ - confidence: number; - /** - * Output only. Transcript text representing the words that the user spoke. - */ - transcript: string; - /** - * Output only. A list of word-specific information for each recognized word. - */ - words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; -} -/** - * A speech recognition result corresponding to a portion of the audio. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { /** - * Output only. May contain one or more recognition hypotheses (up to the - * maximum specified in `max_alternatives`). These alternatives are ordered in - * terms of accuracy, with the top (first) alternative being the most - * probable, as ranked by the recognizer. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - // clang-format off - alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; - // clang-format on -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; + } /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { + * Video annotation request. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest { + /** + * Requested video annotation features. + */ + features: string[]; + /** + * The video data bytes. Encoding: base64. If unset, the input video(s) + * should be specified via `input_uri`. If set, `input_uri` should be unset. + */ + inputContent: string; + /** + * Input video location. Currently, only [Google Cloud + * Storage](https://cloud.google.com/storage/) URIs are supported, which + * must be specified in the following format: `gs://bucket-id/object-id` + * (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more + * information, see [Request URIs](/storage/docs/reference-uris). A video + * URI may include wildcards in `object-id`, and thus identify multiple + * videos. Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be + * embedded in the request as `input_content`. If set, `input_content` + * should be unset. + */ + inputUri: string; + /** + * Optional cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, a region will be determined based on video file + * location. + */ + locationId: string; + /** + * Optional location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request + * URIs](/storage/docs/reference-uris). + */ + outputUri: string; + /** + * Additional video context and/or feature-specific parameters. + */ + videoContext: Schema$GoogleCloudVideointelligenceV1beta1_VideoContext; + } /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - error: Schema$GoogleRpc_Status; + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; + } /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + /** + * Where the label was detected and with what confidence. + */ + locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; + } /** - * Face detection annotations. - */ - faceDetectionAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; + * Label location. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Label level. + */ + level: string; + /** + * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, + * timestamp] for frame-level labels. Otherwise, corresponds to one of + * `AnnotateSpec.segments` (if specified) or to shot boundaries (if + * requested). + */ + segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; + } /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + * Safe search annotation (based on per-frame visual signals only). If no + * unsafe content has been detected in a frame, no annotations are present for + * that frame. If only some types of unsafe content have been detected in a + * frame, the likelihood is set to `UNKNOWN` for all other types of unsafe + * content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { + /** + * Likelihood of adult content. + */ + adult: string; + /** + * Likelihood of medical content. + */ + medical: string; + /** + * Likelihood of racy content. + */ + racy: string; + /** + * Likelihood that an obvious modification was made to the original version + * to make it appear funny or offensive. + */ + spoof: string; + /** + * Video time offset in microseconds. + */ + timeOffset: string; + /** + * Likelihood of violent content. + */ + violent: string; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations. There is exactly one element for each unique label. + */ + labelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; + /** + * Safe search annotations. + */ + safeSearchAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; + } /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; + * Video context and/or feature-specific parameters. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoContext { + /** + * If label detection has been requested, what labels should be detected in + * addition to video-level labels or segment-level labels. If unspecified, + * defaults to `SHOT_MODE`. + */ + labelDetectionMode: string; + /** + * Model to use for label detection. Supported values: "latest" + * and "stable" (the default). + */ + labelDetectionModel: string; + /** + * Model to use for safe search detection. Supported values: + * "latest" and "stable" (the default). + */ + safeSearchDetectionModel: string; + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + */ + segments: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; + /** + * Model to use for shot change detection. Supported values: + * "latest" and "stable" (the default). + */ + shotChangeDetectionModel: string; + /** + * Whether the video has been shot from a stationary (i.e. non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. + */ + stationaryCamera: boolean; + } /** - * Label annotations on shot level. There is exactly one element for each - * unique label. - */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { + /** + * End offset in microseconds (inclusive). Unset means 0. + */ + endTimeOffset: string; + /** + * Start offset in microseconds (inclusive). Unset means 0. + */ + startTimeOffset: string; + } /** - * Speech transcription. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - speechTranscriptions: - Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - endTimeOffset: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Word-specific information for recognized words. Word information is only - * included in the response when certain request parameters are set, such as - * `enable_word_time_offsets`. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the end of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - endTime: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the start of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. - */ - startTime: string; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Output only. The word corresponding to this set of information. - */ - word: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; + } /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1_Entity { + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; + } /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + } /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * All video frames where explicit content was detected. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; + } /** - * Likelihood of the pornography content.. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - pornographyLikelihood: string; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + * Emotion attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { + /** + * Emotion entry. + */ + emotion: string; + /** + * Confidence score. + */ + score: number; + } /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Detected entity. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - entity: Schema$GoogleCloudVideointelligenceV1_Entity; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; + } /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + * Face detection annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { + /** + * All video frames where a face was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; + /** + * All video segments where a face was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; + } /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; + * Face detection attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { + /** + * Emotion attributes. + */ + emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; + /** + * Normalized Bounding box. + */ + normalizedBoundingBox: + Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + * Video frame level annotation results for face detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { + /** + * Face attributes in a frame. There can be more than one attributes if the + * same face is detected in multiple locations within the current frame. + */ + attributes: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Confidence that the label is accurate. Range: [0, 1]. + * Video segment level annotation results for face detection. */ - confidence: number; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { + /** + * Video segment where a face was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Time when the request was received. - */ - startTime: string; + * Normalized bounding box. The normalized vertex coordinates are relative to + * the original image. Range: [0, 1]. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { + /** + * Bottom Y coordinate. + */ + bottom: number; + /** + * Left X coordinate. + */ + left: number; + /** + * Right X coordinate. + */ + right: number; + /** + * Top Y coordinate. + */ + top: number; + } /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + * Alternative hypotheses (a.k.a. n-best list). + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is typically provided only for the top hypothesis, + * and only for `is_final=true` results. Clients should not rely on the + * `confidence` field as it is not guaranteed to be accurate or consistent. + * The default of 0.0 is a sentinel value indicating `confidence` was not + * set. + */ + confidence: number; + /** + * Output only. Transcript text representing the words that the user spoke. + */ + transcript: string; + /** + * Output only. A list of word-specific information for each recognized + * word. + */ + words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; + } /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; + * A speech recognition result corresponding to a portion of the audio. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { + /** + * Output only. May contain one or more recognition hypotheses (up to the + * maximum specified in `max_alternatives`). These alternatives are ordered + * in terms of accuracy, with the top (first) alternative being the most + * probable, as ranked by the recognizer. + */ + // clang-format off + alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; + // clang-format on + } /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; + /** + * Face detection annotations. + */ + faceDetectionAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Speech transcription. + */ + speechTranscriptions: + Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + * Word-specific information for recognized words. Word information is only + * included in the response when certain request parameters are set, such as + * `enable_word_time_offsets`. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + endTime: string; + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + startTime: string; + /** + * Output only. The word corresponding to this set of information. + */ + word: string; + } /** - * Shot annotations. Each shot is represented as a video segment. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; + } /** - * Label annotations on shot level. There is exactly one element for each - * unique label. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - shotLabelAnnotations: Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - startTimeOffset: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunning_Operation { + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpc_Status; + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpc_Status { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Videos { - root: Videointelligence; - constructor(root: Videointelligence) { - this.root = root; - this.getRoot.bind(this); + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunning_Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpc_Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpc_Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * videointelligence.videos.annotate - * @desc Performs asynchronous video annotation. Progress and results can be - * retrieved through the `google.longrunning.Operations` interface. - * `Operation.metadata` contains `AnnotateVideoProgress` (progress). - * `Operation.response` contains `AnnotateVideoResponse` (results). - * @alias videointelligence.videos.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): - AxiosPromise; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Videos { + root: Videointelligence; + constructor(root: Videointelligence) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta1/videos:annotate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * videointelligence.videos.annotate + * @desc Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * @alias videointelligence.videos.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVideointelligenceV1beta1_AnnotateVideoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): + AxiosPromise; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta1/videos:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/videointelligence/v1beta2.ts b/src/apis/videointelligence/v1beta2.ts index 00ca14b8526..3f7e0f6011b 100644 --- a/src/apis/videointelligence/v1beta2.ts +++ b/src/apis/videointelligence/v1beta2.ts @@ -27,1227 +27,1238 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Video Intelligence API - * - * Cloud Video Intelligence API. - * - * @example - * const google = require('googleapis'); - * const videointelligence = google.videointelligence('v1beta2'); - * - * @namespace videointelligence - * @type {Function} - * @version v1beta2 - * @variation v1beta2 - * @param {object=} options Options for Videointelligence - */ -export class Videointelligence { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace videointelligence_v1beta2 { + /** + * Cloud Video Intelligence API + * + * Cloud Video Intelligence API. + * + * @example + * const google = require('googleapis'); + * const videointelligence = google.videointelligence('v1beta2'); + * + * @namespace videointelligence + * @type {Function} + * @version v1beta2 + * @variation v1beta2 + * @param {object=} options Options for Videointelligence + */ + export class Videointelligence { + _options: GlobalOptions; + google: GoogleApis; + root = this; - videos: Resource$Videos; + videos: Resource$Videos; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.videos = new Resource$Videos(this); - } + this.videos = new Resource$Videos(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; - /** - * Where the label was detected and with what confidence. - */ - locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; -} -/** - * Label location. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Label level. - */ - level: string; - /** - * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, - * timestamp] for frame-level labels. Otherwise, corresponds to one of - * `AnnotateSpec.segments` (if specified) or to shot boundaries (if - * requested). - */ - segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; -} -/** - * Safe search annotation (based on per-frame visual signals only). If no unsafe - * content has been detected in a frame, no annotations are present for that - * frame. If only some types of unsafe content have been detected in a frame, - * the likelihood is set to `UNKNOWN` for all other types of unsafe content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { - /** - * Likelihood of adult content. - */ - adult: string; - /** - * Likelihood of medical content. - */ - medical: string; - /** - * Likelihood of racy content. - */ - racy: string; - /** - * Likelihood that an obvious modification was made to the original version to - * make it appear funny or offensive. - */ - spoof: string; - /** - * Video time offset in microseconds. - */ - timeOffset: string; - /** - * Likelihood of violent content. - */ - violent: string; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations. There is exactly one element for each unique label. - */ - labelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; - /** - * Safe search annotations. - */ - safeSearchAnnotations: - Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { - /** - * End offset in microseconds (inclusive). Unset means 0. - */ - endTimeOffset: string; - /** - * Start offset in microseconds (inclusive). Unset means 0. - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; -} -/** - * Video annotation request. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoRequest { - /** - * Requested video annotation features. - */ - features: string[]; - /** - * The video data bytes. If unset, the input video(s) should be specified via - * `input_uri`. If set, `input_uri` should be unset. - */ - inputContent: string; - /** - * Input video location. Currently, only [Google Cloud - * Storage](https://cloud.google.com/storage/) URIs are supported, which must - * be specified in the following format: `gs://bucket-id/object-id` (other URI - * formats return google.rpc.Code.INVALID_ARGUMENT). For more information, see - * [Request URIs](/storage/docs/reference-uris). A video URI may include - * wildcards in `object-id`, and thus identify multiple videos. Supported - * wildcards: '*' to match 0 or more characters; '?' to match - * 1 character. If unset, the input video should be embedded in the request as - * `input_content`. If set, `input_content` should be unset. - */ - inputUri: string; - /** - * Optional cloud region where annotation should take place. Supported cloud - * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - * is specified, a region will be determined based on video file location. - */ - locationId: string; - /** - * Optional location where the output (in JSON format) should be stored. - * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - * URIs are supported, which must be specified in the following format: - * `gs://bucket-id/object-id` (other URI formats return - * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request - * URIs](/storage/docs/reference-uris). - */ - outputUri: string; - /** - * Additional video context and/or feature-specific parameters. - */ - videoContext: Schema$GoogleCloudVideointelligenceV1beta2_VideoContext; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; -} -/** - * Config for EXPLICIT_CONTENT_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentDetectionConfig { - /** - * Model to use for explicit content detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". - */ - model: string; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; -} -/** - * Config for LABEL_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelDetectionConfig { - /** - * What labels should be detected with LABEL_DETECTION, in addition to - * video-level labels or segment-level labels. If unspecified, defaults to - * `SHOT_MODE`. - */ - labelDetectionMode: string; - /** - * Model to use for label detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". - */ - model: string; /** - * Whether the video has been shot from a stationary (i.e. non-moving) camera. - * When set to true, might improve detection accuracy for moving objects. - * Should be used with `SHOT_AND_FRAME_MODE` enabled. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - stationaryCamera: boolean; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; -} -/** - * Config for SHOT_CHANGE_DETECTION. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_ShotChangeDetectionConfig { + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress[]; + } /** - * Model to use for shot change detection. Supported values: - * "builtin/stable" (the default if unset) and - * "builtin/latest". + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - model: string; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { + export interface Schema$GoogleCloudVideointelligenceV1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + /** + * Where the label was detected and with what confidence. + */ + locations: Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation[]; + } /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; + * Label location. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_LabelLocation { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Label level. + */ + level: string; + /** + * Video segment. Set to [-1, -1] for video-level labels. Set to [timestamp, + * timestamp] for frame-level labels. Otherwise, corresponds to one of + * `AnnotateSpec.segments` (if specified) or to shot boundaries (if + * requested). + */ + segment: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment; + } /** - * Time when the request was received. - */ - startTime: string; + * Safe search annotation (based on per-frame visual signals only). If no + * unsafe content has been detected in a frame, no annotations are present for + * that frame. If only some types of unsafe content have been detected in a + * frame, the likelihood is set to `UNKNOWN` for all other types of unsafe + * content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation { + /** + * Likelihood of adult content. + */ + adult: string; + /** + * Likelihood of medical content. + */ + medical: string; + /** + * Likelihood of racy content. + */ + racy: string; + /** + * Likelihood that an obvious modification was made to the original version + * to make it appear funny or offensive. + */ + spoof: string; + /** + * Video time offset in microseconds. + */ + timeOffset: string; + /** + * Likelihood of violent content. + */ + violent: string; + } /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations. There is exactly one element for each unique label. + */ + labelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_LabelAnnotation[]; + /** + * Safe search annotations. + */ + safeSearchAnnotations: + Schema$GoogleCloudVideointelligenceV1beta1_SafeSearchAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment[]; + } /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta1_VideoSegment { + /** + * End offset in microseconds (inclusive). Unset means 0. + */ + endTimeOffset: string; + /** + * Start offset in microseconds (inclusive). Unset means 0. + */ + startTimeOffset: string; + } /** - * Label annotations on frame level. There is exactly one element for each - * unique label. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video annotation request. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoRequest { + /** + * Requested video annotation features. + */ + features: string[]; + /** + * The video data bytes. If unset, the input video(s) should be specified + * via `input_uri`. If set, `input_uri` should be unset. + */ + inputContent: string; + /** + * Input video location. Currently, only [Google Cloud + * Storage](https://cloud.google.com/storage/) URIs are supported, which + * must be specified in the following format: `gs://bucket-id/object-id` + * (other URI formats return google.rpc.Code.INVALID_ARGUMENT). For more + * information, see [Request URIs](/storage/docs/reference-uris). A video + * URI may include wildcards in `object-id`, and thus identify multiple + * videos. Supported wildcards: '*' to match 0 or more characters; + * '?' to match 1 character. If unset, the input video should be + * embedded in the request as `input_content`. If set, `input_content` + * should be unset. + */ + inputUri: string; + /** + * Optional cloud region where annotation should take place. Supported cloud + * regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no + * region is specified, a region will be determined based on video file + * location. + */ + locationId: string; + /** + * Optional location where the output (in JSON format) should be stored. + * Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) + * URIs are supported, which must be specified in the following format: + * `gs://bucket-id/object-id` (other URI formats return + * google.rpc.Code.INVALID_ARGUMENT). For more information, see [Request + * URIs](/storage/docs/reference-uris). + */ + outputUri: string; + /** + * Additional video context and/or feature-specific parameters. + */ + videoContext: Schema$GoogleCloudVideointelligenceV1beta2_VideoContext; + } /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + export interface Schema$GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults[]; + } /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Label annotations on shot level. There is exactly one element for each - * unique label. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; -} -/** - * Video context and/or feature-specific parameters. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoContext { + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame[]; + } /** * Config for EXPLICIT_CONTENT_DETECTION. */ - explicitContentDetectionConfig: - Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentDetectionConfig; - /** - * Config for LABEL_DETECTION. - */ - labelDetectionConfig: - Schema$GoogleCloudVideointelligenceV1beta2_LabelDetectionConfig; - /** - * Video segments to annotate. The segments may overlap and are not required - * to be contiguous or span the whole video. If unspecified, each video is - * treated as a single segment. - */ - segments: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; - /** - * Config for SHOT_CHANGE_DETECTION. - */ - shotChangeDetectionConfig: - Schema$GoogleCloudVideointelligenceV1beta2_ShotChangeDetectionConfig; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { - /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. - */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { - /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; -} -/** - * Emotion attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { - /** - * Emotion entry. - */ - emotion: string; - /** - * Confidence score. - */ - score: number; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { - /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; - /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { - /** - * All video frames where explicit content was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { - /** - * Likelihood of the pornography content.. - */ - pornographyLikelihood: string; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Face detection annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { - /** - * All video frames where a face was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; - /** - * All video segments where a face was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; -} -/** - * Face detection attribute. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { - /** - * Emotion attributes. - */ - emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; - /** - * Normalized Bounding box. - */ - normalizedBoundingBox: - Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; -} -/** - * Video frame level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { - /** - * Face attributes in a frame. There can be more than one attributes if the - * same face is detected in multiple locations within the current frame. - */ - attributes: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for face detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { - /** - * Video segment where a face was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { - /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; - /** - * Detected entity. - */ - entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; - /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; - /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { - /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; - /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; -} -/** - * Normalized bounding box. The normalized vertex coordinates are relative to - * the original image. Range: [0, 1]. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { - /** - * Bottom Y coordinate. - */ - bottom: number; - /** - * Left X coordinate. - */ - left: number; - /** - * Right X coordinate. - */ - right: number; - /** - * Top Y coordinate. - */ - top: number; -} -/** - * Alternative hypotheses (a.k.a. n-best list). - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { - /** - * Output only. The confidence estimate between 0.0 and 1.0. A higher number - * indicates an estimated greater likelihood that the recognized words are - * correct. This field is typically provided only for the top hypothesis, and - * only for `is_final=true` results. Clients should not rely on the - * `confidence` field as it is not guaranteed to be accurate or consistent. - * The default of 0.0 is a sentinel value indicating `confidence` was not set. - */ - confidence: number; - /** - * Output only. Transcript text representing the words that the user spoke. - */ - transcript: string; - /** - * Output only. A list of word-specific information for each recognized word. - */ - words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; -} -/** - * A speech recognition result corresponding to a portion of the audio. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { - /** - * Output only. May contain one or more recognition hypotheses (up to the - * maximum specified in `max_alternatives`). These alternatives are ordered in - * terms of accuracy, with the top (first) alternative being the most - * probable, as ranked by the recognizer. - */ - // clang-format off - alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; - // clang-format on -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; - /** - * Time when the request was received. - */ - startTime: string; - /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { - /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; - /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; - /** - * Face detection annotations. - */ - faceDetectionAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; - /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; - /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; - /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; - /** - * Shot annotations. Each shot is represented as a video segment. - */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; - /** - * Label annotations on shot level. There is exactly one element for each - * unique label. - */ - shotLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; - /** - * Speech transcription. - */ - speechTranscriptions: - Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentDetectionConfig { + /** + * Model to use for explicit content detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). - */ - startTimeOffset: string; -} -/** - * Word-specific information for recognized words. Word information is only - * included in the response when certain request parameters are set, such as - * `enable_word_time_offsets`. - */ -export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1beta2_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1beta2_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment[]; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the end of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. + * Config for LABEL_DETECTION. */ - endTime: string; + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelDetectionConfig { + /** + * What labels should be detected with LABEL_DETECTION, in addition to + * video-level labels or segment-level labels. If unspecified, defaults to + * `SHOT_MODE`. + */ + labelDetectionMode: string; + /** + * Model to use for label detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + /** + * Whether the video has been shot from a stationary (i.e. non-moving) + * camera. When set to true, might improve detection accuracy for moving + * objects. Should be used with `SHOT_AND_FRAME_MODE` enabled. + */ + stationaryCamera: boolean; + } /** - * Output only. Time offset relative to the beginning of the audio, and - * corresponding to the start of the spoken word. This field is only set if - * `enable_word_time_offsets=true` and only in the top hypothesis. This is an - * experimental feature and the accuracy of the time offset can vary. - */ - startTime: string; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Output only. The word corresponding to this set of information. - */ - word: string; -} -/** - * Video annotation progress. Included in the `metadata` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment; + } /** - * Progress metadata for all videos specified in `AnnotateVideoRequest`. + * Config for SHOT_CHANGE_DETECTION. */ - annotationProgress: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; -} -/** - * Video annotation response. Included in the `response` field of the - * `Operation` returned by the `GetOperation` call of the - * `google::longrunning::Operations` service. - */ -export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + export interface Schema$GoogleCloudVideointelligenceV1beta2_ShotChangeDetectionConfig { + /** + * Model to use for shot change detection. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + } /** - * Annotation results for all videos specified in `AnnotateVideoRequest`. - */ - annotationResults: - Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; -} -/** - * Detected entity from video analysis. - */ -export interface Schema$GoogleCloudVideointelligenceV1_Entity { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Textual description, e.g. `Fixed-gear bicycle`. - */ - description: string; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1beta2_LabelAnnotation[]; + } /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - entityId: string; + * Video context and/or feature-specific parameters. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoContext { + /** + * Config for EXPLICIT_CONTENT_DETECTION. + */ + explicitContentDetectionConfig: + Schema$GoogleCloudVideointelligenceV1beta2_ExplicitContentDetectionConfig; + /** + * Config for LABEL_DETECTION. + */ + labelDetectionConfig: + Schema$GoogleCloudVideointelligenceV1beta2_LabelDetectionConfig; + /** + * Video segments to annotate. The segments may overlap and are not required + * to be contiguous or span the whole video. If unspecified, each video is + * treated as a single segment. + */ + segments: Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment[]; + /** + * Config for SHOT_CHANGE_DETECTION. + */ + shotChangeDetectionConfig: + Schema$GoogleCloudVideointelligenceV1beta2_ShotChangeDetectionConfig; + } /** - * Language code for `description` in BCP-47 format. - */ - languageCode: string; -} -/** - * Explicit content annotation (based on per-frame visual signals only). If no - * explicit content has been detected in a frame, no annotations are present for - * that frame. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1beta2_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * All video frames where explicit content was detected. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; -} -/** - * Video frame level annotation results for explicit content. - */ -export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress[]; + } /** - * Likelihood of the pornography content.. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - pornographyLikelihood: string; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Label annotation. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + * Emotion attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute { + /** + * Emotion entry. + */ + emotion: string; + /** + * Confidence score. + */ + score: number; + } /** - * Common categories for the detected entity. E.g. when the label is `Terrier` - * the category is likely `dog`. And in some cases there might be more than - * one categories e.g. `Terrier` could also be a `pet`. - */ - categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Detected entity. + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - entity: Schema$GoogleCloudVideointelligenceV1_Entity; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame[]; + } /** - * All video frames where a label was detected. - */ - frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * All video segments where a label was detected. - */ - segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; -} -/** - * Video frame level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + * Face detection annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation { + /** + * All video frames where a face was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame[]; + /** + * All video segments where a face was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment[]; + } /** - * Confidence that the label is accurate. Range: [0, 1]. - */ - confidence: number; + * Face detection attribute. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute { + /** + * Emotion attributes. + */ + emotions: Schema$GoogleCloudVideointelligenceV1p1beta1_EmotionAttribute[]; + /** + * Normalized Bounding box. + */ + normalizedBoundingBox: + Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * video frame for this location. - */ - timeOffset: string; -} -/** - * Video segment level annotation results for label detection. - */ -export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + * Video frame level annotation results for face detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionFrame { + /** + * Face attributes in a frame. There can be more than one attributes if the + * same face is detected in multiple locations within the current frame. + */ + attributes: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAttribute[]; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Confidence that the label is accurate. Range: [0, 1]. + * Video segment level annotation results for face detection. */ - confidence: number; + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_FaceSegment { + /** + * Video segment where a face was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Video segment where a label was detected. - */ - segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; -} -/** - * Annotation progress for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1p1beta1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * Approximate percentage processed thus far. Guaranteed to be 100 when fully - * processed. - */ - progressPercent: number; + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment; + } /** - * Time when the request was received. - */ - startTime: string; + * Normalized bounding box. The normalized vertex coordinates are relative to + * the original image. Range: [0, 1]. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_NormalizedBoundingBox { + /** + * Bottom Y coordinate. + */ + bottom: number; + /** + * Left X coordinate. + */ + left: number; + /** + * Right X coordinate. + */ + right: number; + /** + * Top Y coordinate. + */ + top: number; + } /** - * Time of the most recent update. - */ - updateTime: string; -} -/** - * Annotation results for a single video. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + * Alternative hypotheses (a.k.a. n-best list). + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative { + /** + * Output only. The confidence estimate between 0.0 and 1.0. A higher number + * indicates an estimated greater likelihood that the recognized words are + * correct. This field is typically provided only for the top hypothesis, + * and only for `is_final=true` results. Clients should not rely on the + * `confidence` field as it is not guaranteed to be accurate or consistent. + * The default of 0.0 is a sentinel value indicating `confidence` was not + * set. + */ + confidence: number; + /** + * Output only. Transcript text representing the words that the user spoke. + */ + transcript: string; + /** + * Output only. A list of word-specific information for each recognized + * word. + */ + words: Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo[]; + } /** - * If set, indicates an error. Note that for a single `AnnotateVideoRequest` - * some videos may succeed and some may fail. - */ - error: Schema$GoogleRpc_Status; + * A speech recognition result corresponding to a portion of the audio. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription { + /** + * Output only. May contain one or more recognition hypotheses (up to the + * maximum specified in `max_alternatives`). These alternatives are ordered + * in terms of accuracy, with the top (first) alternative being the most + * probable, as ranked by the recognizer. + */ + // clang-format off + alternatives: Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechRecognitionAlternative[]; + // clang-format on + } /** - * Explicit content annotation. - */ - explicitAnnotation: - Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * Label annotations on frame level. There is exactly one element for each - * unique label. - */ - frameLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1p1beta1_ExplicitContentAnnotation; + /** + * Face detection annotations. + */ + faceDetectionAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_FaceDetectionAnnotation[]; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1p1beta1_LabelAnnotation[]; + /** + * Speech transcription. + */ + speechTranscriptions: + Schema$GoogleCloudVideointelligenceV1p1beta1_SpeechTranscription[]; + } /** - * Video file location in [Google Cloud - * Storage](https://cloud.google.com/storage/). - */ - inputUri: string; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * Label annotations on video level or user specified segment level. There is - * exactly one element for each unique label. - */ - segmentLabelAnnotations: - Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + * Word-specific information for recognized words. Word information is only + * included in the response when certain request parameters are set, such as + * `enable_word_time_offsets`. + */ + export interface Schema$GoogleCloudVideointelligenceV1p1beta1_WordInfo { + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the end of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + endTime: string; + /** + * Output only. Time offset relative to the beginning of the audio, and + * corresponding to the start of the spoken word. This field is only set if + * `enable_word_time_offsets=true` and only in the top hypothesis. This is + * an experimental feature and the accuracy of the time offset can vary. + */ + startTime: string; + /** + * Output only. The word corresponding to this set of information. + */ + word: string; + } /** - * Shot annotations. Each shot is represented as a video segment. + * Video annotation progress. Included in the `metadata` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoProgress { + /** + * Progress metadata for all videos specified in `AnnotateVideoRequest`. + */ + annotationProgress: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress[]; + } /** - * Label annotations on shot level. There is exactly one element for each - * unique label. + * Video annotation response. Included in the `response` field of the + * `Operation` returned by the `GetOperation` call of the + * `google::longrunning::Operations` service. */ - shotLabelAnnotations: Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; -} -/** - * Video segment. - */ -export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + export interface Schema$GoogleCloudVideointelligenceV1_AnnotateVideoResponse { + /** + * Annotation results for all videos specified in `AnnotateVideoRequest`. + */ + annotationResults: + Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults[]; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * end of the segment (inclusive). - */ - endTimeOffset: string; + * Detected entity from video analysis. + */ + export interface Schema$GoogleCloudVideointelligenceV1_Entity { + /** + * Textual description, e.g. `Fixed-gear bicycle`. + */ + description: string; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + entityId: string; + /** + * Language code for `description` in BCP-47 format. + */ + languageCode: string; + } /** - * Time-offset, relative to the beginning of the video, corresponding to the - * start of the segment (inclusive). + * Explicit content annotation (based on per-frame visual signals only). If no + * explicit content has been detected in a frame, no annotations are present + * for that frame. */ - startTimeOffset: string; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$GoogleLongrunning_Operation { + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation { + /** + * All video frames where explicit content was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame[]; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; + * Video frame level annotation results for explicit content. + */ + export interface Schema$GoogleCloudVideointelligenceV1_ExplicitContentFrame { + /** + * Likelihood of the pornography content.. + */ + pornographyLikelihood: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$GoogleRpc_Status; + * Label annotation. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelAnnotation { + /** + * Common categories for the detected entity. E.g. when the label is + * `Terrier` the category is likely `dog`. And in some cases there might be + * more than one categories e.g. `Terrier` could also be a `pet`. + */ + categoryEntities: Schema$GoogleCloudVideointelligenceV1_Entity[]; + /** + * Detected entity. + */ + entity: Schema$GoogleCloudVideointelligenceV1_Entity; + /** + * All video frames where a label was detected. + */ + frames: Schema$GoogleCloudVideointelligenceV1_LabelFrame[]; + /** + * All video segments where a label was detected. + */ + segments: Schema$GoogleCloudVideointelligenceV1_LabelSegment[]; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Video frame level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelFrame { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * video frame for this location. + */ + timeOffset: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Video segment level annotation results for label detection. + */ + export interface Schema$GoogleCloudVideointelligenceV1_LabelSegment { + /** + * Confidence that the label is accurate. Range: [0, 1]. + */ + confidence: number; + /** + * Video segment where a label was detected. + */ + segment: Schema$GoogleCloudVideointelligenceV1_VideoSegment; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$GoogleRpc_Status { + * Annotation progress for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationProgress { + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Approximate percentage processed thus far. Guaranteed to be 100 when + * fully processed. + */ + progressPercent: number; + /** + * Time when the request was received. + */ + startTime: string; + /** + * Time of the most recent update. + */ + updateTime: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Annotation results for a single video. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoAnnotationResults { + /** + * If set, indicates an error. Note that for a single `AnnotateVideoRequest` + * some videos may succeed and some may fail. + */ + error: Schema$GoogleRpc_Status; + /** + * Explicit content annotation. + */ + explicitAnnotation: + Schema$GoogleCloudVideointelligenceV1_ExplicitContentAnnotation; + /** + * Label annotations on frame level. There is exactly one element for each + * unique label. + */ + frameLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Video file location in [Google Cloud + * Storage](https://cloud.google.com/storage/). + */ + inputUri: string; + /** + * Label annotations on video level or user specified segment level. There + * is exactly one element for each unique label. + */ + segmentLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + /** + * Shot annotations. Each shot is represented as a video segment. + */ + shotAnnotations: Schema$GoogleCloudVideointelligenceV1_VideoSegment[]; + /** + * Label annotations on shot level. There is exactly one element for each + * unique label. + */ + shotLabelAnnotations: + Schema$GoogleCloudVideointelligenceV1_LabelAnnotation[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Video segment. + */ + export interface Schema$GoogleCloudVideointelligenceV1_VideoSegment { + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * end of the segment (inclusive). + */ + endTimeOffset: string; + /** + * Time-offset, relative to the beginning of the video, corresponding to the + * start of the segment (inclusive). + */ + startTimeOffset: string; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Videos { - root: Videointelligence; - constructor(root: Videointelligence) { - this.root = root; - this.getRoot.bind(this); + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$GoogleLongrunning_Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$GoogleRpc_Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$GoogleRpc_Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * videointelligence.videos.annotate - * @desc Performs asynchronous video annotation. Progress and results can be - * retrieved through the `google.longrunning.Operations` interface. - * `Operation.metadata` contains `AnnotateVideoProgress` (progress). - * `Operation.response` contains `AnnotateVideoResponse` (results). - * @alias videointelligence.videos.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVideointelligenceV1beta2_AnnotateVideoRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): - AxiosPromise; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Videos { + root: Videointelligence; + constructor(root: Videointelligence) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://videointelligence.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1beta2/videos:annotate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * videointelligence.videos.annotate + * @desc Performs asynchronous video annotation. Progress and results can be + * retrieved through the `google.longrunning.Operations` interface. + * `Operation.metadata` contains `AnnotateVideoProgress` (progress). + * `Operation.response` contains `AnnotateVideoResponse` (results). + * @alias videointelligence.videos.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVideointelligenceV1beta2_AnnotateVideoRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): + AxiosPromise; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://videointelligence.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1beta2/videos:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/vision/v1.ts b/src/apis/vision/v1.ts index 50d1fe6040d..f42b476fd6d 100644 --- a/src/apis/vision/v1.ts +++ b/src/apis/vision/v1.ts @@ -27,2370 +27,2393 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Vision API - * - * Integrates Google Vision features, including image labeling, face, logo, and - * landmark detection, optical character recognition (OCR), and detection of - * explicit content, into applications. - * - * @example - * const google = require('googleapis'); - * const vision = google.vision('v1'); - * - * @namespace vision - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Vision - */ -export class Vision { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace vision_v1 { + /** + * Cloud Vision API + * + * Integrates Google Vision features, including image labeling, face, logo, + * and landmark detection, optical character recognition (OCR), and detection + * of explicit content, into applications. + * + * @example + * const google = require('googleapis'); + * const vision = google.vision('v1'); + * + * @namespace vision + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Vision + */ + export class Vision { + _options: GlobalOptions; + google: GoogleApis; + root = this; - images: Resource$Images; - locations: Resource$Locations; - operations: Resource$Operations; + images: Resource$Images; + locations: Resource$Locations; + operations: Resource$Operations; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.images = new Resource$Images(this); - this.locations = new Resource$Locations(this); - this.operations = new Resource$Operations(this); - } + this.images = new Resource$Images(this); + this.locations = new Resource$Locations(this); + this.operations = new Resource$Operations(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Request for performing Google Cloud Vision API tasks over a user-provided - * image, with user-requested features. - */ -export interface Schema$AnnotateImageRequest { - /** - * Requested features. - */ - features: Schema$Feature[]; - /** - * The image to be processed. - */ - image: Schema$Image; - /** - * Additional context that may accompany the image. - */ - imageContext: Schema$ImageContext; -} -/** - * Response to an image annotation request. - */ -export interface Schema$AnnotateImageResponse { - /** - * If present, crop hints have completed successfully. - */ - cropHintsAnnotation: Schema$CropHintsAnnotation; - /** - * If set, represents the error message for the operation. Note that filled-in - * image annotations are guaranteed to be correct, even when `error` is set. - */ - error: Schema$Status; - /** - * If present, face detection has completed successfully. - */ - faceAnnotations: Schema$FaceAnnotation[]; - /** - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. This annotation provides the structural hierarchy - * for the OCR detected text. - */ - fullTextAnnotation: Schema$TextAnnotation; - /** - * If present, image properties were extracted successfully. - */ - imagePropertiesAnnotation: Schema$ImageProperties; - /** - * If present, label detection has completed successfully. - */ - labelAnnotations: Schema$EntityAnnotation[]; - /** - * If present, landmark detection has completed successfully. - */ - landmarkAnnotations: Schema$EntityAnnotation[]; - /** - * If present, logo detection has completed successfully. - */ - logoAnnotations: Schema$EntityAnnotation[]; - /** - * If present, safe-search annotation has completed successfully. - */ - safeSearchAnnotation: Schema$SafeSearchAnnotation; - /** - * If present, text (OCR) detection has completed successfully. - */ - textAnnotations: Schema$EntityAnnotation[]; - /** - * If present, web detection has completed successfully. - */ - webDetection: Schema$WebDetection; -} -/** - * Multiple image annotation requests are batched into a single service call. - */ -export interface Schema$BatchAnnotateImagesRequest { - /** - * Individual image annotation requests for this batch. - */ - requests: Schema$AnnotateImageRequest[]; -} -/** - * Response to a batch image annotation request. - */ -export interface Schema$BatchAnnotateImagesResponse { - /** - * Individual responses to image annotation requests within the batch. - */ - responses: Schema$AnnotateImageResponse[]; -} -/** - * Logical element on the page. - */ -export interface Schema$Block { - /** - * Detected block type (text, image etc) for this block. - */ - blockType: string; - /** - * The bounding box for the block. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 - * | | 3----2 * when it's rotated 180 degrees around the - * top-left corner it becomes: 2----3 | | 1----0 - * and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$BoundingPoly; - /** - * Confidence of the OCR results on the block. Range [0, 1]. - */ - confidence: number; - /** - * List of paragraphs in this block (if this blocks is of type text). - */ - paragraphs: Schema$Paragraph[]; - /** - * Additional information detected for the block. - */ - property: Schema$TextProperty; -} -/** - * A bounding polygon for the detected image annotation. - */ -export interface Schema$BoundingPoly { - /** - * The bounding polygon vertices. - */ - vertices: Schema$Vertex[]; -} -/** - * The request message for Operations.CancelOperation. - */ -export interface Schema$CancelOperationRequest {} -/** - * Represents a color in the RGBA color space. This representation is designed - * for simplicity of conversion to/from color representations in various - * languages over compactness; for example, the fields of this representation - * can be trivially provided to the constructor of "java.awt.Color" in - * Java; it can also be trivially provided to UIColor's - * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a - * little work, it can be easily formatted into a CSS "rgba()" string - * in JavaScript, as well. Here are some examples: Example (Java): import - * com.google.type.Color; // ... public static java.awt.Color - * fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? - * protocolor.getAlpha().getValue() : 1.0; return new - * java.awt.Color( protocolor.getRed(), protocolor.getGreen(), - * protocolor.getBlue(), alpha); } public static Color - * toProto(java.awt.Color color) { float red = (float) color.getRed(); - * float green = (float) color.getGreen(); float blue = (float) - * color.getBlue(); float denominator = 255.0; Color.Builder - * resultBuilder = Color .newBuilder() .setRed(red / - * denominator) .setGreen(green / denominator) .setBlue(blue / - * denominator); int alpha = color.getAlpha(); if (alpha != 255) { - * result.setAlpha( FloatValue .newBuilder() - * .setValue(((float) alpha) / denominator) .build()); } - * return resultBuilder.build(); } // ... Example (iOS / Obj-C): // - * ... static UIColor* fromProto(Color* protocolor) { float red = - * [protocolor red]; float green = [protocolor green]; float - * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor - * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha - * = [alpha_wrapper value]; } return [UIColor colorWithRed:red - * green:green blue:blue alpha:alpha]; } static Color* - * toProto(UIColor* color) { CGFloat red, green, blue, alpha; if - * (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - * return nil; } Color* result = [Color alloc] init]; [result - * setRed:red]; [result setGreen:green]; [result - * setBlue:blue]; if (alpha <= 0.9999) { [result - * setAlpha:floatWrapperWithValue(alpha)]; } [result - * autorelease]; return result; } // ... Example - * (JavaScript): // ... var protoToCssColor = function(rgb_color) { - * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || - * 0.0; var blueFrac = rgb_color.blue || 0.0; var red = - * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); - * var blue = Math.floor(blueFrac * 255); if (!('alpha' in - * rgb_color)) { return rgbToCssColor_(red, green, blue); } var - * alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, - * blue].join(','); return ['rgba(', rgbParams, - * ',', alphaFrac, ')'].join(''); }; var - * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new - * Number((red << 16) | (green << 8) | blue); var hexString = - * rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var - * resultBuilder = ['#']; for (var i = 0; i < missingZeros; - * i++) { resultBuilder.push('0'); } - * resultBuilder.push(hexString); return resultBuilder.join(''); - * }; // ... - */ -export interface Schema$Color { - /** - * The fraction of this color that should be applied to the pixel. That is, - * the final pixel color is defined by the equation: pixel color = alpha * - * (this color) + (1.0 - alpha) * (background color) This means that a value - * of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to - * a completely transparent color. This uses a wrapper message rather than a - * simple float scalar so that it is possible to distinguish between a default - * value and the value being unset. If omitted, this color object is to be - * rendered as a solid color (as if the alpha value had been explicitly given - * with a value of 1.0). - */ - alpha: number; - /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; - /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; - /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * Color information consists of RGB channels, score, and the fraction of the - * image that the color occupies in the image. - */ -export interface Schema$ColorInfo { - /** - * RGB components of the color. - */ - color: Schema$Color; - /** - * The fraction of pixels the color occupies in the image. Value in range [0, - * 1]. - */ - pixelFraction: number; - /** - * Image-specific score for this color. Value in range [0, 1]. - */ - score: number; -} -/** - * Single crop hint that is used to generate a new crop when serving an image. - */ -export interface Schema$CropHint { - /** - * The bounding polygon for the crop region. The coordinates of the bounding - * box are in the original image's scale, as returned in `ImageParams`. - */ - boundingPoly: Schema$BoundingPoly; - /** - * Confidence of this being a salient region. Range [0, 1]. - */ - confidence: number; - /** - * Fraction of importance of this salient region with respect to the original - * image. - */ - importanceFraction: number; -} -/** - * Set of crop hints that are used to generate new crops when serving images. - */ -export interface Schema$CropHintsAnnotation { - /** - * Crop hint results. - */ - cropHints: Schema$CropHint[]; -} -/** - * Parameters for crop hints annotation request. - */ -export interface Schema$CropHintsParams { - /** - * Aspect ratios in floats, representing the ratio of the width to the height - * of the image. For example, if the desired aspect ratio is 4/3, the - * corresponding float value should be 1.33333. If not specified, the best - * possible crop is returned. The number of provided aspect ratios is limited - * to a maximum of 16; any aspect ratios provided after the 16th are ignored. - */ - aspectRatios: number[]; -} -/** - * Detected start or end of a structural component. - */ -export interface Schema$DetectedBreak { - /** - * True if break prepends the element. - */ - isPrefix: boolean; - /** - * Detected break type. - */ - type: string; -} -/** - * Detected language for a structural component. - */ -export interface Schema$DetectedLanguage { - /** - * Confidence of detected language. Range [0, 1]. - */ - confidence: number; /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Set of dominant colors and their corresponding scores. - */ -export interface Schema$DominantColorsAnnotation { - /** - * RGB color values with their score and pixel fraction. - */ - colors: Schema$ColorInfo[]; -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * Set of detected entity features. - */ -export interface Schema$EntityAnnotation { - /** - * Image region to which this entity belongs. Not produced for - * `LABEL_DETECTION` features. - */ - boundingPoly: Schema$BoundingPoly; - /** - * **Deprecated. Use `score` instead.** The accuracy of the entity detection - * in an image. For example, for an image in which the "Eiffel - * Tower" entity is detected, this field represents the confidence that - * there is a tower in the query image. Range [0, 1]. - */ - confidence: number; - /** - * Entity textual description, expressed in its `locale` language. - */ - description: string; - /** - * The language code for the locale in which the entity textual `description` - * is expressed. - */ - locale: string; - /** - * The location information for the detected entity. Multiple `LocationInfo` - * elements can be present because one location may indicate the location of - * the scene in the image, and another location may indicate the location of - * the place where the image was taken. Location information is usually - * present for landmarks. - */ - locations: Schema$LocationInfo[]; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - mid: string; - /** - * Some entities may have optional user-supplied `Property` (name/value) - * fields, such a score or string that qualifies the entity. - */ - properties: Schema$Property[]; - /** - * Overall score of the result. Range [0, 1]. - */ - score: number; - /** - * The relevancy of the ICA (Image Content Annotation) label to the image. For - * example, the relevancy of "tower" is likely higher to an image - * containing the detected "Eiffel Tower" than to an image - * containing a detected distant towering building, even though the confidence - * that there is a tower in each image may be the same. Range [0, 1]. - */ - topicality: number; -} -/** - * A face annotation object contains the results of face detection. - */ -export interface Schema$FaceAnnotation { - /** - * Anger likelihood. - */ - angerLikelihood: string; - /** - * Blurred likelihood. - */ - blurredLikelihood: string; - /** - * The bounding polygon around the face. The coordinates of the bounding box - * are in the original image's scale, as returned in `ImageParams`. The - * bounding box is computed to "frame" the face in accordance with - * human expectations. It is based on the landmarker results. Note that one or - * more x and/or y coordinates may not be generated in the `BoundingPoly` (the - * polygon will be unbounded) if only a partial face appears in the image to - * be annotated. - */ - boundingPoly: Schema$BoundingPoly; - /** - * Detection confidence. Range [0, 1]. - */ - detectionConfidence: number; - /** - * The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, - * and encloses only the skin part of the face. Typically, it is used to - * eliminate the face from any image analysis that detects the "amount of - * skin" visible in an image. It is not based on the landmarker results, - * only on the initial face detection, hence the <code>fd</code> - * (face detection) prefix. - */ - fdBoundingPoly: Schema$BoundingPoly; - /** - * Headwear likelihood. - */ - headwearLikelihood: string; - /** - * Joy likelihood. - */ - joyLikelihood: string; - /** - * Face landmarking confidence. Range [0, 1]. - */ - landmarkingConfidence: number; - /** - * Detected face landmarks. - */ - landmarks: Schema$Landmark[]; - /** - * Yaw angle, which indicates the leftward/rightward angle that the face is - * pointing relative to the vertical plane perpendicular to the image. Range - * [-180,180]. - */ - panAngle: number; - /** - * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - * of the face relative to the image vertical about the axis perpendicular to - * the face. Range [-180,180]. - */ - rollAngle: number; - /** - * Sorrow likelihood. - */ - sorrowLikelihood: string; - /** - * Surprise likelihood. - */ - surpriseLikelihood: string; - /** - * Pitch angle, which indicates the upwards/downwards angle that the face is - * pointing relative to the image's horizontal plane. Range [-180,180]. - */ - tiltAngle: number; - /** - * Under-exposed likelihood. - */ - underExposedLikelihood: string; -} -/** - * The type of Google Cloud Vision API detection to perform, and the maximum - * number of results to return for that type. Multiple `Feature` objects can be - * specified in the `features` list. - */ -export interface Schema$Feature { - /** - * Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, - * `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - */ - maxResults: number; - /** - * Model to use for the feature. Supported values: "builtin/stable" - * (the default if unset) and "builtin/latest". - */ - model: string; - /** - * The feature type. - */ - type: string; -} -/** - * Response to a single file annotation request. A file may contain one or more - * images, which individually have their own responses. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { - /** - * Information about the file for which this response is generated. - */ - inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; - /** - * Individual responses to images found within the file. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; -} -/** - * Response to an image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { - /** - * If present, contextual information is needed to understand where this image - * comes from. - */ - context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; - /** - * If present, crop hints have completed successfully. - */ - cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; - /** - * If set, represents the error message for the operation. Note that filled-in - * image annotations are guaranteed to be correct, even when `error` is set. - */ - error: Schema$Status; - /** - * If present, face detection has completed successfully. - */ - faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; - /** - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. This annotation provides the structural hierarchy - * for the OCR detected text. - */ - fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; - /** - * If present, image properties were extracted successfully. - */ - imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; - /** - * If present, label detection has completed successfully. - */ - labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, landmark detection has completed successfully. - */ - landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, logo detection has completed successfully. - */ - logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, safe-search annotation has completed successfully. - */ - safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; - /** - * If present, text (OCR) detection has completed successfully. - */ - textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, web detection has completed successfully. - */ - webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; -} -/** - * The response for a single offline file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { - /** - * The output location and metadata from AsyncAnnotateFileRequest. - */ - outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; -} -/** - * Response to an async batch file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { - /** - * The list of file annotation responses, one for each request in - * AsyncBatchAnnotateFilesRequest. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; -} -/** - * Logical element on the page. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Block { - /** - * Detected block type (text, image etc) for this block. - */ - blockType: string; + * Request for performing Google Cloud Vision API tasks over a user-provided + * image, with user-requested features. + */ + export interface Schema$AnnotateImageRequest { + /** + * Requested features. + */ + features: Schema$Feature[]; + /** + * The image to be processed. + */ + image: Schema$Image; + /** + * Additional context that may accompany the image. + */ + imageContext: Schema$ImageContext; + } /** - * The bounding box for the block. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 - * | | 3----2 * when it's rotated 180 degrees around the - * top-left corner it becomes: 2----3 | | 1----0 - * and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + * Response to an image annotation request. + */ + export interface Schema$AnnotateImageResponse { + /** + * If present, crop hints have completed successfully. + */ + cropHintsAnnotation: Schema$CropHintsAnnotation; + /** + * If set, represents the error message for the operation. Note that + * filled-in image annotations are guaranteed to be correct, even when + * `error` is set. + */ + error: Schema$Status; + /** + * If present, face detection has completed successfully. + */ + faceAnnotations: Schema$FaceAnnotation[]; + /** + * If present, text (OCR) detection or document (OCR) text detection has + * completed successfully. This annotation provides the structural hierarchy + * for the OCR detected text. + */ + fullTextAnnotation: Schema$TextAnnotation; + /** + * If present, image properties were extracted successfully. + */ + imagePropertiesAnnotation: Schema$ImageProperties; + /** + * If present, label detection has completed successfully. + */ + labelAnnotations: Schema$EntityAnnotation[]; + /** + * If present, landmark detection has completed successfully. + */ + landmarkAnnotations: Schema$EntityAnnotation[]; + /** + * If present, logo detection has completed successfully. + */ + logoAnnotations: Schema$EntityAnnotation[]; + /** + * If present, safe-search annotation has completed successfully. + */ + safeSearchAnnotation: Schema$SafeSearchAnnotation; + /** + * If present, text (OCR) detection has completed successfully. + */ + textAnnotations: Schema$EntityAnnotation[]; + /** + * If present, web detection has completed successfully. + */ + webDetection: Schema$WebDetection; + } /** - * Confidence of the OCR results on the block. Range [0, 1]. + * Multiple image annotation requests are batched into a single service call. */ - confidence: number; + export interface Schema$BatchAnnotateImagesRequest { + /** + * Individual image annotation requests for this batch. + */ + requests: Schema$AnnotateImageRequest[]; + } /** - * List of paragraphs in this block (if this blocks is of type text). + * Response to a batch image annotation request. */ - paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; + export interface Schema$BatchAnnotateImagesResponse { + /** + * Individual responses to image annotation requests within the batch. + */ + responses: Schema$AnnotateImageResponse[]; + } /** - * Additional information detected for the block. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; -} -/** - * A bounding polygon for the detected image annotation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { - /** - * The bounding polygon normalized vertices. - */ - normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; - /** - * The bounding polygon vertices. - */ - vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; -} -/** - * Color information consists of RGB channels, score, and the fraction of the - * image that the color occupies in the image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { - /** - * RGB components of the color. - */ - color: Schema$Color; - /** - * The fraction of pixels the color occupies in the image. Value in range [0, - * 1]. - */ - pixelFraction: number; - /** - * Image-specific score for this color. Value in range [0, 1]. - */ - score: number; -} -/** - * Single crop hint that is used to generate a new crop when serving an image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHint { - /** - * The bounding polygon for the crop region. The coordinates of the bounding - * box are in the original image's scale, as returned in `ImageParams`. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of this being a salient region. Range [0, 1]. - */ - confidence: number; - /** - * Fraction of importance of this salient region with respect to the original - * image. - */ - importanceFraction: number; -} -/** - * Set of crop hints that are used to generate new crops when serving images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { - /** - * Crop hint results. - */ - cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; -} -/** - * Set of dominant colors and their corresponding scores. - */ -export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { - /** - * RGB color values with their score and pixel fraction. - */ - colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; -} -/** - * Set of detected entity features. - */ -export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { - /** - * Image region to which this entity belongs. Not produced for - * `LABEL_DETECTION` features. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * **Deprecated. Use `score` instead.** The accuracy of the entity detection - * in an image. For example, for an image in which the "Eiffel - * Tower" entity is detected, this field represents the confidence that - * there is a tower in the query image. Range [0, 1]. - */ - confidence: number; - /** - * Entity textual description, expressed in its `locale` language. - */ - description: string; - /** - * The language code for the locale in which the entity textual `description` - * is expressed. - */ - locale: string; - /** - * The location information for the detected entity. Multiple `LocationInfo` - * elements can be present because one location may indicate the location of - * the scene in the image, and another location may indicate the location of - * the place where the image was taken. Location information is usually - * present for landmarks. - */ - locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - mid: string; - /** - * Some entities may have optional user-supplied `Property` (name/value) - * fields, such a score or string that qualifies the entity. - */ - properties: Schema$GoogleCloudVisionV1p2beta1Property[]; - /** - * Overall score of the result. Range [0, 1]. - */ - score: number; - /** - * The relevancy of the ICA (Image Content Annotation) label to the image. For - * example, the relevancy of "tower" is likely higher to an image - * containing the detected "Eiffel Tower" than to an image - * containing a detected distant towering building, even though the confidence - * that there is a tower in each image may be the same. Range [0, 1]. - */ - topicality: number; -} -/** - * A face annotation object contains the results of face detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { - /** - * Anger likelihood. - */ - angerLikelihood: string; - /** - * Blurred likelihood. - */ - blurredLikelihood: string; - /** - * The bounding polygon around the face. The coordinates of the bounding box - * are in the original image's scale, as returned in `ImageParams`. The - * bounding box is computed to "frame" the face in accordance with - * human expectations. It is based on the landmarker results. Note that one or - * more x and/or y coordinates may not be generated in the `BoundingPoly` (the - * polygon will be unbounded) if only a partial face appears in the image to - * be annotated. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Detection confidence. Range [0, 1]. - */ - detectionConfidence: number; - /** - * The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, - * and encloses only the skin part of the face. Typically, it is used to - * eliminate the face from any image analysis that detects the "amount of - * skin" visible in an image. It is not based on the landmarker results, - * only on the initial face detection, hence the <code>fd</code> - * (face detection) prefix. - */ - fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Headwear likelihood. - */ - headwearLikelihood: string; - /** - * Joy likelihood. - */ - joyLikelihood: string; - /** - * Face landmarking confidence. Range [0, 1]. - */ - landmarkingConfidence: number; - /** - * Detected face landmarks. - */ - landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; - /** - * Yaw angle, which indicates the leftward/rightward angle that the face is - * pointing relative to the vertical plane perpendicular to the image. Range - * [-180,180]. - */ - panAngle: number; - /** - * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - * of the face relative to the image vertical about the axis perpendicular to - * the face. Range [-180,180]. - */ - rollAngle: number; - /** - * Sorrow likelihood. - */ - sorrowLikelihood: string; - /** - * Surprise likelihood. - */ - surpriseLikelihood: string; - /** - * Pitch angle, which indicates the upwards/downwards angle that the face is - * pointing relative to the image's horizontal plane. Range [-180,180]. - */ - tiltAngle: number; - /** - * Under-exposed likelihood. - */ - underExposedLikelihood: string; -} -/** - * A face-specific landmark (for example, a face feature). - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { - /** - * Face landmark position. - */ - position: Schema$GoogleCloudVisionV1p2beta1Position; - /** - * Face landmark type. - */ - type: string; -} -/** - * The Google Cloud Storage location where the output will be written to. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { - /** - * Google Cloud Storage URI where the results will be stored. Results will be - * in JSON format and preceded by its corresponding input URI. This field can - * either represent a single file, or a prefix for multiple outputs. Prefixes - * must end in a `/`. Examples: * File: gs://bucket-name/filename.json * - * Prefix: gs://bucket-name/prefix/here/ * File: - * gs://bucket-name/prefix/here If multiple outputs, each response is still - * AnnotateFileResponse, each of which contains some subset of the full list - * of AnnotateImageResponse. Multiple outputs can happen if, for example, the - * output JSON is too large and overflows into multiple sharded files. - */ - uri: string; -} -/** - * The Google Cloud Storage location where the input will be read from. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { - /** - * Google Cloud Storage URI for the input file. This must only be a Google - * Cloud Storage object. Wildcards are not currently supported. - */ - uri: string; -} -/** - * If an image was produced from a file (e.g. a PDF), this message gives - * information about the source of that image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { - /** - * If the file was a PDF or TIFF, this field gives the page number within the - * file used to produce the image. - */ - pageNumber: number; - /** - * The URI of the file used to produce the image. - */ - uri: string; -} -/** - * Stores image properties, such as dominant colors. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { - /** - * If present, dominant colors completed successfully. - */ - dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; -} -/** - * The desired input location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { - /** - * The Google Cloud Storage location to read the input from. - */ - gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; - /** - * The type of the file. Currently only "application/pdf" and - * "image/tiff" are supported. Wildcards are not supported. - */ - mimeType: string; -} -/** - * Detected entity location information. - */ -export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { - /** - * lat/long location coordinates. - */ - latLng: Schema$LatLng; -} -/** - * A vertex represents a 2D point in the image. NOTE: the normalized vertex - * coordinates are relative to the original image and range from 0 to 1. - */ -export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Contains metadata for the BatchAnnotateImages operation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { - /** - * The time when the batch request was received. - */ - createTime: string; - /** - * Current state of the batch operation. - */ - state: string; - /** - * The time when the operation result was last updated. - */ - updateTime: string; -} -/** - * The desired output location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { - /** - * The max number of response protos to put into each output JSON file on - * Google Cloud Storage. The valid range is [1, 100]. If not specified, the - * default value is 20. For example, for one pdf file with 100 pages, 100 - * response protos will be generated. If `batch_size` = 20, then 5 json files - * each containing 20 response protos will be written under the prefix - * `gcs_destination`.`uri`. Currently, batch_size only applies to - * GcsDestination, with potential future support for other output - * configurations. - */ - batchSize: number; - /** - * The Google Cloud Storage location to write the output(s) to. - */ - gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; -} -/** - * Detected page from OCR. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Page { - /** - * List of blocks of text, images etc on this page. - */ - blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; - /** - * Confidence of the OCR results on the page. Range [0, 1]. - */ - confidence: number; - /** - * Page height. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - height: number; - /** - * Additional information detected on the page. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * Page width. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - width: number; -} -/** - * Structural unit of text representing a number of words in certain order. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { - /** - * The bounding box for the paragraph. The vertices are in the order of - * top-left, top-right, bottom-right, bottom-left. When a rotation of the - * bounding box is detected the rotation is represented as around the top-left - * corner as defined when the text is read in the 'natural' - * orientation. For example: * when the text is horizontal it might look - * like: 0----1 | | 3----2 * when it's rotated 180 - * degrees around the top-left corner it becomes: 2----3 | | - * 1----0 and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the paragraph. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the paragraph. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * List of words in this paragraph. - */ - words: Schema$GoogleCloudVisionV1p2beta1Word[]; -} -/** - * A 3D position in the image, used primarily for Face detection landmarks. A - * valid Position must have both x and y coordinates. The position coordinates - * are in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Position { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; - /** - * Z coordinate (or depth). - */ - z: number; -} -/** - * A `Property` consists of a user-supplied name/value pair. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Property { - /** - * Name of the property. - */ - name: string; - /** - * Value of numeric properties. - */ - uint64Value: string; - /** - * Value of the property. - */ - value: string; -} -/** - * Set of features pertaining to the image, computed by computer vision methods - * over safe-search verticals (for example, adult, spoof, medical, violence). - */ -export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { - /** - * Represents the adult content likelihood for the image. Adult content may - * contain elements such as nudity, pornographic images or cartoons, or sexual - * activities. - */ - adult: string; - /** - * Likelihood that this is a medical image. - */ - medical: string; - /** - * Likelihood that the request image contains racy content. Racy content may - * include (but is not limited to) skimpy or sheer clothing, strategically - * covered nudity, lewd or provocative poses, or close-ups of sensitive body - * areas. - */ - racy: string; - /** - * Spoof likelihood. The likelihood that an modification was made to the - * image's canonical version to make it appear funny or offensive. - */ - spoof: string; - /** - * Likelihood that this image contains violent content. - */ - violence: string; -} -/** - * A single symbol representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Symbol { - /** - * The bounding box for the symbol. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the symbol. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the symbol. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * The actual UTF-8 representation of the symbol. - */ - text: string; -} -/** - * TextAnnotation contains a structured representation of OCR extracted text. - * The hierarchy of an OCR extracted text structure is like this: TextAnnotation - * -> Page -> Block -> Paragraph -> Word -> Symbol Each - * structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please refer - * to the TextAnnotation.TextProperty message definition below for more detail. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { - /** - * List of pages detected by OCR. - */ - pages: Schema$GoogleCloudVisionV1p2beta1Page[]; - /** - * UTF-8 text detected on the pages. - */ - text: string; -} -/** - * Detected start or end of a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { - /** - * True if break prepends the element. - */ - isPrefix: boolean; - /** - * Detected break type. - */ - type: string; -} -/** - * Detected language for a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { - /** - * Confidence of detected language. Range [0, 1]. - */ - confidence: number; - /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Additional information detected on the structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { - /** - * Detected start or end of a text segment. - */ - detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; - /** - * A list of detected languages together with confidence. - */ - detectedLanguages: - Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; -} -/** - * A vertex represents a 2D point in the image. NOTE: the vertex coordinates are - * in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Vertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Relevant information for the image from the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { - /** - * Best guess text labels for the request image. - */ - bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; - /** - * Fully matching images from the Internet. Can include resized copies of the - * query image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Web pages containing the matching images from the Internet. - */ - pagesWithMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; - /** - * Partial matching images from the Internet. Those images are similar enough - * to share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * The visually similar image results. - */ - visuallySimilarImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Deduced entities from similar images on the Internet. - */ - webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; -} -/** - * Entity deduced from similar images on the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { - /** - * Canonical description of the entity, in English. - */ - description: string; - /** - * Opaque entity ID. - */ - entityId: string; - /** - * Overall relevancy score for the entity. Not normalized and not comparable - * across different image queries. - */ - score: number; -} -/** - * Metadata for online images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { - /** - * (Deprecated) Overall relevancy score for the image. - */ - score: number; - /** - * The result image URL. - */ - url: string; -} -/** - * Label to provide extra metadata for the web detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { - /** - * Label for extra metadata. - */ - label: string; - /** - * The BCP-47 language code for `label`, such as "en-US" or - * "sr-Latn". For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Metadata for web pages. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { - /** - * Fully matching images on the page. Can include resized copies of the query - * image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Title for the web page, may contain HTML markups. - */ - pageTitle: string; - /** - * Partial matching images on the page. Those images are similar enough to - * share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * (Deprecated) Overall relevancy score for the web page. - */ - score: number; - /** - * The result web page URL. - */ - url: string; -} -/** - * A word representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Word { - /** - * The bounding box for the word. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the word. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the word. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * List of symbols in the word. The order of the symbols follows the natural - * reading order. - */ - symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; -} -/** - * Client image to perform Google Cloud Vision API tasks over. - */ -export interface Schema$Image { - /** - * Image content, represented as a stream of bytes. Note: As with all `bytes` - * fields, protobuffers use a pure binary representation, whereas JSON - * representations use base64. - */ - content: string; - /** - * Google Cloud Storage image location, or publicly-accessible image URL. If - * both `content` and `source` are provided for an image, `content` takes - * precedence and is used to perform the image annotation request. - */ - source: Schema$ImageSource; -} -/** - * Image context and/or feature-specific parameters. - */ -export interface Schema$ImageContext { - /** - * Parameters for crop hints annotation request. - */ - cropHintsParams: Schema$CropHintsParams; - /** - * List of languages to use for TEXT_DETECTION. In most cases, an empty value - * yields the best results since it enables automatic language detection. For - * languages based on the Latin alphabet, setting `language_hints` is not - * needed. In rare cases, when the language of the text in the image is known, - * setting a hint will help get better results (although it will be a - * significant hindrance if the hint is wrong). Text detection returns an - * error if one or more of the specified languages is not one of the - * [supported languages](/vision/docs/languages). - */ - languageHints: string[]; - /** - * Not used. - */ - latLongRect: Schema$LatLongRect; - /** - * Parameters for web detection. - */ - webDetectionParams: Schema$WebDetectionParams; -} -/** - * Stores image properties, such as dominant colors. - */ -export interface Schema$ImageProperties { - /** - * If present, dominant colors completed successfully. - */ - dominantColors: Schema$DominantColorsAnnotation; -} -/** - * External image source (Google Cloud Storage or web URL image location). - */ -export interface Schema$ImageSource { - /** - * **Use `image_uri` instead.** The Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. See - * [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - */ - gcsImageUri: string; - /** - * The URI of the source image. Can be either: 1. A Google Cloud Storage URI - * of the form `gs://bucket_name/object_name`. Object versioning is not - * supported. See [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - * HTTP/HTTPS URLs, Google cannot guarantee that the request will be - * completed. Your request may fail if the specified host denies the request - * (e.g. due to request throttling or DOS prevention), or if Google throttles - * requests to the site for abuse prevention. You should not depend on - * externally-hosted images for production applications. When both - * `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - * precedence. - */ - imageUri: string; -} -/** - * A face-specific landmark (for example, a face feature). - */ -export interface Schema$Landmark { + * Logical element on the page. + */ + export interface Schema$Block { + /** + * Detected block type (text, image etc) for this block. + */ + blockType: string; + /** + * The bounding box for the block. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's + * rotated 180 degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$BoundingPoly; + /** + * Confidence of the OCR results on the block. Range [0, 1]. + */ + confidence: number; + /** + * List of paragraphs in this block (if this blocks is of type text). + */ + paragraphs: Schema$Paragraph[]; + /** + * Additional information detected for the block. + */ + property: Schema$TextProperty; + } /** - * Face landmark position. + * A bounding polygon for the detected image annotation. */ - position: Schema$Position; + export interface Schema$BoundingPoly { + /** + * The bounding polygon vertices. + */ + vertices: Schema$Vertex[]; + } /** - * Face landmark type. - */ - type: string; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { + * The request message for Operations.CancelOperation. + */ + export interface Schema$CancelOperationRequest {} + /** + * Represents a color in the RGBA color space. This representation is designed + * for simplicity of conversion to/from color representations in various + * languages over compactness; for example, the fields of this representation + * can be trivially provided to the constructor of "java.awt.Color" + * in Java; it can also be trivially provided to UIColor's + * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a + * little work, it can be easily formatted into a CSS "rgba()" + * string in JavaScript, as well. Here are some examples: Example (Java): + * import com.google.type.Color; // ... public static + * java.awt.Color fromProto(Color protocolor) { float alpha = + * protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; + * return new java.awt.Color( protocolor.getRed(), + * protocolor.getGreen(), protocolor.getBlue(), alpha); + * } public static Color toProto(java.awt.Color color) { float + * red = (float) color.getRed(); float green = (float) + * color.getGreen(); float blue = (float) color.getBlue(); float + * denominator = 255.0; Color.Builder resultBuilder = Color + * .newBuilder() .setRed(red / denominator) .setGreen(green / + * denominator) .setBlue(blue / denominator); int alpha + * = color.getAlpha(); if (alpha != 255) { result.setAlpha( + * FloatValue .newBuilder() .setValue(((float) alpha) / + * denominator) .build()); } return + * resultBuilder.build(); } // ... Example (iOS / Obj-C): // + * ... static UIColor* fromProto(Color* protocolor) { float red = + * [protocolor red]; float green = [protocolor green]; float + * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor + * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { + * alpha = [alpha_wrapper value]; } return [UIColor + * colorWithRed:red green:green blue:blue alpha:alpha]; } static + * Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; + * if (![color getRed:&red green:&green blue:&blue + * alpha:&alpha]) { return nil; } Color* + * result = [Color alloc] init]; [result setRed:red]; [result + * setGreen:green]; [result setBlue:blue]; if (alpha <= + * 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } + * [result autorelease]; return result; } // ... Example + * (JavaScript): // ... var protoToCssColor = function(rgb_color) { + * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green + * || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = + * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); + * var blue = Math.floor(blueFrac * 255); if (!('alpha' in + * rgb_color)) { return rgbToCssColor_(red, green, blue); } + * var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, + * green, blue].join(','); return ['rgba(', rgbParams, + * ',', alphaFrac, ')'].join(''); }; var + * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new + * Number((red << 16) | (green << 8) | blue); var hexString + * = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; + * var resultBuilder = ['#']; for (var i = 0; i < + * missingZeros; i++) { resultBuilder.push('0'); } + * resultBuilder.push(hexString); return resultBuilder.join(''); + * }; // ... + */ + export interface Schema$Color { + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: pixel color = alpha + * * (this color) + (1.0 - alpha) * (background color) This means that a + * value of 1.0 corresponds to a solid color, whereas a value of 0.0 + * corresponds to a completely transparent color. This uses a wrapper + * message rather than a simple float scalar so that it is possible to + * distinguish between a default value and the value being unset. If + * omitted, this color object is to be rendered as a solid color (as if the + * alpha value had been explicitly given with a value of 1.0). + */ + alpha: number; + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; + * Color information consists of RGB channels, score, and the fraction of the + * image that the color occupies in the image. + */ + export interface Schema$ColorInfo { + /** + * RGB components of the color. + */ + color: Schema$Color; + /** + * The fraction of pixels the color occupies in the image. Value in range + * [0, 1]. + */ + pixelFraction: number; + /** + * Image-specific score for this color. Value in range [0, 1]. + */ + score: number; + } /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * Rectangle determined by min and max `LatLng` pairs. - */ -export interface Schema$LatLongRect { + * Single crop hint that is used to generate a new crop when serving an image. + */ + export interface Schema$CropHint { + /** + * The bounding polygon for the crop region. The coordinates of the bounding + * box are in the original image's scale, as returned in `ImageParams`. + */ + boundingPoly: Schema$BoundingPoly; + /** + * Confidence of this being a salient region. Range [0, 1]. + */ + confidence: number; + /** + * Fraction of importance of this salient region with respect to the + * original image. + */ + importanceFraction: number; + } /** - * Max lat/long pair. + * Set of crop hints that are used to generate new crops when serving images. */ - maxLatLng: Schema$LatLng; + export interface Schema$CropHintsAnnotation { + /** + * Crop hint results. + */ + cropHints: Schema$CropHint[]; + } /** - * Min lat/long pair. + * Parameters for crop hints annotation request. */ - minLatLng: Schema$LatLng; -} -/** - * The response message for Operations.ListOperations. - */ -export interface Schema$ListOperationsResponse { + export interface Schema$CropHintsParams { + /** + * Aspect ratios in floats, representing the ratio of the width to the + * height of the image. For example, if the desired aspect ratio is 4/3, the + * corresponding float value should be 1.33333. If not specified, the best + * possible crop is returned. The number of provided aspect ratios is + * limited to a maximum of 16; any aspect ratios provided after the 16th are + * ignored. + */ + aspectRatios: number[]; + } /** - * The standard List next-page token. - */ - nextPageToken: string; + * Detected start or end of a structural component. + */ + export interface Schema$DetectedBreak { + /** + * True if break prepends the element. + */ + isPrefix: boolean; + /** + * Detected break type. + */ + type: string; + } /** - * A list of operations that matches the specified filter in the request. - */ - operations: Schema$Operation[]; -} -/** - * Detected entity location information. - */ -export interface Schema$LocationInfo { + * Detected language for a structural component. + */ + export interface Schema$DetectedLanguage { + /** + * Confidence of detected language. Range [0, 1]. + */ + confidence: number; + /** + * The BCP-47 language code, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * lat/long location coordinates. + * Set of dominant colors and their corresponding scores. */ - latLng: Schema$LatLng; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { + export interface Schema$DominantColorsAnnotation { + /** + * RGB color values with their score and pixel fraction. + */ + colors: Schema$ColorInfo[]; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. - */ - done: boolean; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * Set of detected entity features. + */ + export interface Schema$EntityAnnotation { + /** + * Image region to which this entity belongs. Not produced for + * `LABEL_DETECTION` features. + */ + boundingPoly: Schema$BoundingPoly; + /** + * **Deprecated. Use `score` instead.** The accuracy of the entity detection + * in an image. For example, for an image in which the "Eiffel + * Tower" entity is detected, this field represents the confidence that + * there is a tower in the query image. Range [0, 1]. + */ + confidence: number; + /** + * Entity textual description, expressed in its `locale` language. + */ + description: string; + /** + * The language code for the locale in which the entity textual + * `description` is expressed. + */ + locale: string; + /** + * The location information for the detected entity. Multiple `LocationInfo` + * elements can be present because one location may indicate the location of + * the scene in the image, and another location may indicate the location of + * the place where the image was taken. Location information is usually + * present for landmarks. + */ + locations: Schema$LocationInfo[]; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + mid: string; + /** + * Some entities may have optional user-supplied `Property` (name/value) + * fields, such a score or string that qualifies the entity. + */ + properties: Schema$Property[]; + /** + * Overall score of the result. Range [0, 1]. + */ + score: number; + /** + * The relevancy of the ICA (Image Content Annotation) label to the image. + * For example, the relevancy of "tower" is likely higher to an + * image containing the detected "Eiffel Tower" than to an image + * containing a detected distant towering building, even though the + * confidence that there is a tower in each image may be the same. Range [0, + * 1]. + */ + topicality: number; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; + * A face annotation object contains the results of face detection. + */ + export interface Schema$FaceAnnotation { + /** + * Anger likelihood. + */ + angerLikelihood: string; + /** + * Blurred likelihood. + */ + blurredLikelihood: string; + /** + * The bounding polygon around the face. The coordinates of the bounding box + * are in the original image's scale, as returned in `ImageParams`. The + * bounding box is computed to "frame" the face in accordance with + * human expectations. It is based on the landmarker results. Note that one + * or more x and/or y coordinates may not be generated in the `BoundingPoly` + * (the polygon will be unbounded) if only a partial face appears in the + * image to be annotated. + */ + boundingPoly: Schema$BoundingPoly; + /** + * Detection confidence. Range [0, 1]. + */ + detectionConfidence: number; + /** + * The `fd_bounding_poly` bounding polygon is tighter than the + * `boundingPoly`, and encloses only the skin part of the face. Typically, + * it is used to eliminate the face from any image analysis that detects the + * "amount of skin" visible in an image. It is not based on the + * landmarker results, only on the initial face detection, hence the + * <code>fd</code> (face detection) prefix. + */ + fdBoundingPoly: Schema$BoundingPoly; + /** + * Headwear likelihood. + */ + headwearLikelihood: string; + /** + * Joy likelihood. + */ + joyLikelihood: string; + /** + * Face landmarking confidence. Range [0, 1]. + */ + landmarkingConfidence: number; + /** + * Detected face landmarks. + */ + landmarks: Schema$Landmark[]; + /** + * Yaw angle, which indicates the leftward/rightward angle that the face is + * pointing relative to the vertical plane perpendicular to the image. Range + * [-180,180]. + */ + panAngle: number; + /** + * Roll angle, which indicates the amount of clockwise/anti-clockwise + * rotation of the face relative to the image vertical about the axis + * perpendicular to the face. Range [-180,180]. + */ + rollAngle: number; + /** + * Sorrow likelihood. + */ + sorrowLikelihood: string; + /** + * Surprise likelihood. + */ + surpriseLikelihood: string; + /** + * Pitch angle, which indicates the upwards/downwards angle that the face is + * pointing relative to the image's horizontal plane. Range [-180,180]. + */ + tiltAngle: number; + /** + * Under-exposed likelihood. + */ + underExposedLikelihood: string; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * The type of Google Cloud Vision API detection to perform, and the maximum + * number of results to return for that type. Multiple `Feature` objects can + * be specified in the `features` list. + */ + export interface Schema$Feature { + /** + * Maximum number of results of this type. Does not apply to + * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + */ + maxResults: number; + /** + * Model to use for the feature. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + /** + * The feature type. + */ + type: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Response to a single file annotation request. A file may contain one or + * more images, which individually have their own responses. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { + /** + * Information about the file for which this response is generated. + */ + inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; + /** + * Individual responses to images found within the file. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * Detected page from OCR. - */ -export interface Schema$Page { + * Response to an image annotation request. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { + /** + * If present, contextual information is needed to understand where this + * image comes from. + */ + context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; + /** + * If present, crop hints have completed successfully. + */ + cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; + /** + * If set, represents the error message for the operation. Note that + * filled-in image annotations are guaranteed to be correct, even when + * `error` is set. + */ + error: Schema$Status; + /** + * If present, face detection has completed successfully. + */ + faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; + /** + * If present, text (OCR) detection or document (OCR) text detection has + * completed successfully. This annotation provides the structural hierarchy + * for the OCR detected text. + */ + fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; + /** + * If present, image properties were extracted successfully. + */ + imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; + /** + * If present, label detection has completed successfully. + */ + labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, landmark detection has completed successfully. + */ + landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, logo detection has completed successfully. + */ + logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, safe-search annotation has completed successfully. + */ + safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; + /** + * If present, text (OCR) detection has completed successfully. + */ + textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, web detection has completed successfully. + */ + webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; + } /** - * List of blocks of text, images etc on this page. + * The response for a single offline file annotation request. */ - blocks: Schema$Block[]; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { + /** + * The output location and metadata from AsyncAnnotateFileRequest. + */ + outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; + } /** - * Confidence of the OCR results on the page. Range [0, 1]. + * Response to an async batch file annotation request. */ - confidence: number; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { + /** + * The list of file annotation responses, one for each request in + * AsyncBatchAnnotateFilesRequest. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; + } /** - * Page height. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - height: number; + * Logical element on the page. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Block { + /** + * Detected block type (text, image etc) for this block. + */ + blockType: string; + /** + * The bounding box for the block. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's + * rotated 180 degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results on the block. Range [0, 1]. + */ + confidence: number; + /** + * List of paragraphs in this block (if this blocks is of type text). + */ + paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; + /** + * Additional information detected for the block. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + } /** - * Additional information detected on the page. - */ - property: Schema$TextProperty; + * A bounding polygon for the detected image annotation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { + /** + * The bounding polygon normalized vertices. + */ + normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; + /** + * The bounding polygon vertices. + */ + vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; + } /** - * Page width. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - width: number; -} -/** - * Structural unit of text representing a number of words in certain order. - */ -export interface Schema$Paragraph { + * Color information consists of RGB channels, score, and the fraction of the + * image that the color occupies in the image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { + /** + * RGB components of the color. + */ + color: Schema$Color; + /** + * The fraction of pixels the color occupies in the image. Value in range + * [0, 1]. + */ + pixelFraction: number; + /** + * Image-specific score for this color. Value in range [0, 1]. + */ + score: number; + } /** - * The bounding box for the paragraph. The vertices are in the order of - * top-left, top-right, bottom-right, bottom-left. When a rotation of the - * bounding box is detected the rotation is represented as around the top-left - * corner as defined when the text is read in the 'natural' - * orientation. For example: * when the text is horizontal it might look - * like: 0----1 | | 3----2 * when it's rotated 180 - * degrees around the top-left corner it becomes: 2----3 | | - * 1----0 and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$BoundingPoly; + * Single crop hint that is used to generate a new crop when serving an image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1CropHint { + /** + * The bounding polygon for the crop region. The coordinates of the bounding + * box are in the original image's scale, as returned in `ImageParams`. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of this being a salient region. Range [0, 1]. + */ + confidence: number; + /** + * Fraction of importance of this salient region with respect to the + * original image. + */ + importanceFraction: number; + } /** - * Confidence of the OCR results for the paragraph. Range [0, 1]. + * Set of crop hints that are used to generate new crops when serving images. */ - confidence: number; + export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { + /** + * Crop hint results. + */ + cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; + } /** - * Additional information detected for the paragraph. + * Set of dominant colors and their corresponding scores. */ - property: Schema$TextProperty; + export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { + /** + * RGB color values with their score and pixel fraction. + */ + colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; + } /** - * List of words in this paragraph. - */ - words: Schema$Word[]; -} -/** - * A 3D position in the image, used primarily for Face detection landmarks. A - * valid Position must have both x and y coordinates. The position coordinates - * are in the same scale as the original image. - */ -export interface Schema$Position { + * Set of detected entity features. + */ + export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { + /** + * Image region to which this entity belongs. Not produced for + * `LABEL_DETECTION` features. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * **Deprecated. Use `score` instead.** The accuracy of the entity detection + * in an image. For example, for an image in which the "Eiffel + * Tower" entity is detected, this field represents the confidence that + * there is a tower in the query image. Range [0, 1]. + */ + confidence: number; + /** + * Entity textual description, expressed in its `locale` language. + */ + description: string; + /** + * The language code for the locale in which the entity textual + * `description` is expressed. + */ + locale: string; + /** + * The location information for the detected entity. Multiple `LocationInfo` + * elements can be present because one location may indicate the location of + * the scene in the image, and another location may indicate the location of + * the place where the image was taken. Location information is usually + * present for landmarks. + */ + locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + mid: string; + /** + * Some entities may have optional user-supplied `Property` (name/value) + * fields, such a score or string that qualifies the entity. + */ + properties: Schema$GoogleCloudVisionV1p2beta1Property[]; + /** + * Overall score of the result. Range [0, 1]. + */ + score: number; + /** + * The relevancy of the ICA (Image Content Annotation) label to the image. + * For example, the relevancy of "tower" is likely higher to an + * image containing the detected "Eiffel Tower" than to an image + * containing a detected distant towering building, even though the + * confidence that there is a tower in each image may be the same. Range [0, + * 1]. + */ + topicality: number; + } /** - * X coordinate. - */ - x: number; + * A face annotation object contains the results of face detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { + /** + * Anger likelihood. + */ + angerLikelihood: string; + /** + * Blurred likelihood. + */ + blurredLikelihood: string; + /** + * The bounding polygon around the face. The coordinates of the bounding box + * are in the original image's scale, as returned in `ImageParams`. The + * bounding box is computed to "frame" the face in accordance with + * human expectations. It is based on the landmarker results. Note that one + * or more x and/or y coordinates may not be generated in the `BoundingPoly` + * (the polygon will be unbounded) if only a partial face appears in the + * image to be annotated. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Detection confidence. Range [0, 1]. + */ + detectionConfidence: number; + /** + * The `fd_bounding_poly` bounding polygon is tighter than the + * `boundingPoly`, and encloses only the skin part of the face. Typically, + * it is used to eliminate the face from any image analysis that detects the + * "amount of skin" visible in an image. It is not based on the + * landmarker results, only on the initial face detection, hence the + * <code>fd</code> (face detection) prefix. + */ + fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Headwear likelihood. + */ + headwearLikelihood: string; + /** + * Joy likelihood. + */ + joyLikelihood: string; + /** + * Face landmarking confidence. Range [0, 1]. + */ + landmarkingConfidence: number; + /** + * Detected face landmarks. + */ + landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; + /** + * Yaw angle, which indicates the leftward/rightward angle that the face is + * pointing relative to the vertical plane perpendicular to the image. Range + * [-180,180]. + */ + panAngle: number; + /** + * Roll angle, which indicates the amount of clockwise/anti-clockwise + * rotation of the face relative to the image vertical about the axis + * perpendicular to the face. Range [-180,180]. + */ + rollAngle: number; + /** + * Sorrow likelihood. + */ + sorrowLikelihood: string; + /** + * Surprise likelihood. + */ + surpriseLikelihood: string; + /** + * Pitch angle, which indicates the upwards/downwards angle that the face is + * pointing relative to the image's horizontal plane. Range [-180,180]. + */ + tiltAngle: number; + /** + * Under-exposed likelihood. + */ + underExposedLikelihood: string; + } /** - * Y coordinate. - */ - y: number; + * A face-specific landmark (for example, a face feature). + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { + /** + * Face landmark position. + */ + position: Schema$GoogleCloudVisionV1p2beta1Position; + /** + * Face landmark type. + */ + type: string; + } /** - * Z coordinate (or depth). - */ - z: number; -} -/** - * A `Property` consists of a user-supplied name/value pair. - */ -export interface Schema$Property { + * The Google Cloud Storage location where the output will be written to. + */ + export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { + /** + * Google Cloud Storage URI where the results will be stored. Results will + * be in JSON format and preceded by its corresponding input URI. This field + * can either represent a single file, or a prefix for multiple outputs. + * Prefixes must end in a `/`. Examples: * File: + * gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ + * * File: gs://bucket-name/prefix/here If multiple outputs, each + * response is still AnnotateFileResponse, each of which contains some + * subset of the full list of AnnotateImageResponse. Multiple outputs can + * happen if, for example, the output JSON is too large and overflows into + * multiple sharded files. + */ + uri: string; + } /** - * Name of the property. + * The Google Cloud Storage location where the input will be read from. */ - name: string; + export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { + /** + * Google Cloud Storage URI for the input file. This must only be a Google + * Cloud Storage object. Wildcards are not currently supported. + */ + uri: string; + } /** - * Value of numeric properties. - */ - uint64Value: string; + * If an image was produced from a file (e.g. a PDF), this message gives + * information about the source of that image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { + /** + * If the file was a PDF or TIFF, this field gives the page number within + * the file used to produce the image. + */ + pageNumber: number; + /** + * The URI of the file used to produce the image. + */ + uri: string; + } /** - * Value of the property. + * Stores image properties, such as dominant colors. */ - value: string; -} -/** - * Set of features pertaining to the image, computed by computer vision methods - * over safe-search verticals (for example, adult, spoof, medical, violence). - */ -export interface Schema$SafeSearchAnnotation { + export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { + /** + * If present, dominant colors completed successfully. + */ + dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; + } /** - * Represents the adult content likelihood for the image. Adult content may - * contain elements such as nudity, pornographic images or cartoons, or sexual - * activities. - */ - adult: string; + * The desired input location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { + /** + * The Google Cloud Storage location to read the input from. + */ + gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; + /** + * The type of the file. Currently only "application/pdf" and + * "image/tiff" are supported. Wildcards are not supported. + */ + mimeType: string; + } /** - * Likelihood that this is a medical image. + * Detected entity location information. */ - medical: string; + export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { + /** + * lat/long location coordinates. + */ + latLng: Schema$LatLng; + } /** - * Likelihood that the request image contains racy content. Racy content may - * include (but is not limited to) skimpy or sheer clothing, strategically - * covered nudity, lewd or provocative poses, or close-ups of sensitive body - * areas. - */ - racy: string; + * A vertex represents a 2D point in the image. NOTE: the normalized vertex + * coordinates are relative to the original image and range from 0 to 1. + */ + export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * Spoof likelihood. The likelihood that an modification was made to the - * image's canonical version to make it appear funny or offensive. - */ - spoof: string; + * Contains metadata for the BatchAnnotateImages operation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { + /** + * The time when the batch request was received. + */ + createTime: string; + /** + * Current state of the batch operation. + */ + state: string; + /** + * The time when the operation result was last updated. + */ + updateTime: string; + } /** - * Likelihood that this image contains violent content. - */ - violence: string; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * The desired output location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { + /** + * The max number of response protos to put into each output JSON file on + * Google Cloud Storage. The valid range is [1, 100]. If not specified, the + * default value is 20. For example, for one pdf file with 100 pages, 100 + * response protos will be generated. If `batch_size` = 20, then 5 json + * files each containing 20 response protos will be written under the prefix + * `gcs_destination`.`uri`. Currently, batch_size only applies to + * GcsDestination, with potential future support for other output + * configurations. + */ + batchSize: number; + /** + * The Google Cloud Storage location to write the output(s) to. + */ + gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * Detected page from OCR. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Page { + /** + * List of blocks of text, images etc on this page. + */ + blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; + /** + * Confidence of the OCR results on the page. Range [0, 1]. + */ + confidence: number; + /** + * Page height. For PDFs the unit is points. For images (including TIFFs) + * the unit is pixels. + */ + height: number; + /** + * Additional information detected on the page. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * Page width. For PDFs the unit is points. For images (including TIFFs) the + * unit is pixels. + */ + width: number; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * Structural unit of text representing a number of words in certain order. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { + /** + * The bounding box for the paragraph. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the paragraph. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the paragraph. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of words in this paragraph. + */ + words: Schema$GoogleCloudVisionV1p2beta1Word[]; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} -/** - * A single symbol representation. - */ -export interface Schema$Symbol { + * A 3D position in the image, used primarily for Face detection landmarks. A + * valid Position must have both x and y coordinates. The position coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Position { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + /** + * Z coordinate (or depth). + */ + z: number; + } /** - * The bounding box for the symbol. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$BoundingPoly; + * A `Property` consists of a user-supplied name/value pair. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Property { + /** + * Name of the property. + */ + name: string; + /** + * Value of numeric properties. + */ + uint64Value: string; + /** + * Value of the property. + */ + value: string; + } /** - * Confidence of the OCR results for the symbol. Range [0, 1]. - */ - confidence: number; + * Set of features pertaining to the image, computed by computer vision + * methods over safe-search verticals (for example, adult, spoof, medical, + * violence). + */ + export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { + /** + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. + */ + adult: string; + /** + * Likelihood that this is a medical image. + */ + medical: string; + /** + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive body + * areas. + */ + racy: string; + /** + * Spoof likelihood. The likelihood that an modification was made to the + * image's canonical version to make it appear funny or offensive. + */ + spoof: string; + /** + * Likelihood that this image contains violent content. + */ + violence: string; + } /** - * Additional information detected for the symbol. - */ - property: Schema$TextProperty; + * A single symbol representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Symbol { + /** + * The bounding box for the symbol. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the symbol. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the symbol. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * The actual UTF-8 representation of the symbol. + */ + text: string; + } /** - * The actual UTF-8 representation of the symbol. - */ - text: string; -} -/** - * TextAnnotation contains a structured representation of OCR extracted text. - * The hierarchy of an OCR extracted text structure is like this: TextAnnotation - * -> Page -> Block -> Paragraph -> Word -> Symbol Each - * structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please refer - * to the TextAnnotation.TextProperty message definition below for more detail. - */ -export interface Schema$TextAnnotation { + * TextAnnotation contains a structured representation of OCR extracted text. + * The hierarchy of an OCR extracted text structure is like this: + * TextAnnotation -> Page -> Block -> Paragraph -> Word -> + * Symbol Each structural component, starting from Page, may further have + * their own properties. Properties describe detected languages, breaks etc.. + * Please refer to the TextAnnotation.TextProperty message definition below + * for more detail. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { + /** + * List of pages detected by OCR. + */ + pages: Schema$GoogleCloudVisionV1p2beta1Page[]; + /** + * UTF-8 text detected on the pages. + */ + text: string; + } /** - * List of pages detected by OCR. - */ - pages: Schema$Page[]; + * Detected start or end of a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { + /** + * True if break prepends the element. + */ + isPrefix: boolean; + /** + * Detected break type. + */ + type: string; + } /** - * UTF-8 text detected on the pages. - */ - text: string; -} -/** - * Additional information detected on the structural component. - */ -export interface Schema$TextProperty { + * Detected language for a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { + /** + * Confidence of detected language. Range [0, 1]. + */ + confidence: number; + /** + * The BCP-47 language code, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * Detected start or end of a text segment. - */ - detectedBreak: Schema$DetectedBreak; + * Additional information detected on the structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { + /** + * Detected start or end of a text segment. + */ + detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; + /** + * A list of detected languages together with confidence. + */ + detectedLanguages: + Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; + } /** - * A list of detected languages together with confidence. - */ - detectedLanguages: Schema$DetectedLanguage[]; -} -/** - * A vertex represents a 2D point in the image. NOTE: the vertex coordinates are - * in the same scale as the original image. - */ -export interface Schema$Vertex { + * A vertex represents a 2D point in the image. NOTE: the vertex coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Vertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * X coordinate. - */ - x: number; + * Relevant information for the image from the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { + /** + * Best guess text labels for the request image. + */ + bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; + /** + * Fully matching images from the Internet. Can include resized copies of + * the query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Web pages containing the matching images from the Internet. + */ + pagesWithMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; + /** + * Partial matching images from the Internet. Those images are similar + * enough to share some key-point features. For example an original image + * will likely have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * The visually similar image results. + */ + visuallySimilarImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Deduced entities from similar images on the Internet. + */ + webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; + } /** - * Y coordinate. - */ - y: number; -} -/** - * Relevant information for the image from the Internet. - */ -export interface Schema$WebDetection { + * Entity deduced from similar images on the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { + /** + * Canonical description of the entity, in English. + */ + description: string; + /** + * Opaque entity ID. + */ + entityId: string; + /** + * Overall relevancy score for the entity. Not normalized and not comparable + * across different image queries. + */ + score: number; + } /** - * Best guess text labels for the request image. - */ - bestGuessLabels: Schema$WebLabel[]; + * Metadata for online images. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { + /** + * (Deprecated) Overall relevancy score for the image. + */ + score: number; + /** + * The result image URL. + */ + url: string; + } /** - * Fully matching images from the Internet. Can include resized copies of the - * query image. - */ - fullMatchingImages: Schema$WebImage[]; + * Label to provide extra metadata for the web detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { + /** + * Label for extra metadata. + */ + label: string; + /** + * The BCP-47 language code for `label`, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * Web pages containing the matching images from the Internet. - */ - pagesWithMatchingImages: Schema$WebPage[]; + * Metadata for web pages. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { + /** + * Fully matching images on the page. Can include resized copies of the + * query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Title for the web page, may contain HTML markups. + */ + pageTitle: string; + /** + * Partial matching images on the page. Those images are similar enough to + * share some key-point features. For example an original image will likely + * have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * (Deprecated) Overall relevancy score for the web page. + */ + score: number; + /** + * The result web page URL. + */ + url: string; + } /** - * Partial matching images from the Internet. Those images are similar enough - * to share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: Schema$WebImage[]; + * A word representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Word { + /** + * The bounding box for the word. The vertices are in the order of top-left, + * top-right, bottom-right, bottom-left. When a rotation of the bounding box + * is detected the rotation is represented as around the top-left corner as + * defined when the text is read in the 'natural' orientation. For + * example: * when the text is horizontal it might look like: 0----1 + * | | 3----2 * when it's rotated 180 degrees around the + * top-left corner it becomes: 2----3 | | 1----0 and the + * vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the word. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the word. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of symbols in the word. The order of the symbols follows the natural + * reading order. + */ + symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; + } /** - * The visually similar image results. - */ - visuallySimilarImages: Schema$WebImage[]; + * Client image to perform Google Cloud Vision API tasks over. + */ + export interface Schema$Image { + /** + * Image content, represented as a stream of bytes. Note: As with all + * `bytes` fields, protobuffers use a pure binary representation, whereas + * JSON representations use base64. + */ + content: string; + /** + * Google Cloud Storage image location, or publicly-accessible image URL. If + * both `content` and `source` are provided for an image, `content` takes + * precedence and is used to perform the image annotation request. + */ + source: Schema$ImageSource; + } /** - * Deduced entities from similar images on the Internet. - */ - webEntities: Schema$WebEntity[]; -} -/** - * Parameters for web detection request. - */ -export interface Schema$WebDetectionParams { + * Image context and/or feature-specific parameters. + */ + export interface Schema$ImageContext { + /** + * Parameters for crop hints annotation request. + */ + cropHintsParams: Schema$CropHintsParams; + /** + * List of languages to use for TEXT_DETECTION. In most cases, an empty + * value yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting + * `language_hints` is not needed. In rare cases, when the language of the + * text in the image is known, setting a hint will help get better results + * (although it will be a significant hindrance if the hint is wrong). Text + * detection returns an error if one or more of the specified languages is + * not one of the [supported languages](/vision/docs/languages). + */ + languageHints: string[]; + /** + * Not used. + */ + latLongRect: Schema$LatLongRect; + /** + * Parameters for web detection. + */ + webDetectionParams: Schema$WebDetectionParams; + } /** - * Whether to include results derived from the geo information in the image. + * Stores image properties, such as dominant colors. */ - includeGeoResults: boolean; -} -/** - * Entity deduced from similar images on the Internet. - */ -export interface Schema$WebEntity { + export interface Schema$ImageProperties { + /** + * If present, dominant colors completed successfully. + */ + dominantColors: Schema$DominantColorsAnnotation; + } /** - * Canonical description of the entity, in English. - */ - description: string; + * External image source (Google Cloud Storage or web URL image location). + */ + export interface Schema$ImageSource { + /** + * **Use `image_uri` instead.** The Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. See + * [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. + */ + gcsImageUri: string; + /** + * The URI of the source image. Can be either: 1. A Google Cloud Storage + * URI of the form `gs://bucket_name/object_name`. Object versioning is + * not supported. See [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + * images from HTTP/HTTPS URLs, Google cannot guarantee that the request + * will be completed. Your request may fail if the specified host denies + * the request (e.g. due to request throttling or DOS prevention), or if + * Google throttles requests to the site for abuse prevention. You should + * not depend on externally-hosted images for production applications. + * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` + * takes precedence. + */ + imageUri: string; + } /** - * Opaque entity ID. - */ - entityId: string; + * A face-specific landmark (for example, a face feature). + */ + export interface Schema$Landmark { + /** + * Face landmark position. + */ + position: Schema$Position; + /** + * Face landmark type. + */ + type: string; + } /** - * Overall relevancy score for the entity. Not normalized and not comparable - * across different image queries. - */ - score: number; -} -/** - * Metadata for online images. - */ -export interface Schema$WebImage { + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * (Deprecated) Overall relevancy score for the image. - */ - score: number; + * Rectangle determined by min and max `LatLng` pairs. + */ + export interface Schema$LatLongRect { + /** + * Max lat/long pair. + */ + maxLatLng: Schema$LatLng; + /** + * Min lat/long pair. + */ + minLatLng: Schema$LatLng; + } /** - * The result image URL. - */ - url: string; -} -/** - * Label to provide extra metadata for the web detection. - */ -export interface Schema$WebLabel { + * The response message for Operations.ListOperations. + */ + export interface Schema$ListOperationsResponse { + /** + * The standard List next-page token. + */ + nextPageToken: string; + /** + * A list of operations that matches the specified filter in the request. + */ + operations: Schema$Operation[]; + } /** - * Label for extra metadata. + * Detected entity location information. */ - label: string; + export interface Schema$LocationInfo { + /** + * lat/long location coordinates. + */ + latLng: Schema$LatLng; + } /** - * The BCP-47 language code for `label`, such as "en-US" or - * "sr-Latn". For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Metadata for web pages. - */ -export interface Schema$WebPage { + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; + } /** - * Fully matching images on the page. Can include resized copies of the query - * image. - */ - fullMatchingImages: Schema$WebImage[]; + * Detected page from OCR. + */ + export interface Schema$Page { + /** + * List of blocks of text, images etc on this page. + */ + blocks: Schema$Block[]; + /** + * Confidence of the OCR results on the page. Range [0, 1]. + */ + confidence: number; + /** + * Page height. For PDFs the unit is points. For images (including TIFFs) + * the unit is pixels. + */ + height: number; + /** + * Additional information detected on the page. + */ + property: Schema$TextProperty; + /** + * Page width. For PDFs the unit is points. For images (including TIFFs) the + * unit is pixels. + */ + width: number; + } /** - * Title for the web page, may contain HTML markups. - */ - pageTitle: string; + * Structural unit of text representing a number of words in certain order. + */ + export interface Schema$Paragraph { + /** + * The bounding box for the paragraph. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$BoundingPoly; + /** + * Confidence of the OCR results for the paragraph. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the paragraph. + */ + property: Schema$TextProperty; + /** + * List of words in this paragraph. + */ + words: Schema$Word[]; + } /** - * Partial matching images on the page. Those images are similar enough to - * share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: Schema$WebImage[]; + * A 3D position in the image, used primarily for Face detection landmarks. A + * valid Position must have both x and y coordinates. The position coordinates + * are in the same scale as the original image. + */ + export interface Schema$Position { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + /** + * Z coordinate (or depth). + */ + z: number; + } /** - * (Deprecated) Overall relevancy score for the web page. - */ - score: number; + * A `Property` consists of a user-supplied name/value pair. + */ + export interface Schema$Property { + /** + * Name of the property. + */ + name: string; + /** + * Value of numeric properties. + */ + uint64Value: string; + /** + * Value of the property. + */ + value: string; + } /** - * The result web page URL. - */ - url: string; -} -/** - * A word representation. - */ -export interface Schema$Word { + * Set of features pertaining to the image, computed by computer vision + * methods over safe-search verticals (for example, adult, spoof, medical, + * violence). + */ + export interface Schema$SafeSearchAnnotation { + /** + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. + */ + adult: string; + /** + * Likelihood that this is a medical image. + */ + medical: string; + /** + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive body + * areas. + */ + racy: string; + /** + * Spoof likelihood. The likelihood that an modification was made to the + * image's canonical version to make it appear funny or offensive. + */ + spoof: string; + /** + * Likelihood that this image contains violent content. + */ + violence: string; + } /** - * The bounding box for the word. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$BoundingPoly; + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; + } /** - * Confidence of the OCR results for the word. Range [0, 1]. - */ - confidence: number; + * A single symbol representation. + */ + export interface Schema$Symbol { + /** + * The bounding box for the symbol. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$BoundingPoly; + /** + * Confidence of the OCR results for the symbol. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the symbol. + */ + property: Schema$TextProperty; + /** + * The actual UTF-8 representation of the symbol. + */ + text: string; + } /** - * Additional information detected for the word. - */ - property: Schema$TextProperty; + * TextAnnotation contains a structured representation of OCR extracted text. + * The hierarchy of an OCR extracted text structure is like this: + * TextAnnotation -> Page -> Block -> Paragraph -> Word -> + * Symbol Each structural component, starting from Page, may further have + * their own properties. Properties describe detected languages, breaks etc.. + * Please refer to the TextAnnotation.TextProperty message definition below + * for more detail. + */ + export interface Schema$TextAnnotation { + /** + * List of pages detected by OCR. + */ + pages: Schema$Page[]; + /** + * UTF-8 text detected on the pages. + */ + text: string; + } /** - * List of symbols in the word. The order of the symbols follows the natural - * reading order. - */ - symbols: Schema$Symbol[]; -} - -export class Resource$Images { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); + * Additional information detected on the structural component. + */ + export interface Schema$TextProperty { + /** + * Detected start or end of a text segment. + */ + detectedBreak: Schema$DetectedBreak; + /** + * A list of detected languages together with confidence. + */ + detectedLanguages: Schema$DetectedLanguage[]; } - - getRoot() { - return this.root; + /** + * A vertex represents a 2D point in the image. NOTE: the vertex coordinates + * are in the same scale as the original image. + */ + export interface Schema$Vertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; } - - /** - * vision.images.annotate - * @desc Run image detection and annotation for a batch of images. - * @example - * * // BEFORE RUNNING: - * // --------------- - * // 1. If not already done, enable the Google Cloud Vision API - * // and check the quota for your project at - * // https://console.developers.google.com/apis/api/vision - * // 2. This sample uses Application Default Credentials for authentication. - * // If not already done, install the gcloud CLI from - * // https://cloud.google.com/sdk and run - * // `gcloud beta auth application-default login`. - * // For more information, see - * // - * https://developers.google.com/identity/protocols/application-default-credentials - * // 3. Install the Node.js client library by running - * // `npm install googleapis --save` - * - * var google = require('googleapis'); - * var vision = google.vision('v1'); - * - * authorize(function(authClient) { - * var request = { - * resource: { - * // TODO: Add desired properties to the request body. - * }, - * - * auth: authClient, - * }; - * - * vision.images.annotate(request, function(err, response) { - * if (err) { - * console.error(err); - * return; - * } - * - * // TODO: Change code below to process the `response` object: - * console.log(JSON.stringify(response, null, 2)); - * }); - * }); - * - * function authorize(callback) { - * google.auth.getApplicationDefault(function(err, authClient) { - * if (err) { - * console.error('authentication failed: ', err); - * return; - * } - * if (authClient.createScopedRequired && - * authClient.createScopedRequired()) { var scopes = - * ['https://www.googleapis.com/auth/cloud-platform']; authClient = - * authClient.createScoped(scopes); - * } - * callback(authClient); - * }); - * } - * @alias vision.images.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().BatchAnnotateImagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): - AxiosPromise; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - annotate( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/v1/images:annotate').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Relevant information for the image from the Internet. + */ + export interface Schema$WebDetection { + /** + * Best guess text labels for the request image. + */ + bestGuessLabels: Schema$WebLabel[]; + /** + * Fully matching images from the Internet. Can include resized copies of + * the query image. + */ + fullMatchingImages: Schema$WebImage[]; + /** + * Web pages containing the matching images from the Internet. + */ + pagesWithMatchingImages: Schema$WebPage[]; + /** + * Partial matching images from the Internet. Those images are similar + * enough to share some key-point features. For example an original image + * will likely have partial matching for its crops. + */ + partialMatchingImages: Schema$WebImage[]; + /** + * The visually similar image results. + */ + visuallySimilarImages: Schema$WebImage[]; + /** + * Deduced entities from similar images on the Internet. + */ + webEntities: Schema$WebEntity[]; } -} - -export class Resource$Locations { - root: Vision; - operations: Resource$Locations$Operations; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); - this.operations = new Resource$Locations$Operations(root); + /** + * Parameters for web detection request. + */ + export interface Schema$WebDetectionParams { + /** + * Whether to include results derived from the geo information in the image. + */ + includeGeoResults: boolean; } - - getRoot() { - return this.root; + /** + * Entity deduced from similar images on the Internet. + */ + export interface Schema$WebEntity { + /** + * Canonical description of the entity, in English. + */ + description: string; + /** + * Opaque entity ID. + */ + entityId: string; + /** + * Overall relevancy score for the entity. Not normalized and not comparable + * across different image queries. + */ + score: number; } -} -export class Resource$Locations$Operations { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); + /** + * Metadata for online images. + */ + export interface Schema$WebImage { + /** + * (Deprecated) Overall relevancy score for the image. + */ + score: number; + /** + * The result image URL. + */ + url: string; } - - getRoot() { - return this.root; + /** + * Label to provide extra metadata for the web detection. + */ + export interface Schema$WebLabel { + /** + * Label for extra metadata. + */ + label: string; + /** + * The BCP-47 language code for `label`, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; } - - /** - * vision.locations.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias vision.locations.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + * Metadata for web pages. + */ + export interface Schema$WebPage { + /** + * Fully matching images on the page. Can include resized copies of the + * query image. + */ + fullMatchingImages: Schema$WebImage[]; + /** + * Title for the web page, may contain HTML markups. + */ + pageTitle: string; + /** + * Partial matching images on the page. Those images are similar enough to + * share some key-point features. For example an original image will likely + * have partial matching for its crops. + */ + partialMatchingImages: Schema$WebImage[]; + /** + * (Deprecated) Overall relevancy score for the web page. + */ + score: number; + /** + * The result web page URL. + */ + url: string; + } + /** + * A word representation. + */ + export interface Schema$Word { + /** + * The bounding box for the word. The vertices are in the order of top-left, + * top-right, bottom-right, bottom-left. When a rotation of the bounding box + * is detected the rotation is represented as around the top-left corner as + * defined when the text is read in the 'natural' orientation. For + * example: * when the text is horizontal it might look like: 0----1 + * | | 3----2 * when it's rotated 180 degrees around the + * top-left corner it becomes: 2----3 | | 1----0 and the + * vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$BoundingPoly; + /** + * Confidence of the OCR results for the word. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the word. + */ + property: Schema$TextProperty; + /** + * List of symbols in the word. The order of the symbols follows the natural + * reading order. + */ + symbols: Schema$Symbol[]; } -} + export class Resource$Images { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); + } -export class Resource$Operations { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); - } + getRoot() { + return this.root; + } - getRoot() { - return this.root; + + /** + * vision.images.annotate + * @desc Run image detection and annotation for a batch of images. + * @example + * * // BEFORE RUNNING: + * // --------------- + * // 1. If not already done, enable the Google Cloud Vision API + * // and check the quota for your project at + * // https://console.developers.google.com/apis/api/vision + * // 2. This sample uses Application Default Credentials for + * authentication. + * // If not already done, install the gcloud CLI from + * // https://cloud.google.com/sdk and run + * // `gcloud beta auth application-default login`. + * // For more information, see + * // + * https://developers.google.com/identity/protocols/application-default-credentials + * // 3. Install the Node.js client library by running + * // `npm install googleapis --save` + * + * var google = require('googleapis'); + * var vision = google.vision('v1'); + * + * authorize(function(authClient) { + * var request = { + * resource: { + * // TODO: Add desired properties to the request body. + * }, + * + * auth: authClient, + * }; + * + * vision.images.annotate(request, function(err, response) { + * if (err) { + * console.error(err); + * return; + * } + * + * // TODO: Change code below to process the `response` object: + * console.log(JSON.stringify(response, null, 2)); + * }); + * }); + * + * function authorize(callback) { + * google.auth.getApplicationDefault(function(err, authClient) { + * if (err) { + * console.error('authentication failed: ', err); + * return; + * } + * if (authClient.createScopedRequired && + * authClient.createScopedRequired()) { var scopes = + * ['https://www.googleapis.com/auth/cloud-platform']; authClient = + * authClient.createScoped(scopes); + * } + * callback(authClient); + * }); + * } + * @alias vision.images.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().BatchAnnotateImagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): + AxiosPromise; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + annotate( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/images:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } + export class Resource$Locations { + root: Vision; + operations: Resource$Locations$Operations; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); + this.operations = new Resource$Locations$Operations(root); + } - /** - * vision.operations.cancel - * @desc Starts asynchronous cancellation on a long-running operation. The - * server makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation - * or other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, the - * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to - * `Code.CANCELLED`. - * @alias vision.operations.cancel - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be cancelled. - * @param {().CancelOperationRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - cancel(params?: any, options?: MethodOptions): AxiosPromise; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - cancel( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + getRoot() { + return this.root; } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Locations$Operations { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:cancel').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * vision.operations.delete - * @desc Deletes a long-running operation. This method indicates that the - * client is no longer interested in the operation result. It does not cancel - * the operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * @alias vision.operations.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource to be deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * vision.locations.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias vision.locations.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } - /** - * vision.operations.get - * @desc Gets the latest state of a long-running operation. Clients can use - * this method to poll the operation result at intervals as recommended by the - * API service. - * @alias vision.operations.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.name The name of the operation resource. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Operations { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * vision.operations.cancel + * @desc Starts asynchronous cancellation on a long-running operation. The + * server makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation + * or other methods to check whether the cancellation succeeded or whether + * the operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with an + * Operation.error value with a google.rpc.Status.code of 1, corresponding + * to `Code.CANCELLED`. + * @alias vision.operations.cancel + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be cancelled. + * @param {().CancelOperationRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + cancel(params?: any, options?: MethodOptions): AxiosPromise; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + cancel( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:cancel') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * vision.operations.list - * @desc Lists operations that match the specified filter in the request. If - * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: - * the `name` binding allows API services to override the binding to use - * different resource name schemes, such as `users/x/operations`. To override - * the binding, API services can add a binding such as - * `"/v1/{name=users/x}/operations"` to their service configuration. For - * backwards compatibility, the default name includes the operations - * collection id, however overriding users must ensure the name binding is the - * parent resource, without the operations collection id. - * @alias vision.operations.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The standard list filter. - * @param {string} params.name The name of the operation's parent resource. - * @param {integer=} params.pageSize The standard list page size. - * @param {string=} params.pageToken The standard list page token. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * vision.operations.delete + * @desc Deletes a long-running operation. This method indicates that the + * client is no longer interested in the operation result. It does not + * cancel the operation. If the server doesn't support this method, it + * returns `google.rpc.Code.UNIMPLEMENTED`. + * @alias vision.operations.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource to be deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + + + /** + * vision.operations.get + * @desc Gets the latest state of a long-running operation. Clients can use + * this method to poll the operation result at intervals as recommended by + * the API service. + * @alias vision.operations.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The name of the operation resource. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * vision.operations.list + * @desc Lists operations that match the specified filter in the request. If + * the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: + * the `name` binding allows API services to override the binding to use + * different resource name schemes, such as `users/x/operations`. To + * override the binding, API services can add a binding such as + * `"/v1/{name=users/x}/operations"` to their service configuration. For + * backwards compatibility, the default name includes the operations + * collection id, however overriding users must ensure the name binding is + * the parent resource, without the operations collection id. + * @alias vision.operations.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The standard list filter. + * @param {string} params.name The name of the operation's parent resource. + * @param {integer=} params.pageSize The standard list page size. + * @param {string=} params.pageToken The standard list page token. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/vision/v1p1beta1.ts b/src/apis/vision/v1p1beta1.ts index d9b8b7fc475..1875bae681a 100644 --- a/src/apis/vision/v1p1beta1.ts +++ b/src/apis/vision/v1p1beta1.ts @@ -27,1939 +27,1957 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Vision API - * - * Integrates Google Vision features, including image labeling, face, logo, and - * landmark detection, optical character recognition (OCR), and detection of - * explicit content, into applications. - * - * @example - * const google = require('googleapis'); - * const vision = google.vision('v1p1beta1'); - * - * @namespace vision - * @type {Function} - * @version v1p1beta1 - * @variation v1p1beta1 - * @param {object=} options Options for Vision - */ -export class Vision { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace vision_v1p1beta1 { + /** + * Cloud Vision API + * + * Integrates Google Vision features, including image labeling, face, logo, + * and landmark detection, optical character recognition (OCR), and detection + * of explicit content, into applications. + * + * @example + * const google = require('googleapis'); + * const vision = google.vision('v1p1beta1'); + * + * @namespace vision + * @type {Function} + * @version v1p1beta1 + * @variation v1p1beta1 + * @param {object=} options Options for Vision + */ + export class Vision { + _options: GlobalOptions; + google: GoogleApis; + root = this; - images: Resource$Images; + images: Resource$Images; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.images = new Resource$Images(this); - } + this.images = new Resource$Images(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Represents a color in the RGBA color space. This representation is designed - * for simplicity of conversion to/from color representations in various - * languages over compactness; for example, the fields of this representation - * can be trivially provided to the constructor of "java.awt.Color" in - * Java; it can also be trivially provided to UIColor's - * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a - * little work, it can be easily formatted into a CSS "rgba()" string - * in JavaScript, as well. Here are some examples: Example (Java): import - * com.google.type.Color; // ... public static java.awt.Color - * fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? - * protocolor.getAlpha().getValue() : 1.0; return new - * java.awt.Color( protocolor.getRed(), protocolor.getGreen(), - * protocolor.getBlue(), alpha); } public static Color - * toProto(java.awt.Color color) { float red = (float) color.getRed(); - * float green = (float) color.getGreen(); float blue = (float) - * color.getBlue(); float denominator = 255.0; Color.Builder - * resultBuilder = Color .newBuilder() .setRed(red / - * denominator) .setGreen(green / denominator) .setBlue(blue / - * denominator); int alpha = color.getAlpha(); if (alpha != 255) { - * result.setAlpha( FloatValue .newBuilder() - * .setValue(((float) alpha) / denominator) .build()); } - * return resultBuilder.build(); } // ... Example (iOS / Obj-C): // - * ... static UIColor* fromProto(Color* protocolor) { float red = - * [protocolor red]; float green = [protocolor green]; float - * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor - * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha - * = [alpha_wrapper value]; } return [UIColor colorWithRed:red - * green:green blue:blue alpha:alpha]; } static Color* - * toProto(UIColor* color) { CGFloat red, green, blue, alpha; if - * (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - * return nil; } Color* result = [Color alloc] init]; [result - * setRed:red]; [result setGreen:green]; [result - * setBlue:blue]; if (alpha <= 0.9999) { [result - * setAlpha:floatWrapperWithValue(alpha)]; } [result - * autorelease]; return result; } // ... Example - * (JavaScript): // ... var protoToCssColor = function(rgb_color) { - * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || - * 0.0; var blueFrac = rgb_color.blue || 0.0; var red = - * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); - * var blue = Math.floor(blueFrac * 255); if (!('alpha' in - * rgb_color)) { return rgbToCssColor_(red, green, blue); } var - * alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, - * blue].join(','); return ['rgba(', rgbParams, - * ',', alphaFrac, ')'].join(''); }; var - * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new - * Number((red << 16) | (green << 8) | blue); var hexString = - * rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var - * resultBuilder = ['#']; for (var i = 0; i < missingZeros; - * i++) { resultBuilder.push('0'); } - * resultBuilder.push(hexString); return resultBuilder.join(''); - * }; // ... - */ -export interface Schema$Color { - /** - * The fraction of this color that should be applied to the pixel. That is, - * the final pixel color is defined by the equation: pixel color = alpha * - * (this color) + (1.0 - alpha) * (background color) This means that a value - * of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to - * a completely transparent color. This uses a wrapper message rather than a - * simple float scalar so that it is possible to distinguish between a default - * value and the value being unset. If omitted, this color object is to be - * rendered as a solid color (as if the alpha value had been explicitly given - * with a value of 1.0). - */ - alpha: number; - /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; - /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; - /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * Request for performing Google Cloud Vision API tasks over a user-provided - * image, with user-requested features. - */ -export interface Schema$GoogleCloudVisionV1p1beta1AnnotateImageRequest { - /** - * Requested features. - */ - features: Schema$GoogleCloudVisionV1p1beta1Feature[]; - /** - * The image to be processed. - */ - image: Schema$GoogleCloudVisionV1p1beta1Image; - /** - * Additional context that may accompany the image. - */ - imageContext: Schema$GoogleCloudVisionV1p1beta1ImageContext; -} -/** - * Response to an image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p1beta1AnnotateImageResponse { - /** - * If present, crop hints have completed successfully. - */ - cropHintsAnnotation: Schema$GoogleCloudVisionV1p1beta1CropHintsAnnotation; /** - * If set, represents the error message for the operation. Note that filled-in - * image annotations are guaranteed to be correct, even when `error` is set. - */ - error: Schema$Status; + * Represents a color in the RGBA color space. This representation is designed + * for simplicity of conversion to/from color representations in various + * languages over compactness; for example, the fields of this representation + * can be trivially provided to the constructor of "java.awt.Color" + * in Java; it can also be trivially provided to UIColor's + * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a + * little work, it can be easily formatted into a CSS "rgba()" + * string in JavaScript, as well. Here are some examples: Example (Java): + * import com.google.type.Color; // ... public static + * java.awt.Color fromProto(Color protocolor) { float alpha = + * protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; + * return new java.awt.Color( protocolor.getRed(), + * protocolor.getGreen(), protocolor.getBlue(), alpha); + * } public static Color toProto(java.awt.Color color) { float + * red = (float) color.getRed(); float green = (float) + * color.getGreen(); float blue = (float) color.getBlue(); float + * denominator = 255.0; Color.Builder resultBuilder = Color + * .newBuilder() .setRed(red / denominator) .setGreen(green / + * denominator) .setBlue(blue / denominator); int alpha + * = color.getAlpha(); if (alpha != 255) { result.setAlpha( + * FloatValue .newBuilder() .setValue(((float) alpha) / + * denominator) .build()); } return + * resultBuilder.build(); } // ... Example (iOS / Obj-C): // + * ... static UIColor* fromProto(Color* protocolor) { float red = + * [protocolor red]; float green = [protocolor green]; float + * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor + * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { + * alpha = [alpha_wrapper value]; } return [UIColor + * colorWithRed:red green:green blue:blue alpha:alpha]; } static + * Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; + * if (![color getRed:&red green:&green blue:&blue + * alpha:&alpha]) { return nil; } Color* + * result = [Color alloc] init]; [result setRed:red]; [result + * setGreen:green]; [result setBlue:blue]; if (alpha <= + * 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } + * [result autorelease]; return result; } // ... Example + * (JavaScript): // ... var protoToCssColor = function(rgb_color) { + * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green + * || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = + * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); + * var blue = Math.floor(blueFrac * 255); if (!('alpha' in + * rgb_color)) { return rgbToCssColor_(red, green, blue); } + * var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, + * green, blue].join(','); return ['rgba(', rgbParams, + * ',', alphaFrac, ')'].join(''); }; var + * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new + * Number((red << 16) | (green << 8) | blue); var hexString + * = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; + * var resultBuilder = ['#']; for (var i = 0; i < + * missingZeros; i++) { resultBuilder.push('0'); } + * resultBuilder.push(hexString); return resultBuilder.join(''); + * }; // ... + */ + export interface Schema$Color { + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: pixel color = alpha + * * (this color) + (1.0 - alpha) * (background color) This means that a + * value of 1.0 corresponds to a solid color, whereas a value of 0.0 + * corresponds to a completely transparent color. This uses a wrapper + * message rather than a simple float scalar so that it is possible to + * distinguish between a default value and the value being unset. If + * omitted, this color object is to be rendered as a solid color (as if the + * alpha value had been explicitly given with a value of 1.0). + */ + alpha: number; + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * If present, face detection has completed successfully. - */ - faceAnnotations: Schema$GoogleCloudVisionV1p1beta1FaceAnnotation[]; + * Request for performing Google Cloud Vision API tasks over a user-provided + * image, with user-requested features. + */ + export interface Schema$GoogleCloudVisionV1p1beta1AnnotateImageRequest { + /** + * Requested features. + */ + features: Schema$GoogleCloudVisionV1p1beta1Feature[]; + /** + * The image to be processed. + */ + image: Schema$GoogleCloudVisionV1p1beta1Image; + /** + * Additional context that may accompany the image. + */ + imageContext: Schema$GoogleCloudVisionV1p1beta1ImageContext; + } /** - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. This annotation provides the structural hierarchy - * for the OCR detected text. - */ - fullTextAnnotation: Schema$GoogleCloudVisionV1p1beta1TextAnnotation; + * Response to an image annotation request. + */ + export interface Schema$GoogleCloudVisionV1p1beta1AnnotateImageResponse { + /** + * If present, crop hints have completed successfully. + */ + cropHintsAnnotation: Schema$GoogleCloudVisionV1p1beta1CropHintsAnnotation; + /** + * If set, represents the error message for the operation. Note that + * filled-in image annotations are guaranteed to be correct, even when + * `error` is set. + */ + error: Schema$Status; + /** + * If present, face detection has completed successfully. + */ + faceAnnotations: Schema$GoogleCloudVisionV1p1beta1FaceAnnotation[]; + /** + * If present, text (OCR) detection or document (OCR) text detection has + * completed successfully. This annotation provides the structural hierarchy + * for the OCR detected text. + */ + fullTextAnnotation: Schema$GoogleCloudVisionV1p1beta1TextAnnotation; + /** + * If present, image properties were extracted successfully. + */ + imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p1beta1ImageProperties; + /** + * If present, label detection has completed successfully. + */ + labelAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + /** + * If present, landmark detection has completed successfully. + */ + landmarkAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + /** + * If present, logo detection has completed successfully. + */ + logoAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + /** + * If present, safe-search annotation has completed successfully. + */ + safeSearchAnnotation: Schema$GoogleCloudVisionV1p1beta1SafeSearchAnnotation; + /** + * If present, text (OCR) detection has completed successfully. + */ + textAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + /** + * If present, web detection has completed successfully. + */ + webDetection: Schema$GoogleCloudVisionV1p1beta1WebDetection; + } /** - * If present, image properties were extracted successfully. + * Multiple image annotation requests are batched into a single service call. */ - imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p1beta1ImageProperties; + export interface Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest { + /** + * Individual image annotation requests for this batch. + */ + requests: Schema$GoogleCloudVisionV1p1beta1AnnotateImageRequest[]; + } /** - * If present, label detection has completed successfully. + * Response to a batch image annotation request. */ - labelAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + export interface Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse { + /** + * Individual responses to image annotation requests within the batch. + */ + responses: Schema$GoogleCloudVisionV1p1beta1AnnotateImageResponse[]; + } /** - * If present, landmark detection has completed successfully. - */ - landmarkAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + * Logical element on the page. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Block { + /** + * Detected block type (text, image etc) for this block. + */ + blockType: string; + /** + * The bounding box for the block. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's + * rotated 180 degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Confidence of the OCR results on the block. Range [0, 1]. + */ + confidence: number; + /** + * List of paragraphs in this block (if this blocks is of type text). + */ + paragraphs: Schema$GoogleCloudVisionV1p1beta1Paragraph[]; + /** + * Additional information detected for the block. + */ + property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + } /** - * If present, logo detection has completed successfully. + * A bounding polygon for the detected image annotation. */ - logoAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + export interface Schema$GoogleCloudVisionV1p1beta1BoundingPoly { + /** + * The bounding polygon vertices. + */ + vertices: Schema$GoogleCloudVisionV1p1beta1Vertex[]; + } /** - * If present, safe-search annotation has completed successfully. - */ - safeSearchAnnotation: Schema$GoogleCloudVisionV1p1beta1SafeSearchAnnotation; + * Color information consists of RGB channels, score, and the fraction of the + * image that the color occupies in the image. + */ + export interface Schema$GoogleCloudVisionV1p1beta1ColorInfo { + /** + * RGB components of the color. + */ + color: Schema$Color; + /** + * The fraction of pixels the color occupies in the image. Value in range + * [0, 1]. + */ + pixelFraction: number; + /** + * Image-specific score for this color. Value in range [0, 1]. + */ + score: number; + } /** - * If present, text (OCR) detection has completed successfully. - */ - textAnnotations: Schema$GoogleCloudVisionV1p1beta1EntityAnnotation[]; + * Single crop hint that is used to generate a new crop when serving an image. + */ + export interface Schema$GoogleCloudVisionV1p1beta1CropHint { + /** + * The bounding polygon for the crop region. The coordinates of the bounding + * box are in the original image's scale, as returned in `ImageParams`. + */ + boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Confidence of this being a salient region. Range [0, 1]. + */ + confidence: number; + /** + * Fraction of importance of this salient region with respect to the + * original image. + */ + importanceFraction: number; + } /** - * If present, web detection has completed successfully. + * Set of crop hints that are used to generate new crops when serving images. */ - webDetection: Schema$GoogleCloudVisionV1p1beta1WebDetection; -} -/** - * Multiple image annotation requests are batched into a single service call. - */ -export interface Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest { + export interface Schema$GoogleCloudVisionV1p1beta1CropHintsAnnotation { + /** + * Crop hint results. + */ + cropHints: Schema$GoogleCloudVisionV1p1beta1CropHint[]; + } /** - * Individual image annotation requests for this batch. + * Parameters for crop hints annotation request. */ - requests: Schema$GoogleCloudVisionV1p1beta1AnnotateImageRequest[]; -} -/** - * Response to a batch image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse { + export interface Schema$GoogleCloudVisionV1p1beta1CropHintsParams { + /** + * Aspect ratios in floats, representing the ratio of the width to the + * height of the image. For example, if the desired aspect ratio is 4/3, the + * corresponding float value should be 1.33333. If not specified, the best + * possible crop is returned. The number of provided aspect ratios is + * limited to a maximum of 16; any aspect ratios provided after the 16th are + * ignored. + */ + aspectRatios: number[]; + } /** - * Individual responses to image annotation requests within the batch. + * Set of dominant colors and their corresponding scores. */ - responses: Schema$GoogleCloudVisionV1p1beta1AnnotateImageResponse[]; -} -/** - * Logical element on the page. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Block { + export interface Schema$GoogleCloudVisionV1p1beta1DominantColorsAnnotation { + /** + * RGB color values with their score and pixel fraction. + */ + colors: Schema$GoogleCloudVisionV1p1beta1ColorInfo[]; + } /** - * Detected block type (text, image etc) for this block. - */ - blockType: string; + * Set of detected entity features. + */ + export interface Schema$GoogleCloudVisionV1p1beta1EntityAnnotation { + /** + * Image region to which this entity belongs. Not produced for + * `LABEL_DETECTION` features. + */ + boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * **Deprecated. Use `score` instead.** The accuracy of the entity detection + * in an image. For example, for an image in which the "Eiffel + * Tower" entity is detected, this field represents the confidence that + * there is a tower in the query image. Range [0, 1]. + */ + confidence: number; + /** + * Entity textual description, expressed in its `locale` language. + */ + description: string; + /** + * The language code for the locale in which the entity textual + * `description` is expressed. + */ + locale: string; + /** + * The location information for the detected entity. Multiple `LocationInfo` + * elements can be present because one location may indicate the location of + * the scene in the image, and another location may indicate the location of + * the place where the image was taken. Location information is usually + * present for landmarks. + */ + locations: Schema$GoogleCloudVisionV1p1beta1LocationInfo[]; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + mid: string; + /** + * Some entities may have optional user-supplied `Property` (name/value) + * fields, such a score or string that qualifies the entity. + */ + properties: Schema$GoogleCloudVisionV1p1beta1Property[]; + /** + * Overall score of the result. Range [0, 1]. + */ + score: number; + /** + * The relevancy of the ICA (Image Content Annotation) label to the image. + * For example, the relevancy of "tower" is likely higher to an + * image containing the detected "Eiffel Tower" than to an image + * containing a detected distant towering building, even though the + * confidence that there is a tower in each image may be the same. Range [0, + * 1]. + */ + topicality: number; + } /** - * The bounding box for the block. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 - * | | 3----2 * when it's rotated 180 degrees around the - * top-left corner it becomes: 2----3 | | 1----0 - * and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + * A face annotation object contains the results of face detection. + */ + export interface Schema$GoogleCloudVisionV1p1beta1FaceAnnotation { + /** + * Anger likelihood. + */ + angerLikelihood: string; + /** + * Blurred likelihood. + */ + blurredLikelihood: string; + /** + * The bounding polygon around the face. The coordinates of the bounding box + * are in the original image's scale, as returned in `ImageParams`. The + * bounding box is computed to "frame" the face in accordance with + * human expectations. It is based on the landmarker results. Note that one + * or more x and/or y coordinates may not be generated in the `BoundingPoly` + * (the polygon will be unbounded) if only a partial face appears in the + * image to be annotated. + */ + boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Detection confidence. Range [0, 1]. + */ + detectionConfidence: number; + /** + * The `fd_bounding_poly` bounding polygon is tighter than the + * `boundingPoly`, and encloses only the skin part of the face. Typically, + * it is used to eliminate the face from any image analysis that detects the + * "amount of skin" visible in an image. It is not based on the + * landmarker results, only on the initial face detection, hence the + * <code>fd</code> (face detection) prefix. + */ + fdBoundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Headwear likelihood. + */ + headwearLikelihood: string; + /** + * Joy likelihood. + */ + joyLikelihood: string; + /** + * Face landmarking confidence. Range [0, 1]. + */ + landmarkingConfidence: number; + /** + * Detected face landmarks. + */ + landmarks: Schema$GoogleCloudVisionV1p1beta1FaceAnnotationLandmark[]; + /** + * Yaw angle, which indicates the leftward/rightward angle that the face is + * pointing relative to the vertical plane perpendicular to the image. Range + * [-180,180]. + */ + panAngle: number; + /** + * Roll angle, which indicates the amount of clockwise/anti-clockwise + * rotation of the face relative to the image vertical about the axis + * perpendicular to the face. Range [-180,180]. + */ + rollAngle: number; + /** + * Sorrow likelihood. + */ + sorrowLikelihood: string; + /** + * Surprise likelihood. + */ + surpriseLikelihood: string; + /** + * Pitch angle, which indicates the upwards/downwards angle that the face is + * pointing relative to the image's horizontal plane. Range [-180,180]. + */ + tiltAngle: number; + /** + * Under-exposed likelihood. + */ + underExposedLikelihood: string; + } /** - * Confidence of the OCR results on the block. Range [0, 1]. - */ - confidence: number; + * A face-specific landmark (for example, a face feature). + */ + export interface Schema$GoogleCloudVisionV1p1beta1FaceAnnotationLandmark { + /** + * Face landmark position. + */ + position: Schema$GoogleCloudVisionV1p1beta1Position; + /** + * Face landmark type. + */ + type: string; + } /** - * List of paragraphs in this block (if this blocks is of type text). - */ - paragraphs: Schema$GoogleCloudVisionV1p1beta1Paragraph[]; + * The type of Google Cloud Vision API detection to perform, and the maximum + * number of results to return for that type. Multiple `Feature` objects can + * be specified in the `features` list. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Feature { + /** + * Maximum number of results of this type. Does not apply to + * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + */ + maxResults: number; + /** + * Model to use for the feature. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + /** + * The feature type. + */ + type: string; + } /** - * Additional information detected for the block. - */ - property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; -} -/** - * A bounding polygon for the detected image annotation. - */ -export interface Schema$GoogleCloudVisionV1p1beta1BoundingPoly { + * Client image to perform Google Cloud Vision API tasks over. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Image { + /** + * Image content, represented as a stream of bytes. Note: As with all + * `bytes` fields, protobuffers use a pure binary representation, whereas + * JSON representations use base64. + */ + content: string; + /** + * Google Cloud Storage image location, or publicly-accessible image URL. If + * both `content` and `source` are provided for an image, `content` takes + * precedence and is used to perform the image annotation request. + */ + source: Schema$GoogleCloudVisionV1p1beta1ImageSource; + } /** - * The bounding polygon vertices. - */ - vertices: Schema$GoogleCloudVisionV1p1beta1Vertex[]; -} -/** - * Color information consists of RGB channels, score, and the fraction of the - * image that the color occupies in the image. - */ -export interface Schema$GoogleCloudVisionV1p1beta1ColorInfo { + * Image context and/or feature-specific parameters. + */ + export interface Schema$GoogleCloudVisionV1p1beta1ImageContext { + /** + * Parameters for crop hints annotation request. + */ + cropHintsParams: Schema$GoogleCloudVisionV1p1beta1CropHintsParams; + /** + * List of languages to use for TEXT_DETECTION. In most cases, an empty + * value yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting + * `language_hints` is not needed. In rare cases, when the language of the + * text in the image is known, setting a hint will help get better results + * (although it will be a significant hindrance if the hint is wrong). Text + * detection returns an error if one or more of the specified languages is + * not one of the [supported languages](/vision/docs/languages). + */ + languageHints: string[]; + /** + * Not used. + */ + latLongRect: Schema$GoogleCloudVisionV1p1beta1LatLongRect; + /** + * Parameters for web detection. + */ + webDetectionParams: Schema$GoogleCloudVisionV1p1beta1WebDetectionParams; + } /** - * RGB components of the color. + * Stores image properties, such as dominant colors. */ - color: Schema$Color; + export interface Schema$GoogleCloudVisionV1p1beta1ImageProperties { + /** + * If present, dominant colors completed successfully. + */ + dominantColors: Schema$GoogleCloudVisionV1p1beta1DominantColorsAnnotation; + } /** - * The fraction of pixels the color occupies in the image. Value in range [0, - * 1]. - */ - pixelFraction: number; + * External image source (Google Cloud Storage or web URL image location). + */ + export interface Schema$GoogleCloudVisionV1p1beta1ImageSource { + /** + * **Use `image_uri` instead.** The Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. See + * [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. + */ + gcsImageUri: string; + /** + * The URI of the source image. Can be either: 1. A Google Cloud Storage + * URI of the form `gs://bucket_name/object_name`. Object versioning is + * not supported. See [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + * images from HTTP/HTTPS URLs, Google cannot guarantee that the request + * will be completed. Your request may fail if the specified host denies + * the request (e.g. due to request throttling or DOS prevention), or if + * Google throttles requests to the site for abuse prevention. You should + * not depend on externally-hosted images for production applications. + * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` + * takes precedence. + */ + imageUri: string; + } /** - * Image-specific score for this color. Value in range [0, 1]. - */ - score: number; -} -/** - * Single crop hint that is used to generate a new crop when serving an image. - */ -export interface Schema$GoogleCloudVisionV1p1beta1CropHint { + * Rectangle determined by min and max `LatLng` pairs. + */ + export interface Schema$GoogleCloudVisionV1p1beta1LatLongRect { + /** + * Max lat/long pair. + */ + maxLatLng: Schema$LatLng; + /** + * Min lat/long pair. + */ + minLatLng: Schema$LatLng; + } /** - * The bounding polygon for the crop region. The coordinates of the bounding - * box are in the original image's scale, as returned in `ImageParams`. + * Detected entity location information. */ - boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + export interface Schema$GoogleCloudVisionV1p1beta1LocationInfo { + /** + * lat/long location coordinates. + */ + latLng: Schema$LatLng; + } /** - * Confidence of this being a salient region. Range [0, 1]. - */ - confidence: number; + * Detected page from OCR. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Page { + /** + * List of blocks of text, images etc on this page. + */ + blocks: Schema$GoogleCloudVisionV1p1beta1Block[]; + /** + * Confidence of the OCR results on the page. Range [0, 1]. + */ + confidence: number; + /** + * Page height. For PDFs the unit is points. For images (including TIFFs) + * the unit is pixels. + */ + height: number; + /** + * Additional information detected on the page. + */ + property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + /** + * Page width. For PDFs the unit is points. For images (including TIFFs) the + * unit is pixels. + */ + width: number; + } /** - * Fraction of importance of this salient region with respect to the original - * image. - */ - importanceFraction: number; -} -/** - * Set of crop hints that are used to generate new crops when serving images. - */ -export interface Schema$GoogleCloudVisionV1p1beta1CropHintsAnnotation { + * Structural unit of text representing a number of words in certain order. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Paragraph { + /** + * The bounding box for the paragraph. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Confidence of the OCR results for the paragraph. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the paragraph. + */ + property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + /** + * List of words in this paragraph. + */ + words: Schema$GoogleCloudVisionV1p1beta1Word[]; + } /** - * Crop hint results. - */ - cropHints: Schema$GoogleCloudVisionV1p1beta1CropHint[]; -} -/** - * Parameters for crop hints annotation request. - */ -export interface Schema$GoogleCloudVisionV1p1beta1CropHintsParams { + * A 3D position in the image, used primarily for Face detection landmarks. A + * valid Position must have both x and y coordinates. The position coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Position { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + /** + * Z coordinate (or depth). + */ + z: number; + } /** - * Aspect ratios in floats, representing the ratio of the width to the height - * of the image. For example, if the desired aspect ratio is 4/3, the - * corresponding float value should be 1.33333. If not specified, the best - * possible crop is returned. The number of provided aspect ratios is limited - * to a maximum of 16; any aspect ratios provided after the 16th are ignored. - */ - aspectRatios: number[]; -} -/** - * Set of dominant colors and their corresponding scores. - */ -export interface Schema$GoogleCloudVisionV1p1beta1DominantColorsAnnotation { + * A `Property` consists of a user-supplied name/value pair. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Property { + /** + * Name of the property. + */ + name: string; + /** + * Value of numeric properties. + */ + uint64Value: string; + /** + * Value of the property. + */ + value: string; + } /** - * RGB color values with their score and pixel fraction. - */ - colors: Schema$GoogleCloudVisionV1p1beta1ColorInfo[]; -} -/** - * Set of detected entity features. - */ -export interface Schema$GoogleCloudVisionV1p1beta1EntityAnnotation { + * Set of features pertaining to the image, computed by computer vision + * methods over safe-search verticals (for example, adult, spoof, medical, + * violence). + */ + export interface Schema$GoogleCloudVisionV1p1beta1SafeSearchAnnotation { + /** + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. + */ + adult: string; + /** + * Likelihood that this is a medical image. + */ + medical: string; + /** + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive body + * areas. + */ + racy: string; + /** + * Spoof likelihood. The likelihood that an modification was made to the + * image's canonical version to make it appear funny or offensive. + */ + spoof: string; + /** + * Likelihood that this image contains violent content. + */ + violence: string; + } /** - * Image region to which this entity belongs. Not produced for - * `LABEL_DETECTION` features. - */ - boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + * A single symbol representation. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Symbol { + /** + * The bounding box for the symbol. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Confidence of the OCR results for the symbol. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the symbol. + */ + property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + /** + * The actual UTF-8 representation of the symbol. + */ + text: string; + } /** - * **Deprecated. Use `score` instead.** The accuracy of the entity detection - * in an image. For example, for an image in which the "Eiffel - * Tower" entity is detected, this field represents the confidence that - * there is a tower in the query image. Range [0, 1]. - */ - confidence: number; + * TextAnnotation contains a structured representation of OCR extracted text. + * The hierarchy of an OCR extracted text structure is like this: + * TextAnnotation -> Page -> Block -> Paragraph -> Word -> + * Symbol Each structural component, starting from Page, may further have + * their own properties. Properties describe detected languages, breaks etc.. + * Please refer to the TextAnnotation.TextProperty message definition below + * for more detail. + */ + export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotation { + /** + * List of pages detected by OCR. + */ + pages: Schema$GoogleCloudVisionV1p1beta1Page[]; + /** + * UTF-8 text detected on the pages. + */ + text: string; + } /** - * Entity textual description, expressed in its `locale` language. - */ - description: string; + * Detected start or end of a structural component. + */ + export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak { + /** + * True if break prepends the element. + */ + isPrefix: boolean; + /** + * Detected break type. + */ + type: string; + } /** - * The language code for the locale in which the entity textual `description` - * is expressed. - */ - locale: string; + * Detected language for a structural component. + */ + export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage { + /** + * Confidence of detected language. Range [0, 1]. + */ + confidence: number; + /** + * The BCP-47 language code, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * The location information for the detected entity. Multiple `LocationInfo` - * elements can be present because one location may indicate the location of - * the scene in the image, and another location may indicate the location of - * the place where the image was taken. Location information is usually - * present for landmarks. - */ - locations: Schema$GoogleCloudVisionV1p1beta1LocationInfo[]; + * Additional information detected on the structural component. + */ + export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty { + /** + * Detected start or end of a text segment. + */ + detectedBreak: Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak; + /** + * A list of detected languages together with confidence. + */ + detectedLanguages: + Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage[]; + } /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - mid: string; + * A vertex represents a 2D point in the image. NOTE: the vertex coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Vertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * Some entities may have optional user-supplied `Property` (name/value) - * fields, such a score or string that qualifies the entity. - */ - properties: Schema$GoogleCloudVisionV1p1beta1Property[]; + * Relevant information for the image from the Internet. + */ + export interface Schema$GoogleCloudVisionV1p1beta1WebDetection { + /** + * Best guess text labels for the request image. + */ + bestGuessLabels: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebLabel[]; + /** + * Fully matching images from the Internet. Can include resized copies of + * the query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; + /** + * Web pages containing the matching images from the Internet. + */ + pagesWithMatchingImages: + Schema$GoogleCloudVisionV1p1beta1WebDetectionWebPage[]; + /** + * Partial matching images from the Internet. Those images are similar + * enough to share some key-point features. For example an original image + * will likely have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; + /** + * The visually similar image results. + */ + visuallySimilarImages: + Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; + /** + * Deduced entities from similar images on the Internet. + */ + webEntities: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebEntity[]; + } /** - * Overall score of the result. Range [0, 1]. + * Parameters for web detection request. */ - score: number; + export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionParams { + /** + * Whether to include results derived from the geo information in the image. + */ + includeGeoResults: boolean; + } /** - * The relevancy of the ICA (Image Content Annotation) label to the image. For - * example, the relevancy of "tower" is likely higher to an image - * containing the detected "Eiffel Tower" than to an image - * containing a detected distant towering building, even though the confidence - * that there is a tower in each image may be the same. Range [0, 1]. - */ - topicality: number; -} -/** - * A face annotation object contains the results of face detection. - */ -export interface Schema$GoogleCloudVisionV1p1beta1FaceAnnotation { + * Entity deduced from similar images on the Internet. + */ + export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebEntity { + /** + * Canonical description of the entity, in English. + */ + description: string; + /** + * Opaque entity ID. + */ + entityId: string; + /** + * Overall relevancy score for the entity. Not normalized and not comparable + * across different image queries. + */ + score: number; + } /** - * Anger likelihood. - */ - angerLikelihood: string; + * Metadata for online images. + */ + export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage { + /** + * (Deprecated) Overall relevancy score for the image. + */ + score: number; + /** + * The result image URL. + */ + url: string; + } /** - * Blurred likelihood. - */ - blurredLikelihood: string; + * Label to provide extra metadata for the web detection. + */ + export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebLabel { + /** + * Label for extra metadata. + */ + label: string; + /** + * The BCP-47 language code for `label`, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * The bounding polygon around the face. The coordinates of the bounding box - * are in the original image's scale, as returned in `ImageParams`. The - * bounding box is computed to "frame" the face in accordance with - * human expectations. It is based on the landmarker results. Note that one or - * more x and/or y coordinates may not be generated in the `BoundingPoly` (the - * polygon will be unbounded) if only a partial face appears in the image to - * be annotated. - */ - boundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + * Metadata for web pages. + */ + export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebPage { + /** + * Fully matching images on the page. Can include resized copies of the + * query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; + /** + * Title for the web page, may contain HTML markups. + */ + pageTitle: string; + /** + * Partial matching images on the page. Those images are similar enough to + * share some key-point features. For example an original image will likely + * have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; + /** + * (Deprecated) Overall relevancy score for the web page. + */ + score: number; + /** + * The result web page URL. + */ + url: string; + } /** - * Detection confidence. Range [0, 1]. - */ - detectionConfidence: number; + * A word representation. + */ + export interface Schema$GoogleCloudVisionV1p1beta1Word { + /** + * The bounding box for the word. The vertices are in the order of top-left, + * top-right, bottom-right, bottom-left. When a rotation of the bounding box + * is detected the rotation is represented as around the top-left corner as + * defined when the text is read in the 'natural' orientation. For + * example: * when the text is horizontal it might look like: 0----1 + * | | 3----2 * when it's rotated 180 degrees around the + * top-left corner it becomes: 2----3 | | 1----0 and the + * vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + /** + * Confidence of the OCR results for the word. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the word. + */ + property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + /** + * List of symbols in the word. The order of the symbols follows the natural + * reading order. + */ + symbols: Schema$GoogleCloudVisionV1p1beta1Symbol[]; + } /** - * The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, - * and encloses only the skin part of the face. Typically, it is used to - * eliminate the face from any image analysis that detects the "amount of - * skin" visible in an image. It is not based on the landmarker results, - * only on the initial face detection, hence the <code>fd</code> - * (face detection) prefix. - */ - fdBoundingPoly: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + * Response to a single file annotation request. A file may contain one or + * more images, which individually have their own responses. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { + /** + * Information about the file for which this response is generated. + */ + inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; + /** + * Individual responses to images found within the file. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; + } /** - * Headwear likelihood. - */ - headwearLikelihood: string; + * Response to an image annotation request. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { + /** + * If present, contextual information is needed to understand where this + * image comes from. + */ + context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; + /** + * If present, crop hints have completed successfully. + */ + cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; + /** + * If set, represents the error message for the operation. Note that + * filled-in image annotations are guaranteed to be correct, even when + * `error` is set. + */ + error: Schema$Status; + /** + * If present, face detection has completed successfully. + */ + faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; + /** + * If present, text (OCR) detection or document (OCR) text detection has + * completed successfully. This annotation provides the structural hierarchy + * for the OCR detected text. + */ + fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; + /** + * If present, image properties were extracted successfully. + */ + imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; + /** + * If present, label detection has completed successfully. + */ + labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, landmark detection has completed successfully. + */ + landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, logo detection has completed successfully. + */ + logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, safe-search annotation has completed successfully. + */ + safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; + /** + * If present, text (OCR) detection has completed successfully. + */ + textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, web detection has completed successfully. + */ + webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; + } /** - * Joy likelihood. + * The response for a single offline file annotation request. */ - joyLikelihood: string; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { + /** + * The output location and metadata from AsyncAnnotateFileRequest. + */ + outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; + } /** - * Face landmarking confidence. Range [0, 1]. + * Response to an async batch file annotation request. */ - landmarkingConfidence: number; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { + /** + * The list of file annotation responses, one for each request in + * AsyncBatchAnnotateFilesRequest. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; + } /** - * Detected face landmarks. - */ - landmarks: Schema$GoogleCloudVisionV1p1beta1FaceAnnotationLandmark[]; + * Logical element on the page. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Block { + /** + * Detected block type (text, image etc) for this block. + */ + blockType: string; + /** + * The bounding box for the block. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's + * rotated 180 degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results on the block. Range [0, 1]. + */ + confidence: number; + /** + * List of paragraphs in this block (if this blocks is of type text). + */ + paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; + /** + * Additional information detected for the block. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + } /** - * Yaw angle, which indicates the leftward/rightward angle that the face is - * pointing relative to the vertical plane perpendicular to the image. Range - * [-180,180]. - */ - panAngle: number; + * A bounding polygon for the detected image annotation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { + /** + * The bounding polygon normalized vertices. + */ + normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; + /** + * The bounding polygon vertices. + */ + vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; + } /** - * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - * of the face relative to the image vertical about the axis perpendicular to - * the face. Range [-180,180]. - */ - rollAngle: number; + * Color information consists of RGB channels, score, and the fraction of the + * image that the color occupies in the image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { + /** + * RGB components of the color. + */ + color: Schema$Color; + /** + * The fraction of pixels the color occupies in the image. Value in range + * [0, 1]. + */ + pixelFraction: number; + /** + * Image-specific score for this color. Value in range [0, 1]. + */ + score: number; + } /** - * Sorrow likelihood. - */ - sorrowLikelihood: string; + * Single crop hint that is used to generate a new crop when serving an image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1CropHint { + /** + * The bounding polygon for the crop region. The coordinates of the bounding + * box are in the original image's scale, as returned in `ImageParams`. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of this being a salient region. Range [0, 1]. + */ + confidence: number; + /** + * Fraction of importance of this salient region with respect to the + * original image. + */ + importanceFraction: number; + } /** - * Surprise likelihood. + * Set of crop hints that are used to generate new crops when serving images. */ - surpriseLikelihood: string; + export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { + /** + * Crop hint results. + */ + cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; + } /** - * Pitch angle, which indicates the upwards/downwards angle that the face is - * pointing relative to the image's horizontal plane. Range [-180,180]. + * Set of dominant colors and their corresponding scores. */ - tiltAngle: number; + export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { + /** + * RGB color values with their score and pixel fraction. + */ + colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; + } /** - * Under-exposed likelihood. - */ - underExposedLikelihood: string; -} -/** - * A face-specific landmark (for example, a face feature). - */ -export interface Schema$GoogleCloudVisionV1p1beta1FaceAnnotationLandmark { + * Set of detected entity features. + */ + export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { + /** + * Image region to which this entity belongs. Not produced for + * `LABEL_DETECTION` features. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * **Deprecated. Use `score` instead.** The accuracy of the entity detection + * in an image. For example, for an image in which the "Eiffel + * Tower" entity is detected, this field represents the confidence that + * there is a tower in the query image. Range [0, 1]. + */ + confidence: number; + /** + * Entity textual description, expressed in its `locale` language. + */ + description: string; + /** + * The language code for the locale in which the entity textual + * `description` is expressed. + */ + locale: string; + /** + * The location information for the detected entity. Multiple `LocationInfo` + * elements can be present because one location may indicate the location of + * the scene in the image, and another location may indicate the location of + * the place where the image was taken. Location information is usually + * present for landmarks. + */ + locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + mid: string; + /** + * Some entities may have optional user-supplied `Property` (name/value) + * fields, such a score or string that qualifies the entity. + */ + properties: Schema$GoogleCloudVisionV1p2beta1Property[]; + /** + * Overall score of the result. Range [0, 1]. + */ + score: number; + /** + * The relevancy of the ICA (Image Content Annotation) label to the image. + * For example, the relevancy of "tower" is likely higher to an + * image containing the detected "Eiffel Tower" than to an image + * containing a detected distant towering building, even though the + * confidence that there is a tower in each image may be the same. Range [0, + * 1]. + */ + topicality: number; + } /** - * Face landmark position. - */ - position: Schema$GoogleCloudVisionV1p1beta1Position; + * A face annotation object contains the results of face detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { + /** + * Anger likelihood. + */ + angerLikelihood: string; + /** + * Blurred likelihood. + */ + blurredLikelihood: string; + /** + * The bounding polygon around the face. The coordinates of the bounding box + * are in the original image's scale, as returned in `ImageParams`. The + * bounding box is computed to "frame" the face in accordance with + * human expectations. It is based on the landmarker results. Note that one + * or more x and/or y coordinates may not be generated in the `BoundingPoly` + * (the polygon will be unbounded) if only a partial face appears in the + * image to be annotated. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Detection confidence. Range [0, 1]. + */ + detectionConfidence: number; + /** + * The `fd_bounding_poly` bounding polygon is tighter than the + * `boundingPoly`, and encloses only the skin part of the face. Typically, + * it is used to eliminate the face from any image analysis that detects the + * "amount of skin" visible in an image. It is not based on the + * landmarker results, only on the initial face detection, hence the + * <code>fd</code> (face detection) prefix. + */ + fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Headwear likelihood. + */ + headwearLikelihood: string; + /** + * Joy likelihood. + */ + joyLikelihood: string; + /** + * Face landmarking confidence. Range [0, 1]. + */ + landmarkingConfidence: number; + /** + * Detected face landmarks. + */ + landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; + /** + * Yaw angle, which indicates the leftward/rightward angle that the face is + * pointing relative to the vertical plane perpendicular to the image. Range + * [-180,180]. + */ + panAngle: number; + /** + * Roll angle, which indicates the amount of clockwise/anti-clockwise + * rotation of the face relative to the image vertical about the axis + * perpendicular to the face. Range [-180,180]. + */ + rollAngle: number; + /** + * Sorrow likelihood. + */ + sorrowLikelihood: string; + /** + * Surprise likelihood. + */ + surpriseLikelihood: string; + /** + * Pitch angle, which indicates the upwards/downwards angle that the face is + * pointing relative to the image's horizontal plane. Range [-180,180]. + */ + tiltAngle: number; + /** + * Under-exposed likelihood. + */ + underExposedLikelihood: string; + } /** - * Face landmark type. - */ - type: string; -} -/** - * The type of Google Cloud Vision API detection to perform, and the maximum - * number of results to return for that type. Multiple `Feature` objects can be - * specified in the `features` list. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Feature { + * A face-specific landmark (for example, a face feature). + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { + /** + * Face landmark position. + */ + position: Schema$GoogleCloudVisionV1p2beta1Position; + /** + * Face landmark type. + */ + type: string; + } /** - * Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, - * `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - */ - maxResults: number; + * The Google Cloud Storage location where the output will be written to. + */ + export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { + /** + * Google Cloud Storage URI where the results will be stored. Results will + * be in JSON format and preceded by its corresponding input URI. This field + * can either represent a single file, or a prefix for multiple outputs. + * Prefixes must end in a `/`. Examples: * File: + * gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ + * * File: gs://bucket-name/prefix/here If multiple outputs, each + * response is still AnnotateFileResponse, each of which contains some + * subset of the full list of AnnotateImageResponse. Multiple outputs can + * happen if, for example, the output JSON is too large and overflows into + * multiple sharded files. + */ + uri: string; + } /** - * Model to use for the feature. Supported values: "builtin/stable" - * (the default if unset) and "builtin/latest". + * The Google Cloud Storage location where the input will be read from. */ - model: string; + export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { + /** + * Google Cloud Storage URI for the input file. This must only be a Google + * Cloud Storage object. Wildcards are not currently supported. + */ + uri: string; + } /** - * The feature type. - */ - type: string; -} -/** - * Client image to perform Google Cloud Vision API tasks over. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Image { + * If an image was produced from a file (e.g. a PDF), this message gives + * information about the source of that image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { + /** + * If the file was a PDF or TIFF, this field gives the page number within + * the file used to produce the image. + */ + pageNumber: number; + /** + * The URI of the file used to produce the image. + */ + uri: string; + } /** - * Image content, represented as a stream of bytes. Note: As with all `bytes` - * fields, protobuffers use a pure binary representation, whereas JSON - * representations use base64. + * Stores image properties, such as dominant colors. */ - content: string; + export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { + /** + * If present, dominant colors completed successfully. + */ + dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; + } /** - * Google Cloud Storage image location, or publicly-accessible image URL. If - * both `content` and `source` are provided for an image, `content` takes - * precedence and is used to perform the image annotation request. - */ - source: Schema$GoogleCloudVisionV1p1beta1ImageSource; -} -/** - * Image context and/or feature-specific parameters. - */ -export interface Schema$GoogleCloudVisionV1p1beta1ImageContext { + * The desired input location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { + /** + * The Google Cloud Storage location to read the input from. + */ + gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; + /** + * The type of the file. Currently only "application/pdf" and + * "image/tiff" are supported. Wildcards are not supported. + */ + mimeType: string; + } /** - * Parameters for crop hints annotation request. + * Detected entity location information. */ - cropHintsParams: Schema$GoogleCloudVisionV1p1beta1CropHintsParams; + export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { + /** + * lat/long location coordinates. + */ + latLng: Schema$LatLng; + } /** - * List of languages to use for TEXT_DETECTION. In most cases, an empty value - * yields the best results since it enables automatic language detection. For - * languages based on the Latin alphabet, setting `language_hints` is not - * needed. In rare cases, when the language of the text in the image is known, - * setting a hint will help get better results (although it will be a - * significant hindrance if the hint is wrong). Text detection returns an - * error if one or more of the specified languages is not one of the - * [supported languages](/vision/docs/languages). - */ - languageHints: string[]; + * A vertex represents a 2D point in the image. NOTE: the normalized vertex + * coordinates are relative to the original image and range from 0 to 1. + */ + export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * Not used. - */ - latLongRect: Schema$GoogleCloudVisionV1p1beta1LatLongRect; + * Contains metadata for the BatchAnnotateImages operation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { + /** + * The time when the batch request was received. + */ + createTime: string; + /** + * Current state of the batch operation. + */ + state: string; + /** + * The time when the operation result was last updated. + */ + updateTime: string; + } /** - * Parameters for web detection. - */ - webDetectionParams: Schema$GoogleCloudVisionV1p1beta1WebDetectionParams; -} -/** - * Stores image properties, such as dominant colors. - */ -export interface Schema$GoogleCloudVisionV1p1beta1ImageProperties { + * The desired output location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { + /** + * The max number of response protos to put into each output JSON file on + * Google Cloud Storage. The valid range is [1, 100]. If not specified, the + * default value is 20. For example, for one pdf file with 100 pages, 100 + * response protos will be generated. If `batch_size` = 20, then 5 json + * files each containing 20 response protos will be written under the prefix + * `gcs_destination`.`uri`. Currently, batch_size only applies to + * GcsDestination, with potential future support for other output + * configurations. + */ + batchSize: number; + /** + * The Google Cloud Storage location to write the output(s) to. + */ + gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; + } /** - * If present, dominant colors completed successfully. - */ - dominantColors: Schema$GoogleCloudVisionV1p1beta1DominantColorsAnnotation; -} -/** - * External image source (Google Cloud Storage or web URL image location). - */ -export interface Schema$GoogleCloudVisionV1p1beta1ImageSource { - /** - * **Use `image_uri` instead.** The Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. See - * [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - */ - gcsImageUri: string; - /** - * The URI of the source image. Can be either: 1. A Google Cloud Storage URI - * of the form `gs://bucket_name/object_name`. Object versioning is not - * supported. See [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - * HTTP/HTTPS URLs, Google cannot guarantee that the request will be - * completed. Your request may fail if the specified host denies the request - * (e.g. due to request throttling or DOS prevention), or if Google throttles - * requests to the site for abuse prevention. You should not depend on - * externally-hosted images for production applications. When both - * `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - * precedence. - */ - imageUri: string; -} -/** - * Rectangle determined by min and max `LatLng` pairs. - */ -export interface Schema$GoogleCloudVisionV1p1beta1LatLongRect { + * Detected page from OCR. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Page { + /** + * List of blocks of text, images etc on this page. + */ + blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; + /** + * Confidence of the OCR results on the page. Range [0, 1]. + */ + confidence: number; + /** + * Page height. For PDFs the unit is points. For images (including TIFFs) + * the unit is pixels. + */ + height: number; + /** + * Additional information detected on the page. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * Page width. For PDFs the unit is points. For images (including TIFFs) the + * unit is pixels. + */ + width: number; + } /** - * Max lat/long pair. - */ - maxLatLng: Schema$LatLng; + * Structural unit of text representing a number of words in certain order. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { + /** + * The bounding box for the paragraph. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the paragraph. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the paragraph. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of words in this paragraph. + */ + words: Schema$GoogleCloudVisionV1p2beta1Word[]; + } /** - * Min lat/long pair. - */ - minLatLng: Schema$LatLng; -} -/** - * Detected entity location information. - */ -export interface Schema$GoogleCloudVisionV1p1beta1LocationInfo { + * A 3D position in the image, used primarily for Face detection landmarks. A + * valid Position must have both x and y coordinates. The position coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Position { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + /** + * Z coordinate (or depth). + */ + z: number; + } /** - * lat/long location coordinates. - */ - latLng: Schema$LatLng; -} -/** - * Detected page from OCR. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Page { + * A `Property` consists of a user-supplied name/value pair. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Property { + /** + * Name of the property. + */ + name: string; + /** + * Value of numeric properties. + */ + uint64Value: string; + /** + * Value of the property. + */ + value: string; + } /** - * List of blocks of text, images etc on this page. - */ - blocks: Schema$GoogleCloudVisionV1p1beta1Block[]; + * Set of features pertaining to the image, computed by computer vision + * methods over safe-search verticals (for example, adult, spoof, medical, + * violence). + */ + export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { + /** + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. + */ + adult: string; + /** + * Likelihood that this is a medical image. + */ + medical: string; + /** + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive body + * areas. + */ + racy: string; + /** + * Spoof likelihood. The likelihood that an modification was made to the + * image's canonical version to make it appear funny or offensive. + */ + spoof: string; + /** + * Likelihood that this image contains violent content. + */ + violence: string; + } /** - * Confidence of the OCR results on the page. Range [0, 1]. - */ - confidence: number; + * A single symbol representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Symbol { + /** + * The bounding box for the symbol. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the symbol. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the symbol. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * The actual UTF-8 representation of the symbol. + */ + text: string; + } /** - * Page height. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - height: number; + * TextAnnotation contains a structured representation of OCR extracted text. + * The hierarchy of an OCR extracted text structure is like this: + * TextAnnotation -> Page -> Block -> Paragraph -> Word -> + * Symbol Each structural component, starting from Page, may further have + * their own properties. Properties describe detected languages, breaks etc.. + * Please refer to the TextAnnotation.TextProperty message definition below + * for more detail. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { + /** + * List of pages detected by OCR. + */ + pages: Schema$GoogleCloudVisionV1p2beta1Page[]; + /** + * UTF-8 text detected on the pages. + */ + text: string; + } /** - * Additional information detected on the page. - */ - property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + * Detected start or end of a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { + /** + * True if break prepends the element. + */ + isPrefix: boolean; + /** + * Detected break type. + */ + type: string; + } /** - * Page width. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - width: number; -} -/** - * Structural unit of text representing a number of words in certain order. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Paragraph { + * Detected language for a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { + /** + * Confidence of detected language. Range [0, 1]. + */ + confidence: number; + /** + * The BCP-47 language code, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * The bounding box for the paragraph. The vertices are in the order of - * top-left, top-right, bottom-right, bottom-left. When a rotation of the - * bounding box is detected the rotation is represented as around the top-left - * corner as defined when the text is read in the 'natural' - * orientation. For example: * when the text is horizontal it might look - * like: 0----1 | | 3----2 * when it's rotated 180 - * degrees around the top-left corner it becomes: 2----3 | | - * 1----0 and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; + * Additional information detected on the structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { + /** + * Detected start or end of a text segment. + */ + detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; + /** + * A list of detected languages together with confidence. + */ + detectedLanguages: + Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; + } /** - * Confidence of the OCR results for the paragraph. Range [0, 1]. - */ - confidence: number; + * A vertex represents a 2D point in the image. NOTE: the vertex coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Vertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * Additional information detected for the paragraph. - */ - property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; + * Relevant information for the image from the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { + /** + * Best guess text labels for the request image. + */ + bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; + /** + * Fully matching images from the Internet. Can include resized copies of + * the query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Web pages containing the matching images from the Internet. + */ + pagesWithMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; + /** + * Partial matching images from the Internet. Those images are similar + * enough to share some key-point features. For example an original image + * will likely have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * The visually similar image results. + */ + visuallySimilarImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Deduced entities from similar images on the Internet. + */ + webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; + } /** - * List of words in this paragraph. - */ - words: Schema$GoogleCloudVisionV1p1beta1Word[]; -} -/** - * A 3D position in the image, used primarily for Face detection landmarks. A - * valid Position must have both x and y coordinates. The position coordinates - * are in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Position { + * Entity deduced from similar images on the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { + /** + * Canonical description of the entity, in English. + */ + description: string; + /** + * Opaque entity ID. + */ + entityId: string; + /** + * Overall relevancy score for the entity. Not normalized and not comparable + * across different image queries. + */ + score: number; + } /** - * X coordinate. - */ - x: number; + * Metadata for online images. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { + /** + * (Deprecated) Overall relevancy score for the image. + */ + score: number; + /** + * The result image URL. + */ + url: string; + } /** - * Y coordinate. - */ - y: number; + * Label to provide extra metadata for the web detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { + /** + * Label for extra metadata. + */ + label: string; + /** + * The BCP-47 language code for `label`, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * Z coordinate (or depth). - */ - z: number; -} -/** - * A `Property` consists of a user-supplied name/value pair. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Property { + * Metadata for web pages. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { + /** + * Fully matching images on the page. Can include resized copies of the + * query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Title for the web page, may contain HTML markups. + */ + pageTitle: string; + /** + * Partial matching images on the page. Those images are similar enough to + * share some key-point features. For example an original image will likely + * have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * (Deprecated) Overall relevancy score for the web page. + */ + score: number; + /** + * The result web page URL. + */ + url: string; + } /** - * Name of the property. - */ - name: string; + * A word representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Word { + /** + * The bounding box for the word. The vertices are in the order of top-left, + * top-right, bottom-right, bottom-left. When a rotation of the bounding box + * is detected the rotation is represented as around the top-left corner as + * defined when the text is read in the 'natural' orientation. For + * example: * when the text is horizontal it might look like: 0----1 + * | | 3----2 * when it's rotated 180 degrees around the + * top-left corner it becomes: 2----3 | | 1----0 and the + * vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the word. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the word. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of symbols in the word. The order of the symbols follows the natural + * reading order. + */ + symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; + } /** - * Value of numeric properties. - */ - uint64Value: string; + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * Value of the property. - */ - value: string; -} -/** - * Set of features pertaining to the image, computed by computer vision methods - * over safe-search verticals (for example, adult, spoof, medical, violence). - */ -export interface Schema$GoogleCloudVisionV1p1beta1SafeSearchAnnotation { - /** - * Represents the adult content likelihood for the image. Adult content may - * contain elements such as nudity, pornographic images or cartoons, or sexual - * activities. - */ - adult: string; - /** - * Likelihood that this is a medical image. - */ - medical: string; - /** - * Likelihood that the request image contains racy content. Racy content may - * include (but is not limited to) skimpy or sheer clothing, strategically - * covered nudity, lewd or provocative poses, or close-ups of sensitive body - * areas. - */ - racy: string; - /** - * Spoof likelihood. The likelihood that an modification was made to the - * image's canonical version to make it appear funny or offensive. - */ - spoof: string; - /** - * Likelihood that this image contains violent content. - */ - violence: string; -} -/** - * A single symbol representation. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Symbol { - /** - * The bounding box for the symbol. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; - /** - * Confidence of the OCR results for the symbol. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the symbol. - */ - property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; - /** - * The actual UTF-8 representation of the symbol. - */ - text: string; -} -/** - * TextAnnotation contains a structured representation of OCR extracted text. - * The hierarchy of an OCR extracted text structure is like this: TextAnnotation - * -> Page -> Block -> Paragraph -> Word -> Symbol Each - * structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please refer - * to the TextAnnotation.TextProperty message definition below for more detail. - */ -export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotation { - /** - * List of pages detected by OCR. - */ - pages: Schema$GoogleCloudVisionV1p1beta1Page[]; - /** - * UTF-8 text detected on the pages. - */ - text: string; -} -/** - * Detected start or end of a structural component. - */ -export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak { - /** - * True if break prepends the element. - */ - isPrefix: boolean; - /** - * Detected break type. - */ - type: string; -} -/** - * Detected language for a structural component. - */ -export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage { - /** - * Confidence of detected language. Range [0, 1]. - */ - confidence: number; - /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Additional information detected on the structural component. - */ -export interface Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty { - /** - * Detected start or end of a text segment. - */ - detectedBreak: Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak; - /** - * A list of detected languages together with confidence. - */ - detectedLanguages: - Schema$GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage[]; -} -/** - * A vertex represents a 2D point in the image. NOTE: the vertex coordinates are - * in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Vertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Relevant information for the image from the Internet. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetection { - /** - * Best guess text labels for the request image. - */ - bestGuessLabels: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebLabel[]; - /** - * Fully matching images from the Internet. Can include resized copies of the - * query image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; - /** - * Web pages containing the matching images from the Internet. - */ - pagesWithMatchingImages: - Schema$GoogleCloudVisionV1p1beta1WebDetectionWebPage[]; - /** - * Partial matching images from the Internet. Those images are similar enough - * to share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; - /** - * The visually similar image results. - */ - visuallySimilarImages: - Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; - /** - * Deduced entities from similar images on the Internet. - */ - webEntities: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebEntity[]; -} -/** - * Parameters for web detection request. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionParams { - /** - * Whether to include results derived from the geo information in the image. - */ - includeGeoResults: boolean; -} -/** - * Entity deduced from similar images on the Internet. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebEntity { - /** - * Canonical description of the entity, in English. - */ - description: string; - /** - * Opaque entity ID. - */ - entityId: string; - /** - * Overall relevancy score for the entity. Not normalized and not comparable - * across different image queries. - */ - score: number; -} -/** - * Metadata for online images. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage { - /** - * (Deprecated) Overall relevancy score for the image. - */ - score: number; - /** - * The result image URL. - */ - url: string; -} -/** - * Label to provide extra metadata for the web detection. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebLabel { - /** - * Label for extra metadata. - */ - label: string; - /** - * The BCP-47 language code for `label`, such as "en-US" or - * "sr-Latn". For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Metadata for web pages. - */ -export interface Schema$GoogleCloudVisionV1p1beta1WebDetectionWebPage { - /** - * Fully matching images on the page. Can include resized copies of the query - * image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; - /** - * Title for the web page, may contain HTML markups. - */ - pageTitle: string; - /** - * Partial matching images on the page. Those images are similar enough to - * share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p1beta1WebDetectionWebImage[]; - /** - * (Deprecated) Overall relevancy score for the web page. - */ - score: number; - /** - * The result web page URL. - */ - url: string; -} -/** - * A word representation. - */ -export interface Schema$GoogleCloudVisionV1p1beta1Word { - /** - * The bounding box for the word. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p1beta1BoundingPoly; - /** - * Confidence of the OCR results for the word. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the word. - */ - property: Schema$GoogleCloudVisionV1p1beta1TextAnnotationTextProperty; - /** - * List of symbols in the word. The order of the symbols follows the natural - * reading order. - */ - symbols: Schema$GoogleCloudVisionV1p1beta1Symbol[]; -} -/** - * Response to a single file annotation request. A file may contain one or more - * images, which individually have their own responses. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { - /** - * Information about the file for which this response is generated. - */ - inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; - /** - * Individual responses to images found within the file. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; -} -/** - * Response to an image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { - /** - * If present, contextual information is needed to understand where this image - * comes from. - */ - context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; - /** - * If present, crop hints have completed successfully. - */ - cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; - /** - * If set, represents the error message for the operation. Note that filled-in - * image annotations are guaranteed to be correct, even when `error` is set. - */ - error: Schema$Status; - /** - * If present, face detection has completed successfully. - */ - faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; - /** - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. This annotation provides the structural hierarchy - * for the OCR detected text. - */ - fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; - /** - * If present, image properties were extracted successfully. - */ - imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; - /** - * If present, label detection has completed successfully. - */ - labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, landmark detection has completed successfully. - */ - landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, logo detection has completed successfully. - */ - logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, safe-search annotation has completed successfully. - */ - safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; - /** - * If present, text (OCR) detection has completed successfully. - */ - textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, web detection has completed successfully. - */ - webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; -} -/** - * The response for a single offline file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { - /** - * The output location and metadata from AsyncAnnotateFileRequest. - */ - outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; -} -/** - * Response to an async batch file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { - /** - * The list of file annotation responses, one for each request in - * AsyncBatchAnnotateFilesRequest. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; -} -/** - * Logical element on the page. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Block { - /** - * Detected block type (text, image etc) for this block. - */ - blockType: string; - /** - * The bounding box for the block. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 - * | | 3----2 * when it's rotated 180 degrees around the - * top-left corner it becomes: 2----3 | | 1----0 - * and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results on the block. Range [0, 1]. - */ - confidence: number; - /** - * List of paragraphs in this block (if this blocks is of type text). - */ - paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; - /** - * Additional information detected for the block. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; -} -/** - * A bounding polygon for the detected image annotation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { - /** - * The bounding polygon normalized vertices. - */ - normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; - /** - * The bounding polygon vertices. - */ - vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; -} -/** - * Color information consists of RGB channels, score, and the fraction of the - * image that the color occupies in the image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { - /** - * RGB components of the color. - */ - color: Schema$Color; - /** - * The fraction of pixels the color occupies in the image. Value in range [0, - * 1]. - */ - pixelFraction: number; - /** - * Image-specific score for this color. Value in range [0, 1]. - */ - score: number; -} -/** - * Single crop hint that is used to generate a new crop when serving an image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHint { - /** - * The bounding polygon for the crop region. The coordinates of the bounding - * box are in the original image's scale, as returned in `ImageParams`. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of this being a salient region. Range [0, 1]. - */ - confidence: number; - /** - * Fraction of importance of this salient region with respect to the original - * image. - */ - importanceFraction: number; -} -/** - * Set of crop hints that are used to generate new crops when serving images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { - /** - * Crop hint results. - */ - cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; -} -/** - * Set of dominant colors and their corresponding scores. - */ -export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { - /** - * RGB color values with their score and pixel fraction. - */ - colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; -} -/** - * Set of detected entity features. - */ -export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { - /** - * Image region to which this entity belongs. Not produced for - * `LABEL_DETECTION` features. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * **Deprecated. Use `score` instead.** The accuracy of the entity detection - * in an image. For example, for an image in which the "Eiffel - * Tower" entity is detected, this field represents the confidence that - * there is a tower in the query image. Range [0, 1]. - */ - confidence: number; - /** - * Entity textual description, expressed in its `locale` language. - */ - description: string; - /** - * The language code for the locale in which the entity textual `description` - * is expressed. - */ - locale: string; - /** - * The location information for the detected entity. Multiple `LocationInfo` - * elements can be present because one location may indicate the location of - * the scene in the image, and another location may indicate the location of - * the place where the image was taken. Location information is usually - * present for landmarks. - */ - locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - mid: string; - /** - * Some entities may have optional user-supplied `Property` (name/value) - * fields, such a score or string that qualifies the entity. - */ - properties: Schema$GoogleCloudVisionV1p2beta1Property[]; - /** - * Overall score of the result. Range [0, 1]. - */ - score: number; - /** - * The relevancy of the ICA (Image Content Annotation) label to the image. For - * example, the relevancy of "tower" is likely higher to an image - * containing the detected "Eiffel Tower" than to an image - * containing a detected distant towering building, even though the confidence - * that there is a tower in each image may be the same. Range [0, 1]. - */ - topicality: number; -} -/** - * A face annotation object contains the results of face detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { - /** - * Anger likelihood. - */ - angerLikelihood: string; - /** - * Blurred likelihood. - */ - blurredLikelihood: string; - /** - * The bounding polygon around the face. The coordinates of the bounding box - * are in the original image's scale, as returned in `ImageParams`. The - * bounding box is computed to "frame" the face in accordance with - * human expectations. It is based on the landmarker results. Note that one or - * more x and/or y coordinates may not be generated in the `BoundingPoly` (the - * polygon will be unbounded) if only a partial face appears in the image to - * be annotated. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Detection confidence. Range [0, 1]. - */ - detectionConfidence: number; - /** - * The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, - * and encloses only the skin part of the face. Typically, it is used to - * eliminate the face from any image analysis that detects the "amount of - * skin" visible in an image. It is not based on the landmarker results, - * only on the initial face detection, hence the <code>fd</code> - * (face detection) prefix. - */ - fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Headwear likelihood. - */ - headwearLikelihood: string; - /** - * Joy likelihood. - */ - joyLikelihood: string; - /** - * Face landmarking confidence. Range [0, 1]. - */ - landmarkingConfidence: number; - /** - * Detected face landmarks. - */ - landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; - /** - * Yaw angle, which indicates the leftward/rightward angle that the face is - * pointing relative to the vertical plane perpendicular to the image. Range - * [-180,180]. - */ - panAngle: number; - /** - * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - * of the face relative to the image vertical about the axis perpendicular to - * the face. Range [-180,180]. - */ - rollAngle: number; - /** - * Sorrow likelihood. - */ - sorrowLikelihood: string; - /** - * Surprise likelihood. - */ - surpriseLikelihood: string; - /** - * Pitch angle, which indicates the upwards/downwards angle that the face is - * pointing relative to the image's horizontal plane. Range [-180,180]. - */ - tiltAngle: number; - /** - * Under-exposed likelihood. - */ - underExposedLikelihood: string; -} -/** - * A face-specific landmark (for example, a face feature). - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { - /** - * Face landmark position. - */ - position: Schema$GoogleCloudVisionV1p2beta1Position; - /** - * Face landmark type. - */ - type: string; -} -/** - * The Google Cloud Storage location where the output will be written to. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { - /** - * Google Cloud Storage URI where the results will be stored. Results will be - * in JSON format and preceded by its corresponding input URI. This field can - * either represent a single file, or a prefix for multiple outputs. Prefixes - * must end in a `/`. Examples: * File: gs://bucket-name/filename.json * - * Prefix: gs://bucket-name/prefix/here/ * File: - * gs://bucket-name/prefix/here If multiple outputs, each response is still - * AnnotateFileResponse, each of which contains some subset of the full list - * of AnnotateImageResponse. Multiple outputs can happen if, for example, the - * output JSON is too large and overflows into multiple sharded files. - */ - uri: string; -} -/** - * The Google Cloud Storage location where the input will be read from. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { - /** - * Google Cloud Storage URI for the input file. This must only be a Google - * Cloud Storage object. Wildcards are not currently supported. - */ - uri: string; -} -/** - * If an image was produced from a file (e.g. a PDF), this message gives - * information about the source of that image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { - /** - * If the file was a PDF or TIFF, this field gives the page number within the - * file used to produce the image. - */ - pageNumber: number; - /** - * The URI of the file used to produce the image. - */ - uri: string; -} -/** - * Stores image properties, such as dominant colors. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { - /** - * If present, dominant colors completed successfully. - */ - dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; -} -/** - * The desired input location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { - /** - * The Google Cloud Storage location to read the input from. - */ - gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; - /** - * The type of the file. Currently only "application/pdf" and - * "image/tiff" are supported. Wildcards are not supported. - */ - mimeType: string; -} -/** - * Detected entity location information. - */ -export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { - /** - * lat/long location coordinates. - */ - latLng: Schema$LatLng; -} -/** - * A vertex represents a 2D point in the image. NOTE: the normalized vertex - * coordinates are relative to the original image and range from 0 to 1. - */ -export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Contains metadata for the BatchAnnotateImages operation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { - /** - * The time when the batch request was received. - */ - createTime: string; - /** - * Current state of the batch operation. - */ - state: string; - /** - * The time when the operation result was last updated. - */ - updateTime: string; -} -/** - * The desired output location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { - /** - * The max number of response protos to put into each output JSON file on - * Google Cloud Storage. The valid range is [1, 100]. If not specified, the - * default value is 20. For example, for one pdf file with 100 pages, 100 - * response protos will be generated. If `batch_size` = 20, then 5 json files - * each containing 20 response protos will be written under the prefix - * `gcs_destination`.`uri`. Currently, batch_size only applies to - * GcsDestination, with potential future support for other output - * configurations. - */ - batchSize: number; - /** - * The Google Cloud Storage location to write the output(s) to. - */ - gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; -} -/** - * Detected page from OCR. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Page { - /** - * List of blocks of text, images etc on this page. - */ - blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; - /** - * Confidence of the OCR results on the page. Range [0, 1]. - */ - confidence: number; - /** - * Page height. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - height: number; - /** - * Additional information detected on the page. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * Page width. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - width: number; -} -/** - * Structural unit of text representing a number of words in certain order. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { - /** - * The bounding box for the paragraph. The vertices are in the order of - * top-left, top-right, bottom-right, bottom-left. When a rotation of the - * bounding box is detected the rotation is represented as around the top-left - * corner as defined when the text is read in the 'natural' - * orientation. For example: * when the text is horizontal it might look - * like: 0----1 | | 3----2 * when it's rotated 180 - * degrees around the top-left corner it becomes: 2----3 | | - * 1----0 and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the paragraph. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the paragraph. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * List of words in this paragraph. - */ - words: Schema$GoogleCloudVisionV1p2beta1Word[]; -} -/** - * A 3D position in the image, used primarily for Face detection landmarks. A - * valid Position must have both x and y coordinates. The position coordinates - * are in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Position { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; - /** - * Z coordinate (or depth). - */ - z: number; -} -/** - * A `Property` consists of a user-supplied name/value pair. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Property { - /** - * Name of the property. - */ - name: string; - /** - * Value of numeric properties. - */ - uint64Value: string; - /** - * Value of the property. - */ - value: string; -} -/** - * Set of features pertaining to the image, computed by computer vision methods - * over safe-search verticals (for example, adult, spoof, medical, violence). - */ -export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { - /** - * Represents the adult content likelihood for the image. Adult content may - * contain elements such as nudity, pornographic images or cartoons, or sexual - * activities. - */ - adult: string; - /** - * Likelihood that this is a medical image. - */ - medical: string; - /** - * Likelihood that the request image contains racy content. Racy content may - * include (but is not limited to) skimpy or sheer clothing, strategically - * covered nudity, lewd or provocative poses, or close-ups of sensitive body - * areas. - */ - racy: string; - /** - * Spoof likelihood. The likelihood that an modification was made to the - * image's canonical version to make it appear funny or offensive. - */ - spoof: string; - /** - * Likelihood that this image contains violent content. - */ - violence: string; -} -/** - * A single symbol representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Symbol { - /** - * The bounding box for the symbol. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the symbol. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the symbol. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * The actual UTF-8 representation of the symbol. - */ - text: string; -} -/** - * TextAnnotation contains a structured representation of OCR extracted text. - * The hierarchy of an OCR extracted text structure is like this: TextAnnotation - * -> Page -> Block -> Paragraph -> Word -> Symbol Each - * structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please refer - * to the TextAnnotation.TextProperty message definition below for more detail. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { - /** - * List of pages detected by OCR. - */ - pages: Schema$GoogleCloudVisionV1p2beta1Page[]; - /** - * UTF-8 text detected on the pages. - */ - text: string; -} -/** - * Detected start or end of a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { - /** - * True if break prepends the element. - */ - isPrefix: boolean; - /** - * Detected break type. - */ - type: string; -} -/** - * Detected language for a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { - /** - * Confidence of detected language. Range [0, 1]. - */ - confidence: number; - /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Additional information detected on the structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { - /** - * Detected start or end of a text segment. - */ - detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; - /** - * A list of detected languages together with confidence. - */ - detectedLanguages: - Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; -} -/** - * A vertex represents a 2D point in the image. NOTE: the vertex coordinates are - * in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Vertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Relevant information for the image from the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { - /** - * Best guess text labels for the request image. - */ - bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; - /** - * Fully matching images from the Internet. Can include resized copies of the - * query image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Web pages containing the matching images from the Internet. - */ - pagesWithMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; - /** - * Partial matching images from the Internet. Those images are similar enough - * to share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * The visually similar image results. - */ - visuallySimilarImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Deduced entities from similar images on the Internet. - */ - webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; -} -/** - * Entity deduced from similar images on the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { - /** - * Canonical description of the entity, in English. - */ - description: string; - /** - * Opaque entity ID. - */ - entityId: string; - /** - * Overall relevancy score for the entity. Not normalized and not comparable - * across different image queries. - */ - score: number; -} -/** - * Metadata for online images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { - /** - * (Deprecated) Overall relevancy score for the image. - */ - score: number; - /** - * The result image URL. - */ - url: string; -} -/** - * Label to provide extra metadata for the web detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { - /** - * Label for extra metadata. - */ - label: string; - /** - * The BCP-47 language code for `label`, such as "en-US" or - * "sr-Latn". For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Metadata for web pages. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { - /** - * Fully matching images on the page. Can include resized copies of the query - * image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * Title for the web page, may contain HTML markups. - */ - pageTitle: string; - /** - * Partial matching images on the page. Those images are similar enough to - * share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; - /** - * (Deprecated) Overall relevancy score for the web page. - */ - score: number; - /** - * The result web page URL. - */ - url: string; -} -/** - * A word representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Word { - /** - * The bounding box for the word. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the word. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the word. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * List of symbols in the word. The order of the symbols follows the natural - * reading order. - */ - symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { - /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; - /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { - /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; - /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; - /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Images { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - getRoot() { - return this.root; - } - - - /** - * vision.images.annotate - * @desc Run image detection and annotation for a batch of images. - * @alias vision.images.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>; - annotate( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): void; - annotate( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): - void|AxiosPromise< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Images { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1p1beta1/images:annotate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>( - parameters); + + + /** + * vision.images.annotate + * @desc Run image detection and annotation for a batch of images. + * @alias vision.images.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVisionV1p1beta1BatchAnnotateImagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>; + annotate( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): + void; + annotate( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>): + void|AxiosPromise< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1p1beta1/images:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudVisionV1p1beta1BatchAnnotateImagesResponse>( + parameters); + } } } } diff --git a/src/apis/vision/v1p2beta1.ts b/src/apis/vision/v1p2beta1.ts index 3879a4496c2..28bf695d844 100644 --- a/src/apis/vision/v1p2beta1.ts +++ b/src/apis/vision/v1p2beta1.ts @@ -27,1401 +27,1415 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Cloud Vision API - * - * Integrates Google Vision features, including image labeling, face, logo, and - * landmark detection, optical character recognition (OCR), and detection of - * explicit content, into applications. - * - * @example - * const google = require('googleapis'); - * const vision = google.vision('v1p2beta1'); - * - * @namespace vision - * @type {Function} - * @version v1p2beta1 - * @variation v1p2beta1 - * @param {object=} options Options for Vision - */ -export class Vision { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - files: Resource$Files; - images: Resource$Images; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.files = new Resource$Files(this); - this.images = new Resource$Images(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Represents a color in the RGBA color space. This representation is designed - * for simplicity of conversion to/from color representations in various - * languages over compactness; for example, the fields of this representation - * can be trivially provided to the constructor of "java.awt.Color" in - * Java; it can also be trivially provided to UIColor's - * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a - * little work, it can be easily formatted into a CSS "rgba()" string - * in JavaScript, as well. Here are some examples: Example (Java): import - * com.google.type.Color; // ... public static java.awt.Color - * fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? - * protocolor.getAlpha().getValue() : 1.0; return new - * java.awt.Color( protocolor.getRed(), protocolor.getGreen(), - * protocolor.getBlue(), alpha); } public static Color - * toProto(java.awt.Color color) { float red = (float) color.getRed(); - * float green = (float) color.getGreen(); float blue = (float) - * color.getBlue(); float denominator = 255.0; Color.Builder - * resultBuilder = Color .newBuilder() .setRed(red / - * denominator) .setGreen(green / denominator) .setBlue(blue / - * denominator); int alpha = color.getAlpha(); if (alpha != 255) { - * result.setAlpha( FloatValue .newBuilder() - * .setValue(((float) alpha) / denominator) .build()); } - * return resultBuilder.build(); } // ... Example (iOS / Obj-C): // - * ... static UIColor* fromProto(Color* protocolor) { float red = - * [protocolor red]; float green = [protocolor green]; float - * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor - * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha - * = [alpha_wrapper value]; } return [UIColor colorWithRed:red - * green:green blue:blue alpha:alpha]; } static Color* - * toProto(UIColor* color) { CGFloat red, green, blue, alpha; if - * (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - * return nil; } Color* result = [Color alloc] init]; [result - * setRed:red]; [result setGreen:green]; [result - * setBlue:blue]; if (alpha <= 0.9999) { [result - * setAlpha:floatWrapperWithValue(alpha)]; } [result - * autorelease]; return result; } // ... Example - * (JavaScript): // ... var protoToCssColor = function(rgb_color) { - * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || - * 0.0; var blueFrac = rgb_color.blue || 0.0; var red = - * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); - * var blue = Math.floor(blueFrac * 255); if (!('alpha' in - * rgb_color)) { return rgbToCssColor_(red, green, blue); } var - * alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, - * blue].join(','); return ['rgba(', rgbParams, - * ',', alphaFrac, ')'].join(''); }; var - * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new - * Number((red << 16) | (green << 8) | blue); var hexString = - * rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var - * resultBuilder = ['#']; for (var i = 0; i < missingZeros; - * i++) { resultBuilder.push('0'); } - * resultBuilder.push(hexString); return resultBuilder.join(''); - * }; // ... - */ -export interface Schema$Color { - /** - * The fraction of this color that should be applied to the pixel. That is, - * the final pixel color is defined by the equation: pixel color = alpha * - * (this color) + (1.0 - alpha) * (background color) This means that a value - * of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to - * a completely transparent color. This uses a wrapper message rather than a - * simple float scalar so that it is possible to distinguish between a default - * value and the value being unset. If omitted, this color object is to be - * rendered as a solid color (as if the alpha value had been explicitly given - * with a value of 1.0). - */ - alpha: number; - /** - * The amount of blue in the color as a value in the interval [0, 1]. - */ - blue: number; - /** - * The amount of green in the color as a value in the interval [0, 1]. - */ - green: number; - /** - * The amount of red in the color as a value in the interval [0, 1]. - */ - red: number; -} -/** - * Response to a single file annotation request. A file may contain one or more - * images, which individually have their own responses. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { - /** - * Information about the file for which this response is generated. - */ - inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; - /** - * Individual responses to images found within the file. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; -} -/** - * Request for performing Google Cloud Vision API tasks over a user-provided - * image, with user-requested features. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageRequest { - /** - * Requested features. - */ - features: Schema$GoogleCloudVisionV1p2beta1Feature[]; - /** - * The image to be processed. - */ - image: Schema$GoogleCloudVisionV1p2beta1Image; - /** - * Additional context that may accompany the image. - */ - imageContext: Schema$GoogleCloudVisionV1p2beta1ImageContext; -} -/** - * Response to an image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { - /** - * If present, contextual information is needed to understand where this image - * comes from. - */ - context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; - /** - * If present, crop hints have completed successfully. - */ - cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; - /** - * If set, represents the error message for the operation. Note that filled-in - * image annotations are guaranteed to be correct, even when `error` is set. - */ - error: Schema$Status; - /** - * If present, face detection has completed successfully. - */ - faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; - /** - * If present, text (OCR) detection or document (OCR) text detection has - * completed successfully. This annotation provides the structural hierarchy - * for the OCR detected text. - */ - fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; - /** - * If present, image properties were extracted successfully. - */ - imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; - /** - * If present, label detection has completed successfully. - */ - labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, landmark detection has completed successfully. - */ - landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, logo detection has completed successfully. - */ - logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, safe-search annotation has completed successfully. - */ - safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; - /** - * If present, text (OCR) detection has completed successfully. - */ - textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; - /** - * If present, web detection has completed successfully. - */ - webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; -} -/** - * An offline file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest { - /** - * Required. Requested features. - */ - features: Schema$GoogleCloudVisionV1p2beta1Feature[]; - /** - * Additional context that may accompany the image(s) in the file. - */ - imageContext: Schema$GoogleCloudVisionV1p2beta1ImageContext; - /** - * Required. Information about the input file. - */ - inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; - /** - * Required. The desired output location and metadata (e.g. format). - */ - outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; -} -/** - * The response for a single offline file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { - /** - * The output location and metadata from AsyncAnnotateFileRequest. - */ - outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; -} -/** - * Multiple async file annotation requests are batched into a single service - * call. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest { - /** - * Individual async file annotation requests for this batch. - */ - requests: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest[]; -} -/** - * Response to an async batch file annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { - /** - * The list of file annotation responses, one for each request in - * AsyncBatchAnnotateFilesRequest. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; -} -/** - * Multiple image annotation requests are batched into a single service call. - */ -export interface Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest { - /** - * Individual image annotation requests for this batch. - */ - requests: Schema$GoogleCloudVisionV1p2beta1AnnotateImageRequest[]; -} -/** - * Response to a batch image annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse { - /** - * Individual responses to image annotation requests within the batch. - */ - responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; -} -/** - * Logical element on the page. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Block { - /** - * Detected block type (text, image etc) for this block. - */ - blockType: string; - /** - * The bounding box for the block. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 - * | | 3----2 * when it's rotated 180 degrees around the - * top-left corner it becomes: 2----3 | | 1----0 - * and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results on the block. Range [0, 1]. - */ - confidence: number; - /** - * List of paragraphs in this block (if this blocks is of type text). - */ - paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; - /** - * Additional information detected for the block. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; -} -/** - * A bounding polygon for the detected image annotation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { - /** - * The bounding polygon normalized vertices. - */ - normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; - /** - * The bounding polygon vertices. - */ - vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; -} -/** - * Color information consists of RGB channels, score, and the fraction of the - * image that the color occupies in the image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { - /** - * RGB components of the color. - */ - color: Schema$Color; - /** - * The fraction of pixels the color occupies in the image. Value in range [0, - * 1]. - */ - pixelFraction: number; - /** - * Image-specific score for this color. Value in range [0, 1]. - */ - score: number; -} -/** - * Single crop hint that is used to generate a new crop when serving an image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHint { - /** - * The bounding polygon for the crop region. The coordinates of the bounding - * box are in the original image's scale, as returned in `ImageParams`. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of this being a salient region. Range [0, 1]. - */ - confidence: number; - /** - * Fraction of importance of this salient region with respect to the original - * image. - */ - importanceFraction: number; -} -/** - * Set of crop hints that are used to generate new crops when serving images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { - /** - * Crop hint results. - */ - cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; -} -/** - * Parameters for crop hints annotation request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1CropHintsParams { - /** - * Aspect ratios in floats, representing the ratio of the width to the height - * of the image. For example, if the desired aspect ratio is 4/3, the - * corresponding float value should be 1.33333. If not specified, the best - * possible crop is returned. The number of provided aspect ratios is limited - * to a maximum of 16; any aspect ratios provided after the 16th are ignored. - */ - aspectRatios: number[]; -} -/** - * Set of dominant colors and their corresponding scores. - */ -export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { - /** - * RGB color values with their score and pixel fraction. - */ - colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; -} -/** - * Set of detected entity features. - */ -export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { - /** - * Image region to which this entity belongs. Not produced for - * `LABEL_DETECTION` features. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * **Deprecated. Use `score` instead.** The accuracy of the entity detection - * in an image. For example, for an image in which the "Eiffel - * Tower" entity is detected, this field represents the confidence that - * there is a tower in the query image. Range [0, 1]. - */ - confidence: number; - /** - * Entity textual description, expressed in its `locale` language. - */ - description: string; - /** - * The language code for the locale in which the entity textual `description` - * is expressed. - */ - locale: string; - /** - * The location information for the detected entity. Multiple `LocationInfo` - * elements can be present because one location may indicate the location of - * the scene in the image, and another location may indicate the location of - * the place where the image was taken. Location information is usually - * present for landmarks. - */ - locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; - /** - * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph - * Search API](https://developers.google.com/knowledge-graph/). - */ - mid: string; - /** - * Some entities may have optional user-supplied `Property` (name/value) - * fields, such a score or string that qualifies the entity. - */ - properties: Schema$GoogleCloudVisionV1p2beta1Property[]; - /** - * Overall score of the result. Range [0, 1]. - */ - score: number; - /** - * The relevancy of the ICA (Image Content Annotation) label to the image. For - * example, the relevancy of "tower" is likely higher to an image - * containing the detected "Eiffel Tower" than to an image - * containing a detected distant towering building, even though the confidence - * that there is a tower in each image may be the same. Range [0, 1]. - */ - topicality: number; -} -/** - * A face annotation object contains the results of face detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { - /** - * Anger likelihood. - */ - angerLikelihood: string; - /** - * Blurred likelihood. - */ - blurredLikelihood: string; - /** - * The bounding polygon around the face. The coordinates of the bounding box - * are in the original image's scale, as returned in `ImageParams`. The - * bounding box is computed to "frame" the face in accordance with - * human expectations. It is based on the landmarker results. Note that one or - * more x and/or y coordinates may not be generated in the `BoundingPoly` (the - * polygon will be unbounded) if only a partial face appears in the image to - * be annotated. - */ - boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Detection confidence. Range [0, 1]. - */ - detectionConfidence: number; - /** - * The `fd_bounding_poly` bounding polygon is tighter than the `boundingPoly`, - * and encloses only the skin part of the face. Typically, it is used to - * eliminate the face from any image analysis that detects the "amount of - * skin" visible in an image. It is not based on the landmarker results, - * only on the initial face detection, hence the <code>fd</code> - * (face detection) prefix. - */ - fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Headwear likelihood. - */ - headwearLikelihood: string; - /** - * Joy likelihood. - */ - joyLikelihood: string; - /** - * Face landmarking confidence. Range [0, 1]. - */ - landmarkingConfidence: number; - /** - * Detected face landmarks. - */ - landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; - /** - * Yaw angle, which indicates the leftward/rightward angle that the face is - * pointing relative to the vertical plane perpendicular to the image. Range - * [-180,180]. - */ - panAngle: number; - /** - * Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - * of the face relative to the image vertical about the axis perpendicular to - * the face. Range [-180,180]. - */ - rollAngle: number; - /** - * Sorrow likelihood. - */ - sorrowLikelihood: string; - /** - * Surprise likelihood. - */ - surpriseLikelihood: string; - /** - * Pitch angle, which indicates the upwards/downwards angle that the face is - * pointing relative to the image's horizontal plane. Range [-180,180]. - */ - tiltAngle: number; - /** - * Under-exposed likelihood. - */ - underExposedLikelihood: string; -} -/** - * A face-specific landmark (for example, a face feature). - */ -export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { - /** - * Face landmark position. - */ - position: Schema$GoogleCloudVisionV1p2beta1Position; - /** - * Face landmark type. - */ - type: string; -} -/** - * The type of Google Cloud Vision API detection to perform, and the maximum - * number of results to return for that type. Multiple `Feature` objects can be - * specified in the `features` list. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Feature { - /** - * Maximum number of results of this type. Does not apply to `TEXT_DETECTION`, - * `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - */ - maxResults: number; - /** - * Model to use for the feature. Supported values: "builtin/stable" - * (the default if unset) and "builtin/latest". - */ - model: string; - /** - * The feature type. - */ - type: string; -} -/** - * The Google Cloud Storage location where the output will be written to. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { - /** - * Google Cloud Storage URI where the results will be stored. Results will be - * in JSON format and preceded by its corresponding input URI. This field can - * either represent a single file, or a prefix for multiple outputs. Prefixes - * must end in a `/`. Examples: * File: gs://bucket-name/filename.json * - * Prefix: gs://bucket-name/prefix/here/ * File: - * gs://bucket-name/prefix/here If multiple outputs, each response is still - * AnnotateFileResponse, each of which contains some subset of the full list - * of AnnotateImageResponse. Multiple outputs can happen if, for example, the - * output JSON is too large and overflows into multiple sharded files. - */ - uri: string; -} -/** - * The Google Cloud Storage location where the input will be read from. - */ -export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { - /** - * Google Cloud Storage URI for the input file. This must only be a Google - * Cloud Storage object. Wildcards are not currently supported. - */ - uri: string; -} -/** - * Client image to perform Google Cloud Vision API tasks over. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Image { - /** - * Image content, represented as a stream of bytes. Note: As with all `bytes` - * fields, protobuffers use a pure binary representation, whereas JSON - * representations use base64. - */ - content: string; - /** - * Google Cloud Storage image location, or publicly-accessible image URL. If - * both `content` and `source` are provided for an image, `content` takes - * precedence and is used to perform the image annotation request. - */ - source: Schema$GoogleCloudVisionV1p2beta1ImageSource; -} -/** - * If an image was produced from a file (e.g. a PDF), this message gives - * information about the source of that image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { - /** - * If the file was a PDF or TIFF, this field gives the page number within the - * file used to produce the image. - */ - pageNumber: number; - /** - * The URI of the file used to produce the image. - */ - uri: string; -} -/** - * Image context and/or feature-specific parameters. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageContext { - /** - * Parameters for crop hints annotation request. - */ - cropHintsParams: Schema$GoogleCloudVisionV1p2beta1CropHintsParams; - /** - * List of languages to use for TEXT_DETECTION. In most cases, an empty value - * yields the best results since it enables automatic language detection. For - * languages based on the Latin alphabet, setting `language_hints` is not - * needed. In rare cases, when the language of the text in the image is known, - * setting a hint will help get better results (although it will be a - * significant hindrance if the hint is wrong). Text detection returns an - * error if one or more of the specified languages is not one of the - * [supported languages](/vision/docs/languages). - */ - languageHints: string[]; - /** - * Not used. - */ - latLongRect: Schema$GoogleCloudVisionV1p2beta1LatLongRect; - /** - * Parameters for web detection. - */ - webDetectionParams: Schema$GoogleCloudVisionV1p2beta1WebDetectionParams; -} -/** - * Stores image properties, such as dominant colors. - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { - /** - * If present, dominant colors completed successfully. - */ - dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; -} -/** - * External image source (Google Cloud Storage or web URL image location). - */ -export interface Schema$GoogleCloudVisionV1p2beta1ImageSource { - /** - * **Use `image_uri` instead.** The Google Cloud Storage URI of the form - * `gs://bucket_name/object_name`. Object versioning is not supported. See - * [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - */ - gcsImageUri: string; - /** - * The URI of the source image. Can be either: 1. A Google Cloud Storage URI - * of the form `gs://bucket_name/object_name`. Object versioning is not - * supported. See [Google Cloud Storage Request - * URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - * 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - * HTTP/HTTPS URLs, Google cannot guarantee that the request will be - * completed. Your request may fail if the specified host denies the request - * (e.g. due to request throttling or DOS prevention), or if Google throttles - * requests to the site for abuse prevention. You should not depend on - * externally-hosted images for production applications. When both - * `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - * precedence. - */ - imageUri: string; -} -/** - * The desired input location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { - /** - * The Google Cloud Storage location to read the input from. - */ - gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; - /** - * The type of the file. Currently only "application/pdf" and - * "image/tiff" are supported. Wildcards are not supported. - */ - mimeType: string; -} -/** - * Rectangle determined by min and max `LatLng` pairs. - */ -export interface Schema$GoogleCloudVisionV1p2beta1LatLongRect { - /** - * Max lat/long pair. - */ - maxLatLng: Schema$LatLng; - /** - * Min lat/long pair. - */ - minLatLng: Schema$LatLng; -} -/** - * Detected entity location information. - */ -export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { - /** - * lat/long location coordinates. - */ - latLng: Schema$LatLng; -} -/** - * A vertex represents a 2D point in the image. NOTE: the normalized vertex - * coordinates are relative to the original image and range from 0 to 1. - */ -export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; -} -/** - * Contains metadata for the BatchAnnotateImages operation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { - /** - * The time when the batch request was received. - */ - createTime: string; - /** - * Current state of the batch operation. - */ - state: string; - /** - * The time when the operation result was last updated. - */ - updateTime: string; -} -/** - * The desired output location and metadata. - */ -export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { - /** - * The max number of response protos to put into each output JSON file on - * Google Cloud Storage. The valid range is [1, 100]. If not specified, the - * default value is 20. For example, for one pdf file with 100 pages, 100 - * response protos will be generated. If `batch_size` = 20, then 5 json files - * each containing 20 response protos will be written under the prefix - * `gcs_destination`.`uri`. Currently, batch_size only applies to - * GcsDestination, with potential future support for other output - * configurations. - */ - batchSize: number; - /** - * The Google Cloud Storage location to write the output(s) to. - */ - gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; -} -/** - * Detected page from OCR. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Page { - /** - * List of blocks of text, images etc on this page. - */ - blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; - /** - * Confidence of the OCR results on the page. Range [0, 1]. - */ - confidence: number; - /** - * Page height. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - height: number; - /** - * Additional information detected on the page. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * Page width. For PDFs the unit is points. For images (including TIFFs) the - * unit is pixels. - */ - width: number; -} -/** - * Structural unit of text representing a number of words in certain order. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { - /** - * The bounding box for the paragraph. The vertices are in the order of - * top-left, top-right, bottom-right, bottom-left. When a rotation of the - * bounding box is detected the rotation is represented as around the top-left - * corner as defined when the text is read in the 'natural' - * orientation. For example: * when the text is horizontal it might look - * like: 0----1 | | 3----2 * when it's rotated 180 - * degrees around the top-left corner it becomes: 2----3 | | - * 1----0 and the vertice order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; - /** - * Confidence of the OCR results for the paragraph. Range [0, 1]. - */ - confidence: number; - /** - * Additional information detected for the paragraph. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; - /** - * List of words in this paragraph. - */ - words: Schema$GoogleCloudVisionV1p2beta1Word[]; -} -/** - * A 3D position in the image, used primarily for Face detection landmarks. A - * valid Position must have both x and y coordinates. The position coordinates - * are in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Position { - /** - * X coordinate. - */ - x: number; - /** - * Y coordinate. - */ - y: number; - /** - * Z coordinate (or depth). - */ - z: number; -} -/** - * A `Property` consists of a user-supplied name/value pair. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Property { +export namespace vision_v1p2beta1 { /** - * Name of the property. - */ - name: string; + * Cloud Vision API + * + * Integrates Google Vision features, including image labeling, face, logo, + * and landmark detection, optical character recognition (OCR), and detection + * of explicit content, into applications. + * + * @example + * const google = require('googleapis'); + * const vision = google.vision('v1p2beta1'); + * + * @namespace vision + * @type {Function} + * @version v1p2beta1 + * @variation v1p2beta1 + * @param {object=} options Options for Vision + */ + export class Vision { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + files: Resource$Files; + images: Resource$Images; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.files = new Resource$Files(this); + this.images = new Resource$Images(this); + } + + getRoot() { + return this.root; + } + } + /** - * Value of numeric properties. - */ - uint64Value: string; + * Represents a color in the RGBA color space. This representation is designed + * for simplicity of conversion to/from color representations in various + * languages over compactness; for example, the fields of this representation + * can be trivially provided to the constructor of "java.awt.Color" + * in Java; it can also be trivially provided to UIColor's + * "+colorWithRed:green:blue:alpha" method in iOS; and, with just a + * little work, it can be easily formatted into a CSS "rgba()" + * string in JavaScript, as well. Here are some examples: Example (Java): + * import com.google.type.Color; // ... public static + * java.awt.Color fromProto(Color protocolor) { float alpha = + * protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; + * return new java.awt.Color( protocolor.getRed(), + * protocolor.getGreen(), protocolor.getBlue(), alpha); + * } public static Color toProto(java.awt.Color color) { float + * red = (float) color.getRed(); float green = (float) + * color.getGreen(); float blue = (float) color.getBlue(); float + * denominator = 255.0; Color.Builder resultBuilder = Color + * .newBuilder() .setRed(red / denominator) .setGreen(green / + * denominator) .setBlue(blue / denominator); int alpha + * = color.getAlpha(); if (alpha != 255) { result.setAlpha( + * FloatValue .newBuilder() .setValue(((float) alpha) / + * denominator) .build()); } return + * resultBuilder.build(); } // ... Example (iOS / Obj-C): // + * ... static UIColor* fromProto(Color* protocolor) { float red = + * [protocolor red]; float green = [protocolor green]; float + * blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor + * alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { + * alpha = [alpha_wrapper value]; } return [UIColor + * colorWithRed:red green:green blue:blue alpha:alpha]; } static + * Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; + * if (![color getRed:&red green:&green blue:&blue + * alpha:&alpha]) { return nil; } Color* + * result = [Color alloc] init]; [result setRed:red]; [result + * setGreen:green]; [result setBlue:blue]; if (alpha <= + * 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } + * [result autorelease]; return result; } // ... Example + * (JavaScript): // ... var protoToCssColor = function(rgb_color) { + * var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green + * || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = + * Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); + * var blue = Math.floor(blueFrac * 255); if (!('alpha' in + * rgb_color)) { return rgbToCssColor_(red, green, blue); } + * var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, + * green, blue].join(','); return ['rgba(', rgbParams, + * ',', alphaFrac, ')'].join(''); }; var + * rgbToCssColor_ = function(red, green, blue) { var rgbNumber = new + * Number((red << 16) | (green << 8) | blue); var hexString + * = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; + * var resultBuilder = ['#']; for (var i = 0; i < + * missingZeros; i++) { resultBuilder.push('0'); } + * resultBuilder.push(hexString); return resultBuilder.join(''); + * }; // ... + */ + export interface Schema$Color { + /** + * The fraction of this color that should be applied to the pixel. That is, + * the final pixel color is defined by the equation: pixel color = alpha + * * (this color) + (1.0 - alpha) * (background color) This means that a + * value of 1.0 corresponds to a solid color, whereas a value of 0.0 + * corresponds to a completely transparent color. This uses a wrapper + * message rather than a simple float scalar so that it is possible to + * distinguish between a default value and the value being unset. If + * omitted, this color object is to be rendered as a solid color (as if the + * alpha value had been explicitly given with a value of 1.0). + */ + alpha: number; + /** + * The amount of blue in the color as a value in the interval [0, 1]. + */ + blue: number; + /** + * The amount of green in the color as a value in the interval [0, 1]. + */ + green: number; + /** + * The amount of red in the color as a value in the interval [0, 1]. + */ + red: number; + } /** - * Value of the property. - */ - value: string; -} -/** - * Set of features pertaining to the image, computed by computer vision methods - * over safe-search verticals (for example, adult, spoof, medical, violence). - */ -export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { + * Response to a single file annotation request. A file may contain one or + * more images, which individually have their own responses. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateFileResponse { + /** + * Information about the file for which this response is generated. + */ + inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; + /** + * Individual responses to images found within the file. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; + } /** - * Represents the adult content likelihood for the image. Adult content may - * contain elements such as nudity, pornographic images or cartoons, or sexual - * activities. - */ - adult: string; + * Request for performing Google Cloud Vision API tasks over a user-provided + * image, with user-requested features. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageRequest { + /** + * Requested features. + */ + features: Schema$GoogleCloudVisionV1p2beta1Feature[]; + /** + * The image to be processed. + */ + image: Schema$GoogleCloudVisionV1p2beta1Image; + /** + * Additional context that may accompany the image. + */ + imageContext: Schema$GoogleCloudVisionV1p2beta1ImageContext; + } /** - * Likelihood that this is a medical image. - */ - medical: string; + * Response to an image annotation request. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse { + /** + * If present, contextual information is needed to understand where this + * image comes from. + */ + context: Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext; + /** + * If present, crop hints have completed successfully. + */ + cropHintsAnnotation: Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation; + /** + * If set, represents the error message for the operation. Note that + * filled-in image annotations are guaranteed to be correct, even when + * `error` is set. + */ + error: Schema$Status; + /** + * If present, face detection has completed successfully. + */ + faceAnnotations: Schema$GoogleCloudVisionV1p2beta1FaceAnnotation[]; + /** + * If present, text (OCR) detection or document (OCR) text detection has + * completed successfully. This annotation provides the structural hierarchy + * for the OCR detected text. + */ + fullTextAnnotation: Schema$GoogleCloudVisionV1p2beta1TextAnnotation; + /** + * If present, image properties were extracted successfully. + */ + imagePropertiesAnnotation: Schema$GoogleCloudVisionV1p2beta1ImageProperties; + /** + * If present, label detection has completed successfully. + */ + labelAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, landmark detection has completed successfully. + */ + landmarkAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, logo detection has completed successfully. + */ + logoAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, safe-search annotation has completed successfully. + */ + safeSearchAnnotation: Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation; + /** + * If present, text (OCR) detection has completed successfully. + */ + textAnnotations: Schema$GoogleCloudVisionV1p2beta1EntityAnnotation[]; + /** + * If present, web detection has completed successfully. + */ + webDetection: Schema$GoogleCloudVisionV1p2beta1WebDetection; + } /** - * Likelihood that the request image contains racy content. Racy content may - * include (but is not limited to) skimpy or sheer clothing, strategically - * covered nudity, lewd or provocative poses, or close-ups of sensitive body - * areas. - */ - racy: string; + * An offline file annotation request. + */ + export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest { + /** + * Required. Requested features. + */ + features: Schema$GoogleCloudVisionV1p2beta1Feature[]; + /** + * Additional context that may accompany the image(s) in the file. + */ + imageContext: Schema$GoogleCloudVisionV1p2beta1ImageContext; + /** + * Required. Information about the input file. + */ + inputConfig: Schema$GoogleCloudVisionV1p2beta1InputConfig; + /** + * Required. The desired output location and metadata (e.g. format). + */ + outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; + } /** - * Spoof likelihood. The likelihood that an modification was made to the - * image's canonical version to make it appear funny or offensive. + * The response for a single offline file annotation request. */ - spoof: string; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse { + /** + * The output location and metadata from AsyncAnnotateFileRequest. + */ + outputConfig: Schema$GoogleCloudVisionV1p2beta1OutputConfig; + } /** - * Likelihood that this image contains violent content. + * Multiple async file annotation requests are batched into a single service + * call. */ - violence: string; -} -/** - * A single symbol representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Symbol { + export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest { + /** + * Individual async file annotation requests for this batch. + */ + requests: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileRequest[]; + } /** - * The bounding box for the symbol. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). + * Response to an async batch file annotation request. */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + export interface Schema$GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse { + /** + * The list of file annotation responses, one for each request in + * AsyncBatchAnnotateFilesRequest. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse[]; + } /** - * Confidence of the OCR results for the symbol. Range [0, 1]. + * Multiple image annotation requests are batched into a single service call. */ - confidence: number; + export interface Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest { + /** + * Individual image annotation requests for this batch. + */ + requests: Schema$GoogleCloudVisionV1p2beta1AnnotateImageRequest[]; + } /** - * Additional information detected for the symbol. + * Response to a batch image annotation request. */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + export interface Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse { + /** + * Individual responses to image annotation requests within the batch. + */ + responses: Schema$GoogleCloudVisionV1p2beta1AnnotateImageResponse[]; + } /** - * The actual UTF-8 representation of the symbol. - */ - text: string; -} -/** - * TextAnnotation contains a structured representation of OCR extracted text. - * The hierarchy of an OCR extracted text structure is like this: TextAnnotation - * -> Page -> Block -> Paragraph -> Word -> Symbol Each - * structural component, starting from Page, may further have their own - * properties. Properties describe detected languages, breaks etc.. Please refer - * to the TextAnnotation.TextProperty message definition below for more detail. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { + * Logical element on the page. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Block { + /** + * Detected block type (text, image etc) for this block. + */ + blockType: string; + /** + * The bounding box for the block. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's + * rotated 180 degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results on the block. Range [0, 1]. + */ + confidence: number; + /** + * List of paragraphs in this block (if this blocks is of type text). + */ + paragraphs: Schema$GoogleCloudVisionV1p2beta1Paragraph[]; + /** + * Additional information detected for the block. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + } /** - * List of pages detected by OCR. - */ - pages: Schema$GoogleCloudVisionV1p2beta1Page[]; + * A bounding polygon for the detected image annotation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1BoundingPoly { + /** + * The bounding polygon normalized vertices. + */ + normalizedVertices: Schema$GoogleCloudVisionV1p2beta1NormalizedVertex[]; + /** + * The bounding polygon vertices. + */ + vertices: Schema$GoogleCloudVisionV1p2beta1Vertex[]; + } /** - * UTF-8 text detected on the pages. - */ - text: string; -} -/** - * Detected start or end of a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { + * Color information consists of RGB channels, score, and the fraction of the + * image that the color occupies in the image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ColorInfo { + /** + * RGB components of the color. + */ + color: Schema$Color; + /** + * The fraction of pixels the color occupies in the image. Value in range + * [0, 1]. + */ + pixelFraction: number; + /** + * Image-specific score for this color. Value in range [0, 1]. + */ + score: number; + } /** - * True if break prepends the element. - */ - isPrefix: boolean; + * Single crop hint that is used to generate a new crop when serving an image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1CropHint { + /** + * The bounding polygon for the crop region. The coordinates of the bounding + * box are in the original image's scale, as returned in `ImageParams`. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of this being a salient region. Range [0, 1]. + */ + confidence: number; + /** + * Fraction of importance of this salient region with respect to the + * original image. + */ + importanceFraction: number; + } /** - * Detected break type. + * Set of crop hints that are used to generate new crops when serving images. */ - type: string; -} -/** - * Detected language for a structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { + export interface Schema$GoogleCloudVisionV1p2beta1CropHintsAnnotation { + /** + * Crop hint results. + */ + cropHints: Schema$GoogleCloudVisionV1p2beta1CropHint[]; + } /** - * Confidence of detected language. Range [0, 1]. + * Parameters for crop hints annotation request. */ - confidence: number; + export interface Schema$GoogleCloudVisionV1p2beta1CropHintsParams { + /** + * Aspect ratios in floats, representing the ratio of the width to the + * height of the image. For example, if the desired aspect ratio is 4/3, the + * corresponding float value should be 1.33333. If not specified, the best + * possible crop is returned. The number of provided aspect ratios is + * limited to a maximum of 16; any aspect ratios provided after the 16th are + * ignored. + */ + aspectRatios: number[]; + } /** - * The BCP-47 language code, such as "en-US" or "sr-Latn". - * For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + * Set of dominant colors and their corresponding scores. */ - languageCode: string; -} -/** - * Additional information detected on the structural component. - */ -export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { + export interface Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation { + /** + * RGB color values with their score and pixel fraction. + */ + colors: Schema$GoogleCloudVisionV1p2beta1ColorInfo[]; + } /** - * Detected start or end of a text segment. - */ - detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; + * Set of detected entity features. + */ + export interface Schema$GoogleCloudVisionV1p2beta1EntityAnnotation { + /** + * Image region to which this entity belongs. Not produced for + * `LABEL_DETECTION` features. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * **Deprecated. Use `score` instead.** The accuracy of the entity detection + * in an image. For example, for an image in which the "Eiffel + * Tower" entity is detected, this field represents the confidence that + * there is a tower in the query image. Range [0, 1]. + */ + confidence: number; + /** + * Entity textual description, expressed in its `locale` language. + */ + description: string; + /** + * The language code for the locale in which the entity textual + * `description` is expressed. + */ + locale: string; + /** + * The location information for the detected entity. Multiple `LocationInfo` + * elements can be present because one location may indicate the location of + * the scene in the image, and another location may indicate the location of + * the place where the image was taken. Location information is usually + * present for landmarks. + */ + locations: Schema$GoogleCloudVisionV1p2beta1LocationInfo[]; + /** + * Opaque entity ID. Some IDs may be available in [Google Knowledge Graph + * Search API](https://developers.google.com/knowledge-graph/). + */ + mid: string; + /** + * Some entities may have optional user-supplied `Property` (name/value) + * fields, such a score or string that qualifies the entity. + */ + properties: Schema$GoogleCloudVisionV1p2beta1Property[]; + /** + * Overall score of the result. Range [0, 1]. + */ + score: number; + /** + * The relevancy of the ICA (Image Content Annotation) label to the image. + * For example, the relevancy of "tower" is likely higher to an + * image containing the detected "Eiffel Tower" than to an image + * containing a detected distant towering building, even though the + * confidence that there is a tower in each image may be the same. Range [0, + * 1]. + */ + topicality: number; + } /** - * A list of detected languages together with confidence. - */ - detectedLanguages: - Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; -} -/** - * A vertex represents a 2D point in the image. NOTE: the vertex coordinates are - * in the same scale as the original image. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Vertex { + * A face annotation object contains the results of face detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotation { + /** + * Anger likelihood. + */ + angerLikelihood: string; + /** + * Blurred likelihood. + */ + blurredLikelihood: string; + /** + * The bounding polygon around the face. The coordinates of the bounding box + * are in the original image's scale, as returned in `ImageParams`. The + * bounding box is computed to "frame" the face in accordance with + * human expectations. It is based on the landmarker results. Note that one + * or more x and/or y coordinates may not be generated in the `BoundingPoly` + * (the polygon will be unbounded) if only a partial face appears in the + * image to be annotated. + */ + boundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Detection confidence. Range [0, 1]. + */ + detectionConfidence: number; + /** + * The `fd_bounding_poly` bounding polygon is tighter than the + * `boundingPoly`, and encloses only the skin part of the face. Typically, + * it is used to eliminate the face from any image analysis that detects the + * "amount of skin" visible in an image. It is not based on the + * landmarker results, only on the initial face detection, hence the + * <code>fd</code> (face detection) prefix. + */ + fdBoundingPoly: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Headwear likelihood. + */ + headwearLikelihood: string; + /** + * Joy likelihood. + */ + joyLikelihood: string; + /** + * Face landmarking confidence. Range [0, 1]. + */ + landmarkingConfidence: number; + /** + * Detected face landmarks. + */ + landmarks: Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark[]; + /** + * Yaw angle, which indicates the leftward/rightward angle that the face is + * pointing relative to the vertical plane perpendicular to the image. Range + * [-180,180]. + */ + panAngle: number; + /** + * Roll angle, which indicates the amount of clockwise/anti-clockwise + * rotation of the face relative to the image vertical about the axis + * perpendicular to the face. Range [-180,180]. + */ + rollAngle: number; + /** + * Sorrow likelihood. + */ + sorrowLikelihood: string; + /** + * Surprise likelihood. + */ + surpriseLikelihood: string; + /** + * Pitch angle, which indicates the upwards/downwards angle that the face is + * pointing relative to the image's horizontal plane. Range [-180,180]. + */ + tiltAngle: number; + /** + * Under-exposed likelihood. + */ + underExposedLikelihood: string; + } /** - * X coordinate. - */ - x: number; + * A face-specific landmark (for example, a face feature). + */ + export interface Schema$GoogleCloudVisionV1p2beta1FaceAnnotationLandmark { + /** + * Face landmark position. + */ + position: Schema$GoogleCloudVisionV1p2beta1Position; + /** + * Face landmark type. + */ + type: string; + } /** - * Y coordinate. - */ - y: number; -} -/** - * Relevant information for the image from the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { + * The type of Google Cloud Vision API detection to perform, and the maximum + * number of results to return for that type. Multiple `Feature` objects can + * be specified in the `features` list. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Feature { + /** + * Maximum number of results of this type. Does not apply to + * `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + */ + maxResults: number; + /** + * Model to use for the feature. Supported values: + * "builtin/stable" (the default if unset) and + * "builtin/latest". + */ + model: string; + /** + * The feature type. + */ + type: string; + } /** - * Best guess text labels for the request image. - */ - bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; + * The Google Cloud Storage location where the output will be written to. + */ + export interface Schema$GoogleCloudVisionV1p2beta1GcsDestination { + /** + * Google Cloud Storage URI where the results will be stored. Results will + * be in JSON format and preceded by its corresponding input URI. This field + * can either represent a single file, or a prefix for multiple outputs. + * Prefixes must end in a `/`. Examples: * File: + * gs://bucket-name/filename.json * Prefix: gs://bucket-name/prefix/here/ + * * File: gs://bucket-name/prefix/here If multiple outputs, each + * response is still AnnotateFileResponse, each of which contains some + * subset of the full list of AnnotateImageResponse. Multiple outputs can + * happen if, for example, the output JSON is too large and overflows into + * multiple sharded files. + */ + uri: string; + } /** - * Fully matching images from the Internet. Can include resized copies of the - * query image. + * The Google Cloud Storage location where the input will be read from. */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + export interface Schema$GoogleCloudVisionV1p2beta1GcsSource { + /** + * Google Cloud Storage URI for the input file. This must only be a Google + * Cloud Storage object. Wildcards are not currently supported. + */ + uri: string; + } /** - * Web pages containing the matching images from the Internet. - */ - pagesWithMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; + * Client image to perform Google Cloud Vision API tasks over. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Image { + /** + * Image content, represented as a stream of bytes. Note: As with all + * `bytes` fields, protobuffers use a pure binary representation, whereas + * JSON representations use base64. + */ + content: string; + /** + * Google Cloud Storage image location, or publicly-accessible image URL. If + * both `content` and `source` are provided for an image, `content` takes + * precedence and is used to perform the image annotation request. + */ + source: Schema$GoogleCloudVisionV1p2beta1ImageSource; + } /** - * Partial matching images from the Internet. Those images are similar enough - * to share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + * If an image was produced from a file (e.g. a PDF), this message gives + * information about the source of that image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ImageAnnotationContext { + /** + * If the file was a PDF or TIFF, this field gives the page number within + * the file used to produce the image. + */ + pageNumber: number; + /** + * The URI of the file used to produce the image. + */ + uri: string; + } /** - * The visually similar image results. - */ - visuallySimilarImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + * Image context and/or feature-specific parameters. + */ + export interface Schema$GoogleCloudVisionV1p2beta1ImageContext { + /** + * Parameters for crop hints annotation request. + */ + cropHintsParams: Schema$GoogleCloudVisionV1p2beta1CropHintsParams; + /** + * List of languages to use for TEXT_DETECTION. In most cases, an empty + * value yields the best results since it enables automatic language + * detection. For languages based on the Latin alphabet, setting + * `language_hints` is not needed. In rare cases, when the language of the + * text in the image is known, setting a hint will help get better results + * (although it will be a significant hindrance if the hint is wrong). Text + * detection returns an error if one or more of the specified languages is + * not one of the [supported languages](/vision/docs/languages). + */ + languageHints: string[]; + /** + * Not used. + */ + latLongRect: Schema$GoogleCloudVisionV1p2beta1LatLongRect; + /** + * Parameters for web detection. + */ + webDetectionParams: Schema$GoogleCloudVisionV1p2beta1WebDetectionParams; + } /** - * Deduced entities from similar images on the Internet. + * Stores image properties, such as dominant colors. */ - webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; -} -/** - * Parameters for web detection request. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionParams { + export interface Schema$GoogleCloudVisionV1p2beta1ImageProperties { + /** + * If present, dominant colors completed successfully. + */ + dominantColors: Schema$GoogleCloudVisionV1p2beta1DominantColorsAnnotation; + } /** - * Whether to include results derived from the geo information in the image. - */ - includeGeoResults: boolean; -} -/** - * Entity deduced from similar images on the Internet. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { + * External image source (Google Cloud Storage or web URL image location). + */ + export interface Schema$GoogleCloudVisionV1p2beta1ImageSource { + /** + * **Use `image_uri` instead.** The Google Cloud Storage URI of the form + * `gs://bucket_name/object_name`. Object versioning is not supported. See + * [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. + */ + gcsImageUri: string; + /** + * The URI of the source image. Can be either: 1. A Google Cloud Storage + * URI of the form `gs://bucket_name/object_name`. Object versioning is + * not supported. See [Google Cloud Storage Request + * URIs](https://cloud.google.com/storage/docs/reference-uris) for more + * info. 2. A publicly-accessible image HTTP/HTTPS URL. When fetching + * images from HTTP/HTTPS URLs, Google cannot guarantee that the request + * will be completed. Your request may fail if the specified host denies + * the request (e.g. due to request throttling or DOS prevention), or if + * Google throttles requests to the site for abuse prevention. You should + * not depend on externally-hosted images for production applications. + * When both `gcs_image_uri` and `image_uri` are specified, `image_uri` + * takes precedence. + */ + imageUri: string; + } /** - * Canonical description of the entity, in English. - */ - description: string; + * The desired input location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1InputConfig { + /** + * The Google Cloud Storage location to read the input from. + */ + gcsSource: Schema$GoogleCloudVisionV1p2beta1GcsSource; + /** + * The type of the file. Currently only "application/pdf" and + * "image/tiff" are supported. Wildcards are not supported. + */ + mimeType: string; + } /** - * Opaque entity ID. - */ - entityId: string; + * Rectangle determined by min and max `LatLng` pairs. + */ + export interface Schema$GoogleCloudVisionV1p2beta1LatLongRect { + /** + * Max lat/long pair. + */ + maxLatLng: Schema$LatLng; + /** + * Min lat/long pair. + */ + minLatLng: Schema$LatLng; + } /** - * Overall relevancy score for the entity. Not normalized and not comparable - * across different image queries. + * Detected entity location information. */ - score: number; -} -/** - * Metadata for online images. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { + export interface Schema$GoogleCloudVisionV1p2beta1LocationInfo { + /** + * lat/long location coordinates. + */ + latLng: Schema$LatLng; + } /** - * (Deprecated) Overall relevancy score for the image. - */ - score: number; + * A vertex represents a 2D point in the image. NOTE: the normalized vertex + * coordinates are relative to the original image and range from 0 to 1. + */ + export interface Schema$GoogleCloudVisionV1p2beta1NormalizedVertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * The result image URL. - */ - url: string; -} -/** - * Label to provide extra metadata for the web detection. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { + * Contains metadata for the BatchAnnotateImages operation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OperationMetadata { + /** + * The time when the batch request was received. + */ + createTime: string; + /** + * Current state of the batch operation. + */ + state: string; + /** + * The time when the operation result was last updated. + */ + updateTime: string; + } /** - * Label for extra metadata. - */ - label: string; + * The desired output location and metadata. + */ + export interface Schema$GoogleCloudVisionV1p2beta1OutputConfig { + /** + * The max number of response protos to put into each output JSON file on + * Google Cloud Storage. The valid range is [1, 100]. If not specified, the + * default value is 20. For example, for one pdf file with 100 pages, 100 + * response protos will be generated. If `batch_size` = 20, then 5 json + * files each containing 20 response protos will be written under the prefix + * `gcs_destination`.`uri`. Currently, batch_size only applies to + * GcsDestination, with potential future support for other output + * configurations. + */ + batchSize: number; + /** + * The Google Cloud Storage location to write the output(s) to. + */ + gcsDestination: Schema$GoogleCloudVisionV1p2beta1GcsDestination; + } /** - * The BCP-47 language code for `label`, such as "en-US" or - * "sr-Latn". For more information, see - * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - */ - languageCode: string; -} -/** - * Metadata for web pages. - */ -export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { + * Detected page from OCR. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Page { + /** + * List of blocks of text, images etc on this page. + */ + blocks: Schema$GoogleCloudVisionV1p2beta1Block[]; + /** + * Confidence of the OCR results on the page. Range [0, 1]. + */ + confidence: number; + /** + * Page height. For PDFs the unit is points. For images (including TIFFs) + * the unit is pixels. + */ + height: number; + /** + * Additional information detected on the page. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * Page width. For PDFs the unit is points. For images (including TIFFs) the + * unit is pixels. + */ + width: number; + } /** - * Fully matching images on the page. Can include resized copies of the query - * image. - */ - fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + * Structural unit of text representing a number of words in certain order. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Paragraph { + /** + * The bounding box for the paragraph. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the paragraph. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the paragraph. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of words in this paragraph. + */ + words: Schema$GoogleCloudVisionV1p2beta1Word[]; + } /** - * Title for the web page, may contain HTML markups. - */ - pageTitle: string; + * A 3D position in the image, used primarily for Face detection landmarks. A + * valid Position must have both x and y coordinates. The position coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Position { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + /** + * Z coordinate (or depth). + */ + z: number; + } /** - * Partial matching images on the page. Those images are similar enough to - * share some key-point features. For example an original image will likely - * have partial matching for its crops. - */ - partialMatchingImages: - Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + * A `Property` consists of a user-supplied name/value pair. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Property { + /** + * Name of the property. + */ + name: string; + /** + * Value of numeric properties. + */ + uint64Value: string; + /** + * Value of the property. + */ + value: string; + } /** - * (Deprecated) Overall relevancy score for the web page. - */ - score: number; + * Set of features pertaining to the image, computed by computer vision + * methods over safe-search verticals (for example, adult, spoof, medical, + * violence). + */ + export interface Schema$GoogleCloudVisionV1p2beta1SafeSearchAnnotation { + /** + * Represents the adult content likelihood for the image. Adult content may + * contain elements such as nudity, pornographic images or cartoons, or + * sexual activities. + */ + adult: string; + /** + * Likelihood that this is a medical image. + */ + medical: string; + /** + * Likelihood that the request image contains racy content. Racy content may + * include (but is not limited to) skimpy or sheer clothing, strategically + * covered nudity, lewd or provocative poses, or close-ups of sensitive body + * areas. + */ + racy: string; + /** + * Spoof likelihood. The likelihood that an modification was made to the + * image's canonical version to make it appear funny or offensive. + */ + spoof: string; + /** + * Likelihood that this image contains violent content. + */ + violence: string; + } /** - * The result web page URL. - */ - url: string; -} -/** - * A word representation. - */ -export interface Schema$GoogleCloudVisionV1p2beta1Word { + * A single symbol representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Symbol { + /** + * The bounding box for the symbol. The vertices are in the order of + * top-left, top-right, bottom-right, bottom-left. When a rotation of the + * bounding box is detected the rotation is represented as around the + * top-left corner as defined when the text is read in the 'natural' + * orientation. For example: * when the text is horizontal it might look + * like: 0----1 | | 3----2 * when it's rotated 180 + * degrees around the top-left corner it becomes: 2----3 | | + * 1----0 and the vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the symbol. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the symbol. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * The actual UTF-8 representation of the symbol. + */ + text: string; + } /** - * The bounding box for the word. The vertices are in the order of top-left, - * top-right, bottom-right, bottom-left. When a rotation of the bounding box - * is detected the rotation is represented as around the top-left corner as - * defined when the text is read in the 'natural' orientation. For - * example: * when the text is horizontal it might look like: 0----1 | - * | 3----2 * when it's rotated 180 degrees around the top-left - * corner it becomes: 2----3 | | 1----0 and the vertice - * order will still be (0, 1, 2, 3). - */ - boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + * TextAnnotation contains a structured representation of OCR extracted text. + * The hierarchy of an OCR extracted text structure is like this: + * TextAnnotation -> Page -> Block -> Paragraph -> Word -> + * Symbol Each structural component, starting from Page, may further have + * their own properties. Properties describe detected languages, breaks etc.. + * Please refer to the TextAnnotation.TextProperty message definition below + * for more detail. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotation { + /** + * List of pages detected by OCR. + */ + pages: Schema$GoogleCloudVisionV1p2beta1Page[]; + /** + * UTF-8 text detected on the pages. + */ + text: string; + } /** - * Confidence of the OCR results for the word. Range [0, 1]. - */ - confidence: number; + * Detected start or end of a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak { + /** + * True if break prepends the element. + */ + isPrefix: boolean; + /** + * Detected break type. + */ + type: string; + } /** - * Additional information detected for the word. - */ - property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + * Detected language for a structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage { + /** + * Confidence of detected language. Range [0, 1]. + */ + confidence: number; + /** + * The BCP-47 language code, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * List of symbols in the word. The order of the symbols follows the natural - * reading order. - */ - symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; -} -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the <a - * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 - * standard</a>. Values must be within normalized ranges. - */ -export interface Schema$LatLng { + * Additional information detected on the structural component. + */ + export interface Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty { + /** + * Detected start or end of a text segment. + */ + detectedBreak: Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedBreak; + /** + * A list of detected languages together with confidence. + */ + detectedLanguages: + Schema$GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage[]; + } /** - * The latitude in degrees. It must be in the range [-90.0, +90.0]. - */ - latitude: number; + * A vertex represents a 2D point in the image. NOTE: the vertex coordinates + * are in the same scale as the original image. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Vertex { + /** + * X coordinate. + */ + x: number; + /** + * Y coordinate. + */ + y: number; + } /** - * The longitude in degrees. It must be in the range [-180.0, +180.0]. - */ - longitude: number; -} -/** - * This resource represents a long-running operation that is the result of a - * network API call. - */ -export interface Schema$Operation { + * Relevant information for the image from the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetection { + /** + * Best guess text labels for the request image. + */ + bestGuessLabels: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel[]; + /** + * Fully matching images from the Internet. Can include resized copies of + * the query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Web pages containing the matching images from the Internet. + */ + pagesWithMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage[]; + /** + * Partial matching images from the Internet. Those images are similar + * enough to share some key-point features. For example an original image + * will likely have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * The visually similar image results. + */ + visuallySimilarImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Deduced entities from similar images on the Internet. + */ + webEntities: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity[]; + } /** - * If the value is `false`, it means the operation is still in progress. If - * `true`, the operation is completed, and either `error` or `response` is - * available. + * Parameters for web detection request. */ - done: boolean; + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionParams { + /** + * Whether to include results derived from the geo information in the image. + */ + includeGeoResults: boolean; + } /** - * The error result of the operation in case of failure or cancellation. - */ - error: Schema$Status; + * Entity deduced from similar images on the Internet. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebEntity { + /** + * Canonical description of the entity, in English. + */ + description: string; + /** + * Opaque entity ID. + */ + entityId: string; + /** + * Overall relevancy score for the entity. Not normalized and not comparable + * across different image queries. + */ + score: number; + } /** - * Service-specific metadata associated with the operation. It typically - * contains progress information and common metadata such as create time. Some - * services might not provide such metadata. Any method that returns a - * long-running operation should document the metadata type, if any. - */ - metadata: any; + * Metadata for online images. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage { + /** + * (Deprecated) Overall relevancy score for the image. + */ + score: number; + /** + * The result image URL. + */ + url: string; + } /** - * The server-assigned name, which is only unique within the same service that - * originally returns it. If you use the default HTTP mapping, the `name` - * should have the format of `operations/some/unique/name`. - */ - name: string; + * Label to provide extra metadata for the web detection. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebLabel { + /** + * Label for extra metadata. + */ + label: string; + /** + * The BCP-47 language code for `label`, such as "en-US" or + * "sr-Latn". For more information, see + * http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + */ + languageCode: string; + } /** - * The normal response of the operation in case of success. If the original - * method returns no data on success, such as `Delete`, the response is - * `google.protobuf.Empty`. If the original method is standard - * `Get`/`Create`/`Update`, the response should be the resource. For other - * methods, the response should have the type `XxxResponse`, where `Xxx` is - * the original method name. For example, if the original method name is - * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. - */ - response: any; -} -/** - * The `Status` type defines a logical error model that is suitable for - * different programming environments, including REST APIs and RPC APIs. It is - * used by [gRPC](https://github.com/grpc). The error model is designed to be: - * - Simple to use and understand for most users - Flexible enough to meet - * unexpected needs # Overview The `Status` message contains three pieces of - * data: error code, error message, and error details. The error code should be - * an enum value of google.rpc.Code, but it may accept additional error codes if - * needed. The error message should be a developer-facing English message that - * helps developers *understand* and *resolve* the error. If a localized - * user-facing error message is needed, put the localized message in the error - * details or localize it in the client. The optional error details may contain - * arbitrary information about the error. There is a predefined set of error - * detail types in the package `google.rpc` that can be used for common error - * conditions. # Language mapping The `Status` message is the logical - * representation of the error model, but it is not necessarily the actual wire - * format. When the `Status` message is exposed in different client libraries - * and different wire protocols, it can be mapped differently. For example, it - * will likely be mapped to some exceptions in Java, but more likely mapped to - * some error codes in C. # Other uses The error model and the `Status` - * message can be used in a variety of environments, either with or without - * APIs, to provide a consistent developer experience across different - * environments. Example uses of this error model include: - Partial errors. - * If a service needs to return partial errors to the client, it may embed - * the `Status` in the normal response to indicate the partial errors. - - * Workflow errors. A typical workflow has multiple steps. Each step may have a - * `Status` message for error reporting. - Batch operations. If a client uses - * batch request and batch response, the `Status` message should be used - * directly inside batch response, one for each error sub-response. - - * Asynchronous operations. If an API call embeds asynchronous operation results - * in its response, the status of those operations should be represented - * directly using the `Status` message. - Logging. If some API errors are - * stored in logs, the message `Status` could be used directly after any - * stripping needed for security/privacy reasons. - */ -export interface Schema$Status { + * Metadata for web pages. + */ + export interface Schema$GoogleCloudVisionV1p2beta1WebDetectionWebPage { + /** + * Fully matching images on the page. Can include resized copies of the + * query image. + */ + fullMatchingImages: Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * Title for the web page, may contain HTML markups. + */ + pageTitle: string; + /** + * Partial matching images on the page. Those images are similar enough to + * share some key-point features. For example an original image will likely + * have partial matching for its crops. + */ + partialMatchingImages: + Schema$GoogleCloudVisionV1p2beta1WebDetectionWebImage[]; + /** + * (Deprecated) Overall relevancy score for the web page. + */ + score: number; + /** + * The result web page URL. + */ + url: string; + } /** - * The status code, which should be an enum value of google.rpc.Code. - */ - code: number; + * A word representation. + */ + export interface Schema$GoogleCloudVisionV1p2beta1Word { + /** + * The bounding box for the word. The vertices are in the order of top-left, + * top-right, bottom-right, bottom-left. When a rotation of the bounding box + * is detected the rotation is represented as around the top-left corner as + * defined when the text is read in the 'natural' orientation. For + * example: * when the text is horizontal it might look like: 0----1 + * | | 3----2 * when it's rotated 180 degrees around the + * top-left corner it becomes: 2----3 | | 1----0 and the + * vertice order will still be (0, 1, 2, 3). + */ + boundingBox: Schema$GoogleCloudVisionV1p2beta1BoundingPoly; + /** + * Confidence of the OCR results for the word. Range [0, 1]. + */ + confidence: number; + /** + * Additional information detected for the word. + */ + property: Schema$GoogleCloudVisionV1p2beta1TextAnnotationTextProperty; + /** + * List of symbols in the word. The order of the symbols follows the natural + * reading order. + */ + symbols: Schema$GoogleCloudVisionV1p2beta1Symbol[]; + } /** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - */ - details: any[]; + * An object representing a latitude/longitude pair. This is expressed as a + * pair of doubles representing degrees latitude and degrees longitude. Unless + * specified otherwise, this must conform to the <a + * href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84 + * standard</a>. Values must be within normalized ranges. + */ + export interface Schema$LatLng { + /** + * The latitude in degrees. It must be in the range [-90.0, +90.0]. + */ + latitude: number; + /** + * The longitude in degrees. It must be in the range [-180.0, +180.0]. + */ + longitude: number; + } /** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * google.rpc.Status.details field, or localized by the client. - */ - message: string; -} - -export class Resource$Files { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); + * This resource represents a long-running operation that is the result of a + * network API call. + */ + export interface Schema$Operation { + /** + * If the value is `false`, it means the operation is still in progress. If + * `true`, the operation is completed, and either `error` or `response` is + * available. + */ + done: boolean; + /** + * The error result of the operation in case of failure or cancellation. + */ + error: Schema$Status; + /** + * Service-specific metadata associated with the operation. It typically + * contains progress information and common metadata such as create time. + * Some services might not provide such metadata. Any method that returns a + * long-running operation should document the metadata type, if any. + */ + metadata: any; + /** + * The server-assigned name, which is only unique within the same service + * that originally returns it. If you use the default HTTP mapping, the + * `name` should have the format of `operations/some/unique/name`. + */ + name: string; + /** + * The normal response of the operation in case of success. If the original + * method returns no data on success, such as `Delete`, the response is + * `google.protobuf.Empty`. If the original method is standard + * `Get`/`Create`/`Update`, the response should be the resource. For other + * methods, the response should have the type `XxxResponse`, where `Xxx` is + * the original method name. For example, if the original method name is + * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. + */ + response: any; } - - getRoot() { - return this.root; + /** + * The `Status` type defines a logical error model that is suitable for + * different programming environments, including REST APIs and RPC APIs. It is + * used by [gRPC](https://github.com/grpc). The error model is designed to be: + * - Simple to use and understand for most users - Flexible enough to meet + * unexpected needs # Overview The `Status` message contains three pieces of + * data: error code, error message, and error details. The error code should + * be an enum value of google.rpc.Code, but it may accept additional error + * codes if needed. The error message should be a developer-facing English + * message that helps developers *understand* and *resolve* the error. If a + * localized user-facing error message is needed, put the localized message in + * the error details or localize it in the client. The optional error details + * may contain arbitrary information about the error. There is a predefined + * set of error detail types in the package `google.rpc` that can be used for + * common error conditions. # Language mapping The `Status` message is the + * logical representation of the error model, but it is not necessarily the + * actual wire format. When the `Status` message is exposed in different + * client libraries and different wire protocols, it can be mapped + * differently. For example, it will likely be mapped to some exceptions in + * Java, but more likely mapped to some error codes in C. # Other uses The + * error model and the `Status` message can be used in a variety of + * environments, either with or without APIs, to provide a consistent + * developer experience across different environments. Example uses of this + * error model include: - Partial errors. If a service needs to return + * partial errors to the client, it may embed the `Status` in the normal + * response to indicate the partial errors. - Workflow errors. A typical + * workflow has multiple steps. Each step may have a `Status` message for + * error reporting. - Batch operations. If a client uses batch request and + * batch response, the `Status` message should be used directly inside + * batch response, one for each error sub-response. - Asynchronous + * operations. If an API call embeds asynchronous operation results in its + * response, the status of those operations should be represented directly + * using the `Status` message. - Logging. If some API errors are stored in + * logs, the message `Status` could be used directly after any stripping + * needed for security/privacy reasons. + */ + export interface Schema$Status { + /** + * The status code, which should be an enum value of google.rpc.Code. + */ + code: number; + /** + * A list of messages that carry the error details. There is a common set + * of message types for APIs to use. + */ + details: any[]; + /** + * A developer-facing error message, which should be in English. Any + * user-facing error message should be localized and sent in the + * google.rpc.Status.details field, or localized by the client. + */ + message: string; } - - /** - * vision.files.asyncBatchAnnotate - * @desc Run async image detection and annotation for a list of generic files - * (e.g. PDF) which may contain multiple pages and multiple images per page. - * Progress and results can be retrieved through the - * `google.longrunning.Operations` interface. `Operation.metadata` contains - * `OperationMetadata` (metadata). `Operation.response` contains - * `AsyncBatchAnnotateFilesResponse` (results). - * @alias vision.files.asyncBatchAnnotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - asyncBatchAnnotate(params?: any, options?: MethodOptions): - AxiosPromise; - asyncBatchAnnotate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - asyncBatchAnnotate( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Files { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1p2beta1/files:asyncBatchAnnotate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Images { - root: Vision; - constructor(root: Vision) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * vision.files.asyncBatchAnnotate + * @desc Run async image detection and annotation for a list of generic + * files (e.g. PDF) which may contain multiple pages and multiple images per + * page. Progress and results can be retrieved through the + * `google.longrunning.Operations` interface. `Operation.metadata` contains + * `OperationMetadata` (metadata). `Operation.response` contains + * `AsyncBatchAnnotateFilesResponse` (results). + * @alias vision.files.asyncBatchAnnotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + asyncBatchAnnotate(params?: any, options?: MethodOptions): + AxiosPromise; + asyncBatchAnnotate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + asyncBatchAnnotate( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1p2beta1/files:asyncBatchAnnotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * vision.images.annotate - * @desc Run image detection and annotation for a batch of images. - * @alias vision.images.annotate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {().GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - annotate(params?: any, options?: MethodOptions): AxiosPromise< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>; - annotate( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): void; - annotate( - params?: any, - options?: MethodOptions|BodyResponseCallback< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>, - callback?: BodyResponseCallback< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): - void|AxiosPromise< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse> { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Images { + root: Vision; + constructor(root: Vision) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1p2beta1/images:annotate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>( - parameters, callback); - } else { - return createAPIRequest< - Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>( - parameters); + + + /** + * vision.images.annotate + * @desc Run image detection and annotation for a batch of images. + * @alias vision.images.annotate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {().GoogleCloudVisionV1p2beta1BatchAnnotateImagesRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + annotate(params?: any, options?: MethodOptions): AxiosPromise< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>; + annotate( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): + void; + annotate( + params?: any, + options?: MethodOptions|BodyResponseCallback< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>, + callback?: BodyResponseCallback< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>): + void|AxiosPromise< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse> { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://vision.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1p2beta1/images:annotate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>( + parameters, callback); + } else { + return createAPIRequest< + Schema$GoogleCloudVisionV1p2beta1BatchAnnotateImagesResponse>( + parameters); + } } } } diff --git a/src/apis/webfonts/v1.ts b/src/apis/webfonts/v1.ts index 773e313ecdf..c696a086276 100644 --- a/src/apis/webfonts/v1.ts +++ b/src/apis/webfonts/v1.ts @@ -27,153 +27,157 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Google Fonts Developer API - * - * Accesses the metadata for all families served by Google Fonts, providing a - * list of families currently available (including available styles and a list - * of supported script subsets). - * - * @example - * const google = require('googleapis'); - * const webfonts = google.webfonts('v1'); - * - * @namespace webfonts - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Webfonts - */ -export class Webfonts { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace webfonts_v1 { + /** + * Google Fonts Developer API + * + * Accesses the metadata for all families served by Google Fonts, providing a + * list of families currently available (including available styles and a list + * of supported script subsets). + * + * @example + * const google = require('googleapis'); + * const webfonts = google.webfonts('v1'); + * + * @namespace webfonts + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Webfonts + */ + export class Webfonts { + _options: GlobalOptions; + google: GoogleApis; + root = this; - webfonts: Resource$Webfonts; + webfonts: Resource$Webfonts; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.webfonts = new Resource$Webfonts(this); - } + this.webfonts = new Resource$Webfonts(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$Webfont { - /** - * The category of the font. - */ - category: string; - /** - * The name of the font. - */ - family: string; - /** - * The font files (with all supported scripts) for each one of the available - * variants, as a key : value map. - */ - files: any; - /** - * This kind represents a webfont object in the webfonts service. - */ - kind: string; - /** - * The date (format "yyyy-MM-dd") the font was modified for the last - * time. - */ - lastModified: string; - /** - * The scripts supported by the font. - */ - subsets: string[]; - /** - * The available variants for the font. - */ - variants: string[]; - /** - * The font version. - */ - version: string; -} -export interface Schema$WebfontList { - /** - * The list of fonts currently served by the Google Fonts API. - */ - items: Schema$Webfont[]; - /** - * This kind represents a list of webfont objects in the webfonts service. - */ - kind: string; -} - -export class Resource$Webfonts { - root: Webfonts; - constructor(root: Webfonts) { - this.root = root; - this.getRoot.bind(this); + export interface Schema$Webfont { + /** + * The category of the font. + */ + category: string; + /** + * The name of the font. + */ + family: string; + /** + * The font files (with all supported scripts) for each one of the available + * variants, as a key : value map. + */ + files: any; + /** + * This kind represents a webfont object in the webfonts service. + */ + kind: string; + /** + * The date (format "yyyy-MM-dd") the font was modified for the + * last time. + */ + lastModified: string; + /** + * The scripts supported by the font. + */ + subsets: string[]; + /** + * The available variants for the font. + */ + variants: string[]; + /** + * The font version. + */ + version: string; } - - getRoot() { - return this.root; + export interface Schema$WebfontList { + /** + * The list of fonts currently served by the Google Fonts API. + */ + items: Schema$Webfont[]; + /** + * This kind represents a list of webfont objects in the webfonts service. + */ + kind: string; } - - /** - * webfonts.webfonts.list - * @desc Retrieves the list of fonts currently served by the Google Fonts - * Developer API - * @alias webfonts.webfonts.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.sort Enables sorting of the list - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Webfonts { + root: Webfonts; + constructor(root: Webfonts) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webfonts/v1/webfonts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * webfonts.webfonts.list + * @desc Retrieves the list of fonts currently served by the Google Fonts + * Developer API + * @alias webfonts.webfonts.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.sort Enables sorting of the list + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webfonts/v1/webfonts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/webmasters/v3.ts b/src/apis/webmasters/v3.ts index 2f1e59a2ae0..4d3f8350e23 100644 --- a/src/apis/webmasters/v3.ts +++ b/src/apis/webmasters/v3.ts @@ -27,1100 +27,1113 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * Search Console API - * - * View Google Search Console data for your verified sites. - * - * @example - * const google = require('googleapis'); - * const webmasters = google.webmasters('v3'); - * - * @namespace webmasters - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Webmasters - */ -export class Webmasters { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace webmasters_v3 { + /** + * Search Console API + * + * View Google Search Console data for your verified sites. + * + * @example + * const google = require('googleapis'); + * const webmasters = google.webmasters('v3'); + * + * @namespace webmasters + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Webmasters + */ + export class Webmasters { + _options: GlobalOptions; + google: GoogleApis; + root = this; - searchanalytics: Resource$Searchanalytics; - sitemaps: Resource$Sitemaps; - sites: Resource$Sites; - urlcrawlerrorscounts: Resource$Urlcrawlerrorscounts; - urlcrawlerrorssamples: Resource$Urlcrawlerrorssamples; + searchanalytics: Resource$Searchanalytics; + sitemaps: Resource$Sitemaps; + sites: Resource$Sites; + urlcrawlerrorscounts: Resource$Urlcrawlerrorscounts; + urlcrawlerrorssamples: Resource$Urlcrawlerrorssamples; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.searchanalytics = new Resource$Searchanalytics(this); - this.sitemaps = new Resource$Sitemaps(this); - this.sites = new Resource$Sites(this); - this.urlcrawlerrorscounts = new Resource$Urlcrawlerrorscounts(this); - this.urlcrawlerrorssamples = new Resource$Urlcrawlerrorssamples(this); - } + this.searchanalytics = new Resource$Searchanalytics(this); + this.sitemaps = new Resource$Sitemaps(this); + this.sites = new Resource$Sites(this); + this.urlcrawlerrorscounts = new Resource$Urlcrawlerrorscounts(this); + this.urlcrawlerrorssamples = new Resource$Urlcrawlerrorssamples(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$ApiDataRow { - clicks: number; - ctr: number; - impressions: number; - keys: string[]; - position: number; -} -export interface Schema$ApiDimensionFilter { - dimension: string; - expression: string; - operator: string; -} -export interface Schema$ApiDimensionFilterGroup { - filters: Schema$ApiDimensionFilter[]; - groupType: string; -} -export interface Schema$SearchAnalyticsQueryRequest { - /** - * [Optional; Default is "auto"] How data is aggregated. If - * aggregated by property, all data for the same property is aggregated; if - * aggregated by page, all data is aggregated by canonical URI. If you filter - * or group by page, choose AUTO; otherwise you can aggregate either by - * property or by page, depending on how you want your data calculated; see - * the help documentation to learn how data is calculated differently by site - * versus by page. Note: If you group or filter by page, you cannot aggregate - * by property. If you specify any value other than AUTO, the aggregation - * type in the result will match the requested type, or if you request an - * invalid type, you will get an error. The API will never change your - * aggregation type if the requested type is invalid. - */ - aggregationType: string; - /** - * [Optional] Zero or more filters to apply to the dimension grouping values; - * for example, 'query contains "buy"' to see only data - * where the query string contains the substring "buy" (not - * case-sensitive). You can filter by a dimension without grouping by it. - */ - dimensionFilterGroups: Schema$ApiDimensionFilterGroup[]; - /** - * [Optional] Zero or more dimensions to group results by. Dimensions are the - * group-by values in the Search Analytics page. Dimensions are combined to - * create a unique row key for each row. Results are grouped in the order that - * you supply these dimensions. - */ - dimensions: string[]; - /** - * [Required] End date of the requested date range, in YYYY-MM-DD format, in - * PST (UTC - 8:00). Must be greater than or equal to the start date. This - * value is included in the range. - */ - endDate: string; - /** - * [Optional; Default is 1000] The maximum number of rows to return. Must be a - * number from 1 to 5,000 (inclusive). - */ - rowLimit: number; - /** - * [Optional; Default is "web"] The search type to filter for. - */ - searchType: string; - /** - * [Required] Start date of the requested date range, in YYYY-MM-DD format, in - * PST time (UTC - 8:00). Must be less than or equal to the end date. This - * value is included in the range. - */ - startDate: string; - /** - * [Optional; Default is 0] Zero-based index of the first row in the response. - * Must be a non-negative number. - */ - startRow: number; -} -/** - * A list of rows, one per result, grouped by key. Metrics in each row are - * aggregated for all data grouped by that key either by page or property, as - * specified by the aggregation type parameter. - */ -export interface Schema$SearchAnalyticsQueryResponse { - /** - * How the results were aggregated. - */ - responseAggregationType: string; - /** - * A list of rows grouped by the key values in the order given in the query. - */ - rows: Schema$ApiDataRow[]; -} -/** - * List of sitemaps. - */ -export interface Schema$SitemapsListResponse { - /** - * Contains detailed information about a specific URL submitted as a sitemap. - */ - sitemap: Schema$WmxSitemap[]; -} -/** - * List of sites with access level information. - */ -export interface Schema$SitesListResponse { - /** - * Contains permission level information about a Search Console site. For more - * information, see Permissions in Search Console. - */ - siteEntry: Schema$WmxSite[]; -} -/** - * An entry in a URL crawl errors time series. - */ -export interface Schema$UrlCrawlErrorCount { + export interface Schema$ApiDataRow { + clicks: number; + ctr: number; + impressions: number; + keys: string[]; + position: number; + } + export interface Schema$ApiDimensionFilter { + dimension: string; + expression: string; + operator: string; + } + export interface Schema$ApiDimensionFilterGroup { + filters: Schema$ApiDimensionFilter[]; + groupType: string; + } + export interface Schema$SearchAnalyticsQueryRequest { + /** + * [Optional; Default is "auto"] How data is aggregated. If + * aggregated by property, all data for the same property is aggregated; if + * aggregated by page, all data is aggregated by canonical URI. If you + * filter or group by page, choose AUTO; otherwise you can aggregate either + * by property or by page, depending on how you want your data calculated; + * see the help documentation to learn how data is calculated differently + * by site versus by page. Note: If you group or filter by page, you cannot + * aggregate by property. If you specify any value other than AUTO, the + * aggregation type in the result will match the requested type, or if you + * request an invalid type, you will get an error. The API will never change + * your aggregation type if the requested type is invalid. + */ + aggregationType: string; + /** + * [Optional] Zero or more filters to apply to the dimension grouping + * values; for example, 'query contains "buy"' to see only + * data where the query string contains the substring "buy" (not + * case-sensitive). You can filter by a dimension without grouping by it. + */ + dimensionFilterGroups: Schema$ApiDimensionFilterGroup[]; + /** + * [Optional] Zero or more dimensions to group results by. Dimensions are + * the group-by values in the Search Analytics page. Dimensions are combined + * to create a unique row key for each row. Results are grouped in the order + * that you supply these dimensions. + */ + dimensions: string[]; + /** + * [Required] End date of the requested date range, in YYYY-MM-DD format, in + * PST (UTC - 8:00). Must be greater than or equal to the start date. This + * value is included in the range. + */ + endDate: string; + /** + * [Optional; Default is 1000] The maximum number of rows to return. Must be + * a number from 1 to 5,000 (inclusive). + */ + rowLimit: number; + /** + * [Optional; Default is "web"] The search type to filter for. + */ + searchType: string; + /** + * [Required] Start date of the requested date range, in YYYY-MM-DD format, + * in PST time (UTC - 8:00). Must be less than or equal to the end date. + * This value is included in the range. + */ + startDate: string; + /** + * [Optional; Default is 0] Zero-based index of the first row in the + * response. Must be a non-negative number. + */ + startRow: number; + } /** - * The error count at the given timestamp. + * A list of rows, one per result, grouped by key. Metrics in each row are + * aggregated for all data grouped by that key either by page or property, as + * specified by the aggregation type parameter. */ - count: string; + export interface Schema$SearchAnalyticsQueryResponse { + /** + * How the results were aggregated. + */ + responseAggregationType: string; + /** + * A list of rows grouped by the key values in the order given in the query. + */ + rows: Schema$ApiDataRow[]; + } /** - * The date and time when the crawl attempt took place, in RFC 3339 format. + * List of sitemaps. */ - timestamp: string; -} -/** - * Number of errors per day for a specific error type (defined by platform and - * category). - */ -export interface Schema$UrlCrawlErrorCountsPerType { + export interface Schema$SitemapsListResponse { + /** + * Contains detailed information about a specific URL submitted as a + * sitemap. + */ + sitemap: Schema$WmxSitemap[]; + } /** - * The crawl error type. + * List of sites with access level information. */ - category: string; + export interface Schema$SitesListResponse { + /** + * Contains permission level information about a Search Console site. For + * more information, see Permissions in Search Console. + */ + siteEntry: Schema$WmxSite[]; + } /** - * The error count entries time series. + * An entry in a URL crawl errors time series. */ - entries: Schema$UrlCrawlErrorCount[]; + export interface Schema$UrlCrawlErrorCount { + /** + * The error count at the given timestamp. + */ + count: string; + /** + * The date and time when the crawl attempt took place, in RFC 3339 format. + */ + timestamp: string; + } /** - * The general type of Googlebot that made the request (see list of Googlebot - * user-agents for the user-agents used). + * Number of errors per day for a specific error type (defined by platform and + * category). */ - platform: string; -} -/** - * A time series of the number of URL crawl errors per error category and - * platform. - */ -export interface Schema$UrlCrawlErrorsCountsQueryResponse { + export interface Schema$UrlCrawlErrorCountsPerType { + /** + * The crawl error type. + */ + category: string; + /** + * The error count entries time series. + */ + entries: Schema$UrlCrawlErrorCount[]; + /** + * The general type of Googlebot that made the request (see list of + * Googlebot user-agents for the user-agents used). + */ + platform: string; + } /** - * The time series of the number of URL crawl errors per error category and + * A time series of the number of URL crawl errors per error category and * platform. */ - countPerTypes: Schema$UrlCrawlErrorCountsPerType[]; -} -/** - * Contains information about specific crawl errors. - */ -export interface Schema$UrlCrawlErrorsSample { - /** - * The time the error was first detected, in RFC 3339 format. - */ - first_detected: string; - /** - * The time when the URL was last crawled, in RFC 3339 format. - */ - last_crawled: string; + export interface Schema$UrlCrawlErrorsCountsQueryResponse { + /** + * The time series of the number of URL crawl errors per error category and + * platform. + */ + countPerTypes: Schema$UrlCrawlErrorCountsPerType[]; + } /** - * The URL of an error, relative to the site. + * Contains information about specific crawl errors. */ - pageUrl: string; + export interface Schema$UrlCrawlErrorsSample { + /** + * The time the error was first detected, in RFC 3339 format. + */ + first_detected: string; + /** + * The time when the URL was last crawled, in RFC 3339 format. + */ + last_crawled: string; + /** + * The URL of an error, relative to the site. + */ + pageUrl: string; + /** + * The HTTP response code, if any. + */ + responseCode: number; + /** + * Additional details about the URL, set only when calling get(). + */ + urlDetails: Schema$UrlSampleDetails; + } /** - * The HTTP response code, if any. + * List of crawl error samples. */ - responseCode: number; + export interface Schema$UrlCrawlErrorsSamplesListResponse { + /** + * Information about the sample URL and its crawl error. + */ + urlCrawlErrorSample: Schema$UrlCrawlErrorsSample[]; + } /** * Additional details about the URL, set only when calling get(). */ - urlDetails: Schema$UrlSampleDetails; -} -/** - * List of crawl error samples. - */ -export interface Schema$UrlCrawlErrorsSamplesListResponse { - /** - * Information about the sample URL and its crawl error. - */ - urlCrawlErrorSample: Schema$UrlCrawlErrorsSample[]; -} -/** - * Additional details about the URL, set only when calling get(). - */ -export interface Schema$UrlSampleDetails { - /** - * List of sitemaps pointing at this URL. - */ - containingSitemaps: string[]; - /** - * A sample set of URLs linking to this URL. - */ - linkedFromUrls: string[]; -} -/** - * Contains permission level information about a Search Console site. For more - * information, see Permissions in Search Console. - */ -export interface Schema$WmxSite { - /** - * The user's permission level for the site. - */ - permissionLevel: string; - /** - * The URL of the site. - */ - siteUrl: string; -} -/** - * Contains detailed information about a specific URL submitted as a sitemap. - */ -export interface Schema$WmxSitemap { - /** - * The various content types in the sitemap. - */ - contents: Schema$WmxSitemapContent[]; - /** - * Number of errors in the sitemap. These are issues with the sitemap itself - * that need to be fixed before it can be processed correctly. - */ - errors: string; - /** - * If true, the sitemap has not been processed. - */ - isPending: boolean; - /** - * If true, the sitemap is a collection of sitemaps. - */ - isSitemapsIndex: boolean; - /** - * Date & time in which this sitemap was last downloaded. Date format is - * in RFC 3339 format (yyyy-mm-dd). - */ - lastDownloaded: string; - /** - * Date & time in which this sitemap was submitted. Date format is in RFC - * 3339 format (yyyy-mm-dd). - */ - lastSubmitted: string; - /** - * The url of the sitemap. - */ - path: string; - /** - * The type of the sitemap. For example: rssFeed. - */ - type: string; - /** - * Number of warnings for the sitemap. These are generally non-critical issues - * with URLs in the sitemaps. - */ - warnings: string; -} -/** - * Information about the various content types in the sitemap. - */ -export interface Schema$WmxSitemapContent { + export interface Schema$UrlSampleDetails { + /** + * List of sitemaps pointing at this URL. + */ + containingSitemaps: string[]; + /** + * A sample set of URLs linking to this URL. + */ + linkedFromUrls: string[]; + } /** - * The number of URLs from the sitemap that were indexed (of the content - * type). + * Contains permission level information about a Search Console site. For more + * information, see Permissions in Search Console. */ - indexed: string; + export interface Schema$WmxSite { + /** + * The user's permission level for the site. + */ + permissionLevel: string; + /** + * The URL of the site. + */ + siteUrl: string; + } /** - * The number of URLs in the sitemap (of the content type). + * Contains detailed information about a specific URL submitted as a sitemap. */ - submitted: string; + export interface Schema$WmxSitemap { + /** + * The various content types in the sitemap. + */ + contents: Schema$WmxSitemapContent[]; + /** + * Number of errors in the sitemap. These are issues with the sitemap itself + * that need to be fixed before it can be processed correctly. + */ + errors: string; + /** + * If true, the sitemap has not been processed. + */ + isPending: boolean; + /** + * If true, the sitemap is a collection of sitemaps. + */ + isSitemapsIndex: boolean; + /** + * Date & time in which this sitemap was last downloaded. Date format is + * in RFC 3339 format (yyyy-mm-dd). + */ + lastDownloaded: string; + /** + * Date & time in which this sitemap was submitted. Date format is in + * RFC 3339 format (yyyy-mm-dd). + */ + lastSubmitted: string; + /** + * The url of the sitemap. + */ + path: string; + /** + * The type of the sitemap. For example: rssFeed. + */ + type: string; + /** + * Number of warnings for the sitemap. These are generally non-critical + * issues with URLs in the sitemaps. + */ + warnings: string; + } /** - * The specific type of content in this sitemap. For example: web. + * Information about the various content types in the sitemap. */ - type: string; -} - -export class Resource$Searchanalytics { - root: Webmasters; - constructor(root: Webmasters) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$WmxSitemapContent { + /** + * The number of URLs from the sitemap that were indexed (of the content + * type). + */ + indexed: string; + /** + * The number of URLs in the sitemap (of the content type). + */ + submitted: string; + /** + * The specific type of content in this sitemap. For example: web. + */ + type: string; } - - /** - * webmasters.searchanalytics.query - * @desc Query your data with filters and parameters that you define. Returns - * zero or more rows grouped by the row keys that you define. You must define - * a date range of one or more days. When date is one of the group by values, - * any days without data are omitted from the result list. If you need to know - * which days have data, issue a broad date range query grouped by date for - * any metric, and see which day rows are returned. - * @alias webmasters.searchanalytics.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {().SearchAnalyticsQueryRequest} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - query( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Searchanalytics { + root: Webmasters; + constructor(root: Webmasters) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/webmasters/v3/sites/{siteUrl}/searchAnalytics/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Sitemaps { - root: Webmasters; - constructor(root: Webmasters) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * webmasters.searchanalytics.query + * @desc Query your data with filters and parameters that you define. + * Returns zero or more rows grouped by the row keys that you define. You + * must define a date range of one or more days. When date is one of the + * group by values, any days without data are omitted from the result list. + * If you need to know which days have data, issue a broad date range query + * grouped by date for any metric, and see which day rows are returned. + * @alias webmasters.searchanalytics.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {().SearchAnalyticsQueryRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + query( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/searchAnalytics/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * webmasters.sitemaps.delete - * @desc Deletes a sitemap from this site. - * @alias webmasters.sitemaps.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.feedpath The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Sitemaps { + root: Webmasters; + constructor(root: Webmasters) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['siteUrl', 'feedpath'], - pathParams: ['feedpath', 'siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * webmasters.sitemaps.get - * @desc Retrieves information about a specific sitemap. - * @alias webmasters.sitemaps.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.feedpath The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl', 'feedpath'], - pathParams: ['feedpath', 'siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * webmasters.sitemaps.delete + * @desc Deletes a sitemap from this site. + * @alias webmasters.sitemaps.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.feedpath The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['siteUrl', 'feedpath'], + pathParams: ['feedpath', 'siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * webmasters.sitemaps.list - * @desc Lists the sitemaps-entries submitted for this site, or included in - * the sitemap index file (if sitemapIndex is specified in the request). - * @alias webmasters.sitemaps.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.sitemapIndex A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * webmasters.sitemaps.get + * @desc Retrieves information about a specific sitemap. + * @alias webmasters.sitemaps.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.feedpath The URL of the actual sitemap. For example: http://www.example.com/sitemap.xml + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl', 'feedpath'], + pathParams: ['feedpath', 'siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webmasters/v3/sites/{siteUrl}/sitemaps') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * webmasters.sitemaps.submit - * @desc Submits a sitemap for a site. - * @alias webmasters.sitemaps.submit - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.feedpath The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - submit(params?: any, options?: MethodOptions): AxiosPromise; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - submit( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * webmasters.sitemaps.list + * @desc Lists the sitemaps-entries submitted for this site, or included in + * the sitemap index file (if sitemapIndex is specified in the request). + * @alias webmasters.sitemaps.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.sitemapIndex A URL of a site's sitemap index. For example: http://www.example.com/sitemapindex.xml + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webmasters/v3/sites/{siteUrl}/sitemaps') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: - (rootUrl + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['siteUrl', 'feedpath'], - pathParams: ['feedpath', 'siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Sites { - root: Webmasters; - constructor(root: Webmasters) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * webmasters.sitemaps.submit + * @desc Submits a sitemap for a site. + * @alias webmasters.sitemaps.submit + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.feedpath The URL of the sitemap to add. For example: http://www.example.com/sitemap.xml + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + submit(params?: any, options?: MethodOptions): AxiosPromise; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + submit( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['siteUrl', 'feedpath'], + pathParams: ['feedpath', 'siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * webmasters.sites.add - * @desc Adds a site to the set of the user's sites in Search Console. - * @alias webmasters.sites.add - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.siteUrl The URL of the site to add. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - add(params?: any, options?: MethodOptions): AxiosPromise; - add(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - add(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Sites { + root: Webmasters; + constructor(root: Webmasters) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * webmasters.sites.delete - * @desc Removes a site from the set of the user's Search Console sites. - * @alias webmasters.sites.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.siteUrl The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * webmasters.sites.add + * @desc Adds a site to the set of the user's sites in Search Console. + * @alias webmasters.sites.add + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.siteUrl The URL of the site to add. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + add(params?: any, options?: MethodOptions): AxiosPromise; + add(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + add(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * webmasters.sites.get - * @desc Retrieves information about specific site. - * @alias webmasters.sites.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.siteUrl The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * webmasters.sites.delete + * @desc Removes a site from the set of the user's Search Console sites. + * @alias webmasters.sites.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.siteUrl The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * webmasters.sites.list - * @desc Lists the user's Search Console sites. - * @alias webmasters.sites.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * webmasters.sites.get + * @desc Retrieves information about specific site. + * @alias webmasters.sites.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.siteUrl The URI of the property as defined in Search Console. Examples: http://www.example.com/ or android-app://com.example/ Note: for property-sets, use the URI that starts with sc-set: which is used in Search Console URLs. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webmasters/v3/sites/{siteUrl}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/webmasters/v3/sites') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Urlcrawlerrorscounts { - root: Webmasters; - constructor(root: Webmasters) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * webmasters.sites.list + * @desc Lists the user's Search Console sites. + * @alias webmasters.sites.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/webmasters/v3/sites') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * webmasters.urlcrawlerrorscounts.query - * @desc Retrieves a time series of the number of URL crawl errors per error - * category and platform. - * @alias webmasters.urlcrawlerrorscounts.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.category The crawl error category. For example: serverError. If not specified, returns results for all categories. - * @param {boolean=} params.latestCountsOnly If true, returns only the latest crawl error counts. - * @param {string=} params.platform The user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms. - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Urlcrawlerrorscounts { + root: Webmasters; + constructor(root: Webmasters) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsCounts/query') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Urlcrawlerrorssamples { - root: Webmasters; - constructor(root: Webmasters) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * webmasters.urlcrawlerrorscounts.query + * @desc Retrieves a time series of the number of URL crawl errors per error + * category and platform. + * @alias webmasters.urlcrawlerrorscounts.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.category The crawl error category. For example: serverError. If not specified, returns results for all categories. + * @param {boolean=} params.latestCountsOnly If true, returns only the latest crawl error counts. + * @param {string=} params.platform The user agent type (platform) that made the request. For example: web. If not specified, returns results for all platforms. + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + query( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsCounts/query') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } } - - /** - * webmasters.urlcrawlerrorssamples.get - * @desc Retrieves details about crawl errors for a site's sample URL. - * @alias webmasters.urlcrawlerrorssamples.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.category The crawl error category. For example: authPermissions - * @param {string} params.platform The user agent type (platform) that made the request. For example: web - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {string} params.url The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, - options?: MethodOptions): AxiosPromise; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Urlcrawlerrorssamples { + root: Webmasters; + constructor(root: Webmasters) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl', 'url', 'category', 'platform'], - pathParams: ['siteUrl', 'url'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * webmasters.urlcrawlerrorssamples.list - * @desc Lists a site's sample URLs for the specified crawl error category and - * platform. - * @alias webmasters.urlcrawlerrorssamples.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.category The crawl error category. For example: authPermissions - * @param {string} params.platform The user agent type (platform) that made the request. For example: web - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['siteUrl', 'category', 'platform'], - pathParams: ['siteUrl'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); + /** + * webmasters.urlcrawlerrorssamples.get + * @desc Retrieves details about crawl errors for a site's sample URL. + * @alias webmasters.urlcrawlerrorssamples.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.category The crawl error category. For example: authPermissions + * @param {string} params.platform The user agent type (platform) that made the request. For example: web + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {string} params.url The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, + options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl', 'url', 'category', 'platform'], + pathParams: ['siteUrl', 'url'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * webmasters.urlcrawlerrorssamples.markAsFixed - * @desc Marks the provided site's sample URL as fixed, and removes it from - * the samples list. - * @alias webmasters.urlcrawlerrorssamples.markAsFixed - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.category The crawl error category. For example: authPermissions - * @param {string} params.platform The user agent type (platform) that made the request. For example: web - * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ - * @param {string} params.url The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - markAsFixed(params?: any, options?: MethodOptions): AxiosPromise; - markAsFixed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - markAsFixed( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * webmasters.urlcrawlerrorssamples.list + * @desc Lists a site's sample URLs for the specified crawl error category + * and platform. + * @alias webmasters.urlcrawlerrorssamples.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.category The crawl error category. For example: authPermissions + * @param {string} params.platform The user agent type (platform) that made the request. For example: web + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + + '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['siteUrl', 'category', 'platform'], + pathParams: ['siteUrl'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + - '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['siteUrl', 'url', 'category', 'platform'], - pathParams: ['siteUrl', 'url'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * webmasters.urlcrawlerrorssamples.markAsFixed + * @desc Marks the provided site's sample URL as fixed, and removes it from + * the samples list. + * @alias webmasters.urlcrawlerrorssamples.markAsFixed + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.category The crawl error category. For example: authPermissions + * @param {string} params.platform The user agent type (platform) that made the request. For example: web + * @param {string} params.siteUrl The site's URL, including protocol. For example: http://www.example.com/ + * @param {string} params.url The relative path (without the site) of the sample URL. It must be one of the URLs returned by list(). For example, for the URL https://www.example.com/pagename on the site https://www.example.com/, the url value is pagename + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + markAsFixed(params?: any, options?: MethodOptions): AxiosPromise; + markAsFixed( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + markAsFixed( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: + (rootUrl + + '/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['siteUrl', 'url', 'category', 'platform'], + pathParams: ['siteUrl', 'url'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/websecurityscanner/v1alpha.ts b/src/apis/websecurityscanner/v1alpha.ts new file mode 100644 index 00000000000..ef951d42bc3 --- /dev/null +++ b/src/apis/websecurityscanner/v1alpha.ts @@ -0,0 +1,1282 @@ +/** + * Copyright 2015 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {AxiosPromise} from 'axios'; + +import {GoogleApis} from '../..'; +import {BodyResponseCallback, GlobalOptions, MethodOptions} from '../../lib/api'; +import {createAPIRequest} from '../../lib/apirequest'; + +// TODO: We will eventually get the `any` in here cleared out, but in the +// interim we want to turn on no-implicit-any. + +// tslint:disable: no-any +// tslint:disable: class-name +// tslint:disable: variable-name +// tslint:disable: jsdoc-format +// tslint:disable: no-namespace + +export namespace websecurityscanner_v1alpha { + /** + * Web Security Scanner API + * + * Web Security Scanner API (under development). + * + * @example + * const google = require('googleapis'); + * const websecurityscanner = google.websecurityscanner('v1alpha'); + * + * @namespace websecurityscanner + * @type {Function} + * @version v1alpha + * @variation v1alpha + * @param {object=} options Options for Websecurityscanner + */ + export class Websecurityscanner { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + projects: Resource$Projects; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.projects = new Resource$Projects(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Scan authentication configuration. + */ + export interface Schema$Authentication { + /** + * Authentication using a custom account. + */ + customAccount: Schema$CustomAccount; + /** + * Authentication using a Google account. + */ + googleAccount: Schema$GoogleAccount; + } + /** + * A CrawledUrl resource represents a URL that was crawled during a ScanRun. + * Web Security Scanner Service crawls the web applications, following all + * links within the scope of sites, to find the URLs to test against. + */ + export interface Schema$CrawledUrl { + /** + * Output only. The body of the request that was used to visit the URL. + */ + body: string; + /** + * Output only. The http method of the request that was used to visit the + * URL, in uppercase. + */ + httpMethod: string; + /** + * Output only. The URL that was crawled. + */ + url: string; + } + /** + * Describes authentication configuration that uses a custom account. + */ + export interface Schema$CustomAccount { + /** + * Required. The login form URL of the website. + */ + loginUrl: string; + /** + * Input only. Required. The password of the custom account. The credential + * is stored encrypted and not returned in any response. + */ + password: string; + /** + * Required. The user name of the custom account. + */ + username: string; + } + /** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * A Finding resource represents a vulnerability instance identified during a + * ScanRun. + */ + export interface Schema$Finding { + /** + * Output only. The body of the request that triggered the vulnerability. + */ + body: string; + /** + * Output only. The description of the vulnerability. + */ + description: string; + /** + * Output only. The URL where the browser lands when the vulnerability is + * detected. + */ + finalUrl: string; + /** + * Output only. The type of the Finding. + */ + findingType: string; + /** + * Output only. If the vulnerability was originated from nested IFrame, the + * immediate parent IFrame is reported. + */ + frameUrl: string; + /** + * Output only. The URL produced by the server-side fuzzer and used in the + * request that triggered the vulnerability. + */ + fuzzedUrl: string; + /** + * Output only. The http method of the request that triggered the + * vulnerability, in uppercase. + */ + httpMethod: string; + /** + * Output only. The resource name of the Finding. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. + * The finding IDs are generated by the system. + */ + name: string; + /** + * Output only. An addon containing information about outdated libraries. + */ + outdatedLibrary: Schema$OutdatedLibrary; + /** + * Output only. The URL containing human-readable payload that user can + * leverage to reproduce the vulnerability. + */ + reproductionUrl: string; + /** + * Output only. The tracking ID uniquely identifies a vulnerability instance + * across multiple ScanRuns. + */ + trackingId: string; + /** + * Output only. An addon containing detailed information regarding any + * resource causing the vulnerability such as JavaScript sources, image, + * audio files, etc. + */ + violatingResource: Schema$ViolatingResource; + /** + * Output only. An addon containing information about request parameters + * which were found to be vulnerable. + */ + vulnerableParameters: Schema$VulnerableParameters; + /** + * Output only. An addon containing information reported for an XSS, if any. + */ + xss: Schema$Xss; + } + /** + * A FindingTypeStats resource represents stats regarding a specific + * FindingType of Findings under a given ScanRun. + */ + export interface Schema$FindingTypeStats { + /** + * Output only. The count of findings belonging to this finding type. + */ + findingCount: number; + /** + * Output only. The finding type associated with the stats. + */ + findingType: string; + } + /** + * Describes authentication configuration that uses a Google account. + */ + export interface Schema$GoogleAccount { + /** + * Input only. Required. The password of the Google account. The credential + * is stored encrypted and not returned in any response. + */ + password: string; + /** + * Required. The user name of the Google account. + */ + username: string; + } + /** + * Response for the `ListCrawledUrls` method. + */ + export interface Schema$ListCrawledUrlsResponse { + /** + * The list of CrawledUrls returned. + */ + crawledUrls: Schema$CrawledUrl[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } + /** + * Response for the `ListFindings` method. + */ + export interface Schema$ListFindingsResponse { + /** + * The list of Findings returned. + */ + findings: Schema$Finding[]; + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + } + /** + * Response for the `ListFindingTypeStats` method. + */ + export interface Schema$ListFindingTypeStatsResponse { + /** + * The list of FindingTypeStats returned. + */ + findingTypeStats: Schema$FindingTypeStats[]; + } + /** + * Response for the `ListScanConfigs` method. + */ + export interface Schema$ListScanConfigsResponse { + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + /** + * The list of ScanConfigs returned. + */ + scanConfigs: Schema$ScanConfig[]; + } + /** + * Response for the `ListScanRuns` method. + */ + export interface Schema$ListScanRunsResponse { + /** + * Token to retrieve the next page of results, or empty if there are no more + * results in the list. + */ + nextPageToken: string; + /** + * The list of ScanRuns returned. + */ + scanRuns: Schema$ScanRun[]; + } + /** + * Information reported for an outdated library. + */ + export interface Schema$OutdatedLibrary { + /** + * URLs to learn more information about the vulnerabilities in the library. + */ + learnMoreUrls: string[]; + /** + * The name of the outdated library. + */ + libraryName: string; + /** + * The version number. + */ + version: string; + } + /** + * A ScanConfig resource contains the configurations to launch a scan. + */ + export interface Schema$ScanConfig { + /** + * The authentication configuration. If specified, service will use the + * authentication configuration during scanning. + */ + authentication: Schema$Authentication; + /** + * The blacklist URL patterns as described in + * https://cloud.google.com/security-scanner/docs/excluded-urls + */ + blacklistPatterns: string[]; + /** + * Required. The user provided display name of the ScanConfig. + */ + displayName: string; + /** + * The maximum QPS during scanning. A valid value ranges from 5 to 20 + * inclusively. If the field is unspecified or its value is set 0, server + * will default to 15. Other values outside of [5, 20] range will be + * rejected with INVALID_ARGUMENT error. + */ + maxQps: number; + /** + * The resource name of the ScanConfig. The name follows the format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig + * IDs are generated by the system. + */ + name: string; + /** + * The schedule of the ScanConfig. + */ + schedule: Schema$Schedule; + /** + * Required. The starting URLs from which the scanner finds site pages. + */ + startingUrls: string[]; + /** + * Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be + * used as a default. + */ + targetPlatforms: string[]; + /** + * The user agent used during scanning. + */ + userAgent: string; + } + /** + * A ScanRun is a output-only resource representing an actual run of the scan. + */ + export interface Schema$ScanRun { + /** + * Output only. The time at which the ScanRun reached termination state - + * that the ScanRun is either finished or stopped by user. + */ + endTime: string; + /** + * Output only. The execution state of the ScanRun. + */ + executionState: string; + /** + * Output only. Whether the scan run has found any vulnerabilities. + */ + hasVulnerabilities: boolean; + /** + * Output only. The resource name of the ScanRun. The name follows the + * format of + * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * The ScanRun IDs are generated by the system. + */ + name: string; + /** + * Output only. The percentage of total completion ranging from 0 to 100. If + * the scan is in queue, the value is 0. If the scan is running, the value + * ranges from 0 to 100. If the scan is finished, the value is 100. + */ + progressPercent: number; + /** + * Output only. The result state of the ScanRun. This field is only + * available after the execution state reaches "FINISHED". + */ + resultState: string; + /** + * Output only. The time at which the ScanRun started. + */ + startTime: string; + /** + * Output only. The number of URLs crawled during this ScanRun. If the scan + * is in progress, the value represents the number of URLs crawled up to + * now. + */ + urlsCrawledCount: string; + /** + * Output only. The number of URLs tested during this ScanRun. If the scan + * is in progress, the value represents the number of URLs tested up to now. + * The number of URLs tested is usually larger than the number URLS crawled + * because typically a crawled URL is tested with multiple test payloads. + */ + urlsTestedCount: string; + } + /** + * Scan schedule configuration. + */ + export interface Schema$Schedule { + /** + * Required. The duration of time between executions in days. + */ + intervalDurationDays: number; + /** + * A timestamp indicates when the next run will be scheduled. The value is + * refreshed by the server after each run. If unspecified, it will default + * to current server time, which means the scan will be scheduled to start + * immediately. + */ + scheduleTime: string; + } + /** + * Request for the `StartScanRun` method. + */ + export interface Schema$StartScanRunRequest {} + /** + * Request for the `StopScanRun` method. + */ + export interface Schema$StopScanRunRequest {} + /** + * Information regarding any resource causing the vulnerability such as + * JavaScript sources, image, audio files, etc. + */ + export interface Schema$ViolatingResource { + /** + * The MIME type of this resource. + */ + contentType: string; + /** + * URL of this violating resource. + */ + resourceUrl: string; + } + /** + * Information about vulnerable request parameters. + */ + export interface Schema$VulnerableParameters { + /** + * The vulnerable parameter names. + */ + parameterNames: string[]; + } + /** + * Information reported for an XSS. + */ + export interface Schema$Xss { + /** + * An error message generated by a javascript breakage. + */ + errorMessage: string; + /** + * Stack traces leading to the point where the XSS occurred. + */ + stackTraces: string[]; + } + + export class Resource$Projects { + root: Websecurityscanner; + scanConfigs: Resource$Projects$Scanconfigs; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + this.scanConfigs = new Resource$Projects$Scanconfigs(root); + } + + getRoot() { + return this.root; + } + } + export class Resource$Projects$Scanconfigs { + root: Websecurityscanner; + scanRuns: Resource$Projects$Scanconfigs$Scanruns; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + this.scanRuns = new Resource$Projects$Scanconfigs$Scanruns(root); + } + + getRoot() { + return this.root; + } + + + /** + * websecurityscanner.projects.scanConfigs.create + * @desc Creates a new ScanConfig. + * @alias websecurityscanner.projects.scanConfigs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource name where the scan is created, which should be a project resource name in the format 'projects/{projectId}'. + * @param {().ScanConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): + AxiosPromise; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/scanConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.delete + * @desc Deletes an existing ScanConfig and its child resources. + * @alias websecurityscanner.projects.scanConfigs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the ScanConfig to be deleted. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.get + * @desc Gets a ScanConfig. + * @alias websecurityscanner.projects.scanConfigs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the ScanConfig to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.list + * @desc Lists ScanConfigs under a given project. + * @alias websecurityscanner.projects.scanConfigs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of ScanConfigs to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value. + * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous List request. If unspecified, the first page of results is returned. + * @param {string} params.parent Required. The parent resource name, which should be a project resource name in the format 'projects/{projectId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/scanConfigs') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.patch + * @desc Updates a ScanConfig. This method support partial update of a + * ScanConfig. + * @alias websecurityscanner.projects.scanConfigs.patch + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name The resource name of the ScanConfig. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are generated by the system. + * @param {string=} params.updateMask Required. The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {().ScanConfig} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + patch(params?: any, options?: MethodOptions): + AxiosPromise; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + patch( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.start + * @desc Start a ScanRun according to the given ScanConfig. + * @alias websecurityscanner.projects.scanConfigs.start + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the ScanConfig to be used. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {().StartScanRunRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + start(params?: any, options?: MethodOptions): AxiosPromise; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + start( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}:start') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Projects$Scanconfigs$Scanruns { + root: Websecurityscanner; + crawledUrls: Resource$Projects$Scanconfigs$Scanruns$Crawledurls; + findings: Resource$Projects$Scanconfigs$Scanruns$Findings; + findingTypeStats: Resource$Projects$Scanconfigs$Scanruns$Findingtypestats; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + this.crawledUrls = + new Resource$Projects$Scanconfigs$Scanruns$Crawledurls(root); + this.findings = new Resource$Projects$Scanconfigs$Scanruns$Findings(root); + this.findingTypeStats = + new Resource$Projects$Scanconfigs$Scanruns$Findingtypestats(root); + } + + getRoot() { + return this.root; + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.get + * @desc Gets a ScanRun. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the ScanRun to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.list + * @desc Lists ScanRuns under a given ScanConfig, in descending order of + * ScanRun stop time. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of ScanRuns to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value. + * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous List request. If unspecified, the first page of results is returned. + * @param {string} params.parent Required. The parent resource name, which should be a scan resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/scanRuns') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.stop + * @desc Stops a ScanRun. The stopped ScanRun is returned. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.stop + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the ScanRun to be stopped. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {().StopScanRunRequest} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + stop(params?: any, options?: MethodOptions): AxiosPromise; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + stop( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}:stop') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + export class Resource$Projects$Scanconfigs$Scanruns$Crawledurls { + root: Websecurityscanner; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list + * @desc List CrawledUrls under a given ScanRun. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.crawledUrls.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {integer=} params.pageSize The maximum number of CrawledUrls to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value. + * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous List request. If unspecified, the first page of results is returned. + * @param {string} params.parent Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/crawledUrls') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects$Scanconfigs$Scanruns$Findings { + root: Websecurityscanner; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.findings.get + * @desc Gets a Finding. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.name Required. The resource name of the Finding to be returned. The name follows the format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.findings.list + * @desc List Findings under a given ScanRun. + * @alias websecurityscanner.projects.scanConfigs.scanRuns.findings.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The filter expression. The expression must be in the format: . Supported field: 'finding_type'. Supported operator: '='. + * @param {integer=} params.pageSize The maximum number of Findings to return, can be limited by server. If not specified or not positive, the implementation will select a reasonable value. + * @param {string=} params.pageToken A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous List request. If unspecified, the first page of results is returned. + * @param {string} params.parent Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/findings') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Projects$Scanconfigs$Scanruns$Findingtypestats { + root: Websecurityscanner; + constructor(root: Websecurityscanner) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list + * @desc List all FindingTypeStats under a given ScanRun. + * @alias + * websecurityscanner.projects.scanConfigs.scanRuns.findingTypeStats.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.parent Required. The parent resource name, which should be a scan run resource name in the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://websecurityscanner.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1alpha/{+parent}/findingTypeStats') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } +} diff --git a/src/apis/youtube/v3.ts b/src/apis/youtube/v3.ts index 0ffb8ed5cbf..fec80472a6f 100644 --- a/src/apis/youtube/v3.ts +++ b/src/apis/youtube/v3.ts @@ -27,9472 +27,9548 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * YouTube Data API - * - * Supports core YouTube features, such as uploading videos, creating and - * managing playlists, searching for content, and much more. - * - * @example - * const google = require('googleapis'); - * const youtube = google.youtube('v3'); - * - * @namespace youtube - * @type {Function} - * @version v3 - * @variation v3 - * @param {object=} options Options for Youtube - */ -export class Youtube { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - activities: Resource$Activities; - captions: Resource$Captions; - channelBanners: Resource$Channelbanners; - channels: Resource$Channels; - channelSections: Resource$Channelsections; - comments: Resource$Comments; - commentThreads: Resource$Commentthreads; - fanFundingEvents: Resource$Fanfundingevents; - guideCategories: Resource$Guidecategories; - i18nLanguages: Resource$I18nlanguages; - i18nRegions: Resource$I18nregions; - liveBroadcasts: Resource$Livebroadcasts; - liveChatBans: Resource$Livechatbans; - liveChatMessages: Resource$Livechatmessages; - liveChatModerators: Resource$Livechatmoderators; - liveStreams: Resource$Livestreams; - playlistItems: Resource$Playlistitems; - playlists: Resource$Playlists; - search: Resource$Search; - sponsors: Resource$Sponsors; - subscriptions: Resource$Subscriptions; - superChatEvents: Resource$Superchatevents; - thumbnails: Resource$Thumbnails; - videoAbuseReportReasons: Resource$Videoabusereportreasons; - videoCategories: Resource$Videocategories; - videos: Resource$Videos; - watermarks: Resource$Watermarks; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.activities = new Resource$Activities(this); - this.captions = new Resource$Captions(this); - this.channelBanners = new Resource$Channelbanners(this); - this.channels = new Resource$Channels(this); - this.channelSections = new Resource$Channelsections(this); - this.comments = new Resource$Comments(this); - this.commentThreads = new Resource$Commentthreads(this); - this.fanFundingEvents = new Resource$Fanfundingevents(this); - this.guideCategories = new Resource$Guidecategories(this); - this.i18nLanguages = new Resource$I18nlanguages(this); - this.i18nRegions = new Resource$I18nregions(this); - this.liveBroadcasts = new Resource$Livebroadcasts(this); - this.liveChatBans = new Resource$Livechatbans(this); - this.liveChatMessages = new Resource$Livechatmessages(this); - this.liveChatModerators = new Resource$Livechatmoderators(this); - this.liveStreams = new Resource$Livestreams(this); - this.playlistItems = new Resource$Playlistitems(this); - this.playlists = new Resource$Playlists(this); - this.search = new Resource$Search(this); - this.sponsors = new Resource$Sponsors(this); - this.subscriptions = new Resource$Subscriptions(this); - this.superChatEvents = new Resource$Superchatevents(this); - this.thumbnails = new Resource$Thumbnails(this); - this.videoAbuseReportReasons = new Resource$Videoabusereportreasons(this); - this.videoCategories = new Resource$Videocategories(this); - this.videos = new Resource$Videos(this); - this.watermarks = new Resource$Watermarks(this); - } - - getRoot() { - return this.root; - } -} - -/** - * Rights management policy for YouTube resources. - */ -export interface Schema$AccessPolicy { - /** - * The value of allowed indicates whether the access to the policy is allowed - * or denied by default. - */ - allowed: boolean; - /** - * A list of region codes that identify countries where the default policy do - * not apply. - */ - exception: string[]; -} -/** - * An activity resource contains information about an action that a particular - * channel, or user, has taken on YouTube.The actions reported in activity feeds - * include rating a video, sharing a video, marking a video as a favorite, - * commenting on a video, uploading a video, and so forth. Each activity - * resource identifies the type of action, the channel associated with the - * action, and the resource(s) associated with the action, such as the video - * that was rated or uploaded. - */ -export interface Schema$Activity { - /** - * The contentDetails object contains information about the content associated - * with the activity. For example, if the snippet.type value is videoRated, - * then the contentDetails object's content identifies the rated video. - */ - contentDetails: Schema$ActivityContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the activity. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#activity". - */ - kind: string; - /** - * The snippet object contains basic details about the activity, including the - * activity's type and group ID. - */ - snippet: Schema$ActivitySnippet; -} -/** - * Details about the content of an activity: the video that was shared, the - * channel that was subscribed to, etc. - */ -export interface Schema$ActivityContentDetails { - /** - * The bulletin object contains details about a channel bulletin post. This - * object is only present if the snippet.type is bulletin. - */ - bulletin: Schema$ActivityContentDetailsBulletin; - /** - * The channelItem object contains details about a resource which was added to - * a channel. This property is only present if the snippet.type is - * channelItem. - */ - channelItem: Schema$ActivityContentDetailsChannelItem; - /** - * The comment object contains information about a resource that received a - * comment. This property is only present if the snippet.type is comment. - */ - comment: Schema$ActivityContentDetailsComment; - /** - * The favorite object contains information about a video that was marked as a - * favorite video. This property is only present if the snippet.type is - * favorite. - */ - favorite: Schema$ActivityContentDetailsFavorite; - /** - * The like object contains information about a resource that received a - * positive (like) rating. This property is only present if the snippet.type - * is like. - */ - like: Schema$ActivityContentDetailsLike; - /** - * The playlistItem object contains information about a new playlist item. - * This property is only present if the snippet.type is playlistItem. - */ - playlistItem: Schema$ActivityContentDetailsPlaylistItem; - /** - * The promotedItem object contains details about a resource which is being - * promoted. This property is only present if the snippet.type is - * promotedItem. - */ - promotedItem: Schema$ActivityContentDetailsPromotedItem; - /** - * The recommendation object contains information about a recommended - * resource. This property is only present if the snippet.type is - * recommendation. - */ - recommendation: Schema$ActivityContentDetailsRecommendation; - /** - * The social object contains details about a social network post. This - * property is only present if the snippet.type is social. - */ - social: Schema$ActivityContentDetailsSocial; - /** - * The subscription object contains information about a channel that a user - * subscribed to. This property is only present if the snippet.type is - * subscription. - */ - subscription: Schema$ActivityContentDetailsSubscription; - /** - * The upload object contains information about the uploaded video. This - * property is only present if the snippet.type is upload. - */ - upload: Schema$ActivityContentDetailsUpload; -} -/** - * Details about a channel bulletin post. - */ -export interface Schema$ActivityContentDetailsBulletin { - /** - * The resourceId object contains information that identifies the resource - * associated with a bulletin post. - */ - resourceId: Schema$ResourceId; -} -/** - * Details about a resource which was added to a channel. - */ -export interface Schema$ActivityContentDetailsChannelItem { - /** - * The resourceId object contains information that identifies the resource - * that was added to the channel. - */ - resourceId: Schema$ResourceId; -} -/** - * Information about a resource that received a comment. - */ -export interface Schema$ActivityContentDetailsComment { - /** - * The resourceId object contains information that identifies the resource - * associated with the comment. - */ - resourceId: Schema$ResourceId; -} -/** - * Information about a video that was marked as a favorite video. - */ -export interface Schema$ActivityContentDetailsFavorite { - /** - * The resourceId object contains information that identifies the resource - * that was marked as a favorite. - */ - resourceId: Schema$ResourceId; -} -/** - * Information about a resource that received a positive (like) rating. - */ -export interface Schema$ActivityContentDetailsLike { - /** - * The resourceId object contains information that identifies the rated - * resource. - */ - resourceId: Schema$ResourceId; -} -/** - * Information about a new playlist item. - */ -export interface Schema$ActivityContentDetailsPlaylistItem { - /** - * The value that YouTube uses to uniquely identify the playlist. - */ - playlistId: string; - /** - * ID of the item within the playlist. - */ - playlistItemId: string; - /** - * The resourceId object contains information about the resource that was - * added to the playlist. - */ - resourceId: Schema$ResourceId; -} -/** - * Details about a resource which is being promoted. - */ -export interface Schema$ActivityContentDetailsPromotedItem { - /** - * The URL the client should fetch to request a promoted item. - */ - adTag: string; - /** - * The URL the client should ping to indicate that the user clicked through on - * this promoted item. - */ - clickTrackingUrl: string; - /** - * The URL the client should ping to indicate that the user was shown this - * promoted item. - */ - creativeViewUrl: string; - /** - * The type of call-to-action, a message to the user indicating action that - * can be taken. - */ - ctaType: string; - /** - * The custom call-to-action button text. If specified, it will override the - * default button text for the cta_type. - */ - customCtaButtonText: string; - /** - * The text description to accompany the promoted item. - */ - descriptionText: string; - /** - * The URL the client should direct the user to, if the user chooses to visit - * the advertiser's website. - */ - destinationUrl: string; - /** - * The list of forecasting URLs. The client should ping all of these URLs when - * a promoted item is not available, to indicate that a promoted item could - * have been shown. - */ - forecastingUrl: string[]; - /** - * The list of impression URLs. The client should ping all of these URLs to - * indicate that the user was shown this promoted item. - */ - impressionUrl: string[]; - /** - * The ID that YouTube uses to uniquely identify the promoted video. - */ - videoId: string; -} -/** - * Information that identifies the recommended resource. - */ -export interface Schema$ActivityContentDetailsRecommendation { - /** - * The reason that the resource is recommended to the user. - */ - reason: string; - /** - * The resourceId object contains information that identifies the recommended - * resource. - */ - resourceId: Schema$ResourceId; - /** - * The seedResourceId object contains information about the resource that - * caused the recommendation. - */ - seedResourceId: Schema$ResourceId; -} -/** - * Details about a social network post. - */ -export interface Schema$ActivityContentDetailsSocial { - /** - * The author of the social network post. - */ - author: string; - /** - * An image of the post's author. - */ - imageUrl: string; - /** - * The URL of the social network post. - */ - referenceUrl: string; - /** - * The resourceId object encapsulates information that identifies the resource - * associated with a social network post. - */ - resourceId: Schema$ResourceId; - /** - * The name of the social network. - */ - type: string; -} -/** - * Information about a channel that a user subscribed to. - */ -export interface Schema$ActivityContentDetailsSubscription { - /** - * The resourceId object contains information that identifies the resource - * that the user subscribed to. - */ - resourceId: Schema$ResourceId; -} -/** - * Information about the uploaded video. - */ -export interface Schema$ActivityContentDetailsUpload { - /** - * The ID that YouTube uses to uniquely identify the uploaded video. - */ - videoId: string; -} -export interface Schema$ActivityListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of activities, or events, that match the request criteria. - */ - items: Schema$Activity[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#activityListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about an activity, including title, description, thumbnails, - * activity type and group. - */ -export interface Schema$ActivitySnippet { - /** - * The ID that YouTube uses to uniquely identify the channel associated with - * the activity. - */ - channelId: string; - /** - * Channel title for the channel responsible for this activity - */ - channelTitle: string; - /** - * The description of the resource primarily associated with the activity. - */ - description: string; - /** - * The group ID associated with the activity. A group ID identifies user - * events that are associated with the same user and resource. For example, if - * a user rates a video and marks the same video as a favorite, the entries - * for those events would have the same group ID in the user's activity - * feed. In your user interface, you can avoid repetition by grouping events - * with the same groupId value. - */ - groupId: string; - /** - * The date and time that the video was uploaded. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * A map of thumbnail images associated with the resource that is primarily - * associated with the activity. For each object in the map, the key is the - * name of the thumbnail image, and the value is an object that contains other - * information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The title of the resource primarily associated with the activity. - */ - title: string; - /** - * The type of activity that the resource describes. - */ - type: string; -} -/** - * A caption resource represents a YouTube caption track. A caption track is - * associated with exactly one YouTube video. - */ -export interface Schema$Caption { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the caption track. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#caption". - */ - kind: string; - /** - * The snippet object contains basic details about the caption. - */ - snippet: Schema$CaptionSnippet; -} -export interface Schema$CaptionListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of captions that match the request criteria. - */ - items: Schema$Caption[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#captionListResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a caption track, such as its language and name. - */ -export interface Schema$CaptionSnippet { - /** - * The type of audio track associated with the caption track. - */ - audioTrackType: string; - /** - * The reason that YouTube failed to process the caption track. This property - * is only present if the state property's value is failed. - */ - failureReason: string; - /** - * Indicates whether YouTube synchronized the caption track to the audio track - * in the video. The value will be true if a sync was explicitly requested - * when the caption track was uploaded. For example, when calling the - * captions.insert or captions.update methods, you can set the sync parameter - * to true to instruct YouTube to sync the uploaded track to the video. If the - * value is false, YouTube uses the time codes in the uploaded caption track - * to determine when to display captions. - */ - isAutoSynced: boolean; - /** - * Indicates whether the track contains closed captions for the deaf and hard - * of hearing. The default value is false. - */ - isCC: boolean; - /** - * Indicates whether the caption track is a draft. If the value is true, then - * the track is not publicly visible. The default value is false. - */ - isDraft: boolean; - /** - * Indicates whether caption track is formatted for "easy reader," - * meaning it is at a third-grade level for language learners. The default - * value is false. - */ - isEasyReader: boolean; - /** - * Indicates whether the caption track uses large text for the - * vision-impaired. The default value is false. - */ - isLarge: boolean; - /** - * The language of the caption track. The property value is a BCP-47 language - * tag. - */ - language: string; - /** - * The date and time when the caption track was last updated. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - lastUpdated: string; - /** - * The name of the caption track. The name is intended to be visible to the - * user as an option during playback. - */ - name: string; - /** - * The caption track's status. - */ - status: string; - /** - * The caption track's type. - */ - trackKind: string; - /** - * The ID that YouTube uses to uniquely identify the video associated with the - * caption track. - */ - videoId: string; -} -/** - * Brief description of the live stream cdn settings. - */ -export interface Schema$CdnSettings { - /** - * The format of the video stream that you are sending to Youtube. - */ - format: string; - /** - * The frame rate of the inbound video data. - */ - frameRate: string; - /** - * The ingestionInfo object contains information that YouTube provides that - * you need to transmit your RTMP or HTTP stream to YouTube. - */ - ingestionInfo: Schema$IngestionInfo; - /** - * The method or protocol used to transmit the video stream. - */ - ingestionType: string; - /** - * The resolution of the inbound video data. - */ - resolution: string; -} -/** - * A channel resource contains information about a YouTube channel. - */ -export interface Schema$Channel { - /** - * The auditionDetails object encapsulates channel data that is relevant for - * YouTube Partners during the audition process. - */ - auditDetails: Schema$ChannelAuditDetails; - /** - * The brandingSettings object encapsulates information about the branding of - * the channel. - */ - brandingSettings: Schema$ChannelBrandingSettings; - /** - * The contentDetails object encapsulates information about the channel's - * content. - */ - contentDetails: Schema$ChannelContentDetails; - /** - * The contentOwnerDetails object encapsulates channel data that is relevant - * for YouTube Partners linked with the channel. - */ - contentOwnerDetails: Schema$ChannelContentOwnerDetails; - /** - * The conversionPings object encapsulates information about conversion pings - * that need to be respected by the channel. - */ - conversionPings: Schema$ChannelConversionPings; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the channel. - */ - id: string; - /** - * The invideoPromotion object encapsulates information about promotion - * campaign associated with the channel. - */ - invideoPromotion: Schema$InvideoPromotion; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#channel". - */ - kind: string; - /** - * Localizations for different languages - */ - localizations: any; - /** - * The snippet object contains basic details about the channel, such as its - * title, description, and thumbnail images. - */ - snippet: Schema$ChannelSnippet; - /** - * The statistics object encapsulates statistics for the channel. - */ - statistics: Schema$ChannelStatistics; - /** - * The status object encapsulates information about the privacy status of the - * channel. - */ - status: Schema$ChannelStatus; - /** - * The topicDetails object encapsulates information about Freebase topics - * associated with the channel. - */ - topicDetails: Schema$ChannelTopicDetails; -} -/** - * The auditDetails object encapsulates channel data that is relevant for - * YouTube Partners during the audit process. - */ -export interface Schema$ChannelAuditDetails { - /** - * Whether or not the channel respects the community guidelines. - */ - communityGuidelinesGoodStanding: boolean; - /** - * Whether or not the channel has any unresolved claims. - */ - contentIdClaimsGoodStanding: boolean; - /** - * Whether or not the channel has any copyright strikes. - */ - copyrightStrikesGoodStanding: boolean; - /** - * Describes the general state of the channel. This field will always show if - * there are any issues whatsoever with the channel. Currently this field - * represents the result of the logical and operation over the community - * guidelines good standing, the copyright strikes good standing and the - * content ID claims good standing, but this may change in the future. - */ - overallGoodStanding: boolean; -} -/** - * A channel banner returned as the response to a channel_banner.insert call. - */ -export interface Schema$ChannelBannerResource { - /** - * Etag of this resource. - */ - etag: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#channelBannerResource". - */ - kind: string; - /** - * The URL of this banner image. - */ - url: string; -} -/** - * Branding properties of a YouTube channel. - */ -export interface Schema$ChannelBrandingSettings { - /** - * Branding properties for the channel view. - */ - channel: Schema$ChannelSettings; - /** - * Additional experimental branding properties. - */ - hints: Schema$PropertyValue[]; - /** - * Branding properties for branding images. - */ - image: Schema$ImageSettings; - /** - * Branding properties for the watch page. - */ - watch: Schema$WatchSettings; -} -/** - * Details about the content of a channel. - */ -export interface Schema$ChannelContentDetails { relatedPlaylists: any; } -/** - * The contentOwnerDetails object encapsulates channel data that is relevant for - * YouTube Partners linked with the channel. - */ -export interface Schema$ChannelContentOwnerDetails { - /** - * The ID of the content owner linked to the channel. - */ - contentOwner: string; - /** - * The date and time of when the channel was linked to the content owner. The - * value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - timeLinked: string; -} -/** - * Pings that the app shall fire (authenticated by biscotti cookie). Each ping - * has a context, in which the app must fire the ping, and a url identifying the - * ping. - */ -export interface Schema$ChannelConversionPing { - /** - * Defines the context of the ping. - */ - context: string; - /** - * The url (without the schema) that the player shall send the ping to. - * It's at caller's descretion to decide which schema to use (http vs - * https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ - * viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D - * cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must - * append biscotti authentication (ms param in case of mobile, for example) to - * this ping. - */ - conversionUrl: string; -} -/** - * The conversionPings object encapsulates information about conversion pings - * that need to be respected by the channel. - */ -export interface Schema$ChannelConversionPings { - /** - * Pings that the app shall fire (authenticated by biscotti cookie). Each ping - * has a context, in which the app must fire the ping, and a url identifying - * the ping. - */ - pings: Schema$ChannelConversionPing[]; -} -export interface Schema$ChannelListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of channels that match the request criteria. - */ - items: Schema$Channel[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#channelListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Channel localization setting - */ -export interface Schema$ChannelLocalization { - /** - * The localized strings for channel's description. - */ - description: string; - /** - * The localized strings for channel's title. - */ - title: string; -} -export interface Schema$ChannelProfileDetails { - /** - * The YouTube channel ID. - */ - channelId: string; - /** - * The channel's URL. - */ - channelUrl: string; - /** - * The channel's display name. - */ - displayName: string; - /** - * The channels's avatar URL. - */ - profileImageUrl: string; -} -export interface Schema$ChannelSection { - /** - * The contentDetails object contains details about the channel section - * content, such as a list of playlists or channels featured in the section. - */ - contentDetails: Schema$ChannelSectionContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the channel section. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#channelSection". - */ - kind: string; - /** - * Localizations for different languages - */ - localizations: any; - /** - * The snippet object contains basic details about the channel section, such - * as its type, style and title. - */ - snippet: Schema$ChannelSectionSnippet; - /** - * The targeting object contains basic targeting settings about the channel - * section. - */ - targeting: Schema$ChannelSectionTargeting; -} -/** - * Details about a channelsection, including playlists and channels. - */ -export interface Schema$ChannelSectionContentDetails { - /** - * The channel ids for type multiple_channels. - */ - channels: string[]; - /** - * The playlist ids for type single_playlist and multiple_playlists. For - * singlePlaylist, only one playlistId is allowed. - */ - playlists: string[]; -} -export interface Schema$ChannelSectionListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of ChannelSections that match the request criteria. - */ - items: Schema$ChannelSection[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#channelSectionListResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * ChannelSection localization setting - */ -export interface Schema$ChannelSectionLocalization { - /** - * The localized strings for channel section's title. - */ - title: string; -} -/** - * Basic details about a channel section, including title, style and position. - */ -export interface Schema$ChannelSectionSnippet { - /** - * The ID that YouTube uses to uniquely identify the channel that published - * the channel section. - */ - channelId: string; - /** - * The language of the channel section's default title and description. - */ - defaultLanguage: string; - /** - * Localized title, read-only. - */ - localized: Schema$ChannelSectionLocalization; - /** - * The position of the channel section in the channel. - */ - position: number; - /** - * The style of the channel section. - */ - style: string; - /** - * The channel section's title for multiple_playlists and - * multiple_channels. - */ - title: string; - /** - * The type of the channel section. - */ - type: string; -} -/** - * ChannelSection targeting setting. - */ -export interface Schema$ChannelSectionTargeting { - /** - * The country the channel section is targeting. - */ - countries: string[]; - /** - * The language the channel section is targeting. - */ - languages: string[]; - /** - * The region the channel section is targeting. - */ - regions: string[]; -} -/** - * Branding properties for the channel view. - */ -export interface Schema$ChannelSettings { - /** - * The country of the channel. - */ - country: string; - defaultLanguage: string; - /** - * Which content tab users should see when viewing the channel. - */ - defaultTab: string; - /** - * Specifies the channel description. - */ - description: string; - /** - * Title for the featured channels tab. - */ - featuredChannelsTitle: string; - /** - * The list of featured channels. - */ - featuredChannelsUrls: string[]; - /** - * Lists keywords associated with the channel, comma-separated. - */ - keywords: string; - /** - * Whether user-submitted comments left on the channel page need to be - * approved by the channel owner to be publicly visible. - */ - moderateComments: boolean; - /** - * A prominent color that can be rendered on this channel page. - */ - profileColor: string; - /** - * Whether the tab to browse the videos should be displayed. - */ - showBrowseView: boolean; - /** - * Whether related channels should be proposed. - */ - showRelatedChannels: boolean; - /** - * Specifies the channel title. - */ - title: string; - /** - * The ID for a Google Analytics account to track and measure traffic to the - * channels. - */ - trackingAnalyticsAccountId: string; - /** - * The trailer of the channel, for users that are not subscribers. - */ - unsubscribedTrailer: string; -} -/** - * Basic details about a channel, including title, description and thumbnails. - */ -export interface Schema$ChannelSnippet { - /** - * The country of the channel. - */ - country: string; - /** - * The custom url of the channel. - */ - customUrl: string; - /** - * The language of the channel's default title and description. - */ - defaultLanguage: string; - /** - * The description of the channel. - */ - description: string; - /** - * Localized title and description, read-only. - */ - localized: Schema$ChannelLocalization; - /** - * The date and time that the channel was created. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * A map of thumbnail images associated with the channel. For each object in - * the map, the key is the name of the thumbnail image, and the value is an - * object that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The channel's title. - */ - title: string; -} -/** - * Statistics about a channel: number of subscribers, number of videos in the - * channel, etc. - */ -export interface Schema$ChannelStatistics { - /** - * The number of comments for the channel. - */ - commentCount: string; - /** - * Whether or not the number of subscribers is shown for this user. - */ - hiddenSubscriberCount: boolean; - /** - * The number of subscribers that the channel has. - */ - subscriberCount: string; - /** - * The number of videos uploaded to the channel. - */ - videoCount: string; - /** - * The number of times the channel has been viewed. - */ - viewCount: string; -} -/** - * JSON template for the status part of a channel. - */ -export interface Schema$ChannelStatus { - /** - * If true, then the user is linked to either a YouTube username or G+ - * account. Otherwise, the user doesn't have a public YouTube identity. - */ - isLinked: boolean; - /** - * The long uploads status of this channel. See - */ - longUploadsStatus: string; - /** - * Privacy status of the channel. - */ - privacyStatus: string; -} -/** - * Freebase topic information related to the channel. - */ -export interface Schema$ChannelTopicDetails { - /** - * A list of Wikipedia URLs that describe the channel's content. - */ - topicCategories: string[]; - /** - * A list of Freebase topic IDs associated with the channel. You can retrieve - * information about each topic using the Freebase Topic API. - */ - topicIds: string[]; -} -/** - * A comment represents a single YouTube comment. - */ -export interface Schema$Comment { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the comment. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#comment". - */ - kind: string; - /** - * The snippet object contains basic details about the comment. - */ - snippet: Schema$CommentSnippet; -} -export interface Schema$CommentListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of comments that match the request criteria. - */ - items: Schema$Comment[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#commentListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a comment, such as its author and text. - */ -export interface Schema$CommentSnippet { - /** - * The id of the author's YouTube channel, if any. - */ - authorChannelId: any; - /** - * Link to the author's YouTube channel, if any. - */ - authorChannelUrl: string; - /** - * The name of the user who posted the comment. - */ - authorDisplayName: string; - /** - * The URL for the avatar of the user who posted the comment. - */ - authorProfileImageUrl: string; - /** - * Whether the current viewer can rate this comment. - */ - canRate: boolean; - /** - * The id of the corresponding YouTube channel. In case of a channel comment - * this is the channel the comment refers to. In case of a video comment - * it's the video's channel. - */ - channelId: string; - /** - * The total number of likes this comment has received. - */ - likeCount: number; - /** - * The comment's moderation status. Will not be set if the comments were - * requested through the id filter. - */ - moderationStatus: string; - /** - * The unique id of the parent comment, only set for replies. - */ - parentId: string; - /** - * The date and time when the comment was orignally published. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The comment's text. The format is either plain text or HTML dependent - * on what has been requested. Even the plain text representation may differ - * from the text originally posted in that it may replace video links with - * video titles etc. - */ - textDisplay: string; - /** - * The comment's original raw text as initially posted or last updated. - * The original text will only be returned if it is accessible to the viewer, - * which is only guaranteed if the viewer is the comment's author. - */ - textOriginal: string; - /** - * The date and time when was last updated . The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - updatedAt: string; - /** - * The ID of the video the comment refers to, if any. - */ - videoId: string; - /** - * The rating the viewer has given to this comment. For the time being this - * will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This - * may change in the future. - */ - viewerRating: string; -} -/** - * A comment thread represents information that applies to a top level comment - * and all its replies. It can also include the top level comment itself and - * some of the replies. - */ -export interface Schema$CommentThread { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the comment thread. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#commentThread". - */ - kind: string; - /** - * The replies object contains a limited number of replies (if any) to the top - * level comment found in the snippet. - */ - replies: Schema$CommentThreadReplies; - /** - * The snippet object contains basic details about the comment thread and also - * the top level comment. - */ - snippet: Schema$CommentThreadSnippet; -} -export interface Schema$CommentThreadListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of comment threads that match the request criteria. - */ - items: Schema$CommentThread[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#commentThreadListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Comments written in (direct or indirect) reply to the top level comment. - */ -export interface Schema$CommentThreadReplies { - /** - * A limited number of replies. Unless the number of replies returned equals - * total_reply_count in the snippet the returned replies are only a subset of - * the total number of replies. - */ - comments: Schema$Comment[]; -} -/** - * Basic details about a comment thread. - */ -export interface Schema$CommentThreadSnippet { - /** - * Whether the current viewer of the thread can reply to it. This is viewer - * specific - other viewers may see a different value for this field. - */ - canReply: boolean; - /** - * The YouTube channel the comments in the thread refer to or the channel with - * the video the comments refer to. If video_id isn't set the comments - * refer to the channel itself. - */ - channelId: string; - /** - * Whether the thread (and therefore all its comments) is visible to all - * YouTube users. - */ - isPublic: boolean; - /** - * The top level comment of this thread. - */ - topLevelComment: Schema$Comment; - /** - * The total number of replies (not including the top level comment). - */ - totalReplyCount: number; - /** - * The ID of the video the comments refer to, if any. No video_id implies a - * channel discussion comment. - */ - videoId: string; -} -/** - * Ratings schemes. The country-specific ratings are mostly for movies and - * shows. NEXT_ID: 71 - */ -export interface Schema$ContentRating { - /** - * The video's Australian Classification Board (ACB) or Australian - * Communications and Media Authority (ACMA) rating. ACMA ratings are used to - * classify children's television programming. - */ - acbRating: string; - /** - * The video's rating from Italy's Autorità per le Garanzie nelle - * Comunicazioni (AGCOM). - */ - agcomRating: string; - /** - * The video's Anatel (Asociación Nacional de Televisión) rating for - * Chilean television. - */ - anatelRating: string; - /** - * The video's British Board of Film Classification (BBFC) rating. - */ - bbfcRating: string; - /** - * The video's rating from Thailand's Board of Film and Video Censors. - */ - bfvcRating: string; - /** - * The video's rating from the Austrian Board of Media Classification - * (Bundesministerium für Unterricht, Kunst und Kultur). - */ - bmukkRating: string; - /** - * The video's rating from the Canadian Radio-Television and - * Telecommunications Commission (CRTC) for Canadian French-language - * broadcasts. For more information, see the Canadian Broadcast Standards - * Council website. - */ - catvfrRating: string; - /** - * Rating system for Canadian TV - Canadian TV Classification System The - * video's rating from the Canadian Radio-Television and - * Telecommunications Commission (CRTC) for Canadian English-language - * broadcasts. For more information, see the Canadian Broadcast Standards - * Council website. - */ - catvRating: string; - /** - * The video's Central Board of Film Certification (CBFC - India) rating. - */ - cbfcRating: string; - /** - * The video's Consejo de Calificación Cinematográfica (Chile) rating. - */ - cccRating: string; - /** - * The video's rating from Portugal's Comissão de Classificação de - * Espect´culos. - */ - cceRating: string; - /** - * The video's rating in Switzerland. - */ - chfilmRating: string; - /** - * The video's Canadian Home Video Rating System (CHVRS) rating. - */ - chvrsRating: string; - /** - * The video's rating from the Commission de Contrôle des Films (Belgium). - */ - cicfRating: string; - /** - * The video's rating from Romania's CONSILIUL NATIONAL AL - * AUDIOVIZUALULUI (CNA). - */ - cnaRating: string; - /** - * Rating system in France - Commission de classification cinematographique - */ - cncRating: string; - /** - * The video's rating from France's Conseil supérieur de - * l?audiovisuel, which rates broadcast content. - */ - csaRating: string; - /** - * The video's rating from Luxembourg's Commission de surveillance de - * la classification des films (CSCF). - */ - cscfRating: string; - /** - * The video's rating in the Czech Republic. - */ - czfilmRating: string; - /** - * The video's Departamento de Justiça, Classificação, Qualificação e - * Títulos (DJCQT - Brazil) rating. - */ - djctqRating: string; - /** - * Reasons that explain why the video received its DJCQT (Brazil) rating. - */ - djctqRatingReasons: string[]; - /** - * Rating system in Turkey - Evaluation and Classification Board of the - * Ministry of Culture and Tourism - */ - ecbmctRating: string; - /** - * The video's rating in Estonia. - */ - eefilmRating: string; - /** - * The video's rating in Egypt. - */ - egfilmRating: string; - /** - * The video's Eirin (映倫) rating. Eirin is the Japanese rating system. - */ - eirinRating: string; - /** - * The video's rating from Malaysia's Film Censorship Board. - */ - fcbmRating: string; - /** - * The video's rating from Hong Kong's Office for Film, Newspaper and - * Article Administration. - */ - fcoRating: string; - /** - * This property has been deprecated. Use the - * contentDetails.contentRating.cncRating instead. - */ - fmocRating: string; - /** - * The video's rating from South Africa's Film and Publication Board. - */ - fpbRating: string; - /** - * Reasons that explain why the video received its FPB (South Africa) rating. - */ - fpbRatingReasons: string[]; - /** - * The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - - * Germany) rating. - */ - fskRating: string; - /** - * The video's rating in Greece. - */ - grfilmRating: string; - /** - * The video's Instituto de la Cinematografía y de las Artes Audiovisuales - * (ICAA - Spain) rating. - */ - icaaRating: string; - /** - * The video's Irish Film Classification Office (IFCO - Ireland) rating. - * See the IFCO website for more information. - */ - ifcoRating: string; - /** - * The video's rating in Israel. - */ - ilfilmRating: string; - /** - * The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - - * Argentina) rating. - */ - incaaRating: string; - /** - * The video's rating from the Kenya Film Classification Board. - */ - kfcbRating: string; - /** - * voor de Classificatie van Audiovisuele Media (Netherlands). - */ - kijkwijzerRating: string; - /** - * The video's Korea Media Rating Board (영상물등급위원회) rating. The - * KMRB rates videos in South Korea. - */ - kmrbRating: string; - /** - * The video's rating from Indonesia's Lembaga Sensor Film. - */ - lsfRating: string; - /** - * The video's rating from Malta's Film Age-Classification Board. - */ - mccaaRating: string; - /** - * The video's rating from the Danish Film Institute's (Det Danske - * Filminstitut) Media Council for Children and Young People. - */ - mccypRating: string; - /** - * The video's rating system for Vietnam - MCST - */ - mcstRating: string; - /** - * The video's rating from Singapore's Media Development Authority - * (MDA) and, specifically, it's Board of Film Censors (BFC). - */ - mdaRating: string; - /** - * The video's rating from Medietilsynet, the Norwegian Media Authority. - */ - medietilsynetRating: string; - /** - * The video's rating from Finland's Kansallinen Audiovisuaalinen - * Instituutti (National Audiovisual Institute). - */ - mekuRating: string; - /** - * The rating system for MENA countries, a clone of MPAA. It is needed to - */ - menaMpaaRating: string; - /** - * The video's rating from the Ministero dei Beni e delle Attività - * Culturali e del Turismo (Italy). - */ - mibacRating: string; - /** - * The video's Ministerio de Cultura (Colombia) rating. - */ - mocRating: string; - /** - * The video's rating from Taiwan's Ministry of Culture (文化部). - */ - moctwRating: string; - /** - * The video's Motion Picture Association of America (MPAA) rating. - */ - mpaaRating: string; - /** - * The rating system for trailer, DVD, and Ad in the US. See - * http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html. - */ - mpaatRating: string; - /** - * The video's rating from the Movie and Television Review and - * Classification Board (Philippines). - */ - mtrcbRating: string; - /** - * The video's rating in Poland. - */ - nbcplRating: string; - /** - * The video's rating from the Maldives National Bureau of Classification. - */ - nbcRating: string; - /** - * The video's rating from the Bulgarian National Film Center. - */ - nfrcRating: string; - /** - * The video's rating from Nigeria's National Film and Video Censors - * Board. - */ - nfvcbRating: string; - /** - * The video's rating from the Nacionãlais Kino centrs (National Film - * Centre of Latvia). - */ - nkclvRating: string; - /** - * The video's Office of Film and Literature Classification (OFLC - New - * Zealand) rating. - */ - oflcRating: string; - /** - * The video's rating in Peru. - */ - pefilmRating: string; - /** - * The video's rating from the Hungarian Nemzeti Filmiroda, the Rating - * Committee of the National Office of Film. - */ - rcnofRating: string; - /** - * The video's rating in Venezuela. - */ - resorteviolenciaRating: string; - /** - * The video's General Directorate of Radio, Television and Cinematography - * (Mexico) rating. - */ - rtcRating: string; - /** - * The video's rating from Ireland's Raidió Teilifís Éireann. - */ - rteRating: string; - /** - * The video's National Film Registry of the Russian Federation (MKRF - - * Russia) rating. - */ - russiaRating: string; - /** - * The video's rating in Slovakia. - */ - skfilmRating: string; - /** - * The video's rating in Iceland. - */ - smaisRating: string; - /** - * The video's rating from Statens medieråd (Sweden's National Media - * Council). - */ - smsaRating: string; - /** - * The video's TV Parental Guidelines (TVPG) rating. - */ - tvpgRating: string; - /** - * A rating that YouTube uses to identify age-restricted content. - */ - ytRating: string; -} -/** - * A fanFundingEvent resource represents a fan funding event on a YouTube - * channel. Fan funding events occur when a user gives one-time monetary support - * to the channel owner. - */ -export interface Schema$FanFundingEvent { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the fan funding event. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#fanFundingEvent". - */ - kind: string; - /** - * The snippet object contains basic details about the fan funding event. - */ - snippet: Schema$FanFundingEventSnippet; -} -export interface Schema$FanFundingEventListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of fan funding events that match the request criteria. - */ - items: Schema$FanFundingEvent[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#fanFundingEventListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$FanFundingEventSnippet { - /** - * The amount of funding in micros of fund_currency. e.g., 1 is represented - */ - amountMicros: string; - /** - * Channel id where the funding event occurred. - */ - channelId: string; - /** - * The text contents of the comment left by the user. - */ - commentText: string; - /** - * The date and time when the funding occurred. The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - createdAt: string; - /** - * The currency in which the fund was made. ISO 4217. - */ - currency: string; - /** - * A rendered string that displays the fund amount and currency (e.g., - * "$1.00"). The string is rendered for the given language. - */ - displayString: string; - /** - * Details about the supporter. Only filled if the event was made public by - * the user. - */ - supporterDetails: Schema$ChannelProfileDetails; -} -/** - * Geographical coordinates of a point, in WGS84. - */ -export interface Schema$GeoPoint { - /** - * Altitude above the reference ellipsoid, in meters. - */ - altitude: number; - /** - * Latitude in degrees. - */ - latitude: number; - /** - * Longitude in degrees. - */ - longitude: number; -} -/** - * A guideCategory resource identifies a category that YouTube algorithmically - * assigns based on a channel's content or other indicators, such as the - * channel's popularity. The list is similar to video categories, with the - * difference being that a video's uploader can assign a video category but - * only YouTube can assign a channel category. - */ -export interface Schema$GuideCategory { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the guide category. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#guideCategory". - */ - kind: string; - /** - * The snippet object contains basic details about the category, such as its - * title. - */ - snippet: Schema$GuideCategorySnippet; -} -export interface Schema$GuideCategoryListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of categories that can be associated with YouTube channels. In this - * map, the category ID is the map key, and its value is the corresponding - * guideCategory resource. - */ - items: Schema$GuideCategory[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#guideCategoryListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a guide category. - */ -export interface Schema$GuideCategorySnippet { - channelId: string; - /** - * Description of the guide category. - */ - title: string; -} -/** - * An i18nLanguage resource identifies a UI language currently supported by - * YouTube. - */ -export interface Schema$I18nLanguage { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the i18n language. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#i18nLanguage". - */ - kind: string; - /** - * The snippet object contains basic details about the i18n language, such as - * language code and human-readable name. - */ - snippet: Schema$I18nLanguageSnippet; -} -export interface Schema$I18nLanguageListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of supported i18n languages. In this map, the i18n language ID is - * the map key, and its value is the corresponding i18nLanguage resource. - */ - items: Schema$I18nLanguage[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#i18nLanguageListResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about an i18n language, such as language code and - * human-readable name. - */ -export interface Schema$I18nLanguageSnippet { - /** - * A short BCP-47 code that uniquely identifies a language. - */ - hl: string; - /** - * The human-readable name of the language in the language itself. - */ - name: string; -} -/** - * A i18nRegion resource identifies a region where YouTube is available. - */ -export interface Schema$I18nRegion { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the i18n region. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#i18nRegion". - */ - kind: string; - /** - * The snippet object contains basic details about the i18n region, such as - * region code and human-readable name. - */ - snippet: Schema$I18nRegionSnippet; -} -export interface Schema$I18nRegionListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of regions where YouTube is available. In this map, the i18n region - * ID is the map key, and its value is the corresponding i18nRegion resource. - */ - items: Schema$I18nRegion[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#i18nRegionListResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about an i18n region, such as region code and human-readable - * name. - */ -export interface Schema$I18nRegionSnippet { - /** - * The region code as a 2-letter ISO country code. - */ - gl: string; - /** - * The human-readable name of the region. - */ - name: string; -} -/** - * Branding properties for images associated with the channel. - */ -export interface Schema$ImageSettings { - /** - * The URL for the background image shown on the video watch page. The image - * should be 1200px by 615px, with a maximum file size of 128k. - */ - backgroundImageUrl: Schema$LocalizedProperty; - /** - * This is used only in update requests; if it's set, we use this URL to - * generate all of the above banner URLs. - */ - bannerExternalUrl: string; - /** - * Banner image. Desktop size (1060x175). - */ - bannerImageUrl: string; - /** - * Banner image. Mobile size high resolution (1440x395). - */ - bannerMobileExtraHdImageUrl: string; - /** - * Banner image. Mobile size high resolution (1280x360). - */ - bannerMobileHdImageUrl: string; - /** - * Banner image. Mobile size (640x175). - */ - bannerMobileImageUrl: string; - /** - * Banner image. Mobile size low resolution (320x88). - */ - bannerMobileLowImageUrl: string; - /** - * Banner image. Mobile size medium/high resolution (960x263). - */ - bannerMobileMediumHdImageUrl: string; - /** - * Banner image. Tablet size extra high resolution (2560x424). - */ - bannerTabletExtraHdImageUrl: string; - /** - * Banner image. Tablet size high resolution (2276x377). - */ - bannerTabletHdImageUrl: string; - /** - * Banner image. Tablet size (1707x283). - */ - bannerTabletImageUrl: string; - /** - * Banner image. Tablet size low resolution (1138x188). - */ - bannerTabletLowImageUrl: string; - /** - * Banner image. TV size high resolution (1920x1080). - */ - bannerTvHighImageUrl: string; - /** - * Banner image. TV size extra high resolution (2120x1192). - */ - bannerTvImageUrl: string; - /** - * Banner image. TV size low resolution (854x480). - */ - bannerTvLowImageUrl: string; - /** - * Banner image. TV size medium resolution (1280x720). - */ - bannerTvMediumImageUrl: string; - /** - * The image map script for the large banner image. - */ - largeBrandedBannerImageImapScript: Schema$LocalizedProperty; - /** - * The URL for the 854px by 70px image that appears below the video player in - * the expanded video view of the video watch page. - */ - largeBrandedBannerImageUrl: Schema$LocalizedProperty; - /** - * The image map script for the small banner image. - */ - smallBrandedBannerImageImapScript: Schema$LocalizedProperty; - /** - * The URL for the 640px by 70px banner image that appears below the video - * player in the default view of the video watch page. - */ - smallBrandedBannerImageUrl: Schema$LocalizedProperty; - /** - * The URL for a 1px by 1px tracking pixel that can be used to collect - * statistics for views of the channel or video pages. - */ - trackingImageUrl: string; - /** - * The URL for the image that appears above the top-left corner of the video - * player. This is a 25-pixel-high image with a flexible width that cannot - * exceed 170 pixels. - */ - watchIconImageUrl: string; -} -/** - * Describes information necessary for ingesting an RTMP or an HTTP stream. - */ -export interface Schema$IngestionInfo { - /** - * The backup ingestion URL that you should use to stream video to YouTube. - * You have the option of simultaneously streaming the content that you are - * sending to the ingestionAddress to this URL. - */ - backupIngestionAddress: string; - /** - * The primary ingestion URL that you should use to stream video to YouTube. - * You must stream video to this URL. Depending on which application or tool - * you use to encode your video stream, you may need to enter the stream URL - * and stream name separately or you may need to concatenate them in the - * following format: STREAM_URL/STREAM_NAME - */ - ingestionAddress: string; - /** - * The HTTP or RTMP stream name that YouTube assigns to the video stream. - */ - streamName: string; -} -export interface Schema$InvideoBranding { - imageBytes: string; - imageUrl: string; - position: Schema$InvideoPosition; - targetChannelId: string; - timing: Schema$InvideoTiming; -} -/** - * Describes the spatial position of a visual widget inside a video. It is a - * union of various position types, out of which only will be set one. - */ -export interface Schema$InvideoPosition { - /** - * Describes in which corner of the video the visual widget will appear. - */ - cornerPosition: string; - /** - * Defines the position type. - */ - type: string; -} -/** - * Describes an invideo promotion campaign consisting of multiple promoted - * items. A campaign belongs to a single channel_id. - */ -export interface Schema$InvideoPromotion { - /** - * The default temporal position within the video where the promoted item will - * be displayed. Can be overriden by more specific timing in the item. - */ - defaultTiming: Schema$InvideoTiming; - /** - * List of promoted items in decreasing priority. - */ - items: Schema$PromotedItem[]; - /** - * The spatial position within the video where the promoted item will be - * displayed. - */ - position: Schema$InvideoPosition; - /** - * Indicates whether the channel's promotional campaign uses "smart - * timing." This feature attempts to show promotions at a point in the - * video when they are more likely to be clicked and less likely to disrupt - * the viewing experience. This feature also picks up a single promotion to - * show on each video. - */ - useSmartTiming: boolean; -} -/** - * Describes a temporal position of a visual widget inside a video. - */ -export interface Schema$InvideoTiming { - /** - * Defines the duration in milliseconds for which the promotion should be - * displayed. If missing, the client should use the default. - */ - durationMs: string; - /** - * Defines the time at which the promotion will appear. Depending on the value - * of type the value of the offsetMs field will represent a time offset from - * the start or from the end of the video, expressed in milliseconds. - */ - offsetMs: string; - /** - * Describes a timing type. If the value is offsetFromStart, then the offsetMs - * field represents an offset from the start of the video. If the value is - * offsetFromEnd, then the offsetMs field represents an offset from the end of - * the video. - */ - type: string; -} -export interface Schema$LanguageTag { value: string; } -/** - * A liveBroadcast resource represents an event that will be streamed, via live - * video, on YouTube. - */ -export interface Schema$LiveBroadcast { - /** - * The contentDetails object contains information about the event's video - * content, such as whether the content can be shown in an embedded video - * player or if it will be archived and therefore available for viewing after - * the event has concluded. - */ - contentDetails: Schema$LiveBroadcastContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the broadcast. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveBroadcast". - */ - kind: string; - /** - * The snippet object contains basic details about the event, including its - * title, description, start time, and end time. - */ - snippet: Schema$LiveBroadcastSnippet; - /** - * The statistics object contains info about the event's current stats. - * These include concurrent viewers and total chat count. Statistics can - * change (in either direction) during the lifetime of an event. Statistics - * are only returned while the event is live. - */ - statistics: Schema$LiveBroadcastStatistics; - /** - * The status object contains information about the event's status. - */ - status: Schema$LiveBroadcastStatus; -} -/** - * Detailed settings of a broadcast. - */ -export interface Schema$LiveBroadcastContentDetails { - /** - * This value uniquely identifies the live stream bound to the broadcast. - */ - boundStreamId: string; - /** - * The date and time that the live stream referenced by boundStreamId was last - * updated. - */ - boundStreamLastUpdateTimeMs: string; - closedCaptionsType: string; - /** - * This setting indicates whether auto start is enabled for this broadcast. - */ - enableAutoStart: boolean; - /** - * This setting indicates whether HTTP POST closed captioning is enabled for - * this broadcast. The ingestion URL of the closed captions is returned - * through the liveStreams API. This is mutually exclusive with using the - * closed_captions_type property, and is equivalent to setting - * closed_captions_type to CLOSED_CAPTIONS_HTTP_POST. - */ - enableClosedCaptions: boolean; - /** - * This setting indicates whether YouTube should enable content encryption for - * the broadcast. - */ - enableContentEncryption: boolean; - /** - * This setting determines whether viewers can access DVR controls while - * watching the video. DVR controls enable the viewer to control the video - * playback experience by pausing, rewinding, or fast forwarding content. The - * default value for this property is true. Important: You must set the - * value to true and also set the enableArchive property's value to true - * if you want to make playback available immediately after the broadcast - * ends. - */ - enableDvr: boolean; - /** - * This setting indicates whether the broadcast video can be played in an - * embedded player. If you choose to archive the video (using the - * enableArchive property), this setting will also apply to the archived - * video. - */ - enableEmbed: boolean; - /** - * Indicates whether this broadcast has low latency enabled. - */ - enableLowLatency: boolean; - /** - * If both this and enable_low_latency are set, they must match. - * LATENCY_NORMAL should match enable_low_latency=false LATENCY_LOW should - * match enable_low_latency=true LATENCY_ULTRA_LOW should have - * enable_low_latency omitted. - */ - latencyPreference: string; - mesh: string; - /** - * The monitorStream object contains information about the monitor stream, - * which the broadcaster can use to review the event content before the - * broadcast stream is shown publicly. - */ - monitorStream: Schema$MonitorStreamInfo; - /** - * The projection format of this broadcast. This defaults to rectangular. - */ - projection: string; - /** - * Automatically start recording after the event goes live. The default value - * for this property is true. Important: You must also set the enableDvr - * property's value to true if you want the playback to be available - * immediately after the broadcast ends. If you set this property's value - * to true but do not also set the enableDvr property to true, there may be a - * delay of around one day before the archived video will be available for - * playback. - */ - recordFromStart: boolean; - /** - * This setting indicates whether the broadcast should automatically begin - * with an in-stream slate when you update the broadcast's status to live. - * After updating the status, you then need to send a liveCuepoints.insert - * request that sets the cuepoint's eventState to end to remove the - * in-stream slate and make your broadcast stream visible to viewers. - */ - startWithSlate: boolean; - stereoLayout: string; -} -export interface Schema$LiveBroadcastListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of broadcasts that match the request criteria. - */ - items: Schema$LiveBroadcast[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveBroadcastListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$LiveBroadcastSnippet { - /** - * The date and time that the broadcast actually ended. This information is - * only available once the broadcast's state is complete. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - actualEndTime: string; - /** - * The date and time that the broadcast actually started. This information is - * only available once the broadcast's state is live. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - actualStartTime: string; - /** - * The ID that YouTube uses to uniquely identify the channel that is - * publishing the broadcast. - */ - channelId: string; - /** - * The broadcast's description. As with the title, you can set this field - * by modifying the broadcast resource or by setting the description field of - * the corresponding video resource. - */ - description: string; - isDefaultBroadcast: boolean; - /** - * The id of the live chat for this broadcast. - */ - liveChatId: string; - /** - * The date and time that the broadcast was added to YouTube's live - * broadcast schedule. The value is specified in ISO 8601 - * (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The date and time that the broadcast is scheduled to end. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - scheduledEndTime: string; - /** - * The date and time that the broadcast is scheduled to start. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - scheduledStartTime: string; - /** - * A map of thumbnail images associated with the broadcast. For each nested - * object in this object, the key is the name of the thumbnail image, and the - * value is an object that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The broadcast's title. Note that the broadcast represents exactly one - * YouTube video. You can set this field by modifying the broadcast resource - * or by setting the title field of the corresponding video resource. - */ - title: string; -} -/** - * Statistics about the live broadcast. These represent a snapshot of the values - * at the time of the request. Statistics are only returned for live broadcasts. - */ -export interface Schema$LiveBroadcastStatistics { - /** - * The number of viewers currently watching the broadcast. The property and - * its value will be present if the broadcast has current viewers and the - * broadcast owner has not hidden the viewcount for the video. Note that - * YouTube stops tracking the number of concurrent viewers for a broadcast - * when the broadcast ends. So, this property would not identify the number of - * viewers watching an archived video of a live broadcast that already ended. - */ - concurrentViewers: string; - /** - * The total number of live chat messages currently on the broadcast. The - * property and its value will be present if the broadcast is public, has the - * live chat feature enabled, and has at least one message. Note that this - * field will not be filled after the broadcast ends. So this property would - * not identify the number of chat messages for an archived video of a - * completed live broadcast. - */ - totalChatCount: string; -} -export interface Schema$LiveBroadcastStatus { - /** - * The broadcast's status. The status can be updated using the API's - * liveBroadcasts.transition method. - */ - lifeCycleStatus: string; - /** - * Priority of the live broadcast event (internal state). - */ - liveBroadcastPriority: string; - /** - * The broadcast's privacy status. Note that the broadcast represents - * exactly one YouTube video, so the privacy settings are identical to those - * supported for videos. In addition, you can set this field by modifying the - * broadcast resource or by setting the privacyStatus field of the - * corresponding video resource. - */ - privacyStatus: string; - /** - * The broadcast's recording status. - */ - recordingStatus: string; -} -/** - * A liveChatBan resource represents a ban for a YouTube live chat. - */ -export interface Schema$LiveChatBan { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the ban. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveChatBan". - */ - kind: string; - /** - * The snippet object contains basic details about the ban. - */ - snippet: Schema$LiveChatBanSnippet; -} -export interface Schema$LiveChatBanSnippet { - /** - * The duration of a ban, only filled if the ban has type TEMPORARY. - */ - banDurationSeconds: string; - bannedUserDetails: Schema$ChannelProfileDetails; - /** - * The chat this ban is pertinent to. - */ - liveChatId: string; - /** - * The type of ban. - */ - type: string; -} -export interface Schema$LiveChatFanFundingEventDetails { - /** - * A rendered string that displays the fund amount and currency to the user. - */ - amountDisplayString: string; - /** - * The amount of the fund. - */ - amountMicros: string; - /** - * The currency in which the fund was made. - */ - currency: string; - /** - * The comment added by the user to this fan funding event. - */ - userComment: string; -} -/** - * A liveChatMessage resource represents a chat message in a YouTube Live Chat. - */ -export interface Schema$LiveChatMessage { - /** - * The authorDetails object contains basic details about the user that posted - * this message. - */ - authorDetails: Schema$LiveChatMessageAuthorDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the message. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveChatMessage". - */ - kind: string; - /** - * The snippet object contains basic details about the message. - */ - snippet: Schema$LiveChatMessageSnippet; -} -export interface Schema$LiveChatMessageAuthorDetails { - /** - * The YouTube channel ID. - */ - channelId: string; - /** - * The channel's URL. - */ - channelUrl: string; - /** - * The channel's display name. - */ - displayName: string; - /** - * Whether the author is a moderator of the live chat. - */ - isChatModerator: boolean; - /** - * Whether the author is the owner of the live chat. - */ - isChatOwner: boolean; - /** - * Whether the author is a sponsor of the live chat. - */ - isChatSponsor: boolean; - /** - * Whether the author's identity has been verified by YouTube. - */ - isVerified: boolean; - /** - * The channels's avatar URL. - */ - profileImageUrl: string; -} -export interface Schema$LiveChatMessageDeletedDetails { - deletedMessageId: string; -} -export interface Schema$LiveChatMessageListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of live chat messages. - */ - items: Schema$LiveChatMessage[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveChatMessageListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - /** - * The date and time when the underlying stream went offline. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - offlineAt: string; - pageInfo: Schema$PageInfo; - /** - * The amount of time the client should wait before polling again. - */ - pollingIntervalMillis: number; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$LiveChatMessageRetractedDetails { - retractedMessageId: string; -} -export interface Schema$LiveChatMessageSnippet { - /** - * The ID of the user that authored this message, this field is not always - * filled. textMessageEvent - the user that wrote the message fanFundingEvent - * - the user that funded the broadcast newSponsorEvent - the user that just - * became a sponsor messageDeletedEvent - the moderator that took the action - * messageRetractedEvent - the author that retracted their message - * userBannedEvent - the moderator that took the action superChatEvent - the - * user that made the purchase - */ - authorChannelId: string; - /** - * Contains a string that can be displayed to the user. If this field is not - * present the message is silent, at the moment only messages of type - * TOMBSTONE and CHAT_ENDED_EVENT are silent. - */ - displayMessage: string; - /** - * Details about the funding event, this is only set if the type is - * 'fanFundingEvent'. - */ - fanFundingEventDetails: Schema$LiveChatFanFundingEventDetails; - /** - * Whether the message has display content that should be displayed to users. - */ - hasDisplayContent: boolean; - liveChatId: string; - messageDeletedDetails: Schema$LiveChatMessageDeletedDetails; - messageRetractedDetails: Schema$LiveChatMessageRetractedDetails; - pollClosedDetails: Schema$LiveChatPollClosedDetails; - pollEditedDetails: Schema$LiveChatPollEditedDetails; - pollOpenedDetails: Schema$LiveChatPollOpenedDetails; - pollVotedDetails: Schema$LiveChatPollVotedDetails; - /** - * The date and time when the message was orignally published. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * Details about the Super Chat event, this is only set if the type is - * 'superChatEvent'. - */ - superChatDetails: Schema$LiveChatSuperChatDetails; - /** - * Details about the text message, this is only set if the type is - * 'textMessageEvent'. - */ - textMessageDetails: Schema$LiveChatTextMessageDetails; - /** - * The type of message, this will always be present, it determines the - * contents of the message as well as which fields will be present. - */ - type: string; - userBannedDetails: Schema$LiveChatUserBannedMessageDetails; -} -/** - * A liveChatModerator resource represents a moderator for a YouTube live chat. - * A chat moderator has the ability to ban/unban users from a chat, remove - * message, etc. - */ -export interface Schema$LiveChatModerator { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the moderator. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveChatModerator". - */ - kind: string; - /** - * The snippet object contains basic details about the moderator. - */ - snippet: Schema$LiveChatModeratorSnippet; -} -export interface Schema$LiveChatModeratorListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of moderators that match the request criteria. - */ - items: Schema$LiveChatModerator[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveChatModeratorListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$LiveChatModeratorSnippet { - /** - * The ID of the live chat this moderator can act on. - */ - liveChatId: string; - /** - * Details about the moderator. - */ - moderatorDetails: Schema$ChannelProfileDetails; -} -export interface Schema$LiveChatPollClosedDetails { - /** - * The id of the poll that was closed. - */ - pollId: string; -} -export interface Schema$LiveChatPollEditedDetails { - id: string; - items: Schema$LiveChatPollItem[]; - prompt: string; -} -export interface Schema$LiveChatPollItem { - /** - * Plain text description of the item. - */ - description: string; - itemId: string; -} -export interface Schema$LiveChatPollOpenedDetails { - id: string; - items: Schema$LiveChatPollItem[]; - prompt: string; -} -export interface Schema$LiveChatPollVotedDetails { - /** - * The poll item the user chose. - */ - itemId: string; - /** - * The poll the user voted on. - */ - pollId: string; -} -export interface Schema$LiveChatSuperChatDetails { - /** - * A rendered string that displays the fund amount and currency to the user. - */ - amountDisplayString: string; - /** - * The amount purchased by the user, in micros (1,750,000 micros = 1.75). - */ - amountMicros: string; - /** - * The currency in which the purchase was made. - */ - currency: string; - /** - * The tier in which the amount belongs to. Lower amounts belong to lower - * tiers. Starts at 1. - */ - tier: number; - /** - * The comment added by the user to this Super Chat event. - */ - userComment: string; -} -export interface Schema$LiveChatTextMessageDetails { - /** - * The user's message. - */ - messageText: string; -} -export interface Schema$LiveChatUserBannedMessageDetails { - /** - * The duration of the ban. This property is only present if the banType is - * temporary. - */ - banDurationSeconds: string; - /** - * The details of the user that was banned. - */ - bannedUserDetails: Schema$ChannelProfileDetails; - /** - * The type of ban. - */ - banType: string; -} -/** - * A live stream describes a live ingestion point. - */ -export interface Schema$LiveStream { - /** - * The cdn object defines the live stream's content delivery network (CDN) - * settings. These settings provide details about the manner in which you - * stream your content to YouTube. - */ - cdn: Schema$CdnSettings; - /** - * The content_details object contains information about the stream, including - * the closed captions ingestion URL. - */ - contentDetails: Schema$LiveStreamContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the stream. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveStream". - */ - kind: string; - /** - * The snippet object contains basic details about the stream, including its - * channel, title, and description. - */ - snippet: Schema$LiveStreamSnippet; - /** - * The status object contains information about live stream's status. - */ - status: Schema$LiveStreamStatus; -} -export interface Schema$LiveStreamConfigurationIssue { - /** - * The long-form description of the issue and how to resolve it. - */ - description: string; - /** - * The short-form reason for this issue. - */ - reason: string; - /** - * How severe this issue is to the stream. - */ - severity: string; - /** - * The kind of error happening. - */ - type: string; -} -/** - * Detailed settings of a stream. - */ -export interface Schema$LiveStreamContentDetails { - /** - * The ingestion URL where the closed captions of this stream are sent. - */ - closedCaptionsIngestionUrl: string; - /** - * Indicates whether the stream is reusable, which means that it can be bound - * to multiple broadcasts. It is common for broadcasters to reuse the same - * stream for many different broadcasts if those broadcasts occur at different - * times. If you set this value to false, then the stream will not be - * reusable, which means that it can only be bound to one broadcast. - * Non-reusable streams differ from reusable streams in the following ways: - - * A non-reusable stream can only be bound to one broadcast. - A non-reusable - * stream might be deleted by an automated process after the broadcast ends. - * - The liveStreams.list method does not list non-reusable streams if you - * call the method and set the mine parameter to true. The only way to use - * that method to retrieve the resource for a non-reusable stream is to use - * the id parameter to identify the stream. - */ - isReusable: boolean; -} -export interface Schema$LiveStreamHealthStatus { - /** - * The configurations issues on this stream - */ - configurationIssues: Schema$LiveStreamConfigurationIssue[]; - /** - * The last time this status was updated (in seconds) - */ - lastUpdateTimeSeconds: string; - /** - * The status code of this stream - */ - status: string; -} -export interface Schema$LiveStreamListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of live streams that match the request criteria. - */ - items: Schema$LiveStream[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#liveStreamListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$LiveStreamSnippet { - /** - * The ID that YouTube uses to uniquely identify the channel that is - * transmitting the stream. - */ - channelId: string; - /** - * The stream's description. The value cannot be longer than 10000 - * characters. - */ - description: string; - isDefaultStream: boolean; - /** - * The date and time that the stream was created. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The stream's title. The value must be between 1 and 128 characters - * long. - */ - title: string; -} -/** - * Brief description of the live stream status. - */ -export interface Schema$LiveStreamStatus { - /** - * The health status of the stream. - */ - healthStatus: Schema$LiveStreamHealthStatus; - streamStatus: string; -} -export interface Schema$LocalizedProperty { - default: string; - /** - * The language of the default property. - */ - defaultLanguage: Schema$LanguageTag; - localized: Schema$LocalizedString[]; -} -export interface Schema$LocalizedString { - language: string; - value: string; -} -/** - * Settings and Info of the monitor stream - */ -export interface Schema$MonitorStreamInfo { - /** - * If you have set the enableMonitorStream property to true, then this - * property determines the length of the live broadcast delay. - */ - broadcastStreamDelayMs: number; - /** - * HTML code that embeds a player that plays the monitor stream. - */ - embedHtml: string; - /** - * This value determines whether the monitor stream is enabled for the - * broadcast. If the monitor stream is enabled, then YouTube will broadcast - * the event content on a special stream intended only for the - * broadcaster's consumption. The broadcaster can use the stream to review - * the event content and also to identify the optimal times to insert - * cuepoints. You need to set this value to true if you intend to have a - * broadcast delay for your event. Note: This property cannot be updated once - * the broadcast is in the testing or live state. - */ - enableMonitorStream: boolean; -} -/** - * Nonprofit information. - */ -export interface Schema$Nonprofit { - /** - * Id of the nonprofit. - */ - nonprofitId: Schema$NonprofitId; - /** - * Legal name of the nonprofit. - */ - nonprofitLegalName: string; -} -export interface Schema$NonprofitId { value: string; } -/** - * Paging details for lists of resources, including total number of items - * available and number of resources returned in a single page. - */ -export interface Schema$PageInfo { - /** - * The number of results included in the API response. - */ - resultsPerPage: number; - /** - * The total number of results in the result set. - */ - totalResults: number; -} -/** - * A playlist resource represents a YouTube playlist. A playlist is a collection - * of videos that can be viewed sequentially and shared with other users. A - * playlist can contain up to 200 videos, and YouTube does not limit the number - * of playlists that each user creates. By default, playlists are publicly - * visible to other users, but playlists can be public or private. YouTube also - * uses playlists to identify special collections of videos for a channel, such - * as: - uploaded videos - favorite videos - positively rated (liked) videos - * - watch history - watch later To be more specific, these lists are - * associated with a channel, which is a collection of a person, group, or - * company's videos, playlists, and other YouTube information. You can - * retrieve the playlist IDs for each of these lists from the channel resource - * for a given channel. You can then use the playlistItems.list method to - * retrieve any of those lists. You can also add or remove items from those - * lists by calling the playlistItems.insert and playlistItems.delete - * methods. - */ -export interface Schema$Playlist { - /** - * The contentDetails object contains information like video count. - */ - contentDetails: Schema$PlaylistContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the playlist. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#playlist". - */ - kind: string; - /** - * Localizations for different languages - */ - localizations: any; - /** - * The player object contains information that you would use to play the - * playlist in an embedded player. - */ - player: Schema$PlaylistPlayer; - /** - * The snippet object contains basic details about the playlist, such as its - * title and description. - */ - snippet: Schema$PlaylistSnippet; - /** - * The status object contains status information for the playlist. - */ - status: Schema$PlaylistStatus; -} -export interface Schema$PlaylistContentDetails { - /** - * The number of videos in the playlist. - */ - itemCount: number; -} -/** - * A playlistItem resource identifies another resource, such as a video, that is - * included in a playlist. In addition, the playlistItem resource contains - * details about the included resource that pertain specifically to how that - * resource is used in that playlist. YouTube uses playlists to identify - * special collections of videos for a channel, such as: - uploaded videos - - * favorite videos - positively rated (liked) videos - watch history - watch - * later To be more specific, these lists are associated with a channel, which - * is a collection of a person, group, or company's videos, playlists, and - * other YouTube information. You can retrieve the playlist IDs for each of - * these lists from the channel resource for a given channel. You can then use - * the playlistItems.list method to retrieve any of those lists. You can also - * add or remove items from those lists by calling the playlistItems.insert - * and playlistItems.delete methods. For example, if a user gives a positive - * rating to a video, you would insert that video into the liked videos playlist - * for that user's channel. - */ -export interface Schema$PlaylistItem { - /** - * The contentDetails object is included in the resource if the included item - * is a YouTube video. The object contains additional information about the - * video. - */ - contentDetails: Schema$PlaylistItemContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the playlist item. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#playlistItem". - */ - kind: string; - /** - * The snippet object contains basic details about the playlist item, such as - * its title and position in the playlist. - */ - snippet: Schema$PlaylistItemSnippet; - /** - * The status object contains information about the playlist item's - * privacy status. - */ - status: Schema$PlaylistItemStatus; -} -export interface Schema$PlaylistItemContentDetails { - /** - * The time, measured in seconds from the start of the video, when the video - * should stop playing. (The playlist owner can specify the times when the - * video should start and stop playing when the video is played in the context - * of the playlist.) By default, assume that the video.endTime is the end of - * the video. - */ - endAt: string; - /** - * A user-generated note for this item. - */ - note: string; - /** - * The time, measured in seconds from the start of the video, when the video - * should start playing. (The playlist owner can specify the times when the - * video should start and stop playing when the video is played in the context - * of the playlist.) The default value is 0. - */ - startAt: string; - /** - * The ID that YouTube uses to uniquely identify a video. To retrieve the - * video resource, set the id query parameter to this value in your API - * request. - */ - videoId: string; - /** - * The date and time that the video was published to YouTube. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - videoPublishedAt: string; -} -export interface Schema$PlaylistItemListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of playlist items that match the request criteria. - */ - items: Schema$PlaylistItem[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#playlistItemListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a playlist, including title, description and thumbnails. - */ -export interface Schema$PlaylistItemSnippet { - /** - * The ID that YouTube uses to uniquely identify the user that added the item - * to the playlist. - */ - channelId: string; - /** - * Channel title for the channel that the playlist item belongs to. - */ - channelTitle: string; - /** - * The item's description. - */ - description: string; - /** - * The ID that YouTube uses to uniquely identify the playlist that the - * playlist item is in. - */ - playlistId: string; - /** - * The order in which the item appears in the playlist. The value uses a - * zero-based index, so the first item has a position of 0, the second item - * has a position of 1, and so forth. - */ - position: number; - /** - * The date and time that the item was added to the playlist. The value is - * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The id object contains information that can be used to uniquely identify - * the resource that is included in the playlist as the playlist item. - */ - resourceId: Schema$ResourceId; - /** - * A map of thumbnail images associated with the playlist item. For each - * object in the map, the key is the name of the thumbnail image, and the - * value is an object that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The item's title. - */ - title: string; -} -/** - * Information about the playlist item's privacy status. - */ -export interface Schema$PlaylistItemStatus { - /** - * This resource's privacy status. - */ - privacyStatus: string; -} -export interface Schema$PlaylistListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of playlists that match the request criteria. - */ - items: Schema$Playlist[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#playlistListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Playlist localization setting - */ -export interface Schema$PlaylistLocalization { - /** - * The localized strings for playlist's description. - */ - description: string; - /** - * The localized strings for playlist's title. - */ - title: string; -} -export interface Schema$PlaylistPlayer { - /** - * An <iframe> tag that embeds a player that will play the playlist. - */ - embedHtml: string; -} -/** - * Basic details about a playlist, including title, description and thumbnails. - */ -export interface Schema$PlaylistSnippet { - /** - * The ID that YouTube uses to uniquely identify the channel that published - * the playlist. - */ - channelId: string; - /** - * The channel title of the channel that the video belongs to. - */ - channelTitle: string; - /** - * The language of the playlist's default title and description. - */ - defaultLanguage: string; - /** - * The playlist's description. - */ - description: string; - /** - * Localized title and description, read-only. - */ - localized: Schema$PlaylistLocalization; - /** - * The date and time that the playlist was created. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * Keyword tags associated with the playlist. - */ - tags: string[]; - /** - * A map of thumbnail images associated with the playlist. For each object in - * the map, the key is the name of the thumbnail image, and the value is an - * object that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The playlist's title. - */ - title: string; -} -export interface Schema$PlaylistStatus { - /** - * The playlist's privacy status. - */ - privacyStatus: string; -} -/** - * Describes a single promoted item. - */ -export interface Schema$PromotedItem { - /** - * A custom message to display for this promotion. This field is currently - * ignored unless the promoted item is a website. - */ - customMessage: string; - /** - * Identifies the promoted item. - */ - id: Schema$PromotedItemId; - /** - * If true, the content owner's name will be used when displaying the - * promotion. This field can only be set when the update is made on behalf of - * the content owner. - */ - promotedByContentOwner: boolean; - /** - * The temporal position within the video where the promoted item will be - * displayed. If present, it overrides the default timing. - */ - timing: Schema$InvideoTiming; -} -/** - * Describes a single promoted item id. It is a union of various possible types. - */ -export interface Schema$PromotedItemId { - /** - * If type is recentUpload, this field identifies the channel from which to - * take the recent upload. If missing, the channel is assumed to be the same - * channel for which the invideoPromotion is set. - */ - recentlyUploadedBy: string; - /** - * Describes the type of the promoted item. - */ - type: string; - /** - * If the promoted item represents a video, this field represents the unique - * YouTube ID identifying it. This field will be present only if type has the - * value video. - */ - videoId: string; - /** - * If the promoted item represents a website, this field represents the url - * pointing to the website. This field will be present only if type has the - * value website. - */ - websiteUrl: string; -} -/** - * A pair Property / Value. - */ -export interface Schema$PropertyValue { - /** - * A property. - */ - property: string; - /** - * The property's value. - */ - value: string; -} -/** - * A resource id is a generic reference that points to another YouTube resource. - */ -export interface Schema$ResourceId { - /** - * The ID that YouTube uses to uniquely identify the referred resource, if - * that resource is a channel. This property is only present if the - * resourceId.kind value is youtube#channel. - */ - channelId: string; - /** - * The type of the API resource. - */ - kind: string; - /** - * The ID that YouTube uses to uniquely identify the referred resource, if - * that resource is a playlist. This property is only present if the - * resourceId.kind value is youtube#playlist. - */ - playlistId: string; - /** - * The ID that YouTube uses to uniquely identify the referred resource, if - * that resource is a video. This property is only present if the - * resourceId.kind value is youtube#video. - */ - videoId: string; -} -export interface Schema$SearchListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of results that match the search criteria. - */ - items: Schema$SearchResult[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#searchListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - regionCode: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * A search result contains information about a YouTube video, channel, or - * playlist that matches the search parameters specified in an API request. - * While a search result points to a uniquely identifiable resource, like a - * video, it does not have its own persistent data. - */ -export interface Schema$SearchResult { - /** - * Etag of this resource. - */ - etag: string; - /** - * The id object contains information that can be used to uniquely identify - * the resource that matches the search request. - */ - id: Schema$ResourceId; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#searchResult". - */ - kind: string; - /** - * The snippet object contains basic details about a search result, such as - * its title or description. For example, if the search result is a video, - * then the title will be the video's title and the description will be - * the video's description. - */ - snippet: Schema$SearchResultSnippet; -} -/** - * Basic details about a search result, including title, description and - * thumbnails of the item referenced by the search result. - */ -export interface Schema$SearchResultSnippet { - /** - * The value that YouTube uses to uniquely identify the channel that published - * the resource that the search result identifies. - */ - channelId: string; - /** - * The title of the channel that published the resource that the search result - * identifies. - */ - channelTitle: string; - /** - * A description of the search result. - */ - description: string; - /** - * It indicates if the resource (video or channel) has upcoming/active live - * broadcast content. Or it's "none" if there is not any - * upcoming/active live broadcasts. - */ - liveBroadcastContent: string; - /** - * The creation date and time of the resource that the search result - * identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) - * format. - */ - publishedAt: string; - /** - * A map of thumbnail images associated with the search result. For each - * object in the map, the key is the name of the thumbnail image, and the - * value is an object that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The title of the search result. - */ - title: string; -} -/** - * A sponsor resource represents a sponsor for a YouTube channel. A sponsor - * provides recurring monetary support to a creator and receives special - * benefits. - */ -export interface Schema$Sponsor { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the sponsor. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#sponsor". - */ - kind: string; - /** - * The snippet object contains basic details about the sponsor. - */ - snippet: Schema$SponsorSnippet; -} -export interface Schema$SponsorListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of sponsors that match the request criteria. - */ - items: Schema$Sponsor[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#sponsorListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$SponsorSnippet { - /** - * The id of the channel being sponsored. - */ - channelId: string; - /** - * The cumulative time a user has been a sponsor in months. - */ - cumulativeDurationMonths: number; - /** - * Details about the sponsor. - */ - sponsorDetails: Schema$ChannelProfileDetails; - /** - * The date and time when the user became a sponsor. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - sponsorSince: string; -} -/** - * A subscription resource contains information about a YouTube user - * subscription. A subscription notifies a user when new videos are added to a - * channel or when another user takes one of several actions on YouTube, such as - * uploading a video, rating a video, or commenting on a video. - */ -export interface Schema$Subscription { - /** - * The contentDetails object contains basic statistics about the subscription. - */ - contentDetails: Schema$SubscriptionContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the subscription. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#subscription". - */ - kind: string; - /** - * The snippet object contains basic details about the subscription, including - * its title and the channel that the user subscribed to. - */ - snippet: Schema$SubscriptionSnippet; - /** - * The subscriberSnippet object contains basic details about the sbuscriber. - */ - subscriberSnippet: Schema$SubscriptionSubscriberSnippet; -} -/** - * Details about the content to witch a subscription refers. - */ -export interface Schema$SubscriptionContentDetails { - /** - * The type of activity this subscription is for (only uploads, everything). - */ - activityType: string; - /** - * The number of new items in the subscription since its content was last - * read. - */ - newItemCount: number; - /** - * The approximate number of items that the subscription points to. - */ - totalItemCount: number; -} -export interface Schema$SubscriptionListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of subscriptions that match the request criteria. - */ - items: Schema$Subscription[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#subscriptionListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a subscription, including title, description and - * thumbnails of the subscribed item. - */ -export interface Schema$SubscriptionSnippet { - /** - * The ID that YouTube uses to uniquely identify the subscriber's channel. - */ - channelId: string; - /** - * Channel title for the channel that the subscription belongs to. - */ - channelTitle: string; - /** - * The subscription's details. - */ - description: string; - /** - * The date and time that the subscription was created. The value is specified - * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The id object contains information about the channel that the user - * subscribed to. - */ - resourceId: Schema$ResourceId; - /** - * A map of thumbnail images associated with the video. For each object in the - * map, the key is the name of the thumbnail image, and the value is an object - * that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The subscription's title. - */ - title: string; -} -/** - * Basic details about a subscription's subscriber including title, - * description, channel ID and thumbnails. - */ -export interface Schema$SubscriptionSubscriberSnippet { - /** - * The channel ID of the subscriber. - */ - channelId: string; - /** - * The description of the subscriber. - */ - description: string; - /** - * Thumbnails for this subscriber. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The title of the subscriber. - */ - title: string; -} -/** - * A superChatEvent resource represents a Super Chat purchase on a YouTube - * channel. - */ -export interface Schema$SuperChatEvent { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube assigns to uniquely identify the Super Chat event. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#superChatEvent". - */ - kind: string; - /** - * The snippet object contains basic details about the Super Chat event. - */ - snippet: Schema$SuperChatEventSnippet; -} -export interface Schema$SuperChatEventListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of Super Chat purchases that match the request criteria. - */ - items: Schema$SuperChatEvent[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#superChatEventListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$SuperChatEventSnippet { - /** - * The purchase amount, in micros of the purchase currency. e.g., 1 is - * represented as 1000000. - */ - amountMicros: string; - /** - * Channel id where the event occurred. - */ - channelId: string; - /** - * The text contents of the comment left by the user. - */ - commentText: string; - /** - * The date and time when the event occurred. The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - createdAt: string; - /** - * The currency in which the purchase was made. ISO 4217. - */ - currency: string; - /** - * A rendered string that displays the purchase amount and currency (e.g., - * "$1.00"). The string is rendered for the given language. - */ - displayString: string; - /** - * True if this event is a Super Chat for Good purchase. - */ - isSuperChatForGood: boolean; - /** - * The tier for the paid message, which is based on the amount of money spent - * to purchase the message. - */ - messageType: number; - /** - * If this event is a Super Chat for Good purchase, this field will contain - * information about the charity the purchase is donated to. - */ - nonprofit: Schema$Nonprofit; - /** - * Details about the supporter. - */ - supporterDetails: Schema$ChannelProfileDetails; -} -/** - * A thumbnail is an image representing a YouTube resource. - */ -export interface Schema$Thumbnail { - /** - * (Optional) Height of the thumbnail image. - */ - height: number; - /** - * The thumbnail image's URL. - */ - url: string; - /** - * (Optional) Width of the thumbnail image. - */ - width: number; -} -/** - * Internal representation of thumbnails for a YouTube resource. - */ -export interface Schema$ThumbnailDetails { - /** - * The default image for this resource. - */ - default: Schema$Thumbnail; - /** - * The high quality image for this resource. - */ - high: Schema$Thumbnail; - /** - * The maximum resolution quality image for this resource. - */ - maxres: Schema$Thumbnail; - /** - * The medium quality image for this resource. - */ - medium: Schema$Thumbnail; - /** - * The standard quality image for this resource. - */ - standard: Schema$Thumbnail; -} -export interface Schema$ThumbnailSetResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of thumbnails. - */ - items: Schema$ThumbnailDetails[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#thumbnailSetResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Stub token pagination template to suppress results. - */ -export interface Schema$TokenPagination {} -/** - * A video resource represents a YouTube video. - */ -export interface Schema$Video { - /** - * Age restriction details related to a video. This data can only be retrieved - * by the video owner. - */ - ageGating: Schema$VideoAgeGating; - /** - * The contentDetails object contains information about the video content, - * including the length of the video and its aspect ratio. - */ - contentDetails: Schema$VideoContentDetails; - /** - * Etag of this resource. - */ - etag: string; - /** - * The fileDetails object encapsulates information about the video file that - * was uploaded to YouTube, including the file's resolution, duration, - * audio and video codecs, stream bitrates, and more. This data can only be - * retrieved by the video owner. - */ - fileDetails: Schema$VideoFileDetails; - /** - * The ID that YouTube uses to uniquely identify the video. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#video". - */ - kind: string; - /** - * The liveStreamingDetails object contains metadata about a live video - * broadcast. The object will only be present in a video resource if the video - * is an upcoming, live, or completed live broadcast. - */ - liveStreamingDetails: Schema$VideoLiveStreamingDetails; - /** - * List with all localizations. - */ - localizations: any; - /** - * The monetizationDetails object encapsulates information about the - * monetization status of the video. - */ - monetizationDetails: Schema$VideoMonetizationDetails; - /** - * The player object contains information that you would use to play the video - * in an embedded player. - */ - player: Schema$VideoPlayer; - /** - * The processingDetails object encapsulates information about YouTube's - * progress in processing the uploaded video file. The properties in the - * object identify the current processing status and an estimate of the time - * remaining until YouTube finishes processing the video. This part also - * indicates whether different types of data or content, such as file details - * or thumbnail images, are available for the video. The processingProgress - * object is designed to be polled so that the video uploaded can track the - * progress that YouTube has made in processing the uploaded video file. This - * data can only be retrieved by the video owner. - */ - processingDetails: Schema$VideoProcessingDetails; - /** - * The projectDetails object contains information about the project specific - * video metadata. - */ - projectDetails: Schema$VideoProjectDetails; - /** - * The recordingDetails object encapsulates information about the location, - * date and address where the video was recorded. - */ - recordingDetails: Schema$VideoRecordingDetails; - /** - * The snippet object contains basic details about the video, such as its - * title, description, and category. - */ - snippet: Schema$VideoSnippet; - /** - * The statistics object contains statistics about the video. - */ - statistics: Schema$VideoStatistics; - /** - * The status object contains information about the video's uploading, - * processing, and privacy statuses. - */ - status: Schema$VideoStatus; - /** - * The suggestions object encapsulates suggestions that identify opportunities - * to improve the video quality or the metadata for the uploaded video. This - * data can only be retrieved by the video owner. - */ - suggestions: Schema$VideoSuggestions; - /** - * The topicDetails object encapsulates information about Freebase topics - * associated with the video. - */ - topicDetails: Schema$VideoTopicDetails; -} -export interface Schema$VideoAbuseReport { - /** - * Additional comments regarding the abuse report. - */ - comments: string; - /** - * The language that the content was viewed in. - */ - language: string; - /** - * The high-level, or primary, reason that the content is abusive. The value - * is an abuse report reason ID. - */ - reasonId: string; - /** - * The specific, or secondary, reason that this content is abusive (if - * available). The value is an abuse report reason ID that is a valid - * secondary reason for the primary reason. - */ - secondaryReasonId: string; - /** - * The ID that YouTube uses to uniquely identify the video. - */ - videoId: string; -} -/** - * A videoAbuseReportReason resource identifies a reason that a video could be - * reported as abusive. Video abuse report reasons are used with - * video.ReportAbuse. - */ -export interface Schema$VideoAbuseReportReason { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID of this abuse report reason. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoAbuseReportReason". - */ - kind: string; - /** - * The snippet object contains basic details about the abuse report reason. - */ - snippet: Schema$VideoAbuseReportReasonSnippet; -} -export interface Schema$VideoAbuseReportReasonListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of valid abuse reasons that are used with video.ReportAbuse. - */ - items: Schema$VideoAbuseReportReason[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoAbuseReportReasonListResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a video category, such as its localized title. - */ -export interface Schema$VideoAbuseReportReasonSnippet { - /** - * The localized label belonging to this abuse report reason. - */ - label: string; - /** - * The secondary reasons associated with this reason, if any are available. - * (There might be 0 or more.) - */ - secondaryReasons: Schema$VideoAbuseReportSecondaryReason[]; -} -export interface Schema$VideoAbuseReportSecondaryReason { - /** - * The ID of this abuse report secondary reason. - */ - id: string; - /** - * The localized label for this abuse report secondary reason. - */ - label: string; -} -export interface Schema$VideoAgeGating { - /** - * Indicates whether or not the video has alcoholic beverage content. Only - * users of legal purchasing age in a particular country, as identified by - * ICAP, can view the content. - */ - alcoholContent: boolean; - /** - * Age-restricted trailers. For redband trailers and adult-rated video-games. - * Only users aged 18+ can view the content. The the field is true the content - * is restricted to viewers aged 18+. Otherwise The field won't be - * present. - */ - restricted: boolean; - /** - * Video game rating, if any. - */ - videoGameRating: string; -} -/** - * A videoCategory resource identifies a category that has been or could be - * associated with uploaded videos. - */ -export interface Schema$VideoCategory { - /** - * Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the video category. - */ - id: string; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoCategory". - */ - kind: string; - /** - * The snippet object contains basic details about the video category, - * including its title. - */ - snippet: Schema$VideoCategorySnippet; -} -export interface Schema$VideoCategoryListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of video categories that can be associated with YouTube videos. In - * this map, the video category ID is the map key, and its value is the - * corresponding videoCategory resource. - */ - items: Schema$VideoCategory[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoCategoryListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Basic details about a video category, such as its localized title. - */ -export interface Schema$VideoCategorySnippet { - assignable: boolean; - /** - * The YouTube channel that created the video category. - */ - channelId: string; - /** - * The video category's title. - */ - title: string; -} -/** - * Details about the content of a YouTube Video. - */ -export interface Schema$VideoContentDetails { - /** - * The value of captions indicates whether the video has captions or not. - */ - caption: string; - /** - * Specifies the ratings that the video received under various rating schemes. - */ - contentRating: Schema$ContentRating; - /** - * The countryRestriction object contains information about the countries - * where a video is (or is not) viewable. - */ - countryRestriction: Schema$AccessPolicy; - /** - * The value of definition indicates whether the video is available in high - * definition or only in standard definition. - */ - definition: string; - /** - * The value of dimension indicates whether the video is available in 3D or in - * 2D. - */ - dimension: string; - /** - * The length of the video. The tag value is an ISO 8601 duration in the - * format PT#M#S, in which the letters PT indicate that the value specifies a - * period of time, and the letters M and S refer to length in minutes and - * seconds, respectively. The # characters preceding the M and S letters are - * both integers that specify the number of minutes (or seconds) of the video. - * For example, a value of PT15M51S indicates that the video is 15 minutes and - * 51 seconds long. - */ - duration: string; - /** - * Indicates whether the video uploader has provided a custom thumbnail image - * for the video. This property is only visible to the video uploader. - */ - hasCustomThumbnail: boolean; - /** - * The value of is_license_content indicates whether the video is licensed - * content. - */ - licensedContent: boolean; - /** - * Specifies the projection format of the video. - */ - projection: string; - /** - * The regionRestriction object contains information about the countries where - * a video is (or is not) viewable. The object will contain either the - * contentDetails.regionRestriction.allowed property or the - * contentDetails.regionRestriction.blocked property. - */ - regionRestriction: Schema$VideoContentDetailsRegionRestriction; -} -/** - * DEPRECATED Region restriction of the video. - */ -export interface Schema$VideoContentDetailsRegionRestriction { - /** - * A list of region codes that identify countries where the video is viewable. - * If this property is present and a country is not listed in its value, then - * the video is blocked from appearing in that country. If this property is - * present and contains an empty list, the video is blocked in all countries. - */ - allowed: string[]; - /** - * A list of region codes that identify countries where the video is blocked. - * If this property is present and a country is not listed in its value, then - * the video is viewable in that country. If this property is present and - * contains an empty list, the video is viewable in all countries. - */ - blocked: string[]; -} -/** - * Describes original video file properties, including technical details about - * audio and video streams, but also metadata information like content length, - * digitization time, or geotagging information. - */ -export interface Schema$VideoFileDetails { - /** - * A list of audio streams contained in the uploaded video file. Each item in - * the list contains detailed metadata about an audio stream. - */ - audioStreams: Schema$VideoFileDetailsAudioStream[]; - /** - * The uploaded video file's combined (video and audio) bitrate in bits - * per second. - */ - bitrateBps: string; - /** - * The uploaded video file's container format. - */ - container: string; - /** - * The date and time when the uploaded video file was created. The value is - * specified in ISO 8601 format. Currently, the following ISO 8601 formats are - * supported: - Date only: YYYY-MM-DD - Naive time: YYYY-MM-DDTHH:MM:SS - - * Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM - */ - creationTime: string; - /** - * The length of the uploaded video in milliseconds. - */ - durationMs: string; - /** - * The uploaded file's name. This field is present whether a video file or - * another type of file was uploaded. - */ - fileName: string; - /** - * The uploaded file's size in bytes. This field is present whether a - * video file or another type of file was uploaded. - */ - fileSize: string; - /** - * The uploaded file's type as detected by YouTube's video processing - * engine. Currently, YouTube only processes video files, but this field is - * present whether a video file or another type of file was uploaded. - */ - fileType: string; - /** - * A list of video streams contained in the uploaded video file. Each item in - * the list contains detailed metadata about a video stream. - */ - videoStreams: Schema$VideoFileDetailsVideoStream[]; -} -/** - * Information about an audio stream. - */ -export interface Schema$VideoFileDetailsAudioStream { - /** - * The audio stream's bitrate, in bits per second. - */ - bitrateBps: string; - /** - * The number of audio channels that the stream contains. - */ - channelCount: number; - /** - * The audio codec that the stream uses. - */ - codec: string; - /** - * A value that uniquely identifies a video vendor. Typically, the value is a - * four-letter vendor code. - */ - vendor: string; -} -/** - * Information about a video stream. - */ -export interface Schema$VideoFileDetailsVideoStream { - /** - * The video content's display aspect ratio, which specifies the aspect - * ratio in which the video should be displayed. - */ - aspectRatio: number; - /** - * The video stream's bitrate, in bits per second. - */ - bitrateBps: string; - /** - * The video codec that the stream uses. - */ - codec: string; - /** - * The video stream's frame rate, in frames per second. - */ - frameRateFps: number; - /** - * The encoded video content's height in pixels. - */ - heightPixels: number; - /** - * The amount that YouTube needs to rotate the original source content to - * properly display the video. - */ - rotation: string; - /** - * A value that uniquely identifies a video vendor. Typically, the value is a - * four-letter vendor code. - */ - vendor: string; - /** - * The encoded video content's width in pixels. You can calculate the - * video's encoding aspect ratio as width_pixels / height_pixels. - */ - widthPixels: number; -} -export interface Schema$VideoGetRatingResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of ratings that match the request criteria. - */ - items: Schema$VideoRating[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoGetRatingResponse". - */ - kind: string; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -export interface Schema$VideoListResponse { - /** - * Etag of this resource. - */ - etag: string; - /** - * Serialized EventId of the request which produced this response. - */ - eventId: string; - /** - * A list of videos that match the request criteria. - */ - items: Schema$Video[]; - /** - * Identifies what kind of resource this is. Value: the fixed string - * "youtube#videoListResponse". - */ - kind: string; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; - pageInfo: Schema$PageInfo; - /** - * The token that can be used as the value of the pageToken parameter to - * retrieve the previous page in the result set. - */ - prevPageToken: string; - tokenPagination: Schema$TokenPagination; - /** - * The visitorId identifies the visitor. - */ - visitorId: string; -} -/** - * Details about the live streaming metadata. - */ -export interface Schema$VideoLiveStreamingDetails { - /** - * The ID of the currently active live chat attached to this video. This field - * is filled only if the video is a currently live broadcast that has live - * chat. Once the broadcast transitions to complete this field will be removed - * and the live chat closed down. For persistent broadcasts that live chat id - * will no longer be tied to this video but rather to the new video being - * displayed at the persistent page. - */ - activeLiveChatId: string; - /** - * The time that the broadcast actually ended. The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available - * until the broadcast is over. - */ - actualEndTime: string; - /** - * The time that the broadcast actually started. The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available - * until the broadcast begins. - */ - actualStartTime: string; - /** - * The number of viewers currently watching the broadcast. The property and - * its value will be present if the broadcast has current viewers and the - * broadcast owner has not hidden the viewcount for the video. Note that - * YouTube stops tracking the number of concurrent viewers for a broadcast - * when the broadcast ends. So, this property would not identify the number of - * viewers watching an archived video of a live broadcast that already ended. - */ - concurrentViewers: string; - /** - * The time that the broadcast is scheduled to end. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. If the value is empty or the - * property is not present, then the broadcast is scheduled to continue - * indefinitely. - */ - scheduledEndTime: string; - /** - * The time that the broadcast is scheduled to begin. The value is specified - * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - scheduledStartTime: string; -} -/** - * Localized versions of certain video properties (e.g. title). - */ -export interface Schema$VideoLocalization { - /** - * Localized version of the video's description. - */ - description: string; - /** - * Localized version of the video's title. - */ - title: string; -} -/** - * Details about monetization of a YouTube Video. - */ -export interface Schema$VideoMonetizationDetails { - /** - * The value of access indicates whether the video can be monetized or not. - */ - access: Schema$AccessPolicy; -} -/** - * Player to be used for a video playback. - */ -export interface Schema$VideoPlayer { - embedHeight: string; - /** - * An <iframe> tag that embeds a player that will play the video. - */ - embedHtml: string; - /** - * The embed width - */ - embedWidth: string; -} -/** - * Describes processing status and progress and availability of some other Video - * resource parts. - */ -export interface Schema$VideoProcessingDetails { - /** - * This value indicates whether video editing suggestions, which might improve - * video quality or the playback experience, are available for the video. You - * can retrieve these suggestions by requesting the suggestions part in your - * videos.list() request. - */ - editorSuggestionsAvailability: string; - /** - * This value indicates whether file details are available for the uploaded - * video. You can retrieve a video's file details by requesting the - * fileDetails part in your videos.list() request. - */ - fileDetailsAvailability: string; - /** - * The reason that YouTube failed to process the video. This property will - * only have a value if the processingStatus property's value is failed. - */ - processingFailureReason: string; - /** - * This value indicates whether the video processing engine has generated - * suggestions that might improve YouTube's ability to process the the - * video, warnings that explain video processing problems, or errors that - * cause video processing problems. You can retrieve these suggestions by - * requesting the suggestions part in your videos.list() request. - */ - processingIssuesAvailability: string; - /** - * The processingProgress object contains information about the progress - * YouTube has made in processing the video. The values are really only - * relevant if the video's processing status is processing. - */ - processingProgress: Schema$VideoProcessingDetailsProcessingProgress; - /** - * The video's processing status. This value indicates whether YouTube was - * able to process the video or if the video is still being processed. - */ - processingStatus: string; - /** - * This value indicates whether keyword (tag) suggestions are available for - * the video. Tags can be added to a video's metadata to make it easier - * for other users to find the video. You can retrieve these suggestions by - * requesting the suggestions part in your videos.list() request. - */ - tagSuggestionsAvailability: string; - /** - * This value indicates whether thumbnail images have been generated for the - * video. - */ - thumbnailsAvailability: string; -} -/** - * Video processing progress and completion time estimate. - */ -export interface Schema$VideoProcessingDetailsProcessingProgress { - /** - * The number of parts of the video that YouTube has already processed. You - * can estimate the percentage of the video that YouTube has already processed - * by calculating: 100 * parts_processed / parts_total Note that since the - * estimated number of parts could increase without a corresponding increase - * in the number of parts that have already been processed, it is possible - * that the calculated progress could periodically decrease while YouTube - * processes a video. - */ - partsProcessed: string; - /** - * An estimate of the total number of parts that need to be processed for the - * video. The number may be updated with more precise estimates while YouTube - * processes the video. - */ - partsTotal: string; - /** - * An estimate of the amount of time, in millseconds, that YouTube needs to - * finish processing the video. - */ - timeLeftMs: string; -} -/** - * Project specific details about the content of a YouTube Video. - */ -export interface Schema$VideoProjectDetails { - /** - * A list of project tags associated with the video during the upload. - */ - tags: string[]; -} -export interface Schema$VideoRating { - rating: string; - videoId: string; -} -/** - * Recording information associated with the video. - */ -export interface Schema$VideoRecordingDetails { - /** - * The geolocation information associated with the video. - */ - location: Schema$GeoPoint; - /** - * The text description of the location where the video was recorded. - */ - locationDescription: string; - /** - * The date and time when the video was recorded. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. - */ - recordingDate: string; -} -/** - * Basic details about a video, including title, description, uploader, - * thumbnails and category. - */ -export interface Schema$VideoSnippet { - /** - * The YouTube video category associated with the video. - */ - categoryId: string; - /** - * The ID that YouTube uses to uniquely identify the channel that the video - * was uploaded to. - */ - channelId: string; - /** - * Channel title for the channel that the video belongs to. - */ - channelTitle: string; - /** - * The default_audio_language property specifies the language spoken in the - * video's default audio track. - */ - defaultAudioLanguage: string; - /** - * The language of the videos's default snippet. - */ - defaultLanguage: string; - /** - * The video's description. - */ - description: string; - /** - * Indicates if the video is an upcoming/active live broadcast. Or it's - * "none" if the video is not an upcoming/active live broadcast. - */ - liveBroadcastContent: string; - /** - * Localized snippet selected with the hl parameter. If no such localization - * exists, this field is populated with the default snippet. (Read-only) - */ - localized: Schema$VideoLocalization; - /** - * The date and time that the video was uploaded. The value is specified in - * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * A list of keyword tags associated with the video. Tags may contain spaces. - */ - tags: string[]; - /** - * A map of thumbnail images associated with the video. For each object in the - * map, the key is the name of the thumbnail image, and the value is an object - * that contains other information about the thumbnail. - */ - thumbnails: Schema$ThumbnailDetails; - /** - * The video's title. - */ - title: string; -} -/** - * Statistics about the video, such as the number of times the video was viewed - * or liked. - */ -export interface Schema$VideoStatistics { - /** - * The number of comments for the video. - */ - commentCount: string; - /** - * The number of users who have indicated that they disliked the video by - * giving it a negative rating. - */ - dislikeCount: string; - /** - * The number of users who currently have the video marked as a favorite - * video. - */ - favoriteCount: string; - /** - * The number of users who have indicated that they liked the video by giving - * it a positive rating. - */ - likeCount: string; - /** - * The number of times the video has been viewed. - */ - viewCount: string; -} -/** - * Basic details about a video category, such as its localized title. - */ -export interface Schema$VideoStatus { - /** - * This value indicates if the video can be embedded on another website. - */ - embeddable: boolean; - /** - * This value explains why a video failed to upload. This property is only - * present if the uploadStatus property indicates that the upload failed. - */ - failureReason: string; - /** - * The video's license. - */ - license: string; - /** - * The video's privacy status. - */ - privacyStatus: string; - /** - * This value indicates if the extended video statistics on the watch page can - * be viewed by everyone. Note that the view count, likes, etc will still be - * visible if this is disabled. - */ - publicStatsViewable: boolean; - /** - * The date and time when the video is scheduled to publish. It can be set - * only if the privacy status of the video is private. The value is specified - * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishAt: string; - /** - * This value explains why YouTube rejected an uploaded video. This property - * is only present if the uploadStatus property indicates that the upload was - * rejected. - */ - rejectionReason: string; - /** - * The status of the uploaded video. - */ - uploadStatus: string; -} -/** - * Specifies suggestions on how to improve video content, including encoding - * hints, tag suggestions, and editor suggestions. - */ -export interface Schema$VideoSuggestions { - /** - * A list of video editing operations that might improve the video quality or - * playback experience of the uploaded video. - */ - editorSuggestions: string[]; - /** - * A list of errors that will prevent YouTube from successfully processing the - * uploaded video video. These errors indicate that, regardless of the - * video's current processing status, eventually, that status will almost - * certainly be failed. - */ - processingErrors: string[]; - /** - * A list of suggestions that may improve YouTube's ability to process the - * video. - */ - processingHints: string[]; - /** - * A list of reasons why YouTube may have difficulty transcoding the uploaded - * video or that might result in an erroneous transcoding. These warnings are - * generated before YouTube actually processes the uploaded video file. In - * addition, they identify issues that are unlikely to cause the video - * processing to fail but that might cause problems such as sync issues, video - * artifacts, or a missing audio track. - */ - processingWarnings: string[]; - /** - * A list of keyword tags that could be added to the video's metadata to - * increase the likelihood that users will locate your video when searching or - * browsing on YouTube. - */ - tagSuggestions: Schema$VideoSuggestionsTagSuggestion[]; -} -/** - * A single tag suggestion with it's relevance information. - */ -export interface Schema$VideoSuggestionsTagSuggestion { - /** - * A set of video categories for which the tag is relevant. You can use this - * information to display appropriate tag suggestions based on the video - * category that the video uploader associates with the video. By default, tag - * suggestions are relevant for all categories if there are no restricts - * defined for the keyword. - */ - categoryRestricts: string[]; - /** - * The keyword tag suggested for the video. - */ - tag: string; -} -/** - * Freebase topic information related to the video. - */ -export interface Schema$VideoTopicDetails { - /** - * Similar to topic_id, except that these topics are merely relevant to the - * video. These are topics that may be mentioned in, or appear in the video. - * You can retrieve information about each topic using Freebase Topic API. - */ - relevantTopicIds: string[]; - /** - * A list of Wikipedia URLs that provide a high-level description of the - * video's content. - */ - topicCategories: string[]; - /** - * A list of Freebase topic IDs that are centrally associated with the video. - * These are topics that are centrally featured in the video, and it can be - * said that the video is mainly about each of these. You can retrieve - * information about each topic using the Freebase Topic API. - */ - topicIds: string[]; -} -/** - * Branding properties for the watch. All deprecated. - */ -export interface Schema$WatchSettings { - /** - * The text color for the video watch page's branded area. - */ - backgroundColor: string; - /** - * An ID that uniquely identifies a playlist that displays next to the video - * player. - */ - featuredPlaylistId: string; - /** - * The background color for the video watch page's branded area. - */ - textColor: string; -} - -export class Resource$Activities { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.activities.insert - * @desc Posts a bulletin for a specific channel. (The user submitting the - * request must be authorized to act on the channel's behalf.) Note: Even - * though an activity resource can contain information about actions like a - * user rating a video or marking a video as a favorite, you need to use other - * API methods to generate those activity resources. For example, you would - * use the API's videos.rate() method to rate a video and the - * playlistItems.insert() method to mark a video as a favorite. - * @alias youtube.activities.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - * @param {().Activity} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/activities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.activities.list - * @desc Returns a list of channel activity events that match the request - * criteria. For example, you can retrieve events associated with a particular - * channel, events associated with the user's subscriptions and Google+ - * friends, or the YouTube home page feed, which is customized for each user. - * @alias youtube.activities.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities. - * @param {boolean=} params.home Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's activities. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. - * @param {string=} params.publishedAfter The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - * @param {string=} params.publishedBefore The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - * @param {string=} params.regionCode The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/activities') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Captions { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.captions.delete - * @desc Deletes a specified caption track. - * @alias youtube.captions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. - * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.captions.download - * @desc Downloads a caption track. The caption track is returned in its - * original format unless the request specifies a value for the tfmt parameter - * and in its original language unless the request specifies a value for the - * tlang parameter. - * @alias youtube.captions.download - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource. - * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.tfmt The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format. - * @param {string=} params.tlang The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - download(params?: any, options?: MethodOptions): AxiosPromise; - download( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - download( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/captions/{id}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: ['id'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.captions.insert - * @desc Uploads a caption track. - * @alias youtube.captions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet. - * @param {boolean=} params.sync The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions. You should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.captions.list - * @desc Returns a list of caption tracks that are associated with a specified - * video. Note that the API response does not contain the actual captions and - * that the captions.download method provides the ability to retrieve a - * caption track. - * @alias youtube.captions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video. - * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is on behalf of. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet. - * @param {string} params.videoId The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part', 'videoId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.captions.update - * @desc Updates a caption track. When updating a caption track, you can - * change the track's draft status, upload a new caption file for the track, - * or both. - * @alias youtube.captions.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id. - * @param {boolean=} params.sync Note: The API server only processes the parameter value if the request contains an updated caption file. The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/youtube/v3/captions') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channelbanners { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.channelBanners.insert - * @desc Uploads a channel banner image to YouTube. This method represents the - * first two steps in a three-step process to update the banner image for a - * channel: - Call the channelBanners.insert method to upload the binary - * image data to YouTube. The image must have a 16:9 aspect ratio and be at - * least 2120x1192 pixels. - Extract the url property's value from the - * response that the API returns for step 1. - Call the channels.update method - * to update the channel's branding settings. Set the - * brandingSettings.image.bannerExternalUrl property's value to the URL - * obtained in step 2. - * @alias youtube.channelBanners.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId The channelId parameter identifies the YouTube channel to which the banner is uploaded. The channelId parameter was introduced as a required parameter in May 2017. As this was a backward-incompatible change, channelBanners.insert requests that do not specify this parameter will not return an error until six months have passed from the time that the parameter was introduced. Please see the API Terms of Service for the official policy regarding backward incompatible changes and the API revision history for the exact date that the parameter was introduced. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channelBanners/insert') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/youtube/v3/channelBanners/insert') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channels { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.channels.list - * @desc Returns a collection of zero or more channel resources that match the - * request criteria. - * @alias youtube.channels.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.categoryId The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category. - * @param {string=} params.forUsername The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username. - * @param {string=} params.hl The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID. - * @param {boolean=} params.managedByMe Note: This parameter is intended exclusively for YouTube content partners. Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user. - * @param {boolean=} params.mySubscribers Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.channels.update - * @desc Updates a channel's metadata. Note that this method currently only - * supports updates to the channel resource's brandingSettings and - * invideoPromotion objects and their child properties. - * @alias youtube.channels.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.) Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. - * @param {().Channel} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channels') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Channelsections { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.channelSections.delete - * @desc Deletes a channelSection. - * @alias youtube.channelSections.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channelSections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.channelSections.insert - * @desc Adds a channelSection for the authenticated user's channel. - * @alias youtube.channelSections.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part names that you can include in the parameter value are snippet and contentDetails. - * @param {().ChannelSection} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channelSections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.channelSections.list - * @desc Returns channelSection resources that match the API request criteria. - * @alias youtube.channelSections.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections. - * @param {string=} params.hl The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID. - * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channelSections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.channelSections.update - * @desc Update a channelSection. - * @alias youtube.channelSections.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part names that you can include in the parameter value are snippet and contentDetails. - * @param {().ChannelSection} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/channelSections') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Comments { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.comments.delete - * @desc Deletes a comment. - * @alias youtube.comments.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the comment ID for the resource that is being deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.comments.insert - * @desc Creates a reply to an existing comment. Note: To create a top-level - * comment, use the commentThreads.insert method. - * @alias youtube.comments.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.comments.list - * @desc Returns a list of comments that match the API request parameters. - * @alias youtube.comments.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.parentId The parentId parameter specifies the ID of the comment for which replies should be retrieved. Note: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include. - * @param {string=} params.textFormat This parameter indicates whether the API should return comments formatted as HTML or as plain text. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.comments.markAsSpam - * @desc Expresses the caller's opinion that one or more comments should be - * flagged as spam. - * @alias youtube.comments.markAsSpam - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - markAsSpam(params?: any, options?: MethodOptions): AxiosPromise; - markAsSpam( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - markAsSpam( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments/markAsSpam') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.comments.setModerationStatus - * @desc Sets the moderation status of one or more comments. The API request - * must be authorized by the owner of the channel or video associated with the - * comments. - * @alias youtube.comments.setModerationStatus - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.banAuthor The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author. Note: This parameter is only valid if the moderationStatus parameter is also set to rejected. - * @param {string} params.id The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status. - * @param {string} params.moderationStatus Identifies the new moderation status of the specified comments. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - setModerationStatus(params?: any, options?: MethodOptions): - AxiosPromise; - setModerationStatus( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - setModerationStatus( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments/setModerationStatus') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id', 'moderationStatus'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.comments.update - * @desc Modifies a comment. - * @alias youtube.comments.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. - * @param {().Comment} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/comments') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Commentthreads { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.commentThreads.insert - * @desc Creates a new top-level comment. To add a reply to an existing - * comment, use the comments.insert method instead. - * @alias youtube.commentThreads.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. - * @param {().CommentThread} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/commentThreads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.commentThreads.list - * @desc Returns a list of comment threads that match the API request - * parameters. - * @alias youtube.commentThreads.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.allThreadsRelatedToChannelId The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos. - * @param {string=} params.channelId The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.) - * @param {string=} params.id The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.moderationStatus Set this parameter to limit the returned comment threads to a particular moderation state. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.order The order parameter specifies the order in which the API response should list comment threads. Valid values are: - time - Comment threads are ordered by time. This is the default behavior. - relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include. - * @param {string=} params.searchTerms The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms. Note: This parameter is not supported for use in conjunction with the id parameter. - * @param {string=} params.textFormat Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text. - * @param {string=} params.videoId The videoId parameter instructs the API to return comment threads associated with the specified video ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/commentThreads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.commentThreads.update - * @desc Modifies the top-level comment in a comment thread. - * @alias youtube.commentThreads.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. - * @param {().CommentThread} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/commentThreads') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Fanfundingevents { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.fanFundingEvents.list - * @desc Lists fan funding events for a channel. - * @alias youtube.fanFundingEvents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies the fanFundingEvent resource parts that the API response will include. Supported values are id and snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/fanFundingEvents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Guidecategories { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.guideCategories.list - * @desc Returns a list of categories that can be associated with YouTube - * channels. - * @alias youtube.guideCategories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter specifies the language that will be used for text values in the API response. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID. - * @param {string} params.part The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet. - * @param {string=} params.regionCode The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/guideCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$I18nlanguages { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.i18nLanguages.list - * @desc Returns a list of application languages that the YouTube website - * supports. - * @alias youtube.i18nLanguages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. - * @param {string} params.part The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/i18nLanguages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$I18nregions { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.i18nRegions.list - * @desc Returns a list of content regions that the YouTube website supports. - * @alias youtube.i18nRegions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. - * @param {string} params.part The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/i18nRegions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Livebroadcasts { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.liveBroadcasts.bind - * @desc Binds a YouTube broadcast to a stream or removes an existing binding - * between a broadcast and a stream. A broadcast can only be bound to one - * video stream, though a video stream may be bound to more than one - * broadcast. - * @alias youtube.liveBroadcasts.bind - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - * @param {string=} params.streamId The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - bind(params?: any, options?: MethodOptions): - AxiosPromise; - bind( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - bind( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts/bind') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id', 'part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.control - * @desc Controls the settings for a slate that can be displayed in the - * broadcast stream. - * @alias youtube.liveBroadcasts.control - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.displaySlate The displaySlate parameter specifies whether the slate is being enabled or disabled. - * @param {string} params.id The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated. - * @param {string=} params.offsetTimeMs The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time. If you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details. Important: You should only specify a value for this parameter if your broadcast stream is delayed. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - * @param {string=} params.walltime The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - control(params?: any, options?: MethodOptions): - AxiosPromise; - control( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - control( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts/control') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id', 'part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.delete - * @desc Deletes a broadcast. - * @alias youtube.liveBroadcasts.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.insert - * @desc Creates a broadcast. - * @alias youtube.liveBroadcasts.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. - * @param {().LiveBroadcast} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.list - * @desc Returns a list of YouTube broadcasts that match the API request - * parameters. - * @alias youtube.liveBroadcasts.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.broadcastStatus The broadcastStatus parameter filters the API response to only include broadcasts with the specified status. - * @param {string=} params.broadcastType The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now. - * @param {string=} params.id The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.transition - * @desc Changes the status of a YouTube live broadcast and initiates any - * processes associated with the new status. For example, when you transition - * a broadcast's status to testing, YouTube starts to transmit video to that - * broadcast's monitor stream. Before calling this method, you should confirm - * that the value of the status.streamStatus property for the stream bound to - * your broadcast is active. - * @alias youtube.liveBroadcasts.transition - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.broadcastStatus The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. - * @param {string} params.id The id parameter specifies the unique ID of the broadcast that is transitioning to another status. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - transition(params?: any, options?: MethodOptions): - AxiosPromise; - transition( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - transition( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts/transition') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['broadcastStatus', 'id', 'part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveBroadcasts.update - * @desc Updates a broadcast. For example, you could modify the broadcast - * settings defined in the liveBroadcast resource's contentDetails object. - * @alias youtube.liveBroadcasts.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting. - * @param {().LiveBroadcast} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveBroadcasts') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Livechatbans { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.liveChatBans.delete - * @desc Removes a chat ban. - * @alias youtube.liveChatBans.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/bans') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveChatBans.insert - * @desc Adds a new ban to the chat. - * @alias youtube.liveChatBans.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. - * @param {().LiveChatBan} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/bans') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Livechatmessages { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.liveChatMessages.delete - * @desc Deletes a chat message. - * @alias youtube.liveChatMessages.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube chat message ID of the resource that is being deleted. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveChatMessages.insert - * @desc Adds a message to a live chat. - * @alias youtube.liveChatMessages.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet. - * @param {().LiveChatMessage} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveChatMessages.list - * @desc Lists live chat messages for a specific chat. - * @alias youtube.liveChatMessages.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. - * @param {string} params.liveChatId The liveChatId parameter specifies the ID of the chat whose messages will be returned. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of messages that should be returned in the result set. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet. - * @param {integer=} params.profileImageSize The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/messages') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['liveChatId', 'part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Livechatmoderators { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.liveChatModerators.delete - * @desc Removes a chat moderator. - * @alias youtube.liveChatModerators.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/moderators') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveChatModerators.insert - * @desc Adds a new moderator for the chat. - * @alias youtube.liveChatModerators.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. - * @param {().LiveChatModerator} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/moderators') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveChatModerators.list - * @desc Lists moderators for a live chat. - * @alias youtube.liveChatModerators.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.liveChatId The liveChatId parameter specifies the YouTube live chat for which the API should return moderators. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveChat/moderators') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['liveChatId', 'part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Livestreams { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.liveStreams.delete - * @desc Deletes a video stream. - * @alias youtube.liveStreams.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube live stream ID for the resource that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveStreams') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveStreams.insert - * @desc Creates a video stream. The stream enables you to send your video to - * YouTube, which can then broadcast the video to your audience. - * @alias youtube.liveStreams.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, and status. - * @param {().LiveStream} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveStreams') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveStreams.list - * @desc Returns a list of video streams that match the API request - * parameters. - * @alias youtube.liveStreams.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveStreams') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.liveStreams.update - * @desc Updates a video stream. If the properties that you want to change - * cannot be updated, then you need to create a new stream with the proper - * settings. - * @alias youtube.liveStreams.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, and status. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed. - * @param {().LiveStream} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/liveStreams') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Playlistitems { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.playlistItems.delete - * @desc Deletes a playlist item. - * @alias youtube.playlistItems.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlistItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlistItems.insert - * @desc Adds a resource to a playlist. - * @alias youtube.playlistItems.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - * @param {().PlaylistItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlistItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlistItems.list - * @desc Returns a collection of playlist items that match the API request - * parameters. You can retrieve all of the playlist items in a specified - * playlist or retrieve one or more playlist items by their unique IDs. - * @alias youtube.playlistItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of one or more unique playlist item IDs. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. - * @param {string=} params.playlistId The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter. - * @param {string=} params.videoId The videoId parameter specifies that the request should return only the playlist items that contain the specified video. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlistItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlistItems.update - * @desc Modifies a playlist item. For example, you could update the item's - * position in the playlist. - * @alias youtube.playlistItems.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings. - * @param {().PlaylistItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): - AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlistItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Playlists { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.playlists.delete - * @desc Deletes a playlist. - * @alias youtube.playlists.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlists.insert - * @desc Creates a playlist. - * @alias youtube.playlists.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - * @param {().Playlist} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlists.list - * @desc Returns a collection of playlists that match the API request - * parameters. For example, you can retrieve all playlists that the - * authenticated user owns, or you can retrieve one or more playlists by their - * unique IDs. - * @alias youtube.playlists.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId This value indicates that the API should only return the specified channel's playlists. - * @param {string=} params.hl The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.playlists.update - * @desc Modifies a playlist. For example, you could change a playlist's - * title, description, or privacy status. - * @alias youtube.playlists.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted. - * @param {().Playlist} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/playlists') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Search { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.search.list - * @desc Returns a collection of search results that match the query - * parameters specified in the API request. By default, a search result set - * identifies matching video, channel, and playlist resources, but you can - * also configure queries to only retrieve a specific type of resource. - * @alias youtube.search.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId The channelId parameter indicates that the API response should only contain resources created by the channel - * @param {string=} params.channelType The channelType parameter lets you restrict a search to a particular type of channel. - * @param {string=} params.eventType The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {boolean=} params.forContentOwner Note: This parameter is intended exclusively for YouTube content partners. The forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. - * @param {boolean=} params.forDeveloper The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites. - * @param {boolean=} params.forMine The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video. - * @param {string=} params.location The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427). - The location parameter value identifies the point at the center of the area. - The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter. - * @param {string=} params.locationRadius The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. Note: See the definition of the location parameter for more information. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.order The order parameter specifies the method that will be used to order resources in the API response. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet. - * @param {string=} params.publishedAfter The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). - * @param {string=} params.publishedBefore The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). - * @param {string=} params.q The q parameter specifies the query term to search for. Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C. - * @param {string=} params.regionCode The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. - * @param {string=} params.relatedToVideoId The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video. - * @param {string=} params.relevanceLanguage The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term. - * @param {string=} params.safeSearch The safeSearch parameter indicates whether the search results should include restricted content as well as standard content. - * @param {string=} params.topicId The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID. - * @param {string=} params.type The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types. - * @param {string=} params.videoCaption The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoCategoryId The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoDefinition The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoDimension The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoDuration The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoEmbeddable The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoLicense The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoSyndicated The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {string=} params.videoType The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/search').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Sponsors { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.sponsors.list - * @desc Lists sponsors for a channel. - * @alias youtube.sponsors.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.filter The filter parameter specifies which channel sponsors to return. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/sponsors') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Subscriptions { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.subscriptions.delete - * @desc Deletes a subscription. - * @alias youtube.subscriptions.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.subscriptions.insert - * @desc Adds a subscription for the authenticated user's channel. - * @alias youtube.subscriptions.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. - * @param {().Subscription} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): - AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.subscriptions.list - * @desc Returns subscription resources that match the API request criteria. - * @alias youtube.subscriptions.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions. - * @param {string=} params.forChannelId The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions. - * @param {boolean=} params.myRecentSubscribers Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in reverse chronological order (newest first). - * @param {boolean=} params.mySubscribers Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string=} params.order The order parameter specifies the method that will be used to sort resources in the API response. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/subscriptions') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Superchatevents { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.superChatEvents.list - * @desc Lists Super Chat events for a channel. - * @alias youtube.superChatEvents.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. - * @param {string} params.part The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/superChatEvents') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Thumbnails { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.thumbnails.set - * @desc Uploads a custom video thumbnail to YouTube and sets it for a video. - * @alias youtube.thumbnails.set - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.videoId The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided. - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - set(params?: any, - options?: MethodOptions): AxiosPromise; - set(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - set(params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/thumbnails/set') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/youtube/v3/thumbnails/set') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['videoId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Videoabusereportreasons { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.videoAbuseReportReasons.list - * @desc Returns a list of abuse reasons that can be used for reporting - * abusive videos. - * @alias youtube.videoAbuseReportReasons.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. - * @param {string} params.part The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: - BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videoAbuseReportReasons') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest( - parameters, callback); - } else { - return createAPIRequest( - parameters); - } - } -} - -export class Resource$Videocategories { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.videoCategories.list - * @desc Returns a list of categories that can be associated with YouTube - * videos. - * @alias youtube.videoCategories.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. - * @param {string=} params.id The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving. - * @param {string} params.part The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet. - * @param {string=} params.regionCode The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videoCategories') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Videos { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - +export namespace youtube_v3 { /** - * youtube.videos.delete - * @desc Deletes a YouTube video. - * @alias youtube.videos.delete - * @memberOf! () + * YouTube Data API * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.videos.getRating - * @desc Retrieves the ratings that the authorized user gave to a list of - * specified videos. - * @alias youtube.videos.getRating - * @memberOf! () + * Supports core YouTube features, such as uploading videos, creating and + * managing playlists, searching for content, and much more. * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - getRating(params?: any, options?: MethodOptions): - AxiosPromise; - getRating( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - getRating( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos/getRating') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.videos.insert - * @desc Uploads a video to YouTube and optionally sets the video's metadata. - * @alias youtube.videos.insert - * @memberOf! () + * @example + * const google = require('googleapis'); + * const youtube = google.youtube('v3'); * - * @param {object} params Parameters for request - * @param {boolean=} params.autoLevels The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color. - * @param {boolean=} params.notifySubscribers The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. - * @param {boolean=} params.stabilize The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: - (rootUrl + '/upload/youtube/v3/videos').replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - + * @namespace youtube + * @type {Function} + * @version v3 + * @variation v3 + * @param {object=} options Options for Youtube + */ + export class Youtube { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + activities: Resource$Activities; + captions: Resource$Captions; + channelBanners: Resource$Channelbanners; + channels: Resource$Channels; + channelSections: Resource$Channelsections; + comments: Resource$Comments; + commentThreads: Resource$Commentthreads; + fanFundingEvents: Resource$Fanfundingevents; + guideCategories: Resource$Guidecategories; + i18nLanguages: Resource$I18nlanguages; + i18nRegions: Resource$I18nregions; + liveBroadcasts: Resource$Livebroadcasts; + liveChatBans: Resource$Livechatbans; + liveChatMessages: Resource$Livechatmessages; + liveChatModerators: Resource$Livechatmoderators; + liveStreams: Resource$Livestreams; + playlistItems: Resource$Playlistitems; + playlists: Resource$Playlists; + search: Resource$Search; + sponsors: Resource$Sponsors; + subscriptions: Resource$Subscriptions; + superChatEvents: Resource$Superchatevents; + thumbnails: Resource$Thumbnails; + videoAbuseReportReasons: Resource$Videoabusereportreasons; + videoCategories: Resource$Videocategories; + videos: Resource$Videos; + watermarks: Resource$Watermarks; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.activities = new Resource$Activities(this); + this.captions = new Resource$Captions(this); + this.channelBanners = new Resource$Channelbanners(this); + this.channels = new Resource$Channels(this); + this.channelSections = new Resource$Channelsections(this); + this.comments = new Resource$Comments(this); + this.commentThreads = new Resource$Commentthreads(this); + this.fanFundingEvents = new Resource$Fanfundingevents(this); + this.guideCategories = new Resource$Guidecategories(this); + this.i18nLanguages = new Resource$I18nlanguages(this); + this.i18nRegions = new Resource$I18nregions(this); + this.liveBroadcasts = new Resource$Livebroadcasts(this); + this.liveChatBans = new Resource$Livechatbans(this); + this.liveChatMessages = new Resource$Livechatmessages(this); + this.liveChatModerators = new Resource$Livechatmoderators(this); + this.liveStreams = new Resource$Livestreams(this); + this.playlistItems = new Resource$Playlistitems(this); + this.playlists = new Resource$Playlists(this); + this.search = new Resource$Search(this); + this.sponsors = new Resource$Sponsors(this); + this.subscriptions = new Resource$Subscriptions(this); + this.superChatEvents = new Resource$Superchatevents(this); + this.thumbnails = new Resource$Thumbnails(this); + this.videoAbuseReportReasons = new Resource$Videoabusereportreasons(this); + this.videoCategories = new Resource$Videocategories(this); + this.videos = new Resource$Videos(this); + this.watermarks = new Resource$Watermarks(this); + } + + getRoot() { + return this.root; + } + } + + /** + * Rights management policy for YouTube resources. + */ + export interface Schema$AccessPolicy { + /** + * The value of allowed indicates whether the access to the policy is + * allowed or denied by default. + */ + allowed: boolean; + /** + * A list of region codes that identify countries where the default policy + * do not apply. + */ + exception: string[]; + } + /** + * An activity resource contains information about an action that a particular + * channel, or user, has taken on YouTube.The actions reported in activity + * feeds include rating a video, sharing a video, marking a video as a + * favorite, commenting on a video, uploading a video, and so forth. Each + * activity resource identifies the type of action, the channel associated + * with the action, and the resource(s) associated with the action, such as + * the video that was rated or uploaded. + */ + export interface Schema$Activity { + /** + * The contentDetails object contains information about the content + * associated with the activity. For example, if the snippet.type value is + * videoRated, then the contentDetails object's content identifies the + * rated video. + */ + contentDetails: Schema$ActivityContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the activity. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#activity". + */ + kind: string; + /** + * The snippet object contains basic details about the activity, including + * the activity's type and group ID. + */ + snippet: Schema$ActivitySnippet; + } + /** + * Details about the content of an activity: the video that was shared, the + * channel that was subscribed to, etc. + */ + export interface Schema$ActivityContentDetails { + /** + * The bulletin object contains details about a channel bulletin post. This + * object is only present if the snippet.type is bulletin. + */ + bulletin: Schema$ActivityContentDetailsBulletin; + /** + * The channelItem object contains details about a resource which was added + * to a channel. This property is only present if the snippet.type is + * channelItem. + */ + channelItem: Schema$ActivityContentDetailsChannelItem; + /** + * The comment object contains information about a resource that received a + * comment. This property is only present if the snippet.type is comment. + */ + comment: Schema$ActivityContentDetailsComment; + /** + * The favorite object contains information about a video that was marked as + * a favorite video. This property is only present if the snippet.type is + * favorite. + */ + favorite: Schema$ActivityContentDetailsFavorite; + /** + * The like object contains information about a resource that received a + * positive (like) rating. This property is only present if the snippet.type + * is like. + */ + like: Schema$ActivityContentDetailsLike; + /** + * The playlistItem object contains information about a new playlist item. + * This property is only present if the snippet.type is playlistItem. + */ + playlistItem: Schema$ActivityContentDetailsPlaylistItem; + /** + * The promotedItem object contains details about a resource which is being + * promoted. This property is only present if the snippet.type is + * promotedItem. + */ + promotedItem: Schema$ActivityContentDetailsPromotedItem; + /** + * The recommendation object contains information about a recommended + * resource. This property is only present if the snippet.type is + * recommendation. + */ + recommendation: Schema$ActivityContentDetailsRecommendation; + /** + * The social object contains details about a social network post. This + * property is only present if the snippet.type is social. + */ + social: Schema$ActivityContentDetailsSocial; + /** + * The subscription object contains information about a channel that a user + * subscribed to. This property is only present if the snippet.type is + * subscription. + */ + subscription: Schema$ActivityContentDetailsSubscription; + /** + * The upload object contains information about the uploaded video. This + * property is only present if the snippet.type is upload. + */ + upload: Schema$ActivityContentDetailsUpload; + } + /** + * Details about a channel bulletin post. + */ + export interface Schema$ActivityContentDetailsBulletin { + /** + * The resourceId object contains information that identifies the resource + * associated with a bulletin post. + */ + resourceId: Schema$ResourceId; + } + /** + * Details about a resource which was added to a channel. + */ + export interface Schema$ActivityContentDetailsChannelItem { + /** + * The resourceId object contains information that identifies the resource + * that was added to the channel. + */ + resourceId: Schema$ResourceId; + } + /** + * Information about a resource that received a comment. + */ + export interface Schema$ActivityContentDetailsComment { + /** + * The resourceId object contains information that identifies the resource + * associated with the comment. + */ + resourceId: Schema$ResourceId; + } + /** + * Information about a video that was marked as a favorite video. + */ + export interface Schema$ActivityContentDetailsFavorite { + /** + * The resourceId object contains information that identifies the resource + * that was marked as a favorite. + */ + resourceId: Schema$ResourceId; + } + /** + * Information about a resource that received a positive (like) rating. + */ + export interface Schema$ActivityContentDetailsLike { + /** + * The resourceId object contains information that identifies the rated + * resource. + */ + resourceId: Schema$ResourceId; + } + /** + * Information about a new playlist item. + */ + export interface Schema$ActivityContentDetailsPlaylistItem { + /** + * The value that YouTube uses to uniquely identify the playlist. + */ + playlistId: string; + /** + * ID of the item within the playlist. + */ + playlistItemId: string; + /** + * The resourceId object contains information about the resource that was + * added to the playlist. + */ + resourceId: Schema$ResourceId; + } + /** + * Details about a resource which is being promoted. + */ + export interface Schema$ActivityContentDetailsPromotedItem { + /** + * The URL the client should fetch to request a promoted item. + */ + adTag: string; + /** + * The URL the client should ping to indicate that the user clicked through + * on this promoted item. + */ + clickTrackingUrl: string; + /** + * The URL the client should ping to indicate that the user was shown this + * promoted item. + */ + creativeViewUrl: string; + /** + * The type of call-to-action, a message to the user indicating action that + * can be taken. + */ + ctaType: string; + /** + * The custom call-to-action button text. If specified, it will override the + * default button text for the cta_type. + */ + customCtaButtonText: string; + /** + * The text description to accompany the promoted item. + */ + descriptionText: string; + /** + * The URL the client should direct the user to, if the user chooses to + * visit the advertiser's website. + */ + destinationUrl: string; + /** + * The list of forecasting URLs. The client should ping all of these URLs + * when a promoted item is not available, to indicate that a promoted item + * could have been shown. + */ + forecastingUrl: string[]; + /** + * The list of impression URLs. The client should ping all of these URLs to + * indicate that the user was shown this promoted item. + */ + impressionUrl: string[]; + /** + * The ID that YouTube uses to uniquely identify the promoted video. + */ + videoId: string; + } + /** + * Information that identifies the recommended resource. + */ + export interface Schema$ActivityContentDetailsRecommendation { + /** + * The reason that the resource is recommended to the user. + */ + reason: string; + /** + * The resourceId object contains information that identifies the + * recommended resource. + */ + resourceId: Schema$ResourceId; + /** + * The seedResourceId object contains information about the resource that + * caused the recommendation. + */ + seedResourceId: Schema$ResourceId; + } + /** + * Details about a social network post. + */ + export interface Schema$ActivityContentDetailsSocial { + /** + * The author of the social network post. + */ + author: string; + /** + * An image of the post's author. + */ + imageUrl: string; + /** + * The URL of the social network post. + */ + referenceUrl: string; + /** + * The resourceId object encapsulates information that identifies the + * resource associated with a social network post. + */ + resourceId: Schema$ResourceId; + /** + * The name of the social network. + */ + type: string; + } + /** + * Information about a channel that a user subscribed to. + */ + export interface Schema$ActivityContentDetailsSubscription { + /** + * The resourceId object contains information that identifies the resource + * that the user subscribed to. + */ + resourceId: Schema$ResourceId; + } + /** + * Information about the uploaded video. + */ + export interface Schema$ActivityContentDetailsUpload { + /** + * The ID that YouTube uses to uniquely identify the uploaded video. + */ + videoId: string; + } + export interface Schema$ActivityListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of activities, or events, that match the request criteria. + */ + items: Schema$Activity[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#activityListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about an activity, including title, description, thumbnails, + * activity type and group. + */ + export interface Schema$ActivitySnippet { + /** + * The ID that YouTube uses to uniquely identify the channel associated with + * the activity. + */ + channelId: string; + /** + * Channel title for the channel responsible for this activity + */ + channelTitle: string; + /** + * The description of the resource primarily associated with the activity. + */ + description: string; + /** + * The group ID associated with the activity. A group ID identifies user + * events that are associated with the same user and resource. For example, + * if a user rates a video and marks the same video as a favorite, the + * entries for those events would have the same group ID in the user's + * activity feed. In your user interface, you can avoid repetition by + * grouping events with the same groupId value. + */ + groupId: string; + /** + * The date and time that the video was uploaded. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * A map of thumbnail images associated with the resource that is primarily + * associated with the activity. For each object in the map, the key is the + * name of the thumbnail image, and the value is an object that contains + * other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The title of the resource primarily associated with the activity. + */ + title: string; + /** + * The type of activity that the resource describes. + */ + type: string; + } + /** + * A caption resource represents a YouTube caption track. A caption track is + * associated with exactly one YouTube video. + */ + export interface Schema$Caption { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the caption track. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#caption". + */ + kind: string; + /** + * The snippet object contains basic details about the caption. + */ + snippet: Schema$CaptionSnippet; + } + export interface Schema$CaptionListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of captions that match the request criteria. + */ + items: Schema$Caption[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#captionListResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a caption track, such as its language and name. + */ + export interface Schema$CaptionSnippet { + /** + * The type of audio track associated with the caption track. + */ + audioTrackType: string; + /** + * The reason that YouTube failed to process the caption track. This + * property is only present if the state property's value is failed. + */ + failureReason: string; + /** + * Indicates whether YouTube synchronized the caption track to the audio + * track in the video. The value will be true if a sync was explicitly + * requested when the caption track was uploaded. For example, when calling + * the captions.insert or captions.update methods, you can set the sync + * parameter to true to instruct YouTube to sync the uploaded track to the + * video. If the value is false, YouTube uses the time codes in the uploaded + * caption track to determine when to display captions. + */ + isAutoSynced: boolean; + /** + * Indicates whether the track contains closed captions for the deaf and + * hard of hearing. The default value is false. + */ + isCC: boolean; + /** + * Indicates whether the caption track is a draft. If the value is true, + * then the track is not publicly visible. The default value is false. + */ + isDraft: boolean; + /** + * Indicates whether caption track is formatted for "easy reader," + * meaning it is at a third-grade level for language learners. The default + * value is false. + */ + isEasyReader: boolean; + /** + * Indicates whether the caption track uses large text for the + * vision-impaired. The default value is false. + */ + isLarge: boolean; + /** + * The language of the caption track. The property value is a BCP-47 + * language tag. + */ + language: string; + /** + * The date and time when the caption track was last updated. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + lastUpdated: string; + /** + * The name of the caption track. The name is intended to be visible to the + * user as an option during playback. + */ + name: string; + /** + * The caption track's status. + */ + status: string; + /** + * The caption track's type. + */ + trackKind: string; + /** + * The ID that YouTube uses to uniquely identify the video associated with + * the caption track. + */ + videoId: string; + } + /** + * Brief description of the live stream cdn settings. + */ + export interface Schema$CdnSettings { + /** + * The format of the video stream that you are sending to Youtube. + */ + format: string; + /** + * The frame rate of the inbound video data. + */ + frameRate: string; + /** + * The ingestionInfo object contains information that YouTube provides that + * you need to transmit your RTMP or HTTP stream to YouTube. + */ + ingestionInfo: Schema$IngestionInfo; + /** + * The method or protocol used to transmit the video stream. + */ + ingestionType: string; + /** + * The resolution of the inbound video data. + */ + resolution: string; + } + /** + * A channel resource contains information about a YouTube channel. + */ + export interface Schema$Channel { + /** + * The auditionDetails object encapsulates channel data that is relevant for + * YouTube Partners during the audition process. + */ + auditDetails: Schema$ChannelAuditDetails; + /** + * The brandingSettings object encapsulates information about the branding + * of the channel. + */ + brandingSettings: Schema$ChannelBrandingSettings; + /** + * The contentDetails object encapsulates information about the + * channel's content. + */ + contentDetails: Schema$ChannelContentDetails; + /** + * The contentOwnerDetails object encapsulates channel data that is relevant + * for YouTube Partners linked with the channel. + */ + contentOwnerDetails: Schema$ChannelContentOwnerDetails; + /** + * The conversionPings object encapsulates information about conversion + * pings that need to be respected by the channel. + */ + conversionPings: Schema$ChannelConversionPings; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the channel. + */ + id: string; + /** + * The invideoPromotion object encapsulates information about promotion + * campaign associated with the channel. + */ + invideoPromotion: Schema$InvideoPromotion; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#channel". + */ + kind: string; + /** + * Localizations for different languages + */ + localizations: any; + /** + * The snippet object contains basic details about the channel, such as its + * title, description, and thumbnail images. + */ + snippet: Schema$ChannelSnippet; + /** + * The statistics object encapsulates statistics for the channel. + */ + statistics: Schema$ChannelStatistics; + /** + * The status object encapsulates information about the privacy status of + * the channel. + */ + status: Schema$ChannelStatus; + /** + * The topicDetails object encapsulates information about Freebase topics + * associated with the channel. + */ + topicDetails: Schema$ChannelTopicDetails; + } + /** + * The auditDetails object encapsulates channel data that is relevant for + * YouTube Partners during the audit process. + */ + export interface Schema$ChannelAuditDetails { + /** + * Whether or not the channel respects the community guidelines. + */ + communityGuidelinesGoodStanding: boolean; + /** + * Whether or not the channel has any unresolved claims. + */ + contentIdClaimsGoodStanding: boolean; + /** + * Whether or not the channel has any copyright strikes. + */ + copyrightStrikesGoodStanding: boolean; + /** + * Describes the general state of the channel. This field will always show + * if there are any issues whatsoever with the channel. Currently this field + * represents the result of the logical and operation over the community + * guidelines good standing, the copyright strikes good standing and the + * content ID claims good standing, but this may change in the future. + */ + overallGoodStanding: boolean; + } + /** + * A channel banner returned as the response to a channel_banner.insert call. + */ + export interface Schema$ChannelBannerResource { + /** + * Etag of this resource. + */ + etag: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#channelBannerResource". + */ + kind: string; + /** + * The URL of this banner image. + */ + url: string; + } + /** + * Branding properties of a YouTube channel. + */ + export interface Schema$ChannelBrandingSettings { + /** + * Branding properties for the channel view. + */ + channel: Schema$ChannelSettings; + /** + * Additional experimental branding properties. + */ + hints: Schema$PropertyValue[]; + /** + * Branding properties for branding images. + */ + image: Schema$ImageSettings; + /** + * Branding properties for the watch page. + */ + watch: Schema$WatchSettings; + } + /** + * Details about the content of a channel. + */ + export interface Schema$ChannelContentDetails { relatedPlaylists: any; } /** - * youtube.videos.list - * @desc Returns a list of videos that match the API request parameters. - * @alias youtube.videos.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.chart The chart parameter identifies the chart that you want to retrieve. - * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID. - * @param {string=} params.locale DEPRECATED - * @param {integer=} params.maxHeight The maxHeight parameter specifies a maximum height of the embedded player. If maxWidth is provided, maxHeight may not be reached in order to not violate the width request. - * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. - * @param {integer=} params.maxWidth The maxWidth parameter specifies a maximum width of the embedded player. If maxHeight is provided, maxWidth may not be reached in order to not violate the height request. - * @param {string=} params.myRating Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. - * @param {string} params.part The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. - * @param {string=} params.regionCode The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code. - * @param {string=} params.videoCategoryId The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The contentOwnerDetails object encapsulates channel data that is relevant + * for YouTube Partners linked with the channel. */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ChannelContentOwnerDetails { + /** + * The ID of the content owner linked to the channel. + */ + contentOwner: string; + /** + * The date and time of when the channel was linked to the content owner. + * The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + timeLinked: string; } - - /** - * youtube.videos.rate - * @desc Add a like or dislike rating to a video or remove a rating from a - * video. - * @alias youtube.videos.rate - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed. - * @param {string} params.rating Specifies the rating to record. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Pings that the app shall fire (authenticated by biscotti cookie). Each ping + * has a context, in which the app must fire the ping, and a url identifying + * the ping. */ - rate(params?: any, options?: MethodOptions): AxiosPromise; - rate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - rate( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos/rate') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['id', 'rating'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ChannelConversionPing { + /** + * Defines the context of the ping. + */ + context: string; + /** + * The url (without the schema) that the player shall send the ping to. + * It's at caller's descretion to decide which schema to use (http + * vs https) Example of a returned url: + * //googleads.g.doubleclick.net/pagead/ + * viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D + * cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must + * append biscotti authentication (ms param in case of mobile, for example) + * to this ping. + */ + conversionUrl: string; } - - /** - * youtube.videos.reportAbuse - * @desc Report abuse for a video. - * @alias youtube.videos.reportAbuse - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().VideoAbuseReport} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * The conversionPings object encapsulates information about conversion pings + * that need to be respected by the channel. */ - reportAbuse(params?: any, options?: MethodOptions): AxiosPromise; - reportAbuse( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - reportAbuse( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos/reportAbuse') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } + export interface Schema$ChannelConversionPings { + /** + * Pings that the app shall fire (authenticated by biscotti cookie). Each + * ping has a context, in which the app must fire the ping, and a url + * identifying the ping. + */ + pings: Schema$ChannelConversionPing[]; + } + export interface Schema$ChannelListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of channels that match the request criteria. + */ + items: Schema$Channel[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#channelListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Channel localization setting + */ + export interface Schema$ChannelLocalization { + /** + * The localized strings for channel's description. + */ + description: string; + /** + * The localized strings for channel's title. + */ + title: string; + } + export interface Schema$ChannelProfileDetails { + /** + * The YouTube channel ID. + */ + channelId: string; + /** + * The channel's URL. + */ + channelUrl: string; + /** + * The channel's display name. + */ + displayName: string; + /** + * The channels's avatar URL. + */ + profileImageUrl: string; + } + export interface Schema$ChannelSection { + /** + * The contentDetails object contains details about the channel section + * content, such as a list of playlists or channels featured in the section. + */ + contentDetails: Schema$ChannelSectionContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the channel section. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#channelSection". + */ + kind: string; + /** + * Localizations for different languages + */ + localizations: any; + /** + * The snippet object contains basic details about the channel section, such + * as its type, style and title. + */ + snippet: Schema$ChannelSectionSnippet; + /** + * The targeting object contains basic targeting settings about the channel + * section. + */ + targeting: Schema$ChannelSectionTargeting; + } + /** + * Details about a channelsection, including playlists and channels. + */ + export interface Schema$ChannelSectionContentDetails { + /** + * The channel ids for type multiple_channels. + */ + channels: string[]; + /** + * The playlist ids for type single_playlist and multiple_playlists. For + * singlePlaylist, only one playlistId is allowed. + */ + playlists: string[]; + } + export interface Schema$ChannelSectionListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of ChannelSections that match the request criteria. + */ + items: Schema$ChannelSection[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#channelSectionListResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * ChannelSection localization setting + */ + export interface Schema$ChannelSectionLocalization { + /** + * The localized strings for channel section's title. + */ + title: string; + } + /** + * Basic details about a channel section, including title, style and position. + */ + export interface Schema$ChannelSectionSnippet { + /** + * The ID that YouTube uses to uniquely identify the channel that published + * the channel section. + */ + channelId: string; + /** + * The language of the channel section's default title and description. + */ + defaultLanguage: string; + /** + * Localized title, read-only. + */ + localized: Schema$ChannelSectionLocalization; + /** + * The position of the channel section in the channel. + */ + position: number; + /** + * The style of the channel section. + */ + style: string; + /** + * The channel section's title for multiple_playlists and + * multiple_channels. + */ + title: string; + /** + * The type of the channel section. + */ + type: string; + } + /** + * ChannelSection targeting setting. + */ + export interface Schema$ChannelSectionTargeting { + /** + * The country the channel section is targeting. + */ + countries: string[]; + /** + * The language the channel section is targeting. + */ + languages: string[]; + /** + * The region the channel section is targeting. + */ + regions: string[]; } - - /** - * youtube.videos.update - * @desc Updates a video's metadata. - * @alias youtube.videos.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting. In addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. - * @param {().Video} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + * Branding properties for the channel view. */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/videos').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: ['part'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} - -export class Resource$Watermarks { - root: Youtube; - constructor(root: Youtube) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; - } - - - /** - * youtube.watermarks.set - * @desc Uploads a watermark image to YouTube and sets it for a channel. - * @alias youtube.watermarks.set - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} params.resource Media resource metadata - * @param {object} params.media Media object - * @param {string} params.media.mimeType Media mime-type - * @param {string|object} params.media.body Media body contents - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ChannelSettings { + /** + * The country of the channel. + */ + country: string; + defaultLanguage: string; + /** + * Which content tab users should see when viewing the channel. + */ + defaultTab: string; + /** + * Specifies the channel description. + */ + description: string; + /** + * Title for the featured channels tab. + */ + featuredChannelsTitle: string; + /** + * The list of featured channels. + */ + featuredChannelsUrls: string[]; + /** + * Lists keywords associated with the channel, comma-separated. + */ + keywords: string; + /** + * Whether user-submitted comments left on the channel page need to be + * approved by the channel owner to be publicly visible. + */ + moderateComments: boolean; + /** + * A prominent color that can be rendered on this channel page. + */ + profileColor: string; + /** + * Whether the tab to browse the videos should be displayed. + */ + showBrowseView: boolean; + /** + * Whether related channels should be proposed. + */ + showRelatedChannels: boolean; + /** + * Specifies the channel title. + */ + title: string; + /** + * The ID for a Google Analytics account to track and measure traffic to the + * channels. + */ + trackingAnalyticsAccountId: string; + /** + * The trailer of the channel, for users that are not subscribers. + */ + unsubscribedTrailer: string; + } + /** + * Basic details about a channel, including title, description and thumbnails. + */ + export interface Schema$ChannelSnippet { + /** + * The country of the channel. + */ + country: string; + /** + * The custom url of the channel. + */ + customUrl: string; + /** + * The language of the channel's default title and description. + */ + defaultLanguage: string; + /** + * The description of the channel. + */ + description: string; + /** + * Localized title and description, read-only. + */ + localized: Schema$ChannelLocalization; + /** + * The date and time that the channel was created. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * A map of thumbnail images associated with the channel. For each object in + * the map, the key is the name of the thumbnail image, and the value is an + * object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The channel's title. + */ + title: string; + } + /** + * Statistics about a channel: number of subscribers, number of videos in the + * channel, etc. + */ + export interface Schema$ChannelStatistics { + /** + * The number of comments for the channel. + */ + commentCount: string; + /** + * Whether or not the number of subscribers is shown for this user. + */ + hiddenSubscriberCount: boolean; + /** + * The number of subscribers that the channel has. + */ + subscriberCount: string; + /** + * The number of videos uploaded to the channel. + */ + videoCount: string; + /** + * The number of times the channel has been viewed. + */ + viewCount: string; + } + /** + * JSON template for the status part of a channel. + */ + export interface Schema$ChannelStatus { + /** + * If true, then the user is linked to either a YouTube username or G+ + * account. Otherwise, the user doesn't have a public YouTube identity. + */ + isLinked: boolean; + /** + * The long uploads status of this channel. See + */ + longUploadsStatus: string; + /** + * Privacy status of the channel. + */ + privacyStatus: string; + } + /** + * Freebase topic information related to the channel. + */ + export interface Schema$ChannelTopicDetails { + /** + * A list of Wikipedia URLs that describe the channel's content. + */ + topicCategories: string[]; + /** + * A list of Freebase topic IDs associated with the channel. You can + * retrieve information about each topic using the Freebase Topic API. + */ + topicIds: string[]; + } + /** + * A comment represents a single YouTube comment. + */ + export interface Schema$Comment { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the comment. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#comment". + */ + kind: string; + /** + * The snippet object contains basic details about the comment. + */ + snippet: Schema$CommentSnippet; + } + export interface Schema$CommentListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of comments that match the request criteria. + */ + items: Schema$Comment[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#commentListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a comment, such as its author and text. + */ + export interface Schema$CommentSnippet { + /** + * The id of the author's YouTube channel, if any. + */ + authorChannelId: any; + /** + * Link to the author's YouTube channel, if any. + */ + authorChannelUrl: string; + /** + * The name of the user who posted the comment. + */ + authorDisplayName: string; + /** + * The URL for the avatar of the user who posted the comment. + */ + authorProfileImageUrl: string; + /** + * Whether the current viewer can rate this comment. + */ + canRate: boolean; + /** + * The id of the corresponding YouTube channel. In case of a channel comment + * this is the channel the comment refers to. In case of a video comment + * it's the video's channel. + */ + channelId: string; + /** + * The total number of likes this comment has received. + */ + likeCount: number; + /** + * The comment's moderation status. Will not be set if the comments were + * requested through the id filter. + */ + moderationStatus: string; + /** + * The unique id of the parent comment, only set for replies. + */ + parentId: string; + /** + * The date and time when the comment was orignally published. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The comment's text. The format is either plain text or HTML dependent + * on what has been requested. Even the plain text representation may differ + * from the text originally posted in that it may replace video links with + * video titles etc. + */ + textDisplay: string; + /** + * The comment's original raw text as initially posted or last updated. + * The original text will only be returned if it is accessible to the + * viewer, which is only guaranteed if the viewer is the comment's + * author. + */ + textOriginal: string; + /** + * The date and time when was last updated . The value is specified in ISO + * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + updatedAt: string; + /** + * The ID of the video the comment refers to, if any. + */ + videoId: string; + /** + * The rating the viewer has given to this comment. For the time being this + * will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. + * This may change in the future. + */ + viewerRating: string; + } + /** + * A comment thread represents information that applies to a top level comment + * and all its replies. It can also include the top level comment itself and + * some of the replies. + */ + export interface Schema$CommentThread { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the comment thread. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#commentThread". + */ + kind: string; + /** + * The replies object contains a limited number of replies (if any) to the + * top level comment found in the snippet. + */ + replies: Schema$CommentThreadReplies; + /** + * The snippet object contains basic details about the comment thread and + * also the top level comment. + */ + snippet: Schema$CommentThreadSnippet; + } + export interface Schema$CommentThreadListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of comment threads that match the request criteria. + */ + items: Schema$CommentThread[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#commentThreadListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Comments written in (direct or indirect) reply to the top level comment. + */ + export interface Schema$CommentThreadReplies { + /** + * A limited number of replies. Unless the number of replies returned equals + * total_reply_count in the snippet the returned replies are only a subset + * of the total number of replies. + */ + comments: Schema$Comment[]; + } + /** + * Basic details about a comment thread. + */ + export interface Schema$CommentThreadSnippet { + /** + * Whether the current viewer of the thread can reply to it. This is viewer + * specific - other viewers may see a different value for this field. + */ + canReply: boolean; + /** + * The YouTube channel the comments in the thread refer to or the channel + * with the video the comments refer to. If video_id isn't set the + * comments refer to the channel itself. + */ + channelId: string; + /** + * Whether the thread (and therefore all its comments) is visible to all + * YouTube users. + */ + isPublic: boolean; + /** + * The top level comment of this thread. + */ + topLevelComment: Schema$Comment; + /** + * The total number of replies (not including the top level comment). + */ + totalReplyCount: number; + /** + * The ID of the video the comments refer to, if any. No video_id implies a + * channel discussion comment. + */ + videoId: string; + } + /** + * Ratings schemes. The country-specific ratings are mostly for movies and + * shows. NEXT_ID: 71 + */ + export interface Schema$ContentRating { + /** + * The video's Australian Classification Board (ACB) or Australian + * Communications and Media Authority (ACMA) rating. ACMA ratings are used + * to classify children's television programming. + */ + acbRating: string; + /** + * The video's rating from Italy's Autorità per le Garanzie nelle + * Comunicazioni (AGCOM). + */ + agcomRating: string; + /** + * The video's Anatel (Asociación Nacional de Televisión) rating for + * Chilean television. + */ + anatelRating: string; + /** + * The video's British Board of Film Classification (BBFC) rating. + */ + bbfcRating: string; + /** + * The video's rating from Thailand's Board of Film and Video + * Censors. + */ + bfvcRating: string; + /** + * The video's rating from the Austrian Board of Media Classification + * (Bundesministerium für Unterricht, Kunst und Kultur). + */ + bmukkRating: string; + /** + * The video's rating from the Canadian Radio-Television and + * Telecommunications Commission (CRTC) for Canadian French-language + * broadcasts. For more information, see the Canadian Broadcast Standards + * Council website. + */ + catvfrRating: string; + /** + * Rating system for Canadian TV - Canadian TV Classification System The + * video's rating from the Canadian Radio-Television and + * Telecommunications Commission (CRTC) for Canadian English-language + * broadcasts. For more information, see the Canadian Broadcast Standards + * Council website. + */ + catvRating: string; + /** + * The video's Central Board of Film Certification (CBFC - India) + * rating. + */ + cbfcRating: string; + /** + * The video's Consejo de Calificación Cinematográfica (Chile) rating. + */ + cccRating: string; + /** + * The video's rating from Portugal's Comissão de Classificação de + * Espect´culos. + */ + cceRating: string; + /** + * The video's rating in Switzerland. + */ + chfilmRating: string; + /** + * The video's Canadian Home Video Rating System (CHVRS) rating. + */ + chvrsRating: string; + /** + * The video's rating from the Commission de Contrôle des Films + * (Belgium). + */ + cicfRating: string; + /** + * The video's rating from Romania's CONSILIUL NATIONAL AL + * AUDIOVIZUALULUI (CNA). + */ + cnaRating: string; + /** + * Rating system in France - Commission de classification cinematographique + */ + cncRating: string; + /** + * The video's rating from France's Conseil supérieur de + * l?audiovisuel, which rates broadcast content. + */ + csaRating: string; + /** + * The video's rating from Luxembourg's Commission de surveillance + * de la classification des films (CSCF). + */ + cscfRating: string; + /** + * The video's rating in the Czech Republic. + */ + czfilmRating: string; + /** + * The video's Departamento de Justiça, Classificação, Qualificação e + * Títulos (DJCQT - Brazil) rating. + */ + djctqRating: string; + /** + * Reasons that explain why the video received its DJCQT (Brazil) rating. + */ + djctqRatingReasons: string[]; + /** + * Rating system in Turkey - Evaluation and Classification Board of the + * Ministry of Culture and Tourism + */ + ecbmctRating: string; + /** + * The video's rating in Estonia. + */ + eefilmRating: string; + /** + * The video's rating in Egypt. + */ + egfilmRating: string; + /** + * The video's Eirin (映倫) rating. Eirin is the Japanese rating system. + */ + eirinRating: string; + /** + * The video's rating from Malaysia's Film Censorship Board. + */ + fcbmRating: string; + /** + * The video's rating from Hong Kong's Office for Film, Newspaper + * and Article Administration. + */ + fcoRating: string; + /** + * This property has been deprecated. Use the + * contentDetails.contentRating.cncRating instead. + */ + fmocRating: string; + /** + * The video's rating from South Africa's Film and Publication + * Board. + */ + fpbRating: string; + /** + * Reasons that explain why the video received its FPB (South Africa) + * rating. + */ + fpbRatingReasons: string[]; + /** + * The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - + * Germany) rating. + */ + fskRating: string; + /** + * The video's rating in Greece. + */ + grfilmRating: string; + /** + * The video's Instituto de la Cinematografía y de las Artes + * Audiovisuales (ICAA - Spain) rating. + */ + icaaRating: string; + /** + * The video's Irish Film Classification Office (IFCO - Ireland) rating. + * See the IFCO website for more information. + */ + ifcoRating: string; + /** + * The video's rating in Israel. + */ + ilfilmRating: string; + /** + * The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - + * Argentina) rating. + */ + incaaRating: string; + /** + * The video's rating from the Kenya Film Classification Board. + */ + kfcbRating: string; + /** + * voor de Classificatie van Audiovisuele Media (Netherlands). + */ + kijkwijzerRating: string; + /** + * The video's Korea Media Rating Board (영상물등급위원회) rating. The + * KMRB rates videos in South Korea. + */ + kmrbRating: string; + /** + * The video's rating from Indonesia's Lembaga Sensor Film. + */ + lsfRating: string; + /** + * The video's rating from Malta's Film Age-Classification Board. + */ + mccaaRating: string; + /** + * The video's rating from the Danish Film Institute's (Det Danske + * Filminstitut) Media Council for Children and Young People. + */ + mccypRating: string; + /** + * The video's rating system for Vietnam - MCST + */ + mcstRating: string; + /** + * The video's rating from Singapore's Media Development Authority + * (MDA) and, specifically, it's Board of Film Censors (BFC). + */ + mdaRating: string; + /** + * The video's rating from Medietilsynet, the Norwegian Media Authority. + */ + medietilsynetRating: string; + /** + * The video's rating from Finland's Kansallinen Audiovisuaalinen + * Instituutti (National Audiovisual Institute). + */ + mekuRating: string; + /** + * The rating system for MENA countries, a clone of MPAA. It is needed to + */ + menaMpaaRating: string; + /** + * The video's rating from the Ministero dei Beni e delle Attività + * Culturali e del Turismo (Italy). + */ + mibacRating: string; + /** + * The video's Ministerio de Cultura (Colombia) rating. + */ + mocRating: string; + /** + * The video's rating from Taiwan's Ministry of Culture (文化部). + */ + moctwRating: string; + /** + * The video's Motion Picture Association of America (MPAA) rating. + */ + mpaaRating: string; + /** + * The rating system for trailer, DVD, and Ad in the US. See + * http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html. + */ + mpaatRating: string; + /** + * The video's rating from the Movie and Television Review and + * Classification Board (Philippines). + */ + mtrcbRating: string; + /** + * The video's rating in Poland. + */ + nbcplRating: string; + /** + * The video's rating from the Maldives National Bureau of + * Classification. + */ + nbcRating: string; + /** + * The video's rating from the Bulgarian National Film Center. + */ + nfrcRating: string; + /** + * The video's rating from Nigeria's National Film and Video Censors + * Board. + */ + nfvcbRating: string; + /** + * The video's rating from the Nacionãlais Kino centrs (National Film + * Centre of Latvia). + */ + nkclvRating: string; + /** + * The video's Office of Film and Literature Classification (OFLC - New + * Zealand) rating. + */ + oflcRating: string; + /** + * The video's rating in Peru. + */ + pefilmRating: string; + /** + * The video's rating from the Hungarian Nemzeti Filmiroda, the Rating + * Committee of the National Office of Film. + */ + rcnofRating: string; + /** + * The video's rating in Venezuela. + */ + resorteviolenciaRating: string; + /** + * The video's General Directorate of Radio, Television and + * Cinematography (Mexico) rating. + */ + rtcRating: string; + /** + * The video's rating from Ireland's Raidió Teilifís Éireann. + */ + rteRating: string; + /** + * The video's National Film Registry of the Russian Federation (MKRF - + * Russia) rating. + */ + russiaRating: string; + /** + * The video's rating in Slovakia. + */ + skfilmRating: string; + /** + * The video's rating in Iceland. + */ + smaisRating: string; + /** + * The video's rating from Statens medieråd (Sweden's National Media + * Council). + */ + smsaRating: string; + /** + * The video's TV Parental Guidelines (TVPG) rating. + */ + tvpgRating: string; + /** + * A rating that YouTube uses to identify age-restricted content. + */ + ytRating: string; + } + /** + * A fanFundingEvent resource represents a fan funding event on a YouTube + * channel. Fan funding events occur when a user gives one-time monetary + * support to the channel owner. + */ + export interface Schema$FanFundingEvent { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the fan funding event. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#fanFundingEvent". + */ + kind: string; + /** + * The snippet object contains basic details about the fan funding event. + */ + snippet: Schema$FanFundingEventSnippet; + } + export interface Schema$FanFundingEventListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of fan funding events that match the request criteria. + */ + items: Schema$FanFundingEvent[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#fanFundingEventListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$FanFundingEventSnippet { + /** + * The amount of funding in micros of fund_currency. e.g., 1 is represented + */ + amountMicros: string; + /** + * Channel id where the funding event occurred. + */ + channelId: string; + /** + * The text contents of the comment left by the user. + */ + commentText: string; + /** + * The date and time when the funding occurred. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + createdAt: string; + /** + * The currency in which the fund was made. ISO 4217. + */ + currency: string; + /** + * A rendered string that displays the fund amount and currency (e.g., + * "$1.00"). The string is rendered for the given language. + */ + displayString: string; + /** + * Details about the supporter. Only filled if the event was made public by + * the user. + */ + supporterDetails: Schema$ChannelProfileDetails; + } + /** + * Geographical coordinates of a point, in WGS84. + */ + export interface Schema$GeoPoint { + /** + * Altitude above the reference ellipsoid, in meters. + */ + altitude: number; + /** + * Latitude in degrees. + */ + latitude: number; + /** + * Longitude in degrees. + */ + longitude: number; + } + /** + * A guideCategory resource identifies a category that YouTube algorithmically + * assigns based on a channel's content or other indicators, such as the + * channel's popularity. The list is similar to video categories, with the + * difference being that a video's uploader can assign a video category + * but only YouTube can assign a channel category. + */ + export interface Schema$GuideCategory { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the guide category. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#guideCategory". + */ + kind: string; + /** + * The snippet object contains basic details about the category, such as its + * title. + */ + snippet: Schema$GuideCategorySnippet; + } + export interface Schema$GuideCategoryListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of categories that can be associated with YouTube channels. In + * this map, the category ID is the map key, and its value is the + * corresponding guideCategory resource. + */ + items: Schema$GuideCategory[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#guideCategoryListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a guide category. + */ + export interface Schema$GuideCategorySnippet { + channelId: string; + /** + * Description of the guide category. + */ + title: string; + } + /** + * An i18nLanguage resource identifies a UI language currently supported by + * YouTube. + */ + export interface Schema$I18nLanguage { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the i18n language. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#i18nLanguage". + */ + kind: string; + /** + * The snippet object contains basic details about the i18n language, such + * as language code and human-readable name. + */ + snippet: Schema$I18nLanguageSnippet; + } + export interface Schema$I18nLanguageListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of supported i18n languages. In this map, the i18n language ID is + * the map key, and its value is the corresponding i18nLanguage resource. + */ + items: Schema$I18nLanguage[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#i18nLanguageListResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about an i18n language, such as language code and + * human-readable name. + */ + export interface Schema$I18nLanguageSnippet { + /** + * A short BCP-47 code that uniquely identifies a language. + */ + hl: string; + /** + * The human-readable name of the language in the language itself. + */ + name: string; + } + /** + * A i18nRegion resource identifies a region where YouTube is available. + */ + export interface Schema$I18nRegion { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the i18n region. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#i18nRegion". + */ + kind: string; + /** + * The snippet object contains basic details about the i18n region, such as + * region code and human-readable name. + */ + snippet: Schema$I18nRegionSnippet; + } + export interface Schema$I18nRegionListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of regions where YouTube is available. In this map, the i18n + * region ID is the map key, and its value is the corresponding i18nRegion + * resource. + */ + items: Schema$I18nRegion[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#i18nRegionListResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about an i18n region, such as region code and human-readable + * name. + */ + export interface Schema$I18nRegionSnippet { + /** + * The region code as a 2-letter ISO country code. + */ + gl: string; + /** + * The human-readable name of the region. + */ + name: string; + } + /** + * Branding properties for images associated with the channel. + */ + export interface Schema$ImageSettings { + /** + * The URL for the background image shown on the video watch page. The image + * should be 1200px by 615px, with a maximum file size of 128k. + */ + backgroundImageUrl: Schema$LocalizedProperty; + /** + * This is used only in update requests; if it's set, we use this URL to + * generate all of the above banner URLs. + */ + bannerExternalUrl: string; + /** + * Banner image. Desktop size (1060x175). + */ + bannerImageUrl: string; + /** + * Banner image. Mobile size high resolution (1440x395). + */ + bannerMobileExtraHdImageUrl: string; + /** + * Banner image. Mobile size high resolution (1280x360). + */ + bannerMobileHdImageUrl: string; + /** + * Banner image. Mobile size (640x175). + */ + bannerMobileImageUrl: string; + /** + * Banner image. Mobile size low resolution (320x88). + */ + bannerMobileLowImageUrl: string; + /** + * Banner image. Mobile size medium/high resolution (960x263). + */ + bannerMobileMediumHdImageUrl: string; + /** + * Banner image. Tablet size extra high resolution (2560x424). + */ + bannerTabletExtraHdImageUrl: string; + /** + * Banner image. Tablet size high resolution (2276x377). + */ + bannerTabletHdImageUrl: string; + /** + * Banner image. Tablet size (1707x283). + */ + bannerTabletImageUrl: string; + /** + * Banner image. Tablet size low resolution (1138x188). + */ + bannerTabletLowImageUrl: string; + /** + * Banner image. TV size high resolution (1920x1080). + */ + bannerTvHighImageUrl: string; + /** + * Banner image. TV size extra high resolution (2120x1192). + */ + bannerTvImageUrl: string; + /** + * Banner image. TV size low resolution (854x480). + */ + bannerTvLowImageUrl: string; + /** + * Banner image. TV size medium resolution (1280x720). + */ + bannerTvMediumImageUrl: string; + /** + * The image map script for the large banner image. + */ + largeBrandedBannerImageImapScript: Schema$LocalizedProperty; + /** + * The URL for the 854px by 70px image that appears below the video player + * in the expanded video view of the video watch page. + */ + largeBrandedBannerImageUrl: Schema$LocalizedProperty; + /** + * The image map script for the small banner image. + */ + smallBrandedBannerImageImapScript: Schema$LocalizedProperty; + /** + * The URL for the 640px by 70px banner image that appears below the video + * player in the default view of the video watch page. + */ + smallBrandedBannerImageUrl: Schema$LocalizedProperty; + /** + * The URL for a 1px by 1px tracking pixel that can be used to collect + * statistics for views of the channel or video pages. + */ + trackingImageUrl: string; + /** + * The URL for the image that appears above the top-left corner of the video + * player. This is a 25-pixel-high image with a flexible width that cannot + * exceed 170 pixels. + */ + watchIconImageUrl: string; + } + /** + * Describes information necessary for ingesting an RTMP or an HTTP stream. + */ + export interface Schema$IngestionInfo { + /** + * The backup ingestion URL that you should use to stream video to YouTube. + * You have the option of simultaneously streaming the content that you are + * sending to the ingestionAddress to this URL. + */ + backupIngestionAddress: string; + /** + * The primary ingestion URL that you should use to stream video to YouTube. + * You must stream video to this URL. Depending on which application or + * tool you use to encode your video stream, you may need to enter the + * stream URL and stream name separately or you may need to concatenate them + * in the following format: STREAM_URL/STREAM_NAME + */ + ingestionAddress: string; + /** + * The HTTP or RTMP stream name that YouTube assigns to the video stream. + */ + streamName: string; + } + export interface Schema$InvideoBranding { + imageBytes: string; + imageUrl: string; + position: Schema$InvideoPosition; + targetChannelId: string; + timing: Schema$InvideoTiming; + } + /** + * Describes the spatial position of a visual widget inside a video. It is a + * union of various position types, out of which only will be set one. + */ + export interface Schema$InvideoPosition { + /** + * Describes in which corner of the video the visual widget will appear. + */ + cornerPosition: string; + /** + * Defines the position type. + */ + type: string; + } + /** + * Describes an invideo promotion campaign consisting of multiple promoted + * items. A campaign belongs to a single channel_id. + */ + export interface Schema$InvideoPromotion { + /** + * The default temporal position within the video where the promoted item + * will be displayed. Can be overriden by more specific timing in the item. + */ + defaultTiming: Schema$InvideoTiming; + /** + * List of promoted items in decreasing priority. + */ + items: Schema$PromotedItem[]; + /** + * The spatial position within the video where the promoted item will be + * displayed. + */ + position: Schema$InvideoPosition; + /** + * Indicates whether the channel's promotional campaign uses "smart + * timing." This feature attempts to show promotions at a point in the + * video when they are more likely to be clicked and less likely to disrupt + * the viewing experience. This feature also picks up a single promotion to + * show on each video. + */ + useSmartTiming: boolean; + } + /** + * Describes a temporal position of a visual widget inside a video. + */ + export interface Schema$InvideoTiming { + /** + * Defines the duration in milliseconds for which the promotion should be + * displayed. If missing, the client should use the default. + */ + durationMs: string; + /** + * Defines the time at which the promotion will appear. Depending on the + * value of type the value of the offsetMs field will represent a time + * offset from the start or from the end of the video, expressed in + * milliseconds. + */ + offsetMs: string; + /** + * Describes a timing type. If the value is offsetFromStart, then the + * offsetMs field represents an offset from the start of the video. If the + * value is offsetFromEnd, then the offsetMs field represents an offset from + * the end of the video. + */ + type: string; + } + export interface Schema$LanguageTag { value: string; } + /** + * A liveBroadcast resource represents an event that will be streamed, via + * live video, on YouTube. + */ + export interface Schema$LiveBroadcast { + /** + * The contentDetails object contains information about the event's + * video content, such as whether the content can be shown in an embedded + * video player or if it will be archived and therefore available for + * viewing after the event has concluded. + */ + contentDetails: Schema$LiveBroadcastContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the broadcast. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveBroadcast". + */ + kind: string; + /** + * The snippet object contains basic details about the event, including its + * title, description, start time, and end time. + */ + snippet: Schema$LiveBroadcastSnippet; + /** + * The statistics object contains info about the event's current stats. + * These include concurrent viewers and total chat count. Statistics can + * change (in either direction) during the lifetime of an event. Statistics + * are only returned while the event is live. + */ + statistics: Schema$LiveBroadcastStatistics; + /** + * The status object contains information about the event's status. + */ + status: Schema$LiveBroadcastStatus; + } + /** + * Detailed settings of a broadcast. + */ + export interface Schema$LiveBroadcastContentDetails { + /** + * This value uniquely identifies the live stream bound to the broadcast. + */ + boundStreamId: string; + /** + * The date and time that the live stream referenced by boundStreamId was + * last updated. + */ + boundStreamLastUpdateTimeMs: string; + closedCaptionsType: string; + /** + * This setting indicates whether auto start is enabled for this broadcast. + */ + enableAutoStart: boolean; + /** + * This setting indicates whether HTTP POST closed captioning is enabled for + * this broadcast. The ingestion URL of the closed captions is returned + * through the liveStreams API. This is mutually exclusive with using the + * closed_captions_type property, and is equivalent to setting + * closed_captions_type to CLOSED_CAPTIONS_HTTP_POST. + */ + enableClosedCaptions: boolean; + /** + * This setting indicates whether YouTube should enable content encryption + * for the broadcast. + */ + enableContentEncryption: boolean; + /** + * This setting determines whether viewers can access DVR controls while + * watching the video. DVR controls enable the viewer to control the video + * playback experience by pausing, rewinding, or fast forwarding content. + * The default value for this property is true. Important: You must set + * the value to true and also set the enableArchive property's value to + * true if you want to make playback available immediately after the + * broadcast ends. + */ + enableDvr: boolean; + /** + * This setting indicates whether the broadcast video can be played in an + * embedded player. If you choose to archive the video (using the + * enableArchive property), this setting will also apply to the archived + * video. + */ + enableEmbed: boolean; + /** + * Indicates whether this broadcast has low latency enabled. + */ + enableLowLatency: boolean; + /** + * If both this and enable_low_latency are set, they must match. + * LATENCY_NORMAL should match enable_low_latency=false LATENCY_LOW should + * match enable_low_latency=true LATENCY_ULTRA_LOW should have + * enable_low_latency omitted. + */ + latencyPreference: string; + mesh: string; + /** + * The monitorStream object contains information about the monitor stream, + * which the broadcaster can use to review the event content before the + * broadcast stream is shown publicly. + */ + monitorStream: Schema$MonitorStreamInfo; + /** + * The projection format of this broadcast. This defaults to rectangular. + */ + projection: string; + /** + * Automatically start recording after the event goes live. The default + * value for this property is true. Important: You must also set the + * enableDvr property's value to true if you want the playback to be + * available immediately after the broadcast ends. If you set this + * property's value to true but do not also set the enableDvr property + * to true, there may be a delay of around one day before the archived video + * will be available for playback. + */ + recordFromStart: boolean; + /** + * This setting indicates whether the broadcast should automatically begin + * with an in-stream slate when you update the broadcast's status to + * live. After updating the status, you then need to send a + * liveCuepoints.insert request that sets the cuepoint's eventState to + * end to remove the in-stream slate and make your broadcast stream visible + * to viewers. + */ + startWithSlate: boolean; + stereoLayout: string; + } + export interface Schema$LiveBroadcastListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of broadcasts that match the request criteria. + */ + items: Schema$LiveBroadcast[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveBroadcastListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$LiveBroadcastSnippet { + /** + * The date and time that the broadcast actually ended. This information is + * only available once the broadcast's state is complete. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + actualEndTime: string; + /** + * The date and time that the broadcast actually started. This information + * is only available once the broadcast's state is live. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + actualStartTime: string; + /** + * The ID that YouTube uses to uniquely identify the channel that is + * publishing the broadcast. + */ + channelId: string; + /** + * The broadcast's description. As with the title, you can set this + * field by modifying the broadcast resource or by setting the description + * field of the corresponding video resource. + */ + description: string; + isDefaultBroadcast: boolean; + /** + * The id of the live chat for this broadcast. + */ + liveChatId: string; + /** + * The date and time that the broadcast was added to YouTube's live + * broadcast schedule. The value is specified in ISO 8601 + * (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The date and time that the broadcast is scheduled to end. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + scheduledEndTime: string; + /** + * The date and time that the broadcast is scheduled to start. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + scheduledStartTime: string; + /** + * A map of thumbnail images associated with the broadcast. For each nested + * object in this object, the key is the name of the thumbnail image, and + * the value is an object that contains other information about the + * thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The broadcast's title. Note that the broadcast represents exactly one + * YouTube video. You can set this field by modifying the broadcast resource + * or by setting the title field of the corresponding video resource. + */ + title: string; + } + /** + * Statistics about the live broadcast. These represent a snapshot of the + * values at the time of the request. Statistics are only returned for live + * broadcasts. + */ + export interface Schema$LiveBroadcastStatistics { + /** + * The number of viewers currently watching the broadcast. The property and + * its value will be present if the broadcast has current viewers and the + * broadcast owner has not hidden the viewcount for the video. Note that + * YouTube stops tracking the number of concurrent viewers for a broadcast + * when the broadcast ends. So, this property would not identify the number + * of viewers watching an archived video of a live broadcast that already + * ended. + */ + concurrentViewers: string; + /** + * The total number of live chat messages currently on the broadcast. The + * property and its value will be present if the broadcast is public, has + * the live chat feature enabled, and has at least one message. Note that + * this field will not be filled after the broadcast ends. So this property + * would not identify the number of chat messages for an archived video of a + * completed live broadcast. + */ + totalChatCount: string; + } + export interface Schema$LiveBroadcastStatus { + /** + * The broadcast's status. The status can be updated using the API's + * liveBroadcasts.transition method. + */ + lifeCycleStatus: string; + /** + * Priority of the live broadcast event (internal state). + */ + liveBroadcastPriority: string; + /** + * The broadcast's privacy status. Note that the broadcast represents + * exactly one YouTube video, so the privacy settings are identical to those + * supported for videos. In addition, you can set this field by modifying + * the broadcast resource or by setting the privacyStatus field of the + * corresponding video resource. + */ + privacyStatus: string; + /** + * The broadcast's recording status. + */ + recordingStatus: string; + } + /** + * A liveChatBan resource represents a ban for a YouTube live chat. + */ + export interface Schema$LiveChatBan { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the ban. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveChatBan". + */ + kind: string; + /** + * The snippet object contains basic details about the ban. + */ + snippet: Schema$LiveChatBanSnippet; + } + export interface Schema$LiveChatBanSnippet { + /** + * The duration of a ban, only filled if the ban has type TEMPORARY. + */ + banDurationSeconds: string; + bannedUserDetails: Schema$ChannelProfileDetails; + /** + * The chat this ban is pertinent to. + */ + liveChatId: string; + /** + * The type of ban. + */ + type: string; + } + export interface Schema$LiveChatFanFundingEventDetails { + /** + * A rendered string that displays the fund amount and currency to the user. + */ + amountDisplayString: string; + /** + * The amount of the fund. + */ + amountMicros: string; + /** + * The currency in which the fund was made. + */ + currency: string; + /** + * The comment added by the user to this fan funding event. + */ + userComment: string; + } + /** + * A liveChatMessage resource represents a chat message in a YouTube Live + * Chat. + */ + export interface Schema$LiveChatMessage { + /** + * The authorDetails object contains basic details about the user that + * posted this message. + */ + authorDetails: Schema$LiveChatMessageAuthorDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the message. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveChatMessage". + */ + kind: string; + /** + * The snippet object contains basic details about the message. + */ + snippet: Schema$LiveChatMessageSnippet; + } + export interface Schema$LiveChatMessageAuthorDetails { + /** + * The YouTube channel ID. + */ + channelId: string; + /** + * The channel's URL. + */ + channelUrl: string; + /** + * The channel's display name. + */ + displayName: string; + /** + * Whether the author is a moderator of the live chat. + */ + isChatModerator: boolean; + /** + * Whether the author is the owner of the live chat. + */ + isChatOwner: boolean; + /** + * Whether the author is a sponsor of the live chat. + */ + isChatSponsor: boolean; + /** + * Whether the author's identity has been verified by YouTube. + */ + isVerified: boolean; + /** + * The channels's avatar URL. + */ + profileImageUrl: string; + } + export interface Schema$LiveChatMessageDeletedDetails { + deletedMessageId: string; + } + export interface Schema$LiveChatMessageListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of live chat messages. + */ + items: Schema$LiveChatMessage[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveChatMessageListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + /** + * The date and time when the underlying stream went offline. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + offlineAt: string; + pageInfo: Schema$PageInfo; + /** + * The amount of time the client should wait before polling again. + */ + pollingIntervalMillis: number; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$LiveChatMessageRetractedDetails { + retractedMessageId: string; + } + export interface Schema$LiveChatMessageSnippet { + /** + * The ID of the user that authored this message, this field is not always + * filled. textMessageEvent - the user that wrote the message + * fanFundingEvent - the user that funded the broadcast newSponsorEvent - + * the user that just became a sponsor messageDeletedEvent - the moderator + * that took the action messageRetractedEvent - the author that retracted + * their message userBannedEvent - the moderator that took the action + * superChatEvent - the user that made the purchase + */ + authorChannelId: string; + /** + * Contains a string that can be displayed to the user. If this field is not + * present the message is silent, at the moment only messages of type + * TOMBSTONE and CHAT_ENDED_EVENT are silent. + */ + displayMessage: string; + /** + * Details about the funding event, this is only set if the type is + * 'fanFundingEvent'. + */ + fanFundingEventDetails: Schema$LiveChatFanFundingEventDetails; + /** + * Whether the message has display content that should be displayed to + * users. + */ + hasDisplayContent: boolean; + liveChatId: string; + messageDeletedDetails: Schema$LiveChatMessageDeletedDetails; + messageRetractedDetails: Schema$LiveChatMessageRetractedDetails; + pollClosedDetails: Schema$LiveChatPollClosedDetails; + pollEditedDetails: Schema$LiveChatPollEditedDetails; + pollOpenedDetails: Schema$LiveChatPollOpenedDetails; + pollVotedDetails: Schema$LiveChatPollVotedDetails; + /** + * The date and time when the message was orignally published. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * Details about the Super Chat event, this is only set if the type is + * 'superChatEvent'. + */ + superChatDetails: Schema$LiveChatSuperChatDetails; + /** + * Details about the text message, this is only set if the type is + * 'textMessageEvent'. + */ + textMessageDetails: Schema$LiveChatTextMessageDetails; + /** + * The type of message, this will always be present, it determines the + * contents of the message as well as which fields will be present. + */ + type: string; + userBannedDetails: Schema$LiveChatUserBannedMessageDetails; + } + /** + * A liveChatModerator resource represents a moderator for a YouTube live + * chat. A chat moderator has the ability to ban/unban users from a chat, + * remove message, etc. + */ + export interface Schema$LiveChatModerator { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the moderator. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveChatModerator". + */ + kind: string; + /** + * The snippet object contains basic details about the moderator. + */ + snippet: Schema$LiveChatModeratorSnippet; + } + export interface Schema$LiveChatModeratorListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of moderators that match the request criteria. + */ + items: Schema$LiveChatModerator[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveChatModeratorListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$LiveChatModeratorSnippet { + /** + * The ID of the live chat this moderator can act on. + */ + liveChatId: string; + /** + * Details about the moderator. + */ + moderatorDetails: Schema$ChannelProfileDetails; + } + export interface Schema$LiveChatPollClosedDetails { + /** + * The id of the poll that was closed. + */ + pollId: string; + } + export interface Schema$LiveChatPollEditedDetails { + id: string; + items: Schema$LiveChatPollItem[]; + prompt: string; + } + export interface Schema$LiveChatPollItem { + /** + * Plain text description of the item. + */ + description: string; + itemId: string; + } + export interface Schema$LiveChatPollOpenedDetails { + id: string; + items: Schema$LiveChatPollItem[]; + prompt: string; + } + export interface Schema$LiveChatPollVotedDetails { + /** + * The poll item the user chose. + */ + itemId: string; + /** + * The poll the user voted on. + */ + pollId: string; + } + export interface Schema$LiveChatSuperChatDetails { + /** + * A rendered string that displays the fund amount and currency to the user. + */ + amountDisplayString: string; + /** + * The amount purchased by the user, in micros (1,750,000 micros = 1.75). + */ + amountMicros: string; + /** + * The currency in which the purchase was made. + */ + currency: string; + /** + * The tier in which the amount belongs to. Lower amounts belong to lower + * tiers. Starts at 1. + */ + tier: number; + /** + * The comment added by the user to this Super Chat event. + */ + userComment: string; + } + export interface Schema$LiveChatTextMessageDetails { + /** + * The user's message. + */ + messageText: string; + } + export interface Schema$LiveChatUserBannedMessageDetails { + /** + * The duration of the ban. This property is only present if the banType is + * temporary. + */ + banDurationSeconds: string; + /** + * The details of the user that was banned. + */ + bannedUserDetails: Schema$ChannelProfileDetails; + /** + * The type of ban. + */ + banType: string; + } + /** + * A live stream describes a live ingestion point. + */ + export interface Schema$LiveStream { + /** + * The cdn object defines the live stream's content delivery network + * (CDN) settings. These settings provide details about the manner in which + * you stream your content to YouTube. + */ + cdn: Schema$CdnSettings; + /** + * The content_details object contains information about the stream, + * including the closed captions ingestion URL. + */ + contentDetails: Schema$LiveStreamContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the stream. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveStream". + */ + kind: string; + /** + * The snippet object contains basic details about the stream, including its + * channel, title, and description. + */ + snippet: Schema$LiveStreamSnippet; + /** + * The status object contains information about live stream's status. + */ + status: Schema$LiveStreamStatus; + } + export interface Schema$LiveStreamConfigurationIssue { + /** + * The long-form description of the issue and how to resolve it. + */ + description: string; + /** + * The short-form reason for this issue. + */ + reason: string; + /** + * How severe this issue is to the stream. + */ + severity: string; + /** + * The kind of error happening. + */ + type: string; + } + /** + * Detailed settings of a stream. + */ + export interface Schema$LiveStreamContentDetails { + /** + * The ingestion URL where the closed captions of this stream are sent. + */ + closedCaptionsIngestionUrl: string; + /** + * Indicates whether the stream is reusable, which means that it can be + * bound to multiple broadcasts. It is common for broadcasters to reuse the + * same stream for many different broadcasts if those broadcasts occur at + * different times. If you set this value to false, then the stream will + * not be reusable, which means that it can only be bound to one broadcast. + * Non-reusable streams differ from reusable streams in the following ways: + * - A non-reusable stream can only be bound to one broadcast. - A + * non-reusable stream might be deleted by an automated process after the + * broadcast ends. - The liveStreams.list method does not list + * non-reusable streams if you call the method and set the mine parameter to + * true. The only way to use that method to retrieve the resource for a + * non-reusable stream is to use the id parameter to identify the stream. + */ + isReusable: boolean; + } + export interface Schema$LiveStreamHealthStatus { + /** + * The configurations issues on this stream + */ + configurationIssues: Schema$LiveStreamConfigurationIssue[]; + /** + * The last time this status was updated (in seconds) + */ + lastUpdateTimeSeconds: string; + /** + * The status code of this stream + */ + status: string; + } + export interface Schema$LiveStreamListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of live streams that match the request criteria. + */ + items: Schema$LiveStream[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#liveStreamListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$LiveStreamSnippet { + /** + * The ID that YouTube uses to uniquely identify the channel that is + * transmitting the stream. + */ + channelId: string; + /** + * The stream's description. The value cannot be longer than 10000 + * characters. + */ + description: string; + isDefaultStream: boolean; + /** + * The date and time that the stream was created. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The stream's title. The value must be between 1 and 128 characters + * long. + */ + title: string; + } + /** + * Brief description of the live stream status. + */ + export interface Schema$LiveStreamStatus { + /** + * The health status of the stream. + */ + healthStatus: Schema$LiveStreamHealthStatus; + streamStatus: string; + } + export interface Schema$LocalizedProperty { + default: string; + /** + * The language of the default property. + */ + defaultLanguage: Schema$LanguageTag; + localized: Schema$LocalizedString[]; + } + export interface Schema$LocalizedString { + language: string; + value: string; + } + /** + * Settings and Info of the monitor stream + */ + export interface Schema$MonitorStreamInfo { + /** + * If you have set the enableMonitorStream property to true, then this + * property determines the length of the live broadcast delay. + */ + broadcastStreamDelayMs: number; + /** + * HTML code that embeds a player that plays the monitor stream. + */ + embedHtml: string; + /** + * This value determines whether the monitor stream is enabled for the + * broadcast. If the monitor stream is enabled, then YouTube will broadcast + * the event content on a special stream intended only for the + * broadcaster's consumption. The broadcaster can use the stream to + * review the event content and also to identify the optimal times to insert + * cuepoints. You need to set this value to true if you intend to have a + * broadcast delay for your event. Note: This property cannot be updated + * once the broadcast is in the testing or live state. + */ + enableMonitorStream: boolean; + } + /** + * Nonprofit information. + */ + export interface Schema$Nonprofit { + /** + * Id of the nonprofit. + */ + nonprofitId: Schema$NonprofitId; + /** + * Legal name of the nonprofit. + */ + nonprofitLegalName: string; + } + export interface Schema$NonprofitId { value: string; } + /** + * Paging details for lists of resources, including total number of items + * available and number of resources returned in a single page. + */ + export interface Schema$PageInfo { + /** + * The number of results included in the API response. + */ + resultsPerPage: number; + /** + * The total number of results in the result set. + */ + totalResults: number; + } + /** + * A playlist resource represents a YouTube playlist. A playlist is a + * collection of videos that can be viewed sequentially and shared with other + * users. A playlist can contain up to 200 videos, and YouTube does not limit + * the number of playlists that each user creates. By default, playlists are + * publicly visible to other users, but playlists can be public or private. + * YouTube also uses playlists to identify special collections of videos for a + * channel, such as: - uploaded videos - favorite videos - positively + * rated (liked) videos - watch history - watch later To be more specific, + * these lists are associated with a channel, which is a collection of a + * person, group, or company's videos, playlists, and other YouTube + * information. You can retrieve the playlist IDs for each of these lists from + * the channel resource for a given channel. You can then use the + * playlistItems.list method to retrieve any of those lists. You can also add + * or remove items from those lists by calling the playlistItems.insert and + * playlistItems.delete methods. + */ + export interface Schema$Playlist { + /** + * The contentDetails object contains information like video count. + */ + contentDetails: Schema$PlaylistContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the playlist. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#playlist". + */ + kind: string; + /** + * Localizations for different languages + */ + localizations: any; + /** + * The player object contains information that you would use to play the + * playlist in an embedded player. + */ + player: Schema$PlaylistPlayer; + /** + * The snippet object contains basic details about the playlist, such as its + * title and description. + */ + snippet: Schema$PlaylistSnippet; + /** + * The status object contains status information for the playlist. + */ + status: Schema$PlaylistStatus; + } + export interface Schema$PlaylistContentDetails { + /** + * The number of videos in the playlist. + */ + itemCount: number; + } + /** + * A playlistItem resource identifies another resource, such as a video, that + * is included in a playlist. In addition, the playlistItem resource contains + * details about the included resource that pertain specifically to how that + * resource is used in that playlist. YouTube uses playlists to identify + * special collections of videos for a channel, such as: - uploaded videos + * - favorite videos - positively rated (liked) videos - watch history - + * watch later To be more specific, these lists are associated with a + * channel, which is a collection of a person, group, or company's videos, + * playlists, and other YouTube information. You can retrieve the playlist + * IDs for each of these lists from the channel resource for a given + * channel. You can then use the playlistItems.list method to retrieve any + * of those lists. You can also add or remove items from those lists by + * calling the playlistItems.insert and playlistItems.delete methods. For + * example, if a user gives a positive rating to a video, you would insert + * that video into the liked videos playlist for that user's channel. + */ + export interface Schema$PlaylistItem { + /** + * The contentDetails object is included in the resource if the included + * item is a YouTube video. The object contains additional information about + * the video. + */ + contentDetails: Schema$PlaylistItemContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the playlist item. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#playlistItem". + */ + kind: string; + /** + * The snippet object contains basic details about the playlist item, such + * as its title and position in the playlist. + */ + snippet: Schema$PlaylistItemSnippet; + /** + * The status object contains information about the playlist item's + * privacy status. + */ + status: Schema$PlaylistItemStatus; + } + export interface Schema$PlaylistItemContentDetails { + /** + * The time, measured in seconds from the start of the video, when the video + * should stop playing. (The playlist owner can specify the times when the + * video should start and stop playing when the video is played in the + * context of the playlist.) By default, assume that the video.endTime is + * the end of the video. + */ + endAt: string; + /** + * A user-generated note for this item. + */ + note: string; + /** + * The time, measured in seconds from the start of the video, when the video + * should start playing. (The playlist owner can specify the times when the + * video should start and stop playing when the video is played in the + * context of the playlist.) The default value is 0. + */ + startAt: string; + /** + * The ID that YouTube uses to uniquely identify a video. To retrieve the + * video resource, set the id query parameter to this value in your API + * request. + */ + videoId: string; + /** + * The date and time that the video was published to YouTube. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + videoPublishedAt: string; + } + export interface Schema$PlaylistItemListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of playlist items that match the request criteria. + */ + items: Schema$PlaylistItem[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#playlistItemListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a playlist, including title, description and + * thumbnails. + */ + export interface Schema$PlaylistItemSnippet { + /** + * The ID that YouTube uses to uniquely identify the user that added the + * item to the playlist. + */ + channelId: string; + /** + * Channel title for the channel that the playlist item belongs to. + */ + channelTitle: string; + /** + * The item's description. + */ + description: string; + /** + * The ID that YouTube uses to uniquely identify the playlist that the + * playlist item is in. + */ + playlistId: string; + /** + * The order in which the item appears in the playlist. The value uses a + * zero-based index, so the first item has a position of 0, the second item + * has a position of 1, and so forth. + */ + position: number; + /** + * The date and time that the item was added to the playlist. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The id object contains information that can be used to uniquely identify + * the resource that is included in the playlist as the playlist item. + */ + resourceId: Schema$ResourceId; + /** + * A map of thumbnail images associated with the playlist item. For each + * object in the map, the key is the name of the thumbnail image, and the + * value is an object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The item's title. + */ + title: string; + } + /** + * Information about the playlist item's privacy status. + */ + export interface Schema$PlaylistItemStatus { + /** + * This resource's privacy status. + */ + privacyStatus: string; + } + export interface Schema$PlaylistListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of playlists that match the request criteria. + */ + items: Schema$Playlist[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#playlistListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Playlist localization setting + */ + export interface Schema$PlaylistLocalization { + /** + * The localized strings for playlist's description. + */ + description: string; + /** + * The localized strings for playlist's title. + */ + title: string; + } + export interface Schema$PlaylistPlayer { + /** + * An <iframe> tag that embeds a player that will play the playlist. + */ + embedHtml: string; + } + /** + * Basic details about a playlist, including title, description and + * thumbnails. + */ + export interface Schema$PlaylistSnippet { + /** + * The ID that YouTube uses to uniquely identify the channel that published + * the playlist. + */ + channelId: string; + /** + * The channel title of the channel that the video belongs to. + */ + channelTitle: string; + /** + * The language of the playlist's default title and description. + */ + defaultLanguage: string; + /** + * The playlist's description. + */ + description: string; + /** + * Localized title and description, read-only. + */ + localized: Schema$PlaylistLocalization; + /** + * The date and time that the playlist was created. The value is specified + * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * Keyword tags associated with the playlist. + */ + tags: string[]; + /** + * A map of thumbnail images associated with the playlist. For each object + * in the map, the key is the name of the thumbnail image, and the value is + * an object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The playlist's title. + */ + title: string; + } + export interface Schema$PlaylistStatus { + /** + * The playlist's privacy status. + */ + privacyStatus: string; + } + /** + * Describes a single promoted item. + */ + export interface Schema$PromotedItem { + /** + * A custom message to display for this promotion. This field is currently + * ignored unless the promoted item is a website. + */ + customMessage: string; + /** + * Identifies the promoted item. + */ + id: Schema$PromotedItemId; + /** + * If true, the content owner's name will be used when displaying the + * promotion. This field can only be set when the update is made on behalf + * of the content owner. + */ + promotedByContentOwner: boolean; + /** + * The temporal position within the video where the promoted item will be + * displayed. If present, it overrides the default timing. + */ + timing: Schema$InvideoTiming; + } + /** + * Describes a single promoted item id. It is a union of various possible + * types. + */ + export interface Schema$PromotedItemId { + /** + * If type is recentUpload, this field identifies the channel from which to + * take the recent upload. If missing, the channel is assumed to be the same + * channel for which the invideoPromotion is set. + */ + recentlyUploadedBy: string; + /** + * Describes the type of the promoted item. + */ + type: string; + /** + * If the promoted item represents a video, this field represents the unique + * YouTube ID identifying it. This field will be present only if type has + * the value video. + */ + videoId: string; + /** + * If the promoted item represents a website, this field represents the url + * pointing to the website. This field will be present only if type has the + * value website. + */ + websiteUrl: string; + } + /** + * A pair Property / Value. + */ + export interface Schema$PropertyValue { + /** + * A property. + */ + property: string; + /** + * The property's value. + */ + value: string; + } + /** + * A resource id is a generic reference that points to another YouTube + * resource. */ - set(params?: any, options?: MethodOptions): AxiosPromise; - set(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - set(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/watermarks/set') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - mediaUrl: (rootUrl + '/upload/youtube/v3/watermarks/set') - .replace(/([^:]\/)\/+/g, '$1'), - requiredParams: ['channelId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - - - /** - * youtube.watermarks.unset - * @desc Deletes a channel's watermark image. - * @alias youtube.watermarks.unset - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being unset. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object + export interface Schema$ResourceId { + /** + * The ID that YouTube uses to uniquely identify the referred resource, if + * that resource is a channel. This property is only present if the + * resourceId.kind value is youtube#channel. + */ + channelId: string; + /** + * The type of the API resource. + */ + kind: string; + /** + * The ID that YouTube uses to uniquely identify the referred resource, if + * that resource is a playlist. This property is only present if the + * resourceId.kind value is youtube#playlist. + */ + playlistId: string; + /** + * The ID that YouTube uses to uniquely identify the referred resource, if + * that resource is a video. This property is only present if the + * resourceId.kind value is youtube#video. + */ + videoId: string; + } + export interface Schema$SearchListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of results that match the search criteria. + */ + items: Schema$SearchResult[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#searchListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + regionCode: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * A search result contains information about a YouTube video, channel, or + * playlist that matches the search parameters specified in an API request. + * While a search result points to a uniquely identifiable resource, like a + * video, it does not have its own persistent data. + */ + export interface Schema$SearchResult { + /** + * Etag of this resource. + */ + etag: string; + /** + * The id object contains information that can be used to uniquely identify + * the resource that matches the search request. + */ + id: Schema$ResourceId; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#searchResult". + */ + kind: string; + /** + * The snippet object contains basic details about a search result, such as + * its title or description. For example, if the search result is a video, + * then the title will be the video's title and the description will be + * the video's description. + */ + snippet: Schema$SearchResultSnippet; + } + /** + * Basic details about a search result, including title, description and + * thumbnails of the item referenced by the search result. + */ + export interface Schema$SearchResultSnippet { + /** + * The value that YouTube uses to uniquely identify the channel that + * published the resource that the search result identifies. + */ + channelId: string; + /** + * The title of the channel that published the resource that the search + * result identifies. + */ + channelTitle: string; + /** + * A description of the search result. + */ + description: string; + /** + * It indicates if the resource (video or channel) has upcoming/active live + * broadcast content. Or it's "none" if there is not any + * upcoming/active live broadcasts. + */ + liveBroadcastContent: string; + /** + * The creation date and time of the resource that the search result + * identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + * format. + */ + publishedAt: string; + /** + * A map of thumbnail images associated with the search result. For each + * object in the map, the key is the name of the thumbnail image, and the + * value is an object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The title of the search result. + */ + title: string; + } + /** + * A sponsor resource represents a sponsor for a YouTube channel. A sponsor + * provides recurring monetary support to a creator and receives special + * benefits. + */ + export interface Schema$Sponsor { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the sponsor. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#sponsor". + */ + kind: string; + /** + * The snippet object contains basic details about the sponsor. + */ + snippet: Schema$SponsorSnippet; + } + export interface Schema$SponsorListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of sponsors that match the request criteria. + */ + items: Schema$Sponsor[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#sponsorListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$SponsorSnippet { + /** + * The id of the channel being sponsored. + */ + channelId: string; + /** + * The cumulative time a user has been a sponsor in months. + */ + cumulativeDurationMonths: number; + /** + * Details about the sponsor. + */ + sponsorDetails: Schema$ChannelProfileDetails; + /** + * The date and time when the user became a sponsor. The value is specified + * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + sponsorSince: string; + } + /** + * A subscription resource contains information about a YouTube user + * subscription. A subscription notifies a user when new videos are added to a + * channel or when another user takes one of several actions on YouTube, such + * as uploading a video, rating a video, or commenting on a video. + */ + export interface Schema$Subscription { + /** + * The contentDetails object contains basic statistics about the + * subscription. + */ + contentDetails: Schema$SubscriptionContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the subscription. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#subscription". + */ + kind: string; + /** + * The snippet object contains basic details about the subscription, + * including its title and the channel that the user subscribed to. + */ + snippet: Schema$SubscriptionSnippet; + /** + * The subscriberSnippet object contains basic details about the sbuscriber. + */ + subscriberSnippet: Schema$SubscriptionSubscriberSnippet; + } + /** + * Details about the content to witch a subscription refers. + */ + export interface Schema$SubscriptionContentDetails { + /** + * The type of activity this subscription is for (only uploads, everything). + */ + activityType: string; + /** + * The number of new items in the subscription since its content was last + * read. + */ + newItemCount: number; + /** + * The approximate number of items that the subscription points to. + */ + totalItemCount: number; + } + export interface Schema$SubscriptionListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of subscriptions that match the request criteria. + */ + items: Schema$Subscription[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#subscriptionListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a subscription, including title, description and + * thumbnails of the subscribed item. + */ + export interface Schema$SubscriptionSnippet { + /** + * The ID that YouTube uses to uniquely identify the subscriber's + * channel. + */ + channelId: string; + /** + * Channel title for the channel that the subscription belongs to. + */ + channelTitle: string; + /** + * The subscription's details. + */ + description: string; + /** + * The date and time that the subscription was created. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The id object contains information about the channel that the user + * subscribed to. + */ + resourceId: Schema$ResourceId; + /** + * A map of thumbnail images associated with the video. For each object in + * the map, the key is the name of the thumbnail image, and the value is an + * object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The subscription's title. + */ + title: string; + } + /** + * Basic details about a subscription's subscriber including title, + * description, channel ID and thumbnails. + */ + export interface Schema$SubscriptionSubscriberSnippet { + /** + * The channel ID of the subscriber. + */ + channelId: string; + /** + * The description of the subscriber. + */ + description: string; + /** + * Thumbnails for this subscriber. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The title of the subscriber. + */ + title: string; + } + /** + * A superChatEvent resource represents a Super Chat purchase on a YouTube + * channel. */ - unset(params?: any, options?: MethodOptions): AxiosPromise; - unset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - unset( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/v3/watermarks/unset') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: ['channelId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + export interface Schema$SuperChatEvent { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube assigns to uniquely identify the Super Chat event. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#superChatEvent". + */ + kind: string; + /** + * The snippet object contains basic details about the Super Chat event. + */ + snippet: Schema$SuperChatEventSnippet; + } + export interface Schema$SuperChatEventListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of Super Chat purchases that match the request criteria. + */ + items: Schema$SuperChatEvent[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#superChatEventListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$SuperChatEventSnippet { + /** + * The purchase amount, in micros of the purchase currency. e.g., 1 is + * represented as 1000000. + */ + amountMicros: string; + /** + * Channel id where the event occurred. + */ + channelId: string; + /** + * The text contents of the comment left by the user. + */ + commentText: string; + /** + * The date and time when the event occurred. The value is specified in ISO + * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + createdAt: string; + /** + * The currency in which the purchase was made. ISO 4217. + */ + currency: string; + /** + * A rendered string that displays the purchase amount and currency (e.g., + * "$1.00"). The string is rendered for the given language. + */ + displayString: string; + /** + * True if this event is a Super Chat for Good purchase. + */ + isSuperChatForGood: boolean; + /** + * The tier for the paid message, which is based on the amount of money + * spent to purchase the message. + */ + messageType: number; + /** + * If this event is a Super Chat for Good purchase, this field will contain + * information about the charity the purchase is donated to. + */ + nonprofit: Schema$Nonprofit; + /** + * Details about the supporter. + */ + supporterDetails: Schema$ChannelProfileDetails; + } + /** + * A thumbnail is an image representing a YouTube resource. + */ + export interface Schema$Thumbnail { + /** + * (Optional) Height of the thumbnail image. + */ + height: number; + /** + * The thumbnail image's URL. + */ + url: string; + /** + * (Optional) Width of the thumbnail image. + */ + width: number; + } + /** + * Internal representation of thumbnails for a YouTube resource. + */ + export interface Schema$ThumbnailDetails { + /** + * The default image for this resource. + */ + default: Schema$Thumbnail; + /** + * The high quality image for this resource. + */ + high: Schema$Thumbnail; + /** + * The maximum resolution quality image for this resource. + */ + maxres: Schema$Thumbnail; + /** + * The medium quality image for this resource. + */ + medium: Schema$Thumbnail; + /** + * The standard quality image for this resource. + */ + standard: Schema$Thumbnail; + } + export interface Schema$ThumbnailSetResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of thumbnails. + */ + items: Schema$ThumbnailDetails[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#thumbnailSetResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Stub token pagination template to suppress results. + */ + export interface Schema$TokenPagination {} + /** + * A video resource represents a YouTube video. + */ + export interface Schema$Video { + /** + * Age restriction details related to a video. This data can only be + * retrieved by the video owner. + */ + ageGating: Schema$VideoAgeGating; + /** + * The contentDetails object contains information about the video content, + * including the length of the video and its aspect ratio. + */ + contentDetails: Schema$VideoContentDetails; + /** + * Etag of this resource. + */ + etag: string; + /** + * The fileDetails object encapsulates information about the video file that + * was uploaded to YouTube, including the file's resolution, duration, + * audio and video codecs, stream bitrates, and more. This data can only be + * retrieved by the video owner. + */ + fileDetails: Schema$VideoFileDetails; + /** + * The ID that YouTube uses to uniquely identify the video. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#video". + */ + kind: string; + /** + * The liveStreamingDetails object contains metadata about a live video + * broadcast. The object will only be present in a video resource if the + * video is an upcoming, live, or completed live broadcast. + */ + liveStreamingDetails: Schema$VideoLiveStreamingDetails; + /** + * List with all localizations. + */ + localizations: any; + /** + * The monetizationDetails object encapsulates information about the + * monetization status of the video. + */ + monetizationDetails: Schema$VideoMonetizationDetails; + /** + * The player object contains information that you would use to play the + * video in an embedded player. + */ + player: Schema$VideoPlayer; + /** + * The processingDetails object encapsulates information about YouTube's + * progress in processing the uploaded video file. The properties in the + * object identify the current processing status and an estimate of the time + * remaining until YouTube finishes processing the video. This part also + * indicates whether different types of data or content, such as file + * details or thumbnail images, are available for the video. The + * processingProgress object is designed to be polled so that the video + * uploaded can track the progress that YouTube has made in processing the + * uploaded video file. This data can only be retrieved by the video owner. + */ + processingDetails: Schema$VideoProcessingDetails; + /** + * The projectDetails object contains information about the project specific + * video metadata. + */ + projectDetails: Schema$VideoProjectDetails; + /** + * The recordingDetails object encapsulates information about the location, + * date and address where the video was recorded. + */ + recordingDetails: Schema$VideoRecordingDetails; + /** + * The snippet object contains basic details about the video, such as its + * title, description, and category. + */ + snippet: Schema$VideoSnippet; + /** + * The statistics object contains statistics about the video. + */ + statistics: Schema$VideoStatistics; + /** + * The status object contains information about the video's uploading, + * processing, and privacy statuses. + */ + status: Schema$VideoStatus; + /** + * The suggestions object encapsulates suggestions that identify + * opportunities to improve the video quality or the metadata for the + * uploaded video. This data can only be retrieved by the video owner. + */ + suggestions: Schema$VideoSuggestions; + /** + * The topicDetails object encapsulates information about Freebase topics + * associated with the video. + */ + topicDetails: Schema$VideoTopicDetails; + } + export interface Schema$VideoAbuseReport { + /** + * Additional comments regarding the abuse report. + */ + comments: string; + /** + * The language that the content was viewed in. + */ + language: string; + /** + * The high-level, or primary, reason that the content is abusive. The value + * is an abuse report reason ID. + */ + reasonId: string; + /** + * The specific, or secondary, reason that this content is abusive (if + * available). The value is an abuse report reason ID that is a valid + * secondary reason for the primary reason. + */ + secondaryReasonId: string; + /** + * The ID that YouTube uses to uniquely identify the video. + */ + videoId: string; + } + /** + * A videoAbuseReportReason resource identifies a reason that a video could be + * reported as abusive. Video abuse report reasons are used with + * video.ReportAbuse. + */ + export interface Schema$VideoAbuseReportReason { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID of this abuse report reason. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoAbuseReportReason". + */ + kind: string; + /** + * The snippet object contains basic details about the abuse report reason. + */ + snippet: Schema$VideoAbuseReportReasonSnippet; + } + export interface Schema$VideoAbuseReportReasonListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of valid abuse reasons that are used with video.ReportAbuse. + */ + items: Schema$VideoAbuseReportReason[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoAbuseReportReasonListResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a video category, such as its localized title. + */ + export interface Schema$VideoAbuseReportReasonSnippet { + /** + * The localized label belonging to this abuse report reason. + */ + label: string; + /** + * The secondary reasons associated with this reason, if any are available. + * (There might be 0 or more.) + */ + secondaryReasons: Schema$VideoAbuseReportSecondaryReason[]; + } + export interface Schema$VideoAbuseReportSecondaryReason { + /** + * The ID of this abuse report secondary reason. + */ + id: string; + /** + * The localized label for this abuse report secondary reason. + */ + label: string; + } + export interface Schema$VideoAgeGating { + /** + * Indicates whether or not the video has alcoholic beverage content. Only + * users of legal purchasing age in a particular country, as identified by + * ICAP, can view the content. + */ + alcoholContent: boolean; + /** + * Age-restricted trailers. For redband trailers and adult-rated + * video-games. Only users aged 18+ can view the content. The the field is + * true the content is restricted to viewers aged 18+. Otherwise The field + * won't be present. + */ + restricted: boolean; + /** + * Video game rating, if any. + */ + videoGameRating: string; + } + /** + * A videoCategory resource identifies a category that has been or could be + * associated with uploaded videos. + */ + export interface Schema$VideoCategory { + /** + * Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the video category. + */ + id: string; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoCategory". + */ + kind: string; + /** + * The snippet object contains basic details about the video category, + * including its title. + */ + snippet: Schema$VideoCategorySnippet; + } + export interface Schema$VideoCategoryListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of video categories that can be associated with YouTube videos. In + * this map, the video category ID is the map key, and its value is the + * corresponding videoCategory resource. + */ + items: Schema$VideoCategory[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoCategoryListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Basic details about a video category, such as its localized title. + */ + export interface Schema$VideoCategorySnippet { + assignable: boolean; + /** + * The YouTube channel that created the video category. + */ + channelId: string; + /** + * The video category's title. + */ + title: string; + } + /** + * Details about the content of a YouTube Video. + */ + export interface Schema$VideoContentDetails { + /** + * The value of captions indicates whether the video has captions or not. + */ + caption: string; + /** + * Specifies the ratings that the video received under various rating + * schemes. + */ + contentRating: Schema$ContentRating; + /** + * The countryRestriction object contains information about the countries + * where a video is (or is not) viewable. + */ + countryRestriction: Schema$AccessPolicy; + /** + * The value of definition indicates whether the video is available in high + * definition or only in standard definition. + */ + definition: string; + /** + * The value of dimension indicates whether the video is available in 3D or + * in 2D. + */ + dimension: string; + /** + * The length of the video. The tag value is an ISO 8601 duration in the + * format PT#M#S, in which the letters PT indicate that the value specifies + * a period of time, and the letters M and S refer to length in minutes and + * seconds, respectively. The # characters preceding the M and S letters are + * both integers that specify the number of minutes (or seconds) of the + * video. For example, a value of PT15M51S indicates that the video is 15 + * minutes and 51 seconds long. + */ + duration: string; + /** + * Indicates whether the video uploader has provided a custom thumbnail + * image for the video. This property is only visible to the video uploader. + */ + hasCustomThumbnail: boolean; + /** + * The value of is_license_content indicates whether the video is licensed + * content. + */ + licensedContent: boolean; + /** + * Specifies the projection format of the video. + */ + projection: string; + /** + * The regionRestriction object contains information about the countries + * where a video is (or is not) viewable. The object will contain either the + * contentDetails.regionRestriction.allowed property or the + * contentDetails.regionRestriction.blocked property. + */ + regionRestriction: Schema$VideoContentDetailsRegionRestriction; + } + /** + * DEPRECATED Region restriction of the video. + */ + export interface Schema$VideoContentDetailsRegionRestriction { + /** + * A list of region codes that identify countries where the video is + * viewable. If this property is present and a country is not listed in its + * value, then the video is blocked from appearing in that country. If this + * property is present and contains an empty list, the video is blocked in + * all countries. + */ + allowed: string[]; + /** + * A list of region codes that identify countries where the video is + * blocked. If this property is present and a country is not listed in its + * value, then the video is viewable in that country. If this property is + * present and contains an empty list, the video is viewable in all + * countries. + */ + blocked: string[]; + } + /** + * Describes original video file properties, including technical details about + * audio and video streams, but also metadata information like content length, + * digitization time, or geotagging information. + */ + export interface Schema$VideoFileDetails { + /** + * A list of audio streams contained in the uploaded video file. Each item + * in the list contains detailed metadata about an audio stream. + */ + audioStreams: Schema$VideoFileDetailsAudioStream[]; + /** + * The uploaded video file's combined (video and audio) bitrate in bits + * per second. + */ + bitrateBps: string; + /** + * The uploaded video file's container format. + */ + container: string; + /** + * The date and time when the uploaded video file was created. The value is + * specified in ISO 8601 format. Currently, the following ISO 8601 formats + * are supported: - Date only: YYYY-MM-DD - Naive time: + * YYYY-MM-DDTHH:MM:SS - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM + */ + creationTime: string; + /** + * The length of the uploaded video in milliseconds. + */ + durationMs: string; + /** + * The uploaded file's name. This field is present whether a video file + * or another type of file was uploaded. + */ + fileName: string; + /** + * The uploaded file's size in bytes. This field is present whether a + * video file or another type of file was uploaded. + */ + fileSize: string; + /** + * The uploaded file's type as detected by YouTube's video + * processing engine. Currently, YouTube only processes video files, but + * this field is present whether a video file or another type of file was + * uploaded. + */ + fileType: string; + /** + * A list of video streams contained in the uploaded video file. Each item + * in the list contains detailed metadata about a video stream. + */ + videoStreams: Schema$VideoFileDetailsVideoStream[]; + } + /** + * Information about an audio stream. + */ + export interface Schema$VideoFileDetailsAudioStream { + /** + * The audio stream's bitrate, in bits per second. + */ + bitrateBps: string; + /** + * The number of audio channels that the stream contains. + */ + channelCount: number; + /** + * The audio codec that the stream uses. + */ + codec: string; + /** + * A value that uniquely identifies a video vendor. Typically, the value is + * a four-letter vendor code. + */ + vendor: string; + } + /** + * Information about a video stream. + */ + export interface Schema$VideoFileDetailsVideoStream { + /** + * The video content's display aspect ratio, which specifies the aspect + * ratio in which the video should be displayed. + */ + aspectRatio: number; + /** + * The video stream's bitrate, in bits per second. + */ + bitrateBps: string; + /** + * The video codec that the stream uses. + */ + codec: string; + /** + * The video stream's frame rate, in frames per second. + */ + frameRateFps: number; + /** + * The encoded video content's height in pixels. + */ + heightPixels: number; + /** + * The amount that YouTube needs to rotate the original source content to + * properly display the video. + */ + rotation: string; + /** + * A value that uniquely identifies a video vendor. Typically, the value is + * a four-letter vendor code. + */ + vendor: string; + /** + * The encoded video content's width in pixels. You can calculate the + * video's encoding aspect ratio as width_pixels / height_pixels. + */ + widthPixels: number; + } + export interface Schema$VideoGetRatingResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of ratings that match the request criteria. + */ + items: Schema$VideoRating[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoGetRatingResponse". + */ + kind: string; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + export interface Schema$VideoListResponse { + /** + * Etag of this resource. + */ + etag: string; + /** + * Serialized EventId of the request which produced this response. + */ + eventId: string; + /** + * A list of videos that match the request criteria. + */ + items: Schema$Video[]; + /** + * Identifies what kind of resource this is. Value: the fixed string + * "youtube#videoListResponse". + */ + kind: string; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + pageInfo: Schema$PageInfo; + /** + * The token that can be used as the value of the pageToken parameter to + * retrieve the previous page in the result set. + */ + prevPageToken: string; + tokenPagination: Schema$TokenPagination; + /** + * The visitorId identifies the visitor. + */ + visitorId: string; + } + /** + * Details about the live streaming metadata. + */ + export interface Schema$VideoLiveStreamingDetails { + /** + * The ID of the currently active live chat attached to this video. This + * field is filled only if the video is a currently live broadcast that has + * live chat. Once the broadcast transitions to complete this field will be + * removed and the live chat closed down. For persistent broadcasts that + * live chat id will no longer be tied to this video but rather to the new + * video being displayed at the persistent page. + */ + activeLiveChatId: string; + /** + * The time that the broadcast actually ended. The value is specified in ISO + * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available + * until the broadcast is over. + */ + actualEndTime: string; + /** + * The time that the broadcast actually started. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be + * available until the broadcast begins. + */ + actualStartTime: string; + /** + * The number of viewers currently watching the broadcast. The property and + * its value will be present if the broadcast has current viewers and the + * broadcast owner has not hidden the viewcount for the video. Note that + * YouTube stops tracking the number of concurrent viewers for a broadcast + * when the broadcast ends. So, this property would not identify the number + * of viewers watching an archived video of a live broadcast that already + * ended. + */ + concurrentViewers: string; + /** + * The time that the broadcast is scheduled to end. The value is specified + * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. If the value is empty or the + * property is not present, then the broadcast is scheduled to continue + * indefinitely. + */ + scheduledEndTime: string; + /** + * The time that the broadcast is scheduled to begin. The value is specified + * in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + scheduledStartTime: string; + } + /** + * Localized versions of certain video properties (e.g. title). + */ + export interface Schema$VideoLocalization { + /** + * Localized version of the video's description. + */ + description: string; + /** + * Localized version of the video's title. + */ + title: string; + } + /** + * Details about monetization of a YouTube Video. + */ + export interface Schema$VideoMonetizationDetails { + /** + * The value of access indicates whether the video can be monetized or not. + */ + access: Schema$AccessPolicy; + } + /** + * Player to be used for a video playback. + */ + export interface Schema$VideoPlayer { + embedHeight: string; + /** + * An <iframe> tag that embeds a player that will play the video. + */ + embedHtml: string; + /** + * The embed width + */ + embedWidth: string; + } + /** + * Describes processing status and progress and availability of some other + * Video resource parts. + */ + export interface Schema$VideoProcessingDetails { + /** + * This value indicates whether video editing suggestions, which might + * improve video quality or the playback experience, are available for the + * video. You can retrieve these suggestions by requesting the suggestions + * part in your videos.list() request. + */ + editorSuggestionsAvailability: string; + /** + * This value indicates whether file details are available for the uploaded + * video. You can retrieve a video's file details by requesting the + * fileDetails part in your videos.list() request. + */ + fileDetailsAvailability: string; + /** + * The reason that YouTube failed to process the video. This property will + * only have a value if the processingStatus property's value is failed. + */ + processingFailureReason: string; + /** + * This value indicates whether the video processing engine has generated + * suggestions that might improve YouTube's ability to process the the + * video, warnings that explain video processing problems, or errors that + * cause video processing problems. You can retrieve these suggestions by + * requesting the suggestions part in your videos.list() request. + */ + processingIssuesAvailability: string; + /** + * The processingProgress object contains information about the progress + * YouTube has made in processing the video. The values are really only + * relevant if the video's processing status is processing. + */ + processingProgress: Schema$VideoProcessingDetailsProcessingProgress; + /** + * The video's processing status. This value indicates whether YouTube + * was able to process the video or if the video is still being processed. + */ + processingStatus: string; + /** + * This value indicates whether keyword (tag) suggestions are available for + * the video. Tags can be added to a video's metadata to make it easier + * for other users to find the video. You can retrieve these suggestions by + * requesting the suggestions part in your videos.list() request. + */ + tagSuggestionsAvailability: string; + /** + * This value indicates whether thumbnail images have been generated for the + * video. + */ + thumbnailsAvailability: string; + } + /** + * Video processing progress and completion time estimate. + */ + export interface Schema$VideoProcessingDetailsProcessingProgress { + /** + * The number of parts of the video that YouTube has already processed. You + * can estimate the percentage of the video that YouTube has already + * processed by calculating: 100 * parts_processed / parts_total Note that + * since the estimated number of parts could increase without a + * corresponding increase in the number of parts that have already been + * processed, it is possible that the calculated progress could periodically + * decrease while YouTube processes a video. + */ + partsProcessed: string; + /** + * An estimate of the total number of parts that need to be processed for + * the video. The number may be updated with more precise estimates while + * YouTube processes the video. + */ + partsTotal: string; + /** + * An estimate of the amount of time, in millseconds, that YouTube needs to + * finish processing the video. + */ + timeLeftMs: string; + } + /** + * Project specific details about the content of a YouTube Video. + */ + export interface Schema$VideoProjectDetails { + /** + * A list of project tags associated with the video during the upload. + */ + tags: string[]; + } + export interface Schema$VideoRating { + rating: string; + videoId: string; + } + /** + * Recording information associated with the video. + */ + export interface Schema$VideoRecordingDetails { + /** + * The geolocation information associated with the video. + */ + location: Schema$GeoPoint; + /** + * The text description of the location where the video was recorded. + */ + locationDescription: string; + /** + * The date and time when the video was recorded. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. + */ + recordingDate: string; + } + /** + * Basic details about a video, including title, description, uploader, + * thumbnails and category. + */ + export interface Schema$VideoSnippet { + /** + * The YouTube video category associated with the video. + */ + categoryId: string; + /** + * The ID that YouTube uses to uniquely identify the channel that the video + * was uploaded to. + */ + channelId: string; + /** + * Channel title for the channel that the video belongs to. + */ + channelTitle: string; + /** + * The default_audio_language property specifies the language spoken in the + * video's default audio track. + */ + defaultAudioLanguage: string; + /** + * The language of the videos's default snippet. + */ + defaultLanguage: string; + /** + * The video's description. + */ + description: string; + /** + * Indicates if the video is an upcoming/active live broadcast. Or it's + * "none" if the video is not an upcoming/active live broadcast. + */ + liveBroadcastContent: string; + /** + * Localized snippet selected with the hl parameter. If no such localization + * exists, this field is populated with the default snippet. (Read-only) + */ + localized: Schema$VideoLocalization; + /** + * The date and time that the video was uploaded. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * A list of keyword tags associated with the video. Tags may contain + * spaces. + */ + tags: string[]; + /** + * A map of thumbnail images associated with the video. For each object in + * the map, the key is the name of the thumbnail image, and the value is an + * object that contains other information about the thumbnail. + */ + thumbnails: Schema$ThumbnailDetails; + /** + * The video's title. + */ + title: string; + } + /** + * Statistics about the video, such as the number of times the video was + * viewed or liked. + */ + export interface Schema$VideoStatistics { + /** + * The number of comments for the video. + */ + commentCount: string; + /** + * The number of users who have indicated that they disliked the video by + * giving it a negative rating. + */ + dislikeCount: string; + /** + * The number of users who currently have the video marked as a favorite + * video. + */ + favoriteCount: string; + /** + * The number of users who have indicated that they liked the video by + * giving it a positive rating. + */ + likeCount: string; + /** + * The number of times the video has been viewed. + */ + viewCount: string; + } + /** + * Basic details about a video category, such as its localized title. + */ + export interface Schema$VideoStatus { + /** + * This value indicates if the video can be embedded on another website. + */ + embeddable: boolean; + /** + * This value explains why a video failed to upload. This property is only + * present if the uploadStatus property indicates that the upload failed. + */ + failureReason: string; + /** + * The video's license. + */ + license: string; + /** + * The video's privacy status. + */ + privacyStatus: string; + /** + * This value indicates if the extended video statistics on the watch page + * can be viewed by everyone. Note that the view count, likes, etc will + * still be visible if this is disabled. + */ + publicStatsViewable: boolean; + /** + * The date and time when the video is scheduled to publish. It can be set + * only if the privacy status of the video is private. The value is + * specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishAt: string; + /** + * This value explains why YouTube rejected an uploaded video. This property + * is only present if the uploadStatus property indicates that the upload + * was rejected. + */ + rejectionReason: string; + /** + * The status of the uploaded video. + */ + uploadStatus: string; + } + /** + * Specifies suggestions on how to improve video content, including encoding + * hints, tag suggestions, and editor suggestions. + */ + export interface Schema$VideoSuggestions { + /** + * A list of video editing operations that might improve the video quality + * or playback experience of the uploaded video. + */ + editorSuggestions: string[]; + /** + * A list of errors that will prevent YouTube from successfully processing + * the uploaded video video. These errors indicate that, regardless of the + * video's current processing status, eventually, that status will + * almost certainly be failed. + */ + processingErrors: string[]; + /** + * A list of suggestions that may improve YouTube's ability to process + * the video. + */ + processingHints: string[]; + /** + * A list of reasons why YouTube may have difficulty transcoding the + * uploaded video or that might result in an erroneous transcoding. These + * warnings are generated before YouTube actually processes the uploaded + * video file. In addition, they identify issues that are unlikely to cause + * the video processing to fail but that might cause problems such as sync + * issues, video artifacts, or a missing audio track. + */ + processingWarnings: string[]; + /** + * A list of keyword tags that could be added to the video's metadata to + * increase the likelihood that users will locate your video when searching + * or browsing on YouTube. + */ + tagSuggestions: Schema$VideoSuggestionsTagSuggestion[]; + } + /** + * A single tag suggestion with it's relevance information. + */ + export interface Schema$VideoSuggestionsTagSuggestion { + /** + * A set of video categories for which the tag is relevant. You can use this + * information to display appropriate tag suggestions based on the video + * category that the video uploader associates with the video. By default, + * tag suggestions are relevant for all categories if there are no restricts + * defined for the keyword. + */ + categoryRestricts: string[]; + /** + * The keyword tag suggested for the video. + */ + tag: string; + } + /** + * Freebase topic information related to the video. + */ + export interface Schema$VideoTopicDetails { + /** + * Similar to topic_id, except that these topics are merely relevant to the + * video. These are topics that may be mentioned in, or appear in the video. + * You can retrieve information about each topic using Freebase Topic API. + */ + relevantTopicIds: string[]; + /** + * A list of Wikipedia URLs that provide a high-level description of the + * video's content. + */ + topicCategories: string[]; + /** + * A list of Freebase topic IDs that are centrally associated with the + * video. These are topics that are centrally featured in the video, and it + * can be said that the video is mainly about each of these. You can + * retrieve information about each topic using the Freebase Topic API. + */ + topicIds: string[]; + } + /** + * Branding properties for the watch. All deprecated. + */ + export interface Schema$WatchSettings { + /** + * The text color for the video watch page's branded area. + */ + backgroundColor: string; + /** + * An ID that uniquely identifies a playlist that displays next to the video + * player. + */ + featuredPlaylistId: string; + /** + * The background color for the video watch page's branded area. + */ + textColor: string; + } + + export class Resource$Activities { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.activities.insert + * @desc Posts a bulletin for a specific channel. (The user submitting the + * request must be authorized to act on the channel's behalf.) Note: Even + * though an activity resource can contain information about actions like a + * user rating a video or marking a video as a favorite, you need to use + * other API methods to generate those activity resources. For example, you + * would use the API's videos.rate() method to rate a video and the + * playlistItems.insert() method to mark a video as a favorite. + * @alias youtube.activities.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * @param {().Activity} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/activities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.activities.list + * @desc Returns a list of channel activity events that match the request + * criteria. For example, you can retrieve events associated with a + * particular channel, events associated with the user's subscriptions and + * Google+ friends, or the YouTube home page feed, which is customized for + * each user. + * @alias youtube.activities.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities. + * @param {boolean=} params.home Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's activities. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties. + * @param {string=} params.publishedAfter The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + * @param {string=} params.publishedBefore The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + * @param {string=} params.regionCode The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/activities') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Captions { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.captions.delete + * @desc Deletes a specified caption track. + * @alias youtube.captions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource. + * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.captions.download + * @desc Downloads a caption track. The caption track is returned in its + * original format unless the request specifies a value for the tfmt + * parameter and in its original language unless the request specifies a + * value for the tlang parameter. + * @alias youtube.captions.download + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource. + * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.tfmt The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format. + * @param {string=} params.tlang The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + download(params?: any, options?: MethodOptions): AxiosPromise; + download( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + download( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/captions/{id}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.captions.insert + * @desc Uploads a caption track. + * @alias youtube.captions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet. + * @param {boolean=} params.sync The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions. You should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.captions.list + * @desc Returns a list of caption tracks that are associated with a + * specified video. Note that the API response does not contain the actual + * captions and that the captions.download method provides the ability to + * retrieve a caption track. + * @alias youtube.captions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video. + * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is on behalf of. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet. + * @param {string} params.videoId The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part', 'videoId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.captions.update + * @desc Updates a caption track. When updating a caption track, you can + * change the track's draft status, upload a new caption file for the track, + * or both. + * @alias youtube.captions.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOf ID of the Google+ Page for the channel that the request is be on behalf of + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id. + * @param {boolean=} params.sync Note: The API server only processes the parameter value if the request contains an updated caption file. The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/captions') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Channelbanners { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.channelBanners.insert + * @desc Uploads a channel banner image to YouTube. This method represents + * the first two steps in a three-step process to update the banner image + * for a channel: - Call the channelBanners.insert method to upload the + * binary image data to YouTube. The image must have a 16:9 aspect ratio and + * be at least 2120x1192 pixels. - Extract the url property's value from the + * response that the API returns for step 1. - Call the channels.update + * method to update the channel's branding settings. Set the + * brandingSettings.image.bannerExternalUrl property's value to the URL + * obtained in step 2. + * @alias youtube.channelBanners.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId The channelId parameter identifies the YouTube channel to which the banner is uploaded. The channelId parameter was introduced as a required parameter in May 2017. As this was a backward-incompatible change, channelBanners.insert requests that do not specify this parameter will not return an error until six months have passed from the time that the parameter was introduced. Please see the API Terms of Service for the official policy regarding backward incompatible changes and the API revision history for the exact date that the parameter was introduced. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channelBanners/insert') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/channelBanners/insert') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Channels { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.channels.list + * @desc Returns a collection of zero or more channel resources that match + * the request criteria. + * @alias youtube.channels.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.categoryId The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category. + * @param {string=} params.forUsername The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username. + * @param {string=} params.hl The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID. + * @param {boolean=} params.managedByMe Note: This parameter is intended exclusively for YouTube content partners. Set this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user. + * @param {boolean=} params.mySubscribers Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.channels.update + * @desc Updates a channel's metadata. Note that this method currently only + * supports updates to the channel resource's brandingSettings and + * invideoPromotion objects and their child properties. + * @alias youtube.channels.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.) Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. + * @param {().Channel} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channels') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Channelsections { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.channelSections.delete + * @desc Deletes a channelSection. + * @alias youtube.channelSections.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channelSections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.channelSections.insert + * @desc Adds a channelSection for the authenticated user's channel. + * @alias youtube.channelSections.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part names that you can include in the parameter value are snippet and contentDetails. + * @param {().ChannelSection} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channelSections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.channelSections.list + * @desc Returns channelSection resources that match the API request + * criteria. + * @alias youtube.channelSections.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections. + * @param {string=} params.hl The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID. + * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channelSections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.channelSections.update + * @desc Update a channelSection. + * @alias youtube.channelSections.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part names that you can include in the parameter value are snippet and contentDetails. + * @param {().ChannelSection} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/channelSections') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Comments { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.comments.delete + * @desc Deletes a comment. + * @alias youtube.comments.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the comment ID for the resource that is being deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.comments.insert + * @desc Creates a reply to an existing comment. Note: To create a top-level + * comment, use the commentThreads.insert method. + * @alias youtube.comments.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.comments.list + * @desc Returns a list of comments that match the API request parameters. + * @alias youtube.comments.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.parentId The parentId parameter specifies the ID of the comment for which replies should be retrieved. Note: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include. + * @param {string=} params.textFormat This parameter indicates whether the API should return comments formatted as HTML or as plain text. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.comments.markAsSpam + * @desc Expresses the caller's opinion that one or more comments should be + * flagged as spam. + * @alias youtube.comments.markAsSpam + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + markAsSpam(params?: any, options?: MethodOptions): AxiosPromise; + markAsSpam( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + markAsSpam( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments/markAsSpam') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.comments.setModerationStatus + * @desc Sets the moderation status of one or more comments. The API request + * must be authorized by the owner of the channel or video associated with + * the comments. + * @alias youtube.comments.setModerationStatus + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.banAuthor The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author. Note: This parameter is only valid if the moderationStatus parameter is also set to rejected. + * @param {string} params.id The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status. + * @param {string} params.moderationStatus Identifies the new moderation status of the specified comments. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + setModerationStatus(params?: any, options?: MethodOptions): + AxiosPromise; + setModerationStatus( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + setModerationStatus( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments/setModerationStatus') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id', 'moderationStatus'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.comments.update + * @desc Modifies a comment. + * @alias youtube.comments.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. + * @param {().Comment} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/comments') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Commentthreads { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.commentThreads.insert + * @desc Creates a new top-level comment. To add a reply to an existing + * comment, use the comments.insert method instead. + * @alias youtube.commentThreads.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units. + * @param {().CommentThread} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/commentThreads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.commentThreads.list + * @desc Returns a list of comment threads that match the API request + * parameters. + * @alias youtube.commentThreads.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.allThreadsRelatedToChannelId The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos. + * @param {string=} params.channelId The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.) + * @param {string=} params.id The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.moderationStatus Set this parameter to limit the returned comment threads to a particular moderation state. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.order The order parameter specifies the order in which the API response should list comment threads. Valid values are: - time - Comment threads are ordered by time. This is the default behavior. - relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include. + * @param {string=} params.searchTerms The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms. Note: This parameter is not supported for use in conjunction with the id parameter. + * @param {string=} params.textFormat Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text. + * @param {string=} params.videoId The videoId parameter instructs the API to return comment threads associated with the specified video ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/commentThreads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.commentThreads.update + * @desc Modifies the top-level comment in a comment thread. + * @alias youtube.commentThreads.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update. + * @param {().CommentThread} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/commentThreads') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Fanfundingevents { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.fanFundingEvents.list + * @desc Lists fan funding events for a channel. + * @alias youtube.fanFundingEvents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies the fanFundingEvent resource parts that the API response will include. Supported values are id and snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/fanFundingEvents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Guidecategories { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.guideCategories.list + * @desc Returns a list of categories that can be associated with YouTube + * channels. + * @alias youtube.guideCategories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter specifies the language that will be used for text values in the API response. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID. + * @param {string} params.part The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet. + * @param {string=} params.regionCode The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/guideCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$I18nlanguages { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.i18nLanguages.list + * @desc Returns a list of application languages that the YouTube website + * supports. + * @alias youtube.i18nLanguages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. + * @param {string} params.part The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/i18nLanguages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$I18nregions { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.i18nRegions.list + * @desc Returns a list of content regions that the YouTube website + * supports. + * @alias youtube.i18nRegions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. + * @param {string} params.part The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/i18nRegions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Livebroadcasts { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.liveBroadcasts.bind + * @desc Binds a YouTube broadcast to a stream or removes an existing + * binding between a broadcast and a stream. A broadcast can only be bound + * to one video stream, though a video stream may be bound to more than one + * broadcast. + * @alias youtube.liveBroadcasts.bind + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the unique ID of the broadcast that is being bound to a video stream. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * @param {string=} params.streamId The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + bind(params?: any, options?: MethodOptions): + AxiosPromise; + bind( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + bind( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts/bind') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id', 'part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.control + * @desc Controls the settings for a slate that can be displayed in the + * broadcast stream. + * @alias youtube.liveBroadcasts.control + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.displaySlate The displaySlate parameter specifies whether the slate is being enabled or disabled. + * @param {string} params.id The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated. + * @param {string=} params.offsetTimeMs The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time. If you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details. Important: You should only specify a value for this parameter if your broadcast stream is delayed. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * @param {string=} params.walltime The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + control(params?: any, options?: MethodOptions): + AxiosPromise; + control( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + control( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts/control') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id', 'part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.delete + * @desc Deletes a broadcast. + * @alias youtube.liveBroadcasts.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.insert + * @desc Creates a broadcast. + * @alias youtube.liveBroadcasts.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. + * @param {().LiveBroadcast} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.list + * @desc Returns a list of YouTube broadcasts that match the API request + * parameters. + * @alias youtube.liveBroadcasts.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.broadcastStatus The broadcastStatus parameter filters the API response to only include broadcasts with the specified status. + * @param {string=} params.broadcastType The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now. + * @param {string=} params.id The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.transition + * @desc Changes the status of a YouTube live broadcast and initiates any + * processes associated with the new status. For example, when you + * transition a broadcast's status to testing, YouTube starts to transmit + * video to that broadcast's monitor stream. Before calling this method, you + * should confirm that the value of the status.streamStatus property for the + * stream bound to your broadcast is active. + * @alias youtube.liveBroadcasts.transition + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.broadcastStatus The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. + * @param {string} params.id The id parameter specifies the unique ID of the broadcast that is transitioning to another status. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + transition(params?: any, options?: MethodOptions): + AxiosPromise; + transition( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + transition( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts/transition') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['broadcastStatus', 'id', 'part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveBroadcasts.update + * @desc Updates a broadcast. For example, you could modify the broadcast + * settings defined in the liveBroadcast resource's contentDetails object. + * @alias youtube.liveBroadcasts.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, contentDetails, and status. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting. + * @param {().LiveBroadcast} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveBroadcasts') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Livechatbans { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.liveChatBans.delete + * @desc Removes a chat ban. + * @alias youtube.liveChatBans.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/bans') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveChatBans.insert + * @desc Adds a new ban to the chat. + * @alias youtube.liveChatBans.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. + * @param {().LiveChatBan} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/bans') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Livechatmessages { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.liveChatMessages.delete + * @desc Deletes a chat message. + * @alias youtube.liveChatMessages.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube chat message ID of the resource that is being deleted. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveChatMessages.insert + * @desc Adds a message to a live chat. + * @alias youtube.liveChatMessages.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet. + * @param {().LiveChatMessage} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveChatMessages.list + * @desc Lists live chat messages for a specific chat. + * @alias youtube.liveChatMessages.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * @param {string} params.liveChatId The liveChatId parameter specifies the ID of the chat whose messages will be returned. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of messages that should be returned in the result set. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet. + * @param {integer=} params.profileImageSize The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/messages') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['liveChatId', 'part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Livechatmoderators { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.liveChatModerators.delete + * @desc Removes a chat moderator. + * @alias youtube.liveChatModerators.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/moderators') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveChatModerators.insert + * @desc Adds a new moderator for the chat. + * @alias youtube.liveChatModerators.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet. + * @param {().LiveChatModerator} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/moderators') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveChatModerators.list + * @desc Lists moderators for a live chat. + * @alias youtube.liveChatModerators.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.liveChatId The liveChatId parameter specifies the YouTube live chat for which the API should return moderators. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveChat/moderators') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['liveChatId', 'part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Livestreams { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.liveStreams.delete + * @desc Deletes a video stream. + * @alias youtube.liveStreams.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube live stream ID for the resource that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveStreams') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveStreams.insert + * @desc Creates a video stream. The stream enables you to send your video + * to YouTube, which can then broadcast the video to your audience. + * @alias youtube.liveStreams.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, and status. + * @param {().LiveStream} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveStreams') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveStreams.list + * @desc Returns a list of video streams that match the API request + * parameters. + * @alias youtube.liveStreams.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveStreams') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.liveStreams.update + * @desc Updates a video stream. If the properties that you want to change + * cannot be updated, then you need to create a new stream with the proper + * settings. + * @alias youtube.liveStreams.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. The part properties that you can include in the parameter value are id, snippet, cdn, and status. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed. + * @param {().LiveStream} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/liveStreams') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Playlistitems { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.playlistItems.delete + * @desc Deletes a playlist item. + * @alias youtube.playlistItems.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlistItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlistItems.insert + * @desc Adds a resource to a playlist. + * @alias youtube.playlistItems.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * @param {().PlaylistItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlistItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlistItems.list + * @desc Returns a collection of playlist items that match the API request + * parameters. You can retrieve all of the playlist items in a specified + * playlist or retrieve one or more playlist items by their unique IDs. + * @alias youtube.playlistItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of one or more unique playlist item IDs. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties. + * @param {string=} params.playlistId The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter. + * @param {string=} params.videoId The videoId parameter specifies that the request should return only the playlist items that contain the specified video. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlistItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlistItems.update + * @desc Modifies a playlist item. For example, you could update the item's + * position in the playlist. + * @alias youtube.playlistItems.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings. + * @param {().PlaylistItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlistItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Playlists { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.playlists.delete + * @desc Deletes a playlist. + * @alias youtube.playlists.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlists.insert + * @desc Creates a playlist. + * @alias youtube.playlists.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * @param {().Playlist} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlists.list + * @desc Returns a collection of playlists that match the API request + * parameters. For example, you can retrieve all playlists that the + * authenticated user owns, or you can retrieve one or more playlists by + * their unique IDs. + * @alias youtube.playlists.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId This value indicates that the API should only return the specified channel's playlists. + * @param {string=} params.hl The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.playlists.update + * @desc Modifies a playlist. For example, you could change a playlist's + * title, description, or privacy status. + * @alias youtube.playlists.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted. + * @param {().Playlist} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): + AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/playlists') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Search { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.search.list + * @desc Returns a collection of search results that match the query + * parameters specified in the API request. By default, a search result set + * identifies matching video, channel, and playlist resources, but you can + * also configure queries to only retrieve a specific type of resource. + * @alias youtube.search.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId The channelId parameter indicates that the API response should only contain resources created by the channel + * @param {string=} params.channelType The channelType parameter lets you restrict a search to a particular type of channel. + * @param {string=} params.eventType The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {boolean=} params.forContentOwner Note: This parameter is intended exclusively for YouTube content partners. The forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided. + * @param {boolean=} params.forDeveloper The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites. + * @param {boolean=} params.forMine The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video. + * @param {string=} params.location The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427). - The location parameter value identifies the point at the center of the area. - The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter. + * @param {string=} params.locationRadius The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area. The parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers. Note: See the definition of the location parameter for more information. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.order The order parameter specifies the method that will be used to order resources in the API response. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet. + * @param {string=} params.publishedAfter The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). + * @param {string=} params.publishedBefore The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). + * @param {string=} params.q The q parameter specifies the query term to search for. Your request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either "boating" or "sailing", set the q parameter value to boating|sailing. Similarly, to search for videos matching either "boating" or "sailing" but not "fishing", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C. + * @param {string=} params.regionCode The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * @param {string=} params.relatedToVideoId The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video. + * @param {string=} params.relevanceLanguage The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term. + * @param {string=} params.safeSearch The safeSearch parameter indicates whether the search results should include restricted content as well as standard content. + * @param {string=} params.topicId The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID. + * @param {string=} params.type The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types. + * @param {string=} params.videoCaption The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoCategoryId The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoDefinition The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoDimension The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoDuration The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoEmbeddable The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoLicense The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoSyndicated The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {string=} params.videoType The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/search') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Sponsors { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.sponsors.list + * @desc Lists sponsors for a channel. + * @alias youtube.sponsors.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.filter The filter parameter specifies which channel sponsors to return. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/sponsors') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Subscriptions { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.subscriptions.delete + * @desc Deletes a subscription. + * @alias youtube.subscriptions.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.subscriptions.insert + * @desc Adds a subscription for the authenticated user's channel. + * @alias youtube.subscriptions.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. + * @param {().Subscription} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.subscriptions.list + * @desc Returns subscription resources that match the API request criteria. + * @alias youtube.subscriptions.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.channelId The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions. + * @param {string=} params.forChannelId The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {boolean=} params.mine Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions. + * @param {boolean=} params.myRecentSubscribers Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in reverse chronological order (newest first). + * @param {boolean=} params.mySubscribers Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string=} params.order The order parameter specifies the method that will be used to sort resources in the API response. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/subscriptions') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Superchatevents { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.superChatEvents.list + * @desc Lists Super Chat events for a channel. + * @alias youtube.superChatEvents.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + * @param {string} params.part The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/superChatEvents') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Thumbnails { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.thumbnails.set + * @desc Uploads a custom video thumbnail to YouTube and sets it for a + * video. + * @alias youtube.thumbnails.set + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.videoId The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided. + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + set(params?: any, + options?: MethodOptions): AxiosPromise; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + set(params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/thumbnails/set') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/thumbnails/set') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['videoId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Videoabusereportreasons { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.videoAbuseReportReasons.list + * @desc Returns a list of abuse reasons that can be used for reporting + * abusive videos. + * @alias youtube.videoAbuseReportReasons.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. + * @param {string} params.part The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: + BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videoAbuseReportReasons') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest( + parameters); + } + } + } + + export class Resource$Videocategories { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.videoCategories.list + * @desc Returns a list of categories that can be associated with YouTube + * videos. + * @alias youtube.videoCategories.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.hl The hl parameter specifies the language that should be used for text values in the API response. + * @param {string=} params.id The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving. + * @param {string} params.part The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet. + * @param {string=} params.regionCode The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videoCategories') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest( + parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Videos { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.videos.delete + * @desc Deletes a YouTube video. + * @alias youtube.videos.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.getRating + * @desc Retrieves the ratings that the authorized user gave to a list of + * specified videos. + * @alias youtube.videos.getRating + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + getRating(params?: any, options?: MethodOptions): + AxiosPromise; + getRating( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + getRating( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos/getRating') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.insert + * @desc Uploads a video to YouTube and optionally sets the video's + * metadata. + * @alias youtube.videos.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.autoLevels The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color. + * @param {boolean=} params.notifySubscribers The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.onBehalfOfContentOwnerChannel This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + * @param {boolean=} params.stabilize The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/videos') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.list + * @desc Returns a list of videos that match the API request parameters. + * @alias youtube.videos.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.chart The chart parameter identifies the chart that you want to retrieve. + * @param {string=} params.hl The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID. + * @param {string=} params.locale DEPRECATED + * @param {integer=} params.maxHeight The maxHeight parameter specifies a maximum height of the embedded player. If maxWidth is provided, maxHeight may not be reached in order to not violate the width request. + * @param {integer=} params.maxResults The maxResults parameter specifies the maximum number of items that should be returned in the result set. Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. + * @param {integer=} params.maxWidth The maxWidth parameter specifies a maximum width of the embedded player. If maxHeight is provided, maxWidth may not be reached in order to not violate the height request. + * @param {string=} params.myRating Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. Note: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter. + * @param {string} params.part The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include. If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties. + * @param {string=} params.regionCode The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code. + * @param {string=} params.videoCategoryId The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.rate + * @desc Add a like or dislike rating to a video or remove a rating from a + * video. + * @alias youtube.videos.rate + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed. + * @param {string} params.rating Specifies the rating to record. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + rate(params?: any, options?: MethodOptions): AxiosPromise; + rate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + rate( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos/rate') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['id', 'rating'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.reportAbuse + * @desc Report abuse for a video. + * @alias youtube.videos.reportAbuse + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().VideoAbuseReport} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + reportAbuse(params?: any, options?: MethodOptions): AxiosPromise; + reportAbuse( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + reportAbuse( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos/reportAbuse') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.videos.update + * @desc Updates a video's metadata. + * @alias youtube.videos.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string} params.part The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Note that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting. In addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response. + * @param {().Video} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/videos') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: ['part'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + } + + export class Resource$Watermarks { + root: Youtube; + constructor(root: Youtube) { + this.root = root; + this.getRoot.bind(this); + } + + getRoot() { + return this.root; + } + + + /** + * youtube.watermarks.set + * @desc Uploads a watermark image to YouTube and sets it for a channel. + * @alias youtube.watermarks.set + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being provided. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} params.resource Media resource metadata + * @param {object} params.media Media object + * @param {string} params.media.mimeType Media mime-type + * @param {string|object} params.media.body Media body contents + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + set(params?: any, options?: MethodOptions): AxiosPromise; + set(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + set(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/watermarks/set') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + mediaUrl: (rootUrl + '/upload/youtube/v3/watermarks/set') + .replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['channelId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } + + + /** + * youtube.watermarks.unset + * @desc Deletes a channel's watermark image. + * @alias youtube.watermarks.unset + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being unset. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + unset(params?: any, options?: MethodOptions): AxiosPromise; + unset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + unset( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/v3/watermarks/unset') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: ['channelId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/youtubeAnalytics/v1.ts b/src/apis/youtubeAnalytics/v1.ts index 10e03707317..648ce8aea64 100644 --- a/src/apis/youtubeAnalytics/v1.ts +++ b/src/apis/youtubeAnalytics/v1.ts @@ -27,588 +27,599 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * YouTube Analytics API - * - * Retrieves your YouTube Analytics data. - * - * @example - * const google = require('googleapis'); - * const youtubeAnalytics = google.youtubeAnalytics('v1'); - * - * @namespace youtubeAnalytics - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Youtubeanalytics - */ -export class Youtubeanalytics { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - groupItems: Resource$Groupitems; - groups: Resource$Groups; - reports: Resource$Reports; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.groupItems = new Resource$Groupitems(this); - this.groups = new Resource$Groups(this); - this.reports = new Resource$Reports(this); - } +export namespace youtubeAnalytics_v1 { + /** + * YouTube Analytics API + * + * Retrieves your YouTube Analytics data. + * + * @example + * const google = require('googleapis'); + * const youtubeAnalytics = google.youtubeAnalytics('v1'); + * + * @namespace youtubeAnalytics + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Youtubeanalytics + */ + export class Youtubeanalytics { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + groupItems: Resource$Groupitems; + groups: Resource$Groups; + reports: Resource$Reports; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.groupItems = new Resource$Groupitems(this); + this.groups = new Resource$Groups(this); + this.reports = new Resource$Reports(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$Group { - contentDetails: any; - etag: string; - id: string; - kind: string; - snippet: any; -} -export interface Schema$GroupItem { - etag: string; - groupId: string; - id: string; - kind: string; - resource: any; -} -/** - * A paginated list of grouList resources returned in response to a - * youtubeAnalytics.groupApi.list request. - */ -export interface Schema$GroupItemListResponse { - etag: string; - items: Schema$GroupItem[]; - kind: string; -} -/** - * A paginated list of grouList resources returned in response to a - * youtubeAnalytics.groupApi.list request. - */ -export interface Schema$GroupListResponse { - etag: string; - items: Schema$Group[]; - kind: string; - nextPageToken: string; -} -/** - * Contains a single result table. The table is returned as an array of rows - * that contain the values for the cells of the table. Depending on the metric - * or dimension, the cell can contain a string (video ID, country code) or a - * number (number of views or number of likes). - */ -export interface Schema$ResultTable { + export interface Schema$Group { + contentDetails: any; + etag: string; + id: string; + kind: string; + snippet: any; + } + export interface Schema$GroupItem { + etag: string; + groupId: string; + id: string; + kind: string; + resource: any; + } /** - * This value specifies information about the data returned in the rows - * fields. Each item in the columnHeaders list identifies a field returned in - * the rows value, which contains a list of comma-delimited data. The - * columnHeaders list will begin with the dimensions specified in the API - * request, which will be followed by the metrics specified in the API - * request. The order of both dimensions and metrics will match the ordering - * in the API request. For example, if the API request contains the parameters - * dimensions=ageGroup,gender&metrics=viewerPercentage, the API response - * will return columns in this order: ageGroup,gender,viewerPercentage. + * A paginated list of grouList resources returned in response to a + * youtubeAnalytics.groupApi.list request. */ - columnHeaders: any[]; + export interface Schema$GroupItemListResponse { + etag: string; + items: Schema$GroupItem[]; + kind: string; + } /** - * This value specifies the type of data included in the API response. For the - * query method, the kind property value will be youtubeAnalytics#resultTable. + * A paginated list of grouList resources returned in response to a + * youtubeAnalytics.groupApi.list request. */ - kind: string; + export interface Schema$GroupListResponse { + etag: string; + items: Schema$Group[]; + kind: string; + nextPageToken: string; + } /** - * The list contains all rows of the result table. Each item in the list is an - * array that contains comma-delimited data corresponding to a single row of - * data. The order of the comma-delimited data fields will match the order of - * the columns listed in the columnHeaders field. If no data is available for - * the given query, the rows element will be omitted from the response. The - * response for a query with the day dimension will not contain rows for the - * most recent days. + * Contains a single result table. The table is returned as an array of rows + * that contain the values for the cells of the table. Depending on the metric + * or dimension, the cell can contain a string (video ID, country code) or a + * number (number of views or number of likes). */ - rows: any[][]; -} - -export class Resource$Groupitems { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$ResultTable { + /** + * This value specifies information about the data returned in the rows + * fields. Each item in the columnHeaders list identifies a field returned + * in the rows value, which contains a list of comma-delimited data. The + * columnHeaders list will begin with the dimensions specified in the API + * request, which will be followed by the metrics specified in the API + * request. The order of both dimensions and metrics will match the ordering + * in the API request. For example, if the API request contains the + * parameters dimensions=ageGroup,gender&metrics=viewerPercentage, the + * API response will return columns in this order: + * ageGroup,gender,viewerPercentage. + */ + columnHeaders: any[]; + /** + * This value specifies the type of data included in the API response. For + * the query method, the kind property value will be + * youtubeAnalytics#resultTable. + */ + kind: string; + /** + * The list contains all rows of the result table. Each item in the list is + * an array that contains comma-delimited data corresponding to a single row + * of data. The order of the comma-delimited data fields will match the + * order of the columns listed in the columnHeaders field. If no data is + * available for the given query, the rows element will be omitted from the + * response. The response for a query with the day dimension will not + * contain rows for the most recent days. + */ + rows: any[][]; } - - /** - * youtubeAnalytics.groupItems.delete - * @desc Removes an item from a group. - * @alias youtubeAnalytics.groupItems.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube group item ID for the group that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groupitems { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groupItems.insert - * @desc Creates a group item. - * @alias youtubeAnalytics.groupItems.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().GroupItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groupItems.delete + * @desc Removes an item from a group. + * @alias youtubeAnalytics.groupItems.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube group item ID for the group that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groupItems.list - * @desc Returns a collection of group items that match the API request - * parameters. - * @alias youtubeAnalytics.groupItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubeAnalytics.groupItems.insert + * @desc Creates a group item. + * @alias youtubeAnalytics.groupItems.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().GroupItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Groups { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groupItems.list + * @desc Returns a collection of group items that match the API request + * parameters. + * @alias youtubeAnalytics.groupItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.groups.delete - * @desc Deletes a group. - * @alias youtubeAnalytics.groups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube group ID for the group that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groups { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groups.insert - * @desc Creates a group. - * @alias youtubeAnalytics.groups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groups.delete + * @desc Deletes a group. + * @alias youtubeAnalytics.groups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube group ID for the group that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.list - * @desc Returns a collection of groups that match the API request parameters. - * For example, you can retrieve all groups that the authenticated user owns, - * or you can retrieve one or more groups by their unique IDs. - * @alias youtubeAnalytics.groups.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID. - * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubeAnalytics.groups.insert + * @desc Creates a group. + * @alias youtubeAnalytics.groups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.update - * @desc Modifies a group. For example, you could change a group's title. - * @alias youtubeAnalytics.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * youtubeAnalytics.groups.list + * @desc Returns a collection of groups that match the API request + * parameters. For example, you can retrieve all groups that the + * authenticated user owns, or you can retrieve one or more groups by their + * unique IDs. + * @alias youtubeAnalytics.groups.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID. + * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Reports { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groups.update + * @desc Modifies a group. For example, you could change a group's title. + * @alias youtubeAnalytics.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.reports.query - * @desc Retrieve your YouTube Analytics reports. - * @alias youtubeAnalytics.reports.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized. - * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions. - * @param {string} params.end-date The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. - * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy. - * @param {string} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner. - * @param {boolean=} params.include-historical-channel-data If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved. - * @param {integer=} params.max-results The maximum number of rows to include in the response. - * @param {string} params.metrics A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order. - * @param {string} params.start-date The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * youtubeAnalytics.reports.query + * @desc Retrieve your YouTube Analytics reports. + * @alias youtubeAnalytics.reports.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized. + * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions. + * @param {string} params.end-date The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. + * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy. + * @param {string} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner. + * @param {boolean=} params.include-historical-channel-data If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved. + * @param {integer=} params.max-results The maximum number of rows to include in the response. + * @param {string} params.metrics A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order. + * @param {string} params.start-date The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/youtubeAnalytics/v1beta1.ts b/src/apis/youtubeAnalytics/v1beta1.ts index 6d19c8b24ea..f8b64033a74 100644 --- a/src/apis/youtubeAnalytics/v1beta1.ts +++ b/src/apis/youtubeAnalytics/v1beta1.ts @@ -27,588 +27,599 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * YouTube Analytics API - * - * Retrieves your YouTube Analytics data. - * - * @example - * const google = require('googleapis'); - * const youtubeAnalytics = google.youtubeAnalytics('v1beta1'); - * - * @namespace youtubeAnalytics - * @type {Function} - * @version v1beta1 - * @variation v1beta1 - * @param {object=} options Options for Youtubeanalytics - */ -export class Youtubeanalytics { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - groupItems: Resource$Groupitems; - groups: Resource$Groups; - reports: Resource$Reports; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.groupItems = new Resource$Groupitems(this); - this.groups = new Resource$Groups(this); - this.reports = new Resource$Reports(this); - } +export namespace youtubeAnalytics_v1beta1 { + /** + * YouTube Analytics API + * + * Retrieves your YouTube Analytics data. + * + * @example + * const google = require('googleapis'); + * const youtubeAnalytics = google.youtubeAnalytics('v1beta1'); + * + * @namespace youtubeAnalytics + * @type {Function} + * @version v1beta1 + * @variation v1beta1 + * @param {object=} options Options for Youtubeanalytics + */ + export class Youtubeanalytics { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + groupItems: Resource$Groupitems; + groups: Resource$Groups; + reports: Resource$Reports; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.groupItems = new Resource$Groupitems(this); + this.groups = new Resource$Groups(this); + this.reports = new Resource$Reports(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -export interface Schema$Group { - contentDetails: any; - etag: string; - id: string; - kind: string; - snippet: any; -} -export interface Schema$GroupItem { - etag: string; - groupId: string; - id: string; - kind: string; - resource: any; -} -/** - * A paginated list of grouList resources returned in response to a - * youtubeAnalytics.groupApi.list request. - */ -export interface Schema$GroupItemListResponse { - etag: string; - items: Schema$GroupItem[]; - kind: string; -} -/** - * A paginated list of grouList resources returned in response to a - * youtubeAnalytics.groupApi.list request. - */ -export interface Schema$GroupListResponse { - etag: string; - items: Schema$Group[]; - kind: string; - nextPageToken: string; -} -/** - * Contains a single result table. The table is returned as an array of rows - * that contain the values for the cells of the table. Depending on the metric - * or dimension, the cell can contain a string (video ID, country code) or a - * number (number of views or number of likes). - */ -export interface Schema$ResultTable { + export interface Schema$Group { + contentDetails: any; + etag: string; + id: string; + kind: string; + snippet: any; + } + export interface Schema$GroupItem { + etag: string; + groupId: string; + id: string; + kind: string; + resource: any; + } /** - * This value specifies information about the data returned in the rows - * fields. Each item in the columnHeaders list identifies a field returned in - * the rows value, which contains a list of comma-delimited data. The - * columnHeaders list will begin with the dimensions specified in the API - * request, which will be followed by the metrics specified in the API - * request. The order of both dimensions and metrics will match the ordering - * in the API request. For example, if the API request contains the parameters - * dimensions=ageGroup,gender&metrics=viewerPercentage, the API response - * will return columns in this order: ageGroup,gender,viewerPercentage. + * A paginated list of grouList resources returned in response to a + * youtubeAnalytics.groupApi.list request. */ - columnHeaders: any[]; + export interface Schema$GroupItemListResponse { + etag: string; + items: Schema$GroupItem[]; + kind: string; + } /** - * This value specifies the type of data included in the API response. For the - * query method, the kind property value will be youtubeAnalytics#resultTable. + * A paginated list of grouList resources returned in response to a + * youtubeAnalytics.groupApi.list request. */ - kind: string; + export interface Schema$GroupListResponse { + etag: string; + items: Schema$Group[]; + kind: string; + nextPageToken: string; + } /** - * The list contains all rows of the result table. Each item in the list is an - * array that contains comma-delimited data corresponding to a single row of - * data. The order of the comma-delimited data fields will match the order of - * the columns listed in the columnHeaders field. If no data is available for - * the given query, the rows element will be omitted from the response. The - * response for a query with the day dimension will not contain rows for the - * most recent days. + * Contains a single result table. The table is returned as an array of rows + * that contain the values for the cells of the table. Depending on the metric + * or dimension, the cell can contain a string (video ID, country code) or a + * number (number of views or number of likes). */ - rows: any[][]; -} - -export class Resource$Groupitems { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + export interface Schema$ResultTable { + /** + * This value specifies information about the data returned in the rows + * fields. Each item in the columnHeaders list identifies a field returned + * in the rows value, which contains a list of comma-delimited data. The + * columnHeaders list will begin with the dimensions specified in the API + * request, which will be followed by the metrics specified in the API + * request. The order of both dimensions and metrics will match the ordering + * in the API request. For example, if the API request contains the + * parameters dimensions=ageGroup,gender&metrics=viewerPercentage, the + * API response will return columns in this order: + * ageGroup,gender,viewerPercentage. + */ + columnHeaders: any[]; + /** + * This value specifies the type of data included in the API response. For + * the query method, the kind property value will be + * youtubeAnalytics#resultTable. + */ + kind: string; + /** + * The list contains all rows of the result table. Each item in the list is + * an array that contains comma-delimited data corresponding to a single row + * of data. The order of the comma-delimited data fields will match the + * order of the columns listed in the columnHeaders field. If no data is + * available for the given query, the rows element will be omitted from the + * response. The response for a query with the day dimension will not + * contain rows for the most recent days. + */ + rows: any[][]; } - - /** - * youtubeAnalytics.groupItems.delete - * @desc Removes an item from a group. - * @alias youtubeAnalytics.groupItems.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube group item ID for the group that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groupitems { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groupItems.insert - * @desc Creates a group item. - * @alias youtubeAnalytics.groupItems.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().GroupItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groupItems.delete + * @desc Removes an item from a group. + * @alias youtubeAnalytics.groupItems.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube group item ID for the group that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groupItems.list - * @desc Returns a collection of group items that match the API request - * parameters. - * @alias youtubeAnalytics.groupItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubeAnalytics.groupItems.insert + * @desc Creates a group item. + * @alias youtubeAnalytics.groupItems.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().GroupItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['groupId'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Groups { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groupItems.list + * @desc Returns a collection of group items that match the API request + * parameters. + * @alias youtubeAnalytics.groupItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.groupId The id parameter specifies the unique ID of the group for which you want to retrieve group items. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groupItems') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['groupId'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.groups.delete - * @desc Deletes a group. - * @alias youtubeAnalytics.groups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.id The id parameter specifies the YouTube group ID for the group that is being deleted. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groups { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['id'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groups.insert - * @desc Creates a group. - * @alias youtubeAnalytics.groups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groups.delete + * @desc Deletes a group. + * @alias youtubeAnalytics.groups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The id parameter specifies the YouTube group ID for the group that is being deleted. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['id'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.list - * @desc Returns a collection of groups that match the API request parameters. - * For example, you can retrieve all groups that the authenticated user owns, - * or you can retrieve one or more groups by their unique IDs. - * @alias youtubeAnalytics.groups.list - * @memberOf! () - * - * @param {object=} params Parameters for request - * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID. - * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user. - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubeAnalytics.groups.insert + * @desc Creates a group. + * @alias youtubeAnalytics.groups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.update - * @desc Modifies a group. For example, you could change a group's title. - * @alias youtubeAnalytics.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/groups') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * youtubeAnalytics.groups.list + * @desc Returns a collection of groups that match the API request + * parameters. For example, you can retrieve all groups that the + * authenticated user owns, or you can retrieve one or more groups by their + * unique IDs. + * @alias youtubeAnalytics.groups.list + * @memberOf! () + * + * @param {object=} params Parameters for request + * @param {string=} params.id The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID. + * @param {boolean=} params.mine Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user. + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Reports { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groups.update + * @desc Modifies a group. For example, you could change a group's title. + * @alias youtubeAnalytics.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner Note: This parameter is intended exclusively for YouTube content partners. The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/groups') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.reports.query - * @desc Retrieve your YouTube Analytics reports. - * @alias youtubeAnalytics.reports.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized. - * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions. - * @param {string} params.end-date The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. - * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy. - * @param {string} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner. - * @param {boolean=} params.include-historical-channel-data If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved. - * @param {integer=} params.max-results The maximum number of rows to include in the response. - * @param {string} params.metrics A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics. - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order. - * @param {string} params.start-date The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. - * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/youtube/analytics/v1beta1/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * youtubeAnalytics.reports.query + * @desc Retrieve your YouTube Analytics reports. + * @alias youtubeAnalytics.reports.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized. + * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions. + * @param {string} params.end-date The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. + * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy. + * @param {string} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner. + * @param {boolean=} params.include-historical-channel-data If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved. + * @param {integer=} params.max-results The maximum number of rows to include in the response. + * @param {string} params.metrics A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics. + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order. + * @param {string} params.start-date The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format. + * @param {integer=} params.start-index An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = options.rootUrl || 'https://www.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/youtube/analytics/v1beta1/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['ids', 'start-date', 'end-date', 'metrics'], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/youtubeAnalytics/v2.ts b/src/apis/youtubeAnalytics/v2.ts index 8b35738d1e6..67becf41984 100644 --- a/src/apis/youtubeAnalytics/v2.ts +++ b/src/apis/youtubeAnalytics/v2.ts @@ -27,819 +27,830 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * YouTube Analytics API - * - * Retrieves your YouTube Analytics data. - * - * @example - * const google = require('googleapis'); - * const youtubeAnalytics = google.youtubeAnalytics('v2'); - * - * @namespace youtubeAnalytics - * @type {Function} - * @version v2 - * @variation v2 - * @param {object=} options Options for Youtubeanalytics - */ -export class Youtubeanalytics { - _options: GlobalOptions; - google: GoogleApis; - root = this; - - groupItems: Resource$Groupitems; - groups: Resource$Groups; - reports: Resource$Reports; - - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); - - this.groupItems = new Resource$Groupitems(this); - this.groups = new Resource$Groups(this); - this.reports = new Resource$Reports(this); - } +export namespace youtubeAnalytics_v2 { + /** + * YouTube Analytics API + * + * Retrieves your YouTube Analytics data. + * + * @example + * const google = require('googleapis'); + * const youtubeAnalytics = google.youtubeAnalytics('v2'); + * + * @namespace youtubeAnalytics + * @type {Function} + * @version v2 + * @variation v2 + * @param {object=} options Options for Youtubeanalytics + */ + export class Youtubeanalytics { + _options: GlobalOptions; + google: GoogleApis; + root = this; + + groupItems: Resource$Groupitems; + groups: Resource$Groups; + reports: Resource$Reports; + + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); + + this.groupItems = new Resource$Groupitems(this); + this.groups = new Resource$Groups(this); + this.reports = new Resource$Reports(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * Empty response. - */ -export interface Schema$EmptyResponse { - /** - * Apiary error details - */ - errors: Schema$Errors; -} -/** - * Describes one specific error. - */ -export interface Schema$ErrorProto { - /** - * Error arguments, to be used when building user-friendly error messages - * given the error domain and code. Different error codes require different - * arguments. - */ - argument: string[]; - /** - * Error code in the error domain. This should correspond to a value of the - * enum type whose name is in domain. See the core error domain in - * error_domain.proto. - */ - code: string; - /** - * Debugging information, which should not be shared externally. - */ - debugInfo: string; - /** - * Error domain. RoSy services can define their own domain and error codes. - * This should normally be the name of an enum type, such as: - * gdata.CoreErrorDomain - */ - domain: string; - /** - * A short explanation for the error, which can be shared outside Google. - * Please set domain, code and arguments whenever possible instead of this - * error message so that external APIs can build safe error messages - * themselves. External messages built in a RoSy interface will most likely - * refer to information and concepts that are not available externally and - * should not be exposed. It is safer if external APIs can understand the - * errors and decide what the error message should look like. - */ - externalErrorMessage: string; - /** - * Location of the error, as specified by the location type. If location_type - * is PATH, this should be a path to a field that's relative to the - * request, using FieldPath notation (net/proto2/util/public/field_path.h). - * Examples: authenticated_user.gaia_id resource.address[2].country - */ - location: string; - locationType: string; -} -/** - * Request Error information. The presence of an error field signals that the - * operation has failed. - */ -export interface Schema$Errors { - /** - * Global error code. Deprecated and ignored. Set custom error codes in - * ErrorProto.domain and ErrorProto.code instead. - */ - code: string; - /** - * Specific error description and codes - */ - error: Schema$ErrorProto[]; - /** - * Request identifier generated by the service, which can be used to identify - * the error in the logs - */ - requestId: string; -} -/** - * A group. - */ -export interface Schema$Group { - /** - * The `contentDetails` object contains additional information about the - * group, such as the number and type of items that it contains. - */ - contentDetails: Schema$GroupContentDetails; - /** - * Apiary error details - */ - errors: Schema$Errors; - /** - * The Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the group. - */ - id: string; - /** - * Identifies the API resource's type. The value will be `youtube#group`. - */ - kind: string; - /** - * The `snippet` object contains basic information about the group, including - * its creation date and name. - */ - snippet: Schema$GroupSnippet; -} -/** - * A group's content details. - */ -export interface Schema$GroupContentDetails { - /** - * The number of items in the group. - */ - itemCount: string; - /** - * The type of resources that the group contains. Valid values for this - * property are: * `youtube#channel` * `youtube#playlist` * `youtube#video` - * * `youtubePartner#asset` - */ - itemType: string; -} -/** - * A group item. - */ -export interface Schema$GroupItem { - /** - * Apiary error details - */ - errors: Schema$Errors; - /** - * The Etag of this resource. - */ - etag: string; - /** - * The ID that YouTube uses to uniquely identify the group that contains the - * item. - */ - groupId: string; - /** - * The ID that YouTube uses to uniquely identify the `channel`, `video`, - * `playlist`, or `asset` resource that is included in the group. Note that - * this ID refers specifically to the inclusion of that resource in a - * particular group and is different than the channel ID, video ID, playlist - * ID, or asset ID that uniquely identifies the resource itself. The - * `resource.id` property's value specifies the unique channel, video, - * playlist, or asset ID. - */ - id: string; - /** - * Identifies the API resource's type. The value will be - * `youtube#groupItem`. - */ - kind: string; - /** - * The `resource` object contains information that identifies the item being - * added to the group. - */ - resource: Schema$GroupItemResource; -} -export interface Schema$GroupItemResource { - /** - * The channel, video, playlist, or asset ID that YouTube uses to uniquely - * identify the item that is being added to the group. - */ - id: string; - /** - * Identifies the type of resource being added to the group. Valid values for - * this property are: * `youtube#channel` * `youtube#playlist` * - * `youtube#video` * `youtubePartner#asset` - */ - kind: string; -} -/** - * A group snippet. - */ -export interface Schema$GroupSnippet { - /** - * The date and time that the group was created. The value is specified in ISO - * 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - */ - publishedAt: string; - /** - * The group name. The value must be a non-empty string. - */ - title: string; -} -/** - * Response message for GroupsService.ListGroupItems. - */ -export interface Schema$ListGroupItemsResponse { - /** - * Apiary error details - */ - errors: Schema$Errors; - /** - * The Etag of this resource. - */ - etag: string; /** - * A list of groups that match the API request parameters. Each item in the - * list represents a `groupItem` resource. + * Empty response. */ - items: Schema$GroupItem[]; - /** - * Identifies the API resource's type. The value will be - * `youtube#groupItemListResponse`. - */ - kind: string; -} -/** - * Response message for GroupsService.ListGroups. - */ -export interface Schema$ListGroupsResponse { - /** - * Apiary error details - */ - errors: Schema$Errors; - /** - * The Etag of this resource. - */ - etag: string; - /** - * A list of groups that match the API request parameters. Each item in the - * list represents a `group` resource. - */ - items: Schema$Group[]; + export interface Schema$EmptyResponse { + /** + * Apiary error details + */ + errors: Schema$Errors; + } /** - * Identifies the API resource's type. The value will be - * `youtube#groupListResponse`. - */ - kind: string; + * Describes one specific error. + */ + export interface Schema$ErrorProto { + /** + * Error arguments, to be used when building user-friendly error messages + * given the error domain and code. Different error codes require different + * arguments. + */ + argument: string[]; + /** + * Error code in the error domain. This should correspond to a value of the + * enum type whose name is in domain. See the core error domain in + * error_domain.proto. + */ + code: string; + /** + * Debugging information, which should not be shared externally. + */ + debugInfo: string; + /** + * Error domain. RoSy services can define their own domain and error codes. + * This should normally be the name of an enum type, such as: + * gdata.CoreErrorDomain + */ + domain: string; + /** + * A short explanation for the error, which can be shared outside Google. + * Please set domain, code and arguments whenever possible instead of this + * error message so that external APIs can build safe error messages + * themselves. External messages built in a RoSy interface will most likely + * refer to information and concepts that are not available externally and + * should not be exposed. It is safer if external APIs can understand the + * errors and decide what the error message should look like. + */ + externalErrorMessage: string; + /** + * Location of the error, as specified by the location type. If + * location_type is PATH, this should be a path to a field that's + * relative to the request, using FieldPath notation + * (net/proto2/util/public/field_path.h). Examples: + * authenticated_user.gaia_id resource.address[2].country + */ + location: string; + locationType: string; + } /** - * The token that can be used as the value of the `pageToken` parameter to - * retrieve the next page in the result set. - */ - nextPageToken: string; -} -/** - * Response message for TargetedQueriesService.Query. - */ -export interface Schema$QueryResponse { + * Request Error information. The presence of an error field signals that the + * operation has failed. + */ + export interface Schema$Errors { + /** + * Global error code. Deprecated and ignored. Set custom error codes in + * ErrorProto.domain and ErrorProto.code instead. + */ + code: string; + /** + * Specific error description and codes + */ + error: Schema$ErrorProto[]; + /** + * Request identifier generated by the service, which can be used to + * identify the error in the logs + */ + requestId: string; + } /** - * This value specifies information about the data returned in the `rows` - * fields. Each item in the `columnHeaders` list identifies a field returned - * in the `rows` value, which contains a list of comma-delimited data. The - * `columnHeaders` list will begin with the dimensions specified in the API - * request, which will be followed by the metrics specified in the API - * request. The order of both dimensions and metrics will match the ordering - * in the API request. For example, if the API request contains the parameters - * `dimensions=ageGroup,gender&metrics=viewerPercentage`, the API response - * will return columns in this order: `ageGroup`, `gender`, - * `viewerPercentage`. - */ - columnHeaders: Schema$ResultTableColumnHeader[]; + * A group. + */ + export interface Schema$Group { + /** + * The `contentDetails` object contains additional information about the + * group, such as the number and type of items that it contains. + */ + contentDetails: Schema$GroupContentDetails; + /** + * Apiary error details + */ + errors: Schema$Errors; + /** + * The Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the group. + */ + id: string; + /** + * Identifies the API resource's type. The value will be + * `youtube#group`. + */ + kind: string; + /** + * The `snippet` object contains basic information about the group, + * including its creation date and name. + */ + snippet: Schema$GroupSnippet; + } /** - * When set, indicates that the operation failed. - */ - errors: Schema$Errors; + * A group's content details. + */ + export interface Schema$GroupContentDetails { + /** + * The number of items in the group. + */ + itemCount: string; + /** + * The type of resources that the group contains. Valid values for this + * property are: * `youtube#channel` * `youtube#playlist` * + * `youtube#video` * `youtubePartner#asset` + */ + itemType: string; + } /** - * This value specifies the type of data included in the API response. For the - * query method, the kind property value will be - * `youtubeAnalytics#resultTable`. - */ - kind: string; + * A group item. + */ + export interface Schema$GroupItem { + /** + * Apiary error details + */ + errors: Schema$Errors; + /** + * The Etag of this resource. + */ + etag: string; + /** + * The ID that YouTube uses to uniquely identify the group that contains the + * item. + */ + groupId: string; + /** + * The ID that YouTube uses to uniquely identify the `channel`, `video`, + * `playlist`, or `asset` resource that is included in the group. Note that + * this ID refers specifically to the inclusion of that resource in a + * particular group and is different than the channel ID, video ID, playlist + * ID, or asset ID that uniquely identifies the resource itself. The + * `resource.id` property's value specifies the unique channel, video, + * playlist, or asset ID. + */ + id: string; + /** + * Identifies the API resource's type. The value will be + * `youtube#groupItem`. + */ + kind: string; + /** + * The `resource` object contains information that identifies the item being + * added to the group. + */ + resource: Schema$GroupItemResource; + } + export interface Schema$GroupItemResource { + /** + * The channel, video, playlist, or asset ID that YouTube uses to uniquely + * identify the item that is being added to the group. + */ + id: string; + /** + * Identifies the type of resource being added to the group. Valid values + * for this property are: * `youtube#channel` * `youtube#playlist` * + * `youtube#video` * `youtubePartner#asset` + */ + kind: string; + } /** - * The list contains all rows of the result table. Each item in the list is an - * array that contains comma-delimited data corresponding to a single row of - * data. The order of the comma-delimited data fields will match the order of - * the columns listed in the `columnHeaders` field. If no data is available - * for the given query, the `rows` element will be omitted from the response. - * The response for a query with the `day` dimension will not contain rows for - * the most recent days. - */ - rows: any[][]; -} -/** - * The description of a column of the result table. - */ -export interface Schema$ResultTableColumnHeader { + * A group snippet. + */ + export interface Schema$GroupSnippet { + /** + * The date and time that the group was created. The value is specified in + * ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + */ + publishedAt: string; + /** + * The group name. The value must be a non-empty string. + */ + title: string; + } /** - * The type of the column (`DIMENSION` or `METRIC`). - */ - columnType: string; + * Response message for GroupsService.ListGroupItems. + */ + export interface Schema$ListGroupItemsResponse { + /** + * Apiary error details + */ + errors: Schema$Errors; + /** + * The Etag of this resource. + */ + etag: string; + /** + * A list of groups that match the API request parameters. Each item in the + * list represents a `groupItem` resource. + */ + items: Schema$GroupItem[]; + /** + * Identifies the API resource's type. The value will be + * `youtube#groupItemListResponse`. + */ + kind: string; + } /** - * The type of the data in the column (`STRING`, `INTEGER`, `FLOAT`, etc.). - */ - dataType: string; + * Response message for GroupsService.ListGroups. + */ + export interface Schema$ListGroupsResponse { + /** + * Apiary error details + */ + errors: Schema$Errors; + /** + * The Etag of this resource. + */ + etag: string; + /** + * A list of groups that match the API request parameters. Each item in the + * list represents a `group` resource. + */ + items: Schema$Group[]; + /** + * Identifies the API resource's type. The value will be + * `youtube#groupListResponse`. + */ + kind: string; + /** + * The token that can be used as the value of the `pageToken` parameter to + * retrieve the next page in the result set. + */ + nextPageToken: string; + } /** - * The name of the dimension or metric. - */ - name: string; -} - -export class Resource$Groupitems { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); + * Response message for TargetedQueriesService.Query. + */ + export interface Schema$QueryResponse { + /** + * This value specifies information about the data returned in the `rows` + * fields. Each item in the `columnHeaders` list identifies a field returned + * in the `rows` value, which contains a list of comma-delimited data. The + * `columnHeaders` list will begin with the dimensions specified in the API + * request, which will be followed by the metrics specified in the API + * request. The order of both dimensions and metrics will match the ordering + * in the API request. For example, if the API request contains the + * parameters `dimensions=ageGroup,gender&metrics=viewerPercentage`, the + * API response will return columns in this order: `ageGroup`, `gender`, + * `viewerPercentage`. + */ + columnHeaders: Schema$ResultTableColumnHeader[]; + /** + * When set, indicates that the operation failed. + */ + errors: Schema$Errors; + /** + * This value specifies the type of data included in the API response. For + * the query method, the kind property value will be + * `youtubeAnalytics#resultTable`. + */ + kind: string; + /** + * The list contains all rows of the result table. Each item in the list is + * an array that contains comma-delimited data corresponding to a single row + * of data. The order of the comma-delimited data fields will match the + * order of the columns listed in the `columnHeaders` field. If no data is + * available for the given query, the `rows` element will be omitted from + * the response. The response for a query with the `day` dimension will not + * contain rows for the most recent days. + */ + rows: any[][]; } - - getRoot() { - return this.root; + /** + * The description of a column of the result table. + */ + export interface Schema$ResultTableColumnHeader { + /** + * The type of the column (`DIMENSION` or `METRIC`). + */ + columnType: string; + /** + * The type of the data in the column (`STRING`, `INTEGER`, `FLOAT`, etc.). + */ + dataType: string; + /** + * The name of the dimension or metric. + */ + name: string; } - - /** - * youtubeAnalytics.groupItems.delete - * @desc Removes an item from a group. - * @alias youtubeAnalytics.groupItems.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The `id` parameter specifies the YouTube group item ID of the group item that is being deleted. - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groupitems { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groupItems.insert - * @desc Creates a group item. - * @alias youtubeAnalytics.groupItems.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().GroupItem} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * youtubeAnalytics.groupItems.delete + * @desc Removes an item from a group. + * @alias youtubeAnalytics.groupItems.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The `id` parameter specifies the YouTube group item ID of the group item that is being deleted. + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } - /** - * youtubeAnalytics.groupItems.list - * @desc Returns a collection of group items that match the API request - * parameters. - * @alias youtubeAnalytics.groupItems.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.groupId The `groupId` parameter specifies the unique ID of the group for which you want to retrieve group items. - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + /** + * youtubeAnalytics.groupItems.insert + * @desc Creates a group item. + * @alias youtubeAnalytics.groupItems.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().GroupItem} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): + AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - } -} -export class Resource$Groups { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groupItems.list + * @desc Returns a collection of group items that match the API request + * parameters. + * @alias youtubeAnalytics.groupItems.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.groupId The `groupId` parameter specifies the unique ID of the group for which you want to retrieve group items. + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groupItems').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.groups.delete - * @desc Deletes a group. - * @alias youtubeAnalytics.groups.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The `id` parameter specifies the YouTube group ID of the group that is being deleted. - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): - AxiosPromise; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Groups { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubeAnalytics.groups.insert - * @desc Creates a group. - * @alias youtubeAnalytics.groups.insert - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - insert(params?: any, options?: MethodOptions): AxiosPromise; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - insert( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groups.delete + * @desc Deletes a group. + * @alias youtubeAnalytics.groups.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The `id` parameter specifies the YouTube group ID of the group that is being deleted. + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): + AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.list - * @desc Returns a collection of groups that match the API request parameters. - * For example, you can retrieve all groups that the authenticated user owns, - * or you can retrieve one or more groups by their unique IDs. - * @alias youtubeAnalytics.groups.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.id The `id` parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. Each group must be owned by the authenticated user. In a `group` resource, the `id` property specifies the group's YouTube group ID. Note that if you do not specify a value for the `id` parameter, then you must set the `mine` parameter to `true`. - * @param {boolean=} params.mine This parameter can only be used in a properly authorized request. Set this parameter's value to true to retrieve all groups owned by the authenticated user. - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {string=} params.pageToken The `pageToken` parameter identifies a specific page in the result set that should be returned. In an API response, the `nextPageToken` property identifies the next page that can be retrieved. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groups.insert + * @desc Creates a group. + * @alias youtubeAnalytics.groups.insert + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + insert(params?: any, options?: MethodOptions): AxiosPromise; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + insert( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubeAnalytics.groups.update - * @desc Modifies a group. For example, you could change a group's title. - * @alias youtubeAnalytics.groups.update - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. - * @param {().Group} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - update(params?: any, options?: MethodOptions): AxiosPromise; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - update( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubeAnalytics.groups.list + * @desc Returns a collection of groups that match the API request + * parameters. For example, you can retrieve all groups that the + * authenticated user owns, or you can retrieve one or more groups by their + * unique IDs. + * @alias youtubeAnalytics.groups.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.id The `id` parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. Each group must be owned by the authenticated user. In a `group` resource, the `id` property specifies the group's YouTube group ID. Note that if you do not specify a value for the `id` parameter, then you must set the `mine` parameter to `true`. + * @param {boolean=} params.mine This parameter can only be used in a properly authorized request. Set this parameter's value to true to retrieve all groups owned by the authenticated user. + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {string=} params.pageToken The `pageToken` parameter identifies a specific page in the result set that should be returned. In an API response, the `nextPageToken` property identifies the next page that can be retrieved. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), - method: 'PUT' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Reports { - root: Youtubeanalytics; - constructor(root: Youtubeanalytics) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubeAnalytics.groups.update + * @desc Modifies a group. For example, you could change a group's title. + * @alias youtubeAnalytics.groups.update + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner This parameter can only be used in a properly authorized request. **Note:** This parameter is intended exclusively for YouTube content partners that own and manage many different YouTube channels. The `onBehalfOfContentOwner` parameter indicates that the request's authorization credentials identify a YouTube user who is acting on behalf of the content owner specified in the parameter value. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The account that the user authenticates with must be linked to the specified YouTube content owner. + * @param {().Group} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + update(params?: any, options?: MethodOptions): AxiosPromise; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + update( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/groups').replace(/([^:]\/)\/+/g, '$1'), + method: 'PUT' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubeAnalytics.reports.query - * @desc Retrieve your YouTube Analytics reports. - * @alias youtubeAnalytics.reports.query - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.", pattern: [A-Z]{3} - * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as `views` or `ageGroup,gender`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document for definitions of those dimensions." pattern: [0-9a-zA-Z,]+ - * @param {string=} params.endDate The end date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: [0-9]{4}-[0-9]{2}-[0-9]{2} - * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The [Available Reports](/youtube/analytics/v2/available_reports) document identifies the dimensions that can be used to filter each report, and the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (`;`), and the returned result table will satisfy both filters. For example, a filters parameter value of `video==dMH0bHeiRNg;country==IT` restricts the result set to include data for the given video in Italy.", - * @param {string=} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the `ids` parameter value to `channel==CHANNEL_ID`, where `CHANNEL_ID` specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the `ids` parameter value to `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name of the content owner. required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+ - * @param {boolean=} params.includeHistoricalChannelData If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved.", - * @param {integer=} params.maxResults The maximum number of rows to include in the response.", minValue: 1 - * @param {string=} params.metrics A comma-separated list of YouTube Analytics metrics, such as `views` or `likes,dislikes`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the metrics available in each report, and see the [Metrics](/youtube/analytics/v2/dimsmets/mets) document for definitions of those metrics. required: true, pattern: [0-9a-zA-Z,]+ - * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '`-`' prefix causes descending sort order.", pattern: [-0-9a-zA-Z,]+ - * @param {string=} params.startDate The start date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: "[0-9]{4}-[0-9]{2}-[0-9]{2} - * @param {integer=} params.startIndex An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).", minValue: 1 - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - query(params?: any, options?: MethodOptions): - AxiosPromise; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - query( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reports { + root: Youtubeanalytics; + constructor(root: Youtubeanalytics) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v2/reports').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * youtubeAnalytics.reports.query + * @desc Retrieve your YouTube Analytics reports. + * @alias youtubeAnalytics.reports.query + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.currency The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.", pattern: [A-Z]{3} + * @param {string=} params.dimensions A comma-separated list of YouTube Analytics dimensions, such as `views` or `ageGroup,gender`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document for definitions of those dimensions." pattern: [0-9a-zA-Z,]+ + * @param {string=} params.endDate The end date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: [0-9]{4}-[0-9]{2}-[0-9]{2} + * @param {string=} params.filters A list of filters that should be applied when retrieving YouTube Analytics data. The [Available Reports](/youtube/analytics/v2/available_reports) document identifies the dimensions that can be used to filter each report, and the [Dimensions](/youtube/analytics/v2/dimsmets/dims) document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (`;`), and the returned result table will satisfy both filters. For example, a filters parameter value of `video==dMH0bHeiRNg;country==IT` restricts the result set to include data for the given video in Italy.", + * @param {string=} params.ids Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data. - To request data for a YouTube user, set the `ids` parameter value to `channel==CHANNEL_ID`, where `CHANNEL_ID` specifies the unique YouTube channel ID. - To request data for a YouTube CMS content owner, set the `ids` parameter value to `contentOwner==OWNER_NAME`, where `OWNER_NAME` is the CMS name of the content owner. required: true, pattern: [a-zA-Z]+==[a-zA-Z0-9_+-]+ + * @param {boolean=} params.includeHistoricalChannelData If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved.", + * @param {integer=} params.maxResults The maximum number of rows to include in the response.", minValue: 1 + * @param {string=} params.metrics A comma-separated list of YouTube Analytics metrics, such as `views` or `likes,dislikes`. See the [Available Reports](/youtube/analytics/v2/available_reports) document for a list of the reports that you can retrieve and the metrics available in each report, and see the [Metrics](/youtube/analytics/v2/dimsmets/mets) document for definitions of those metrics. required: true, pattern: [0-9a-zA-Z,]+ + * @param {string=} params.sort A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '`-`' prefix causes descending sort order.", pattern: [-0-9a-zA-Z,]+ + * @param {string=} params.startDate The start date for fetching YouTube Analytics data. The value should be in `YYYY-MM-DD` format. required: true, pattern: "[0-9]{4}-[0-9]{2}-[0-9]{2} + * @param {integer=} params.startIndex An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).", minValue: 1 + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + query(params?: any, options?: MethodOptions): + AxiosPromise; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + query( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubeanalytics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2/reports').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/apis/youtubereporting/v1.ts b/src/apis/youtubereporting/v1.ts index 63c9ce988ce..4e54f60b99f 100644 --- a/src/apis/youtubereporting/v1.ts +++ b/src/apis/youtubereporting/v1.ts @@ -27,1009 +27,1018 @@ import {createAPIRequest} from '../../lib/apirequest'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace -/** - * YouTube Reporting API - * - * Schedules reporting jobs containing your YouTube Analytics data and downloads - * the resulting bulk data reports in the form of CSV files. - * - * @example - * const google = require('googleapis'); - * const youtubereporting = google.youtubereporting('v1'); - * - * @namespace youtubereporting - * @type {Function} - * @version v1 - * @variation v1 - * @param {object=} options Options for Youtubereporting - */ -export class Youtubereporting { - _options: GlobalOptions; - google: GoogleApis; - root = this; +export namespace youtubereporting_v1 { + /** + * YouTube Reporting API + * + * Schedules reporting jobs containing your YouTube Analytics data and + * downloads the resulting bulk data reports in the form of CSV files. + * + * @example + * const google = require('googleapis'); + * const youtubereporting = google.youtubereporting('v1'); + * + * @namespace youtubereporting + * @type {Function} + * @version v1 + * @variation v1 + * @param {object=} options Options for Youtubereporting + */ + export class Youtubereporting { + _options: GlobalOptions; + google: GoogleApis; + root = this; - jobs: Resource$Jobs; - media: Resource$Media; - reportTypes: Resource$Reporttypes; + jobs: Resource$Jobs; + media: Resource$Media; + reportTypes: Resource$Reporttypes; - constructor(options: GlobalOptions, google: GoogleApis) { - this._options = options || {}; - this.google = google; - this.getRoot.bind(this); + constructor(options: GlobalOptions, google: GoogleApis) { + this._options = options || {}; + this.google = google; + this.getRoot.bind(this); - this.jobs = new Resource$Jobs(this); - this.media = new Resource$Media(this); - this.reportTypes = new Resource$Reporttypes(this); - } + this.jobs = new Resource$Jobs(this); + this.media = new Resource$Media(this); + this.reportTypes = new Resource$Reporttypes(this); + } - getRoot() { - return this.root; + getRoot() { + return this.root; + } } -} -/** - * A generic empty message that you can re-use to avoid defining duplicated - * empty messages in your APIs. A typical example is to use it as the request or - * the response type of an API method. For instance: service Foo { rpc - * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON - * representation for `Empty` is empty JSON object `{}`. - */ -export interface Schema$Empty {} -/** - * gdata - */ -export interface Schema$GdataBlobstore2Info { - /** - * gdata - */ - blobGeneration: string; - /** - * gdata - */ - blobId: string; - /** - * gdata - */ - downloadReadHandle: string; - /** - * gdata - */ - readToken: string; - /** - * gdata - */ - uploadMetadataContainer: string; -} -/** - * gdata - */ -export interface Schema$GdataCompositeMedia { - /** - * gdata - */ - blobRef: string; - /** - * gdata - */ - blobstore2Info: Schema$GdataBlobstore2Info; - /** - * gdata - */ - cosmoBinaryReference: string; - /** - * gdata - */ - crc32cHash: number; - /** - * gdata - */ - inline: string; - /** - * gdata - */ - length: string; - /** - * gdata - */ - md5Hash: string; - /** - * gdata - */ - objectId: Schema$GdataObjectId; - /** - * gdata - */ - path: string; - /** - * gdata - */ - referenceType: string; - /** - * gdata - */ - sha1Hash: string; -} -/** - * gdata - */ -export interface Schema$GdataContentTypeInfo { - /** - * gdata - */ - bestGuess: string; - /** - * gdata - */ - fromBytes: string; - /** - * gdata - */ - fromFileName: string; - /** - * gdata - */ - fromHeader: string; - /** - * gdata - */ - fromUrlPath: string; -} -/** - * gdata - */ -export interface Schema$GdataDiffChecksumsResponse { - /** - * gdata - */ - checksumsLocation: Schema$GdataCompositeMedia; - /** - * gdata - */ - chunkSizeBytes: string; - /** - * gdata - */ - objectLocation: Schema$GdataCompositeMedia; - /** - * gdata - */ - objectSizeBytes: string; - /** - * gdata - */ - objectVersion: string; -} -/** - * gdata - */ -export interface Schema$GdataDiffDownloadResponse { - /** - * gdata - */ - objectLocation: Schema$GdataCompositeMedia; -} -/** - * gdata - */ -export interface Schema$GdataDiffUploadRequest { - /** - * gdata - */ - checksumsInfo: Schema$GdataCompositeMedia; - /** - * gdata - */ - objectInfo: Schema$GdataCompositeMedia; - /** - * gdata - */ - objectVersion: string; -} -/** - * gdata - */ -export interface Schema$GdataDiffUploadResponse { - /** - * gdata - */ - objectVersion: string; - /** - * gdata - */ - originalObject: Schema$GdataCompositeMedia; -} -/** - * gdata - */ -export interface Schema$GdataDiffVersionResponse { - /** - * gdata - */ - objectSizeBytes: string; - /** - * gdata - */ - objectVersion: string; -} -/** - * gdata - */ -export interface Schema$GdataDownloadParameters { - /** - * gdata - */ - allowGzipCompression: boolean; - /** - * gdata - */ - ignoreRange: boolean; -} -/** - * gdata - */ -export interface Schema$GdataMedia { - /** - * gdata - */ - algorithm: string; - /** - * gdata - */ - bigstoreObjectRef: string; - /** - * gdata - */ - blobRef: string; - /** - * gdata - */ - blobstore2Info: Schema$GdataBlobstore2Info; - /** - * gdata - */ - compositeMedia: Schema$GdataCompositeMedia[]; - /** - * gdata - */ - contentType: string; - /** - * gdata - */ - contentTypeInfo: Schema$GdataContentTypeInfo; - /** - * gdata - */ - cosmoBinaryReference: string; - /** - * gdata - */ - crc32cHash: number; - /** - * gdata - */ - diffChecksumsResponse: Schema$GdataDiffChecksumsResponse; - /** - * gdata - */ - diffDownloadResponse: Schema$GdataDiffDownloadResponse; - /** - * gdata - */ - diffUploadRequest: Schema$GdataDiffUploadRequest; - /** - * gdata - */ - diffUploadResponse: Schema$GdataDiffUploadResponse; - /** - * gdata - */ - diffVersionResponse: Schema$GdataDiffVersionResponse; - /** - * gdata - */ - downloadParameters: Schema$GdataDownloadParameters; - /** - * gdata - */ - filename: string; - /** - * gdata - */ - hash: string; - /** - * gdata - */ - hashVerified: boolean; - /** - * gdata - */ - inline: string; - /** - * gdata - */ - isPotentialRetry: boolean; - /** - * gdata - */ - length: string; /** - * gdata - */ - md5Hash: string; - /** - * gdata - */ - mediaId: string; + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: service Foo { rpc + * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON + * representation for `Empty` is empty JSON object `{}`. + */ + export interface Schema$Empty {} + /** + * gdata + */ + export interface Schema$GdataBlobstore2Info { + /** + * gdata + */ + blobGeneration: string; + /** + * gdata + */ + blobId: string; + /** + * gdata + */ + downloadReadHandle: string; + /** + * gdata + */ + readToken: string; + /** + * gdata + */ + uploadMetadataContainer: string; + } /** * gdata */ - objectId: Schema$GdataObjectId; + export interface Schema$GdataCompositeMedia { + /** + * gdata + */ + blobRef: string; + /** + * gdata + */ + blobstore2Info: Schema$GdataBlobstore2Info; + /** + * gdata + */ + cosmoBinaryReference: string; + /** + * gdata + */ + crc32cHash: number; + /** + * gdata + */ + inline: string; + /** + * gdata + */ + length: string; + /** + * gdata + */ + md5Hash: string; + /** + * gdata + */ + objectId: Schema$GdataObjectId; + /** + * gdata + */ + path: string; + /** + * gdata + */ + referenceType: string; + /** + * gdata + */ + sha1Hash: string; + } /** * gdata */ - path: string; + export interface Schema$GdataContentTypeInfo { + /** + * gdata + */ + bestGuess: string; + /** + * gdata + */ + fromBytes: string; + /** + * gdata + */ + fromFileName: string; + /** + * gdata + */ + fromHeader: string; + /** + * gdata + */ + fromUrlPath: string; + } /** * gdata */ - referenceType: string; + export interface Schema$GdataDiffChecksumsResponse { + /** + * gdata + */ + checksumsLocation: Schema$GdataCompositeMedia; + /** + * gdata + */ + chunkSizeBytes: string; + /** + * gdata + */ + objectLocation: Schema$GdataCompositeMedia; + /** + * gdata + */ + objectSizeBytes: string; + /** + * gdata + */ + objectVersion: string; + } /** * gdata */ - sha1Hash: string; + export interface Schema$GdataDiffDownloadResponse { + /** + * gdata + */ + objectLocation: Schema$GdataCompositeMedia; + } /** * gdata */ - sha256Hash: string; + export interface Schema$GdataDiffUploadRequest { + /** + * gdata + */ + checksumsInfo: Schema$GdataCompositeMedia; + /** + * gdata + */ + objectInfo: Schema$GdataCompositeMedia; + /** + * gdata + */ + objectVersion: string; + } /** * gdata */ - timestamp: string; + export interface Schema$GdataDiffUploadResponse { + /** + * gdata + */ + objectVersion: string; + /** + * gdata + */ + originalObject: Schema$GdataCompositeMedia; + } /** * gdata */ - token: string; -} -/** - * gdata - */ -export interface Schema$GdataObjectId { + export interface Schema$GdataDiffVersionResponse { + /** + * gdata + */ + objectSizeBytes: string; + /** + * gdata + */ + objectVersion: string; + } /** * gdata */ - bucketName: string; + export interface Schema$GdataDownloadParameters { + /** + * gdata + */ + allowGzipCompression: boolean; + /** + * gdata + */ + ignoreRange: boolean; + } /** * gdata */ - generation: string; + export interface Schema$GdataMedia { + /** + * gdata + */ + algorithm: string; + /** + * gdata + */ + bigstoreObjectRef: string; + /** + * gdata + */ + blobRef: string; + /** + * gdata + */ + blobstore2Info: Schema$GdataBlobstore2Info; + /** + * gdata + */ + compositeMedia: Schema$GdataCompositeMedia[]; + /** + * gdata + */ + contentType: string; + /** + * gdata + */ + contentTypeInfo: Schema$GdataContentTypeInfo; + /** + * gdata + */ + cosmoBinaryReference: string; + /** + * gdata + */ + crc32cHash: number; + /** + * gdata + */ + diffChecksumsResponse: Schema$GdataDiffChecksumsResponse; + /** + * gdata + */ + diffDownloadResponse: Schema$GdataDiffDownloadResponse; + /** + * gdata + */ + diffUploadRequest: Schema$GdataDiffUploadRequest; + /** + * gdata + */ + diffUploadResponse: Schema$GdataDiffUploadResponse; + /** + * gdata + */ + diffVersionResponse: Schema$GdataDiffVersionResponse; + /** + * gdata + */ + downloadParameters: Schema$GdataDownloadParameters; + /** + * gdata + */ + filename: string; + /** + * gdata + */ + hash: string; + /** + * gdata + */ + hashVerified: boolean; + /** + * gdata + */ + inline: string; + /** + * gdata + */ + isPotentialRetry: boolean; + /** + * gdata + */ + length: string; + /** + * gdata + */ + md5Hash: string; + /** + * gdata + */ + mediaId: string; + /** + * gdata + */ + objectId: Schema$GdataObjectId; + /** + * gdata + */ + path: string; + /** + * gdata + */ + referenceType: string; + /** + * gdata + */ + sha1Hash: string; + /** + * gdata + */ + sha256Hash: string; + /** + * gdata + */ + timestamp: string; + /** + * gdata + */ + token: string; + } /** * gdata */ - objectName: string; -} -/** - * A job creating reports of a specific type. - */ -export interface Schema$Job { - /** - * The creation date/time of the job. - */ - createTime: string; - /** - * The date/time when this job will expire/expired. After a job expired, no - * new reports are generated. - */ - expireTime: string; - /** - * The server-generated ID of the job (max. 40 characters). - */ - id: string; - /** - * The name of the job (max. 100 characters). - */ - name: string; - /** - * The type of reports this job creates. Corresponds to the ID of a - * ReportType. - */ - reportTypeId: string; - /** - * True if this a system-managed job that cannot be modified by the user; - * otherwise false. - */ - systemManaged: boolean; -} -/** - * Response message for ReportingService.ListJobs. - */ -export interface Schema$ListJobsResponse { - /** - * The list of jobs. - */ - jobs: Schema$Job[]; - /** - * A token to retrieve next page of results. Pass this value in the - * ListJobsRequest.page_token field in the subsequent call to `ListJobs` - * method to retrieve the next page of results. - */ - nextPageToken: string; -} -/** - * Response message for ReportingService.ListReports. - */ -export interface Schema$ListReportsResponse { - /** - * A token to retrieve next page of results. Pass this value in the - * ListReportsRequest.page_token field in the subsequent call to `ListReports` - * method to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The list of report types. - */ - reports: Schema$Report[]; -} -/** - * Response message for ReportingService.ListReportTypes. - */ -export interface Schema$ListReportTypesResponse { - /** - * A token to retrieve next page of results. Pass this value in the - * ListReportTypesRequest.page_token field in the subsequent call to - * `ListReportTypes` method to retrieve the next page of results. - */ - nextPageToken: string; - /** - * The list of report types. - */ - reportTypes: Schema$ReportType[]; -} -/** - * A report's metadata including the URL from which the report itself can be - * downloaded. - */ -export interface Schema$Report { - /** - * The date/time when this report was created. - */ - createTime: string; - /** - * The URL from which the report can be downloaded (max. 1000 characters). - */ - downloadUrl: string; - /** - * The end of the time period that the report instance covers. The value is - * exclusive. - */ - endTime: string; - /** - * The server-generated ID of the report. - */ - id: string; - /** - * The date/time when the job this report belongs to will expire/expired. - */ - jobExpireTime: string; - /** - * The ID of the job that created this report. - */ - jobId: string; + export interface Schema$GdataObjectId { + /** + * gdata + */ + bucketName: string; + /** + * gdata + */ + generation: string; + /** + * gdata + */ + objectName: string; + } /** - * The start of the time period that the report instance covers. The value is - * inclusive. - */ - startTime: string; -} -/** - * A report type. - */ -export interface Schema$ReportType { + * A job creating reports of a specific type. + */ + export interface Schema$Job { + /** + * The creation date/time of the job. + */ + createTime: string; + /** + * The date/time when this job will expire/expired. After a job expired, no + * new reports are generated. + */ + expireTime: string; + /** + * The server-generated ID of the job (max. 40 characters). + */ + id: string; + /** + * The name of the job (max. 100 characters). + */ + name: string; + /** + * The type of reports this job creates. Corresponds to the ID of a + * ReportType. + */ + reportTypeId: string; + /** + * True if this a system-managed job that cannot be modified by the user; + * otherwise false. + */ + systemManaged: boolean; + } /** - * The date/time when this report type was/will be deprecated. - */ - deprecateTime: string; + * Response message for ReportingService.ListJobs. + */ + export interface Schema$ListJobsResponse { + /** + * The list of jobs. + */ + jobs: Schema$Job[]; + /** + * A token to retrieve next page of results. Pass this value in the + * ListJobsRequest.page_token field in the subsequent call to `ListJobs` + * method to retrieve the next page of results. + */ + nextPageToken: string; + } /** - * The ID of the report type (max. 100 characters). - */ - id: string; + * Response message for ReportingService.ListReports. + */ + export interface Schema$ListReportsResponse { + /** + * A token to retrieve next page of results. Pass this value in the + * ListReportsRequest.page_token field in the subsequent call to + * `ListReports` method to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The list of report types. + */ + reports: Schema$Report[]; + } /** - * The name of the report type (max. 100 characters). - */ - name: string; + * Response message for ReportingService.ListReportTypes. + */ + export interface Schema$ListReportTypesResponse { + /** + * A token to retrieve next page of results. Pass this value in the + * ListReportTypesRequest.page_token field in the subsequent call to + * `ListReportTypes` method to retrieve the next page of results. + */ + nextPageToken: string; + /** + * The list of report types. + */ + reportTypes: Schema$ReportType[]; + } /** - * True if this a system-managed report type; otherwise false. Reporting jobs - * for system-managed report types are created automatically and can thus not - * be used in the `CreateJob` method. - */ - systemManaged: boolean; -} - -export class Resource$Jobs { - root: Youtubereporting; - reports: Resource$Jobs$Reports; - constructor(root: Youtubereporting) { - this.root = root; - this.getRoot.bind(this); - this.reports = new Resource$Jobs$Reports(root); + * A report's metadata including the URL from which the report itself can + * be downloaded. + */ + export interface Schema$Report { + /** + * The date/time when this report was created. + */ + createTime: string; + /** + * The URL from which the report can be downloaded (max. 1000 characters). + */ + downloadUrl: string; + /** + * The end of the time period that the report instance covers. The value is + * exclusive. + */ + endTime: string; + /** + * The server-generated ID of the report. + */ + id: string; + /** + * The date/time when the job this report belongs to will expire/expired. + */ + jobExpireTime: string; + /** + * The ID of the job that created this report. + */ + jobId: string; + /** + * The start of the time period that the report instance covers. The value + * is inclusive. + */ + startTime: string; } - - getRoot() { - return this.root; + /** + * A report type. + */ + export interface Schema$ReportType { + /** + * The date/time when this report type was/will be deprecated. + */ + deprecateTime: string; + /** + * The ID of the report type (max. 100 characters). + */ + id: string; + /** + * The name of the report type (max. 100 characters). + */ + name: string; + /** + * True if this a system-managed report type; otherwise false. Reporting + * jobs for system-managed report types are created automatically and can + * thus not be used in the `CreateJob` method. + */ + systemManaged: boolean; } - - /** - * youtubereporting.jobs.create - * @desc Creates a job and returns it. - * @alias youtubereporting.jobs.create - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {().Job} params.resource Request body data - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - create(params?: any, options?: MethodOptions): AxiosPromise; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - create( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + export class Resource$Jobs { + root: Youtubereporting; + reports: Resource$Jobs$Reports; + constructor(root: Youtubereporting) { + this.root = root; + this.getRoot.bind(this); + this.reports = new Resource$Jobs$Reports(root); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'POST' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubereporting.jobs.delete - * @desc Deletes a job. - * @alias youtubereporting.jobs.delete - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The ID of the job to delete. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - delete(params?: any, options?: MethodOptions): AxiosPromise; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - delete( - params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubereporting.jobs.create + * @desc Creates a job and returns it. + * @alias youtubereporting.jobs.create + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {().Job} params.resource Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + create(params?: any, options?: MethodOptions): AxiosPromise; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + create( + params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs').replace(/([^:]\/)\/+/g, '$1'), + method: 'POST' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs/{jobId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'DELETE' - }, - options), - params, - requiredParams: ['jobId'], - pathParams: ['jobId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubereporting.jobs.get - * @desc Gets a job. - * @alias youtubereporting.jobs.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The ID of the job to retrieve. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubereporting.jobs.delete + * @desc Deletes a job. + * @alias youtubereporting.jobs.delete + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The ID of the job to delete. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + delete(params?: any, options?: MethodOptions): AxiosPromise; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + delete( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs/{jobId}').replace(/([^:]\/)\/+/g, '$1'), + method: 'DELETE' + }, + options), + params, + requiredParams: ['jobId'], + pathParams: ['jobId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs/{jobId}').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['jobId'], - pathParams: ['jobId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } - /** - * youtubereporting.jobs.list - * @desc Lists jobs. - * @alias youtubereporting.jobs.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeSystemManaged If set to true, also system-managed jobs will be returned; otherwise only user-created jobs will be returned. System-managed jobs can neither be modified nor deleted. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {integer=} params.pageSize Requested page size. Server may return fewer jobs than requested. If unspecified, server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListJobs` method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubereporting.jobs.get + * @desc Gets a job. + * @alias youtubereporting.jobs.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The ID of the job to retrieve. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs/{jobId}').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['jobId'], + pathParams: ['jobId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Jobs$Reports { - root: Youtubereporting; - constructor(root: Youtubereporting) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; - } - - /** - * youtubereporting.jobs.reports.get - * @desc Gets the metadata of a specific report. - * @alias youtubereporting.jobs.reports.get - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.jobId The ID of the job. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {string} params.reportId The ID of the report to retrieve. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - get(params?: any, options?: MethodOptions): AxiosPromise; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - get(params?: any, options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + /** + * youtubereporting.jobs.list + * @desc Lists jobs. + * @alias youtubereporting.jobs.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeSystemManaged If set to true, also system-managed jobs will be returned; otherwise only user-created jobs will be returned. System-managed jobs can neither be modified nor deleted. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {integer=} params.pageSize Requested page size. Server may return fewer jobs than requested. If unspecified, server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListJobs` method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - if (typeof params === 'function') { - callback = params; - params = {}; + } + export class Resource$Jobs$Reports { + root: Youtubereporting; + constructor(root: Youtubereporting) { + this.root = root; + this.getRoot.bind(this); } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs/{jobId}/reports/{reportId}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['jobId', 'reportId'], - pathParams: ['jobId', 'reportId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } - /** - * youtubereporting.jobs.reports.list - * @desc Lists reports created by a specific job. Returns NOT_FOUND if the job - * does not exist. - * @alias youtubereporting.jobs.reports.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string=} params.createdAfter If set, only reports created after the specified date/time are returned. - * @param {string} params.jobId The ID of the job. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {integer=} params.pageSize Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportsResponse.next_page_token returned in response to the previous call to the `ListReports` method. - * @param {string=} params.startTimeAtOrAfter If set, only reports whose start time is greater than or equal the specified date/time are returned. - * @param {string=} params.startTimeBefore If set, only reports whose start time is smaller than the specified date/time are returned. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; - } - if (typeof params === 'function') { - callback = params; - params = {}; + /** + * youtubereporting.jobs.reports.get + * @desc Gets the metadata of a specific report. + * @alias youtubereporting.jobs.reports.get + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.jobId The ID of the job. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {string} params.reportId The ID of the report to retrieve. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + get(params?: any, options?: MethodOptions): AxiosPromise; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + get(params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs/{jobId}/reports/{reportId}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['jobId', 'reportId'], + pathParams: ['jobId', 'reportId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/jobs/{jobId}/reports') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['jobId'], - pathParams: ['jobId'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); - } - } -} -export class Resource$Media { - root: Youtubereporting; - constructor(root: Youtubereporting) { - this.root = root; - this.getRoot.bind(this); - } - - getRoot() { - return this.root; + /** + * youtubereporting.jobs.reports.list + * @desc Lists reports created by a specific job. Returns NOT_FOUND if the + * job does not exist. + * @alias youtubereporting.jobs.reports.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string=} params.createdAfter If set, only reports created after the specified date/time are returned. + * @param {string} params.jobId The ID of the job. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {integer=} params.pageSize Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportsResponse.next_page_token returned in response to the previous call to the `ListReports` method. + * @param {string=} params.startTimeAtOrAfter If set, only reports whose start time is greater than or equal the specified date/time are returned. + * @param {string=} params.startTimeBefore If set, only reports whose start time is smaller than the specified date/time are returned. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/jobs/{jobId}/reports') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['jobId'], + pathParams: ['jobId'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - /** - * youtubereporting.media.download - * @desc Method for media download. Download is supported on the URI - * `/v1/media/{+name}?alt=media`. - * @alias youtubereporting.media.download - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {string} params.resourceName Name of the media that is being downloaded. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - download(params?: any, options?: MethodOptions): - AxiosPromise; - download( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): void; - download( - params?: any, - options?: MethodOptions|BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Media { + root: Youtubereporting; + constructor(root: Youtubereporting) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; - } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/media/{+resourceName}') - .replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: ['resourceName'], - pathParams: ['resourceName'], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + getRoot() { + return this.root; } - } -} -export class Resource$Reporttypes { - root: Youtubereporting; - constructor(root: Youtubereporting) { - this.root = root; - this.getRoot.bind(this); - } - getRoot() { - return this.root; + /** + * youtubereporting.media.download + * @desc Method for media download. Download is supported on the URI + * `/v1/media/{+name}?alt=media`. + * @alias youtubereporting.media.download + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.resourceName Name of the media that is being downloaded. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + download(params?: any, options?: MethodOptions): + AxiosPromise; + download( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): void; + download( + params?: any, + options?: MethodOptions|BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/media/{+resourceName}') + .replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: ['resourceName'], + pathParams: ['resourceName'], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } + } } - - /** - * youtubereporting.reportTypes.list - * @desc Lists report types. - * @alias youtubereporting.reportTypes.list - * @memberOf! () - * - * @param {object} params Parameters for request - * @param {boolean=} params.includeSystemManaged If set to true, also system-managed report types will be returned; otherwise only the report types that can be used to create new reporting jobs will be returned. - * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). - * @param {integer=} params.pageSize Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. - * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListReportTypes` method. - * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. - * @param {callback} callback The callback that handles the response. - * @return {object} Request object - */ - list(params?: any, options?: MethodOptions): - AxiosPromise; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): void; - list( - params?: any, - options?: MethodOptions| - BodyResponseCallback, - callback?: BodyResponseCallback): - void|AxiosPromise { - if (typeof options === 'function') { - callback = options; - options = {}; + export class Resource$Reporttypes { + root: Youtubereporting; + constructor(root: Youtubereporting) { + this.root = root; + this.getRoot.bind(this); } - if (typeof params === 'function') { - callback = params; - params = {}; + + getRoot() { + return this.root; } - options = options || {}; - const rootUrl = - options.rootUrl || 'https://youtubereporting.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/reportTypes').replace(/([^:]\/)\/+/g, '$1'), - method: 'GET' - }, - options), - params, - requiredParams: [], - pathParams: [], - context: this.getRoot() - }; - if (callback) { - createAPIRequest(parameters, callback); - } else { - return createAPIRequest(parameters); + + + /** + * youtubereporting.reportTypes.list + * @desc Lists report types. + * @alias youtubereporting.reportTypes.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {boolean=} params.includeSystemManaged If set to true, also system-managed report types will be returned; otherwise only the report types that can be used to create new reporting jobs will be returned. + * @param {string=} params.onBehalfOfContentOwner The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + * @param {integer=} params.pageSize Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. + * @param {string=} params.pageToken A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListReportTypes` method. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list(params?: any, options?: MethodOptions): + AxiosPromise; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): void; + list( + params?: any, + options?: MethodOptions| + BodyResponseCallback, + callback?: BodyResponseCallback): + void|AxiosPromise { + if (typeof options === 'function') { + callback = options; + options = {}; + } + if (typeof params === 'function') { + callback = params; + params = {}; + } + options = options || {}; + const rootUrl = + options.rootUrl || 'https://youtubereporting.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/reportTypes').replace(/([^:]\/)\/+/g, '$1'), + method: 'GET' + }, + options), + params, + requiredParams: [], + pathParams: [], + context: this.getRoot() + }; + if (callback) { + createAPIRequest(parameters, callback); + } else { + return createAPIRequest(parameters); + } } } } diff --git a/src/index.ts b/src/index.ts index 5b34c128822..c653b7f1da0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,208 @@ * limitations under the License. */ +/*! THIS FILE IS AUTO-GENERATED */ + import {GoogleApis} from './lib/googleapis'; const google = new GoogleApis(); export {google, GoogleApis}; + +export {abusiveexperiencereport_v1} from './apis/abusiveexperiencereport/v1'; +export {acceleratedmobilepageurl_v1} from './apis/acceleratedmobilepageurl/v1'; +export {adexchangebuyer_v1_2} from './apis/adexchangebuyer/v1.2'; +export {adexchangebuyer_v1_3} from './apis/adexchangebuyer/v1.3'; +export {adexchangebuyer_v1_4} from './apis/adexchangebuyer/v1.4'; +export {adexchangebuyer2_v2beta1} from './apis/adexchangebuyer2/v2beta1'; +export {adexchangeseller_v1_1} from './apis/adexchangeseller/v1.1'; +export {adexchangeseller_v1} from './apis/adexchangeseller/v1'; +export {adexchangeseller_v2_0} from './apis/adexchangeseller/v2.0'; +export {adexperiencereport_v1} from './apis/adexperiencereport/v1'; +export {admin_datatransfer_v1} from './apis/admin/datatransfer_v1'; +export {admin_directory_v1} from './apis/admin/directory_v1'; +export {admin_reports_v1} from './apis/admin/reports_v1'; +export {adsense_v1_4} from './apis/adsense/v1.4'; +export {adsensehost_v4_1} from './apis/adsensehost/v4.1'; +export {analytics_v2_4} from './apis/analytics/v2.4'; +export {analytics_v3} from './apis/analytics/v3'; +export {analyticsreporting_v4} from './apis/analyticsreporting/v4'; +export {androiddeviceprovisioning_v1} from './apis/androiddeviceprovisioning/v1'; +export {androidenterprise_v1} from './apis/androidenterprise/v1'; +export {androidmanagement_v1} from './apis/androidmanagement/v1'; +export {androidpublisher_v1_1} from './apis/androidpublisher/v1.1'; +export {androidpublisher_v1} from './apis/androidpublisher/v1'; +export {androidpublisher_v2} from './apis/androidpublisher/v2'; +export {appengine_v1} from './apis/appengine/v1'; +export {appengine_v1alpha} from './apis/appengine/v1alpha'; +export {appengine_v1beta} from './apis/appengine/v1beta'; +export {appengine_v1beta4} from './apis/appengine/v1beta4'; +export {appengine_v1beta5} from './apis/appengine/v1beta5'; +export {appsactivity_v1} from './apis/appsactivity/v1'; +export {appstate_v1} from './apis/appstate/v1'; +export {bigquery_v2} from './apis/bigquery/v2'; +export {bigquerydatatransfer_v1} from './apis/bigquerydatatransfer/v1'; +export {blogger_v2} from './apis/blogger/v2'; +export {blogger_v3} from './apis/blogger/v3'; +export {books_v1} from './apis/books/v1'; +export {calendar_v3} from './apis/calendar/v3'; +export {chat_v1} from './apis/chat/v1'; +export {civicinfo_v2} from './apis/civicinfo/v2'; +export {classroom_v1} from './apis/classroom/v1'; +export {cloudbilling_v1} from './apis/cloudbilling/v1'; +export {cloudbuild_v1} from './apis/cloudbuild/v1'; +export {clouddebugger_v2} from './apis/clouddebugger/v2'; +export {clouderrorreporting_v1beta1} from './apis/clouderrorreporting/v1beta1'; +export {cloudfunctions_v1} from './apis/cloudfunctions/v1'; +export {cloudfunctions_v1beta2} from './apis/cloudfunctions/v1beta2'; +export {cloudiot_v1} from './apis/cloudiot/v1'; +export {cloudkms_v1} from './apis/cloudkms/v1'; +export {cloudresourcemanager_v1} from './apis/cloudresourcemanager/v1'; +export {cloudresourcemanager_v1beta1} from './apis/cloudresourcemanager/v1beta1'; +export {cloudresourcemanager_v2} from './apis/cloudresourcemanager/v2'; +export {cloudresourcemanager_v2beta1} from './apis/cloudresourcemanager/v2beta1'; +export {cloudshell_v1} from './apis/cloudshell/v1'; +export {cloudshell_v1alpha1} from './apis/cloudshell/v1alpha1'; +export {cloudtasks_v2beta2} from './apis/cloudtasks/v2beta2'; +export {cloudtrace_v1} from './apis/cloudtrace/v1'; +export {cloudtrace_v2} from './apis/cloudtrace/v2'; +export {compute_alpha} from './apis/compute/alpha'; +export {compute_beta} from './apis/compute/beta'; +export {compute_v1} from './apis/compute/v1'; +export {container_v1} from './apis/container/v1'; +export {container_v1beta1} from './apis/container/v1beta1'; +export {content_v2} from './apis/content/v2'; +export {content_v2sandbox} from './apis/content/v2sandbox'; +export {customsearch_v1} from './apis/customsearch/v1'; +export {dataflow_v1b3} from './apis/dataflow/v1b3'; +export {dataproc_v1} from './apis/dataproc/v1'; +export {dataproc_v1beta2} from './apis/dataproc/v1beta2'; +export {datastore_v1} from './apis/datastore/v1'; +export {datastore_v1beta1} from './apis/datastore/v1beta1'; +export {datastore_v1beta3} from './apis/datastore/v1beta3'; +export {deploymentmanager_alpha} from './apis/deploymentmanager/alpha'; +export {deploymentmanager_v2} from './apis/deploymentmanager/v2'; +export {deploymentmanager_v2beta} from './apis/deploymentmanager/v2beta'; +export {dfareporting_v2_8} from './apis/dfareporting/v2.8'; +export {dfareporting_v3_0} from './apis/dfareporting/v3.0'; +export {dialogflow_v2} from './apis/dialogflow/v2'; +export {dialogflow_v2beta1} from './apis/dialogflow/v2beta1'; +export {digitalassetlinks_v1} from './apis/digitalassetlinks/v1'; +export {discovery_v1} from './apis/discovery/v1'; +export {dlp_v2} from './apis/dlp/v2'; +export {dlp_v2beta1} from './apis/dlp/v2beta1'; +export {dlp_v2beta2} from './apis/dlp/v2beta2'; +export {dns_v1} from './apis/dns/v1'; +export {dns_v1beta2} from './apis/dns/v1beta2'; +export {dns_v2beta1} from './apis/dns/v2beta1'; +export {doubleclickbidmanager_v1} from './apis/doubleclickbidmanager/v1'; +export {doubleclicksearch_v2} from './apis/doubleclicksearch/v2'; +export {drive_v2} from './apis/drive/v2'; +export {drive_v3} from './apis/drive/v3'; +export {firebasedynamiclinks_v1} from './apis/firebasedynamiclinks/v1'; +export {firebaserules_v1} from './apis/firebaserules/v1'; +export {firestore_v1beta1} from './apis/firestore/v1beta1'; +export {fitness_v1} from './apis/fitness/v1'; +export {fusiontables_v1} from './apis/fusiontables/v1'; +export {fusiontables_v2} from './apis/fusiontables/v2'; +export {games_v1} from './apis/games/v1'; +export {gamesConfiguration_v1configuration} from './apis/gamesConfiguration/v1configuration'; +export {gamesManagement_v1management} from './apis/gamesManagement/v1management'; +export {genomics_v1} from './apis/genomics/v1'; +export {genomics_v1alpha2} from './apis/genomics/v1alpha2'; +export {genomics_v2alpha1} from './apis/genomics/v2alpha1'; +export {gmail_v1} from './apis/gmail/v1'; +export {groupsmigration_v1} from './apis/groupsmigration/v1'; +export {groupssettings_v1} from './apis/groupssettings/v1'; +export {iam_v1} from './apis/iam/v1'; +export {identitytoolkit_v3} from './apis/identitytoolkit/v3'; +export {kgsearch_v1} from './apis/kgsearch/v1'; +export {language_v1} from './apis/language/v1'; +export {language_v1beta1} from './apis/language/v1beta1'; +export {language_v1beta2} from './apis/language/v1beta2'; +export {licensing_v1} from './apis/licensing/v1'; +export {logging_v2} from './apis/logging/v2'; +export {logging_v2beta1} from './apis/logging/v2beta1'; +export {manufacturers_v1} from './apis/manufacturers/v1'; +export {mirror_v1} from './apis/mirror/v1'; +export {ml_v1} from './apis/ml/v1'; +export {monitoring_v3} from './apis/monitoring/v3'; +export {oauth2_v1} from './apis/oauth2/v1'; +export {oauth2_v2} from './apis/oauth2/v2'; +export {oslogin_v1} from './apis/oslogin/v1'; +export {oslogin_v1alpha} from './apis/oslogin/v1alpha'; +export {oslogin_v1beta} from './apis/oslogin/v1beta'; +export {pagespeedonline_v1} from './apis/pagespeedonline/v1'; +export {pagespeedonline_v2} from './apis/pagespeedonline/v2'; +export {pagespeedonline_v4} from './apis/pagespeedonline/v4'; +export {partners_v2} from './apis/partners/v2'; +export {people_v1} from './apis/people/v1'; +export {playcustomapp_v1} from './apis/playcustomapp/v1'; +export {plus_v1} from './apis/plus/v1'; +export {plusDomains_v1} from './apis/plusDomains/v1'; +export {poly_v1} from './apis/poly/v1'; +export {prediction_v1_2} from './apis/prediction/v1.2'; +export {prediction_v1_3} from './apis/prediction/v1.3'; +export {prediction_v1_4} from './apis/prediction/v1.4'; +export {prediction_v1_5} from './apis/prediction/v1.5'; +export {prediction_v1_6} from './apis/prediction/v1.6'; +export {proximitybeacon_v1beta1} from './apis/proximitybeacon/v1beta1'; +export {pubsub_v1} from './apis/pubsub/v1'; +export {pubsub_v1beta1a} from './apis/pubsub/v1beta1a'; +export {pubsub_v1beta2} from './apis/pubsub/v1beta2'; +export {replicapool_v1beta1} from './apis/replicapool/v1beta1'; +export {replicapool_v1beta2} from './apis/replicapool/v1beta2'; +export {replicapoolupdater_v1beta1} from './apis/replicapoolupdater/v1beta1'; +export {reseller_v1} from './apis/reseller/v1'; +export {resourceviews_v1beta1} from './apis/resourceviews/v1beta1'; +export {resourceviews_v1beta2} from './apis/resourceviews/v1beta2'; +export {runtimeconfig_v1} from './apis/runtimeconfig/v1'; +export {runtimeconfig_v1beta1} from './apis/runtimeconfig/v1beta1'; +export {safebrowsing_v4} from './apis/safebrowsing/v4'; +export {script_v1} from './apis/script/v1'; +export {searchconsole_v1} from './apis/searchconsole/v1'; +export {serviceconsumermanagement_v1} from './apis/serviceconsumermanagement/v1'; +export {servicecontrol_v1} from './apis/servicecontrol/v1'; +export {servicemanagement_v1} from './apis/servicemanagement/v1'; +export {serviceusage_v1beta1} from './apis/serviceusage/v1beta1'; +export {serviceuser_v1} from './apis/serviceuser/v1'; +export {sheets_v4} from './apis/sheets/v4'; +export {siteVerification_v1} from './apis/siteVerification/v1'; +export {slides_v1} from './apis/slides/v1'; +export {sourcerepo_v1} from './apis/sourcerepo/v1'; +export {spanner_v1} from './apis/spanner/v1'; +export {spectrum_v1explorer} from './apis/spectrum/v1explorer'; +export {speech_v1} from './apis/speech/v1'; +export {speech_v1beta1} from './apis/speech/v1beta1'; +export {sqladmin_v1beta3} from './apis/sqladmin/v1beta3'; +export {sqladmin_v1beta4} from './apis/sqladmin/v1beta4'; +export {storage_v1} from './apis/storage/v1'; +export {storage_v1beta1} from './apis/storage/v1beta1'; +export {storage_v1beta2} from './apis/storage/v1beta2'; +export {storagetransfer_v1} from './apis/storagetransfer/v1'; +export {streetviewpublish_v1} from './apis/streetviewpublish/v1'; +export {surveys_v2} from './apis/surveys/v2'; +export {tagmanager_v1} from './apis/tagmanager/v1'; +export {tagmanager_v2} from './apis/tagmanager/v2'; +export {taskqueue_v1beta1} from './apis/taskqueue/v1beta1'; +export {taskqueue_v1beta2} from './apis/taskqueue/v1beta2'; +export {tasks_v1} from './apis/tasks/v1'; +export {testing_v1} from './apis/testing/v1'; +export {texttospeech_v1beta1} from './apis/texttospeech/v1beta1'; +export {toolresults_v1beta3} from './apis/toolresults/v1beta3'; +export {tpu_v1alpha1} from './apis/tpu/v1alpha1'; +export {translate_v2} from './apis/translate/v2'; +export {urlshortener_v1} from './apis/urlshortener/v1'; +export {vault_v1} from './apis/vault/v1'; +export {videointelligence_v1} from './apis/videointelligence/v1'; +export {videointelligence_v1beta1} from './apis/videointelligence/v1beta1'; +export {videointelligence_v1beta2} from './apis/videointelligence/v1beta2'; +export {vision_v1} from './apis/vision/v1'; +export {vision_v1p1beta1} from './apis/vision/v1p1beta1'; +export {vision_v1p2beta1} from './apis/vision/v1p2beta1'; +export {webfonts_v1} from './apis/webfonts/v1'; +export {webmasters_v3} from './apis/webmasters/v3'; +export {websecurityscanner_v1alpha} from './apis/websecurityscanner/v1alpha'; +export {youtube_v3} from './apis/youtube/v3'; +export {youtubeAnalytics_v1} from './apis/youtubeAnalytics/v1'; +export {youtubeAnalytics_v1beta1} from './apis/youtubeAnalytics/v1beta1'; +export {youtubeAnalytics_v2} from './apis/youtubeAnalytics/v2'; +export {youtubereporting_v1} from './apis/youtubereporting/v1'; diff --git a/src/scripts/generator.ts b/src/scripts/generator.ts index 3b422d9cd34..2860bcd6946 100644 --- a/src/scripts/generator.ts +++ b/src/scripts/generator.ts @@ -214,6 +214,7 @@ export class Generator { const apis: {[index: string]: {[index: string]: string}} = {}; const apisPath = path.join(srcPath, 'apis'); const indexPath = path.join(apisPath, 'index.ts'); + const rootIndexPath = path.join(apisPath, '../', 'index.ts'); // Dynamically discover available APIs const files: string[] = await fsp.readdir(apisPath); @@ -231,8 +232,12 @@ export class Generator { } } } + const result = this.env.render('index.njk', {apis}); await fsp.writeFile(indexPath, result, {encoding: 'utf8'}); + + const res2 = this.env.render('root-index.njk', {apis}); + await fsp.writeFile(rootIndexPath, res2, {encoding: 'utf8'}); } /** diff --git a/src/templates/api-endpoint.njk b/src/templates/api-endpoint.njk index 0252fe7bfdc..b8127844454 100644 --- a/src/templates/api-endpoint.njk +++ b/src/templates/api-endpoint.njk @@ -30,6 +30,9 @@ import {AxiosPromise} from 'axios'; // tslint:disable: class-name // tslint:disable: variable-name // tslint:disable: jsdoc-format +// tslint:disable: no-namespace + +export namespace {{api.name}}_{{api.version|replace('\.', '_')}} { {% set Name = api.name|capitalize %} {% if api.version %} @@ -116,3 +119,5 @@ export interface Schema${{ schema.id }} { {% endif %} {{ resource.render(api, api, 'Resource$') }} + +} diff --git a/src/templates/index.njk b/src/templates/index.njk index 5710055fcbe..b0931f9db5a 100644 --- a/src/templates/index.njk +++ b/src/templates/index.njk @@ -17,7 +17,7 @@ import * as path from 'path'; import * as util from 'util'; import { ServiceOptions } from '../lib/api'; {% for apiName, api in apis %} - {% for versionName, version in api %}import * as {{ apiName }}_{{ version|replace('.','_') }} from './{{ apiName }}/{{ version }}'; + {% for versionName, version in api %}import { {{ apiName }}_{{ version|replace('.','_') }} } from './{{ apiName }}/{{ version }}'; {% endfor %} {% endfor %} diff --git a/src/templates/root-index.njk b/src/templates/root-index.njk new file mode 100644 index 00000000000..c26f25e8a6b --- /dev/null +++ b/src/templates/root-index.njk @@ -0,0 +1,26 @@ +/** + * Copyright 2017 Google Inc. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /*! THIS FILE IS AUTO-GENERATED */ + +import {GoogleApis} from './lib/googleapis'; +const google = new GoogleApis(); +export {google, GoogleApis}; + +{% for apiName, api in apis %} + {% for versionName, version in api %}export { {{ apiName }}_{{ version|replace('.','_') }} } from './apis/{{ apiName }}/{{ version }}'; +{% endfor %} +{% endfor %} diff --git a/test/test.clients.ts b/test/test.clients.ts index 85200bbf334..003fd79b2c9 100644 --- a/test/test.clients.ts +++ b/test/test.clients.ts @@ -17,8 +17,7 @@ import * as nock from 'nock'; import * as path from 'path'; import * as url from 'url'; -import {GoogleApis} from '../src'; -import {Datastore} from '../src/apis/datastore/v1'; +import {datastore_v1, GoogleApis} from '../src'; import {APIEndpoint} from '../src/lib/api'; import {Utils} from './utils'; @@ -93,8 +92,8 @@ describe('Clients', () => { it('should support default params', async () => { const google = new GoogleApis(); - const datastore = - google.datastore({version: 'v1', params: {myParam: '123'}}); + const datastore = google.datastore( + {version: 'v1', params: {myParam: '123'}}); createNock('myParam=123'); const res = await datastore.projects.lookup({projectId: 'test-project-id'}); // If the default param handling is broken, query might be undefined, thus @@ -119,8 +118,8 @@ describe('Clients', () => { it('should allow default params to be overriden per-request', async () => { const google = new GoogleApis(); - const datastore = - google.datastore({version: 'v1', params: {myParam: '123'}}); + const datastore = google.datastore( + {version: 'v1', params: {myParam: '123'}}); // Override the default datasetId param for this particular API call createNock('myParam=456'); const res = await datastore.projects.lookup( @@ -153,7 +152,7 @@ describe('Clients', () => { it('should include default params when only callback is provided to API call', async () => { const google = new GoogleApis(); - const datastore = google.datastore({ + const datastore = google.datastore({ version: 'v1', params: { // We must set this here - it is a required param